@treasuredata/tdx 0.1.18 → 0.1.20

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 (115) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-client.d.ts +2 -2
  7. package/dist/client/llm-client.d.ts.map +1 -1
  8. package/dist/client/llm-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-client.js +1 -1
  11. package/dist/client/trino-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/api-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/chat-command.js.map +1 -1
  17. package/dist/commands/claude-command.d.ts.map +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-command.js.map +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/context-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/job-command.js +1 -1
  25. package/dist/commands/llm-command.d.ts.map +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/llm-command.js.map +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 +3 -3
  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 +5 -3
  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/sdk/api.js +1 -1
  61. package/dist/sdk/database.js +1 -1
  62. package/dist/sdk/errors.d.ts +3 -1
  63. package/dist/sdk/errors.d.ts.map +1 -1
  64. package/dist/sdk/errors.js +1 -1
  65. package/dist/sdk/errors.js.map +1 -1
  66. package/dist/sdk/index.js +1 -1
  67. package/dist/sdk/job.js +1 -1
  68. package/dist/sdk/llm.d.ts +14 -0
  69. package/dist/sdk/llm.d.ts.map +1 -1
  70. package/dist/sdk/llm.js +1 -1
  71. package/dist/sdk/llm.js.map +1 -1
  72. package/dist/sdk/query.js +1 -1
  73. package/dist/sdk/segment.js +1 -1
  74. package/dist/sdk/table.js +1 -1
  75. package/dist/sdk/workflow.js +1 -1
  76. package/dist/types/endpoints.js +1 -1
  77. package/dist/types/index.d.ts +41 -21
  78. package/dist/types/index.d.ts.map +1 -1
  79. package/dist/types/index.js +1 -1
  80. package/dist/utils/agent-ref-parser.js +1 -1
  81. package/dist/utils/chat-cache.js +1 -1
  82. package/dist/utils/colors.d.ts +4 -0
  83. package/dist/utils/colors.d.ts.map +1 -1
  84. package/dist/utils/colors.js +1 -1
  85. package/dist/utils/colors.js.map +1 -1
  86. package/dist/utils/command-output.js +1 -1
  87. package/dist/utils/file-permissions.js +1 -1
  88. package/dist/utils/format-detector.js +1 -1
  89. package/dist/utils/formatters.js +1 -1
  90. package/dist/utils/json-loader.js +1 -1
  91. package/dist/utils/model-aliases.d.ts +15 -0
  92. package/dist/utils/model-aliases.d.ts.map +1 -1
  93. package/dist/utils/model-aliases.js +1 -1
  94. package/dist/utils/model-aliases.js.map +1 -1
  95. package/dist/utils/option-validation.js +1 -1
  96. package/dist/utils/port.js +1 -1
  97. package/dist/utils/process.js +1 -1
  98. package/dist/utils/prompt.js +1 -1
  99. package/dist/utils/segment-path-parser.js +1 -1
  100. package/dist/utils/segment-ref-parser.js +1 -1
  101. package/dist/utils/spinner.js +1 -1
  102. package/dist/utils/sql-parser.js +1 -1
  103. package/dist/utils/sse-parser.d.ts +2 -2
  104. package/dist/utils/sse-parser.d.ts.map +1 -1
  105. package/dist/utils/sse-parser.js +1 -1
  106. package/dist/utils/sse-parser.js.map +1 -1
  107. package/dist/utils/string-utils.js +1 -1
  108. package/dist/utils/table-ref-parser.js +1 -1
  109. package/dist/utils/tree-formatter.js +1 -1
  110. package/dist/utils/version-check.d.ts +28 -0
  111. package/dist/utils/version-check.d.ts.map +1 -0
  112. package/dist/utils/version-check.js +1 -0
  113. package/dist/utils/version-check.js.map +1 -0
  114. package/dist/utils/workflow-utils.js +1 -1
  115. package/package.json +3 -1
@@ -1 +1 @@
1
- function a19_0x1a84(){const _0x38dd27=['data','behaviorsFile','scheduleType','Error:\x20Parent\x20segment\x20name\x20is\x20required','customerGroupFile','site','addBehaviors','2618830xGKRes','execute','length','Creating\x20parent\x20segment\x20\x27','Name:\x20','getParentFull','name','4587805szYljn','attributes','attributesFile','14hncgtS','Table:\x20','Update\x20existing\x20parent\x20segment\x20(audience)','addAttributesFile','verbose','behaviors','1256hfbBlW','segment:parent:update','description','database','segment:parent:create','addBehaviorsFile','2855919wYCtCh','9QlPjtn','✔\x20Created\x20parent\x20segment\x20\x27','14539qtPBnC','timezone','\x27\x20with\x20ID:\x20','Database:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','263708glDPEZ','error','7724694LoGRWz','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Site:\x20','111209UBlBDn','addAttributes','\x27...','Parent\x20segment:\x20','3ywiCWJ','customerGroup','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment','scheduleOption','table'];a19_0x1a84=function(){return _0x38dd27;};return a19_0x1a84();}const a19_0x321176=a19_0x5406;function a19_0x5406(_0xa6b6ba,_0x5baf72){const _0x1a8488=a19_0x1a84();return a19_0x5406=function(_0x5406ff,_0xd48b1f){_0x5406ff=_0x5406ff-0x18d;let _0x17f17b=_0x1a8488[_0x5406ff];return _0x17f17b;},a19_0x5406(_0xa6b6ba,_0x5baf72);}(function(_0x2285c5,_0x4df444){const _0x85a0fb=a19_0x5406,_0x5660fe=_0x2285c5();while(!![]){try{const _0x37e869=parseInt(_0x85a0fb(0x1b6))/0x1*(parseInt(_0x85a0fb(0x19d))/0x2)+-parseInt(_0x85a0fb(0x1ba))/0x3*(-parseInt(_0x85a0fb(0x1b1))/0x4)+parseInt(_0x85a0fb(0x19a))/0x5+-parseInt(_0x85a0fb(0x1b3))/0x6+parseInt(_0x85a0fb(0x1ac))/0x7*(parseInt(_0x85a0fb(0x1a3))/0x8)+-parseInt(_0x85a0fb(0x1aa))/0x9*(-parseInt(_0x85a0fb(0x193))/0xa)+-parseInt(_0x85a0fb(0x1a9))/0xb;if(_0x37e869===_0x4df444)break;else _0x5660fe['push'](_0x5660fe['shift']());}catch(_0x46fa6f){_0x5660fe['push'](_0x5660fe['shift']());}}}(a19_0x1a84,0xc401d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{['name']=a19_0x321176(0x1a7);[a19_0x321176(0x1a5)]='Create\x20new\x20parent\x20segment\x20(audience)';async[a19_0x321176(0x194)](_0x3ad8f){const _0x47d837=a19_0x321176,{options:_0x3d8ffc,args:_0x1ebd97,tdx:_0x459ef6}=_0x3ad8f,_0x227b73=_0x3d8ffc;if(_0x1ebd97[_0x47d837(0x195)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x47d837(0x1b2)](_0x47d837(0x1b4)),0x1;const _0x91cad8=_0x1ebd97[0x0];if(!_0x227b73[_0x47d837(0x1a6)]||!_0x227b73['table'])return console[_0x47d837(0x1b2)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x47d837(0x1b2)](_0x47d837(0x1b4)),0x1;_0x227b73[_0x47d837(0x1a1)]&&(console[_0x47d837(0x1b2)](_0x47d837(0x1b5)+_0x227b73[_0x47d837(0x191)]),console[_0x47d837(0x1b2)](_0x47d837(0x197)+_0x91cad8),console[_0x47d837(0x1b2)](_0x47d837(0x1af)+_0x227b73['database']),console[_0x47d837(0x1b2)](_0x47d837(0x19e)+_0x227b73[_0x47d837(0x1bf)]));const _0x459f2e=await loadJSONFromOptions(_0x227b73[_0x47d837(0x19b)],_0x227b73[_0x47d837(0x19c)]),_0x532065=await loadJSONFromOptions(_0x227b73[_0x47d837(0x1a2)],_0x227b73[_0x47d837(0x18d)]),_0x343cfa=await loadJSONFromOptions(_0x227b73[_0x47d837(0x1bb)],_0x227b73[_0x47d837(0x190)]),_0x56cb3b={'name':_0x91cad8,'description':_0x227b73['description'],'scheduleType':_0x227b73[_0x47d837(0x18e)],'scheduleOption':_0x227b73[_0x47d837(0x1be)],'timezone':_0x227b73[_0x47d837(0x1ad)],'master':{'parentDatabaseName':_0x227b73[_0x47d837(0x1a6)],'parentTableName':_0x227b73[_0x47d837(0x1bf)]},'attributes':_0x459f2e,'behaviors':_0x532065,'customerGroup':_0x343cfa},_0x382beb=await withSpinner(_0x47d837(0x196)+_0x91cad8+_0x47d837(0x1b8),()=>_0x459ef6[_0x47d837(0x1bd)]['createParent'](_0x56cb3b),{'verbose':_0x3d8ffc[_0x47d837(0x1a1)]}),_0xc296c4=_0x382beb[_0x47d837(0x1c0)];return console[_0x47d837(0x1b2)](_0x47d837(0x1ab)+_0xc296c4[_0x47d837(0x199)]+_0x47d837(0x1ae)+_0xc296c4['id']),await handleSDKOutput([_0xc296c4],_0x3d8ffc),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a19_0x321176(0x199)]=a19_0x321176(0x1a4);['description']=a19_0x321176(0x19f);async[a19_0x321176(0x194)](_0xd62f62){const _0x265c41=a19_0x321176,{options:_0xcaacf0,args:_0x11dd5d,tdx:_0x131c31}=_0xd62f62,_0x5a783c=_0xcaacf0;if(_0x11dd5d[_0x265c41(0x195)]===0x0)return console['error'](_0x265c41(0x18f)),console['error'](_0x265c41(0x1bc)),0x1;const _0x31bdb9=_0x11dd5d[0x0];_0x5a783c[_0x265c41(0x1a1)]&&(console[_0x265c41(0x1b2)](_0x265c41(0x1b5)+_0x5a783c[_0x265c41(0x191)]),console[_0x265c41(0x1b2)](_0x265c41(0x1b9)+_0x31bdb9));const _0x300fc3=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x31bdb9+'\x27...',()=>_0x131c31['segment'][_0x265c41(0x198)](_0x31bdb9),{'verbose':_0x5a783c['verbose']}),_0x324f3e=_0x300fc3[_0x265c41(0x1c0)],_0x2545bc=await loadJSONFromOptions(_0x5a783c[_0x265c41(0x1b7)],_0x5a783c[_0x265c41(0x1a0)]),_0x1f7135=await loadJSONFromOptions(_0x5a783c[_0x265c41(0x192)],_0x5a783c[_0x265c41(0x1a8)]),_0x54bc58={'name':_0x324f3e['name'],'description':_0x5a783c['description']!==undefined?_0x5a783c['description']:_0x324f3e[_0x265c41(0x1a5)],'scheduleType':_0x5a783c['scheduleType']!==undefined?_0x5a783c[_0x265c41(0x18e)]:_0x324f3e[_0x265c41(0x18e)],'scheduleOption':_0x5a783c['scheduleOption']!==undefined?_0x5a783c[_0x265c41(0x1be)]:_0x324f3e[_0x265c41(0x1be)],'timezone':_0x5a783c[_0x265c41(0x1ad)]!==undefined?_0x5a783c[_0x265c41(0x1ad)]:_0x324f3e[_0x265c41(0x1ad)],'master':_0x324f3e['master'],'attributes':_0x2545bc?[..._0x324f3e[_0x265c41(0x19b)]||[],..._0x2545bc]:_0x324f3e['attributes'],'behaviors':_0x1f7135?[..._0x324f3e[_0x265c41(0x1a2)]||[],..._0x1f7135]:_0x324f3e['behaviors'],'customerGroup':_0x324f3e[_0x265c41(0x1bb)]},_0x1d39c3=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x31bdb9+_0x265c41(0x1b8),()=>_0x131c31[_0x265c41(0x1bd)]['updateParent'](_0x31bdb9,_0x54bc58),{'verbose':_0x5a783c[_0x265c41(0x1a1)]}),_0x80b8e6=_0x1d39c3[_0x265c41(0x1c0)];return console['error'](_0x265c41(0x1b0)+_0x80b8e6['name']+'\x27'),await handleSDKOutput([_0x80b8e6],_0x5a783c),0x0;}}
1
+ const a19_0x2ee633=a19_0xb70d;(function(_0x166297,_0xc967ac){const _0x3e84f0=a19_0xb70d,_0x1e9061=_0x166297();while(!![]){try{const _0x28122e=parseInt(_0x3e84f0(0x1c8))/0x1*(parseInt(_0x3e84f0(0x1dd))/0x2)+-parseInt(_0x3e84f0(0x1d7))/0x3+parseInt(_0x3e84f0(0x1d6))/0x4+parseInt(_0x3e84f0(0x1ca))/0x5+parseInt(_0x3e84f0(0x1d9))/0x6+parseInt(_0x3e84f0(0x1f0))/0x7*(-parseInt(_0x3e84f0(0x1d3))/0x8)+-parseInt(_0x3e84f0(0x1c5))/0x9*(parseInt(_0x3e84f0(0x1f5))/0xa);if(_0x28122e===_0xc967ac)break;else _0x1e9061['push'](_0x1e9061['shift']());}catch(_0x1b3dc2){_0x1e9061['push'](_0x1e9061['shift']());}}}(a19_0x1def,0xd83fc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x2ee633(0x1d1)]=a19_0x2ee633(0x1e8);[a19_0x2ee633(0x1dc)]=a19_0x2ee633(0x1d5);async[a19_0x2ee633(0x1f6)](_0x1eca9c){const _0x4fd46f=a19_0x2ee633,{options:_0x248b7b,args:_0x23bd73,tdx:_0x4810c6}=_0x1eca9c,_0x308d78=_0x248b7b;if(_0x23bd73[_0x4fd46f(0x1f7)]===0x0)return console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1db)),console[_0x4fd46f(0x1d8)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x15c0b6=_0x23bd73[0x0];if(!_0x308d78[_0x4fd46f(0x1cb)]||!_0x308d78[_0x4fd46f(0x1f2)])return console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1ef)),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1f4)),0x1;_0x308d78[_0x4fd46f(0x1ec)]&&(console['error'](_0x4fd46f(0x1de)+_0x308d78[_0x4fd46f(0x1e9)]),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1e0)+_0x15c0b6),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1c9)+_0x308d78['database']),console[_0x4fd46f(0x1d8)](_0x4fd46f(0x1cd)+_0x308d78[_0x4fd46f(0x1f2)]));const _0x3d5d92=await loadJSONFromOptions(_0x308d78[_0x4fd46f(0x1d0)],_0x308d78[_0x4fd46f(0x1d4)]),_0x32234e=await loadJSONFromOptions(_0x308d78[_0x4fd46f(0x1e4)],_0x308d78[_0x4fd46f(0x1f8)]),_0x46d1f6=await loadJSONFromOptions(_0x308d78['customerGroup'],_0x308d78[_0x4fd46f(0x1c4)]),_0x2c3845={'name':_0x15c0b6,'description':_0x308d78['description'],'scheduleType':_0x308d78['scheduleType'],'scheduleOption':_0x308d78[_0x4fd46f(0x1df)],'timezone':_0x308d78['timezone'],'master':{'parentDatabaseName':_0x308d78[_0x4fd46f(0x1cb)],'parentTableName':_0x308d78[_0x4fd46f(0x1f2)]},'attributes':_0x3d5d92,'behaviors':_0x32234e,'customerGroup':_0x46d1f6},_0x1238fe=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x15c0b6+'\x27...',()=>_0x4810c6[_0x4fd46f(0x1c7)][_0x4fd46f(0x1eb)](_0x2c3845),{'verbose':_0x248b7b[_0x4fd46f(0x1ec)]}),_0x2e547a=_0x1238fe[_0x4fd46f(0x1ea)];return console[_0x4fd46f(0x1d8)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x2e547a[_0x4fd46f(0x1d1)]+'\x27\x20with\x20ID:\x20'+_0x2e547a['id']),await handleSDKOutput([_0x2e547a],_0x248b7b),0x0;}}function a19_0xb70d(_0x4adcd1,_0x585ca6){const _0x1def07=a19_0x1def();return a19_0xb70d=function(_0xb70d83,_0x48a756){_0xb70d83=_0xb70d83-0x1c3;let _0x564b33=_0x1def07[_0xb70d83];return _0x564b33;},a19_0xb70d(_0x4adcd1,_0x585ca6);}function a19_0x1def(){const _0x50f40d=['Updating\x20parent\x20segment\x20\x27','table','getParentFull','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','20TWFToy','execute','length','behaviorsFile','addAttributes','customerGroupFile','6176664LCoPSz','Fetching\x20current\x20configuration\x20for\x20\x27','segment','63839iHBFRU','Database:\x20','5544020MEkkJl','database','addBehaviors','Table:\x20','addBehaviorsFile','Update\x20existing\x20parent\x20segment\x20(audience)','attributes','name','\x27...','40QjFygC','attributesFile','Create\x20new\x20parent\x20segment\x20(audience)','5946044rBgWQU','830262MqRjio','error','2057802zqQlvc','updateParent','Error:\x20Parent\x20segment\x20name\x20is\x20required','description','10WWihgl','Site:\x20','scheduleOption','Name:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','segment:parent:update','✔\x20Updated\x20parent\x20segment\x20\x27','behaviors','scheduleType','timezone','Parent\x20segment:\x20','segment:parent:create','site','data','createParent','verbose','customerGroup','master','Error:\x20--database\x20and\x20--table\x20are\x20required','1011325UTLHQM'];a19_0x1def=function(){return _0x50f40d;};return a19_0x1def();}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a19_0x2ee633(0x1e2);[a19_0x2ee633(0x1dc)]=a19_0x2ee633(0x1cf);async[a19_0x2ee633(0x1f6)](_0x1190a2){const _0x291a76=a19_0x2ee633,{options:_0x13ac30,args:_0x255cd2,tdx:_0x249815}=_0x1190a2,_0x327174=_0x13ac30;if(_0x255cd2[_0x291a76(0x1f7)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x291a76(0x1d8)](_0x291a76(0x1e1)),0x1;const _0x54e971=_0x255cd2[0x0];_0x327174['verbose']&&(console[_0x291a76(0x1d8)]('Site:\x20'+_0x327174[_0x291a76(0x1e9)]),console[_0x291a76(0x1d8)](_0x291a76(0x1e7)+_0x54e971));const _0x75a7b7=await withSpinner(_0x291a76(0x1c6)+_0x54e971+_0x291a76(0x1d2),()=>_0x249815[_0x291a76(0x1c7)][_0x291a76(0x1f3)](_0x54e971),{'verbose':_0x327174[_0x291a76(0x1ec)]}),_0x23a50b=_0x75a7b7[_0x291a76(0x1ea)],_0x31ac85=await loadJSONFromOptions(_0x327174[_0x291a76(0x1c3)],_0x327174['addAttributesFile']),_0x3addd7=await loadJSONFromOptions(_0x327174[_0x291a76(0x1cc)],_0x327174[_0x291a76(0x1ce)]),_0x4de4bf={'name':_0x23a50b[_0x291a76(0x1d1)],'description':_0x327174['description']!==undefined?_0x327174['description']:_0x23a50b['description'],'scheduleType':_0x327174[_0x291a76(0x1e5)]!==undefined?_0x327174[_0x291a76(0x1e5)]:_0x23a50b[_0x291a76(0x1e5)],'scheduleOption':_0x327174[_0x291a76(0x1df)]!==undefined?_0x327174[_0x291a76(0x1df)]:_0x23a50b[_0x291a76(0x1df)],'timezone':_0x327174['timezone']!==undefined?_0x327174[_0x291a76(0x1e6)]:_0x23a50b[_0x291a76(0x1e6)],'master':_0x23a50b[_0x291a76(0x1ee)],'attributes':_0x31ac85?[..._0x23a50b[_0x291a76(0x1d0)]||[],..._0x31ac85]:_0x23a50b[_0x291a76(0x1d0)],'behaviors':_0x3addd7?[..._0x23a50b['behaviors']||[],..._0x3addd7]:_0x23a50b['behaviors'],'customerGroup':_0x23a50b[_0x291a76(0x1ed)]},_0x2022b4=await withSpinner(_0x291a76(0x1f1)+_0x54e971+_0x291a76(0x1d2),()=>_0x249815[_0x291a76(0x1c7)][_0x291a76(0x1da)](_0x54e971,_0x4de4bf),{'verbose':_0x327174[_0x291a76(0x1ec)]}),_0x4bf4c8=_0x2022b4[_0x291a76(0x1ea)];return console[_0x291a76(0x1d8)](_0x291a76(0x1e3)+_0x4bf4c8[_0x291a76(0x1d1)]+'\x27'),await handleSDKOutput([_0x4bf4c8],_0x327174),0x0;}}
@@ -1 +1 @@
1
- function a20_0xdda5(_0x1642ff,_0x324444){const _0x3e773f=a20_0x3e77();return a20_0xdda5=function(_0xdda50,_0x5b1c80){_0xdda50=_0xdda50-0x18e;let _0x37729b=_0x3e773f[_0xdda50];return _0x37729b;},a20_0xdda5(_0x1642ff,_0x324444);}function a20_0x3e77(){const _0x4a39ed=['566992EFRAYq','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','error','374TGnqLW','Error:\x20','15TFqRtX','\x20\x20Global:\x20~/.config/tdx/tdx.json','log','map','4883103zmJNHT','List\x20all\x20available\x20profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','name','1559THwRWx','description','1486ISFAzu','20kZkAla','81907cMzLXT','2724lZpswM','4120fXCJQQ','318324DHDrUs','19707220GyEMeq','56qBjluM','config','message'];a20_0x3e77=function(){return _0x4a39ed;};return a20_0x3e77();}const a20_0x3d3356=a20_0xdda5;(function(_0x278af9,_0x31cd6b){const _0x52bddc=a20_0xdda5,_0x3a92ec=_0x278af9();while(!![]){try{const _0x5739e1=parseInt(_0x52bddc(0x18f))/0x1*(parseInt(_0x52bddc(0x191))/0x2)+-parseInt(_0x52bddc(0x1a0))/0x3*(-parseInt(_0x52bddc(0x19b))/0x4)+-parseInt(_0x52bddc(0x195))/0x5*(-parseInt(_0x52bddc(0x194))/0x6)+parseInt(_0x52bddc(0x193))/0x7*(parseInt(_0x52bddc(0x198))/0x8)+-parseInt(_0x52bddc(0x1a4))/0x9*(parseInt(_0x52bddc(0x192))/0xa)+-parseInt(_0x52bddc(0x19e))/0xb*(-parseInt(_0x52bddc(0x196))/0xc)+-parseInt(_0x52bddc(0x197))/0xd;if(_0x5739e1===_0x31cd6b)break;else _0x3a92ec['push'](_0x3a92ec['shift']());}catch(_0x394ec4){_0x3a92ec['push'](_0x3a92ec['shift']());}}}(a20_0x3e77,0x98534));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x3d3356(0x18e)]='profiles';[a20_0x3d3356(0x190)]=a20_0x3d3356(0x1a5);async['execute'](_0x4b458e){const _0xf32c23=a20_0x3d3356,{options:_0x5523fb}=_0x4b458e;try{const _0x2d3d3a=listProfiles(),_0x5f2a4d=getActiveProfile();if(_0x2d3d3a['length']===0x0)return console[_0xf32c23(0x1a2)](_0xf32c23(0x1a6)),console[_0xf32c23(0x1a2)](_0xf32c23(0x19c)),console[_0xf32c23(0x1a2)](_0xf32c23(0x1a1)),0x0;const _0x50f8d5=_0x2d3d3a[_0xf32c23(0x1a3)](_0x205c3d=>{const _0x15d544=_0xf32c23,_0x47deb0=_0x205c3d[_0x15d544(0x18e)]===_0x5f2a4d,_0x2881f0=getProfileParams(_0x205c3d[_0x15d544(0x199)]);return{'name':_0x205c3d['name'],'active':_0x47deb0,'scope':_0x205c3d['scope'],'description':_0x205c3d['config'][_0x15d544(0x190)]||'','params':_0x2881f0};});return await handleSDKOutput(_0x50f8d5,_0x5523fb),0x0;}catch(_0x5f3de){return _0x5f3de instanceof Error&&console[_0xf32c23(0x19d)](_0xf32c23(0x19f)+_0x5f3de[_0xf32c23(0x19a)]),0x1;}}}
1
+ function a20_0x5138(){const _0x49101=['name','map','profiles','370404ornisS','1623096xsQzsb','37130kBsgWl','execute','message','2ettzOE','\x20\x20Global:\x20~/.config/tdx/tdx.json','Error:\x20','361134UNWgqJ','16fTSpmh','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','21WxqtsY','List\x20all\x20available\x20profiles','log','141882KsHWwr','description','143oEYqTH','6497088wUanLQ','config','13064oBxDjV','390KxEvIl','scope'];a20_0x5138=function(){return _0x49101;};return a20_0x5138();}function a20_0x5ded(_0x5ebc5d,_0x10cbb6){const _0x5138b8=a20_0x5138();return a20_0x5ded=function(_0x5ded5b,_0x5a621d){_0x5ded5b=_0x5ded5b-0x15d;let _0x8b0895=_0x5138b8[_0x5ded5b];return _0x8b0895;},a20_0x5ded(_0x5ebc5d,_0x10cbb6);}const a20_0x35216a=a20_0x5ded;(function(_0x3738c7,_0x6adde2){const _0x299ec7=a20_0x5ded,_0x41f9b5=_0x3738c7();while(!![]){try{const _0x3498e2=parseInt(_0x299ec7(0x16b))/0x1+parseInt(_0x299ec7(0x170))/0x2*(-parseInt(_0x299ec7(0x173))/0x3)+-parseInt(_0x299ec7(0x165))/0x4*(parseInt(_0x299ec7(0x166))/0x5)+-parseInt(_0x299ec7(0x160))/0x6*(-parseInt(_0x299ec7(0x15d))/0x7)+parseInt(_0x299ec7(0x174))/0x8*(-parseInt(_0x299ec7(0x16c))/0x9)+parseInt(_0x299ec7(0x16d))/0xa*(-parseInt(_0x299ec7(0x162))/0xb)+parseInt(_0x299ec7(0x163))/0xc;if(_0x3498e2===_0x6adde2)break;else _0x41f9b5['push'](_0x41f9b5['shift']());}catch(_0xbca8ad){_0x41f9b5['push'](_0x41f9b5['shift']());}}}(a20_0x5138,0x3081e));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x35216a(0x168)]=a20_0x35216a(0x16a);[a20_0x35216a(0x161)]=a20_0x35216a(0x15e);async[a20_0x35216a(0x16e)](_0x2aea34){const _0x56faad=a20_0x35216a,{options:_0x57eb4b}=_0x2aea34;try{const _0x5c77c7=listProfiles(),_0x9fdba8=getActiveProfile();if(_0x5c77c7['length']===0x0)return console[_0x56faad(0x15f)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x56faad(0x15f)](_0x56faad(0x175)),console[_0x56faad(0x15f)](_0x56faad(0x171)),0x0;const _0x13c0b5=_0x5c77c7[_0x56faad(0x169)](_0x5b717e=>{const _0x4e3302=_0x56faad,_0x486766=_0x5b717e['name']===_0x9fdba8,_0x592e6a=getProfileParams(_0x5b717e[_0x4e3302(0x164)]);return{'name':_0x5b717e[_0x4e3302(0x168)],'active':_0x486766,'scope':_0x5b717e[_0x4e3302(0x167)],'description':_0x5b717e['config']['description']||'','params':_0x592e6a};});return await handleSDKOutput(_0x13c0b5,_0x57eb4b),0x0;}catch(_0x43d6e1){return _0x43d6e1 instanceof Error&&console['error'](_0x56faad(0x172)+_0x43d6e1[_0x56faad(0x16f)]),0x1;}}}
@@ -1 +1 @@
1
- function a21_0x5345(){const _0x263aa4=['args','../utils/command-output.js','execute','Run\x20Trino\x20queries\x20(streaming)','file','push','name','join','verbose','jobId','processedRows','6771440mQWulR','Query\x20completed:\x20Processed\x20','\x20-\x20','error','1061982Qmhqoy','...','17757LDjSyi','\x20rows\x20','query','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','Site:\x20','database','Executing\x20query\x20[','Statement\x20','catalog','SQL:\x20','\x0aAll\x20results\x20saved\x20to\x20','6aibNao','in\x20','description','Executing\x20query...','18223700jFoFJe','\x20[Job\x20ID:\x20','message','setJobId','Catalog:\x20','setPhase','stats','Executing\x20statement\x20','information_schema','2883545AzOrGM','648AmRvnW','site','totalSplits','Error:\x20','6302952DhmScT','49473vZuQaL','originalMessage','length','274RZJIno','output'];a21_0x5345=function(){return _0x263aa4;};return a21_0x5345();}const a21_0xbb1a16=a21_0x13e7;(function(_0x4db785,_0x440e4f){const _0x512755=a21_0x13e7,_0x4119cf=_0x4db785();while(!![]){try{const _0x5332cf=parseInt(_0x512755(0x207))/0x1+parseInt(_0x512755(0x1f6))/0x2*(parseInt(_0x512755(0x209))/0x3)+-parseInt(_0x512755(0x1f2))/0x4+-parseInt(_0x512755(0x203))/0x5+parseInt(_0x512755(0x1e0))/0x6*(-parseInt(_0x512755(0x1ed))/0x7)+-parseInt(_0x512755(0x1ee))/0x8*(-parseInt(_0x512755(0x1f3))/0x9)+parseInt(_0x512755(0x1e4))/0xa;if(_0x5332cf===_0x440e4f)break;else _0x4119cf['push'](_0x4119cf['shift']());}catch(_0x16bc67){_0x4119cf['push'](_0x4119cf['shift']());}}}(a21_0x5345,0xc2f57));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';function a21_0x13e7(_0x1c5ecc,_0x4bd951){const _0x534594=a21_0x5345();return a21_0x13e7=function(_0x13e7a0,_0x4e2a17){_0x13e7a0=_0x13e7a0-0x1dc;let _0x218d76=_0x534594[_0x13e7a0];return _0x218d76;},a21_0x13e7(_0x1c5ecc,_0x4bd951);}import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a21_0xbb1a16(0x1fe)]=a21_0xbb1a16(0x20b);[a21_0xbb1a16(0x1e2)]=a21_0xbb1a16(0x1fb);async[a21_0xbb1a16(0x1fa)](_0x409d3e){const _0x344553=a21_0xbb1a16,{options:_0xcb2696,args:_0x1d81fe,tdx:_0x48b266}=_0x409d3e,_0x51dfa9=_0x1d81fe[0x0],_0xb1bf9b=_0xcb2696[_0x344553(0x1fc)];let _0x3248e2;if(_0xb1bf9b)try{_0x3248e2=readSqlStatementsFromFile(_0xb1bf9b);}catch(_0x2d414e){return console['error'](_0x344553(0x1f1)+_0x2d414e[_0x344553(0x1e6)]),0x1;}else try{_0x3248e2=splitSqlStatements(_0x51dfa9);}catch(_0x41740d){return console[_0x344553(0x206)](_0x344553(0x1f1)+_0x41740d[_0x344553(0x1e6)]),0x1;}const _0x291401=_0xcb2696[_0x344553(0x20e)]||_0x344553(0x1ec),_0x3fbc9f=_0xcb2696[_0x344553(0x1dd)];try{const _0x1086e8=[],_0x443d6d=!!_0xcb2696[_0x344553(0x1f7)];for(let _0x49936e=0x0;_0x49936e<_0x3248e2[_0x344553(0x1f5)];_0x49936e++){const _0x324796=_0x3248e2[_0x49936e],_0x4f3d2f=_0x49936e+0x1,_0x186b11=_0x3248e2[_0x344553(0x1f5)],_0x494c9a=_0x186b11>0x1;_0xcb2696[_0x344553(0x200)]&&(console[_0x344553(0x206)]('\x0a'+(_0x494c9a?_0x344553(0x1dc)+_0x4f3d2f+'/'+_0x186b11+':':'')),console['error'](_0x344553(0x20d)+_0xcb2696[_0x344553(0x1ef)]),console['error'](_0x344553(0x1e8)+(_0x3fbc9f||'td')),console['error']('Schema:\x20'+_0x291401),console[_0x344553(0x206)](_0x344553(0x1de)+_0x324796));const _0x248b90=_0x494c9a?_0x344553(0x1eb)+_0x4f3d2f+'/'+_0x186b11+_0x344553(0x208):_0x344553(0x1e3);try{const _0x47f9bf=await withQuerySpinner(_0x248b90,async _0x102739=>{const _0x527e84=_0x344553,_0xc6b4d3=await _0x48b266[_0x527e84(0x20b)](_0x324796,{'catalog':_0x3fbc9f,'schema':_0x291401,'onJobId':_0x54143f=>{const _0x3a22bb=_0x527e84;_0x102739[_0x3a22bb(0x1e7)](_0x54143f);},'onProgress':_0x21c932=>{const _0x32f5d1=_0x527e84;_0x102739[_0x32f5d1(0x1e9)](_0x32f5d1(0x20f)+_0x21c932['state']+']'),_0x102739['setExtra'](formatRows(_0x21c932[_0x32f5d1(0x202)])+_0x32f5d1(0x20a)+_0x21c932['completedSplits']+'/'+_0x21c932[_0x32f5d1(0x1f0)]+'\x20splits');}});return _0xc6b4d3;},{'verbose':_0xcb2696[_0x344553(0x200)]}),_0x131253=_0x47f9bf['data'],_0x307f55=_0x131253[_0x344553(0x201)]?_0x344553(0x1e5)+_0x131253[_0x344553(0x201)]+']':'',_0x2cd302=_0x494c9a?'Statement\x20'+_0x4f3d2f+'/'+_0x186b11+_0x344553(0x205):'';console['error']('✔\x20'+_0x2cd302+_0x344553(0x204)+formatRows(_0x131253[_0x344553(0x1ea)][_0x344553(0x202)])+_0x344553(0x20a)+(_0x344553(0x1e1)+formatElapsed(_0x131253[_0x344553(0x1ea)]['elapsedTimeMillis'])+_0x307f55));if(_0x494c9a&&_0x443d6d){const {formatQueryOutput:_0x18645c,resolveOutputOptions:_0x388b2d}=await import(_0x344553(0x1f9)),_0x4100c9=_0x388b2d(_0xcb2696),_0x3c188a=await _0x18645c(_0x131253,_0x4100c9);_0x1086e8[_0x344553(0x1fd)](_0x3c188a);}else await handleQueryOutput(_0x131253,_0xcb2696);}catch(_0x1a5148){const _0x2cd626=_0x494c9a?_0x344553(0x1dc)+_0x4f3d2f+'/'+_0x186b11+':\x0a':'',_0x1f3977=_0x1a5148 instanceof SDKError?_0x1a5148[_0x344553(0x1f4)]:_0x1a5148[_0x344553(0x1e6)];return console[_0x344553(0x206)](''+_0x2cd626+_0x1f3977),0x1;}}if(_0x3248e2['length']>0x1&&_0x443d6d&&_0x1086e8[_0x344553(0x1f5)]>0x0){const _0x2f99d7=_0x1086e8[_0x344553(0x1ff)]('\x0a');writeFileSync(_0xcb2696[_0x344553(0x1f7)],_0x2f99d7),console[_0x344553(0x206)](_0x344553(0x1df)+_0xcb2696[_0x344553(0x1f7)]);}return 0x0;}catch(_0x261c15){throw _0x261c15;}}['validate'](_0x3ad142){const _0x40b5cc=a21_0xbb1a16,_0x2b6e67=_0x3ad142[_0x40b5cc(0x1f8)][0x0],_0x30806c=_0x3ad142['options']['file'];if(!_0x2b6e67&&!_0x30806c)return _0x40b5cc(0x20c);if(_0x2b6e67&&_0x30806c)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
1
+ const a21_0x1f0b26=a21_0x55ca;(function(_0x138479,_0x3bf6df){const _0x48b2f4=a21_0x55ca,_0x140627=_0x138479();while(!![]){try{const _0x1b2efd=-parseInt(_0x48b2f4(0x16b))/0x1*(parseInt(_0x48b2f4(0x189))/0x2)+parseInt(_0x48b2f4(0x165))/0x3*(-parseInt(_0x48b2f4(0x187))/0x4)+-parseInt(_0x48b2f4(0x15c))/0x5+-parseInt(_0x48b2f4(0x166))/0x6+-parseInt(_0x48b2f4(0x17c))/0x7*(-parseInt(_0x48b2f4(0x161))/0x8)+parseInt(_0x48b2f4(0x18a))/0x9*(parseInt(_0x48b2f4(0x169))/0xa)+parseInt(_0x48b2f4(0x185))/0xb;if(_0x1b2efd===_0x3bf6df)break;else _0x140627['push'](_0x140627['shift']());}catch(_0x2c5202){_0x140627['push'](_0x140627['shift']());}}}(a21_0x30f1,0x88c5e));import{BaseCommand}from'./command.js';function a21_0x55ca(_0x3554fe,_0x54374f){const _0x30f106=a21_0x30f1();return a21_0x55ca=function(_0x55caa8,_0x418221){_0x55caa8=_0x55caa8-0x15a;let _0x387b19=_0x30f106[_0x55caa8];return _0x387b19;},a21_0x55ca(_0x3554fe,_0x54374f);}function a21_0x30f1(){const _0x29aa8d=['message','validate','Executing\x20query...','Schema:\x20','data','1092539hMXoIF','Site:\x20','stats','Executing\x20statement\x20','../utils/command-output.js','\x20rows\x20','file','Error:\x20','error','26745092cwaZuR','processedRows','6504AdbQpq','information_schema','2178872vLyhVI','18pjlCSK','Query\x20completed:\x20Processed\x20','join','name','args','2632990iKaWYp','description','verbose','in\x20','output','8kerqhw','Catalog:\x20','\x0aAll\x20results\x20saved\x20to\x20','elapsedTimeMillis','1707uCbDoR','2356806WeACyz','length','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','4534010kgrNXp','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','1KfGhOu','database','Statement\x20','push','originalMessage','jobId','setJobId','state','Executing\x20query\x20[','query','execute','setPhase'];a21_0x30f1=function(){return _0x29aa8d;};return a21_0x30f1();}import{SDKError}from'../sdk/index.js';import{handleQueryOutput}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a21_0x1f0b26(0x15a)]=a21_0x1f0b26(0x174);[a21_0x1f0b26(0x15d)]='Run\x20Trino\x20queries\x20(streaming)';async[a21_0x1f0b26(0x175)](_0x230f4e){const _0x554839=a21_0x1f0b26,{options:_0x3ed46d,args:_0x19e677,tdx:_0x266473}=_0x230f4e,_0x622efd=_0x19e677[0x0],_0x7625b7=_0x3ed46d[_0x554839(0x182)];let _0x10e01f;if(_0x7625b7)try{_0x10e01f=readSqlStatementsFromFile(_0x7625b7);}catch(_0x2c5bf2){return console['error'](_0x554839(0x183)+_0x2c5bf2[_0x554839(0x177)]),0x1;}else try{_0x10e01f=splitSqlStatements(_0x622efd);}catch(_0x4c5c14){return console[_0x554839(0x184)](_0x554839(0x183)+_0x4c5c14[_0x554839(0x177)]),0x1;}const _0x56c361=_0x3ed46d[_0x554839(0x16c)]||_0x554839(0x188),_0x14d5ae=_0x3ed46d['catalog'];try{const _0x4f6d23=[],_0x285397=!!_0x3ed46d[_0x554839(0x160)];for(let _0x4bf437=0x0;_0x4bf437<_0x10e01f[_0x554839(0x167)];_0x4bf437++){const _0x145a74=_0x10e01f[_0x4bf437],_0x353ea9=_0x4bf437+0x1,_0x23e53c=_0x10e01f[_0x554839(0x167)],_0x3f4be1=_0x23e53c>0x1;_0x3ed46d['verbose']&&(console[_0x554839(0x184)]('\x0a'+(_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+':':'')),console[_0x554839(0x184)](_0x554839(0x17d)+_0x3ed46d['site']),console[_0x554839(0x184)](_0x554839(0x162)+(_0x14d5ae||'td')),console[_0x554839(0x184)](_0x554839(0x17a)+_0x56c361),console[_0x554839(0x184)]('SQL:\x20'+_0x145a74));const _0x769f0d=_0x3f4be1?_0x554839(0x17f)+_0x353ea9+'/'+_0x23e53c+'...':_0x554839(0x179);try{const _0x318c55=await withQuerySpinner(_0x769f0d,async _0x362089=>{const _0x1d89b9=_0x554839,_0x563827=await _0x266473[_0x1d89b9(0x174)](_0x145a74,{'catalog':_0x14d5ae,'schema':_0x56c361,'onJobId':_0x1b4272=>{const _0x1efbeb=_0x1d89b9;_0x362089[_0x1efbeb(0x171)](_0x1b4272);},'onProgress':_0x55977a=>{const _0x6b52c7=_0x1d89b9;_0x362089[_0x6b52c7(0x176)](_0x6b52c7(0x173)+_0x55977a[_0x6b52c7(0x172)]+']'),_0x362089['setExtra'](formatRows(_0x55977a[_0x6b52c7(0x186)])+_0x6b52c7(0x181)+_0x55977a['completedSplits']+'/'+_0x55977a['totalSplits']+'\x20splits');}});return _0x563827;},{'verbose':_0x3ed46d[_0x554839(0x15e)]}),_0x1d7bb4=_0x318c55[_0x554839(0x17b)],_0x2c73c2=_0x1d7bb4[_0x554839(0x170)]?'\x20[Job\x20ID:\x20'+_0x1d7bb4[_0x554839(0x170)]+']':'',_0x4832fe=_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+'\x20-\x20':'';console['error']('✔\x20'+_0x4832fe+_0x554839(0x18b)+formatRows(_0x1d7bb4[_0x554839(0x17e)][_0x554839(0x186)])+_0x554839(0x181)+(_0x554839(0x15f)+formatElapsed(_0x1d7bb4[_0x554839(0x17e)][_0x554839(0x164)])+_0x2c73c2));if(_0x3f4be1&&_0x285397){const {formatQueryOutput:_0x280909,resolveOutputOptions:_0x555af5}=await import(_0x554839(0x180)),_0x4db11d=_0x555af5(_0x3ed46d),_0x4c1cca=await _0x280909(_0x1d7bb4,_0x4db11d);_0x4f6d23[_0x554839(0x16e)](_0x4c1cca);}else await handleQueryOutput(_0x1d7bb4,_0x3ed46d);}catch(_0x4f7e9d){const _0x42a12d=_0x3f4be1?_0x554839(0x16d)+_0x353ea9+'/'+_0x23e53c+':\x0a':'',_0x2c6bd6=_0x4f7e9d instanceof SDKError?_0x4f7e9d[_0x554839(0x16f)]:_0x4f7e9d[_0x554839(0x177)];return console['error'](''+_0x42a12d+_0x2c6bd6),0x1;}}if(_0x10e01f[_0x554839(0x167)]>0x1&&_0x285397&&_0x4f6d23[_0x554839(0x167)]>0x0){const _0xd0507b=_0x4f6d23[_0x554839(0x18c)]('\x0a');writeFileSync(_0x3ed46d[_0x554839(0x160)],_0xd0507b),console[_0x554839(0x184)](_0x554839(0x163)+_0x3ed46d['output']);}return 0x0;}catch(_0x4f590e){throw _0x4f590e;}}[a21_0x1f0b26(0x178)](_0x459c80){const _0x5e47b1=a21_0x1f0b26,_0x1072d7=_0x459c80[_0x5e47b1(0x15b)][0x0],_0x265786=_0x459c80['options'][_0x5e47b1(0x182)];if(!_0x1072d7&&!_0x265786)return _0x5e47b1(0x16a);if(_0x1072d7&&_0x265786)return _0x5e47b1(0x168);return undefined;}}
@@ -1 +1 @@
1
- const a22_0x14b7e1=a22_0x25ac;(function(_0x3cfa12,_0x47cd52){const _0xd2da4f=a22_0x25ac,_0x1ac2a1=_0x3cfa12();while(!![]){try{const _0xb453e6=parseInt(_0xd2da4f(0x1f4))/0x1*(-parseInt(_0xd2da4f(0x1c9))/0x2)+parseInt(_0xd2da4f(0x1da))/0x3*(parseInt(_0xd2da4f(0x1a1))/0x4)+parseInt(_0xd2da4f(0x18d))/0x5+-parseInt(_0xd2da4f(0x19d))/0x6+-parseInt(_0xd2da4f(0x1ba))/0x7*(-parseInt(_0xd2da4f(0x1e0))/0x8)+parseInt(_0xd2da4f(0x183))/0x9+parseInt(_0xd2da4f(0x1ab))/0xa*(parseInt(_0xd2da4f(0x1b3))/0xb);if(_0xb453e6===_0x47cd52)break;else _0x1ac2a1['push'](_0x1ac2a1['shift']());}catch(_0x59d00e){_0x1ac2a1['push'](_0x1ac2a1['shift']());}}}(a22_0x4f69,0x4bd78));function a22_0x4f69(){const _0x85d79=['Examples:','Resolved\x20parent\x20folder\x20ID:\x20','verbose','Folder\x20name:\x20','Creating\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Parent\x20ID:\x20','1347756mQcmNd','in\x20','\x20rows\x20','elapsedTimeMillis','32TWeTMs','segment:sql','✔\x20Found\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Parent\x20segment:\x20','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','information_schema','Usage:\x20tdx\x20segment\x20show\x20<path>','22160omiylI','✖\x20Query\x20failed\x20[','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolvePathToResource','Site:\x20','folderId','3388RlcohA','site','segment:describe','data','Fetching\x20SQL\x20for\x20parent\x20segment...','parentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','7XrpJOp','setJobId','length','Resolving\x20path\x20\x27','trim','Error:\x20','segmentId','Resolving\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20folder\x20details...','INTERNAL','resolveFolderId','jsonl','query','getParent','2QIrYjU','segment','format','stats','Resolved\x20parent\x20ID:\x20','listFolders','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','resolveParentId','message','getParentSQL','Resolved\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Path\x20or\x20name\x20is\x20required','createFolder','70539hOJOKD','getSegment','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Query\x20completed:\x20Processed\x20','parentFolder','description','541088otePME','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','jobId','folder','Folder\x20ID:\x20','Show\x20segment\x20folder\x20details','SQL\x20query:\x0a','segment:folder:show','Executing\x20segment\x20query...','parent','segment:show','processedRows','test','\x27...','cause','Resolving\x20parent\x20folder\x20\x27','Fetching\x20segment\x20details...','Fetching\x20parent\x20segment\x20details...','segmentPath','getSegmentSQL','590422absqOd','Segment\x20ID:\x20','125334cZEZsD','execute','getFolder','Resolved\x20type:\x20','name','Usage:\x20tdx\x20segment\x20describe\x20<path>','Parent\x20name:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Resolved\x20relative\x20path\x20to:\x20','867510eImwBF','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','type','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20parent\x20segment\x20\x27','error','Show\x20segment\x20or\x20folder\x20details','includes','\x20\x20Cause:\x20'];a22_0x4f69=function(){return _0x85d79;};return a22_0x4f69();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x25ac(_0x37e3c3,_0x44864c){const _0x4f69f1=a22_0x4f69();return a22_0x25ac=function(_0x25acc8,_0x11b0c4){_0x25acc8=_0x25acc8-0x183;let _0x4cb02a=_0x4f69f1[_0x25acc8];return _0x4cb02a;},a22_0x25ac(_0x37e3c3,_0x44864c);}import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1b5);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x193);async[a22_0x14b7e1(0x184)](_0x4a6a5b){const _0x3bbebd=a22_0x14b7e1,{options:_0x58fd3a,args:_0xd9ca7c,tdx:_0x46e972}=_0x4a6a5b;if(_0xd9ca7c[_0x3bbebd(0x1bc)]===0x0)return console[_0x3bbebd(0x192)](_0x3bbebd(0x1d8)),console[_0x3bbebd(0x192)](_0x3bbebd(0x188)),console[_0x3bbebd(0x192)](_0x3bbebd(0x196)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x3bbebd(0x192)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3bbebd(0x192)](_0x3bbebd(0x1ae)),0x1;try{const _0x260c47=_0xd9ca7c[0x0],_0x1485b0=_0x58fd3a[_0x3bbebd(0x1f2)];let _0x256c14=_0x260c47;_0x1485b0&&!_0x260c47[_0x3bbebd(0x194)]('/')&&(_0x256c14=_0x1485b0+'/'+_0x260c47,_0x58fd3a['verbose']&&console[_0x3bbebd(0x192)](_0x3bbebd(0x18c)+_0x256c14));const _0x28581d=await withSpinner(_0x3bbebd(0x1bd)+_0x256c14+_0x3bbebd(0x1ed),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1b0)](_0x256c14),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]}),_0x328f7c=_0x28581d[_0x3bbebd(0x1b6)];_0x58fd3a[_0x3bbebd(0x198)]&&(console['error'](_0x3bbebd(0x186)+_0x328f7c[_0x3bbebd(0x18f)]),console[_0x3bbebd(0x192)](_0x3bbebd(0x19c)+_0x328f7c['parentId']),_0x328f7c[_0x3bbebd(0x1b2)]&&console['error'](_0x3bbebd(0x1e4)+_0x328f7c[_0x3bbebd(0x1b2)]),_0x328f7c['segmentId']&&console[_0x3bbebd(0x192)](_0x3bbebd(0x1f5)+_0x328f7c['segmentId']));if(_0x328f7c['type']===_0x3bbebd(0x1e9)){const _0x544792=await withSpinner(_0x3bbebd(0x1f1),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1c8)](_0x328f7c[_0x3bbebd(0x1b8)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x544792[_0x3bbebd(0x1b6)]],_0x58fd3a);}else{if(_0x328f7c['type']===_0x3bbebd(0x1e3)){if(!_0x328f7c[_0x3bbebd(0x1b2)])throw new SDKError(ErrorCode[_0x3bbebd(0x1c4)],_0x3bbebd(0x1c2));const _0x2b0e9e=await withSpinner(_0x3bbebd(0x1c3),()=>_0x46e972['segment'][_0x3bbebd(0x185)](_0x328f7c[_0x3bbebd(0x1b2)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x2b0e9e['data']],_0x58fd3a);}else{if(_0x328f7c['type']==='segment'){if(!_0x328f7c[_0x3bbebd(0x1c0)])throw new SDKError(ErrorCode[_0x3bbebd(0x1c4)],_0x3bbebd(0x18a));const _0x1886e5=await withSpinner(_0x3bbebd(0x1f0),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1db)](_0x328f7c['parentId'],_0x328f7c[_0x3bbebd(0x1c0)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x1886e5[_0x3bbebd(0x1b6)]],_0x58fd3a);}}}return 0x0;}catch(_0x51a417){if(_0x51a417 instanceof SDKError)return console[_0x3bbebd(0x192)](_0x3bbebd(0x1bf)+_0x51a417[_0x3bbebd(0x1d3)]),_0x51a417[_0x3bbebd(0x1ee)]&&console['error'](_0x3bbebd(0x195)+_0x51a417['cause']),0x1;throw _0x51a417;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1ea);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1a5);async['execute'](_0x504d46){const _0x3b15df=a22_0x14b7e1,{options:_0x518090,args:_0x1dfe93,tdx:_0x2ee8df}=_0x504d46;if(_0x1dfe93['length']===0x0)return console['error'](_0x3b15df(0x1cf)),console[_0x3b15df(0x192)](_0x3b15df(0x1aa)),console['error'](_0x3b15df(0x196)),console[_0x3b15df(0x192)](_0x3b15df(0x1d1)),console[_0x3b15df(0x192)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3b15df(0x192)](_0x3b15df(0x1a4)),0x1;try{const _0x4f0c46=_0x1dfe93[0x0],_0x46e3f0=_0x518090['segmentPath'];let _0x1d6361=_0x4f0c46;_0x46e3f0&&!_0x4f0c46[_0x3b15df(0x194)]('/')&&(_0x1d6361=_0x46e3f0+'/'+_0x4f0c46,_0x518090[_0x3b15df(0x198)]&&console[_0x3b15df(0x192)]('Resolved\x20relative\x20path\x20to:\x20'+_0x1d6361));const _0x512bef=await withSpinner(_0x3b15df(0x1bd)+_0x1d6361+_0x3b15df(0x1ed),()=>_0x2ee8df['segment'][_0x3b15df(0x1b0)](_0x1d6361),{'verbose':_0x518090[_0x3b15df(0x198)]}),_0x33835c=_0x512bef[_0x3b15df(0x1b6)];_0x518090[_0x3b15df(0x198)]&&(console[_0x3b15df(0x192)](_0x3b15df(0x186)+_0x33835c[_0x3b15df(0x18f)]),console[_0x3b15df(0x192)]('Parent\x20ID:\x20'+_0x33835c[_0x3b15df(0x1b8)]));if(_0x33835c['type']===_0x3b15df(0x1e3))return console[_0x3b15df(0x192)](_0x3b15df(0x1e1)),console[_0x3b15df(0x192)](_0x3b15df(0x1a8)),0x1;let _0x1a1381;if(_0x33835c[_0x3b15df(0x18f)]==='parent'){const _0x1b7edd=await withSpinner(_0x3b15df(0x1b7),()=>_0x2ee8df[_0x3b15df(0x1ca)][_0x3b15df(0x1d4)](_0x33835c[_0x3b15df(0x1b8)]),{'verbose':_0x518090[_0x3b15df(0x198)]});_0x1a1381=_0x1b7edd['data'];}else{if(!_0x33835c[_0x3b15df(0x1c0)])throw new SDKError(ErrorCode[_0x3b15df(0x1c4)],_0x3b15df(0x18a));const _0x58920a=await withSpinner(_0x3b15df(0x1d6),()=>_0x2ee8df[_0x3b15df(0x1ca)]['getSegmentSQL'](_0x33835c[_0x3b15df(0x1b8)],_0x33835c[_0x3b15df(0x1c0)]),{'verbose':_0x518090[_0x3b15df(0x198)]});_0x1a1381=_0x58920a[_0x3b15df(0x1b6)];}const _0x474261=_0x518090['limit'],_0x1cbbfc=/\bLIMIT\s+\d+/i[_0x3b15df(0x1ec)](_0x1a1381);!_0x1cbbfc&&(_0x1a1381=_0x1a1381[_0x3b15df(0x1be)]()['replace'](/;+$/,''),_0x1a1381=_0x3b15df(0x1dc)+_0x1a1381+_0x3b15df(0x190)+_0x474261);_0x518090[_0x3b15df(0x198)]&&console['error'](_0x3b15df(0x1e6)+_0x1a1381);const _0x202444=await withQuerySpinner(_0x3b15df(0x1e8),async _0x3a7a22=>{const _0x4ff6f2=_0x3b15df,_0x4e763e=await _0x2ee8df[_0x4ff6f2(0x1c7)](_0x1a1381,{'catalog':'td','schema':_0x4ff6f2(0x1a9),'onJobId':_0x34b6bf=>{const _0x498a74=_0x4ff6f2;_0x3a7a22[_0x498a74(0x1bb)](_0x34b6bf);}});return _0x4e763e;},{'verbose':_0x518090[_0x3b15df(0x198)]}),_0x1d07c9=_0x202444[_0x3b15df(0x1b6)],_0x3bfba6=_0x1d07c9[_0x3b15df(0x1e2)]?'\x20[Job\x20ID:\x20'+_0x1d07c9['jobId']+']':'';return console[_0x3b15df(0x192)](_0x3b15df(0x1dd)+_0x1d07c9['stats'][_0x3b15df(0x1eb)]['toLocaleString']()+_0x3b15df(0x19f)+(_0x3b15df(0x19e)+formatElapsed(_0x1d07c9[_0x3b15df(0x1cc)][_0x3b15df(0x1a0)])+_0x3bfba6)),await handleQueryOutput(_0x1d07c9,_0x518090),0x0;}catch(_0x4cb028){if(_0x4cb028 instanceof SDKError)return console['error'](_0x3b15df(0x1ac)+_0x4cb028['code']+']'),console[_0x3b15df(0x192)]('\x0a'+_0x4cb028[_0x3b15df(0x1d3)]),0x1;throw _0x4cb028;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1d0);async['execute'](_0x38cdaf){const _0x2efa88=a22_0x14b7e1,{options:_0x12da7e,args:_0x904d31,tdx:_0x15b9c6}=_0x38cdaf;if(_0x904d31[_0x2efa88(0x1bc)]===0x0)return console[_0x2efa88(0x192)](_0x2efa88(0x1b9)),console[_0x2efa88(0x192)](_0x2efa88(0x19b)),0x1;const _0x27e3a6=_0x904d31[0x0];try{_0x12da7e[_0x2efa88(0x198)]&&(console[_0x2efa88(0x192)](_0x2efa88(0x1b1)+_0x12da7e[_0x2efa88(0x1b4)]),console[_0x2efa88(0x192)](_0x2efa88(0x189)+_0x27e3a6));const _0x2d4c8c=await withSpinner(_0x2efa88(0x191)+_0x27e3a6+_0x2efa88(0x1ed),()=>_0x15b9c6[_0x2efa88(0x1ca)]['resolveParentId'](_0x27e3a6),{'verbose':_0x12da7e['verbose']}),_0x1edba7=_0x2d4c8c[_0x2efa88(0x1b6)];_0x12da7e[_0x2efa88(0x198)]&&console[_0x2efa88(0x192)](_0x2efa88(0x1cd)+_0x1edba7);const _0xea6e08=await withSpinner(_0x2efa88(0x1d7)+_0x27e3a6+_0x2efa88(0x1ed),()=>_0x15b9c6[_0x2efa88(0x1ca)][_0x2efa88(0x1ce)](_0x1edba7),{'verbose':_0x12da7e[_0x2efa88(0x198)]}),_0x3e162e=_0xea6e08[_0x2efa88(0x1b6)];return console[_0x2efa88(0x192)](_0x2efa88(0x1a3)+_0x3e162e['length']+'\x20folder'+(_0x3e162e['length']!==0x1?'s':'')),await handleSDKOutput(_0x3e162e,_0x12da7e),0x0;}catch(_0x34f15d){if(_0x34f15d instanceof SDKError)return console[_0x2efa88(0x192)](_0x2efa88(0x1bf)+_0x34f15d[_0x2efa88(0x1d3)]),_0x34f15d[_0x2efa88(0x1ee)]&&console[_0x2efa88(0x192)](_0x2efa88(0x195)+_0x34f15d[_0x2efa88(0x1ee)]),0x1;throw _0x34f15d;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a22_0x14b7e1(0x1e7);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1e5);async['execute'](_0x33e7a4){const _0x123cb9=a22_0x14b7e1,{options:_0x276c76,args:_0x33ecd2,tdx:_0x5199ae}=_0x33e7a4;if(_0x33ecd2[_0x123cb9(0x1bc)]===0x0)return console[_0x123cb9(0x192)](_0x123cb9(0x1a7)),console[_0x123cb9(0x192)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x4369e6,childId:_0x4feaa9}=parseSegmentRef(_0x33ecd2[0x0]);_0x276c76['verbose']&&(console[_0x123cb9(0x192)](_0x123cb9(0x1b1)+_0x276c76[_0x123cb9(0x1b4)]),console[_0x123cb9(0x192)](_0x123cb9(0x189)+_0x4369e6),_0x4feaa9&&console['error']('Folder\x20name:\x20'+_0x4feaa9));if(!_0x4feaa9)return console[_0x123cb9(0x192)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x1b25d4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4369e6+_0x123cb9(0x1ed),()=>_0x5199ae[_0x123cb9(0x1ca)][_0x123cb9(0x1d2)](_0x4369e6),{'verbose':_0x276c76['verbose']}),_0x55c5dc=_0x1b25d4['data'];_0x276c76[_0x123cb9(0x198)]&&console[_0x123cb9(0x192)](_0x123cb9(0x1cd)+_0x55c5dc);const _0x39cb58=await withSpinner(_0x123cb9(0x1c1)+_0x4feaa9+'\x27...',()=>_0x5199ae[_0x123cb9(0x1ca)][_0x123cb9(0x1c5)](_0x55c5dc,_0x4feaa9),{'verbose':_0x276c76[_0x123cb9(0x198)]}),_0x25ffaa=_0x39cb58[_0x123cb9(0x1b6)];_0x276c76[_0x123cb9(0x198)]&&console[_0x123cb9(0x192)](_0x123cb9(0x1d5)+_0x25ffaa);const _0x2c14a9=await withSpinner('Fetching\x20folder\x20\x27'+_0x4feaa9+'\x27...',()=>_0x5199ae[_0x123cb9(0x1ca)]['getFolder'](_0x25ffaa),{'verbose':_0x276c76[_0x123cb9(0x198)]});return await handleSDKOutput([_0x2c14a9[_0x123cb9(0x1b6)]],_0x276c76),0x0;}catch(_0x279d2f){if(_0x279d2f instanceof SDKError)return console['error']('Error:\x20'+_0x279d2f['message']),_0x279d2f['cause']&&console[_0x123cb9(0x192)]('\x20\x20Cause:\x20'+_0x279d2f[_0x123cb9(0x1ee)]),0x1;throw _0x279d2f;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1a2);[a22_0x14b7e1(0x1df)]='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async['execute'](_0x23a57a){const _0x4d68e8=a22_0x14b7e1,{options:_0x4334c1,args:_0x31e420,tdx:_0x3ed2c1}=_0x23a57a;if(_0x31e420[_0x4d68e8(0x1bc)]===0x0)return console[_0x4d68e8(0x192)](_0x4d68e8(0x1cf)),console[_0x4d68e8(0x192)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x4d68e8(0x192)]('Examples:'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x3cb893=_0x31e420[0x0],_0x45b301=_0x4334c1[_0x4d68e8(0x1f2)];let _0x35e528=_0x3cb893;_0x45b301&&!_0x3cb893[_0x4d68e8(0x194)]('/')&&(_0x35e528=_0x45b301+'/'+_0x3cb893,_0x4334c1[_0x4d68e8(0x198)]&&console[_0x4d68e8(0x192)](_0x4d68e8(0x18c)+_0x35e528));const _0x107bf9=await withSpinner('Resolving\x20path\x20\x27'+_0x35e528+'\x27...',()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1b0)](_0x35e528),{'verbose':_0x4334c1[_0x4d68e8(0x198)]}),_0x212abe=_0x107bf9[_0x4d68e8(0x1b6)];_0x4334c1['verbose']&&(console[_0x4d68e8(0x192)]('Resolved\x20type:\x20'+_0x212abe[_0x4d68e8(0x18f)]),console[_0x4d68e8(0x192)](_0x4d68e8(0x19c)+_0x212abe[_0x4d68e8(0x1b8)]));if(_0x212abe[_0x4d68e8(0x18f)]===_0x4d68e8(0x1e3))return console[_0x4d68e8(0x192)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x4d68e8(0x192)](_0x4d68e8(0x18e)),0x1;let _0x4a29c8;if(_0x212abe['type']===_0x4d68e8(0x1e9)){const _0x1b8bb6=await withSpinner(_0x4d68e8(0x1b7),()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1d4)](_0x212abe[_0x4d68e8(0x1b8)]),{'verbose':_0x4334c1[_0x4d68e8(0x198)]});_0x4a29c8=_0x1b8bb6[_0x4d68e8(0x1b6)];}else{if(!_0x212abe[_0x4d68e8(0x1c0)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x58aee9=await withSpinner(_0x4d68e8(0x1d6),()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1f3)](_0x212abe['parentId'],_0x212abe[_0x4d68e8(0x1c0)]),{'verbose':_0x4334c1[_0x4d68e8(0x198)]});_0x4a29c8=_0x58aee9[_0x4d68e8(0x1b6)];}return _0x4334c1[_0x4d68e8(0x1cb)]==='json'||_0x4334c1['format']===_0x4d68e8(0x1c6)?await handleSDKOutput([{'sql':_0x4a29c8}],_0x4334c1):console['log'](_0x4a29c8),0x0;}catch(_0x43a378){if(_0x43a378 instanceof SDKError)return console['error']('Error:\x20'+_0x43a378[_0x4d68e8(0x1d3)]),_0x43a378['cause']&&console[_0x4d68e8(0x192)](_0x4d68e8(0x195)+_0x43a378['cause']),0x1;throw _0x43a378;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x14b7e1(0x187)]='segment:folder:create';[a22_0x14b7e1(0x1df)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x4159c2){const _0x5e0b57=a22_0x14b7e1,{options:_0x3889fe,args:_0x400ef1,tdx:_0x3e378f}=_0x4159c2,_0x50ec8a=_0x3889fe;if(_0x400ef1['length']<0x2)return console[_0x5e0b57(0x192)](_0x5e0b57(0x18b)),console[_0x5e0b57(0x192)](_0x5e0b57(0x1af)),0x1;const _0x519321=_0x400ef1[0x0],_0x3530a4=_0x400ef1[0x1];_0x50ec8a[_0x5e0b57(0x198)]&&(console[_0x5e0b57(0x192)]('Site:\x20'+_0x50ec8a[_0x5e0b57(0x1b4)]),console[_0x5e0b57(0x192)](_0x5e0b57(0x1a6)+_0x519321),console[_0x5e0b57(0x192)](_0x5e0b57(0x199)+_0x3530a4));let _0x15355f;if(_0x50ec8a[_0x5e0b57(0x1de)]){const _0x325b3d=_0x50ec8a[_0x5e0b57(0x1de)],_0x1784b6=await withSpinner(_0x5e0b57(0x191)+_0x519321+_0x5e0b57(0x1ed),()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1d2)](_0x519321),{'verbose':_0x50ec8a[_0x5e0b57(0x198)]}),_0x20e870=_0x1784b6[_0x5e0b57(0x1b6)],_0x495e1a=await withSpinner(_0x5e0b57(0x1ef)+_0x325b3d+'\x27...',()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1c5)](_0x20e870,_0x325b3d),{'verbose':_0x50ec8a['verbose']});_0x15355f=_0x495e1a['data'],_0x50ec8a[_0x5e0b57(0x198)]&&console[_0x5e0b57(0x192)](_0x5e0b57(0x197)+_0x15355f);}const _0x3a194a={'name':_0x3530a4,'description':_0x50ec8a[_0x5e0b57(0x1df)],'parentFolderId':_0x15355f},_0x1ee4c2=await withSpinner(_0x5e0b57(0x19a)+_0x3530a4+_0x5e0b57(0x1ed),()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1d9)](_0x519321,_0x3a194a),{'verbose':_0x50ec8a[_0x5e0b57(0x198)]}),_0x438e24=_0x1ee4c2[_0x5e0b57(0x1b6)];return console[_0x5e0b57(0x192)](_0x5e0b57(0x1ad)+_0x438e24[_0x5e0b57(0x187)]+'\x27\x20with\x20ID:\x20'+_0x438e24['id']),await handleSDKOutput([_0x438e24],_0x50ec8a),0x0;}}
1
+ const a22_0x411ca8=a22_0x1ec7;(function(_0x19e4e8,_0x578ec7){const _0x38e101=a22_0x1ec7,_0x39e8da=_0x19e4e8();while(!![]){try{const _0xb63161=parseInt(_0x38e101(0x101))/0x1*(-parseInt(_0x38e101(0xf1))/0x2)+parseInt(_0x38e101(0x102))/0x3*(-parseInt(_0x38e101(0xe3))/0x4)+parseInt(_0x38e101(0x10c))/0x5+parseInt(_0x38e101(0x13d))/0x6*(-parseInt(_0x38e101(0xda))/0x7)+parseInt(_0x38e101(0x13a))/0x8*(-parseInt(_0x38e101(0x11c))/0x9)+parseInt(_0x38e101(0x11b))/0xa+-parseInt(_0x38e101(0x140))/0xb*(-parseInt(_0x38e101(0xd7))/0xc);if(_0xb63161===_0x578ec7)break;else _0x39e8da['push'](_0x39e8da['shift']());}catch(_0x400e8a){_0x39e8da['push'](_0x39e8da['shift']());}}}(a22_0x5afa,0x526e3));function a22_0x1ec7(_0x513435,_0x406c85){const _0x5afab9=a22_0x5afa();return a22_0x1ec7=function(_0x1ec707,_0x2d0bd3){_0x1ec707=_0x1ec707-0xcb;let _0x45b81f=_0x5afab9[_0x1ec707];return _0x45b81f;},a22_0x1ec7(_0x513435,_0x406c85);}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';export class SegmentDescribeCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0x117);['description']=a22_0x411ca8(0x103);async['execute'](_0x34b88c){const _0x1300e0=a22_0x411ca8,{options:_0x5c96a2,args:_0x531d71,tdx:_0x4885ff}=_0x34b88c;if(_0x531d71[_0x1300e0(0x11d)]===0x0)return console[_0x1300e0(0x128)](_0x1300e0(0xd9)),console[_0x1300e0(0x128)](_0x1300e0(0x108)),console[_0x1300e0(0x128)](_0x1300e0(0x12d)),console[_0x1300e0(0x128)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x1300e0(0x128)](_0x1300e0(0x12a)),console[_0x1300e0(0x128)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x20ce92=_0x531d71[0x0],_0x105069=_0x5c96a2['segmentPath'];let _0x320ef5=_0x20ce92;_0x105069&&!_0x20ce92[_0x1300e0(0x123)]('/')&&(_0x320ef5=_0x105069+'/'+_0x20ce92,_0x5c96a2['verbose']&&console[_0x1300e0(0x128)](_0x1300e0(0xd1)+_0x320ef5));const _0x586431=await withSpinner(_0x1300e0(0x125)+_0x320ef5+'\x27...',()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x130)](_0x320ef5),{'verbose':_0x5c96a2[_0x1300e0(0x104)]}),_0x18fe18=_0x586431[_0x1300e0(0xdb)];_0x5c96a2[_0x1300e0(0x104)]&&(console[_0x1300e0(0x128)](_0x1300e0(0x112)+_0x18fe18['type']),console['error'](_0x1300e0(0x12c)+_0x18fe18[_0x1300e0(0x107)]),_0x18fe18[_0x1300e0(0x122)]&&console[_0x1300e0(0x128)](_0x1300e0(0x106)+_0x18fe18[_0x1300e0(0x122)]),_0x18fe18[_0x1300e0(0xe9)]&&console[_0x1300e0(0x128)](_0x1300e0(0xd0)+_0x18fe18[_0x1300e0(0xe9)]));if(_0x18fe18[_0x1300e0(0x109)]==='parent'){const _0x5471ad=await withSpinner(_0x1300e0(0xe1),()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x136)](_0x18fe18[_0x1300e0(0x107)]),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x5471ad[_0x1300e0(0xdb)]],_0x5c96a2);}else{if(_0x18fe18[_0x1300e0(0x109)]===_0x1300e0(0xdc)){if(!_0x18fe18[_0x1300e0(0x122)])throw new SDKError(ErrorCode[_0x1300e0(0xf0)],_0x1300e0(0x10d));const _0x52a65d=await withSpinner(_0x1300e0(0xfb),()=>_0x4885ff[_0x1300e0(0x134)]['getFolder'](_0x18fe18['folderId']),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x52a65d[_0x1300e0(0xdb)]],_0x5c96a2);}else{if(_0x18fe18['type']===_0x1300e0(0x134)){if(!_0x18fe18[_0x1300e0(0xe9)])throw new SDKError(ErrorCode['INTERNAL'],_0x1300e0(0x133));const _0x238f99=await withSpinner(_0x1300e0(0xd8),()=>_0x4885ff[_0x1300e0(0x134)][_0x1300e0(0x12e)](_0x18fe18[_0x1300e0(0x107)],_0x18fe18['segmentId']),{'verbose':_0x5c96a2[_0x1300e0(0x104)]});await handleSDKOutput([_0x238f99[_0x1300e0(0xdb)]],_0x5c96a2);}}}return 0x0;}catch(_0x36afa6){if(_0x36afa6 instanceof SDKError)return console[_0x1300e0(0x128)](_0x1300e0(0xd5)+_0x36afa6[_0x1300e0(0xdf)]),_0x36afa6[_0x1300e0(0xd4)]&&console[_0x1300e0(0x128)](_0x1300e0(0x11f)+_0x36afa6[_0x1300e0(0xd4)]),0x1;throw _0x36afa6;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xef);[a22_0x411ca8(0xe2)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a22_0x411ca8(0x10a)](_0x3db8d8){const _0x51c945=a22_0x411ca8,{options:_0x3106f0,args:_0xd718a0,tdx:_0x22dea4}=_0x3db8d8;if(_0xd718a0[_0x51c945(0x11d)]===0x0)return console[_0x51c945(0x128)](_0x51c945(0xdd)),console['error'](_0x51c945(0xd6)),console['error'](_0x51c945(0x12d)),console[_0x51c945(0x128)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x51c945(0x128)](_0x51c945(0x120)),console[_0x51c945(0x128)](_0x51c945(0xf4)),0x1;try{const _0x362308=_0xd718a0[0x0],_0x5e7775=_0x3106f0[_0x51c945(0x126)];let _0x55b32d=_0x362308;_0x5e7775&&!_0x362308[_0x51c945(0x123)]('/')&&(_0x55b32d=_0x5e7775+'/'+_0x362308,_0x3106f0[_0x51c945(0x104)]&&console[_0x51c945(0x128)]('Resolved\x20relative\x20path\x20to:\x20'+_0x55b32d));const _0x567e56=await withSpinner('Resolving\x20path\x20\x27'+_0x55b32d+'\x27...',()=>_0x22dea4[_0x51c945(0x134)][_0x51c945(0x130)](_0x55b32d),{'verbose':_0x3106f0['verbose']}),_0x268791=_0x567e56[_0x51c945(0xdb)];_0x3106f0[_0x51c945(0x104)]&&(console[_0x51c945(0x128)]('Resolved\x20type:\x20'+_0x268791[_0x51c945(0x109)]),console[_0x51c945(0x128)](_0x51c945(0x12c)+_0x268791[_0x51c945(0x107)]));if(_0x268791[_0x51c945(0x109)]===_0x51c945(0xdc))return console[_0x51c945(0x128)](_0x51c945(0x13c)),console[_0x51c945(0x128)](_0x51c945(0x10b)),0x1;let _0x287b62;if(_0x268791['type']==='parent'){const _0x56c668=await withSpinner(_0x51c945(0x13e),()=>_0x22dea4[_0x51c945(0x134)]['getParentSQL'](_0x268791[_0x51c945(0x107)]),{'verbose':_0x3106f0[_0x51c945(0x104)]});_0x287b62=_0x56c668[_0x51c945(0xdb)];}else{if(!_0x268791[_0x51c945(0xe9)])throw new SDKError(ErrorCode[_0x51c945(0xf0)],_0x51c945(0x133));const _0x527d5d=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x22dea4[_0x51c945(0x134)][_0x51c945(0xfa)](_0x268791['parentId'],_0x268791[_0x51c945(0xe9)]),{'verbose':_0x3106f0[_0x51c945(0x104)]});_0x287b62=_0x527d5d['data'];}const _0x5ef0dd=_0x3106f0[_0x51c945(0x10f)],_0x3f702c=/\bLIMIT\s+\d+/i['test'](_0x287b62);!_0x3f702c&&(_0x287b62=_0x287b62['trim']()[_0x51c945(0xe4)](/;+$/,''),_0x287b62=_0x51c945(0xe7)+_0x287b62+_0x51c945(0x12b)+_0x5ef0dd);_0x3106f0[_0x51c945(0x104)]&&console[_0x51c945(0x128)](_0x51c945(0x124)+_0x287b62);const _0x3ea9c6=await withQuerySpinner('Executing\x20segment\x20query...',async _0x3b9757=>{const _0xfa0afd=_0x51c945,_0x18eb30=await _0x22dea4[_0xfa0afd(0x139)](_0x287b62,{'catalog':'td','schema':_0xfa0afd(0x127),'onJobId':_0x58a643=>{_0x3b9757['setJobId'](_0x58a643);}});return _0x18eb30;},{'verbose':_0x3106f0['verbose']}),_0x451602=_0x3ea9c6[_0x51c945(0xdb)],_0x31adcf=_0x451602[_0x51c945(0x135)]?_0x51c945(0x11e)+_0x451602['jobId']+']':'';return console[_0x51c945(0x128)](_0x51c945(0xea)+_0x451602[_0x51c945(0x138)][_0x51c945(0xfd)][_0x51c945(0xcb)]()+_0x51c945(0x12f)+(_0x51c945(0xf5)+formatElapsed(_0x451602[_0x51c945(0x138)][_0x51c945(0xd2)])+_0x31adcf)),await handleQueryOutput(_0x451602,_0x3106f0),0x0;}catch(_0x3940a2){if(_0x3940a2 instanceof SDKError)return console['error']('✖\x20Query\x20failed\x20['+_0x3940a2[_0x51c945(0x10e)]+']'),console['error']('\x0a'+_0x3940a2[_0x51c945(0xdf)]),0x1;throw _0x3940a2;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0x115);[a22_0x411ca8(0xe2)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a22_0x411ca8(0x10a)](_0x1ef747){const _0x3ca105=a22_0x411ca8,{options:_0x26c031,args:_0x55fcdb,tdx:_0xdf2c1f}=_0x1ef747;if(_0x55fcdb[_0x3ca105(0x11d)]===0x0)return console[_0x3ca105(0x128)](_0x3ca105(0xed)),console[_0x3ca105(0x128)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x2476be=_0x55fcdb[0x0];try{_0x26c031[_0x3ca105(0x104)]&&(console[_0x3ca105(0x128)](_0x3ca105(0xcc)+_0x26c031[_0x3ca105(0xfc)]),console[_0x3ca105(0x128)](_0x3ca105(0xde)+_0x2476be));const _0x4e1227=await withSpinner(_0x3ca105(0xf8)+_0x2476be+_0x3ca105(0x118),()=>_0xdf2c1f[_0x3ca105(0x134)][_0x3ca105(0xf9)](_0x2476be),{'verbose':_0x26c031[_0x3ca105(0x104)]}),_0x27db7e=_0x4e1227[_0x3ca105(0xdb)];_0x26c031[_0x3ca105(0x104)]&&console[_0x3ca105(0x128)](_0x3ca105(0x119)+_0x27db7e);const _0x43baa6=await withSpinner(_0x3ca105(0xce)+_0x2476be+_0x3ca105(0x118),()=>_0xdf2c1f[_0x3ca105(0x134)]['listFolders'](_0x27db7e),{'verbose':_0x26c031['verbose']}),_0x1a8999=_0x43baa6['data'];return console[_0x3ca105(0x128)](_0x3ca105(0x11a)+_0x1a8999[_0x3ca105(0x11d)]+'\x20folder'+(_0x1a8999[_0x3ca105(0x11d)]!==0x1?'s':'')),await handleSDKOutput(_0x1a8999,_0x26c031),0x0;}catch(_0x5f5203){if(_0x5f5203 instanceof SDKError)return console[_0x3ca105(0x128)](_0x3ca105(0xd5)+_0x5f5203['message']),_0x5f5203[_0x3ca105(0xd4)]&&console[_0x3ca105(0x128)](_0x3ca105(0x11f)+_0x5f5203[_0x3ca105(0xd4)]),0x1;throw _0x5f5203;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xcf);[a22_0x411ca8(0xe2)]=a22_0x411ca8(0x100);async[a22_0x411ca8(0x10a)](_0x553bbe){const _0x46e8fd=a22_0x411ca8,{options:_0x47ae89,args:_0x92ac80,tdx:_0x2da2f5}=_0x553bbe;if(_0x92ac80[_0x46e8fd(0x11d)]===0x0)return console['error'](_0x46e8fd(0x110)),console[_0x46e8fd(0x128)](_0x46e8fd(0x129)),0x1;try{const {parentId:_0x52b42,childId:_0x554fbe}=parseSegmentRef(_0x92ac80[0x0]);_0x47ae89[_0x46e8fd(0x104)]&&(console[_0x46e8fd(0x128)]('Site:\x20'+_0x47ae89[_0x46e8fd(0xfc)]),console['error'](_0x46e8fd(0xde)+_0x52b42),_0x554fbe&&console[_0x46e8fd(0x128)](_0x46e8fd(0xee)+_0x554fbe));if(!_0x554fbe)return console[_0x46e8fd(0x128)](_0x46e8fd(0x114)),0x1;const _0x144ad6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x52b42+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)][_0x46e8fd(0xf9)](_0x52b42),{'verbose':_0x47ae89[_0x46e8fd(0x104)]}),_0x47038a=_0x144ad6[_0x46e8fd(0xdb)];_0x47ae89[_0x46e8fd(0x104)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0x119)+_0x47038a);const _0x2d6f58=await withSpinner(_0x46e8fd(0xec)+_0x554fbe+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)]['resolveFolderId'](_0x47038a,_0x554fbe),{'verbose':_0x47ae89[_0x46e8fd(0x104)]}),_0x5a9a8b=_0x2d6f58[_0x46e8fd(0xdb)];_0x47ae89[_0x46e8fd(0x104)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0xff)+_0x5a9a8b);const _0x3b241d=await withSpinner(_0x46e8fd(0x105)+_0x554fbe+_0x46e8fd(0x118),()=>_0x2da2f5[_0x46e8fd(0x134)][_0x46e8fd(0xd3)](_0x5a9a8b),{'verbose':_0x47ae89[_0x46e8fd(0x104)]});return await handleSDKOutput([_0x3b241d[_0x46e8fd(0xdb)]],_0x47ae89),0x0;}catch(_0x4025fe){if(_0x4025fe instanceof SDKError)return console[_0x46e8fd(0x128)](_0x46e8fd(0xd5)+_0x4025fe['message']),_0x4025fe[_0x46e8fd(0xd4)]&&console[_0x46e8fd(0x128)](_0x46e8fd(0x11f)+_0x4025fe[_0x46e8fd(0xd4)]),0x1;throw _0x4025fe;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x411ca8(0xf2)]=a22_0x411ca8(0xe8);['description']=a22_0x411ca8(0xeb);async['execute'](_0x2e22d9){const _0x199f05=a22_0x411ca8,{options:_0x3641c4,args:_0x342d8c,tdx:_0x250fc7}=_0x2e22d9;if(_0x342d8c[_0x199f05(0x11d)]===0x0)return console[_0x199f05(0x128)](_0x199f05(0xdd)),console['error'](_0x199f05(0x113)),console[_0x199f05(0x128)]('Examples:'),console[_0x199f05(0x128)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console['error'](_0x199f05(0xfe)),console[_0x199f05(0x128)](_0x199f05(0x13b)),0x1;try{const _0x14718e=_0x342d8c[0x0],_0x3fa4ff=_0x3641c4[_0x199f05(0x126)];let _0x2c7662=_0x14718e;_0x3fa4ff&&!_0x14718e['includes']('/')&&(_0x2c7662=_0x3fa4ff+'/'+_0x14718e,_0x3641c4[_0x199f05(0x104)]&&console[_0x199f05(0x128)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2c7662));const _0xd12287=await withSpinner(_0x199f05(0x125)+_0x2c7662+_0x199f05(0x118),()=>_0x250fc7[_0x199f05(0x134)][_0x199f05(0x130)](_0x2c7662),{'verbose':_0x3641c4[_0x199f05(0x104)]}),_0x22ac60=_0xd12287['data'];_0x3641c4[_0x199f05(0x104)]&&(console[_0x199f05(0x128)]('Resolved\x20type:\x20'+_0x22ac60[_0x199f05(0x109)]),console['error']('Parent\x20ID:\x20'+_0x22ac60[_0x199f05(0x107)]));if(_0x22ac60[_0x199f05(0x109)]===_0x199f05(0xdc))return console[_0x199f05(0x128)](_0x199f05(0x137)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x494771;if(_0x22ac60[_0x199f05(0x109)]===_0x199f05(0x131)){const _0x4e0a81=await withSpinner(_0x199f05(0x13e),()=>_0x250fc7[_0x199f05(0x134)][_0x199f05(0x121)](_0x22ac60['parentId']),{'verbose':_0x3641c4[_0x199f05(0x104)]});_0x494771=_0x4e0a81[_0x199f05(0xdb)];}else{if(!_0x22ac60[_0x199f05(0xe9)])throw new SDKError(ErrorCode['INTERNAL'],_0x199f05(0x133));const _0x10de6c=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x250fc7['segment'][_0x199f05(0xfa)](_0x22ac60[_0x199f05(0x107)],_0x22ac60[_0x199f05(0xe9)]),{'verbose':_0x3641c4[_0x199f05(0x104)]});_0x494771=_0x10de6c[_0x199f05(0xdb)];}return _0x3641c4[_0x199f05(0xf3)]===_0x199f05(0xe0)||_0x3641c4[_0x199f05(0xf3)]===_0x199f05(0xcd)?await handleSDKOutput([{'sql':_0x494771}],_0x3641c4):console[_0x199f05(0xf6)](_0x494771),0x0;}catch(_0x17fd0a){if(_0x17fd0a instanceof SDKError)return console[_0x199f05(0x128)](_0x199f05(0xd5)+_0x17fd0a['message']),_0x17fd0a[_0x199f05(0xd4)]&&console[_0x199f05(0x128)]('\x20\x20Cause:\x20'+_0x17fd0a[_0x199f05(0xd4)]),0x1;throw _0x17fd0a;}}}function a22_0x5afa(){const _0x38e764=['segment','jobId','getParent','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','stats','query','31568XAkbwS','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','14172hawegY','Fetching\x20SQL\x20for\x20parent\x20segment...','Parent\x20segment:\x20','451ehxArv','toLocaleString','Site:\x20','jsonl','Listing\x20folders\x20for\x20parent\x20\x27','segment:folder:show','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','elapsedTimeMillis','getFolder','cause','Error:\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','265884qwFhdS','Fetching\x20segment\x20details...','Error:\x20Path\x20or\x20name\x20is\x20required','287GDXIAw','data','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20name:\x20','message','json','Fetching\x20parent\x20segment\x20details...','description','48wThrXN','replace','Resolved\x20parent\x20folder\x20ID:\x20','✔\x20Created\x20folder\x20\x27','SELECT\x20*\x20FROM\x20(\x0a','segment:sql','segmentId','✔\x20Query\x20completed:\x20Processed\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Resolving\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','Folder\x20name:\x20','segment:show','INTERNAL','554liDeML','name','format','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','in\x20','log','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','resolveParentId','getSegmentSQL','Fetching\x20folder\x20details...','site','processedRows','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20folder\x20ID:\x20','Show\x20segment\x20folder\x20details','787PLEqQj','51855ArcxBU','Show\x20segment\x20or\x20folder\x20details','verbose','Fetching\x20folder\x20\x27','Folder\x20ID:\x20','parentId','Usage:\x20tdx\x20segment\x20describe\x20<path>','type','execute','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','2561565qYrhLS','Folder\x20ID\x20missing\x20from\x20resolved\x20path','code','limit','Error:\x20Folder\x20reference\x20is\x20required','createFolder','Resolved\x20type:\x20','Usage:\x20tdx\x20segment\x20sql\x20<path>','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segment:describe','\x27...','Resolved\x20parent\x20ID:\x20','✔\x20Found\x20','823440ppIFhI','1467dTYxfR','length','\x20[Job\x20ID:\x20','\x20\x20Cause:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getParentSQL','folderId','includes','SQL\x20query:\x0a','Resolving\x20path\x20\x27','segmentPath','information_schema','error','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20ID:\x20','Examples:','getSegment','\x20rows\x20','resolvePathToResource','parent','parentFolder','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a22_0x5afa=function(){return _0x38e764;};return a22_0x5afa();}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a22_0x411ca8(0xe2)]='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x411ca8(0x10a)](_0x3a3521){const _0x633a0f=a22_0x411ca8,{options:_0x2044dc,args:_0xa244e8,tdx:_0xf7f0db}=_0x3a3521,_0x179098=_0x2044dc;if(_0xa244e8[_0x633a0f(0x11d)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x633a0f(0x116)),0x1;const _0x359e19=_0xa244e8[0x0],_0x2cd29c=_0xa244e8[0x1];_0x179098['verbose']&&(console['error']('Site:\x20'+_0x179098[_0x633a0f(0xfc)]),console['error'](_0x633a0f(0x13f)+_0x359e19),console[_0x633a0f(0x128)](_0x633a0f(0xee)+_0x2cd29c));let _0x575990;if(_0x179098[_0x633a0f(0x132)]){const _0x353d0d=_0x179098[_0x633a0f(0x132)],_0x19933e=await withSpinner(_0x633a0f(0xf8)+_0x359e19+_0x633a0f(0x118),()=>_0xf7f0db['segment'][_0x633a0f(0xf9)](_0x359e19),{'verbose':_0x179098[_0x633a0f(0x104)]}),_0x35d470=_0x19933e[_0x633a0f(0xdb)],_0x5af6b0=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x353d0d+_0x633a0f(0x118),()=>_0xf7f0db[_0x633a0f(0x134)]['resolveFolderId'](_0x35d470,_0x353d0d),{'verbose':_0x179098['verbose']});_0x575990=_0x5af6b0[_0x633a0f(0xdb)],_0x179098[_0x633a0f(0x104)]&&console[_0x633a0f(0x128)](_0x633a0f(0xe5)+_0x575990);}const _0x1aa519={'name':_0x2cd29c,'description':_0x179098[_0x633a0f(0xe2)],'parentFolderId':_0x575990},_0x577424=await withSpinner('Creating\x20folder\x20\x27'+_0x2cd29c+_0x633a0f(0x118),()=>_0xf7f0db[_0x633a0f(0x134)][_0x633a0f(0x111)](_0x359e19,_0x1aa519),{'verbose':_0x179098[_0x633a0f(0x104)]}),_0x2c6a38=_0x577424[_0x633a0f(0xdb)];return console['error'](_0x633a0f(0xe6)+_0x2c6a38[_0x633a0f(0xf2)]+_0x633a0f(0xf7)+_0x2c6a38['id']),await handleSDKOutput([_0x2c6a38],_0x179098),0x0;}}
@@ -1 +1 @@
1
- const a23_0x19a1af=a23_0xd175;(function(_0x2e135d,_0x663958){const _0x45ae55=a23_0xd175,_0x561cc0=_0x2e135d();while(!![]){try{const _0x391daf=-parseInt(_0x45ae55(0x1fc))/0x1*(parseInt(_0x45ae55(0x1e4))/0x2)+parseInt(_0x45ae55(0x209))/0x3+parseInt(_0x45ae55(0x208))/0x4+parseInt(_0x45ae55(0x1f2))/0x5*(parseInt(_0x45ae55(0x1eb))/0x6)+parseInt(_0x45ae55(0x204))/0x7*(-parseInt(_0x45ae55(0x1e7))/0x8)+parseInt(_0x45ae55(0x1f4))/0x9+-parseInt(_0x45ae55(0x1fe))/0xa;if(_0x391daf===_0x663958)break;else _0x561cc0['push'](_0x561cc0['shift']());}catch(_0x462183){_0x561cc0['push'](_0x561cc0['shift']());}}}(a23_0x408f,0x678de));import{BaseCommand}from'./command.js';function a23_0x408f(){const _0x237912=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','\x20\x20\x20Path:\x20','execute','invisible','type','Creating\x20segment\x20\x27','244eBtzSz','resolveFolderId','resolvePathToResource','260152hxxtlF','Examples:','parent','createSegment','930ZdpbyM','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent:\x20','folder','\x27...','description','ruleFile','20665QhCKDW','Site:\x20','1241685kiQOjV','error','Resolved\x20relative\x20path\x20to:\x20','segment','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','site','name','4000buuCLE','Parent\x20path:\x20','943530qwVFWd','data','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Segment\x20name:\x20','noCountPopulation','rule','175fbxHmH','verbose','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','3304124RvMFUy','644625qNiMVy','length','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segments','kind','\x27\x20with\x20ID:\x20'];a23_0x408f=function(){return _0x237912;};return a23_0x408f();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a23_0xd175(_0x3fc8e7,_0x5bc5b2){const _0x408f90=a23_0x408f();return a23_0xd175=function(_0xd1755e,_0x2ca9e1){_0xd1755e=_0xd1755e-0x1de;let _0xde8712=_0x408f90[_0xd1755e];return _0xde8712;},a23_0xd175(_0x3fc8e7,_0x5bc5b2);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a23_0x19a1af(0x1f0)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a23_0x19a1af(0x1e0)](_0x51ca16){const _0xee6a22=a23_0x19a1af,{options:_0x162bec,args:_0x2f2c0d,tdx:_0x4815cd}=_0x51ca16,_0x5c1d40=_0x162bec;if(_0x2f2c0d[_0xee6a22(0x20a)]===0x0)return console[_0xee6a22(0x1f5)](_0xee6a22(0x1ec)),console[_0xee6a22(0x1f5)](_0xee6a22(0x206)),console[_0xee6a22(0x1f5)](_0xee6a22(0x1e8)),console[_0xee6a22(0x1f5)](_0xee6a22(0x207)),console[_0xee6a22(0x1f5)](_0xee6a22(0x1de)),console[_0xee6a22(0x1f5)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x160626=_0x2f2c0d[0x0],_0x50925f=_0x162bec['segmentPath'];let _0x17f674=_0x160626;_0x50925f&&!_0x160626['includes']('/')&&(_0x17f674=_0x50925f+'/'+_0x160626,_0x5c1d40[_0xee6a22(0x205)]&&console['error'](_0xee6a22(0x1f6)+_0x17f674));const _0x55de20=parsePath(_0x17f674);if(_0x55de20[_0xee6a22(0x20c)][_0xee6a22(0x20a)]<0x2)return console[_0xee6a22(0x1f5)](_0xee6a22(0x20b)),console[_0xee6a22(0x1f5)](_0xee6a22(0x200)),0x1;const _0x56896f=_0x55de20['segments'][0x0],_0x53949f=getBaseName(_0x17f674),_0x5a2917=getParentPath(_0x17f674);_0x5c1d40['verbose']&&(console[_0xee6a22(0x1f5)](_0xee6a22(0x1f3)+_0x5c1d40[_0xee6a22(0x1fa)]),console[_0xee6a22(0x1f5)]('Target\x20path:\x20'+_0x17f674),console[_0xee6a22(0x1f5)](_0xee6a22(0x1ed)+_0x56896f),console[_0xee6a22(0x1f5)](_0xee6a22(0x201)+_0x53949f),console[_0xee6a22(0x1f5)](_0xee6a22(0x1fd)+_0x5a2917));const _0x507b9d=await withSpinner(_0xee6a22(0x1f8)+_0x56896f+_0xee6a22(0x1ef),()=>_0x4815cd[_0xee6a22(0x1f7)]['resolveParentId'](_0x56896f),{'verbose':_0x5c1d40['verbose']}),_0x579871=_0x507b9d['data'];let _0x211400;if(_0x55de20['segments'][_0xee6a22(0x20a)]>0x2){const _0x15fde8=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x5a2917+_0xee6a22(0x1ef),()=>_0x4815cd[_0xee6a22(0x1f7)][_0xee6a22(0x1e6)](_0x5a2917),{'verbose':_0x5c1d40[_0xee6a22(0x205)]}),_0x11cd77=_0x15fde8['data'];if(_0x11cd77[_0xee6a22(0x1e2)]!==_0xee6a22(0x1ee)&&_0x11cd77[_0xee6a22(0x1e2)]!==_0xee6a22(0x1e9))return console[_0xee6a22(0x1f5)](_0xee6a22(0x1f9)),0x1;_0x211400=_0x11cd77['folderId'];}else{if(_0x5c1d40['folder']){const _0xb708ab=await withSpinner('Resolving\x20folder\x20\x27'+_0x5c1d40['folder']+_0xee6a22(0x1ef),()=>_0x4815cd[_0xee6a22(0x1f7)][_0xee6a22(0x1e5)](_0x579871,_0x5c1d40[_0xee6a22(0x1ee)]),{'verbose':_0x5c1d40[_0xee6a22(0x205)]});_0x211400=_0xb708ab[_0xee6a22(0x1ff)];}}_0x5c1d40[_0xee6a22(0x205)]&&_0x211400&&console[_0xee6a22(0x1f5)]('Resolved\x20folder\x20ID:\x20'+_0x211400);const _0xf0638=await loadJSONFromOptions(_0x5c1d40[_0xee6a22(0x203)],_0x5c1d40[_0xee6a22(0x1f1)]),_0x30e416={'name':_0x53949f,'description':_0x5c1d40[_0xee6a22(0x1f0)],'rule':_0xf0638,'kind':_0x5c1d40['kind']!==undefined?parseInt(_0x5c1d40[_0xee6a22(0x20d)],0xa):undefined,'isVisible':_0x5c1d40[_0xee6a22(0x1e1)]?![]:undefined,'segmentFolderId':_0x211400,'countPopulation':_0x5c1d40[_0xee6a22(0x202)]?![]:undefined},_0x3f6131=await withSpinner(_0xee6a22(0x1e3)+_0x53949f+_0xee6a22(0x1ef),()=>_0x4815cd['segment'][_0xee6a22(0x1ea)](_0x579871,_0x30e416),{'verbose':_0x5c1d40['verbose']}),_0x22a49d=_0x3f6131[_0xee6a22(0x1ff)];return console[_0xee6a22(0x1f5)]('✔\x20Created\x20segment\x20\x27'+_0x22a49d[_0xee6a22(0x1fb)]+_0xee6a22(0x20e)+_0x22a49d['id']),_0x17f674!==_0x160626&&console[_0xee6a22(0x1f5)](_0xee6a22(0x1df)+_0x17f674),await handleSDKOutput([_0x22a49d],_0x5c1d40),0x0;}}
1
+ const a23_0x43a657=a23_0x26df;(function(_0x5d4cfc,_0x2c6eee){const _0x569e75=a23_0x26df,_0x2daac2=_0x5d4cfc();while(!![]){try{const _0x2042a5=-parseInt(_0x569e75(0x117))/0x1+-parseInt(_0x569e75(0xf1))/0x2*(-parseInt(_0x569e75(0x104))/0x3)+parseInt(_0x569e75(0x112))/0x4+-parseInt(_0x569e75(0xf9))/0x5+parseInt(_0x569e75(0xf4))/0x6+parseInt(_0x569e75(0x101))/0x7*(-parseInt(_0x569e75(0x109))/0x8)+-parseInt(_0x569e75(0x111))/0x9*(-parseInt(_0x569e75(0x114))/0xa);if(_0x2042a5===_0x2c6eee)break;else _0x2daac2['push'](_0x2daac2['shift']());}catch(_0x32b074){_0x2daac2['push'](_0x2daac2['shift']());}}}(a23_0x44e5,0xcc20c));import{BaseCommand}from'./command.js';function a23_0x26df(_0x305635,_0x47a499){const _0x44e5b4=a23_0x44e5();return a23_0x26df=function(_0x26df72,_0x5c9c57){_0x26df72=_0x26df72-0xea;let _0x54941a=_0x44e5b4[_0x26df72];return _0x54941a;},a23_0x26df(_0x305635,_0x47a499);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x43a657(0xef)]=a23_0x43a657(0xf6);[a23_0x43a657(0xeb)]=a23_0x43a657(0xfa);async[a23_0x43a657(0xf0)](_0x14fc89){const _0x173704=a23_0x43a657,{options:_0x110b4c,args:_0x1979b5,tdx:_0x56d797}=_0x14fc89,_0x2dc352=_0x110b4c;if(_0x1979b5[_0x173704(0x110)]===0x0)return console[_0x173704(0xea)](_0x173704(0x102)),console[_0x173704(0xea)](_0x173704(0x116)),console[_0x173704(0xea)](_0x173704(0x113)),console[_0x173704(0xea)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x173704(0xea)](_0x173704(0xf7)),console[_0x173704(0xea)](_0x173704(0xed)),0x1;const _0x5e81dd=_0x1979b5[0x0],_0x99540a=_0x110b4c['segmentPath'];let _0x136bf6=_0x5e81dd;_0x99540a&&!_0x5e81dd[_0x173704(0x10c)]('/')&&(_0x136bf6=_0x99540a+'/'+_0x5e81dd,_0x2dc352[_0x173704(0x115)]&&console[_0x173704(0xea)]('Resolved\x20relative\x20path\x20to:\x20'+_0x136bf6));const _0x30ae8f=parsePath(_0x136bf6);if(_0x30ae8f[_0x173704(0xf8)][_0x173704(0x110)]<0x2)return console[_0x173704(0xea)](_0x173704(0xec)),console['error'](_0x173704(0x10d)),0x1;const _0x10125b=_0x30ae8f[_0x173704(0xf8)][0x0],_0x550b4a=getBaseName(_0x136bf6),_0x3a31d=getParentPath(_0x136bf6);_0x2dc352['verbose']&&(console['error']('Site:\x20'+_0x2dc352[_0x173704(0xee)]),console['error'](_0x173704(0x106)+_0x136bf6),console[_0x173704(0xea)](_0x173704(0x10a)+_0x10125b),console[_0x173704(0xea)]('Segment\x20name:\x20'+_0x550b4a),console[_0x173704(0xea)]('Parent\x20path:\x20'+_0x3a31d));const _0x3be583=await withSpinner(_0x173704(0x118)+_0x10125b+'\x27...',()=>_0x56d797['segment']['resolveParentId'](_0x10125b),{'verbose':_0x2dc352['verbose']}),_0x28ca06=_0x3be583['data'];let _0x33b74e;if(_0x30ae8f['segments'][_0x173704(0x110)]>0x2){const _0x5ceb47=await withSpinner(_0x173704(0xf2)+_0x3a31d+'\x27...',()=>_0x56d797[_0x173704(0xfc)][_0x173704(0x100)](_0x3a31d),{'verbose':_0x2dc352[_0x173704(0x115)]}),_0x5699a8=_0x5ceb47[_0x173704(0x108)];if(_0x5699a8['type']!==_0x173704(0xfe)&&_0x5699a8[_0x173704(0x10f)]!==_0x173704(0xfd))return console[_0x173704(0xea)](_0x173704(0x10b)),0x1;_0x33b74e=_0x5699a8['folderId'];}else{if(_0x2dc352[_0x173704(0xfe)]){const _0xbab09e=await withSpinner('Resolving\x20folder\x20\x27'+_0x2dc352[_0x173704(0xfe)]+'\x27...',()=>_0x56d797[_0x173704(0xfc)][_0x173704(0x107)](_0x28ca06,_0x2dc352[_0x173704(0xfe)]),{'verbose':_0x2dc352[_0x173704(0x115)]});_0x33b74e=_0xbab09e['data'];}}_0x2dc352['verbose']&&_0x33b74e&&console[_0x173704(0xea)]('Resolved\x20folder\x20ID:\x20'+_0x33b74e);const _0x2e4b61=await loadJSONFromOptions(_0x2dc352[_0x173704(0x10e)],_0x2dc352[_0x173704(0xf5)]),_0x35e800={'name':_0x550b4a,'description':_0x2dc352[_0x173704(0xeb)],'rule':_0x2e4b61,'kind':_0x2dc352['kind']!==undefined?parseInt(_0x2dc352[_0x173704(0x103)],0xa):undefined,'isVisible':_0x2dc352[_0x173704(0xff)]?![]:undefined,'segmentFolderId':_0x33b74e,'countPopulation':_0x2dc352['noCountPopulation']?![]:undefined},_0x345e04=await withSpinner('Creating\x20segment\x20\x27'+_0x550b4a+_0x173704(0xf3),()=>_0x56d797[_0x173704(0xfc)][_0x173704(0xfb)](_0x28ca06,_0x35e800),{'verbose':_0x2dc352[_0x173704(0x115)]}),_0x1996d1=_0x345e04[_0x173704(0x108)];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x1996d1['name']+'\x27\x20with\x20ID:\x20'+_0x1996d1['id']),_0x136bf6!==_0x5e81dd&&console[_0x173704(0xea)](_0x173704(0x105)+_0x136bf6),await handleSDKOutput([_0x1996d1],_0x2dc352),0x0;}}function a23_0x44e5(){const _0x4270fc=['site','name','execute','45566TbcdaV','Resolving\x20folder\x20path\x20\x27','\x27...','6302190chDMeo','ruleFile','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','2779090RLYLNc','Create\x20child\x20segment\x20with\x20filtering\x20rules','createSegment','segment','parent','folder','invisible','resolvePathToResource','11003629LVnZGp','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','kind','147ARgwck','\x20\x20\x20Path:\x20','Target\x20path:\x20','resolveFolderId','data','8fhdhdu','Parent:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','includes','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','rule','type','length','2302821wyJZIc','3233312ePaLBp','Examples:','20EATFks','verbose','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','522925XTBIIl','Resolving\x20parent\x20segment\x20\x27','error','description','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'];a23_0x44e5=function(){return _0x4270fc;};return a23_0x44e5();}
@@ -1 +1 @@
1
- const a24_0x41f898=a24_0x3fc9;function a24_0x3fc9(_0x508ac4,_0x3b4e70){const _0x4ba170=a24_0x4ba1();return a24_0x3fc9=function(_0x3fc93c,_0x4c49dc){_0x3fc93c=_0x3fc93c-0x140;let _0x4a31b4=_0x4ba170[_0x3fc93c];return _0x4a31b4;},a24_0x3fc9(_0x508ac4,_0x3b4e70);}function a24_0x4ba1(){const _0x597a86=['Site:\x20','\x27...','24130719jnDZHW','404438IhKTZM','Listing\x20fields\x20for\x20\x27','segment','description','\x20field','2ZzhpiX','3414776HCLaOX','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2165051jbjSjo','site','verbose','segment:fields','error','List\x20available\x20fields\x20for\x20segmentation','2785rhRjZo','length','4383330lQaAJP','2306169opLFZJ','1868dFgYay'];a24_0x4ba1=function(){return _0x597a86;};return a24_0x4ba1();}(function(_0x5317ec,_0x406522){const _0x1af11d=a24_0x3fc9,_0x512058=_0x5317ec();while(!![]){try{const _0x2294e5=parseInt(_0x1af11d(0x148))/0x1*(-parseInt(_0x1af11d(0x14d))/0x2)+-parseInt(_0x1af11d(0x143))/0x3+parseInt(_0x1af11d(0x144))/0x4*(-parseInt(_0x1af11d(0x140))/0x5)+-parseInt(_0x1af11d(0x142))/0x6+parseInt(_0x1af11d(0x150))/0x7+-parseInt(_0x1af11d(0x14e))/0x8+parseInt(_0x1af11d(0x147))/0x9;if(_0x2294e5===_0x406522)break;else _0x512058['push'](_0x512058['shift']());}catch(_0x3aaad1){_0x512058['push'](_0x512058['shift']());}}}(a24_0x4ba1,0x619ba));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a24_0x41f898(0x153);[a24_0x41f898(0x14b)]=a24_0x41f898(0x155);async['execute'](_0x429a68){const _0x9aa037=a24_0x41f898,{options:_0x5b287a,args:_0x542ef5,tdx:_0x303511}=_0x429a68;if(_0x542ef5[_0x9aa037(0x141)]===0x0)return console[_0x9aa037(0x154)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x9aa037(0x154)](_0x9aa037(0x14f)),0x1;const _0x3f7205=_0x542ef5[0x0];_0x5b287a[_0x9aa037(0x152)]&&(console[_0x9aa037(0x154)](_0x9aa037(0x145)+_0x5b287a[_0x9aa037(0x151)]),console[_0x9aa037(0x154)]('Parent\x20segment:\x20'+_0x3f7205));const _0x157605=await withSpinner(_0x9aa037(0x149)+_0x3f7205+_0x9aa037(0x146),()=>_0x303511[_0x9aa037(0x14a)]['listFields'](_0x3f7205),{'verbose':_0x5b287a[_0x9aa037(0x152)]}),_0x17a75f=_0x157605['data'];return console[_0x9aa037(0x154)]('✔\x20Found\x20'+_0x17a75f['length']+_0x9aa037(0x14c)+(_0x17a75f[_0x9aa037(0x141)]!==0x1?'s':'')),await handleSDKOutput(_0x17a75f,_0x5b287a),0x0;}}
1
+ function a24_0x58fb(){const _0x295bb2=['3453461wVhTwX','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2vVZcGj','\x20field','data','length','7gNceaK','segment','\x27...','verbose','List\x20available\x20fields\x20for\x20segmentation','execute','3285032npUMEx','351011YyPtPV','626890NXbFjx','segment:fields','Site:\x20','description','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','178284cVDHZN','1907840RWagjD','9TjDrde','listFields','name','39VuhBXy','Listing\x20fields\x20for\x20\x27','1248054GczSBq','✔\x20Found\x20'];a24_0x58fb=function(){return _0x295bb2;};return a24_0x58fb();}function a24_0x1edb(_0x39a57f,_0x42fb57){const _0x58fbe1=a24_0x58fb();return a24_0x1edb=function(_0x1edb0b,_0x3e5a48){_0x1edb0b=_0x1edb0b-0x1e1;let _0x123366=_0x58fbe1[_0x1edb0b];return _0x123366;},a24_0x1edb(_0x39a57f,_0x42fb57);}const a24_0x3084f3=a24_0x1edb;(function(_0x214e8b,_0x37405e){const _0x32d0c1=a24_0x1edb,_0x37c93d=_0x214e8b();while(!![]){try{const _0x2e8e19=parseInt(_0x32d0c1(0x1f1))/0x1*(-parseInt(_0x32d0c1(0x1e6))/0x2)+parseInt(_0x32d0c1(0x1fd))/0x3*(-parseInt(_0x32d0c1(0x1f8))/0x4)+parseInt(_0x32d0c1(0x1f2))/0x5+parseInt(_0x32d0c1(0x1e2))/0x6*(parseInt(_0x32d0c1(0x1ea))/0x7)+-parseInt(_0x32d0c1(0x1f0))/0x8*(-parseInt(_0x32d0c1(0x1fa))/0x9)+parseInt(_0x32d0c1(0x1f9))/0xa+parseInt(_0x32d0c1(0x1e4))/0xb;if(_0x2e8e19===_0x37405e)break;else _0x37c93d['push'](_0x37c93d['shift']());}catch(_0x2feb34){_0x37c93d['push'](_0x37c93d['shift']());}}}(a24_0x58fb,0x4db6d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x3084f3(0x1fc)]=a24_0x3084f3(0x1f3);[a24_0x3084f3(0x1f5)]=a24_0x3084f3(0x1ee);async[a24_0x3084f3(0x1ef)](_0x595363){const _0x341730=a24_0x3084f3,{options:_0x345524,args:_0x530d95,tdx:_0x34e76e}=_0x595363;if(_0x530d95[_0x341730(0x1e9)]===0x0)return console[_0x341730(0x1f7)](_0x341730(0x1f6)),console[_0x341730(0x1f7)](_0x341730(0x1e5)),0x1;const _0x322d4d=_0x530d95[0x0];_0x345524[_0x341730(0x1ed)]&&(console['error'](_0x341730(0x1f4)+_0x345524['site']),console[_0x341730(0x1f7)]('Parent\x20segment:\x20'+_0x322d4d));const _0x4ac02e=await withSpinner(_0x341730(0x1e1)+_0x322d4d+_0x341730(0x1ec),()=>_0x34e76e[_0x341730(0x1eb)][_0x341730(0x1fb)](_0x322d4d),{'verbose':_0x345524[_0x341730(0x1ed)]}),_0x39e6c0=_0x4ac02e[_0x341730(0x1e8)];return console[_0x341730(0x1f7)](_0x341730(0x1e3)+_0x39e6c0[_0x341730(0x1e9)]+_0x341730(0x1e7)+(_0x39e6c0[_0x341730(0x1e9)]!==0x1?'s':'')),await handleSDKOutput(_0x39e6c0,_0x345524),0x0;}}
@@ -1 +1 @@
1
- const a25_0x2e744b=a25_0x2e6c;function a25_0x2e6c(_0x3f387a,_0x58176c){const _0x547b87=a25_0x547b();return a25_0x2e6c=function(_0x2e6caa,_0x502150){_0x2e6caa=_0x2e6caa-0x106;let _0xfecbe1=_0x547b87[_0x2e6caa];return _0xfecbe1;},a25_0x2e6c(_0x3f387a,_0x58176c);}(function(_0x56d376,_0x2b096e){const _0x50d10d=a25_0x2e6c,_0x1a6b0c=_0x56d376();while(!![]){try{const _0x578a47=parseInt(_0x50d10d(0x120))/0x1*(parseInt(_0x50d10d(0x10b))/0x2)+-parseInt(_0x50d10d(0x107))/0x3+parseInt(_0x50d10d(0x106))/0x4*(-parseInt(_0x50d10d(0x116))/0x5)+-parseInt(_0x50d10d(0x121))/0x6+parseInt(_0x50d10d(0x10e))/0x7*(-parseInt(_0x50d10d(0x114))/0x8)+parseInt(_0x50d10d(0x11b))/0x9+parseInt(_0x50d10d(0x11f))/0xa*(parseInt(_0x50d10d(0x112))/0xb);if(_0x578a47===_0x2b096e)break;else _0x1a6b0c['push'](_0x1a6b0c['shift']());}catch(_0x4fe9cf){_0x1a6b0c['push'](_0x1a6b0c['shift']());}}}(a25_0x547b,0xbbd25));import{BaseCommand}from'./command.js';function a25_0x547b(){const _0x30adfd=['error','verbose','1500202qIHNln','name','8maUMyU','Show\x20current\x20segment/folder\x20context','315415DlPmLw','Context\x20details:','segment:pwd','\x20\x20Path:\x20','execute','4185333TTNDyA','stringify','segmentPath','format','120zeICZM','1005457WdPdzY','7254366FPFPLz','4nbUFie','608541jvUjSc','jsonl','json','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','2VDBDga','description','log','6039390WDRZtI','root'];a25_0x547b=function(){return _0x30adfd;};return a25_0x547b();}export class SegmentPwdCommand extends BaseCommand{[a25_0x2e744b(0x113)]=a25_0x2e744b(0x118);[a25_0x2e744b(0x10c)]=a25_0x2e744b(0x115);async[a25_0x2e744b(0x11a)](_0x9827b0){const _0x4a8c53=a25_0x2e744b,{options:_0x6e6d0a}=_0x9827b0;try{const _0x2be092=_0x6e6d0a[_0x4a8c53(0x11d)];if(!_0x2be092)return _0x6e6d0a['format']===_0x4a8c53(0x109)||_0x6e6d0a[_0x4a8c53(0x11e)]===_0x4a8c53(0x108)?console[_0x4a8c53(0x10d)](JSON[_0x4a8c53(0x11c)]({'path':'/','type':_0x4a8c53(0x10f)})):console[_0x4a8c53(0x10d)]('/'),0x0;if(_0x6e6d0a['format']==='json'||_0x6e6d0a[_0x4a8c53(0x11e)]===_0x4a8c53(0x108)){const _0x21e985={'path':_0x2be092};console[_0x4a8c53(0x10d)](JSON['stringify'](_0x21e985));}else console[_0x4a8c53(0x10d)](_0x2be092),_0x6e6d0a[_0x4a8c53(0x111)]&&(console[_0x4a8c53(0x110)](''),console[_0x4a8c53(0x110)](_0x4a8c53(0x117)),console[_0x4a8c53(0x110)](_0x4a8c53(0x119)+_0x2be092),console[_0x4a8c53(0x110)](''),console[_0x4a8c53(0x110)](_0x4a8c53(0x10a)),console[_0x4a8c53(0x110)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0xb2e594){throw _0xb2e594;}}}
1
+ const a25_0x55da45=a25_0xc014;function a25_0xc014(_0x3940af,_0x4b01c1){const _0x2e97bc=a25_0x2e97();return a25_0xc014=function(_0xc01454,_0x5cfe1f){_0xc01454=_0xc01454-0x1db;let _0x53a551=_0x2e97bc[_0xc01454];return _0x53a551;},a25_0xc014(_0x3940af,_0x4b01c1);}(function(_0x50c5ff,_0x54bda0){const _0x54935d=a25_0xc014,_0x193ba0=_0x50c5ff();while(!![]){try{const _0x2560e4=-parseInt(_0x54935d(0x1ec))/0x1*(parseInt(_0x54935d(0x1e4))/0x2)+parseInt(_0x54935d(0x1f1))/0x3*(parseInt(_0x54935d(0x1f0))/0x4)+-parseInt(_0x54935d(0x1e8))/0x5*(-parseInt(_0x54935d(0x1de))/0x6)+-parseInt(_0x54935d(0x1dc))/0x7+parseInt(_0x54935d(0x1df))/0x8*(-parseInt(_0x54935d(0x1e0))/0x9)+parseInt(_0x54935d(0x1eb))/0xa*(-parseInt(_0x54935d(0x1e6))/0xb)+-parseInt(_0x54935d(0x1ea))/0xc*(-parseInt(_0x54935d(0x1e9))/0xd);if(_0x2560e4===_0x54bda0)break;else _0x193ba0['push'](_0x193ba0['shift']());}catch(_0x1a0a3e){_0x193ba0['push'](_0x193ba0['shift']());}}}(a25_0x2e97,0x5f823));import{BaseCommand}from'./command.js';function a25_0x2e97(){const _0x1bdb44=['log','stringify','json','1766pQooIi','\x20\x20Path:\x20','22627MUkHwZ','Context\x20details:','15pILJjs','26fvxtEk','5097684ZTFHzN','420WdeHfN','687qAXcjL','format','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','error','2466388eYPLNn','3MnRtUV','jsonl','root','1907850XhOcFq','segment:pwd','1295634CdqUtT','288NvRxgU','189315jEAjFw'];a25_0x2e97=function(){return _0x1bdb44;};return a25_0x2e97();}export class SegmentPwdCommand extends BaseCommand{['name']=a25_0x55da45(0x1dd);['description']='Show\x20current\x20segment/folder\x20context';async['execute'](_0x1e29e5){const _0x3f2a6f=a25_0x55da45,{options:_0x1be658}=_0x1e29e5;try{const _0x5cf156=_0x1be658['segmentPath'];if(!_0x5cf156)return _0x1be658['format']===_0x3f2a6f(0x1e3)||_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1f2)?console[_0x3f2a6f(0x1e1)](JSON['stringify']({'path':'/','type':_0x3f2a6f(0x1db)})):console[_0x3f2a6f(0x1e1)]('/'),0x0;if(_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1e3)||_0x1be658[_0x3f2a6f(0x1ed)]===_0x3f2a6f(0x1f2)){const _0xb9accf={'path':_0x5cf156};console[_0x3f2a6f(0x1e1)](JSON[_0x3f2a6f(0x1e2)](_0xb9accf));}else console[_0x3f2a6f(0x1e1)](_0x5cf156),_0x1be658['verbose']&&(console[_0x3f2a6f(0x1ef)](''),console[_0x3f2a6f(0x1ef)](_0x3f2a6f(0x1e7)),console[_0x3f2a6f(0x1ef)](_0x3f2a6f(0x1e5)+_0x5cf156),console['error'](''),console['error'](_0x3f2a6f(0x1ee)),console[_0x3f2a6f(0x1ef)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x25d969){throw _0x25d969;}}}
@@ -1 +1 @@
1
- const a26_0x1c4733=a26_0x565d;(function(_0x3dd3f8,_0x25d620){const _0x2a04d7=a26_0x565d,_0x54b54d=_0x3dd3f8();while(!![]){try{const _0x451aa1=-parseInt(_0x2a04d7(0xf9))/0x1+-parseInt(_0x2a04d7(0xf1))/0x2+-parseInt(_0x2a04d7(0xe5))/0x3+parseInt(_0x2a04d7(0xeb))/0x4*(parseInt(_0x2a04d7(0xf8))/0x5)+-parseInt(_0x2a04d7(0x101))/0x6+-parseInt(_0x2a04d7(0xe8))/0x7+parseInt(_0x2a04d7(0xfd))/0x8;if(_0x451aa1===_0x25d620)break;else _0x54b54d['push'](_0x54b54d['shift']());}catch(_0x4f2eb3){_0x54b54d['push'](_0x54b54d['shift']());}}}(a26_0x12e0,0xb9925));function a26_0x12e0(){const _0x3b95e5=['Error:\x20Cannot\x20update\x20','42987688SmCUnR','\x27...','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','✔\x20Updated\x20segment\x20\x27','2480250RJEzNz','includes','error','resolvePathToResource','folder','verbose','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','type','Resolved\x20relative\x20path\x20to:\x20','Examples:','rule','Segment\x20ID\x20missing\x20from\x20resolved\x20path','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','3640722BYzrVq','Resolved\x20folder\x20ID:\x20','Resolved\x20type:\x20','7525539bYnOUO','parentId','segmentId','8zODtTM','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentPath','data','updateSegmentById','kind','2570728qVbTBQ','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','description','Update\x20existing\x20child\x20segment','segment','name','1049210pojYCk','1045654priDlM','\x20\x20\x20Path:\x20','segment:update'];a26_0x12e0=function(){return _0x3b95e5;};return a26_0x12e0();}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 a26_0x565d(_0x2569d7,_0x24ce53){const _0x12e07e=a26_0x12e0();return a26_0x565d=function(_0x565d8e,_0x4d9885){_0x565d8e=_0x565d8e-0xde;let _0x257402=_0x12e07e[_0x565d8e];return _0x257402;},a26_0x565d(_0x2569d7,_0x24ce53);}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x1c4733(0xf7)]=a26_0x1c4733(0xfb);[a26_0x1c4733(0xf4)]=a26_0x1c4733(0xf5);async['execute'](_0x5cc718){const _0x403ded=a26_0x1c4733,{options:_0x4919a0,args:_0xc5f995,tdx:_0x32bf1f}=_0x5cc718,_0x42e320=_0x4919a0;if(_0xc5f995['length']===0x0)return console['error'](_0x403ded(0xf2)),console[_0x403ded(0x103)](_0x403ded(0xec)),console[_0x403ded(0x103)](_0x403ded(0xe1)),console['error'](_0x403ded(0xde)),console[_0x403ded(0x103)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1442bf=_0xc5f995[0x0],_0x5bf24f=_0x4919a0[_0x403ded(0xed)];let _0x37d24c=_0x1442bf;_0x5bf24f&&!_0x1442bf[_0x403ded(0x102)]('/')&&(_0x37d24c=_0x5bf24f+'/'+_0x1442bf,_0x42e320[_0x403ded(0x106)]&&console[_0x403ded(0x103)](_0x403ded(0xe0)+_0x37d24c));const _0x1b5ec8=await withSpinner(_0x403ded(0xf3)+_0x37d24c+'\x27...',()=>_0x32bf1f[_0x403ded(0xf6)][_0x403ded(0x104)](_0x37d24c),{'verbose':_0x42e320['verbose']}),_0x1a7f86=_0x1b5ec8[_0x403ded(0xee)];_0x42e320['verbose']&&console[_0x403ded(0x103)](_0x403ded(0xe7)+_0x1a7f86[_0x403ded(0xdf)]);if(_0x1a7f86[_0x403ded(0xdf)]!==_0x403ded(0xf6))return console[_0x403ded(0x103)](_0x403ded(0xfc)+_0x1a7f86[_0x403ded(0xdf)]+_0x403ded(0xe4)),console[_0x403ded(0x103)](_0x403ded(0xff)),0x1;if(!_0x1a7f86['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x403ded(0xe3));const _0x43218a=_0x1a7f86[_0x403ded(0xe9)],_0x133215=_0x1a7f86[_0x403ded(0xea)];_0x42e320[_0x403ded(0x106)]&&(console['error']('Parent\x20ID:\x20'+_0x43218a),console[_0x403ded(0x103)]('Segment\x20ID:\x20'+_0x133215));let _0x377f0b;if(_0x42e320[_0x403ded(0x105)]){const _0xf68345=_0x42e320[_0x403ded(0x105)],_0x5b6b2b=await withSpinner('Resolving\x20folder\x20\x27'+_0xf68345+_0x403ded(0xfe),()=>_0x32bf1f[_0x403ded(0xf6)]['resolveFolderId'](_0x43218a,_0xf68345),{'verbose':_0x42e320[_0x403ded(0x106)]});_0x377f0b=parseInt(_0x5b6b2b[_0x403ded(0xee)],0xa),_0x42e320['verbose']&&console[_0x403ded(0x103)](_0x403ded(0xe6)+_0x377f0b);}const _0x1b8e42=await loadJSONFromOptions(_0x42e320[_0x403ded(0xe2)],_0x42e320['ruleFile']),_0x155287={'name':_0x42e320[_0x403ded(0xf7)],'description':_0x42e320[_0x403ded(0xf4)],'rule':_0x1b8e42,'kind':_0x42e320[_0x403ded(0xf0)]!==undefined?parseInt(_0x42e320[_0x403ded(0xf0)],0xa):undefined,'segmentFolderId':_0x377f0b},_0x4fdcc0=await withSpinner('Updating\x20segment\x20\x27'+_0x1a7f86['segmentName']+_0x403ded(0xfe),()=>_0x32bf1f[_0x403ded(0xf6)][_0x403ded(0xef)](_0x43218a,_0x133215,_0x155287),{'verbose':_0x42e320['verbose']}),_0x354034=_0x4fdcc0['data'];return console['error'](_0x403ded(0x100)+_0x354034[_0x403ded(0xf7)]+'\x27'),_0x37d24c!==_0x1442bf&&console['error'](_0x403ded(0xfa)+_0x37d24c),await handleSDKOutput([_0x354034],_0x42e320),0x0;}}
1
+ function a26_0x1431(){const _0x304dfa=['Parent\x20ID:\x20','name','kind','Segment\x20ID\x20missing\x20from\x20resolved\x20path','parentId','\x20\x20\x20Path:\x20','segment','data','9002076fzMvzf','2690733UlTkMz','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','1288301ThAurQ','segmentPath','verbose','segment:update','\x27...','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','type','1353088XlIAma','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','2mgPbwf','277700bZhITJ','5ijCHEg','Resolved\x20relative\x20path\x20to:\x20','error','Update\x20existing\x20child\x20segment','Examples:','Segment\x20ID:\x20','65942cGjNul','Resolved\x20type:\x20','includes','4870592vwHbQJ','8orSJXX','✔\x20Updated\x20segment\x20\x27','INTERNAL','180XsBhMR'];a26_0x1431=function(){return _0x304dfa;};return a26_0x1431();}const a26_0x3f7489=a26_0x29c0;function a26_0x29c0(_0x599c94,_0x262f54){const _0x14312e=a26_0x1431();return a26_0x29c0=function(_0x29c0c1,_0x3bcc69){_0x29c0c1=_0x29c0c1-0x11e;let _0x5af9ef=_0x14312e[_0x29c0c1];return _0x5af9ef;},a26_0x29c0(_0x599c94,_0x262f54);}(function(_0x2668b4,_0x1a4a9f){const _0x16691b=a26_0x29c0,_0x46b035=_0x2668b4();while(!![]){try{const _0x5bafc5=parseInt(_0x16691b(0x120))/0x1+-parseInt(_0x16691b(0x13e))/0x2*(-parseInt(_0x16691b(0x131))/0x3)+-parseInt(_0x16691b(0x123))/0x4*(parseInt(_0x16691b(0x140))/0x5)+parseInt(_0x16691b(0x130))/0x6+parseInt(_0x16691b(0x134))/0x7*(parseInt(_0x16691b(0x124))/0x8)+parseInt(_0x16691b(0x127))/0x9*(-parseInt(_0x16691b(0x13f))/0xa)+-parseInt(_0x16691b(0x13c))/0xb;if(_0x5bafc5===_0x1a4a9f)break;else _0x46b035['push'](_0x46b035['shift']());}catch(_0x28d44f){_0x46b035['push'](_0x46b035['shift']());}}}(a26_0x1431,0xb7652));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_0x3f7489(0x129)]=a26_0x3f7489(0x137);['description']=a26_0x3f7489(0x143);async['execute'](_0x1c296a){const _0x5ead8c=a26_0x3f7489,{options:_0x1ef7c4,args:_0x24e026,tdx:_0xc98ddd}=_0x1c296a,_0x34fa81=_0x1ef7c4;if(_0x24e026['length']===0x0)return console[_0x5ead8c(0x142)](_0x5ead8c(0x133)),console[_0x5ead8c(0x142)](_0x5ead8c(0x13d)),console[_0x5ead8c(0x142)](_0x5ead8c(0x11e)),console[_0x5ead8c(0x142)](_0x5ead8c(0x139)),console[_0x5ead8c(0x142)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1d1331=_0x24e026[0x0],_0xef423a=_0x1ef7c4[_0x5ead8c(0x135)];let _0x560257=_0x1d1331;_0xef423a&&!_0x1d1331[_0x5ead8c(0x122)]('/')&&(_0x560257=_0xef423a+'/'+_0x1d1331,_0x34fa81[_0x5ead8c(0x136)]&&console['error'](_0x5ead8c(0x141)+_0x560257));const _0x3c09d0=await withSpinner('Resolving\x20path\x20\x27'+_0x560257+_0x5ead8c(0x138),()=>_0xc98ddd[_0x5ead8c(0x12e)]['resolvePathToResource'](_0x560257),{'verbose':_0x34fa81['verbose']}),_0x41216e=_0x3c09d0[_0x5ead8c(0x12f)];_0x34fa81[_0x5ead8c(0x136)]&&console[_0x5ead8c(0x142)](_0x5ead8c(0x121)+_0x41216e['type']);if(_0x41216e['type']!=='segment')return console['error']('Error:\x20Cannot\x20update\x20'+_0x41216e[_0x5ead8c(0x13b)]+_0x5ead8c(0x13a)),console[_0x5ead8c(0x142)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x41216e['segmentId'])throw new SDKError(ErrorCode[_0x5ead8c(0x126)],_0x5ead8c(0x12b));const _0xae20e3=_0x41216e[_0x5ead8c(0x12c)],_0x217529=_0x41216e['segmentId'];_0x34fa81[_0x5ead8c(0x136)]&&(console[_0x5ead8c(0x142)](_0x5ead8c(0x128)+_0xae20e3),console[_0x5ead8c(0x142)](_0x5ead8c(0x11f)+_0x217529));let _0x20eec1;if(_0x34fa81['folder']){const _0x35d1ea=_0x34fa81[_0x5ead8c(0x132)],_0x39964a=await withSpinner('Resolving\x20folder\x20\x27'+_0x35d1ea+_0x5ead8c(0x138),()=>_0xc98ddd[_0x5ead8c(0x12e)]['resolveFolderId'](_0xae20e3,_0x35d1ea),{'verbose':_0x34fa81['verbose']});_0x20eec1=parseInt(_0x39964a['data'],0xa),_0x34fa81[_0x5ead8c(0x136)]&&console[_0x5ead8c(0x142)]('Resolved\x20folder\x20ID:\x20'+_0x20eec1);}const _0x343c27=await loadJSONFromOptions(_0x34fa81['rule'],_0x34fa81['ruleFile']),_0x58bee9={'name':_0x34fa81['name'],'description':_0x34fa81['description'],'rule':_0x343c27,'kind':_0x34fa81[_0x5ead8c(0x12a)]!==undefined?parseInt(_0x34fa81['kind'],0xa):undefined,'segmentFolderId':_0x20eec1},_0x8c33a2=await withSpinner('Updating\x20segment\x20\x27'+_0x41216e['segmentName']+'\x27...',()=>_0xc98ddd[_0x5ead8c(0x12e)]['updateSegmentById'](_0xae20e3,_0x217529,_0x58bee9),{'verbose':_0x34fa81['verbose']}),_0x123a0a=_0x8c33a2['data'];return console[_0x5ead8c(0x142)](_0x5ead8c(0x125)+_0x123a0a['name']+'\x27'),_0x560257!==_0x1d1331&&console[_0x5ead8c(0x142)](_0x5ead8c(0x12d)+_0x560257),await handleSDKOutput([_0x123a0a],_0x34fa81),0x0;}}
@@ -1 +1 @@
1
- const a27_0x247628=a27_0x1c20;(function(_0x7bca58,_0x3bd679){const _0x18496f=a27_0x1c20,_0x200c63=_0x7bca58();while(!![]){try{const _0x5cd9f0=parseInt(_0x18496f(0x149))/0x1+-parseInt(_0x18496f(0x153))/0x2+-parseInt(_0x18496f(0x15d))/0x3+parseInt(_0x18496f(0x143))/0x4+parseInt(_0x18496f(0x148))/0x5*(-parseInt(_0x18496f(0x13e))/0x6)+-parseInt(_0x18496f(0x157))/0x7+parseInt(_0x18496f(0x14f))/0x8;if(_0x5cd9f0===_0x3bd679)break;else _0x200c63['push'](_0x200c63['shift']());}catch(_0x18a3d2){_0x200c63['push'](_0x200c63['shift']());}}}(a27_0x1f01,0x49651));function a27_0x1f01(){const _0x2c994f=['Parent\x20ID:\x20','\x27...','42UHKNhY','name','isAbsolute','folderPath','verbose','739124QBCFfJ','resolvePathToResource','Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Resolved\x20path\x20type:\x20','163675eeeOJr','239920kbYKSJ','Examples:','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Context\x20cleared.\x20Back\x20to\x20root.','split','folderId','11836688qhOUFD','Resolved\x20relative\x20path\x20to:\x20','Use:\x20tdx\x20segment\x20use\x20','Site:\x20','676706Siojgl','parentName','Error:\x20Path\x20is\x20required','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','3335892mVKBaf','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','log','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','session','1678824lLoSLk','site','segments','type','slice','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','join','error','data','segmentPath','segment','length','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','description'];a27_0x1f01=function(){return _0x2c994f;};return a27_0x1f01();}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_0x1c20(_0x265817,_0x2ae963){const _0x1f0179=a27_0x1f01();return a27_0x1c20=function(_0x1c2054,_0x4e1e4b){_0x1c2054=_0x1c2054-0x137;let _0x29ab09=_0x1f0179[_0x1c2054];return _0x29ab09;},a27_0x1c20(_0x265817,_0x2ae963);}export class SegmentUseCommand extends BaseCommand{[a27_0x247628(0x13f)]='segment:use';[a27_0x247628(0x13b)]=a27_0x247628(0x163);async['execute'](_0x11d146){const _0x266926=a27_0x247628,{options:_0x192c7a,args:_0x55440b,tdx:_0xb5cad0}=_0x11d146;if(_0x55440b[_0x266926(0x139)]===0x0)return console[_0x266926(0x167)](_0x266926(0x155)),console[_0x266926(0x167)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x266926(0x167)](_0x266926(0x14a)),console[_0x266926(0x167)](_0x266926(0x15b)),console[_0x266926(0x167)](_0x266926(0x146)),console['error'](_0x266926(0x158)),console['error']('\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 _0x22b1fc=_0x55440b[0x0],_0x228d78=_0x192c7a[_0x266926(0x15c)];try{if(_0x22b1fc==='/')return saveSessionContext({'segment_path':undefined},_0x228d78),console['log'](_0x266926(0x14c)),0x0;const _0x571643=_0x192c7a[_0x266926(0x137)];let _0x119c2d=_0x22b1fc;const _0x3acf3c=parsePath(_0x22b1fc);if(!_0x3acf3c[_0x266926(0x140)]){if(!_0x571643)return console[_0x266926(0x167)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console['error'](_0x266926(0x156)),0x1;if(_0x22b1fc==='..'){const _0x3f2300=_0x571643[_0x266926(0x14d)]('/')[_0x266926(0x161)](0x0,-0x1)[_0x266926(0x166)]('/');_0x119c2d=_0x3f2300||'/';}else _0x22b1fc==='.'?_0x119c2d=_0x571643:_0x119c2d=_0x571643+'/'+_0x22b1fc;_0x192c7a[_0x266926(0x142)]&&console['error'](_0x266926(0x150)+_0x119c2d);}if(_0x119c2d==='/'||_0x119c2d==='')return saveSessionContext({'segment_path':undefined},_0x228d78),console[_0x266926(0x159)](_0x266926(0x14c)),0x0;_0x119c2d=normalizePath(_0x119c2d);const _0xeef7ee=parsePath(_0x119c2d)[_0x266926(0x15f)];if(_0xeef7ee[_0x266926(0x139)]===0x0)return saveSessionContext({'segment_path':undefined},_0x228d78),console[_0x266926(0x159)](_0x266926(0x14c)),0x0;_0x192c7a[_0x266926(0x142)]&&(console[_0x266926(0x167)](_0x266926(0x152)+_0x192c7a[_0x266926(0x15e)]),console[_0x266926(0x167)]('Target\x20path:\x20'+_0x119c2d));const _0x4979dc=await withSpinner(_0x266926(0x15a)+_0x119c2d+_0x266926(0x13d),()=>_0xb5cad0[_0x266926(0x138)][_0x266926(0x144)](_0x119c2d),{'verbose':_0x192c7a[_0x266926(0x142)]}),_0x36053e=_0x4979dc[_0x266926(0x168)];_0x192c7a[_0x266926(0x142)]&&(console[_0x266926(0x167)](_0x266926(0x147)+_0x36053e[_0x266926(0x160)]),console[_0x266926(0x167)](_0x266926(0x13c)+_0x36053e['parentId']),_0x36053e['folderId']&&console[_0x266926(0x167)]('Folder\x20ID:\x20'+_0x36053e[_0x266926(0x14e)]));if(_0x36053e[_0x266926(0x160)]===_0x266926(0x138))return console[_0x266926(0x167)](_0x266926(0x164)),console['error'](_0x266926(0x13a)),console[_0x266926(0x167)](_0x266926(0x151)+_0x36053e[_0x266926(0x154)]+(_0x36053e[_0x266926(0x141)]?'/'+_0x36053e[_0x266926(0x141)][_0x266926(0x166)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x36053e[_0x266926(0x162)],'parent_segment':_0x36053e[_0x266926(0x154)]},_0x228d78),console[_0x266926(0x159)](_0x266926(0x145)+_0x36053e['fullPath']),_0x192c7a['verbose']&&(console[_0x266926(0x167)](_0x266926(0x165)),console['error']('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0x266926(0x167)](_0x266926(0x14b))),0x0;}catch(_0x2799aa){throw _0x2799aa;}}}
1
+ const a27_0xa9f964=a27_0x1e3c;(function(_0x407e2d,_0x453b2e){const _0x234114=a27_0x1e3c,_0x4c1c86=_0x407e2d();while(!![]){try{const _0x23ee26=parseInt(_0x234114(0xbf))/0x1+-parseInt(_0x234114(0xe1))/0x2*(parseInt(_0x234114(0xc3))/0x3)+parseInt(_0x234114(0xb4))/0x4+-parseInt(_0x234114(0xda))/0x5*(parseInt(_0x234114(0xe6))/0x6)+-parseInt(_0x234114(0xb7))/0x7*(parseInt(_0x234114(0xe4))/0x8)+parseInt(_0x234114(0xe8))/0x9*(-parseInt(_0x234114(0xbc))/0xa)+-parseInt(_0x234114(0xe7))/0xb*(-parseInt(_0x234114(0xc4))/0xc);if(_0x23ee26===_0x453b2e)break;else _0x4c1c86['push'](_0x4c1c86['shift']());}catch(_0x3d151b){_0x4c1c86['push'](_0x4c1c86['shift']());}}}(a27_0x10c2,0x66f35));function a27_0x10c2(){const _0x2677fa=['Use:\x20tdx\x20segment\x20use\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','description','name','split','segment','resolvePathToResource','Examples:','slice','Folder\x20ID:\x20','error','Error:\x20Path\x20is\x20required','292425tqPyji','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','type','Context\x20cleared.\x20Back\x20to\x20root.','parentId','folderId','isAbsolute','2wPlrgg','Parent\x20ID:\x20','session','5741224gzxlpy','Target\x20path:\x20','48bBjYCU','4562932XwyWgn','2978253dZoejv','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','2868512qCuXyH','folderPath','segments','7ClnLQk','segmentPath','data','Context\x20set\x20to:\x20','verbose','10VgUWFT','Resolving\x20path\x20\x27','Resolved\x20path\x20type:\x20','300392TFIEtp','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','length','segment:use','971463gmTSaI','36iZTkKL','execute','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','site','join','Site:\x20','log','fullPath'];a27_0x10c2=function(){return _0x2677fa;};return a27_0x10c2();}import{BaseCommand}from'./command.js';function a27_0x1e3c(_0x3acff6,_0x2c81f6){const _0x10c23e=a27_0x10c2();return a27_0x1e3c=function(_0x1e3c07,_0x54dcb8){_0x1e3c07=_0x1e3c07-0xb3;let _0x807984=_0x10c23e[_0x1e3c07];return _0x807984;},a27_0x1e3c(_0x3acff6,_0x2c81f6);}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{[a27_0xa9f964(0xd1)]=a27_0xa9f964(0xc2);[a27_0xa9f964(0xd0)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a27_0xa9f964(0xc5)](_0x4378c7){const _0xedca74=a27_0xa9f964,{options:_0x4f7472,args:_0x343bb5,tdx:_0x22c34a}=_0x4378c7;if(_0x343bb5[_0xedca74(0xc1)]===0x0)return console[_0xedca74(0xd8)](_0xedca74(0xd9)),console['error'](_0xedca74(0xcd)),console[_0xedca74(0xd8)](_0xedca74(0xd5)),console[_0xedca74(0xd8)](_0xedca74(0xce)),console[_0xedca74(0xd8)](_0xedca74(0xb3)),console['error'](_0xedca74(0xdb)),console[_0xedca74(0xd8)]('\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 _0x353338=_0x343bb5[0x0],_0x45dce4=_0x4f7472[_0xedca74(0xe3)];try{if(_0x353338==='/')return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xdd)),0x0;const _0x55b01c=_0x4f7472[_0xedca74(0xb8)];let _0xd6f10f=_0x353338;const _0x5eafcc=parsePath(_0x353338);if(!_0x5eafcc[_0xedca74(0xe0)]){if(!_0x55b01c)return console[_0xedca74(0xd8)](_0xedca74(0xc0)),console[_0xedca74(0xd8)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'),0x1;if(_0x353338==='..'){const _0x2d1175=_0x55b01c[_0xedca74(0xd2)]('/')[_0xedca74(0xd6)](0x0,-0x1)[_0xedca74(0xc8)]('/');_0xd6f10f=_0x2d1175||'/';}else _0x353338==='.'?_0xd6f10f=_0x55b01c:_0xd6f10f=_0x55b01c+'/'+_0x353338;_0x4f7472[_0xedca74(0xbb)]&&console[_0xedca74(0xd8)](_0xedca74(0xea)+_0xd6f10f);}if(_0xd6f10f==='/'||_0xd6f10f==='')return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xdd)),0x0;_0xd6f10f=normalizePath(_0xd6f10f);const _0x5c3fb1=parsePath(_0xd6f10f)[_0xedca74(0xb6)];if(_0x5c3fb1['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x45dce4),console[_0xedca74(0xca)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x4f7472['verbose']&&(console[_0xedca74(0xd8)](_0xedca74(0xc9)+_0x4f7472[_0xedca74(0xc7)]),console[_0xedca74(0xd8)](_0xedca74(0xe5)+_0xd6f10f));const _0xd21dc5=await withSpinner(_0xedca74(0xbd)+_0xd6f10f+'\x27...',()=>_0x22c34a[_0xedca74(0xd3)][_0xedca74(0xd4)](_0xd6f10f),{'verbose':_0x4f7472['verbose']}),_0x5c1ab2=_0xd21dc5[_0xedca74(0xb9)];_0x4f7472['verbose']&&(console['error'](_0xedca74(0xbe)+_0x5c1ab2[_0xedca74(0xdc)]),console[_0xedca74(0xd8)](_0xedca74(0xe2)+_0x5c1ab2[_0xedca74(0xde)]),_0x5c1ab2[_0xedca74(0xdf)]&&console[_0xedca74(0xd8)](_0xedca74(0xd7)+_0x5c1ab2[_0xedca74(0xdf)]));if(_0x5c1ab2['type']===_0xedca74(0xd3))return console[_0xedca74(0xd8)](_0xedca74(0xcf)),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0xedca74(0xd8)](_0xedca74(0xcc)+_0x5c1ab2['parentName']+(_0x5c1ab2[_0xedca74(0xb5)]?'/'+_0x5c1ab2[_0xedca74(0xb5)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x5c1ab2[_0xedca74(0xcb)],'parent_segment':_0x5c1ab2['parentName']},_0x45dce4),console[_0xedca74(0xca)](_0xedca74(0xba)+_0x5c1ab2[_0xedca74(0xcb)]),_0x4f7472['verbose']&&(console[_0xedca74(0xd8)](_0xedca74(0xc6)),console[_0xedca74(0xd8)]('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0xedca74(0xd8)](_0xedca74(0xe9))),0x0;}catch(_0x141dd8){throw _0x141dd8;}}}
@@ -1 +1 @@
1
- const a28_0x1dc4c6=a28_0x4c0f;(function(_0x205937,_0x1cd109){const _0x66c1c3=a28_0x4c0f,_0xe97810=_0x205937();while(!![]){try{const _0x3b6be0=parseInt(_0x66c1c3(0x103))/0x1+-parseInt(_0x66c1c3(0x119))/0x2*(parseInt(_0x66c1c3(0x10d))/0x3)+parseInt(_0x66c1c3(0x11b))/0x4*(-parseInt(_0x66c1c3(0x13a))/0x5)+parseInt(_0x66c1c3(0x128))/0x6+-parseInt(_0x66c1c3(0x126))/0x7+-parseInt(_0x66c1c3(0x116))/0x8+parseInt(_0x66c1c3(0x118))/0x9*(parseInt(_0x66c1c3(0x10f))/0xa);if(_0x3b6be0===_0x1cd109)break;else _0xe97810['push'](_0xe97810['shift']());}catch(_0xc0855b){_0xe97810['push'](_0xe97810['shift']());}}}(a28_0x3a4f,0x9aadf));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a28_0x4c0f(_0x26209d,_0x2d5b2a){const _0x3a4fed=a28_0x3a4f();return a28_0x4c0f=function(_0x4c0f34,_0x5d8a8b){_0x4c0f34=_0x4c0f34-0xfd;let _0x1dd75e=_0x3a4fed[_0x4c0f34];return _0x1dd75e;},a28_0x4c0f(_0x26209d,_0x2d5b2a);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a28_0x3a4f(){const _0x266949=['2017036XjVjBS','execute','✔\x20Found\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Parent\x20ID:\x20','map','replace','resolvePathToResource','filter','length','site','348250bQUkCg','segment','138342NOeBCW','includes','description','\x20\x20Cause:\x20','(empty)','error','Listing\x20folders\x20and\x20segments...','listParentsWithPattern','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','cause','\x20folder','listRecursive','verbose','\x20segment','Resolving\x20context\x20path\x20\x27','Folder\x20ID:\x20','\x20parent\x20segment','localeCompare','5MWSJBh','Building\x20hierarchy\x20tree...','Path/pattern\x20arg:\x20','dim','segments','[parent\x20segments]','Site:\x20','format','491698WKThLB','Listing\x20parent\x20segments...','listUnified','\x20top-level\x20items','attributes','jsonl','parentId','listParents','Listing\x20parent\x20segments\x20matching\x20\x27','recursive','78YlKIOU','name','22178670ZzeCAO','folderId','json','👥\x20','\x5c$&','log','\x27...','8203072WUdpug','population','9uCresW','39974HgHYGG','data'];a28_0x3a4f=function(){return _0x266949;};return a28_0x3a4f();}import{formatRows}from'../utils/formatters.js';import a28_0x52f7c9 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x1dc4c6(0x10e)]=a28_0x1dc4c6(0xff);[a28_0x1dc4c6(0x12a)]=a28_0x1dc4c6(0x130);async[a28_0x1dc4c6(0x11c)](_0x459eae){const _0x8489e7=a28_0x1dc4c6,{options:_0x565ab8,args:_0x288c21}=_0x459eae,_0x2c42b9=_0x565ab8[_0x8489e7(0x10c)],_0x228617=_0x288c21[0x0];try{const _0x4a0e23=_0x565ab8['segmentPath'];_0x565ab8['verbose']&&(console[_0x8489e7(0x12d)](_0x8489e7(0x101)+_0x565ab8[_0x8489e7(0x125)]),console[_0x8489e7(0x12d)]('Current\x20context:\x20'+(_0x4a0e23||'/')),_0x228617&&console[_0x8489e7(0x12d)](_0x8489e7(0xfd)+_0x228617),_0x2c42b9&&console['error']('Recursive\x20mode:\x20enabled'));if(_0x228617){const _0x275e15=_0x228617[_0x8489e7(0x129)]('*')||_0x228617[_0x8489e7(0x129)]('?');if(_0x275e15&&!_0x4a0e23)return await this[_0x8489e7(0x12f)](_0x459eae,_0x228617);else return _0x275e15?(console['error']('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x8489e7(0x12d)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x2c42b9?await this['listRecursive'](_0x459eae,_0x228617):await this[_0x8489e7(0x105)](_0x459eae,_0x228617);}if(!_0x4a0e23)return await this[_0x8489e7(0x10a)](_0x459eae);return _0x2c42b9?await this['listRecursive'](_0x459eae,_0x4a0e23):await this[_0x8489e7(0x105)](_0x459eae,_0x4a0e23);}catch(_0x3d4250){if(_0x3d4250 instanceof SDKError)return console[_0x8489e7(0x12d)]('Error:\x20'+_0x3d4250['message']),_0x3d4250[_0x8489e7(0x131)]&&console[_0x8489e7(0x12d)](_0x8489e7(0x12b)+_0x3d4250[_0x8489e7(0x131)]),0x1;throw _0x3d4250;}}async['listParentsWithPattern'](_0x20f16a,_0x56c077){const _0x15832a=a28_0x1dc4c6,{options:_0x2e17f3,tdx:_0x27b6ff}=_0x20f16a,_0x2345cb=await withSpinner(_0x15832a(0x10b)+_0x56c077+_0x15832a(0x115),()=>_0x27b6ff[_0x15832a(0x127)]['listParents'](),{'verbose':_0x2e17f3[_0x15832a(0x134)]}),_0x27a3a5=_0x2345cb['data'],_0x58fd33=_0x56c077[_0x15832a(0x121)](/[.+^${}()|[\]\\]/g,_0x15832a(0x113))[_0x15832a(0x121)](/\*/g,'.*')[_0x15832a(0x121)](/\?/g,'.'),_0x92ab0=new RegExp('^'+_0x58fd33+'$','i'),_0x47986a=_0x27a3a5[_0x15832a(0x123)](_0x4d84ff=>_0x92ab0['test'](_0x4d84ff[_0x15832a(0x107)][_0x15832a(0x10e)]));console[_0x15832a(0x12d)](_0x15832a(0x11d)+_0x47986a['length']+_0x15832a(0x138)+(_0x47986a[_0x15832a(0x124)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x56c077+'\x27');if(_0x2e17f3[_0x15832a(0x102)]===_0x15832a(0x111)||_0x2e17f3['format']===_0x15832a(0x108))await handleSDKOutput(_0x47986a,_0x2e17f3);else{if(_0x47986a[_0x15832a(0x124)]===0x0)console[_0x15832a(0x114)](_0x15832a(0x11e)+_0x56c077);else{console[_0x15832a(0x114)](_0x15832a(0x100));for(const _0x53ffdd of _0x47986a){const _0x21fb9f=_0x53ffdd[_0x15832a(0x107)][_0x15832a(0x117)]?a28_0x52f7c9[_0x15832a(0xfe)]('\x20('+formatRows(_0x53ffdd['attributes'][_0x15832a(0x117)])+')'):'';console[_0x15832a(0x114)](_0x15832a(0x112)+_0x53ffdd[_0x15832a(0x107)][_0x15832a(0x10e)]+_0x21fb9f);}}}return 0x0;}async[a28_0x1dc4c6(0x10a)](_0x1bcf57){const _0x3633ac=a28_0x1dc4c6,{options:_0x113726,tdx:_0x52d9f4}=_0x1bcf57,_0x482d02=await withSpinner(_0x3633ac(0x104),()=>_0x52d9f4[_0x3633ac(0x127)][_0x3633ac(0x10a)](),{'verbose':_0x113726[_0x3633ac(0x134)]}),_0x42b758=_0x482d02['data'];console[_0x3633ac(0x12d)](_0x3633ac(0x11d)+_0x42b758[_0x3633ac(0x124)]+_0x3633ac(0x138)+(_0x42b758[_0x3633ac(0x124)]!==0x1?'s':''));if(_0x113726[_0x3633ac(0x102)]===_0x3633ac(0x111)||_0x113726[_0x3633ac(0x102)]==='jsonl')await handleSDKOutput(_0x42b758,_0x113726);else{console[_0x3633ac(0x114)](_0x3633ac(0x100));for(const _0x121fd0 of _0x42b758){const _0x53fe33=_0x121fd0['attributes'][_0x3633ac(0x117)]?a28_0x52f7c9[_0x3633ac(0xfe)]('\x20('+formatRows(_0x121fd0[_0x3633ac(0x107)][_0x3633ac(0x117)])+')'):'';console[_0x3633ac(0x114)](_0x3633ac(0x112)+_0x121fd0[_0x3633ac(0x107)][_0x3633ac(0x10e)]+_0x53fe33);}}return 0x0;}async[a28_0x1dc4c6(0x105)](_0x2b9dac,_0x84e14b){const _0x485c65=a28_0x1dc4c6,{options:_0x3007ad,tdx:_0x50a694}=_0x2b9dac,_0x2a20a5=await withSpinner(_0x485c65(0x136)+_0x84e14b+_0x485c65(0x115),()=>_0x50a694[_0x485c65(0x127)][_0x485c65(0x122)](_0x84e14b),{'verbose':_0x3007ad[_0x485c65(0x134)]}),_0x27eebf=_0x2a20a5['data'];_0x3007ad['verbose']&&(console[_0x485c65(0x12d)](_0x485c65(0x11f)+_0x27eebf['parentId']),_0x27eebf['folderId']&&console['error'](_0x485c65(0x137)+_0x27eebf[_0x485c65(0x110)]));const _0x586625=await withSpinner(_0x485c65(0x12e),()=>_0x50a694[_0x485c65(0x127)][_0x485c65(0x105)](_0x27eebf['parentId'],_0x27eebf[_0x485c65(0x110)]),{'verbose':_0x3007ad[_0x485c65(0x134)]}),{folders:_0x57df89,segments:_0x34e46e}=_0x586625[_0x485c65(0x11a)],_0xea7ae8=_0x57df89[_0x485c65(0x124)]+_0x34e46e[_0x485c65(0x124)];console['error'](_0x485c65(0x11d)+_0x57df89['length']+_0x485c65(0x132)+(_0x57df89[_0x485c65(0x124)]!==0x1?'s':'')+'\x20and\x20'+_0x34e46e['length']+_0x485c65(0x135)+(_0x34e46e['length']!==0x1?'s':''));if(_0x3007ad[_0x485c65(0x102)]===_0x485c65(0x111)||_0x3007ad[_0x485c65(0x102)]===_0x485c65(0x108)){const _0x271ac3=[..._0x57df89[_0x485c65(0x120)](_0x53da88=>({..._0x53da88,'type':'folder'})),..._0x34e46e['map'](_0x1f857a=>({..._0x1f857a,'type':_0x485c65(0x127)}))]['sort']((_0x2c3d34,_0x34e0b5)=>_0x2c3d34[_0x485c65(0x10e)][_0x485c65(0x139)](_0x34e0b5['name']));await handleSDKOutput(_0x271ac3,_0x3007ad);}else{if(_0xea7ae8===0x0)console[_0x485c65(0x114)](a28_0x52f7c9[_0x485c65(0xfe)]('[/'+_0x84e14b+']')),console[_0x485c65(0x114)](_0x485c65(0x12c));else{console[_0x485c65(0x114)](a28_0x52f7c9[_0x485c65(0xfe)]('[/'+_0x84e14b+']'));const _0x5aeb22=formatFlatList(_0x57df89,_0x34e46e,{'showMetadata':!![]});console[_0x485c65(0x114)](_0x5aeb22);}}return 0x0;}async[a28_0x1dc4c6(0x133)](_0x1c8f96,_0x409872){const _0x585247=a28_0x1dc4c6,{options:_0x2d87be,tdx:_0x5acdbf}=_0x1c8f96,_0x14518a=await withSpinner(_0x585247(0x136)+_0x409872+_0x585247(0x115),()=>_0x5acdbf[_0x585247(0x127)][_0x585247(0x122)](_0x409872),{'verbose':_0x2d87be[_0x585247(0x134)]}),_0x2be6b3=_0x14518a[_0x585247(0x11a)];_0x2d87be['verbose']&&(console['error'](_0x585247(0x11f)+_0x2be6b3[_0x585247(0x109)]),_0x2be6b3[_0x585247(0x110)]&&console[_0x585247(0x12d)]('Folder\x20ID:\x20'+_0x2be6b3[_0x585247(0x110)]));const _0x56fe4f=_0x2d87be['maxDepth']||0xa,_0x1348d6=await withSpinner(_0x585247(0x13b),()=>_0x5acdbf[_0x585247(0x127)][_0x585247(0x133)](_0x2be6b3[_0x585247(0x109)],_0x2be6b3[_0x585247(0x110)],0x0,_0x56fe4f),{'verbose':_0x2d87be[_0x585247(0x134)]}),_0x1800a3=_0x1348d6[_0x585247(0x11a)];console[_0x585247(0x12d)]('✔\x20Built\x20tree\x20with\x20'+_0x1800a3[_0x585247(0x124)]+_0x585247(0x106));if(_0x2d87be[_0x585247(0x102)]===_0x585247(0x111)||_0x2d87be[_0x585247(0x102)]===_0x585247(0x108))await handleSDKOutput(_0x1800a3,_0x2d87be);else{console['log'](a28_0x52f7c9[_0x585247(0xfe)]('[/'+_0x409872+']'));const _0x41551c=formatTree(_0x1800a3,{'showMetadata':!![]});console[_0x585247(0x114)](_0x41551c);}return 0x0;}}
1
+ const a28_0x1d8708=a28_0x8d64;function a28_0x8d64(_0x247444,_0x2bbc76){const _0x15861f=a28_0x1586();return a28_0x8d64=function(_0x8d64fd,_0x5108aa){_0x8d64fd=_0x8d64fd-0x1d4;let _0x5665db=_0x15861f[_0x8d64fd];return _0x5665db;},a28_0x8d64(_0x247444,_0x2bbc76);}(function(_0x5622e1,_0x34c727){const _0x1a5fd0=a28_0x8d64,_0x30a0da=_0x5622e1();while(!![]){try{const _0xbf5170=parseInt(_0x1a5fd0(0x1f6))/0x1+-parseInt(_0x1a5fd0(0x205))/0x2+-parseInt(_0x1a5fd0(0x214))/0x3*(parseInt(_0x1a5fd0(0x1de))/0x4)+parseInt(_0x1a5fd0(0x204))/0x5+-parseInt(_0x1a5fd0(0x1ec))/0x6*(-parseInt(_0x1a5fd0(0x1d4))/0x7)+-parseInt(_0x1a5fd0(0x1f3))/0x8+parseInt(_0x1a5fd0(0x1d8))/0x9;if(_0xbf5170===_0x34c727)break;else _0x30a0da['push'](_0x30a0da['shift']());}catch(_0x123ec3){_0x30a0da['push'](_0x30a0da['shift']());}}}(a28_0x1586,0x55c13));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_0x1586(){const _0x5e0a0b=['jsonl','229467OJXjat','\x20segment','map','name','json','239792xWGLlN','resolvePathToResource','verbose','segmentPath','5070627NFetxS','✔\x20Built\x20tree\x20with\x20','includes','population','Building\x20hierarchy\x20tree...','\x20folder','28kXwrBR','cause','listParents','description','\x20parent\x20segment','(empty)','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','message','length','✔\x20Found\x20','error','\x20top-level\x20items','Current\x20context:\x20','listUnified','60ZdyiFo','replace','maxDepth','\x5c$&','localeCompare','data','\x27...','4238352qrHTnV','attributes','Resolving\x20context\x20path\x20\x27','492830YfFhvA','recursive','segment','parentId','Parent\x20ID:\x20','segments','Path/pattern\x20arg:\x20','listRecursive','dim','sort','format','log','Folder\x20ID:\x20','folder','2427475RDnKYt','935640rwRoXH','folderId','Site:\x20','[parent\x20segments]','\x20\x20Cause:\x20','site','👥\x20','Listing\x20parent\x20segments...','Recursive\x20mode:\x20enabled','listParentsWithPattern','Error:\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','filter','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'];a28_0x1586=function(){return _0x5e0a0b;};return a28_0x1586();}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x3ddf56 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x1d8708(0x217)]=a28_0x1d8708(0x1fb);[a28_0x1d8708(0x1e1)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async['execute'](_0x555277){const _0x17c6eb=a28_0x1d8708,{options:_0x5ea423,args:_0x4e2e2d}=_0x555277,_0x43e6ce=_0x5ea423[_0x17c6eb(0x1f7)],_0x28b896=_0x4e2e2d[0x0];try{const _0x3ca76a=_0x5ea423[_0x17c6eb(0x1d7)];_0x5ea423['verbose']&&(console['error'](_0x17c6eb(0x207)+_0x5ea423[_0x17c6eb(0x20a)]),console['error'](_0x17c6eb(0x1ea)+(_0x3ca76a||'/')),_0x28b896&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x1fc)+_0x28b896),_0x43e6ce&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x20d)));if(_0x28b896){const _0x5e6156=_0x28b896[_0x17c6eb(0x1da)]('*')||_0x28b896[_0x17c6eb(0x1da)]('?');if(_0x5e6156&&!_0x3ca76a)return await this[_0x17c6eb(0x20e)](_0x555277,_0x28b896);else return _0x5e6156?(console[_0x17c6eb(0x1e8)](_0x17c6eb(0x1e4)),console[_0x17c6eb(0x1e8)](_0x17c6eb(0x212)),0x1):_0x43e6ce?await this[_0x17c6eb(0x1fd)](_0x555277,_0x28b896):await this['listUnified'](_0x555277,_0x28b896);}if(!_0x3ca76a)return await this[_0x17c6eb(0x1e0)](_0x555277);return _0x43e6ce?await this[_0x17c6eb(0x1fd)](_0x555277,_0x3ca76a):await this['listUnified'](_0x555277,_0x3ca76a);}catch(_0x2f467b){if(_0x2f467b instanceof SDKError)return console[_0x17c6eb(0x1e8)](_0x17c6eb(0x20f)+_0x2f467b[_0x17c6eb(0x1e5)]),_0x2f467b[_0x17c6eb(0x1df)]&&console[_0x17c6eb(0x1e8)](_0x17c6eb(0x209)+_0x2f467b[_0x17c6eb(0x1df)]),0x1;throw _0x2f467b;}}async['listParentsWithPattern'](_0x281817,_0x2eb61c){const _0x13b371=a28_0x1d8708,{options:_0x45ea1c,tdx:_0x22ea53}=_0x281817,_0x1627ef=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x2eb61c+_0x13b371(0x1f2),()=>_0x22ea53['segment'][_0x13b371(0x1e0)](),{'verbose':_0x45ea1c['verbose']}),_0x449c1a=_0x1627ef[_0x13b371(0x1f1)],_0x3cba78=_0x2eb61c[_0x13b371(0x1ed)](/[.+^${}()|[\]\\]/g,_0x13b371(0x1ef))[_0x13b371(0x1ed)](/\*/g,'.*')[_0x13b371(0x1ed)](/\?/g,'.'),_0x13ffc5=new RegExp('^'+_0x3cba78+'$','i'),_0xfb0ae6=_0x449c1a[_0x13b371(0x211)](_0x48f576=>_0x13ffc5['test'](_0x48f576[_0x13b371(0x1f4)]['name']));console[_0x13b371(0x1e8)]('✔\x20Found\x20'+_0xfb0ae6['length']+_0x13b371(0x1e2)+(_0xfb0ae6[_0x13b371(0x1e6)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x2eb61c+'\x27');if(_0x45ea1c['format']==='json'||_0x45ea1c['format']===_0x13b371(0x213))await handleSDKOutput(_0xfb0ae6,_0x45ea1c);else{if(_0xfb0ae6[_0x13b371(0x1e6)]===0x0)console[_0x13b371(0x201)](_0x13b371(0x210)+_0x2eb61c);else{console['log'](_0x13b371(0x208));for(const _0x588037 of _0xfb0ae6){const _0x57d285=_0x588037['attributes'][_0x13b371(0x1db)]?a28_0x3ddf56[_0x13b371(0x1fe)]('\x20('+formatRows(_0x588037['attributes'][_0x13b371(0x1db)])+')'):'';console[_0x13b371(0x201)](_0x13b371(0x20b)+_0x588037[_0x13b371(0x1f4)][_0x13b371(0x217)]+_0x57d285);}}}return 0x0;}async[a28_0x1d8708(0x1e0)](_0x4f5467){const _0x89939c=a28_0x1d8708,{options:_0x2952a6,tdx:_0x34ffc8}=_0x4f5467,_0x406bf0=await withSpinner(_0x89939c(0x20c),()=>_0x34ffc8[_0x89939c(0x1f8)][_0x89939c(0x1e0)](),{'verbose':_0x2952a6[_0x89939c(0x1d6)]}),_0x527580=_0x406bf0[_0x89939c(0x1f1)];console[_0x89939c(0x1e8)](_0x89939c(0x1e7)+_0x527580[_0x89939c(0x1e6)]+'\x20parent\x20segment'+(_0x527580[_0x89939c(0x1e6)]!==0x1?'s':''));if(_0x2952a6['format']===_0x89939c(0x218)||_0x2952a6[_0x89939c(0x200)]==='jsonl')await handleSDKOutput(_0x527580,_0x2952a6);else{console['log']('[parent\x20segments]');for(const _0x272e7c of _0x527580){const _0x2417b6=_0x272e7c['attributes'][_0x89939c(0x1db)]?a28_0x3ddf56[_0x89939c(0x1fe)]('\x20('+formatRows(_0x272e7c[_0x89939c(0x1f4)]['population'])+')'):'';console[_0x89939c(0x201)]('👥\x20'+_0x272e7c[_0x89939c(0x1f4)][_0x89939c(0x217)]+_0x2417b6);}}return 0x0;}async[a28_0x1d8708(0x1eb)](_0x5c36d9,_0x1a3e2c){const _0x269e0a=a28_0x1d8708,{options:_0x222754,tdx:_0x1b9a97}=_0x5c36d9,_0x1b548e=await withSpinner(_0x269e0a(0x1f5)+_0x1a3e2c+_0x269e0a(0x1f2),()=>_0x1b9a97['segment'][_0x269e0a(0x1d5)](_0x1a3e2c),{'verbose':_0x222754['verbose']}),_0x30818d=_0x1b548e[_0x269e0a(0x1f1)];_0x222754[_0x269e0a(0x1d6)]&&(console['error'](_0x269e0a(0x1fa)+_0x30818d[_0x269e0a(0x1f9)]),_0x30818d['folderId']&&console[_0x269e0a(0x1e8)](_0x269e0a(0x202)+_0x30818d[_0x269e0a(0x206)]));const _0x2d52df=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x1b9a97[_0x269e0a(0x1f8)]['listUnified'](_0x30818d['parentId'],_0x30818d['folderId']),{'verbose':_0x222754[_0x269e0a(0x1d6)]}),{folders:_0x5059de,segments:_0x3a7d7d}=_0x2d52df[_0x269e0a(0x1f1)],_0x581aba=_0x5059de[_0x269e0a(0x1e6)]+_0x3a7d7d[_0x269e0a(0x1e6)];console[_0x269e0a(0x1e8)](_0x269e0a(0x1e7)+_0x5059de['length']+_0x269e0a(0x1dd)+(_0x5059de[_0x269e0a(0x1e6)]!==0x1?'s':'')+'\x20and\x20'+_0x3a7d7d[_0x269e0a(0x1e6)]+_0x269e0a(0x215)+(_0x3a7d7d[_0x269e0a(0x1e6)]!==0x1?'s':''));if(_0x222754[_0x269e0a(0x200)]===_0x269e0a(0x218)||_0x222754[_0x269e0a(0x200)]==='jsonl'){const _0x12d1fc=[..._0x5059de[_0x269e0a(0x216)](_0x333b0=>({..._0x333b0,'type':_0x269e0a(0x203)})),..._0x3a7d7d['map'](_0x198047=>({..._0x198047,'type':_0x269e0a(0x1f8)}))][_0x269e0a(0x1ff)]((_0x15446a,_0x279398)=>_0x15446a['name'][_0x269e0a(0x1f0)](_0x279398[_0x269e0a(0x217)]));await handleSDKOutput(_0x12d1fc,_0x222754);}else{if(_0x581aba===0x0)console[_0x269e0a(0x201)](a28_0x3ddf56[_0x269e0a(0x1fe)]('[/'+_0x1a3e2c+']')),console[_0x269e0a(0x201)](_0x269e0a(0x1e3));else{console[_0x269e0a(0x201)](a28_0x3ddf56['dim']('[/'+_0x1a3e2c+']'));const _0xee204c=formatFlatList(_0x5059de,_0x3a7d7d,{'showMetadata':!![]});console[_0x269e0a(0x201)](_0xee204c);}}return 0x0;}async[a28_0x1d8708(0x1fd)](_0x1c8cb2,_0xa9d52d){const _0x397d17=a28_0x1d8708,{options:_0x3f0efa,tdx:_0x5173d5}=_0x1c8cb2,_0x636780=await withSpinner(_0x397d17(0x1f5)+_0xa9d52d+_0x397d17(0x1f2),()=>_0x5173d5[_0x397d17(0x1f8)]['resolvePathToResource'](_0xa9d52d),{'verbose':_0x3f0efa[_0x397d17(0x1d6)]}),_0x4196fc=_0x636780[_0x397d17(0x1f1)];_0x3f0efa['verbose']&&(console[_0x397d17(0x1e8)]('Parent\x20ID:\x20'+_0x4196fc[_0x397d17(0x1f9)]),_0x4196fc[_0x397d17(0x206)]&&console[_0x397d17(0x1e8)](_0x397d17(0x202)+_0x4196fc[_0x397d17(0x206)]));const _0x42f196=_0x3f0efa[_0x397d17(0x1ee)]||0xa,_0xc4d9c8=await withSpinner(_0x397d17(0x1dc),()=>_0x5173d5[_0x397d17(0x1f8)]['listRecursive'](_0x4196fc[_0x397d17(0x1f9)],_0x4196fc[_0x397d17(0x206)],0x0,_0x42f196),{'verbose':_0x3f0efa[_0x397d17(0x1d6)]}),_0x3b2e86=_0xc4d9c8[_0x397d17(0x1f1)];console[_0x397d17(0x1e8)](_0x397d17(0x1d9)+_0x3b2e86[_0x397d17(0x1e6)]+_0x397d17(0x1e9));if(_0x3f0efa['format']==='json'||_0x3f0efa[_0x397d17(0x200)]===_0x397d17(0x213))await handleSDKOutput(_0x3b2e86,_0x3f0efa);else{console['log'](a28_0x3ddf56['dim']('[/'+_0xa9d52d+']'));const _0x53c644=formatTree(_0x3b2e86,{'showMetadata':!![]});console[_0x397d17(0x201)](_0x53c644);}return 0x0;}}
@@ -1 +1 @@
1
- const a29_0x4162b1=a29_0x114f;function a29_0x114f(_0x25f2d1,_0x51e5e3){const _0x52a07a=a29_0x52a0();return a29_0x114f=function(_0x114f04,_0x1dfe2d){_0x114f04=_0x114f04-0xc3;let _0x30d1f3=_0x52a07a[_0x114f04];return _0x30d1f3;},a29_0x114f(_0x25f2d1,_0x51e5e3);}(function(_0x399f35,_0x38e9d9){const _0x5970eb=a29_0x114f,_0x10ebb9=_0x399f35();while(!![]){try{const _0x36a104=-parseInt(_0x5970eb(0xc8))/0x1*(-parseInt(_0x5970eb(0xc6))/0x2)+-parseInt(_0x5970eb(0xc9))/0x3*(-parseInt(_0x5970eb(0xcd))/0x4)+parseInt(_0x5970eb(0xe3))/0x5*(parseInt(_0x5970eb(0xe2))/0x6)+-parseInt(_0x5970eb(0xc4))/0x7*(parseInt(_0x5970eb(0xdd))/0x8)+-parseInt(_0x5970eb(0xcb))/0x9*(parseInt(_0x5970eb(0xde))/0xa)+-parseInt(_0x5970eb(0xe5))/0xb+parseInt(_0x5970eb(0xec))/0xc;if(_0x36a104===_0x38e9d9)break;else _0x10ebb9['push'](_0x10ebb9['shift']());}catch(_0x38c13b){_0x10ebb9['push'](_0x10ebb9['shift']());}}}(a29_0x52a0,0xabdc3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a29_0x52a0(){const _0x2000d6=['\x20row','verbose','Show\x20table\x20contents','Error:\x20','site','error','message','cause','2325936fhWtqv','489950MKIpXj','✔\x20Retrieved\x20','database','showTable','30yGztca','618675DWgMDx','description','7820351OcOlaZ','table','...','Site:\x20','Catalog:\x20','show','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','7919100gmDilL','args','14aKLSBg','length','30ETAfCT','catalog','79791TNyjiy','473502wEHCNA','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','117UWTOkq','Usage:\x20tdx\x20show\x20<database.table>','4HQNhZr','validate','name','Table:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20from\x20','data','execute'];a29_0x52a0=function(){return _0x2000d6;};return a29_0x52a0();}import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x4162b1(0xcf)]=a29_0x4162b1(0xea);[a29_0x4162b1(0xe4)]=a29_0x4162b1(0xd7);async[a29_0x4162b1(0xd4)](_0x32e594){const _0x4afef4=a29_0x4162b1;return this[_0x4afef4(0xe1)](_0x32e594);}async[a29_0x4162b1(0xe1)](_0x2535d7){const _0x47b16f=a29_0x4162b1,{options:_0x57b520,args:_0x4e7444,tdx:_0x292c75}=_0x2535d7;let _0x383d53;try{_0x383d53=parseTableReference(_0x4e7444[0x0]);const _0x450373=_0x57b520[_0x47b16f(0xe0)];!_0x383d53[_0x47b16f(0xe0)]&&_0x450373&&(_0x383d53[_0x47b16f(0xe0)]=_0x450373);const _0x1ba9c7=validateTableDescribeReference(_0x383d53);if(_0x1ba9c7)return console[_0x47b16f(0xda)]('Error:\x20'+_0x1ba9c7),console[_0x47b16f(0xda)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x47b16f(0xda)](_0x47b16f(0xd1)),console[_0x47b16f(0xda)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0xea9fbf){return console[_0x47b16f(0xda)](_0x47b16f(0xd8)+_0xea9fbf[_0x47b16f(0xdb)]),console[_0x47b16f(0xda)](_0x47b16f(0xcc)),console[_0x47b16f(0xda)](_0x47b16f(0xd1)),console[_0x47b16f(0xda)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x471d7b=_0x383d53[_0x47b16f(0xc7)],_0x105906=_0x383d53[_0x47b16f(0xe0)],_0x3c2dbe=_0x383d53[_0x47b16f(0xe6)],_0x54e283=_0x57b520['limit'];try{_0x57b520[_0x47b16f(0xd6)]&&(console[_0x47b16f(0xda)](_0x47b16f(0xe8)+_0x57b520[_0x47b16f(0xd9)]),_0x471d7b&&console[_0x47b16f(0xda)](_0x47b16f(0xe9)+_0x471d7b),console[_0x47b16f(0xda)]('Database:\x20'+_0x105906),console[_0x47b16f(0xda)](_0x47b16f(0xd0)+_0x3c2dbe),console[_0x47b16f(0xda)]('Limit:\x20'+_0x54e283));const _0x5ce6fe=_0x471d7b?_0x471d7b+'.'+_0x105906+'.'+_0x3c2dbe:_0x105906+'.'+_0x3c2dbe,_0x4fb5b0=await withSpinner('Querying\x20'+_0x5ce6fe+_0x47b16f(0xe7),()=>_0x292c75[_0x47b16f(0xe6)][_0x47b16f(0xea)](_0x105906,_0x3c2dbe,_0x54e283,_0x471d7b),{'verbose':_0x57b520['verbose']}),_0xa172e1=_0x4fb5b0[_0x47b16f(0xd3)],_0x51808f=_0xa172e1[_0x47b16f(0xd3)];return _0x51808f[_0x47b16f(0xc5)]===0x0?console[_0x47b16f(0xda)](_0x47b16f(0xca)):console[_0x47b16f(0xda)](_0x47b16f(0xdf)+_0x51808f[_0x47b16f(0xc5)]+_0x47b16f(0xd5)+(_0x51808f[_0x47b16f(0xc5)]!==0x1?'s':'')+_0x47b16f(0xd2)+_0x5ce6fe),await handleSDKOutput(_0x51808f,_0x57b520),0x0;}catch(_0x26a6d0){if(_0x26a6d0 instanceof SDKError)return console[_0x47b16f(0xda)]('Error:\x20'+_0x26a6d0['message']),_0x26a6d0[_0x47b16f(0xdc)]&&console[_0x47b16f(0xda)]('\x20\x20Cause:\x20'+_0x26a6d0[_0x47b16f(0xdc)]),0x1;throw _0x26a6d0;}}[a29_0x4162b1(0xce)](_0xd331c7){const _0x572f82=a29_0x4162b1;if(_0xd331c7[_0x572f82(0xc3)][_0x572f82(0xc5)]===0x0)return _0x572f82(0xeb);if(_0xd331c7[_0x572f82(0xc3)][_0x572f82(0xc5)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
1
+ const a29_0x2ed005=a29_0x45da;(function(_0x366bc0,_0x41cb5e){const _0x400166=a29_0x45da,_0x48c37a=_0x366bc0();while(!![]){try{const _0x5ca2da=parseInt(_0x400166(0xef))/0x1*(parseInt(_0x400166(0xce))/0x2)+parseInt(_0x400166(0xde))/0x3+-parseInt(_0x400166(0xf6))/0x4*(-parseInt(_0x400166(0xd1))/0x5)+-parseInt(_0x400166(0xe1))/0x6+-parseInt(_0x400166(0xe4))/0x7*(parseInt(_0x400166(0xe7))/0x8)+parseInt(_0x400166(0xd7))/0x9+parseInt(_0x400166(0xe3))/0xa*(-parseInt(_0x400166(0xe0))/0xb);if(_0x5ca2da===_0x41cb5e)break;else _0x48c37a['push'](_0x48c37a['shift']());}catch(_0x4475f4){_0x48c37a['push'](_0x48c37a['shift']());}}}(a29_0x129b,0x64247));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a29_0x129b(){const _0x515a6a=['20992VymsEy','\x20from\x20','validate','4050845wUYVHM','site','showTable','Catalog:\x20','length','\x20\x20Cause:\x20','1136070kOSqCu','args','description','verbose','execute','cause','error','1758132qfYget','message','11aYWYSj','2245890wWdREC','Table:\x20','12790220IVCWFg','287qYNQAg','show','limit','19352BhSOUL','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Limit:\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','...','\x20row','data','61bThTpG','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Querying\x20','Error:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','database','name','4wbsNFO','Show\x20table\x20contents','Usage:\x20tdx\x20show\x20<database.table>'];a29_0x129b=function(){return _0x515a6a;};return a29_0x129b();}function a29_0x45da(_0x5768fc,_0x37d803){const _0x129b8b=a29_0x129b();return a29_0x45da=function(_0x45da4b,_0x595d81){_0x45da4b=_0x45da4b-0xcc;let _0x2b2c2a=_0x129b8b[_0x45da4b];return _0x2b2c2a;},a29_0x45da(_0x5768fc,_0x37d803);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x2ed005(0xf5)]=a29_0x2ed005(0xe5);[a29_0x2ed005(0xd9)]=a29_0x2ed005(0xcc);async[a29_0x2ed005(0xdb)](_0x1a9b4e){const _0x1881e3=a29_0x2ed005;return this[_0x1881e3(0xd3)](_0x1a9b4e);}async['showTable'](_0x417e38){const _0xc7b28a=a29_0x2ed005,{options:_0x57eb8e,args:_0x312e2a,tdx:_0x5878e4}=_0x417e38;let _0x3f6029;try{_0x3f6029=parseTableReference(_0x312e2a[0x0]);const _0x245aa2=_0x57eb8e[_0xc7b28a(0xf4)];!_0x3f6029[_0xc7b28a(0xf4)]&&_0x245aa2&&(_0x3f6029[_0xc7b28a(0xf4)]=_0x245aa2);const _0x1c9f39=validateTableDescribeReference(_0x3f6029);if(_0x1c9f39)return console[_0xc7b28a(0xdd)](_0xc7b28a(0xf2)+_0x1c9f39),console[_0xc7b28a(0xdd)](_0xc7b28a(0xcd)),console[_0xc7b28a(0xdd)](_0xc7b28a(0xf0)),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe8)),0x1;}catch(_0x113032){return console[_0xc7b28a(0xdd)](_0xc7b28a(0xf2)+_0x113032[_0xc7b28a(0xdf)]),console[_0xc7b28a(0xdd)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xc7b28a(0xdd)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe8)),0x1;}const _0x57ed77=_0x3f6029['catalog'],_0x403a72=_0x3f6029[_0xc7b28a(0xf4)],_0x34eba1=_0x3f6029['table'],_0x326ff7=_0x57eb8e[_0xc7b28a(0xe6)];try{_0x57eb8e[_0xc7b28a(0xda)]&&(console[_0xc7b28a(0xdd)]('Site:\x20'+_0x57eb8e[_0xc7b28a(0xd2)]),_0x57ed77&&console[_0xc7b28a(0xdd)](_0xc7b28a(0xd4)+_0x57ed77),console[_0xc7b28a(0xdd)]('Database:\x20'+_0x403a72),console[_0xc7b28a(0xdd)](_0xc7b28a(0xe2)+_0x34eba1),console[_0xc7b28a(0xdd)](_0xc7b28a(0xea)+_0x326ff7));const _0x3c01c3=_0x57ed77?_0x57ed77+'.'+_0x403a72+'.'+_0x34eba1:_0x403a72+'.'+_0x34eba1,_0x4190a7=await withSpinner(_0xc7b28a(0xf1)+_0x3c01c3+_0xc7b28a(0xec),()=>_0x5878e4['table'][_0xc7b28a(0xe5)](_0x403a72,_0x34eba1,_0x326ff7,_0x57ed77),{'verbose':_0x57eb8e[_0xc7b28a(0xda)]}),_0x470334=_0x4190a7[_0xc7b28a(0xee)],_0x256a34=_0x470334[_0xc7b28a(0xee)];return _0x256a34[_0xc7b28a(0xd5)]===0x0?console[_0xc7b28a(0xdd)](_0xc7b28a(0xe9)):console['error']('✔\x20Retrieved\x20'+_0x256a34[_0xc7b28a(0xd5)]+_0xc7b28a(0xed)+(_0x256a34['length']!==0x1?'s':'')+_0xc7b28a(0xcf)+_0x3c01c3),await handleSDKOutput(_0x256a34,_0x57eb8e),0x0;}catch(_0x56c664){if(_0x56c664 instanceof SDKError)return console['error']('Error:\x20'+_0x56c664[_0xc7b28a(0xdf)]),_0x56c664[_0xc7b28a(0xdc)]&&console['error'](_0xc7b28a(0xd6)+_0x56c664['cause']),0x1;throw _0x56c664;}}[a29_0x2ed005(0xd0)](_0x18d4a9){const _0xc8b005=a29_0x2ed005;if(_0x18d4a9[_0xc8b005(0xd8)]['length']===0x0)return _0xc8b005(0xeb);if(_0x18d4a9[_0xc8b005(0xd8)][_0xc8b005(0xd5)]>0x1)return _0xc8b005(0xf3);return undefined;}}