@treasuredata/tdx 0.7.0 → 0.7.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/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/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/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/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-pwd-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/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/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/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/api.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/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.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.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.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/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x8bc473=a33_0x2e28;(function(_0x443a52,_0x55c9fa){const _0x275b28=a33_0x2e28,_0x5c27aa=_0x443a52();while(!![]){try{const _0x217f39=-parseInt(_0x275b28(0x19f))/0x1+parseInt(_0x275b28(0x1b2))/0x2+parseInt(_0x275b28(0x1ad))/0x3+parseInt(_0x275b28(0x1a7))/0x4*(parseInt(_0x275b28(0x1c4))/0x5)+-parseInt(_0x275b28(0x1ba))/0x6*(-parseInt(_0x275b28(0x19a))/0x7)+-parseInt(_0x275b28(0x1b5))/0x8+-parseInt(_0x275b28(0x1a9))/0x9;if(_0x217f39===_0x55c9fa)break;else _0x5c27aa['push'](_0x5c27aa['shift']());}catch(_0x552258){_0x5c27aa['push'](_0x5c27aa['shift']());}}}(a33_0x18fe,0xb734a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a33_0x18fe(){const _0x4c3152=['type','includes','4842FVGFME','Resolving\x20folder\x20\x27','✔\x20Updated\x20segment\x20\x27','kind','updateSegmentById','verbose','Update\x20existing\x20child\x20segment','Resolved\x20folder\x20ID:\x20','INTERNAL','length','8940IDsiPq','\x20\x20\x20Path:\x20','Resolved\x20type:\x20','Parent\x20ID:\x20','10850RCzzRM','segment:update','execute','segmentName','Error:\x20Cannot\x20update\x20','752881TcGDow','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','segmentId','folder','Updating\x20segment\x20\x27','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','error','resolveFolderId','2804zhXGoc','data','11211588sDxpiN','description','resolvePathToResource','segment','872292kbYccF','\x27...','ruleFile','segmentPath','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','1706946AIGrdm','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Segment\x20ID:\x20','7195616bPUvcd','name','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a33_0x18fe=function(){return _0x4c3152;};return a33_0x18fe();}function a33_0x2e28(_0x55b70e,_0x5988d3){const _0x18feed=a33_0x18fe();return a33_0x2e28=function(_0x2e28fe,_0x542d07){_0x2e28fe=_0x2e28fe-0x199;let _0x2e8f79=_0x18feed[_0x2e28fe];return _0x2e8f79;},a33_0x2e28(_0x55b70e,_0x5988d3);}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a33_0x8bc473(0x1b6)]=a33_0x8bc473(0x19b);[a33_0x8bc473(0x1aa)]=a33_0x8bc473(0x1c0);async[a33_0x8bc473(0x19c)](_0x4b19b0){const _0x2e50fa=a33_0x8bc473,{options:_0x5d8101,args:_0x2d1ce3,tdx:_0x111e99}=_0x4b19b0,_0x487837=_0x5d8101;if(_0x2d1ce3[_0x2e50fa(0x1c3)]===0x0)return console[_0x2e50fa(0x1a5)](_0x2e50fa(0x1b1)),console[_0x2e50fa(0x1a5)](_0x2e50fa(0x1b3)),console['error']('Examples:'),console['error'](_0x2e50fa(0x1a0)),console[_0x2e50fa(0x1a5)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2fc60e=_0x2d1ce3[0x0],_0x2e6000=_0x5d8101[_0x2e50fa(0x1b0)];let _0x27a152=_0x2fc60e;_0x2e6000&&!_0x2fc60e[_0x2e50fa(0x1b9)]('/')&&(_0x27a152=_0x2e6000+'/'+_0x2fc60e,_0x487837[_0x2e50fa(0x1bf)]&&console[_0x2e50fa(0x1a5)]('Resolved\x20relative\x20path\x20to:\x20'+_0x27a152));const _0x1951e1=await withSpinner('Resolving\x20path\x20\x27'+_0x27a152+'\x27...',()=>_0x111e99[_0x2e50fa(0x1ac)][_0x2e50fa(0x1ab)](_0x27a152),{'verbose':_0x487837[_0x2e50fa(0x1bf)]}),_0x54af0a=_0x1951e1[_0x2e50fa(0x1a8)];_0x487837[_0x2e50fa(0x1bf)]&&console[_0x2e50fa(0x1a5)](_0x2e50fa(0x1c6)+_0x54af0a['type']);if(_0x54af0a[_0x2e50fa(0x1b8)]!==_0x2e50fa(0x1ac))return console[_0x2e50fa(0x1a5)](_0x2e50fa(0x19e)+_0x54af0a[_0x2e50fa(0x1b8)]+_0x2e50fa(0x1a4)),console[_0x2e50fa(0x1a5)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x54af0a[_0x2e50fa(0x1a1)])throw new SDKError(ErrorCode[_0x2e50fa(0x1c2)],_0x2e50fa(0x1b7));const _0x2c3c5d=_0x54af0a['parentId'],_0x2ab6dc=_0x54af0a[_0x2e50fa(0x1a1)];_0x487837[_0x2e50fa(0x1bf)]&&(console[_0x2e50fa(0x1a5)](_0x2e50fa(0x199)+_0x2c3c5d),console[_0x2e50fa(0x1a5)](_0x2e50fa(0x1b4)+_0x2ab6dc));let _0x6db7a1;if(_0x487837[_0x2e50fa(0x1a2)]){const _0x1d1505=_0x487837[_0x2e50fa(0x1a2)],_0x4abf91=await withSpinner(_0x2e50fa(0x1bb)+_0x1d1505+_0x2e50fa(0x1ae),()=>_0x111e99[_0x2e50fa(0x1ac)][_0x2e50fa(0x1a6)](_0x2c3c5d,_0x1d1505),{'verbose':_0x487837[_0x2e50fa(0x1bf)]});_0x6db7a1=parseInt(_0x4abf91[_0x2e50fa(0x1a8)],0xa),_0x487837['verbose']&&console[_0x2e50fa(0x1a5)](_0x2e50fa(0x1c1)+_0x6db7a1);}const _0xcb7185=await loadJSONFromOptions(_0x487837['rule'],_0x487837[_0x2e50fa(0x1af)]),_0x40a7e8={'name':_0x487837[_0x2e50fa(0x1b6)],'description':_0x487837[_0x2e50fa(0x1aa)],'rule':_0xcb7185,'kind':_0x487837[_0x2e50fa(0x1bd)]!==undefined?parseInt(_0x487837[_0x2e50fa(0x1bd)],0xa):undefined,'segmentFolderId':_0x6db7a1},_0x1559ef=await withSpinner(_0x2e50fa(0x1a3)+_0x54af0a[_0x2e50fa(0x19d)]+_0x2e50fa(0x1ae),()=>_0x111e99[_0x2e50fa(0x1ac)][_0x2e50fa(0x1be)](_0x2c3c5d,_0x2ab6dc,_0x40a7e8),{'verbose':_0x487837[_0x2e50fa(0x1bf)]}),_0x16edde=_0x1559ef[_0x2e50fa(0x1a8)];return console[_0x2e50fa(0x1a5)](_0x2e50fa(0x1bc)+_0x16edde[_0x2e50fa(0x1b6)]+'\x27'),_0x27a152!==_0x2fc60e&&console[_0x2e50fa(0x1a5)](_0x2e50fa(0x1c5)+_0x27a152),await handleSDKOutput([_0x16edde],_0x487837),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a34_0x34d0(){const _0x12f995=['name','Examples:','join','\x27...','Context\x20set\x20to:\x20','parentName','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','6521148wXQPRe','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','parentId','10YmtEqx','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','262984CEENKy','slice','segment','Site:\x20','isAbsolute','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','1445508LBDUpS','16fzWLCx','error','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Target\x20path:\x20','116033NsGavq','231XDPVge','segments','verbose','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segmentPath','Context\x20cleared.\x20Back\x20to\x20root.','split','log','616456CZQYbO','77mZPQPp','folderId','1897330ENmeGv','site','type','fullPath','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','execute','Usage:\x20tdx\x20segment\x20use\x20<path>','1076538qSQhHj','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','length','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'];a34_0x34d0=function(){return _0x12f995;};return a34_0x34d0();}const a34_0x1eed29=a34_0x3c15;(function(_0x508022,_0x45da26){const _0x42472a=a34_0x3c15,_0x5c53f1=_0x508022();while(!![]){try{const _0x1fa8e2=-parseInt(_0x42472a(0x1c6))/0x1*(parseInt(_0x42472a(0x1c2))/0x2)+parseInt(_0x42472a(0x1c1))/0x3+-parseInt(_0x42472a(0x1cf))/0x4*(parseInt(_0x42472a(0x1b9))/0x5)+-parseInt(_0x42472a(0x1da))/0x6+-parseInt(_0x42472a(0x1c7))/0x7*(-parseInt(_0x42472a(0x1bb))/0x8)+-parseInt(_0x42472a(0x1b6))/0x9+-parseInt(_0x42472a(0x1d2))/0xa*(-parseInt(_0x42472a(0x1d0))/0xb);if(_0x1fa8e2===_0x45da26)break;else _0x5c53f1['push'](_0x5c53f1['shift']());}catch(_0x16f4d0){_0x5c53f1['push'](_0x5c53f1['shift']());}}}(a34_0x34d0,0xb8271));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a34_0x3c15(_0xd014d6,_0x16d683){const _0x34d0cd=a34_0x34d0();return a34_0x3c15=function(_0x3c1503,_0x217222){_0x3c1503=_0x3c1503-0x1b3;let _0x1eafd7=_0x34d0cd[_0x3c1503];return _0x1eafd7;},a34_0x3c15(_0xd014d6,_0x16d683);}export class SegmentUseCommand extends BaseCommand{[a34_0x1eed29(0x1df)]=a34_0x1eed29(0x1d6);['description']=a34_0x1eed29(0x1b7);async[a34_0x1eed29(0x1d8)](_0x47680c){const _0x5a52ff=a34_0x1eed29,{options:_0x3fd392,args:_0x25955d,tdx:_0x2bfb77}=_0x47680c;if(_0x25955d['length']===0x0)return console[_0x5a52ff(0x1c3)]('Error:\x20Path\x20is\x20required'),console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1d9)),console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1e0)),console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1de)),console['error'](_0x5a52ff(0x1ca)),console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1c4)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x19e9e6=_0x25955d[0x0],_0x560cc9=_0x3fd392['session'];try{if(_0x19e9e6==='/')return saveSessionContext({'segment_path':undefined},_0x560cc9),console['log'](_0x5a52ff(0x1cc)),0x0;const _0x2d9105=_0x3fd392[_0x5a52ff(0x1cb)];let _0x5ab4fb=_0x19e9e6;const _0x4bfd01=parsePath(_0x19e9e6);if(!_0x4bfd01[_0x5a52ff(0x1bf)]){if(!_0x2d9105)return console[_0x5a52ff(0x1c3)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1c0)),0x1;if(_0x19e9e6==='..'){const _0x1b139c=_0x2d9105[_0x5a52ff(0x1cd)]('/')[_0x5a52ff(0x1bc)](0x0,-0x1)['join']('/');_0x5ab4fb=_0x1b139c||'/';}else _0x19e9e6==='.'?_0x5ab4fb=_0x2d9105:_0x5ab4fb=_0x2d9105+'/'+_0x19e9e6;_0x3fd392['verbose']&&console[_0x5a52ff(0x1c3)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5ab4fb);}if(_0x5ab4fb==='/'||_0x5ab4fb==='')return saveSessionContext({'segment_path':undefined},_0x560cc9),console[_0x5a52ff(0x1ce)](_0x5a52ff(0x1cc)),0x0;_0x5ab4fb=normalizePath(_0x5ab4fb);const _0x3f1ebe=parsePath(_0x5ab4fb)[_0x5a52ff(0x1c8)];if(_0x3f1ebe[_0x5a52ff(0x1dc)]===0x0)return saveSessionContext({'segment_path':undefined},_0x560cc9),console[_0x5a52ff(0x1ce)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x3fd392['verbose']&&(console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1be)+_0x3fd392[_0x5a52ff(0x1d3)]),console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1c5)+_0x5ab4fb));const _0x1badd5=await withSpinner('Resolving\x20path\x20\x27'+_0x5ab4fb+_0x5a52ff(0x1e2),()=>_0x2bfb77['segment']['resolvePathToResource'](_0x5ab4fb),{'verbose':_0x3fd392[_0x5a52ff(0x1c9)]}),_0x5ba590=_0x1badd5['data'];_0x3fd392[_0x5a52ff(0x1c9)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x5ba590[_0x5a52ff(0x1d4)]),console[_0x5a52ff(0x1c3)]('Parent\x20ID:\x20'+_0x5ba590[_0x5a52ff(0x1b8)]),_0x5ba590[_0x5a52ff(0x1d1)]&&console['error'](_0x5a52ff(0x1dd)+_0x5ba590[_0x5a52ff(0x1d1)]));if(_0x5ba590[_0x5a52ff(0x1d4)]===_0x5a52ff(0x1bd))return console['error']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1ba)),console[_0x5a52ff(0x1c3)]('Use:\x20tdx\x20segment\x20use\x20'+_0x5ba590[_0x5a52ff(0x1b4)]+(_0x5ba590['folderPath']?'/'+_0x5ba590['folderPath'][_0x5a52ff(0x1e1)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x5ba590[_0x5a52ff(0x1d5)],'parent_segment':_0x5ba590['parentName']},_0x560cc9),console[_0x5a52ff(0x1ce)](_0x5a52ff(0x1b3)+_0x5ba590[_0x5a52ff(0x1d5)]),_0x3fd392['verbose']&&(console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1d7)),console['error'](_0x5a52ff(0x1b5)),console[_0x5a52ff(0x1c3)](_0x5a52ff(0x1db))),0x0;}catch(_0x1064c4){throw _0x1064c4;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0xf6c952=a35_0x55bf;(function(_0xbd2fb7,_0x339571){const _0x393c24=a35_0x55bf,_0x2791a2=_0xbd2fb7();while(!![]){try{const _0x1a86d7=-parseInt(_0x393c24(0x1e6))/0x1+parseInt(_0x393c24(0x1f9))/0x2+parseInt(_0x393c24(0x1c4))/0x3*(parseInt(_0x393c24(0x1e2))/0x4)+-parseInt(_0x393c24(0x1dc))/0x5*(parseInt(_0x393c24(0x1d3))/0x6)+parseInt(_0x393c24(0x1eb))/0x7*(-parseInt(_0x393c24(0x1c2))/0x8)+parseInt(_0x393c24(0x1d1))/0x9*(parseInt(_0x393c24(0x1ef))/0xa)+parseInt(_0x393c24(0x1f0))/0xb;if(_0x1a86d7===_0x339571)break;else _0x2791a2['push'](_0x2791a2['shift']());}catch(_0x424d39){_0x2791a2['push'](_0x2791a2['shift']());}}}(a35_0x3ec7,0x25d65));import{BaseCommand}from'./command.js';function a35_0x3ec7(){const _0x386ff6=['listUnified','name','Building\x20hierarchy\x20tree...','9279Anjkik','listParentsWithPattern','78iYaFdE','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','json','✔\x20Found\x20','\x20folder','segments','Listing\x20parent\x20segments\x20matching\x20\x27','👥\x20','Listing\x20folders\x20and\x20segments...','10365JlQRYI','message','parentId','log','population','execute','16vElOHa','Path/pattern\x20arg:\x20','dim','verbose','175051gtqrAX','\x20top-level\x20items','format','Current\x20context:\x20','jsonl','304906qPdKwe','length','includes','sort','590czoICc','6212239IJmRVi','Folder\x20ID:\x20','site','description','Error:\x20','replace','folder','\x20matching\x20\x27','recursive','3842gjuhmh','\x20segment','listParents','✔\x20Built\x20tree\x20with\x20','\x27...','folderId','segmentPath','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','\x20parent\x20segment','error','map','attributes','Recursive\x20mode:\x20enabled','\x20and\x20','segment','Parent\x20ID:\x20','56xEjses','cause','25791lZEWau','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','\x5c$&','localeCompare','[parent\x20segments]','data','Resolving\x20context\x20path\x20\x27','Site:\x20','resolvePathToResource','(empty)'];a35_0x3ec7=function(){return _0x386ff6;};return a35_0x3ec7();}import{SDKError}from'../sdk/index.js';function a35_0x55bf(_0x559947,_0x57ff39){const _0x3ec7ad=a35_0x3ec7();return a35_0x55bf=function(_0x55bf89,_0x210c76){_0x55bf89=_0x55bf89-0x1bd;let _0x144528=_0x3ec7ad[_0x55bf89];return _0x144528;},a35_0x55bf(_0x559947,_0x57ff39);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a35_0x1aabaf from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0xf6c952(0x1cf)]=a35_0xf6c952(0x1d8);[a35_0xf6c952(0x1f3)]=a35_0xf6c952(0x1d4);async[a35_0xf6c952(0x1e1)](_0x49e1d0){const _0x1e4658=a35_0xf6c952,{options:_0x3e4bdf,args:_0x17185c}=_0x49e1d0,_0x2bfb95=_0x3e4bdf[_0x1e4658(0x1f8)],_0x461235=_0x17185c[0x0];try{const _0x27c944=_0x3e4bdf[_0x1e4658(0x1ff)];_0x3e4bdf[_0x1e4658(0x1e5)]&&(console[_0x1e4658(0x202)](_0x1e4658(0x1cb)+_0x3e4bdf[_0x1e4658(0x1f2)]),console[_0x1e4658(0x202)](_0x1e4658(0x1e9)+(_0x27c944||'/')),_0x461235&&console[_0x1e4658(0x202)](_0x1e4658(0x1e3)+_0x461235),_0x2bfb95&&console[_0x1e4658(0x202)](_0x1e4658(0x1be)));if(_0x461235){const _0xcc9c36=_0x461235[_0x1e4658(0x1ed)]('*')||_0x461235[_0x1e4658(0x1ed)]('?');if(_0xcc9c36&&!_0x27c944)return await this['listParentsWithPattern'](_0x49e1d0,_0x461235);else return _0xcc9c36?(console[_0x1e4658(0x202)](_0x1e4658(0x200)),console[_0x1e4658(0x202)](_0x1e4658(0x1c5)),0x1):_0x2bfb95?await this['listRecursive'](_0x49e1d0,_0x461235):await this[_0x1e4658(0x1ce)](_0x49e1d0,_0x461235);}if(!_0x27c944)return await this[_0x1e4658(0x1fb)](_0x49e1d0);return _0x2bfb95?await this['listRecursive'](_0x49e1d0,_0x27c944):await this[_0x1e4658(0x1ce)](_0x49e1d0,_0x27c944);}catch(_0x5a372c){if(_0x5a372c instanceof SDKError)return console[_0x1e4658(0x202)](_0x1e4658(0x1f4)+_0x5a372c[_0x1e4658(0x1dd)]),_0x5a372c[_0x1e4658(0x1c3)]&&console[_0x1e4658(0x202)]('\x20\x20Cause:\x20'+_0x5a372c[_0x1e4658(0x1c3)]),0x1;throw _0x5a372c;}}async[a35_0xf6c952(0x1d2)](_0x3db626,_0x7be769){const _0x2d8ef5=a35_0xf6c952,{options:_0x49dfce,tdx:_0x28e20e}=_0x3db626,_0x125f52=await withSpinner(_0x2d8ef5(0x1d9)+_0x7be769+_0x2d8ef5(0x1fd),()=>_0x28e20e[_0x2d8ef5(0x1c0)][_0x2d8ef5(0x1fb)](),{'verbose':_0x49dfce[_0x2d8ef5(0x1e5)]}),_0xd80825=_0x125f52[_0x2d8ef5(0x1c9)],_0x530d0a=_0x7be769['replace'](/[.+^${}()|[\]\\]/g,_0x2d8ef5(0x1c6))[_0x2d8ef5(0x1f5)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1c9b72=new RegExp('^'+_0x530d0a+'$','i'),_0x88d19=_0xd80825['filter'](_0x5edaa4=>_0x1c9b72['test'](_0x5edaa4[_0x2d8ef5(0x1bd)][_0x2d8ef5(0x1cf)]));console[_0x2d8ef5(0x202)](_0x2d8ef5(0x1d6)+_0x88d19['length']+_0x2d8ef5(0x201)+(_0x88d19['length']!==0x1?'s':'')+_0x2d8ef5(0x1f7)+_0x7be769+'\x27');if(_0x49dfce[_0x2d8ef5(0x1e8)]===_0x2d8ef5(0x1d5)||_0x49dfce['format']===_0x2d8ef5(0x1ea))await handleSDKOutput(_0x88d19,_0x49dfce);else{if(_0x88d19['length']===0x0)console['log']('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x7be769);else{console[_0x2d8ef5(0x1df)](_0x2d8ef5(0x1c8));for(const _0x16989f of _0x88d19){const _0x8febd=_0x16989f[_0x2d8ef5(0x1bd)][_0x2d8ef5(0x1e0)]?a35_0x1aabaf[_0x2d8ef5(0x1e4)]('\x20('+formatRows(_0x16989f['attributes'][_0x2d8ef5(0x1e0)])+')'):'';console[_0x2d8ef5(0x1df)](_0x2d8ef5(0x1da)+_0x16989f[_0x2d8ef5(0x1bd)][_0x2d8ef5(0x1cf)]+_0x8febd);}}}return 0x0;}async['listParents'](_0x253df2){const _0x32e74d=a35_0xf6c952,{options:_0x346adc,tdx:_0xd40afc}=_0x253df2,_0x2a734b=await withSpinner('Listing\x20parent\x20segments...',()=>_0xd40afc['segment'][_0x32e74d(0x1fb)](),{'verbose':_0x346adc[_0x32e74d(0x1e5)]}),_0x5a5b69=_0x2a734b[_0x32e74d(0x1c9)];console[_0x32e74d(0x202)](_0x32e74d(0x1d6)+_0x5a5b69[_0x32e74d(0x1ec)]+_0x32e74d(0x201)+(_0x5a5b69[_0x32e74d(0x1ec)]!==0x1?'s':''));if(_0x346adc[_0x32e74d(0x1e8)]===_0x32e74d(0x1d5)||_0x346adc[_0x32e74d(0x1e8)]===_0x32e74d(0x1ea))await handleSDKOutput(_0x5a5b69,_0x346adc);else{console['log'](_0x32e74d(0x1c8));for(const _0x408ab8 of _0x5a5b69){const _0x5a7976=_0x408ab8[_0x32e74d(0x1bd)][_0x32e74d(0x1e0)]?a35_0x1aabaf[_0x32e74d(0x1e4)]('\x20('+formatRows(_0x408ab8[_0x32e74d(0x1bd)][_0x32e74d(0x1e0)])+')'):'';console[_0x32e74d(0x1df)](_0x32e74d(0x1da)+_0x408ab8[_0x32e74d(0x1bd)][_0x32e74d(0x1cf)]+_0x5a7976);}}return 0x0;}async[a35_0xf6c952(0x1ce)](_0x1d1fd4,_0x1dfa54){const _0x5b640b=a35_0xf6c952,{options:_0x23ed4f,tdx:_0x59fb9b}=_0x1d1fd4,_0x41933d=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x1dfa54+_0x5b640b(0x1fd),()=>_0x59fb9b[_0x5b640b(0x1c0)][_0x5b640b(0x1cc)](_0x1dfa54),{'verbose':_0x23ed4f[_0x5b640b(0x1e5)]}),_0x2aa5e4=_0x41933d['data'];_0x23ed4f['verbose']&&(console['error'](_0x5b640b(0x1c1)+_0x2aa5e4[_0x5b640b(0x1de)]),_0x2aa5e4['folderId']&&console['error'](_0x5b640b(0x1f1)+_0x2aa5e4[_0x5b640b(0x1fe)]));const _0x237045=await withSpinner(_0x5b640b(0x1db),()=>_0x59fb9b[_0x5b640b(0x1c0)][_0x5b640b(0x1ce)](_0x2aa5e4['parentId'],_0x2aa5e4[_0x5b640b(0x1fe)]),{'verbose':_0x23ed4f[_0x5b640b(0x1e5)]}),{folders:_0x70e7e7,segments:_0x4a3e83}=_0x237045['data'],_0x5c9377=_0x70e7e7[_0x5b640b(0x1ec)]+_0x4a3e83[_0x5b640b(0x1ec)];console[_0x5b640b(0x202)](_0x5b640b(0x1d6)+_0x70e7e7[_0x5b640b(0x1ec)]+_0x5b640b(0x1d7)+(_0x70e7e7[_0x5b640b(0x1ec)]!==0x1?'s':'')+_0x5b640b(0x1bf)+_0x4a3e83['length']+_0x5b640b(0x1fa)+(_0x4a3e83[_0x5b640b(0x1ec)]!==0x1?'s':''));if(_0x23ed4f[_0x5b640b(0x1e8)]===_0x5b640b(0x1d5)||_0x23ed4f[_0x5b640b(0x1e8)]==='jsonl'){const _0x16ff3a=[..._0x70e7e7[_0x5b640b(0x203)](_0x30d4ae=>({..._0x30d4ae,'type':_0x5b640b(0x1f6)})),..._0x4a3e83[_0x5b640b(0x203)](_0x3bf0cc=>({..._0x3bf0cc,'type':'segment'}))][_0x5b640b(0x1ee)]((_0x2952a3,_0x1f5d28)=>_0x2952a3[_0x5b640b(0x1cf)][_0x5b640b(0x1c7)](_0x1f5d28[_0x5b640b(0x1cf)]));await handleSDKOutput(_0x16ff3a,_0x23ed4f);}else{if(_0x5c9377===0x0)console[_0x5b640b(0x1df)](a35_0x1aabaf['dim']('[/'+_0x1dfa54+']')),console['log'](_0x5b640b(0x1cd));else{console[_0x5b640b(0x1df)](a35_0x1aabaf[_0x5b640b(0x1e4)]('[/'+_0x1dfa54+']'));const _0x3feef2=formatFlatList(_0x70e7e7,_0x4a3e83,{'showMetadata':!![]});console[_0x5b640b(0x1df)](_0x3feef2);}}return 0x0;}async['listRecursive'](_0x24c491,_0xa5863b){const _0x34aa69=a35_0xf6c952,{options:_0x3da273,tdx:_0x1c0cf9}=_0x24c491,_0x4af00f=await withSpinner(_0x34aa69(0x1ca)+_0xa5863b+_0x34aa69(0x1fd),()=>_0x1c0cf9[_0x34aa69(0x1c0)]['resolvePathToResource'](_0xa5863b),{'verbose':_0x3da273[_0x34aa69(0x1e5)]}),_0x4af84c=_0x4af00f[_0x34aa69(0x1c9)];_0x3da273[_0x34aa69(0x1e5)]&&(console[_0x34aa69(0x202)](_0x34aa69(0x1c1)+_0x4af84c[_0x34aa69(0x1de)]),_0x4af84c['folderId']&&console[_0x34aa69(0x202)]('Folder\x20ID:\x20'+_0x4af84c['folderId']));const _0x60edb8=_0x3da273['maxDepth']||0xa,_0x1771fe=await withSpinner(_0x34aa69(0x1d0),()=>_0x1c0cf9[_0x34aa69(0x1c0)]['listRecursive'](_0x4af84c[_0x34aa69(0x1de)],_0x4af84c['folderId'],0x0,_0x60edb8),{'verbose':_0x3da273['verbose']}),_0x3025d8=_0x1771fe[_0x34aa69(0x1c9)];console[_0x34aa69(0x202)](_0x34aa69(0x1fc)+_0x3025d8[_0x34aa69(0x1ec)]+_0x34aa69(0x1e7));if(_0x3da273[_0x34aa69(0x1e8)]===_0x34aa69(0x1d5)||_0x3da273[_0x34aa69(0x1e8)]===_0x34aa69(0x1ea))await handleSDKOutput(_0x3025d8,_0x3da273);else{console[_0x34aa69(0x1df)](a35_0x1aabaf[_0x34aa69(0x1e4)]('[/'+_0xa5863b+']'));const _0x21023f=formatTree(_0x3025d8,{'showMetadata':!![]});console['log'](_0x21023f);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x5abac0=a36_0x3fd1;(function(_0x1122b7,_0x50e3cf){const _0x5c44b5=a36_0x3fd1,_0x5e9e45=_0x1122b7();while(!![]){try{const _0x29e14c=-parseInt(_0x5c44b5(0xb2))/0x1*(-parseInt(_0x5c44b5(0xb0))/0x2)+parseInt(_0x5c44b5(0xa6))/0x3*(-parseInt(_0x5c44b5(0xaa))/0x4)+-parseInt(_0x5c44b5(0xb8))/0x5+parseInt(_0x5c44b5(0xa9))/0x6+parseInt(_0x5c44b5(0xa0))/0x7+parseInt(_0x5c44b5(0xa1))/0x8+parseInt(_0x5c44b5(0xb6))/0x9;if(_0x29e14c===_0x50e3cf)break;else _0x5e9e45['push'](_0x5e9e45['shift']());}catch(_0xe8b490){_0x5e9e45['push'](_0x5e9e45['shift']());}}}(a36_0x4ff3,0x31a06));import{BaseCommand}from'./command.js';function a36_0x3fd1(_0x1fa2a5,_0x4a1d33){const _0x4ff3e4=a36_0x4ff3();return a36_0x3fd1=function(_0x3fd14e,_0x1da9ce){_0x3fd14e=_0x3fd14e-0x94;let _0x207b55=_0x4ff3e4[_0x3fd14e];return _0x207b55;},a36_0x3fd1(_0x1fa2a5,_0x4a1d33);}import{SDKError}from'../sdk/index.js';function a36_0x4ff3(){const _0x337676=['4fScuvV','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','✔\x20Retrieved\x20','name','message','Error:\x20','6ijVFiZ','limit','26407QsSbMn','data','Show\x20table\x20contents','\x20\x20Cause:\x20','2890692pkifbd','cause','1568550MxUVUx','args','execute','Table:\x20','show','\x20from\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','length','Database:\x20','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','database','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','catalog','Catalog:\x20','115619sJsqqS','86320GkcPJU','...','query','validate','error','111636Hwxzku','\x20row','site','758856KFkYVK'];a36_0x4ff3=function(){return _0x337676;};return a36_0x4ff3();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a36_0x5abac0(0xad)]=a36_0x5abac0(0x94);['description']=a36_0x5abac0(0xb4);async[a36_0x5abac0(0xba)](_0x2c5df5){return this['showTable'](_0x2c5df5);}async['showTable'](_0x3cc4f1){const _0x832930=a36_0x5abac0,{options:_0x202b41,args:_0x3ff08d,tdx:_0x2f8a5a}=_0x3cc4f1;let _0x2627a4;try{_0x2627a4=parseTableReference(_0x3ff08d[0x0]);const _0xa44783=_0x202b41[_0x832930(0x9c)];!_0x2627a4[_0x832930(0x9c)]&&_0xa44783&&(_0x2627a4[_0x832930(0x9c)]=_0xa44783);const _0x14f877=validateTableDescribeReference(_0x2627a4);if(_0x14f877)return console[_0x832930(0xa5)](_0x832930(0xaf)+_0x14f877),console[_0x832930(0xa5)](_0x832930(0x9a)),console['error'](_0x832930(0x97)),console[_0x832930(0xa5)](_0x832930(0x9b)),0x1;}catch(_0x571d94){return console[_0x832930(0xa5)](_0x832930(0xaf)+_0x571d94[_0x832930(0xae)]),console[_0x832930(0xa5)](_0x832930(0x9a)),console[_0x832930(0xa5)](_0x832930(0x97)),console[_0x832930(0xa5)](_0x832930(0x9b)),0x1;}const _0x484a40=_0x2627a4[_0x832930(0x9e)],_0x2120db=_0x2627a4[_0x832930(0x9c)],_0x36cd5b=_0x2627a4['table'],_0x4ba0a8=resolveLimit(_0x202b41[_0x832930(0xb1)],DEFAULT_DISPLAY_LIMIT);try{_0x202b41['verbose']&&(console['error']('Site:\x20'+_0x202b41[_0x832930(0xa8)]),_0x484a40&&console[_0x832930(0xa5)](_0x832930(0x9f)+_0x484a40),console[_0x832930(0xa5)](_0x832930(0x99)+_0x2120db),console[_0x832930(0xa5)](_0x832930(0xbb)+_0x36cd5b),console[_0x832930(0xa5)]('Limit:\x20'+_0x4ba0a8));const _0x91a3a8=_0x484a40?_0x484a40+'.'+_0x2120db+'.'+_0x36cd5b:_0x2120db+'.'+_0x36cd5b,_0x4cd9ea=await withSpinner('Querying\x20'+_0x91a3a8+_0x832930(0xa2),()=>_0x2f8a5a[_0x832930(0xa3)]['showTable'](_0x2120db,_0x36cd5b,_0x4ba0a8,_0x484a40),{'verbose':_0x202b41['verbose']}),_0x421796=_0x4cd9ea[_0x832930(0xb3)],_0x312683=_0x421796[_0x832930(0xb3)];return _0x312683[_0x832930(0x98)]===0x0?console[_0x832930(0xa5)](_0x832930(0x96)):console[_0x832930(0xa5)](_0x832930(0xac)+_0x312683['length']+_0x832930(0xa7)+(_0x312683['length']!==0x1?'s':'')+_0x832930(0x95)+_0x91a3a8),await handleSDKOutput(_0x312683,_0x202b41),0x0;}catch(_0xd5b8f1){if(_0xd5b8f1 instanceof SDKError)return console['error']('Error:\x20'+_0xd5b8f1[_0x832930(0xae)]),_0xd5b8f1[_0x832930(0xb7)]&&console['error'](_0x832930(0xb5)+_0xd5b8f1[_0x832930(0xb7)]),0x1;throw _0xd5b8f1;}}[a36_0x5abac0(0xa4)](_0x394299){const _0x4edb63=a36_0x5abac0;if(_0x394299[_0x4edb63(0xb9)][_0x4edb63(0x98)]===0x0)return _0x4edb63(0xab);if(_0x394299[_0x4edb63(0xb9)][_0x4edb63(0x98)]>0x1)return _0x4edb63(0x9d);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x21fb4e=a37_0x423f;function a37_0x2cf3(){const _0x34421e=['Database\x20\x27','16iYXlfH','472hNPfEz','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20Pattern\x20\x27','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Database:\x20all','Or\x20use\x20--in\x20flag:','1424LOuCuq','Site:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','Database:\x20','includes','query','\x20\x20Use:\x20tdx\x20tables\x20\x22','verbose','Error:\x20','\x20table','740yyZmQW','\x27\x20across\x20all\x20databases.','limit','70213WTYKzx','Listing\x20tables...','error','table','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','✔\x20Found\x20','site','description','data','Table\x20pattern:\x20','execute','database','name','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','3108aUYIWH','message','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','4162983guOZsU','7458899wRYhYN','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','4820OqLnMW','cause','List\x20tables\x20in\x20a\x20database','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Database\x20pattern:\x20','listTables','1795581EMJWBa','3754124hyDCeF','length','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x27\x20is\x20ambiguous.'];a37_0x2cf3=function(){return _0x34421e;};return a37_0x2cf3();}(function(_0x59dc91,_0xaf7252){const _0x568fbc=a37_0x423f,_0x31f2a5=_0x59dc91();while(!![]){try{const _0x5cde1c=-parseInt(_0x568fbc(0x170))/0x1*(parseInt(_0x568fbc(0x176))/0x2)+parseInt(_0x568fbc(0x160))/0x3+-parseInt(_0x568fbc(0x16a))/0x4+-parseInt(_0x568fbc(0x163))/0x5*(-parseInt(_0x568fbc(0x15d))/0x6)+parseInt(_0x568fbc(0x161))/0x7+parseInt(_0x568fbc(0x16f))/0x8*(-parseInt(_0x568fbc(0x169))/0x9)+-parseInt(_0x568fbc(0x181))/0xa*(parseInt(_0x568fbc(0x14f))/0xb);if(_0x5cde1c===_0xaf7252)break;else _0x31f2a5['push'](_0x31f2a5['shift']());}catch(_0xbb0648){_0x31f2a5['push'](_0x31f2a5['shift']());}}}(a37_0x2cf3,0xc4ed7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a37_0x423f(_0x3aab3e,_0x3c6ff7){const _0x2cf3dc=a37_0x2cf3();return a37_0x423f=function(_0x423fe5,_0x1b13fa){_0x423fe5=_0x423fe5-0x14d;let _0x358363=_0x2cf3dc[_0x423fe5];return _0x358363;},a37_0x423f(_0x3aab3e,_0x3c6ff7);}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a37_0x21fb4e(0x15b)]='tables';[a37_0x21fb4e(0x156)]=a37_0x21fb4e(0x165);async[a37_0x21fb4e(0x159)](_0x10e0b1){const _0x55388d=a37_0x21fb4e,{options:_0x4d5ab0,args:_0x3da192,tdx:_0x65f6c5}=_0x10e0b1;let _0x21e490;if(_0x3da192[_0x55388d(0x16b)]===0x0)_0x21e490={'database':undefined,'table':undefined,'original':''};else{if(_0x3da192[_0x55388d(0x16b)]===0x1)try{_0x21e490=parseTableReference(_0x3da192[0x0]);if(_0x21e490[_0x55388d(0x152)]&&!_0x21e490[_0x55388d(0x15a)]&&!_0x21e490['table'][_0x55388d(0x17b)]('*')&&!_0x21e490[_0x55388d(0x152)]['includes']('?'))return console[_0x55388d(0x151)](_0x55388d(0x172)+_0x3da192[0x0]+_0x55388d(0x16d)),console[_0x55388d(0x151)](_0x55388d(0x15f)+_0x21e490[_0x55388d(0x152)]+'\x27?'),console['error'](_0x55388d(0x17d)+_0x21e490[_0x55388d(0x152)]+'.*\x22'),console[_0x55388d(0x151)](_0x55388d(0x166)+_0x21e490[_0x55388d(0x152)]),console[_0x55388d(0x151)](_0x55388d(0x178)+_0x21e490[_0x55388d(0x152)]),console['error'](''),console[_0x55388d(0x151)]('Note:\x20\x27'+_0x3da192[0x0]+_0x55388d(0x162)+_0x21e490[_0x55388d(0x152)]+_0x55388d(0x14d)),0x1;}catch(_0x33b421){return console[_0x55388d(0x151)](_0x55388d(0x17f)+_0x33b421[_0x55388d(0x15e)]),0x1;}else return console[_0x55388d(0x151)](_0x55388d(0x15c)),console[_0x55388d(0x151)](_0x55388d(0x153)),console[_0x55388d(0x151)](_0x55388d(0x171)),console[_0x55388d(0x151)](_0x55388d(0x179)),console[_0x55388d(0x151)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x55388d(0x151)](_0x55388d(0x175)),console[_0x55388d(0x151)](_0x55388d(0x16c)),0x1;}const _0x2c957b=_0x4d5ab0[_0x55388d(0x15a)];!_0x21e490[_0x55388d(0x15a)]&&_0x2c957b&&(_0x21e490[_0x55388d(0x15a)]=_0x2c957b);try{const _0x3f1c79=_0x4d3de9=>_0x4d3de9&&(_0x4d3de9[_0x55388d(0x17b)]('*')||_0x4d3de9[_0x55388d(0x17b)]('?')),_0x3a3939=_0x3f1c79(_0x21e490['database']);_0x4d5ab0[_0x55388d(0x17e)]&&(console[_0x55388d(0x151)](_0x55388d(0x177)+_0x4d5ab0[_0x55388d(0x155)]),_0x21e490['database']?_0x3a3939?console[_0x55388d(0x151)](_0x55388d(0x167)+_0x21e490[_0x55388d(0x15a)]):console[_0x55388d(0x151)](_0x55388d(0x17a)+_0x21e490['database']):console[_0x55388d(0x151)](_0x55388d(0x174)),_0x21e490['table']&&console[_0x55388d(0x151)](_0x55388d(0x158)+_0x21e490[_0x55388d(0x152)]));const _0x2d30f2=_0x21e490[_0x55388d(0x15a)]&&!_0x3a3939?_0x21e490[_0x55388d(0x15a)]:undefined,_0x93cb13=_0x3a3939?_0x21e490[_0x55388d(0x15a)]:undefined,_0x56413d=_0x21e490[_0x55388d(0x152)],_0x14c7f5=resolveLimit(_0x4d5ab0[_0x55388d(0x14e)],DEFAULT_LISTING_LIMIT),_0x34037d=await withSpinner(_0x55388d(0x150),()=>_0x65f6c5[_0x55388d(0x17c)][_0x55388d(0x168)](_0x2d30f2,_0x56413d,_0x93cb13,_0x14c7f5),{'verbose':_0x4d5ab0[_0x55388d(0x17e)]}),_0x815387=_0x34037d[_0x55388d(0x157)];if(_0x815387['length']===0x0&&_0x21e490[_0x55388d(0x15a)]&&!_0x3a3939)return console[_0x55388d(0x151)]('✖\x20No\x20tables\x20found'),console['error'](_0x55388d(0x16e)+_0x21e490[_0x55388d(0x15a)]+_0x55388d(0x173)),0x1;return console['error'](_0x55388d(0x154)+_0x815387[_0x55388d(0x16b)]+_0x55388d(0x180)+(_0x815387['length']!==0x1?'s':'')),await handleSDKOutput(_0x815387,{..._0x4d5ab0,'limit':_0x14c7f5}),0x0;}catch(_0x53dd77){if(_0x53dd77 instanceof SDKError)return console[_0x55388d(0x151)](_0x55388d(0x17f)+_0x53dd77[_0x55388d(0x15e)]),_0x53dd77[_0x55388d(0x164)]&&console[_0x55388d(0x151)]('\x20\x20Cause:\x20'+_0x53dd77[_0x55388d(0x164)]),0x1;throw _0x53dd77;}}['validate'](_0x1e418e){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x3e0d1b=a38_0x6fb3;function a38_0x245e(){const _0x1bf05a=['133ywTkUn','session','use','execute','1724604SmocUh','Invalid\x20resource:\x20','error','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Error:\x20Profile\x20\x27','database','dim','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','llm_project','79962ZWFMZt','Session\x20database\x20set\x20to:\x20','clear','log','.\x20Must\x20be\x20one\x20of:\x20','6oVWzDE','22132mWjwEL','debug','validate','toString','profile','(session:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','cleared','73768pqlNZS','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','join','30ogLqro','green','782205Gvkkbd','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','displayWithSources','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','parent_segment','27mIZyar','length','name','engage_workspace','422667CZThjg','\x27\x20does\x20not\x20exist','6924368QwZDew','message','Session\x20llm_project\x20set\x20to:\x20','Error:\x20'];a38_0x245e=function(){return _0x1bf05a;};return a38_0x245e();}(function(_0x1e2548,_0x4e650c){const _0x1b1fb1=a38_0x6fb3,_0x209a86=_0x1e2548();while(!![]){try{const _0x13d58d=parseInt(_0x1b1fb1(0x1c1))/0x1+parseInt(_0x1b1fb1(0x1c7))/0x2*(-parseInt(_0x1b1fb1(0x1aa))/0x3)+-parseInt(_0x1b1fb1(0x1b8))/0x4+parseInt(_0x1b1fb1(0x1a5))/0x5*(parseInt(_0x1b1fb1(0x1c6))/0x6)+-parseInt(_0x1b1fb1(0x1b4))/0x7*(parseInt(_0x1b1fb1(0x1cf))/0x8)+parseInt(_0x1b1fb1(0x1ae))/0x9*(parseInt(_0x1b1fb1(0x1a3))/0xa)+parseInt(_0x1b1fb1(0x1b0))/0xb;if(_0x13d58d===_0x4e650c)break;else _0x209a86['push'](_0x209a86['shift']());}catch(_0x205c2a){_0x209a86['push'](_0x209a86['shift']());}}}(a38_0x245e,0x49724));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';function a38_0x6fb3(_0x11b1a5,_0x44a2ff){const _0x245e89=a38_0x245e();return a38_0x6fb3=function(_0x6fb3ba,_0x284023){_0x6fb3ba=_0x6fb3ba-0x1a3;let _0x5718c6=_0x245e89[_0x6fb3ba];return _0x5718c6;},a38_0x6fb3(_0x11b1a5,_0x44a2ff);}import{GlobalContext}from'../core/global-context.js';import a38_0x4c1b5c from'chalk';export class UseCommand extends BaseCommand{[a38_0x3e0d1b(0x1ac)]=a38_0x3e0d1b(0x1b6);['description']='Set\x20session-level\x20context';[a38_0x3e0d1b(0x1c9)](_0x548254){const _0x1a3b16=a38_0x3e0d1b,{args:_0x29f1d5}=_0x548254;if(_0x29f1d5['length']===0x0)return undefined;if(_0x29f1d5[_0x1a3b16(0x1ab)]===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x1a3b16(0x1cd)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x1a3b16(0x1bf)+_0x1a3b16(0x1d0);const _0x4d4e8d=_0x29f1d5[0x0],_0x112da0=[_0x1a3b16(0x1bd),_0x1a3b16(0x1a9),_0x1a3b16(0x1c0),_0x1a3b16(0x1cb),_0x1a3b16(0x1ad)];if(!_0x112da0['includes'](_0x4d4e8d))return _0x1a3b16(0x1b9)+_0x4d4e8d+_0x1a3b16(0x1c5)+_0x112da0[_0x1a3b16(0x1d1)](',\x20');return undefined;}async[a38_0x3e0d1b(0x1b7)](_0x5f7373){const _0x386d4c=a38_0x3e0d1b,{args:_0x1c77a7,options:_0x4ba6ab}=_0x5f7373,_0x25dd40=_0x4ba6ab[_0x386d4c(0x1c8)],_0x41cb27=_0x4ba6ab[_0x386d4c(0x1c3)];cleanExpiredSessions();try{if(_0x41cb27){clearSessionContext(_0x4ba6ab[_0x386d4c(0x1b5)]);const _0x282b4b=_0x4ba6ab[_0x386d4c(0x1b5)]||getCurrentSessionPID()[_0x386d4c(0x1ca)]();return console[_0x386d4c(0x1c4)]('Session\x20context\x20'+a38_0x4c1b5c[_0x386d4c(0x1a4)](_0x386d4c(0x1ce))+'\x20'+a38_0x4c1b5c[_0x386d4c(0x1be)](_0x386d4c(0x1cc)+_0x282b4b+')')),0x0;}if(_0x1c77a7[_0x386d4c(0x1ab)]===0x0){const _0x13786c=new GlobalContext(_0x4ba6ab);return _0x25dd40?_0x13786c[_0x386d4c(0x1a7)]():_0x13786c['display'](),console[_0x386d4c(0x1c4)](a38_0x4c1b5c[_0x386d4c(0x1be)](_0x386d4c(0x1a6))),console[_0x386d4c(0x1c4)](a38_0x4c1b5c[_0x386d4c(0x1be)]('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace')),0x0;}const _0x4e30ee=_0x1c77a7[0x0],_0x45e03d=_0x1c77a7[0x1];if(_0x4e30ee===_0x386d4c(0x1cb)){if(!profileExists(_0x45e03d))return console[_0x386d4c(0x1ba)](_0x386d4c(0x1bc)+_0x45e03d+_0x386d4c(0x1af)),console[_0x386d4c(0x1ba)](_0x386d4c(0x1bb)),0x1;const _0x2ee7b9=_0x4ba6ab[_0x386d4c(0x1b5)]||getCurrentSessionPID()[_0x386d4c(0x1ca)]();return saveSessionContext({'profile':_0x45e03d},_0x4ba6ab[_0x386d4c(0x1b5)]),console[_0x386d4c(0x1c4)]('Session\x20profile\x20set\x20to:\x20'+a38_0x4c1b5c[_0x386d4c(0x1a4)](_0x45e03d)+'\x20'+a38_0x4c1b5c['dim']('(session:\x20'+_0x2ee7b9+')')),console['log'](a38_0x4c1b5c[_0x386d4c(0x1be)](_0x386d4c(0x1a8))),0x0;}const _0x3c68af={},_0x3b4680=_0x4ba6ab['session']||getCurrentSessionPID()[_0x386d4c(0x1ca)]();switch(_0x4e30ee){case _0x386d4c(0x1bd):_0x3c68af['database']=_0x45e03d,console[_0x386d4c(0x1c4)](_0x386d4c(0x1c2)+a38_0x4c1b5c['green'](_0x45e03d)+'\x20'+a38_0x4c1b5c[_0x386d4c(0x1be)](_0x386d4c(0x1cc)+_0x3b4680+')'));break;case'parent_segment':_0x3c68af[_0x386d4c(0x1a9)]=_0x45e03d,console['log']('Session\x20parent_segment\x20set\x20to:\x20'+a38_0x4c1b5c['green'](_0x45e03d)+'\x20'+a38_0x4c1b5c[_0x386d4c(0x1be)](_0x386d4c(0x1cc)+_0x3b4680+')'));break;case _0x386d4c(0x1c0):_0x3c68af['llm_project']=_0x45e03d,console[_0x386d4c(0x1c4)](_0x386d4c(0x1b2)+a38_0x4c1b5c[_0x386d4c(0x1a4)](_0x45e03d)+'\x20'+a38_0x4c1b5c[_0x386d4c(0x1be)](_0x386d4c(0x1cc)+_0x3b4680+')'));break;case _0x386d4c(0x1ad):_0x3c68af[_0x386d4c(0x1ad)]=_0x45e03d,console[_0x386d4c(0x1c4)]('Session\x20engage_workspace\x20set\x20to:\x20'+a38_0x4c1b5c[_0x386d4c(0x1a4)](_0x45e03d)+'\x20'+a38_0x4c1b5c[_0x386d4c(0x1be)]('(session:\x20'+_0x3b4680+')'));break;}return saveSessionContext(_0x3c68af,_0x4ba6ab[_0x386d4c(0x1b5)]),console[_0x386d4c(0x1c4)](a38_0x4c1b5c[_0x386d4c(0x1be)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x519ebc){return _0x519ebc instanceof Error&&console['error'](_0x386d4c(0x1b3)+_0x519ebc[_0x386d4c(0x1b1)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x538516=a39_0x5249;(function(_0x2f062b,_0x4c8a7e){const _0x44a421=a39_0x5249,_0xf9cab5=_0x2f062b();while(!![]){try{const _0x55093b=parseInt(_0x44a421(0x17b))/0x1+-parseInt(_0x44a421(0x1c8))/0x2+-parseInt(_0x44a421(0x1de))/0x3*(parseInt(_0x44a421(0x176))/0x4)+parseInt(_0x44a421(0x1d4))/0x5+-parseInt(_0x44a421(0x1a0))/0x6*(parseInt(_0x44a421(0x1b9))/0x7)+parseInt(_0x44a421(0x1e0))/0x8*(-parseInt(_0x44a421(0x155))/0x9)+-parseInt(_0x44a421(0x16f))/0xa*(-parseInt(_0x44a421(0x1ae))/0xb);if(_0x55093b===_0x4c8a7e)break;else _0xf9cab5['push'](_0xf9cab5['shift']());}catch(_0x114b81){_0xf9cab5['push'](_0xf9cab5['shift']());}}}(a39_0x50ba,0x4c5ce));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a39_0x5249(_0x53d0f4,_0x187c0b){const _0x50ba1f=a39_0x50ba();return a39_0x5249=function(_0x52496c,_0x5972b3){_0x52496c=_0x52496c-0x14f;let _0x3b1c45=_0x50ba1f[_0x52496c];return _0x3b1c45;},a39_0x5249(_0x53d0f4,_0x187c0b);}import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';function a39_0x50ba(){const _0x3e4fac=['keys','Fetching\x20log\x20files...','session:','kill','params','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Error:\x20Attempt\x20ID\x20is\x20required','List\x20workflow\x20attempts','Filter:\x20project=','workflow:kill','\x20\x20Session\x20ID:\x20','format','running','getTime','indexOf','...','Session\x20time:\x20','includeSubtasks','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Expected\x20format:\x20--param\x20key=value','workflow','10QxSasy','canceling','push','length','Error:\x20Invalid\x20JSON\x20in\x20--params','Revision:\x20','Start\x20a\x20workflow\x20run','4AOaxnL','sessionId','\x20\x20New\x20attempt\x20ID:\x20','workflow:workflows','workflow:delete','91584zppEhd','\x22?\x20This\x20cannot\x20be\x20undone.','project','retryAttemptName','projectName','List\x20all\x20workflow\x20projects','Output\x20directory:\x20','Project\x20directory:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Filter:\x20','sessionTime','param','workflow:tasks','resumeFrom','message','\x20attempt','Resume\x20from:\x20','stringify','createdAt','\x20\x20Cause:\x20','workflows','limit','Including\x20subtasks:\x20yes','retrySession','Project\x20name:\x20','filesExtracted','done','delete','Pushing\x20workflow\x20project...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','substring','Killing\x20attempt...','startsWith','Listing\x20workflow\x20projects...','logFiles','success','fromTask','696XIANsS','isArray','status','Project\x20filter:\x20','Show\x20specific\x20attempt\x20details','execute','Show\x20tasks\x20for\x20an\x20attempt','data','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:logs','Retrying\x20session...','workflow:download','\x20\x20Project\x20ID:\x20','projects','9849543Edsgmm','workflow:projects','run','Kill\x20a\x20running\x20attempt','Attempt\x20ID:\x20','cause','workflow:run','force','task','\x20\x20Location:\x20','\x20project','19341KHZbPS','skipValidation','Parameters:\x20','Target:\x20','✔\x20Found\x20','download','projectId','workflow:attempts','Getting\x20attempt\x20tasks...','error','\x20is\x20not\x20a\x20directory','index','fs/promises','description','\x20\x20Files\x20extracted:\x20','91888xINelX','parse','taskName','Force:\x20yes','✔\x20Deleted\x20project\x20','workflow:sessions','Status:\x20','session','isDirectory','stat','\x20\x20Revision:\x20','cancelRequested','2093565eCQpaq','name','logs','fileSize','select','attemptId','json','Deleting\x20project\x20','tasks','revision','1682139kKNlrl','workflow:push','102008mHpXPj','Cancelled','Task\x20name:\x20','attempt','yes','readFile','Listing\x20workflow\x20sessions...','Project:\x20','Params:\x20','verbose','Starting\x20workflow\x20run...','✔\x20Retry\x20started','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','List\x20workflows','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','attempts','includeRetried','split','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Error:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Downloading\x20project\x20','Error:\x20Workflow\x20identifier\x20is\x20required','finishedAt','utf-8','workflow:attempt','Listing\x20workflows...','117WPcewr','Error:\x20Invalid\x20parameter\x20format:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Retry\x20a\x20session\x20or\x20attempt'];a39_0x50ba=function(){return _0x3e4fac;};return a39_0x50ba();}import{formatBytes}from'../utils/formatters.js';import a39_0x25e3c6 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a39_0x538516(0x1d5)]=a39_0x538516(0x1af);[a39_0x538516(0x1c6)]=a39_0x538516(0x180);async[a39_0x538516(0x1a5)](_0x278940){const _0x31b258=a39_0x538516,{options:_0x529fc3,args:_0x4e3e9c,tdx:_0x3c310b}=_0x278940,_0x7f1a89=_0x4e3e9c[0x0];try{_0x529fc3[_0x31b258(0x1e9)]&&_0x7f1a89&&console[_0x31b258(0x1c2)]('Pattern:\x20'+_0x7f1a89);const _0x1123e4=await withSpinner(_0x31b258(0x19c),()=>_0x3c310b['workflow'][_0x31b258(0x1ad)](_0x7f1a89,{'limit':_0x529fc3['limit']}),{'verbose':_0x529fc3[_0x31b258(0x1e9)]}),_0x3c6c60=_0x1123e4[_0x31b258(0x1a7)];return console[_0x31b258(0x1c2)](_0x31b258(0x1bd)+_0x3c6c60[_0x31b258(0x172)]+_0x31b258(0x1b8)+(_0x3c6c60[_0x31b258(0x172)]!==0x1?'s':'')),await handleSDKOutput(_0x3c6c60,_0x529fc3),0x0;}catch(_0x1c80b5){if(_0x1c80b5 instanceof SDKError)return console[_0x31b258(0x1c2)]('Error:\x20'+_0x1c80b5[_0x31b258(0x189)]),_0x1c80b5[_0x31b258(0x1b3)]&&console[_0x31b258(0x1c2)](_0x31b258(0x18e)+_0x1c80b5[_0x31b258(0x1b3)]),0x1;throw _0x1c80b5;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a39_0x538516(0x179);[a39_0x538516(0x1c6)]=a39_0x538516(0x1ed);async[a39_0x538516(0x1a5)](_0x553249){const _0x1e78fa=a39_0x538516,{options:_0x199020,args:_0x10826a,tdx:_0x127870}=_0x553249,_0x5dbbe4=_0x10826a[0x0];try{_0x199020[_0x1e78fa(0x1e9)]&&_0x5dbbe4&&console[_0x1e78fa(0x1c2)](_0x1e78fa(0x1a3)+_0x5dbbe4);const _0x104f19=await withSpinner(_0x1e78fa(0x154),()=>_0x127870[_0x1e78fa(0x16e)][_0x1e78fa(0x18f)](_0x5dbbe4,{'limit':_0x199020[_0x1e78fa(0x190)]}),{'verbose':_0x199020[_0x1e78fa(0x1e9)]}),_0x3bfc8b=_0x104f19[_0x1e78fa(0x1a7)];return console[_0x1e78fa(0x1c2)](_0x1e78fa(0x1bd)+_0x3bfc8b[_0x1e78fa(0x172)]+'\x20workflow'+(_0x3bfc8b[_0x1e78fa(0x172)]!==0x1?'s':'')),await handleSDKOutput(_0x3bfc8b,_0x199020),0x0;}catch(_0x142212){if(_0x142212 instanceof SDKError)return console[_0x1e78fa(0x1c2)](_0x1e78fa(0x1f3)+_0x142212['message']),_0x142212['cause']&&console[_0x1e78fa(0x1c2)](_0x1e78fa(0x18e)+_0x142212[_0x1e78fa(0x1b3)]),0x1;throw _0x142212;}}}export class WorkflowSessionsCommand extends BaseCommand{[a39_0x538516(0x1d5)]=a39_0x538516(0x1cd);[a39_0x538516(0x1c6)]='List\x20workflow\x20execution\x20sessions';async['execute'](_0x2c2cc5){const _0x22f99e=a39_0x538516,{options:_0x29f818,args:_0x307a51,tdx:_0x3bb705}=_0x2c2cc5;let _0x1adfc1,_0x482741;if(_0x307a51[0x0]){const _0x5d530b=_0x307a51[0x0][_0x22f99e(0x1f1)]('.');if(_0x5d530b[_0x22f99e(0x172)]===0x1)_0x1adfc1=_0x5d530b[0x0];else{if(_0x5d530b[_0x22f99e(0x172)]===0x2)[_0x1adfc1,_0x482741]=_0x5d530b;else return console[_0x22f99e(0x1c2)](_0x22f99e(0x1f4)),0x1;}}try{if(_0x29f818[_0x22f99e(0x1e9)]){if(_0x1adfc1&&_0x482741)console[_0x22f99e(0x1c2)](_0x22f99e(0x184)+_0x1adfc1+'.'+_0x482741);else _0x1adfc1&&console['error'](_0x22f99e(0x162)+_0x1adfc1);const _0x2a2741=_0x29f818[_0x22f99e(0x1a2)];_0x2a2741&&console[_0x22f99e(0x1c2)](_0x22f99e(0x1ce)+_0x2a2741);}const _0xd8c412=await withSpinner(_0x22f99e(0x1e6),()=>_0x3bb705[_0x22f99e(0x16e)]['sessions']({'projectName':_0x1adfc1,'workflowName':_0x482741,'status':_0x29f818[_0x22f99e(0x1a2)],'fromTime':_0x29f818['from'],'toTime':_0x29f818['to'],'limit':_0x29f818['limit']}),{'verbose':_0x29f818['verbose']}),_0x19f426=_0xd8c412[_0x22f99e(0x1a7)];return console[_0x22f99e(0x1c2)](_0x22f99e(0x1bd)+_0x19f426['length']+'\x20session'+(_0x19f426[_0x22f99e(0x172)]!==0x1?'s':'')),await handleSDKOutput(_0x19f426,_0x29f818),0x0;}catch(_0xbac069){if(_0xbac069 instanceof SDKError)return console[_0x22f99e(0x1c2)]('Error:\x20'+_0xbac069['message']),_0xbac069[_0x22f99e(0x1b3)]&&console[_0x22f99e(0x1c2)](_0x22f99e(0x18e)+_0xbac069['cause']),0x1;throw _0xbac069;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a39_0x538516(0x1d5)]=a39_0x538516(0x1c0);['description']=a39_0x538516(0x161);async['execute'](_0x41897c){const _0x373855=a39_0x538516,{options:_0xd62223,args:_0x1d27c9,tdx:_0x1adcd2}=_0x41897c;let _0x50c410,_0x4c3fd1;if(_0x1d27c9[0x0]){const _0x2803ce=_0x1d27c9[0x0][_0x373855(0x1f1)]('.');if(_0x2803ce['length']===0x1)_0x50c410=_0x2803ce[0x0];else{if(_0x2803ce['length']===0x2)[_0x50c410,_0x4c3fd1]=_0x2803ce;else return console[_0x373855(0x1c2)](_0x373855(0x1f4)),0x1;}}try{const _0x4db326=_0xd62223[_0x373855(0x1f0)];if(_0xd62223[_0x373855(0x1e9)]){if(_0x50c410&&_0x4c3fd1)console[_0x373855(0x1c2)](_0x373855(0x184)+_0x50c410+'.'+_0x4c3fd1);else _0x50c410&&console['error']('Filter:\x20project='+_0x50c410);_0x4db326&&console['error']('Include\x20retried:\x20yes');}const _0x480620=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x1adcd2[_0x373855(0x16e)][_0x373855(0x1ef)]({'projectName':_0x50c410,'workflowName':_0x4c3fd1,'includeRetried':_0x4db326,'limit':_0xd62223['limit']}),{'verbose':_0xd62223[_0x373855(0x1e9)]}),_0x53f0a0=_0x480620[_0x373855(0x1a7)];return console['error'](_0x373855(0x1bd)+_0x53f0a0[_0x373855(0x172)]+_0x373855(0x18a)+(_0x53f0a0[_0x373855(0x172)]!==0x1?'s':'')),await handleSDKOutput(_0x53f0a0,_0xd62223),0x0;}catch(_0x25d6fb){if(_0x25d6fb instanceof SDKError)return console[_0x373855(0x1c2)]('Error:\x20'+_0x25d6fb[_0x373855(0x189)]),_0x25d6fb[_0x373855(0x1b3)]&&console[_0x373855(0x1c2)](_0x373855(0x18e)+_0x25d6fb[_0x373855(0x1b3)]),0x1;throw _0x25d6fb;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a39_0x538516(0x153);[a39_0x538516(0x1c6)]=a39_0x538516(0x1a4);async[a39_0x538516(0x1a5)](_0x4cf634){const _0x1ad952=a39_0x538516,{options:_0x33e1fa,args:_0xb22cf1,tdx:_0x541dd1}=_0x4cf634,_0x48cc92=_0xb22cf1[0x0];if(!_0x48cc92)return console['error'](_0x1ad952(0x160)),0x1;try{_0x33e1fa['verbose']&&console[_0x1ad952(0x1c2)](_0x1ad952(0x1b2)+_0x48cc92);const _0x45fb89=await withSpinner('Getting\x20attempt\x20details...',()=>_0x541dd1[_0x1ad952(0x16e)][_0x1ad952(0x1e3)](_0x48cc92),{'verbose':_0x33e1fa[_0x1ad952(0x1e9)]}),_0x32240f=_0x45fb89[_0x1ad952(0x1a7)];let _0x586158;!_0x32240f[_0x1ad952(0x195)]?_0x586158=_0x32240f[_0x1ad952(0x1d3)]?_0x1ad952(0x170):_0x1ad952(0x166):_0x586158=_0x32240f[_0x1ad952(0x19e)]?_0x1ad952(0x19e):_0x1ad952(0x1c2);let _0x2dd59a;if(_0x32240f[_0x1ad952(0x18d)]&&_0x32240f[_0x1ad952(0x151)]){const _0x56bbe6=new Date(_0x32240f[_0x1ad952(0x18d)])[_0x1ad952(0x167)](),_0x1fb837=new Date(_0x32240f['finishedAt'])['getTime']();_0x2dd59a=Math['round']((_0x1fb837-_0x56bbe6)/0x3e8);}const _0x1d2dd5={'attempt_id':_0x32240f['id'],'status':_0x586158,..._0x32240f[_0x1ad952(0x1c4)]!==undefined&&{'index':_0x32240f[_0x1ad952(0x1c4)]},..._0x32240f[_0x1ad952(0x17d)]&&{'project':_0x32240f[_0x1ad952(0x17d)][_0x1ad952(0x1d5)]},..._0x32240f[_0x1ad952(0x16e)]&&{'workflow':_0x32240f[_0x1ad952(0x16e)]['name']},..._0x32240f['sessionId']&&{'session_id':_0x32240f[_0x1ad952(0x177)]},..._0x32240f[_0x1ad952(0x185)]&&{'session_time':_0x32240f[_0x1ad952(0x185)]},..._0x32240f['retryAttemptName']&&{'retry_attempt':_0x32240f[_0x1ad952(0x17e)]},..._0x2dd59a!==undefined&&{'duration_sec':_0x2dd59a},..._0x32240f[_0x1ad952(0x18d)]&&{'created_at':_0x32240f[_0x1ad952(0x18d)]},..._0x32240f[_0x1ad952(0x151)]&&{'finished_at':_0x32240f[_0x1ad952(0x151)]},...Object[_0x1ad952(0x15a)](_0x32240f[_0x1ad952(0x15e)])[_0x1ad952(0x172)]>0x0&&{'params':_0x32240f['params']}};return await handleSingleObjectOutput(_0x1d2dd5,_0x33e1fa),0x0;}catch(_0x46b175){if(_0x46b175 instanceof SDKError)return console['error'](_0x1ad952(0x1f3)+_0x46b175[_0x1ad952(0x189)]),_0x46b175[_0x1ad952(0x1b3)]&&console[_0x1ad952(0x1c2)](_0x1ad952(0x18e)+_0x46b175[_0x1ad952(0x1b3)]),0x1;throw _0x46b175;}}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x538516(0x1d5)]=a39_0x538516(0x187);[a39_0x538516(0x1c6)]=a39_0x538516(0x1a6);async[a39_0x538516(0x1a5)](_0x5abca8){const _0x135a4d=a39_0x538516,{options:_0x1c9796,args:_0x53141c,tdx:_0x32c7d5}=_0x5abca8,_0x272898=_0x53141c[0x0];if(!_0x272898)return console[_0x135a4d(0x1c2)](_0x135a4d(0x160)),0x1;try{const _0x403903=_0x1c9796[_0x135a4d(0x16b)];_0x1c9796[_0x135a4d(0x1e9)]&&(console['error'](_0x135a4d(0x1b2)+_0x272898),_0x403903&&console[_0x135a4d(0x1c2)](_0x135a4d(0x191)));const _0x3149b1=await withSpinner(_0x135a4d(0x1c1),()=>_0x32c7d5['workflow'][_0x135a4d(0x1dc)](_0x272898,_0x403903||![]),{'verbose':_0x1c9796[_0x135a4d(0x1e9)]}),_0x290714=_0x3149b1[_0x135a4d(0x1a7)];return console[_0x135a4d(0x1c2)](_0x135a4d(0x1bd)+_0x290714[_0x135a4d(0x172)]+'\x20task'+(_0x290714[_0x135a4d(0x172)]!==0x1?'s':'')),await handleSDKOutput(_0x290714,_0x1c9796),0x0;}catch(_0x381827){if(_0x381827 instanceof SDKError)return console[_0x135a4d(0x1c2)](_0x135a4d(0x1f3)+_0x381827['message']),_0x381827[_0x135a4d(0x1b3)]&&console[_0x135a4d(0x1c2)]('\x20\x20Cause:\x20'+_0x381827[_0x135a4d(0x1b3)]),0x1;throw _0x381827;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x538516(0x1d5)]=a39_0x538516(0x1a9);[a39_0x538516(0x1c6)]=a39_0x538516(0x183);async[a39_0x538516(0x1a5)](_0x147d72){const _0x533273=a39_0x538516,{options:_0x195adf,args:_0x3d0782,tdx:_0x478a98}=_0x147d72,_0xc6a36e=_0x3d0782[0x0];let _0x4a2679=_0x3d0782[0x1];if(!_0xc6a36e)return console[_0x533273(0x1c2)](_0x533273(0x160)),0x1;try{_0x195adf[_0x533273(0x1e9)]&&(console[_0x533273(0x1c2)](_0x533273(0x1b2)+_0xc6a36e),_0x4a2679&&console[_0x533273(0x1c2)](_0x533273(0x1e2)+_0x4a2679));const _0xb011fc=await withSpinner(_0x533273(0x15b),()=>_0x478a98[_0x533273(0x16e)][_0x533273(0x19d)](_0xc6a36e,_0x4a2679),{'verbose':_0x195adf[_0x533273(0x1e9)]}),_0x1fa1e5=_0xb011fc[_0x533273(0x1a7)];if(_0x1fa1e5[_0x533273(0x172)]===0x0)return console[_0x533273(0x1c2)](_0x533273(0x16c)),0x0;if(!_0x4a2679&&(_0x195adf[_0x533273(0x1da)]||_0x195adf[_0x533273(0x165)]))return await handleSDKOutput(_0x1fa1e5,_0x195adf),0x0;if(!_0x4a2679){const _0x29ea35=_0x1fa1e5['map'](_0x594603=>({'title':_0x594603['taskName']+'\x20('+formatBytes(_0x594603[_0x533273(0x1d7)])+')','value':_0x594603[_0x533273(0x1ca)]})),_0xbf106c=await a39_0x25e3c6({'type':_0x533273(0x1d8),'name':_0x533273(0x1b6),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x29ea35});if(!_0xbf106c[_0x533273(0x1b6)])return console[_0x533273(0x1c2)](_0x533273(0x1e1)),0x0;_0x4a2679=_0xbf106c['task'];}const _0x43bc31=await withSpinner('Downloading\x20logs...',()=>_0x478a98['workflow'][_0x533273(0x1d6)](_0xc6a36e,_0x4a2679),{'verbose':_0x195adf[_0x533273(0x1e9)]}),_0x4e90e7=_0x43bc31[_0x533273(0x1a7)];return _0x4e90e7?console['log'](_0x4e90e7):console[_0x533273(0x1c2)]('No\x20log\x20content\x20found'),0x0;}catch(_0x1523b5){if(_0x1523b5 instanceof SDKError)return console[_0x533273(0x1c2)]('Error:\x20'+_0x1523b5[_0x533273(0x189)]),_0x1523b5[_0x533273(0x1b3)]&&console['error']('\x20\x20Cause:\x20'+_0x1523b5[_0x533273(0x1b3)]),0x1;throw _0x1523b5;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a39_0x538516(0x163);['description']=a39_0x538516(0x1b1);async[a39_0x538516(0x1a5)](_0x182956){const _0x14db4d=a39_0x538516,{options:_0x4d7aee,args:_0xcae1b4,tdx:_0x2475af}=_0x182956,_0x55ada8=_0xcae1b4[0x0];if(!_0x55ada8)return console[_0x14db4d(0x1c2)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x41bfe2=_0x4d7aee['reason'];_0x4d7aee[_0x14db4d(0x1e9)]&&(console[_0x14db4d(0x1c2)](_0x14db4d(0x1b2)+_0x55ada8),_0x41bfe2&&console[_0x14db4d(0x1c2)]('Reason:\x20'+_0x41bfe2));if(!_0x4d7aee[_0x14db4d(0x1e4)]){const _0xed0dd6=await confirm(_0x14db4d(0x1f2)+_0x55ada8+'?');if(!_0xed0dd6)return console[_0x14db4d(0x1c2)]('Cancelled'),0x0;}const _0x6a7a7f=await withSpinner(_0x14db4d(0x19a),()=>_0x2475af[_0x14db4d(0x16e)][_0x14db4d(0x15d)](_0x55ada8,_0x41bfe2),{'verbose':_0x4d7aee['verbose']}),_0x283835=_0x6a7a7f[_0x14db4d(0x1a7)];return console[_0x14db4d(0x1c2)]('✔\x20'+_0x283835),0x0;}catch(_0x42531d){if(_0x42531d instanceof SDKError)return console[_0x14db4d(0x1c2)]('Error:\x20'+_0x42531d[_0x14db4d(0x189)]),_0x42531d[_0x14db4d(0x1b3)]&&console['error'](_0x14db4d(0x18e)+_0x42531d[_0x14db4d(0x1b3)]),0x1;throw _0x42531d;}}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';[a39_0x538516(0x1c6)]=a39_0x538516(0x159);async[a39_0x538516(0x1a5)](_0x4a02ad){const _0xd164e3=a39_0x538516,{options:_0x2acc5b,args:_0x5dfe03,tdx:_0x256fec}=_0x4a02ad,_0x3bb55a=_0x5dfe03[0x0];if(!_0x3bb55a)return console[_0xd164e3(0x1c2)](_0xd164e3(0x1ec)),console[_0xd164e3(0x1c2)](_0xd164e3(0x1a8)),0x1;let _0x1ca7ce=![],_0x3fc516=_0x3bb55a;if(_0x3bb55a[_0xd164e3(0x19b)](_0xd164e3(0x15c)))_0x1ca7ce=!![],_0x3fc516=_0x3bb55a['substring'](0x8);else{if(_0x3bb55a[_0xd164e3(0x19b)]('attempt:'))_0x1ca7ce=![],_0x3fc516=_0x3bb55a[_0xd164e3(0x199)](0x8);else return console['error'](_0xd164e3(0x1ee)),console[_0xd164e3(0x1c2)](_0xd164e3(0x1a8)),0x1;}try{const _0x18d762=_0x2acc5b[_0xd164e3(0x19f)],_0x2f6020=_0x2acc5b[_0xd164e3(0x188)],_0x417393=_0x2acc5b[_0xd164e3(0x15e)],_0x39dae5=_0x2acc5b[_0xd164e3(0x1b5)];_0x2acc5b[_0xd164e3(0x1e9)]&&(console[_0xd164e3(0x1c2)](_0xd164e3(0x1bc)+(_0x1ca7ce?_0xd164e3(0x1cf):_0xd164e3(0x1e3))+'\x20'+_0x3fc516),_0x18d762&&console[_0xd164e3(0x1c2)]('From\x20task:\x20'+_0x18d762),_0x2f6020&&console[_0xd164e3(0x1c2)](_0xd164e3(0x18b)+_0x2f6020),_0x417393&&console[_0xd164e3(0x1c2)](_0xd164e3(0x1e8)+_0x417393),_0x39dae5&&console[_0xd164e3(0x1c2)](_0xd164e3(0x1cb)));let _0x208fbd;if(_0x417393)try{if(_0x417393[_0xd164e3(0x19b)]('@')){const _0x5e38b2=await import(_0xd164e3(0x1c5)),_0x541296=_0x417393[_0xd164e3(0x199)](0x1),_0x3b5aa7=await _0x5e38b2[_0xd164e3(0x1e5)](_0x541296,_0xd164e3(0x152));_0x208fbd=JSON[_0xd164e3(0x1c9)](_0x3b5aa7);}else _0x208fbd=JSON[_0xd164e3(0x1c9)](_0x417393);}catch{return console[_0xd164e3(0x1c2)](_0xd164e3(0x173)),0x1;}if(!_0x2acc5b[_0xd164e3(0x1e4)]){const _0x4a0a9a=await confirm(_0xd164e3(0x15f)+(_0x1ca7ce?'session':'attempt')+'\x20'+_0x3fc516+'?');if(!_0x4a0a9a)return console[_0xd164e3(0x1c2)](_0xd164e3(0x1e1)),0x0;}let _0x43d683;_0x1ca7ce?_0x43d683=await withSpinner(_0xd164e3(0x1aa),()=>_0x256fec[_0xd164e3(0x16e)][_0xd164e3(0x192)](_0x3fc516,{'fromTask':_0x18d762,'retryParams':_0x208fbd}),{'verbose':_0x2acc5b[_0xd164e3(0x1e9)]}):_0x43d683=await withSpinner('Retrying\x20attempt...',()=>_0x256fec[_0xd164e3(0x16e)]['retryAttempt'](_0x3fc516,{'resumeFrom':_0x2f6020,'retryParams':_0x208fbd,'force':_0x39dae5}),{'verbose':_0x2acc5b[_0xd164e3(0x1e9)]});const _0x4bc95d=_0x43d683[_0xd164e3(0x1a7)];return console[_0xd164e3(0x1c2)](_0xd164e3(0x1eb)),console[_0xd164e3(0x1c2)](_0xd164e3(0x178)+_0x4bc95d[_0xd164e3(0x1d9)]),console[_0xd164e3(0x1c2)]('\x20\x20Session\x20ID:\x20'+_0x4bc95d['sessionId']),0x0;}catch(_0x1411c8){if(_0x1411c8 instanceof SDKError)return console[_0xd164e3(0x1c2)](_0xd164e3(0x1f3)+_0x1411c8['message']),_0x1411c8[_0xd164e3(0x1b3)]&&console[_0xd164e3(0x1c2)]('\x20\x20Cause:\x20'+_0x1411c8[_0xd164e3(0x1b3)]),0x1;throw _0x1411c8;}}}export class WorkflowRunCommand extends BaseCommand{['name']=a39_0x538516(0x1b4);[a39_0x538516(0x1c6)]=a39_0x538516(0x175);async[a39_0x538516(0x1a5)](_0x4f31cb){const _0x5f046b=a39_0x538516,{options:_0x4c1fb1,args:_0x3cbe3c,tdx:_0x58ad47}=_0x4f31cb,_0x4ff70e=_0x3cbe3c[0x0];if(!_0x4ff70e)return console[_0x5f046b(0x1c2)](_0x5f046b(0x150)),console[_0x5f046b(0x1c2)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0x5b253=_0x4c1fb1[_0x5f046b(0x186)],_0x44bbfe=_0x4c1fb1[_0x5f046b(0x185)],_0x2c9bf3={};if(_0x5b253&&Array[_0x5f046b(0x1a1)](_0x5b253))for(const _0x386d35 of _0x5b253){const _0x508079=_0x386d35[_0x5f046b(0x168)]('=');if(_0x508079===-0x1)return console['error'](_0x5f046b(0x156)+_0x386d35),console['error'](_0x5f046b(0x16d)),0x1;const _0x209b48=_0x386d35[_0x5f046b(0x199)](0x0,_0x508079),_0x498664=_0x386d35[_0x5f046b(0x199)](_0x508079+0x1);try{_0x2c9bf3[_0x209b48]=JSON['parse'](_0x498664);}catch{_0x2c9bf3[_0x209b48]=_0x498664;}}_0x4c1fb1['verbose']&&(console[_0x5f046b(0x1c2)]('Workflow:\x20'+_0x4ff70e),Object['keys'](_0x2c9bf3)[_0x5f046b(0x172)]>0x0&&console[_0x5f046b(0x1c2)](_0x5f046b(0x1bb)+JSON[_0x5f046b(0x18c)](_0x2c9bf3)),_0x44bbfe&&console[_0x5f046b(0x1c2)](_0x5f046b(0x16a)+_0x44bbfe));const _0x33de97=await withSpinner(_0x5f046b(0x1ea),()=>_0x58ad47[_0x5f046b(0x16e)][_0x5f046b(0x1b0)](_0x4ff70e,_0x2c9bf3,{'sessionTime':_0x44bbfe}),{'verbose':_0x4c1fb1['verbose']}),_0x137259=_0x33de97['data'];return console[_0x5f046b(0x1c2)]('✔\x20Workflow\x20run\x20started'),console[_0x5f046b(0x1c2)]('\x20\x20Attempt\x20ID:\x20'+_0x137259['id']),console['error'](_0x5f046b(0x164)+_0x137259['sessionId']),console[_0x5f046b(0x1c2)]('\x20\x20Project:\x20'+_0x137259[_0x5f046b(0x17d)]?.[_0x5f046b(0x1d5)]),console[_0x5f046b(0x1c2)]('\x20\x20Workflow:\x20'+_0x137259['workflow']?.[_0x5f046b(0x1d5)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0x538516(0x1d5)]=a39_0x538516(0x1ab);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a39_0x538516(0x1a5)](_0x40dddb){const _0x24595c=a39_0x538516,{options:_0x161cee,args:_0x3d0e83,tdx:_0x200736}=_0x40dddb,_0xe1935c=_0x3d0e83[0x0],_0x15ae94=_0x3d0e83[0x1]||'.';if(!_0xe1935c)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x24595c(0x198)),0x1;const _0x38e468=_0x161cee[_0x24595c(0x1dd)];_0x161cee[_0x24595c(0x1e9)]&&(console[_0x24595c(0x1c2)]('Project:\x20'+_0xe1935c),console[_0x24595c(0x1c2)](_0x24595c(0x181)+_0x15ae94),_0x38e468&&console[_0x24595c(0x1c2)](_0x24595c(0x174)+_0x38e468));const _0x4a1879=await withSpinner(_0x24595c(0x14f)+_0xe1935c+_0x24595c(0x169),()=>_0x200736[_0x24595c(0x16e)][_0x24595c(0x1be)](_0xe1935c,_0x15ae94,{'revision':_0x38e468}),{'verbose':_0x161cee[_0x24595c(0x1e9)]}),_0x472c48=_0x4a1879[_0x24595c(0x1a7)];return console[_0x24595c(0x1c2)]('✔\x20Downloaded\x20'+_0x472c48[_0x24595c(0x17f)]),console[_0x24595c(0x1c2)](_0x24595c(0x1d2)+_0x472c48[_0x24595c(0x1dd)]),console[_0x24595c(0x1c2)](_0x24595c(0x1c7)+_0x472c48[_0x24595c(0x194)]),console[_0x24595c(0x1c2)](_0x24595c(0x1b7)+_0x15ae94+'/'+_0x472c48[_0x24595c(0x17f)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a39_0x538516(0x1d5)]=a39_0x538516(0x1df);[a39_0x538516(0x1c6)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a39_0x538516(0x1a5)](_0x41615f){const _0x2952ef=a39_0x538516,{options:_0x1452e2,args:_0x1ce44f,tdx:_0x3778ee}=_0x41615f;let _0x3ac488='.',_0x48da12=_0x1452e2['name'];if(_0x1ce44f[0x0]){const {promises:_0x86ca03}=await import('fs');try{const _0x98919b=await _0x86ca03[_0x2952ef(0x1d1)](_0x1ce44f[0x0]);if(_0x98919b[_0x2952ef(0x1d0)]())_0x3ac488=_0x1ce44f[0x0];else return console[_0x2952ef(0x1c2)]('Error:\x20'+_0x1ce44f[0x0]+_0x2952ef(0x1c3)),0x1;}catch{_0x48da12=_0x1ce44f[0x0],_0x3ac488='.';}}const _0x4b9f51=_0x1452e2['revision'],_0x333a97=_0x1452e2[_0x2952ef(0x1ba)];_0x1452e2[_0x2952ef(0x1e9)]&&(console[_0x2952ef(0x1c2)](_0x2952ef(0x182)+_0x3ac488),_0x48da12&&console[_0x2952ef(0x1c2)](_0x2952ef(0x193)+_0x48da12),_0x4b9f51&&console['error'](_0x2952ef(0x174)+_0x4b9f51),_0x333a97&&console[_0x2952ef(0x1c2)]('Validation:\x20skipped'));const _0xd2c8c7=await withSpinner(_0x2952ef(0x197),()=>_0x3778ee[_0x2952ef(0x16e)][_0x2952ef(0x171)](_0x3ac488,{'projectName':_0x48da12,'revision':_0x4b9f51,'skipValidation':_0x333a97}),{'verbose':_0x1452e2[_0x2952ef(0x1e9)]}),_0x141ee6=_0xd2c8c7[_0x2952ef(0x1a7)];return console[_0x2952ef(0x1c2)]('✔\x20Pushed\x20'+_0x141ee6['projectName']),console['error'](_0x2952ef(0x1ac)+_0x141ee6[_0x2952ef(0x1bf)]),console['error']('\x20\x20Revision:\x20'+_0x141ee6[_0x2952ef(0x1dd)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a39_0x538516(0x17a);['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a39_0x538516(0x1a5)](_0x5747a1){const _0x527ce3=a39_0x538516,{options:_0x563b16,args:_0x213a1b,tdx:_0x48ad9f}=_0x5747a1,_0xccb6ad=_0x213a1b[0x0];if(!_0xccb6ad)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x527ce3(0x1c2)](_0x527ce3(0x157)),0x1;_0x563b16[_0x527ce3(0x1e9)]&&console['error'](_0x527ce3(0x1e7)+_0xccb6ad);if(!_0x563b16['yes']){const _0x422cae=await confirm(_0x527ce3(0x158)+_0xccb6ad+_0x527ce3(0x17c));if(!_0x422cae)return console['error']('Cancelled'),0x0;}const _0x400552=await withSpinner(_0x527ce3(0x1db)+_0xccb6ad+'...',()=>_0x48ad9f['workflow'][_0x527ce3(0x196)](_0xccb6ad),{'verbose':_0x563b16['verbose']}),_0x2d8803=_0x400552[_0x527ce3(0x1a7)];return console[_0x527ce3(0x1c2)](_0x527ce3(0x1cc)+_0x2d8803[_0x527ce3(0x17f)]),console[_0x527ce3(0x1c2)](_0x527ce3(0x1ac)+_0x2d8803[_0x527ce3(0x1bf)]),0x0;}}
|
|
1
|
+
function a39_0x304c(){const _0x6c7d13=['push','yes','isArray','6325704MQiHvx','10629353cRjgyp','sessionId','✔\x20Deleted\x20project\x20','workflow:workflows','workflow:retry','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20\x20Cause:\x20','cause','verbose','cancelRequested','Getting\x20attempt\x20details...','Project\x20name:\x20','split','5707132fRELBX','Filter:\x20project=','Show\x20logs\x20for\x20a\x20workflow\x20attempt','select','✔\x20Found\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','fs/promises','format','Params:\x20','json','attempt:','Task\x20name:\x20','description','utf-8','stringify','Workflow:\x20','\x20\x20Attempt\x20ID:\x20','Show\x20tasks\x20for\x20an\x20attempt','data','List\x20all\x20workflow\x20projects','✔\x20Workflow\x20run\x20started','taskName','\x20workflow','execute','filesExtracted','workflow:attempt','attempt','session','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','workflow:download','retryAttemptName','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','run','logFiles','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','includeSubtasks','createdAt','3556880SXYBaO','workflow:run','Retrying\x20attempt...','✔\x20Pushed\x20','param','status','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20Session\x20ID:\x20','includeRetried','revision','\x22?\x20This\x20cannot\x20be\x20undone.','projects','startsWith','substring','\x20attempt','Status:\x20','getTime','List\x20workflow\x20execution\x20sessions','Start\x20a\x20workflow\x20run','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','✔\x20Downloaded\x20','retrySession','\x20\x20Location:\x20','workflow:attempts','Error:\x20Attempt\x20ID\x20is\x20required','Getting\x20attempt\x20tasks...','\x20project','Pattern:\x20','finishedAt','\x20\x20Project\x20ID:\x20','Starting\x20workflow\x20run...','Resume\x20from:\x20','\x20\x20Project:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','projectName','round','isDirectory','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','276637wWmkmi','map','Retry\x20a\x20session\x20or\x20attempt','\x20\x20New\x20attempt\x20ID:\x20','workflow:sessions','List\x20workflow\x20attempts','name','running','Reason:\x20','session:','skipValidation','workflow:tasks','fileSize','workflow','delete','canceling','List\x20workflows','\x20\x20Revision:\x20','projectId','readFile','length','project','workflow:delete','Deleting\x20project\x20','Filter:\x20','Include\x20retried:\x20yes','Force:\x20yes','\x20\x20Workflow:\x20','index','Error:\x20Invalid\x20parameter\x20format:\x20','parse','Downloading\x20project\x20','keys','Revision:\x20','Project:\x20','✔\x20Retry\x20started','Pushing\x20workflow\x20project...','Show\x20specific\x20attempt\x20details','Target:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','error','success','reason','attempts','492132OupeQW','sessions','stat','Attempt\x20ID:\x20','Error:\x20Project\x20name\x20is\x20required','from','No\x20log\x20content\x20found','Cancelled','task','\x20task','sessionTime','force','62870AxMGyW','logs','workflow:push','Session\x20time:\x20','Parameters:\x20','Output\x20directory:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Usage:\x20workflow:delete\x20<project-name-or-id>','download','Including\x20subtasks:\x20yes','limit','workflow:kill','tasks','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','Validation:\x20skipped','attemptId','params','Fetching\x20log\x20files...','\x20is\x20not\x20a\x20directory','Error:\x20','message','Retrying\x20session...','678hhhWQY'];a39_0x304c=function(){return _0x6c7d13;};return a39_0x304c();}const a39_0x187e55=a39_0x88b5;(function(_0x44a321,_0x234169){const _0x4f81b2=a39_0x88b5,_0x1ab361=_0x44a321();while(!![]){try{const _0x5c23ef=-parseInt(_0x4f81b2(0x127))/0x1+parseInt(_0x4f81b2(0x101))/0x2+parseInt(_0x4f81b2(0x153))/0x3+-parseInt(_0x4f81b2(0xdc))/0x4+parseInt(_0x4f81b2(0x15f))/0x5*(parseInt(_0x4f81b2(0xca))/0x6)+-parseInt(_0x4f81b2(0xcf))/0x7+parseInt(_0x4f81b2(0xce))/0x8;if(_0x5c23ef===_0x234169)break;else _0x1ab361['push'](_0x1ab361['shift']());}catch(_0x15746a){_0x1ab361['push'](_0x1ab361['shift']());}}}(a39_0x304c,0xe3940));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a39_0x22973d from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a39_0x187e55(0x12d)]='workflow:projects';[a39_0x187e55(0xe8)]=a39_0x187e55(0xef);async[a39_0x187e55(0xf3)](_0x16b4e7){const _0x5997db=a39_0x187e55,{options:_0x541da9,args:_0x2f0ece,tdx:_0x97b669}=_0x16b4e7,_0x18fe4d=_0x2f0ece[0x0];try{_0x541da9[_0x5997db(0xd7)]&&_0x18fe4d&&console[_0x5997db(0x14f)](_0x5997db(0x11c)+_0x18fe4d);const _0x1e5dcd=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x97b669[_0x5997db(0x134)][_0x5997db(0x10c)](_0x18fe4d,{'limit':_0x541da9[_0x5997db(0xbe)]}),{'verbose':_0x541da9[_0x5997db(0xd7)]}),_0xef1758=_0x1e5dcd[_0x5997db(0xee)];return console[_0x5997db(0x14f)](_0x5997db(0xe0)+_0xef1758[_0x5997db(0x13b)]+_0x5997db(0x11b)+(_0xef1758['length']!==0x1?'s':'')),await handleSDKOutput(_0xef1758,_0x541da9),0x0;}catch(_0x31f22a){if(_0x31f22a instanceof SDKError)return console[_0x5997db(0x14f)](_0x5997db(0xc7)+_0x31f22a[_0x5997db(0xc8)]),_0x31f22a['cause']&&console[_0x5997db(0x14f)]('\x20\x20Cause:\x20'+_0x31f22a[_0x5997db(0xd6)]),0x1;throw _0x31f22a;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0xd2);['description']=a39_0x187e55(0x137);async[a39_0x187e55(0xf3)](_0x45a254){const _0x47ad09=a39_0x187e55,{options:_0x5851bf,args:_0x22b44b,tdx:_0x39f671}=_0x45a254,_0x14a5a1=_0x22b44b[0x0];try{_0x5851bf[_0x47ad09(0xd7)]&&_0x14a5a1&&console[_0x47ad09(0x14f)]('Project\x20filter:\x20'+_0x14a5a1);const _0x4189fe=await withSpinner('Listing\x20workflows...',()=>_0x39f671[_0x47ad09(0x134)]['workflows'](_0x14a5a1,{'limit':_0x5851bf['limit']}),{'verbose':_0x5851bf[_0x47ad09(0xd7)]}),_0x2fff16=_0x4189fe['data'];return console[_0x47ad09(0x14f)]('✔\x20Found\x20'+_0x2fff16[_0x47ad09(0x13b)]+_0x47ad09(0xf2)+(_0x2fff16[_0x47ad09(0x13b)]!==0x1?'s':'')),await handleSDKOutput(_0x2fff16,_0x5851bf),0x0;}catch(_0x3ae1bb){if(_0x3ae1bb instanceof SDKError)return console[_0x47ad09(0x14f)](_0x47ad09(0xc7)+_0x3ae1bb[_0x47ad09(0xc8)]),_0x3ae1bb[_0x47ad09(0xd6)]&&console['error'](_0x47ad09(0xd5)+_0x3ae1bb['cause']),0x1;throw _0x3ae1bb;}}}export class WorkflowSessionsCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x12b);['description']=a39_0x187e55(0x112);async['execute'](_0x3f6942){const _0x219ef4=a39_0x187e55,{options:_0x1dfe3d,args:_0x4b2877,tdx:_0x5a2e4d}=_0x3f6942;let _0x4b8823,_0x180ddd;if(_0x4b2877[0x0]){const _0x5fce0b=_0x4b2877[0x0][_0x219ef4(0xdb)]('.');if(_0x5fce0b[_0x219ef4(0x13b)]===0x1)_0x4b8823=_0x5fce0b[0x0];else{if(_0x5fce0b['length']===0x2)[_0x4b8823,_0x180ddd]=_0x5fce0b;else return console[_0x219ef4(0x14f)](_0x219ef4(0xfb)),0x1;}}try{if(_0x1dfe3d[_0x219ef4(0xd7)]){if(_0x4b8823&&_0x180ddd)console[_0x219ef4(0x14f)](_0x219ef4(0x13f)+_0x4b8823+'.'+_0x180ddd);else _0x4b8823&&console[_0x219ef4(0x14f)](_0x219ef4(0xdd)+_0x4b8823);const _0x139318=_0x1dfe3d[_0x219ef4(0x106)];_0x139318&&console['error'](_0x219ef4(0x110)+_0x139318);}const _0x5d4299=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5a2e4d[_0x219ef4(0x134)][_0x219ef4(0x154)]({'projectName':_0x4b8823,'workflowName':_0x180ddd,'status':_0x1dfe3d[_0x219ef4(0x106)],'fromTime':_0x1dfe3d[_0x219ef4(0x158)],'toTime':_0x1dfe3d['to'],'limit':_0x1dfe3d[_0x219ef4(0xbe)]}),{'verbose':_0x1dfe3d[_0x219ef4(0xd7)]}),_0x5b7a7d=_0x5d4299[_0x219ef4(0xee)];return console[_0x219ef4(0x14f)](_0x219ef4(0xe0)+_0x5b7a7d[_0x219ef4(0x13b)]+'\x20session'+(_0x5b7a7d[_0x219ef4(0x13b)]!==0x1?'s':'')),await handleSDKOutput(_0x5b7a7d,_0x1dfe3d),0x0;}catch(_0x46b58b){if(_0x46b58b instanceof SDKError)return console['error'](_0x219ef4(0xc7)+_0x46b58b['message']),_0x46b58b[_0x219ef4(0xd6)]&&console[_0x219ef4(0x14f)](_0x219ef4(0xd5)+_0x46b58b[_0x219ef4(0xd6)]),0x1;throw _0x46b58b;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x118);[a39_0x187e55(0xe8)]=a39_0x187e55(0x12c);async[a39_0x187e55(0xf3)](_0x474c9f){const _0x36ca5d=a39_0x187e55,{options:_0x1c8779,args:_0x409d6a,tdx:_0x23ef08}=_0x474c9f;let _0x5e4694,_0x598534;if(_0x409d6a[0x0]){const _0x614c64=_0x409d6a[0x0][_0x36ca5d(0xdb)]('.');if(_0x614c64[_0x36ca5d(0x13b)]===0x1)_0x5e4694=_0x614c64[0x0];else{if(_0x614c64[_0x36ca5d(0x13b)]===0x2)[_0x5e4694,_0x598534]=_0x614c64;else return console[_0x36ca5d(0x14f)](_0x36ca5d(0xfb)),0x1;}}try{const _0xab4382=_0x1c8779[_0x36ca5d(0x109)];if(_0x1c8779[_0x36ca5d(0xd7)]){if(_0x5e4694&&_0x598534)console['error']('Filter:\x20'+_0x5e4694+'.'+_0x598534);else _0x5e4694&&console[_0x36ca5d(0x14f)](_0x36ca5d(0xdd)+_0x5e4694);_0xab4382&&console[_0x36ca5d(0x14f)](_0x36ca5d(0x140));}const _0x4cb3cc=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x23ef08[_0x36ca5d(0x134)][_0x36ca5d(0x152)]({'projectName':_0x5e4694,'workflowName':_0x598534,'includeRetried':_0xab4382,'limit':_0x1c8779[_0x36ca5d(0xbe)]}),{'verbose':_0x1c8779[_0x36ca5d(0xd7)]}),_0x1e9bac=_0x4cb3cc[_0x36ca5d(0xee)];return console[_0x36ca5d(0x14f)](_0x36ca5d(0xe0)+_0x1e9bac[_0x36ca5d(0x13b)]+_0x36ca5d(0x10f)+(_0x1e9bac[_0x36ca5d(0x13b)]!==0x1?'s':'')),await handleSDKOutput(_0x1e9bac,_0x1c8779),0x0;}catch(_0x45e796){if(_0x45e796 instanceof SDKError)return console[_0x36ca5d(0x14f)](_0x36ca5d(0xc7)+_0x45e796[_0x36ca5d(0xc8)]),_0x45e796[_0x36ca5d(0xd6)]&&console[_0x36ca5d(0x14f)](_0x36ca5d(0xd5)+_0x45e796[_0x36ca5d(0xd6)]),0x1;throw _0x45e796;}}}export class WorkflowAttemptCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0xf5);[a39_0x187e55(0xe8)]=a39_0x187e55(0x14c);async[a39_0x187e55(0xf3)](_0x13816d){const _0x64a1f=a39_0x187e55,{options:_0x4a9c0e,args:_0x325bc5,tdx:_0x480181}=_0x13816d,_0x2c24d2=_0x325bc5[0x0];if(!_0x2c24d2)return console['error'](_0x64a1f(0x119)),0x1;try{_0x4a9c0e['verbose']&&console[_0x64a1f(0x14f)](_0x64a1f(0x156)+_0x2c24d2);const _0x499ad4=await withSpinner(_0x64a1f(0xd9),()=>_0x480181[_0x64a1f(0x134)][_0x64a1f(0xf6)](_0x2c24d2),{'verbose':_0x4a9c0e['verbose']}),_0x229655=_0x499ad4[_0x64a1f(0xee)];let _0x4ae785;!_0x229655['done']?_0x4ae785=_0x229655[_0x64a1f(0xd8)]?_0x64a1f(0x136):_0x64a1f(0x12e):_0x4ae785=_0x229655[_0x64a1f(0x150)]?_0x64a1f(0x150):_0x64a1f(0x14f);let _0x3accf5;if(_0x229655[_0x64a1f(0x100)]&&_0x229655[_0x64a1f(0x11d)]){const _0x1b9e53=new Date(_0x229655['createdAt'])[_0x64a1f(0x111)](),_0x5795a2=new Date(_0x229655[_0x64a1f(0x11d)])['getTime']();_0x3accf5=Math[_0x64a1f(0x124)]((_0x5795a2-_0x1b9e53)/0x3e8);}const _0x42565c={'attempt_id':_0x229655['id'],'status':_0x4ae785,..._0x229655[_0x64a1f(0x143)]!==undefined&&{'index':_0x229655[_0x64a1f(0x143)]},..._0x229655[_0x64a1f(0x13c)]&&{'project':_0x229655[_0x64a1f(0x13c)][_0x64a1f(0x12d)]},..._0x229655[_0x64a1f(0x134)]&&{'workflow':_0x229655[_0x64a1f(0x134)]['name']},..._0x229655['sessionId']&&{'session_id':_0x229655[_0x64a1f(0xd0)]},..._0x229655[_0x64a1f(0x15d)]&&{'session_time':_0x229655['sessionTime']},..._0x229655['retryAttemptName']&&{'retry_attempt':_0x229655[_0x64a1f(0xfa)]},..._0x3accf5!==undefined&&{'duration_sec':_0x3accf5},..._0x229655[_0x64a1f(0x100)]&&{'created_at':_0x229655[_0x64a1f(0x100)]},..._0x229655[_0x64a1f(0x11d)]&&{'finished_at':_0x229655[_0x64a1f(0x11d)]},...Object['keys'](_0x229655[_0x64a1f(0xc4)])[_0x64a1f(0x13b)]>0x0&&{'params':_0x229655['params']}};return await handleSingleObjectOutput(_0x42565c,_0x4a9c0e),0x0;}catch(_0x501ec6){if(_0x501ec6 instanceof SDKError)return console['error'](_0x64a1f(0xc7)+_0x501ec6[_0x64a1f(0xc8)]),_0x501ec6[_0x64a1f(0xd6)]&&console[_0x64a1f(0x14f)](_0x64a1f(0xd5)+_0x501ec6[_0x64a1f(0xd6)]),0x1;throw _0x501ec6;}}}export class WorkflowTasksCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x132);[a39_0x187e55(0xe8)]=a39_0x187e55(0xed);async['execute'](_0x29060c){const _0x3f2507=a39_0x187e55,{options:_0x19e07f,args:_0x513fa4,tdx:_0x343850}=_0x29060c,_0x383bd0=_0x513fa4[0x0];if(!_0x383bd0)return console[_0x3f2507(0x14f)](_0x3f2507(0x119)),0x1;try{const _0x24782e=_0x19e07f[_0x3f2507(0xff)];_0x19e07f[_0x3f2507(0xd7)]&&(console['error'](_0x3f2507(0x156)+_0x383bd0),_0x24782e&&console[_0x3f2507(0x14f)](_0x3f2507(0xbd)));const _0x1f7afc=await withSpinner(_0x3f2507(0x11a),()=>_0x343850[_0x3f2507(0x134)][_0x3f2507(0xc0)](_0x383bd0,_0x24782e||![]),{'verbose':_0x19e07f[_0x3f2507(0xd7)]}),_0x40319d=_0x1f7afc[_0x3f2507(0xee)];return console['error']('✔\x20Found\x20'+_0x40319d[_0x3f2507(0x13b)]+_0x3f2507(0x15c)+(_0x40319d[_0x3f2507(0x13b)]!==0x1?'s':'')),await handleSDKOutput(_0x40319d,_0x19e07f),0x0;}catch(_0x1a78d7){if(_0x1a78d7 instanceof SDKError)return console[_0x3f2507(0x14f)](_0x3f2507(0xc7)+_0x1a78d7[_0x3f2507(0xc8)]),_0x1a78d7[_0x3f2507(0xd6)]&&console[_0x3f2507(0x14f)]('\x20\x20Cause:\x20'+_0x1a78d7[_0x3f2507(0xd6)]),0x1;throw _0x1a78d7;}}}export class WorkflowLogsCommand extends BaseCommand{[a39_0x187e55(0x12d)]='workflow:logs';[a39_0x187e55(0xe8)]=a39_0x187e55(0xde);async['execute'](_0x5d2e47){const _0x134b37=a39_0x187e55,{options:_0x4c2439,args:_0x21a864,tdx:_0x317db4}=_0x5d2e47,_0x445394=_0x21a864[0x0];let _0x490470=_0x21a864[0x1];if(!_0x445394)return console[_0x134b37(0x14f)](_0x134b37(0x119)),0x1;try{_0x4c2439[_0x134b37(0xd7)]&&(console[_0x134b37(0x14f)](_0x134b37(0x156)+_0x445394),_0x490470&&console[_0x134b37(0x14f)](_0x134b37(0xe7)+_0x490470));const _0x4b2f75=await withSpinner(_0x134b37(0xc5),()=>_0x317db4[_0x134b37(0x134)][_0x134b37(0xfd)](_0x445394,_0x490470),{'verbose':_0x4c2439[_0x134b37(0xd7)]}),_0x5df1a3=_0x4b2f75[_0x134b37(0xee)];if(_0x5df1a3[_0x134b37(0x13b)]===0x0)return console['error'](_0x134b37(0xd4)),0x0;if(!_0x490470&&(_0x4c2439[_0x134b37(0xe5)]||_0x4c2439[_0x134b37(0xe3)]))return await handleSDKOutput(_0x5df1a3,_0x4c2439),0x0;if(!_0x490470){const _0x19c3a2=_0x5df1a3[_0x134b37(0x128)](_0x3e1150=>({'title':_0x3e1150[_0x134b37(0xf1)]+'\x20('+formatBytes(_0x3e1150[_0x134b37(0x133)])+')','value':_0x3e1150[_0x134b37(0xf1)]})),_0x321064=await a39_0x22973d({'type':_0x134b37(0xdf),'name':'task','message':_0x134b37(0x107),'choices':_0x19c3a2});if(!_0x321064[_0x134b37(0x15b)])return console['error'](_0x134b37(0x15a)),0x0;_0x490470=_0x321064['task'];}const _0x13dd98=await withSpinner('Downloading\x20logs...',()=>_0x317db4[_0x134b37(0x134)][_0x134b37(0x160)](_0x445394,_0x490470),{'verbose':_0x4c2439[_0x134b37(0xd7)]}),_0x599b56=_0x13dd98[_0x134b37(0xee)];return _0x599b56?console['log'](_0x599b56):console[_0x134b37(0x14f)](_0x134b37(0x159)),0x0;}catch(_0x433126){if(_0x433126 instanceof SDKError)return console[_0x134b37(0x14f)]('Error:\x20'+_0x433126[_0x134b37(0xc8)]),_0x433126['cause']&&console[_0x134b37(0x14f)](_0x134b37(0xd5)+_0x433126['cause']),0x1;throw _0x433126;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a39_0x187e55(0xbf);[a39_0x187e55(0xe8)]='Kill\x20a\x20running\x20attempt';async[a39_0x187e55(0xf3)](_0x406392){const _0x16ef41=a39_0x187e55,{options:_0x3c5ee5,args:_0x48987c,tdx:_0x151bf7}=_0x406392,_0x1e1513=_0x48987c[0x0];if(!_0x1e1513)return console['error'](_0x16ef41(0x119)),0x1;try{const _0x47a58e=_0x3c5ee5[_0x16ef41(0x151)];_0x3c5ee5[_0x16ef41(0xd7)]&&(console['error']('Attempt\x20ID:\x20'+_0x1e1513),_0x47a58e&&console[_0x16ef41(0x14f)](_0x16ef41(0x12f)+_0x47a58e));if(!_0x3c5ee5['yes']){const _0x392cf4=await confirm(_0x16ef41(0xfe)+_0x1e1513+'?');if(!_0x392cf4)return console['error'](_0x16ef41(0x15a)),0x0;}const _0x3d4d97=await withSpinner('Killing\x20attempt...',()=>_0x151bf7[_0x16ef41(0x134)]['kill'](_0x1e1513,_0x47a58e),{'verbose':_0x3c5ee5['verbose']}),_0x2773b3=_0x3d4d97[_0x16ef41(0xee)];return console[_0x16ef41(0x14f)]('✔\x20'+_0x2773b3),0x0;}catch(_0x3ffff5){if(_0x3ffff5 instanceof SDKError)return console['error'](_0x16ef41(0xc7)+_0x3ffff5['message']),_0x3ffff5[_0x16ef41(0xd6)]&&console['error'](_0x16ef41(0xd5)+_0x3ffff5[_0x16ef41(0xd6)]),0x1;throw _0x3ffff5;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a39_0x187e55(0xd3);['description']=a39_0x187e55(0x129);async[a39_0x187e55(0xf3)](_0x2a464c){const _0x4db2d4=a39_0x187e55,{options:_0x467178,args:_0x2952d8,tdx:_0x27fd96}=_0x2a464c,_0x136367=_0x2952d8[0x0];if(!_0x136367)return console[_0x4db2d4(0x14f)](_0x4db2d4(0x14e)),console[_0x4db2d4(0x14f)](_0x4db2d4(0xe1)),0x1;let _0x466146=![],_0x1c6d25=_0x136367;if(_0x136367[_0x4db2d4(0x10d)](_0x4db2d4(0x130)))_0x466146=!![],_0x1c6d25=_0x136367[_0x4db2d4(0x10e)](0x8);else{if(_0x136367[_0x4db2d4(0x10d)](_0x4db2d4(0xe6)))_0x466146=![],_0x1c6d25=_0x136367[_0x4db2d4(0x10e)](0x8);else return console['error'](_0x4db2d4(0x122)),console[_0x4db2d4(0x14f)](_0x4db2d4(0xe1)),0x1;}try{const _0x52f276=_0x467178['fromTask'],_0x34d998=_0x467178['resumeFrom'],_0x4cd686=_0x467178[_0x4db2d4(0xc4)],_0x2b6995=_0x467178[_0x4db2d4(0x15e)];_0x467178['verbose']&&(console[_0x4db2d4(0x14f)](_0x4db2d4(0x14d)+(_0x466146?_0x4db2d4(0xf7):_0x4db2d4(0xf6))+'\x20'+_0x1c6d25),_0x52f276&&console[_0x4db2d4(0x14f)]('From\x20task:\x20'+_0x52f276),_0x34d998&&console[_0x4db2d4(0x14f)](_0x4db2d4(0x120)+_0x34d998),_0x4cd686&&console[_0x4db2d4(0x14f)](_0x4db2d4(0xe4)+_0x4cd686),_0x2b6995&&console[_0x4db2d4(0x14f)](_0x4db2d4(0x141)));let _0x3b45a2;if(_0x4cd686)try{if(_0x4cd686[_0x4db2d4(0x10d)]('@')){const _0x23e4bc=await import(_0x4db2d4(0xe2)),_0x2d6bff=_0x4cd686['substring'](0x1),_0x46927a=await _0x23e4bc[_0x4db2d4(0x13a)](_0x2d6bff,_0x4db2d4(0xe9));_0x3b45a2=JSON['parse'](_0x46927a);}else _0x3b45a2=JSON['parse'](_0x4cd686);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x467178[_0x4db2d4(0xcc)]){const _0x59e01f=await confirm(_0x4db2d4(0x114)+(_0x466146?_0x4db2d4(0xf7):'attempt')+'\x20'+_0x1c6d25+'?');if(!_0x59e01f)return console[_0x4db2d4(0x14f)](_0x4db2d4(0x15a)),0x0;}let _0x7a214c;_0x466146?_0x7a214c=await withSpinner(_0x4db2d4(0xc9),()=>_0x27fd96['workflow'][_0x4db2d4(0x116)](_0x1c6d25,{'fromTask':_0x52f276,'retryParams':_0x3b45a2}),{'verbose':_0x467178[_0x4db2d4(0xd7)]}):_0x7a214c=await withSpinner(_0x4db2d4(0x103),()=>_0x27fd96['workflow']['retryAttempt'](_0x1c6d25,{'resumeFrom':_0x34d998,'retryParams':_0x3b45a2,'force':_0x2b6995}),{'verbose':_0x467178[_0x4db2d4(0xd7)]});const _0x3b2a84=_0x7a214c[_0x4db2d4(0xee)];return console[_0x4db2d4(0x14f)](_0x4db2d4(0x14a)),console[_0x4db2d4(0x14f)](_0x4db2d4(0x12a)+_0x3b2a84[_0x4db2d4(0xc3)]),console[_0x4db2d4(0x14f)](_0x4db2d4(0x108)+_0x3b2a84[_0x4db2d4(0xd0)]),0x0;}catch(_0x54b5f2){if(_0x54b5f2 instanceof SDKError)return console[_0x4db2d4(0x14f)]('Error:\x20'+_0x54b5f2[_0x4db2d4(0xc8)]),_0x54b5f2[_0x4db2d4(0xd6)]&&console['error'](_0x4db2d4(0xd5)+_0x54b5f2[_0x4db2d4(0xd6)]),0x1;throw _0x54b5f2;}}}export class WorkflowRunCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x102);['description']=a39_0x187e55(0x113);async[a39_0x187e55(0xf3)](_0x3fb345){const _0x4f488d=a39_0x187e55,{options:_0x28c96d,args:_0x160bb3,tdx:_0xa03f42}=_0x3fb345,_0x1fd2e1=_0x160bb3[0x0];if(!_0x1fd2e1)return console[_0x4f488d(0x14f)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x4f488d(0x14f)](_0x4f488d(0xc1)),0x1;const _0x5b9d11=_0x28c96d[_0x4f488d(0x105)],_0x507d51=_0x28c96d[_0x4f488d(0x15d)],_0xa0ef8e={};if(_0x5b9d11&&Array[_0x4f488d(0xcd)](_0x5b9d11))for(const _0x434480 of _0x5b9d11){const _0x3ea520=_0x434480['indexOf']('=');if(_0x3ea520===-0x1)return console[_0x4f488d(0x14f)](_0x4f488d(0x144)+_0x434480),console[_0x4f488d(0x14f)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1ddebe=_0x434480['substring'](0x0,_0x3ea520),_0x46d894=_0x434480[_0x4f488d(0x10e)](_0x3ea520+0x1);try{_0xa0ef8e[_0x1ddebe]=JSON[_0x4f488d(0x145)](_0x46d894);}catch{_0xa0ef8e[_0x1ddebe]=_0x46d894;}}_0x28c96d[_0x4f488d(0xd7)]&&(console['error'](_0x4f488d(0xeb)+_0x1fd2e1),Object[_0x4f488d(0x147)](_0xa0ef8e)[_0x4f488d(0x13b)]>0x0&&console[_0x4f488d(0x14f)](_0x4f488d(0xb8)+JSON[_0x4f488d(0xea)](_0xa0ef8e)),_0x507d51&&console[_0x4f488d(0x14f)](_0x4f488d(0xb7)+_0x507d51));const _0x2fb095=await withSpinner(_0x4f488d(0x11f),()=>_0xa03f42[_0x4f488d(0x134)][_0x4f488d(0xfc)](_0x1fd2e1,_0xa0ef8e,{'sessionTime':_0x507d51}),{'verbose':_0x28c96d[_0x4f488d(0xd7)]}),_0x59cf2c=_0x2fb095['data'];return console[_0x4f488d(0x14f)](_0x4f488d(0xf0)),console[_0x4f488d(0x14f)](_0x4f488d(0xec)+_0x59cf2c['id']),console[_0x4f488d(0x14f)]('\x20\x20Session\x20ID:\x20'+_0x59cf2c[_0x4f488d(0xd0)]),console[_0x4f488d(0x14f)](_0x4f488d(0x121)+_0x59cf2c[_0x4f488d(0x13c)]?.['name']),console[_0x4f488d(0x14f)](_0x4f488d(0x142)+_0x59cf2c[_0x4f488d(0x134)]?.[_0x4f488d(0x12d)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a39_0x187e55(0xf9);[a39_0x187e55(0xe8)]=a39_0x187e55(0xba);async[a39_0x187e55(0xf3)](_0x2acac8){const _0x14e607=a39_0x187e55,{options:_0x3b534f,args:_0x38a01d,tdx:_0x37f602}=_0x2acac8,_0xe5e907=_0x38a01d[0x0],_0x8222e6=_0x38a01d[0x1]||'.';if(!_0xe5e907)return console[_0x14e607(0x14f)](_0x14e607(0x157)),console[_0x14e607(0x14f)](_0x14e607(0x126)),0x1;const _0x4a30f5=_0x3b534f[_0x14e607(0x10a)];_0x3b534f[_0x14e607(0xd7)]&&(console['error'](_0x14e607(0x149)+_0xe5e907),console[_0x14e607(0x14f)](_0x14e607(0xb9)+_0x8222e6),_0x4a30f5&&console[_0x14e607(0x14f)]('Revision:\x20'+_0x4a30f5));const _0x3b0223=await withSpinner(_0x14e607(0x146)+_0xe5e907+'...',()=>_0x37f602[_0x14e607(0x134)][_0x14e607(0xbc)](_0xe5e907,_0x8222e6,{'revision':_0x4a30f5}),{'verbose':_0x3b534f[_0x14e607(0xd7)]}),_0x3e298e=_0x3b0223[_0x14e607(0xee)];return console[_0x14e607(0x14f)](_0x14e607(0x115)+_0x3e298e[_0x14e607(0x123)]),console[_0x14e607(0x14f)](_0x14e607(0x138)+_0x3e298e['revision']),console[_0x14e607(0x14f)]('\x20\x20Files\x20extracted:\x20'+_0x3e298e[_0x14e607(0xf4)]),console[_0x14e607(0x14f)](_0x14e607(0x117)+_0x8222e6+'/'+_0x3e298e[_0x14e607(0x123)]),0x0;}}function a39_0x88b5(_0x39b9e5,_0x30009f){const _0x304c38=a39_0x304c();return a39_0x88b5=function(_0x88b50e,_0x175186){_0x88b50e=_0x88b50e-0xb6;let _0xdfe212=_0x304c38[_0x88b50e];return _0xdfe212;},a39_0x88b5(_0x39b9e5,_0x30009f);}export class WorkflowPushCommand extends BaseCommand{['name']=a39_0x187e55(0xb6);[a39_0x187e55(0xe8)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async['execute'](_0x42bdb3){const _0x2f2dcf=a39_0x187e55,{options:_0x2803fe,args:_0x5806eb,tdx:_0x48347b}=_0x42bdb3;let _0x376f20='.',_0xb3256c=_0x2803fe[_0x2f2dcf(0x12d)];if(_0x5806eb[0x0]){const {promises:_0x135f01}=await import('fs');try{const _0x3d702e=await _0x135f01[_0x2f2dcf(0x155)](_0x5806eb[0x0]);if(_0x3d702e[_0x2f2dcf(0x125)]())_0x376f20=_0x5806eb[0x0];else return console[_0x2f2dcf(0x14f)](_0x2f2dcf(0xc7)+_0x5806eb[0x0]+_0x2f2dcf(0xc6)),0x1;}catch{_0xb3256c=_0x5806eb[0x0],_0x376f20='.';}}const _0x255e42=_0x2803fe[_0x2f2dcf(0x10a)],_0xde8c=_0x2803fe[_0x2f2dcf(0x131)];_0x2803fe[_0x2f2dcf(0xd7)]&&(console[_0x2f2dcf(0x14f)]('Project\x20directory:\x20'+_0x376f20),_0xb3256c&&console[_0x2f2dcf(0x14f)](_0x2f2dcf(0xda)+_0xb3256c),_0x255e42&&console[_0x2f2dcf(0x14f)](_0x2f2dcf(0x148)+_0x255e42),_0xde8c&&console['error'](_0x2f2dcf(0xc2)));const _0x54b48d=await withSpinner(_0x2f2dcf(0x14b),()=>_0x48347b[_0x2f2dcf(0x134)][_0x2f2dcf(0xcb)](_0x376f20,{'projectName':_0xb3256c,'revision':_0x255e42,'skipValidation':_0xde8c}),{'verbose':_0x2803fe[_0x2f2dcf(0xd7)]}),_0x140c7f=_0x54b48d[_0x2f2dcf(0xee)];return console['error'](_0x2f2dcf(0x104)+_0x140c7f[_0x2f2dcf(0x123)]),console[_0x2f2dcf(0x14f)](_0x2f2dcf(0x11e)+_0x140c7f[_0x2f2dcf(0x139)]),console[_0x2f2dcf(0x14f)](_0x2f2dcf(0x138)+_0x140c7f['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0x187e55(0x12d)]=a39_0x187e55(0x13d);[a39_0x187e55(0xe8)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a39_0x187e55(0xf3)](_0x4979e4){const _0x18b525=a39_0x187e55,{options:_0x32eaba,args:_0x4d65bb,tdx:_0x4c70bd}=_0x4979e4,_0x47cf40=_0x4d65bb[0x0];if(!_0x47cf40)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x18b525(0xbb)),0x1;_0x32eaba[_0x18b525(0xd7)]&&console['error'](_0x18b525(0x149)+_0x47cf40);if(!_0x32eaba[_0x18b525(0xcc)]){const _0x713b56=await confirm(_0x18b525(0xf8)+_0x47cf40+_0x18b525(0x10b));if(!_0x713b56)return console['error'](_0x18b525(0x15a)),0x0;}const _0x3e1698=await withSpinner(_0x18b525(0x13e)+_0x47cf40+'...',()=>_0x4c70bd[_0x18b525(0x134)][_0x18b525(0x135)](_0x47cf40),{'verbose':_0x32eaba[_0x18b525(0xd7)]}),_0x26853d=_0x3e1698[_0x18b525(0xee)];return console['error'](_0x18b525(0xd1)+_0x26853d['projectName']),console[_0x18b525(0x14f)]('\x20\x20Project\x20ID:\x20'+_0x26853d[_0x18b525(0x139)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x594da3,_0x245817){const _0x2d746=a40_0x29ea,_0x3a1f6f=_0x594da3();while(!![]){try{const _0x5c9dcb=parseInt(_0x2d746(0x111))/0x1+-parseInt(_0x2d746(0x109))/0x2*(-parseInt(_0x2d746(0xff))/0x3)+-parseInt(_0x2d746(0x106))/0x4*(parseInt(_0x2d746(0x10d))/0x5)+parseInt(_0x2d746(0x110))/0x6*(-parseInt(_0x2d746(0x113))/0x7)+parseInt(_0x2d746(0x101))/0x8+parseInt(_0x2d746(0x102))/0x9+parseInt(_0x2d746(0x112))/0xa;if(_0x5c9dcb===_0x245817)break;else _0x3a1f6f['push'](_0x3a1f6f['shift']());}catch(_0x3dda15){_0x3a1f6f['push'](_0x3a1f6f['shift']());}}}(a40_0x5e8a,0x8fa9b));import{platform}from'os';function a40_0x5e8a(){const _0x357811=['141692dtpMsT','url','utf-8','2234RHrFmW','TD1\x20','replace','../../package.json','135IRvgtI','tdx','tdx/','6RTsxpE','743390nHeYdS','801880JrPfWT','7881937ncPvUZ',';\x20node/','2307UTAjqa','length','1296896LxfcID','7435728SRQCeY','entries','parse','Authorization'];a40_0x5e8a=function(){return _0x357811;};return a40_0x5e8a();}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x4d6d99=a40_0x29ea;try{const _0x5d41b6=fileURLToPath(import.meta[_0x4d6d99(0x107)]),_0x12b1ee=dirname(_0x5d41b6),_0x4dcc12=join(_0x12b1ee,_0x4d6d99(0x10c)),_0x229d19=JSON[_0x4d6d99(0x104)](readFileSync(_0x4dcc12,_0x4d6d99(0x108)));return _0x229d19['version'];}catch{return'0.0.0';}}export function getUserAgent(){const _0x1993a6=a40_0x29ea,_0xd47f1f=getVersion(),_0x36d8ed=platform(),_0x2c6504=process['version'][_0x1993a6(0x10b)]('v','');return _0x1993a6(0x10f)+_0xd47f1f+'\x20('+_0x36d8ed+_0x1993a6(0xfe)+_0x2c6504+')';}export function getAuthHeaders(_0x5b295c,_0x4b8cb6){const _0x15983f=a40_0x29ea,_0x198619=getVersion(),_0x213e2d={'User-Agent':getUserAgent(),'X-TD-Client':_0x15983f(0x10e),'X-TD-Client-Version':_0x198619};return _0x4b8cb6&&(_0x213e2d[_0x15983f(0x105)]=_0x15983f(0x10a)+_0x4b8cb6),_0x213e2d;}export function toHeaderRecord(_0x3e2cea){const _0x107814=a40_0x29ea,_0x4dbc91={};for(const [_0x298b01,_0x51e343]of Object[_0x107814(0x103)](_0x3e2cea)){_0x51e343!==undefined&&(_0x4dbc91[_0x298b01]=_0x51e343);}return _0x4dbc91;}function a40_0x29ea(_0x3227f2,_0x2ba6bb){const _0x5e8a35=a40_0x5e8a();return a40_0x29ea=function(_0x29ea39,_0x13d8aa){_0x29ea39=_0x29ea39-0xfe;let _0x2751dc=_0x5e8a35[_0x29ea39];return _0x2751dc;},a40_0x29ea(_0x3227f2,_0x2ba6bb);}export function getTrinoHeaders(_0x10a155,_0x27e920){const _0x2f039c=a40_0x29ea,_0x365267=getAuthHeaders(_0x10a155,_0x27e920),_0x3e8c7e=toHeaderRecord(_0x365267);return delete _0x3e8c7e[_0x2f039c(0x105)],_0x27e920&&(_0x3e8c7e['X-Trino-User']=_0x27e920),_0x3e8c7e;}export function hasAPIKey(_0x2a200a){const _0x3705fc=a40_0x29ea,_0x5d578b=getAPIKey(_0x2a200a);return _0x5d578b!==undefined&&_0x5d578b[_0x3705fc(0x100)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2bfcbd,_0x4d28db){const _0x35d0b7=a41_0x47a9,_0x26fc57=_0x2bfcbd();while(!![]){try{const _0x47f09d=parseInt(_0x35d0b7(0xba))/0x1*(parseInt(_0x35d0b7(0xa6))/0x2)+parseInt(_0x35d0b7(0x6f))/0x3+parseInt(_0x35d0b7(0x82))/0x4*(-parseInt(_0x35d0b7(0x83))/0x5)+parseInt(_0x35d0b7(0xb2))/0x6*(-parseInt(_0x35d0b7(0x8a))/0x7)+parseInt(_0x35d0b7(0x9f))/0x8*(parseInt(_0x35d0b7(0x7e))/0x9)+parseInt(_0x35d0b7(0xa7))/0xa+-parseInt(_0x35d0b7(0x7c))/0xb*(parseInt(_0x35d0b7(0x97))/0xc);if(_0x47f09d===_0x4d28db)break;else _0x26fc57['push'](_0x26fc57['shift']());}catch(_0x1a1130){_0x26fc57['push'](_0x26fc57['shift']());}}}(a41_0x1c74,0x536a5));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0xf5646e from'node:fs';import*as a41_0x4b0c97 from'node:path';function a41_0x1c74(){const _0x78989e=['profiles','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','tdx.json','20916OtyNZW','keychain\x20(profile:\x20','stg-jp01','profile','startsWith','stg-ap03','dev-eu01','slice','224hUDTkq','dev-us01','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','us01','map','Warning:\x20Unknown\x20site\x20\x27','join','4mvlDDw','1393950TpZFNt','trim','TD_API_KEY\x20env\x20var\x20(deprecated)','name','TDX_API_KEY_<PROFILE>','source','llm_default_project.','string','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','TD_API_KEY','.config','1880322rEQNlc','TDX_CONFIG_DIR','toUpperCase','tdx','TDX_API_KEY_','keychain','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','eu01','326726PawTjG','TDX_API_KEY\x20env\x20var','1916217ZMkXiZ','replace','TDX_CACHE_DIR','utf-8','\x27,\x20defaulting\x20to\x20us01','readFileSync','apiKey','legacy\x20.env\x20file\x20(profile:\x20','split','stringify','match','ap03','ap02','5797cbsIZc','TD_API_KEY_','199152Ylxghi','warn','env','Warning:\x20Failed\x20to\x20load\x20','4LgbTCe','2387765tlkkGq','TDX_API_KEY','existsSync','legacy\x20.env\x20file','endsWith','stg-us01','yellow','7OxQNVJ','jp01','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','\x20env\x20var','.cache','includes','.env.','.env','some','parse'];a41_0x1c74=function(){return _0x78989e;};return a41_0x1c74();}import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x2c3cae from'chalk';export function getConfigDir(){const _0x225b55=a41_0x47a9;return process[_0x225b55(0x80)][_0x225b55(0xb3)]||join(homedir(),_0x225b55(0xb1),_0x225b55(0xb5));}export function getConfigFile(){const _0x2f9f94=a41_0x47a9;return join(getConfigDir(),_0x2f9f94(0x91));}function a41_0x47a9(_0x5f51b8,_0xbb8312){const _0x1c74e3=a41_0x1c74();return a41_0x47a9=function(_0x47a953,_0x22b274){_0x47a953=_0x47a953-0x6f;let _0x2fcc8e=_0x1c74e3[_0x47a953];return _0x2fcc8e;},a41_0x47a9(_0x5f51b8,_0xbb8312);}export function getConfigFilePath(_0x43f0fe){const _0x585647=a41_0x47a9,_0x148779=getConfigDir();return _0x43f0fe?a41_0x4b0c97[_0x585647(0xa5)](_0x148779,_0x585647(0x90)+_0x43f0fe):getConfigFile();}export function getCacheDir(){const _0x2b63a4=a41_0x47a9;return process[_0x2b63a4(0x80)][_0x2b63a4(0x71)]||join(homedir(),_0x2b63a4(0x8e),'tdx');}export function getLLMProjectCacheFile(_0x440016){const _0x38d98f=a41_0x47a9,_0x3b6be6=_0x440016?_0x38d98f(0xad)+_0x440016:'llm_default_project';return join(getCacheDir(),_0x3b6be6);}export function readCachedLLMProject(_0x47e913){const _0x515a5b=a41_0x47a9;try{const _0x36adf0=getLLMProjectCacheFile(_0x47e913);if(!existsSync(_0x36adf0))return null;const _0x4c2f56=readFileSync(_0x36adf0,_0x515a5b(0x72))[_0x515a5b(0xa8)]();try{const _0x470927=JSON[_0x515a5b(0x93)](_0x4c2f56);if(_0x470927&&typeof _0x470927['id']===_0x515a5b(0xae)&&typeof _0x470927[_0x515a5b(0xaa)]==='string')return _0x470927;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x1621e1,_0x1eaee6,_0x2697ab){const _0x5da09e=a41_0x47a9;try{const _0x341d98=getCacheDir(),_0x30f38e=getLLMProjectCacheFile(_0x2697ab);!existsSync(_0x341d98)&&mkdirSync(_0x341d98,{'recursive':!![]});const _0x4834b5={'name':_0x1621e1,'id':_0x1eaee6};writeFileSync(_0x30f38e,JSON[_0x5da09e(0x78)](_0x4834b5),_0x5da09e(0x72));}catch{}}export function parseEnvFile(_0x41fec6){const _0x535e47=a41_0x47a9,_0x5768f0={};for(const _0x22704a of _0x41fec6[_0x535e47(0x77)]('\x0a')){const _0x59bacc=_0x22704a['trim']();if(!_0x59bacc||_0x59bacc['startsWith']('#'))continue;const _0x3094a8=_0x59bacc[_0x535e47(0x79)](/^([^=]+)=(.*)$/);if(_0x3094a8){const _0x91385=_0x3094a8[0x1][_0x535e47(0xa8)]();let _0x75c532=_0x3094a8[0x2]['trim']();(_0x75c532[_0x535e47(0x9b)]('\x22')&&_0x75c532[_0x535e47(0x87)]('\x22')||_0x75c532[_0x535e47(0x9b)]('\x27')&&_0x75c532[_0x535e47(0x87)]('\x27'))&&(_0x75c532=_0x75c532[_0x535e47(0x9e)](0x1,-0x1)),_0x5768f0[_0x91385]=_0x75c532;}}return _0x5768f0;}export function readUserConfig(){const _0x3ea3c1=a41_0x47a9,_0x334775=getConfigFile();if(!existsSync(_0x334775))return{};try{const _0x4f18cd=readFileSync(_0x334775,'utf-8');return parseEnvFile(_0x4f18cd);}catch(_0x382720){return console['warn'](_0x3ea3c1(0xa1)+_0x334775+':',_0x382720),{};}}export function resolveSite(_0x2b56fa){const _0x474a10=a41_0x47a9,_0x6edf3=[_0x474a10(0xa2),_0x474a10(0x8b),_0x474a10(0xb9),_0x474a10(0x7b),'ap03','dev-us01',_0x474a10(0x9d),'stg-us01',_0x474a10(0x99),'stg-ap03'];if(_0x6edf3[_0x474a10(0x8f)](_0x2b56fa))return _0x2b56fa;if(_0x2b56fa in SITE_ALIASES)return SITE_ALIASES[_0x2b56fa];return console['warn'](_0x474a10(0xa4)+_0x2b56fa+_0x474a10(0x73)),_0x474a10(0xa2);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0xbb49e0,_0x55ec41){const _0x9b1842=a41_0x47a9,_0x256d77=_0x55ec41||getActiveProfileName();if(_0x256d77){const _0x21005c=_0x9b1842(0xb6)+normalizeProfileForEnvVar(_0x256d77);if(process[_0x9b1842(0x80)][_0x21005c])return process[_0x9b1842(0x80)][_0x21005c];}if(process['env'][_0x9b1842(0x84)])return process[_0x9b1842(0x80)]['TDX_API_KEY'];if(process[_0x9b1842(0x80)][_0x9b1842(0xb0)])return process['env']['TD_API_KEY'];const _0x311bed=_0xbb49e0['toUpperCase']()['replace'](/-/g,'_'),_0x19d156=_0x9b1842(0x7d)+_0x311bed;if(_0x256d77){const _0x49fad8=loadProfileEnv(_0x256d77);if(_0x49fad8){if(_0x49fad8[_0x19d156])return _0x49fad8[_0x19d156];if(_0x49fad8[_0x9b1842(0xb0)])return _0x49fad8[_0x9b1842(0xb0)];}}const _0x57623f=loadUserConfigOnce();if(_0x57623f[_0x19d156])return _0x57623f[_0x19d156];if(_0x57623f['TD_API_KEY'])return _0x57623f[_0x9b1842(0xb0)];return undefined;}export function normalizeProfileForEnvVar(_0x2c7bae){const _0x2285d8=a41_0x47a9;return _0x2c7bae[_0x2285d8(0xb4)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x296286,_0x537bbe){const _0x246283=a41_0x47a9,_0x40795c=_0x537bbe||getActiveProfileName()||undefined;if(_0x40795c){const _0x34cae4='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x40795c);if(process[_0x246283(0x80)][_0x34cae4])return{'apiKey':process['env'][_0x34cae4],'source':_0x34cae4+_0x246283(0x8d),'isDeprecated':![]};const _0x3699b4=getCachedCredential(_0x296286,_0x40795c);if(_0x3699b4)return{'apiKey':_0x3699b4,'source':'keychain\x20(profile:\x20'+_0x40795c+')','isDeprecated':![]};const _0x3bf0a3=await getKeychainAPIKey(_0x40795c);if(_0x3bf0a3)return setCachedCredential(_0x3bf0a3,_0x296286,_0x40795c),{'apiKey':_0x3bf0a3,'source':_0x246283(0x98)+_0x40795c+')','isDeprecated':![]};}if(process[_0x246283(0x80)][_0x246283(0x84)])return{'apiKey':process[_0x246283(0x80)][_0x246283(0x84)],'source':_0x246283(0xbb),'isDeprecated':![]};if(!_0x40795c){const _0x2fbd9d=getCachedCredential(_0x296286,undefined);if(_0x2fbd9d)return{'apiKey':_0x2fbd9d,'source':_0x246283(0xb7),'isDeprecated':![]};const _0x3be3a4=await getKeychainAPIKey(undefined);if(_0x3be3a4)return setCachedCredential(_0x3be3a4,_0x296286,undefined),{'apiKey':_0x3be3a4,'source':_0x246283(0xb7),'isDeprecated':![]};}if(process[_0x246283(0x80)][_0x246283(0xb0)])return{'apiKey':process['env'][_0x246283(0xb0)],'source':_0x246283(0xa9),'isDeprecated':!![]};const _0x1bc149=getLegacyEnvAPIKey(_0x296286,_0x40795c);if(_0x1bc149){const _0x4e8a8e=await isKeychainAvailable();if(_0x4e8a8e)try{await saveKeychainAPIKey(_0x1bc149,_0x40795c),setCachedCredential(_0x1bc149,_0x296286,_0x40795c);const _0x5a3461=getConfigFilePath(_0x40795c);cleanupLegacyEnvFile(_0x5a3461)&&console[_0x246283(0x7f)](a41_0x2c3cae[_0x246283(0x89)](_0x246283(0x95)));}catch(_0x1b8f7e){console[_0x246283(0x7f)](a41_0x2c3cae[_0x246283(0x89)](_0x246283(0xb8)+_0x1b8f7e));}const _0x5bb90c=_0x40795c?_0x246283(0x76)+_0x40795c+')':_0x246283(0x86);return{'apiKey':_0x1bc149,'source':_0x5bb90c,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2f743e,_0x5354b8,_0x36efb5=!![]){const _0x3f03b5=a41_0x47a9,_0x4fbfbc=await resolveAPIKeyAsync(_0x2f743e,_0x5354b8);if(!_0x4fbfbc)return undefined;if(_0x36efb5&&_0x4fbfbc['isDeprecated']&&_0x4fbfbc[_0x3f03b5(0xac)][_0x3f03b5(0x8f)](_0x3f03b5(0xb0))){const _0x341b1c=_0x5354b8||getActiveProfileName()||undefined,_0x4278b5=_0x341b1c?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x341b1c):_0x3f03b5(0xab);console[_0x3f03b5(0x7f)](a41_0x2c3cae['yellow'](_0x3f03b5(0xaf)+(_0x3f03b5(0x8c)+_0x4278b5+').')));}return _0x4fbfbc[_0x3f03b5(0x75)];}function getLegacyEnvAPIKey(_0x48beab,_0x55f275){const _0x44e02e=a41_0x47a9,_0x3f79cf=_0x48beab[_0x44e02e(0xb4)]()[_0x44e02e(0x70)](/-/g,'_'),_0x429e27=_0x44e02e(0x7d)+_0x3f79cf;if(_0x55f275){const _0x5aac65=loadProfileEnv(_0x55f275);if(_0x5aac65){if(_0x5aac65[_0x429e27])return _0x5aac65[_0x429e27];if(_0x5aac65[_0x44e02e(0xb0)])return _0x5aac65[_0x44e02e(0xb0)];}}const _0x5dde3b=loadUserConfigOnce();if(_0x5dde3b[_0x429e27])return _0x5dde3b[_0x429e27];if(_0x5dde3b[_0x44e02e(0xb0)])return _0x5dde3b[_0x44e02e(0xb0)];return undefined;}function cleanupLegacyEnvFile(_0x54daec){const _0x1a9d37=a41_0x47a9;if(!existsSync(_0x54daec))return![];try{const _0x228a01=readFileSync(_0x54daec,_0x1a9d37(0x72)),_0x58f353=_0x228a01[_0x1a9d37(0x77)]('\x0a'),_0x381f94=_0x58f353['filter'](_0x51c04e=>{const _0x3cb5e2=_0x1a9d37,_0x41bd3f=_0x51c04e[_0x3cb5e2(0xa8)]();if(!_0x41bd3f||_0x41bd3f[_0x3cb5e2(0x9b)]('#'))return!![];const [_0x54a24f]=_0x41bd3f[_0x3cb5e2(0x77)]('=');return!_0x54a24f[_0x3cb5e2(0x9b)](_0x3cb5e2(0xb0));}),_0x377851=_0x381f94[_0x1a9d37(0x92)](_0x545b30=>{const _0x347c12=_0x1a9d37,_0x1e13c1=_0x545b30['trim']();return _0x1e13c1&&!_0x1e13c1[_0x347c12(0x9b)]('#');});if(!_0x377851)return unlinkSync(_0x54daec),!![];return writeFileSync(_0x54daec,_0x381f94['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x5d3c41){const _0x372624=a41_0x47a9,_0x4c5a9f=a41_0x4b0c97[_0x372624(0xa5)](getConfigDir(),'.env.'+_0x5d3c41);if(a41_0xf5646e[_0x372624(0x85)](_0x4c5a9f)){validateSecureFilePermissions(_0x4c5a9f);try{const _0x32150a=a41_0xf5646e[_0x372624(0x74)](_0x4c5a9f,_0x372624(0x72));return parseEnvFile(_0x32150a);}catch(_0x55bdd7){console['warn'](_0x372624(0x81)+_0x4c5a9f+':\x20'+_0x55bdd7);}}const _0x3dcc60=a41_0x4b0c97[_0x372624(0xa5)](getConfigDir(),_0x372624(0x94),_0x5d3c41,_0x372624(0x91));if(a41_0xf5646e[_0x372624(0x85)](_0x3dcc60)){validateSecureFilePermissions(_0x3dcc60);try{const _0x185045=a41_0xf5646e['readFileSync'](_0x3dcc60,_0x372624(0x72));return parseEnvFile(_0x185045);}catch(_0x13c154){return console[_0x372624(0x7f)](_0x372624(0x81)+_0x3dcc60+':\x20'+_0x13c154),null;}}return null;}function getActiveProfileName(){const _0x402edd=a41_0x47a9,_0x27f85b=a41_0x4b0c97[_0x402edd(0xa5)](getConfigDir(),_0x402edd(0x96));if(!a41_0xf5646e[_0x402edd(0x85)](_0x27f85b))return null;try{const _0x419738=a41_0xf5646e[_0x402edd(0x74)](_0x27f85b,_0x402edd(0x72)),_0x9afbbb=JSON[_0x402edd(0x93)](_0x419738);return _0x9afbbb[_0x402edd(0x9a)]||null;}catch{return null;}}export function saveAPIKey(_0x2f8cf2,_0x5ee389,_0x4143ea){const _0x1f64ac=a41_0x47a9,_0x390182=getConfigDir(),_0x84d306=getConfigFilePath(_0x4143ea);!existsSync(_0x390182)&&mkdirSync(_0x390182,{'recursive':!![],'mode':0x1c0});let _0x1d7284={};if(existsSync(_0x84d306))try{const _0x1f2faf=readFileSync(_0x84d306,'utf-8');_0x1d7284=parseEnvFile(_0x1f2faf);}catch(_0x280a37){console[_0x1f64ac(0x7f)]('Warning:\x20Failed\x20to\x20read\x20'+_0x84d306+':',_0x280a37);}const _0x1cafc4=_0x2f8cf2[_0x1f64ac(0xb4)]()[_0x1f64ac(0x70)](/-/g,'_');_0x1d7284[_0x1f64ac(0x7d)+_0x1cafc4]=_0x5ee389;const _0x353a1e=Object['entries'](_0x1d7284)[_0x1f64ac(0xa3)](([_0x3d9e47,_0x320eef])=>_0x3d9e47+'='+_0x320eef);writeFileSync(_0x84d306,_0x353a1e[_0x1f64ac(0xa5)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x5bb353,_0x2959ea,_0x6a7ede){const _0x355bc8=a41_0x47a9;await saveKeychainAPIKey(_0x5bb353,_0x6a7ede),setCachedCredential(_0x5bb353,_0x2959ea,_0x6a7ede);const _0x30556f=getConfigFilePath(_0x6a7ede);cleanupLegacyEnvFile(_0x30556f)&&console[_0x355bc8(0x7f)](a41_0x2c3cae[_0x355bc8(0x89)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x1eb887=a41_0x47a9,_0x5a320d={'apiKeys':{},'defaultSite':_0x1eb887(0xa2)},_0x100679=['us01',_0x1eb887(0x8b),_0x1eb887(0xb9),_0x1eb887(0x7b),_0x1eb887(0x7a),_0x1eb887(0xa0),_0x1eb887(0x9d),_0x1eb887(0x88),_0x1eb887(0x99),_0x1eb887(0x9c)];for(const _0x5af6f3 of _0x100679){const _0x1d0a21=getAPIKey(_0x5af6f3);_0x1d0a21&&(_0x5a320d['apiKeys'][_0x5af6f3]=_0x1d0a21);}return _0x5a320d;}
|
|
1
|
+
(function(_0x53f680,_0x4ccb06){const _0x473554=a41_0x326e,_0x149932=_0x53f680();while(!![]){try{const _0x12e199=parseInt(_0x473554(0x10b))/0x1+-parseInt(_0x473554(0x13d))/0x2*(parseInt(_0x473554(0x14e))/0x3)+-parseInt(_0x473554(0x14b))/0x4+parseInt(_0x473554(0x11f))/0x5+-parseInt(_0x473554(0x143))/0x6*(-parseInt(_0x473554(0x122))/0x7)+parseInt(_0x473554(0x130))/0x8+parseInt(_0x473554(0x133))/0x9*(-parseInt(_0x473554(0x13b))/0xa);if(_0x12e199===_0x4ccb06)break;else _0x149932['push'](_0x149932['shift']());}catch(_0xb058c7){_0x149932['push'](_0x149932['shift']());}}}(a41_0xba00,0x3d15b));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x2c83f0 from'node:fs';import*as a41_0xd5b29e from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x12b6e4 from'chalk';export function getConfigDir(){const _0x2238b5=a41_0x326e;return process['env']['TDX_CONFIG_DIR']||join(homedir(),_0x2238b5(0x11b),_0x2238b5(0x11d));}function a41_0xba00(){const _0x3456f7=['join','includes','readFileSync','.env.','entries','split','keychain','354944tBOWyy','stg-us01','match','1278705nmnRlO','warn','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','profiles','493864yMbdFR','toUpperCase','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','utf-8','us01','jp01','some','TD_API_KEY_','existsSync','yellow','string','replace','trim','stg-jp01','endsWith','dev-eu01','.config','source','tdx','\x20env\x20var','2404645unePTJ','ap02','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','1275477pbHKoz','map','ap03','eu01','env','TDX_API_KEY','TDX_CACHE_DIR','.env','startsWith','slice','legacy\x20.env\x20file\x20(profile:\x20','profile','tdx.json','Warning:\x20Unknown\x20site\x20\x27','3611864YMycow','parse','isDeprecated','200646dVdkJZ','keychain\x20(profile:\x20','TDX_API_KEY_','.cache','Warning:\x20Failed\x20to\x20load\x20','llm_default_project.','TDX_API_KEY_<PROFILE>','TDX_API_KEY\x20env\x20var','460TgCMar','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','2hHbcki','name','stg-ap03','Warning:\x20Failed\x20to\x20read\x20','filter','TD_API_KEY','12HGTflU'];a41_0xba00=function(){return _0x3456f7;};return a41_0xba00();}export function getConfigFile(){const _0x5ab437=a41_0x326e;return join(getConfigDir(),_0x5ab437(0x129));}export function getConfigFilePath(_0xc302e1){const _0x3940ea=a41_0x326e,_0x3a0920=getConfigDir();return _0xc302e1?a41_0xd5b29e[_0x3940ea(0x144)](_0x3a0920,'.env.'+_0xc302e1):getConfigFile();}export function getCacheDir(){const _0x433df8=a41_0x326e;return process[_0x433df8(0x126)][_0x433df8(0x128)]||join(homedir(),_0x433df8(0x136),_0x433df8(0x11d));}export function getLLMProjectCacheFile(_0x31d57c){const _0x369c46=a41_0x326e,_0x549ac4=_0x31d57c?_0x369c46(0x138)+_0x31d57c:'llm_default_project';return join(getCacheDir(),_0x549ac4);}export function readCachedLLMProject(_0xff0e70){const _0x2bb5ec=a41_0x326e;try{const _0xd9c1b4=getLLMProjectCacheFile(_0xff0e70);if(!existsSync(_0xd9c1b4))return null;const _0x449ab2=readFileSync(_0xd9c1b4,_0x2bb5ec(0x10e))[_0x2bb5ec(0x117)]();try{const _0x5cd033=JSON[_0x2bb5ec(0x131)](_0x449ab2);if(_0x5cd033&&typeof _0x5cd033['id']===_0x2bb5ec(0x115)&&typeof _0x5cd033[_0x2bb5ec(0x13e)]===_0x2bb5ec(0x115))return _0x5cd033;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x2e1c81,_0x2eaafa,_0x32fdd9){const _0x4d7c68=a41_0x326e;try{const _0x4a309b=getCacheDir(),_0x3ef088=getLLMProjectCacheFile(_0x32fdd9);!existsSync(_0x4a309b)&&mkdirSync(_0x4a309b,{'recursive':!![]});const _0x322b8b={'name':_0x2e1c81,'id':_0x2eaafa};writeFileSync(_0x3ef088,JSON['stringify'](_0x322b8b),_0x4d7c68(0x10e));}catch{}}export function parseEnvFile(_0x576166){const _0xf7fd64=a41_0x326e,_0x5e699a={};for(const _0x596bba of _0x576166[_0xf7fd64(0x149)]('\x0a')){const _0x4c46ae=_0x596bba[_0xf7fd64(0x117)]();if(!_0x4c46ae||_0x4c46ae[_0xf7fd64(0x12a)]('#'))continue;const _0x5539d5=_0x4c46ae[_0xf7fd64(0x14d)](/^([^=]+)=(.*)$/);if(_0x5539d5){const _0x3daff4=_0x5539d5[0x1][_0xf7fd64(0x117)]();let _0xc362f7=_0x5539d5[0x2]['trim']();(_0xc362f7[_0xf7fd64(0x12a)]('\x22')&&_0xc362f7[_0xf7fd64(0x119)]('\x22')||_0xc362f7[_0xf7fd64(0x12a)]('\x27')&&_0xc362f7[_0xf7fd64(0x119)]('\x27'))&&(_0xc362f7=_0xc362f7[_0xf7fd64(0x12b)](0x1,-0x1)),_0x5e699a[_0x3daff4]=_0xc362f7;}}return _0x5e699a;}export function readUserConfig(){const _0x4ae25f=a41_0x326e,_0x6fdf84=getConfigFile();if(!existsSync(_0x6fdf84))return{};try{const _0x3fe926=readFileSync(_0x6fdf84,_0x4ae25f(0x10e));return parseEnvFile(_0x3fe926);}catch(_0x3e1252){return console['warn'](_0x4ae25f(0x109)+_0x6fdf84+':',_0x3e1252),{};}}export function resolveSite(_0x174b97){const _0x60b93b=a41_0x326e,_0x1b8759=[_0x60b93b(0x10f),'jp01',_0x60b93b(0x125),_0x60b93b(0x120),_0x60b93b(0x124),'dev-us01',_0x60b93b(0x11a),_0x60b93b(0x14c),_0x60b93b(0x118),_0x60b93b(0x13f)];if(_0x1b8759[_0x60b93b(0x145)](_0x174b97))return _0x174b97;if(_0x174b97 in SITE_ALIASES)return SITE_ALIASES[_0x174b97];return console[_0x60b93b(0x14f)](_0x60b93b(0x12f)+_0x174b97+'\x27,\x20defaulting\x20to\x20us01'),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5d3480,_0x4f1567){const _0xa26832=a41_0x326e,_0x126d21=_0x4f1567||getActiveProfileName();if(_0x126d21){const _0x575801=_0xa26832(0x135)+normalizeProfileForEnvVar(_0x126d21);if(process[_0xa26832(0x126)][_0x575801])return process[_0xa26832(0x126)][_0x575801];}if(process[_0xa26832(0x126)][_0xa26832(0x127)])return process[_0xa26832(0x126)][_0xa26832(0x127)];if(process['env'][_0xa26832(0x142)])return process['env']['TD_API_KEY'];const _0xdf00be=_0x5d3480[_0xa26832(0x10c)]()[_0xa26832(0x116)](/-/g,'_'),_0x2a0468=_0xa26832(0x112)+_0xdf00be;if(_0x126d21){const _0x334e13=loadProfileEnv(_0x126d21);if(_0x334e13){if(_0x334e13[_0x2a0468])return _0x334e13[_0x2a0468];if(_0x334e13[_0xa26832(0x142)])return _0x334e13[_0xa26832(0x142)];}}const _0x1a43ef=loadUserConfigOnce();if(_0x1a43ef[_0x2a0468])return _0x1a43ef[_0x2a0468];if(_0x1a43ef[_0xa26832(0x142)])return _0x1a43ef[_0xa26832(0x142)];return undefined;}export function normalizeProfileForEnvVar(_0x4ba555){const _0x59e78e=a41_0x326e;return _0x4ba555[_0x59e78e(0x10c)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x3f8ff0,_0x148c4c){const _0x5aaed4=a41_0x326e,_0x1004e2=_0x148c4c||getActiveProfileName()||undefined;if(_0x1004e2){const _0x193ff2=_0x5aaed4(0x135)+normalizeProfileForEnvVar(_0x1004e2);if(process[_0x5aaed4(0x126)][_0x193ff2])return{'apiKey':process['env'][_0x193ff2],'source':_0x193ff2+_0x5aaed4(0x11e),'isDeprecated':![]};const _0x4e416c=getCachedCredential(_0x3f8ff0,_0x1004e2);if(_0x4e416c)return{'apiKey':_0x4e416c,'source':_0x5aaed4(0x134)+_0x1004e2+')','isDeprecated':![]};const _0x5d91f5=await getKeychainAPIKey(_0x1004e2);if(_0x5d91f5)return setCachedCredential(_0x5d91f5,_0x3f8ff0,_0x1004e2),{'apiKey':_0x5d91f5,'source':'keychain\x20(profile:\x20'+_0x1004e2+')','isDeprecated':![]};}if(process[_0x5aaed4(0x126)]['TDX_API_KEY'])return{'apiKey':process[_0x5aaed4(0x126)][_0x5aaed4(0x127)],'source':_0x5aaed4(0x13a),'isDeprecated':![]};if(!_0x1004e2){const _0x505aa9=getCachedCredential(_0x3f8ff0,undefined);if(_0x505aa9)return{'apiKey':_0x505aa9,'source':_0x5aaed4(0x14a),'isDeprecated':![]};const _0x3fa551=await getKeychainAPIKey(undefined);if(_0x3fa551)return setCachedCredential(_0x3fa551,_0x3f8ff0,undefined),{'apiKey':_0x3fa551,'source':_0x5aaed4(0x14a),'isDeprecated':![]};}if(process[_0x5aaed4(0x126)][_0x5aaed4(0x142)])return{'apiKey':process[_0x5aaed4(0x126)]['TD_API_KEY'],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x35a65e=getLegacyEnvAPIKey(_0x3f8ff0,_0x1004e2);if(_0x35a65e){const _0x1b1192=await isKeychainAvailable();if(_0x1b1192)try{await saveKeychainAPIKey(_0x35a65e,_0x1004e2),setCachedCredential(_0x35a65e,_0x3f8ff0,_0x1004e2);const _0x3905d9=getConfigFilePath(_0x1004e2);cleanupLegacyEnvFile(_0x3905d9)&&console[_0x5aaed4(0x14f)](a41_0x12b6e4[_0x5aaed4(0x114)](_0x5aaed4(0x10d)));}catch(_0x531222){console[_0x5aaed4(0x14f)](a41_0x12b6e4[_0x5aaed4(0x114)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x531222));}const _0x37580d=_0x1004e2?_0x5aaed4(0x12c)+_0x1004e2+')':'legacy\x20.env\x20file';return{'apiKey':_0x35a65e,'source':_0x37580d,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x23d775,_0x49bf1d,_0x4c2062=!![]){const _0x3ffe1d=a41_0x326e,_0x2f4e59=await resolveAPIKeyAsync(_0x23d775,_0x49bf1d);if(!_0x2f4e59)return undefined;if(_0x4c2062&&_0x2f4e59[_0x3ffe1d(0x132)]&&_0x2f4e59[_0x3ffe1d(0x11c)][_0x3ffe1d(0x145)](_0x3ffe1d(0x142))){const _0x5a1a9a=_0x49bf1d||getActiveProfileName()||undefined,_0x1ef869=_0x5a1a9a?_0x3ffe1d(0x135)+normalizeProfileForEnvVar(_0x5a1a9a):_0x3ffe1d(0x139);console[_0x3ffe1d(0x14f)](a41_0x12b6e4[_0x3ffe1d(0x114)]('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x3ffe1d(0x13c)+_0x1ef869+').')));}return _0x2f4e59['apiKey'];}function getLegacyEnvAPIKey(_0x500b5a,_0x496e0a){const _0x248e00=a41_0x326e,_0x564c56=_0x500b5a['toUpperCase']()[_0x248e00(0x116)](/-/g,'_'),_0x3ce839=_0x248e00(0x112)+_0x564c56;if(_0x496e0a){const _0x5a3243=loadProfileEnv(_0x496e0a);if(_0x5a3243){if(_0x5a3243[_0x3ce839])return _0x5a3243[_0x3ce839];if(_0x5a3243['TD_API_KEY'])return _0x5a3243['TD_API_KEY'];}}const _0x4f478f=loadUserConfigOnce();if(_0x4f478f[_0x3ce839])return _0x4f478f[_0x3ce839];if(_0x4f478f[_0x248e00(0x142)])return _0x4f478f[_0x248e00(0x142)];return undefined;}function cleanupLegacyEnvFile(_0x5e02f4){const _0x36fa36=a41_0x326e;if(!existsSync(_0x5e02f4))return![];try{const _0x251229=readFileSync(_0x5e02f4,_0x36fa36(0x10e)),_0x4b611a=_0x251229[_0x36fa36(0x149)]('\x0a'),_0x4ce4be=_0x4b611a[_0x36fa36(0x141)](_0x4d8843=>{const _0x345183=_0x36fa36,_0x1e97e6=_0x4d8843[_0x345183(0x117)]();if(!_0x1e97e6||_0x1e97e6[_0x345183(0x12a)]('#'))return!![];const [_0x2f99c4]=_0x1e97e6['split']('=');return!_0x2f99c4[_0x345183(0x12a)]('TD_API_KEY');}),_0x820665=_0x4ce4be[_0x36fa36(0x111)](_0x39dc1d=>{const _0xad6604=_0x36fa36,_0x15922f=_0x39dc1d[_0xad6604(0x117)]();return _0x15922f&&!_0x15922f[_0xad6604(0x12a)]('#');});if(!_0x820665)return unlinkSync(_0x5e02f4),!![];return writeFileSync(_0x5e02f4,_0x4ce4be['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function a41_0x326e(_0x1ed9ab,_0x558672){const _0xba0034=a41_0xba00();return a41_0x326e=function(_0x326ea3,_0x221986){_0x326ea3=_0x326ea3-0x109;let _0x13a643=_0xba0034[_0x326ea3];return _0x13a643;},a41_0x326e(_0x1ed9ab,_0x558672);}function loadProfileEnv(_0xbcd298){const _0x4039c1=a41_0x326e,_0x4f0f12=a41_0xd5b29e[_0x4039c1(0x144)](getConfigDir(),_0x4039c1(0x147)+_0xbcd298);if(a41_0x2c83f0[_0x4039c1(0x113)](_0x4f0f12)){validateSecureFilePermissions(_0x4f0f12);try{const _0x3a4760=a41_0x2c83f0[_0x4039c1(0x146)](_0x4f0f12,'utf-8');return parseEnvFile(_0x3a4760);}catch(_0x5e18b3){console['warn'](_0x4039c1(0x137)+_0x4f0f12+':\x20'+_0x5e18b3);}}const _0x33c174=a41_0xd5b29e[_0x4039c1(0x144)](getConfigDir(),_0x4039c1(0x10a),_0xbcd298,_0x4039c1(0x129));if(a41_0x2c83f0[_0x4039c1(0x113)](_0x33c174)){validateSecureFilePermissions(_0x33c174);try{const _0x3f9668=a41_0x2c83f0[_0x4039c1(0x146)](_0x33c174,_0x4039c1(0x10e));return parseEnvFile(_0x3f9668);}catch(_0x3d7f21){return console['warn'](_0x4039c1(0x137)+_0x33c174+':\x20'+_0x3d7f21),null;}}return null;}function getActiveProfileName(){const _0x40668b=a41_0x326e,_0x3b7db1=a41_0xd5b29e['join'](getConfigDir(),_0x40668b(0x12e));if(!a41_0x2c83f0[_0x40668b(0x113)](_0x3b7db1))return null;try{const _0x38b7f4=a41_0x2c83f0[_0x40668b(0x146)](_0x3b7db1,_0x40668b(0x10e)),_0x2f1c00=JSON[_0x40668b(0x131)](_0x38b7f4);return _0x2f1c00[_0x40668b(0x12d)]||null;}catch{return null;}}export function saveAPIKey(_0x194ea6,_0x30d7b4,_0xa0a66c){const _0x29b0e2=a41_0x326e,_0x39e68b=getConfigDir(),_0x321fc6=getConfigFilePath(_0xa0a66c);!existsSync(_0x39e68b)&&mkdirSync(_0x39e68b,{'recursive':!![],'mode':0x1c0});let _0x12782e={};if(existsSync(_0x321fc6))try{const _0x50f0b9=readFileSync(_0x321fc6,_0x29b0e2(0x10e));_0x12782e=parseEnvFile(_0x50f0b9);}catch(_0xa6bcb4){console[_0x29b0e2(0x14f)](_0x29b0e2(0x140)+_0x321fc6+':',_0xa6bcb4);}const _0xc1cce9=_0x194ea6[_0x29b0e2(0x10c)]()[_0x29b0e2(0x116)](/-/g,'_');_0x12782e[_0x29b0e2(0x112)+_0xc1cce9]=_0x30d7b4;const _0x2e1a8e=Object[_0x29b0e2(0x148)](_0x12782e)[_0x29b0e2(0x123)](([_0x282417,_0x177e01])=>_0x282417+'='+_0x177e01);writeFileSync(_0x321fc6,_0x2e1a8e[_0x29b0e2(0x144)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x432f8e,_0x446030,_0x5ab93d){const _0x415835=a41_0x326e;await saveKeychainAPIKey(_0x432f8e,_0x5ab93d),setCachedCredential(_0x432f8e,_0x446030,_0x5ab93d);const _0x18edcc=getConfigFilePath(_0x5ab93d);cleanupLegacyEnvFile(_0x18edcc)&&console['warn'](a41_0x12b6e4['yellow'](_0x415835(0x121)));}export function loadConfig(){const _0x2a0952=a41_0x326e,_0x326178={'apiKeys':{},'defaultSite':_0x2a0952(0x10f)},_0x321e37=[_0x2a0952(0x10f),_0x2a0952(0x110),_0x2a0952(0x125),_0x2a0952(0x120),_0x2a0952(0x124),'dev-us01',_0x2a0952(0x11a),_0x2a0952(0x14c),'stg-jp01','stg-ap03'];for(const _0x4e6fda of _0x321e37){const _0x28c839=getAPIKey(_0x4e6fda);_0x28c839&&(_0x326178['apiKeys'][_0x4e6fda]=_0x28c839);}return _0x326178;}
|