@treasuredata/tdx 0.10.0 → 0.10.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 +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +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.js +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.js +1 -1
- package/dist/core/keychain.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/core/user-cache.js +1 -1
- 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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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/push-workflow.js.map +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/cdp.d.ts +5 -2
- package/dist/sdk/types/cdp.d.ts.map +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/index.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
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1c5db1,_0x385de6){const _0x40f7e3=a141_0x1ac3,_0x4393cf=_0x1c5db1();while(!![]){try{const _0x36f6bc=-parseInt(_0x40f7e3(0x1e7))/0x1+parseInt(_0x40f7e3(0x1ec))/0x2+parseInt(_0x40f7e3(0x1e0))/0x3+-parseInt(_0x40f7e3(0x1e4))/0x4+parseInt(_0x40f7e3(0x1ea))/0x5+parseInt(_0x40f7e3(0x1e3))/0x6+-parseInt(_0x40f7e3(0x1f1))/0x7;if(_0x36f6bc===_0x385de6)break;else _0x4393cf['push'](_0x4393cf['shift']());}catch(_0x25cf43){_0x4393cf['push'](_0x4393cf['shift']());}}}(a141_0x4179,0xe86b6));function hasWildcard(_0x26f2c){const _0x2fb975=a141_0x1ac3;return _0x26f2c[_0x2fb975(0x1eb)]('*')||_0x26f2c[_0x2fb975(0x1eb)]('?');}export function parseTableReference(_0x3ae680){const _0x4ce39d=a141_0x1ac3;if(!_0x3ae680||_0x3ae680[_0x4ce39d(0x1f4)]()[_0x4ce39d(0x1e2)]===0x0)throw new Error('Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only');const _0x1cda35=_0x3ae680[_0x4ce39d(0x1f4)](),_0x34178b={'original':_0x1cda35},_0x2e1211=_0x1cda35['split']('.');if(_0x2e1211[_0x4ce39d(0x1e2)]===0x1){const _0x349914=_0x2e1211[0x0];if(!_0x349914)throw new Error('Pattern\x20cannot\x20be\x20just\x20a\x20dot');_0x34178b[_0x4ce39d(0x1e5)]=_0x349914;}else{if(_0x2e1211[_0x4ce39d(0x1e2)]===0x2){const [_0x51e6af,_0x3e247f]=_0x2e1211;if(!_0x51e6af)throw new Error(_0x4ce39d(0x1f0));if(!_0x3e247f)throw new Error('Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)');_0x34178b[_0x4ce39d(0x1f3)]=_0x51e6af,_0x34178b[_0x4ce39d(0x1e5)]=_0x3e247f;}else{if(_0x2e1211['length']===0x3){const [_0x361a86,_0x158d61,_0x49b3a4]=_0x2e1211;if(!_0x361a86||!_0x158d61||!_0x49b3a4)throw new Error(_0x4ce39d(0x1e6));_0x34178b['catalog']=_0x361a86,_0x34178b[_0x4ce39d(0x1f3)]=_0x158d61,_0x34178b[_0x4ce39d(0x1e5)]=_0x49b3a4;}else throw new Error(_0x4ce39d(0x1ef));}}return _0x34178b;}export function formatTableReference(_0x2cf01f){const _0x117e72=a141_0x1ac3,_0x140b4=[];return _0x2cf01f[_0x117e72(0x1ee)]&&_0x140b4['push'](_0x2cf01f['catalog']),_0x2cf01f[_0x117e72(0x1f3)]&&_0x140b4[_0x117e72(0x1e1)](_0x2cf01f[_0x117e72(0x1f3)]),_0x2cf01f[_0x117e72(0x1e5)]&&_0x140b4[_0x117e72(0x1e1)](_0x2cf01f[_0x117e72(0x1e5)]),_0x140b4[_0x117e72(0x1e9)]('.');}function a141_0x4179(){const _0x57c481=['2057781UEGLkU','push','length','7949526tLBdKS','1210852gkfUvN','table','Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty','1019230mJMkrT','Table\x20name\x20is\x20required\x20for\x20describe\x20operation','join','6011700VNtlxd','includes','2399954vbPNWk','Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation','catalog','Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','14974624UflOHR','Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation','database','trim'];a141_0x4179=function(){return _0x57c481;};return a141_0x4179();}export function validateTableListReference(_0x1961a2){return undefined;}function a141_0x1ac3(_0x26180a,_0x5a762a){_0x26180a=_0x26180a-0x1e0;const _0x41794f=a141_0x4179();let _0x1ac309=_0x41794f[_0x26180a];return _0x1ac309;}export function validateTableDescribeReference(_0x452794){const _0x3c3aaf=a141_0x1ac3;if(!_0x452794[_0x3c3aaf(0x1e5)])return _0x3c3aaf(0x1e8);if(_0x452794[_0x3c3aaf(0x1f3)]&&hasWildcard(_0x452794[_0x3c3aaf(0x1f3)]))return _0x3c3aaf(0x1f2);if(hasWildcard(_0x452794[_0x3c3aaf(0x1e5)]))return _0x3c3aaf(0x1ed);return undefined;}
|
package/dist/utils/tdx-logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a142_0x3cf6d5=a142_0x5efc;(function(_0x5bd6ac,_0x4c8d34){const _0x3ab43a=a142_0x5efc,_0x956de7=_0x5bd6ac();while(!![]){try{const _0x506448=-parseInt(_0x3ab43a(0xec))/0x1+parseInt(_0x3ab43a(0xea))/0x2+parseInt(_0x3ab43a(0xfc))/0x3+parseInt(_0x3ab43a(0xfd))/0x4*(parseInt(_0x3ab43a(0xf9))/0x5)+-parseInt(_0x3ab43a(0xf4))/0x6*(parseInt(_0x3ab43a(0x107))/0x7)+-parseInt(_0x3ab43a(0xf6))/0x8*(-parseInt(_0x3ab43a(0xd7))/0x9)+-parseInt(_0x3ab43a(0xd3))/0xa*(-parseInt(_0x3ab43a(0xe5))/0xb);if(_0x506448===_0x4c8d34)break;else _0x956de7['push'](_0x956de7['shift']());}catch(_0x4f09a6){_0x956de7['push'](_0x956de7['shift']());}}}(a142_0xe199,0xe1974));import{createWriteStream,createReadStream}from'fs';import{mkdir,readdir,unlink,stat,rename}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createGzip}from'zlib';import{pipeline}from'stream/promises';function a142_0xe199(){const _0x582787=['DEBUG','tdx.log','WARN','7iQbERp','write','cause','.log','.cache','rotateOldLogs','stack','getDate','logs','warn','10uAPBPh','close','toString','getLogPath','1259001zUNTnH','split','debug','getSeconds','gray','info','padStart','abs','map','end','Proxy\x20session\x20ended','Warning:\x20Error\x20writing\x20to\x20tdx.log:','getHours','toISOString','2215917xOguYX','INFO','stringify','ERROR','init','3179258HqDZCR','logDir','931694NDGHqO','error','name','.gz','floor','message','mtime','getMinutes','9978354tiVxmz','Warning:\x20Failed\x20to\x20initialize\x20log\x20files:','32cSqevX','tdx-','log','877005IYnrbV','logStream','string','1399611TvCYpf','16BZWmXx','getFullYear','logLevel','join','red','TRACE','fileOnly'];a142_0xe199=function(){return _0x582787;};return a142_0xe199();}import a142_0x77de2b from'chalk';function safeStringify(_0x17b405){const _0x5a68e0=a142_0x5efc;if(typeof _0x17b405===_0x5a68e0(0xfb))return _0x17b405;if(_0x17b405 instanceof Error)return _0x17b405[_0x5a68e0(0xcf)]||_0x17b405[_0x5a68e0(0xee)]+':\x20'+_0x17b405['message'];try{return JSON[_0x5a68e0(0xe7)](_0x17b405,(_0x1099ce,_0x3ecc4e)=>{const _0x54251e=_0x5a68e0;if(_0x3ecc4e instanceof Error)return{'name':_0x3ecc4e[_0x54251e(0xee)],'message':_0x3ecc4e[_0x54251e(0xf1)],'stack':_0x3ecc4e[_0x54251e(0xcf)],'cause':_0x3ecc4e[_0x54251e(0x109)]};return _0x3ecc4e;});}catch{return String(_0x17b405);}}function getTimezoneOffset(){const _0x3ba080=a142_0x5efc,_0x30443c=-new Date()['getTimezoneOffset'](),_0x4ef6eb=Math[_0x3ba080(0xf0)](Math['abs'](_0x30443c)/0x3c),_0x353d39=Math[_0x3ba080(0xde)](_0x30443c)%0x3c,_0x529000=_0x30443c>=0x0?'+':'-';return''+_0x529000+_0x4ef6eb['toString']()[_0x3ba080(0xdd)](0x2,'0')+_0x353d39['toString']()[_0x3ba080(0xdd)](0x2,'0');}function a142_0x5efc(_0x134096,_0x3b3fc7){_0x134096=_0x134096-0xcd;const _0xe19906=a142_0xe199();let _0x5efcbf=_0xe19906[_0x134096];return _0x5efcbf;}function formatTimestamp(){const _0x33e1f6=a142_0x5efc,_0x504610=new Date(),_0x333bab=_0x504610[_0x33e1f6(0xfe)](),_0xc30b91=(_0x504610['getMonth']()+0x1)[_0x33e1f6(0xd5)]()['padStart'](0x2,'0'),_0x310372=_0x504610[_0x33e1f6(0xd0)]()[_0x33e1f6(0xd5)]()[_0x33e1f6(0xdd)](0x2,'0'),_0x1aedc8=_0x504610[_0x33e1f6(0xe3)]()['toString']()[_0x33e1f6(0xdd)](0x2,'0'),_0x13aeb5=_0x504610[_0x33e1f6(0xf3)]()[_0x33e1f6(0xd5)]()[_0x33e1f6(0xdd)](0x2,'0'),_0x3229d9=_0x504610[_0x33e1f6(0xda)]()[_0x33e1f6(0xd5)]()[_0x33e1f6(0xdd)](0x2,'0'),_0x32f827=_0x504610['getMilliseconds']()[_0x33e1f6(0xd5)]()[_0x33e1f6(0xdd)](0x3,'0'),_0xb5b2cd=getTimezoneOffset();return _0x333bab+'-'+_0xc30b91+'-'+_0x310372+'\x20'+_0x1aedc8+':'+_0x13aeb5+':'+_0x3229d9+'.'+_0x32f827+_0xb5b2cd;}function formatColoredLogEntry(_0x2aa6c1,_0xbb0199){const _0x2cea6a=a142_0x5efc,_0x572d38=formatTimestamp(),_0x5054e2=_0xbb0199[_0x2cea6a(0xdf)](safeStringify)[_0x2cea6a(0x100)]('\x20'),_0x5e73f3=a142_0x77de2b[_0x2cea6a(0xdb)](_0x572d38);let _0x484ca1;switch(_0x2aa6c1){case _0x2cea6a(0xdc):_0x484ca1=a142_0x77de2b['cyan']('['+_0x2aa6c1+']\x20');break;case _0x2cea6a(0xd2):_0x484ca1=a142_0x77de2b['yellow']('['+_0x2aa6c1+']\x20');break;case'error':_0x484ca1=a142_0x77de2b[_0x2cea6a(0x101)]('['+_0x2aa6c1+']');break;case _0x2cea6a(0xd9):_0x484ca1=a142_0x77de2b[_0x2cea6a(0xdb)]('['+_0x2aa6c1+']');break;default:_0x484ca1='['+_0x2aa6c1+']';}return _0x5e73f3+'\x20'+_0x484ca1+'\x20'+_0x5054e2;}export var LogLevel;(function(_0x7f98de){const _0xc54f10=a142_0x5efc;_0x7f98de[_0x7f98de[_0xc54f10(0x102)]=-0x2]=_0xc54f10(0x102),_0x7f98de[_0x7f98de[_0xc54f10(0x104)]=-0x1]='DEBUG',_0x7f98de[_0x7f98de[_0xc54f10(0xe6)]=0x0]=_0xc54f10(0xe6),_0x7f98de[_0x7f98de[_0xc54f10(0x106)]=0x1]='WARN',_0x7f98de[_0x7f98de[_0xc54f10(0xe8)]=0x2]=_0xc54f10(0xe8);}(LogLevel||(LogLevel={})));export class TDXLogger{[a142_0x3cf6d5(0xfa)];[a142_0x3cf6d5(0xeb)];[a142_0x3cf6d5(0xff)];[a142_0x3cf6d5(0x103)];constructor(_0x5eadc5=LogLevel['INFO'],_0x1b4bdb=![]){const _0x698bc2=a142_0x3cf6d5;this[_0x698bc2(0xeb)]=join(homedir(),_0x698bc2(0xcd),'tdx',_0x698bc2(0xd1)),this['logLevel']=_0x5eadc5,this[_0x698bc2(0x103)]=_0x1b4bdb;}async[a142_0x3cf6d5(0xe9)](){const _0x4d9f34=a142_0x3cf6d5;try{await mkdir(this[_0x4d9f34(0xeb)],{'recursive':!![]}),await this[_0x4d9f34(0xce)]();const _0x56fc38=join(this[_0x4d9f34(0xeb)],'tdx.log');this['logStream']=createWriteStream(_0x56fc38,{'flags':'a'}),this[_0x4d9f34(0xfa)]['on']('error',_0x49b560=>{const _0x2f8a23=_0x4d9f34;console[_0x2f8a23(0xed)](_0x2f8a23(0xe2),_0x49b560[_0x2f8a23(0xf1)]);});}catch(_0x39608f){console['error'](_0x4d9f34(0xf5),_0x39608f);}}async[a142_0x3cf6d5(0xce)](){const _0x3c5527=a142_0x3cf6d5;try{const _0x2d942c=await readdir(this[_0x3c5527(0xeb)]),_0x4a8380=new Date()['toISOString']()[_0x3c5527(0xd8)]('T')[0x0];if(_0x2d942c['includes']('tdx.log')){const _0x350d5f=join(this[_0x3c5527(0xeb)],_0x3c5527(0x105)),_0x241fed=await stat(_0x350d5f),_0x2ff529=new Date(_0x241fed[_0x3c5527(0xf2)])[_0x3c5527(0xe4)]()[_0x3c5527(0xd8)]('T')[0x0];if(_0x2ff529<_0x4a8380){const _0x4696cd=join(this[_0x3c5527(0xeb)],_0x3c5527(0xf7)+_0x2ff529+_0x3c5527(0x10a));await rename(_0x350d5f,_0x4696cd);}}const _0x63b400=await readdir(this[_0x3c5527(0xeb)]),_0x16812e=/^tdx-(\d{4}-\d{2}-\d{2})\.log$/,_0x776a2e=_0x63b400['filter'](_0x278be0=>_0x16812e['test'](_0x278be0));for(const _0x524c8e of _0x776a2e){const _0x2749ca=join(this['logDir'],_0x524c8e),_0x2c3ccc=join(this[_0x3c5527(0xeb)],_0x524c8e+_0x3c5527(0xef));try{await pipeline(createReadStream(_0x2749ca),createGzip(),createWriteStream(_0x2c3ccc)),await unlink(_0x2749ca);}catch(_0x417446){console[_0x3c5527(0xed)]('Warning:\x20Failed\x20to\x20compress\x20'+_0x524c8e+':',_0x417446);}}}catch{}}['debug'](..._0x23ffcf){const _0x31dc43=a142_0x3cf6d5;if(this[_0x31dc43(0xff)]>LogLevel['DEBUG'])return;const _0x440cc4=formatColoredLogEntry('debug',_0x23ffcf);this['logStream']?.['write'](_0x440cc4+'\x0a');}['trace'](..._0x4152ed){const _0x20dc8c=a142_0x3cf6d5;if(this[_0x20dc8c(0xff)]>LogLevel[_0x20dc8c(0x102)])return;const _0x25095f=formatColoredLogEntry('trace',_0x4152ed);this['logStream']?.[_0x20dc8c(0x108)](_0x25095f+'\x0a');}[a142_0x3cf6d5(0xdc)](..._0x55ca9d){const _0x5efba1=a142_0x3cf6d5;if(this[_0x5efba1(0xff)]>LogLevel[_0x5efba1(0xe6)])return;const _0x22de02=formatColoredLogEntry(_0x5efba1(0xdc),_0x55ca9d);!this[_0x5efba1(0x103)]&&console[_0x5efba1(0xf8)](_0x22de02),this['logStream']?.['write'](_0x22de02+'\x0a');}[a142_0x3cf6d5(0xd2)](..._0x4142fb){const _0x372d6e=a142_0x3cf6d5;if(this[_0x372d6e(0xff)]>LogLevel[_0x372d6e(0x106)])return;const _0x328e9f=formatColoredLogEntry(_0x372d6e(0xd2),_0x4142fb);!this['fileOnly']&&console[_0x372d6e(0xed)](_0x328e9f),this[_0x372d6e(0xfa)]?.[_0x372d6e(0x108)](_0x328e9f+'\x0a');}[a142_0x3cf6d5(0xed)](..._0x2b8cd9){const _0x22d7bc=a142_0x3cf6d5,_0x11a80e=formatColoredLogEntry(_0x22d7bc(0xed),_0x2b8cd9);!this[_0x22d7bc(0x103)]&&console[_0x22d7bc(0xed)](_0x11a80e),this[_0x22d7bc(0xfa)]?.['write'](_0x11a80e+'\x0a');}async[a142_0x3cf6d5(0xd4)](){const _0x4ffb80=a142_0x3cf6d5;return this[_0x4ffb80(0xdc)](_0x4ffb80(0xe1)),new Promise(_0x431954=>{const _0x15f741=_0x4ffb80;this[_0x15f741(0xfa)]?this[_0x15f741(0xfa)][_0x15f741(0xe0)](()=>{_0x431954();}):_0x431954();});}[a142_0x3cf6d5(0xd6)](){const _0x2b8635=a142_0x3cf6d5;return join(this[_0x2b8635(0xeb)],'tdx.log');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a143_0x4fb666=a143_0x5a82;(function(_0x4dcf56,_0x3dca7f){const _0x365fe6=a143_0x5a82,_0x1b0e7a=_0x4dcf56();while(!![]){try{const _0x556399=parseInt(_0x365fe6(0x135))/0x1*(parseInt(_0x365fe6(0x148))/0x2)+-parseInt(_0x365fe6(0x143))/0x3*(parseInt(_0x365fe6(0x139))/0x4)+-parseInt(_0x365fe6(0x14a))/0x5*(parseInt(_0x365fe6(0x14d))/0x6)+-parseInt(_0x365fe6(0x13a))/0x7+-parseInt(_0x365fe6(0x134))/0x8*(-parseInt(_0x365fe6(0x14b))/0x9)+-parseInt(_0x365fe6(0x14f))/0xa+parseInt(_0x365fe6(0x13f))/0xb;if(_0x556399===_0x3dca7f)break;else _0x1b0e7a['push'](_0x1b0e7a['shift']());}catch(_0x19ca53){_0x1b0e7a['push'](_0x1b0e7a['shift']());}}}(a143_0x5674,0xb5f90));function a143_0x5674(){const _0x15dda6=['\x0aUpdate\x20available:\x20','destroy','yellow','714471JYOAcL','NO_COLOR','npm\x20install\x20-g\x20@treasuredata/tdx@latest','toISOString','last_version_check','789856zqFwIH','Invalid\x20version\x20format','170skiZpx','18yDSIkk','version','246810owTjYe','currentVersion','11829180eBgfqa','Run:','https://registry.npmjs.org/@treasuredata/tdx/latest','dim','end','green','HTTP\x20','write','latestVersion','getTime','now','4783648DzFXCr','1ThCNgr','statusCode','data','\x0aRun:\x20','20AtnrRc','2518285gYLyjv','Request\x20timeout','parse','updateAvailable','utf-8','36152248ozqdbA'];a143_0x5674=function(){return _0x15dda6;};return a143_0x5674();}import{get}from'https';import{readFileSync,writeFileSync,mkdirSync}from'fs';import{join}from'path';import{gt,valid}from'semver';import a143_0x10e078 from'chalk';import{getCacheDir}from'../core/config.js';const CACHE_DURATION_MS=0x18*0x3c*0x3c*0x3e8,NPM_REGISTRY_URL=a143_0x4fb666(0x151),TIMEOUT_MS=0x7d0;function a143_0x5a82(_0x1fb9cb,_0x1f5af1){_0x1fb9cb=_0x1fb9cb-0x12c;const _0x567461=a143_0x5674();let _0x5a8264=_0x567461[_0x1fb9cb];return _0x5a8264;}function getCacheFilePath(){const _0x55d07f=a143_0x4fb666,_0x5151a8=getCacheDir();return join(_0x5151a8,_0x55d07f(0x147));}function readCache(){const _0x22237f=a143_0x4fb666;try{const _0x52424e=getCacheFilePath(),_0x1c594f=readFileSync(_0x52424e,_0x22237f(0x13e));return JSON['parse'](_0x1c594f);}catch{return null;}}function writeCache(_0x1915c9){const _0x44b8c2=a143_0x4fb666;try{const _0x2f0296=getCacheDir();mkdirSync(_0x2f0296,{'recursive':!![]});const _0x5956d6={'lastCheck':new Date()[_0x44b8c2(0x146)](),'latestVersion':_0x1915c9},_0x233672=getCacheFilePath();writeFileSync(_0x233672,JSON['stringify'](_0x5956d6,null,0x2),_0x44b8c2(0x13e));}catch{}}function isCacheValid(_0x150196){const _0x2af6d1=a143_0x4fb666;if(!_0x150196)return![];const _0xdddd98=new Date(_0x150196['lastCheck'])[_0x2af6d1(0x132)](),_0x4d3204=Date[_0x2af6d1(0x133)]();return _0x4d3204-_0xdddd98<CACHE_DURATION_MS;}function fetchLatestVersion(){return new Promise((_0x4c0559,_0x29bf21)=>{const _0x1bae5d=get(NPM_REGISTRY_URL,_0x5f992f=>{const _0x417ee0=a143_0x5a82;if(_0x5f992f[_0x417ee0(0x136)]!==0xc8){clearTimeout(_0x4fb3f5),_0x29bf21(new Error(_0x417ee0(0x12f)+_0x5f992f['statusCode']));return;}let _0x43dedf='';_0x5f992f['on'](_0x417ee0(0x137),_0x11dc5a=>{_0x43dedf+=_0x11dc5a;}),_0x5f992f['on'](_0x417ee0(0x12d),()=>{const _0x2253bd=_0x417ee0;clearTimeout(_0x4fb3f5);try{const _0x251f68=JSON[_0x2253bd(0x13c)](_0x43dedf);if(!valid(_0x251f68[_0x2253bd(0x14c)])){_0x29bf21(new Error(_0x2253bd(0x149)));return;}_0x4c0559(_0x251f68[_0x2253bd(0x14c)]);}catch(_0x11e3b6){_0x29bf21(_0x11e3b6);}});})['on']('error',_0x1f9e0e=>{clearTimeout(_0x4fb3f5),_0x29bf21(_0x1f9e0e);}),_0x4fb3f5=setTimeout(()=>{const _0x17817d=a143_0x5a82;_0x1bae5d[_0x17817d(0x141)](),_0x29bf21(new Error(_0x17817d(0x13b)));},TIMEOUT_MS);});}export async function checkForUpdate(_0x11e79a){const _0x89cf0a=a143_0x4fb666;try{const _0x4bf142=readCache();if(isCacheValid(_0x4bf142)){const _0x4f3453=gt(_0x4bf142[_0x89cf0a(0x131)],_0x11e79a);return{'updateAvailable':_0x4f3453,'currentVersion':_0x11e79a,'latestVersion':_0x4bf142[_0x89cf0a(0x131)]};}const _0x2884ba=await fetchLatestVersion();writeCache(_0x2884ba);const _0x22b218=gt(_0x2884ba,_0x11e79a);return{'updateAvailable':_0x22b218,'currentVersion':_0x11e79a,'latestVersion':_0x2884ba};}catch{return null;}}export function displayUpdateNotification(_0x109cf4){const _0x49a19f=a143_0x4fb666;if(!_0x109cf4[_0x49a19f(0x13d)])return;const _0x1d0d75=process['stderr']['isTTY']&&!process['env'][_0x49a19f(0x144)],_0x203b44=_0x1d0d75?a143_0x10e078['gray']('→'):'→',_0x296ec4=_0x1d0d75?a143_0x10e078[_0x49a19f(0x12c)](_0x109cf4[_0x49a19f(0x14e)]):_0x109cf4[_0x49a19f(0x14e)],_0x12a9ee=_0x1d0d75?a143_0x10e078[_0x49a19f(0x12e)](_0x109cf4['latestVersion']):_0x109cf4[_0x49a19f(0x131)],_0x3debbe=_0x1d0d75?a143_0x10e078['cyan']('npm\x20install\x20-g\x20@treasuredata/tdx@latest'):_0x49a19f(0x145),_0x2c8be7=_0x1d0d75?'\x0a'+a143_0x10e078[_0x49a19f(0x142)]('Update\x20available:')+'\x20'+_0x296ec4+'\x20'+_0x203b44+'\x20'+_0x12a9ee+'\x0a'+a143_0x10e078['dim'](_0x49a19f(0x150))+'\x20'+_0x3debbe+'\x0a':_0x49a19f(0x140)+_0x296ec4+'\x20'+_0x203b44+'\x20'+_0x12a9ee+_0x49a19f(0x138)+_0x3debbe+'\x0a';process['stderr'][_0x49a19f(0x130)](_0x2c8be7);}
|