@treasuredata/tdx 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection-validator.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.js +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.d.ts +17 -11
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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.js +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.d.ts +30 -0
- package/dist/utils/journey-utils.d.ts.map +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/journey-utils.js.map +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_0x3fea(_0x267333,_0x933628){_0x267333=_0x267333-0x182;const _0x310b13=a39_0x310b();let _0x3fea23=_0x310b13[_0x267333];return _0x3fea23;}const a39_0x3308cc=a39_0x3fea;function a39_0x310b(){const _0x2c2bf1=[',\x20and\x20','(not\x20set)','34QwsjjT','/e/','sort','length','localeCompare','7458lFZyZZ','327699XlVXIa','segment','all','49777IggmJs','Parent\x20ID:\x20','\x20segment','site','Resolving\x20path\x20\x27','1102326dqbLkT','journey','No\x20items\x20match\x20pattern:\x20','jsonl','message','parentId','Site:\x20','description','/app/ps/','\x20folder','Folder\x20ID:\x20','248664UAqaOe','\x20matching\x20\x27','48IjksFT','Folder/pattern\x20arg:\x20','listWithPattern','\x20journey','folder','cause','folderId','Parent\x20segment\x20context:\x20','name','json','error','filter','log','Listing\x20folders,\x20segments,\x20and\x20journeys...','✔\x20Found\x20','664155dKbCzf','execute','List\x20folders\x20and\x20child\x20segments','resolvePathToResource','maxDepth','listUnified','(empty)','\x27...','journeyBundleName','Resolving\x20parent\x20segment\x20\x27','format','/j/da','listJourneysFromParentSegment','Error:\x20No\x20parent\x20segment\x20context\x20set.','map','includes','dim','verbose','Error:\x20','segments','9jYXfTA','replace','web','\x5c$&','test','5027880SqKCIh','Recursive\x20mode:\x20enabled','data','Building\x20hierarchy\x20tree...','listRecursive'];a39_0x310b=function(){return _0x2c2bf1;};return a39_0x310b();}(function(_0x325b4a,_0x1dc35b){const _0x2a0d11=a39_0x3fea,_0x421a16=_0x325b4a();while(!![]){try{const _0x29ab8a=-parseInt(_0x2a0d11(0x1b3))/0x1*(parseInt(_0x2a0d11(0x1ae))/0x2)+-parseInt(_0x2a0d11(0x1a2))/0x3*(parseInt(_0x2a0d11(0x1c7))/0x4)+parseInt(_0x2a0d11(0x18e))/0x5+-parseInt(_0x2a0d11(0x1bc))/0x6+-parseInt(_0x2a0d11(0x1b7))/0x7*(parseInt(_0x2a0d11(0x1c9))/0x8)+parseInt(_0x2a0d11(0x1b4))/0x9+parseInt(_0x2a0d11(0x1a7))/0xa;if(_0x29ab8a===_0x1dc35b)break;else _0x421a16['push'](_0x421a16['shift']());}catch(_0x7dac3b){_0x421a16['push'](_0x421a16['shift']());}}}(a39_0x310b,0x20507));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_0x5c3ac7 from'chalk';export class SegmentsCommand extends BaseCommand{[a39_0x3308cc(0x187)]=a39_0x3308cc(0x1a1);[a39_0x3308cc(0x1c3)]=a39_0x3308cc(0x190);async[a39_0x3308cc(0x18f)](_0x22ed8a){const _0x3d1a2d=a39_0x3308cc,{options:_0xca5f9c,args:_0x37d0e9}=_0x22ed8a,_0x1e33c2=_0xca5f9c['recursive'],_0x1c980d=_0x37d0e9[0x0];try{const _0x5533a2=_0xca5f9c['parentSegment'];_0xca5f9c['verbose']&&(console[_0x3d1a2d(0x189)](_0x3d1a2d(0x1c2)+_0xca5f9c[_0x3d1a2d(0x1ba)]),console[_0x3d1a2d(0x189)](_0x3d1a2d(0x186)+(_0x5533a2||_0x3d1a2d(0x1ad))),_0x1c980d&&console[_0x3d1a2d(0x189)](_0x3d1a2d(0x1ca)+_0x1c980d),_0x1e33c2&&console[_0x3d1a2d(0x189)](_0x3d1a2d(0x1a8)));if(!_0x5533a2)return console[_0x3d1a2d(0x189)](_0x3d1a2d(0x19b)),console[_0x3d1a2d(0x189)](''),console[_0x3d1a2d(0x189)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x3d1a2d(0x189)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x3d1a2d(0x189)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x3d1a2d(0x189)](''),console['error']('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x1ca4b0=_0x1c980d&&(_0x1c980d[_0x3d1a2d(0x19d)]('*')||_0x1c980d[_0x3d1a2d(0x19d)]('?'));if(_0x1ca4b0)return await this[_0x3d1a2d(0x1cb)](_0x22ed8a,_0x5533a2,_0x1c980d);const _0xda96dc=_0x1c980d?_0x5533a2+'/'+_0x1c980d:_0x5533a2;return _0x1e33c2?await this['listRecursive'](_0x22ed8a,_0xda96dc):await this[_0x3d1a2d(0x193)](_0x22ed8a,_0xda96dc);}catch(_0x3227d2){if(_0x3227d2 instanceof SDKError)return console[_0x3d1a2d(0x189)](_0x3d1a2d(0x1a0)+_0x3227d2[_0x3d1a2d(0x1c0)]),_0x3227d2['cause']&&console[_0x3d1a2d(0x189)]('\x20\x20Cause:\x20'+_0x3227d2[_0x3d1a2d(0x184)]),0x1;throw _0x3227d2;}}async[a39_0x3308cc(0x1cb)](_0x1abef9,_0x1cd02d,_0x144b4a){const _0x58da2d=a39_0x3308cc,{options:_0x1dfcf5,tdx:_0x4ff5a9}=_0x1abef9,_0x46fbe8=_0x1dfcf5[_0x58da2d(0x1a4)],_0x15d553=await withSpinner(_0x58da2d(0x197)+_0x1cd02d+_0x58da2d(0x195),()=>_0x4ff5a9['segment']['resolvePathToResource'](_0x1cd02d),{'verbose':_0x1dfcf5[_0x58da2d(0x19f)]}),_0xd5183b=_0x15d553[_0x58da2d(0x1a9)],_0x578c27=await withSpinner(_0x58da2d(0x18c),()=>Promise[_0x58da2d(0x1b6)]([_0x4ff5a9[_0x58da2d(0x1b5)][_0x58da2d(0x193)](_0xd5183b[_0x58da2d(0x1c1)],_0xd5183b['folderId']),_0x4ff5a9[_0x58da2d(0x1bd)][_0x58da2d(0x19a)](_0xd5183b[_0x58da2d(0x1c1)])]),{'verbose':_0x1dfcf5['verbose']}),[_0x498acc,_0x5a84d3]=_0x578c27[_0x58da2d(0x1a9)],{folders:_0x282472,segments:_0x5f49ff}=_0x498acc,_0x35cdb1=_0x144b4a[_0x58da2d(0x1a3)](/[.+^${}()|[\]\\]/g,_0x58da2d(0x1a5))['replace'](/\*/g,'.*')[_0x58da2d(0x1a3)](/\?/g,'.'),_0x7e6399=new RegExp('^'+_0x35cdb1+'$','i'),_0x84496=_0x282472['filter'](_0x24f39e=>_0x7e6399['test'](_0x24f39e[_0x58da2d(0x187)])),_0xebb353=_0x5f49ff[_0x58da2d(0x18a)](_0x53b3c1=>_0x7e6399[_0x58da2d(0x1a6)](_0x53b3c1[_0x58da2d(0x187)])),_0x2759f4=_0x5a84d3[_0x58da2d(0x18a)](_0x14a667=>_0x7e6399[_0x58da2d(0x1a6)](_0x14a667['journeyBundleName'])),_0x4f8cd8=_0x84496[_0x58da2d(0x1b1)]+_0xebb353[_0x58da2d(0x1b1)]+_0x2759f4[_0x58da2d(0x1b1)];console[_0x58da2d(0x189)](_0x58da2d(0x18d)+_0x84496['length']+_0x58da2d(0x1c5)+(_0x84496[_0x58da2d(0x1b1)]!==0x1?'s':'')+',\x20'+_0xebb353['length']+'\x20segment'+(_0xebb353[_0x58da2d(0x1b1)]!==0x1?'s':'')+_0x58da2d(0x1ac)+_0x2759f4[_0x58da2d(0x1b1)]+'\x20journey'+(_0x2759f4[_0x58da2d(0x1b1)]!==0x1?'s':'')+_0x58da2d(0x1c8)+_0x144b4a+'\x27');const _0x2f35b8=_0x6b4ac4=>{const _0x27065f=_0x58da2d;return getConsoleNextUrl(_0x1dfcf5['site'],'/app/ps/'+_0xd5183b['parentId']+_0x27065f(0x1af)+_0x6b4ac4);},_0x2f10d5=_0x1dfcf5[_0x58da2d(0x198)]===_0x58da2d(0x188)||_0x1dfcf5[_0x58da2d(0x198)]===_0x58da2d(0x1bf);if(_0x2f10d5){const _0x1b9c9a=[..._0x84496[_0x58da2d(0x19c)](_0x53d5a7=>({..._0x53d5a7,'type':_0x58da2d(0x183)})),..._0xebb353[_0x58da2d(0x19c)](_0x47a051=>({..._0x47a051,'type':_0x58da2d(0x1b5),'url':_0x2f35b8(_0x47a051['id'])})),..._0x2759f4[_0x58da2d(0x19c)](_0x3ebc66=>({..._0x3ebc66,'name':_0x3ebc66[_0x58da2d(0x196)],'type':_0x58da2d(0x1bd)}))]['sort']((_0x1a9505,_0x3d6916)=>_0x1a9505[_0x58da2d(0x187)][_0x58da2d(0x1b2)](_0x3d6916[_0x58da2d(0x187)]));await handleSDKOutput(_0x1b9c9a,_0x1dfcf5);}else{if(_0x4f8cd8===0x0)console['log'](_0x58da2d(0x1be)+_0x144b4a);else{console[_0x58da2d(0x18b)](a39_0x5c3ac7[_0x58da2d(0x19e)]('['+_0x1cd02d+']\x20matching\x20\x27'+_0x144b4a+'\x27'));const _0x477c93=formatFlatList(_0x84496,_0xebb353,{'showMetadata':!![],'showUrl':_0x46fbe8,'getSegmentUrl':_0x2f35b8},_0x2759f4);console[_0x58da2d(0x18b)](_0x477c93);}}return 0x0;}async[a39_0x3308cc(0x193)](_0x5037c9,_0x1f69ce){const _0xab70a7=a39_0x3308cc,{options:_0x3e1430,tdx:_0x3f255e}=_0x5037c9,_0x3866f2=_0x3e1430['web'],_0x7238b1=await withSpinner(_0xab70a7(0x1bb)+_0x1f69ce+_0xab70a7(0x195),()=>_0x3f255e[_0xab70a7(0x1b5)][_0xab70a7(0x191)](_0x1f69ce),{'verbose':_0x3e1430[_0xab70a7(0x19f)]}),_0x34c542=_0x7238b1[_0xab70a7(0x1a9)];_0x3e1430['verbose']&&(console['error'](_0xab70a7(0x1b8)+_0x34c542[_0xab70a7(0x1c1)]),_0x34c542[_0xab70a7(0x185)]&&console[_0xab70a7(0x189)](_0xab70a7(0x1c6)+_0x34c542[_0xab70a7(0x185)]));const _0x586999=await withSpinner(_0xab70a7(0x18c),()=>Promise[_0xab70a7(0x1b6)]([_0x3f255e['segment'][_0xab70a7(0x193)](_0x34c542['parentId'],_0x34c542['folderId']),_0x3f255e['journey'][_0xab70a7(0x19a)](_0x34c542['parentId'])]),{'verbose':_0x3e1430[_0xab70a7(0x19f)]}),[_0x243f1b,_0xe19a38]=_0x586999['data'],{folders:_0x2f3edf,segments:_0x439ce6}=_0x243f1b,_0x156ca3=_0x2f3edf[_0xab70a7(0x1b1)]+_0x439ce6[_0xab70a7(0x1b1)]+_0xe19a38[_0xab70a7(0x1b1)];console[_0xab70a7(0x189)](_0xab70a7(0x18d)+_0x2f3edf['length']+_0xab70a7(0x1c5)+(_0x2f3edf[_0xab70a7(0x1b1)]!==0x1?'s':'')+',\x20'+_0x439ce6[_0xab70a7(0x1b1)]+_0xab70a7(0x1b9)+(_0x439ce6[_0xab70a7(0x1b1)]!==0x1?'s':'')+_0xab70a7(0x1ac)+_0xe19a38['length']+_0xab70a7(0x182)+(_0xe19a38[_0xab70a7(0x1b1)]!==0x1?'s':''));const _0x2a1cf6=_0x1a99ba=>{const _0x47f88b=_0xab70a7;return getConsoleNextUrl(_0x3e1430['site'],'/app/ps/'+_0x34c542[_0x47f88b(0x1c1)]+_0x47f88b(0x1af)+_0x1a99ba);},_0xff7459=_0x2443f5=>{const _0x4e9d33=_0xab70a7;return getConsoleNextUrl(_0x3e1430[_0x4e9d33(0x1ba)],_0x4e9d33(0x1c4)+_0x34c542[_0x4e9d33(0x1c1)]+'/e/'+_0x2443f5+_0x4e9d33(0x199));},_0x559094=_0x3e1430[_0xab70a7(0x198)]===_0xab70a7(0x188)||_0x3e1430[_0xab70a7(0x198)]===_0xab70a7(0x1bf);if(_0x559094){const _0x58a151=[..._0x2f3edf['map'](_0x34668b=>({..._0x34668b,'type':_0xab70a7(0x183)})),..._0x439ce6[_0xab70a7(0x19c)](_0x799741=>({..._0x799741,'type':_0xab70a7(0x1b5),'url':_0x2a1cf6(_0x799741['id'])})),..._0xe19a38[_0xab70a7(0x19c)](_0x22c1de=>({..._0x22c1de,'name':_0x22c1de[_0xab70a7(0x196)],'type':_0xab70a7(0x1bd),'url':_0xff7459(_0x22c1de['id'])}))][_0xab70a7(0x1b0)]((_0x12f44f,_0x1d13c0)=>_0x12f44f['name'][_0xab70a7(0x1b2)](_0x1d13c0[_0xab70a7(0x187)]));await handleSDKOutput(_0x58a151,_0x3e1430);}else{if(_0x156ca3===0x0)console[_0xab70a7(0x18b)](a39_0x5c3ac7[_0xab70a7(0x19e)]('['+_0x1f69ce+']')),console['log'](_0xab70a7(0x194));else{console['log'](a39_0x5c3ac7['dim']('['+_0x1f69ce+']'));const _0x2f5643=formatFlatList(_0x2f3edf,_0x439ce6,{'showMetadata':!![],'showUrl':_0x3866f2,'getSegmentUrl':_0x2a1cf6,'getJourneyUrl':_0xff7459},_0xe19a38);console[_0xab70a7(0x18b)](_0x2f5643);}}return 0x0;}async[a39_0x3308cc(0x1ab)](_0x2a9254,_0x47437a){const _0xee8fb8=a39_0x3308cc,{options:_0x4cc7d2,tdx:_0x238f7f}=_0x2a9254,_0x516831=_0x4cc7d2['web'],_0x3a1201=await withSpinner(_0xee8fb8(0x1bb)+_0x47437a+_0xee8fb8(0x195),()=>_0x238f7f[_0xee8fb8(0x1b5)][_0xee8fb8(0x191)](_0x47437a),{'verbose':_0x4cc7d2[_0xee8fb8(0x19f)]}),_0x3bc76a=_0x3a1201[_0xee8fb8(0x1a9)];_0x4cc7d2['verbose']&&(console['error']('Parent\x20ID:\x20'+_0x3bc76a[_0xee8fb8(0x1c1)]),_0x3bc76a[_0xee8fb8(0x185)]&&console[_0xee8fb8(0x189)](_0xee8fb8(0x1c6)+_0x3bc76a[_0xee8fb8(0x185)]));const _0x4dc54c=_0x4cc7d2[_0xee8fb8(0x192)]||0xa,_0x2c734e=await withSpinner(_0xee8fb8(0x1aa),()=>_0x238f7f[_0xee8fb8(0x1b5)]['listRecursive'](_0x3bc76a[_0xee8fb8(0x1c1)],_0x3bc76a['folderId'],0x0,_0x4dc54c),{'verbose':_0x4cc7d2[_0xee8fb8(0x19f)]}),_0xb93cd8=_0x2c734e[_0xee8fb8(0x1a9)];console['error']('✔\x20Built\x20tree\x20with\x20'+_0xb93cd8[_0xee8fb8(0x1b1)]+'\x20top-level\x20items');const _0x2860d8=_0x33c7ea=>{const _0x3dae8d=_0xee8fb8;return getConsoleNextUrl(_0x4cc7d2[_0x3dae8d(0x1ba)],'/app/ps/'+_0x3bc76a[_0x3dae8d(0x1c1)]+_0x3dae8d(0x1af)+_0x33c7ea);};if(_0x4cc7d2['format']===_0xee8fb8(0x188)||_0x4cc7d2[_0xee8fb8(0x198)]==='jsonl')await handleSDKOutput(_0xb93cd8,_0x4cc7d2);else{console[_0xee8fb8(0x18b)](a39_0x5c3ac7[_0xee8fb8(0x19e)]('['+_0x47437a+']'));const _0x1b16b7=formatTree(_0xb93cd8,{'showMetadata':!![],'showUrl':_0x516831,'getSegmentUrl':_0x2860d8});console[_0xee8fb8(0x18b)](_0x1b16b7);}return 0x0;}}
|
|
1
|
+
function a39_0x5ecc(){const _0x587ce1=['Error:\x20','(not\x20set)','test','segment','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Resolving\x20parent\x20segment\x20\x27','log','Listing\x20folders,\x20segments,\x20and\x20journeys...',']\x20matching\x20\x27','folderId','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','message','465zkrQBX','\x20folder','\x20journey','No\x20items\x20match\x20pattern:\x20','resolvePathToResource','Folder/pattern\x20arg:\x20','sort','data','parentId','format','all','replace','600mRdOcC','2093454wlGGMG','20surldw','/e/','✔\x20Found\x20','(empty)','Resolving\x20path\x20\x27','Parent\x20segment\x20context:\x20','101857cLegBF','filter','966513fAuPEi','78474rJYJDN','Parent\x20ID:\x20','\x27...','description',',\x20and\x20','jsonl','segments','json','map','4OagaxK','site','folder','execute','listWithPattern','journeyBundleName','dim','localeCompare','Folder\x20ID:\x20','1105100UHpmpF','Site:\x20','Recursive\x20mode:\x20enabled','\x20top-level\x20items','3458120eXpfIS','error','Set\x20a\x20parent\x20segment\x20context\x20first:','recursive','includes','638lOKHzn','134472YWqAic','Building\x20hierarchy\x20tree...','journey','\x5c$&','listJourneysFromParentSegment','name','listUnified','listRecursive','\x20\x20Cause:\x20','Error:\x20No\x20parent\x20segment\x20context\x20set.','/j/da','✔\x20Built\x20tree\x20with\x20','\x20segment','cause','length','/app/ps/','verbose','web'];a39_0x5ecc=function(){return _0x587ce1;};return a39_0x5ecc();}const a39_0x164ca3=a39_0x1742;(function(_0x5e2139,_0x4dc17e){const _0x20d8e1=a39_0x1742,_0x1d0d10=_0x5e2139();while(!![]){try{const _0x2837e1=parseInt(_0x20d8e1(0x16c))/0x1+parseInt(_0x20d8e1(0x163))/0x2*(-parseInt(_0x20d8e1(0x159))/0x3)+-parseInt(_0x20d8e1(0x170))/0x4+parseInt(_0x20d8e1(0x194))/0x5*(parseInt(_0x20d8e1(0x15a))/0x6)+-parseInt(_0x20d8e1(0x157))/0x7*(-parseInt(_0x20d8e1(0x14f))/0x8)+-parseInt(_0x20d8e1(0x150))/0x9*(parseInt(_0x20d8e1(0x151))/0xa)+parseInt(_0x20d8e1(0x175))/0xb*(-parseInt(_0x20d8e1(0x176))/0xc);if(_0x2837e1===_0x4dc17e)break;else _0x1d0d10['push'](_0x1d0d10['shift']());}catch(_0x2573b1){_0x1d0d10['push'](_0x1d0d10['shift']());}}}(a39_0x5ecc,0xc0904));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';function a39_0x1742(_0x41afa,_0x307c32){_0x41afa=_0x41afa-0x14d;const _0x5eccd4=a39_0x5ecc();let _0x17427f=_0x5eccd4[_0x41afa];return _0x17427f;}import a39_0x51825a from'chalk';export class SegmentsCommand extends BaseCommand{[a39_0x164ca3(0x17b)]=a39_0x164ca3(0x160);[a39_0x164ca3(0x15d)]='List\x20folders\x20and\x20child\x20segments';async[a39_0x164ca3(0x166)](_0x4b3979){const _0x2de97d=a39_0x164ca3,{options:_0xa1c79a,args:_0x40ff4b}=_0x4b3979,_0x44921e=_0xa1c79a[_0x2de97d(0x173)],_0x54f6f9=_0x40ff4b[0x0];try{const _0xdd8844=_0xa1c79a['parentSegment'];_0xa1c79a[_0x2de97d(0x186)]&&(console[_0x2de97d(0x171)](_0x2de97d(0x16d)+_0xa1c79a[_0x2de97d(0x164)]),console['error'](_0x2de97d(0x156)+(_0xdd8844||_0x2de97d(0x189))),_0x54f6f9&&console[_0x2de97d(0x171)](_0x2de97d(0x199)+_0x54f6f9),_0x44921e&&console[_0x2de97d(0x171)](_0x2de97d(0x16e)));if(!_0xdd8844)return console[_0x2de97d(0x171)](_0x2de97d(0x17f)),console[_0x2de97d(0x171)](''),console['error'](_0x2de97d(0x172)),console[_0x2de97d(0x171)](_0x2de97d(0x192)),console[_0x2de97d(0x171)](_0x2de97d(0x18c)),console[_0x2de97d(0x171)](''),console[_0x2de97d(0x171)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x25345f=_0x54f6f9&&(_0x54f6f9[_0x2de97d(0x174)]('*')||_0x54f6f9[_0x2de97d(0x174)]('?'));if(_0x25345f)return await this['listWithPattern'](_0x4b3979,_0xdd8844,_0x54f6f9);const _0x1efaad=_0x54f6f9?_0xdd8844+'/'+_0x54f6f9:_0xdd8844;return _0x44921e?await this[_0x2de97d(0x17d)](_0x4b3979,_0x1efaad):await this[_0x2de97d(0x17c)](_0x4b3979,_0x1efaad);}catch(_0x5ecdd3){if(_0x5ecdd3 instanceof SDKError)return console['error'](_0x2de97d(0x188)+_0x5ecdd3[_0x2de97d(0x193)]),_0x5ecdd3[_0x2de97d(0x183)]&&console[_0x2de97d(0x171)](_0x2de97d(0x17e)+_0x5ecdd3[_0x2de97d(0x183)]),0x1;throw _0x5ecdd3;}}async[a39_0x164ca3(0x167)](_0x42fce9,_0x47a113,_0x4810bb){const _0x253ff1=a39_0x164ca3,{options:_0x4917c1,tdx:_0x9d1a53}=_0x42fce9,_0x12a713=_0x4917c1[_0x253ff1(0x187)],_0x46c31c=await withSpinner(_0x253ff1(0x18d)+_0x47a113+_0x253ff1(0x15c),()=>_0x9d1a53[_0x253ff1(0x18b)][_0x253ff1(0x198)](_0x47a113),{'verbose':_0x4917c1[_0x253ff1(0x186)]}),_0x3f34c6=_0x46c31c[_0x253ff1(0x19b)],_0x20ea04=await withSpinner(_0x253ff1(0x18f),()=>Promise[_0x253ff1(0x14d)]([_0x9d1a53[_0x253ff1(0x18b)][_0x253ff1(0x17c)](_0x3f34c6[_0x253ff1(0x19c)],_0x3f34c6['folderId']),_0x9d1a53[_0x253ff1(0x178)][_0x253ff1(0x17a)](_0x3f34c6['parentId'])]),{'verbose':_0x4917c1[_0x253ff1(0x186)]}),[_0x457ac8,_0x22eaca]=_0x20ea04['data'],{folders:_0x5a6441,segments:_0x2dde98}=_0x457ac8,_0x122384=_0x4810bb['replace'](/[.+^${}()|[\]\\]/g,_0x253ff1(0x179))[_0x253ff1(0x14e)](/\*/g,'.*')[_0x253ff1(0x14e)](/\?/g,'.'),_0x4747c3=new RegExp('^'+_0x122384+'$','i'),_0x208f78=_0x5a6441[_0x253ff1(0x158)](_0x1fc8ae=>_0x4747c3[_0x253ff1(0x18a)](_0x1fc8ae[_0x253ff1(0x17b)])),_0x5b6080=_0x2dde98[_0x253ff1(0x158)](_0x2899e3=>_0x4747c3[_0x253ff1(0x18a)](_0x2899e3[_0x253ff1(0x17b)])),_0x2f8ffc=_0x22eaca[_0x253ff1(0x158)](_0x4eb089=>_0x4747c3[_0x253ff1(0x18a)](_0x4eb089[_0x253ff1(0x168)])),_0x465c38=_0x208f78[_0x253ff1(0x184)]+_0x5b6080[_0x253ff1(0x184)]+_0x2f8ffc[_0x253ff1(0x184)];console['error'](_0x253ff1(0x153)+_0x208f78[_0x253ff1(0x184)]+_0x253ff1(0x195)+(_0x208f78[_0x253ff1(0x184)]!==0x1?'s':'')+',\x20'+_0x5b6080['length']+_0x253ff1(0x182)+(_0x5b6080[_0x253ff1(0x184)]!==0x1?'s':'')+_0x253ff1(0x15e)+_0x2f8ffc[_0x253ff1(0x184)]+_0x253ff1(0x196)+(_0x2f8ffc[_0x253ff1(0x184)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x4810bb+'\x27');const _0x219735=_0xaf331e=>{const _0x3755fa=_0x253ff1;return getConsoleNextUrl(_0x4917c1[_0x3755fa(0x164)],_0x3755fa(0x185)+_0x3f34c6[_0x3755fa(0x19c)]+'/e/'+_0xaf331e);},_0x19b928=_0x4917c1[_0x253ff1(0x19d)]===_0x253ff1(0x161)||_0x4917c1[_0x253ff1(0x19d)]===_0x253ff1(0x15f);if(_0x19b928){const _0x485d1d=[..._0x208f78[_0x253ff1(0x162)](_0x109adf=>({..._0x109adf,'type':_0x253ff1(0x165)})),..._0x5b6080[_0x253ff1(0x162)](_0x94065f=>({..._0x94065f,'type':_0x253ff1(0x18b),'url':_0x219735(_0x94065f['id'])})),..._0x2f8ffc[_0x253ff1(0x162)](_0x288696=>({..._0x288696,'name':_0x288696[_0x253ff1(0x168)],'type':_0x253ff1(0x178)}))][_0x253ff1(0x19a)]((_0x48065c,_0x13c8a2)=>_0x48065c[_0x253ff1(0x17b)]['localeCompare'](_0x13c8a2[_0x253ff1(0x17b)]));await handleSDKOutput(_0x485d1d,_0x4917c1);}else{if(_0x465c38===0x0)console[_0x253ff1(0x18e)](_0x253ff1(0x197)+_0x4810bb);else{console[_0x253ff1(0x18e)](a39_0x51825a[_0x253ff1(0x169)]('['+_0x47a113+_0x253ff1(0x190)+_0x4810bb+'\x27'));const _0x11dc98=formatFlatList(_0x208f78,_0x5b6080,{'showMetadata':!![],'showUrl':_0x12a713,'getSegmentUrl':_0x219735},_0x2f8ffc);console[_0x253ff1(0x18e)](_0x11dc98);}}return 0x0;}async[a39_0x164ca3(0x17c)](_0x25e6cf,_0x25176c){const _0x3c1aa6=a39_0x164ca3,{options:_0xdada31,tdx:_0x4c3936}=_0x25e6cf,_0x2b388b=_0xdada31[_0x3c1aa6(0x187)],_0x1d0b39=await withSpinner(_0x3c1aa6(0x155)+_0x25176c+_0x3c1aa6(0x15c),()=>_0x4c3936[_0x3c1aa6(0x18b)]['resolvePathToResource'](_0x25176c),{'verbose':_0xdada31[_0x3c1aa6(0x186)]}),_0x5da35f=_0x1d0b39['data'];_0xdada31[_0x3c1aa6(0x186)]&&(console[_0x3c1aa6(0x171)](_0x3c1aa6(0x15b)+_0x5da35f[_0x3c1aa6(0x19c)]),_0x5da35f[_0x3c1aa6(0x191)]&&console['error'](_0x3c1aa6(0x16b)+_0x5da35f['folderId']));const _0x2108d1=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>Promise[_0x3c1aa6(0x14d)]([_0x4c3936[_0x3c1aa6(0x18b)][_0x3c1aa6(0x17c)](_0x5da35f[_0x3c1aa6(0x19c)],_0x5da35f[_0x3c1aa6(0x191)]),_0x4c3936[_0x3c1aa6(0x178)][_0x3c1aa6(0x17a)](_0x5da35f[_0x3c1aa6(0x19c)])]),{'verbose':_0xdada31['verbose']}),[_0x425ea3,_0x42eab7]=_0x2108d1[_0x3c1aa6(0x19b)],{folders:_0x5edc46,segments:_0x30425a}=_0x425ea3,_0x1e1b1d=_0x5edc46['length']+_0x30425a[_0x3c1aa6(0x184)]+_0x42eab7[_0x3c1aa6(0x184)];console['error']('✔\x20Found\x20'+_0x5edc46[_0x3c1aa6(0x184)]+_0x3c1aa6(0x195)+(_0x5edc46[_0x3c1aa6(0x184)]!==0x1?'s':'')+',\x20'+_0x30425a[_0x3c1aa6(0x184)]+'\x20segment'+(_0x30425a['length']!==0x1?'s':'')+_0x3c1aa6(0x15e)+_0x42eab7[_0x3c1aa6(0x184)]+_0x3c1aa6(0x196)+(_0x42eab7[_0x3c1aa6(0x184)]!==0x1?'s':''));const _0x56d034=_0x286004=>{const _0x56eac1=_0x3c1aa6;return getConsoleNextUrl(_0xdada31[_0x56eac1(0x164)],_0x56eac1(0x185)+_0x5da35f[_0x56eac1(0x19c)]+_0x56eac1(0x152)+_0x286004);},_0x139afa=_0x32c658=>{const _0x4d1165=_0x3c1aa6;return getConsoleNextUrl(_0xdada31['site'],_0x4d1165(0x185)+_0x5da35f[_0x4d1165(0x19c)]+_0x4d1165(0x152)+_0x32c658+_0x4d1165(0x180));},_0x1ddaf1=_0xdada31['format']===_0x3c1aa6(0x161)||_0xdada31[_0x3c1aa6(0x19d)]==='jsonl';if(_0x1ddaf1){const _0x50f157=[..._0x5edc46[_0x3c1aa6(0x162)](_0x4bb131=>({..._0x4bb131,'type':_0x3c1aa6(0x165)})),..._0x30425a[_0x3c1aa6(0x162)](_0x51f0a3=>({..._0x51f0a3,'type':_0x3c1aa6(0x18b),'url':_0x56d034(_0x51f0a3['id'])})),..._0x42eab7[_0x3c1aa6(0x162)](_0x16911d=>({..._0x16911d,'name':_0x16911d['journeyBundleName'],'type':_0x3c1aa6(0x178),'url':_0x139afa(_0x16911d['id'])}))][_0x3c1aa6(0x19a)]((_0x4938ae,_0x15efae)=>_0x4938ae[_0x3c1aa6(0x17b)][_0x3c1aa6(0x16a)](_0x15efae[_0x3c1aa6(0x17b)]));await handleSDKOutput(_0x50f157,_0xdada31);}else{if(_0x1e1b1d===0x0)console[_0x3c1aa6(0x18e)](a39_0x51825a[_0x3c1aa6(0x169)]('['+_0x25176c+']')),console[_0x3c1aa6(0x18e)](_0x3c1aa6(0x154));else{console[_0x3c1aa6(0x18e)](a39_0x51825a['dim']('['+_0x25176c+']'));const _0x4abda9=formatFlatList(_0x5edc46,_0x30425a,{'showMetadata':!![],'showUrl':_0x2b388b,'getSegmentUrl':_0x56d034,'getJourneyUrl':_0x139afa},_0x42eab7);console['log'](_0x4abda9);}}return 0x0;}async[a39_0x164ca3(0x17d)](_0x1955e4,_0x2f4002){const _0x4d817d=a39_0x164ca3,{options:_0x4b9ad3,tdx:_0x204502}=_0x1955e4,_0x365f40=_0x4b9ad3[_0x4d817d(0x187)],_0x9e1111=await withSpinner('Resolving\x20path\x20\x27'+_0x2f4002+_0x4d817d(0x15c),()=>_0x204502[_0x4d817d(0x18b)]['resolvePathToResource'](_0x2f4002),{'verbose':_0x4b9ad3[_0x4d817d(0x186)]}),_0x2ac3c9=_0x9e1111[_0x4d817d(0x19b)];_0x4b9ad3['verbose']&&(console[_0x4d817d(0x171)](_0x4d817d(0x15b)+_0x2ac3c9[_0x4d817d(0x19c)]),_0x2ac3c9[_0x4d817d(0x191)]&&console[_0x4d817d(0x171)]('Folder\x20ID:\x20'+_0x2ac3c9[_0x4d817d(0x191)]));const _0x32b316=_0x4b9ad3['maxDepth']||0xa,_0x8e67fd=await withSpinner(_0x4d817d(0x177),()=>_0x204502[_0x4d817d(0x18b)][_0x4d817d(0x17d)](_0x2ac3c9[_0x4d817d(0x19c)],_0x2ac3c9[_0x4d817d(0x191)],0x0,_0x32b316),{'verbose':_0x4b9ad3['verbose']}),_0x4204e4=_0x8e67fd[_0x4d817d(0x19b)];console['error'](_0x4d817d(0x181)+_0x4204e4[_0x4d817d(0x184)]+_0x4d817d(0x16f));const _0x270fd2=_0x3ddb9f=>{const _0xbd62f6=_0x4d817d;return getConsoleNextUrl(_0x4b9ad3['site'],'/app/ps/'+_0x2ac3c9[_0xbd62f6(0x19c)]+'/e/'+_0x3ddb9f);};if(_0x4b9ad3[_0x4d817d(0x19d)]==='json'||_0x4b9ad3[_0x4d817d(0x19d)]==='jsonl')await handleSDKOutput(_0x4204e4,_0x4b9ad3);else{console[_0x4d817d(0x18e)](a39_0x51825a[_0x4d817d(0x169)]('['+_0x2f4002+']'));const _0x2001bc=formatTree(_0x4204e4,{'showMetadata':!![],'showUrl':_0x365f40,'getSegmentUrl':_0x270fd2});console[_0x4d817d(0x18e)](_0x2001bc);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a40_0x169ea8=a40_0x3286;(function(_0xe1ef71,_0x3dbc5d){const _0x3defef=a40_0x3286,_0x4451c3=_0xe1ef71();while(!![]){try{const _0x5bfee8=-parseInt(_0x3defef(0x14d))/0x1*(parseInt(_0x3defef(0x13d))/0x2)+-parseInt(_0x3defef(0x148))/0x3*(parseInt(_0x3defef(0x162))/0x4)+-parseInt(_0x3defef(0x15e))/0x5*(-parseInt(_0x3defef(0x15b))/0x6)+parseInt(_0x3defef(0x156))/0x7+-parseInt(_0x3defef(0x145))/0x8+parseInt(_0x3defef(0x13f))/0x9*(-parseInt(_0x3defef(0x147))/0xa)+parseInt(_0x3defef(0x146))/0xb;if(_0x5bfee8===_0x3dbc5d)break;else _0x4451c3['push'](_0x4451c3['shift']());}catch(_0x34af65){_0x4451c3['push'](_0x4451c3['shift']());}}}(a40_0x1a51,0x93ce7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a40_0x3286(_0x5585cb,_0x12f13e){_0x5585cb=_0x5585cb-0x138;const _0x1a5170=a40_0x1a51();let _0x328647=_0x1a5170[_0x5585cb];return _0x328647;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a40_0x1a51(){const _0x1be10e=['execute','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','✔\x20Retrieved\x20','limit','5076169cULdcB','cause','\x20from\x20','verbose','Error:\x20','1302HyvFoq','message','show','9690XfLbXG','...','length','Catalog:\x20','60FQaTgj','database','Querying\x20','Usage:\x20tdx\x20show\x20<database.table>','args','Show\x20table\x20contents','error','2TdfWmI','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','432fJOQUt','Site:\x20','data','Limit:\x20','catalog','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','7254248Oedqka','17769554ybPteU','34420xUqbfK','12396hFnXsU','\x20\x20Cause:\x20','\x20row','validate','showTable','1021735KwonSj','site','query','Table:\x20'];a40_0x1a51=function(){return _0x1be10e;};return a40_0x1a51();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a40_0x169ea8(0x15d);['description']=a40_0x169ea8(0x13b);async[a40_0x169ea8(0x151)](_0x1ef351){const _0x31eb60=a40_0x169ea8;return this[_0x31eb60(0x14c)](_0x1ef351);}async[a40_0x169ea8(0x14c)](_0x382af4){const _0x83883c=a40_0x169ea8,{options:_0x3b8274,args:_0x23be2a,tdx:_0x1fc9c9}=_0x382af4;let _0x442828;try{_0x442828=parseTableReference(_0x23be2a[0x0]);const _0xf69de=_0x3b8274[_0x83883c(0x163)];!_0x442828['database']&&_0xf69de&&(_0x442828[_0x83883c(0x163)]=_0xf69de);const _0x36af9e=validateTableDescribeReference(_0x442828);if(_0x36af9e)return console['error'](_0x83883c(0x15a)+_0x36af9e),console['error'](_0x83883c(0x139)),console[_0x83883c(0x13c)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x2b18bd){return console['error']('Error:\x20'+_0x2b18bd[_0x83883c(0x15c)]),console[_0x83883c(0x13c)](_0x83883c(0x139)),console[_0x83883c(0x13c)](_0x83883c(0x144)),console['error'](_0x83883c(0x152)),0x1;}const _0x150136=_0x442828[_0x83883c(0x143)],_0x5a3c82=_0x442828['database'],_0x10232f=_0x442828['table'],_0x56431b=resolveLimit(_0x3b8274[_0x83883c(0x155)],DEFAULT_DISPLAY_LIMIT);try{_0x3b8274[_0x83883c(0x159)]&&(console[_0x83883c(0x13c)](_0x83883c(0x140)+_0x3b8274[_0x83883c(0x14e)]),_0x150136&&console[_0x83883c(0x13c)](_0x83883c(0x161)+_0x150136),console[_0x83883c(0x13c)]('Database:\x20'+_0x5a3c82),console['error'](_0x83883c(0x150)+_0x10232f),console['error'](_0x83883c(0x142)+_0x56431b));const _0x307299=_0x150136?_0x150136+'.'+_0x5a3c82+'.'+_0x10232f:_0x5a3c82+'.'+_0x10232f,_0x5b5f7b=await withSpinner(_0x83883c(0x138)+_0x307299+_0x83883c(0x15f),()=>_0x1fc9c9[_0x83883c(0x14f)][_0x83883c(0x14c)](_0x5a3c82,_0x10232f,_0x56431b,_0x150136),{'verbose':_0x3b8274[_0x83883c(0x159)]}),_0xbd9016=_0x5b5f7b[_0x83883c(0x141)],_0x10668c=_0xbd9016[_0x83883c(0x141)];return _0x10668c[_0x83883c(0x160)]===0x0?console[_0x83883c(0x13c)](_0x83883c(0x153)):console['error'](_0x83883c(0x154)+_0x10668c[_0x83883c(0x160)]+_0x83883c(0x14a)+(_0x10668c[_0x83883c(0x160)]!==0x1?'s':'')+_0x83883c(0x158)+_0x307299),await handleSDKOutput(_0x10668c,_0x3b8274),0x0;}catch(_0x556d39){if(_0x556d39 instanceof SDKError)return console[_0x83883c(0x13c)](_0x83883c(0x15a)+_0x556d39[_0x83883c(0x15c)]),_0x556d39[_0x83883c(0x157)]&&console[_0x83883c(0x13c)](_0x83883c(0x149)+_0x556d39['cause']),0x1;throw _0x556d39;}}[a40_0x169ea8(0x14b)](_0x4bea25){const _0x3a4d7b=a40_0x169ea8;if(_0x4bea25[_0x3a4d7b(0x13a)]['length']===0x0)return'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';if(_0x4bea25[_0x3a4d7b(0x13a)][_0x3a4d7b(0x160)]>0x1)return _0x3a4d7b(0x13e);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x44fada=a41_0xbb70;(function(_0x72e119,_0x212032){const _0xde0817=a41_0xbb70,_0xe8471b=_0x72e119();while(!![]){try{const _0x1c7f8a=-parseInt(_0xde0817(0x189))/0x1*(-parseInt(_0xde0817(0x184))/0x2)+-parseInt(_0xde0817(0x18d))/0x3+parseInt(_0xde0817(0x1a6))/0x4*(-parseInt(_0xde0817(0x195))/0x5)+parseInt(_0xde0817(0x188))/0x6*(-parseInt(_0xde0817(0x190))/0x7)+parseInt(_0xde0817(0x17f))/0x8+parseInt(_0xde0817(0x1a7))/0x9*(parseInt(_0xde0817(0x1ac))/0xa)+-parseInt(_0xde0817(0x19f))/0xb*(-parseInt(_0xde0817(0x183))/0xc);if(_0x1c7f8a===_0x212032)break;else _0xe8471b['push'](_0xe8471b['shift']());}catch(_0x348214){_0xe8471b['push'](_0xe8471b['shift']());}}}(a41_0x30a0,0x20a45));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a41_0xbb70(_0x4d404d,_0x52c1da){_0x4d404d=_0x4d404d-0x17e;const _0x30a026=a41_0x30a0();let _0xbb706e=_0x30a026[_0x4d404d];return _0xbb706e;}import{parseTableReference}from'../utils/table-ref-parser.js';function a41_0x30a0(){const _0xe810ff=['226872IpvNgg','query','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','7tYBdlt','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','Database:\x20','length','includes','5pivuxm','error','cause','\x20\x20Cause:\x20','Note:\x20\x27','database','execute','✔\x20Found\x20','table','\x27\x20is\x20ambiguous.','12716HPJVcs','Site:\x20','Listing\x20tables...','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','limit','data','site','396692ugmvgl','553041HwJfLj','Error:\x20','message','Error:\x20Pattern\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','10CFvPrG','.*\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','1803520tyoekF','description','tables','\x20table','1056rBiSbb','4ePItAJ','Or\x20use\x20--in\x20flag:','Table\x20pattern:\x20','List\x20tables\x20in\x20a\x20database','1064682RWYGdv','48664pkupPX','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'];a41_0x30a0=function(){return _0xe810ff;};return a41_0x30a0();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']=a41_0x44fada(0x181);[a41_0x44fada(0x180)]=a41_0x44fada(0x187);async[a41_0x44fada(0x19b)](_0x3c1dba){const _0x403015=a41_0x44fada,{options:_0x1713bd,args:_0x2c841d,tdx:_0x5dc996}=_0x3c1dba;let _0x256ea9;if(_0x2c841d[_0x403015(0x193)]===0x0)_0x256ea9={'database':undefined,'table':undefined,'original':''};else{if(_0x2c841d['length']===0x1)try{_0x256ea9=parseTableReference(_0x2c841d[0x0]);if(_0x256ea9[_0x403015(0x19d)]&&!_0x256ea9[_0x403015(0x19a)]&&!_0x256ea9[_0x403015(0x19d)][_0x403015(0x194)]('*')&&!_0x256ea9[_0x403015(0x19d)]['includes']('?'))return console[_0x403015(0x196)](_0x403015(0x1aa)+_0x2c841d[0x0]+_0x403015(0x19e)),console[_0x403015(0x196)](_0x403015(0x191)+_0x256ea9[_0x403015(0x19d)]+'\x27?'),console[_0x403015(0x196)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x256ea9[_0x403015(0x19d)]+_0x403015(0x1ad)),console[_0x403015(0x196)](_0x403015(0x18b)+_0x256ea9[_0x403015(0x19d)]),console[_0x403015(0x196)](_0x403015(0x1ab)+_0x256ea9[_0x403015(0x19d)]),console[_0x403015(0x196)](''),console[_0x403015(0x196)](_0x403015(0x199)+_0x2c841d[0x0]+_0x403015(0x18a)+_0x256ea9['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x1dcede){return console[_0x403015(0x196)](_0x403015(0x1a8)+_0x1dcede['message']),0x1;}else return console['error']('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console['error'](_0x403015(0x18f)),console[_0x403015(0x196)](_0x403015(0x18c)),console[_0x403015(0x196)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x403015(0x196)](_0x403015(0x17e)),console[_0x403015(0x196)](_0x403015(0x185)),console[_0x403015(0x196)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x4a7e2b=_0x1713bd[_0x403015(0x19a)];!_0x256ea9['database']&&_0x4a7e2b&&(_0x256ea9['database']=_0x4a7e2b);try{const _0x53ffe5=_0x32cf69=>_0x32cf69&&(_0x32cf69[_0x403015(0x194)]('*')||_0x32cf69[_0x403015(0x194)]('?')),_0x5ee79b=_0x53ffe5(_0x256ea9['database']);_0x1713bd['verbose']&&(console[_0x403015(0x196)](_0x403015(0x1a0)+_0x1713bd[_0x403015(0x1a5)]),_0x256ea9['database']?_0x5ee79b?console[_0x403015(0x196)]('Database\x20pattern:\x20'+_0x256ea9['database']):console[_0x403015(0x196)](_0x403015(0x192)+_0x256ea9['database']):console['error']('Database:\x20all'),_0x256ea9['table']&&console[_0x403015(0x196)](_0x403015(0x186)+_0x256ea9['table']));const _0x29c53d=_0x256ea9[_0x403015(0x19a)]&&!_0x5ee79b?_0x256ea9['database']:undefined,_0x3125ba=_0x5ee79b?_0x256ea9[_0x403015(0x19a)]:undefined,_0x480106=_0x256ea9['table'],_0x36f393=resolveLimit(_0x1713bd[_0x403015(0x1a3)],DEFAULT_LISTING_LIMIT),_0x9f52be=await withSpinner(_0x403015(0x1a1),()=>_0x5dc996[_0x403015(0x18e)]['listTables'](_0x29c53d,_0x480106,_0x3125ba,_0x36f393),{'verbose':_0x1713bd['verbose']}),_0x1481ae=_0x9f52be[_0x403015(0x1a4)];if(_0x1481ae[_0x403015(0x193)]===0x0&&_0x256ea9['database']&&!_0x5ee79b)return console[_0x403015(0x196)]('✖\x20No\x20tables\x20found'),console['error']('Database\x20\x27'+_0x256ea9['database']+_0x403015(0x1a2)),0x1;return console[_0x403015(0x196)](_0x403015(0x19c)+_0x1481ae['length']+_0x403015(0x182)+(_0x1481ae['length']!==0x1?'s':'')),await handleSDKOutput(_0x1481ae,{..._0x1713bd,'limit':_0x36f393}),0x0;}catch(_0x2e0ec7){if(_0x2e0ec7 instanceof SDKError)return console[_0x403015(0x196)](_0x403015(0x1a8)+_0x2e0ec7[_0x403015(0x1a9)]),_0x2e0ec7['cause']&&console[_0x403015(0x196)](_0x403015(0x198)+_0x2e0ec7[_0x403015(0x197)]),0x1;throw _0x2e0ec7;}}['validate'](_0x472444){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a42_0x4b1e76=a42_0x1584;(function(_0x430c88,_0x528117){const _0x2ac4df=a42_0x1584,_0x18e5b5=_0x430c88();while(!![]){try{const _0x2d716c=parseInt(_0x2ac4df(0xc7))/0x1*(parseInt(_0x2ac4df(0xcd))/0x2)+-parseInt(_0x2ac4df(0xc8))/0x3+parseInt(_0x2ac4df(0xce))/0x4+parseInt(_0x2ac4df(0xc1))/0x5*(-parseInt(_0x2ac4df(0xbe))/0x6)+parseInt(_0x2ac4df(0xca))/0x7+-parseInt(_0x2ac4df(0xa7))/0x8+-parseInt(_0x2ac4df(0xaa))/0x9*(parseInt(_0x2ac4df(0xba))/0xa);if(_0x2d716c===_0x528117)break;else _0x18e5b5['push'](_0x18e5b5['shift']());}catch(_0x1bd0cc){_0x18e5b5['push'](_0x18e5b5['shift']());}}}(a42_0x4308,0xa4968));import{BaseCommand}from'./command.js';function a42_0x4308(){const _0x2955f9=['execute','Session\x20agent\x20set\x20to:\x20','cleared','session','5348504XKLpDk','\x27\x20does\x20not\x20exist','Session\x20context\x20','9rlHNzw','green','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','Session\x20profile\x20set\x20to:\x20','engage_workspace','Error:\x20','Error:\x20Profile\x20\x27','log','profile','clear','llm_agent','error','includes','Invalid\x20resource:\x20','1501370SERkZG','message','toString','use','1824puXxxW','(session:\x20','description','13175cMEqhh','Session\x20database\x20set\x20to:\x20','Session\x20llm_project\x20set\x20to:\x20','displayWithSources','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','join','70PTulTP','901191kEUeRb','agent','8149827CQmJHt','llm_project','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','4656isuLMC','5068272apuLTf','database','dim','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','name','debug','Session\x20engage_workspace\x20set\x20to:\x20','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','display','validate','length','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','Set\x20session-level\x20context'];a42_0x4308=function(){return _0x2955f9;};return a42_0x4308();}import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';function a42_0x1584(_0x383eb7,_0x334664){_0x383eb7=_0x383eb7-0x9c;const _0x4308c5=a42_0x4308();let _0x158411=_0x4308c5[_0x383eb7];return _0x158411;}import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../utils/agent-ref-parser.js';import a42_0x429805 from'chalk';export class UseCommand extends BaseCommand{[a42_0x4b1e76(0xd2)]=a42_0x4b1e76(0xbd);[a42_0x4b1e76(0xc0)]=a42_0x4b1e76(0xa2);[a42_0x4b1e76(0x9f)](_0x338898){const _0x29628c=a42_0x4b1e76,{args:_0x30e00e}=_0x338898;if(_0x30e00e[_0x29628c(0xa0)]===0x0)return undefined;if(_0x30e00e[_0x29628c(0xa0)]===0x1)return _0x29628c(0x9d)+'\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'+_0x29628c(0xae)+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a'+_0x29628c(0xc5);const _0x2180f4=_0x30e00e[0x0],_0x10b4d9=[_0x29628c(0xcf),_0x29628c(0xad),'llm_project',_0x29628c(0xc9),_0x29628c(0xb4),_0x29628c(0xb0)];if(!_0x10b4d9[_0x29628c(0xb8)](_0x2180f4))return _0x29628c(0xb9)+_0x2180f4+'.\x20Must\x20be\x20one\x20of:\x20'+_0x10b4d9[_0x29628c(0xc6)](',\x20');return undefined;}async[a42_0x4b1e76(0xa3)](_0x5c10a1){const _0x1721c1=a42_0x4b1e76,{args:_0x2cd918,options:_0x5d8323}=_0x5c10a1,_0x32cde9=_0x5d8323[_0x1721c1(0xd3)],_0x265ad5=_0x5d8323[_0x1721c1(0xb5)];cleanExpiredSessions();try{if(_0x265ad5){clearSessionContext(_0x5d8323['session']);const _0x3e4207=_0x5d8323[_0x1721c1(0xa6)]||getCurrentSessionPID()[_0x1721c1(0xbc)]();return console['log'](_0x1721c1(0xa9)+a42_0x429805[_0x1721c1(0xab)](_0x1721c1(0xa5))+'\x20'+a42_0x429805[_0x1721c1(0xd0)](_0x1721c1(0xbf)+_0x3e4207+')')),0x0;}if(_0x2cd918['length']===0x0){const _0x1b7749=new GlobalContext(_0x5d8323);return _0x32cde9?_0x1b7749[_0x1721c1(0xc4)]():_0x1b7749[_0x1721c1(0x9e)](),console[_0x1721c1(0xb3)](a42_0x429805['dim'](_0x1721c1(0xac))),console[_0x1721c1(0xb3)](a42_0x429805[_0x1721c1(0xd0)](_0x1721c1(0xa1))),0x0;}const _0x11d510=_0x2cd918[0x0],_0x387071=_0x2cd918[0x1];if(_0x11d510==='profile'){if(!profileExists(_0x387071))return console[_0x1721c1(0xb7)](_0x1721c1(0xb2)+_0x387071+_0x1721c1(0xa8)),console['error'](_0x1721c1(0xcc)),0x1;const _0x332dd5=_0x5d8323[_0x1721c1(0xa6)]||getCurrentSessionPID()[_0x1721c1(0xbc)]();return saveSessionContext({'profile':_0x387071},_0x5d8323['session']),console['log'](_0x1721c1(0xaf)+a42_0x429805['green'](_0x387071)+'\x20'+a42_0x429805[_0x1721c1(0xd0)](_0x1721c1(0xbf)+_0x332dd5+')')),console[_0x1721c1(0xb3)](a42_0x429805[_0x1721c1(0xd0)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x10d3f6={},_0x469000=_0x5d8323[_0x1721c1(0xa6)]||getCurrentSessionPID()[_0x1721c1(0xbc)]();switch(_0x11d510){case _0x1721c1(0xcf):_0x10d3f6['database']=_0x387071,console['log'](_0x1721c1(0xc2)+a42_0x429805[_0x1721c1(0xab)](_0x387071)+'\x20'+a42_0x429805['dim'](_0x1721c1(0xbf)+_0x469000+')'));break;case _0x1721c1(0xad):_0x10d3f6[_0x1721c1(0xad)]=_0x387071,console[_0x1721c1(0xb3)]('Session\x20parent_segment\x20set\x20to:\x20'+a42_0x429805[_0x1721c1(0xab)](_0x387071)+'\x20'+a42_0x429805[_0x1721c1(0xd0)](_0x1721c1(0xbf)+_0x469000+')'));break;case _0x1721c1(0xcb):_0x10d3f6[_0x1721c1(0xcb)]=_0x387071,console[_0x1721c1(0xb3)](_0x1721c1(0xc3)+a42_0x429805[_0x1721c1(0xab)](_0x387071)+'\x20'+a42_0x429805[_0x1721c1(0xd0)](_0x1721c1(0xbf)+_0x469000+')'));break;case _0x1721c1(0xc9):{const {projectName:_0x7b5ff7,agentName:_0x430ddd}=parseAgentRef(_0x387071);_0x430ddd?(_0x10d3f6[_0x1721c1(0xcb)]=_0x7b5ff7,_0x10d3f6[_0x1721c1(0xb6)]=_0x430ddd,console['log'](_0x1721c1(0xc3)+a42_0x429805[_0x1721c1(0xab)](_0x7b5ff7)+'\x20'+a42_0x429805[_0x1721c1(0xd0)]('(session:\x20'+_0x469000+')')),console['log'](_0x1721c1(0xa4)+a42_0x429805[_0x1721c1(0xab)](_0x430ddd)+'\x20'+a42_0x429805[_0x1721c1(0xd0)](_0x1721c1(0xbf)+_0x469000+')'))):(_0x10d3f6['llm_agent']=_0x387071,console['log'](_0x1721c1(0xa4)+a42_0x429805[_0x1721c1(0xab)](_0x387071)+'\x20'+a42_0x429805[_0x1721c1(0xd0)](_0x1721c1(0xbf)+_0x469000+')')));break;}case _0x1721c1(0xb0):_0x10d3f6[_0x1721c1(0xb0)]=_0x387071,console[_0x1721c1(0xb3)](_0x1721c1(0x9c)+a42_0x429805[_0x1721c1(0xab)](_0x387071)+'\x20'+a42_0x429805['dim']('(session:\x20'+_0x469000+')'));break;}return saveSessionContext(_0x10d3f6,_0x5d8323['session']),console[_0x1721c1(0xb3)](a42_0x429805[_0x1721c1(0xd0)](_0x1721c1(0xd1))),0x0;}catch(_0x151de6){return _0x151de6 instanceof Error&&console[_0x1721c1(0xb7)](_0x1721c1(0xb1)+_0x151de6[_0x1721c1(0xbb)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a43_0x2bb8(){const _0x2a9839=['length','user','description','7MBNiDf','Error:\x20','verbose','1581584xnoFUS','name','302246esWgJT','cause','\x20user','execute','\x20\x20Cause:\x20','data','1732444hQILkv','6obbjsO','22563540TktOuz','Show\x20current\x20user\x20information','message','list','✔\x20Found\x20','error','Listing\x20users...','228118tVZoww','user\x20list','List\x20all\x20users\x20in\x20the\x20account','2154365iwmWap','5703588xNJJNR'];a43_0x2bb8=function(){return _0x2a9839;};return a43_0x2bb8();}const a43_0x21b9ee=a43_0x42a3;(function(_0x3c12d4,_0x63c830){const _0x472349=a43_0x42a3,_0x383eef=_0x3c12d4();while(!![]){try{const _0x96ae46=-parseInt(_0x472349(0x1fb))/0x1+-parseInt(_0x472349(0x1ec))/0x2*(-parseInt(_0x472349(0x1f3))/0x3)+-parseInt(_0x472349(0x1f2))/0x4+-parseInt(_0x472349(0x1e2))/0x5+-parseInt(_0x472349(0x1e3))/0x6+parseInt(_0x472349(0x1e7))/0x7*(-parseInt(_0x472349(0x1ea))/0x8)+parseInt(_0x472349(0x1f4))/0x9;if(_0x96ae46===_0x63c830)break;else _0x383eef['push'](_0x383eef['shift']());}catch(_0x59bd58){_0x383eef['push'](_0x383eef['shift']());}}}(a43_0x2bb8,0x8ae4c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a43_0x42a3(_0x568a10,_0x3be3cf){_0x568a10=_0x568a10-0x1e1;const _0x2bb8ec=a43_0x2bb8();let _0x42a3db=_0x2bb8ec[_0x568a10];return _0x42a3db;}import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a43_0x21b9ee(0x1eb)]=a43_0x21b9ee(0x1e5);[a43_0x21b9ee(0x1e6)]=a43_0x21b9ee(0x1f5);async[a43_0x21b9ee(0x1ef)](_0x6b75f2){const _0x2dceb1=a43_0x21b9ee,{options:_0x2203e7,tdx:_0x125ddb}=_0x6b75f2;try{const _0x3b2c98=await withSpinner('Fetching\x20user\x20info...',()=>_0x125ddb[_0x2dceb1(0x1e5)]['getCurrent'](),{'verbose':_0x2203e7[_0x2dceb1(0x1e9)]}),_0x46f9f4=_0x3b2c98[_0x2dceb1(0x1f1)];return await handleSingleObjectOutput(_0x46f9f4,_0x2203e7),0x0;}catch(_0x1fa4c1){if(_0x1fa4c1 instanceof SDKError)return console[_0x2dceb1(0x1f9)]('Error:\x20'+_0x1fa4c1[_0x2dceb1(0x1f6)]),_0x1fa4c1['cause']&&console[_0x2dceb1(0x1f9)]('\x20\x20Cause:\x20'+_0x1fa4c1[_0x2dceb1(0x1ed)]),0x1;throw _0x1fa4c1;}}}export class UserListCommand extends BaseCommand{[a43_0x21b9ee(0x1eb)]=a43_0x21b9ee(0x1fc);[a43_0x21b9ee(0x1e6)]=a43_0x21b9ee(0x1e1);async[a43_0x21b9ee(0x1ef)](_0x12735c){const _0x67751a=a43_0x21b9ee,{options:_0x388084,tdx:_0x86f310}=_0x12735c;try{const _0x3261dc=await withSpinner(_0x67751a(0x1fa),()=>_0x86f310['user'][_0x67751a(0x1f7)](),{'verbose':_0x388084['verbose']}),_0xb43f6e=_0x3261dc[_0x67751a(0x1f1)];return console[_0x67751a(0x1f9)](_0x67751a(0x1f8)+_0xb43f6e[_0x67751a(0x1e4)]+_0x67751a(0x1ee)+(_0xb43f6e[_0x67751a(0x1e4)]!==0x1?'s':'')),await handleSDKOutput(_0xb43f6e,_0x388084),0x0;}catch(_0xbd7ee1){if(_0xbd7ee1 instanceof SDKError)return console['error'](_0x67751a(0x1e8)+_0xbd7ee1[_0x67751a(0x1f6)]),_0xbd7ee1[_0x67751a(0x1ed)]&&console[_0x67751a(0x1f9)](_0x67751a(0x1f0)+_0xbd7ee1[_0x67751a(0x1ed)]),0x1;throw _0xbd7ee1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a44_0x16383b=a44_0x3f12;(function(_0x263e41,_0x400f82){const _0xe93d38=a44_0x3f12,_0x6da8bc=_0x263e41();while(!![]){try{const _0x33bf3b=parseInt(_0xe93d38(0x96))/0x1*(-parseInt(_0xe93d38(0xa3))/0x2)+parseInt(_0xe93d38(0xf2))/0x3*(parseInt(_0xe93d38(0xf7))/0x4)+-parseInt(_0xe93d38(0xb2))/0x5+-parseInt(_0xe93d38(0xbb))/0x6+parseInt(_0xe93d38(0xc9))/0x7+-parseInt(_0xe93d38(0xdc))/0x8+parseInt(_0xe93d38(0xd1))/0x9;if(_0x33bf3b===_0x400f82)break;else _0x6da8bc['push'](_0x6da8bc['shift']());}catch(_0x524d1d){_0x6da8bc['push'](_0x6da8bc['shift']());}}}(a44_0x5e5d,0x7265b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0x210539 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0xd5);[a44_0x16383b(0xde)]=a44_0x16383b(0xd7);async[a44_0x16383b(0x121)](_0x5cc5f){const _0x5423e6=a44_0x16383b,{options:_0x27e056,args:_0x51547b,tdx:_0x264647}=_0x5cc5f,_0x545d4d=_0x51547b[0x0];try{_0x27e056[_0x5423e6(0x10d)]&&_0x545d4d&&console[_0x5423e6(0xdf)](_0x5423e6(0x10b)+_0x545d4d);const _0x1f63b3=await withSpinner(_0x5423e6(0x112),()=>_0x264647[_0x5423e6(0x10f)][_0x5423e6(0x87)](_0x545d4d,{'limit':_0x27e056[_0x5423e6(0xb8)]}),{'verbose':_0x27e056['verbose']}),_0x3c5f87=_0x1f63b3['data'];return console[_0x5423e6(0xdf)](_0x5423e6(0xbd)+_0x3c5f87[_0x5423e6(0x118)]+_0x5423e6(0x105)+(_0x3c5f87[_0x5423e6(0x118)]!==0x1?'s':'')),await handleSDKOutput(_0x3c5f87,_0x27e056),0x0;}catch(_0x1dec0d){if(_0x1dec0d instanceof SDKError)return console[_0x5423e6(0xdf)](_0x5423e6(0xf4)+_0x1dec0d[_0x5423e6(0x8c)]),_0x1dec0d['cause']&&console[_0x5423e6(0xdf)](_0x5423e6(0xb1)+_0x1dec0d[_0x5423e6(0xbf)]),0x1;throw _0x1dec0d;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x124);[a44_0x16383b(0xde)]='List\x20workflows';async[a44_0x16383b(0x121)](_0x5452ba){const _0x3148b4=a44_0x16383b,{options:_0x3c269a,args:_0x31a0a3,tdx:_0x37af11}=_0x5452ba,_0x5253da=_0x31a0a3[0x0];try{_0x3c269a[_0x3148b4(0x10d)]&&_0x5253da&&console[_0x3148b4(0xdf)](_0x3148b4(0x122)+_0x5253da);const _0xd1661e=await withSpinner(_0x3148b4(0x10e),()=>_0x37af11['workflow'][_0x3148b4(0x107)](_0x5253da,{'limit':_0x3c269a[_0x3148b4(0xb8)]}),{'verbose':_0x3c269a[_0x3148b4(0x10d)]}),_0x5609eb=_0xd1661e[_0x3148b4(0xb7)];return console[_0x3148b4(0xdf)](_0x3148b4(0xbd)+_0x5609eb[_0x3148b4(0x118)]+_0x3148b4(0xc1)+(_0x5609eb['length']!==0x1?'s':'')),await handleSDKOutput(_0x5609eb,_0x3c269a),0x0;}catch(_0x36a81a){if(_0x36a81a instanceof SDKError)return console['error'](_0x3148b4(0xf4)+_0x36a81a[_0x3148b4(0x8c)]),_0x36a81a['cause']&&console[_0x3148b4(0xdf)](_0x3148b4(0xb1)+_0x36a81a[_0x3148b4(0xbf)]),0x1;throw _0x36a81a;}}}function a44_0x5e5d(){const _0x28166a=['workflow:kill','\x22?\x20This\x20cannot\x20be\x20undone.','List\x20workflow\x20execution\x20sessions','Retry\x20a\x20session\x20or\x20attempt','kill','Error:\x20Invalid\x20parameter\x20format:\x20','...','stringify','log','23mTuaUv','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Error:\x20Project\x20name\x20is\x20required','\x20\x20Revision:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Including\x20subtasks:\x20yes','workflow:delete','\x20\x20Project\x20ID:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','parse','split','\x20session','retryAttemptName','59886hFLOzi','Project:\x20','Session\x20time:\x20','fileSize','Error:\x20Attempt\x20ID\x20is\x20required','json','\x20is\x20not\x20a\x20directory','projectId','projectName','getTime','workflow:sessions','stat','done','running','\x20\x20Cause:\x20','1247905eFDvNc','name','\x20task','Getting\x20attempt\x20tasks...','Filter:\x20','data','limit','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','substring','5179044hQYUBZ','Pushing\x20workflow\x20project...','✔\x20Found\x20','task','cause','revision','\x20workflow','✔\x20Downloaded\x20','Error:\x20Workflow\x20identifier\x20is\x20required','project','logs','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','delete','Include\x20retried:\x20yes','6144257PFOZSl','cancelRequested','attempt','canceling','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Resume\x20from:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','reason','19123542biCsBs','Filter:\x20project=','isArray','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:projects','createdAt','List\x20all\x20workflow\x20projects','format','utf-8','finishedAt','attemptId','6113264UhAIyc','Project\x20directory:\x20','description','error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Kill\x20a\x20running\x20attempt','success','Show\x20specific\x20attempt\x20details','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','From\x20task:\x20','No\x20log\x20content\x20found','map','params','Task\x20name:\x20','workflow:push','Retrying\x20session...','param','✔\x20Retry\x20started','retryAttempt','Show\x20tasks\x20for\x20an\x20attempt','\x20\x20Location:\x20','sessionTime','21OohWyl','Deleting\x20project\x20','Error:\x20','List\x20workflow\x20attempts','workflow:attempts','18048OFpkmT','yes','index','skipValidation','taskName','status','filesExtracted','attempt:','Attempt\x20ID:\x20','fs/promises','workflow:retry','✔\x20Pushed\x20','Expected\x20format:\x20--param\x20key=value','attempts','\x20project','Reason:\x20','workflows','\x20\x20Workflow:\x20','download','Validation:\x20skipped','Pattern:\x20','Listing\x20workflow\x20sessions...','verbose','Listing\x20workflows...','workflow','startsWith','workflow:attempt','Listing\x20workflow\x20projects...','Parameters:\x20','session:','workflow:logs','Start\x20a\x20workflow\x20run','Starting\x20workflow\x20run...','length','✔\x20Deleted\x20project\x20','includeSubtasks','includeRetried','Revision:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','retrySession','Show\x20logs\x20for\x20a\x20workflow\x20attempt','sessions','execute','Project\x20filter:\x20','sessionId','workflow:workflows','session','Listing\x20workflow\x20attempts...','readFile','Target:\x20','keys','\x20attempt','force','from','\x20\x20Session\x20ID:\x20','projects','select','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Attempt\x20ID:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','message'];a44_0x5e5d=function(){return _0x28166a;};return a44_0x5e5d();}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0xad);[a44_0x16383b(0xde)]=a44_0x16383b(0x8f);async[a44_0x16383b(0x121)](_0x37ef64){const _0x44f5ab=a44_0x16383b,{options:_0x5ed4a0,args:_0x260cf0,tdx:_0x44fbd8}=_0x37ef64;let _0x433ffc,_0x56b037;if(_0x260cf0[0x0]){const _0x40f46f=_0x260cf0[0x0][_0x44f5ab(0xa0)]('.');if(_0x40f46f[_0x44f5ab(0x118)]===0x1)_0x433ffc=_0x40f46f[0x0];else{if(_0x40f46f['length']===0x2)[_0x433ffc,_0x56b037]=_0x40f46f;else return console[_0x44f5ab(0xdf)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{if(_0x5ed4a0[_0x44f5ab(0x10d)]){if(_0x433ffc&&_0x56b037)console['error'](_0x44f5ab(0xb6)+_0x433ffc+'.'+_0x56b037);else _0x433ffc&&console['error'](_0x44f5ab(0xd2)+_0x433ffc);const _0xd04765=_0x5ed4a0[_0x44f5ab(0xfc)];_0xd04765&&console[_0x44f5ab(0xdf)]('Status:\x20'+_0xd04765);}const _0x26968f=await withSpinner(_0x44f5ab(0x10c),()=>_0x44fbd8[_0x44f5ab(0x10f)][_0x44f5ab(0x120)]({'projectName':_0x433ffc,'workflowName':_0x56b037,'status':_0x5ed4a0['status'],'fromTime':_0x5ed4a0[_0x44f5ab(0x85)],'toTime':_0x5ed4a0['to'],'limit':_0x5ed4a0[_0x44f5ab(0xb8)]}),{'verbose':_0x5ed4a0[_0x44f5ab(0x10d)]}),_0x280687=_0x26968f[_0x44f5ab(0xb7)];return console[_0x44f5ab(0xdf)]('✔\x20Found\x20'+_0x280687[_0x44f5ab(0x118)]+_0x44f5ab(0xa1)+(_0x280687[_0x44f5ab(0x118)]!==0x1?'s':'')),await handleSDKOutput(_0x280687,_0x5ed4a0),0x0;}catch(_0x4634f0){if(_0x4634f0 instanceof SDKError)return console[_0x44f5ab(0xdf)](_0x44f5ab(0xf4)+_0x4634f0[_0x44f5ab(0x8c)]),_0x4634f0['cause']&&console['error'](_0x44f5ab(0xb1)+_0x4634f0[_0x44f5ab(0xbf)]),0x1;throw _0x4634f0;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a44_0x16383b(0xf6);['description']=a44_0x16383b(0xf5);async['execute'](_0x3812a1){const _0x257218=a44_0x16383b,{options:_0x2671c8,args:_0x4eaf41,tdx:_0x3a40a5}=_0x3812a1;let _0x1b32dd,_0x1ef97f;if(_0x4eaf41[0x0]){const _0x27d70a=_0x4eaf41[0x0][_0x257218(0xa0)]('.');if(_0x27d70a[_0x257218(0x118)]===0x1)_0x1b32dd=_0x27d70a[0x0];else{if(_0x27d70a[_0x257218(0x118)]===0x2)[_0x1b32dd,_0x1ef97f]=_0x27d70a;else return console[_0x257218(0xdf)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x44c3c6=_0x2671c8[_0x257218(0x11b)];if(_0x2671c8[_0x257218(0x10d)]){if(_0x1b32dd&&_0x1ef97f)console['error'](_0x257218(0xb6)+_0x1b32dd+'.'+_0x1ef97f);else _0x1b32dd&&console[_0x257218(0xdf)](_0x257218(0xd2)+_0x1b32dd);_0x44c3c6&&console[_0x257218(0xdf)](_0x257218(0xc8));}const _0x5d105e=await withSpinner(_0x257218(0x126),()=>_0x3a40a5[_0x257218(0x10f)][_0x257218(0x104)]({'projectName':_0x1b32dd,'workflowName':_0x1ef97f,'includeRetried':_0x44c3c6,'limit':_0x2671c8[_0x257218(0xb8)]}),{'verbose':_0x2671c8[_0x257218(0x10d)]}),_0x3d400c=_0x5d105e[_0x257218(0xb7)];return console['error'](_0x257218(0xbd)+_0x3d400c['length']+_0x257218(0x83)+(_0x3d400c[_0x257218(0x118)]!==0x1?'s':'')),await handleSDKOutput(_0x3d400c,_0x2671c8),0x0;}catch(_0x267a4b){if(_0x267a4b instanceof SDKError)return console[_0x257218(0xdf)](_0x257218(0xf4)+_0x267a4b['message']),_0x267a4b[_0x257218(0xbf)]&&console['error'](_0x257218(0xb1)+_0x267a4b[_0x257218(0xbf)]),0x1;throw _0x267a4b;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a44_0x16383b(0x111);[a44_0x16383b(0xde)]=a44_0x16383b(0xe3);async[a44_0x16383b(0x121)](_0x589922){const _0x41c770=a44_0x16383b,{options:_0x55d90b,args:_0x4a68a6,tdx:_0x5e67c1}=_0x589922,_0x2952f0=_0x4a68a6[0x0];if(!_0x2952f0)return console[_0x41c770(0xdf)](_0x41c770(0xa7)),0x1;try{_0x55d90b[_0x41c770(0x10d)]&&console['error'](_0x41c770(0xff)+_0x2952f0);const _0x12d7cc=await withSpinner('Getting\x20attempt\x20details...',()=>_0x5e67c1['workflow'][_0x41c770(0xcb)](_0x2952f0),{'verbose':_0x55d90b[_0x41c770(0x10d)]}),_0x2932fa=_0x12d7cc[_0x41c770(0xb7)];let _0x5d37c1;!_0x2932fa[_0x41c770(0xaf)]?_0x5d37c1=_0x2932fa[_0x41c770(0xca)]?_0x41c770(0xcc):_0x41c770(0xb0):_0x5d37c1=_0x2932fa[_0x41c770(0xe2)]?'success':_0x41c770(0xdf);let _0x58c0e2;if(_0x2932fa['createdAt']&&_0x2932fa[_0x41c770(0xda)]){const _0x435560=new Date(_0x2932fa[_0x41c770(0xd6)])[_0x41c770(0xac)](),_0x406eb5=new Date(_0x2932fa[_0x41c770(0xda)])['getTime']();_0x58c0e2=Math['round']((_0x406eb5-_0x435560)/0x3e8);}const _0x3dddb3={'attempt_id':_0x2932fa['id'],'status':_0x5d37c1,..._0x2932fa[_0x41c770(0xf9)]!==undefined&&{'index':_0x2932fa[_0x41c770(0xf9)]},..._0x2932fa[_0x41c770(0xc4)]&&{'project':_0x2932fa['project'][_0x41c770(0xb3)]},..._0x2932fa[_0x41c770(0x10f)]&&{'workflow':_0x2932fa[_0x41c770(0x10f)][_0x41c770(0xb3)]},..._0x2932fa[_0x41c770(0x123)]&&{'session_id':_0x2932fa[_0x41c770(0x123)]},..._0x2932fa[_0x41c770(0xf1)]&&{'session_time':_0x2932fa[_0x41c770(0xf1)]},..._0x2932fa[_0x41c770(0xa2)]&&{'retry_attempt':_0x2932fa[_0x41c770(0xa2)]},..._0x58c0e2!==undefined&&{'duration_sec':_0x58c0e2},..._0x2932fa[_0x41c770(0xd6)]&&{'created_at':_0x2932fa[_0x41c770(0xd6)]},..._0x2932fa[_0x41c770(0xda)]&&{'finished_at':_0x2932fa[_0x41c770(0xda)]},...Object[_0x41c770(0x82)](_0x2932fa[_0x41c770(0xe8)])[_0x41c770(0x118)]>0x0&&{'params':_0x2932fa[_0x41c770(0xe8)]}};return await handleSingleObjectOutput(_0x3dddb3,_0x55d90b),0x0;}catch(_0x55c629){if(_0x55c629 instanceof SDKError)return console[_0x41c770(0xdf)]('Error:\x20'+_0x55c629[_0x41c770(0x8c)]),_0x55c629[_0x41c770(0xbf)]&&console['error']('\x20\x20Cause:\x20'+_0x55c629[_0x41c770(0xbf)]),0x1;throw _0x55c629;}}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a44_0x16383b(0xde)]=a44_0x16383b(0xef);async[a44_0x16383b(0x121)](_0x4457dc){const _0x49ee9e=a44_0x16383b,{options:_0x3734a3,args:_0x34ee58,tdx:_0x4c30a3}=_0x4457dc,_0x354d24=_0x34ee58[0x0];if(!_0x354d24)return console[_0x49ee9e(0xdf)](_0x49ee9e(0xa7)),0x1;try{const _0x3504b8=_0x3734a3[_0x49ee9e(0x11a)];_0x3734a3['verbose']&&(console[_0x49ee9e(0xdf)]('Attempt\x20ID:\x20'+_0x354d24),_0x3504b8&&console[_0x49ee9e(0xdf)](_0x49ee9e(0x9b)));const _0x57d41c=await withSpinner(_0x49ee9e(0xb5),()=>_0x4c30a3['workflow']['tasks'](_0x354d24,_0x3504b8||![]),{'verbose':_0x3734a3['verbose']}),_0x24bc0a=_0x57d41c[_0x49ee9e(0xb7)];return console[_0x49ee9e(0xdf)](_0x49ee9e(0xbd)+_0x24bc0a[_0x49ee9e(0x118)]+_0x49ee9e(0xb4)+(_0x24bc0a[_0x49ee9e(0x118)]!==0x1?'s':'')),await handleSDKOutput(_0x24bc0a,_0x3734a3),0x0;}catch(_0x5c1d28){if(_0x5c1d28 instanceof SDKError)return console[_0x49ee9e(0xdf)](_0x49ee9e(0xf4)+_0x5c1d28[_0x49ee9e(0x8c)]),_0x5c1d28[_0x49ee9e(0xbf)]&&console['error'](_0x49ee9e(0xb1)+_0x5c1d28[_0x49ee9e(0xbf)]),0x1;throw _0x5c1d28;}}}export class WorkflowLogsCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x115);['description']=a44_0x16383b(0x11f);async[a44_0x16383b(0x121)](_0x53e90d){const _0x2df433=a44_0x16383b,{options:_0x46b1c6,args:_0x132e90,tdx:_0x3c5cce}=_0x53e90d,_0x50187b=_0x132e90[0x0];let _0xcbaaa6=_0x132e90[0x1];if(!_0x50187b)return console[_0x2df433(0xdf)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x46b1c6['verbose']&&(console['error']('Attempt\x20ID:\x20'+_0x50187b),_0xcbaaa6&&console['error'](_0x2df433(0xe9)+_0xcbaaa6));const _0x2eb8dd=await withSpinner('Fetching\x20log\x20files...',()=>_0x3c5cce[_0x2df433(0x10f)]['logFiles'](_0x50187b,_0xcbaaa6),{'verbose':_0x46b1c6[_0x2df433(0x10d)]}),_0x1ed0ee=_0x2eb8dd['data'];if(_0x1ed0ee[_0x2df433(0x118)]===0x0)return console[_0x2df433(0xdf)](_0x2df433(0x11d)),0x0;if(!_0xcbaaa6&&(_0x46b1c6[_0x2df433(0xa8)]||_0x46b1c6[_0x2df433(0xd8)]))return await handleSDKOutput(_0x1ed0ee,_0x46b1c6),0x0;if(!_0xcbaaa6){const _0x41c615=_0x1ed0ee[_0x2df433(0xe7)](_0x54608d=>({'title':_0x54608d[_0x2df433(0xfb)]+'\x20('+formatBytes(_0x54608d[_0x2df433(0xa6)])+')','value':_0x54608d['taskName']})),_0x4ea3a8=await a44_0x210539({'type':_0x2df433(0x88),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x41c615});if(!_0x4ea3a8[_0x2df433(0xbe)])return console[_0x2df433(0xdf)]('Cancelled'),0x0;_0xcbaaa6=_0x4ea3a8[_0x2df433(0xbe)];}const _0x1cc2f8=await withSpinner('Downloading\x20logs...',()=>_0x3c5cce[_0x2df433(0x10f)][_0x2df433(0xc5)](_0x50187b,_0xcbaaa6),{'verbose':_0x46b1c6[_0x2df433(0x10d)]}),_0x47d34b=_0x1cc2f8[_0x2df433(0xb7)];return _0x47d34b?console[_0x2df433(0x95)](_0x47d34b):console[_0x2df433(0xdf)](_0x2df433(0xe6)),0x0;}catch(_0x17ba09){if(_0x17ba09 instanceof SDKError)return console[_0x2df433(0xdf)](_0x2df433(0xf4)+_0x17ba09[_0x2df433(0x8c)]),_0x17ba09['cause']&&console['error'](_0x2df433(0xb1)+_0x17ba09['cause']),0x1;throw _0x17ba09;}}}export class WorkflowKillCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x8d);['description']=a44_0x16383b(0xe1);async[a44_0x16383b(0x121)](_0x54c24d){const _0x240e34=a44_0x16383b,{options:_0x566222,args:_0x40b127,tdx:_0x4d8465}=_0x54c24d,_0x544350=_0x40b127[0x0];if(!_0x544350)return console[_0x240e34(0xdf)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x13a890=_0x566222[_0x240e34(0xd0)];_0x566222[_0x240e34(0x10d)]&&(console[_0x240e34(0xdf)](_0x240e34(0xff)+_0x544350),_0x13a890&&console['error'](_0x240e34(0x106)+_0x13a890));if(!_0x566222[_0x240e34(0xf8)]){const _0x189b2e=await confirm(_0x240e34(0xb9)+_0x544350+'?');if(!_0x189b2e)return console['error']('Cancelled'),0x0;}const _0x11a16f=await withSpinner('Killing\x20attempt...',()=>_0x4d8465['workflow'][_0x240e34(0x91)](_0x544350,_0x13a890),{'verbose':_0x566222[_0x240e34(0x10d)]}),_0x5f20ae=_0x11a16f[_0x240e34(0xb7)];return console[_0x240e34(0xdf)]('✔\x20'+_0x5f20ae),0x0;}catch(_0x5b94c4){if(_0x5b94c4 instanceof SDKError)return console['error'](_0x240e34(0xf4)+_0x5b94c4[_0x240e34(0x8c)]),_0x5b94c4[_0x240e34(0xbf)]&&console[_0x240e34(0xdf)](_0x240e34(0xb1)+_0x5b94c4[_0x240e34(0xbf)]),0x1;throw _0x5b94c4;}}}export class WorkflowRetryCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x101);[a44_0x16383b(0xde)]=a44_0x16383b(0x90);async[a44_0x16383b(0x121)](_0x30679b){const _0x16589e=a44_0x16383b,{options:_0x3ae809,args:_0x5e6450,tdx:_0x141df6}=_0x30679b,_0x17fd86=_0x5e6450[0x0];if(!_0x17fd86)return console[_0x16589e(0xdf)](_0x16589e(0xe0)),console[_0x16589e(0xdf)](_0x16589e(0xc6)),0x1;let _0x341955=![],_0x541a41=_0x17fd86;if(_0x17fd86[_0x16589e(0x110)](_0x16589e(0x114)))_0x341955=!![],_0x541a41=_0x17fd86[_0x16589e(0xba)](0x8);else{if(_0x17fd86['startsWith'](_0x16589e(0xfe)))_0x341955=![],_0x541a41=_0x17fd86[_0x16589e(0xba)](0x8);else return console[_0x16589e(0xdf)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x16589e(0xdf)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x11cc20=_0x3ae809['fromTask'],_0x4418ca=_0x3ae809['resumeFrom'],_0x1b2402=_0x3ae809['params'],_0x312ac3=_0x3ae809[_0x16589e(0x84)];_0x3ae809['verbose']&&(console[_0x16589e(0xdf)](_0x16589e(0x81)+(_0x341955?_0x16589e(0x125):'attempt')+'\x20'+_0x541a41),_0x11cc20&&console[_0x16589e(0xdf)](_0x16589e(0xe5)+_0x11cc20),_0x4418ca&&console[_0x16589e(0xdf)](_0x16589e(0xce)+_0x4418ca),_0x1b2402&&console[_0x16589e(0xdf)]('Params:\x20'+_0x1b2402),_0x312ac3&&console['error']('Force:\x20yes'));let _0x1a60e9;if(_0x1b2402)try{if(_0x1b2402[_0x16589e(0x110)]('@')){const _0xb395ff=await import(_0x16589e(0x100)),_0x1919eb=_0x1b2402[_0x16589e(0xba)](0x1),_0x2ab894=await _0xb395ff[_0x16589e(0x80)](_0x1919eb,_0x16589e(0xd9));_0x1a60e9=JSON[_0x16589e(0x9f)](_0x2ab894);}else _0x1a60e9=JSON['parse'](_0x1b2402);}catch{return console[_0x16589e(0xdf)](_0x16589e(0x89)),0x1;}if(!_0x3ae809[_0x16589e(0xf8)]){const _0x418eec=await confirm(_0x16589e(0xd4)+(_0x341955?_0x16589e(0x125):_0x16589e(0xcb))+'\x20'+_0x541a41+'?');if(!_0x418eec)return console[_0x16589e(0xdf)]('Cancelled'),0x0;}let _0x2c5cfc;_0x341955?_0x2c5cfc=await withSpinner(_0x16589e(0xeb),()=>_0x141df6[_0x16589e(0x10f)][_0x16589e(0x11e)](_0x541a41,{'fromTask':_0x11cc20,'retryParams':_0x1a60e9}),{'verbose':_0x3ae809['verbose']}):_0x2c5cfc=await withSpinner('Retrying\x20attempt...',()=>_0x141df6[_0x16589e(0x10f)][_0x16589e(0xee)](_0x541a41,{'resumeFrom':_0x4418ca,'retryParams':_0x1a60e9,'force':_0x312ac3}),{'verbose':_0x3ae809[_0x16589e(0x10d)]});const _0x462d46=_0x2c5cfc[_0x16589e(0xb7)];return console[_0x16589e(0xdf)](_0x16589e(0xed)),console[_0x16589e(0xdf)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x462d46[_0x16589e(0xdb)]),console['error'](_0x16589e(0x86)+_0x462d46[_0x16589e(0x123)]),0x0;}catch(_0xac485e){if(_0xac485e instanceof SDKError)return console[_0x16589e(0xdf)](_0x16589e(0xf4)+_0xac485e['message']),_0xac485e['cause']&&console['error']('\x20\x20Cause:\x20'+_0xac485e[_0x16589e(0xbf)]),0x1;throw _0xac485e;}}}function a44_0x3f12(_0x5d86a1,_0xc2ecc0){_0x5d86a1=_0x5d86a1-0x80;const _0x5e5da7=a44_0x5e5d();let _0x3f1251=_0x5e5da7[_0x5d86a1];return _0x3f1251;}export class WorkflowRunCommand extends BaseCommand{['name']='workflow:run';[a44_0x16383b(0xde)]=a44_0x16383b(0x116);async[a44_0x16383b(0x121)](_0x43b471){const _0xf2da62=a44_0x16383b,{options:_0x20b7cc,args:_0x49a86e,tdx:_0x3739f5}=_0x43b471,_0x12fbe2=_0x49a86e[0x0];if(!_0x12fbe2)return console[_0xf2da62(0xdf)](_0xf2da62(0xc3)),console[_0xf2da62(0xdf)]('Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]'),0x1;const _0x2b27e9=_0x20b7cc[_0xf2da62(0xec)],_0x3c22b2=_0x20b7cc['sessionTime'],_0x4ac0e3={};if(_0x2b27e9&&Array[_0xf2da62(0xd3)](_0x2b27e9))for(const _0x3d11be of _0x2b27e9){const _0x2604cf=_0x3d11be['indexOf']('=');if(_0x2604cf===-0x1)return console[_0xf2da62(0xdf)](_0xf2da62(0x92)+_0x3d11be),console[_0xf2da62(0xdf)](_0xf2da62(0x103)),0x1;const _0x2566c2=_0x3d11be[_0xf2da62(0xba)](0x0,_0x2604cf),_0x18247f=_0x3d11be[_0xf2da62(0xba)](_0x2604cf+0x1);try{_0x4ac0e3[_0x2566c2]=JSON[_0xf2da62(0x9f)](_0x18247f);}catch{_0x4ac0e3[_0x2566c2]=_0x18247f;}}_0x20b7cc['verbose']&&(console['error']('Workflow:\x20'+_0x12fbe2),Object[_0xf2da62(0x82)](_0x4ac0e3)[_0xf2da62(0x118)]>0x0&&console[_0xf2da62(0xdf)](_0xf2da62(0x113)+JSON[_0xf2da62(0x94)](_0x4ac0e3)),_0x3c22b2&&console[_0xf2da62(0xdf)](_0xf2da62(0xa5)+_0x3c22b2));const _0x3a4ae1=await withSpinner(_0xf2da62(0x117),()=>_0x3739f5[_0xf2da62(0x10f)]['run'](_0x12fbe2,_0x4ac0e3,{'sessionTime':_0x3c22b2}),{'verbose':_0x20b7cc['verbose']}),_0x46340c=_0x3a4ae1['data'];return console['error']('✔\x20Workflow\x20run\x20started'),console[_0xf2da62(0xdf)](_0xf2da62(0x8a)+_0x46340c['id']),console['error'](_0xf2da62(0x86)+_0x46340c[_0xf2da62(0x123)]),console[_0xf2da62(0xdf)]('\x20\x20Project:\x20'+_0x46340c[_0xf2da62(0xc4)]?.[_0xf2da62(0xb3)]),console['error'](_0xf2da62(0x108)+_0x46340c[_0xf2da62(0x10f)]?.[_0xf2da62(0xb3)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a44_0x16383b(0xde)]=a44_0x16383b(0xcf);async[a44_0x16383b(0x121)](_0x5525a7){const _0x2e9b9c=a44_0x16383b,{options:_0x7d48dc,args:_0x2cf29e,tdx:_0x401a5e}=_0x5525a7,_0x47dcf2=_0x2cf29e[0x0],_0x2129b3=_0x2cf29e[0x1]||'.';if(!_0x47dcf2)return console[_0x2e9b9c(0xdf)](_0x2e9b9c(0x98)),console[_0x2e9b9c(0xdf)](_0x2e9b9c(0xe4)),0x1;const _0x5dbd3a=_0x7d48dc['revision'];_0x7d48dc[_0x2e9b9c(0x10d)]&&(console[_0x2e9b9c(0xdf)](_0x2e9b9c(0xa4)+_0x47dcf2),console['error']('Output\x20directory:\x20'+_0x2129b3),_0x5dbd3a&&console['error'](_0x2e9b9c(0x11c)+_0x5dbd3a));const _0x22c702=await withSpinner('Downloading\x20project\x20'+_0x47dcf2+_0x2e9b9c(0x93),()=>_0x401a5e['workflow'][_0x2e9b9c(0x109)](_0x47dcf2,_0x2129b3,{'revision':_0x5dbd3a}),{'verbose':_0x7d48dc[_0x2e9b9c(0x10d)]}),_0x26d570=_0x22c702[_0x2e9b9c(0xb7)];return console['error'](_0x2e9b9c(0xc2)+_0x26d570[_0x2e9b9c(0xab)]),console[_0x2e9b9c(0xdf)](_0x2e9b9c(0x99)+_0x26d570['revision']),console[_0x2e9b9c(0xdf)]('\x20\x20Files\x20extracted:\x20'+_0x26d570[_0x2e9b9c(0xfd)]),console[_0x2e9b9c(0xdf)](_0x2e9b9c(0xf0)+_0x2129b3+'/'+_0x26d570[_0x2e9b9c(0xab)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a44_0x16383b(0xea);[a44_0x16383b(0xde)]=a44_0x16383b(0x9e);async[a44_0x16383b(0x121)](_0x667f53){const _0x4b5a8b=a44_0x16383b,{options:_0x1f876b,args:_0x45cac5,tdx:_0x593855}=_0x667f53;let _0x5ca53b='.',_0x5a8a5a=_0x1f876b[_0x4b5a8b(0xb3)];if(_0x45cac5[0x0]){const {promises:_0x1773f8}=await import('fs');try{const _0x2ea449=await _0x1773f8[_0x4b5a8b(0xae)](_0x45cac5[0x0]);if(_0x2ea449['isDirectory']())_0x5ca53b=_0x45cac5[0x0];else return console[_0x4b5a8b(0xdf)]('Error:\x20'+_0x45cac5[0x0]+_0x4b5a8b(0xa9)),0x1;}catch{_0x5a8a5a=_0x45cac5[0x0],_0x5ca53b='.';}}const _0x51bd47=_0x1f876b['revision'],_0x487e11=_0x1f876b[_0x4b5a8b(0xfa)];_0x1f876b['verbose']&&(console[_0x4b5a8b(0xdf)](_0x4b5a8b(0xdd)+_0x5ca53b),_0x5a8a5a&&console[_0x4b5a8b(0xdf)]('Project\x20name:\x20'+_0x5a8a5a),_0x51bd47&&console[_0x4b5a8b(0xdf)](_0x4b5a8b(0x11c)+_0x51bd47),_0x487e11&&console[_0x4b5a8b(0xdf)](_0x4b5a8b(0x10a)));const _0xfcbec=await withSpinner(_0x4b5a8b(0xbc),()=>_0x593855['workflow']['push'](_0x5ca53b,{'projectName':_0x5a8a5a,'revision':_0x51bd47,'skipValidation':_0x487e11}),{'verbose':_0x1f876b['verbose']}),_0x995a01=_0xfcbec[_0x4b5a8b(0xb7)];return console[_0x4b5a8b(0xdf)](_0x4b5a8b(0x102)+_0x995a01[_0x4b5a8b(0xab)]),console[_0x4b5a8b(0xdf)](_0x4b5a8b(0x9d)+_0x995a01[_0x4b5a8b(0xaa)]),console['error'](_0x4b5a8b(0x99)+_0x995a01[_0x4b5a8b(0xc0)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x16383b(0xb3)]=a44_0x16383b(0x9c);[a44_0x16383b(0xde)]=a44_0x16383b(0xcd);async[a44_0x16383b(0x121)](_0x38d1ef){const _0x4338cb=a44_0x16383b,{options:_0x254838,args:_0x592624,tdx:_0x5b2de8}=_0x38d1ef,_0x5cdc1c=_0x592624[0x0];if(!_0x5cdc1c)return console[_0x4338cb(0xdf)](_0x4338cb(0x97)),console[_0x4338cb(0xdf)](_0x4338cb(0x8b)),0x1;_0x254838[_0x4338cb(0x10d)]&&console['error'](_0x4338cb(0xa4)+_0x5cdc1c);if(!_0x254838[_0x4338cb(0xf8)]){const _0x2ffe1c=await confirm(_0x4338cb(0x9a)+_0x5cdc1c+_0x4338cb(0x8e));if(!_0x2ffe1c)return console['error']('Cancelled'),0x0;}const _0x43defc=await withSpinner(_0x4338cb(0xf3)+_0x5cdc1c+'...',()=>_0x5b2de8[_0x4338cb(0x10f)][_0x4338cb(0xc7)](_0x5cdc1c),{'verbose':_0x254838[_0x4338cb(0x10d)]}),_0x523887=_0x43defc[_0x4338cb(0xb7)];return console[_0x4338cb(0xdf)](_0x4338cb(0x119)+_0x523887[_0x4338cb(0xab)]),console['error'](_0x4338cb(0x9d)+_0x523887[_0x4338cb(0xaa)]),0x0;}}
|
|
1
|
+
const a44_0x2ab1ae=a44_0x3516;(function(_0x1fc2ec,_0x690f93){const _0x2624c0=a44_0x3516,_0x56788a=_0x1fc2ec();while(!![]){try{const _0x4162a4=-parseInt(_0x2624c0(0x174))/0x1*(parseInt(_0x2624c0(0x166))/0x2)+parseInt(_0x2624c0(0x13a))/0x3+-parseInt(_0x2624c0(0x18b))/0x4+parseInt(_0x2624c0(0x175))/0x5+parseInt(_0x2624c0(0x193))/0x6+parseInt(_0x2624c0(0x17d))/0x7+-parseInt(_0x2624c0(0x179))/0x8*(parseInt(_0x2624c0(0x15d))/0x9);if(_0x4162a4===_0x690f93)break;else _0x56788a['push'](_0x56788a['shift']());}catch(_0x14d475){_0x56788a['push'](_0x56788a['shift']());}}}(a44_0x4ac8,0x30878));import{BaseCommand}from'./command.js';function a44_0x3516(_0x1b7ca6,_0x118802){_0x1b7ca6=_0x1b7ca6-0x11c;const _0x4ac853=a44_0x4ac8();let _0x3516fd=_0x4ac853[_0x1b7ca6];return _0x3516fd;}function a44_0x4ac8(){const _0x24a2b4=['Including\x20subtasks:\x20yes','workflow:kill','No\x20log\x20content\x20found','Downloading\x20logs...','Listing\x20workflow\x20sessions...','Project\x20filter:\x20','projects','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','✔\x20Downloaded\x20','✔\x20Found\x20','Pattern:\x20','List\x20workflow\x20execution\x20sessions','filesExtracted','Downloading\x20project\x20','from','\x22?\x20This\x20cannot\x20be\x20undone.','Getting\x20attempt\x20details...','running','\x20\x20Attempt\x20ID:\x20','yes','\x20\x20Project:\x20','Parameters:\x20','execute','workflow:push','startsWith','Error:\x20Workflow\x20identifier\x20is\x20required','finishedAt','fromTask','Retrying\x20session...','workflow:tasks','data','retrySession','length','sessionId','467988AavrpG','workflow:run','format','workflow:download','session:','Error:\x20Invalid\x20parameter\x20format:\x20','Deleting\x20project\x20','parse','logs','status','Validation:\x20skipped','Usage:\x20workflow:delete\x20<project-name-or-id>','attempt','Cancelled','description','List\x20workflows','Reason:\x20','attempts','\x20\x20Cause:\x20','Filter:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','✔\x20Deleted\x20project\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','error','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','push','revision','...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20Revision:\x20','workflow:workflows','workflow','utf-8','fs/promises','Error:\x20Attempt\x20ID\x20is\x20required','791415DTVsiz','From\x20task:\x20','\x20\x20Location:\x20','success','Attempt\x20ID:\x20','\x20\x20New\x20attempt\x20ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:retry','659508QFrPKS','projectName','\x20attempt','Session\x20time:\x20','params','getTime','Error:\x20Project\x20name\x20is\x20required','name','sessionTime','Getting\x20attempt\x20tasks...','List\x20all\x20workflow\x20projects','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','isArray','\x20project','1SvVxvC','284435VKdbCM','Output\x20directory:\x20','includeRetried','Project:\x20','8gkPbkn','Include\x20retried:\x20yes','workflow:projects','taskName','2465960NWcJqz','\x20task','Starting\x20workflow\x20run...','Retrying\x20attempt...','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Filter:\x20project=','reason','workflow:attempt','resumeFrom','force','createdAt','projectId','includeSubtasks','project','955624apPWDH','session','Listing\x20workflows...','Error:\x20','Pushing\x20workflow\x20project...','\x20session','param','✔\x20Workflow\x20run\x20started','1741248iArzYA','limit','Expected\x20format:\x20--param\x20key=value','retryAttemptName','cause','\x20\x20Project\x20ID:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','skipValidation','round','workflow:logs','canceling','kill','done','\x20\x20Files\x20extracted:\x20','Project\x20name:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Force:\x20yes','Select\x20a\x20task\x20to\x20view\x20logs:','Revision:\x20','Retry\x20a\x20session\x20or\x20attempt','\x20\x20Session\x20ID:\x20','task','message','select','split','\x20is\x20not\x20a\x20directory','✔\x20Pushed\x20','index','keys','Killing\x20attempt...','workflow:sessions','Resume\x20from:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Fetching\x20log\x20files...','workflow:attempts','sessions','workflow:delete','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','readFile','Listing\x20workflow\x20attempts...','delete','verbose','List\x20workflow\x20attempts','Task\x20name:\x20','Show\x20tasks\x20for\x20an\x20attempt','tasks','Project\x20directory:\x20','substring','retryAttempt','attempt:','Show\x20specific\x20attempt\x20details'];a44_0x4ac8=function(){return _0x24a2b4;};return a44_0x4ac8();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a44_0xeea67 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a44_0x2ab1ae(0x16d)]=a44_0x2ab1ae(0x17b);['description']=a44_0x2ab1ae(0x170);async[a44_0x2ab1ae(0x12e)](_0x30f97c){const _0x310ff6=a44_0x2ab1ae,{options:_0x1d0be8,args:_0x3638df,tdx:_0x1b0d2a}=_0x30f97c,_0x562c24=_0x3638df[0x0];try{_0x1d0be8[_0x310ff6(0x1bc)]&&_0x562c24&&console['error'](_0x310ff6(0x122)+_0x562c24);const _0x490e8d=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x1b0d2a[_0x310ff6(0x159)][_0x310ff6(0x11e)](_0x562c24,{'limit':_0x1d0be8[_0x310ff6(0x194)]}),{'verbose':_0x1d0be8[_0x310ff6(0x1bc)]}),_0xa3a4e3=_0x490e8d['data'];return console[_0x310ff6(0x151)]('✔\x20Found\x20'+_0xa3a4e3[_0x310ff6(0x138)]+_0x310ff6(0x173)+(_0xa3a4e3[_0x310ff6(0x138)]!==0x1?'s':'')),await handleSDKOutput(_0xa3a4e3,_0x1d0be8),0x0;}catch(_0x259721){if(_0x259721 instanceof SDKError)return console['error']('Error:\x20'+_0x259721[_0x310ff6(0x1a9)]),_0x259721[_0x310ff6(0x197)]&&console[_0x310ff6(0x151)](_0x310ff6(0x14c)+_0x259721[_0x310ff6(0x197)]),0x1;throw _0x259721;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a44_0x2ab1ae(0x158);[a44_0x2ab1ae(0x148)]=a44_0x2ab1ae(0x149);async[a44_0x2ab1ae(0x12e)](_0x25468f){const _0x28b7cf=a44_0x2ab1ae,{options:_0x1b990c,args:_0x1daa6e,tdx:_0x423551}=_0x25468f,_0x30d7f6=_0x1daa6e[0x0];try{_0x1b990c['verbose']&&_0x30d7f6&&console[_0x28b7cf(0x151)](_0x28b7cf(0x11d)+_0x30d7f6);const _0x5b5138=await withSpinner(_0x28b7cf(0x18d),()=>_0x423551[_0x28b7cf(0x159)]['workflows'](_0x30d7f6,{'limit':_0x1b990c[_0x28b7cf(0x194)]}),{'verbose':_0x1b990c['verbose']}),_0x1e85e9=_0x5b5138['data'];return console[_0x28b7cf(0x151)](_0x28b7cf(0x121)+_0x1e85e9[_0x28b7cf(0x138)]+'\x20workflow'+(_0x1e85e9[_0x28b7cf(0x138)]!==0x1?'s':'')),await handleSDKOutput(_0x1e85e9,_0x1b990c),0x0;}catch(_0x5b42dd){if(_0x5b42dd instanceof SDKError)return console[_0x28b7cf(0x151)](_0x28b7cf(0x18e)+_0x5b42dd[_0x28b7cf(0x1a9)]),_0x5b42dd[_0x28b7cf(0x197)]&&console[_0x28b7cf(0x151)](_0x28b7cf(0x14c)+_0x5b42dd['cause']),0x1;throw _0x5b42dd;}}}export class WorkflowSessionsCommand extends BaseCommand{[a44_0x2ab1ae(0x16d)]=a44_0x2ab1ae(0x1b1);['description']=a44_0x2ab1ae(0x123);async['execute'](_0x484eb3){const _0x14a3a7=a44_0x2ab1ae,{options:_0x57b6de,args:_0x2b3195,tdx:_0x7fdc8a}=_0x484eb3;let _0x8806a3,_0x10ff5a;if(_0x2b3195[0x0]){const _0xe450e5=_0x2b3195[0x0][_0x14a3a7(0x1ab)]('.');if(_0xe450e5['length']===0x1)_0x8806a3=_0xe450e5[0x0];else{if(_0xe450e5[_0x14a3a7(0x138)]===0x2)[_0x8806a3,_0x10ff5a]=_0xe450e5;else return console[_0x14a3a7(0x151)](_0x14a3a7(0x1b3)),0x1;}}try{if(_0x57b6de[_0x14a3a7(0x1bc)]){if(_0x8806a3&&_0x10ff5a)console[_0x14a3a7(0x151)](_0x14a3a7(0x14d)+_0x8806a3+'.'+_0x10ff5a);else _0x8806a3&&console[_0x14a3a7(0x151)](_0x14a3a7(0x182)+_0x8806a3);const _0x46920e=_0x57b6de[_0x14a3a7(0x143)];_0x46920e&&console[_0x14a3a7(0x151)]('Status:\x20'+_0x46920e);}const _0x491444=await withSpinner(_0x14a3a7(0x11c),()=>_0x7fdc8a[_0x14a3a7(0x159)][_0x14a3a7(0x1b6)]({'projectName':_0x8806a3,'workflowName':_0x10ff5a,'status':_0x57b6de['status'],'fromTime':_0x57b6de[_0x14a3a7(0x126)],'toTime':_0x57b6de['to'],'limit':_0x57b6de['limit']}),{'verbose':_0x57b6de[_0x14a3a7(0x1bc)]}),_0x33e6da=_0x491444[_0x14a3a7(0x136)];return console[_0x14a3a7(0x151)](_0x14a3a7(0x121)+_0x33e6da[_0x14a3a7(0x138)]+_0x14a3a7(0x190)+(_0x33e6da[_0x14a3a7(0x138)]!==0x1?'s':'')),await handleSDKOutput(_0x33e6da,_0x57b6de),0x0;}catch(_0x4ae915){if(_0x4ae915 instanceof SDKError)return console[_0x14a3a7(0x151)]('Error:\x20'+_0x4ae915['message']),_0x4ae915['cause']&&console[_0x14a3a7(0x151)](_0x14a3a7(0x14c)+_0x4ae915['cause']),0x1;throw _0x4ae915;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a44_0x2ab1ae(0x16d)]=a44_0x2ab1ae(0x1b5);[a44_0x2ab1ae(0x148)]=a44_0x2ab1ae(0x1bd);async[a44_0x2ab1ae(0x12e)](_0x37c91a){const _0x195303=a44_0x2ab1ae,{options:_0x5704fd,args:_0x3abfe7,tdx:_0x24c051}=_0x37c91a;let _0x3ab56e,_0x36b276;if(_0x3abfe7[0x0]){const _0x50e9f7=_0x3abfe7[0x0][_0x195303(0x1ab)]('.');if(_0x50e9f7[_0x195303(0x138)]===0x1)_0x3ab56e=_0x50e9f7[0x0];else{if(_0x50e9f7[_0x195303(0x138)]===0x2)[_0x3ab56e,_0x36b276]=_0x50e9f7;else return console[_0x195303(0x151)](_0x195303(0x1b3)),0x1;}}try{const _0x236054=_0x5704fd[_0x195303(0x177)];if(_0x5704fd[_0x195303(0x1bc)]){if(_0x3ab56e&&_0x36b276)console[_0x195303(0x151)](_0x195303(0x14d)+_0x3ab56e+'.'+_0x36b276);else _0x3ab56e&&console[_0x195303(0x151)](_0x195303(0x182)+_0x3ab56e);_0x236054&&console[_0x195303(0x151)](_0x195303(0x17a));}const _0x42131a=await withSpinner(_0x195303(0x1ba),()=>_0x24c051[_0x195303(0x159)][_0x195303(0x14b)]({'projectName':_0x3ab56e,'workflowName':_0x36b276,'includeRetried':_0x236054,'limit':_0x5704fd[_0x195303(0x194)]}),{'verbose':_0x5704fd[_0x195303(0x1bc)]}),_0x3dd4db=_0x42131a[_0x195303(0x136)];return console[_0x195303(0x151)](_0x195303(0x121)+_0x3dd4db[_0x195303(0x138)]+_0x195303(0x168)+(_0x3dd4db[_0x195303(0x138)]!==0x1?'s':'')),await handleSDKOutput(_0x3dd4db,_0x5704fd),0x0;}catch(_0x3a17d5){if(_0x3a17d5 instanceof SDKError)return console[_0x195303(0x151)](_0x195303(0x18e)+_0x3a17d5[_0x195303(0x1a9)]),_0x3a17d5['cause']&&console[_0x195303(0x151)](_0x195303(0x14c)+_0x3a17d5[_0x195303(0x197)]),0x1;throw _0x3a17d5;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a44_0x2ab1ae(0x184);[a44_0x2ab1ae(0x148)]=a44_0x2ab1ae(0x1c5);async['execute'](_0xc6bb9f){const _0x8e0426=a44_0x2ab1ae,{options:_0x1e67a9,args:_0x272994,tdx:_0x4a0245}=_0xc6bb9f,_0x5b3456=_0x272994[0x0];if(!_0x5b3456)return console['error'](_0x8e0426(0x15c)),0x1;try{_0x1e67a9[_0x8e0426(0x1bc)]&&console[_0x8e0426(0x151)](_0x8e0426(0x161)+_0x5b3456);const _0x129e16=await withSpinner(_0x8e0426(0x128),()=>_0x4a0245[_0x8e0426(0x159)][_0x8e0426(0x146)](_0x5b3456),{'verbose':_0x1e67a9[_0x8e0426(0x1bc)]}),_0x237c22=_0x129e16['data'];let _0x1a7369;!_0x237c22[_0x8e0426(0x19f)]?_0x1a7369=_0x237c22['cancelRequested']?_0x8e0426(0x19d):_0x8e0426(0x129):_0x1a7369=_0x237c22[_0x8e0426(0x160)]?'success':_0x8e0426(0x151);let _0x89b54c;if(_0x237c22[_0x8e0426(0x187)]&&_0x237c22[_0x8e0426(0x132)]){const _0x4306ad=new Date(_0x237c22[_0x8e0426(0x187)])[_0x8e0426(0x16b)](),_0x12f78f=new Date(_0x237c22['finishedAt'])[_0x8e0426(0x16b)]();_0x89b54c=Math[_0x8e0426(0x19b)]((_0x12f78f-_0x4306ad)/0x3e8);}const _0x5270b6={'attempt_id':_0x237c22['id'],'status':_0x1a7369,..._0x237c22[_0x8e0426(0x1ae)]!==undefined&&{'index':_0x237c22[_0x8e0426(0x1ae)]},..._0x237c22[_0x8e0426(0x18a)]&&{'project':_0x237c22[_0x8e0426(0x18a)][_0x8e0426(0x16d)]},..._0x237c22[_0x8e0426(0x159)]&&{'workflow':_0x237c22[_0x8e0426(0x159)][_0x8e0426(0x16d)]},..._0x237c22[_0x8e0426(0x139)]&&{'session_id':_0x237c22[_0x8e0426(0x139)]},..._0x237c22[_0x8e0426(0x16e)]&&{'session_time':_0x237c22['sessionTime']},..._0x237c22[_0x8e0426(0x196)]&&{'retry_attempt':_0x237c22[_0x8e0426(0x196)]},..._0x89b54c!==undefined&&{'duration_sec':_0x89b54c},..._0x237c22['createdAt']&&{'created_at':_0x237c22[_0x8e0426(0x187)]},..._0x237c22[_0x8e0426(0x132)]&&{'finished_at':_0x237c22['finishedAt']},...Object[_0x8e0426(0x1af)](_0x237c22[_0x8e0426(0x16a)])[_0x8e0426(0x138)]>0x0&&{'params':_0x237c22[_0x8e0426(0x16a)]}};return await handleSingleObjectOutput(_0x5270b6,_0x1e67a9),0x0;}catch(_0x3da21d){if(_0x3da21d instanceof SDKError)return console[_0x8e0426(0x151)]('Error:\x20'+_0x3da21d[_0x8e0426(0x1a9)]),_0x3da21d[_0x8e0426(0x197)]&&console['error'](_0x8e0426(0x14c)+_0x3da21d[_0x8e0426(0x197)]),0x1;throw _0x3da21d;}}}export class WorkflowTasksCommand extends BaseCommand{[a44_0x2ab1ae(0x16d)]=a44_0x2ab1ae(0x135);[a44_0x2ab1ae(0x148)]=a44_0x2ab1ae(0x1bf);async[a44_0x2ab1ae(0x12e)](_0x3dec6d){const _0x540137=a44_0x2ab1ae,{options:_0x12b8c7,args:_0x4e5223,tdx:_0x38e412}=_0x3dec6d,_0x5a0d41=_0x4e5223[0x0];if(!_0x5a0d41)return console['error'](_0x540137(0x15c)),0x1;try{const _0x4f3c32=_0x12b8c7[_0x540137(0x189)];_0x12b8c7[_0x540137(0x1bc)]&&(console[_0x540137(0x151)](_0x540137(0x161)+_0x5a0d41),_0x4f3c32&&console[_0x540137(0x151)](_0x540137(0x1c6)));const _0x1473ba=await withSpinner(_0x540137(0x16f),()=>_0x38e412[_0x540137(0x159)][_0x540137(0x1c0)](_0x5a0d41,_0x4f3c32||![]),{'verbose':_0x12b8c7['verbose']}),_0x5b14c3=_0x1473ba[_0x540137(0x136)];return console[_0x540137(0x151)](_0x540137(0x121)+_0x5b14c3['length']+_0x540137(0x17e)+(_0x5b14c3['length']!==0x1?'s':'')),await handleSDKOutput(_0x5b14c3,_0x12b8c7),0x0;}catch(_0x4738b8){if(_0x4738b8 instanceof SDKError)return console[_0x540137(0x151)](_0x540137(0x18e)+_0x4738b8['message']),_0x4738b8[_0x540137(0x197)]&&console['error'](_0x540137(0x14c)+_0x4738b8[_0x540137(0x197)]),0x1;throw _0x4738b8;}}}export class WorkflowLogsCommand extends BaseCommand{['name']=a44_0x2ab1ae(0x19c);['description']=a44_0x2ab1ae(0x199);async[a44_0x2ab1ae(0x12e)](_0x4b653f){const _0x4ecce8=a44_0x2ab1ae,{options:_0x16c200,args:_0x460246,tdx:_0x3aade7}=_0x4b653f,_0x150c39=_0x460246[0x0];let _0x414784=_0x460246[0x1];if(!_0x150c39)return console[_0x4ecce8(0x151)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{_0x16c200[_0x4ecce8(0x1bc)]&&(console['error'](_0x4ecce8(0x161)+_0x150c39),_0x414784&&console[_0x4ecce8(0x151)](_0x4ecce8(0x1be)+_0x414784));const _0x3bd020=await withSpinner(_0x4ecce8(0x1b4),()=>_0x3aade7[_0x4ecce8(0x159)]['logFiles'](_0x150c39,_0x414784),{'verbose':_0x16c200['verbose']}),_0x81c0b6=_0x3bd020['data'];if(_0x81c0b6['length']===0x0)return console['error'](_0x4ecce8(0x1a2)),0x0;if(!_0x414784&&(_0x16c200['json']||_0x16c200[_0x4ecce8(0x13c)]))return await handleSDKOutput(_0x81c0b6,_0x16c200),0x0;if(!_0x414784){const _0x57f6fd=_0x81c0b6['map'](_0x3fadae=>({'title':_0x3fadae['taskName']+'\x20('+formatBytes(_0x3fadae['fileSize'])+')','value':_0x3fadae[_0x4ecce8(0x17c)]})),_0x34d446=await a44_0xeea67({'type':_0x4ecce8(0x1aa),'name':'task','message':_0x4ecce8(0x1a4),'choices':_0x57f6fd});if(!_0x34d446[_0x4ecce8(0x1a8)])return console[_0x4ecce8(0x151)](_0x4ecce8(0x147)),0x0;_0x414784=_0x34d446['task'];}const _0x4417fe=await withSpinner(_0x4ecce8(0x1c9),()=>_0x3aade7[_0x4ecce8(0x159)][_0x4ecce8(0x142)](_0x150c39,_0x414784),{'verbose':_0x16c200['verbose']}),_0x5026cb=_0x4417fe[_0x4ecce8(0x136)];return _0x5026cb?console['log'](_0x5026cb):console['error'](_0x4ecce8(0x1c8)),0x0;}catch(_0x189dbd){if(_0x189dbd instanceof SDKError)return console['error']('Error:\x20'+_0x189dbd[_0x4ecce8(0x1a9)]),_0x189dbd[_0x4ecce8(0x197)]&&console[_0x4ecce8(0x151)](_0x4ecce8(0x14c)+_0x189dbd[_0x4ecce8(0x197)]),0x1;throw _0x189dbd;}}}export class WorkflowKillCommand extends BaseCommand{[a44_0x2ab1ae(0x16d)]=a44_0x2ab1ae(0x1c7);[a44_0x2ab1ae(0x148)]='Kill\x20a\x20running\x20attempt';async[a44_0x2ab1ae(0x12e)](_0x39e9be){const _0x19f669=a44_0x2ab1ae,{options:_0x4844b9,args:_0x5891db,tdx:_0x59de16}=_0x39e9be,_0x56c1f3=_0x5891db[0x0];if(!_0x56c1f3)return console[_0x19f669(0x151)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x671e2d=_0x4844b9[_0x19f669(0x183)];_0x4844b9[_0x19f669(0x1bc)]&&(console[_0x19f669(0x151)](_0x19f669(0x161)+_0x56c1f3),_0x671e2d&&console[_0x19f669(0x151)](_0x19f669(0x14a)+_0x671e2d));if(!_0x4844b9[_0x19f669(0x12b)]){const _0x422d68=await confirm(_0x19f669(0x163)+_0x56c1f3+'?');if(!_0x422d68)return console[_0x19f669(0x151)](_0x19f669(0x147)),0x0;}const _0x3564c6=await withSpinner(_0x19f669(0x1b0),()=>_0x59de16[_0x19f669(0x159)][_0x19f669(0x19e)](_0x56c1f3,_0x671e2d),{'verbose':_0x4844b9[_0x19f669(0x1bc)]}),_0x22eb25=_0x3564c6[_0x19f669(0x136)];return console[_0x19f669(0x151)]('✔\x20'+_0x22eb25),0x0;}catch(_0x39ffc2){if(_0x39ffc2 instanceof SDKError)return console[_0x19f669(0x151)](_0x19f669(0x18e)+_0x39ffc2[_0x19f669(0x1a9)]),_0x39ffc2[_0x19f669(0x197)]&&console['error'](_0x19f669(0x14c)+_0x39ffc2[_0x19f669(0x197)]),0x1;throw _0x39ffc2;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a44_0x2ab1ae(0x165);['description']=a44_0x2ab1ae(0x1a6);async[a44_0x2ab1ae(0x12e)](_0x3bb769){const _0x46c804=a44_0x2ab1ae,{options:_0x194f65,args:_0x1d05ef,tdx:_0x316aaa}=_0x3bb769,_0x31d4df=_0x1d05ef[0x0];if(!_0x31d4df)return console['error'](_0x46c804(0x14e)),console[_0x46c804(0x151)](_0x46c804(0x164)),0x1;let _0x3a766f=![],_0x39a2d6=_0x31d4df;if(_0x31d4df[_0x46c804(0x130)](_0x46c804(0x13e)))_0x3a766f=!![],_0x39a2d6=_0x31d4df[_0x46c804(0x1c2)](0x8);else{if(_0x31d4df[_0x46c804(0x130)](_0x46c804(0x1c4)))_0x3a766f=![],_0x39a2d6=_0x31d4df[_0x46c804(0x1c2)](0x8);else return console[_0x46c804(0x151)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x46c804(0x151)](_0x46c804(0x164)),0x1;}try{const _0x52e10c=_0x194f65[_0x46c804(0x133)],_0x5affdb=_0x194f65[_0x46c804(0x185)],_0xeeb183=_0x194f65[_0x46c804(0x16a)],_0x2316dc=_0x194f65[_0x46c804(0x186)];_0x194f65[_0x46c804(0x1bc)]&&(console[_0x46c804(0x151)]('Target:\x20'+(_0x3a766f?_0x46c804(0x18c):_0x46c804(0x146))+'\x20'+_0x39a2d6),_0x52e10c&&console[_0x46c804(0x151)](_0x46c804(0x15e)+_0x52e10c),_0x5affdb&&console[_0x46c804(0x151)](_0x46c804(0x1b2)+_0x5affdb),_0xeeb183&&console[_0x46c804(0x151)]('Params:\x20'+_0xeeb183),_0x2316dc&&console[_0x46c804(0x151)](_0x46c804(0x1a3)));let _0xc48a8b;if(_0xeeb183)try{if(_0xeeb183['startsWith']('@')){const _0x40048e=await import(_0x46c804(0x15b)),_0x5a9a8d=_0xeeb183[_0x46c804(0x1c2)](0x1),_0x1a70dd=await _0x40048e[_0x46c804(0x1b9)](_0x5a9a8d,_0x46c804(0x15a));_0xc48a8b=JSON[_0x46c804(0x141)](_0x1a70dd);}else _0xc48a8b=JSON['parse'](_0xeeb183);}catch{return console[_0x46c804(0x151)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x194f65['yes']){const _0x12a0ad=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x3a766f?_0x46c804(0x18c):'attempt')+'\x20'+_0x39a2d6+'?');if(!_0x12a0ad)return console[_0x46c804(0x151)](_0x46c804(0x147)),0x0;}let _0x4fb2a4;_0x3a766f?_0x4fb2a4=await withSpinner(_0x46c804(0x134),()=>_0x316aaa[_0x46c804(0x159)][_0x46c804(0x137)](_0x39a2d6,{'fromTask':_0x52e10c,'retryParams':_0xc48a8b}),{'verbose':_0x194f65[_0x46c804(0x1bc)]}):_0x4fb2a4=await withSpinner(_0x46c804(0x180),()=>_0x316aaa[_0x46c804(0x159)][_0x46c804(0x1c3)](_0x39a2d6,{'resumeFrom':_0x5affdb,'retryParams':_0xc48a8b,'force':_0x2316dc}),{'verbose':_0x194f65[_0x46c804(0x1bc)]});const _0xbc70c3=_0x4fb2a4['data'];return console[_0x46c804(0x151)]('✔\x20Retry\x20started'),console[_0x46c804(0x151)](_0x46c804(0x162)+_0xbc70c3['attemptId']),console[_0x46c804(0x151)](_0x46c804(0x1a7)+_0xbc70c3[_0x46c804(0x139)]),0x0;}catch(_0x4ea67d){if(_0x4ea67d instanceof SDKError)return console[_0x46c804(0x151)](_0x46c804(0x18e)+_0x4ea67d[_0x46c804(0x1a9)]),_0x4ea67d['cause']&&console[_0x46c804(0x151)]('\x20\x20Cause:\x20'+_0x4ea67d['cause']),0x1;throw _0x4ea67d;}}}export class WorkflowRunCommand extends BaseCommand{[a44_0x2ab1ae(0x16d)]=a44_0x2ab1ae(0x13b);[a44_0x2ab1ae(0x148)]='Start\x20a\x20workflow\x20run';async['execute'](_0x346990){const _0x508c4f=a44_0x2ab1ae,{options:_0x37a518,args:_0x11d33a,tdx:_0x31255b}=_0x346990,_0x1bf92a=_0x11d33a[0x0];if(!_0x1bf92a)return console[_0x508c4f(0x151)](_0x508c4f(0x131)),console['error'](_0x508c4f(0x152)),0x1;const _0x557e0e=_0x37a518[_0x508c4f(0x191)],_0xa0af02=_0x37a518[_0x508c4f(0x16e)],_0x5ad862={};if(_0x557e0e&&Array[_0x508c4f(0x172)](_0x557e0e))for(const _0x14d6a8 of _0x557e0e){const _0x2e08b8=_0x14d6a8['indexOf']('=');if(_0x2e08b8===-0x1)return console['error'](_0x508c4f(0x13f)+_0x14d6a8),console[_0x508c4f(0x151)](_0x508c4f(0x195)),0x1;const _0x598da0=_0x14d6a8[_0x508c4f(0x1c2)](0x0,_0x2e08b8),_0x143708=_0x14d6a8['substring'](_0x2e08b8+0x1);try{_0x5ad862[_0x598da0]=JSON[_0x508c4f(0x141)](_0x143708);}catch{_0x5ad862[_0x598da0]=_0x143708;}}_0x37a518[_0x508c4f(0x1bc)]&&(console['error']('Workflow:\x20'+_0x1bf92a),Object[_0x508c4f(0x1af)](_0x5ad862)[_0x508c4f(0x138)]>0x0&&console[_0x508c4f(0x151)](_0x508c4f(0x12d)+JSON['stringify'](_0x5ad862)),_0xa0af02&&console[_0x508c4f(0x151)](_0x508c4f(0x169)+_0xa0af02));const _0x4d80bf=await withSpinner(_0x508c4f(0x17f),()=>_0x31255b[_0x508c4f(0x159)]['run'](_0x1bf92a,_0x5ad862,{'sessionTime':_0xa0af02}),{'verbose':_0x37a518['verbose']}),_0x561e92=_0x4d80bf['data'];return console['error'](_0x508c4f(0x192)),console[_0x508c4f(0x151)](_0x508c4f(0x12a)+_0x561e92['id']),console[_0x508c4f(0x151)](_0x508c4f(0x1a7)+_0x561e92[_0x508c4f(0x139)]),console[_0x508c4f(0x151)](_0x508c4f(0x12c)+_0x561e92[_0x508c4f(0x18a)]?.['name']),console[_0x508c4f(0x151)]('\x20\x20Workflow:\x20'+_0x561e92[_0x508c4f(0x159)]?.[_0x508c4f(0x16d)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a44_0x2ab1ae(0x16d)]=a44_0x2ab1ae(0x13d);['description']=a44_0x2ab1ae(0x1b8);async['execute'](_0x509cf0){const _0x5d3bcb=a44_0x2ab1ae,{options:_0x4ffad1,args:_0x448938,tdx:_0x2c9d97}=_0x509cf0,_0x1078e3=_0x448938[0x0],_0x37a246=_0x448938[0x1]||'.';if(!_0x1078e3)return console['error'](_0x5d3bcb(0x16c)),console[_0x5d3bcb(0x151)](_0x5d3bcb(0x11f)),0x1;const _0x11c3dd=_0x4ffad1[_0x5d3bcb(0x154)];_0x4ffad1['verbose']&&(console['error'](_0x5d3bcb(0x178)+_0x1078e3),console[_0x5d3bcb(0x151)](_0x5d3bcb(0x176)+_0x37a246),_0x11c3dd&&console[_0x5d3bcb(0x151)](_0x5d3bcb(0x1a5)+_0x11c3dd));const _0x3ded45=await withSpinner(_0x5d3bcb(0x125)+_0x1078e3+_0x5d3bcb(0x155),()=>_0x2c9d97[_0x5d3bcb(0x159)]['download'](_0x1078e3,_0x37a246,{'revision':_0x11c3dd}),{'verbose':_0x4ffad1[_0x5d3bcb(0x1bc)]}),_0x4d2afd=_0x3ded45[_0x5d3bcb(0x136)];return console[_0x5d3bcb(0x151)](_0x5d3bcb(0x120)+_0x4d2afd[_0x5d3bcb(0x167)]),console['error'](_0x5d3bcb(0x157)+_0x4d2afd[_0x5d3bcb(0x154)]),console[_0x5d3bcb(0x151)](_0x5d3bcb(0x1a0)+_0x4d2afd[_0x5d3bcb(0x124)]),console[_0x5d3bcb(0x151)](_0x5d3bcb(0x15f)+_0x37a246+'/'+_0x4d2afd[_0x5d3bcb(0x167)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a44_0x2ab1ae(0x12f);[a44_0x2ab1ae(0x148)]=a44_0x2ab1ae(0x181);async[a44_0x2ab1ae(0x12e)](_0x42475c){const _0x1346a4=a44_0x2ab1ae,{options:_0x5c442c,args:_0x194676,tdx:_0x7e397e}=_0x42475c;let _0x1d5a0d='.',_0x316e6e=_0x5c442c[_0x1346a4(0x16d)];if(_0x194676[0x0]){const {promises:_0x13b6cd}=await import('fs');try{const _0x263067=await _0x13b6cd['stat'](_0x194676[0x0]);if(_0x263067['isDirectory']())_0x1d5a0d=_0x194676[0x0];else return console[_0x1346a4(0x151)]('Error:\x20'+_0x194676[0x0]+_0x1346a4(0x1ac)),0x1;}catch{_0x316e6e=_0x194676[0x0],_0x1d5a0d='.';}}const _0x11dbf6=_0x5c442c[_0x1346a4(0x154)],_0x236e8d=_0x5c442c[_0x1346a4(0x19a)];_0x5c442c[_0x1346a4(0x1bc)]&&(console[_0x1346a4(0x151)](_0x1346a4(0x1c1)+_0x1d5a0d),_0x316e6e&&console['error'](_0x1346a4(0x1a1)+_0x316e6e),_0x11dbf6&&console['error'](_0x1346a4(0x1a5)+_0x11dbf6),_0x236e8d&&console[_0x1346a4(0x151)](_0x1346a4(0x144)));const _0x390bfd=await withSpinner(_0x1346a4(0x18f),()=>_0x7e397e[_0x1346a4(0x159)][_0x1346a4(0x153)](_0x1d5a0d,{'projectName':_0x316e6e,'revision':_0x11dbf6,'skipValidation':_0x236e8d}),{'verbose':_0x5c442c[_0x1346a4(0x1bc)]}),_0x4669fb=_0x390bfd['data'];return console[_0x1346a4(0x151)](_0x1346a4(0x1ad)+_0x4669fb[_0x1346a4(0x167)]),console['error'](_0x1346a4(0x198)+_0x4669fb[_0x1346a4(0x188)]),console[_0x1346a4(0x151)]('\x20\x20Revision:\x20'+_0x4669fb[_0x1346a4(0x154)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a44_0x2ab1ae(0x16d)]=a44_0x2ab1ae(0x1b7);[a44_0x2ab1ae(0x148)]=a44_0x2ab1ae(0x150);async[a44_0x2ab1ae(0x12e)](_0x5dc34a){const _0x2e487d=a44_0x2ab1ae,{options:_0x48f66d,args:_0x15edaf,tdx:_0x5764fd}=_0x5dc34a,_0x321922=_0x15edaf[0x0];if(!_0x321922)return console[_0x2e487d(0x151)](_0x2e487d(0x171)),console[_0x2e487d(0x151)](_0x2e487d(0x145)),0x1;_0x48f66d[_0x2e487d(0x1bc)]&&console[_0x2e487d(0x151)]('Project:\x20'+_0x321922);if(!_0x48f66d['yes']){const _0x7021b6=await confirm(_0x2e487d(0x156)+_0x321922+_0x2e487d(0x127));if(!_0x7021b6)return console[_0x2e487d(0x151)](_0x2e487d(0x147)),0x0;}const _0x79b57e=await withSpinner(_0x2e487d(0x140)+_0x321922+_0x2e487d(0x155),()=>_0x5764fd[_0x2e487d(0x159)][_0x2e487d(0x1bb)](_0x321922),{'verbose':_0x48f66d[_0x2e487d(0x1bc)]}),_0x41ce5c=_0x79b57e[_0x2e487d(0x136)];return console[_0x2e487d(0x151)](_0x2e487d(0x14f)+_0x41ce5c[_0x2e487d(0x167)]),console[_0x2e487d(0x151)](_0x2e487d(0x198)+_0x41ce5c[_0x2e487d(0x188)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a839f,_0x38e3ef){const _0x239d7b=a45_0x27de,_0x292497=_0x2a839f();while(!![]){try{const _0x338bb4=-parseInt(_0x239d7b(0xc6))/0x1+-parseInt(_0x239d7b(0xc0))/0x2*(-parseInt(_0x239d7b(0xc1))/0x3)+parseInt(_0x239d7b(0xb7))/0x4+-parseInt(_0x239d7b(0xc7))/0x5*(parseInt(_0x239d7b(0xb8))/0x6)+-parseInt(_0x239d7b(0xc2))/0x7+-parseInt(_0x239d7b(0xc3))/0x8*(parseInt(_0x239d7b(0xbb))/0x9)+parseInt(_0x239d7b(0xb5))/0xa*(parseInt(_0x239d7b(0xbc))/0xb);if(_0x338bb4===_0x38e3ef)break;else _0x292497['push'](_0x292497['shift']());}catch(_0x102c23){_0x292497['push'](_0x292497['shift']());}}}(a45_0x17b2,0x6620f));function a45_0x17b2(){const _0x4929b4=['entries','832204dqEJKC','24WLIZew','replace','version','5918949xSsRAD','352mQqlFL','0.0.0','parse','Authorization','6neoUtV','836409mLDRJC','3287788PRODaT','8DEVTWN','utf-8','../../package.json','521200dHZBST','903635dTSHAg','tdx','545410MqCJHs'];a45_0x17b2=function(){return _0x4929b4;};return a45_0x17b2();}import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x3b0326=a45_0x27de;try{const _0x1faff4=fileURLToPath(import.meta.url),_0x589ac8=dirname(_0x1faff4),_0x3a7b64=join(_0x589ac8,_0x3b0326(0xc5)),_0x517b6f=JSON[_0x3b0326(0xbe)](readFileSync(_0x3a7b64,_0x3b0326(0xc4)));return _0x517b6f['version'];}catch{return _0x3b0326(0xbd);}}export function getUserAgent(){const _0x206b92=a45_0x27de,_0x406ae0=getVersion(),_0xf9ccc7=platform(),_0x3e3f68=process[_0x206b92(0xba)][_0x206b92(0xb9)]('v','');return'tdx/'+_0x406ae0+'\x20('+_0xf9ccc7+';\x20node/'+_0x3e3f68+')';}export function getAuthHeaders(_0x70552b,_0x21eb73){const _0x136f53=a45_0x27de,_0x16ae2c=getVersion(),_0x4e3309={'User-Agent':getUserAgent(),'X-TD-Client':_0x136f53(0xc8),'X-TD-Client-Version':_0x16ae2c};return _0x21eb73&&(_0x4e3309['Authorization']='TD1\x20'+_0x21eb73),_0x4e3309;}export function toHeaderRecord(_0x283069){const _0x3170f0=a45_0x27de,_0x4cbea4={};for(const [_0x113038,_0x384c77]of Object[_0x3170f0(0xb6)](_0x283069)){_0x384c77!==undefined&&(_0x4cbea4[_0x113038]=_0x384c77);}return _0x4cbea4;}export function getTrinoHeaders(_0x16b55d,_0x28df50){const _0x12d46a=a45_0x27de,_0x587279=getAuthHeaders(_0x16b55d,_0x28df50),_0xc4e70=toHeaderRecord(_0x587279);return delete _0xc4e70[_0x12d46a(0xbf)],_0x28df50&&(_0xc4e70['X-Trino-User']=_0x28df50),_0xc4e70;}function a45_0x27de(_0x330506,_0x5b933a){_0x330506=_0x330506-0xb5;const _0x17b2d6=a45_0x17b2();let _0x27def5=_0x17b2d6[_0x330506];return _0x27def5;}export function hasAPIKey(_0x41219c){const _0x1fb709=getAPIKey(_0x41219c);return _0x1fb709!==undefined&&_0x1fb709['length']>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xd44700,_0x1e2b76){const _0x3d2517=a46_0x455e,_0x3a192e=_0xd44700();while(!![]){try{const _0x10d5f4=-parseInt(_0x3d2517(0x1d6))/0x1*(parseInt(_0x3d2517(0x1eb))/0x2)+-parseInt(_0x3d2517(0x1ee))/0x3+parseInt(_0x3d2517(0x1f1))/0x4*(-parseInt(_0x3d2517(0x1d4))/0x5)+-parseInt(_0x3d2517(0x1cb))/0x6+-parseInt(_0x3d2517(0x1df))/0x7+-parseInt(_0x3d2517(0x1c8))/0x8*(parseInt(_0x3d2517(0x1cf))/0x9)+-parseInt(_0x3d2517(0x1d9))/0xa*(-parseInt(_0x3d2517(0x1d0))/0xb);if(_0x10d5f4===_0x1e2b76)break;else _0x3a192e['push'](_0x3a192e['shift']());}catch(_0x50b168){_0x3a192e['push'](_0x3a192e['shift']());}}}(a46_0x150e,0x6c3cd));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x4b4054 from'node:fs';import*as a46_0x3ba6ea 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_0xdb86fc from'chalk';export function getConfigDir(){const _0x505a27=a46_0x455e;return process[_0x505a27(0x1ab)]['TDX_CONFIG_DIR']||join(homedir(),_0x505a27(0x1bd),_0x505a27(0x1b4));}export function getConfigFile(){const _0x26d68a=a46_0x455e;return join(getConfigDir(),_0x26d68a(0x1c4));}export function getConfigFilePath(_0x529418){const _0x210fba=a46_0x455e,_0x56123e=getConfigDir();return _0x529418?a46_0x3ba6ea['join'](_0x56123e,_0x210fba(0x1d8)+_0x529418):getConfigFile();}export function getCacheDir(){const _0x333100=a46_0x455e;return process[_0x333100(0x1ab)]['TDX_CACHE_DIR']||join(homedir(),_0x333100(0x1e3),'tdx');}export function getLLMProjectCacheFile(_0x51dd82){const _0x2cf61c=a46_0x455e,_0xee818e=_0x51dd82?'llm_default_project.'+_0x51dd82:_0x2cf61c(0x1ea);return join(getCacheDir(),_0xee818e);}export function readCachedLLMProject(_0x3430d5){const _0x11acf7=a46_0x455e;try{const _0x4c2c16=getLLMProjectCacheFile(_0x3430d5);if(!existsSync(_0x4c2c16))return null;const _0x22e017=readFileSync(_0x4c2c16,_0x11acf7(0x1cd))['trim']();try{const _0x3ff4f4=JSON[_0x11acf7(0x1e6)](_0x22e017);if(_0x3ff4f4&&typeof _0x3ff4f4['id']===_0x11acf7(0x1ed)&&typeof _0x3ff4f4[_0x11acf7(0x1ac)]===_0x11acf7(0x1ed))return _0x3ff4f4;}catch{}return null;}catch{return null;}}function a46_0x455e(_0x41d9c0,_0x1752e3){_0x41d9c0=_0x41d9c0-0x1aa;const _0x150efc=a46_0x150e();let _0x455e00=_0x150efc[_0x41d9c0];return _0x455e00;}export function writeCachedLLMProject(_0x4f54b9,_0x4e5e83,_0xe79617){const _0x2a1ffc=a46_0x455e;try{const _0x2adede=getCacheDir(),_0x462c57=getLLMProjectCacheFile(_0xe79617);!existsSync(_0x2adede)&&mkdirSync(_0x2adede,{'recursive':!![]});const _0x23826d={'name':_0x4f54b9,'id':_0x4e5e83};writeFileSync(_0x462c57,JSON[_0x2a1ffc(0x1ae)](_0x23826d),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x1a76e1){const _0x8130b=_0x1a76e1?'llm_default_agent.'+_0x1a76e1:'llm_default_agent';return join(getCacheDir(),_0x8130b);}export function readCachedLLMAgent(_0x242903){const _0x300ed7=a46_0x455e;try{const _0x321a67=getLLMAgentCacheFile(_0x242903);if(!existsSync(_0x321a67))return null;const _0x3edbf6=readFileSync(_0x321a67,_0x300ed7(0x1cd))[_0x300ed7(0x1d5)]();try{const _0xb68f32=JSON[_0x300ed7(0x1e6)](_0x3edbf6);if(_0xb68f32&&typeof _0xb68f32['id']===_0x300ed7(0x1ed)&&typeof _0xb68f32[_0x300ed7(0x1ac)]==='string'&&typeof _0xb68f32['projectId']===_0x300ed7(0x1ed))return _0xb68f32;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x2f233c,_0x44cebd,_0x315910,_0x11d0a6){try{const _0x15a6fe=getCacheDir(),_0x5f578c=getLLMAgentCacheFile(_0x11d0a6);!existsSync(_0x15a6fe)&&mkdirSync(_0x15a6fe,{'recursive':!![]});const _0xa7b6c6={'name':_0x2f233c,'id':_0x44cebd,'projectId':_0x315910};writeFileSync(_0x5f578c,JSON['stringify'](_0xa7b6c6),'utf-8');}catch{}}export function clearCachedLLMAgent(_0x1bef79){try{const _0x32e0ff=getLLMAgentCacheFile(_0x1bef79);existsSync(_0x32e0ff)&&unlinkSync(_0x32e0ff);}catch{}}export function getAccountInfoCacheFile(_0x18fadf){const _0x5ec345=a46_0x455e,_0x5d1691=_0x18fadf?_0x5ec345(0x1c5)+_0x18fadf+_0x5ec345(0x1e4):_0x5ec345(0x1c6);return join(getCacheDir(),_0x5d1691);}export function readCachedAccountInfo(_0x3291dd){const _0x4d2347=a46_0x455e;try{const _0x1d3ed6=getAccountInfoCacheFile(_0x3291dd);if(!existsSync(_0x1d3ed6))return null;const _0x5822ce=readFileSync(_0x1d3ed6,_0x4d2347(0x1cd))[_0x4d2347(0x1d5)](),_0x55db5e=JSON[_0x4d2347(0x1e6)](_0x5822ce);if(_0x55db5e&&typeof _0x55db5e['site']==='string'&&typeof _0x55db5e[_0x4d2347(0x1b7)]===_0x4d2347(0x1db))return _0x55db5e;return null;}catch{return null;}}export function writeCachedAccountInfo(_0xb60133,_0xbb3055,_0x190043){const _0x19f002=a46_0x455e;try{const _0x19aef5=getCacheDir(),_0x483244=getAccountInfoCacheFile(_0x190043);!existsSync(_0x19aef5)&&mkdirSync(_0x19aef5,{'recursive':!![]});const _0x5f13c8={'site':_0xb60133,'accountId':_0xbb3055,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x483244,JSON['stringify'](_0x5f13c8),_0x19f002(0x1cd));}catch{}}export function parseEnvFile(_0x24a612){const _0x4edd9e=a46_0x455e,_0x1395c5={};for(const _0x531bf0 of _0x24a612[_0x4edd9e(0x1bc)]('\x0a')){const _0x3c9fe2=_0x531bf0[_0x4edd9e(0x1d5)]();if(!_0x3c9fe2||_0x3c9fe2['startsWith']('#'))continue;const _0x42cc93=_0x3c9fe2['match'](/^([^=]+)=(.*)$/);if(_0x42cc93){const _0x4d31de=_0x42cc93[0x1][_0x4edd9e(0x1d5)]();let _0x4247f7=_0x42cc93[0x2][_0x4edd9e(0x1d5)]();(_0x4247f7['startsWith']('\x22')&&_0x4247f7[_0x4edd9e(0x1d2)]('\x22')||_0x4247f7['startsWith']('\x27')&&_0x4247f7[_0x4edd9e(0x1d2)]('\x27'))&&(_0x4247f7=_0x4247f7['slice'](0x1,-0x1)),_0x1395c5[_0x4d31de]=_0x4247f7;}}return _0x1395c5;}export function readUserConfig(){const _0x308b5c=a46_0x455e,_0x39e367=getConfigFile();if(!existsSync(_0x39e367))return{};try{const _0x2eee92=readFileSync(_0x39e367,_0x308b5c(0x1cd));return parseEnvFile(_0x2eee92);}catch(_0x5d46e6){return console[_0x308b5c(0x1ce)](_0x308b5c(0x1aa)+_0x39e367+':',_0x5d46e6),{};}}export function resolveSite(_0x33191e){const _0x207be9=a46_0x455e,_0x54ea8b=['us01','jp01',_0x207be9(0x1b9),_0x207be9(0x1e9),_0x207be9(0x1ba),_0x207be9(0x1dd),_0x207be9(0x1b8),_0x207be9(0x1d7),_0x207be9(0x1f0),_0x207be9(0x1c7)];if(_0x54ea8b['includes'](_0x33191e))return _0x33191e;if(_0x33191e in SITE_ALIASES)return SITE_ALIASES[_0x33191e];return console[_0x207be9(0x1ce)](_0x207be9(0x1f2)+_0x33191e+_0x207be9(0x1bf)),_0x207be9(0x1e8);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}function a46_0x150e(){const _0x1dc5f1=['ap02','llm_default_project','6SJvWrN','profile','string','23013JUhhRr','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','stg-jp01','8tJlaZn','Warning:\x20Unknown\x20site\x20\x27','keychain','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','env','name','legacy\x20.env\x20file','stringify','yellow','map','replace','keychain\x20(profile:\x20','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','tdx','TD_API_KEY\x20env\x20var\x20(deprecated)','TDX_API_KEY','accountId','dev-eu01','eu01','ap03','TDX_API_KEY_<PROFILE>','split','.config','TD_API_KEY_','\x27,\x20defaulting\x20to\x20us01','includes','Warning:\x20Failed\x20to\x20load\x20','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','toUpperCase','.env','account_info.','account_info.json','stg-ap03','8OmNNXU','readFileSync','join','4186134IRhQdT','TDX_API_KEY_','utf-8','warn','5765301HLiTUv','11Cnaqys','filter','endsWith','profiles','959205DiiYen','trim','4586GHQYKe','stg-us01','.env.','29282170AQbZug','legacy\x20.env\x20file\x20(profile:\x20','number','existsSync','dev-us01','TDX_API_KEY\x20env\x20var','5190409oNidBE','startsWith','apiKey','TD_API_KEY','.cache','.json','apiKeys','parse','source','us01'];a46_0x150e=function(){return _0x1dc5f1;};return a46_0x150e();}export function getAPIKey(_0x290cf4,_0x18f296){const _0x15a840=a46_0x455e,_0x439cfe=_0x18f296||getActiveProfileName();if(_0x439cfe){const _0x2af58a=_0x15a840(0x1cc)+normalizeProfileForEnvVar(_0x439cfe);if(process[_0x15a840(0x1ab)][_0x2af58a])return process[_0x15a840(0x1ab)][_0x2af58a];}if(process[_0x15a840(0x1ab)][_0x15a840(0x1b6)])return process[_0x15a840(0x1ab)]['TDX_API_KEY'];if(process['env']['TD_API_KEY'])return process['env'][_0x15a840(0x1e2)];const _0x1948e6=_0x290cf4[_0x15a840(0x1c3)]()[_0x15a840(0x1b1)](/-/g,'_'),_0x27d2c5='TD_API_KEY_'+_0x1948e6;if(_0x439cfe){const _0x5e01e7=loadProfileEnv(_0x439cfe);if(_0x5e01e7){if(_0x5e01e7[_0x27d2c5])return _0x5e01e7[_0x27d2c5];if(_0x5e01e7[_0x15a840(0x1e2)])return _0x5e01e7['TD_API_KEY'];}}const _0x1c63ca=loadUserConfigOnce();if(_0x1c63ca[_0x27d2c5])return _0x1c63ca[_0x27d2c5];if(_0x1c63ca['TD_API_KEY'])return _0x1c63ca['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x46f1f){const _0x17c62d=a46_0x455e;return _0x46f1f[_0x17c62d(0x1c3)]()[_0x17c62d(0x1b1)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x4954de,_0x2bb592){const _0x249936=a46_0x455e,_0x3c1b02=_0x2bb592||getActiveProfileName()||undefined;if(_0x3c1b02){const _0xd432a2=_0x249936(0x1cc)+normalizeProfileForEnvVar(_0x3c1b02);if(process[_0x249936(0x1ab)][_0xd432a2])return{'apiKey':process['env'][_0xd432a2],'source':_0xd432a2+'\x20env\x20var','isDeprecated':![]};const _0x556e21=getCachedCredential(_0x4954de,_0x3c1b02);if(_0x556e21)return{'apiKey':_0x556e21,'source':'keychain\x20(profile:\x20'+_0x3c1b02+')','isDeprecated':![]};const _0x37076d=await getKeychainAPIKey(_0x3c1b02);if(_0x37076d)return setCachedCredential(_0x37076d,_0x4954de,_0x3c1b02),{'apiKey':_0x37076d,'source':_0x249936(0x1b2)+_0x3c1b02+')','isDeprecated':![]};}if(process['env'][_0x249936(0x1b6)])return{'apiKey':process[_0x249936(0x1ab)]['TDX_API_KEY'],'source':_0x249936(0x1de),'isDeprecated':![]};if(!_0x3c1b02){const _0x4d95a7=getCachedCredential(_0x4954de,undefined);if(_0x4d95a7)return{'apiKey':_0x4d95a7,'source':'keychain','isDeprecated':![]};const _0x5f44ad=await getKeychainAPIKey(undefined);if(_0x5f44ad)return setCachedCredential(_0x5f44ad,_0x4954de,undefined),{'apiKey':_0x5f44ad,'source':_0x249936(0x1f3),'isDeprecated':![]};}if(process[_0x249936(0x1ab)]['TD_API_KEY'])return{'apiKey':process['env'][_0x249936(0x1e2)],'source':_0x249936(0x1b5),'isDeprecated':!![]};const _0x2271f5=getLegacyEnvAPIKey(_0x4954de,_0x3c1b02);if(_0x2271f5){const _0x4e62fe=await isKeychainAvailable();if(_0x4e62fe)try{await saveKeychainAPIKey(_0x2271f5,_0x3c1b02),setCachedCredential(_0x2271f5,_0x4954de,_0x3c1b02);const _0x20416a=getConfigFilePath(_0x3c1b02);cleanupLegacyEnvFile(_0x20416a)&&console[_0x249936(0x1ce)](a46_0xdb86fc[_0x249936(0x1af)](_0x249936(0x1c2)));}catch(_0x1244bb){console[_0x249936(0x1ce)](a46_0xdb86fc['yellow']('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x1244bb));}const _0x4e5026=_0x3c1b02?_0x249936(0x1da)+_0x3c1b02+')':_0x249936(0x1ad);return{'apiKey':_0x2271f5,'source':_0x4e5026,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2b199f,_0x3c2687,_0x263ef8=!![]){const _0x22b169=a46_0x455e,_0x4a5fd7=await resolveAPIKeyAsync(_0x2b199f,_0x3c2687);if(!_0x4a5fd7)return undefined;if(_0x263ef8&&_0x4a5fd7['isDeprecated']&&_0x4a5fd7[_0x22b169(0x1e7)][_0x22b169(0x1c0)](_0x22b169(0x1e2))){const _0x37f486=_0x3c2687||getActiveProfileName()||undefined,_0x3d7eac=_0x37f486?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x37f486):_0x22b169(0x1bb);console[_0x22b169(0x1ce)](a46_0xdb86fc[_0x22b169(0x1af)](_0x22b169(0x1b3)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x3d7eac+').')));}return _0x4a5fd7[_0x22b169(0x1e1)];}function getLegacyEnvAPIKey(_0x59d29d,_0x4bae80){const _0xfdaedc=a46_0x455e,_0x4c4127=_0x59d29d[_0xfdaedc(0x1c3)]()[_0xfdaedc(0x1b1)](/-/g,'_'),_0x3ccc25=_0xfdaedc(0x1be)+_0x4c4127;if(_0x4bae80){const _0x597007=loadProfileEnv(_0x4bae80);if(_0x597007){if(_0x597007[_0x3ccc25])return _0x597007[_0x3ccc25];if(_0x597007['TD_API_KEY'])return _0x597007[_0xfdaedc(0x1e2)];}}const _0x11f2fa=loadUserConfigOnce();if(_0x11f2fa[_0x3ccc25])return _0x11f2fa[_0x3ccc25];if(_0x11f2fa['TD_API_KEY'])return _0x11f2fa[_0xfdaedc(0x1e2)];return undefined;}function cleanupLegacyEnvFile(_0x5db281){const _0x1e333b=a46_0x455e;if(!existsSync(_0x5db281))return![];try{const _0x194aa2=readFileSync(_0x5db281,_0x1e333b(0x1cd)),_0x20c0b4=_0x194aa2[_0x1e333b(0x1bc)]('\x0a'),_0x5113f1=_0x20c0b4[_0x1e333b(0x1d1)](_0x2ef571=>{const _0x58e9af=_0x1e333b,_0x3ca357=_0x2ef571['trim']();if(!_0x3ca357||_0x3ca357[_0x58e9af(0x1e0)]('#'))return!![];const [_0x50ac71]=_0x3ca357[_0x58e9af(0x1bc)]('=');return!_0x50ac71[_0x58e9af(0x1e0)](_0x58e9af(0x1e2));}),_0x421b9e=_0x5113f1['some'](_0x4787c7=>{const _0x4df17b=_0x1e333b,_0x3f8d18=_0x4787c7[_0x4df17b(0x1d5)]();return _0x3f8d18&&!_0x3f8d18[_0x4df17b(0x1e0)]('#');});if(!_0x421b9e)return unlinkSync(_0x5db281),!![];return writeFileSync(_0x5db281,_0x5113f1[_0x1e333b(0x1ca)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x2dba29){const _0x59d2aa=a46_0x455e,_0xb010e3=a46_0x3ba6ea['join'](getConfigDir(),_0x59d2aa(0x1d8)+_0x2dba29);if(a46_0x4b4054[_0x59d2aa(0x1dc)](_0xb010e3)){validateSecureFilePermissions(_0xb010e3);try{const _0x1a2318=a46_0x4b4054[_0x59d2aa(0x1c9)](_0xb010e3,'utf-8');return parseEnvFile(_0x1a2318);}catch(_0x2867ca){console[_0x59d2aa(0x1ce)](_0x59d2aa(0x1c1)+_0xb010e3+':\x20'+_0x2867ca);}}const _0x648241=a46_0x3ba6ea[_0x59d2aa(0x1ca)](getConfigDir(),_0x59d2aa(0x1d3),_0x2dba29,_0x59d2aa(0x1c4));if(a46_0x4b4054['existsSync'](_0x648241)){validateSecureFilePermissions(_0x648241);try{const _0x3d5929=a46_0x4b4054[_0x59d2aa(0x1c9)](_0x648241,_0x59d2aa(0x1cd));return parseEnvFile(_0x3d5929);}catch(_0x4d6c68){return console[_0x59d2aa(0x1ce)](_0x59d2aa(0x1c1)+_0x648241+':\x20'+_0x4d6c68),null;}}return null;}function getActiveProfileName(){const _0x33d99b=a46_0x455e,_0x46a0c5=a46_0x3ba6ea[_0x33d99b(0x1ca)](getConfigDir(),'tdx.json');if(!a46_0x4b4054[_0x33d99b(0x1dc)](_0x46a0c5))return null;try{const _0x31e1a4=a46_0x4b4054[_0x33d99b(0x1c9)](_0x46a0c5,_0x33d99b(0x1cd)),_0x453097=JSON['parse'](_0x31e1a4);return _0x453097[_0x33d99b(0x1ec)]||null;}catch{return null;}}export function saveAPIKey(_0x7ac853,_0x3d20cb,_0x5e9dab){const _0x39eafd=a46_0x455e,_0x584012=getConfigDir(),_0x157ecf=getConfigFilePath(_0x5e9dab);!existsSync(_0x584012)&&mkdirSync(_0x584012,{'recursive':!![],'mode':0x1c0});let _0x24cdc6={};if(existsSync(_0x157ecf))try{const _0x53696b=readFileSync(_0x157ecf,'utf-8');_0x24cdc6=parseEnvFile(_0x53696b);}catch(_0x15ab34){console[_0x39eafd(0x1ce)]('Warning:\x20Failed\x20to\x20read\x20'+_0x157ecf+':',_0x15ab34);}const _0x4430c0=_0x7ac853[_0x39eafd(0x1c3)]()[_0x39eafd(0x1b1)](/-/g,'_');_0x24cdc6[_0x39eafd(0x1be)+_0x4430c0]=_0x3d20cb;const _0x1de105=Object['entries'](_0x24cdc6)[_0x39eafd(0x1b0)](([_0x3e91b4,_0x4831d6])=>_0x3e91b4+'='+_0x4831d6);writeFileSync(_0x157ecf,_0x1de105[_0x39eafd(0x1ca)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x4395ca,_0x224f5d,_0x15e99e){const _0x4ba267=a46_0x455e;await saveKeychainAPIKey(_0x4395ca,_0x15e99e),setCachedCredential(_0x4395ca,_0x224f5d,_0x15e99e);const _0x492a2c=getConfigFilePath(_0x15e99e);cleanupLegacyEnvFile(_0x492a2c)&&console['warn'](a46_0xdb86fc[_0x4ba267(0x1af)](_0x4ba267(0x1ef)));}export function loadConfig(){const _0xe65587=a46_0x455e,_0x23395d={'apiKeys':{},'defaultSite':_0xe65587(0x1e8)},_0x436271=[_0xe65587(0x1e8),'jp01','eu01',_0xe65587(0x1e9),_0xe65587(0x1ba),_0xe65587(0x1dd),_0xe65587(0x1b8),_0xe65587(0x1d7),_0xe65587(0x1f0),'stg-ap03'];for(const _0xfd0d05 of _0x436271){const _0x8bcba=getAPIKey(_0xfd0d05);_0x8bcba&&(_0x23395d[_0xe65587(0x1e5)][_0xfd0d05]=_0x8bcba);}return _0x23395d;}
|
|
1
|
+
(function(_0x2a4c93,_0x19bc72){const _0x472cbd=a46_0x5cf5,_0x4f88b0=_0x2a4c93();while(!![]){try{const _0xd2bd86=-parseInt(_0x472cbd(0x1bb))/0x1*(-parseInt(_0x472cbd(0x18c))/0x2)+parseInt(_0x472cbd(0x1b5))/0x3+-parseInt(_0x472cbd(0x187))/0x4*(parseInt(_0x472cbd(0x1ad))/0x5)+-parseInt(_0x472cbd(0x179))/0x6*(parseInt(_0x472cbd(0x197))/0x7)+parseInt(_0x472cbd(0x199))/0x8+parseInt(_0x472cbd(0x1a0))/0x9+parseInt(_0x472cbd(0x1a4))/0xa;if(_0xd2bd86===_0x19bc72)break;else _0x4f88b0['push'](_0x4f88b0['shift']());}catch(_0x27143d){_0x4f88b0['push'](_0x4f88b0['shift']());}}}(a46_0x4ac6,0xb430d));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x321104 from'node:fs';import*as a46_0x1e6474 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_0x35519b from'chalk';export function getConfigDir(){const _0x3d5a77=a46_0x5cf5;return process[_0x3d5a77(0x193)][_0x3d5a77(0x196)]||join(homedir(),_0x3d5a77(0x1a8),_0x3d5a77(0x1bd));}function a46_0x5cf5(_0x9c15c3,_0xf0e446){_0x9c15c3=_0x9c15c3-0x177;const _0x4ac68c=a46_0x4ac6();let _0x5cf571=_0x4ac68c[_0x9c15c3];return _0x5cf571;}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x3f378){const _0x247388=a46_0x5cf5,_0x1186b2=getConfigDir();return _0x3f378?a46_0x1e6474[_0x247388(0x19b)](_0x1186b2,_0x247388(0x1bc)+_0x3f378):getConfigFile();}export function getCacheDir(){const _0x8cfea8=a46_0x5cf5;return process[_0x8cfea8(0x193)][_0x8cfea8(0x198)]||join(homedir(),_0x8cfea8(0x1ae),_0x8cfea8(0x1bd));}export function getLLMProjectCacheFile(_0x137afb){const _0x2b15ef=a46_0x5cf5,_0x36593f=_0x137afb?_0x2b15ef(0x1a7)+_0x137afb:_0x2b15ef(0x1c4);return join(getCacheDir(),_0x36593f);}export function readCachedLLMProject(_0x2ef94c){const _0x1bde23=a46_0x5cf5;try{const _0x2bf43f=getLLMProjectCacheFile(_0x2ef94c);if(!existsSync(_0x2bf43f))return null;const _0x402733=readFileSync(_0x2bf43f,_0x1bde23(0x1aa))[_0x1bde23(0x1c2)]();try{const _0x309c75=JSON[_0x1bde23(0x19f)](_0x402733);if(_0x309c75&&typeof _0x309c75['id']===_0x1bde23(0x1b6)&&typeof _0x309c75['name']===_0x1bde23(0x1b6))return _0x309c75;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x33218d,_0x4ac3da,_0x247386){try{const _0x29842a=getCacheDir(),_0x39a9aa=getLLMProjectCacheFile(_0x247386);!existsSync(_0x29842a)&&mkdirSync(_0x29842a,{'recursive':!![]});const _0x15979f={'name':_0x33218d,'id':_0x4ac3da};writeFileSync(_0x39a9aa,JSON['stringify'](_0x15979f),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x2c25fe){const _0x1345b8=a46_0x5cf5,_0x516e30=_0x2c25fe?_0x1345b8(0x19d)+_0x2c25fe:_0x1345b8(0x1ca);return join(getCacheDir(),_0x516e30);}export function readCachedLLMAgent(_0x268567){const _0x5d02d9=a46_0x5cf5;try{const _0x239bde=getLLMAgentCacheFile(_0x268567);if(!existsSync(_0x239bde))return null;const _0x1d71e7=readFileSync(_0x239bde,_0x5d02d9(0x1aa))['trim']();try{const _0x1bfea9=JSON[_0x5d02d9(0x19f)](_0x1d71e7);if(_0x1bfea9&&typeof _0x1bfea9['id']==='string'&&typeof _0x1bfea9[_0x5d02d9(0x184)]===_0x5d02d9(0x1b6)&&typeof _0x1bfea9[_0x5d02d9(0x1c7)]===_0x5d02d9(0x1b6))return _0x1bfea9;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x5ab531,_0xbc4ad2,_0x5f6d41,_0xbbb95e){const _0x14d79e=a46_0x5cf5;try{const _0x6a414d=getCacheDir(),_0x2db06b=getLLMAgentCacheFile(_0xbbb95e);!existsSync(_0x6a414d)&&mkdirSync(_0x6a414d,{'recursive':!![]});const _0x5a9411={'name':_0x5ab531,'id':_0xbc4ad2,'projectId':_0x5f6d41};writeFileSync(_0x2db06b,JSON[_0x14d79e(0x183)](_0x5a9411),_0x14d79e(0x1aa));}catch{}}export function clearCachedLLMAgent(_0x306952){try{const _0x1cb98b=getLLMAgentCacheFile(_0x306952);existsSync(_0x1cb98b)&&unlinkSync(_0x1cb98b);}catch{}}export function getAccountInfoCacheFile(_0x45f74e){const _0x33622f=a46_0x5cf5,_0x22ee6f=_0x45f74e?'account_info.'+_0x45f74e+_0x33622f(0x18d):_0x33622f(0x1b7);return join(getCacheDir(),_0x22ee6f);}export function readCachedAccountInfo(_0x4cea12){const _0x1e7cff=a46_0x5cf5;try{const _0xc64c3c=getAccountInfoCacheFile(_0x4cea12);if(!existsSync(_0xc64c3c))return null;const _0x641220=readFileSync(_0xc64c3c,_0x1e7cff(0x1aa))[_0x1e7cff(0x1c2)](),_0x315a37=JSON['parse'](_0x641220);if(_0x315a37&&typeof _0x315a37['site']===_0x1e7cff(0x1b6)&&typeof _0x315a37[_0x1e7cff(0x19c)]===_0x1e7cff(0x1c9))return _0x315a37;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x276dad,_0x352078,_0x328eae){const _0x34b703=a46_0x5cf5;try{const _0x4f5eff=getCacheDir(),_0x335b6a=getAccountInfoCacheFile(_0x328eae);!existsSync(_0x4f5eff)&&mkdirSync(_0x4f5eff,{'recursive':!![]});const _0x142dd1={'site':_0x276dad,'accountId':_0x352078,'cachedAt':new Date()[_0x34b703(0x1b8)]()};writeFileSync(_0x335b6a,JSON[_0x34b703(0x183)](_0x142dd1),_0x34b703(0x1aa));}catch{}}export function parseEnvFile(_0x355eee){const _0x353899=a46_0x5cf5,_0x54e2af={};for(const _0x68138a of _0x355eee[_0x353899(0x1c3)]('\x0a')){const _0x484c26=_0x68138a[_0x353899(0x1c2)]();if(!_0x484c26||_0x484c26[_0x353899(0x18f)]('#'))continue;const _0x5ea039=_0x484c26[_0x353899(0x194)](/^([^=]+)=(.*)$/);if(_0x5ea039){const _0x3e6b02=_0x5ea039[0x1][_0x353899(0x1c2)]();let _0x5c3b9b=_0x5ea039[0x2][_0x353899(0x1c2)]();(_0x5c3b9b['startsWith']('\x22')&&_0x5c3b9b[_0x353899(0x189)]('\x22')||_0x5c3b9b[_0x353899(0x18f)]('\x27')&&_0x5c3b9b[_0x353899(0x189)]('\x27'))&&(_0x5c3b9b=_0x5c3b9b[_0x353899(0x1b0)](0x1,-0x1)),_0x54e2af[_0x3e6b02]=_0x5c3b9b;}}return _0x54e2af;}export function readUserConfig(){const _0x537ec7=a46_0x5cf5,_0x1c83cb=getConfigFile();if(!existsSync(_0x1c83cb))return{};try{const _0x451b11=readFileSync(_0x1c83cb,_0x537ec7(0x1aa));return parseEnvFile(_0x451b11);}catch(_0x5da043){return console['warn'](_0x537ec7(0x192)+_0x1c83cb+':',_0x5da043),{};}}export function resolveSite(_0x35bba3){const _0xf3669b=a46_0x5cf5,_0x2b1738=['us01',_0xf3669b(0x1a3),'eu01',_0xf3669b(0x1a9),'ap03',_0xf3669b(0x18b),_0xf3669b(0x1af),_0xf3669b(0x177),_0xf3669b(0x180),_0xf3669b(0x1bf)];if(_0x2b1738[_0xf3669b(0x17e)](_0x35bba3))return _0x35bba3;if(_0x35bba3 in SITE_ALIASES)return SITE_ALIASES[_0x35bba3];return console['warn'](_0xf3669b(0x17b)+_0x35bba3+_0xf3669b(0x1c6)),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}function a46_0x4ac6(){const _0x1ae610=['some','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','env','match','replace','TDX_CONFIG_DIR','119IbEqBU','TDX_CACHE_DIR','9105560WNvOQI','eu01','join','accountId','llm_default_agent.','profiles','parse','427347fqQhiO','.env','toUpperCase','jp01','7438040mjEaOM','TD_API_KEY\x20env\x20var\x20(deprecated)','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','llm_default_project.','.config','ap02','utf-8','TD_API_KEY','keychain','5VMncuS','.cache','dev-eu01','slice','existsSync','TD_API_KEY_','yellow','profile','1891068SCdMoc','string','account_info.json','toISOString','TDX_API_KEY\x20env\x20var','apiKey','33SShGna','.env.','tdx','readFileSync','stg-ap03','legacy\x20.env\x20file','map','trim','split','llm_default_project','keychain\x20(profile:\x20','\x27,\x20defaulting\x20to\x20us01','projectId','TDX_API_KEY_<PROFILE>','number','llm_default_agent','stg-us01','TDX_API_KEY','365268IaslBL','source','Warning:\x20Unknown\x20site\x20\x27','entries','legacy\x20.env\x20file\x20(profile:\x20','includes','us01','stg-jp01','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','isDeprecated','stringify','name','ap03','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','3164696fjgNxd','Warning:\x20Failed\x20to\x20load\x20','endsWith','warn','dev-us01','262NkcpoH','.json','TDX_API_KEY_','startsWith'];a46_0x4ac6=function(){return _0x1ae610;};return a46_0x4ac6();}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x1007bb,_0x1279d3){const _0x262ed7=a46_0x5cf5,_0x41f053=_0x1279d3||getActiveProfileName();if(_0x41f053){const _0x167ad0=_0x262ed7(0x18e)+normalizeProfileForEnvVar(_0x41f053);if(process[_0x262ed7(0x193)][_0x167ad0])return process['env'][_0x167ad0];}if(process[_0x262ed7(0x193)][_0x262ed7(0x178)])return process['env'][_0x262ed7(0x178)];if(process[_0x262ed7(0x193)][_0x262ed7(0x1ab)])return process[_0x262ed7(0x193)]['TD_API_KEY'];const _0x35788e=_0x1007bb[_0x262ed7(0x1a2)]()[_0x262ed7(0x195)](/-/g,'_'),_0x38e1a8=_0x262ed7(0x1b2)+_0x35788e;if(_0x41f053){const _0x10970c=loadProfileEnv(_0x41f053);if(_0x10970c){if(_0x10970c[_0x38e1a8])return _0x10970c[_0x38e1a8];if(_0x10970c[_0x262ed7(0x1ab)])return _0x10970c[_0x262ed7(0x1ab)];}}const _0x1899eb=loadUserConfigOnce();if(_0x1899eb[_0x38e1a8])return _0x1899eb[_0x38e1a8];if(_0x1899eb['TD_API_KEY'])return _0x1899eb['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x168c96){const _0x954f02=a46_0x5cf5;return _0x168c96[_0x954f02(0x1a2)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x56514c,_0x51d597){const _0x447ae3=a46_0x5cf5,_0x58a4eb=_0x51d597||getActiveProfileName()||undefined;if(_0x58a4eb){const _0x2e2871=_0x447ae3(0x18e)+normalizeProfileForEnvVar(_0x58a4eb);if(process[_0x447ae3(0x193)][_0x2e2871])return{'apiKey':process[_0x447ae3(0x193)][_0x2e2871],'source':_0x2e2871+'\x20env\x20var','isDeprecated':![]};const _0x26a3ac=getCachedCredential(_0x56514c,_0x58a4eb);if(_0x26a3ac)return{'apiKey':_0x26a3ac,'source':_0x447ae3(0x1c5)+_0x58a4eb+')','isDeprecated':![]};const _0x1afefa=await getKeychainAPIKey(_0x58a4eb);if(_0x1afefa)return setCachedCredential(_0x1afefa,_0x56514c,_0x58a4eb),{'apiKey':_0x1afefa,'source':_0x447ae3(0x1c5)+_0x58a4eb+')','isDeprecated':![]};}if(process[_0x447ae3(0x193)][_0x447ae3(0x178)])return{'apiKey':process['env'][_0x447ae3(0x178)],'source':_0x447ae3(0x1b9),'isDeprecated':![]};if(!_0x58a4eb){const _0x4436ab=getCachedCredential(_0x56514c,undefined);if(_0x4436ab)return{'apiKey':_0x4436ab,'source':_0x447ae3(0x1ac),'isDeprecated':![]};const _0x28e192=await getKeychainAPIKey(undefined);if(_0x28e192)return setCachedCredential(_0x28e192,_0x56514c,undefined),{'apiKey':_0x28e192,'source':_0x447ae3(0x1ac),'isDeprecated':![]};}if(process[_0x447ae3(0x193)][_0x447ae3(0x1ab)])return{'apiKey':process[_0x447ae3(0x193)][_0x447ae3(0x1ab)],'source':_0x447ae3(0x1a5),'isDeprecated':!![]};const _0xeba120=getLegacyEnvAPIKey(_0x56514c,_0x58a4eb);if(_0xeba120){const _0x1b8cd3=await isKeychainAvailable();if(_0x1b8cd3)try{await saveKeychainAPIKey(_0xeba120,_0x58a4eb),setCachedCredential(_0xeba120,_0x56514c,_0x58a4eb);const _0xc4085b=getConfigFilePath(_0x58a4eb);cleanupLegacyEnvFile(_0xc4085b)&&console[_0x447ae3(0x18a)](a46_0x35519b[_0x447ae3(0x1b3)]('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x296e24){console['warn'](a46_0x35519b[_0x447ae3(0x1b3)](_0x447ae3(0x181)+_0x296e24));}const _0x594bbf=_0x58a4eb?_0x447ae3(0x17d)+_0x58a4eb+')':_0x447ae3(0x1c0);return{'apiKey':_0xeba120,'source':_0x594bbf,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x17a37c,_0x116d6c,_0x5b097e=!![]){const _0x3e78ec=a46_0x5cf5,_0x532034=await resolveAPIKeyAsync(_0x17a37c,_0x116d6c);if(!_0x532034)return undefined;if(_0x5b097e&&_0x532034[_0x3e78ec(0x182)]&&_0x532034[_0x3e78ec(0x17a)][_0x3e78ec(0x17e)]('TD_API_KEY')){const _0x3f8161=_0x116d6c||getActiveProfileName()||undefined,_0x2b1e87=_0x3f8161?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x3f8161):_0x3e78ec(0x1c8);console['warn'](a46_0x35519b['yellow'](_0x3e78ec(0x186)+(_0x3e78ec(0x1a6)+_0x2b1e87+').')));}return _0x532034[_0x3e78ec(0x1ba)];}function getLegacyEnvAPIKey(_0x443819,_0x4360d6){const _0x240406=a46_0x5cf5,_0x5974df=_0x443819['toUpperCase']()['replace'](/-/g,'_'),_0x3a0fe6='TD_API_KEY_'+_0x5974df;if(_0x4360d6){const _0xda49f6=loadProfileEnv(_0x4360d6);if(_0xda49f6){if(_0xda49f6[_0x3a0fe6])return _0xda49f6[_0x3a0fe6];if(_0xda49f6['TD_API_KEY'])return _0xda49f6[_0x240406(0x1ab)];}}const _0x16b3ed=loadUserConfigOnce();if(_0x16b3ed[_0x3a0fe6])return _0x16b3ed[_0x3a0fe6];if(_0x16b3ed[_0x240406(0x1ab)])return _0x16b3ed['TD_API_KEY'];return undefined;}function cleanupLegacyEnvFile(_0x19d60d){const _0x2fb4b3=a46_0x5cf5;if(!existsSync(_0x19d60d))return![];try{const _0x411c13=readFileSync(_0x19d60d,_0x2fb4b3(0x1aa)),_0x3f2209=_0x411c13['split']('\x0a'),_0x4ced75=_0x3f2209['filter'](_0x367652=>{const _0x403f30=_0x2fb4b3,_0x5ea60c=_0x367652[_0x403f30(0x1c2)]();if(!_0x5ea60c||_0x5ea60c[_0x403f30(0x18f)]('#'))return!![];const [_0x338a9b]=_0x5ea60c[_0x403f30(0x1c3)]('=');return!_0x338a9b[_0x403f30(0x18f)]('TD_API_KEY');}),_0x4588ac=_0x4ced75[_0x2fb4b3(0x190)](_0xbfe7c=>{const _0x23c002=_0x2fb4b3,_0x167716=_0xbfe7c[_0x23c002(0x1c2)]();return _0x167716&&!_0x167716['startsWith']('#');});if(!_0x4588ac)return unlinkSync(_0x19d60d),!![];return writeFileSync(_0x19d60d,_0x4ced75['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x5231ce){const _0x5f4fb1=a46_0x5cf5,_0x5dbdd5=a46_0x1e6474[_0x5f4fb1(0x19b)](getConfigDir(),_0x5f4fb1(0x1bc)+_0x5231ce);if(a46_0x321104[_0x5f4fb1(0x1b1)](_0x5dbdd5)){validateSecureFilePermissions(_0x5dbdd5);try{const _0x34b8f0=a46_0x321104[_0x5f4fb1(0x1be)](_0x5dbdd5,_0x5f4fb1(0x1aa));return parseEnvFile(_0x34b8f0);}catch(_0x461d0d){console[_0x5f4fb1(0x18a)](_0x5f4fb1(0x188)+_0x5dbdd5+':\x20'+_0x461d0d);}}const _0x46a339=a46_0x1e6474['join'](getConfigDir(),_0x5f4fb1(0x19e),_0x5231ce,_0x5f4fb1(0x1a1));if(a46_0x321104['existsSync'](_0x46a339)){validateSecureFilePermissions(_0x46a339);try{const _0x583ea9=a46_0x321104[_0x5f4fb1(0x1be)](_0x46a339,_0x5f4fb1(0x1aa));return parseEnvFile(_0x583ea9);}catch(_0x30849e){return console[_0x5f4fb1(0x18a)](_0x5f4fb1(0x188)+_0x46a339+':\x20'+_0x30849e),null;}}return null;}function getActiveProfileName(){const _0x2229d9=a46_0x5cf5,_0x28a787=a46_0x1e6474[_0x2229d9(0x19b)](getConfigDir(),'tdx.json');if(!a46_0x321104[_0x2229d9(0x1b1)](_0x28a787))return null;try{const _0x2f7b1d=a46_0x321104[_0x2229d9(0x1be)](_0x28a787,'utf-8'),_0x2d0bec=JSON[_0x2229d9(0x19f)](_0x2f7b1d);return _0x2d0bec[_0x2229d9(0x1b4)]||null;}catch{return null;}}export function saveAPIKey(_0x1372a2,_0x44b077,_0x1303a7){const _0x40ee12=a46_0x5cf5,_0x3291f0=getConfigDir(),_0x14f903=getConfigFilePath(_0x1303a7);!existsSync(_0x3291f0)&&mkdirSync(_0x3291f0,{'recursive':!![],'mode':0x1c0});let _0xcf04ad={};if(existsSync(_0x14f903))try{const _0x157755=readFileSync(_0x14f903,_0x40ee12(0x1aa));_0xcf04ad=parseEnvFile(_0x157755);}catch(_0x36011c){console['warn']('Warning:\x20Failed\x20to\x20read\x20'+_0x14f903+':',_0x36011c);}const _0x2dd336=_0x1372a2[_0x40ee12(0x1a2)]()[_0x40ee12(0x195)](/-/g,'_');_0xcf04ad[_0x40ee12(0x1b2)+_0x2dd336]=_0x44b077;const _0x3d6a29=Object[_0x40ee12(0x17c)](_0xcf04ad)[_0x40ee12(0x1c1)](([_0x54701b,_0x58c698])=>_0x54701b+'='+_0x58c698);writeFileSync(_0x14f903,_0x3d6a29['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x49df56,_0x496603,_0x1e0387){const _0x22c142=a46_0x5cf5;await saveKeychainAPIKey(_0x49df56,_0x1e0387),setCachedCredential(_0x49df56,_0x496603,_0x1e0387);const _0x3a51b8=getConfigFilePath(_0x1e0387);cleanupLegacyEnvFile(_0x3a51b8)&&console[_0x22c142(0x18a)](a46_0x35519b[_0x22c142(0x1b3)](_0x22c142(0x191)));}export function loadConfig(){const _0x402814=a46_0x5cf5,_0x4ce591={'apiKeys':{},'defaultSite':'us01'},_0x26b94f=[_0x402814(0x17f),_0x402814(0x1a3),_0x402814(0x19a),_0x402814(0x1a9),_0x402814(0x185),'dev-us01',_0x402814(0x1af),'stg-us01',_0x402814(0x180),'stg-ap03'];for(const _0x10734b of _0x26b94f){const _0x48ecf3=getAPIKey(_0x10734b);_0x48ecf3&&(_0x4ce591['apiKeys'][_0x10734b]=_0x48ecf3);}return _0x4ce591;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x555d5d,_0x113ba9){const _0x16fba6=a47_0x1d0c,_0x42eee9=_0x555d5d();while(!![]){try{const _0x38b19f=parseInt(_0x16fba6(0x1cf))/0x1+parseInt(_0x16fba6(0x1d5))/0x2+parseInt(_0x16fba6(0x1d7))/0x3+parseInt(_0x16fba6(0x1ce))/0x4+-parseInt(_0x16fba6(0x1d0))/0x5+parseInt(_0x16fba6(0x1d8))/0x6+-parseInt(_0x16fba6(0x1d3))/0x7;if(_0x38b19f===_0x113ba9)break;else _0x42eee9['push'](_0x42eee9['shift']());}catch(_0x1d5492){_0x42eee9['push'](_0x42eee9['shift']());}}}(a47_0x3d84,0xb145c));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x3e9d31){const _0x48ff0e=a47_0x1d0c,_0x3e407b=_0x3e9d31||'default';return join(getCacheDir(),_0x48ff0e(0x1d6)+_0x3e407b+_0x48ff0e(0x1d1));}function a47_0x1d0c(_0x2ee19f,_0x4cc1eb){_0x2ee19f=_0x2ee19f-0x1cd;const _0x3d8427=a47_0x3d84();let _0x1d0cdc=_0x3d8427[_0x2ee19f];return _0x1d0cdc;}export function loadCachedConnections(_0x5b13f5){const _0x8596da=getCacheFilePath(_0x5b13f5);if(!existsSync(_0x8596da))return null;try{const _0x540232=readFileSync(_0x8596da,'utf-8'),_0x73431d=JSON['parse'](_0x540232);return _0x73431d['connections'];}catch{return null;}}function a47_0x3d84(){const _0x2332ee=['stringify','2936024HJoNnF','179143GWNqsJ','5022690xnjJmX','.json','utf-8','14209993Bqrevm','now','2774918YmckNJ','connections-','2717895JDoKvW','3324432PKipMn'];a47_0x3d84=function(){return _0x2332ee;};return a47_0x3d84();}export function saveCachedConnections(_0x53cb63,_0x176678){const _0x16dedf=a47_0x1d0c,_0x333351=getCacheDir();!existsSync(_0x333351)&&mkdirSync(_0x333351,{'recursive':!![]});const _0xcb80d=getCacheFilePath(_0x53cb63),_0x243359={'connections':_0x176678,'cachedAt':Date[_0x16dedf(0x1d4)]()};writeFileSync(_0xcb80d,JSON[_0x16dedf(0x1cd)](_0x243359,null,0x2),_0x16dedf(0x1d2));}export function clearConnectionCache(_0x3fa2b6){const _0x10e599=getCacheFilePath(_0x3fa2b6);if(existsSync(_0x10e599))try{unlinkSync(_0x10e599);}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8ccb09,_0x32a1d3){const _0x31e116=a48_0x3297,_0x46ecae=_0x8ccb09();while(!![]){try{const _0x54bf83=parseInt(_0x31e116(0x7e))/0x1*(parseInt(_0x31e116(0x73))/0x2)+-parseInt(_0x31e116(0x74))/0x3*(-parseInt(_0x31e116(0x7f))/0x4)+parseInt(_0x31e116(0x71))/0x5*(-parseInt(_0x31e116(0x79))/0x6)+parseInt(_0x31e116(0x77))/0x7+-parseInt(_0x31e116(0x75))/0x8+parseInt(_0x31e116(0x76))/0x9*(parseInt(_0x31e116(0x7d))/0xa)+-parseInt(_0x31e116(0x7c))/0xb*(parseInt(_0x31e116(0x7b))/0xc);if(_0x54bf83===_0x32a1d3)break;else _0x46ecae['push'](_0x46ecae['shift']());}catch(_0xff30cd){_0x46ecae['push'](_0x46ecae['shift']());}}}(a48_0x2c1d,0x1a569));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0xe1cd9a,_0x5dbdc7){const _0x433d72=a48_0x3297,_0x45233f=_0xe1cd9a||_0x433d72(0x80),_0x14b5a2=_0x5dbdc7||'__default_profile__';return _0x45233f+':'+_0x14b5a2;}export function getCachedCredential(_0x20238d,_0x25486d){const _0x34a9d3=a48_0x3297,_0x3e24a9=getCacheKey(_0x20238d,_0x25486d),_0x47577a=cache['get'](_0x3e24a9);if(!_0x47577a)return null;if(Date[_0x34a9d3(0x70)]()-_0x47577a[_0x34a9d3(0x7a)]>CACHE_TTL_MS)return cache['delete'](_0x3e24a9),null;return _0x47577a['apiKey'];}function a48_0x2c1d(){const _0x47fc6c=['30foZYVF','loadedAt','12VgHxEV','2272501oKYQMO','27250vRRmIs','75269uguQZB','28VRNRCW','__default_site__','now','16495xUtTng','clear','4rAGOKp','309lXMVCs','864008RptCYz','639XviAMt','659638BfpKfX','set'];a48_0x2c1d=function(){return _0x47fc6c;};return a48_0x2c1d();}function a48_0x3297(_0x3302a8,_0xe27591){_0x3302a8=_0x3302a8-0x70;const _0x2c1db8=a48_0x2c1d();let _0x3297e3=_0x2c1db8[_0x3302a8];return _0x3297e3;}export function setCachedCredential(_0x2c8860,_0x5bd66c,_0x423af5){const _0x198119=a48_0x3297,_0x2da88a=getCacheKey(_0x5bd66c,_0x423af5);cache[_0x198119(0x78)](_0x2da88a,{'apiKey':_0x2c8860,'loadedAt':Date[_0x198119(0x70)]()});}export function clearCredentialCache(){const _0x259ab0=a48_0x3297;cache[_0x259ab0(0x72)]();}export function clearCachedCredential(_0x1abc23,_0x27a1c6){const _0x604758=getCacheKey(_0x1abc23,_0x27a1c6);cache['delete'](_0x604758);}
|