@treasuredata/tdx 0.3.5 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/http-client.d.ts +4 -0
- package/dist/client/http-client.d.ts.map +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/http-client.js.map +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts +9 -0
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/command.d.ts +5 -0
- package/dist/commands/command.d.ts.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/command.js.map +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.d.ts +9 -6
- package/dist/commands/segment-command.d.ts.map +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-command.js.map +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.d.ts +3 -1
- package/dist/commands/segment-fields-command.d.ts.map +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-fields-command.js.map +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.d.ts +25 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/credential-cache.d.ts +35 -0
- package/dist/core/credential-cache.d.ts.map +1 -0
- package/dist/core/credential-cache.js +1 -0
- package/dist/core/credential-cache.js.map +1 -0
- package/dist/core/global-context.d.ts +19 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.d.ts +38 -0
- package/dist/core/keychain.d.ts.map +1 -0
- package/dist/core/keychain.js +1 -0
- package/dist/core/keychain.js.map +1 -0
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.d.ts.map +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/command-output.js.map +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +3 -1
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a67_0x11d7(){const _0x5cf8aa=['2xvxFxB','20572yzrJcL','1285500oAJvdH','647944NemLpf','5467020IukVSM','771780kZyPwA','290082iqDBuB','108ViIKfU','8GoYScb','5624847cdBbtW','number','28cNMUcx','20jAMVXH'];a67_0x11d7=function(){return _0x5cf8aa;};return a67_0x11d7();}(function(_0x24df65,_0x4e12f8){const _0x5a9483=a67_0x3528,_0x51777e=_0x24df65();while(!![]){try{const _0x352ae2=-parseInt(_0x5a9483(0x10b))/0x1+-parseInt(_0x5a9483(0x106))/0x2*(-parseInt(_0x5a9483(0x108))/0x3)+-parseInt(_0x5a9483(0x107))/0x4*(-parseInt(_0x5a9483(0x105))/0x5)+-parseInt(_0x5a9483(0x10c))/0x6*(-parseInt(_0x5a9483(0x104))/0x7)+parseInt(_0x5a9483(0x10e))/0x8*(parseInt(_0x5a9483(0x10f))/0x9)+-parseInt(_0x5a9483(0x10a))/0xa+parseInt(_0x5a9483(0x109))/0xb*(parseInt(_0x5a9483(0x10d))/0xc);if(_0x352ae2===_0x4e12f8)break;else _0x51777e['push'](_0x51777e['shift']());}catch(_0x8534a4){_0x51777e['push'](_0x51777e['shift']());}}}(a67_0x11d7,0x74f79));export const DEFAULT_DISPLAY_LIMIT=0x28;function a67_0x3528(_0x40f9fd,_0x5b929e){const _0x11d77c=a67_0x11d7();return a67_0x3528=function(_0x3528a8,_0x3eeaf2){_0x3528a8=_0x3528a8-0x104;let _0x29737e=_0x11d77c[_0x3528a8];return _0x29737e;},a67_0x3528(_0x40f9fd,_0x5b929e);}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x289fbb,_0xfc660d){const _0x18d253=a67_0x3528;if(_0x289fbb===undefined)return _0xfc660d;if(typeof _0x289fbb===_0x18d253(0x110))return _0x289fbb;return parseInt(_0x289fbb,0xa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a68_0x3efb(_0x1e06d2,_0x5813d8){const _0x2df198=a68_0x2df1();return a68_0x3efb=function(_0x3efbd6,_0xd1ff6c){_0x3efbd6=_0x3efbd6-0x132;let _0x381627=_0x2df198[_0x3efbd6];return _0x381627;},a68_0x3efb(_0x1e06d2,_0x5813d8);}(function(_0x409497,_0x322210){const _0x15db8d=a68_0x3efb,_0x451b2a=_0x409497();while(!![]){try{const _0x4e1332=parseInt(_0x15db8d(0x13b))/0x1+parseInt(_0x15db8d(0x139))/0x2*(-parseInt(_0x15db8d(0x13d))/0x3)+-parseInt(_0x15db8d(0x145))/0x4+-parseInt(_0x15db8d(0x137))/0x5+parseInt(_0x15db8d(0x132))/0x6*(parseInt(_0x15db8d(0x136))/0x7)+-parseInt(_0x15db8d(0x13c))/0x8*(parseInt(_0x15db8d(0x141))/0x9)+parseInt(_0x15db8d(0x134))/0xa*(parseInt(_0x15db8d(0x140))/0xb);if(_0x4e1332===_0x322210)break;else _0x451b2a['push'](_0x451b2a['shift']());}catch(_0x4de92f){_0x451b2a['push'](_0x451b2a['shift']());}}}(a68_0x2df1,0xf392f));import*as a68_0x26e7e9 from'node:fs';import*as a68_0x10cf35 from'node:path';export function setSecureFilePermissions(_0x164112){const _0x3789a7=a68_0x3efb;try{a68_0x26e7e9[_0x3789a7(0x142)](_0x164112,0x180);}catch{console[_0x3789a7(0x135)](_0x3789a7(0x138)+_0x164112);}}export function setSecureDirectoryPermissions(_0x4f1354){const _0xce4f7e=a68_0x3efb;try{a68_0x26e7e9[_0xce4f7e(0x142)](_0x4f1354,0x1c0);}catch{console[_0xce4f7e(0x135)](_0xce4f7e(0x138)+_0x4f1354);}}export function createSecureDirectory(_0x26e121){const _0x529d1e=a68_0x3efb;!a68_0x26e7e9['existsSync'](_0x26e121)&&(a68_0x26e7e9[_0x529d1e(0x143)](_0x26e121,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x26e121));}export function validateSecureFilePermissions(_0x5a972b){const _0x1fdbf9=a68_0x3efb;try{const _0x3a710c=a68_0x26e7e9[_0x1fdbf9(0x13a)](_0x5a972b),_0x1c1da7=_0x3a710c[_0x1fdbf9(0x13e)]&0x1ff,_0xf52a3=(_0x1c1da7&0x3f)!==0x0;if(_0xf52a3)return console[_0x1fdbf9(0x135)](_0x1fdbf9(0x144)+_0x5a972b+_0x1fdbf9(0x146)+_0x1c1da7[_0x1fdbf9(0x13f)](0x8)+').\x20'+_0x1fdbf9(0x133)),![];return!![];}catch{return!![];}}function a68_0x2df1(){const _0x386d24=['33odHYSZ','3606003mJODOV','chmodSync','mkdirSync','Warning:\x20','3561464jAPKtS','\x20has\x20insecure\x20permissions\x20(','48KScgzM','Should\x20be\x200600\x20or\x20more\x20restrictive.','3251590yJJSKI','warn','1334543PNXtsS','2652835BcYHoY','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','2EkJvyY','statSync','1329541btdNCE','8CgTmtD','3032793etmdBQ','mode','toString'];a68_0x2df1=function(){return _0x386d24;};return a68_0x2df1();}export function writeSecureFile(_0x5aceab,_0x282e30){const _0xd7a42b=a68_0x10cf35['dirname'](_0x5aceab);createSecureDirectory(_0xd7a42b),a68_0x26e7e9['writeFileSync'](_0x5aceab,_0x282e30,{'mode':0x180}),setSecureFilePermissions(_0x5aceab);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a69_0x4c69(_0x5a27f7,_0x1d3b79){const _0x315085=a69_0x3150();return a69_0x4c69=function(_0x4c690d,_0x2e7e10){_0x4c690d=_0x4c690d-0xc5;let _0x578b13=_0x315085[_0x4c690d];return _0x578b13;},a69_0x4c69(_0x5a27f7,_0x1d3b79);}(function(_0x16382a,_0x3c73e1){const _0x318479=a69_0x4c69,_0x107bb3=_0x16382a();while(!![]){try{const _0x2f6dff=parseInt(_0x318479(0xca))/0x1+parseInt(_0x318479(0xc7))/0x2+parseInt(_0x318479(0xc5))/0x3*(-parseInt(_0x318479(0xd0))/0x4)+parseInt(_0x318479(0xce))/0x5+-parseInt(_0x318479(0xd4))/0x6*(parseInt(_0x318479(0xd3))/0x7)+-parseInt(_0x318479(0xcd))/0x8*(-parseInt(_0x318479(0xc9))/0x9)+-parseInt(_0x318479(0xc6))/0xa;if(_0x2f6dff===_0x3c73e1)break;else _0x107bb3['push'](_0x107bb3['shift']());}catch(_0x4fcf98){_0x107bb3['push'](_0x107bb3['shift']());}}}(a69_0x3150,0x92d1f));export function detectFormatFromExtension(_0x23dee3){const _0x1cb37b=a69_0x4c69,_0x9cd6d8=_0x23dee3['toLowerCase']()[_0x1cb37b(0xd2)]('.')[_0x1cb37b(0xcc)]();switch(_0x9cd6d8){case _0x1cb37b(0xcb):return'json';case _0x1cb37b(0xcf):return _0x1cb37b(0xcf);case _0x1cb37b(0xc8):case'tab':return'tsv';case _0x1cb37b(0xd1):case _0x1cb37b(0xd5):return'table';default:return undefined;}}export function resolveOutputFormat(_0x4ea139,_0x4aa96e,_0x430650){if(_0x4ea139)return _0x4ea139;if(_0x4aa96e){const _0x42bbca=detectFormatFromExtension(_0x4aa96e);if(_0x42bbca)return _0x42bbca;}return _0x430650;}function a69_0x3150(){const _0x111ba5=['1494454DPcrpw','tsv','602892TCQtoB','970413ZSeffw','json','pop','128DCfatH','5090985DOMFAa','jsonl','2720qNeqLS','txt','split','1598296flIQRY','30mQJPXr','text','3630aChquz','12418300aNHRmE'];a69_0x3150=function(){return _0x111ba5;};return a69_0x3150();}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x37f7db,_0x5b35a5){const _0x4b599d=a68_0x3c36,_0x296bdf=_0x37f7db();while(!![]){try{const _0x1d5469=-parseInt(_0x4b599d(0x20f))/0x1*(-parseInt(_0x4b599d(0x1ff))/0x2)+parseInt(_0x4b599d(0x1e7))/0x3*(-parseInt(_0x4b599d(0x1eb))/0x4)+-parseInt(_0x4b599d(0x20d))/0x5*(parseInt(_0x4b599d(0x1ea))/0x6)+-parseInt(_0x4b599d(0x1f4))/0x7*(-parseInt(_0x4b599d(0x1fd))/0x8)+parseInt(_0x4b599d(0x1e9))/0x9+parseInt(_0x4b599d(0x20a))/0xa*(-parseInt(_0x4b599d(0x1e6))/0xb)+-parseInt(_0x4b599d(0x213))/0xc*(parseInt(_0x4b599d(0x1f7))/0xd);if(_0x1d5469===_0x5b35a5)break;else _0x296bdf['push'](_0x296bdf['shift']());}catch(_0x47736e){_0x296bdf['push'](_0x296bdf['shift']());}}}(a68_0x1471,0x30f15));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){return process['stdout']['columns']||Infinity;}function a68_0x1471(){const _0x140eee=['join','padEnd','jsonl','120vePaPt','No\x20rows\x20returned','true','forEach','toString','row','push','boolean','0\x20B','name','entries','false','toFixed','458711dVgLSO','652977vXgBwS','long','364131FZaRZq','102CgJhVG','4oUrhjA','slice','length','string','pow','reduce','startsWith','columns','tsv','238KvDsDr','type','json','172978SLVpHe','min','number','stringify','array','log','60920rfsTcJ','map','962tXiEZG','object','bool','repeat','floor','int','max','replace','\x20row','\x20rows\x20(','\x20shown)','10qcHack','data','double','19915MSWTuN','toISOString','751fXeXLa'];a68_0x1471=function(){return _0x140eee;};return a68_0x1471();}function a68_0x3c36(_0x391e9b,_0x47477a){const _0x1471f6=a68_0x1471();return a68_0x3c36=function(_0x3c36ae,_0x4f9d72){_0x3c36ae=_0x3c36ae-0x1e0;let _0x9bbcd8=_0x1471f6[_0x3c36ae];return _0x9bbcd8;},a68_0x3c36(_0x391e9b,_0x47477a);}export function formatAsTable(_0x2ba443,_0x17d8ae=DEFAULT_MAX_DISPLAY_ROWS,_0x33892c=![],_0xfd3bdf={}){const _0x742d1f=a68_0x3c36;if(_0x2ba443[_0x742d1f(0x20b)][_0x742d1f(0x1ed)]===0x0)return _0x742d1f(0x214);const _0x5d38ae=_0x2ba443[_0x742d1f(0x1f2)][_0x742d1f(0x1fe)](_0x2ec6b4=>_0x2ec6b4[_0x742d1f(0x1e2)]),_0x22b8d6=_0x2ba443[_0x742d1f(0x1f2)][_0x742d1f(0x1fe)](_0x330657=>simplifyType(_0x330657[_0x742d1f(0x1f5)])),_0x4d8cb2=_0x2ba443['data'][_0x742d1f(0x1ec)](0x0,_0x17d8ae),_0x4836a1=_0x2ba443[_0x742d1f(0x20b)][_0x742d1f(0x1ed)],_0x785a63=_0x4836a1>_0x17d8ae,_0x38f0ca=[],_0x6855bf=getTerminalWidth(),_0x223945=_0x6855bf!==Infinity,_0x3ede32=0x32;let _0x42a0fb=_0x5d38ae[_0x742d1f(0x1fe)]((_0x5b28e4,_0x37ac33)=>{const _0x53bcd4=_0x742d1f,_0x32939e=stringWidth(_0x22b8d6[_0x37ac33]),_0x4a0af4=Math[_0x53bcd4(0x205)](..._0x4d8cb2[_0x53bcd4(0x1fe)](_0x4deae2=>{const _0x4a6716=_0x4deae2[_0x5b28e4];return stringWidth(formatValue(_0x4a6716));})),_0x2cbcbe=Math['max'](stringWidth(_0x5b28e4),_0x32939e,_0x4a0af4);return _0x33892c?_0x2cbcbe:Math[_0x53bcd4(0x1f8)](_0x2cbcbe,_0x3ede32);});if(_0x223945&&!_0x33892c&&_0x5d38ae[_0x742d1f(0x1ed)]>0x0){const _0xb26b63=_0xd0b069=>{let _0x3e1e35=0x1;for(const _0x4447d8 of _0xd0b069){_0x3e1e35+=_0x4447d8+0x3;}return _0x3e1e35+0x1;};let _0x5b872e=_0xb26b63(_0x42a0fb);if(_0x5b872e>_0x6855bf){const _0x4b9f9d=0x3;for(let _0x14ea57=_0x42a0fb['length']-0x1;_0x14ea57>=0x0;_0x14ea57--){_0x5b872e=_0xb26b63(_0x42a0fb);if(_0x5b872e<=_0x6855bf)break;const _0x37a534=_0x42a0fb[_0x14ea57],_0x5c2a86=_0x5b872e-_0x6855bf,_0x46b2be=_0x37a534-_0x4b9f9d,_0x4bcf20=Math[_0x742d1f(0x1f8)](_0x5c2a86,_0x46b2be);_0x4bcf20>0x0&&(_0x42a0fb[_0x14ea57]=_0x37a534-_0x4bcf20);}}}const _0x1cb8a2=_0x5d38ae,_0x52f101=_0x22b8d6,_0x2be8a1=_0x42a0fb,_0x3cf408=_0x42a0fb;_0x38f0ca[_0x742d1f(0x219)](colorBorder('┌'+_0x3cf408[_0x742d1f(0x1fe)](_0x341ffb=>'─'['repeat'](_0x341ffb+0x2))[_0x742d1f(0x210)]('┬')+'┐',_0xfd3bdf));const _0x1603b8=_0x1cb8a2[_0x742d1f(0x1fe)]((_0x30a8af,_0x351e2a)=>centerAlign(_0x30a8af,_0x2be8a1[_0x351e2a]));_0x38f0ca[_0x742d1f(0x219)](colorBorder('│',_0xfd3bdf)+'\x20'+_0x1603b8[_0x742d1f(0x210)]('\x20'+colorBorder('│',_0xfd3bdf)+'\x20')+'\x20'+colorBorder('│',_0xfd3bdf));const _0x4e0fc7=_0x52f101[_0x742d1f(0x1fe)]((_0x48e7a3,_0x1af911)=>colorType(centerAlign(_0x48e7a3,_0x2be8a1[_0x1af911]),_0xfd3bdf));_0x38f0ca['push'](colorBorder('│',_0xfd3bdf)+'\x20'+_0x4e0fc7['join']('\x20'+colorBorder('│',_0xfd3bdf)+'\x20')+'\x20'+colorBorder('│',_0xfd3bdf)),_0x38f0ca['push'](colorBorder('├'+_0x3cf408['map'](_0xfd28dd=>'─'[_0x742d1f(0x202)](_0xfd28dd+0x2))[_0x742d1f(0x210)]('┼')+'┤',_0xfd3bdf));const _0x238f74=(_0x26c938,_0x5c8ab3)=>{const _0xa1e23=_0x742d1f,_0x179ef3=stringWidth(_0x26c938);if(_0x179ef3<=_0x5c8ab3)return _0x26c938;let _0x396ace=_0x26c938;while(stringWidth(_0x396ace+'…')>_0x5c8ab3&&_0x396ace[_0xa1e23(0x1ed)]>0x0){_0x396ace=_0x396ace[_0xa1e23(0x1ec)](0x0,-0x1);}return _0x396ace+'…';};_0x4d8cb2[_0x742d1f(0x216)](_0x57533e=>{const _0x2adcd2=_0x742d1f,_0x1e5dcf=_0x5d38ae[_0x2adcd2(0x1fe)]((_0x4b5075,_0x9b593c)=>{const _0x5d1954=_0x2adcd2,_0x4dac7e=_0x57533e[_0x4b5075],_0x49c2f8=formatValue(_0x4dac7e),_0x456049=_0x2be8a1[_0x9b593c],_0x3db42b=_0x238f74(_0x49c2f8,_0x456049),_0x1b8d2c=typeof _0x4dac7e==='number'||typeof _0x4dac7e===_0x5d1954(0x1ee)&&/^-?\d+$/['test'](_0x4dac7e);return _0x1b8d2c?padStart(_0x3db42b,_0x456049):padEnd(_0x3db42b,_0x456049);});_0x38f0ca[_0x2adcd2(0x219)](colorBorder('│',_0xfd3bdf)+'\x20'+_0x1e5dcf[_0x2adcd2(0x210)]('\x20'+colorBorder('│',_0xfd3bdf)+'\x20')+'\x20'+colorBorder('│',_0xfd3bdf));});const _0x2647df=_0x3cf408[_0x742d1f(0x1f0)]((_0xbdda83,_0x335e9d)=>_0xbdda83+_0x335e9d+0x3,-0x1);_0x38f0ca[_0x742d1f(0x219)](colorBorder('├'+_0x3cf408['map'](_0x178e34=>'─'['repeat'](_0x178e34+0x2))['join']('┴')+'┤',_0xfd3bdf));let _0x820adc;_0x785a63?_0x820adc=_0x4836a1+_0x742d1f(0x208)+_0x17d8ae+_0x742d1f(0x209):_0x820adc=_0x4836a1+_0x742d1f(0x207)+(_0x4836a1===0x1?'':'s');const _0x1933a0=_0x820adc[_0x742d1f(0x211)](_0x2647df-0x2);return _0x38f0ca[_0x742d1f(0x219)](colorBorder('│',_0xfd3bdf)+'\x20'+_0x1933a0+'\x20'+colorBorder('│',_0xfd3bdf)),_0x38f0ca[_0x742d1f(0x219)](colorBorder('└'+'─'[_0x742d1f(0x202)](_0x2647df)+'┘',_0xfd3bdf)),_0x38f0ca[_0x742d1f(0x210)]('\x0a');}function simplifyType(_0x3d9ec0){const _0x111022=a68_0x3c36,_0x3de412={'varchar':'string','bigint':_0x111022(0x1e8),'integer':_0x111022(0x204),'double':_0x111022(0x20c),'boolean':_0x111022(0x201),'date':'date','timestamp':'timestamp','array':_0x111022(0x1fb),'map':_0x111022(0x1fe),'row':_0x111022(0x218)},_0xc7c417=_0x3d9ec0['toLowerCase']();for(const [_0x1e6b15,_0x385d99]of Object[_0x111022(0x1e3)](_0x3de412)){if(_0xc7c417[_0x111022(0x1f1)](_0x1e6b15))return _0x385d99;}return _0x3d9ec0['length']>0xa?_0x3d9ec0['substring'](0x0,0xa):_0x3d9ec0;}export function formatAsJSON(_0x512ad9,_0x13b113={}){const _0x27cb2f=a68_0x3c36;if(_0x512ad9[_0x27cb2f(0x20b)]['length']===0x0)return'[]';if(shouldUseColor(_0x13b113))return colorizeJSON(_0x512ad9[_0x27cb2f(0x20b)],_0x13b113);const _0x23e9a4=_0x512ad9['data'][_0x27cb2f(0x1fe)](_0x3c73c2=>'\x20\x20'+JSON[_0x27cb2f(0x1fa)](_0x3c73c2));return'[\x0a'+_0x23e9a4['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x16bfef,_0x423cc4={}){const _0x167242=a68_0x3c36;if(_0x16bfef[_0x167242(0x20b)][_0x167242(0x1ed)]===0x0)return'';if(shouldUseColor(_0x423cc4))return _0x16bfef['data'][_0x167242(0x1fe)](_0x48aebd=>colorizeJSONCompact(_0x48aebd,_0x423cc4))[_0x167242(0x210)]('\x0a');return _0x16bfef['data'][_0x167242(0x1fe)](_0x2c1cc2=>JSON[_0x167242(0x1fa)](_0x2c1cc2))[_0x167242(0x210)]('\x0a');}export function formatAsTSV(_0x25e385){const _0x46527f=a68_0x3c36;if(_0x25e385['data'][_0x46527f(0x1ed)]===0x0)return'';const _0x4f6a6b=[],_0x36cd9f=_0x25e385[_0x46527f(0x1f2)][_0x46527f(0x1fe)](_0x47e94e=>_0x47e94e[_0x46527f(0x1e2)]);return _0x4f6a6b[_0x46527f(0x219)](_0x36cd9f[_0x46527f(0x210)]('\x09')),_0x25e385[_0x46527f(0x20b)][_0x46527f(0x216)](_0x245538=>{const _0x47c7bf=_0x46527f,_0x4659e6=_0x36cd9f[_0x47c7bf(0x1fe)](_0x13deb4=>{const _0xacc37e=_0x245538[_0x13deb4];return formatValueForTSV(_0xacc37e);});_0x4f6a6b[_0x47c7bf(0x219)](_0x4659e6[_0x47c7bf(0x210)]('\x09'));}),_0x4f6a6b[_0x46527f(0x210)]('\x0a');}function formatValue(_0x3e3407){const _0x466571=a68_0x3c36;if(_0x3e3407===null||_0x3e3407===undefined)return'';if(typeof _0x3e3407===_0x466571(0x1ee)){const _0x1be67f=_0x3e3407['replace'](/\n/g,'\x5cn')[_0x466571(0x206)](/\r/g,'\x5cr')[_0x466571(0x206)](/\t/g,'\x5ct');return _0x1be67f;}if(typeof _0x3e3407===_0x466571(0x1f9))return String(_0x3e3407);if(typeof _0x3e3407===_0x466571(0x1e0))return _0x3e3407?_0x466571(0x215):_0x466571(0x1e4);if(_0x3e3407 instanceof Date)return _0x3e3407[_0x466571(0x20e)]();if(typeof _0x3e3407===_0x466571(0x200))return JSON['stringify'](_0x3e3407);return String(_0x3e3407);}function formatValueForTSV(_0x13cf77){const _0x4a06f7=a68_0x3c36;if(_0x13cf77===null||_0x13cf77===undefined)return'';if(typeof _0x13cf77===_0x4a06f7(0x1ee))return _0x13cf77[_0x4a06f7(0x206)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x13cf77===_0x4a06f7(0x1f9)||typeof _0x13cf77===_0x4a06f7(0x1e0))return String(_0x13cf77);if(_0x13cf77 instanceof Date)return _0x13cf77['toISOString']();if(typeof _0x13cf77===_0x4a06f7(0x200))return JSON['stringify'](_0x13cf77);return String(_0x13cf77);}export function formatQueryResult(_0x5c3f9d,_0x151fb1){const _0x4a1d53=a68_0x3c36;switch(_0x151fb1){case'table':return formatAsTable(_0x5c3f9d);case _0x4a1d53(0x1f6):return formatAsJSON(_0x5c3f9d);case _0x4a1d53(0x212):return formatAsJSONL(_0x5c3f9d);case _0x4a1d53(0x1f3):return formatAsTSV(_0x5c3f9d);default:return formatAsJSON(_0x5c3f9d);}}export function formatBytes(_0xf831d4){const _0x33cc93=a68_0x3c36;if(_0xf831d4===0x0)return _0x33cc93(0x1e1);const _0xa5e469=['B','KB','MB','GB','TB'],_0x8b14a3=0x400,_0x41e1be=Math[_0x33cc93(0x203)](Math[_0x33cc93(0x1fc)](_0xf831d4)/Math[_0x33cc93(0x1fc)](_0x8b14a3)),_0x166ffc=_0xf831d4/Math['pow'](_0x8b14a3,_0x41e1be),_0x26bbdd=_0x166ffc>=0xa?0x1:0x2;return _0x166ffc[_0x33cc93(0x1e5)](_0x26bbdd)+'\x20'+_0xa5e469[_0x41e1be];}export function formatRows(_0x43eea2){const _0x1ca9e7=a68_0x3c36;if(_0x43eea2==null)return'-';if(_0x43eea2===0x0)return'0';if(_0x43eea2<0x3e8)return _0x43eea2[_0x1ca9e7(0x217)]();const _0x375b92=['','K','M','B','T'],_0x35e3ef=0x3e8,_0x1e03d2=Math[_0x1ca9e7(0x203)](Math[_0x1ca9e7(0x1fc)](_0x43eea2)/Math[_0x1ca9e7(0x1fc)](_0x35e3ef)),_0x409e8a=_0x43eea2/Math[_0x1ca9e7(0x1ef)](_0x35e3ef,_0x1e03d2),_0x11e5ad=_0x409e8a>=0xa?0x1:0x2;return''+_0x409e8a[_0x1ca9e7(0x1e5)](_0x11e5ad)+_0x375b92[_0x1e03d2];}
|
|
1
|
+
(function(_0x2e1427,_0x5fc6e0){const _0x25a1f5=a70_0x2949,_0x4ed815=_0x2e1427();while(!![]){try{const _0x1b11d7=parseInt(_0x25a1f5(0x172))/0x1+-parseInt(_0x25a1f5(0x177))/0x2*(-parseInt(_0x25a1f5(0x194))/0x3)+-parseInt(_0x25a1f5(0x180))/0x4+parseInt(_0x25a1f5(0x174))/0x5+-parseInt(_0x25a1f5(0x16a))/0x6+parseInt(_0x25a1f5(0x181))/0x7*(parseInt(_0x25a1f5(0x170))/0x8)+parseInt(_0x25a1f5(0x178))/0x9*(-parseInt(_0x25a1f5(0x189))/0xa);if(_0x1b11d7===_0x5fc6e0)break;else _0x4ed815['push'](_0x4ed815['shift']());}catch(_0x5971d7){_0x4ed815['push'](_0x4ed815['shift']());}}}(a70_0x30d2,0xce214));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x34beba=a70_0x2949;return process['stdout'][_0x34beba(0x185)]||Infinity;}export function formatAsTable(_0xec61ca,_0xc7db68=DEFAULT_MAX_DISPLAY_ROWS,_0x2b9ea7=![],_0x25bdb7={}){const _0x16f3f7=a70_0x2949;if(_0xec61ca[_0x16f3f7(0x167)][_0x16f3f7(0x18f)]===0x0)return _0x16f3f7(0x161);const _0x3b9241=_0xec61ca['columns']['map'](_0x4846d7=>_0x4846d7[_0x16f3f7(0x179)]),_0x26c154=_0xec61ca[_0x16f3f7(0x185)][_0x16f3f7(0x183)](_0x4c32f3=>simplifyType(_0x4c32f3[_0x16f3f7(0x16b)])),_0x175587=_0xec61ca[_0x16f3f7(0x167)][_0x16f3f7(0x16c)](0x0,_0xc7db68),_0x18862a=_0xec61ca[_0x16f3f7(0x167)][_0x16f3f7(0x18f)],_0x1fbaf0=_0x18862a>_0xc7db68,_0x3d16d9=[],_0x5644ed=getTerminalWidth(),_0x535ed1=_0x5644ed!==Infinity,_0x25a536=0x32;let _0x1fe938=_0x3b9241[_0x16f3f7(0x183)]((_0x33ce0c,_0x54536e)=>{const _0x5f03de=_0x16f3f7,_0x2db864=stringWidth(_0x26c154[_0x54536e]),_0x451759=Math[_0x5f03de(0x188)](..._0x175587[_0x5f03de(0x183)](_0x3ac833=>{const _0xaab3c=_0x3ac833[_0x33ce0c];return stringWidth(formatValue(_0xaab3c));})),_0x5abcbb=Math['max'](stringWidth(_0x33ce0c),_0x2db864,_0x451759);return _0x2b9ea7?_0x5abcbb:Math[_0x5f03de(0x173)](_0x5abcbb,_0x25a536);});if(_0x535ed1&&!_0x2b9ea7&&_0x3b9241[_0x16f3f7(0x18f)]>0x0){const _0x3f789a=_0x30fdf3=>{let _0x434e43=0x1;for(const _0x32f95e of _0x30fdf3){_0x434e43+=_0x32f95e+0x3;}return _0x434e43+0x1;};let _0x28fad=_0x3f789a(_0x1fe938);if(_0x28fad>_0x5644ed){const _0xae9724=0x3;for(let _0x133e94=_0x1fe938[_0x16f3f7(0x18f)]-0x1;_0x133e94>=0x0;_0x133e94--){_0x28fad=_0x3f789a(_0x1fe938);if(_0x28fad<=_0x5644ed)break;const _0x2e0b0e=_0x1fe938[_0x133e94],_0x4fc4c3=_0x28fad-_0x5644ed,_0x57f772=_0x2e0b0e-_0xae9724,_0x220140=Math[_0x16f3f7(0x173)](_0x4fc4c3,_0x57f772);_0x220140>0x0&&(_0x1fe938[_0x133e94]=_0x2e0b0e-_0x220140);}}}const _0x1f883e=_0x3b9241,_0x8010d0=_0x26c154,_0x45efec=_0x1fe938,_0x1f15f0=_0x1fe938;_0x3d16d9[_0x16f3f7(0x15f)](colorBorder('┌'+_0x1f15f0[_0x16f3f7(0x183)](_0x46c01b=>'─'[_0x16f3f7(0x17d)](_0x46c01b+0x2))['join']('┬')+'┐',_0x25bdb7));const _0x4fd138=_0x1f883e[_0x16f3f7(0x183)]((_0x544c67,_0x478f40)=>centerAlign(_0x544c67,_0x45efec[_0x478f40]));_0x3d16d9['push'](colorBorder('│',_0x25bdb7)+'\x20'+_0x4fd138[_0x16f3f7(0x15c)]('\x20'+colorBorder('│',_0x25bdb7)+'\x20')+'\x20'+colorBorder('│',_0x25bdb7));const _0x15dce1=_0x8010d0[_0x16f3f7(0x183)]((_0x540771,_0x5436ac)=>colorType(centerAlign(_0x540771,_0x45efec[_0x5436ac]),_0x25bdb7));_0x3d16d9['push'](colorBorder('│',_0x25bdb7)+'\x20'+_0x15dce1[_0x16f3f7(0x15c)]('\x20'+colorBorder('│',_0x25bdb7)+'\x20')+'\x20'+colorBorder('│',_0x25bdb7)),_0x3d16d9[_0x16f3f7(0x15f)](colorBorder('├'+_0x1f15f0[_0x16f3f7(0x183)](_0x41aa4=>'─'[_0x16f3f7(0x17d)](_0x41aa4+0x2))['join']('┼')+'┤',_0x25bdb7));const _0x50a334=(_0xac04e1,_0x3bd33e)=>{const _0x3a534c=_0x16f3f7,_0x3ae16c=stringWidth(_0xac04e1);if(_0x3ae16c<=_0x3bd33e)return _0xac04e1;let _0x1ae3be=_0xac04e1;while(stringWidth(_0x1ae3be+'…')>_0x3bd33e&&_0x1ae3be[_0x3a534c(0x18f)]>0x0){_0x1ae3be=_0x1ae3be[_0x3a534c(0x16c)](0x0,-0x1);}return _0x1ae3be+'…';};_0x175587[_0x16f3f7(0x186)](_0xf2b730=>{const _0x19ceb9=_0x3b9241['map']((_0x50f3c6,_0x594eff)=>{const _0x253ce3=a70_0x2949,_0x2dfe5e=_0xf2b730[_0x50f3c6],_0x3f9d1f=formatValue(_0x2dfe5e),_0x3be018=_0x45efec[_0x594eff],_0x49efd7=_0x50a334(_0x3f9d1f,_0x3be018),_0x17ab5c=typeof _0x2dfe5e===_0x253ce3(0x184)||typeof _0x2dfe5e===_0x253ce3(0x15d)&&/^-?\d+$/[_0x253ce3(0x187)](_0x2dfe5e);return _0x17ab5c?padStart(_0x49efd7,_0x3be018):padEnd(_0x49efd7,_0x3be018);});_0x3d16d9['push'](colorBorder('│',_0x25bdb7)+'\x20'+_0x19ceb9['join']('\x20'+colorBorder('│',_0x25bdb7)+'\x20')+'\x20'+colorBorder('│',_0x25bdb7));});const _0x525765=_0x1f15f0[_0x16f3f7(0x18d)]((_0x5be83f,_0x2997a3)=>_0x5be83f+_0x2997a3+0x3,-0x1);_0x3d16d9[_0x16f3f7(0x15f)](colorBorder('├'+_0x1f15f0[_0x16f3f7(0x183)](_0xb5fc78=>'─'['repeat'](_0xb5fc78+0x2))[_0x16f3f7(0x15c)]('┴')+'┤',_0x25bdb7));let _0x12f429;_0x1fbaf0?_0x12f429=_0x18862a+_0x16f3f7(0x175)+_0xc7db68+'\x20shown)':_0x12f429=_0x18862a+_0x16f3f7(0x169)+(_0x18862a===0x1?'':'s');const _0x508458=_0x12f429[_0x16f3f7(0x168)](_0x525765-0x2);return _0x3d16d9[_0x16f3f7(0x15f)](colorBorder('│',_0x25bdb7)+'\x20'+_0x508458+'\x20'+colorBorder('│',_0x25bdb7)),_0x3d16d9['push'](colorBorder('└'+'─'[_0x16f3f7(0x17d)](_0x525765)+'┘',_0x25bdb7)),_0x3d16d9[_0x16f3f7(0x15c)]('\x0a');}function a70_0x2949(_0x5928b5,_0x3e3afb){const _0x30d2bd=a70_0x30d2();return a70_0x2949=function(_0x2949c0,_0x11db56){_0x2949c0=_0x2949c0-0x15c;let _0x43d759=_0x30d2bd[_0x2949c0];return _0x43d759;},a70_0x2949(_0x5928b5,_0x3e3afb);}function simplifyType(_0x116bcb){const _0xfeed86=a70_0x2949,_0x28e855={'varchar':_0xfeed86(0x15d),'bigint':_0xfeed86(0x18e),'integer':_0xfeed86(0x162),'double':'double','boolean':_0xfeed86(0x171),'date':_0xfeed86(0x190),'timestamp':_0xfeed86(0x17a),'array':_0xfeed86(0x193),'map':_0xfeed86(0x183),'row':_0xfeed86(0x17f)},_0x51715b=_0x116bcb[_0xfeed86(0x163)]();for(const [_0x43c648,_0x865dc0]of Object['entries'](_0x28e855)){if(_0x51715b[_0xfeed86(0x17c)](_0x43c648))return _0x865dc0;}return _0x116bcb['length']>0xa?_0x116bcb[_0xfeed86(0x18b)](0x0,0xa):_0x116bcb;}export function formatAsJSON(_0x35e68a,_0x2c4cfd={}){const _0xf6476a=a70_0x2949;if(_0x35e68a[_0xf6476a(0x167)][_0xf6476a(0x18f)]===0x0)return'[]';if(shouldUseColor(_0x2c4cfd))return colorizeJSON(_0x35e68a[_0xf6476a(0x167)],_0x2c4cfd);const _0x209d59=_0x35e68a[_0xf6476a(0x167)][_0xf6476a(0x183)](_0x1a2501=>'\x20\x20'+JSON[_0xf6476a(0x182)](_0x1a2501));return'[\x0a'+_0x209d59['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x1b11e4,_0x319292={}){const _0x3fdf01=a70_0x2949;if(_0x1b11e4[_0x3fdf01(0x167)]['length']===0x0)return'';if(shouldUseColor(_0x319292))return _0x1b11e4[_0x3fdf01(0x167)][_0x3fdf01(0x183)](_0x25a1ec=>colorizeJSONCompact(_0x25a1ec,_0x319292))[_0x3fdf01(0x15c)]('\x0a');return _0x1b11e4[_0x3fdf01(0x167)]['map'](_0x3098ac=>JSON['stringify'](_0x3098ac))[_0x3fdf01(0x15c)]('\x0a');}export function formatAsTSV(_0x142262){const _0x3e84a1=a70_0x2949;if(_0x142262['data'][_0x3e84a1(0x18f)]===0x0)return'';const _0x57e351=[],_0x22122b=_0x142262['columns'][_0x3e84a1(0x183)](_0x490ed3=>_0x490ed3[_0x3e84a1(0x179)]);return _0x57e351[_0x3e84a1(0x15f)](_0x22122b[_0x3e84a1(0x15c)]('\x09')),_0x142262[_0x3e84a1(0x167)][_0x3e84a1(0x186)](_0x15430b=>{const _0x26c7d2=_0x3e84a1,_0x2c0308=_0x22122b[_0x26c7d2(0x183)](_0x355047=>{const _0x39add4=_0x15430b[_0x355047];return formatValueForTSV(_0x39add4);});_0x57e351[_0x26c7d2(0x15f)](_0x2c0308[_0x26c7d2(0x15c)]('\x09'));}),_0x57e351[_0x3e84a1(0x15c)]('\x0a');}function formatValue(_0x490a74){const _0xc19086=a70_0x2949;if(_0x490a74===null||_0x490a74===undefined)return'';if(typeof _0x490a74===_0xc19086(0x15d)){const _0x53c3b9=_0x490a74[_0xc19086(0x176)](/\n/g,'\x5cn')[_0xc19086(0x176)](/\r/g,'\x5cr')[_0xc19086(0x176)](/\t/g,'\x5ct');return _0x53c3b9;}if(typeof _0x490a74==='number')return String(_0x490a74);if(typeof _0x490a74==='boolean')return _0x490a74?_0xc19086(0x18a):_0xc19086(0x17e);if(_0x490a74 instanceof Date)return _0x490a74[_0xc19086(0x192)]();if(typeof _0x490a74===_0xc19086(0x165))return JSON[_0xc19086(0x182)](_0x490a74);return String(_0x490a74);}function formatValueForTSV(_0x3ccffb){const _0x23124d=a70_0x2949;if(_0x3ccffb===null||_0x3ccffb===undefined)return'';if(typeof _0x3ccffb==='string')return _0x3ccffb[_0x23124d(0x176)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x3ccffb===_0x23124d(0x184)||typeof _0x3ccffb==='boolean')return String(_0x3ccffb);if(_0x3ccffb instanceof Date)return _0x3ccffb[_0x23124d(0x192)]();if(typeof _0x3ccffb===_0x23124d(0x165))return JSON['stringify'](_0x3ccffb);return String(_0x3ccffb);}export function formatQueryResult(_0x5dccc6,_0x17e0ae){const _0x2288a4=a70_0x2949;switch(_0x17e0ae){case _0x2288a4(0x15e):return formatAsTable(_0x5dccc6);case _0x2288a4(0x164):return formatAsJSON(_0x5dccc6);case _0x2288a4(0x160):return formatAsJSONL(_0x5dccc6);case _0x2288a4(0x16d):return formatAsTSV(_0x5dccc6);default:return formatAsJSON(_0x5dccc6);}}export function formatBytes(_0x13029b){const _0x4142bb=a70_0x2949;if(_0x13029b===0x0)return _0x4142bb(0x16e);const _0x203e5e=['B','KB','MB','GB','TB'],_0x495db5=0x400,_0x2415d4=Math[_0x4142bb(0x166)](Math[_0x4142bb(0x18c)](_0x13029b)/Math['log'](_0x495db5)),_0x41212c=_0x13029b/Math[_0x4142bb(0x191)](_0x495db5,_0x2415d4),_0x21ce3c=_0x41212c>=0xa?0x1:0x2;return _0x41212c[_0x4142bb(0x17b)](_0x21ce3c)+'\x20'+_0x203e5e[_0x2415d4];}function a70_0x30d2(){const _0xb34c95=['long','length','date','pow','toISOString','array','291VEoesS','join','string','table','push','jsonl','No\x20rows\x20returned','int','toLowerCase','json','object','floor','data','padEnd','\x20row','1947684OlenTX','type','slice','tsv','0\x20B','toString','4312DaPCDx','bool','1483556ZNlsER','min','6071120uHMVAT','\x20rows\x20(','replace','33758jcpFyL','54ZNFVOp','name','timestamp','toFixed','startsWith','repeat','false','row','1798196VKrSfa','13398zHsRuo','stringify','map','number','columns','forEach','test','max','6247030QVVVJK','true','substring','log','reduce'];a70_0x30d2=function(){return _0xb34c95;};return a70_0x30d2();}export function formatRows(_0x3e6c57){const _0x5078b4=a70_0x2949;if(_0x3e6c57==null)return'-';if(_0x3e6c57===0x0)return'0';if(_0x3e6c57<0x3e8)return _0x3e6c57[_0x5078b4(0x16f)]();const _0x430668=['','K','M','B','T'],_0x3816fb=0x3e8,_0x33dd55=Math[_0x5078b4(0x166)](Math['log'](_0x3e6c57)/Math[_0x5078b4(0x18c)](_0x3816fb)),_0x54d845=_0x3e6c57/Math[_0x5078b4(0x191)](_0x3816fb,_0x33dd55),_0x5a15ae=_0x54d845>=0xa?0x1:0x2;return''+_0x54d845[_0x5078b4(0x17b)](_0x5a15ae)+_0x430668[_0x33dd55];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a71_0x1a04(_0x2ddb9e,_0x23912a){const _0x3da288=a71_0x3da2();return a71_0x1a04=function(_0x1a0458,_0x185a94){_0x1a0458=_0x1a0458-0x14a;let _0x1cd885=_0x3da288[_0x1a0458];return _0x1cd885;},a71_0x1a04(_0x2ddb9e,_0x23912a);}(function(_0x42a186,_0x2b2375){const _0xaa9aa9=a71_0x1a04,_0x965dcb=_0x42a186();while(!![]){try{const _0x6c334a=parseInt(_0xaa9aa9(0x14b))/0x1+parseInt(_0xaa9aa9(0x153))/0x2*(parseInt(_0xaa9aa9(0x15b))/0x3)+parseInt(_0xaa9aa9(0x15f))/0x4+-parseInt(_0xaa9aa9(0x14c))/0x5+parseInt(_0xaa9aa9(0x151))/0x6+-parseInt(_0xaa9aa9(0x15e))/0x7*(-parseInt(_0xaa9aa9(0x14a))/0x8)+-parseInt(_0xaa9aa9(0x157))/0x9;if(_0x6c334a===_0x2b2375)break;else _0x965dcb['push'](_0x965dcb['shift']());}catch(_0x629139){_0x965dcb['push'](_0x965dcb['shift']());}}}(a71_0x3da2,0x8bb22));function a71_0x3da2(){const _0x2f77bc=['Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','PERMISSION_DENIED','message','5360238cFozhj','EACCES','INVALID_ARGUMENT','ENOENT','42CPEdis','File\x20not\x20found:\x20','Permission\x20denied\x20reading\x20file:\x20','6755903HOvkLa','2027840GUqzFE','8AgPVaQ','15734KxacZq','5720395KLrmKI','\x27:\x20','code','parse','Failed\x20to\x20load\x20JSON:\x20','4794588XVaOWr','Invalid\x20JSON\x20in\x20file\x20\x27','3562RWoVWN'];a71_0x3da2=function(){return _0x2f77bc;};return a71_0x3da2();}import{readFile}from'fs/promises';import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x17ff79,_0x5688e6){const _0x25260c=a71_0x1a04;try{if(_0x5688e6){const _0x20ee97=await readFile(_0x17ff79,'utf-8');try{return JSON[_0x25260c(0x14f)](_0x20ee97);}catch(_0xf72e66){throw new SDKError(ErrorCode[_0x25260c(0x159)],_0x25260c(0x152)+_0x17ff79+_0x25260c(0x14d)+(_0xf72e66 instanceof Error?_0xf72e66[_0x25260c(0x156)]:String(_0xf72e66)));}}else try{return JSON['parse'](_0x17ff79);}catch(_0x1eb3fa){throw new SDKError(ErrorCode[_0x25260c(0x159)],'Invalid\x20JSON\x20string:\x20'+(_0x1eb3fa instanceof Error?_0x1eb3fa['message']:String(_0x1eb3fa)));}}catch(_0x3c783b){if(_0x3c783b instanceof SDKError)throw _0x3c783b;if(_0x3c783b instanceof Error&&'code'in _0x3c783b){const _0x5bc62e=_0x3c783b;if(_0x5bc62e[_0x25260c(0x14e)]===_0x25260c(0x15a))throw new SDKError(ErrorCode['NOT_FOUND'],_0x25260c(0x15c)+_0x17ff79);else{if(_0x5bc62e[_0x25260c(0x14e)]===_0x25260c(0x158))throw new SDKError(ErrorCode[_0x25260c(0x155)],_0x25260c(0x15d)+_0x17ff79);}}throw new SDKError(ErrorCode['INTERNAL'],_0x25260c(0x150)+(_0x3c783b instanceof Error?_0x3c783b[_0x25260c(0x156)]:String(_0x3c783b)));}}export async function loadJSONFromOptions(_0xdc061c,_0x35f211){const _0x371f70=a71_0x1a04;if(_0xdc061c&&_0x35f211)throw new SDKError(ErrorCode[_0x371f70(0x159)],_0x371f70(0x154));if(_0xdc061c)return await loadJSON(_0xdc061c,![]);if(_0x35f211)return await loadJSON(_0x35f211,!![]);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x4cfcc6=a72_0xec15;(function(_0x200f9a,_0x66bd8f){const _0x13cd1f=a72_0xec15,_0xee2cab=_0x200f9a();while(!![]){try{const _0x202e9d=-parseInt(_0x13cd1f(0x75))/0x1*(-parseInt(_0x13cd1f(0x76))/0x2)+-parseInt(_0x13cd1f(0x74))/0x3*(parseInt(_0x13cd1f(0x77))/0x4)+parseInt(_0x13cd1f(0x72))/0x5*(parseInt(_0x13cd1f(0x79))/0x6)+parseInt(_0x13cd1f(0x70))/0x7+parseInt(_0x13cd1f(0x78))/0x8+parseInt(_0x13cd1f(0x6d))/0x9+parseInt(_0x13cd1f(0x73))/0xa*(-parseInt(_0x13cd1f(0x71))/0xb);if(_0x202e9d===_0x66bd8f)break;else _0xee2cab['push'](_0xee2cab['shift']());}catch(_0x381bea){_0xee2cab['push'](_0xee2cab['shift']());}}}(a72_0x40fa,0x6cd63));function a72_0x40fa(){const _0x337135=['10jChqSv','181480YbJBJj','3141hqfHNQ','2031AJIfVu','126XtVuuj','220BmpPjS','1395480nMxaKZ','1058982FiIooo','toLowerCase','3238083iPtDwd','claude-4.5-sonnet','claude-4.5-haiku','6199249ymBYVh','847RuxkMh'];a72_0x40fa=function(){return _0x337135;};return a72_0x40fa();}function a72_0xec15(_0xbca766,_0x108cf5){const _0x40faaa=a72_0x40fa();return a72_0xec15=function(_0xec15bc,_0x24efe6){_0xec15bc=_0xec15bc-0x6d;let _0x2611fb=_0x40faaa[_0xec15bc];return _0x2611fb;},a72_0xec15(_0xbca766,_0x108cf5);}const MODEL_ALIASES={'haiku':a72_0x4cfcc6(0x6f),'sonnet':a72_0x4cfcc6(0x6e)};export function extractModelAlias(_0x2262ed){const _0x3e8240=_0x2262ed['match'](/^claude-(?:\d+-)?(?:\d+-?)?(sonnet|haiku|opus)/i);if(_0x3e8240)return _0x3e8240[0x1]['toLowerCase']();return _0x2262ed;}export function resolveModelAlias(_0xa3938a){const _0x37ca86=a72_0x4cfcc6;return MODEL_ALIASES[_0xa3938a[_0x37ca86(0x7a)]()]||_0xa3938a;}export function getModelAliases(){return{...MODEL_ALIASES};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b6caf,_0x5303f3){const _0x36a8dc=a73_0x380d,_0x163a56=_0x4b6caf();while(!![]){try{const _0x32dc73=parseInt(_0x36a8dc(0x199))/0x1+parseInt(_0x36a8dc(0x19c))/0x2*(parseInt(_0x36a8dc(0x194))/0x3)+-parseInt(_0x36a8dc(0x19a))/0x4+parseInt(_0x36a8dc(0x193))/0x5*(parseInt(_0x36a8dc(0x18d))/0x6)+-parseInt(_0x36a8dc(0x18e))/0x7*(parseInt(_0x36a8dc(0x196))/0x8)+-parseInt(_0x36a8dc(0x198))/0x9*(-parseInt(_0x36a8dc(0x191))/0xa)+parseInt(_0x36a8dc(0x192))/0xb;if(_0x32dc73===_0x5303f3)break;else _0x163a56['push'](_0x163a56['shift']());}catch(_0x4549a8){_0x163a56['push'](_0x163a56['shift']());}}}(a73_0x1015,0xbb351));function a73_0x1015(){const _0x5828bb=['6083990XTnqJP','35075RRtYWA','3VsfqNR','.\x20Must\x20be\x20a\x20positive\x20integer.','8VfxBCW','number','32634rpFniB','177829ZIvMTx','5225864GIbbBB','Invalid\x20timeout\x20value:\x20','1597210oKqVRQ','.\x20Must\x20be\x20a\x20number.','348ZKaKCy','7595623AjTbYN','.\x20Must\x20be\x20an\x20integer.','Invalid\x20limit\x20value:\x20','3370IiQtdb'];a73_0x1015=function(){return _0x5828bb;};return a73_0x1015();}function a73_0x380d(_0x502ce8,_0x1d9f46){const _0x1015f0=a73_0x1015();return a73_0x380d=function(_0x380dfe,_0x21def4){_0x380dfe=_0x380dfe-0x18d;let _0xb0406e=_0x1015f0[_0x380dfe];return _0xb0406e;},a73_0x380d(_0x502ce8,_0x1d9f46);}export function validateLimitOption(_0xcc4a55){const _0x4815a2=a73_0x380d;if(!Number['isInteger'](_0xcc4a55))return{'isValid':![],'error':_0x4815a2(0x190)+_0xcc4a55+_0x4815a2(0x18f)};if(_0xcc4a55<=0x0)return{'isValid':![],'error':'Invalid\x20limit\x20value:\x20'+_0xcc4a55+_0x4815a2(0x195)};return{'isValid':!![],'value':_0xcc4a55};}export function validateTimeoutOption(_0x38ad7c,_0x2e599a=0x1e){const _0x4f550=a73_0x380d;if(_0x38ad7c===undefined)return{'isValid':!![],'value':_0x2e599a};const _0x5241ed=typeof _0x38ad7c===_0x4f550(0x197)?_0x38ad7c:parseFloat(_0x38ad7c);if(isNaN(_0x5241ed))return{'isValid':![],'error':_0x4f550(0x19b)+_0x38ad7c+_0x4f550(0x19d)};if(_0x5241ed<=0x0)return{'isValid':![],'error':_0x4f550(0x19b)+_0x5241ed+'.\x20Must\x20be\x20a\x20positive\x20number.'};return{'isValid':!![],'value':_0x5241ed};}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a74_0x1e3e(){const _0x49e8da=['0.0.0.0','code','close','232188fOHSda','No\x20available\x20port\x20found\x20between\x20','3723995qzxFTM','2239959OTVKUq','EADDRINUSE','\x20and\x20','16903017BvvBmw','once','246FxCaFS','6241864hmYcCa','3522QagFMg','error','119cXYzbg','listen','10EChvMa','2318456OPKjlg'];a74_0x1e3e=function(){return _0x49e8da;};return a74_0x1e3e();}(function(_0x3513ee,_0xba0980){const _0x222fa6=a74_0x2857,_0x381d96=_0x3513ee();while(!![]){try{const _0x3c1d9b=-parseInt(_0x222fa6(0x72))/0x1*(parseInt(_0x222fa6(0x74))/0x2)+-parseInt(_0x222fa6(0x6d))/0x3+parseInt(_0x222fa6(0x79))/0x4+-parseInt(_0x222fa6(0x6c))/0x5+-parseInt(_0x222fa6(0x6a))/0x6*(-parseInt(_0x222fa6(0x76))/0x7)+-parseInt(_0x222fa6(0x73))/0x8+-parseInt(_0x222fa6(0x70))/0x9*(-parseInt(_0x222fa6(0x78))/0xa);if(_0x3c1d9b===_0xba0980)break;else _0x381d96['push'](_0x381d96['shift']());}catch(_0x3f9001){_0x381d96['push'](_0x381d96['shift']());}}}(a74_0x1e3e,0x6444e));import{createServer}from'node:net';function a74_0x2857(_0x24c51c,_0x4f41bc){const _0x1e3e80=a74_0x1e3e();return a74_0x2857=function(_0x285709,_0x3b47bd){_0x285709=_0x285709-0x69;let _0x532806=_0x1e3e80[_0x285709];return _0x532806;},a74_0x2857(_0x24c51c,_0x4f41bc);}export async function isPortAvailable(_0x451012){return new Promise(_0x1548c9=>{const _0x36c428=a74_0x2857,_0x35f93e=createServer();_0x35f93e[_0x36c428(0x71)](_0x36c428(0x75),_0x4cd31c=>{const _0xb04c83=_0x36c428;_0x4cd31c[_0xb04c83(0x7b)]===_0xb04c83(0x6e)?_0x1548c9(![]):_0x1548c9(![]);}),_0x35f93e[_0x36c428(0x71)]('listening',()=>{const _0x3deae2=_0x36c428;_0x35f93e[_0x3deae2(0x69)](),_0x1548c9(!![]);}),_0x35f93e[_0x36c428(0x77)](_0x451012,_0x36c428(0x7a));});}export async function findAvailablePort(_0x57b95e=0xfa0,_0x389b42=0x64){const _0x30189a=a74_0x2857;for(let _0x382fbe=0x0;_0x382fbe<_0x389b42;_0x382fbe++){const _0x1ed049=_0x57b95e+_0x382fbe;if(await isPortAvailable(_0x1ed049))return _0x1ed049;}throw new Error(_0x30189a(0x6b)+_0x57b95e+_0x30189a(0x6f)+(_0x57b95e+_0x389b42-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a75_0x1510b7=a75_0x111d;function a75_0x5aaa(){const _0xda795a=['ppid','trim','win32','pwsh','env','cursor','length','comm','platform','Failed\x20to\x20get\x20process\x20info\x20for\x20PID\x20','powershell','282564CuzxTh','DEBUG','utf-8','722640EvLIjV','kill','\x20on\x20POSIX:','810452EjKQDU','toLowerCase','pid','119218jDRHmI','48sauISZ','3xzGnyx','170QjybFl','635914XeRIjU','Found\x20ephemeral\x20shell\x20','\x20on\x20Windows:','csh','\x20-o\x20ppid=,comm=','split','fish','bash','has','35TjaZWn','ps\x20-p\x20','913542gNsajJ','\x20get\x20ParentProcessId,Name\x20/format:csv','ksh','error','filter','code','4452eLiCcS','zsh','xonsh',')\x20spawned\x20by\x20','1835222NVnksO'];a75_0x5aaa=function(){return _0xda795a;};return a75_0x5aaa();}(function(_0x2eef02,_0x139908){const _0x291414=a75_0x111d,_0x9a7df9=_0x2eef02();while(!![]){try{const _0x3f4458=-parseInt(_0x291414(0x129))/0x1+-parseInt(_0x291414(0x110))/0x2*(parseInt(_0x291414(0x127))/0x3)+parseInt(_0x291414(0x122))/0x4+parseInt(_0x291414(0x104))/0x5*(-parseInt(_0x291414(0x11f))/0x6)+-parseInt(_0x291414(0x106))/0x7*(parseInt(_0x291414(0x126))/0x8)+parseInt(_0x291414(0x11c))/0x9*(-parseInt(_0x291414(0x128))/0xa)+-parseInt(_0x291414(0x125))/0xb*(-parseInt(_0x291414(0x10c))/0xc);if(_0x3f4458===_0x139908)break;else _0x9a7df9['push'](_0x9a7df9['shift']());}catch(_0x55829e){_0x9a7df9['push'](_0x9a7df9['shift']());}}}(a75_0x5aaa,0x7c8ba));function a75_0x111d(_0x5c69cf,_0x3568db){const _0x5aaaec=a75_0x5aaa();return a75_0x111d=function(_0x111d25,_0xa5165a){_0x111d25=_0x111d25-0xfc;let _0x23d58a=_0x5aaaec[_0x111d25];return _0x23d58a;},a75_0x111d(_0x5c69cf,_0x3568db);}import{execSync}from'node:child_process';const SHELL_NAMES=new Set([a75_0x1510b7(0x102),a75_0x1510b7(0x10d),'sh',a75_0x1510b7(0x101),a75_0x1510b7(0x108),'tcsh',a75_0x1510b7(0xfe),'dash',a75_0x1510b7(0x114),a75_0x1510b7(0x11b),'nu','ion','elvish',a75_0x1510b7(0x10e)]),EPHEMERAL_SHELL_SPAWNERS=new Set(['claude',a75_0x1510b7(0x10b),a75_0x1510b7(0x116)]);function getProcessInfoWindows(_0x4ff0b7){const _0xa5a7f7=a75_0x1510b7;try{const _0x2cf913=execSync('wmic\x20process\x20where\x20ProcessId='+_0x4ff0b7+_0xa5a7f7(0x107),{'encoding':_0xa5a7f7(0x11e),'windowsHide':!![]})[_0xa5a7f7(0x112)](),_0xa8f38a=_0x2cf913['split']('\x0a')[_0xa5a7f7(0x10a)](_0x299915=>_0x299915['trim']());if(_0xa8f38a['length']<0x2)return null;const _0x1ee6e9=_0xa8f38a[_0xa8f38a[_0xa5a7f7(0x117)]-0x1][_0xa5a7f7(0x100)](',');if(_0x1ee6e9[_0xa5a7f7(0x117)]<0x3)return null;const _0x11a767=_0x1ee6e9[0x1]?.[_0xa5a7f7(0x112)]()||'',_0xf101d3=parseInt(_0x1ee6e9[0x2]?.['trim']()||'0',0xa);if(isNaN(_0xf101d3)||!_0x11a767)return null;return{'pid':_0x4ff0b7,'ppid':_0xf101d3,'comm':_0x11a767['replace'](/\.exe$/i,'')};}catch(_0x328337){return process['env'][_0xa5a7f7(0x11d)]&&console['error'](_0xa5a7f7(0x11a)+_0x4ff0b7+_0xa5a7f7(0xfd),_0x328337),null;}}function getProcessInfoPosix(_0x3be86c){const _0x61f7bd=a75_0x1510b7;try{const _0x56cb06=execSync(_0x61f7bd(0x105)+_0x3be86c+_0x61f7bd(0xff),{'encoding':_0x61f7bd(0x11e)})[_0x61f7bd(0x112)](),[_0x36bbc4,..._0x5b0f3d]=_0x56cb06[_0x61f7bd(0x100)](/\s+/),_0x330321=parseInt(_0x36bbc4,0xa),_0x352602=_0x5b0f3d['join']('\x20');if(isNaN(_0x330321))return null;return{'pid':_0x3be86c,'ppid':_0x330321,'comm':_0x352602};}catch(_0x3ad596){return process[_0x61f7bd(0x115)]['DEBUG']&&console['error'](_0x61f7bd(0x11a)+_0x3be86c+_0x61f7bd(0x121),_0x3ad596),null;}}function getProcessInfo(_0x21219b){const _0x26d0f6=a75_0x1510b7;if(process[_0x26d0f6(0x119)]===_0x26d0f6(0x113))return getProcessInfoWindows(_0x21219b);return getProcessInfoPosix(_0x21219b);}function getBasename(_0x2fad15){const _0x440505=a75_0x1510b7;return _0x2fad15['replace'](/^-/,'')[_0x440505(0x100)]('/')['pop']()?.[_0x440505(0x123)]()||'';}function isShell(_0x15ef16){return SHELL_NAMES['has'](getBasename(_0x15ef16));}function isEphemeralShellSpawner(_0x1f44ed){const _0x2e44ff=a75_0x1510b7;return EPHEMERAL_SHELL_SPAWNERS[_0x2e44ff(0x103)](getBasename(_0x1f44ed));}let cachedShellPID;function findShellPID(){const _0x336d06=a75_0x1510b7;let _0x21c382=process[_0x336d06(0x111)];const _0xdb7ae4=0xa;let _0x47197f=0x0;while(_0x47197f<_0xdb7ae4){const _0x2f88bf=getProcessInfo(_0x21c382);if(!_0x2f88bf){process[_0x336d06(0x115)]['DEBUG']&&console['error']('Could\x20not\x20get\x20process\x20info\x20for\x20PID\x20'+_0x21c382+',\x20using\x20fallback');break;}if(isShell(_0x2f88bf[_0x336d06(0x118)])){const _0x59a27d=getProcessInfo(_0x2f88bf[_0x336d06(0x111)]);if(_0x59a27d&&isEphemeralShellSpawner(_0x59a27d[_0x336d06(0x118)])){process['env'][_0x336d06(0x11d)]&&console['error'](_0x336d06(0xfc)+_0x2f88bf[_0x336d06(0x124)]+'\x20('+_0x2f88bf[_0x336d06(0x118)]+_0x336d06(0x10f)+_0x59a27d['comm']+',\x20continuing\x20up');_0x21c382=_0x2f88bf[_0x336d06(0x111)],_0x47197f++;continue;}return _0x2f88bf[_0x336d06(0x124)];}if(_0x2f88bf[_0x336d06(0x111)]===0x0||_0x2f88bf['ppid']===0x1){if(isShell(_0x2f88bf[_0x336d06(0x118)]))return _0x2f88bf[_0x336d06(0x124)];break;}_0x21c382=_0x2f88bf[_0x336d06(0x111)],_0x47197f++;}return process[_0x336d06(0x115)][_0x336d06(0x11d)]&&console[_0x336d06(0x109)]('No\x20shell\x20found\x20in\x20process\x20tree,\x20falling\x20back\x20to\x20process.ppid'),process['ppid'];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x1b37d5){const _0x54cb91=a75_0x1510b7;try{return process[_0x54cb91(0x120)](_0x1b37d5,0x0),!![];}catch{return![];}}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f5874,_0x2b27a7){const _0x52d233=a76_0x3c22,_0x576743=_0x5f5874();while(!![]){try{const _0x442ae6=parseInt(_0x52d233(0x17c))/0x1*(parseInt(_0x52d233(0x187))/0x2)+-parseInt(_0x52d233(0x185))/0x3*(parseInt(_0x52d233(0x182))/0x4)+-parseInt(_0x52d233(0x17e))/0x5+-parseInt(_0x52d233(0x177))/0x6*(parseInt(_0x52d233(0x178))/0x7)+-parseInt(_0x52d233(0x17a))/0x8*(-parseInt(_0x52d233(0x17f))/0x9)+parseInt(_0x52d233(0x17b))/0xa+parseInt(_0x52d233(0x17d))/0xb*(-parseInt(_0x52d233(0x184))/0xc);if(_0x442ae6===_0x2b27a7)break;else _0x576743['push'](_0x576743['shift']());}catch(_0x3bd208){_0x576743['push'](_0x576743['shift']());}}}(a76_0x3e80,0xdc434));function a76_0x3c22(_0x1df49b,_0x40f394){const _0x3e801d=a76_0x3e80();return a76_0x3c22=function(_0x3c2298,_0x129798){_0x3c2298=_0x3c2298-0x177;let _0x3defd5=_0x3e801d[_0x3c2298];return _0x3defd5;},a76_0x3c22(_0x1df49b,_0x40f394);}import*as a76_0xe244d0 from'readline';function a76_0x3e80(){const _0x5390b7=['close','8754SnHksF','3297jOktaq','stdin','1216rDXqAG','14232420VtVQdq','202175AzKcAc','1925132PHOuOc','4973070TZtqvr','87750WGbTDI','stdout','\x20(y/N):\x20','40BrMicV','toLowerCase','108fbhWyV','48408raxgvi','question','14ZCUkCy','createInterface'];a76_0x3e80=function(){return _0x5390b7;};return a76_0x3e80();}export async function confirm(_0x5f4cb9){const _0x4f0f31=a76_0x3c22,_0x40da64=a76_0xe244d0[_0x4f0f31(0x188)]({'input':process[_0x4f0f31(0x179)],'output':process[_0x4f0f31(0x180)]});return new Promise(_0xaeb40f=>{const _0x1c526b=_0x4f0f31;_0x40da64[_0x1c526b(0x186)](_0x5f4cb9+_0x1c526b(0x181),_0x504a47=>{const _0x238cf0=_0x1c526b;_0x40da64[_0x238cf0(0x189)](),_0xaeb40f(_0x504a47['toLowerCase']()==='y'||_0x504a47[_0x238cf0(0x183)]()==='yes');});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3344b2,_0x6d8397){const _0x166c09=a77_0x25c5,_0x4a5df6=_0x3344b2();while(!![]){try{const _0x283979=parseInt(_0x166c09(0x94))/0x1+-parseInt(_0x166c09(0x82))/0x2+-parseInt(_0x166c09(0x7d))/0x3*(parseInt(_0x166c09(0x7a))/0x4)+parseInt(_0x166c09(0x80))/0x5*(-parseInt(_0x166c09(0x8d))/0x6)+parseInt(_0x166c09(0x79))/0x7*(parseInt(_0x166c09(0x83))/0x8)+parseInt(_0x166c09(0x7e))/0x9*(parseInt(_0x166c09(0x85))/0xa)+parseInt(_0x166c09(0x77))/0xb;if(_0x283979===_0x6d8397)break;else _0x4a5df6['push'](_0x4a5df6['shift']());}catch(_0x291f5c){_0x4a5df6['push'](_0x4a5df6['shift']());}}}(a77_0x553a,0x94ef2));export function parsePath(_0xd89845){const _0x2a67d6=a77_0x25c5;if(!_0xd89845||_0xd89845[_0x2a67d6(0x91)]()==='')throw new Error(_0x2a67d6(0x90));const _0x589e0d=_0xd89845[_0x2a67d6(0x91)]();if(_0x589e0d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xd89845};const _0x34f5c8=_0x589e0d[_0x2a67d6(0x88)]('/')?_0x589e0d['substring'](0x1):_0x589e0d,_0x3d8b1b=_0x34f5c8[_0x2a67d6(0x95)]('/')['filter'](_0x12ccd1=>_0x12ccd1!=='');if(_0x3d8b1b[_0x2a67d6(0x84)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x427ad6=_0x589e0d[_0x2a67d6(0x88)]('/')||!isRelativePathSegment(_0x3d8b1b[0x0]);for(const _0x179db8 of _0x3d8b1b){validatePathSegment(_0x179db8);}return{'segments':_0x3d8b1b,'isAbsolute':_0x427ad6,'raw':_0xd89845};}function a77_0x25c5(_0x131a09,_0x501e00){const _0x553ae6=a77_0x553a();return a77_0x25c5=function(_0x25c55f,_0xa6f095){_0x25c55f=_0x25c55f-0x77;let _0x18919b=_0x553ae6[_0x25c55f];return _0x18919b;},a77_0x25c5(_0x131a09,_0x501e00);}function isRelativePathSegment(_0x484b3e){return _0x484b3e==='.'||_0x484b3e==='..';}function a77_0x553a(){const _0x5898c5=['25336927RkHFsT','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','5341OHpFse','92TsIpqq','test','join','134991RlESeH','18NWRwwH','segments','1013955adcRhs','isAbsolute','1501446XsBlPk','6728SGDSTQ','length','456590eNEfNh','Path\x20segment\x20cannot\x20be\x20empty','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','startsWith','pop','Relative\x20path\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','push','36pSRaZB','slice','Cannot\x20split\x20empty\x20path','Path\x20cannot\x20be\x20empty','trim','Path\x20attempts\x20to\x20navigate\x20above\x20root','raw','576076MYaaKP','split'];a77_0x553a=function(){return _0x5898c5;};return a77_0x553a();}function validatePathSegment(_0x40cfdd){const _0x486c67=a77_0x25c5;if(_0x40cfdd==='')throw new Error(_0x486c67(0x86));if(_0x40cfdd==='.'||_0x40cfdd==='..')return;if(/[\x00-\x1F\x7F]/[_0x486c67(0x7b)](_0x40cfdd))throw new Error(_0x486c67(0x87)+_0x40cfdd);if(_0x40cfdd!==_0x40cfdd['trim']()){}}export function validatePath(_0x5850b5){const _0x18c61e=a77_0x25c5;if(_0x5850b5[_0x18c61e(0x7f)][_0x18c61e(0x84)]===0x0&&!_0x5850b5[_0x18c61e(0x81)])throw new Error(_0x18c61e(0x8a));if(_0x5850b5[_0x18c61e(0x81)]){if(_0x5850b5[_0x18c61e(0x7f)][0x0]==='..')throw new Error(_0x18c61e(0x78));let _0x31f779=0x0;for(const _0x44138e of _0x5850b5[_0x18c61e(0x7f)]){if(_0x44138e==='..'){if(_0x31f779===0x0)throw new Error(_0x18c61e(0x92));_0x31f779--;}else _0x44138e!=='.'&&_0x31f779++;}}}export function joinPaths(_0x36a4d3,_0x53d731){const _0x5f5212=a77_0x25c5;if(!_0x36a4d3||_0x36a4d3==='/')return _0x53d731;if(!_0x53d731||_0x53d731==='.')return _0x36a4d3;if(_0x53d731[_0x5f5212(0x88)]('/'))return _0x53d731;const _0x3d56cb=parsePath(_0x36a4d3),_0x217586=parsePath(_0x53d731),_0x53c7a7=[..._0x3d56cb['segments']];for(const _0x3277b9 of _0x217586[_0x5f5212(0x7f)]){if(_0x3277b9==='.')continue;else{if(_0x3277b9==='..'){if(_0x53c7a7[_0x5f5212(0x84)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x53c7a7[_0x5f5212(0x89)]();}else _0x53c7a7[_0x5f5212(0x8c)](_0x3277b9);}}const _0xbde776=_0x53c7a7[_0x5f5212(0x7c)]('/');return _0x3d56cb[_0x5f5212(0x93)][_0x5f5212(0x88)]('/')?'/'+_0xbde776:_0xbde776;}export function normalizePath(_0xe3e707){const _0x583b48=a77_0x25c5,_0x4ac736=parsePath(_0xe3e707),_0x22d5f7=[];for(const _0x338b6f of _0x4ac736[_0x583b48(0x7f)]){if(_0x338b6f==='.')continue;else{if(_0x338b6f==='..'){if(_0x22d5f7[_0x583b48(0x84)]===0x0){if(_0x4ac736[_0x583b48(0x81)])throw new Error(_0x583b48(0x8b));_0x22d5f7[_0x583b48(0x8c)]('..');}else _0x22d5f7[_0x22d5f7[_0x583b48(0x84)]-0x1]==='..'?_0x22d5f7[_0x583b48(0x8c)]('..'):_0x22d5f7['pop']();}else _0x22d5f7[_0x583b48(0x8c)](_0x338b6f);}}if(_0x22d5f7[_0x583b48(0x84)]===0x0)return _0x4ac736[_0x583b48(0x81)]?'/':'.';const _0x46bc73=_0x22d5f7['join']('/');return _0x4ac736['raw'][_0x583b48(0x88)]('/')?'/'+_0x46bc73:_0x46bc73;}export function getParentPath(_0xb76d3){const _0x3070d6=a77_0x25c5,_0x7ee910=parsePath(_0xb76d3);if(_0x7ee910['segments']['length']<=0x1)return'/';const _0xaf5e6=_0x7ee910[_0x3070d6(0x7f)]['slice'](0x0,-0x1)[_0x3070d6(0x7c)]('/');return _0x7ee910[_0x3070d6(0x93)][_0x3070d6(0x88)]('/')?'/'+_0xaf5e6:_0xaf5e6;}export function getBaseName(_0x454d98){const _0x36b308=a77_0x25c5,_0x5c8b9f=parsePath(_0x454d98);return _0x5c8b9f[_0x36b308(0x7f)][_0x5c8b9f[_0x36b308(0x7f)][_0x36b308(0x84)]-0x1]||'';}export function isChildPath(_0x3a6d60,_0x3b21a9){const _0x1cfd63=a77_0x25c5,_0x3ca81d=parsePath(_0x3a6d60),_0x1d12cb=parsePath(_0x3b21a9);if(_0x3ca81d[_0x1cfd63(0x7f)][_0x1cfd63(0x84)]<=_0x1d12cb[_0x1cfd63(0x7f)]['length'])return![];for(let _0x337aec=0x0;_0x337aec<_0x1d12cb[_0x1cfd63(0x7f)][_0x1cfd63(0x84)];_0x337aec++){if(_0x3ca81d[_0x1cfd63(0x7f)][_0x337aec]!==_0x1d12cb['segments'][_0x337aec])return![];}return!![];}export function splitPath(_0x24934f){const _0x33e76a=a77_0x25c5,_0x38de8d=parsePath(_0x24934f);if(_0x38de8d[_0x33e76a(0x7f)]['length']===0x0)throw new Error(_0x33e76a(0x8f));if(_0x38de8d[_0x33e76a(0x7f)][_0x33e76a(0x84)]===0x1)return{'parent':_0x38de8d[_0x33e76a(0x7f)][0x0]};return{'parent':_0x38de8d[_0x33e76a(0x7f)][0x0],'child':_0x38de8d[_0x33e76a(0x7f)][_0x33e76a(0x8e)](0x1)['join']('/')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a78_0x3c2c(){const _0x1e9a6d=['Invalid\x20segment\x20reference\x20format:\x20','4BsMqEl','substring','3847014RwJRBk','3802296FVJffq','118xEgjfG','734574mIUlgg','.\x20Parent\x20name\x20cannot\x20be\x20empty','45hxKMjZ','255128Ddupan','280qTMglW','4632410VEyveD','11iGlApG','indexOf','.\x20Child\x20name\x20cannot\x20be\x20empty','5263dVuVFM','2109740JtPgnJ'];a78_0x3c2c=function(){return _0x1e9a6d;};return a78_0x3c2c();}(function(_0x56bd5c,_0x4aae4a){const _0x5610f5=a78_0x9f03,_0xb04c3a=_0x56bd5c();while(!![]){try{const _0x3052b9=-parseInt(_0x5610f5(0xee))/0x1*(-parseInt(_0x5610f5(0xf5))/0x2)+-parseInt(_0x5610f5(0xf3))/0x3+-parseInt(_0x5610f5(0xf1))/0x4*(parseInt(_0x5610f5(0xea))/0x5)+parseInt(_0x5610f5(0xf6))/0x6+-parseInt(_0x5610f5(0xe9))/0x7*(-parseInt(_0x5610f5(0xf9))/0x8)+-parseInt(_0x5610f5(0xf8))/0x9*(-parseInt(_0x5610f5(0xef))/0xa)+-parseInt(_0x5610f5(0xeb))/0xb*(-parseInt(_0x5610f5(0xf4))/0xc);if(_0x3052b9===_0x4aae4a)break;else _0xb04c3a['push'](_0xb04c3a['shift']());}catch(_0x5f461e){_0xb04c3a['push'](_0xb04c3a['shift']());}}}(a78_0x3c2c,0xd4c46));function a78_0x9f03(_0x2f066b,_0x11f586){const _0x3c2cf2=a78_0x3c2c();return a78_0x9f03=function(_0x9f0358,_0x6595c7){_0x9f0358=_0x9f0358-0xe9;let _0x43626e=_0x3c2cf2[_0x9f0358];return _0x43626e;},a78_0x9f03(_0x2f066b,_0x11f586);}export function parseSegmentRef(_0x4cee53){const _0x8beea5=a78_0x9f03,_0xc7efbd=_0x4cee53[_0x8beea5(0xec)]('/');if(_0xc7efbd===-0x1)return{'parentId':_0x4cee53};if(_0xc7efbd===0x0)throw new Error(_0x8beea5(0xf0)+_0x4cee53+_0x8beea5(0xf7));const _0x54941d=_0x4cee53[_0x8beea5(0xf2)](0x0,_0xc7efbd),_0x56fb76=_0x4cee53['substring'](_0xc7efbd+0x1);if(_0x56fb76==='')throw new Error(_0x8beea5(0xf0)+_0x4cee53+_0x8beea5(0xed));return{'parentId':_0x54941d,'childId':_0x56fb76};}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x44f336,_0x31695b){const _0x43638d=a79_0x1671,_0x3ffb3d=_0x44f336();while(!![]){try{const _0x48628e=-parseInt(_0x43638d(0x6a))/0x1+parseInt(_0x43638d(0x80))/0x2+parseInt(_0x43638d(0x78))/0x3*(-parseInt(_0x43638d(0x7a))/0x4)+parseInt(_0x43638d(0x7d))/0x5*(parseInt(_0x43638d(0x6b))/0x6)+-parseInt(_0x43638d(0x7c))/0x7+parseInt(_0x43638d(0x70))/0x8*(-parseInt(_0x43638d(0x73))/0x9)+-parseInt(_0x43638d(0x6f))/0xa*(-parseInt(_0x43638d(0x7e))/0xb);if(_0x48628e===_0x31695b)break;else _0x3ffb3d['push'](_0x3ffb3d['shift']());}catch(_0x7b2016){_0x3ffb3d['push'](_0x3ffb3d['shift']());}}}(a79_0x5abb,0x3f4b2));import a79_0x24f75b from'ora';export function createCommandSpinner(_0x518435,_0x222d6c={}){const _0x1fb592=a79_0x1671,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0x222d6c;return a79_0x24f75b({'text':_0x518435,'color':_0x1fb592(0x72),'isEnabled':forceEnabled||process[_0x1fb592(0x82)][_0x1fb592(0x7b)]&&!verbose});}function a79_0x1671(_0x2ba785,_0x3f5570){const _0x5abb4d=a79_0x5abb();return a79_0x1671=function(_0x1671fc,_0x11a44c){_0x1671fc=_0x1671fc-0x6a;let _0x4ea9cb=_0x5abb4d[_0x1671fc];return _0x4ea9cb;},a79_0x1671(_0x2ba785,_0x3f5570);}function a79_0x5abb(){const _0xf5524a=['extra','cyan','18099jnhrnO','start','toFixed','\x20[Job\x20ID:\x20','text','3309LbiPpl','clock','1588MAvbVG','isTTY','1435406AwNVQq','25eEzIRr','2483261CnNDgY','phase','368086hcDqVX','jobId','stdout','54305FQtwYQ','43644CPXVoV','floor','replace','now','40VfPYvC','664pqNqTA'];a79_0x5abb=function(){return _0xf5524a;};return a79_0x5abb();}export async function withSpinner(_0xbf7d62,_0x1ea4f0,_0x41360f={}){const _0xe349f4=a79_0x1671,_0x230a43=_0x41360f[_0xe349f4(0x79)]??(()=>Date[_0xe349f4(0x6e)]()),_0x4b1d72=createCommandSpinner(_0xbf7d62,_0x41360f);_0x4b1d72[_0xe349f4(0x74)]();const _0x5c6f5d=_0x230a43();try{const _0x1937df=await _0x1ea4f0(),_0x37f881=_0x230a43()-_0x5c6f5d;return _0x4b1d72['stop'](),{'data':_0x1937df,'elapsedMs':_0x37f881};}catch(_0x22dbbc){_0x4b1d72['stop']();throw _0x22dbbc;}}export async function withQuerySpinner(_0x49d5b5,_0x3f879f,_0x35a453={}){const _0x424e18=a79_0x1671,_0xae50dc=_0x35a453[_0x424e18(0x79)]??(()=>Date[_0x424e18(0x6e)]()),_0x1ccf52=_0x35a453['intervalFactory']??setInterval,_0x59baf5=createCommandSpinner(_0x49d5b5,_0x35a453);_0x59baf5[_0x424e18(0x74)]();const _0x2a8f6a=_0xae50dc(),_0x529950=_0x49d5b5[_0x424e18(0x6d)]('...',''),_0x4ef5d8={},_0x20a1f7=()=>{const _0x25b0aa=_0x424e18;if(!_0x59baf5['isSpinning'])return;const _0x1de40d=_0xae50dc()-_0x2a8f6a,_0x319f90=formatElapsed(_0x1de40d),_0x14f0af=_0x4ef5d8['phase']??_0x529950,_0x4355cd=_0x4ef5d8[_0x25b0aa(0x81)]?_0x25b0aa(0x76)+_0x4ef5d8[_0x25b0aa(0x81)]+']':'',_0x19d8f8=_0x4ef5d8[_0x25b0aa(0x71)]?'\x20'+_0x4ef5d8[_0x25b0aa(0x71)]:'';_0x59baf5[_0x25b0aa(0x77)]=_0x14f0af+'\x20'+_0x319f90+_0x19d8f8+_0x4355cd;},_0x35ddf1=_0x1ccf52(()=>{_0x20a1f7();},0x3e8),_0x2ad12f={'setPhase':_0x10b21e=>{const _0x55acc6=_0x424e18;_0x4ef5d8[_0x55acc6(0x7f)]=_0x10b21e,_0x20a1f7();},'setJobId':_0x3d4a3d=>{_0x4ef5d8['jobId']=_0x3d4a3d,_0x20a1f7();},'setExtra':_0x2ada99=>{const _0x3f50c0=_0x424e18;_0x4ef5d8[_0x3f50c0(0x71)]=_0x2ada99,_0x20a1f7();}};_0x20a1f7();try{const _0x5a772d=await _0x3f879f(_0x2ad12f),_0x41daee=_0xae50dc()-_0x2a8f6a;return{'data':_0x5a772d,'elapsedMs':_0x41daee};}finally{clearInterval(_0x35ddf1),_0x59baf5['stop']();}}export function formatElapsed(_0x47ce1c){const _0x185e7f=a79_0x1671,_0x372d0e=Math['floor'](_0x47ce1c/0x3e8);if(_0x372d0e<0x3c)return(_0x47ce1c/0x3e8)[_0x185e7f(0x75)](0x1)+'s';const _0x56ca91=Math[_0x185e7f(0x6c)](_0x372d0e/0x3c),_0x3ed66d=_0x372d0e%0x3c;if(_0x56ca91<0x3c)return _0x56ca91+'m\x20'+_0x3ed66d+'s';const _0x40ce25=Math['floor'](_0x56ca91/0x3c),_0xf20176=_0x56ca91%0x3c;return _0x40ce25+'h\x20'+_0xf20176+'m';}
|
package/dist/utils/sql-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x21a32d,_0x22a263){const _0x3abe84=a80_0x34e2,_0x2e1b34=_0x21a32d();while(!![]){try{const _0x38858d=-parseInt(_0x3abe84(0x7f))/0x1*(-parseInt(_0x3abe84(0x6c))/0x2)+-parseInt(_0x3abe84(0x7d))/0x3+-parseInt(_0x3abe84(0x6f))/0x4*(-parseInt(_0x3abe84(0x83))/0x5)+-parseInt(_0x3abe84(0x85))/0x6+-parseInt(_0x3abe84(0x87))/0x7*(parseInt(_0x3abe84(0x70))/0x8)+-parseInt(_0x3abe84(0x82))/0x9*(-parseInt(_0x3abe84(0x75))/0xa)+-parseInt(_0x3abe84(0x72))/0xb*(-parseInt(_0x3abe84(0x79))/0xc);if(_0x38858d===_0x22a263)break;else _0x2e1b34['push'](_0x2e1b34['shift']());}catch(_0xee63b2){_0x2e1b34['push'](_0x2e1b34['shift']());}}}(a80_0x4d8f,0x8ca2b));import{readFileSync}from'fs';export function stripSqlComments(_0x1880ac){const _0x4f1747=a80_0x34e2;let _0x339f7c=_0x1880ac[_0x4f1747(0x84)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x339f7c=_0x339f7c[_0x4f1747(0x84)](/--.*$/gm,''),_0x339f7c[_0x4f1747(0x77)]();}function a80_0x4d8f(){const _0x1f320f=['6357022CVkwfg','15322MDInmm','ENOENT','\x27\x20not\x20found','188cjGrXm','8nPwPUf','\x27:\x20','55eUEOgu','length','Content\x20contains\x20no\x20SQL\x20statements','5335090nUtqDB','code','trim','Error\x20reading\x20file\x20\x27','3238476ldndHy','toLowerCase','message','Permission\x20denied\x20reading\x20file\x20\x27','664470vuKCCk','File\x20\x27','47KKgspd','utf-8','push','18vNiqQz','200TxggGb','replace','6435906ctGSSU','map'];a80_0x4d8f=function(){return _0x1f320f;};return a80_0x4d8f();}function isEscaped(_0x17f3d6,_0x5c51d7){let _0x3b2a6b=0x0;for(let _0x1c8f99=_0x5c51d7-0x1;_0x1c8f99>=0x0&&_0x17f3d6[_0x1c8f99]==='\x5c';_0x1c8f99--){_0x3b2a6b++;}return _0x3b2a6b%0x2===0x1;}export function splitSqlStatements(_0x1a6215){const _0x587596=a80_0x34e2,_0x4928cd=stripSqlComments(_0x1a6215);if(!_0x4928cd)throw new Error(_0x587596(0x74));const _0x229975=[];let _0x512ad3='',_0x50dc5d=![],_0x3bd95d=![],_0x577071=![];for(let _0x3db265=0x0;_0x3db265<_0x1a6215['length'];_0x3db265++){const _0x1228fe=_0x1a6215[_0x3db265];if(_0x1228fe==='\x27'&&!isEscaped(_0x1a6215,_0x3db265)&&!_0x3bd95d&&!_0x577071)_0x50dc5d=!_0x50dc5d;else{if(_0x1228fe==='\x22'&&!isEscaped(_0x1a6215,_0x3db265)&&!_0x50dc5d&&!_0x577071)_0x3bd95d=!_0x3bd95d;else _0x1228fe==='`'&&!isEscaped(_0x1a6215,_0x3db265)&&!_0x50dc5d&&!_0x3bd95d&&(_0x577071=!_0x577071);}if(_0x1228fe===';'&&!_0x50dc5d&&!_0x3bd95d&&!_0x577071){const _0x50bebf=_0x512ad3[_0x587596(0x77)]();_0x50bebf&&_0x229975[_0x587596(0x81)](_0x50bebf),_0x512ad3='';}else _0x512ad3+=_0x1228fe;}const _0x1bd8b7=_0x512ad3[_0x587596(0x77)]();_0x1bd8b7&&_0x229975[_0x587596(0x81)](_0x1bd8b7);const _0x359034=_0x229975[_0x587596(0x86)](_0x2e6fca=>_0x2e6fca[_0x587596(0x77)]())['filter'](_0x8291e4=>{const _0x305e92=_0x587596,_0x293411=stripSqlComments(_0x8291e4);return _0x293411[_0x305e92(0x73)]>0x0;});if(_0x359034[_0x587596(0x73)]===0x0)throw new Error('Content\x20contains\x20no\x20SQL\x20statements');return _0x359034;}function a80_0x34e2(_0x2ad9cd,_0x50bad4){const _0x4d8ff8=a80_0x4d8f();return a80_0x34e2=function(_0x34e275,_0x2c19ba){_0x34e275=_0x34e275-0x6c;let _0x79a398=_0x4d8ff8[_0x34e275];return _0x79a398;},a80_0x34e2(_0x2ad9cd,_0x50bad4);}export function readFileContent(_0x1e5f72){const _0x5bc359=a80_0x34e2;try{return readFileSync(_0x1e5f72,_0x5bc359(0x80));}catch(_0x8390f6){const _0x3bf5ea=_0x8390f6[_0x5bc359(0x76)];if(_0x3bf5ea===_0x5bc359(0x6d))throw new Error(_0x5bc359(0x7e)+_0x1e5f72+_0x5bc359(0x6e));else{if(_0x3bf5ea==='EACCES')throw new Error(_0x5bc359(0x7c)+_0x1e5f72+'\x27');else throw new Error(_0x5bc359(0x78)+_0x1e5f72+_0x5bc359(0x71)+_0x8390f6[_0x5bc359(0x7b)]);}}}export function readSqlStatementsFromFile(_0x1b7695){const _0x2d7b23=a80_0x34e2,_0x2adf91=readFileContent(_0x1b7695);try{return splitSqlStatements(_0x2adf91);}catch(_0x45793d){throw new Error(_0x2d7b23(0x7e)+_0x1b7695+'\x27\x20'+_0x45793d[_0x2d7b23(0x7b)][_0x2d7b23(0x7a)]());}}
|
package/dist/utils/sse-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a81_0x4fed(_0x2d7a87,_0xee2dac){const _0x1b028e=a81_0x1b02();return a81_0x4fed=function(_0x4fedd3,_0x22ee6c){_0x4fedd3=_0x4fedd3-0x1ee;let _0x211240=_0x1b028e[_0x4fedd3];return _0x211240;},a81_0x4fed(_0x2d7a87,_0xee2dac);}(function(_0x521a71,_0x167013){const _0x572eef=a81_0x4fed,_0x378dd9=_0x521a71();while(!![]){try{const _0x2074b8=parseInt(_0x572eef(0x1f5))/0x1+parseInt(_0x572eef(0x1fd))/0x2+-parseInt(_0x572eef(0x204))/0x3*(-parseInt(_0x572eef(0x200))/0x4)+-parseInt(_0x572eef(0x1ee))/0x5*(-parseInt(_0x572eef(0x1f1))/0x6)+parseInt(_0x572eef(0x1f6))/0x7*(-parseInt(_0x572eef(0x1fb))/0x8)+-parseInt(_0x572eef(0x1f0))/0x9+parseInt(_0x572eef(0x1fa))/0xa;if(_0x2074b8===_0x167013)break;else _0x378dd9['push'](_0x378dd9['shift']());}catch(_0x352ec9){_0x378dd9['push'](_0x378dd9['shift']());}}}(a81_0x1b02,0x4e4cc));function a81_0x1b02(){const _0x50d7a7=['6PIJJEL','getReader','body','startsWith','566328YraOHD','6433YpBgWv','Failed\x20to\x20parse\x20SSE\x20data\x20as\x20JSON:\x20','split','read','1919540RxuRmA','5528jZSJpr','decode','220116pwAIzK','data','trim','5800WpBKpz','[LLM\x20API\x20SSE]\x20','slice','parse','246ZNRCPQ','1859510xcNLyX','debug','3630573xGSerB'];a81_0x1b02=function(){return _0x50d7a7;};return a81_0x1b02();}export async function*parseSSEStream(_0x1bef55,_0x5be334){const _0x5ae430=a81_0x4fed;if(!_0x1bef55['body'])throw new Error('Response\x20body\x20is\x20null');const _0x2490fa=_0x1bef55[_0x5ae430(0x1f3)][_0x5ae430(0x1f2)](),_0x3f6055=new TextDecoder();let _0x11f0a2='',_0x8da4f={};try{while(!![]){const {done:_0x289fb7,value:_0x3739ad}=await _0x2490fa[_0x5ae430(0x1f9)]();if(_0x289fb7){if(_0x8da4f[_0x5ae430(0x1fe)]){_0x5be334?.[_0x5ae430(0x1ef)](_0x5ae430(0x201)+_0x8da4f[_0x5ae430(0x1fe)]);const _0x56328f=parseSSEData(_0x8da4f['data']);yield _0x56328f;}break;}_0x11f0a2+=_0x3f6055[_0x5ae430(0x1fc)](_0x3739ad,{'stream':!![]});const _0x343890=_0x11f0a2[_0x5ae430(0x1f8)]('\x0a');_0x11f0a2=_0x343890['pop']()||'';for(const _0x2d0caf of _0x343890){if(_0x2d0caf[_0x5ae430(0x1ff)]()===''){if(_0x8da4f[_0x5ae430(0x1fe)]){_0x5be334?.[_0x5ae430(0x1ef)](_0x5ae430(0x201)+_0x8da4f[_0x5ae430(0x1fe)]);const _0x4fa985=parseSSEData(_0x8da4f['data']);yield _0x4fa985,_0x8da4f={};}continue;}if(_0x2d0caf[_0x5ae430(0x1f4)](':'))continue;const _0x5bb837=_0x2d0caf['indexOf'](':');if(_0x5bb837===-0x1)continue;const _0x12e0d7=_0x2d0caf[_0x5ae430(0x202)](0x0,_0x5bb837);let _0x438766=_0x2d0caf[_0x5ae430(0x202)](_0x5bb837+0x1);_0x438766[_0x5ae430(0x1f4)]('\x20')&&(_0x438766=_0x438766[_0x5ae430(0x202)](0x1));switch(_0x12e0d7){case'event':_0x8da4f['event']=_0x438766;break;case _0x5ae430(0x1fe):_0x8da4f[_0x5ae430(0x1fe)]=_0x8da4f['data']?_0x8da4f['data']+'\x0a'+_0x438766:_0x438766;break;case'id':_0x8da4f['id']=_0x438766;break;}}}}finally{_0x2490fa['releaseLock']();}}function parseSSEData(_0x3a2b14){const _0x5004f9=a81_0x4fed;try{return JSON[_0x5004f9(0x203)](_0x3a2b14);}catch(_0x2a9c74){throw new Error(_0x5004f9(0x1f7)+_0x3a2b14,{'cause':_0x2a9c74});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a82_0x3a3b(_0x1fe070,_0x1e2ffc){const _0x201e76=a82_0x201e();return a82_0x3a3b=function(_0x3a3ba1,_0x9fef5){_0x3a3ba1=_0x3a3ba1-0x99;let _0x255342=_0x201e76[_0x3a3ba1];return _0x255342;},a82_0x3a3b(_0x1fe070,_0x1e2ffc);}(function(_0x5ca52b,_0xd5e13a){const _0x2fc89f=a82_0x3a3b,_0x2ab23c=_0x5ca52b();while(!![]){try{const _0x15086d=-parseInt(_0x2fc89f(0xaa))/0x1*(-parseInt(_0x2fc89f(0xa5))/0x2)+-parseInt(_0x2fc89f(0x9e))/0x3*(parseInt(_0x2fc89f(0xb0))/0x4)+parseInt(_0x2fc89f(0xad))/0x5+parseInt(_0x2fc89f(0xae))/0x6+parseInt(_0x2fc89f(0x9f))/0x7+parseInt(_0x2fc89f(0xac))/0x8+-parseInt(_0x2fc89f(0xa6))/0x9;if(_0x15086d===_0xd5e13a)break;else _0x2ab23c['push'](_0x2ab23c['shift']());}catch(_0xacbd74){_0x2ab23c['push'](_0x2ab23c['shift']());}}}(a82_0x201e,0xd889d));import a82_0x38cae6 from'string-width';export function stringWidth(_0x12215d){return a82_0x38cae6(_0x12215d);}export function padEnd(_0x3dcae3,_0xed1859){const _0x400a29=a82_0x3a3b,_0x8faf9f=stringWidth(_0x3dcae3);if(_0x8faf9f>=_0xed1859)return _0x3dcae3;return _0x3dcae3+'\x20'[_0x400a29(0x9b)](_0xed1859-_0x8faf9f);}export function padStart(_0x5d3e97,_0x2f0334){const _0xe80910=a82_0x3a3b,_0x17fdcb=stringWidth(_0x5d3e97);if(_0x17fdcb>=_0x2f0334)return _0x5d3e97;return'\x20'[_0xe80910(0x9b)](_0x2f0334-_0x17fdcb)+_0x5d3e97;}export function centerAlign(_0x34183f,_0xe819f7){const _0x404fab=a82_0x3a3b,_0x4a0d10=stringWidth(_0x34183f);if(_0x4a0d10>_0xe819f7){if(_0xe819f7<=0x1)return'…'['substring'](0x0,_0xe819f7);let _0x165f5a=_0x34183f;while(stringWidth(_0x165f5a+'…')>_0xe819f7){_0x165f5a=_0x165f5a[_0x404fab(0xa1)](0x0,-0x1);}return _0x165f5a+'…';}if(_0x4a0d10===_0xe819f7)return _0x34183f;const _0x5d1509=_0xe819f7-_0x4a0d10,_0x2da912=Math[_0x404fab(0xaf)](_0x5d1509/0x2),_0x3f38c8=_0x5d1509-_0x2da912;return'\x20'[_0x404fab(0x9b)](_0x2da912)+_0x34183f+'\x20'[_0x404fab(0x9b)](_0x3f38c8);}export function escapeStringLiteral(_0x1c97d4){const _0x22e145=a82_0x3a3b;if(!_0x1c97d4||_0x1c97d4[_0x22e145(0xa2)]()[_0x22e145(0x9d)]===0x0)throw new Error(_0x22e145(0x9a));const _0x5b0042=_0x1c97d4[_0x22e145(0x9c)](/'/g,'\x27\x27');return'\x27'+_0x5b0042+'\x27';}export function globToLike(_0x57b40b){const _0x30010c=a82_0x3a3b;let _0xfb72ac=_0x57b40b[_0x30010c(0x9c)](/\\/g,'\x5c\x5c')[_0x30010c(0x9c)](/%/g,'\x5c%')[_0x30010c(0x9c)](/_/g,'\x5c_');return _0xfb72ac=_0xfb72ac['replace'](/\*/g,'%')[_0x30010c(0x9c)](/\?/g,'_'),_0xfb72ac;}export function buildLikePattern(_0x57c12f){const _0x1a388f=a82_0x3a3b;if(!_0x57c12f||_0x57c12f[_0x1a388f(0xa2)]()[_0x1a388f(0x9d)]===0x0)throw new Error('Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string');const _0x168383=globToLike(_0x57c12f),_0x4b059c=_0x168383[_0x1a388f(0x9c)](/'/g,'\x27\x27');return'\x27'+_0x4b059c+'\x27';}export function matchGlobPattern(_0x2f09c4,_0x1468b1){const _0x5bc1dd=a82_0x3a3b,_0x3c8e02=_0x1468b1['replace'](/[.+^${}()|[\]\\]/g,_0x5bc1dd(0xa8))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x58b96b=new RegExp('^'+_0x3c8e02+'$');return _0x58b96b['test'](_0x2f09c4);}export function getSanitizedUsername(){const _0x2c7385=a82_0x3a3b,_0x32dc5e=process[_0x2c7385(0xab)]['USER']||process[_0x2c7385(0xab)][_0x2c7385(0xa3)]||_0x2c7385(0xa7);return _0x32dc5e['replace'](/[^a-zA-Z0-9]/g,'')[_0x2c7385(0xa0)]();}function a82_0x201e(){const _0x46e2ac=['random','Cannot\x20escape\x20empty\x20string\x20literal','repeat','replace','length','201lfJrQh','7329924BXzaWX','toLowerCase','slice','trim','USERNAME','padStart','190202gjOBcP','1150974IptXJL','unknown','\x5c$&','toString','2bTZQYl','env','6649024TQQeYR','1210065MjBywh','2795094wthSvJ','floor','105164OdXAVg'];a82_0x201e=function(){return _0x46e2ac;};return a82_0x201e();}export function generateRandomHex(){const _0x4a0ebd=a82_0x3a3b,_0x561b44=Math[_0x4a0ebd(0xaf)](Math[_0x4a0ebd(0x99)]()*0xfffff);return _0x561b44[_0x4a0ebd(0xa9)](0x10)[_0x4a0ebd(0xa4)](0x5,'0');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a83_0x5294(){const _0x39f2d1=['includes','trim','14391553mJaOuF','length','6156040QWrrmU','join','catalog','Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','25PcCxih','database','Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','push','table','434498BmryTZ','278706BuieEg','Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation','Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty','112844ggpuLn','4200030QIPVMu','7969717KqHuJZ','Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)','6RkXtRv','12uVtSil','39gYhprU','Table\x20name\x20is\x20required\x20for\x20describe\x20operation','Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation','30XTTSvE'];a83_0x5294=function(){return _0x39f2d1;};return a83_0x5294();}(function(_0x35a4c2,_0xf8b652){const _0x5704b0=a83_0x1624,_0x353822=_0x35a4c2();while(!![]){try{const _0x240a4e=-parseInt(_0x5704b0(0xde))/0x1*(-parseInt(_0x5704b0(0xe6))/0x2)+parseInt(_0x5704b0(0xe8))/0x3*(-parseInt(_0x5704b0(0xe2))/0x4)+-parseInt(_0x5704b0(0xd9))/0x5*(-parseInt(_0x5704b0(0xdf))/0x6)+-parseInt(_0x5704b0(0xe4))/0x7+parseInt(_0x5704b0(0xd5))/0x8+parseInt(_0x5704b0(0xe3))/0x9*(parseInt(_0x5704b0(0xeb))/0xa)+-parseInt(_0x5704b0(0xee))/0xb*(parseInt(_0x5704b0(0xe7))/0xc);if(_0x240a4e===_0xf8b652)break;else _0x353822['push'](_0x353822['shift']());}catch(_0x3bfa3c){_0x353822['push'](_0x353822['shift']());}}}(a83_0x5294,0xd9b13));function hasWildcard(_0x3fd8ab){const _0xb8961d=a83_0x1624;return _0x3fd8ab[_0xb8961d(0xec)]('*')||_0x3fd8ab['includes']('?');}export function parseTableReference(_0xaf4b8c){const _0x3ae4f6=a83_0x1624;if(!_0xaf4b8c||_0xaf4b8c[_0x3ae4f6(0xed)]()[_0x3ae4f6(0xd4)]===0x0)throw new Error('Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only');const _0x427cf6=_0xaf4b8c[_0x3ae4f6(0xed)](),_0x4e4548={'original':_0x427cf6},_0x4ef20b=_0x427cf6['split']('.');if(_0x4ef20b[_0x3ae4f6(0xd4)]===0x1){const _0x173f6d=_0x4ef20b[0x0];if(!_0x173f6d)throw new Error('Pattern\x20cannot\x20be\x20just\x20a\x20dot');_0x4e4548['table']=_0x173f6d;}else{if(_0x4ef20b[_0x3ae4f6(0xd4)]===0x2){const [_0x265897,_0x3ad5e5]=_0x4ef20b;if(!_0x265897)throw new Error(_0x3ae4f6(0xd8));if(!_0x3ad5e5)throw new Error(_0x3ae4f6(0xe5));_0x4e4548[_0x3ae4f6(0xda)]=_0x265897,_0x4e4548[_0x3ae4f6(0xdd)]=_0x3ad5e5;}else{if(_0x4ef20b[_0x3ae4f6(0xd4)]===0x3){const [_0x4cdf13,_0x30d684,_0x3a47ca]=_0x4ef20b;if(!_0x4cdf13||!_0x30d684||!_0x3a47ca)throw new Error(_0x3ae4f6(0xe1));_0x4e4548[_0x3ae4f6(0xd7)]=_0x4cdf13,_0x4e4548[_0x3ae4f6(0xda)]=_0x30d684,_0x4e4548[_0x3ae4f6(0xdd)]=_0x3a47ca;}else throw new Error(_0x3ae4f6(0xdb));}}return _0x4e4548;}export function formatTableReference(_0x4013a7){const _0x99fd9d=a83_0x1624,_0x1f1b13=[];return _0x4013a7['catalog']&&_0x1f1b13[_0x99fd9d(0xdc)](_0x4013a7['catalog']),_0x4013a7[_0x99fd9d(0xda)]&&_0x1f1b13[_0x99fd9d(0xdc)](_0x4013a7[_0x99fd9d(0xda)]),_0x4013a7[_0x99fd9d(0xdd)]&&_0x1f1b13[_0x99fd9d(0xdc)](_0x4013a7[_0x99fd9d(0xdd)]),_0x1f1b13[_0x99fd9d(0xd6)]('.');}export function validateTableListReference(_0x51dff4){return undefined;}function a83_0x1624(_0xf35618,_0x3c9f51){const _0x529453=a83_0x5294();return a83_0x1624=function(_0x162494,_0x4d13ec){_0x162494=_0x162494-0xd4;let _0x3e37b4=_0x529453[_0x162494];return _0x3e37b4;},a83_0x1624(_0xf35618,_0x3c9f51);}export function validateTableDescribeReference(_0x350de6){const _0x337438=a83_0x1624;if(!_0x350de6['table'])return _0x337438(0xe9);if(_0x350de6[_0x337438(0xda)]&&hasWildcard(_0x350de6['database']))return _0x337438(0xea);if(hasWildcard(_0x350de6[_0x337438(0xdd)]))return _0x337438(0xe0);return undefined;}
|
package/dist/utils/tdx-logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a84_0x40811a=a84_0x5ce8;function a84_0x3a97(){const _0xe05470=['log','DEBUG','.cache','abs','getFullYear','getSeconds','message','INFO','test','150065eTILOp','tdx','80ticZBV','logDir','trace','logLevel','cause','end','1075698cZCuMP','fileOnly','padStart','10249386IindNa','toISOString','ERROR','stringify','split','22gVbepH','getDate','3YTROsu','rotateOldLogs','warn','name','getMilliseconds','204tQVRgm','logs','yellow','toString','21920YBDOgW','write','init','879209yMsTun','gray','34066dFwede','red','getHours','TRACE','debug','stack','error','.gz','string','info','4261070OiQmPi','filter','Warning:\x20Failed\x20to\x20initialize\x20log\x20files:','mtime','close','tdx.log','WARN','join','Warning:\x20Failed\x20to\x20compress\x20','logStream','.log'];a84_0x3a97=function(){return _0xe05470;};return a84_0x3a97();}(function(_0x32a49c,_0x2499db){const _0x248599=a84_0x5ce8,_0x3c3147=_0x32a49c();while(!![]){try{const _0x66535d=-parseInt(_0x248599(0xfc))/0x1+parseInt(_0x248599(0xfe))/0x2*(parseInt(_0x248599(0x12e))/0x3)+parseInt(_0x248599(0xf9))/0x4+parseInt(_0x248599(0x11c))/0x5*(parseInt(_0x248599(0xf5))/0x6)+-parseInt(_0x248599(0x127))/0x7+parseInt(_0x248599(0x11e))/0x8*(parseInt(_0x248599(0x124))/0x9)+parseInt(_0x248599(0x108))/0xa*(parseInt(_0x248599(0x12c))/0xb);if(_0x66535d===_0x2499db)break;else _0x3c3147['push'](_0x3c3147['shift']());}catch(_0x51cac1){_0x3c3147['push'](_0x3c3147['shift']());}}}(a84_0x3a97,0xb65e6));import{createWriteStream,createReadStream}from'fs';import{mkdir,readdir,unlink,stat,rename}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createGzip}from'zlib';import{pipeline}from'stream/promises';function a84_0x5ce8(_0x449ed9,_0x47ffcc){const _0x3a978b=a84_0x3a97();return a84_0x5ce8=function(_0x5ce8f0,_0x1cbfa4){_0x5ce8f0=_0x5ce8f0-0xf5;let _0x5c7ae0=_0x3a978b[_0x5ce8f0];return _0x5c7ae0;},a84_0x5ce8(_0x449ed9,_0x47ffcc);}import a84_0x4b722a from'chalk';function safeStringify(_0x4c0b8c){const _0x5d7823=a84_0x5ce8;if(typeof _0x4c0b8c===_0x5d7823(0x106))return _0x4c0b8c;if(_0x4c0b8c instanceof Error)return _0x4c0b8c[_0x5d7823(0x103)]||_0x4c0b8c['name']+':\x20'+_0x4c0b8c[_0x5d7823(0x119)];try{return JSON[_0x5d7823(0x12a)](_0x4c0b8c,(_0x13180d,_0x4b62dc)=>{const _0x29de87=_0x5d7823;if(_0x4b62dc instanceof Error)return{'name':_0x4b62dc[_0x29de87(0x131)],'message':_0x4b62dc[_0x29de87(0x119)],'stack':_0x4b62dc[_0x29de87(0x103)],'cause':_0x4b62dc[_0x29de87(0x122)]};return _0x4b62dc;});}catch{return String(_0x4c0b8c);}}function getTimezoneOffset(){const _0x1b6e44=a84_0x5ce8,_0x999a48=-new Date()['getTimezoneOffset'](),_0x4cddd9=Math['floor'](Math[_0x1b6e44(0x116)](_0x999a48)/0x3c),_0x39eb16=Math[_0x1b6e44(0x116)](_0x999a48)%0x3c,_0x2bb182=_0x999a48>=0x0?'+':'-';return''+_0x2bb182+_0x4cddd9['toString']()[_0x1b6e44(0x126)](0x2,'0')+_0x39eb16['toString']()[_0x1b6e44(0x126)](0x2,'0');}function formatTimestamp(){const _0x3f2113=a84_0x5ce8,_0x17b9c0=new Date(),_0x1eb215=_0x17b9c0[_0x3f2113(0x117)](),_0x2a000e=(_0x17b9c0['getMonth']()+0x1)['toString']()[_0x3f2113(0x126)](0x2,'0'),_0xb792d3=_0x17b9c0[_0x3f2113(0x12d)]()[_0x3f2113(0xf8)]()[_0x3f2113(0x126)](0x2,'0'),_0x169d20=_0x17b9c0[_0x3f2113(0x100)]()[_0x3f2113(0xf8)]()[_0x3f2113(0x126)](0x2,'0'),_0xfa6c6e=_0x17b9c0['getMinutes']()['toString']()[_0x3f2113(0x126)](0x2,'0'),_0x4df684=_0x17b9c0[_0x3f2113(0x118)]()[_0x3f2113(0xf8)]()[_0x3f2113(0x126)](0x2,'0'),_0x402c56=_0x17b9c0[_0x3f2113(0x132)]()[_0x3f2113(0xf8)]()[_0x3f2113(0x126)](0x3,'0'),_0x266690=getTimezoneOffset();return _0x1eb215+'-'+_0x2a000e+'-'+_0xb792d3+'\x20'+_0x169d20+':'+_0xfa6c6e+':'+_0x4df684+'.'+_0x402c56+_0x266690;}function formatColoredLogEntry(_0x29eeb1,_0x3991a2){const _0x5526b4=a84_0x5ce8,_0x4c411d=formatTimestamp(),_0x25fcf3=_0x3991a2['map'](safeStringify)[_0x5526b4(0x10f)]('\x20'),_0xd782f1=a84_0x4b722a[_0x5526b4(0xfd)](_0x4c411d);let _0x4cf35f;switch(_0x29eeb1){case'info':_0x4cf35f=a84_0x4b722a['cyan']('['+_0x29eeb1+']\x20');break;case _0x5526b4(0x130):_0x4cf35f=a84_0x4b722a[_0x5526b4(0xf7)]('['+_0x29eeb1+']\x20');break;case'error':_0x4cf35f=a84_0x4b722a[_0x5526b4(0xff)]('['+_0x29eeb1+']');break;case'debug':_0x4cf35f=a84_0x4b722a[_0x5526b4(0xfd)]('['+_0x29eeb1+']');break;default:_0x4cf35f='['+_0x29eeb1+']';}return _0xd782f1+'\x20'+_0x4cf35f+'\x20'+_0x25fcf3;}export var LogLevel;(function(_0x187dfe){const _0x54a831=a84_0x5ce8;_0x187dfe[_0x187dfe[_0x54a831(0x101)]=-0x2]='TRACE',_0x187dfe[_0x187dfe['DEBUG']=-0x1]=_0x54a831(0x114),_0x187dfe[_0x187dfe['INFO']=0x0]=_0x54a831(0x11a),_0x187dfe[_0x187dfe[_0x54a831(0x10e)]=0x1]=_0x54a831(0x10e),_0x187dfe[_0x187dfe[_0x54a831(0x129)]=0x2]=_0x54a831(0x129);}(LogLevel||(LogLevel={})));export class TDXLogger{[a84_0x40811a(0x111)];[a84_0x40811a(0x11f)];['logLevel'];[a84_0x40811a(0x125)];constructor(_0x4fb5e1=LogLevel['INFO'],_0x23087e=![]){const _0x5d5c2c=a84_0x40811a;this[_0x5d5c2c(0x11f)]=join(homedir(),_0x5d5c2c(0x115),_0x5d5c2c(0x11d),_0x5d5c2c(0xf6)),this['logLevel']=_0x4fb5e1,this[_0x5d5c2c(0x125)]=_0x23087e;}async[a84_0x40811a(0xfb)](){const _0x240e71=a84_0x40811a;try{await mkdir(this['logDir'],{'recursive':!![]}),await this[_0x240e71(0x12f)]();const _0x4c9a20=join(this['logDir'],_0x240e71(0x10d));this['logStream']=createWriteStream(_0x4c9a20,{'flags':'a'}),this[_0x240e71(0x111)]['on'](_0x240e71(0x104),_0x275895=>{const _0x4762d2=_0x240e71;console[_0x4762d2(0x104)]('Warning:\x20Error\x20writing\x20to\x20tdx.log:',_0x275895[_0x4762d2(0x119)]);});}catch(_0x5a01e9){console['error'](_0x240e71(0x10a),_0x5a01e9);}}async[a84_0x40811a(0x12f)](){const _0x1a8f8f=a84_0x40811a;try{const _0x17a748=await readdir(this[_0x1a8f8f(0x11f)]),_0x4b6198=new Date()[_0x1a8f8f(0x128)]()[_0x1a8f8f(0x12b)]('T')[0x0];if(_0x17a748['includes'](_0x1a8f8f(0x10d))){const _0x77b7af=join(this['logDir'],'tdx.log'),_0x5b044a=await stat(_0x77b7af),_0x1d0576=new Date(_0x5b044a[_0x1a8f8f(0x10b)])[_0x1a8f8f(0x128)]()[_0x1a8f8f(0x12b)]('T')[0x0];if(_0x1d0576<_0x4b6198){const _0x4ce5ee=join(this[_0x1a8f8f(0x11f)],'tdx-'+_0x1d0576+_0x1a8f8f(0x112));await rename(_0x77b7af,_0x4ce5ee);}}const _0x33b3b8=await readdir(this[_0x1a8f8f(0x11f)]),_0x43e39c=/^tdx-(\d{4}-\d{2}-\d{2})\.log$/,_0x315231=_0x33b3b8[_0x1a8f8f(0x109)](_0x1b1f02=>_0x43e39c[_0x1a8f8f(0x11b)](_0x1b1f02));for(const _0x23836c of _0x315231){const _0x4a4b9a=join(this[_0x1a8f8f(0x11f)],_0x23836c),_0x2458e0=join(this[_0x1a8f8f(0x11f)],_0x23836c+_0x1a8f8f(0x105));try{await pipeline(createReadStream(_0x4a4b9a),createGzip(),createWriteStream(_0x2458e0)),await unlink(_0x4a4b9a);}catch(_0x7e6fe1){console['error'](_0x1a8f8f(0x110)+_0x23836c+':',_0x7e6fe1);}}}catch{}}['debug'](..._0x162774){const _0x57345b=a84_0x40811a;if(this[_0x57345b(0x121)]>LogLevel[_0x57345b(0x114)])return;const _0x156ef5=formatColoredLogEntry(_0x57345b(0x102),_0x162774);this[_0x57345b(0x111)]?.[_0x57345b(0xfa)](_0x156ef5+'\x0a');}[a84_0x40811a(0x120)](..._0x165b2f){const _0x24fd41=a84_0x40811a;if(this[_0x24fd41(0x121)]>LogLevel[_0x24fd41(0x101)])return;const _0x483090=formatColoredLogEntry(_0x24fd41(0x120),_0x165b2f);this['logStream']?.['write'](_0x483090+'\x0a');}[a84_0x40811a(0x107)](..._0x1dbbac){const _0x4af285=a84_0x40811a;if(this[_0x4af285(0x121)]>LogLevel['INFO'])return;const _0x22e918=formatColoredLogEntry(_0x4af285(0x107),_0x1dbbac);!this['fileOnly']&&console[_0x4af285(0x113)](_0x22e918),this[_0x4af285(0x111)]?.[_0x4af285(0xfa)](_0x22e918+'\x0a');}['warn'](..._0x2d2145){const _0x38008a=a84_0x40811a;if(this['logLevel']>LogLevel[_0x38008a(0x10e)])return;const _0x104950=formatColoredLogEntry('warn',_0x2d2145);!this[_0x38008a(0x125)]&&console[_0x38008a(0x104)](_0x104950),this[_0x38008a(0x111)]?.[_0x38008a(0xfa)](_0x104950+'\x0a');}[a84_0x40811a(0x104)](..._0x30b2a3){const _0x275457=a84_0x40811a,_0x4721c9=formatColoredLogEntry('error',_0x30b2a3);!this[_0x275457(0x125)]&&console[_0x275457(0x104)](_0x4721c9),this[_0x275457(0x111)]?.[_0x275457(0xfa)](_0x4721c9+'\x0a');}async[a84_0x40811a(0x10c)](){return this['info']('Proxy\x20session\x20ended'),new Promise(_0x169cef=>{const _0x347b94=a84_0x5ce8;this[_0x347b94(0x111)]?this['logStream'][_0x347b94(0x123)](()=>{_0x169cef();}):_0x169cef();});}['getLogPath'](){return join(this['logDir'],'tdx.log');}}
|