@treasuredata/tdx 0.2.7 → 0.3.0
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 +71 -11
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.d.ts.map +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/http-client.js.map +1 -1
- package/dist/client/llm-client.d.ts +2 -0
- package/dist/client/llm-client.d.ts.map +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/llm-client.js.map +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.d.ts +9 -1
- package/dist/client/td-client.d.ts.map +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/td-client.js.map +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.d.ts +23 -0
- package/dist/commands/auth-command.d.ts.map +1 -0
- package/dist/commands/auth-command.js +1 -0
- package/dist/commands/auth-command.js.map +1 -0
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/chat-command.js.map +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/command.d.ts.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/command.js.map +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.d.ts.map +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/llm-proxy.js.map +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.d.ts +13 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.d.ts +8 -1
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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.d.ts +1 -14
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +1 -1
- package/dist/proxy/server.d.ts +3 -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.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.d.ts +6 -5
- 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.js +1 -1
- package/dist/sdk/llm.d.ts +5 -3
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/anthropic.d.ts +10 -3
- package/dist/types/anthropic.d.ts.map +1 -1
- package/dist/types/endpoints.d.ts +12 -0
- package/dist/types/endpoints.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/endpoints.js.map +1 -1
- package/dist/types/index.d.ts +22 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.d.ts +3 -1
- package/dist/utils/sse-parser.d.ts.map +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/sse-parser.js.map +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a24_0x11f326=a24_0x2e89;function a24_0x2e89(_0x4dc628,_0x280a08){const _0x58ca22=a24_0x58ca();return a24_0x2e89=function(_0x2e8918,_0x3b9edb){_0x2e8918=_0x2e8918-0x1d2;let _0x3d9a13=_0x58ca22[_0x2e8918];return _0x3d9a13;},a24_0x2e89(_0x4dc628,_0x280a08);}(function(_0x356cdb,_0x536506){const _0x570fd7=a24_0x2e89,_0x36d40d=_0x356cdb();while(!![]){try{const _0x3136dd=parseInt(_0x570fd7(0x1e6))/0x1+-parseInt(_0x570fd7(0x1da))/0x2+-parseInt(_0x570fd7(0x1df))/0x3+parseInt(_0x570fd7(0x1f3))/0x4*(-parseInt(_0x570fd7(0x1fb))/0x5)+-parseInt(_0x570fd7(0x206))/0x6*(-parseInt(_0x570fd7(0x1e3))/0x7)+-parseInt(_0x570fd7(0x1ee))/0x8*(parseInt(_0x570fd7(0x1f6))/0x9)+parseInt(_0x570fd7(0x1f9))/0xa;if(_0x3136dd===_0x536506)break;else _0x36d40d['push'](_0x36d40d['shift']());}catch(_0x59ff22){_0x36d40d['push'](_0x36d40d['shift']());}}}(a24_0x58ca,0xc6e3f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a24_0x58ca(){const _0x59aba9=['description','\x20\x20\x20Path:\x20','21geLnmF','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Resolved\x20relative\x20path\x20to:\x20','1590090NMqmMV','segment','parent','Resolved\x20folder\x20ID:\x20','Parent:\x20','segmentPath','Examples:','folderId','219224VxMGmN','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Segment\x20name:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveFolderId','1324rTMwZJ','length','name','279UfbJVH','kind','type','24505180uboMJf','rule','11085yBaTfh','createSegment','site','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folder','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','verbose','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segments','error','resolvePathToResource','1695552CWgVLD','✔\x20Created\x20segment\x20\x27','\x27...','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','resolveParentId','Create\x20child\x20segment\x20with\x20filtering\x20rules','includes','data','2083008YXyYPm','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Creating\x20segment\x20\x27','Target\x20path:\x20','4346715RgDkbm','noCountPopulation'];a24_0x58ca=function(){return _0x59aba9;};return a24_0x58ca();}export class SegmentCreateCommand extends BaseCommand{[a24_0x11f326(0x1f5)]=a24_0x11f326(0x1db);[a24_0x11f326(0x1e1)]=a24_0x11f326(0x1d7);async['execute'](_0x3f70da){const _0x3f7f13=a24_0x11f326,{options:_0x574a2d,args:_0x12a380,tdx:_0x431415}=_0x3f70da,_0x54dd68=_0x574a2d;if(_0x12a380[_0x3f7f13(0x1f4)]===0x0)return console[_0x3f7f13(0x204)](_0x3f7f13(0x1f1)),console['error'](_0x3f7f13(0x1ef)),console[_0x3f7f13(0x204)](_0x3f7f13(0x1ec)),console['error'](_0x3f7f13(0x1dc)),console[_0x3f7f13(0x204)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x3f7f13(0x202)),0x1;const _0x120a35=_0x12a380[0x0],_0x44687d=_0x574a2d[_0x3f7f13(0x1eb)];let _0x31144b=_0x120a35;_0x44687d&&!_0x120a35[_0x3f7f13(0x1d8)]('/')&&(_0x31144b=_0x44687d+'/'+_0x120a35,_0x54dd68[_0x3f7f13(0x201)]&&console[_0x3f7f13(0x204)](_0x3f7f13(0x1e5)+_0x31144b));const _0x262dee=parsePath(_0x31144b);if(_0x262dee[_0x3f7f13(0x203)][_0x3f7f13(0x1f4)]<0x2)return console[_0x3f7f13(0x204)](_0x3f7f13(0x200)),console[_0x3f7f13(0x204)](_0x3f7f13(0x1fe)),0x1;const _0x30dab3=_0x262dee[_0x3f7f13(0x203)][0x0],_0xa63857=getBaseName(_0x31144b),_0x35ca4e=getParentPath(_0x31144b);_0x54dd68[_0x3f7f13(0x201)]&&(console[_0x3f7f13(0x204)]('Site:\x20'+_0x54dd68[_0x3f7f13(0x1fd)]),console[_0x3f7f13(0x204)](_0x3f7f13(0x1de)+_0x31144b),console['error'](_0x3f7f13(0x1ea)+_0x30dab3),console[_0x3f7f13(0x204)](_0x3f7f13(0x1f0)+_0xa63857),console[_0x3f7f13(0x204)]('Parent\x20path:\x20'+_0x35ca4e));const _0x17a218=await withSpinner(_0x3f7f13(0x1d5)+_0x30dab3+_0x3f7f13(0x1d3),()=>_0x431415[_0x3f7f13(0x1e7)][_0x3f7f13(0x1d6)](_0x30dab3),{'verbose':_0x54dd68[_0x3f7f13(0x201)]}),_0xa38b7d=_0x17a218[_0x3f7f13(0x1d9)];let _0x2f56f9;if(_0x262dee['segments'][_0x3f7f13(0x1f4)]>0x2){const _0x5d5356=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x35ca4e+_0x3f7f13(0x1d3),()=>_0x431415[_0x3f7f13(0x1e7)][_0x3f7f13(0x205)](_0x35ca4e),{'verbose':_0x54dd68['verbose']}),_0x3ce7fa=_0x5d5356[_0x3f7f13(0x1d9)];if(_0x3ce7fa[_0x3f7f13(0x1f8)]!==_0x3f7f13(0x1ff)&&_0x3ce7fa[_0x3f7f13(0x1f8)]!==_0x3f7f13(0x1e8))return console[_0x3f7f13(0x204)](_0x3f7f13(0x1e4)),0x1;_0x2f56f9=_0x3ce7fa[_0x3f7f13(0x1ed)];}else{if(_0x54dd68[_0x3f7f13(0x1ff)]){const _0x1753ca=await withSpinner('Resolving\x20folder\x20\x27'+_0x54dd68[_0x3f7f13(0x1ff)]+_0x3f7f13(0x1d3),()=>_0x431415['segment'][_0x3f7f13(0x1f2)](_0xa38b7d,_0x54dd68[_0x3f7f13(0x1ff)]),{'verbose':_0x54dd68['verbose']});_0x2f56f9=_0x1753ca[_0x3f7f13(0x1d9)];}}_0x54dd68['verbose']&&_0x2f56f9&&console['error'](_0x3f7f13(0x1e9)+_0x2f56f9);const _0x2e17a0=await loadJSONFromOptions(_0x54dd68[_0x3f7f13(0x1fa)],_0x54dd68['ruleFile']),_0x2ec336={'name':_0xa63857,'description':_0x54dd68[_0x3f7f13(0x1e1)],'rule':_0x2e17a0,'kind':_0x54dd68[_0x3f7f13(0x1f7)]!==undefined?parseInt(_0x54dd68['kind'],0xa):undefined,'isVisible':_0x54dd68['invisible']?![]:undefined,'segmentFolderId':_0x2f56f9,'countPopulation':_0x54dd68[_0x3f7f13(0x1e0)]?![]:undefined},_0x21738b=await withSpinner(_0x3f7f13(0x1dd)+_0xa63857+_0x3f7f13(0x1d3),()=>_0x431415['segment'][_0x3f7f13(0x1fc)](_0xa38b7d,_0x2ec336),{'verbose':_0x54dd68[_0x3f7f13(0x201)]}),_0x2c9183=_0x21738b[_0x3f7f13(0x1d9)];return console[_0x3f7f13(0x204)](_0x3f7f13(0x1d2)+_0x2c9183[_0x3f7f13(0x1f5)]+_0x3f7f13(0x1d4)+_0x2c9183['id']),_0x31144b!==_0x120a35&&console[_0x3f7f13(0x204)](_0x3f7f13(0x1e2)+_0x31144b),await handleSDKOutput([_0x2c9183],_0x54dd68),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a25_0x497a(_0x5ef630,_0x4e57d6){const _0x5aad47=a25_0x5aad();return a25_0x497a=function(_0x497a09,_0x315e40){_0x497a09=_0x497a09-0x1d4;let _0x314eb3=_0x5aad47[_0x497a09];return _0x314eb3;},a25_0x497a(_0x5ef630,_0x4e57d6);}const a25_0xd1f998=a25_0x497a;(function(_0x40d86e,_0x51ba1d){const _0x333688=a25_0x497a,_0x152987=_0x40d86e();while(!![]){try{const _0x31e12a=parseInt(_0x333688(0x1d9))/0x1+parseInt(_0x333688(0x1d6))/0x2+parseInt(_0x333688(0x1e6))/0x3*(parseInt(_0x333688(0x1ec))/0x4)+-parseInt(_0x333688(0x1e5))/0x5*(parseInt(_0x333688(0x1d8))/0x6)+-parseInt(_0x333688(0x1dd))/0x7+parseInt(_0x333688(0x1dc))/0x8*(parseInt(_0x333688(0x1d4))/0x9)+parseInt(_0x333688(0x1e4))/0xa*(-parseInt(_0x333688(0x1e1))/0xb);if(_0x31e12a===_0x51ba1d)break;else _0x152987['push'](_0x152987['shift']());}catch(_0x4c2090){_0x152987['push'](_0x152987['shift']());}}}(a25_0x5aad,0xceb35));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a25_0x5aad(){const _0x21fc44=['Parent\x20segment:\x20','Site:\x20','50788BCyOUl','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Found\x20','verbose','9594vnPATZ','segment:fields','1801786saeNXY','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','36jYMylH','593656aMjcOb','\x27...','execute','304yEqUfY','3328871jaEzPL','segment','Listing\x20fields\x20for\x20\x27','error','118228HJReBu','length','List\x20available\x20fields\x20for\x20segmentation','500qZWoWV','311495nsqLdM','165ELnaKs','\x20field','listFields','site'];a25_0x5aad=function(){return _0x21fc44;};return a25_0x5aad();}export class SegmentFieldsCommand extends BaseCommand{['name']=a25_0xd1f998(0x1d5);['description']=a25_0xd1f998(0x1e3);async[a25_0xd1f998(0x1db)](_0x46993f){const _0x273ab6=a25_0xd1f998,{options:_0x52bf2f,args:_0x5e8b73,tdx:_0x1f7618}=_0x46993f;if(_0x5e8b73['length']===0x0)return console[_0x273ab6(0x1e0)](_0x273ab6(0x1ed)),console['error'](_0x273ab6(0x1d7)),0x1;const _0x54b588=_0x5e8b73[0x0];_0x52bf2f['verbose']&&(console['error'](_0x273ab6(0x1eb)+_0x52bf2f[_0x273ab6(0x1e9)]),console['error'](_0x273ab6(0x1ea)+_0x54b588));const _0x1b5e17=await withSpinner(_0x273ab6(0x1df)+_0x54b588+_0x273ab6(0x1da),()=>_0x1f7618[_0x273ab6(0x1de)][_0x273ab6(0x1e8)](_0x54b588),{'verbose':_0x52bf2f[_0x273ab6(0x1ef)]}),_0x120bba=_0x1b5e17['data'];return console[_0x273ab6(0x1e0)](_0x273ab6(0x1ee)+_0x120bba[_0x273ab6(0x1e2)]+_0x273ab6(0x1e7)+(_0x120bba[_0x273ab6(0x1e2)]!==0x1?'s':'')),await handleSDKOutput(_0x120bba,_0x52bf2f),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x1ecf(_0xf07b1b,_0x44da16){const _0x4023d9=a26_0x4023();return a26_0x1ecf=function(_0x1ecfc3,_0x253e9a){_0x1ecfc3=_0x1ecfc3-0x78;let _0x38b5e6=_0x4023d9[_0x1ecfc3];return _0x38b5e6;},a26_0x1ecf(_0xf07b1b,_0x44da16);}const a26_0x823619=a26_0x1ecf;(function(_0xcebbba,_0x2f10fe){const _0x149b42=a26_0x1ecf,_0x3f7c0a=_0xcebbba();while(!![]){try{const _0x3eac96=parseInt(_0x149b42(0x82))/0x1*(-parseInt(_0x149b42(0x7a))/0x2)+parseInt(_0x149b42(0x8e))/0x3*(parseInt(_0x149b42(0x8b))/0x4)+parseInt(_0x149b42(0x7c))/0x5*(-parseInt(_0x149b42(0x91))/0x6)+-parseInt(_0x149b42(0x8c))/0x7*(parseInt(_0x149b42(0x93))/0x8)+-parseInt(_0x149b42(0x86))/0x9*(-parseInt(_0x149b42(0x84))/0xa)+-parseInt(_0x149b42(0x92))/0xb+-parseInt(_0x149b42(0x89))/0xc*(-parseInt(_0x149b42(0x88))/0xd);if(_0x3eac96===_0x2f10fe)break;else _0x3f7c0a['push'](_0x3f7c0a['shift']());}catch(_0x44000f){_0x3f7c0a['push'](_0x3f7c0a['shift']());}}}(a26_0x4023,0x95ad6));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{['name']=a26_0x823619(0x7f);[a26_0x823619(0x7b)]='Show\x20current\x20segment/folder\x20context';async[a26_0x823619(0x79)](_0x1dc332){const _0x2b8e1c=a26_0x823619,{options:_0x403e76}=_0x1dc332;try{const _0x330689=_0x403e76[_0x2b8e1c(0x85)];if(!_0x330689)return _0x403e76[_0x2b8e1c(0x7e)]==='json'||_0x403e76[_0x2b8e1c(0x7e)]===_0x2b8e1c(0x8a)?console['log'](JSON[_0x2b8e1c(0x8f)]({'path':'/','type':_0x2b8e1c(0x87)})):console[_0x2b8e1c(0x8d)]('/'),0x0;if(_0x403e76[_0x2b8e1c(0x7e)]===_0x2b8e1c(0x94)||_0x403e76[_0x2b8e1c(0x7e)]===_0x2b8e1c(0x8a)){const _0x476c38={'path':_0x330689};console[_0x2b8e1c(0x8d)](JSON['stringify'](_0x476c38));}else console['log'](_0x330689),_0x403e76[_0x2b8e1c(0x7d)]&&(console[_0x2b8e1c(0x78)](''),console[_0x2b8e1c(0x78)](_0x2b8e1c(0x80)),console[_0x2b8e1c(0x78)](_0x2b8e1c(0x83)+_0x330689),console[_0x2b8e1c(0x78)](''),console[_0x2b8e1c(0x78)](_0x2b8e1c(0x81)),console[_0x2b8e1c(0x78)](_0x2b8e1c(0x90)));return 0x0;}catch(_0x1b8280){throw _0x1b8280;}}}function a26_0x4023(){const _0x5e4aae=['61350IVanqm','segmentPath','909fDNaKe','root','1016587KPoBLM','204IyuEqD','jsonl','230196BUnEoP','26383GBEKJC','log','9jLKxPu','stringify','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','14724ZfAKjw','5549709FikWns','1096coQWsG','json','error','execute','2AZPMyC','description','850LJJClN','verbose','format','segment:pwd','Context\x20details:','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','70535VzqfbU','\x20\x20Path:\x20'];a26_0x4023=function(){return _0x5e4aae;};return a26_0x4023();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x5703(_0x203df6,_0x3db6c){const _0x8e8391=a27_0x8e83();return a27_0x5703=function(_0x5703af,_0x1777ec){_0x5703af=_0x5703af-0x16f;let _0x44100c=_0x8e8391[_0x5703af];return _0x44100c;},a27_0x5703(_0x203df6,_0x3db6c);}const a27_0x1532e2=a27_0x5703;(function(_0x5747c0,_0xd821b2){const _0x4e3370=a27_0x5703,_0x9972ef=_0x5747c0();while(!![]){try{const _0x5bd051=-parseInt(_0x4e3370(0x194))/0x1+-parseInt(_0x4e3370(0x173))/0x2+-parseInt(_0x4e3370(0x171))/0x3*(parseInt(_0x4e3370(0x172))/0x4)+parseInt(_0x4e3370(0x187))/0x5+parseInt(_0x4e3370(0x180))/0x6*(-parseInt(_0x4e3370(0x193))/0x7)+parseInt(_0x4e3370(0x184))/0x8*(-parseInt(_0x4e3370(0x17e))/0x9)+parseInt(_0x4e3370(0x170))/0xa;if(_0x5bd051===_0xd821b2)break;else _0x9972ef['push'](_0x9972ef['shift']());}catch(_0x1bb6e4){_0x9972ef['push'](_0x9972ef['shift']());}}}(a27_0x8e83,0x27a6d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a27_0x8e83(){const _0x3c4d9c=['2239384UYOQEh','\x27...','kind','1330245zWSgMe','Update\x20existing\x20child\x20segment','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20update\x20','Segment\x20ID:\x20','error','resolveFolderId','verbose','rule','Parent\x20ID:\x20','length','Resolving\x20folder\x20\x27','119hXHnNK','62699xVJOIV','\x20\x20\x20Path:\x20','segment:update','execute','Resolving\x20path\x20\x27','Updating\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INTERNAL','parentId','7533370CbEliu','348JRoGAs','9780mdGIcZ','416446GhRGgu','resolvePathToResource','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentId','segmentName','data','type','segment','description','name','9iFQZSE','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','7944SiMhOs','Examples:','segmentPath','✔\x20Updated\x20segment\x20\x27'];a27_0x8e83=function(){return _0x3c4d9c;};return a27_0x8e83();}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a27_0x1532e2(0x17d)]=a27_0x1532e2(0x196);['description']=a27_0x1532e2(0x188);async[a27_0x1532e2(0x197)](_0x417827){const _0x49cb8a=a27_0x1532e2,{options:_0xdaa1b7,args:_0x5d8446,tdx:_0x5df945}=_0x417827,_0x50db6a=_0xdaa1b7;if(_0x5d8446[_0x49cb8a(0x191)]===0x0)return console['error'](_0x49cb8a(0x176)),console[_0x49cb8a(0x18c)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x49cb8a(0x18c)](_0x49cb8a(0x181)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x49cb8a(0x18c)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2a5e42=_0x5d8446[0x0],_0x34b8db=_0xdaa1b7[_0x49cb8a(0x182)];let _0x4d7196=_0x2a5e42;_0x34b8db&&!_0x2a5e42['includes']('/')&&(_0x4d7196=_0x34b8db+'/'+_0x2a5e42,_0x50db6a[_0x49cb8a(0x18e)]&&console[_0x49cb8a(0x18c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4d7196));const _0x19c5d6=await withSpinner(_0x49cb8a(0x198)+_0x4d7196+'\x27...',()=>_0x5df945[_0x49cb8a(0x17b)][_0x49cb8a(0x174)](_0x4d7196),{'verbose':_0x50db6a[_0x49cb8a(0x18e)]}),_0x1db437=_0x19c5d6['data'];_0x50db6a[_0x49cb8a(0x18e)]&&console[_0x49cb8a(0x18c)]('Resolved\x20type:\x20'+_0x1db437['type']);if(_0x1db437[_0x49cb8a(0x17a)]!=='segment')return console[_0x49cb8a(0x18c)](_0x49cb8a(0x18a)+_0x1db437['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x49cb8a(0x18c)](_0x49cb8a(0x17f)),0x1;if(!_0x1db437[_0x49cb8a(0x177)])throw new SDKError(ErrorCode[_0x49cb8a(0x19b)],_0x49cb8a(0x19a));const _0x4ac118=_0x1db437[_0x49cb8a(0x16f)],_0x3ccd1c=_0x1db437[_0x49cb8a(0x177)];_0x50db6a[_0x49cb8a(0x18e)]&&(console[_0x49cb8a(0x18c)](_0x49cb8a(0x190)+_0x4ac118),console[_0x49cb8a(0x18c)](_0x49cb8a(0x18b)+_0x3ccd1c));let _0x40b853;if(_0x50db6a[_0x49cb8a(0x175)]){const _0x366305=_0x50db6a[_0x49cb8a(0x175)],_0x3bdde6=await withSpinner(_0x49cb8a(0x192)+_0x366305+'\x27...',()=>_0x5df945['segment'][_0x49cb8a(0x18d)](_0x4ac118,_0x366305),{'verbose':_0x50db6a['verbose']});_0x40b853=parseInt(_0x3bdde6[_0x49cb8a(0x179)],0xa),_0x50db6a['verbose']&&console[_0x49cb8a(0x18c)](_0x49cb8a(0x189)+_0x40b853);}const _0x4d2c30=await loadJSONFromOptions(_0x50db6a[_0x49cb8a(0x18f)],_0x50db6a['ruleFile']),_0x22c7ca={'name':_0x50db6a[_0x49cb8a(0x17d)],'description':_0x50db6a[_0x49cb8a(0x17c)],'rule':_0x4d2c30,'kind':_0x50db6a[_0x49cb8a(0x186)]!==undefined?parseInt(_0x50db6a[_0x49cb8a(0x186)],0xa):undefined,'segmentFolderId':_0x40b853},_0x2ce931=await withSpinner(_0x49cb8a(0x199)+_0x1db437[_0x49cb8a(0x178)]+_0x49cb8a(0x185),()=>_0x5df945['segment']['updateSegmentById'](_0x4ac118,_0x3ccd1c,_0x22c7ca),{'verbose':_0x50db6a[_0x49cb8a(0x18e)]}),_0xc57ce1=_0x2ce931[_0x49cb8a(0x179)];return console['error'](_0x49cb8a(0x183)+_0xc57ce1[_0x49cb8a(0x17d)]+'\x27'),_0x4d7196!==_0x2a5e42&&console[_0x49cb8a(0x18c)](_0x49cb8a(0x195)+_0x4d7196),await handleSDKOutput([_0xc57ce1],_0x50db6a),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x40cf62=a28_0x5ad5;function a28_0x3756(){const _0x12131b=['segment','11cpaEKR','Usage:\x20tdx\x20segment\x20use\x20<path>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','108HqEheh','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','155vKZSti','segment:use','execute','98YUByLz','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','8134650Hzckip','isAbsolute','Context\x20set\x20to:\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','join','Parent\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Path\x20is\x20required','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','log','name','7888464iOdIBi','parentName','slice','27739060wqdPHI','split','verbose','session','Folder\x20ID:\x20','description','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Examples:','type','Resolved\x20path\x20type:\x20','folderPath','error','326PTPvmj','Use:\x20tdx\x20segment\x20use\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x27...','3694124ArCIXH','115698qhiQnD','length','parentId','resolvePathToResource','folderId','Context\x20cleared.\x20Back\x20to\x20root.','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','segmentPath','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','site','Site:\x20','fullPath','102549zayRzM'];a28_0x3756=function(){return _0x12131b;};return a28_0x3756();}(function(_0x4f13af,_0x2a952f){const _0x38ea09=a28_0x5ad5,_0x2afb5f=_0x4f13af();while(!![]){try{const _0x370f25=parseInt(_0x38ea09(0xbf))/0x1*(parseInt(_0x38ea09(0xdb))/0x2)+parseInt(_0x38ea09(0xee))/0x3*(-parseInt(_0x38ea09(0xf3))/0x4)+parseInt(_0x38ea09(0xf5))/0x5*(-parseInt(_0x38ea09(0xe2))/0x6)+-parseInt(_0x38ea09(0xe1))/0x7+-parseInt(_0x38ea09(0xcc))/0x8+parseInt(_0x38ea09(0xc1))/0x9+-parseInt(_0x38ea09(0xcf))/0xa*(-parseInt(_0x38ea09(0xf0))/0xb);if(_0x370f25===_0x2a952f)break;else _0x2afb5f['push'](_0x2afb5f['shift']());}catch(_0x59b4d6){_0x2afb5f['push'](_0x2afb5f['shift']());}}}(a28_0x3756,0xa0f1a));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a28_0x5ad5(_0x2d437e,_0x20c6a8){const _0x37561c=a28_0x3756();return a28_0x5ad5=function(_0x5ad5be,_0x39dda3){_0x5ad5be=_0x5ad5be-0xbd;let _0x54d493=_0x37561c[_0x5ad5be];return _0x54d493;},a28_0x5ad5(_0x2d437e,_0x20c6a8);}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a28_0x40cf62(0xcb)]=a28_0x40cf62(0xbd);[a28_0x40cf62(0xd4)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a28_0x40cf62(0xbe)](_0x2b4a7e){const _0x4db49b=a28_0x40cf62,{options:_0x152f02,args:_0x4b7e4a,tdx:_0x3bf0fb}=_0x2b4a7e;if(_0x4b7e4a[_0x4db49b(0xe3)]===0x0)return console[_0x4db49b(0xda)](_0x4db49b(0xc8)),console['error'](_0x4db49b(0xf1)),console[_0x4db49b(0xda)](_0x4db49b(0xd6)),console[_0x4db49b(0xda)](_0x4db49b(0xd5)),console['error'](_0x4db49b(0xde)),console[_0x4db49b(0xda)](_0x4db49b(0xdd)),console['error'](_0x4db49b(0xc9)),0x1;const _0xef4bc6=_0x4b7e4a[0x0],_0x3a0b30=_0x152f02[_0x4db49b(0xd2)];try{if(_0xef4bc6==='/')return saveSessionContext({'segment_path':undefined},_0x3a0b30),console['log'](_0x4db49b(0xe7)),0x0;const _0x38bb39=_0x152f02[_0x4db49b(0xe9)];let _0x55f091=_0xef4bc6;const _0x233685=parsePath(_0xef4bc6);if(!_0x233685[_0x4db49b(0xc2)]){if(!_0x38bb39)return console[_0x4db49b(0xda)](_0x4db49b(0xf4)),console['error'](_0x4db49b(0xc0)),0x1;if(_0xef4bc6==='..'){const _0x286023=_0x38bb39[_0x4db49b(0xd0)]('/')[_0x4db49b(0xce)](0x0,-0x1)[_0x4db49b(0xc5)]('/');_0x55f091=_0x286023||'/';}else _0xef4bc6==='.'?_0x55f091=_0x38bb39:_0x55f091=_0x38bb39+'/'+_0xef4bc6;_0x152f02[_0x4db49b(0xd1)]&&console[_0x4db49b(0xda)](_0x4db49b(0xc7)+_0x55f091);}if(_0x55f091==='/'||_0x55f091==='')return saveSessionContext({'segment_path':undefined},_0x3a0b30),console[_0x4db49b(0xca)](_0x4db49b(0xe7)),0x0;_0x55f091=normalizePath(_0x55f091);const _0x208307=parsePath(_0x55f091)['segments'];if(_0x208307['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3a0b30),console[_0x4db49b(0xca)](_0x4db49b(0xe7)),0x0;_0x152f02[_0x4db49b(0xd1)]&&(console['error'](_0x4db49b(0xec)+_0x152f02[_0x4db49b(0xeb)]),console['error']('Target\x20path:\x20'+_0x55f091));const _0xef0a03=await withSpinner('Resolving\x20path\x20\x27'+_0x55f091+_0x4db49b(0xe0),()=>_0x3bf0fb[_0x4db49b(0xef)][_0x4db49b(0xe5)](_0x55f091),{'verbose':_0x152f02['verbose']}),_0x433c37=_0xef0a03['data'];_0x152f02[_0x4db49b(0xd1)]&&(console['error'](_0x4db49b(0xd8)+_0x433c37[_0x4db49b(0xd7)]),console[_0x4db49b(0xda)](_0x4db49b(0xc6)+_0x433c37[_0x4db49b(0xe4)]),_0x433c37['folderId']&&console[_0x4db49b(0xda)](_0x4db49b(0xd3)+_0x433c37[_0x4db49b(0xe6)]));if(_0x433c37[_0x4db49b(0xd7)]===_0x4db49b(0xef))return console['error'](_0x4db49b(0xc4)),console['error'](_0x4db49b(0xdf)),console[_0x4db49b(0xda)](_0x4db49b(0xdc)+_0x433c37[_0x4db49b(0xcd)]+(_0x433c37[_0x4db49b(0xd9)]?'/'+_0x433c37[_0x4db49b(0xd9)][_0x4db49b(0xc5)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x433c37[_0x4db49b(0xed)],'parent_segment':_0x433c37['parentName']},_0x3a0b30),console[_0x4db49b(0xca)](_0x4db49b(0xc3)+_0x433c37[_0x4db49b(0xed)]),_0x152f02[_0x4db49b(0xd1)]&&(console[_0x4db49b(0xda)](_0x4db49b(0xf2)),console[_0x4db49b(0xda)](_0x4db49b(0xea)),console[_0x4db49b(0xda)](_0x4db49b(0xe8))),0x0;}catch(_0x464609){throw _0x464609;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x1d27de=a29_0x609e;(function(_0x22bbb0,_0x4d7878){const _0x514766=a29_0x609e,_0x429b4f=_0x22bbb0();while(!![]){try{const _0x4e7c83=-parseInt(_0x514766(0x11a))/0x1*(parseInt(_0x514766(0x133))/0x2)+parseInt(_0x514766(0x14a))/0x3*(-parseInt(_0x514766(0x14e))/0x4)+parseInt(_0x514766(0x139))/0x5*(parseInt(_0x514766(0x115))/0x6)+-parseInt(_0x514766(0x12c))/0x7*(parseInt(_0x514766(0x12b))/0x8)+-parseInt(_0x514766(0x119))/0x9+-parseInt(_0x514766(0x145))/0xa*(-parseInt(_0x514766(0x143))/0xb)+parseInt(_0x514766(0x127))/0xc;if(_0x4e7c83===_0x4d7878)break;else _0x429b4f['push'](_0x429b4f['shift']());}catch(_0x143f0e){_0x429b4f['push'](_0x429b4f['shift']());}}}(a29_0x2a0b,0x99023));import{BaseCommand}from'./command.js';function a29_0x2a0b(){const _0x1153c2=['No\x20parent\x20segments\x20match\x20pattern:\x20','Recursive\x20mode:\x20enabled','replace','Resolving\x20context\x20path\x20\x27','1086BcgcFe','map','cause','segment','2467791koeedD','427532tcHIbx','length','data','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','name','message','\x20\x20Cause:\x20','resolvePathToResource','listRecursive','filter','\x20top-level\x20items','verbose','folderId','12457188oDwFoD','dim','folder','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','72VuLsQp','99169wsgNZj','jsonl','👥\x20','parentId','description','Site:\x20','✔\x20Found\x20','2HAxKSh','segmentPath','site','\x20folder','listUnified','Path/pattern\x20arg:\x20','21905XvIGyy','\x20segment','execute','includes','format','localeCompare','[parent\x20segments]','Listing\x20parent\x20segments\x20matching\x20\x27','error','\x27...','1018897PmTcmY','\x5c$&','20YMUVpX','json','listParents','(empty)','Parent\x20ID:\x20','3njVMJF','sort','log','Error:\x20','2241428pMSxLK','\x20and\x20','maxDepth','✔\x20Built\x20tree\x20with\x20','\x20parent\x20segment','Folder\x20ID:\x20','attributes','test','listParentsWithPattern','population'];a29_0x2a0b=function(){return _0x1153c2;};return a29_0x2a0b();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a29_0x609e(_0x51c1f0,_0x1ef7a8){const _0x2a0b4d=a29_0x2a0b();return a29_0x609e=function(_0x609eff,_0x13a87e){_0x609eff=_0x609eff-0x110;let _0x4d5d60=_0x2a0b4d[_0x609eff];return _0x4d5d60;},a29_0x609e(_0x51c1f0,_0x1ef7a8);}import{formatRows}from'../utils/formatters.js';import a29_0x37c102 from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x1d27de(0x11e)]='segments';[a29_0x1d27de(0x130)]=a29_0x1d27de(0x12a);async[a29_0x1d27de(0x13b)](_0x46a23d){const _0x3a86af=a29_0x1d27de,{options:_0x2fb85e,args:_0x3b4352}=_0x46a23d,_0x1d5ade=_0x2fb85e['recursive'],_0x1a8894=_0x3b4352[0x0];try{const _0x10ab82=_0x2fb85e[_0x3a86af(0x134)];_0x2fb85e['verbose']&&(console[_0x3a86af(0x141)](_0x3a86af(0x131)+_0x2fb85e[_0x3a86af(0x135)]),console['error']('Current\x20context:\x20'+(_0x10ab82||'/')),_0x1a8894&&console[_0x3a86af(0x141)](_0x3a86af(0x138)+_0x1a8894),_0x1d5ade&&console[_0x3a86af(0x141)](_0x3a86af(0x112)));if(_0x1a8894){const _0x4d668d=_0x1a8894['includes']('*')||_0x1a8894[_0x3a86af(0x13c)]('?');if(_0x4d668d&&!_0x10ab82)return await this[_0x3a86af(0x156)](_0x46a23d,_0x1a8894);else return _0x4d668d?(console[_0x3a86af(0x141)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x3a86af(0x141)](_0x3a86af(0x11d)),0x1):_0x1d5ade?await this[_0x3a86af(0x122)](_0x46a23d,_0x1a8894):await this[_0x3a86af(0x137)](_0x46a23d,_0x1a8894);}if(!_0x10ab82)return await this[_0x3a86af(0x147)](_0x46a23d);return _0x1d5ade?await this['listRecursive'](_0x46a23d,_0x10ab82):await this['listUnified'](_0x46a23d,_0x10ab82);}catch(_0xad1faf){if(_0xad1faf instanceof SDKError)return console[_0x3a86af(0x141)](_0x3a86af(0x14d)+_0xad1faf[_0x3a86af(0x11f)]),_0xad1faf[_0x3a86af(0x117)]&&console['error'](_0x3a86af(0x120)+_0xad1faf[_0x3a86af(0x117)]),0x1;throw _0xad1faf;}}async[a29_0x1d27de(0x156)](_0x100263,_0x2af208){const _0x37c0b7=a29_0x1d27de,{options:_0x130e17,tdx:_0x5d41b2}=_0x100263,_0x18156c=await withSpinner(_0x37c0b7(0x140)+_0x2af208+'\x27...',()=>_0x5d41b2[_0x37c0b7(0x118)][_0x37c0b7(0x147)](),{'verbose':_0x130e17[_0x37c0b7(0x125)]}),_0x5dfcc6=_0x18156c[_0x37c0b7(0x11c)],_0x7b83e7=_0x2af208[_0x37c0b7(0x113)](/[.+^${}()|[\]\\]/g,_0x37c0b7(0x144))['replace'](/\*/g,'.*')[_0x37c0b7(0x113)](/\?/g,'.'),_0x24397e=new RegExp('^'+_0x7b83e7+'$','i'),_0x1d0f46=_0x5dfcc6[_0x37c0b7(0x123)](_0x2a0d9d=>_0x24397e[_0x37c0b7(0x155)](_0x2a0d9d[_0x37c0b7(0x154)][_0x37c0b7(0x11e)]));console[_0x37c0b7(0x141)](_0x37c0b7(0x132)+_0x1d0f46[_0x37c0b7(0x11b)]+_0x37c0b7(0x152)+(_0x1d0f46[_0x37c0b7(0x11b)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x2af208+'\x27');if(_0x130e17[_0x37c0b7(0x13d)]===_0x37c0b7(0x146)||_0x130e17[_0x37c0b7(0x13d)]===_0x37c0b7(0x12d))await handleSDKOutput(_0x1d0f46,_0x130e17);else{if(_0x1d0f46['length']===0x0)console[_0x37c0b7(0x14c)](_0x37c0b7(0x111)+_0x2af208);else{console[_0x37c0b7(0x14c)](_0x37c0b7(0x13f));for(const _0x113771 of _0x1d0f46){const _0x566b0a=_0x113771[_0x37c0b7(0x154)][_0x37c0b7(0x110)]?a29_0x37c102[_0x37c0b7(0x128)]('\x20('+formatRows(_0x113771[_0x37c0b7(0x154)][_0x37c0b7(0x110)])+')'):'';console['log'](_0x37c0b7(0x12e)+_0x113771[_0x37c0b7(0x154)]['name']+_0x566b0a);}}}return 0x0;}async[a29_0x1d27de(0x147)](_0x1b96e5){const _0x5dddf0=a29_0x1d27de,{options:_0x31e659,tdx:_0x10c272}=_0x1b96e5,_0x188efd=await withSpinner('Listing\x20parent\x20segments...',()=>_0x10c272[_0x5dddf0(0x118)][_0x5dddf0(0x147)](),{'verbose':_0x31e659['verbose']}),_0x72e64b=_0x188efd[_0x5dddf0(0x11c)];console[_0x5dddf0(0x141)]('✔\x20Found\x20'+_0x72e64b['length']+_0x5dddf0(0x152)+(_0x72e64b['length']!==0x1?'s':''));if(_0x31e659[_0x5dddf0(0x13d)]===_0x5dddf0(0x146)||_0x31e659[_0x5dddf0(0x13d)]==='jsonl')await handleSDKOutput(_0x72e64b,_0x31e659);else{console['log'](_0x5dddf0(0x13f));for(const _0x2073b2 of _0x72e64b){const _0x2ceb17=_0x2073b2['attributes']['population']?a29_0x37c102['dim']('\x20('+formatRows(_0x2073b2['attributes']['population'])+')'):'';console[_0x5dddf0(0x14c)](_0x5dddf0(0x12e)+_0x2073b2['attributes'][_0x5dddf0(0x11e)]+_0x2ceb17);}}return 0x0;}async[a29_0x1d27de(0x137)](_0x1a6ca7,_0x2b8678){const _0x5ecf2c=a29_0x1d27de,{options:_0x3f9855,tdx:_0xecea5c}=_0x1a6ca7,_0x4ae065=await withSpinner(_0x5ecf2c(0x114)+_0x2b8678+'\x27...',()=>_0xecea5c[_0x5ecf2c(0x118)][_0x5ecf2c(0x121)](_0x2b8678),{'verbose':_0x3f9855['verbose']}),_0xd941bd=_0x4ae065[_0x5ecf2c(0x11c)];_0x3f9855['verbose']&&(console[_0x5ecf2c(0x141)](_0x5ecf2c(0x149)+_0xd941bd[_0x5ecf2c(0x12f)]),_0xd941bd[_0x5ecf2c(0x126)]&&console[_0x5ecf2c(0x141)](_0x5ecf2c(0x153)+_0xd941bd[_0x5ecf2c(0x126)]));const _0x5da3e3=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0xecea5c[_0x5ecf2c(0x118)][_0x5ecf2c(0x137)](_0xd941bd['parentId'],_0xd941bd[_0x5ecf2c(0x126)]),{'verbose':_0x3f9855[_0x5ecf2c(0x125)]}),{folders:_0x436d49,segments:_0x2ed50c}=_0x5da3e3[_0x5ecf2c(0x11c)],_0x2c5698=_0x436d49[_0x5ecf2c(0x11b)]+_0x2ed50c[_0x5ecf2c(0x11b)];console[_0x5ecf2c(0x141)](_0x5ecf2c(0x132)+_0x436d49['length']+_0x5ecf2c(0x136)+(_0x436d49[_0x5ecf2c(0x11b)]!==0x1?'s':'')+_0x5ecf2c(0x14f)+_0x2ed50c['length']+_0x5ecf2c(0x13a)+(_0x2ed50c['length']!==0x1?'s':''));if(_0x3f9855['format']===_0x5ecf2c(0x146)||_0x3f9855[_0x5ecf2c(0x13d)]===_0x5ecf2c(0x12d)){const _0x5d15fc=[..._0x436d49['map'](_0x2d2655=>({..._0x2d2655,'type':_0x5ecf2c(0x129)})),..._0x2ed50c[_0x5ecf2c(0x116)](_0x5e622b=>({..._0x5e622b,'type':'segment'}))][_0x5ecf2c(0x14b)]((_0x6c5670,_0x511aa7)=>_0x6c5670[_0x5ecf2c(0x11e)][_0x5ecf2c(0x13e)](_0x511aa7[_0x5ecf2c(0x11e)]));await handleSDKOutput(_0x5d15fc,_0x3f9855);}else{if(_0x2c5698===0x0)console[_0x5ecf2c(0x14c)](a29_0x37c102['dim']('[/'+_0x2b8678+']')),console[_0x5ecf2c(0x14c)](_0x5ecf2c(0x148));else{console[_0x5ecf2c(0x14c)](a29_0x37c102[_0x5ecf2c(0x128)]('[/'+_0x2b8678+']'));const _0x84f9ab=formatFlatList(_0x436d49,_0x2ed50c,{'showMetadata':!![]});console[_0x5ecf2c(0x14c)](_0x84f9ab);}}return 0x0;}async[a29_0x1d27de(0x122)](_0x517540,_0x423b4c){const _0x1221c4=a29_0x1d27de,{options:_0x1901d8,tdx:_0x22f062}=_0x517540,_0x504cdb=await withSpinner(_0x1221c4(0x114)+_0x423b4c+_0x1221c4(0x142),()=>_0x22f062[_0x1221c4(0x118)][_0x1221c4(0x121)](_0x423b4c),{'verbose':_0x1901d8[_0x1221c4(0x125)]}),_0x55aca5=_0x504cdb[_0x1221c4(0x11c)];_0x1901d8[_0x1221c4(0x125)]&&(console[_0x1221c4(0x141)](_0x1221c4(0x149)+_0x55aca5[_0x1221c4(0x12f)]),_0x55aca5['folderId']&&console[_0x1221c4(0x141)]('Folder\x20ID:\x20'+_0x55aca5[_0x1221c4(0x126)]));const _0x1aa348=_0x1901d8[_0x1221c4(0x150)]||0xa,_0xba1e32=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x22f062[_0x1221c4(0x118)]['listRecursive'](_0x55aca5[_0x1221c4(0x12f)],_0x55aca5[_0x1221c4(0x126)],0x0,_0x1aa348),{'verbose':_0x1901d8[_0x1221c4(0x125)]}),_0x5c238f=_0xba1e32[_0x1221c4(0x11c)];console[_0x1221c4(0x141)](_0x1221c4(0x151)+_0x5c238f[_0x1221c4(0x11b)]+_0x1221c4(0x124));if(_0x1901d8[_0x1221c4(0x13d)]===_0x1221c4(0x146)||_0x1901d8['format']===_0x1221c4(0x12d))await handleSDKOutput(_0x5c238f,_0x1901d8);else{console[_0x1221c4(0x14c)](a29_0x37c102[_0x1221c4(0x128)]('[/'+_0x423b4c+']'));const _0x206be2=formatTree(_0x5c238f,{'showMetadata':!![]});console[_0x1221c4(0x14c)](_0x206be2);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a30_0x329060=a30_0x1a9a;(function(_0x246029,_0x264209){const _0xfd5708=a30_0x1a9a,_0x1da4e2=_0x246029();while(!![]){try{const _0x3152b0=parseInt(_0xfd5708(0xcd))/0x1+parseInt(_0xfd5708(0xbd))/0x2+-parseInt(_0xfd5708(0xdb))/0x3+-parseInt(_0xfd5708(0xc8))/0x4*(-parseInt(_0xfd5708(0xc0))/0x5)+parseInt(_0xfd5708(0xbe))/0x6+parseInt(_0xfd5708(0xe0))/0x7+-parseInt(_0xfd5708(0xd6))/0x8;if(_0x3152b0===_0x264209)break;else _0x1da4e2['push'](_0x1da4e2['shift']());}catch(_0xe0a0d7){_0x1da4e2['push'](_0x1da4e2['shift']());}}}(a30_0x2f58,0x9e675));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a30_0x1a9a(_0x3d8a5f,_0x446c6f){const _0x2f5886=a30_0x2f58();return a30_0x1a9a=function(_0x1a9aa3,_0x329cbc){_0x1a9aa3=_0x1a9aa3-0xba;let _0x4d5290=_0x2f5886[_0x1a9aa3];return _0x4d5290;},a30_0x1a9a(_0x3d8a5f,_0x446c6f);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a30_0x2f58(){const _0xb0bf45=['site','verbose','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','length','Error:\x20','Catalog:\x20','Database:\x20','\x20\x20Cause:\x20','15242096BlTIKz','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','data','description','Usage:\x20tdx\x20show\x20<database.table>','2339526eaKxzb','database','...','catalog','Site:\x20','6886103VHpIIQ','showTable','cause','\x20row','156180fifhFQ','312492OBJbUR','table','5251655QeZxoJ','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','args','Querying\x20','execute','message','error','4GROsUK','Show\x20table\x20contents','Table:\x20','\x20from\x20','show','1169693mSyEon'];a30_0x2f58=function(){return _0xb0bf45;};return a30_0x2f58();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a30_0x329060(0xcc);[a30_0x329060(0xd9)]=a30_0x329060(0xc9);async[a30_0x329060(0xc5)](_0x37d594){const _0x3dfeb6=a30_0x329060;return this[_0x3dfeb6(0xba)](_0x37d594);}async[a30_0x329060(0xba)](_0x272381){const _0x1c338f=a30_0x329060,{options:_0x4d58e6,args:_0x87965c,tdx:_0x20a0be}=_0x272381;let _0x55c32f;try{_0x55c32f=parseTableReference(_0x87965c[0x0]);const _0x3f7971=_0x4d58e6[_0x1c338f(0xdc)];!_0x55c32f[_0x1c338f(0xdc)]&&_0x3f7971&&(_0x55c32f[_0x1c338f(0xdc)]=_0x3f7971);const _0x4d4c60=validateTableDescribeReference(_0x55c32f);if(_0x4d4c60)return console['error'](_0x1c338f(0xd2)+_0x4d4c60),console['error'](_0x1c338f(0xda)),console[_0x1c338f(0xc7)](_0x1c338f(0xc1)),console[_0x1c338f(0xc7)](_0x1c338f(0xd7)),0x1;}catch(_0x662e46){return console[_0x1c338f(0xc7)](_0x1c338f(0xd2)+_0x662e46[_0x1c338f(0xc6)]),console[_0x1c338f(0xc7)](_0x1c338f(0xda)),console['error'](_0x1c338f(0xc1)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x5887b6=_0x55c32f[_0x1c338f(0xde)],_0x40c26d=_0x55c32f[_0x1c338f(0xdc)],_0x51292a=_0x55c32f[_0x1c338f(0xbf)],_0x3dfdd0=resolveLimit(_0x4d58e6['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x4d58e6['verbose']&&(console[_0x1c338f(0xc7)](_0x1c338f(0xdf)+_0x4d58e6[_0x1c338f(0xce)]),_0x5887b6&&console[_0x1c338f(0xc7)](_0x1c338f(0xd3)+_0x5887b6),console['error'](_0x1c338f(0xd4)+_0x40c26d),console[_0x1c338f(0xc7)](_0x1c338f(0xca)+_0x51292a),console[_0x1c338f(0xc7)]('Limit:\x20'+_0x3dfdd0));const _0x1f028a=_0x5887b6?_0x5887b6+'.'+_0x40c26d+'.'+_0x51292a:_0x40c26d+'.'+_0x51292a,_0x202e1d=await withSpinner(_0x1c338f(0xc4)+_0x1f028a+_0x1c338f(0xdd),()=>_0x20a0be[_0x1c338f(0xbf)][_0x1c338f(0xcc)](_0x40c26d,_0x51292a,_0x3dfdd0,_0x5887b6),{'verbose':_0x4d58e6[_0x1c338f(0xcf)]}),_0x2db84b=_0x202e1d['data'],_0x1fc87c=_0x2db84b[_0x1c338f(0xd8)];return _0x1fc87c['length']===0x0?console[_0x1c338f(0xc7)](_0x1c338f(0xc2)):console['error']('✔\x20Retrieved\x20'+_0x1fc87c[_0x1c338f(0xd1)]+_0x1c338f(0xbc)+(_0x1fc87c[_0x1c338f(0xd1)]!==0x1?'s':'')+_0x1c338f(0xcb)+_0x1f028a),await handleSDKOutput(_0x1fc87c,_0x4d58e6),0x0;}catch(_0x353d83){if(_0x353d83 instanceof SDKError)return console[_0x1c338f(0xc7)](_0x1c338f(0xd2)+_0x353d83['message']),_0x353d83[_0x1c338f(0xbb)]&&console[_0x1c338f(0xc7)](_0x1c338f(0xd5)+_0x353d83[_0x1c338f(0xbb)]),0x1;throw _0x353d83;}}['validate'](_0x25830e){const _0x4f3e54=a30_0x329060;if(_0x25830e[_0x4f3e54(0xc3)]['length']===0x0)return _0x4f3e54(0xd0);if(_0x25830e[_0x4f3e54(0xc3)][_0x4f3e54(0xd1)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a31_0x14e2(){const _0x28b904=['Table\x20pattern:\x20','List\x20tables\x20in\x20a\x20database','list','verbose','737944Qwubkk','site','Database\x20pattern:\x20','3036544XnGesU','error','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','message','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Cause:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','510129vuKBvK','26fAZCVJ','2179700yofsgr','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Use:\x20tdx\x20tables\x20\x22','5265090QLYCvY','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database\x20\x27','description','Listing\x20tables...','Note:\x20\x27','\x20table','execute','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','database','table','\x27\x20is\x20ambiguous.','1200318jhBKmQ','8gjQAkS','includes','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','length','Error:\x20Pattern\x20\x27','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','42017YuedDR','cause','name','data','Database:\x20all','36MRUKbf','validate','tables','✖\x20No\x20tables\x20found','Error:\x20'];a31_0x14e2=function(){return _0x28b904;};return a31_0x14e2();}const a31_0x2cad47=a31_0x199f;(function(_0x46bca6,_0x1a05dd){const _0x1a5212=a31_0x199f,_0xaec3cf=_0x46bca6();while(!![]){try{const _0x1c6a11=parseInt(_0x1a5212(0x204))/0x1*(parseInt(_0x1a5212(0x1ed))/0x2)+-parseInt(_0x1a5212(0x1ec))/0x3*(-parseInt(_0x1a5212(0x1fe))/0x4)+parseInt(_0x1a5212(0x1ee))/0x5+-parseInt(_0x1a5212(0x1fd))/0x6+-parseInt(_0x1a5212(0x1e5))/0x7+-parseInt(_0x1a5212(0x1e2))/0x8*(-parseInt(_0x1a5212(0x209))/0x9)+-parseInt(_0x1a5212(0x1f1))/0xa;if(_0x1c6a11===_0x1a05dd)break;else _0xaec3cf['push'](_0xaec3cf['shift']());}catch(_0x3fe4e1){_0xaec3cf['push'](_0xaec3cf['shift']());}}}(a31_0x14e2,0x819b1));import{BaseCommand}from'./command.js';function a31_0x199f(_0x56169a,_0x5504e3){const _0x14e256=a31_0x14e2();return a31_0x199f=function(_0x199f7d,_0x5d0693){_0x199f7d=_0x199f7d-0x1e1;let _0xb142ec=_0x14e256[_0x199f7d];return _0xb142ec;},a31_0x199f(_0x56169a,_0x5504e3);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a31_0x2cad47(0x206)]=a31_0x2cad47(0x20b);[a31_0x2cad47(0x1f4)]=a31_0x2cad47(0x20f);async[a31_0x2cad47(0x1f8)](_0x29c760){const _0x39bc29=a31_0x2cad47,{options:_0x6c48ff,args:_0x544aa7,tdx:_0x2fe04c}=_0x29c760;let _0x289ed4;if(_0x544aa7[_0x39bc29(0x201)]===0x0)_0x289ed4={'database':undefined,'table':undefined,'original':''};else{if(_0x544aa7[_0x39bc29(0x201)]===0x1)try{_0x289ed4=parseTableReference(_0x544aa7[0x0]);if(_0x289ed4[_0x39bc29(0x1fb)]&&!_0x289ed4[_0x39bc29(0x1fa)]&&!_0x289ed4[_0x39bc29(0x1fb)]['includes']('*')&&!_0x289ed4[_0x39bc29(0x1fb)][_0x39bc29(0x1ff)]('?'))return console[_0x39bc29(0x1e6)](_0x39bc29(0x202)+_0x544aa7[0x0]+_0x39bc29(0x1fc)),console[_0x39bc29(0x1e6)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x289ed4['table']+'\x27?'),console[_0x39bc29(0x1e6)](_0x39bc29(0x1f0)+_0x289ed4[_0x39bc29(0x1fb)]+'.*\x22'),console[_0x39bc29(0x1e6)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x289ed4[_0x39bc29(0x1fb)]),console[_0x39bc29(0x1e6)](_0x39bc29(0x1f9)+_0x289ed4[_0x39bc29(0x1fb)]),console[_0x39bc29(0x1e6)](''),console['error'](_0x39bc29(0x1f6)+_0x544aa7[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x289ed4[_0x39bc29(0x1fb)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x11b16e){return console[_0x39bc29(0x1e6)](_0x39bc29(0x20d)+_0x11b16e[_0x39bc29(0x1e8)]),0x1;}else return console[_0x39bc29(0x1e6)](_0x39bc29(0x1ef)),console[_0x39bc29(0x1e6)](_0x39bc29(0x1f2)),console[_0x39bc29(0x1e6)](_0x39bc29(0x200)),console['error'](_0x39bc29(0x1e7)),console[_0x39bc29(0x1e6)](_0x39bc29(0x1eb)),console[_0x39bc29(0x1e6)]('Or\x20use\x20--in\x20flag:'),console[_0x39bc29(0x1e6)](_0x39bc29(0x1e9)),0x1;}const _0x51d610=_0x6c48ff[_0x39bc29(0x1fa)];!_0x289ed4[_0x39bc29(0x1fa)]&&_0x51d610&&(_0x289ed4[_0x39bc29(0x1fa)]=_0x51d610);try{const _0x4b7acc=_0x5e55d8=>_0x5e55d8&&(_0x5e55d8[_0x39bc29(0x1ff)]('*')||_0x5e55d8[_0x39bc29(0x1ff)]('?')),_0x5bf206=_0x4b7acc(_0x289ed4[_0x39bc29(0x1fa)]);_0x6c48ff[_0x39bc29(0x1e1)]&&(console[_0x39bc29(0x1e6)]('Site:\x20'+_0x6c48ff[_0x39bc29(0x1e3)]),_0x289ed4['database']?_0x5bf206?console[_0x39bc29(0x1e6)](_0x39bc29(0x1e4)+_0x289ed4[_0x39bc29(0x1fa)]):console[_0x39bc29(0x1e6)]('Database:\x20'+_0x289ed4[_0x39bc29(0x1fa)]):console[_0x39bc29(0x1e6)](_0x39bc29(0x208)),_0x289ed4[_0x39bc29(0x1fb)]&&console[_0x39bc29(0x1e6)](_0x39bc29(0x20e)+_0x289ed4['table']));const _0x33c5c9=_0x289ed4[_0x39bc29(0x1fa)]&&!_0x5bf206?_0x289ed4[_0x39bc29(0x1fa)]:undefined,_0x175634=_0x5bf206?_0x289ed4[_0x39bc29(0x1fa)]:undefined,_0x5b424a=_0x289ed4[_0x39bc29(0x1fb)],_0xaf96f4=resolveLimit(_0x6c48ff['limit'],DEFAULT_LISTING_LIMIT),_0x2487ca=await withSpinner(_0x39bc29(0x1f5),()=>_0x2fe04c[_0x39bc29(0x1fb)][_0x39bc29(0x210)](_0x33c5c9,_0x5b424a,_0x175634,_0xaf96f4),{'verbose':_0x6c48ff['verbose']}),_0x24ab31=_0x2487ca[_0x39bc29(0x207)];if(_0x24ab31[_0x39bc29(0x201)]===0x0&&_0x289ed4[_0x39bc29(0x1fa)]&&!_0x5bf206)return console[_0x39bc29(0x1e6)](_0x39bc29(0x20c)),console[_0x39bc29(0x1e6)](_0x39bc29(0x1f3)+_0x289ed4[_0x39bc29(0x1fa)]+_0x39bc29(0x203)),0x1;return console['error']('✔\x20Found\x20'+_0x24ab31[_0x39bc29(0x201)]+_0x39bc29(0x1f7)+(_0x24ab31[_0x39bc29(0x201)]!==0x1?'s':'')),await handleSDKOutput(_0x24ab31,{..._0x6c48ff,'limit':_0xaf96f4}),0x0;}catch(_0x847bf4){if(_0x847bf4 instanceof SDKError)return console[_0x39bc29(0x1e6)](_0x39bc29(0x20d)+_0x847bf4[_0x39bc29(0x1e8)]),_0x847bf4['cause']&&console['error'](_0x39bc29(0x1ea)+_0x847bf4[_0x39bc29(0x205)]),0x1;throw _0x847bf4;}}[a31_0x2cad47(0x20a)](_0x38b65e){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x20d9f9=a32_0x58f8;(function(_0x4fc340,_0x537cbd){const _0x2df72b=a32_0x58f8,_0x4c1ffe=_0x4fc340();while(!![]){try{const _0x516e0b=parseInt(_0x2df72b(0x1ba))/0x1*(parseInt(_0x2df72b(0x1a9))/0x2)+parseInt(_0x2df72b(0x1bc))/0x3*(-parseInt(_0x2df72b(0x1b7))/0x4)+-parseInt(_0x2df72b(0x1c2))/0x5+-parseInt(_0x2df72b(0x1ad))/0x6+parseInt(_0x2df72b(0x1c4))/0x7*(parseInt(_0x2df72b(0x1b8))/0x8)+parseInt(_0x2df72b(0x1c5))/0x9+parseInt(_0x2df72b(0x1af))/0xa;if(_0x516e0b===_0x537cbd)break;else _0x4c1ffe['push'](_0x4c1ffe['shift']());}catch(_0x4ae72d){_0x4c1ffe['push'](_0x4c1ffe['shift']());}}}(a32_0x5e64,0xc3b7a));function a32_0x58f8(_0x3404ef,_0x5f24d6){const _0x5e648b=a32_0x5e64();return a32_0x58f8=function(_0x58f807,_0x2745e0){_0x58f807=_0x58f807-0x1a5;let _0x56151c=_0x5e648b[_0x58f807];return _0x56151c;},a32_0x58f8(_0x3404ef,_0x5f24d6);}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a32_0x5e64(){const _0x2fa10e=['1276636USjbBw','\x20(session:\x20','Set\x20session-level\x20context','profile','9005934XpGoXn','toString','19624070CKgtUd','log','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','Session\x20profile\x20set\x20to:\x20','parent_segment','Invalid\x20resource:\x20','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','description','618344YXKdoT','1613992BYCKDB','use','1pfIPsN','database','24MxqlJM','Session\x20database\x20set\x20to:\x20','includes','validate','Error:\x20','llm_project','237895ZcFYnJ','session','28jJgDLd','1612737wbNgwq','error','execute','length','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','\x27\x20does\x20not\x20exist'];a32_0x5e64=function(){return _0x2fa10e;};return a32_0x5e64();}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{['name']=a32_0x20d9f9(0x1b9);[a32_0x20d9f9(0x1b6)]=a32_0x20d9f9(0x1ab);[a32_0x20d9f9(0x1bf)](_0x1e0b67){const _0x298d15=a32_0x20d9f9,{args:_0x451551}=_0x1e0b67;if(_0x451551[_0x298d15(0x1a6)]<0x2)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x298d15(0x1b1)+'Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'+_0x298d15(0x1a7);const _0x3cbae7=_0x451551[0x0],_0x55b9fc=[_0x298d15(0x1bb),'parent_segment',_0x298d15(0x1c1),_0x298d15(0x1ac)];if(!_0x55b9fc[_0x298d15(0x1be)](_0x3cbae7))return _0x298d15(0x1b4)+_0x3cbae7+'.\x20Must\x20be\x20one\x20of:\x20'+_0x55b9fc['join'](',\x20');return undefined;}async[a32_0x20d9f9(0x1a5)](_0x14f97a){const _0x129b3b=a32_0x20d9f9,{args:_0x377fe6,options:_0x1ef1f8}=_0x14f97a;try{const _0x483aaf=_0x377fe6[0x0],_0x4f5599=_0x377fe6[0x1];if(_0x483aaf==='profile'){if(!profileExists(_0x4f5599))return console[_0x129b3b(0x1c6)]('Error:\x20Profile\x20\x27'+_0x4f5599+_0x129b3b(0x1a8)),console[_0x129b3b(0x1c6)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x4de5a6=_0x1ef1f8['session']||getCurrentSessionPID()[_0x129b3b(0x1ae)]();return saveSessionContext({'profile':_0x4f5599},_0x1ef1f8[_0x129b3b(0x1c3)]),console[_0x129b3b(0x1b0)](_0x129b3b(0x1b2)+_0x4f5599+'\x20(session:\x20'+_0x4de5a6+')'),console[_0x129b3b(0x1b0)](_0x129b3b(0x1b5)),0x0;}const _0x1bbc44={},_0x1d73ae=_0x1ef1f8['session']||getCurrentSessionPID()[_0x129b3b(0x1ae)]();switch(_0x483aaf){case'database':_0x1bbc44[_0x129b3b(0x1bb)]=_0x4f5599,console[_0x129b3b(0x1b0)](_0x129b3b(0x1bd)+_0x4f5599+_0x129b3b(0x1aa)+_0x1d73ae+')');break;case'parent_segment':_0x1bbc44[_0x129b3b(0x1b3)]=_0x4f5599,console[_0x129b3b(0x1b0)]('Session\x20parent_segment\x20set\x20to:\x20'+_0x4f5599+_0x129b3b(0x1aa)+_0x1d73ae+')');break;case _0x129b3b(0x1c1):_0x1bbc44['llm_project']=_0x4f5599,console[_0x129b3b(0x1b0)]('Session\x20llm_project\x20set\x20to:\x20'+_0x4f5599+'\x20(session:\x20'+_0x1d73ae+')');break;}return saveSessionContext(_0x1bbc44,_0x1ef1f8[_0x129b3b(0x1c3)]),console['log'](_0x129b3b(0x1b5)),0x0;}catch(_0x408bb3){return _0x408bb3 instanceof Error&&console[_0x129b3b(0x1c6)](_0x129b3b(0x1c0)+_0x408bb3['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x316af0=a32_0x5e8d;(function(_0x487ce0,_0x4fb9f9){const _0x4314a6=a32_0x5e8d,_0x4fbfe0=_0x487ce0();while(!![]){try{const _0xaac1dd=-parseInt(_0x4314a6(0xcd))/0x1+-parseInt(_0x4314a6(0x115))/0x2+-parseInt(_0x4314a6(0xc5))/0x3*(parseInt(_0x4314a6(0x103))/0x4)+-parseInt(_0x4314a6(0xba))/0x5+-parseInt(_0x4314a6(0xe6))/0x6+-parseInt(_0x4314a6(0x114))/0x7*(-parseInt(_0x4314a6(0x11c))/0x8)+-parseInt(_0x4314a6(0xbd))/0x9*(-parseInt(_0x4314a6(0xe8))/0xa);if(_0xaac1dd===_0x4fb9f9)break;else _0x4fbfe0['push'](_0x4fbfe0['shift']());}catch(_0x2e1678){_0x4fbfe0['push'](_0x4fbfe0['shift']());}}}(a32_0x7370,0xbf8ca));function a32_0x7370(){const _0x48ebef=['kill','\x20\x20Project\x20ID:\x20','attemptId','Task\x20name:\x20','data','3613800ePuWjU','Pushing\x20workflow\x20project...','\x20workflow','18HVQTIw','Show\x20specific\x20attempt\x20details','Cancelled','retryAttempt','attempt','stat','logs','\x20attempt','289353IFCtXN','...','Filter:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','verbose','workflow:download','Resume\x20from:\x20','\x20is\x20not\x20a\x20directory','1027229rBWNfK','params','fs/promises','✔\x20Found\x20','Project\x20directory:\x20','ies','Revision:\x20','workflow:retry','revision','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Retry\x20a\x20session\x20or\x20attempt','Error:\x20Attempt\x20ID\x20and\x20task\x20name\x20are\x20required','session:','attempts','cause','Usage:\x20workflow:delete\x20<project-name-or-id>','workflow:workflows','projectId','Params:\x20','parse','✔\x20Pushed\x20','Kill\x20a\x20running\x20attempt','Including\x20subtasks:\x20yes','description','workflows','1804086fzniul','Show\x20logs\x20for\x20a\x20specific\x20task','8320100qpEiLZ','Project\x20filter:\x20','workflow:delete','status','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Project:\x20','session','delete','Validation:\x20skipped','List\x20workflow\x20attempts','workflow:tasks','\x20\x20Session\x20ID:\x20','Reason:\x20','workflow:attempt','name','\x20\x20Revision:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20project','from','startsWith','Retrying\x20attempt...','workflow:projects','Project\x20name:\x20','Retrying\x20session...','Filter:\x20project=','sessionId','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','12dtuOrQ','Status:\x20','\x20log\x20entr','List\x20workflow\x20execution\x20sessions','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Downloading\x20project\x20','projects','skipValidation','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','yes','substring','limit','tasks','execute','download','retrySession','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','28532zQhPaW','21694TWVDpe','Error:\x20','\x20\x20Cause:\x20','resumeFrom','\x20\x20Location:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:attempts','2888qnXouj','error','message','Killing\x20attempt...','offset','List\x20workflows','Listing\x20workflow\x20projects...','includeSubtasks','\x20task','Getting\x20attempt\x20details...','force','\x20\x20Files\x20extracted:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow','List\x20all\x20workflow\x20projects','Error:\x20Attempt\x20ID\x20is\x20required','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','✔\x20Deleted\x20project\x20','split','Attempt\x20ID:\x20','length','projectName','✔\x20Retry\x20started','readFile'];a32_0x7370=function(){return _0x48ebef;};return a32_0x7370();}function a32_0x5e8d(_0x4307e2,_0xf7cf5){const _0x7370f2=a32_0x7370();return a32_0x5e8d=function(_0x5e8de7,_0x13b922){_0x5e8de7=_0x5e8de7-0xb3;let _0x41101b=_0x7370f2[_0x5e8de7];return _0x41101b;},a32_0x5e8d(_0x4307e2,_0xf7cf5);}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{confirm}from'../utils/prompt.js';export class WorkflowProjectsCommand extends BaseCommand{['name']=a32_0x316af0(0xfd);['description']=a32_0x316af0(0x12a);async[a32_0x316af0(0x110)](_0x2050ef){const _0x2cb9d5=a32_0x316af0,{options:_0x9e7b5b,args:_0x4311f8,tdx:_0x1fc6cc}=_0x2050ef,_0x5949bc=_0x4311f8[0x0];try{_0x9e7b5b[_0x2cb9d5(0xc9)]&&_0x5949bc&&console['error']('Pattern:\x20'+_0x5949bc);const _0x10bab1=await withSpinner(_0x2cb9d5(0x122),()=>_0x1fc6cc[_0x2cb9d5(0x129)][_0x2cb9d5(0x109)](_0x5949bc,{'limit':_0x9e7b5b[_0x2cb9d5(0x10e)]}),{'verbose':_0x9e7b5b[_0x2cb9d5(0xc9)]}),_0x405660=_0x10bab1[_0x2cb9d5(0xb9)];return console[_0x2cb9d5(0x11d)](_0x2cb9d5(0xd0)+_0x405660[_0x2cb9d5(0x130)]+_0x2cb9d5(0xf9)+(_0x405660['length']!==0x1?'s':'')),await handleSDKOutput(_0x405660,_0x9e7b5b),0x0;}catch(_0x58ac07){if(_0x58ac07 instanceof SDKError)return console[_0x2cb9d5(0x11d)](_0x2cb9d5(0x116)+_0x58ac07[_0x2cb9d5(0x11e)]),_0x58ac07['cause']&&console[_0x2cb9d5(0x11d)]('\x20\x20Cause:\x20'+_0x58ac07[_0x2cb9d5(0xdb)]),0x1;throw _0x58ac07;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xdd);[a32_0x316af0(0xe4)]=a32_0x316af0(0x121);async['execute'](_0x101d43){const _0x471b83=a32_0x316af0,{options:_0xd34849,args:_0x10b2c4,tdx:_0xfa0d55}=_0x101d43,_0x3fcc7e=_0x10b2c4[0x0];try{_0xd34849[_0x471b83(0xc9)]&&_0x3fcc7e&&console[_0x471b83(0x11d)](_0x471b83(0xe9)+_0x3fcc7e);const _0x469066=await withSpinner('Listing\x20workflows...',()=>_0xfa0d55[_0x471b83(0x129)][_0x471b83(0xe5)](_0x3fcc7e,{'limit':_0xd34849[_0x471b83(0x10e)]}),{'verbose':_0xd34849['verbose']}),_0x20af73=_0x469066[_0x471b83(0xb9)];return console[_0x471b83(0x11d)](_0x471b83(0xd0)+_0x20af73[_0x471b83(0x130)]+_0x471b83(0xbc)+(_0x20af73[_0x471b83(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x20af73,_0xd34849),0x0;}catch(_0x3b170b){if(_0x3b170b instanceof SDKError)return console['error'](_0x471b83(0x116)+_0x3b170b['message']),_0x3b170b[_0x471b83(0xdb)]&&console[_0x471b83(0x11d)](_0x471b83(0x117)+_0x3b170b[_0x471b83(0xdb)]),0x1;throw _0x3b170b;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']='workflow:sessions';[a32_0x316af0(0xe4)]=a32_0x316af0(0x106);async[a32_0x316af0(0x110)](_0x5eb038){const _0x5a4e6e=a32_0x316af0,{options:_0x3064de,args:_0x2e00e0,tdx:_0x4845a7}=_0x5eb038;let _0x5708fe,_0xbc4cda;if(_0x2e00e0[0x0]){const _0x13017d=_0x2e00e0[0x0]['split']('.');if(_0x13017d[_0x5a4e6e(0x130)]===0x1)_0x5708fe=_0x13017d[0x0];else{if(_0x13017d[_0x5a4e6e(0x130)]===0x2)[_0x5708fe,_0xbc4cda]=_0x13017d;else return console[_0x5a4e6e(0x11d)](_0x5a4e6e(0x10b)),0x1;}}try{if(_0x3064de[_0x5a4e6e(0xc9)]){if(_0x5708fe&&_0xbc4cda)console['error']('Filter:\x20'+_0x5708fe+'.'+_0xbc4cda);else _0x5708fe&&console['error']('Filter:\x20project='+_0x5708fe);const _0x45c159=_0x3064de[_0x5a4e6e(0xeb)];_0x45c159&&console[_0x5a4e6e(0x11d)](_0x5a4e6e(0x104)+_0x45c159);}const _0x24caa5=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x4845a7['workflow']['sessions']({'projectName':_0x5708fe,'workflowName':_0xbc4cda,'status':_0x3064de['status'],'fromTime':_0x3064de[_0x5a4e6e(0xfa)],'toTime':_0x3064de['to'],'limit':_0x3064de['limit']}),{'verbose':_0x3064de[_0x5a4e6e(0xc9)]}),_0x3c6573=_0x24caa5[_0x5a4e6e(0xb9)];return console[_0x5a4e6e(0x11d)]('✔\x20Found\x20'+_0x3c6573[_0x5a4e6e(0x130)]+'\x20session'+(_0x3c6573[_0x5a4e6e(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x3c6573,_0x3064de),0x0;}catch(_0x3c161e){if(_0x3c161e instanceof SDKError)return console['error'](_0x5a4e6e(0x116)+_0x3c161e[_0x5a4e6e(0x11e)]),_0x3c161e['cause']&&console[_0x5a4e6e(0x11d)](_0x5a4e6e(0x117)+_0x3c161e['cause']),0x1;throw _0x3c161e;}}}export class WorkflowAttemptsCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0x11b);['description']=a32_0x316af0(0xf1);async[a32_0x316af0(0x110)](_0x4975b0){const _0x4e12ab=a32_0x316af0,{options:_0x5b60be,args:_0x405dc1,tdx:_0x7af3e3}=_0x4975b0;let _0xda83ab,_0x3af5d5;if(_0x405dc1[0x0]){const _0x578853=_0x405dc1[0x0][_0x4e12ab(0x12e)]('.');if(_0x578853[_0x4e12ab(0x130)]===0x1)_0xda83ab=_0x578853[0x0];else{if(_0x578853[_0x4e12ab(0x130)]===0x2)[_0xda83ab,_0x3af5d5]=_0x578853;else return console[_0x4e12ab(0x11d)](_0x4e12ab(0x10b)),0x1;}}try{const _0x2cf557=_0x5b60be['includeRetried'];if(_0x5b60be[_0x4e12ab(0xc9)]){if(_0xda83ab&&_0x3af5d5)console[_0x4e12ab(0x11d)](_0x4e12ab(0xc7)+_0xda83ab+'.'+_0x3af5d5);else _0xda83ab&&console[_0x4e12ab(0x11d)](_0x4e12ab(0x100)+_0xda83ab);_0x2cf557&&console[_0x4e12ab(0x11d)]('Include\x20retried:\x20yes');}const _0x33c63b=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x7af3e3[_0x4e12ab(0x129)][_0x4e12ab(0xda)]({'projectName':_0xda83ab,'workflowName':_0x3af5d5,'includeRetried':_0x2cf557,'limit':_0x5b60be[_0x4e12ab(0x10e)]}),{'verbose':_0x5b60be[_0x4e12ab(0xc9)]}),_0x421868=_0x33c63b[_0x4e12ab(0xb9)];return console[_0x4e12ab(0x11d)](_0x4e12ab(0xd0)+_0x421868[_0x4e12ab(0x130)]+_0x4e12ab(0xc4)+(_0x421868[_0x4e12ab(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x421868,_0x5b60be),0x0;}catch(_0x4712de){if(_0x4712de instanceof SDKError)return console[_0x4e12ab(0x11d)](_0x4e12ab(0x116)+_0x4712de[_0x4e12ab(0x11e)]),_0x4712de['cause']&&console[_0x4e12ab(0x11d)](_0x4e12ab(0x117)+_0x4712de[_0x4e12ab(0xdb)]),0x1;throw _0x4712de;}}}export class WorkflowAttemptCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xf5);[a32_0x316af0(0xe4)]=a32_0x316af0(0xbe);async['execute'](_0x5e4335){const _0x28a989=a32_0x316af0,{options:_0x3253bb,args:_0x52905d,tdx:_0x363fb0}=_0x5e4335,_0xeba356=_0x52905d[0x0];if(!_0xeba356)return console[_0x28a989(0x11d)](_0x28a989(0x12b)),0x1;try{_0x3253bb[_0x28a989(0xc9)]&&console[_0x28a989(0x11d)](_0x28a989(0x12f)+_0xeba356);const _0x49b039=await withSpinner(_0x28a989(0x125),()=>_0x363fb0[_0x28a989(0x129)][_0x28a989(0xc1)](_0xeba356),{'verbose':_0x3253bb[_0x28a989(0xc9)]}),_0x501bdc=_0x49b039[_0x28a989(0xb9)];return await handleSDKOutput([_0x501bdc],_0x3253bb),0x0;}catch(_0xecf5e1){if(_0xecf5e1 instanceof SDKError)return console['error']('Error:\x20'+_0xecf5e1[_0x28a989(0x11e)]),_0xecf5e1[_0x28a989(0xdb)]&&console[_0x28a989(0x11d)]('\x20\x20Cause:\x20'+_0xecf5e1[_0x28a989(0xdb)]),0x1;throw _0xecf5e1;}}}export class WorkflowTasksCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xf2);['description']='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x6cd323){const _0x2f41ac=a32_0x316af0,{options:_0x219a11,args:_0x227378,tdx:_0x46ba0c}=_0x6cd323,_0x3ecaf6=_0x227378[0x0];if(!_0x3ecaf6)return console['error'](_0x2f41ac(0x12b)),0x1;try{const _0x2444b7=_0x219a11[_0x2f41ac(0x123)];_0x219a11[_0x2f41ac(0xc9)]&&(console[_0x2f41ac(0x11d)](_0x2f41ac(0x12f)+_0x3ecaf6),_0x2444b7&&console['error'](_0x2f41ac(0xe3)));const _0x5109ef=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x46ba0c[_0x2f41ac(0x129)][_0x2f41ac(0x10f)](_0x3ecaf6,_0x2444b7||![]),{'verbose':_0x219a11[_0x2f41ac(0xc9)]}),_0x29e1da=_0x5109ef[_0x2f41ac(0xb9)];return console[_0x2f41ac(0x11d)](_0x2f41ac(0xd0)+_0x29e1da['length']+_0x2f41ac(0x124)+(_0x29e1da[_0x2f41ac(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x29e1da,_0x219a11),0x0;}catch(_0x359216){if(_0x359216 instanceof SDKError)return console[_0x2f41ac(0x11d)](_0x2f41ac(0x116)+_0x359216[_0x2f41ac(0x11e)]),_0x359216[_0x2f41ac(0xdb)]&&console[_0x2f41ac(0x11d)]('\x20\x20Cause:\x20'+_0x359216[_0x2f41ac(0xdb)]),0x1;throw _0x359216;}}}export class WorkflowLogsCommand extends BaseCommand{[a32_0x316af0(0xf6)]='workflow:logs';[a32_0x316af0(0xe4)]=a32_0x316af0(0xe7);async[a32_0x316af0(0x110)](_0x1bf65b){const _0x47cf21=a32_0x316af0,{options:_0x5785c2,args:_0x2d107d,tdx:_0x4276c2}=_0x1bf65b,_0x22bd08=_0x2d107d[0x0],_0x3685df=_0x2d107d[0x1];if(!_0x22bd08||!_0x3685df)return console[_0x47cf21(0x11d)](_0x47cf21(0xd8)),0x1;try{_0x5785c2[_0x47cf21(0xc9)]&&(console[_0x47cf21(0x11d)](_0x47cf21(0x12f)+_0x22bd08),console[_0x47cf21(0x11d)](_0x47cf21(0xb8)+_0x3685df));const _0xea347=_0x5785c2[_0x47cf21(0x120)],_0x5348c2=await withSpinner('Getting\x20task\x20logs...',()=>_0x4276c2['workflow'][_0x47cf21(0xc3)](_0x22bd08,_0x3685df,{'offset':_0xea347,'limit':_0x5785c2[_0x47cf21(0x10e)]}),{'verbose':_0x5785c2[_0x47cf21(0xc9)]}),_0x44aabb=_0x5348c2['data'];return console[_0x47cf21(0x11d)]('✔\x20Found\x20'+_0x44aabb[_0x47cf21(0x130)]+_0x47cf21(0x105)+(_0x44aabb[_0x47cf21(0x130)]!==0x1?_0x47cf21(0xd2):'y')),await handleSDKOutput(_0x44aabb,_0x5785c2),0x0;}catch(_0x3fbc23){if(_0x3fbc23 instanceof SDKError)return console[_0x47cf21(0x11d)](_0x47cf21(0x116)+_0x3fbc23[_0x47cf21(0x11e)]),_0x3fbc23[_0x47cf21(0xdb)]&&console[_0x47cf21(0x11d)](_0x47cf21(0x117)+_0x3fbc23['cause']),0x1;throw _0x3fbc23;}}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a32_0x316af0(0xe4)]=a32_0x316af0(0xe2);async[a32_0x316af0(0x110)](_0x6d8a6b){const _0x3eef29=a32_0x316af0,{options:_0x3eb46f,args:_0x158a21,tdx:_0x3a30ea}=_0x6d8a6b,_0x484f1a=_0x158a21[0x0];if(!_0x484f1a)return console[_0x3eef29(0x11d)](_0x3eef29(0x12b)),0x1;try{const _0x42ef9e=_0x3eb46f['reason'];_0x3eb46f['verbose']&&(console[_0x3eef29(0x11d)](_0x3eef29(0x12f)+_0x484f1a),_0x42ef9e&&console[_0x3eef29(0x11d)](_0x3eef29(0xf4)+_0x42ef9e));if(!_0x3eb46f[_0x3eef29(0x10c)]){const _0x475f5b=await confirm(_0x3eef29(0xec)+_0x484f1a+'?');if(!_0x475f5b)return console[_0x3eef29(0x11d)](_0x3eef29(0xbf)),0x0;}const _0x5284e2=await withSpinner(_0x3eef29(0x11f),()=>_0x3a30ea[_0x3eef29(0x129)][_0x3eef29(0xb5)](_0x484f1a,_0x42ef9e),{'verbose':_0x3eb46f['verbose']}),_0x142ce8=_0x5284e2[_0x3eef29(0xb9)];return console[_0x3eef29(0x11d)]('✔\x20'+_0x142ce8),0x0;}catch(_0x1a5a68){if(_0x1a5a68 instanceof SDKError)return console['error'](_0x3eef29(0x116)+_0x1a5a68['message']),_0x1a5a68['cause']&&console[_0x3eef29(0x11d)](_0x3eef29(0x117)+_0x1a5a68[_0x3eef29(0xdb)]),0x1;throw _0x1a5a68;}}}export class WorkflowRetryCommand extends BaseCommand{['name']=a32_0x316af0(0xd4);[a32_0x316af0(0xe4)]=a32_0x316af0(0xd7);async[a32_0x316af0(0x110)](_0x12a087){const _0x1f3a5d=a32_0x316af0,{options:_0x561ac2,args:_0x28a179,tdx:_0x141174}=_0x12a087,_0x510fc7=_0x28a179[0x0];if(!_0x510fc7)return console[_0x1f3a5d(0x11d)](_0x1f3a5d(0x113)),console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xd6)),0x1;let _0xff224d=![],_0x3d9552=_0x510fc7;if(_0x510fc7[_0x1f3a5d(0xfb)](_0x1f3a5d(0xd9)))_0xff224d=!![],_0x3d9552=_0x510fc7[_0x1f3a5d(0x10d)](0x8);else{if(_0x510fc7[_0x1f3a5d(0xfb)]('attempt:'))_0xff224d=![],_0x3d9552=_0x510fc7[_0x1f3a5d(0x10d)](0x8);else return console[_0x1f3a5d(0x11d)](_0x1f3a5d(0x107)),console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xd6)),0x1;}try{const _0x588993=_0x561ac2['fromTask'],_0x355a46=_0x561ac2[_0x1f3a5d(0x118)],_0x29d00c=_0x561ac2[_0x1f3a5d(0xce)],_0x352448=_0x561ac2[_0x1f3a5d(0x126)];_0x561ac2[_0x1f3a5d(0xc9)]&&(console[_0x1f3a5d(0x11d)]('Target:\x20'+(_0xff224d?_0x1f3a5d(0xee):_0x1f3a5d(0xc1))+'\x20'+_0x3d9552),_0x588993&&console[_0x1f3a5d(0x11d)]('From\x20task:\x20'+_0x588993),_0x355a46&&console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xcb)+_0x355a46),_0x29d00c&&console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xdf)+_0x29d00c),_0x352448&&console[_0x1f3a5d(0x11d)]('Force:\x20yes'));let _0xe0aa4f;if(_0x29d00c)try{if(_0x29d00c[_0x1f3a5d(0xfb)]('@')){const _0x1354f2=await import(_0x1f3a5d(0xcf)),_0x76531f=_0x29d00c[_0x1f3a5d(0x10d)](0x1),_0x35b42e=await _0x1354f2[_0x1f3a5d(0xb4)](_0x76531f,'utf-8');_0xe0aa4f=JSON[_0x1f3a5d(0xe0)](_0x35b42e);}else _0xe0aa4f=JSON[_0x1f3a5d(0xe0)](_0x29d00c);}catch{return console[_0x1f3a5d(0x11d)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x561ac2[_0x1f3a5d(0x10c)]){const _0x1f0940=await confirm(_0x1f3a5d(0x11a)+(_0xff224d?'session':_0x1f3a5d(0xc1))+'\x20'+_0x3d9552+'?');if(!_0x1f0940)return console[_0x1f3a5d(0x11d)]('Cancelled'),0x0;}let _0x46759f;_0xff224d?_0x46759f=await withSpinner(_0x1f3a5d(0xff),()=>_0x141174['workflow'][_0x1f3a5d(0x112)](_0x3d9552,{'fromTask':_0x588993,'retryParams':_0xe0aa4f}),{'verbose':_0x561ac2[_0x1f3a5d(0xc9)]}):_0x46759f=await withSpinner(_0x1f3a5d(0xfc),()=>_0x141174[_0x1f3a5d(0x129)][_0x1f3a5d(0xc0)](_0x3d9552,{'resumeFrom':_0x355a46,'retryParams':_0xe0aa4f,'force':_0x352448}),{'verbose':_0x561ac2['verbose']});const _0x6b1251=_0x46759f[_0x1f3a5d(0xb9)];return console['error'](_0x1f3a5d(0xb3)),console[_0x1f3a5d(0x11d)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x6b1251[_0x1f3a5d(0xb7)]),console[_0x1f3a5d(0x11d)](_0x1f3a5d(0xf3)+_0x6b1251[_0x1f3a5d(0x101)]),0x0;}catch(_0x5f11c1){if(_0x5f11c1 instanceof SDKError)return console['error'](_0x1f3a5d(0x116)+_0x5f11c1['message']),_0x5f11c1[_0x1f3a5d(0xdb)]&&console[_0x1f3a5d(0x11d)]('\x20\x20Cause:\x20'+_0x5f11c1[_0x1f3a5d(0xdb)]),0x1;throw _0x5f11c1;}}}export class WorkflowDownloadCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xca);[a32_0x316af0(0xe4)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a32_0x316af0(0x110)](_0x2ad1fc){const _0x561784=a32_0x316af0,{options:_0x553a3a,args:_0x41c8d5,tdx:_0x22586e}=_0x2ad1fc,_0x3610bb=_0x41c8d5[0x0],_0x344ade=_0x41c8d5[0x1]||'.';if(!_0x3610bb)return console[_0x561784(0x11d)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x561784(0x11d)](_0x561784(0xf8)),0x1;const _0x4adef5=_0x553a3a[_0x561784(0xd5)];_0x553a3a[_0x561784(0xc9)]&&(console[_0x561784(0x11d)](_0x561784(0xed)+_0x3610bb),console[_0x561784(0x11d)]('Output\x20directory:\x20'+_0x344ade),_0x4adef5&&console[_0x561784(0x11d)](_0x561784(0xd3)+_0x4adef5));const _0x3236ca=await withSpinner(_0x561784(0x108)+_0x3610bb+_0x561784(0xc6),()=>_0x22586e[_0x561784(0x129)][_0x561784(0x111)](_0x3610bb,_0x344ade,{'revision':_0x4adef5}),{'verbose':_0x553a3a['verbose']}),_0x28f603=_0x3236ca[_0x561784(0xb9)];return console['error']('✔\x20Downloaded\x20'+_0x28f603['projectName']),console[_0x561784(0x11d)](_0x561784(0xf7)+_0x28f603['revision']),console[_0x561784(0x11d)](_0x561784(0x127)+_0x28f603['filesExtracted']),console[_0x561784(0x11d)](_0x561784(0x119)+_0x344ade+'/'+_0x28f603['projectName']),0x0;}}export class WorkflowPushCommand extends BaseCommand{['name']='workflow:push';['description']=a32_0x316af0(0x102);async[a32_0x316af0(0x110)](_0x4761d8){const _0x4934ba=a32_0x316af0,{options:_0x1f3569,args:_0x95ae3e,tdx:_0x21a692}=_0x4761d8;let _0x132ee7='.',_0x5681f4=_0x1f3569[_0x4934ba(0xf6)];if(_0x95ae3e[0x0]){const {promises:_0x1bb73e}=await import('fs');try{const _0x499c32=await _0x1bb73e[_0x4934ba(0xc2)](_0x95ae3e[0x0]);if(_0x499c32['isDirectory']())_0x132ee7=_0x95ae3e[0x0];else return console[_0x4934ba(0x11d)](_0x4934ba(0x116)+_0x95ae3e[0x0]+_0x4934ba(0xcc)),0x1;}catch{_0x5681f4=_0x95ae3e[0x0],_0x132ee7='.';}}const _0x10c58e=_0x1f3569[_0x4934ba(0xd5)],_0x17fcf2=_0x1f3569[_0x4934ba(0x10a)];_0x1f3569['verbose']&&(console[_0x4934ba(0x11d)](_0x4934ba(0xd1)+_0x132ee7),_0x5681f4&&console[_0x4934ba(0x11d)](_0x4934ba(0xfe)+_0x5681f4),_0x10c58e&&console['error'](_0x4934ba(0xd3)+_0x10c58e),_0x17fcf2&&console[_0x4934ba(0x11d)](_0x4934ba(0xf0)));const _0x7e07d7=await withSpinner(_0x4934ba(0xbb),()=>_0x21a692[_0x4934ba(0x129)]['push'](_0x132ee7,{'projectName':_0x5681f4,'revision':_0x10c58e,'skipValidation':_0x17fcf2}),{'verbose':_0x1f3569[_0x4934ba(0xc9)]}),_0x16e0c0=_0x7e07d7[_0x4934ba(0xb9)];return console[_0x4934ba(0x11d)](_0x4934ba(0xe1)+_0x16e0c0[_0x4934ba(0x131)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x16e0c0[_0x4934ba(0xde)]),console[_0x4934ba(0x11d)](_0x4934ba(0xf7)+_0x16e0c0['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a32_0x316af0(0xf6)]=a32_0x316af0(0xea);[a32_0x316af0(0xe4)]=a32_0x316af0(0x128);async[a32_0x316af0(0x110)](_0x3ded61){const _0x1371ee=a32_0x316af0,{options:_0x2db1e6,args:_0x922e79,tdx:_0x4e525d}=_0x3ded61,_0x1c4856=_0x922e79[0x0];if(!_0x1c4856)return console['error'](_0x1371ee(0x12c)),console[_0x1371ee(0x11d)](_0x1371ee(0xdc)),0x1;_0x2db1e6['verbose']&&console[_0x1371ee(0x11d)](_0x1371ee(0xed)+_0x1c4856);if(!_0x2db1e6[_0x1371ee(0x10c)]){const _0x5e359f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x1c4856+_0x1371ee(0xc8));if(!_0x5e359f)return console['error'](_0x1371ee(0xbf)),0x0;}const _0x48278e=await withSpinner('Deleting\x20project\x20'+_0x1c4856+_0x1371ee(0xc6),()=>_0x4e525d[_0x1371ee(0x129)][_0x1371ee(0xef)](_0x1c4856),{'verbose':_0x2db1e6[_0x1371ee(0xc9)]}),_0x3ecaba=_0x48278e[_0x1371ee(0xb9)];return console[_0x1371ee(0x11d)](_0x1371ee(0x12d)+_0x3ecaba[_0x1371ee(0x131)]),console[_0x1371ee(0x11d)](_0x1371ee(0xb6)+_0x3ecaba[_0x1371ee(0xde)]),0x0;}}
|
|
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;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a34_0x3fca(_0xed9cc0,_0x25c066){const _0x4f3f68=a34_0x4f3f();return a34_0x3fca=function(_0x3fcadf,_0x32b737){_0x3fcadf=_0x3fcadf-0x72;let _0x1c9073=_0x4f3f68[_0x3fcadf];return _0x1c9073;},a34_0x3fca(_0xed9cc0,_0x25c066);}(function(_0x4dc628,_0x354f60){const _0x5e4c66=a34_0x3fca,_0x243b49=_0x4dc628();while(!![]){try{const _0x3c4d25=parseInt(_0x5e4c66(0x84))/0x1*(-parseInt(_0x5e4c66(0x88))/0x2)+-parseInt(_0x5e4c66(0x80))/0x3+parseInt(_0x5e4c66(0x76))/0x4*(parseInt(_0x5e4c66(0x7d))/0x5)+parseInt(_0x5e4c66(0x74))/0x6+-parseInt(_0x5e4c66(0x82))/0x7+-parseInt(_0x5e4c66(0x7f))/0x8+parseInt(_0x5e4c66(0x86))/0x9;if(_0x3c4d25===_0x354f60)break;else _0x243b49['push'](_0x243b49['shift']());}catch(_0x5ed7cc){_0x243b49['push'](_0x243b49['shift']());}}}(a34_0x4f3f,0x4a0f6));import{platform}from'os';import{readFileSync}from'fs';import{fileURLToPath}from'url';function a34_0x4f3f(){const _0x318ca8=['1237236ebJiVk','version','12884kDSgNp','../../package.json','0.0.0','Authorization','length','entries','X-Trino-User','85EUGryx','url','1682488UEeDIs','405717GqNYWq','utf-8','2009427NYyaCq','parse','827jlFDsL','tdx','6767181qKEUzt',';\x20node/','186oLvXSM','tdx/','replace'];a34_0x4f3f=function(){return _0x318ca8;};return a34_0x4f3f();}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x373fed=a34_0x3fca;try{const _0xf6f14a=fileURLToPath(import.meta[_0x373fed(0x7e)]),_0x5c45d9=dirname(_0xf6f14a),_0x4df957=join(_0x5c45d9,_0x373fed(0x77)),_0x35d07=JSON[_0x373fed(0x83)](readFileSync(_0x4df957,_0x373fed(0x81)));return _0x35d07[_0x373fed(0x75)];}catch{return _0x373fed(0x78);}}export function getUserAgent(){const _0x342f8e=a34_0x3fca,_0x4b900c=getVersion(),_0x502c41=platform(),_0x222f88=process['version'][_0x342f8e(0x73)]('v','');return _0x342f8e(0x72)+_0x4b900c+'\x20('+_0x502c41+_0x342f8e(0x87)+_0x222f88+')';}export function getAuthHeaders(_0x76fdf5,_0x80b28f){const _0x363c3e=a34_0x3fca,_0x5349e3=getVersion(),_0x5d7c62={'User-Agent':getUserAgent(),'X-TD-Client':_0x363c3e(0x85),'X-TD-Client-Version':_0x5349e3};return _0x80b28f&&(_0x5d7c62[_0x363c3e(0x79)]='TD1\x20'+_0x80b28f),_0x5d7c62;}export function toHeaderRecord(_0x4672ec){const _0x371b08=a34_0x3fca,_0x3af670={};for(const [_0x2ec033,_0x41f31d]of Object[_0x371b08(0x7b)](_0x4672ec)){_0x41f31d!==undefined&&(_0x3af670[_0x2ec033]=_0x41f31d);}return _0x3af670;}export function getTrinoHeaders(_0x144f80,_0x2c9bb4){const _0x5ca159=a34_0x3fca,_0x48b867=getAuthHeaders(_0x144f80,_0x2c9bb4),_0x11a8c7=toHeaderRecord(_0x48b867);return delete _0x11a8c7[_0x5ca159(0x79)],_0x2c9bb4&&(_0x11a8c7[_0x5ca159(0x7c)]=_0x2c9bb4),_0x11a8c7;}export function hasAPIKey(_0x47027c){const _0x4936d0=a34_0x3fca,_0x315160=getAPIKey(_0x47027c);return _0x315160!==undefined&&_0x315160[_0x4936d0(0x7a)]>0x0;}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export declare function getConfigDir(): string;
|
|
|
16
16
|
* Get the user config file path
|
|
17
17
|
*/
|
|
18
18
|
export declare function getConfigFile(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Get the config file path (global or profile-specific)
|
|
21
|
+
*
|
|
22
|
+
* @param profileName - Optional profile name
|
|
23
|
+
* @returns Path to .env file (global) or .env.{profile} (profile-specific)
|
|
24
|
+
*/
|
|
25
|
+
export declare function getConfigFilePath(profileName?: string): string;
|
|
19
26
|
/**
|
|
20
27
|
* Get the user cache directory path
|
|
21
28
|
* Uses TDX_CACHE_DIR environment variable if set (for testing)
|
|
@@ -79,9 +86,13 @@ export declare function getAPIKey(site: TDSite, profileName?: string): string |
|
|
|
79
86
|
*/
|
|
80
87
|
export declare function getAPIKeySource(site: TDSite, profileName?: string): string | null;
|
|
81
88
|
/**
|
|
82
|
-
* Save API key to user config file
|
|
89
|
+
* Save API key to user config file (global or profile-specific)
|
|
90
|
+
*
|
|
91
|
+
* @param site - TD site
|
|
92
|
+
* @param apiKey - API key to save
|
|
93
|
+
* @param profileName - Optional profile name. If provided, saves to .env.{profile} instead of .env
|
|
83
94
|
*/
|
|
84
|
-
export declare function saveAPIKey(site: TDSite, apiKey: string): void;
|
|
95
|
+
export declare function saveAPIKey(site: TDSite, apiKey: string, profileName?: string): void;
|
|
85
96
|
/**
|
|
86
97
|
* Load complete configuration
|
|
87
98
|
*/
|