@treasuredata/tdx 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.d.ts +17 -1
- package/dist/client/workflow-client.d.ts.map +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/client/workflow-client.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +9 -1
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/workflow.d.ts +52 -16
- package/dist/sdk/workflow.d.ts.map +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/sdk/workflow.js.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/workflow.d.ts +49 -0
- package/dist/types/workflow.d.ts.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.d.ts.map +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/command-output.js.map +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a19_0x3d76a0=a19_0x41e1;(function(_0x40a4fa,_0x11a754){const _0x21cc18=a19_0x41e1,_0x356b84=_0x40a4fa();while(!![]){try{const _0x3bc0e3=parseInt(_0x21cc18(0x15b))/0x1*(parseInt(_0x21cc18(0x167))/0x2)+-parseInt(_0x21cc18(0x178))/0x3*(parseInt(_0x21cc18(0x14a))/0x4)+-parseInt(_0x21cc18(0x165))/0x5+-parseInt(_0x21cc18(0x156))/0x6*(-parseInt(_0x21cc18(0x170))/0x7)+-parseInt(_0x21cc18(0x145))/0x8+-parseInt(_0x21cc18(0x14e))/0x9+parseInt(_0x21cc18(0x17f))/0xa;if(_0x3bc0e3===_0x11a754)break;else _0x356b84['push'](_0x356b84['shift']());}catch(_0x1f7319){_0x356b84['push'](_0x356b84['shift']());}}}(a19_0x2597,0x41af1));import a19_0x4c6413 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';function a19_0x41e1(_0x595a5c,_0x4a7d75){const _0x2597d5=a19_0x2597();return a19_0x41e1=function(_0x41e1b1,_0x1e4414){_0x41e1b1=_0x41e1b1-0x142;let _0x5c1b26=_0x2597d5[_0x41e1b1];return _0x5c1b26;},a19_0x41e1(_0x595a5c,_0x4a7d75);}import{TDXLogger}from'../utils/tdx-logger.js';function a19_0x2597(){const _0x5e730b=['project','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','execute','cyan','stop','white','\x20\x20Address:','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','1826680AclmMv','Server\x20Configuration:','4aBmVZl','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','logLevel','\x27\x20not\x20found','dim','port','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','✓\x20Proxy\x20server\x20stopped','48839rQqLOe','\x20\x20\x20\x20}','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','Project\x20\x27','log','yellow','\x0aClaude\x20Code\x20Configuration:','bold','688791BONYeK','\x20\x20Project:','\x20\x20Site:','llm','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','find','http://0.0.0.0:','12950380hXZnbg','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','llmProject','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','name','\x20\x20}','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','server','start','3676544xUDjWy','projects','logger','SIGINT','green','4rfyqai','Resolving\x20project...','\x20\x20{','getOrCreateDefaultProject','1107612gZKpRY','attributes','Port\x20','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','created\x20on-demand\x20per\x20model','\x20\x20Agents:','\x20is\x20unavailable,\x20using\x20port\x20','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','84QeStZX','site','NOT_FOUND','description','close','26947dnJwEC','SIGTERM'];a19_0x2597=function(){return _0x5e730b;};return a19_0x2597();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x81d6ff,_0x25de78){const _0x7abaa=a19_0x41e1,{tdx:_0x3705b0,options:_0xb8b70c}=_0x81d6ff,_0x463b2f=_0x25de78||_0xb8b70c[_0x7abaa(0x181)];if(_0x463b2f){const _0x2f9ae1=await _0x3705b0[_0x7abaa(0x17b)][_0x7abaa(0x146)](),_0x5ea192=_0x2f9ae1['find'](_0x4617bb=>_0x4617bb[_0x7abaa(0x14f)]['name']===_0x463b2f);if(!_0x5ea192)throw new SDKError(ErrorCode[_0x7abaa(0x158)],_0x7abaa(0x173)+_0x463b2f+_0x7abaa(0x16b),undefined,{'helpText':_0x7abaa(0x17c)});return _0x5ea192['id'];}const _0x47cab7=await _0x3705b0[_0x7abaa(0x17b)][_0x7abaa(0x14d)]();return _0x47cab7['id'];}export class LLMProxyCommand extends BaseCommand{['name']='llm:proxy';[a19_0x3d76a0(0x159)]=a19_0x3d76a0(0x142);[a19_0x3d76a0(0x143)];[a19_0x3d76a0(0x147)];async[a19_0x3d76a0(0x15f)](_0x178791){const _0xb90865=a19_0x3d76a0,{tdx:_0x449b94,options:_0x3a6e24}=_0x178791;try{const _0x1ac8eb=_0x3a6e24,_0x2391f9=_0x1ac8eb[_0xb90865(0x16d)]||0xfa0,_0x2eb270=_0x1ac8eb[_0xb90865(0x15d)],_0x3bfba5=await findAvailablePort(_0x2391f9);console['log'](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x14b)));const _0x36cf15=await getProjectIdOrDefault(_0x178791,_0x2eb270),_0x3ffba9=await _0x449b94[_0xb90865(0x17b)][_0xb90865(0x146)](),_0x1b7b13=_0x3ffba9[_0xb90865(0x17d)](_0x11983e=>_0x11983e['id']===_0x36cf15);this['logger']=new TDXLogger(_0x3a6e24[_0xb90865(0x16a)]),await this[_0xb90865(0x147)]['init'](),console['log'](a19_0x4c6413[_0xb90865(0x16c)]('Starting\x20proxy\x20server...'));_0x3bfba5!==_0x2391f9&&console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x175)](_0xb90865(0x150)+_0x2391f9+_0xb90865(0x154)+_0x3bfba5));this[_0xb90865(0x143)]=new ProxyServer({'port':_0x3bfba5,'projectId':_0x36cf15,'tdx':_0x449b94,'logger':this['logger'],'site':_0x3a6e24[_0xb90865(0x157)]}),await this['server'][_0xb90865(0x144)](),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x175)][_0xb90865(0x177)](_0xb90865(0x151))),console['log'](a19_0x4c6413[_0xb90865(0x175)](_0xb90865(0x169))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x175)](_0xb90865(0x172))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x149)][_0xb90865(0x177)](_0xb90865(0x16e))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x160)](_0xb90865(0x166))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x163)),a19_0x4c6413[_0xb90865(0x162)](_0xb90865(0x17e)+_0x3bfba5)),console['log'](a19_0x4c6413['dim'](_0xb90865(0x179)),a19_0x4c6413[_0xb90865(0x162)](_0x1b7b13?.[_0xb90865(0x14f)][_0xb90865(0x183)]||_0x36cf15)),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x153)),a19_0x4c6413[_0xb90865(0x162)](_0xb90865(0x152))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x17a)),a19_0x4c6413[_0xb90865(0x162)](_0x3a6e24[_0xb90865(0x157)])),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x160)](_0xb90865(0x176))),console['log'](a19_0x4c6413['dim'](_0xb90865(0x168))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x162)](_0xb90865(0x14c))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x162)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0xb90865(0x174)](a19_0x4c6413['white'](_0xb90865(0x15e)+_0x3bfba5+'\x22,')),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x162)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console[_0xb90865(0x174)](a19_0x4c6413['white'](_0xb90865(0x171))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x162)](_0xb90865(0x184))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x160)]('\x0aTesting\x20with\x20Agent\x20SDK:')),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x155))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x182))),console[_0xb90865(0x174)](a19_0x4c6413['dim'](_0xb90865(0x180))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x175)](_0xb90865(0x164)));const _0x360b29=async()=>{const _0x1bf1f5=_0xb90865;console['log'](a19_0x4c6413[_0x1bf1f5(0x16c)]('\x0a\x0aShutting\x20down\x20proxy\x20server...')),this[_0x1bf1f5(0x143)]&&await this[_0x1bf1f5(0x143)][_0x1bf1f5(0x161)](),this[_0x1bf1f5(0x147)]&&await this[_0x1bf1f5(0x147)]['close'](),console[_0x1bf1f5(0x174)](a19_0x4c6413[_0x1bf1f5(0x149)](_0x1bf1f5(0x16f))),process['exit'](0x0);};return process['on'](_0xb90865(0x148),_0x360b29),process['on'](_0xb90865(0x15c),_0x360b29),await new Promise(()=>{}),0x0;}catch(_0x3ea90e){this[_0xb90865(0x143)]&&await this[_0xb90865(0x143)][_0xb90865(0x161)]();this[_0xb90865(0x147)]&&await this[_0xb90865(0x147)][_0xb90865(0x15a)]();throw _0x3ea90e;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x1217e4=a20_0x1a3a;(function(_0x386051,_0x275329){const _0x24f584=a20_0x1a3a,_0x1e8dae=_0x386051();while(!![]){try{const _0x1a26de=parseInt(_0x24f584(0x75))/0x1+-parseInt(_0x24f584(0x7d))/0x2*(parseInt(_0x24f584(0x8a))/0x3)+parseInt(_0x24f584(0x8c))/0x4*(parseInt(_0x24f584(0x98))/0x5)+-parseInt(_0x24f584(0x83))/0x6+-parseInt(_0x24f584(0x93))/0x7*(-parseInt(_0x24f584(0x6c))/0x8)+-parseInt(_0x24f584(0x88))/0x9*(-parseInt(_0x24f584(0x87))/0xa)+-parseInt(_0x24f584(0x70))/0xb;if(_0x1a26de===_0x275329)break;else _0x1e8dae['push'](_0x1e8dae['shift']());}catch(_0x2e6cee){_0x1e8dae['push'](_0x1e8dae['shift']());}}}(a20_0x142f,0x90d97));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';export class ParentSegmentCreateCommand extends BaseCommand{[a20_0x1217e4(0x73)]='segment:parent:create';[a20_0x1217e4(0x6d)]=a20_0x1217e4(0x7f);async[a20_0x1217e4(0x96)](_0x7f3c31){const _0x310c36=a20_0x1217e4,{options:_0x565f4b,args:_0x38dbc8,tdx:_0x77e96a}=_0x7f3c31,_0x440bf7=_0x565f4b;if(_0x38dbc8[_0x310c36(0x6b)]===0x0)return console[_0x310c36(0x95)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x5bd1df=_0x38dbc8[0x0];if(!_0x440bf7[_0x310c36(0x6f)]||!_0x440bf7['table'])return console[_0x310c36(0x95)](_0x310c36(0x67)),console[_0x310c36(0x95)](_0x310c36(0x99)),0x1;_0x440bf7[_0x310c36(0x90)]&&(console[_0x310c36(0x95)]('Site:\x20'+_0x440bf7[_0x310c36(0x8f)]),console[_0x310c36(0x95)](_0x310c36(0x89)+_0x5bd1df),console['error'](_0x310c36(0x80)+_0x440bf7[_0x310c36(0x6f)]),console[_0x310c36(0x95)]('Table:\x20'+_0x440bf7['table']));const _0xe1f48a=await loadJSONFromOptions(_0x440bf7[_0x310c36(0x77)],_0x440bf7[_0x310c36(0x85)]),_0x167d9c=await loadJSONFromOptions(_0x440bf7['behaviors'],_0x440bf7[_0x310c36(0x71)]),_0x50f61f=await loadJSONFromOptions(_0x440bf7['customerGroup'],_0x440bf7[_0x310c36(0x97)]),_0xce84d3={'name':_0x5bd1df,'description':_0x440bf7['description'],'scheduleType':_0x440bf7[_0x310c36(0x84)],'scheduleOption':_0x440bf7['scheduleOption'],'timezone':_0x440bf7['timezone'],'master':{'parentDatabaseName':_0x440bf7[_0x310c36(0x6f)],'parentTableName':_0x440bf7[_0x310c36(0x8e)]},'attributes':_0xe1f48a,'behaviors':_0x167d9c,'customerGroup':_0x50f61f},_0xf4f051=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x5bd1df+_0x310c36(0x7c),()=>_0x77e96a[_0x310c36(0x7a)]['createParent'](_0xce84d3),{'verbose':_0x565f4b[_0x310c36(0x90)]}),_0xd80ecd=_0xf4f051[_0x310c36(0x91)];return console[_0x310c36(0x95)](_0x310c36(0x8b)+_0xd80ecd[_0x310c36(0x73)]+'\x27\x20with\x20ID:\x20'+_0xd80ecd['id']),await handleSDKOutput([_0xd80ecd],_0x565f4b),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a20_0x1217e4(0x73)]=a20_0x1217e4(0x94);[a20_0x1217e4(0x6d)]=a20_0x1217e4(0x7b);async[a20_0x1217e4(0x96)](_0x570809){const _0x175cf5=a20_0x1217e4,{options:_0x1bb193,args:_0x5cc0e7,tdx:_0x189a33}=_0x570809,_0xd6c9f5=_0x1bb193;if(_0x5cc0e7[_0x175cf5(0x6b)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x175cf5(0x95)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x2b0770=_0x5cc0e7[0x0];_0xd6c9f5[_0x175cf5(0x90)]&&(console[_0x175cf5(0x95)](_0x175cf5(0x72)+_0xd6c9f5[_0x175cf5(0x8f)]),console['error'](_0x175cf5(0x74)+_0x2b0770));const _0x1cf467=await withSpinner(_0x175cf5(0x7e)+_0x2b0770+_0x175cf5(0x7c),()=>_0x189a33['segment'][_0x175cf5(0x92)](_0x2b0770),{'verbose':_0xd6c9f5[_0x175cf5(0x90)]}),_0x281318=_0x1cf467[_0x175cf5(0x91)],_0x32b121=await loadJSONFromOptions(_0xd6c9f5[_0x175cf5(0x6a)],_0xd6c9f5[_0x175cf5(0x8d)]),_0x44a261=await loadJSONFromOptions(_0xd6c9f5[_0x175cf5(0x82)],_0xd6c9f5[_0x175cf5(0x68)]),_0x3657f8={'name':_0x281318[_0x175cf5(0x73)],'description':_0xd6c9f5[_0x175cf5(0x6d)]!==undefined?_0xd6c9f5[_0x175cf5(0x6d)]:_0x281318[_0x175cf5(0x6d)],'scheduleType':_0xd6c9f5[_0x175cf5(0x84)]!==undefined?_0xd6c9f5[_0x175cf5(0x84)]:_0x281318['scheduleType'],'scheduleOption':_0xd6c9f5[_0x175cf5(0x76)]!==undefined?_0xd6c9f5['scheduleOption']:_0x281318[_0x175cf5(0x76)],'timezone':_0xd6c9f5[_0x175cf5(0x69)]!==undefined?_0xd6c9f5[_0x175cf5(0x69)]:_0x281318[_0x175cf5(0x69)],'master':_0x281318[_0x175cf5(0x86)],'attributes':_0x32b121?[..._0x281318['attributes']||[],..._0x32b121]:_0x281318[_0x175cf5(0x77)],'behaviors':_0x44a261?[..._0x281318['behaviors']||[],..._0x44a261]:_0x281318[_0x175cf5(0x6e)],'customerGroup':_0x281318[_0x175cf5(0x78)]},_0x578e9e=await withSpinner(_0x175cf5(0x81)+_0x2b0770+_0x175cf5(0x7c),()=>_0x189a33[_0x175cf5(0x7a)]['updateParent'](_0x2b0770,_0x3657f8),{'verbose':_0xd6c9f5[_0x175cf5(0x90)]}),_0x2cb7fe=_0x578e9e['data'];return console['error'](_0x175cf5(0x79)+_0x2cb7fe[_0x175cf5(0x73)]+'\x27'),await handleSDKOutput([_0x2cb7fe],_0xd6c9f5),0x0;}}function a20_0x1a3a(_0x57cbe,_0x313926){const _0x142f35=a20_0x142f();return a20_0x1a3a=function(_0x1a3ace,_0x2eb2e7){_0x1a3ace=_0x1a3ace-0x67;let _0x49d358=_0x142f35[_0x1a3ace];return _0x49d358;},a20_0x1a3a(_0x57cbe,_0x313926);}function a20_0x142f(){const _0x237b81=['addBehaviorsFile','timezone','addAttributes','length','1437872HXnjwe','description','behaviors','database','1549834NleCua','behaviorsFile','Site:\x20','name','Parent\x20segment:\x20','684473MGSiXX','scheduleOption','attributes','customerGroup','✔\x20Updated\x20parent\x20segment\x20\x27','segment','Update\x20existing\x20parent\x20segment\x20(audience)','\x27...','2wDpknR','Fetching\x20current\x20configuration\x20for\x20\x27','Create\x20new\x20parent\x20segment\x20(audience)','Database:\x20','Updating\x20parent\x20segment\x20\x27','addBehaviors','4377552igRyIY','scheduleType','attributesFile','master','10TuuFWB','1182735choIVr','Name:\x20','1013631rHYLee','✔\x20Created\x20parent\x20segment\x20\x27','1786304uWtEsM','addAttributesFile','table','site','verbose','data','getParentFull','21PQcIIz','segment:parent:update','error','execute','customerGroupFile','5OcDiar','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Error:\x20--database\x20and\x20--table\x20are\x20required'];a20_0x142f=function(){return _0x237b81;};return a20_0x142f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x4bda32=a21_0x24be;(function(_0x2faca4,_0x28d1bb){const _0x1ddff6=a21_0x24be,_0x2da602=_0x2faca4();while(!![]){try{const _0x56b145=-parseInt(_0x1ddff6(0x83))/0x1+-parseInt(_0x1ddff6(0x86))/0x2*(parseInt(_0x1ddff6(0x89))/0x3)+-parseInt(_0x1ddff6(0x74))/0x4*(parseInt(_0x1ddff6(0x8a))/0x5)+-parseInt(_0x1ddff6(0x78))/0x6*(parseInt(_0x1ddff6(0x8b))/0x7)+parseInt(_0x1ddff6(0x80))/0x8+-parseInt(_0x1ddff6(0x7c))/0x9+-parseInt(_0x1ddff6(0x7a))/0xa*(-parseInt(_0x1ddff6(0x84))/0xb);if(_0x56b145===_0x28d1bb)break;else _0x2da602['push'](_0x2da602['shift']());}catch(_0x55981b){_0x2da602['push'](_0x2da602['shift']());}}}(a21_0x4be9,0x9b5da));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';function a21_0x24be(_0x28f4c3,_0x2449a4){const _0x4be9c1=a21_0x4be9();return a21_0x24be=function(_0x24becf,_0x295c2f){_0x24becf=_0x24becf-0x73;let _0x53c240=_0x4be9c1[_0x24becf];return _0x53c240;},a21_0x24be(_0x28f4c3,_0x2449a4);}export class ProfilesCommand extends BaseCommand{[a21_0x4bda32(0x8c)]=a21_0x4bda32(0x76);[a21_0x4bda32(0x85)]=a21_0x4bda32(0x87);async[a21_0x4bda32(0x82)](_0x41814a){const _0x5cdd79=a21_0x4bda32,{options:_0x50ccef}=_0x41814a;try{const _0x574c41=listProfiles(),_0x19a46f=getActiveProfile();if(_0x574c41[_0x5cdd79(0x73)]===0x0)return console['log'](_0x5cdd79(0x81)),console[_0x5cdd79(0x79)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x5cdd79(0x79)](_0x5cdd79(0x7f)),0x0;const _0x258879=_0x574c41[_0x5cdd79(0x77)](_0x38158c=>{const _0x5d7959=_0x5cdd79,_0x5ba342=_0x38158c['name']===_0x19a46f,_0x452133=getProfileParams(_0x38158c[_0x5d7959(0x88)]);return{'name':_0x38158c[_0x5d7959(0x8c)],'active':_0x5ba342,'scope':_0x38158c[_0x5d7959(0x7e)],'description':_0x38158c[_0x5d7959(0x88)]['description']||'','params':_0x452133};});return await handleSDKOutput(_0x258879,_0x50ccef),0x0;}catch(_0x3f9e31){return _0x3f9e31 instanceof Error&&console[_0x5cdd79(0x7b)](_0x5cdd79(0x75)+_0x3f9e31[_0x5cdd79(0x7d)]),0x1;}}}function a21_0x4be9(){const _0xa08a20=['No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','execute','1236602EXFyWY','59994429BhLEcU','description','44baGCcK','List\x20all\x20available\x20profiles','config','154719ImIHwM','1006685rdyerI','91SnBztN','name','length','24reNrsx','Error:\x20','profiles','map','275118lKfNsT','log','10SnSyuL','error','10498347gJhsMF','message','scope','\x20\x20Global:\x20~/.config/tdx/tdx.json','4193128kuDINS'];a21_0x4be9=function(){return _0xa08a20;};return a21_0x4be9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x107356=a22_0x2ed3;(function(_0x3febb4,_0x2b476e){const _0x563138=a22_0x2ed3,_0x121419=_0x3febb4();while(!![]){try{const _0x520178=parseInt(_0x563138(0xea))/0x1+-parseInt(_0x563138(0xf5))/0x2+-parseInt(_0x563138(0xfd))/0x3*(-parseInt(_0x563138(0xf8))/0x4)+-parseInt(_0x563138(0xf1))/0x5+-parseInt(_0x563138(0xeb))/0x6*(-parseInt(_0x563138(0xe6))/0x7)+-parseInt(_0x563138(0x10d))/0x8*(parseInt(_0x563138(0xfe))/0x9)+-parseInt(_0x563138(0xfc))/0xa*(-parseInt(_0x563138(0x113))/0xb);if(_0x520178===_0x2b476e)break;else _0x121419['push'](_0x121419['shift']());}catch(_0x1fcc60){_0x121419['push'](_0x121419['shift']());}}}(a22_0x3ebd,0xb09d1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a22_0x2ed3(_0x5f59e3,_0x5feaa){const _0x3ebdd8=a22_0x3ebd();return a22_0x2ed3=function(_0x2ed3e0,_0x2a8aa8){_0x2ed3e0=_0x2ed3e0-0xe3;let _0x566b58=_0x3ebdd8[_0x2ed3e0];return _0x566b58;},a22_0x2ed3(_0x5f59e3,_0x5feaa);}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x3ebd(){const _0x5a9d1a=['1429348wITjKG','data','error','3440icKTHr','Site:\x20','setPhase','in\x20','14909110tkbldT','3000yTMQhk','41049HGZAUj','jobId','elapsedTimeMillis','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','processedRows','state','stats','originalMessage','\x20-\x20','\x20[Job\x20ID:\x20','...','Executing\x20statement\x20','execute','join','SQL:\x20','152xWxPZr','\x20rows\x20','query','name','\x0aAll\x20results\x20saved\x20to\x20','options','11Zonebt','Error:\x20','totalSplits','Statement\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','verbose','Executing\x20query...','Schema:\x20','args','site','completedSplits','push','7aTzmTJ','description','Catalog:\x20','Query\x20completed:\x20Processed\x20','482366vNFmmh','411630aGSjVZ','length','message','output','\x20splits','file','6885700rOmTOp','catalog','setExtra','database'];a22_0x3ebd=function(){return _0x5a9d1a;};return a22_0x3ebd();}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a22_0x107356(0x110)]=a22_0x107356(0x10f);[a22_0x107356(0xe7)]='Run\x20Trino\x20queries\x20(streaming)';async[a22_0x107356(0x10a)](_0x13bcb7){const _0x5e4459=a22_0x107356,{options:_0x30d064,args:_0x11a8f6,tdx:_0x5015c5}=_0x13bcb7,_0x1443cd=_0x11a8f6[0x0],_0x4270fe=_0x30d064[_0x5e4459(0xf0)];let _0x375efa;if(_0x4270fe)try{_0x375efa=readSqlStatementsFromFile(_0x4270fe);}catch(_0x329cb7){return console[_0x5e4459(0xf7)](_0x5e4459(0x114)+_0x329cb7[_0x5e4459(0xed)]),0x1;}else try{_0x375efa=splitSqlStatements(_0x1443cd);}catch(_0x5b47c7){return console[_0x5e4459(0xf7)](_0x5e4459(0x114)+_0x5b47c7[_0x5e4459(0xed)]),0x1;}const _0x2823fa=_0x30d064[_0x5e4459(0xf4)]||'information_schema',_0x7c60c2=_0x30d064[_0x5e4459(0xf2)];try{const _0x13d722=[],_0xc3452d=!!_0x30d064[_0x5e4459(0xee)];for(let _0x3f21cd=0x0;_0x3f21cd<_0x375efa['length'];_0x3f21cd++){const _0x23cf7b=_0x375efa[_0x3f21cd],_0x5808b3=_0x3f21cd+0x1,_0x356c20=_0x375efa[_0x5e4459(0xec)],_0x41b348=_0x356c20>0x1;_0x30d064['verbose']&&(console[_0x5e4459(0xf7)]('\x0a'+(_0x41b348?_0x5e4459(0x116)+_0x5808b3+'/'+_0x356c20+':':'')),console[_0x5e4459(0xf7)](_0x5e4459(0xf9)+_0x30d064[_0x5e4459(0xe3)]),console[_0x5e4459(0xf7)](_0x5e4459(0xe8)+(_0x7c60c2||'td')),console[_0x5e4459(0xf7)](_0x5e4459(0x11a)+_0x2823fa),console[_0x5e4459(0xf7)](_0x5e4459(0x10c)+_0x23cf7b));const _0x3a1d21=_0x41b348?_0x5e4459(0x109)+_0x5808b3+'/'+_0x356c20+_0x5e4459(0x108):_0x5e4459(0x119);try{const _0x23bb25=await withQuerySpinner(_0x3a1d21,async _0x4c6ba8=>{const _0xb36ee6=_0x5e4459,_0x23b036=await _0x5015c5['query'][_0xb36ee6(0x10a)](_0x23cf7b,{'catalog':_0x7c60c2,'schema':_0x2823fa,'onJobId':_0x357206=>{_0x4c6ba8['setJobId'](_0x357206);},'onProgress':_0xcda6dc=>{const _0x2a0f3f=_0xb36ee6;_0x4c6ba8[_0x2a0f3f(0xfa)]('Executing\x20query\x20['+_0xcda6dc[_0x2a0f3f(0x103)]+']'),_0x4c6ba8[_0x2a0f3f(0xf3)](formatRows(_0xcda6dc[_0x2a0f3f(0x102)])+'\x20rows\x20'+_0xcda6dc[_0x2a0f3f(0xe4)]+'/'+_0xcda6dc[_0x2a0f3f(0x115)]+_0x2a0f3f(0xef));}});return _0x23b036;},{'verbose':_0x30d064[_0x5e4459(0x118)]}),_0x203c47=_0x23bb25[_0x5e4459(0xf6)],_0xacfd3=_0x203c47['jobId']?_0x5e4459(0x107)+_0x203c47[_0x5e4459(0xff)]+']':'',_0x1831ff=_0x41b348?_0x5e4459(0x116)+_0x5808b3+'/'+_0x356c20+_0x5e4459(0x106):'';console[_0x5e4459(0xf7)]('✔\x20'+_0x1831ff+_0x5e4459(0xe9)+formatRows(_0x203c47[_0x5e4459(0x104)][_0x5e4459(0x102)])+_0x5e4459(0x10e)+(_0x5e4459(0xfb)+formatElapsed(_0x203c47[_0x5e4459(0x104)][_0x5e4459(0x100)])+_0xacfd3));if(_0x41b348&&_0xc3452d){const _0x42d32c=resolveOutputOptions(_0x30d064),_0x20dbaf=await formatQueryOutput(_0x203c47,_0x42d32c);_0x13d722[_0x5e4459(0xe5)](_0x20dbaf);}else await handleQueryOutput(_0x203c47,_0x30d064);}catch(_0x127ec7){const _0x4682f2=_0x41b348?'Statement\x20'+_0x5808b3+'/'+_0x356c20+':\x0a':'',_0x3875bb=_0x127ec7 instanceof SDKError?_0x127ec7[_0x5e4459(0x105)]:_0x127ec7[_0x5e4459(0xed)];return console[_0x5e4459(0xf7)](''+_0x4682f2+_0x3875bb),0x1;}}if(_0x375efa[_0x5e4459(0xec)]>0x1&&_0xc3452d&&_0x13d722[_0x5e4459(0xec)]>0x0){const _0xb7e573=_0x13d722[_0x5e4459(0x10b)]('\x0a');writeFileSync(_0x30d064[_0x5e4459(0xee)],_0xb7e573),console[_0x5e4459(0xf7)](_0x5e4459(0x111)+_0x30d064[_0x5e4459(0xee)]);}return 0x0;}catch(_0x166a27){throw _0x166a27;}}['validate'](_0x3915a1){const _0x43f990=a22_0x107356,_0xc3515b=_0x3915a1[_0x43f990(0x11b)][0x0],_0x5bceb3=_0x3915a1[_0x43f990(0x112)][_0x43f990(0xf0)];if(!_0xc3515b&&!_0x5bceb3)return _0x43f990(0x101);if(_0xc3515b&&_0x5bceb3)return _0x43f990(0x117);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0xe3fb7b=a23_0x169b;(function(_0x51a431,_0x4e8838){const _0xdcd664=a23_0x169b,_0x1911ca=_0x51a431();while(!![]){try{const _0x545756=-parseInt(_0xdcd664(0x1da))/0x1*(-parseInt(_0xdcd664(0x1dc))/0x2)+-parseInt(_0xdcd664(0x1b0))/0x3*(-parseInt(_0xdcd664(0x18b))/0x4)+parseInt(_0xdcd664(0x19d))/0x5+-parseInt(_0xdcd664(0x1d3))/0x6+-parseInt(_0xdcd664(0x1c6))/0x7*(-parseInt(_0xdcd664(0x1cf))/0x8)+parseInt(_0xdcd664(0x17a))/0x9+-parseInt(_0xdcd664(0x1a4))/0xa;if(_0x545756===_0x4e8838)break;else _0x1911ca['push'](_0x1911ca['shift']());}catch(_0x37ec59){_0x1911ca['push'](_0x1911ca['shift']());}}}(a23_0x3d43,0xa14ca));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a23_0x3d43(){const _0x59ffd5=['getParent','processedRows','error','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','setJobId','Folder\x20ID:\x20','Executing\x20segment\x20query...','query','log','\x27\x20with\x20ID:\x20','in\x20','trim','\x27...','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','execute','\x20folder','2335950SpqErV','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','segmentId','toLocaleString','segment:describe','getSegment','createFolder','getSegmentSQL','cause','type','parent','json','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20parent\x20segment...','Parent\x20segment:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Create\x20segment\x20folder\x20for\x20organization','1168qUAOHw','folderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:folder:create','Listing\x20folders\x20for\x20parent\x20\x27','Fetching\x20parent\x20segment\x20details...','Folder\x20ID\x20missing\x20from\x20resolved\x20path','✖\x20Query\x20failed\x20[','jsonl','getFolder','description','site','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20[Job\x20ID:\x20','Parent\x20name:\x20','parentId','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','3573680JXlsgR','segment:folder:list','Parent\x20ID:\x20','includes','Error:\x20Path\x20or\x20name\x20is\x20required','Fetching\x20segment\x20details...','Examples:','6913130ACpEFA','segment:show','segmentPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','format','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','name','Fetching\x20folder\x20\x27','resolveFolderId','Site:\x20','INTERNAL','2007zTYJWu','replace','\x20rows\x20','Resolving\x20parent\x20segment\x20\x27','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Creating\x20folder\x20\x27','Fetching\x20SQL\x20for\x20segment...','listFolders','information_schema','segment','folder','data','Resolving\x20parent\x20folder\x20\x27','Error:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','stats','parentFolder','\x20\x20Cause:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','✔\x20Created\x20folder\x20\x27','4111653wvYujp','Error:\x20Parent\x20segment\x20name\x20is\x20required','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Folder\x20reference\x20is\x20required','resolveParentId','getParentSQL','verbose','8rLgBxg','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Show\x20segment\x20or\x20folder\x20details','message','6112110PMtaIy','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','SQL\x20query:\x0a','length','Resolved\x20type:\x20','Resolving\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','1XgCDbP','✔\x20Query\x20completed:\x20Processed\x20','1227334UHysob','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolved\x20parent\x20folder\x20ID:\x20','jobId','resolvePathToResource'];a23_0x3d43=function(){return _0x59ffd5;};return a23_0x3d43();}import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x17e);[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1d1);async[a23_0xe3fb7b(0x1f0)](_0x582219){const _0x2ca564=a23_0xe3fb7b,{options:_0x53e843,args:_0x3f14f1,tdx:_0x4b8d4f}=_0x582219;if(_0x3f14f1[_0x2ca564(0x1d6)]===0x0)return console[_0x2ca564(0x1e4)](_0x2ca564(0x1a1)),console[_0x2ca564(0x1e4)](_0x2ca564(0x198)),console['error'](_0x2ca564(0x1a3)),console['error'](_0x2ca564(0x1de)),console[_0x2ca564(0x1e4)](_0x2ca564(0x1a7)),console[_0x2ca564(0x1e4)](_0x2ca564(0x1ef)),0x1;try{const _0x303772=_0x3f14f1[0x0],_0x2b3c9b=_0x53e843[_0x2ca564(0x1a6)];let _0x2911d0=_0x303772;_0x2b3c9b&&!_0x303772[_0x2ca564(0x1a0)]('/')&&(_0x2911d0=_0x2b3c9b+'/'+_0x303772,_0x53e843[_0x2ca564(0x1ce)]&&console[_0x2ca564(0x1e4)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2911d0));const _0x1478df=await withSpinner(_0x2ca564(0x1b4)+_0x2911d0+_0x2ca564(0x1ee),()=>_0x4b8d4f['segment'][_0x2ca564(0x1e1)](_0x2911d0),{'verbose':_0x53e843[_0x2ca564(0x1ce)]}),_0x8cf3bd=_0x1478df['data'];_0x53e843[_0x2ca564(0x1ce)]&&(console['error']('Resolved\x20type:\x20'+_0x8cf3bd[_0x2ca564(0x183)]),console['error'](_0x2ca564(0x19f)+_0x8cf3bd['parentId']),_0x8cf3bd['folderId']&&console[_0x2ca564(0x1e4)](_0x2ca564(0x1e7)+_0x8cf3bd[_0x2ca564(0x18c)]),_0x8cf3bd[_0x2ca564(0x17c)]&&console[_0x2ca564(0x1e4)]('Segment\x20ID:\x20'+_0x8cf3bd[_0x2ca564(0x17c)]));if(_0x8cf3bd[_0x2ca564(0x183)]===_0x2ca564(0x184)){const _0xacfea1=await withSpinner(_0x2ca564(0x191),()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x1e2)](_0x8cf3bd[_0x2ca564(0x19b)]),{'verbose':_0x53e843[_0x2ca564(0x1ce)]});await handleSDKOutput([_0xacfea1['data']],_0x53e843);}else{if(_0x8cf3bd[_0x2ca564(0x183)]===_0x2ca564(0x1bc)){if(!_0x8cf3bd[_0x2ca564(0x18c)])throw new SDKError(ErrorCode[_0x2ca564(0x1af)],_0x2ca564(0x192));const _0x50c843=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x195)](_0x8cf3bd['folderId']),{'verbose':_0x53e843['verbose']});await handleSDKOutput([_0x50c843[_0x2ca564(0x1bd)]],_0x53e843);}else{if(_0x8cf3bd['type']==='segment'){if(!_0x8cf3bd[_0x2ca564(0x17c)])throw new SDKError(ErrorCode[_0x2ca564(0x1af)],_0x2ca564(0x18d));const _0x563c62=await withSpinner(_0x2ca564(0x1a2),()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x17f)](_0x8cf3bd[_0x2ca564(0x19b)],_0x8cf3bd[_0x2ca564(0x17c)]),{'verbose':_0x53e843[_0x2ca564(0x1ce)]});await handleSDKOutput([_0x563c62[_0x2ca564(0x1bd)]],_0x53e843);}}}return 0x0;}catch(_0x59c82c){if(_0x59c82c instanceof SDKError)return console['error']('Error:\x20'+_0x59c82c[_0x2ca564(0x1d2)]),_0x59c82c[_0x2ca564(0x182)]&&console['error'](_0x2ca564(0x1c3)+_0x59c82c[_0x2ca564(0x182)]),0x1;throw _0x59c82c;}}}export class SegmentShowCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x1a5);['description']=a23_0xe3fb7b(0x1aa);async[a23_0xe3fb7b(0x1f0)](_0x3ab9d2){const _0x35125e=a23_0xe3fb7b,{options:_0x1eed68,args:_0x59991e,tdx:_0x2b0adc}=_0x3ab9d2;if(_0x59991e[_0x35125e(0x1d6)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x35125e(0x1e4)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x35125e(0x1e4)]('Examples:'),console[_0x35125e(0x1e4)](_0x35125e(0x19c)),console[_0x35125e(0x1e4)](_0x35125e(0x18e)),console['error'](_0x35125e(0x1a8)),0x1;try{const _0x4fc08a=_0x59991e[0x0],_0x5e7397=_0x1eed68[_0x35125e(0x1a6)];let _0x2c237e=_0x4fc08a;_0x5e7397&&!_0x4fc08a[_0x35125e(0x1a0)]('/')&&(_0x2c237e=_0x5e7397+'/'+_0x4fc08a,_0x1eed68[_0x35125e(0x1ce)]&&console[_0x35125e(0x1e4)](_0x35125e(0x1d9)+_0x2c237e));const _0x35cbd2=await withSpinner(_0x35125e(0x1b4)+_0x2c237e+_0x35125e(0x1ee),()=>_0x2b0adc[_0x35125e(0x1bb)][_0x35125e(0x1e1)](_0x2c237e),{'verbose':_0x1eed68[_0x35125e(0x1ce)]}),_0x303414=_0x35cbd2['data'];_0x1eed68[_0x35125e(0x1ce)]&&(console[_0x35125e(0x1e4)](_0x35125e(0x1d7)+_0x303414[_0x35125e(0x183)]),console[_0x35125e(0x1e4)]('Parent\x20ID:\x20'+_0x303414['parentId']));if(_0x303414[_0x35125e(0x183)]===_0x35125e(0x1bc))return console[_0x35125e(0x1e4)](_0x35125e(0x17b)),console[_0x35125e(0x1e4)](_0x35125e(0x1b6)),0x1;let _0x1d3c09;if(_0x303414[_0x35125e(0x183)]===_0x35125e(0x184)){const _0x256fbf=await withSpinner(_0x35125e(0x187),()=>_0x2b0adc['segment'][_0x35125e(0x1cd)](_0x303414['parentId']),{'verbose':_0x1eed68['verbose']});_0x1d3c09=_0x256fbf[_0x35125e(0x1bd)];}else{if(!_0x303414['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x35125e(0x18d));const _0x1f7123=await withSpinner(_0x35125e(0x1b8),()=>_0x2b0adc[_0x35125e(0x1bb)][_0x35125e(0x181)](_0x303414['parentId'],_0x303414[_0x35125e(0x17c)]),{'verbose':_0x1eed68[_0x35125e(0x1ce)]});_0x1d3c09=_0x1f7123[_0x35125e(0x1bd)];}const _0x3e8305=resolveLimit(_0x1eed68['limit'],DEFAULT_DISPLAY_LIMIT),_0xb13f38=/\bLIMIT\s+\d+/i['test'](_0x1d3c09);!_0xb13f38&&(_0x1d3c09=_0x1d3c09[_0x35125e(0x1ed)]()[_0x35125e(0x1b1)](/;+$/,''),_0x1d3c09=_0x35125e(0x1ca)+_0x1d3c09+_0x35125e(0x1dd)+_0x3e8305);_0x1eed68['verbose']&&console['error'](_0x35125e(0x1d5)+_0x1d3c09);const _0x344d6f=await withQuerySpinner(_0x35125e(0x1e8),async _0x2dbd86=>{const _0x327233=_0x35125e,_0x150a42=await _0x2b0adc[_0x327233(0x1e9)][_0x327233(0x1f0)](_0x1d3c09,{'catalog':'td','schema':_0x327233(0x1ba),'onJobId':_0x59cc3e=>{const _0x307d3e=_0x327233;_0x2dbd86[_0x307d3e(0x1e6)](_0x59cc3e);}});return _0x150a42;},{'verbose':_0x1eed68[_0x35125e(0x1ce)]}),_0x5a72c=_0x344d6f[_0x35125e(0x1bd)],_0x38a0dc=_0x5a72c[_0x35125e(0x1e0)]?_0x35125e(0x199)+_0x5a72c[_0x35125e(0x1e0)]+']':'';return console[_0x35125e(0x1e4)](_0x35125e(0x1db)+_0x5a72c[_0x35125e(0x1c1)][_0x35125e(0x1e3)][_0x35125e(0x17d)]()+_0x35125e(0x1b2)+(_0x35125e(0x1ec)+formatElapsed(_0x5a72c[_0x35125e(0x1c1)]['elapsedTimeMillis'])+_0x38a0dc)),await handleQueryOutput(_0x5a72c,_0x1eed68),0x0;}catch(_0x247e7a){if(_0x247e7a instanceof SDKError)return console[_0x35125e(0x1e4)](_0x35125e(0x193)+_0x247e7a['code']+']'),console[_0x35125e(0x1e4)]('\x0a'+_0x247e7a['message']),0x1;throw _0x247e7a;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x19e);[a23_0xe3fb7b(0x196)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a23_0xe3fb7b(0x1f0)](_0x4826be){const _0x3578bd=a23_0xe3fb7b,{options:_0x484a7d,args:_0x4510c0,tdx:_0x2cb398}=_0x4826be;if(_0x4510c0[_0x3578bd(0x1d6)]===0x0)return console[_0x3578bd(0x1e4)](_0x3578bd(0x1c7)),console[_0x3578bd(0x1e4)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x1e7378=_0x4510c0[0x0];try{_0x484a7d[_0x3578bd(0x1ce)]&&(console['error'](_0x3578bd(0x1ae)+_0x484a7d[_0x3578bd(0x197)]),console[_0x3578bd(0x1e4)](_0x3578bd(0x19a)+_0x1e7378));const _0x17ad80=await withSpinner(_0x3578bd(0x1b3)+_0x1e7378+_0x3578bd(0x1ee),()=>_0x2cb398['segment'][_0x3578bd(0x1cc)](_0x1e7378),{'verbose':_0x484a7d['verbose']}),_0x3dea59=_0x17ad80[_0x3578bd(0x1bd)];_0x484a7d['verbose']&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x3dea59);const _0x4f3d2a=await withSpinner(_0x3578bd(0x190)+_0x1e7378+_0x3578bd(0x1ee),()=>_0x2cb398['segment'][_0x3578bd(0x1b9)](_0x3dea59),{'verbose':_0x484a7d[_0x3578bd(0x1ce)]}),_0x5f6173=_0x4f3d2a['data'];return console[_0x3578bd(0x1e4)]('✔\x20Found\x20'+_0x5f6173[_0x3578bd(0x1d6)]+_0x3578bd(0x1f1)+(_0x5f6173[_0x3578bd(0x1d6)]!==0x1?'s':'')),await handleSDKOutput(_0x5f6173,_0x484a7d),0x0;}catch(_0x117ade){if(_0x117ade instanceof SDKError)return console[_0x3578bd(0x1e4)](_0x3578bd(0x1bf)+_0x117ade['message']),_0x117ade['cause']&&console[_0x3578bd(0x1e4)](_0x3578bd(0x1c3)+_0x117ade[_0x3578bd(0x182)]),0x1;throw _0x117ade;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]='segment:folder:show';[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1c8);async[a23_0xe3fb7b(0x1f0)](_0x38c801){const _0x4856da=a23_0xe3fb7b,{options:_0xaaaf14,args:_0x11a2f1,tdx:_0x2b00e3}=_0x38c801;if(_0x11a2f1[_0x4856da(0x1d6)]===0x0)return console['error'](_0x4856da(0x1cb)),console[_0x4856da(0x1e4)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x46ab0e,childId:_0xc540e9}=parseSegmentRef(_0x11a2f1[0x0]);_0xaaaf14[_0x4856da(0x1ce)]&&(console[_0x4856da(0x1e4)](_0x4856da(0x1ae)+_0xaaaf14['site']),console[_0x4856da(0x1e4)]('Parent\x20name:\x20'+_0x46ab0e),_0xc540e9&&console['error']('Folder\x20name:\x20'+_0xc540e9));if(!_0xc540e9)return console[_0x4856da(0x1e4)](_0x4856da(0x1c0)),0x1;const _0x4c12cf=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x46ab0e+_0x4856da(0x1ee),()=>_0x2b00e3[_0x4856da(0x1bb)][_0x4856da(0x1cc)](_0x46ab0e),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]}),_0x3ec330=_0x4c12cf[_0x4856da(0x1bd)];_0xaaaf14[_0x4856da(0x1ce)]&&console[_0x4856da(0x1e4)]('Resolved\x20parent\x20ID:\x20'+_0x3ec330);const _0x5da319=await withSpinner(_0x4856da(0x1d8)+_0xc540e9+'\x27...',()=>_0x2b00e3[_0x4856da(0x1bb)][_0x4856da(0x1ad)](_0x3ec330,_0xc540e9),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]}),_0x79ac68=_0x5da319['data'];_0xaaaf14['verbose']&&console[_0x4856da(0x1e4)]('Resolved\x20folder\x20ID:\x20'+_0x79ac68);const _0x31d61c=await withSpinner(_0x4856da(0x1ac)+_0xc540e9+_0x4856da(0x1ee),()=>_0x2b00e3['segment']['getFolder'](_0x79ac68),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]});return await handleSDKOutput([_0x31d61c[_0x4856da(0x1bd)]],_0xaaaf14),0x0;}catch(_0x21b78e){if(_0x21b78e instanceof SDKError)return console[_0x4856da(0x1e4)](_0x4856da(0x1bf)+_0x21b78e[_0x4856da(0x1d2)]),_0x21b78e[_0x4856da(0x182)]&&console[_0x4856da(0x1e4)](_0x4856da(0x1c3)+_0x21b78e[_0x4856da(0x182)]),0x1;throw _0x21b78e;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]='segment:sql';[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1e5);async[a23_0xe3fb7b(0x1f0)](_0x18b286){const _0x2cf7ef=a23_0xe3fb7b,{options:_0x181d4b,args:_0x58390f,tdx:_0x3e993d}=_0x18b286;if(_0x58390f[_0x2cf7ef(0x1d6)]===0x0)return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x186)),console[_0x2cf7ef(0x1e4)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console['error'](_0x2cf7ef(0x1a3)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x189)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1b5)),console['error'](_0x2cf7ef(0x1c9)),0x1;try{const _0x483506=_0x58390f[0x0],_0x505e2c=_0x181d4b['segmentPath'];let _0x13b18e=_0x483506;_0x505e2c&&!_0x483506[_0x2cf7ef(0x1a0)]('/')&&(_0x13b18e=_0x505e2c+'/'+_0x483506,_0x181d4b[_0x2cf7ef(0x1ce)]&&console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d9)+_0x13b18e));const _0x124a37=await withSpinner(_0x2cf7ef(0x1b4)+_0x13b18e+'\x27...',()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x1e1)](_0x13b18e),{'verbose':_0x181d4b[_0x2cf7ef(0x1ce)]}),_0x255aa2=_0x124a37[_0x2cf7ef(0x1bd)];_0x181d4b[_0x2cf7ef(0x1ce)]&&(console[_0x2cf7ef(0x1e4)]('Resolved\x20type:\x20'+_0x255aa2[_0x2cf7ef(0x183)]),console[_0x2cf7ef(0x1e4)]('Parent\x20ID:\x20'+_0x255aa2[_0x2cf7ef(0x19b)]));if(_0x255aa2[_0x2cf7ef(0x183)]===_0x2cf7ef(0x1bc))return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d4)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d0)),0x1;let _0x5b8285;if(_0x255aa2[_0x2cf7ef(0x183)]==='parent'){const _0x251211=await withSpinner(_0x2cf7ef(0x187),()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x1cd)](_0x255aa2[_0x2cf7ef(0x19b)]),{'verbose':_0x181d4b['verbose']});_0x5b8285=_0x251211[_0x2cf7ef(0x1bd)];}else{if(!_0x255aa2[_0x2cf7ef(0x17c)])throw new SDKError(ErrorCode[_0x2cf7ef(0x1af)],_0x2cf7ef(0x18d));const _0x429079=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x181)](_0x255aa2[_0x2cf7ef(0x19b)],_0x255aa2[_0x2cf7ef(0x17c)]),{'verbose':_0x181d4b[_0x2cf7ef(0x1ce)]});_0x5b8285=_0x429079[_0x2cf7ef(0x1bd)];}return _0x181d4b[_0x2cf7ef(0x1a9)]===_0x2cf7ef(0x185)||_0x181d4b[_0x2cf7ef(0x1a9)]===_0x2cf7ef(0x194)?await handleSDKOutput([{'sql':_0x5b8285}],_0x181d4b):console[_0x2cf7ef(0x1ea)](_0x5b8285),0x0;}catch(_0x37e8ed){if(_0x37e8ed instanceof SDKError)return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1bf)+_0x37e8ed[_0x2cf7ef(0x1d2)]),_0x37e8ed[_0x2cf7ef(0x182)]&&console['error'](_0x2cf7ef(0x1c3)+_0x37e8ed[_0x2cf7ef(0x182)]),0x1;throw _0x37e8ed;}}}function a23_0x169b(_0x5cd79f,_0x3878ff){const _0x3d43ca=a23_0x3d43();return a23_0x169b=function(_0x169b79,_0x4f2b92){_0x169b79=_0x169b79-0x17a;let _0x511b41=_0x3d43ca[_0x169b79];return _0x511b41;},a23_0x169b(_0x5cd79f,_0x3878ff);}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x18f);[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x18a);async[a23_0xe3fb7b(0x1f0)](_0x1cb8c4){const _0x19a596=a23_0xe3fb7b,{options:_0x517f6e,args:_0x14a249,tdx:_0x3efa8b}=_0x1cb8c4,_0x500660=_0x517f6e;if(_0x14a249[_0x19a596(0x1d6)]<0x2)return console[_0x19a596(0x1e4)](_0x19a596(0x1c4)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3b3672=_0x14a249[0x0],_0x41166c=_0x14a249[0x1];_0x500660[_0x19a596(0x1ce)]&&(console[_0x19a596(0x1e4)](_0x19a596(0x1ae)+_0x500660[_0x19a596(0x197)]),console[_0x19a596(0x1e4)](_0x19a596(0x188)+_0x3b3672),console[_0x19a596(0x1e4)]('Folder\x20name:\x20'+_0x41166c));let _0x2f2efb;if(_0x500660[_0x19a596(0x1c2)]){const _0x129c64=_0x500660[_0x19a596(0x1c2)],_0x370288=await withSpinner(_0x19a596(0x1b3)+_0x3b3672+_0x19a596(0x1ee),()=>_0x3efa8b[_0x19a596(0x1bb)][_0x19a596(0x1cc)](_0x3b3672),{'verbose':_0x500660[_0x19a596(0x1ce)]}),_0x2b42c5=_0x370288[_0x19a596(0x1bd)],_0x36e143=await withSpinner(_0x19a596(0x1be)+_0x129c64+_0x19a596(0x1ee),()=>_0x3efa8b['segment'][_0x19a596(0x1ad)](_0x2b42c5,_0x129c64),{'verbose':_0x500660['verbose']});_0x2f2efb=_0x36e143[_0x19a596(0x1bd)],_0x500660[_0x19a596(0x1ce)]&&console[_0x19a596(0x1e4)](_0x19a596(0x1df)+_0x2f2efb);}const _0x40816e={'name':_0x41166c,'description':_0x500660['description'],'parentFolderId':_0x2f2efb},_0x2bf799=await withSpinner(_0x19a596(0x1b7)+_0x41166c+_0x19a596(0x1ee),()=>_0x3efa8b[_0x19a596(0x1bb)][_0x19a596(0x180)](_0x3b3672,_0x40816e),{'verbose':_0x500660[_0x19a596(0x1ce)]}),_0x333f1d=_0x2bf799['data'];return console[_0x19a596(0x1e4)](_0x19a596(0x1c5)+_0x333f1d['name']+_0x19a596(0x1eb)+_0x333f1d['id']),await handleSDKOutput([_0x333f1d],_0x500660),0x0;}}
|
|
1
|
+
const a23_0x1a3ecf=a23_0x2382;(function(_0x388af2,_0x540775){const _0x4e2a47=a23_0x2382,_0x35b6c9=_0x388af2();while(!![]){try{const _0x54f882=-parseInt(_0x4e2a47(0x1c5))/0x1*(parseInt(_0x4e2a47(0x1e5))/0x2)+-parseInt(_0x4e2a47(0x1c3))/0x3+parseInt(_0x4e2a47(0x1fb))/0x4+-parseInt(_0x4e2a47(0x210))/0x5*(-parseInt(_0x4e2a47(0x1dd))/0x6)+-parseInt(_0x4e2a47(0x1f1))/0x7+parseInt(_0x4e2a47(0x213))/0x8*(parseInt(_0x4e2a47(0x1d6))/0x9)+parseInt(_0x4e2a47(0x1c1))/0xa;if(_0x54f882===_0x540775)break;else _0x35b6c9['push'](_0x35b6c9['shift']());}catch(_0x52646b){_0x35b6c9['push'](_0x35b6c9['shift']());}}}(a23_0x45c7,0x19a17));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a23_0x2382(_0x25798a,_0x414290){const _0x45c7c8=a23_0x45c7();return a23_0x2382=function(_0x23826d,_0x380c56){_0x23826d=_0x23826d-0x1a8;let _0x49c574=_0x45c7c8[_0x23826d];return _0x49c574;},a23_0x2382(_0x25798a,_0x414290);}import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a23_0x45c7(){const _0x1b200f=['Fetching\x20folder\x20details...','\x20rows\x20','name','Fetching\x20folder\x20\x27','\x20\x20Cause:\x20','segment:show','Resolved\x20type:\x20','807050pciiVX','getSegmentSQL','68052MJEoUU','data','182491AyODjb','description','includes','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Examples:','folder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parentFolder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20SQL\x20for\x20parent\x20segment...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Folder\x20reference\x20is\x20required','segment:sql','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','4329blIHVa','INTERNAL','segment','Segment\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','error','elapsedTimeMillis','156168KIOGwz','\x20folder','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segment:folder:create','getSegment','Error:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','2miAWsT','Show\x20segment\x20folder\x20details','setJobId','Resolving\x20folder\x20\x27','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Folder\x20ID:\x20','folderId','Resolving\x20parent\x20folder\x20\x27','length','parent','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Parent\x20segment:\x20','530236qltTal','✔\x20Found\x20','test','Resolving\x20path\x20\x27','Folder\x20name:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','createFolder','Listing\x20folders\x20for\x20parent\x20\x27','Executing\x20segment\x20query...','Fetching\x20SQL\x20for\x20segment...','408012qKDmlg','parentId','segmentPath','json','Show\x20segment\x20or\x20folder\x20details','type','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentId','listFolders','jobId','in\x20','replace','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20describe\x20<path>','Fetching\x20segment\x20details...','execute','Resolved\x20parent\x20ID:\x20','\x27\x20with\x20ID:\x20','stats','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','20XhkTRl','format','information_schema','1648zXUejB','\x27...','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','✖\x20Query\x20failed\x20[','verbose','\x20[Job\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','jsonl','Parent\x20ID:\x20','site','✔\x20Query\x20completed:\x20Processed\x20','cause','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','✔\x20Created\x20folder\x20\x27','getFolder','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SELECT\x20*\x20FROM\x20(\x0a','processedRows','getParent','Usage:\x20tdx\x20segment\x20show\x20<path>','resolvePathToResource','SQL\x20query:\x0a','code','message','Usage:\x20tdx\x20segment\x20sql\x20<path>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:describe','resolveParentId','segment:folder:show'];a23_0x45c7=function(){return _0x1b200f;};return a23_0x45c7();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1b7);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1ff);async[a23_0x1a3ecf(0x20a)](_0x57ecec){const _0xdbc49c=a23_0x1a3ecf,{options:_0x265c13,args:_0x5a38d6,tdx:_0x48c842}=_0x57ecec;if(_0x5a38d6[_0xdbc49c(0x1ed)]===0x0)return console[_0xdbc49c(0x1db)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0xdbc49c(0x1db)](_0xdbc49c(0x208)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c9)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1cf)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x201)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c8)),0x1;try{const _0x22a5f2=_0x5a38d6[0x0],_0x3fb241=_0x265c13[_0xdbc49c(0x1fd)];let _0xc60bc0=_0x22a5f2;_0x3fb241&&!_0x22a5f2['includes']('/')&&(_0xc60bc0=_0x3fb241+'/'+_0x22a5f2,_0x265c13['verbose']&&console[_0xdbc49c(0x1db)]('Resolved\x20relative\x20path\x20to:\x20'+_0xc60bc0));const _0xf7adea=await withSpinner('Resolving\x20path\x20\x27'+_0xc60bc0+_0xdbc49c(0x214),()=>_0x48c842['segment'][_0xdbc49c(0x1b1)](_0xc60bc0),{'verbose':_0x265c13[_0xdbc49c(0x217)]}),_0x5c24dc=_0xf7adea['data'];_0x265c13[_0xdbc49c(0x217)]&&(console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c0)+_0x5c24dc[_0xdbc49c(0x200)]),console[_0xdbc49c(0x1db)](_0xdbc49c(0x21c)+_0x5c24dc['parentId']),_0x5c24dc[_0xdbc49c(0x1eb)]&&console['error'](_0xdbc49c(0x1ea)+_0x5c24dc[_0xdbc49c(0x1eb)]),_0x5c24dc['segmentId']&&console['error'](_0xdbc49c(0x1d9)+_0x5c24dc[_0xdbc49c(0x202)]));if(_0x5c24dc[_0xdbc49c(0x200)]==='parent'){const _0x5ef62b=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1af)](_0x5c24dc['parentId']),{'verbose':_0x265c13['verbose']});await handleSDKOutput([_0x5ef62b['data']],_0x265c13);}else{if(_0x5c24dc[_0xdbc49c(0x200)]===_0xdbc49c(0x1ca)){if(!_0x5c24dc[_0xdbc49c(0x1eb)])throw new SDKError(ErrorCode[_0xdbc49c(0x1d7)],_0xdbc49c(0x1cb));const _0xbc6bed=await withSpinner(_0xdbc49c(0x1ba),()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1ab)](_0x5c24dc[_0xdbc49c(0x1eb)]),{'verbose':_0x265c13[_0xdbc49c(0x217)]});await handleSDKOutput([_0xbc6bed[_0xdbc49c(0x1c4)]],_0x265c13);}else{if(_0x5c24dc['type']===_0xdbc49c(0x1d8)){if(!_0x5c24dc[_0xdbc49c(0x202)])throw new SDKError(ErrorCode[_0xdbc49c(0x1d7)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x295749=await withSpinner(_0xdbc49c(0x209),()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1e1)](_0x5c24dc['parentId'],_0x5c24dc[_0xdbc49c(0x202)]),{'verbose':_0x265c13[_0xdbc49c(0x217)]});await handleSDKOutput([_0x295749[_0xdbc49c(0x1c4)]],_0x265c13);}}}return 0x0;}catch(_0x33db79){if(_0x33db79 instanceof SDKError)return console[_0xdbc49c(0x1db)](_0xdbc49c(0x1e2)+_0x33db79[_0xdbc49c(0x1b4)]),_0x33db79['cause']&&console[_0xdbc49c(0x1db)](_0xdbc49c(0x1be)+_0x33db79[_0xdbc49c(0x1a8)]),0x1;throw _0x33db79;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1bf);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e9);async[a23_0x1a3ecf(0x20a)](_0x42e6df){const _0x544360=a23_0x1a3ecf,{options:_0x231f19,args:_0x1e933f,tdx:_0x401468}=_0x42e6df;if(_0x1e933f[_0x544360(0x1ed)]===0x0)return console[_0x544360(0x1db)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x544360(0x1db)](_0x544360(0x1b0)),console[_0x544360(0x1db)](_0x544360(0x1c9)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x544360(0x1d5)),console[_0x544360(0x1db)](_0x544360(0x1ef)),0x1;try{const _0x13c6af=_0x1e933f[0x0],_0x168d73=_0x231f19[_0x544360(0x1fd)];let _0x1526fd=_0x13c6af;_0x168d73&&!_0x13c6af['includes']('/')&&(_0x1526fd=_0x168d73+'/'+_0x13c6af,_0x231f19['verbose']&&console[_0x544360(0x1db)](_0x544360(0x219)+_0x1526fd));const _0x4e4843=await withSpinner(_0x544360(0x1f4)+_0x1526fd+_0x544360(0x214),()=>_0x401468['segment'][_0x544360(0x1b1)](_0x1526fd),{'verbose':_0x231f19[_0x544360(0x217)]}),_0x140c9e=_0x4e4843[_0x544360(0x1c4)];_0x231f19[_0x544360(0x217)]&&(console['error'](_0x544360(0x1c0)+_0x140c9e['type']),console[_0x544360(0x1db)](_0x544360(0x21c)+_0x140c9e[_0x544360(0x1fc)]));if(_0x140c9e[_0x544360(0x200)]===_0x544360(0x1ca))return console[_0x544360(0x1db)](_0x544360(0x1f6)),console['error'](_0x544360(0x20e)),0x1;let _0xdb9b94;if(_0x140c9e[_0x544360(0x200)]==='parent'){const _0x1d6aa6=await withSpinner(_0x544360(0x1ce),()=>_0x401468[_0x544360(0x1d8)]['getParentSQL'](_0x140c9e['parentId']),{'verbose':_0x231f19[_0x544360(0x217)]});_0xdb9b94=_0x1d6aa6[_0x544360(0x1c4)];}else{if(!_0x140c9e[_0x544360(0x202)])throw new SDKError(ErrorCode[_0x544360(0x1d7)],_0x544360(0x1b6));const _0xb52979=await withSpinner(_0x544360(0x1fa),()=>_0x401468[_0x544360(0x1d8)][_0x544360(0x1c2)](_0x140c9e[_0x544360(0x1fc)],_0x140c9e[_0x544360(0x202)]),{'verbose':_0x231f19['verbose']});_0xdb9b94=_0xb52979[_0x544360(0x1c4)];}const _0x280ac8=resolveLimit(_0x231f19['limit'],DEFAULT_DISPLAY_LIMIT),_0x412983=/\bLIMIT\s+\d+/i[_0x544360(0x1f3)](_0xdb9b94);!_0x412983&&(_0xdb9b94=_0xdb9b94['trim']()[_0x544360(0x206)](/;+$/,''),_0xdb9b94=_0x544360(0x1ad)+_0xdb9b94+_0x544360(0x1e3)+_0x280ac8);_0x231f19[_0x544360(0x217)]&&console[_0x544360(0x1db)](_0x544360(0x1b2)+_0xdb9b94);const _0x123635=await withQuerySpinner(_0x544360(0x1f9),async _0x49419d=>{const _0x5594f7=_0x544360,_0x542f39=await _0x401468['query'][_0x5594f7(0x20a)](_0xdb9b94,{'catalog':'td','schema':_0x5594f7(0x212),'onJobId':_0x531300=>{const _0x31a3ef=_0x5594f7;_0x49419d[_0x31a3ef(0x1e7)](_0x531300);}});return _0x542f39;},{'verbose':_0x231f19['verbose']}),_0x566bd7=_0x123635[_0x544360(0x1c4)],_0x14edc7=_0x566bd7[_0x544360(0x204)]?_0x544360(0x218)+_0x566bd7['jobId']+']':'';return console[_0x544360(0x1db)](_0x544360(0x21e)+_0x566bd7[_0x544360(0x20d)][_0x544360(0x1ae)]['toLocaleString']()+_0x544360(0x1bb)+(_0x544360(0x205)+formatElapsed(_0x566bd7[_0x544360(0x20d)][_0x544360(0x1dc)])+_0x14edc7)),await handleQueryOutput(_0x566bd7,_0x231f19),0x0;}catch(_0x37f90b){if(_0x37f90b instanceof SDKError)return console[_0x544360(0x1db)](_0x544360(0x216)+_0x37f90b[_0x544360(0x1b3)]+']'),console[_0x544360(0x1db)]('\x0a'+_0x37f90b['message']),0x1;throw _0x37f90b;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]='segment:folder:list';[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e4);async[a23_0x1a3ecf(0x20a)](_0x2ede41){const _0x1f1c95=a23_0x1a3ecf,{options:_0x2c707b,args:_0xfc6d75,tdx:_0x2c518f}=_0x2ede41;if(_0xfc6d75[_0x1f1c95(0x1ed)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1f1c95(0x1db)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x2bbbea=_0xfc6d75[0x0];try{_0x2c707b['verbose']&&(console['error'](_0x1f1c95(0x1d4)+_0x2c707b['site']),console[_0x1f1c95(0x1db)]('Parent\x20name:\x20'+_0x2bbbea));const _0x413370=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2bbbea+_0x1f1c95(0x214),()=>_0x2c518f[_0x1f1c95(0x1d8)]['resolveParentId'](_0x2bbbea),{'verbose':_0x2c707b['verbose']}),_0x32cd95=_0x413370[_0x1f1c95(0x1c4)];_0x2c707b[_0x1f1c95(0x217)]&&console['error'](_0x1f1c95(0x20b)+_0x32cd95);const _0x329cde=await withSpinner(_0x1f1c95(0x1f8)+_0x2bbbea+_0x1f1c95(0x214),()=>_0x2c518f['segment'][_0x1f1c95(0x203)](_0x32cd95),{'verbose':_0x2c707b[_0x1f1c95(0x217)]}),_0x18e49a=_0x329cde[_0x1f1c95(0x1c4)];return console['error'](_0x1f1c95(0x1f2)+_0x18e49a[_0x1f1c95(0x1ed)]+_0x1f1c95(0x1de)+(_0x18e49a[_0x1f1c95(0x1ed)]!==0x1?'s':'')),await handleSDKOutput(_0x18e49a,_0x2c707b),0x0;}catch(_0x5d10a6){if(_0x5d10a6 instanceof SDKError)return console['error']('Error:\x20'+_0x5d10a6[_0x1f1c95(0x1b4)]),_0x5d10a6[_0x1f1c95(0x1a8)]&&console['error'](_0x1f1c95(0x1be)+_0x5d10a6[_0x1f1c95(0x1a8)]),0x1;throw _0x5d10a6;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1b9);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e6);async[a23_0x1a3ecf(0x20a)](_0x11270b){const _0x3b34a0=a23_0x1a3ecf,{options:_0x655433,args:_0x20ad35,tdx:_0x41ca9d}=_0x11270b;if(_0x20ad35[_0x3b34a0(0x1ed)]===0x0)return console['error'](_0x3b34a0(0x1d0)),console[_0x3b34a0(0x1db)](_0x3b34a0(0x1df)),0x1;try{const {parentId:_0x49917d,childId:_0x282ce7}=parseSegmentRef(_0x20ad35[0x0]);_0x655433[_0x3b34a0(0x217)]&&(console[_0x3b34a0(0x1db)](_0x3b34a0(0x1d4)+_0x655433[_0x3b34a0(0x21d)]),console['error']('Parent\x20name:\x20'+_0x49917d),_0x282ce7&&console['error'](_0x3b34a0(0x1f5)+_0x282ce7));if(!_0x282ce7)return console[_0x3b34a0(0x1db)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x474e11=await withSpinner(_0x3b34a0(0x207)+_0x49917d+_0x3b34a0(0x214),()=>_0x41ca9d[_0x3b34a0(0x1d8)]['resolveParentId'](_0x49917d),{'verbose':_0x655433[_0x3b34a0(0x217)]}),_0x1cd0a7=_0x474e11[_0x3b34a0(0x1c4)];_0x655433[_0x3b34a0(0x217)]&&console[_0x3b34a0(0x1db)](_0x3b34a0(0x20b)+_0x1cd0a7);const _0x5e4b3a=await withSpinner(_0x3b34a0(0x1e8)+_0x282ce7+_0x3b34a0(0x214),()=>_0x41ca9d[_0x3b34a0(0x1d8)]['resolveFolderId'](_0x1cd0a7,_0x282ce7),{'verbose':_0x655433[_0x3b34a0(0x217)]}),_0x9c0c03=_0x5e4b3a['data'];_0x655433[_0x3b34a0(0x217)]&&console[_0x3b34a0(0x1db)]('Resolved\x20folder\x20ID:\x20'+_0x9c0c03);const _0x529c5b=await withSpinner(_0x3b34a0(0x1bd)+_0x282ce7+_0x3b34a0(0x214),()=>_0x41ca9d['segment'][_0x3b34a0(0x1ab)](_0x9c0c03),{'verbose':_0x655433[_0x3b34a0(0x217)]});return await handleSDKOutput([_0x529c5b[_0x3b34a0(0x1c4)]],_0x655433),0x0;}catch(_0x2a5058){if(_0x2a5058 instanceof SDKError)return console['error'](_0x3b34a0(0x1e2)+_0x2a5058[_0x3b34a0(0x1b4)]),_0x2a5058[_0x3b34a0(0x1a8)]&&console['error'](_0x3b34a0(0x1be)+_0x2a5058[_0x3b34a0(0x1a8)]),0x1;throw _0x2a5058;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a23_0x1a3ecf(0x1d1);['description']=a23_0x1a3ecf(0x20f);async[a23_0x1a3ecf(0x20a)](_0x3c33e2){const _0x32404f=a23_0x1a3ecf,{options:_0x4c9c3c,args:_0x5b8463,tdx:_0xbad90e}=_0x3c33e2;if(_0x5b8463[_0x32404f(0x1ed)]===0x0)return console[_0x32404f(0x1db)](_0x32404f(0x1d3)),console[_0x32404f(0x1db)](_0x32404f(0x1b5)),console[_0x32404f(0x1db)](_0x32404f(0x1c9)),console['error'](_0x32404f(0x21a)),console[_0x32404f(0x1db)](_0x32404f(0x1da)),console['error'](_0x32404f(0x1ac)),0x1;try{const _0x211fba=_0x5b8463[0x0],_0x331053=_0x4c9c3c['segmentPath'];let _0x26066a=_0x211fba;_0x331053&&!_0x211fba[_0x32404f(0x1c7)]('/')&&(_0x26066a=_0x331053+'/'+_0x211fba,_0x4c9c3c['verbose']&&console['error'](_0x32404f(0x219)+_0x26066a));const _0x244823=await withSpinner(_0x32404f(0x1f4)+_0x26066a+'\x27...',()=>_0xbad90e[_0x32404f(0x1d8)][_0x32404f(0x1b1)](_0x26066a),{'verbose':_0x4c9c3c['verbose']}),_0x4a7537=_0x244823[_0x32404f(0x1c4)];_0x4c9c3c[_0x32404f(0x217)]&&(console['error'](_0x32404f(0x1c0)+_0x4a7537[_0x32404f(0x200)]),console[_0x32404f(0x1db)](_0x32404f(0x21c)+_0x4a7537[_0x32404f(0x1fc)]));if(_0x4a7537[_0x32404f(0x200)]===_0x32404f(0x1ca))return console[_0x32404f(0x1db)](_0x32404f(0x1a9)),console[_0x32404f(0x1db)](_0x32404f(0x1cd)),0x1;let _0x2d67e3;if(_0x4a7537['type']===_0x32404f(0x1ee)){const _0x2f3f2a=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0xbad90e[_0x32404f(0x1d8)]['getParentSQL'](_0x4a7537[_0x32404f(0x1fc)]),{'verbose':_0x4c9c3c[_0x32404f(0x217)]});_0x2d67e3=_0x2f3f2a[_0x32404f(0x1c4)];}else{if(!_0x4a7537[_0x32404f(0x202)])throw new SDKError(ErrorCode[_0x32404f(0x1d7)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x647717=await withSpinner(_0x32404f(0x1fa),()=>_0xbad90e[_0x32404f(0x1d8)]['getSegmentSQL'](_0x4a7537[_0x32404f(0x1fc)],_0x4a7537[_0x32404f(0x202)]),{'verbose':_0x4c9c3c['verbose']});_0x2d67e3=_0x647717['data'];}return _0x4c9c3c['format']===_0x32404f(0x1fe)||_0x4c9c3c[_0x32404f(0x211)]===_0x32404f(0x21b)?await handleSDKOutput([{'sql':_0x2d67e3}],_0x4c9c3c):console['log'](_0x2d67e3),0x0;}catch(_0x775ddc){if(_0x775ddc instanceof SDKError)return console['error'](_0x32404f(0x1e2)+_0x775ddc[_0x32404f(0x1b4)]),_0x775ddc['cause']&&console['error'](_0x32404f(0x1be)+_0x775ddc[_0x32404f(0x1a8)]),0x1;throw _0x775ddc;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1e0);['description']=a23_0x1a3ecf(0x1d2);async['execute'](_0x324010){const _0x48b92c=a23_0x1a3ecf,{options:_0x302475,args:_0x8b4590,tdx:_0x1b6a5a}=_0x324010,_0x155fe8=_0x302475;if(_0x8b4590['length']<0x2)return console[_0x48b92c(0x1db)](_0x48b92c(0x215)),console[_0x48b92c(0x1db)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x362fc2=_0x8b4590[0x0],_0x33733d=_0x8b4590[0x1];_0x155fe8['verbose']&&(console['error'](_0x48b92c(0x1d4)+_0x155fe8[_0x48b92c(0x21d)]),console['error'](_0x48b92c(0x1f0)+_0x362fc2),console[_0x48b92c(0x1db)]('Folder\x20name:\x20'+_0x33733d));let _0x22161f;if(_0x155fe8[_0x48b92c(0x1cc)]){const _0x391a09=_0x155fe8['parentFolder'],_0x467855=await withSpinner(_0x48b92c(0x207)+_0x362fc2+_0x48b92c(0x214),()=>_0x1b6a5a['segment'][_0x48b92c(0x1b8)](_0x362fc2),{'verbose':_0x155fe8[_0x48b92c(0x217)]}),_0xf577d7=_0x467855[_0x48b92c(0x1c4)],_0x105663=await withSpinner(_0x48b92c(0x1ec)+_0x391a09+_0x48b92c(0x214),()=>_0x1b6a5a[_0x48b92c(0x1d8)]['resolveFolderId'](_0xf577d7,_0x391a09),{'verbose':_0x155fe8[_0x48b92c(0x217)]});_0x22161f=_0x105663[_0x48b92c(0x1c4)],_0x155fe8['verbose']&&console[_0x48b92c(0x1db)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x22161f);}const _0x1d2d97={'name':_0x33733d,'description':_0x155fe8[_0x48b92c(0x1c6)],'parentFolderId':_0x22161f},_0x327530=await withSpinner('Creating\x20folder\x20\x27'+_0x33733d+'\x27...',()=>_0x1b6a5a[_0x48b92c(0x1d8)][_0x48b92c(0x1f7)](_0x362fc2,_0x1d2d97),{'verbose':_0x155fe8[_0x48b92c(0x217)]}),_0x673c03=_0x327530[_0x48b92c(0x1c4)];return console[_0x48b92c(0x1db)](_0x48b92c(0x1aa)+_0x673c03[_0x48b92c(0x1bc)]+_0x48b92c(0x20c)+_0x673c03['id']),await handleSDKOutput([_0x673c03],_0x155fe8),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0xf7ece2=a24_0x4219;(function(_0x1cff80,_0x536201){const _0x14ad73=a24_0x4219,_0x4e93ee=_0x1cff80();while(!![]){try{const _0x5985ad=parseInt(_0x14ad73(0x137))/0x1+parseInt(_0x14ad73(0x14e))/0x2+-parseInt(_0x14ad73(0x156))/0x3*(parseInt(_0x14ad73(0x15c))/0x4)+parseInt(_0x14ad73(0x148))/0x5+parseInt(_0x14ad73(0x13f))/0x6*(-parseInt(_0x14ad73(0x15f))/0x7)+-parseInt(_0x14ad73(0x153))/0x8+-parseInt(_0x14ad73(0x161))/0x9*(-parseInt(_0x14ad73(0x162))/0xa);if(_0x5985ad===_0x536201)break;else _0x4e93ee['push'](_0x4e93ee['shift']());}catch(_0x5107ba){_0x4e93ee['push'](_0x4e93ee['shift']());}}}(a24_0x2638,0x97cf1));function a24_0x2638(){const _0x2c8bb8=['type','data','length','4063615UUqDpP','site','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','verbose','\x27...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','1260620PRLtsC','✔\x20Created\x20segment\x20\x27','folder','Create\x20child\x20segment\x20with\x20filtering\x20rules','ruleFile','6911408gaXDAp','parent','folderId','2613yJHERC','Resolving\x20folder\x20\x27','createSegment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segment','Segment\x20name:\x20','5524dPauWP','Site:\x20','name','637770lrivRw','rule','711fdSmYu','149200zUvtrc','execute','segments','Target\x20path:\x20','Resolving\x20folder\x20path\x20\x27','error','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','noCountPopulation','invisible','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','kind','Creating\x20segment\x20\x27','431313QKopgf','\x27\x20with\x20ID:\x20','Parent\x20path:\x20','resolveFolderId','description','segmentPath','Examples:','resolveParentId','24KChELM','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolvePathToResource','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Resolved\x20folder\x20ID:\x20'];a24_0x2638=function(){return _0x2c8bb8;};return a24_0x2638();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a24_0x4219(_0x4c48bd,_0xa583a5){const _0x263824=a24_0x2638();return a24_0x4219=function(_0x4219f9,_0x2e6c4d){_0x4219f9=_0x4219f9-0x12a;let _0x5b2d49=_0x263824[_0x4219f9];return _0x5b2d49;},a24_0x4219(_0x4c48bd,_0xa583a5);}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a24_0xf7ece2(0x15e)]='segment:create';[a24_0xf7ece2(0x13b)]=a24_0xf7ece2(0x151);async[a24_0xf7ece2(0x12a)](_0x4a9f65){const _0x23422e=a24_0xf7ece2,{options:_0x5a1f3d,args:_0xee06c5,tdx:_0x44599c}=_0x4a9f65,_0x118e23=_0x5a1f3d;if(_0xee06c5[_0x23422e(0x147)]===0x0)return console[_0x23422e(0x12e)](_0x23422e(0x14d)),console['error'](_0x23422e(0x159)),console[_0x23422e(0x12e)](_0x23422e(0x13d)),console['error'](_0x23422e(0x134)),console[_0x23422e(0x12e)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x23422e(0x12e)](_0x23422e(0x141)),0x1;const _0x8fdc75=_0xee06c5[0x0],_0x4ddd62=_0x5a1f3d[_0x23422e(0x13c)];let _0x498b5e=_0x8fdc75;_0x4ddd62&&!_0x8fdc75[_0x23422e(0x133)]('/')&&(_0x498b5e=_0x4ddd62+'/'+_0x8fdc75,_0x118e23[_0x23422e(0x14b)]&&console['error'](_0x23422e(0x12f)+_0x498b5e));const _0x1cef59=parsePath(_0x498b5e);if(_0x1cef59[_0x23422e(0x12b)]['length']<0x2)return console['error'](_0x23422e(0x14a)),console[_0x23422e(0x12e)](_0x23422e(0x130)),0x1;const _0x467c8d=_0x1cef59[_0x23422e(0x12b)][0x0],_0xf36a16=getBaseName(_0x498b5e),_0x4ba97f=getParentPath(_0x498b5e);_0x118e23[_0x23422e(0x14b)]&&(console[_0x23422e(0x12e)](_0x23422e(0x15d)+_0x118e23[_0x23422e(0x149)]),console[_0x23422e(0x12e)](_0x23422e(0x12c)+_0x498b5e),console[_0x23422e(0x12e)]('Parent:\x20'+_0x467c8d),console[_0x23422e(0x12e)](_0x23422e(0x15b)+_0xf36a16),console['error'](_0x23422e(0x139)+_0x4ba97f));const _0x57d1d1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x467c8d+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x13e)](_0x467c8d),{'verbose':_0x118e23['verbose']}),_0x2d0614=_0x57d1d1['data'];let _0x238862;if(_0x1cef59[_0x23422e(0x12b)]['length']>0x2){const _0x20caf1=await withSpinner(_0x23422e(0x12d)+_0x4ba97f+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x142)](_0x4ba97f),{'verbose':_0x118e23[_0x23422e(0x14b)]}),_0x3a49d4=_0x20caf1[_0x23422e(0x146)];if(_0x3a49d4[_0x23422e(0x145)]!=='folder'&&_0x3a49d4[_0x23422e(0x145)]!==_0x23422e(0x154))return console[_0x23422e(0x12e)](_0x23422e(0x143)),0x1;_0x238862=_0x3a49d4[_0x23422e(0x155)];}else{if(_0x118e23[_0x23422e(0x150)]){const _0x5cab00=await withSpinner(_0x23422e(0x157)+_0x118e23[_0x23422e(0x150)]+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x13a)](_0x2d0614,_0x118e23[_0x23422e(0x150)]),{'verbose':_0x118e23['verbose']});_0x238862=_0x5cab00[_0x23422e(0x146)];}}_0x118e23[_0x23422e(0x14b)]&&_0x238862&&console[_0x23422e(0x12e)](_0x23422e(0x144)+_0x238862);const _0x4d2a23=await loadJSONFromOptions(_0x118e23[_0x23422e(0x160)],_0x118e23[_0x23422e(0x152)]),_0x1dda19={'name':_0xf36a16,'description':_0x118e23[_0x23422e(0x13b)],'rule':_0x4d2a23,'kind':_0x118e23[_0x23422e(0x135)]!==undefined?parseInt(_0x118e23['kind'],0xa):undefined,'isVisible':_0x118e23[_0x23422e(0x132)]?![]:undefined,'segmentFolderId':_0x238862,'countPopulation':_0x118e23[_0x23422e(0x131)]?![]:undefined},_0x5c1a13=await withSpinner(_0x23422e(0x136)+_0xf36a16+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x158)](_0x2d0614,_0x1dda19),{'verbose':_0x118e23[_0x23422e(0x14b)]}),_0x1408bd=_0x5c1a13['data'];return console[_0x23422e(0x12e)](_0x23422e(0x14f)+_0x1408bd[_0x23422e(0x15e)]+_0x23422e(0x138)+_0x1408bd['id']),_0x498b5e!==_0x8fdc75&&console[_0x23422e(0x12e)](_0x23422e(0x140)+_0x498b5e),await handleSDKOutput([_0x1408bd],_0x118e23),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x4bbd94=a25_0x5113;function a25_0x2e5c(){const _0x41fb56=['575OtyRJV','listFields','10170QcwBmu','name','497yCevWW','site','verbose','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','494324Gsfmin','407ynsLAr','30zASquD','356376dVQEJz','1373172UrciTS','segment','812hEImDr','List\x20available\x20fields\x20for\x20segmentation','length','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','description','✔\x20Found\x20','\x20field','Parent\x20segment:\x20','error','24080obPOvR','2950KokdUN','14975HsfZaO'];a25_0x2e5c=function(){return _0x41fb56;};return a25_0x2e5c();}(function(_0x2df506,_0x3b9818){const _0x7b2a8a=a25_0x5113,_0x1cbb08=_0x2df506();while(!![]){try{const _0x2e69a1=-parseInt(_0x7b2a8a(0x82))/0x1*(-parseInt(_0x7b2a8a(0x91))/0x2)+parseInt(_0x7b2a8a(0x8f))/0x3+parseInt(_0x7b2a8a(0x8b))/0x4+parseInt(_0x7b2a8a(0x81))/0x5*(parseInt(_0x7b2a8a(0x8d))/0x6)+parseInt(_0x7b2a8a(0x86))/0x7*(parseInt(_0x7b2a8a(0x9b))/0x8)+parseInt(_0x7b2a8a(0x84))/0x9*(parseInt(_0x7b2a8a(0x9c))/0xa)+-parseInt(_0x7b2a8a(0x8c))/0xb*(parseInt(_0x7b2a8a(0x8e))/0xc);if(_0x2e69a1===_0x3b9818)break;else _0x1cbb08['push'](_0x1cbb08['shift']());}catch(_0x30d052){_0x1cbb08['push'](_0x1cbb08['shift']());}}}(a25_0x2e5c,0x43dcc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a25_0x5113(_0x2ab147,_0x5ba92e){const _0x2e5c45=a25_0x2e5c();return a25_0x5113=function(_0x51133e,_0x405ecd){_0x51133e=_0x51133e-0x81;let _0x451d77=_0x2e5c45[_0x51133e];return _0x451d77;},a25_0x5113(_0x2ab147,_0x5ba92e);}export class SegmentFieldsCommand extends BaseCommand{[a25_0x4bbd94(0x85)]='segment:fields';[a25_0x4bbd94(0x96)]=a25_0x4bbd94(0x92);async['execute'](_0x79b9b0){const _0x146cbd=a25_0x4bbd94,{options:_0x19b7ff,args:_0x1e6d48,tdx:_0x468aaa}=_0x79b9b0;if(_0x1e6d48[_0x146cbd(0x93)]===0x0)return console['error'](_0x146cbd(0x8a)),console[_0x146cbd(0x9a)](_0x146cbd(0x95)),0x1;const _0x7f9f50=_0x1e6d48[0x0];_0x19b7ff[_0x146cbd(0x88)]&&(console[_0x146cbd(0x9a)](_0x146cbd(0x89)+_0x19b7ff[_0x146cbd(0x87)]),console[_0x146cbd(0x9a)](_0x146cbd(0x99)+_0x7f9f50));const _0x34b2e1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x7f9f50+'\x27...',()=>_0x468aaa[_0x146cbd(0x90)][_0x146cbd(0x83)](_0x7f9f50),{'verbose':_0x19b7ff[_0x146cbd(0x88)]}),_0x34834b=_0x34b2e1[_0x146cbd(0x94)];return console[_0x146cbd(0x9a)](_0x146cbd(0x97)+_0x34834b[_0x146cbd(0x93)]+_0x146cbd(0x98)+(_0x34834b[_0x146cbd(0x93)]!==0x1?'s':'')),await handleSDKOutput(_0x34834b,_0x19b7ff),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x10f538=a26_0x417b;(function(_0x405e2a,_0x72c23d){const _0x39d0db=a26_0x417b,_0x24f21c=_0x405e2a();while(!![]){try{const _0x99a0ea=parseInt(_0x39d0db(0x188))/0x1+parseInt(_0x39d0db(0x197))/0x2*(parseInt(_0x39d0db(0x18b))/0x3)+-parseInt(_0x39d0db(0x18c))/0x4*(parseInt(_0x39d0db(0x187))/0x5)+-parseInt(_0x39d0db(0x196))/0x6*(parseInt(_0x39d0db(0x18f))/0x7)+-parseInt(_0x39d0db(0x195))/0x8+parseInt(_0x39d0db(0x183))/0x9+parseInt(_0x39d0db(0x19a))/0xa;if(_0x99a0ea===_0x72c23d)break;else _0x24f21c['push'](_0x24f21c['shift']());}catch(_0x27e06a){_0x24f21c['push'](_0x24f21c['shift']());}}}(a26_0x1c5c,0xdf46e));function a26_0x417b(_0x44596c,_0x346cab){const _0x1c5c37=a26_0x1c5c();return a26_0x417b=function(_0x417be7,_0x52d87b){_0x417be7=_0x417be7-0x182;let _0x5850ef=_0x1c5c37[_0x417be7];return _0x5850ef;},a26_0x417b(_0x44596c,_0x346cab);}import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a26_0x10f538(0x198)]=a26_0x10f538(0x191);['description']=a26_0x10f538(0x193);async[a26_0x10f538(0x18a)](_0x242af6){const _0xe768fb=a26_0x10f538,{options:_0x386812}=_0x242af6;try{const _0x2eeacf=_0x386812[_0xe768fb(0x18e)];if(!_0x2eeacf)return _0x386812[_0xe768fb(0x185)]==='json'||_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x184)?console[_0xe768fb(0x189)](JSON['stringify']({'path':'/','type':'root'})):console[_0xe768fb(0x189)]('/'),0x0;if(_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x18d)||_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x184)){const _0x3eb377={'path':_0x2eeacf};console['log'](JSON[_0xe768fb(0x190)](_0x3eb377));}else console['log'](_0x2eeacf),_0x386812[_0xe768fb(0x194)]&&(console[_0xe768fb(0x199)](''),console[_0xe768fb(0x199)](_0xe768fb(0x186)),console[_0xe768fb(0x199)]('\x20\x20Path:\x20'+_0x2eeacf),console[_0xe768fb(0x199)](''),console['error'](_0xe768fb(0x192)),console[_0xe768fb(0x199)](_0xe768fb(0x182)));return 0x0;}catch(_0xfa42c3){throw _0xfa42c3;}}}function a26_0x1c5c(){const _0xfee966=['4405928TanZmq','721044agOQZY','80MQsEbb','name','error','4189690bHueru','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','12897360MJgyAD','jsonl','format','Context\x20details:','7055hUZvbJ','950606dvZJNG','log','execute','55530QVToYx','2824vwiZty','json','segmentPath','63FfWXol','stringify','segment:pwd','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Show\x20current\x20segment/folder\x20context','verbose'];a26_0x1c5c=function(){return _0xfee966;};return a26_0x1c5c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0xf515b0=a27_0x4795;(function(_0x1c50c5,_0x3322e4){const _0x2aa6cf=a27_0x4795,_0x349e17=_0x1c50c5();while(!![]){try{const _0x37e773=-parseInt(_0x2aa6cf(0x118))/0x1*(-parseInt(_0x2aa6cf(0x109))/0x2)+-parseInt(_0x2aa6cf(0x11e))/0x3+-parseInt(_0x2aa6cf(0x10b))/0x4*(-parseInt(_0x2aa6cf(0x11a))/0x5)+parseInt(_0x2aa6cf(0x117))/0x6+-parseInt(_0x2aa6cf(0x12b))/0x7+parseInt(_0x2aa6cf(0x110))/0x8+parseInt(_0x2aa6cf(0x12a))/0x9*(-parseInt(_0x2aa6cf(0x11c))/0xa);if(_0x37e773===_0x3322e4)break;else _0x349e17['push'](_0x349e17['shift']());}catch(_0x3bb2a2){_0x349e17['push'](_0x349e17['shift']());}}}(a27_0xa4c6,0x4b60e));function a27_0x4795(_0x34ee83,_0x20929e){const _0xa4c637=a27_0xa4c6();return a27_0x4795=function(_0x4795d5,_0x20b652){_0x4795d5=_0x4795d5-0xfe;let _0x4fd9a2=_0xa4c637[_0x4795d5];return _0x4fd9a2;},a27_0x4795(_0x34ee83,_0x20929e);}function a27_0xa4c6(){const _0x28b9e7=['3183504KwcyCj','segmentId','rule','\x27...','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolving\x20folder\x20\x27','length','2667714pDIrzw','3237fBGpGH','data','5vJWiAs','segment','10ggeiZv','name','1046808DjMolJ','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Segment\x20ID:\x20','segmentPath','Resolved\x20type:\x20','folder','verbose','ruleFile','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Error:\x20Cannot\x20update\x20','segmentName','resolveFolderId','4247487wpVCmp','2476082fhaJro','Examples:','includes','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent\x20ID:\x20','execute','Resolved\x20folder\x20ID:\x20','segment:update','INTERNAL','Updating\x20segment\x20\x27','✔\x20Updated\x20segment\x20\x27','description','updateSegmentById','136blTNIC','type','1682728lHoqBh','Update\x20existing\x20child\x20segment','resolvePathToResource','kind','error'];a27_0xa4c6=function(){return _0x28b9e7;};return a27_0xa4c6();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0xf515b0(0x103);[a27_0xf515b0(0x107)]=a27_0xf515b0(0x10c);async[a27_0xf515b0(0x101)](_0x152470){const _0x294218=a27_0xf515b0,{options:_0x471942,args:_0x511a53,tdx:_0x29ccbe}=_0x152470,_0x49154a=_0x471942;if(_0x511a53[_0x294218(0x116)]===0x0)return console[_0x294218(0x10f)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x294218(0x10f)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x294218(0x10f)](_0x294218(0x12c)),console[_0x294218(0x10f)](_0x294218(0x11f)),console[_0x294218(0x10f)](_0x294218(0xff)),0x1;const _0x21be47=_0x511a53[0x0],_0x48e5cf=_0x471942[_0x294218(0x121)];let _0x19d5b2=_0x21be47;_0x48e5cf&&!_0x21be47[_0x294218(0xfe)]('/')&&(_0x19d5b2=_0x48e5cf+'/'+_0x21be47,_0x49154a[_0x294218(0x124)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x19d5b2));const _0x5ab69e=await withSpinner('Resolving\x20path\x20\x27'+_0x19d5b2+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x10d)](_0x19d5b2),{'verbose':_0x49154a[_0x294218(0x124)]}),_0x44e97d=_0x5ab69e[_0x294218(0x119)];_0x49154a[_0x294218(0x124)]&&console[_0x294218(0x10f)](_0x294218(0x122)+_0x44e97d[_0x294218(0x10a)]);if(_0x44e97d[_0x294218(0x10a)]!==_0x294218(0x11b))return console[_0x294218(0x10f)](_0x294218(0x127)+_0x44e97d['type']+_0x294218(0x114)),console[_0x294218(0x10f)](_0x294218(0x126)),0x1;if(!_0x44e97d[_0x294218(0x111)])throw new SDKError(ErrorCode[_0x294218(0x104)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x115cd4=_0x44e97d['parentId'],_0x1c1c9e=_0x44e97d[_0x294218(0x111)];_0x49154a[_0x294218(0x124)]&&(console[_0x294218(0x10f)](_0x294218(0x100)+_0x115cd4),console[_0x294218(0x10f)](_0x294218(0x120)+_0x1c1c9e));let _0x404cbc;if(_0x49154a[_0x294218(0x123)]){const _0x559060=_0x49154a[_0x294218(0x123)],_0x3f7941=await withSpinner(_0x294218(0x115)+_0x559060+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x129)](_0x115cd4,_0x559060),{'verbose':_0x49154a[_0x294218(0x124)]});_0x404cbc=parseInt(_0x3f7941[_0x294218(0x119)],0xa),_0x49154a[_0x294218(0x124)]&&console[_0x294218(0x10f)](_0x294218(0x102)+_0x404cbc);}const _0x8add21=await loadJSONFromOptions(_0x49154a[_0x294218(0x112)],_0x49154a[_0x294218(0x125)]),_0x4fe11d={'name':_0x49154a[_0x294218(0x11d)],'description':_0x49154a[_0x294218(0x107)],'rule':_0x8add21,'kind':_0x49154a[_0x294218(0x10e)]!==undefined?parseInt(_0x49154a[_0x294218(0x10e)],0xa):undefined,'segmentFolderId':_0x404cbc},_0xe7a75b=await withSpinner(_0x294218(0x105)+_0x44e97d[_0x294218(0x128)]+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x108)](_0x115cd4,_0x1c1c9e,_0x4fe11d),{'verbose':_0x49154a[_0x294218(0x124)]}),_0x5c3e5b=_0xe7a75b[_0x294218(0x119)];return console[_0x294218(0x10f)](_0x294218(0x106)+_0x5c3e5b[_0x294218(0x11d)]+'\x27'),_0x19d5b2!==_0x21be47&&console[_0x294218(0x10f)]('\x20\x20\x20Path:\x20'+_0x19d5b2),await handleSDKOutput([_0x5c3e5b],_0x49154a),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a28_0x2a9f(){const _0x4a561d=['type','515iARCZB','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Usage:\x20tdx\x20segment\x20use\x20<path>','segmentPath','isAbsolute','join','data','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','segment:use','verbose','Use:\x20tdx\x20segment\x20use\x20','description','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','slice','log','parentId','\x27...','folderPath','2114570efzVpJ','5811232bRwAKc','name','Context\x20set\x20to:\x20','execute','fullPath','Context\x20cleared.\x20Back\x20to\x20root.','parentName','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderId','Resolved\x20path\x20type:\x20','site','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','4224993ejLgEu','session','resolvePathToResource','split','Site:\x20','segments','length','4363404bkPcrr','error','19128GlYEKZ','1NWnQnC','6386282YDtgPf','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','15020MKblZW','13014dTTryK','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Folder\x20ID:\x20'];a28_0x2a9f=function(){return _0x4a561d;};return a28_0x2a9f();}const a28_0x252c63=a28_0x5dd3;(function(_0x8fd22c,_0x573107){const _0x269a11=a28_0x5dd3,_0x20ab05=_0x8fd22c();while(!![]){try{const _0x1cb7b3=parseInt(_0x269a11(0x18d))/0x1*(parseInt(_0x269a11(0x175))/0x2)+-parseInt(_0x269a11(0x183))/0x3+parseInt(_0x269a11(0x18c))/0x4*(-parseInt(_0x269a11(0x163))/0x5)+-parseInt(_0x269a11(0x18a))/0x6+parseInt(_0x269a11(0x18e))/0x7+-parseInt(_0x269a11(0x176))/0x8+-parseInt(_0x269a11(0x15e))/0x9*(-parseInt(_0x269a11(0x15d))/0xa);if(_0x1cb7b3===_0x573107)break;else _0x20ab05['push'](_0x20ab05['shift']());}catch(_0x219c3c){_0x20ab05['push'](_0x20ab05['shift']());}}}(a28_0x2a9f,0xc022c));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a28_0x5dd3(_0xd02058,_0x5a9782){const _0x2a9fd8=a28_0x2a9f();return a28_0x5dd3=function(_0x5dd302,_0x522cf4){_0x5dd302=_0x5dd302-0x15b;let _0x14aacd=_0x2a9fd8[_0x5dd302];return _0x14aacd;},a28_0x5dd3(_0xd02058,_0x5a9782);}export class SegmentUseCommand extends BaseCommand{[a28_0x252c63(0x177)]=a28_0x252c63(0x16b);[a28_0x252c63(0x16e)]=a28_0x252c63(0x164);async[a28_0x252c63(0x179)](_0x2e78eb){const _0x47ec38=a28_0x252c63,{options:_0x2e4bbc,args:_0x14bcc5,tdx:_0x150b38}=_0x2e78eb;if(_0x14bcc5[_0x47ec38(0x189)]===0x0)return console[_0x47ec38(0x18b)]('Error:\x20Path\x20is\x20required'),console[_0x47ec38(0x18b)](_0x47ec38(0x165)),console['error']('Examples:'),console[_0x47ec38(0x18b)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x47ec38(0x18b)](_0x47ec38(0x17e)),console['error'](_0x47ec38(0x160)),console['error'](_0x47ec38(0x15c)),0x1;const _0x51a752=_0x14bcc5[0x0],_0x39875b=_0x2e4bbc[_0x47ec38(0x184)];try{if(_0x51a752==='/')return saveSessionContext({'segment_path':undefined},_0x39875b),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x420f7a=_0x2e4bbc[_0x47ec38(0x166)];let _0x34927d=_0x51a752;const _0x288dc9=parsePath(_0x51a752);if(!_0x288dc9[_0x47ec38(0x167)]){if(!_0x420f7a)return console[_0x47ec38(0x18b)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console['error'](_0x47ec38(0x16a)),0x1;if(_0x51a752==='..'){const _0xd98d01=_0x420f7a[_0x47ec38(0x186)]('/')[_0x47ec38(0x170)](0x0,-0x1)[_0x47ec38(0x168)]('/');_0x34927d=_0xd98d01||'/';}else _0x51a752==='.'?_0x34927d=_0x420f7a:_0x34927d=_0x420f7a+'/'+_0x51a752;_0x2e4bbc[_0x47ec38(0x16c)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x34927d);}if(_0x34927d==='/'||_0x34927d==='')return saveSessionContext({'segment_path':undefined},_0x39875b),console[_0x47ec38(0x171)](_0x47ec38(0x17b)),0x0;_0x34927d=normalizePath(_0x34927d);const _0x115c31=parsePath(_0x34927d)[_0x47ec38(0x188)];if(_0x115c31[_0x47ec38(0x189)]===0x0)return saveSessionContext({'segment_path':undefined},_0x39875b),console[_0x47ec38(0x171)](_0x47ec38(0x17b)),0x0;_0x2e4bbc['verbose']&&(console['error'](_0x47ec38(0x187)+_0x2e4bbc[_0x47ec38(0x181)]),console['error'](_0x47ec38(0x17d)+_0x34927d));const _0x41f58e=await withSpinner('Resolving\x20path\x20\x27'+_0x34927d+_0x47ec38(0x173),()=>_0x150b38['segment'][_0x47ec38(0x185)](_0x34927d),{'verbose':_0x2e4bbc[_0x47ec38(0x16c)]}),_0xaf3309=_0x41f58e[_0x47ec38(0x169)];_0x2e4bbc[_0x47ec38(0x16c)]&&(console[_0x47ec38(0x18b)](_0x47ec38(0x180)+_0xaf3309[_0x47ec38(0x162)]),console[_0x47ec38(0x18b)]('Parent\x20ID:\x20'+_0xaf3309[_0x47ec38(0x172)]),_0xaf3309[_0x47ec38(0x17f)]&&console[_0x47ec38(0x18b)](_0x47ec38(0x161)+_0xaf3309[_0x47ec38(0x17f)]));if(_0xaf3309[_0x47ec38(0x162)]===_0x47ec38(0x15b))return console['error'](_0x47ec38(0x18f)),console[_0x47ec38(0x18b)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x47ec38(0x18b)](_0x47ec38(0x16d)+_0xaf3309[_0x47ec38(0x17c)]+(_0xaf3309[_0x47ec38(0x174)]?'/'+_0xaf3309[_0x47ec38(0x174)][_0x47ec38(0x168)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0xaf3309['fullPath'],'parent_segment':_0xaf3309[_0x47ec38(0x17c)]},_0x39875b),console['log'](_0x47ec38(0x178)+_0xaf3309[_0x47ec38(0x17a)]),_0x2e4bbc[_0x47ec38(0x16c)]&&(console[_0x47ec38(0x18b)](_0x47ec38(0x16f)),console['error'](_0x47ec38(0x182)),console[_0x47ec38(0x18b)](_0x47ec38(0x15f))),0x0;}catch(_0x1ed02a){throw _0x1ed02a;}}}
|