@treasuredata/tdx 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-api-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-api-client.js +1 -1
  7. package/dist/client/rate-limiter.js +1 -1
  8. package/dist/client/td-api-client.js +1 -1
  9. package/dist/client/trino-api-client.js +1 -1
  10. package/dist/client/workflow-client.js +1 -1
  11. package/dist/commands/activations.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/llm-command.js +1 -1
  22. package/dist/commands/llm-proxy.js +1 -1
  23. package/dist/commands/parent-segment-command.js +1 -1
  24. package/dist/commands/profiles-command.js +1 -1
  25. package/dist/commands/query-command.js +1 -1
  26. package/dist/commands/segment-command.js +1 -1
  27. package/dist/commands/segment-create-command.js +1 -1
  28. package/dist/commands/segment-fields-command.js +1 -1
  29. package/dist/commands/segment-pwd-command.js +1 -1
  30. package/dist/commands/segment-update-command.js +1 -1
  31. package/dist/commands/segment-use-command.js +1 -1
  32. package/dist/commands/segments.js +1 -1
  33. package/dist/commands/show.js +1 -1
  34. package/dist/commands/tables.js +1 -1
  35. package/dist/commands/use-command.js +1 -1
  36. package/dist/commands/workflow-command.js +1 -1
  37. package/dist/core/auth.js +1 -1
  38. package/dist/core/config.js +1 -1
  39. package/dist/core/global-context.js +1 -1
  40. package/dist/core/profile.js +1 -1
  41. package/dist/core/project-config.js +1 -1
  42. package/dist/core/session.js +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/proxy/anthropic-adapter.js +1 -1
  45. package/dist/proxy/server.js +1 -1
  46. package/dist/proxy/session-cache.js +1 -1
  47. package/dist/sdk/api.js +1 -1
  48. package/dist/sdk/errors.js +1 -1
  49. package/dist/sdk/index.js +1 -1
  50. package/dist/sdk/job.js +1 -1
  51. package/dist/sdk/llm.js +1 -1
  52. package/dist/sdk/query.js +1 -1
  53. package/dist/sdk/segment.js +1 -1
  54. package/dist/sdk/workflow.js +1 -1
  55. package/dist/types/endpoints.js +1 -1
  56. package/dist/types/index.js +1 -1
  57. package/dist/utils/agent-ref-parser.js +1 -1
  58. package/dist/utils/chat-cache.js +1 -1
  59. package/dist/utils/colors.js +1 -1
  60. package/dist/utils/command-output.js +1 -1
  61. package/dist/utils/constants.js +1 -1
  62. package/dist/utils/file-permissions.js +1 -1
  63. package/dist/utils/format-detector.js +1 -1
  64. package/dist/utils/formatters.js +1 -1
  65. package/dist/utils/json-loader.js +1 -1
  66. package/dist/utils/model-aliases.js +1 -1
  67. package/dist/utils/option-validation.js +1 -1
  68. package/dist/utils/port.js +1 -1
  69. package/dist/utils/process.js +1 -1
  70. package/dist/utils/prompt.js +1 -1
  71. package/dist/utils/segment-path-parser.js +1 -1
  72. package/dist/utils/segment-ref-parser.js +1 -1
  73. package/dist/utils/spinner.js +1 -1
  74. package/dist/utils/sql-parser.js +1 -1
  75. package/dist/utils/sse-parser.js +1 -1
  76. package/dist/utils/string-utils.js +1 -1
  77. package/dist/utils/table-ref-parser.js +1 -1
  78. package/dist/utils/tdx-logger.js +1 -1
  79. package/dist/utils/tdx-logger.js.map +1 -1
  80. package/dist/utils/tree-formatter.js +1 -1
  81. package/dist/utils/version-check.js +1 -1
  82. package/dist/utils/workflow-utils.js +1 -1
  83. package/package.json +1 -1
@@ -1 +1 @@
1
- const a22_0x2a8a55=a22_0x3ccb;(function(_0x116f53,_0x50568b){const _0x400c59=a22_0x3ccb,_0x3c7a11=_0x116f53();while(!![]){try{const _0x117d7d=-parseInt(_0x400c59(0xf4))/0x1+-parseInt(_0x400c59(0xf5))/0x2*(parseInt(_0x400c59(0xfe))/0x3)+parseInt(_0x400c59(0xec))/0x4*(parseInt(_0x400c59(0x110))/0x5)+-parseInt(_0x400c59(0xfa))/0x6*(parseInt(_0x400c59(0x106))/0x7)+parseInt(_0x400c59(0x112))/0x8*(parseInt(_0x400c59(0x118))/0x9)+parseInt(_0x400c59(0x105))/0xa+parseInt(_0x400c59(0xef))/0xb*(parseInt(_0x400c59(0x11f))/0xc);if(_0x117d7d===_0x50568b)break;else _0x3c7a11['push'](_0x3c7a11['shift']());}catch(_0x4f81e2){_0x3c7a11['push'](_0x3c7a11['shift']());}}}(a22_0xd9a1,0x89ccb));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';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_0x3ccb(_0x21f74e,_0x54b5c5){const _0xd9a184=a22_0xd9a1();return a22_0x3ccb=function(_0x3ccb8a,_0xa00895){_0x3ccb8a=_0x3ccb8a-0xec;let _0x53973=_0xd9a184[_0x3ccb8a];return _0x53973;},a22_0x3ccb(_0x21f74e,_0x54b5c5);}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a22_0x2a8a55(0x11a)]=a22_0x2a8a55(0xfb);[a22_0x2a8a55(0x101)]=a22_0x2a8a55(0x103);async[a22_0x2a8a55(0xf9)](_0x1c514e){const _0x5bc910=a22_0x2a8a55,{options:_0xa9a9f7,args:_0xdfbe36,tdx:_0x2a2d77}=_0x1c514e,_0x40d19f=_0xdfbe36[0x0],_0x39891d=_0xa9a9f7[_0x5bc910(0x10d)];let _0x2e91d3;if(_0x39891d)try{_0x2e91d3=readSqlStatementsFromFile(_0x39891d);}catch(_0x299897){return console[_0x5bc910(0xf2)](_0x5bc910(0x114)+_0x299897[_0x5bc910(0xf1)]),0x1;}else try{_0x2e91d3=splitSqlStatements(_0x40d19f);}catch(_0x2157de){return console['error'](_0x5bc910(0x114)+_0x2157de[_0x5bc910(0xf1)]),0x1;}const _0x1eedde=_0xa9a9f7['database']||_0x5bc910(0xf0),_0x1ae81d=_0xa9a9f7[_0x5bc910(0x10f)];try{const _0x392f1d=[],_0x3f16bb=!!_0xa9a9f7[_0x5bc910(0x115)];for(let _0x59e2ce=0x0;_0x59e2ce<_0x2e91d3['length'];_0x59e2ce++){const _0x16beda=_0x2e91d3[_0x59e2ce],_0x5c02c2=_0x59e2ce+0x1,_0x1c14aa=_0x2e91d3[_0x5bc910(0xf6)],_0x569566=_0x1c14aa>0x1;_0xa9a9f7[_0x5bc910(0xf7)]&&(console[_0x5bc910(0xf2)]('\x0a'+(_0x569566?_0x5bc910(0x10a)+_0x5c02c2+'/'+_0x1c14aa+':':'')),console[_0x5bc910(0xf2)](_0x5bc910(0x120)+_0xa9a9f7['site']),console[_0x5bc910(0xf2)](_0x5bc910(0xed)+(_0x1ae81d||'td')),console[_0x5bc910(0xf2)](_0x5bc910(0x10c)+_0x1eedde),console[_0x5bc910(0xf2)]('SQL:\x20'+_0x16beda));const _0x17c207=_0x569566?_0x5bc910(0xf8)+_0x5c02c2+'/'+_0x1c14aa+_0x5bc910(0x117):_0x5bc910(0x111);try{const _0x5a4cbf=await withQuerySpinner(_0x17c207,async _0x720abc=>{const _0x1314c9=_0x5bc910,_0x2a786d=await _0x2a2d77['query'][_0x1314c9(0xf9)](_0x16beda,{'catalog':_0x1ae81d,'schema':_0x1eedde,'onJobId':_0x188e6c=>{const _0x47fb24=_0x1314c9;_0x720abc[_0x47fb24(0x11e)](_0x188e6c);},'onProgress':_0x57e275=>{const _0x3490ec=_0x1314c9;_0x720abc[_0x3490ec(0xfc)](_0x3490ec(0x121)+_0x57e275[_0x3490ec(0xff)]+']'),_0x720abc[_0x3490ec(0x104)](formatRows(_0x57e275[_0x3490ec(0xfd)])+'\x20rows\x20'+_0x57e275[_0x3490ec(0x109)]+'/'+_0x57e275['totalSplits']+'\x20splits');}});return _0x2a786d;},{'verbose':_0xa9a9f7[_0x5bc910(0xf7)]}),_0xbfd22a=_0x5a4cbf[_0x5bc910(0x107)],_0x509353=_0xbfd22a[_0x5bc910(0x108)]?_0x5bc910(0xf3)+_0xbfd22a[_0x5bc910(0x108)]+']':'',_0x4ce23b=_0x569566?_0x5bc910(0x10a)+_0x5c02c2+'/'+_0x1c14aa+_0x5bc910(0x10e):'';console[_0x5bc910(0xf2)]('✔\x20'+_0x4ce23b+'Query\x20completed:\x20Processed\x20'+formatRows(_0xbfd22a[_0x5bc910(0x11d)][_0x5bc910(0xfd)])+_0x5bc910(0x11b)+('in\x20'+formatElapsed(_0xbfd22a['stats']['elapsedTimeMillis'])+_0x509353));if(_0x569566&&_0x3f16bb){const _0x43d069=resolveOutputOptions(_0xa9a9f7),_0x3ada08=await formatQueryOutput(_0xbfd22a,_0x43d069);_0x392f1d[_0x5bc910(0x113)](_0x3ada08);}else await handleQueryOutput(_0xbfd22a,_0xa9a9f7);}catch(_0x3ed788){const _0x198c9f=_0x569566?_0x5bc910(0x10a)+_0x5c02c2+'/'+_0x1c14aa+':\x0a':'',_0x46d561=_0x3ed788 instanceof SDKError?_0x3ed788[_0x5bc910(0x100)]:_0x3ed788[_0x5bc910(0xf1)];return console[_0x5bc910(0xf2)](''+_0x198c9f+_0x46d561),0x1;}}if(_0x2e91d3[_0x5bc910(0xf6)]>0x1&&_0x3f16bb&&_0x392f1d[_0x5bc910(0xf6)]>0x0){const _0x4eef1c=_0x392f1d[_0x5bc910(0x116)]('\x0a');writeFileSync(_0xa9a9f7[_0x5bc910(0x115)],_0x4eef1c),console[_0x5bc910(0xf2)]('\x0aAll\x20results\x20saved\x20to\x20'+_0xa9a9f7[_0x5bc910(0x115)]);}return 0x0;}catch(_0x52fc04){throw _0x52fc04;}}[a22_0x2a8a55(0x10b)](_0x5e668e){const _0x217f3e=a22_0x2a8a55,_0x260d08=_0x5e668e[_0x217f3e(0x11c)][0x0],_0x18b007=_0x5e668e[_0x217f3e(0x119)][_0x217f3e(0x10d)];if(!_0x260d08&&!_0x18b007)return _0x217f3e(0x102);if(_0x260d08&&_0x18b007)return _0x217f3e(0xee);return undefined;}}function a22_0xd9a1(){const _0x5b251c=['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','Run\x20Trino\x20queries\x20(streaming)','setExtra','3533600IhLZOD','11599yloVLe','data','jobId','completedSplits','Statement\x20','validate','Schema:\x20','file','\x20-\x20','catalog','1886265suXwbm','Executing\x20query...','88AQQBhn','push','Error:\x20','output','join','...','723924rDnHgZ','options','name','\x20rows\x20','args','stats','setJobId','5444148nRFYYJ','Site:\x20','Executing\x20query\x20[','8HszvGn','Catalog:\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','11rfQcYy','information_schema','message','error','\x20[Job\x20ID:\x20','571856TvUGMy','1672312fwFiKV','length','verbose','Executing\x20statement\x20','execute','1716Mepnuq','query','setPhase','processedRows','3xsrckq','state','originalMessage','description'];a22_0xd9a1=function(){return _0x5b251c;};return a22_0xd9a1();}
1
+ const a22_0x58236f=a22_0x42bc;(function(_0x20f353,_0x4bd2c0){const _0x2b8168=a22_0x42bc,_0x122326=_0x20f353();while(!![]){try{const _0x1420f8=-parseInt(_0x2b8168(0x1ce))/0x1+-parseInt(_0x2b8168(0x1d2))/0x2+-parseInt(_0x2b8168(0x1dd))/0x3+parseInt(_0x2b8168(0x1c3))/0x4+-parseInt(_0x2b8168(0x1c6))/0x5*(parseInt(_0x2b8168(0x1c2))/0x6)+parseInt(_0x2b8168(0x1c4))/0x7*(parseInt(_0x2b8168(0x1b8))/0x8)+parseInt(_0x2b8168(0x1b3))/0x9*(parseInt(_0x2b8168(0x1de))/0xa);if(_0x1420f8===_0x4bd2c0)break;else _0x122326['push'](_0x122326['shift']());}catch(_0xae8847){_0x122326['push'](_0x122326['shift']());}}}(a22_0x3feb,0x692a8));import{BaseCommand}from'./command.js';function a22_0x42bc(_0x2539c2,_0x5698bb){const _0x3feb5e=a22_0x3feb();return a22_0x42bc=function(_0x42bcf3,_0x35d425){_0x42bcf3=_0x42bcf3-0x1ad;let _0x329961=_0x3feb5e[_0x42bcf3];return _0x329961;},a22_0x42bc(_0x2539c2,_0x5698bb);}import{SDKError}from'../sdk/index.js';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';import{formatRows}from'../utils/formatters.js';function a22_0x3feb(){const _0x21d648=['setExtra','error','stats','47475GuAAYz','108470gzWpDr','in\x20','file','elapsedTimeMillis','data','name','jobId','catalog','message','1503hoViAI','processedRows','Query\x20completed:\x20Processed\x20','\x20splits','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','8WUnCuD','length','args','join','Catalog:\x20','setJobId','\x20rows\x20','totalSplits','state','Statement\x20','6tqfeYs','1460344ApaLNK','551215GUgDLX','information_schema','4245560wSrlQh','verbose','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','description','setPhase','database','completedSplits','Schema:\x20','494325zNKwbH','query','\x0aAll\x20results\x20saved\x20to\x20','output','930516vVTNxv','Site:\x20','SQL:\x20','Executing\x20query\x20[','site','Error:\x20','options','Executing\x20query...'];a22_0x3feb=function(){return _0x21d648;};return a22_0x3feb();}export class QueryCommand extends BaseCommand{[a22_0x58236f(0x1af)]=a22_0x58236f(0x1cf);[a22_0x58236f(0x1c9)]='Run\x20Trino\x20queries\x20(streaming)';async['execute'](_0x4ede67){const _0x1fcbb7=a22_0x58236f,{options:_0x27b6c7,args:_0x1166ba,tdx:_0x4f4fbe}=_0x4ede67,_0x98e7d1=_0x1166ba[0x0],_0x54b0aa=_0x27b6c7[_0x1fcbb7(0x1e0)];let _0xd65441;if(_0x54b0aa)try{_0xd65441=readSqlStatementsFromFile(_0x54b0aa);}catch(_0x2f2a34){return console['error'](_0x1fcbb7(0x1d7)+_0x2f2a34[_0x1fcbb7(0x1b2)]),0x1;}else try{_0xd65441=splitSqlStatements(_0x98e7d1);}catch(_0x264388){return console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d7)+_0x264388[_0x1fcbb7(0x1b2)]),0x1;}const _0x273f6c=_0x27b6c7[_0x1fcbb7(0x1cb)]||_0x1fcbb7(0x1c5),_0x36105b=_0x27b6c7[_0x1fcbb7(0x1b1)];try{const _0x1b6c81=[],_0x1f4371=!!_0x27b6c7[_0x1fcbb7(0x1d1)];for(let _0x41c134=0x0;_0x41c134<_0xd65441[_0x1fcbb7(0x1b9)];_0x41c134++){const _0x49bd41=_0xd65441[_0x41c134],_0x44572a=_0x41c134+0x1,_0xeedcf8=_0xd65441[_0x1fcbb7(0x1b9)],_0x425442=_0xeedcf8>0x1;_0x27b6c7[_0x1fcbb7(0x1c7)]&&(console[_0x1fcbb7(0x1db)]('\x0a'+(_0x425442?'Statement\x20'+_0x44572a+'/'+_0xeedcf8+':':'')),console['error'](_0x1fcbb7(0x1d3)+_0x27b6c7[_0x1fcbb7(0x1d6)]),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1bc)+(_0x36105b||'td')),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1cd)+_0x273f6c),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d4)+_0x49bd41));const _0x4a0a6e=_0x425442?'Executing\x20statement\x20'+_0x44572a+'/'+_0xeedcf8+'...':_0x1fcbb7(0x1d9);try{const _0x1b689d=await withQuerySpinner(_0x4a0a6e,async _0x4bd638=>{const _0x2d4ac0=_0x1fcbb7,_0x37826e=await _0x4f4fbe[_0x2d4ac0(0x1cf)]['execute'](_0x49bd41,{'catalog':_0x36105b,'schema':_0x273f6c,'onJobId':_0x244cb2=>{const _0x370e45=_0x2d4ac0;_0x4bd638[_0x370e45(0x1bd)](_0x244cb2);},'onProgress':_0x5a4d67=>{const _0x2b0d24=_0x2d4ac0;_0x4bd638[_0x2b0d24(0x1ca)](_0x2b0d24(0x1d5)+_0x5a4d67[_0x2b0d24(0x1c0)]+']'),_0x4bd638[_0x2b0d24(0x1da)](formatRows(_0x5a4d67[_0x2b0d24(0x1b4)])+'\x20rows\x20'+_0x5a4d67[_0x2b0d24(0x1cc)]+'/'+_0x5a4d67[_0x2b0d24(0x1bf)]+_0x2b0d24(0x1b6));}});return _0x37826e;},{'verbose':_0x27b6c7[_0x1fcbb7(0x1c7)]}),_0x4ecaee=_0x1b689d[_0x1fcbb7(0x1ae)],_0x360768=_0x4ecaee[_0x1fcbb7(0x1b0)]?'\x20[Job\x20ID:\x20'+_0x4ecaee[_0x1fcbb7(0x1b0)]+']':'',_0xc7d4c6=_0x425442?_0x1fcbb7(0x1c1)+_0x44572a+'/'+_0xeedcf8+'\x20-\x20':'';console[_0x1fcbb7(0x1db)]('✔\x20'+_0xc7d4c6+_0x1fcbb7(0x1b5)+formatRows(_0x4ecaee['stats'][_0x1fcbb7(0x1b4)])+_0x1fcbb7(0x1be)+(_0x1fcbb7(0x1df)+formatElapsed(_0x4ecaee[_0x1fcbb7(0x1dc)][_0x1fcbb7(0x1ad)])+_0x360768));if(_0x425442&&_0x1f4371){const _0x184f17=resolveOutputOptions(_0x27b6c7),_0xab2eb=await formatQueryOutput(_0x4ecaee,_0x184f17);_0x1b6c81['push'](_0xab2eb);}else await handleQueryOutput(_0x4ecaee,_0x27b6c7);}catch(_0x35fc5d){const _0x52a312=_0x425442?_0x1fcbb7(0x1c1)+_0x44572a+'/'+_0xeedcf8+':\x0a':'',_0x4a83f9=_0x35fc5d instanceof SDKError?_0x35fc5d['originalMessage']:_0x35fc5d[_0x1fcbb7(0x1b2)];return console[_0x1fcbb7(0x1db)](''+_0x52a312+_0x4a83f9),0x1;}}if(_0xd65441[_0x1fcbb7(0x1b9)]>0x1&&_0x1f4371&&_0x1b6c81['length']>0x0){const _0x2e5fdb=_0x1b6c81[_0x1fcbb7(0x1bb)]('\x0a');writeFileSync(_0x27b6c7['output'],_0x2e5fdb),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d0)+_0x27b6c7[_0x1fcbb7(0x1d1)]);}return 0x0;}catch(_0x3d894f){throw _0x3d894f;}}['validate'](_0x59f54f){const _0x6c52b5=a22_0x58236f,_0x5d7d14=_0x59f54f[_0x6c52b5(0x1ba)][0x0],_0x1385c0=_0x59f54f[_0x6c52b5(0x1d8)]['file'];if(!_0x5d7d14&&!_0x1385c0)return _0x6c52b5(0x1c8);if(_0x5d7d14&&_0x1385c0)return _0x6c52b5(0x1b7);return undefined;}}
@@ -1 +1 @@
1
- const a23_0x62bb42=a23_0x42b5;function a23_0x2c1d(){const _0x42b721=['\x20folder','\x20rows\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Fetching\x20parent\x20segment\x20details...','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20type:\x20','limit','1889260MiwHcn','Error:\x20Path\x20or\x20name\x20is\x20required','Resolved\x20relative\x20path\x20to:\x20','jobId','getParent','execute','message','includes','setJobId','✖\x20Query\x20failed\x20[','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Examples:','getParentSQL','parent','Folder\x20ID:\x20','segment:describe','Folder\x20name:\x20','75PwrboY','Creating\x20folder\x20\x27','Resolved\x20parent\x20ID:\x20','in\x20','replace','segment','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','folder','\x27...','getSegment','jsonl','segment:sql','Resolving\x20folder\x20\x27','folderId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveFolderId','log','Executing\x20segment\x20query...','toLocaleString','Fetching\x20SQL\x20for\x20parent\x20segment...','parentId','resolveParentId','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','379SCzQhl','INTERNAL','description','25685165HRQXsi','Parent\x20ID:\x20','data','Usage:\x20tdx\x20segment\x20describe\x20<path>','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x27\x20with\x20ID:\x20','elapsedTimeMillis','type','processedRows','Create\x20segment\x20folder\x20for\x20organization','Resolved\x20folder\x20ID:\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Fetching\x20SQL\x20for\x20segment...','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','12AtuWjZ','Parent\x20segment:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','site','Error:\x20','Listing\x20folders\x20for\x20parent\x20\x27','code','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','6268598XLFSiD','test','cause','\x20\x20Cause:\x20','verbose','Fetching\x20folder\x20details...','63vRaEjo','181752paWuWz','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegmentSQL','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentFolder','getFolder','Parent\x20name:\x20','resolvePathToResource','segmentPath','Resolving\x20parent\x20segment\x20\x27','Fetching\x20segment\x20details...','Resolving\x20path\x20\x27','2532JgawbF','information_schema','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','6143964xWKwxB','Resolving\x20parent\x20folder\x20\x27','✔\x20Created\x20folder\x20\x27','stats','SQL\x20query:\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','6338400EgnFFJ','error','name','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segmentId','length','segment:folder:list','Site:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','5IMVZcC'];a23_0x2c1d=function(){return _0x42b721;};return a23_0x2c1d();}(function(_0x1813f4,_0x158c01){const _0x4940e2=a23_0x42b5,_0x44a436=_0x1813f4();while(!![]){try{const _0x5f5951=parseInt(_0x4940e2(0xca))/0x1*(-parseInt(_0x4940e2(0xf8))/0x2)+-parseInt(_0x4940e2(0x128))/0x3*(-parseInt(_0x4940e2(0xeb))/0x4)+parseInt(_0x4940e2(0x10e))/0x5*(-parseInt(_0x4940e2(0xfc))/0x6)+parseInt(_0x4940e2(0xe4))/0x7+-parseInt(_0x4940e2(0x102))/0x8+parseInt(_0x4940e2(0xea))/0x9*(-parseInt(_0x4940e2(0x117))/0xa)+parseInt(_0x4940e2(0xcd))/0xb*(parseInt(_0x4940e2(0xdb))/0xc);if(_0x5f5951===_0x158c01)break;else _0x44a436['push'](_0x44a436['shift']());}catch(_0x1f81ac){_0x44a436['push'](_0x44a436['shift']());}}}(a23_0x2c1d,0xb6971));function a23_0x42b5(_0x281536,_0x45ed1e){const _0x2c1d40=a23_0x2c1d();return a23_0x42b5=function(_0x42b5b8,_0x283a40){_0x42b5b8=_0x42b5b8-0xb6;let _0x14822f=_0x2c1d40[_0x42b5b8];return _0x14822f;},a23_0x42b5(_0x281536,_0x45ed1e);}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';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0x62bb42(0x104)]=a23_0x62bb42(0x126);[a23_0x62bb42(0xcc)]='Show\x20segment\x20or\x20folder\x20details';async[a23_0x62bb42(0x11c)](_0x919f8c){const _0x387887=a23_0x62bb42,{options:_0x4994ed,args:_0x7ac881,tdx:_0x5e54f3}=_0x919f8c;if(_0x7ac881[_0x387887(0x108)]===0x0)return console[_0x387887(0x103)](_0x387887(0x118)),console[_0x387887(0x103)](_0x387887(0xd0)),console[_0x387887(0x103)]('Examples:'),console[_0x387887(0x103)](_0x387887(0x111)),console[_0x387887(0x103)](_0x387887(0x101)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x41a7ca=_0x7ac881[0x0],_0x446bbb=_0x4994ed['segmentPath'];let _0x4fea9b=_0x41a7ca;_0x446bbb&&!_0x41a7ca[_0x387887(0x11e)]('/')&&(_0x4fea9b=_0x446bbb+'/'+_0x41a7ca,_0x4994ed[_0x387887(0xe8)]&&console[_0x387887(0x103)](_0x387887(0x119)+_0x4fea9b));const _0x3b3638=await withSpinner(_0x387887(0xf7)+_0x4fea9b+_0x387887(0xbb),()=>_0x5e54f3[_0x387887(0xb8)]['resolvePathToResource'](_0x4fea9b),{'verbose':_0x4994ed['verbose']}),_0x230281=_0x3b3638[_0x387887(0xcf)];_0x4994ed['verbose']&&(console['error'](_0x387887(0x115)+_0x230281[_0x387887(0xd4)]),console[_0x387887(0x103)](_0x387887(0xce)+_0x230281['parentId']),_0x230281[_0x387887(0xc0)]&&console[_0x387887(0x103)](_0x387887(0x125)+_0x230281[_0x387887(0xc0)]),_0x230281[_0x387887(0x107)]&&console[_0x387887(0x103)](_0x387887(0x10c)+_0x230281[_0x387887(0x107)]));if(_0x230281[_0x387887(0xd4)]===_0x387887(0x124)){const _0x2880e7=await withSpinner(_0x387887(0x112),()=>_0x5e54f3[_0x387887(0xb8)][_0x387887(0x11b)](_0x230281[_0x387887(0xc7)]),{'verbose':_0x4994ed[_0x387887(0xe8)]});await handleSDKOutput([_0x2880e7[_0x387887(0xcf)]],_0x4994ed);}else{if(_0x230281[_0x387887(0xd4)]===_0x387887(0xba)){if(!_0x230281['folderId'])throw new SDKError(ErrorCode[_0x387887(0xcb)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3374e0=await withSpinner(_0x387887(0xe9),()=>_0x5e54f3['segment'][_0x387887(0xf1)](_0x230281['folderId']),{'verbose':_0x4994ed[_0x387887(0xe8)]});await handleSDKOutput([_0x3374e0['data']],_0x4994ed);}else{if(_0x230281[_0x387887(0xd4)]==='segment'){if(!_0x230281[_0x387887(0x107)])throw new SDKError(ErrorCode['INTERNAL'],_0x387887(0x121));const _0x53d67c=await withSpinner(_0x387887(0xf6),()=>_0x5e54f3['segment'][_0x387887(0xbc)](_0x230281['parentId'],_0x230281[_0x387887(0x107)]),{'verbose':_0x4994ed[_0x387887(0xe8)]});await handleSDKOutput([_0x53d67c[_0x387887(0xcf)]],_0x4994ed);}}}return 0x0;}catch(_0x58bf7f){if(_0x58bf7f instanceof SDKError)return console[_0x387887(0x103)](_0x387887(0xdf)+_0x58bf7f[_0x387887(0x11d)]),_0x58bf7f[_0x387887(0xe6)]&&console[_0x387887(0x103)](_0x387887(0xe7)+_0x58bf7f[_0x387887(0xe6)]),0x1;throw _0x58bf7f;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x62bb42(0x104)]='segment:show';[a23_0x62bb42(0xcc)]=a23_0x62bb42(0xc9);async[a23_0x62bb42(0x11c)](_0x3a89c3){const _0x52b787=a23_0x62bb42,{options:_0x168959,args:_0x17fbff,tdx:_0x3622a7}=_0x3a89c3;if(_0x17fbff[_0x52b787(0x108)]===0x0)return console[_0x52b787(0x103)](_0x52b787(0xc1)),console[_0x52b787(0x103)](_0x52b787(0x10d)),console[_0x52b787(0x103)](_0x52b787(0x122)),console[_0x52b787(0x103)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x52b787(0x103)](_0x52b787(0xec)),console[_0x52b787(0x103)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x57794e=_0x17fbff[0x0],_0x79bda9=_0x168959[_0x52b787(0xf4)];let _0x222d8c=_0x57794e;_0x79bda9&&!_0x57794e['includes']('/')&&(_0x222d8c=_0x79bda9+'/'+_0x57794e,_0x168959[_0x52b787(0xe8)]&&console[_0x52b787(0x103)](_0x52b787(0x119)+_0x222d8c));const _0x583bb1=await withSpinner(_0x52b787(0xf7)+_0x222d8c+'\x27...',()=>_0x3622a7[_0x52b787(0xb8)][_0x52b787(0xf3)](_0x222d8c),{'verbose':_0x168959['verbose']}),_0x379165=_0x583bb1[_0x52b787(0xcf)];_0x168959[_0x52b787(0xe8)]&&(console['error']('Resolved\x20type:\x20'+_0x379165[_0x52b787(0xd4)]),console['error'](_0x52b787(0xce)+_0x379165[_0x52b787(0xc7)]));if(_0x379165[_0x52b787(0xd4)]===_0x52b787(0xba))return console[_0x52b787(0x103)](_0x52b787(0xb9)),console[_0x52b787(0x103)](_0x52b787(0xda)),0x1;let _0x55507d;if(_0x379165['type']==='parent'){const _0x4a9e3f=await withSpinner(_0x52b787(0xc6),()=>_0x3622a7[_0x52b787(0xb8)][_0x52b787(0x123)](_0x379165[_0x52b787(0xc7)]),{'verbose':_0x168959[_0x52b787(0xe8)]});_0x55507d=_0x4a9e3f[_0x52b787(0xcf)];}else{if(!_0x379165['segmentId'])throw new SDKError(ErrorCode[_0x52b787(0xcb)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1cbf4d=await withSpinner(_0x52b787(0xd9),()=>_0x3622a7['segment'][_0x52b787(0xed)](_0x379165[_0x52b787(0xc7)],_0x379165[_0x52b787(0x107)]),{'verbose':_0x168959[_0x52b787(0xe8)]});_0x55507d=_0x1cbf4d[_0x52b787(0xcf)];}const _0x88c316=resolveLimit(_0x168959[_0x52b787(0x116)],DEFAULT_DISPLAY_LIMIT),_0x4f7917=/\bLIMIT\s+\d+/i[_0x52b787(0xe5)](_0x55507d);!_0x4f7917&&(_0x55507d=_0x55507d['trim']()[_0x52b787(0xb7)](/;+$/,''),_0x55507d=_0x52b787(0x113)+_0x55507d+_0x52b787(0x106)+_0x88c316);_0x168959['verbose']&&console['error'](_0x52b787(0x100)+_0x55507d);const _0x309c8f=await withQuerySpinner(_0x52b787(0xc4),async _0x16cd2c=>{const _0x2614a3=_0x52b787,_0x4f7b23=await _0x3622a7['query'][_0x2614a3(0x11c)](_0x55507d,{'catalog':'td','schema':_0x2614a3(0xf9),'onJobId':_0x3ead57=>{const _0x2f9cae=_0x2614a3;_0x16cd2c[_0x2f9cae(0x11f)](_0x3ead57);}});return _0x4f7b23;},{'verbose':_0x168959['verbose']}),_0x427e6b=_0x309c8f[_0x52b787(0xcf)],_0x41a5f2=_0x427e6b[_0x52b787(0x11a)]?'\x20[Job\x20ID:\x20'+_0x427e6b[_0x52b787(0x11a)]+']':'';return console[_0x52b787(0x103)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x427e6b[_0x52b787(0xff)][_0x52b787(0xd5)][_0x52b787(0xc5)]()+_0x52b787(0x110)+(_0x52b787(0xb6)+formatElapsed(_0x427e6b[_0x52b787(0xff)][_0x52b787(0xd3)])+_0x41a5f2)),await handleQueryOutput(_0x427e6b,_0x168959),0x0;}catch(_0x3dc142){if(_0x3dc142 instanceof SDKError)return console[_0x52b787(0x103)](_0x52b787(0x120)+_0x3dc142[_0x52b787(0xe1)]+']'),console[_0x52b787(0x103)]('\x0a'+_0x3dc142[_0x52b787(0x11d)]),0x1;throw _0x3dc142;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x62bb42(0x104)]=a23_0x62bb42(0x109);[a23_0x62bb42(0xcc)]=a23_0x62bb42(0xdd);async[a23_0x62bb42(0x11c)](_0x1dd62a){const _0x54cab8=a23_0x62bb42,{options:_0x1651ec,args:_0x464757,tdx:_0x20d51c}=_0x1dd62a;if(_0x464757[_0x54cab8(0x108)]===0x0)return console[_0x54cab8(0x103)](_0x54cab8(0xee)),console['error'](_0x54cab8(0xe3)),0x1;const _0x4346c7=_0x464757[0x0];try{_0x1651ec['verbose']&&(console[_0x54cab8(0x103)]('Site:\x20'+_0x1651ec[_0x54cab8(0xde)]),console['error'](_0x54cab8(0xf2)+_0x4346c7));const _0x33e124=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4346c7+_0x54cab8(0xbb),()=>_0x20d51c[_0x54cab8(0xb8)][_0x54cab8(0xc8)](_0x4346c7),{'verbose':_0x1651ec[_0x54cab8(0xe8)]}),_0xd026a=_0x33e124['data'];_0x1651ec['verbose']&&console[_0x54cab8(0x103)](_0x54cab8(0x12a)+_0xd026a);const _0x42a0fe=await withSpinner(_0x54cab8(0xe0)+_0x4346c7+'\x27...',()=>_0x20d51c[_0x54cab8(0xb8)]['listFolders'](_0xd026a),{'verbose':_0x1651ec[_0x54cab8(0xe8)]}),_0x314db5=_0x42a0fe['data'];return console[_0x54cab8(0x103)]('✔\x20Found\x20'+_0x314db5[_0x54cab8(0x108)]+_0x54cab8(0x10f)+(_0x314db5[_0x54cab8(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x314db5,_0x1651ec),0x0;}catch(_0x305e9c){if(_0x305e9c instanceof SDKError)return console[_0x54cab8(0x103)]('Error:\x20'+_0x305e9c[_0x54cab8(0x11d)]),_0x305e9c[_0x54cab8(0xe6)]&&console[_0x54cab8(0x103)](_0x54cab8(0xe7)+_0x305e9c[_0x54cab8(0xe6)]),0x1;throw _0x305e9c;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x62bb42(0x104)]='segment:folder:show';[a23_0x62bb42(0xcc)]='Show\x20segment\x20folder\x20details';async[a23_0x62bb42(0x11c)](_0x59e463){const _0x95664=a23_0x62bb42,{options:_0x3764ef,args:_0x548b57,tdx:_0x822daa}=_0x59e463;if(_0x548b57[_0x95664(0x108)]===0x0)return console[_0x95664(0x103)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x95664(0x103)](_0x95664(0x105)),0x1;try{const {parentId:_0x389896,childId:_0x54a3c2}=parseSegmentRef(_0x548b57[0x0]);_0x3764ef[_0x95664(0xe8)]&&(console[_0x95664(0x103)](_0x95664(0x10a)+_0x3764ef[_0x95664(0xde)]),console['error'](_0x95664(0xf2)+_0x389896),_0x54a3c2&&console[_0x95664(0x103)]('Folder\x20name:\x20'+_0x54a3c2));if(!_0x54a3c2)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x214252=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x389896+'\x27...',()=>_0x822daa[_0x95664(0xb8)][_0x95664(0xc8)](_0x389896),{'verbose':_0x3764ef[_0x95664(0xe8)]}),_0x3f0dda=_0x214252['data'];_0x3764ef[_0x95664(0xe8)]&&console[_0x95664(0x103)](_0x95664(0x12a)+_0x3f0dda);const _0x19c51c=await withSpinner(_0x95664(0xbf)+_0x54a3c2+_0x95664(0xbb),()=>_0x822daa[_0x95664(0xb8)][_0x95664(0xc2)](_0x3f0dda,_0x54a3c2),{'verbose':_0x3764ef[_0x95664(0xe8)]}),_0x4fd199=_0x19c51c[_0x95664(0xcf)];_0x3764ef[_0x95664(0xe8)]&&console[_0x95664(0x103)](_0x95664(0xd7)+_0x4fd199);const _0x2405c7=await withSpinner('Fetching\x20folder\x20\x27'+_0x54a3c2+_0x95664(0xbb),()=>_0x822daa[_0x95664(0xb8)][_0x95664(0xf1)](_0x4fd199),{'verbose':_0x3764ef[_0x95664(0xe8)]});return await handleSDKOutput([_0x2405c7[_0x95664(0xcf)]],_0x3764ef),0x0;}catch(_0x3fd690){if(_0x3fd690 instanceof SDKError)return console['error'](_0x95664(0xdf)+_0x3fd690[_0x95664(0x11d)]),_0x3fd690[_0x95664(0xe6)]&&console[_0x95664(0x103)]('\x20\x20Cause:\x20'+_0x3fd690['cause']),0x1;throw _0x3fd690;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a23_0x62bb42(0xbe);[a23_0x62bb42(0xcc)]=a23_0x62bb42(0xd8);async[a23_0x62bb42(0x11c)](_0x3ba52c){const _0x12d677=a23_0x62bb42,{options:_0x37b6eb,args:_0x3e08e9,tdx:_0x59da57}=_0x3ba52c;if(_0x3e08e9[_0x12d677(0x108)]===0x0)return console['error'](_0x12d677(0xc1)),console[_0x12d677(0x103)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x12d677(0x103)](_0x12d677(0x122)),console['error'](_0x12d677(0xfb)),console[_0x12d677(0x103)](_0x12d677(0xef)),console['error'](_0x12d677(0x114)),0x1;try{const _0x15684e=_0x3e08e9[0x0],_0x39c0c6=_0x37b6eb[_0x12d677(0xf4)];let _0x4a3d28=_0x15684e;_0x39c0c6&&!_0x15684e[_0x12d677(0x11e)]('/')&&(_0x4a3d28=_0x39c0c6+'/'+_0x15684e,_0x37b6eb[_0x12d677(0xe8)]&&console['error'](_0x12d677(0x119)+_0x4a3d28));const _0x48b392=await withSpinner(_0x12d677(0xf7)+_0x4a3d28+_0x12d677(0xbb),()=>_0x59da57['segment'][_0x12d677(0xf3)](_0x4a3d28),{'verbose':_0x37b6eb[_0x12d677(0xe8)]}),_0x2f2003=_0x48b392[_0x12d677(0xcf)];_0x37b6eb[_0x12d677(0xe8)]&&(console[_0x12d677(0x103)](_0x12d677(0x115)+_0x2f2003[_0x12d677(0xd4)]),console[_0x12d677(0x103)](_0x12d677(0xce)+_0x2f2003[_0x12d677(0xc7)]));if(_0x2f2003['type']==='folder')return console[_0x12d677(0x103)](_0x12d677(0xe2)),console['error'](_0x12d677(0xd1)),0x1;let _0x1b215a;if(_0x2f2003[_0x12d677(0xd4)]==='parent'){const _0x2bd21d=await withSpinner(_0x12d677(0xc6),()=>_0x59da57[_0x12d677(0xb8)][_0x12d677(0x123)](_0x2f2003['parentId']),{'verbose':_0x37b6eb[_0x12d677(0xe8)]});_0x1b215a=_0x2bd21d['data'];}else{if(!_0x2f2003[_0x12d677(0x107)])throw new SDKError(ErrorCode[_0x12d677(0xcb)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4ca8c2=await withSpinner(_0x12d677(0xd9),()=>_0x59da57[_0x12d677(0xb8)]['getSegmentSQL'](_0x2f2003[_0x12d677(0xc7)],_0x2f2003[_0x12d677(0x107)]),{'verbose':_0x37b6eb[_0x12d677(0xe8)]});_0x1b215a=_0x4ca8c2[_0x12d677(0xcf)];}return _0x37b6eb['format']==='json'||_0x37b6eb['format']===_0x12d677(0xbd)?await handleSDKOutput([{'sql':_0x1b215a}],_0x37b6eb):console[_0x12d677(0xc3)](_0x1b215a),0x0;}catch(_0x3734dd){if(_0x3734dd instanceof SDKError)return console[_0x12d677(0x103)](_0x12d677(0xdf)+_0x3734dd[_0x12d677(0x11d)]),_0x3734dd[_0x12d677(0xe6)]&&console['error']('\x20\x20Cause:\x20'+_0x3734dd[_0x12d677(0xe6)]),0x1;throw _0x3734dd;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x62bb42(0x104)]='segment:folder:create';[a23_0x62bb42(0xcc)]=a23_0x62bb42(0xd6);async[a23_0x62bb42(0x11c)](_0x567a8e){const _0x369710=a23_0x62bb42,{options:_0x45d6fc,args:_0x4c0e9c,tdx:_0x170270}=_0x567a8e,_0x524f4c=_0x45d6fc;if(_0x4c0e9c['length']<0x2)return console[_0x369710(0x103)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x369710(0x103)](_0x369710(0x10b)),0x1;const _0x44d7fa=_0x4c0e9c[0x0],_0x5f366a=_0x4c0e9c[0x1];_0x524f4c['verbose']&&(console[_0x369710(0x103)](_0x369710(0x10a)+_0x524f4c[_0x369710(0xde)]),console[_0x369710(0x103)](_0x369710(0xdc)+_0x44d7fa),console[_0x369710(0x103)](_0x369710(0x127)+_0x5f366a));let _0x248267;if(_0x524f4c['parentFolder']){const _0x288eb9=_0x524f4c[_0x369710(0xf0)],_0x27e6d0=await withSpinner(_0x369710(0xf5)+_0x44d7fa+_0x369710(0xbb),()=>_0x170270[_0x369710(0xb8)]['resolveParentId'](_0x44d7fa),{'verbose':_0x524f4c['verbose']}),_0x4da2a6=_0x27e6d0[_0x369710(0xcf)],_0x39b7b7=await withSpinner(_0x369710(0xfd)+_0x288eb9+_0x369710(0xbb),()=>_0x170270[_0x369710(0xb8)]['resolveFolderId'](_0x4da2a6,_0x288eb9),{'verbose':_0x524f4c['verbose']});_0x248267=_0x39b7b7[_0x369710(0xcf)],_0x524f4c[_0x369710(0xe8)]&&console[_0x369710(0x103)](_0x369710(0xfa)+_0x248267);}const _0x419a64={'name':_0x5f366a,'description':_0x524f4c['description'],'parentFolderId':_0x248267},_0x1fafea=await withSpinner(_0x369710(0x129)+_0x5f366a+_0x369710(0xbb),()=>_0x170270[_0x369710(0xb8)]['createFolder'](_0x44d7fa,_0x419a64),{'verbose':_0x524f4c[_0x369710(0xe8)]}),_0x2c3ba0=_0x1fafea[_0x369710(0xcf)];return console['error'](_0x369710(0xfe)+_0x2c3ba0[_0x369710(0x104)]+_0x369710(0xd2)+_0x2c3ba0['id']),await handleSDKOutput([_0x2c3ba0],_0x524f4c),0x0;}}
1
+ const a23_0x3e213e=a23_0x4b7e;function a23_0x4b7e(_0x24336d,_0x2afc19){const _0xf450b2=a23_0xf450();return a23_0x4b7e=function(_0x4b7e4b,_0x572c13){_0x4b7e4b=_0x4b7e4b-0x1ed;let _0x3c939d=_0xf450b2[_0x4b7e4b];return _0x3c939d;},a23_0x4b7e(_0x24336d,_0x2afc19);}(function(_0x2b7188,_0xbcd18a){const _0x247973=a23_0x4b7e,_0x225dc3=_0x2b7188();while(!![]){try{const _0x276d64=parseInt(_0x247973(0x217))/0x1+parseInt(_0x247973(0x227))/0x2*(parseInt(_0x247973(0x1ef))/0x3)+parseInt(_0x247973(0x20c))/0x4+-parseInt(_0x247973(0x22b))/0x5+parseInt(_0x247973(0x212))/0x6+parseInt(_0x247973(0x251))/0x7*(parseInt(_0x247973(0x23e))/0x8)+parseInt(_0x247973(0x25a))/0x9*(-parseInt(_0x247973(0x239))/0xa);if(_0x276d64===_0xbcd18a)break;else _0x225dc3['push'](_0x225dc3['shift']());}catch(_0x3cb30b){_0x225dc3['push'](_0x225dc3['shift']());}}}(a23_0xf450,0xdc9d3));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';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a23_0xf450(){const _0x440596=['Fetching\x20parent\x20segment\x20details...','resolveParentId','✔\x20Found\x20','resolvePathToResource','segment','Create\x20segment\x20folder\x20for\x20organization','✖\x20Query\x20failed\x20[','cause','439515OEZUZQ','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','segment:show','Usage:\x20tdx\x20segment\x20sql\x20<path>','Creating\x20folder\x20\x27','createFolder','elapsedTimeMillis','Resolved\x20parent\x20folder\x20ID:\x20','listFolders','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','1636773AMBahh','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','replace','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','json','parent','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','getParentSQL','execute','limit','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','data','information_schema','parentFolder','segment:folder:list','stats','Resolved\x20type:\x20','Fetching\x20segment\x20details...','Parent\x20name:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','log','segmentPath','verbose','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20ID\x20missing\x20from\x20resolved\x20path','7010384kwhQej','segment:sql','Executing\x20segment\x20query...','\x20rows\x20','site','Resolved\x20folder\x20ID:\x20','8749266XhbpAR','code','Resolved\x20relative\x20path\x20to:\x20','getSegment','Examples:','1746112cEjduq','name','message','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','parentId','Folder\x20name:\x20','Resolving\x20path\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','type','\x27...','INTERNAL','includes','Parent\x20ID:\x20','\x20[Job\x20ID:\x20','2qlCOsG','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolveFolderId','Resolving\x20folder\x20\x27','8253395WaiQwC','format','trim','query','length','Resolving\x20parent\x20segment\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','setJobId','\x20folder','SQL\x20query:\x0a','Error:\x20','getSegmentSQL','950iGZOCk','Show\x20segment\x20folder\x20details','segment:describe','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20show\x20<path>','88PMOTKJ','getFolder','Error:\x20Path\x20or\x20name\x20is\x20required','error','Parent\x20segment:\x20','Resolved\x20parent\x20ID:\x20','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','SELECT\x20*\x20FROM\x20(\x0a','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folder','description','segmentId','in\x20','jsonl','segment:folder:show','folderId','processedRows','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','1076173BFJWhY'];a23_0xf450=function(){return _0x440596;};return a23_0xf450();}export class SegmentDescribeCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x23b);[a23_0x3e213e(0x249)]='Show\x20segment\x20or\x20folder\x20details';async[a23_0x3e213e(0x1f9)](_0x215a2a){const _0x2d3a3b=a23_0x3e213e,{options:_0x416a24,args:_0x15271e,tdx:_0x4c406a}=_0x215a2a;if(_0x15271e['length']===0x0)return console[_0x2d3a3b(0x241)](_0x2d3a3b(0x240)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1ee)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x216)),console['error'](_0x2d3a3b(0x1f0)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x247)),console[_0x2d3a3b(0x241)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x40f754=_0x15271e[0x0],_0x40b289=_0x416a24[_0x2d3a3b(0x207)];let _0x1b2465=_0x40f754;_0x40b289&&!_0x40f754[_0x2d3a3b(0x224)]('/')&&(_0x1b2465=_0x40b289+'/'+_0x40f754,_0x416a24[_0x2d3a3b(0x208)]&&console['error'](_0x2d3a3b(0x214)+_0x1b2465));const _0x3076b3=await withSpinner(_0x2d3a3b(0x21f)+_0x1b2465+_0x2d3a3b(0x222),()=>_0x4c406a['segment'][_0x2d3a3b(0x255)](_0x1b2465),{'verbose':_0x416a24[_0x2d3a3b(0x208)]}),_0xe05657=_0x3076b3[_0x2d3a3b(0x1fd)];_0x416a24[_0x2d3a3b(0x208)]&&(console['error']('Resolved\x20type:\x20'+_0xe05657['type']),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x225)+_0xe05657[_0x2d3a3b(0x21d)]),_0xe05657[_0x2d3a3b(0x24e)]&&console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1f6)+_0xe05657[_0x2d3a3b(0x24e)]),_0xe05657[_0x2d3a3b(0x24a)]&&console[_0x2d3a3b(0x241)]('Segment\x20ID:\x20'+_0xe05657['segmentId']));if(_0xe05657[_0x2d3a3b(0x221)]===_0x2d3a3b(0x1f5)){const _0x37319f=await withSpinner(_0x2d3a3b(0x252),()=>_0x4c406a[_0x2d3a3b(0x256)]['getParent'](_0xe05657[_0x2d3a3b(0x21d)]),{'verbose':_0x416a24['verbose']});await handleSDKOutput([_0x37319f[_0x2d3a3b(0x1fd)]],_0x416a24);}else{if(_0xe05657[_0x2d3a3b(0x221)]===_0x2d3a3b(0x248)){if(!_0xe05657[_0x2d3a3b(0x24e)])throw new SDKError(ErrorCode['INTERNAL'],_0x2d3a3b(0x20b));const _0x19477c=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4c406a['segment'][_0x2d3a3b(0x23f)](_0xe05657[_0x2d3a3b(0x24e)]),{'verbose':_0x416a24['verbose']});await handleSDKOutput([_0x19477c[_0x2d3a3b(0x1fd)]],_0x416a24);}else{if(_0xe05657['type']===_0x2d3a3b(0x256)){if(!_0xe05657[_0x2d3a3b(0x24a)])throw new SDKError(ErrorCode['INTERNAL'],_0x2d3a3b(0x20a));const _0x18a418=await withSpinner(_0x2d3a3b(0x203),()=>_0x4c406a[_0x2d3a3b(0x256)][_0x2d3a3b(0x215)](_0xe05657[_0x2d3a3b(0x21d)],_0xe05657[_0x2d3a3b(0x24a)]),{'verbose':_0x416a24[_0x2d3a3b(0x208)]});await handleSDKOutput([_0x18a418[_0x2d3a3b(0x1fd)]],_0x416a24);}}}return 0x0;}catch(_0x621d01){if(_0x621d01 instanceof SDKError)return console[_0x2d3a3b(0x241)](_0x2d3a3b(0x237)+_0x621d01[_0x2d3a3b(0x219)]),_0x621d01[_0x2d3a3b(0x259)]&&console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1ed)+_0x621d01['cause']),0x1;throw _0x621d01;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x25c);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x244);async['execute'](_0x525a49){const _0x509524=a23_0x3e213e,{options:_0x382e5f,args:_0x1d2df0,tdx:_0x67a05d}=_0x525a49;if(_0x1d2df0[_0x509524(0x22f)]===0x0)return console[_0x509524(0x241)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x509524(0x241)](_0x509524(0x23d)),console[_0x509524(0x241)]('Examples:'),console[_0x509524(0x241)](_0x509524(0x233)),console[_0x509524(0x241)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x509524(0x241)](_0x509524(0x21a)),0x1;try{const _0x1990ce=_0x1d2df0[0x0],_0x2e228a=_0x382e5f[_0x509524(0x207)];let _0x441039=_0x1990ce;_0x2e228a&&!_0x1990ce[_0x509524(0x224)]('/')&&(_0x441039=_0x2e228a+'/'+_0x1990ce,_0x382e5f[_0x509524(0x208)]&&console['error'](_0x509524(0x214)+_0x441039));const _0x5699ad=await withSpinner(_0x509524(0x21f)+_0x441039+_0x509524(0x222),()=>_0x67a05d[_0x509524(0x256)][_0x509524(0x255)](_0x441039),{'verbose':_0x382e5f[_0x509524(0x208)]}),_0x4210f3=_0x5699ad['data'];_0x382e5f[_0x509524(0x208)]&&(console['error'](_0x509524(0x202)+_0x4210f3[_0x509524(0x221)]),console[_0x509524(0x241)](_0x509524(0x225)+_0x4210f3[_0x509524(0x21d)]));if(_0x4210f3[_0x509524(0x221)]===_0x509524(0x248))return console[_0x509524(0x241)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x509524(0x241)](_0x509524(0x21c)),0x1;let _0x23bbd5;if(_0x4210f3['type']===_0x509524(0x1f5)){const _0x29c2ed=await withSpinner(_0x509524(0x205),()=>_0x67a05d[_0x509524(0x256)][_0x509524(0x1f8)](_0x4210f3[_0x509524(0x21d)]),{'verbose':_0x382e5f['verbose']});_0x23bbd5=_0x29c2ed['data'];}else{if(!_0x4210f3[_0x509524(0x24a)])throw new SDKError(ErrorCode[_0x509524(0x223)],_0x509524(0x20a));const _0x3e6d24=await withSpinner(_0x509524(0x1f2),()=>_0x67a05d['segment'][_0x509524(0x238)](_0x4210f3[_0x509524(0x21d)],_0x4210f3[_0x509524(0x24a)]),{'verbose':_0x382e5f[_0x509524(0x208)]});_0x23bbd5=_0x3e6d24['data'];}const _0x5c77f3=resolveLimit(_0x382e5f[_0x509524(0x1fa)],DEFAULT_DISPLAY_LIMIT),_0x254abf=/\bLIMIT\s+\d+/i['test'](_0x23bbd5);!_0x254abf&&(_0x23bbd5=_0x23bbd5[_0x509524(0x22d)]()[_0x509524(0x1f1)](/;+$/,''),_0x23bbd5=_0x509524(0x245)+_0x23bbd5+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5c77f3);_0x382e5f[_0x509524(0x208)]&&console['error'](_0x509524(0x236)+_0x23bbd5);const _0xeab6ef=await withQuerySpinner(_0x509524(0x20e),async _0x1eb133=>{const _0xe8595d=_0x509524,_0x1c9c2f=await _0x67a05d[_0xe8595d(0x22e)][_0xe8595d(0x1f9)](_0x23bbd5,{'catalog':'td','schema':_0xe8595d(0x1fe),'onJobId':_0x380cdb=>{const _0x181c6d=_0xe8595d;_0x1eb133[_0x181c6d(0x234)](_0x380cdb);}});return _0x1c9c2f;},{'verbose':_0x382e5f[_0x509524(0x208)]}),_0x54244c=_0xeab6ef[_0x509524(0x1fd)],_0x5d9aa9=_0x54244c['jobId']?_0x509524(0x226)+_0x54244c['jobId']+']':'';return console[_0x509524(0x241)](_0x509524(0x220)+_0x54244c[_0x509524(0x201)][_0x509524(0x24f)]['toLocaleString']()+_0x509524(0x20f)+(_0x509524(0x24b)+formatElapsed(_0x54244c['stats'][_0x509524(0x260)])+_0x5d9aa9)),await handleQueryOutput(_0x54244c,_0x382e5f),0x0;}catch(_0x272607){if(_0x272607 instanceof SDKError)return console['error'](_0x509524(0x258)+_0x272607[_0x509524(0x213)]+']'),console[_0x509524(0x241)]('\x0a'+_0x272607[_0x509524(0x219)]),0x1;throw _0x272607;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x200);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x1fc);async['execute'](_0x4d729e){const _0x12225a=a23_0x3e213e,{options:_0x37c974,args:_0x2b3861,tdx:_0x5e65e3}=_0x4d729e;if(_0x2b3861[_0x12225a(0x22f)]===0x0)return console['error'](_0x12225a(0x23c)),console[_0x12225a(0x241)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x15da0e=_0x2b3861[0x0];try{_0x37c974['verbose']&&(console[_0x12225a(0x241)](_0x12225a(0x232)+_0x37c974[_0x12225a(0x210)]),console[_0x12225a(0x241)](_0x12225a(0x204)+_0x15da0e));const _0x370c5d=await withSpinner(_0x12225a(0x230)+_0x15da0e+_0x12225a(0x222),()=>_0x5e65e3[_0x12225a(0x256)][_0x12225a(0x253)](_0x15da0e),{'verbose':_0x37c974['verbose']}),_0x4ab582=_0x370c5d[_0x12225a(0x1fd)];_0x37c974[_0x12225a(0x208)]&&console[_0x12225a(0x241)](_0x12225a(0x243)+_0x4ab582);const _0x23fd43=await withSpinner(_0x12225a(0x231)+_0x15da0e+'\x27...',()=>_0x5e65e3['segment'][_0x12225a(0x262)](_0x4ab582),{'verbose':_0x37c974[_0x12225a(0x208)]}),_0x40bf6d=_0x23fd43[_0x12225a(0x1fd)];return console[_0x12225a(0x241)](_0x12225a(0x254)+_0x40bf6d[_0x12225a(0x22f)]+_0x12225a(0x235)+(_0x40bf6d[_0x12225a(0x22f)]!==0x1?'s':'')),await handleSDKOutput(_0x40bf6d,_0x37c974),0x0;}catch(_0x59ba4f){if(_0x59ba4f instanceof SDKError)return console[_0x12225a(0x241)](_0x12225a(0x237)+_0x59ba4f[_0x12225a(0x219)]),_0x59ba4f[_0x12225a(0x259)]&&console[_0x12225a(0x241)](_0x12225a(0x1ed)+_0x59ba4f[_0x12225a(0x259)]),0x1;throw _0x59ba4f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x24d);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x23a);async[a23_0x3e213e(0x1f9)](_0x371f36){const _0x2dad99=a23_0x3e213e,{options:_0x698d67,args:_0x4fddfc,tdx:_0x2dbca9}=_0x371f36;if(_0x4fddfc[_0x2dad99(0x22f)]===0x0)return console[_0x2dad99(0x241)](_0x2dad99(0x21b)),console[_0x2dad99(0x241)](_0x2dad99(0x1f7)),0x1;try{const {parentId:_0x17dd56,childId:_0x45b978}=parseSegmentRef(_0x4fddfc[0x0]);_0x698d67['verbose']&&(console[_0x2dad99(0x241)](_0x2dad99(0x232)+_0x698d67['site']),console[_0x2dad99(0x241)](_0x2dad99(0x204)+_0x17dd56),_0x45b978&&console[_0x2dad99(0x241)](_0x2dad99(0x21e)+_0x45b978));if(!_0x45b978)return console[_0x2dad99(0x241)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x3de28c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x17dd56+_0x2dad99(0x222),()=>_0x2dbca9['segment'][_0x2dad99(0x253)](_0x17dd56),{'verbose':_0x698d67['verbose']}),_0x9742d=_0x3de28c['data'];_0x698d67['verbose']&&console[_0x2dad99(0x241)]('Resolved\x20parent\x20ID:\x20'+_0x9742d);const _0x4aba10=await withSpinner(_0x2dad99(0x22a)+_0x45b978+'\x27...',()=>_0x2dbca9['segment'][_0x2dad99(0x229)](_0x9742d,_0x45b978),{'verbose':_0x698d67[_0x2dad99(0x208)]}),_0x447a45=_0x4aba10[_0x2dad99(0x1fd)];_0x698d67['verbose']&&console[_0x2dad99(0x241)](_0x2dad99(0x211)+_0x447a45);const _0x1b35ba=await withSpinner('Fetching\x20folder\x20\x27'+_0x45b978+'\x27...',()=>_0x2dbca9[_0x2dad99(0x256)][_0x2dad99(0x23f)](_0x447a45),{'verbose':_0x698d67[_0x2dad99(0x208)]});return await handleSDKOutput([_0x1b35ba[_0x2dad99(0x1fd)]],_0x698d67),0x0;}catch(_0x57e6d0){if(_0x57e6d0 instanceof SDKError)return console[_0x2dad99(0x241)](_0x2dad99(0x237)+_0x57e6d0[_0x2dad99(0x219)]),_0x57e6d0[_0x2dad99(0x259)]&&console['error'](_0x2dad99(0x1ed)+_0x57e6d0[_0x2dad99(0x259)]),0x1;throw _0x57e6d0;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x20d);['description']=a23_0x3e213e(0x209);async[a23_0x3e213e(0x1f9)](_0x1e717d){const _0x507432=a23_0x3e213e,{options:_0x28627e,args:_0x308e6b,tdx:_0x497630}=_0x1e717d;if(_0x308e6b[_0x507432(0x22f)]===0x0)return console['error'](_0x507432(0x1fb)),console[_0x507432(0x241)](_0x507432(0x25d)),console['error'](_0x507432(0x216)),console[_0x507432(0x241)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x507432(0x241)](_0x507432(0x1f3)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x29942d=_0x308e6b[0x0],_0x1be7fc=_0x28627e[_0x507432(0x207)];let _0x1e9411=_0x29942d;_0x1be7fc&&!_0x29942d[_0x507432(0x224)]('/')&&(_0x1e9411=_0x1be7fc+'/'+_0x29942d,_0x28627e[_0x507432(0x208)]&&console[_0x507432(0x241)](_0x507432(0x214)+_0x1e9411));const _0x3b5089=await withSpinner(_0x507432(0x21f)+_0x1e9411+'\x27...',()=>_0x497630[_0x507432(0x256)][_0x507432(0x255)](_0x1e9411),{'verbose':_0x28627e['verbose']}),_0x56e538=_0x3b5089[_0x507432(0x1fd)];_0x28627e[_0x507432(0x208)]&&(console[_0x507432(0x241)](_0x507432(0x202)+_0x56e538[_0x507432(0x221)]),console[_0x507432(0x241)](_0x507432(0x225)+_0x56e538[_0x507432(0x21d)]));if(_0x56e538[_0x507432(0x221)]==='folder')return console[_0x507432(0x241)](_0x507432(0x25b)),console[_0x507432(0x241)](_0x507432(0x246)),0x1;let _0x60f1c0;if(_0x56e538[_0x507432(0x221)]===_0x507432(0x1f5)){const _0x335d11=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x497630['segment'][_0x507432(0x1f8)](_0x56e538[_0x507432(0x21d)]),{'verbose':_0x28627e[_0x507432(0x208)]});_0x60f1c0=_0x335d11[_0x507432(0x1fd)];}else{if(!_0x56e538[_0x507432(0x24a)])throw new SDKError(ErrorCode[_0x507432(0x223)],_0x507432(0x20a));const _0x4c96fa=await withSpinner(_0x507432(0x1f2),()=>_0x497630['segment'][_0x507432(0x238)](_0x56e538[_0x507432(0x21d)],_0x56e538['segmentId']),{'verbose':_0x28627e[_0x507432(0x208)]});_0x60f1c0=_0x4c96fa[_0x507432(0x1fd)];}return _0x28627e[_0x507432(0x22c)]===_0x507432(0x1f4)||_0x28627e[_0x507432(0x22c)]===_0x507432(0x24c)?await handleSDKOutput([{'sql':_0x60f1c0}],_0x28627e):console[_0x507432(0x206)](_0x60f1c0),0x0;}catch(_0x43ea05){if(_0x43ea05 instanceof SDKError)return console[_0x507432(0x241)](_0x507432(0x237)+_0x43ea05[_0x507432(0x219)]),_0x43ea05[_0x507432(0x259)]&&console[_0x507432(0x241)]('\x20\x20Cause:\x20'+_0x43ea05[_0x507432(0x259)]),0x1;throw _0x43ea05;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x3e213e(0x218)]='segment:folder:create';[a23_0x3e213e(0x249)]=a23_0x3e213e(0x257);async['execute'](_0x2a21b3){const _0x2d0d66=a23_0x3e213e,{options:_0x3ca8da,args:_0x43091b,tdx:_0x4899f6}=_0x2a21b3,_0x498ce7=_0x3ca8da;if(_0x43091b['length']<0x2)return console[_0x2d0d66(0x241)](_0x2d0d66(0x250)),console[_0x2d0d66(0x241)](_0x2d0d66(0x228)),0x1;const _0x4e9f11=_0x43091b[0x0],_0x26bede=_0x43091b[0x1];_0x498ce7[_0x2d0d66(0x208)]&&(console[_0x2d0d66(0x241)](_0x2d0d66(0x232)+_0x498ce7[_0x2d0d66(0x210)]),console['error'](_0x2d0d66(0x242)+_0x4e9f11),console[_0x2d0d66(0x241)]('Folder\x20name:\x20'+_0x26bede));let _0x108872;if(_0x498ce7[_0x2d0d66(0x1ff)]){const _0x35945c=_0x498ce7['parentFolder'],_0x55fa55=await withSpinner(_0x2d0d66(0x230)+_0x4e9f11+'\x27...',()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x253)](_0x4e9f11),{'verbose':_0x498ce7[_0x2d0d66(0x208)]}),_0x200da4=_0x55fa55[_0x2d0d66(0x1fd)],_0x4bafff=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x35945c+_0x2d0d66(0x222),()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x229)](_0x200da4,_0x35945c),{'verbose':_0x498ce7[_0x2d0d66(0x208)]});_0x108872=_0x4bafff['data'],_0x498ce7['verbose']&&console[_0x2d0d66(0x241)](_0x2d0d66(0x261)+_0x108872);}const _0x205d7f={'name':_0x26bede,'description':_0x498ce7[_0x2d0d66(0x249)],'parentFolderId':_0x108872},_0x56de02=await withSpinner(_0x2d0d66(0x25e)+_0x26bede+_0x2d0d66(0x222),()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x25f)](_0x4e9f11,_0x205d7f),{'verbose':_0x498ce7[_0x2d0d66(0x208)]}),_0x242346=_0x56de02[_0x2d0d66(0x1fd)];return console[_0x2d0d66(0x241)]('✔\x20Created\x20folder\x20\x27'+_0x242346['name']+'\x27\x20with\x20ID:\x20'+_0x242346['id']),await handleSDKOutput([_0x242346],_0x498ce7),0x0;}}
@@ -1 +1 @@
1
- const a24_0x53d9cf=a24_0x4303;function a24_0x4303(_0x4fc0c7,_0x3c3729){const _0x431183=a24_0x4311();return a24_0x4303=function(_0x430353,_0x2b3eeb){_0x430353=_0x430353-0x155;let _0x1dbd7b=_0x431183[_0x430353];return _0x1dbd7b;},a24_0x4303(_0x4fc0c7,_0x3c3729);}(function(_0x27124f,_0x262783){const _0x5e314e=a24_0x4303,_0xb29c0c=_0x27124f();while(!![]){try{const _0x2bde9c=parseInt(_0x5e314e(0x163))/0x1+-parseInt(_0x5e314e(0x16c))/0x2*(parseInt(_0x5e314e(0x155))/0x3)+parseInt(_0x5e314e(0x159))/0x4+-parseInt(_0x5e314e(0x16e))/0x5*(parseInt(_0x5e314e(0x15b))/0x6)+-parseInt(_0x5e314e(0x179))/0x7+-parseInt(_0x5e314e(0x171))/0x8*(parseInt(_0x5e314e(0x15f))/0x9)+-parseInt(_0x5e314e(0x17c))/0xa*(-parseInt(_0x5e314e(0x16a))/0xb);if(_0x2bde9c===_0x262783)break;else _0xb29c0c['push'](_0xb29c0c['shift']());}catch(_0x454589){_0xb29c0c['push'](_0xb29c0c['shift']());}}}(a24_0x4311,0x85a84));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';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a24_0x53d9cf(0x184)]=a24_0x53d9cf(0x160);async[a24_0x53d9cf(0x173)](_0x1fe1c9){const _0x50a27d=a24_0x53d9cf,{options:_0x2a2d23,args:_0xf540f6,tdx:_0x2279bc}=_0x1fe1c9,_0x4ba9d3=_0x2a2d23;if(_0xf540f6['length']===0x0)return console['error'](_0x50a27d(0x172)),console['error'](_0x50a27d(0x181)),console['error'](_0x50a27d(0x187)),console[_0x50a27d(0x157)](_0x50a27d(0x15a)),console[_0x50a27d(0x157)](_0x50a27d(0x16f)),console[_0x50a27d(0x157)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x37ac63=_0xf540f6[0x0],_0x5d8c67=_0x2a2d23[_0x50a27d(0x178)];let _0x15c07e=_0x37ac63;_0x5d8c67&&!_0x37ac63[_0x50a27d(0x158)]('/')&&(_0x15c07e=_0x5d8c67+'/'+_0x37ac63,_0x4ba9d3[_0x50a27d(0x164)]&&console[_0x50a27d(0x157)](_0x50a27d(0x182)+_0x15c07e));const _0x5740d5=parsePath(_0x15c07e);if(_0x5740d5[_0x50a27d(0x186)][_0x50a27d(0x17f)]<0x2)return console[_0x50a27d(0x157)](_0x50a27d(0x168)),console[_0x50a27d(0x157)](_0x50a27d(0x169)),0x1;const _0x4bf7db=_0x5740d5['segments'][0x0],_0x41baa3=getBaseName(_0x15c07e),_0x3d3ec0=getParentPath(_0x15c07e);_0x4ba9d3['verbose']&&(console[_0x50a27d(0x157)](_0x50a27d(0x17e)+_0x4ba9d3['site']),console[_0x50a27d(0x157)]('Target\x20path:\x20'+_0x15c07e),console['error'](_0x50a27d(0x15e)+_0x4bf7db),console['error'](_0x50a27d(0x162)+_0x41baa3),console[_0x50a27d(0x157)](_0x50a27d(0x166)+_0x3d3ec0));const _0x2cecc8=await withSpinner(_0x50a27d(0x156)+_0x4bf7db+_0x50a27d(0x175),()=>_0x2279bc[_0x50a27d(0x188)][_0x50a27d(0x174)](_0x4bf7db),{'verbose':_0x4ba9d3['verbose']}),_0x35a28b=_0x2cecc8['data'];let _0x9e0627;if(_0x5740d5[_0x50a27d(0x186)][_0x50a27d(0x17f)]>0x2){const _0xd91013=await withSpinner(_0x50a27d(0x15d)+_0x3d3ec0+_0x50a27d(0x175),()=>_0x2279bc[_0x50a27d(0x188)][_0x50a27d(0x167)](_0x3d3ec0),{'verbose':_0x4ba9d3['verbose']}),_0x4d6cdc=_0xd91013['data'];if(_0x4d6cdc[_0x50a27d(0x15c)]!==_0x50a27d(0x183)&&_0x4d6cdc[_0x50a27d(0x15c)]!==_0x50a27d(0x161))return console[_0x50a27d(0x157)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x9e0627=_0x4d6cdc[_0x50a27d(0x170)];}else{if(_0x4ba9d3['folder']){const _0x4efe1f=await withSpinner(_0x50a27d(0x165)+_0x4ba9d3['folder']+'\x27...',()=>_0x2279bc[_0x50a27d(0x188)][_0x50a27d(0x17b)](_0x35a28b,_0x4ba9d3['folder']),{'verbose':_0x4ba9d3[_0x50a27d(0x164)]});_0x9e0627=_0x4efe1f[_0x50a27d(0x189)];}}_0x4ba9d3['verbose']&&_0x9e0627&&console[_0x50a27d(0x157)](_0x50a27d(0x180)+_0x9e0627);const _0x5dda47=await loadJSONFromOptions(_0x4ba9d3['rule'],_0x4ba9d3[_0x50a27d(0x17d)]),_0x1543fb={'name':_0x41baa3,'description':_0x4ba9d3[_0x50a27d(0x184)],'rule':_0x5dda47,'kind':_0x4ba9d3[_0x50a27d(0x185)]!==undefined?parseInt(_0x4ba9d3['kind'],0xa):undefined,'isVisible':_0x4ba9d3[_0x50a27d(0x16b)]?![]:undefined,'segmentFolderId':_0x9e0627,'countPopulation':_0x4ba9d3[_0x50a27d(0x17a)]?![]:undefined},_0x56d885=await withSpinner(_0x50a27d(0x176)+_0x41baa3+_0x50a27d(0x175),()=>_0x2279bc['segment'][_0x50a27d(0x177)](_0x35a28b,_0x1543fb),{'verbose':_0x4ba9d3[_0x50a27d(0x164)]}),_0x35b1b9=_0x56d885[_0x50a27d(0x189)];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x35b1b9[_0x50a27d(0x16d)]+_0x50a27d(0x18a)+_0x35b1b9['id']),_0x15c07e!==_0x37ac63&&console[_0x50a27d(0x157)]('\x20\x20\x20Path:\x20'+_0x15c07e),await handleSDKOutput([_0x35b1b9],_0x4ba9d3),0x0;}}function a24_0x4311(){const _0x26d237=['Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','folder','description','kind','segments','Examples:','segment','data','\x27\x20with\x20ID:\x20','243pUpPnW','Resolving\x20parent\x20segment\x20\x27','error','includes','1755344tMCLTp','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','60EDKpZr','type','Resolving\x20folder\x20path\x20\x27','Parent:\x20','17559UUYDxf','Create\x20child\x20segment\x20with\x20filtering\x20rules','parent','Segment\x20name:\x20','181871YgpgYt','verbose','Resolving\x20folder\x20\x27','Parent\x20path:\x20','resolvePathToResource','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','53141qtbTHn','invisible','21212ZYRXjf','name','252705oWzXID','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','folderId','3064DqKxGl','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','resolveParentId','\x27...','Creating\x20segment\x20\x27','createSegment','segmentPath','1354080ofLJTn','noCountPopulation','resolveFolderId','4620eiAcbK','ruleFile','Site:\x20','length','Resolved\x20folder\x20ID:\x20'];a24_0x4311=function(){return _0x26d237;};return a24_0x4311();}
1
+ const a24_0x1b4b21=a24_0x511a;(function(_0x824870,_0x4f9e4f){const _0x304fc7=a24_0x511a,_0x43a3d5=_0x824870();while(!![]){try{const _0x547e98=-parseInt(_0x304fc7(0x8a))/0x1*(-parseInt(_0x304fc7(0x87))/0x2)+-parseInt(_0x304fc7(0x93))/0x3*(parseInt(_0x304fc7(0x77))/0x4)+parseInt(_0x304fc7(0x9a))/0x5+parseInt(_0x304fc7(0x94))/0x6*(-parseInt(_0x304fc7(0xa1))/0x7)+-parseInt(_0x304fc7(0x98))/0x8*(parseInt(_0x304fc7(0x91))/0x9)+-parseInt(_0x304fc7(0x80))/0xa+-parseInt(_0x304fc7(0x8f))/0xb*(-parseInt(_0x304fc7(0x86))/0xc);if(_0x547e98===_0x4f9e4f)break;else _0x43a3d5['push'](_0x43a3d5['shift']());}catch(_0x4fcf79){_0x43a3d5['push'](_0x43a3d5['shift']());}}}(a24_0x57ce,0x27ac4));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a24_0x511a(_0x4f2bc6,_0x59ff19){const _0x57ce3e=a24_0x57ce();return a24_0x511a=function(_0x511ac4,_0x13af6b){_0x511ac4=_0x511ac4-0x6c;let _0x4d1685=_0x57ce3e[_0x511ac4];return _0x4d1685;},a24_0x511a(_0x4f2bc6,_0x59ff19);}function a24_0x57ce(){const _0x55e3f0=['Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Segment\x20name:\x20','Site:\x20','length','8kyREOj','noCountPopulation','✔\x20Created\x20segment\x20\x27','segment','kind','site','data','execute','verbose','202390rUpIJb','Examples:','error','Resolving\x20folder\x20\x27','segmentPath','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','333708birska','113858gdWJyy','parent','\x27...','4NpQrpA','includes','\x27\x20with\x20ID:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','187pbZEVS','Parent:\x20','437841ydnRtD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','466050eZDfiH','474smZtEy','folderId','name','resolvePathToResource','16nSsHDG','resolveFolderId','496510fsKjVB','folder','Resolved\x20relative\x20path\x20to:\x20','description','Create\x20child\x20segment\x20with\x20filtering\x20rules','Target\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','18522TVkuVo','\x20\x20\x20Path:\x20','resolveParentId','rule','createSegment','segments','invisible'];a24_0x57ce=function(){return _0x55e3f0;};return a24_0x57ce();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a24_0x1b4b21(0x9d)]=a24_0x1b4b21(0x9e);async[a24_0x1b4b21(0x7e)](_0x185b44){const _0x5d01be=a24_0x1b4b21,{options:_0x34242e,args:_0x4ef2dd,tdx:_0x5d9ad8}=_0x185b44,_0x2c7830=_0x34242e;if(_0x4ef2dd[_0x5d01be(0x76)]===0x0)return console[_0x5d01be(0x82)](_0x5d01be(0x92)),console[_0x5d01be(0x82)](_0x5d01be(0x85)),console[_0x5d01be(0x82)](_0x5d01be(0x81)),console[_0x5d01be(0x82)](_0x5d01be(0x8e)),console[_0x5d01be(0x82)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x48d154=_0x4ef2dd[0x0],_0x556f5d=_0x34242e[_0x5d01be(0x84)];let _0x1dc459=_0x48d154;_0x556f5d&&!_0x48d154[_0x5d01be(0x8b)]('/')&&(_0x1dc459=_0x556f5d+'/'+_0x48d154,_0x2c7830['verbose']&&console[_0x5d01be(0x82)](_0x5d01be(0x9c)+_0x1dc459));const _0x54f92b=parsePath(_0x1dc459);if(_0x54f92b[_0x5d01be(0x70)][_0x5d01be(0x76)]<0x2)return console[_0x5d01be(0x82)](_0x5d01be(0x8d)),console[_0x5d01be(0x82)](_0x5d01be(0x73)),0x1;const _0x4d05e3=_0x54f92b[_0x5d01be(0x70)][0x0],_0xedc836=getBaseName(_0x1dc459),_0x385c6b=getParentPath(_0x1dc459);_0x2c7830[_0x5d01be(0x7f)]&&(console[_0x5d01be(0x82)](_0x5d01be(0x75)+_0x2c7830[_0x5d01be(0x7c)]),console[_0x5d01be(0x82)](_0x5d01be(0x9f)+_0x1dc459),console[_0x5d01be(0x82)](_0x5d01be(0x90)+_0x4d05e3),console[_0x5d01be(0x82)](_0x5d01be(0x74)+_0xedc836),console['error']('Parent\x20path:\x20'+_0x385c6b));const _0x3af35a=await withSpinner(_0x5d01be(0xa0)+_0x4d05e3+_0x5d01be(0x89),()=>_0x5d9ad8['segment'][_0x5d01be(0x6d)](_0x4d05e3),{'verbose':_0x2c7830[_0x5d01be(0x7f)]}),_0xd33ba6=_0x3af35a[_0x5d01be(0x7d)];let _0x3a7950;if(_0x54f92b[_0x5d01be(0x70)][_0x5d01be(0x76)]>0x2){const _0x37f562=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x385c6b+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x97)](_0x385c6b),{'verbose':_0x2c7830['verbose']}),_0x3ec5cd=_0x37f562[_0x5d01be(0x7d)];if(_0x3ec5cd['type']!==_0x5d01be(0x9b)&&_0x3ec5cd['type']!==_0x5d01be(0x88))return console[_0x5d01be(0x82)](_0x5d01be(0x72)),0x1;_0x3a7950=_0x3ec5cd[_0x5d01be(0x95)];}else{if(_0x2c7830['folder']){const _0x37d6e9=await withSpinner(_0x5d01be(0x83)+_0x2c7830[_0x5d01be(0x9b)]+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x99)](_0xd33ba6,_0x2c7830[_0x5d01be(0x9b)]),{'verbose':_0x2c7830[_0x5d01be(0x7f)]});_0x3a7950=_0x37d6e9['data'];}}_0x2c7830['verbose']&&_0x3a7950&&console[_0x5d01be(0x82)]('Resolved\x20folder\x20ID:\x20'+_0x3a7950);const _0x3e11e7=await loadJSONFromOptions(_0x2c7830[_0x5d01be(0x6e)],_0x2c7830['ruleFile']),_0x1e8aa1={'name':_0xedc836,'description':_0x2c7830['description'],'rule':_0x3e11e7,'kind':_0x2c7830[_0x5d01be(0x7b)]!==undefined?parseInt(_0x2c7830[_0x5d01be(0x7b)],0xa):undefined,'isVisible':_0x2c7830[_0x5d01be(0x71)]?![]:undefined,'segmentFolderId':_0x3a7950,'countPopulation':_0x2c7830[_0x5d01be(0x78)]?![]:undefined},_0x15601d=await withSpinner('Creating\x20segment\x20\x27'+_0xedc836+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x6f)](_0xd33ba6,_0x1e8aa1),{'verbose':_0x2c7830[_0x5d01be(0x7f)]}),_0x44ed0a=_0x15601d['data'];return console['error'](_0x5d01be(0x79)+_0x44ed0a[_0x5d01be(0x96)]+_0x5d01be(0x8c)+_0x44ed0a['id']),_0x1dc459!==_0x48d154&&console[_0x5d01be(0x82)](_0x5d01be(0x6c)+_0x1dc459),await handleSDKOutput([_0x44ed0a],_0x2c7830),0x0;}}
@@ -1 +1 @@
1
- const a25_0x4f5d2d=a25_0x53d0;function a25_0x3a18(){const _0x1a5afe=['355196yuyzqM','4388028fGCdEk','4mRNtyw','segment','length','listFields','data','verbose','22615gKCehW','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','39756876TxdYFk','\x27...','8KxnGCp','Parent\x20segment:\x20','error','12703933yMKFLv','List\x20available\x20fields\x20for\x20segmentation','70thVOrD','5llWlUH','✔\x20Found\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','site','1110AgjqXe','execute','Listing\x20fields\x20for\x20\x27','segment:fields','1416501mJvKFP','name','7656061AbGEeO'];a25_0x3a18=function(){return _0x1a5afe;};return a25_0x3a18();}(function(_0x346b41,_0x19a370){const _0x2f0fe5=a25_0x53d0,_0x10a0dc=_0x346b41();while(!![]){try{const _0x2e6b6d=-parseInt(_0x2f0fe5(0x1a6))/0x1*(parseInt(_0x2f0fe5(0x1b1))/0x2)+parseInt(_0x2f0fe5(0x1b2))/0x3*(-parseInt(_0x2f0fe5(0x1b3))/0x4)+-parseInt(_0x2f0fe5(0x19b))/0x5*(-parseInt(_0x2f0fe5(0x1aa))/0x6)+-parseInt(_0x2f0fe5(0x1b0))/0x7*(parseInt(_0x2f0fe5(0x1a0))/0x8)+parseInt(_0x2f0fe5(0x1ae))/0x9*(-parseInt(_0x2f0fe5(0x1a5))/0xa)+parseInt(_0x2f0fe5(0x1a3))/0xb+parseInt(_0x2f0fe5(0x19e))/0xc;if(_0x2e6b6d===_0x19a370)break;else _0x10a0dc['push'](_0x10a0dc['shift']());}catch(_0x264c5f){_0x10a0dc['push'](_0x10a0dc['shift']());}}}(a25_0x3a18,0xb935b));function a25_0x53d0(_0xd39361,_0xb8fe40){const _0x3a1846=a25_0x3a18();return a25_0x53d0=function(_0x53d0ff,_0x5d285c){_0x53d0ff=_0x53d0ff-0x198;let _0x42f9b0=_0x3a1846[_0x53d0ff];return _0x42f9b0;},a25_0x53d0(_0xd39361,_0xb8fe40);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a25_0x4f5d2d(0x1af)]=a25_0x4f5d2d(0x1ad);['description']=a25_0x4f5d2d(0x1a4);async[a25_0x4f5d2d(0x1ab)](_0x319c9f){const _0x3a205c=a25_0x4f5d2d,{options:_0x42aa46,args:_0x17fc88,tdx:_0x6e65d8}=_0x319c9f;if(_0x17fc88['length']===0x0)return console[_0x3a205c(0x1a2)](_0x3a205c(0x19d)),console[_0x3a205c(0x1a2)](_0x3a205c(0x1a8)),0x1;const _0x20df08=_0x17fc88[0x0];_0x42aa46[_0x3a205c(0x19a)]&&(console[_0x3a205c(0x1a2)](_0x3a205c(0x19c)+_0x42aa46[_0x3a205c(0x1a9)]),console['error'](_0x3a205c(0x1a1)+_0x20df08));const _0x4a579f=await withSpinner(_0x3a205c(0x1ac)+_0x20df08+_0x3a205c(0x19f),()=>_0x6e65d8[_0x3a205c(0x1b4)][_0x3a205c(0x198)](_0x20df08),{'verbose':_0x42aa46['verbose']}),_0x4ec794=_0x4a579f[_0x3a205c(0x199)];return console[_0x3a205c(0x1a2)](_0x3a205c(0x1a7)+_0x4ec794[_0x3a205c(0x1b5)]+'\x20field'+(_0x4ec794[_0x3a205c(0x1b5)]!==0x1?'s':'')),await handleSDKOutput(_0x4ec794,_0x42aa46),0x0;}}
1
+ const a25_0x43c92d=a25_0xca2a;function a25_0xca2a(_0xa0095d,_0x37ab4a){const _0x5a911d=a25_0x5a91();return a25_0xca2a=function(_0xca2a5b,_0x23ce8){_0xca2a5b=_0xca2a5b-0x122;let _0x35a1e0=_0x5a911d[_0xca2a5b];return _0x35a1e0;},a25_0xca2a(_0xa0095d,_0x37ab4a);}(function(_0x4f7ed3,_0x479622){const _0x2c599d=a25_0xca2a,_0x43f235=_0x4f7ed3();while(!![]){try{const _0x7f1eaf=parseInt(_0x2c599d(0x137))/0x1+parseInt(_0x2c599d(0x123))/0x2*(-parseInt(_0x2c599d(0x12a))/0x3)+-parseInt(_0x2c599d(0x131))/0x4*(-parseInt(_0x2c599d(0x127))/0x5)+-parseInt(_0x2c599d(0x125))/0x6+-parseInt(_0x2c599d(0x129))/0x7+-parseInt(_0x2c599d(0x12e))/0x8+parseInt(_0x2c599d(0x136))/0x9;if(_0x7f1eaf===_0x479622)break;else _0x43f235['push'](_0x43f235['shift']());}catch(_0x438f33){_0x43f235['push'](_0x43f235['shift']());}}}(a25_0x5a91,0x6378c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a25_0x43c92d(0x12b);[a25_0x43c92d(0x126)]=a25_0x43c92d(0x128);async[a25_0x43c92d(0x132)](_0xd4a55d){const _0x5f74fc=a25_0x43c92d,{options:_0x175aec,args:_0x363946,tdx:_0x13d524}=_0xd4a55d;if(_0x363946[_0x5f74fc(0x12c)]===0x0)return console[_0x5f74fc(0x12f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x5f74fc(0x130)),0x1;const _0x52c26f=_0x363946[0x0];_0x175aec[_0x5f74fc(0x122)]&&(console[_0x5f74fc(0x12f)](_0x5f74fc(0x134)+_0x175aec['site']),console['error']('Parent\x20segment:\x20'+_0x52c26f));const _0x1ae501=await withSpinner(_0x5f74fc(0x124)+_0x52c26f+'\x27...',()=>_0x13d524[_0x5f74fc(0x135)]['listFields'](_0x52c26f),{'verbose':_0x175aec['verbose']}),_0x3e2c38=_0x1ae501[_0x5f74fc(0x12d)];return console[_0x5f74fc(0x12f)](_0x5f74fc(0x133)+_0x3e2c38[_0x5f74fc(0x12c)]+'\x20field'+(_0x3e2c38[_0x5f74fc(0x12c)]!==0x1?'s':'')),await handleSDKOutput(_0x3e2c38,_0x175aec),0x0;}}function a25_0x5a91(){const _0x2c6791=['538454bMEApu','3acOrml','segment:fields','length','data','5166552SsbfIu','error','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','360uwLJLG','execute','✔\x20Found\x20','Site:\x20','segment','9324036XUsOba','326984anGfcx','verbose','984564yoHziU','Listing\x20fields\x20for\x20\x27','287274eauQXP','description','17075TYqvea','List\x20available\x20fields\x20for\x20segmentation'];a25_0x5a91=function(){return _0x2c6791;};return a25_0x5a91();}
@@ -1 +1 @@
1
- function a26_0x1b5f(){const _0x2db47c=['jsonl','310NuXlMn','segment:pwd','json','16ZuWgvG','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','5072010dvbruo','format','\x20\x20Path:\x20','4651767zNjVcu','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','12850425HCIelR','9655fFqzDc','verbose','error','segmentPath','log','Show\x20current\x20segment/folder\x20context','stringify','228LymLgp','6363812bkMvkC','36675CMMpmV','5050927hopqru'];a26_0x1b5f=function(){return _0x2db47c;};return a26_0x1b5f();}const a26_0xbfee8d=a26_0x5426;(function(_0x2d9295,_0x1f4748){const _0xed390f=a26_0x5426,_0x11eb1e=_0x2d9295();while(!![]){try{const _0x3279dc=parseInt(_0xed390f(0xaf))/0x1*(-parseInt(_0xed390f(0xbb))/0x2)+parseInt(_0xed390f(0xac))/0x3+parseInt(_0xed390f(0xb7))/0x4+parseInt(_0xed390f(0xb8))/0x5*(-parseInt(_0xed390f(0xb6))/0x6)+parseInt(_0xed390f(0xb9))/0x7*(parseInt(_0xed390f(0xbe))/0x8)+-parseInt(_0xed390f(0xae))/0x9+-parseInt(_0xed390f(0xc0))/0xa;if(_0x3279dc===_0x1f4748)break;else _0x11eb1e['push'](_0x11eb1e['shift']());}catch(_0x83eea4){_0x11eb1e['push'](_0x11eb1e['shift']());}}}(a26_0x1b5f,0xd578f));import{BaseCommand}from'./command.js';function a26_0x5426(_0x759355,_0x53bff1){const _0x1b5f0d=a26_0x1b5f();return a26_0x5426=function(_0x5426d0,_0x468b25){_0x5426d0=_0x5426d0-0xaa;let _0x21f3ff=_0x1b5f0d[_0x5426d0];return _0x21f3ff;},a26_0x5426(_0x759355,_0x53bff1);}export class SegmentPwdCommand extends BaseCommand{['name']=a26_0xbfee8d(0xbc);['description']=a26_0xbfee8d(0xb4);async['execute'](_0x3359d3){const _0x5b1c85=a26_0xbfee8d,{options:_0x4a6145}=_0x3359d3;try{const _0x2d55be=_0x4a6145[_0x5b1c85(0xb2)];if(!_0x2d55be)return _0x4a6145[_0x5b1c85(0xaa)]===_0x5b1c85(0xbd)||_0x4a6145[_0x5b1c85(0xaa)]===_0x5b1c85(0xba)?console[_0x5b1c85(0xb3)](JSON[_0x5b1c85(0xb5)]({'path':'/','type':'root'})):console[_0x5b1c85(0xb3)]('/'),0x0;if(_0x4a6145[_0x5b1c85(0xaa)]===_0x5b1c85(0xbd)||_0x4a6145[_0x5b1c85(0xaa)]==='jsonl'){const _0x5db3f2={'path':_0x2d55be};console[_0x5b1c85(0xb3)](JSON['stringify'](_0x5db3f2));}else console[_0x5b1c85(0xb3)](_0x2d55be),_0x4a6145[_0x5b1c85(0xb0)]&&(console[_0x5b1c85(0xb1)](''),console[_0x5b1c85(0xb1)]('Context\x20details:'),console[_0x5b1c85(0xb1)](_0x5b1c85(0xab)+_0x2d55be),console[_0x5b1c85(0xb1)](''),console['error'](_0x5b1c85(0xbf)),console['error'](_0x5b1c85(0xad)));return 0x0;}catch(_0x32edcc){throw _0x32edcc;}}}
1
+ const a26_0x59b2e1=a26_0x1406;function a26_0x1406(_0x31620e,_0x4d92db){const _0x34d355=a26_0x34d3();return a26_0x1406=function(_0x1406f1,_0x290925){_0x1406f1=_0x1406f1-0x13e;let _0xe95d90=_0x34d355[_0x1406f1];return _0xe95d90;},a26_0x1406(_0x31620e,_0x4d92db);}(function(_0x351f12,_0x17e57e){const _0x17e786=a26_0x1406,_0x238cac=_0x351f12();while(!![]){try{const _0x4ab661=-parseInt(_0x17e786(0x14d))/0x1+parseInt(_0x17e786(0x13e))/0x2+-parseInt(_0x17e786(0x152))/0x3*(-parseInt(_0x17e786(0x146))/0x4)+parseInt(_0x17e786(0x14c))/0x5+-parseInt(_0x17e786(0x149))/0x6+-parseInt(_0x17e786(0x14b))/0x7*(parseInt(_0x17e786(0x151))/0x8)+parseInt(_0x17e786(0x150))/0x9;if(_0x4ab661===_0x17e57e)break;else _0x238cac['push'](_0x238cac['shift']());}catch(_0xc2ffbe){_0x238cac['push'](_0x238cac['shift']());}}}(a26_0x34d3,0x89eb9));import{BaseCommand}from'./command.js';function a26_0x34d3(){const _0x6bb374=['2346720PMMwCg','341359xvcPHw','execute','\x20\x20Path:\x20','14872338BiyYkB','8oscIuc','18dvbyAT','658292DQnmjH','json','log','error','stringify','format','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','description','398572uxabCJ','Context\x20details:','Show\x20current\x20segment/folder\x20context','6618006TUgvwi','jsonl','7276843PaIjZf'];a26_0x34d3=function(){return _0x6bb374;};return a26_0x34d3();}export class SegmentPwdCommand extends BaseCommand{['name']='segment:pwd';[a26_0x59b2e1(0x145)]=a26_0x59b2e1(0x148);async[a26_0x59b2e1(0x14e)](_0xd859b1){const _0x57d617=a26_0x59b2e1,{options:_0x49a56e}=_0xd859b1;try{const _0x4db1ba=_0x49a56e['segmentPath'];if(!_0x4db1ba)return _0x49a56e[_0x57d617(0x143)]===_0x57d617(0x13f)||_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x14a)?console[_0x57d617(0x140)](JSON[_0x57d617(0x142)]({'path':'/','type':'root'})):console[_0x57d617(0x140)]('/'),0x0;if(_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x13f)||_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x14a)){const _0x528c95={'path':_0x4db1ba};console[_0x57d617(0x140)](JSON[_0x57d617(0x142)](_0x528c95));}else console[_0x57d617(0x140)](_0x4db1ba),_0x49a56e['verbose']&&(console[_0x57d617(0x141)](''),console[_0x57d617(0x141)](_0x57d617(0x147)),console[_0x57d617(0x141)](_0x57d617(0x14f)+_0x4db1ba),console['error'](''),console[_0x57d617(0x141)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x57d617(0x141)](_0x57d617(0x144)));return 0x0;}catch(_0x213782){throw _0x213782;}}}
@@ -1 +1 @@
1
- const a27_0x250804=a27_0x37fe;(function(_0x2a43c0,_0x25ba2f){const _0x1f0549=a27_0x37fe,_0x3f8da8=_0x2a43c0();while(!![]){try{const _0x4a5b14=-parseInt(_0x1f0549(0x168))/0x1*(parseInt(_0x1f0549(0x171))/0x2)+-parseInt(_0x1f0549(0x14e))/0x3*(parseInt(_0x1f0549(0x16a))/0x4)+-parseInt(_0x1f0549(0x16f))/0x5+-parseInt(_0x1f0549(0x156))/0x6+parseInt(_0x1f0549(0x15a))/0x7*(-parseInt(_0x1f0549(0x16d))/0x8)+-parseInt(_0x1f0549(0x15c))/0x9+parseInt(_0x1f0549(0x14a))/0xa;if(_0x4a5b14===_0x25ba2f)break;else _0x3f8da8['push'](_0x3f8da8['shift']());}catch(_0x74d0b4){_0x3f8da8['push'](_0x3f8da8['shift']());}}}(a27_0x58c4,0xb961c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x58c4(){const _0x1d9bbd=['Segment\x20ID\x20missing\x20from\x20resolved\x20path','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Update\x20existing\x20child\x20segment','segmentName','Segment\x20ID:\x20','\x27...','Resolved\x20relative\x20path\x20to:\x20','resolveFolderId','\x20\x20\x20Path:\x20','folder','33DDqwta','kind','1436EXugFH','parentId','Error:\x20Cannot\x20update\x20','1336GxEBQv','segmentId','1391040pFqaDX','segment','42818nNjbQF','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','name','updateSegmentById','description','Resolving\x20folder\x20\x27','error','54289240QIPgzC','length','rule','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','1707UbySao','Parent\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','data','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Updating\x20segment\x20\x27','Resolved\x20folder\x20ID:\x20','7228998CSuixO','Resolved\x20type:\x20','includes','Examples:','57197hZXcSm','type','8201106xyMlvi','verbose'];a27_0x58c4=function(){return _0x1d9bbd;};return a27_0x58c4();}import{withSpinner}from'../utils/spinner.js';function a27_0x37fe(_0x57c7ac,_0x1d4bd1){const _0x58c403=a27_0x58c4();return a27_0x37fe=function(_0x37fe86,_0xb110c4){_0x37fe86=_0x37fe86-0x149;let _0x53d9ed=_0x58c403[_0x37fe86];return _0x53d9ed;},a27_0x37fe(_0x57c7ac,_0x1d4bd1);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a27_0x250804(0x173)]='segment:update';[a27_0x250804(0x175)]=a27_0x250804(0x160);async[a27_0x250804(0x151)](_0x4c28f8){const _0x40ba4b=a27_0x250804,{options:_0x28e4ad,args:_0x22bc52,tdx:_0x37a34a}=_0x4c28f8,_0x1e4153=_0x28e4ad;if(_0x22bc52[_0x40ba4b(0x14b)]===0x0)return console['error'](_0x40ba4b(0x150)),console['error'](_0x40ba4b(0x14d)),console[_0x40ba4b(0x149)](_0x40ba4b(0x159)),console['error'](_0x40ba4b(0x153)),console[_0x40ba4b(0x149)](_0x40ba4b(0x172)),0x1;const _0x2ace2b=_0x22bc52[0x0],_0x98fbd4=_0x28e4ad['segmentPath'];let _0x2d6b88=_0x2ace2b;_0x98fbd4&&!_0x2ace2b[_0x40ba4b(0x158)]('/')&&(_0x2d6b88=_0x98fbd4+'/'+_0x2ace2b,_0x1e4153[_0x40ba4b(0x15d)]&&console[_0x40ba4b(0x149)](_0x40ba4b(0x164)+_0x2d6b88));const _0x7cc02e=await withSpinner('Resolving\x20path\x20\x27'+_0x2d6b88+'\x27...',()=>_0x37a34a[_0x40ba4b(0x170)]['resolvePathToResource'](_0x2d6b88),{'verbose':_0x1e4153[_0x40ba4b(0x15d)]}),_0x3c9a6b=_0x7cc02e[_0x40ba4b(0x152)];_0x1e4153[_0x40ba4b(0x15d)]&&console[_0x40ba4b(0x149)](_0x40ba4b(0x157)+_0x3c9a6b[_0x40ba4b(0x15b)]);if(_0x3c9a6b[_0x40ba4b(0x15b)]!=='segment')return console[_0x40ba4b(0x149)](_0x40ba4b(0x16c)+_0x3c9a6b[_0x40ba4b(0x15b)]+_0x40ba4b(0x15f)),console[_0x40ba4b(0x149)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3c9a6b[_0x40ba4b(0x16e)])throw new SDKError(ErrorCode['INTERNAL'],_0x40ba4b(0x15e));const _0x59a96f=_0x3c9a6b[_0x40ba4b(0x16b)],_0x29de5b=_0x3c9a6b['segmentId'];_0x1e4153[_0x40ba4b(0x15d)]&&(console[_0x40ba4b(0x149)](_0x40ba4b(0x14f)+_0x59a96f),console[_0x40ba4b(0x149)](_0x40ba4b(0x162)+_0x29de5b));let _0xcc05ee;if(_0x1e4153[_0x40ba4b(0x167)]){const _0x1040de=_0x1e4153['folder'],_0x207a90=await withSpinner(_0x40ba4b(0x176)+_0x1040de+_0x40ba4b(0x163),()=>_0x37a34a['segment'][_0x40ba4b(0x165)](_0x59a96f,_0x1040de),{'verbose':_0x1e4153[_0x40ba4b(0x15d)]});_0xcc05ee=parseInt(_0x207a90[_0x40ba4b(0x152)],0xa),_0x1e4153[_0x40ba4b(0x15d)]&&console[_0x40ba4b(0x149)](_0x40ba4b(0x155)+_0xcc05ee);}const _0x5879b4=await loadJSONFromOptions(_0x1e4153[_0x40ba4b(0x14c)],_0x1e4153['ruleFile']),_0x40c8f1={'name':_0x1e4153[_0x40ba4b(0x173)],'description':_0x1e4153[_0x40ba4b(0x175)],'rule':_0x5879b4,'kind':_0x1e4153[_0x40ba4b(0x169)]!==undefined?parseInt(_0x1e4153[_0x40ba4b(0x169)],0xa):undefined,'segmentFolderId':_0xcc05ee},_0x184df2=await withSpinner(_0x40ba4b(0x154)+_0x3c9a6b[_0x40ba4b(0x161)]+'\x27...',()=>_0x37a34a[_0x40ba4b(0x170)][_0x40ba4b(0x174)](_0x59a96f,_0x29de5b,_0x40c8f1),{'verbose':_0x1e4153['verbose']}),_0x126c5a=_0x184df2[_0x40ba4b(0x152)];return console[_0x40ba4b(0x149)]('✔\x20Updated\x20segment\x20\x27'+_0x126c5a[_0x40ba4b(0x173)]+'\x27'),_0x2d6b88!==_0x2ace2b&&console['error'](_0x40ba4b(0x166)+_0x2d6b88),await handleSDKOutput([_0x126c5a],_0x1e4153),0x0;}}
1
+ const a27_0x345b10=a27_0x1e3d;(function(_0x13622e,_0x5d642a){const _0x50b126=a27_0x1e3d,_0x57fb90=_0x13622e();while(!![]){try{const _0x334027=-parseInt(_0x50b126(0xd7))/0x1+-parseInt(_0x50b126(0xe5))/0x2+-parseInt(_0x50b126(0xd5))/0x3+-parseInt(_0x50b126(0xe3))/0x4+-parseInt(_0x50b126(0xef))/0x5*(parseInt(_0x50b126(0xdb))/0x6)+-parseInt(_0x50b126(0xf3))/0x7+parseInt(_0x50b126(0xf4))/0x8*(parseInt(_0x50b126(0xd4))/0x9);if(_0x334027===_0x5d642a)break;else _0x57fb90['push'](_0x57fb90['shift']());}catch(_0x56136d){_0x57fb90['push'](_0x57fb90['shift']());}}}(a27_0xdfb6,0xabbec));function a27_0x1e3d(_0xb737ff,_0x526a3){const _0xdfb60=a27_0xdfb6();return a27_0x1e3d=function(_0x1e3da8,_0x5038bc){_0x1e3da8=_0x1e3da8-0xcb;let _0x14ce1d=_0xdfb60[_0x1e3da8];return _0x14ce1d;},a27_0x1e3d(_0xb737ff,_0x526a3);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0x345b10(0xea);[a27_0x345b10(0xf9)]=a27_0x345b10(0xcf);async[a27_0x345b10(0xe9)](_0x4799b8){const _0x175041=a27_0x345b10,{options:_0x1070cf,args:_0x1d5952,tdx:_0x6c8303}=_0x4799b8,_0x23c0b=_0x1070cf;if(_0x1d5952[_0x175041(0xfc)]===0x0)return console[_0x175041(0xd3)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x175041(0xd3)](_0x175041(0xf8)),console['error'](_0x175041(0xde)),console[_0x175041(0xd3)](_0x175041(0xdf)),console[_0x175041(0xd3)](_0x175041(0xf2)),0x1;const _0x111915=_0x1d5952[0x0],_0x14b051=_0x1070cf[_0x175041(0xda)];let _0x75d171=_0x111915;_0x14b051&&!_0x111915[_0x175041(0xe6)]('/')&&(_0x75d171=_0x14b051+'/'+_0x111915,_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xd6)+_0x75d171));const _0x3516d9=await withSpinner(_0x175041(0xf0)+_0x75d171+_0x175041(0xe1),()=>_0x6c8303['segment'][_0x175041(0xce)](_0x75d171),{'verbose':_0x23c0b[_0x175041(0xdd)]}),_0x5a85d6=_0x3516d9['data'];_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xcb)+_0x5a85d6[_0x175041(0xf7)]);if(_0x5a85d6[_0x175041(0xf7)]!=='segment')return console['error'](_0x175041(0xd0)+_0x5a85d6['type']+_0x175041(0xe0)),console[_0x175041(0xd3)](_0x175041(0xf1)),0x1;if(!_0x5a85d6[_0x175041(0xcc)])throw new SDKError(ErrorCode[_0x175041(0xd9)],_0x175041(0xf6));const _0x2cdad6=_0x5a85d6['parentId'],_0x4903de=_0x5a85d6[_0x175041(0xcc)];_0x23c0b['verbose']&&(console[_0x175041(0xd3)](_0x175041(0xdc)+_0x2cdad6),console[_0x175041(0xd3)](_0x175041(0xed)+_0x4903de));let _0x4ce3e9;if(_0x23c0b['folder']){const _0x2497dd=_0x23c0b[_0x175041(0xd8)],_0x3212cd=await withSpinner(_0x175041(0xf5)+_0x2497dd+_0x175041(0xe1),()=>_0x6c8303[_0x175041(0xfa)][_0x175041(0xe8)](_0x2cdad6,_0x2497dd),{'verbose':_0x23c0b[_0x175041(0xdd)]});_0x4ce3e9=parseInt(_0x3212cd[_0x175041(0xfb)],0xa),_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xeb)+_0x4ce3e9);}const _0x3654f0=await loadJSONFromOptions(_0x23c0b[_0x175041(0xe7)],_0x23c0b['ruleFile']),_0x1ca825={'name':_0x23c0b[_0x175041(0xec)],'description':_0x23c0b[_0x175041(0xf9)],'rule':_0x3654f0,'kind':_0x23c0b[_0x175041(0xd1)]!==undefined?parseInt(_0x23c0b['kind'],0xa):undefined,'segmentFolderId':_0x4ce3e9},_0x2273a8=await withSpinner(_0x175041(0xe4)+_0x5a85d6[_0x175041(0xee)]+_0x175041(0xe1),()=>_0x6c8303['segment'][_0x175041(0xd2)](_0x2cdad6,_0x4903de,_0x1ca825),{'verbose':_0x23c0b[_0x175041(0xdd)]}),_0x5331de=_0x2273a8[_0x175041(0xfb)];return console['error'](_0x175041(0xe2)+_0x5331de['name']+'\x27'),_0x75d171!==_0x111915&&console[_0x175041(0xd3)](_0x175041(0xcd)+_0x75d171),await handleSDKOutput([_0x5331de],_0x23c0b),0x0;}}function a27_0xdfb6(){const _0x5679a5=['updateSegmentById','error','117aSPTVA','2912157ZLCWUn','Resolved\x20relative\x20path\x20to:\x20','778631cWgTrI','folder','INTERNAL','segmentPath','1848IrKWgW','Parent\x20ID:\x20','verbose','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x27...','✔\x20Updated\x20segment\x20\x27','1958012JkGikq','Updating\x20segment\x20\x27','702246SIWCFy','includes','rule','resolveFolderId','execute','segment:update','Resolved\x20folder\x20ID:\x20','name','Segment\x20ID:\x20','segmentName','12785GdHrbP','Resolving\x20path\x20\x27','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1409583oEEotX','2635304RWuFgI','Resolving\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','description','segment','data','length','Resolved\x20type:\x20','segmentId','\x20\x20\x20Path:\x20','resolvePathToResource','Update\x20existing\x20child\x20segment','Error:\x20Cannot\x20update\x20','kind'];a27_0xdfb6=function(){return _0x5679a5;};return a27_0xdfb6();}
@@ -1 +1 @@
1
- const a28_0x337bb6=a28_0x1318;(function(_0x12dc42,_0x1c039c){const _0x387c44=a28_0x1318,_0x2eae22=_0x12dc42();while(!![]){try{const _0x34e45e=parseInt(_0x387c44(0x104))/0x1+-parseInt(_0x387c44(0x117))/0x2+-parseInt(_0x387c44(0xff))/0x3+-parseInt(_0x387c44(0x125))/0x4+parseInt(_0x387c44(0x120))/0x5+parseInt(_0x387c44(0x107))/0x6+parseInt(_0x387c44(0x122))/0x7*(parseInt(_0x387c44(0x106))/0x8);if(_0x34e45e===_0x1c039c)break;else _0x2eae22['push'](_0x2eae22['shift']());}catch(_0x48c382){_0x2eae22['push'](_0x2eae22['shift']());}}}(a28_0x37aa,0xd641a));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a28_0x37aa(){const _0x503196=['Use:\x20tdx\x20segment\x20use\x20','split','folderPath','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','2516188kpEetn','verbose','Context\x20set\x20to:\x20','segmentPath','Resolved\x20relative\x20path\x20to:\x20','log','resolvePathToResource','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','8713510OeQusw','Context\x20cleared.\x20Back\x20to\x20root.','35RabaSV','parentId','Error:\x20Path\x20is\x20required','6438380omfTHQ','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','error','segments','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','folderId','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Site:\x20','segment:use','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','4299216lqFczC','Parent\x20ID:\x20','join','fullPath','Target\x20path:\x20','1369590yUxJcR','segment','2167696DjuKhz','4267518omrdRb','site','session','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','name','slice','description','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','Examples:'];a28_0x37aa=function(){return _0x503196;};return a28_0x37aa();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a28_0x1318(_0x282d57,_0x5237da){const _0x37aaf2=a28_0x37aa();return a28_0x1318=function(_0x131896,_0x428026){_0x131896=_0x131896-0xf8;let _0x5e199d=_0x37aaf2[_0x131896];return _0x5e199d;},a28_0x1318(_0x282d57,_0x5237da);}export class SegmentUseCommand extends BaseCommand{[a28_0x337bb6(0x10b)]=a28_0x337bb6(0xfd);[a28_0x337bb6(0x10d)]=a28_0x337bb6(0x10a);async['execute'](_0x45982e){const _0x455059=a28_0x337bb6,{options:_0x22e120,args:_0x427807,tdx:_0x2fadb8}=_0x45982e;if(_0x427807['length']===0x0)return console[_0x455059(0x127)](_0x455059(0x124)),console[_0x455059(0x127)](_0x455059(0x11e)),console['error'](_0x455059(0x110)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0x455059(0x10e)),console[_0x455059(0x127)](_0x455059(0xfb)),console[_0x455059(0x127)](_0x455059(0x114)),0x1;const _0x55ba9a=_0x427807[0x0],_0x22f81d=_0x22e120[_0x455059(0x109)];try{if(_0x55ba9a==='/')return saveSessionContext({'segment_path':undefined},_0x22f81d),console['log'](_0x455059(0x121)),0x0;const _0x49d2b3=_0x22e120[_0x455059(0x11a)];let _0x1d90d0=_0x55ba9a;const _0x397cd7=parsePath(_0x55ba9a);if(!_0x397cd7['isAbsolute']){if(!_0x49d2b3)return console['error'](_0x455059(0x11f)),console[_0x455059(0x127)](_0x455059(0xfe)),0x1;if(_0x55ba9a==='..'){const _0x5526ab=_0x49d2b3[_0x455059(0x112)]('/')[_0x455059(0x10c)](0x0,-0x1)['join']('/');_0x1d90d0=_0x5526ab||'/';}else _0x55ba9a==='.'?_0x1d90d0=_0x49d2b3:_0x1d90d0=_0x49d2b3+'/'+_0x55ba9a;_0x22e120[_0x455059(0x118)]&&console['error'](_0x455059(0x11b)+_0x1d90d0);}if(_0x1d90d0==='/'||_0x1d90d0==='')return saveSessionContext({'segment_path':undefined},_0x22f81d),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x1d90d0=normalizePath(_0x1d90d0);const _0x33032a=parsePath(_0x1d90d0)[_0x455059(0x128)];if(_0x33032a['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x22f81d),console['log'](_0x455059(0x121)),0x0;_0x22e120[_0x455059(0x118)]&&(console[_0x455059(0x127)](_0x455059(0xfc)+_0x22e120[_0x455059(0x108)]),console[_0x455059(0x127)](_0x455059(0x103)+_0x1d90d0));const _0x342c43=await withSpinner('Resolving\x20path\x20\x27'+_0x1d90d0+'\x27...',()=>_0x2fadb8[_0x455059(0x105)][_0x455059(0x11d)](_0x1d90d0),{'verbose':_0x22e120[_0x455059(0x118)]}),_0x43e285=_0x342c43['data'];_0x22e120[_0x455059(0x118)]&&(console[_0x455059(0x127)]('Resolved\x20path\x20type:\x20'+_0x43e285['type']),console['error'](_0x455059(0x100)+_0x43e285[_0x455059(0x123)]),_0x43e285['folderId']&&console[_0x455059(0x127)]('Folder\x20ID:\x20'+_0x43e285[_0x455059(0xfa)]));if(_0x43e285['type']==='segment')return console[_0x455059(0x127)](_0x455059(0x126)),console['error'](_0x455059(0xf9)),console[_0x455059(0x127)](_0x455059(0x111)+_0x43e285[_0x455059(0x116)]+(_0x43e285[_0x455059(0x113)]?'/'+_0x43e285['folderPath'][_0x455059(0x101)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x43e285[_0x455059(0x102)],'parent_segment':_0x43e285[_0x455059(0x116)]},_0x22f81d),console[_0x455059(0x11c)](_0x455059(0x119)+_0x43e285[_0x455059(0x102)]),_0x22e120[_0x455059(0x118)]&&(console['error'](_0x455059(0x115)),console[_0x455059(0x127)](_0x455059(0x10f)),console['error'](_0x455059(0xf8))),0x0;}catch(_0x4b764e){throw _0x4b764e;}}}
1
+ const a28_0x434dc4=a28_0x37f1;(function(_0x12274b,_0x3981f1){const _0x489874=a28_0x37f1,_0x47ada6=_0x12274b();while(!![]){try{const _0x42c5c0=-parseInt(_0x489874(0x78))/0x1*(-parseInt(_0x489874(0x95))/0x2)+parseInt(_0x489874(0x83))/0x3*(parseInt(_0x489874(0x72))/0x4)+parseInt(_0x489874(0x67))/0x5+parseInt(_0x489874(0x68))/0x6*(parseInt(_0x489874(0x6e))/0x7)+parseInt(_0x489874(0x71))/0x8*(parseInt(_0x489874(0x80))/0x9)+parseInt(_0x489874(0x69))/0xa*(-parseInt(_0x489874(0x66))/0xb)+parseInt(_0x489874(0x94))/0xc*(-parseInt(_0x489874(0x86))/0xd);if(_0x42c5c0===_0x3981f1)break;else _0x47ada6['push'](_0x47ada6['shift']());}catch(_0x462f70){_0x47ada6['push'](_0x47ada6['shift']());}}}(a28_0x4b49,0xc423e));function a28_0x37f1(_0x55ff9e,_0x3a5d67){const _0x4b49e8=a28_0x4b49();return a28_0x37f1=function(_0x37f195,_0x4d6615){_0x37f195=_0x37f195-0x64;let _0x218158=_0x4b49e8[_0x37f195];return _0x218158;},a28_0x37f1(_0x55ff9e,_0x3a5d67);}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']=a28_0x434dc4(0x6f);[a28_0x434dc4(0x99)]=a28_0x434dc4(0x8d);async[a28_0x434dc4(0x85)](_0x48ec6b){const _0x1d2301=a28_0x434dc4,{options:_0x465a27,args:_0x340f00,tdx:_0x252539}=_0x48ec6b;if(_0x340f00[_0x1d2301(0x65)]===0x0)return console[_0x1d2301(0x93)](_0x1d2301(0x7b)),console['error'](_0x1d2301(0x7a)),console['error']('Examples:'),console[_0x1d2301(0x93)](_0x1d2301(0x70)),console[_0x1d2301(0x93)](_0x1d2301(0x89)),console[_0x1d2301(0x93)](_0x1d2301(0x7d)),console[_0x1d2301(0x93)](_0x1d2301(0x8c)),0x1;const _0x3bf99f=_0x340f00[0x0],_0x3ab212=_0x465a27['session'];try{if(_0x3bf99f==='/')return saveSessionContext({'segment_path':undefined},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x97)),0x0;const _0x13de47=_0x465a27[_0x1d2301(0x76)];let _0x5dfec1=_0x3bf99f;const _0x45e030=parsePath(_0x3bf99f);if(!_0x45e030[_0x1d2301(0x88)]){if(!_0x13de47)return console[_0x1d2301(0x93)](_0x1d2301(0x77)),console[_0x1d2301(0x93)](_0x1d2301(0x8b)),0x1;if(_0x3bf99f==='..'){const _0x4ab308=_0x13de47[_0x1d2301(0x6b)]('/')[_0x1d2301(0x8a)](0x0,-0x1)[_0x1d2301(0x91)]('/');_0x5dfec1=_0x4ab308||'/';}else _0x3bf99f==='.'?_0x5dfec1=_0x13de47:_0x5dfec1=_0x13de47+'/'+_0x3bf99f;_0x465a27[_0x1d2301(0x92)]&&console[_0x1d2301(0x93)](_0x1d2301(0x90)+_0x5dfec1);}if(_0x5dfec1==='/'||_0x5dfec1==='')return saveSessionContext({'segment_path':undefined},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x97)),0x0;_0x5dfec1=normalizePath(_0x5dfec1);const _0x3b4988=parsePath(_0x5dfec1)['segments'];if(_0x3b4988['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3ab212),console['log'](_0x1d2301(0x97)),0x0;_0x465a27[_0x1d2301(0x92)]&&(console[_0x1d2301(0x93)]('Site:\x20'+_0x465a27[_0x1d2301(0x7c)]),console[_0x1d2301(0x93)](_0x1d2301(0x84)+_0x5dfec1));const _0x48fd53=await withSpinner(_0x1d2301(0x7e)+_0x5dfec1+_0x1d2301(0x8e),()=>_0x252539[_0x1d2301(0x79)][_0x1d2301(0x82)](_0x5dfec1),{'verbose':_0x465a27[_0x1d2301(0x92)]}),_0x37ef4f=_0x48fd53['data'];_0x465a27[_0x1d2301(0x92)]&&(console[_0x1d2301(0x93)](_0x1d2301(0x98)+_0x37ef4f['type']),console['error'](_0x1d2301(0x74)+_0x37ef4f['parentId']),_0x37ef4f[_0x1d2301(0x87)]&&console[_0x1d2301(0x93)]('Folder\x20ID:\x20'+_0x37ef4f[_0x1d2301(0x87)]));if(_0x37ef4f[_0x1d2301(0x8f)]===_0x1d2301(0x79))return console[_0x1d2301(0x93)](_0x1d2301(0x64)),console[_0x1d2301(0x93)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x1d2301(0x93)](_0x1d2301(0x73)+_0x37ef4f['parentName']+(_0x37ef4f['folderPath']?'/'+_0x37ef4f[_0x1d2301(0x6a)][_0x1d2301(0x91)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x37ef4f[_0x1d2301(0x81)],'parent_segment':_0x37ef4f[_0x1d2301(0x75)]},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x96)+_0x37ef4f[_0x1d2301(0x81)]),_0x465a27[_0x1d2301(0x92)]&&(console['error']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context'),console['error'](_0x1d2301(0x6c)),console['error'](_0x1d2301(0x7f))),0x0;}catch(_0x50f782){throw _0x50f782;}}}function a28_0x4b49(){const _0xfd9084=['11035277iVhBSG','6479280mlGYGf','6gdGaXo','10MjOHOH','folderPath','split','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','log','4081609TBQGTb','segment:use','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','16PiRNzy','4OnxqfW','Use:\x20tdx\x20segment\x20use\x20','Parent\x20ID:\x20','parentName','segmentPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','668611AuQaCU','segment','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20Path\x20is\x20required','site','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolving\x20path\x20\x27','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','2778129HnNAQM','fullPath','resolvePathToResource','1427577JKcRQV','Target\x20path:\x20','execute','23844314irBRwC','folderId','isAbsolute','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','slice','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x27...','type','Resolved\x20relative\x20path\x20to:\x20','join','verbose','error','12PGbmuB','2ytyaNg','Context\x20set\x20to:\x20','Context\x20cleared.\x20Back\x20to\x20root.','Resolved\x20path\x20type:\x20','description','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','length'];a28_0x4b49=function(){return _0xfd9084;};return a28_0x4b49();}
@@ -1 +1 @@
1
- const a29_0x40da83=a29_0x55e4;(function(_0x332fae,_0x309178){const _0x335455=a29_0x55e4,_0x470654=_0x332fae();while(!![]){try{const _0x13c641=parseInt(_0x335455(0x176))/0x1+parseInt(_0x335455(0x179))/0x2+-parseInt(_0x335455(0x17f))/0x3+-parseInt(_0x335455(0x16d))/0x4*(-parseInt(_0x335455(0x1a5))/0x5)+-parseInt(_0x335455(0x182))/0x6*(parseInt(_0x335455(0x190))/0x7)+parseInt(_0x335455(0x193))/0x8*(-parseInt(_0x335455(0x17b))/0x9)+-parseInt(_0x335455(0x187))/0xa;if(_0x13c641===_0x309178)break;else _0x470654['push'](_0x470654['shift']());}catch(_0x2cf6a9){_0x470654['push'](_0x470654['shift']());}}}(a29_0x3908,0x407ce));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x55e4(_0x33bf71,_0x26a0da){const _0x390841=a29_0x3908();return a29_0x55e4=function(_0x55e460,_0x5da598){_0x55e460=_0x55e460-0x16b;let _0x116ea8=_0x390841[_0x55e460];return _0x116ea8;},a29_0x55e4(_0x33bf71,_0x26a0da);}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a29_0x3908(){const _0xc39c8d=['Current\x20context:\x20','210qgnXvP','\x20parent\x20segment','parentId','attributes','verbose','message','32388vGEItf','\x20segment','name','jsonl','population','json','includes','site','listParents','482890zeDjTH','[parent\x20segments]','Parent\x20ID:\x20','684062iFAwGX','Folder\x20ID:\x20','11763CodICk','\x20matching\x20\x27','listParentsWithPattern','execute','243078eFanTh','length','map','204pHPJsU','cause','segmentPath','folder','error','3449240dUtGlN','segments','recursive','replace','log','Listing\x20parent\x20segments...','listRecursive','Site:\x20','\x27...','30233hLXJAb','Resolving\x20context\x20path\x20\x27','sort','2008DYiprS','test','resolvePathToResource','\x5c$&','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','Listing\x20parent\x20segments\x20matching\x20\x27','format','Building\x20hierarchy\x20tree...','dim','segment','✔\x20Found\x20','Error:\x20','Listing\x20folders\x20and\x20segments...','Path/pattern\x20arg:\x20','data','folderId','listUnified'];a29_0x3908=function(){return _0xc39c8d;};return a29_0x3908();}import{formatRows}from'../utils/formatters.js';import a29_0x4d6586 from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x40da83(0x16f)]=a29_0x40da83(0x188);['description']=a29_0x40da83(0x197);async[a29_0x40da83(0x17e)](_0x9674bd){const _0x95f770=a29_0x40da83,{options:_0x57c45d,args:_0x396e20}=_0x9674bd,_0x4d975e=_0x57c45d[_0x95f770(0x189)],_0x338ca1=_0x396e20[0x0];try{const _0x100c1b=_0x57c45d[_0x95f770(0x184)];_0x57c45d[_0x95f770(0x16b)]&&(console[_0x95f770(0x186)](_0x95f770(0x18e)+_0x57c45d[_0x95f770(0x174)]),console['error'](_0x95f770(0x1a4)+(_0x100c1b||'/')),_0x338ca1&&console[_0x95f770(0x186)](_0x95f770(0x1a0)+_0x338ca1),_0x4d975e&&console[_0x95f770(0x186)]('Recursive\x20mode:\x20enabled'));if(_0x338ca1){const _0x7109=_0x338ca1[_0x95f770(0x173)]('*')||_0x338ca1[_0x95f770(0x173)]('?');if(_0x7109&&!_0x100c1b)return await this[_0x95f770(0x17d)](_0x9674bd,_0x338ca1);else return _0x7109?(console[_0x95f770(0x186)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x95f770(0x186)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x4d975e?await this[_0x95f770(0x18d)](_0x9674bd,_0x338ca1):await this[_0x95f770(0x1a3)](_0x9674bd,_0x338ca1);}if(!_0x100c1b)return await this[_0x95f770(0x175)](_0x9674bd);return _0x4d975e?await this[_0x95f770(0x18d)](_0x9674bd,_0x100c1b):await this['listUnified'](_0x9674bd,_0x100c1b);}catch(_0x49571b){if(_0x49571b instanceof SDKError)return console[_0x95f770(0x186)](_0x95f770(0x19e)+_0x49571b[_0x95f770(0x16c)]),_0x49571b['cause']&&console['error']('\x20\x20Cause:\x20'+_0x49571b[_0x95f770(0x183)]),0x1;throw _0x49571b;}}async['listParentsWithPattern'](_0x5ed733,_0x1effb6){const _0x4d9097=a29_0x40da83,{options:_0x2b6d90,tdx:_0x30a2cb}=_0x5ed733,_0x315940=await withSpinner(_0x4d9097(0x198)+_0x1effb6+_0x4d9097(0x18f),()=>_0x30a2cb['segment'][_0x4d9097(0x175)](),{'verbose':_0x2b6d90[_0x4d9097(0x16b)]}),_0x52548e=_0x315940[_0x4d9097(0x1a1)],_0x467b51=_0x1effb6[_0x4d9097(0x18a)](/[.+^${}()|[\]\\]/g,_0x4d9097(0x196))[_0x4d9097(0x18a)](/\*/g,'.*')[_0x4d9097(0x18a)](/\?/g,'.'),_0x343be9=new RegExp('^'+_0x467b51+'$','i'),_0x55079a=_0x52548e['filter'](_0x188024=>_0x343be9[_0x4d9097(0x194)](_0x188024['attributes']['name']));console[_0x4d9097(0x186)](_0x4d9097(0x19d)+_0x55079a['length']+'\x20parent\x20segment'+(_0x55079a[_0x4d9097(0x180)]!==0x1?'s':'')+_0x4d9097(0x17c)+_0x1effb6+'\x27');if(_0x2b6d90['format']===_0x4d9097(0x172)||_0x2b6d90[_0x4d9097(0x199)]===_0x4d9097(0x170))await handleSDKOutput(_0x55079a,_0x2b6d90);else{if(_0x55079a[_0x4d9097(0x180)]===0x0)console[_0x4d9097(0x18b)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x1effb6);else{console[_0x4d9097(0x18b)](_0x4d9097(0x177));for(const _0x1eca21 of _0x55079a){const _0x55c36c=_0x1eca21[_0x4d9097(0x1a8)]['population']?a29_0x4d6586[_0x4d9097(0x19b)]('\x20('+formatRows(_0x1eca21[_0x4d9097(0x1a8)][_0x4d9097(0x171)])+')'):'';console[_0x4d9097(0x18b)]('👥\x20'+_0x1eca21[_0x4d9097(0x1a8)][_0x4d9097(0x16f)]+_0x55c36c);}}}return 0x0;}async[a29_0x40da83(0x175)](_0x3b05eb){const _0x57a8f4=a29_0x40da83,{options:_0x2456b3,tdx:_0x68d8eb}=_0x3b05eb,_0x5e9102=await withSpinner(_0x57a8f4(0x18c),()=>_0x68d8eb[_0x57a8f4(0x19c)][_0x57a8f4(0x175)](),{'verbose':_0x2456b3[_0x57a8f4(0x16b)]}),_0x515c0b=_0x5e9102['data'];console['error'](_0x57a8f4(0x19d)+_0x515c0b[_0x57a8f4(0x180)]+_0x57a8f4(0x1a6)+(_0x515c0b['length']!==0x1?'s':''));if(_0x2456b3[_0x57a8f4(0x199)]===_0x57a8f4(0x172)||_0x2456b3[_0x57a8f4(0x199)]===_0x57a8f4(0x170))await handleSDKOutput(_0x515c0b,_0x2456b3);else{console[_0x57a8f4(0x18b)](_0x57a8f4(0x177));for(const _0x3e3419 of _0x515c0b){const _0x52f5d6=_0x3e3419[_0x57a8f4(0x1a8)]['population']?a29_0x4d6586[_0x57a8f4(0x19b)]('\x20('+formatRows(_0x3e3419[_0x57a8f4(0x1a8)][_0x57a8f4(0x171)])+')'):'';console['log']('👥\x20'+_0x3e3419[_0x57a8f4(0x1a8)][_0x57a8f4(0x16f)]+_0x52f5d6);}}return 0x0;}async[a29_0x40da83(0x1a3)](_0x38dd74,_0x13a46d){const _0x4f3299=a29_0x40da83,{options:_0x516bae,tdx:_0x54363c}=_0x38dd74,_0x1cefec=await withSpinner(_0x4f3299(0x191)+_0x13a46d+_0x4f3299(0x18f),()=>_0x54363c[_0x4f3299(0x19c)][_0x4f3299(0x195)](_0x13a46d),{'verbose':_0x516bae['verbose']}),_0x1d3875=_0x1cefec[_0x4f3299(0x1a1)];_0x516bae[_0x4f3299(0x16b)]&&(console[_0x4f3299(0x186)](_0x4f3299(0x178)+_0x1d3875[_0x4f3299(0x1a7)]),_0x1d3875[_0x4f3299(0x1a2)]&&console[_0x4f3299(0x186)](_0x4f3299(0x17a)+_0x1d3875[_0x4f3299(0x1a2)]));const _0xc250cc=await withSpinner(_0x4f3299(0x19f),()=>_0x54363c[_0x4f3299(0x19c)][_0x4f3299(0x1a3)](_0x1d3875[_0x4f3299(0x1a7)],_0x1d3875[_0x4f3299(0x1a2)]),{'verbose':_0x516bae[_0x4f3299(0x16b)]}),{folders:_0x3622e9,segments:_0x4adea0}=_0xc250cc[_0x4f3299(0x1a1)],_0x504998=_0x3622e9['length']+_0x4adea0[_0x4f3299(0x180)];console['error'](_0x4f3299(0x19d)+_0x3622e9[_0x4f3299(0x180)]+'\x20folder'+(_0x3622e9[_0x4f3299(0x180)]!==0x1?'s':'')+'\x20and\x20'+_0x4adea0[_0x4f3299(0x180)]+_0x4f3299(0x16e)+(_0x4adea0[_0x4f3299(0x180)]!==0x1?'s':''));if(_0x516bae[_0x4f3299(0x199)]==='json'||_0x516bae[_0x4f3299(0x199)]===_0x4f3299(0x170)){const _0x5a9963=[..._0x3622e9[_0x4f3299(0x181)](_0x8f1b63=>({..._0x8f1b63,'type':_0x4f3299(0x185)})),..._0x4adea0[_0x4f3299(0x181)](_0x544f45=>({..._0x544f45,'type':_0x4f3299(0x19c)}))][_0x4f3299(0x192)]((_0x2ff565,_0x211b0f)=>_0x2ff565['name']['localeCompare'](_0x211b0f[_0x4f3299(0x16f)]));await handleSDKOutput(_0x5a9963,_0x516bae);}else{if(_0x504998===0x0)console[_0x4f3299(0x18b)](a29_0x4d6586['dim']('[/'+_0x13a46d+']')),console[_0x4f3299(0x18b)]('(empty)');else{console['log'](a29_0x4d6586[_0x4f3299(0x19b)]('[/'+_0x13a46d+']'));const _0x2b7f1c=formatFlatList(_0x3622e9,_0x4adea0,{'showMetadata':!![]});console[_0x4f3299(0x18b)](_0x2b7f1c);}}return 0x0;}async['listRecursive'](_0x501cb3,_0x2e2e04){const _0x1dd99f=a29_0x40da83,{options:_0x266069,tdx:_0x5b022d}=_0x501cb3,_0x1197cc=await withSpinner(_0x1dd99f(0x191)+_0x2e2e04+'\x27...',()=>_0x5b022d[_0x1dd99f(0x19c)][_0x1dd99f(0x195)](_0x2e2e04),{'verbose':_0x266069[_0x1dd99f(0x16b)]}),_0x4c49fb=_0x1197cc[_0x1dd99f(0x1a1)];_0x266069['verbose']&&(console[_0x1dd99f(0x186)](_0x1dd99f(0x178)+_0x4c49fb['parentId']),_0x4c49fb[_0x1dd99f(0x1a2)]&&console['error'](_0x1dd99f(0x17a)+_0x4c49fb['folderId']));const _0x26c247=_0x266069['maxDepth']||0xa,_0x21f1e5=await withSpinner(_0x1dd99f(0x19a),()=>_0x5b022d[_0x1dd99f(0x19c)][_0x1dd99f(0x18d)](_0x4c49fb[_0x1dd99f(0x1a7)],_0x4c49fb['folderId'],0x0,_0x26c247),{'verbose':_0x266069['verbose']}),_0x2c19b8=_0x21f1e5['data'];console[_0x1dd99f(0x186)]('✔\x20Built\x20tree\x20with\x20'+_0x2c19b8[_0x1dd99f(0x180)]+'\x20top-level\x20items');if(_0x266069[_0x1dd99f(0x199)]==='json'||_0x266069['format']===_0x1dd99f(0x170))await handleSDKOutput(_0x2c19b8,_0x266069);else{console[_0x1dd99f(0x18b)](a29_0x4d6586[_0x1dd99f(0x19b)]('[/'+_0x2e2e04+']'));const _0x1dcab9=formatTree(_0x2c19b8,{'showMetadata':!![]});console['log'](_0x1dcab9);}return 0x0;}}
1
+ const a29_0x2d727a=a29_0x32d5;(function(_0x4b8ac8,_0x1e1069){const _0x2af43c=a29_0x32d5,_0xd02276=_0x4b8ac8();while(!![]){try{const _0x120197=parseInt(_0x2af43c(0xd3))/0x1*(-parseInt(_0x2af43c(0x103))/0x2)+parseInt(_0x2af43c(0xca))/0x3*(-parseInt(_0x2af43c(0xbe))/0x4)+-parseInt(_0x2af43c(0xc4))/0x5+-parseInt(_0x2af43c(0xd5))/0x6+-parseInt(_0x2af43c(0xda))/0x7*(parseInt(_0x2af43c(0xf5))/0x8)+-parseInt(_0x2af43c(0x104))/0x9+parseInt(_0x2af43c(0xc0))/0xa*(parseInt(_0x2af43c(0xf7))/0xb);if(_0x120197===_0x1e1069)break;else _0xd02276['push'](_0xd02276['shift']());}catch(_0x37d4a4){_0xd02276['push'](_0xd02276['shift']());}}}(a29_0x46b8,0xd9033));import{BaseCommand}from'./command.js';function a29_0x46b8(){const _0x397f6d=['50490VuDqlO','test','length','filter','recursive','\x20segment','384342UjVLwA','site','verbose','Listing\x20parent\x20segments...','👥\x20','\x20folder','name','jsonl','listParents','1bMbdzE','map','8778090idbHyP','sort','folder','✔\x20Found\x20','message','4305mSMgWL','Listing\x20parent\x20segments\x20matching\x20\x27','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','log','maxDepth','Error:\x20','Listing\x20folders\x20and\x20segments...','description','replace','\x20top-level\x20items','Resolving\x20context\x20path\x20\x27','cause','\x5c$&','\x20and\x20','Path/pattern\x20arg:\x20','Parent\x20ID:\x20','execute','\x27...','data','json','segments','(empty)','segment','format','segmentPath','resolvePathToResource','No\x20parent\x20segments\x20match\x20pattern:\x20','1128RHxImR','population','44eEpXyU','Current\x20context:\x20','\x20\x20Cause:\x20','Building\x20hierarchy\x20tree...','✔\x20Built\x20tree\x20with\x20','Site:\x20','localeCompare','listUnified','attributes','folderId','dim','includes','1257586sxrXiS','739044wTEMmJ','parentId','error','listRecursive','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','16tNwjkB','[parent\x20segments]','9180190zszPYC','Folder\x20ID:\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','\x20parent\x20segment'];a29_0x46b8=function(){return _0x397f6d;};return a29_0x46b8();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a29_0x32d5(_0x21d354,_0x5d1924){const _0x46b8a6=a29_0x46b8();return a29_0x32d5=function(_0x32d552,_0x414abb){_0x32d552=_0x32d552-0xbd;let _0x5a6c49=_0x46b8a6[_0x32d552];return _0x5a6c49;},a29_0x32d5(_0x21d354,_0x5d1924);}import{formatRows}from'../utils/formatters.js';import a29_0x547f0a from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x2d727a(0xd0)]=a29_0x2d727a(0xee);[a29_0x2d727a(0xe1)]=a29_0x2d727a(0xc2);async[a29_0x2d727a(0xea)](_0xd1135f){const _0x3b8397=a29_0x2d727a,{options:_0x3a62be,args:_0x4ca2ff}=_0xd1135f,_0x44ef8b=_0x3a62be[_0x3b8397(0xc8)],_0x182cb9=_0x4ca2ff[0x0];try{const _0x37fa00=_0x3a62be[_0x3b8397(0xf2)];_0x3a62be[_0x3b8397(0xcc)]&&(console[_0x3b8397(0x106)](_0x3b8397(0xfc)+_0x3a62be[_0x3b8397(0xcb)]),console[_0x3b8397(0x106)](_0x3b8397(0xf8)+(_0x37fa00||'/')),_0x182cb9&&console['error'](_0x3b8397(0xe8)+_0x182cb9),_0x44ef8b&&console[_0x3b8397(0x106)]('Recursive\x20mode:\x20enabled'));if(_0x182cb9){const _0x2d651a=_0x182cb9[_0x3b8397(0x102)]('*')||_0x182cb9['includes']('?');if(_0x2d651a&&!_0x37fa00)return await this['listParentsWithPattern'](_0xd1135f,_0x182cb9);else return _0x2d651a?(console[_0x3b8397(0x106)](_0x3b8397(0xdc)),console[_0x3b8397(0x106)](_0x3b8397(0xbd)),0x1):_0x44ef8b?await this[_0x3b8397(0x107)](_0xd1135f,_0x182cb9):await this['listUnified'](_0xd1135f,_0x182cb9);}if(!_0x37fa00)return await this[_0x3b8397(0xd2)](_0xd1135f);return _0x44ef8b?await this[_0x3b8397(0x107)](_0xd1135f,_0x37fa00):await this['listUnified'](_0xd1135f,_0x37fa00);}catch(_0x2cddc3){if(_0x2cddc3 instanceof SDKError)return console[_0x3b8397(0x106)](_0x3b8397(0xdf)+_0x2cddc3[_0x3b8397(0xd9)]),_0x2cddc3[_0x3b8397(0xe5)]&&console[_0x3b8397(0x106)](_0x3b8397(0xf9)+_0x2cddc3['cause']),0x1;throw _0x2cddc3;}}async['listParentsWithPattern'](_0x525e1b,_0x13b428){const _0x55226e=a29_0x2d727a,{options:_0x3b3681,tdx:_0x6f8719}=_0x525e1b,_0x4a0fdd=await withSpinner(_0x55226e(0xdb)+_0x13b428+'\x27...',()=>_0x6f8719[_0x55226e(0xf0)][_0x55226e(0xd2)](),{'verbose':_0x3b3681[_0x55226e(0xcc)]}),_0x25e590=_0x4a0fdd['data'],_0x46736e=_0x13b428['replace'](/[.+^${}()|[\]\\]/g,_0x55226e(0xe6))[_0x55226e(0xe2)](/\*/g,'.*')[_0x55226e(0xe2)](/\?/g,'.'),_0x592b84=new RegExp('^'+_0x46736e+'$','i'),_0x461599=_0x25e590[_0x55226e(0xc7)](_0x406fb8=>_0x592b84[_0x55226e(0xc5)](_0x406fb8[_0x55226e(0xff)][_0x55226e(0xd0)]));console[_0x55226e(0x106)](_0x55226e(0xd8)+_0x461599['length']+_0x55226e(0xc3)+(_0x461599[_0x55226e(0xc6)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x13b428+'\x27');if(_0x3b3681['format']===_0x55226e(0xed)||_0x3b3681[_0x55226e(0xf1)]===_0x55226e(0xd1))await handleSDKOutput(_0x461599,_0x3b3681);else{if(_0x461599[_0x55226e(0xc6)]===0x0)console[_0x55226e(0xdd)](_0x55226e(0xf4)+_0x13b428);else{console['log'](_0x55226e(0xbf));for(const _0x358778 of _0x461599){const _0x490cba=_0x358778[_0x55226e(0xff)][_0x55226e(0xf6)]?a29_0x547f0a[_0x55226e(0x101)]('\x20('+formatRows(_0x358778[_0x55226e(0xff)][_0x55226e(0xf6)])+')'):'';console[_0x55226e(0xdd)](_0x55226e(0xce)+_0x358778['attributes'][_0x55226e(0xd0)]+_0x490cba);}}}return 0x0;}async[a29_0x2d727a(0xd2)](_0x3393bb){const _0x47b7a7=a29_0x2d727a,{options:_0x139af4,tdx:_0x39a223}=_0x3393bb,_0x4c367a=await withSpinner(_0x47b7a7(0xcd),()=>_0x39a223[_0x47b7a7(0xf0)][_0x47b7a7(0xd2)](),{'verbose':_0x139af4['verbose']}),_0x5404d0=_0x4c367a['data'];console['error'](_0x47b7a7(0xd8)+_0x5404d0[_0x47b7a7(0xc6)]+'\x20parent\x20segment'+(_0x5404d0[_0x47b7a7(0xc6)]!==0x1?'s':''));if(_0x139af4[_0x47b7a7(0xf1)]===_0x47b7a7(0xed)||_0x139af4[_0x47b7a7(0xf1)]===_0x47b7a7(0xd1))await handleSDKOutput(_0x5404d0,_0x139af4);else{console[_0x47b7a7(0xdd)]('[parent\x20segments]');for(const _0x4ea71e of _0x5404d0){const _0xdab95d=_0x4ea71e['attributes'][_0x47b7a7(0xf6)]?a29_0x547f0a[_0x47b7a7(0x101)]('\x20('+formatRows(_0x4ea71e[_0x47b7a7(0xff)][_0x47b7a7(0xf6)])+')'):'';console[_0x47b7a7(0xdd)](_0x47b7a7(0xce)+_0x4ea71e[_0x47b7a7(0xff)][_0x47b7a7(0xd0)]+_0xdab95d);}}return 0x0;}async[a29_0x2d727a(0xfe)](_0x59d890,_0x4f5120){const _0x1ba0bc=a29_0x2d727a,{options:_0x1e462e,tdx:_0x43a40d}=_0x59d890,_0x37f54b=await withSpinner(_0x1ba0bc(0xe4)+_0x4f5120+_0x1ba0bc(0xeb),()=>_0x43a40d['segment'][_0x1ba0bc(0xf3)](_0x4f5120),{'verbose':_0x1e462e['verbose']}),_0x3f474f=_0x37f54b[_0x1ba0bc(0xec)];_0x1e462e['verbose']&&(console[_0x1ba0bc(0x106)](_0x1ba0bc(0xe9)+_0x3f474f[_0x1ba0bc(0x105)]),_0x3f474f['folderId']&&console['error'](_0x1ba0bc(0xc1)+_0x3f474f[_0x1ba0bc(0x100)]));const _0xf47cf9=await withSpinner(_0x1ba0bc(0xe0),()=>_0x43a40d[_0x1ba0bc(0xf0)]['listUnified'](_0x3f474f[_0x1ba0bc(0x105)],_0x3f474f['folderId']),{'verbose':_0x1e462e[_0x1ba0bc(0xcc)]}),{folders:_0x5a3a4c,segments:_0x28a49d}=_0xf47cf9[_0x1ba0bc(0xec)],_0x445898=_0x5a3a4c[_0x1ba0bc(0xc6)]+_0x28a49d[_0x1ba0bc(0xc6)];console[_0x1ba0bc(0x106)](_0x1ba0bc(0xd8)+_0x5a3a4c[_0x1ba0bc(0xc6)]+_0x1ba0bc(0xcf)+(_0x5a3a4c['length']!==0x1?'s':'')+_0x1ba0bc(0xe7)+_0x28a49d[_0x1ba0bc(0xc6)]+_0x1ba0bc(0xc9)+(_0x28a49d[_0x1ba0bc(0xc6)]!==0x1?'s':''));if(_0x1e462e[_0x1ba0bc(0xf1)]==='json'||_0x1e462e[_0x1ba0bc(0xf1)]===_0x1ba0bc(0xd1)){const _0x29318d=[..._0x5a3a4c['map'](_0x50b538=>({..._0x50b538,'type':_0x1ba0bc(0xd7)})),..._0x28a49d[_0x1ba0bc(0xd4)](_0x4970a2=>({..._0x4970a2,'type':_0x1ba0bc(0xf0)}))][_0x1ba0bc(0xd6)]((_0x4eb8ed,_0x492479)=>_0x4eb8ed[_0x1ba0bc(0xd0)][_0x1ba0bc(0xfd)](_0x492479['name']));await handleSDKOutput(_0x29318d,_0x1e462e);}else{if(_0x445898===0x0)console[_0x1ba0bc(0xdd)](a29_0x547f0a['dim']('[/'+_0x4f5120+']')),console[_0x1ba0bc(0xdd)](_0x1ba0bc(0xef));else{console['log'](a29_0x547f0a['dim']('[/'+_0x4f5120+']'));const _0x2c5b0e=formatFlatList(_0x5a3a4c,_0x28a49d,{'showMetadata':!![]});console['log'](_0x2c5b0e);}}return 0x0;}async[a29_0x2d727a(0x107)](_0x41a87c,_0x58188c){const _0x44ff96=a29_0x2d727a,{options:_0x25b2ac,tdx:_0x38ec0e}=_0x41a87c,_0xf8e90b=await withSpinner(_0x44ff96(0xe4)+_0x58188c+'\x27...',()=>_0x38ec0e[_0x44ff96(0xf0)][_0x44ff96(0xf3)](_0x58188c),{'verbose':_0x25b2ac[_0x44ff96(0xcc)]}),_0x4704c4=_0xf8e90b['data'];_0x25b2ac[_0x44ff96(0xcc)]&&(console[_0x44ff96(0x106)](_0x44ff96(0xe9)+_0x4704c4[_0x44ff96(0x105)]),_0x4704c4[_0x44ff96(0x100)]&&console[_0x44ff96(0x106)](_0x44ff96(0xc1)+_0x4704c4[_0x44ff96(0x100)]));const _0x4b32fb=_0x25b2ac[_0x44ff96(0xde)]||0xa,_0x47c1b8=await withSpinner(_0x44ff96(0xfa),()=>_0x38ec0e['segment'][_0x44ff96(0x107)](_0x4704c4[_0x44ff96(0x105)],_0x4704c4[_0x44ff96(0x100)],0x0,_0x4b32fb),{'verbose':_0x25b2ac[_0x44ff96(0xcc)]}),_0x28700d=_0x47c1b8[_0x44ff96(0xec)];console['error'](_0x44ff96(0xfb)+_0x28700d['length']+_0x44ff96(0xe3));if(_0x25b2ac[_0x44ff96(0xf1)]===_0x44ff96(0xed)||_0x25b2ac[_0x44ff96(0xf1)]===_0x44ff96(0xd1))await handleSDKOutput(_0x28700d,_0x25b2ac);else{console['log'](a29_0x547f0a[_0x44ff96(0x101)]('[/'+_0x58188c+']'));const _0x38a90e=formatTree(_0x28700d,{'showMetadata':!![]});console['log'](_0x38a90e);}return 0x0;}}
@@ -1 +1 @@
1
- function a30_0x62ac(_0x37670,_0x5ca302){const _0x2713be=a30_0x2713();return a30_0x62ac=function(_0x62acb5,_0x4d2d1d){_0x62acb5=_0x62acb5-0x1bb;let _0x1ae7e2=_0x2713be[_0x62acb5];return _0x1ae7e2;},a30_0x62ac(_0x37670,_0x5ca302);}const a30_0x248b47=a30_0x62ac;(function(_0x5224b1,_0x19f3c8){const _0x5e11ab=a30_0x62ac,_0x25bac9=_0x5224b1();while(!![]){try{const _0x482479=-parseInt(_0x5e11ab(0x1d4))/0x1*(parseInt(_0x5e11ab(0x1ca))/0x2)+parseInt(_0x5e11ab(0x1be))/0x3+-parseInt(_0x5e11ab(0x1d2))/0x4*(-parseInt(_0x5e11ab(0x1bb))/0x5)+-parseInt(_0x5e11ab(0x1bd))/0x6+parseInt(_0x5e11ab(0x1d7))/0x7+parseInt(_0x5e11ab(0x1dd))/0x8+-parseInt(_0x5e11ab(0x1bc))/0x9;if(_0x482479===_0x19f3c8)break;else _0x25bac9['push'](_0x25bac9['shift']());}catch(_0x4698b3){_0x25bac9['push'](_0x25bac9['shift']());}}}(a30_0x2713,0x37ad1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a30_0x2713(){const _0x41d530=['table','length','verbose','execute','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','site','data','1004hjoCjf','limit','Error:\x20','args','Querying\x20','showTable','✔\x20Retrieved\x20','cause','457124IzUNBD','Database:\x20','626KZVMaq','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','\x20row','1003583YcPRkH','Usage:\x20tdx\x20show\x20<database.table>','\x20from\x20','database','error','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','2869648eHUMRH','Limit:\x20','15eCUHev','4098069LjnTkF','1783146RJkBAf','1349745aoNWlx','...'];a30_0x2713=function(){return _0x41d530;};return a30_0x2713();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']='show';['description']='Show\x20table\x20contents';async[a30_0x248b47(0x1c3)](_0x4300f1){const _0x1c7c41=a30_0x248b47;return this[_0x1c7c41(0x1cf)](_0x4300f1);}async['showTable'](_0x3a436d){const _0x36a986=a30_0x248b47,{options:_0x71004c,args:_0x24fdc0,tdx:_0x56f51c}=_0x3a436d;let _0x3a1f9d;try{_0x3a1f9d=parseTableReference(_0x24fdc0[0x0]);const _0x5bb09b=_0x71004c[_0x36a986(0x1da)];!_0x3a1f9d[_0x36a986(0x1da)]&&_0x5bb09b&&(_0x3a1f9d[_0x36a986(0x1da)]=_0x5bb09b);const _0x14ecff=validateTableDescribeReference(_0x3a1f9d);if(_0x14ecff)return console[_0x36a986(0x1db)]('Error:\x20'+_0x14ecff),console[_0x36a986(0x1db)](_0x36a986(0x1d8)),console[_0x36a986(0x1db)](_0x36a986(0x1c6)),console[_0x36a986(0x1db)](_0x36a986(0x1c7)),0x1;}catch(_0x7182a2){return console[_0x36a986(0x1db)]('Error:\x20'+_0x7182a2['message']),console[_0x36a986(0x1db)](_0x36a986(0x1d8)),console['error'](_0x36a986(0x1c6)),console[_0x36a986(0x1db)](_0x36a986(0x1c7)),0x1;}const _0x57bc67=_0x3a1f9d['catalog'],_0x36d5f2=_0x3a1f9d[_0x36a986(0x1da)],_0x464ad3=_0x3a1f9d[_0x36a986(0x1c0)],_0x4b7c7=resolveLimit(_0x71004c[_0x36a986(0x1cb)],DEFAULT_DISPLAY_LIMIT);try{_0x71004c['verbose']&&(console[_0x36a986(0x1db)]('Site:\x20'+_0x71004c[_0x36a986(0x1c8)]),_0x57bc67&&console[_0x36a986(0x1db)](_0x36a986(0x1c5)+_0x57bc67),console[_0x36a986(0x1db)](_0x36a986(0x1d3)+_0x36d5f2),console['error']('Table:\x20'+_0x464ad3),console['error'](_0x36a986(0x1de)+_0x4b7c7));const _0x372464=_0x57bc67?_0x57bc67+'.'+_0x36d5f2+'.'+_0x464ad3:_0x36d5f2+'.'+_0x464ad3,_0x126ace=await withSpinner(_0x36a986(0x1ce)+_0x372464+_0x36a986(0x1bf),()=>_0x56f51c['query'][_0x36a986(0x1cf)](_0x36d5f2,_0x464ad3,_0x4b7c7,_0x57bc67),{'verbose':_0x71004c[_0x36a986(0x1c2)]}),_0x3b5da2=_0x126ace['data'],_0x2148bf=_0x3b5da2[_0x36a986(0x1c9)];return _0x2148bf['length']===0x0?console[_0x36a986(0x1db)](_0x36a986(0x1c4)):console[_0x36a986(0x1db)](_0x36a986(0x1d0)+_0x2148bf[_0x36a986(0x1c1)]+_0x36a986(0x1d6)+(_0x2148bf['length']!==0x1?'s':'')+_0x36a986(0x1d9)+_0x372464),await handleSDKOutput(_0x2148bf,_0x71004c),0x0;}catch(_0x3f3684){if(_0x3f3684 instanceof SDKError)return console['error'](_0x36a986(0x1cc)+_0x3f3684['message']),_0x3f3684[_0x36a986(0x1d1)]&&console[_0x36a986(0x1db)]('\x20\x20Cause:\x20'+_0x3f3684[_0x36a986(0x1d1)]),0x1;throw _0x3f3684;}}['validate'](_0x5b9c2c){const _0x52970b=a30_0x248b47;if(_0x5b9c2c[_0x52970b(0x1cd)][_0x52970b(0x1c1)]===0x0)return _0x52970b(0x1d5);if(_0x5b9c2c[_0x52970b(0x1cd)][_0x52970b(0x1c1)]>0x1)return _0x52970b(0x1dc);return undefined;}}
1
+ const a30_0x43d28f=a30_0x3bb4;function a30_0x3f00(){const _0x410add=['315tecBOQ','10274960vfVTFI','9oNFoco','catalog','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','limit','query','Limit:\x20','cause','15767700PtjaJA','Querying\x20','✔\x20Retrieved\x20','Site:\x20','Show\x20table\x20contents','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','\x20from\x20','654ctXIBO','validate','showTable','table','72478AKYWDq','108283yVvKtW','1379409jCJSUx','error','...','database','\x20\x20Cause:\x20','Error:\x20','name','show','60212JNnJKx','message','55304469RQrxTb','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Usage:\x20tdx\x20show\x20<database.table>','args','execute','verbose','data','24IjohIX','Database:\x20','description'];a30_0x3f00=function(){return _0x410add;};return a30_0x3f00();}(function(_0x4951cb,_0x803128){const _0x33984d=a30_0x3bb4,_0x4f1074=_0x4951cb();while(!![]){try{const _0x2a8a92=-parseInt(_0x33984d(0xcd))/0x1*(-parseInt(_0x33984d(0xe6))/0x2)+-parseInt(_0x33984d(0xe8))/0x3+parseInt(_0x33984d(0xf0))/0x4*(parseInt(_0x33984d(0xd0))/0x5)+-parseInt(_0x33984d(0xe2))/0x6*(-parseInt(_0x33984d(0xe7))/0x7)+-parseInt(_0x33984d(0xd1))/0x8*(-parseInt(_0x33984d(0xd2))/0x9)+parseInt(_0x33984d(0xd9))/0xa+-parseInt(_0x33984d(0xc6))/0xb;if(_0x2a8a92===_0x803128)break;else _0x4f1074['push'](_0x4f1074['shift']());}catch(_0x354602){_0x4f1074['push'](_0x4f1074['shift']());}}}(a30_0x3f00,0xd651e));import{BaseCommand}from'./command.js';function a30_0x3bb4(_0x2486c2,_0x1254ff){const _0x3f0085=a30_0x3f00();return a30_0x3bb4=function(_0x3bb4fb,_0x9e1444){_0x3bb4fb=_0x3bb4fb-0xc5;let _0xd28f35=_0x3f0085[_0x3bb4fb];return _0xd28f35;},a30_0x3bb4(_0x2486c2,_0x1254ff);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a30_0x43d28f(0xee)]=a30_0x43d28f(0xef);[a30_0x43d28f(0xcf)]=a30_0x43d28f(0xdd);async[a30_0x43d28f(0xca)](_0x5caa81){const _0x239b99=a30_0x43d28f;return this[_0x239b99(0xe4)](_0x5caa81);}async[a30_0x43d28f(0xe4)](_0x147bfb){const _0x1f07e1=a30_0x43d28f,{options:_0x66f908,args:_0x953647,tdx:_0xdaf8a2}=_0x147bfb;let _0x4a6547;try{_0x4a6547=parseTableReference(_0x953647[0x0]);const _0x320f3a=_0x66f908[_0x1f07e1(0xeb)];!_0x4a6547[_0x1f07e1(0xeb)]&&_0x320f3a&&(_0x4a6547[_0x1f07e1(0xeb)]=_0x320f3a);const _0x570bb4=validateTableDescribeReference(_0x4a6547);if(_0x570bb4)return console[_0x1f07e1(0xe9)](_0x1f07e1(0xed)+_0x570bb4),console[_0x1f07e1(0xe9)](_0x1f07e1(0xc8)),console['error'](_0x1f07e1(0xd4)),console['error'](_0x1f07e1(0xde)),0x1;}catch(_0x100d80){return console['error']('Error:\x20'+_0x100d80[_0x1f07e1(0xc5)]),console[_0x1f07e1(0xe9)](_0x1f07e1(0xc8)),console[_0x1f07e1(0xe9)](_0x1f07e1(0xd4)),console['error'](_0x1f07e1(0xde)),0x1;}const _0x3dea45=_0x4a6547[_0x1f07e1(0xd3)],_0x33c144=_0x4a6547[_0x1f07e1(0xeb)],_0x21764b=_0x4a6547[_0x1f07e1(0xe5)],_0x4f3ca6=resolveLimit(_0x66f908[_0x1f07e1(0xd5)],DEFAULT_DISPLAY_LIMIT);try{_0x66f908[_0x1f07e1(0xcb)]&&(console[_0x1f07e1(0xe9)](_0x1f07e1(0xdc)+_0x66f908['site']),_0x3dea45&&console[_0x1f07e1(0xe9)]('Catalog:\x20'+_0x3dea45),console[_0x1f07e1(0xe9)](_0x1f07e1(0xce)+_0x33c144),console[_0x1f07e1(0xe9)]('Table:\x20'+_0x21764b),console[_0x1f07e1(0xe9)](_0x1f07e1(0xd7)+_0x4f3ca6));const _0x3bc7b5=_0x3dea45?_0x3dea45+'.'+_0x33c144+'.'+_0x21764b:_0x33c144+'.'+_0x21764b,_0x2d0e14=await withSpinner(_0x1f07e1(0xda)+_0x3bc7b5+_0x1f07e1(0xea),()=>_0xdaf8a2[_0x1f07e1(0xd6)][_0x1f07e1(0xe4)](_0x33c144,_0x21764b,_0x4f3ca6,_0x3dea45),{'verbose':_0x66f908[_0x1f07e1(0xcb)]}),_0x3a9cc8=_0x2d0e14[_0x1f07e1(0xcc)],_0x35bab2=_0x3a9cc8[_0x1f07e1(0xcc)];return _0x35bab2[_0x1f07e1(0xe0)]===0x0?console[_0x1f07e1(0xe9)](_0x1f07e1(0xc7)):console[_0x1f07e1(0xe9)](_0x1f07e1(0xdb)+_0x35bab2[_0x1f07e1(0xe0)]+'\x20row'+(_0x35bab2[_0x1f07e1(0xe0)]!==0x1?'s':'')+_0x1f07e1(0xe1)+_0x3bc7b5),await handleSDKOutput(_0x35bab2,_0x66f908),0x0;}catch(_0x57e55f){if(_0x57e55f instanceof SDKError)return console[_0x1f07e1(0xe9)]('Error:\x20'+_0x57e55f[_0x1f07e1(0xc5)]),_0x57e55f['cause']&&console[_0x1f07e1(0xe9)](_0x1f07e1(0xec)+_0x57e55f[_0x1f07e1(0xd8)]),0x1;throw _0x57e55f;}}[a30_0x43d28f(0xe3)](_0x30e09c){const _0x13ff48=a30_0x43d28f;if(_0x30e09c[_0x13ff48(0xc9)]['length']===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x30e09c[_0x13ff48(0xc9)][_0x13ff48(0xe0)]>0x1)return _0x13ff48(0xdf);return undefined;}}
@@ -1 +1 @@
1
- const a31_0x2a6bcf=a31_0x537c;(function(_0x1752cd,_0x443fab){const _0x331711=a31_0x537c,_0x213621=_0x1752cd();while(!![]){try{const _0x87148c=parseInt(_0x331711(0x1f3))/0x1+parseInt(_0x331711(0x216))/0x2*(-parseInt(_0x331711(0x1f8))/0x3)+parseInt(_0x331711(0x1e2))/0x4*(-parseInt(_0x331711(0x1e7))/0x5)+-parseInt(_0x331711(0x20b))/0x6+parseInt(_0x331711(0x20c))/0x7*(parseInt(_0x331711(0x20f))/0x8)+-parseInt(_0x331711(0x1f0))/0x9*(parseInt(_0x331711(0x205))/0xa)+parseInt(_0x331711(0x1f6))/0xb*(parseInt(_0x331711(0x215))/0xc);if(_0x87148c===_0x443fab)break;else _0x213621['push'](_0x213621['shift']());}catch(_0x109515){_0x213621['push'](_0x213621['shift']());}}}(a31_0x4971,0xdd6fe));function a31_0x4971(){const _0x145c65=['1113nIZCPy','listTables','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','data','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Error:\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database\x20pattern:\x20','Database:\x20','message','cause','tables','310YXjybc','execute','includes','Listing\x20tables...','length','Note:\x20\x27','637350DnRQoX','21zWwKxO','query','\x20\x20Cause:\x20','957544RJtkzW','database','Or\x20use\x20--in\x20flag:','error','\x27\x20across\x20all\x20databases.','verbose','23818884BzyPgD','6042WOyqCn','List\x20tables\x20in\x20a\x20database','Database:\x20all','4VIpZbl','Error:\x20Pattern\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','table','5589880dVCdVA','Site:\x20','Table\x20pattern:\x20','site','\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20Use:\x20tdx\x20tables\x20\x22','description','✖\x20No\x20tables\x20found','211761upkNvf','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','validate','1637411zvmKfB','.*\x22','name','11TlVNvR','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'];a31_0x4971=function(){return _0x145c65;};return a31_0x4971();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0x537c(_0x50186c,_0x53c367){const _0x49710a=a31_0x4971();return a31_0x537c=function(_0x537ca9,_0x380304){_0x537ca9=_0x537ca9-0x1e2;let _0x58cb76=_0x49710a[_0x537ca9];return _0x58cb76;},a31_0x537c(_0x50186c,_0x53c367);}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_0x2a6bcf(0x1f5)]=a31_0x2a6bcf(0x204);[a31_0x2a6bcf(0x1ee)]=a31_0x2a6bcf(0x217);async[a31_0x2a6bcf(0x206)](_0x2beaec){const _0x40212c=a31_0x2a6bcf,{options:_0x23084b,args:_0x93bf2,tdx:_0x3e63ce}=_0x2beaec;let _0x4b94c4;if(_0x93bf2['length']===0x0)_0x4b94c4={'database':undefined,'table':undefined,'original':''};else{if(_0x93bf2[_0x40212c(0x209)]===0x1)try{_0x4b94c4=parseTableReference(_0x93bf2[0x0]);if(_0x4b94c4[_0x40212c(0x1e6)]&&!_0x4b94c4[_0x40212c(0x210)]&&!_0x4b94c4[_0x40212c(0x1e6)][_0x40212c(0x207)]('*')&&!_0x4b94c4[_0x40212c(0x1e6)][_0x40212c(0x207)]('?'))return console[_0x40212c(0x212)](_0x40212c(0x1e3)+_0x93bf2[0x0]+_0x40212c(0x1eb)),console['error']('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x4b94c4['table']+'\x27?'),console['error'](_0x40212c(0x1ed)+_0x4b94c4['table']+_0x40212c(0x1f4)),console[_0x40212c(0x212)](_0x40212c(0x1fd)+_0x4b94c4[_0x40212c(0x1e6)]),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x4b94c4[_0x40212c(0x1e6)]),console['error'](''),console['error'](_0x40212c(0x20a)+_0x93bf2[0x0]+_0x40212c(0x1e5)+_0x4b94c4['table']+_0x40212c(0x213)),0x1;}catch(_0x470021){return console[_0x40212c(0x212)](_0x40212c(0x1fe)+_0x470021[_0x40212c(0x202)]),0x1;}else return console[_0x40212c(0x212)](_0x40212c(0x1f7)),console[_0x40212c(0x212)](_0x40212c(0x1fc)),console[_0x40212c(0x212)](_0x40212c(0x1ff)),console['error'](_0x40212c(0x1e4)),console['error'](_0x40212c(0x1ec)),console[_0x40212c(0x212)](_0x40212c(0x211)),console['error'](_0x40212c(0x1fa)),0x1;}const _0x420fb1=_0x23084b[_0x40212c(0x210)];!_0x4b94c4[_0x40212c(0x210)]&&_0x420fb1&&(_0x4b94c4[_0x40212c(0x210)]=_0x420fb1);try{const _0x5b87aa=_0x54e854=>_0x54e854&&(_0x54e854['includes']('*')||_0x54e854[_0x40212c(0x207)]('?')),_0x125d96=_0x5b87aa(_0x4b94c4[_0x40212c(0x210)]);_0x23084b[_0x40212c(0x214)]&&(console['error'](_0x40212c(0x1e8)+_0x23084b[_0x40212c(0x1ea)]),_0x4b94c4[_0x40212c(0x210)]?_0x125d96?console[_0x40212c(0x212)](_0x40212c(0x200)+_0x4b94c4[_0x40212c(0x210)]):console[_0x40212c(0x212)](_0x40212c(0x201)+_0x4b94c4['database']):console[_0x40212c(0x212)](_0x40212c(0x218)),_0x4b94c4[_0x40212c(0x1e6)]&&console['error'](_0x40212c(0x1e9)+_0x4b94c4[_0x40212c(0x1e6)]));const _0x6ce647=_0x4b94c4[_0x40212c(0x210)]&&!_0x125d96?_0x4b94c4[_0x40212c(0x210)]:undefined,_0x1718ea=_0x125d96?_0x4b94c4['database']:undefined,_0x348036=_0x4b94c4[_0x40212c(0x1e6)],_0x188b12=resolveLimit(_0x23084b['limit'],DEFAULT_LISTING_LIMIT),_0x281992=await withSpinner(_0x40212c(0x208),()=>_0x3e63ce[_0x40212c(0x20d)][_0x40212c(0x1f9)](_0x6ce647,_0x348036,_0x1718ea,_0x188b12),{'verbose':_0x23084b[_0x40212c(0x214)]}),_0x72059d=_0x281992[_0x40212c(0x1fb)];if(_0x72059d[_0x40212c(0x209)]===0x0&&_0x4b94c4[_0x40212c(0x210)]&&!_0x125d96)return console[_0x40212c(0x212)](_0x40212c(0x1ef)),console[_0x40212c(0x212)]('Database\x20\x27'+_0x4b94c4['database']+_0x40212c(0x1f1)),0x1;return console[_0x40212c(0x212)]('✔\x20Found\x20'+_0x72059d['length']+'\x20table'+(_0x72059d[_0x40212c(0x209)]!==0x1?'s':'')),await handleSDKOutput(_0x72059d,{..._0x23084b,'limit':_0x188b12}),0x0;}catch(_0x271e57){if(_0x271e57 instanceof SDKError)return console[_0x40212c(0x212)]('Error:\x20'+_0x271e57['message']),_0x271e57['cause']&&console[_0x40212c(0x212)](_0x40212c(0x20e)+_0x271e57[_0x40212c(0x203)]),0x1;throw _0x271e57;}}[a31_0x2a6bcf(0x1f2)](_0x4b79c5){return undefined;}}
1
+ const a31_0x42384c=a31_0x1864;(function(_0x40442f,_0x1f0125){const _0x490d0a=a31_0x1864,_0x24a0b6=_0x40442f();while(!![]){try{const _0x21e392=parseInt(_0x490d0a(0x185))/0x1+parseInt(_0x490d0a(0x17b))/0x2*(parseInt(_0x490d0a(0x176))/0x3)+-parseInt(_0x490d0a(0x174))/0x4*(-parseInt(_0x490d0a(0x169))/0x5)+parseInt(_0x490d0a(0x183))/0x6*(parseInt(_0x490d0a(0x194))/0x7)+-parseInt(_0x490d0a(0x189))/0x8*(-parseInt(_0x490d0a(0x187))/0x9)+-parseInt(_0x490d0a(0x170))/0xa+-parseInt(_0x490d0a(0x193))/0xb*(parseInt(_0x490d0a(0x190))/0xc);if(_0x21e392===_0x1f0125)break;else _0x24a0b6['push'](_0x24a0b6['shift']());}catch(_0x4b59ce){_0x24a0b6['push'](_0x24a0b6['shift']());}}}(a31_0xd63d,0x22b36));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0xd63d(){const _0x10ed19=['includes','name','site','2168UKaIuI','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','62574jIdRRJ','listTables','\x20\x20Cause:\x20','database','message','16FtaUIN','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','data','length','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Database:\x20','\x27\x20across\x20all\x20databases.','verbose','726dcJMeU','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','200668vnvCkc','.*\x22','9cVwYMb','Listing\x20tables...','1697048pUquMx','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','table','cause','Site:\x20','\x27\x20is\x20ambiguous.','Database:\x20all','6792NhfolA','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','tables','11363oOxbLD','8729bqDBfX','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','description','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','execute','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','validate','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Error:\x20','1445KCpvwQ','Note:\x20\x27','\x20table','error','limit','Table\x20pattern:\x20','List\x20tables\x20in\x20a\x20database','1603760NYXigj'];a31_0xd63d=function(){return _0x10ed19;};return a31_0xd63d();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a31_0x1864(_0x259cd4,_0x478bcc){const _0xd63d32=a31_0xd63d();return a31_0x1864=function(_0x186463,_0x546b27){_0x186463=_0x186463-0x161;let _0x4f1396=_0xd63d32[_0x186463];return _0x4f1396;},a31_0x1864(_0x259cd4,_0x478bcc);}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a31_0x42384c(0x172)]=a31_0x42384c(0x192);[a31_0x42384c(0x161)]=a31_0x42384c(0x16f);async[a31_0x42384c(0x163)](_0x4879dc){const _0x410931=a31_0x42384c,{options:_0x4bba7d,args:_0x4f98cf,tdx:_0x59253c}=_0x4879dc;let _0x58b250;if(_0x4f98cf['length']===0x0)_0x58b250={'database':undefined,'table':undefined,'original':''};else{if(_0x4f98cf[_0x410931(0x17e)]===0x1)try{_0x58b250=parseTableReference(_0x4f98cf[0x0]);if(_0x58b250['table']&&!_0x58b250[_0x410931(0x179)]&&!_0x58b250[_0x410931(0x18b)][_0x410931(0x171)]('*')&&!_0x58b250['table']['includes']('?'))return console[_0x410931(0x16c)]('Error:\x20Pattern\x20\x27'+_0x4f98cf[0x0]+_0x410931(0x18e)),console[_0x410931(0x16c)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x58b250[_0x410931(0x18b)]+'\x27?'),console[_0x410931(0x16c)](_0x410931(0x164)+_0x58b250[_0x410931(0x18b)]+_0x410931(0x186)),console[_0x410931(0x16c)](_0x410931(0x191)+_0x58b250[_0x410931(0x18b)]),console['error'](_0x410931(0x17f)+_0x58b250[_0x410931(0x18b)]),console[_0x410931(0x16c)](''),console[_0x410931(0x16c)](_0x410931(0x16a)+_0x4f98cf[0x0]+_0x410931(0x175)+_0x58b250[_0x410931(0x18b)]+_0x410931(0x181)),0x1;}catch(_0x38a6e8){return console[_0x410931(0x16c)](_0x410931(0x168)+_0x38a6e8['message']),0x1;}else return console[_0x410931(0x16c)](_0x410931(0x195)),console['error'](_0x410931(0x18a)),console[_0x410931(0x16c)](_0x410931(0x184)),console[_0x410931(0x16c)](_0x410931(0x17c)),console[_0x410931(0x16c)](_0x410931(0x165)),console[_0x410931(0x16c)]('Or\x20use\x20--in\x20flag:'),console[_0x410931(0x16c)](_0x410931(0x162)),0x1;}const _0x538d2a=_0x4bba7d[_0x410931(0x179)];!_0x58b250[_0x410931(0x179)]&&_0x538d2a&&(_0x58b250[_0x410931(0x179)]=_0x538d2a);try{const _0x330e5e=_0x30da6f=>_0x30da6f&&(_0x30da6f[_0x410931(0x171)]('*')||_0x30da6f[_0x410931(0x171)]('?')),_0x1ce00b=_0x330e5e(_0x58b250[_0x410931(0x179)]);_0x4bba7d['verbose']&&(console['error'](_0x410931(0x18d)+_0x4bba7d[_0x410931(0x173)]),_0x58b250[_0x410931(0x179)]?_0x1ce00b?console[_0x410931(0x16c)]('Database\x20pattern:\x20'+_0x58b250[_0x410931(0x179)]):console['error'](_0x410931(0x180)+_0x58b250[_0x410931(0x179)]):console[_0x410931(0x16c)](_0x410931(0x18f)),_0x58b250['table']&&console[_0x410931(0x16c)](_0x410931(0x16e)+_0x58b250[_0x410931(0x18b)]));const _0x1f47eb=_0x58b250[_0x410931(0x179)]&&!_0x1ce00b?_0x58b250[_0x410931(0x179)]:undefined,_0x2277b3=_0x1ce00b?_0x58b250[_0x410931(0x179)]:undefined,_0x15c02b=_0x58b250[_0x410931(0x18b)],_0x21d9b8=resolveLimit(_0x4bba7d[_0x410931(0x16d)],DEFAULT_LISTING_LIMIT),_0x29bbf3=await withSpinner(_0x410931(0x188),()=>_0x59253c['query'][_0x410931(0x177)](_0x1f47eb,_0x15c02b,_0x2277b3,_0x21d9b8),{'verbose':_0x4bba7d[_0x410931(0x182)]}),_0xe4185e=_0x29bbf3[_0x410931(0x17d)];if(_0xe4185e[_0x410931(0x17e)]===0x0&&_0x58b250['database']&&!_0x1ce00b)return console[_0x410931(0x16c)]('✖\x20No\x20tables\x20found'),console[_0x410931(0x16c)]('Database\x20\x27'+_0x58b250[_0x410931(0x179)]+_0x410931(0x167)),0x1;return console[_0x410931(0x16c)]('✔\x20Found\x20'+_0xe4185e[_0x410931(0x17e)]+_0x410931(0x16b)+(_0xe4185e[_0x410931(0x17e)]!==0x1?'s':'')),await handleSDKOutput(_0xe4185e,{..._0x4bba7d,'limit':_0x21d9b8}),0x0;}catch(_0x974726){if(_0x974726 instanceof SDKError)return console[_0x410931(0x16c)](_0x410931(0x168)+_0x974726[_0x410931(0x17a)]),_0x974726[_0x410931(0x18c)]&&console[_0x410931(0x16c)](_0x410931(0x178)+_0x974726[_0x410931(0x18c)]),0x1;throw _0x974726;}}[a31_0x42384c(0x166)](_0xf1db6a){return undefined;}}
@@ -1 +1 @@
1
- const a32_0x543374=a32_0x3163;(function(_0xbc0696,_0x546161){const _0x3add38=a32_0x3163,_0x4b7ab7=_0xbc0696();while(!![]){try{const _0x466a8d=-parseInt(_0x3add38(0x196))/0x1+-parseInt(_0x3add38(0x194))/0x2+parseInt(_0x3add38(0x1a4))/0x3+parseInt(_0x3add38(0x1b4))/0x4+-parseInt(_0x3add38(0x19e))/0x5*(-parseInt(_0x3add38(0x1b0))/0x6)+-parseInt(_0x3add38(0x193))/0x7+parseInt(_0x3add38(0x19d))/0x8;if(_0x466a8d===_0x546161)break;else _0x4b7ab7['push'](_0x4b7ab7['shift']());}catch(_0x337bb9){_0x4b7ab7['push'](_0x4b7ab7['shift']());}}}(a32_0x29a4,0x5dc35));function a32_0x3163(_0x4348af,_0x20a2fa){const _0x29a41f=a32_0x29a4();return a32_0x3163=function(_0x316337,_0x541f47){_0x316337=_0x316337-0x18e;let _0x218461=_0x29a41f[_0x316337];return _0x218461;},a32_0x3163(_0x4348af,_0x20a2fa);}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';function a32_0x29a4(){const _0x24e3cd=['Session\x20llm_project\x20set\x20to:\x20','error','Invalid\x20resource:\x20','3648547FtrmFS','729330epIsIB','Error:\x20Profile\x20\x27','369551mvruVa','includes','name','Set\x20session-level\x20context','profile','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','parent_segment','2385616JpiXzr','1179305UJQvjh','validate','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','description','database','1836939sKpetx','Session\x20profile\x20set\x20to:\x20','\x20(session:\x20','llm_project','join','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Session\x20database\x20set\x20to:\x20','Session\x20parent_segment\x20set\x20to:\x20','Error:\x20','session','execute','toString','12zkssYv','message','use','length','1029012aPWHyA','log','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'];a32_0x29a4=function(){return _0x24e3cd;};return a32_0x29a4();}export class UseCommand extends BaseCommand{[a32_0x543374(0x198)]=a32_0x543374(0x1b2);[a32_0x543374(0x1a2)]=a32_0x543374(0x199);[a32_0x543374(0x19f)](_0x54892a){const _0x430c73=a32_0x543374,{args:_0x232af3}=_0x54892a;if(_0x232af3[_0x430c73(0x1b3)]<0x2)return _0x430c73(0x18f)+_0x430c73(0x1a0)+'Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'+_0x430c73(0x1a9);const _0x46bda1=_0x232af3[0x0],_0x39e289=[_0x430c73(0x1a3),_0x430c73(0x19c),'llm_project',_0x430c73(0x19a)];if(!_0x39e289[_0x430c73(0x197)](_0x46bda1))return _0x430c73(0x192)+_0x46bda1+'.\x20Must\x20be\x20one\x20of:\x20'+_0x39e289[_0x430c73(0x1a8)](',\x20');return undefined;}async[a32_0x543374(0x1ae)](_0x1be76f){const _0x2aa9d8=a32_0x543374,{args:_0x113b67,options:_0xa31136}=_0x1be76f;try{const _0x49b6b3=_0x113b67[0x0],_0x32c9b2=_0x113b67[0x1];if(_0x49b6b3===_0x2aa9d8(0x19a)){if(!profileExists(_0x32c9b2))return console[_0x2aa9d8(0x191)](_0x2aa9d8(0x195)+_0x32c9b2+'\x27\x20does\x20not\x20exist'),console[_0x2aa9d8(0x191)](_0x2aa9d8(0x19b)),0x1;const _0x4bf98a=_0xa31136[_0x2aa9d8(0x1ad)]||getCurrentSessionPID()[_0x2aa9d8(0x1af)]();return saveSessionContext({'profile':_0x32c9b2},_0xa31136['session']),console[_0x2aa9d8(0x18e)](_0x2aa9d8(0x1a5)+_0x32c9b2+'\x20(session:\x20'+_0x4bf98a+')'),console[_0x2aa9d8(0x18e)](_0x2aa9d8(0x1a1)),0x0;}const _0x45c616={},_0x5da15a=_0xa31136[_0x2aa9d8(0x1ad)]||getCurrentSessionPID()[_0x2aa9d8(0x1af)]();switch(_0x49b6b3){case _0x2aa9d8(0x1a3):_0x45c616['database']=_0x32c9b2,console[_0x2aa9d8(0x18e)](_0x2aa9d8(0x1aa)+_0x32c9b2+_0x2aa9d8(0x1a6)+_0x5da15a+')');break;case _0x2aa9d8(0x19c):_0x45c616['parent_segment']=_0x32c9b2,console[_0x2aa9d8(0x18e)](_0x2aa9d8(0x1ab)+_0x32c9b2+'\x20(session:\x20'+_0x5da15a+')');break;case _0x2aa9d8(0x1a7):_0x45c616[_0x2aa9d8(0x1a7)]=_0x32c9b2,console[_0x2aa9d8(0x18e)](_0x2aa9d8(0x190)+_0x32c9b2+_0x2aa9d8(0x1a6)+_0x5da15a+')');break;}return saveSessionContext(_0x45c616,_0xa31136[_0x2aa9d8(0x1ad)]),console[_0x2aa9d8(0x18e)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x52fe20){return _0x52fe20 instanceof Error&&console[_0x2aa9d8(0x191)](_0x2aa9d8(0x1ac)+_0x52fe20[_0x2aa9d8(0x1b1)]),0x1;}}}
1
+ const a32_0x1e2d02=a32_0x25ed;(function(_0x152599,_0xb30cf7){const _0x4d0ba3=a32_0x25ed,_0x27809d=_0x152599();while(!![]){try{const _0x348ed5=-parseInt(_0x4d0ba3(0x145))/0x1*(-parseInt(_0x4d0ba3(0x125))/0x2)+parseInt(_0x4d0ba3(0x12b))/0x3*(parseInt(_0x4d0ba3(0x13d))/0x4)+-parseInt(_0x4d0ba3(0x14a))/0x5*(parseInt(_0x4d0ba3(0x135))/0x6)+-parseInt(_0x4d0ba3(0x146))/0x7+parseInt(_0x4d0ba3(0x132))/0x8+parseInt(_0x4d0ba3(0x137))/0x9*(parseInt(_0x4d0ba3(0x129))/0xa)+parseInt(_0x4d0ba3(0x128))/0xb*(-parseInt(_0x4d0ba3(0x12a))/0xc);if(_0x348ed5===_0xb30cf7)break;else _0x27809d['push'](_0x27809d['shift']());}catch(_0x3b612c){_0x27809d['push'](_0x27809d['shift']());}}}(a32_0x1ef3,0x6b849));import{BaseCommand}from'./command.js';function a32_0x1ef3(){const _0x3cab1f=['\x20(session:\x20','3MvFFzo','4335884kiQBqd','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','error','message','3629870YcXOJc','length','329150rXPMPT','parent_segment','session','22cPsTch','40cHZQfh','1552956vxCVSe','1929813gynFSw','log','Set\x20session-level\x20context','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','includes','llm_project','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','6193224sjRAtB','profile','Session\x20parent_segment\x20set\x20to:\x20','6MBjPPx','toString','300276jUWQgW','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Session\x20profile\x20set\x20to:\x20','database','\x27\x20does\x20not\x20exist','4FCEMCP','Error:\x20','validate','use','name','join','.\x20Must\x20be\x20one\x20of:\x20'];a32_0x1ef3=function(){return _0x3cab1f;};return a32_0x1ef3();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a32_0x25ed(_0x15755f,_0x4bc920){const _0x1ef3aa=a32_0x1ef3();return a32_0x25ed=function(_0x25ed95,_0x29c2cd){_0x25ed95=_0x25ed95-0x125;let _0x4f48af=_0x1ef3aa[_0x25ed95];return _0x4f48af;},a32_0x25ed(_0x15755f,_0x4bc920);}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a32_0x1e2d02(0x141)]=a32_0x1e2d02(0x140);['description']=a32_0x1e2d02(0x12d);[a32_0x1e2d02(0x13f)](_0x22549b){const _0x224565=a32_0x1e2d02,{args:_0x78891e}=_0x22549b;if(_0x78891e[_0x224565(0x14b)]<0x2)return _0x224565(0x138)+_0x224565(0x147)+_0x224565(0x131)+_0x224565(0x139);const _0x318723=_0x78891e[0x0],_0x23ec99=[_0x224565(0x13b),_0x224565(0x126),_0x224565(0x130),'profile'];if(!_0x23ec99[_0x224565(0x12f)](_0x318723))return'Invalid\x20resource:\x20'+_0x318723+_0x224565(0x143)+_0x23ec99[_0x224565(0x142)](',\x20');return undefined;}async['execute'](_0x23f6d9){const _0x4cde9d=a32_0x1e2d02,{args:_0x1ebdd8,options:_0x18a83a}=_0x23f6d9;try{const _0x5cefe1=_0x1ebdd8[0x0],_0x4cd752=_0x1ebdd8[0x1];if(_0x5cefe1===_0x4cde9d(0x133)){if(!profileExists(_0x4cd752))return console['error']('Error:\x20Profile\x20\x27'+_0x4cd752+_0x4cde9d(0x13c)),console[_0x4cde9d(0x148)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x314deb=_0x18a83a[_0x4cde9d(0x127)]||getCurrentSessionPID()[_0x4cde9d(0x136)]();return saveSessionContext({'profile':_0x4cd752},_0x18a83a['session']),console[_0x4cde9d(0x12c)](_0x4cde9d(0x13a)+_0x4cd752+_0x4cde9d(0x144)+_0x314deb+')'),console['log'](_0x4cde9d(0x12e)),0x0;}const _0x16b21a={},_0x4c67c9=_0x18a83a[_0x4cde9d(0x127)]||getCurrentSessionPID()[_0x4cde9d(0x136)]();switch(_0x5cefe1){case'database':_0x16b21a[_0x4cde9d(0x13b)]=_0x4cd752,console[_0x4cde9d(0x12c)]('Session\x20database\x20set\x20to:\x20'+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;case _0x4cde9d(0x126):_0x16b21a[_0x4cde9d(0x126)]=_0x4cd752,console[_0x4cde9d(0x12c)](_0x4cde9d(0x134)+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;case'llm_project':_0x16b21a[_0x4cde9d(0x130)]=_0x4cd752,console[_0x4cde9d(0x12c)]('Session\x20llm_project\x20set\x20to:\x20'+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;}return saveSessionContext(_0x16b21a,_0x18a83a[_0x4cde9d(0x127)]),console[_0x4cde9d(0x12c)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x5c2996){return _0x5c2996 instanceof Error&&console[_0x4cde9d(0x148)](_0x4cde9d(0x13e)+_0x5c2996[_0x4cde9d(0x149)]),0x1;}}}