@treasuredata/tdx 0.9.3 → 0.9.4
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.d.ts +52 -1
- package/dist/client/llm-api-client.d.ts.map +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/llm-api-client.js.map +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/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +15 -2
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/llm.d.ts +107 -2
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.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/journey-utils.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-config.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x525914=a39_0xeb28;(function(_0x5dcdef,_0x33a58d){const _0x53d371=a39_0xeb28,_0x5ab749=_0x5dcdef();while(!![]){try{const _0x18b533=-parseInt(_0x53d371(0xf0))/0x1+-parseInt(_0x53d371(0xbd))/0x2*(parseInt(_0x53d371(0xd2))/0x3)+parseInt(_0x53d371(0xcb))/0x4*(parseInt(_0x53d371(0xdd))/0x5)+-parseInt(_0x53d371(0xb2))/0x6+-parseInt(_0x53d371(0xe6))/0x7+-parseInt(_0x53d371(0xc6))/0x8*(parseInt(_0x53d371(0xf1))/0x9)+parseInt(_0x53d371(0xbb))/0xa*(parseInt(_0x53d371(0xf5))/0xb);if(_0x18b533===_0x33a58d)break;else _0x5ab749['push'](_0x5ab749['shift']());}catch(_0x1976d6){_0x5ab749['push'](_0x5ab749['shift']());}}}(a39_0xb89d,0x5c4cf));import{BaseCommand}from'./command.js';function a39_0xeb28(_0x26c32d,_0x3f7ec3){_0x26c32d=_0x26c32d-0xaa;const _0xb89d39=a39_0xb89d();let _0xeb2838=_0xb89d39[_0x26c32d];return _0xeb2838;}function a39_0xb89d(){const _0x1c1ff0=['✔\x20Built\x20tree\x20with\x20','1390cAaMwb','✔\x20Found\x20','71234XcePyA','test','Parent\x20segment\x20context:\x20','Resolving\x20parent\x20segment\x20\x27','Resolving\x20path\x20\x27','\x5c$&','error','jsonl','Recursive\x20mode:\x20enabled','8kijgUU','/j/da','Folder\x20ID:\x20','journeyBundleName','listJourneysFromParentSegment','3756chWTDT','localeCompare','Building\x20hierarchy\x20tree...','execute','name','listWithPattern','json','51EjqpHp','Folder/pattern\x20arg:\x20','format','\x20folder','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','resolvePathToResource','Listing\x20folders,\x20segments,\x20and\x20journeys...','Error:\x20No\x20parent\x20segment\x20context\x20set.','journey','maxDepth','235bowVXk','message','cause','sort',']\x20matching\x20\x27','replace','filter','Site:\x20','dim','5075462AcLTzl','verbose','site','\x20segment','folderId','length','listRecursive','includes','\x27...','log','638338eFkrhn','1644156zvULOK','\x20journey','listUnified','List\x20folders\x20and\x20child\x20segments','243463aXtIUv','/app/ps/','segment','map','Parent\x20ID:\x20','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20top-level\x20items','data','(empty)','folder','/e/',',\x20and\x20','3545880ZyESQU','description','Set\x20a\x20parent\x20segment\x20context\x20first:','parentId','recursive','web','all','Error:\x20'];a39_0xb89d=function(){return _0x1c1ff0;};return a39_0xb89d();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';import a39_0x17d0dc from'chalk';export class SegmentsCommand extends BaseCommand{['name']='segments';[a39_0x525914(0xb3)]=a39_0x525914(0xf4);async[a39_0x525914(0xce)](_0x38a8c6){const _0x1ec8e5=a39_0x525914,{options:_0x4d3242,args:_0x5bc594}=_0x38a8c6,_0x53f362=_0x4d3242[_0x1ec8e5(0xb6)],_0x3ea3f5=_0x5bc594[0x0];try{const _0x8f1a60=_0x4d3242['parentSegment'];_0x4d3242[_0x1ec8e5(0xe7)]&&(console[_0x1ec8e5(0xc3)](_0x1ec8e5(0xe4)+_0x4d3242[_0x1ec8e5(0xe8)]),console[_0x1ec8e5(0xc3)](_0x1ec8e5(0xbf)+(_0x8f1a60||'(not\x20set)')),_0x3ea3f5&&console[_0x1ec8e5(0xc3)](_0x1ec8e5(0xd3)+_0x3ea3f5),_0x53f362&&console['error'](_0x1ec8e5(0xc5)));if(!_0x8f1a60)return console[_0x1ec8e5(0xc3)](_0x1ec8e5(0xda)),console[_0x1ec8e5(0xc3)](''),console['error'](_0x1ec8e5(0xb4)),console['error'](_0x1ec8e5(0xd6)),console[_0x1ec8e5(0xc3)](_0x1ec8e5(0xd7)),console[_0x1ec8e5(0xc3)](''),console[_0x1ec8e5(0xc3)](_0x1ec8e5(0xab)),0x1;const _0x52310e=_0x3ea3f5&&(_0x3ea3f5[_0x1ec8e5(0xed)]('*')||_0x3ea3f5[_0x1ec8e5(0xed)]('?'));if(_0x52310e)return await this[_0x1ec8e5(0xd0)](_0x38a8c6,_0x8f1a60,_0x3ea3f5);const _0x4dbdd1=_0x3ea3f5?_0x8f1a60+'/'+_0x3ea3f5:_0x8f1a60;return _0x53f362?await this['listRecursive'](_0x38a8c6,_0x4dbdd1):await this[_0x1ec8e5(0xf3)](_0x38a8c6,_0x4dbdd1);}catch(_0x4380a5){if(_0x4380a5 instanceof SDKError)return console[_0x1ec8e5(0xc3)](_0x1ec8e5(0xb9)+_0x4380a5[_0x1ec8e5(0xde)]),_0x4380a5[_0x1ec8e5(0xdf)]&&console[_0x1ec8e5(0xc3)]('\x20\x20Cause:\x20'+_0x4380a5[_0x1ec8e5(0xdf)]),0x1;throw _0x4380a5;}}async[a39_0x525914(0xd0)](_0x696634,_0x1c9b00,_0x335fc5){const _0xc0574c=a39_0x525914,{options:_0x4dad11,tdx:_0x489443}=_0x696634,_0x1b5ffb=_0x4dad11[_0xc0574c(0xb7)],_0x47d3ad=await withSpinner(_0xc0574c(0xc0)+_0x1c9b00+_0xc0574c(0xee),()=>_0x489443[_0xc0574c(0xf7)]['resolvePathToResource'](_0x1c9b00),{'verbose':_0x4dad11[_0xc0574c(0xe7)]}),_0x24dd32=_0x47d3ad[_0xc0574c(0xad)],_0x463021=await withSpinner(_0xc0574c(0xd9),()=>Promise[_0xc0574c(0xb8)]([_0x489443[_0xc0574c(0xf7)][_0xc0574c(0xf3)](_0x24dd32[_0xc0574c(0xb5)],_0x24dd32[_0xc0574c(0xea)]),_0x489443[_0xc0574c(0xdb)]['listJourneysFromParentSegment'](_0x24dd32[_0xc0574c(0xb5)])]),{'verbose':_0x4dad11[_0xc0574c(0xe7)]}),[_0xc5f1,_0x5b679f]=_0x463021[_0xc0574c(0xad)],{folders:_0x3e04e5,segments:_0x371049}=_0xc5f1,_0x3f1581=_0x335fc5[_0xc0574c(0xe2)](/[.+^${}()|[\]\\]/g,_0xc0574c(0xc2))[_0xc0574c(0xe2)](/\*/g,'.*')[_0xc0574c(0xe2)](/\?/g,'.'),_0x1497ea=new RegExp('^'+_0x3f1581+'$','i'),_0x1fe587=_0x3e04e5[_0xc0574c(0xe3)](_0x13bb6c=>_0x1497ea['test'](_0x13bb6c[_0xc0574c(0xcf)])),_0x8f2cad=_0x371049['filter'](_0x28591f=>_0x1497ea[_0xc0574c(0xbe)](_0x28591f['name'])),_0x470558=_0x5b679f['filter'](_0x2debb7=>_0x1497ea[_0xc0574c(0xbe)](_0x2debb7[_0xc0574c(0xc9)])),_0x166598=_0x1fe587[_0xc0574c(0xeb)]+_0x8f2cad[_0xc0574c(0xeb)]+_0x470558[_0xc0574c(0xeb)];console[_0xc0574c(0xc3)](_0xc0574c(0xbc)+_0x1fe587[_0xc0574c(0xeb)]+_0xc0574c(0xd5)+(_0x1fe587[_0xc0574c(0xeb)]!==0x1?'s':'')+',\x20'+_0x8f2cad['length']+_0xc0574c(0xe9)+(_0x8f2cad[_0xc0574c(0xeb)]!==0x1?'s':'')+_0xc0574c(0xb1)+_0x470558[_0xc0574c(0xeb)]+_0xc0574c(0xf2)+(_0x470558[_0xc0574c(0xeb)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x335fc5+'\x27');const _0x4f73f8=_0x407769=>{const _0x51409f=_0xc0574c;return getConsoleNextUrl(_0x4dad11[_0x51409f(0xe8)],_0x51409f(0xf6)+_0x24dd32[_0x51409f(0xb5)]+_0x51409f(0xb0)+_0x407769);},_0x245b64=_0x4dad11[_0xc0574c(0xd4)]===_0xc0574c(0xd1)||_0x4dad11[_0xc0574c(0xd4)]===_0xc0574c(0xc4);if(_0x245b64){const _0x523fbe=[..._0x1fe587['map'](_0x123c3a=>({..._0x123c3a,'type':_0xc0574c(0xaf)})),..._0x8f2cad[_0xc0574c(0xf8)](_0x15c269=>({..._0x15c269,'type':_0xc0574c(0xf7),'url':_0x4f73f8(_0x15c269['id'])})),..._0x470558['map'](_0x43e14b=>({..._0x43e14b,'name':_0x43e14b['journeyBundleName'],'type':'journey'}))][_0xc0574c(0xe0)]((_0x5d151f,_0x182b50)=>_0x5d151f[_0xc0574c(0xcf)]['localeCompare'](_0x182b50[_0xc0574c(0xcf)]));await handleSDKOutput(_0x523fbe,_0x4dad11);}else{if(_0x166598===0x0)console[_0xc0574c(0xef)]('No\x20items\x20match\x20pattern:\x20'+_0x335fc5);else{console[_0xc0574c(0xef)](a39_0x17d0dc[_0xc0574c(0xe5)]('['+_0x1c9b00+_0xc0574c(0xe1)+_0x335fc5+'\x27'));const _0x35c9a8=formatFlatList(_0x1fe587,_0x8f2cad,{'showMetadata':!![],'showUrl':_0x1b5ffb,'getSegmentUrl':_0x4f73f8},_0x470558);console['log'](_0x35c9a8);}}return 0x0;}async[a39_0x525914(0xf3)](_0x1f33c,_0xbb90c9){const _0x119a83=a39_0x525914,{options:_0x2da65a,tdx:_0x44d812}=_0x1f33c,_0x2b7f3a=_0x2da65a[_0x119a83(0xb7)],_0x31affb=await withSpinner(_0x119a83(0xc1)+_0xbb90c9+'\x27...',()=>_0x44d812[_0x119a83(0xf7)][_0x119a83(0xd8)](_0xbb90c9),{'verbose':_0x2da65a['verbose']}),_0x50e4f5=_0x31affb[_0x119a83(0xad)];_0x2da65a[_0x119a83(0xe7)]&&(console[_0x119a83(0xc3)]('Parent\x20ID:\x20'+_0x50e4f5[_0x119a83(0xb5)]),_0x50e4f5[_0x119a83(0xea)]&&console[_0x119a83(0xc3)](_0x119a83(0xc8)+_0x50e4f5[_0x119a83(0xea)]));const _0x1ff47e=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>Promise[_0x119a83(0xb8)]([_0x44d812[_0x119a83(0xf7)]['listUnified'](_0x50e4f5[_0x119a83(0xb5)],_0x50e4f5[_0x119a83(0xea)]),_0x44d812['journey'][_0x119a83(0xca)](_0x50e4f5[_0x119a83(0xb5)])]),{'verbose':_0x2da65a[_0x119a83(0xe7)]}),[_0x19fc19,_0x30cf4a]=_0x1ff47e[_0x119a83(0xad)],{folders:_0x56f292,segments:_0x2c76a6}=_0x19fc19,_0x4c3fdb=_0x56f292['length']+_0x2c76a6[_0x119a83(0xeb)]+_0x30cf4a[_0x119a83(0xeb)];console[_0x119a83(0xc3)]('✔\x20Found\x20'+_0x56f292[_0x119a83(0xeb)]+_0x119a83(0xd5)+(_0x56f292[_0x119a83(0xeb)]!==0x1?'s':'')+',\x20'+_0x2c76a6['length']+'\x20segment'+(_0x2c76a6['length']!==0x1?'s':'')+_0x119a83(0xb1)+_0x30cf4a['length']+'\x20journey'+(_0x30cf4a['length']!==0x1?'s':''));const _0x27bb4e=_0x5108c6=>{const _0x285e65=_0x119a83;return getConsoleNextUrl(_0x2da65a[_0x285e65(0xe8)],_0x285e65(0xf6)+_0x50e4f5[_0x285e65(0xb5)]+_0x285e65(0xb0)+_0x5108c6);},_0x2af4fa=_0x197437=>{const _0x4aedff=_0x119a83;return getConsoleNextUrl(_0x2da65a[_0x4aedff(0xe8)],_0x4aedff(0xf6)+_0x50e4f5['parentId']+_0x4aedff(0xb0)+_0x197437+_0x4aedff(0xc7));},_0x138e39=_0x2da65a[_0x119a83(0xd4)]==='json'||_0x2da65a['format']===_0x119a83(0xc4);if(_0x138e39){const _0x52c257=[..._0x56f292[_0x119a83(0xf8)](_0x204ed3=>({..._0x204ed3,'type':_0x119a83(0xaf)})),..._0x2c76a6[_0x119a83(0xf8)](_0x51e2b9=>({..._0x51e2b9,'type':_0x119a83(0xf7),'url':_0x27bb4e(_0x51e2b9['id'])})),..._0x30cf4a[_0x119a83(0xf8)](_0x4c0a40=>({..._0x4c0a40,'name':_0x4c0a40[_0x119a83(0xc9)],'type':_0x119a83(0xdb),'url':_0x2af4fa(_0x4c0a40['id'])}))][_0x119a83(0xe0)]((_0xba592c,_0x4a6c5a)=>_0xba592c[_0x119a83(0xcf)][_0x119a83(0xcc)](_0x4a6c5a[_0x119a83(0xcf)]));await handleSDKOutput(_0x52c257,_0x2da65a);}else{if(_0x4c3fdb===0x0)console[_0x119a83(0xef)](a39_0x17d0dc[_0x119a83(0xe5)]('['+_0xbb90c9+']')),console[_0x119a83(0xef)](_0x119a83(0xae));else{console['log'](a39_0x17d0dc['dim']('['+_0xbb90c9+']'));const _0x481ab4=formatFlatList(_0x56f292,_0x2c76a6,{'showMetadata':!![],'showUrl':_0x2b7f3a,'getSegmentUrl':_0x27bb4e,'getJourneyUrl':_0x2af4fa},_0x30cf4a);console[_0x119a83(0xef)](_0x481ab4);}}return 0x0;}async[a39_0x525914(0xec)](_0x109191,_0x1b04f5){const _0x55ac35=a39_0x525914,{options:_0x459440,tdx:_0x24cd93}=_0x109191,_0x2e94cc=_0x459440[_0x55ac35(0xb7)],_0x174423=await withSpinner(_0x55ac35(0xc1)+_0x1b04f5+_0x55ac35(0xee),()=>_0x24cd93[_0x55ac35(0xf7)][_0x55ac35(0xd8)](_0x1b04f5),{'verbose':_0x459440[_0x55ac35(0xe7)]}),_0x50c678=_0x174423[_0x55ac35(0xad)];_0x459440[_0x55ac35(0xe7)]&&(console[_0x55ac35(0xc3)](_0x55ac35(0xaa)+_0x50c678[_0x55ac35(0xb5)]),_0x50c678['folderId']&&console[_0x55ac35(0xc3)](_0x55ac35(0xc8)+_0x50c678[_0x55ac35(0xea)]));const _0x4abc82=_0x459440[_0x55ac35(0xdc)]||0xa,_0x10ccee=await withSpinner(_0x55ac35(0xcd),()=>_0x24cd93[_0x55ac35(0xf7)][_0x55ac35(0xec)](_0x50c678['parentId'],_0x50c678['folderId'],0x0,_0x4abc82),{'verbose':_0x459440['verbose']}),_0x1a8b3c=_0x10ccee['data'];console[_0x55ac35(0xc3)](_0x55ac35(0xba)+_0x1a8b3c[_0x55ac35(0xeb)]+_0x55ac35(0xac));const _0x4d3102=_0x13cea8=>{const _0x3d9c6c=_0x55ac35;return getConsoleNextUrl(_0x459440[_0x3d9c6c(0xe8)],_0x3d9c6c(0xf6)+_0x50c678['parentId']+_0x3d9c6c(0xb0)+_0x13cea8);};if(_0x459440[_0x55ac35(0xd4)]===_0x55ac35(0xd1)||_0x459440[_0x55ac35(0xd4)]===_0x55ac35(0xc4))await handleSDKOutput(_0x1a8b3c,_0x459440);else{console[_0x55ac35(0xef)](a39_0x17d0dc[_0x55ac35(0xe5)]('['+_0x1b04f5+']'));const _0x573f5b=formatTree(_0x1a8b3c,{'showMetadata':!![],'showUrl':_0x2e94cc,'getSegmentUrl':_0x4d3102});console[_0x55ac35(0xef)](_0x573f5b);}return 0x0;}}
|
|
1
|
+
const a39_0x321f27=a39_0x4e60;(function(_0x4ad82d,_0x4139bb){const _0x403b52=a39_0x4e60,_0x25999f=_0x4ad82d();while(!![]){try{const _0x50a567=parseInt(_0x403b52(0x191))/0x1*(-parseInt(_0x403b52(0x1a8))/0x2)+parseInt(_0x403b52(0x1b6))/0x3*(parseInt(_0x403b52(0x1b9))/0x4)+-parseInt(_0x403b52(0x1ab))/0x5*(parseInt(_0x403b52(0x184))/0x6)+-parseInt(_0x403b52(0x18d))/0x7*(parseInt(_0x403b52(0x197))/0x8)+parseInt(_0x403b52(0x194))/0x9+-parseInt(_0x403b52(0x19d))/0xa+-parseInt(_0x403b52(0x1c1))/0xb*(-parseInt(_0x403b52(0x1af))/0xc);if(_0x50a567===_0x4139bb)break;else _0x25999f['push'](_0x25999f['shift']());}catch(_0x46eead){_0x25999f['push'](_0x25999f['shift']());}}}(a39_0x3356,0xc6655));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';import a39_0x2a8f7d from'chalk';export class SegmentsCommand extends BaseCommand{[a39_0x321f27(0x186)]=a39_0x321f27(0x1b5);[a39_0x321f27(0x190)]='List\x20folders\x20and\x20child\x20segments';async[a39_0x321f27(0x18a)](_0x40284f){const _0x466130=a39_0x321f27,{options:_0x2876d0,args:_0x3197e1}=_0x40284f,_0x2909af=_0x2876d0[_0x466130(0x185)],_0x3680c5=_0x3197e1[0x0];try{const _0x3a790a=_0x2876d0[_0x466130(0x1bb)];_0x2876d0['verbose']&&(console['error']('Site:\x20'+_0x2876d0[_0x466130(0x1aa)]),console[_0x466130(0x1a6)](_0x466130(0x1d0)+(_0x3a790a||_0x466130(0x193))),_0x3680c5&&console[_0x466130(0x1a6)]('Folder/pattern\x20arg:\x20'+_0x3680c5),_0x2909af&&console[_0x466130(0x1a6)]('Recursive\x20mode:\x20enabled'));if(!_0x3a790a)return console[_0x466130(0x1a6)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x466130(0x1a6)](_0x466130(0x1ca)),console['error'](_0x466130(0x1c0)),console[_0x466130(0x1a6)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x466130(0x1a6)](''),console[_0x466130(0x1a6)](_0x466130(0x1c3)),0x1;const _0x333155=_0x3680c5&&(_0x3680c5[_0x466130(0x1c4)]('*')||_0x3680c5[_0x466130(0x1c4)]('?'));if(_0x333155)return await this['listWithPattern'](_0x40284f,_0x3a790a,_0x3680c5);const _0x4dee2d=_0x3680c5?_0x3a790a+'/'+_0x3680c5:_0x3a790a;return _0x2909af?await this['listRecursive'](_0x40284f,_0x4dee2d):await this[_0x466130(0x19e)](_0x40284f,_0x4dee2d);}catch(_0x28736c){if(_0x28736c instanceof SDKError)return console[_0x466130(0x1a6)](_0x466130(0x1a4)+_0x28736c[_0x466130(0x1bf)]),_0x28736c[_0x466130(0x187)]&&console['error'](_0x466130(0x18c)+_0x28736c['cause']),0x1;throw _0x28736c;}}async[a39_0x321f27(0x198)](_0x2eea2b,_0x2051e7,_0x1d1b34){const _0x5f3b7f=a39_0x321f27,{options:_0x1d8030,tdx:_0x5d652d}=_0x2eea2b,_0x66a210=_0x1d8030[_0x5f3b7f(0x1a1)],_0xb01c4d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2051e7+_0x5f3b7f(0x18b),()=>_0x5d652d['segment'][_0x5f3b7f(0x19c)](_0x2051e7),{'verbose':_0x1d8030[_0x5f3b7f(0x1ac)]}),_0xb3a29e=_0xb01c4d[_0x5f3b7f(0x19a)],_0x2a96ca=await withSpinner(_0x5f3b7f(0x1a7),()=>Promise['all']([_0x5d652d['segment'][_0x5f3b7f(0x19e)](_0xb3a29e[_0x5f3b7f(0x1c5)],_0xb3a29e[_0x5f3b7f(0x199)]),_0x5d652d[_0x5f3b7f(0x1c2)]['listJourneysFromParentSegment'](_0xb3a29e['parentId'])]),{'verbose':_0x1d8030[_0x5f3b7f(0x1ac)]}),[_0x3adc64,_0x5baec1]=_0x2a96ca[_0x5f3b7f(0x19a)],{folders:_0x45c611,segments:_0x185d14}=_0x3adc64,_0x2ea749=_0x1d1b34[_0x5f3b7f(0x1b3)](/[.+^${}()|[\]\\]/g,_0x5f3b7f(0x18f))[_0x5f3b7f(0x1b3)](/\*/g,'.*')[_0x5f3b7f(0x1b3)](/\?/g,'.'),_0x410b53=new RegExp('^'+_0x2ea749+'$','i'),_0x4a863c=_0x45c611[_0x5f3b7f(0x1cd)](_0x12de49=>_0x410b53[_0x5f3b7f(0x19b)](_0x12de49[_0x5f3b7f(0x186)])),_0x5bce9f=_0x185d14[_0x5f3b7f(0x1cd)](_0x23f9b0=>_0x410b53[_0x5f3b7f(0x19b)](_0x23f9b0[_0x5f3b7f(0x186)])),_0x23f16d=_0x5baec1['filter'](_0x33a9ee=>_0x410b53[_0x5f3b7f(0x19b)](_0x33a9ee[_0x5f3b7f(0x1a3)])),_0xf1ff96=_0x4a863c[_0x5f3b7f(0x1cc)]+_0x5bce9f[_0x5f3b7f(0x1cc)]+_0x23f16d['length'];console['error'](_0x5f3b7f(0x1c6)+_0x4a863c[_0x5f3b7f(0x1cc)]+_0x5f3b7f(0x189)+(_0x4a863c[_0x5f3b7f(0x1cc)]!==0x1?'s':'')+',\x20'+_0x5bce9f[_0x5f3b7f(0x1cc)]+_0x5f3b7f(0x1b2)+(_0x5bce9f[_0x5f3b7f(0x1cc)]!==0x1?'s':'')+_0x5f3b7f(0x18e)+_0x23f16d[_0x5f3b7f(0x1cc)]+_0x5f3b7f(0x1ae)+(_0x23f16d[_0x5f3b7f(0x1cc)]!==0x1?'s':'')+_0x5f3b7f(0x1c7)+_0x1d1b34+'\x27');const _0x267d2d=_0x5c76f6=>{const _0x1c216f=_0x5f3b7f;return getConsoleNextUrl(_0x1d8030['site'],'/app/ps/'+_0xb3a29e[_0x1c216f(0x1c5)]+_0x1c216f(0x1a2)+_0x5c76f6);},_0x2e5b0f=_0x1d8030[_0x5f3b7f(0x1ce)]===_0x5f3b7f(0x195)||_0x1d8030['format']==='jsonl';if(_0x2e5b0f){const _0x3e20fd=[..._0x4a863c[_0x5f3b7f(0x192)](_0x5916a7=>({..._0x5916a7,'type':_0x5f3b7f(0x1b4)})),..._0x5bce9f[_0x5f3b7f(0x192)](_0x3430bb=>({..._0x3430bb,'type':_0x5f3b7f(0x1a9),'url':_0x267d2d(_0x3430bb['id'])})),..._0x23f16d['map'](_0x5f1a82=>({..._0x5f1a82,'name':_0x5f1a82[_0x5f3b7f(0x1a3)],'type':_0x5f3b7f(0x1c2)}))]['sort']((_0x2442f0,_0x165ee3)=>_0x2442f0[_0x5f3b7f(0x186)][_0x5f3b7f(0x1bd)](_0x165ee3[_0x5f3b7f(0x186)]));await handleSDKOutput(_0x3e20fd,_0x1d8030);}else{if(_0xf1ff96===0x0)console[_0x5f3b7f(0x1b8)](_0x5f3b7f(0x19f)+_0x1d1b34);else{console[_0x5f3b7f(0x1b8)](a39_0x2a8f7d[_0x5f3b7f(0x1b0)]('['+_0x2051e7+_0x5f3b7f(0x1a0)+_0x1d1b34+'\x27'));const _0x461fc0=formatFlatList(_0x4a863c,_0x5bce9f,{'showMetadata':!![],'showUrl':_0x66a210,'getSegmentUrl':_0x267d2d},_0x23f16d);console[_0x5f3b7f(0x1b8)](_0x461fc0);}}return 0x0;}async[a39_0x321f27(0x19e)](_0x167261,_0x19b4da){const _0x3cf0ca=a39_0x321f27,{options:_0x2b39a8,tdx:_0x3f8b63}=_0x167261,_0x5e059a=_0x2b39a8[_0x3cf0ca(0x1a1)],_0x10f33a=await withSpinner('Resolving\x20path\x20\x27'+_0x19b4da+_0x3cf0ca(0x18b),()=>_0x3f8b63[_0x3cf0ca(0x1a9)][_0x3cf0ca(0x19c)](_0x19b4da),{'verbose':_0x2b39a8[_0x3cf0ca(0x1ac)]}),_0x3cee1d=_0x10f33a[_0x3cf0ca(0x19a)];_0x2b39a8[_0x3cf0ca(0x1ac)]&&(console[_0x3cf0ca(0x1a6)](_0x3cf0ca(0x1ba)+_0x3cee1d['parentId']),_0x3cee1d[_0x3cf0ca(0x199)]&&console[_0x3cf0ca(0x1a6)](_0x3cf0ca(0x1ad)+_0x3cee1d[_0x3cf0ca(0x199)]));const _0x38d56d=await withSpinner(_0x3cf0ca(0x1a7),()=>Promise[_0x3cf0ca(0x1cf)]([_0x3f8b63[_0x3cf0ca(0x1a9)][_0x3cf0ca(0x19e)](_0x3cee1d[_0x3cf0ca(0x1c5)],_0x3cee1d[_0x3cf0ca(0x199)]),_0x3f8b63['journey'][_0x3cf0ca(0x1c8)](_0x3cee1d['parentId'])]),{'verbose':_0x2b39a8['verbose']}),[_0x3d3d20,_0x2b8b9b]=_0x38d56d[_0x3cf0ca(0x19a)],{folders:_0x12447d,segments:_0xdffc86}=_0x3d3d20,_0x49fd5e=_0x12447d[_0x3cf0ca(0x1cc)]+_0xdffc86['length']+_0x2b8b9b['length'];console[_0x3cf0ca(0x1a6)]('✔\x20Found\x20'+_0x12447d[_0x3cf0ca(0x1cc)]+'\x20folder'+(_0x12447d['length']!==0x1?'s':'')+',\x20'+_0xdffc86[_0x3cf0ca(0x1cc)]+_0x3cf0ca(0x1b2)+(_0xdffc86[_0x3cf0ca(0x1cc)]!==0x1?'s':'')+',\x20and\x20'+_0x2b8b9b[_0x3cf0ca(0x1cc)]+_0x3cf0ca(0x1ae)+(_0x2b8b9b[_0x3cf0ca(0x1cc)]!==0x1?'s':''));const _0x2f4d6a=_0xa99e7a=>{const _0x5b0bf6=_0x3cf0ca;return getConsoleNextUrl(_0x2b39a8['site'],'/app/ps/'+_0x3cee1d[_0x5b0bf6(0x1c5)]+_0x5b0bf6(0x1a2)+_0xa99e7a);},_0x20ffaf=_0x594376=>{const _0x39cbbf=_0x3cf0ca;return getConsoleNextUrl(_0x2b39a8[_0x39cbbf(0x1aa)],_0x39cbbf(0x1c9)+_0x3cee1d[_0x39cbbf(0x1c5)]+_0x39cbbf(0x1a2)+_0x594376+_0x39cbbf(0x1bc));},_0x3829bd=_0x2b39a8[_0x3cf0ca(0x1ce)]===_0x3cf0ca(0x195)||_0x2b39a8['format']===_0x3cf0ca(0x1be);if(_0x3829bd){const _0x4bdfbf=[..._0x12447d[_0x3cf0ca(0x192)](_0x3c5375=>({..._0x3c5375,'type':_0x3cf0ca(0x1b4)})),..._0xdffc86[_0x3cf0ca(0x192)](_0x4766f3=>({..._0x4766f3,'type':_0x3cf0ca(0x1a9),'url':_0x2f4d6a(_0x4766f3['id'])})),..._0x2b8b9b[_0x3cf0ca(0x192)](_0x115353=>({..._0x115353,'name':_0x115353[_0x3cf0ca(0x1a3)],'type':'journey','url':_0x20ffaf(_0x115353['id'])}))]['sort']((_0xb1bbb6,_0x2106a7)=>_0xb1bbb6[_0x3cf0ca(0x186)][_0x3cf0ca(0x1bd)](_0x2106a7[_0x3cf0ca(0x186)]));await handleSDKOutput(_0x4bdfbf,_0x2b39a8);}else{if(_0x49fd5e===0x0)console['log'](a39_0x2a8f7d[_0x3cf0ca(0x1b0)]('['+_0x19b4da+']')),console[_0x3cf0ca(0x1b8)](_0x3cf0ca(0x1a5));else{console[_0x3cf0ca(0x1b8)](a39_0x2a8f7d[_0x3cf0ca(0x1b0)]('['+_0x19b4da+']'));const _0x1ef6e6=formatFlatList(_0x12447d,_0xdffc86,{'showMetadata':!![],'showUrl':_0x5e059a,'getSegmentUrl':_0x2f4d6a,'getJourneyUrl':_0x20ffaf},_0x2b8b9b);console[_0x3cf0ca(0x1b8)](_0x1ef6e6);}}return 0x0;}async[a39_0x321f27(0x1b1)](_0x525fd8,_0x307150){const _0x5cc53b=a39_0x321f27,{options:_0x3f1425,tdx:_0x5ab550}=_0x525fd8,_0xdb632d=_0x3f1425[_0x5cc53b(0x1a1)],_0x5c0fdf=await withSpinner(_0x5cc53b(0x196)+_0x307150+_0x5cc53b(0x18b),()=>_0x5ab550[_0x5cc53b(0x1a9)][_0x5cc53b(0x19c)](_0x307150),{'verbose':_0x3f1425[_0x5cc53b(0x1ac)]}),_0x34d8be=_0x5c0fdf[_0x5cc53b(0x19a)];_0x3f1425['verbose']&&(console[_0x5cc53b(0x1a6)](_0x5cc53b(0x1ba)+_0x34d8be[_0x5cc53b(0x1c5)]),_0x34d8be['folderId']&&console['error']('Folder\x20ID:\x20'+_0x34d8be[_0x5cc53b(0x199)]));const _0x341ded=_0x3f1425[_0x5cc53b(0x1cb)]||0xa,_0x196931=await withSpinner(_0x5cc53b(0x1b7),()=>_0x5ab550[_0x5cc53b(0x1a9)][_0x5cc53b(0x1b1)](_0x34d8be[_0x5cc53b(0x1c5)],_0x34d8be[_0x5cc53b(0x199)],0x0,_0x341ded),{'verbose':_0x3f1425[_0x5cc53b(0x1ac)]}),_0x1e732d=_0x196931['data'];console[_0x5cc53b(0x1a6)]('✔\x20Built\x20tree\x20with\x20'+_0x1e732d[_0x5cc53b(0x1cc)]+_0x5cc53b(0x188));const _0x5d28fd=_0x2d7915=>{const _0x1784b3=_0x5cc53b;return getConsoleNextUrl(_0x3f1425[_0x1784b3(0x1aa)],'/app/ps/'+_0x34d8be[_0x1784b3(0x1c5)]+_0x1784b3(0x1a2)+_0x2d7915);};if(_0x3f1425[_0x5cc53b(0x1ce)]===_0x5cc53b(0x195)||_0x3f1425[_0x5cc53b(0x1ce)]===_0x5cc53b(0x1be))await handleSDKOutput(_0x1e732d,_0x3f1425);else{console[_0x5cc53b(0x1b8)](a39_0x2a8f7d['dim']('['+_0x307150+']'));const _0x1e759e=formatTree(_0x1e732d,{'showMetadata':!![],'showUrl':_0xdb632d,'getSegmentUrl':_0x5d28fd});console[_0x5cc53b(0x1b8)](_0x1e759e);}return 0x0;}}function a39_0x4e60(_0x1228ef,_0x5065e5){_0x1228ef=_0x1228ef-0x184;const _0x3356d9=a39_0x3356();let _0x4e602f=_0x3356d9[_0x1228ef];return _0x4e602f;}function a39_0x3356(){const _0x3a9087=['test','resolvePathToResource','7365670nNFPut','listUnified','No\x20items\x20match\x20pattern:\x20',']\x20matching\x20\x27','web','/e/','journeyBundleName','Error:\x20','(empty)','error','Listing\x20folders,\x20segments,\x20and\x20journeys...','62XOGUpf','segment','site','7521225YYEIih','verbose','Folder\x20ID:\x20','\x20journey','96mKnCoI','dim','listRecursive','\x20segment','replace','folder','segments','3017643fCyskH','Building\x20hierarchy\x20tree...','log','4FGyKop','Parent\x20ID:\x20','parentSegment','/j/da','localeCompare','jsonl','message','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','5548708LHNNPR','journey','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','includes','parentId','✔\x20Found\x20','\x20matching\x20\x27','listJourneysFromParentSegment','/app/ps/','Set\x20a\x20parent\x20segment\x20context\x20first:','maxDepth','length','filter','format','all','Parent\x20segment\x20context:\x20','6mfDdsA','recursive','name','cause','\x20top-level\x20items','\x20folder','execute','\x27...','\x20\x20Cause:\x20','227521WTeQQY',',\x20and\x20','\x5c$&','description','31012UCrTXe','map','(not\x20set)','1585071hHoaKI','json','Resolving\x20path\x20\x27','296rLhdpb','listWithPattern','folderId','data'];a39_0x3356=function(){return _0x3a9087;};return a39_0x3356();}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a40_0x48d2(){const _0x3e81ec=['Querying\x20','validate','1448222UhAXIo','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Usage:\x20tdx\x20show\x20<database.table>','1253200AysDPH','Catalog:\x20','data','verbose','\x20\x20Cause:\x20','query','database','args','5503663FlVuLg','\x20row','3636orKtQp','Error:\x20','9twMTfM','Show\x20table\x20contents','295295svsjkn','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','catalog','3hEanpi','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','length','5299FJWyVU','Limit:\x20','message','show','1643408FKoRsT','10lcZwEw','site','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','error','description','showTable','table','limit','49202ueaAAd','Table:\x20'];a40_0x48d2=function(){return _0x3e81ec;};return a40_0x48d2();}const a40_0x263c80=a40_0x34d0;(function(_0x2b1967,_0x398328){const _0x2e4cb9=a40_0x34d0,_0x41d527=_0x2b1967();while(!![]){try{const _0x5879df=-parseInt(_0x2e4cb9(0xbe))/0x1+-parseInt(_0x2e4cb9(0xc2))/0x2*(parseInt(_0x2e4cb9(0xae))/0x3)+parseInt(_0x2e4cb9(0xc5))/0x4+-parseInt(_0x2e4cb9(0xab))/0x5+parseInt(_0x2e4cb9(0xcf))/0x6*(parseInt(_0x2e4cb9(0xb1))/0x7)+parseInt(_0x2e4cb9(0xb5))/0x8*(parseInt(_0x2e4cb9(0xd1))/0x9)+parseInt(_0x2e4cb9(0xb6))/0xa*(parseInt(_0x2e4cb9(0xcd))/0xb);if(_0x5879df===_0x398328)break;else _0x41d527['push'](_0x41d527['shift']());}catch(_0x37c722){_0x41d527['push'](_0x41d527['shift']());}}}(a40_0x48d2,0x9d935));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';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';function a40_0x34d0(_0x44c792,_0x2526b8){_0x44c792=_0x44c792-0xaa;const _0x48d2bf=a40_0x48d2();let _0x34d01d=_0x48d2bf[_0x44c792];return _0x34d01d;}export class ShowCommand extends BaseCommand{['name']=a40_0x263c80(0xb4);[a40_0x263c80(0xba)]=a40_0x263c80(0xaa);async['execute'](_0x33c000){return this['showTable'](_0x33c000);}async['showTable'](_0x2d1ec3){const _0x49b068=a40_0x263c80,{options:_0x4da7a8,args:_0x47e78a,tdx:_0x4c56d3}=_0x2d1ec3;let _0x148a6f;try{_0x148a6f=parseTableReference(_0x47e78a[0x0]);const _0x395872=_0x4da7a8[_0x49b068(0xcb)];!_0x148a6f[_0x49b068(0xcb)]&&_0x395872&&(_0x148a6f[_0x49b068(0xcb)]=_0x395872);const _0x913f8e=validateTableDescribeReference(_0x148a6f);if(_0x913f8e)return console['error'](_0x49b068(0xd0)+_0x913f8e),console[_0x49b068(0xb9)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x49b068(0xb9)](_0x49b068(0xc3)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x18d732){return console[_0x49b068(0xb9)]('Error:\x20'+_0x18d732[_0x49b068(0xb3)]),console[_0x49b068(0xb9)](_0x49b068(0xc4)),console[_0x49b068(0xb9)](_0x49b068(0xc3)),console['error'](_0x49b068(0xaf)),0x1;}const _0x1a0e7d=_0x148a6f[_0x49b068(0xad)],_0x2369b6=_0x148a6f[_0x49b068(0xcb)],_0x5518a2=_0x148a6f[_0x49b068(0xbc)],_0x2db3e7=resolveLimit(_0x4da7a8[_0x49b068(0xbd)],DEFAULT_DISPLAY_LIMIT);try{_0x4da7a8[_0x49b068(0xc8)]&&(console[_0x49b068(0xb9)]('Site:\x20'+_0x4da7a8[_0x49b068(0xb7)]),_0x1a0e7d&&console['error'](_0x49b068(0xc6)+_0x1a0e7d),console[_0x49b068(0xb9)]('Database:\x20'+_0x2369b6),console[_0x49b068(0xb9)](_0x49b068(0xbf)+_0x5518a2),console[_0x49b068(0xb9)](_0x49b068(0xb2)+_0x2db3e7));const _0x4d9784=_0x1a0e7d?_0x1a0e7d+'.'+_0x2369b6+'.'+_0x5518a2:_0x2369b6+'.'+_0x5518a2,_0x46818d=await withSpinner(_0x49b068(0xc0)+_0x4d9784+'...',()=>_0x4c56d3[_0x49b068(0xca)][_0x49b068(0xbb)](_0x2369b6,_0x5518a2,_0x2db3e7,_0x1a0e7d),{'verbose':_0x4da7a8[_0x49b068(0xc8)]}),_0x4083d1=_0x46818d['data'],_0x579eb8=_0x4083d1[_0x49b068(0xc7)];return _0x579eb8['length']===0x0?console[_0x49b068(0xb9)](_0x49b068(0xac)):console[_0x49b068(0xb9)]('✔\x20Retrieved\x20'+_0x579eb8['length']+_0x49b068(0xce)+(_0x579eb8[_0x49b068(0xb0)]!==0x1?'s':'')+'\x20from\x20'+_0x4d9784),await handleSDKOutput(_0x579eb8,_0x4da7a8),0x0;}catch(_0x329de7){if(_0x329de7 instanceof SDKError)return console[_0x49b068(0xb9)](_0x49b068(0xd0)+_0x329de7[_0x49b068(0xb3)]),_0x329de7['cause']&&console[_0x49b068(0xb9)](_0x49b068(0xc9)+_0x329de7['cause']),0x1;throw _0x329de7;}}[a40_0x263c80(0xc1)](_0x1f4a57){const _0x1b1295=a40_0x263c80;if(_0x1f4a57[_0x1b1295(0xcc)][_0x1b1295(0xb0)]===0x0)return _0x1b1295(0xb8);if(_0x1f4a57['args'][_0x1b1295(0xb0)]>0x1)return'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';return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0xf94197=a41_0x2260;(function(_0x5ace00,_0x5b90fb){const _0x5b4fb2=a41_0x2260,_0x3be42f=_0x5ace00();while(!![]){try{const _0xecbadf=-parseInt(_0x5b4fb2(0x205))/0x1+-parseInt(_0x5b4fb2(0x1eb))/0x2+parseInt(_0x5b4fb2(0x206))/0x3+parseInt(_0x5b4fb2(0x1f3))/0x4*(parseInt(_0x5b4fb2(0x1f2))/0x5)+parseInt(_0x5b4fb2(0x20c))/0x6+parseInt(_0x5b4fb2(0x209))/0x7*(-parseInt(_0x5b4fb2(0x1e8))/0x8)+parseInt(_0x5b4fb2(0x20f))/0x9;if(_0xecbadf===_0x5b90fb)break;else _0x3be42f['push'](_0x3be42f['shift']());}catch(_0x306900){_0x3be42f['push'](_0x3be42f['shift']());}}}(a41_0x4dc0,0x44b9f));import{BaseCommand}from'./command.js';function a41_0x2260(_0x2719e4,_0x4aec02){_0x2719e4=_0x2719e4-0x1e2;const _0x4dc0f1=a41_0x4dc0();let _0x2260e8=_0x4dc0f1[_0x2719e4];return _0x2260e8;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';function a41_0x4dc0(){const _0x2c5104=['869972JCPKIW','database','name','Or\x20use\x20--in\x20flag:','\x20table','validate','.*\x22','error','length','Note:\x20\x27','\x27\x20across\x20all\x20databases.','limit','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','verbose','table','includes','data','Error:\x20','404620CdQJEr','1095402iMVcVy','Database\x20\x27','Site:\x20','7zAfLWh','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','listTables','2287374yUjqOz','cause','\x20\x20Cause:\x20','220365WoKcgE','Database:\x20all','\x20\x20Use:\x20tdx\x20tables\x20\x22','List\x20tables\x20in\x20a\x20database','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database:\x20','tables','\x27\x20is\x20ambiguous.','1514984JMUyGS','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Error:\x20Pattern\x20\x27','225690QYBsjW','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','message','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','✔\x20Found\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','5ZQYRqv'];a41_0x4dc0=function(){return _0x2c5104;};return a41_0x4dc0();}export class TablesCommand extends BaseCommand{[a41_0xf94197(0x1f5)]=a41_0xf94197(0x1e6);['description']=a41_0xf94197(0x1e3);async['execute'](_0x1da3cf){const _0x357d5c=a41_0xf94197,{options:_0x241bc7,args:_0x46c224,tdx:_0x2b5d80}=_0x1da3cf;let _0x352efb;if(_0x46c224[_0x357d5c(0x1fb)]===0x0)_0x352efb={'database':undefined,'table':undefined,'original':''};else{if(_0x46c224[_0x357d5c(0x1fb)]===0x1)try{_0x352efb=parseTableReference(_0x46c224[0x0]);if(_0x352efb[_0x357d5c(0x201)]&&!_0x352efb['database']&&!_0x352efb['table'][_0x357d5c(0x202)]('*')&&!_0x352efb[_0x357d5c(0x201)]['includes']('?'))return console['error'](_0x357d5c(0x1ea)+_0x46c224[0x0]+_0x357d5c(0x1e7)),console[_0x357d5c(0x1fa)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x352efb[_0x357d5c(0x201)]+'\x27?'),console[_0x357d5c(0x1fa)](_0x357d5c(0x1e2)+_0x352efb[_0x357d5c(0x201)]+_0x357d5c(0x1f9)),console[_0x357d5c(0x1fa)](_0x357d5c(0x1ed)+_0x352efb[_0x357d5c(0x201)]),console[_0x357d5c(0x1fa)](_0x357d5c(0x1f1)+_0x352efb[_0x357d5c(0x201)]),console[_0x357d5c(0x1fa)](''),console[_0x357d5c(0x1fa)](_0x357d5c(0x1fc)+_0x46c224[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x352efb[_0x357d5c(0x201)]+_0x357d5c(0x1fd)),0x1;}catch(_0x52e347){return console['error'](_0x357d5c(0x204)+_0x52e347[_0x357d5c(0x1ee)]),0x1;}else return console['error'](_0x357d5c(0x1ef)),console['error'](_0x357d5c(0x1e4)),console[_0x357d5c(0x1fa)](_0x357d5c(0x20a)),console[_0x357d5c(0x1fa)](_0x357d5c(0x1ec)),console[_0x357d5c(0x1fa)](_0x357d5c(0x1ff)),console['error'](_0x357d5c(0x1f6)),console['error']('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x5b2ac3=_0x241bc7[_0x357d5c(0x1f4)];!_0x352efb[_0x357d5c(0x1f4)]&&_0x5b2ac3&&(_0x352efb[_0x357d5c(0x1f4)]=_0x5b2ac3);try{const _0x4d14f8=_0x4eaf2b=>_0x4eaf2b&&(_0x4eaf2b[_0x357d5c(0x202)]('*')||_0x4eaf2b[_0x357d5c(0x202)]('?')),_0xb71f9b=_0x4d14f8(_0x352efb['database']);_0x241bc7[_0x357d5c(0x200)]&&(console[_0x357d5c(0x1fa)](_0x357d5c(0x208)+_0x241bc7['site']),_0x352efb['database']?_0xb71f9b?console['error']('Database\x20pattern:\x20'+_0x352efb['database']):console[_0x357d5c(0x1fa)](_0x357d5c(0x1e5)+_0x352efb['database']):console['error'](_0x357d5c(0x210)),_0x352efb[_0x357d5c(0x201)]&&console[_0x357d5c(0x1fa)]('Table\x20pattern:\x20'+_0x352efb[_0x357d5c(0x201)]));const _0x399795=_0x352efb[_0x357d5c(0x1f4)]&&!_0xb71f9b?_0x352efb[_0x357d5c(0x1f4)]:undefined,_0x375861=_0xb71f9b?_0x352efb['database']:undefined,_0x1bd38e=_0x352efb[_0x357d5c(0x201)],_0x81e1d9=resolveLimit(_0x241bc7[_0x357d5c(0x1fe)],DEFAULT_LISTING_LIMIT),_0x270bc5=await withSpinner('Listing\x20tables...',()=>_0x2b5d80['query'][_0x357d5c(0x20b)](_0x399795,_0x1bd38e,_0x375861,_0x81e1d9),{'verbose':_0x241bc7[_0x357d5c(0x200)]}),_0xf0953b=_0x270bc5[_0x357d5c(0x203)];if(_0xf0953b['length']===0x0&&_0x352efb[_0x357d5c(0x1f4)]&&!_0xb71f9b)return console[_0x357d5c(0x1fa)]('✖\x20No\x20tables\x20found'),console[_0x357d5c(0x1fa)](_0x357d5c(0x207)+_0x352efb[_0x357d5c(0x1f4)]+_0x357d5c(0x1e9)),0x1;return console[_0x357d5c(0x1fa)](_0x357d5c(0x1f0)+_0xf0953b[_0x357d5c(0x1fb)]+_0x357d5c(0x1f7)+(_0xf0953b[_0x357d5c(0x1fb)]!==0x1?'s':'')),await handleSDKOutput(_0xf0953b,{..._0x241bc7,'limit':_0x81e1d9}),0x0;}catch(_0x20d035){if(_0x20d035 instanceof SDKError)return console['error'](_0x357d5c(0x204)+_0x20d035[_0x357d5c(0x1ee)]),_0x20d035[_0x357d5c(0x20d)]&&console[_0x357d5c(0x1fa)](_0x357d5c(0x20e)+_0x20d035[_0x357d5c(0x20d)]),0x1;throw _0x20d035;}}[a41_0xf94197(0x1f8)](_0x16e577){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a42_0x4aff(_0xb937c8,_0x57dc46){_0xb937c8=_0xb937c8-0x169;const _0x1c655b=a42_0x1c65();let _0x4aff38=_0x1c655b[_0xb937c8];return _0x4aff38;}const a42_0x3a8491=a42_0x4aff;(function(_0x3b3779,_0x1995ee){const _0x32ee9a=a42_0x4aff,_0x526651=_0x3b3779();while(!![]){try{const _0x1f086a=-parseInt(_0x32ee9a(0x16e))/0x1*(parseInt(_0x32ee9a(0x180))/0x2)+parseInt(_0x32ee9a(0x170))/0x3*(parseInt(_0x32ee9a(0x199))/0x4)+-parseInt(_0x32ee9a(0x19b))/0x5*(-parseInt(_0x32ee9a(0x18c))/0x6)+parseInt(_0x32ee9a(0x172))/0x7+-parseInt(_0x32ee9a(0x16d))/0x8+-parseInt(_0x32ee9a(0x193))/0x9+parseInt(_0x32ee9a(0x17f))/0xa*(parseInt(_0x32ee9a(0x19c))/0xb);if(_0x1f086a===_0x1995ee)break;else _0x526651['push'](_0x526651['shift']());}catch(_0x2b0053){_0x526651['push'](_0x526651['shift']());}}}(a42_0x1c65,0x8c322));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import a42_0x1fc17b from'chalk';export class UseCommand extends BaseCommand{[a42_0x3a8491(0x196)]=a42_0x3a8491(0x18e);[a42_0x3a8491(0x16c)]=a42_0x3a8491(0x19e);[a42_0x3a8491(0x173)](_0x421901){const _0x21e6ed=a42_0x3a8491,{args:_0x2a7977}=_0x421901;if(_0x2a7977[_0x21e6ed(0x185)]===0x0)return undefined;if(_0x2a7977[_0x21e6ed(0x185)]===0x1)return _0x21e6ed(0x17d)+'\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'+_0x21e6ed(0x182)+_0x21e6ed(0x189)+_0x21e6ed(0x18d);const _0x16eb53=_0x2a7977[0x0],_0x4b2b34=[_0x21e6ed(0x198),'parent_segment',_0x21e6ed(0x19d),_0x21e6ed(0x17c),_0x21e6ed(0x188),_0x21e6ed(0x17a)];if(!_0x4b2b34[_0x21e6ed(0x18f)](_0x16eb53))return _0x21e6ed(0x184)+_0x16eb53+_0x21e6ed(0x181)+_0x4b2b34[_0x21e6ed(0x19a)](',\x20');return undefined;}async[a42_0x3a8491(0x169)](_0x4d414c){const _0x436f16=a42_0x3a8491,{args:_0xb78392,options:_0x3a6a25}=_0x4d414c,_0x5eeb11=_0x3a6a25['debug'],_0x276c42=_0x3a6a25['clear'];cleanExpiredSessions();try{if(_0x276c42){clearSessionContext(_0x3a6a25[_0x436f16(0x176)]);const _0x347f14=_0x3a6a25[_0x436f16(0x176)]||getCurrentSessionPID()['toString']();return console[_0x436f16(0x186)](_0x436f16(0x16f)+a42_0x1fc17b[_0x436f16(0x179)](_0x436f16(0x187))+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x347f14+')')),0x0;}if(_0xb78392['length']===0x0){const _0x41a506=new GlobalContext(_0x3a6a25);return _0x5eeb11?_0x41a506[_0x436f16(0x177)]():_0x41a506[_0x436f16(0x18b)](),console[_0x436f16(0x186)](a42_0x1fc17b['dim'](_0x436f16(0x178))),console[_0x436f16(0x186)](a42_0x1fc17b[_0x436f16(0x195)]('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace')),0x0;}const _0xd3f776=_0xb78392[0x0],_0x562f60=_0xb78392[0x1];if(_0xd3f776==='profile'){if(!profileExists(_0x562f60))return console[_0x436f16(0x17e)]('Error:\x20Profile\x20\x27'+_0x562f60+_0x436f16(0x18a)),console['error'](_0x436f16(0x16a)),0x1;const _0x3f41af=_0x3a6a25[_0x436f16(0x176)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x562f60},_0x3a6a25[_0x436f16(0x176)]),console[_0x436f16(0x186)](_0x436f16(0x17b)+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)]('(session:\x20'+_0x3f41af+')')),console[_0x436f16(0x186)](a42_0x1fc17b[_0x436f16(0x195)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x35d93f={},_0x272f92=_0x3a6a25['session']||getCurrentSessionPID()['toString']();switch(_0xd3f776){case _0x436f16(0x198):_0x35d93f['database']=_0x562f60,console['log'](_0x436f16(0x197)+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'));break;case _0x436f16(0x183):_0x35d93f['parent_segment']=_0x562f60,console['log'](_0x436f16(0x192)+a42_0x1fc17b['green'](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'));break;case _0x436f16(0x19d):_0x35d93f['llm_project']=_0x562f60,console[_0x436f16(0x186)]('Session\x20llm_project\x20set\x20to:\x20'+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'));break;case _0x436f16(0x17c):{const {projectName:_0x38cd9c,agentName:_0x100379}=parseAgentRef(_0x562f60);_0x100379?(_0x35d93f[_0x436f16(0x19d)]=_0x38cd9c,_0x35d93f[_0x436f16(0x190)]=_0x100379,console[_0x436f16(0x186)](_0x436f16(0x174)+a42_0x1fc17b[_0x436f16(0x179)](_0x38cd9c)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')')),console[_0x436f16(0x186)](_0x436f16(0x16b)+a42_0x1fc17b['green'](_0x100379)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'))):(_0x35d93f[_0x436f16(0x190)]=_0x562f60,console['log'](_0x436f16(0x16b)+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')')));break;}case _0x436f16(0x17a):_0x35d93f[_0x436f16(0x17a)]=_0x562f60,console[_0x436f16(0x186)]('Session\x20engage_workspace\x20set\x20to:\x20'+a42_0x1fc17b[_0x436f16(0x179)](_0x562f60)+'\x20'+a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x194)+_0x272f92+')'));break;}return saveSessionContext(_0x35d93f,_0x3a6a25[_0x436f16(0x176)]),console[_0x436f16(0x186)](a42_0x1fc17b[_0x436f16(0x195)](_0x436f16(0x175))),0x0;}catch(_0x38881d){return _0x38881d instanceof Error&&console[_0x436f16(0x17e)](_0x436f16(0x171)+_0x38881d[_0x436f16(0x191)]),0x1;}}}function a42_0x1c65(){const _0x4e5ed0=['14084170ydthxv','2jXriDs','.\x20Must\x20be\x20one\x20of:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','parent_segment','Invalid\x20resource:\x20','length','log','cleared','profile','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','\x27\x20does\x20not\x20exist','display','120GKkikP','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','use','includes','llm_agent','message','Session\x20parent_segment\x20set\x20to:\x20','4924431RmsjzG','(session:\x20','dim','name','Session\x20database\x20set\x20to:\x20','database','4MPsvkW','join','184290lRobQO','11YVLMqh','llm_project','Set\x20session-level\x20context','execute','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Session\x20agent\x20set\x20to:\x20','description','9007072wajLhr','580840rqeJiJ','Session\x20context\x20','2041734asdJGb','Error:\x20','13790zraztV','validate','Session\x20llm_project\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','session','displayWithSources','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','green','engage_workspace','Session\x20profile\x20set\x20to:\x20','agent','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','error'];a42_0x1c65=function(){return _0x4e5ed0;};return a42_0x1c65();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x4294e1=a43_0x45ba;(function(_0x3b53f9,_0x51a5c3){const _0x1c0841=a43_0x45ba,_0x33499d=_0x3b53f9();while(!![]){try{const _0x5c4077=parseInt(_0x1c0841(0xe6))/0x1*(-parseInt(_0x1c0841(0xe9))/0x2)+parseInt(_0x1c0841(0xdc))/0x3+-parseInt(_0x1c0841(0xf6))/0x4+parseInt(_0x1c0841(0xdd))/0x5+parseInt(_0x1c0841(0xed))/0x6+-parseInt(_0x1c0841(0xe1))/0x7*(-parseInt(_0x1c0841(0xe8))/0x8)+parseInt(_0x1c0841(0xe2))/0x9*(-parseInt(_0x1c0841(0xf1))/0xa);if(_0x5c4077===_0x51a5c3)break;else _0x33499d['push'](_0x33499d['shift']());}catch(_0x46225f){_0x33499d['push'](_0x33499d['shift']());}}}(a43_0x45f7,0xe1a87));function a43_0x45f7(){const _0x32ef2d=['\x20user','message','17038RzkTNg','126JRmTcT','Show\x20current\x20user\x20information','List\x20all\x20users\x20in\x20the\x20account','Fetching\x20user\x20info...','551qahasg','list','2024NnOIrU','3962uPLbVy','execute','user','✔\x20Found\x20','5958858EGrDHd','getCurrent','cause','length','234790TWvBFJ','data','Error:\x20','Listing\x20users...','verbose','2519788lXfpfP','error','user\x20list','3010968TAiZun','1809390lYZKpb','description'];a43_0x45f7=function(){return _0x32ef2d;};return a43_0x45f7();}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';function a43_0x45ba(_0x2e9278,_0x4533f0){_0x2e9278=_0x2e9278-0xdc;const _0x45f7a4=a43_0x45f7();let _0x45ba1a=_0x45f7a4[_0x2e9278];return _0x45ba1a;}export class UserCommand extends BaseCommand{['name']=a43_0x4294e1(0xeb);[a43_0x4294e1(0xde)]=a43_0x4294e1(0xe3);async[a43_0x4294e1(0xea)](_0x16dca1){const _0x298888=a43_0x4294e1,{options:_0x42f994,tdx:_0x204709}=_0x16dca1;try{const _0x57d19b=await withSpinner(_0x298888(0xe5),()=>_0x204709[_0x298888(0xeb)][_0x298888(0xee)](),{'verbose':_0x42f994[_0x298888(0xf5)]}),_0x125309=_0x57d19b[_0x298888(0xf2)];return await handleSingleObjectOutput(_0x125309,_0x42f994),0x0;}catch(_0x3b80b4){if(_0x3b80b4 instanceof SDKError)return console[_0x298888(0xf7)](_0x298888(0xf3)+_0x3b80b4['message']),_0x3b80b4[_0x298888(0xef)]&&console['error']('\x20\x20Cause:\x20'+_0x3b80b4[_0x298888(0xef)]),0x1;throw _0x3b80b4;}}}export class UserListCommand extends BaseCommand{['name']=a43_0x4294e1(0xf8);[a43_0x4294e1(0xde)]=a43_0x4294e1(0xe4);async[a43_0x4294e1(0xea)](_0x3915b9){const _0x3da1c=a43_0x4294e1,{options:_0x14fd1c,tdx:_0x57aa7a}=_0x3915b9;try{const _0x28d8fb=await withSpinner(_0x3da1c(0xf4),()=>_0x57aa7a[_0x3da1c(0xeb)][_0x3da1c(0xe7)](),{'verbose':_0x14fd1c[_0x3da1c(0xf5)]}),_0x20926a=_0x28d8fb[_0x3da1c(0xf2)];return console[_0x3da1c(0xf7)](_0x3da1c(0xec)+_0x20926a[_0x3da1c(0xf0)]+_0x3da1c(0xdf)+(_0x20926a[_0x3da1c(0xf0)]!==0x1?'s':'')),await handleSDKOutput(_0x20926a,_0x14fd1c),0x0;}catch(_0x263704){if(_0x263704 instanceof SDKError)return console[_0x3da1c(0xf7)](_0x3da1c(0xf3)+_0x263704[_0x3da1c(0xe0)]),_0x263704[_0x3da1c(0xef)]&&console[_0x3da1c(0xf7)]('\x20\x20Cause:\x20'+_0x263704[_0x3da1c(0xef)]),0x1;throw _0x263704;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a44_0x9c18ca=a44_0x17b7;(function(_0x1022f1,_0x278bd3){const _0x13d883=a44_0x17b7,_0x46b1ae=_0x1022f1();while(!![]){try{const _0x511242=parseInt(_0x13d883(0x148))/0x1*(parseInt(_0x13d883(0x140))/0x2)+parseInt(_0x13d883(0x165))/0x3+-parseInt(_0x13d883(0x191))/0x4+-parseInt(_0x13d883(0x15d))/0x5+parseInt(_0x13d883(0x15b))/0x6*(-parseInt(_0x13d883(0x177))/0x7)+parseInt(_0x13d883(0x150))/0x8*(parseInt(_0x13d883(0x1bf))/0x9)+parseInt(_0x13d883(0x162))/0xa*(parseInt(_0x13d883(0x1c5))/0xb);if(_0x511242===_0x278bd3)break;else _0x46b1ae['push'](_0x46b1ae['shift']());}catch(_0x2cb7b7){_0x46b1ae['push'](_0x46b1ae['shift']());}}}(a44_0x5c23,0x4e06e));function a44_0x5c23(){const _0x72530a=['getTime','substring','Error:\x20Workflow\x20identifier\x20is\x20required','Show\x20tasks\x20for\x20an\x20attempt','Force:\x20yes','workflow:run','createdAt','7ZXNgbl','\x20is\x20not\x20a\x20directory','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Kill\x20a\x20running\x20attempt','Output\x20directory:\x20','\x20\x20Project\x20ID:\x20','includeRetried','running','workflow:workflows','select','Error:\x20Attempt\x20ID\x20is\x20required','from','workflow','sessionId','Params:\x20','Project\x20name:\x20','execute','index','Project\x20filter:\x20','...','✔\x20Workflow\x20run\x20started','readFile','Show\x20logs\x20for\x20a\x20workflow\x20attempt','format','workflow:retry','List\x20workflow\x20execution\x20sessions','1193764luZhJl','status','keys','retryAttempt','reason','param','indexOf','Pushing\x20workflow\x20project...','stat','✔\x20Found\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','Filter:\x20project=','attempt:','✔\x20Pushed\x20','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','cancelRequested','startsWith','params','Deleting\x20project\x20','includeSubtasks','Expected\x20format:\x20--param\x20key=value','\x20attempt','map','✔\x20Deleted\x20project\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Pattern:\x20','workflow:delete','Filter:\x20','projectName','done','Session\x20time:\x20','limit','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','workflow:download','length','download','filesExtracted','\x20\x20Attempt\x20ID:\x20','parse','yes','Error:\x20','utf-8','resumeFrom','attemptId','Reason:\x20','fromTask','99mouGLv','workflow:push','\x20\x20Revision:\x20','isDirectory','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','task','276441fkRMoq','error','message','Retrying\x20attempt...','Retry\x20a\x20session\x20or\x20attempt','cause','Attempt\x20ID:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','round','Target:\x20','\x20\x20Files\x20extracted:\x20','Starting\x20workflow\x20run...','retrySession','List\x20workflows','\x20project','delete','workflow:kill','split','✔\x20Retry\x20started','projectId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Session\x20ID:\x20','log','projects','verbose','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','kill','session','Listing\x20workflows...','Including\x20subtasks:\x20yes','logs','Task\x20name:\x20','Downloading\x20project\x20','push','name','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20\x20Project:\x20','8zTWnbt','fileSize','workflow:attempt','project','\x20workflow','List\x20workflow\x20attempts','attempts','revision','52406pBDyrx','\x20\x20New\x20attempt\x20ID:\x20','skipValidation','\x20session','finishedAt','success','Start\x20a\x20workflow\x20run','Getting\x20attempt\x20details...','159944SrAGSx','Show\x20specific\x20attempt\x20details','taskName','Revision:\x20','Parameters:\x20','attempt','Listing\x20workflow\x20projects...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Cancelled','retryAttemptName','Status:\x20','487752nWSGnO','isArray','2107915EtoMeM','Include\x20retried:\x20yes','json','description','workflow:sessions','70rXfEmD','Getting\x20attempt\x20tasks...','sessions','1546350PnAhAD','\x20\x20Cause:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','sessionTime','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:logs','Retrying\x20session...','workflow:tasks','Error:\x20Invalid\x20parameter\x20format:\x20','\x20\x20Location:\x20','data'];a44_0x5c23=function(){return _0x72530a;};return a44_0x5c23();}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';function a44_0x17b7(_0x6979a3,_0x53a418){_0x6979a3=_0x6979a3-0x138;const _0x5c2300=a44_0x5c23();let _0x17b767=_0x5c2300[_0x6979a3];return _0x17b767;}import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0x19105c from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]='workflow:projects';[a44_0x9c18ca(0x160)]='List\x20all\x20workflow\x20projects';async[a44_0x9c18ca(0x187)](_0x308519){const _0x45d822=a44_0x9c18ca,{options:_0x302a96,args:_0x15beb2,tdx:_0x14b017}=_0x308519,_0x383091=_0x15beb2[0x0];try{_0x302a96['verbose']&&_0x383091&&console['error'](_0x45d822(0x1aa)+_0x383091);const _0x247c94=await withSpinner(_0x45d822(0x156),()=>_0x14b017['workflow'][_0x45d822(0x1de)](_0x383091,{'limit':_0x302a96[_0x45d822(0x1b0)]}),{'verbose':_0x302a96[_0x45d822(0x1df)]}),_0x24d537=_0x247c94['data'];return console['error'](_0x45d822(0x19a)+_0x24d537[_0x45d822(0x1b3)]+_0x45d822(0x1d3)+(_0x24d537['length']!==0x1?'s':'')),await handleSDKOutput(_0x24d537,_0x302a96),0x0;}catch(_0x5b57f7){if(_0x5b57f7 instanceof SDKError)return console[_0x45d822(0x1c6)](_0x45d822(0x1b9)+_0x5b57f7[_0x45d822(0x1c7)]),_0x5b57f7[_0x45d822(0x1ca)]&&console['error'](_0x45d822(0x166)+_0x5b57f7[_0x45d822(0x1ca)]),0x1;throw _0x5b57f7;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x17f);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x1d2);async[a44_0x9c18ca(0x187)](_0x59d73a){const _0x363b88=a44_0x9c18ca,{options:_0x79d1aa,args:_0x42fca4,tdx:_0x2871ef}=_0x59d73a,_0x57a4cb=_0x42fca4[0x0];try{_0x79d1aa[_0x363b88(0x1df)]&&_0x57a4cb&&console['error'](_0x363b88(0x189)+_0x57a4cb);const _0x590e7b=await withSpinner(_0x363b88(0x1e3),()=>_0x2871ef['workflow']['workflows'](_0x57a4cb,{'limit':_0x79d1aa[_0x363b88(0x1b0)]}),{'verbose':_0x79d1aa[_0x363b88(0x1df)]}),_0x37fb54=_0x590e7b[_0x363b88(0x16f)];return console['error']('✔\x20Found\x20'+_0x37fb54[_0x363b88(0x1b3)]+_0x363b88(0x144)+(_0x37fb54[_0x363b88(0x1b3)]!==0x1?'s':'')),await handleSDKOutput(_0x37fb54,_0x79d1aa),0x0;}catch(_0x142b8a){if(_0x142b8a instanceof SDKError)return console[_0x363b88(0x1c6)](_0x363b88(0x1b9)+_0x142b8a[_0x363b88(0x1c7)]),_0x142b8a[_0x363b88(0x1ca)]&&console[_0x363b88(0x1c6)](_0x363b88(0x166)+_0x142b8a[_0x363b88(0x1ca)]),0x1;throw _0x142b8a;}}}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x161);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x190);async[a44_0x9c18ca(0x187)](_0x4ec03a){const _0xeb0ecf=a44_0x9c18ca,{options:_0x6a6a90,args:_0x322cf0,tdx:_0x5f2804}=_0x4ec03a;let _0x3f21ac,_0xbe682a;if(_0x322cf0[0x0]){const _0x5d3fc9=_0x322cf0[0x0][_0xeb0ecf(0x1d6)]('.');if(_0x5d3fc9['length']===0x1)_0x3f21ac=_0x5d3fc9[0x0];else{if(_0x5d3fc9['length']===0x2)[_0x3f21ac,_0xbe682a]=_0x5d3fc9;else return console[_0xeb0ecf(0x1c6)](_0xeb0ecf(0x169)),0x1;}}try{if(_0x6a6a90['verbose']){if(_0x3f21ac&&_0xbe682a)console['error'](_0xeb0ecf(0x1ac)+_0x3f21ac+'.'+_0xbe682a);else _0x3f21ac&&console[_0xeb0ecf(0x1c6)](_0xeb0ecf(0x19c)+_0x3f21ac);const _0xf9f477=_0x6a6a90['status'];_0xf9f477&&console[_0xeb0ecf(0x1c6)](_0xeb0ecf(0x15a)+_0xf9f477);}const _0x806a2=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5f2804[_0xeb0ecf(0x183)][_0xeb0ecf(0x164)]({'projectName':_0x3f21ac,'workflowName':_0xbe682a,'status':_0x6a6a90[_0xeb0ecf(0x192)],'fromTime':_0x6a6a90[_0xeb0ecf(0x182)],'toTime':_0x6a6a90['to'],'limit':_0x6a6a90[_0xeb0ecf(0x1b0)]}),{'verbose':_0x6a6a90[_0xeb0ecf(0x1df)]}),_0xd28537=_0x806a2[_0xeb0ecf(0x16f)];return console[_0xeb0ecf(0x1c6)](_0xeb0ecf(0x19a)+_0xd28537['length']+_0xeb0ecf(0x14b)+(_0xd28537['length']!==0x1?'s':'')),await handleSDKOutput(_0xd28537,_0x6a6a90),0x0;}catch(_0x598e62){if(_0x598e62 instanceof SDKError)return console['error']('Error:\x20'+_0x598e62[_0xeb0ecf(0x1c7)]),_0x598e62['cause']&&console[_0xeb0ecf(0x1c6)](_0xeb0ecf(0x166)+_0x598e62[_0xeb0ecf(0x1ca)]),0x1;throw _0x598e62;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']='workflow:attempts';['description']=a44_0x9c18ca(0x145);async['execute'](_0x4c1234){const _0x521b75=a44_0x9c18ca,{options:_0x2a839a,args:_0x1a104f,tdx:_0x22d010}=_0x4c1234;let _0x18adcc,_0x20c116;if(_0x1a104f[0x0]){const _0x38ec5c=_0x1a104f[0x0][_0x521b75(0x1d6)]('.');if(_0x38ec5c['length']===0x1)_0x18adcc=_0x38ec5c[0x0];else{if(_0x38ec5c[_0x521b75(0x1b3)]===0x2)[_0x18adcc,_0x20c116]=_0x38ec5c;else return console[_0x521b75(0x1c6)](_0x521b75(0x169)),0x1;}}try{const _0x2b659a=_0x2a839a[_0x521b75(0x17d)];if(_0x2a839a[_0x521b75(0x1df)]){if(_0x18adcc&&_0x20c116)console[_0x521b75(0x1c6)](_0x521b75(0x1ac)+_0x18adcc+'.'+_0x20c116);else _0x18adcc&&console[_0x521b75(0x1c6)](_0x521b75(0x19c)+_0x18adcc);_0x2b659a&&console[_0x521b75(0x1c6)](_0x521b75(0x15e));}const _0x3ff32a=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x22d010[_0x521b75(0x183)][_0x521b75(0x146)]({'projectName':_0x18adcc,'workflowName':_0x20c116,'includeRetried':_0x2b659a,'limit':_0x2a839a[_0x521b75(0x1b0)]}),{'verbose':_0x2a839a[_0x521b75(0x1df)]}),_0x4cec00=_0x3ff32a[_0x521b75(0x16f)];return console[_0x521b75(0x1c6)](_0x521b75(0x19a)+_0x4cec00['length']+_0x521b75(0x1a6)+(_0x4cec00[_0x521b75(0x1b3)]!==0x1?'s':'')),await handleSDKOutput(_0x4cec00,_0x2a839a),0x0;}catch(_0x47a9f4){if(_0x47a9f4 instanceof SDKError)return console[_0x521b75(0x1c6)]('Error:\x20'+_0x47a9f4[_0x521b75(0x1c7)]),_0x47a9f4['cause']&&console['error']('\x20\x20Cause:\x20'+_0x47a9f4['cause']),0x1;throw _0x47a9f4;}}}export class WorkflowAttemptCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x142);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x151);async[a44_0x9c18ca(0x187)](_0x18fb29){const _0x5bf906=a44_0x9c18ca,{options:_0x2cbd44,args:_0x5dbd84,tdx:_0x31ef7f}=_0x18fb29,_0xa31ee2=_0x5dbd84[0x0];if(!_0xa31ee2)return console[_0x5bf906(0x1c6)](_0x5bf906(0x181)),0x1;try{_0x2cbd44[_0x5bf906(0x1df)]&&console[_0x5bf906(0x1c6)](_0x5bf906(0x1cb)+_0xa31ee2);const _0x51b511=await withSpinner(_0x5bf906(0x14f),()=>_0x31ef7f[_0x5bf906(0x183)][_0x5bf906(0x155)](_0xa31ee2),{'verbose':_0x2cbd44[_0x5bf906(0x1df)]}),_0x28c9d3=_0x51b511[_0x5bf906(0x16f)];let _0x97bec3;!_0x28c9d3[_0x5bf906(0x1ae)]?_0x97bec3=_0x28c9d3[_0x5bf906(0x1a0)]?'canceling':_0x5bf906(0x17e):_0x97bec3=_0x28c9d3[_0x5bf906(0x14d)]?_0x5bf906(0x14d):_0x5bf906(0x1c6);let _0x4193fc;if(_0x28c9d3[_0x5bf906(0x176)]&&_0x28c9d3[_0x5bf906(0x14c)]){const _0x1a0047=new Date(_0x28c9d3[_0x5bf906(0x176)])[_0x5bf906(0x170)](),_0x3afb03=new Date(_0x28c9d3[_0x5bf906(0x14c)])[_0x5bf906(0x170)]();_0x4193fc=Math[_0x5bf906(0x1cd)]((_0x3afb03-_0x1a0047)/0x3e8);}const _0x2e2108={'attempt_id':_0x28c9d3['id'],'status':_0x97bec3,..._0x28c9d3[_0x5bf906(0x188)]!==undefined&&{'index':_0x28c9d3['index']},..._0x28c9d3[_0x5bf906(0x143)]&&{'project':_0x28c9d3[_0x5bf906(0x143)][_0x5bf906(0x13d)]},..._0x28c9d3['workflow']&&{'workflow':_0x28c9d3['workflow'][_0x5bf906(0x13d)]},..._0x28c9d3[_0x5bf906(0x184)]&&{'session_id':_0x28c9d3[_0x5bf906(0x184)]},..._0x28c9d3['sessionTime']&&{'session_time':_0x28c9d3[_0x5bf906(0x168)]},..._0x28c9d3[_0x5bf906(0x159)]&&{'retry_attempt':_0x28c9d3[_0x5bf906(0x159)]},..._0x4193fc!==undefined&&{'duration_sec':_0x4193fc},..._0x28c9d3[_0x5bf906(0x176)]&&{'created_at':_0x28c9d3[_0x5bf906(0x176)]},..._0x28c9d3[_0x5bf906(0x14c)]&&{'finished_at':_0x28c9d3['finishedAt']},...Object[_0x5bf906(0x193)](_0x28c9d3[_0x5bf906(0x1a2)])[_0x5bf906(0x1b3)]>0x0&&{'params':_0x28c9d3['params']}};return await handleSingleObjectOutput(_0x2e2108,_0x2cbd44),0x0;}catch(_0x26d36a){if(_0x26d36a instanceof SDKError)return console[_0x5bf906(0x1c6)](_0x5bf906(0x1b9)+_0x26d36a[_0x5bf906(0x1c7)]),_0x26d36a[_0x5bf906(0x1ca)]&&console['error'](_0x5bf906(0x166)+_0x26d36a[_0x5bf906(0x1ca)]),0x1;throw _0x26d36a;}}}export class WorkflowTasksCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x16c);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x173);async[a44_0x9c18ca(0x187)](_0x41119f){const _0x26a10f=a44_0x9c18ca,{options:_0x39cda6,args:_0x59730f,tdx:_0x1d0f3b}=_0x41119f,_0x17644d=_0x59730f[0x0];if(!_0x17644d)return console[_0x26a10f(0x1c6)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x4c4dd0=_0x39cda6[_0x26a10f(0x1a4)];_0x39cda6['verbose']&&(console[_0x26a10f(0x1c6)](_0x26a10f(0x1cb)+_0x17644d),_0x4c4dd0&&console['error'](_0x26a10f(0x138)));const _0x3c556b=await withSpinner(_0x26a10f(0x163),()=>_0x1d0f3b['workflow']['tasks'](_0x17644d,_0x4c4dd0||![]),{'verbose':_0x39cda6[_0x26a10f(0x1df)]}),_0x4f2ba5=_0x3c556b[_0x26a10f(0x16f)];return console[_0x26a10f(0x1c6)]('✔\x20Found\x20'+_0x4f2ba5[_0x26a10f(0x1b3)]+'\x20task'+(_0x4f2ba5[_0x26a10f(0x1b3)]!==0x1?'s':'')),await handleSDKOutput(_0x4f2ba5,_0x39cda6),0x0;}catch(_0x9bbfe0){if(_0x9bbfe0 instanceof SDKError)return console[_0x26a10f(0x1c6)](_0x26a10f(0x1b9)+_0x9bbfe0[_0x26a10f(0x1c7)]),_0x9bbfe0['cause']&&console[_0x26a10f(0x1c6)]('\x20\x20Cause:\x20'+_0x9bbfe0[_0x26a10f(0x1ca)]),0x1;throw _0x9bbfe0;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x16a);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x18d);async[a44_0x9c18ca(0x187)](_0xc83e09){const _0x37c8cf=a44_0x9c18ca,{options:_0x47898f,args:_0x247029,tdx:_0x564b47}=_0xc83e09,_0x1f5d28=_0x247029[0x0];let _0x4c328d=_0x247029[0x1];if(!_0x1f5d28)return console['error'](_0x37c8cf(0x181)),0x1;try{_0x47898f[_0x37c8cf(0x1df)]&&(console[_0x37c8cf(0x1c6)](_0x37c8cf(0x1cb)+_0x1f5d28),_0x4c328d&&console[_0x37c8cf(0x1c6)](_0x37c8cf(0x13a)+_0x4c328d));const _0x3353c7=await withSpinner('Fetching\x20log\x20files...',()=>_0x564b47[_0x37c8cf(0x183)]['logFiles'](_0x1f5d28,_0x4c328d),{'verbose':_0x47898f[_0x37c8cf(0x1df)]}),_0x25b92f=_0x3353c7[_0x37c8cf(0x16f)];if(_0x25b92f[_0x37c8cf(0x1b3)]===0x0)return console['error'](_0x37c8cf(0x1da)),0x0;if(!_0x4c328d&&(_0x47898f[_0x37c8cf(0x15f)]||_0x47898f[_0x37c8cf(0x18e)]))return await handleSDKOutput(_0x25b92f,_0x47898f),0x0;if(!_0x4c328d){const _0x588014=_0x25b92f[_0x37c8cf(0x1a7)](_0x520cf2=>({'title':_0x520cf2['taskName']+'\x20('+formatBytes(_0x520cf2[_0x37c8cf(0x141)])+')','value':_0x520cf2[_0x37c8cf(0x152)]})),_0x2cea1c=await a44_0x19105c({'type':_0x37c8cf(0x180),'name':_0x37c8cf(0x1c4),'message':_0x37c8cf(0x1cc),'choices':_0x588014});if(!_0x2cea1c['task'])return console[_0x37c8cf(0x1c6)](_0x37c8cf(0x158)),0x0;_0x4c328d=_0x2cea1c['task'];}const _0x22bdf4=await withSpinner('Downloading\x20logs...',()=>_0x564b47['workflow'][_0x37c8cf(0x139)](_0x1f5d28,_0x4c328d),{'verbose':_0x47898f[_0x37c8cf(0x1df)]}),_0x36ac1f=_0x22bdf4[_0x37c8cf(0x16f)];return _0x36ac1f?console[_0x37c8cf(0x1dd)](_0x36ac1f):console['error']('No\x20log\x20content\x20found'),0x0;}catch(_0x4e5218){if(_0x4e5218 instanceof SDKError)return console[_0x37c8cf(0x1c6)](_0x37c8cf(0x1b9)+_0x4e5218['message']),_0x4e5218[_0x37c8cf(0x1ca)]&&console[_0x37c8cf(0x1c6)](_0x37c8cf(0x166)+_0x4e5218[_0x37c8cf(0x1ca)]),0x1;throw _0x4e5218;}}}export class WorkflowKillCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x1d5);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x17a);async[a44_0x9c18ca(0x187)](_0x4adc41){const _0x49aab8=a44_0x9c18ca,{options:_0x329301,args:_0x1d4eef,tdx:_0x21d148}=_0x4adc41,_0x1de32d=_0x1d4eef[0x0];if(!_0x1de32d)return console[_0x49aab8(0x1c6)](_0x49aab8(0x181)),0x1;try{const _0x59d943=_0x329301[_0x49aab8(0x195)];_0x329301['verbose']&&(console[_0x49aab8(0x1c6)](_0x49aab8(0x1cb)+_0x1de32d),_0x59d943&&console[_0x49aab8(0x1c6)](_0x49aab8(0x1bd)+_0x59d943));if(!_0x329301['yes']){const _0x5a5b51=await confirm(_0x49aab8(0x1b1)+_0x1de32d+'?');if(!_0x5a5b51)return console[_0x49aab8(0x1c6)](_0x49aab8(0x158)),0x0;}const _0x41d407=await withSpinner('Killing\x20attempt...',()=>_0x21d148[_0x49aab8(0x183)][_0x49aab8(0x1e1)](_0x1de32d,_0x59d943),{'verbose':_0x329301[_0x49aab8(0x1df)]}),_0x241e89=_0x41d407['data'];return console[_0x49aab8(0x1c6)]('✔\x20'+_0x241e89),0x0;}catch(_0x544335){if(_0x544335 instanceof SDKError)return console['error'](_0x49aab8(0x1b9)+_0x544335['message']),_0x544335['cause']&&console['error']('\x20\x20Cause:\x20'+_0x544335[_0x49aab8(0x1ca)]),0x1;throw _0x544335;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a44_0x9c18ca(0x18f);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x1c9);async[a44_0x9c18ca(0x187)](_0x8bb29f){const _0x1f4218=a44_0x9c18ca,{options:_0x513982,args:_0x5053bc,tdx:_0x370a3d}=_0x8bb29f,_0x2ee016=_0x5053bc[0x0];if(!_0x2ee016)return console['error'](_0x1f4218(0x1a9)),console[_0x1f4218(0x1c6)](_0x1f4218(0x1e0)),0x1;let _0x1585be=![],_0x3aff57=_0x2ee016;if(_0x2ee016[_0x1f4218(0x1a1)]('session:'))_0x1585be=!![],_0x3aff57=_0x2ee016['substring'](0x8);else{if(_0x2ee016[_0x1f4218(0x1a1)](_0x1f4218(0x19d)))_0x1585be=![],_0x3aff57=_0x2ee016[_0x1f4218(0x171)](0x8);else return console[_0x1f4218(0x1c6)](_0x1f4218(0x179)),console[_0x1f4218(0x1c6)](_0x1f4218(0x1e0)),0x1;}try{const _0x3797d8=_0x513982[_0x1f4218(0x1be)],_0x40f9b0=_0x513982[_0x1f4218(0x1bb)],_0x549858=_0x513982[_0x1f4218(0x1a2)],_0x3a8b55=_0x513982['force'];_0x513982[_0x1f4218(0x1df)]&&(console[_0x1f4218(0x1c6)](_0x1f4218(0x1ce)+(_0x1585be?_0x1f4218(0x1e2):_0x1f4218(0x155))+'\x20'+_0x3aff57),_0x3797d8&&console[_0x1f4218(0x1c6)]('From\x20task:\x20'+_0x3797d8),_0x40f9b0&&console[_0x1f4218(0x1c6)]('Resume\x20from:\x20'+_0x40f9b0),_0x549858&&console['error'](_0x1f4218(0x185)+_0x549858),_0x3a8b55&&console['error'](_0x1f4218(0x174)));let _0x3b83a0;if(_0x549858)try{if(_0x549858[_0x1f4218(0x1a1)]('@')){const _0x20d4cd=await import('fs/promises'),_0x28a842=_0x549858[_0x1f4218(0x171)](0x1),_0x30005d=await _0x20d4cd[_0x1f4218(0x18c)](_0x28a842,_0x1f4218(0x1ba));_0x3b83a0=JSON['parse'](_0x30005d);}else _0x3b83a0=JSON[_0x1f4218(0x1b7)](_0x549858);}catch{return console[_0x1f4218(0x1c6)](_0x1f4218(0x1db)),0x1;}if(!_0x513982['yes']){const _0x32f3e9=await confirm(_0x1f4218(0x13e)+(_0x1585be?_0x1f4218(0x1e2):_0x1f4218(0x155))+'\x20'+_0x3aff57+'?');if(!_0x32f3e9)return console[_0x1f4218(0x1c6)]('Cancelled'),0x0;}let _0x103062;_0x1585be?_0x103062=await withSpinner(_0x1f4218(0x16b),()=>_0x370a3d[_0x1f4218(0x183)][_0x1f4218(0x1d1)](_0x3aff57,{'fromTask':_0x3797d8,'retryParams':_0x3b83a0}),{'verbose':_0x513982[_0x1f4218(0x1df)]}):_0x103062=await withSpinner(_0x1f4218(0x1c8),()=>_0x370a3d[_0x1f4218(0x183)][_0x1f4218(0x194)](_0x3aff57,{'resumeFrom':_0x40f9b0,'retryParams':_0x3b83a0,'force':_0x3a8b55}),{'verbose':_0x513982['verbose']});const _0x195b37=_0x103062[_0x1f4218(0x16f)];return console[_0x1f4218(0x1c6)](_0x1f4218(0x1d7)),console['error'](_0x1f4218(0x149)+_0x195b37[_0x1f4218(0x1bc)]),console['error'](_0x1f4218(0x1dc)+_0x195b37[_0x1f4218(0x184)]),0x0;}catch(_0x452f64){if(_0x452f64 instanceof SDKError)return console[_0x1f4218(0x1c6)](_0x1f4218(0x1b9)+_0x452f64[_0x1f4218(0x1c7)]),_0x452f64[_0x1f4218(0x1ca)]&&console[_0x1f4218(0x1c6)](_0x1f4218(0x166)+_0x452f64[_0x1f4218(0x1ca)]),0x1;throw _0x452f64;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x175);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x14e);async[a44_0x9c18ca(0x187)](_0x46668b){const _0x56ce52=a44_0x9c18ca,{options:_0x2b4f23,args:_0x13970f,tdx:_0x1c9495}=_0x46668b,_0x2c2326=_0x13970f[0x0];if(!_0x2c2326)return console[_0x56ce52(0x1c6)](_0x56ce52(0x172)),console[_0x56ce52(0x1c6)](_0x56ce52(0x19f)),0x1;const _0x50d858=_0x2b4f23[_0x56ce52(0x196)],_0x524dcb=_0x2b4f23['sessionTime'],_0x598cff={};if(_0x50d858&&Array[_0x56ce52(0x15c)](_0x50d858))for(const _0xed8cc0 of _0x50d858){const _0x4791fd=_0xed8cc0[_0x56ce52(0x197)]('=');if(_0x4791fd===-0x1)return console['error'](_0x56ce52(0x16d)+_0xed8cc0),console[_0x56ce52(0x1c6)](_0x56ce52(0x1a5)),0x1;const _0x1ef830=_0xed8cc0[_0x56ce52(0x171)](0x0,_0x4791fd),_0xdb88d6=_0xed8cc0[_0x56ce52(0x171)](_0x4791fd+0x1);try{_0x598cff[_0x1ef830]=JSON[_0x56ce52(0x1b7)](_0xdb88d6);}catch{_0x598cff[_0x1ef830]=_0xdb88d6;}}_0x2b4f23['verbose']&&(console[_0x56ce52(0x1c6)]('Workflow:\x20'+_0x2c2326),Object['keys'](_0x598cff)[_0x56ce52(0x1b3)]>0x0&&console['error'](_0x56ce52(0x154)+JSON['stringify'](_0x598cff)),_0x524dcb&&console[_0x56ce52(0x1c6)](_0x56ce52(0x1af)+_0x524dcb));const _0x21a0a2=await withSpinner(_0x56ce52(0x1d0),()=>_0x1c9495['workflow']['run'](_0x2c2326,_0x598cff,{'sessionTime':_0x524dcb}),{'verbose':_0x2b4f23[_0x56ce52(0x1df)]}),_0x1ebb9a=_0x21a0a2['data'];return console['error'](_0x56ce52(0x18b)),console[_0x56ce52(0x1c6)](_0x56ce52(0x1b6)+_0x1ebb9a['id']),console[_0x56ce52(0x1c6)](_0x56ce52(0x1dc)+_0x1ebb9a[_0x56ce52(0x184)]),console[_0x56ce52(0x1c6)](_0x56ce52(0x13f)+_0x1ebb9a[_0x56ce52(0x143)]?.[_0x56ce52(0x13d)]),console[_0x56ce52(0x1c6)]('\x20\x20Workflow:\x20'+_0x1ebb9a[_0x56ce52(0x183)]?.[_0x56ce52(0x13d)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a44_0x9c18ca(0x1b2);[a44_0x9c18ca(0x160)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a44_0x9c18ca(0x187)](_0x404178){const _0x1f8f6e=a44_0x9c18ca,{options:_0x147275,args:_0x50d63e,tdx:_0x2683f4}=_0x404178,_0x1a66bd=_0x50d63e[0x0],_0x42c1cd=_0x50d63e[0x1]||'.';if(!_0x1a66bd)return console[_0x1f8f6e(0x1c6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x1f8f6e(0x1c6)](_0x1f8f6e(0x157)),0x1;const _0x1dbaed=_0x147275['revision'];_0x147275[_0x1f8f6e(0x1df)]&&(console[_0x1f8f6e(0x1c6)]('Project:\x20'+_0x1a66bd),console[_0x1f8f6e(0x1c6)](_0x1f8f6e(0x17b)+_0x42c1cd),_0x1dbaed&&console[_0x1f8f6e(0x1c6)](_0x1f8f6e(0x153)+_0x1dbaed));const _0x42389b=await withSpinner(_0x1f8f6e(0x13b)+_0x1a66bd+_0x1f8f6e(0x18a),()=>_0x2683f4[_0x1f8f6e(0x183)][_0x1f8f6e(0x1b4)](_0x1a66bd,_0x42c1cd,{'revision':_0x1dbaed}),{'verbose':_0x147275[_0x1f8f6e(0x1df)]}),_0x3e1078=_0x42389b[_0x1f8f6e(0x16f)];return console[_0x1f8f6e(0x1c6)]('✔\x20Downloaded\x20'+_0x3e1078[_0x1f8f6e(0x1ad)]),console[_0x1f8f6e(0x1c6)](_0x1f8f6e(0x1c1)+_0x3e1078['revision']),console[_0x1f8f6e(0x1c6)](_0x1f8f6e(0x1cf)+_0x3e1078[_0x1f8f6e(0x1b5)]),console['error'](_0x1f8f6e(0x16e)+_0x42c1cd+'/'+_0x3e1078[_0x1f8f6e(0x1ad)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x1c0);[a44_0x9c18ca(0x160)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async['execute'](_0x4d2148){const _0x2e0593=a44_0x9c18ca,{options:_0x4bf975,args:_0x47af5c,tdx:_0x58a22b}=_0x4d2148;let _0x290d4a='.',_0x404189=_0x4bf975['name'];if(_0x47af5c[0x0]){const {promises:_0x4405a4}=await import('fs');try{const _0x3b1f1c=await _0x4405a4[_0x2e0593(0x199)](_0x47af5c[0x0]);if(_0x3b1f1c[_0x2e0593(0x1c2)]())_0x290d4a=_0x47af5c[0x0];else return console[_0x2e0593(0x1c6)](_0x2e0593(0x1b9)+_0x47af5c[0x0]+_0x2e0593(0x178)),0x1;}catch{_0x404189=_0x47af5c[0x0],_0x290d4a='.';}}const _0x45f509=_0x4bf975[_0x2e0593(0x147)],_0x9341a6=_0x4bf975[_0x2e0593(0x14a)];_0x4bf975[_0x2e0593(0x1df)]&&(console[_0x2e0593(0x1c6)]('Project\x20directory:\x20'+_0x290d4a),_0x404189&&console[_0x2e0593(0x1c6)](_0x2e0593(0x186)+_0x404189),_0x45f509&&console[_0x2e0593(0x1c6)](_0x2e0593(0x153)+_0x45f509),_0x9341a6&&console[_0x2e0593(0x1c6)]('Validation:\x20skipped'));const _0x5dd7da=await withSpinner(_0x2e0593(0x198),()=>_0x58a22b[_0x2e0593(0x183)][_0x2e0593(0x13c)](_0x290d4a,{'projectName':_0x404189,'revision':_0x45f509,'skipValidation':_0x9341a6}),{'verbose':_0x4bf975[_0x2e0593(0x1df)]}),_0x50d5a4=_0x5dd7da[_0x2e0593(0x16f)];return console[_0x2e0593(0x1c6)](_0x2e0593(0x19e)+_0x50d5a4[_0x2e0593(0x1ad)]),console[_0x2e0593(0x1c6)]('\x20\x20Project\x20ID:\x20'+_0x50d5a4[_0x2e0593(0x1d8)]),console[_0x2e0593(0x1c6)]('\x20\x20Revision:\x20'+_0x50d5a4[_0x2e0593(0x147)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x9c18ca(0x13d)]=a44_0x9c18ca(0x1ab);[a44_0x9c18ca(0x160)]=a44_0x9c18ca(0x1c3);async[a44_0x9c18ca(0x187)](_0x52a3d5){const _0x761f53=a44_0x9c18ca,{options:_0x211a37,args:_0x341d3c,tdx:_0x27b47f}=_0x52a3d5,_0x37a59c=_0x341d3c[0x0];if(!_0x37a59c)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x761f53(0x1c6)](_0x761f53(0x19b)),0x1;_0x211a37[_0x761f53(0x1df)]&&console['error']('Project:\x20'+_0x37a59c);if(!_0x211a37[_0x761f53(0x1b8)]){const _0x582ba5=await confirm(_0x761f53(0x1d9)+_0x37a59c+_0x761f53(0x167));if(!_0x582ba5)return console[_0x761f53(0x1c6)](_0x761f53(0x158)),0x0;}const _0x3a83a0=await withSpinner(_0x761f53(0x1a3)+_0x37a59c+_0x761f53(0x18a),()=>_0x27b47f[_0x761f53(0x183)][_0x761f53(0x1d4)](_0x37a59c),{'verbose':_0x211a37[_0x761f53(0x1df)]}),_0x4a2f76=_0x3a83a0[_0x761f53(0x16f)];return console[_0x761f53(0x1c6)](_0x761f53(0x1a8)+_0x4a2f76[_0x761f53(0x1ad)]),console['error'](_0x761f53(0x17c)+_0x4a2f76[_0x761f53(0x1d8)]),0x0;}}
|
|
1
|
+
const a44_0x5525a1=a44_0x31da;(function(_0x97c196,_0x23190b){const _0xbf111c=a44_0x31da,_0x264ded=_0x97c196();while(!![]){try{const _0x2d0e0a=parseInt(_0xbf111c(0x227))/0x1+-parseInt(_0xbf111c(0x20b))/0x2+parseInt(_0xbf111c(0x1ed))/0x3*(-parseInt(_0xbf111c(0x212))/0x4)+-parseInt(_0xbf111c(0x239))/0x5*(-parseInt(_0xbf111c(0x1b1))/0x6)+parseInt(_0xbf111c(0x1fe))/0x7*(parseInt(_0xbf111c(0x21b))/0x8)+parseInt(_0xbf111c(0x1c2))/0x9+-parseInt(_0xbf111c(0x207))/0xa;if(_0x2d0e0a===_0x23190b)break;else _0x264ded['push'](_0x264ded['shift']());}catch(_0x4c5318){_0x264ded['push'](_0x264ded['shift']());}}}(a44_0x225d,0xbe44a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x31da(_0x35b105,_0x2c6c27){_0x35b105=_0x35b105-0x1b0;const _0x225d53=a44_0x225d();let _0x31da06=_0x225d53[_0x35b105];return _0x31da06;}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a44_0x225d(){const _0x507fbe=['Error:\x20Attempt\x20ID\x20is\x20required','Expected\x20format:\x20--param\x20key=value','Show\x20logs\x20for\x20a\x20workflow\x20attempt','name','substring','workflow:run','params','Filter:\x20project=','\x20session','isDirectory','logFiles','workflow:attempt','workflow:logs','\x20\x20Attempt\x20ID:\x20','attempts','List\x20workflows','Show\x20specific\x20attempt\x20details','session','workflows','\x20\x20New\x20attempt\x20ID:\x20','Error:\x20Workflow\x20identifier\x20is\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','download','✔\x20Retry\x20started','\x20\x20Files\x20extracted:\x20','\x20task','✔\x20Found\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Project\x20ID:\x20','Filter:\x20','717gOodNB','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','List\x20workflow\x20attempts','workflow:delete','Project\x20name:\x20','message','Error:\x20Invalid\x20JSON\x20in\x20--params','sessionId','Task\x20name:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','logs','yes','success','canceling','\x20\x20Cause:\x20','...','Validation:\x20skipped','9153767VannTt','attempt','verbose','projects','split','project','task','Error:\x20','workflow:projects','3984930yYnnVT','Select\x20a\x20task\x20to\x20view\x20logs:','Usage:\x20workflow:delete\x20<project-name-or-id>','Attempt\x20ID:\x20','2506410aTZpbe','Force:\x20yes','Including\x20subtasks:\x20yes','Params:\x20','List\x20all\x20workflow\x20projects','includeRetried','Session\x20time:\x20','10196VPihPR','stringify','skipValidation','workflow:push','\x20\x20Session\x20ID:\x20','Listing\x20workflows...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','sessions','\x20\x20Revision:\x20','8NGCTdc','\x20project','stat','getTime','Retrying\x20session...','Listing\x20workflow\x20sessions...','Revision:\x20','Starting\x20workflow\x20run...','Pattern:\x20','execute','readFile','revision','1319150eWXnHu','startsWith','\x20\x20Location:\x20','error','session:','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','retrySession','retryAttemptName','param','limit','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','✔\x20Workflow\x20run\x20started','running','description','\x20\x20Workflow:\x20','\x20is\x20not\x20a\x20directory','Retry\x20a\x20session\x20or\x20attempt','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','535CEdFYI','Downloading\x20logs...','Parameters:\x20','fs/promises','isArray','round','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','projectId','Project\x20filter:\x20','Output\x20directory:\x20','Getting\x20attempt\x20details...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','length','\x22?\x20This\x20cannot\x20be\x20undone.','indexOf','keys','Project:\x20','Target:\x20','force','format','workflow','Error:\x20Project\x20name\x20is\x20required','From\x20task:\x20','workflow:attempts','cause','json','Getting\x20attempt\x20tasks...','workflow:workflows','7422sNiZrb','parse','Reason:\x20','utf-8','\x20\x20Project:\x20','index','No\x20log\x20content\x20found','Workflow:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Cancelled','✔\x20Pushed\x20','Listing\x20workflow\x20projects...','delete','status','finishedAt','attempt:','filesExtracted','2529513jzHslZ','data','workflow:tasks','select','from','Include\x20retried:\x20yes','createdAt','run','Retrying\x20attempt...','cancelRequested','fromTask','sessionTime','projectName'];a44_0x225d=function(){return _0x507fbe;};return a44_0x225d();}import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0x2ce703 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{['name']=a44_0x5525a1(0x206);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x20f);async[a44_0x5525a1(0x224)](_0x555a72){const _0x18dce0=a44_0x5525a1,{options:_0x5ba918,args:_0x3584af,tdx:_0x50e85}=_0x555a72,_0x136f33=_0x3584af[0x0];try{_0x5ba918[_0x18dce0(0x200)]&&_0x136f33&&console['error'](_0x18dce0(0x223)+_0x136f33);const _0x2f36bb=await withSpinner(_0x18dce0(0x1bc),()=>_0x50e85['workflow'][_0x18dce0(0x201)](_0x136f33,{'limit':_0x5ba918[_0x18dce0(0x230)]}),{'verbose':_0x5ba918[_0x18dce0(0x200)]}),_0x719909=_0x2f36bb['data'];return console[_0x18dce0(0x22a)](_0x18dce0(0x1e9)+_0x719909['length']+_0x18dce0(0x21c)+(_0x719909[_0x18dce0(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x719909,_0x5ba918),0x0;}catch(_0x308acb){if(_0x308acb instanceof SDKError)return console[_0x18dce0(0x22a)]('Error:\x20'+_0x308acb[_0x18dce0(0x1f2)]),_0x308acb[_0x18dce0(0x252)]&&console[_0x18dce0(0x22a)](_0x18dce0(0x1fb)+_0x308acb[_0x18dce0(0x252)]),0x1;throw _0x308acb;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1b0);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x1de);async[a44_0x5525a1(0x224)](_0x3a229c){const _0x50ef67=a44_0x5525a1,{options:_0x414d2f,args:_0x3c6cf7,tdx:_0x1cd558}=_0x3a229c,_0x2c468a=_0x3c6cf7[0x0];try{_0x414d2f[_0x50ef67(0x200)]&&_0x2c468a&&console['error'](_0x50ef67(0x241)+_0x2c468a);const _0x597701=await withSpinner(_0x50ef67(0x217),()=>_0x1cd558['workflow'][_0x50ef67(0x1e1)](_0x2c468a,{'limit':_0x414d2f[_0x50ef67(0x230)]}),{'verbose':_0x414d2f[_0x50ef67(0x200)]}),_0x353025=_0x597701['data'];return console['error']('✔\x20Found\x20'+_0x353025[_0x50ef67(0x246)]+'\x20workflow'+(_0x353025[_0x50ef67(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x353025,_0x414d2f),0x0;}catch(_0x65d068){if(_0x65d068 instanceof SDKError)return console[_0x50ef67(0x22a)](_0x50ef67(0x205)+_0x65d068[_0x50ef67(0x1f2)]),_0x65d068[_0x50ef67(0x252)]&&console['error'](_0x50ef67(0x1fb)+_0x65d068['cause']),0x1;throw _0x65d068;}}}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]='workflow:sessions';[a44_0x5525a1(0x234)]='List\x20workflow\x20execution\x20sessions';async[a44_0x5525a1(0x224)](_0x1e93ad){const _0x5b496e=a44_0x5525a1,{options:_0x1583b9,args:_0x2a4744,tdx:_0xabb219}=_0x1e93ad;let _0x51f15f,_0x3df0c6;if(_0x2a4744[0x0]){const _0x4bf160=_0x2a4744[0x0][_0x5b496e(0x202)]('.');if(_0x4bf160[_0x5b496e(0x246)]===0x1)_0x51f15f=_0x4bf160[0x0];else{if(_0x4bf160[_0x5b496e(0x246)]===0x2)[_0x51f15f,_0x3df0c6]=_0x4bf160;else return console[_0x5b496e(0x22a)](_0x5b496e(0x1ee)),0x1;}}try{if(_0x1583b9[_0x5b496e(0x200)]){if(_0x51f15f&&_0x3df0c6)console[_0x5b496e(0x22a)](_0x5b496e(0x1ec)+_0x51f15f+'.'+_0x3df0c6);else _0x51f15f&&console[_0x5b496e(0x22a)]('Filter:\x20project='+_0x51f15f);const _0x18ab7d=_0x1583b9['status'];_0x18ab7d&&console['error']('Status:\x20'+_0x18ab7d);}const _0x27f40a=await withSpinner(_0x5b496e(0x220),()=>_0xabb219[_0x5b496e(0x24e)][_0x5b496e(0x219)]({'projectName':_0x51f15f,'workflowName':_0x3df0c6,'status':_0x1583b9[_0x5b496e(0x1be)],'fromTime':_0x1583b9[_0x5b496e(0x1c6)],'toTime':_0x1583b9['to'],'limit':_0x1583b9[_0x5b496e(0x230)]}),{'verbose':_0x1583b9[_0x5b496e(0x200)]}),_0x52bfd3=_0x27f40a[_0x5b496e(0x1c3)];return console['error']('✔\x20Found\x20'+_0x52bfd3[_0x5b496e(0x246)]+_0x5b496e(0x1d7)+(_0x52bfd3['length']!==0x1?'s':'')),await handleSDKOutput(_0x52bfd3,_0x1583b9),0x0;}catch(_0x148dae){if(_0x148dae instanceof SDKError)return console[_0x5b496e(0x22a)](_0x5b496e(0x205)+_0x148dae[_0x5b496e(0x1f2)]),_0x148dae['cause']&&console[_0x5b496e(0x22a)](_0x5b496e(0x1fb)+_0x148dae['cause']),0x1;throw _0x148dae;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x251);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x1ef);async[a44_0x5525a1(0x224)](_0x494031){const _0x18bf1e=a44_0x5525a1,{options:_0x2402aa,args:_0x1b5bea,tdx:_0x4010a6}=_0x494031;let _0x365b65,_0x3fc83e;if(_0x1b5bea[0x0]){const _0x58ef33=_0x1b5bea[0x0][_0x18bf1e(0x202)]('.');if(_0x58ef33[_0x18bf1e(0x246)]===0x1)_0x365b65=_0x58ef33[0x0];else{if(_0x58ef33[_0x18bf1e(0x246)]===0x2)[_0x365b65,_0x3fc83e]=_0x58ef33;else return console[_0x18bf1e(0x22a)](_0x18bf1e(0x1ee)),0x1;}}try{const _0xfbde9b=_0x2402aa[_0x18bf1e(0x210)];if(_0x2402aa[_0x18bf1e(0x200)]){if(_0x365b65&&_0x3fc83e)console[_0x18bf1e(0x22a)](_0x18bf1e(0x1ec)+_0x365b65+'.'+_0x3fc83e);else _0x365b65&&console[_0x18bf1e(0x22a)](_0x18bf1e(0x1d6)+_0x365b65);_0xfbde9b&&console[_0x18bf1e(0x22a)](_0x18bf1e(0x1c7));}const _0x5ef6ba=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x4010a6[_0x18bf1e(0x24e)][_0x18bf1e(0x1dd)]({'projectName':_0x365b65,'workflowName':_0x3fc83e,'includeRetried':_0xfbde9b,'limit':_0x2402aa[_0x18bf1e(0x230)]}),{'verbose':_0x2402aa[_0x18bf1e(0x200)]}),_0x2bcf02=_0x5ef6ba[_0x18bf1e(0x1c3)];return console[_0x18bf1e(0x22a)](_0x18bf1e(0x1e9)+_0x2bcf02[_0x18bf1e(0x246)]+'\x20attempt'+(_0x2bcf02['length']!==0x1?'s':'')),await handleSDKOutput(_0x2bcf02,_0x2402aa),0x0;}catch(_0x1ae297){if(_0x1ae297 instanceof SDKError)return console[_0x18bf1e(0x22a)](_0x18bf1e(0x205)+_0x1ae297[_0x18bf1e(0x1f2)]),_0x1ae297[_0x18bf1e(0x252)]&&console[_0x18bf1e(0x22a)](_0x18bf1e(0x1fb)+_0x1ae297[_0x18bf1e(0x252)]),0x1;throw _0x1ae297;}}}export class WorkflowAttemptCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1da);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x1df);async[a44_0x5525a1(0x224)](_0x343fdd){const _0x341b5a=a44_0x5525a1,{options:_0x2bee2a,args:_0x172069,tdx:_0x56c341}=_0x343fdd,_0x26c4b0=_0x172069[0x0];if(!_0x26c4b0)return console[_0x341b5a(0x22a)](_0x341b5a(0x1cf)),0x1;try{_0x2bee2a[_0x341b5a(0x200)]&&console[_0x341b5a(0x22a)](_0x341b5a(0x20a)+_0x26c4b0);const _0x305cb3=await withSpinner(_0x341b5a(0x243),()=>_0x56c341['workflow'][_0x341b5a(0x1ff)](_0x26c4b0),{'verbose':_0x2bee2a[_0x341b5a(0x200)]}),_0x337f3a=_0x305cb3[_0x341b5a(0x1c3)];let _0x372b7a;!_0x337f3a['done']?_0x372b7a=_0x337f3a[_0x341b5a(0x1cb)]?_0x341b5a(0x1fa):_0x341b5a(0x233):_0x372b7a=_0x337f3a[_0x341b5a(0x1f9)]?_0x341b5a(0x1f9):'error';let _0x87c742;if(_0x337f3a[_0x341b5a(0x1c8)]&&_0x337f3a[_0x341b5a(0x1bf)]){const _0x58f2d5=new Date(_0x337f3a[_0x341b5a(0x1c8)])[_0x341b5a(0x21e)](),_0x523d73=new Date(_0x337f3a[_0x341b5a(0x1bf)])[_0x341b5a(0x21e)]();_0x87c742=Math[_0x341b5a(0x23e)]((_0x523d73-_0x58f2d5)/0x3e8);}const _0x14a73e={'attempt_id':_0x337f3a['id'],'status':_0x372b7a,..._0x337f3a[_0x341b5a(0x1b6)]!==undefined&&{'index':_0x337f3a[_0x341b5a(0x1b6)]},..._0x337f3a[_0x341b5a(0x203)]&&{'project':_0x337f3a[_0x341b5a(0x203)][_0x341b5a(0x1d2)]},..._0x337f3a[_0x341b5a(0x24e)]&&{'workflow':_0x337f3a[_0x341b5a(0x24e)][_0x341b5a(0x1d2)]},..._0x337f3a[_0x341b5a(0x1f4)]&&{'session_id':_0x337f3a[_0x341b5a(0x1f4)]},..._0x337f3a[_0x341b5a(0x1cd)]&&{'session_time':_0x337f3a['sessionTime']},..._0x337f3a['retryAttemptName']&&{'retry_attempt':_0x337f3a[_0x341b5a(0x22e)]},..._0x87c742!==undefined&&{'duration_sec':_0x87c742},..._0x337f3a[_0x341b5a(0x1c8)]&&{'created_at':_0x337f3a['createdAt']},..._0x337f3a[_0x341b5a(0x1bf)]&&{'finished_at':_0x337f3a[_0x341b5a(0x1bf)]},...Object[_0x341b5a(0x249)](_0x337f3a[_0x341b5a(0x1d5)])['length']>0x0&&{'params':_0x337f3a[_0x341b5a(0x1d5)]}};return await handleSingleObjectOutput(_0x14a73e,_0x2bee2a),0x0;}catch(_0x2c1374){if(_0x2c1374 instanceof SDKError)return console[_0x341b5a(0x22a)](_0x341b5a(0x205)+_0x2c1374['message']),_0x2c1374[_0x341b5a(0x252)]&&console[_0x341b5a(0x22a)](_0x341b5a(0x1fb)+_0x2c1374['cause']),0x1;throw _0x2c1374;}}}export class WorkflowTasksCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1c4);[a44_0x5525a1(0x234)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x432148){const _0x13a096=a44_0x5525a1,{options:_0x486e63,args:_0x7481b6,tdx:_0x16444c}=_0x432148,_0x44a01e=_0x7481b6[0x0];if(!_0x44a01e)return console[_0x13a096(0x22a)](_0x13a096(0x1cf)),0x1;try{const _0x14ea17=_0x486e63['includeSubtasks'];_0x486e63[_0x13a096(0x200)]&&(console[_0x13a096(0x22a)](_0x13a096(0x20a)+_0x44a01e),_0x14ea17&&console[_0x13a096(0x22a)](_0x13a096(0x20d)));const _0x3687f7=await withSpinner(_0x13a096(0x254),()=>_0x16444c['workflow']['tasks'](_0x44a01e,_0x14ea17||![]),{'verbose':_0x486e63[_0x13a096(0x200)]}),_0x29511e=_0x3687f7[_0x13a096(0x1c3)];return console[_0x13a096(0x22a)](_0x13a096(0x1e9)+_0x29511e['length']+_0x13a096(0x1e8)+(_0x29511e[_0x13a096(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x29511e,_0x486e63),0x0;}catch(_0x2f5769){if(_0x2f5769 instanceof SDKError)return console[_0x13a096(0x22a)](_0x13a096(0x205)+_0x2f5769['message']),_0x2f5769['cause']&&console['error'](_0x13a096(0x1fb)+_0x2f5769[_0x13a096(0x252)]),0x1;throw _0x2f5769;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1db);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x1d1);async[a44_0x5525a1(0x224)](_0x4fed4f){const _0x47405a=a44_0x5525a1,{options:_0x121e48,args:_0x230718,tdx:_0x1c1a54}=_0x4fed4f,_0x102357=_0x230718[0x0];let _0x2a8a29=_0x230718[0x1];if(!_0x102357)return console[_0x47405a(0x22a)](_0x47405a(0x1cf)),0x1;try{_0x121e48[_0x47405a(0x200)]&&(console[_0x47405a(0x22a)](_0x47405a(0x20a)+_0x102357),_0x2a8a29&&console['error'](_0x47405a(0x1f5)+_0x2a8a29));const _0x2439a8=await withSpinner('Fetching\x20log\x20files...',()=>_0x1c1a54[_0x47405a(0x24e)][_0x47405a(0x1d9)](_0x102357,_0x2a8a29),{'verbose':_0x121e48[_0x47405a(0x200)]}),_0xfb55a8=_0x2439a8['data'];if(_0xfb55a8[_0x47405a(0x246)]===0x0)return console[_0x47405a(0x22a)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2a8a29&&(_0x121e48[_0x47405a(0x253)]||_0x121e48[_0x47405a(0x24d)]))return await handleSDKOutput(_0xfb55a8,_0x121e48),0x0;if(!_0x2a8a29){const _0x3a1486=_0xfb55a8['map'](_0x2db09a=>({'title':_0x2db09a['taskName']+'\x20('+formatBytes(_0x2db09a['fileSize'])+')','value':_0x2db09a['taskName']})),_0x18ff62=await a44_0x2ce703({'type':_0x47405a(0x1c5),'name':_0x47405a(0x204),'message':_0x47405a(0x208),'choices':_0x3a1486});if(!_0x18ff62[_0x47405a(0x204)])return console['error'](_0x47405a(0x1ba)),0x0;_0x2a8a29=_0x18ff62[_0x47405a(0x204)];}const _0x260901=await withSpinner(_0x47405a(0x23a),()=>_0x1c1a54[_0x47405a(0x24e)][_0x47405a(0x1f7)](_0x102357,_0x2a8a29),{'verbose':_0x121e48['verbose']}),_0x5e173c=_0x260901[_0x47405a(0x1c3)];return _0x5e173c?console['log'](_0x5e173c):console['error'](_0x47405a(0x1b7)),0x0;}catch(_0x77444a){if(_0x77444a instanceof SDKError)return console[_0x47405a(0x22a)](_0x47405a(0x205)+_0x77444a[_0x47405a(0x1f2)]),_0x77444a[_0x47405a(0x252)]&&console[_0x47405a(0x22a)]('\x20\x20Cause:\x20'+_0x77444a[_0x47405a(0x252)]),0x1;throw _0x77444a;}}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a44_0x5525a1(0x234)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x1ff8ff){const _0x572643=a44_0x5525a1,{options:_0x4faf3d,args:_0x36f5d9,tdx:_0x2ba218}=_0x1ff8ff,_0x97dd53=_0x36f5d9[0x0];if(!_0x97dd53)return console['error'](_0x572643(0x1cf)),0x1;try{const _0x3f29a9=_0x4faf3d['reason'];_0x4faf3d[_0x572643(0x200)]&&(console['error'](_0x572643(0x20a)+_0x97dd53),_0x3f29a9&&console[_0x572643(0x22a)](_0x572643(0x1b3)+_0x3f29a9));if(!_0x4faf3d[_0x572643(0x1f8)]){const _0x41383b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x97dd53+'?');if(!_0x41383b)return console[_0x572643(0x22a)](_0x572643(0x1ba)),0x0;}const _0x1b1b41=await withSpinner('Killing\x20attempt...',()=>_0x2ba218[_0x572643(0x24e)]['kill'](_0x97dd53,_0x3f29a9),{'verbose':_0x4faf3d[_0x572643(0x200)]}),_0x17b44a=_0x1b1b41[_0x572643(0x1c3)];return console[_0x572643(0x22a)]('✔\x20'+_0x17b44a),0x0;}catch(_0x56e9fc){if(_0x56e9fc instanceof SDKError)return console[_0x572643(0x22a)](_0x572643(0x205)+_0x56e9fc[_0x572643(0x1f2)]),_0x56e9fc[_0x572643(0x252)]&&console[_0x572643(0x22a)](_0x572643(0x1fb)+_0x56e9fc[_0x572643(0x252)]),0x1;throw _0x56e9fc;}}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';['description']=a44_0x5525a1(0x237);async[a44_0x5525a1(0x224)](_0x24ef6b){const _0x4572d6=a44_0x5525a1,{options:_0x35e8b5,args:_0x5081c9,tdx:_0x263f99}=_0x24ef6b,_0x2acf4b=_0x5081c9[0x0];if(!_0x2acf4b)return console[_0x4572d6(0x22a)](_0x4572d6(0x1e4)),console[_0x4572d6(0x22a)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2b21a8=![],_0x5a90cf=_0x2acf4b;if(_0x2acf4b[_0x4572d6(0x228)](_0x4572d6(0x22b)))_0x2b21a8=!![],_0x5a90cf=_0x2acf4b['substring'](0x8);else{if(_0x2acf4b[_0x4572d6(0x228)](_0x4572d6(0x1c0)))_0x2b21a8=![],_0x5a90cf=_0x2acf4b[_0x4572d6(0x1d3)](0x8);else return console[_0x4572d6(0x22a)](_0x4572d6(0x231)),console['error'](_0x4572d6(0x22c)),0x1;}try{const _0x247209=_0x35e8b5[_0x4572d6(0x1cc)],_0x469575=_0x35e8b5['resumeFrom'],_0x2768b2=_0x35e8b5[_0x4572d6(0x1d5)],_0x332d2b=_0x35e8b5[_0x4572d6(0x24c)];_0x35e8b5[_0x4572d6(0x200)]&&(console['error'](_0x4572d6(0x24b)+(_0x2b21a8?_0x4572d6(0x1e0):_0x4572d6(0x1ff))+'\x20'+_0x5a90cf),_0x247209&&console[_0x4572d6(0x22a)](_0x4572d6(0x250)+_0x247209),_0x469575&&console[_0x4572d6(0x22a)]('Resume\x20from:\x20'+_0x469575),_0x2768b2&&console['error'](_0x4572d6(0x20e)+_0x2768b2),_0x332d2b&&console[_0x4572d6(0x22a)](_0x4572d6(0x20c)));let _0x16d5ff;if(_0x2768b2)try{if(_0x2768b2['startsWith']('@')){const _0x5118c7=await import(_0x4572d6(0x23c)),_0x19dba0=_0x2768b2[_0x4572d6(0x1d3)](0x1),_0x5dfb68=await _0x5118c7[_0x4572d6(0x225)](_0x19dba0,_0x4572d6(0x1b4));_0x16d5ff=JSON['parse'](_0x5dfb68);}else _0x16d5ff=JSON[_0x4572d6(0x1b2)](_0x2768b2);}catch{return console[_0x4572d6(0x22a)](_0x4572d6(0x1f3)),0x1;}if(!_0x35e8b5[_0x4572d6(0x1f8)]){const _0x44fd52=await confirm(_0x4572d6(0x218)+(_0x2b21a8?_0x4572d6(0x1e0):_0x4572d6(0x1ff))+'\x20'+_0x5a90cf+'?');if(!_0x44fd52)return console[_0x4572d6(0x22a)]('Cancelled'),0x0;}let _0x5da4f0;_0x2b21a8?_0x5da4f0=await withSpinner(_0x4572d6(0x21f),()=>_0x263f99[_0x4572d6(0x24e)][_0x4572d6(0x22d)](_0x5a90cf,{'fromTask':_0x247209,'retryParams':_0x16d5ff}),{'verbose':_0x35e8b5[_0x4572d6(0x200)]}):_0x5da4f0=await withSpinner(_0x4572d6(0x1ca),()=>_0x263f99[_0x4572d6(0x24e)]['retryAttempt'](_0x5a90cf,{'resumeFrom':_0x469575,'retryParams':_0x16d5ff,'force':_0x332d2b}),{'verbose':_0x35e8b5[_0x4572d6(0x200)]});const _0x1bf875=_0x5da4f0[_0x4572d6(0x1c3)];return console[_0x4572d6(0x22a)](_0x4572d6(0x1e6)),console[_0x4572d6(0x22a)](_0x4572d6(0x1e2)+_0x1bf875['attemptId']),console[_0x4572d6(0x22a)](_0x4572d6(0x216)+_0x1bf875[_0x4572d6(0x1f4)]),0x0;}catch(_0x33088f){if(_0x33088f instanceof SDKError)return console[_0x4572d6(0x22a)](_0x4572d6(0x205)+_0x33088f[_0x4572d6(0x1f2)]),_0x33088f[_0x4572d6(0x252)]&&console['error'](_0x4572d6(0x1fb)+_0x33088f['cause']),0x1;throw _0x33088f;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1d4);[a44_0x5525a1(0x234)]='Start\x20a\x20workflow\x20run';async[a44_0x5525a1(0x224)](_0x24e253){const _0x23c951=a44_0x5525a1,{options:_0x5c0a46,args:_0x4d6c56,tdx:_0x31e7a2}=_0x24e253,_0x2041db=_0x4d6c56[0x0];if(!_0x2041db)return console[_0x23c951(0x22a)](_0x23c951(0x1e3)),console['error'](_0x23c951(0x245)),0x1;const _0x3d43e9=_0x5c0a46[_0x23c951(0x22f)],_0x4b5ffa=_0x5c0a46['sessionTime'],_0x17e849={};if(_0x3d43e9&&Array[_0x23c951(0x23d)](_0x3d43e9))for(const _0x293b69 of _0x3d43e9){const _0x3328c9=_0x293b69[_0x23c951(0x248)]('=');if(_0x3328c9===-0x1)return console[_0x23c951(0x22a)](_0x23c951(0x1f6)+_0x293b69),console['error'](_0x23c951(0x1d0)),0x1;const _0x487377=_0x293b69[_0x23c951(0x1d3)](0x0,_0x3328c9),_0x15552d=_0x293b69['substring'](_0x3328c9+0x1);try{_0x17e849[_0x487377]=JSON[_0x23c951(0x1b2)](_0x15552d);}catch{_0x17e849[_0x487377]=_0x15552d;}}_0x5c0a46[_0x23c951(0x200)]&&(console['error'](_0x23c951(0x1b8)+_0x2041db),Object['keys'](_0x17e849)[_0x23c951(0x246)]>0x0&&console[_0x23c951(0x22a)](_0x23c951(0x23b)+JSON[_0x23c951(0x213)](_0x17e849)),_0x4b5ffa&&console[_0x23c951(0x22a)](_0x23c951(0x211)+_0x4b5ffa));const _0x27af1e=await withSpinner(_0x23c951(0x222),()=>_0x31e7a2[_0x23c951(0x24e)][_0x23c951(0x1c9)](_0x2041db,_0x17e849,{'sessionTime':_0x4b5ffa}),{'verbose':_0x5c0a46['verbose']}),_0x1ffda2=_0x27af1e[_0x23c951(0x1c3)];return console[_0x23c951(0x22a)](_0x23c951(0x232)),console[_0x23c951(0x22a)](_0x23c951(0x1dc)+_0x1ffda2['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x1ffda2[_0x23c951(0x1f4)]),console[_0x23c951(0x22a)](_0x23c951(0x1b5)+_0x1ffda2[_0x23c951(0x203)]?.['name']),console['error'](_0x23c951(0x235)+_0x1ffda2[_0x23c951(0x24e)]?.[_0x23c951(0x1d2)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]='workflow:download';[a44_0x5525a1(0x234)]=a44_0x5525a1(0x244);async[a44_0x5525a1(0x224)](_0x1adf41){const _0xffacb3=a44_0x5525a1,{options:_0x3c739c,args:_0x57f4fc,tdx:_0xd76216}=_0x1adf41,_0x5dd22d=_0x57f4fc[0x0],_0x582422=_0x57f4fc[0x1]||'.';if(!_0x5dd22d)return console[_0xffacb3(0x22a)](_0xffacb3(0x24f)),console['error'](_0xffacb3(0x238)),0x1;const _0x2089a0=_0x3c739c[_0xffacb3(0x226)];_0x3c739c[_0xffacb3(0x200)]&&(console[_0xffacb3(0x22a)](_0xffacb3(0x24a)+_0x5dd22d),console[_0xffacb3(0x22a)](_0xffacb3(0x242)+_0x582422),_0x2089a0&&console['error']('Revision:\x20'+_0x2089a0));const _0x569880=await withSpinner('Downloading\x20project\x20'+_0x5dd22d+_0xffacb3(0x1fc),()=>_0xd76216[_0xffacb3(0x24e)][_0xffacb3(0x1e5)](_0x5dd22d,_0x582422,{'revision':_0x2089a0}),{'verbose':_0x3c739c[_0xffacb3(0x200)]}),_0x34421b=_0x569880[_0xffacb3(0x1c3)];return console[_0xffacb3(0x22a)]('✔\x20Downloaded\x20'+_0x34421b[_0xffacb3(0x1ce)]),console[_0xffacb3(0x22a)](_0xffacb3(0x21a)+_0x34421b[_0xffacb3(0x226)]),console[_0xffacb3(0x22a)](_0xffacb3(0x1e7)+_0x34421b[_0xffacb3(0x1c1)]),console[_0xffacb3(0x22a)](_0xffacb3(0x229)+_0x582422+'/'+_0x34421b[_0xffacb3(0x1ce)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x215);[a44_0x5525a1(0x234)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a44_0x5525a1(0x224)](_0x3fbdaf){const _0x697190=a44_0x5525a1,{options:_0x2f86d8,args:_0x227533,tdx:_0x1c0a86}=_0x3fbdaf;let _0x1db126='.',_0x474d6e=_0x2f86d8[_0x697190(0x1d2)];if(_0x227533[0x0]){const {promises:_0x514ebf}=await import('fs');try{const _0x528fbc=await _0x514ebf[_0x697190(0x21d)](_0x227533[0x0]);if(_0x528fbc[_0x697190(0x1d8)]())_0x1db126=_0x227533[0x0];else return console[_0x697190(0x22a)](_0x697190(0x205)+_0x227533[0x0]+_0x697190(0x236)),0x1;}catch{_0x474d6e=_0x227533[0x0],_0x1db126='.';}}const _0x41767e=_0x2f86d8[_0x697190(0x226)],_0x30cc5d=_0x2f86d8[_0x697190(0x214)];_0x2f86d8['verbose']&&(console[_0x697190(0x22a)]('Project\x20directory:\x20'+_0x1db126),_0x474d6e&&console[_0x697190(0x22a)](_0x697190(0x1f1)+_0x474d6e),_0x41767e&&console[_0x697190(0x22a)](_0x697190(0x221)+_0x41767e),_0x30cc5d&&console['error'](_0x697190(0x1fd)));const _0x3d1e85=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x1c0a86[_0x697190(0x24e)]['push'](_0x1db126,{'projectName':_0x474d6e,'revision':_0x41767e,'skipValidation':_0x30cc5d}),{'verbose':_0x2f86d8[_0x697190(0x200)]}),_0x1fb749=_0x3d1e85[_0x697190(0x1c3)];return console[_0x697190(0x22a)](_0x697190(0x1bb)+_0x1fb749[_0x697190(0x1ce)]),console['error'](_0x697190(0x1eb)+_0x1fb749['projectId']),console[_0x697190(0x22a)](_0x697190(0x21a)+_0x1fb749[_0x697190(0x226)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x5525a1(0x1d2)]=a44_0x5525a1(0x1f0);[a44_0x5525a1(0x234)]=a44_0x5525a1(0x23f);async[a44_0x5525a1(0x224)](_0x58ca15){const _0x525578=a44_0x5525a1,{options:_0x15974e,args:_0x458c40,tdx:_0x35586a}=_0x58ca15,_0x460f3d=_0x458c40[0x0];if(!_0x460f3d)return console[_0x525578(0x22a)](_0x525578(0x1ea)),console[_0x525578(0x22a)](_0x525578(0x209)),0x1;_0x15974e[_0x525578(0x200)]&&console[_0x525578(0x22a)](_0x525578(0x24a)+_0x460f3d);if(!_0x15974e['yes']){const _0x323254=await confirm(_0x525578(0x1b9)+_0x460f3d+_0x525578(0x247));if(!_0x323254)return console[_0x525578(0x22a)]('Cancelled'),0x0;}const _0x1ae94f=await withSpinner('Deleting\x20project\x20'+_0x460f3d+_0x525578(0x1fc),()=>_0x35586a[_0x525578(0x24e)][_0x525578(0x1bd)](_0x460f3d),{'verbose':_0x15974e[_0x525578(0x200)]}),_0x1b0e68=_0x1ae94f[_0x525578(0x1c3)];return console[_0x525578(0x22a)]('✔\x20Deleted\x20project\x20'+_0x1b0e68['projectName']),console[_0x525578(0x22a)](_0x525578(0x1eb)+_0x1b0e68[_0x525578(0x240)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a4921,_0x2ec841){const _0x3a43d6=a45_0x1d18,_0x3a9a22=_0x3a4921();while(!![]){try{const _0x2bf37b=-parseInt(_0x3a43d6(0x179))/0x1+-parseInt(_0x3a43d6(0x168))/0x2*(parseInt(_0x3a43d6(0x175))/0x3)+-parseInt(_0x3a43d6(0x172))/0x4*(parseInt(_0x3a43d6(0x16f))/0x5)+parseInt(_0x3a43d6(0x16d))/0x6*(parseInt(_0x3a43d6(0x171))/0x7)+parseInt(_0x3a43d6(0x178))/0x8+-parseInt(_0x3a43d6(0x16b))/0x9+parseInt(_0x3a43d6(0x17a))/0xa;if(_0x2bf37b===_0x2ec841)break;else _0x3a9a22['push'](_0x3a9a22['shift']());}catch(_0x17220a){_0x3a9a22['push'](_0x3a9a22['shift']());}}}(a45_0x593d,0xa44bc));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a45_0x593d(){const _0x13416b=['571516hwEGDi','parse','version','4714722QWQNeX','entries','4482ChzKxN','length','8065xEncMz','0.0.0','4837pSuFHF','424zfFwFN','Authorization','../../package.json','6zJDZue','tdx','tdx/','4717560KgZrOe','108708YrAocL','9421440LHJpVT','TD1\x20'];a45_0x593d=function(){return _0x13416b;};return a45_0x593d();}import{getAPIKey}from'./config.js';function a45_0x1d18(_0x23893c,_0x4cedfa){_0x23893c=_0x23893c-0x168;const _0x593ddf=a45_0x593d();let _0x1d18e3=_0x593ddf[_0x23893c];return _0x1d18e3;}export function getVersion(){const _0x184e7f=a45_0x1d18;try{const _0x194173=fileURLToPath(import.meta.url),_0x465b99=dirname(_0x194173),_0x4f087e=join(_0x465b99,_0x184e7f(0x174)),_0x48f937=JSON[_0x184e7f(0x169)](readFileSync(_0x4f087e,'utf-8'));return _0x48f937[_0x184e7f(0x16a)];}catch{return _0x184e7f(0x170);}}export function getUserAgent(){const _0x125fc6=a45_0x1d18,_0x15d5c3=getVersion(),_0xcb013d=platform(),_0xe523bc=process[_0x125fc6(0x16a)]['replace']('v','');return _0x125fc6(0x177)+_0x15d5c3+'\x20('+_0xcb013d+';\x20node/'+_0xe523bc+')';}export function getAuthHeaders(_0x30b5de,_0x143f63){const _0x3bddd6=a45_0x1d18,_0x3333bb=getVersion(),_0x20bdd6={'User-Agent':getUserAgent(),'X-TD-Client':_0x3bddd6(0x176),'X-TD-Client-Version':_0x3333bb};return _0x143f63&&(_0x20bdd6[_0x3bddd6(0x173)]=_0x3bddd6(0x17b)+_0x143f63),_0x20bdd6;}export function toHeaderRecord(_0x485aaf){const _0x4a504e=a45_0x1d18,_0x99efb9={};for(const [_0x3a9294,_0x49e597]of Object[_0x4a504e(0x16c)](_0x485aaf)){_0x49e597!==undefined&&(_0x99efb9[_0x3a9294]=_0x49e597);}return _0x99efb9;}export function getTrinoHeaders(_0x1f68e8,_0x24564a){const _0x32f238=a45_0x1d18,_0x186b8d=getAuthHeaders(_0x1f68e8,_0x24564a),_0x5aff8b=toHeaderRecord(_0x186b8d);return delete _0x5aff8b[_0x32f238(0x173)],_0x24564a&&(_0x5aff8b['X-Trino-User']=_0x24564a),_0x5aff8b;}export function hasAPIKey(_0x739473){const _0x3ee382=a45_0x1d18,_0x2ffddc=getAPIKey(_0x739473);return _0x2ffddc!==undefined&&_0x2ffddc[_0x3ee382(0x16e)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x251d4a,_0x103197){const _0x2e9ae3=a46_0x4142,_0x32f0f6=_0x251d4a();while(!![]){try{const _0x1345ec=parseInt(_0x2e9ae3(0x236))/0x1+parseInt(_0x2e9ae3(0x1ed))/0x2+parseInt(_0x2e9ae3(0x223))/0x3*(-parseInt(_0x2e9ae3(0x1f3))/0x4)+-parseInt(_0x2e9ae3(0x20c))/0x5*(-parseInt(_0x2e9ae3(0x221))/0x6)+-parseInt(_0x2e9ae3(0x21f))/0x7*(-parseInt(_0x2e9ae3(0x21b))/0x8)+-parseInt(_0x2e9ae3(0x226))/0x9*(parseInt(_0x2e9ae3(0x1ee))/0xa)+-parseInt(_0x2e9ae3(0x234))/0xb*(-parseInt(_0x2e9ae3(0x209))/0xc);if(_0x1345ec===_0x103197)break;else _0x32f0f6['push'](_0x32f0f6['shift']());}catch(_0x1d9909){_0x32f0f6['push'](_0x32f0f6['shift']());}}}(a46_0x564c,0x4bdde));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x3a5bc4 from'node:fs';import*as a46_0x599f93 from'node:path';import{SITE_ALIASES}from'../types/index.js';function a46_0x564c(){const _0x47af9f=['Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','toISOString','eu01','keychain\x20(profile:\x20','yellow','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','dev-us01','profiles','split','join','replace','8NrVLei','number','ap02','TDX_API_KEY','517153kADJkJ','account_info.json','1189194Ihezuk','account_info.','6FPrtRx','string','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','9LnXZeb','startsWith','apiKeys','stg-ap03','isDeprecated','stg-us01','projectId','TD_API_KEY','apiKey','.env.','TD_API_KEY_','llm_default_agent','parse','TDX_CACHE_DIR','2475110zwfdtm','tdx','263129yZOfco','keychain','accountId','stg-jp01','legacy\x20.env\x20file','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','legacy\x20.env\x20file\x20(profile:\x20','Warning:\x20Failed\x20to\x20load\x20','utf-8','572846ihGOCK','3759010AkpMyU','stringify','map','profile','.env','1116376sjZCaa','readFileSync','entries','llm_default_agent.','name','match','toUpperCase','endsWith','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','jp01','dev-eu01','TDX_API_KEY\x20env\x20var','existsSync','env','TDX_API_KEY_<PROFILE>','includes','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','llm_default_project.','TDX_CONFIG_DIR','\x20env\x20var','ap03','warn','12bUIKcA','TDX_API_KEY_','trim','10nJiDlS','us01','Warning:\x20Unknown\x20site\x20\x27','site'];a46_0x564c=function(){return _0x47af9f;};return a46_0x564c();}import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a46_0x541372 from'chalk';export function getConfigDir(){const _0x394a5a=a46_0x4142;return process[_0x394a5a(0x200)][_0x394a5a(0x205)]||join(homedir(),'.config',_0x394a5a(0x235));}export function getConfigFile(){const _0x56280e=a46_0x4142;return join(getConfigDir(),_0x56280e(0x1f2));}export function getConfigFilePath(_0x5f4dec){const _0x35b840=a46_0x4142,_0x504248=getConfigDir();return _0x5f4dec?a46_0x599f93[_0x35b840(0x219)](_0x504248,_0x35b840(0x22f)+_0x5f4dec):getConfigFile();}export function getCacheDir(){const _0x557380=a46_0x4142;return process['env'][_0x557380(0x233)]||join(homedir(),'.cache',_0x557380(0x235));}export function getLLMProjectCacheFile(_0x4d3b29){const _0x2fd145=a46_0x4142,_0x3216b8=_0x4d3b29?_0x2fd145(0x204)+_0x4d3b29:'llm_default_project';return join(getCacheDir(),_0x3216b8);}export function readCachedLLMProject(_0x2ced6a){const _0x36383f=a46_0x4142;try{const _0x55abc5=getLLMProjectCacheFile(_0x2ced6a);if(!existsSync(_0x55abc5))return null;const _0x122f6b=readFileSync(_0x55abc5,_0x36383f(0x1ec))[_0x36383f(0x20b)]();try{const _0x5a5911=JSON['parse'](_0x122f6b);if(_0x5a5911&&typeof _0x5a5911['id']===_0x36383f(0x224)&&typeof _0x5a5911['name']==='string')return _0x5a5911;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x3e6f03,_0x5e332b,_0x4d5778){const _0x154df3=a46_0x4142;try{const _0x1d345b=getCacheDir(),_0x265571=getLLMProjectCacheFile(_0x4d5778);!existsSync(_0x1d345b)&&mkdirSync(_0x1d345b,{'recursive':!![]});const _0x268257={'name':_0x3e6f03,'id':_0x5e332b};writeFileSync(_0x265571,JSON[_0x154df3(0x1ef)](_0x268257),_0x154df3(0x1ec));}catch{}}export function getLLMAgentCacheFile(_0x31909d){const _0x1ad453=a46_0x4142,_0x378a9c=_0x31909d?_0x1ad453(0x1f6)+_0x31909d:_0x1ad453(0x231);return join(getCacheDir(),_0x378a9c);}export function readCachedLLMAgent(_0x2e9420){const _0xe980b3=a46_0x4142;try{const _0x139180=getLLMAgentCacheFile(_0x2e9420);if(!existsSync(_0x139180))return null;const _0x28babd=readFileSync(_0x139180,_0xe980b3(0x1ec))[_0xe980b3(0x20b)]();try{const _0x27273c=JSON[_0xe980b3(0x232)](_0x28babd);if(_0x27273c&&typeof _0x27273c['id']===_0xe980b3(0x224)&&typeof _0x27273c[_0xe980b3(0x1f7)]===_0xe980b3(0x224)&&typeof _0x27273c[_0xe980b3(0x22c)]==='string')return _0x27273c;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x5eb5fe,_0x3f3aa0,_0x1fcd62,_0x865cd3){const _0x29027b=a46_0x4142;try{const _0x5d9b7d=getCacheDir(),_0xef1705=getLLMAgentCacheFile(_0x865cd3);!existsSync(_0x5d9b7d)&&mkdirSync(_0x5d9b7d,{'recursive':!![]});const _0x225707={'name':_0x5eb5fe,'id':_0x3f3aa0,'projectId':_0x1fcd62};writeFileSync(_0xef1705,JSON['stringify'](_0x225707),_0x29027b(0x1ec));}catch{}}export function clearCachedLLMAgent(_0x3852a5){try{const _0x4a07bc=getLLMAgentCacheFile(_0x3852a5);existsSync(_0x4a07bc)&&unlinkSync(_0x4a07bc);}catch{}}export function getAccountInfoCacheFile(_0xb6844c){const _0x3d1b85=a46_0x4142,_0x52396f=_0xb6844c?_0x3d1b85(0x222)+_0xb6844c+'.json':_0x3d1b85(0x220);return join(getCacheDir(),_0x52396f);}export function readCachedAccountInfo(_0x1fa246){const _0x55f13f=a46_0x4142;try{const _0x247ba0=getAccountInfoCacheFile(_0x1fa246);if(!existsSync(_0x247ba0))return null;const _0x3f9aea=readFileSync(_0x247ba0,_0x55f13f(0x1ec))[_0x55f13f(0x20b)](),_0x468a2a=JSON['parse'](_0x3f9aea);if(_0x468a2a&&typeof _0x468a2a[_0x55f13f(0x20f)]===_0x55f13f(0x224)&&typeof _0x468a2a[_0x55f13f(0x1e6)]===_0x55f13f(0x21c))return _0x468a2a;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x3f6366,_0x35b27d,_0x276516){const _0x3c7e83=a46_0x4142;try{const _0x5d2682=getCacheDir(),_0x4b8411=getAccountInfoCacheFile(_0x276516);!existsSync(_0x5d2682)&&mkdirSync(_0x5d2682,{'recursive':!![]});const _0x50b519={'site':_0x3f6366,'accountId':_0x35b27d,'cachedAt':new Date()[_0x3c7e83(0x211)]()};writeFileSync(_0x4b8411,JSON['stringify'](_0x50b519),_0x3c7e83(0x1ec));}catch{}}export function parseEnvFile(_0x33dce2){const _0xde0ec9=a46_0x4142,_0x4d5901={};for(const _0x3977aa of _0x33dce2['split']('\x0a')){const _0x3b03bd=_0x3977aa['trim']();if(!_0x3b03bd||_0x3b03bd['startsWith']('#'))continue;const _0x5bca67=_0x3b03bd[_0xde0ec9(0x1f8)](/^([^=]+)=(.*)$/);if(_0x5bca67){const _0x314106=_0x5bca67[0x1][_0xde0ec9(0x20b)]();let _0x300a1d=_0x5bca67[0x2][_0xde0ec9(0x20b)]();(_0x300a1d[_0xde0ec9(0x227)]('\x22')&&_0x300a1d[_0xde0ec9(0x1fa)]('\x22')||_0x300a1d['startsWith']('\x27')&&_0x300a1d['endsWith']('\x27'))&&(_0x300a1d=_0x300a1d['slice'](0x1,-0x1)),_0x4d5901[_0x314106]=_0x300a1d;}}return _0x4d5901;}export function readUserConfig(){const _0x46aefa=a46_0x4142,_0x43a2be=getConfigFile();if(!existsSync(_0x43a2be))return{};try{const _0x95043b=readFileSync(_0x43a2be,'utf-8');return parseEnvFile(_0x95043b);}catch(_0x4cb4a1){return console[_0x46aefa(0x208)](_0x46aefa(0x210)+_0x43a2be+':',_0x4cb4a1),{};}}function a46_0x4142(_0x2995d,_0x45411d){_0x2995d=_0x2995d-0x1e5;const _0x564cf8=a46_0x564c();let _0x41422c=_0x564cf8[_0x2995d];return _0x41422c;}export function resolveSite(_0x4fdac4){const _0x43e7b4=a46_0x4142,_0xe7d29=[_0x43e7b4(0x20d),_0x43e7b4(0x1fc),_0x43e7b4(0x212),_0x43e7b4(0x21d),_0x43e7b4(0x207),_0x43e7b4(0x216),_0x43e7b4(0x1fd),_0x43e7b4(0x22b),_0x43e7b4(0x1e7),'stg-ap03'];if(_0xe7d29[_0x43e7b4(0x202)](_0x4fdac4))return _0x4fdac4;if(_0x4fdac4 in SITE_ALIASES)return SITE_ALIASES[_0x4fdac4];return console[_0x43e7b4(0x208)](_0x43e7b4(0x20e)+_0x4fdac4+'\x27,\x20defaulting\x20to\x20us01'),_0x43e7b4(0x20d);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x2fd6ae,_0x7148b3){const _0x27cca7=a46_0x4142,_0x45fc8f=_0x7148b3||getActiveProfileName();if(_0x45fc8f){const _0x1b9b58=_0x27cca7(0x20a)+normalizeProfileForEnvVar(_0x45fc8f);if(process[_0x27cca7(0x200)][_0x1b9b58])return process[_0x27cca7(0x200)][_0x1b9b58];}if(process[_0x27cca7(0x200)][_0x27cca7(0x21e)])return process[_0x27cca7(0x200)][_0x27cca7(0x21e)];if(process[_0x27cca7(0x200)]['TD_API_KEY'])return process[_0x27cca7(0x200)]['TD_API_KEY'];const _0x55be87=_0x2fd6ae['toUpperCase']()[_0x27cca7(0x21a)](/-/g,'_'),_0xcc5e12=_0x27cca7(0x230)+_0x55be87;if(_0x45fc8f){const _0x23a215=loadProfileEnv(_0x45fc8f);if(_0x23a215){if(_0x23a215[_0xcc5e12])return _0x23a215[_0xcc5e12];if(_0x23a215[_0x27cca7(0x22d)])return _0x23a215[_0x27cca7(0x22d)];}}const _0x33cc61=loadUserConfigOnce();if(_0x33cc61[_0xcc5e12])return _0x33cc61[_0xcc5e12];if(_0x33cc61[_0x27cca7(0x22d)])return _0x33cc61[_0x27cca7(0x22d)];return undefined;}export function normalizeProfileForEnvVar(_0x6d57fc){const _0x454d8c=a46_0x4142;return _0x6d57fc[_0x454d8c(0x1f9)]()[_0x454d8c(0x21a)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x567192,_0x2613ec){const _0xa19dc1=a46_0x4142,_0x34605a=_0x2613ec||getActiveProfileName()||undefined;if(_0x34605a){const _0x5e90da=_0xa19dc1(0x20a)+normalizeProfileForEnvVar(_0x34605a);if(process['env'][_0x5e90da])return{'apiKey':process[_0xa19dc1(0x200)][_0x5e90da],'source':_0x5e90da+_0xa19dc1(0x206),'isDeprecated':![]};const _0x408160=getCachedCredential(_0x567192,_0x34605a);if(_0x408160)return{'apiKey':_0x408160,'source':_0xa19dc1(0x213)+_0x34605a+')','isDeprecated':![]};const _0x1f05b8=await getKeychainAPIKey(_0x34605a);if(_0x1f05b8)return setCachedCredential(_0x1f05b8,_0x567192,_0x34605a),{'apiKey':_0x1f05b8,'source':'keychain\x20(profile:\x20'+_0x34605a+')','isDeprecated':![]};}if(process[_0xa19dc1(0x200)][_0xa19dc1(0x21e)])return{'apiKey':process[_0xa19dc1(0x200)][_0xa19dc1(0x21e)],'source':_0xa19dc1(0x1fe),'isDeprecated':![]};if(!_0x34605a){const _0xd2d88c=getCachedCredential(_0x567192,undefined);if(_0xd2d88c)return{'apiKey':_0xd2d88c,'source':'keychain','isDeprecated':![]};const _0x2c0f92=await getKeychainAPIKey(undefined);if(_0x2c0f92)return setCachedCredential(_0x2c0f92,_0x567192,undefined),{'apiKey':_0x2c0f92,'source':_0xa19dc1(0x1e5),'isDeprecated':![]};}if(process[_0xa19dc1(0x200)]['TD_API_KEY'])return{'apiKey':process[_0xa19dc1(0x200)][_0xa19dc1(0x22d)],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x48a8ce=getLegacyEnvAPIKey(_0x567192,_0x34605a);if(_0x48a8ce){const _0x3555d1=await isKeychainAvailable();if(_0x3555d1)try{await saveKeychainAPIKey(_0x48a8ce,_0x34605a),setCachedCredential(_0x48a8ce,_0x567192,_0x34605a);const _0xd830=getConfigFilePath(_0x34605a);cleanupLegacyEnvFile(_0xd830)&&console[_0xa19dc1(0x208)](a46_0x541372[_0xa19dc1(0x214)](_0xa19dc1(0x203)));}catch(_0x4560fd){console['warn'](a46_0x541372[_0xa19dc1(0x214)](_0xa19dc1(0x1fb)+_0x4560fd));}const _0x442d92=_0x34605a?_0xa19dc1(0x1ea)+_0x34605a+')':_0xa19dc1(0x1e8);return{'apiKey':_0x48a8ce,'source':_0x442d92,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x4138c7,_0x436127,_0x7c22f4=!![]){const _0xd53fd2=a46_0x4142,_0x5b89a2=await resolveAPIKeyAsync(_0x4138c7,_0x436127);if(!_0x5b89a2)return undefined;if(_0x7c22f4&&_0x5b89a2[_0xd53fd2(0x22a)]&&_0x5b89a2['source']['includes']('TD_API_KEY')){const _0x4d9cdb=_0x436127||getActiveProfileName()||undefined,_0x38c710=_0x4d9cdb?_0xd53fd2(0x20a)+normalizeProfileForEnvVar(_0x4d9cdb):_0xd53fd2(0x201);console[_0xd53fd2(0x208)](a46_0x541372[_0xd53fd2(0x214)](_0xd53fd2(0x215)+(_0xd53fd2(0x1e9)+_0x38c710+').')));}return _0x5b89a2[_0xd53fd2(0x22e)];}function getLegacyEnvAPIKey(_0x3ff9e9,_0x87602e){const _0x2b8dd5=a46_0x4142,_0x36309a=_0x3ff9e9[_0x2b8dd5(0x1f9)]()['replace'](/-/g,'_'),_0x155ce9=_0x2b8dd5(0x230)+_0x36309a;if(_0x87602e){const _0x5afa71=loadProfileEnv(_0x87602e);if(_0x5afa71){if(_0x5afa71[_0x155ce9])return _0x5afa71[_0x155ce9];if(_0x5afa71[_0x2b8dd5(0x22d)])return _0x5afa71[_0x2b8dd5(0x22d)];}}const _0x483956=loadUserConfigOnce();if(_0x483956[_0x155ce9])return _0x483956[_0x155ce9];if(_0x483956[_0x2b8dd5(0x22d)])return _0x483956[_0x2b8dd5(0x22d)];return undefined;}function cleanupLegacyEnvFile(_0x588cb4){const _0x174042=a46_0x4142;if(!existsSync(_0x588cb4))return![];try{const _0x2b0176=readFileSync(_0x588cb4,'utf-8'),_0x2bc570=_0x2b0176[_0x174042(0x218)]('\x0a'),_0x3b7fe2=_0x2bc570['filter'](_0x4ba046=>{const _0x4a9403=_0x174042,_0x198557=_0x4ba046['trim']();if(!_0x198557||_0x198557[_0x4a9403(0x227)]('#'))return!![];const [_0x441ccf]=_0x198557[_0x4a9403(0x218)]('=');return!_0x441ccf[_0x4a9403(0x227)](_0x4a9403(0x22d));}),_0x28f61a=_0x3b7fe2['some'](_0x23d69c=>{const _0x50829f=_0x174042,_0xeb0a49=_0x23d69c[_0x50829f(0x20b)]();return _0xeb0a49&&!_0xeb0a49[_0x50829f(0x227)]('#');});if(!_0x28f61a)return unlinkSync(_0x588cb4),!![];return writeFileSync(_0x588cb4,_0x3b7fe2[_0x174042(0x219)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x3244ff){const _0x3ef02c=a46_0x4142,_0x169d20=a46_0x599f93[_0x3ef02c(0x219)](getConfigDir(),_0x3ef02c(0x22f)+_0x3244ff);if(a46_0x3a5bc4['existsSync'](_0x169d20)){validateSecureFilePermissions(_0x169d20);try{const _0x2a7a33=a46_0x3a5bc4['readFileSync'](_0x169d20,_0x3ef02c(0x1ec));return parseEnvFile(_0x2a7a33);}catch(_0x456e74){console[_0x3ef02c(0x208)](_0x3ef02c(0x1eb)+_0x169d20+':\x20'+_0x456e74);}}const _0x47f4ea=a46_0x599f93[_0x3ef02c(0x219)](getConfigDir(),_0x3ef02c(0x217),_0x3244ff,_0x3ef02c(0x1f2));if(a46_0x3a5bc4[_0x3ef02c(0x1ff)](_0x47f4ea)){validateSecureFilePermissions(_0x47f4ea);try{const _0x57f3e4=a46_0x3a5bc4[_0x3ef02c(0x1f4)](_0x47f4ea,_0x3ef02c(0x1ec));return parseEnvFile(_0x57f3e4);}catch(_0x172a3f){return console[_0x3ef02c(0x208)](_0x3ef02c(0x1eb)+_0x47f4ea+':\x20'+_0x172a3f),null;}}return null;}function getActiveProfileName(){const _0x822cf1=a46_0x4142,_0x3b2ff8=a46_0x599f93[_0x822cf1(0x219)](getConfigDir(),'tdx.json');if(!a46_0x3a5bc4[_0x822cf1(0x1ff)](_0x3b2ff8))return null;try{const _0x1b5d58=a46_0x3a5bc4[_0x822cf1(0x1f4)](_0x3b2ff8,_0x822cf1(0x1ec)),_0x527f45=JSON[_0x822cf1(0x232)](_0x1b5d58);return _0x527f45[_0x822cf1(0x1f1)]||null;}catch{return null;}}export function saveAPIKey(_0x25da79,_0x4912e2,_0xdcd2f1){const _0x4aff3f=a46_0x4142,_0x4e61d7=getConfigDir(),_0x59d156=getConfigFilePath(_0xdcd2f1);!existsSync(_0x4e61d7)&&mkdirSync(_0x4e61d7,{'recursive':!![],'mode':0x1c0});let _0x20bb0={};if(existsSync(_0x59d156))try{const _0x267089=readFileSync(_0x59d156,_0x4aff3f(0x1ec));_0x20bb0=parseEnvFile(_0x267089);}catch(_0x31f859){console[_0x4aff3f(0x208)]('Warning:\x20Failed\x20to\x20read\x20'+_0x59d156+':',_0x31f859);}const _0x223581=_0x25da79['toUpperCase']()[_0x4aff3f(0x21a)](/-/g,'_');_0x20bb0[_0x4aff3f(0x230)+_0x223581]=_0x4912e2;const _0x45fbbf=Object[_0x4aff3f(0x1f5)](_0x20bb0)[_0x4aff3f(0x1f0)](([_0x2459e7,_0x37de0c])=>_0x2459e7+'='+_0x37de0c);writeFileSync(_0x59d156,_0x45fbbf[_0x4aff3f(0x219)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x3d1d6e,_0x3d1190,_0xf6180d){const _0x4af0ae=a46_0x4142;await saveKeychainAPIKey(_0x3d1d6e,_0xf6180d),setCachedCredential(_0x3d1d6e,_0x3d1190,_0xf6180d);const _0x586149=getConfigFilePath(_0xf6180d);cleanupLegacyEnvFile(_0x586149)&&console[_0x4af0ae(0x208)](a46_0x541372[_0x4af0ae(0x214)](_0x4af0ae(0x225)));}export function loadConfig(){const _0x38ee3e=a46_0x4142,_0x398fd7={'apiKeys':{},'defaultSite':'us01'},_0x5f29d6=[_0x38ee3e(0x20d),_0x38ee3e(0x1fc),_0x38ee3e(0x212),'ap02',_0x38ee3e(0x207),_0x38ee3e(0x216),_0x38ee3e(0x1fd),_0x38ee3e(0x22b),'stg-jp01',_0x38ee3e(0x229)];for(const _0x2e8c2a of _0x5f29d6){const _0x3d2591=getAPIKey(_0x2e8c2a);_0x3d2591&&(_0x398fd7[_0x38ee3e(0x228)][_0x2e8c2a]=_0x3d2591);}return _0x398fd7;}
|
|
1
|
+
(function(_0x5e7f04,_0x2048c3){const _0x347116=a46_0x2771,_0x18f517=_0x5e7f04();while(!![]){try{const _0x4e1482=parseInt(_0x347116(0x1fb))/0x1+parseInt(_0x347116(0x200))/0x2+parseInt(_0x347116(0x230))/0x3*(parseInt(_0x347116(0x211))/0x4)+parseInt(_0x347116(0x21b))/0x5+parseInt(_0x347116(0x20e))/0x6+-parseInt(_0x347116(0x202))/0x7*(-parseInt(_0x347116(0x208))/0x8)+-parseInt(_0x347116(0x22d))/0x9;if(_0x4e1482===_0x2048c3)break;else _0x18f517['push'](_0x18f517['shift']());}catch(_0x4a978d){_0x18f517['push'](_0x18f517['shift']());}}}(a46_0x3730,0x7cf6b));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x617de2 from'node:fs';import*as a46_0x2892f0 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 a46_0x5aff50 from'chalk';export function getConfigDir(){const _0x5d50eb=a46_0x2771;return process[_0x5d50eb(0x1fc)][_0x5d50eb(0x1f9)]||join(homedir(),'.config',_0x5d50eb(0x223));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x3e8665){const _0x5108f1=a46_0x2771,_0xd6ec3c=getConfigDir();return _0x3e8665?a46_0x2892f0[_0x5108f1(0x232)](_0xd6ec3c,_0x5108f1(0x21f)+_0x3e8665):getConfigFile();}export function getCacheDir(){const _0x58fe5a=a46_0x2771;return process['env'][_0x58fe5a(0x1fd)]||join(homedir(),_0x58fe5a(0x22c),_0x58fe5a(0x223));}export function getLLMProjectCacheFile(_0x5384fd){const _0xce1dc9=a46_0x2771,_0x3fecd4=_0x5384fd?'llm_default_project.'+_0x5384fd:_0xce1dc9(0x1f2);return join(getCacheDir(),_0x3fecd4);}export function readCachedLLMProject(_0x46fdf7){const _0x39cb7d=a46_0x2771;try{const _0x1160a3=getLLMProjectCacheFile(_0x46fdf7);if(!existsSync(_0x1160a3))return null;const _0x22acd8=readFileSync(_0x1160a3,_0x39cb7d(0x20f))[_0x39cb7d(0x1f3)]();try{const _0x42f0a8=JSON[_0x39cb7d(0x1e8)](_0x22acd8);if(_0x42f0a8&&typeof _0x42f0a8['id']===_0x39cb7d(0x20d)&&typeof _0x42f0a8['name']==='string')return _0x42f0a8;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x155254,_0x2f2a78,_0x108464){try{const _0x5aa63e=getCacheDir(),_0x219f7b=getLLMProjectCacheFile(_0x108464);!existsSync(_0x5aa63e)&&mkdirSync(_0x5aa63e,{'recursive':!![]});const _0x60d416={'name':_0x155254,'id':_0x2f2a78};writeFileSync(_0x219f7b,JSON['stringify'](_0x60d416),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x18ec23){const _0x4476b9=a46_0x2771,_0x14202f=_0x18ec23?_0x4476b9(0x1f4)+_0x18ec23:'llm_default_agent';return join(getCacheDir(),_0x14202f);}export function readCachedLLMAgent(_0x3c8c5e){const _0x1ddd6e=a46_0x2771;try{const _0x1e62e0=getLLMAgentCacheFile(_0x3c8c5e);if(!existsSync(_0x1e62e0))return null;const _0x5aca1f=readFileSync(_0x1e62e0,_0x1ddd6e(0x20f))[_0x1ddd6e(0x1f3)]();try{const _0x47303c=JSON[_0x1ddd6e(0x1e8)](_0x5aca1f);if(_0x47303c&&typeof _0x47303c['id']===_0x1ddd6e(0x20d)&&typeof _0x47303c['name']===_0x1ddd6e(0x20d)&&typeof _0x47303c[_0x1ddd6e(0x1eb)]===_0x1ddd6e(0x20d))return _0x47303c;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x2425cd,_0x46c3a6,_0x16b9c9,_0x29c080){const _0xd47d15=a46_0x2771;try{const _0x2cbc0c=getCacheDir(),_0x1f86b7=getLLMAgentCacheFile(_0x29c080);!existsSync(_0x2cbc0c)&&mkdirSync(_0x2cbc0c,{'recursive':!![]});const _0x280451={'name':_0x2425cd,'id':_0x46c3a6,'projectId':_0x16b9c9};writeFileSync(_0x1f86b7,JSON[_0xd47d15(0x214)](_0x280451),_0xd47d15(0x20f));}catch{}}export function clearCachedLLMAgent(_0x2fe218){try{const _0x5d9879=getLLMAgentCacheFile(_0x2fe218);existsSync(_0x5d9879)&&unlinkSync(_0x5d9879);}catch{}}export function getAccountInfoCacheFile(_0x1a720a){const _0x2f0067=a46_0x2771,_0x5aa396=_0x1a720a?'account_info.'+_0x1a720a+'.json':_0x2f0067(0x222);return join(getCacheDir(),_0x5aa396);}export function readCachedAccountInfo(_0x3ff646){const _0x492662=a46_0x2771;try{const _0x17631e=getAccountInfoCacheFile(_0x3ff646);if(!existsSync(_0x17631e))return null;const _0x2bb5eb=readFileSync(_0x17631e,_0x492662(0x20f))[_0x492662(0x1f3)](),_0x17282e=JSON['parse'](_0x2bb5eb);if(_0x17282e&&typeof _0x17282e[_0x492662(0x204)]==='string'&&typeof _0x17282e[_0x492662(0x21c)]===_0x492662(0x231))return _0x17282e;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x57ec36,_0x523c0d,_0x4a7832){const _0x1e6fb8=a46_0x2771;try{const _0x2646ed=getCacheDir(),_0x3e1743=getAccountInfoCacheFile(_0x4a7832);!existsSync(_0x2646ed)&&mkdirSync(_0x2646ed,{'recursive':!![]});const _0x2c5e5d={'site':_0x57ec36,'accountId':_0x523c0d,'cachedAt':new Date()[_0x1e6fb8(0x21d)]()};writeFileSync(_0x3e1743,JSON[_0x1e6fb8(0x214)](_0x2c5e5d),_0x1e6fb8(0x20f));}catch{}}export function parseEnvFile(_0x5d7ead){const _0x293481=a46_0x2771,_0x59d42e={};for(const _0x1b2088 of _0x5d7ead[_0x293481(0x228)]('\x0a')){const _0x401954=_0x1b2088[_0x293481(0x1f3)]();if(!_0x401954||_0x401954[_0x293481(0x216)]('#'))continue;const _0x380727=_0x401954['match'](/^([^=]+)=(.*)$/);if(_0x380727){const _0xaf5345=_0x380727[0x1]['trim']();let _0xd26b28=_0x380727[0x2][_0x293481(0x1f3)]();(_0xd26b28[_0x293481(0x216)]('\x22')&&_0xd26b28[_0x293481(0x224)]('\x22')||_0xd26b28[_0x293481(0x216)]('\x27')&&_0xd26b28[_0x293481(0x224)]('\x27'))&&(_0xd26b28=_0xd26b28[_0x293481(0x218)](0x1,-0x1)),_0x59d42e[_0xaf5345]=_0xd26b28;}}return _0x59d42e;}export function readUserConfig(){const _0x1e99d4=a46_0x2771,_0x39a64c=getConfigFile();if(!existsSync(_0x39a64c))return{};try{const _0x3853e4=readFileSync(_0x39a64c,'utf-8');return parseEnvFile(_0x3853e4);}catch(_0x6c5b19){return console[_0x1e99d4(0x20a)](_0x1e99d4(0x1ff)+_0x39a64c+':',_0x6c5b19),{};}}export function resolveSite(_0x49a8ce){const _0x3e9cfb=a46_0x2771,_0x4bb24d=[_0x3e9cfb(0x1fe),_0x3e9cfb(0x20c),_0x3e9cfb(0x22f),_0x3e9cfb(0x217),'ap03',_0x3e9cfb(0x229),_0x3e9cfb(0x1ec),'stg-us01','stg-jp01',_0x3e9cfb(0x1ee)];if(_0x4bb24d['includes'](_0x49a8ce))return _0x49a8ce;if(_0x49a8ce in SITE_ALIASES)return SITE_ALIASES[_0x49a8ce];return console[_0x3e9cfb(0x20a)](_0x3e9cfb(0x233)+_0x49a8ce+_0x3e9cfb(0x1f5)),_0x3e9cfb(0x1fe);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x4a80da,_0x30f259){const _0x45af9a=a46_0x2771,_0x15fc37=_0x30f259||getActiveProfileName();if(_0x15fc37){const _0x511db2=_0x45af9a(0x207)+normalizeProfileForEnvVar(_0x15fc37);if(process[_0x45af9a(0x1fc)][_0x511db2])return process[_0x45af9a(0x1fc)][_0x511db2];}if(process[_0x45af9a(0x1fc)][_0x45af9a(0x21a)])return process[_0x45af9a(0x1fc)][_0x45af9a(0x21a)];if(process[_0x45af9a(0x1fc)][_0x45af9a(0x209)])return process[_0x45af9a(0x1fc)]['TD_API_KEY'];const _0x4a901e=_0x4a80da['toUpperCase']()[_0x45af9a(0x227)](/-/g,'_'),_0x158188=_0x45af9a(0x234)+_0x4a901e;if(_0x15fc37){const _0xfc4a14=loadProfileEnv(_0x15fc37);if(_0xfc4a14){if(_0xfc4a14[_0x158188])return _0xfc4a14[_0x158188];if(_0xfc4a14[_0x45af9a(0x209)])return _0xfc4a14[_0x45af9a(0x209)];}}const _0x52c637=loadUserConfigOnce();if(_0x52c637[_0x158188])return _0x52c637[_0x158188];if(_0x52c637['TD_API_KEY'])return _0x52c637[_0x45af9a(0x209)];return undefined;}export function normalizeProfileForEnvVar(_0x2f62d2){const _0x5ce1ed=a46_0x2771;return _0x2f62d2[_0x5ce1ed(0x1f1)]()[_0x5ce1ed(0x227)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x41b408,_0x3c09e5){const _0x1f1a6f=a46_0x2771,_0x49b207=_0x3c09e5||getActiveProfileName()||undefined;if(_0x49b207){const _0x2c90c0=_0x1f1a6f(0x207)+normalizeProfileForEnvVar(_0x49b207);if(process[_0x1f1a6f(0x1fc)][_0x2c90c0])return{'apiKey':process[_0x1f1a6f(0x1fc)][_0x2c90c0],'source':_0x2c90c0+_0x1f1a6f(0x226),'isDeprecated':![]};const _0x555f1c=getCachedCredential(_0x41b408,_0x49b207);if(_0x555f1c)return{'apiKey':_0x555f1c,'source':_0x1f1a6f(0x206)+_0x49b207+')','isDeprecated':![]};const _0x3f3d53=await getKeychainAPIKey(_0x49b207);if(_0x3f3d53)return setCachedCredential(_0x3f3d53,_0x41b408,_0x49b207),{'apiKey':_0x3f3d53,'source':_0x1f1a6f(0x206)+_0x49b207+')','isDeprecated':![]};}if(process['env'][_0x1f1a6f(0x21a)])return{'apiKey':process['env'][_0x1f1a6f(0x21a)],'source':_0x1f1a6f(0x20b),'isDeprecated':![]};if(!_0x49b207){const _0x41cdf6=getCachedCredential(_0x41b408,undefined);if(_0x41cdf6)return{'apiKey':_0x41cdf6,'source':_0x1f1a6f(0x212),'isDeprecated':![]};const _0x1ce979=await getKeychainAPIKey(undefined);if(_0x1ce979)return setCachedCredential(_0x1ce979,_0x41b408,undefined),{'apiKey':_0x1ce979,'source':_0x1f1a6f(0x212),'isDeprecated':![]};}if(process[_0x1f1a6f(0x1fc)][_0x1f1a6f(0x209)])return{'apiKey':process[_0x1f1a6f(0x1fc)][_0x1f1a6f(0x209)],'source':_0x1f1a6f(0x22e),'isDeprecated':!![]};const _0x163b30=getLegacyEnvAPIKey(_0x41b408,_0x49b207);if(_0x163b30){const _0x1dab07=await isKeychainAvailable();if(_0x1dab07)try{await saveKeychainAPIKey(_0x163b30,_0x49b207),setCachedCredential(_0x163b30,_0x41b408,_0x49b207);const _0x5dd26d=getConfigFilePath(_0x49b207);cleanupLegacyEnvFile(_0x5dd26d)&&console[_0x1f1a6f(0x20a)](a46_0x5aff50[_0x1f1a6f(0x205)](_0x1f1a6f(0x1e6)));}catch(_0xcb83c1){console[_0x1f1a6f(0x20a)](a46_0x5aff50[_0x1f1a6f(0x205)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0xcb83c1));}const _0x4c818f=_0x49b207?_0x1f1a6f(0x215)+_0x49b207+')':_0x1f1a6f(0x22a);return{'apiKey':_0x163b30,'source':_0x4c818f,'isDeprecated':!![]};}return null;}function a46_0x3730(){const _0x3de4c6=['Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','1695258dvumqR','readFileSync','35084TqVXVI','Warning:\x20Failed\x20to\x20load\x20','site','yellow','keychain\x20(profile:\x20','TDX_API_KEY_','64eDxKnJ','TD_API_KEY','warn','TDX_API_KEY\x20env\x20var','jp01','string','1352076hxAzFU','utf-8','Warning:\x20Failed\x20to\x20read\x20','296DAVjPZ','keychain','profiles','stringify','legacy\x20.env\x20file\x20(profile:\x20','startsWith','ap02','slice','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','TDX_API_KEY','8130qRHUKj','accountId','toISOString','TDX_API_KEY_<PROFILE>','.env.','existsSync','entries','account_info.json','tdx','endsWith','apiKey','\x20env\x20var','replace','split','dev-us01','legacy\x20.env\x20file','filter','.cache','19778382Vdvctn','TD_API_KEY\x20env\x20var\x20(deprecated)','eu01','38061tJyDjo','number','join','Warning:\x20Unknown\x20site\x20\x27','TD_API_KEY_','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','profile','parse','stg-jp01','isDeprecated','projectId','dev-eu01','apiKeys','stg-ap03','map','includes','toUpperCase','llm_default_project','trim','llm_default_agent.','\x27,\x20defaulting\x20to\x20us01','source','ap03','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','TDX_CONFIG_DIR','.env','655914DHxngy','env','TDX_CACHE_DIR','us01'];a46_0x3730=function(){return _0x3de4c6;};return a46_0x3730();}export async function getAPIKeyAsync(_0x533cfc,_0x36f1b1,_0x500723=!![]){const _0x172c74=a46_0x2771,_0x72309b=await resolveAPIKeyAsync(_0x533cfc,_0x36f1b1);if(!_0x72309b)return undefined;if(_0x500723&&_0x72309b[_0x172c74(0x1ea)]&&_0x72309b[_0x172c74(0x1f6)][_0x172c74(0x1f0)]('TD_API_KEY')){const _0x64e2d8=_0x36f1b1||getActiveProfileName()||undefined,_0xb5bdf2=_0x64e2d8?_0x172c74(0x207)+normalizeProfileForEnvVar(_0x64e2d8):_0x172c74(0x21e);console['warn'](a46_0x5aff50['yellow']('Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a'+(_0x172c74(0x219)+_0xb5bdf2+').')));}return _0x72309b[_0x172c74(0x225)];}function getLegacyEnvAPIKey(_0x599d83,_0x2a5dde){const _0x1a8937=a46_0x2771,_0x3fb550=_0x599d83[_0x1a8937(0x1f1)]()[_0x1a8937(0x227)](/-/g,'_'),_0x54a2e9=_0x1a8937(0x234)+_0x3fb550;if(_0x2a5dde){const _0x3908f7=loadProfileEnv(_0x2a5dde);if(_0x3908f7){if(_0x3908f7[_0x54a2e9])return _0x3908f7[_0x54a2e9];if(_0x3908f7[_0x1a8937(0x209)])return _0x3908f7[_0x1a8937(0x209)];}}const _0x55e5de=loadUserConfigOnce();if(_0x55e5de[_0x54a2e9])return _0x55e5de[_0x54a2e9];if(_0x55e5de[_0x1a8937(0x209)])return _0x55e5de[_0x1a8937(0x209)];return undefined;}function cleanupLegacyEnvFile(_0x503449){const _0x4b8f15=a46_0x2771;if(!existsSync(_0x503449))return![];try{const _0x9a899f=readFileSync(_0x503449,_0x4b8f15(0x20f)),_0x241300=_0x9a899f[_0x4b8f15(0x228)]('\x0a'),_0x3cf3c3=_0x241300[_0x4b8f15(0x22b)](_0x4cc501=>{const _0x4ae62a=_0x4b8f15,_0x1d4523=_0x4cc501[_0x4ae62a(0x1f3)]();if(!_0x1d4523||_0x1d4523[_0x4ae62a(0x216)]('#'))return!![];const [_0x2c59d7]=_0x1d4523[_0x4ae62a(0x228)]('=');return!_0x2c59d7[_0x4ae62a(0x216)]('TD_API_KEY');}),_0x385dd4=_0x3cf3c3['some'](_0x4d55d9=>{const _0x44a270=_0x4b8f15,_0x24d1c7=_0x4d55d9[_0x44a270(0x1f3)]();return _0x24d1c7&&!_0x24d1c7[_0x44a270(0x216)]('#');});if(!_0x385dd4)return unlinkSync(_0x503449),!![];return writeFileSync(_0x503449,_0x3cf3c3[_0x4b8f15(0x232)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x1f1b2d){const _0x5ba574=a46_0x2771,_0x47e5ce=a46_0x2892f0[_0x5ba574(0x232)](getConfigDir(),_0x5ba574(0x21f)+_0x1f1b2d);if(a46_0x617de2[_0x5ba574(0x220)](_0x47e5ce)){validateSecureFilePermissions(_0x47e5ce);try{const _0x43a836=a46_0x617de2[_0x5ba574(0x201)](_0x47e5ce,'utf-8');return parseEnvFile(_0x43a836);}catch(_0x469da2){console['warn'](_0x5ba574(0x203)+_0x47e5ce+':\x20'+_0x469da2);}}const _0x2cffed=a46_0x2892f0[_0x5ba574(0x232)](getConfigDir(),_0x5ba574(0x213),_0x1f1b2d,_0x5ba574(0x1fa));if(a46_0x617de2[_0x5ba574(0x220)](_0x2cffed)){validateSecureFilePermissions(_0x2cffed);try{const _0x21cd76=a46_0x617de2[_0x5ba574(0x201)](_0x2cffed,'utf-8');return parseEnvFile(_0x21cd76);}catch(_0x42faae){return console[_0x5ba574(0x20a)](_0x5ba574(0x203)+_0x2cffed+':\x20'+_0x42faae),null;}}return null;}function getActiveProfileName(){const _0x8a110d=a46_0x2771,_0x3da0a5=a46_0x2892f0[_0x8a110d(0x232)](getConfigDir(),'tdx.json');if(!a46_0x617de2['existsSync'](_0x3da0a5))return null;try{const _0x36b622=a46_0x617de2[_0x8a110d(0x201)](_0x3da0a5,_0x8a110d(0x20f)),_0x440611=JSON['parse'](_0x36b622);return _0x440611[_0x8a110d(0x1e7)]||null;}catch{return null;}}export function saveAPIKey(_0x2e347a,_0x451689,_0x21906b){const _0xcedbd4=a46_0x2771,_0x47b412=getConfigDir(),_0x30f685=getConfigFilePath(_0x21906b);!existsSync(_0x47b412)&&mkdirSync(_0x47b412,{'recursive':!![],'mode':0x1c0});let _0x3145a1={};if(existsSync(_0x30f685))try{const _0x27383d=readFileSync(_0x30f685,_0xcedbd4(0x20f));_0x3145a1=parseEnvFile(_0x27383d);}catch(_0x130be2){console[_0xcedbd4(0x20a)](_0xcedbd4(0x210)+_0x30f685+':',_0x130be2);}const _0x44544b=_0x2e347a[_0xcedbd4(0x1f1)]()['replace'](/-/g,'_');_0x3145a1['TD_API_KEY_'+_0x44544b]=_0x451689;const _0x18bf7a=Object[_0xcedbd4(0x221)](_0x3145a1)[_0xcedbd4(0x1ef)](([_0x25079e,_0x30b8d1])=>_0x25079e+'='+_0x30b8d1);writeFileSync(_0x30f685,_0x18bf7a[_0xcedbd4(0x232)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x58a9bf,_0xf49682,_0x287bec){const _0x3d8b5e=a46_0x2771;await saveKeychainAPIKey(_0x58a9bf,_0x287bec),setCachedCredential(_0x58a9bf,_0xf49682,_0x287bec);const _0xbe1b3d=getConfigFilePath(_0x287bec);cleanupLegacyEnvFile(_0xbe1b3d)&&console[_0x3d8b5e(0x20a)](a46_0x5aff50['yellow'](_0x3d8b5e(0x1f8)));}function a46_0x2771(_0xd7209f,_0x54f474){_0xd7209f=_0xd7209f-0x1e6;const _0x3730eb=a46_0x3730();let _0x277160=_0x3730eb[_0xd7209f];return _0x277160;}export function loadConfig(){const _0x59f403=a46_0x2771,_0x3d08eb={'apiKeys':{},'defaultSite':_0x59f403(0x1fe)},_0x138cf9=[_0x59f403(0x1fe),_0x59f403(0x20c),_0x59f403(0x22f),_0x59f403(0x217),_0x59f403(0x1f7),'dev-us01',_0x59f403(0x1ec),'stg-us01',_0x59f403(0x1e9),'stg-ap03'];for(const _0x265b4b of _0x138cf9){const _0x4ef2f5=getAPIKey(_0x265b4b);_0x4ef2f5&&(_0x3d08eb[_0x59f403(0x1ed)][_0x265b4b]=_0x4ef2f5);}return _0x3d08eb;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3744c9,_0x220d1d){const _0x335ec9=a47_0xa425,_0x4a1633=_0x3744c9();while(!![]){try{const _0x4a0889=parseInt(_0x335ec9(0x106))/0x1*(-parseInt(_0x335ec9(0x102))/0x2)+parseInt(_0x335ec9(0x10a))/0x3+parseInt(_0x335ec9(0x109))/0x4+-parseInt(_0x335ec9(0xfe))/0x5*(-parseInt(_0x335ec9(0x107))/0x6)+-parseInt(_0x335ec9(0x10d))/0x7*(-parseInt(_0x335ec9(0x105))/0x8)+parseInt(_0x335ec9(0x103))/0x9+-parseInt(_0x335ec9(0x10b))/0xa*(parseInt(_0x335ec9(0xff))/0xb);if(_0x4a0889===_0x220d1d)break;else _0x4a1633['push'](_0x4a1633['shift']());}catch(_0x4dadfe){_0x4a1633['push'](_0x4a1633['shift']());}}}(a47_0x122e,0x8c1f6));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';function a47_0xa425(_0x1185c9,_0x53625a){_0x1185c9=_0x1185c9-0xfe;const _0x122ecb=a47_0x122e();let _0xa42567=_0x122ecb[_0x1185c9];return _0xa42567;}import{join}from'path';import{getCacheDir}from'./config.js';function a47_0x122e(){const _0x1a3e3e=['3464vpKgMn','23smCCCg','850548IbWOOt','connections','2500196YZWJLa','1134966LqqQKT','20BFWDdB','utf-8','11235UvCYWy','30eoIsaO','7638279BqCpyZ','now','stringify','88682RnXRhF','3903111tieIxy','connections-'];a47_0x122e=function(){return _0x1a3e3e;};return a47_0x122e();}function getCacheFilePath(_0x897cdf){const _0xb4a261=a47_0xa425,_0x3a2bc5=_0x897cdf||'default';return join(getCacheDir(),_0xb4a261(0x104)+_0x3a2bc5+'.json');}export function loadCachedConnections(_0x438cd0){const _0x1b127f=a47_0xa425,_0x37a992=getCacheFilePath(_0x438cd0);if(!existsSync(_0x37a992))return null;try{const _0x4883c3=readFileSync(_0x37a992,'utf-8'),_0x1cfc1a=JSON['parse'](_0x4883c3);return _0x1cfc1a[_0x1b127f(0x108)];}catch{return null;}}export function saveCachedConnections(_0x72d0a1,_0x1d80e7){const _0x57d1d0=a47_0xa425,_0x33c890=getCacheDir();!existsSync(_0x33c890)&&mkdirSync(_0x33c890,{'recursive':!![]});const _0x880c05=getCacheFilePath(_0x72d0a1),_0x3275e9={'connections':_0x1d80e7,'cachedAt':Date[_0x57d1d0(0x100)]()};writeFileSync(_0x880c05,JSON[_0x57d1d0(0x101)](_0x3275e9,null,0x2),_0x57d1d0(0x10c));}export function clearConnectionCache(_0x326dd9){const _0x32f666=getCacheFilePath(_0x326dd9);if(existsSync(_0x32f666))try{unlinkSync(_0x32f666);}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a0afe,_0x43f7f2){const _0x5e0920=a48_0x3b73,_0x4d7eb5=_0x3a0afe();while(!![]){try{const _0xc75b8f=-parseInt(_0x5e0920(0x7c))/0x1+parseInt(_0x5e0920(0x75))/0x2*(-parseInt(_0x5e0920(0x6b))/0x3)+-parseInt(_0x5e0920(0x6e))/0x4+parseInt(_0x5e0920(0x72))/0x5+-parseInt(_0x5e0920(0x6d))/0x6*(-parseInt(_0x5e0920(0x6a))/0x7)+parseInt(_0x5e0920(0x6c))/0x8*(-parseInt(_0x5e0920(0x79))/0x9)+parseInt(_0x5e0920(0x77))/0xa;if(_0xc75b8f===_0x43f7f2)break;else _0x4d7eb5['push'](_0x4d7eb5['shift']());}catch(_0x3029de){_0x4d7eb5['push'](_0x4d7eb5['shift']());}}}(a48_0x48a3,0x572d3));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x4921d9,_0x4626fa){const _0x54e43f=a48_0x3b73,_0x1dd395=_0x4921d9||_0x54e43f(0x74),_0x49856a=_0x4626fa||_0x54e43f(0x6f);return _0x1dd395+':'+_0x49856a;}export function getCachedCredential(_0x2c66e7,_0x2d816f){const _0xd432f3=a48_0x3b73,_0x3a376d=getCacheKey(_0x2c66e7,_0x2d816f),_0x414485=cache[_0xd432f3(0x73)](_0x3a376d);if(!_0x414485)return null;if(Date['now']()-_0x414485[_0xd432f3(0x71)]>CACHE_TTL_MS)return cache[_0xd432f3(0x7a)](_0x3a376d),null;return _0x414485[_0xd432f3(0x70)];}export function setCachedCredential(_0x31e3ee,_0x4eec78,_0x3cca1e){const _0xe2b1ed=a48_0x3b73,_0x9062b6=getCacheKey(_0x4eec78,_0x3cca1e);cache[_0xe2b1ed(0x76)](_0x9062b6,{'apiKey':_0x31e3ee,'loadedAt':Date[_0xe2b1ed(0x7b)]()});}function a48_0x3b73(_0x4e1678,_0x2c5041){_0x4e1678=_0x4e1678-0x6a;const _0x48a3a7=a48_0x48a3();let _0x3b738a=_0x48a3a7[_0x4e1678];return _0x3b738a;}function a48_0x48a3(){const _0x1414b9=['set','6107610VzxSTm','clear','204813KYfoMD','delete','now','109656lCgpPG','5761ZKfLkg','396315CLvMYH','8ZiAqUf','4614RoDtkO','1930140eVwBhV','__default_profile__','apiKey','loadedAt','623450GoYXQV','get','__default_site__','6BfLRLm'];a48_0x48a3=function(){return _0x1414b9;};return a48_0x48a3();}export function clearCredentialCache(){const _0x1a1e34=a48_0x3b73;cache[_0x1a1e34(0x78)]();}export function clearCachedCredential(_0x2415b9,_0x3d2f9a){const _0x3ccbc2=a48_0x3b73,_0x47b0f3=getCacheKey(_0x2415b9,_0x3d2f9a);cache[_0x3ccbc2(0x7a)](_0x47b0f3);}
|