@treasuredata/tdx 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -1690
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-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/global-context.js.map +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.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.d.ts +3 -0
- package/dist/sdk/api.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/api.js.map +1 -1
- package/dist/sdk/database.d.ts +1 -0
- package/dist/sdk/database.d.ts.map +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/database.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +14 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/job.d.ts +1 -0
- package/dist/sdk/job.d.ts.map +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/job.js.map +1 -1
- package/dist/sdk/llm.d.ts +1 -0
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.d.ts +1 -0
- package/dist/sdk/query.d.ts.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/query.js.map +1 -1
- package/dist/sdk/segment.d.ts +1 -0
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/table.d.ts +1 -0
- package/dist/sdk/table.d.ts.map +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/table.js.map +1 -1
- package/dist/sdk/workflow.d.ts +1 -0
- package/dist/sdk/workflow.d.ts.map +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/sdk/workflow.js.map +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.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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.d.ts.map +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tdx-logger.js.map +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 +9 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a25_0x10d3d1=a25_0xb4d5;(function(_0xc4f0af,_0x11adea){const _0x15e719=a25_0xb4d5,_0x349bbc=_0xc4f0af();while(!![]){try{const _0x544103=-parseInt(_0x15e719(0x1a6))/0x1*(parseInt(_0x15e719(0x1ac))/0x2)+-parseInt(_0x15e719(0x19f))/0x3*(parseInt(_0x15e719(0x1a0))/0x4)+-parseInt(_0x15e719(0x1ab))/0x5*(parseInt(_0x15e719(0x1ae))/0x6)+-parseInt(_0x15e719(0x19a))/0x7+parseInt(_0x15e719(0x19b))/0x8+parseInt(_0x15e719(0x19e))/0x9*(-parseInt(_0x15e719(0x1a1))/0xa)+-parseInt(_0x15e719(0x1a8))/0xb*(-parseInt(_0x15e719(0x1aa))/0xc);if(_0x544103===_0x11adea)break;else _0x349bbc['push'](_0x349bbc['shift']());}catch(_0x3c6533){_0x349bbc['push'](_0x349bbc['shift']());}}}(a25_0x28de,0x79561));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a25_0x28de(){const _0x4f18a8=['Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Parent\x20segment:\x20','execute','Site:\x20','data','✔\x20Found\x20','verbose','error','2851555xEYyFE','3312744lTgzif','segment:fields','\x27...','43137SJxGqn','10590sWYFey','28VUGCrs','2060BzJxuX','description','listFields','List\x20available\x20fields\x20for\x20segmentation','Error:\x20Parent\x20segment\x20name\x20is\x20required','1009QVBrHt','name','24057JAzutS','length','12108AYydgo','2749865KfFCQj','306ZyrGhz','Listing\x20fields\x20for\x20\x27','6suWBPt'];a25_0x28de=function(){return _0x4f18a8;};return a25_0x28de();}function a25_0xb4d5(_0x43b9c5,_0x62e4bf){const _0x28defd=a25_0x28de();return a25_0xb4d5=function(_0xb4d5e7,_0x8094f5){_0xb4d5e7=_0xb4d5e7-0x198;let _0x56b272=_0x28defd[_0xb4d5e7];return _0x56b272;},a25_0xb4d5(_0x43b9c5,_0x62e4bf);}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a25_0x10d3d1(0x1a7)]=a25_0x10d3d1(0x19c);[a25_0x10d3d1(0x1a2)]=a25_0x10d3d1(0x1a4);async[a25_0x10d3d1(0x1b1)](_0x29bcef){const _0x379823=a25_0x10d3d1,{options:_0x4dac40,args:_0x141864,tdx:_0x520446}=_0x29bcef;if(_0x141864['length']===0x0)return console[_0x379823(0x199)](_0x379823(0x1a5)),console['error'](_0x379823(0x1af)),0x1;const _0xb3cf8=_0x141864[0x0];_0x4dac40[_0x379823(0x198)]&&(console[_0x379823(0x199)](_0x379823(0x1b2)+_0x4dac40['site']),console['error'](_0x379823(0x1b0)+_0xb3cf8));const _0x2fd283=await withSpinner(_0x379823(0x1ad)+_0xb3cf8+_0x379823(0x19d),()=>_0x520446['segment'][_0x379823(0x1a3)](_0xb3cf8),{'verbose':_0x4dac40[_0x379823(0x198)]}),_0x14f704=_0x2fd283[_0x379823(0x1b3)];return console[_0x379823(0x199)](_0x379823(0x1b4)+_0x14f704['length']+'\x20field'+(_0x14f704[_0x379823(0x1a9)]!==0x1?'s':'')),await handleSDKOutput(_0x14f704,_0x4dac40),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0x2fa883=a26_0x51e9;(function(_0x20a18a,_0x4176c9){const _0x29c306=a26_0x51e9,_0x22e35b=_0x20a18a();while(!![]){try{const _0x11aa7a=parseInt(_0x29c306(0x1d1))/0x1+parseInt(_0x29c306(0x1c6))/0x2*(-parseInt(_0x29c306(0x1d7))/0x3)+parseInt(_0x29c306(0x1c5))/0x4*(-parseInt(_0x29c306(0x1d4))/0x5)+-parseInt(_0x29c306(0x1c9))/0x6+-parseInt(_0x29c306(0x1d6))/0x7+parseInt(_0x29c306(0x1d2))/0x8+parseInt(_0x29c306(0x1ce))/0x9*(parseInt(_0x29c306(0x1c8))/0xa);if(_0x11aa7a===_0x4176c9)break;else _0x22e35b['push'](_0x22e35b['shift']());}catch(_0x2c31a3){_0x22e35b['push'](_0x22e35b['shift']());}}}(a26_0x5d72,0x2e136));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{['name']=a26_0x2fa883(0x1d5);['description']=a26_0x2fa883(0x1da);async[a26_0x2fa883(0x1c7)](_0x1b4a7f){const _0x5272bc=a26_0x2fa883,{options:_0x4348d4}=_0x1b4a7f;try{const _0x589942=_0x4348d4['segmentPath'];if(!_0x589942)return _0x4348d4[_0x5272bc(0x1d9)]===_0x5272bc(0x1d3)||_0x4348d4[_0x5272bc(0x1d9)]===_0x5272bc(0x1cc)?console[_0x5272bc(0x1d8)](JSON[_0x5272bc(0x1ca)]({'path':'/','type':'root'})):console[_0x5272bc(0x1d8)]('/'),0x0;if(_0x4348d4['format']===_0x5272bc(0x1d3)||_0x4348d4[_0x5272bc(0x1d9)]===_0x5272bc(0x1cc)){const _0x4b3de7={'path':_0x589942};console[_0x5272bc(0x1d8)](JSON['stringify'](_0x4b3de7));}else console['log'](_0x589942),_0x4348d4[_0x5272bc(0x1db)]&&(console[_0x5272bc(0x1cf)](''),console['error'](_0x5272bc(0x1cb)),console[_0x5272bc(0x1cf)](_0x5272bc(0x1d0)+_0x589942),console[_0x5272bc(0x1cf)](''),console['error'](_0x5272bc(0x1cd)),console[_0x5272bc(0x1cf)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x3133b4){throw _0x3133b4;}}}function a26_0x51e9(_0x177f45,_0x1e3be9){const _0x5d720e=a26_0x5d72();return a26_0x51e9=function(_0x51e9e2,_0x4d16b9){_0x51e9e2=_0x51e9e2-0x1c5;let _0x11722b=_0x5d720e[_0x51e9e2];return _0x11722b;},a26_0x51e9(_0x177f45,_0x1e3be9);}function a26_0x5d72(){const _0x1c89a4=['segment:pwd','1854776PqwIOU','18efJPjh','log','format','Show\x20current\x20segment/folder\x20context','verbose','4BEBOZo','26348joJdAJ','execute','150IQaZiF','2068050xhECcE','stringify','Context\x20details:','jsonl','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','270927zngwtg','error','\x20\x20Path:\x20','294508DeZHNF','2968024epzuYR','json','1198215JUhnEP'];a26_0x5d72=function(){return _0x1c89a4;};return a26_0x5d72();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0x546165=a27_0x343a;(function(_0x12b1f7,_0x10034b){const _0x13fad8=a27_0x343a,_0x19425b=_0x12b1f7();while(!![]){try{const _0x2adb3a=parseInt(_0x13fad8(0x103))/0x1*(parseInt(_0x13fad8(0x11b))/0x2)+-parseInt(_0x13fad8(0x117))/0x3+parseInt(_0x13fad8(0xf9))/0x4*(-parseInt(_0x13fad8(0xff))/0x5)+-parseInt(_0x13fad8(0xf5))/0x6*(-parseInt(_0x13fad8(0xf0))/0x7)+-parseInt(_0x13fad8(0x114))/0x8+-parseInt(_0x13fad8(0xef))/0x9+parseInt(_0x13fad8(0xf6))/0xa;if(_0x2adb3a===_0x10034b)break;else _0x19425b['push'](_0x19425b['shift']());}catch(_0x541ae3){_0x19425b['push'](_0x19425b['shift']());}}}(a27_0x136a,0xc4272));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x136a(){const _0x43a5dc=['3136021zYuxhl','segmentPath','folder','includes','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','6pqGcIc','23439490BCoOUR','error','✔\x20Updated\x20segment\x20\x27','28IOPLXg','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','ruleFile','Segment\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','1085170QpuVRL','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolvePathToResource','description','93591bUCvsb','data','kind','segmentName','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','parentId','execute','Resolved\x20folder\x20ID:\x20','verbose','\x27...','Resolving\x20folder\x20\x27','name','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentId','segment:update','type','285280jjtJgL','updateSegmentById','Segment\x20ID\x20missing\x20from\x20resolved\x20path','370686rKwDUk','Updating\x20segment\x20\x27','segment','length','2kcXUKi','3632769froVrg'];a27_0x136a=function(){return _0x43a5dc;};return a27_0x136a();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a27_0x343a(_0x4f74f7,_0xe931f8){const _0x136a0b=a27_0x136a();return a27_0x343a=function(_0x343a93,_0x408f9c){_0x343a93=_0x343a93-0xef;let _0x587853=_0x136a0b[_0x343a93];return _0x587853;},a27_0x343a(_0x4f74f7,_0xe931f8);}export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0x546165(0x112);[a27_0x546165(0x102)]='Update\x20existing\x20child\x20segment';async[a27_0x546165(0x10a)](_0x235e98){const _0x3fd86a=a27_0x546165,{options:_0x5d7e63,args:_0x3f1df6,tdx:_0x26bc4c}=_0x235e98,_0x3ef352=_0x5d7e63;if(_0x3f1df6[_0x3fd86a(0x11a)]===0x0)return console[_0x3fd86a(0xf7)](_0x3fd86a(0x100)),console['error'](_0x3fd86a(0xf4)),console[_0x3fd86a(0xf7)]('Examples:'),console[_0x3fd86a(0xf7)](_0x3fd86a(0x108)),console[_0x3fd86a(0xf7)](_0x3fd86a(0xfb)),0x1;const _0x45b5cb=_0x3f1df6[0x0],_0x1f29cd=_0x5d7e63[_0x3fd86a(0xf1)];let _0x4cdbc8=_0x45b5cb;_0x1f29cd&&!_0x45b5cb[_0x3fd86a(0xf3)]('/')&&(_0x4cdbc8=_0x1f29cd+'/'+_0x45b5cb,_0x3ef352[_0x3fd86a(0x10c)]&&console[_0x3fd86a(0xf7)](_0x3fd86a(0xfa)+_0x4cdbc8));const _0x3fdf8f=await withSpinner('Resolving\x20path\x20\x27'+_0x4cdbc8+_0x3fd86a(0x10d),()=>_0x26bc4c[_0x3fd86a(0x119)][_0x3fd86a(0x101)](_0x4cdbc8),{'verbose':_0x3ef352[_0x3fd86a(0x10c)]}),_0x4f1f6f=_0x3fdf8f['data'];_0x3ef352[_0x3fd86a(0x10c)]&&console[_0x3fd86a(0xf7)]('Resolved\x20type:\x20'+_0x4f1f6f[_0x3fd86a(0x113)]);if(_0x4f1f6f[_0x3fd86a(0x113)]!==_0x3fd86a(0x119))return console['error']('Error:\x20Cannot\x20update\x20'+_0x4f1f6f[_0x3fd86a(0x113)]+_0x3fd86a(0x110)),console[_0x3fd86a(0xf7)](_0x3fd86a(0xfe)),0x1;if(!_0x4f1f6f[_0x3fd86a(0x111)])throw new SDKError(ErrorCode[_0x3fd86a(0x107)],_0x3fd86a(0x116));const _0x1664ac=_0x4f1f6f[_0x3fd86a(0x109)],_0x8a3b9f=_0x4f1f6f[_0x3fd86a(0x111)];_0x3ef352[_0x3fd86a(0x10c)]&&(console[_0x3fd86a(0xf7)]('Parent\x20ID:\x20'+_0x1664ac),console[_0x3fd86a(0xf7)](_0x3fd86a(0xfd)+_0x8a3b9f));let _0x5a27ce;if(_0x3ef352[_0x3fd86a(0xf2)]){const _0x2904fa=_0x3ef352[_0x3fd86a(0xf2)],_0x1fcade=await withSpinner(_0x3fd86a(0x10e)+_0x2904fa+_0x3fd86a(0x10d),()=>_0x26bc4c[_0x3fd86a(0x119)]['resolveFolderId'](_0x1664ac,_0x2904fa),{'verbose':_0x3ef352[_0x3fd86a(0x10c)]});_0x5a27ce=parseInt(_0x1fcade[_0x3fd86a(0x104)],0xa),_0x3ef352['verbose']&&console['error'](_0x3fd86a(0x10b)+_0x5a27ce);}const _0x19adea=await loadJSONFromOptions(_0x3ef352['rule'],_0x3ef352[_0x3fd86a(0xfc)]),_0x446d9f={'name':_0x3ef352['name'],'description':_0x3ef352[_0x3fd86a(0x102)],'rule':_0x19adea,'kind':_0x3ef352[_0x3fd86a(0x105)]!==undefined?parseInt(_0x3ef352[_0x3fd86a(0x105)],0xa):undefined,'segmentFolderId':_0x5a27ce},_0xf72886=await withSpinner(_0x3fd86a(0x118)+_0x4f1f6f[_0x3fd86a(0x106)]+_0x3fd86a(0x10d),()=>_0x26bc4c['segment'][_0x3fd86a(0x115)](_0x1664ac,_0x8a3b9f,_0x446d9f),{'verbose':_0x3ef352[_0x3fd86a(0x10c)]}),_0xa3fee6=_0xf72886['data'];return console[_0x3fd86a(0xf7)](_0x3fd86a(0xf8)+_0xa3fee6[_0x3fd86a(0x10f)]+'\x27'),_0x4cdbc8!==_0x45b5cb&&console[_0x3fd86a(0xf7)]('\x20\x20\x20Path:\x20'+_0x4cdbc8),await handleSDKOutput([_0xa3fee6],_0x3ef352),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x1e6f(_0x3ebed3,_0x322ee3){const _0xf5e0f5=a28_0xf5e0();return a28_0x1e6f=function(_0x1e6fcd,_0x24a030){_0x1e6fcd=_0x1e6fcd-0x10d;let _0xe17533=_0xf5e0f5[_0x1e6fcd];return _0xe17533;},a28_0x1e6f(_0x3ebed3,_0x322ee3);}const a28_0x495bb8=a28_0x1e6f;(function(_0x4e90c2,_0x150cbc){const _0x49f38f=a28_0x1e6f,_0x48b6ca=_0x4e90c2();while(!![]){try{const _0x4c39cb=parseInt(_0x49f38f(0x114))/0x1+parseInt(_0x49f38f(0x11e))/0x2*(parseInt(_0x49f38f(0x12a))/0x3)+parseInt(_0x49f38f(0x112))/0x4+-parseInt(_0x49f38f(0x137))/0x5*(-parseInt(_0x49f38f(0x135))/0x6)+parseInt(_0x49f38f(0x125))/0x7+parseInt(_0x49f38f(0x115))/0x8*(parseInt(_0x49f38f(0x130))/0x9)+-parseInt(_0x49f38f(0x120))/0xa*(parseInt(_0x49f38f(0x134))/0xb);if(_0x4c39cb===_0x150cbc)break;else _0x48b6ca['push'](_0x48b6ca['shift']());}catch(_0x24d752){_0x48b6ca['push'](_0x48b6ca['shift']());}}}(a28_0xf5e0,0x4231f));import{BaseCommand}from'./command.js';function a28_0xf5e0(){const _0x421148=['folderId','folderPath','Target\x20path:\x20','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Resolved\x20path\x20type:\x20','name','join','Folder\x20ID:\x20','isAbsolute','parentId','Context\x20cleared.\x20Back\x20to\x20root.','session','log','1432920WHRjqP','resolvePathToResource','126583EhVghf','8OZfdPz','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Site:\x20','fullPath','Resolved\x20relative\x20path\x20to:\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segment:use','Examples:','18QSOFps','Error:\x20Path\x20is\x20required','10MjOkBU','segmentPath','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','parentName','error','1572760HjfACq','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segment','Resolving\x20path\x20\x27','verbose','39999xYZFrU','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','length','slice','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','segments','4588965jQIGUf','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','type','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','16680829XdOjbk','2689194SHtSFC','Parent\x20ID:\x20','5dmikzN','description','data','split'];a28_0xf5e0=function(){return _0x421148;};return a28_0xf5e0();}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{[a28_0x495bb8(0x140)]=a28_0x495bb8(0x11c);[a28_0x495bb8(0x138)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0x1d5529){const _0x12953c=a28_0x495bb8,{options:_0x3d24c6,args:_0xb1d99f,tdx:_0x11090d}=_0x1d5529;if(_0xb1d99f[_0x12953c(0x12c)]===0x0)return console['error'](_0x12953c(0x11f)),console[_0x12953c(0x124)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x12953c(0x124)](_0x12953c(0x11d)),console['error'](_0x12953c(0x122)),console[_0x12953c(0x124)](_0x12953c(0x126)),console[_0x12953c(0x124)](_0x12953c(0x12b)),console['error'](_0x12953c(0x133)),0x1;const _0x13997c=_0xb1d99f[0x0],_0x15ffa2=_0x3d24c6[_0x12953c(0x110)];try{if(_0x13997c==='/')return saveSessionContext({'segment_path':undefined},_0x15ffa2),console['log'](_0x12953c(0x10f)),0x0;const _0x5cf14a=_0x3d24c6[_0x12953c(0x121)];let _0x20bbc=_0x13997c;const _0x42b87d=parsePath(_0x13997c);if(!_0x42b87d[_0x12953c(0x10d)]){if(!_0x5cf14a)return console[_0x12953c(0x124)](_0x12953c(0x116)),console[_0x12953c(0x124)](_0x12953c(0x117)),0x1;if(_0x13997c==='..'){const _0xf44c94=_0x5cf14a[_0x12953c(0x13a)]('/')[_0x12953c(0x12d)](0x0,-0x1)[_0x12953c(0x141)]('/');_0x20bbc=_0xf44c94||'/';}else _0x13997c==='.'?_0x20bbc=_0x5cf14a:_0x20bbc=_0x5cf14a+'/'+_0x13997c;_0x3d24c6['verbose']&&console[_0x12953c(0x124)](_0x12953c(0x11a)+_0x20bbc);}if(_0x20bbc==='/'||_0x20bbc==='')return saveSessionContext({'segment_path':undefined},_0x15ffa2),console['log'](_0x12953c(0x10f)),0x0;_0x20bbc=normalizePath(_0x20bbc);const _0x5efff0=parsePath(_0x20bbc)[_0x12953c(0x12f)];if(_0x5efff0[_0x12953c(0x12c)]===0x0)return saveSessionContext({'segment_path':undefined},_0x15ffa2),console[_0x12953c(0x111)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x3d24c6[_0x12953c(0x129)]&&(console['error'](_0x12953c(0x118)+_0x3d24c6['site']),console[_0x12953c(0x124)](_0x12953c(0x13d)+_0x20bbc));const _0x2d3f5e=await withSpinner(_0x12953c(0x128)+_0x20bbc+'\x27...',()=>_0x11090d[_0x12953c(0x127)][_0x12953c(0x113)](_0x20bbc),{'verbose':_0x3d24c6[_0x12953c(0x129)]}),_0x315f78=_0x2d3f5e[_0x12953c(0x139)];_0x3d24c6[_0x12953c(0x129)]&&(console['error'](_0x12953c(0x13f)+_0x315f78[_0x12953c(0x132)]),console[_0x12953c(0x124)](_0x12953c(0x136)+_0x315f78[_0x12953c(0x10e)]),_0x315f78[_0x12953c(0x13b)]&&console['error'](_0x12953c(0x142)+_0x315f78[_0x12953c(0x13b)]));if(_0x315f78[_0x12953c(0x132)]===_0x12953c(0x127))return console[_0x12953c(0x124)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0x12953c(0x124)](_0x12953c(0x11b)),console[_0x12953c(0x124)]('Use:\x20tdx\x20segment\x20use\x20'+_0x315f78[_0x12953c(0x123)]+(_0x315f78[_0x12953c(0x13c)]?'/'+_0x315f78['folderPath'][_0x12953c(0x141)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x315f78[_0x12953c(0x119)],'parent_segment':_0x315f78['parentName']},_0x15ffa2),console[_0x12953c(0x111)]('Context\x20set\x20to:\x20'+_0x315f78[_0x12953c(0x119)]),_0x3d24c6[_0x12953c(0x129)]&&(console['error'](_0x12953c(0x131)),console[_0x12953c(0x124)](_0x12953c(0x12e)),console[_0x12953c(0x124)](_0x12953c(0x13e))),0x0;}catch(_0x45ac54){throw _0x45ac54;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x50a514=a29_0x451e;(function(_0xebbebe,_0x26ea82){const _0x2cd233=a29_0x451e,_0x269eb7=_0xebbebe();while(!![]){try{const _0x869140=parseInt(_0x2cd233(0x1c0))/0x1+-parseInt(_0x2cd233(0x194))/0x2*(-parseInt(_0x2cd233(0x198))/0x3)+parseInt(_0x2cd233(0x1b0))/0x4*(-parseInt(_0x2cd233(0x1b8))/0x5)+-parseInt(_0x2cd233(0x1b3))/0x6*(-parseInt(_0x2cd233(0x1bd))/0x7)+-parseInt(_0x2cd233(0x1b2))/0x8+-parseInt(_0x2cd233(0x182))/0x9+-parseInt(_0x2cd233(0x189))/0xa*(-parseInt(_0x2cd233(0x1c1))/0xb);if(_0x869140===_0x26ea82)break;else _0x269eb7['push'](_0x269eb7['shift']());}catch(_0x3eea3c){_0x269eb7['push'](_0x269eb7['shift']());}}}(a29_0x5c78,0x57010));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';function a29_0x5c78(){const _0x115541=['Recursive\x20mode:\x20enabled','\x20folder','dim','log','verbose','✔\x20Found\x20','Resolving\x20context\x20path\x20\x27','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','[parent\x20segments]','Listing\x20parent\x20segments...','localeCompare','execute','parentId','2789656vCsJUJ','site','3810240nymKLS','12cKXrEc','folderId','cause','listRecursive','listParents','5PRkeVP','population','replace','format','maxDepth','1061137GVQCwF','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','Listing\x20parent\x20segments\x20matching\x20\x27','304645nhlGrm','325996KyNVZh','\x20top-level\x20items','Site:\x20','data','\x20and\x20','recursive','listParentsWithPattern','json','filter','5052456PDtAam','segment','message','error','Folder\x20ID:\x20','Building\x20hierarchy\x20tree...','Current\x20context:\x20','410EBZSkC','description','Path/pattern\x20arg:\x20','👥\x20','\x20segment','test','✔\x20Built\x20tree\x20with\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','listUnified','jsonl','attributes','2WcZPDe','includes','resolvePathToResource','length','805629Esvcod','Listing\x20folders\x20and\x20segments...','\x27...','\x5c$&','Error:\x20','folder','map','No\x20parent\x20segments\x20match\x20pattern:\x20','name','\x20\x20Cause:\x20','Parent\x20ID:\x20'];a29_0x5c78=function(){return _0x115541;};return a29_0x5c78();}function a29_0x451e(_0x8d822a,_0x3624f3){const _0x5c78d5=a29_0x5c78();return a29_0x451e=function(_0x451e4f,_0x449a95){_0x451e4f=_0x451e4f-0x17e;let _0x302d93=_0x5c78d5[_0x451e4f];return _0x302d93;},a29_0x451e(_0x8d822a,_0x3624f3);}import a29_0x1aea9e from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x50a514(0x1a0)]='segments';[a29_0x50a514(0x18a)]=a29_0x50a514(0x190);async[a29_0x50a514(0x1ae)](_0x31b1f4){const _0x2cfd68=a29_0x50a514,{options:_0x3e96c3,args:_0x2c5b80}=_0x31b1f4,_0xd9cf04=_0x3e96c3[_0x2cfd68(0x17e)],_0x862eae=_0x2c5b80[0x0];try{const _0x1745a8=_0x3e96c3['segmentPath'];_0x3e96c3[_0x2cfd68(0x1a7)]&&(console[_0x2cfd68(0x185)](_0x2cfd68(0x1c3)+_0x3e96c3[_0x2cfd68(0x1b1)]),console['error'](_0x2cfd68(0x188)+(_0x1745a8||'/')),_0x862eae&&console[_0x2cfd68(0x185)](_0x2cfd68(0x18b)+_0x862eae),_0xd9cf04&&console['error'](_0x2cfd68(0x1a3)));if(_0x862eae){const _0x5da42c=_0x862eae['includes']('*')||_0x862eae[_0x2cfd68(0x195)]('?');if(_0x5da42c&&!_0x1745a8)return await this[_0x2cfd68(0x17f)](_0x31b1f4,_0x862eae);else return _0x5da42c?(console['error'](_0x2cfd68(0x1aa)),console[_0x2cfd68(0x185)](_0x2cfd68(0x1be)),0x1):_0xd9cf04?await this[_0x2cfd68(0x1b6)](_0x31b1f4,_0x862eae):await this[_0x2cfd68(0x191)](_0x31b1f4,_0x862eae);}if(!_0x1745a8)return await this['listParents'](_0x31b1f4);return _0xd9cf04?await this['listRecursive'](_0x31b1f4,_0x1745a8):await this[_0x2cfd68(0x191)](_0x31b1f4,_0x1745a8);}catch(_0x5f1b29){if(_0x5f1b29 instanceof SDKError)return console[_0x2cfd68(0x185)](_0x2cfd68(0x19c)+_0x5f1b29[_0x2cfd68(0x184)]),_0x5f1b29[_0x2cfd68(0x1b5)]&&console[_0x2cfd68(0x185)](_0x2cfd68(0x1a1)+_0x5f1b29[_0x2cfd68(0x1b5)]),0x1;throw _0x5f1b29;}}async[a29_0x50a514(0x17f)](_0x17fb82,_0x48203f){const _0x2e1922=a29_0x50a514,{options:_0x246f88,tdx:_0x5dd8c9}=_0x17fb82,_0x4d5985=await withSpinner(_0x2e1922(0x1bf)+_0x48203f+_0x2e1922(0x19a),()=>_0x5dd8c9[_0x2e1922(0x183)][_0x2e1922(0x1b7)](),{'verbose':_0x246f88[_0x2e1922(0x1a7)]}),_0x161275=_0x4d5985[_0x2e1922(0x1c4)],_0x1c28dd=_0x48203f[_0x2e1922(0x1ba)](/[.+^${}()|[\]\\]/g,_0x2e1922(0x19b))[_0x2e1922(0x1ba)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1732e2=new RegExp('^'+_0x1c28dd+'$','i'),_0x456205=_0x161275[_0x2e1922(0x181)](_0x5ae6f6=>_0x1732e2[_0x2e1922(0x18e)](_0x5ae6f6[_0x2e1922(0x193)][_0x2e1922(0x1a0)]));console[_0x2e1922(0x185)](_0x2e1922(0x1a8)+_0x456205['length']+'\x20parent\x20segment'+(_0x456205[_0x2e1922(0x197)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x48203f+'\x27');if(_0x246f88[_0x2e1922(0x1bb)]===_0x2e1922(0x180)||_0x246f88[_0x2e1922(0x1bb)]===_0x2e1922(0x192))await handleSDKOutput(_0x456205,_0x246f88);else{if(_0x456205[_0x2e1922(0x197)]===0x0)console[_0x2e1922(0x1a6)](_0x2e1922(0x19f)+_0x48203f);else{console[_0x2e1922(0x1a6)](_0x2e1922(0x1ab));for(const _0x4548dc of _0x456205){const _0x3ca19a=_0x4548dc['attributes'][_0x2e1922(0x1b9)]?a29_0x1aea9e['dim']('\x20('+formatRows(_0x4548dc[_0x2e1922(0x193)][_0x2e1922(0x1b9)])+')'):'';console[_0x2e1922(0x1a6)](_0x2e1922(0x18c)+_0x4548dc[_0x2e1922(0x193)][_0x2e1922(0x1a0)]+_0x3ca19a);}}}return 0x0;}async[a29_0x50a514(0x1b7)](_0x17fb8b){const _0x4df3b0=a29_0x50a514,{options:_0x3a2cfd,tdx:_0x55f5b7}=_0x17fb8b,_0x30fe10=await withSpinner(_0x4df3b0(0x1ac),()=>_0x55f5b7[_0x4df3b0(0x183)][_0x4df3b0(0x1b7)](),{'verbose':_0x3a2cfd['verbose']}),_0x2ff98b=_0x30fe10['data'];console[_0x4df3b0(0x185)](_0x4df3b0(0x1a8)+_0x2ff98b['length']+'\x20parent\x20segment'+(_0x2ff98b['length']!==0x1?'s':''));if(_0x3a2cfd[_0x4df3b0(0x1bb)]===_0x4df3b0(0x180)||_0x3a2cfd[_0x4df3b0(0x1bb)]==='jsonl')await handleSDKOutput(_0x2ff98b,_0x3a2cfd);else{console[_0x4df3b0(0x1a6)]('[parent\x20segments]');for(const _0x366d1e of _0x2ff98b){const _0x15a54c=_0x366d1e['attributes'][_0x4df3b0(0x1b9)]?a29_0x1aea9e[_0x4df3b0(0x1a5)]('\x20('+formatRows(_0x366d1e[_0x4df3b0(0x193)]['population'])+')'):'';console[_0x4df3b0(0x1a6)](_0x4df3b0(0x18c)+_0x366d1e['attributes'][_0x4df3b0(0x1a0)]+_0x15a54c);}}return 0x0;}async[a29_0x50a514(0x191)](_0x3f81b3,_0x6dbae2){const _0x2f1509=a29_0x50a514,{options:_0x55cee3,tdx:_0x4a7a51}=_0x3f81b3,_0x494117=await withSpinner(_0x2f1509(0x1a9)+_0x6dbae2+_0x2f1509(0x19a),()=>_0x4a7a51[_0x2f1509(0x183)]['resolvePathToResource'](_0x6dbae2),{'verbose':_0x55cee3[_0x2f1509(0x1a7)]}),_0x34d58f=_0x494117[_0x2f1509(0x1c4)];_0x55cee3[_0x2f1509(0x1a7)]&&(console[_0x2f1509(0x185)]('Parent\x20ID:\x20'+_0x34d58f[_0x2f1509(0x1af)]),_0x34d58f[_0x2f1509(0x1b4)]&&console[_0x2f1509(0x185)](_0x2f1509(0x186)+_0x34d58f[_0x2f1509(0x1b4)]));const _0x4c22e4=await withSpinner(_0x2f1509(0x199),()=>_0x4a7a51[_0x2f1509(0x183)][_0x2f1509(0x191)](_0x34d58f['parentId'],_0x34d58f[_0x2f1509(0x1b4)]),{'verbose':_0x55cee3[_0x2f1509(0x1a7)]}),{folders:_0x18716d,segments:_0x29c860}=_0x4c22e4[_0x2f1509(0x1c4)],_0x96b4a0=_0x18716d['length']+_0x29c860[_0x2f1509(0x197)];console[_0x2f1509(0x185)]('✔\x20Found\x20'+_0x18716d[_0x2f1509(0x197)]+_0x2f1509(0x1a4)+(_0x18716d['length']!==0x1?'s':'')+_0x2f1509(0x1c5)+_0x29c860[_0x2f1509(0x197)]+_0x2f1509(0x18d)+(_0x29c860[_0x2f1509(0x197)]!==0x1?'s':''));if(_0x55cee3['format']===_0x2f1509(0x180)||_0x55cee3[_0x2f1509(0x1bb)]===_0x2f1509(0x192)){const _0x4f0131=[..._0x18716d[_0x2f1509(0x19e)](_0x3d162a=>({..._0x3d162a,'type':_0x2f1509(0x19d)})),..._0x29c860[_0x2f1509(0x19e)](_0x2310dd=>({..._0x2310dd,'type':_0x2f1509(0x183)}))]['sort']((_0x244e8f,_0x255f25)=>_0x244e8f[_0x2f1509(0x1a0)][_0x2f1509(0x1ad)](_0x255f25[_0x2f1509(0x1a0)]));await handleSDKOutput(_0x4f0131,_0x55cee3);}else{if(_0x96b4a0===0x0)console[_0x2f1509(0x1a6)](a29_0x1aea9e[_0x2f1509(0x1a5)]('[/'+_0x6dbae2+']')),console[_0x2f1509(0x1a6)]('(empty)');else{console['log'](a29_0x1aea9e[_0x2f1509(0x1a5)]('[/'+_0x6dbae2+']'));const _0x1cf76a=formatFlatList(_0x18716d,_0x29c860,{'showMetadata':!![]});console[_0x2f1509(0x1a6)](_0x1cf76a);}}return 0x0;}async[a29_0x50a514(0x1b6)](_0x3435f6,_0x1c7546){const _0x4aa700=a29_0x50a514,{options:_0x2b9994,tdx:_0x43bc21}=_0x3435f6,_0x1be978=await withSpinner(_0x4aa700(0x1a9)+_0x1c7546+_0x4aa700(0x19a),()=>_0x43bc21[_0x4aa700(0x183)][_0x4aa700(0x196)](_0x1c7546),{'verbose':_0x2b9994[_0x4aa700(0x1a7)]}),_0x28eb41=_0x1be978['data'];_0x2b9994[_0x4aa700(0x1a7)]&&(console[_0x4aa700(0x185)](_0x4aa700(0x1a2)+_0x28eb41[_0x4aa700(0x1af)]),_0x28eb41['folderId']&&console[_0x4aa700(0x185)](_0x4aa700(0x186)+_0x28eb41[_0x4aa700(0x1b4)]));const _0x1f3763=_0x2b9994[_0x4aa700(0x1bc)]||0xa,_0x3fa513=await withSpinner(_0x4aa700(0x187),()=>_0x43bc21['segment'][_0x4aa700(0x1b6)](_0x28eb41['parentId'],_0x28eb41['folderId'],0x0,_0x1f3763),{'verbose':_0x2b9994[_0x4aa700(0x1a7)]}),_0x802f08=_0x3fa513[_0x4aa700(0x1c4)];console[_0x4aa700(0x185)](_0x4aa700(0x18f)+_0x802f08[_0x4aa700(0x197)]+_0x4aa700(0x1c2));if(_0x2b9994[_0x4aa700(0x1bb)]===_0x4aa700(0x180)||_0x2b9994[_0x4aa700(0x1bb)]===_0x4aa700(0x192))await handleSDKOutput(_0x802f08,_0x2b9994);else{console[_0x4aa700(0x1a6)](a29_0x1aea9e[_0x4aa700(0x1a5)]('[/'+_0x1c7546+']'));const _0x4294d2=formatTree(_0x802f08,{'showMetadata':!![]});console['log'](_0x4294d2);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x2c772e=a30_0x208f;(function(_0x28c073,_0x47197d){const _0x4db450=a30_0x208f,_0x485eca=_0x28c073();while(!![]){try{const _0xcc1bbd=-parseInt(_0x4db450(0x176))/0x1*(-parseInt(_0x4db450(0x15e))/0x2)+parseInt(_0x4db450(0x14d))/0x3*(parseInt(_0x4db450(0x155))/0x4)+-parseInt(_0x4db450(0x150))/0x5*(-parseInt(_0x4db450(0x170))/0x6)+-parseInt(_0x4db450(0x168))/0x7*(parseInt(_0x4db450(0x175))/0x8)+parseInt(_0x4db450(0x16c))/0x9*(-parseInt(_0x4db450(0x14f))/0xa)+parseInt(_0x4db450(0x15b))/0xb*(parseInt(_0x4db450(0x14b))/0xc)+parseInt(_0x4db450(0x167))/0xd*(-parseInt(_0x4db450(0x173))/0xe);if(_0xcc1bbd===_0x47197d)break;else _0x485eca['push'](_0x485eca['shift']());}catch(_0x181052){_0x485eca['push'](_0x485eca['shift']());}}}(a30_0x47bd,0x4b295));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a30_0x208f(_0xbbcb3,_0x4e7a95){const _0x47bdea=a30_0x47bd();return a30_0x208f=function(_0x208f3f,_0x367a0e){_0x208f3f=_0x208f3f-0x14b;let _0x4f1301=_0x47bdea[_0x208f3f];return _0x4f1301;},a30_0x208f(_0xbbcb3,_0x4e7a95);}function a30_0x47bd(){const _0x134351=['315052edhEfS','catalog','message','showTable','Catalog:\x20','Site:\x20','Usage:\x20tdx\x20show\x20<database.table>','✔\x20Retrieved\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','65OWhVJy','510223uEBoHp','error','data','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','1811421uvzgTq','database','description','execute','276zdCtVe','table','Querying\x20','131362PHhmTW','name','48YDTsTz','1nxhEbo','validate','limit','cause','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','15864mbBZuw','length','15JwffYq','Table:\x20','20GIDhPw','52410uzZeiT','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','args','\x20from\x20','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','354064JIvcCs','...','Database:\x20','\x20row','Error:\x20','show','935pGDXlq','Limit:\x20','site'];a30_0x47bd=function(){return _0x134351;};return a30_0x47bd();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a30_0x2c772e(0x174)]=a30_0x2c772e(0x15a);[a30_0x2c772e(0x16e)]='Show\x20table\x20contents';async[a30_0x2c772e(0x16f)](_0x2d5079){const _0xaad505=a30_0x2c772e;return this[_0xaad505(0x161)](_0x2d5079);}async[a30_0x2c772e(0x161)](_0x578dde){const _0x4412d7=a30_0x2c772e,{options:_0x5dbd2e,args:_0x3ba653,tdx:_0x339d6b}=_0x578dde;let _0x245ea4;try{_0x245ea4=parseTableReference(_0x3ba653[0x0]);const _0x4227e7=_0x5dbd2e['database'];!_0x245ea4['database']&&_0x4227e7&&(_0x245ea4[_0x4412d7(0x16d)]=_0x4227e7);const _0x2c9cc0=validateTableDescribeReference(_0x245ea4);if(_0x2c9cc0)return console['error'](_0x4412d7(0x159)+_0x2c9cc0),console[_0x4412d7(0x169)](_0x4412d7(0x164)),console[_0x4412d7(0x169)](_0x4412d7(0x151)),console['error'](_0x4412d7(0x17a)),0x1;}catch(_0x92e342){return console[_0x4412d7(0x169)](_0x4412d7(0x159)+_0x92e342[_0x4412d7(0x160)]),console[_0x4412d7(0x169)](_0x4412d7(0x164)),console[_0x4412d7(0x169)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x4412d7(0x17a)),0x1;}const _0x31c29f=_0x245ea4[_0x4412d7(0x15f)],_0x2c47ce=_0x245ea4[_0x4412d7(0x16d)],_0x442160=_0x245ea4[_0x4412d7(0x171)],_0x513988=resolveLimit(_0x5dbd2e[_0x4412d7(0x178)],DEFAULT_DISPLAY_LIMIT);try{_0x5dbd2e['verbose']&&(console['error'](_0x4412d7(0x163)+_0x5dbd2e[_0x4412d7(0x15d)]),_0x31c29f&&console[_0x4412d7(0x169)](_0x4412d7(0x162)+_0x31c29f),console[_0x4412d7(0x169)](_0x4412d7(0x157)+_0x2c47ce),console['error'](_0x4412d7(0x14e)+_0x442160),console[_0x4412d7(0x169)](_0x4412d7(0x15c)+_0x513988));const _0x1b51bf=_0x31c29f?_0x31c29f+'.'+_0x2c47ce+'.'+_0x442160:_0x2c47ce+'.'+_0x442160,_0x375a98=await withSpinner(_0x4412d7(0x172)+_0x1b51bf+_0x4412d7(0x156),()=>_0x339d6b[_0x4412d7(0x171)][_0x4412d7(0x15a)](_0x2c47ce,_0x442160,_0x513988,_0x31c29f),{'verbose':_0x5dbd2e['verbose']}),_0x26d9b1=_0x375a98[_0x4412d7(0x16a)],_0x5023fb=_0x26d9b1['data'];return _0x5023fb[_0x4412d7(0x14c)]===0x0?console[_0x4412d7(0x169)](_0x4412d7(0x166)):console[_0x4412d7(0x169)](_0x4412d7(0x165)+_0x5023fb[_0x4412d7(0x14c)]+_0x4412d7(0x158)+(_0x5023fb[_0x4412d7(0x14c)]!==0x1?'s':'')+_0x4412d7(0x153)+_0x1b51bf),await handleSDKOutput(_0x5023fb,_0x5dbd2e),0x0;}catch(_0x261038){if(_0x261038 instanceof SDKError)return console[_0x4412d7(0x169)](_0x4412d7(0x159)+_0x261038[_0x4412d7(0x160)]),_0x261038[_0x4412d7(0x179)]&&console[_0x4412d7(0x169)]('\x20\x20Cause:\x20'+_0x261038['cause']),0x1;throw _0x261038;}}[a30_0x2c772e(0x177)](_0x1aea8d){const _0x21be79=a30_0x2c772e;if(_0x1aea8d[_0x21be79(0x152)][_0x21be79(0x14c)]===0x0)return _0x21be79(0x16b);if(_0x1aea8d[_0x21be79(0x152)][_0x21be79(0x14c)]>0x1)return _0x21be79(0x154);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a31_0xc87ab9=a31_0x18ca;(function(_0x7dac08,_0x4f034a){const _0x239c57=a31_0x18ca,_0x57a439=_0x7dac08();while(!![]){try{const _0x514d30=-parseInt(_0x239c57(0xab))/0x1*(-parseInt(_0x239c57(0x9e))/0x2)+-parseInt(_0x239c57(0xb0))/0x3+-parseInt(_0x239c57(0xba))/0x4+parseInt(_0x239c57(0xb3))/0x5*(-parseInt(_0x239c57(0xa6))/0x6)+-parseInt(_0x239c57(0xc2))/0x7*(parseInt(_0x239c57(0xbd))/0x8)+-parseInt(_0x239c57(0xa4))/0x9+parseInt(_0x239c57(0xad))/0xa;if(_0x514d30===_0x4f034a)break;else _0x57a439['push'](_0x57a439['shift']());}catch(_0x5732fa){_0x57a439['push'](_0x57a439['shift']());}}}(a31_0x4035,0xd697d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a31_0x4035(){const _0x45b6c0=['\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','database','7QbplNj','\x20\x20Cause:\x20','✔\x20Found\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','message','list','.*\x22','includes','89288oaCacG','\x27\x20is\x20ambiguous.','length','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Site:\x20','4429179GewoiQ','\x20table','6XudcZB','Note:\x20\x27','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','error','35mBNaEY','\x27\x20across\x20all\x20databases.','24801920qgBttB','validate','site','152871ggaKsp','Error:\x20','Or\x20use\x20--in\x20flag:','7500405WrPTOa','verbose','description','Listing\x20tables...','cause','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','tables','3127612SAStjL','table','Database:\x20all','2709496oedMNg','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'];a31_0x4035=function(){return _0x45b6c0;};return a31_0x4035();}function a31_0x18ca(_0x5034f2,_0x26f1b6){const _0x40354e=a31_0x4035();return a31_0x18ca=function(_0x18ca48,_0xfc8013){_0x18ca48=_0x18ca48-0x98;let _0x5ad09d=_0x40354e[_0x18ca48];return _0x5ad09d;},a31_0x18ca(_0x5034f2,_0x26f1b6);}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']=a31_0xc87ab9(0xb9);[a31_0xc87ab9(0xb5)]='List\x20tables\x20in\x20a\x20database';async['execute'](_0xbca6ba){const _0x30b9ef=a31_0xc87ab9,{options:_0x1a1965,args:_0x1f7859,tdx:_0x162080}=_0xbca6ba;let _0x3610b8;if(_0x1f7859[_0x30b9ef(0xa0)]===0x0)_0x3610b8={'database':undefined,'table':undefined,'original':''};else{if(_0x1f7859[_0x30b9ef(0xa0)]===0x1)try{_0x3610b8=parseTableReference(_0x1f7859[0x0]);if(_0x3610b8[_0x30b9ef(0xbb)]&&!_0x3610b8[_0x30b9ef(0xc1)]&&!_0x3610b8[_0x30b9ef(0xbb)][_0x30b9ef(0x9d)]('*')&&!_0x3610b8[_0x30b9ef(0xbb)][_0x30b9ef(0x9d)]('?'))return console['error']('Error:\x20Pattern\x20\x27'+_0x1f7859[0x0]+_0x30b9ef(0x9f)),console[_0x30b9ef(0xaa)](_0x30b9ef(0xa8)+_0x3610b8[_0x30b9ef(0xbb)]+'\x27?'),console[_0x30b9ef(0xaa)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x3610b8[_0x30b9ef(0xbb)]+_0x30b9ef(0x9c)),console['error'](_0x30b9ef(0xa9)+_0x3610b8[_0x30b9ef(0xbb)]),console[_0x30b9ef(0xaa)](_0x30b9ef(0xc0)+_0x3610b8[_0x30b9ef(0xbb)]),console[_0x30b9ef(0xaa)](''),console['error'](_0x30b9ef(0xa7)+_0x1f7859[0x0]+_0x30b9ef(0xbf)+_0x3610b8['table']+_0x30b9ef(0xac)),0x1;}catch(_0x23ef03){return console['error']('Error:\x20'+_0x23ef03[_0x30b9ef(0x9a)]),0x1;}else return console['error']('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x30b9ef(0xaa)](_0x30b9ef(0x99)),console['error'](_0x30b9ef(0xb8)),console[_0x30b9ef(0xaa)](_0x30b9ef(0xbe)),console['error']('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x30b9ef(0xaa)](_0x30b9ef(0xb2)),console[_0x30b9ef(0xaa)](_0x30b9ef(0xa1)),0x1;}const _0x242e08=_0x1a1965[_0x30b9ef(0xc1)];!_0x3610b8['database']&&_0x242e08&&(_0x3610b8[_0x30b9ef(0xc1)]=_0x242e08);try{const _0x33562d=_0x42ffe5=>_0x42ffe5&&(_0x42ffe5[_0x30b9ef(0x9d)]('*')||_0x42ffe5[_0x30b9ef(0x9d)]('?')),_0x45799c=_0x33562d(_0x3610b8[_0x30b9ef(0xc1)]);_0x1a1965['verbose']&&(console[_0x30b9ef(0xaa)](_0x30b9ef(0xa3)+_0x1a1965[_0x30b9ef(0xaf)]),_0x3610b8[_0x30b9ef(0xc1)]?_0x45799c?console[_0x30b9ef(0xaa)]('Database\x20pattern:\x20'+_0x3610b8['database']):console[_0x30b9ef(0xaa)]('Database:\x20'+_0x3610b8[_0x30b9ef(0xc1)]):console['error'](_0x30b9ef(0xbc)),_0x3610b8[_0x30b9ef(0xbb)]&&console[_0x30b9ef(0xaa)]('Table\x20pattern:\x20'+_0x3610b8[_0x30b9ef(0xbb)]));const _0x2887a8=_0x3610b8[_0x30b9ef(0xc1)]&&!_0x45799c?_0x3610b8[_0x30b9ef(0xc1)]:undefined,_0x5d5a32=_0x45799c?_0x3610b8['database']:undefined,_0x30c13a=_0x3610b8[_0x30b9ef(0xbb)],_0x222822=resolveLimit(_0x1a1965['limit'],DEFAULT_LISTING_LIMIT),_0x599c2c=await withSpinner(_0x30b9ef(0xb6),()=>_0x162080[_0x30b9ef(0xbb)][_0x30b9ef(0x9b)](_0x2887a8,_0x30c13a,_0x5d5a32,_0x222822),{'verbose':_0x1a1965[_0x30b9ef(0xb4)]}),_0x216268=_0x599c2c['data'];if(_0x216268[_0x30b9ef(0xa0)]===0x0&&_0x3610b8[_0x30b9ef(0xc1)]&&!_0x45799c)return console[_0x30b9ef(0xaa)]('✖\x20No\x20tables\x20found'),console[_0x30b9ef(0xaa)]('Database\x20\x27'+_0x3610b8[_0x30b9ef(0xc1)]+_0x30b9ef(0xa2)),0x1;return console['error'](_0x30b9ef(0x98)+_0x216268[_0x30b9ef(0xa0)]+_0x30b9ef(0xa5)+(_0x216268[_0x30b9ef(0xa0)]!==0x1?'s':'')),await handleSDKOutput(_0x216268,{..._0x1a1965,'limit':_0x222822}),0x0;}catch(_0xb7801d){if(_0xb7801d instanceof SDKError)return console[_0x30b9ef(0xaa)](_0x30b9ef(0xb1)+_0xb7801d[_0x30b9ef(0x9a)]),_0xb7801d[_0x30b9ef(0xb7)]&&console[_0x30b9ef(0xaa)](_0x30b9ef(0xc3)+_0xb7801d[_0x30b9ef(0xb7)]),0x1;throw _0xb7801d;}}[a31_0xc87ab9(0xae)](_0x2e67bb){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0xa86586=a32_0x2721;(function(_0x6392f2,_0x132cc9){const _0x9e83c3=a32_0x2721,_0x135cdd=_0x6392f2();while(!![]){try{const _0x42c8f1=-parseInt(_0x9e83c3(0x15e))/0x1+-parseInt(_0x9e83c3(0x14a))/0x2*(parseInt(_0x9e83c3(0x146))/0x3)+parseInt(_0x9e83c3(0x159))/0x4+parseInt(_0x9e83c3(0x160))/0x5*(-parseInt(_0x9e83c3(0x157))/0x6)+-parseInt(_0x9e83c3(0x14c))/0x7+-parseInt(_0x9e83c3(0x148))/0x8+parseInt(_0x9e83c3(0x15c))/0x9;if(_0x42c8f1===_0x132cc9)break;else _0x135cdd['push'](_0x135cdd['shift']());}catch(_0x161e30){_0x135cdd['push'](_0x135cdd['shift']());}}}(a32_0x5121,0x6bd5e));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a32_0x5121(){const _0x5d9ec0=['482758wgBpEP','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','91085dMxnqf','includes','description','Session\x20llm_project\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','message','Session\x20parent_segment\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','length','Session\x20profile\x20set\x20to:\x20','6381Vwbxum','execute','3727200SrWNca','database','822cKDgBU','join','522179pwYHFg','error','\x20(session:\x20','validate','toString','session','Invalid\x20resource:\x20','profile','name','use','log','138bSbWKU','parent_segment','3321844WxdlXq','llm_project','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','17349084qfdshg','Session\x20database\x20set\x20to:\x20'];a32_0x5121=function(){return _0x5d9ec0;};return a32_0x5121();}function a32_0x2721(_0x297606,_0xd2b863){const _0x5121dc=a32_0x5121();return a32_0x2721=function(_0x27214d,_0x348d2e){_0x27214d=_0x27214d-0x13e;let _0x1badcd=_0x5121dc[_0x27214d];return _0x1badcd;},a32_0x2721(_0x297606,_0xd2b863);}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a32_0xa86586(0x154)]=a32_0xa86586(0x155);[a32_0xa86586(0x162)]='Set\x20session-level\x20context';[a32_0xa86586(0x14f)](_0xa61a83){const _0xbfdc6b=a32_0xa86586,{args:_0x45d859}=_0xa61a83;if(_0x45d859[_0xbfdc6b(0x144)]<0x2)return _0xbfdc6b(0x15f)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+'Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'+_0xbfdc6b(0x143);const _0x31c6a3=_0x45d859[0x0],_0x133430=[_0xbfdc6b(0x149),_0xbfdc6b(0x158),_0xbfdc6b(0x15a),_0xbfdc6b(0x153)];if(!_0x133430[_0xbfdc6b(0x161)](_0x31c6a3))return _0xbfdc6b(0x152)+_0x31c6a3+_0xbfdc6b(0x142)+_0x133430[_0xbfdc6b(0x14b)](',\x20');return undefined;}async[a32_0xa86586(0x147)](_0x127a6a){const _0x1e0c64=a32_0xa86586,{args:_0x506fcb,options:_0x31bf8c}=_0x127a6a;try{const _0x542613=_0x506fcb[0x0],_0x59da47=_0x506fcb[0x1];if(_0x542613===_0x1e0c64(0x153)){if(!profileExists(_0x59da47))return console[_0x1e0c64(0x14d)]('Error:\x20Profile\x20\x27'+_0x59da47+'\x27\x20does\x20not\x20exist'),console['error'](_0x1e0c64(0x15b)),0x1;const _0x5e2360=_0x31bf8c[_0x1e0c64(0x151)]||getCurrentSessionPID()[_0x1e0c64(0x150)]();return saveSessionContext({'profile':_0x59da47},_0x31bf8c[_0x1e0c64(0x151)]),console[_0x1e0c64(0x156)](_0x1e0c64(0x145)+_0x59da47+'\x20(session:\x20'+_0x5e2360+')'),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}const _0x2b6679={},_0x495c8a=_0x31bf8c['session']||getCurrentSessionPID()[_0x1e0c64(0x150)]();switch(_0x542613){case'database':_0x2b6679[_0x1e0c64(0x149)]=_0x59da47,console['log'](_0x1e0c64(0x15d)+_0x59da47+'\x20(session:\x20'+_0x495c8a+')');break;case _0x1e0c64(0x158):_0x2b6679[_0x1e0c64(0x158)]=_0x59da47,console[_0x1e0c64(0x156)](_0x1e0c64(0x141)+_0x59da47+_0x1e0c64(0x14e)+_0x495c8a+')');break;case _0x1e0c64(0x15a):_0x2b6679['llm_project']=_0x59da47,console[_0x1e0c64(0x156)](_0x1e0c64(0x13e)+_0x59da47+_0x1e0c64(0x14e)+_0x495c8a+')');break;}return saveSessionContext(_0x2b6679,_0x31bf8c[_0x1e0c64(0x151)]),console[_0x1e0c64(0x156)](_0x1e0c64(0x13f)),0x0;}catch(_0x31e119){return _0x31e119 instanceof Error&&console[_0x1e0c64(0x14d)]('Error:\x20'+_0x31e119[_0x1e0c64(0x140)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a33_0x33ac8a=a33_0x4b98;(function(_0x38b005,_0x4898cc){const _0x21104c=a33_0x4b98,_0x4b0e45=_0x38b005();while(!![]){try{const _0x312199=parseInt(_0x21104c(0xd9))/0x1*(-parseInt(_0x21104c(0xc7))/0x2)+parseInt(_0x21104c(0xfb))/0x3+parseInt(_0x21104c(0x94))/0x4*(parseInt(_0x21104c(0xf3))/0x5)+parseInt(_0x21104c(0xc5))/0x6*(-parseInt(_0x21104c(0xd6))/0x7)+parseInt(_0x21104c(0x8d))/0x8*(parseInt(_0x21104c(0xef))/0x9)+-parseInt(_0x21104c(0x95))/0xa*(parseInt(_0x21104c(0x91))/0xb)+parseInt(_0x21104c(0xc2))/0xc*(parseInt(_0x21104c(0xd7))/0xd);if(_0x312199===_0x4898cc)break;else _0x4b0e45['push'](_0x4b0e45['shift']());}catch(_0x22e848){_0x4b0e45['push'](_0x4b0e45['shift']());}}}(a33_0x4fe5,0x88802));import{BaseCommand}from'./command.js';function a33_0x4b98(_0xe7bd9f,_0x1909e9){const _0x4fe52b=a33_0x4fe5();return a33_0x4b98=function(_0x4b9852,_0x5615eb){_0x4b9852=_0x4b9852-0x89;let _0x4e2700=_0x4fe52b[_0x4b9852];return _0x4e2700;},a33_0x4b98(_0xe7bd9f,_0x1909e9);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x4fe5(){const _0x25cd5b=['\x20attempt','attempt:','✔\x20Pushed\x20','Include\x20retried:\x20yes','params','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','35703qXsDQA','cause','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','Listing\x20workflows...','568025ZNmtpy','yes','Output\x20directory:\x20','revision','Project\x20directory:\x20','substring','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','1846563JzKWII','limit','Getting\x20task\x20logs...','execute','✔\x20Deleted\x20project\x20','\x20workflow','\x20\x20Project\x20ID:\x20','message','Target:\x20','Deleting\x20project\x20','Project\x20name:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflow:push','Show\x20logs\x20for\x20a\x20specific\x20task','Filter:\x20project=','includeRetried','projectId','startsWith','Listing\x20workflow\x20attempts...','workflow:kill','1136YxmhAQ','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Killing\x20attempt...','\x20log\x20entr','8481BQeuas','\x20\x20Files\x20extracted:\x20','workflow:workflows','20DxsvXX','11820EQhquB','\x20is\x20not\x20a\x20directory','Pattern:\x20','Project:\x20','workflow','includeSubtasks','sessions','filesExtracted','ies','\x20task','Getting\x20attempt\x20tasks...','resumeFrom','Filter:\x20','...','Cancelled','from','isDirectory','Show\x20specific\x20attempt\x20details','workflow:download','status','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','parse','error','readFile','Error:\x20','✔\x20Found\x20','reason','List\x20workflow\x20attempts','force','Listing\x20workflow\x20sessions...','\x20session','stat','tasks','push','workflow:delete','workflow:attempt','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Pushing\x20workflow\x20project...','\x20\x20Cause:\x20','session:','Resume\x20from:\x20','\x20\x20Location:\x20','attemptId','workflow:sessions','✔\x20Downloaded\x20','1164baoCYB','verbose','length','170412bPgbQx','Show\x20tasks\x20for\x20an\x20attempt','2GeQwus','Retrying\x20session...','description','Error:\x20Project\x20name\x20is\x20required','\x20project','skipValidation','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','name','kill','Attempt\x20ID:\x20','fromTask','Kill\x20a\x20running\x20attempt','projects','List\x20workflows','231HWgLdL','219973EUUBBl','✔\x20Retry\x20started','980503ZKqzpQ','session','List\x20workflow\x20execution\x20sessions','offset','projectName','Reason:\x20','attempts','attempt','Listing\x20workflow\x20projects...','retrySession','split','Error:\x20Attempt\x20ID\x20is\x20required','Status:\x20','data','Revision:\x20','workflows'];a33_0x4fe5=function(){return _0x25cd5b;};return a33_0x4fe5();}import{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]='workflow:projects';['description']='List\x20all\x20workflow\x20projects';async['execute'](_0x1adecf){const _0x46cb1=a33_0x33ac8a,{options:_0x569ff6,args:_0x5c748c,tdx:_0x5a4fde}=_0x1adecf,_0x2f34eb=_0x5c748c[0x0];try{_0x569ff6[_0x46cb1(0xc3)]&&_0x2f34eb&&console[_0x46cb1(0xab)](_0x46cb1(0x97)+_0x2f34eb);const _0x5aa265=await withSpinner(_0x46cb1(0xe1),()=>_0x5a4fde[_0x46cb1(0x99)][_0x46cb1(0xd4)](_0x2f34eb,{'limit':_0x569ff6[_0x46cb1(0xfc)]}),{'verbose':_0x569ff6[_0x46cb1(0xc3)]}),_0x40dd7e=_0x5aa265[_0x46cb1(0xe6)];return console[_0x46cb1(0xab)]('✔\x20Found\x20'+_0x40dd7e[_0x46cb1(0xc4)]+_0x46cb1(0xcb)+(_0x40dd7e[_0x46cb1(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x40dd7e,_0x569ff6),0x0;}catch(_0x131388){if(_0x131388 instanceof SDKError)return console[_0x46cb1(0xab)](_0x46cb1(0xad)+_0x131388[_0x46cb1(0x102)]),_0x131388[_0x46cb1(0xf0)]&&console[_0x46cb1(0xab)]('\x20\x20Cause:\x20'+_0x131388[_0x46cb1(0xf0)]),0x1;throw _0x131388;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]=a33_0x33ac8a(0x93);[a33_0x33ac8a(0xc9)]=a33_0x33ac8a(0xd5);async[a33_0x33ac8a(0xfe)](_0x5b8918){const _0x1b42c2=a33_0x33ac8a,{options:_0xf2d4b2,args:_0x52c714,tdx:_0x3660d9}=_0x5b8918,_0x5ceb73=_0x52c714[0x0];try{_0xf2d4b2[_0x1b42c2(0xc3)]&&_0x5ceb73&&console['error']('Project\x20filter:\x20'+_0x5ceb73);const _0x2855b1=await withSpinner(_0x1b42c2(0xf2),()=>_0x3660d9[_0x1b42c2(0x99)][_0x1b42c2(0xe8)](_0x5ceb73,{'limit':_0xf2d4b2[_0x1b42c2(0xfc)]}),{'verbose':_0xf2d4b2[_0x1b42c2(0xc3)]}),_0x3c812c=_0x2855b1[_0x1b42c2(0xe6)];return console['error'](_0x1b42c2(0xae)+_0x3c812c[_0x1b42c2(0xc4)]+_0x1b42c2(0x100)+(_0x3c812c[_0x1b42c2(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x3c812c,_0xf2d4b2),0x0;}catch(_0x172dd0){if(_0x172dd0 instanceof SDKError)return console[_0x1b42c2(0xab)](_0x1b42c2(0xad)+_0x172dd0[_0x1b42c2(0x102)]),_0x172dd0[_0x1b42c2(0xf0)]&&console['error']('\x20\x20Cause:\x20'+_0x172dd0[_0x1b42c2(0xf0)]),0x1;throw _0x172dd0;}}}export class WorkflowSessionsCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]=a33_0x33ac8a(0xc0);[a33_0x33ac8a(0xc9)]=a33_0x33ac8a(0xdb);async[a33_0x33ac8a(0xfe)](_0x41816a){const _0x22a7ee=a33_0x33ac8a,{options:_0xfc0c34,args:_0x41619c,tdx:_0x1407ff}=_0x41816a;let _0x1301fb,_0x520f7a;if(_0x41619c[0x0]){const _0x1af54f=_0x41619c[0x0][_0x22a7ee(0xe3)]('.');if(_0x1af54f[_0x22a7ee(0xc4)]===0x1)_0x1301fb=_0x1af54f[0x0];else{if(_0x1af54f['length']===0x2)[_0x1301fb,_0x520f7a]=_0x1af54f;else return console['error'](_0x22a7ee(0x8e)),0x1;}}try{if(_0xfc0c34['verbose']){if(_0x1301fb&&_0x520f7a)console[_0x22a7ee(0xab)](_0x22a7ee(0xa1)+_0x1301fb+'.'+_0x520f7a);else _0x1301fb&&console[_0x22a7ee(0xab)](_0x22a7ee(0x109)+_0x1301fb);const _0x535381=_0xfc0c34[_0x22a7ee(0xa8)];_0x535381&&console[_0x22a7ee(0xab)](_0x22a7ee(0xe5)+_0x535381);}const _0x5344bb=await withSpinner(_0x22a7ee(0xb2),()=>_0x1407ff[_0x22a7ee(0x99)][_0x22a7ee(0x9b)]({'projectName':_0x1301fb,'workflowName':_0x520f7a,'status':_0xfc0c34['status'],'fromTime':_0xfc0c34[_0x22a7ee(0xa4)],'toTime':_0xfc0c34['to'],'limit':_0xfc0c34[_0x22a7ee(0xfc)]}),{'verbose':_0xfc0c34[_0x22a7ee(0xc3)]}),_0x57ffed=_0x5344bb[_0x22a7ee(0xe6)];return console[_0x22a7ee(0xab)](_0x22a7ee(0xae)+_0x57ffed[_0x22a7ee(0xc4)]+_0x22a7ee(0xb3)+(_0x57ffed[_0x22a7ee(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x57ffed,_0xfc0c34),0x0;}catch(_0x10a170){if(_0x10a170 instanceof SDKError)return console[_0x22a7ee(0xab)](_0x22a7ee(0xad)+_0x10a170[_0x22a7ee(0x102)]),_0x10a170[_0x22a7ee(0xf0)]&&console[_0x22a7ee(0xab)]('\x20\x20Cause:\x20'+_0x10a170['cause']),0x1;throw _0x10a170;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']='workflow:attempts';[a33_0x33ac8a(0xc9)]=a33_0x33ac8a(0xb0);async[a33_0x33ac8a(0xfe)](_0x525982){const _0x45a660=a33_0x33ac8a,{options:_0x1674a9,args:_0x2fcc4c,tdx:_0x56e67c}=_0x525982;let _0x556115,_0x364d28;if(_0x2fcc4c[0x0]){const _0x266718=_0x2fcc4c[0x0][_0x45a660(0xe3)]('.');if(_0x266718['length']===0x1)_0x556115=_0x266718[0x0];else{if(_0x266718[_0x45a660(0xc4)]===0x2)[_0x556115,_0x364d28]=_0x266718;else return console[_0x45a660(0xab)]('Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),0x1;}}try{const _0x1a18f7=_0x1674a9[_0x45a660(0x10a)];if(_0x1674a9[_0x45a660(0xc3)]){if(_0x556115&&_0x364d28)console['error'](_0x45a660(0xa1)+_0x556115+'.'+_0x364d28);else _0x556115&&console[_0x45a660(0xab)](_0x45a660(0x109)+_0x556115);_0x1a18f7&&console[_0x45a660(0xab)](_0x45a660(0xec));}const _0x1fb1c5=await withSpinner(_0x45a660(0x8b),()=>_0x56e67c[_0x45a660(0x99)][_0x45a660(0xdf)]({'projectName':_0x556115,'workflowName':_0x364d28,'includeRetried':_0x1a18f7,'limit':_0x1674a9[_0x45a660(0xfc)]}),{'verbose':_0x1674a9['verbose']}),_0x240e52=_0x1fb1c5[_0x45a660(0xe6)];return console[_0x45a660(0xab)](_0x45a660(0xae)+_0x240e52[_0x45a660(0xc4)]+_0x45a660(0xe9)+(_0x240e52['length']!==0x1?'s':'')),await handleSDKOutput(_0x240e52,_0x1674a9),0x0;}catch(_0x48ccba){if(_0x48ccba instanceof SDKError)return console[_0x45a660(0xab)]('Error:\x20'+_0x48ccba[_0x45a660(0x102)]),_0x48ccba[_0x45a660(0xf0)]&&console['error'](_0x45a660(0xbb)+_0x48ccba['cause']),0x1;throw _0x48ccba;}}}export class WorkflowAttemptCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]=a33_0x33ac8a(0xb8);[a33_0x33ac8a(0xc9)]=a33_0x33ac8a(0xa6);async[a33_0x33ac8a(0xfe)](_0x462294){const _0x4be2e9=a33_0x33ac8a,{options:_0x52c75e,args:_0xf3718c,tdx:_0x5725ee}=_0x462294,_0x5a5ee1=_0xf3718c[0x0];if(!_0x5a5ee1)return console[_0x4be2e9(0xab)](_0x4be2e9(0xe4)),0x1;try{_0x52c75e['verbose']&&console[_0x4be2e9(0xab)](_0x4be2e9(0xd1)+_0x5a5ee1);const _0x58476e=await withSpinner('Getting\x20attempt\x20details...',()=>_0x5725ee[_0x4be2e9(0x99)][_0x4be2e9(0xe0)](_0x5a5ee1),{'verbose':_0x52c75e['verbose']}),_0x20734c=_0x58476e['data'];return await handleSDKOutput([_0x20734c],_0x52c75e),0x0;}catch(_0x83aaa){if(_0x83aaa instanceof SDKError)return console[_0x4be2e9(0xab)]('Error:\x20'+_0x83aaa[_0x4be2e9(0x102)]),_0x83aaa[_0x4be2e9(0xf0)]&&console[_0x4be2e9(0xab)](_0x4be2e9(0xbb)+_0x83aaa[_0x4be2e9(0xf0)]),0x1;throw _0x83aaa;}}}export class WorkflowTasksCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]='workflow:tasks';['description']=a33_0x33ac8a(0xc6);async[a33_0x33ac8a(0xfe)](_0x374ee4){const _0xdeb3e5=a33_0x33ac8a,{options:_0x305bf3,args:_0x2d969e,tdx:_0x1ea5a9}=_0x374ee4,_0x21f7a2=_0x2d969e[0x0];if(!_0x21f7a2)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x3845ce=_0x305bf3[_0xdeb3e5(0x9a)];_0x305bf3[_0xdeb3e5(0xc3)]&&(console[_0xdeb3e5(0xab)]('Attempt\x20ID:\x20'+_0x21f7a2),_0x3845ce&&console[_0xdeb3e5(0xab)]('Including\x20subtasks:\x20yes'));const _0x534a19=await withSpinner(_0xdeb3e5(0x9f),()=>_0x1ea5a9[_0xdeb3e5(0x99)][_0xdeb3e5(0xb5)](_0x21f7a2,_0x3845ce||![]),{'verbose':_0x305bf3[_0xdeb3e5(0xc3)]}),_0x3fb5fc=_0x534a19[_0xdeb3e5(0xe6)];return console[_0xdeb3e5(0xab)](_0xdeb3e5(0xae)+_0x3fb5fc[_0xdeb3e5(0xc4)]+_0xdeb3e5(0x9e)+(_0x3fb5fc[_0xdeb3e5(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x3fb5fc,_0x305bf3),0x0;}catch(_0x32baba){if(_0x32baba instanceof SDKError)return console[_0xdeb3e5(0xab)]('Error:\x20'+_0x32baba[_0xdeb3e5(0x102)]),_0x32baba[_0xdeb3e5(0xf0)]&&console['error'](_0xdeb3e5(0xbb)+_0x32baba['cause']),0x1;throw _0x32baba;}}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a33_0x33ac8a(0xc9)]=a33_0x33ac8a(0x108);async[a33_0x33ac8a(0xfe)](_0x566e79){const _0x52bba7=a33_0x33ac8a,{options:_0x5b52a4,args:_0x4c8db7,tdx:_0x1dd4e2}=_0x566e79,_0x198193=_0x4c8db7[0x0],_0x5ee90d=_0x4c8db7[0x1];if(!_0x198193||!_0x5ee90d)return console[_0x52bba7(0xab)](_0x52bba7(0xf1)),0x1;try{_0x5b52a4['verbose']&&(console[_0x52bba7(0xab)](_0x52bba7(0xd1)+_0x198193),console[_0x52bba7(0xab)]('Task\x20name:\x20'+_0x5ee90d));const _0x4ba80a=_0x5b52a4[_0x52bba7(0xdc)],_0x4c4c8d=await withSpinner(_0x52bba7(0xfd),()=>_0x1dd4e2[_0x52bba7(0x99)]['logs'](_0x198193,_0x5ee90d,{'offset':_0x4ba80a,'limit':_0x5b52a4[_0x52bba7(0xfc)]}),{'verbose':_0x5b52a4[_0x52bba7(0xc3)]}),_0x25699a=_0x4c4c8d[_0x52bba7(0xe6)];return console['error']('✔\x20Found\x20'+_0x25699a[_0x52bba7(0xc4)]+_0x52bba7(0x90)+(_0x25699a[_0x52bba7(0xc4)]!==0x1?_0x52bba7(0x9d):'y')),await handleSDKOutput(_0x25699a,_0x5b52a4),0x0;}catch(_0x489dda){if(_0x489dda instanceof SDKError)return console[_0x52bba7(0xab)](_0x52bba7(0xad)+_0x489dda[_0x52bba7(0x102)]),_0x489dda[_0x52bba7(0xf0)]&&console[_0x52bba7(0xab)](_0x52bba7(0xbb)+_0x489dda['cause']),0x1;throw _0x489dda;}}}export class WorkflowKillCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]=a33_0x33ac8a(0x8c);[a33_0x33ac8a(0xc9)]=a33_0x33ac8a(0xd3);async['execute'](_0x4f3507){const _0x5c6724=a33_0x33ac8a,{options:_0x5000af,args:_0x4a25a3,tdx:_0x16ab9e}=_0x4f3507,_0x5cc87f=_0x4a25a3[0x0];if(!_0x5cc87f)return console[_0x5c6724(0xab)](_0x5c6724(0xe4)),0x1;try{const _0xb6e6c2=_0x5000af[_0x5c6724(0xaf)];_0x5000af[_0x5c6724(0xc3)]&&(console['error'](_0x5c6724(0xd1)+_0x5cc87f),_0xb6e6c2&&console[_0x5c6724(0xab)](_0x5c6724(0xde)+_0xb6e6c2));if(!_0x5000af[_0x5c6724(0xf4)]){const _0x32e09f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x5cc87f+'?');if(!_0x32e09f)return console[_0x5c6724(0xab)](_0x5c6724(0xa3)),0x0;}const _0x5db2d4=await withSpinner(_0x5c6724(0x8f),()=>_0x16ab9e['workflow'][_0x5c6724(0xd0)](_0x5cc87f,_0xb6e6c2),{'verbose':_0x5000af[_0x5c6724(0xc3)]}),_0x4be374=_0x5db2d4[_0x5c6724(0xe6)];return console[_0x5c6724(0xab)]('✔\x20'+_0x4be374),0x0;}catch(_0xec468c){if(_0xec468c instanceof SDKError)return console['error']('Error:\x20'+_0xec468c[_0x5c6724(0x102)]),_0xec468c[_0x5c6724(0xf0)]&&console[_0x5c6724(0xab)]('\x20\x20Cause:\x20'+_0xec468c['cause']),0x1;throw _0xec468c;}}}export class WorkflowRetryCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]='workflow:retry';['description']='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x5f2e06){const _0x3e407c=a33_0x33ac8a,{options:_0x19f32a,args:_0xf1b2cd,tdx:_0x5225ea}=_0x5f2e06,_0x29db58=_0xf1b2cd[0x0];if(!_0x29db58)return console[_0x3e407c(0xab)](_0x3e407c(0x106)),console[_0x3e407c(0xab)](_0x3e407c(0xee)),0x1;let _0x3a33ba=![],_0x6489d6=_0x29db58;if(_0x29db58[_0x3e407c(0x8a)](_0x3e407c(0xbc)))_0x3a33ba=!![],_0x6489d6=_0x29db58[_0x3e407c(0xf8)](0x8);else{if(_0x29db58[_0x3e407c(0x8a)](_0x3e407c(0xea)))_0x3a33ba=![],_0x6489d6=_0x29db58[_0x3e407c(0xf8)](0x8);else return console[_0x3e407c(0xab)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x3e407c(0xab)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}try{const _0x329435=_0x19f32a[_0x3e407c(0xd2)],_0x1566c3=_0x19f32a[_0x3e407c(0xa0)],_0x1c518f=_0x19f32a[_0x3e407c(0xed)],_0x455d7d=_0x19f32a[_0x3e407c(0xb1)];_0x19f32a[_0x3e407c(0xc3)]&&(console[_0x3e407c(0xab)](_0x3e407c(0x103)+(_0x3a33ba?_0x3e407c(0xda):_0x3e407c(0xe0))+'\x20'+_0x6489d6),_0x329435&&console[_0x3e407c(0xab)]('From\x20task:\x20'+_0x329435),_0x1566c3&&console[_0x3e407c(0xab)](_0x3e407c(0xbd)+_0x1566c3),_0x1c518f&&console[_0x3e407c(0xab)]('Params:\x20'+_0x1c518f),_0x455d7d&&console[_0x3e407c(0xab)]('Force:\x20yes'));let _0x2ed599;if(_0x1c518f)try{if(_0x1c518f[_0x3e407c(0x8a)]('@')){const _0xa447e4=await import('fs/promises'),_0x124ceb=_0x1c518f[_0x3e407c(0xf8)](0x1),_0x516d51=await _0xa447e4[_0x3e407c(0xac)](_0x124ceb,'utf-8');_0x2ed599=JSON[_0x3e407c(0xaa)](_0x516d51);}else _0x2ed599=JSON[_0x3e407c(0xaa)](_0x1c518f);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x19f32a['yes']){const _0x19c4f4=await confirm(_0x3e407c(0xcd)+(_0x3a33ba?_0x3e407c(0xda):'attempt')+'\x20'+_0x6489d6+'?');if(!_0x19c4f4)return console[_0x3e407c(0xab)](_0x3e407c(0xa3)),0x0;}let _0x21b9f7;_0x3a33ba?_0x21b9f7=await withSpinner(_0x3e407c(0xc8),()=>_0x5225ea['workflow'][_0x3e407c(0xe2)](_0x6489d6,{'fromTask':_0x329435,'retryParams':_0x2ed599}),{'verbose':_0x19f32a[_0x3e407c(0xc3)]}):_0x21b9f7=await withSpinner('Retrying\x20attempt...',()=>_0x5225ea[_0x3e407c(0x99)]['retryAttempt'](_0x6489d6,{'resumeFrom':_0x1566c3,'retryParams':_0x2ed599,'force':_0x455d7d}),{'verbose':_0x19f32a[_0x3e407c(0xc3)]});const _0x59589d=_0x21b9f7[_0x3e407c(0xe6)];return console[_0x3e407c(0xab)](_0x3e407c(0xd8)),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0x59589d[_0x3e407c(0xbf)]),console['error']('\x20\x20Session\x20ID:\x20'+_0x59589d['sessionId']),0x0;}catch(_0x116c7f){if(_0x116c7f instanceof SDKError)return console[_0x3e407c(0xab)](_0x3e407c(0xad)+_0x116c7f['message']),_0x116c7f['cause']&&console[_0x3e407c(0xab)](_0x3e407c(0xbb)+_0x116c7f[_0x3e407c(0xf0)]),0x1;throw _0x116c7f;}}}export class WorkflowDownloadCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]=a33_0x33ac8a(0xa7);[a33_0x33ac8a(0xc9)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a33_0x33ac8a(0xfe)](_0x2ab464){const _0x3dc9be=a33_0x33ac8a,{options:_0x3afcf6,args:_0x3707e3,tdx:_0x7e0608}=_0x2ab464,_0x38ec50=_0x3707e3[0x0],_0x95af32=_0x3707e3[0x1]||'.';if(!_0x38ec50)return console['error'](_0x3dc9be(0xca)),console[_0x3dc9be(0xab)](_0x3dc9be(0xce)),0x1;const _0xa4be3a=_0x3afcf6[_0x3dc9be(0xf6)];_0x3afcf6[_0x3dc9be(0xc3)]&&(console[_0x3dc9be(0xab)](_0x3dc9be(0x98)+_0x38ec50),console[_0x3dc9be(0xab)](_0x3dc9be(0xf5)+_0x95af32),_0xa4be3a&&console[_0x3dc9be(0xab)](_0x3dc9be(0xe7)+_0xa4be3a));const _0x2e3293=await withSpinner('Downloading\x20project\x20'+_0x38ec50+'...',()=>_0x7e0608['workflow']['download'](_0x38ec50,_0x95af32,{'revision':_0xa4be3a}),{'verbose':_0x3afcf6[_0x3dc9be(0xc3)]}),_0x4670de=_0x2e3293[_0x3dc9be(0xe6)];return console['error'](_0x3dc9be(0xc1)+_0x4670de[_0x3dc9be(0xdd)]),console[_0x3dc9be(0xab)]('\x20\x20Revision:\x20'+_0x4670de['revision']),console[_0x3dc9be(0xab)](_0x3dc9be(0x92)+_0x4670de[_0x3dc9be(0x9c)]),console[_0x3dc9be(0xab)](_0x3dc9be(0xbe)+_0x95af32+'/'+_0x4670de['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]=a33_0x33ac8a(0x107);[a33_0x33ac8a(0xc9)]=a33_0x33ac8a(0xb9);async[a33_0x33ac8a(0xfe)](_0x280af7){const _0x4fa2b5=a33_0x33ac8a,{options:_0x3aa97b,args:_0x15e382,tdx:_0x2ea9a7}=_0x280af7;let _0x4ee651='.',_0x314b2f=_0x3aa97b['name'];if(_0x15e382[0x0]){const {promises:_0x477629}=await import('fs');try{const _0x4cefe0=await _0x477629[_0x4fa2b5(0xb4)](_0x15e382[0x0]);if(_0x4cefe0[_0x4fa2b5(0xa5)]())_0x4ee651=_0x15e382[0x0];else return console[_0x4fa2b5(0xab)](_0x4fa2b5(0xad)+_0x15e382[0x0]+_0x4fa2b5(0x96)),0x1;}catch{_0x314b2f=_0x15e382[0x0],_0x4ee651='.';}}const _0x40f23d=_0x3aa97b[_0x4fa2b5(0xf6)],_0x46e628=_0x3aa97b[_0x4fa2b5(0xcc)];_0x3aa97b[_0x4fa2b5(0xc3)]&&(console[_0x4fa2b5(0xab)](_0x4fa2b5(0xf7)+_0x4ee651),_0x314b2f&&console[_0x4fa2b5(0xab)](_0x4fa2b5(0x105)+_0x314b2f),_0x40f23d&&console[_0x4fa2b5(0xab)](_0x4fa2b5(0xe7)+_0x40f23d),_0x46e628&&console[_0x4fa2b5(0xab)]('Validation:\x20skipped'));const _0x52f0a4=await withSpinner(_0x4fa2b5(0xba),()=>_0x2ea9a7[_0x4fa2b5(0x99)][_0x4fa2b5(0xb6)](_0x4ee651,{'projectName':_0x314b2f,'revision':_0x40f23d,'skipValidation':_0x46e628}),{'verbose':_0x3aa97b[_0x4fa2b5(0xc3)]}),_0x35bc64=_0x52f0a4[_0x4fa2b5(0xe6)];return console['error'](_0x4fa2b5(0xeb)+_0x35bc64[_0x4fa2b5(0xdd)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x35bc64[_0x4fa2b5(0x89)]),console[_0x4fa2b5(0xab)]('\x20\x20Revision:\x20'+_0x35bc64[_0x4fa2b5(0xf6)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a33_0x33ac8a(0xcf)]=a33_0x33ac8a(0xb7);[a33_0x33ac8a(0xc9)]=a33_0x33ac8a(0xfa);async[a33_0x33ac8a(0xfe)](_0x4f51a0){const _0x42b1fc=a33_0x33ac8a,{options:_0xa359d6,args:_0x554fc0,tdx:_0x4610e8}=_0x4f51a0,_0x4ea145=_0x554fc0[0x0];if(!_0x4ea145)return console[_0x42b1fc(0xab)](_0x42b1fc(0xf9)),console[_0x42b1fc(0xab)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xa359d6[_0x42b1fc(0xc3)]&&console['error'](_0x42b1fc(0x98)+_0x4ea145);if(!_0xa359d6[_0x42b1fc(0xf4)]){const _0x234bd6=await confirm(_0x42b1fc(0xa9)+_0x4ea145+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x234bd6)return console[_0x42b1fc(0xab)](_0x42b1fc(0xa3)),0x0;}const _0x36b7d4=await withSpinner(_0x42b1fc(0x104)+_0x4ea145+_0x42b1fc(0xa2),()=>_0x4610e8[_0x42b1fc(0x99)]['delete'](_0x4ea145),{'verbose':_0xa359d6[_0x42b1fc(0xc3)]}),_0x49f61f=_0x36b7d4[_0x42b1fc(0xe6)];return console[_0x42b1fc(0xab)](_0x42b1fc(0xff)+_0x49f61f['projectName']),console['error'](_0x42b1fc(0x101)+_0x49f61f[_0x42b1fc(0x89)]),0x0;}}
|
|
1
|
+
const a33_0x1e907c=a33_0x31c7;(function(_0x2aaef9,_0x19a0fa){const _0xe2db7d=a33_0x31c7,_0xe03335=_0x2aaef9();while(!![]){try{const _0x59cf21=parseInt(_0xe2db7d(0x121))/0x1+-parseInt(_0xe2db7d(0x169))/0x2+parseInt(_0xe2db7d(0x191))/0x3+-parseInt(_0xe2db7d(0x184))/0x4+-parseInt(_0xe2db7d(0x129))/0x5*(parseInt(_0xe2db7d(0x12e))/0x6)+-parseInt(_0xe2db7d(0x193))/0x7*(-parseInt(_0xe2db7d(0x15d))/0x8)+parseInt(_0xe2db7d(0x13a))/0x9*(parseInt(_0xe2db7d(0x167))/0xa);if(_0x59cf21===_0x19a0fa)break;else _0xe03335['push'](_0xe03335['shift']());}catch(_0xefde92){_0xe03335['push'](_0xe03335['shift']());}}}(a33_0x58c9,0xe6ddf));import{BaseCommand}from'./command.js';function a33_0x58c9(){const _0x4eed0d=['\x20\x20Session\x20ID:\x20','2418898dktEHZ','Project\x20filter:\x20','List\x20workflows','isDirectory','Retry\x20a\x20session\x20or\x20attempt','projectName','yes','revision','attemptId','✔\x20Deleted\x20project\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','error','Show\x20logs\x20for\x20a\x20specific\x20task','✔\x20Pushed\x20','Listing\x20workflows...','verbose','attempt:','fs/promises','params','Listing\x20workflow\x20sessions...','workflow:attempts','Show\x20specific\x20attempt\x20details','\x20\x20Files\x20extracted:\x20','Validation:\x20skipped','Error:\x20Attempt\x20ID\x20is\x20required','tasks','Show\x20tasks\x20for\x20an\x20attempt','1161232sjHFWp','ies','push','Cancelled','cause','Revision:\x20','Project\x20directory:\x20','workflow:sessions','From\x20task:\x20','substring','Retrying\x20attempt...','Params:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','1070352yAQbTQ','Killing\x20attempt...','546259cWGTQF','✔\x20Found\x20','Pushing\x20workflow\x20project...','Error:\x20','projects','\x20project','...','Task\x20name:\x20','Attempt\x20ID:\x20','Deleting\x20project\x20','338039jPjGyW','List\x20workflow\x20attempts','retryAttempt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','✔\x20Downloaded\x20','workflows','parse','sessionId','20390MIOfuT','utf-8','\x20log\x20entr','Filter:\x20','workflow:push','210kcYRZX','\x20session','Getting\x20attempt\x20tasks...','projectId','✔\x20Retry\x20started','\x20\x20Location:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20Revision:\x20','execute','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','\x22?\x20This\x20cannot\x20be\x20undone.','offset','168426PJlxpH','\x20\x20New\x20attempt\x20ID:\x20','Project:\x20','name','session:','resumeFrom','\x20\x20Cause:\x20','workflow:workflows','Usage:\x20workflow:delete\x20<project-name-or-id>','workflow:kill','limit','workflow:download','Getting\x20task\x20logs...','\x20\x20Project\x20ID:\x20','\x20workflow','Force:\x20yes','Filter:\x20project=','Retrying\x20session...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','data','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','download','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Listing\x20workflow\x20attempts...','workflow:retry','message','Include\x20retried:\x20yes','length','sessions','Kill\x20a\x20running\x20attempt','includeRetried','Output\x20directory:\x20','workflow:attempt','status','attempts','8WCAFQn','readFile','Target:\x20','skipValidation','Pattern:\x20','attempt','stat','description','workflow:tasks','workflow','970EdhqHc'];a33_0x58c9=function(){return _0x4eed0d;};return a33_0x58c9();}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_0x1e907c(0x13d)]='workflow:projects';[a33_0x1e907c(0x164)]='List\x20all\x20workflow\x20projects';async[a33_0x1e907c(0x136)](_0x5d6dc2){const _0x489aa3=a33_0x1e907c,{options:_0x1c6ce6,args:_0x597215,tdx:_0x5b8e1c}=_0x5d6dc2,_0x256944=_0x597215[0x0];try{_0x1c6ce6[_0x489aa3(0x178)]&&_0x256944&&console[_0x489aa3(0x174)](_0x489aa3(0x161)+_0x256944);const _0x313431=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5b8e1c[_0x489aa3(0x166)][_0x489aa3(0x197)](_0x256944,{'limit':_0x1c6ce6[_0x489aa3(0x144)]}),{'verbose':_0x1c6ce6[_0x489aa3(0x178)]}),_0x5877bb=_0x313431['data'];return console[_0x489aa3(0x174)](_0x489aa3(0x194)+_0x5877bb[_0x489aa3(0x155)]+_0x489aa3(0x198)+(_0x5877bb[_0x489aa3(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x5877bb,_0x1c6ce6),0x0;}catch(_0x4f6547){if(_0x4f6547 instanceof SDKError)return console[_0x489aa3(0x174)](_0x489aa3(0x196)+_0x4f6547['message']),_0x4f6547[_0x489aa3(0x188)]&&console[_0x489aa3(0x174)](_0x489aa3(0x140)+_0x4f6547['cause']),0x1;throw _0x4f6547;}}}function a33_0x31c7(_0x26503f,_0x375148){const _0x58c9f8=a33_0x58c9();return a33_0x31c7=function(_0x31c738,_0xdcb8d2){_0x31c738=_0x31c738-0x121;let _0x47f7aa=_0x58c9f8[_0x31c738];return _0x47f7aa;},a33_0x31c7(_0x26503f,_0x375148);}export class WorkflowWorkflowsCommand extends BaseCommand{[a33_0x1e907c(0x13d)]=a33_0x1e907c(0x141);[a33_0x1e907c(0x164)]=a33_0x1e907c(0x16b);async['execute'](_0x1b747a){const _0x5a8976=a33_0x1e907c,{options:_0x4522cb,args:_0x4385a1,tdx:_0x30893e}=_0x1b747a,_0x4f9dbe=_0x4385a1[0x0];try{_0x4522cb['verbose']&&_0x4f9dbe&&console[_0x5a8976(0x174)](_0x5a8976(0x16a)+_0x4f9dbe);const _0x50d39e=await withSpinner(_0x5a8976(0x177),()=>_0x30893e[_0x5a8976(0x166)][_0x5a8976(0x126)](_0x4f9dbe,{'limit':_0x4522cb['limit']}),{'verbose':_0x4522cb[_0x5a8976(0x178)]}),_0x3b1477=_0x50d39e[_0x5a8976(0x14d)];return console['error'](_0x5a8976(0x194)+_0x3b1477[_0x5a8976(0x155)]+_0x5a8976(0x148)+(_0x3b1477[_0x5a8976(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x3b1477,_0x4522cb),0x0;}catch(_0x551f62){if(_0x551f62 instanceof SDKError)return console[_0x5a8976(0x174)](_0x5a8976(0x196)+_0x551f62[_0x5a8976(0x153)]),_0x551f62['cause']&&console[_0x5a8976(0x174)](_0x5a8976(0x140)+_0x551f62[_0x5a8976(0x188)]),0x1;throw _0x551f62;}}}export class WorkflowSessionsCommand extends BaseCommand{[a33_0x1e907c(0x13d)]=a33_0x1e907c(0x18b);[a33_0x1e907c(0x164)]='List\x20workflow\x20execution\x20sessions';async[a33_0x1e907c(0x136)](_0x270d71){const _0x468977=a33_0x1e907c,{options:_0x20d497,args:_0x2f1375,tdx:_0x37790d}=_0x270d71;let _0xf4610d,_0x94072;if(_0x2f1375[0x0]){const _0x561115=_0x2f1375[0x0]['split']('.');if(_0x561115[_0x468977(0x155)]===0x1)_0xf4610d=_0x561115[0x0];else{if(_0x561115[_0x468977(0x155)]===0x2)[_0xf4610d,_0x94072]=_0x561115;else return console[_0x468977(0x174)](_0x468977(0x137)),0x1;}}try{if(_0x20d497[_0x468977(0x178)]){if(_0xf4610d&&_0x94072)console[_0x468977(0x174)](_0x468977(0x12c)+_0xf4610d+'.'+_0x94072);else _0xf4610d&&console[_0x468977(0x174)](_0x468977(0x14a)+_0xf4610d);const _0x37bcd8=_0x20d497[_0x468977(0x15b)];_0x37bcd8&&console[_0x468977(0x174)]('Status:\x20'+_0x37bcd8);}const _0x50e684=await withSpinner(_0x468977(0x17c),()=>_0x37790d[_0x468977(0x166)][_0x468977(0x156)]({'projectName':_0xf4610d,'workflowName':_0x94072,'status':_0x20d497[_0x468977(0x15b)],'fromTime':_0x20d497['from'],'toTime':_0x20d497['to'],'limit':_0x20d497['limit']}),{'verbose':_0x20d497['verbose']}),_0x109122=_0x50e684[_0x468977(0x14d)];return console[_0x468977(0x174)](_0x468977(0x194)+_0x109122[_0x468977(0x155)]+_0x468977(0x12f)+(_0x109122[_0x468977(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x109122,_0x20d497),0x0;}catch(_0x23dce6){if(_0x23dce6 instanceof SDKError)return console[_0x468977(0x174)](_0x468977(0x196)+_0x23dce6[_0x468977(0x153)]),_0x23dce6[_0x468977(0x188)]&&console[_0x468977(0x174)](_0x468977(0x140)+_0x23dce6[_0x468977(0x188)]),0x1;throw _0x23dce6;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a33_0x1e907c(0x13d)]=a33_0x1e907c(0x17d);['description']=a33_0x1e907c(0x122);async[a33_0x1e907c(0x136)](_0x126458){const _0x1635c0=a33_0x1e907c,{options:_0x1ed1ec,args:_0x4edd98,tdx:_0x454a9f}=_0x126458;let _0x2e5a9b,_0x395465;if(_0x4edd98[0x0]){const _0x1c9924=_0x4edd98[0x0]['split']('.');if(_0x1c9924['length']===0x1)_0x2e5a9b=_0x1c9924[0x0];else{if(_0x1c9924[_0x1635c0(0x155)]===0x2)[_0x2e5a9b,_0x395465]=_0x1c9924;else return console[_0x1635c0(0x174)](_0x1635c0(0x137)),0x1;}}try{const _0x539031=_0x1ed1ec[_0x1635c0(0x158)];if(_0x1ed1ec[_0x1635c0(0x178)]){if(_0x2e5a9b&&_0x395465)console['error'](_0x1635c0(0x12c)+_0x2e5a9b+'.'+_0x395465);else _0x2e5a9b&&console['error']('Filter:\x20project='+_0x2e5a9b);_0x539031&&console[_0x1635c0(0x174)](_0x1635c0(0x154));}const _0x1a7e03=await withSpinner(_0x1635c0(0x151),()=>_0x454a9f[_0x1635c0(0x166)][_0x1635c0(0x15c)]({'projectName':_0x2e5a9b,'workflowName':_0x395465,'includeRetried':_0x539031,'limit':_0x1ed1ec[_0x1635c0(0x144)]}),{'verbose':_0x1ed1ec[_0x1635c0(0x178)]}),_0x4c3f6d=_0x1a7e03['data'];return console[_0x1635c0(0x174)]('✔\x20Found\x20'+_0x4c3f6d['length']+'\x20attempt'+(_0x4c3f6d[_0x1635c0(0x155)]!==0x1?'s':'')),await handleSDKOutput(_0x4c3f6d,_0x1ed1ec),0x0;}catch(_0xd17ef7){if(_0xd17ef7 instanceof SDKError)return console[_0x1635c0(0x174)](_0x1635c0(0x196)+_0xd17ef7[_0x1635c0(0x153)]),_0xd17ef7[_0x1635c0(0x188)]&&console['error'](_0x1635c0(0x140)+_0xd17ef7['cause']),0x1;throw _0xd17ef7;}}}export class WorkflowAttemptCommand extends BaseCommand{[a33_0x1e907c(0x13d)]=a33_0x1e907c(0x15a);[a33_0x1e907c(0x164)]=a33_0x1e907c(0x17e);async[a33_0x1e907c(0x136)](_0x2b97f1){const _0x4359af=a33_0x1e907c,{options:_0x442124,args:_0x40d26c,tdx:_0x33bae0}=_0x2b97f1,_0x2e65b4=_0x40d26c[0x0];if(!_0x2e65b4)return console[_0x4359af(0x174)](_0x4359af(0x181)),0x1;try{_0x442124['verbose']&&console[_0x4359af(0x174)](_0x4359af(0x19b)+_0x2e65b4);const _0x1f821d=await withSpinner('Getting\x20attempt\x20details...',()=>_0x33bae0['workflow'][_0x4359af(0x162)](_0x2e65b4),{'verbose':_0x442124['verbose']}),_0xbb09ee=_0x1f821d['data'];return await handleSDKOutput([_0xbb09ee],_0x442124),0x0;}catch(_0x1e291b){if(_0x1e291b instanceof SDKError)return console[_0x4359af(0x174)](_0x4359af(0x196)+_0x1e291b[_0x4359af(0x153)]),_0x1e291b[_0x4359af(0x188)]&&console[_0x4359af(0x174)](_0x4359af(0x140)+_0x1e291b[_0x4359af(0x188)]),0x1;throw _0x1e291b;}}}export class WorkflowTasksCommand extends BaseCommand{[a33_0x1e907c(0x13d)]=a33_0x1e907c(0x165);[a33_0x1e907c(0x164)]=a33_0x1e907c(0x183);async['execute'](_0x2781fe){const _0x839413=a33_0x1e907c,{options:_0x42be86,args:_0x26b936,tdx:_0x498af7}=_0x2781fe,_0x333203=_0x26b936[0x0];if(!_0x333203)return console['error'](_0x839413(0x181)),0x1;try{const _0x7bf6bb=_0x42be86['includeSubtasks'];_0x42be86[_0x839413(0x178)]&&(console[_0x839413(0x174)](_0x839413(0x19b)+_0x333203),_0x7bf6bb&&console['error']('Including\x20subtasks:\x20yes'));const _0x420371=await withSpinner(_0x839413(0x130),()=>_0x498af7['workflow'][_0x839413(0x182)](_0x333203,_0x7bf6bb||![]),{'verbose':_0x42be86[_0x839413(0x178)]}),_0x12f319=_0x420371[_0x839413(0x14d)];return console[_0x839413(0x174)]('✔\x20Found\x20'+_0x12f319[_0x839413(0x155)]+'\x20task'+(_0x12f319['length']!==0x1?'s':'')),await handleSDKOutput(_0x12f319,_0x42be86),0x0;}catch(_0x4dbef9){if(_0x4dbef9 instanceof SDKError)return console['error'](_0x839413(0x196)+_0x4dbef9[_0x839413(0x153)]),_0x4dbef9[_0x839413(0x188)]&&console[_0x839413(0x174)](_0x839413(0x140)+_0x4dbef9[_0x839413(0x188)]),0x1;throw _0x4dbef9;}}}export class WorkflowLogsCommand extends BaseCommand{[a33_0x1e907c(0x13d)]='workflow:logs';[a33_0x1e907c(0x164)]=a33_0x1e907c(0x175);async[a33_0x1e907c(0x136)](_0x47adb9){const _0x5e58bd=a33_0x1e907c,{options:_0x691665,args:_0x886864,tdx:_0x5dc8c7}=_0x47adb9,_0x34cad1=_0x886864[0x0],_0x276920=_0x886864[0x1];if(!_0x34cad1||!_0x276920)return console[_0x5e58bd(0x174)]('Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required'),0x1;try{_0x691665[_0x5e58bd(0x178)]&&(console[_0x5e58bd(0x174)]('Attempt\x20ID:\x20'+_0x34cad1),console[_0x5e58bd(0x174)](_0x5e58bd(0x19a)+_0x276920));const _0x1d5b8c=_0x691665[_0x5e58bd(0x139)],_0x46b583=await withSpinner(_0x5e58bd(0x146),()=>_0x5dc8c7['workflow']['logs'](_0x34cad1,_0x276920,{'offset':_0x1d5b8c,'limit':_0x691665['limit']}),{'verbose':_0x691665[_0x5e58bd(0x178)]}),_0xaa6119=_0x46b583[_0x5e58bd(0x14d)];return console[_0x5e58bd(0x174)](_0x5e58bd(0x194)+_0xaa6119[_0x5e58bd(0x155)]+_0x5e58bd(0x12b)+(_0xaa6119[_0x5e58bd(0x155)]!==0x1?_0x5e58bd(0x185):'y')),await handleSDKOutput(_0xaa6119,_0x691665),0x0;}catch(_0x10fb68){if(_0x10fb68 instanceof SDKError)return console['error']('Error:\x20'+_0x10fb68[_0x5e58bd(0x153)]),_0x10fb68['cause']&&console[_0x5e58bd(0x174)]('\x20\x20Cause:\x20'+_0x10fb68[_0x5e58bd(0x188)]),0x1;throw _0x10fb68;}}}export class WorkflowKillCommand extends BaseCommand{['name']=a33_0x1e907c(0x143);['description']=a33_0x1e907c(0x157);async[a33_0x1e907c(0x136)](_0xa8ce2e){const _0x1a24ee=a33_0x1e907c,{options:_0x51e80a,args:_0x1abc00,tdx:_0x20b662}=_0xa8ce2e,_0x3bac23=_0x1abc00[0x0];if(!_0x3bac23)return console[_0x1a24ee(0x174)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0xc490c3=_0x51e80a['reason'];_0x51e80a['verbose']&&(console[_0x1a24ee(0x174)](_0x1a24ee(0x19b)+_0x3bac23),_0xc490c3&&console[_0x1a24ee(0x174)]('Reason:\x20'+_0xc490c3));if(!_0x51e80a[_0x1a24ee(0x16f)]){const _0x3ed9bb=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3bac23+'?');if(!_0x3ed9bb)return console[_0x1a24ee(0x174)]('Cancelled'),0x0;}const _0x1f79c7=await withSpinner(_0x1a24ee(0x192),()=>_0x20b662[_0x1a24ee(0x166)]['kill'](_0x3bac23,_0xc490c3),{'verbose':_0x51e80a[_0x1a24ee(0x178)]}),_0x3d841b=_0x1f79c7[_0x1a24ee(0x14d)];return console[_0x1a24ee(0x174)]('✔\x20'+_0x3d841b),0x0;}catch(_0x3ca073){if(_0x3ca073 instanceof SDKError)return console[_0x1a24ee(0x174)](_0x1a24ee(0x196)+_0x3ca073[_0x1a24ee(0x153)]),_0x3ca073[_0x1a24ee(0x188)]&&console[_0x1a24ee(0x174)](_0x1a24ee(0x140)+_0x3ca073[_0x1a24ee(0x188)]),0x1;throw _0x3ca073;}}}export class WorkflowRetryCommand extends BaseCommand{[a33_0x1e907c(0x13d)]=a33_0x1e907c(0x152);['description']=a33_0x1e907c(0x16d);async[a33_0x1e907c(0x136)](_0x141e01){const _0x1f7c0f=a33_0x1e907c,{options:_0x2c13c1,args:_0x1a8ca4,tdx:_0x5659f9}=_0x141e01,_0x2bafd5=_0x1a8ca4[0x0];if(!_0x2bafd5)return console['error'](_0x1f7c0f(0x134)),console[_0x1f7c0f(0x174)](_0x1f7c0f(0x150)),0x1;let _0x23e0ef=![],_0x13ce2a=_0x2bafd5;if(_0x2bafd5['startsWith'](_0x1f7c0f(0x13e)))_0x23e0ef=!![],_0x13ce2a=_0x2bafd5[_0x1f7c0f(0x18d)](0x8);else{if(_0x2bafd5['startsWith'](_0x1f7c0f(0x179)))_0x23e0ef=![],_0x13ce2a=_0x2bafd5[_0x1f7c0f(0x18d)](0x8);else return console[_0x1f7c0f(0x174)](_0x1f7c0f(0x14c)),console[_0x1f7c0f(0x174)](_0x1f7c0f(0x150)),0x1;}try{const _0x5536bc=_0x2c13c1['fromTask'],_0x47d7f6=_0x2c13c1[_0x1f7c0f(0x13f)],_0x348ec4=_0x2c13c1[_0x1f7c0f(0x17b)],_0x2bd726=_0x2c13c1['force'];_0x2c13c1[_0x1f7c0f(0x178)]&&(console[_0x1f7c0f(0x174)](_0x1f7c0f(0x15f)+(_0x23e0ef?'session':_0x1f7c0f(0x162))+'\x20'+_0x13ce2a),_0x5536bc&&console[_0x1f7c0f(0x174)](_0x1f7c0f(0x18c)+_0x5536bc),_0x47d7f6&&console['error']('Resume\x20from:\x20'+_0x47d7f6),_0x348ec4&&console[_0x1f7c0f(0x174)](_0x1f7c0f(0x18f)+_0x348ec4),_0x2bd726&&console[_0x1f7c0f(0x174)](_0x1f7c0f(0x149)));let _0x5be48a;if(_0x348ec4)try{if(_0x348ec4['startsWith']('@')){const _0x3b6ad3=await import(_0x1f7c0f(0x17a)),_0x482283=_0x348ec4[_0x1f7c0f(0x18d)](0x1),_0x316139=await _0x3b6ad3[_0x1f7c0f(0x15e)](_0x482283,_0x1f7c0f(0x12a));_0x5be48a=JSON['parse'](_0x316139);}else _0x5be48a=JSON[_0x1f7c0f(0x127)](_0x348ec4);}catch{return console[_0x1f7c0f(0x174)](_0x1f7c0f(0x190)),0x1;}if(!_0x2c13c1[_0x1f7c0f(0x16f)]){const _0x399b20=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x23e0ef?'session':_0x1f7c0f(0x162))+'\x20'+_0x13ce2a+'?');if(!_0x399b20)return console[_0x1f7c0f(0x174)](_0x1f7c0f(0x187)),0x0;}let _0x54498f;_0x23e0ef?_0x54498f=await withSpinner(_0x1f7c0f(0x14b),()=>_0x5659f9['workflow']['retrySession'](_0x13ce2a,{'fromTask':_0x5536bc,'retryParams':_0x5be48a}),{'verbose':_0x2c13c1[_0x1f7c0f(0x178)]}):_0x54498f=await withSpinner(_0x1f7c0f(0x18e),()=>_0x5659f9[_0x1f7c0f(0x166)][_0x1f7c0f(0x123)](_0x13ce2a,{'resumeFrom':_0x47d7f6,'retryParams':_0x5be48a,'force':_0x2bd726}),{'verbose':_0x2c13c1[_0x1f7c0f(0x178)]});const _0x3ccc8b=_0x54498f[_0x1f7c0f(0x14d)];return console[_0x1f7c0f(0x174)](_0x1f7c0f(0x132)),console[_0x1f7c0f(0x174)](_0x1f7c0f(0x13b)+_0x3ccc8b[_0x1f7c0f(0x171)]),console[_0x1f7c0f(0x174)](_0x1f7c0f(0x168)+_0x3ccc8b[_0x1f7c0f(0x128)]),0x0;}catch(_0x521886){if(_0x521886 instanceof SDKError)return console['error'](_0x1f7c0f(0x196)+_0x521886[_0x1f7c0f(0x153)]),_0x521886[_0x1f7c0f(0x188)]&&console[_0x1f7c0f(0x174)](_0x1f7c0f(0x140)+_0x521886['cause']),0x1;throw _0x521886;}}}export class WorkflowDownloadCommand extends BaseCommand{[a33_0x1e907c(0x13d)]=a33_0x1e907c(0x145);[a33_0x1e907c(0x164)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a33_0x1e907c(0x136)](_0x63343a){const _0x1f177a=a33_0x1e907c,{options:_0x4440c5,args:_0x3cc95b,tdx:_0x798912}=_0x63343a,_0x52f963=_0x3cc95b[0x0],_0x314b93=_0x3cc95b[0x1]||'.';if(!_0x52f963)return console[_0x1f177a(0x174)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x1f177a(0x174)](_0x1f177a(0x173)),0x1;const _0x476c1f=_0x4440c5[_0x1f177a(0x170)];_0x4440c5[_0x1f177a(0x178)]&&(console[_0x1f177a(0x174)](_0x1f177a(0x13c)+_0x52f963),console[_0x1f177a(0x174)](_0x1f177a(0x159)+_0x314b93),_0x476c1f&&console[_0x1f177a(0x174)](_0x1f177a(0x189)+_0x476c1f));const _0x38803d=await withSpinner('Downloading\x20project\x20'+_0x52f963+_0x1f177a(0x199),()=>_0x798912[_0x1f177a(0x166)][_0x1f177a(0x14f)](_0x52f963,_0x314b93,{'revision':_0x476c1f}),{'verbose':_0x4440c5['verbose']}),_0x4436af=_0x38803d['data'];return console[_0x1f177a(0x174)](_0x1f177a(0x125)+_0x4436af['projectName']),console[_0x1f177a(0x174)](_0x1f177a(0x135)+_0x4436af[_0x1f177a(0x170)]),console[_0x1f177a(0x174)](_0x1f177a(0x17f)+_0x4436af['filesExtracted']),console[_0x1f177a(0x174)](_0x1f177a(0x133)+_0x314b93+'/'+_0x4436af[_0x1f177a(0x16e)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a33_0x1e907c(0x13d)]=a33_0x1e907c(0x12d);[a33_0x1e907c(0x164)]=a33_0x1e907c(0x14e);async[a33_0x1e907c(0x136)](_0x182176){const _0xcefb28=a33_0x1e907c,{options:_0x4e151e,args:_0x410b49,tdx:_0x518022}=_0x182176;let _0x38413d='.',_0x5c4cfd=_0x4e151e[_0xcefb28(0x13d)];if(_0x410b49[0x0]){const {promises:_0x1e8310}=await import('fs');try{const _0x4fe819=await _0x1e8310[_0xcefb28(0x163)](_0x410b49[0x0]);if(_0x4fe819[_0xcefb28(0x16c)]())_0x38413d=_0x410b49[0x0];else return console[_0xcefb28(0x174)](_0xcefb28(0x196)+_0x410b49[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x5c4cfd=_0x410b49[0x0],_0x38413d='.';}}const _0x250481=_0x4e151e['revision'],_0x5dceb0=_0x4e151e[_0xcefb28(0x160)];_0x4e151e[_0xcefb28(0x178)]&&(console[_0xcefb28(0x174)](_0xcefb28(0x18a)+_0x38413d),_0x5c4cfd&&console[_0xcefb28(0x174)]('Project\x20name:\x20'+_0x5c4cfd),_0x250481&&console[_0xcefb28(0x174)](_0xcefb28(0x189)+_0x250481),_0x5dceb0&&console[_0xcefb28(0x174)](_0xcefb28(0x180)));const _0x529060=await withSpinner(_0xcefb28(0x195),()=>_0x518022[_0xcefb28(0x166)][_0xcefb28(0x186)](_0x38413d,{'projectName':_0x5c4cfd,'revision':_0x250481,'skipValidation':_0x5dceb0}),{'verbose':_0x4e151e[_0xcefb28(0x178)]}),_0x3d19b5=_0x529060['data'];return console[_0xcefb28(0x174)](_0xcefb28(0x176)+_0x3d19b5[_0xcefb28(0x16e)]),console[_0xcefb28(0x174)](_0xcefb28(0x147)+_0x3d19b5[_0xcefb28(0x131)]),console['error'](_0xcefb28(0x135)+_0x3d19b5['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a33_0x1e907c(0x13d)]='workflow:delete';['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x41b7d9){const _0x54d4c7=a33_0x1e907c,{options:_0x3551c0,args:_0x2e6c97,tdx:_0x2b28b7}=_0x41b7d9,_0x2c3e07=_0x2e6c97[0x0];if(!_0x2c3e07)return console[_0x54d4c7(0x174)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x54d4c7(0x174)](_0x54d4c7(0x142)),0x1;_0x3551c0[_0x54d4c7(0x178)]&&console[_0x54d4c7(0x174)](_0x54d4c7(0x13c)+_0x2c3e07);if(!_0x3551c0['yes']){const _0x237e5e=await confirm(_0x54d4c7(0x124)+_0x2c3e07+_0x54d4c7(0x138));if(!_0x237e5e)return console[_0x54d4c7(0x174)](_0x54d4c7(0x187)),0x0;}const _0x23118d=await withSpinner(_0x54d4c7(0x19c)+_0x2c3e07+'...',()=>_0x2b28b7['workflow']['delete'](_0x2c3e07),{'verbose':_0x3551c0['verbose']}),_0x28fbdb=_0x23118d[_0x54d4c7(0x14d)];return console[_0x54d4c7(0x174)](_0x54d4c7(0x172)+_0x28fbdb[_0x54d4c7(0x16e)]),console[_0x54d4c7(0x174)](_0x54d4c7(0x147)+_0x28fbdb[_0x54d4c7(0x131)]),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1d8bda,_0x597db6){const _0x578b8a=a34_0x2c8e,_0x3de154=_0x1d8bda();while(!![]){try{const _0x41e546=-parseInt(_0x578b8a(0x1c7))/0x1+-parseInt(_0x578b8a(0x1cb))/0x2+-parseInt(_0x578b8a(0x1c0))/0x3+-parseInt(_0x578b8a(0x1c1))/0x4+parseInt(_0x578b8a(0x1cc))/0x5+-parseInt(_0x578b8a(0x1c3))/0x6*(-parseInt(_0x578b8a(0x1c6))/0x7)+parseInt(_0x578b8a(0x1c8))/0x8;if(_0x41e546===_0x597db6)break;else _0x3de154['push'](_0x3de154['shift']());}catch(_0xc232c2){_0x3de154['push'](_0x3de154['shift']());}}}(a34_0xe69f,0x54bd8));function a34_0x2c8e(_0xeb3a5a,_0x438e6d){const _0xe69f77=a34_0xe69f();return a34_0x2c8e=function(_0x2c8e43,_0x3b6932){_0x2c8e43=_0x2c8e43-0x1be;let _0x5413f8=_0xe69f77[_0x2c8e43];return _0x5413f8;},a34_0x2c8e(_0xeb3a5a,_0x438e6d);}import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x38d88d=a34_0x2c8e;try{const _0x26f920=fileURLToPath(import.meta[_0x38d88d(0x1d2)]),_0x1be8d9=dirname(_0x26f920),_0x41fd40=join(_0x1be8d9,'../../package.json'),_0x661221=JSON[_0x38d88d(0x1d0)](readFileSync(_0x41fd40,_0x38d88d(0x1c9)));return _0x661221[_0x38d88d(0x1bf)];}catch{return _0x38d88d(0x1d3);}}export function getUserAgent(){const _0x3eb2da=a34_0x2c8e,_0x45cf71=getVersion(),_0x53a620=platform(),_0x7cec9b=process['version'][_0x3eb2da(0x1cd)]('v','');return _0x3eb2da(0x1c2)+_0x45cf71+'\x20('+_0x53a620+_0x3eb2da(0x1d1)+_0x7cec9b+')';}export function getAuthHeaders(_0x4a1d39,_0x20f956){const _0x1bc65d=a34_0x2c8e,_0x15d5ce=getVersion(),_0x243e5b={'User-Agent':getUserAgent(),'X-TD-Client':_0x1bc65d(0x1be),'X-TD-Client-Version':_0x15d5ce};return _0x20f956&&(_0x243e5b[_0x1bc65d(0x1c4)]=_0x1bc65d(0x1ca)+_0x20f956),_0x243e5b;}export function toHeaderRecord(_0x322b5a){const _0xf448cf=a34_0x2c8e,_0x52c242={};for(const [_0x2681dd,_0x2ebfc2]of Object[_0xf448cf(0x1ce)](_0x322b5a)){_0x2ebfc2!==undefined&&(_0x52c242[_0x2681dd]=_0x2ebfc2);}return _0x52c242;}export function getTrinoHeaders(_0x365526,_0x2710db){const _0x3deec5=a34_0x2c8e,_0x33c381=getAuthHeaders(_0x365526,_0x2710db),_0x56dbf4=toHeaderRecord(_0x33c381);return delete _0x56dbf4[_0x3deec5(0x1c4)],_0x2710db&&(_0x56dbf4[_0x3deec5(0x1c5)]=_0x2710db),_0x56dbf4;}function a34_0xe69f(){const _0x25b02b=['version','1213017PrZYje','1028228ldPIZw','tdx/','6kHcYNK','Authorization','X-Trino-User','292313sntYJp','593452nhqPGe','12310952LtBsdW','utf-8','TD1\x20','1266766xQmkXu','3273495FSSHlo','replace','entries','length','parse',';\x20node/','url','0.0.0','tdx'];a34_0xe69f=function(){return _0x25b02b;};return a34_0xe69f();}export function hasAPIKey(_0x13c0c6){const _0x53dd65=a34_0x2c8e,_0x3bfceb=getAPIKey(_0x13c0c6);return _0x3bfceb!==undefined&&_0x3bfceb[_0x53dd65(0x1cf)]>0x0;}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4f6417,_0x21f7db){const _0x42d38e=a35_0x117e,_0x3dce95=_0x4f6417();while(!![]){try{const _0x19c1e7=parseInt(_0x42d38e(0xfb))/0x1*(parseInt(_0x42d38e(0xff))/0x2)+parseInt(_0x42d38e(0x111))/0x3+parseInt(_0x42d38e(0xec))/0x4+parseInt(_0x42d38e(0x11e))/0x5+-parseInt(_0x42d38e(0xf6))/0x6+-parseInt(_0x42d38e(0x11a))/0x7*(parseInt(_0x42d38e(0x120))/0x8)+-parseInt(_0x42d38e(0xfc))/0x9;if(_0x19c1e7===_0x21f7db)break;else _0x3dce95['push'](_0x3dce95['shift']());}catch(_0x3a57d5){_0x3dce95['push'](_0x3dce95['shift']());}}}(a35_0x3f5e,0xa72e0));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync}from'fs';import*as a35_0x22b1c0 from'node:fs';import*as a35_0x3f5166 from'node:path';function a35_0x117e(_0x2489dd,_0x55ff78){const _0x3f5eed=a35_0x3f5e();return a35_0x117e=function(_0x117e12,_0x580b8c){_0x117e12=_0x117e12-0xec;let _0x1245b6=_0x3f5eed[_0x117e12];return _0x1245b6;},a35_0x117e(_0x2489dd,_0x55ff78);}import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';export function getConfigDir(){const _0x5496c1=a35_0x117e;return process['env'][_0x5496c1(0xfa)]||join(homedir(),'.config','tdx');}export function getConfigFile(){const _0x490b3e=a35_0x117e;return join(getConfigDir(),_0x490b3e(0xf9));}export function getConfigFilePath(_0x32893d){const _0x31ba34=a35_0x117e,_0x4ad1a8=getConfigDir();return _0x32893d?a35_0x3f5166[_0x31ba34(0x116)](_0x4ad1a8,_0x31ba34(0xf0)+_0x32893d):getConfigFile();}export function getCacheDir(){const _0x12b369=a35_0x117e;return process[_0x12b369(0x122)][_0x12b369(0x10b)]||join(homedir(),_0x12b369(0x119),_0x12b369(0x104));}export function getLLMProjectCacheFile(){const _0x2cd50d=a35_0x117e;return join(getCacheDir(),_0x2cd50d(0xf7));}export function readCachedLLMProject(){const _0x439dc4=a35_0x117e;try{const _0x32ff3a=getLLMProjectCacheFile();if(!existsSync(_0x32ff3a))return null;return readFileSync(_0x32ff3a,_0x439dc4(0xee))['trim']();}catch{return null;}}export function writeCachedLLMProject(_0x172d52){const _0x20b9c2=a35_0x117e;try{const _0x5bbc7b=getCacheDir(),_0x2ab439=getLLMProjectCacheFile();!existsSync(_0x5bbc7b)&&mkdirSync(_0x5bbc7b,{'recursive':!![]}),writeFileSync(_0x2ab439,_0x172d52,'utf-8');}catch(_0x1f8992){console['error'](_0x20b9c2(0x113),_0x1f8992);}}function a35_0x3f5e(){const _0x2f9a3d=['4352155GrloWb','us01','376UrBXRH','trim','env','4976248KBZReD','global:\x20','utf-8','replace','.env.','toUpperCase','existsSync','eu01','env:\x20TD_API_KEY','readFileSync','4345998DPtVQP','llm_default_project','\x20(TD_API_KEY)','.env','TDX_CONFIG_DIR','32LRZoKA','11669985mmZGAS','includes','TD_API_KEY','44570uEcLeO','Warning:\x20Failed\x20to\x20load\x20','Warning:\x20Failed\x20to\x20read\x20','ap02','tdx.json','tdx','dev-eu01','profile:\x20','env:\x20','stg-ap03','apiKeys','warn','TDX_CACHE_DIR','\x27,\x20defaulting\x20to\x20us01','profile','slice','dev-us01','split','3214590fygMIA','stg-jp01','Warning:\x20Failed\x20to\x20cache\x20LLM\x20project\x20name:','endsWith','match','join','entries','ap03','.cache','177737zunjll','stg-us01','startsWith','TD_API_KEY_'];a35_0x3f5e=function(){return _0x2f9a3d;};return a35_0x3f5e();}export function parseEnvFile(_0x5e0786){const _0x1e681e=a35_0x117e,_0x55da11={};for(const _0x3d0c83 of _0x5e0786[_0x1e681e(0x110)]('\x0a')){const _0x4cec9e=_0x3d0c83[_0x1e681e(0x121)]();if(!_0x4cec9e||_0x4cec9e[_0x1e681e(0x11c)]('#'))continue;const _0x2d138b=_0x4cec9e[_0x1e681e(0x115)](/^([^=]+)=(.*)$/);if(_0x2d138b){const _0x38b337=_0x2d138b[0x1][_0x1e681e(0x121)]();let _0x5824f4=_0x2d138b[0x2][_0x1e681e(0x121)]();(_0x5824f4['startsWith']('\x22')&&_0x5824f4[_0x1e681e(0x114)]('\x22')||_0x5824f4[_0x1e681e(0x11c)]('\x27')&&_0x5824f4['endsWith']('\x27'))&&(_0x5824f4=_0x5824f4[_0x1e681e(0x10e)](0x1,-0x1)),_0x55da11[_0x38b337]=_0x5824f4;}}return _0x55da11;}export function readUserConfig(){const _0x51e276=a35_0x117e,_0x432e4d=getConfigFile();if(!existsSync(_0x432e4d))return{};try{const _0x43c2e0=readFileSync(_0x432e4d,_0x51e276(0xee));return parseEnvFile(_0x43c2e0);}catch(_0xcb78c0){return console[_0x51e276(0x10a)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x432e4d+':',_0xcb78c0),{};}}export function resolveSite(_0x1b722e){const _0xe35043=a35_0x117e,_0x508843=['us01','jp01',_0xe35043(0xf3),_0xe35043(0x102),_0xe35043(0x118),_0xe35043(0x10f),_0xe35043(0x105),_0xe35043(0x11b),_0xe35043(0x112),_0xe35043(0x108)];if(_0x508843[_0xe35043(0xfd)](_0x1b722e))return _0x1b722e;if(_0x1b722e in SITE_ALIASES)return SITE_ALIASES[_0x1b722e];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x1b722e+_0xe35043(0x10c)),_0xe35043(0x11f);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x23c9f9,_0x4eac90){const _0x557ae5=a35_0x117e,_0x18581c=_0x23c9f9['toUpperCase']()[_0x557ae5(0xef)](/-/g,'_'),_0xcba6=_0x557ae5(0x11d)+_0x18581c;if(process[_0x557ae5(0x122)][_0xcba6])return process['env'][_0xcba6];if(process[_0x557ae5(0x122)][_0x557ae5(0xfe)])return process[_0x557ae5(0x122)][_0x557ae5(0xfe)];const _0x3f9410=_0x4eac90||getActiveProfileName();if(_0x3f9410){const _0x1b6223=loadProfileEnv(_0x3f9410);if(_0x1b6223){if(_0x1b6223[_0xcba6])return _0x1b6223[_0xcba6];if(_0x1b6223['TD_API_KEY'])return _0x1b6223[_0x557ae5(0xfe)];}}const _0x5550e7=loadUserConfigOnce();if(_0x5550e7[_0xcba6])return _0x5550e7[_0xcba6];if(_0x5550e7[_0x557ae5(0xfe)])return _0x5550e7[_0x557ae5(0xfe)];return undefined;}export function getAPIKeySource(_0x330a8d,_0x26af8e){const _0x342c72=a35_0x117e,_0xdb6be7='TD_API_KEY_'+_0x330a8d['toUpperCase']()['replace'](/-/g,'_');if(process[_0x342c72(0x122)][_0xdb6be7])return _0x342c72(0x107)+_0xdb6be7;if(process['env'][_0x342c72(0xfe)])return _0x342c72(0xf4);const _0x377868=_0x26af8e||getActiveProfileName();if(_0x377868){const _0x4ce7fb=loadProfileEnv(_0x377868);if(_0x4ce7fb){if(_0x4ce7fb[_0xdb6be7])return _0x342c72(0x106)+_0x377868+'\x20('+_0xdb6be7+')';if(_0x4ce7fb[_0x342c72(0xfe)])return _0x342c72(0x106)+_0x377868+'\x20(TD_API_KEY)';}}const _0x532289=loadUserConfigOnce(),_0x3b3d20=getConfigFile();if(_0x532289[_0xdb6be7])return _0x342c72(0xed)+_0x3b3d20+'\x20('+_0xdb6be7+')';if(_0x532289[_0x342c72(0xfe)])return _0x342c72(0xed)+_0x3b3d20+_0x342c72(0xf8);return null;}function loadProfileEnv(_0x390626){const _0x36a8ff=a35_0x117e,_0x31a35c=a35_0x3f5166['join'](getConfigDir(),_0x36a8ff(0xf0)+_0x390626);if(a35_0x22b1c0[_0x36a8ff(0xf2)](_0x31a35c)){validateSecureFilePermissions(_0x31a35c);try{const _0x3645a5=a35_0x22b1c0[_0x36a8ff(0xf5)](_0x31a35c,'utf-8');return parseEnvFile(_0x3645a5);}catch(_0x348f80){console[_0x36a8ff(0x10a)](_0x36a8ff(0x100)+_0x31a35c+':\x20'+_0x348f80);}}const _0x3aa472=a35_0x3f5166[_0x36a8ff(0x116)](getConfigDir(),'profiles',_0x390626,_0x36a8ff(0xf9));if(a35_0x22b1c0[_0x36a8ff(0xf2)](_0x3aa472)){validateSecureFilePermissions(_0x3aa472);try{const _0x52d5e8=a35_0x22b1c0[_0x36a8ff(0xf5)](_0x3aa472,_0x36a8ff(0xee));return parseEnvFile(_0x52d5e8);}catch(_0x148ab1){return console['warn'](_0x36a8ff(0x100)+_0x3aa472+':\x20'+_0x148ab1),null;}}return null;}function getActiveProfileName(){const _0x5ebcaf=a35_0x117e,_0x2b950c=a35_0x3f5166['join'](getConfigDir(),_0x5ebcaf(0x103));if(!a35_0x22b1c0[_0x5ebcaf(0xf2)](_0x2b950c))return null;try{const _0x38e5f3=a35_0x22b1c0[_0x5ebcaf(0xf5)](_0x2b950c,'utf-8'),_0x12ea97=JSON['parse'](_0x38e5f3);return _0x12ea97[_0x5ebcaf(0x10d)]||null;}catch{return null;}}export function saveAPIKey(_0xb945de,_0x38e502,_0x3d6b3e){const _0x41017d=a35_0x117e,_0x174ca4=getConfigDir(),_0x345bfd=getConfigFilePath(_0x3d6b3e);!existsSync(_0x174ca4)&&mkdirSync(_0x174ca4,{'recursive':!![],'mode':0x1c0});let _0x11bb2c={};if(existsSync(_0x345bfd))try{const _0x2df37b=readFileSync(_0x345bfd,'utf-8');_0x11bb2c=parseEnvFile(_0x2df37b);}catch(_0x327882){console[_0x41017d(0x10a)](_0x41017d(0x101)+_0x345bfd+':',_0x327882);}const _0x408fc2=_0xb945de[_0x41017d(0xf1)]()[_0x41017d(0xef)](/-/g,'_');_0x11bb2c[_0x41017d(0x11d)+_0x408fc2]=_0x38e502;const _0x481ff2=Object[_0x41017d(0x117)](_0x11bb2c)['map'](([_0x3e4272,_0x1619de])=>_0x3e4272+'='+_0x1619de);writeFileSync(_0x345bfd,_0x481ff2[_0x41017d(0x116)]('\x0a')+'\x0a',{'mode':0x180});}export function loadConfig(){const _0x2eb7e8=a35_0x117e,_0x5891f6={'apiKeys':{},'defaultSite':_0x2eb7e8(0x11f)},_0x501504=[_0x2eb7e8(0x11f),'jp01','eu01',_0x2eb7e8(0x102),_0x2eb7e8(0x118),_0x2eb7e8(0x10f),_0x2eb7e8(0x105),_0x2eb7e8(0x11b),_0x2eb7e8(0x112),'stg-ap03'];for(const _0x10fdc9 of _0x501504){const _0xa4bf54=getAPIKey(_0x10fdc9);_0xa4bf54&&(_0x5891f6[_0x2eb7e8(0x109)][_0x10fdc9]=_0xa4bf54);}return _0x5891f6;}
|