@treasuredata/tdx 0.12.0 → 0.12.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/bin.js +1 -1
- package/dist/build-info.json +3 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-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/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-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.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-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/segment-validate-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/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.d.ts +2 -4
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- 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.js +1 -1
- package/dist/core/profile.d.ts +2 -1
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.d.ts +45 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +1 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.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/spinner.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/version-check.js +1 -1
- package/package.json +1 -1
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a141_0x28782b=a141_0x553c;(function(_0x57fece,_0x6fe5e0){const _0x5f2d0e=a141_0x553c,_0x3d8b60=_0x57fece();while(!![]){try{const _0xb951c0=-parseInt(_0x5f2d0e(0x1a2))/0x1+-parseInt(_0x5f2d0e(0x1b7))/0x2+parseInt(_0x5f2d0e(0x1b6))/0x3*(-parseInt(_0x5f2d0e(0x1c6))/0x4)+-parseInt(_0x5f2d0e(0x1ca))/0x5*(parseInt(_0x5f2d0e(0x1c1))/0x6)+-parseInt(_0x5f2d0e(0x1be))/0x7*(-parseInt(_0x5f2d0e(0x1c3))/0x8)+-parseInt(_0x5f2d0e(0x1bc))/0x9*(parseInt(_0x5f2d0e(0x1ce))/0xa)+parseInt(_0x5f2d0e(0x1a5))/0xb*(parseInt(_0x5f2d0e(0x1c5))/0xc);if(_0xb951c0===_0x6fe5e0)break;else _0x3d8b60['push'](_0x3d8b60['shift']());}catch(_0x351ffe){_0x3d8b60['push'](_0x3d8b60['shift']());}}}(a141_0x3af0,0xcfe7b));import{execSync,spawn}from'node:child_process';const SHELL_NAMES=new Set([a141_0x28782b(0x1af),'zsh','sh',a141_0x28782b(0x1bf),a141_0x28782b(0x1b5),'tcsh',a141_0x28782b(0x1ba),'dash',a141_0x28782b(0x1b1),a141_0x28782b(0x1ad),'nu','ion',a141_0x28782b(0x1c9),'xonsh']),EPHEMERAL_SHELL_SPAWNERS=new Set([a141_0x28782b(0x1a3),a141_0x28782b(0x1a8),a141_0x28782b(0x1b8)]);function getProcessInfoWindows(_0x2ad21d){const _0x12505c=a141_0x28782b;try{if(!Number[_0x12505c(0x1ab)](_0x2ad21d)||_0x2ad21d<=0x0)return null;const _0x2dc794=execSync(_0x12505c(0x1a7)+_0x2ad21d+_0x12505c(0x1a6),{'encoding':_0x12505c(0x1a4),'windowsHide':!![]})[_0x12505c(0x1ac)](),_0x3d1ff5=_0x2dc794[_0x12505c(0x1b2)]('\x0a')[_0x12505c(0x1a9)](_0x5491c6=>_0x5491c6['trim']());if(_0x3d1ff5['length']<0x2)return null;const _0x5ec0d3=_0x3d1ff5[_0x3d1ff5['length']-0x1][_0x12505c(0x1b2)](',');if(_0x5ec0d3['length']<0x3)return null;const _0x32f9b8=_0x5ec0d3[0x1]?.[_0x12505c(0x1ac)]()||'',_0x16ba7b=parseInt(_0x5ec0d3[0x2]?.[_0x12505c(0x1ac)]()||'0',0xa);if(isNaN(_0x16ba7b)||!_0x32f9b8)return null;return{'pid':_0x2ad21d,'ppid':_0x16ba7b,'comm':_0x32f9b8[_0x12505c(0x1bb)](/\.exe$/i,'')};}catch{return null;}}function getProcessInfoPosix(_0x154ea8){const _0x4a87c3=a141_0x28782b;try{const _0x4f909e=0x400000;if(!Number[_0x4a87c3(0x1ab)](_0x154ea8)||_0x154ea8<=0x0||_0x154ea8>_0x4f909e)return null;const _0x27b392=execSync(_0x4a87c3(0x1ae)+_0x154ea8+_0x4a87c3(0x1c2),{'encoding':'utf-8','stdio':'pipe'})[_0x4a87c3(0x1ac)](),[_0x1ebc91,..._0x242ac3]=_0x27b392[_0x4a87c3(0x1b2)](/\s+/),_0x2d9c83=parseInt(_0x1ebc91,0xa),_0xf59c9a=_0x242ac3[_0x4a87c3(0x1cd)]('\x20');if(isNaN(_0x2d9c83))return null;return{'pid':_0x154ea8,'ppid':_0x2d9c83,'comm':_0xf59c9a};}catch{return null;}}function getProcessInfo(_0x1972fe){const _0x3a14d6=a141_0x28782b;if(process[_0x3a14d6(0x1b0)]===_0x3a14d6(0x1a1))return getProcessInfoWindows(_0x1972fe);return getProcessInfoPosix(_0x1972fe);}function getBasename(_0x3a6e35){const _0x1a91b7=a141_0x28782b;return _0x3a6e35['replace'](/^-/,'')[_0x1a91b7(0x1b2)]('/')[_0x1a91b7(0x1c8)]()?.[_0x1a91b7(0x1b3)]()||'';}function a141_0x553c(_0x532920,_0x3ecf54){_0x532920=_0x532920-0x1a1;const _0x3af0fc=a141_0x3af0();let _0x553c4d=_0x3af0fc[_0x532920];return _0x553c4d;}function isShell(_0x8e8d13){const _0x391ef8=a141_0x28782b;return SHELL_NAMES[_0x391ef8(0x1b9)](getBasename(_0x8e8d13));}function isEphemeralShellSpawner(_0x588aef){const _0x54f8bd=a141_0x28782b;return EPHEMERAL_SHELL_SPAWNERS[_0x54f8bd(0x1b9)](getBasename(_0x588aef));}let cachedShellPID;function findShellPID(){const _0x279b55=a141_0x28782b;if(process[_0x279b55(0x1aa)]===undefined)return process[_0x279b55(0x1cb)];let _0x57b4fd=process['ppid'];const _0xfd9832=0xa;let _0x40336a=0x0;while(_0x40336a<_0xfd9832){const _0x3e34b0=getProcessInfo(_0x57b4fd);if(!_0x3e34b0)break;if(isShell(_0x3e34b0['comm'])){const _0x395d2b=getProcessInfo(_0x3e34b0[_0x279b55(0x1aa)]);if(_0x395d2b&&isEphemeralShellSpawner(_0x395d2b[_0x279b55(0x1bd)])){_0x57b4fd=_0x3e34b0[_0x279b55(0x1aa)],_0x40336a++;continue;}return _0x3e34b0[_0x279b55(0x1cb)];}if(_0x3e34b0[_0x279b55(0x1aa)]===0x0||_0x3e34b0['ppid']===0x1){if(isShell(_0x3e34b0[_0x279b55(0x1bd)]))return _0x3e34b0['pid'];break;}_0x57b4fd=_0x3e34b0[_0x279b55(0x1aa)],_0x40336a++;}return process[_0x279b55(0x1aa)]!==undefined?process[_0x279b55(0x1aa)]:process[_0x279b55(0x1cb)];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x193956){const _0x5c99bd=a141_0x28782b;if(!Number['isInteger'](_0x193956)||_0x193956<=0x0)return![];try{return process[_0x5c99bd(0x1c0)](_0x193956,0x0),!![];}catch{return![];}}function a141_0x3af0(){const _0x129786=['csh','replace','2450088dlmmet','comm','7ApsFeG','fish','kill','24558SsAKBw','\x20-o\x20ppid=,comm=','12249704UyoCzl','unref','14892fYnxkD','1091004WlnLPz','open','pop','elvish','2020mksSMJ','pid','ignore','join','30yIapTc','win32','981998FbnQMa','claude','utf-8','33605bWvoIJ','\x20get\x20ParentProcessId,Name\x20/format:csv','wmic\x20process\x20where\x20ProcessId=','code','filter','ppid','isInteger','trim','powershell','ps\x20-p\x20','bash','platform','pwsh','split','toLowerCase','darwin','ksh','3cyplNy','1491744hTCOZS','cursor','has'];a141_0x3af0=function(){return _0x129786;};return a141_0x3af0();}export function openBrowser(_0x51de3f){const _0x4384fd=a141_0x28782b,_0x301849=process[_0x4384fd(0x1b0)],_0x55c2f2=_0x301849===_0x4384fd(0x1b4)?_0x4384fd(0x1c7):_0x301849===_0x4384fd(0x1a1)?'start':'xdg-open';spawn(_0x55c2f2,[_0x51de3f],{'detached':!![],'stdio':_0x4384fd(0x1cc)})[_0x4384fd(0x1c4)]();}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2bacd3,_0x475539){const _0x21af79=a142_0x9071,_0x3e7d31=_0x2bacd3();while(!![]){try{const _0xcfaa7c=-parseInt(_0x21af79(0x151))/0x1+parseInt(_0x21af79(0x15c))/0x2*(parseInt(_0x21af79(0x154))/0x3)+-parseInt(_0x21af79(0x153))/0x4*(-parseInt(_0x21af79(0x15b))/0x5)+parseInt(_0x21af79(0x15d))/0x6+-parseInt(_0x21af79(0x14f))/0x7+parseInt(_0x21af79(0x158))/0x8+parseInt(_0x21af79(0x15a))/0x9*(parseInt(_0x21af79(0x14d))/0xa);if(_0xcfaa7c===_0x475539)break;else _0x3e7d31['push'](_0x3e7d31['shift']());}catch(_0x3882a3){_0x3e7d31['push'](_0x3e7d31['shift']());}}}(a142_0x54bd,0xc90eb));function a142_0x54bd(){const _0x3d4d5e=['1392745nsjwfQ','toLowerCase','4WfbsXs','921777vqrPnb','\x20(y/N):\x20','setRawMode','setEncoding','7105664tZXCyF','exit','9iSMlqt','946185paAgKS','6JxcUzR','1667166krtnAo','utf8','data','isTTY','resume','stdin','stdout','stderr','question','write','yes','12247330hPgqXr','createInterface','8998780srgfvR','close'];a142_0x54bd=function(){return _0x3d4d5e;};return a142_0x54bd();}function a142_0x9071(_0x4ea67e,_0x5923f0){_0x4ea67e=_0x4ea67e-0x147;const _0x54bd41=a142_0x54bd();let _0x90717b=_0x54bd41[_0x4ea67e];return _0x90717b;}import*as a142_0x17026e from'readline';export async function confirm(_0x4cfbf3){const _0x184d9d=a142_0x9071,_0x456678=a142_0x17026e[_0x184d9d(0x14e)]({'input':process['stdin'],'output':process[_0x184d9d(0x148)]});return new Promise(_0x38c610=>{const _0x4440dc=_0x184d9d;_0x456678[_0x4440dc(0x14a)](_0x4cfbf3+_0x4440dc(0x155),_0x5a01d3=>{const _0x54ac24=_0x4440dc;_0x456678[_0x54ac24(0x150)](),_0x38c610(_0x5a01d3[_0x54ac24(0x152)]()==='y'||_0x5a01d3[_0x54ac24(0x152)]()===_0x54ac24(0x14c));});});}export async function confirmKey(_0xeca9e7){const _0x563918=a142_0x9071;if(!process['stdin'][_0x563918(0x160)])return![];return process['stderr'][_0x563918(0x14b)](_0xeca9e7+'\x20[y/N]\x20'),new Promise(_0xf49ab=>{const _0x71438=_0x563918,_0x329fd8=process[_0x71438(0x147)];_0x329fd8[_0x71438(0x156)](!![]),_0x329fd8[_0x71438(0x161)](),_0x329fd8[_0x71438(0x157)](_0x71438(0x15e));const _0x3b7069=_0x31ded2=>{const _0x120b20=_0x71438;_0x329fd8['setRawMode'](![]),_0x329fd8['pause'](),_0x329fd8['removeListener'](_0x120b20(0x15f),_0x3b7069);if(_0x31ded2==='\x1b'){process[_0x120b20(0x149)][_0x120b20(0x14b)]('\x0a'),_0xf49ab(![]);return;}_0x31ded2==='\x03'&&(process[_0x120b20(0x149)][_0x120b20(0x14b)]('\x0a'),process[_0x120b20(0x159)](0x82));if(_0x31ded2[_0x120b20(0x152)]()==='y'){process[_0x120b20(0x149)][_0x120b20(0x14b)]('y\x0a'),_0xf49ab(!![]);return;}process[_0x120b20(0x149)]['write']('\x0a'),_0xf49ab(![]);};_0x329fd8['on'](_0x71438(0x15f),_0x3b7069);});}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a143_0x365c(_0x4161fa,_0x33a9e3){_0x4161fa=_0x4161fa-0xf8;const _0x4e3c30=a143_0x4e3c();let _0x365c38=_0x4e3c30[_0x4161fa];return _0x365c38;}(function(_0x48d276,_0x3cc525){const _0x2aa33d=a143_0x365c,_0x1c531d=_0x48d276();while(!![]){try{const _0x119870=parseInt(_0x2aa33d(0xfd))/0x1*(parseInt(_0x2aa33d(0x110))/0x2)+-parseInt(_0x2aa33d(0xfe))/0x3+-parseInt(_0x2aa33d(0x107))/0x4+-parseInt(_0x2aa33d(0x101))/0x5+parseInt(_0x2aa33d(0x114))/0x6+-parseInt(_0x2aa33d(0x113))/0x7*(parseInt(_0x2aa33d(0xfa))/0x8)+parseInt(_0x2aa33d(0x108))/0x9*(parseInt(_0x2aa33d(0xfb))/0xa);if(_0x119870===_0x3cc525)break;else _0x1c531d['push'](_0x1c531d['shift']());}catch(_0x492829){_0x1c531d['push'](_0x1c531d['shift']());}}}(a143_0x4e3c,0xf2ea5));import a143_0x1f73a2 from'ora';export function createCommandSpinner(_0x50c9e7,_0x48cf51={}){const _0x43b7f2=a143_0x365c,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0x48cf51;return a143_0x1f73a2({'text':_0x50c9e7,'color':_0x43b7f2(0x10d),'stream':process[_0x43b7f2(0xfc)],'isEnabled':forceEnabled||process['stderr'][_0x43b7f2(0x112)]&&!verbose});}function a143_0x4e3c(){const _0x249e20=['20398041cAJSPI','intervalFactory','start','clock','extra','cyan','text','stop','344362QoIyvr','jobId','isTTY','7hmpxCQ','1077228CjcCwc','toFixed','...','2507896JsrsjY','10htexNn','stderr','6KswYjW','1958223dIalnt','trim','isSpinning','2496180LSKpIO','floor','\x20[Job\x20ID:\x20','now','phase','replace','4074512gmHtGP'];a143_0x4e3c=function(){return _0x249e20;};return a143_0x4e3c();}export async function withSpinner(_0x16273e,_0x1043b4,_0xdb3804={}){const _0x2253d1=a143_0x365c,_0x2bccf6=_0xdb3804[_0x2253d1(0x10b)]??(()=>Date[_0x2253d1(0x104)]()),_0x36ac4=createCommandSpinner(_0x16273e,_0xdb3804);_0x36ac4['start']();const _0xe3c31d=_0x2bccf6();try{const _0x37e4f5=await _0x1043b4(),_0x5e7c5e=_0x2bccf6()-_0xe3c31d;return _0x36ac4[_0x2253d1(0x10f)](),{'data':_0x37e4f5,'elapsedMs':_0x5e7c5e};}catch(_0x5475da){_0x36ac4[_0x2253d1(0x10f)]();throw _0x5475da;}}export async function withProgressSpinner(_0x10836b,_0x3f7006,_0x3fb0ba={}){const _0x429b5e=a143_0x365c,_0x19631e=_0x3fb0ba[_0x429b5e(0x10b)]??(()=>Date['now']()),_0x5bdd00=_0x3fb0ba[_0x429b5e(0x109)]??setInterval,_0x22b3df=createCommandSpinner(_0x10836b,_0x3fb0ba);_0x22b3df[_0x429b5e(0x10a)]();const _0x135d33=_0x19631e(),_0x2b19fc=_0x10836b[_0x429b5e(0x106)](_0x429b5e(0xf9),'')['trim']()||'Processing',_0x22dcb3={};let _0x2b2789=_0x10836b;const _0x3fec57=()=>{const _0x19ffc5=_0x429b5e;if(!_0x22b3df[_0x19ffc5(0x100)])return;const _0x1dc73b=_0x19631e()-_0x135d33,_0x115aac=formatElapsed(_0x1dc73b),_0x21a35d=_0x22dcb3[_0x19ffc5(0x105)]?.[_0x19ffc5(0xff)]()||_0x2b19fc,_0x4052d1=_0x22dcb3[_0x19ffc5(0x111)]?_0x19ffc5(0x103)+_0x22dcb3[_0x19ffc5(0x111)]+']':'',_0x273f21=_0x22dcb3['extra']?'\x20'+_0x22dcb3[_0x19ffc5(0x10c)]:'',_0x328749=_0x21a35d+'\x20'+_0x115aac+_0x273f21+_0x4052d1;_0x328749!==_0x2b2789&&_0x328749[_0x19ffc5(0xff)]()&&(_0x22b3df[_0x19ffc5(0x10e)]=_0x328749,_0x2b2789=_0x328749);},_0x3601cb=_0x5bdd00(()=>{_0x3fec57();},0x3e8),_0x134c57={'setPhase':_0x45791b=>{const _0x20fa05=_0x429b5e;_0x22dcb3[_0x20fa05(0x105)]=_0x45791b;const _0x28349e=_0x45791b?.[_0x20fa05(0xff)]()||_0x2b19fc,_0x2a7fe9=_0x19631e()-_0x135d33,_0x103dc8=formatElapsed(_0x2a7fe9),_0x4cdaaa=_0x22dcb3[_0x20fa05(0x111)]?_0x20fa05(0x103)+_0x22dcb3['jobId']+']':'',_0x40152d=_0x22dcb3[_0x20fa05(0x10c)]?'\x20'+_0x22dcb3[_0x20fa05(0x10c)]:'',_0x1b41ee=_0x28349e+'\x20'+_0x103dc8+_0x40152d+_0x4cdaaa;_0x22b3df[_0x20fa05(0x100)]&&_0x1b41ee['trim']()&&(_0x22b3df[_0x20fa05(0x10e)]=_0x1b41ee,_0x2b2789=_0x1b41ee);},'setJobId':_0x3162e4=>{const _0xc1e0aa=_0x429b5e;_0x22dcb3[_0xc1e0aa(0x111)]=_0x3162e4,_0x3fec57();},'setExtra':_0xcc3094=>{_0x22dcb3['extra']=_0xcc3094,_0x3fec57();}};_0x3fec57();try{const _0x29b9aa=await _0x3f7006(_0x134c57),_0x44a148=_0x19631e()-_0x135d33;return{'data':_0x29b9aa,'elapsedMs':_0x44a148};}finally{clearInterval(_0x3601cb),_0x22b3df['stop']();}}export function formatElapsed(_0x4db64c){const _0x1409d6=a143_0x365c,_0x530ffb=Math[_0x1409d6(0x102)](_0x4db64c/0x3e8);if(_0x530ffb<0x3c)return(_0x4db64c/0x3e8)[_0x1409d6(0xf8)](0x1)+'s';const _0x85a489=Math[_0x1409d6(0x102)](_0x530ffb/0x3c),_0x4af87c=_0x530ffb%0x3c;if(_0x85a489<0x3c)return _0x85a489+'m\x20'+_0x4af87c+'s';const _0x1bd79f=Math[_0x1409d6(0x102)](_0x85a489/0x3c),_0xdcae0d=_0x85a489%0x3c;return _0x1bd79f+'h\x20'+_0xdcae0d+'m';}
|
package/dist/utils/sse-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f6013,_0x297002){const _0x1b9861=a144_0x5853,_0x43b7d8=_0x2f6013();while(!![]){try{const _0x30ffc9=parseInt(_0x1b9861(0x184))/0x1*(-parseInt(_0x1b9861(0x17b))/0x2)+parseInt(_0x1b9861(0x17f))/0x3+parseInt(_0x1b9861(0x185))/0x4*(-parseInt(_0x1b9861(0x189))/0x5)+-parseInt(_0x1b9861(0x191))/0x6+-parseInt(_0x1b9861(0x18a))/0x7*(-parseInt(_0x1b9861(0x17d))/0x8)+-parseInt(_0x1b9861(0x18e))/0x9+parseInt(_0x1b9861(0x183))/0xa;if(_0x30ffc9===_0x297002)break;else _0x43b7d8['push'](_0x43b7d8['shift']());}catch(_0x4f1653){_0x43b7d8['push'](_0x43b7d8['shift']());}}}(a144_0x4840,0x4a295));export async function*parseSSEStream(_0x1b024c,_0x18a253){const _0x3e989b=a144_0x5853;if(!_0x1b024c[_0x3e989b(0x18b)])throw new Error(_0x3e989b(0x17c));const _0x3a414d=_0x1b024c[_0x3e989b(0x18b)][_0x3e989b(0x193)](),_0x422005=new TextDecoder();let _0x8b34a5='',_0xe1cb8b={};try{while(!![]){const {done:_0x25f765,value:_0x55b29a}=await _0x3a414d[_0x3e989b(0x186)]();if(_0x25f765){if(_0xe1cb8b[_0x3e989b(0x17e)]){_0x18a253?.[_0x3e989b(0x190)]('[LLM\x20API\x20SSE]\x20'+_0xe1cb8b[_0x3e989b(0x17e)]);const _0x33528a=parseSSEData(_0xe1cb8b[_0x3e989b(0x17e)]);yield _0x33528a;}break;}_0x8b34a5+=_0x422005[_0x3e989b(0x18c)](_0x55b29a,{'stream':!![]});const _0x209916=_0x8b34a5[_0x3e989b(0x181)]('\x0a');_0x8b34a5=_0x209916[_0x3e989b(0x182)]()||'';for(const _0x4a1ff6 of _0x209916){if(_0x4a1ff6[_0x3e989b(0x18d)]()===''){if(_0xe1cb8b[_0x3e989b(0x17e)]){_0x18a253?.[_0x3e989b(0x190)]('[LLM\x20API\x20SSE]\x20'+_0xe1cb8b[_0x3e989b(0x17e)]);const _0x535517=parseSSEData(_0xe1cb8b[_0x3e989b(0x17e)]);yield _0x535517,_0xe1cb8b={};}continue;}if(_0x4a1ff6[_0x3e989b(0x192)](':'))continue;const _0x493a20=_0x4a1ff6[_0x3e989b(0x18f)](':');if(_0x493a20===-0x1)continue;const _0x3d2df6=_0x4a1ff6[_0x3e989b(0x180)](0x0,_0x493a20);let _0x11e0ef=_0x4a1ff6[_0x3e989b(0x180)](_0x493a20+0x1);_0x11e0ef['startsWith']('\x20')&&(_0x11e0ef=_0x11e0ef[_0x3e989b(0x180)](0x1));switch(_0x3d2df6){case'event':_0xe1cb8b['event']=_0x11e0ef;break;case'data':_0xe1cb8b['data']=_0xe1cb8b[_0x3e989b(0x17e)]?_0xe1cb8b[_0x3e989b(0x17e)]+'\x0a'+_0x11e0ef:_0x11e0ef;break;case'id':_0xe1cb8b['id']=_0x11e0ef;break;}}}}finally{_0x3a414d['releaseLock']();}}function a144_0x5853(_0x4360c0,_0x54e0c2){_0x4360c0=_0x4360c0-0x17b;const _0x4840f8=a144_0x4840();let _0x5853b5=_0x4840f8[_0x4360c0];return _0x5853b5;}function a144_0x4840(){const _0x40d506=['body','decode','trim','3188826vQrlhE','indexOf','debug','950022AFNUVP','startsWith','getReader','198778yyNBib','Response\x20body\x20is\x20null','3022232nYMUzb','data','581673fxEOsL','slice','split','pop','9785170NQGTht','5svlqvD','2124EJXNjX','read','Failed\x20to\x20parse\x20SSE\x20data\x20as\x20JSON:\x20','parse','2230LgPPQH','7Abqoun'];a144_0x4840=function(){return _0x40d506;};return a144_0x4840();}function parseSSEData(_0x456c50){const _0x21f7c9=a144_0x5853;try{return JSON[_0x21f7c9(0x188)](_0x456c50);}catch(_0x30c4e0){throw new Error(_0x21f7c9(0x187)+_0x456c50,{'cause':_0x30c4e0});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3105c3,_0x1ef427){const _0x1ee935=a145_0x27e5,_0x4d91f6=_0x3105c3();while(!![]){try{const _0x2849fd=-parseInt(_0x1ee935(0x88))/0x1*(parseInt(_0x1ee935(0x83))/0x2)+parseInt(_0x1ee935(0x73))/0x3*(-parseInt(_0x1ee935(0x72))/0x4)+-parseInt(_0x1ee935(0x77))/0x5+-parseInt(_0x1ee935(0x81))/0x6+parseInt(_0x1ee935(0x7c))/0x7+parseInt(_0x1ee935(0x6f))/0x8*(parseInt(_0x1ee935(0x70))/0x9)+parseInt(_0x1ee935(0x7e))/0xa*(parseInt(_0x1ee935(0x71))/0xb);if(_0x2849fd===_0x1ef427)break;else _0x4d91f6['push'](_0x4d91f6['shift']());}catch(_0x10b16d){_0x4d91f6['push'](_0x4d91f6['shift']());}}}(a145_0x524a,0xbf030));import a145_0x18b18c from'string-width';export function stringWidth(_0x3f6fcb){return a145_0x18b18c(_0x3f6fcb);}export function padEnd(_0x7377d9,_0x2e38a5){const _0x195e2b=a145_0x27e5,_0x412068=stringWidth(_0x7377d9);if(_0x412068>=_0x2e38a5)return _0x7377d9;return _0x7377d9+'\x20'[_0x195e2b(0x82)](_0x2e38a5-_0x412068);}function a145_0x524a(){const _0x36ed57=['11037410rnFNQL','test','trim','3134010VNNBQr','repeat','6idXzpf','toLowerCase','Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string','\x5c$&','replace','426301xVdjFX','USERNAME','Cannot\x20escape\x20empty\x20string\x20literal','8kvGnyX','13576941YdHtOc','11EkgQUs','1948VCURHM','303AZrcjp','floor','padStart','toString','3971100HhElaJ','random','env','length','substring','5703173OIMCzu','USER'];a145_0x524a=function(){return _0x36ed57;};return a145_0x524a();}export function padStart(_0x27488f,_0x552bf9){const _0x50e30a=stringWidth(_0x27488f);if(_0x50e30a>=_0x552bf9)return _0x27488f;return'\x20'['repeat'](_0x552bf9-_0x50e30a)+_0x27488f;}function a145_0x27e5(_0x25b109,_0x204b0b){_0x25b109=_0x25b109-0x6e;const _0x524aaa=a145_0x524a();let _0x27e58e=_0x524aaa[_0x25b109];return _0x27e58e;}export function centerAlign(_0x2cd61f,_0x260b81){const _0x654e64=a145_0x27e5,_0x5ec9e7=stringWidth(_0x2cd61f);if(_0x5ec9e7>_0x260b81){if(_0x260b81<=0x1)return'…'[_0x654e64(0x7b)](0x0,_0x260b81);let _0x488a68=_0x2cd61f;while(stringWidth(_0x488a68+'…')>_0x260b81){_0x488a68=_0x488a68['slice'](0x0,-0x1);}return _0x488a68+'…';}if(_0x5ec9e7===_0x260b81)return _0x2cd61f;const _0x2af631=_0x260b81-_0x5ec9e7,_0x1c2478=Math[_0x654e64(0x74)](_0x2af631/0x2),_0x3647b9=_0x2af631-_0x1c2478;return'\x20'['repeat'](_0x1c2478)+_0x2cd61f+'\x20'[_0x654e64(0x82)](_0x3647b9);}export function escapeStringLiteral(_0x342bf4){const _0x5918d5=a145_0x27e5;if(!_0x342bf4||_0x342bf4[_0x5918d5(0x80)]()[_0x5918d5(0x7a)]===0x0)throw new Error(_0x5918d5(0x6e));const _0x502eac=_0x342bf4[_0x5918d5(0x87)](/'/g,'\x27\x27');return'\x27'+_0x502eac+'\x27';}export function globToLike(_0x4da3d9){const _0x20475c=a145_0x27e5;let _0x3e2982=_0x4da3d9['replace'](/\\/g,'\x5c\x5c')[_0x20475c(0x87)](/%/g,'\x5c%')[_0x20475c(0x87)](/_/g,'\x5c_');return _0x3e2982=_0x3e2982[_0x20475c(0x87)](/\*/g,'%')['replace'](/\?/g,'_'),_0x3e2982;}export function buildLikePattern(_0x2d1582){const _0xe0fc8b=a145_0x27e5;if(!_0x2d1582||_0x2d1582[_0xe0fc8b(0x80)]()[_0xe0fc8b(0x7a)]===0x0)throw new Error(_0xe0fc8b(0x85));const _0xedfbe9=globToLike(_0x2d1582),_0x411d83=_0xedfbe9[_0xe0fc8b(0x87)](/'/g,'\x27\x27');return'\x27'+_0x411d83+'\x27';}export function matchGlobPattern(_0x15b95a,_0x5c6d8b){const _0xdc6b4e=a145_0x27e5,_0x54fb5b=_0x5c6d8b[_0xdc6b4e(0x87)](/[.+^${}()|[\]\\]/g,_0xdc6b4e(0x86))[_0xdc6b4e(0x87)](/\*/g,'.*')[_0xdc6b4e(0x87)](/\?/g,'.'),_0x43aefe=new RegExp('^'+_0x54fb5b+'$');return _0x43aefe[_0xdc6b4e(0x7f)](_0x15b95a);}export function getSanitizedUsername(){const _0x155ff9=a145_0x27e5,_0x37a1c0=process[_0x155ff9(0x79)][_0x155ff9(0x7d)]||process[_0x155ff9(0x79)][_0x155ff9(0x89)]||'unknown';return _0x37a1c0['replace'](/[^a-zA-Z0-9]/g,'')['toLowerCase']();}export function generateRandomHex(){const _0x33f463=a145_0x27e5,_0x365200=Math[_0x33f463(0x74)](Math[_0x33f463(0x78)]()*0xfffff);return _0x365200[_0x33f463(0x76)](0x10)[_0x33f463(0x75)](0x5,'0');}export function sanitizeFileName(_0x5c9717){const _0x28deb4=a145_0x27e5;return _0x5c9717[_0x28deb4(0x84)]()[_0x28deb4(0x87)](/[/\\:*?"<>|]/g,'-')['replace'](/\s+/g,'-')[_0x28deb4(0x87)](/-+/g,'-')[_0x28deb4(0x87)](/^-|-$/g,'');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e1bdf,_0x2c63a0){const _0x50cfce=a146_0x101c,_0x5926e1=_0x1e1bdf();while(!![]){try{const _0x390d8a=-parseInt(_0x50cfce(0x1e8))/0x1+parseInt(_0x50cfce(0x1e2))/0x2*(-parseInt(_0x50cfce(0x1ee))/0x3)+-parseInt(_0x50cfce(0x1da))/0x4+parseInt(_0x50cfce(0x1ef))/0x5*(-parseInt(_0x50cfce(0x1f3))/0x6)+parseInt(_0x50cfce(0x1e4))/0x7*(parseInt(_0x50cfce(0x1e5))/0x8)+-parseInt(_0x50cfce(0x1e0))/0x9+-parseInt(_0x50cfce(0x1ea))/0xa*(-parseInt(_0x50cfce(0x1db))/0xb);if(_0x390d8a===_0x2c63a0)break;else _0x5926e1['push'](_0x5926e1['shift']());}catch(_0x4f37ec){_0x5926e1['push'](_0x5926e1['shift']());}}}(a146_0x1136,0x28eca));function hasWildcard(_0x3f108f){const _0x3ab05f=a146_0x101c;return _0x3f108f[_0x3ab05f(0x1ed)]('*')||_0x3f108f[_0x3ab05f(0x1ed)]('?');}function a146_0x1136(){const _0x2eaf05=['954588kcGFIV','3938HsvQbc','Table\x20name\x20is\x20required\x20for\x20describe\x20operation','Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation','Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','push','613638oFjhKt','join','3562AOBOcj','Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)','105049knHxNY','168rKXNMQ','split','table','302584CHeSYA','catalog','24010ViwoCg','Pattern\x20cannot\x20be\x20just\x20a\x20dot','trim','includes','369yWXRtk','5Gclhgm','length','Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','database','1071618jXAYcb','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only'];a146_0x1136=function(){return _0x2eaf05;};return a146_0x1136();}export function parseTableReference(_0x16c55c){const _0x17936e=a146_0x101c;if(!_0x16c55c||_0x16c55c['trim']()[_0x17936e(0x1f0)]===0x0)throw new Error(_0x17936e(0x1d9));const _0x3a5d69=_0x16c55c[_0x17936e(0x1ec)](),_0x5d6e52={'original':_0x3a5d69},_0x1348aa=_0x3a5d69[_0x17936e(0x1e6)]('.');if(_0x1348aa['length']===0x1){const _0x22db9a=_0x1348aa[0x0];if(!_0x22db9a)throw new Error(_0x17936e(0x1eb));_0x5d6e52[_0x17936e(0x1e7)]=_0x22db9a;}else{if(_0x1348aa[_0x17936e(0x1f0)]===0x2){const [_0x4f17ca,_0x3dc9fb]=_0x1348aa;if(!_0x4f17ca)throw new Error(_0x17936e(0x1de));if(!_0x3dc9fb)throw new Error(_0x17936e(0x1e3));_0x5d6e52[_0x17936e(0x1f2)]=_0x4f17ca,_0x5d6e52[_0x17936e(0x1e7)]=_0x3dc9fb;}else{if(_0x1348aa[_0x17936e(0x1f0)]===0x3){const [_0x2968f1,_0x2bd498,_0x25a6c3]=_0x1348aa;if(!_0x2968f1||!_0x2bd498||!_0x25a6c3)throw new Error('Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty');_0x5d6e52['catalog']=_0x2968f1,_0x5d6e52['database']=_0x2bd498,_0x5d6e52[_0x17936e(0x1e7)]=_0x25a6c3;}else throw new Error(_0x17936e(0x1f1));}}return _0x5d6e52;}export function formatTableReference(_0x3accc0){const _0x550a92=a146_0x101c,_0x6c6120=[];return _0x3accc0['catalog']&&_0x6c6120[_0x550a92(0x1df)](_0x3accc0[_0x550a92(0x1e9)]),_0x3accc0[_0x550a92(0x1f2)]&&_0x6c6120['push'](_0x3accc0[_0x550a92(0x1f2)]),_0x3accc0[_0x550a92(0x1e7)]&&_0x6c6120[_0x550a92(0x1df)](_0x3accc0[_0x550a92(0x1e7)]),_0x6c6120[_0x550a92(0x1e1)]('.');}function a146_0x101c(_0x2a8093,_0x51ecbe){_0x2a8093=_0x2a8093-0x1d9;const _0x11363a=a146_0x1136();let _0x101c36=_0x11363a[_0x2a8093];return _0x101c36;}export function validateTableListReference(_0x365f1a){return undefined;}export function validateTableDescribeReference(_0x44a6c4){const _0x121f65=a146_0x101c;if(!_0x44a6c4[_0x121f65(0x1e7)])return _0x121f65(0x1dc);if(_0x44a6c4[_0x121f65(0x1f2)]&&hasWildcard(_0x44a6c4[_0x121f65(0x1f2)]))return _0x121f65(0x1dd);if(hasWildcard(_0x44a6c4[_0x121f65(0x1e7)]))return'Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation';return undefined;}
|
package/dist/utils/tdx-logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a147_0x20f31f=a147_0x3b5e;(function(_0x4b4bb1,_0x3d8de7){const _0x42571c=a147_0x3b5e,_0x4a70de=_0x4b4bb1();while(!![]){try{const _0x26d703=-parseInt(_0x42571c(0x218))/0x1*(parseInt(_0x42571c(0x1fc))/0x2)+-parseInt(_0x42571c(0x1dd))/0x3*(parseInt(_0x42571c(0x219))/0x4)+-parseInt(_0x42571c(0x208))/0x5+-parseInt(_0x42571c(0x1f1))/0x6*(-parseInt(_0x42571c(0x200))/0x7)+-parseInt(_0x42571c(0x217))/0x8+parseInt(_0x42571c(0x1f5))/0x9+parseInt(_0x42571c(0x1ff))/0xa*(parseInt(_0x42571c(0x1ee))/0xb);if(_0x26d703===_0x3d8de7)break;else _0x4a70de['push'](_0x4a70de['shift']());}catch(_0xacc69e){_0x4a70de['push'](_0x4a70de['shift']());}}}(a147_0x53f2,0x3978b));import{createWriteStream,createReadStream}from'fs';import{mkdir,readdir,unlink,stat,rename}from'fs/promises';function a147_0x3b5e(_0x446198,_0x51860b){_0x446198=_0x446198-0x1dd;const _0x53f217=a147_0x53f2();let _0x3b5eb1=_0x53f217[_0x446198];return _0x3b5eb1;}import{join}from'path';import{homedir}from'os';import{createGzip}from'zlib';import{pipeline}from'stream/promises';import a147_0x58826e from'chalk';function safeStringify(_0x446b87){const _0x10ff38=a147_0x3b5e;if(typeof _0x446b87===_0x10ff38(0x1e3))return _0x446b87;if(_0x446b87 instanceof Error)return _0x446b87[_0x10ff38(0x1de)]||_0x446b87['name']+':\x20'+_0x446b87['message'];try{return JSON[_0x10ff38(0x1e6)](_0x446b87,(_0x521a0c,_0x5b3b30)=>{const _0x324ef6=_0x10ff38;if(_0x5b3b30 instanceof Error)return{'name':_0x5b3b30[_0x324ef6(0x1eb)],'message':_0x5b3b30[_0x324ef6(0x1e9)],'stack':_0x5b3b30[_0x324ef6(0x1de)],'cause':_0x5b3b30[_0x324ef6(0x1fd)]};return _0x5b3b30;});}catch{return String(_0x446b87);}}function getTimezoneOffset(){const _0x51be94=a147_0x3b5e,_0x1d6ce9=-new Date()['getTimezoneOffset'](),_0x28a5cd=Math[_0x51be94(0x21a)](Math[_0x51be94(0x213)](_0x1d6ce9)/0x3c),_0x3b79c4=Math[_0x51be94(0x213)](_0x1d6ce9)%0x3c,_0xab3465=_0x1d6ce9>=0x0?'+':'-';return''+_0xab3465+_0x28a5cd[_0x51be94(0x215)]()[_0x51be94(0x203)](0x2,'0')+_0x3b79c4[_0x51be94(0x215)]()[_0x51be94(0x203)](0x2,'0');}function formatTimestamp(){const _0x314a0b=a147_0x3b5e,_0x2bde13=new Date(),_0x47b996=_0x2bde13['getFullYear'](),_0x52aeae=(_0x2bde13[_0x314a0b(0x1e0)]()+0x1)[_0x314a0b(0x215)]()['padStart'](0x2,'0'),_0x23a70c=_0x2bde13[_0x314a0b(0x206)]()[_0x314a0b(0x215)]()[_0x314a0b(0x203)](0x2,'0'),_0x8f36ad=_0x2bde13[_0x314a0b(0x20f)]()[_0x314a0b(0x215)]()['padStart'](0x2,'0'),_0x161071=_0x2bde13[_0x314a0b(0x209)]()[_0x314a0b(0x215)]()[_0x314a0b(0x203)](0x2,'0'),_0x37758d=_0x2bde13[_0x314a0b(0x20e)]()[_0x314a0b(0x215)]()[_0x314a0b(0x203)](0x2,'0'),_0x433c9a=_0x2bde13[_0x314a0b(0x1e4)]()[_0x314a0b(0x215)]()[_0x314a0b(0x203)](0x3,'0'),_0x8f45e0=getTimezoneOffset();return _0x47b996+'-'+_0x52aeae+'-'+_0x23a70c+'\x20'+_0x8f36ad+':'+_0x161071+':'+_0x37758d+'.'+_0x433c9a+_0x8f45e0;}function formatColoredLogEntry(_0x530992,_0x2049ca){const _0x39356e=a147_0x3b5e,_0x1a2327=formatTimestamp(),_0x194e7e=_0x2049ca[_0x39356e(0x1df)](safeStringify)[_0x39356e(0x1f9)]('\x20'),_0x261632=a147_0x58826e['gray'](_0x1a2327);let _0x4aa7cc;switch(_0x530992){case _0x39356e(0x1ec):_0x4aa7cc=a147_0x58826e['cyan']('['+_0x530992+']\x20');break;case'warn':_0x4aa7cc=a147_0x58826e[_0x39356e(0x20b)]('['+_0x530992+']\x20');break;case'error':_0x4aa7cc=a147_0x58826e['red']('['+_0x530992+']');break;case _0x39356e(0x1f6):_0x4aa7cc=a147_0x58826e['gray']('['+_0x530992+']');break;default:_0x4aa7cc='['+_0x530992+']';}return _0x261632+'\x20'+_0x4aa7cc+'\x20'+_0x194e7e;}export var LogLevel;(function(_0x57fd69){const _0x54e4ca=a147_0x3b5e;_0x57fd69[_0x57fd69[_0x54e4ca(0x1f2)]=-0x2]=_0x54e4ca(0x1f2),_0x57fd69[_0x57fd69[_0x54e4ca(0x1ea)]=-0x1]=_0x54e4ca(0x1ea),_0x57fd69[_0x57fd69['INFO']=0x0]=_0x54e4ca(0x1f8),_0x57fd69[_0x57fd69[_0x54e4ca(0x1fe)]=0x1]=_0x54e4ca(0x1fe),_0x57fd69[_0x57fd69[_0x54e4ca(0x1ef)]=0x2]=_0x54e4ca(0x1ef);}(LogLevel||(LogLevel={})));function a147_0x53f2(){const _0x4d1b61=['getSeconds','getHours','warn','init','close','abs','Proxy\x20session\x20ended','toString','split','2155200hRUVaG','35282xIhdQe','16cbkqlu','floor','267798PPRNlC','stack','map','getMonth','tdx.log','toISOString','string','getMilliseconds','Warning:\x20Failed\x20to\x20compress\x20','stringify','write','tdx','message','DEBUG','name','info','test','38742HOIpap','ERROR','logStream','1324926lXyPUw','TRACE','fileOnly','logs','1113048MezKWa','debug','end','INFO','join','logLevel','rotateOldLogs','4HEtEFy','cause','WARN','1810MclfgA','14ombtzY','Warning:\x20Error\x20writing\x20to\x20tdx.log:','error','padStart','mtime','logDir','getDate','.cache','1351825VuZKjC','getMinutes','trace','yellow','Warning:\x20Failed\x20to\x20initialize\x20log\x20files:','filter'];a147_0x53f2=function(){return _0x4d1b61;};return a147_0x53f2();}export class TDXLogger{[a147_0x20f31f(0x1f0)];[a147_0x20f31f(0x205)];[a147_0x20f31f(0x1fa)];[a147_0x20f31f(0x1f3)];constructor(_0x475435=LogLevel['INFO'],_0x5d3956=![]){const _0x5e3376=a147_0x20f31f;this['logDir']=join(homedir(),_0x5e3376(0x207),_0x5e3376(0x1e8),_0x5e3376(0x1f4)),this[_0x5e3376(0x1fa)]=_0x475435,this[_0x5e3376(0x1f3)]=_0x5d3956;}async[a147_0x20f31f(0x211)](){const _0x454b82=a147_0x20f31f;try{await mkdir(this['logDir'],{'recursive':!![]}),await this[_0x454b82(0x1fb)]();const _0x541da3=join(this['logDir'],_0x454b82(0x1e1));this[_0x454b82(0x1f0)]=createWriteStream(_0x541da3,{'flags':'a'}),this['logStream']['on'](_0x454b82(0x202),_0x59e337=>{const _0x784509=_0x454b82;console['error'](_0x784509(0x201),_0x59e337[_0x784509(0x1e9)]);});}catch(_0x53f293){console[_0x454b82(0x202)](_0x454b82(0x20c),_0x53f293);}}async[a147_0x20f31f(0x1fb)](){const _0x241559=a147_0x20f31f;try{const _0x446b2f=await readdir(this[_0x241559(0x205)]),_0x35fef3=new Date()[_0x241559(0x1e2)]()[_0x241559(0x216)]('T')[0x0];if(_0x446b2f['includes'](_0x241559(0x1e1))){const _0xfccd86=join(this[_0x241559(0x205)],_0x241559(0x1e1)),_0x519b48=await stat(_0xfccd86),_0x314d6e=new Date(_0x519b48[_0x241559(0x204)])['toISOString']()[_0x241559(0x216)]('T')[0x0];if(_0x314d6e<_0x35fef3){const _0xc2f982=join(this[_0x241559(0x205)],'tdx-'+_0x314d6e+'.log');await rename(_0xfccd86,_0xc2f982);}}const _0x25f15e=await readdir(this[_0x241559(0x205)]),_0x4b8c97=/^tdx-(\d{4}-\d{2}-\d{2})\.log$/,_0x629b8f=_0x25f15e[_0x241559(0x20d)](_0x75ef2=>_0x4b8c97[_0x241559(0x1ed)](_0x75ef2));for(const _0x24e2b4 of _0x629b8f){const _0x4f4d82=join(this[_0x241559(0x205)],_0x24e2b4),_0x40ae3e=join(this['logDir'],_0x24e2b4+'.gz');try{await pipeline(createReadStream(_0x4f4d82),createGzip(),createWriteStream(_0x40ae3e)),await unlink(_0x4f4d82);}catch(_0x1939c8){console['error'](_0x241559(0x1e5)+_0x24e2b4+':',_0x1939c8);}}}catch{}}[a147_0x20f31f(0x1f6)](..._0x32c585){const _0x440fff=a147_0x20f31f;if(this['logLevel']>LogLevel['DEBUG'])return;const _0x274074=formatColoredLogEntry(_0x440fff(0x1f6),_0x32c585);this[_0x440fff(0x1f0)]?.[_0x440fff(0x1e7)](_0x274074+'\x0a');}['trace'](..._0x428961){const _0x55abcf=a147_0x20f31f;if(this[_0x55abcf(0x1fa)]>LogLevel[_0x55abcf(0x1f2)])return;const _0x3b2272=formatColoredLogEntry(_0x55abcf(0x20a),_0x428961);this[_0x55abcf(0x1f0)]?.['write'](_0x3b2272+'\x0a');}[a147_0x20f31f(0x1ec)](..._0x28ebfe){const _0x4a81c6=a147_0x20f31f;if(this[_0x4a81c6(0x1fa)]>LogLevel[_0x4a81c6(0x1f8)])return;const _0x233c99=formatColoredLogEntry('info',_0x28ebfe);!this[_0x4a81c6(0x1f3)]&&console['log'](_0x233c99),this[_0x4a81c6(0x1f0)]?.['write'](_0x233c99+'\x0a');}['warn'](..._0x3d964b){const _0x1e23c9=a147_0x20f31f;if(this[_0x1e23c9(0x1fa)]>LogLevel[_0x1e23c9(0x1fe)])return;const _0x2e3820=formatColoredLogEntry(_0x1e23c9(0x210),_0x3d964b);!this[_0x1e23c9(0x1f3)]&&console[_0x1e23c9(0x202)](_0x2e3820),this['logStream']?.[_0x1e23c9(0x1e7)](_0x2e3820+'\x0a');}[a147_0x20f31f(0x202)](..._0x4aa749){const _0xec8edf=a147_0x20f31f,_0x4af7d8=formatColoredLogEntry(_0xec8edf(0x202),_0x4aa749);!this[_0xec8edf(0x1f3)]&&console[_0xec8edf(0x202)](_0x4af7d8),this['logStream']?.['write'](_0x4af7d8+'\x0a');}async[a147_0x20f31f(0x212)](){const _0xc7e196=a147_0x20f31f;return this[_0xc7e196(0x1ec)](_0xc7e196(0x214)),new Promise(_0x5f0719=>{const _0x411ce2=_0xc7e196;this['logStream']?this[_0x411ce2(0x1f0)][_0x411ce2(0x1f7)](()=>{_0x5f0719();}):_0x5f0719();});}['getLogPath'](){const _0x1f03b5=a147_0x20f31f;return join(this[_0x1f03b5(0x205)],'tdx.log');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a148_0x18b3(){const _0x562c3e=['cyan','env','1257310GdzHqL','lastCheck','https://registry.npmjs.org/@treasuredata/tdx/latest','Run:','currentVersion','\x0aRun:\x20','1176232CvTNpN','3190DXnfZC','90156ToPxUY','\x0aUpdate\x20available:\x20','dim','6nlHhgg','toISOString','NO_COLOR','getTime','parse','1561hclJKw','gray','now','error','write','Request\x20timeout','stderr','end','version','167BpnPkS','statusCode','npm\x20install\x20-g\x20@treasuredata/tdx@latest','232036xWMQEM','green','1338470wJiwwc','destroy','22mkVPHd','utf-8','stringify','7818fUIffW','HTTP\x20','isTTY','9OOXyTn','latestVersion','yellow'];a148_0x18b3=function(){return _0x562c3e;};return a148_0x18b3();}const a148_0x4df31e=a148_0x1d81;(function(_0x22c5a7,_0x54e1b4){const _0x696e82=a148_0x1d81,_0x33fc51=_0x22c5a7();while(!![]){try{const _0x347702=parseInt(_0x696e82(0x79))/0x1*(-parseInt(_0x696e82(0x92))/0x2)+parseInt(_0x696e82(0x6b))/0x3*(parseInt(_0x696e82(0x7c))/0x4)+-parseInt(_0x696e82(0x8b))/0x5+parseInt(_0x696e82(0x83))/0x6*(parseInt(_0x696e82(0x70))/0x7)+-parseInt(_0x696e82(0x91))/0x8*(-parseInt(_0x696e82(0x86))/0x9)+parseInt(_0x696e82(0x7e))/0xa+parseInt(_0x696e82(0x80))/0xb*(-parseInt(_0x696e82(0x93))/0xc);if(_0x347702===_0x54e1b4)break;else _0x33fc51['push'](_0x33fc51['shift']());}catch(_0x406f15){_0x33fc51['push'](_0x33fc51['shift']());}}}(a148_0x18b3,0x25bf2));import{get}from'https';import{readFileSync,writeFileSync,mkdirSync}from'fs';import{join}from'path';import{gt,valid}from'semver';import a148_0x3ee7db from'chalk';import{getCacheDir}from'../core/config.js';const CACHE_DURATION_MS=0x18*0x3c*0x3c*0x3e8,NPM_REGISTRY_URL=a148_0x4df31e(0x8d),TIMEOUT_MS=0x7d0;function getCacheFilePath(){const _0x33c436=getCacheDir();return join(_0x33c436,'last_version_check');}function readCache(){const _0x4152dc=a148_0x4df31e;try{const _0x338cf9=getCacheFilePath(),_0x268160=readFileSync(_0x338cf9,_0x4152dc(0x81));return JSON[_0x4152dc(0x6f)](_0x268160);}catch{return null;}}function writeCache(_0x4966e6){const _0x4cc182=a148_0x4df31e;try{const _0x46e4f1=getCacheDir();mkdirSync(_0x46e4f1,{'recursive':!![]});const _0x517ad9={'lastCheck':new Date()[_0x4cc182(0x6c)](),'latestVersion':_0x4966e6},_0xa852fd=getCacheFilePath();writeFileSync(_0xa852fd,JSON[_0x4cc182(0x82)](_0x517ad9,null,0x2),'utf-8');}catch{}}function isCacheValid(_0x172f22){const _0x12ac01=a148_0x4df31e;if(!_0x172f22)return![];const _0x527582=new Date(_0x172f22[_0x12ac01(0x8c)])[_0x12ac01(0x6e)](),_0x5c0b23=Date[_0x12ac01(0x72)]();return _0x5c0b23-_0x527582<CACHE_DURATION_MS;}function fetchLatestVersion(){return new Promise((_0x2739e8,_0x1ea47f)=>{const _0x31718b=a148_0x1d81,_0xbf0f81=get(NPM_REGISTRY_URL,_0x546678=>{const _0x2a9c9b=a148_0x1d81;if(_0x546678[_0x2a9c9b(0x7a)]!==0xc8){clearTimeout(_0x74a747),_0x1ea47f(new Error(_0x2a9c9b(0x84)+_0x546678[_0x2a9c9b(0x7a)]));return;}let _0x250aef='';_0x546678['on']('data',_0x2c5014=>{_0x250aef+=_0x2c5014;}),_0x546678['on'](_0x2a9c9b(0x77),()=>{const _0x50088f=_0x2a9c9b;clearTimeout(_0x74a747);try{const _0x469dab=JSON['parse'](_0x250aef);if(!valid(_0x469dab[_0x50088f(0x78)])){_0x1ea47f(new Error('Invalid\x20version\x20format'));return;}_0x2739e8(_0x469dab[_0x50088f(0x78)]);}catch(_0x1f619e){_0x1ea47f(_0x1f619e);}});})['on'](_0x31718b(0x73),_0x55b223=>{clearTimeout(_0x74a747),_0x1ea47f(_0x55b223);}),_0x74a747=setTimeout(()=>{const _0x4b541e=_0x31718b;_0xbf0f81[_0x4b541e(0x7f)](),_0x1ea47f(new Error(_0x4b541e(0x75)));},TIMEOUT_MS);});}export async function checkForUpdate(_0x1795e1){const _0x34d124=a148_0x4df31e;try{const _0x2d5f5e=readCache();if(isCacheValid(_0x2d5f5e)){const _0x23529d=gt(_0x2d5f5e['latestVersion'],_0x1795e1);return{'updateAvailable':_0x23529d,'currentVersion':_0x1795e1,'latestVersion':_0x2d5f5e[_0x34d124(0x87)]};}const _0x25a807=await fetchLatestVersion();writeCache(_0x25a807);const _0x4d90a0=gt(_0x25a807,_0x1795e1);return{'updateAvailable':_0x4d90a0,'currentVersion':_0x1795e1,'latestVersion':_0x25a807};}catch{return null;}}function a148_0x1d81(_0x17467f,_0x14c951){_0x17467f=_0x17467f-0x6a;const _0x18b349=a148_0x18b3();let _0x1d81bc=_0x18b349[_0x17467f];return _0x1d81bc;}export function displayUpdateNotification(_0x4f742d){const _0x17ebf7=a148_0x4df31e;if(!_0x4f742d['updateAvailable'])return;const _0x5de70c=process[_0x17ebf7(0x76)][_0x17ebf7(0x85)]&&!process[_0x17ebf7(0x8a)][_0x17ebf7(0x6d)],_0x50df7a=_0x5de70c?a148_0x3ee7db[_0x17ebf7(0x71)]('→'):'→',_0x16853c=_0x5de70c?a148_0x3ee7db[_0x17ebf7(0x6a)](_0x4f742d['currentVersion']):_0x4f742d[_0x17ebf7(0x8f)],_0x3e3765=_0x5de70c?a148_0x3ee7db[_0x17ebf7(0x7d)](_0x4f742d[_0x17ebf7(0x87)]):_0x4f742d['latestVersion'],_0x5bebfc=_0x5de70c?a148_0x3ee7db[_0x17ebf7(0x89)](_0x17ebf7(0x7b)):_0x17ebf7(0x7b),_0x127298=_0x5de70c?'\x0a'+a148_0x3ee7db[_0x17ebf7(0x88)]('Update\x20available:')+'\x20'+_0x16853c+'\x20'+_0x50df7a+'\x20'+_0x3e3765+'\x0a'+a148_0x3ee7db[_0x17ebf7(0x6a)](_0x17ebf7(0x8e))+'\x20'+_0x5bebfc+'\x0a':_0x17ebf7(0x94)+_0x16853c+'\x20'+_0x50df7a+'\x20'+_0x3e3765+_0x17ebf7(0x90)+_0x5bebfc+'\x0a';process['stderr'][_0x17ebf7(0x74)](_0x127298);}
|