@northflank/cli 0.10.7 → 0.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-helpers.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/contextCommands.js +1 -1
- package/dist/copy/index.js +1 -1
- package/dist/defaults.js +1 -1
- package/dist/exec/index.js +1 -1
- package/dist/formatting/command-overview.js +1 -1
- package/dist/formatting/console-format-helpers.js +1 -1
- package/dist/formatting/terminal-chart.js +1 -1
- package/dist/inquirer-helper.js +1 -1
- package/dist/login/browser-login.js +1 -1
- package/dist/logs/index.js +1 -1
- package/dist/logs/log-formatter.js +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/pagination/inquirer-pagination-prompt.js +1 -1
- package/dist/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +17 -19
- package/postinstall.js +0 -16
package/dist/api-helpers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0I3=a0B;(function(I,B){const I2=a0B,J=I();while(!![]){try{const C=-parseInt(I2(0x89))/0x1*(parseInt(I2(0xae))/0x2)+parseInt(I2(0x8e))/0x3*(parseInt(I2(0x71))/0x4)+-parseInt(I2(0xa1))/0x5*(parseInt(I2(0x7c))/0x6)+-parseInt(I2(0x8d))/0x7*(parseInt(I2(0x8a))/0x8)+-parseInt(I2(0x91))/0x9*(parseInt(I2(0x96))/0xa)+-parseInt(I2(0xa4))/0xb+parseInt(I2(0x94))/0xc;if(C===B)break;else J['push'](J['shift']());}catch(G){J['push'](J['shift']());}}}(a0I,0x23521));function a0I(){const IF=['2491EjgQMc','856IdkEWQ','addonTypes','backups','7931YYpjkD','3oCBozY','length','latest','372024iGxold','map','projects','7846704hyQjbo','versions','40HOiMva','types','secret','secretLink','replicas','logSink','registryCredentials','then','data','default','keys','374210VBDIbN','defineProperty','credentials','2778094uYXUOH','throw','fetchResourceList','version','__esModule','done','regions','plans','includes','serviceId','2GMbedc','storage','find','resources','nextPageCursor','__awaiter','./utils','428972qeAAIA','projectId','apply','options','services','addonDependencies','get','cursor','addon','next','internalId','6zQDZks','pagination','warning','templateId','keyName','deploymentPlan','list','No\x20available\x20versions\x20to\x20upgrade\x20to.','addonId','value','templates','type','source'];a0I=function(){return IF;};return a0I();}var __awaiter=this&&this[a0I3(0x6f)]||function(I,B,J,C){function G(F){return F instanceof J?F:new J(function(A){A(F);});}return new(J||(J=Promise))(function(F,A){const I7=a0B;function H(X){const I4=a0B;try{d(C[I4(0x7a)](X));}catch(S){A(S);}}function t(X){const I5=a0B;try{d(C[I5(0xa5)](X));}catch(S){A(S);}}function d(X){const I6=a0B;X[I6(0xa9)]?F(X['value']):G(X[I6(0x85)])[I6(0x9d)](H,t);}d((C=C[I7(0x73)](I,B||[]))[I7(0x7a)]());});};Object[a0I3(0xa2)](exports,a0I3(0xa8),{'value':!![]}),exports[a0I3(0xa6)]=fetchResourceList;const utils_1=require(a0I3(0x70)),defaultPaginationPageSize=0x64,getProjects=I=>B=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const I8=a0I3;var J;const C=yield I[I8(0x82)]['projects']({'options':{'per_page':defaultPaginationPageSize,'cursor':B===null||B===void 0x0?void 0x0:B[I8(0xb2)]}});return{'elements':C[I8(0x9e)][I8(0x93)][I8(0x92)](G=>G['id']),'nextPageCursor':(J=C['pagination'])===null||J===void 0x0?void 0x0:J[I8(0x78)]};}),getServices=(I,B)=>J=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const I9=a0I3;var C;const G=yield I['list'][I9(0x75)]({'parameters':{'projectId':B},'options':{'per_page':defaultPaginationPageSize,'cursor':J===null||J===void 0x0?void 0x0:J[I9(0xb2)]}});return{'elements':G['data'][I9(0x75)][I9(0x92)](F=>F['id']),'nextPageCursor':(C=G[I9(0x7d)])===null||C===void 0x0?void 0x0:C[I9(0x78)]};}),getAddons=(I,B)=>J=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const II=a0I3;var C;const G=yield I[II(0x82)]['addons']({'parameters':{'projectId':B},'options':{'per_page':defaultPaginationPageSize,'cursor':J===null||J===void 0x0?void 0x0:J[II(0xb2)]}});return{'elements':G[II(0x9e)]['addons'][II(0x92)](F=>F['id']),'nextPageCursor':(C=G['pagination'])===null||C===void 0x0?void 0x0:C[II(0x78)]};}),getAddonBackups=(I,B,J)=>C=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const IB=a0I3;var G;const F=yield I['get'][IB(0x79)]['backups']({'parameters':{'projectId':B,'addonId':J},'options':{'per_page':defaultPaginationPageSize,'cursor':C===null||C===void 0x0?void 0x0:C['nextPageCursor']}});return{'elements':F['data'][IB(0x8c)][IB(0x92)](A=>A['id']),'nextPageCursor':(G=F[IB(0x7d)])===null||G===void 0x0?void 0x0:G[IB(0x78)]};});function a0B(I,B){const J=a0I();return a0B=function(C,G){C=C-0x6f;let F=J[C];return F;},a0B(I,B);}function fetchResourceList(I,B,J,C,G,F){return __awaiter(this,void 0x0,void 0x0,function*(){const IJ=a0B;var A,H,t,d,X,S,f,v,a,V,r,s;const K=undefined;try{if(I===IJ(0x81)){const q=yield B['list'][IJ(0xab)]({}),x=q[IJ(0x9e)][IJ(0xab)][IJ(0x92)](g=>{const IC=IJ;var o;return(o=g===null||g===void 0x0?void 0x0:g[IC(0x7b)])!==null&&o!==void 0x0?o:g===null||g===void 0x0?void 0x0:g['id'];});return{'choices':x,'defaultValue':K};}if(I==='region'&&!(J===null||J===void 0x0?void 0x0:J[IJ(0xac)](IJ(0x9b)))){const g=yield B['list'][IJ(0xaa)]({}),o=g[IJ(0x9e)][IJ(0xaa)]['map'](O=>{var p;return(p=O===null||O===void 0x0?void 0x0:O['internalId'])!==null&&p!==void 0x0?p:O===null||O===void 0x0?void 0x0:O['id'];});return{'choices':o,'defaultValue':K};}if(I==='projectId'){const O=yield getProjects(B),{elements:p,nextPageCursor:w}=yield O();return{'choices':p,'defaultValue':K,'pagination':{'nextPageCursor':w,'loadMore':O}};}if(I==='credentials'){const Z=yield B[IJ(0x82)][IJ(0x9c)]({}),z=Z['data']['credentials'][IJ(0x92)](Q=>Q['id']);return{'choices':z,'defaultValue':K};}const b=G===null||G===void 0x0?void 0x0:G['projectId'],W=I===IJ(0xad)||I==='id'&&(F===null||F===void 0x0?void 0x0:F[IJ(0xac)]('owningObject'));if(b!==undefined&&W){const Q=yield getServices(B,b),{elements:c,nextPageCursor:l}=yield Q();return{'choices':c,'defaultValue':K,'pagination':{'nextPageCursor':l,'loadMore':Q}};}const u=J===null||J===void 0x0?void 0x0:J['includes'](IJ(0x79));if(u){const n=m=>__awaiter(this,void 0x0,void 0x0,function*(){const IG=IJ;var E;const j=yield B[IG(0x77)][IG(0x79)]['types']({});return(E=j[IG(0x9e)]['addonTypes'])===null||E===void 0x0?void 0x0:E[IG(0x92)](U=>U[IG(0x87)])[IG(0xb0)](U=>U[IG(0x87)]===m);});if(I===IJ(0x87)){const m=yield B[IJ(0x77)][IJ(0x79)][IJ(0x97)]({}),E=(A=m[IJ(0x9e)][IJ(0x8b)])===null||A===void 0x0?void 0x0:A[IJ(0x92)](j=>j['type']);return{'choices':E,'defaultValue':K};}if(I===IJ(0xa7)&&(C===null||C===void 0x0?void 0x0:C['type'])!==undefined){const j=(H=yield n(C['type']))===null||H===void 0x0?void 0x0:H[IJ(0x95)],U=j!==undefined?[IJ(0x90),...j]:undefined;return{'choices':U,'defaultValue':K};}if(I===IJ(0xaf)&&(C===null||C===void 0x0?void 0x0:C[IJ(0x87)])!==undefined){const D=(d=(t=yield n(C[IJ(0x87)]))===null||t===void 0x0?void 0x0:t[IJ(0xb1)])===null||d===void 0x0?void 0x0:d['storage'];return{'choices':D===null||D===void 0x0?void 0x0:D[IJ(0x74)],'defaultValue':D===null||D===void 0x0?void 0x0:D['default']};}if(I===IJ(0x9a)&&(C===null||C===void 0x0?void 0x0:C[IJ(0x87)])!==undefined){const M=(S=(X=yield n(C[IJ(0x87)]))===null||X===void 0x0?void 0x0:X[IJ(0xb1)])===null||S===void 0x0?void 0x0:S[IJ(0x9a)];return{'choices':M===null||M===void 0x0?void 0x0:M[IJ(0x74)],'defaultValue':M===null||M===void 0x0?void 0x0:M[IJ(0x9f)]};}}if(I===IJ(0x84)&&(G===null||G===void 0x0?void 0x0:G['projectId'])!==undefined){const R=yield getAddons(B,G===null||G===void 0x0?void 0x0:G['projectId']),{elements:Y,nextPageCursor:P}=yield R();return{'choices':Y,'defaultValue':K,'pagination':{'nextPageCursor':P,'loadMore':R}};}if(I==='backupId'&&(G===null||G===void 0x0?void 0x0:G['projectId'])!==undefined&&((f=C===null||C===void 0x0?void 0x0:C['source'])===null||f===void 0x0?void 0x0:f[IJ(0x84)])!==undefined){const k=yield getAddonBackups(B,G===null||G===void 0x0?void 0x0:G[IJ(0x72)],(v=C===null||C===void 0x0?void 0x0:C[IJ(0x88)])===null||v===void 0x0?void 0x0:v[IJ(0x84)]),{elements:L,nextPageCursor:N}=yield k();return{'choices':L,'defaultValue':K,'pagination':{'nextPageCursor':N,'loadMore':k}};}const h=(a=G===null||G===void 0x0?void 0x0:G['addonId'])!==null&&a!==void 0x0?a:(V=C===null||C===void 0x0?void 0x0:C[IJ(0x76)])===null||V===void 0x0?void 0x0:V[IJ(0x84)];if((J===null||J===void 0x0?void 0x0:J['join'](''))==='updateaddonversion'&&I==='version'&&(G===null||G===void 0x0?void 0x0:G[IJ(0x72)])!==undefined&&h!==undefined){const {upgradeTo:T}=(yield B[IJ(0x77)]['addon']['version']({'parameters':{'addonId':h,'projectId':G===null||G===void 0x0?void 0x0:G[IJ(0x72)]}}))[IJ(0x9e)];if(T===undefined||T[IJ(0x8f)]<=0x0){(0x0,utils_1[IJ(0x7e)])(IJ(0x83));throw new Error();}return{'choices':T[IJ(0x92)](y=>y[IJ(0xa7)]),'defaultValue':K};}if(I===IJ(0x7f)){const y=yield B['list'][IJ(0x86)]({}),i=y[IJ(0x9e)][IJ(0x86)]['map'](I0=>I0===null||I0===void 0x0?void 0x0:I0['id']);return{'choices':i,'defaultValue':K};}if(((J===null||J===void 0x0?void 0x0:J['includes'](IJ(0x99)))||(J===null||J===void 0x0?void 0x0:J[IJ(0xac)](IJ(0x98))))&&I===IJ(0x80)&&h!==undefined&&(G===null||G===void 0x0?void 0x0:G[IJ(0x72)])!==undefined){const I0=(yield B[IJ(0x77)][IJ(0x79)][IJ(0xa3)]({'parameters':{'addonId':h,'projectId':G===null||G===void 0x0?void 0x0:G['projectId']}}))[IJ(0x9e)];return{'choices':[...(r=Object[IJ(0xa0)](I0===null||I0===void 0x0?void 0x0:I0['envs']))!==null&&r!==void 0x0?r:[],...(s=Object[IJ(0xa0)](I0===null||I0===void 0x0?void 0x0:I0['secrets']))!==null&&s!==void 0x0?s:[]]};}}catch(I1){}return{'choices':undefined,'defaultValue':K};});}
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-deprecation
|
|
2
|
-
'use strict';const a1jX=a1h;function a1h(j,h){const N=a1j();return a1h=function(F,K){F=F-0xc7;let G=N[F];return G;},a1h(j,h);}(function(j,h){const jI=a1h,N=j();while(!![]){try{const F=-parseInt(jI(0x1ae))/0x1*(-parseInt(jI(0x13e))/0x2)+-parseInt(jI(0x109))/0x3+parseInt(jI(0x170))/0x4*(parseInt(jI(0xd4))/0x5)+parseInt(jI(0x157))/0x6*(parseInt(jI(0x1d3))/0x7)+-parseInt(jI(0x184))/0x8+parseInt(jI(0xeb))/0x9*(parseInt(jI(0xfb))/0xa)+parseInt(jI(0x1af))/0xb*(-parseInt(jI(0x198))/0xc);if(F===h)break;else N['push'](N['shift']());}catch(K){N['push'](N['shift']());}}}(a1j,0xc1f6e));function a1j(){const jT=['12rXiWKt','runId','resourceTagId','replace','File\x20to\x20load\x20resource\x20json\x20from','getCurrentProjectName','pop','requiredPermissions','getCommand','services','done','buildId','Resource\x20was\x20not\x20deleted.','getNextPage','asyncSequential','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','askForJobRun','request','call','split','then','some','printAsTable','ApiClient','path','5520aHOJLa','proxyEnvsSet','type','jobs','repository','paginationArgs','defineProperty','templateId','aliases','askForTemplateRun','domainId','CliContext','Update\x20Northflank\x20','Display\x20help\x20for\x20command','forEach','askForPipeline','yml','checkUpdate','customUserAgent','value','12340760xtQTiD','subdomainId','safeLoad','Northflank\x20cli\x20version:\x20','helpOption','backup-destination','getCommandOverview','pipelineId','.yaml','__createBinding','invoice','getMetricsCommand','askForJob','noDefaults',',\x20-','repos','next','-f,\x20--file\x20<file-path>','cursor','rgn','1527528veLvNA','update','repo','CliLogs','getLogsCommand','omit','delete','bind','askForSubdomain','argv','error','branches','verbose','API\x20request\x20failed\x0a\x09Message:\x20','clusterId','chalk','jobId','nonInteractiveEndpoint','setPathVars','askForBuild','getOwnPropertyNames','-v,\x20--version','30662NyMMdi','66PzRwVx','./metrics','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','File\x20does\x20not\x20exist:\x20','stdout','scrt','docsTagsPath','\x20--','warning','tags','commander','Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line','exitCode','login','__esModule','subdomain','tag','regions','toString','projects','./defaults','Unknown\x20input\x20file\x20type:\x20','CliPortForward','file','restores','addonId','./exec','upperFirst','version','getCurrentJobName','parse','Get\x20information\x20about\x20Northflank\x20','json',',\x20NF\x20error\x20id:\x20','alias','CliFileCopy','3489017mwQENg','agent','kebabCase','underline','keys','projectId','-i,\x20--input\x20<resource-def>','create','volumeId','isEqual','toUpperCase','getProgram','volumes','name','GetApiEndpointPaginated','all','getCurrentContext','adn','cred','deleteWarningPrompt','\x20properties','includes','CliMetrics','3180bEXepZ','log','hasOwnProperty','hasNextPage','askForLogSink','volume','length','/docs/v1/api/','domain','prototype','ApiClientFileContextProvider','rawResponse','join','credentials','consoleFormat','__awaiter','addHelpCommand','askForTag','northflank','js-yaml','(HTTP\x20status\x20code:\x20','VERBOSE:\x20Using\x20endpoint\x20->\x20','isPaginatedEndpoint','5363721odCqMh','../package.json','askConfirm','sort','askForCredentials','existsSync','addons','opt','./utils','api.','boolean','opts','custom-columns=','svc','./formatting/command-overview','service','20uSllix','askForService','askForDomain','contextProvider','invoices','writable','pagination','message','secrets','Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20','Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27','assign','get','body','1184733ZkYPiF','contexts','statusText','grey','default','option','startsWith','has','map','getCurrentServiceName','prj','askForProject','askForAddonBackup','apply','askForBackupDestination','addHelpText','configurable','serviceId','clearLine','template','repositories','find','job','quiet','Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli','resource','stringify','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','.json','assertContextExisting','entries','count','branch','output','skipValidation','Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.','secretId','there\x20are\x20more\x20rows,\x20load?','subdomainPath','yaml','page','endsWith','askForTemplate','toLowerCase','addCommand','askForSubdomainPath','brn','askForAddon','method','backupDestinationId','loadAll','pln','domains','28Riyeom','set','backup','--verbose','handleYamlOutput','region','VERBOSE:\x20Request\x20body\x20->\x20','logs','isString','dmn','Documentation:\x20','Command','downloadCmd','query','\x20Northflank\x20resources','./port-forward','addon','./context/contextCommands','commands','required','handleJsonOutput','description','plan','enablePositionalOptions','credentialId'];a1j=function(){return jT;};return a1j();}var __createBinding=this&&this[a1jX(0x18d)]||(Object[a1jX(0x1da)]?function(j,h,N,F){const jl=a1jX;if(F===undefined)F=N;var K=Object['getOwnPropertyDescriptor'](h,N);(!K||(jl(0x107)in K?!h[jl(0x1bd)]:K[jl(0x100)]||K[jl(0x119)]))&&(K={'enumerable':!![],'get':function(){return h[N];}}),Object[jl(0x176)](j,F,K);}:function(j,h,N,F){if(F===undefined)F=N;j[F]=h[N];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(j,h){const jp=a1jX;Object[jp(0x176)](j,jp(0x10d),{'enumerable':!![],'value':h});}:function(j,h){j['default']=h;}),__importStar=this&&this['__importStar']||function(j){const jJ=a1jX;if(j&&j[jJ(0x1bd)])return j;var h={};if(j!=null){for(var N in j)if(N!==jJ(0x10d)&&Object[jJ(0xdd)][jJ(0xd6)][jJ(0x169)](j,N))__createBinding(h,j,N);}return __setModuleDefault(h,j),h;},__awaiter=this&&this[a1jX(0xe3)]||function(j,h,N,F){function K(G){return G instanceof N?G:new N(function(d){d(G);});}return new(N||(N=Promise))(function(G,d){const jD=a1h;function x(I){const jQ=a1h;try{e(F[jQ(0x194)](I));}catch(X){d(X);}}function m(I){try{e(F['throw'](I));}catch(X){d(X);}}function e(I){const jy=a1h;I[jy(0x161)]?G(I[jy(0x183)]):K(I[jy(0x183)])[jy(0x16b)](x,m);}e((F=F[jD(0x116)](j,h||[]))[jD(0x194)]());});},__importDefault=this&&this['__importDefault']||function(j){const ji=a1jX;return j&&j[ji(0x1bd)]?j:{'default':j};};Object[a1jX(0x176)](exports,a1jX(0x1bd),{'value':!![]}),exports[a1jX(0xc8)]=void 0x0;const js_client_1=require('@northflank/js-client'),commander_1=__importDefault(require(a1jX(0x1b9))),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1jX(0x1a7))),_=__importStar(require('lodash')),contextCommands_1=require(a1jX(0x14f)),utils_1=require(a1jX(0xf3)),defaults=__importStar(require(a1jX(0x1c3))),inquirer_helper_1=require('./inquirer-helper'),console_format_helpers_1=require('./formatting/console-format-helpers'),command_overview_1=require(a1jX(0xf9)),port_forward_1=require(a1jX(0x14d)),exec_1=require(a1jX(0x1c9)),logs_1=require('./logs'),metrics_1=require(a1jX(0x1b0)),copy_1=require('./copy'),yaml=require(a1jX(0xe7)),pgk=require(a1jX(0xec)),getProgram=j=>{const jW=a1jX,h=new commander_1[(jW(0x10d))][(jW(0x149))](jW(0xe6));h[jW(0x153)](jW(0x1ba)),h[jW(0x155)](!![]),h[jW(0x1cb)](jW(0x187)+chalk_1[jW(0x10d)][jW(0x1d6)](pgk[jW(0x1cb)]),jW(0x1ad),jW(0x121));const N=new js_client_1[(jW(0x16e))](j,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[jW(0x182)],'agent':utils_1[jW(0x1d4)]}),F=new contextCommands_1[(jW(0x17b))](N,utils_1[jW(0x1d4)]),K=new port_forward_1[(jW(0x1c5))](j,utils_1[jW(0x1d4)]),G=new exec_1['CliExec'](j,utils_1[jW(0x1d4)]),d=new copy_1[(jW(0x1d2))](j,utils_1[jW(0x1d4)]),x=new logs_1[(jW(0x19b))](j,utils_1[jW(0x1d4)]),m=new metrics_1[(jW(0xd3))](j,utils_1[jW(0x1d4)]);return h[jW(0x135)](K['portFwdCmd']),h['addCommand'](G['execCmd']),h[jW(0x135)](d[jW(0x14a)]),h['addCommand'](d['uploadCmd']),h['addCommand'](F[jW(0x1bc)]),h[jW(0x135)](F[jW(0x10a)]),generateCommands(N,N['endpoints'],h,x,m),h[jW(0x135)]((0x0,command_overview_1[jW(0x18a)])(h)),h[jW(0xe4)](!![],jW(0x17d)),h[jW(0x188)](undefined,jW(0x17d)),h;};exports[a1jX(0xc8)]=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const jE=a1jX;try{const j=new js_client_1[(jE(0xde))]();yield(0x0,utils_1[jE(0x181)])(j);const h=(0x0,exports[jE(0xc8)])(j);yield h['parseAsync'](process[jE(0x1a1)]);}catch(N){(0x0,utils_1[jE(0x1a2)])(jE(0x166)+N[jE(0x102)]),process[jE(0x1a1)][jE(0x11e)](F=>F===jE(0x141))&&console[jE(0xd5)](N),process[jE(0x1bb)]=0x1;}}))());function isListCommand(j){const jt=a1jX,h=[[jt(0x107),jt(0x14e),'backups'],[jt(0x107),jt(0x11f),'runs']];return j[jt(0x11e)](N=>N==='list')||h[jt(0x16c)](N=>_[jt(0x1dc)](j,N));}function generateCommands(j,h,N,F,K,G=defaults['defaults'],d=[]){const jH=a1jX,x=new inquirer_helper_1['InquirerHelper'](new js_client_1[(jH(0x16e))](j[jH(0xfe)],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[jH(0x182)],'agent':utils_1[jH(0x1d4)]}));function m(X,l){const ja=jH;return X[ja(0x151)]!==![]&&l===undefined;}function P(X,l){const jq=jH,{opt:p,name:J}=X,Q=p[jq(0x10d)],y=m(p,Q),D=a=>a['length']>0x1?'--'+a:'-'+a,i=p===null||p===void 0x0?void 0x0:p[jq(0x1d1)],W=i?_['isArray'](i)?'-'+(i===null||i===void 0x0?void 0x0:i[jq(0x111)](q=>D(q))[jq(0xe0)](jq(0x192)))+',':''+D(i):'',E=y?'':'OPTIONAL:\x20',t=typeof p[jq(0x172)]===jq(0xf5)||p[jq(0x172)]===jq(0xf5)?W+jq(0x1b6)+J:W+'\x20--'+J+'\x20<'+J[jq(0xc7)]()+'>',H=E+p[jq(0x153)];l[jq(0x10e)](t,H,Q);}function e(X,l){const jR=jH;if(l[jR(0x150)][jR(0x16c)](p=>p['name']()===jR(0x145)))return;_[jR(0x1dc)](X,[jR(0x107),jR(0xfa)])&&(l['addCommand'](F[jR(0x19c)](jR(0xfa))),l[jR(0x135)](K['getMetricsCommand'](jR(0xfa))),l[jR(0x135)](F[jR(0x19c)](jR(0xfa),!![])),l[jR(0x135)](K[jR(0x18f)]('service',!![]))),_['isEqual'](X,[jR(0x107),jR(0x11f)])&&(l['addCommand'](F['getLogsCommand']('job')),l['addCommand'](K[jR(0x18f)](jR(0x11f))),l['addCommand'](F[jR(0x19c)]('job',!![])),l[jR(0x135)](K[jR(0x18f)](jR(0x11f),!![]))),_[jR(0x1dc)](X,['get','addon'])&&(l[jR(0x135)](F[jR(0x19c)](jR(0x14e))),l[jR(0x135)](K[jR(0x18f)](jR(0x14e)))),_[jR(0x1dc)](X,[jR(0x107),'addon',jR(0x140)])&&l[jR(0x135)](F[jR(0x19c)]('addon',![],!![])),_[jR(0x1dc)](X,[jR(0x107),jR(0x14e),jR(0x1c7)])&&l[jR(0x135)](F[jR(0x19c)](jR(0x14e),![],!![],!![]));}return Object[jH(0x1ac)](G)[jH(0x17e)](X=>{const jO=jH,l=h[X],p=G[X],J=d['concat']([X]);function Q(R,n){const jn=a1h,k=Object[jn(0x1ac)](R||{});k[jn(0x111)](L=>{return{'name':L,'opt':R[L]};})[jn(0xee)]((L,A)=>!m(L[jn(0xf2)])?!m(A['opt'])?0x0:0x1:-0x1)[jn(0x17e)](L=>{P(L,n);});}function y(R,n){const jk=a1h,k=[['project',jk(0x1c2),jk(0x113)],[jk(0xfa),jk(0x160),jk(0xf8)],[jk(0xe1),'credential',jk(0xcf)],[jk(0x14e),jk(0xf1),jk(0xce)],['job',jk(0x173)],[jk(0x154),'plans',jk(0x13c)],[jk(0x143),jk(0x1c0),jk(0x197)],['domain',jk(0x13d),jk(0x147)],['secret',jk(0x103),jk(0x1b4)],[jk(0xc9),jk(0xd9),'vol'],[jk(0x1a3),jk(0x129),jk(0x137)],[jk(0x18e),jk(0xff),'inv'],[jk(0x11c),'templates','tpl'],[jk(0x193),jk(0x174),jk(0x11d),jk(0x19a)],[jk(0x189),'backup-destinations'],[jk(0x1bf),jk(0x1b8)]],L=k['find'](A=>A[jk(0xd2)](n));if(L!==undefined)R[jk(0x178)](L['filter'](A=>A!==n));}function D(R){var n,k;return __awaiter(this,void 0x0,void 0x0,function*(){const jL=a1h,L={},{contextProvider:A}=j,v=J[jL(0xd2)](jL(0x19e)),s=R[jL(0x191)]===!![];function U(r,V,f){var O,z;return __awaiter(this,void 0x0,void 0x0,function*(){const jA=a1h;if(_[jA(0x110)]((z=(O=p['opt'])===null||O===void 0x0?void 0x0:O[jA(0x16f)])!==null&&z!==void 0x0?z:{},r)){const b=!s&&!v&&f?f():undefined,T=R[r]||b||(yield V());_[jA(0x13f)](L,r,T);}});}return yield(0x0,utils_1[jL(0x165)])(Object[jL(0x127)]((k=(n=p[jL(0xf2)])===null||n===void 0x0?void 0x0:n['path'])!==null&&k!==void 0x0?k:{}),([r,V])=>__awaiter(this,void 0x0,void 0x0,function*(){const jv=jL;var f;const O=L===null||L===void 0x0?void 0x0:L[jv(0x1d8)],z=L===null||L===void 0x0?void 0x0:L[jv(0x177)];switch(r){case'projectId':return yield U(jv(0x1d8),x[jv(0x114)][jv(0x19f)](x),A[jv(0x15c)]['bind'](A));case'serviceId':return yield U(jv(0x11a),x[jv(0xfc)](O)[jv(0x19f)](x),A[jv(0x112)]['bind'](A));case jv(0x1c8):return yield U(jv(0x1c8),x[jv(0x138)](O)[jv(0x19f)](x));case jv(0x1a8):return yield U('jobId',x[jv(0x190)](O)[jv(0x19f)](x),A[jv(0x1cc)][jv(0x19f)](A));case'runId':return yield U(jv(0x158),x[jv(0x167)](L[jv(0x1a8)],O,![])['bind'](x));case jv(0x12d):return yield U(jv(0x12d),x['askForSecret'](O)['bind'](x));case jv(0xdc):case jv(0x17a):return yield U(jv(0xdc),x[jv(0xfd)][jv(0x19f)](x));case'credentialId':return yield U(jv(0x156),x[jv(0xef)][jv(0x19f)](x));case jv(0x1db):return yield U(jv(0x1db),x['askForVolume'](O)['bind'](x));case jv(0x1be):return yield U(jv(0x1be),x[jv(0x1a0)](L[jv(0xdc)])[jv(0x19f)](x));case jv(0x185):return yield U(jv(0x185),x[jv(0x1a0)](L[jv(0x17a)])[jv(0x19f)](x));case jv(0x12f):return yield U(jv(0x12f),x[jv(0x136)](L[jv(0xdc)],(f=L[jv(0x1be)])!==null&&f!==void 0x0?f:L['subdomainId'])['bind'](x));case'backupId':return yield U('backupId',x[jv(0x115)](O,L[jv(0x1c8)])[jv(0x19f)](x));case jv(0x162):return yield U(jv(0x162),x[jv(0x1ab)](O,L[jv(0x11a)],L[jv(0x1a8)])['bind'](x));case jv(0x177):return yield U(jv(0x177),x[jv(0x133)]()[jv(0x19f)](x));case'templateRunId':return yield U('templateRunId',x[jv(0x179)](z)[jv(0x19f)](x));case'logSinkId':return yield U('logSinkId',x[jv(0xd8)]()[jv(0x19f)](x));case'pipelineId':return yield U(jv(0x18b),x[jv(0x17f)](O)['bind'](x));case jv(0x159):return yield U(jv(0x159),x[jv(0xe5)]()[jv(0x19f)](x));case'backupDestinationId':return yield U(jv(0x13a),x[jv(0x117)]()[jv(0x19f)](x));case jv(0x1a6):return yield U(jv(0x1a6),x['askForClusterId']()[jv(0x19f)](x));default:return yield U(r,x['askGeneric'](r,V===null||V===void 0x0?void 0x0:V[jv(0x153)])['bind'](x));}})),L;});}function i(R){var n,k,L;return __awaiter(this,void 0x0,void 0x0,function*(){const js=a1h,A={},v=((n=p[js(0xf2)])===null||n===void 0x0?void 0x0:n[js(0xea)])?defaults[js(0x175)]:{},s=Object[js(0x106)](Object[js(0x106)]({},(L=(k=p[js(0xf2)])===null||k===void 0x0?void 0x0:k['query'])!==null&&L!==void 0x0?L:{}),v),U=Object[js(0x1d7)](s)['filter'](r=>r!==js(0x13b));return yield(0x0,utils_1[js(0x165)])(U,r=>__awaiter(this,void 0x0,void 0x0,function*(){const jU=js;if(R[r]!==undefined)return _[jU(0x13f)](A,r,R[r]);})),A;});}function W(){const jr=a1h;switch(J[0x0]){case jr(0x107):return jr(0x1ce)+(J[0x1]||jr(0x122))+'s';case jr(0x199):return jr(0x17c)+(J[0x1]||jr(0x122))+jr(0xd1);default:return _[jr(0x1ca)](X)+jr(0x14c);}}function E(R,n){const jV=a1h;var k,L,A,v,s,U,r,V;if(!n){const Y=(0x0,utils_1[jV(0x15f)])()[jV(0xca)](_[jV(0x1d5)](X))[jV(0x153)](W());return y(Y,X),Y;}const f=(R===null||R===void 0x0?void 0x0:R['requiredPermissions'])?chalk_1[jV(0x10d)][jV(0x10c)]('\x0a>\x20Token\x20permissions\x20required:\x20'+R[jV(0x15e)]):'',O=j[jV(0xfe)][jV(0xcd)](),z=O!==undefined&&((k=p===null||p===void 0x0?void 0x0:p[jV(0xf2)])===null||k===void 0x0?void 0x0:k[jV(0x1b5)])!==undefined,b=O===null||O===void 0x0?void 0x0:O['host'][jV(0x15a)](jV(0xf4),''),T=z?jV(0x148)+b+jV(0xdb)+((L=p===null||p===void 0x0?void 0x0:p[jV(0xf2)])===null||L===void 0x0?void 0x0:L['docsTagsPath']):'',u=(R===null||R===void 0x0?void 0x0:R[jV(0x153)])||'',Z=(0x0,utils_1[jV(0x15f)])(!![])[jV(0xca)](_['kebabCase'](X))[jV(0x153)](u)[jV(0x118)]('after',[f,T][jV(0xe0)]('\x0a'));y(Z,X);(((A=p[jV(0xf2)])===null||A===void 0x0?void 0x0:A[jV(0x108)])||((v=p[jV(0xf2)])===null||v===void 0x0?void 0x0:v['nonInteractiveEndpoint']))&&(Z[jV(0x10e)](jV(0x195),jV(0x15b)),Z[jV(0x10e)](jV(0x1d9),jV(0x124)));Q((s=p[jV(0xf2)])===null||s===void 0x0?void 0x0:s[jV(0x16f)],Z),Q((U=p['opt'])===null||U===void 0x0?void 0x0:U[jV(0x14b)],Z);const S=(r=p[jV(0xf2)])===null||r===void 0x0?void 0x0:r[jV(0xea)];return S&&Q(defaults[jV(0x175)],Z),Q((V=p[jV(0xf2)])===null||V===void 0x0?void 0x0:V['base'],Z),Z['action'](()=>__awaiter(this,void 0x0,void 0x0,function*(){const jf=jV;var M,w,C,o,g,c;(0x0,utils_1[jf(0x126)])(j);const B=Z[jf(0xf6)]();(B===null||B===void 0x0?void 0x0:B[jf(0x1a4)])&&utils_1[jf(0x171)]&&(0x0,utils_1[jf(0x1b7)])('VERBOSE:\x20HTTP_PROXY\x20or\x20HTTPS_PROXY\x20environment\x20variable\x20set:\x20tunnelling\x20traffic\x20through\x20HTTP\x20proxy.');const j0=B[jf(0x131)]!==undefined||B[jf(0x196)]!==undefined;if(B[jf(0x13b)]===!![]&&j0)throw new Error(jf(0x105));const j1=B===null||B===void 0x0?void 0x0:B['output'],j2=j1==='json',j3=j1==='yaml'||j1===jf(0x180),j4=yield D(B);x[jf(0x1aa)](j4);const j5=yield i(B),j6=Object[jf(0x1d7)]((w=(M=p[jf(0xf2)])===null||M===void 0x0?void 0x0:M['path'])!==null&&w!==void 0x0?w:{})[jf(0x111)](jh=>jh+'='+chalk_1[jf(0x10d)]['green'](j4[jh]))[jf(0xe0)](',\x20');if(j6[jf(0xda)]>0x0&&!j2&&!j3){const jh='=>\x20running\x20command\x20with:\x20'+j6;console[jf(0xd5)](jh);}const j7=((C=p[jf(0xf2)])===null||C===void 0x0?void 0x0:C['body'])||((o=p[jf(0xf2)])===null||o===void 0x0?void 0x0:o[jf(0x1a9)])?yield I(B,p,J):undefined;if(!B['force']&&J['includes'](jf(0x19e))&&!(yield x[jf(0xd0)]())){(0x0,utils_1['warning'])(jf(0x163));return;}const j8=S&&(B['loadAll']||(B[jf(0x12a)]===jf(0x1cf)||B[jf(0x12a)]===jf(0x130))&&!j0);let j9=j8&&l instanceof js_client_1[jf(0xcb)]?yield l[jf(0xcc)]({'parameters':j4,'options':j5,'data':j7}):yield l[jf(0x169)]({'parameters':j4,'options':Object[jf(0x106)]({},j5),'data':j7});if(B===null||B===void 0x0?void 0x0:B[jf(0x1a4)]){const jN=j9[jf(0x168)];console[jf(0xd5)](jf(0xe9)+jN[jf(0x139)][jf(0xc7)]()+':'+jN['url']);if(j7!==undefined)console[jf(0xd5)](jf(0x144)+j7);}if(j9['error']){const {details:jF,id:jK,message:jG,status:jd}=j9[jf(0x1a2)],jx=jF?'\x0a\x09details\x20:'+JSON[jf(0x123)](jF):'',jm=jK?jf(0x1d0)+jK:'',jP=jf(0xe8)+jd+jm+')';throw new Error(jf(0x1a5)+jG+'\x20'+jP+jx);}let jj=0x0;printCallResult(B,j2,j9['data'],j3,J,j1,![],jj,j9[jf(0xdf)]['statusText']);if(!B['quiet']&&!j8&&!j0&&((g=j9[jf(0x101)])===null||g===void 0x0?void 0x0:g[jf(0xd7)]))while((c=j9[jf(0x101)])===null||c===void 0x0?void 0x0:c[jf(0xd7)]){const je=yield x[jf(0xed)](jf(0x12e));if(je)process['stdout']['moveCursor'](0x0,-0x1),process[jf(0x1b3)][jf(0x11b)](0x1),jj+=j9[jf(0x101)][jf(0x128)],j9=yield j9['pagination'][jf(0x164)](),printCallResult(B,j2,j9['data'],j3,J,j1,!![],jj,j9[jf(0xdf)][jf(0x10b)]);else return;}})),Z;}const t=_['has'](p,jO(0xf2)),H=l,a=E(H,t);e(J,a),N['addCommand'](a);const q=_[jO(0x19d)](p,jO(0xf2));Object[jO(0x1d7)](q)['length']>0x0&&generateCommands(j,l,a,F,K,q,J);});function I(X,l,p){var J;return __awaiter(this,void 0x0,void 0x0,function*(){const jz=a1h,{input:Q,file:y}=X;if(Q!==undefined)try{return JSON[jz(0x1cd)](Q);}catch(D){try{return yaml[jz(0x186)](Q);}catch(i){throw new Error(jz(0x12c));}}if(y!==undefined){if(!fs_1[jz(0x10d)][jz(0xf0)](y))throw new Error(jz(0x1b2)+y);const W=fs_1[jz(0x10d)]['readFileSync'](y)[jz(0x1c1)]();let E;try{if(_[jz(0x146)](W)){if(X[jz(0x1c6)][jz(0x132)](jz(0x125)))E=JSON[jz(0x1cd)](W);else{if(X[jz(0x1c6)]['endsWith'](jz(0x18c))||X[jz(0x1c6)]['endsWith'](jz(0x180)))E=yaml[jz(0x186)](W);else throw new Error(jz(0x1c4)+X[jz(0x1c6)][jz(0x16a)]('.')[jz(0x15d)]());}}else E=W;return E;}catch(t){throw new Error(jz(0x104)+t['message']);}}if((J=l===null||l===void 0x0?void 0x0:l[jz(0xf2)])===null||J===void 0x0?void 0x0:J[jz(0x1a9)])throw new Error(jz(0x1b1));return yield x['retrievePayloadViaInteractiveCli'](l,{'cmdPath':p,'skipValidation':X[jz(0x12b)]});});}}const printCallResult=(j,h,N,F,K,G,d,x,m)=>{const jb=a1jX;if(!(j===null||j===void 0x0?void 0x0:j[jb(0x120)])){if(h)(0x0,console_format_helpers_1[jb(0x152)])(j===null||j===void 0x0?void 0x0:j[jb(0x12a)],N);else{if(F)(0x0,console_format_helpers_1[jb(0x142)])(j===null||j===void 0x0?void 0x0:j[jb(0x12a)],N);else{if(isListCommand(K)){const P=(G===null||G===void 0x0?void 0x0:G[jb(0x10f)]('custom-columns='))?G[jb(0x15a)](jb(0xf7),'')[jb(0x16a)](',')[jb(0x111)](p=>p[jb(0x134)]()):undefined,e=K[K['length']-0x1],I=''+e+(e[jb(0x132)]('s')?'':'s'),X=_['upperFirst'](I),l=_[jb(0x110)](N,I)?N[I]:N;(0x0,console_format_helpers_1[jb(0x16d)])(l,X,P,d,x);}else console[jb(0xd5)]((0x0,console_format_helpers_1[jb(0xe2)])(N,m));}}}};
|
|
2
|
+
'use strict';const a1If=a1B;(function(I,B){const IS=a1B,J=I();while(!![]){try{const C=parseInt(IS(0x29a))/0x1*(parseInt(IS(0x2d1))/0x2)+-parseInt(IS(0x1ef))/0x3*(parseInt(IS(0x2e5))/0x4)+parseInt(IS(0x1f1))/0x5*(-parseInt(IS(0x20b))/0x6)+-parseInt(IS(0x233))/0x7*(parseInt(IS(0x1e7))/0x8)+-parseInt(IS(0x235))/0x9+parseInt(IS(0x263))/0xa+parseInt(IS(0x27c))/0xb;if(C===B)break;else J['push'](J['shift']());}catch(G){J['push'](J['shift']());}}}(a1I,0x878f6));var __createBinding=this&&this[a1If(0x1f6)]||(Object[a1If(0x23a)]?function(I,B,J,C){const Iv=a1If;if(C===undefined)C=J;var G=Object['getOwnPropertyDescriptor'](B,J);(!G||(Iv(0x24d)in G?!B[Iv(0x205)]:G['writable']||G[Iv(0x28a)]))&&(G={'enumerable':!![],'get':function(){return B[J];}}),Object['defineProperty'](I,C,G);}:function(I,B,J,C){if(C===undefined)C=J;I[C]=B[J];}),__setModuleDefault=this&&this[a1If(0x211)]||(Object['create']?function(I,B){const Ia=a1If;Object[Ia(0x25b)](I,Ia(0x20a),{'enumerable':!![],'value':B});}:function(I,B){const IV=a1If;I[IV(0x20a)]=B;}),__importStar=this&&this[a1If(0x203)]||(function(){var I=function(B){const Ir=a1B;return I=Object[Ir(0x2db)]||function(J){const Is=Ir;var C=[];for(var G in J)if(Object[Is(0x224)]['hasOwnProperty'][Is(0x246)](J,G))C[C['length']]=G;return C;},I(B);};return function(B){const IK=a1B;if(B&&B['__esModule'])return B;var J={};if(B!=null){for(var C=I(B),G=0x0;G<C[IK(0x2b8)];G++)if(C[G]!==IK(0x20a))__createBinding(J,B,C[G]);}return __setModuleDefault(J,B),J;};}()),__awaiter=this&&this[a1If(0x2e4)]||function(I,B,J,C){function G(F){return F instanceof J?F:new J(function(A){A(F);});}return new(J||(J=Promise))(function(F,A){const Ih=a1B;function H(X){const Ib=a1B;try{d(C[Ib(0x240)](X));}catch(S){A(S);}}function t(X){const IW=a1B;try{d(C[IW(0x238)](X));}catch(S){A(S);}}function d(X){const Iu=a1B;X[Iu(0x29c)]?F(X[Iu(0x26f)]):G(X[Iu(0x26f)])['then'](H,t);}d((C=C[Ih(0x207)](I,B||[]))[Ih(0x240)]());});},__importDefault=this&&this['__importDefault']||function(I){const Iq=a1If;return I&&I[Iq(0x205)]?I:{'default':I};};Object[a1If(0x25b)](exports,'__esModule',{'value':!![]}),exports[a1If(0x260)]=void 0x0;const js_client_1=require(a1If(0x21f)),commander_1=require(a1If(0x28e)),fs_1=__importDefault(require('fs')),chalk_1=__importDefault(require(a1If(0x2df))),_=__importStar(require(a1If(0x2a9))),contextCommands_1=require(a1If(0x289)),utils_1=require(a1If(0x28d)),defaults=__importStar(require('./defaults')),inquirer_helper_1=require(a1If(0x247)),console_format_helpers_1=require(a1If(0x22a)),command_overview_1=require(a1If(0x1e4)),port_forward_1=require(a1If(0x2f5)),exec_1=require(a1If(0x2f3)),logs_1=require(a1If(0x2c9)),metrics_1=require('./metrics'),copy_1=require(a1If(0x1fa)),yaml=require(a1If(0x262)),pgk=require(a1If(0x22f)),getProgram=I=>{const Ix=a1If,B=new commander_1[(Ix(0x25a))]('northflank');B['description']('Manage\x20your\x20Northflank\x20resources\x20from\x20the\x20command\x20line'),B[Ix(0x25f)](!![]),B[Ix(0x283)]('Northflank\x20cli\x20version:\x20'+chalk_1[Ix(0x20a)]['underline'](pgk[Ix(0x283)]),Ix(0x219),'Print\x20the\x20current\x20version\x20of\x20the\x20Northflank\x20cli');const J=new js_client_1['ApiClient'](I,{'throwErrorOnHttpErrorCode':![],'customUserAgent':utils_1[Ix(0x1f3)],'agent':utils_1[Ix(0x20c)]}),C=new contextCommands_1[(Ix(0x2ee))](J,utils_1['agent']),G=new port_forward_1[(Ix(0x1e2))](I,utils_1['agent']),F=new exec_1['CliExec'](I,utils_1[Ix(0x20c)]),A=new copy_1[(Ix(0x26d))](I,utils_1[Ix(0x20c)]),H=new logs_1[(Ix(0x2e7))](I,utils_1[Ix(0x20c)]),t=new metrics_1[(Ix(0x2a1))](I,utils_1['agent']);return B['addCommand'](G[Ix(0x272)]),B[Ix(0x2f6)](F[Ix(0x21b)]),B[Ix(0x2f6)](A[Ix(0x254)]),B[Ix(0x2f6)](A['uploadCmd']),B['addCommand'](C[Ix(0x299)]),B[Ix(0x2f6)](C[Ix(0x26b)]),generateCommands(J,J['endpoints'],B,H,t),B[Ix(0x2f6)]((0x0,command_overview_1[Ix(0x218)])(B)),B[Ix(0x270)](Ix(0x1e0),Ix(0x225)),B[Ix(0x24f)](undefined,'Display\x20help\x20for\x20command'),B;};exports['getProgram']=getProgram,((()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const Ig=a1If;try{const I=new js_client_1[(Ig(0x20d))]();yield(0x0,utils_1[Ig(0x23b)])(I);const B=(0x0,exports[Ig(0x260)])(I);yield B[Ig(0x2d7)](process[Ig(0x23f)]);}catch(J){(0x0,utils_1[Ig(0x27b)])(Ig(0x2bd)+J['message']),process['argv'][Ig(0x2b7)](C=>C===Ig(0x253))&&console['log'](J),process[Ig(0x2ef)]=0x1;}}))());function isListCommand(I){const Io=a1If,B=[[Io(0x24d),Io(0x2ed),Io(0x2b0)],[Io(0x24d),'job',Io(0x255)]];return I['find'](J=>J===Io(0x2c6))||B[Io(0x2d6)](J=>_['isEqual'](I,J));}function a1B(I,B){const J=a1I();return a1B=function(C,G){C=C-0x1e0;let F=J[C];return F;},a1B(I,B);}function generateCommands(I,B,J,C,G,F=defaults[a1If(0x2c1)],A=[]){const IO=a1If,H=new inquirer_helper_1[(IO(0x2b3))](new js_client_1[(IO(0x2aa))](I[IO(0x27f)],{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent'],'agent':utils_1['agent']}));function t(f,v){const Ip=IO;return f[Ip(0x214)]!==![]&&v===undefined;}function d(f,v){const Iw=IO,{opt:a,name:V}=f,r=a['default'],s=t(a,r),K=x=>x[Iw(0x2b8)]>0x1?'--'+x:'-'+x,b=a===null||a===void 0x0?void 0x0:a[Iw(0x1f8)],W=b?_[Iw(0x1e6)](b)?'-'+(b===null||b===void 0x0?void 0x0:b[Iw(0x2e6)](x=>K(x))[Iw(0x208)](',\x20-'))+',':''+K(b):'',u=s?'':Iw(0x2f2),h=typeof a[Iw(0x2ec)]===Iw(0x22d)||a['type']==='boolean'?W+Iw(0x1e8)+V:W+'\x20--'+V+'\x20<'+V[Iw(0x258)]()+'>',q=u+a[Iw(0x250)];v['option'](h[Iw(0x268)](),q,r);}function X(f,v){const IZ=IO;if(v[IZ(0x294)]['some'](a=>a[IZ(0x28f)]()===IZ(0x2ae)))return;_[IZ(0x29b)](f,[IZ(0x24d),IZ(0x2e9)])&&(v['addCommand'](C[IZ(0x287)](IZ(0x2e9))),v['addCommand'](G[IZ(0x248)](IZ(0x2e9))),v['addCommand'](C[IZ(0x287)](IZ(0x2e9),!![])),v[IZ(0x2f6)](G[IZ(0x248)](IZ(0x2e9),!![]))),_['isEqual'](f,[IZ(0x24d),'job'])&&(v['addCommand'](C[IZ(0x287)](IZ(0x277))),v[IZ(0x2f6)](G['getMetricsCommand'](IZ(0x277))),v[IZ(0x2f6)](C[IZ(0x287)]('job',!![])),v['addCommand'](G[IZ(0x248)](IZ(0x277),!![]))),_[IZ(0x29b)](f,[IZ(0x24d),'addon'])&&(v['addCommand'](C[IZ(0x287)]('addon')),v[IZ(0x2f6)](G[IZ(0x248)]('addon'))),_[IZ(0x29b)](f,['get','addon',IZ(0x2c0)])&&v['addCommand'](C['getLogsCommand'](IZ(0x2ed),![],!![])),_[IZ(0x29b)](f,['get',IZ(0x2ed),'restores'])&&v['addCommand'](C[IZ(0x287)](IZ(0x2ed),![],!![],!![]));}return Object['getOwnPropertyNames'](F)[IO(0x1ea)](f=>{const Iz=IO,v=B[f],a=F[f],V=A[Iz(0x24e)]([f]);function r(o,O){const IQ=Iz,p=Object[IQ(0x2db)](o||{});p[IQ(0x2e6)](w=>{return{'name':w,'opt':o[w]};})[IQ(0x273)]((w,Z)=>!t(w[IQ(0x269)])?!t(Z[IQ(0x269)])?0x0:0x1:-0x1)['forEach'](w=>{d(w,O);});}function s(o,O){const Ic=Iz,p=[[Ic(0x228),Ic(0x217),'prj'],[Ic(0x2e9),Ic(0x227),Ic(0x26e)],[Ic(0x271),Ic(0x1e9),Ic(0x297)],[Ic(0x2ed),Ic(0x276),Ic(0x2d2)],[Ic(0x277),Ic(0x1e5)],['plan',Ic(0x293),Ic(0x2d5)],['region',Ic(0x2ad),Ic(0x2e0)],[Ic(0x2d9),Ic(0x2e8),'dmn'],[Ic(0x26a),Ic(0x28b),Ic(0x209)],['volumes',Ic(0x2bf),Ic(0x21a)],[Ic(0x21d),'branch',Ic(0x275)],[Ic(0x2a4),Ic(0x265),Ic(0x279)],[Ic(0x200),Ic(0x2d3),'tpl'],[Ic(0x281),'repository',Ic(0x1ec),Ic(0x2bb)],[Ic(0x256),Ic(0x2a7)],['tag',Ic(0x236)]],w=p['find'](Z=>Z[Ic(0x232)](O));if(w!==undefined)o[Ic(0x2c5)](w[Ic(0x237)](Z=>Z!==O));}function K(o){return __awaiter(this,void 0x0,void 0x0,function*(){const Il=a1B;var O,p;const w={},{contextProvider:Z}=I,z=V[Il(0x232)](Il(0x2ca)),Q=o['noDefaults']===!![];function c(l,n,m){return __awaiter(this,void 0x0,void 0x0,function*(){const In=a1B;var E,j;if(_[In(0x1ee)]((j=(E=a[In(0x269)])===null||E===void 0x0?void 0x0:E['path'])!==null&&j!==void 0x0?j:{},l)){const U=!Q&&!z&&m?m():undefined,D=o[l]||U||(yield n());_['set'](w,l,D);}});}return yield(0x0,utils_1['asyncSequential'])(Object[Il(0x259)]((p=(O=a[Il(0x269)])===null||O===void 0x0?void 0x0:O[Il(0x2c2)])!==null&&p!==void 0x0?p:{}),l=>__awaiter(this,[l],void 0x0,function*([n,m]){const Im=Il;var E;const j=w===null||w===void 0x0?void 0x0:w[Im(0x29f)],U=w===null||w===void 0x0?void 0x0:w[Im(0x226)];switch(n){case Im(0x29f):return yield c(Im(0x29f),H['askForProject'][Im(0x2a2)](H),Z['getCurrentProjectName'][Im(0x2a2)](Z));case Im(0x202):return yield c(Im(0x202),H['askForService'](j)[Im(0x2a2)](H),Z[Im(0x1e3)][Im(0x2a2)](Z));case Im(0x2c4):return yield c(Im(0x2c4),H['askForAddon'](j)[Im(0x2a2)](H));case Im(0x24c):return yield c(Im(0x24c),H[Im(0x2d4)](j)[Im(0x2a2)](H),Z['getCurrentJobName'][Im(0x2a2)](Z));case Im(0x2a5):return yield c('runId',H[Im(0x2c3)](w[Im(0x24c)],j,![])[Im(0x2a2)](H));case Im(0x2ce):return yield c(Im(0x2ce),H[Im(0x2cb)](j)[Im(0x2a2)](H));case Im(0x2d9):case'domainId':return yield c(Im(0x2d9),H[Im(0x25d)]['bind'](H));case Im(0x2b4):return yield c('credentialId',H[Im(0x245)][Im(0x2a2)](H));case Im(0x2b6):return yield c('volumeId',H[Im(0x231)](j)[Im(0x2a2)](H));case Im(0x216):return yield c(Im(0x216),H['askForSubdomain'](w[Im(0x2d9)])[Im(0x2a2)](H));case'subdomainId':return yield c('subdomainId',H[Im(0x2af)](w[Im(0x292)])['bind'](H));case Im(0x2cf):return yield c(Im(0x2cf),H[Im(0x1f2)](w[Im(0x2d9)],(E=w[Im(0x216)])!==null&&E!==void 0x0?E:w[Im(0x27d)])['bind'](H));case'backupId':return yield c(Im(0x2de),H[Im(0x223)](j,w[Im(0x2c4)])[Im(0x2a2)](H));case'buildId':return yield c(Im(0x22c),H[Im(0x20e)](j,w['serviceId'],w['jobId'])['bind'](H));case Im(0x226):return yield c(Im(0x226),H[Im(0x213)]()[Im(0x2a2)](H));case Im(0x29d):return yield c(Im(0x29d),H[Im(0x2da)](U)[Im(0x2a2)](H));case'logSinkId':return yield c('logSinkId',H[Im(0x2a6)]()[Im(0x2a2)](H));case Im(0x2d0):return yield c(Im(0x2d0),H['askForPipeline'](j)[Im(0x2a2)](H));case'resourceTagId':return yield c(Im(0x1ed),H['askForTag']()[Im(0x2a2)](H));case Im(0x298):return yield c(Im(0x298),H[Im(0x285)]()['bind'](H));case Im(0x201):return yield c(Im(0x201),H['askForClusterId']()['bind'](H));default:return yield c(n,H[Im(0x2b5)](n,m===null||m===void 0x0?void 0x0:m[Im(0x250)])[Im(0x2a2)](H));}})),w;});}function b(o){return __awaiter(this,void 0x0,void 0x0,function*(){const IE=a1B;var O,p,w;const Z={},z=((O=a[IE(0x269)])===null||O===void 0x0?void 0x0:O[IE(0x29e)])?defaults['paginationArgs']:{},Q=Object['assign'](Object[IE(0x2c8)]({},(w=(p=a[IE(0x269)])===null||p===void 0x0?void 0x0:p[IE(0x2a3)])!==null&&w!==void 0x0?w:{}),z),c=Object['keys'](Q)[IE(0x237)](l=>l!==IE(0x27e));return yield(0x0,utils_1[IE(0x1ff)])(c,l=>__awaiter(this,void 0x0,void 0x0,function*(){const Ij=IE;if(o[l]!==undefined)return _[Ij(0x2e1)](Z,l,o[l]);})),Z;});}function W(){const IU=Iz;switch(V[0x0]){case IU(0x24d):return IU(0x2ab)+(V[0x1]||'resource')+'s';case IU(0x20f):return IU(0x266)+(V[0x1]||IU(0x204))+IU(0x2d8);default:return _[IU(0x24a)](f)+IU(0x1f4);}}function u(o,O){const ID=Iz;var p,w,Z,z,Q,c,l,n;if(!O){const P=(0x0,utils_1[ID(0x1fe)])()[ID(0x28f)](_[ID(0x229)](f))[ID(0x250)](W());return s(P,f),P;}const m=(o===null||o===void 0x0?void 0x0:o['requiredPermissions'])?chalk_1[ID(0x20a)][ID(0x291)](ID(0x222)+o['requiredPermissions']):'',E=I['contextProvider'][ID(0x2f0)](),j=E!==undefined&&((p=a===null||a===void 0x0?void 0x0:a[ID(0x269)])===null||p===void 0x0?void 0x0:p[ID(0x1f9)])!==undefined,U=E===null||E===void 0x0?void 0x0:E[ID(0x215)][ID(0x2ac)](ID(0x274),''),D=j?ID(0x1e1)+U+ID(0x286)+((w=a===null||a===void 0x0?void 0x0:a['opt'])===null||w===void 0x0?void 0x0:w[ID(0x1f9)]):'',M=(o===null||o===void 0x0?void 0x0:o[ID(0x250)])||'',R=(0x0,utils_1[ID(0x1fe)])(!![])[ID(0x28f)](_[ID(0x229)](f))[ID(0x250)](M)[ID(0x243)](ID(0x261),[m,D][ID(0x208)]('\x0a'));s(R,f);(((Z=a[ID(0x269)])===null||Z===void 0x0?void 0x0:Z[ID(0x23e)])||((z=a['opt'])===null||z===void 0x0?void 0x0:z['nonInteractiveEndpoint']))&&(R[ID(0x25e)](ID(0x264),ID(0x1fd)),R[ID(0x25e)](ID(0x24b),ID(0x2a8)));r((Q=a['opt'])===null||Q===void 0x0?void 0x0:Q[ID(0x2c2)],R),r((c=a[ID(0x269)])===null||c===void 0x0?void 0x0:c[ID(0x2a3)],R);const Y=(l=a[ID(0x269)])===null||l===void 0x0?void 0x0:l[ID(0x29e)];return Y&&r(defaults[ID(0x2dc)],R),r((n=a[ID(0x269)])===null||n===void 0x0?void 0x0:n[ID(0x2cd)],R),R['action'](()=>__awaiter(this,void 0x0,void 0x0,function*(){const IM=ID;var k,L,N,T,y,e;(0x0,utils_1[IM(0x295)])(I);const i=R['opts']();(i===null||i===void 0x0?void 0x0:i[IM(0x2c7)])&&utils_1[IM(0x206)]&&(0x0,utils_1[IM(0x1f7)])(IM(0x2a0));const I0=i['page']!==undefined||i['cursor']!==undefined;if(i[IM(0x27e)]===!![]&&I0)throw new Error(IM(0x28c));const I1=i===null||i===void 0x0?void 0x0:i[IM(0x2e3)],I2=I1===IM(0x23d),I3=I1===IM(0x1f5)||I1===IM(0x1fb),I4=yield K(i);H[IM(0x22e)](I4);const I5=yield b(i),I6=Object[IM(0x210)]((L=(k=a[IM(0x269)])===null||k===void 0x0?void 0x0:k[IM(0x2c2)])!==null&&L!==void 0x0?L:{})['map'](IB=>IB+'='+chalk_1[IM(0x20a)]['green'](I4[IB]))[IM(0x208)](',\x20');if(I6[IM(0x2b8)]>0x0&&!I2&&!I3){const IB=IM(0x230)+I6;console[IM(0x242)](IB);}const I7=((N=a['opt'])===null||N===void 0x0?void 0x0:N[IM(0x23e)])||((T=a[IM(0x269)])===null||T===void 0x0?void 0x0:T['nonInteractiveEndpoint'])?yield S(i,a,V):undefined;if(!i[IM(0x2b9)]&&V[IM(0x232)]('delete')&&!(yield H['deleteWarningPrompt']())){(0x0,utils_1[IM(0x1f7)])('Resource\x20was\x20not\x20deleted.');return;}const I8=Y&&(i[IM(0x27e)]||(i[IM(0x2e3)]==='json'||i[IM(0x2e3)]==='yaml')&&!I0);let I9=I8&&v instanceof js_client_1['GetApiEndpointPaginated']?yield v[IM(0x2eb)]({'parameters':I4,'options':I5,'data':I7}):yield v['call']({'parameters':I4,'options':Object[IM(0x2c8)]({},I5),'data':I7});if(i===null||i===void 0x0?void 0x0:i['verbose']){const IJ=I9[IM(0x2f4)];console['log']('VERBOSE:\x20Using\x20endpoint\x20->\x20'+IJ[IM(0x2f1)][IM(0x258)]()+':'+IJ['url']);if(I7!==undefined)console[IM(0x242)](IM(0x1fc)+I7);}if(I9[IM(0x27b)]){const {details:IC,id:IG,message:IF,status:IA}=I9[IM(0x27b)],IH=IC?IM(0x2dd)+JSON['stringify'](IC):'',It=IG?IM(0x267)+IG:'',Id=IM(0x284)+IA+It+')';throw new Error(IM(0x280)+IF+'\x20'+Id+IH);}let II=0x0;printCallResult(i,I2,I9[IM(0x257)],I3,V,I1,![],II,I9[IM(0x2ba)][IM(0x278)]);if(!i[IM(0x2bc)]&&!I8&&!I0&&((y=I9['pagination'])===null||y===void 0x0?void 0x0:y[IM(0x288)]))while((e=I9[IM(0x249)])===null||e===void 0x0?void 0x0:e[IM(0x288)]){const IX=yield H['askConfirm'](IM(0x234));if(IX)process['stdout'][IM(0x1eb)](0x0,-0x1),process['stdout'][IM(0x27a)](0x1),II+=I9['pagination'][IM(0x2cc)],I9=yield I9['pagination']['getNextPage'](),printCallResult(i,I2,I9[IM(0x257)],I3,V,I1,!![],II,I9[IM(0x2ba)]['statusText']);else return;}})),R;}const h=_['has'](a,Iz(0x269)),q=v,x=u(q,h);X(V,x),J[Iz(0x2f6)](x);const g=_['omit'](a,Iz(0x269));Object[Iz(0x210)](g)[Iz(0x2b8)]>0x0&&generateCommands(I,v,x,C,G,g,V);});function S(f,v,a){return __awaiter(this,void 0x0,void 0x0,function*(){const IR=a1B;var V;const {input:r,file:s}=f;if(r!==undefined)try{return JSON[IR(0x25c)](r);}catch(K){try{return yaml[IR(0x26c)](r);}catch(b){throw new Error(IR(0x1f0));}}if(s!==undefined){if(!fs_1[IR(0x20a)][IR(0x239)](s))throw new Error('File\x20does\x20not\x20exist:\x20'+s);const W=fs_1[IR(0x20a)][IR(0x244)](s)[IR(0x290)]();let u;try{if(_[IR(0x221)](W)){if(f['file']['endsWith']('.json'))u=JSON[IR(0x25c)](W);else{if(f[IR(0x252)][IR(0x2be)]('.yaml')||f[IR(0x252)]['endsWith']('yml'))u=yaml[IR(0x26c)](W);else throw new Error('Unknown\x20input\x20file\x20type:\x20'+f['file'][IR(0x251)]('.')[IR(0x2e2)]());}}else u=W;return u;}catch(h){throw new Error('Failed\x20to\x20validate\x20input\x20(incorrect\x20format):\x20'+h[IR(0x282)]);}}if((V=v===null||v===void 0x0?void 0x0:v[IR(0x269)])===null||V===void 0x0?void 0x0:V[IR(0x2ea)])throw new Error(IR(0x220));return yield H[IR(0x21c)](v,{'cmdPath':a,'skipValidation':f[IR(0x296)]});});}}function a1I(){const IP=['all','type','addon','CliContext','exitCode','getCurrentContext','method','OPTIONAL:\x20','./exec','request','./port-forward','addCommand','help\x20[command]','Documentation:\x20','CliPortForward','getCurrentServiceName','./formatting/command-overview','jobs','isArray','8714912gzxDLZ','\x20--','credential','forEach','moveCursor','repositories','resourceTagId','has','78723EmZpib','Unknown\x20input\x20format.\x20Not\x20valid\x20json\x20and\x20not\x20valid\x20yaml.','1020575wnMOkk','askForSubdomainPath','customUserAgent','\x20Northflank\x20resources','yaml','__createBinding','warning','alias','docsTagsPath','./copy','yml','VERBOSE:\x20Request\x20body\x20->\x20','File\x20to\x20load\x20resource\x20json\x20from','getCommand','asyncSequential','template','clusterId','serviceId','__importStar','resource','__esModule','proxyEnvsSet','apply','join','scrt','default','6nwXLKF','agent','ApiClientFileContextProvider','askForBuild','update','keys','__setModuleDefault','handleJsonOutput','askForTemplate','required','host','subdomain','projects','getCommandOverview','-v,\x20--version','vol','execCmd','retrievePayloadViaInteractiveCli','branches','printAsTable','@northflank/js-client','Expecting\x20resource\x20input\x20with\x20\x27--input\x27\x20or\x20\x27--file\x27\x20argument','isString','\x0a>\x20Token\x20permissions\x20required:\x20','askForAddonBackup','prototype','Display\x20help\x20for\x20command','templateId','services','project','kebabCase','./formatting/console-format-helpers','custom-columns=','buildId','boolean','setPathVars','../package.json','=>\x20running\x20command\x20with:\x20','askForVolume','includes','7szNLek','there\x20are\x20more\x20rows,\x20load?','7094520jqxasZ','tags','filter','throw','existsSync','create','checkUpdate','handleYamlOutput','json','body','argv','next','consoleFormat','log','addHelpText','readFileSync','askForCredentials','call','./inquirer-helper','getMetricsCommand','pagination','upperFirst','-i,\x20--input\x20<resource-def>','jobId','get','concat','helpOption','description','split','file','--verbose','downloadCmd','runs','backup-destination','data','toUpperCase','entries','Command','defineProperty','parse','askForDomain','option','enablePositionalOptions','getProgram','after','js-yaml','2211150aMskIR','-f,\x20--file\x20<file-path>','invoices','Update\x20Northflank\x20',',\x20NF\x20error\x20id:\x20','trim','opt','secret','contexts','load','CliFileCopy','svc','value','helpCommand','credentials','portFwdCmd','sort','api.','brn','addons','job','statusText','inv','clearLine','error','24801282DZzuTm','subdomainId','loadAll','contextProvider','API\x20request\x20failed\x0a\x09Message:\x20','repos','message','version','(HTTP\x20status\x20code:\x20','askForBackupDestination','/docs/v1/api/','getLogsCommand','hasNextPage','./context/contextCommands','configurable','secrets','Options\x20\x27loadAll\x27\x20can\x20not\x20be\x20combined\x20with\x20\x27page\x27\x20or\x20\x27cursor\x27','./utils','commander','name','toString','italic','domainId','plans','commands','assertContextExisting','skipValidation','cred','backupDestinationId','login','1BnfqwB','isEqual','done','templateRunId','isPaginatedEndpoint','projectId','VERBOSE:\x20HTTP_PROXY\x20or\x20HTTPS_PROXY\x20environment\x20variable\x20set:\x20tunnelling\x20traffic\x20through\x20HTTP\x20proxy.','CliMetrics','bind','query','invoice','runId','askForLogSink','backup-destinations','JSON-formatted\x20resource\x20definition,\x20takes\x20precedence\x20over\x20\x22--file\x22','lodash','ApiClient','Get\x20information\x20about\x20Northflank\x20','replace','regions','logs','askForSubdomain','backups','toLowerCase','startsWith','InquirerHelper','credentialId','askGeneric','volumeId','find','length','force','rawResponse','repo','quiet','Error\x20occured\x20while\x20trying\x20to\x20run\x20command,\x20error:\x20','endsWith','volume','backup','defaults','path','askForJobRun','addonId','aliases','list','verbose','assign','./logs','delete','askForSecret','count','base','secretId','subdomainPath','pipelineId','1214666eakYlM','adn','templates','askForJob','pln','some','parseAsync','\x20properties','domain','askForTemplateRun','getOwnPropertyNames','paginationArgs','\x0a\x09details\x20:','backupId','chalk','rgn','set','pop','output','__awaiter','68pfZcZm','map','CliLogs','domains','service','nonInteractiveEndpoint'];a1I=function(){return IP;};return a1I();}const printCallResult=(I,B,J,C,G,F,A,H,t)=>{const IY=a1If;if(!(I===null||I===void 0x0?void 0x0:I[IY(0x2bc)])){if(B)(0x0,console_format_helpers_1[IY(0x212)])(I===null||I===void 0x0?void 0x0:I['output'],J);else{if(C)(0x0,console_format_helpers_1[IY(0x23c)])(I===null||I===void 0x0?void 0x0:I[IY(0x2e3)],J);else{if(isListCommand(G)){const d=(F===null||F===void 0x0?void 0x0:F[IY(0x2b2)](IY(0x22b)))?F[IY(0x2ac)]('custom-columns=','')['split'](',')[IY(0x2e6)](a=>a[IY(0x2b1)]()):undefined,X=G[G[IY(0x2b8)]-0x1],S=''+X+(X[IY(0x2be)]('s')?'':'s'),f=_[IY(0x24a)](S),v=_[IY(0x1ee)](J,S)?J[S]:J;(0x0,console_format_helpers_1[IY(0x21e)])(v,f,d,A,H);}else console[IY(0x242)]((0x0,console_format_helpers_1[IY(0x241)])(J,t));}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a2t=a2h;(function(j,h){const E=a2h,N=j();while(!![]){try{const F=parseInt(E(0x197))/0x1+-parseInt(E(0x167))/0x2+parseInt(E(0x1c9))/0x3+-parseInt(E(0x1a9))/0x4+parseInt(E(0x1fc))/0x5+-parseInt(E(0x1be))/0x6+parseInt(E(0x176))/0x7*(parseInt(E(0x1b5))/0x8);if(F===h)break;else N['push'](N['shift']());}catch(K){N['push'](N['shift']());}}}(a2j,0x4d494));function a2h(j,h){const N=a2j();return a2h=function(F,K){F=F-0x164;let G=N[F];return G;},a2h(j,h);}var __createBinding=this&&this[a2t(0x1f2)]||(Object[a2t(0x199)]?function(j,h,N,F){const H=a2t;if(F===undefined)F=N;var K=Object[H(0x1d6)](h,N);(!K||(H(0x18c)in K?!h[H(0x1cd)]:K['writable']||K['configurable']))&&(K={'enumerable':!![],'get':function(){return h[N];}}),Object[H(0x1f9)](j,F,K);}:function(j,h,N,F){if(F===undefined)F=N;j[F]=h[N];}),__setModuleDefault=this&&this[a2t(0x180)]||(Object[a2t(0x199)]?function(j,h){const a=a2t;Object[a(0x1f9)](j,'default',{'enumerable':!![],'value':h});}:function(j,h){const q=a2t;j[q(0x16d)]=h;}),__importStar=this&&this[a2t(0x1a6)]||function(j){const R=a2t;if(j&&j[R(0x1cd)])return j;var h={};if(j!=null){for(var N in j)if(N!=='default'&&Object[R(0x190)][R(0x17a)][R(0x1c0)](j,N))__createBinding(h,j,N);}return __setModuleDefault(h,j),h;},__awaiter=this&&this['__awaiter']||function(j,h,N,F){function K(G){return G instanceof N?G:new N(function(d){d(G);});}return new(N||(N=Promise))(function(G,d){const L=a2h;function x(I){try{e(F['next'](I));}catch(X){d(X);}}function m(I){const n=a2h;try{e(F[n(0x1ee)](I));}catch(X){d(X);}}function e(I){const k=a2h;I[k(0x1a1)]?G(I[k(0x1bd)]):K(I[k(0x1bd)])['then'](x,m);}e((F=F[L(0x1b4)](j,h||[]))[L(0x1a7)]());});},__importDefault=this&&this[a2t(0x166)]||function(j){const A=a2t;return j&&j[A(0x1cd)]?j:{'default':j};};Object[a2t(0x1f9)](exports,'__esModule',{'value':!![]}),exports['CliContext']=void 0x0;const _=__importStar(require('lodash')),proxy_agent_1=require(a2t(0x179)),chalk_1=__importDefault(require(a2t(0x181))),utils_1=require('../utils'),inquirer_helper_1=require(a2t(0x164)),console_format_helpers_1=require(a2t(0x1a3)),browser_login_1=require('../login/browser-login'),node_fetch_1=__importDefault(require(a2t(0x1c5))),inquirer=require(a2t(0x1c3));class CliContext{constructor(j,h=undefined,N=a2t(0x169)){const v=a2t;this[v(0x1d0)]=h,this[v(0x18f)]=N,this[v(0x1b0)]=X=>{const s=v;let l=X;return!/^https?:\/\//i[s(0x1e6)](l)&&(l=s(0x1fb)+l),l=l['replace'](/\/+$/,''),l;},this[v(0x18d)]=j;const F=new inquirer_helper_1['InquirerHelper'](j);this[v(0x16e)]=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x16e))[v(0x17b)](v(0x192))[v(0x184)](v(0x1d5),v(0x175),![])[v(0x184)]('--do-not-open-browser',v(0x1e5),![])['option'](v(0x1ef),v(0x1ca))[v(0x184)](v(0x1f3),v(0x1ad))[v(0x184)](v(0x198),v(0x1f0),this['defaultBaseUrl'])['option'](v(0x1ff),v(0x1b8),![])[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const U=v;_[U(0x1c8)](X,U(0x1fe),this[U(0x1b0)](X[U(0x1fe)]));const l=X['tokenLogin']||X[U(0x1d9)]!==undefined,{name:p,host:J,token:Q,override:y}=l?yield this['apiTokenLogin'](X,F):yield this['browserLogin'](X,F);try{yield this[U(0x18d)]['contextProvider'][U(0x16a)]({'name':p,'host':J,'token':Q},y);}catch(D){(0x0,utils_1['error'])(D[U(0x1f6)]);return;}if(!(yield this[U(0x19b)]()))(0x0,utils_1[U(0x18a)])(U(0x1dc)),yield this[U(0x18d)][U(0x1d4)][U(0x201)](p);else{const i=l?U(0x1fa):U(0x165),W=U(0x178)+i+',\x20added\x20context\x20with\x20name\x20'+chalk_1[U(0x16d)][U(0x1f5)](p)+'\x20(api\x20host:\x20'+J+')';(0x0,utils_1['success'])(W);}})),this[v(0x1e8)]=(0x0,utils_1[v(0x16f)])()[v(0x188)]('context')[v(0x17b)](v(0x1e1))['alias'](v(0x1e8))[v(0x200)]('ctx');const K=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x170))[v(0x188)]('ls')[v(0x17b)](v(0x17c))[v(0x184)]('--all','Shows\x20full\x20context\x20information\x20(including\x20tokens)')['action'](X=>__awaiter(this,void 0x0,void 0x0,function*(){const r=v;console['log'](j[r(0x1d4)]['getInfo']());const l=j[r(0x1d4)][r(0x1a2)]();if(X['all']===!![]){console[r(0x1ae)](l);return;}const p=l['current'],J=l[r(0x1e8)][r(0x19c)]((Q,y)=>Q[r(0x188)]===p?-0x1:y[r(0x188)]===p?0x1:0x0)['map'](Q=>{const V=r,y=p===Q['name']?V(0x1f7):'';return{'Name':''+Q[V(0x188)]+y,'Host':Q[V(0x1fe)],'Default\x20Project':Q[V(0x19f)]||'-','Default\x20Service':Q[V(0x1d7)]||'-'};});(0x0,console_format_helpers_1[r(0x195)])(J,r(0x1dd));})),G=(0x0,utils_1[v(0x16f)])();G[v(0x188)]('use')[v(0x17b)](v(0x196))['option'](v(0x1ef),v(0x1e7))[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const f=v,l=(X===null||X===void 0x0?void 0x0:X[f(0x188)])||(yield this[f(0x1f4)](f(0x16c)));yield this['apiClient'][f(0x1d4)][f(0x1ec)](l),(0x0,utils_1['success'])('Changed\x20current\x20context\x20to\x20'+l);}));const d='-i,\x20--id\x20[ID]',x=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x19f))[v(0x17b)]('Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context')[v(0x184)](d,v(0x1ba))[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const O=v,l=(X===null||X===void 0x0?void 0x0:X['id'])||(yield F[O(0x1b1)]());yield this[O(0x18d)][O(0x1d4)][O(0x1f1)](l),console[O(0x1c7)](O(0x194),l);})),m=(0x0,utils_1['getCommand'])()['name'](v(0x1d7))[v(0x17b)](v(0x183))[v(0x184)](d,v(0x182))['action'](X=>__awaiter(this,void 0x0,void 0x0,function*(){const z=v,l=(X===null||X===void 0x0?void 0x0:X['id'])||(yield F[z(0x18b)](this[z(0x1df)]())());console[z(0x1c7)](z(0x19e),l),yield this[z(0x18d)][z(0x1d4)][z(0x1c4)](l);})),P=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x185))[v(0x17b)](v(0x1bb))[v(0x184)](d,'Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context')['action'](X=>__awaiter(this,void 0x0,void 0x0,function*(){const b=v,l=(X===null||X===void 0x0?void 0x0:X['id'])||(yield F[b(0x1eb)](this[b(0x1df)]())());console[b(0x1c7)](b(0x1b7),l),yield this[b(0x18d)]['contextProvider'][b(0x1a4)](l);}));G[v(0x193)](x),G[v(0x193)](P),G[v(0x193)](m);const e=(0x0,utils_1[v(0x16f)])()[v(0x188)]('remove')[v(0x200)](v(0x1b3))[v(0x200)]('rm')[v(0x17b)](v(0x1e9))[v(0x184)](d,v(0x1e0))[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const T=v;var l;const p=(X===null||X===void 0x0?void 0x0:X['id'])||(yield this[T(0x1f4)]('remove')),J=(l=this['apiClient'][T(0x1d4)][T(0x17e)]())===null||l===void 0x0?void 0x0:l[T(0x188)];yield this[T(0x18d)][T(0x1d4)]['removeContext'](p),(0x0,utils_1[T(0x186)])(T(0x172)+p+T(0x1c6));if(!this[T(0x1d2)]()){(0x0,utils_1[T(0x187)])(T(0x1f8));return;}if(J===p){const Q=(X===null||X===void 0x0?void 0x0:X[T(0x188)])||(yield this[T(0x1f4)](T(0x19a)));yield this[T(0x18d)][T(0x1d4)][T(0x1ec)](Q),(0x0,utils_1[T(0x186)])(T(0x16b)+Q);}})),I=(0x0,utils_1[v(0x16f)])()[v(0x188)](v(0x1a0))[v(0x200)](v(0x1b6))[v(0x17b)](v(0x173))['option'](v(0x1f3),v(0x1cc))[v(0x1c2)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const u=v,{contextProvider:l}=this[u(0x18d)],p=(X===null||X===void 0x0?void 0x0:X['token'])||(yield F[u(0x1aa)]()),J=l[u(0x191)]();yield l[u(0x1e3)](p);if(yield this['verifyToken']())(0x0,utils_1['success'])('Token\x20for\x20current\x20context\x20\x27'+l['getCurrentName']()+u(0x1b2));else{if(J)yield l[u(0x1e3)](J);(0x0,utils_1[u(0x18a)])(u(0x1db));}}));this['contexts'][v(0x193)](K),this[v(0x1e8)][v(0x193)](G),this[v(0x1e8)][v(0x193)](e),this[v(0x1e8)]['addCommand'](I);}['browserLogin'](j,h){var N,F,K,G;return __awaiter(this,void 0x0,void 0x0,function*(){const Z=a2h,d=!j[Z(0x1d1)],x=(N=j[Z(0x1fe)])!==null&&N!==void 0x0?N:this[Z(0x18f)],m=new browser_login_1[(Z(0x1ac))](x,d,this[Z(0x1d0)]);let P;m['on']('browser-opened',({url:l})=>{const S=Z;if(d){const p=l[S(0x1cf)](/sessionToken=.*/,'sessionToken=********');console[S(0x1c7)](S(0x1ea)+p+')'),P=inquirer[S(0x1a5)]([{'type':'confirm','name':S(0x1d8),'message':S(0x1a8),'default':![]}]),P[S(0x1ed)](J=>{const Y=S;process[Y(0x1b9)]['moveCursor'](0x0,-0x1),process['stdout'][Y(0x1de)](0x1),J[Y(0x1d8)]&&console[Y(0x1c7)]('Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09'+l+'\x20');});}else console[S(0x1c7)](S(0x174)+l+'\x20');});const {token:e,contextName:I}=yield m[Z(0x1d3)]()[Z(0x1c1)](l=>__awaiter(this,void 0x0,void 0x0,function*(){const M=Z;(0x0,utils_1[M(0x18a)])(M(0x19d)+l[M(0x1f6)]+M(0x177));const p=yield this['apiTokenLogin'](j,h);return{'token':p[M(0x1d9)],'contextName':p[M(0x188)]};}))[Z(0x168)](()=>{if(P)P['ui']['close']();}),X=(K=(F=j['name'])!==null&&F!==void 0x0?F:I)!==null&&K!==void 0x0?K:Z(0x171)+new Date()[Z(0x1e2)]();return{'name':X,'token':e,'host':x,'override':(G=j['override'])!==null&&G!==void 0x0?G:![]};});}[a2t(0x17f)](j,h){return __awaiter(this,void 0x0,void 0x0,function*(){const w=a2h,N=this[w(0x18d)][w(0x1d4)][w(0x1a2)]()[w(0x1e8)],{name:F,token:K,host:G,override:d}=yield h[w(0x18e)](j,N);return{'name':F,'token':K,'host':G,'override':d};});}[a2t(0x1df)](){const C=a2t,j=this[C(0x18d)][C(0x1d4)][C(0x1af)]();if(j===undefined)throw new Error(C(0x1e4));return j;}['askForContext'](j){return __awaiter(this,void 0x0,void 0x0,function*(){const o=a2h;if(!this['contextAvailable']())throw new Error('No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.');const h=this[o(0x18d)][o(0x1d4)]['loadContextWrapper']()[o(0x1e8)][o(0x1da)](F=>F[o(0x188)]),N=h['length']>0x4?o(0x1ab):o(0x170);return(yield inquirer[o(0x1a5)]([{'type':N,'name':'name','message':o(0x1bf)+j+':','choices':h}]))[o(0x188)];});}['contextAvailable'](){const g=a2t;return this[g(0x18d)]['contextProvider'][g(0x1a2)]()['contexts']['length']>0x0;}[a2t(0x19b)](){return __awaiter(this,void 0x0,void 0x0,function*(){const c=a2h;try{const j=this[c(0x18d)]['contextProvider'][c(0x1cb)](),h=this[c(0x18d)][c(0x1d4)][c(0x191)](),N=j+'/v1/login',F={'Authorization':c(0x1ce)+h},K=new proxy_agent_1[(c(0x189))](),G=yield(0x0,utils_1['retry'])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const B=c;return(0x0,node_fetch_1[B(0x16d)])(N,{'method':B(0x1bc),'signal':AbortSignal[B(0x1fd)](0xbb8),'headers':F,'agent':K});}));if(G['ok'])return!![];return![];}catch(d){return![];}});}}exports[a2t(0x17d)]=CliContext;function a2j(){const j0=['addContext','Changed\x20current\x20context\x20to\x20','use','default','login','getCommand','list','autologin-','Local\x20context\x20\x27','Update\x20token\x20for\x20current\x20context','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','Use\x20manual\x20login\x20with\x20API\x20token','6818VpKrSM','.\x20Using\x20fallback.','\x0aSuccessfully\x20logged\x20in\x20using\x20','proxy-agent','hasOwnProperty','description','List\x20all\x20available\x20contexts','CliContext','getCurrentContext','apiTokenLogin','__setModuleDefault','chalk','Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context','option','job','success','warning','name','ProxyAgent','error','askForService','get','apiClient','loginPrompt','defaultBaseUrl','prototype','getCurrentToken','Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.','addCommand','Use\x20project\x20with\x20id:','printAsTable','Switch\x20between\x20your\x20local\x20contexts','323380VNhDXD','--host\x20[HOST]','create','use\x20from\x20now\x20on','verifyToken','sort','Error\x20occured\x20during\x20browser\x20login:\x20','Use\x20service\x20with\x20id:','project','update-token','done','loadContextWrapper','../formatting/console-format-helpers','useJobId','prompt','__importStar','next','Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','395808hlCspM','tokenPrompt','search-list','NorthflankApiBrowserLogin','Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used','dir','getCurrentProjectName','sanitiseHostname','askForProject','\x27\x20successfully\x20updated.','delete','apply','1992aKzpvo','set-token','Use\x20job\x20with\x20id:','Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)','stdout','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','GET','value','2460732qbxfHN','Choose\x20the\x20context\x20to\x20','call','catch','action','inquirer','useServiceId','node-fetch','\x27\x20successfully\x20removed.','log','set','1255707qeBoQL','Name\x20for\x20login\x20context','getCurrentBaseUrl','Token\x20for\x20this\x20context','__esModule','Bearer\x20','replace','agent','doNotOpenBrowser','contextAvailable','startLogin','contextProvider','--token-login','getOwnPropertyDescriptor','service','fullUrl','token','map','Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','Contexts','clearLine','getProjectName','Local\x20context\x20name\x20to\x20remove.','Retrieve\x20and\x20update\x20local\x20context\x20settings.','valueOf','updateToken','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','test','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','contexts','Remove\x20a\x20context','Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20','askForJob','useContext','then','throw','-n,\x20--name\x20[NAME]','host\x20url\x20for\x20this\x20context','useProjectId','__createBinding','-t,\x20--token\x20[TOKEN]','askForContext','italic','message','\x20(current)','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','defineProperty','token\x20login','https://','1573510YifVno','timeout','host','--override','alias','removeContext','../inquirer-helper','browser\x20login','__importDefault','947078RxInpO','finally','https://api.northflank.com'];a2j=function(){return j0;};return a2j();}
|
|
1
|
+
'use strict';const a2q=a2B;(function(I,B){const h=a2B,J=I();while(!![]){try{const C=parseInt(h(0x198))/0x1+-parseInt(h(0x18a))/0x2*(parseInt(h(0x1ee))/0x3)+-parseInt(h(0x173))/0x4+parseInt(h(0x1da))/0x5+parseInt(h(0x17e))/0x6+parseInt(h(0x21d))/0x7*(parseInt(h(0x1ff))/0x8)+parseInt(h(0x195))/0x9*(-parseInt(h(0x1bb))/0xa);if(C===B)break;else J['push'](J['shift']());}catch(G){J['push'](J['shift']());}}}(a2I,0x4e9f0));function a2B(I,B){const J=a2I();return a2B=function(C,G){C=C-0x171;let F=J[C];return F;},a2B(I,B);}function a2I(){const I6=['-t,\x20--token\x20[TOKEN]','Service\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','confirm','-n,\x20--name\x20[NAME]','list','name','printAsTable','hasOwnProperty','Failed\x20to\x20login\x20with\x20the\x20provided\x20token,\x20make\x20sure\x20to\x20use\x20a\x20valid\x20token\x20and\x20host.','prompt','getInfo','writable','Display\x20full\x20URL\x20to\x20allow\x20opening\x20the\x20link\x20manually','apiClient','getOwnPropertyNames','205030rFSpCW','host\x20url\x20for\x20this\x20context','\x0a\x20\x20Host:\x09\x09\x09','--token-login','tokenLogin','prototype','removeContext','call','autologin-',':\x20\x0a\x20\x20Name:\x09\x09\x09','getCurrentProjectName','--do-not-open-browser','use\x20from\x20now\x20on','__setModuleDefault','__createBinding','List\x20all\x20available\x20contexts','next','Contexts','verifyToken','\x0a\x20\x20Token\x20Role\x20ID:\x09','99UxwLtS','success','--all','InquirerHelper','apply','map','fullUrl','askForJob','__importStar','No\x20context\x20available.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','browserLogin','job','Project\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','Current\x20token\x20info','Change\x20the\x20default\x20job\x20in\x20the\x20current\x20local\x20context','\x0aSuccessfully\x20logged\x20in\x20using\x20','Shows\x20full\x20context\x20information\x20(including\x20tokens)','123856rHVhDf','show','length','../utils','update-token','Name\x20for\x20login\x20context','test','Local\x20context\x20\x27','Override\x20existing\x20contexts\x20(this\x20will\x20remove\x20project\x20and\x20service\x20context)','service','Change\x20the\x20default\x20project\x20in\x20the\x20current\x20local\x20context','moveCursor','error','loadContextWrapper','override','lodash','getCurrentContext','close','delete','ctx','Choose\x20the\x20context\x20to\x20','https://','Bearer\x20','.\x20Using\x20fallback.','askForContext','defineProperty','throw','stdout','Use\x20project\x20with\x20id:','Use\x20manual\x20login\x20with\x20API\x20token','35eiNLQO','startLogin','sanitiseHostname','askForService','useProjectId','1042120wZVOHo','useServiceId','warning','description','defaultBaseUrl','\x0a\x20\x20Default\x20Project:\x09','project','message','Connect\x20the\x20CLI\x20to\x20your\x20Northflank\x20account.','GET','Use\x20browser\x20login\x20but\x20only\x20print\x20URL\x20which\x20can\x20be\x20used\x20to\x20login','2704374hUMHRE','getCommand','Changed\x20current\x20context\x20to\x20','decodeJwtPayload','Follow\x20the\x20steps\x20displayed\x20on\x20the\x20page\x20opened\x20in\x20the\x20browser\x20(URL\x20opened:\x20','CliContext','token','updateToken','action','\x0a\x20\x20\x20\x20\x20\x20\x20\x20','done','https://api.northflank.com','21806IvZUbS','use','addContext','Retrieve\x20and\x20update\x20local\x20context\x20settings.','contexts','useJobId','../inquirer-helper','Change\x20current\x20context\x20to\x20context\x20identified\x20by\x20this\x20name','browser-opened','useContext','Open\x20this\x20URL\x20in\x20your\x20browser\x20and\x20follow\x20the\x20steps:\x0a\x09','95301fbpiky','askForProject','getProjectName','553229IbidWy','inquirer','create','node-fetch','\x0a\x20\x20Token\x20ID:\x09\x09','apiTokenLogin','No\x20current\x20context\x20set.\x20Use\x20\x27northflank\x20login\x27\x20to\x20create\x20one\x20or\x20\x27northflank\x20context\x20use\x27\x20to\x20select\x20an\x20existing\x20one.','Job\x20name\x20(internal\x20id)\x20to\x20use\x20as\x20default\x20in\x20context','set','remove','Token\x20for\x20this\x20context.\x20When\x20set,\x20browser\x20login\x20is\x20not\x20used','get','replace','login','proxy-agent','bold','sort','current','agent','Change\x20the\x20default\x20service\x20in\x20the\x20current\x20local\x20context','alias','Remove\x20a\x20context','\x20(api\x20host:\x20','contextAvailable','context','then','set-token','browser\x20login','log','__esModule','option','contextProvider','search-list','\x20(current)','italic','170OUAtMj','timeout','clearLine','configurable','addCommand','getCurrentBaseUrl','getCurrentName','finally','all','No\x20context\x20available.\x20Please\x20use\x20\x27northflank\x20login\x27\x20to\x20create\x20context.','Switch\x20between\x20your\x20local\x20contexts','chalk','No\x20project\x20in\x20current\x20context.\x20Please\x20set\x20project\x20before\x20setting\x20a\x20project-scoped\x20resource','default','valueOf','host'];a2I=function(){return I6;};return a2I();}var __createBinding=this&&this[a2q(0x1e8)]||(Object[a2q(0x19a)]?function(I,B,J,C){const x=a2q;if(C===undefined)C=J;var G=Object['getOwnPropertyDescriptor'](B,J);(!G||(x(0x1a3)in G?!B['__esModule']:G[x(0x1d6)]||G[x(0x1be)]))&&(G={'enumerable':!![],'get':function(){return B[J];}}),Object['defineProperty'](I,C,G);}:function(I,B,J,C){if(C===undefined)C=J;I[C]=B[J];}),__setModuleDefault=this&&this[a2q(0x1e7)]||(Object[a2q(0x19a)]?function(I,B){const g=a2q;Object[g(0x218)](I,g(0x1c8),{'enumerable':!![],'value':B});}:function(I,B){const o=a2q;I[o(0x1c8)]=B;}),__importStar=this&&this[a2q(0x1f6)]||(function(){var I=function(B){const O=a2B;return I=Object[O(0x1d9)]||function(J){const p=O;var C=[];for(var G in J)if(Object[p(0x1df)][p(0x1d2)][p(0x1e1)](J,G))C[C['length']]=G;return C;},I(B);};return function(B){const w=a2B;if(B&&B[w(0x1b5)])return B;var J={};if(B!=null){for(var C=I(B),G=0x0;G<C['length'];G++)if(C[G]!==w(0x1c8))__createBinding(J,B,C[G]);}return __setModuleDefault(J,B),J;};}()),__awaiter=this&&this['__awaiter']||function(I,B,J,C){function G(F){return F instanceof J?F:new J(function(A){A(F);});}return new(J||(J=Promise))(function(F,A){const c=a2B;function H(X){const Z=a2B;try{d(C[Z(0x1ea)](X));}catch(S){A(S);}}function t(X){const z=a2B;try{d(C[z(0x219)](X));}catch(S){A(S);}}function d(X){const Q=a2B;X[Q(0x188)]?F(X['value']):G(X['value'])[Q(0x1b1)](H,t);}d((C=C[c(0x1f2)](I,B||[]))[c(0x1ea)]());});},__importDefault=this&&this['__importDefault']||function(I){const l=a2q;return I&&I[l(0x1b5)]?I:{'default':I};};Object[a2q(0x218)](exports,a2q(0x1b5),{'value':!![]}),exports[a2q(0x183)]=void 0x0;const _=__importStar(require(a2q(0x20e))),proxy_agent_1=require(a2q(0x1a6)),chalk_1=__importDefault(require(a2q(0x1c6))),utils_1=require(a2q(0x202)),inquirer_helper_1=require(a2q(0x190)),console_format_helpers_1=require('../formatting/console-format-helpers'),browser_login_1=require('../login/browser-login'),node_fetch_1=__importDefault(require(a2q(0x19b))),inquirer=require(a2q(0x199));class CliContext{constructor(I,B=undefined,J=a2q(0x189)){const n=a2q;this[n(0x1aa)]=B,this[n(0x177)]=J,this[n(0x21f)]=v=>{const m=n;let a=v;return!/^https?:\/\//i[m(0x205)](a)&&(a=m(0x214)+a),a=a['replace'](/\/+$/,''),a;},this['apiClient']=I;const C=new inquirer_helper_1[(n(0x1f1))](I);this[n(0x1a5)]=(0x0,utils_1['getCommand'])()[n(0x1d0)](n(0x1a5))[n(0x176)](n(0x17b))[n(0x1b6)](n(0x1dd),n(0x21c),![])[n(0x1b6)](n(0x1e5),n(0x17d),![])[n(0x1b6)](n(0x1ce),n(0x204))['option'](n(0x1cb),n(0x1a2))[n(0x1b6)]('--host\x20[HOST]',n(0x1db),this[n(0x177)])[n(0x1b6)]('--override',n(0x207),![])[n(0x186)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const E=n;_[E(0x1a0)](v,E(0x1ca),this[E(0x21f)](v[E(0x1ca)]));const a=v[E(0x1de)]||v['token']!==undefined,{name:V,host:r,token:s,override:K}=a?yield this[E(0x19d)](v,C):yield this[E(0x1f8)](v,C);try{yield this[E(0x1d8)][E(0x1b7)][E(0x18c)]({'name':V,'host':r,'token':s},K);}catch(b){(0x0,utils_1[E(0x20b)])(b[E(0x17a)]);return;}if(!(yield this[E(0x1ec)]()))(0x0,utils_1['error'])(E(0x1d3)),yield this[E(0x1d8)][E(0x1b7)][E(0x1e0)](V);else{const W=a?'token\x20login':E(0x1b3),u=E(0x1fd)+W+',\x20added\x20context\x20with\x20name\x20'+chalk_1['default'][E(0x1ba)](V)+E(0x1ae)+r+')';(0x0,utils_1['success'])(u);}})),this[n(0x18e)]=(0x0,utils_1['getCommand'])()[n(0x1d0)](n(0x1b0))[n(0x176)](n(0x18d))[n(0x1ac)](n(0x18e))[n(0x1ac)](n(0x212));const G=(0x0,utils_1['getCommand'])()[n(0x1d0)](n(0x1cf))['name']('ls')[n(0x176)](n(0x1e9))['option'](n(0x1f0),n(0x1fe))['action'](v=>__awaiter(this,void 0x0,void 0x0,function*(){const j=n;console['log'](I[j(0x1b7)][j(0x1d5)]());const a=I['contextProvider'][j(0x20c)]();if(v[j(0x1c3)]===!![]){console['dir'](a);return;}const V=a[j(0x1a9)],r=a[j(0x18e)][j(0x1a8)]((s,K)=>s['name']===V?-0x1:K[j(0x1d0)]===V?0x1:0x0)['map'](s=>{const U=j,K=V===s[U(0x1d0)]?U(0x1b9):'';return{'Name':''+s[U(0x1d0)]+K,'Host':s['host'],'Default\x20Project':s[U(0x179)]||'-','Default\x20Service':s['service']||'-'};});(0x0,console_format_helpers_1[j(0x1d1)])(r,j(0x1eb));})),F=(0x0,utils_1[n(0x17f)])()[n(0x1d0)](n(0x200))[n(0x176)]('Shows\x20detailed\x20information\x20about\x20current\x20context')[n(0x186)](()=>__awaiter(this,void 0x0,void 0x0,function*(){const D=n;console[D(0x1b4)](I[D(0x1b7)][D(0x1d5)]());const v=I[D(0x1b7)][D(0x20f)]();if(v===undefined){console[D(0x1b4)](D(0x19e));return;}const a=(0x0,utils_1[D(0x181)])(v[D(0x184)]),V=v[D(0x1ca)];console[D(0x1b4)](chalk_1[D(0x1c8)][D(0x1a7)](D(0x1fb))+D(0x1e3)+v[D(0x1d0)]+D(0x1dc)+V+D(0x178)+(v[D(0x179)]||'-')+'\x0a\x20\x20Default\x20Service:\x09'+(v['service']||'-')+D(0x19c)+((a===null||a===void 0x0?void 0x0:a['tokenInternalId'])||'-')+D(0x1ed)+((a===null||a===void 0x0?void 0x0:a['roleInternalId'])||'-')+D(0x187));})),A=(0x0,utils_1[n(0x17f)])();A['name']('use')['description'](n(0x1c5))['option'](n(0x1ce),n(0x191))['action'](v=>__awaiter(this,void 0x0,void 0x0,function*(){const M=n,a=(v===null||v===void 0x0?void 0x0:v['name'])||(yield this[M(0x217)](M(0x18b)));yield this['apiClient'][M(0x1b7)][M(0x193)](a),(0x0,utils_1[M(0x1ef)])(M(0x180)+a);}));const H='-i,\x20--id\x20[ID]',t=(0x0,utils_1['getCommand'])()[n(0x1d0)](n(0x179))[n(0x176)](n(0x209))[n(0x1b6)](H,n(0x1fa))[n(0x186)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const R=n,a=(v===null||v===void 0x0?void 0x0:v['id'])||(yield C[R(0x196)]());yield this['apiClient'][R(0x1b7)][R(0x172)](a),console[R(0x1b4)](R(0x21b),a);})),d=(0x0,utils_1[n(0x17f)])()[n(0x1d0)](n(0x208))[n(0x176)](n(0x1ab))[n(0x1b6)](H,n(0x1cc))[n(0x186)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=n,a=(v===null||v===void 0x0?void 0x0:v['id'])||(yield C[Y(0x171)](this['getProjectName']())());console[Y(0x1b4)]('Use\x20service\x20with\x20id:',a),yield this[Y(0x1d8)][Y(0x1b7)][Y(0x174)](a);})),X=(0x0,utils_1['getCommand'])()['name'](n(0x1f9))['description'](n(0x1fc))[n(0x1b6)](H,n(0x19f))[n(0x186)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const P=n,a=(v===null||v===void 0x0?void 0x0:v['id'])||(yield C[P(0x1f5)](this[P(0x197)]())());console['log']('Use\x20job\x20with\x20id:',a),yield this[P(0x1d8)][P(0x1b7)][P(0x18f)](a);}));A[n(0x1bf)](t),A[n(0x1bf)](X),A['addCommand'](d);const S=(0x0,utils_1[n(0x17f)])()[n(0x1d0)]('remove')[n(0x1ac)](n(0x211))['alias']('rm')[n(0x176)](n(0x1ad))[n(0x1b6)](H,'Local\x20context\x20name\x20to\x20remove.')[n(0x186)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const k=n;var a;const V=(v===null||v===void 0x0?void 0x0:v['id'])||(yield this[k(0x217)](k(0x1a1))),r=(a=this['apiClient'][k(0x1b7)][k(0x20f)]())===null||a===void 0x0?void 0x0:a[k(0x1d0)];yield this['apiClient'][k(0x1b7)][k(0x1e0)](V),(0x0,utils_1[k(0x1ef)])(k(0x206)+V+'\x27\x20successfully\x20removed.');if(!this['contextAvailable']()){(0x0,utils_1[k(0x175)])(k(0x1f7));return;}if(r===V){const s=(v===null||v===void 0x0?void 0x0:v[k(0x1d0)])||(yield this['askForContext'](k(0x1e6)));yield this['apiClient'][k(0x1b7)][k(0x193)](s),(0x0,utils_1[k(0x1ef)])(k(0x180)+s);}})),f=(0x0,utils_1[n(0x17f)])()[n(0x1d0)](n(0x203))[n(0x1ac)](n(0x1b2))[n(0x176)]('Update\x20token\x20for\x20current\x20context')['option'](n(0x1cb),'Token\x20for\x20this\x20context')['action'](v=>__awaiter(this,void 0x0,void 0x0,function*(){const L=n,{contextProvider:a}=this[L(0x1d8)],V=(v===null||v===void 0x0?void 0x0:v['token'])||(yield C['tokenPrompt']()),r=a['getCurrentToken']();yield a[L(0x185)](V);if(yield this[L(0x1ec)]())(0x0,utils_1[L(0x1ef)])('Token\x20for\x20current\x20context\x20\x27'+a[L(0x1c1)]()+'\x27\x20successfully\x20updated.');else{if(r)yield a[L(0x185)](r);(0x0,utils_1[L(0x20b)])('Failed\x20to\x20login\x20with\x20the\x20provided\x20token.\x20Token\x20was\x20not\x20changed');}}));this[n(0x18e)]['addCommand'](G),this[n(0x18e)][n(0x1bf)](F),this[n(0x18e)][n(0x1bf)](A),this[n(0x18e)][n(0x1bf)](S),this[n(0x18e)][n(0x1bf)](f);}['browserLogin'](I,B){return __awaiter(this,void 0x0,void 0x0,function*(){const N=a2B;var J,C,G,F;const A=!I['doNotOpenBrowser'],H=(J=I[N(0x1ca)])!==null&&J!==void 0x0?J:this[N(0x177)],t=new browser_login_1['NorthflankApiBrowserLogin'](H,A,this['agent']);let d;t['on'](N(0x192),({url:v})=>{const T=N;if(A){const a=v[T(0x1a4)](/sessionToken=.*/,'sessionToken=********');console[T(0x1b4)](T(0x182)+a+')'),d=inquirer[T(0x1d4)]([{'type':T(0x1cd),'name':'fullUrl','message':T(0x1d7),'default':![]}]),d[T(0x1b1)](V=>{const y=T;process[y(0x21a)][y(0x20a)](0x0,-0x1),process[y(0x21a)][y(0x1bd)](0x1),V[y(0x1f4)]&&console[y(0x1b4)](y(0x194)+v+'\x20');});}else console['log'](T(0x194)+v+'\x20');});const {token:X,contextName:S}=yield t[N(0x21e)]()['catch'](v=>__awaiter(this,void 0x0,void 0x0,function*(){const e=N;(0x0,utils_1[e(0x20b)])('Error\x20occured\x20during\x20browser\x20login:\x20'+v['message']+e(0x216));const a=yield this['apiTokenLogin'](I,B);return{'token':a['token'],'contextName':a['name']};}))[N(0x1c2)](()=>{const i=N;if(d)d['ui'][i(0x210)]();}),f=(G=(C=I[N(0x1d0)])!==null&&C!==void 0x0?C:S)!==null&&G!==void 0x0?G:N(0x1e2)+new Date()[N(0x1c9)]();return{'name':f,'token':X,'host':H,'override':(F=I[N(0x20d)])!==null&&F!==void 0x0?F:![]};});}['apiTokenLogin'](I,B){return __awaiter(this,void 0x0,void 0x0,function*(){const I0=a2B,J=this['apiClient'][I0(0x1b7)][I0(0x20c)]()[I0(0x18e)],{name:C,token:G,host:F,override:A}=yield B['loginPrompt'](I,J);return{'name':C,'token':G,'host':F,'override':A};});}[a2q(0x197)](){const I1=a2q,I=this['apiClient'][I1(0x1b7)][I1(0x1e4)]();if(I===undefined)throw new Error(I1(0x1c7));return I;}[a2q(0x217)](I){return __awaiter(this,void 0x0,void 0x0,function*(){const I2=a2B;if(!this[I2(0x1af)]())throw new Error(I2(0x1c4));const B=this[I2(0x1d8)][I2(0x1b7)][I2(0x20c)]()['contexts'][I2(0x1f3)](C=>C[I2(0x1d0)]),J=B['length']>0x4?I2(0x1b8):I2(0x1cf);return(yield inquirer[I2(0x1d4)]([{'type':J,'name':I2(0x1d0),'message':I2(0x213)+I+':','choices':B}]))[I2(0x1d0)];});}['contextAvailable'](){const I3=a2q;return this['apiClient'][I3(0x1b7)]['loadContextWrapper']()[I3(0x18e)][I3(0x201)]>0x0;}[a2q(0x1ec)](){return __awaiter(this,void 0x0,void 0x0,function*(){const I4=a2B;try{const I=this[I4(0x1d8)][I4(0x1b7)][I4(0x1c0)](),B=this['apiClient'][I4(0x1b7)]['getCurrentToken'](),J=I+'/v1/login',C={'Authorization':I4(0x215)+B},G=new proxy_agent_1['ProxyAgent'](),F=yield(0x0,utils_1['retry'])(0x3)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const I5=I4;return(0x0,node_fetch_1[I5(0x1c8)])(J,{'method':I5(0x17c),'signal':AbortSignal[I5(0x1bc)](0xbb8),'headers':C,'agent':G});}));if(F['ok'])return!![];return![];}catch(A){return![];}});}}exports[a2q(0x183)]=CliContext;
|
package/dist/copy/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a3p=a3B;function a3I(){const j=['2275208OhlmyJ','next','Downloaded\x20file\x20\x27','capitalize','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20job.','27bQcvDv','\x20directory:\x20\x20\x20\x20\x20northflank\x20','success','ensureRelevantPathIsSet','8635403MNHNWu','localPath','apiClient','option','Path\x20is\x20not\x20specified,\x20the\x20','charAt','action','uploadCmd','\x27remotePath\x27','defineProperty','logCopyResult','Id\x20[NAME]','--noDefaults','current\x20working','toUpperCase','Downloaded\x20all\x20directory\x20contents\x20from\x20\x27','inquirer','ed-file.txt\x0a\x20\x20','getStandardCopyCommand','2586774TxGkxL','s.\x20Please\x20enter\x20a\x20path:','Project\x20for\x20','upload','download','File\x20and\x20directory\x20download\x20for\x20Northflank\x20service.','getCommand','user\x20home','File\x20and\x20directory\x20download\x20for\x20Northflank\x20job.','\x20file\x20--localPath\x20my_directory\x20--remotePath\x20/home/','file','11528374LXIDZH','Remote\x20file\x20or\x20directory','CopyType','input','287354gqlrMy','slice','downloadCmd','askForService','FILE_UPLOAD','askForPath','getCurrentProjectName','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20services\x20and\x20jobs.','__esModule','4BYrfCC','\x20files\x20','File\x20and\x20directory\x20download\x20for\x20Northflank\x20services\x20and\x20jobs.','Uploaded\x20all\x20directory\x20contents\x20from\x20\x27','2659206nLAoKp','23195pPifoj','files','CliFileCopy','alias','FILE_DOWNLOAD','remotePath','apply','service','Local\x20file\x20or\x20directory','from','getCurrentServiceName','assertContextExisting','@northflank/js-client','\x20the\x20specified\x20','customUserAgent','File\x20and\x20directory\x20upload\x20for\x20Northflank\x20service.','prompt','--project\x20--projectId\x20[NAME]','description','name','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','DIRECTORY_UPLOAD','30IyuMBs','addCommand','\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','\x20single\x20file:\x20\x20\x20northflank\x20','job','\x27\x20to\x20\x27','InquirerHelper','ApiClient','value','\x27\x20to\x20local\x20directory\x20\x27','then','--container\x20--containerId\x20[NAME]','852WZnAUH','remote'];a3I=function(){return j;};return a3I();}(function(I,B){const x=a3B,J=I();while(!![]){try{const C=-parseInt(x(0x197))/0x1*(-parseInt(x(0x1eb))/0x2)+parseInt(x(0x1dc))/0x3+-parseInt(x(0x1be))/0x4*(-parseInt(x(0x19c))/0x5)+-parseInt(x(0x19b))/0x6+parseInt(x(0x1c9))/0x7+-parseInt(x(0x1c0))/0x8*(-parseInt(x(0x1c5))/0x9)+-parseInt(x(0x1b2))/0xa*(parseInt(x(0x1e7))/0xb);if(C===B)break;else J['push'](J['shift']());}catch(G){J['push'](J['shift']());}}}(a3I,0xe1bba));function a3B(I,B){const J=a3I();return a3B=function(C,G){C=C-0x191;let F=J[C];return F;},a3B(I,B);}var __awaiter=this&&this['__awaiter']||function(I,B,J,C){function G(F){return F instanceof J?F:new J(function(A){A(F);});}return new(J||(J=Promise))(function(F,A){const O=a3B;function H(X){const g=a3B;try{d(C[g(0x1c1)](X));}catch(S){A(S);}}function t(X){try{d(C['throw'](X));}catch(S){A(S);}}function d(X){const o=a3B;X['done']?F(X[o(0x1ba)]):G(X[o(0x1ba)])[o(0x1bc)](H,t);}d((C=C[O(0x1a2)](I,B||[]))[O(0x1c1)]());});};Object[a3p(0x1d2)](exports,a3p(0x196),{'value':!![]}),exports[a3p(0x19e)]=void 0x0;const js_client_1=require(a3p(0x1a8)),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper'),lodash_1=require('lodash'),inquirer=require(a3p(0x1d9));class CliFileCopy{constructor(I,B){const w=a3p;this[w(0x1db)]=(d,X)=>{const Z=w,S=(0x0,lodash_1[Z(0x1c3)])(X),f=X===Z(0x1df)?Z(0x1bf):'local',v=X===Z(0x1df)?Z(0x1e3):Z(0x1d6),a=X===Z(0x1df)?'to':Z(0x1a5);return(0x0,utils_1[Z(0x1e2)])(!![])[Z(0x1af)](Z(0x1e6))[Z(0x1ae)](S+Z(0x198)+a+Z(0x1a9)+d+'.\x20If\x20the\x20'+f+Z(0x1cd)+v+'\x20directory\x20is\x20used.\x20If\x20the\x20directory\x20for\x20'+f+'Path\x20does\x20not\x20exist,\x20it\x20will\x20be\x20created.\x0aExamples:\x0a\x20\x20'+S+Z(0x1b5)+X+'\x20'+d+'\x20file\x20--localPath\x20my_directory/my-file.txt\x20--remotePath\x20/home/my-'+X+Z(0x1da)+S+Z(0x1c6)+X+'\x20'+d+Z(0x1e5)+X+'-dir')[Z(0x1cc)](Z(0x1ad),Z(0x1de)+X)[Z(0x1cc)]('--'+d+'\x20--'+d+Z(0x1d4),d[Z(0x1ce)](0x0)[Z(0x1d7)]()+d[Z(0x1ec)](0x1)+'\x20to\x20'+X+'\x20files')['option'](Z(0x1bd),'Container\x20used\x20to\x20'+X+Z(0x1b4))[Z(0x1cc)]('--local\x20--localPath\x20[LOCALPATH]',Z(0x1a4))['option']('--remote\x20--remotePath\x20[REMOTEPATH]',Z(0x1e8))[Z(0x1cc)](Z(0x1d5),Z(0x1b0),![]);},this[w(0x1d3)]=(d,X)=>{const z=w;if(X)return;const {sourceDirectory:S,targetDirectory:f,sourceFile:v,targetFile:a}=d;switch(d['type']){case js_client_1['CopyType']['DIRECTORY_DOWNLOAD']:{(0x0,utils_1[z(0x1c7)])(z(0x1d8)+S+z(0x1bb)+f+'\x27');break;}case js_client_1['CopyType'][z(0x1a0)]:{(0x0,utils_1[z(0x1c7)])(z(0x1c2)+S+'/'+v+z(0x1b7)+f+'/'+a+'\x27');break;}case js_client_1[z(0x1e9)][z(0x1b1)]:{(0x0,utils_1[z(0x1c7)])(z(0x19a)+S+'\x27\x20to\x20container\x20directory\x20\x27'+f+'\x27');break;}case js_client_1['CopyType'][z(0x192)]:{(0x0,utils_1[z(0x1c7)])('Uploaded\x20file\x20from\x20\x27'+S+'/'+v+z(0x1b7)+f+'/'+a+'\x27');break;}}},this['ensureRelevantPathIsSet']=(d,X)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=w,S=d===Q(0x1e0)&&X[Q(0x1a1)]===undefined?yield this[Q(0x193)](Q(0x1d1),'download'):X[Q(0x1a1)],f=d===Q(0x1df)&&X[Q(0x1ca)]===undefined?yield this[Q(0x193)]('\x27localPath\x27',Q(0x1df)):X['localPath'];return{'localPath':f,'remotePath':S};}),this[w(0x193)]=(d,X)=>__awaiter(this,void 0x0,void 0x0,function*(){const c=w,S=d+'\x20is\x20required\x20for\x20'+X+c(0x1dd);return(yield inquirer[c(0x1ac)]([{'type':c(0x1ea),'name':c(0x1af),'message':S}]))['name'];}),this['apiClient']=new js_client_1[(w(0x1b9))](I,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[w(0x1aa)],'agent':B});const J=new inquirer_helper_1[(w(0x1b8))](this[w(0x1cb)]);this[w(0x1ed)]=(0x0,utils_1[w(0x1e2)])()[w(0x1af)](w(0x1e0))[w(0x19f)]('dl')[w(0x1ae)](w(0x199)),this[w(0x1d0)]=(0x0,utils_1[w(0x1e2)])()[w(0x1af)]('upload')['alias']('ul')[w(0x1ae)](w(0x195));const C=(0x0,utils_1[w(0x1e2)])()[w(0x1af)](w(0x1a3))[w(0x1ae)](w(0x1e1)),G=(0x0,utils_1[w(0x1e2)])()[w(0x1af)](w(0x1a3))[w(0x1ae)](w(0x1ab)),F=(0x0,utils_1[w(0x1e2)])()[w(0x1af)](w(0x1b6))[w(0x1ae)](w(0x1e4)),A=(0x0,utils_1[w(0x1e2)])()[w(0x1af)](w(0x1b6))['description'](w(0x1c4)),H=d=>{const l=w;return this[l(0x1db)](l(0x1a3),d)[l(0x1cf)](X=>__awaiter(this,void 0x0,void 0x0,function*(){const n=l,{projectId:S,serviceId:f,containerId:v,noDefaults:a,quiet:V}=X;(0x0,utils_1[n(0x1a7)])(this[n(0x1cb)]);const r=a?undefined:I[n(0x194)](),s=S||r||(yield J['askForProject']()),K=a?undefined:I[n(0x1a6)](),b=f||K||(yield J[n(0x191)](s)()),{remotePath:W,localPath:u}=yield this[n(0x1c8)](d,X),h={'projectId':s,'serviceId':b},q=yield this[n(0x1cb)][d][n(0x1a3)][n(0x19d)](h,{'containerName':v,'localPath':u,'remotePath':W});this[n(0x1d3)](q,V);}));},t=d=>{const m=w;return this[m(0x1db)](m(0x1b6),d)['action'](X=>__awaiter(this,void 0x0,void 0x0,function*(){const E=m,{projectId:S,jobId:f,containerId:v,noDefaults:a,quiet:V}=X;(0x0,utils_1[E(0x1a7)])(this[E(0x1cb)]);const r=a?undefined:I['getCurrentProjectName'](),s=S||r||(yield J['askForProject']()),K=f||(yield J['askForJob'](s)()),{remotePath:b,localPath:W}=yield this[E(0x1c8)](d,X),u={'projectId':s,'jobId':K},h=yield this[E(0x1cb)][d][E(0x1b6)][E(0x19d)](u,{'containerName':v,'localPath':W,'remotePath':b});this[E(0x1d3)](h,V);}));};C[w(0x1b3)](H(w(0x1e0))),F['addCommand'](t('download')),G[w(0x1b3)](H('upload')),A['addCommand'](t(w(0x1df))),this[w(0x1ed)]['addCommand'](C),this['downloadCmd'][w(0x1b3)](F),this['uploadCmd']['addCommand'](G),this[w(0x1d0)][w(0x1b3)](A);}}exports['CliFileCopy']=CliFileCopy;
|