@treasuredata/tdx 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/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/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x1b4b21=a24_0x511a;(function(_0x824870,_0x4f9e4f){const _0x304fc7=a24_0x511a,_0x43a3d5=_0x824870();while(!![]){try{const _0x547e98=-parseInt(_0x304fc7(0x8a))/0x1*(-parseInt(_0x304fc7(0x87))/0x2)+-parseInt(_0x304fc7(0x93))/0x3*(parseInt(_0x304fc7(0x77))/0x4)+parseInt(_0x304fc7(0x9a))/0x5+parseInt(_0x304fc7(0x94))/0x6*(-parseInt(_0x304fc7(0xa1))/0x7)+-parseInt(_0x304fc7(0x98))/0x8*(parseInt(_0x304fc7(0x91))/0x9)+-parseInt(_0x304fc7(0x80))/0xa+-parseInt(_0x304fc7(0x8f))/0xb*(-parseInt(_0x304fc7(0x86))/0xc);if(_0x547e98===_0x4f9e4f)break;else _0x43a3d5['push'](_0x43a3d5['shift']());}catch(_0x4fcf79){_0x43a3d5['push'](_0x43a3d5['shift']());}}}(a24_0x57ce,0x27ac4));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a24_0x511a(_0x4f2bc6,_0x59ff19){const _0x57ce3e=a24_0x57ce();return a24_0x511a=function(_0x511ac4,_0x13af6b){_0x511ac4=_0x511ac4-0x6c;let _0x4d1685=_0x57ce3e[_0x511ac4];return _0x4d1685;},a24_0x511a(_0x4f2bc6,_0x59ff19);}function a24_0x57ce(){const _0x55e3f0=['Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Segment\x20name:\x20','Site:\x20','length','8kyREOj','noCountPopulation','✔\x20Created\x20segment\x20\x27','segment','kind','site','data','execute','verbose','202390rUpIJb','Examples:','error','Resolving\x20folder\x20\x27','segmentPath','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','333708birska','113858gdWJyy','parent','\x27...','4NpQrpA','includes','\x27\x20with\x20ID:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','187pbZEVS','Parent:\x20','437841ydnRtD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','466050eZDfiH','474smZtEy','folderId','name','resolvePathToResource','16nSsHDG','resolveFolderId','496510fsKjVB','folder','Resolved\x20relative\x20path\x20to:\x20','description','Create\x20child\x20segment\x20with\x20filtering\x20rules','Target\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','18522TVkuVo','\x20\x20\x20Path:\x20','resolveParentId','rule','createSegment','segments','invisible'];a24_0x57ce=function(){return _0x55e3f0;};return a24_0x57ce();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a24_0x1b4b21(0x9d)]=a24_0x1b4b21(0x9e);async[a24_0x1b4b21(0x7e)](_0x185b44){const _0x5d01be=a24_0x1b4b21,{options:_0x34242e,args:_0x4ef2dd,tdx:_0x5d9ad8}=_0x185b44,_0x2c7830=_0x34242e;if(_0x4ef2dd[_0x5d01be(0x76)]===0x0)return console[_0x5d01be(0x82)](_0x5d01be(0x92)),console[_0x5d01be(0x82)](_0x5d01be(0x85)),console[_0x5d01be(0x82)](_0x5d01be(0x81)),console[_0x5d01be(0x82)](_0x5d01be(0x8e)),console[_0x5d01be(0x82)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x48d154=_0x4ef2dd[0x0],_0x556f5d=_0x34242e[_0x5d01be(0x84)];let _0x1dc459=_0x48d154;_0x556f5d&&!_0x48d154[_0x5d01be(0x8b)]('/')&&(_0x1dc459=_0x556f5d+'/'+_0x48d154,_0x2c7830['verbose']&&console[_0x5d01be(0x82)](_0x5d01be(0x9c)+_0x1dc459));const _0x54f92b=parsePath(_0x1dc459);if(_0x54f92b[_0x5d01be(0x70)][_0x5d01be(0x76)]<0x2)return console[_0x5d01be(0x82)](_0x5d01be(0x8d)),console[_0x5d01be(0x82)](_0x5d01be(0x73)),0x1;const _0x4d05e3=_0x54f92b[_0x5d01be(0x70)][0x0],_0xedc836=getBaseName(_0x1dc459),_0x385c6b=getParentPath(_0x1dc459);_0x2c7830[_0x5d01be(0x7f)]&&(console[_0x5d01be(0x82)](_0x5d01be(0x75)+_0x2c7830[_0x5d01be(0x7c)]),console[_0x5d01be(0x82)](_0x5d01be(0x9f)+_0x1dc459),console[_0x5d01be(0x82)](_0x5d01be(0x90)+_0x4d05e3),console[_0x5d01be(0x82)](_0x5d01be(0x74)+_0xedc836),console['error']('Parent\x20path:\x20'+_0x385c6b));const _0x3af35a=await withSpinner(_0x5d01be(0xa0)+_0x4d05e3+_0x5d01be(0x89),()=>_0x5d9ad8['segment'][_0x5d01be(0x6d)](_0x4d05e3),{'verbose':_0x2c7830[_0x5d01be(0x7f)]}),_0xd33ba6=_0x3af35a[_0x5d01be(0x7d)];let _0x3a7950;if(_0x54f92b[_0x5d01be(0x70)][_0x5d01be(0x76)]>0x2){const _0x37f562=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x385c6b+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x97)](_0x385c6b),{'verbose':_0x2c7830['verbose']}),_0x3ec5cd=_0x37f562[_0x5d01be(0x7d)];if(_0x3ec5cd['type']!==_0x5d01be(0x9b)&&_0x3ec5cd['type']!==_0x5d01be(0x88))return console[_0x5d01be(0x82)](_0x5d01be(0x72)),0x1;_0x3a7950=_0x3ec5cd[_0x5d01be(0x95)];}else{if(_0x2c7830['folder']){const _0x37d6e9=await withSpinner(_0x5d01be(0x83)+_0x2c7830[_0x5d01be(0x9b)]+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x99)](_0xd33ba6,_0x2c7830[_0x5d01be(0x9b)]),{'verbose':_0x2c7830[_0x5d01be(0x7f)]});_0x3a7950=_0x37d6e9['data'];}}_0x2c7830['verbose']&&_0x3a7950&&console[_0x5d01be(0x82)]('Resolved\x20folder\x20ID:\x20'+_0x3a7950);const _0x3e11e7=await loadJSONFromOptions(_0x2c7830[_0x5d01be(0x6e)],_0x2c7830['ruleFile']),_0x1e8aa1={'name':_0xedc836,'description':_0x2c7830['description'],'rule':_0x3e11e7,'kind':_0x2c7830[_0x5d01be(0x7b)]!==undefined?parseInt(_0x2c7830[_0x5d01be(0x7b)],0xa):undefined,'isVisible':_0x2c7830[_0x5d01be(0x71)]?![]:undefined,'segmentFolderId':_0x3a7950,'countPopulation':_0x2c7830[_0x5d01be(0x78)]?![]:undefined},_0x15601d=await withSpinner('Creating\x20segment\x20\x27'+_0xedc836+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x6f)](_0xd33ba6,_0x1e8aa1),{'verbose':_0x2c7830[_0x5d01be(0x7f)]}),_0x44ed0a=_0x15601d['data'];return console['error'](_0x5d01be(0x79)+_0x44ed0a[_0x5d01be(0x96)]+_0x5d01be(0x8c)+_0x44ed0a['id']),_0x1dc459!==_0x48d154&&console[_0x5d01be(0x82)](_0x5d01be(0x6c)+_0x1dc459),await handleSDKOutput([_0x44ed0a],_0x2c7830),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x43c92d=a25_0xca2a;function a25_0xca2a(_0xa0095d,_0x37ab4a){const _0x5a911d=a25_0x5a91();return a25_0xca2a=function(_0xca2a5b,_0x23ce8){_0xca2a5b=_0xca2a5b-0x122;let _0x35a1e0=_0x5a911d[_0xca2a5b];return _0x35a1e0;},a25_0xca2a(_0xa0095d,_0x37ab4a);}(function(_0x4f7ed3,_0x479622){const _0x2c599d=a25_0xca2a,_0x43f235=_0x4f7ed3();while(!![]){try{const _0x7f1eaf=parseInt(_0x2c599d(0x137))/0x1+parseInt(_0x2c599d(0x123))/0x2*(-parseInt(_0x2c599d(0x12a))/0x3)+-parseInt(_0x2c599d(0x131))/0x4*(-parseInt(_0x2c599d(0x127))/0x5)+-parseInt(_0x2c599d(0x125))/0x6+-parseInt(_0x2c599d(0x129))/0x7+-parseInt(_0x2c599d(0x12e))/0x8+parseInt(_0x2c599d(0x136))/0x9;if(_0x7f1eaf===_0x479622)break;else _0x43f235['push'](_0x43f235['shift']());}catch(_0x438f33){_0x43f235['push'](_0x43f235['shift']());}}}(a25_0x5a91,0x6378c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a25_0x43c92d(0x12b);[a25_0x43c92d(0x126)]=a25_0x43c92d(0x128);async[a25_0x43c92d(0x132)](_0xd4a55d){const _0x5f74fc=a25_0x43c92d,{options:_0x175aec,args:_0x363946,tdx:_0x13d524}=_0xd4a55d;if(_0x363946[_0x5f74fc(0x12c)]===0x0)return console[_0x5f74fc(0x12f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x5f74fc(0x130)),0x1;const _0x52c26f=_0x363946[0x0];_0x175aec[_0x5f74fc(0x122)]&&(console[_0x5f74fc(0x12f)](_0x5f74fc(0x134)+_0x175aec['site']),console['error']('Parent\x20segment:\x20'+_0x52c26f));const _0x1ae501=await withSpinner(_0x5f74fc(0x124)+_0x52c26f+'\x27...',()=>_0x13d524[_0x5f74fc(0x135)]['listFields'](_0x52c26f),{'verbose':_0x175aec['verbose']}),_0x3e2c38=_0x1ae501[_0x5f74fc(0x12d)];return console[_0x5f74fc(0x12f)](_0x5f74fc(0x133)+_0x3e2c38[_0x5f74fc(0x12c)]+'\x20field'+(_0x3e2c38[_0x5f74fc(0x12c)]!==0x1?'s':'')),await handleSDKOutput(_0x3e2c38,_0x175aec),0x0;}}function a25_0x5a91(){const _0x2c6791=['538454bMEApu','3acOrml','segment:fields','length','data','5166552SsbfIu','error','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','360uwLJLG','execute','✔\x20Found\x20','Site:\x20','segment','9324036XUsOba','326984anGfcx','verbose','984564yoHziU','Listing\x20fields\x20for\x20\x27','287274eauQXP','description','17075TYqvea','List\x20available\x20fields\x20for\x20segmentation'];a25_0x5a91=function(){return _0x2c6791;};return a25_0x5a91();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x59b2e1=a26_0x1406;function a26_0x1406(_0x31620e,_0x4d92db){const _0x34d355=a26_0x34d3();return a26_0x1406=function(_0x1406f1,_0x290925){_0x1406f1=_0x1406f1-0x13e;let _0xe95d90=_0x34d355[_0x1406f1];return _0xe95d90;},a26_0x1406(_0x31620e,_0x4d92db);}(function(_0x351f12,_0x17e57e){const _0x17e786=a26_0x1406,_0x238cac=_0x351f12();while(!![]){try{const _0x4ab661=-parseInt(_0x17e786(0x14d))/0x1+parseInt(_0x17e786(0x13e))/0x2+-parseInt(_0x17e786(0x152))/0x3*(-parseInt(_0x17e786(0x146))/0x4)+parseInt(_0x17e786(0x14c))/0x5+-parseInt(_0x17e786(0x149))/0x6+-parseInt(_0x17e786(0x14b))/0x7*(parseInt(_0x17e786(0x151))/0x8)+parseInt(_0x17e786(0x150))/0x9;if(_0x4ab661===_0x17e57e)break;else _0x238cac['push'](_0x238cac['shift']());}catch(_0xc2ffbe){_0x238cac['push'](_0x238cac['shift']());}}}(a26_0x34d3,0x89eb9));import{BaseCommand}from'./command.js';function a26_0x34d3(){const _0x6bb374=['2346720PMMwCg','341359xvcPHw','execute','\x20\x20Path:\x20','14872338BiyYkB','8oscIuc','18dvbyAT','658292DQnmjH','json','log','error','stringify','format','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','description','398572uxabCJ','Context\x20details:','Show\x20current\x20segment/folder\x20context','6618006TUgvwi','jsonl','7276843PaIjZf'];a26_0x34d3=function(){return _0x6bb374;};return a26_0x34d3();}export class SegmentPwdCommand extends BaseCommand{['name']='segment:pwd';[a26_0x59b2e1(0x145)]=a26_0x59b2e1(0x148);async[a26_0x59b2e1(0x14e)](_0xd859b1){const _0x57d617=a26_0x59b2e1,{options:_0x49a56e}=_0xd859b1;try{const _0x4db1ba=_0x49a56e['segmentPath'];if(!_0x4db1ba)return _0x49a56e[_0x57d617(0x143)]===_0x57d617(0x13f)||_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x14a)?console[_0x57d617(0x140)](JSON[_0x57d617(0x142)]({'path':'/','type':'root'})):console[_0x57d617(0x140)]('/'),0x0;if(_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x13f)||_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x14a)){const _0x528c95={'path':_0x4db1ba};console[_0x57d617(0x140)](JSON[_0x57d617(0x142)](_0x528c95));}else console[_0x57d617(0x140)](_0x4db1ba),_0x49a56e['verbose']&&(console[_0x57d617(0x141)](''),console[_0x57d617(0x141)](_0x57d617(0x147)),console[_0x57d617(0x141)](_0x57d617(0x14f)+_0x4db1ba),console['error'](''),console[_0x57d617(0x141)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x57d617(0x141)](_0x57d617(0x144)));return 0x0;}catch(_0x213782){throw _0x213782;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x345b10=a27_0x1e3d;(function(_0x13622e,_0x5d642a){const _0x50b126=a27_0x1e3d,_0x57fb90=_0x13622e();while(!![]){try{const _0x334027=-parseInt(_0x50b126(0xd7))/0x1+-parseInt(_0x50b126(0xe5))/0x2+-parseInt(_0x50b126(0xd5))/0x3+-parseInt(_0x50b126(0xe3))/0x4+-parseInt(_0x50b126(0xef))/0x5*(parseInt(_0x50b126(0xdb))/0x6)+-parseInt(_0x50b126(0xf3))/0x7+parseInt(_0x50b126(0xf4))/0x8*(parseInt(_0x50b126(0xd4))/0x9);if(_0x334027===_0x5d642a)break;else _0x57fb90['push'](_0x57fb90['shift']());}catch(_0x56136d){_0x57fb90['push'](_0x57fb90['shift']());}}}(a27_0xdfb6,0xabbec));function a27_0x1e3d(_0xb737ff,_0x526a3){const _0xdfb60=a27_0xdfb6();return a27_0x1e3d=function(_0x1e3da8,_0x5038bc){_0x1e3da8=_0x1e3da8-0xcb;let _0x14ce1d=_0xdfb60[_0x1e3da8];return _0x14ce1d;},a27_0x1e3d(_0xb737ff,_0x526a3);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0x345b10(0xea);[a27_0x345b10(0xf9)]=a27_0x345b10(0xcf);async[a27_0x345b10(0xe9)](_0x4799b8){const _0x175041=a27_0x345b10,{options:_0x1070cf,args:_0x1d5952,tdx:_0x6c8303}=_0x4799b8,_0x23c0b=_0x1070cf;if(_0x1d5952[_0x175041(0xfc)]===0x0)return console[_0x175041(0xd3)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x175041(0xd3)](_0x175041(0xf8)),console['error'](_0x175041(0xde)),console[_0x175041(0xd3)](_0x175041(0xdf)),console[_0x175041(0xd3)](_0x175041(0xf2)),0x1;const _0x111915=_0x1d5952[0x0],_0x14b051=_0x1070cf[_0x175041(0xda)];let _0x75d171=_0x111915;_0x14b051&&!_0x111915[_0x175041(0xe6)]('/')&&(_0x75d171=_0x14b051+'/'+_0x111915,_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xd6)+_0x75d171));const _0x3516d9=await withSpinner(_0x175041(0xf0)+_0x75d171+_0x175041(0xe1),()=>_0x6c8303['segment'][_0x175041(0xce)](_0x75d171),{'verbose':_0x23c0b[_0x175041(0xdd)]}),_0x5a85d6=_0x3516d9['data'];_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xcb)+_0x5a85d6[_0x175041(0xf7)]);if(_0x5a85d6[_0x175041(0xf7)]!=='segment')return console['error'](_0x175041(0xd0)+_0x5a85d6['type']+_0x175041(0xe0)),console[_0x175041(0xd3)](_0x175041(0xf1)),0x1;if(!_0x5a85d6[_0x175041(0xcc)])throw new SDKError(ErrorCode[_0x175041(0xd9)],_0x175041(0xf6));const _0x2cdad6=_0x5a85d6['parentId'],_0x4903de=_0x5a85d6[_0x175041(0xcc)];_0x23c0b['verbose']&&(console[_0x175041(0xd3)](_0x175041(0xdc)+_0x2cdad6),console[_0x175041(0xd3)](_0x175041(0xed)+_0x4903de));let _0x4ce3e9;if(_0x23c0b['folder']){const _0x2497dd=_0x23c0b[_0x175041(0xd8)],_0x3212cd=await withSpinner(_0x175041(0xf5)+_0x2497dd+_0x175041(0xe1),()=>_0x6c8303[_0x175041(0xfa)][_0x175041(0xe8)](_0x2cdad6,_0x2497dd),{'verbose':_0x23c0b[_0x175041(0xdd)]});_0x4ce3e9=parseInt(_0x3212cd[_0x175041(0xfb)],0xa),_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xeb)+_0x4ce3e9);}const _0x3654f0=await loadJSONFromOptions(_0x23c0b[_0x175041(0xe7)],_0x23c0b['ruleFile']),_0x1ca825={'name':_0x23c0b[_0x175041(0xec)],'description':_0x23c0b[_0x175041(0xf9)],'rule':_0x3654f0,'kind':_0x23c0b[_0x175041(0xd1)]!==undefined?parseInt(_0x23c0b['kind'],0xa):undefined,'segmentFolderId':_0x4ce3e9},_0x2273a8=await withSpinner(_0x175041(0xe4)+_0x5a85d6[_0x175041(0xee)]+_0x175041(0xe1),()=>_0x6c8303['segment'][_0x175041(0xd2)](_0x2cdad6,_0x4903de,_0x1ca825),{'verbose':_0x23c0b[_0x175041(0xdd)]}),_0x5331de=_0x2273a8[_0x175041(0xfb)];return console['error'](_0x175041(0xe2)+_0x5331de['name']+'\x27'),_0x75d171!==_0x111915&&console[_0x175041(0xd3)](_0x175041(0xcd)+_0x75d171),await handleSDKOutput([_0x5331de],_0x23c0b),0x0;}}function a27_0xdfb6(){const _0x5679a5=['updateSegmentById','error','117aSPTVA','2912157ZLCWUn','Resolved\x20relative\x20path\x20to:\x20','778631cWgTrI','folder','INTERNAL','segmentPath','1848IrKWgW','Parent\x20ID:\x20','verbose','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x27...','✔\x20Updated\x20segment\x20\x27','1958012JkGikq','Updating\x20segment\x20\x27','702246SIWCFy','includes','rule','resolveFolderId','execute','segment:update','Resolved\x20folder\x20ID:\x20','name','Segment\x20ID:\x20','segmentName','12785GdHrbP','Resolving\x20path\x20\x27','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1409583oEEotX','2635304RWuFgI','Resolving\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','description','segment','data','length','Resolved\x20type:\x20','segmentId','\x20\x20\x20Path:\x20','resolvePathToResource','Update\x20existing\x20child\x20segment','Error:\x20Cannot\x20update\x20','kind'];a27_0xdfb6=function(){return _0x5679a5;};return a27_0xdfb6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x434dc4=a28_0x37f1;(function(_0x12274b,_0x3981f1){const _0x489874=a28_0x37f1,_0x47ada6=_0x12274b();while(!![]){try{const _0x42c5c0=-parseInt(_0x489874(0x78))/0x1*(-parseInt(_0x489874(0x95))/0x2)+parseInt(_0x489874(0x83))/0x3*(parseInt(_0x489874(0x72))/0x4)+parseInt(_0x489874(0x67))/0x5+parseInt(_0x489874(0x68))/0x6*(parseInt(_0x489874(0x6e))/0x7)+parseInt(_0x489874(0x71))/0x8*(parseInt(_0x489874(0x80))/0x9)+parseInt(_0x489874(0x69))/0xa*(-parseInt(_0x489874(0x66))/0xb)+parseInt(_0x489874(0x94))/0xc*(-parseInt(_0x489874(0x86))/0xd);if(_0x42c5c0===_0x3981f1)break;else _0x47ada6['push'](_0x47ada6['shift']());}catch(_0x462f70){_0x47ada6['push'](_0x47ada6['shift']());}}}(a28_0x4b49,0xc423e));function a28_0x37f1(_0x55ff9e,_0x3a5d67){const _0x4b49e8=a28_0x4b49();return a28_0x37f1=function(_0x37f195,_0x4d6615){_0x37f195=_0x37f195-0x64;let _0x218158=_0x4b49e8[_0x37f195];return _0x218158;},a28_0x37f1(_0x55ff9e,_0x3a5d67);}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']=a28_0x434dc4(0x6f);[a28_0x434dc4(0x99)]=a28_0x434dc4(0x8d);async[a28_0x434dc4(0x85)](_0x48ec6b){const _0x1d2301=a28_0x434dc4,{options:_0x465a27,args:_0x340f00,tdx:_0x252539}=_0x48ec6b;if(_0x340f00[_0x1d2301(0x65)]===0x0)return console[_0x1d2301(0x93)](_0x1d2301(0x7b)),console['error'](_0x1d2301(0x7a)),console['error']('Examples:'),console[_0x1d2301(0x93)](_0x1d2301(0x70)),console[_0x1d2301(0x93)](_0x1d2301(0x89)),console[_0x1d2301(0x93)](_0x1d2301(0x7d)),console[_0x1d2301(0x93)](_0x1d2301(0x8c)),0x1;const _0x3bf99f=_0x340f00[0x0],_0x3ab212=_0x465a27['session'];try{if(_0x3bf99f==='/')return saveSessionContext({'segment_path':undefined},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x97)),0x0;const _0x13de47=_0x465a27[_0x1d2301(0x76)];let _0x5dfec1=_0x3bf99f;const _0x45e030=parsePath(_0x3bf99f);if(!_0x45e030[_0x1d2301(0x88)]){if(!_0x13de47)return console[_0x1d2301(0x93)](_0x1d2301(0x77)),console[_0x1d2301(0x93)](_0x1d2301(0x8b)),0x1;if(_0x3bf99f==='..'){const _0x4ab308=_0x13de47[_0x1d2301(0x6b)]('/')[_0x1d2301(0x8a)](0x0,-0x1)[_0x1d2301(0x91)]('/');_0x5dfec1=_0x4ab308||'/';}else _0x3bf99f==='.'?_0x5dfec1=_0x13de47:_0x5dfec1=_0x13de47+'/'+_0x3bf99f;_0x465a27[_0x1d2301(0x92)]&&console[_0x1d2301(0x93)](_0x1d2301(0x90)+_0x5dfec1);}if(_0x5dfec1==='/'||_0x5dfec1==='')return saveSessionContext({'segment_path':undefined},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x97)),0x0;_0x5dfec1=normalizePath(_0x5dfec1);const _0x3b4988=parsePath(_0x5dfec1)['segments'];if(_0x3b4988['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3ab212),console['log'](_0x1d2301(0x97)),0x0;_0x465a27[_0x1d2301(0x92)]&&(console[_0x1d2301(0x93)]('Site:\x20'+_0x465a27[_0x1d2301(0x7c)]),console[_0x1d2301(0x93)](_0x1d2301(0x84)+_0x5dfec1));const _0x48fd53=await withSpinner(_0x1d2301(0x7e)+_0x5dfec1+_0x1d2301(0x8e),()=>_0x252539[_0x1d2301(0x79)][_0x1d2301(0x82)](_0x5dfec1),{'verbose':_0x465a27[_0x1d2301(0x92)]}),_0x37ef4f=_0x48fd53['data'];_0x465a27[_0x1d2301(0x92)]&&(console[_0x1d2301(0x93)](_0x1d2301(0x98)+_0x37ef4f['type']),console['error'](_0x1d2301(0x74)+_0x37ef4f['parentId']),_0x37ef4f[_0x1d2301(0x87)]&&console[_0x1d2301(0x93)]('Folder\x20ID:\x20'+_0x37ef4f[_0x1d2301(0x87)]));if(_0x37ef4f[_0x1d2301(0x8f)]===_0x1d2301(0x79))return console[_0x1d2301(0x93)](_0x1d2301(0x64)),console[_0x1d2301(0x93)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x1d2301(0x93)](_0x1d2301(0x73)+_0x37ef4f['parentName']+(_0x37ef4f['folderPath']?'/'+_0x37ef4f[_0x1d2301(0x6a)][_0x1d2301(0x91)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x37ef4f[_0x1d2301(0x81)],'parent_segment':_0x37ef4f[_0x1d2301(0x75)]},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x96)+_0x37ef4f[_0x1d2301(0x81)]),_0x465a27[_0x1d2301(0x92)]&&(console['error']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context'),console['error'](_0x1d2301(0x6c)),console['error'](_0x1d2301(0x7f))),0x0;}catch(_0x50f782){throw _0x50f782;}}}function a28_0x4b49(){const _0xfd9084=['11035277iVhBSG','6479280mlGYGf','6gdGaXo','10MjOHOH','folderPath','split','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','log','4081609TBQGTb','segment:use','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','16PiRNzy','4OnxqfW','Use:\x20tdx\x20segment\x20use\x20','Parent\x20ID:\x20','parentName','segmentPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','668611AuQaCU','segment','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20Path\x20is\x20required','site','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolving\x20path\x20\x27','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','2778129HnNAQM','fullPath','resolvePathToResource','1427577JKcRQV','Target\x20path:\x20','execute','23844314irBRwC','folderId','isAbsolute','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','slice','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x27...','type','Resolved\x20relative\x20path\x20to:\x20','join','verbose','error','12PGbmuB','2ytyaNg','Context\x20set\x20to:\x20','Context\x20cleared.\x20Back\x20to\x20root.','Resolved\x20path\x20type:\x20','description','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','length'];a28_0x4b49=function(){return _0xfd9084;};return a28_0x4b49();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a29_0x2d727a=a29_0x32d5;(function(_0x4b8ac8,_0x1e1069){const _0x2af43c=a29_0x32d5,_0xd02276=_0x4b8ac8();while(!![]){try{const _0x120197=parseInt(_0x2af43c(0xd3))/0x1*(-parseInt(_0x2af43c(0x103))/0x2)+parseInt(_0x2af43c(0xca))/0x3*(-parseInt(_0x2af43c(0xbe))/0x4)+-parseInt(_0x2af43c(0xc4))/0x5+-parseInt(_0x2af43c(0xd5))/0x6+-parseInt(_0x2af43c(0xda))/0x7*(parseInt(_0x2af43c(0xf5))/0x8)+-parseInt(_0x2af43c(0x104))/0x9+parseInt(_0x2af43c(0xc0))/0xa*(parseInt(_0x2af43c(0xf7))/0xb);if(_0x120197===_0x1e1069)break;else _0xd02276['push'](_0xd02276['shift']());}catch(_0x37d4a4){_0xd02276['push'](_0xd02276['shift']());}}}(a29_0x46b8,0xd9033));import{BaseCommand}from'./command.js';function a29_0x46b8(){const _0x397f6d=['50490VuDqlO','test','length','filter','recursive','\x20segment','384342UjVLwA','site','verbose','Listing\x20parent\x20segments...','👥\x20','\x20folder','name','jsonl','listParents','1bMbdzE','map','8778090idbHyP','sort','folder','✔\x20Found\x20','message','4305mSMgWL','Listing\x20parent\x20segments\x20matching\x20\x27','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','log','maxDepth','Error:\x20','Listing\x20folders\x20and\x20segments...','description','replace','\x20top-level\x20items','Resolving\x20context\x20path\x20\x27','cause','\x5c$&','\x20and\x20','Path/pattern\x20arg:\x20','Parent\x20ID:\x20','execute','\x27...','data','json','segments','(empty)','segment','format','segmentPath','resolvePathToResource','No\x20parent\x20segments\x20match\x20pattern:\x20','1128RHxImR','population','44eEpXyU','Current\x20context:\x20','\x20\x20Cause:\x20','Building\x20hierarchy\x20tree...','✔\x20Built\x20tree\x20with\x20','Site:\x20','localeCompare','listUnified','attributes','folderId','dim','includes','1257586sxrXiS','739044wTEMmJ','parentId','error','listRecursive','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','16tNwjkB','[parent\x20segments]','9180190zszPYC','Folder\x20ID:\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','\x20parent\x20segment'];a29_0x46b8=function(){return _0x397f6d;};return a29_0x46b8();}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';function a29_0x32d5(_0x21d354,_0x5d1924){const _0x46b8a6=a29_0x46b8();return a29_0x32d5=function(_0x32d552,_0x414abb){_0x32d552=_0x32d552-0xbd;let _0x5a6c49=_0x46b8a6[_0x32d552];return _0x5a6c49;},a29_0x32d5(_0x21d354,_0x5d1924);}import{formatRows}from'../utils/formatters.js';import a29_0x547f0a from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x2d727a(0xd0)]=a29_0x2d727a(0xee);[a29_0x2d727a(0xe1)]=a29_0x2d727a(0xc2);async[a29_0x2d727a(0xea)](_0xd1135f){const _0x3b8397=a29_0x2d727a,{options:_0x3a62be,args:_0x4ca2ff}=_0xd1135f,_0x44ef8b=_0x3a62be[_0x3b8397(0xc8)],_0x182cb9=_0x4ca2ff[0x0];try{const _0x37fa00=_0x3a62be[_0x3b8397(0xf2)];_0x3a62be[_0x3b8397(0xcc)]&&(console[_0x3b8397(0x106)](_0x3b8397(0xfc)+_0x3a62be[_0x3b8397(0xcb)]),console[_0x3b8397(0x106)](_0x3b8397(0xf8)+(_0x37fa00||'/')),_0x182cb9&&console['error'](_0x3b8397(0xe8)+_0x182cb9),_0x44ef8b&&console[_0x3b8397(0x106)]('Recursive\x20mode:\x20enabled'));if(_0x182cb9){const _0x2d651a=_0x182cb9[_0x3b8397(0x102)]('*')||_0x182cb9['includes']('?');if(_0x2d651a&&!_0x37fa00)return await this['listParentsWithPattern'](_0xd1135f,_0x182cb9);else return _0x2d651a?(console[_0x3b8397(0x106)](_0x3b8397(0xdc)),console[_0x3b8397(0x106)](_0x3b8397(0xbd)),0x1):_0x44ef8b?await this[_0x3b8397(0x107)](_0xd1135f,_0x182cb9):await this['listUnified'](_0xd1135f,_0x182cb9);}if(!_0x37fa00)return await this[_0x3b8397(0xd2)](_0xd1135f);return _0x44ef8b?await this[_0x3b8397(0x107)](_0xd1135f,_0x37fa00):await this['listUnified'](_0xd1135f,_0x37fa00);}catch(_0x2cddc3){if(_0x2cddc3 instanceof SDKError)return console[_0x3b8397(0x106)](_0x3b8397(0xdf)+_0x2cddc3[_0x3b8397(0xd9)]),_0x2cddc3[_0x3b8397(0xe5)]&&console[_0x3b8397(0x106)](_0x3b8397(0xf9)+_0x2cddc3['cause']),0x1;throw _0x2cddc3;}}async['listParentsWithPattern'](_0x525e1b,_0x13b428){const _0x55226e=a29_0x2d727a,{options:_0x3b3681,tdx:_0x6f8719}=_0x525e1b,_0x4a0fdd=await withSpinner(_0x55226e(0xdb)+_0x13b428+'\x27...',()=>_0x6f8719[_0x55226e(0xf0)][_0x55226e(0xd2)](),{'verbose':_0x3b3681[_0x55226e(0xcc)]}),_0x25e590=_0x4a0fdd['data'],_0x46736e=_0x13b428['replace'](/[.+^${}()|[\]\\]/g,_0x55226e(0xe6))[_0x55226e(0xe2)](/\*/g,'.*')[_0x55226e(0xe2)](/\?/g,'.'),_0x592b84=new RegExp('^'+_0x46736e+'$','i'),_0x461599=_0x25e590[_0x55226e(0xc7)](_0x406fb8=>_0x592b84[_0x55226e(0xc5)](_0x406fb8[_0x55226e(0xff)][_0x55226e(0xd0)]));console[_0x55226e(0x106)](_0x55226e(0xd8)+_0x461599['length']+_0x55226e(0xc3)+(_0x461599[_0x55226e(0xc6)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x13b428+'\x27');if(_0x3b3681['format']===_0x55226e(0xed)||_0x3b3681[_0x55226e(0xf1)]===_0x55226e(0xd1))await handleSDKOutput(_0x461599,_0x3b3681);else{if(_0x461599[_0x55226e(0xc6)]===0x0)console[_0x55226e(0xdd)](_0x55226e(0xf4)+_0x13b428);else{console['log'](_0x55226e(0xbf));for(const _0x358778 of _0x461599){const _0x490cba=_0x358778[_0x55226e(0xff)][_0x55226e(0xf6)]?a29_0x547f0a[_0x55226e(0x101)]('\x20('+formatRows(_0x358778[_0x55226e(0xff)][_0x55226e(0xf6)])+')'):'';console[_0x55226e(0xdd)](_0x55226e(0xce)+_0x358778['attributes'][_0x55226e(0xd0)]+_0x490cba);}}}return 0x0;}async[a29_0x2d727a(0xd2)](_0x3393bb){const _0x47b7a7=a29_0x2d727a,{options:_0x139af4,tdx:_0x39a223}=_0x3393bb,_0x4c367a=await withSpinner(_0x47b7a7(0xcd),()=>_0x39a223[_0x47b7a7(0xf0)][_0x47b7a7(0xd2)](),{'verbose':_0x139af4['verbose']}),_0x5404d0=_0x4c367a['data'];console['error'](_0x47b7a7(0xd8)+_0x5404d0[_0x47b7a7(0xc6)]+'\x20parent\x20segment'+(_0x5404d0[_0x47b7a7(0xc6)]!==0x1?'s':''));if(_0x139af4[_0x47b7a7(0xf1)]===_0x47b7a7(0xed)||_0x139af4[_0x47b7a7(0xf1)]===_0x47b7a7(0xd1))await handleSDKOutput(_0x5404d0,_0x139af4);else{console[_0x47b7a7(0xdd)]('[parent\x20segments]');for(const _0x4ea71e of _0x5404d0){const _0xdab95d=_0x4ea71e['attributes'][_0x47b7a7(0xf6)]?a29_0x547f0a[_0x47b7a7(0x101)]('\x20('+formatRows(_0x4ea71e[_0x47b7a7(0xff)][_0x47b7a7(0xf6)])+')'):'';console[_0x47b7a7(0xdd)](_0x47b7a7(0xce)+_0x4ea71e[_0x47b7a7(0xff)][_0x47b7a7(0xd0)]+_0xdab95d);}}return 0x0;}async[a29_0x2d727a(0xfe)](_0x59d890,_0x4f5120){const _0x1ba0bc=a29_0x2d727a,{options:_0x1e462e,tdx:_0x43a40d}=_0x59d890,_0x37f54b=await withSpinner(_0x1ba0bc(0xe4)+_0x4f5120+_0x1ba0bc(0xeb),()=>_0x43a40d['segment'][_0x1ba0bc(0xf3)](_0x4f5120),{'verbose':_0x1e462e['verbose']}),_0x3f474f=_0x37f54b[_0x1ba0bc(0xec)];_0x1e462e['verbose']&&(console[_0x1ba0bc(0x106)](_0x1ba0bc(0xe9)+_0x3f474f[_0x1ba0bc(0x105)]),_0x3f474f['folderId']&&console['error'](_0x1ba0bc(0xc1)+_0x3f474f[_0x1ba0bc(0x100)]));const _0xf47cf9=await withSpinner(_0x1ba0bc(0xe0),()=>_0x43a40d[_0x1ba0bc(0xf0)]['listUnified'](_0x3f474f[_0x1ba0bc(0x105)],_0x3f474f['folderId']),{'verbose':_0x1e462e[_0x1ba0bc(0xcc)]}),{folders:_0x5a3a4c,segments:_0x28a49d}=_0xf47cf9[_0x1ba0bc(0xec)],_0x445898=_0x5a3a4c[_0x1ba0bc(0xc6)]+_0x28a49d[_0x1ba0bc(0xc6)];console[_0x1ba0bc(0x106)](_0x1ba0bc(0xd8)+_0x5a3a4c[_0x1ba0bc(0xc6)]+_0x1ba0bc(0xcf)+(_0x5a3a4c['length']!==0x1?'s':'')+_0x1ba0bc(0xe7)+_0x28a49d[_0x1ba0bc(0xc6)]+_0x1ba0bc(0xc9)+(_0x28a49d[_0x1ba0bc(0xc6)]!==0x1?'s':''));if(_0x1e462e[_0x1ba0bc(0xf1)]==='json'||_0x1e462e[_0x1ba0bc(0xf1)]===_0x1ba0bc(0xd1)){const _0x29318d=[..._0x5a3a4c['map'](_0x50b538=>({..._0x50b538,'type':_0x1ba0bc(0xd7)})),..._0x28a49d[_0x1ba0bc(0xd4)](_0x4970a2=>({..._0x4970a2,'type':_0x1ba0bc(0xf0)}))][_0x1ba0bc(0xd6)]((_0x4eb8ed,_0x492479)=>_0x4eb8ed[_0x1ba0bc(0xd0)][_0x1ba0bc(0xfd)](_0x492479['name']));await handleSDKOutput(_0x29318d,_0x1e462e);}else{if(_0x445898===0x0)console[_0x1ba0bc(0xdd)](a29_0x547f0a['dim']('[/'+_0x4f5120+']')),console[_0x1ba0bc(0xdd)](_0x1ba0bc(0xef));else{console['log'](a29_0x547f0a['dim']('[/'+_0x4f5120+']'));const _0x2c5b0e=formatFlatList(_0x5a3a4c,_0x28a49d,{'showMetadata':!![]});console['log'](_0x2c5b0e);}}return 0x0;}async[a29_0x2d727a(0x107)](_0x41a87c,_0x58188c){const _0x44ff96=a29_0x2d727a,{options:_0x25b2ac,tdx:_0x38ec0e}=_0x41a87c,_0xf8e90b=await withSpinner(_0x44ff96(0xe4)+_0x58188c+'\x27...',()=>_0x38ec0e[_0x44ff96(0xf0)][_0x44ff96(0xf3)](_0x58188c),{'verbose':_0x25b2ac[_0x44ff96(0xcc)]}),_0x4704c4=_0xf8e90b['data'];_0x25b2ac[_0x44ff96(0xcc)]&&(console[_0x44ff96(0x106)](_0x44ff96(0xe9)+_0x4704c4[_0x44ff96(0x105)]),_0x4704c4[_0x44ff96(0x100)]&&console[_0x44ff96(0x106)](_0x44ff96(0xc1)+_0x4704c4[_0x44ff96(0x100)]));const _0x4b32fb=_0x25b2ac[_0x44ff96(0xde)]||0xa,_0x47c1b8=await withSpinner(_0x44ff96(0xfa),()=>_0x38ec0e['segment'][_0x44ff96(0x107)](_0x4704c4[_0x44ff96(0x105)],_0x4704c4[_0x44ff96(0x100)],0x0,_0x4b32fb),{'verbose':_0x25b2ac[_0x44ff96(0xcc)]}),_0x28700d=_0x47c1b8[_0x44ff96(0xec)];console['error'](_0x44ff96(0xfb)+_0x28700d['length']+_0x44ff96(0xe3));if(_0x25b2ac[_0x44ff96(0xf1)]===_0x44ff96(0xed)||_0x25b2ac[_0x44ff96(0xf1)]===_0x44ff96(0xd1))await handleSDKOutput(_0x28700d,_0x25b2ac);else{console['log'](a29_0x547f0a[_0x44ff96(0x101)]('[/'+_0x58188c+']'));const _0x38a90e=formatTree(_0x28700d,{'showMetadata':!![]});console['log'](_0x38a90e);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x43d28f=a30_0x3bb4;function a30_0x3f00(){const _0x410add=['315tecBOQ','10274960vfVTFI','9oNFoco','catalog','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','limit','query','Limit:\x20','cause','15767700PtjaJA','Querying\x20','✔\x20Retrieved\x20','Site:\x20','Show\x20table\x20contents','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','\x20from\x20','654ctXIBO','validate','showTable','table','72478AKYWDq','108283yVvKtW','1379409jCJSUx','error','...','database','\x20\x20Cause:\x20','Error:\x20','name','show','60212JNnJKx','message','55304469RQrxTb','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Usage:\x20tdx\x20show\x20<database.table>','args','execute','verbose','data','24IjohIX','Database:\x20','description'];a30_0x3f00=function(){return _0x410add;};return a30_0x3f00();}(function(_0x4951cb,_0x803128){const _0x33984d=a30_0x3bb4,_0x4f1074=_0x4951cb();while(!![]){try{const _0x2a8a92=-parseInt(_0x33984d(0xcd))/0x1*(-parseInt(_0x33984d(0xe6))/0x2)+-parseInt(_0x33984d(0xe8))/0x3+parseInt(_0x33984d(0xf0))/0x4*(parseInt(_0x33984d(0xd0))/0x5)+-parseInt(_0x33984d(0xe2))/0x6*(-parseInt(_0x33984d(0xe7))/0x7)+-parseInt(_0x33984d(0xd1))/0x8*(-parseInt(_0x33984d(0xd2))/0x9)+parseInt(_0x33984d(0xd9))/0xa+-parseInt(_0x33984d(0xc6))/0xb;if(_0x2a8a92===_0x803128)break;else _0x4f1074['push'](_0x4f1074['shift']());}catch(_0x354602){_0x4f1074['push'](_0x4f1074['shift']());}}}(a30_0x3f00,0xd651e));import{BaseCommand}from'./command.js';function a30_0x3bb4(_0x2486c2,_0x1254ff){const _0x3f0085=a30_0x3f00();return a30_0x3bb4=function(_0x3bb4fb,_0x9e1444){_0x3bb4fb=_0x3bb4fb-0xc5;let _0xd28f35=_0x3f0085[_0x3bb4fb];return _0xd28f35;},a30_0x3bb4(_0x2486c2,_0x1254ff);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a30_0x43d28f(0xee)]=a30_0x43d28f(0xef);[a30_0x43d28f(0xcf)]=a30_0x43d28f(0xdd);async[a30_0x43d28f(0xca)](_0x5caa81){const _0x239b99=a30_0x43d28f;return this[_0x239b99(0xe4)](_0x5caa81);}async[a30_0x43d28f(0xe4)](_0x147bfb){const _0x1f07e1=a30_0x43d28f,{options:_0x66f908,args:_0x953647,tdx:_0xdaf8a2}=_0x147bfb;let _0x4a6547;try{_0x4a6547=parseTableReference(_0x953647[0x0]);const _0x320f3a=_0x66f908[_0x1f07e1(0xeb)];!_0x4a6547[_0x1f07e1(0xeb)]&&_0x320f3a&&(_0x4a6547[_0x1f07e1(0xeb)]=_0x320f3a);const _0x570bb4=validateTableDescribeReference(_0x4a6547);if(_0x570bb4)return console[_0x1f07e1(0xe9)](_0x1f07e1(0xed)+_0x570bb4),console[_0x1f07e1(0xe9)](_0x1f07e1(0xc8)),console['error'](_0x1f07e1(0xd4)),console['error'](_0x1f07e1(0xde)),0x1;}catch(_0x100d80){return console['error']('Error:\x20'+_0x100d80[_0x1f07e1(0xc5)]),console[_0x1f07e1(0xe9)](_0x1f07e1(0xc8)),console[_0x1f07e1(0xe9)](_0x1f07e1(0xd4)),console['error'](_0x1f07e1(0xde)),0x1;}const _0x3dea45=_0x4a6547[_0x1f07e1(0xd3)],_0x33c144=_0x4a6547[_0x1f07e1(0xeb)],_0x21764b=_0x4a6547[_0x1f07e1(0xe5)],_0x4f3ca6=resolveLimit(_0x66f908[_0x1f07e1(0xd5)],DEFAULT_DISPLAY_LIMIT);try{_0x66f908[_0x1f07e1(0xcb)]&&(console[_0x1f07e1(0xe9)](_0x1f07e1(0xdc)+_0x66f908['site']),_0x3dea45&&console[_0x1f07e1(0xe9)]('Catalog:\x20'+_0x3dea45),console[_0x1f07e1(0xe9)](_0x1f07e1(0xce)+_0x33c144),console[_0x1f07e1(0xe9)]('Table:\x20'+_0x21764b),console[_0x1f07e1(0xe9)](_0x1f07e1(0xd7)+_0x4f3ca6));const _0x3bc7b5=_0x3dea45?_0x3dea45+'.'+_0x33c144+'.'+_0x21764b:_0x33c144+'.'+_0x21764b,_0x2d0e14=await withSpinner(_0x1f07e1(0xda)+_0x3bc7b5+_0x1f07e1(0xea),()=>_0xdaf8a2[_0x1f07e1(0xd6)][_0x1f07e1(0xe4)](_0x33c144,_0x21764b,_0x4f3ca6,_0x3dea45),{'verbose':_0x66f908[_0x1f07e1(0xcb)]}),_0x3a9cc8=_0x2d0e14[_0x1f07e1(0xcc)],_0x35bab2=_0x3a9cc8[_0x1f07e1(0xcc)];return _0x35bab2[_0x1f07e1(0xe0)]===0x0?console[_0x1f07e1(0xe9)](_0x1f07e1(0xc7)):console[_0x1f07e1(0xe9)](_0x1f07e1(0xdb)+_0x35bab2[_0x1f07e1(0xe0)]+'\x20row'+(_0x35bab2[_0x1f07e1(0xe0)]!==0x1?'s':'')+_0x1f07e1(0xe1)+_0x3bc7b5),await handleSDKOutput(_0x35bab2,_0x66f908),0x0;}catch(_0x57e55f){if(_0x57e55f instanceof SDKError)return console[_0x1f07e1(0xe9)]('Error:\x20'+_0x57e55f[_0x1f07e1(0xc5)]),_0x57e55f['cause']&&console[_0x1f07e1(0xe9)](_0x1f07e1(0xec)+_0x57e55f[_0x1f07e1(0xd8)]),0x1;throw _0x57e55f;}}[a30_0x43d28f(0xe3)](_0x30e09c){const _0x13ff48=a30_0x43d28f;if(_0x30e09c[_0x13ff48(0xc9)]['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(_0x30e09c[_0x13ff48(0xc9)][_0x13ff48(0xe0)]>0x1)return _0x13ff48(0xdf);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a31_0x42384c=a31_0x1864;(function(_0x40442f,_0x1f0125){const _0x490d0a=a31_0x1864,_0x24a0b6=_0x40442f();while(!![]){try{const _0x21e392=parseInt(_0x490d0a(0x185))/0x1+parseInt(_0x490d0a(0x17b))/0x2*(parseInt(_0x490d0a(0x176))/0x3)+-parseInt(_0x490d0a(0x174))/0x4*(-parseInt(_0x490d0a(0x169))/0x5)+parseInt(_0x490d0a(0x183))/0x6*(parseInt(_0x490d0a(0x194))/0x7)+-parseInt(_0x490d0a(0x189))/0x8*(-parseInt(_0x490d0a(0x187))/0x9)+-parseInt(_0x490d0a(0x170))/0xa+-parseInt(_0x490d0a(0x193))/0xb*(parseInt(_0x490d0a(0x190))/0xc);if(_0x21e392===_0x1f0125)break;else _0x24a0b6['push'](_0x24a0b6['shift']());}catch(_0x4b59ce){_0x24a0b6['push'](_0x24a0b6['shift']());}}}(a31_0xd63d,0x22b36));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0xd63d(){const _0x10ed19=['includes','name','site','2168UKaIuI','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','62574jIdRRJ','listTables','\x20\x20Cause:\x20','database','message','16FtaUIN','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','data','length','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Database:\x20','\x27\x20across\x20all\x20databases.','verbose','726dcJMeU','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','200668vnvCkc','.*\x22','9cVwYMb','Listing\x20tables...','1697048pUquMx','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','table','cause','Site:\x20','\x27\x20is\x20ambiguous.','Database:\x20all','6792NhfolA','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','tables','11363oOxbLD','8729bqDBfX','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','description','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','execute','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','validate','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Error:\x20','1445KCpvwQ','Note:\x20\x27','\x20table','error','limit','Table\x20pattern:\x20','List\x20tables\x20in\x20a\x20database','1603760NYXigj'];a31_0xd63d=function(){return _0x10ed19;};return a31_0xd63d();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a31_0x1864(_0x259cd4,_0x478bcc){const _0xd63d32=a31_0xd63d();return a31_0x1864=function(_0x186463,_0x546b27){_0x186463=_0x186463-0x161;let _0x4f1396=_0xd63d32[_0x186463];return _0x4f1396;},a31_0x1864(_0x259cd4,_0x478bcc);}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a31_0x42384c(0x172)]=a31_0x42384c(0x192);[a31_0x42384c(0x161)]=a31_0x42384c(0x16f);async[a31_0x42384c(0x163)](_0x4879dc){const _0x410931=a31_0x42384c,{options:_0x4bba7d,args:_0x4f98cf,tdx:_0x59253c}=_0x4879dc;let _0x58b250;if(_0x4f98cf['length']===0x0)_0x58b250={'database':undefined,'table':undefined,'original':''};else{if(_0x4f98cf[_0x410931(0x17e)]===0x1)try{_0x58b250=parseTableReference(_0x4f98cf[0x0]);if(_0x58b250['table']&&!_0x58b250[_0x410931(0x179)]&&!_0x58b250[_0x410931(0x18b)][_0x410931(0x171)]('*')&&!_0x58b250['table']['includes']('?'))return console[_0x410931(0x16c)]('Error:\x20Pattern\x20\x27'+_0x4f98cf[0x0]+_0x410931(0x18e)),console[_0x410931(0x16c)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x58b250[_0x410931(0x18b)]+'\x27?'),console[_0x410931(0x16c)](_0x410931(0x164)+_0x58b250[_0x410931(0x18b)]+_0x410931(0x186)),console[_0x410931(0x16c)](_0x410931(0x191)+_0x58b250[_0x410931(0x18b)]),console['error'](_0x410931(0x17f)+_0x58b250[_0x410931(0x18b)]),console[_0x410931(0x16c)](''),console[_0x410931(0x16c)](_0x410931(0x16a)+_0x4f98cf[0x0]+_0x410931(0x175)+_0x58b250[_0x410931(0x18b)]+_0x410931(0x181)),0x1;}catch(_0x38a6e8){return console[_0x410931(0x16c)](_0x410931(0x168)+_0x38a6e8['message']),0x1;}else return console[_0x410931(0x16c)](_0x410931(0x195)),console['error'](_0x410931(0x18a)),console[_0x410931(0x16c)](_0x410931(0x184)),console[_0x410931(0x16c)](_0x410931(0x17c)),console[_0x410931(0x16c)](_0x410931(0x165)),console[_0x410931(0x16c)]('Or\x20use\x20--in\x20flag:'),console[_0x410931(0x16c)](_0x410931(0x162)),0x1;}const _0x538d2a=_0x4bba7d[_0x410931(0x179)];!_0x58b250[_0x410931(0x179)]&&_0x538d2a&&(_0x58b250[_0x410931(0x179)]=_0x538d2a);try{const _0x330e5e=_0x30da6f=>_0x30da6f&&(_0x30da6f[_0x410931(0x171)]('*')||_0x30da6f[_0x410931(0x171)]('?')),_0x1ce00b=_0x330e5e(_0x58b250[_0x410931(0x179)]);_0x4bba7d['verbose']&&(console['error'](_0x410931(0x18d)+_0x4bba7d[_0x410931(0x173)]),_0x58b250[_0x410931(0x179)]?_0x1ce00b?console[_0x410931(0x16c)]('Database\x20pattern:\x20'+_0x58b250[_0x410931(0x179)]):console['error'](_0x410931(0x180)+_0x58b250[_0x410931(0x179)]):console[_0x410931(0x16c)](_0x410931(0x18f)),_0x58b250['table']&&console[_0x410931(0x16c)](_0x410931(0x16e)+_0x58b250[_0x410931(0x18b)]));const _0x1f47eb=_0x58b250[_0x410931(0x179)]&&!_0x1ce00b?_0x58b250[_0x410931(0x179)]:undefined,_0x2277b3=_0x1ce00b?_0x58b250[_0x410931(0x179)]:undefined,_0x15c02b=_0x58b250[_0x410931(0x18b)],_0x21d9b8=resolveLimit(_0x4bba7d[_0x410931(0x16d)],DEFAULT_LISTING_LIMIT),_0x29bbf3=await withSpinner(_0x410931(0x188),()=>_0x59253c['query'][_0x410931(0x177)](_0x1f47eb,_0x15c02b,_0x2277b3,_0x21d9b8),{'verbose':_0x4bba7d[_0x410931(0x182)]}),_0xe4185e=_0x29bbf3[_0x410931(0x17d)];if(_0xe4185e[_0x410931(0x17e)]===0x0&&_0x58b250['database']&&!_0x1ce00b)return console[_0x410931(0x16c)]('✖\x20No\x20tables\x20found'),console[_0x410931(0x16c)]('Database\x20\x27'+_0x58b250[_0x410931(0x179)]+_0x410931(0x167)),0x1;return console[_0x410931(0x16c)]('✔\x20Found\x20'+_0xe4185e[_0x410931(0x17e)]+_0x410931(0x16b)+(_0xe4185e[_0x410931(0x17e)]!==0x1?'s':'')),await handleSDKOutput(_0xe4185e,{..._0x4bba7d,'limit':_0x21d9b8}),0x0;}catch(_0x974726){if(_0x974726 instanceof SDKError)return console[_0x410931(0x16c)](_0x410931(0x168)+_0x974726[_0x410931(0x17a)]),_0x974726[_0x410931(0x18c)]&&console[_0x410931(0x16c)](_0x410931(0x178)+_0x974726[_0x410931(0x18c)]),0x1;throw _0x974726;}}[a31_0x42384c(0x166)](_0xf1db6a){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x1e2d02=a32_0x25ed;(function(_0x152599,_0xb30cf7){const _0x4d0ba3=a32_0x25ed,_0x27809d=_0x152599();while(!![]){try{const _0x348ed5=-parseInt(_0x4d0ba3(0x145))/0x1*(-parseInt(_0x4d0ba3(0x125))/0x2)+parseInt(_0x4d0ba3(0x12b))/0x3*(parseInt(_0x4d0ba3(0x13d))/0x4)+-parseInt(_0x4d0ba3(0x14a))/0x5*(parseInt(_0x4d0ba3(0x135))/0x6)+-parseInt(_0x4d0ba3(0x146))/0x7+parseInt(_0x4d0ba3(0x132))/0x8+parseInt(_0x4d0ba3(0x137))/0x9*(parseInt(_0x4d0ba3(0x129))/0xa)+parseInt(_0x4d0ba3(0x128))/0xb*(-parseInt(_0x4d0ba3(0x12a))/0xc);if(_0x348ed5===_0xb30cf7)break;else _0x27809d['push'](_0x27809d['shift']());}catch(_0x3b612c){_0x27809d['push'](_0x27809d['shift']());}}}(a32_0x1ef3,0x6b849));import{BaseCommand}from'./command.js';function a32_0x1ef3(){const _0x3cab1f=['\x20(session:\x20','3MvFFzo','4335884kiQBqd','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','error','message','3629870YcXOJc','length','329150rXPMPT','parent_segment','session','22cPsTch','40cHZQfh','1552956vxCVSe','1929813gynFSw','log','Set\x20session-level\x20context','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','includes','llm_project','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','6193224sjRAtB','profile','Session\x20parent_segment\x20set\x20to:\x20','6MBjPPx','toString','300276jUWQgW','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Session\x20profile\x20set\x20to:\x20','database','\x27\x20does\x20not\x20exist','4FCEMCP','Error:\x20','validate','use','name','join','.\x20Must\x20be\x20one\x20of:\x20'];a32_0x1ef3=function(){return _0x3cab1f;};return a32_0x1ef3();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a32_0x25ed(_0x15755f,_0x4bc920){const _0x1ef3aa=a32_0x1ef3();return a32_0x25ed=function(_0x25ed95,_0x29c2cd){_0x25ed95=_0x25ed95-0x125;let _0x4f48af=_0x1ef3aa[_0x25ed95];return _0x4f48af;},a32_0x25ed(_0x15755f,_0x4bc920);}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a32_0x1e2d02(0x141)]=a32_0x1e2d02(0x140);['description']=a32_0x1e2d02(0x12d);[a32_0x1e2d02(0x13f)](_0x22549b){const _0x224565=a32_0x1e2d02,{args:_0x78891e}=_0x22549b;if(_0x78891e[_0x224565(0x14b)]<0x2)return _0x224565(0x138)+_0x224565(0x147)+_0x224565(0x131)+_0x224565(0x139);const _0x318723=_0x78891e[0x0],_0x23ec99=[_0x224565(0x13b),_0x224565(0x126),_0x224565(0x130),'profile'];if(!_0x23ec99[_0x224565(0x12f)](_0x318723))return'Invalid\x20resource:\x20'+_0x318723+_0x224565(0x143)+_0x23ec99[_0x224565(0x142)](',\x20');return undefined;}async['execute'](_0x23f6d9){const _0x4cde9d=a32_0x1e2d02,{args:_0x1ebdd8,options:_0x18a83a}=_0x23f6d9;try{const _0x5cefe1=_0x1ebdd8[0x0],_0x4cd752=_0x1ebdd8[0x1];if(_0x5cefe1===_0x4cde9d(0x133)){if(!profileExists(_0x4cd752))return console['error']('Error:\x20Profile\x20\x27'+_0x4cd752+_0x4cde9d(0x13c)),console[_0x4cde9d(0x148)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x314deb=_0x18a83a[_0x4cde9d(0x127)]||getCurrentSessionPID()[_0x4cde9d(0x136)]();return saveSessionContext({'profile':_0x4cd752},_0x18a83a['session']),console[_0x4cde9d(0x12c)](_0x4cde9d(0x13a)+_0x4cd752+_0x4cde9d(0x144)+_0x314deb+')'),console['log'](_0x4cde9d(0x12e)),0x0;}const _0x16b21a={},_0x4c67c9=_0x18a83a[_0x4cde9d(0x127)]||getCurrentSessionPID()[_0x4cde9d(0x136)]();switch(_0x5cefe1){case'database':_0x16b21a[_0x4cde9d(0x13b)]=_0x4cd752,console[_0x4cde9d(0x12c)]('Session\x20database\x20set\x20to:\x20'+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;case _0x4cde9d(0x126):_0x16b21a[_0x4cde9d(0x126)]=_0x4cd752,console[_0x4cde9d(0x12c)](_0x4cde9d(0x134)+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;case'llm_project':_0x16b21a[_0x4cde9d(0x130)]=_0x4cd752,console[_0x4cde9d(0x12c)]('Session\x20llm_project\x20set\x20to:\x20'+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;}return saveSessionContext(_0x16b21a,_0x18a83a[_0x4cde9d(0x127)]),console[_0x4cde9d(0x12c)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x5c2996){return _0x5c2996 instanceof Error&&console[_0x4cde9d(0x148)](_0x4cde9d(0x13e)+_0x5c2996[_0x4cde9d(0x149)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a33_0x47e5ec=a33_0x11c0;(function(_0x396042,_0x365320){const _0x2075c8=a33_0x11c0,_0x42696c=_0x396042();while(!![]){try{const _0x4ee476=parseInt(_0x2075c8(0x1f5))/0x1+-parseInt(_0x2075c8(0x1e1))/0x2*(-parseInt(_0x2075c8(0x1cc))/0x3)+parseInt(_0x2075c8(0x1b4))/0x4+parseInt(_0x2075c8(0x21d))/0x5+parseInt(_0x2075c8(0x1dd))/0x6*(parseInt(_0x2075c8(0x1eb))/0x7)+-parseInt(_0x2075c8(0x1ed))/0x8+-parseInt(_0x2075c8(0x204))/0x9;if(_0x4ee476===_0x365320)break;else _0x42696c['push'](_0x42696c['shift']());}catch(_0x162c34){_0x42696c['push'](_0x42696c['shift']());}}}(a33_0x5b00,0x9d368));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x5b00(){const _0x5e771a=['\x20attempt','length','cause','fromTask','substring','kill','From\x20task:\x20','Attempt\x20ID:\x20','attempt:','Project\x20directory:\x20','attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x22?\x20This\x20cannot\x20be\x20undone.','workflow:sessions','status','Listing\x20workflow\x20projects...','parse','retrySession','reason','Retrying\x20session...','1749705dxdllv','✔\x20Found\x20','error','download','Killing\x20attempt...','Error:\x20Attempt\x20ID\x20is\x20required','Validation:\x20skipped','workflow:workflows','...','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflow','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','delete','readFile','session:','Error:\x20','List\x20workflows','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20\x20Project\x20ID:\x20','startsWith','message','Listing\x20workflow\x20attempts...','Output\x20directory:\x20','workflow:tasks','workflows','885320udhrMS','\x20project','fs/promises','projectId','Retrying\x20attempt...','data','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Project:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','projects','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Task\x20name:\x20','description','tasks','\x20\x20Session\x20ID:\x20','List\x20workflow\x20attempts','limit','Filter:\x20','Kill\x20a\x20running\x20attempt','Deleting\x20project\x20','includeRetried','sessionId','Show\x20tasks\x20for\x20an\x20attempt','Show\x20logs\x20for\x20a\x20specific\x20task','327lbEzbb','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20session','Project\x20name:\x20','Filter:\x20project=','\x20task','Getting\x20attempt\x20details...','workflow:kill','force','\x20log\x20entr','List\x20workflow\x20execution\x20sessions','from','Project\x20filter:\x20','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Error:\x20Project\x20name\x20is\x20required','workflow:delete','Including\x20subtasks:\x20yes','36108AsLtmI','\x20\x20Cause:\x20','Status:\x20','projectName','8828eebfHx','✔\x20Downloaded\x20','filesExtracted','Params:\x20','Getting\x20attempt\x20tasks...','\x20workflow','Reason:\x20','params','workflow:attempt','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','1127QlEKbg','workflow:projects','1627280wWkgwE','List\x20all\x20workflow\x20projects','yes','verbose','name','✔\x20Pushed\x20','✔\x20Deleted\x20project\x20','session','968352VJWEdw','Cancelled','Revision:\x20','logs','workflow:push','retryAttempt','revision','sessions','attemptId','execute','workflow:logs','attempts','stat','workflow:download','Listing\x20workflow\x20sessions...','19280637TfxsQg','split','\x20\x20Location:\x20','Target:\x20','offset'];a33_0x5b00=function(){return _0x5e771a;};return a33_0x5b00();}import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{['name']=a33_0x47e5ec(0x1ec);[a33_0x47e5ec(0x1c0)]=a33_0x47e5ec(0x1ee);async[a33_0x47e5ec(0x1fe)](_0x51ecb9){const _0x594276=a33_0x47e5ec,{options:_0x3b4b5d,args:_0x47c3b0,tdx:_0x54f2e7}=_0x51ecb9,_0x3b8714=_0x47c3b0[0x0];try{_0x3b4b5d['verbose']&&_0x3b8714&&console[_0x594276(0x21f)]('Pattern:\x20'+_0x3b8714);const _0x2e6413=await withSpinner(_0x594276(0x218),()=>_0x54f2e7[_0x594276(0x227)][_0x594276(0x1bd)](_0x3b8714,{'limit':_0x3b4b5d[_0x594276(0x1c4)]}),{'verbose':_0x3b4b5d[_0x594276(0x1f0)]}),_0x1b215d=_0x2e6413[_0x594276(0x1b9)];return console[_0x594276(0x21f)](_0x594276(0x21e)+_0x1b215d[_0x594276(0x20a)]+_0x594276(0x1b5)+(_0x1b215d[_0x594276(0x20a)]!==0x1?'s':'')),await handleSDKOutput(_0x1b215d,_0x3b4b5d),0x0;}catch(_0x42fbb3){if(_0x42fbb3 instanceof SDKError)return console[_0x594276(0x21f)](_0x594276(0x1aa)+_0x42fbb3['message']),_0x42fbb3['cause']&&console['error']('\x20\x20Cause:\x20'+_0x42fbb3['cause']),0x1;throw _0x42fbb3;}}}export class WorkflowWorkflowsCommand extends BaseCommand{['name']=a33_0x47e5ec(0x224);[a33_0x47e5ec(0x1c0)]=a33_0x47e5ec(0x1ab);async[a33_0x47e5ec(0x1fe)](_0x485698){const _0x374ff1=a33_0x47e5ec,{options:_0x14fc0c,args:_0xbb0606,tdx:_0x2ffb94}=_0x485698,_0x286959=_0xbb0606[0x0];try{_0x14fc0c[_0x374ff1(0x1f0)]&&_0x286959&&console[_0x374ff1(0x21f)](_0x374ff1(0x1d8)+_0x286959);const _0x17823d=await withSpinner('Listing\x20workflows...',()=>_0x2ffb94['workflow'][_0x374ff1(0x1b3)](_0x286959,{'limit':_0x14fc0c[_0x374ff1(0x1c4)]}),{'verbose':_0x14fc0c[_0x374ff1(0x1f0)]}),_0x5f5180=_0x17823d[_0x374ff1(0x1b9)];return console[_0x374ff1(0x21f)](_0x374ff1(0x21e)+_0x5f5180[_0x374ff1(0x20a)]+_0x374ff1(0x1e6)+(_0x5f5180[_0x374ff1(0x20a)]!==0x1?'s':'')),await handleSDKOutput(_0x5f5180,_0x14fc0c),0x0;}catch(_0x5ab76e){if(_0x5ab76e instanceof SDKError)return console['error'](_0x374ff1(0x1aa)+_0x5ab76e['message']),_0x5ab76e[_0x374ff1(0x20b)]&&console['error']('\x20\x20Cause:\x20'+_0x5ab76e['cause']),0x1;throw _0x5ab76e;}}}export class WorkflowSessionsCommand extends BaseCommand{[a33_0x47e5ec(0x1f1)]=a33_0x47e5ec(0x216);['description']=a33_0x47e5ec(0x1d6);async[a33_0x47e5ec(0x1fe)](_0x50e19d){const _0x1d20c9=a33_0x47e5ec,{options:_0x5038fe,args:_0x4bdbfa,tdx:_0x3677fb}=_0x50e19d;let _0xfa24d2,_0x74de72;if(_0x4bdbfa[0x0]){const _0x2520f9=_0x4bdbfa[0x0][_0x1d20c9(0x205)]('.');if(_0x2520f9[_0x1d20c9(0x20a)]===0x1)_0xfa24d2=_0x2520f9[0x0];else{if(_0x2520f9[_0x1d20c9(0x20a)]===0x2)[_0xfa24d2,_0x74de72]=_0x2520f9;else return console[_0x1d20c9(0x21f)](_0x1d20c9(0x1bc)),0x1;}}try{if(_0x5038fe[_0x1d20c9(0x1f0)]){if(_0xfa24d2&&_0x74de72)console[_0x1d20c9(0x21f)]('Filter:\x20'+_0xfa24d2+'.'+_0x74de72);else _0xfa24d2&&console['error'](_0x1d20c9(0x1d0)+_0xfa24d2);const _0xcc41d7=_0x5038fe['status'];_0xcc41d7&&console[_0x1d20c9(0x21f)](_0x1d20c9(0x1df)+_0xcc41d7);}const _0x2ca66b=await withSpinner(_0x1d20c9(0x203),()=>_0x3677fb['workflow'][_0x1d20c9(0x1fc)]({'projectName':_0xfa24d2,'workflowName':_0x74de72,'status':_0x5038fe[_0x1d20c9(0x217)],'fromTime':_0x5038fe[_0x1d20c9(0x1d7)],'toTime':_0x5038fe['to'],'limit':_0x5038fe[_0x1d20c9(0x1c4)]}),{'verbose':_0x5038fe[_0x1d20c9(0x1f0)]}),_0x4fb698=_0x2ca66b['data'];return console[_0x1d20c9(0x21f)](_0x1d20c9(0x21e)+_0x4fb698['length']+_0x1d20c9(0x1ce)+(_0x4fb698[_0x1d20c9(0x20a)]!==0x1?'s':'')),await handleSDKOutput(_0x4fb698,_0x5038fe),0x0;}catch(_0x23d27b){if(_0x23d27b instanceof SDKError)return console[_0x1d20c9(0x21f)](_0x1d20c9(0x1aa)+_0x23d27b[_0x1d20c9(0x1af)]),_0x23d27b[_0x1d20c9(0x20b)]&&console['error'](_0x1d20c9(0x1de)+_0x23d27b[_0x1d20c9(0x20b)]),0x1;throw _0x23d27b;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']='workflow:attempts';[a33_0x47e5ec(0x1c0)]=a33_0x47e5ec(0x1c3);async[a33_0x47e5ec(0x1fe)](_0x48f1d9){const _0x54902b=a33_0x47e5ec,{options:_0x64f6bc,args:_0x3903c0,tdx:_0x2e9d23}=_0x48f1d9;let _0x5e69a6,_0x3ccf6d;if(_0x3903c0[0x0]){const _0x1c2448=_0x3903c0[0x0][_0x54902b(0x205)]('.');if(_0x1c2448[_0x54902b(0x20a)]===0x1)_0x5e69a6=_0x1c2448[0x0];else{if(_0x1c2448[_0x54902b(0x20a)]===0x2)[_0x5e69a6,_0x3ccf6d]=_0x1c2448;else return console['error'](_0x54902b(0x1bc)),0x1;}}try{const _0x2425ea=_0x64f6bc[_0x54902b(0x1c8)];if(_0x64f6bc[_0x54902b(0x1f0)]){if(_0x5e69a6&&_0x3ccf6d)console['error'](_0x54902b(0x1c5)+_0x5e69a6+'.'+_0x3ccf6d);else _0x5e69a6&&console['error']('Filter:\x20project='+_0x5e69a6);_0x2425ea&&console['error']('Include\x20retried:\x20yes');}const _0x3830e7=await withSpinner(_0x54902b(0x1b0),()=>_0x2e9d23['workflow'][_0x54902b(0x200)]({'projectName':_0x5e69a6,'workflowName':_0x3ccf6d,'includeRetried':_0x2425ea,'limit':_0x64f6bc[_0x54902b(0x1c4)]}),{'verbose':_0x64f6bc[_0x54902b(0x1f0)]}),_0x20520b=_0x3830e7[_0x54902b(0x1b9)];return console['error'](_0x54902b(0x21e)+_0x20520b[_0x54902b(0x20a)]+_0x54902b(0x209)+(_0x20520b[_0x54902b(0x20a)]!==0x1?'s':'')),await handleSDKOutput(_0x20520b,_0x64f6bc),0x0;}catch(_0x49abc2){if(_0x49abc2 instanceof SDKError)return console[_0x54902b(0x21f)](_0x54902b(0x1aa)+_0x49abc2['message']),_0x49abc2[_0x54902b(0x20b)]&&console['error']('\x20\x20Cause:\x20'+_0x49abc2[_0x54902b(0x20b)]),0x1;throw _0x49abc2;}}}export class WorkflowAttemptCommand extends BaseCommand{[a33_0x47e5ec(0x1f1)]=a33_0x47e5ec(0x1e9);[a33_0x47e5ec(0x1c0)]='Show\x20specific\x20attempt\x20details';async[a33_0x47e5ec(0x1fe)](_0x5c1c43){const _0x345a64=a33_0x47e5ec,{options:_0x2b8b87,args:_0x227f2d,tdx:_0x3e1224}=_0x5c1c43,_0x1535a0=_0x227f2d[0x0];if(!_0x1535a0)return console['error'](_0x345a64(0x222)),0x1;try{_0x2b8b87[_0x345a64(0x1f0)]&&console[_0x345a64(0x21f)](_0x345a64(0x210)+_0x1535a0);const _0x3950c9=await withSpinner(_0x345a64(0x1d2),()=>_0x3e1224[_0x345a64(0x227)][_0x345a64(0x213)](_0x1535a0),{'verbose':_0x2b8b87[_0x345a64(0x1f0)]}),_0x447e96=_0x3950c9[_0x345a64(0x1b9)];return await handleSDKOutput([_0x447e96],_0x2b8b87),0x0;}catch(_0x42bd64){if(_0x42bd64 instanceof SDKError)return console[_0x345a64(0x21f)](_0x345a64(0x1aa)+_0x42bd64[_0x345a64(0x1af)]),_0x42bd64['cause']&&console['error'](_0x345a64(0x1de)+_0x42bd64[_0x345a64(0x20b)]),0x1;throw _0x42bd64;}}}function a33_0x11c0(_0x58366d,_0x36ce15){const _0x5b00fb=a33_0x5b00();return a33_0x11c0=function(_0x11c0d5,_0x705c98){_0x11c0d5=_0x11c0d5-0x1aa;let _0x18694a=_0x5b00fb[_0x11c0d5];return _0x18694a;},a33_0x11c0(_0x58366d,_0x36ce15);}export class WorkflowTasksCommand extends BaseCommand{['name']=a33_0x47e5ec(0x1b2);[a33_0x47e5ec(0x1c0)]=a33_0x47e5ec(0x1ca);async[a33_0x47e5ec(0x1fe)](_0x2c2591){const _0x28ed27=a33_0x47e5ec,{options:_0xa1d50,args:_0x3cc29b,tdx:_0x2442a7}=_0x2c2591,_0x3e9e83=_0x3cc29b[0x0];if(!_0x3e9e83)return console[_0x28ed27(0x21f)](_0x28ed27(0x222)),0x1;try{const _0x27e66a=_0xa1d50['includeSubtasks'];_0xa1d50[_0x28ed27(0x1f0)]&&(console['error'](_0x28ed27(0x210)+_0x3e9e83),_0x27e66a&&console[_0x28ed27(0x21f)](_0x28ed27(0x1dc)));const _0x4b094b=await withSpinner(_0x28ed27(0x1e5),()=>_0x2442a7['workflow'][_0x28ed27(0x1c1)](_0x3e9e83,_0x27e66a||![]),{'verbose':_0xa1d50[_0x28ed27(0x1f0)]}),_0x1f39d1=_0x4b094b[_0x28ed27(0x1b9)];return console[_0x28ed27(0x21f)](_0x28ed27(0x21e)+_0x1f39d1[_0x28ed27(0x20a)]+_0x28ed27(0x1d1)+(_0x1f39d1['length']!==0x1?'s':'')),await handleSDKOutput(_0x1f39d1,_0xa1d50),0x0;}catch(_0x435f4e){if(_0x435f4e instanceof SDKError)return console[_0x28ed27(0x21f)]('Error:\x20'+_0x435f4e[_0x28ed27(0x1af)]),_0x435f4e['cause']&&console[_0x28ed27(0x21f)]('\x20\x20Cause:\x20'+_0x435f4e['cause']),0x1;throw _0x435f4e;}}}export class WorkflowLogsCommand extends BaseCommand{[a33_0x47e5ec(0x1f1)]=a33_0x47e5ec(0x1ff);[a33_0x47e5ec(0x1c0)]=a33_0x47e5ec(0x1cb);async[a33_0x47e5ec(0x1fe)](_0x2b3d5f){const _0x4ef17a=a33_0x47e5ec,{options:_0x194638,args:_0x44e760,tdx:_0x5cc9a9}=_0x2b3d5f,_0x2e8739=_0x44e760[0x0],_0x342fc0=_0x44e760[0x1];if(!_0x2e8739||!_0x342fc0)return console[_0x4ef17a(0x21f)](_0x4ef17a(0x228)),0x1;try{_0x194638['verbose']&&(console[_0x4ef17a(0x21f)](_0x4ef17a(0x210)+_0x2e8739),console[_0x4ef17a(0x21f)](_0x4ef17a(0x1bf)+_0x342fc0));const _0xd94e15=_0x194638[_0x4ef17a(0x208)],_0xb4294b=await withSpinner('Getting\x20task\x20logs...',()=>_0x5cc9a9[_0x4ef17a(0x227)][_0x4ef17a(0x1f8)](_0x2e8739,_0x342fc0,{'offset':_0xd94e15,'limit':_0x194638[_0x4ef17a(0x1c4)]}),{'verbose':_0x194638[_0x4ef17a(0x1f0)]}),_0x4427ad=_0xb4294b[_0x4ef17a(0x1b9)];return console[_0x4ef17a(0x21f)]('✔\x20Found\x20'+_0x4427ad[_0x4ef17a(0x20a)]+_0x4ef17a(0x1d5)+(_0x4427ad[_0x4ef17a(0x20a)]!==0x1?'ies':'y')),await handleSDKOutput(_0x4427ad,_0x194638),0x0;}catch(_0x5956aa){if(_0x5956aa instanceof SDKError)return console[_0x4ef17a(0x21f)](_0x4ef17a(0x1aa)+_0x5956aa['message']),_0x5956aa[_0x4ef17a(0x20b)]&&console['error']('\x20\x20Cause:\x20'+_0x5956aa[_0x4ef17a(0x20b)]),0x1;throw _0x5956aa;}}}export class WorkflowKillCommand extends BaseCommand{[a33_0x47e5ec(0x1f1)]=a33_0x47e5ec(0x1d3);[a33_0x47e5ec(0x1c0)]=a33_0x47e5ec(0x1c6);async['execute'](_0x3d6464){const _0x49e97e=a33_0x47e5ec,{options:_0x2b7d09,args:_0x40f930,tdx:_0x7303e6}=_0x3d6464,_0x54e24d=_0x40f930[0x0];if(!_0x54e24d)return console[_0x49e97e(0x21f)](_0x49e97e(0x222)),0x1;try{const _0x27b6c8=_0x2b7d09[_0x49e97e(0x21b)];_0x2b7d09[_0x49e97e(0x1f0)]&&(console[_0x49e97e(0x21f)](_0x49e97e(0x210)+_0x54e24d),_0x27b6c8&&console[_0x49e97e(0x21f)](_0x49e97e(0x1e7)+_0x27b6c8));if(!_0x2b7d09[_0x49e97e(0x1ef)]){const _0x11564c=await confirm(_0x49e97e(0x214)+_0x54e24d+'?');if(!_0x11564c)return console[_0x49e97e(0x21f)]('Cancelled'),0x0;}const _0x5e25a2=await withSpinner(_0x49e97e(0x221),()=>_0x7303e6[_0x49e97e(0x227)][_0x49e97e(0x20e)](_0x54e24d,_0x27b6c8),{'verbose':_0x2b7d09[_0x49e97e(0x1f0)]}),_0x45b43c=_0x5e25a2[_0x49e97e(0x1b9)];return console[_0x49e97e(0x21f)]('✔\x20'+_0x45b43c),0x0;}catch(_0x2be95f){if(_0x2be95f instanceof SDKError)return console['error'](_0x49e97e(0x1aa)+_0x2be95f[_0x49e97e(0x1af)]),_0x2be95f['cause']&&console[_0x49e97e(0x21f)](_0x49e97e(0x1de)+_0x2be95f[_0x49e97e(0x20b)]),0x1;throw _0x2be95f;}}}export class WorkflowRetryCommand extends BaseCommand{[a33_0x47e5ec(0x1f1)]='workflow:retry';[a33_0x47e5ec(0x1c0)]='Retry\x20a\x20session\x20or\x20attempt';async[a33_0x47e5ec(0x1fe)](_0x5dfcd9){const _0x37439a=a33_0x47e5ec,{options:_0x468e09,args:_0x33bd7b,tdx:_0x4fa3fd}=_0x5dfcd9,_0x3c42f5=_0x33bd7b[0x0];if(!_0x3c42f5)return console[_0x37439a(0x21f)](_0x37439a(0x226)),console[_0x37439a(0x21f)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0xdf8b71=![],_0x5a20c0=_0x3c42f5;if(_0x3c42f5[_0x37439a(0x1ae)](_0x37439a(0x22b)))_0xdf8b71=!![],_0x5a20c0=_0x3c42f5[_0x37439a(0x20d)](0x8);else{if(_0x3c42f5[_0x37439a(0x1ae)](_0x37439a(0x211)))_0xdf8b71=![],_0x5a20c0=_0x3c42f5['substring'](0x8);else return console[_0x37439a(0x21f)](_0x37439a(0x1ea)),console[_0x37439a(0x21f)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x21fdc2=_0x468e09[_0x37439a(0x20c)],_0x226bee=_0x468e09['resumeFrom'],_0x196341=_0x468e09[_0x37439a(0x1e8)],_0x295868=_0x468e09[_0x37439a(0x1d4)];_0x468e09[_0x37439a(0x1f0)]&&(console[_0x37439a(0x21f)](_0x37439a(0x207)+(_0xdf8b71?_0x37439a(0x1f4):'attempt')+'\x20'+_0x5a20c0),_0x21fdc2&&console['error'](_0x37439a(0x20f)+_0x21fdc2),_0x226bee&&console['error']('Resume\x20from:\x20'+_0x226bee),_0x196341&&console[_0x37439a(0x21f)](_0x37439a(0x1e4)+_0x196341),_0x295868&&console[_0x37439a(0x21f)]('Force:\x20yes'));let _0x19e8c0;if(_0x196341)try{if(_0x196341['startsWith']('@')){const _0x22e6a7=await import(_0x37439a(0x1b6)),_0x2229aa=_0x196341[_0x37439a(0x20d)](0x1),_0x363b55=await _0x22e6a7[_0x37439a(0x22a)](_0x2229aa,'utf-8');_0x19e8c0=JSON[_0x37439a(0x219)](_0x363b55);}else _0x19e8c0=JSON['parse'](_0x196341);}catch{return console[_0x37439a(0x21f)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x468e09[_0x37439a(0x1ef)]){const _0xabaf7c=await confirm(_0x37439a(0x1ac)+(_0xdf8b71?'session':_0x37439a(0x213))+'\x20'+_0x5a20c0+'?');if(!_0xabaf7c)return console[_0x37439a(0x21f)](_0x37439a(0x1f6)),0x0;}let _0x41bed3;_0xdf8b71?_0x41bed3=await withSpinner(_0x37439a(0x21c),()=>_0x4fa3fd[_0x37439a(0x227)][_0x37439a(0x21a)](_0x5a20c0,{'fromTask':_0x21fdc2,'retryParams':_0x19e8c0}),{'verbose':_0x468e09['verbose']}):_0x41bed3=await withSpinner(_0x37439a(0x1b8),()=>_0x4fa3fd[_0x37439a(0x227)][_0x37439a(0x1fa)](_0x5a20c0,{'resumeFrom':_0x226bee,'retryParams':_0x19e8c0,'force':_0x295868}),{'verbose':_0x468e09['verbose']});const _0x132ec1=_0x41bed3[_0x37439a(0x1b9)];return console['error']('✔\x20Retry\x20started'),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0x132ec1[_0x37439a(0x1fd)]),console[_0x37439a(0x21f)](_0x37439a(0x1c2)+_0x132ec1[_0x37439a(0x1c9)]),0x0;}catch(_0x3e79c7){if(_0x3e79c7 instanceof SDKError)return console[_0x37439a(0x21f)](_0x37439a(0x1aa)+_0x3e79c7[_0x37439a(0x1af)]),_0x3e79c7[_0x37439a(0x20b)]&&console[_0x37439a(0x21f)](_0x37439a(0x1de)+_0x3e79c7[_0x37439a(0x20b)]),0x1;throw _0x3e79c7;}}}export class WorkflowDownloadCommand extends BaseCommand{[a33_0x47e5ec(0x1f1)]=a33_0x47e5ec(0x202);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a33_0x47e5ec(0x1fe)](_0x1596dd){const _0xf4a2e5=a33_0x47e5ec,{options:_0x5a6b6a,args:_0x456bbd,tdx:_0x5703b3}=_0x1596dd,_0x3f4399=_0x456bbd[0x0],_0x12d030=_0x456bbd[0x1]||'.';if(!_0x3f4399)return console[_0xf4a2e5(0x21f)](_0xf4a2e5(0x1da)),console['error'](_0xf4a2e5(0x1ba)),0x1;const _0x2456a6=_0x5a6b6a[_0xf4a2e5(0x1fb)];_0x5a6b6a[_0xf4a2e5(0x1f0)]&&(console[_0xf4a2e5(0x21f)](_0xf4a2e5(0x1bb)+_0x3f4399),console[_0xf4a2e5(0x21f)](_0xf4a2e5(0x1b1)+_0x12d030),_0x2456a6&&console[_0xf4a2e5(0x21f)](_0xf4a2e5(0x1f7)+_0x2456a6));const _0x1d33c3=await withSpinner('Downloading\x20project\x20'+_0x3f4399+_0xf4a2e5(0x225),()=>_0x5703b3['workflow'][_0xf4a2e5(0x220)](_0x3f4399,_0x12d030,{'revision':_0x2456a6}),{'verbose':_0x5a6b6a[_0xf4a2e5(0x1f0)]}),_0x2a5537=_0x1d33c3['data'];return console[_0xf4a2e5(0x21f)](_0xf4a2e5(0x1e2)+_0x2a5537[_0xf4a2e5(0x1e0)]),console['error']('\x20\x20Revision:\x20'+_0x2a5537['revision']),console['error']('\x20\x20Files\x20extracted:\x20'+_0x2a5537[_0xf4a2e5(0x1e3)]),console[_0xf4a2e5(0x21f)](_0xf4a2e5(0x206)+_0x12d030+'/'+_0x2a5537['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']=a33_0x47e5ec(0x1f9);['description']=a33_0x47e5ec(0x1d9);async[a33_0x47e5ec(0x1fe)](_0x5e7de9){const _0x308b48=a33_0x47e5ec,{options:_0x5af2cd,args:_0x5ed8c0,tdx:_0xc2d1ef}=_0x5e7de9;let _0x33a223='.',_0x3e50ac=_0x5af2cd['name'];if(_0x5ed8c0[0x0]){const {promises:_0x52624a}=await import('fs');try{const _0xa8d989=await _0x52624a[_0x308b48(0x201)](_0x5ed8c0[0x0]);if(_0xa8d989['isDirectory']())_0x33a223=_0x5ed8c0[0x0];else return console[_0x308b48(0x21f)](_0x308b48(0x1aa)+_0x5ed8c0[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x3e50ac=_0x5ed8c0[0x0],_0x33a223='.';}}const _0x1b1f2e=_0x5af2cd[_0x308b48(0x1fb)],_0x31239f=_0x5af2cd['skipValidation'];_0x5af2cd[_0x308b48(0x1f0)]&&(console[_0x308b48(0x21f)](_0x308b48(0x212)+_0x33a223),_0x3e50ac&&console[_0x308b48(0x21f)](_0x308b48(0x1cf)+_0x3e50ac),_0x1b1f2e&&console[_0x308b48(0x21f)]('Revision:\x20'+_0x1b1f2e),_0x31239f&&console[_0x308b48(0x21f)](_0x308b48(0x223)));const _0x3c1807=await withSpinner('Pushing\x20workflow\x20project...',()=>_0xc2d1ef[_0x308b48(0x227)]['push'](_0x33a223,{'projectName':_0x3e50ac,'revision':_0x1b1f2e,'skipValidation':_0x31239f}),{'verbose':_0x5af2cd[_0x308b48(0x1f0)]}),_0x389c8a=_0x3c1807['data'];return console['error'](_0x308b48(0x1f2)+_0x389c8a['projectName']),console[_0x308b48(0x21f)](_0x308b48(0x1ad)+_0x389c8a[_0x308b48(0x1b7)]),console[_0x308b48(0x21f)]('\x20\x20Revision:\x20'+_0x389c8a[_0x308b48(0x1fb)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a33_0x47e5ec(0x1f1)]=a33_0x47e5ec(0x1db);[a33_0x47e5ec(0x1c0)]=a33_0x47e5ec(0x1cd);async[a33_0x47e5ec(0x1fe)](_0x565609){const _0x1c26a5=a33_0x47e5ec,{options:_0x476f50,args:_0x3509b7,tdx:_0x27c811}=_0x565609,_0x2f83c9=_0x3509b7[0x0];if(!_0x2f83c9)return console[_0x1c26a5(0x21f)](_0x1c26a5(0x1be)),console[_0x1c26a5(0x21f)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x476f50[_0x1c26a5(0x1f0)]&&console['error'](_0x1c26a5(0x1bb)+_0x2f83c9);if(!_0x476f50[_0x1c26a5(0x1ef)]){const _0x21fa77=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2f83c9+_0x1c26a5(0x215));if(!_0x21fa77)return console[_0x1c26a5(0x21f)](_0x1c26a5(0x1f6)),0x0;}const _0x2ee61c=await withSpinner(_0x1c26a5(0x1c7)+_0x2f83c9+_0x1c26a5(0x225),()=>_0x27c811[_0x1c26a5(0x227)][_0x1c26a5(0x229)](_0x2f83c9),{'verbose':_0x476f50[_0x1c26a5(0x1f0)]}),_0x1c4a1f=_0x2ee61c['data'];return console['error'](_0x1c26a5(0x1f3)+_0x1c4a1f[_0x1c26a5(0x1e0)]),console[_0x1c26a5(0x21f)]('\x20\x20Project\x20ID:\x20'+_0x1c4a1f['projectId']),0x0;}}
|
|
1
|
+
const a33_0x21671f=a33_0x4942;(function(_0x46fce9,_0x338ede){const _0x1b7e68=a33_0x4942,_0x221a9e=_0x46fce9();while(!![]){try{const _0x337788=-parseInt(_0x1b7e68(0x1a8))/0x1*(-parseInt(_0x1b7e68(0x217))/0x2)+-parseInt(_0x1b7e68(0x1ed))/0x3+parseInt(_0x1b7e68(0x1ea))/0x4*(parseInt(_0x1b7e68(0x1cf))/0x5)+-parseInt(_0x1b7e68(0x19f))/0x6+-parseInt(_0x1b7e68(0x1a6))/0x7+parseInt(_0x1b7e68(0x1a4))/0x8*(parseInt(_0x1b7e68(0x201))/0x9)+-parseInt(_0x1b7e68(0x1df))/0xa*(-parseInt(_0x1b7e68(0x1fa))/0xb);if(_0x337788===_0x338ede)break;else _0x221a9e['push'](_0x221a9e['shift']());}catch(_0x40487f){_0x221a9e['push'](_0x221a9e['shift']());}}}(a33_0x3af4,0xf024e));import{BaseCommand}from'./command.js';function a33_0x3af4(){const _0x720c0b=['\x20\x20Project\x20ID:\x20','\x20\x20Cause:\x20','8352858WNFEDR','workflow:sessions','sessions','attempts','\x20session','195256mEQxnH','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','6563249VpYLkV','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','21GfpXQl','workflow:push','...','workflow:delete','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Filter:\x20project=','retryAttempt','params','Project\x20directory:\x20','projectId','startsWith','execute','workflow:attempts','Cancelled','Reason:\x20','yes','\x20attempt','Attempt\x20ID:\x20','Include\x20retried:\x20yes','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Including\x20subtasks:\x20yes','Retrying\x20attempt...','utf-8','parse','Error:\x20Project\x20name\x20is\x20required','status','From\x20task:\x20','\x20workflow','workflow:tasks','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Filter:\x20','Status:\x20','Error:\x20','\x20log\x20entr','limit','Resume\x20from:\x20','name','Output\x20directory:\x20','attempt','3055oLzPyj','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Revision:\x20','workflows','\x20\x20Files\x20extracted:\x20','✔\x20Found\x20','includeSubtasks','Pushing\x20workflow\x20project...','✔\x20Retry\x20started','length','workflow','\x20\x20New\x20attempt\x20ID:\x20','List\x20workflow\x20attempts','session','Getting\x20task\x20logs...','substring','22972910qNsmWg','logs','tasks','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','✔\x20Deleted\x20project\x20','projectName','isDirectory','session:','stat','error','resumeFrom','4484rLsxZG','workflow:retry','workflow:kill','2649768ltTpLS','\x20task','readFile','Getting\x20attempt\x20details...','verbose','✔\x20Downloaded\x20','attempt:','\x20\x20Location:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Params:\x20','delete','Force:\x20yes','data','11xcPVFJ','retrySession','\x20\x20Session\x20ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','cause','split','workflow:download','9CceYsj','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Deleting\x20project\x20','Error:\x20Attempt\x20ID\x20is\x20required','Project:\x20','revision','force','Target:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','List\x20workflow\x20execution\x20sessions','\x20is\x20not\x20a\x20directory','from','download','message','workflow:projects','includeRetried','Usage:\x20workflow:delete\x20<project-name-or-id>','Task\x20name:\x20','description','List\x20all\x20workflow\x20projects','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Revision:\x20','113334CkCkYY','offset'];a33_0x3af4=function(){return _0x720c0b;};return a33_0x3af4();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a33_0x21671f(0x1cc)]=a33_0x21671f(0x20f);[a33_0x21671f(0x213)]=a33_0x21671f(0x214);async['execute'](_0x5afccd){const _0x9ed574=a33_0x21671f,{options:_0x3c1158,args:_0xe2bd20,tdx:_0x2bdac0}=_0x5afccd,_0x34ec8f=_0xe2bd20[0x0];try{_0x3c1158[_0x9ed574(0x1f1)]&&_0x34ec8f&&console['error']('Pattern:\x20'+_0x34ec8f);const _0x4059f9=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x2bdac0[_0x9ed574(0x1d9)]['projects'](_0x34ec8f,{'limit':_0x3c1158[_0x9ed574(0x1ca)]}),{'verbose':_0x3c1158[_0x9ed574(0x1f1)]}),_0x9796fa=_0x4059f9[_0x9ed574(0x1f9)];return console[_0x9ed574(0x1e8)]('✔\x20Found\x20'+_0x9796fa[_0x9ed574(0x1d8)]+'\x20project'+(_0x9796fa['length']!==0x1?'s':'')),await handleSDKOutput(_0x9796fa,_0x3c1158),0x0;}catch(_0x2cf681){if(_0x2cf681 instanceof SDKError)return console['error']('Error:\x20'+_0x2cf681['message']),_0x2cf681[_0x9ed574(0x1fe)]&&console['error']('\x20\x20Cause:\x20'+_0x2cf681[_0x9ed574(0x1fe)]),0x1;throw _0x2cf681;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a33_0x21671f(0x1cc)]='workflow:workflows';[a33_0x21671f(0x213)]='List\x20workflows';async['execute'](_0x502775){const _0xea939a=a33_0x21671f,{options:_0x9495bf,args:_0x1e895d,tdx:_0x5b18fb}=_0x502775,_0x36221a=_0x1e895d[0x0];try{_0x9495bf[_0xea939a(0x1f1)]&&_0x36221a&&console['error']('Project\x20filter:\x20'+_0x36221a);const _0x40f991=await withSpinner('Listing\x20workflows...',()=>_0x5b18fb[_0xea939a(0x1d9)][_0xea939a(0x1d2)](_0x36221a,{'limit':_0x9495bf[_0xea939a(0x1ca)]}),{'verbose':_0x9495bf['verbose']}),_0x47f572=_0x40f991['data'];return console[_0xea939a(0x1e8)](_0xea939a(0x1d4)+_0x47f572['length']+_0xea939a(0x1c3)+(_0x47f572['length']!==0x1?'s':'')),await handleSDKOutput(_0x47f572,_0x9495bf),0x0;}catch(_0x3f4a98){if(_0x3f4a98 instanceof SDKError)return console[_0xea939a(0x1e8)](_0xea939a(0x1c8)+_0x3f4a98[_0xea939a(0x20e)]),_0x3f4a98[_0xea939a(0x1fe)]&&console['error'](_0xea939a(0x21a)+_0x3f4a98[_0xea939a(0x1fe)]),0x1;throw _0x3f4a98;}}}export class WorkflowSessionsCommand extends BaseCommand{[a33_0x21671f(0x1cc)]=a33_0x21671f(0x1a0);[a33_0x21671f(0x213)]=a33_0x21671f(0x20a);async[a33_0x21671f(0x1b3)](_0x20800c){const _0x596a26=a33_0x21671f,{options:_0x3bd32f,args:_0x5e722f,tdx:_0x30fb29}=_0x20800c;let _0x80181,_0x1b8510;if(_0x5e722f[0x0]){const _0x1fa543=_0x5e722f[0x0][_0x596a26(0x1ff)]('.');if(_0x1fa543['length']===0x1)_0x80181=_0x1fa543[0x0];else{if(_0x1fa543['length']===0x2)[_0x80181,_0x1b8510]=_0x1fa543;else return console[_0x596a26(0x1e8)](_0x596a26(0x1e2)),0x1;}}try{if(_0x3bd32f[_0x596a26(0x1f1)]){if(_0x80181&&_0x1b8510)console['error'](_0x596a26(0x1c6)+_0x80181+'.'+_0x1b8510);else _0x80181&&console['error'](_0x596a26(0x1ad)+_0x80181);const _0xaa8de=_0x3bd32f[_0x596a26(0x1c1)];_0xaa8de&&console[_0x596a26(0x1e8)](_0x596a26(0x1c7)+_0xaa8de);}const _0x3bfe4a=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x30fb29[_0x596a26(0x1d9)][_0x596a26(0x1a1)]({'projectName':_0x80181,'workflowName':_0x1b8510,'status':_0x3bd32f[_0x596a26(0x1c1)],'fromTime':_0x3bd32f[_0x596a26(0x20c)],'toTime':_0x3bd32f['to'],'limit':_0x3bd32f[_0x596a26(0x1ca)]}),{'verbose':_0x3bd32f['verbose']}),_0x48ba22=_0x3bfe4a[_0x596a26(0x1f9)];return console[_0x596a26(0x1e8)](_0x596a26(0x1d4)+_0x48ba22[_0x596a26(0x1d8)]+_0x596a26(0x1a3)+(_0x48ba22[_0x596a26(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x48ba22,_0x3bd32f),0x0;}catch(_0x4accb4){if(_0x4accb4 instanceof SDKError)return console['error'](_0x596a26(0x1c8)+_0x4accb4[_0x596a26(0x20e)]),_0x4accb4[_0x596a26(0x1fe)]&&console[_0x596a26(0x1e8)](_0x596a26(0x21a)+_0x4accb4[_0x596a26(0x1fe)]),0x1;throw _0x4accb4;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a33_0x21671f(0x1cc)]=a33_0x21671f(0x1b4);[a33_0x21671f(0x213)]=a33_0x21671f(0x1db);async[a33_0x21671f(0x1b3)](_0x3d97e8){const _0x180dfd=a33_0x21671f,{options:_0x37896a,args:_0xd648b4,tdx:_0x15ebef}=_0x3d97e8;let _0x4adc72,_0x302d02;if(_0xd648b4[0x0]){const _0x4b2db0=_0xd648b4[0x0][_0x180dfd(0x1ff)]('.');if(_0x4b2db0[_0x180dfd(0x1d8)]===0x1)_0x4adc72=_0x4b2db0[0x0];else{if(_0x4b2db0[_0x180dfd(0x1d8)]===0x2)[_0x4adc72,_0x302d02]=_0x4b2db0;else return console[_0x180dfd(0x1e8)](_0x180dfd(0x1e2)),0x1;}}try{const _0x3a63c7=_0x37896a[_0x180dfd(0x210)];if(_0x37896a[_0x180dfd(0x1f1)]){if(_0x4adc72&&_0x302d02)console[_0x180dfd(0x1e8)](_0x180dfd(0x1c6)+_0x4adc72+'.'+_0x302d02);else _0x4adc72&&console[_0x180dfd(0x1e8)](_0x180dfd(0x1ad)+_0x4adc72);_0x3a63c7&&console[_0x180dfd(0x1e8)](_0x180dfd(0x1ba));}const _0x3c291c=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x15ebef[_0x180dfd(0x1d9)][_0x180dfd(0x1a2)]({'projectName':_0x4adc72,'workflowName':_0x302d02,'includeRetried':_0x3a63c7,'limit':_0x37896a[_0x180dfd(0x1ca)]}),{'verbose':_0x37896a[_0x180dfd(0x1f1)]}),_0x480932=_0x3c291c[_0x180dfd(0x1f9)];return console[_0x180dfd(0x1e8)](_0x180dfd(0x1d4)+_0x480932[_0x180dfd(0x1d8)]+_0x180dfd(0x1b8)+(_0x480932[_0x180dfd(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x480932,_0x37896a),0x0;}catch(_0x24807b){if(_0x24807b instanceof SDKError)return console[_0x180dfd(0x1e8)](_0x180dfd(0x1c8)+_0x24807b[_0x180dfd(0x20e)]),_0x24807b['cause']&&console[_0x180dfd(0x1e8)](_0x180dfd(0x21a)+_0x24807b[_0x180dfd(0x1fe)]),0x1;throw _0x24807b;}}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a33_0x21671f(0x213)]='Show\x20specific\x20attempt\x20details';async['execute'](_0x574bb4){const _0xd5ed73=a33_0x21671f,{options:_0x1e22a3,args:_0x3bfaed,tdx:_0xd91528}=_0x574bb4,_0x48c9ef=_0x3bfaed[0x0];if(!_0x48c9ef)return console[_0xd5ed73(0x1e8)](_0xd5ed73(0x204)),0x1;try{_0x1e22a3[_0xd5ed73(0x1f1)]&&console[_0xd5ed73(0x1e8)](_0xd5ed73(0x1b9)+_0x48c9ef);const _0x14b8ba=await withSpinner(_0xd5ed73(0x1f0),()=>_0xd91528[_0xd5ed73(0x1d9)][_0xd5ed73(0x1ce)](_0x48c9ef),{'verbose':_0x1e22a3[_0xd5ed73(0x1f1)]}),_0x3da943=_0x14b8ba[_0xd5ed73(0x1f9)];return await handleSDKOutput([_0x3da943],_0x1e22a3),0x0;}catch(_0x3bbc70){if(_0x3bbc70 instanceof SDKError)return console[_0xd5ed73(0x1e8)](_0xd5ed73(0x1c8)+_0x3bbc70['message']),_0x3bbc70[_0xd5ed73(0x1fe)]&&console[_0xd5ed73(0x1e8)](_0xd5ed73(0x21a)+_0x3bbc70[_0xd5ed73(0x1fe)]),0x1;throw _0x3bbc70;}}}export class WorkflowTasksCommand extends BaseCommand{[a33_0x21671f(0x1cc)]=a33_0x21671f(0x1c4);[a33_0x21671f(0x213)]='Show\x20tasks\x20for\x20an\x20attempt';async[a33_0x21671f(0x1b3)](_0x39b892){const _0x973ff4=a33_0x21671f,{options:_0x49fe7e,args:_0x478b72,tdx:_0x15139d}=_0x39b892,_0xf7713a=_0x478b72[0x0];if(!_0xf7713a)return console[_0x973ff4(0x1e8)](_0x973ff4(0x204)),0x1;try{const _0x2ad9b7=_0x49fe7e[_0x973ff4(0x1d5)];_0x49fe7e[_0x973ff4(0x1f1)]&&(console[_0x973ff4(0x1e8)]('Attempt\x20ID:\x20'+_0xf7713a),_0x2ad9b7&&console[_0x973ff4(0x1e8)](_0x973ff4(0x1bc)));const _0x14655d=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x15139d[_0x973ff4(0x1d9)][_0x973ff4(0x1e1)](_0xf7713a,_0x2ad9b7||![]),{'verbose':_0x49fe7e[_0x973ff4(0x1f1)]}),_0x2ff576=_0x14655d[_0x973ff4(0x1f9)];return console[_0x973ff4(0x1e8)](_0x973ff4(0x1d4)+_0x2ff576[_0x973ff4(0x1d8)]+_0x973ff4(0x1ee)+(_0x2ff576['length']!==0x1?'s':'')),await handleSDKOutput(_0x2ff576,_0x49fe7e),0x0;}catch(_0x45050f){if(_0x45050f instanceof SDKError)return console[_0x973ff4(0x1e8)](_0x973ff4(0x1c8)+_0x45050f['message']),_0x45050f[_0x973ff4(0x1fe)]&&console['error'](_0x973ff4(0x21a)+_0x45050f['cause']),0x1;throw _0x45050f;}}}export class WorkflowLogsCommand extends BaseCommand{[a33_0x21671f(0x1cc)]='workflow:logs';['description']='Show\x20logs\x20for\x20a\x20specific\x20task';async[a33_0x21671f(0x1b3)](_0x1982e9){const _0x384c62=a33_0x21671f,{options:_0x38a8e3,args:_0x44af49,tdx:_0x567b8d}=_0x1982e9,_0x1bb46b=_0x44af49[0x0],_0x5ad315=_0x44af49[0x1];if(!_0x1bb46b||!_0x5ad315)return console[_0x384c62(0x1e8)]('Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required'),0x1;try{_0x38a8e3[_0x384c62(0x1f1)]&&(console['error'](_0x384c62(0x1b9)+_0x1bb46b),console[_0x384c62(0x1e8)](_0x384c62(0x212)+_0x5ad315));const _0x3de47a=_0x38a8e3[_0x384c62(0x218)],_0x386964=await withSpinner(_0x384c62(0x1dd),()=>_0x567b8d[_0x384c62(0x1d9)][_0x384c62(0x1e0)](_0x1bb46b,_0x5ad315,{'offset':_0x3de47a,'limit':_0x38a8e3['limit']}),{'verbose':_0x38a8e3[_0x384c62(0x1f1)]}),_0x235774=_0x386964['data'];return console[_0x384c62(0x1e8)](_0x384c62(0x1d4)+_0x235774[_0x384c62(0x1d8)]+_0x384c62(0x1c9)+(_0x235774[_0x384c62(0x1d8)]!==0x1?'ies':'y')),await handleSDKOutput(_0x235774,_0x38a8e3),0x0;}catch(_0x9d1138){if(_0x9d1138 instanceof SDKError)return console['error'](_0x384c62(0x1c8)+_0x9d1138[_0x384c62(0x20e)]),_0x9d1138['cause']&&console['error'](_0x384c62(0x21a)+_0x9d1138[_0x384c62(0x1fe)]),0x1;throw _0x9d1138;}}}export class WorkflowKillCommand extends BaseCommand{[a33_0x21671f(0x1cc)]=a33_0x21671f(0x1ec);['description']='Kill\x20a\x20running\x20attempt';async[a33_0x21671f(0x1b3)](_0x135c7a){const _0x4bc309=a33_0x21671f,{options:_0x3c0928,args:_0x5a368a,tdx:_0x33b6be}=_0x135c7a,_0x12b394=_0x5a368a[0x0];if(!_0x12b394)return console[_0x4bc309(0x1e8)](_0x4bc309(0x204)),0x1;try{const _0x22d1ef=_0x3c0928['reason'];_0x3c0928[_0x4bc309(0x1f1)]&&(console[_0x4bc309(0x1e8)](_0x4bc309(0x1b9)+_0x12b394),_0x22d1ef&&console[_0x4bc309(0x1e8)](_0x4bc309(0x1b6)+_0x22d1ef));if(!_0x3c0928[_0x4bc309(0x1b7)]){const _0x29e285=await confirm(_0x4bc309(0x1fd)+_0x12b394+'?');if(!_0x29e285)return console[_0x4bc309(0x1e8)](_0x4bc309(0x1b5)),0x0;}const _0x4965f6=await withSpinner('Killing\x20attempt...',()=>_0x33b6be[_0x4bc309(0x1d9)]['kill'](_0x12b394,_0x22d1ef),{'verbose':_0x3c0928[_0x4bc309(0x1f1)]}),_0x2c59ed=_0x4965f6[_0x4bc309(0x1f9)];return console[_0x4bc309(0x1e8)]('✔\x20'+_0x2c59ed),0x0;}catch(_0x1aa578){if(_0x1aa578 instanceof SDKError)return console[_0x4bc309(0x1e8)]('Error:\x20'+_0x1aa578[_0x4bc309(0x20e)]),_0x1aa578[_0x4bc309(0x1fe)]&&console[_0x4bc309(0x1e8)](_0x4bc309(0x21a)+_0x1aa578['cause']),0x1;throw _0x1aa578;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a33_0x21671f(0x1eb);[a33_0x21671f(0x213)]='Retry\x20a\x20session\x20or\x20attempt';async[a33_0x21671f(0x1b3)](_0x3b5e18){const _0x104b75=a33_0x21671f,{options:_0x562815,args:_0x270ce8,tdx:_0x1b75c3}=_0x3b5e18,_0x11058d=_0x270ce8[0x0];if(!_0x11058d)return console[_0x104b75(0x1e8)](_0x104b75(0x1bb)),console[_0x104b75(0x1e8)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x42782e=![],_0x467491=_0x11058d;if(_0x11058d[_0x104b75(0x1b2)](_0x104b75(0x1e6)))_0x42782e=!![],_0x467491=_0x11058d[_0x104b75(0x1de)](0x8);else{if(_0x11058d[_0x104b75(0x1b2)](_0x104b75(0x1f3)))_0x42782e=![],_0x467491=_0x11058d[_0x104b75(0x1de)](0x8);else return console[_0x104b75(0x1e8)](_0x104b75(0x1a5)),console['error'](_0x104b75(0x202)),0x1;}try{const _0xafe06e=_0x562815['fromTask'],_0x51f1ab=_0x562815[_0x104b75(0x1e9)],_0x172583=_0x562815[_0x104b75(0x1af)],_0x180f98=_0x562815[_0x104b75(0x207)];_0x562815[_0x104b75(0x1f1)]&&(console[_0x104b75(0x1e8)](_0x104b75(0x208)+(_0x42782e?_0x104b75(0x1dc):_0x104b75(0x1ce))+'\x20'+_0x467491),_0xafe06e&&console['error'](_0x104b75(0x1c2)+_0xafe06e),_0x51f1ab&&console[_0x104b75(0x1e8)](_0x104b75(0x1cb)+_0x51f1ab),_0x172583&&console[_0x104b75(0x1e8)](_0x104b75(0x1f6)+_0x172583),_0x180f98&&console[_0x104b75(0x1e8)](_0x104b75(0x1f8)));let _0x13f98f;if(_0x172583)try{if(_0x172583[_0x104b75(0x1b2)]('@')){const _0x4e44e0=await import('fs/promises'),_0x43ddb2=_0x172583[_0x104b75(0x1de)](0x1),_0x4f7a40=await _0x4e44e0[_0x104b75(0x1ef)](_0x43ddb2,_0x104b75(0x1be));_0x13f98f=JSON[_0x104b75(0x1bf)](_0x4f7a40);}else _0x13f98f=JSON[_0x104b75(0x1bf)](_0x172583);}catch{return console[_0x104b75(0x1e8)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x562815[_0x104b75(0x1b7)]){const _0x557c7f=await confirm(_0x104b75(0x209)+(_0x42782e?_0x104b75(0x1dc):'attempt')+'\x20'+_0x467491+'?');if(!_0x557c7f)return console['error'](_0x104b75(0x1b5)),0x0;}let _0x299aec;_0x42782e?_0x299aec=await withSpinner('Retrying\x20session...',()=>_0x1b75c3[_0x104b75(0x1d9)][_0x104b75(0x1fb)](_0x467491,{'fromTask':_0xafe06e,'retryParams':_0x13f98f}),{'verbose':_0x562815[_0x104b75(0x1f1)]}):_0x299aec=await withSpinner(_0x104b75(0x1bd),()=>_0x1b75c3[_0x104b75(0x1d9)][_0x104b75(0x1ae)](_0x467491,{'resumeFrom':_0x51f1ab,'retryParams':_0x13f98f,'force':_0x180f98}),{'verbose':_0x562815[_0x104b75(0x1f1)]});const _0x186d3a=_0x299aec[_0x104b75(0x1f9)];return console[_0x104b75(0x1e8)](_0x104b75(0x1d7)),console[_0x104b75(0x1e8)](_0x104b75(0x1da)+_0x186d3a['attemptId']),console[_0x104b75(0x1e8)](_0x104b75(0x1fc)+_0x186d3a['sessionId']),0x0;}catch(_0x49c92f){if(_0x49c92f instanceof SDKError)return console[_0x104b75(0x1e8)](_0x104b75(0x1c8)+_0x49c92f['message']),_0x49c92f[_0x104b75(0x1fe)]&&console[_0x104b75(0x1e8)](_0x104b75(0x21a)+_0x49c92f[_0x104b75(0x1fe)]),0x1;throw _0x49c92f;}}}function a33_0x4942(_0x97ec9,_0x4fbf24){const _0x3af45b=a33_0x3af4();return a33_0x4942=function(_0x494213,_0x1395a4){_0x494213=_0x494213-0x19f;let _0x111e69=_0x3af45b[_0x494213];return _0x111e69;},a33_0x4942(_0x97ec9,_0x4fbf24);}export class WorkflowDownloadCommand extends BaseCommand{[a33_0x21671f(0x1cc)]=a33_0x21671f(0x200);[a33_0x21671f(0x213)]=a33_0x21671f(0x1d0);async[a33_0x21671f(0x1b3)](_0x4c4dd8){const _0x5d6c36=a33_0x21671f,{options:_0x2b580e,args:_0x3fe8a2,tdx:_0x532d83}=_0x4c4dd8,_0x4f5af0=_0x3fe8a2[0x0],_0x41fd61=_0x3fe8a2[0x1]||'.';if(!_0x4f5af0)return console[_0x5d6c36(0x1e8)](_0x5d6c36(0x1c0)),console[_0x5d6c36(0x1e8)](_0x5d6c36(0x1f5)),0x1;const _0x232fa9=_0x2b580e[_0x5d6c36(0x206)];_0x2b580e[_0x5d6c36(0x1f1)]&&(console[_0x5d6c36(0x1e8)](_0x5d6c36(0x205)+_0x4f5af0),console[_0x5d6c36(0x1e8)](_0x5d6c36(0x1cd)+_0x41fd61),_0x232fa9&&console[_0x5d6c36(0x1e8)](_0x5d6c36(0x1d1)+_0x232fa9));const _0x22b841=await withSpinner('Downloading\x20project\x20'+_0x4f5af0+'...',()=>_0x532d83[_0x5d6c36(0x1d9)][_0x5d6c36(0x20d)](_0x4f5af0,_0x41fd61,{'revision':_0x232fa9}),{'verbose':_0x2b580e[_0x5d6c36(0x1f1)]}),_0x4f3485=_0x22b841[_0x5d6c36(0x1f9)];return console[_0x5d6c36(0x1e8)](_0x5d6c36(0x1f2)+_0x4f3485[_0x5d6c36(0x1e4)]),console['error']('\x20\x20Revision:\x20'+_0x4f3485[_0x5d6c36(0x206)]),console[_0x5d6c36(0x1e8)](_0x5d6c36(0x1d3)+_0x4f3485['filesExtracted']),console[_0x5d6c36(0x1e8)](_0x5d6c36(0x1f4)+_0x41fd61+'/'+_0x4f3485[_0x5d6c36(0x1e4)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a33_0x21671f(0x1cc)]=a33_0x21671f(0x1a9);['description']=a33_0x21671f(0x1c5);async['execute'](_0x4cce43){const _0x20d7a4=a33_0x21671f,{options:_0x1a2317,args:_0x3123a9,tdx:_0xe414b2}=_0x4cce43;let _0x384e03='.',_0x4e375a=_0x1a2317[_0x20d7a4(0x1cc)];if(_0x3123a9[0x0]){const {promises:_0x5184c3}=await import('fs');try{const _0x21f2c2=await _0x5184c3[_0x20d7a4(0x1e7)](_0x3123a9[0x0]);if(_0x21f2c2[_0x20d7a4(0x1e5)]())_0x384e03=_0x3123a9[0x0];else return console[_0x20d7a4(0x1e8)](_0x20d7a4(0x1c8)+_0x3123a9[0x0]+_0x20d7a4(0x20b)),0x1;}catch{_0x4e375a=_0x3123a9[0x0],_0x384e03='.';}}const _0x2fd4ad=_0x1a2317['revision'],_0x3c4c7e=_0x1a2317['skipValidation'];_0x1a2317[_0x20d7a4(0x1f1)]&&(console[_0x20d7a4(0x1e8)](_0x20d7a4(0x1b0)+_0x384e03),_0x4e375a&&console[_0x20d7a4(0x1e8)]('Project\x20name:\x20'+_0x4e375a),_0x2fd4ad&&console['error']('Revision:\x20'+_0x2fd4ad),_0x3c4c7e&&console[_0x20d7a4(0x1e8)]('Validation:\x20skipped'));const _0x3d9c23=await withSpinner(_0x20d7a4(0x1d6),()=>_0xe414b2[_0x20d7a4(0x1d9)]['push'](_0x384e03,{'projectName':_0x4e375a,'revision':_0x2fd4ad,'skipValidation':_0x3c4c7e}),{'verbose':_0x1a2317['verbose']}),_0x514b68=_0x3d9c23[_0x20d7a4(0x1f9)];return console[_0x20d7a4(0x1e8)]('✔\x20Pushed\x20'+_0x514b68['projectName']),console[_0x20d7a4(0x1e8)](_0x20d7a4(0x219)+_0x514b68[_0x20d7a4(0x1b1)]),console[_0x20d7a4(0x1e8)](_0x20d7a4(0x216)+_0x514b68['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a33_0x21671f(0x1cc)]=a33_0x21671f(0x1ab);['description']=a33_0x21671f(0x215);async[a33_0x21671f(0x1b3)](_0x43402a){const _0xf2b8a5=a33_0x21671f,{options:_0x207485,args:_0x21d801,tdx:_0x28ac1c}=_0x43402a,_0x384888=_0x21d801[0x0];if(!_0x384888)return console[_0xf2b8a5(0x1e8)](_0xf2b8a5(0x1ac)),console['error'](_0xf2b8a5(0x211)),0x1;_0x207485[_0xf2b8a5(0x1f1)]&&console[_0xf2b8a5(0x1e8)](_0xf2b8a5(0x205)+_0x384888);if(!_0x207485[_0xf2b8a5(0x1b7)]){const _0x39ada0=await confirm(_0xf2b8a5(0x1a7)+_0x384888+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x39ada0)return console[_0xf2b8a5(0x1e8)](_0xf2b8a5(0x1b5)),0x0;}const _0x41d3d7=await withSpinner(_0xf2b8a5(0x203)+_0x384888+_0xf2b8a5(0x1aa),()=>_0x28ac1c[_0xf2b8a5(0x1d9)][_0xf2b8a5(0x1f7)](_0x384888),{'verbose':_0x207485[_0xf2b8a5(0x1f1)]}),_0x237a13=_0x41d3d7[_0xf2b8a5(0x1f9)];return console[_0xf2b8a5(0x1e8)](_0xf2b8a5(0x1e3)+_0x237a13['projectName']),console[_0xf2b8a5(0x1e8)](_0xf2b8a5(0x219)+_0x237a13[_0xf2b8a5(0x1b1)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10ac93,_0xfcbf1d){const _0x410461=a34_0xf4de,_0x39de15=_0x10ac93();while(!![]){try{const _0x544560=-parseInt(_0x410461(0x10b))/0x1*(parseInt(_0x410461(0x10f))/0x2)+-parseInt(_0x410461(0x117))/0x3+parseInt(_0x410461(0x108))/0x4*(parseInt(_0x410461(0x113))/0x5)+parseInt(_0x410461(0x10d))/0x6*(-parseInt(_0x410461(0x115))/0x7)+parseInt(_0x410461(0x106))/0x8+-parseInt(_0x410461(0x112))/0x9*(-parseInt(_0x410461(0x10c))/0xa)+-parseInt(_0x410461(0x104))/0xb*(-parseInt(_0x410461(0x114))/0xc);if(_0x544560===_0xfcbf1d)break;else _0x39de15['push'](_0x39de15['shift']());}catch(_0x169c5d){_0x39de15['push'](_0x39de15['shift']());}}}(a34_0x42c6,0x40ebb));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a34_0xf4de(_0x1b72e1,_0x4166d9){const _0x42c6f7=a34_0x42c6();return a34_0xf4de=function(_0xf4dec3,_0x5ac2b1){_0xf4dec3=_0xf4dec3-0x102;let _0x5289ce=_0x42c6f7[_0xf4dec3];return _0x5289ce;},a34_0xf4de(_0x1b72e1,_0x4166d9);}import{getAPIKey}from'./config.js';export function getVersion(){const _0x480fc2=a34_0xf4de;try{const _0x25f6c5=fileURLToPath(import.meta[_0x480fc2(0x10a)]),_0x401dd7=dirname(_0x25f6c5),_0x51dfae=join(_0x401dd7,_0x480fc2(0x107)),_0x515fad=JSON[_0x480fc2(0x109)](readFileSync(_0x51dfae,'utf-8'));return _0x515fad[_0x480fc2(0x103)];}catch{return'0.0.0';}}function a34_0x42c6(){const _0x4d564f=['5465eNyNUs','1700zugFtn','673278BgBlkH',';\x20node/','178KJCAGH','Authorization','tdx','18009TtPItp','563215qBsYuj','72OJkXhE','21WKwraN','X-Trino-User','1336155Wscjxp','entries','replace','version','1672660bBfZYl','TD1\x20','1353208wDgyxB','../../package.json','4lNzBpx','parse','url'];a34_0x42c6=function(){return _0x4d564f;};return a34_0x42c6();}export function getUserAgent(){const _0x418cf4=a34_0xf4de,_0x460a6f=getVersion(),_0x92ffac=platform(),_0x38990a=process[_0x418cf4(0x103)][_0x418cf4(0x102)]('v','');return'tdx/'+_0x460a6f+'\x20('+_0x92ffac+_0x418cf4(0x10e)+_0x38990a+')';}export function getAuthHeaders(_0x3e090a,_0x343db8){const _0x471671=a34_0xf4de,_0x2a55a4=getVersion(),_0x368d31={'User-Agent':getUserAgent(),'X-TD-Client':_0x471671(0x111),'X-TD-Client-Version':_0x2a55a4};return _0x343db8&&(_0x368d31[_0x471671(0x110)]=_0x471671(0x105)+_0x343db8),_0x368d31;}export function toHeaderRecord(_0x399e9c){const _0x4262db=a34_0xf4de,_0x3b91bd={};for(const [_0x3972a2,_0x23a7f6]of Object[_0x4262db(0x118)](_0x399e9c)){_0x23a7f6!==undefined&&(_0x3b91bd[_0x3972a2]=_0x23a7f6);}return _0x3b91bd;}export function getTrinoHeaders(_0x58c45e,_0x49d48a){const _0x8c2ce5=a34_0xf4de,_0xa7b05c=getAuthHeaders(_0x58c45e,_0x49d48a),_0x3f69c0=toHeaderRecord(_0xa7b05c);return delete _0x3f69c0[_0x8c2ce5(0x110)],_0x49d48a&&(_0x3f69c0[_0x8c2ce5(0x116)]=_0x49d48a),_0x3f69c0;}export function hasAPIKey(_0x205301){const _0x5c49e6=getAPIKey(_0x205301);return _0x5c49e6!==undefined&&_0x5c49e6['length']>0x0;}
|