@treasuredata/tdx 0.2.6 → 0.2.8

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 (114) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/client/cdp-client.js +1 -1
  4. package/dist/client/http-client.d.ts.map +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/http-client.js.map +1 -1
  7. package/dist/client/llm-client.d.ts +2 -0
  8. package/dist/client/llm-client.d.ts.map +1 -1
  9. package/dist/client/llm-client.js +1 -1
  10. package/dist/client/llm-client.js.map +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-client.js +1 -1
  13. package/dist/client/trino-client.js +1 -1
  14. package/dist/client/workflow-client.js +1 -1
  15. package/dist/commands/activations.js +1 -1
  16. package/dist/commands/api-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/chat-command.js.map +1 -1
  19. package/dist/commands/claude-command.d.ts.map +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-command.js.map +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/llm-command.js +1 -1
  28. package/dist/commands/llm-proxy.d.ts.map +1 -1
  29. package/dist/commands/llm-proxy.js +1 -1
  30. package/dist/commands/llm-proxy.js.map +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pwd-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/global-context.js +1 -1
  48. package/dist/core/profile.js +1 -1
  49. package/dist/core/project-config.js +1 -1
  50. package/dist/core/session.js +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/proxy/anthropic-adapter.d.ts +1 -14
  53. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  54. package/dist/proxy/anthropic-adapter.js +1 -1
  55. package/dist/proxy/anthropic-adapter.js.map +1 -1
  56. package/dist/proxy/server.d.ts +3 -1
  57. package/dist/proxy/server.d.ts.map +1 -1
  58. package/dist/proxy/server.js +1 -1
  59. package/dist/proxy/server.js.map +1 -1
  60. package/dist/proxy/session-cache.d.ts +3 -1
  61. package/dist/proxy/session-cache.d.ts.map +1 -1
  62. package/dist/proxy/session-cache.js +1 -1
  63. package/dist/proxy/session-cache.js.map +1 -1
  64. package/dist/sdk/api.js +1 -1
  65. package/dist/sdk/database.js +1 -1
  66. package/dist/sdk/errors.d.ts +2 -0
  67. package/dist/sdk/errors.d.ts.map +1 -1
  68. package/dist/sdk/errors.js +1 -1
  69. package/dist/sdk/errors.js.map +1 -1
  70. package/dist/sdk/index.js +1 -1
  71. package/dist/sdk/job.js +1 -1
  72. package/dist/sdk/llm.d.ts +5 -3
  73. package/dist/sdk/llm.d.ts.map +1 -1
  74. package/dist/sdk/llm.js +1 -1
  75. package/dist/sdk/llm.js.map +1 -1
  76. package/dist/sdk/query.js +1 -1
  77. package/dist/sdk/segment.js +1 -1
  78. package/dist/sdk/table.js +1 -1
  79. package/dist/sdk/workflow.js +1 -1
  80. package/dist/types/anthropic.d.ts +10 -3
  81. package/dist/types/anthropic.d.ts.map +1 -1
  82. package/dist/types/endpoints.js +1 -1
  83. package/dist/types/index.d.ts +5 -1
  84. package/dist/types/index.d.ts.map +1 -1
  85. package/dist/types/index.js +1 -1
  86. package/dist/utils/agent-ref-parser.js +1 -1
  87. package/dist/utils/chat-cache.js +1 -1
  88. package/dist/utils/colors.js +1 -1
  89. package/dist/utils/command-output.js +1 -1
  90. package/dist/utils/constants.js +1 -1
  91. package/dist/utils/file-permissions.js +1 -1
  92. package/dist/utils/format-detector.js +1 -1
  93. package/dist/utils/formatters.js +1 -1
  94. package/dist/utils/json-loader.js +1 -1
  95. package/dist/utils/model-aliases.js +1 -1
  96. package/dist/utils/option-validation.js +1 -1
  97. package/dist/utils/port.js +1 -1
  98. package/dist/utils/process.js +1 -1
  99. package/dist/utils/prompt.js +1 -1
  100. package/dist/utils/segment-path-parser.js +1 -1
  101. package/dist/utils/segment-ref-parser.js +1 -1
  102. package/dist/utils/spinner.js +1 -1
  103. package/dist/utils/sql-parser.js +1 -1
  104. package/dist/utils/sse-parser.d.ts +3 -1
  105. package/dist/utils/sse-parser.d.ts.map +1 -1
  106. package/dist/utils/sse-parser.js +1 -1
  107. package/dist/utils/sse-parser.js.map +1 -1
  108. package/dist/utils/string-utils.js +1 -1
  109. package/dist/utils/table-ref-parser.js +1 -1
  110. package/dist/utils/tdx-logger.js +1 -1
  111. package/dist/utils/tree-formatter.js +1 -1
  112. package/dist/utils/version-check.js +1 -1
  113. package/dist/utils/workflow-utils.js +1 -1
  114. package/package.json +2 -2
@@ -1 +1 @@
1
- const a20_0x4ec802=a20_0x1e5c;(function(_0x35e45a,_0x486423){const _0xbdc6ff=a20_0x1e5c,_0xe271b1=_0x35e45a();while(!![]){try{const _0xf09610=-parseInt(_0xbdc6ff(0x167))/0x1+-parseInt(_0xbdc6ff(0x160))/0x2+-parseInt(_0xbdc6ff(0x165))/0x3*(-parseInt(_0xbdc6ff(0x16f))/0x4)+parseInt(_0xbdc6ff(0x16b))/0x5*(-parseInt(_0xbdc6ff(0x170))/0x6)+parseInt(_0xbdc6ff(0x15c))/0x7*(parseInt(_0xbdc6ff(0x164))/0x8)+-parseInt(_0xbdc6ff(0x16a))/0x9+parseInt(_0xbdc6ff(0x163))/0xa;if(_0xf09610===_0x486423)break;else _0xe271b1['push'](_0xe271b1['shift']());}catch(_0x7d67d5){_0xe271b1['push'](_0xe271b1['shift']());}}}(a20_0x172e,0x4d10b));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a20_0x1e5c(_0x4ee7af,_0x273462){const _0x172ef0=a20_0x172e();return a20_0x1e5c=function(_0x1e5ce3,_0x1c3ab){_0x1e5ce3=_0x1e5ce3-0x15c;let _0x23fd12=_0x172ef0[_0x1e5ce3];return _0x23fd12;},a20_0x1e5c(_0x4ee7af,_0x273462);}import{handleSDKOutput}from'../utils/command-output.js';function a20_0x172e(){const _0x233fea=['config','328896HgaHIk','\x20\x20Global:\x20~/.config/tdx/tdx.json','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2124756Hzebwx','1915925OPhCVJ','log','Error:\x20','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','274540fYCGzf','6NuPMIi','14Qllowi','length','map','name','228006Rlnsng','description','error','8596960xZKjcL','699824AodzLB','15HWPPAS'];a20_0x172e=function(){return _0x233fea;};return a20_0x172e();}export class ProfilesCommand extends BaseCommand{[a20_0x4ec802(0x15f)]='profiles';[a20_0x4ec802(0x161)]='List\x20all\x20available\x20profiles';async['execute'](_0x5d9ebe){const _0x365dd1=a20_0x4ec802,{options:_0xa22c2c}=_0x5d9ebe;try{const _0xa98521=listProfiles(),_0x593c5d=getActiveProfile();if(_0xa98521[_0x365dd1(0x15d)]===0x0)return console['log'](_0x365dd1(0x16e)),console['log'](_0x365dd1(0x169)),console[_0x365dd1(0x16c)](_0x365dd1(0x168)),0x0;const _0x55a4d8=_0xa98521[_0x365dd1(0x15e)](_0x15dffa=>{const _0x3aef44=_0x365dd1,_0x2958b1=_0x15dffa['name']===_0x593c5d,_0x39887c=getProfileParams(_0x15dffa['config']);return{'name':_0x15dffa['name'],'active':_0x2958b1,'scope':_0x15dffa['scope'],'description':_0x15dffa[_0x3aef44(0x166)][_0x3aef44(0x161)]||'','params':_0x39887c};});return await handleSDKOutput(_0x55a4d8,_0xa22c2c),0x0;}catch(_0x24a964){return _0x24a964 instanceof Error&&console[_0x365dd1(0x162)](_0x365dd1(0x16d)+_0x24a964['message']),0x1;}}}
1
+ function a20_0x1266(_0x20295b,_0x51583a){const _0x120cb9=a20_0x120c();return a20_0x1266=function(_0x12661e,_0x516176){_0x12661e=_0x12661e-0x18b;let _0x4b04a7=_0x120cb9[_0x12661e];return _0x4b04a7;},a20_0x1266(_0x20295b,_0x51583a);}const a20_0x45ae95=a20_0x1266;(function(_0x12aa0b,_0x43ce5b){const _0x37127a=a20_0x1266,_0x4fb209=_0x12aa0b();while(!![]){try{const _0x469e23=-parseInt(_0x37127a(0x18c))/0x1+-parseInt(_0x37127a(0x19e))/0x2*(parseInt(_0x37127a(0x190))/0x3)+-parseInt(_0x37127a(0x19b))/0x4*(parseInt(_0x37127a(0x1a0))/0x5)+-parseInt(_0x37127a(0x196))/0x6+parseInt(_0x37127a(0x19c))/0x7+-parseInt(_0x37127a(0x19f))/0x8*(-parseInt(_0x37127a(0x18e))/0x9)+parseInt(_0x37127a(0x194))/0xa;if(_0x469e23===_0x43ce5b)break;else _0x4fb209['push'](_0x4fb209['shift']());}catch(_0x3e4637){_0x4fb209['push'](_0x4fb209['shift']());}}}(a20_0x120c,0x96020));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a20_0x120c(){const _0x3bf94c=['List\x20all\x20available\x20profiles','message','map','132LukZoY','1021013CjsAcY','name','28586ettchN','128soOqXd','147310wZcMWb','length','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','102041FVdCFN','error','644733AqSkEV','execute','183BwwFgN','\x20\x20Global:\x20~/.config/tdx/tdx.json','description','config','15222190mxyUbY','log','1522068UwGqgN','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'];a20_0x120c=function(){return _0x3bf94c;};return a20_0x120c();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x45ae95(0x19d)]='profiles';[a20_0x45ae95(0x192)]=a20_0x45ae95(0x198);async[a20_0x45ae95(0x18f)](_0x22accf){const _0x20cfee=a20_0x45ae95,{options:_0xbc58ec}=_0x22accf;try{const _0x3420d4=listProfiles(),_0x4540e2=getActiveProfile();if(_0x3420d4[_0x20cfee(0x1a1)]===0x0)return console[_0x20cfee(0x195)](_0x20cfee(0x18b)),console[_0x20cfee(0x195)](_0x20cfee(0x197)),console[_0x20cfee(0x195)](_0x20cfee(0x191)),0x0;const _0x31ef50=_0x3420d4[_0x20cfee(0x19a)](_0x256db1=>{const _0x4fae7a=_0x20cfee,_0x93a377=_0x256db1[_0x4fae7a(0x19d)]===_0x4540e2,_0x2a37f6=getProfileParams(_0x256db1['config']);return{'name':_0x256db1[_0x4fae7a(0x19d)],'active':_0x93a377,'scope':_0x256db1['scope'],'description':_0x256db1[_0x4fae7a(0x193)][_0x4fae7a(0x192)]||'','params':_0x2a37f6};});return await handleSDKOutput(_0x31ef50,_0xbc58ec),0x0;}catch(_0x445c9b){return _0x445c9b instanceof Error&&console[_0x20cfee(0x18d)]('Error:\x20'+_0x445c9b[_0x20cfee(0x199)]),0x1;}}}
@@ -1 +1 @@
1
- const a21_0x3784a5=a21_0x6d66;(function(_0x435af9,_0x1e1984){const _0x4c54bf=a21_0x6d66,_0x105666=_0x435af9();while(!![]){try{const _0x4c0701=-parseInt(_0x4c54bf(0x1da))/0x1*(-parseInt(_0x4c54bf(0x1ea))/0x2)+-parseInt(_0x4c54bf(0x1e1))/0x3*(-parseInt(_0x4c54bf(0x1d8))/0x4)+-parseInt(_0x4c54bf(0x1e5))/0x5+parseInt(_0x4c54bf(0x1fb))/0x6*(parseInt(_0x4c54bf(0x1ff))/0x7)+-parseInt(_0x4c54bf(0x1fc))/0x8+-parseInt(_0x4c54bf(0x203))/0x9*(-parseInt(_0x4c54bf(0x1db))/0xa)+parseInt(_0x4c54bf(0x1ed))/0xb*(-parseInt(_0x4c54bf(0x205))/0xc);if(_0x4c0701===_0x1e1984)break;else _0x105666['push'](_0x105666['shift']());}catch(_0x58b8b4){_0x105666['push'](_0x105666['shift']());}}}(a21_0x4224,0x877b5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a21_0x4224(){const _0x54edf2=['stats','length','Statement\x20','\x20[Job\x20ID:\x20','\x20-\x20','Site:\x20','5716BpwlEC','Run\x20Trino\x20queries\x20(streaming)','189080ZIJIkz','10892970PhPPJp','SQL:\x20','Catalog:\x20','state','options','Executing\x20query\x20[','177yVXQId','name','information_schema','args','5102935uNCiQL','\x0aAll\x20results\x20saved\x20to\x20','Error:\x20','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','message','4drHZUh','setPhase','file','33IUbbKL','totalSplits','completedSplits','jobId','output','join','Executing\x20statement\x20','\x20rows\x20','setJobId','processedRows','originalMessage','verbose','error','elapsedTimeMillis','115254kDJtuU','1976464AiEbrq','site','query','161HnlUTZ','\x20splits','in\x20','push','9lLKjFd','execute','683988aeKLUG','Executing\x20query...'];a21_0x4224=function(){return _0x54edf2;};return a21_0x4224();}import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a21_0x6d66(_0x1b795d,_0x234e30){const _0x42249b=a21_0x4224();return a21_0x6d66=function(_0x6d66e4,_0x1fb81b){_0x6d66e4=_0x6d66e4-0x1d7;let _0x3b2e3c=_0x42249b[_0x6d66e4];return _0x3b2e3c;},a21_0x6d66(_0x1b795d,_0x234e30);}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a21_0x3784a5(0x1e2)]=a21_0x3784a5(0x1fe);['description']=a21_0x3784a5(0x1d9);async[a21_0x3784a5(0x204)](_0x249b94){const _0x26077c=a21_0x3784a5,{options:_0x4cb098,args:_0x183073,tdx:_0x3cc815}=_0x249b94,_0x2ebb6d=_0x183073[0x0],_0x29b437=_0x4cb098[_0x26077c(0x1ec)];let _0x17d80a;if(_0x29b437)try{_0x17d80a=readSqlStatementsFromFile(_0x29b437);}catch(_0x565638){return console[_0x26077c(0x1f9)](_0x26077c(0x1e7)+_0x565638[_0x26077c(0x1e9)]),0x1;}else try{_0x17d80a=splitSqlStatements(_0x2ebb6d);}catch(_0x1b053d){return console[_0x26077c(0x1f9)]('Error:\x20'+_0x1b053d[_0x26077c(0x1e9)]),0x1;}const _0x29019d=_0x4cb098['database']||_0x26077c(0x1e3),_0x347b4a=_0x4cb098['catalog'];try{const _0x140bf8=[],_0x36e695=!!_0x4cb098[_0x26077c(0x1f1)];for(let _0x15ec4a=0x0;_0x15ec4a<_0x17d80a[_0x26077c(0x208)];_0x15ec4a++){const _0x1be4a3=_0x17d80a[_0x15ec4a],_0xfc300a=_0x15ec4a+0x1,_0x4c6049=_0x17d80a[_0x26077c(0x208)],_0x125e1d=_0x4c6049>0x1;_0x4cb098['verbose']&&(console[_0x26077c(0x1f9)]('\x0a'+(_0x125e1d?_0x26077c(0x209)+_0xfc300a+'/'+_0x4c6049+':':'')),console[_0x26077c(0x1f9)](_0x26077c(0x1d7)+_0x4cb098[_0x26077c(0x1fd)]),console['error'](_0x26077c(0x1dd)+(_0x347b4a||'td')),console[_0x26077c(0x1f9)]('Schema:\x20'+_0x29019d),console[_0x26077c(0x1f9)](_0x26077c(0x1dc)+_0x1be4a3));const _0x3776e1=_0x125e1d?_0x26077c(0x1f3)+_0xfc300a+'/'+_0x4c6049+'...':_0x26077c(0x206);try{const _0x571e9e=await withQuerySpinner(_0x3776e1,async _0x59b28d=>{const _0x213d5e=_0x26077c,_0x10a8b7=await _0x3cc815[_0x213d5e(0x1fe)](_0x1be4a3,{'catalog':_0x347b4a,'schema':_0x29019d,'onJobId':_0x20211b=>{const _0x39ff57=_0x213d5e;_0x59b28d[_0x39ff57(0x1f5)](_0x20211b);},'onProgress':_0x24bd2e=>{const _0x309e9b=_0x213d5e;_0x59b28d[_0x309e9b(0x1eb)](_0x309e9b(0x1e0)+_0x24bd2e[_0x309e9b(0x1de)]+']'),_0x59b28d['setExtra'](formatRows(_0x24bd2e[_0x309e9b(0x1f6)])+_0x309e9b(0x1f4)+_0x24bd2e[_0x309e9b(0x1ef)]+'/'+_0x24bd2e[_0x309e9b(0x1ee)]+_0x309e9b(0x200));}});return _0x10a8b7;},{'verbose':_0x4cb098[_0x26077c(0x1f8)]}),_0x4143a1=_0x571e9e['data'],_0x5f46d8=_0x4143a1[_0x26077c(0x1f0)]?_0x26077c(0x20a)+_0x4143a1['jobId']+']':'',_0x174d71=_0x125e1d?_0x26077c(0x209)+_0xfc300a+'/'+_0x4c6049+_0x26077c(0x20b):'';console[_0x26077c(0x1f9)]('✔\x20'+_0x174d71+'Query\x20completed:\x20Processed\x20'+formatRows(_0x4143a1[_0x26077c(0x207)][_0x26077c(0x1f6)])+_0x26077c(0x1f4)+(_0x26077c(0x201)+formatElapsed(_0x4143a1[_0x26077c(0x207)][_0x26077c(0x1fa)])+_0x5f46d8));if(_0x125e1d&&_0x36e695){const _0x472b8a=resolveOutputOptions(_0x4cb098),_0x5cd419=await formatQueryOutput(_0x4143a1,_0x472b8a);_0x140bf8[_0x26077c(0x202)](_0x5cd419);}else await handleQueryOutput(_0x4143a1,_0x4cb098);}catch(_0xbf4a70){const _0xd4613c=_0x125e1d?'Statement\x20'+_0xfc300a+'/'+_0x4c6049+':\x0a':'',_0x1391c1=_0xbf4a70 instanceof SDKError?_0xbf4a70[_0x26077c(0x1f7)]:_0xbf4a70[_0x26077c(0x1e9)];return console['error'](''+_0xd4613c+_0x1391c1),0x1;}}if(_0x17d80a['length']>0x1&&_0x36e695&&_0x140bf8[_0x26077c(0x208)]>0x0){const _0x15c63d=_0x140bf8[_0x26077c(0x1f2)]('\x0a');writeFileSync(_0x4cb098[_0x26077c(0x1f1)],_0x15c63d),console['error'](_0x26077c(0x1e6)+_0x4cb098[_0x26077c(0x1f1)]);}return 0x0;}catch(_0x5634fe){throw _0x5634fe;}}['validate'](_0x3c1292){const _0x3e9cb9=a21_0x3784a5,_0xe842c2=_0x3c1292[_0x3e9cb9(0x1e4)][0x0],_0x4a53a4=_0x3c1292[_0x3e9cb9(0x1df)][_0x3e9cb9(0x1ec)];if(!_0xe842c2&&!_0x4a53a4)return _0x3e9cb9(0x1e8);if(_0xe842c2&&_0x4a53a4)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
1
+ function a21_0x3446(){const _0x3e1eaf=['\x20splits','Statement\x20','file','setJobId','completedSplits','information_schema','stats','1251162kYVfTy','5845LEekAe','Schema:\x20','push','setExtra','data','name','error','message','jobId','Run\x20Trino\x20queries\x20(streaming)','489156ZbQKuz','description','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','setPhase','verbose','\x0aAll\x20results\x20saved\x20to\x20','10QOlNRb','query','Executing\x20query...','Site:\x20','processedRows','output','11pIfuBJ','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','2570892DaPtTa','join','9016wFNnxV','elapsedTimeMillis','Executing\x20statement\x20','3976gIIOHO','...','totalSplits','Catalog:\x20','originalMessage','length','Executing\x20query\x20[','database','validate','Error:\x20','in\x20','2171490OcGrEB','Query\x20completed:\x20Processed\x20','3916017klquYG','5NYWgts'];a21_0x3446=function(){return _0x3e1eaf;};return a21_0x3446();}const a21_0x48e1f0=a21_0x154f;(function(_0x4f76ed,_0xfd0aeb){const _0x159552=a21_0x154f,_0xfdc8b8=_0x4f76ed();while(!![]){try{const _0x1e3b14=parseInt(_0x159552(0xe9))/0x1*(parseInt(_0x159552(0x113))/0x2)+-parseInt(_0x159552(0x102))/0x3+-parseInt(_0x159552(0x10d))/0x4*(-parseInt(_0x159552(0xfa))/0x5)+parseInt(_0x159552(0x11b))/0x6+-parseInt(_0x159552(0x103))/0x7*(-parseInt(_0x159552(0xec))/0x8)+-parseInt(_0x159552(0xf9))/0x9+-parseInt(_0x159552(0xf7))/0xa*(-parseInt(_0x159552(0x119))/0xb);if(_0x1e3b14===_0xfd0aeb)break;else _0xfdc8b8['push'](_0xfdc8b8['shift']());}catch(_0x5bba9f){_0xfdc8b8['push'](_0xfdc8b8['shift']());}}}(a21_0x3446,0x5bc14));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a21_0x154f(_0x35d28b,_0x558f11){const _0x344677=a21_0x3446();return a21_0x154f=function(_0x154f48,_0x2bf249){_0x154f48=_0x154f48-0xe9;let _0x2e5f56=_0x344677[_0x154f48];return _0x2e5f56;},a21_0x154f(_0x35d28b,_0x558f11);}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';export class QueryCommand extends BaseCommand{[a21_0x48e1f0(0x108)]=a21_0x48e1f0(0x114);[a21_0x48e1f0(0x10e)]=a21_0x48e1f0(0x10c);async['execute'](_0x549f24){const _0x108d98=a21_0x48e1f0,{options:_0x129c9,args:_0x464dda,tdx:_0x464930}=_0x549f24,_0x417e3d=_0x464dda[0x0],_0x20f660=_0x129c9[_0x108d98(0xfd)];let _0x44bff7;if(_0x20f660)try{_0x44bff7=readSqlStatementsFromFile(_0x20f660);}catch(_0x4433a1){return console[_0x108d98(0x109)](_0x108d98(0xf5)+_0x4433a1['message']),0x1;}else try{_0x44bff7=splitSqlStatements(_0x417e3d);}catch(_0x424689){return console[_0x108d98(0x109)](_0x108d98(0xf5)+_0x424689[_0x108d98(0x10a)]),0x1;}const _0x1bd554=_0x129c9[_0x108d98(0xf3)]||_0x108d98(0x100),_0x1f0529=_0x129c9['catalog'];try{const _0x178839=[],_0x2e795f=!!_0x129c9[_0x108d98(0x118)];for(let _0x2ccf14=0x0;_0x2ccf14<_0x44bff7['length'];_0x2ccf14++){const _0x3ba046=_0x44bff7[_0x2ccf14],_0x593fbf=_0x2ccf14+0x1,_0x114b8a=_0x44bff7[_0x108d98(0xf1)],_0x2debd3=_0x114b8a>0x1;_0x129c9[_0x108d98(0x111)]&&(console[_0x108d98(0x109)]('\x0a'+(_0x2debd3?'Statement\x20'+_0x593fbf+'/'+_0x114b8a+':':'')),console[_0x108d98(0x109)](_0x108d98(0x116)+_0x129c9['site']),console['error'](_0x108d98(0xef)+(_0x1f0529||'td')),console['error'](_0x108d98(0x104)+_0x1bd554),console[_0x108d98(0x109)]('SQL:\x20'+_0x3ba046));const _0x5729d4=_0x2debd3?_0x108d98(0xeb)+_0x593fbf+'/'+_0x114b8a+_0x108d98(0xed):_0x108d98(0x115);try{const _0x3cc735=await withQuerySpinner(_0x5729d4,async _0x2ccb81=>{const _0x24f243=await _0x464930['query'](_0x3ba046,{'catalog':_0x1f0529,'schema':_0x1bd554,'onJobId':_0x268da5=>{const _0x475f1a=a21_0x154f;_0x2ccb81[_0x475f1a(0xfe)](_0x268da5);},'onProgress':_0x3b9785=>{const _0x328c5d=a21_0x154f;_0x2ccb81[_0x328c5d(0x110)](_0x328c5d(0xf2)+_0x3b9785['state']+']'),_0x2ccb81[_0x328c5d(0x106)](formatRows(_0x3b9785['processedRows'])+'\x20rows\x20'+_0x3b9785[_0x328c5d(0xff)]+'/'+_0x3b9785[_0x328c5d(0xee)]+_0x328c5d(0xfb));}});return _0x24f243;},{'verbose':_0x129c9[_0x108d98(0x111)]}),_0xb80e63=_0x3cc735[_0x108d98(0x107)],_0x323b70=_0xb80e63[_0x108d98(0x10b)]?'\x20[Job\x20ID:\x20'+_0xb80e63[_0x108d98(0x10b)]+']':'',_0x258549=_0x2debd3?_0x108d98(0xfc)+_0x593fbf+'/'+_0x114b8a+'\x20-\x20':'';console[_0x108d98(0x109)]('✔\x20'+_0x258549+_0x108d98(0xf8)+formatRows(_0xb80e63[_0x108d98(0x101)][_0x108d98(0x117)])+'\x20rows\x20'+(_0x108d98(0xf6)+formatElapsed(_0xb80e63[_0x108d98(0x101)][_0x108d98(0xea)])+_0x323b70));if(_0x2debd3&&_0x2e795f){const _0x3065d1=resolveOutputOptions(_0x129c9),_0x230118=await formatQueryOutput(_0xb80e63,_0x3065d1);_0x178839[_0x108d98(0x105)](_0x230118);}else await handleQueryOutput(_0xb80e63,_0x129c9);}catch(_0x543065){const _0x4c0925=_0x2debd3?_0x108d98(0xfc)+_0x593fbf+'/'+_0x114b8a+':\x0a':'',_0x103cd3=_0x543065 instanceof SDKError?_0x543065[_0x108d98(0xf0)]:_0x543065['message'];return console[_0x108d98(0x109)](''+_0x4c0925+_0x103cd3),0x1;}}if(_0x44bff7[_0x108d98(0xf1)]>0x1&&_0x2e795f&&_0x178839['length']>0x0){const _0x5823d3=_0x178839[_0x108d98(0x11c)]('\x0a');writeFileSync(_0x129c9[_0x108d98(0x118)],_0x5823d3),console[_0x108d98(0x109)](_0x108d98(0x112)+_0x129c9[_0x108d98(0x118)]);}return 0x0;}catch(_0x231beb){throw _0x231beb;}}[a21_0x48e1f0(0xf4)](_0x5ec372){const _0x48c4b2=a21_0x48e1f0,_0xecd757=_0x5ec372['args'][0x0],_0x54b13c=_0x5ec372['options'][_0x48c4b2(0xfd)];if(!_0xecd757&&!_0x54b13c)return _0x48c4b2(0x10f);if(_0xecd757&&_0x54b13c)return _0x48c4b2(0x11a);return undefined;}}
@@ -1 +1 @@
1
- const a22_0x1e14fc=a22_0x3975;(function(_0x7bef9d,_0x30efb9){const _0x4ef1cf=a22_0x3975,_0x372ca6=_0x7bef9d();while(!![]){try{const _0x5cc10f=-parseInt(_0x4ef1cf(0x142))/0x1+-parseInt(_0x4ef1cf(0x11e))/0x2*(-parseInt(_0x4ef1cf(0x104))/0x3)+parseInt(_0x4ef1cf(0x148))/0x4*(parseInt(_0x4ef1cf(0x14a))/0x5)+parseInt(_0x4ef1cf(0x125))/0x6*(parseInt(_0x4ef1cf(0x11f))/0x7)+-parseInt(_0x4ef1cf(0x12f))/0x8*(parseInt(_0x4ef1cf(0x122))/0x9)+-parseInt(_0x4ef1cf(0x131))/0xa+-parseInt(_0x4ef1cf(0x101))/0xb*(-parseInt(_0x4ef1cf(0xf3))/0xc);if(_0x5cc10f===_0x30efb9)break;else _0x372ca6['push'](_0x372ca6['shift']());}catch(_0x407f22){_0x372ca6['push'](_0x372ca6['shift']());}}}(a22_0x4598,0xa949b));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{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0xef);[a22_0x1e14fc(0x103)]='Show\x20segment\x20or\x20folder\x20details';async[a22_0x1e14fc(0x10e)](_0x65139c){const _0x3bfe25=a22_0x1e14fc,{options:_0x1a8639,args:_0x5f295f,tdx:_0xbafc20}=_0x65139c;if(_0x5f295f[_0x3bfe25(0x156)]===0x0)return console['error'](_0x3bfe25(0x149)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xfb)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xed)),console[_0x3bfe25(0x10c)](_0x3bfe25(0x123)),console[_0x3bfe25(0x10c)](_0x3bfe25(0x10f)),console[_0x3bfe25(0x10c)](_0x3bfe25(0xfa)),0x1;try{const _0x4f1913=_0x5f295f[0x0],_0x53e51b=_0x1a8639['segmentPath'];let _0x38db5b=_0x4f1913;_0x53e51b&&!_0x4f1913[_0x3bfe25(0x153)]('/')&&(_0x38db5b=_0x53e51b+'/'+_0x4f1913,_0x1a8639[_0x3bfe25(0xfe)]&&console[_0x3bfe25(0x10c)](_0x3bfe25(0x10b)+_0x38db5b));const _0x12b67b=await withSpinner(_0x3bfe25(0xfd)+_0x38db5b+_0x3bfe25(0x152),()=>_0xbafc20[_0x3bfe25(0x140)]['resolvePathToResource'](_0x38db5b),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]}),_0x141381=_0x12b67b['data'];_0x1a8639['verbose']&&(console[_0x3bfe25(0x10c)]('Resolved\x20type:\x20'+_0x141381[_0x3bfe25(0x12e)]),console[_0x3bfe25(0x10c)]('Parent\x20ID:\x20'+_0x141381[_0x3bfe25(0x13a)]),_0x141381[_0x3bfe25(0x137)]&&console[_0x3bfe25(0x10c)](_0x3bfe25(0x14d)+_0x141381[_0x3bfe25(0x137)]),_0x141381[_0x3bfe25(0xec)]&&console['error'](_0x3bfe25(0x158)+_0x141381[_0x3bfe25(0xec)]));if(_0x141381['type']===_0x3bfe25(0x105)){const _0x4720d0=await withSpinner(_0x3bfe25(0x139),()=>_0xbafc20['segment'][_0x3bfe25(0x113)](_0x141381['parentId']),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]});await handleSDKOutput([_0x4720d0[_0x3bfe25(0x106)]],_0x1a8639);}else{if(_0x141381[_0x3bfe25(0x12e)]===_0x3bfe25(0x107)){if(!_0x141381[_0x3bfe25(0x137)])throw new SDKError(ErrorCode['INTERNAL'],_0x3bfe25(0x15a));const _0x8cc8f2=await withSpinner('Fetching\x20folder\x20details...',()=>_0xbafc20['segment'][_0x3bfe25(0x15d)](_0x141381[_0x3bfe25(0x137)]),{'verbose':_0x1a8639['verbose']});await handleSDKOutput([_0x8cc8f2[_0x3bfe25(0x106)]],_0x1a8639);}else{if(_0x141381[_0x3bfe25(0x12e)]===_0x3bfe25(0x140)){if(!_0x141381[_0x3bfe25(0xec)])throw new SDKError(ErrorCode[_0x3bfe25(0x14f)],_0x3bfe25(0x13c));const _0x1f3c1f=await withSpinner(_0x3bfe25(0x121),()=>_0xbafc20[_0x3bfe25(0x140)]['getSegment'](_0x141381[_0x3bfe25(0x13a)],_0x141381[_0x3bfe25(0xec)]),{'verbose':_0x1a8639[_0x3bfe25(0xfe)]});await handleSDKOutput([_0x1f3c1f[_0x3bfe25(0x106)]],_0x1a8639);}}}return 0x0;}catch(_0x254d6f){if(_0x254d6f instanceof SDKError)return console['error'](_0x3bfe25(0x118)+_0x254d6f[_0x3bfe25(0x13f)]),_0x254d6f['cause']&&console['error'](_0x3bfe25(0x13b)+_0x254d6f[_0x3bfe25(0x119)]),0x1;throw _0x254d6f;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0x144);[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x133);async['execute'](_0x304b0b){const _0x47c54e=a22_0x1e14fc,{options:_0x198585,args:_0xa42028,tdx:_0x3cce35}=_0x304b0b;if(_0xa42028[_0x47c54e(0x156)]===0x0)return console[_0x47c54e(0x10c)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x47c54e(0x10c)](_0x47c54e(0x10a)),console[_0x47c54e(0x10c)](_0x47c54e(0xed)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x47c54e(0x136)),console[_0x47c54e(0x10c)](_0x47c54e(0x15b)),0x1;try{const _0x5c6da5=_0xa42028[0x0],_0x4d7064=_0x198585[_0x47c54e(0x11a)];let _0x48ef4f=_0x5c6da5;_0x4d7064&&!_0x5c6da5[_0x47c54e(0x153)]('/')&&(_0x48ef4f=_0x4d7064+'/'+_0x5c6da5,_0x198585[_0x47c54e(0xfe)]&&console[_0x47c54e(0x10c)](_0x47c54e(0x10b)+_0x48ef4f));const _0x2d6933=await withSpinner(_0x47c54e(0xfd)+_0x48ef4f+_0x47c54e(0x152),()=>_0x3cce35[_0x47c54e(0x140)]['resolvePathToResource'](_0x48ef4f),{'verbose':_0x198585[_0x47c54e(0xfe)]}),_0x14364b=_0x2d6933[_0x47c54e(0x106)];_0x198585[_0x47c54e(0xfe)]&&(console['error']('Resolved\x20type:\x20'+_0x14364b[_0x47c54e(0x12e)]),console[_0x47c54e(0x10c)](_0x47c54e(0xf2)+_0x14364b['parentId']));if(_0x14364b[_0x47c54e(0x12e)]===_0x47c54e(0x107))return console['error'](_0x47c54e(0x11c)),console[_0x47c54e(0x10c)](_0x47c54e(0x11b)),0x1;let _0x167d52;if(_0x14364b['type']===_0x47c54e(0x105)){const _0x1062c5=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x3cce35[_0x47c54e(0x140)][_0x47c54e(0x13e)](_0x14364b['parentId']),{'verbose':_0x198585['verbose']});_0x167d52=_0x1062c5['data'];}else{if(!_0x14364b[_0x47c54e(0xec)])throw new SDKError(ErrorCode[_0x47c54e(0x14f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x398572=await withSpinner(_0x47c54e(0xf7),()=>_0x3cce35[_0x47c54e(0x140)][_0x47c54e(0x14b)](_0x14364b['parentId'],_0x14364b[_0x47c54e(0xec)]),{'verbose':_0x198585[_0x47c54e(0xfe)]});_0x167d52=_0x398572['data'];}const _0x32cbf7=resolveLimit(_0x198585[_0x47c54e(0xf4)],DEFAULT_DISPLAY_LIMIT),_0x2ba327=/\bLIMIT\s+\d+/i['test'](_0x167d52);!_0x2ba327&&(_0x167d52=_0x167d52[_0x47c54e(0x15e)]()[_0x47c54e(0x129)](/;+$/,''),_0x167d52=_0x47c54e(0xee)+_0x167d52+_0x47c54e(0xf1)+_0x32cbf7);_0x198585[_0x47c54e(0xfe)]&&console[_0x47c54e(0x10c)](_0x47c54e(0x157)+_0x167d52);const _0x3e0d11=await withQuerySpinner(_0x47c54e(0x127),async _0x489bf1=>{const _0x48c734=_0x47c54e,_0x345fc3=await _0x3cce35['query'](_0x167d52,{'catalog':'td','schema':_0x48c734(0x110),'onJobId':_0x540e3f=>{_0x489bf1['setJobId'](_0x540e3f);}});return _0x345fc3;},{'verbose':_0x198585['verbose']}),_0x1e1025=_0x3e0d11[_0x47c54e(0x106)],_0xaa8732=_0x1e1025[_0x47c54e(0x155)]?_0x47c54e(0x111)+_0x1e1025[_0x47c54e(0x155)]+']':'';return console[_0x47c54e(0x10c)](_0x47c54e(0x154)+_0x1e1025['stats'][_0x47c54e(0x108)]['toLocaleString']()+_0x47c54e(0x146)+(_0x47c54e(0x12d)+formatElapsed(_0x1e1025['stats']['elapsedTimeMillis'])+_0xaa8732)),await handleQueryOutput(_0x1e1025,_0x198585),0x0;}catch(_0x523fac){if(_0x523fac instanceof SDKError)return console[_0x47c54e(0x10c)](_0x47c54e(0xf8)+_0x523fac[_0x47c54e(0x141)]+']'),console[_0x47c54e(0x10c)]('\x0a'+_0x523fac['message']),0x1;throw _0x523fac;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x1e14fc(0x130)]=a22_0x1e14fc(0x100);[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x14e);async['execute'](_0x3d0c36){const _0x50f55e=a22_0x1e14fc,{options:_0x3af545,args:_0x7deb6c,tdx:_0x42d8f1}=_0x3d0c36;if(_0x7deb6c['length']===0x0)return console[_0x50f55e(0x10c)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x5d9616=_0x7deb6c[0x0];try{_0x3af545[_0x50f55e(0xfe)]&&(console[_0x50f55e(0x10c)](_0x50f55e(0x135)+_0x3af545[_0x50f55e(0x112)]),console['error'](_0x50f55e(0x151)+_0x5d9616));const _0x1a68e5=await withSpinner(_0x50f55e(0x138)+_0x5d9616+'\x27...',()=>_0x42d8f1[_0x50f55e(0x140)][_0x50f55e(0x102)](_0x5d9616),{'verbose':_0x3af545[_0x50f55e(0xfe)]}),_0x295bf4=_0x1a68e5['data'];_0x3af545[_0x50f55e(0xfe)]&&console[_0x50f55e(0x10c)](_0x50f55e(0x115)+_0x295bf4);const _0x4affc2=await withSpinner(_0x50f55e(0xf9)+_0x5d9616+_0x50f55e(0x152),()=>_0x42d8f1[_0x50f55e(0x140)]['listFolders'](_0x295bf4),{'verbose':_0x3af545[_0x50f55e(0xfe)]}),_0x2c8fc2=_0x4affc2['data'];return console['error'](_0x50f55e(0x109)+_0x2c8fc2[_0x50f55e(0x156)]+_0x50f55e(0x15c)+(_0x2c8fc2[_0x50f55e(0x156)]!==0x1?'s':'')),await handleSDKOutput(_0x2c8fc2,_0x3af545),0x0;}catch(_0x17f638){if(_0x17f638 instanceof SDKError)return console['error'](_0x50f55e(0x118)+_0x17f638['message']),_0x17f638[_0x50f55e(0x119)]&&console[_0x50f55e(0x10c)](_0x50f55e(0x13b)+_0x17f638['cause']),0x1;throw _0x17f638;}}}function a22_0x3975(_0x5bb802,_0x69622e){const _0x459837=a22_0x4598();return a22_0x3975=function(_0x39757e,_0x16174e){_0x39757e=_0x39757e-0xec;let _0x1dc39a=_0x459837[_0x39757e];return _0x1dc39a;},a22_0x3975(_0x5bb802,_0x69622e);}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:folder:show';['description']=a22_0x1e14fc(0x116);async[a22_0x1e14fc(0x10e)](_0x461ee5){const _0x5a75d2=a22_0x1e14fc,{options:_0x58d419,args:_0x446b8b,tdx:_0xe3e7c1}=_0x461ee5;if(_0x446b8b['length']===0x0)return console[_0x5a75d2(0x10c)](_0x5a75d2(0x120)),console[_0x5a75d2(0x10c)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x196bb0,childId:_0x1f9af3}=parseSegmentRef(_0x446b8b[0x0]);_0x58d419[_0x5a75d2(0xfe)]&&(console[_0x5a75d2(0x10c)](_0x5a75d2(0x135)+_0x58d419[_0x5a75d2(0x112)]),console['error'](_0x5a75d2(0x151)+_0x196bb0),_0x1f9af3&&console['error'](_0x5a75d2(0xf6)+_0x1f9af3));if(!_0x1f9af3)return console[_0x5a75d2(0x10c)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x857cca=await withSpinner(_0x5a75d2(0x138)+_0x196bb0+'\x27...',()=>_0xe3e7c1[_0x5a75d2(0x140)][_0x5a75d2(0x102)](_0x196bb0),{'verbose':_0x58d419['verbose']}),_0x4f0bc7=_0x857cca[_0x5a75d2(0x106)];_0x58d419[_0x5a75d2(0xfe)]&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x115)+_0x4f0bc7);const _0x36acbc=await withSpinner(_0x5a75d2(0x147)+_0x1f9af3+_0x5a75d2(0x152),()=>_0xe3e7c1[_0x5a75d2(0x140)][_0x5a75d2(0x128)](_0x4f0bc7,_0x1f9af3),{'verbose':_0x58d419['verbose']}),_0x35cf4f=_0x36acbc[_0x5a75d2(0x106)];_0x58d419['verbose']&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x150)+_0x35cf4f);const _0xa50964=await withSpinner(_0x5a75d2(0x126)+_0x1f9af3+_0x5a75d2(0x152),()=>_0xe3e7c1['segment'][_0x5a75d2(0x15d)](_0x35cf4f),{'verbose':_0x58d419[_0x5a75d2(0xfe)]});return await handleSDKOutput([_0xa50964[_0x5a75d2(0x106)]],_0x58d419),0x0;}catch(_0x3b5e35){if(_0x3b5e35 instanceof SDKError)return console[_0x5a75d2(0x10c)]('Error:\x20'+_0x3b5e35[_0x5a75d2(0x13f)]),_0x3b5e35[_0x5a75d2(0x119)]&&console[_0x5a75d2(0x10c)](_0x5a75d2(0x13b)+_0x3b5e35[_0x5a75d2(0x119)]),0x1;throw _0x3b5e35;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:sql';[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x117);async[a22_0x1e14fc(0x10e)](_0x32aed9){const _0x13d62d=a22_0x1e14fc,{options:_0x228686,args:_0x15301c,tdx:_0x44fdbd}=_0x32aed9;if(_0x15301c['length']===0x0)return console[_0x13d62d(0x10c)](_0x13d62d(0x13d)),console['error'](_0x13d62d(0x159)),console[_0x13d62d(0x10c)](_0x13d62d(0xed)),console[_0x13d62d(0x10c)](_0x13d62d(0xf5)),console[_0x13d62d(0x10c)](_0x13d62d(0x134)),console[_0x13d62d(0x10c)](_0x13d62d(0x12b)),0x1;try{const _0x294755=_0x15301c[0x0],_0x45bf64=_0x228686['segmentPath'];let _0x42e561=_0x294755;_0x45bf64&&!_0x294755[_0x13d62d(0x153)]('/')&&(_0x42e561=_0x45bf64+'/'+_0x294755,_0x228686[_0x13d62d(0xfe)]&&console['error'](_0x13d62d(0x10b)+_0x42e561));const _0x3a104c=await withSpinner(_0x13d62d(0xfd)+_0x42e561+_0x13d62d(0x152),()=>_0x44fdbd[_0x13d62d(0x140)]['resolvePathToResource'](_0x42e561),{'verbose':_0x228686[_0x13d62d(0xfe)]}),_0x4292e0=_0x3a104c[_0x13d62d(0x106)];_0x228686['verbose']&&(console[_0x13d62d(0x10c)]('Resolved\x20type:\x20'+_0x4292e0[_0x13d62d(0x12e)]),console[_0x13d62d(0x10c)]('Parent\x20ID:\x20'+_0x4292e0[_0x13d62d(0x13a)]));if(_0x4292e0['type']===_0x13d62d(0x107))return console[_0x13d62d(0x10c)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x13d62d(0x10c)](_0x13d62d(0x12c)),0x1;let _0x7b0093;if(_0x4292e0[_0x13d62d(0x12e)]===_0x13d62d(0x105)){const _0x379feb=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x44fdbd[_0x13d62d(0x140)]['getParentSQL'](_0x4292e0[_0x13d62d(0x13a)]),{'verbose':_0x228686['verbose']});_0x7b0093=_0x379feb[_0x13d62d(0x106)];}else{if(!_0x4292e0[_0x13d62d(0xec)])throw new SDKError(ErrorCode[_0x13d62d(0x14f)],_0x13d62d(0x13c));const _0x5efa91=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x44fdbd[_0x13d62d(0x140)]['getSegmentSQL'](_0x4292e0[_0x13d62d(0x13a)],_0x4292e0[_0x13d62d(0xec)]),{'verbose':_0x228686[_0x13d62d(0xfe)]});_0x7b0093=_0x5efa91[_0x13d62d(0x106)];}return _0x228686[_0x13d62d(0xff)]===_0x13d62d(0x14c)||_0x228686['format']==='jsonl'?await handleSDKOutput([{'sql':_0x7b0093}],_0x228686):console[_0x13d62d(0x132)](_0x7b0093),0x0;}catch(_0x237291){if(_0x237291 instanceof SDKError)return console['error']('Error:\x20'+_0x237291[_0x13d62d(0x13f)]),_0x237291['cause']&&console['error'](_0x13d62d(0x13b)+_0x237291[_0x13d62d(0x119)]),0x1;throw _0x237291;}}}function a22_0x4598(){const _0x4df051=['\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Folder\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','✖\x20Query\x20failed\x20[','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Usage:\x20tdx\x20segment\x20describe\x20<path>','✔\x20Created\x20folder\x20\x27','Resolving\x20path\x20\x27','verbose','format','segment:folder:list','237457NDprOS','resolveParentId','description','100209WRIsZY','parent','data','folder','processedRows','✔\x20Found\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','Resolved\x20relative\x20path\x20to:\x20','error','Resolving\x20parent\x20folder\x20\x27','execute','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','information_schema','\x20[Job\x20ID:\x20','site','getParent','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20parent\x20ID:\x20','Show\x20segment\x20folder\x20details','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Error:\x20','cause','segmentPath','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolved\x20parent\x20folder\x20ID:\x20','82GPDsnI','1386763UGQpPC','Error:\x20Folder\x20reference\x20is\x20required','Fetching\x20segment\x20details...','1783989RYtXCy','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Create\x20segment\x20folder\x20for\x20organization','24dsbbGW','Fetching\x20folder\x20\x27','Executing\x20segment\x20query...','resolveFolderId','replace','Parent\x20segment:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','in\x20','type','48RvMAsY','name','9620140lYmiWY','log','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderId','Resolving\x20parent\x20segment\x20\x27','Fetching\x20parent\x20segment\x20details...','parentId','\x20\x20Cause:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','getParentSQL','message','segment','code','384685uoYvRx','\x27\x20with\x20ID:\x20','segment:show','createFolder','\x20rows\x20','Resolving\x20folder\x20\x27','1304zxnrSz','Error:\x20Path\x20or\x20name\x20is\x20required','8095caMgiJ','getSegmentSQL','json','Folder\x20ID:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','INTERNAL','Resolved\x20folder\x20ID:\x20','Parent\x20name:\x20','\x27...','includes','✔\x20Query\x20completed:\x20Processed\x20','jobId','length','SQL\x20query:\x0a','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20sql\x20<path>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20folder','getFolder','trim','segmentId','Examples:','SELECT\x20*\x20FROM\x20(\x0a','segment:describe','parentFolder','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20ID:\x20','300mdcQCJ','limit'];a22_0x4598=function(){return _0x4df051;};return a22_0x4598();}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x1e14fc(0x130)]='segment:folder:create';[a22_0x1e14fc(0x103)]=a22_0x1e14fc(0x124);async[a22_0x1e14fc(0x10e)](_0x197885){const _0x11e23c=a22_0x1e14fc,{options:_0x1a36fb,args:_0x5740ae,tdx:_0x588080}=_0x197885,_0x3838fe=_0x1a36fb;if(_0x5740ae[_0x11e23c(0x156)]<0x2)return console[_0x11e23c(0x10c)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x11e23c(0x10c)](_0x11e23c(0x114)),0x1;const _0x457123=_0x5740ae[0x0],_0x1793a8=_0x5740ae[0x1];_0x3838fe[_0x11e23c(0xfe)]&&(console['error'](_0x11e23c(0x135)+_0x3838fe[_0x11e23c(0x112)]),console[_0x11e23c(0x10c)](_0x11e23c(0x12a)+_0x457123),console[_0x11e23c(0x10c)](_0x11e23c(0xf6)+_0x1793a8));let _0x32f184;if(_0x3838fe[_0x11e23c(0xf0)]){const _0x14bbc2=_0x3838fe[_0x11e23c(0xf0)],_0x5ce834=await withSpinner(_0x11e23c(0x138)+_0x457123+_0x11e23c(0x152),()=>_0x588080[_0x11e23c(0x140)][_0x11e23c(0x102)](_0x457123),{'verbose':_0x3838fe[_0x11e23c(0xfe)]}),_0x83be2d=_0x5ce834[_0x11e23c(0x106)],_0x8374b=await withSpinner(_0x11e23c(0x10d)+_0x14bbc2+_0x11e23c(0x152),()=>_0x588080[_0x11e23c(0x140)][_0x11e23c(0x128)](_0x83be2d,_0x14bbc2),{'verbose':_0x3838fe[_0x11e23c(0xfe)]});_0x32f184=_0x8374b[_0x11e23c(0x106)],_0x3838fe[_0x11e23c(0xfe)]&&console[_0x11e23c(0x10c)](_0x11e23c(0x11d)+_0x32f184);}const _0x50a591={'name':_0x1793a8,'description':_0x3838fe[_0x11e23c(0x103)],'parentFolderId':_0x32f184},_0x2163c0=await withSpinner('Creating\x20folder\x20\x27'+_0x1793a8+'\x27...',()=>_0x588080['segment'][_0x11e23c(0x145)](_0x457123,_0x50a591),{'verbose':_0x3838fe[_0x11e23c(0xfe)]}),_0x194ff0=_0x2163c0[_0x11e23c(0x106)];return console[_0x11e23c(0x10c)](_0x11e23c(0xfc)+_0x194ff0[_0x11e23c(0x130)]+_0x11e23c(0x143)+_0x194ff0['id']),await handleSDKOutput([_0x194ff0],_0x3838fe),0x0;}}
1
+ const a22_0x22b1fd=a22_0x4942;(function(_0x388dfc,_0x3586e7){const _0x3dc287=a22_0x4942,_0x33c4a2=_0x388dfc();while(!![]){try{const _0x44135a=parseInt(_0x3dc287(0x17f))/0x1*(parseInt(_0x3dc287(0x19b))/0x2)+-parseInt(_0x3dc287(0x140))/0x3+parseInt(_0x3dc287(0x17b))/0x4+parseInt(_0x3dc287(0x18a))/0x5*(-parseInt(_0x3dc287(0x155))/0x6)+-parseInt(_0x3dc287(0x14b))/0x7*(parseInt(_0x3dc287(0x160))/0x8)+-parseInt(_0x3dc287(0x14e))/0x9+-parseInt(_0x3dc287(0x16c))/0xa*(-parseInt(_0x3dc287(0x182))/0xb);if(_0x44135a===_0x3586e7)break;else _0x33c4a2['push'](_0x33c4a2['shift']());}catch(_0x52e89c){_0x33c4a2['push'](_0x33c4a2['shift']());}}}(a22_0x4596,0xe32a1));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 a22_0x4942(_0x2a5611,_0x2ddf13){const _0x459685=a22_0x4596();return a22_0x4942=function(_0x4942b1,_0x15df9a){_0x4942b1=_0x4942b1-0x132;let _0x474cac=_0x459685[_0x4942b1];return _0x474cac;},a22_0x4942(_0x2a5611,_0x2ddf13);}export class SegmentDescribeCommand extends BaseCommand{[a22_0x22b1fd(0x1a1)]=a22_0x22b1fd(0x141);['description']=a22_0x22b1fd(0x193);async[a22_0x22b1fd(0x188)](_0x4c1e2f){const _0x5796f9=a22_0x22b1fd,{options:_0x24e40d,args:_0x543db7,tdx:_0x1a7448}=_0x4c1e2f;if(_0x543db7[_0x5796f9(0x194)]===0x0)return console[_0x5796f9(0x134)](_0x5796f9(0x13d)),console[_0x5796f9(0x134)](_0x5796f9(0x19c)),console[_0x5796f9(0x134)](_0x5796f9(0x195)),console[_0x5796f9(0x134)](_0x5796f9(0x14d)),console[_0x5796f9(0x134)](_0x5796f9(0x18f)),console[_0x5796f9(0x134)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x5514ec=_0x543db7[0x0],_0x42f1bc=_0x24e40d[_0x5796f9(0x169)];let _0x5de153=_0x5514ec;_0x42f1bc&&!_0x5514ec[_0x5796f9(0x13b)]('/')&&(_0x5de153=_0x42f1bc+'/'+_0x5514ec,_0x24e40d['verbose']&&console[_0x5796f9(0x134)](_0x5796f9(0x137)+_0x5de153));const _0x7443a2=await withSpinner(_0x5796f9(0x146)+_0x5de153+'\x27...',()=>_0x1a7448['segment'][_0x5796f9(0x163)](_0x5de153),{'verbose':_0x24e40d[_0x5796f9(0x170)]}),_0x230c35=_0x7443a2[_0x5796f9(0x168)];_0x24e40d[_0x5796f9(0x170)]&&(console[_0x5796f9(0x134)](_0x5796f9(0x164)+_0x230c35[_0x5796f9(0x161)]),console[_0x5796f9(0x134)](_0x5796f9(0x148)+_0x230c35[_0x5796f9(0x18d)]),_0x230c35['folderId']&&console[_0x5796f9(0x134)](_0x5796f9(0x1a2)+_0x230c35[_0x5796f9(0x176)]),_0x230c35[_0x5796f9(0x14c)]&&console[_0x5796f9(0x134)](_0x5796f9(0x150)+_0x230c35[_0x5796f9(0x14c)]));if(_0x230c35[_0x5796f9(0x161)]===_0x5796f9(0x13a)){const _0x50443c=await withSpinner(_0x5796f9(0x1a0),()=>_0x1a7448['segment'][_0x5796f9(0x174)](_0x230c35[_0x5796f9(0x18d)]),{'verbose':_0x24e40d[_0x5796f9(0x170)]});await handleSDKOutput([_0x50443c[_0x5796f9(0x168)]],_0x24e40d);}else{if(_0x230c35[_0x5796f9(0x161)]===_0x5796f9(0x179)){if(!_0x230c35['folderId'])throw new SDKError(ErrorCode[_0x5796f9(0x13f)],_0x5796f9(0x18e));const _0x18084d=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1a7448[_0x5796f9(0x1a8)]['getFolder'](_0x230c35[_0x5796f9(0x176)]),{'verbose':_0x24e40d[_0x5796f9(0x170)]});await handleSDKOutput([_0x18084d['data']],_0x24e40d);}else{if(_0x230c35[_0x5796f9(0x161)]===_0x5796f9(0x1a8)){if(!_0x230c35[_0x5796f9(0x14c)])throw new SDKError(ErrorCode[_0x5796f9(0x13f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2db466=await withSpinner(_0x5796f9(0x139),()=>_0x1a7448[_0x5796f9(0x1a8)][_0x5796f9(0x18c)](_0x230c35[_0x5796f9(0x18d)],_0x230c35[_0x5796f9(0x14c)]),{'verbose':_0x24e40d['verbose']});await handleSDKOutput([_0x2db466[_0x5796f9(0x168)]],_0x24e40d);}}}return 0x0;}catch(_0xb5da1d){if(_0xb5da1d instanceof SDKError)return console[_0x5796f9(0x134)](_0x5796f9(0x152)+_0xb5da1d[_0x5796f9(0x16f)]),_0xb5da1d[_0x5796f9(0x1aa)]&&console[_0x5796f9(0x134)](_0x5796f9(0x1a7)+_0xb5da1d[_0x5796f9(0x1aa)]),0x1;throw _0xb5da1d;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x22b1fd(0x1a1)]='segment:show';['description']=a22_0x22b1fd(0x17d);async[a22_0x22b1fd(0x188)](_0x45a4f4){const _0x245c3a=a22_0x22b1fd,{options:_0x271f00,args:_0x5cd6d5,tdx:_0x3644b1}=_0x45a4f4;if(_0x5cd6d5[_0x245c3a(0x194)]===0x0)return console[_0x245c3a(0x134)](_0x245c3a(0x190)),console['error'](_0x245c3a(0x151)),console['error'](_0x245c3a(0x195)),console[_0x245c3a(0x134)](_0x245c3a(0x19a)),console[_0x245c3a(0x134)](_0x245c3a(0x17a)),console[_0x245c3a(0x134)](_0x245c3a(0x1a3)),0x1;try{const _0x1a0153=_0x5cd6d5[0x0],_0x130681=_0x271f00[_0x245c3a(0x169)];let _0x176ab9=_0x1a0153;_0x130681&&!_0x1a0153[_0x245c3a(0x13b)]('/')&&(_0x176ab9=_0x130681+'/'+_0x1a0153,_0x271f00[_0x245c3a(0x170)]&&console[_0x245c3a(0x134)]('Resolved\x20relative\x20path\x20to:\x20'+_0x176ab9));const _0x2362ce=await withSpinner(_0x245c3a(0x146)+_0x176ab9+_0x245c3a(0x167),()=>_0x3644b1[_0x245c3a(0x1a8)][_0x245c3a(0x163)](_0x176ab9),{'verbose':_0x271f00[_0x245c3a(0x170)]}),_0x54e6fa=_0x2362ce[_0x245c3a(0x168)];_0x271f00[_0x245c3a(0x170)]&&(console[_0x245c3a(0x134)]('Resolved\x20type:\x20'+_0x54e6fa[_0x245c3a(0x161)]),console[_0x245c3a(0x134)](_0x245c3a(0x148)+_0x54e6fa[_0x245c3a(0x18d)]));if(_0x54e6fa['type']===_0x245c3a(0x179))return console[_0x245c3a(0x134)](_0x245c3a(0x153)),console[_0x245c3a(0x134)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x406bfd;if(_0x54e6fa[_0x245c3a(0x161)]===_0x245c3a(0x13a)){const _0x2b712c=await withSpinner(_0x245c3a(0x199),()=>_0x3644b1[_0x245c3a(0x1a8)][_0x245c3a(0x13c)](_0x54e6fa[_0x245c3a(0x18d)]),{'verbose':_0x271f00[_0x245c3a(0x170)]});_0x406bfd=_0x2b712c[_0x245c3a(0x168)];}else{if(!_0x54e6fa['segmentId'])throw new SDKError(ErrorCode[_0x245c3a(0x13f)],_0x245c3a(0x177));const _0x2a8195=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3644b1[_0x245c3a(0x1a8)][_0x245c3a(0x1a9)](_0x54e6fa['parentId'],_0x54e6fa[_0x245c3a(0x14c)]),{'verbose':_0x271f00[_0x245c3a(0x170)]});_0x406bfd=_0x2a8195[_0x245c3a(0x168)];}const _0x2f0091=resolveLimit(_0x271f00[_0x245c3a(0x191)],DEFAULT_DISPLAY_LIMIT),_0x129717=/\bLIMIT\s+\d+/i[_0x245c3a(0x15f)](_0x406bfd);!_0x129717&&(_0x406bfd=_0x406bfd[_0x245c3a(0x154)]()[_0x245c3a(0x143)](/;+$/,''),_0x406bfd=_0x245c3a(0x138)+_0x406bfd+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x2f0091);_0x271f00['verbose']&&console[_0x245c3a(0x134)](_0x245c3a(0x145)+_0x406bfd);const _0x25a4d4=await withQuerySpinner(_0x245c3a(0x173),async _0x2a50ff=>{const _0x2012f2=_0x245c3a,_0x40d807=await _0x3644b1[_0x2012f2(0x18b)](_0x406bfd,{'catalog':'td','schema':'information_schema','onJobId':_0x22cd72=>{const _0x150cd6=_0x2012f2;_0x2a50ff[_0x150cd6(0x192)](_0x22cd72);}});return _0x40d807;},{'verbose':_0x271f00['verbose']}),_0x291f4d=_0x25a4d4['data'],_0x5b44ea=_0x291f4d[_0x245c3a(0x165)]?_0x245c3a(0x15b)+_0x291f4d[_0x245c3a(0x165)]+']':'';return console['error'](_0x245c3a(0x16b)+_0x291f4d[_0x245c3a(0x13e)][_0x245c3a(0x14a)][_0x245c3a(0x136)]()+'\x20rows\x20'+(_0x245c3a(0x189)+formatElapsed(_0x291f4d[_0x245c3a(0x13e)]['elapsedTimeMillis'])+_0x5b44ea)),await handleQueryOutput(_0x291f4d,_0x271f00),0x0;}catch(_0x34636b){if(_0x34636b instanceof SDKError)return console[_0x245c3a(0x134)]('✖\x20Query\x20failed\x20['+_0x34636b[_0x245c3a(0x135)]+']'),console[_0x245c3a(0x134)]('\x0a'+_0x34636b[_0x245c3a(0x16f)]),0x1;throw _0x34636b;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x22b1fd(0x1a1)]=a22_0x22b1fd(0x166);[a22_0x22b1fd(0x175)]=a22_0x22b1fd(0x19d);async[a22_0x22b1fd(0x188)](_0x268a51){const _0x488537=a22_0x22b1fd,{options:_0xe604e3,args:_0x2bfc95,tdx:_0x33f243}=_0x268a51;if(_0x2bfc95['length']===0x0)return console[_0x488537(0x134)](_0x488537(0x180)),console[_0x488537(0x134)](_0x488537(0x178)),0x1;const _0x26bb3e=_0x2bfc95[0x0];try{_0xe604e3[_0x488537(0x170)]&&(console[_0x488537(0x134)](_0x488537(0x15c)+_0xe604e3[_0x488537(0x14f)]),console['error'](_0x488537(0x17e)+_0x26bb3e));const _0x425b56=await withSpinner(_0x488537(0x185)+_0x26bb3e+_0x488537(0x167),()=>_0x33f243[_0x488537(0x1a8)]['resolveParentId'](_0x26bb3e),{'verbose':_0xe604e3['verbose']}),_0x1a6c2e=_0x425b56[_0x488537(0x168)];_0xe604e3[_0x488537(0x170)]&&console['error'](_0x488537(0x16d)+_0x1a6c2e);const _0x855005=await withSpinner(_0x488537(0x1a6)+_0x26bb3e+_0x488537(0x167),()=>_0x33f243[_0x488537(0x1a8)][_0x488537(0x132)](_0x1a6c2e),{'verbose':_0xe604e3['verbose']}),_0x1674f1=_0x855005[_0x488537(0x168)];return console['error']('✔\x20Found\x20'+_0x1674f1[_0x488537(0x194)]+_0x488537(0x197)+(_0x1674f1[_0x488537(0x194)]!==0x1?'s':'')),await handleSDKOutput(_0x1674f1,_0xe604e3),0x0;}catch(_0x44076f){if(_0x44076f instanceof SDKError)return console[_0x488537(0x134)](_0x488537(0x152)+_0x44076f['message']),_0x44076f[_0x488537(0x1aa)]&&console[_0x488537(0x134)](_0x488537(0x1a7)+_0x44076f['cause']),0x1;throw _0x44076f;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a22_0x22b1fd(0x15d);['description']='Show\x20segment\x20folder\x20details';async['execute'](_0x5e212c){const _0x5685fc=a22_0x22b1fd,{options:_0x39bd36,args:_0x22eb63,tdx:_0x2b5a0e}=_0x5e212c;if(_0x22eb63[_0x5685fc(0x194)]===0x0)return console[_0x5685fc(0x134)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x5685fc(0x134)](_0x5685fc(0x15e)),0x1;try{const {parentId:_0x2d14c2,childId:_0x267fdb}=parseSegmentRef(_0x22eb63[0x0]);_0x39bd36[_0x5685fc(0x170)]&&(console[_0x5685fc(0x134)](_0x5685fc(0x15c)+_0x39bd36[_0x5685fc(0x14f)]),console[_0x5685fc(0x134)](_0x5685fc(0x17e)+_0x2d14c2),_0x267fdb&&console['error'](_0x5685fc(0x159)+_0x267fdb));if(!_0x267fdb)return console[_0x5685fc(0x134)](_0x5685fc(0x198)),0x1;const _0x2295b8=await withSpinner(_0x5685fc(0x185)+_0x2d14c2+_0x5685fc(0x167),()=>_0x2b5a0e[_0x5685fc(0x1a8)][_0x5685fc(0x15a)](_0x2d14c2),{'verbose':_0x39bd36[_0x5685fc(0x170)]}),_0x2d2b9d=_0x2295b8['data'];_0x39bd36[_0x5685fc(0x170)]&&console[_0x5685fc(0x134)](_0x5685fc(0x16d)+_0x2d2b9d);const _0x3cfdf0=await withSpinner(_0x5685fc(0x149)+_0x267fdb+'\x27...',()=>_0x2b5a0e['segment'][_0x5685fc(0x181)](_0x2d2b9d,_0x267fdb),{'verbose':_0x39bd36[_0x5685fc(0x170)]}),_0x5c773e=_0x3cfdf0['data'];_0x39bd36[_0x5685fc(0x170)]&&console[_0x5685fc(0x134)](_0x5685fc(0x17c)+_0x5c773e);const _0x39bc5a=await withSpinner(_0x5685fc(0x19e)+_0x267fdb+_0x5685fc(0x167),()=>_0x2b5a0e[_0x5685fc(0x1a8)]['getFolder'](_0x5c773e),{'verbose':_0x39bd36[_0x5685fc(0x170)]});return await handleSDKOutput([_0x39bc5a[_0x5685fc(0x168)]],_0x39bd36),0x0;}catch(_0x252034){if(_0x252034 instanceof SDKError)return console[_0x5685fc(0x134)](_0x5685fc(0x152)+_0x252034[_0x5685fc(0x16f)]),_0x252034[_0x5685fc(0x1aa)]&&console[_0x5685fc(0x134)](_0x5685fc(0x1a7)+_0x252034[_0x5685fc(0x1aa)]),0x1;throw _0x252034;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x22b1fd(0x1a1)]=a22_0x22b1fd(0x19f);[a22_0x22b1fd(0x175)]=a22_0x22b1fd(0x172);async[a22_0x22b1fd(0x188)](_0x415eed){const _0x26b5ad=a22_0x22b1fd,{options:_0x476010,args:_0x566a73,tdx:_0x1d3978}=_0x415eed;if(_0x566a73['length']===0x0)return console[_0x26b5ad(0x134)](_0x26b5ad(0x190)),console['error'](_0x26b5ad(0x16a)),console['error'](_0x26b5ad(0x195)),console[_0x26b5ad(0x134)](_0x26b5ad(0x171)),console[_0x26b5ad(0x134)](_0x26b5ad(0x157)),console[_0x26b5ad(0x134)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x1bd9e8=_0x566a73[0x0],_0x591091=_0x476010[_0x26b5ad(0x169)];let _0x4ead76=_0x1bd9e8;_0x591091&&!_0x1bd9e8[_0x26b5ad(0x13b)]('/')&&(_0x4ead76=_0x591091+'/'+_0x1bd9e8,_0x476010['verbose']&&console[_0x26b5ad(0x134)](_0x26b5ad(0x137)+_0x4ead76));const _0x5516c4=await withSpinner('Resolving\x20path\x20\x27'+_0x4ead76+_0x26b5ad(0x167),()=>_0x1d3978[_0x26b5ad(0x1a8)][_0x26b5ad(0x163)](_0x4ead76),{'verbose':_0x476010[_0x26b5ad(0x170)]}),_0x17a2ee=_0x5516c4['data'];_0x476010[_0x26b5ad(0x170)]&&(console['error'](_0x26b5ad(0x164)+_0x17a2ee['type']),console[_0x26b5ad(0x134)](_0x26b5ad(0x148)+_0x17a2ee[_0x26b5ad(0x18d)]));if(_0x17a2ee[_0x26b5ad(0x161)]==='folder')return console['error'](_0x26b5ad(0x133)),console[_0x26b5ad(0x134)](_0x26b5ad(0x144)),0x1;let _0xbdf34f;if(_0x17a2ee[_0x26b5ad(0x161)]===_0x26b5ad(0x13a)){const _0x2dc355=await withSpinner(_0x26b5ad(0x199),()=>_0x1d3978[_0x26b5ad(0x1a8)][_0x26b5ad(0x13c)](_0x17a2ee[_0x26b5ad(0x18d)]),{'verbose':_0x476010[_0x26b5ad(0x170)]});_0xbdf34f=_0x2dc355['data'];}else{if(!_0x17a2ee[_0x26b5ad(0x14c)])throw new SDKError(ErrorCode[_0x26b5ad(0x13f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4338d5=await withSpinner(_0x26b5ad(0x162),()=>_0x1d3978[_0x26b5ad(0x1a8)]['getSegmentSQL'](_0x17a2ee[_0x26b5ad(0x18d)],_0x17a2ee['segmentId']),{'verbose':_0x476010['verbose']});_0xbdf34f=_0x4338d5[_0x26b5ad(0x168)];}return _0x476010['format']===_0x26b5ad(0x142)||_0x476010['format']===_0x26b5ad(0x187)?await handleSDKOutput([{'sql':_0xbdf34f}],_0x476010):console[_0x26b5ad(0x183)](_0xbdf34f),0x0;}catch(_0x328a0f){if(_0x328a0f instanceof SDKError)return console[_0x26b5ad(0x134)](_0x26b5ad(0x152)+_0x328a0f[_0x26b5ad(0x16f)]),_0x328a0f[_0x26b5ad(0x1aa)]&&console[_0x26b5ad(0x134)](_0x26b5ad(0x1a7)+_0x328a0f[_0x26b5ad(0x1aa)]),0x1;throw _0x328a0f;}}}function a22_0x4596(){const _0x388fa3=['trim','1528506ixDAKx','createFolder','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20parent\x20folder\x20ID:\x20','Folder\x20name:\x20','resolveParentId','\x20[Job\x20ID:\x20','Site:\x20','segment:folder:show','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','test','5680zgSZxR','type','Fetching\x20SQL\x20for\x20segment...','resolvePathToResource','Resolved\x20type:\x20','jobId','segment:folder:list','\x27...','data','segmentPath','Usage:\x20tdx\x20segment\x20sql\x20<path>','✔\x20Query\x20completed:\x20Processed\x20','380fBfeYW','Resolved\x20parent\x20ID:\x20','Parent\x20segment:\x20','message','verbose','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Executing\x20segment\x20query...','getParent','description','folderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','folder','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','1495056ZtVXsn','Resolved\x20folder\x20ID:\x20','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Parent\x20name:\x20','707fYaKYV','Error:\x20Parent\x20segment\x20name\x20is\x20required','resolveFolderId','1588477JWvGMB','log','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolving\x20parent\x20segment\x20\x27','parentFolder','jsonl','execute','in\x20','30UmYpTG','query','getSegment','parentId','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','limit','setJobId','Show\x20segment\x20or\x20folder\x20details','length','Examples:','\x27\x20with\x20ID:\x20','\x20folder','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Fetching\x20SQL\x20for\x20parent\x20segment...','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','2252cJSXPH','Usage:\x20tdx\x20segment\x20describe\x20<path>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Fetching\x20folder\x20\x27','segment:sql','Fetching\x20parent\x20segment\x20details...','name','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Creating\x20folder\x20\x27','Resolving\x20parent\x20folder\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20Cause:\x20','segment','getSegmentSQL','cause','listFolders','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','error','code','toLocaleString','Resolved\x20relative\x20path\x20to:\x20','SELECT\x20*\x20FROM\x20(\x0a','Fetching\x20segment\x20details...','parent','includes','getParentSQL','Error:\x20Path\x20or\x20name\x20is\x20required','stats','INTERNAL','3034347cjcAID','segment:describe','json','replace','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','SQL\x20query:\x0a','Resolving\x20path\x20\x27','✔\x20Created\x20folder\x20\x27','Parent\x20ID:\x20','Resolving\x20folder\x20\x27','processedRows','14728BHpmOV','segmentId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','15237468ZgcQWa','site','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','Error:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'];a22_0x4596=function(){return _0x388fa3;};return a22_0x4596();}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a22_0x22b1fd(0x175)]='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x22b1fd(0x188)](_0x366fab){const _0x5c5073=a22_0x22b1fd,{options:_0x29eedb,args:_0x362ebc,tdx:_0x26c9c9}=_0x366fab,_0x149b48=_0x29eedb;if(_0x362ebc[_0x5c5073(0x194)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x5c5073(0x134)](_0x5c5073(0x184)),0x1;const _0x519040=_0x362ebc[0x0],_0x1d4124=_0x362ebc[0x1];_0x149b48['verbose']&&(console[_0x5c5073(0x134)](_0x5c5073(0x15c)+_0x149b48[_0x5c5073(0x14f)]),console['error'](_0x5c5073(0x16e)+_0x519040),console[_0x5c5073(0x134)](_0x5c5073(0x159)+_0x1d4124));let _0x16e27b;if(_0x149b48[_0x5c5073(0x186)]){const _0x1a7111=_0x149b48['parentFolder'],_0x5ef77e=await withSpinner(_0x5c5073(0x185)+_0x519040+_0x5c5073(0x167),()=>_0x26c9c9[_0x5c5073(0x1a8)][_0x5c5073(0x15a)](_0x519040),{'verbose':_0x149b48[_0x5c5073(0x170)]}),_0x16e1f3=_0x5ef77e['data'],_0x4c978b=await withSpinner(_0x5c5073(0x1a5)+_0x1a7111+_0x5c5073(0x167),()=>_0x26c9c9['segment'][_0x5c5073(0x181)](_0x16e1f3,_0x1a7111),{'verbose':_0x149b48[_0x5c5073(0x170)]});_0x16e27b=_0x4c978b['data'],_0x149b48[_0x5c5073(0x170)]&&console[_0x5c5073(0x134)](_0x5c5073(0x158)+_0x16e27b);}const _0x29b857={'name':_0x1d4124,'description':_0x149b48['description'],'parentFolderId':_0x16e27b},_0x2160d7=await withSpinner(_0x5c5073(0x1a4)+_0x1d4124+_0x5c5073(0x167),()=>_0x26c9c9[_0x5c5073(0x1a8)][_0x5c5073(0x156)](_0x519040,_0x29b857),{'verbose':_0x149b48[_0x5c5073(0x170)]}),_0x42873d=_0x2160d7[_0x5c5073(0x168)];return console[_0x5c5073(0x134)](_0x5c5073(0x147)+_0x42873d[_0x5c5073(0x1a1)]+_0x5c5073(0x196)+_0x42873d['id']),await handleSDKOutput([_0x42873d],_0x149b48),0x0;}}
@@ -1 +1 @@
1
- const a23_0xb16e67=a23_0x1bd1;function a23_0x1bd1(_0x4f8dd1,_0x58933c){const _0x36cec3=a23_0x36ce();return a23_0x1bd1=function(_0x1bd1a1,_0x2e2044){_0x1bd1a1=_0x1bd1a1-0x1b4;let _0x203f80=_0x36cec3[_0x1bd1a1];return _0x203f80;},a23_0x1bd1(_0x4f8dd1,_0x58933c);}(function(_0x57c35c,_0x55566a){const _0x2d4884=a23_0x1bd1,_0x3c9927=_0x57c35c();while(!![]){try{const _0x5a3057=parseInt(_0x2d4884(0x1cc))/0x1+-parseInt(_0x2d4884(0x1c2))/0x2*(-parseInt(_0x2d4884(0x1e5))/0x3)+parseInt(_0x2d4884(0x1de))/0x4+parseInt(_0x2d4884(0x1c4))/0x5+parseInt(_0x2d4884(0x1d0))/0x6*(-parseInt(_0x2d4884(0x1c9))/0x7)+parseInt(_0x2d4884(0x1c5))/0x8+-parseInt(_0x2d4884(0x1b8))/0x9;if(_0x5a3057===_0x55566a)break;else _0x3c9927['push'](_0x3c9927['shift']());}catch(_0x5f24bb){_0x3c9927['push'](_0x3c9927['shift']());}}}(a23_0x36ce,0x3f7da));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a23_0x36ce(){const _0x13d590=['resolveParentId','verbose','length','Parent:\x20','parent','rule','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Create\x20child\x20segment\x20with\x20filtering\x20rules','602316zDuuee','execute','✔\x20Created\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','kind','Examples:','description','303gvuaSp','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segment','error','\x20\x20\x20Path:\x20','1391229CwXJCz','segmentPath','data','folder','type','Creating\x20segment\x20\x27','resolveFolderId','Target\x20path:\x20','folderId','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','596ixVMoy','resolvePathToResource','307490Oloupm','57192DohjzK','Resolving\x20folder\x20path\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Resolving\x20folder\x20\x27','4242UmwJmD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','site','273789zPwNOb','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','ruleFile','1074EvPLRp','name','\x27...','Resolved\x20folder\x20ID:\x20','segments'];a23_0x36ce=function(){return _0x13d590;};return a23_0x36ce();}export class SegmentCreateCommand extends BaseCommand{[a23_0xb16e67(0x1d1)]=a23_0xb16e67(0x1db);[a23_0xb16e67(0x1e4)]=a23_0xb16e67(0x1dd);async[a23_0xb16e67(0x1df)](_0x4b6fdd){const _0x1f61bc=a23_0xb16e67,{options:_0x482fa5,args:_0x118fce,tdx:_0x4752c0}=_0x4b6fdd,_0x3097a6=_0x482fa5;if(_0x118fce[_0x1f61bc(0x1d7)]===0x0)return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1ca)),console['error'](_0x1f61bc(0x1b4)),console['error'](_0x1f61bc(0x1e3)),console[_0x1f61bc(0x1b6)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x1f61bc(0x1b6)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x1f61bc(0x1dc)),0x1;const _0x1198c5=_0x118fce[0x0],_0x558430=_0x482fa5[_0x1f61bc(0x1b9)];let _0x277516=_0x1198c5;_0x558430&&!_0x1198c5['includes']('/')&&(_0x277516=_0x558430+'/'+_0x1198c5,_0x3097a6['verbose']&&console['error'](_0x1f61bc(0x1cd)+_0x277516));const _0x1e3568=parsePath(_0x277516);if(_0x1e3568[_0x1f61bc(0x1d4)][_0x1f61bc(0x1d7)]<0x2)return console['error'](_0x1f61bc(0x1c1)),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1c7)),0x1;const _0xe7041b=_0x1e3568[_0x1f61bc(0x1d4)][0x0],_0x3de008=getBaseName(_0x277516),_0x386e68=getParentPath(_0x277516);_0x3097a6[_0x1f61bc(0x1d6)]&&(console[_0x1f61bc(0x1b6)]('Site:\x20'+_0x3097a6[_0x1f61bc(0x1cb)]),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1bf)+_0x277516),console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1d8)+_0xe7041b),console[_0x1f61bc(0x1b6)]('Segment\x20name:\x20'+_0x3de008),console[_0x1f61bc(0x1b6)]('Parent\x20path:\x20'+_0x386e68));const _0x295a53=await withSpinner(_0x1f61bc(0x1e1)+_0xe7041b+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1d5)](_0xe7041b),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0x24be4c=_0x295a53[_0x1f61bc(0x1ba)];let _0x124da1;if(_0x1e3568['segments']['length']>0x2){const _0x21bffa=await withSpinner(_0x1f61bc(0x1c6)+_0x386e68+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1c3)](_0x386e68),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0xc666d9=_0x21bffa['data'];if(_0xc666d9[_0x1f61bc(0x1bc)]!==_0x1f61bc(0x1bb)&&_0xc666d9[_0x1f61bc(0x1bc)]!==_0x1f61bc(0x1d9))return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1ce)),0x1;_0x124da1=_0xc666d9[_0x1f61bc(0x1c0)];}else{if(_0x3097a6[_0x1f61bc(0x1bb)]){const _0x19b048=await withSpinner(_0x1f61bc(0x1c8)+_0x3097a6['folder']+_0x1f61bc(0x1d2),()=>_0x4752c0[_0x1f61bc(0x1b5)][_0x1f61bc(0x1be)](_0x24be4c,_0x3097a6[_0x1f61bc(0x1bb)]),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]});_0x124da1=_0x19b048[_0x1f61bc(0x1ba)];}}_0x3097a6['verbose']&&_0x124da1&&console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1d3)+_0x124da1);const _0x5b2977=await loadJSONFromOptions(_0x3097a6[_0x1f61bc(0x1da)],_0x3097a6[_0x1f61bc(0x1cf)]),_0x2f7701={'name':_0x3de008,'description':_0x3097a6[_0x1f61bc(0x1e4)],'rule':_0x5b2977,'kind':_0x3097a6['kind']!==undefined?parseInt(_0x3097a6[_0x1f61bc(0x1e2)],0xa):undefined,'isVisible':_0x3097a6['invisible']?![]:undefined,'segmentFolderId':_0x124da1,'countPopulation':_0x3097a6['noCountPopulation']?![]:undefined},_0x2e2929=await withSpinner(_0x1f61bc(0x1bd)+_0x3de008+_0x1f61bc(0x1d2),()=>_0x4752c0['segment']['createSegment'](_0x24be4c,_0x2f7701),{'verbose':_0x3097a6[_0x1f61bc(0x1d6)]}),_0xb1c26e=_0x2e2929[_0x1f61bc(0x1ba)];return console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1e0)+_0xb1c26e['name']+'\x27\x20with\x20ID:\x20'+_0xb1c26e['id']),_0x277516!==_0x1198c5&&console[_0x1f61bc(0x1b6)](_0x1f61bc(0x1b7)+_0x277516),await handleSDKOutput([_0xb1c26e],_0x3097a6),0x0;}}
1
+ function a23_0x440d(_0x52efe3,_0xe22ccd){const _0x181e2b=a23_0x181e();return a23_0x440d=function(_0x440db7,_0x4b3aa9){_0x440db7=_0x440db7-0x105;let _0x3365b4=_0x181e2b[_0x440db7];return _0x3365b4;},a23_0x440d(_0x52efe3,_0xe22ccd);}const a23_0x4f0b06=a23_0x440d;(function(_0x477278,_0x344efa){const _0x4bbd44=a23_0x440d,_0x11ebd5=_0x477278();while(!![]){try{const _0x30cd6c=-parseInt(_0x4bbd44(0x105))/0x1+parseInt(_0x4bbd44(0x12c))/0x2*(-parseInt(_0x4bbd44(0x106))/0x3)+-parseInt(_0x4bbd44(0x114))/0x4*(parseInt(_0x4bbd44(0x115))/0x5)+-parseInt(_0x4bbd44(0x10c))/0x6+parseInt(_0x4bbd44(0x111))/0x7+-parseInt(_0x4bbd44(0x126))/0x8*(-parseInt(_0x4bbd44(0x11b))/0x9)+parseInt(_0x4bbd44(0x108))/0xa;if(_0x30cd6c===_0x344efa)break;else _0x11ebd5['push'](_0x11ebd5['shift']());}catch(_0x355cf6){_0x11ebd5['push'](_0x11ebd5['shift']());}}}(a23_0x181e,0xd5ba9));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 a23_0x181e(){const _0x450ef9=['1108HhlTnI','8165FxLBww','segmentPath','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','error','noCountPopulation','\x27\x20with\x20ID:\x20','1275174oIGYkn','data','Examples:','segment','Resolving\x20folder\x20\x27','\x20\x20\x20Path:\x20','execute','createSegment','Site:\x20','Resolved\x20relative\x20path\x20to:\x20','description','72QmQsnu','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','segments','type','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','2NFCrEX','segment:create','verbose','Parent:\x20','includes','1741935vYfAaZ','4423482qkoXzB','Create\x20child\x20segment\x20with\x20filtering\x20rules','39375160OXiaIt','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','name','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','7873032DPdpbL','length','resolveParentId','\x27...','Resolving\x20folder\x20path\x20\x27','4505795wyVjoV','folder','Parent\x20path:\x20'];a23_0x181e=function(){return _0x450ef9;};return a23_0x181e();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x4f0b06(0x10a)]=a23_0x4f0b06(0x12d);[a23_0x4f0b06(0x125)]=a23_0x4f0b06(0x107);async[a23_0x4f0b06(0x121)](_0x5925fa){const _0x48b984=a23_0x4f0b06,{options:_0x2d6009,args:_0x5f4e18,tdx:_0x37a783}=_0x5925fa,_0x358813=_0x2d6009;if(_0x5f4e18[_0x48b984(0x10d)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x48b984(0x118)](_0x48b984(0x10b)),console[_0x48b984(0x118)](_0x48b984(0x11d)),console[_0x48b984(0x118)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x48b984(0x118)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x48b984(0x118)](_0x48b984(0x109)),0x1;const _0x40e8c4=_0x5f4e18[0x0],_0x1b239e=_0x2d6009[_0x48b984(0x116)];let _0x357dba=_0x40e8c4;_0x1b239e&&!_0x40e8c4[_0x48b984(0x130)]('/')&&(_0x357dba=_0x1b239e+'/'+_0x40e8c4,_0x358813['verbose']&&console['error'](_0x48b984(0x124)+_0x357dba));const _0x11a40d=parsePath(_0x357dba);if(_0x11a40d['segments'][_0x48b984(0x10d)]<0x2)return console[_0x48b984(0x118)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x48b984(0x118)](_0x48b984(0x117)),0x1;const _0x221464=_0x11a40d[_0x48b984(0x128)][0x0],_0x498ee1=getBaseName(_0x357dba),_0x52d8bf=getParentPath(_0x357dba);_0x358813[_0x48b984(0x12e)]&&(console[_0x48b984(0x118)](_0x48b984(0x123)+_0x358813['site']),console[_0x48b984(0x118)]('Target\x20path:\x20'+_0x357dba),console[_0x48b984(0x118)](_0x48b984(0x12f)+_0x221464),console[_0x48b984(0x118)]('Segment\x20name:\x20'+_0x498ee1),console[_0x48b984(0x118)](_0x48b984(0x113)+_0x52d8bf));const _0x3c6c42=await withSpinner(_0x48b984(0x12a)+_0x221464+_0x48b984(0x10f),()=>_0x37a783[_0x48b984(0x11e)][_0x48b984(0x10e)](_0x221464),{'verbose':_0x358813['verbose']}),_0x1b9f40=_0x3c6c42[_0x48b984(0x11c)];let _0x445de4;if(_0x11a40d[_0x48b984(0x128)]['length']>0x2){const _0x3278a4=await withSpinner(_0x48b984(0x110)+_0x52d8bf+'\x27...',()=>_0x37a783[_0x48b984(0x11e)]['resolvePathToResource'](_0x52d8bf),{'verbose':_0x358813[_0x48b984(0x12e)]}),_0x5f5654=_0x3278a4[_0x48b984(0x11c)];if(_0x5f5654['type']!==_0x48b984(0x112)&&_0x5f5654[_0x48b984(0x129)]!=='parent')return console[_0x48b984(0x118)](_0x48b984(0x127)),0x1;_0x445de4=_0x5f5654['folderId'];}else{if(_0x358813[_0x48b984(0x112)]){const _0x275f45=await withSpinner(_0x48b984(0x11f)+_0x358813[_0x48b984(0x112)]+_0x48b984(0x10f),()=>_0x37a783[_0x48b984(0x11e)][_0x48b984(0x12b)](_0x1b9f40,_0x358813[_0x48b984(0x112)]),{'verbose':_0x358813['verbose']});_0x445de4=_0x275f45[_0x48b984(0x11c)];}}_0x358813[_0x48b984(0x12e)]&&_0x445de4&&console[_0x48b984(0x118)]('Resolved\x20folder\x20ID:\x20'+_0x445de4);const _0x17e32d=await loadJSONFromOptions(_0x358813['rule'],_0x358813['ruleFile']),_0x4455be={'name':_0x498ee1,'description':_0x358813[_0x48b984(0x125)],'rule':_0x17e32d,'kind':_0x358813['kind']!==undefined?parseInt(_0x358813['kind'],0xa):undefined,'isVisible':_0x358813['invisible']?![]:undefined,'segmentFolderId':_0x445de4,'countPopulation':_0x358813[_0x48b984(0x119)]?![]:undefined},_0x2e59dd=await withSpinner('Creating\x20segment\x20\x27'+_0x498ee1+_0x48b984(0x10f),()=>_0x37a783[_0x48b984(0x11e)][_0x48b984(0x122)](_0x1b9f40,_0x4455be),{'verbose':_0x358813[_0x48b984(0x12e)]}),_0x58c996=_0x2e59dd['data'];return console[_0x48b984(0x118)]('✔\x20Created\x20segment\x20\x27'+_0x58c996[_0x48b984(0x10a)]+_0x48b984(0x11a)+_0x58c996['id']),_0x357dba!==_0x40e8c4&&console[_0x48b984(0x118)](_0x48b984(0x120)+_0x357dba),await handleSDKOutput([_0x58c996],_0x358813),0x0;}}
@@ -1 +1 @@
1
- function a24_0x531f(_0x119687,_0x376631){const _0x236811=a24_0x2368();return a24_0x531f=function(_0x531f8b,_0x2b0b3e){_0x531f8b=_0x531f8b-0x15a;let _0x21b7a3=_0x236811[_0x531f8b];return _0x21b7a3;},a24_0x531f(_0x119687,_0x376631);}const a24_0x6b3d10=a24_0x531f;(function(_0x346e6,_0x252850){const _0x1c33d1=a24_0x531f,_0x1ceed0=_0x346e6();while(!![]){try{const _0x3d88a4=parseInt(_0x1c33d1(0x15b))/0x1+parseInt(_0x1c33d1(0x171))/0x2*(parseInt(_0x1c33d1(0x165))/0x3)+-parseInt(_0x1c33d1(0x160))/0x4+parseInt(_0x1c33d1(0x15a))/0x5*(parseInt(_0x1c33d1(0x15f))/0x6)+parseInt(_0x1c33d1(0x16a))/0x7*(parseInt(_0x1c33d1(0x15d))/0x8)+parseInt(_0x1c33d1(0x164))/0x9*(parseInt(_0x1c33d1(0x16e))/0xa)+parseInt(_0x1c33d1(0x166))/0xb*(-parseInt(_0x1c33d1(0x167))/0xc);if(_0x3d88a4===_0x252850)break;else _0x1ceed0['push'](_0x1ceed0['shift']());}catch(_0x395fca){_0x1ceed0['push'](_0x1ceed0['shift']());}}}(a24_0x2368,0x2ef69));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a24_0x2368(){const _0x134016=['101066JJASyl','name','✔\x20Found\x20','data','error','5bkaHeJ','89590MxQByG','site','2000336CvTheD','segment:fields','1168572YQCGPl','1337408wPwibZ','\x27...','Listing\x20fields\x20for\x20\x27','execute','2554731AuFJDI','9BAJoKM','187xsIFDc','312804izhrPd','Error:\x20Parent\x20segment\x20name\x20is\x20required','listFields','7RDOBwV','\x20field','Parent\x20segment:\x20','Site:\x20','10XCPwuk','verbose','length'];a24_0x2368=function(){return _0x134016;};return a24_0x2368();}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x6b3d10(0x172)]=a24_0x6b3d10(0x15e);['description']='List\x20available\x20fields\x20for\x20segmentation';async[a24_0x6b3d10(0x163)](_0x181835){const _0xefd34c=a24_0x6b3d10,{options:_0x5ae7d9,args:_0x4bbc1a,tdx:_0x4aa85d}=_0x181835;if(_0x4bbc1a['length']===0x0)return console[_0xefd34c(0x175)](_0xefd34c(0x168)),console[_0xefd34c(0x175)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x5d731a=_0x4bbc1a[0x0];_0x5ae7d9[_0xefd34c(0x16f)]&&(console[_0xefd34c(0x175)](_0xefd34c(0x16d)+_0x5ae7d9[_0xefd34c(0x15c)]),console[_0xefd34c(0x175)](_0xefd34c(0x16c)+_0x5d731a));const _0x1e45a3=await withSpinner(_0xefd34c(0x162)+_0x5d731a+_0xefd34c(0x161),()=>_0x4aa85d['segment'][_0xefd34c(0x169)](_0x5d731a),{'verbose':_0x5ae7d9['verbose']}),_0x163e40=_0x1e45a3[_0xefd34c(0x174)];return console['error'](_0xefd34c(0x173)+_0x163e40[_0xefd34c(0x170)]+_0xefd34c(0x16b)+(_0x163e40['length']!==0x1?'s':'')),await handleSDKOutput(_0x163e40,_0x5ae7d9),0x0;}}
1
+ const a24_0x51d6c0=a24_0x5a50;(function(_0x447692,_0x4fb1aa){const _0x1eba63=a24_0x5a50,_0x432114=_0x447692();while(!![]){try{const _0x4abf5c=parseInt(_0x1eba63(0x8f))/0x1*(parseInt(_0x1eba63(0x7f))/0x2)+-parseInt(_0x1eba63(0x7b))/0x3*(parseInt(_0x1eba63(0x90))/0x4)+-parseInt(_0x1eba63(0x83))/0x5+parseInt(_0x1eba63(0x7d))/0x6*(-parseInt(_0x1eba63(0x7e))/0x7)+-parseInt(_0x1eba63(0x8b))/0x8+-parseInt(_0x1eba63(0x7a))/0x9*(-parseInt(_0x1eba63(0x8e))/0xa)+-parseInt(_0x1eba63(0x88))/0xb*(-parseInt(_0x1eba63(0x84))/0xc);if(_0x4abf5c===_0x4fb1aa)break;else _0x432114['push'](_0x432114['shift']());}catch(_0x397377){_0x432114['push'](_0x432114['shift']());}}}(a24_0x1b8d,0x2ac25));function a24_0x5a50(_0x442f2c,_0x4a2e9a){const _0x1b8da6=a24_0x1b8d();return a24_0x5a50=function(_0x5a50a7,_0x128eeb){_0x5a50a7=_0x5a50a7-0x74;let _0x42eaa9=_0x1b8da6[_0x5a50a7];return _0x42eaa9;},a24_0x5a50(_0x442f2c,_0x4a2e9a);}function a24_0x1b8d(){const _0x4dcdb6=['segment:fields','275VIDHqA','\x27...','site','2654568UJoVHK','name','Parent\x20segment:\x20','39170WkZSYP','240721OiuBYG','112928gysVKK','description','segment','error','Site:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','verbose','Listing\x20fields\x20for\x20\x27','333DRGcgQ','12mIulXt','length','14568LUuxus','133YlRjcK','2qfKBVj','\x20field','listFields','execute','467015XMBudd','179412MRKwUl','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Found\x20'];a24_0x1b8d=function(){return _0x4dcdb6;};return a24_0x1b8d();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x51d6c0(0x8c)]=a24_0x51d6c0(0x87);[a24_0x51d6c0(0x91)]='List\x20available\x20fields\x20for\x20segmentation';async[a24_0x51d6c0(0x82)](_0x2221cc){const _0x1519de=a24_0x51d6c0,{options:_0x16c0ee,args:_0x35c433,tdx:_0x571edb}=_0x2221cc;if(_0x35c433[_0x1519de(0x7c)]===0x0)return console[_0x1519de(0x75)](_0x1519de(0x85)),console[_0x1519de(0x75)](_0x1519de(0x77)),0x1;const _0x34052b=_0x35c433[0x0];_0x16c0ee[_0x1519de(0x78)]&&(console['error'](_0x1519de(0x76)+_0x16c0ee[_0x1519de(0x8a)]),console['error'](_0x1519de(0x8d)+_0x34052b));const _0x54ebfc=await withSpinner(_0x1519de(0x79)+_0x34052b+_0x1519de(0x89),()=>_0x571edb[_0x1519de(0x74)][_0x1519de(0x81)](_0x34052b),{'verbose':_0x16c0ee[_0x1519de(0x78)]}),_0x1521a1=_0x54ebfc['data'];return console[_0x1519de(0x75)](_0x1519de(0x86)+_0x1521a1[_0x1519de(0x7c)]+_0x1519de(0x80)+(_0x1521a1[_0x1519de(0x7c)]!==0x1?'s':'')),await handleSDKOutput(_0x1521a1,_0x16c0ee),0x0;}}
@@ -1 +1 @@
1
- const a25_0x5603ff=a25_0xf46d;(function(_0x188f9f,_0x40672d){const _0x230bd2=a25_0xf46d,_0x267edc=_0x188f9f();while(!![]){try{const _0x2e8e6c=parseInt(_0x230bd2(0xa5))/0x1*(-parseInt(_0x230bd2(0xa6))/0x2)+parseInt(_0x230bd2(0x9d))/0x3*(parseInt(_0x230bd2(0x9e))/0x4)+-parseInt(_0x230bd2(0xa7))/0x5+-parseInt(_0x230bd2(0xa8))/0x6*(-parseInt(_0x230bd2(0x96))/0x7)+parseInt(_0x230bd2(0xa0))/0x8+parseInt(_0x230bd2(0x95))/0x9+-parseInt(_0x230bd2(0x91))/0xa*(-parseInt(_0x230bd2(0x90))/0xb);if(_0x2e8e6c===_0x40672d)break;else _0x267edc['push'](_0x267edc['shift']());}catch(_0x4e24fc){_0x267edc['push'](_0x267edc['shift']());}}}(a25_0x1d73,0xd5e84));function a25_0x1d73(){const _0x134f48=['jsonl','1247EVKgMk','604rTJOLH','7993885bpEIMr','6KFvBsg','segmentPath','770iWgyeF','43690DzhOfd','log','json','execute','6121377kMlNGj','7959343AEGaYx','name','format','error','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','segment:pwd','description','3TOQTSB','2121524zDdsDr','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','1584976hHFVFY','verbose','Context\x20details:','\x20\x20Path:\x20'];a25_0x1d73=function(){return _0x134f48;};return a25_0x1d73();}import{BaseCommand}from'./command.js';function a25_0xf46d(_0x153722,_0x93b6f7){const _0x1d732f=a25_0x1d73();return a25_0xf46d=function(_0xf46dad,_0x2350bb){_0xf46dad=_0xf46dad-0x8f;let _0xe12844=_0x1d732f[_0xf46dad];return _0xe12844;},a25_0xf46d(_0x153722,_0x93b6f7);}export class SegmentPwdCommand extends BaseCommand{[a25_0x5603ff(0x97)]=a25_0x5603ff(0x9b);[a25_0x5603ff(0x9c)]='Show\x20current\x20segment/folder\x20context';async[a25_0x5603ff(0x94)](_0x4a2472){const _0x5504f3=a25_0x5603ff,{options:_0x2280f5}=_0x4a2472;try{const _0x14c232=_0x2280f5[_0x5504f3(0x8f)];if(!_0x14c232)return _0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0x93)||_0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0xa4)?console[_0x5504f3(0x92)](JSON['stringify']({'path':'/','type':'root'})):console[_0x5504f3(0x92)]('/'),0x0;if(_0x2280f5['format']===_0x5504f3(0x93)||_0x2280f5[_0x5504f3(0x98)]===_0x5504f3(0xa4)){const _0x5e46d3={'path':_0x14c232};console[_0x5504f3(0x92)](JSON['stringify'](_0x5e46d3));}else console['log'](_0x14c232),_0x2280f5[_0x5504f3(0xa1)]&&(console[_0x5504f3(0x99)](''),console[_0x5504f3(0x99)](_0x5504f3(0xa2)),console[_0x5504f3(0x99)](_0x5504f3(0xa3)+_0x14c232),console[_0x5504f3(0x99)](''),console['error'](_0x5504f3(0x9a)),console[_0x5504f3(0x99)](_0x5504f3(0x9f)));return 0x0;}catch(_0x2e523f){throw _0x2e523f;}}}
1
+ const a25_0x1ca26f=a25_0x2b51;function a25_0x2b51(_0x2df5f7,_0x2efd0b){const _0xb91fe6=a25_0xb91f();return a25_0x2b51=function(_0x2b51c0,_0x560188){_0x2b51c0=_0x2b51c0-0x143;let _0x47e7d2=_0xb91fe6[_0x2b51c0];return _0x47e7d2;},a25_0x2b51(_0x2df5f7,_0x2efd0b);}(function(_0x3e67e3,_0x494a9f){const _0xa477d0=a25_0x2b51,_0x43d4ad=_0x3e67e3();while(!![]){try{const _0x1c60d8=-parseInt(_0xa477d0(0x149))/0x1+-parseInt(_0xa477d0(0x157))/0x2+-parseInt(_0xa477d0(0x154))/0x3*(parseInt(_0xa477d0(0x150))/0x4)+-parseInt(_0xa477d0(0x14a))/0x5*(-parseInt(_0xa477d0(0x14c))/0x6)+parseInt(_0xa477d0(0x147))/0x7*(parseInt(_0xa477d0(0x144))/0x8)+parseInt(_0xa477d0(0x155))/0x9*(-parseInt(_0xa477d0(0x14b))/0xa)+parseInt(_0xa477d0(0x152))/0xb*(parseInt(_0xa477d0(0x153))/0xc);if(_0x1c60d8===_0x494a9f)break;else _0x43d4ad['push'](_0x43d4ad['shift']());}catch(_0x33f305){_0x43d4ad['push'](_0x43d4ad['shift']());}}}(a25_0xb91f,0xcbdaa));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a25_0x1ca26f(0x143)]=a25_0x1ca26f(0x145);[a25_0x1ca26f(0x14d)]=a25_0x1ca26f(0x148);async['execute'](_0x3972b7){const _0x37b189=a25_0x1ca26f,{options:_0x4e7edc}=_0x3972b7;try{const _0x58ca3d=_0x4e7edc['segmentPath'];if(!_0x58ca3d)return _0x4e7edc[_0x37b189(0x159)]===_0x37b189(0x158)||_0x4e7edc[_0x37b189(0x159)]===_0x37b189(0x14e)?console[_0x37b189(0x15c)](JSON['stringify']({'path':'/','type':_0x37b189(0x15b)})):console[_0x37b189(0x15c)]('/'),0x0;if(_0x4e7edc[_0x37b189(0x159)]===_0x37b189(0x158)||_0x4e7edc['format']==='jsonl'){const _0x1eda87={'path':_0x58ca3d};console[_0x37b189(0x15c)](JSON[_0x37b189(0x156)](_0x1eda87));}else console[_0x37b189(0x15c)](_0x58ca3d),_0x4e7edc['verbose']&&(console[_0x37b189(0x15a)](''),console[_0x37b189(0x15a)]('Context\x20details:'),console[_0x37b189(0x15a)](_0x37b189(0x151)+_0x58ca3d),console[_0x37b189(0x15a)](''),console[_0x37b189(0x15a)](_0x37b189(0x14f)),console[_0x37b189(0x15a)](_0x37b189(0x146)));return 0x0;}catch(_0x15066a){throw _0x15066a;}}}function a25_0xb91f(){const _0x5bd924=['segment:pwd','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','42dYhqZO','Show\x20current\x20segment/folder\x20context','732652ICwaLe','2911430HMzBTp','4007770gYmrSg','12WcdmqU','description','jsonl','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','2172WXHWsV','\x20\x20Path:\x20','297bOBjso','1236120kiVogn','7290AYuzIi','9qcCUId','stringify','2669654DvTHpN','json','format','error','root','log','name','902520TSFPDQ'];a25_0xb91f=function(){return _0x5bd924;};return a25_0xb91f();}
@@ -1 +1 @@
1
- const a26_0xfe8283=a26_0x569d;(function(_0x3bb0af,_0x32c251){const _0xf79bc1=a26_0x569d,_0x563268=_0x3bb0af();while(!![]){try{const _0x3365af=-parseInt(_0xf79bc1(0xb3))/0x1+parseInt(_0xf79bc1(0x97))/0x2+-parseInt(_0xf79bc1(0x8f))/0x3*(parseInt(_0xf79bc1(0x8c))/0x4)+-parseInt(_0xf79bc1(0xac))/0x5*(parseInt(_0xf79bc1(0x99))/0x6)+-parseInt(_0xf79bc1(0xb1))/0x7*(parseInt(_0xf79bc1(0xa8))/0x8)+-parseInt(_0xf79bc1(0xae))/0x9*(-parseInt(_0xf79bc1(0x9f))/0xa)+parseInt(_0xf79bc1(0x9e))/0xb;if(_0x3365af===_0x32c251)break;else _0x563268['push'](_0x563268['shift']());}catch(_0x104584){_0x563268['push'](_0x563268['shift']());}}}(a26_0x6899,0xecfb7));function a26_0x6899(){const _0x3ab0d9=['Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','rule','error','segment','41536275QssUby','10CKHucp','Segment\x20ID:\x20','segmentName','Resolved\x20folder\x20ID:\x20','execute','Error:\x20Cannot\x20update\x20','verbose','updateSegmentById','\x27...','8zVzWAL','\x20\x20\x20Path:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Update\x20existing\x20child\x20segment','3144755vDmJxC','segmentPath','8997489XPkHuM','type','name','13188875JhajFv','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','571549DuHBgS','description','Updating\x20segment\x20\x27','ruleFile','✔\x20Updated\x20segment\x20\x27','1603116HqkfbH','data','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','6ixalXY','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','parentId','resolveFolderId','folder','includes','INTERNAL','segmentId','162232TAocoO','Resolved\x20type:\x20','6nSJaHZ'];a26_0x6899=function(){return _0x3ab0d9;};return a26_0x6899();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a26_0x569d(_0x1687f6,_0x55fb42){const _0x68990b=a26_0x6899();return a26_0x569d=function(_0x569d7c,_0x4f3be4){_0x569d7c=_0x569d7c-0x89;let _0x27d898=_0x68990b[_0x569d7c];return _0x27d898;},a26_0x569d(_0x1687f6,_0x55fb42);}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{[a26_0xfe8283(0xb0)]='segment:update';[a26_0xfe8283(0xb4)]=a26_0xfe8283(0xab);async[a26_0xfe8283(0xa3)](_0x203f85){const _0x5e5b92=a26_0xfe8283,{options:_0x52ff98,args:_0x51ed74,tdx:_0x30a5ba}=_0x203f85,_0xf4d2b2=_0x52ff98;if(_0x51ed74['length']===0x0)return console[_0x5e5b92(0x9c)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x5e5b92(0x9c)](_0x5e5b92(0x9a)),console['error']('Examples:'),console['error'](_0x5e5b92(0x8e)),console['error'](_0x5e5b92(0xb2)),0x1;const _0x14a860=_0x51ed74[0x0],_0x3e693c=_0x52ff98[_0x5e5b92(0xad)];let _0x48eed5=_0x14a860;_0x3e693c&&!_0x14a860[_0x5e5b92(0x94)]('/')&&(_0x48eed5=_0x3e693c+'/'+_0x14a860,_0xf4d2b2[_0x5e5b92(0xa5)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x48eed5));const _0x244c08=await withSpinner('Resolving\x20path\x20\x27'+_0x48eed5+'\x27...',()=>_0x30a5ba[_0x5e5b92(0x9d)]['resolvePathToResource'](_0x48eed5),{'verbose':_0xf4d2b2[_0x5e5b92(0xa5)]}),_0x25b09c=_0x244c08[_0x5e5b92(0x8d)];_0xf4d2b2[_0x5e5b92(0xa5)]&&console[_0x5e5b92(0x9c)](_0x5e5b92(0x98)+_0x25b09c[_0x5e5b92(0xaf)]);if(_0x25b09c[_0x5e5b92(0xaf)]!==_0x5e5b92(0x9d))return console[_0x5e5b92(0x9c)](_0x5e5b92(0xa4)+_0x25b09c[_0x5e5b92(0xaf)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x5e5b92(0x9c)](_0x5e5b92(0x90)),0x1;if(!_0x25b09c['segmentId'])throw new SDKError(ErrorCode[_0x5e5b92(0x95)],_0x5e5b92(0xaa));const _0x1cd958=_0x25b09c[_0x5e5b92(0x91)],_0x4a454f=_0x25b09c[_0x5e5b92(0x96)];_0xf4d2b2[_0x5e5b92(0xa5)]&&(console['error']('Parent\x20ID:\x20'+_0x1cd958),console[_0x5e5b92(0x9c)](_0x5e5b92(0xa0)+_0x4a454f));let _0x2b44d1;if(_0xf4d2b2[_0x5e5b92(0x93)]){const _0x5a3bbb=_0xf4d2b2[_0x5e5b92(0x93)],_0x4f163b=await withSpinner('Resolving\x20folder\x20\x27'+_0x5a3bbb+_0x5e5b92(0xa7),()=>_0x30a5ba[_0x5e5b92(0x9d)][_0x5e5b92(0x92)](_0x1cd958,_0x5a3bbb),{'verbose':_0xf4d2b2[_0x5e5b92(0xa5)]});_0x2b44d1=parseInt(_0x4f163b['data'],0xa),_0xf4d2b2[_0x5e5b92(0xa5)]&&console[_0x5e5b92(0x9c)](_0x5e5b92(0xa2)+_0x2b44d1);}const _0x3369ed=await loadJSONFromOptions(_0xf4d2b2[_0x5e5b92(0x9b)],_0xf4d2b2[_0x5e5b92(0x8a)]),_0x12c008={'name':_0xf4d2b2[_0x5e5b92(0xb0)],'description':_0xf4d2b2['description'],'rule':_0x3369ed,'kind':_0xf4d2b2['kind']!==undefined?parseInt(_0xf4d2b2['kind'],0xa):undefined,'segmentFolderId':_0x2b44d1},_0x20b4b6=await withSpinner(_0x5e5b92(0x89)+_0x25b09c[_0x5e5b92(0xa1)]+_0x5e5b92(0xa7),()=>_0x30a5ba['segment'][_0x5e5b92(0xa6)](_0x1cd958,_0x4a454f,_0x12c008),{'verbose':_0xf4d2b2[_0x5e5b92(0xa5)]}),_0x4dfc88=_0x20b4b6[_0x5e5b92(0x8d)];return console['error'](_0x5e5b92(0x8b)+_0x4dfc88['name']+'\x27'),_0x48eed5!==_0x14a860&&console[_0x5e5b92(0x9c)](_0x5e5b92(0xa9)+_0x48eed5),await handleSDKOutput([_0x4dfc88],_0xf4d2b2),0x0;}}
1
+ const a26_0x112971=a26_0x4651;(function(_0x4d2e33,_0x2ce93a){const _0x460cdf=a26_0x4651,_0x240ea5=_0x4d2e33();while(!![]){try{const _0x54eba3=-parseInt(_0x460cdf(0x1b6))/0x1*(-parseInt(_0x460cdf(0x195))/0x2)+parseInt(_0x460cdf(0x19b))/0x3+parseInt(_0x460cdf(0x1a9))/0x4+parseInt(_0x460cdf(0x1aa))/0x5+parseInt(_0x460cdf(0x1a6))/0x6+-parseInt(_0x460cdf(0x1a8))/0x7+-parseInt(_0x460cdf(0x1b3))/0x8;if(_0x54eba3===_0x2ce93a)break;else _0x240ea5['push'](_0x240ea5['shift']());}catch(_0x58e73c){_0x240ea5['push'](_0x240ea5['shift']());}}}(a26_0x55ec,0xa0cdd));function a26_0x4651(_0x239dc6,_0x500465){const _0x55ecab=a26_0x55ec();return a26_0x4651=function(_0x4651d5,_0x3ee7ef){_0x4651d5=_0x4651d5-0x194;let _0x3ae61e=_0x55ecab[_0x4651d5];return _0x3ae61e;},a26_0x4651(_0x239dc6,_0x500465);}function a26_0x55ec(){const _0x133c35=['3816955YwGmeU','description','segmentId','Resolved\x20type:\x20','folder','Resolved\x20folder\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','INTERNAL','Examples:','15362720bXvIbJ','type','name','1KSQjyw','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','parentId','segmentName','error','includes','segment','Updating\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20ID:\x20','317054YPXnuF','segment:update','Error:\x20Cannot\x20update\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','resolveFolderId','2699709xQopvs','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','✔\x20Updated\x20segment\x20\x27','\x27...','length','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','data','kind','execute','updateSegmentById','rule','5338692Eacvbt','Segment\x20ID:\x20','3666558SBWIhy','1564736xSnGRy'];a26_0x55ec=function(){return _0x133c35;};return a26_0x55ec();}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{[a26_0x112971(0x1b5)]=a26_0x112971(0x196);[a26_0x112971(0x1ab)]='Update\x20existing\x20child\x20segment';async[a26_0x112971(0x1a3)](_0x5f4830){const _0x54cc49=a26_0x112971,{options:_0x5d8555,args:_0x2a8578,tdx:_0x49992c}=_0x5f4830,_0x2d39af=_0x5d8555;if(_0x2a8578[_0x54cc49(0x19f)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x54cc49(0x1ba)](_0x54cc49(0x1b7)),console[_0x54cc49(0x1ba)](_0x54cc49(0x1b2)),console['error'](_0x54cc49(0x198)),console[_0x54cc49(0x1ba)](_0x54cc49(0x1a0)),0x1;const _0x117be4=_0x2a8578[0x0],_0x50a79f=_0x5d8555['segmentPath'];let _0x39618d=_0x117be4;_0x50a79f&&!_0x117be4[_0x54cc49(0x1bb)]('/')&&(_0x39618d=_0x50a79f+'/'+_0x117be4,_0x2d39af[_0x54cc49(0x199)]&&console[_0x54cc49(0x1ba)]('Resolved\x20relative\x20path\x20to:\x20'+_0x39618d));const _0x170b8f=await withSpinner('Resolving\x20path\x20\x27'+_0x39618d+'\x27...',()=>_0x49992c['segment']['resolvePathToResource'](_0x39618d),{'verbose':_0x2d39af[_0x54cc49(0x199)]}),_0x44ff94=_0x170b8f[_0x54cc49(0x1a1)];_0x2d39af[_0x54cc49(0x199)]&&console[_0x54cc49(0x1ba)](_0x54cc49(0x1ad)+_0x44ff94['type']);if(_0x44ff94[_0x54cc49(0x1b4)]!=='segment')return console[_0x54cc49(0x1ba)](_0x54cc49(0x197)+_0x44ff94['type']+_0x54cc49(0x19c)),console[_0x54cc49(0x1ba)](_0x54cc49(0x1b0)),0x1;if(!_0x44ff94[_0x54cc49(0x1ac)])throw new SDKError(ErrorCode[_0x54cc49(0x1b1)],_0x54cc49(0x1be));const _0x155684=_0x44ff94[_0x54cc49(0x1b8)],_0x47575b=_0x44ff94['segmentId'];_0x2d39af['verbose']&&(console['error'](_0x54cc49(0x194)+_0x155684),console[_0x54cc49(0x1ba)](_0x54cc49(0x1a7)+_0x47575b));let _0x254bfa;if(_0x2d39af[_0x54cc49(0x1ae)]){const _0x2544d8=_0x2d39af[_0x54cc49(0x1ae)],_0x55d64f=await withSpinner('Resolving\x20folder\x20\x27'+_0x2544d8+_0x54cc49(0x19e),()=>_0x49992c[_0x54cc49(0x1bc)][_0x54cc49(0x19a)](_0x155684,_0x2544d8),{'verbose':_0x2d39af[_0x54cc49(0x199)]});_0x254bfa=parseInt(_0x55d64f[_0x54cc49(0x1a1)],0xa),_0x2d39af[_0x54cc49(0x199)]&&console[_0x54cc49(0x1ba)](_0x54cc49(0x1af)+_0x254bfa);}const _0x12acf6=await loadJSONFromOptions(_0x2d39af[_0x54cc49(0x1a5)],_0x2d39af['ruleFile']),_0x2a931c={'name':_0x2d39af[_0x54cc49(0x1b5)],'description':_0x2d39af[_0x54cc49(0x1ab)],'rule':_0x12acf6,'kind':_0x2d39af[_0x54cc49(0x1a2)]!==undefined?parseInt(_0x2d39af[_0x54cc49(0x1a2)],0xa):undefined,'segmentFolderId':_0x254bfa},_0xd9f82b=await withSpinner(_0x54cc49(0x1bd)+_0x44ff94[_0x54cc49(0x1b9)]+_0x54cc49(0x19e),()=>_0x49992c['segment'][_0x54cc49(0x1a4)](_0x155684,_0x47575b,_0x2a931c),{'verbose':_0x2d39af[_0x54cc49(0x199)]}),_0x40fc95=_0xd9f82b['data'];return console[_0x54cc49(0x1ba)](_0x54cc49(0x19d)+_0x40fc95[_0x54cc49(0x1b5)]+'\x27'),_0x39618d!==_0x117be4&&console[_0x54cc49(0x1ba)]('\x20\x20\x20Path:\x20'+_0x39618d),await handleSDKOutput([_0x40fc95],_0x2d39af),0x0;}}
@@ -1 +1 @@
1
- const a27_0x1fc2cb=a27_0x91e7;(function(_0x56b17e,_0x90cd1f){const _0x2a1635=a27_0x91e7,_0xa908ec=_0x56b17e();while(!![]){try{const _0x4793cf=parseInt(_0x2a1635(0x1a6))/0x1*(parseInt(_0x2a1635(0x1c4))/0x2)+-parseInt(_0x2a1635(0x1c2))/0x3*(parseInt(_0x2a1635(0x1bc))/0x4)+parseInt(_0x2a1635(0x1b0))/0x5+parseInt(_0x2a1635(0x1bb))/0x6+parseInt(_0x2a1635(0x1ca))/0x7+-parseInt(_0x2a1635(0x1b4))/0x8+-parseInt(_0x2a1635(0x1cc))/0x9;if(_0x4793cf===_0x90cd1f)break;else _0xa908ec['push'](_0xa908ec['shift']());}catch(_0x24f17d){_0xa908ec['push'](_0xa908ec['shift']());}}}(a27_0x44e6,0x86902));function a27_0x91e7(_0xfcdcae,_0x41683c){const _0x44e6fd=a27_0x44e6();return a27_0x91e7=function(_0x91e75e,_0x37c8be){_0x91e75e=_0x91e75e-0x1a3;let _0x4c76be=_0x44e6fd[_0x91e75e];return _0x4c76be;},a27_0x91e7(_0xfcdcae,_0x41683c);}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a27_0x44e6(){const _0x85335a=['Error:\x20Path\x20is\x20required','description','7217441FsljYl','Resolved\x20path\x20type:\x20','1397061ewvvbf','verbose','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','slice','session','Context\x20set\x20to:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','fullPath','Parent\x20ID:\x20','site','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segment:use','23587TQmcHC','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','Resolving\x20path\x20\x27','\x27...','\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\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Usage:\x20tdx\x20segment\x20use\x20<path>','name','Context\x20cleared.\x20Back\x20to\x20root.','folderId','552430nXAfmG','segment','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Examples:','6747832wCpsxU','Target\x20path:\x20','Folder\x20ID:\x20','split','segmentPath','error','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','643020uNvBin','348rtTMeu','execute','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','join','log','type','22149uOaLTr','Resolved\x20relative\x20path\x20to:\x20','80sMhEDw','resolvePathToResource','segments','parentId'];a27_0x44e6=function(){return _0x85335a;};return a27_0x44e6();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a27_0x1fc2cb(0x1ad)]=a27_0x1fc2cb(0x1a5);[a27_0x1fc2cb(0x1c9)]=a27_0x1fc2cb(0x1ba);async[a27_0x1fc2cb(0x1bd)](_0x6be72){const _0x185b95=a27_0x1fc2cb,{options:_0x1c3586,args:_0x2df347,tdx:_0x4a746e}=_0x6be72;if(_0x2df347['length']===0x0)return console[_0x185b95(0x1b9)](_0x185b95(0x1c8)),console[_0x185b95(0x1b9)](_0x185b95(0x1ac)),console[_0x185b95(0x1b9)](_0x185b95(0x1b3)),console['error'](_0x185b95(0x1ce)),console[_0x185b95(0x1b9)](_0x185b95(0x1b2)),console[_0x185b95(0x1b9)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x185b95(0x1aa)),0x1;const _0x21aec3=_0x2df347[0x0],_0xa393b2=_0x1c3586[_0x185b95(0x1d0)];try{if(_0x21aec3==='/')return saveSessionContext({'segment_path':undefined},_0xa393b2),console['log'](_0x185b95(0x1ae)),0x0;const _0x1f8b1b=_0x1c3586[_0x185b95(0x1b8)];let _0x39ac2a=_0x21aec3;const _0x54515b=parsePath(_0x21aec3);if(!_0x54515b['isAbsolute']){if(!_0x1f8b1b)return console[_0x185b95(0x1b9)](_0x185b95(0x1be)),console[_0x185b95(0x1b9)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'),0x1;if(_0x21aec3==='..'){const _0x3a4fc2=_0x1f8b1b[_0x185b95(0x1b7)]('/')[_0x185b95(0x1cf)](0x0,-0x1)['join']('/');_0x39ac2a=_0x3a4fc2||'/';}else _0x21aec3==='.'?_0x39ac2a=_0x1f8b1b:_0x39ac2a=_0x1f8b1b+'/'+_0x21aec3;_0x1c3586['verbose']&&console[_0x185b95(0x1b9)](_0x185b95(0x1c3)+_0x39ac2a);}if(_0x39ac2a==='/'||_0x39ac2a==='')return saveSessionContext({'segment_path':undefined},_0xa393b2),console[_0x185b95(0x1c0)](_0x185b95(0x1ae)),0x0;_0x39ac2a=normalizePath(_0x39ac2a);const _0x426b4f=parsePath(_0x39ac2a)[_0x185b95(0x1c6)];if(_0x426b4f['length']===0x0)return saveSessionContext({'segment_path':undefined},_0xa393b2),console[_0x185b95(0x1c0)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x1c3586[_0x185b95(0x1cd)]&&(console['error']('Site:\x20'+_0x1c3586[_0x185b95(0x1a3)]),console[_0x185b95(0x1b9)](_0x185b95(0x1b5)+_0x39ac2a));const _0x212ff4=await withSpinner(_0x185b95(0x1a8)+_0x39ac2a+_0x185b95(0x1a9),()=>_0x4a746e[_0x185b95(0x1b1)][_0x185b95(0x1c5)](_0x39ac2a),{'verbose':_0x1c3586['verbose']}),_0xcb10ba=_0x212ff4['data'];_0x1c3586[_0x185b95(0x1cd)]&&(console[_0x185b95(0x1b9)](_0x185b95(0x1cb)+_0xcb10ba[_0x185b95(0x1c1)]),console['error'](_0x185b95(0x1d4)+_0xcb10ba[_0x185b95(0x1c7)]),_0xcb10ba[_0x185b95(0x1af)]&&console[_0x185b95(0x1b9)](_0x185b95(0x1b6)+_0xcb10ba[_0x185b95(0x1af)]));if(_0xcb10ba[_0x185b95(0x1c1)]===_0x185b95(0x1b1))return console[_0x185b95(0x1b9)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0x185b95(0x1b9)](_0x185b95(0x1a4)),console[_0x185b95(0x1b9)]('Use:\x20tdx\x20segment\x20use\x20'+_0xcb10ba['parentName']+(_0xcb10ba['folderPath']?'/'+_0xcb10ba['folderPath'][_0x185b95(0x1bf)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0xcb10ba[_0x185b95(0x1d3)],'parent_segment':_0xcb10ba['parentName']},_0xa393b2),console[_0x185b95(0x1c0)](_0x185b95(0x1d1)+_0xcb10ba[_0x185b95(0x1d3)]),_0x1c3586[_0x185b95(0x1cd)]&&(console[_0x185b95(0x1b9)](_0x185b95(0x1d2)),console[_0x185b95(0x1b9)](_0x185b95(0x1a7)),console['error'](_0x185b95(0x1ab))),0x0;}catch(_0x5b9381){throw _0x5b9381;}}}
1
+ const a27_0x454508=a27_0x1d8e;function a27_0x1d8e(_0x5beda2,_0x3e990a){const _0x2de941=a27_0x2de9();return a27_0x1d8e=function(_0x1d8e23,_0x45bb73){_0x1d8e23=_0x1d8e23-0x18c;let _0x57e2d0=_0x2de941[_0x1d8e23];return _0x57e2d0;},a27_0x1d8e(_0x5beda2,_0x3e990a);}(function(_0x3b829d,_0x1fb2c8){const _0x16c102=a27_0x1d8e,_0x140649=_0x3b829d();while(!![]){try{const _0x408dfa=-parseInt(_0x16c102(0x19d))/0x1+parseInt(_0x16c102(0x18e))/0x2*(-parseInt(_0x16c102(0x1bb))/0x3)+parseInt(_0x16c102(0x197))/0x4*(parseInt(_0x16c102(0x1a0))/0x5)+parseInt(_0x16c102(0x1ac))/0x6+parseInt(_0x16c102(0x196))/0x7*(parseInt(_0x16c102(0x1b2))/0x8)+-parseInt(_0x16c102(0x18c))/0x9*(parseInt(_0x16c102(0x19b))/0xa)+-parseInt(_0x16c102(0x1a7))/0xb;if(_0x408dfa===_0x1fb2c8)break;else _0x140649['push'](_0x140649['shift']());}catch(_0x301cde){_0x140649['push'](_0x140649['shift']());}}}(a27_0x2de9,0xe7641));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a27_0x2de9(){const _0x4bf547=['110620nMYvcQ','Target\x20path:\x20','89947ticvdO','join','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','45qTmssZ','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','error','folderId','7402120YtLLTg','execute','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Resolved\x20path\x20type:\x20','isAbsolute','877788SQvSqa','Resolved\x20relative\x20path\x20to:\x20','Folder\x20ID:\x20','Site:\x20','description','segments','8VDSkYb','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','segment','site','session','folderPath','verbose','Error:\x20Path\x20is\x20required','resolvePathToResource','1835520SzevmU','9tfZOQO','length','4IDQHwB','Context\x20set\x20to:\x20','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','Resolving\x20path\x20\x27','slice','parentName','Context\x20cleared.\x20Back\x20to\x20root.','log','12849151YwDiVm','428220WCPqSK','fullPath','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Parent\x20ID:\x20'];a27_0x2de9=function(){return _0x4bf547;};return a27_0x2de9();}export class SegmentUseCommand extends BaseCommand{['name']=a27_0x454508(0x1a1);[a27_0x454508(0x1b0)]=a27_0x454508(0x19f);async[a27_0x454508(0x1a8)](_0x53646b){const _0xac5526=a27_0x454508,{options:_0x2b9cde,args:_0x562c8c,tdx:_0x5228af}=_0x53646b;if(_0x562c8c[_0xac5526(0x18d)]===0x0)return console[_0xac5526(0x1a5)](_0xac5526(0x1b9)),console['error'](_0xac5526(0x1a3)),console['error']('Examples:'),console[_0xac5526(0x1a5)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0xac5526(0x1a5)](_0xac5526(0x1a9)),console[_0xac5526(0x1a5)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0xac5526(0x1a5)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x2123d9=_0x562c8c[0x0],_0x330253=_0x2b9cde[_0xac5526(0x1b6)];try{if(_0x2123d9==='/')return saveSessionContext({'segment_path':undefined},_0x330253),console[_0xac5526(0x195)](_0xac5526(0x194)),0x0;const _0x22108c=_0x2b9cde['segmentPath'];let _0x3b2f01=_0x2123d9;const _0x4e3754=parsePath(_0x2123d9);if(!_0x4e3754[_0xac5526(0x1ab)]){if(!_0x22108c)return console['error']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console[_0xac5526(0x1a5)](_0xac5526(0x1b3)),0x1;if(_0x2123d9==='..'){const _0x348b1b=_0x22108c['split']('/')[_0xac5526(0x192)](0x0,-0x1)[_0xac5526(0x19e)]('/');_0x3b2f01=_0x348b1b||'/';}else _0x2123d9==='.'?_0x3b2f01=_0x22108c:_0x3b2f01=_0x22108c+'/'+_0x2123d9;_0x2b9cde[_0xac5526(0x1b8)]&&console[_0xac5526(0x1a5)](_0xac5526(0x1ad)+_0x3b2f01);}if(_0x3b2f01==='/'||_0x3b2f01==='')return saveSessionContext({'segment_path':undefined},_0x330253),console[_0xac5526(0x195)](_0xac5526(0x194)),0x0;_0x3b2f01=normalizePath(_0x3b2f01);const _0x14ea84=parsePath(_0x3b2f01)[_0xac5526(0x1b1)];if(_0x14ea84['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x330253),console[_0xac5526(0x195)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x2b9cde[_0xac5526(0x1b8)]&&(console[_0xac5526(0x1a5)](_0xac5526(0x1af)+_0x2b9cde[_0xac5526(0x1b5)]),console[_0xac5526(0x1a5)](_0xac5526(0x19c)+_0x3b2f01));const _0x230264=await withSpinner(_0xac5526(0x191)+_0x3b2f01+'\x27...',()=>_0x5228af[_0xac5526(0x1b4)][_0xac5526(0x1ba)](_0x3b2f01),{'verbose':_0x2b9cde['verbose']}),_0x4ae84a=_0x230264['data'];_0x2b9cde[_0xac5526(0x1b8)]&&(console[_0xac5526(0x1a5)](_0xac5526(0x1aa)+_0x4ae84a['type']),console['error'](_0xac5526(0x19a)+_0x4ae84a['parentId']),_0x4ae84a[_0xac5526(0x1a6)]&&console[_0xac5526(0x1a5)](_0xac5526(0x1ae)+_0x4ae84a[_0xac5526(0x1a6)]));if(_0x4ae84a['type']===_0xac5526(0x1b4))return console[_0xac5526(0x1a5)](_0xac5526(0x1a4)),console['error'](_0xac5526(0x199)),console[_0xac5526(0x1a5)]('Use:\x20tdx\x20segment\x20use\x20'+_0x4ae84a[_0xac5526(0x193)]+(_0x4ae84a[_0xac5526(0x1b7)]?'/'+_0x4ae84a[_0xac5526(0x1b7)][_0xac5526(0x19e)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x4ae84a[_0xac5526(0x198)],'parent_segment':_0x4ae84a[_0xac5526(0x193)]},_0x330253),console[_0xac5526(0x195)](_0xac5526(0x18f)+_0x4ae84a[_0xac5526(0x198)]),_0x2b9cde[_0xac5526(0x1b8)]&&(console['error'](_0xac5526(0x1a2)),console[_0xac5526(0x1a5)](_0xac5526(0x190)),console[_0xac5526(0x1a5)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters')),0x0;}catch(_0x2b07a1){throw _0x2b07a1;}}}
@@ -1 +1 @@
1
- const a28_0x163ce3=a28_0x39c9;(function(_0x1b73a2,_0x4a1023){const _0x3d9558=a28_0x39c9,_0x222009=_0x1b73a2();while(!![]){try{const _0x148b89=parseInt(_0x3d9558(0x8a))/0x1*(parseInt(_0x3d9558(0xa1))/0x2)+parseInt(_0x3d9558(0xb4))/0x3+parseInt(_0x3d9558(0x8b))/0x4+parseInt(_0x3d9558(0xaa))/0x5*(parseInt(_0x3d9558(0x81))/0x6)+-parseInt(_0x3d9558(0x86))/0x7*(parseInt(_0x3d9558(0xb2))/0x8)+-parseInt(_0x3d9558(0xac))/0x9+-parseInt(_0x3d9558(0x8f))/0xa;if(_0x148b89===_0x4a1023)break;else _0x222009['push'](_0x222009['shift']());}catch(_0x38bd0c){_0x222009['push'](_0x222009['shift']());}}}(a28_0xd4b6,0xbcbc6));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 a28_0x39c9(_0xd7309,_0x261a70){const _0xd4b6b2=a28_0xd4b6();return a28_0x39c9=function(_0x39c941,_0x4a34ca){_0x39c941=_0x39c941-0x7a;let _0x4295d3=_0xd4b6b2[_0x39c941];return _0x4295d3;},a28_0x39c9(_0xd7309,_0x261a70);}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x5d7bae from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a28_0x163ce3(0x98);['description']=a28_0x163ce3(0x84);async[a28_0x163ce3(0x9b)](_0x216681){const _0x472b05=a28_0x163ce3,{options:_0x33b123,args:_0x31276a}=_0x216681,_0x226d9f=_0x33b123[_0x472b05(0x97)],_0x5c6302=_0x31276a[0x0];try{const _0x2e8ec9=_0x33b123['segmentPath'];_0x33b123['verbose']&&(console[_0x472b05(0xae)]('Site:\x20'+_0x33b123[_0x472b05(0x82)]),console[_0x472b05(0xae)]('Current\x20context:\x20'+(_0x2e8ec9||'/')),_0x5c6302&&console[_0x472b05(0xae)](_0x472b05(0xb3)+_0x5c6302),_0x226d9f&&console[_0x472b05(0xae)](_0x472b05(0x89)));if(_0x5c6302){const _0xed1af9=_0x5c6302[_0x472b05(0xad)]('*')||_0x5c6302['includes']('?');if(_0xed1af9&&!_0x2e8ec9)return await this[_0x472b05(0xa0)](_0x216681,_0x5c6302);else return _0xed1af9?(console['error'](_0x472b05(0x88)),console[_0x472b05(0xae)](_0x472b05(0xa8)),0x1):_0x226d9f?await this['listRecursive'](_0x216681,_0x5c6302):await this[_0x472b05(0xa3)](_0x216681,_0x5c6302);}if(!_0x2e8ec9)return await this[_0x472b05(0xb9)](_0x216681);return _0x226d9f?await this[_0x472b05(0x8e)](_0x216681,_0x2e8ec9):await this['listUnified'](_0x216681,_0x2e8ec9);}catch(_0x577f35){if(_0x577f35 instanceof SDKError)return console[_0x472b05(0xae)](_0x472b05(0x7f)+_0x577f35[_0x472b05(0x99)]),_0x577f35[_0x472b05(0xa9)]&&console[_0x472b05(0xae)](_0x472b05(0xb6)+_0x577f35[_0x472b05(0xa9)]),0x1;throw _0x577f35;}}async[a28_0x163ce3(0xa0)](_0x563eb4,_0x4727fd){const _0x5dbfa4=a28_0x163ce3,{options:_0x9ede49,tdx:_0x3ccd0e}=_0x563eb4,_0x26849b=await withSpinner(_0x5dbfa4(0xa6)+_0x4727fd+_0x5dbfa4(0x7b),()=>_0x3ccd0e['segment']['listParents'](),{'verbose':_0x9ede49[_0x5dbfa4(0x83)]}),_0x3b8256=_0x26849b[_0x5dbfa4(0x9e)],_0x279990=_0x4727fd[_0x5dbfa4(0x95)](/[.+^${}()|[\]\\]/g,_0x5dbfa4(0x9c))[_0x5dbfa4(0x95)](/\*/g,'.*')['replace'](/\?/g,'.'),_0xc82427=new RegExp('^'+_0x279990+'$','i'),_0xdf5565=_0x3b8256['filter'](_0x5675b5=>_0xc82427[_0x5dbfa4(0x8c)](_0x5675b5[_0x5dbfa4(0x7a)][_0x5dbfa4(0x7d)]));console['error'](_0x5dbfa4(0xa7)+_0xdf5565['length']+_0x5dbfa4(0x96)+(_0xdf5565[_0x5dbfa4(0x90)]!==0x1?'s':'')+_0x5dbfa4(0x9d)+_0x4727fd+'\x27');if(_0x9ede49[_0x5dbfa4(0x7c)]==='json'||_0x9ede49[_0x5dbfa4(0x7c)]===_0x5dbfa4(0xb8))await handleSDKOutput(_0xdf5565,_0x9ede49);else{if(_0xdf5565[_0x5dbfa4(0x90)]===0x0)console[_0x5dbfa4(0x9a)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x4727fd);else{console['log']('[parent\x20segments]');for(const _0x1394f2 of _0xdf5565){const _0x2f25f6=_0x1394f2[_0x5dbfa4(0x7a)]['population']?a28_0x5d7bae['dim']('\x20('+formatRows(_0x1394f2[_0x5dbfa4(0x7a)][_0x5dbfa4(0xa5)])+')'):'';console[_0x5dbfa4(0x9a)]('👥\x20'+_0x1394f2[_0x5dbfa4(0x7a)][_0x5dbfa4(0x7d)]+_0x2f25f6);}}}return 0x0;}async['listParents'](_0x30dbb7){const _0x5b9a89=a28_0x163ce3,{options:_0x405943,tdx:_0x5a519e}=_0x30dbb7,_0x15a755=await withSpinner(_0x5b9a89(0x91),()=>_0x5a519e[_0x5b9a89(0xa2)][_0x5b9a89(0xb9)](),{'verbose':_0x405943[_0x5b9a89(0x83)]}),_0x170e48=_0x15a755[_0x5b9a89(0x9e)];console[_0x5b9a89(0xae)](_0x5b9a89(0xa7)+_0x170e48['length']+_0x5b9a89(0x96)+(_0x170e48[_0x5b9a89(0x90)]!==0x1?'s':''));if(_0x405943[_0x5b9a89(0x7c)]===_0x5b9a89(0x94)||_0x405943[_0x5b9a89(0x7c)]===_0x5b9a89(0xb8))await handleSDKOutput(_0x170e48,_0x405943);else{console[_0x5b9a89(0x9a)]('[parent\x20segments]');for(const _0x27f316 of _0x170e48){const _0x4fd010=_0x27f316[_0x5b9a89(0x7a)]['population']?a28_0x5d7bae[_0x5b9a89(0xa4)]('\x20('+formatRows(_0x27f316[_0x5b9a89(0x7a)]['population'])+')'):'';console[_0x5b9a89(0x9a)]('👥\x20'+_0x27f316[_0x5b9a89(0x7a)]['name']+_0x4fd010);}}return 0x0;}async[a28_0x163ce3(0xa3)](_0x27d7a3,_0x478f38){const _0x82569d=a28_0x163ce3,{options:_0x2f063f,tdx:_0x1c886c}=_0x27d7a3,_0x151722=await withSpinner(_0x82569d(0x9f)+_0x478f38+_0x82569d(0x7b),()=>_0x1c886c['segment']['resolvePathToResource'](_0x478f38),{'verbose':_0x2f063f[_0x82569d(0x83)]}),_0x2ed10e=_0x151722[_0x82569d(0x9e)];_0x2f063f[_0x82569d(0x83)]&&(console[_0x82569d(0xae)]('Parent\x20ID:\x20'+_0x2ed10e['parentId']),_0x2ed10e[_0x82569d(0x85)]&&console[_0x82569d(0xae)](_0x82569d(0xb7)+_0x2ed10e[_0x82569d(0x85)]));const _0x313eaa=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x1c886c[_0x82569d(0xa2)][_0x82569d(0xa3)](_0x2ed10e[_0x82569d(0x8d)],_0x2ed10e[_0x82569d(0x85)]),{'verbose':_0x2f063f['verbose']}),{folders:_0x2ca18e,segments:_0x2b880b}=_0x313eaa[_0x82569d(0x9e)],_0x3a2685=_0x2ca18e[_0x82569d(0x90)]+_0x2b880b[_0x82569d(0x90)];console[_0x82569d(0xae)](_0x82569d(0xa7)+_0x2ca18e[_0x82569d(0x90)]+_0x82569d(0x87)+(_0x2ca18e['length']!==0x1?'s':'')+_0x82569d(0xb5)+_0x2b880b[_0x82569d(0x90)]+'\x20segment'+(_0x2b880b[_0x82569d(0x90)]!==0x1?'s':''));if(_0x2f063f[_0x82569d(0x7c)]==='json'||_0x2f063f[_0x82569d(0x7c)]===_0x82569d(0xb8)){const _0x549407=[..._0x2ca18e[_0x82569d(0x80)](_0xfe3817=>({..._0xfe3817,'type':'folder'})),..._0x2b880b['map'](_0x54582d=>({..._0x54582d,'type':_0x82569d(0xa2)}))][_0x82569d(0xab)]((_0xbe0e44,_0x3ec793)=>_0xbe0e44[_0x82569d(0x7d)][_0x82569d(0xb1)](_0x3ec793[_0x82569d(0x7d)]));await handleSDKOutput(_0x549407,_0x2f063f);}else{if(_0x3a2685===0x0)console[_0x82569d(0x9a)](a28_0x5d7bae[_0x82569d(0xa4)]('[/'+_0x478f38+']')),console[_0x82569d(0x9a)](_0x82569d(0x93));else{console[_0x82569d(0x9a)](a28_0x5d7bae[_0x82569d(0xa4)]('[/'+_0x478f38+']'));const _0x4672e2=formatFlatList(_0x2ca18e,_0x2b880b,{'showMetadata':!![]});console['log'](_0x4672e2);}}return 0x0;}async[a28_0x163ce3(0x8e)](_0x1bc5e9,_0x5e27d9){const _0x35b218=a28_0x163ce3,{options:_0x2a2532,tdx:_0x12b982}=_0x1bc5e9,_0x4102cb=await withSpinner(_0x35b218(0x9f)+_0x5e27d9+'\x27...',()=>_0x12b982[_0x35b218(0xa2)][_0x35b218(0xaf)](_0x5e27d9),{'verbose':_0x2a2532[_0x35b218(0x83)]}),_0x5ace67=_0x4102cb['data'];_0x2a2532[_0x35b218(0x83)]&&(console['error'](_0x35b218(0x7e)+_0x5ace67[_0x35b218(0x8d)]),_0x5ace67[_0x35b218(0x85)]&&console[_0x35b218(0xae)](_0x35b218(0xb7)+_0x5ace67['folderId']));const _0x21430e=_0x2a2532['maxDepth']||0xa,_0x109190=await withSpinner(_0x35b218(0xb0),()=>_0x12b982[_0x35b218(0xa2)][_0x35b218(0x8e)](_0x5ace67[_0x35b218(0x8d)],_0x5ace67[_0x35b218(0x85)],0x0,_0x21430e),{'verbose':_0x2a2532[_0x35b218(0x83)]}),_0x4deed2=_0x109190[_0x35b218(0x9e)];console[_0x35b218(0xae)]('✔\x20Built\x20tree\x20with\x20'+_0x4deed2[_0x35b218(0x90)]+_0x35b218(0x92));if(_0x2a2532[_0x35b218(0x7c)]===_0x35b218(0x94)||_0x2a2532[_0x35b218(0x7c)]==='jsonl')await handleSDKOutput(_0x4deed2,_0x2a2532);else{console[_0x35b218(0x9a)](a28_0x5d7bae['dim']('[/'+_0x5e27d9+']'));const _0x15e747=formatTree(_0x4deed2,{'showMetadata':!![]});console[_0x35b218(0x9a)](_0x15e747);}return 0x0;}}function a28_0xd4b6(){const _0x9c8792=['localeCompare','12227288ovQBWE','Path/pattern\x20arg:\x20','793572JcPEcb','\x20and\x20','\x20\x20Cause:\x20','Folder\x20ID:\x20','jsonl','listParents','attributes','\x27...','format','name','Parent\x20ID:\x20','Error:\x20','map','4056kXSwUL','site','verbose','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','folderId','7wEbvSx','\x20folder','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','Recursive\x20mode:\x20enabled','1eegsoE','4364376KkqKQz','test','parentId','listRecursive','11517520IGkNsT','length','Listing\x20parent\x20segments...','\x20top-level\x20items','(empty)','json','replace','\x20parent\x20segment','recursive','segments','message','log','execute','\x5c$&','\x20matching\x20\x27','data','Resolving\x20context\x20path\x20\x27','listParentsWithPattern','2134766Dznbxm','segment','listUnified','dim','population','Listing\x20parent\x20segments\x20matching\x20\x27','✔\x20Found\x20','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','cause','9385KmRrIV','sort','2147652pNIsDK','includes','error','resolvePathToResource','Building\x20hierarchy\x20tree...'];a28_0xd4b6=function(){return _0x9c8792;};return a28_0xd4b6();}
1
+ function a28_0x1407(){const _0x2b5828=['maxDepth','attributes','\x20\x20Cause:\x20','👥\x20','data','json','16182738kfvnek','log','\x5c$&','listUnified','sort','folder','name','segment','verbose','\x20and\x20','(empty)','site','31012WAWhWc','execute','✔\x20Found\x20','listParentsWithPattern','Path/pattern\x20arg:\x20','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','listRecursive','Recursive\x20mode:\x20enabled','132edMtDs','10mMhKAN','1549842hoKamG','1400xTqbJR','folderId','map','format','listParents','37984zeUdvi','Listing\x20folders\x20and\x20segments...','includes','resolvePathToResource','\x20folder','replace','Parent\x20ID:\x20','473NMdDjr','error','83spiiuY','dim','jsonl','Error:\x20','Listing\x20parent\x20segments...','159370pPKNPm','parentId','localeCompare','✔\x20Built\x20tree\x20with\x20','\x27...','population','2399501AcdMeq','filter','Folder\x20ID:\x20','12twFaUm','\x20parent\x20segment','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20top-level\x20items','message','[parent\x20segments]','Resolving\x20context\x20path\x20\x27','length','1327779iuQcFn','segmentPath'];a28_0x1407=function(){return _0x2b5828;};return a28_0x1407();}const a28_0x45f81f=a28_0x3fab;(function(_0xca0927,_0x39d6d8){const _0x2e0471=a28_0x3fab,_0x45a6d1=_0xca0927();while(!![]){try{const _0x3d88c3=-parseInt(_0x2e0471(0x1fe))/0x1*(-parseInt(_0x2e0471(0x1e5))/0x2)+parseInt(_0x2e0471(0x214))/0x3*(-parseInt(_0x2e0471(0x20c))/0x4)+parseInt(_0x2e0471(0x1ee))/0x5*(parseInt(_0x2e0471(0x1ef))/0x6)+parseInt(_0x2e0471(0x1f0))/0x7*(parseInt(_0x2e0471(0x1f5))/0x8)+-parseInt(_0x2e0471(0x1d9))/0x9+parseInt(_0x2e0471(0x203))/0xa*(-parseInt(_0x2e0471(0x1fc))/0xb)+parseInt(_0x2e0471(0x1ed))/0xc*(parseInt(_0x2e0471(0x209))/0xd);if(_0x3d88c3===_0x39d6d8)break;else _0x45a6d1['push'](_0x45a6d1['shift']());}catch(_0x28a678){_0x45a6d1['push'](_0x45a6d1['shift']());}}}(a28_0x1407,0xed677));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a28_0x3fab(_0x69ec96,_0x4d71d8){const _0x14074e=a28_0x1407();return a28_0x3fab=function(_0x3fab4c,_0x2c8ddf){_0x3fab4c=_0x3fab4c-0x1d5;let _0x42d093=_0x14074e[_0x3fab4c];return _0x42d093;},a28_0x3fab(_0x69ec96,_0x4d71d8);}import{formatRows}from'../utils/formatters.js';import a28_0x91264d from'chalk';export class SegmentsCommand extends BaseCommand{['name']='segments';['description']='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a28_0x45f81f(0x1e6)](_0x38adb2){const _0x1cb9aa=a28_0x45f81f,{options:_0x3dcc54,args:_0x92da0d}=_0x38adb2,_0x216a89=_0x3dcc54['recursive'],_0x2039c7=_0x92da0d[0x0];try{const _0x1c503f=_0x3dcc54[_0x1cb9aa(0x215)];_0x3dcc54[_0x1cb9aa(0x1e1)]&&(console[_0x1cb9aa(0x1fd)]('Site:\x20'+_0x3dcc54[_0x1cb9aa(0x1e4)]),console['error']('Current\x20context:\x20'+(_0x1c503f||'/')),_0x2039c7&&console[_0x1cb9aa(0x1fd)](_0x1cb9aa(0x1e9)+_0x2039c7),_0x216a89&&console[_0x1cb9aa(0x1fd)](_0x1cb9aa(0x1ec)));if(_0x2039c7){const _0x3732a9=_0x2039c7['includes']('*')||_0x2039c7[_0x1cb9aa(0x1f7)]('?');if(_0x3732a9&&!_0x1c503f)return await this[_0x1cb9aa(0x1e8)](_0x38adb2,_0x2039c7);else return _0x3732a9?(console[_0x1cb9aa(0x1fd)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x1cb9aa(0x1fd)](_0x1cb9aa(0x1ea)),0x1):_0x216a89?await this[_0x1cb9aa(0x1eb)](_0x38adb2,_0x2039c7):await this[_0x1cb9aa(0x1dc)](_0x38adb2,_0x2039c7);}if(!_0x1c503f)return await this['listParents'](_0x38adb2);return _0x216a89?await this[_0x1cb9aa(0x1eb)](_0x38adb2,_0x1c503f):await this[_0x1cb9aa(0x1dc)](_0x38adb2,_0x1c503f);}catch(_0x51f71b){if(_0x51f71b instanceof SDKError)return console[_0x1cb9aa(0x1fd)](_0x1cb9aa(0x201)+_0x51f71b[_0x1cb9aa(0x210)]),_0x51f71b['cause']&&console[_0x1cb9aa(0x1fd)](_0x1cb9aa(0x1d5)+_0x51f71b['cause']),0x1;throw _0x51f71b;}}async[a28_0x45f81f(0x1e8)](_0x22f2f1,_0x582b84){const _0x799830=a28_0x45f81f,{options:_0x5452fd,tdx:_0x23bd9a}=_0x22f2f1,_0x153d79=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x582b84+_0x799830(0x207),()=>_0x23bd9a[_0x799830(0x1e0)][_0x799830(0x1f4)](),{'verbose':_0x5452fd[_0x799830(0x1e1)]}),_0x30f3e0=_0x153d79[_0x799830(0x1d7)],_0x2ce757=_0x582b84['replace'](/[.+^${}()|[\]\\]/g,_0x799830(0x1db))[_0x799830(0x1fa)](/\*/g,'.*')[_0x799830(0x1fa)](/\?/g,'.'),_0x46fec8=new RegExp('^'+_0x2ce757+'$','i'),_0x2e8f9e=_0x30f3e0[_0x799830(0x20a)](_0x17a34a=>_0x46fec8['test'](_0x17a34a['attributes'][_0x799830(0x1df)]));console[_0x799830(0x1fd)](_0x799830(0x1e7)+_0x2e8f9e[_0x799830(0x213)]+_0x799830(0x20d)+(_0x2e8f9e[_0x799830(0x213)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x582b84+'\x27');if(_0x5452fd[_0x799830(0x1f3)]==='json'||_0x5452fd[_0x799830(0x1f3)]==='jsonl')await handleSDKOutput(_0x2e8f9e,_0x5452fd);else{if(_0x2e8f9e[_0x799830(0x213)]===0x0)console[_0x799830(0x1da)](_0x799830(0x20e)+_0x582b84);else{console['log'](_0x799830(0x211));for(const _0x486e38 of _0x2e8f9e){const _0x512f4e=_0x486e38[_0x799830(0x217)]['population']?a28_0x91264d[_0x799830(0x1ff)]('\x20('+formatRows(_0x486e38[_0x799830(0x217)][_0x799830(0x208)])+')'):'';console[_0x799830(0x1da)](_0x799830(0x1d6)+_0x486e38['attributes'][_0x799830(0x1df)]+_0x512f4e);}}}return 0x0;}async[a28_0x45f81f(0x1f4)](_0x311253){const _0x1e51ed=a28_0x45f81f,{options:_0x55fba3,tdx:_0x109eca}=_0x311253,_0x5ed1c5=await withSpinner(_0x1e51ed(0x202),()=>_0x109eca['segment'][_0x1e51ed(0x1f4)](),{'verbose':_0x55fba3[_0x1e51ed(0x1e1)]}),_0x27ede6=_0x5ed1c5[_0x1e51ed(0x1d7)];console[_0x1e51ed(0x1fd)]('✔\x20Found\x20'+_0x27ede6[_0x1e51ed(0x213)]+_0x1e51ed(0x20d)+(_0x27ede6['length']!==0x1?'s':''));if(_0x55fba3[_0x1e51ed(0x1f3)]===_0x1e51ed(0x1d8)||_0x55fba3['format']===_0x1e51ed(0x200))await handleSDKOutput(_0x27ede6,_0x55fba3);else{console[_0x1e51ed(0x1da)](_0x1e51ed(0x211));for(const _0x5a1ceb of _0x27ede6){const _0x144a78=_0x5a1ceb[_0x1e51ed(0x217)]['population']?a28_0x91264d['dim']('\x20('+formatRows(_0x5a1ceb[_0x1e51ed(0x217)][_0x1e51ed(0x208)])+')'):'';console['log']('👥\x20'+_0x5a1ceb['attributes'][_0x1e51ed(0x1df)]+_0x144a78);}}return 0x0;}async[a28_0x45f81f(0x1dc)](_0x2da5a2,_0x3968f5){const _0xd2fa31=a28_0x45f81f,{options:_0x26c320,tdx:_0x2595a5}=_0x2da5a2,_0x4116a6=await withSpinner(_0xd2fa31(0x212)+_0x3968f5+_0xd2fa31(0x207),()=>_0x2595a5[_0xd2fa31(0x1e0)][_0xd2fa31(0x1f8)](_0x3968f5),{'verbose':_0x26c320[_0xd2fa31(0x1e1)]}),_0x477de5=_0x4116a6[_0xd2fa31(0x1d7)];_0x26c320[_0xd2fa31(0x1e1)]&&(console['error'](_0xd2fa31(0x1fb)+_0x477de5[_0xd2fa31(0x204)]),_0x477de5[_0xd2fa31(0x1f1)]&&console['error'](_0xd2fa31(0x20b)+_0x477de5[_0xd2fa31(0x1f1)]));const _0xf16060=await withSpinner(_0xd2fa31(0x1f6),()=>_0x2595a5['segment'][_0xd2fa31(0x1dc)](_0x477de5['parentId'],_0x477de5[_0xd2fa31(0x1f1)]),{'verbose':_0x26c320['verbose']}),{folders:_0x14b8c0,segments:_0x1ff66a}=_0xf16060[_0xd2fa31(0x1d7)],_0x41586b=_0x14b8c0[_0xd2fa31(0x213)]+_0x1ff66a[_0xd2fa31(0x213)];console[_0xd2fa31(0x1fd)]('✔\x20Found\x20'+_0x14b8c0[_0xd2fa31(0x213)]+_0xd2fa31(0x1f9)+(_0x14b8c0[_0xd2fa31(0x213)]!==0x1?'s':'')+_0xd2fa31(0x1e2)+_0x1ff66a[_0xd2fa31(0x213)]+'\x20segment'+(_0x1ff66a[_0xd2fa31(0x213)]!==0x1?'s':''));if(_0x26c320[_0xd2fa31(0x1f3)]===_0xd2fa31(0x1d8)||_0x26c320[_0xd2fa31(0x1f3)]===_0xd2fa31(0x200)){const _0x4547f2=[..._0x14b8c0[_0xd2fa31(0x1f2)](_0xb7c5be=>({..._0xb7c5be,'type':_0xd2fa31(0x1de)})),..._0x1ff66a[_0xd2fa31(0x1f2)](_0x207557=>({..._0x207557,'type':'segment'}))][_0xd2fa31(0x1dd)]((_0x273a1d,_0x2d09b3)=>_0x273a1d['name'][_0xd2fa31(0x205)](_0x2d09b3[_0xd2fa31(0x1df)]));await handleSDKOutput(_0x4547f2,_0x26c320);}else{if(_0x41586b===0x0)console[_0xd2fa31(0x1da)](a28_0x91264d[_0xd2fa31(0x1ff)]('[/'+_0x3968f5+']')),console['log'](_0xd2fa31(0x1e3));else{console['log'](a28_0x91264d['dim']('[/'+_0x3968f5+']'));const _0x137a1c=formatFlatList(_0x14b8c0,_0x1ff66a,{'showMetadata':!![]});console[_0xd2fa31(0x1da)](_0x137a1c);}}return 0x0;}async['listRecursive'](_0x514b81,_0x35598d){const _0x23bf27=a28_0x45f81f,{options:_0x54f38b,tdx:_0x154a46}=_0x514b81,_0x999664=await withSpinner(_0x23bf27(0x212)+_0x35598d+_0x23bf27(0x207),()=>_0x154a46[_0x23bf27(0x1e0)][_0x23bf27(0x1f8)](_0x35598d),{'verbose':_0x54f38b[_0x23bf27(0x1e1)]}),_0x2e6f09=_0x999664[_0x23bf27(0x1d7)];_0x54f38b[_0x23bf27(0x1e1)]&&(console[_0x23bf27(0x1fd)](_0x23bf27(0x1fb)+_0x2e6f09[_0x23bf27(0x204)]),_0x2e6f09[_0x23bf27(0x1f1)]&&console[_0x23bf27(0x1fd)]('Folder\x20ID:\x20'+_0x2e6f09[_0x23bf27(0x1f1)]));const _0x38cb16=_0x54f38b[_0x23bf27(0x216)]||0xa,_0x6371d6=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x154a46[_0x23bf27(0x1e0)][_0x23bf27(0x1eb)](_0x2e6f09[_0x23bf27(0x204)],_0x2e6f09['folderId'],0x0,_0x38cb16),{'verbose':_0x54f38b[_0x23bf27(0x1e1)]}),_0x1b0d32=_0x6371d6[_0x23bf27(0x1d7)];console[_0x23bf27(0x1fd)](_0x23bf27(0x206)+_0x1b0d32[_0x23bf27(0x213)]+_0x23bf27(0x20f));if(_0x54f38b[_0x23bf27(0x1f3)]==='json'||_0x54f38b[_0x23bf27(0x1f3)]===_0x23bf27(0x200))await handleSDKOutput(_0x1b0d32,_0x54f38b);else{console[_0x23bf27(0x1da)](a28_0x91264d[_0x23bf27(0x1ff)]('[/'+_0x35598d+']'));const _0x429be7=formatTree(_0x1b0d32,{'showMetadata':!![]});console[_0x23bf27(0x1da)](_0x429be7);}return 0x0;}}
@@ -1 +1 @@
1
- const a29_0xe3a0af=a29_0xc409;(function(_0xe155d5,_0x2d9598){const _0x33bd8d=a29_0xc409,_0x5cab37=_0xe155d5();while(!![]){try{const _0x4efe2e=-parseInt(_0x33bd8d(0x1ae))/0x1*(-parseInt(_0x33bd8d(0x1c9))/0x2)+parseInt(_0x33bd8d(0x1c8))/0x3*(parseInt(_0x33bd8d(0x1ac))/0x4)+parseInt(_0x33bd8d(0x1ba))/0x5*(-parseInt(_0x33bd8d(0x1bd))/0x6)+-parseInt(_0x33bd8d(0x19f))/0x7*(-parseInt(_0x33bd8d(0x1aa))/0x8)+parseInt(_0x33bd8d(0x1a0))/0x9*(parseInt(_0x33bd8d(0x1bb))/0xa)+parseInt(_0x33bd8d(0x1ab))/0xb*(parseInt(_0x33bd8d(0x1c7))/0xc)+-parseInt(_0x33bd8d(0x1b1))/0xd;if(_0x4efe2e===_0x2d9598)break;else _0x5cab37['push'](_0x5cab37['shift']());}catch(_0x4be57a){_0x5cab37['push'](_0x5cab37['shift']());}}}(a29_0x3be6,0xed967));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a29_0x3be6(){const _0x2c8f10=['Querying\x20','Usage:\x20tdx\x20show\x20<database.table>','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','...','138084imMzHG','159BVZlIx','1104034LsrEFs','Catalog:\x20','cause','args','28679JbTVGa','162YWCnIP','Table:\x20','table','verbose','execute','Limit:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','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','3560aSCdLp','1507tLkiwk','103772SUFvKU','data','1AuOoQh','Show\x20table\x20contents','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','58896955aQmYzj','showTable','show','limit','\x20row','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','message','name','Site:\x20','9580aKxRSJ','106890fXDPUz','length','48pLzQra','validate','\x20\x20Cause:\x20','error','Error:\x20','site'];a29_0x3be6=function(){return _0x2c8f10;};return a29_0x3be6();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a29_0xc409(_0x3b8161,_0x270089){const _0x3be616=a29_0x3be6();return a29_0xc409=function(_0xc40921,_0x32e00c){_0xc40921=_0xc40921-0x19e;let _0x70411=_0x3be616[_0xc40921];return _0x70411;},a29_0xc409(_0x3b8161,_0x270089);}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a29_0xe3a0af(0x1b8)]=a29_0xe3a0af(0x1b3);['description']=a29_0xe3a0af(0x1af);async[a29_0xe3a0af(0x1a4)](_0x5659a9){const _0x12bf14=a29_0xe3a0af;return this[_0x12bf14(0x1b2)](_0x5659a9);}async[a29_0xe3a0af(0x1b2)](_0x88c489){const _0x1d9ab6=a29_0xe3a0af,{options:_0x300e47,args:_0x54b71c,tdx:_0x4091e7}=_0x88c489;let _0x28c4bc;try{_0x28c4bc=parseTableReference(_0x54b71c[0x0]);const _0x21b678=_0x300e47[_0x1d9ab6(0x1a8)];!_0x28c4bc[_0x1d9ab6(0x1a8)]&&_0x21b678&&(_0x28c4bc[_0x1d9ab6(0x1a8)]=_0x21b678);const _0x2e2730=validateTableDescribeReference(_0x28c4bc);if(_0x2e2730)return console['error']('Error:\x20'+_0x2e2730),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1c4)),console['error'](_0x1d9ab6(0x1b6)),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1a6)),0x1;}catch(_0xb4f51b){return console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1c1)+_0xb4f51b[_0x1d9ab6(0x1b7)]),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1c4)),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1b6)),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1a6)),0x1;}const _0x1f4612=_0x28c4bc['catalog'],_0x3ee834=_0x28c4bc['database'],_0x4b292e=_0x28c4bc[_0x1d9ab6(0x1a2)],_0x5283ec=resolveLimit(_0x300e47[_0x1d9ab6(0x1b4)],DEFAULT_DISPLAY_LIMIT);try{_0x300e47['verbose']&&(console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1b9)+_0x300e47[_0x1d9ab6(0x1c2)]),_0x1f4612&&console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1ca)+_0x1f4612),console['error'](_0x1d9ab6(0x1a7)+_0x3ee834),console['error'](_0x1d9ab6(0x1a1)+_0x4b292e),console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1a5)+_0x5283ec));const _0xd7f2c0=_0x1f4612?_0x1f4612+'.'+_0x3ee834+'.'+_0x4b292e:_0x3ee834+'.'+_0x4b292e,_0x1fde97=await withSpinner(_0x1d9ab6(0x1c3)+_0xd7f2c0+_0x1d9ab6(0x1c6),()=>_0x4091e7['table'][_0x1d9ab6(0x1b3)](_0x3ee834,_0x4b292e,_0x5283ec,_0x1f4612),{'verbose':_0x300e47[_0x1d9ab6(0x1a3)]}),_0x4e7296=_0x1fde97[_0x1d9ab6(0x1ad)],_0x5bff89=_0x4e7296['data'];return _0x5bff89['length']===0x0?console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1b0)):console['error']('✔\x20Retrieved\x20'+_0x5bff89[_0x1d9ab6(0x1bc)]+_0x1d9ab6(0x1b5)+(_0x5bff89['length']!==0x1?'s':'')+'\x20from\x20'+_0xd7f2c0),await handleSDKOutput(_0x5bff89,_0x300e47),0x0;}catch(_0x18980c){if(_0x18980c instanceof SDKError)return console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1c1)+_0x18980c[_0x1d9ab6(0x1b7)]),_0x18980c[_0x1d9ab6(0x1cb)]&&console[_0x1d9ab6(0x1c0)](_0x1d9ab6(0x1bf)+_0x18980c[_0x1d9ab6(0x1cb)]),0x1;throw _0x18980c;}}[a29_0xe3a0af(0x1be)](_0x348614){const _0x225162=a29_0xe3a0af;if(_0x348614[_0x225162(0x19e)][_0x225162(0x1bc)]===0x0)return _0x225162(0x1c5);if(_0x348614[_0x225162(0x19e)][_0x225162(0x1bc)]>0x1)return _0x225162(0x1a9);return undefined;}}
1
+ const a29_0x47094d=a29_0xc776;(function(_0x36f724,_0x317b84){const _0x3527f=a29_0xc776,_0x602dba=_0x36f724();while(!![]){try{const _0x53ba0e=-parseInt(_0x3527f(0xa1))/0x1+parseInt(_0x3527f(0x99))/0x2+parseInt(_0x3527f(0xb0))/0x3*(parseInt(_0x3527f(0xae))/0x4)+-parseInt(_0x3527f(0xb1))/0x5*(parseInt(_0x3527f(0xaa))/0x6)+parseInt(_0x3527f(0x9d))/0x7+parseInt(_0x3527f(0xa0))/0x8+-parseInt(_0x3527f(0xa5))/0x9*(parseInt(_0x3527f(0xa6))/0xa);if(_0x53ba0e===_0x317b84)break;else _0x602dba['push'](_0x602dba['shift']());}catch(_0x5a539d){_0x602dba['push'](_0x602dba['shift']());}}}(a29_0x408e,0xe0749));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a29_0xc776(_0x3a846a,_0xbe87e7){const _0x408ee7=a29_0x408e();return a29_0xc776=function(_0xc776a5,_0x28110f){_0xc776a5=_0xc776a5-0x98;let _0x2fe217=_0x408ee7[_0xc776a5];return _0x2fe217;},a29_0xc776(_0x3a846a,_0xbe87e7);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a29_0x408e(){const _0xa312f5=['Site:\x20','\x20\x20Cause:\x20','5672EGGfoX','description','3867GwKmUs','1285pJVeql','database','cause','Catalog:\x20','✔\x20Retrieved\x20','Usage:\x20tdx\x20show\x20<database.table>','limit','validate','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','args','table','Limit:\x20','\x20from\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','name','message','1806260psTGJQ','Querying\x20','data','Database:\x20','89922GljYBH','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','error','14329824rKppzk','1661202TaVdhw','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','catalog','\x20row','4581eiuBPG','23230twUXba','Error:\x20','length','site','18024IoxLBs','show'];a29_0x408e=function(){return _0xa312f5;};return a29_0x408e();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a29_0x47094d(0xc0)]=a29_0x47094d(0xab);[a29_0x47094d(0xaf)]='Show\x20table\x20contents';async['execute'](_0x47f6ba){return this['showTable'](_0x47f6ba);}async['showTable'](_0x456a48){const _0xfd0415=a29_0x47094d,{options:_0x2a1602,args:_0x5dae5b,tdx:_0x13754b}=_0x456a48;let _0x55e527;try{_0x55e527=parseTableReference(_0x5dae5b[0x0]);const _0x21cc3b=_0x2a1602[_0xfd0415(0xb2)];!_0x55e527[_0xfd0415(0xb2)]&&_0x21cc3b&&(_0x55e527[_0xfd0415(0xb2)]=_0x21cc3b);const _0xb2e8e4=validateTableDescribeReference(_0x55e527);if(_0xb2e8e4)return console[_0xfd0415(0x9f)](_0xfd0415(0xa7)+_0xb2e8e4),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xfd0415(0x9f)](_0xfd0415(0xbe)),console[_0xfd0415(0x9f)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x5cb387){return console['error'](_0xfd0415(0xa7)+_0x5cb387[_0xfd0415(0x98)]),console[_0xfd0415(0x9f)](_0xfd0415(0xb6)),console[_0xfd0415(0x9f)](_0xfd0415(0xbe)),console[_0xfd0415(0x9f)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x4228f1=_0x55e527[_0xfd0415(0xa3)],_0x4e8c2a=_0x55e527['database'],_0x1097fd=_0x55e527[_0xfd0415(0xbb)],_0x5f12db=resolveLimit(_0x2a1602[_0xfd0415(0xb7)],DEFAULT_DISPLAY_LIMIT);try{_0x2a1602[_0xfd0415(0xbf)]&&(console[_0xfd0415(0x9f)](_0xfd0415(0xac)+_0x2a1602[_0xfd0415(0xa9)]),_0x4228f1&&console[_0xfd0415(0x9f)](_0xfd0415(0xb4)+_0x4228f1),console[_0xfd0415(0x9f)](_0xfd0415(0x9c)+_0x4e8c2a),console[_0xfd0415(0x9f)]('Table:\x20'+_0x1097fd),console[_0xfd0415(0x9f)](_0xfd0415(0xbc)+_0x5f12db));const _0x37f230=_0x4228f1?_0x4228f1+'.'+_0x4e8c2a+'.'+_0x1097fd:_0x4e8c2a+'.'+_0x1097fd,_0x3295f3=await withSpinner(_0xfd0415(0x9a)+_0x37f230+'...',()=>_0x13754b[_0xfd0415(0xbb)][_0xfd0415(0xab)](_0x4e8c2a,_0x1097fd,_0x5f12db,_0x4228f1),{'verbose':_0x2a1602[_0xfd0415(0xbf)]}),_0x528189=_0x3295f3[_0xfd0415(0x9b)],_0x506a94=_0x528189['data'];return _0x506a94[_0xfd0415(0xa8)]===0x0?console[_0xfd0415(0x9f)](_0xfd0415(0xb9)):console['error'](_0xfd0415(0xb5)+_0x506a94[_0xfd0415(0xa8)]+_0xfd0415(0xa4)+(_0x506a94[_0xfd0415(0xa8)]!==0x1?'s':'')+_0xfd0415(0xbd)+_0x37f230),await handleSDKOutput(_0x506a94,_0x2a1602),0x0;}catch(_0x24fa0a){if(_0x24fa0a instanceof SDKError)return console[_0xfd0415(0x9f)]('Error:\x20'+_0x24fa0a[_0xfd0415(0x98)]),_0x24fa0a[_0xfd0415(0xb3)]&&console[_0xfd0415(0x9f)](_0xfd0415(0xad)+_0x24fa0a[_0xfd0415(0xb3)]),0x1;throw _0x24fa0a;}}[a29_0x47094d(0xb8)](_0x11857d){const _0x151028=a29_0x47094d;if(_0x11857d[_0x151028(0xba)][_0x151028(0xa8)]===0x0)return _0x151028(0x9e);if(_0x11857d[_0x151028(0xba)][_0x151028(0xa8)]>0x1)return _0x151028(0xa2);return undefined;}}
@@ -1 +1 @@
1
- const a30_0x54564f=a30_0x4c41;function a30_0x4c41(_0x5ba8a0,_0x47a4ed){const _0x42753e=a30_0x4275();return a30_0x4c41=function(_0x4c4129,_0x22d11f){_0x4c4129=_0x4c4129-0x10c;let _0x117355=_0x42753e[_0x4c4129];return _0x117355;},a30_0x4c41(_0x5ba8a0,_0x47a4ed);}(function(_0x393c9e,_0x6cbd74){const _0x2f88ca=a30_0x4c41,_0x240db4=_0x393c9e();while(!![]){try{const _0x5986b0=parseInt(_0x2f88ca(0x126))/0x1*(parseInt(_0x2f88ca(0x11f))/0x2)+-parseInt(_0x2f88ca(0x11d))/0x3+parseInt(_0x2f88ca(0x12c))/0x4+-parseInt(_0x2f88ca(0x139))/0x5+parseInt(_0x2f88ca(0x134))/0x6*(parseInt(_0x2f88ca(0x113))/0x7)+parseInt(_0x2f88ca(0x122))/0x8*(-parseInt(_0x2f88ca(0x129))/0x9)+-parseInt(_0x2f88ca(0x118))/0xa*(-parseInt(_0x2f88ca(0x11b))/0xb);if(_0x5986b0===_0x6cbd74)break;else _0x240db4['push'](_0x240db4['shift']());}catch(_0x3e9852){_0x240db4['push'](_0x240db4['shift']());}}}(a30_0x4275,0x70cca));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a30_0x4275(){const _0x46b37d=['list','Database\x20pattern:\x20','11UOyjvD','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','1989516NcGItp','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','150414vROkwb','table','Site:\x20','16MUzUkR','length','limit','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','3PDYnUv','\x20table','Listing\x20tables...','4012542xclDvl','tables','Table\x20pattern:\x20','932532LrXEkk','database','Error:\x20','\x27\x20is\x20ambiguous.','Database:\x20','\x27\x20across\x20all\x20databases.','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','data','5356014FvxcSm','site','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','error','4020115hzntTn','validate','\x20\x20Cause:\x20','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Database:\x20all','execute','\x20\x20Use:\x20tdx\x20tables\x20\x22','message','✖\x20No\x20tables\x20found','cause','7VblilS','includes','name','✔\x20Found\x20','description','14694740rXRmdf'];a30_0x4275=function(){return _0x46b37d;};return a30_0x4275();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0x54564f(0x115)]=a30_0x54564f(0x12a);[a30_0x54564f(0x117)]='List\x20tables\x20in\x20a\x20database';async[a30_0x54564f(0x10e)](_0x170d35){const _0x31e011=a30_0x54564f,{options:_0xab6ba9,args:_0x1df1d4,tdx:_0x11f887}=_0x170d35;let _0x33419a;if(_0x1df1d4[_0x31e011(0x123)]===0x0)_0x33419a={'database':undefined,'table':undefined,'original':''};else{if(_0x1df1d4['length']===0x1)try{_0x33419a=parseTableReference(_0x1df1d4[0x0]);if(_0x33419a[_0x31e011(0x120)]&&!_0x33419a['database']&&!_0x33419a[_0x31e011(0x120)]['includes']('*')&&!_0x33419a[_0x31e011(0x120)][_0x31e011(0x114)]('?'))return console[_0x31e011(0x138)]('Error:\x20Pattern\x20\x27'+_0x1df1d4[0x0]+_0x31e011(0x12f)),console[_0x31e011(0x138)](_0x31e011(0x132)+_0x33419a[_0x31e011(0x120)]+'\x27?'),console[_0x31e011(0x138)](_0x31e011(0x10f)+_0x33419a[_0x31e011(0x120)]+'.*\x22'),console[_0x31e011(0x138)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x33419a[_0x31e011(0x120)]),console[_0x31e011(0x138)](_0x31e011(0x11e)+_0x33419a[_0x31e011(0x120)]),console[_0x31e011(0x138)](''),console['error']('Note:\x20\x27'+_0x1df1d4[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x33419a['table']+_0x31e011(0x131)),0x1;}catch(_0x2caed9){return console[_0x31e011(0x138)](_0x31e011(0x12e)+_0x2caed9[_0x31e011(0x110)]),0x1;}else return console['error'](_0x31e011(0x10c)),console[_0x31e011(0x138)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x31e011(0x138)](_0x31e011(0x137)),console[_0x31e011(0x138)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x31e011(0x138)](_0x31e011(0x125)),console[_0x31e011(0x138)]('Or\x20use\x20--in\x20flag:'),console[_0x31e011(0x138)](_0x31e011(0x11c)),0x1;}const _0x2c0c58=_0xab6ba9[_0x31e011(0x12d)];!_0x33419a['database']&&_0x2c0c58&&(_0x33419a[_0x31e011(0x12d)]=_0x2c0c58);try{const _0x3dac34=_0x2569fd=>_0x2569fd&&(_0x2569fd['includes']('*')||_0x2569fd[_0x31e011(0x114)]('?')),_0x3abc54=_0x3dac34(_0x33419a[_0x31e011(0x12d)]);_0xab6ba9['verbose']&&(console[_0x31e011(0x138)](_0x31e011(0x121)+_0xab6ba9[_0x31e011(0x135)]),_0x33419a[_0x31e011(0x12d)]?_0x3abc54?console[_0x31e011(0x138)](_0x31e011(0x11a)+_0x33419a[_0x31e011(0x12d)]):console[_0x31e011(0x138)](_0x31e011(0x130)+_0x33419a[_0x31e011(0x12d)]):console[_0x31e011(0x138)](_0x31e011(0x10d)),_0x33419a['table']&&console[_0x31e011(0x138)](_0x31e011(0x12b)+_0x33419a[_0x31e011(0x120)]));const _0x4460d1=_0x33419a[_0x31e011(0x12d)]&&!_0x3abc54?_0x33419a[_0x31e011(0x12d)]:undefined,_0x56868a=_0x3abc54?_0x33419a[_0x31e011(0x12d)]:undefined,_0x594763=_0x33419a[_0x31e011(0x120)],_0x1035d9=resolveLimit(_0xab6ba9[_0x31e011(0x124)],DEFAULT_LISTING_LIMIT),_0x1cdc21=await withSpinner(_0x31e011(0x128),()=>_0x11f887[_0x31e011(0x120)][_0x31e011(0x119)](_0x4460d1,_0x594763,_0x56868a,_0x1035d9),{'verbose':_0xab6ba9['verbose']}),_0x11f340=_0x1cdc21[_0x31e011(0x133)];if(_0x11f340[_0x31e011(0x123)]===0x0&&_0x33419a['database']&&!_0x3abc54)return console['error'](_0x31e011(0x111)),console[_0x31e011(0x138)]('Database\x20\x27'+_0x33419a[_0x31e011(0x12d)]+_0x31e011(0x136)),0x1;return console[_0x31e011(0x138)](_0x31e011(0x116)+_0x11f340[_0x31e011(0x123)]+_0x31e011(0x127)+(_0x11f340[_0x31e011(0x123)]!==0x1?'s':'')),await handleSDKOutput(_0x11f340,{..._0xab6ba9,'limit':_0x1035d9}),0x0;}catch(_0x1b8615){if(_0x1b8615 instanceof SDKError)return console['error'](_0x31e011(0x12e)+_0x1b8615[_0x31e011(0x110)]),_0x1b8615[_0x31e011(0x112)]&&console[_0x31e011(0x138)](_0x31e011(0x13b)+_0x1b8615[_0x31e011(0x112)]),0x1;throw _0x1b8615;}}[a30_0x54564f(0x13a)](_0x220b25){return undefined;}}
1
+ const a30_0xfebd27=a30_0x7d29;function a30_0x55e8(){const _0x4b663f=['site','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x20table','\x27\x20is\x20ambiguous.','✖\x20No\x20tables\x20found','name','✔\x20Found\x20','Error:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Database\x20pattern:\x20','.*\x22','260193iZMjTt','46152EacSPq','list','data','database','8YMRUaY','includes','message','12vzpqfJ','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','error','\x20\x20Use:\x20tdx\x20tables\x20\x22','287440RLqeCD','Database:\x20all','Error:\x20Pattern\x20\x27','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','143gNnZvV','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','99920lkRYMQ','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','length','Database\x20\x27','13136qGXGOv','table','3829437uHiQci','2808505GcyFTv','2RdFfHG','validate','cause','91NvUPcz','96bFUkYz','Note:\x20\x27','verbose','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'];a30_0x55e8=function(){return _0x4b663f;};return a30_0x55e8();}(function(_0x21819f,_0x41f826){const _0xad4997=a30_0x7d29,_0xc4d698=_0x21819f();while(!![]){try{const _0x564d83=-parseInt(_0xad4997(0x1c4))/0x1*(parseInt(_0xad4997(0x1df))/0x2)+-parseInt(_0xad4997(0x1cc))/0x3*(-parseInt(_0xad4997(0x1db))/0x4)+parseInt(_0xad4997(0x1d1))/0x5*(parseInt(_0xad4997(0x1e3))/0x6)+-parseInt(_0xad4997(0x1de))/0x7*(-parseInt(_0xad4997(0x1c9))/0x8)+-parseInt(_0xad4997(0x1dd))/0x9+parseInt(_0xad4997(0x1d7))/0xa*(-parseInt(_0xad4997(0x1d5))/0xb)+-parseInt(_0xad4997(0x1c5))/0xc*(parseInt(_0xad4997(0x1e2))/0xd);if(_0x564d83===_0x41f826)break;else _0xc4d698['push'](_0xc4d698['shift']());}catch(_0x3e742d){_0xc4d698['push'](_0xc4d698['shift']());}}}(a30_0x55e8,0x78087));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a30_0x7d29(_0x72d84d,_0x4f34ec){const _0x55e818=a30_0x55e8();return a30_0x7d29=function(_0x7d2943,_0x59721d){_0x7d2943=_0x7d2943-0x1c2;let _0x3db01a=_0x55e818[_0x7d2943];return _0x3db01a;},a30_0x7d29(_0x72d84d,_0x4f34ec);}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0xfebd27(0x1ed)]='tables';['description']='List\x20tables\x20in\x20a\x20database';async['execute'](_0xec49f6){const _0x50d92a=a30_0xfebd27,{options:_0x16b3f0,args:_0x1aa4ba,tdx:_0x3dd7ba}=_0xec49f6;let _0x292c84;if(_0x1aa4ba[_0x50d92a(0x1d9)]===0x0)_0x292c84={'database':undefined,'table':undefined,'original':''};else{if(_0x1aa4ba[_0x50d92a(0x1d9)]===0x1)try{_0x292c84=parseTableReference(_0x1aa4ba[0x0]);if(_0x292c84[_0x50d92a(0x1dc)]&&!_0x292c84[_0x50d92a(0x1c8)]&&!_0x292c84[_0x50d92a(0x1dc)][_0x50d92a(0x1ca)]('*')&&!_0x292c84[_0x50d92a(0x1dc)]['includes']('?'))return console[_0x50d92a(0x1cf)](_0x50d92a(0x1d3)+_0x1aa4ba[0x0]+_0x50d92a(0x1eb)),console[_0x50d92a(0x1cf)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x292c84[_0x50d92a(0x1dc)]+'\x27?'),console['error'](_0x50d92a(0x1d0)+_0x292c84[_0x50d92a(0x1dc)]+_0x50d92a(0x1c3)),console[_0x50d92a(0x1cf)](_0x50d92a(0x1ce)+_0x292c84['table']),console[_0x50d92a(0x1cf)](_0x50d92a(0x1d6)+_0x292c84['table']),console[_0x50d92a(0x1cf)](''),console[_0x50d92a(0x1cf)](_0x50d92a(0x1e4)+_0x1aa4ba[0x0]+_0x50d92a(0x1d4)+_0x292c84['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x2c5e5a){return console[_0x50d92a(0x1cf)](_0x50d92a(0x1ef)+_0x2c5e5a[_0x50d92a(0x1cb)]),0x1;}else return console[_0x50d92a(0x1cf)](_0x50d92a(0x1cd)),console[_0x50d92a(0x1cf)](_0x50d92a(0x1e7)),console[_0x50d92a(0x1cf)](_0x50d92a(0x1d8)),console['error'](_0x50d92a(0x1e9)),console[_0x50d92a(0x1cf)](_0x50d92a(0x1f0)),console['error']('Or\x20use\x20--in\x20flag:'),console[_0x50d92a(0x1cf)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x36c8c7=_0x16b3f0[_0x50d92a(0x1c8)];!_0x292c84[_0x50d92a(0x1c8)]&&_0x36c8c7&&(_0x292c84[_0x50d92a(0x1c8)]=_0x36c8c7);try{const _0x485ea3=_0x17a085=>_0x17a085&&(_0x17a085['includes']('*')||_0x17a085['includes']('?')),_0x4a2bd9=_0x485ea3(_0x292c84['database']);_0x16b3f0[_0x50d92a(0x1e5)]&&(console[_0x50d92a(0x1cf)]('Site:\x20'+_0x16b3f0[_0x50d92a(0x1e8)]),_0x292c84[_0x50d92a(0x1c8)]?_0x4a2bd9?console['error'](_0x50d92a(0x1c2)+_0x292c84[_0x50d92a(0x1c8)]):console[_0x50d92a(0x1cf)]('Database:\x20'+_0x292c84[_0x50d92a(0x1c8)]):console[_0x50d92a(0x1cf)](_0x50d92a(0x1d2)),_0x292c84[_0x50d92a(0x1dc)]&&console['error']('Table\x20pattern:\x20'+_0x292c84[_0x50d92a(0x1dc)]));const _0x30a10b=_0x292c84['database']&&!_0x4a2bd9?_0x292c84[_0x50d92a(0x1c8)]:undefined,_0x41c0df=_0x4a2bd9?_0x292c84[_0x50d92a(0x1c8)]:undefined,_0x3943b4=_0x292c84[_0x50d92a(0x1dc)],_0xb9bda6=resolveLimit(_0x16b3f0['limit'],DEFAULT_LISTING_LIMIT),_0x1bbc29=await withSpinner('Listing\x20tables...',()=>_0x3dd7ba[_0x50d92a(0x1dc)][_0x50d92a(0x1c6)](_0x30a10b,_0x3943b4,_0x41c0df,_0xb9bda6),{'verbose':_0x16b3f0[_0x50d92a(0x1e5)]}),_0x37ed93=_0x1bbc29[_0x50d92a(0x1c7)];if(_0x37ed93['length']===0x0&&_0x292c84[_0x50d92a(0x1c8)]&&!_0x4a2bd9)return console['error'](_0x50d92a(0x1ec)),console[_0x50d92a(0x1cf)](_0x50d92a(0x1da)+_0x292c84['database']+_0x50d92a(0x1e6)),0x1;return console[_0x50d92a(0x1cf)](_0x50d92a(0x1ee)+_0x37ed93[_0x50d92a(0x1d9)]+_0x50d92a(0x1ea)+(_0x37ed93[_0x50d92a(0x1d9)]!==0x1?'s':'')),await handleSDKOutput(_0x37ed93,{..._0x16b3f0,'limit':_0xb9bda6}),0x0;}catch(_0x3222e2){if(_0x3222e2 instanceof SDKError)return console['error'](_0x50d92a(0x1ef)+_0x3222e2[_0x50d92a(0x1cb)]),_0x3222e2[_0x50d92a(0x1e1)]&&console[_0x50d92a(0x1cf)]('\x20\x20Cause:\x20'+_0x3222e2[_0x50d92a(0x1e1)]),0x1;throw _0x3222e2;}}[a30_0xfebd27(0x1e0)](_0x1a1aa2){return undefined;}}