@treasuredata/tdx 0.1.9 → 0.1.10
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/README.md +68 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-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/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +20 -0
- package/dist/commands/claude-command.d.ts.map +1 -0
- package/dist/commands/claude-command.js +1 -0
- package/dist/commands/claude-command.js.map +1 -0
- package/dist/commands/command.js +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/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-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.js +1 -1
- package/dist/core/global-context.js +1 -1
- 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/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.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/table.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.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/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.d.ts +18 -0
- package/dist/utils/port.d.ts.map +1 -0
- package/dist/utils/port.js +1 -0
- package/dist/utils/port.js.map +1 -0
- package/dist/utils/process.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/workflow-utils.js +1 -1
- package/package.json +1 -1
package/dist/utils/chat-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e7f64,_0x5c7f22){const _0x2b0bb4=a50_0x53ea,_0x28de19=_0x4e7f64();while(!![]){try{const _0x581717=-parseInt(_0x2b0bb4(0xaf))/0x1*(-parseInt(_0x2b0bb4(0xa7))/0x2)+-parseInt(_0x2b0bb4(0xa9))/0x3+-parseInt(_0x2b0bb4(0xae))/0x4+parseInt(_0x2b0bb4(0xab))/0x5*(parseInt(_0x2b0bb4(0xa5))/0x6)+-parseInt(_0x2b0bb4(0xb2))/0x7*(parseInt(_0x2b0bb4(0xac))/0x8)+-parseInt(_0x2b0bb4(0xb0))/0x9+-parseInt(_0x2b0bb4(0xa8))/0xa*(-parseInt(_0x2b0bb4(0xaa))/0xb);if(_0x581717===_0x5c7f22)break;else _0x28de19['push'](_0x28de19['shift']());}catch(_0x113ad7){_0x28de19['push'](_0x28de19['shift']());}}}(a50_0x6a1d,0x4b41f));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function a50_0x53ea(_0x276f2c,_0x4afa21){const _0x6a1dd0=a50_0x6a1d();return a50_0x53ea=function(_0x53ead6,_0x55e0fc){_0x53ead6=_0x53ead6-0xa2;let _0xc18d37=_0x6a1dd0[_0x53ead6];return _0xc18d37;},a50_0x53ea(_0x276f2c,_0x4afa21);}function getCacheDir(){const _0x58226b=a50_0x53ea;return join(process[_0x58226b(0xad)](),_0x58226b(0xb1),_0x58226b(0xa4));}function getLastChatIdPath(){const _0x43136b=a50_0x53ea;return join(getCacheDir(),_0x43136b(0xa6));}function ensureCacheDir(){const _0x54a6d4=getCacheDir();!existsSync(_0x54a6d4)&&mkdirSync(_0x54a6d4,{'recursive':!![]});}export function saveLastChatId(_0x5a161c){const _0x96ad75=a50_0x53ea;ensureCacheDir();const _0x370793=getLastChatIdPath();writeFileSync(_0x370793,_0x5a161c,_0x96ad75(0xa3));}export function loadLastChatId(){const _0x5b01fe=a50_0x53ea,_0x5af807=getLastChatIdPath();if(!existsSync(_0x5af807))return undefined;try{const _0xf1a841=readFileSync(_0x5af807,_0x5b01fe(0xa3))[_0x5b01fe(0xa2)]();return _0xf1a841||undefined;}catch{return undefined;}}export function clearLastChatId(){const _0x1b75f1=a50_0x53ea,_0x1e8eea=getLastChatIdPath();if(existsSync(_0x1e8eea))try{writeFileSync(_0x1e8eea,'',_0x1b75f1(0xa3));}catch{}}function a50_0x6a1d(){const _0x4e99ba=['524989ldaLtQ','4836753iursnP','.cache','735EdjbRw','trim','utf-8','tdx','138ymlzsz','last_chat_id','2Eeeszu','112820HiMATb','78051cyTBoz','583FvboYV','100595bRoyts','44152HpXPzf','cwd','537952MunZsb'];a50_0x6a1d=function(){return _0x4e99ba;};return a50_0x6a1d();}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x26730f,_0x4adea2){const _0x16e097=a51_0x513f,_0x32c6dc=_0x26730f();while(!![]){try{const _0x3c9e6c=parseInt(_0x16e097(0x1be))/0x1+parseInt(_0x16e097(0x1ad))/0x2*(parseInt(_0x16e097(0x1af))/0x3)+parseInt(_0x16e097(0x1c0))/0x4*(-parseInt(_0x16e097(0x1ab))/0x5)+parseInt(_0x16e097(0x1b6))/0x6+parseInt(_0x16e097(0x1c4))/0x7*(parseInt(_0x16e097(0x1a7))/0x8)+-parseInt(_0x16e097(0x1bc))/0x9+parseInt(_0x16e097(0x1a5))/0xa;if(_0x3c9e6c===_0x4adea2)break;else _0x32c6dc['push'](_0x32c6dc['shift']());}catch(_0x17e26f){_0x32c6dc['push'](_0x32c6dc['shift']());}}}(a51_0x2174,0xb061d));import{Chalk}from'chalk';export function shouldUseColor(_0xda6781={}){const _0x4bf3cc=a51_0x513f;if(_0xda6781[_0x4bf3cc(0x1b3)]===!![])return![];if(_0xda6781[_0x4bf3cc(0x1b2)]===!![])return!![];if(process[_0x4bf3cc(0x1b4)]['NO_COLOR']!==undefined)return![];return process[_0x4bf3cc(0x1ac)][_0x4bf3cc(0x1b9)]??![];}function a51_0x2174(){const _0x3113ee=['41196QyvXVZ','yellow','boolean','entries','7RpXupQ','3526500DFmFJR','blue','5383984HAbnUf','length','dim','object','605IXicFr','stdout','4ErrDDQ','green','543570EBROip','null','isArray','color','noColor','env','repeat','6520566pqxRbL','map','join','isTTY','number','cyan','11349387XNrfwi','string','754894YZFeFe','stringify'];a51_0x2174=function(){return _0x3113ee;};return a51_0x2174();}function getChalk(_0x509a71={}){if(shouldUseColor(_0x509a71))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0x55da2b,_0x1dddf7={}){return getChalk(_0x1dddf7)['dim'](_0x55da2b);}export function colorHeader(_0x334ed9,_0x27bca6={}){const _0x37c561=a51_0x513f;return getChalk(_0x27bca6)[_0x37c561(0x1bb)](_0x334ed9);}function a51_0x513f(_0x19d5d5,_0x27ad04){const _0x217455=a51_0x2174();return a51_0x513f=function(_0x513ff1,_0x2d7b83){_0x513ff1=_0x513ff1-0x1a5;let _0x10d240=_0x217455[_0x513ff1];return _0x10d240;},a51_0x513f(_0x19d5d5,_0x27ad04);}export function colorType(_0x112c46,_0x395ac3={}){return getChalk(_0x395ac3)['dim'](_0x112c46);}export function colorJSONKey(_0x165acd,_0x431cca={}){const _0x248306=a51_0x513f;return getChalk(_0x431cca)[_0x248306(0x1a6)](_0x165acd);}export function colorJSONString(_0x422193,_0xb8ce14={}){const _0x5efb71=a51_0x513f;return getChalk(_0xb8ce14)[_0x5efb71(0x1ae)](_0x422193);}export function colorJSONNumber(_0x11ea95,_0x42cafa={}){return getChalk(_0x42cafa)['cyan'](_0x11ea95);}export function colorJSONBoolean(_0x57419a,_0x220ea3={}){const _0xab568b=a51_0x513f;return getChalk(_0x220ea3)[_0xab568b(0x1c1)](_0x57419a);}export function colorJSONNull(_0x502d60,_0x3d3cee={}){const _0x1af172=a51_0x513f;return getChalk(_0x3d3cee)[_0x1af172(0x1a9)](_0x502d60);}export function colorizeJSONCompact(_0x48b2cb,_0x1768fc={}){const _0x55d02b=a51_0x513f;if(!shouldUseColor(_0x1768fc))return JSON[_0x55d02b(0x1bf)](_0x48b2cb);if(_0x48b2cb===null)return colorJSONNull(_0x55d02b(0x1b0),_0x1768fc);if(typeof _0x48b2cb===_0x55d02b(0x1c2))return colorJSONBoolean(String(_0x48b2cb),_0x1768fc);if(typeof _0x48b2cb===_0x55d02b(0x1ba))return colorJSONNumber(String(_0x48b2cb),_0x1768fc);if(typeof _0x48b2cb==='string')return colorJSONString(JSON[_0x55d02b(0x1bf)](_0x48b2cb),_0x1768fc);if(Array[_0x55d02b(0x1b1)](_0x48b2cb)){if(_0x48b2cb[_0x55d02b(0x1a8)]===0x0)return'[]';const _0x3f90b2=_0x48b2cb[_0x55d02b(0x1b7)](_0x413bd7=>colorizeJSONCompact(_0x413bd7,_0x1768fc));return'['+_0x3f90b2[_0x55d02b(0x1b8)](',')+']';}if(typeof _0x48b2cb===_0x55d02b(0x1aa)){const _0x4befb5=Object[_0x55d02b(0x1c3)](_0x48b2cb);if(_0x4befb5['length']===0x0)return'{}';const _0x3c769c=_0x4befb5[_0x55d02b(0x1b7)](([_0x15f537,_0x44a30f])=>{const _0x462cab=_0x55d02b,_0x19b8f4=colorJSONKey(JSON[_0x462cab(0x1bf)](_0x15f537),_0x1768fc),_0x40d56b=colorizeJSONCompact(_0x44a30f,_0x1768fc);return _0x19b8f4+':'+_0x40d56b;});return'{'+_0x3c769c[_0x55d02b(0x1b8)](',')+'}';}return String(_0x48b2cb);}export function colorizeJSON(_0x1b6414,_0xb5ecc3={},_0x219bf0=0x0){const _0x2565e7=a51_0x513f;if(!shouldUseColor(_0xb5ecc3))return JSON['stringify'](_0x1b6414,null,0x2);const _0x2ac276='\x20'[_0x2565e7(0x1b5)](_0x219bf0),_0x2d0083=_0x219bf0+0x2;if(_0x1b6414===null)return colorJSONNull(_0x2565e7(0x1b0),_0xb5ecc3);if(typeof _0x1b6414===_0x2565e7(0x1c2))return colorJSONBoolean(String(_0x1b6414),_0xb5ecc3);if(typeof _0x1b6414===_0x2565e7(0x1ba))return colorJSONNumber(String(_0x1b6414),_0xb5ecc3);if(typeof _0x1b6414===_0x2565e7(0x1bd))return colorJSONString(JSON[_0x2565e7(0x1bf)](_0x1b6414),_0xb5ecc3);if(Array[_0x2565e7(0x1b1)](_0x1b6414)){if(_0x1b6414[_0x2565e7(0x1a8)]===0x0)return'[]';const _0x4fb1cd=_0x1b6414[_0x2565e7(0x1b7)](_0x28805b=>{const _0x402a45=_0x2565e7,_0x2d7f35=colorizeJSON(_0x28805b,_0xb5ecc3,_0x2d0083);return''+'\x20'[_0x402a45(0x1b5)](_0x2d0083)+_0x2d7f35;});return'[\x0a'+_0x4fb1cd[_0x2565e7(0x1b8)](',\x0a')+('\x0a'+_0x2ac276+']');}if(typeof _0x1b6414==='object'){const _0x269560=Object[_0x2565e7(0x1c3)](_0x1b6414);if(_0x269560[_0x2565e7(0x1a8)]===0x0)return'{}';const _0x25519c=_0x269560['map'](([_0x45f1dd,_0x28eabf])=>{const _0x1682fe=_0x2565e7,_0x4ea982=colorJSONKey(JSON[_0x1682fe(0x1bf)](_0x45f1dd),_0xb5ecc3),_0x232bf3=colorizeJSON(_0x28eabf,_0xb5ecc3,_0x2d0083);return''+'\x20'[_0x1682fe(0x1b5)](_0x2d0083)+_0x4ea982+':\x20'+_0x232bf3;});return'{\x0a'+_0x25519c[_0x2565e7(0x1b8)](',\x0a')+('\x0a'+_0x2ac276+'}');}return String(_0x1b6414);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xe21fc8,_0x8c71b4){const _0x586d41=a52_0x13cb,_0x5662be=_0xe21fc8();while(!![]){try{const _0x156924=-parseInt(_0x586d41(0x8a))/0x1+parseInt(_0x586d41(0x6a))/0x2*(parseInt(_0x586d41(0x6b))/0x3)+parseInt(_0x586d41(0x7f))/0x4+-parseInt(_0x586d41(0x73))/0x5*(-parseInt(_0x586d41(0x69))/0x6)+parseInt(_0x586d41(0x6f))/0x7*(-parseInt(_0x586d41(0x77))/0x8)+parseInt(_0x586d41(0x7b))/0x9+parseInt(_0x586d41(0x7a))/0xa*(parseInt(_0x586d41(0x88))/0xb);if(_0x156924===_0x8c71b4)break;else _0x5662be['push'](_0x5662be['shift']());}catch(_0x2c5ac6){_0x5662be['push'](_0x5662be['shift']());}}}(a52_0x8361,0x36524));import{writeFileSync}from'fs';function a52_0x13cb(_0x555cc6,_0x1b4257){const _0x836143=a52_0x8361();return a52_0x13cb=function(_0x13cbbf,_0x4ee391){_0x13cbbf=_0x13cbbf-0x69;let _0x10fcfc=_0x836143[_0x13cbbf];return _0x10fcfc;},a52_0x13cb(_0x555cc6,_0x1b4257);}import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';export function parseOutputOptions(_0x366bfd){const _0x2b1da4=a52_0x13cb;return{'format':_0x366bfd[_0x2b1da4(0x80)]||_0x2b1da4(0x81),'output':_0x366bfd[_0x2b1da4(0x83)]||'','limit':_0x366bfd['limit'],'color':_0x366bfd[_0x2b1da4(0x76)],'noColor':_0x366bfd['noColor']};}function convertSDKResultToQueryResult(_0x45edf2){const _0x1a256f=a52_0x13cb,_0x3a9cbb=[];if(_0x45edf2['length']>0x0){const _0x194c6d=_0x45edf2[0x0];for(const [_0x41b9d2,_0x53b32a]of Object[_0x1a256f(0x86)](_0x194c6d)){let _0x21f163=_0x1a256f(0x84);if(typeof _0x53b32a===_0x1a256f(0x8d))_0x21f163=Number[_0x1a256f(0x6e)](_0x53b32a)?_0x1a256f(0x6d):'double';else{if(typeof _0x53b32a==='boolean')_0x21f163=_0x1a256f(0x75);else _0x53b32a===null&&(_0x21f163=_0x1a256f(0x84));}_0x3a9cbb['push']({'name':_0x41b9d2,'type':_0x21f163});}}return{'queryId':_0x1a256f(0x74),'columns':_0x3a9cbb,'data':_0x45edf2,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x45edf2[_0x1a256f(0x71)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x61d580,_0x314544){const _0x598dac=convertSDKResultToQueryResult(_0x61d580);return formatQueryOutput(_0x598dac,_0x314544);}export async function formatQueryOutput(_0x4edb51,_0x516272){const _0x2857cf=a52_0x13cb,{format:_0x2c07b4,limit:_0x550263,output:_0x5c53af,color:_0x349b6a,noColor:_0x436e68}=_0x516272,_0x21d641=Boolean(_0x5c53af)&&!_0x349b6a,_0x1191b1={'color':_0x349b6a,'noColor':_0x436e68||_0x21d641};if(_0x2c07b4===_0x2857cf(0x81)){const {formatAsTable:_0x59affd}=await import(_0x2857cf(0x7c)),_0x525f36=shouldUseLess(_0x2c07b4,_0x5c53af);return _0x59affd(_0x4edb51,_0x550263,_0x525f36,_0x1191b1);}else{if(_0x2c07b4===_0x2857cf(0x7d)){const {formatAsJSON:_0x1e5aff}=await import(_0x2857cf(0x7c));return _0x1e5aff(_0x4edb51,_0x1191b1);}else{if(_0x2c07b4===_0x2857cf(0x79)){const {formatAsJSONL:_0x1ed22e}=await import(_0x2857cf(0x7c));return _0x1ed22e(_0x4edb51,_0x1191b1);}else{const {formatQueryResult:_0x121326}=await import(_0x2857cf(0x7c));return _0x121326(_0x4edb51,_0x2c07b4);}}}}function shouldUseLess(_0x44a7f0,_0x576b92){const _0x492276=a52_0x13cb;return _0x44a7f0==='table'&&process['stdout'][_0x492276(0x87)]&&!_0x576b92;}function a52_0x8361(){const _0x267b4b=['sdk-result','boolean','color','3448VIjjVQ','stdin','jsonl','910EYfQyL','1905921XCSczx','./formatters.js','json','resolve','129688keLPhV','format','table','error','output','varchar','log','entries','isTTY','8657QljGBs','write','163207cETpuM','inherit','limit','number','pipe','146238JqfVqT','140540LshaXQ','6BUfClj','noColor','bigint','isInteger','1939MImKaR','close','length','Results\x20saved\x20to\x20','10YkPmNm'];a52_0x8361=function(){return _0x267b4b;};return a52_0x8361();}export function resolveOutputOptions(_0xa9a26){const _0x506f76=a52_0x13cb,_0x3b7e9c=resolveOutputFormat(_0xa9a26[_0x506f76(0x80)],_0xa9a26['output'],_0x506f76(0x81));let _0x74c7f9=typeof _0xa9a26[_0x506f76(0x8c)]==='number'?_0xa9a26[_0x506f76(0x8c)]:parseInt(_0xa9a26[_0x506f76(0x8c)]||'40',0xa);const _0x45ba29=_0xa9a26[_0x506f76(0x83)]||'';return shouldUseLess(_0x3b7e9c,_0x45ba29)&&(_0x74c7f9=Infinity),{'format':_0x3b7e9c,'output':_0x45ba29,'limit':_0x74c7f9,'color':_0xa9a26[_0x506f76(0x76)],'noColor':_0xa9a26[_0x506f76(0x6c)]};}export function writeOutput(_0xee09b,_0x44801c,_0x1ca26f){const _0x30f4b2=a52_0x13cb;return _0x44801c?(writeFileSync(_0x44801c,_0xee09b),console[_0x30f4b2(0x82)](_0x30f4b2(0x72)+_0x44801c),Promise[_0x30f4b2(0x7e)]()):shouldUseLess(_0x1ca26f||'','')?new Promise(_0x30a712=>{const _0xd0a4c0=_0x30f4b2,_0x26388c=spawn('less',['-FXRSn'],{'stdio':[_0xd0a4c0(0x8e),_0xd0a4c0(0x8b),'inherit']});let _0x201123=![];_0x26388c['on'](_0xd0a4c0(0x82),()=>{const _0x28e481=_0xd0a4c0;!_0x201123&&(_0x201123=!![],console[_0x28e481(0x85)](_0xee09b),_0x30a712());}),_0x26388c['on'](_0xd0a4c0(0x70),()=>{!_0x201123&&(_0x201123=!![],_0x30a712());}),_0x26388c['on']('spawn',()=>{const _0x433260=_0xd0a4c0;!_0x201123&&_0x26388c[_0x433260(0x78)]&&(_0x26388c[_0x433260(0x78)]['on'](_0x433260(0x82),()=>{}),_0x26388c[_0x433260(0x78)][_0x433260(0x89)](_0xee09b),_0x26388c[_0x433260(0x78)]['end']());}),!_0x26388c[_0xd0a4c0(0x78)]&&(!_0x201123&&(_0x201123=!![],console[_0xd0a4c0(0x85)](_0xee09b),_0x30a712()));}):(console[_0x30f4b2(0x85)](_0xee09b),Promise['resolve']());}export async function handleSDKOutput(_0x1648c0,_0x26457b){const _0x38c286=resolveOutputOptions(_0x26457b),_0x536b2b=await formatSDKOutput(_0x1648c0,_0x38c286);await writeOutput(_0x536b2b,_0x38c286['output']||undefined,_0x38c286['format']);}export async function handleQueryOutput(_0x920040,_0x424705){const _0x246653=a52_0x13cb,_0x21d21e=resolveOutputOptions(_0x424705),_0x1d146c=await formatQueryOutput(_0x920040,_0x21d21e);await writeOutput(_0x1d146c,_0x21d21e[_0x246653(0x83)]||undefined,_0x21d21e[_0x246653(0x80)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e42cc,_0x45910f){const _0x18389d=a53_0x20e0,_0x31a55a=_0x1e42cc();while(!![]){try{const _0x20c0fb=-parseInt(_0x18389d(0xe2))/0x1+-parseInt(_0x18389d(0xdb))/0x2*(-parseInt(_0x18389d(0xdd))/0x3)+-parseInt(_0x18389d(0xdf))/0x4*(-parseInt(_0x18389d(0xde))/0x5)+-parseInt(_0x18389d(0xe6))/0x6+parseInt(_0x18389d(0xe9))/0x7*(-parseInt(_0x18389d(0xda))/0x8)+-parseInt(_0x18389d(0xe4))/0x9+parseInt(_0x18389d(0xe3))/0xa*(parseInt(_0x18389d(0xd8))/0xb);if(_0x20c0fb===_0x45910f)break;else _0x31a55a['push'](_0x31a55a['shift']());}catch(_0x46bdc3){_0x31a55a['push'](_0x31a55a['shift']());}}}(a53_0x5165,0xebe03));import*as a53_0x395f9d from'node:fs';import*as a53_0x3b3ec8 from'node:path';function a53_0x20e0(_0x21eefc,_0xadd3e0){const _0x5165b3=a53_0x5165();return a53_0x20e0=function(_0x20e0eb,_0x523032){_0x20e0eb=_0x20e0eb-0xd8;let _0x140710=_0x5165b3[_0x20e0eb];return _0x140710;},a53_0x20e0(_0x21eefc,_0xadd3e0);}export function setSecureFilePermissions(_0x37d36d){const _0x189def=a53_0x20e0;try{a53_0x395f9d[_0x189def(0xea)](_0x37d36d,0x180);}catch{console[_0x189def(0xef)]('Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20'+_0x37d36d);}}function a53_0x5165(){const _0x3a72e1=['mkdirSync','mode','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','toString','warn','11LxiFvt','existsSync','125992ukHDPN','20oYyGKM','writeFileSync','429153parEth','12300dyUfOz','1044XUoYPx',').\x20','\x20has\x20insecure\x20permissions\x20(','938583LjKHtU','35607610cRNbQH','15305283heNJoL','Warning:\x20','8860794rBcFRe','Should\x20be\x200600\x20or\x20more\x20restrictive.','statSync','245LgFRfE','chmodSync'];a53_0x5165=function(){return _0x3a72e1;};return a53_0x5165();}export function setSecureDirectoryPermissions(_0x5ac832){const _0x5b0b2b=a53_0x20e0;try{a53_0x395f9d['chmodSync'](_0x5ac832,0x1c0);}catch{console[_0x5b0b2b(0xef)](_0x5b0b2b(0xed)+_0x5ac832);}}export function createSecureDirectory(_0xb27aa7){const _0xdfd899=a53_0x20e0;!a53_0x395f9d[_0xdfd899(0xd9)](_0xb27aa7)&&(a53_0x395f9d[_0xdfd899(0xeb)](_0xb27aa7,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0xb27aa7));}export function validateSecureFilePermissions(_0x49268d){const _0x3775b2=a53_0x20e0;try{const _0x3a24f9=a53_0x395f9d[_0x3775b2(0xe8)](_0x49268d),_0x54047d=_0x3a24f9[_0x3775b2(0xec)]&0x1ff,_0x4cd5a1=(_0x54047d&0x3f)!==0x0;if(_0x4cd5a1)return console[_0x3775b2(0xef)](_0x3775b2(0xe5)+_0x49268d+_0x3775b2(0xe1)+_0x54047d[_0x3775b2(0xee)](0x8)+_0x3775b2(0xe0)+_0x3775b2(0xe7)),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x118c64,_0x3dcfbe){const _0x1c0bf6=a53_0x20e0,_0x594f22=a53_0x3b3ec8['dirname'](_0x118c64);createSecureDirectory(_0x594f22),a53_0x395f9d[_0x1c0bf6(0xdc)](_0x118c64,_0x3dcfbe,{'mode':0x180}),setSecureFilePermissions(_0x118c64);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e4bf2,_0x1c77b7){const _0x3997be=a54_0x29ef,_0xa2ee5f=_0x4e4bf2();while(!![]){try{const _0x4e88de=parseInt(_0x3997be(0x1d0))/0x1+-parseInt(_0x3997be(0x1de))/0x2+parseInt(_0x3997be(0x1dc))/0x3+parseInt(_0x3997be(0x1e0))/0x4*(parseInt(_0x3997be(0x1d4))/0x5)+parseInt(_0x3997be(0x1cf))/0x6+-parseInt(_0x3997be(0x1d1))/0x7*(-parseInt(_0x3997be(0x1d3))/0x8)+-parseInt(_0x3997be(0x1dd))/0x9;if(_0x4e88de===_0x1c77b7)break;else _0xa2ee5f['push'](_0xa2ee5f['shift']());}catch(_0xc6468e){_0xa2ee5f['push'](_0xa2ee5f['shift']());}}}(a54_0x1a04,0x5b860));function a54_0x1a04(){const _0x3c8d41=['tsv','40dyLDnF','20eGhZCr','table','pop','toLowerCase','split','text','jsonl','txt','2151921fuxiad','16390269xgPcoY','86654AypBjA','json','284296KIJjdI','1368930gkxZfK','737885VMObdL','380387aYMEiD'];a54_0x1a04=function(){return _0x3c8d41;};return a54_0x1a04();}function a54_0x29ef(_0x123332,_0x1778e0){const _0x1a0467=a54_0x1a04();return a54_0x29ef=function(_0x29efd4,_0x580a07){_0x29efd4=_0x29efd4-0x1cf;let _0x4a8d91=_0x1a0467[_0x29efd4];return _0x4a8d91;},a54_0x29ef(_0x123332,_0x1778e0);}export function detectFormatFromExtension(_0x18cfe7){const _0x57c592=a54_0x29ef,_0x101952=_0x18cfe7[_0x57c592(0x1d7)]()[_0x57c592(0x1d8)]('.')[_0x57c592(0x1d6)]();switch(_0x101952){case _0x57c592(0x1df):return _0x57c592(0x1df);case _0x57c592(0x1da):return _0x57c592(0x1da);case _0x57c592(0x1d2):case'tab':return'tsv';case _0x57c592(0x1db):case _0x57c592(0x1d9):return _0x57c592(0x1d5);default:return undefined;}}export function resolveOutputFormat(_0xc8f8a7,_0x4e06bd,_0x473ba3){if(_0xc8f8a7)return _0xc8f8a7;if(_0x4e06bd){const _0x52ce2d=detectFormatFromExtension(_0x4e06bd);if(_0x52ce2d)return _0x52ce2d;}return _0x473ba3;}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7df93d,_0x1af07f){const _0x5bf42b=a55_0x5ee5,_0x1d5891=_0x7df93d();while(!![]){try{const _0x424862=-parseInt(_0x5bf42b(0x1ac))/0x1+-parseInt(_0x5bf42b(0x1b1))/0x2+-parseInt(_0x5bf42b(0x1dd))/0x3+parseInt(_0x5bf42b(0x1ba))/0x4+-parseInt(_0x5bf42b(0x1de))/0x5*(parseInt(_0x5bf42b(0x1b3))/0x6)+parseInt(_0x5bf42b(0x1c3))/0x7*(parseInt(_0x5bf42b(0x1c0))/0x8)+parseInt(_0x5bf42b(0x1ce))/0x9*(parseInt(_0x5bf42b(0x1c5))/0xa);if(_0x424862===_0x1af07f)break;else _0x1d5891['push'](_0x1d5891['shift']());}catch(_0x5e4411){_0x1d5891['push'](_0x1d5891['shift']());}}}(a55_0x33ee,0x44440));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 _0x52001f=a55_0x5ee5;return process[_0x52001f(0x1d7)][_0x52001f(0x1cd)]||Infinity;}export function formatAsTable(_0x18b017,_0x342afa=DEFAULT_MAX_DISPLAY_ROWS,_0x132c66=![],_0xca2e1d={}){const _0x19f733=a55_0x5ee5;if(_0x18b017[_0x19f733(0x1ad)][_0x19f733(0x1d8)]===0x0)return _0x19f733(0x1c4);const _0x554adf=_0x18b017['columns'][_0x19f733(0x1b8)](_0x2bfb15=>_0x2bfb15['name']),_0xdee0c4=_0x18b017[_0x19f733(0x1cd)][_0x19f733(0x1b8)](_0x580dff=>simplifyType(_0x580dff[_0x19f733(0x1dc)])),_0x78d383=_0x18b017[_0x19f733(0x1ad)][_0x19f733(0x1d0)](0x0,_0x342afa),_0x72cf0a=_0x18b017[_0x19f733(0x1ad)]['length'],_0x3a740a=_0x72cf0a>_0x342afa,_0x14b284=[],_0x37ab35=getTerminalWidth(),_0x3dbfc9=_0x37ab35!==Infinity,_0x3b5184=0x32;let _0x1933d3=_0x554adf['map']((_0x3499e4,_0x3dc90f)=>{const _0x50dc66=_0x19f733,_0xda4010=stringWidth(_0xdee0c4[_0x3dc90f]),_0x5b40bd=Math[_0x50dc66(0x1d1)](..._0x78d383['map'](_0x27d981=>{const _0x4e5ae1=_0x27d981[_0x3499e4];return stringWidth(formatValue(_0x4e5ae1));})),_0x3df918=Math['max'](stringWidth(_0x3499e4),_0xda4010,_0x5b40bd);return _0x132c66?_0x3df918:Math['min'](_0x3df918,_0x3b5184);});if(_0x3dbfc9&&!_0x132c66&&_0x554adf[_0x19f733(0x1d8)]>0x0){const _0x409440=_0x203e73=>{let _0x5d546a=0x1;for(const _0x2460a2 of _0x203e73){_0x5d546a+=_0x2460a2+0x3;}return _0x5d546a+0x1;};let _0x446d0b=_0x409440(_0x1933d3);if(_0x446d0b>_0x37ab35){const _0x2d9e6b=0x3;for(let _0x1446a8=_0x1933d3[_0x19f733(0x1d8)]-0x1;_0x1446a8>=0x0;_0x1446a8--){_0x446d0b=_0x409440(_0x1933d3);if(_0x446d0b<=_0x37ab35)break;const _0x32a3f6=_0x1933d3[_0x1446a8],_0x5b2ee2=_0x446d0b-_0x37ab35,_0x1d8df6=_0x32a3f6-_0x2d9e6b,_0x4dc8f4=Math[_0x19f733(0x1ae)](_0x5b2ee2,_0x1d8df6);_0x4dc8f4>0x0&&(_0x1933d3[_0x1446a8]=_0x32a3f6-_0x4dc8f4);}}}const _0x3fe685=_0x554adf,_0x3f75fa=_0xdee0c4,_0x2e136c=_0x1933d3,_0x39fc54=_0x1933d3;_0x14b284[_0x19f733(0x1bd)](colorBorder('┌'+_0x39fc54[_0x19f733(0x1b8)](_0x322707=>'─'[_0x19f733(0x1bb)](_0x322707+0x2))[_0x19f733(0x1ca)]('┬')+'┐',_0xca2e1d));const _0x5c62d7=_0x3fe685['map']((_0x1f4b24,_0x1b1ee3)=>centerAlign(_0x1f4b24,_0x2e136c[_0x1b1ee3]));_0x14b284[_0x19f733(0x1bd)](colorBorder('│',_0xca2e1d)+'\x20'+_0x5c62d7['join']('\x20'+colorBorder('│',_0xca2e1d)+'\x20')+'\x20'+colorBorder('│',_0xca2e1d));const _0x53915d=_0x3f75fa[_0x19f733(0x1b8)]((_0x4fcb00,_0x2702dd)=>colorType(centerAlign(_0x4fcb00,_0x2e136c[_0x2702dd]),_0xca2e1d));_0x14b284[_0x19f733(0x1bd)](colorBorder('│',_0xca2e1d)+'\x20'+_0x53915d['join']('\x20'+colorBorder('│',_0xca2e1d)+'\x20')+'\x20'+colorBorder('│',_0xca2e1d)),_0x14b284[_0x19f733(0x1bd)](colorBorder('├'+_0x39fc54['map'](_0x5b5be4=>'─'['repeat'](_0x5b5be4+0x2))['join']('┼')+'┤',_0xca2e1d));const _0x5ef017=(_0x1c9de5,_0x86f23a)=>{const _0x25d199=_0x19f733,_0x52e1fc=stringWidth(_0x1c9de5);if(_0x52e1fc<=_0x86f23a)return _0x1c9de5;let _0x147498=_0x1c9de5;while(stringWidth(_0x147498+'…')>_0x86f23a&&_0x147498[_0x25d199(0x1d8)]>0x0){_0x147498=_0x147498[_0x25d199(0x1d0)](0x0,-0x1);}return _0x147498+'…';};_0x78d383[_0x19f733(0x1cf)](_0x7a88d4=>{const _0x4b562c=_0x19f733,_0x5548b4=_0x554adf[_0x4b562c(0x1b8)]((_0x173d78,_0x2021b0)=>{const _0x5928c3=_0x4b562c,_0x3665ad=_0x7a88d4[_0x173d78],_0x4f5519=formatValue(_0x3665ad),_0x5cff55=_0x2e136c[_0x2021b0],_0x201661=_0x5ef017(_0x4f5519,_0x5cff55),_0x4dba7c=typeof _0x3665ad===_0x5928c3(0x1b2)||typeof _0x3665ad==='string'&&/^-?\d+$/[_0x5928c3(0x1be)](_0x3665ad);return _0x4dba7c?padStart(_0x201661,_0x5cff55):padEnd(_0x201661,_0x5cff55);});_0x14b284[_0x4b562c(0x1bd)](colorBorder('│',_0xca2e1d)+'\x20'+_0x5548b4[_0x4b562c(0x1ca)]('\x20'+colorBorder('│',_0xca2e1d)+'\x20')+'\x20'+colorBorder('│',_0xca2e1d));});const _0x5b41eb=_0x39fc54[_0x19f733(0x1b4)]((_0x3f104c,_0x1ef5c5)=>_0x3f104c+_0x1ef5c5+0x3,-0x1);_0x14b284[_0x19f733(0x1bd)](colorBorder('├'+_0x39fc54[_0x19f733(0x1b8)](_0x186ffa=>'─'[_0x19f733(0x1bb)](_0x186ffa+0x2))[_0x19f733(0x1ca)]('┴')+'┤',_0xca2e1d));let _0x503a49;_0x3a740a?_0x503a49=_0x72cf0a+_0x19f733(0x1db)+_0x342afa+_0x19f733(0x1c6):_0x503a49=_0x72cf0a+_0x19f733(0x1d2)+(_0x72cf0a===0x1?'':'s');const _0x485c47=_0x503a49['padEnd'](_0x5b41eb-0x2);return _0x14b284[_0x19f733(0x1bd)](colorBorder('│',_0xca2e1d)+'\x20'+_0x485c47+'\x20'+colorBorder('│',_0xca2e1d)),_0x14b284[_0x19f733(0x1bd)](colorBorder('└'+'─'[_0x19f733(0x1bb)](_0x5b41eb)+'┘',_0xca2e1d)),_0x14b284[_0x19f733(0x1ca)]('\x0a');}function simplifyType(_0xe43492){const _0x932896=a55_0x5ee5,_0x100205={'varchar':_0x932896(0x1d6),'bigint':_0x932896(0x1c7),'integer':_0x932896(0x1b0),'double':_0x932896(0x1b5),'boolean':_0x932896(0x1d3),'date':_0x932896(0x1c8),'timestamp':'timestamp','array':'array','map':_0x932896(0x1b8),'row':_0x932896(0x1bf)},_0x3c8e85=_0xe43492[_0x932896(0x1c1)]();for(const [_0x46c4da,_0x50cfad]of Object[_0x932896(0x1af)](_0x100205)){if(_0x3c8e85[_0x932896(0x1d9)](_0x46c4da))return _0x50cfad;}return _0xe43492[_0x932896(0x1d8)]>0xa?_0xe43492[_0x932896(0x1b7)](0x0,0xa):_0xe43492;}function a55_0x5ee5(_0x37abb8,_0x285326){const _0x33eee8=a55_0x33ee();return a55_0x5ee5=function(_0x5ee535,_0x2e46c0){_0x5ee535=_0x5ee535-0x1ac;let _0x1c4763=_0x33eee8[_0x5ee535];return _0x1c4763;},a55_0x5ee5(_0x37abb8,_0x285326);}function a55_0x33ee(){const _0x22a011=['forEach','slice','max','\x20row','bool','table','name','string','stdout','length','startsWith','false','\x20rows\x20(','type','779898ZmKMEf','15160LXlfZB','478739SmjGPk','data','min','entries','int','974012aVqgoF','number','1068CgfmGA','reduce','double','jsonl','substring','map','toISOString','892824WhfRRi','repeat','true','push','test','row','8WBgfDn','toLowerCase','boolean','2503529siEzeM','No\x20rows\x20returned','100AdgVep','\x20shown)','long','date','json','join','stringify','replace','columns','1317753cvXHaB'];a55_0x33ee=function(){return _0x22a011;};return a55_0x33ee();}export function formatAsJSON(_0x3d080a,_0x5f26db={}){const _0x4dc815=a55_0x5ee5;if(_0x3d080a['data']['length']===0x0)return'[]';if(shouldUseColor(_0x5f26db))return colorizeJSON(_0x3d080a['data'],_0x5f26db);const _0x71405b=_0x3d080a[_0x4dc815(0x1ad)]['map'](_0x598b57=>'\x20\x20'+JSON[_0x4dc815(0x1cb)](_0x598b57));return'[\x0a'+_0x71405b[_0x4dc815(0x1ca)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x551df7,_0x2fbe7a={}){const _0x3ce969=a55_0x5ee5;if(_0x551df7[_0x3ce969(0x1ad)]['length']===0x0)return'';if(shouldUseColor(_0x2fbe7a))return _0x551df7['data'][_0x3ce969(0x1b8)](_0x244ceb=>colorizeJSONCompact(_0x244ceb,_0x2fbe7a))[_0x3ce969(0x1ca)]('\x0a');return _0x551df7[_0x3ce969(0x1ad)][_0x3ce969(0x1b8)](_0x3a5d98=>JSON[_0x3ce969(0x1cb)](_0x3a5d98))[_0x3ce969(0x1ca)]('\x0a');}export function formatAsTSV(_0x12a141){const _0x4ddd6d=a55_0x5ee5;if(_0x12a141[_0x4ddd6d(0x1ad)][_0x4ddd6d(0x1d8)]===0x0)return'';const _0x2fb361=[],_0x2409bc=_0x12a141[_0x4ddd6d(0x1cd)][_0x4ddd6d(0x1b8)](_0x1bf7d3=>_0x1bf7d3[_0x4ddd6d(0x1d5)]);return _0x2fb361['push'](_0x2409bc[_0x4ddd6d(0x1ca)]('\x09')),_0x12a141[_0x4ddd6d(0x1ad)][_0x4ddd6d(0x1cf)](_0x5be85e=>{const _0x3c0f72=_0x4ddd6d,_0x16573e=_0x2409bc['map'](_0x26c2b0=>{const _0x56be13=_0x5be85e[_0x26c2b0];return formatValueForTSV(_0x56be13);});_0x2fb361[_0x3c0f72(0x1bd)](_0x16573e[_0x3c0f72(0x1ca)]('\x09'));}),_0x2fb361[_0x4ddd6d(0x1ca)]('\x0a');}function formatValue(_0x21f72e){const _0x9b51da=a55_0x5ee5;if(_0x21f72e===null||_0x21f72e===undefined)return'';if(typeof _0x21f72e===_0x9b51da(0x1d6)){const _0x31b571=_0x21f72e[_0x9b51da(0x1cc)](/\n/g,'\x5cn')[_0x9b51da(0x1cc)](/\r/g,'\x5cr')[_0x9b51da(0x1cc)](/\t/g,'\x5ct');return _0x31b571;}if(typeof _0x21f72e==='number')return String(_0x21f72e);if(typeof _0x21f72e==='boolean')return _0x21f72e?_0x9b51da(0x1bc):_0x9b51da(0x1da);if(_0x21f72e instanceof Date)return _0x21f72e[_0x9b51da(0x1b9)]();if(typeof _0x21f72e==='object')return JSON[_0x9b51da(0x1cb)](_0x21f72e);return String(_0x21f72e);}function formatValueForTSV(_0x1bb6c5){const _0x1bf751=a55_0x5ee5;if(_0x1bb6c5===null||_0x1bb6c5===undefined)return'';if(typeof _0x1bb6c5===_0x1bf751(0x1d6))return _0x1bb6c5['replace'](/\t/g,'\x5ct')[_0x1bf751(0x1cc)](/\n/g,'\x5cn');if(typeof _0x1bb6c5===_0x1bf751(0x1b2)||typeof _0x1bb6c5===_0x1bf751(0x1c2))return String(_0x1bb6c5);if(_0x1bb6c5 instanceof Date)return _0x1bb6c5[_0x1bf751(0x1b9)]();if(typeof _0x1bb6c5==='object')return JSON[_0x1bf751(0x1cb)](_0x1bb6c5);return String(_0x1bb6c5);}export function formatQueryResult(_0x39299c,_0x7e9f0e){const _0x9e38d5=a55_0x5ee5;switch(_0x7e9f0e){case _0x9e38d5(0x1d4):return formatAsTable(_0x39299c);case _0x9e38d5(0x1c9):return formatAsJSON(_0x39299c);case _0x9e38d5(0x1b6):return formatAsJSONL(_0x39299c);case'tsv':return formatAsTSV(_0x39299c);default:return formatAsJSON(_0x39299c);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a56_0x25e5(_0x5c1089,_0x584756){const _0x917455=a56_0x9174();return a56_0x25e5=function(_0x25e52d,_0x2f2d7c){_0x25e52d=_0x25e52d-0x76;let _0x382107=_0x917455[_0x25e52d];return _0x382107;},a56_0x25e5(_0x5c1089,_0x584756);}const a56_0x43bd6c=a56_0x25e5;function a56_0x9174(){const _0xee3670=['toLowerCase','1347126gqxIru','2476605IyMbVK','1022802dPluVe','claude-4.5-haiku','11843258OZeXAB','214420tjtkDG','530188qymqnN','921114tqcniR'];a56_0x9174=function(){return _0xee3670;};return a56_0x9174();}(function(_0x589c6a,_0x253e72){const _0x19878f=a56_0x25e5,_0xa876dd=_0x589c6a();while(!![]){try{const _0x30e148=-parseInt(_0x19878f(0x79))/0x1+-parseInt(_0x19878f(0x7c))/0x2+parseInt(_0x19878f(0x77))/0x3+-parseInt(_0x19878f(0x7d))/0x4+-parseInt(_0x19878f(0x78))/0x5+parseInt(_0x19878f(0x7e))/0x6+parseInt(_0x19878f(0x7b))/0x7;if(_0x30e148===_0x253e72)break;else _0xa876dd['push'](_0xa876dd['shift']());}catch(_0x912cbb){_0xa876dd['push'](_0xa876dd['shift']());}}}(a56_0x9174,0x82fff));const MODEL_ALIASES={'haiku':a56_0x43bd6c(0x7a),'sonnet':'claude-4.5-sonnet'};export function resolveModelAlias(_0x3df291){const _0x20f8d5=a56_0x43bd6c;return MODEL_ALIASES[_0x3df291[_0x20f8d5(0x76)]()]||_0x3df291;}export function getModelAliases(){return{...MODEL_ALIASES};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3402d3,_0x56b87f){const _0x5ce0e9=a57_0x47c8,_0xed3c3a=_0x3402d3();while(!![]){try{const _0x5e4ac4=parseInt(_0x5ce0e9(0xe3))/0x1*(-parseInt(_0x5ce0e9(0xda))/0x2)+parseInt(_0x5ce0e9(0xe2))/0x3+parseInt(_0x5ce0e9(0xd8))/0x4*(parseInt(_0x5ce0e9(0xe1))/0x5)+-parseInt(_0x5ce0e9(0xe5))/0x6+-parseInt(_0x5ce0e9(0xdf))/0x7*(-parseInt(_0x5ce0e9(0xe7))/0x8)+parseInt(_0x5ce0e9(0xd9))/0x9+-parseInt(_0x5ce0e9(0xdb))/0xa;if(_0x5e4ac4===_0x56b87f)break;else _0xed3c3a['push'](_0xed3c3a['shift']());}catch(_0x4a8d97){_0xed3c3a['push'](_0xed3c3a['shift']());}}}(a57_0x3987,0x23665));export function validateLimitOption(_0x3d3aff){const _0x4d6cd8=a57_0x47c8;if(!Number[_0x4d6cd8(0xde)](_0x3d3aff))return{'isValid':![],'error':'Invalid\x20limit\x20value:\x20'+_0x3d3aff+_0x4d6cd8(0xe8)};if(_0x3d3aff<=0x0)return{'isValid':![],'error':_0x4d6cd8(0xdd)+_0x3d3aff+'.\x20Must\x20be\x20a\x20positive\x20integer.'};return{'isValid':!![],'value':_0x3d3aff};}export function validateTimeoutOption(_0x27f63d,_0x3a7003=0x1e){const _0xc3d52c=a57_0x47c8;if(_0x27f63d===undefined)return{'isValid':!![],'value':_0x3a7003};const _0x36c9b8=typeof _0x27f63d===_0xc3d52c(0xe6)?_0x27f63d:parseFloat(_0x27f63d);if(isNaN(_0x36c9b8))return{'isValid':![],'error':_0xc3d52c(0xdc)+_0x27f63d+_0xc3d52c(0xe4)};if(_0x36c9b8<=0x0)return{'isValid':![],'error':_0xc3d52c(0xdc)+_0x36c9b8+_0xc3d52c(0xe0)};return{'isValid':!![],'value':_0x36c9b8};}function a57_0x47c8(_0x560a4d,_0x52422d){const _0x3987f8=a57_0x3987();return a57_0x47c8=function(_0x47c8ae,_0x31852e){_0x47c8ae=_0x47c8ae-0xd8;let _0x970a28=_0x3987f8[_0x47c8ae];return _0x970a28;},a57_0x47c8(_0x560a4d,_0x52422d);}function a57_0x3987(){const _0x5be484=['1526481UMKNGQ','114BVqFNx','4370750GibPtb','Invalid\x20timeout\x20value:\x20','Invalid\x20limit\x20value:\x20','isInteger','253855kaGSMB','.\x20Must\x20be\x20a\x20positive\x20number.','7420fWgKEN','862251JXgbaa','139weLYio','.\x20Must\x20be\x20a\x20number.','983532RGYbrJ','number','56ZeOlEK','.\x20Must\x20be\x20an\x20integer.','116lUqevh'];a57_0x3987=function(){return _0x5be484;};return a57_0x3987();}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port availability utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if a port is available
|
|
6
|
+
* @param port - Port number to check
|
|
7
|
+
* @returns Promise<boolean> - True if port is available, false otherwise
|
|
8
|
+
*/
|
|
9
|
+
export declare function isPortAvailable(port: number): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* Find an available port starting from a given port
|
|
12
|
+
* @param startPort - Starting port number (default: 4000)
|
|
13
|
+
* @param maxAttempts - Maximum number of ports to try (default: 100)
|
|
14
|
+
* @returns Promise<number> - Available port number
|
|
15
|
+
* @throws Error if no available port is found
|
|
16
|
+
*/
|
|
17
|
+
export declare function findAvailablePort(startPort?: number, maxAttempts?: number): Promise<number>;
|
|
18
|
+
//# sourceMappingURL=port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port.d.ts","sourceRoot":"","sources":["../../src/utils/port.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAmBpE;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,GAAE,MAAa,EACxB,WAAW,GAAE,MAAY,GACxB,OAAO,CAAC,MAAM,CAAC,CAWjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3c2e95,_0x34d37b){const _0x2ce412=a58_0x5111,_0x27b2ff=_0x3c2e95();while(!![]){try{const _0xaf899c=parseInt(_0x2ce412(0x9f))/0x1*(parseInt(_0x2ce412(0x95))/0x2)+parseInt(_0x2ce412(0x9b))/0x3*(-parseInt(_0x2ce412(0x90))/0x4)+parseInt(_0x2ce412(0x93))/0x5*(parseInt(_0x2ce412(0x92))/0x6)+-parseInt(_0x2ce412(0xa1))/0x7+-parseInt(_0x2ce412(0xa0))/0x8*(parseInt(_0x2ce412(0x9c))/0x9)+-parseInt(_0x2ce412(0x9e))/0xa*(parseInt(_0x2ce412(0x96))/0xb)+-parseInt(_0x2ce412(0x9a))/0xc*(-parseInt(_0x2ce412(0xa2))/0xd);if(_0xaf899c===_0x34d37b)break;else _0x27b2ff['push'](_0x27b2ff['shift']());}catch(_0x4f7cc1){_0x27b2ff['push'](_0x27b2ff['shift']());}}}(a58_0x159a,0xcd6b6));import{createServer}from'node:net';export async function isPortAvailable(_0x2d433e){return new Promise(_0x4106c4=>{const _0x4832f5=a58_0x5111,_0x2dc646=createServer();_0x2dc646[_0x4832f5(0x98)](_0x4832f5(0xa4),_0x3edcfc=>{const _0x4c18c4=_0x4832f5;_0x3edcfc['code']===_0x4c18c4(0xa3)?_0x4106c4(![]):_0x4106c4(![]);}),_0x2dc646[_0x4832f5(0x98)](_0x4832f5(0x9d),()=>{_0x2dc646['close'](),_0x4106c4(!![]);}),_0x2dc646[_0x4832f5(0x94)](_0x2d433e,_0x4832f5(0x99));});}export async function findAvailablePort(_0x1d74d6=0xfa0,_0x54cdea=0x64){const _0x4e3570=a58_0x5111;for(let _0x46284f=0x0;_0x46284f<_0x54cdea;_0x46284f++){const _0x34c718=_0x1d74d6+_0x46284f;if(await isPortAvailable(_0x34c718))return _0x34c718;}throw new Error(_0x4e3570(0x91)+_0x1d74d6+_0x4e3570(0x97)+(_0x1d74d6+_0x54cdea-0x1));}function a58_0x5111(_0x19316e,_0x471496){const _0x159ae6=a58_0x159a();return a58_0x5111=function(_0x511178,_0xaa62bb){_0x511178=_0x511178-0x90;let _0xb0335a=_0x159ae6[_0x511178];return _0xb0335a;},a58_0x5111(_0x19316e,_0x471496);}function a58_0x159a(){const _0xce146=['127.0.0.1','15699300ThrEPt','69978aXxFZP','45jKkJul','listening','817780tVSgLB','783ICFwav','509848wRjDEm','8650558CgmkuP','13lhrNJE','EADDRINUSE','error','140flLDML','No\x20available\x20port\x20found\x20between\x20','6rrlhGp','5908915IujNiz','listen','3098VblnLi','66DOusSm','\x20and\x20','once'];a58_0x159a=function(){return _0xce146;};return a58_0x159a();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port.js","sourceRoot":"","sources":["../../src/utils/port.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAE9B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAA0B,EAAE,EAAE;YAClD,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gBAC9B,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;YAC5B,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,YAAoB,IAAI,EACxB,cAAsB,GAAG;IAEzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,SAAS,GAAG,CAAC,CAAC;QAC3B,IAAI,MAAM,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CACb,mCAAmC,SAAS,QAAQ,SAAS,GAAG,WAAW,GAAG,CAAC,EAAE,CAClF,CAAC;AACJ,CAAC"}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x26d175,_0x467267){var _0x550a9e=a59_0x3b5d,_0x3e9ac8=_0x26d175();while(!![]){try{var _0x58639f=-parseInt(_0x550a9e(0x1d4))/0x1*(parseInt(_0x550a9e(0x1d5))/0x2)+parseInt(_0x550a9e(0x1dc))/0x3+parseInt(_0x550a9e(0x1db))/0x4*(-parseInt(_0x550a9e(0x1d2))/0x5)+parseInt(_0x550a9e(0x1da))/0x6*(-parseInt(_0x550a9e(0x1d7))/0x7)+-parseInt(_0x550a9e(0x1d6))/0x8+-parseInt(_0x550a9e(0x1d8))/0x9*(-parseInt(_0x550a9e(0x1d3))/0xa)+parseInt(_0x550a9e(0x1d0))/0xb;if(_0x58639f===_0x467267)break;else _0x3e9ac8['push'](_0x3e9ac8['shift']());}catch(_0x508dfe){_0x3e9ac8['push'](_0x3e9ac8['shift']());}}}(a59_0x3afe,0xec98c));export function getPPID(){var _0x232652=a59_0x3b5d;return process[_0x232652(0x1d9)];}function a59_0x3b5d(_0x4399bf,_0x77498f){var _0x3afe6e=a59_0x3afe();return a59_0x3b5d=function(_0x3b5daa,_0x1696b6){_0x3b5daa=_0x3b5daa-0x1d0;var _0x289aa3=_0x3afe6e[_0x3b5daa];return _0x289aa3;},a59_0x3b5d(_0x4399bf,_0x77498f);}export function isProcessRunning(_0x5f4355){var _0x362eb8=a59_0x3b5d;try{return process[_0x362eb8(0x1d1)](_0x5f4355,0x0),!![];}catch{return![];}}function a59_0x3afe(){var _0x21a924=['26333340fIKrTp','kill','215MZiJhB','110BMMAvy','1615443awDFcS','2uSzObi','3882200AdrWXs','57197fhkZRq','433071yfWCzV','ppid','1146vKNhch','4612ykmdUP','5270427bLqwkP'];a59_0x3afe=function(){return _0x21a924;};return a59_0x3afe();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a60_0x29db(){const _0xf99c87=['indexOf','3985712hlsesu','1233355vWaahj','2418yQhCLw','.\x20Child\x20name\x20cannot\x20be\x20empty','5291285xoAToq','8239kZVSEo','2818410oxnITO','substring','1615612IVHnlE','1701498VsqPNT','4uLLwDK','Invalid\x20segment\x20reference\x20format:\x20','9eKXXgf'];a60_0x29db=function(){return _0xf99c87;};return a60_0x29db();}(function(_0x590ab8,_0x35a29d){const _0x5b312b=a60_0xe8e4,_0x5123d6=_0x590ab8();while(!![]){try{const _0x3a89f7=-parseInt(_0x5b312b(0x1dc))/0x1+-parseInt(_0x5b312b(0x1d5))/0x2+parseInt(_0x5b312b(0x1d6))/0x3+parseInt(_0x5b312b(0x1d7))/0x4*(parseInt(_0x5b312b(0x1df))/0x5)+parseInt(_0x5b312b(0x1dd))/0x6*(parseInt(_0x5b312b(0x1d2))/0x7)+-parseInt(_0x5b312b(0x1db))/0x8*(-parseInt(_0x5b312b(0x1d9))/0x9)+parseInt(_0x5b312b(0x1d3))/0xa;if(_0x3a89f7===_0x35a29d)break;else _0x5123d6['push'](_0x5123d6['shift']());}catch(_0x42f549){_0x5123d6['push'](_0x5123d6['shift']());}}}(a60_0x29db,0xccbf8));function a60_0xe8e4(_0xd089a4,_0x2ebabe){const _0x29dbc2=a60_0x29db();return a60_0xe8e4=function(_0xe8e4b9,_0x5a8262){_0xe8e4b9=_0xe8e4b9-0x1d2;let _0x16351a=_0x29dbc2[_0xe8e4b9];return _0x16351a;},a60_0xe8e4(_0xd089a4,_0x2ebabe);}export function parseSegmentRef(_0x1caf1e){const _0x3b02ea=a60_0xe8e4,_0x36d970=_0x1caf1e[_0x3b02ea(0x1da)]('/');if(_0x36d970===-0x1)return{'parentId':_0x1caf1e};if(_0x36d970===0x0)throw new Error(_0x3b02ea(0x1d8)+_0x1caf1e+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x3a81b1=_0x1caf1e['substring'](0x0,_0x36d970),_0x44c3d3=_0x1caf1e[_0x3b02ea(0x1d4)](_0x36d970+0x1);if(_0x44c3d3==='')throw new Error(_0x3b02ea(0x1d8)+_0x1caf1e+_0x3b02ea(0x1de));return{'parentId':_0x3a81b1,'childId':_0x44c3d3};}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ea661,_0x2a3938){const _0x1af6cc=a61_0x4c19,_0x49cb21=_0x1ea661();while(!![]){try{const _0x20c9a0=-parseInt(_0x1af6cc(0x1b1))/0x1+-parseInt(_0x1af6cc(0x1b2))/0x2*(-parseInt(_0x1af6cc(0x1bc))/0x3)+parseInt(_0x1af6cc(0x1b0))/0x4*(parseInt(_0x1af6cc(0x1b3))/0x5)+-parseInt(_0x1af6cc(0x1ae))/0x6*(parseInt(_0x1af6cc(0x1b5))/0x7)+parseInt(_0x1af6cc(0x1b6))/0x8*(-parseInt(_0x1af6cc(0x1c0))/0x9)+parseInt(_0x1af6cc(0x1bf))/0xa*(-parseInt(_0x1af6cc(0x1bd))/0xb)+parseInt(_0x1af6cc(0x1c4))/0xc;if(_0x20c9a0===_0x2a3938)break;else _0x49cb21['push'](_0x49cb21['shift']());}catch(_0x524d36){_0x49cb21['push'](_0x49cb21['shift']());}}}(a61_0x363e,0x922da));import a61_0x51e41c from'ora';export function createCommandSpinner(_0x518fff,_0xf3d863={}){const _0x1b5fd8=a61_0x4c19,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0xf3d863;return a61_0x51e41c({'text':_0x518fff,'color':'cyan','isEnabled':forceEnabled||process[_0x1b5fd8(0x1bb)]['isTTY']&&!verbose});}export async function withSpinner(_0x3089b6,_0x3a66cb,_0x4e6b5e={}){const _0x10197=a61_0x4c19,_0x32c974=_0x4e6b5e[_0x10197(0x1af)]??(()=>Date[_0x10197(0x1b8)]()),_0x21ed44=createCommandSpinner(_0x3089b6,_0x4e6b5e);_0x21ed44[_0x10197(0x1ba)]();const _0x1b32d5=_0x32c974();try{const _0x2e3794=await _0x3a66cb(),_0x15b69d=_0x32c974()-_0x1b32d5;return _0x21ed44[_0x10197(0x1c1)](),{'data':_0x2e3794,'elapsedMs':_0x15b69d};}catch(_0x1c7b3b){_0x21ed44[_0x10197(0x1c1)]();throw _0x1c7b3b;}}function a61_0x4c19(_0x596179,_0x4ce355){const _0x363e38=a61_0x363e();return a61_0x4c19=function(_0x4c195e,_0x533074){_0x4c195e=_0x4c195e-0x1ae;let _0x238ac5=_0x363e38[_0x4c195e];return _0x238ac5;},a61_0x4c19(_0x596179,_0x4ce355);}export async function withQuerySpinner(_0xbd417f,_0x3b6071,_0x2bcf12={}){const _0x2eebf2=a61_0x4c19,_0x400d45=_0x2bcf12['clock']??(()=>Date[_0x2eebf2(0x1b8)]()),_0x5ee16c=_0x2bcf12[_0x2eebf2(0x1b9)]??setInterval,_0x21c002=createCommandSpinner(_0xbd417f,_0x2bcf12);_0x21c002[_0x2eebf2(0x1ba)]();const _0x449429=_0x400d45(),_0x32e9fc=_0xbd417f['replace'](_0x2eebf2(0x1c2),''),_0x351796={},_0x591c2d=()=>{const _0x21da69=_0x2eebf2;if(!_0x21c002['isSpinning'])return;const _0x4deba9=((_0x400d45()-_0x449429)/0x3e8)['toFixed'](0x1),_0x384011=_0x351796[_0x21da69(0x1b4)]??_0x32e9fc,_0x17bf33=_0x351796[_0x21da69(0x1be)]?_0x21da69(0x1b7)+_0x351796['jobId']+']':'',_0x4fba3e=_0x351796[_0x21da69(0x1c3)]?'\x20'+_0x351796[_0x21da69(0x1c3)]:'';_0x21c002['text']=_0x384011+'\x20('+_0x4deba9+'s)'+_0x4fba3e+_0x17bf33;},_0x818d65=_0x5ee16c(()=>{_0x591c2d();},0x3e8),_0x316cd8={'setPhase':_0x4c4cca=>{const _0x1a7a23=_0x2eebf2;_0x351796[_0x1a7a23(0x1b4)]=_0x4c4cca,_0x591c2d();},'setJobId':_0x22a4ff=>{const _0x3ce163=_0x2eebf2;_0x351796[_0x3ce163(0x1be)]=_0x22a4ff,_0x591c2d();},'setExtra':_0x4551d2=>{const _0x2f8513=_0x2eebf2;_0x351796[_0x2f8513(0x1c3)]=_0x4551d2,_0x591c2d();}};_0x591c2d();try{const _0x29eaee=await _0x3b6071(_0x316cd8),_0x371f02=_0x400d45()-_0x449429;return{'data':_0x29eaee,'elapsedMs':_0x371f02};}finally{clearInterval(_0x818d65),_0x21c002['stop']();}}export function formatElapsed(_0x105127){return(_0x105127/0x3e8)['toFixed'](0x2)+'s';}function a61_0x363e(){const _0x13a355=['649810MtdhFt','2CVvIKV','315AOmlEG','phase','7lrrgaN','8xExIMU','\x20[Job\x20ID:\x20','now','intervalFactory','start','stdout','801018DeUGou','1408583ZadRYv','jobId','30GOUPcZ','6956811PWsfxf','stop','...','extra','30663456vmWIux','4478052VcegzT','clock','20936XXiQUG'];a61_0x363e=function(){return _0x13a355;};return a61_0x363e();}
|
package/dist/utils/sql-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5ec5a2,_0x141149){const _0x2ce370=a62_0x3dae,_0xe4ec0=_0x5ec5a2();while(!![]){try{const _0xc7f05d=-parseInt(_0x2ce370(0xd2))/0x1+-parseInt(_0x2ce370(0xd1))/0x2+parseInt(_0x2ce370(0xd9))/0x3+parseInt(_0x2ce370(0xc8))/0x4*(-parseInt(_0x2ce370(0xdf))/0x5)+parseInt(_0x2ce370(0xd3))/0x6*(-parseInt(_0x2ce370(0xd0))/0x7)+-parseInt(_0x2ce370(0xce))/0x8+parseInt(_0x2ce370(0xdd))/0x9;if(_0xc7f05d===_0x141149)break;else _0xe4ec0['push'](_0xe4ec0['shift']());}catch(_0x1980e5){_0xe4ec0['push'](_0xe4ec0['shift']());}}}(a62_0x6b4c,0x64bb5));import{readFileSync}from'fs';function a62_0x3dae(_0x1099f4,_0x321ee0){const _0x6b4c78=a62_0x6b4c();return a62_0x3dae=function(_0x3dae9e,_0x163698){_0x3dae9e=_0x3dae9e-0xc8;let _0x1131f3=_0x6b4c78[_0x3dae9e];return _0x1131f3;},a62_0x3dae(_0x1099f4,_0x321ee0);}export function stripSqlComments(_0x3a6405){const _0x2a8965=a62_0x3dae;let _0x3c332e=_0x3a6405[_0x2a8965(0xca)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x3c332e=_0x3c332e['replace'](/--.*$/gm,''),_0x3c332e['trim']();}function isEscaped(_0x5d9b40,_0x445f2d){let _0x5553aa=0x0;for(let _0x139e33=_0x445f2d-0x1;_0x139e33>=0x0&&_0x5d9b40[_0x139e33]==='\x5c';_0x139e33--){_0x5553aa++;}return _0x5553aa%0x2===0x1;}function a62_0x6b4c(){const _0x41ea0e=['Content\x20contains\x20no\x20SQL\x20statements','1330896bdZoEt','map','381500DNYuiA','1126646vgaHEV','485926pEkQXm','6Wznnnp','ENOENT','Permission\x20denied\x20reading\x20file\x20\x27','filter','utf-8','trim','1056015umVHYi','\x27\x20not\x20found','code','length','14574483Mzdqlv','Error\x20reading\x20file\x20\x27','270hDjXzb','File\x20\x27','21384yPAGiI','EACCES','replace','\x27:\x20','push'];a62_0x6b4c=function(){return _0x41ea0e;};return a62_0x6b4c();}export function splitSqlStatements(_0x509891){const _0x2e8677=a62_0x3dae,_0x2e32e4=stripSqlComments(_0x509891);if(!_0x2e32e4)throw new Error(_0x2e8677(0xcd));const _0x18b104=[];let _0x5d71c4='',_0x227a80=![],_0x1b23bd=![],_0x5d951d=![];for(let _0x7dfb0d=0x0;_0x7dfb0d<_0x509891[_0x2e8677(0xdc)];_0x7dfb0d++){const _0x29d0d1=_0x509891[_0x7dfb0d];if(_0x29d0d1==='\x27'&&!isEscaped(_0x509891,_0x7dfb0d)&&!_0x1b23bd&&!_0x5d951d)_0x227a80=!_0x227a80;else{if(_0x29d0d1==='\x22'&&!isEscaped(_0x509891,_0x7dfb0d)&&!_0x227a80&&!_0x5d951d)_0x1b23bd=!_0x1b23bd;else _0x29d0d1==='`'&&!isEscaped(_0x509891,_0x7dfb0d)&&!_0x227a80&&!_0x1b23bd&&(_0x5d951d=!_0x5d951d);}if(_0x29d0d1===';'&&!_0x227a80&&!_0x1b23bd&&!_0x5d951d){const _0x199568=_0x5d71c4[_0x2e8677(0xd8)]();_0x199568&&_0x18b104[_0x2e8677(0xcc)](_0x199568),_0x5d71c4='';}else _0x5d71c4+=_0x29d0d1;}const _0x434ae4=_0x5d71c4['trim']();_0x434ae4&&_0x18b104[_0x2e8677(0xcc)](_0x434ae4);const _0x2e79a9=_0x18b104[_0x2e8677(0xcf)](_0x5b9ff1=>_0x5b9ff1[_0x2e8677(0xd8)]())[_0x2e8677(0xd6)](_0x109912=>{const _0x3dc3d9=stripSqlComments(_0x109912);return _0x3dc3d9['length']>0x0;});if(_0x2e79a9[_0x2e8677(0xdc)]===0x0)throw new Error(_0x2e8677(0xcd));return _0x2e79a9;}export function readFileContent(_0x359c9d){const _0x5728c0=a62_0x3dae;try{return readFileSync(_0x359c9d,_0x5728c0(0xd7));}catch(_0x23c791){const _0x3bce94=_0x23c791[_0x5728c0(0xdb)];if(_0x3bce94===_0x5728c0(0xd4))throw new Error(_0x5728c0(0xe0)+_0x359c9d+_0x5728c0(0xda));else{if(_0x3bce94===_0x5728c0(0xc9))throw new Error(_0x5728c0(0xd5)+_0x359c9d+'\x27');else throw new Error(_0x5728c0(0xde)+_0x359c9d+_0x5728c0(0xcb)+_0x23c791['message']);}}}export function readSqlStatementsFromFile(_0xc38489){const _0x4ff0e9=a62_0x3dae,_0x411f3=readFileContent(_0xc38489);try{return splitSqlStatements(_0x411f3);}catch(_0x4824da){throw new Error(_0x4ff0e9(0xe0)+_0xc38489+'\x27\x20'+_0x4824da['message']['toLowerCase']());}}
|
package/dist/utils/sse-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a63_0x41ff(){const _0x41c717=['814737GHoBPj','trim','Response\x20body\x20is\x20null','releaseLock','data','event','2345136nCzMiO','51650EVeyYo','decode','12OmgWzu','78572bCmqif','slice','5662300YRUUcu','997650LbBsNa','split','1509RKQPJe','startsWith','body','pop','524lMVtmY','40AWJPUE','read','parse'];a63_0x41ff=function(){return _0x41c717;};return a63_0x41ff();}(function(_0x4c44e6,_0x52c48d){const _0x35125a=a63_0x3b51,_0x20c835=_0x4c44e6();while(!![]){try{const _0x4f71b1=parseInt(_0x35125a(0x119))/0x1+parseInt(_0x35125a(0x125))/0x2*(-parseInt(_0x35125a(0x121))/0x3)+-parseInt(_0x35125a(0x11c))/0x4*(parseInt(_0x35125a(0x126))/0x5)+-parseInt(_0x35125a(0x11b))/0x6*(-parseInt(_0x35125a(0x129))/0x7)+-parseInt(_0x35125a(0x118))/0x8+-parseInt(_0x35125a(0x11f))/0x9+parseInt(_0x35125a(0x11e))/0xa;if(_0x4f71b1===_0x52c48d)break;else _0x20c835['push'](_0x20c835['shift']());}catch(_0x4b61d8){_0x20c835['push'](_0x20c835['shift']());}}}(a63_0x41ff,0x2682c));export async function*parseSSEStream(_0x35a735){const _0x3e755f=a63_0x3b51;if(!_0x35a735['body'])throw new Error(_0x3e755f(0x12b));const _0x2550df=_0x35a735[_0x3e755f(0x123)]['getReader'](),_0x23b05a=new TextDecoder();let _0x2d3e66='',_0xe288da={};try{while(!![]){const {done:_0x16246e,value:_0x4a7280}=await _0x2550df[_0x3e755f(0x127)]();if(_0x16246e){_0xe288da[_0x3e755f(0x12d)]&&(yield parseSSEData(_0xe288da[_0x3e755f(0x12d)]));break;}_0x2d3e66+=_0x23b05a[_0x3e755f(0x11a)](_0x4a7280,{'stream':!![]});const _0x5d0aef=_0x2d3e66[_0x3e755f(0x120)]('\x0a');_0x2d3e66=_0x5d0aef[_0x3e755f(0x124)]()||'';for(const _0x1c60ea of _0x5d0aef){if(_0x1c60ea[_0x3e755f(0x12a)]()===''){_0xe288da['data']&&(yield parseSSEData(_0xe288da[_0x3e755f(0x12d)]),_0xe288da={});continue;}if(_0x1c60ea[_0x3e755f(0x122)](':'))continue;const _0x5f3e1a=_0x1c60ea['indexOf'](':');if(_0x5f3e1a===-0x1)continue;const _0x1719b6=_0x1c60ea[_0x3e755f(0x11d)](0x0,_0x5f3e1a);let _0x48c392=_0x1c60ea[_0x3e755f(0x11d)](_0x5f3e1a+0x1);_0x48c392['startsWith']('\x20')&&(_0x48c392=_0x48c392[_0x3e755f(0x11d)](0x1));switch(_0x1719b6){case _0x3e755f(0x117):_0xe288da['event']=_0x48c392;break;case _0x3e755f(0x12d):_0xe288da['data']=_0xe288da[_0x3e755f(0x12d)]?_0xe288da[_0x3e755f(0x12d)]+'\x0a'+_0x48c392:_0x48c392;break;case'id':_0xe288da['id']=_0x48c392;break;}}}}finally{_0x2550df[_0x3e755f(0x12c)]();}}function a63_0x3b51(_0x5665d1,_0xc95071){const _0x41ffa5=a63_0x41ff();return a63_0x3b51=function(_0x3b51f1,_0x5e8735){_0x3b51f1=_0x3b51f1-0x117;let _0x4ad385=_0x41ffa5[_0x3b51f1];return _0x4ad385;},a63_0x3b51(_0x5665d1,_0xc95071);}function parseSSEData(_0x4b3ab7){const _0x833b43=a63_0x3b51;try{return JSON[_0x833b43(0x128)](_0x4b3ab7);}catch(_0x130dd5){throw new Error('Failed\x20to\x20parse\x20SSE\x20data\x20as\x20JSON:\x20'+_0x4b3ab7,{'cause':_0x130dd5});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12e14e,_0x491923){const _0x50beed=a64_0x45d6,_0x1fa30c=_0x12e14e();while(!![]){try{const _0x31be64=parseInt(_0x50beed(0xe9))/0x1*(-parseInt(_0x50beed(0xf6))/0x2)+parseInt(_0x50beed(0xec))/0x3+parseInt(_0x50beed(0xf4))/0x4+-parseInt(_0x50beed(0xe5))/0x5+parseInt(_0x50beed(0xf0))/0x6*(parseInt(_0x50beed(0xe3))/0x7)+-parseInt(_0x50beed(0xe8))/0x8*(-parseInt(_0x50beed(0xf7))/0x9)+-parseInt(_0x50beed(0xf1))/0xa;if(_0x31be64===_0x491923)break;else _0x1fa30c['push'](_0x1fa30c['shift']());}catch(_0x48e592){_0x1fa30c['push'](_0x1fa30c['shift']());}}}(a64_0x7fe1,0x6bbcb));import a64_0x29fce1 from'string-width';export function stringWidth(_0xc75a94){return a64_0x29fce1(_0xc75a94);}export function padEnd(_0x8995c,_0x40b663){const _0x1edd8e=a64_0x45d6,_0x3f90d7=stringWidth(_0x8995c);if(_0x3f90d7>=_0x40b663)return _0x8995c;return _0x8995c+'\x20'[_0x1edd8e(0xeb)](_0x40b663-_0x3f90d7);}export function padStart(_0x7cf8e6,_0x521608){const _0x429a30=a64_0x45d6,_0x459256=stringWidth(_0x7cf8e6);if(_0x459256>=_0x521608)return _0x7cf8e6;return'\x20'[_0x429a30(0xeb)](_0x521608-_0x459256)+_0x7cf8e6;}export function centerAlign(_0xf5783b,_0x257bdc){const _0x539f15=a64_0x45d6,_0x5a8824=stringWidth(_0xf5783b);if(_0x5a8824>_0x257bdc){if(_0x257bdc<=0x1)return'…'[_0x539f15(0xe7)](0x0,_0x257bdc);let _0x3c6e29=_0xf5783b;while(stringWidth(_0x3c6e29+'…')>_0x257bdc){_0x3c6e29=_0x3c6e29[_0x539f15(0xed)](0x0,-0x1);}return _0x3c6e29+'…';}if(_0x5a8824===_0x257bdc)return _0xf5783b;const _0x258cba=_0x257bdc-_0x5a8824,_0xdc2970=Math[_0x539f15(0xf5)](_0x258cba/0x2),_0x3125d9=_0x258cba-_0xdc2970;return'\x20'[_0x539f15(0xeb)](_0xdc2970)+_0xf5783b+'\x20'[_0x539f15(0xeb)](_0x3125d9);}export function escapeStringLiteral(_0xbe962c){const _0x3a2013=a64_0x45d6;if(!_0xbe962c||_0xbe962c[_0x3a2013(0xf2)]()[_0x3a2013(0xe6)]===0x0)throw new Error(_0x3a2013(0xea));const _0x216fe4=_0xbe962c['replace'](/'/g,'\x27\x27');return'\x27'+_0x216fe4+'\x27';}export function globToLike(_0x6bc07f){const _0xf101cd=a64_0x45d6;let _0x1a2f74=_0x6bc07f[_0xf101cd(0xef)](/\\/g,'\x5c\x5c')['replace'](/%/g,'\x5c%')[_0xf101cd(0xef)](/_/g,'\x5c_');return _0x1a2f74=_0x1a2f74['replace'](/\*/g,'%')[_0xf101cd(0xef)](/\?/g,'_'),_0x1a2f74;}function a64_0x45d6(_0x23113c,_0x2423ab){const _0x7fe1a3=a64_0x7fe1();return a64_0x45d6=function(_0x45d6ba,_0x1c4991){_0x45d6ba=_0x45d6ba-0xe2;let _0x35a38c=_0x7fe1a3[_0x45d6ba];return _0x35a38c;},a64_0x45d6(_0x23113c,_0x2423ab);}export function buildLikePattern(_0x392da0){const _0x5243c2=a64_0x45d6;if(!_0x392da0||_0x392da0[_0x5243c2(0xf2)]()[_0x5243c2(0xe6)]===0x0)throw new Error(_0x5243c2(0xf9));const _0xba0ec8=globToLike(_0x392da0),_0x1cc0af=_0xba0ec8[_0x5243c2(0xef)](/'/g,'\x27\x27');return'\x27'+_0x1cc0af+'\x27';}function a64_0x7fe1(){const _0x9f092c=['3269zfTlIG','unknown','1855515BkcYmY','length','substring','14480NNkEPq','1pnFnGE','Cannot\x20escape\x20empty\x20string\x20literal','repeat','801870SqaKzl','slice','USER','replace','1050UbppUZ','2645590FcnEoV','trim','toLowerCase','2382112UQnQWr','floor','173200yQNAVU','1089NDUjHa','toString','Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string','\x5c$&','env','random'];a64_0x7fe1=function(){return _0x9f092c;};return a64_0x7fe1();}export function matchGlobPattern(_0x12fc7f,_0x47aefa){const _0x88265e=a64_0x45d6,_0x9d6619=_0x47aefa['replace'](/[.+^${}()|[\]\\]/g,_0x88265e(0xfa))[_0x88265e(0xef)](/\*/g,'.*')[_0x88265e(0xef)](/\?/g,'.'),_0x4c7738=new RegExp('^'+_0x9d6619+'$');return _0x4c7738['test'](_0x12fc7f);}export function getSanitizedUsername(){const _0x47f6e7=a64_0x45d6,_0x2f6e61=process[_0x47f6e7(0xfb)][_0x47f6e7(0xee)]||process[_0x47f6e7(0xfb)]['USERNAME']||_0x47f6e7(0xe4);return _0x2f6e61['replace'](/[^a-zA-Z0-9]/g,'')[_0x47f6e7(0xf3)]();}export function generateRandomHex(){const _0x1441ec=a64_0x45d6,_0x59885f=Math[_0x1441ec(0xf5)](Math[_0x1441ec(0xe2)]()*0xfffff);return _0x59885f[_0x1441ec(0xf8)](0x10)['padStart'](0x5,'0');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x718f2e,_0x55812d){const _0x2ec364=a65_0x3688,_0x1d25fe=_0x718f2e();while(!![]){try{const _0x294ce2=parseInt(_0x2ec364(0xdc))/0x1+parseInt(_0x2ec364(0xf1))/0x2+-parseInt(_0x2ec364(0xea))/0x3*(-parseInt(_0x2ec364(0xe7))/0x4)+parseInt(_0x2ec364(0xdb))/0x5*(-parseInt(_0x2ec364(0xe9))/0x6)+parseInt(_0x2ec364(0xde))/0x7*(parseInt(_0x2ec364(0xe0))/0x8)+-parseInt(_0x2ec364(0xe8))/0x9*(-parseInt(_0x2ec364(0xef))/0xa)+parseInt(_0x2ec364(0xe6))/0xb*(-parseInt(_0x2ec364(0xd9))/0xc);if(_0x294ce2===_0x55812d)break;else _0x1d25fe['push'](_0x1d25fe['shift']());}catch(_0x563f83){_0x1d25fe['push'](_0x1d25fe['shift']());}}}(a65_0x14ee,0xa819f));function hasWildcard(_0x4998dd){const _0x2fe276=a65_0x3688;return _0x4998dd['includes']('*')||_0x4998dd[_0x2fe276(0xeb)]('?');}export function parseTableReference(_0x1f49f1){const _0x90239c=a65_0x3688;if(!_0x1f49f1||_0x1f49f1['trim']()[_0x90239c(0xf4)]===0x0)throw new Error(_0x90239c(0xf3));const _0x407f25=_0x1f49f1[_0x90239c(0xe5)](),_0x31b174={'original':_0x407f25},_0x457ef7=_0x407f25['split']('.');if(_0x457ef7[_0x90239c(0xf4)]===0x1){const _0x49e94c=_0x457ef7[0x0];if(!_0x49e94c)throw new Error(_0x90239c(0xe3));_0x31b174[_0x90239c(0xe2)]=_0x49e94c;}else{if(_0x457ef7[_0x90239c(0xf4)]===0x2){const [_0x3df38d,_0x8de70b]=_0x457ef7;if(!_0x3df38d)throw new Error(_0x90239c(0xdf));if(!_0x8de70b)throw new Error(_0x90239c(0xe4));_0x31b174[_0x90239c(0xec)]=_0x3df38d,_0x31b174['table']=_0x8de70b;}else{if(_0x457ef7[_0x90239c(0xf4)]===0x3){const [_0x2d29f4,_0x56dfbd,_0x961bb8]=_0x457ef7;if(!_0x2d29f4||!_0x56dfbd||!_0x961bb8)throw new Error(_0x90239c(0xf2));_0x31b174[_0x90239c(0xf0)]=_0x2d29f4,_0x31b174[_0x90239c(0xec)]=_0x56dfbd,_0x31b174[_0x90239c(0xe2)]=_0x961bb8;}else throw new Error(_0x90239c(0xe1));}}return _0x31b174;}function a65_0x14ee(){const _0x174759=['Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','24uYlNnV','Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','table','Pattern\x20cannot\x20be\x20just\x20a\x20dot','Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)','trim','1969aYrpGl','2596NSXuCA','520290BJjLnO','1332RckWme','6213hdecVx','includes','database','Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation','push','180hCLlcu','catalog','1870702UTTgFV','Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','length','194316NvLCMB','join','15475mDxjZe','639371aFALEU','Table\x20name\x20is\x20required\x20for\x20describe\x20operation','734531GyQCrk'];a65_0x14ee=function(){return _0x174759;};return a65_0x14ee();}function a65_0x3688(_0xc15304,_0x230ce7){const _0x14ee85=a65_0x14ee();return a65_0x3688=function(_0x3688fb,_0x50e550){_0x3688fb=_0x3688fb-0xd9;let _0x5bf910=_0x14ee85[_0x3688fb];return _0x5bf910;},a65_0x3688(_0xc15304,_0x230ce7);}export function formatTableReference(_0x56189f){const _0x5e055b=a65_0x3688,_0x30aad8=[];return _0x56189f[_0x5e055b(0xf0)]&&_0x30aad8[_0x5e055b(0xee)](_0x56189f[_0x5e055b(0xf0)]),_0x56189f[_0x5e055b(0xec)]&&_0x30aad8[_0x5e055b(0xee)](_0x56189f['database']),_0x56189f['table']&&_0x30aad8[_0x5e055b(0xee)](_0x56189f[_0x5e055b(0xe2)]),_0x30aad8[_0x5e055b(0xda)]('.');}export function validateTableListReference(_0x3a6255){return undefined;}export function validateTableDescribeReference(_0x14d490){const _0xbfb86c=a65_0x3688;if(!_0x14d490['table'])return _0xbfb86c(0xdd);if(_0x14d490[_0xbfb86c(0xec)]&&hasWildcard(_0x14d490[_0xbfb86c(0xec)]))return'Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation';if(hasWildcard(_0x14d490[_0xbfb86c(0xe2)]))return _0xbfb86c(0xed);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a66_0x13b7ad=a66_0x143d;function a66_0x1f00(){const _0x527cf2=['3383394pNuSxu','9098376JqfUYE','19583775sbOSFV','6493040IcOgFd','.digdag','8QucgKd','6405203piOPRr','50443nTjCqF','.dig','startsWith','5AbVCKr','4878556AHdUCX'];a66_0x1f00=function(){return _0x527cf2;};return a66_0x1f00();}(function(_0x5385d5,_0x1c160b){const _0x35e0b6=a66_0x143d,_0x457fb0=_0x5385d5();while(!![]){try{const _0x372095=-parseInt(_0x35e0b6(0x1c8))/0x1*(parseInt(_0x35e0b6(0x1c6))/0x2)+parseInt(_0x35e0b6(0x1c1))/0x3+parseInt(_0x35e0b6(0x1c0))/0x4*(-parseInt(_0x35e0b6(0x1cb))/0x5)+parseInt(_0x35e0b6(0x1c2))/0x6+parseInt(_0x35e0b6(0x1c7))/0x7+parseInt(_0x35e0b6(0x1c4))/0x8+-parseInt(_0x35e0b6(0x1c3))/0x9;if(_0x372095===_0x1c160b)break;else _0x457fb0['push'](_0x457fb0['shift']());}catch(_0x20e176){_0x457fb0['push'](_0x457fb0['shift']());}}}(a66_0x1f00,0xbcd5b));export const WORKFLOW_FILE_EXTENSION=a66_0x13b7ad(0x1c9);function a66_0x143d(_0x59547d,_0x1da59d){const _0x1f00e0=a66_0x1f00();return a66_0x143d=function(_0x143d9c,_0x1894f3){_0x143d9c=_0x143d9c-0x1c0;let _0x4fa255=_0x1f00e0[_0x143d9c];return _0x4fa255;},a66_0x143d(_0x59547d,_0x1da59d);}export function shouldIncludeInArchive(_0x4f35a1){const _0x2ffc83=a66_0x13b7ad;if(_0x4f35a1===_0x2ffc83(0x1c5))return!![];if(_0x4f35a1[_0x2ffc83(0x1ca)]('.'))return![];return!![];}
|