@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.
Files changed (135) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.js +1 -1
  9. package/dist/commands/chat-command.js +1 -1
  10. package/dist/commands/claude-command.js +1 -1
  11. package/dist/commands/claude-statusline-command.js +1 -1
  12. package/dist/commands/claude-usage-command.js +1 -1
  13. package/dist/commands/command.js +1 -1
  14. package/dist/commands/connection-command.js +1 -1
  15. package/dist/commands/context-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profiles-command.js +1 -1
  26. package/dist/commands/query-command.js +1 -1
  27. package/dist/commands/segment-command.js +1 -1
  28. package/dist/commands/segment-create-command.js +1 -1
  29. package/dist/commands/segment-fields-command.js +1 -1
  30. package/dist/commands/segment-pull-command.js +1 -1
  31. package/dist/commands/segment-push-command.js +1 -1
  32. package/dist/commands/segment-update-command.js +1 -1
  33. package/dist/commands/segment-use-command.js +1 -1
  34. package/dist/commands/segment-validate-command.js +1 -1
  35. package/dist/commands/segments.js +1 -1
  36. package/dist/commands/show.js +1 -1
  37. package/dist/commands/tables.js +1 -1
  38. package/dist/commands/use-command.js +1 -1
  39. package/dist/commands/user-command.js +1 -1
  40. package/dist/commands/workflow-command.js +1 -1
  41. package/dist/core/auth.js +1 -1
  42. package/dist/core/command-output.js +1 -1
  43. package/dist/core/config.js +1 -1
  44. package/dist/core/connection-cache.js +1 -1
  45. package/dist/core/constants.js +1 -1
  46. package/dist/core/credential-cache.js +1 -1
  47. package/dist/core/global-context.js +1 -1
  48. package/dist/core/keychain.js +1 -1
  49. package/dist/core/profile.js +1 -1
  50. package/dist/core/project-config.js +1 -1
  51. package/dist/core/session.js +1 -1
  52. package/dist/core/user-cache.js +1 -1
  53. package/dist/index.js +1 -1
  54. package/dist/proxy/anthropic-adapter.js +1 -1
  55. package/dist/proxy/claude-usage-tracker.js +1 -1
  56. package/dist/proxy/context-signature.js +1 -1
  57. package/dist/proxy/conversation-utils.js +1 -1
  58. package/dist/proxy/server.js +1 -1
  59. package/dist/proxy/session-cache.js +1 -1
  60. package/dist/sdk/agent/agent-config.js +1 -1
  61. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  62. package/dist/sdk/agent/agent-yaml.js +1 -1
  63. package/dist/sdk/api.js +1 -1
  64. package/dist/sdk/client/cdp-api-client.js +1 -1
  65. package/dist/sdk/client/endpoints.js +1 -1
  66. package/dist/sdk/client/engage-api-client.js +1 -1
  67. package/dist/sdk/client/http-client.js +1 -1
  68. package/dist/sdk/client/llm-api-client.js +1 -1
  69. package/dist/sdk/client/rate-limiter.js +1 -1
  70. package/dist/sdk/client/td-api-client.js +1 -1
  71. package/dist/sdk/client/trino-api-client.js +1 -1
  72. package/dist/sdk/client/workflow-client.js +1 -1
  73. package/dist/sdk/connection-validator.js +1 -1
  74. package/dist/sdk/connection.js +1 -1
  75. package/dist/sdk/engage.js +1 -1
  76. package/dist/sdk/errors.js +1 -1
  77. package/dist/sdk/index.js +1 -1
  78. package/dist/sdk/io/index.js +1 -1
  79. package/dist/sdk/io/node-filesystem.js +1 -1
  80. package/dist/sdk/job.js +1 -1
  81. package/dist/sdk/journey.js +1 -1
  82. package/dist/sdk/llm/chat-cache.js +1 -1
  83. package/dist/sdk/llm/index.js +1 -1
  84. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  85. package/dist/sdk/llm/model-aliases.js +1 -1
  86. package/dist/sdk/llm/model-factors.js +1 -1
  87. package/dist/sdk/query/index.js +1 -1
  88. package/dist/sdk/query/sql-parser.js +1 -1
  89. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  90. package/dist/sdk/segment/fields-display.js +1 -1
  91. package/dist/sdk/segment/file-discovery.js +1 -1
  92. package/dist/sdk/segment/journey-utils.js +1 -1
  93. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  94. package/dist/sdk/segment/journey-yaml.js +1 -1
  95. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  96. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  97. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  98. package/dist/sdk/segment/pull-workflow.js +1 -1
  99. package/dist/sdk/segment/push-workflow.js +1 -1
  100. package/dist/sdk/segment/push-workflow.js.map +1 -1
  101. package/dist/sdk/segment/resolution-context.js +1 -1
  102. package/dist/sdk/segment/segment-path-parser.js +1 -1
  103. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  104. package/dist/sdk/segment/target-resolution.js +1 -1
  105. package/dist/sdk/segment/tdx-config.js +1 -1
  106. package/dist/sdk/segment/validate-files.js +1 -1
  107. package/dist/sdk/segment/yaml-validator.js +1 -1
  108. package/dist/sdk/segment.js +1 -1
  109. package/dist/sdk/types/cdp.d.ts +5 -2
  110. package/dist/sdk/types/cdp.d.ts.map +1 -1
  111. package/dist/sdk/types/index.js +1 -1
  112. package/dist/sdk/types/progress.js +1 -1
  113. package/dist/sdk/user.js +1 -1
  114. package/dist/sdk/util/format-detector.js +1 -1
  115. package/dist/sdk/util/formatters.js +1 -1
  116. package/dist/sdk/util/index.js +1 -1
  117. package/dist/sdk/util/tree-formatter.js +1 -1
  118. package/dist/sdk/workflow/index.js +1 -1
  119. package/dist/sdk/workflow/workflow-utils.js +1 -1
  120. package/dist/utils/async.js +1 -1
  121. package/dist/utils/colors.js +1 -1
  122. package/dist/utils/diff.js +1 -1
  123. package/dist/utils/file-permissions.js +1 -1
  124. package/dist/utils/json-loader.js +1 -1
  125. package/dist/utils/option-validation.js +1 -1
  126. package/dist/utils/port.js +1 -1
  127. package/dist/utils/process.js +1 -1
  128. package/dist/utils/prompt.js +1 -1
  129. package/dist/utils/spinner.js +1 -1
  130. package/dist/utils/sse-parser.js +1 -1
  131. package/dist/utils/string-utils.js +1 -1
  132. package/dist/utils/table-ref-parser.js +1 -1
  133. package/dist/utils/tdx-logger.js +1 -1
  134. package/dist/utils/version-check.js +1 -1
  135. package/package.json +1 -1
@@ -1 +1 @@
1
- function a141_0x28ec(){const _0xfdad09=['Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','split','join','4106920gPbEir','length','410586XTRICb','5267034AgAbkV','4209458qlqqem','1129458cVRJPq','catalog','1FLnUsF','20khCykF','841070zEuQNX','Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation','3252402Jdlrjk','30vPcScG','push','7OOwsnQ','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)','table','database','includes','Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)','Pattern\x20cannot\x20be\x20just\x20a\x20dot'];a141_0x28ec=function(){return _0xfdad09;};return a141_0x28ec();}(function(_0x747623,_0x362cf8){const _0xd16b9a=a141_0x5a1b,_0x57c38d=_0x747623();while(!![]){try{const _0x5c2cb0=-parseInt(_0xd16b9a(0x10b))/0x1*(parseInt(_0xd16b9a(0x109))/0x2)+parseInt(_0xd16b9a(0x106))/0x3*(-parseInt(_0xd16b9a(0x10c))/0x4)+-parseInt(_0xd16b9a(0x10d))/0x5+parseInt(_0xd16b9a(0x10f))/0x6*(parseInt(_0xd16b9a(0x112))/0x7)+-parseInt(_0xd16b9a(0x104))/0x8+parseInt(_0xd16b9a(0x107))/0x9+parseInt(_0xd16b9a(0x110))/0xa*(parseInt(_0xd16b9a(0x108))/0xb);if(_0x5c2cb0===_0x362cf8)break;else _0x57c38d['push'](_0x57c38d['shift']());}catch(_0x4930f5){_0x57c38d['push'](_0x57c38d['shift']());}}}(a141_0x28ec,0x54285));function hasWildcard(_0x36343d){const _0x288d07=a141_0x5a1b;return _0x36343d[_0x288d07(0xfe)]('*')||_0x36343d[_0x288d07(0xfe)]('?');}export function parseTableReference(_0x13afe3){const _0x5e1807=a141_0x5a1b;if(!_0x13afe3||_0x13afe3['trim']()['length']===0x0)throw new Error(_0x5e1807(0x101));const _0x510473=_0x13afe3['trim'](),_0xe8e59f={'original':_0x510473},_0x4fbe31=_0x510473[_0x5e1807(0x102)]('.');if(_0x4fbe31[_0x5e1807(0x105)]===0x1){const _0xfab793=_0x4fbe31[0x0];if(!_0xfab793)throw new Error(_0x5e1807(0x100));_0xe8e59f[_0x5e1807(0xfc)]=_0xfab793;}else{if(_0x4fbe31['length']===0x2){const [_0x13a9fe,_0x4e3795]=_0x4fbe31;if(!_0x13a9fe)throw new Error(_0x5e1807(0x114));if(!_0x4e3795)throw new Error(_0x5e1807(0xff));_0xe8e59f[_0x5e1807(0xfd)]=_0x13a9fe,_0xe8e59f[_0x5e1807(0xfc)]=_0x4e3795;}else{if(_0x4fbe31[_0x5e1807(0x105)]===0x3){const [_0x5a7bb9,_0x12eea1,_0x1671ed]=_0x4fbe31;if(!_0x5a7bb9||!_0x12eea1||!_0x1671ed)throw new Error('Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty');_0xe8e59f['catalog']=_0x5a7bb9,_0xe8e59f['database']=_0x12eea1,_0xe8e59f['table']=_0x1671ed;}else throw new Error('Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)');}}return _0xe8e59f;}export function formatTableReference(_0x2b6611){const _0x3eadbb=a141_0x5a1b,_0x19ff25=[];return _0x2b6611[_0x3eadbb(0x10a)]&&_0x19ff25[_0x3eadbb(0x111)](_0x2b6611[_0x3eadbb(0x10a)]),_0x2b6611[_0x3eadbb(0xfd)]&&_0x19ff25[_0x3eadbb(0x111)](_0x2b6611[_0x3eadbb(0xfd)]),_0x2b6611[_0x3eadbb(0xfc)]&&_0x19ff25[_0x3eadbb(0x111)](_0x2b6611['table']),_0x19ff25[_0x3eadbb(0x103)]('.');}export function validateTableListReference(_0x66a0e){return undefined;}function a141_0x5a1b(_0x466fd0,_0x30b5ee){_0x466fd0=_0x466fd0-0xfc;const _0x28eccd=a141_0x28ec();let _0x5a1bba=_0x28eccd[_0x466fd0];return _0x5a1bba;}export function validateTableDescribeReference(_0x44b0a2){const _0x59c128=a141_0x5a1b;if(!_0x44b0a2[_0x59c128(0xfc)])return'Table\x20name\x20is\x20required\x20for\x20describe\x20operation';if(_0x44b0a2[_0x59c128(0xfd)]&&hasWildcard(_0x44b0a2[_0x59c128(0xfd)]))return _0x59c128(0x113);if(hasWildcard(_0x44b0a2[_0x59c128(0xfc)]))return _0x59c128(0x10e);return undefined;}
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;}
@@ -1 +1 @@
1
- const a142_0xa3c0d9=a142_0x428d;(function(_0xdd9492,_0x58d02c){const _0x594035=a142_0x428d,_0x588c99=_0xdd9492();while(!![]){try{const _0x36182e=-parseInt(_0x594035(0x10d))/0x1+-parseInt(_0x594035(0x126))/0x2+-parseInt(_0x594035(0x109))/0x3*(parseInt(_0x594035(0x13b))/0x4)+parseInt(_0x594035(0x130))/0x5*(-parseInt(_0x594035(0x11a))/0x6)+-parseInt(_0x594035(0x108))/0x7*(-parseInt(_0x594035(0x110))/0x8)+parseInt(_0x594035(0x114))/0x9+parseInt(_0x594035(0x131))/0xa;if(_0x36182e===_0x58d02c)break;else _0x588c99['push'](_0x588c99['shift']());}catch(_0x5bb20a){_0x588c99['push'](_0x588c99['shift']());}}}(a142_0xfd73,0xa4ce0));import{createWriteStream,createReadStream}from'fs';import{mkdir,readdir,unlink,stat,rename}from'fs/promises';import{join}from'path';function a142_0xfd73(){const _0x16118d=['1716658UMeifV','getDate','tdx','warn','gray','getMonth','padStart','cause','logs','tdx-','35WkTRrO','25082730BHjxAh','.gz','test','toISOString','error','.log','tdx.log','Warning:\x20Error\x20writing\x20to\x20tdx.log:','mtime','logDir','4828IFaWaC','debug','abs','Warning:\x20Failed\x20to\x20compress\x20','init','close','ERROR','INFO','getMinutes','info','filter','trace','56SSfUZY','3249dFtKhp','join','stringify','getHours','1189978qdBkyq','name','log','1139032TpzkXe','.cache','fileOnly','stack','11180304RJHkHh','write','getSeconds','rotateOldLogs','yellow','TRACE','736314rtwncj','string','message','WARN','split','logLevel','includes','cyan','logStream','Proxy\x20session\x20ended','DEBUG','toString'];a142_0xfd73=function(){return _0x16118d;};return a142_0xfd73();}import{homedir}from'os';import{createGzip}from'zlib';import{pipeline}from'stream/promises';function a142_0x428d(_0x4508e1,_0x221384){_0x4508e1=_0x4508e1-0x108;const _0xfd73ad=a142_0xfd73();let _0x428dd3=_0xfd73ad[_0x4508e1];return _0x428dd3;}import a142_0x452818 from'chalk';function safeStringify(_0xbda9fa){const _0x4672f3=a142_0x428d;if(typeof _0xbda9fa===_0x4672f3(0x11b))return _0xbda9fa;if(_0xbda9fa instanceof Error)return _0xbda9fa[_0x4672f3(0x113)]||_0xbda9fa[_0x4672f3(0x10e)]+':\x20'+_0xbda9fa[_0x4672f3(0x11c)];try{return JSON[_0x4672f3(0x10b)](_0xbda9fa,(_0x1e52a9,_0x4a258c)=>{const _0x199c6a=_0x4672f3;if(_0x4a258c instanceof Error)return{'name':_0x4a258c[_0x199c6a(0x10e)],'message':_0x4a258c[_0x199c6a(0x11c)],'stack':_0x4a258c[_0x199c6a(0x113)],'cause':_0x4a258c[_0x199c6a(0x12d)]};return _0x4a258c;});}catch{return String(_0xbda9fa);}}function getTimezoneOffset(){const _0x653624=a142_0x428d,_0x719c14=-new Date()['getTimezoneOffset'](),_0x2be0b5=Math['floor'](Math[_0x653624(0x13d)](_0x719c14)/0x3c),_0x469b86=Math['abs'](_0x719c14)%0x3c,_0x36d3ad=_0x719c14>=0x0?'+':'-';return''+_0x36d3ad+_0x2be0b5[_0x653624(0x125)]()[_0x653624(0x12c)](0x2,'0')+_0x469b86[_0x653624(0x125)]()['padStart'](0x2,'0');}function formatTimestamp(){const _0x94660b=a142_0x428d,_0x22679b=new Date(),_0x491c2e=_0x22679b['getFullYear'](),_0x279e62=(_0x22679b[_0x94660b(0x12b)]()+0x1)[_0x94660b(0x125)]()['padStart'](0x2,'0'),_0x35b536=_0x22679b[_0x94660b(0x127)]()[_0x94660b(0x125)]()[_0x94660b(0x12c)](0x2,'0'),_0x490402=_0x22679b[_0x94660b(0x10c)]()['toString']()[_0x94660b(0x12c)](0x2,'0'),_0xbc1b10=_0x22679b[_0x94660b(0x143)]()[_0x94660b(0x125)]()[_0x94660b(0x12c)](0x2,'0'),_0x2404eb=_0x22679b[_0x94660b(0x116)]()[_0x94660b(0x125)]()[_0x94660b(0x12c)](0x2,'0'),_0x88e3c3=_0x22679b['getMilliseconds']()[_0x94660b(0x125)]()['padStart'](0x3,'0'),_0x9d6cd1=getTimezoneOffset();return _0x491c2e+'-'+_0x279e62+'-'+_0x35b536+'\x20'+_0x490402+':'+_0xbc1b10+':'+_0x2404eb+'.'+_0x88e3c3+_0x9d6cd1;}function formatColoredLogEntry(_0x5a96be,_0x41301d){const _0x136761=a142_0x428d,_0x3690e8=formatTimestamp(),_0x96172c=_0x41301d['map'](safeStringify)[_0x136761(0x10a)]('\x20'),_0x5d6127=a142_0x452818[_0x136761(0x12a)](_0x3690e8);let _0x1946e5;switch(_0x5a96be){case'info':_0x1946e5=a142_0x452818[_0x136761(0x121)]('['+_0x5a96be+']\x20');break;case'warn':_0x1946e5=a142_0x452818[_0x136761(0x118)]('['+_0x5a96be+']\x20');break;case _0x136761(0x135):_0x1946e5=a142_0x452818['red']('['+_0x5a96be+']');break;case _0x136761(0x13c):_0x1946e5=a142_0x452818[_0x136761(0x12a)]('['+_0x5a96be+']');break;default:_0x1946e5='['+_0x5a96be+']';}return _0x5d6127+'\x20'+_0x1946e5+'\x20'+_0x96172c;}export var LogLevel;(function(_0x5bb804){const _0x5ccac3=a142_0x428d;_0x5bb804[_0x5bb804[_0x5ccac3(0x119)]=-0x2]=_0x5ccac3(0x119),_0x5bb804[_0x5bb804[_0x5ccac3(0x124)]=-0x1]=_0x5ccac3(0x124),_0x5bb804[_0x5bb804['INFO']=0x0]=_0x5ccac3(0x142),_0x5bb804[_0x5bb804[_0x5ccac3(0x11d)]=0x1]=_0x5ccac3(0x11d),_0x5bb804[_0x5bb804[_0x5ccac3(0x141)]=0x2]=_0x5ccac3(0x141);}(LogLevel||(LogLevel={})));export class TDXLogger{[a142_0xa3c0d9(0x122)];[a142_0xa3c0d9(0x13a)];[a142_0xa3c0d9(0x11f)];['fileOnly'];constructor(_0x758164=LogLevel[a142_0xa3c0d9(0x142)],_0xc22c32=![]){const _0x28431f=a142_0xa3c0d9;this[_0x28431f(0x13a)]=join(homedir(),_0x28431f(0x111),_0x28431f(0x128),_0x28431f(0x12e)),this[_0x28431f(0x11f)]=_0x758164,this[_0x28431f(0x112)]=_0xc22c32;}async[a142_0xa3c0d9(0x13f)](){const _0x3ae1c4=a142_0xa3c0d9;try{await mkdir(this[_0x3ae1c4(0x13a)],{'recursive':!![]}),await this['rotateOldLogs']();const _0x2b19ee=join(this[_0x3ae1c4(0x13a)],_0x3ae1c4(0x137));this[_0x3ae1c4(0x122)]=createWriteStream(_0x2b19ee,{'flags':'a'}),this['logStream']['on'](_0x3ae1c4(0x135),_0x396786=>{const _0x4afad7=_0x3ae1c4;console[_0x4afad7(0x135)](_0x4afad7(0x138),_0x396786[_0x4afad7(0x11c)]);});}catch(_0x47b877){console[_0x3ae1c4(0x135)]('Warning:\x20Failed\x20to\x20initialize\x20log\x20files:',_0x47b877);}}async[a142_0xa3c0d9(0x117)](){const _0x72f6f7=a142_0xa3c0d9;try{const _0x13d09f=await readdir(this['logDir']),_0x5b306c=new Date()[_0x72f6f7(0x134)]()[_0x72f6f7(0x11e)]('T')[0x0];if(_0x13d09f[_0x72f6f7(0x120)](_0x72f6f7(0x137))){const _0x14f72b=join(this[_0x72f6f7(0x13a)],'tdx.log'),_0x8907ee=await stat(_0x14f72b),_0x162e40=new Date(_0x8907ee[_0x72f6f7(0x139)])[_0x72f6f7(0x134)]()[_0x72f6f7(0x11e)]('T')[0x0];if(_0x162e40<_0x5b306c){const _0x1ed601=join(this[_0x72f6f7(0x13a)],_0x72f6f7(0x12f)+_0x162e40+_0x72f6f7(0x136));await rename(_0x14f72b,_0x1ed601);}}const _0x207982=await readdir(this[_0x72f6f7(0x13a)]),_0x51336f=/^tdx-(\d{4}-\d{2}-\d{2})\.log$/,_0x3a972c=_0x207982[_0x72f6f7(0x145)](_0x16d53a=>_0x51336f[_0x72f6f7(0x133)](_0x16d53a));for(const _0x8ead61 of _0x3a972c){const _0x14d900=join(this[_0x72f6f7(0x13a)],_0x8ead61),_0x40b6cc=join(this[_0x72f6f7(0x13a)],_0x8ead61+_0x72f6f7(0x132));try{await pipeline(createReadStream(_0x14d900),createGzip(),createWriteStream(_0x40b6cc)),await unlink(_0x14d900);}catch(_0x4a8de9){console[_0x72f6f7(0x135)](_0x72f6f7(0x13e)+_0x8ead61+':',_0x4a8de9);}}}catch{}}['debug'](..._0x1d64d8){const _0x2f68b3=a142_0xa3c0d9;if(this[_0x2f68b3(0x11f)]>LogLevel[_0x2f68b3(0x124)])return;const _0x3b6924=formatColoredLogEntry('debug',_0x1d64d8);this[_0x2f68b3(0x122)]?.[_0x2f68b3(0x115)](_0x3b6924+'\x0a');}[a142_0xa3c0d9(0x146)](..._0x38c305){const _0x43f9b2=a142_0xa3c0d9;if(this['logLevel']>LogLevel[_0x43f9b2(0x119)])return;const _0x18ef25=formatColoredLogEntry(_0x43f9b2(0x146),_0x38c305);this[_0x43f9b2(0x122)]?.[_0x43f9b2(0x115)](_0x18ef25+'\x0a');}[a142_0xa3c0d9(0x144)](..._0x382f88){const _0x64237c=a142_0xa3c0d9;if(this[_0x64237c(0x11f)]>LogLevel[_0x64237c(0x142)])return;const _0x57267f=formatColoredLogEntry('info',_0x382f88);!this['fileOnly']&&console[_0x64237c(0x10f)](_0x57267f),this[_0x64237c(0x122)]?.['write'](_0x57267f+'\x0a');}[a142_0xa3c0d9(0x129)](..._0xaf230a){const _0x2335d3=a142_0xa3c0d9;if(this[_0x2335d3(0x11f)]>LogLevel[_0x2335d3(0x11d)])return;const _0x4da88b=formatColoredLogEntry(_0x2335d3(0x129),_0xaf230a);!this[_0x2335d3(0x112)]&&console['error'](_0x4da88b),this[_0x2335d3(0x122)]?.[_0x2335d3(0x115)](_0x4da88b+'\x0a');}[a142_0xa3c0d9(0x135)](..._0x39bee6){const _0x457914=a142_0xa3c0d9,_0x114d1b=formatColoredLogEntry('error',_0x39bee6);!this['fileOnly']&&console[_0x457914(0x135)](_0x114d1b),this[_0x457914(0x122)]?.[_0x457914(0x115)](_0x114d1b+'\x0a');}async[a142_0xa3c0d9(0x140)](){const _0x42875f=a142_0xa3c0d9;return this[_0x42875f(0x144)](_0x42875f(0x123)),new Promise(_0x54cba4=>{const _0xc990cd=_0x42875f;this[_0xc990cd(0x122)]?this[_0xc990cd(0x122)]['end'](()=>{_0x54cba4();}):_0x54cba4();});}['getLogPath'](){const _0x2fa5b1=a142_0xa3c0d9;return join(this[_0x2fa5b1(0x13a)],_0x2fa5b1(0x137));}}
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(_0x56c9da,_0xfa9ca1){const _0x215884=a143_0x3d21,_0x13ee54=_0x56c9da();while(!![]){try{const _0x2babfe=-parseInt(_0x215884(0x1d5))/0x1*(parseInt(_0x215884(0x1e4))/0x2)+-parseInt(_0x215884(0x1f3))/0x3*(-parseInt(_0x215884(0x1d3))/0x4)+-parseInt(_0x215884(0x1f2))/0x5*(parseInt(_0x215884(0x1ee))/0x6)+parseInt(_0x215884(0x1e0))/0x7*(parseInt(_0x215884(0x1d0))/0x8)+parseInt(_0x215884(0x1da))/0x9*(parseInt(_0x215884(0x1cf))/0xa)+-parseInt(_0x215884(0x1e9))/0xb*(parseInt(_0x215884(0x1d4))/0xc)+-parseInt(_0x215884(0x1e3))/0xd*(-parseInt(_0x215884(0x1e5))/0xe);if(_0x2babfe===_0xfa9ca1)break;else _0x13ee54['push'](_0x13ee54['shift']());}catch(_0x1631e6){_0x13ee54['push'](_0x13ee54['shift']());}}}(a143_0x4e87,0x60d0a));import{get}from'https';import{readFileSync,writeFileSync,mkdirSync}from'fs';import{join}from'path';import{gt,valid}from'semver';import a143_0x332609 from'chalk';import{getCacheDir}from'../core/config.js';const CACHE_DURATION_MS=0x18*0x3c*0x3c*0x3e8,NPM_REGISTRY_URL='https://registry.npmjs.org/@treasuredata/tdx/latest',TIMEOUT_MS=0x7d0;function a143_0x3d21(_0x35be43,_0x1e9d8b){_0x35be43=_0x35be43-0x1ce;const _0x4e8739=a143_0x4e87();let _0x3d21f5=_0x4e8739[_0x35be43];return _0x3d21f5;}function getCacheFilePath(){const _0x2983c9=getCacheDir();return join(_0x2983c9,'last_version_check');}function readCache(){const _0x242d45=a143_0x3d21;try{const _0x2f9134=getCacheFilePath(),_0x28a434=readFileSync(_0x2f9134,_0x242d45(0x1e7));return JSON[_0x242d45(0x1ea)](_0x28a434);}catch{return null;}}function writeCache(_0x1bd34c){const _0x46829a=a143_0x3d21;try{const _0x2914e1=getCacheDir();mkdirSync(_0x2914e1,{'recursive':!![]});const _0x12801b={'lastCheck':new Date()['toISOString'](),'latestVersion':_0x1bd34c},_0x4d5256=getCacheFilePath();writeFileSync(_0x4d5256,JSON[_0x46829a(0x1d9)](_0x12801b,null,0x2),_0x46829a(0x1e7));}catch{}}function isCacheValid(_0x202dd4){const _0x3a5fac=a143_0x3d21;if(!_0x202dd4)return![];const _0x2fe0db=new Date(_0x202dd4['lastCheck'])['getTime'](),_0x52d62a=Date[_0x3a5fac(0x1e6)]();return _0x52d62a-_0x2fe0db<CACHE_DURATION_MS;}function a143_0x4e87(){const _0x119762=['\x0aUpdate\x20available:\x20','green','dim','6EqZRcI','version','NO_COLOR','data','8435tRsJrZ','744609qmIyso','latestVersion','stderr','env','2110FXBfBB','160ExVpCK','Run:','\x0aRun:\x20','4NeiZjV','84AyPPKE','1TkvadB','cyan','currentVersion','Invalid\x20version\x20format','stringify','5310ILlQaL','Update\x20available:','destroy','statusCode','end','npm\x20install\x20-g\x20@treasuredata/tdx@latest','25879olATiD','HTTP\x20','Request\x20timeout','2260882bDCvAv','377242xIAXjC','28cwmMFy','now','utf-8','gray','326227eBxRLj','parse'];a143_0x4e87=function(){return _0x119762;};return a143_0x4e87();}function fetchLatestVersion(){return new Promise((_0x171e5b,_0xf4cf34)=>{const _0x963be=get(NPM_REGISTRY_URL,_0x115693=>{const _0x3f4d67=a143_0x3d21;if(_0x115693[_0x3f4d67(0x1dd)]!==0xc8){clearTimeout(_0x3494da),_0xf4cf34(new Error(_0x3f4d67(0x1e1)+_0x115693[_0x3f4d67(0x1dd)]));return;}let _0x6e0125='';_0x115693['on'](_0x3f4d67(0x1f1),_0x226efb=>{_0x6e0125+=_0x226efb;}),_0x115693['on'](_0x3f4d67(0x1de),()=>{const _0x4886a1=_0x3f4d67;clearTimeout(_0x3494da);try{const _0x475eb0=JSON[_0x4886a1(0x1ea)](_0x6e0125);if(!valid(_0x475eb0[_0x4886a1(0x1ef)])){_0xf4cf34(new Error(_0x4886a1(0x1d8)));return;}_0x171e5b(_0x475eb0[_0x4886a1(0x1ef)]);}catch(_0x128119){_0xf4cf34(_0x128119);}});})['on']('error',_0x503c64=>{clearTimeout(_0x3494da),_0xf4cf34(_0x503c64);}),_0x3494da=setTimeout(()=>{const _0x1bedad=a143_0x3d21;_0x963be[_0x1bedad(0x1dc)](),_0xf4cf34(new Error(_0x1bedad(0x1e2)));},TIMEOUT_MS);});}export async function checkForUpdate(_0x2c2c44){const _0x278606=a143_0x3d21;try{const _0x479ea9=readCache();if(isCacheValid(_0x479ea9)){const _0x47b0ae=gt(_0x479ea9[_0x278606(0x1f4)],_0x2c2c44);return{'updateAvailable':_0x47b0ae,'currentVersion':_0x2c2c44,'latestVersion':_0x479ea9[_0x278606(0x1f4)]};}const _0x4ba1c8=await fetchLatestVersion();writeCache(_0x4ba1c8);const _0x2463d1=gt(_0x4ba1c8,_0x2c2c44);return{'updateAvailable':_0x2463d1,'currentVersion':_0x2c2c44,'latestVersion':_0x4ba1c8};}catch{return null;}}export function displayUpdateNotification(_0x27df61){const _0x41d564=a143_0x3d21;if(!_0x27df61['updateAvailable'])return;const _0x20f5ce=process[_0x41d564(0x1f5)]['isTTY']&&!process[_0x41d564(0x1ce)][_0x41d564(0x1f0)],_0x2fa45c=_0x20f5ce?a143_0x332609[_0x41d564(0x1e8)]('→'):'→',_0x2bae76=_0x20f5ce?a143_0x332609[_0x41d564(0x1ed)](_0x27df61[_0x41d564(0x1d7)]):_0x27df61[_0x41d564(0x1d7)],_0x20b541=_0x20f5ce?a143_0x332609[_0x41d564(0x1ec)](_0x27df61['latestVersion']):_0x27df61[_0x41d564(0x1f4)],_0x2102dc=_0x20f5ce?a143_0x332609[_0x41d564(0x1d6)]('npm\x20install\x20-g\x20@treasuredata/tdx@latest'):_0x41d564(0x1df),_0x1e281b=_0x20f5ce?'\x0a'+a143_0x332609['yellow'](_0x41d564(0x1db))+'\x20'+_0x2bae76+'\x20'+_0x2fa45c+'\x20'+_0x20b541+'\x0a'+a143_0x332609[_0x41d564(0x1ed)](_0x41d564(0x1d1))+'\x20'+_0x2102dc+'\x0a':_0x41d564(0x1eb)+_0x2bae76+'\x20'+_0x2fa45c+'\x20'+_0x20b541+_0x41d564(0x1d2)+_0x2102dc+'\x0a';process[_0x41d564(0x1f5)]['write'](_0x1e281b);}
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);}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasuredata/tdx",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "AI-native CLI for Treasure Data - optimized for both human engineers and AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {