@treasuredata/tdx 2026.3.22 → 2026.3.24
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 -3
- 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/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-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/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-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/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.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/oauth-keychain.js +1 -1
- package/dist/core/oauth.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/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.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/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-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/oauth-refresh.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/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.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-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.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-validator.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-recovery.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/segment-validator.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/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.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/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.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/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.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/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.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
|
-
function
|
|
1
|
+
function a209_0x1840(_0x2b914d,_0x4db58a){_0x2b914d=_0x2b914d-0x12a;const _0x811afe=a209_0x811a();let _0x1840e1=_0x811afe[_0x2b914d];return _0x1840e1;}const a209_0x3669ca=a209_0x1840;(function(_0x3de28d,_0x3fb554){const _0x202ae2=a209_0x1840,_0x19209d=_0x3de28d();while(!![]){try{const _0x4054ee=-parseInt(_0x202ae2(0x134))/0x1*(parseInt(_0x202ae2(0x158))/0x2)+parseInt(_0x202ae2(0x15d))/0x3+-parseInt(_0x202ae2(0x136))/0x4*(parseInt(_0x202ae2(0x13d))/0x5)+-parseInt(_0x202ae2(0x130))/0x6+parseInt(_0x202ae2(0x168))/0x7+-parseInt(_0x202ae2(0x12f))/0x8*(parseInt(_0x202ae2(0x156))/0x9)+parseInt(_0x202ae2(0x13e))/0xa*(parseInt(_0x202ae2(0x132))/0xb);if(_0x4054ee===_0x3fb554)break;else _0x19209d['push'](_0x19209d['shift']());}catch(_0x2ab699){_0x19209d['push'](_0x19209d['shift']());}}}(a209_0x811a,0xc5bdc));import{execSync,spawn}from'node:child_process';const SHELL_NAMES=new Set([a209_0x3669ca(0x14b),a209_0x3669ca(0x148),'sh',a209_0x3669ca(0x16b),'ksh',a209_0x3669ca(0x155),a209_0x3669ca(0x15f),a209_0x3669ca(0x147),a209_0x3669ca(0x12a),a209_0x3669ca(0x154),'nu',a209_0x3669ca(0x14e),a209_0x3669ca(0x14d),a209_0x3669ca(0x165)]),EPHEMERAL_SHELL_SPAWNERS=new Set([a209_0x3669ca(0x14c),a209_0x3669ca(0x12e),'cursor',a209_0x3669ca(0x14f),a209_0x3669ca(0x12d)]);function getProcessInfoWindows(_0x588747){const _0x54d51a=a209_0x3669ca;try{if(!Number[_0x54d51a(0x138)](_0x588747)||_0x588747<=0x0)return null;const _0x3b0772='Get-CimInstance\x20Win32_Process\x20-Filter\x20\x22ProcessId='+_0x588747+_0x54d51a(0x133),_0x448d09=execSync(_0x54d51a(0x16a)+_0x3b0772+'\x22',{'encoding':_0x54d51a(0x164),'windowsHide':!![],'stdio':[_0x54d51a(0x162),'pipe','pipe']})[_0x54d51a(0x13b)]();if(!_0x448d09)return null;const [_0x3cd1e2,..._0x9ddd2d]=_0x448d09[_0x54d51a(0x157)](','),_0x35cebf=parseInt(_0x3cd1e2,0xa),_0x118437=_0x9ddd2d[_0x54d51a(0x161)](',')[_0x54d51a(0x13b)]();if(isNaN(_0x35cebf)||!_0x118437)return null;return{'pid':_0x588747,'ppid':_0x35cebf,'comm':_0x118437[_0x54d51a(0x14a)](/\.exe$/i,'')};}catch{return null;}}function getProcessInfoPosix(_0x86a737){const _0x4372b6=a209_0x3669ca;try{const _0x297385=0x400000;if(!Number[_0x4372b6(0x138)](_0x86a737)||_0x86a737<=0x0||_0x86a737>_0x297385)return null;const _0x52d868=execSync(_0x4372b6(0x15b)+_0x86a737+_0x4372b6(0x131),{'encoding':_0x4372b6(0x164),'stdio':'pipe'})[_0x4372b6(0x13b)](),[_0x5646f1,..._0x2fb02e]=_0x52d868[_0x4372b6(0x157)](/\s+/),_0x219d42=parseInt(_0x5646f1,0xa),_0x3a7163=_0x2fb02e[_0x4372b6(0x161)]('\x20');if(isNaN(_0x219d42))return null;return{'pid':_0x86a737,'ppid':_0x219d42,'comm':_0x3a7163};}catch{return null;}}function getProcessInfo(_0x2914ed){const _0x4f8510=a209_0x3669ca;if(process[_0x4f8510(0x15a)]==='win32')return getProcessInfoWindows(_0x2914ed);return getProcessInfoPosix(_0x2914ed);}function getBasename(_0x81890a){const _0x5bcfb1=a209_0x3669ca;return _0x81890a['replace'](/^-/,'')[_0x5bcfb1(0x157)]('/')[_0x5bcfb1(0x152)]()?.[_0x5bcfb1(0x135)]()||'';}function isShell(_0x4bb85a){return SHELL_NAMES['has'](getBasename(_0x4bb85a));}function isEphemeralShellSpawner(_0x1e86d4){return EPHEMERAL_SHELL_SPAWNERS['has'](getBasename(_0x1e86d4));}let cachedShellPID;function findShellPID(){const _0x200a8c=a209_0x3669ca;if(process[_0x200a8c(0x13a)]===undefined)return process[_0x200a8c(0x141)];let _0x3a4d1b=process['ppid'];const _0x3066cc=0xa;let _0x53a24f=0x0;while(_0x53a24f<_0x3066cc){const _0x9cc5e1=getProcessInfo(_0x3a4d1b);if(!_0x9cc5e1)break;if(isShell(_0x9cc5e1['comm'])){const _0x527882=getProcessInfo(_0x9cc5e1[_0x200a8c(0x13a)]);if(_0x527882&&isEphemeralShellSpawner(_0x527882['comm'])){_0x3a4d1b=_0x9cc5e1[_0x200a8c(0x13a)],_0x53a24f++;continue;}return _0x9cc5e1[_0x200a8c(0x141)];}if(_0x9cc5e1[_0x200a8c(0x13a)]===0x0||_0x9cc5e1[_0x200a8c(0x13a)]===0x1){if(isShell(_0x9cc5e1[_0x200a8c(0x139)]))return _0x9cc5e1['pid'];break;}_0x3a4d1b=_0x9cc5e1[_0x200a8c(0x13a)],_0x53a24f++;}return process[_0x200a8c(0x13a)]!==undefined?process['ppid']:process[_0x200a8c(0x141)];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x3926c5){const _0x13b42c=a209_0x3669ca;if(!Number[_0x13b42c(0x138)](_0x3926c5)||_0x3926c5<=0x0)return![];try{return process[_0x13b42c(0x160)](_0x3926c5,0x0),!![];}catch{return![];}}export function openBrowser(_0x4d1383){const _0x48980e=a209_0x3669ca;let _0x48cfaa;try{_0x48cfaa=new URL(_0x4d1383);}catch{throw new Error(_0x48980e(0x137)+_0x4d1383);}if(_0x48cfaa[_0x48980e(0x149)]!==_0x48980e(0x151)&&_0x48cfaa[_0x48980e(0x149)]!==_0x48980e(0x15e))throw new Error(_0x48980e(0x167)+_0x48cfaa[_0x48980e(0x149)]);const _0x5cb1bd=_0x48cfaa[_0x48980e(0x145)],_0x1a78fa=process[_0x48980e(0x15a)];if(_0x1a78fa===_0x48980e(0x153))spawn(_0x48980e(0x13c),['/c',_0x48980e(0x12c),'',_0x5cb1bd],{'detached':!![],'stdio':'ignore'})['unref']();else{const _0xa9bf4=_0x1a78fa===_0x48980e(0x159)?_0x48980e(0x140):_0x48980e(0x150);spawn(_0xa9bf4,[_0x5cb1bd],{'detached':!![],'stdio':_0x48980e(0x142)})[_0x48980e(0x166)]();}}export function isWindows(){const _0x5a7823=a209_0x3669ca;return process[_0x5a7823(0x15a)]==='win32';}export function getCrossSpawnOptions(_0x2d4385){return{..._0x2d4385??{},'shell':isWindows()};}export function escapeWindowsArg(_0x3d43fc){const _0x2a4506=a209_0x3669ca;if(!/[ \t"&|<>^%!`\r\n]/[_0x2a4506(0x12b)](_0x3d43fc))return _0x3d43fc;const _0x185ce6=_0x3d43fc['replace'](/"/g,'\x22\x22');return'\x22'+_0x185ce6+'\x22';}export function crossSpawn(_0x10cde1,_0x50bddb,_0x14a91e){const _0x27656a=a209_0x3669ca;if(isWindows()){const _0x40c7f0=escapeWindowsArg(_0x10cde1),_0x515c02=_0x50bddb[_0x27656a(0x15c)](escapeWindowsArg),_0x45fb4b=[_0x40c7f0,..._0x515c02][_0x27656a(0x161)]('\x20');return spawn(_0x45fb4b,[],{..._0x14a91e,'shell':!![]});}return spawn(_0x10cde1,_0x50bddb,{..._0x14a91e,'shell':![]});}export function gracefulExit(_0xa4f805=0x0){const _0x4319b6=a209_0x3669ca;isWindows()?setTimeout(()=>process[_0x4319b6(0x146)](_0xa4f805),0x32):process[_0x4319b6(0x146)](_0xa4f805);}function a209_0x811a(){const _0x24c8e3=['where.exe','powershell.exe\x20-NoProfile\x20-NonInteractive\x20-Command\x20\x22','fish','pwsh','test','start','treasure\x20studio','code','294288mdPIVS','2414730hLZyCw','\x20-o\x20ppid=,comm=','6259ceoHJz','\x22\x20|\x20Select-Object\x20-Property\x20ParentProcessId,Name\x20|\x20ForEach-Object\x20{\x20\x22$($_.ParentProcessId),$($_.Name)\x22\x20}','2ksMkwT','toLowerCase','530064ijWTzP','Invalid\x20URL:\x20','isInteger','comm','ppid','trim','cmd.exe','40ToIDil','26140lQnUcR','stdout','open','pid','ignore','toString','stderr','href','exit','dash','zsh','protocol','replace','bash','claude','elvish','ion','electron','xdg-open','http:','pop','win32','powershell','tcsh','162WxVxSN','split','1002262MvmfTW','darwin','platform','ps\x20-p\x20','map','3138264wqtzhi','https:','csh','kill','join','pipe','data','utf-8','xonsh','unref','Unsupported\x20protocol:\x20','9824409qlhuFG'];a209_0x811a=function(){return _0x24c8e3;};return a209_0x811a();}export function findExecutable(_0x5418e2,_0x1fb273=0x1388){return new Promise(_0x1ea203=>{const _0x457000=a209_0x1840,_0x5e52ac=isWindows()?_0x457000(0x169):'which';let _0x530787=![];const _0x2ee3d0=crossSpawn(_0x5e52ac,[_0x5418e2],{'stdio':_0x457000(0x162),'shell':isWindows()}),_0x1640e2=setTimeout(()=>{const _0x44d6d6=_0x457000;!_0x530787&&(_0x530787=!![],_0x2ee3d0[_0x44d6d6(0x160)](),_0x1ea203(null));},_0x1fb273);let _0x19cb06='';_0x2ee3d0[_0x457000(0x13f)]?.['on'](_0x457000(0x163),_0x37432b=>{const _0xff900f=_0x457000;_0x19cb06+=_0x37432b[_0xff900f(0x143)]();}),_0x2ee3d0[_0x457000(0x144)]?.['on'](_0x457000(0x163),()=>{}),_0x2ee3d0['on'](_0x457000(0x146),_0x2ed3e2=>{const _0x1e6291=_0x457000;if(_0x530787)return;_0x530787=!![],clearTimeout(_0x1640e2);if(_0x2ed3e2===0x0&&_0x19cb06['trim']()){const _0x47c8ae=_0x19cb06[_0x1e6291(0x13b)]()[_0x1e6291(0x157)](/\r?\n/)[0x0];_0x1ea203(_0x47c8ae);}else _0x1ea203(null);}),_0x2ee3d0['on']('error',()=>{if(_0x530787)return;_0x530787=!![],clearTimeout(_0x1640e2),_0x1ea203(null);});});}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e2efa,_0x28073e){const _0x49581=a210_0x1ff9,_0x3b7d56=_0x3e2efa();while(!![]){try{const _0x52dc9e=parseInt(_0x49581(0x1d5))/0x1*(parseInt(_0x49581(0x1d7))/0x2)+-parseInt(_0x49581(0x1c7))/0x3+parseInt(_0x49581(0x1d6))/0x4*(-parseInt(_0x49581(0x1dd))/0x5)+-parseInt(_0x49581(0x1d3))/0x6+-parseInt(_0x49581(0x1cc))/0x7*(-parseInt(_0x49581(0x1c6))/0x8)+-parseInt(_0x49581(0x1d9))/0x9*(parseInt(_0x49581(0x1d2))/0xa)+parseInt(_0x49581(0x1d4))/0xb;if(_0x52dc9e===_0x28073e)break;else _0x3b7d56['push'](_0x3b7d56['shift']());}catch(_0x14a7c5){_0x3b7d56['push'](_0x3b7d56['shift']());}}}(a210_0x38de,0x85740));function a210_0x38de(){const _0x507161=['20dPQOTG','47886Lwssky','removeListener','5651829XYbCAG','isTTY','stdout','resume','608245TcUuIA','createInterface','data','1171416xcBPdy','1640679bpJCzq','utf8','stdin','pause','close','21fVfaIx','setEncoding','write','stderr','setRawMode','toLowerCase','10VTwKHc','326142HJFIxc','13491819OqRMuQ','30SJYtoY'];a210_0x38de=function(){return _0x507161;};return a210_0x38de();}import*as a210_0x32c3f0 from'readline';import{gracefulExit}from'./process.js';export function isInteractive(){const _0x54bc7e=a210_0x1ff9;return process[_0x54bc7e(0x1c9)]['isTTY']===!![];}function a210_0x1ff9(_0x3b1364,_0x429017){_0x3b1364=_0x3b1364-0x1c6;const _0x38ded4=a210_0x38de();let _0x1ff94a=_0x38ded4[_0x3b1364];return _0x1ff94a;}export async function confirm(_0x2a84bb){const _0x5802be=a210_0x1ff9,_0x2cd8ca=a210_0x32c3f0[_0x5802be(0x1de)]({'input':process['stdin'],'output':process[_0x5802be(0x1db)]});return new Promise(_0x19c7a0=>{_0x2cd8ca['question'](_0x2a84bb+'\x20(y/N):\x20',_0x49a50d=>{const _0x4a456d=a210_0x1ff9;_0x2cd8ca[_0x4a456d(0x1cb)](),_0x19c7a0(_0x49a50d[_0x4a456d(0x1d1)]()==='y'||_0x49a50d['toLowerCase']()==='yes');});});}export async function confirmKey(_0x3e8767){const _0x571f45=a210_0x1ff9;if(!process['stdin'][_0x571f45(0x1da)])return![];return process[_0x571f45(0x1cf)][_0x571f45(0x1ce)](_0x3e8767+'\x20[y/N]\x20'),new Promise(_0x55c1c8=>{const _0x322e36=_0x571f45,_0x33c4bf=process[_0x322e36(0x1c9)];_0x33c4bf['setRawMode'](!![]),_0x33c4bf[_0x322e36(0x1dc)](),_0x33c4bf[_0x322e36(0x1cd)](_0x322e36(0x1c8));const _0x1d73f6=_0x392369=>{const _0x238485=_0x322e36;_0x33c4bf[_0x238485(0x1d0)](![]),_0x33c4bf[_0x238485(0x1ca)](),_0x33c4bf[_0x238485(0x1d8)](_0x238485(0x1df),_0x1d73f6);if(_0x392369==='\x1b'){process[_0x238485(0x1cf)][_0x238485(0x1ce)]('\x0a'),_0x55c1c8(![]);return;}_0x392369==='\x03'&&(process[_0x238485(0x1cf)][_0x238485(0x1ce)]('\x0a'),gracefulExit(0x82));if(_0x392369[_0x238485(0x1d1)]()==='y'){process[_0x238485(0x1cf)][_0x238485(0x1ce)]('y\x0a'),_0x55c1c8(!![]);return;}process['stderr']['write']('\x0a'),_0x55c1c8(![]);};_0x33c4bf['on'](_0x322e36(0x1df),_0x1d73f6);});}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x103201,_0x98a2dc){const _0x5a602e=a211_0x1796,_0xb693ed=_0x103201();while(!![]){try{const _0x5c5be6=parseInt(_0x5a602e(0x15e))/0x1*(-parseInt(_0x5a602e(0x16a))/0x2)+parseInt(_0x5a602e(0x15c))/0x3+parseInt(_0x5a602e(0x162))/0x4+parseInt(_0x5a602e(0x168))/0x5+parseInt(_0x5a602e(0x15d))/0x6+-parseInt(_0x5a602e(0x166))/0x7+parseInt(_0x5a602e(0x171))/0x8*(parseInt(_0x5a602e(0x16e))/0x9);if(_0x5c5be6===_0x98a2dc)break;else _0xb693ed['push'](_0xb693ed['shift']());}catch(_0x11c0c7){_0xb693ed['push'](_0xb693ed['shift']());}}}(a211_0x248e,0xbe400));import a211_0x2c88ff from'ora';import{isWindows}from'./process.js';const windowsSpinner={'interval':0x3e8,'frames':['•']};export function createCommandSpinner(_0x50b1b6,_0x3f418a={}){const _0x583d91=a211_0x1796,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0x3f418a;return a211_0x2c88ff({'text':_0x50b1b6,'color':_0x583d91(0x167),'stream':process[_0x583d91(0x169)],'isEnabled':forceEnabled||process[_0x583d91(0x169)]['isTTY']&&!verbose,...isWindows()&&{'spinner':windowsSpinner}});}export async function withSpinner(_0x3b04e1,_0x179f12,_0x118377={}){const _0x515ef7=a211_0x1796,_0x5311ed=_0x118377[_0x515ef7(0x161)]??(()=>Date[_0x515ef7(0x170)]()),_0x5bda26=createCommandSpinner(_0x3b04e1,_0x118377);_0x5bda26[_0x515ef7(0x16d)]();const _0x30a67b=_0x5311ed();try{const _0x3e17d7=await _0x179f12(),_0x399f94=_0x5311ed()-_0x30a67b;return _0x5bda26['stop'](),{'data':_0x3e17d7,'elapsedMs':_0x399f94};}catch(_0x4f1d9d){_0x5bda26[_0x515ef7(0x164)]();throw _0x4f1d9d;}}function a211_0x1796(_0xae1384,_0x3a52a4){_0xae1384=_0xae1384-0x15b;const _0x248e2a=a211_0x248e();let _0x1796e3=_0x248e2a[_0xae1384];return _0x1796e3;}export async function withProgressSpinner(_0x8a7662,_0xc29d41,_0x3060f7={}){const _0x20f473=a211_0x1796,_0x36b479=_0x3060f7['clock']??(()=>Date[_0x20f473(0x170)]()),_0xccf438=_0x3060f7['intervalFactory']??setInterval,_0xc42c93=createCommandSpinner(_0x8a7662,_0x3060f7);_0xc42c93[_0x20f473(0x16d)]();const _0x1f15e2=_0x36b479(),_0x3229e3=_0x8a7662[_0x20f473(0x160)]('...','')[_0x20f473(0x15b)]()||'Processing',_0x1867ff={};let _0x3a614f=_0x8a7662;const _0x53cf2b=()=>{const _0x37a60=_0x20f473;if(!_0xc42c93[_0x37a60(0x16b)])return;const _0x2d1afb=_0x36b479()-_0x1f15e2,_0x52ab3e=formatElapsed(_0x2d1afb),_0x26a49b=_0x1867ff[_0x37a60(0x16f)]?.[_0x37a60(0x15b)]()||_0x3229e3,_0x51efa6=_0x1867ff[_0x37a60(0x172)]?_0x37a60(0x15f)+_0x1867ff['jobId']+']':'',_0x19532a=_0x1867ff[_0x37a60(0x165)]?'\x20'+_0x1867ff[_0x37a60(0x165)]:'',_0x37083e=_0x26a49b+'\x20'+_0x52ab3e+_0x19532a+_0x51efa6;_0x37083e!==_0x3a614f&&_0x37083e[_0x37a60(0x15b)]()&&(_0xc42c93['text']=_0x37083e,_0x3a614f=_0x37083e);},_0x4df01e=_0xccf438(()=>{_0x53cf2b();},0x3e8),_0x392631={'setPhase':_0x20c1e5=>{const _0x3c2d6b=_0x20f473;_0x1867ff[_0x3c2d6b(0x16f)]=_0x20c1e5;const _0x194d8d=_0x20c1e5?.[_0x3c2d6b(0x15b)]()||_0x3229e3,_0x2fb583=_0x36b479()-_0x1f15e2,_0x334670=formatElapsed(_0x2fb583),_0x477020=_0x1867ff[_0x3c2d6b(0x172)]?_0x3c2d6b(0x15f)+_0x1867ff[_0x3c2d6b(0x172)]+']':'',_0x56ca83=_0x1867ff['extra']?'\x20'+_0x1867ff[_0x3c2d6b(0x165)]:'',_0x55297d=_0x194d8d+'\x20'+_0x334670+_0x56ca83+_0x477020;_0xc42c93[_0x3c2d6b(0x16b)]&&_0x55297d['trim']()&&(_0xc42c93[_0x3c2d6b(0x16c)]=_0x55297d,_0x3a614f=_0x55297d);},'setJobId':_0x4a9f40=>{const _0x4bcc75=_0x20f473;_0x1867ff[_0x4bcc75(0x172)]=_0x4a9f40,_0x53cf2b();},'setExtra':_0x22868c=>{_0x1867ff['extra']=_0x22868c,_0x53cf2b();}};_0x53cf2b();try{const _0x361193=await _0xc29d41(_0x392631),_0x14ccfb=_0x36b479()-_0x1f15e2;return{'data':_0x361193,'elapsedMs':_0x14ccfb};}finally{clearInterval(_0x4df01e),_0xc42c93['stop']();}}export function formatElapsed(_0x58ce35){const _0xd49a65=a211_0x1796,_0x1389bc=Math[_0xd49a65(0x163)](_0x58ce35/0x3e8);if(_0x1389bc<0x3c)return(_0x58ce35/0x3e8)['toFixed'](0x1)+'s';const _0x320c03=Math['floor'](_0x1389bc/0x3c),_0x11b4f5=_0x1389bc%0x3c;if(_0x320c03<0x3c)return _0x320c03+'m\x20'+_0x11b4f5+'s';const _0x509b05=Math[_0xd49a65(0x163)](_0x320c03/0x3c),_0x2d660f=_0x320c03%0x3c;return _0x509b05+'h\x20'+_0x2d660f+'m';}function a211_0x248e(){const _0x1791eb=['213335XjrcnY','stderr','6RwHHLv','isSpinning','text','start','56286dNADio','phase','now','896wiaVNO','jobId','trim','2564973VqhHfZ','528960eAAWhM','363507OrxUwA','\x20[Job\x20ID:\x20','replace','clock','3297632VjTusX','floor','stop','extra','4486223twkYhJ','cyan'];a211_0x248e=function(){return _0x1791eb;};return a211_0x248e();}
|
package/dist/utils/sse-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a212_0x1a9e(_0x35e09a,_0x547c57){_0x35e09a=_0x35e09a-0x102;const _0x53a406=a212_0x53a4();let _0x1a9e79=_0x53a406[_0x35e09a];return _0x1a9e79;}(function(_0x5f4159,_0x2c4e9d){const _0x751bf2=a212_0x1a9e,_0x469539=_0x5f4159();while(!![]){try{const _0x2525a5=parseInt(_0x751bf2(0x109))/0x1+parseInt(_0x751bf2(0x10c))/0x2*(parseInt(_0x751bf2(0x118))/0x3)+parseInt(_0x751bf2(0x102))/0x4*(parseInt(_0x751bf2(0x111))/0x5)+parseInt(_0x751bf2(0x119))/0x6*(parseInt(_0x751bf2(0x10e))/0x7)+-parseInt(_0x751bf2(0x10f))/0x8*(parseInt(_0x751bf2(0x10d))/0x9)+parseInt(_0x751bf2(0x105))/0xa+parseInt(_0x751bf2(0x10a))/0xb*(-parseInt(_0x751bf2(0x110))/0xc);if(_0x2525a5===_0x2c4e9d)break;else _0x469539['push'](_0x469539['shift']());}catch(_0x2504db){_0x469539['push'](_0x469539['shift']());}}}(a212_0x53a4,0xad799));export async function*parseSSEStream(_0x23283e,_0x56b53d){const _0x4c51f1=a212_0x1a9e;if(!_0x23283e[_0x4c51f1(0x114)])throw new Error('Response\x20body\x20is\x20null');const _0x5a8458=_0x23283e[_0x4c51f1(0x114)]['getReader'](),_0x3ec350=new TextDecoder();let _0x25f7d6='',_0x5c2546={};try{while(!![]){const {done:_0x488b4e,value:_0x513553}=await _0x5a8458['read']();if(_0x488b4e){if(_0x5c2546[_0x4c51f1(0x117)]){_0x56b53d?.['debug'](_0x4c51f1(0x113)+_0x5c2546[_0x4c51f1(0x117)]);const _0x1ebb67=parseSSEData(_0x5c2546[_0x4c51f1(0x117)]);yield _0x1ebb67;}break;}_0x25f7d6+=_0x3ec350['decode'](_0x513553,{'stream':!![]});const _0x326ab2=_0x25f7d6[_0x4c51f1(0x116)]('\x0a');_0x25f7d6=_0x326ab2[_0x4c51f1(0x107)]()||'';for(const _0x306d0d of _0x326ab2){if(_0x306d0d[_0x4c51f1(0x115)]()===''){if(_0x5c2546[_0x4c51f1(0x117)]){_0x56b53d?.[_0x4c51f1(0x104)](_0x4c51f1(0x113)+_0x5c2546[_0x4c51f1(0x117)]);const _0x2cc908=parseSSEData(_0x5c2546['data']);yield _0x2cc908,_0x5c2546={};}continue;}if(_0x306d0d[_0x4c51f1(0x10b)](':'))continue;const _0x1950f1=_0x306d0d['indexOf'](':');if(_0x1950f1===-0x1)continue;const _0x514dd7=_0x306d0d[_0x4c51f1(0x108)](0x0,_0x1950f1);let _0x50bdf0=_0x306d0d[_0x4c51f1(0x108)](_0x1950f1+0x1);_0x50bdf0[_0x4c51f1(0x10b)]('\x20')&&(_0x50bdf0=_0x50bdf0[_0x4c51f1(0x108)](0x1));switch(_0x514dd7){case _0x4c51f1(0x106):_0x5c2546['event']=_0x50bdf0;break;case _0x4c51f1(0x117):_0x5c2546[_0x4c51f1(0x117)]=_0x5c2546[_0x4c51f1(0x117)]?_0x5c2546['data']+'\x0a'+_0x50bdf0:_0x50bdf0;break;case'id':_0x5c2546['id']=_0x50bdf0;break;}}}}finally{_0x5a8458[_0x4c51f1(0x112)]();}}function a212_0x53a4(){const _0x4dce99=['pop','slice','94597cNczYK','4961JCvYbk','startsWith','2miKriD','131976RzBpqA','28AcNvZb','152tEiWEV','44844pcsDFy','980IrISmL','releaseLock','[LLM\x20API\x20SSE]\x20','body','trim','split','data','34539xxtjUS','1157028sMVhqp','9508qLaYSN','Failed\x20to\x20parse\x20SSE\x20data\x20as\x20JSON:\x20','debug','13312020PXBxji','event'];a212_0x53a4=function(){return _0x4dce99;};return a212_0x53a4();}function parseSSEData(_0x161e53){const _0xa15f67=a212_0x1a9e;try{return JSON['parse'](_0x161e53);}catch(_0x2f8396){throw new Error(_0xa15f67(0x103)+_0x161e53,{'cause':_0x2f8396});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a467a,_0x1e1c5a){const _0x56aec2=a213_0x300f,_0x2e0b17=_0x2a467a();while(!![]){try{const _0x3476b4=-parseInt(_0x56aec2(0x16e))/0x1+-parseInt(_0x56aec2(0x17c))/0x2*(-parseInt(_0x56aec2(0x171))/0x3)+parseInt(_0x56aec2(0x17d))/0x4*(-parseInt(_0x56aec2(0x176))/0x5)+parseInt(_0x56aec2(0x16f))/0x6+parseInt(_0x56aec2(0x174))/0x7+-parseInt(_0x56aec2(0x16d))/0x8+parseInt(_0x56aec2(0x170))/0x9;if(_0x3476b4===_0x1e1c5a)break;else _0x2e0b17['push'](_0x2e0b17['shift']());}catch(_0x4edd3e){_0x2e0b17['push'](_0x2e0b17['shift']());}}}(a213_0x263b,0xc7dd1));import a213_0x217500 from'string-width';export function stringWidth(_0x1e7d43){return a213_0x217500(_0x1e7d43);}export function padEnd(_0x1de00a,_0x5c6bb7){const _0x3e0a56=a213_0x300f,_0x4fbd21=stringWidth(_0x1de00a);if(_0x4fbd21>=_0x5c6bb7)return _0x1de00a;return _0x1de00a+'\x20'[_0x3e0a56(0x175)](_0x5c6bb7-_0x4fbd21);}export function padStart(_0x51e228,_0x1ebb7d){const _0x50a02f=a213_0x300f,_0x4f4660=stringWidth(_0x51e228);if(_0x4f4660>=_0x1ebb7d)return _0x51e228;return'\x20'[_0x50a02f(0x175)](_0x1ebb7d-_0x4f4660)+_0x51e228;}export function centerAlign(_0x3d2993,_0x35d65){const _0x52badd=a213_0x300f,_0x3e495d=stringWidth(_0x3d2993);if(_0x3e495d>_0x35d65){if(_0x35d65<=0x1)return'…'[_0x52badd(0x16c)](0x0,_0x35d65);let _0x3a8dde=_0x3d2993;while(stringWidth(_0x3a8dde+'…')>_0x35d65){_0x3a8dde=_0x3a8dde[_0x52badd(0x16a)](0x0,-0x1);}return _0x3a8dde+'…';}if(_0x3e495d===_0x35d65)return _0x3d2993;const _0x1e355f=_0x35d65-_0x3e495d,_0x1dfcd9=Math[_0x52badd(0x172)](_0x1e355f/0x2),_0x10d674=_0x1e355f-_0x1dfcd9;return'\x20'[_0x52badd(0x175)](_0x1dfcd9)+_0x3d2993+'\x20'[_0x52badd(0x175)](_0x10d674);}export function escapeStringLiteral(_0x158236){const _0x2a6b39=a213_0x300f;if(!_0x158236||_0x158236['trim']()['length']===0x0)throw new Error(_0x2a6b39(0x179));const _0x3687cb=_0x158236[_0x2a6b39(0x178)](/'/g,'\x27\x27');return'\x27'+_0x3687cb+'\x27';}function a213_0x300f(_0x5cd19c,_0x46773d){_0x5cd19c=_0x5cd19c-0x169;const _0x263b96=a213_0x263b();let _0x300fee=_0x263b96[_0x5cd19c];return _0x300fee;}export function globToLike(_0x133ae6){const _0x295cc4=a213_0x300f;let _0xdaf367=_0x133ae6[_0x295cc4(0x178)](/\\/g,'\x5c\x5c')['replace'](/%/g,'\x5c%')['replace'](/_/g,'\x5c_');return _0xdaf367=_0xdaf367[_0x295cc4(0x178)](/\*/g,'%')[_0x295cc4(0x178)](/\?/g,'_'),_0xdaf367;}export function buildLikePattern(_0xae6a8d){const _0x27dcfc=a213_0x300f;if(!_0xae6a8d||_0xae6a8d['trim']()[_0x27dcfc(0x17a)]===0x0)throw new Error(_0x27dcfc(0x177));const _0x53122c=globToLike(_0xae6a8d),_0x54448b=_0x53122c[_0x27dcfc(0x178)](/'/g,'\x27\x27');return'\x27'+_0x54448b+'\x27';}function a213_0x263b(){const _0x5e5be3=['test','4447387jDtUkv','repeat','10oNIGMC','Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string','replace','Cannot\x20escape\x20empty\x20string\x20literal','length','unknown','25446lWDvCp','1846304pUvOvc','toLowerCase','random','slice','toString','substring','12274840EzfyHc','1513023tRvkFl','7772262WNXOcM','21718332VZTYKq','105DvxMBt','floor'];a213_0x263b=function(){return _0x5e5be3;};return a213_0x263b();}export function matchGlobPattern(_0x32a3e9,_0x35c95b){const _0x19c04f=a213_0x300f,_0x2299d7=_0x35c95b['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x19c04f(0x178)](/\*/g,'.*')[_0x19c04f(0x178)](/\?/g,'.'),_0xa7e723=new RegExp('^'+_0x2299d7+'$');return _0xa7e723[_0x19c04f(0x173)](_0x32a3e9);}export function getSanitizedUsername(){const _0x1b7489=a213_0x300f,_0x9a363f=process.env.USER||process.env.USERNAME||_0x1b7489(0x17b);return _0x9a363f['replace'](/[^a-zA-Z0-9]/g,'')[_0x1b7489(0x17e)]();}export function generateRandomHex(){const _0x54ca21=a213_0x300f,_0x42f957=Math['floor'](Math[_0x54ca21(0x169)]()*0xfffff);return _0x42f957[_0x54ca21(0x16b)](0x10)['padStart'](0x5,'0');}export function sanitizeFileName(_0xa95d47){const _0x3966cf=a213_0x300f;return _0xa95d47[_0x3966cf(0x17e)]()[_0x3966cf(0x178)](/[/\\:*?"<>|]/g,'-')[_0x3966cf(0x178)](/\s+/g,'-')[_0x3966cf(0x178)](/-+/g,'-')[_0x3966cf(0x178)](/^-|-$/g,'');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a214_0x4bb2(_0x22faf3,_0xaffa7d){_0x22faf3=_0x22faf3-0x130;const _0x707675=a214_0x7076();let _0x4bb21e=_0x707675[_0x22faf3];return _0x4bb21e;}(function(_0x4cf5a0,_0x58c339){const _0x1728b3=a214_0x4bb2,_0x531f22=_0x4cf5a0();while(!![]){try{const _0x3e81b5=parseInt(_0x1728b3(0x13a))/0x1+-parseInt(_0x1728b3(0x145))/0x2+parseInt(_0x1728b3(0x135))/0x3*(-parseInt(_0x1728b3(0x144))/0x4)+parseInt(_0x1728b3(0x142))/0x5+-parseInt(_0x1728b3(0x13f))/0x6+-parseInt(_0x1728b3(0x134))/0x7+-parseInt(_0x1728b3(0x136))/0x8*(-parseInt(_0x1728b3(0x13c))/0x9);if(_0x3e81b5===_0x58c339)break;else _0x531f22['push'](_0x531f22['shift']());}catch(_0x26863b){_0x531f22['push'](_0x531f22['shift']());}}}(a214_0x7076,0xb93d9));function hasWildcard(_0x396ee8){const _0x377585=a214_0x4bb2;return _0x396ee8[_0x377585(0x141)]('*')||_0x396ee8['includes']('?');}export function parseTableReference(_0x105535){const _0x282e5d=a214_0x4bb2;if(!_0x105535||_0x105535[_0x282e5d(0x139)]()[_0x282e5d(0x131)]===0x0)throw new Error(_0x282e5d(0x140));const _0x53b6c9=_0x105535['trim'](),_0x2e6b5e={'original':_0x53b6c9},_0x189305=_0x53b6c9[_0x282e5d(0x132)]('.');if(_0x189305['length']===0x1){const _0x46e908=_0x189305[0x0];if(!_0x46e908)throw new Error('Pattern\x20cannot\x20be\x20just\x20a\x20dot');_0x2e6b5e[_0x282e5d(0x130)]=_0x46e908;}else{if(_0x189305[_0x282e5d(0x131)]===0x2){const [_0x4aeb91,_0x491a94]=_0x189305;if(!_0x4aeb91)throw new Error(_0x282e5d(0x13e));if(!_0x491a94)throw new Error('Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)');_0x2e6b5e[_0x282e5d(0x143)]=_0x4aeb91,_0x2e6b5e[_0x282e5d(0x130)]=_0x491a94;}else{if(_0x189305[_0x282e5d(0x131)]===0x3){const [_0x2dab3d,_0x24a4d9,_0x202c68]=_0x189305;if(!_0x2dab3d||!_0x24a4d9||!_0x202c68)throw new Error('Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty');_0x2e6b5e[_0x282e5d(0x137)]=_0x2dab3d,_0x2e6b5e[_0x282e5d(0x143)]=_0x24a4d9,_0x2e6b5e[_0x282e5d(0x130)]=_0x202c68;}else throw new Error(_0x282e5d(0x133));}}return _0x2e6b5e;}function a214_0x7076(){const _0x3c51f3=['Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','9915780UvseSP','522VlWEQY','8MUmQzm','catalog','join','trim','762987mLxKrr','Table\x20name\x20is\x20required\x20for\x20describe\x20operation','13135896MUVops','push','Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','529170gAjRUP','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','includes','7022720xUEKCI','database','27176QVsoap','362878TrqYsz','table','length','split'];a214_0x7076=function(){return _0x3c51f3;};return a214_0x7076();}export function formatTableReference(_0x3ea7eb){const _0x11a832=a214_0x4bb2,_0x45fe4d=[];return _0x3ea7eb[_0x11a832(0x137)]&&_0x45fe4d['push'](_0x3ea7eb[_0x11a832(0x137)]),_0x3ea7eb[_0x11a832(0x143)]&&_0x45fe4d[_0x11a832(0x13d)](_0x3ea7eb[_0x11a832(0x143)]),_0x3ea7eb[_0x11a832(0x130)]&&_0x45fe4d['push'](_0x3ea7eb[_0x11a832(0x130)]),_0x45fe4d[_0x11a832(0x138)]('.');}export function validateTableListReference(_0x146349){return undefined;}export function validateTableDescribeReference(_0x126aa3){const _0x583380=a214_0x4bb2;if(!_0x126aa3[_0x583380(0x130)])return _0x583380(0x13b);if(_0x126aa3['database']&&hasWildcard(_0x126aa3[_0x583380(0x143)]))return'Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation';if(hasWildcard(_0x126aa3['table']))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 a215_0x494fe6=a215_0x3505;(function(_0xea8d3c,_0x2da597){const _0x1dcbac=a215_0x3505,_0x101540=_0xea8d3c();while(!![]){try{const _0x3ebeb9=parseInt(_0x1dcbac(0x1cf))/0x1*(parseInt(_0x1dcbac(0x1cb))/0x2)+parseInt(_0x1dcbac(0x1d1))/0x3+-parseInt(_0x1dcbac(0x1c7))/0x4+parseInt(_0x1dcbac(0x1c8))/0x5*(parseInt(_0x1dcbac(0x1d9))/0x6)+-parseInt(_0x1dcbac(0x1cd))/0x7+-parseInt(_0x1dcbac(0x1d7))/0x8*(-parseInt(_0x1dcbac(0x1c4))/0x9)+-parseInt(_0x1dcbac(0x1df))/0xa*(parseInt(_0x1dcbac(0x1d6))/0xb);if(_0x3ebeb9===_0x2da597)break;else _0x101540['push'](_0x101540['shift']());}catch(_0x578a8f){_0x101540['push'](_0x101540['shift']());}}}(a215_0x4307,0x8278b));import{join}from'path';import{Logger,LogLevel,FileHandler,ConsoleHandler,DefaultLogFormatter}from'./logger/index.js';import{getGlobalCacheDir}from'./global-cache.js';export{LogLevel}from'./logger/index.js';export class TDXLogger{[a215_0x494fe6(0x1c5)];['fileOnly'];[a215_0x494fe6(0x1d0)];[a215_0x494fe6(0x1c9)];[a215_0x494fe6(0x1dc)];['fileHandler']=null;[a215_0x494fe6(0x1db)]=null;constructor(_0x5c54bc=LogLevel[a215_0x494fe6(0x1d3)],_0x12f544=![],_0x196cd9,_0x3923ee=a215_0x494fe6(0x1e0)){const _0x223f9a=a215_0x494fe6;this['logLevel']=_0x5c54bc,this[_0x223f9a(0x1cc)]=_0x12f544,this[_0x223f9a(0x1d0)]=_0x196cd9||join(getGlobalCacheDir(),_0x223f9a(0x1e1)),this['logFileName']=_0x3923ee,this['logger']=Logger['of'](_0x223f9a(0x1c3));}async[a215_0x494fe6(0x1c0)](){const _0x4c6cc4=a215_0x494fe6,_0x26f8bd=join(this['logDir'],this[_0x4c6cc4(0x1c9)]);if(Logger[_0x4c6cc4(0x1c6)]()){!this['fileOnly']&&(this['consoleHandler']=new ConsoleHandler({'minLevel':LogLevel[_0x4c6cc4(0x1d3)],'colors':!![]}),Logger[_0x4c6cc4(0x1ce)](this['consoleHandler']));return;}this[_0x4c6cc4(0x1ca)]=new FileHandler({'filePath':_0x26f8bd});const _0x15ea51=[this[_0x4c6cc4(0x1ca)]];!this[_0x4c6cc4(0x1cc)]&&(this[_0x4c6cc4(0x1db)]=new ConsoleHandler({'minLevel':LogLevel['INFO'],'colors':!![]}),_0x15ea51[_0x4c6cc4(0x1da)](this[_0x4c6cc4(0x1db)])),await Logger[_0x4c6cc4(0x1c0)]({'defaultLevel':this[_0x4c6cc4(0x1c5)],'handlers':_0x15ea51,'formatter':new DefaultLogFormatter({'colors':!![]})});}[a215_0x494fe6(0x1de)](..._0xe38dc8){const _0x2ac88d=a215_0x494fe6;this[_0x2ac88d(0x1dc)][_0x2ac88d(0x1de)](..._0xe38dc8);}[a215_0x494fe6(0x1c1)](..._0xeebf5c){const _0x33d528=a215_0x494fe6;this['logger'][_0x33d528(0x1c1)](..._0xeebf5c);}['info'](..._0x1f8b25){this['logger']['info'](..._0x1f8b25);}[a215_0x494fe6(0x1d5)](..._0x1586b7){const _0x3ea507=a215_0x494fe6;this[_0x3ea507(0x1dc)]['warn'](..._0x1586b7);}[a215_0x494fe6(0x1c2)](..._0x2ee96b){const _0x3e9a1c=a215_0x494fe6;this[_0x3e9a1c(0x1dc)][_0x3e9a1c(0x1c2)](..._0x2ee96b);}async['close'](){const _0x57ffdb=a215_0x494fe6;this[_0x57ffdb(0x1dc)][_0x57ffdb(0x1d2)](_0x57ffdb(0x1d4)),await Logger[_0x57ffdb(0x1dd)]();}[a215_0x494fe6(0x1d8)](){const _0x14e070=a215_0x494fe6;return join(this[_0x14e070(0x1d0)],this[_0x14e070(0x1c9)]);}}function a215_0x3505(_0x3d9d3a,_0x55a79d){_0x3d9d3a=_0x3d9d3a-0x1c0;const _0x43071b=a215_0x4307();let _0x35055d=_0x43071b[_0x3d9d3a];return _0x35055d;}function a215_0x4307(){const _0x135a41=['logger','shutdown','debug','90dBOGaw','tdx.log','logs','init','trace','error','tdx','135747ZyRwpu','logLevel','isInitialized','1655028KYvDza','80ZJWpyM','logFileName','fileHandler','4gtDnEE','fileOnly','4876585JtTayV','addHandler','114916tnbvOp','logDir','2357100QqsMqE','info','INFO','Session\x20ended','warn','779031Nuvlcs','192xiPGvw','getLogPath','339258lvPOUH','push','consoleHandler'];a215_0x4307=function(){return _0x135a41;};return a215_0x4307();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a216_0x3220ab=a216_0x4f39;(function(_0x263089,_0x2c0a8b){const _0x585eb2=a216_0x4f39,_0x1500cc=_0x263089();while(!![]){try{const _0x2ddaba=-parseInt(_0x585eb2(0xd5))/0x1*(parseInt(_0x585eb2(0xf9))/0x2)+parseInt(_0x585eb2(0xd2))/0x3*(-parseInt(_0x585eb2(0xf6))/0x4)+parseInt(_0x585eb2(0xed))/0x5+parseInt(_0x585eb2(0xf1))/0x6*(parseInt(_0x585eb2(0xe7))/0x7)+-parseInt(_0x585eb2(0xd4))/0x8*(-parseInt(_0x585eb2(0xee))/0x9)+-parseInt(_0x585eb2(0xe5))/0xa+parseInt(_0x585eb2(0xf5))/0xb;if(_0x2ddaba===_0x2c0a8b)break;else _0x1500cc['push'](_0x1500cc['shift']());}catch(_0x37fcf2){_0x1500cc['push'](_0x1500cc['shift']());}}}(a216_0x5683,0x1fd04));import{get}from'https';import{gt,valid}from'semver';function a216_0x4f39(_0x4cb2fe,_0x245b64){_0x4cb2fe=_0x4cb2fe-0xd0;const _0x5683e1=a216_0x5683();let _0x4f39a6=_0x5683e1[_0x4cb2fe];return _0x4f39a6;}import a216_0x176930 from'chalk';import{createGlobalCache}from'./global-cache.js';function a216_0x5683(){const _0x1ab3b3=['956644FjimHC','utils/version-check','destroy','433118gvslnE','latestVersion','unref','latest','read','Run:','currentVersion','\x0aUpdate\x20available:\x20','HTTP\x20','3yrPEAi','dim','5912zgoVDV','1jeyduy','version','gray','toISOString','statusCode','stable','next','last_version_check','utils/version-check-next','\x0aRun:\x20','socket','lastCheck','stderr','Update\x20available:','last_version_check_next','isTTY','2449500HfOnkk','end','7wwTZBJ','channel','cyan','Request\x20timeout','tdx\x20upgrade','now','1129840Vcgtgd','36QUVKxr','getTime','parse','60972hWRAbk','tdx\x20upgrade\x20--next','updateAvailable','write','6510812duerKw'];a216_0x5683=function(){return _0x1ab3b3;};return a216_0x5683();}const CACHE_DURATION_MS=0x18*0x3c*0x3c*0x3e8,NPM_REGISTRY_BASE='https://registry.npmjs.org/@treasuredata/tdx',TIMEOUT_MS=0x7d0,stableVersionCache=createGlobalCache(a216_0x3220ab(0xdc),a216_0x3220ab(0xf7)),nextVersionCache=createGlobalCache(a216_0x3220ab(0xe3),a216_0x3220ab(0xdd));function getCacheForChannel(_0x1ddd59){const _0x2c9b2d=a216_0x3220ab;return _0x1ddd59===_0x2c9b2d(0xdb)?nextVersionCache:stableVersionCache;}function readCache(_0xbb614c){const _0x1dd090=a216_0x3220ab;return getCacheForChannel(_0xbb614c)[_0x1dd090(0xfd)]()??null;}function writeCache(_0x645fef,_0x592a69){const _0x25cb57=a216_0x3220ab;try{getCacheForChannel(_0x592a69)[_0x25cb57(0xf4)]({'lastCheck':new Date()[_0x25cb57(0xd8)](),'latestVersion':_0x645fef});}catch{}}function isCacheValid(_0x2883e3){const _0x210d05=a216_0x3220ab;if(!_0x2883e3)return![];const _0x181229=new Date(_0x2883e3[_0x210d05(0xe0)])[_0x210d05(0xef)](),_0x58872c=Date[_0x210d05(0xec)]();return _0x58872c-_0x181229<CACHE_DURATION_MS;}export function fetchLatestVersion(_0x32d95b=a216_0x3220ab(0xda)){const _0x2f786d=a216_0x3220ab,_0x5037fb=_0x32d95b===_0x2f786d(0xdb)?_0x2f786d(0xdb):_0x2f786d(0xfc),_0x4a6c24=NPM_REGISTRY_BASE+'/'+_0x5037fb;return new Promise((_0x24700e,_0x207450)=>{const _0x274afa=_0x2f786d,_0x1e9c74=get(_0x4a6c24,{'timeout':TIMEOUT_MS},_0x787fc1=>{const _0x27c8ca=a216_0x4f39;if(_0x787fc1[_0x27c8ca(0xd9)]!==0xc8){clearTimeout(_0x421175),_0x207450(new Error(_0x27c8ca(0xd1)+_0x787fc1[_0x27c8ca(0xd9)]));return;}let _0x16a82f='';_0x787fc1['on']('data',_0x4ae25a=>{_0x16a82f+=_0x4ae25a;}),_0x787fc1['on'](_0x27c8ca(0xe6),()=>{const _0x9d5e9e=_0x27c8ca;clearTimeout(_0x421175);try{const _0x25b19b=JSON[_0x9d5e9e(0xf0)](_0x16a82f);if(!valid(_0x25b19b[_0x9d5e9e(0xd6)])){_0x207450(new Error('Invalid\x20version\x20format'));return;}_0x24700e(_0x25b19b[_0x9d5e9e(0xd6)]);}catch(_0x3d17fb){_0x207450(_0x3d17fb);}});})['on']('error',_0x1529bf=>{clearTimeout(_0x421175),_0x207450(_0x1529bf);});_0x1e9c74['on'](_0x274afa(0xdf),_0x1a9b5b=>{const _0x537a98=_0x274afa;_0x1a9b5b[_0x537a98(0xfb)]();});const _0x421175=setTimeout(()=>{const _0x427c05=_0x274afa;_0x1e9c74[_0x427c05(0xf8)](),_0x207450(new Error(_0x427c05(0xea)));},TIMEOUT_MS);_0x421175[_0x274afa(0xfb)]();});}export async function checkForUpdate(_0xfb9f90,_0x333b34=a216_0x3220ab(0xda)){const _0x5e34fe=a216_0x3220ab;try{const _0x1352b1=readCache(_0x333b34);if(isCacheValid(_0x1352b1)){const _0x523056=gt(_0x1352b1[_0x5e34fe(0xfa)],_0xfb9f90);return{'updateAvailable':_0x523056,'currentVersion':_0xfb9f90,'latestVersion':_0x1352b1[_0x5e34fe(0xfa)],'channel':_0x333b34};}const _0x2d25a5=await fetchLatestVersion(_0x333b34);writeCache(_0x2d25a5,_0x333b34);const _0x2b2e6e=gt(_0x2d25a5,_0xfb9f90);return{'updateAvailable':_0x2b2e6e,'currentVersion':_0xfb9f90,'latestVersion':_0x2d25a5,'channel':_0x333b34};}catch{return null;}}export function displayUpdateNotification(_0x28fe6f){const _0x38f3bb=a216_0x3220ab;if(!_0x28fe6f[_0x38f3bb(0xf3)])return;const _0x1f6e2f=_0x28fe6f[_0x38f3bb(0xe8)]===_0x38f3bb(0xdb)?_0x38f3bb(0xf2):_0x38f3bb(0xeb),_0x2155e6=process[_0x38f3bb(0xe1)][_0x38f3bb(0xe4)]&&!process.env.NO_COLOR,_0x440624=_0x2155e6?a216_0x176930[_0x38f3bb(0xd7)]('→'):'→',_0x4f79ac=_0x2155e6?a216_0x176930[_0x38f3bb(0xd3)](_0x28fe6f[_0x38f3bb(0xff)]):_0x28fe6f[_0x38f3bb(0xff)],_0x33b7d0=_0x2155e6?a216_0x176930['green'](_0x28fe6f[_0x38f3bb(0xfa)]):_0x28fe6f['latestVersion'],_0x2f578b=_0x2155e6?a216_0x176930[_0x38f3bb(0xe9)](_0x1f6e2f):_0x1f6e2f,_0x246a61=_0x2155e6?'\x0a'+a216_0x176930['yellow'](_0x38f3bb(0xe2))+'\x20'+_0x4f79ac+'\x20'+_0x440624+'\x20'+_0x33b7d0+'\x0a'+a216_0x176930[_0x38f3bb(0xd3)](_0x38f3bb(0xfe))+'\x20'+_0x2f578b+'\x0a':_0x38f3bb(0xd0)+_0x4f79ac+'\x20'+_0x440624+'\x20'+_0x33b7d0+_0x38f3bb(0xde)+_0x2f578b+'\x0a';process[_0x38f3bb(0xe1)][_0x38f3bb(0xf4)](_0x246a61);}
|