@treasuredata/tdx 0.9.1 → 0.9.3
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 +35 -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.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +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 +45 -1
- 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 +27 -20
- 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 +80 -4
- 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
|
-
function a39_0xfe8b(){const _0x1a022c=['\x20segment',',\x20and\x20','Parent\x20ID:\x20','recursive','replace','web','Site:\x20','66dSsacO','/app/ps/','/e/','execute','Recursive\x20mode:\x20enabled','segments','listUnified','jsonl','journeyBundleName','name','all','length','✔\x20Found\x20','listJourneysFromParentSegment','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.',']\x20matching\x20\x27','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','journey','658bJkfGz','description','708436pmOlPW','Listing\x20folders,\x20segments,\x20and\x20journeys...','filter','Building\x20hierarchy\x20tree...','site','Resolving\x20parent\x20segment\x20\x27','✔\x20Built\x20tree\x20with\x20','message','\x27...','211271TJgzcU','Folder\x20ID:\x20','List\x20folders\x20and\x20child\x20segments','map','listWithPattern','sort','241520mRZLgA','1164hTFaHc','\x20matching\x20\x27','cause','test','/j/da','folder','Error:\x20No\x20parent\x20segment\x20context\x20set.','75265qCARPW','Error:\x20','\x20journey','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId','\x20top-level\x20items','No\x20items\x20match\x20pattern:\x20','1012887AsrJpK','\x20\x20Cause:\x20','28CGLKFM','format','localeCompare','\x20folder','(empty)','parentId','includes','\x5c$&','8371LVGiyU','error','resolvePathToResource','log','246XwVDXb','dim','10FMetjH','verbose','json','listRecursive','data','segment','Resolving\x20path\x20\x27'];a39_0xfe8b=function(){return _0x1a022c;};return a39_0xfe8b();}const a39_0x54b069=a39_0x4454;function a39_0x4454(_0x2da3b5,_0x4d78d3){_0x2da3b5=_0x2da3b5-0xcf;const _0xfe8b86=a39_0xfe8b();let _0x44543e=_0xfe8b86[_0x2da3b5];return _0x44543e;}(function(_0x1ecc19,_0x4e419f){const _0x2a316b=a39_0x4454,_0x253326=_0x1ecc19();while(!![]){try{const _0x2ea5c1=parseInt(_0x2a316b(0xf5))/0x1+-parseInt(_0x2a316b(0xea))/0x2*(parseInt(_0x2a316b(0x118))/0x3)+-parseInt(_0x2a316b(0xec))/0x4+parseInt(_0x2a316b(0x103))/0x5*(-parseInt(_0x2a316b(0xd8))/0x6)+-parseInt(_0x2a316b(0x10c))/0x7*(-parseInt(_0x2a316b(0xfb))/0x8)+-parseInt(_0x2a316b(0x10a))/0x9*(-parseInt(_0x2a316b(0x11a))/0xa)+parseInt(_0x2a316b(0x114))/0xb*(parseInt(_0x2a316b(0xfc))/0xc);if(_0x2ea5c1===_0x4e419f)break;else _0x253326['push'](_0x253326['shift']());}catch(_0x34f1e3){_0x253326['push'](_0x253326['shift']());}}}(a39_0xfe8b,0x244f1));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_0x197811 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a39_0x54b069(0xdd);[a39_0x54b069(0xeb)]=a39_0x54b069(0xf7);async[a39_0x54b069(0xdb)](_0x218b33){const _0x4d9630=a39_0x54b069,{options:_0x5ae2d5,args:_0x3fb802}=_0x218b33,_0x4ea016=_0x5ae2d5[_0x4d9630(0xd4)],_0x1b5226=_0x3fb802[0x0];try{const _0x20dad6=_0x5ae2d5['parentSegment'];_0x5ae2d5[_0x4d9630(0x11b)]&&(console['error'](_0x4d9630(0xd7)+_0x5ae2d5[_0x4d9630(0xf0)]),console[_0x4d9630(0x115)]('Parent\x20segment\x20context:\x20'+(_0x20dad6||'(not\x20set)')),_0x1b5226&&console[_0x4d9630(0x115)]('Folder/pattern\x20arg:\x20'+_0x1b5226),_0x4ea016&&console['error'](_0x4d9630(0xdc)));if(!_0x20dad6)return console[_0x4d9630(0x115)](_0x4d9630(0x102)),console[_0x4d9630(0x115)](''),console['error'](_0x4d9630(0x106)),console['error']('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console['error'](_0x4d9630(0xe8)),console[_0x4d9630(0x115)](''),console[_0x4d9630(0x115)](_0x4d9630(0xe6)),0x1;const _0x87e83f=_0x1b5226&&(_0x1b5226[_0x4d9630(0x112)]('*')||_0x1b5226[_0x4d9630(0x112)]('?'));if(_0x87e83f)return await this[_0x4d9630(0xf9)](_0x218b33,_0x20dad6,_0x1b5226);const _0x2074d=_0x1b5226?_0x20dad6+'/'+_0x1b5226:_0x20dad6;return _0x4ea016?await this['listRecursive'](_0x218b33,_0x2074d):await this[_0x4d9630(0xde)](_0x218b33,_0x2074d);}catch(_0x2f9c3b){if(_0x2f9c3b instanceof SDKError)return console['error'](_0x4d9630(0x104)+_0x2f9c3b[_0x4d9630(0xf3)]),_0x2f9c3b[_0x4d9630(0xfe)]&&console[_0x4d9630(0x115)](_0x4d9630(0x10b)+_0x2f9c3b[_0x4d9630(0xfe)]),0x1;throw _0x2f9c3b;}}async[a39_0x54b069(0xf9)](_0x2e31c4,_0x54d7e5,_0x23afa1){const _0x3cc7e1=a39_0x54b069,{options:_0x20ca0f,tdx:_0x15f94c}=_0x2e31c4,_0x55964c=_0x20ca0f['web'],_0x215f17=await withSpinner(_0x3cc7e1(0xf1)+_0x54d7e5+_0x3cc7e1(0xf4),()=>_0x15f94c[_0x3cc7e1(0xcf)][_0x3cc7e1(0x116)](_0x54d7e5),{'verbose':_0x20ca0f[_0x3cc7e1(0x11b)]}),_0x1558d9=_0x215f17[_0x3cc7e1(0x11e)],_0x5bb813=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>Promise[_0x3cc7e1(0xe2)]([_0x15f94c[_0x3cc7e1(0xcf)][_0x3cc7e1(0xde)](_0x1558d9[_0x3cc7e1(0x111)],_0x1558d9[_0x3cc7e1(0x107)]),_0x15f94c[_0x3cc7e1(0xe9)][_0x3cc7e1(0xe5)](_0x1558d9['parentId'])]),{'verbose':_0x20ca0f[_0x3cc7e1(0x11b)]}),[_0x20a0e7,_0x450158]=_0x5bb813[_0x3cc7e1(0x11e)],{folders:_0x41d592,segments:_0x5262a8}=_0x20a0e7,_0x205c0e=_0x23afa1[_0x3cc7e1(0xd5)](/[.+^${}()|[\]\\]/g,_0x3cc7e1(0x113))['replace'](/\*/g,'.*')[_0x3cc7e1(0xd5)](/\?/g,'.'),_0x8c4c3d=new RegExp('^'+_0x205c0e+'$','i'),_0x340468=_0x41d592[_0x3cc7e1(0xee)](_0x36e5da=>_0x8c4c3d[_0x3cc7e1(0xff)](_0x36e5da[_0x3cc7e1(0xe1)])),_0x2fdcdb=_0x5262a8[_0x3cc7e1(0xee)](_0x1e9666=>_0x8c4c3d[_0x3cc7e1(0xff)](_0x1e9666[_0x3cc7e1(0xe1)])),_0x4b3932=_0x450158[_0x3cc7e1(0xee)](_0x15e382=>_0x8c4c3d[_0x3cc7e1(0xff)](_0x15e382['journeyBundleName'])),_0x165eb8=_0x340468[_0x3cc7e1(0xe3)]+_0x2fdcdb[_0x3cc7e1(0xe3)]+_0x4b3932[_0x3cc7e1(0xe3)];console['error']('✔\x20Found\x20'+_0x340468[_0x3cc7e1(0xe3)]+_0x3cc7e1(0x10f)+(_0x340468[_0x3cc7e1(0xe3)]!==0x1?'s':'')+',\x20'+_0x2fdcdb[_0x3cc7e1(0xe3)]+_0x3cc7e1(0xd1)+(_0x2fdcdb[_0x3cc7e1(0xe3)]!==0x1?'s':'')+_0x3cc7e1(0xd2)+_0x4b3932[_0x3cc7e1(0xe3)]+_0x3cc7e1(0x105)+(_0x4b3932[_0x3cc7e1(0xe3)]!==0x1?'s':'')+_0x3cc7e1(0xfd)+_0x23afa1+'\x27');const _0x4c84d0=_0xc3fa32=>{const _0x50da2d=_0x3cc7e1;return getConsoleNextUrl(_0x20ca0f[_0x50da2d(0xf0)],_0x50da2d(0xd9)+_0x1558d9[_0x50da2d(0x111)]+_0x50da2d(0xda)+_0xc3fa32);},_0x290d55=_0x20ca0f[_0x3cc7e1(0x10d)]===_0x3cc7e1(0x11c)||_0x20ca0f[_0x3cc7e1(0x10d)]===_0x3cc7e1(0xdf);if(_0x290d55){const _0x203001=[..._0x340468[_0x3cc7e1(0xf8)](_0x546cea=>({..._0x546cea,'type':_0x3cc7e1(0x101)})),..._0x2fdcdb['map'](_0x35e336=>({..._0x35e336,'type':_0x3cc7e1(0xcf),'url':_0x4c84d0(_0x35e336['id'])})),..._0x4b3932['map'](_0x21d1be=>({..._0x21d1be,'name':_0x21d1be['journeyBundleName'],'type':_0x3cc7e1(0xe9)}))][_0x3cc7e1(0xfa)]((_0x421998,_0x1b5e21)=>_0x421998[_0x3cc7e1(0xe1)][_0x3cc7e1(0x10e)](_0x1b5e21[_0x3cc7e1(0xe1)]));await handleSDKOutput(_0x203001,_0x20ca0f);}else{if(_0x165eb8===0x0)console[_0x3cc7e1(0x117)](_0x3cc7e1(0x109)+_0x23afa1);else{console[_0x3cc7e1(0x117)](a39_0x197811[_0x3cc7e1(0x119)]('['+_0x54d7e5+_0x3cc7e1(0xe7)+_0x23afa1+'\x27'));const _0x44977a=formatFlatList(_0x340468,_0x2fdcdb,{'showMetadata':!![],'showUrl':_0x55964c,'getSegmentUrl':_0x4c84d0},_0x4b3932);console[_0x3cc7e1(0x117)](_0x44977a);}}return 0x0;}async[a39_0x54b069(0xde)](_0xb247d0,_0x34a519){const _0x54e021=a39_0x54b069,{options:_0x109057,tdx:_0x350d1e}=_0xb247d0,_0x45a6a2=_0x109057[_0x54e021(0xd6)],_0xda2479=await withSpinner(_0x54e021(0xd0)+_0x34a519+'\x27...',()=>_0x350d1e[_0x54e021(0xcf)][_0x54e021(0x116)](_0x34a519),{'verbose':_0x109057[_0x54e021(0x11b)]}),_0x27e5b1=_0xda2479['data'];_0x109057['verbose']&&(console[_0x54e021(0x115)](_0x54e021(0xd3)+_0x27e5b1['parentId']),_0x27e5b1[_0x54e021(0x107)]&&console[_0x54e021(0x115)](_0x54e021(0xf6)+_0x27e5b1[_0x54e021(0x107)]));const _0x43d826=await withSpinner(_0x54e021(0xed),()=>Promise[_0x54e021(0xe2)]([_0x350d1e[_0x54e021(0xcf)][_0x54e021(0xde)](_0x27e5b1[_0x54e021(0x111)],_0x27e5b1[_0x54e021(0x107)]),_0x350d1e['journey'][_0x54e021(0xe5)](_0x27e5b1['parentId'])]),{'verbose':_0x109057[_0x54e021(0x11b)]}),[_0x8a4ae9,_0x12cd63]=_0x43d826[_0x54e021(0x11e)],{folders:_0x2be11f,segments:_0x42dd36}=_0x8a4ae9,_0x674b11=_0x2be11f[_0x54e021(0xe3)]+_0x42dd36[_0x54e021(0xe3)]+_0x12cd63[_0x54e021(0xe3)];console[_0x54e021(0x115)](_0x54e021(0xe4)+_0x2be11f[_0x54e021(0xe3)]+_0x54e021(0x10f)+(_0x2be11f[_0x54e021(0xe3)]!==0x1?'s':'')+',\x20'+_0x42dd36[_0x54e021(0xe3)]+'\x20segment'+(_0x42dd36[_0x54e021(0xe3)]!==0x1?'s':'')+_0x54e021(0xd2)+_0x12cd63[_0x54e021(0xe3)]+_0x54e021(0x105)+(_0x12cd63['length']!==0x1?'s':''));const _0x257381=_0x145bbd=>{const _0x41c373=_0x54e021;return getConsoleNextUrl(_0x109057[_0x41c373(0xf0)],_0x41c373(0xd9)+_0x27e5b1[_0x41c373(0x111)]+_0x41c373(0xda)+_0x145bbd);},_0x1abd4f=_0x322ef9=>{const _0x9bb890=_0x54e021;return getConsoleNextUrl(_0x109057['site'],_0x9bb890(0xd9)+_0x27e5b1['parentId']+_0x9bb890(0xda)+_0x322ef9+_0x9bb890(0x100));},_0x26d590=_0x109057[_0x54e021(0x10d)]==='json'||_0x109057[_0x54e021(0x10d)]==='jsonl';if(_0x26d590){const _0x2d7d2b=[..._0x2be11f[_0x54e021(0xf8)](_0x3465f2=>({..._0x3465f2,'type':'folder'})),..._0x42dd36[_0x54e021(0xf8)](_0x48e03a=>({..._0x48e03a,'type':_0x54e021(0xcf),'url':_0x257381(_0x48e03a['id'])})),..._0x12cd63[_0x54e021(0xf8)](_0x2ee233=>({..._0x2ee233,'name':_0x2ee233[_0x54e021(0xe0)],'type':_0x54e021(0xe9),'url':_0x1abd4f(_0x2ee233['id'])}))][_0x54e021(0xfa)]((_0x7009da,_0x159707)=>_0x7009da[_0x54e021(0xe1)][_0x54e021(0x10e)](_0x159707['name']));await handleSDKOutput(_0x2d7d2b,_0x109057);}else{if(_0x674b11===0x0)console[_0x54e021(0x117)](a39_0x197811[_0x54e021(0x119)]('['+_0x34a519+']')),console[_0x54e021(0x117)](_0x54e021(0x110));else{console[_0x54e021(0x117)](a39_0x197811[_0x54e021(0x119)]('['+_0x34a519+']'));const _0x961207=formatFlatList(_0x2be11f,_0x42dd36,{'showMetadata':!![],'showUrl':_0x45a6a2,'getSegmentUrl':_0x257381,'getJourneyUrl':_0x1abd4f},_0x12cd63);console[_0x54e021(0x117)](_0x961207);}}return 0x0;}async['listRecursive'](_0x2d049c,_0x27720b){const _0x72b922=a39_0x54b069,{options:_0x3a362d,tdx:_0x32f1e7}=_0x2d049c,_0x9960e1=_0x3a362d[_0x72b922(0xd6)],_0x5efb3c=await withSpinner(_0x72b922(0xd0)+_0x27720b+_0x72b922(0xf4),()=>_0x32f1e7[_0x72b922(0xcf)][_0x72b922(0x116)](_0x27720b),{'verbose':_0x3a362d[_0x72b922(0x11b)]}),_0x220a8c=_0x5efb3c[_0x72b922(0x11e)];_0x3a362d[_0x72b922(0x11b)]&&(console[_0x72b922(0x115)](_0x72b922(0xd3)+_0x220a8c['parentId']),_0x220a8c[_0x72b922(0x107)]&&console[_0x72b922(0x115)](_0x72b922(0xf6)+_0x220a8c[_0x72b922(0x107)]));const _0x175f1d=_0x3a362d['maxDepth']||0xa,_0x4c7d1a=await withSpinner(_0x72b922(0xef),()=>_0x32f1e7[_0x72b922(0xcf)][_0x72b922(0x11d)](_0x220a8c['parentId'],_0x220a8c['folderId'],0x0,_0x175f1d),{'verbose':_0x3a362d[_0x72b922(0x11b)]}),_0x27e586=_0x4c7d1a[_0x72b922(0x11e)];console[_0x72b922(0x115)](_0x72b922(0xf2)+_0x27e586[_0x72b922(0xe3)]+_0x72b922(0x108));const _0x5bed69=_0x2b7d22=>{const _0x686cf2=_0x72b922;return getConsoleNextUrl(_0x3a362d[_0x686cf2(0xf0)],_0x686cf2(0xd9)+_0x220a8c['parentId']+_0x686cf2(0xda)+_0x2b7d22);};if(_0x3a362d[_0x72b922(0x10d)]===_0x72b922(0x11c)||_0x3a362d[_0x72b922(0x10d)]===_0x72b922(0xdf))await handleSDKOutput(_0x27e586,_0x3a362d);else{console[_0x72b922(0x117)](a39_0x197811[_0x72b922(0x119)]('['+_0x27720b+']'));const _0x3c6b62=formatTree(_0x27e586,{'showMetadata':!![],'showUrl':_0x9960e1,'getSegmentUrl':_0x5bed69});console[_0x72b922(0x117)](_0x3c6b62);}return 0x0;}}
|
|
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;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0xeb159f=a40_0x5216;(function(_0x28519e,_0x2c8a21){const _0x245798=a40_0x5216,_0x94c9f4=_0x28519e();while(!![]){try{const _0x266856=-parseInt(_0x245798(0x1a3))/0x1+parseInt(_0x245798(0x189))/0x2+-parseInt(_0x245798(0x18c))/0x3*(-parseInt(_0x245798(0x1a8))/0x4)+-parseInt(_0x245798(0x183))/0x5*(parseInt(_0x245798(0x180))/0x6)+parseInt(_0x245798(0x190))/0x7*(parseInt(_0x245798(0x19c))/0x8)+parseInt(_0x245798(0x1a4))/0x9*(-parseInt(_0x245798(0x198))/0xa)+parseInt(_0x245798(0x192))/0xb;if(_0x266856===_0x2c8a21)break;else _0x94c9f4['push'](_0x94c9f4['shift']());}catch(_0x2933da){_0x94c9f4['push'](_0x94c9f4['shift']());}}}(a40_0x597f,0xc3908));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a40_0x597f(){const _0x2f97db=['Querying\x20','length','Limit:\x20','244493XrrWKc','10555029WOaWMs','show','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Usage:\x20tdx\x20show\x20<database.table>','32JcjeDi','\x20row','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','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','verbose','5924562fPMuyQ','validate','name','5wTlEQd','limit','catalog','data','error','message','3088926tsvcas','Database:\x20','cause','149745GGasJa','args','query','table','259973pPZLix','site','13472921QUXoXP','execute','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','Show\x20table\x20contents','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Error:\x20','10rktPvB','database','showTable','✔\x20Retrieved\x20','8BwIdPU','Site:\x20','description','Table:\x20'];a40_0x597f=function(){return _0x2f97db;};return a40_0x597f();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a40_0x5216(_0x1202f0,_0x1e198f){_0x1202f0=_0x1202f0-0x17f;const _0x597f4a=a40_0x597f();let _0x5216ce=_0x597f4a[_0x1202f0];return _0x5216ce;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a40_0xeb159f(0x182)]=a40_0xeb159f(0x1a5);[a40_0xeb159f(0x19e)]=a40_0xeb159f(0x195);async[a40_0xeb159f(0x193)](_0x6ddb93){return this['showTable'](_0x6ddb93);}async[a40_0xeb159f(0x19a)](_0x20571d){const _0x4906de=a40_0xeb159f,{options:_0x18cd8d,args:_0x2c6741,tdx:_0x2d8726}=_0x20571d;let _0x34c823;try{_0x34c823=parseTableReference(_0x2c6741[0x0]);const _0x1cef8e=_0x18cd8d[_0x4906de(0x199)];!_0x34c823['database']&&_0x1cef8e&&(_0x34c823[_0x4906de(0x199)]=_0x1cef8e);const _0x563009=validateTableDescribeReference(_0x34c823);if(_0x563009)return console[_0x4906de(0x187)](_0x4906de(0x197)+_0x563009),console[_0x4906de(0x187)](_0x4906de(0x1a7)),console['error'](_0x4906de(0x196)),console[_0x4906de(0x187)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x4ab066){return console[_0x4906de(0x187)]('Error:\x20'+_0x4ab066[_0x4906de(0x188)]),console['error'](_0x4906de(0x1a7)),console['error'](_0x4906de(0x196)),console['error'](_0x4906de(0x1a6)),0x1;}const _0x2ee379=_0x34c823[_0x4906de(0x185)],_0x464098=_0x34c823['database'],_0x26c8a2=_0x34c823[_0x4906de(0x18f)],_0xeff7=resolveLimit(_0x18cd8d[_0x4906de(0x184)],DEFAULT_DISPLAY_LIMIT);try{_0x18cd8d['verbose']&&(console[_0x4906de(0x187)](_0x4906de(0x19d)+_0x18cd8d[_0x4906de(0x191)]),_0x2ee379&&console[_0x4906de(0x187)]('Catalog:\x20'+_0x2ee379),console['error'](_0x4906de(0x18a)+_0x464098),console[_0x4906de(0x187)](_0x4906de(0x19f)+_0x26c8a2),console[_0x4906de(0x187)](_0x4906de(0x1a2)+_0xeff7));const _0xafb6a5=_0x2ee379?_0x2ee379+'.'+_0x464098+'.'+_0x26c8a2:_0x464098+'.'+_0x26c8a2,_0x13ff28=await withSpinner(_0x4906de(0x1a0)+_0xafb6a5+'...',()=>_0x2d8726[_0x4906de(0x18e)][_0x4906de(0x19a)](_0x464098,_0x26c8a2,_0xeff7,_0x2ee379),{'verbose':_0x18cd8d[_0x4906de(0x17f)]}),_0x27f72d=_0x13ff28[_0x4906de(0x186)],_0x17a0f1=_0x27f72d[_0x4906de(0x186)];return _0x17a0f1[_0x4906de(0x1a1)]===0x0?console['error'](_0x4906de(0x1ab)):console['error'](_0x4906de(0x19b)+_0x17a0f1['length']+_0x4906de(0x1a9)+(_0x17a0f1[_0x4906de(0x1a1)]!==0x1?'s':'')+'\x20from\x20'+_0xafb6a5),await handleSDKOutput(_0x17a0f1,_0x18cd8d),0x0;}catch(_0x10311d){if(_0x10311d instanceof SDKError)return console[_0x4906de(0x187)](_0x4906de(0x197)+_0x10311d[_0x4906de(0x188)]),_0x10311d[_0x4906de(0x18b)]&&console['error']('\x20\x20Cause:\x20'+_0x10311d[_0x4906de(0x18b)]),0x1;throw _0x10311d;}}[a40_0xeb159f(0x181)](_0x36c737){const _0x4ac4ec=a40_0xeb159f;if(_0x36c737[_0x4ac4ec(0x18d)][_0x4ac4ec(0x1a1)]===0x0)return _0x4ac4ec(0x1aa);if(_0x36c737[_0x4ac4ec(0x18d)][_0x4ac4ec(0x1a1)]>0x1)return _0x4ac4ec(0x194);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x22dfed=a41_0x49ee;(function(_0x3e28ae,_0x21b62f){const _0x48585f=a41_0x49ee,_0x3973ae=_0x3e28ae();while(!![]){try{const _0x5d9269=-parseInt(_0x48585f(0x142))/0x1+parseInt(_0x48585f(0x13d))/0x2+parseInt(_0x48585f(0x15c))/0x3*(-parseInt(_0x48585f(0x158))/0x4)+parseInt(_0x48585f(0x150))/0x5+-parseInt(_0x48585f(0x162))/0x6*(-parseInt(_0x48585f(0x161))/0x7)+parseInt(_0x48585f(0x146))/0x8*(parseInt(_0x48585f(0x15d))/0x9)+-parseInt(_0x48585f(0x156))/0xa*(-parseInt(_0x48585f(0x13b))/0xb);if(_0x5d9269===_0x21b62f)break;else _0x3973ae['push'](_0x3973ae['shift']());}catch(_0x348371){_0x3973ae['push'](_0x3973ae['shift']());}}}(a41_0x33c7,0x4a0f8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a41_0x33c7(){const _0x2b1998=['522834SDjjuN','listTables','database','\x27\x20is\x20ambiguous.','3488696IsvYdS','length','verbose','data','✖\x20No\x20tables\x20found','validate','tables','\x20table','.*\x22','List\x20tables\x20in\x20a\x20database','1414455dSpBKc','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Table\x20pattern:\x20','table','30uixDam','name','1776356deyscd','Site:\x20','Database:\x20all','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','3EFRMtW','9xwEaZz','includes','message','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','7ekgbGI','166302JwZxQP','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','error','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database\x20pattern:\x20','\x27\x20across\x20all\x20databases.','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Database\x20\x27','description','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','Listing\x20tables...','limit','111991TUHFvO','cause','986074LlcJpi','query','execute','Error:\x20','Error:\x20Pattern\x20\x27'];a41_0x33c7=function(){return _0x2b1998;};return a41_0x33c7();}function a41_0x49ee(_0x42a8ce,_0x89ac7){_0x42a8ce=_0x42a8ce-0x137;const _0x33c7ad=a41_0x33c7();let _0x49eed=_0x33c7ad[_0x42a8ce];return _0x49eed;}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a41_0x22dfed(0x157)]=a41_0x22dfed(0x14c);[a41_0x22dfed(0x137)]=a41_0x22dfed(0x14f);async[a41_0x22dfed(0x13f)](_0x4bc906){const _0x298213=a41_0x22dfed,{options:_0x4a25e9,args:_0x583a41,tdx:_0x53f1dd}=_0x4bc906;let _0x560416;if(_0x583a41[_0x298213(0x147)]===0x0)_0x560416={'database':undefined,'table':undefined,'original':''};else{if(_0x583a41[_0x298213(0x147)]===0x1)try{_0x560416=parseTableReference(_0x583a41[0x0]);if(_0x560416[_0x298213(0x155)]&&!_0x560416['database']&&!_0x560416[_0x298213(0x155)][_0x298213(0x15e)]('*')&&!_0x560416['table'][_0x298213(0x15e)]('?'))return console['error'](_0x298213(0x141)+_0x583a41[0x0]+_0x298213(0x145)),console[_0x298213(0x164)](_0x298213(0x138)+_0x560416['table']+'\x27?'),console[_0x298213(0x164)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x560416[_0x298213(0x155)]+_0x298213(0x14e)),console['error'](_0x298213(0x152)+_0x560416[_0x298213(0x155)]),console[_0x298213(0x164)](_0x298213(0x160)+_0x560416['table']),console[_0x298213(0x164)](''),console[_0x298213(0x164)]('Note:\x20\x27'+_0x583a41[0x0]+_0x298213(0x168)+_0x560416[_0x298213(0x155)]+_0x298213(0x167)),0x1;}catch(_0x5c2c1e){return console[_0x298213(0x164)]('Error:\x20'+_0x5c2c1e[_0x298213(0x15f)]),0x1;}else return console[_0x298213(0x164)](_0x298213(0x163)),console[_0x298213(0x164)](_0x298213(0x153)),console['error'](_0x298213(0x165)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x298213(0x164)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x298213(0x164)]('Or\x20use\x20--in\x20flag:'),console[_0x298213(0x164)](_0x298213(0x15b)),0x1;}const _0x1a82ad=_0x4a25e9[_0x298213(0x144)];!_0x560416['database']&&_0x1a82ad&&(_0x560416['database']=_0x1a82ad);try{const _0x137f58=_0x21a426=>_0x21a426&&(_0x21a426[_0x298213(0x15e)]('*')||_0x21a426[_0x298213(0x15e)]('?')),_0x3477f2=_0x137f58(_0x560416[_0x298213(0x144)]);_0x4a25e9['verbose']&&(console[_0x298213(0x164)](_0x298213(0x159)+_0x4a25e9['site']),_0x560416[_0x298213(0x144)]?_0x3477f2?console[_0x298213(0x164)](_0x298213(0x166)+_0x560416[_0x298213(0x144)]):console['error']('Database:\x20'+_0x560416[_0x298213(0x144)]):console[_0x298213(0x164)](_0x298213(0x15a)),_0x560416[_0x298213(0x155)]&&console[_0x298213(0x164)](_0x298213(0x154)+_0x560416['table']));const _0x1acfcf=_0x560416[_0x298213(0x144)]&&!_0x3477f2?_0x560416['database']:undefined,_0x4e2827=_0x3477f2?_0x560416[_0x298213(0x144)]:undefined,_0xe21a89=_0x560416['table'],_0x375cae=resolveLimit(_0x4a25e9[_0x298213(0x13a)],DEFAULT_LISTING_LIMIT),_0x2b2431=await withSpinner(_0x298213(0x139),()=>_0x53f1dd[_0x298213(0x13e)][_0x298213(0x143)](_0x1acfcf,_0xe21a89,_0x4e2827,_0x375cae),{'verbose':_0x4a25e9[_0x298213(0x148)]}),_0x55edd3=_0x2b2431[_0x298213(0x149)];if(_0x55edd3[_0x298213(0x147)]===0x0&&_0x560416[_0x298213(0x144)]&&!_0x3477f2)return console[_0x298213(0x164)](_0x298213(0x14a)),console[_0x298213(0x164)](_0x298213(0x169)+_0x560416[_0x298213(0x144)]+_0x298213(0x151)),0x1;return console[_0x298213(0x164)]('✔\x20Found\x20'+_0x55edd3[_0x298213(0x147)]+_0x298213(0x14d)+(_0x55edd3[_0x298213(0x147)]!==0x1?'s':'')),await handleSDKOutput(_0x55edd3,{..._0x4a25e9,'limit':_0x375cae}),0x0;}catch(_0x5a07b5){if(_0x5a07b5 instanceof SDKError)return console[_0x298213(0x164)](_0x298213(0x140)+_0x5a07b5[_0x298213(0x15f)]),_0x5a07b5[_0x298213(0x13c)]&&console[_0x298213(0x164)]('\x20\x20Cause:\x20'+_0x5a07b5['cause']),0x1;throw _0x5a07b5;}}[a41_0x22dfed(0x14b)](_0x488f38){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0xed728e=a42_0x33d1;(function(_0x4be336,_0xd26c27){const _0x36081d=a42_0x33d1,_0x5ab659=_0x4be336();while(!![]){try{const _0x1e2e8b=-parseInt(_0x36081d(0xd8))/0x1*(parseInt(_0x36081d(0xf1))/0x2)+-parseInt(_0x36081d(0xf3))/0x3*(-parseInt(_0x36081d(0xcc))/0x4)+parseInt(_0x36081d(0xf7))/0x5+-parseInt(_0x36081d(0xf8))/0x6*(-parseInt(_0x36081d(0xcd))/0x7)+parseInt(_0x36081d(0xd6))/0x8*(parseInt(_0x36081d(0xda))/0x9)+parseInt(_0x36081d(0xe9))/0xa+parseInt(_0x36081d(0xd3))/0xb*(-parseInt(_0x36081d(0xcf))/0xc);if(_0x1e2e8b===_0xd26c27)break;else _0x5ab659['push'](_0x5ab659['shift']());}catch(_0x2a4e7b){_0x5ab659['push'](_0x5ab659['shift']());}}}(a42_0x45d8,0x5b768));function a42_0x45d8(){const _0x18be6d=['validate','Session\x20llm_project\x20set\x20to:\x20','2KYNHFc','log','2487EetlLz','llm_project','llm_agent','dim','2823110yyXeuo','11436XnjhVH','cleared','\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','database','error','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','message','(session:\x20','1940HlIatO','1120sMaofP','execute','516xyQWtK','engage_workspace','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','338591jmucvi','name','Session\x20parent_segment\x20set\x20to:\x20','4862864tEPWPg','display','568091QjuMrA','includes','9wFiJpZ','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','debug','toString','Invalid\x20resource:\x20','\x27\x20does\x20not\x20exist','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','length','Session\x20agent\x20set\x20to:\x20','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','Session\x20context\x20','Session\x20database\x20set\x20to:\x20','agent','session','3868010ZpBZll','parent_segment','profile','green','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Session\x20profile\x20set\x20to:\x20'];a42_0x45d8=function(){return _0x18be6d;};return a42_0x45d8();}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_0x1f0040 from'chalk';function a42_0x33d1(_0xb76e16,_0x53e652){_0xb76e16=_0xb76e16-0xcb;const _0x45d876=a42_0x45d8();let _0x33d1da=_0x45d876[_0xb76e16];return _0x33d1da;}export class UseCommand extends BaseCommand{[a42_0xed728e(0xd4)]='use';['description']='Set\x20session-level\x20context';[a42_0xed728e(0xef)](_0x324fcb){const _0x301a87=a42_0xed728e,{args:_0xd0847e}=_0x324fcb;if(_0xd0847e['length']===0x0)return undefined;if(_0xd0847e['length']===0x1)return _0x301a87(0xe0)+_0x301a87(0xfa)+_0x301a87(0xd2)+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a'+_0x301a87(0xe1);const _0x3cd89e=_0xd0847e[0x0],_0x23dbd7=['database',_0x301a87(0xea),_0x301a87(0xf4),'agent',_0x301a87(0xeb),_0x301a87(0xd0)];if(!_0x23dbd7[_0x301a87(0xd9)](_0x3cd89e))return _0x301a87(0xde)+_0x3cd89e+'.\x20Must\x20be\x20one\x20of:\x20'+_0x23dbd7['join'](',\x20');return undefined;}async[a42_0xed728e(0xce)](_0x3b874f){const _0x49b79c=a42_0xed728e,{args:_0x25c00d,options:_0x125bc9}=_0x3b874f,_0x3cce7b=_0x125bc9[_0x49b79c(0xdc)],_0x5b8136=_0x125bc9['clear'];cleanExpiredSessions();try{if(_0x5b8136){clearSessionContext(_0x125bc9['session']);const _0x5cd04f=_0x125bc9['session']||getCurrentSessionPID()['toString']();return console[_0x49b79c(0xf2)](_0x49b79c(0xe5)+a42_0x1f0040[_0x49b79c(0xec)](_0x49b79c(0xf9))+'\x20'+a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xcb)+_0x5cd04f+')')),0x0;}if(_0x25c00d[_0x49b79c(0xe2)]===0x0){const _0x561a27=new GlobalContext(_0x125bc9);return _0x3cce7b?_0x561a27['displayWithSources']():_0x561a27[_0x49b79c(0xd7)](),console[_0x49b79c(0xf2)](a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xe4))),console[_0x49b79c(0xf2)](a42_0x1f0040['dim'](_0x49b79c(0xdb))),0x0;}const _0x34a0af=_0x25c00d[0x0],_0x1cc8cd=_0x25c00d[0x1];if(_0x34a0af==='profile'){if(!profileExists(_0x1cc8cd))return console[_0x49b79c(0xfc)]('Error:\x20Profile\x20\x27'+_0x1cc8cd+_0x49b79c(0xdf)),console[_0x49b79c(0xfc)](_0x49b79c(0xfd)),0x1;const _0x4639bc=_0x125bc9['session']||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x1cc8cd},_0x125bc9[_0x49b79c(0xe8)]),console[_0x49b79c(0xf2)](_0x49b79c(0xee)+a42_0x1f0040[_0x49b79c(0xec)](_0x1cc8cd)+'\x20'+a42_0x1f0040[_0x49b79c(0xf6)]('(session:\x20'+_0x4639bc+')')),console[_0x49b79c(0xf2)](a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xed))),0x0;}const _0x416136={},_0x4e8060=_0x125bc9['session']||getCurrentSessionPID()[_0x49b79c(0xdd)]();switch(_0x34a0af){case _0x49b79c(0xfb):_0x416136['database']=_0x1cc8cd,console[_0x49b79c(0xf2)](_0x49b79c(0xe6)+a42_0x1f0040[_0x49b79c(0xec)](_0x1cc8cd)+'\x20'+a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xcb)+_0x4e8060+')'));break;case _0x49b79c(0xea):_0x416136[_0x49b79c(0xea)]=_0x1cc8cd,console[_0x49b79c(0xf2)](_0x49b79c(0xd5)+a42_0x1f0040[_0x49b79c(0xec)](_0x1cc8cd)+'\x20'+a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xcb)+_0x4e8060+')'));break;case _0x49b79c(0xf4):_0x416136['llm_project']=_0x1cc8cd,console['log'](_0x49b79c(0xf0)+a42_0x1f0040[_0x49b79c(0xec)](_0x1cc8cd)+'\x20'+a42_0x1f0040['dim']('(session:\x20'+_0x4e8060+')'));break;case _0x49b79c(0xe7):{const {projectName:_0x5711cb,agentName:_0x21c459}=parseAgentRef(_0x1cc8cd);_0x21c459?(_0x416136[_0x49b79c(0xf4)]=_0x5711cb,_0x416136[_0x49b79c(0xf5)]=_0x21c459,console[_0x49b79c(0xf2)](_0x49b79c(0xf0)+a42_0x1f0040[_0x49b79c(0xec)](_0x5711cb)+'\x20'+a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xcb)+_0x4e8060+')')),console[_0x49b79c(0xf2)](_0x49b79c(0xe3)+a42_0x1f0040[_0x49b79c(0xec)](_0x21c459)+'\x20'+a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xcb)+_0x4e8060+')'))):(_0x416136[_0x49b79c(0xf5)]=_0x1cc8cd,console['log'](_0x49b79c(0xe3)+a42_0x1f0040['green'](_0x1cc8cd)+'\x20'+a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xcb)+_0x4e8060+')')));break;}case _0x49b79c(0xd0):_0x416136[_0x49b79c(0xd0)]=_0x1cc8cd,console[_0x49b79c(0xf2)]('Session\x20engage_workspace\x20set\x20to:\x20'+a42_0x1f0040[_0x49b79c(0xec)](_0x1cc8cd)+'\x20'+a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xcb)+_0x4e8060+')'));break;}return saveSessionContext(_0x416136,_0x125bc9[_0x49b79c(0xe8)]),console[_0x49b79c(0xf2)](a42_0x1f0040[_0x49b79c(0xf6)](_0x49b79c(0xed))),0x0;}catch(_0x5a1899){return _0x5a1899 instanceof Error&&console[_0x49b79c(0xfc)](_0x49b79c(0xd1)+_0x5a1899[_0x49b79c(0xfe)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a43_0x141b(){const _0x1e9488=['verbose','data','✔\x20Found\x20','2NBYmBT','118560sWKATz','name','user','Listing\x20users...','\x20\x20Cause:\x20','\x20user','description','1082480LwyNjb','cause','Error:\x20','16977bNeeDc','410995fJuzSK','message','173984NNnLfD','error','Fetching\x20user\x20info...','execute','239189EGUCuw','60IwNeBI','Show\x20current\x20user\x20information','63SBrQGa','getCurrent','length','515892CNOKEX','List\x20all\x20users\x20in\x20the\x20account'];a43_0x141b=function(){return _0x1e9488;};return a43_0x141b();}const a43_0x690f4a=a43_0x1df9;(function(_0x3c68fd,_0x3f35e5){const _0x11b8f6=a43_0x1df9,_0x4c0c48=_0x3c68fd();while(!![]){try{const _0x5e284e=-parseInt(_0x11b8f6(0xfe))/0x1*(parseInt(_0x11b8f6(0x109))/0x2)+-parseInt(_0x11b8f6(0xf7))/0x3*(parseInt(_0x11b8f6(0xff))/0x4)+parseInt(_0x11b8f6(0xf8))/0x5+parseInt(_0x11b8f6(0x104))/0x6+parseInt(_0x11b8f6(0xf4))/0x7+-parseInt(_0x11b8f6(0xfa))/0x8*(-parseInt(_0x11b8f6(0x101))/0x9)+-parseInt(_0x11b8f6(0x10a))/0xa;if(_0x5e284e===_0x3f35e5)break;else _0x4c0c48['push'](_0x4c0c48['shift']());}catch(_0x380d6b){_0x4c0c48['push'](_0x4c0c48['shift']());}}}(a43_0x141b,0x21f77));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';export class UserCommand extends BaseCommand{[a43_0x690f4a(0xee)]=a43_0x690f4a(0xef);[a43_0x690f4a(0xf3)]=a43_0x690f4a(0x100);async[a43_0x690f4a(0xfd)](_0x8ace93){const _0x41e97d=a43_0x690f4a,{options:_0x10d00f,tdx:_0x408327}=_0x8ace93;try{const _0x23b483=await withSpinner(_0x41e97d(0xfc),()=>_0x408327[_0x41e97d(0xef)][_0x41e97d(0x102)](),{'verbose':_0x10d00f[_0x41e97d(0x106)]}),_0x5c6482=_0x23b483['data'];return await handleSingleObjectOutput(_0x5c6482,_0x10d00f),0x0;}catch(_0x3573eb){if(_0x3573eb instanceof SDKError)return console[_0x41e97d(0xfb)](_0x41e97d(0xf6)+_0x3573eb[_0x41e97d(0xf9)]),_0x3573eb['cause']&&console['error'](_0x41e97d(0xf1)+_0x3573eb[_0x41e97d(0xf5)]),0x1;throw _0x3573eb;}}}function a43_0x1df9(_0x4f98ee,_0x396984){_0x4f98ee=_0x4f98ee-0xee;const _0x141b9b=a43_0x141b();let _0x1df91e=_0x141b9b[_0x4f98ee];return _0x1df91e;}export class UserListCommand extends BaseCommand{[a43_0x690f4a(0xee)]='user\x20list';['description']=a43_0x690f4a(0x105);async[a43_0x690f4a(0xfd)](_0x52d755){const _0x4ec084=a43_0x690f4a,{options:_0x24cdfc,tdx:_0xc38d3c}=_0x52d755;try{const _0x1ed514=await withSpinner(_0x4ec084(0xf0),()=>_0xc38d3c['user']['list'](),{'verbose':_0x24cdfc['verbose']}),_0x219ada=_0x1ed514[_0x4ec084(0x107)];return console['error'](_0x4ec084(0x108)+_0x219ada[_0x4ec084(0x103)]+_0x4ec084(0xf2)+(_0x219ada[_0x4ec084(0x103)]!==0x1?'s':'')),await handleSDKOutput(_0x219ada,_0x24cdfc),0x0;}catch(_0x55247f){if(_0x55247f instanceof SDKError)return console[_0x4ec084(0xfb)]('Error:\x20'+_0x55247f[_0x4ec084(0xf9)]),_0x55247f['cause']&&console[_0x4ec084(0xfb)]('\x20\x20Cause:\x20'+_0x55247f[_0x4ec084(0xf5)]),0x1;throw _0x55247f;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a44_0x42df42=a44_0xaa61;(function(_0x4cc158,_0x40bbc7){const _0x5b6317=a44_0xaa61,_0x5bacf6=_0x4cc158();while(!![]){try{const _0x1d46c6=-parseInt(_0x5b6317(0x128))/0x1+-parseInt(_0x5b6317(0x18c))/0x2+parseInt(_0x5b6317(0x133))/0x3*(parseInt(_0x5b6317(0x168))/0x4)+parseInt(_0x5b6317(0x141))/0x5*(-parseInt(_0x5b6317(0x1b3))/0x6)+-parseInt(_0x5b6317(0x166))/0x7+-parseInt(_0x5b6317(0x130))/0x8+parseInt(_0x5b6317(0x1a8))/0x9;if(_0x1d46c6===_0x40bbc7)break;else _0x5bacf6['push'](_0x5bacf6['shift']());}catch(_0x46bbaf){_0x5bacf6['push'](_0x5bacf6['shift']());}}}(a44_0x19e3,0xe06f7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a44_0xaa61(_0x389cb0,_0x3bfba4){_0x389cb0=_0x389cb0-0x11f;const _0x19e385=a44_0x19e3();let _0xaa61b8=_0x19e385[_0x389cb0];return _0xaa61b8;}import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0x10c99b from'prompts';function a44_0x19e3(){const _0x4a91c1=['task','Task\x20name:\x20','38157687wvzLQo','Status:\x20','Filter:\x20project=','round','\x20\x20Attempt\x20ID:\x20','Retry\x20a\x20session\x20or\x20attempt','\x20\x20Files\x20extracted:\x20','includeSubtasks','startsWith','keys','sessions','8601732gvVDQg','description','running','\x20session','Target:\x20','Starting\x20workflow\x20run...','project','execute','run','Validation:\x20skipped','Output\x20directory:\x20','\x20attempt','cause','canceling','kill','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','force','index','651363kjVZoB','download','Fetching\x20log\x20files...','From\x20task:\x20','\x20\x20Project\x20ID:\x20','workflow:delete','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Resume\x20from:\x20','4579912qHsnbn','\x20\x20Workflow:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','37779FoUIaW','projectId','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:tasks','workflow:run','isArray','Error:\x20Project\x20name\x20is\x20required','Error:\x20Invalid\x20parameter\x20format:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','Listing\x20workflow\x20attempts...','Expected\x20format:\x20--param\x20key=value','stat','workflow:kill','verbose','5AEGdUj','getTime','success','param','Getting\x20attempt\x20tasks...','projects','Listing\x20workflow\x20sessions...','isDirectory','push','✔\x20Retry\x20started','map','workflows','retryAttempt','Pattern:\x20','attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Session\x20time:\x20','length','delete','Start\x20a\x20workflow\x20run','error','\x20is\x20not\x20a\x20directory','\x20\x20Session\x20ID:\x20','Pushing\x20workflow\x20project...','name','Listing\x20workflows...','✔\x20Downloaded\x20','\x20\x20Project:\x20','session','yes','log','Revision:\x20','No\x20log\x20content\x20found','attempt:','Retrying\x20session...','stringify','\x20workflow','11043130uXFJPH','fileSize','532gpBKqk','from','Error:\x20','sessionTime','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Project\x20directory:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','status','Params:\x20','createdAt','indexOf','Downloading\x20logs...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','finishedAt','Include\x20retried:\x20yes','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','split','taskName','tasks','params','Downloading\x20project\x20','sessionId','data','\x20\x20Cause:\x20','includeRetried','message','revision','Cancelled','Getting\x20attempt\x20details...','workflow:download','Error:\x20Attempt\x20ID\x20is\x20required','session:','workflow:sessions','Retrying\x20attempt...','workflow:attempts','✔\x20Deleted\x20project\x20','1520522lcNWXZ','attempts','...','resumeFrom','workflow','\x20\x20Location:\x20','parse','substring','\x22?\x20This\x20cannot\x20be\x20undone.','workflow:logs','Project:\x20','\x20\x20Revision:\x20','workflow:workflows','select','Parameters:\x20','logs','Killing\x20attempt...','✔\x20Found\x20','Force:\x20yes','projectName','Attempt\x20ID:\x20','limit','filesExtracted','workflow:projects','retryAttemptName','Workflow:\x20'];a44_0x19e3=function(){return _0x4a91c1;};return a44_0x19e3();}export class WorkflowProjectsCommand extends BaseCommand{['name']=a44_0x42df42(0x1a3);['description']='List\x20all\x20workflow\x20projects';async['execute'](_0x5b524b){const _0x4dc3a8=a44_0x42df42,{options:_0x5c09f3,args:_0x8f6c67,tdx:_0xda7bea}=_0x5b524b,_0x2d22b6=_0x8f6c67[0x0];try{_0x5c09f3[_0x4dc3a8(0x140)]&&_0x2d22b6&&console[_0x4dc3a8(0x155)](_0x4dc3a8(0x14e)+_0x2d22b6);const _0x204f5a=await withSpinner('Listing\x20workflow\x20projects...',()=>_0xda7bea[_0x4dc3a8(0x190)][_0x4dc3a8(0x146)](_0x2d22b6,{'limit':_0x5c09f3[_0x4dc3a8(0x1a1)]}),{'verbose':_0x5c09f3[_0x4dc3a8(0x140)]}),_0x420973=_0x204f5a['data'];return console[_0x4dc3a8(0x155)](_0x4dc3a8(0x19d)+_0x420973['length']+'\x20project'+(_0x420973[_0x4dc3a8(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0x420973,_0x5c09f3),0x0;}catch(_0x36fede){if(_0x36fede instanceof SDKError)return console['error'](_0x4dc3a8(0x16a)+_0x36fede[_0x4dc3a8(0x181)]),_0x36fede[_0x4dc3a8(0x122)]&&console[_0x4dc3a8(0x155)]('\x20\x20Cause:\x20'+_0x36fede[_0x4dc3a8(0x122)]),0x1;throw _0x36fede;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x198);['description']='List\x20workflows';async[a44_0x42df42(0x1ba)](_0x1803ec){const _0x159ac3=a44_0x42df42,{options:_0x3b40bc,args:_0x46e5f6,tdx:_0x19436d}=_0x1803ec,_0xaa6357=_0x46e5f6[0x0];try{_0x3b40bc[_0x159ac3(0x140)]&&_0xaa6357&&console[_0x159ac3(0x155)]('Project\x20filter:\x20'+_0xaa6357);const _0x2192e6=await withSpinner(_0x159ac3(0x15a),()=>_0x19436d[_0x159ac3(0x190)][_0x159ac3(0x14c)](_0xaa6357,{'limit':_0x3b40bc['limit']}),{'verbose':_0x3b40bc[_0x159ac3(0x140)]}),_0x2e6ce9=_0x2192e6[_0x159ac3(0x17e)];return console[_0x159ac3(0x155)]('✔\x20Found\x20'+_0x2e6ce9[_0x159ac3(0x152)]+_0x159ac3(0x165)+(_0x2e6ce9['length']!==0x1?'s':'')),await handleSDKOutput(_0x2e6ce9,_0x3b40bc),0x0;}catch(_0x167dfe){if(_0x167dfe instanceof SDKError)return console[_0x159ac3(0x155)](_0x159ac3(0x16a)+_0x167dfe[_0x159ac3(0x181)]),_0x167dfe['cause']&&console['error']('\x20\x20Cause:\x20'+_0x167dfe[_0x159ac3(0x122)]),0x1;throw _0x167dfe;}}}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x188);[a44_0x42df42(0x1b4)]='List\x20workflow\x20execution\x20sessions';async[a44_0x42df42(0x1ba)](_0x4ca8a0){const _0x470be2=a44_0x42df42,{options:_0x8038bd,args:_0x59cbef,tdx:_0x4e009d}=_0x4ca8a0;let _0x3e8a45,_0x520018;if(_0x59cbef[0x0]){const _0x5af0ee=_0x59cbef[0x0][_0x470be2(0x178)]('.');if(_0x5af0ee[_0x470be2(0x152)]===0x1)_0x3e8a45=_0x5af0ee[0x0];else{if(_0x5af0ee[_0x470be2(0x152)]===0x2)[_0x3e8a45,_0x520018]=_0x5af0ee;else return console[_0x470be2(0x155)](_0x470be2(0x16e)),0x1;}}try{if(_0x8038bd['verbose']){if(_0x3e8a45&&_0x520018)console[_0x470be2(0x155)]('Filter:\x20'+_0x3e8a45+'.'+_0x520018);else _0x3e8a45&&console[_0x470be2(0x155)](_0x470be2(0x1aa)+_0x3e8a45);const _0x11005d=_0x8038bd[_0x470be2(0x16f)];_0x11005d&&console[_0x470be2(0x155)](_0x470be2(0x1a9)+_0x11005d);}const _0x9bba30=await withSpinner(_0x470be2(0x147),()=>_0x4e009d[_0x470be2(0x190)][_0x470be2(0x1b2)]({'projectName':_0x3e8a45,'workflowName':_0x520018,'status':_0x8038bd['status'],'fromTime':_0x8038bd[_0x470be2(0x169)],'toTime':_0x8038bd['to'],'limit':_0x8038bd['limit']}),{'verbose':_0x8038bd[_0x470be2(0x140)]}),_0x27cfce=_0x9bba30[_0x470be2(0x17e)];return console[_0x470be2(0x155)](_0x470be2(0x19d)+_0x27cfce[_0x470be2(0x152)]+_0x470be2(0x1b6)+(_0x27cfce['length']!==0x1?'s':'')),await handleSDKOutput(_0x27cfce,_0x8038bd),0x0;}catch(_0x535896){if(_0x535896 instanceof SDKError)return console[_0x470be2(0x155)](_0x470be2(0x16a)+_0x535896[_0x470be2(0x181)]),_0x535896[_0x470be2(0x122)]&&console['error'](_0x470be2(0x17f)+_0x535896[_0x470be2(0x122)]),0x1;throw _0x535896;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x18a);[a44_0x42df42(0x1b4)]='List\x20workflow\x20attempts';async[a44_0x42df42(0x1ba)](_0x3ef5f6){const _0x40405a=a44_0x42df42,{options:_0x395bb8,args:_0x39348d,tdx:_0x3e77ec}=_0x3ef5f6;let _0x347b23,_0x4b0b03;if(_0x39348d[0x0]){const _0x296e5c=_0x39348d[0x0][_0x40405a(0x178)]('.');if(_0x296e5c[_0x40405a(0x152)]===0x1)_0x347b23=_0x296e5c[0x0];else{if(_0x296e5c[_0x40405a(0x152)]===0x2)[_0x347b23,_0x4b0b03]=_0x296e5c;else return console['error'](_0x40405a(0x16e)),0x1;}}try{const _0x10bd22=_0x395bb8[_0x40405a(0x180)];if(_0x395bb8[_0x40405a(0x140)]){if(_0x347b23&&_0x4b0b03)console['error']('Filter:\x20'+_0x347b23+'.'+_0x4b0b03);else _0x347b23&&console[_0x40405a(0x155)]('Filter:\x20project='+_0x347b23);_0x10bd22&&console['error'](_0x40405a(0x176));}const _0x509fdb=await withSpinner(_0x40405a(0x13c),()=>_0x3e77ec[_0x40405a(0x190)][_0x40405a(0x18d)]({'projectName':_0x347b23,'workflowName':_0x4b0b03,'includeRetried':_0x10bd22,'limit':_0x395bb8[_0x40405a(0x1a1)]}),{'verbose':_0x395bb8['verbose']}),_0xf3ba64=_0x509fdb[_0x40405a(0x17e)];return console[_0x40405a(0x155)](_0x40405a(0x19d)+_0xf3ba64[_0x40405a(0x152)]+_0x40405a(0x121)+(_0xf3ba64[_0x40405a(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0xf3ba64,_0x395bb8),0x0;}catch(_0xc751c6){if(_0xc751c6 instanceof SDKError)return console['error'](_0x40405a(0x16a)+_0xc751c6[_0x40405a(0x181)]),_0xc751c6[_0x40405a(0x122)]&&console['error']('\x20\x20Cause:\x20'+_0xc751c6[_0x40405a(0x122)]),0x1;throw _0xc751c6;}}}export class WorkflowAttemptCommand extends BaseCommand{[a44_0x42df42(0x159)]='workflow:attempt';[a44_0x42df42(0x1b4)]='Show\x20specific\x20attempt\x20details';async['execute'](_0x342a11){const _0x2d2d7a=a44_0x42df42,{options:_0x203b6a,args:_0x42f9a9,tdx:_0x36122f}=_0x342a11,_0x1abec7=_0x42f9a9[0x0];if(!_0x1abec7)return console['error'](_0x2d2d7a(0x186)),0x1;try{_0x203b6a['verbose']&&console[_0x2d2d7a(0x155)]('Attempt\x20ID:\x20'+_0x1abec7);const _0x11dbd9=await withSpinner(_0x2d2d7a(0x184),()=>_0x36122f[_0x2d2d7a(0x190)]['attempt'](_0x1abec7),{'verbose':_0x203b6a[_0x2d2d7a(0x140)]}),_0x2ddd4f=_0x11dbd9[_0x2d2d7a(0x17e)];let _0x43708a;!_0x2ddd4f['done']?_0x43708a=_0x2ddd4f['cancelRequested']?_0x2d2d7a(0x123):_0x2d2d7a(0x1b5):_0x43708a=_0x2ddd4f[_0x2d2d7a(0x143)]?'success':_0x2d2d7a(0x155);let _0x5f34f0;if(_0x2ddd4f['createdAt']&&_0x2ddd4f[_0x2d2d7a(0x175)]){const _0x517c71=new Date(_0x2ddd4f['createdAt'])[_0x2d2d7a(0x142)](),_0x5e1200=new Date(_0x2ddd4f[_0x2d2d7a(0x175)])['getTime']();_0x5f34f0=Math[_0x2d2d7a(0x1ab)]((_0x5e1200-_0x517c71)/0x3e8);}const _0x5b87f2={'attempt_id':_0x2ddd4f['id'],'status':_0x43708a,..._0x2ddd4f[_0x2d2d7a(0x127)]!==undefined&&{'index':_0x2ddd4f[_0x2d2d7a(0x127)]},..._0x2ddd4f[_0x2d2d7a(0x1b9)]&&{'project':_0x2ddd4f[_0x2d2d7a(0x1b9)][_0x2d2d7a(0x159)]},..._0x2ddd4f['workflow']&&{'workflow':_0x2ddd4f['workflow'][_0x2d2d7a(0x159)]},..._0x2ddd4f[_0x2d2d7a(0x17d)]&&{'session_id':_0x2ddd4f[_0x2d2d7a(0x17d)]},..._0x2ddd4f[_0x2d2d7a(0x16b)]&&{'session_time':_0x2ddd4f[_0x2d2d7a(0x16b)]},..._0x2ddd4f[_0x2d2d7a(0x1a4)]&&{'retry_attempt':_0x2ddd4f['retryAttemptName']},..._0x5f34f0!==undefined&&{'duration_sec':_0x5f34f0},..._0x2ddd4f[_0x2d2d7a(0x171)]&&{'created_at':_0x2ddd4f['createdAt']},..._0x2ddd4f[_0x2d2d7a(0x175)]&&{'finished_at':_0x2ddd4f[_0x2d2d7a(0x175)]},...Object['keys'](_0x2ddd4f[_0x2d2d7a(0x17b)])[_0x2d2d7a(0x152)]>0x0&&{'params':_0x2ddd4f[_0x2d2d7a(0x17b)]}};return await handleSingleObjectOutput(_0x5b87f2,_0x203b6a),0x0;}catch(_0x35864f){if(_0x35864f instanceof SDKError)return console[_0x2d2d7a(0x155)](_0x2d2d7a(0x16a)+_0x35864f[_0x2d2d7a(0x181)]),_0x35864f['cause']&&console[_0x2d2d7a(0x155)](_0x2d2d7a(0x17f)+_0x35864f[_0x2d2d7a(0x122)]),0x1;throw _0x35864f;}}}export class WorkflowTasksCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x136);['description']='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x2350f6){const _0x476517=a44_0x42df42,{options:_0x57848c,args:_0x22cfec,tdx:_0x224b1a}=_0x2350f6,_0x392131=_0x22cfec[0x0];if(!_0x392131)return console[_0x476517(0x155)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x58ee4d=_0x57848c[_0x476517(0x1af)];_0x57848c[_0x476517(0x140)]&&(console[_0x476517(0x155)](_0x476517(0x1a0)+_0x392131),_0x58ee4d&&console[_0x476517(0x155)]('Including\x20subtasks:\x20yes'));const _0x33a131=await withSpinner(_0x476517(0x145),()=>_0x224b1a[_0x476517(0x190)][_0x476517(0x17a)](_0x392131,_0x58ee4d||![]),{'verbose':_0x57848c[_0x476517(0x140)]}),_0x56f81a=_0x33a131['data'];return console[_0x476517(0x155)]('✔\x20Found\x20'+_0x56f81a[_0x476517(0x152)]+'\x20task'+(_0x56f81a[_0x476517(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0x56f81a,_0x57848c),0x0;}catch(_0x5c1097){if(_0x5c1097 instanceof SDKError)return console[_0x476517(0x155)](_0x476517(0x16a)+_0x5c1097['message']),_0x5c1097[_0x476517(0x122)]&&console[_0x476517(0x155)](_0x476517(0x17f)+_0x5c1097['cause']),0x1;throw _0x5c1097;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x195);[a44_0x42df42(0x1b4)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x300189){const _0x4ed597=a44_0x42df42,{options:_0x52be97,args:_0x24c13a,tdx:_0x45e5bc}=_0x300189,_0x4bc590=_0x24c13a[0x0];let _0x171e98=_0x24c13a[0x1];if(!_0x4bc590)return console['error'](_0x4ed597(0x186)),0x1;try{_0x52be97[_0x4ed597(0x140)]&&(console[_0x4ed597(0x155)](_0x4ed597(0x1a0)+_0x4bc590),_0x171e98&&console[_0x4ed597(0x155)](_0x4ed597(0x1a7)+_0x171e98));const _0x172236=await withSpinner(_0x4ed597(0x12a),()=>_0x45e5bc[_0x4ed597(0x190)]['logFiles'](_0x4bc590,_0x171e98),{'verbose':_0x52be97['verbose']}),_0x429e64=_0x172236['data'];if(_0x429e64['length']===0x0)return console[_0x4ed597(0x155)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x171e98&&(_0x52be97['json']||_0x52be97['format']))return await handleSDKOutput(_0x429e64,_0x52be97),0x0;if(!_0x171e98){const _0x224b57=_0x429e64[_0x4ed597(0x14b)](_0x1bc1e9=>({'title':_0x1bc1e9[_0x4ed597(0x179)]+'\x20('+formatBytes(_0x1bc1e9[_0x4ed597(0x167)])+')','value':_0x1bc1e9[_0x4ed597(0x179)]})),_0x17fd44=await a44_0x10c99b({'type':_0x4ed597(0x199),'name':_0x4ed597(0x1a6),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x224b57});if(!_0x17fd44[_0x4ed597(0x1a6)])return console[_0x4ed597(0x155)](_0x4ed597(0x183)),0x0;_0x171e98=_0x17fd44[_0x4ed597(0x1a6)];}const _0x3adf24=await withSpinner(_0x4ed597(0x173),()=>_0x45e5bc[_0x4ed597(0x190)][_0x4ed597(0x19b)](_0x4bc590,_0x171e98),{'verbose':_0x52be97['verbose']}),_0x3a2fe0=_0x3adf24[_0x4ed597(0x17e)];return _0x3a2fe0?console[_0x4ed597(0x15f)](_0x3a2fe0):console[_0x4ed597(0x155)](_0x4ed597(0x161)),0x0;}catch(_0x1d18d6){if(_0x1d18d6 instanceof SDKError)return console[_0x4ed597(0x155)](_0x4ed597(0x16a)+_0x1d18d6['message']),_0x1d18d6[_0x4ed597(0x122)]&&console[_0x4ed597(0x155)](_0x4ed597(0x17f)+_0x1d18d6['cause']),0x1;throw _0x1d18d6;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a44_0x42df42(0x13f);[a44_0x42df42(0x1b4)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x54ab75){const _0x35cb34=a44_0x42df42,{options:_0xfced00,args:_0x44d0c3,tdx:_0x742a1b}=_0x54ab75,_0x5dc081=_0x44d0c3[0x0];if(!_0x5dc081)return console[_0x35cb34(0x155)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x6b13b5=_0xfced00['reason'];_0xfced00[_0x35cb34(0x140)]&&(console[_0x35cb34(0x155)]('Attempt\x20ID:\x20'+_0x5dc081),_0x6b13b5&&console[_0x35cb34(0x155)]('Reason:\x20'+_0x6b13b5));if(!_0xfced00['yes']){const _0x13b223=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x5dc081+'?');if(!_0x13b223)return console[_0x35cb34(0x155)]('Cancelled'),0x0;}const _0x5c1520=await withSpinner(_0x35cb34(0x19c),()=>_0x742a1b[_0x35cb34(0x190)][_0x35cb34(0x124)](_0x5dc081,_0x6b13b5),{'verbose':_0xfced00['verbose']}),_0x4b98bb=_0x5c1520[_0x35cb34(0x17e)];return console[_0x35cb34(0x155)]('✔\x20'+_0x4b98bb),0x0;}catch(_0x5ab95f){if(_0x5ab95f instanceof SDKError)return console['error'](_0x35cb34(0x16a)+_0x5ab95f['message']),_0x5ab95f[_0x35cb34(0x122)]&&console[_0x35cb34(0x155)](_0x35cb34(0x17f)+_0x5ab95f[_0x35cb34(0x122)]),0x1;throw _0x5ab95f;}}}export class WorkflowRetryCommand extends BaseCommand{[a44_0x42df42(0x159)]='workflow:retry';[a44_0x42df42(0x1b4)]=a44_0x42df42(0x1ad);async[a44_0x42df42(0x1ba)](_0x2809b1){const _0x1486c9=a44_0x42df42,{options:_0xa205d7,args:_0x170c50,tdx:_0x421607}=_0x2809b1,_0xe38162=_0x170c50[0x0];if(!_0xe38162)return console[_0x1486c9(0x155)](_0x1486c9(0x12e)),console[_0x1486c9(0x155)](_0x1486c9(0x125)),0x1;let _0x32ae69=![],_0x1c1612=_0xe38162;if(_0xe38162[_0x1486c9(0x1b0)](_0x1486c9(0x187)))_0x32ae69=!![],_0x1c1612=_0xe38162[_0x1486c9(0x193)](0x8);else{if(_0xe38162['startsWith'](_0x1486c9(0x162)))_0x32ae69=![],_0x1c1612=_0xe38162['substring'](0x8);else return console[_0x1486c9(0x155)](_0x1486c9(0x177)),console[_0x1486c9(0x155)](_0x1486c9(0x125)),0x1;}try{const _0x1a4e1f=_0xa205d7['fromTask'],_0x1110fe=_0xa205d7[_0x1486c9(0x18f)],_0x3ba348=_0xa205d7[_0x1486c9(0x17b)],_0x4fe210=_0xa205d7[_0x1486c9(0x126)];_0xa205d7['verbose']&&(console['error'](_0x1486c9(0x1b7)+(_0x32ae69?_0x1486c9(0x15d):_0x1486c9(0x14f))+'\x20'+_0x1c1612),_0x1a4e1f&&console[_0x1486c9(0x155)](_0x1486c9(0x12b)+_0x1a4e1f),_0x1110fe&&console[_0x1486c9(0x155)](_0x1486c9(0x12f)+_0x1110fe),_0x3ba348&&console['error'](_0x1486c9(0x170)+_0x3ba348),_0x4fe210&&console[_0x1486c9(0x155)](_0x1486c9(0x19e)));let _0x1d91ee;if(_0x3ba348)try{if(_0x3ba348[_0x1486c9(0x1b0)]('@')){const _0x13fe70=await import('fs/promises'),_0x57fef9=_0x3ba348[_0x1486c9(0x193)](0x1),_0x154ce7=await _0x13fe70['readFile'](_0x57fef9,'utf-8');_0x1d91ee=JSON[_0x1486c9(0x192)](_0x154ce7);}else _0x1d91ee=JSON[_0x1486c9(0x192)](_0x3ba348);}catch{return console['error'](_0x1486c9(0x13b)),0x1;}if(!_0xa205d7[_0x1486c9(0x15e)]){const _0x364d65=await confirm(_0x1486c9(0x135)+(_0x32ae69?_0x1486c9(0x15d):_0x1486c9(0x14f))+'\x20'+_0x1c1612+'?');if(!_0x364d65)return console[_0x1486c9(0x155)](_0x1486c9(0x183)),0x0;}let _0x2a2d9f;_0x32ae69?_0x2a2d9f=await withSpinner(_0x1486c9(0x163),()=>_0x421607[_0x1486c9(0x190)]['retrySession'](_0x1c1612,{'fromTask':_0x1a4e1f,'retryParams':_0x1d91ee}),{'verbose':_0xa205d7['verbose']}):_0x2a2d9f=await withSpinner(_0x1486c9(0x189),()=>_0x421607[_0x1486c9(0x190)][_0x1486c9(0x14d)](_0x1c1612,{'resumeFrom':_0x1110fe,'retryParams':_0x1d91ee,'force':_0x4fe210}),{'verbose':_0xa205d7['verbose']});const _0x139c5a=_0x2a2d9f[_0x1486c9(0x17e)];return console['error'](_0x1486c9(0x14a)),console[_0x1486c9(0x155)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x139c5a['attemptId']),console[_0x1486c9(0x155)](_0x1486c9(0x157)+_0x139c5a[_0x1486c9(0x17d)]),0x0;}catch(_0x62c43f){if(_0x62c43f instanceof SDKError)return console[_0x1486c9(0x155)](_0x1486c9(0x16a)+_0x62c43f[_0x1486c9(0x181)]),_0x62c43f[_0x1486c9(0x122)]&&console[_0x1486c9(0x155)]('\x20\x20Cause:\x20'+_0x62c43f[_0x1486c9(0x122)]),0x1;throw _0x62c43f;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x137);[a44_0x42df42(0x1b4)]=a44_0x42df42(0x154);async[a44_0x42df42(0x1ba)](_0x3ab4b4){const _0x1bb862=a44_0x42df42,{options:_0x3e45a,args:_0xcca38b,tdx:_0x21805c}=_0x3ab4b4,_0x3f71a0=_0xcca38b[0x0];if(!_0x3f71a0)return console[_0x1bb862(0x155)]('Error:\x20Workflow\x20identifier\x20is\x20required'),console[_0x1bb862(0x155)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0xea7b8=_0x3e45a[_0x1bb862(0x144)],_0xf9f64d=_0x3e45a[_0x1bb862(0x16b)],_0x2d1ff0={};if(_0xea7b8&&Array[_0x1bb862(0x138)](_0xea7b8))for(const _0x14bbe4 of _0xea7b8){const _0x144d36=_0x14bbe4[_0x1bb862(0x172)]('=');if(_0x144d36===-0x1)return console[_0x1bb862(0x155)](_0x1bb862(0x13a)+_0x14bbe4),console['error'](_0x1bb862(0x13d)),0x1;const _0x435ca9=_0x14bbe4['substring'](0x0,_0x144d36),_0x21da68=_0x14bbe4[_0x1bb862(0x193)](_0x144d36+0x1);try{_0x2d1ff0[_0x435ca9]=JSON['parse'](_0x21da68);}catch{_0x2d1ff0[_0x435ca9]=_0x21da68;}}_0x3e45a[_0x1bb862(0x140)]&&(console[_0x1bb862(0x155)](_0x1bb862(0x1a5)+_0x3f71a0),Object[_0x1bb862(0x1b1)](_0x2d1ff0)['length']>0x0&&console[_0x1bb862(0x155)](_0x1bb862(0x19a)+JSON[_0x1bb862(0x164)](_0x2d1ff0)),_0xf9f64d&&console[_0x1bb862(0x155)](_0x1bb862(0x151)+_0xf9f64d));const _0x580105=await withSpinner(_0x1bb862(0x1b8),()=>_0x21805c[_0x1bb862(0x190)][_0x1bb862(0x1bb)](_0x3f71a0,_0x2d1ff0,{'sessionTime':_0xf9f64d}),{'verbose':_0x3e45a['verbose']}),_0x29a9ff=_0x580105[_0x1bb862(0x17e)];return console[_0x1bb862(0x155)]('✔\x20Workflow\x20run\x20started'),console[_0x1bb862(0x155)](_0x1bb862(0x1ac)+_0x29a9ff['id']),console[_0x1bb862(0x155)](_0x1bb862(0x157)+_0x29a9ff[_0x1bb862(0x17d)]),console[_0x1bb862(0x155)](_0x1bb862(0x15c)+_0x29a9ff[_0x1bb862(0x1b9)]?.[_0x1bb862(0x159)]),console[_0x1bb862(0x155)](_0x1bb862(0x131)+_0x29a9ff['workflow']?.['name']),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x185);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a44_0x42df42(0x1ba)](_0x2c21f7){const _0x47aab4=a44_0x42df42,{options:_0x1997fc,args:_0x2239c0,tdx:_0x2feee1}=_0x2c21f7,_0x372245=_0x2239c0[0x0],_0x1b9055=_0x2239c0[0x1]||'.';if(!_0x372245)return console[_0x47aab4(0x155)](_0x47aab4(0x139)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x3d6f3a=_0x1997fc[_0x47aab4(0x182)];_0x1997fc[_0x47aab4(0x140)]&&(console[_0x47aab4(0x155)](_0x47aab4(0x196)+_0x372245),console[_0x47aab4(0x155)](_0x47aab4(0x120)+_0x1b9055),_0x3d6f3a&&console[_0x47aab4(0x155)](_0x47aab4(0x160)+_0x3d6f3a));const _0x1768f9=await withSpinner(_0x47aab4(0x17c)+_0x372245+_0x47aab4(0x18e),()=>_0x2feee1['workflow'][_0x47aab4(0x129)](_0x372245,_0x1b9055,{'revision':_0x3d6f3a}),{'verbose':_0x1997fc[_0x47aab4(0x140)]}),_0x2b4f6c=_0x1768f9[_0x47aab4(0x17e)];return console[_0x47aab4(0x155)](_0x47aab4(0x15b)+_0x2b4f6c['projectName']),console[_0x47aab4(0x155)](_0x47aab4(0x197)+_0x2b4f6c[_0x47aab4(0x182)]),console['error'](_0x47aab4(0x1ae)+_0x2b4f6c[_0x47aab4(0x1a2)]),console['error'](_0x47aab4(0x191)+_0x1b9055+'/'+_0x2b4f6c[_0x47aab4(0x19f)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';[a44_0x42df42(0x1b4)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a44_0x42df42(0x1ba)](_0x567dbc){const _0x24cb23=a44_0x42df42,{options:_0x4eda32,args:_0x549380,tdx:_0x25e0c2}=_0x567dbc;let _0x7a18eb='.',_0x329cad=_0x4eda32['name'];if(_0x549380[0x0]){const {promises:_0x3606e3}=await import('fs');try{const _0x568346=await _0x3606e3[_0x24cb23(0x13e)](_0x549380[0x0]);if(_0x568346[_0x24cb23(0x148)]())_0x7a18eb=_0x549380[0x0];else return console['error']('Error:\x20'+_0x549380[0x0]+_0x24cb23(0x156)),0x1;}catch{_0x329cad=_0x549380[0x0],_0x7a18eb='.';}}const _0x49154d=_0x4eda32[_0x24cb23(0x182)],_0x4ddd7d=_0x4eda32['skipValidation'];_0x4eda32[_0x24cb23(0x140)]&&(console[_0x24cb23(0x155)](_0x24cb23(0x16d)+_0x7a18eb),_0x329cad&&console[_0x24cb23(0x155)]('Project\x20name:\x20'+_0x329cad),_0x49154d&&console[_0x24cb23(0x155)](_0x24cb23(0x160)+_0x49154d),_0x4ddd7d&&console[_0x24cb23(0x155)](_0x24cb23(0x11f)));const _0x35bbd5=await withSpinner(_0x24cb23(0x158),()=>_0x25e0c2['workflow'][_0x24cb23(0x149)](_0x7a18eb,{'projectName':_0x329cad,'revision':_0x49154d,'skipValidation':_0x4ddd7d}),{'verbose':_0x4eda32['verbose']}),_0x44e0d6=_0x35bbd5[_0x24cb23(0x17e)];return console[_0x24cb23(0x155)]('✔\x20Pushed\x20'+_0x44e0d6[_0x24cb23(0x19f)]),console[_0x24cb23(0x155)](_0x24cb23(0x12c)+_0x44e0d6[_0x24cb23(0x134)]),console[_0x24cb23(0x155)](_0x24cb23(0x197)+_0x44e0d6[_0x24cb23(0x182)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x42df42(0x159)]=a44_0x42df42(0x12d);[a44_0x42df42(0x1b4)]=a44_0x42df42(0x16c);async[a44_0x42df42(0x1ba)](_0x21708a){const _0x36fae7=a44_0x42df42,{options:_0x3d6478,args:_0x551280,tdx:_0x33977b}=_0x21708a,_0x28b06d=_0x551280[0x0];if(!_0x28b06d)return console[_0x36fae7(0x155)](_0x36fae7(0x150)),console[_0x36fae7(0x155)](_0x36fae7(0x132)),0x1;_0x3d6478[_0x36fae7(0x140)]&&console[_0x36fae7(0x155)]('Project:\x20'+_0x28b06d);if(!_0x3d6478['yes']){const _0x2bcac6=await confirm(_0x36fae7(0x174)+_0x28b06d+_0x36fae7(0x194));if(!_0x2bcac6)return console['error'](_0x36fae7(0x183)),0x0;}const _0x59786c=await withSpinner('Deleting\x20project\x20'+_0x28b06d+_0x36fae7(0x18e),()=>_0x33977b[_0x36fae7(0x190)][_0x36fae7(0x153)](_0x28b06d),{'verbose':_0x3d6478[_0x36fae7(0x140)]}),_0x4042e1=_0x59786c['data'];return console['error'](_0x36fae7(0x18b)+_0x4042e1[_0x36fae7(0x19f)]),console[_0x36fae7(0x155)](_0x36fae7(0x12c)+_0x4042e1[_0x36fae7(0x134)]),0x0;}}
|
|
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;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x368dcb,_0x5dd878){const _0x12cece=a45_0x1dbd,_0x29f1b0=_0x368dcb();while(!![]){try{const _0x5459ce=parseInt(_0x12cece(0x19f))/0x1*(-parseInt(_0x12cece(0x1a1))/0x2)+-parseInt(_0x12cece(0x1a4))/0x3*(parseInt(_0x12cece(0x1a7))/0x4)+parseInt(_0x12cece(0x195))/0x5*(-parseInt(_0x12cece(0x1a2))/0x6)+-parseInt(_0x12cece(0x1a0))/0x7+-parseInt(_0x12cece(0x1aa))/0x8+parseInt(_0x12cece(0x19d))/0x9*(-parseInt(_0x12cece(0x1a9))/0xa)+parseInt(_0x12cece(0x197))/0xb;if(_0x5459ce===_0x5dd878)break;else _0x29f1b0['push'](_0x29f1b0['shift']());}catch(_0x351aba){_0x29f1b0['push'](_0x29f1b0['shift']());}}}(a45_0x5c8d,0xc2860));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a45_0x1dbd(_0x3cc021,_0x175974){_0x3cc021=_0x3cc021-0x193;const _0x5c8db1=a45_0x5c8d();let _0x1dbde2=_0x5c8db1[_0x3cc021];return _0x1dbde2;}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0xd67be4=a45_0x1dbd;try{const _0x4e4d48=fileURLToPath(import.meta.url),_0x5aadb7=dirname(_0x4e4d48),_0x12ab8e=join(_0x5aadb7,_0xd67be4(0x198)),_0x3dca88=JSON[_0xd67be4(0x194)](readFileSync(_0x12ab8e,_0xd67be4(0x19e)));return _0x3dca88[_0xd67be4(0x1a6)];}catch{return _0xd67be4(0x19b);}}export function getUserAgent(){const _0x1d6765=a45_0x1dbd,_0x271e73=getVersion(),_0x2cefd8=platform(),_0x49e57d=process[_0x1d6765(0x1a6)][_0x1d6765(0x19c)]('v','');return _0x1d6765(0x1a5)+_0x271e73+'\x20('+_0x2cefd8+_0x1d6765(0x19a)+_0x49e57d+')';}export function getAuthHeaders(_0x502c06,_0x29552f){const _0x383d7c=a45_0x1dbd,_0x1f7f2f=getVersion(),_0x1ede89={'User-Agent':getUserAgent(),'X-TD-Client':_0x383d7c(0x193),'X-TD-Client-Version':_0x1f7f2f};return _0x29552f&&(_0x1ede89[_0x383d7c(0x199)]=_0x383d7c(0x1a3)+_0x29552f),_0x1ede89;}export function toHeaderRecord(_0x114ac9){const _0x24630c=a45_0x1dbd,_0x19b405={};for(const [_0x58520c,_0x6fe469]of Object[_0x24630c(0x196)](_0x114ac9)){_0x6fe469!==undefined&&(_0x19b405[_0x58520c]=_0x6fe469);}return _0x19b405;}function a45_0x5c8d(){const _0x20c6da=['Authorization',';\x20node/','0.0.0','replace','8820QUTbcd','utf-8','618444WnqFoK','10636920GeNjAN','4jOIIbw','2685318EiRRwK','TD1\x20','3798PhOIEP','tdx/','version','3860waDLfW','X-Trino-User','3940btaRCZ','8558904acoXcs','tdx','parse','15kLCvlA','entries','83309028dXkMJd','../../package.json'];a45_0x5c8d=function(){return _0x20c6da;};return a45_0x5c8d();}export function getTrinoHeaders(_0x952d6b,_0x362816){const _0x136f91=a45_0x1dbd,_0x3109a2=getAuthHeaders(_0x952d6b,_0x362816),_0x17b09d=toHeaderRecord(_0x3109a2);return delete _0x17b09d['Authorization'],_0x362816&&(_0x17b09d[_0x136f91(0x1a8)]=_0x362816),_0x17b09d;}export function hasAPIKey(_0x5ad18e){const _0x796b88=getAPIKey(_0x5ad18e);return _0x796b88!==undefined&&_0x796b88['length']>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xd436fa,_0x27a7da){const _0x5e2990=a46_0x1a85,_0x3db7d7=_0xd436fa();while(!![]){try{const _0x2ebee1=parseInt(_0x5e2990(0x11e))/0x1*(parseInt(_0x5e2990(0x126))/0x2)+-parseInt(_0x5e2990(0x10d))/0x3+parseInt(_0x5e2990(0x122))/0x4+-parseInt(_0x5e2990(0x11a))/0x5*(parseInt(_0x5e2990(0xf8))/0x6)+-parseInt(_0x5e2990(0x10e))/0x7*(-parseInt(_0x5e2990(0x10c))/0x8)+-parseInt(_0x5e2990(0x115))/0x9*(-parseInt(_0x5e2990(0xe5))/0xa)+parseInt(_0x5e2990(0xef))/0xb;if(_0x2ebee1===_0x27a7da)break;else _0x3db7d7['push'](_0x3db7d7['shift']());}catch(_0x2c68ec){_0x3db7d7['push'](_0x3db7d7['shift']());}}}(a46_0x1cd2,0xb24a8));import{homedir}from'os';function a46_0x1cd2(){const _0x48c739=['apiKey','22794LrUiDl','llm_default_project','Warning:\x20Unknown\x20site\x20\x27','.env','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','split','profiles','TDX_API_KEY\x20env\x20var','keychain\x20(profile:\x20','dev-eu01','env','includes','stg-us01','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','match','startsWith','Warning:\x20Failed\x20to\x20load\x20','source','entries','TDX_API_KEY_','28072TVesro','3147540JEPcmx','2443KvjabI','eu01','\x27,\x20defaulting\x20to\x20us01','us01','ap03','replace','account_info.','6471tmMuYs','toUpperCase','dev-us01','TDX_API_KEY_<PROFILE>','utf-8','855aUjMmO','llm_default_project.','\x20env\x20var','tdx.json','589231BnFdmM','TD_API_KEY','stg-ap03','legacy\x20.env\x20file\x20(profile:\x20','931240jfciaS','.env.','parse','.config','2cozUoB','legacy\x20.env\x20file','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','keychain','jp01','name','llm_default_agent.','existsSync','stg-jp01','TD_API_KEY\x20env\x20var\x20(deprecated)','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','yellow','warn','stringify','projectId','Warning:\x20Failed\x20to\x20read\x20','filter','2440GxoKrs','apiKeys','readFileSync','accountId','trim','slice','ap02','profile','.json','join','2276681qPTxMO','string','number','TDX_API_KEY','site','some','TD_API_KEY_','endsWith'];a46_0x1cd2=function(){return _0x48c739;};return a46_0x1cd2();}import{join}from'path';function a46_0x1a85(_0x2eba8b,_0xb068d5){_0x2eba8b=_0x2eba8b-0xe0;const _0x1cd29e=a46_0x1cd2();let _0x1a85c8=_0x1cd29e[_0x2eba8b];return _0x1a85c8;}import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x52c338 from'node:fs';import*as a46_0x52ea98 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_0x5260c2 from'chalk';export function getConfigDir(){const _0x1d9a14=a46_0x1a85;return process[_0x1d9a14(0x102)]['TDX_CONFIG_DIR']||join(homedir(),_0x1d9a14(0x125),'tdx');}export function getConfigFile(){const _0x193d2f=a46_0x1a85;return join(getConfigDir(),_0x193d2f(0xfb));}export function getConfigFilePath(_0x467e5b){const _0x4230b5=a46_0x1a85,_0x253af7=getConfigDir();return _0x467e5b?a46_0x52ea98['join'](_0x253af7,_0x4230b5(0x123)+_0x467e5b):getConfigFile();}export function getCacheDir(){const _0x3476ed=a46_0x1a85;return process[_0x3476ed(0x102)]['TDX_CACHE_DIR']||join(homedir(),'.cache','tdx');}export function getLLMProjectCacheFile(_0x5e7d82){const _0x35b6a5=a46_0x1a85,_0x1eb9e5=_0x5e7d82?_0x35b6a5(0x11b)+_0x5e7d82:_0x35b6a5(0xf9);return join(getCacheDir(),_0x1eb9e5);}export function readCachedLLMProject(_0x2c3e1d){const _0x365664=a46_0x1a85;try{const _0x253400=getLLMProjectCacheFile(_0x2c3e1d);if(!existsSync(_0x253400))return null;const _0x6320d5=readFileSync(_0x253400,_0x365664(0x119))[_0x365664(0xe9)]();try{const _0x3ce07a=JSON[_0x365664(0x124)](_0x6320d5);if(_0x3ce07a&&typeof _0x3ce07a['id']===_0x365664(0xf0)&&typeof _0x3ce07a[_0x365664(0x12b)]===_0x365664(0xf0))return _0x3ce07a;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x38a150,_0x135c9f,_0x245c9d){const _0x353f2e=a46_0x1a85;try{const _0x732a81=getCacheDir(),_0x1381a9=getLLMProjectCacheFile(_0x245c9d);!existsSync(_0x732a81)&&mkdirSync(_0x732a81,{'recursive':!![]});const _0x268ff2={'name':_0x38a150,'id':_0x135c9f};writeFileSync(_0x1381a9,JSON[_0x353f2e(0xe1)](_0x268ff2),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x3f4e96){const _0x6022f1=a46_0x1a85,_0x1c068a=_0x3f4e96?_0x6022f1(0x12c)+_0x3f4e96:'llm_default_agent';return join(getCacheDir(),_0x1c068a);}export function readCachedLLMAgent(_0x1a2b74){const _0x47ae46=a46_0x1a85;try{const _0x46fe00=getLLMAgentCacheFile(_0x1a2b74);if(!existsSync(_0x46fe00))return null;const _0x212b14=readFileSync(_0x46fe00,_0x47ae46(0x119))[_0x47ae46(0xe9)]();try{const _0x3431f9=JSON['parse'](_0x212b14);if(_0x3431f9&&typeof _0x3431f9['id']===_0x47ae46(0xf0)&&typeof _0x3431f9[_0x47ae46(0x12b)]===_0x47ae46(0xf0)&&typeof _0x3431f9[_0x47ae46(0xe2)]==='string')return _0x3431f9;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x50a00a,_0x522e95,_0x164275,_0x28dde7){const _0x57e67d=a46_0x1a85;try{const _0x36dadd=getCacheDir(),_0x28c9b6=getLLMAgentCacheFile(_0x28dde7);!existsSync(_0x36dadd)&&mkdirSync(_0x36dadd,{'recursive':!![]});const _0x5a4281={'name':_0x50a00a,'id':_0x522e95,'projectId':_0x164275};writeFileSync(_0x28c9b6,JSON['stringify'](_0x5a4281),_0x57e67d(0x119));}catch{}}export function clearCachedLLMAgent(_0x1f5ca9){try{const _0x9fddf1=getLLMAgentCacheFile(_0x1f5ca9);existsSync(_0x9fddf1)&&unlinkSync(_0x9fddf1);}catch{}}export function getAccountInfoCacheFile(_0x42a58e){const _0x4abc79=a46_0x1a85,_0x1b8cdd=_0x42a58e?_0x4abc79(0x114)+_0x42a58e+_0x4abc79(0xed):'account_info.json';return join(getCacheDir(),_0x1b8cdd);}export function readCachedAccountInfo(_0x57fe2e){const _0x31f043=a46_0x1a85;try{const _0x318869=getAccountInfoCacheFile(_0x57fe2e);if(!existsSync(_0x318869))return null;const _0x48ca24=readFileSync(_0x318869,'utf-8')[_0x31f043(0xe9)](),_0x5c38a7=JSON[_0x31f043(0x124)](_0x48ca24);if(_0x5c38a7&&typeof _0x5c38a7[_0x31f043(0xf3)]===_0x31f043(0xf0)&&typeof _0x5c38a7[_0x31f043(0xe8)]===_0x31f043(0xf1))return _0x5c38a7;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x3900f7,_0x1b495b,_0x27eed5){const _0x152e73=a46_0x1a85;try{const _0x2f4ff5=getCacheDir(),_0x58d93b=getAccountInfoCacheFile(_0x27eed5);!existsSync(_0x2f4ff5)&&mkdirSync(_0x2f4ff5,{'recursive':!![]});const _0x4ceb54={'site':_0x3900f7,'accountId':_0x1b495b,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x58d93b,JSON[_0x152e73(0xe1)](_0x4ceb54),_0x152e73(0x119));}catch{}}export function parseEnvFile(_0x18c0f9){const _0x31058e=a46_0x1a85,_0x9e52b9={};for(const _0x2efd7e of _0x18c0f9[_0x31058e(0xfd)]('\x0a')){const _0x49e941=_0x2efd7e[_0x31058e(0xe9)]();if(!_0x49e941||_0x49e941[_0x31058e(0x107)]('#'))continue;const _0x479112=_0x49e941[_0x31058e(0x106)](/^([^=]+)=(.*)$/);if(_0x479112){const _0x4b6fab=_0x479112[0x1][_0x31058e(0xe9)]();let _0x2bbd78=_0x479112[0x2][_0x31058e(0xe9)]();(_0x2bbd78['startsWith']('\x22')&&_0x2bbd78['endsWith']('\x22')||_0x2bbd78[_0x31058e(0x107)]('\x27')&&_0x2bbd78[_0x31058e(0xf6)]('\x27'))&&(_0x2bbd78=_0x2bbd78[_0x31058e(0xea)](0x1,-0x1)),_0x9e52b9[_0x4b6fab]=_0x2bbd78;}}return _0x9e52b9;}export function readUserConfig(){const _0x53355f=a46_0x1a85,_0x836025=getConfigFile();if(!existsSync(_0x836025))return{};try{const _0x13de70=readFileSync(_0x836025,_0x53355f(0x119));return parseEnvFile(_0x13de70);}catch(_0x5ac782){return console[_0x53355f(0xe0)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x836025+':',_0x5ac782),{};}}export function resolveSite(_0x2170fd){const _0xc77a5a=a46_0x1a85,_0x4cb1ff=[_0xc77a5a(0x111),_0xc77a5a(0x12a),_0xc77a5a(0x10f),_0xc77a5a(0xeb),_0xc77a5a(0x112),_0xc77a5a(0x117),_0xc77a5a(0x101),_0xc77a5a(0x104),_0xc77a5a(0x12e),_0xc77a5a(0x120)];if(_0x4cb1ff[_0xc77a5a(0x103)](_0x2170fd))return _0x2170fd;if(_0x2170fd in SITE_ALIASES)return SITE_ALIASES[_0x2170fd];return console[_0xc77a5a(0xe0)](_0xc77a5a(0xfa)+_0x2170fd+_0xc77a5a(0x110)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x24dc07,_0xb5ffda){const _0x30c0d8=a46_0x1a85,_0x49acf9=_0xb5ffda||getActiveProfileName();if(_0x49acf9){const _0x1aaca8=_0x30c0d8(0x10b)+normalizeProfileForEnvVar(_0x49acf9);if(process[_0x30c0d8(0x102)][_0x1aaca8])return process[_0x30c0d8(0x102)][_0x1aaca8];}if(process['env'][_0x30c0d8(0xf2)])return process[_0x30c0d8(0x102)][_0x30c0d8(0xf2)];if(process[_0x30c0d8(0x102)][_0x30c0d8(0x11f)])return process[_0x30c0d8(0x102)]['TD_API_KEY'];const _0x19c16b=_0x24dc07['toUpperCase']()[_0x30c0d8(0x113)](/-/g,'_'),_0x53b905=_0x30c0d8(0xf5)+_0x19c16b;if(_0x49acf9){const _0x1d5b07=loadProfileEnv(_0x49acf9);if(_0x1d5b07){if(_0x1d5b07[_0x53b905])return _0x1d5b07[_0x53b905];if(_0x1d5b07[_0x30c0d8(0x11f)])return _0x1d5b07['TD_API_KEY'];}}const _0x1623c9=loadUserConfigOnce();if(_0x1623c9[_0x53b905])return _0x1623c9[_0x53b905];if(_0x1623c9[_0x30c0d8(0x11f)])return _0x1623c9['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x4437be){return _0x4437be['toUpperCase']()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x5b8bc5,_0x35fb7c){const _0x5cfee0=a46_0x1a85,_0xa28cb6=_0x35fb7c||getActiveProfileName()||undefined;if(_0xa28cb6){const _0x1e9d0f=_0x5cfee0(0x10b)+normalizeProfileForEnvVar(_0xa28cb6);if(process[_0x5cfee0(0x102)][_0x1e9d0f])return{'apiKey':process[_0x5cfee0(0x102)][_0x1e9d0f],'source':_0x1e9d0f+_0x5cfee0(0x11c),'isDeprecated':![]};const _0x19d83f=getCachedCredential(_0x5b8bc5,_0xa28cb6);if(_0x19d83f)return{'apiKey':_0x19d83f,'source':_0x5cfee0(0x100)+_0xa28cb6+')','isDeprecated':![]};const _0x2b4f6e=await getKeychainAPIKey(_0xa28cb6);if(_0x2b4f6e)return setCachedCredential(_0x2b4f6e,_0x5b8bc5,_0xa28cb6),{'apiKey':_0x2b4f6e,'source':_0x5cfee0(0x100)+_0xa28cb6+')','isDeprecated':![]};}if(process[_0x5cfee0(0x102)][_0x5cfee0(0xf2)])return{'apiKey':process[_0x5cfee0(0x102)][_0x5cfee0(0xf2)],'source':_0x5cfee0(0xff),'isDeprecated':![]};if(!_0xa28cb6){const _0x385f3b=getCachedCredential(_0x5b8bc5,undefined);if(_0x385f3b)return{'apiKey':_0x385f3b,'source':_0x5cfee0(0x129),'isDeprecated':![]};const _0x2b8ac8=await getKeychainAPIKey(undefined);if(_0x2b8ac8)return setCachedCredential(_0x2b8ac8,_0x5b8bc5,undefined),{'apiKey':_0x2b8ac8,'source':_0x5cfee0(0x129),'isDeprecated':![]};}if(process[_0x5cfee0(0x102)][_0x5cfee0(0x11f)])return{'apiKey':process['env'][_0x5cfee0(0x11f)],'source':_0x5cfee0(0x12f),'isDeprecated':!![]};const _0x2e3df4=getLegacyEnvAPIKey(_0x5b8bc5,_0xa28cb6);if(_0x2e3df4){const _0x2ea36a=await isKeychainAvailable();if(_0x2ea36a)try{await saveKeychainAPIKey(_0x2e3df4,_0xa28cb6),setCachedCredential(_0x2e3df4,_0x5b8bc5,_0xa28cb6);const _0x12c89b=getConfigFilePath(_0xa28cb6);cleanupLegacyEnvFile(_0x12c89b)&&console[_0x5cfee0(0xe0)](a46_0x5260c2[_0x5cfee0(0x131)](_0x5cfee0(0x128)));}catch(_0x1e99db){console['warn'](a46_0x5260c2[_0x5cfee0(0x131)](_0x5cfee0(0x130)+_0x1e99db));}const _0x4ec634=_0xa28cb6?_0x5cfee0(0x121)+_0xa28cb6+')':_0x5cfee0(0x127);return{'apiKey':_0x2e3df4,'source':_0x4ec634,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0xf49628,_0x1513fb,_0x4972a9=!![]){const _0x271226=a46_0x1a85,_0x4a919e=await resolveAPIKeyAsync(_0xf49628,_0x1513fb);if(!_0x4a919e)return undefined;if(_0x4972a9&&_0x4a919e['isDeprecated']&&_0x4a919e[_0x271226(0x109)][_0x271226(0x103)](_0x271226(0x11f))){const _0x1a1b2b=_0x1513fb||getActiveProfileName()||undefined,_0x31bcf3=_0x1a1b2b?_0x271226(0x10b)+normalizeProfileForEnvVar(_0x1a1b2b):_0x271226(0x118);console[_0x271226(0xe0)](a46_0x5260c2[_0x271226(0x131)](_0x271226(0x105)+(_0x271226(0xfc)+_0x31bcf3+').')));}return _0x4a919e[_0x271226(0xf7)];}function getLegacyEnvAPIKey(_0x586009,_0x3ad9c0){const _0x214cff=a46_0x1a85,_0x47b094=_0x586009['toUpperCase']()['replace'](/-/g,'_'),_0x38984c=_0x214cff(0xf5)+_0x47b094;if(_0x3ad9c0){const _0x2c1884=loadProfileEnv(_0x3ad9c0);if(_0x2c1884){if(_0x2c1884[_0x38984c])return _0x2c1884[_0x38984c];if(_0x2c1884[_0x214cff(0x11f)])return _0x2c1884['TD_API_KEY'];}}const _0x1c4d93=loadUserConfigOnce();if(_0x1c4d93[_0x38984c])return _0x1c4d93[_0x38984c];if(_0x1c4d93[_0x214cff(0x11f)])return _0x1c4d93[_0x214cff(0x11f)];return undefined;}function cleanupLegacyEnvFile(_0x524f92){const _0x3b3efb=a46_0x1a85;if(!existsSync(_0x524f92))return![];try{const _0x3db141=readFileSync(_0x524f92,_0x3b3efb(0x119)),_0x4a3ba9=_0x3db141['split']('\x0a'),_0x17d96c=_0x4a3ba9[_0x3b3efb(0xe4)](_0x5f18dd=>{const _0x2e208f=_0x3b3efb,_0x2c84a5=_0x5f18dd[_0x2e208f(0xe9)]();if(!_0x2c84a5||_0x2c84a5['startsWith']('#'))return!![];const [_0x4a333c]=_0x2c84a5[_0x2e208f(0xfd)]('=');return!_0x4a333c[_0x2e208f(0x107)](_0x2e208f(0x11f));}),_0x574cca=_0x17d96c[_0x3b3efb(0xf4)](_0x300749=>{const _0x4dbf6f=_0x3b3efb,_0x290d42=_0x300749[_0x4dbf6f(0xe9)]();return _0x290d42&&!_0x290d42[_0x4dbf6f(0x107)]('#');});if(!_0x574cca)return unlinkSync(_0x524f92),!![];return writeFileSync(_0x524f92,_0x17d96c[_0x3b3efb(0xee)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x70a79){const _0x5822a8=a46_0x1a85,_0x4db3bb=a46_0x52ea98[_0x5822a8(0xee)](getConfigDir(),_0x5822a8(0x123)+_0x70a79);if(a46_0x52c338[_0x5822a8(0x12d)](_0x4db3bb)){validateSecureFilePermissions(_0x4db3bb);try{const _0x6966b0=a46_0x52c338['readFileSync'](_0x4db3bb,'utf-8');return parseEnvFile(_0x6966b0);}catch(_0x586845){console['warn'](_0x5822a8(0x108)+_0x4db3bb+':\x20'+_0x586845);}}const _0x4126f0=a46_0x52ea98[_0x5822a8(0xee)](getConfigDir(),_0x5822a8(0xfe),_0x70a79,_0x5822a8(0xfb));if(a46_0x52c338[_0x5822a8(0x12d)](_0x4126f0)){validateSecureFilePermissions(_0x4126f0);try{const _0x8a996=a46_0x52c338[_0x5822a8(0xe7)](_0x4126f0,_0x5822a8(0x119));return parseEnvFile(_0x8a996);}catch(_0x2d16e5){return console[_0x5822a8(0xe0)](_0x5822a8(0x108)+_0x4126f0+':\x20'+_0x2d16e5),null;}}return null;}function getActiveProfileName(){const _0x314b8a=a46_0x1a85,_0xf1ee45=a46_0x52ea98['join'](getConfigDir(),_0x314b8a(0x11d));if(!a46_0x52c338['existsSync'](_0xf1ee45))return null;try{const _0x578396=a46_0x52c338['readFileSync'](_0xf1ee45,_0x314b8a(0x119)),_0x4ff5c9=JSON[_0x314b8a(0x124)](_0x578396);return _0x4ff5c9[_0x314b8a(0xec)]||null;}catch{return null;}}export function saveAPIKey(_0x45569d,_0x309cdc,_0x4cd2a5){const _0x27a337=a46_0x1a85,_0x534221=getConfigDir(),_0x5a94d2=getConfigFilePath(_0x4cd2a5);!existsSync(_0x534221)&&mkdirSync(_0x534221,{'recursive':!![],'mode':0x1c0});let _0x17527f={};if(existsSync(_0x5a94d2))try{const _0x352d9a=readFileSync(_0x5a94d2,_0x27a337(0x119));_0x17527f=parseEnvFile(_0x352d9a);}catch(_0x77d532){console[_0x27a337(0xe0)](_0x27a337(0xe3)+_0x5a94d2+':',_0x77d532);}const _0x33ef4e=_0x45569d[_0x27a337(0x116)]()[_0x27a337(0x113)](/-/g,'_');_0x17527f['TD_API_KEY_'+_0x33ef4e]=_0x309cdc;const _0x555e5a=Object[_0x27a337(0x10a)](_0x17527f)['map'](([_0x2a01fc,_0xcc149])=>_0x2a01fc+'='+_0xcc149);writeFileSync(_0x5a94d2,_0x555e5a[_0x27a337(0xee)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x56ae71,_0x5e9b53,_0x29cf07){await saveKeychainAPIKey(_0x56ae71,_0x29cf07),setCachedCredential(_0x56ae71,_0x5e9b53,_0x29cf07);const _0x1e3598=getConfigFilePath(_0x29cf07);cleanupLegacyEnvFile(_0x1e3598)&&console['warn'](a46_0x5260c2['yellow']('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x5d1554=a46_0x1a85,_0x2cb514={'apiKeys':{},'defaultSite':_0x5d1554(0x111)},_0x593eb4=[_0x5d1554(0x111),'jp01',_0x5d1554(0x10f),_0x5d1554(0xeb),_0x5d1554(0x112),'dev-us01',_0x5d1554(0x101),_0x5d1554(0x104),_0x5d1554(0x12e),_0x5d1554(0x120)];for(const _0x4d2d10 of _0x593eb4){const _0x1743d8=getAPIKey(_0x4d2d10);_0x1743d8&&(_0x2cb514[_0x5d1554(0xe6)][_0x4d2d10]=_0x1743d8);}return _0x2cb514;}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e32a7,_0xc19c13){const _0x3717d0=a47_0x18bb,_0x5ce1cb=_0x3e32a7();while(!![]){try{const _0x1935ad=parseInt(_0x3717d0(0x95))/0x1+parseInt(_0x3717d0(0x96))/0x2*(parseInt(_0x3717d0(0x93))/0x3)+-parseInt(_0x3717d0(0x92))/0x4+parseInt(_0x3717d0(0x99))/0x5*(-parseInt(_0x3717d0(0x9a))/0x6)+parseInt(_0x3717d0(0x9e))/0x7+parseInt(_0x3717d0(0x94))/0x8+-parseInt(_0x3717d0(0x97))/0x9*(parseInt(_0x3717d0(0x9d))/0xa);if(_0x1935ad===_0xc19c13)break;else _0x5ce1cb['push'](_0x5ce1cb['shift']());}catch(_0x4bd537){_0x5ce1cb['push'](_0x5ce1cb['shift']());}}}(a47_0xcb1a,0x18f88));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x3ae3ca){const _0x1df286=a47_0x18bb,_0x1ccb24=_0x3ae3ca||_0x1df286(0x9b);return join(getCacheDir(),_0x1df286(0x9c)+_0x1ccb24+'.json');}function a47_0x18bb(_0x959e38,_0x4527e1){_0x959e38=_0x959e38-0x92;const _0xcb1a30=a47_0xcb1a();let _0x18bba7=_0xcb1a30[_0x959e38];return _0x18bba7;}function a47_0xcb1a(){const _0x257888=['default','connections-','20YLRlqM','1159137JKqXiT','439532kLMBuK','36vbAdJn','1203328qxYjeZ','131468RrFVjM','5318iHxyaD','1061721QKmgzk','utf-8','5TfCXWo','187692mXkcnv'];a47_0xcb1a=function(){return _0x257888;};return a47_0xcb1a();}export function loadCachedConnections(_0x3b99fc){const _0x580872=a47_0x18bb,_0x5b7eca=getCacheFilePath(_0x3b99fc);if(!existsSync(_0x5b7eca))return null;try{const _0x5965f6=readFileSync(_0x5b7eca,_0x580872(0x98)),_0x1af934=JSON['parse'](_0x5965f6);return _0x1af934['connections'];}catch{return null;}}export function saveCachedConnections(_0x228d4b,_0xbc60f3){const _0x55f9fb=a47_0x18bb,_0x418b90=getCacheDir();!existsSync(_0x418b90)&&mkdirSync(_0x418b90,{'recursive':!![]});const _0x1251c2=getCacheFilePath(_0x228d4b),_0x3b9ce0={'connections':_0xbc60f3,'cachedAt':Date['now']()};writeFileSync(_0x1251c2,JSON['stringify'](_0x3b9ce0,null,0x2),_0x55f9fb(0x98));}export function clearConnectionCache(_0x203d9b){const _0x16d204=getCacheFilePath(_0x203d9b);if(existsSync(_0x16d204))try{unlinkSync(_0x16d204);}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37a103,_0x56bceb){const _0x412b3e=a48_0x15a9,_0x29c713=_0x37a103();while(!![]){try{const _0x276826=parseInt(_0x412b3e(0x1bc))/0x1*(parseInt(_0x412b3e(0x1b2))/0x2)+parseInt(_0x412b3e(0x1af))/0x3*(-parseInt(_0x412b3e(0x1aa))/0x4)+parseInt(_0x412b3e(0x1b3))/0x5*(parseInt(_0x412b3e(0x1ad))/0x6)+parseInt(_0x412b3e(0x1b6))/0x7*(-parseInt(_0x412b3e(0x1bd))/0x8)+-parseInt(_0x412b3e(0x1b7))/0x9+parseInt(_0x412b3e(0x1b5))/0xa+-parseInt(_0x412b3e(0x1bb))/0xb*(-parseInt(_0x412b3e(0x1ba))/0xc);if(_0x276826===_0x56bceb)break;else _0x29c713['push'](_0x29c713['shift']());}catch(_0x372c91){_0x29c713['push'](_0x29c713['shift']());}}}(a48_0x12d5,0x2f76a));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x317b95,_0x2e952b){const _0x4097b5=a48_0x15a9,_0x502d24=_0x317b95||_0x4097b5(0x1ac),_0x3ad7ef=_0x2e952b||_0x4097b5(0x1ab);return _0x502d24+':'+_0x3ad7ef;}function a48_0x15a9(_0x461375,_0x21f5ca){_0x461375=_0x461375-0x1aa;const _0x12d558=a48_0x12d5();let _0x15a946=_0x12d558[_0x461375];return _0x15a946;}export function getCachedCredential(_0x38ed09,_0x1f4d9f){const _0x4d5425=a48_0x15a9,_0x2bf735=getCacheKey(_0x38ed09,_0x1f4d9f),_0x28e0bd=cache[_0x4d5425(0x1b1)](_0x2bf735);if(!_0x28e0bd)return null;if(Date[_0x4d5425(0x1b0)]()-_0x28e0bd['loadedAt']>CACHE_TTL_MS)return cache['delete'](_0x2bf735),null;return _0x28e0bd[_0x4d5425(0x1b8)];}export function setCachedCredential(_0x4360d4,_0x117e69,_0x56bb75){const _0x476b29=a48_0x15a9,_0x1a6190=getCacheKey(_0x117e69,_0x56bb75);cache[_0x476b29(0x1b4)](_0x1a6190,{'apiKey':_0x4360d4,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x45134e=a48_0x15a9;cache[_0x45134e(0x1ae)]();}export function clearCachedCredential(_0x299d18,_0x2a5acf){const _0x204d97=a48_0x15a9,_0x3da418=getCacheKey(_0x299d18,_0x2a5acf);cache[_0x204d97(0x1b9)](_0x3da418);}function a48_0x12d5(){const _0x518b67=['8tEmGQf','__default_profile__','__default_site__','25722lzjQBu','clear','326595WxcZgl','now','get','142918tqQeih','60hmYqRv','set','573280caRXsv','7LanEMh','2581884boVJNz','apiKey','delete','1183020lpMpLZ','77XZMUfx','4XxWJwp','3085496AprakH'];a48_0x12d5=function(){return _0x518b67;};return a48_0x12d5();}
|