@treasuredata/tdx 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-api-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-api-client.js +1 -1
  7. package/dist/client/rate-limiter.js +1 -1
  8. package/dist/client/td-api-client.js +1 -1
  9. package/dist/client/trino-api-client.js +1 -1
  10. package/dist/client/workflow-client.d.ts +17 -1
  11. package/dist/client/workflow-client.d.ts.map +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/client/workflow-client.js.map +1 -1
  14. package/dist/commands/activations.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/context-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/llm-proxy.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pwd-command.js +1 -1
  33. package/dist/commands/segment-update-command.js +1 -1
  34. package/dist/commands/segment-use-command.js +1 -1
  35. package/dist/commands/segments.js +1 -1
  36. package/dist/commands/show.js +1 -1
  37. package/dist/commands/tables.js +1 -1
  38. package/dist/commands/use-command.js +1 -1
  39. package/dist/commands/workflow-command.d.ts +9 -1
  40. package/dist/commands/workflow-command.d.ts.map +1 -1
  41. package/dist/commands/workflow-command.js +1 -1
  42. package/dist/commands/workflow-command.js.map +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/config.js +1 -1
  45. package/dist/core/global-context.js +1 -1
  46. package/dist/core/profile.js +1 -1
  47. package/dist/core/project-config.js +1 -1
  48. package/dist/core/session.js +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/proxy/anthropic-adapter.js +1 -1
  51. package/dist/proxy/server.js +1 -1
  52. package/dist/proxy/session-cache.js +1 -1
  53. package/dist/sdk/api.js +1 -1
  54. package/dist/sdk/errors.js +1 -1
  55. package/dist/sdk/index.js +1 -1
  56. package/dist/sdk/job.js +1 -1
  57. package/dist/sdk/llm.js +1 -1
  58. package/dist/sdk/query.js +1 -1
  59. package/dist/sdk/segment.js +1 -1
  60. package/dist/sdk/workflow.d.ts +52 -16
  61. package/dist/sdk/workflow.d.ts.map +1 -1
  62. package/dist/sdk/workflow.js +1 -1
  63. package/dist/sdk/workflow.js.map +1 -1
  64. package/dist/types/endpoints.js +1 -1
  65. package/dist/types/index.d.ts +1 -1
  66. package/dist/types/index.d.ts.map +1 -1
  67. package/dist/types/index.js +1 -1
  68. package/dist/types/workflow.d.ts +49 -0
  69. package/dist/types/workflow.d.ts.map +1 -1
  70. package/dist/utils/agent-ref-parser.js +1 -1
  71. package/dist/utils/chat-cache.js +1 -1
  72. package/dist/utils/colors.js +1 -1
  73. package/dist/utils/command-output.d.ts.map +1 -1
  74. package/dist/utils/command-output.js +1 -1
  75. package/dist/utils/command-output.js.map +1 -1
  76. package/dist/utils/constants.js +1 -1
  77. package/dist/utils/file-permissions.js +1 -1
  78. package/dist/utils/format-detector.js +1 -1
  79. package/dist/utils/formatters.js +1 -1
  80. package/dist/utils/json-loader.js +1 -1
  81. package/dist/utils/model-aliases.js +1 -1
  82. package/dist/utils/option-validation.js +1 -1
  83. package/dist/utils/port.js +1 -1
  84. package/dist/utils/process.js +1 -1
  85. package/dist/utils/prompt.js +1 -1
  86. package/dist/utils/segment-path-parser.js +1 -1
  87. package/dist/utils/segment-ref-parser.js +1 -1
  88. package/dist/utils/spinner.js +1 -1
  89. package/dist/utils/sql-parser.js +1 -1
  90. package/dist/utils/sse-parser.js +1 -1
  91. package/dist/utils/string-utils.js +1 -1
  92. package/dist/utils/table-ref-parser.js +1 -1
  93. package/dist/utils/tdx-logger.js +1 -1
  94. package/dist/utils/tree-formatter.js +1 -1
  95. package/dist/utils/version-check.js +1 -1
  96. package/dist/utils/workflow-utils.js +1 -1
  97. package/package.json +1 -1
@@ -1 +1 @@
1
- function a19_0x50e8(_0x170f1f,_0x3acdae){const _0x4d7b09=a19_0x4d7b();return a19_0x50e8=function(_0x50e8cf,_0x3d933c){_0x50e8cf=_0x50e8cf-0x1a1;let _0x4f93a1=_0x4d7b09[_0x50e8cf];return _0x4f93a1;},a19_0x50e8(_0x170f1f,_0x3acdae);}const a19_0x3183e0=a19_0x50e8;(function(_0x4f4345,_0x59a80c){const _0x42f632=a19_0x50e8,_0x1dcc8a=_0x4f4345();while(!![]){try{const _0x50e352=-parseInt(_0x42f632(0x1a3))/0x1+parseInt(_0x42f632(0x1c6))/0x2*(-parseInt(_0x42f632(0x1d0))/0x3)+-parseInt(_0x42f632(0x1b4))/0x4*(parseInt(_0x42f632(0x1c3))/0x5)+-parseInt(_0x42f632(0x1e0))/0x6+-parseInt(_0x42f632(0x1be))/0x7+parseInt(_0x42f632(0x1c5))/0x8+parseInt(_0x42f632(0x1c2))/0x9;if(_0x50e352===_0x59a80c)break;else _0x1dcc8a['push'](_0x1dcc8a['shift']());}catch(_0x7a9c77){_0x1dcc8a['push'](_0x1dcc8a['shift']());}}}(a19_0x4d7b,0x75a4d));import a19_0x16f6fe from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x3defbf,_0x4271e5){const _0x4bdcc0=a19_0x50e8,{tdx:_0x3babc6,options:_0x353d68}=_0x3defbf,_0x4148cf=_0x4271e5||_0x353d68[_0x4bdcc0(0x1c8)];if(_0x4148cf){const _0x515583=await _0x3babc6[_0x4bdcc0(0x1a8)][_0x4bdcc0(0x1ad)](),_0x2610c9=_0x515583[_0x4bdcc0(0x1ab)](_0x3bbea2=>_0x3bbea2[_0x4bdcc0(0x1bf)]['name']===_0x4148cf);if(!_0x2610c9)throw new SDKError(ErrorCode[_0x4bdcc0(0x1df)],'Project\x20\x27'+_0x4148cf+_0x4bdcc0(0x1c9),undefined,{'helpText':_0x4bdcc0(0x1a2)});return _0x2610c9['id'];}const _0x28885b=await _0x3babc6[_0x4bdcc0(0x1a8)][_0x4bdcc0(0x1d3)]();return _0x28885b['id'];}function a19_0x4d7b(){const _0x3fd57f=['\x0aClaude\x20Code\x20Configuration:','\x0a\x0aShutting\x20down\x20proxy\x20server...','log','4KPzZPY','bold','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','Port\x20','dim','SIGINT','\x20\x20Project:','white','\x20\x20}','3062136xKdKwL','attributes','yellow','name','22556025glUBHD','2346130bjNggk','port','986568nQPiHr','508054WSTMxb','Server\x20Configuration:','llmProject','\x27\x20not\x20found','\x20\x20{','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','llm:proxy','cyan','stop','3LujSbB','project','logger','getOrCreateDefaultProject','\x20is\x20unavailable,\x20using\x20port\x20','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','execute','\x20\x20Agents:','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','server','\x0aTesting\x20with\x20Agent\x20SDK:','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','green','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','NOT_FOUND','5256060aXsgEB','close','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','110966mcGlRE','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','exit','Resolving\x20project...','\x20\x20Site:','llm','site','\x20\x20Address:','find','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','projects','\x20\x20\x20\x20}','✓\x20Proxy\x20server\x20stopped','Starting\x20proxy\x20server...'];a19_0x4d7b=function(){return _0x3fd57f;};return a19_0x4d7b();}export class LLMProxyCommand extends BaseCommand{[a19_0x3183e0(0x1c1)]=a19_0x3183e0(0x1cd);['description']=a19_0x3183e0(0x1db);['server'];[a19_0x3183e0(0x1d2)];async[a19_0x3183e0(0x1d6)](_0x4df65a){const _0x549674=a19_0x3183e0,{tdx:_0x5824b6,options:_0x1398dc}=_0x4df65a;try{const _0x1195ec=_0x1398dc,_0x43192b=_0x1195ec[_0x549674(0x1c4)]||0xfa0,_0x440663=_0x1195ec[_0x549674(0x1d1)],_0x257818=await findAvailablePort(_0x43192b);console['log'](a19_0x16f6fe[_0x549674(0x1b9)](_0x549674(0x1a6)));const _0x1b7c48=await getProjectIdOrDefault(_0x4df65a,_0x440663),_0x2290de=await _0x5824b6[_0x549674(0x1a8)][_0x549674(0x1ad)](),_0x2ac35b=_0x2290de['find'](_0x5081b1=>_0x5081b1['id']===_0x1b7c48);this[_0x549674(0x1d2)]=new TDXLogger(_0x1398dc['logLevel']),await this[_0x549674(0x1d2)]['init'](),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1b9)](_0x549674(0x1b0)));_0x257818!==_0x43192b&&console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1c0)](_0x549674(0x1b8)+_0x43192b+_0x549674(0x1d4)+_0x257818));this[_0x549674(0x1d9)]=new ProxyServer({'port':_0x257818,'projectId':_0x1b7c48,'tdx':_0x5824b6,'logger':this[_0x549674(0x1d2)],'site':_0x1398dc[_0x549674(0x1a9)]}),await this[_0x549674(0x1d9)]['start'](),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1c0)]['bold']('\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE')),console[_0x549674(0x1b3)](a19_0x16f6fe['yellow'](_0x549674(0x1b6))),console[_0x549674(0x1b3)](a19_0x16f6fe['yellow'](_0x549674(0x1b7))),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1dc)][_0x549674(0x1b5)](_0x549674(0x1d5))),console[_0x549674(0x1b3)](a19_0x16f6fe['cyan'](_0x549674(0x1c7))),console[_0x549674(0x1b3)](a19_0x16f6fe['dim'](_0x549674(0x1aa)),a19_0x16f6fe[_0x549674(0x1bc)]('http://0.0.0.0:'+_0x257818)),console['log'](a19_0x16f6fe['dim'](_0x549674(0x1bb)),a19_0x16f6fe[_0x549674(0x1bc)](_0x2ac35b?.['attributes']['name']||_0x1b7c48)),console['log'](a19_0x16f6fe[_0x549674(0x1b9)](_0x549674(0x1d7)),a19_0x16f6fe[_0x549674(0x1bc)]('created\x20on-demand\x20per\x20model')),console['log'](a19_0x16f6fe[_0x549674(0x1b9)](_0x549674(0x1a7)),a19_0x16f6fe[_0x549674(0x1bc)](_0x1398dc[_0x549674(0x1a9)])),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1ce)](_0x549674(0x1b1))),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1b9)](_0x549674(0x1d8))),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1bc)](_0x549674(0x1ca))),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1bc)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0x549674(0x1b3)](a19_0x16f6fe['white'](_0x549674(0x1a4)+_0x257818+'\x22,')),console['log'](a19_0x16f6fe[_0x549674(0x1bc)](_0x549674(0x1cb))),console['log'](a19_0x16f6fe['white'](_0x549674(0x1ae))),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1bc)](_0x549674(0x1bd))),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1ce)](_0x549674(0x1da))),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1b9)](_0x549674(0x1cc))),console[_0x549674(0x1b3)](a19_0x16f6fe[_0x549674(0x1b9)](_0x549674(0x1de))),console['log'](a19_0x16f6fe[_0x549674(0x1b9)](_0x549674(0x1ac))),console[_0x549674(0x1b3)](a19_0x16f6fe['yellow'](_0x549674(0x1dd)));const _0x32828c=async()=>{const _0x318a34=_0x549674;console[_0x318a34(0x1b3)](a19_0x16f6fe[_0x318a34(0x1b9)](_0x318a34(0x1b2))),this[_0x318a34(0x1d9)]&&await this['server'][_0x318a34(0x1cf)](),this['logger']&&await this[_0x318a34(0x1d2)][_0x318a34(0x1a1)](),console[_0x318a34(0x1b3)](a19_0x16f6fe[_0x318a34(0x1dc)](_0x318a34(0x1af))),process[_0x318a34(0x1a5)](0x0);};return process['on'](_0x549674(0x1ba),_0x32828c),process['on']('SIGTERM',_0x32828c),await new Promise(()=>{}),0x0;}catch(_0x579c6b){this[_0x549674(0x1d9)]&&await this[_0x549674(0x1d9)]['stop']();this['logger']&&await this['logger'][_0x549674(0x1a1)]();throw _0x579c6b;}}}
1
+ const a19_0x3d76a0=a19_0x41e1;(function(_0x40a4fa,_0x11a754){const _0x21cc18=a19_0x41e1,_0x356b84=_0x40a4fa();while(!![]){try{const _0x3bc0e3=parseInt(_0x21cc18(0x15b))/0x1*(parseInt(_0x21cc18(0x167))/0x2)+-parseInt(_0x21cc18(0x178))/0x3*(parseInt(_0x21cc18(0x14a))/0x4)+-parseInt(_0x21cc18(0x165))/0x5+-parseInt(_0x21cc18(0x156))/0x6*(-parseInt(_0x21cc18(0x170))/0x7)+-parseInt(_0x21cc18(0x145))/0x8+-parseInt(_0x21cc18(0x14e))/0x9+parseInt(_0x21cc18(0x17f))/0xa;if(_0x3bc0e3===_0x11a754)break;else _0x356b84['push'](_0x356b84['shift']());}catch(_0x1f7319){_0x356b84['push'](_0x356b84['shift']());}}}(a19_0x2597,0x41af1));import a19_0x4c6413 from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';function a19_0x41e1(_0x595a5c,_0x4a7d75){const _0x2597d5=a19_0x2597();return a19_0x41e1=function(_0x41e1b1,_0x1e4414){_0x41e1b1=_0x41e1b1-0x142;let _0x5c1b26=_0x2597d5[_0x41e1b1];return _0x5c1b26;},a19_0x41e1(_0x595a5c,_0x4a7d75);}import{TDXLogger}from'../utils/tdx-logger.js';function a19_0x2597(){const _0x5e730b=['project','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','execute','cyan','stop','white','\x20\x20Address:','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','1826680AclmMv','Server\x20Configuration:','4aBmVZl','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','logLevel','\x27\x20not\x20found','dim','port','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','✓\x20Proxy\x20server\x20stopped','48839rQqLOe','\x20\x20\x20\x20}','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','Project\x20\x27','log','yellow','\x0aClaude\x20Code\x20Configuration:','bold','688791BONYeK','\x20\x20Project:','\x20\x20Site:','llm','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','find','http://0.0.0.0:','12950380hXZnbg','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','llmProject','\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript','name','\x20\x20}','[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration','server','start','3676544xUDjWy','projects','logger','SIGINT','green','4rfyqai','Resolving\x20project...','\x20\x20{','getOrCreateDefaultProject','1107612gZKpRY','attributes','Port\x20','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','created\x20on-demand\x20per\x20model','\x20\x20Agents:','\x20is\x20unavailable,\x20using\x20port\x20','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','84QeStZX','site','NOT_FOUND','description','close','26947dnJwEC','SIGTERM'];a19_0x2597=function(){return _0x5e730b;};return a19_0x2597();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x81d6ff,_0x25de78){const _0x7abaa=a19_0x41e1,{tdx:_0x3705b0,options:_0xb8b70c}=_0x81d6ff,_0x463b2f=_0x25de78||_0xb8b70c[_0x7abaa(0x181)];if(_0x463b2f){const _0x2f9ae1=await _0x3705b0[_0x7abaa(0x17b)][_0x7abaa(0x146)](),_0x5ea192=_0x2f9ae1['find'](_0x4617bb=>_0x4617bb[_0x7abaa(0x14f)]['name']===_0x463b2f);if(!_0x5ea192)throw new SDKError(ErrorCode[_0x7abaa(0x158)],_0x7abaa(0x173)+_0x463b2f+_0x7abaa(0x16b),undefined,{'helpText':_0x7abaa(0x17c)});return _0x5ea192['id'];}const _0x47cab7=await _0x3705b0[_0x7abaa(0x17b)][_0x7abaa(0x14d)]();return _0x47cab7['id'];}export class LLMProxyCommand extends BaseCommand{['name']='llm:proxy';[a19_0x3d76a0(0x159)]=a19_0x3d76a0(0x142);[a19_0x3d76a0(0x143)];[a19_0x3d76a0(0x147)];async[a19_0x3d76a0(0x15f)](_0x178791){const _0xb90865=a19_0x3d76a0,{tdx:_0x449b94,options:_0x3a6e24}=_0x178791;try{const _0x1ac8eb=_0x3a6e24,_0x2391f9=_0x1ac8eb[_0xb90865(0x16d)]||0xfa0,_0x2eb270=_0x1ac8eb[_0xb90865(0x15d)],_0x3bfba5=await findAvailablePort(_0x2391f9);console['log'](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x14b)));const _0x36cf15=await getProjectIdOrDefault(_0x178791,_0x2eb270),_0x3ffba9=await _0x449b94[_0xb90865(0x17b)][_0xb90865(0x146)](),_0x1b7b13=_0x3ffba9[_0xb90865(0x17d)](_0x11983e=>_0x11983e['id']===_0x36cf15);this['logger']=new TDXLogger(_0x3a6e24[_0xb90865(0x16a)]),await this[_0xb90865(0x147)]['init'](),console['log'](a19_0x4c6413[_0xb90865(0x16c)]('Starting\x20proxy\x20server...'));_0x3bfba5!==_0x2391f9&&console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x175)](_0xb90865(0x150)+_0x2391f9+_0xb90865(0x154)+_0x3bfba5));this[_0xb90865(0x143)]=new ProxyServer({'port':_0x3bfba5,'projectId':_0x36cf15,'tdx':_0x449b94,'logger':this['logger'],'site':_0x3a6e24[_0xb90865(0x157)]}),await this['server'][_0xb90865(0x144)](),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x175)][_0xb90865(0x177)](_0xb90865(0x151))),console['log'](a19_0x4c6413[_0xb90865(0x175)](_0xb90865(0x169))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x175)](_0xb90865(0x172))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x149)][_0xb90865(0x177)](_0xb90865(0x16e))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x160)](_0xb90865(0x166))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x163)),a19_0x4c6413[_0xb90865(0x162)](_0xb90865(0x17e)+_0x3bfba5)),console['log'](a19_0x4c6413['dim'](_0xb90865(0x179)),a19_0x4c6413[_0xb90865(0x162)](_0x1b7b13?.[_0xb90865(0x14f)][_0xb90865(0x183)]||_0x36cf15)),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x153)),a19_0x4c6413[_0xb90865(0x162)](_0xb90865(0x152))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x17a)),a19_0x4c6413[_0xb90865(0x162)](_0x3a6e24[_0xb90865(0x157)])),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x160)](_0xb90865(0x176))),console['log'](a19_0x4c6413['dim'](_0xb90865(0x168))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x162)](_0xb90865(0x14c))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x162)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0xb90865(0x174)](a19_0x4c6413['white'](_0xb90865(0x15e)+_0x3bfba5+'\x22,')),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x162)]('\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22')),console[_0xb90865(0x174)](a19_0x4c6413['white'](_0xb90865(0x171))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x162)](_0xb90865(0x184))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x160)]('\x0aTesting\x20with\x20Agent\x20SDK:')),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x155))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x16c)](_0xb90865(0x182))),console[_0xb90865(0x174)](a19_0x4c6413['dim'](_0xb90865(0x180))),console[_0xb90865(0x174)](a19_0x4c6413[_0xb90865(0x175)](_0xb90865(0x164)));const _0x360b29=async()=>{const _0x1bf1f5=_0xb90865;console['log'](a19_0x4c6413[_0x1bf1f5(0x16c)]('\x0a\x0aShutting\x20down\x20proxy\x20server...')),this[_0x1bf1f5(0x143)]&&await this[_0x1bf1f5(0x143)][_0x1bf1f5(0x161)](),this[_0x1bf1f5(0x147)]&&await this[_0x1bf1f5(0x147)]['close'](),console[_0x1bf1f5(0x174)](a19_0x4c6413[_0x1bf1f5(0x149)](_0x1bf1f5(0x16f))),process['exit'](0x0);};return process['on'](_0xb90865(0x148),_0x360b29),process['on'](_0xb90865(0x15c),_0x360b29),await new Promise(()=>{}),0x0;}catch(_0x3ea90e){this[_0xb90865(0x143)]&&await this[_0xb90865(0x143)][_0xb90865(0x161)]();this[_0xb90865(0x147)]&&await this[_0xb90865(0x147)][_0xb90865(0x15a)]();throw _0x3ea90e;}}}
@@ -1 +1 @@
1
- const a20_0x4e5552=a20_0x514a;(function(_0x5614e0,_0x5d74c9){const _0xf467f8=a20_0x514a,_0x29957b=_0x5614e0();while(!![]){try{const _0x156866=-parseInt(_0xf467f8(0xaa))/0x1+-parseInt(_0xf467f8(0xd9))/0x2+parseInt(_0xf467f8(0xc7))/0x3*(parseInt(_0xf467f8(0xb5))/0x4)+parseInt(_0xf467f8(0xbb))/0x5*(-parseInt(_0xf467f8(0xd6))/0x6)+-parseInt(_0xf467f8(0xc6))/0x7*(parseInt(_0xf467f8(0xb2))/0x8)+-parseInt(_0xf467f8(0xc1))/0x9+parseInt(_0xf467f8(0xca))/0xa*(parseInt(_0xf467f8(0xa9))/0xb);if(_0x156866===_0x5d74c9)break;else _0x29957b['push'](_0x29957b['shift']());}catch(_0x56b457){_0x29957b['push'](_0x29957b['shift']());}}}(a20_0x5914,0x3d54d));import{BaseCommand}from'./command.js';function a20_0x5914(){const _0x17aef8=['segment','145651nlqsyF','453091QFKdrC','table','Error:\x20--database\x20and\x20--table\x20are\x20required','customerGroup','✔\x20Created\x20parent\x20segment\x20\x27','updateParent','\x27...','Parent\x20segment:\x20','24jyXOeu','data','Creating\x20parent\x20segment\x20\x27','664436iBOuLG','attributesFile','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','execute','error','Name:\x20','755aYVJke','Update\x20existing\x20parent\x20segment\x20(audience)','customerGroupFile','name','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','3624561UdBWnh','behaviors','addAttributes','addBehaviorsFile','Updating\x20parent\x20segment\x20\x27','1126657LrfiqZ','9eyGSVt','description','segment:parent:update','1430cUhhwT','attributes','Create\x20new\x20parent\x20segment\x20(audience)','Site:\x20','addAttributesFile','verbose','segment:parent:create','timezone','database','site','scheduleOption','length','16698PvHGdq','Fetching\x20current\x20configuration\x20for\x20\x27','scheduleType','763342zbHzfg','master','\x27\x20with\x20ID:\x20','addBehaviors'];a20_0x5914=function(){return _0x17aef8;};return a20_0x5914();}function a20_0x514a(_0x4de986,_0x3b8c6e){const _0x5914bb=a20_0x5914();return a20_0x514a=function(_0x514a53,_0x5c9ece){_0x514a53=_0x514a53-0xa6;let _0xd03ac7=_0x5914bb[_0x514a53];return _0xd03ac7;},a20_0x514a(_0x4de986,_0x3b8c6e);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a20_0x4e5552(0xbe)]=a20_0x4e5552(0xd0);[a20_0x4e5552(0xc8)]=a20_0x4e5552(0xcc);async[a20_0x4e5552(0xb8)](_0x4eb353){const _0x16b96d=a20_0x4e5552,{options:_0x527a08,args:_0x19c4e4,tdx:_0x1160a9}=_0x4eb353,_0x2efcd2=_0x527a08;if(_0x19c4e4[_0x16b96d(0xd5)]===0x0)return console[_0x16b96d(0xb9)](_0x16b96d(0xbf)),console[_0x16b96d(0xb9)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x114a2a=_0x19c4e4[0x0];if(!_0x2efcd2['database']||!_0x2efcd2['table'])return console[_0x16b96d(0xb9)](_0x16b96d(0xac)),console[_0x16b96d(0xb9)](_0x16b96d(0xc0)),0x1;_0x2efcd2[_0x16b96d(0xcf)]&&(console[_0x16b96d(0xb9)](_0x16b96d(0xcd)+_0x2efcd2['site']),console[_0x16b96d(0xb9)](_0x16b96d(0xba)+_0x114a2a),console[_0x16b96d(0xb9)]('Database:\x20'+_0x2efcd2[_0x16b96d(0xd2)]),console[_0x16b96d(0xb9)]('Table:\x20'+_0x2efcd2[_0x16b96d(0xab)]));const _0x1f4525=await loadJSONFromOptions(_0x2efcd2[_0x16b96d(0xcb)],_0x2efcd2[_0x16b96d(0xb6)]),_0x5d4e73=await loadJSONFromOptions(_0x2efcd2['behaviors'],_0x2efcd2['behaviorsFile']),_0x1083b0=await loadJSONFromOptions(_0x2efcd2[_0x16b96d(0xad)],_0x2efcd2[_0x16b96d(0xbd)]),_0xe23ede={'name':_0x114a2a,'description':_0x2efcd2[_0x16b96d(0xc8)],'scheduleType':_0x2efcd2['scheduleType'],'scheduleOption':_0x2efcd2[_0x16b96d(0xd4)],'timezone':_0x2efcd2['timezone'],'master':{'parentDatabaseName':_0x2efcd2['database'],'parentTableName':_0x2efcd2['table']},'attributes':_0x1f4525,'behaviors':_0x5d4e73,'customerGroup':_0x1083b0},_0x5486f6=await withSpinner(_0x16b96d(0xb4)+_0x114a2a+_0x16b96d(0xb0),()=>_0x1160a9[_0x16b96d(0xa8)]['createParent'](_0xe23ede),{'verbose':_0x527a08[_0x16b96d(0xcf)]}),_0x57212f=_0x5486f6[_0x16b96d(0xb3)];return console['error'](_0x16b96d(0xae)+_0x57212f[_0x16b96d(0xbe)]+_0x16b96d(0xa6)+_0x57212f['id']),await handleSDKOutput([_0x57212f],_0x527a08),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a20_0x4e5552(0xbe)]=a20_0x4e5552(0xc9);['description']=a20_0x4e5552(0xbc);async[a20_0x4e5552(0xb8)](_0x354b12){const _0x55edfc=a20_0x4e5552,{options:_0x168c3f,args:_0x4ea6cd,tdx:_0x1e0231}=_0x354b12,_0x53383e=_0x168c3f;if(_0x4ea6cd[_0x55edfc(0xd5)]===0x0)return console[_0x55edfc(0xb9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x55edfc(0xb9)](_0x55edfc(0xb7)),0x1;const _0x324b01=_0x4ea6cd[0x0];_0x53383e[_0x55edfc(0xcf)]&&(console[_0x55edfc(0xb9)](_0x55edfc(0xcd)+_0x53383e[_0x55edfc(0xd3)]),console[_0x55edfc(0xb9)](_0x55edfc(0xb1)+_0x324b01));const _0x202411=await withSpinner(_0x55edfc(0xd7)+_0x324b01+_0x55edfc(0xb0),()=>_0x1e0231[_0x55edfc(0xa8)]['getParentFull'](_0x324b01),{'verbose':_0x53383e['verbose']}),_0x182adb=_0x202411[_0x55edfc(0xb3)],_0x577038=await loadJSONFromOptions(_0x53383e[_0x55edfc(0xc3)],_0x53383e[_0x55edfc(0xce)]),_0x4fe016=await loadJSONFromOptions(_0x53383e[_0x55edfc(0xa7)],_0x53383e[_0x55edfc(0xc4)]),_0x5aba1e={'name':_0x182adb[_0x55edfc(0xbe)],'description':_0x53383e[_0x55edfc(0xc8)]!==undefined?_0x53383e['description']:_0x182adb[_0x55edfc(0xc8)],'scheduleType':_0x53383e[_0x55edfc(0xd8)]!==undefined?_0x53383e[_0x55edfc(0xd8)]:_0x182adb[_0x55edfc(0xd8)],'scheduleOption':_0x53383e[_0x55edfc(0xd4)]!==undefined?_0x53383e[_0x55edfc(0xd4)]:_0x182adb[_0x55edfc(0xd4)],'timezone':_0x53383e['timezone']!==undefined?_0x53383e[_0x55edfc(0xd1)]:_0x182adb[_0x55edfc(0xd1)],'master':_0x182adb[_0x55edfc(0xda)],'attributes':_0x577038?[..._0x182adb['attributes']||[],..._0x577038]:_0x182adb[_0x55edfc(0xcb)],'behaviors':_0x4fe016?[..._0x182adb[_0x55edfc(0xc2)]||[],..._0x4fe016]:_0x182adb['behaviors'],'customerGroup':_0x182adb[_0x55edfc(0xad)]},_0x4ee716=await withSpinner(_0x55edfc(0xc5)+_0x324b01+'\x27...',()=>_0x1e0231[_0x55edfc(0xa8)][_0x55edfc(0xaf)](_0x324b01,_0x5aba1e),{'verbose':_0x53383e[_0x55edfc(0xcf)]}),_0x362fd0=_0x4ee716[_0x55edfc(0xb3)];return console[_0x55edfc(0xb9)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x362fd0['name']+'\x27'),await handleSDKOutput([_0x362fd0],_0x53383e),0x0;}}
1
+ const a20_0x1217e4=a20_0x1a3a;(function(_0x386051,_0x275329){const _0x24f584=a20_0x1a3a,_0x1e8dae=_0x386051();while(!![]){try{const _0x1a26de=parseInt(_0x24f584(0x75))/0x1+-parseInt(_0x24f584(0x7d))/0x2*(parseInt(_0x24f584(0x8a))/0x3)+parseInt(_0x24f584(0x8c))/0x4*(parseInt(_0x24f584(0x98))/0x5)+-parseInt(_0x24f584(0x83))/0x6+-parseInt(_0x24f584(0x93))/0x7*(-parseInt(_0x24f584(0x6c))/0x8)+-parseInt(_0x24f584(0x88))/0x9*(-parseInt(_0x24f584(0x87))/0xa)+-parseInt(_0x24f584(0x70))/0xb;if(_0x1a26de===_0x275329)break;else _0x1e8dae['push'](_0x1e8dae['shift']());}catch(_0x2e6cee){_0x1e8dae['push'](_0x1e8dae['shift']());}}}(a20_0x142f,0x90d97));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a20_0x1217e4(0x73)]='segment:parent:create';[a20_0x1217e4(0x6d)]=a20_0x1217e4(0x7f);async[a20_0x1217e4(0x96)](_0x7f3c31){const _0x310c36=a20_0x1217e4,{options:_0x565f4b,args:_0x38dbc8,tdx:_0x77e96a}=_0x7f3c31,_0x440bf7=_0x565f4b;if(_0x38dbc8[_0x310c36(0x6b)]===0x0)return console[_0x310c36(0x95)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x5bd1df=_0x38dbc8[0x0];if(!_0x440bf7[_0x310c36(0x6f)]||!_0x440bf7['table'])return console[_0x310c36(0x95)](_0x310c36(0x67)),console[_0x310c36(0x95)](_0x310c36(0x99)),0x1;_0x440bf7[_0x310c36(0x90)]&&(console[_0x310c36(0x95)]('Site:\x20'+_0x440bf7[_0x310c36(0x8f)]),console[_0x310c36(0x95)](_0x310c36(0x89)+_0x5bd1df),console['error'](_0x310c36(0x80)+_0x440bf7[_0x310c36(0x6f)]),console[_0x310c36(0x95)]('Table:\x20'+_0x440bf7['table']));const _0xe1f48a=await loadJSONFromOptions(_0x440bf7[_0x310c36(0x77)],_0x440bf7[_0x310c36(0x85)]),_0x167d9c=await loadJSONFromOptions(_0x440bf7['behaviors'],_0x440bf7[_0x310c36(0x71)]),_0x50f61f=await loadJSONFromOptions(_0x440bf7['customerGroup'],_0x440bf7[_0x310c36(0x97)]),_0xce84d3={'name':_0x5bd1df,'description':_0x440bf7['description'],'scheduleType':_0x440bf7[_0x310c36(0x84)],'scheduleOption':_0x440bf7['scheduleOption'],'timezone':_0x440bf7['timezone'],'master':{'parentDatabaseName':_0x440bf7[_0x310c36(0x6f)],'parentTableName':_0x440bf7[_0x310c36(0x8e)]},'attributes':_0xe1f48a,'behaviors':_0x167d9c,'customerGroup':_0x50f61f},_0xf4f051=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x5bd1df+_0x310c36(0x7c),()=>_0x77e96a[_0x310c36(0x7a)]['createParent'](_0xce84d3),{'verbose':_0x565f4b[_0x310c36(0x90)]}),_0xd80ecd=_0xf4f051[_0x310c36(0x91)];return console[_0x310c36(0x95)](_0x310c36(0x8b)+_0xd80ecd[_0x310c36(0x73)]+'\x27\x20with\x20ID:\x20'+_0xd80ecd['id']),await handleSDKOutput([_0xd80ecd],_0x565f4b),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a20_0x1217e4(0x73)]=a20_0x1217e4(0x94);[a20_0x1217e4(0x6d)]=a20_0x1217e4(0x7b);async[a20_0x1217e4(0x96)](_0x570809){const _0x175cf5=a20_0x1217e4,{options:_0x1bb193,args:_0x5cc0e7,tdx:_0x189a33}=_0x570809,_0xd6c9f5=_0x1bb193;if(_0x5cc0e7[_0x175cf5(0x6b)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x175cf5(0x95)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x2b0770=_0x5cc0e7[0x0];_0xd6c9f5[_0x175cf5(0x90)]&&(console[_0x175cf5(0x95)](_0x175cf5(0x72)+_0xd6c9f5[_0x175cf5(0x8f)]),console['error'](_0x175cf5(0x74)+_0x2b0770));const _0x1cf467=await withSpinner(_0x175cf5(0x7e)+_0x2b0770+_0x175cf5(0x7c),()=>_0x189a33['segment'][_0x175cf5(0x92)](_0x2b0770),{'verbose':_0xd6c9f5[_0x175cf5(0x90)]}),_0x281318=_0x1cf467[_0x175cf5(0x91)],_0x32b121=await loadJSONFromOptions(_0xd6c9f5[_0x175cf5(0x6a)],_0xd6c9f5[_0x175cf5(0x8d)]),_0x44a261=await loadJSONFromOptions(_0xd6c9f5[_0x175cf5(0x82)],_0xd6c9f5[_0x175cf5(0x68)]),_0x3657f8={'name':_0x281318[_0x175cf5(0x73)],'description':_0xd6c9f5[_0x175cf5(0x6d)]!==undefined?_0xd6c9f5[_0x175cf5(0x6d)]:_0x281318[_0x175cf5(0x6d)],'scheduleType':_0xd6c9f5[_0x175cf5(0x84)]!==undefined?_0xd6c9f5[_0x175cf5(0x84)]:_0x281318['scheduleType'],'scheduleOption':_0xd6c9f5[_0x175cf5(0x76)]!==undefined?_0xd6c9f5['scheduleOption']:_0x281318[_0x175cf5(0x76)],'timezone':_0xd6c9f5[_0x175cf5(0x69)]!==undefined?_0xd6c9f5[_0x175cf5(0x69)]:_0x281318[_0x175cf5(0x69)],'master':_0x281318[_0x175cf5(0x86)],'attributes':_0x32b121?[..._0x281318['attributes']||[],..._0x32b121]:_0x281318[_0x175cf5(0x77)],'behaviors':_0x44a261?[..._0x281318['behaviors']||[],..._0x44a261]:_0x281318[_0x175cf5(0x6e)],'customerGroup':_0x281318[_0x175cf5(0x78)]},_0x578e9e=await withSpinner(_0x175cf5(0x81)+_0x2b0770+_0x175cf5(0x7c),()=>_0x189a33[_0x175cf5(0x7a)]['updateParent'](_0x2b0770,_0x3657f8),{'verbose':_0xd6c9f5[_0x175cf5(0x90)]}),_0x2cb7fe=_0x578e9e['data'];return console['error'](_0x175cf5(0x79)+_0x2cb7fe[_0x175cf5(0x73)]+'\x27'),await handleSDKOutput([_0x2cb7fe],_0xd6c9f5),0x0;}}function a20_0x1a3a(_0x57cbe,_0x313926){const _0x142f35=a20_0x142f();return a20_0x1a3a=function(_0x1a3ace,_0x2eb2e7){_0x1a3ace=_0x1a3ace-0x67;let _0x49d358=_0x142f35[_0x1a3ace];return _0x49d358;},a20_0x1a3a(_0x57cbe,_0x313926);}function a20_0x142f(){const _0x237b81=['addBehaviorsFile','timezone','addAttributes','length','1437872HXnjwe','description','behaviors','database','1549834NleCua','behaviorsFile','Site:\x20','name','Parent\x20segment:\x20','684473MGSiXX','scheduleOption','attributes','customerGroup','✔\x20Updated\x20parent\x20segment\x20\x27','segment','Update\x20existing\x20parent\x20segment\x20(audience)','\x27...','2wDpknR','Fetching\x20current\x20configuration\x20for\x20\x27','Create\x20new\x20parent\x20segment\x20(audience)','Database:\x20','Updating\x20parent\x20segment\x20\x27','addBehaviors','4377552igRyIY','scheduleType','attributesFile','master','10TuuFWB','1182735choIVr','Name:\x20','1013631rHYLee','✔\x20Created\x20parent\x20segment\x20\x27','1786304uWtEsM','addAttributesFile','table','site','verbose','data','getParentFull','21PQcIIz','segment:parent:update','error','execute','customerGroupFile','5OcDiar','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Error:\x20--database\x20and\x20--table\x20are\x20required'];a20_0x142f=function(){return _0x237b81;};return a20_0x142f();}
@@ -1 +1 @@
1
- const a21_0x54df58=a21_0x5982;(function(_0x3e98a8,_0xb26d29){const _0x16a166=a21_0x5982,_0x1bf980=_0x3e98a8();while(!![]){try{const _0x4def1f=-parseInt(_0x16a166(0xec))/0x1+-parseInt(_0x16a166(0xf3))/0x2*(parseInt(_0x16a166(0xef))/0x3)+-parseInt(_0x16a166(0xed))/0x4*(parseInt(_0x16a166(0xf4))/0x5)+parseInt(_0x16a166(0xf2))/0x6+parseInt(_0x16a166(0xf1))/0x7*(parseInt(_0x16a166(0xf0))/0x8)+-parseInt(_0x16a166(0xe8))/0x9+parseInt(_0x16a166(0xfd))/0xa*(parseInt(_0x16a166(0xf9))/0xb);if(_0x4def1f===_0xb26d29)break;else _0x1bf980['push'](_0x1bf980['shift']());}catch(_0xd3c919){_0x1bf980['push'](_0x1bf980['shift']());}}}(a21_0x3f60,0x98dcd));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a21_0x3f60(){const _0xd19f10=['Error:\x20','135586fABdpB','description','log','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2440IEOWxx','\x20\x20Global:\x20~/.config/tdx/tdx.json','error','config','10958976ILafkL','scope','List\x20all\x20available\x20profiles','execute','732582SanHSH','4284536gicPou','name','25593NTUDTE','6312ZSGrRO','308VlKdUM','5422980sOQrEc','70NSiZYU','5nrSqey','profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','message'];a21_0x3f60=function(){return _0xd19f10;};return a21_0x3f60();}function a21_0x5982(_0x38cbcc,_0x3e57ba){const _0x3f60d1=a21_0x3f60();return a21_0x5982=function(_0x5982f1,_0x44b9e3){_0x5982f1=_0x5982f1-0xe6;let _0x249357=_0x3f60d1[_0x5982f1];return _0x249357;},a21_0x5982(_0x38cbcc,_0x3e57ba);}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a21_0x54df58(0xee)]=a21_0x54df58(0xf5);[a21_0x54df58(0xfa)]=a21_0x54df58(0xea);async[a21_0x54df58(0xeb)](_0x53b4f7){const _0x221e65=a21_0x54df58,{options:_0x472f09}=_0x53b4f7;try{const _0x12d3bf=listProfiles(),_0x36b3bc=getActiveProfile();if(_0x12d3bf['length']===0x0)return console[_0x221e65(0xfb)](_0x221e65(0xf6)),console[_0x221e65(0xfb)](_0x221e65(0xfc)),console['log'](_0x221e65(0xfe)),0x0;const _0x2898fd=_0x12d3bf['map'](_0x1c3005=>{const _0x594093=_0x221e65,_0x2a1fb9=_0x1c3005[_0x594093(0xee)]===_0x36b3bc,_0xccede8=getProfileParams(_0x1c3005[_0x594093(0xe7)]);return{'name':_0x1c3005[_0x594093(0xee)],'active':_0x2a1fb9,'scope':_0x1c3005[_0x594093(0xe9)],'description':_0x1c3005['config'][_0x594093(0xfa)]||'','params':_0xccede8};});return await handleSDKOutput(_0x2898fd,_0x472f09),0x0;}catch(_0x13cc51){return _0x13cc51 instanceof Error&&console[_0x221e65(0xe6)](_0x221e65(0xf8)+_0x13cc51[_0x221e65(0xf7)]),0x1;}}}
1
+ const a21_0x4bda32=a21_0x24be;(function(_0x2faca4,_0x28d1bb){const _0x1ddff6=a21_0x24be,_0x2da602=_0x2faca4();while(!![]){try{const _0x56b145=-parseInt(_0x1ddff6(0x83))/0x1+-parseInt(_0x1ddff6(0x86))/0x2*(parseInt(_0x1ddff6(0x89))/0x3)+-parseInt(_0x1ddff6(0x74))/0x4*(parseInt(_0x1ddff6(0x8a))/0x5)+-parseInt(_0x1ddff6(0x78))/0x6*(parseInt(_0x1ddff6(0x8b))/0x7)+parseInt(_0x1ddff6(0x80))/0x8+-parseInt(_0x1ddff6(0x7c))/0x9+-parseInt(_0x1ddff6(0x7a))/0xa*(-parseInt(_0x1ddff6(0x84))/0xb);if(_0x56b145===_0x28d1bb)break;else _0x2da602['push'](_0x2da602['shift']());}catch(_0x55981b){_0x2da602['push'](_0x2da602['shift']());}}}(a21_0x4be9,0x9b5da));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';function a21_0x24be(_0x28f4c3,_0x2449a4){const _0x4be9c1=a21_0x4be9();return a21_0x24be=function(_0x24becf,_0x295c2f){_0x24becf=_0x24becf-0x73;let _0x53c240=_0x4be9c1[_0x24becf];return _0x53c240;},a21_0x24be(_0x28f4c3,_0x2449a4);}export class ProfilesCommand extends BaseCommand{[a21_0x4bda32(0x8c)]=a21_0x4bda32(0x76);[a21_0x4bda32(0x85)]=a21_0x4bda32(0x87);async[a21_0x4bda32(0x82)](_0x41814a){const _0x5cdd79=a21_0x4bda32,{options:_0x50ccef}=_0x41814a;try{const _0x574c41=listProfiles(),_0x19a46f=getActiveProfile();if(_0x574c41[_0x5cdd79(0x73)]===0x0)return console['log'](_0x5cdd79(0x81)),console[_0x5cdd79(0x79)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x5cdd79(0x79)](_0x5cdd79(0x7f)),0x0;const _0x258879=_0x574c41[_0x5cdd79(0x77)](_0x38158c=>{const _0x5d7959=_0x5cdd79,_0x5ba342=_0x38158c['name']===_0x19a46f,_0x452133=getProfileParams(_0x38158c[_0x5d7959(0x88)]);return{'name':_0x38158c[_0x5d7959(0x8c)],'active':_0x5ba342,'scope':_0x38158c[_0x5d7959(0x7e)],'description':_0x38158c[_0x5d7959(0x88)]['description']||'','params':_0x452133};});return await handleSDKOutput(_0x258879,_0x50ccef),0x0;}catch(_0x3f9e31){return _0x3f9e31 instanceof Error&&console[_0x5cdd79(0x7b)](_0x5cdd79(0x75)+_0x3f9e31[_0x5cdd79(0x7d)]),0x1;}}}function a21_0x4be9(){const _0xa08a20=['No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','execute','1236602EXFyWY','59994429BhLEcU','description','44baGCcK','List\x20all\x20available\x20profiles','config','154719ImIHwM','1006685rdyerI','91SnBztN','name','length','24reNrsx','Error:\x20','profiles','map','275118lKfNsT','log','10SnSyuL','error','10498347gJhsMF','message','scope','\x20\x20Global:\x20~/.config/tdx/tdx.json','4193128kuDINS'];a21_0x4be9=function(){return _0xa08a20;};return a21_0x4be9();}
@@ -1 +1 @@
1
- const a22_0x9ddf19=a22_0x4bc1;(function(_0x1d27d8,_0x1968c6){const _0x35dd43=a22_0x4bc1,_0x269e67=_0x1d27d8();while(!![]){try{const _0x1d09ef=parseInt(_0x35dd43(0x14d))/0x1+-parseInt(_0x35dd43(0x13c))/0x2+parseInt(_0x35dd43(0x142))/0x3*(-parseInt(_0x35dd43(0x13d))/0x4)+-parseInt(_0x35dd43(0x15f))/0x5+-parseInt(_0x35dd43(0x135))/0x6+parseInt(_0x35dd43(0x13e))/0x7+parseInt(_0x35dd43(0x14f))/0x8;if(_0x1d09ef===_0x1968c6)break;else _0x269e67['push'](_0x269e67['shift']());}catch(_0x466be5){_0x269e67['push'](_0x269e67['shift']());}}}(a22_0x282a,0xb9d7c));function a22_0x4bc1(_0x52605f,_0x3b31fc){const _0x282ab7=a22_0x282a();return a22_0x4bc1=function(_0x4bc113,_0x36221d){_0x4bc113=_0x4bc113-0x12b;let _0x3334b7=_0x282ab7[_0x4bc113];return _0x3334b7;},a22_0x4bc1(_0x52605f,_0x3b31fc);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';function a22_0x282a(){const _0x2bf896=['validate','length','Site:\x20','7123060eAdcCm','Statement\x20','file','Query\x20completed:\x20Processed\x20','\x0aAll\x20results\x20saved\x20to\x20','\x20[Job\x20ID:\x20','verbose','args','SQL:\x20','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','\x20rows\x20','7539726eJoKbZ','Executing\x20query\x20[','push','Catalog:\x20','stats','setPhase','name','2921940djkrIr','256928VhLPOM','9933623rdEQJW','query','elapsedTimeMillis','join','12RirTAQ','options','execute','catalog','description','processedRows','message','Error:\x20','site','setJobId','output','585453bqyCWt','state','25246408oEtoRU','Executing\x20query...','originalMessage','\x20-\x20','database','information_schema','jobId','completedSplits','error','data','Executing\x20statement\x20','in\x20','\x20splits'];a22_0x282a=function(){return _0x2bf896;};return a22_0x282a();}export class QueryCommand extends BaseCommand{[a22_0x9ddf19(0x13b)]=a22_0x9ddf19(0x13f);[a22_0x9ddf19(0x146)]='Run\x20Trino\x20queries\x20(streaming)';async[a22_0x9ddf19(0x144)](_0x2e79df){const _0x2db9ee=a22_0x9ddf19,{options:_0x40ebf9,args:_0x57f522,tdx:_0x139879}=_0x2e79df,_0x3e7329=_0x57f522[0x0],_0x42643e=_0x40ebf9['file'];let _0x1502ee;if(_0x42643e)try{_0x1502ee=readSqlStatementsFromFile(_0x42643e);}catch(_0x640be){return console[_0x2db9ee(0x157)](_0x2db9ee(0x149)+_0x640be[_0x2db9ee(0x148)]),0x1;}else try{_0x1502ee=splitSqlStatements(_0x3e7329);}catch(_0x38768e){return console[_0x2db9ee(0x157)](_0x2db9ee(0x149)+_0x38768e['message']),0x1;}const _0x386821=_0x40ebf9[_0x2db9ee(0x153)]||_0x2db9ee(0x154),_0x507b85=_0x40ebf9[_0x2db9ee(0x145)];try{const _0x26817a=[],_0x5279de=!!_0x40ebf9[_0x2db9ee(0x14c)];for(let _0xbd07f6=0x0;_0xbd07f6<_0x1502ee[_0x2db9ee(0x15d)];_0xbd07f6++){const _0x5a10e8=_0x1502ee[_0xbd07f6],_0x5dbdaf=_0xbd07f6+0x1,_0x403e95=_0x1502ee[_0x2db9ee(0x15d)],_0x3b88d4=_0x403e95>0x1;_0x40ebf9[_0x2db9ee(0x130)]&&(console['error']('\x0a'+(_0x3b88d4?_0x2db9ee(0x12b)+_0x5dbdaf+'/'+_0x403e95+':':'')),console[_0x2db9ee(0x157)](_0x2db9ee(0x15e)+_0x40ebf9[_0x2db9ee(0x14a)]),console['error'](_0x2db9ee(0x138)+(_0x507b85||'td')),console['error']('Schema:\x20'+_0x386821),console[_0x2db9ee(0x157)](_0x2db9ee(0x132)+_0x5a10e8));const _0x386623=_0x3b88d4?_0x2db9ee(0x159)+_0x5dbdaf+'/'+_0x403e95+'...':_0x2db9ee(0x150);try{const _0x1d4523=await withQuerySpinner(_0x386623,async _0x4c0dcc=>{const _0x2fbc01=_0x2db9ee,_0x13ae69=await _0x139879[_0x2fbc01(0x13f)]['execute'](_0x5a10e8,{'catalog':_0x507b85,'schema':_0x386821,'onJobId':_0x440af9=>{const _0x3e4791=_0x2fbc01;_0x4c0dcc[_0x3e4791(0x14b)](_0x440af9);},'onProgress':_0x369644=>{const _0x40c689=_0x2fbc01;_0x4c0dcc[_0x40c689(0x13a)](_0x40c689(0x136)+_0x369644[_0x40c689(0x14e)]+']'),_0x4c0dcc['setExtra'](formatRows(_0x369644[_0x40c689(0x147)])+_0x40c689(0x134)+_0x369644[_0x40c689(0x156)]+'/'+_0x369644['totalSplits']+_0x40c689(0x15b));}});return _0x13ae69;},{'verbose':_0x40ebf9[_0x2db9ee(0x130)]}),_0x45b0f0=_0x1d4523[_0x2db9ee(0x158)],_0x44e5f0=_0x45b0f0[_0x2db9ee(0x155)]?_0x2db9ee(0x12f)+_0x45b0f0[_0x2db9ee(0x155)]+']':'',_0x2934e2=_0x3b88d4?_0x2db9ee(0x12b)+_0x5dbdaf+'/'+_0x403e95+_0x2db9ee(0x152):'';console[_0x2db9ee(0x157)]('✔\x20'+_0x2934e2+_0x2db9ee(0x12d)+formatRows(_0x45b0f0[_0x2db9ee(0x139)][_0x2db9ee(0x147)])+'\x20rows\x20'+(_0x2db9ee(0x15a)+formatElapsed(_0x45b0f0[_0x2db9ee(0x139)][_0x2db9ee(0x140)])+_0x44e5f0));if(_0x3b88d4&&_0x5279de){const _0x24dbe9=resolveOutputOptions(_0x40ebf9),_0xd84464=await formatQueryOutput(_0x45b0f0,_0x24dbe9);_0x26817a[_0x2db9ee(0x137)](_0xd84464);}else await handleQueryOutput(_0x45b0f0,_0x40ebf9);}catch(_0x368ae7){const _0x3a201d=_0x3b88d4?_0x2db9ee(0x12b)+_0x5dbdaf+'/'+_0x403e95+':\x0a':'',_0x4546e0=_0x368ae7 instanceof SDKError?_0x368ae7[_0x2db9ee(0x151)]:_0x368ae7['message'];return console[_0x2db9ee(0x157)](''+_0x3a201d+_0x4546e0),0x1;}}if(_0x1502ee[_0x2db9ee(0x15d)]>0x1&&_0x5279de&&_0x26817a[_0x2db9ee(0x15d)]>0x0){const _0x46c74=_0x26817a[_0x2db9ee(0x141)]('\x0a');writeFileSync(_0x40ebf9[_0x2db9ee(0x14c)],_0x46c74),console['error'](_0x2db9ee(0x12e)+_0x40ebf9[_0x2db9ee(0x14c)]);}return 0x0;}catch(_0x2a1494){throw _0x2a1494;}}[a22_0x9ddf19(0x15c)](_0x29ad52){const _0x3778e7=a22_0x9ddf19,_0x52a64e=_0x29ad52[_0x3778e7(0x131)][0x0],_0x1aecfd=_0x29ad52[_0x3778e7(0x143)][_0x3778e7(0x12c)];if(!_0x52a64e&&!_0x1aecfd)return _0x3778e7(0x133);if(_0x52a64e&&_0x1aecfd)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
1
+ const a22_0x107356=a22_0x2ed3;(function(_0x3febb4,_0x2b476e){const _0x563138=a22_0x2ed3,_0x121419=_0x3febb4();while(!![]){try{const _0x520178=parseInt(_0x563138(0xea))/0x1+-parseInt(_0x563138(0xf5))/0x2+-parseInt(_0x563138(0xfd))/0x3*(-parseInt(_0x563138(0xf8))/0x4)+-parseInt(_0x563138(0xf1))/0x5+-parseInt(_0x563138(0xeb))/0x6*(-parseInt(_0x563138(0xe6))/0x7)+-parseInt(_0x563138(0x10d))/0x8*(parseInt(_0x563138(0xfe))/0x9)+-parseInt(_0x563138(0xfc))/0xa*(-parseInt(_0x563138(0x113))/0xb);if(_0x520178===_0x2b476e)break;else _0x121419['push'](_0x121419['shift']());}catch(_0x1fcc60){_0x121419['push'](_0x121419['shift']());}}}(a22_0x3ebd,0xb09d1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a22_0x2ed3(_0x5f59e3,_0x5feaa){const _0x3ebdd8=a22_0x3ebd();return a22_0x2ed3=function(_0x2ed3e0,_0x2a8aa8){_0x2ed3e0=_0x2ed3e0-0xe3;let _0x566b58=_0x3ebdd8[_0x2ed3e0];return _0x566b58;},a22_0x2ed3(_0x5f59e3,_0x5feaa);}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x3ebd(){const _0x5a9d1a=['1429348wITjKG','data','error','3440icKTHr','Site:\x20','setPhase','in\x20','14909110tkbldT','3000yTMQhk','41049HGZAUj','jobId','elapsedTimeMillis','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','processedRows','state','stats','originalMessage','\x20-\x20','\x20[Job\x20ID:\x20','...','Executing\x20statement\x20','execute','join','SQL:\x20','152xWxPZr','\x20rows\x20','query','name','\x0aAll\x20results\x20saved\x20to\x20','options','11Zonebt','Error:\x20','totalSplits','Statement\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','verbose','Executing\x20query...','Schema:\x20','args','site','completedSplits','push','7aTzmTJ','description','Catalog:\x20','Query\x20completed:\x20Processed\x20','482366vNFmmh','411630aGSjVZ','length','message','output','\x20splits','file','6885700rOmTOp','catalog','setExtra','database'];a22_0x3ebd=function(){return _0x5a9d1a;};return a22_0x3ebd();}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a22_0x107356(0x110)]=a22_0x107356(0x10f);[a22_0x107356(0xe7)]='Run\x20Trino\x20queries\x20(streaming)';async[a22_0x107356(0x10a)](_0x13bcb7){const _0x5e4459=a22_0x107356,{options:_0x30d064,args:_0x11a8f6,tdx:_0x5015c5}=_0x13bcb7,_0x1443cd=_0x11a8f6[0x0],_0x4270fe=_0x30d064[_0x5e4459(0xf0)];let _0x375efa;if(_0x4270fe)try{_0x375efa=readSqlStatementsFromFile(_0x4270fe);}catch(_0x329cb7){return console[_0x5e4459(0xf7)](_0x5e4459(0x114)+_0x329cb7[_0x5e4459(0xed)]),0x1;}else try{_0x375efa=splitSqlStatements(_0x1443cd);}catch(_0x5b47c7){return console[_0x5e4459(0xf7)](_0x5e4459(0x114)+_0x5b47c7[_0x5e4459(0xed)]),0x1;}const _0x2823fa=_0x30d064[_0x5e4459(0xf4)]||'information_schema',_0x7c60c2=_0x30d064[_0x5e4459(0xf2)];try{const _0x13d722=[],_0xc3452d=!!_0x30d064[_0x5e4459(0xee)];for(let _0x3f21cd=0x0;_0x3f21cd<_0x375efa['length'];_0x3f21cd++){const _0x23cf7b=_0x375efa[_0x3f21cd],_0x5808b3=_0x3f21cd+0x1,_0x356c20=_0x375efa[_0x5e4459(0xec)],_0x41b348=_0x356c20>0x1;_0x30d064['verbose']&&(console[_0x5e4459(0xf7)]('\x0a'+(_0x41b348?_0x5e4459(0x116)+_0x5808b3+'/'+_0x356c20+':':'')),console[_0x5e4459(0xf7)](_0x5e4459(0xf9)+_0x30d064[_0x5e4459(0xe3)]),console[_0x5e4459(0xf7)](_0x5e4459(0xe8)+(_0x7c60c2||'td')),console[_0x5e4459(0xf7)](_0x5e4459(0x11a)+_0x2823fa),console[_0x5e4459(0xf7)](_0x5e4459(0x10c)+_0x23cf7b));const _0x3a1d21=_0x41b348?_0x5e4459(0x109)+_0x5808b3+'/'+_0x356c20+_0x5e4459(0x108):_0x5e4459(0x119);try{const _0x23bb25=await withQuerySpinner(_0x3a1d21,async _0x4c6ba8=>{const _0xb36ee6=_0x5e4459,_0x23b036=await _0x5015c5['query'][_0xb36ee6(0x10a)](_0x23cf7b,{'catalog':_0x7c60c2,'schema':_0x2823fa,'onJobId':_0x357206=>{_0x4c6ba8['setJobId'](_0x357206);},'onProgress':_0xcda6dc=>{const _0x2a0f3f=_0xb36ee6;_0x4c6ba8[_0x2a0f3f(0xfa)]('Executing\x20query\x20['+_0xcda6dc[_0x2a0f3f(0x103)]+']'),_0x4c6ba8[_0x2a0f3f(0xf3)](formatRows(_0xcda6dc[_0x2a0f3f(0x102)])+'\x20rows\x20'+_0xcda6dc[_0x2a0f3f(0xe4)]+'/'+_0xcda6dc[_0x2a0f3f(0x115)]+_0x2a0f3f(0xef));}});return _0x23b036;},{'verbose':_0x30d064[_0x5e4459(0x118)]}),_0x203c47=_0x23bb25[_0x5e4459(0xf6)],_0xacfd3=_0x203c47['jobId']?_0x5e4459(0x107)+_0x203c47[_0x5e4459(0xff)]+']':'',_0x1831ff=_0x41b348?_0x5e4459(0x116)+_0x5808b3+'/'+_0x356c20+_0x5e4459(0x106):'';console[_0x5e4459(0xf7)]('✔\x20'+_0x1831ff+_0x5e4459(0xe9)+formatRows(_0x203c47[_0x5e4459(0x104)][_0x5e4459(0x102)])+_0x5e4459(0x10e)+(_0x5e4459(0xfb)+formatElapsed(_0x203c47[_0x5e4459(0x104)][_0x5e4459(0x100)])+_0xacfd3));if(_0x41b348&&_0xc3452d){const _0x42d32c=resolveOutputOptions(_0x30d064),_0x20dbaf=await formatQueryOutput(_0x203c47,_0x42d32c);_0x13d722[_0x5e4459(0xe5)](_0x20dbaf);}else await handleQueryOutput(_0x203c47,_0x30d064);}catch(_0x127ec7){const _0x4682f2=_0x41b348?'Statement\x20'+_0x5808b3+'/'+_0x356c20+':\x0a':'',_0x3875bb=_0x127ec7 instanceof SDKError?_0x127ec7[_0x5e4459(0x105)]:_0x127ec7[_0x5e4459(0xed)];return console[_0x5e4459(0xf7)](''+_0x4682f2+_0x3875bb),0x1;}}if(_0x375efa[_0x5e4459(0xec)]>0x1&&_0xc3452d&&_0x13d722[_0x5e4459(0xec)]>0x0){const _0xb7e573=_0x13d722[_0x5e4459(0x10b)]('\x0a');writeFileSync(_0x30d064[_0x5e4459(0xee)],_0xb7e573),console[_0x5e4459(0xf7)](_0x5e4459(0x111)+_0x30d064[_0x5e4459(0xee)]);}return 0x0;}catch(_0x166a27){throw _0x166a27;}}['validate'](_0x3915a1){const _0x43f990=a22_0x107356,_0xc3515b=_0x3915a1[_0x43f990(0x11b)][0x0],_0x5bceb3=_0x3915a1[_0x43f990(0x112)][_0x43f990(0xf0)];if(!_0xc3515b&&!_0x5bceb3)return _0x43f990(0x101);if(_0xc3515b&&_0x5bceb3)return _0x43f990(0x117);return undefined;}}
@@ -1 +1 @@
1
- const a23_0xe3fb7b=a23_0x169b;(function(_0x51a431,_0x4e8838){const _0xdcd664=a23_0x169b,_0x1911ca=_0x51a431();while(!![]){try{const _0x545756=-parseInt(_0xdcd664(0x1da))/0x1*(-parseInt(_0xdcd664(0x1dc))/0x2)+-parseInt(_0xdcd664(0x1b0))/0x3*(-parseInt(_0xdcd664(0x18b))/0x4)+parseInt(_0xdcd664(0x19d))/0x5+-parseInt(_0xdcd664(0x1d3))/0x6+-parseInt(_0xdcd664(0x1c6))/0x7*(-parseInt(_0xdcd664(0x1cf))/0x8)+parseInt(_0xdcd664(0x17a))/0x9+-parseInt(_0xdcd664(0x1a4))/0xa;if(_0x545756===_0x4e8838)break;else _0x1911ca['push'](_0x1911ca['shift']());}catch(_0x37ec59){_0x1911ca['push'](_0x1911ca['shift']());}}}(a23_0x3d43,0xa14ca));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a23_0x3d43(){const _0x59ffd5=['getParent','processedRows','error','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','setJobId','Folder\x20ID:\x20','Executing\x20segment\x20query...','query','log','\x27\x20with\x20ID:\x20','in\x20','trim','\x27...','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','execute','\x20folder','2335950SpqErV','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','segmentId','toLocaleString','segment:describe','getSegment','createFolder','getSegmentSQL','cause','type','parent','json','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20parent\x20segment...','Parent\x20segment:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Create\x20segment\x20folder\x20for\x20organization','1168qUAOHw','folderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:folder:create','Listing\x20folders\x20for\x20parent\x20\x27','Fetching\x20parent\x20segment\x20details...','Folder\x20ID\x20missing\x20from\x20resolved\x20path','✖\x20Query\x20failed\x20[','jsonl','getFolder','description','site','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20[Job\x20ID:\x20','Parent\x20name:\x20','parentId','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','3573680JXlsgR','segment:folder:list','Parent\x20ID:\x20','includes','Error:\x20Path\x20or\x20name\x20is\x20required','Fetching\x20segment\x20details...','Examples:','6913130ACpEFA','segment:show','segmentPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','format','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','name','Fetching\x20folder\x20\x27','resolveFolderId','Site:\x20','INTERNAL','2007zTYJWu','replace','\x20rows\x20','Resolving\x20parent\x20segment\x20\x27','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Creating\x20folder\x20\x27','Fetching\x20SQL\x20for\x20segment...','listFolders','information_schema','segment','folder','data','Resolving\x20parent\x20folder\x20\x27','Error:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','stats','parentFolder','\x20\x20Cause:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','✔\x20Created\x20folder\x20\x27','4111653wvYujp','Error:\x20Parent\x20segment\x20name\x20is\x20required','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Folder\x20reference\x20is\x20required','resolveParentId','getParentSQL','verbose','8rLgBxg','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Show\x20segment\x20or\x20folder\x20details','message','6112110PMtaIy','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','SQL\x20query:\x0a','length','Resolved\x20type:\x20','Resolving\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','1XgCDbP','✔\x20Query\x20completed:\x20Processed\x20','1227334UHysob','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolved\x20parent\x20folder\x20ID:\x20','jobId','resolvePathToResource'];a23_0x3d43=function(){return _0x59ffd5;};return a23_0x3d43();}import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x17e);[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1d1);async[a23_0xe3fb7b(0x1f0)](_0x582219){const _0x2ca564=a23_0xe3fb7b,{options:_0x53e843,args:_0x3f14f1,tdx:_0x4b8d4f}=_0x582219;if(_0x3f14f1[_0x2ca564(0x1d6)]===0x0)return console[_0x2ca564(0x1e4)](_0x2ca564(0x1a1)),console[_0x2ca564(0x1e4)](_0x2ca564(0x198)),console['error'](_0x2ca564(0x1a3)),console['error'](_0x2ca564(0x1de)),console[_0x2ca564(0x1e4)](_0x2ca564(0x1a7)),console[_0x2ca564(0x1e4)](_0x2ca564(0x1ef)),0x1;try{const _0x303772=_0x3f14f1[0x0],_0x2b3c9b=_0x53e843[_0x2ca564(0x1a6)];let _0x2911d0=_0x303772;_0x2b3c9b&&!_0x303772[_0x2ca564(0x1a0)]('/')&&(_0x2911d0=_0x2b3c9b+'/'+_0x303772,_0x53e843[_0x2ca564(0x1ce)]&&console[_0x2ca564(0x1e4)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2911d0));const _0x1478df=await withSpinner(_0x2ca564(0x1b4)+_0x2911d0+_0x2ca564(0x1ee),()=>_0x4b8d4f['segment'][_0x2ca564(0x1e1)](_0x2911d0),{'verbose':_0x53e843[_0x2ca564(0x1ce)]}),_0x8cf3bd=_0x1478df['data'];_0x53e843[_0x2ca564(0x1ce)]&&(console['error']('Resolved\x20type:\x20'+_0x8cf3bd[_0x2ca564(0x183)]),console['error'](_0x2ca564(0x19f)+_0x8cf3bd['parentId']),_0x8cf3bd['folderId']&&console[_0x2ca564(0x1e4)](_0x2ca564(0x1e7)+_0x8cf3bd[_0x2ca564(0x18c)]),_0x8cf3bd[_0x2ca564(0x17c)]&&console[_0x2ca564(0x1e4)]('Segment\x20ID:\x20'+_0x8cf3bd[_0x2ca564(0x17c)]));if(_0x8cf3bd[_0x2ca564(0x183)]===_0x2ca564(0x184)){const _0xacfea1=await withSpinner(_0x2ca564(0x191),()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x1e2)](_0x8cf3bd[_0x2ca564(0x19b)]),{'verbose':_0x53e843[_0x2ca564(0x1ce)]});await handleSDKOutput([_0xacfea1['data']],_0x53e843);}else{if(_0x8cf3bd[_0x2ca564(0x183)]===_0x2ca564(0x1bc)){if(!_0x8cf3bd[_0x2ca564(0x18c)])throw new SDKError(ErrorCode[_0x2ca564(0x1af)],_0x2ca564(0x192));const _0x50c843=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x195)](_0x8cf3bd['folderId']),{'verbose':_0x53e843['verbose']});await handleSDKOutput([_0x50c843[_0x2ca564(0x1bd)]],_0x53e843);}else{if(_0x8cf3bd['type']==='segment'){if(!_0x8cf3bd[_0x2ca564(0x17c)])throw new SDKError(ErrorCode[_0x2ca564(0x1af)],_0x2ca564(0x18d));const _0x563c62=await withSpinner(_0x2ca564(0x1a2),()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x17f)](_0x8cf3bd[_0x2ca564(0x19b)],_0x8cf3bd[_0x2ca564(0x17c)]),{'verbose':_0x53e843[_0x2ca564(0x1ce)]});await handleSDKOutput([_0x563c62[_0x2ca564(0x1bd)]],_0x53e843);}}}return 0x0;}catch(_0x59c82c){if(_0x59c82c instanceof SDKError)return console['error']('Error:\x20'+_0x59c82c[_0x2ca564(0x1d2)]),_0x59c82c[_0x2ca564(0x182)]&&console['error'](_0x2ca564(0x1c3)+_0x59c82c[_0x2ca564(0x182)]),0x1;throw _0x59c82c;}}}export class SegmentShowCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x1a5);['description']=a23_0xe3fb7b(0x1aa);async[a23_0xe3fb7b(0x1f0)](_0x3ab9d2){const _0x35125e=a23_0xe3fb7b,{options:_0x1eed68,args:_0x59991e,tdx:_0x2b0adc}=_0x3ab9d2;if(_0x59991e[_0x35125e(0x1d6)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x35125e(0x1e4)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x35125e(0x1e4)]('Examples:'),console[_0x35125e(0x1e4)](_0x35125e(0x19c)),console[_0x35125e(0x1e4)](_0x35125e(0x18e)),console['error'](_0x35125e(0x1a8)),0x1;try{const _0x4fc08a=_0x59991e[0x0],_0x5e7397=_0x1eed68[_0x35125e(0x1a6)];let _0x2c237e=_0x4fc08a;_0x5e7397&&!_0x4fc08a[_0x35125e(0x1a0)]('/')&&(_0x2c237e=_0x5e7397+'/'+_0x4fc08a,_0x1eed68[_0x35125e(0x1ce)]&&console[_0x35125e(0x1e4)](_0x35125e(0x1d9)+_0x2c237e));const _0x35cbd2=await withSpinner(_0x35125e(0x1b4)+_0x2c237e+_0x35125e(0x1ee),()=>_0x2b0adc[_0x35125e(0x1bb)][_0x35125e(0x1e1)](_0x2c237e),{'verbose':_0x1eed68[_0x35125e(0x1ce)]}),_0x303414=_0x35cbd2['data'];_0x1eed68[_0x35125e(0x1ce)]&&(console[_0x35125e(0x1e4)](_0x35125e(0x1d7)+_0x303414[_0x35125e(0x183)]),console[_0x35125e(0x1e4)]('Parent\x20ID:\x20'+_0x303414['parentId']));if(_0x303414[_0x35125e(0x183)]===_0x35125e(0x1bc))return console[_0x35125e(0x1e4)](_0x35125e(0x17b)),console[_0x35125e(0x1e4)](_0x35125e(0x1b6)),0x1;let _0x1d3c09;if(_0x303414[_0x35125e(0x183)]===_0x35125e(0x184)){const _0x256fbf=await withSpinner(_0x35125e(0x187),()=>_0x2b0adc['segment'][_0x35125e(0x1cd)](_0x303414['parentId']),{'verbose':_0x1eed68['verbose']});_0x1d3c09=_0x256fbf[_0x35125e(0x1bd)];}else{if(!_0x303414['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x35125e(0x18d));const _0x1f7123=await withSpinner(_0x35125e(0x1b8),()=>_0x2b0adc[_0x35125e(0x1bb)][_0x35125e(0x181)](_0x303414['parentId'],_0x303414[_0x35125e(0x17c)]),{'verbose':_0x1eed68[_0x35125e(0x1ce)]});_0x1d3c09=_0x1f7123[_0x35125e(0x1bd)];}const _0x3e8305=resolveLimit(_0x1eed68['limit'],DEFAULT_DISPLAY_LIMIT),_0xb13f38=/\bLIMIT\s+\d+/i['test'](_0x1d3c09);!_0xb13f38&&(_0x1d3c09=_0x1d3c09[_0x35125e(0x1ed)]()[_0x35125e(0x1b1)](/;+$/,''),_0x1d3c09=_0x35125e(0x1ca)+_0x1d3c09+_0x35125e(0x1dd)+_0x3e8305);_0x1eed68['verbose']&&console['error'](_0x35125e(0x1d5)+_0x1d3c09);const _0x344d6f=await withQuerySpinner(_0x35125e(0x1e8),async _0x2dbd86=>{const _0x327233=_0x35125e,_0x150a42=await _0x2b0adc[_0x327233(0x1e9)][_0x327233(0x1f0)](_0x1d3c09,{'catalog':'td','schema':_0x327233(0x1ba),'onJobId':_0x59cc3e=>{const _0x307d3e=_0x327233;_0x2dbd86[_0x307d3e(0x1e6)](_0x59cc3e);}});return _0x150a42;},{'verbose':_0x1eed68[_0x35125e(0x1ce)]}),_0x5a72c=_0x344d6f[_0x35125e(0x1bd)],_0x38a0dc=_0x5a72c[_0x35125e(0x1e0)]?_0x35125e(0x199)+_0x5a72c[_0x35125e(0x1e0)]+']':'';return console[_0x35125e(0x1e4)](_0x35125e(0x1db)+_0x5a72c[_0x35125e(0x1c1)][_0x35125e(0x1e3)][_0x35125e(0x17d)]()+_0x35125e(0x1b2)+(_0x35125e(0x1ec)+formatElapsed(_0x5a72c[_0x35125e(0x1c1)]['elapsedTimeMillis'])+_0x38a0dc)),await handleQueryOutput(_0x5a72c,_0x1eed68),0x0;}catch(_0x247e7a){if(_0x247e7a instanceof SDKError)return console[_0x35125e(0x1e4)](_0x35125e(0x193)+_0x247e7a['code']+']'),console[_0x35125e(0x1e4)]('\x0a'+_0x247e7a['message']),0x1;throw _0x247e7a;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x19e);[a23_0xe3fb7b(0x196)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a23_0xe3fb7b(0x1f0)](_0x4826be){const _0x3578bd=a23_0xe3fb7b,{options:_0x484a7d,args:_0x4510c0,tdx:_0x2cb398}=_0x4826be;if(_0x4510c0[_0x3578bd(0x1d6)]===0x0)return console[_0x3578bd(0x1e4)](_0x3578bd(0x1c7)),console[_0x3578bd(0x1e4)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x1e7378=_0x4510c0[0x0];try{_0x484a7d[_0x3578bd(0x1ce)]&&(console['error'](_0x3578bd(0x1ae)+_0x484a7d[_0x3578bd(0x197)]),console[_0x3578bd(0x1e4)](_0x3578bd(0x19a)+_0x1e7378));const _0x17ad80=await withSpinner(_0x3578bd(0x1b3)+_0x1e7378+_0x3578bd(0x1ee),()=>_0x2cb398['segment'][_0x3578bd(0x1cc)](_0x1e7378),{'verbose':_0x484a7d['verbose']}),_0x3dea59=_0x17ad80[_0x3578bd(0x1bd)];_0x484a7d['verbose']&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x3dea59);const _0x4f3d2a=await withSpinner(_0x3578bd(0x190)+_0x1e7378+_0x3578bd(0x1ee),()=>_0x2cb398['segment'][_0x3578bd(0x1b9)](_0x3dea59),{'verbose':_0x484a7d[_0x3578bd(0x1ce)]}),_0x5f6173=_0x4f3d2a['data'];return console[_0x3578bd(0x1e4)]('✔\x20Found\x20'+_0x5f6173[_0x3578bd(0x1d6)]+_0x3578bd(0x1f1)+(_0x5f6173[_0x3578bd(0x1d6)]!==0x1?'s':'')),await handleSDKOutput(_0x5f6173,_0x484a7d),0x0;}catch(_0x117ade){if(_0x117ade instanceof SDKError)return console[_0x3578bd(0x1e4)](_0x3578bd(0x1bf)+_0x117ade['message']),_0x117ade['cause']&&console[_0x3578bd(0x1e4)](_0x3578bd(0x1c3)+_0x117ade[_0x3578bd(0x182)]),0x1;throw _0x117ade;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]='segment:folder:show';[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1c8);async[a23_0xe3fb7b(0x1f0)](_0x38c801){const _0x4856da=a23_0xe3fb7b,{options:_0xaaaf14,args:_0x11a2f1,tdx:_0x2b00e3}=_0x38c801;if(_0x11a2f1[_0x4856da(0x1d6)]===0x0)return console['error'](_0x4856da(0x1cb)),console[_0x4856da(0x1e4)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x46ab0e,childId:_0xc540e9}=parseSegmentRef(_0x11a2f1[0x0]);_0xaaaf14[_0x4856da(0x1ce)]&&(console[_0x4856da(0x1e4)](_0x4856da(0x1ae)+_0xaaaf14['site']),console[_0x4856da(0x1e4)]('Parent\x20name:\x20'+_0x46ab0e),_0xc540e9&&console['error']('Folder\x20name:\x20'+_0xc540e9));if(!_0xc540e9)return console[_0x4856da(0x1e4)](_0x4856da(0x1c0)),0x1;const _0x4c12cf=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x46ab0e+_0x4856da(0x1ee),()=>_0x2b00e3[_0x4856da(0x1bb)][_0x4856da(0x1cc)](_0x46ab0e),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]}),_0x3ec330=_0x4c12cf[_0x4856da(0x1bd)];_0xaaaf14[_0x4856da(0x1ce)]&&console[_0x4856da(0x1e4)]('Resolved\x20parent\x20ID:\x20'+_0x3ec330);const _0x5da319=await withSpinner(_0x4856da(0x1d8)+_0xc540e9+'\x27...',()=>_0x2b00e3[_0x4856da(0x1bb)][_0x4856da(0x1ad)](_0x3ec330,_0xc540e9),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]}),_0x79ac68=_0x5da319['data'];_0xaaaf14['verbose']&&console[_0x4856da(0x1e4)]('Resolved\x20folder\x20ID:\x20'+_0x79ac68);const _0x31d61c=await withSpinner(_0x4856da(0x1ac)+_0xc540e9+_0x4856da(0x1ee),()=>_0x2b00e3['segment']['getFolder'](_0x79ac68),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]});return await handleSDKOutput([_0x31d61c[_0x4856da(0x1bd)]],_0xaaaf14),0x0;}catch(_0x21b78e){if(_0x21b78e instanceof SDKError)return console[_0x4856da(0x1e4)](_0x4856da(0x1bf)+_0x21b78e[_0x4856da(0x1d2)]),_0x21b78e[_0x4856da(0x182)]&&console[_0x4856da(0x1e4)](_0x4856da(0x1c3)+_0x21b78e[_0x4856da(0x182)]),0x1;throw _0x21b78e;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]='segment:sql';[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1e5);async[a23_0xe3fb7b(0x1f0)](_0x18b286){const _0x2cf7ef=a23_0xe3fb7b,{options:_0x181d4b,args:_0x58390f,tdx:_0x3e993d}=_0x18b286;if(_0x58390f[_0x2cf7ef(0x1d6)]===0x0)return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x186)),console[_0x2cf7ef(0x1e4)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console['error'](_0x2cf7ef(0x1a3)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x189)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1b5)),console['error'](_0x2cf7ef(0x1c9)),0x1;try{const _0x483506=_0x58390f[0x0],_0x505e2c=_0x181d4b['segmentPath'];let _0x13b18e=_0x483506;_0x505e2c&&!_0x483506[_0x2cf7ef(0x1a0)]('/')&&(_0x13b18e=_0x505e2c+'/'+_0x483506,_0x181d4b[_0x2cf7ef(0x1ce)]&&console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d9)+_0x13b18e));const _0x124a37=await withSpinner(_0x2cf7ef(0x1b4)+_0x13b18e+'\x27...',()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x1e1)](_0x13b18e),{'verbose':_0x181d4b[_0x2cf7ef(0x1ce)]}),_0x255aa2=_0x124a37[_0x2cf7ef(0x1bd)];_0x181d4b[_0x2cf7ef(0x1ce)]&&(console[_0x2cf7ef(0x1e4)]('Resolved\x20type:\x20'+_0x255aa2[_0x2cf7ef(0x183)]),console[_0x2cf7ef(0x1e4)]('Parent\x20ID:\x20'+_0x255aa2[_0x2cf7ef(0x19b)]));if(_0x255aa2[_0x2cf7ef(0x183)]===_0x2cf7ef(0x1bc))return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d4)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d0)),0x1;let _0x5b8285;if(_0x255aa2[_0x2cf7ef(0x183)]==='parent'){const _0x251211=await withSpinner(_0x2cf7ef(0x187),()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x1cd)](_0x255aa2[_0x2cf7ef(0x19b)]),{'verbose':_0x181d4b['verbose']});_0x5b8285=_0x251211[_0x2cf7ef(0x1bd)];}else{if(!_0x255aa2[_0x2cf7ef(0x17c)])throw new SDKError(ErrorCode[_0x2cf7ef(0x1af)],_0x2cf7ef(0x18d));const _0x429079=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x181)](_0x255aa2[_0x2cf7ef(0x19b)],_0x255aa2[_0x2cf7ef(0x17c)]),{'verbose':_0x181d4b[_0x2cf7ef(0x1ce)]});_0x5b8285=_0x429079[_0x2cf7ef(0x1bd)];}return _0x181d4b[_0x2cf7ef(0x1a9)]===_0x2cf7ef(0x185)||_0x181d4b[_0x2cf7ef(0x1a9)]===_0x2cf7ef(0x194)?await handleSDKOutput([{'sql':_0x5b8285}],_0x181d4b):console[_0x2cf7ef(0x1ea)](_0x5b8285),0x0;}catch(_0x37e8ed){if(_0x37e8ed instanceof SDKError)return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1bf)+_0x37e8ed[_0x2cf7ef(0x1d2)]),_0x37e8ed[_0x2cf7ef(0x182)]&&console['error'](_0x2cf7ef(0x1c3)+_0x37e8ed[_0x2cf7ef(0x182)]),0x1;throw _0x37e8ed;}}}function a23_0x169b(_0x5cd79f,_0x3878ff){const _0x3d43ca=a23_0x3d43();return a23_0x169b=function(_0x169b79,_0x4f2b92){_0x169b79=_0x169b79-0x17a;let _0x511b41=_0x3d43ca[_0x169b79];return _0x511b41;},a23_0x169b(_0x5cd79f,_0x3878ff);}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x18f);[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x18a);async[a23_0xe3fb7b(0x1f0)](_0x1cb8c4){const _0x19a596=a23_0xe3fb7b,{options:_0x517f6e,args:_0x14a249,tdx:_0x3efa8b}=_0x1cb8c4,_0x500660=_0x517f6e;if(_0x14a249[_0x19a596(0x1d6)]<0x2)return console[_0x19a596(0x1e4)](_0x19a596(0x1c4)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3b3672=_0x14a249[0x0],_0x41166c=_0x14a249[0x1];_0x500660[_0x19a596(0x1ce)]&&(console[_0x19a596(0x1e4)](_0x19a596(0x1ae)+_0x500660[_0x19a596(0x197)]),console[_0x19a596(0x1e4)](_0x19a596(0x188)+_0x3b3672),console[_0x19a596(0x1e4)]('Folder\x20name:\x20'+_0x41166c));let _0x2f2efb;if(_0x500660[_0x19a596(0x1c2)]){const _0x129c64=_0x500660[_0x19a596(0x1c2)],_0x370288=await withSpinner(_0x19a596(0x1b3)+_0x3b3672+_0x19a596(0x1ee),()=>_0x3efa8b[_0x19a596(0x1bb)][_0x19a596(0x1cc)](_0x3b3672),{'verbose':_0x500660[_0x19a596(0x1ce)]}),_0x2b42c5=_0x370288[_0x19a596(0x1bd)],_0x36e143=await withSpinner(_0x19a596(0x1be)+_0x129c64+_0x19a596(0x1ee),()=>_0x3efa8b['segment'][_0x19a596(0x1ad)](_0x2b42c5,_0x129c64),{'verbose':_0x500660['verbose']});_0x2f2efb=_0x36e143[_0x19a596(0x1bd)],_0x500660[_0x19a596(0x1ce)]&&console[_0x19a596(0x1e4)](_0x19a596(0x1df)+_0x2f2efb);}const _0x40816e={'name':_0x41166c,'description':_0x500660['description'],'parentFolderId':_0x2f2efb},_0x2bf799=await withSpinner(_0x19a596(0x1b7)+_0x41166c+_0x19a596(0x1ee),()=>_0x3efa8b[_0x19a596(0x1bb)][_0x19a596(0x180)](_0x3b3672,_0x40816e),{'verbose':_0x500660[_0x19a596(0x1ce)]}),_0x333f1d=_0x2bf799['data'];return console[_0x19a596(0x1e4)](_0x19a596(0x1c5)+_0x333f1d['name']+_0x19a596(0x1eb)+_0x333f1d['id']),await handleSDKOutput([_0x333f1d],_0x500660),0x0;}}
1
+ const a23_0x1a3ecf=a23_0x2382;(function(_0x388af2,_0x540775){const _0x4e2a47=a23_0x2382,_0x35b6c9=_0x388af2();while(!![]){try{const _0x54f882=-parseInt(_0x4e2a47(0x1c5))/0x1*(parseInt(_0x4e2a47(0x1e5))/0x2)+-parseInt(_0x4e2a47(0x1c3))/0x3+parseInt(_0x4e2a47(0x1fb))/0x4+-parseInt(_0x4e2a47(0x210))/0x5*(-parseInt(_0x4e2a47(0x1dd))/0x6)+-parseInt(_0x4e2a47(0x1f1))/0x7+parseInt(_0x4e2a47(0x213))/0x8*(parseInt(_0x4e2a47(0x1d6))/0x9)+parseInt(_0x4e2a47(0x1c1))/0xa;if(_0x54f882===_0x540775)break;else _0x35b6c9['push'](_0x35b6c9['shift']());}catch(_0x52646b){_0x35b6c9['push'](_0x35b6c9['shift']());}}}(a23_0x45c7,0x19a17));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a23_0x2382(_0x25798a,_0x414290){const _0x45c7c8=a23_0x45c7();return a23_0x2382=function(_0x23826d,_0x380c56){_0x23826d=_0x23826d-0x1a8;let _0x49c574=_0x45c7c8[_0x23826d];return _0x49c574;},a23_0x2382(_0x25798a,_0x414290);}import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a23_0x45c7(){const _0x1b200f=['Fetching\x20folder\x20details...','\x20rows\x20','name','Fetching\x20folder\x20\x27','\x20\x20Cause:\x20','segment:show','Resolved\x20type:\x20','807050pciiVX','getSegmentSQL','68052MJEoUU','data','182491AyODjb','description','includes','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Examples:','folder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parentFolder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20SQL\x20for\x20parent\x20segment...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Folder\x20reference\x20is\x20required','segment:sql','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','4329blIHVa','INTERNAL','segment','Segment\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','error','elapsedTimeMillis','156168KIOGwz','\x20folder','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segment:folder:create','getSegment','Error:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','2miAWsT','Show\x20segment\x20folder\x20details','setJobId','Resolving\x20folder\x20\x27','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Folder\x20ID:\x20','folderId','Resolving\x20parent\x20folder\x20\x27','length','parent','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Parent\x20segment:\x20','530236qltTal','✔\x20Found\x20','test','Resolving\x20path\x20\x27','Folder\x20name:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','createFolder','Listing\x20folders\x20for\x20parent\x20\x27','Executing\x20segment\x20query...','Fetching\x20SQL\x20for\x20segment...','408012qKDmlg','parentId','segmentPath','json','Show\x20segment\x20or\x20folder\x20details','type','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentId','listFolders','jobId','in\x20','replace','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20describe\x20<path>','Fetching\x20segment\x20details...','execute','Resolved\x20parent\x20ID:\x20','\x27\x20with\x20ID:\x20','stats','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','20XhkTRl','format','information_schema','1648zXUejB','\x27...','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','✖\x20Query\x20failed\x20[','verbose','\x20[Job\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','jsonl','Parent\x20ID:\x20','site','✔\x20Query\x20completed:\x20Processed\x20','cause','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','✔\x20Created\x20folder\x20\x27','getFolder','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SELECT\x20*\x20FROM\x20(\x0a','processedRows','getParent','Usage:\x20tdx\x20segment\x20show\x20<path>','resolvePathToResource','SQL\x20query:\x0a','code','message','Usage:\x20tdx\x20segment\x20sql\x20<path>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:describe','resolveParentId','segment:folder:show'];a23_0x45c7=function(){return _0x1b200f;};return a23_0x45c7();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1b7);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1ff);async[a23_0x1a3ecf(0x20a)](_0x57ecec){const _0xdbc49c=a23_0x1a3ecf,{options:_0x265c13,args:_0x5a38d6,tdx:_0x48c842}=_0x57ecec;if(_0x5a38d6[_0xdbc49c(0x1ed)]===0x0)return console[_0xdbc49c(0x1db)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0xdbc49c(0x1db)](_0xdbc49c(0x208)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c9)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1cf)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x201)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c8)),0x1;try{const _0x22a5f2=_0x5a38d6[0x0],_0x3fb241=_0x265c13[_0xdbc49c(0x1fd)];let _0xc60bc0=_0x22a5f2;_0x3fb241&&!_0x22a5f2['includes']('/')&&(_0xc60bc0=_0x3fb241+'/'+_0x22a5f2,_0x265c13['verbose']&&console[_0xdbc49c(0x1db)]('Resolved\x20relative\x20path\x20to:\x20'+_0xc60bc0));const _0xf7adea=await withSpinner('Resolving\x20path\x20\x27'+_0xc60bc0+_0xdbc49c(0x214),()=>_0x48c842['segment'][_0xdbc49c(0x1b1)](_0xc60bc0),{'verbose':_0x265c13[_0xdbc49c(0x217)]}),_0x5c24dc=_0xf7adea['data'];_0x265c13[_0xdbc49c(0x217)]&&(console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c0)+_0x5c24dc[_0xdbc49c(0x200)]),console[_0xdbc49c(0x1db)](_0xdbc49c(0x21c)+_0x5c24dc['parentId']),_0x5c24dc[_0xdbc49c(0x1eb)]&&console['error'](_0xdbc49c(0x1ea)+_0x5c24dc[_0xdbc49c(0x1eb)]),_0x5c24dc['segmentId']&&console['error'](_0xdbc49c(0x1d9)+_0x5c24dc[_0xdbc49c(0x202)]));if(_0x5c24dc[_0xdbc49c(0x200)]==='parent'){const _0x5ef62b=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1af)](_0x5c24dc['parentId']),{'verbose':_0x265c13['verbose']});await handleSDKOutput([_0x5ef62b['data']],_0x265c13);}else{if(_0x5c24dc[_0xdbc49c(0x200)]===_0xdbc49c(0x1ca)){if(!_0x5c24dc[_0xdbc49c(0x1eb)])throw new SDKError(ErrorCode[_0xdbc49c(0x1d7)],_0xdbc49c(0x1cb));const _0xbc6bed=await withSpinner(_0xdbc49c(0x1ba),()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1ab)](_0x5c24dc[_0xdbc49c(0x1eb)]),{'verbose':_0x265c13[_0xdbc49c(0x217)]});await handleSDKOutput([_0xbc6bed[_0xdbc49c(0x1c4)]],_0x265c13);}else{if(_0x5c24dc['type']===_0xdbc49c(0x1d8)){if(!_0x5c24dc[_0xdbc49c(0x202)])throw new SDKError(ErrorCode[_0xdbc49c(0x1d7)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x295749=await withSpinner(_0xdbc49c(0x209),()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1e1)](_0x5c24dc['parentId'],_0x5c24dc[_0xdbc49c(0x202)]),{'verbose':_0x265c13[_0xdbc49c(0x217)]});await handleSDKOutput([_0x295749[_0xdbc49c(0x1c4)]],_0x265c13);}}}return 0x0;}catch(_0x33db79){if(_0x33db79 instanceof SDKError)return console[_0xdbc49c(0x1db)](_0xdbc49c(0x1e2)+_0x33db79[_0xdbc49c(0x1b4)]),_0x33db79['cause']&&console[_0xdbc49c(0x1db)](_0xdbc49c(0x1be)+_0x33db79[_0xdbc49c(0x1a8)]),0x1;throw _0x33db79;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1bf);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e9);async[a23_0x1a3ecf(0x20a)](_0x42e6df){const _0x544360=a23_0x1a3ecf,{options:_0x231f19,args:_0x1e933f,tdx:_0x401468}=_0x42e6df;if(_0x1e933f[_0x544360(0x1ed)]===0x0)return console[_0x544360(0x1db)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x544360(0x1db)](_0x544360(0x1b0)),console[_0x544360(0x1db)](_0x544360(0x1c9)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x544360(0x1d5)),console[_0x544360(0x1db)](_0x544360(0x1ef)),0x1;try{const _0x13c6af=_0x1e933f[0x0],_0x168d73=_0x231f19[_0x544360(0x1fd)];let _0x1526fd=_0x13c6af;_0x168d73&&!_0x13c6af['includes']('/')&&(_0x1526fd=_0x168d73+'/'+_0x13c6af,_0x231f19['verbose']&&console[_0x544360(0x1db)](_0x544360(0x219)+_0x1526fd));const _0x4e4843=await withSpinner(_0x544360(0x1f4)+_0x1526fd+_0x544360(0x214),()=>_0x401468['segment'][_0x544360(0x1b1)](_0x1526fd),{'verbose':_0x231f19[_0x544360(0x217)]}),_0x140c9e=_0x4e4843[_0x544360(0x1c4)];_0x231f19[_0x544360(0x217)]&&(console['error'](_0x544360(0x1c0)+_0x140c9e['type']),console[_0x544360(0x1db)](_0x544360(0x21c)+_0x140c9e[_0x544360(0x1fc)]));if(_0x140c9e[_0x544360(0x200)]===_0x544360(0x1ca))return console[_0x544360(0x1db)](_0x544360(0x1f6)),console['error'](_0x544360(0x20e)),0x1;let _0xdb9b94;if(_0x140c9e[_0x544360(0x200)]==='parent'){const _0x1d6aa6=await withSpinner(_0x544360(0x1ce),()=>_0x401468[_0x544360(0x1d8)]['getParentSQL'](_0x140c9e['parentId']),{'verbose':_0x231f19[_0x544360(0x217)]});_0xdb9b94=_0x1d6aa6[_0x544360(0x1c4)];}else{if(!_0x140c9e[_0x544360(0x202)])throw new SDKError(ErrorCode[_0x544360(0x1d7)],_0x544360(0x1b6));const _0xb52979=await withSpinner(_0x544360(0x1fa),()=>_0x401468[_0x544360(0x1d8)][_0x544360(0x1c2)](_0x140c9e[_0x544360(0x1fc)],_0x140c9e[_0x544360(0x202)]),{'verbose':_0x231f19['verbose']});_0xdb9b94=_0xb52979[_0x544360(0x1c4)];}const _0x280ac8=resolveLimit(_0x231f19['limit'],DEFAULT_DISPLAY_LIMIT),_0x412983=/\bLIMIT\s+\d+/i[_0x544360(0x1f3)](_0xdb9b94);!_0x412983&&(_0xdb9b94=_0xdb9b94['trim']()[_0x544360(0x206)](/;+$/,''),_0xdb9b94=_0x544360(0x1ad)+_0xdb9b94+_0x544360(0x1e3)+_0x280ac8);_0x231f19[_0x544360(0x217)]&&console[_0x544360(0x1db)](_0x544360(0x1b2)+_0xdb9b94);const _0x123635=await withQuerySpinner(_0x544360(0x1f9),async _0x49419d=>{const _0x5594f7=_0x544360,_0x542f39=await _0x401468['query'][_0x5594f7(0x20a)](_0xdb9b94,{'catalog':'td','schema':_0x5594f7(0x212),'onJobId':_0x531300=>{const _0x31a3ef=_0x5594f7;_0x49419d[_0x31a3ef(0x1e7)](_0x531300);}});return _0x542f39;},{'verbose':_0x231f19['verbose']}),_0x566bd7=_0x123635[_0x544360(0x1c4)],_0x14edc7=_0x566bd7[_0x544360(0x204)]?_0x544360(0x218)+_0x566bd7['jobId']+']':'';return console[_0x544360(0x1db)](_0x544360(0x21e)+_0x566bd7[_0x544360(0x20d)][_0x544360(0x1ae)]['toLocaleString']()+_0x544360(0x1bb)+(_0x544360(0x205)+formatElapsed(_0x566bd7[_0x544360(0x20d)][_0x544360(0x1dc)])+_0x14edc7)),await handleQueryOutput(_0x566bd7,_0x231f19),0x0;}catch(_0x37f90b){if(_0x37f90b instanceof SDKError)return console[_0x544360(0x1db)](_0x544360(0x216)+_0x37f90b[_0x544360(0x1b3)]+']'),console[_0x544360(0x1db)]('\x0a'+_0x37f90b['message']),0x1;throw _0x37f90b;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]='segment:folder:list';[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e4);async[a23_0x1a3ecf(0x20a)](_0x2ede41){const _0x1f1c95=a23_0x1a3ecf,{options:_0x2c707b,args:_0xfc6d75,tdx:_0x2c518f}=_0x2ede41;if(_0xfc6d75[_0x1f1c95(0x1ed)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1f1c95(0x1db)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x2bbbea=_0xfc6d75[0x0];try{_0x2c707b['verbose']&&(console['error'](_0x1f1c95(0x1d4)+_0x2c707b['site']),console[_0x1f1c95(0x1db)]('Parent\x20name:\x20'+_0x2bbbea));const _0x413370=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2bbbea+_0x1f1c95(0x214),()=>_0x2c518f[_0x1f1c95(0x1d8)]['resolveParentId'](_0x2bbbea),{'verbose':_0x2c707b['verbose']}),_0x32cd95=_0x413370[_0x1f1c95(0x1c4)];_0x2c707b[_0x1f1c95(0x217)]&&console['error'](_0x1f1c95(0x20b)+_0x32cd95);const _0x329cde=await withSpinner(_0x1f1c95(0x1f8)+_0x2bbbea+_0x1f1c95(0x214),()=>_0x2c518f['segment'][_0x1f1c95(0x203)](_0x32cd95),{'verbose':_0x2c707b[_0x1f1c95(0x217)]}),_0x18e49a=_0x329cde[_0x1f1c95(0x1c4)];return console['error'](_0x1f1c95(0x1f2)+_0x18e49a[_0x1f1c95(0x1ed)]+_0x1f1c95(0x1de)+(_0x18e49a[_0x1f1c95(0x1ed)]!==0x1?'s':'')),await handleSDKOutput(_0x18e49a,_0x2c707b),0x0;}catch(_0x5d10a6){if(_0x5d10a6 instanceof SDKError)return console['error']('Error:\x20'+_0x5d10a6[_0x1f1c95(0x1b4)]),_0x5d10a6[_0x1f1c95(0x1a8)]&&console['error'](_0x1f1c95(0x1be)+_0x5d10a6[_0x1f1c95(0x1a8)]),0x1;throw _0x5d10a6;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1b9);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e6);async[a23_0x1a3ecf(0x20a)](_0x11270b){const _0x3b34a0=a23_0x1a3ecf,{options:_0x655433,args:_0x20ad35,tdx:_0x41ca9d}=_0x11270b;if(_0x20ad35[_0x3b34a0(0x1ed)]===0x0)return console['error'](_0x3b34a0(0x1d0)),console[_0x3b34a0(0x1db)](_0x3b34a0(0x1df)),0x1;try{const {parentId:_0x49917d,childId:_0x282ce7}=parseSegmentRef(_0x20ad35[0x0]);_0x655433[_0x3b34a0(0x217)]&&(console[_0x3b34a0(0x1db)](_0x3b34a0(0x1d4)+_0x655433[_0x3b34a0(0x21d)]),console['error']('Parent\x20name:\x20'+_0x49917d),_0x282ce7&&console['error'](_0x3b34a0(0x1f5)+_0x282ce7));if(!_0x282ce7)return console[_0x3b34a0(0x1db)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x474e11=await withSpinner(_0x3b34a0(0x207)+_0x49917d+_0x3b34a0(0x214),()=>_0x41ca9d[_0x3b34a0(0x1d8)]['resolveParentId'](_0x49917d),{'verbose':_0x655433[_0x3b34a0(0x217)]}),_0x1cd0a7=_0x474e11[_0x3b34a0(0x1c4)];_0x655433[_0x3b34a0(0x217)]&&console[_0x3b34a0(0x1db)](_0x3b34a0(0x20b)+_0x1cd0a7);const _0x5e4b3a=await withSpinner(_0x3b34a0(0x1e8)+_0x282ce7+_0x3b34a0(0x214),()=>_0x41ca9d[_0x3b34a0(0x1d8)]['resolveFolderId'](_0x1cd0a7,_0x282ce7),{'verbose':_0x655433[_0x3b34a0(0x217)]}),_0x9c0c03=_0x5e4b3a['data'];_0x655433[_0x3b34a0(0x217)]&&console[_0x3b34a0(0x1db)]('Resolved\x20folder\x20ID:\x20'+_0x9c0c03);const _0x529c5b=await withSpinner(_0x3b34a0(0x1bd)+_0x282ce7+_0x3b34a0(0x214),()=>_0x41ca9d['segment'][_0x3b34a0(0x1ab)](_0x9c0c03),{'verbose':_0x655433[_0x3b34a0(0x217)]});return await handleSDKOutput([_0x529c5b[_0x3b34a0(0x1c4)]],_0x655433),0x0;}catch(_0x2a5058){if(_0x2a5058 instanceof SDKError)return console['error'](_0x3b34a0(0x1e2)+_0x2a5058[_0x3b34a0(0x1b4)]),_0x2a5058[_0x3b34a0(0x1a8)]&&console['error'](_0x3b34a0(0x1be)+_0x2a5058[_0x3b34a0(0x1a8)]),0x1;throw _0x2a5058;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a23_0x1a3ecf(0x1d1);['description']=a23_0x1a3ecf(0x20f);async[a23_0x1a3ecf(0x20a)](_0x3c33e2){const _0x32404f=a23_0x1a3ecf,{options:_0x4c9c3c,args:_0x5b8463,tdx:_0xbad90e}=_0x3c33e2;if(_0x5b8463[_0x32404f(0x1ed)]===0x0)return console[_0x32404f(0x1db)](_0x32404f(0x1d3)),console[_0x32404f(0x1db)](_0x32404f(0x1b5)),console[_0x32404f(0x1db)](_0x32404f(0x1c9)),console['error'](_0x32404f(0x21a)),console[_0x32404f(0x1db)](_0x32404f(0x1da)),console['error'](_0x32404f(0x1ac)),0x1;try{const _0x211fba=_0x5b8463[0x0],_0x331053=_0x4c9c3c['segmentPath'];let _0x26066a=_0x211fba;_0x331053&&!_0x211fba[_0x32404f(0x1c7)]('/')&&(_0x26066a=_0x331053+'/'+_0x211fba,_0x4c9c3c['verbose']&&console['error'](_0x32404f(0x219)+_0x26066a));const _0x244823=await withSpinner(_0x32404f(0x1f4)+_0x26066a+'\x27...',()=>_0xbad90e[_0x32404f(0x1d8)][_0x32404f(0x1b1)](_0x26066a),{'verbose':_0x4c9c3c['verbose']}),_0x4a7537=_0x244823[_0x32404f(0x1c4)];_0x4c9c3c[_0x32404f(0x217)]&&(console['error'](_0x32404f(0x1c0)+_0x4a7537[_0x32404f(0x200)]),console[_0x32404f(0x1db)](_0x32404f(0x21c)+_0x4a7537[_0x32404f(0x1fc)]));if(_0x4a7537[_0x32404f(0x200)]===_0x32404f(0x1ca))return console[_0x32404f(0x1db)](_0x32404f(0x1a9)),console[_0x32404f(0x1db)](_0x32404f(0x1cd)),0x1;let _0x2d67e3;if(_0x4a7537['type']===_0x32404f(0x1ee)){const _0x2f3f2a=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0xbad90e[_0x32404f(0x1d8)]['getParentSQL'](_0x4a7537[_0x32404f(0x1fc)]),{'verbose':_0x4c9c3c[_0x32404f(0x217)]});_0x2d67e3=_0x2f3f2a[_0x32404f(0x1c4)];}else{if(!_0x4a7537[_0x32404f(0x202)])throw new SDKError(ErrorCode[_0x32404f(0x1d7)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x647717=await withSpinner(_0x32404f(0x1fa),()=>_0xbad90e[_0x32404f(0x1d8)]['getSegmentSQL'](_0x4a7537[_0x32404f(0x1fc)],_0x4a7537[_0x32404f(0x202)]),{'verbose':_0x4c9c3c['verbose']});_0x2d67e3=_0x647717['data'];}return _0x4c9c3c['format']===_0x32404f(0x1fe)||_0x4c9c3c[_0x32404f(0x211)]===_0x32404f(0x21b)?await handleSDKOutput([{'sql':_0x2d67e3}],_0x4c9c3c):console['log'](_0x2d67e3),0x0;}catch(_0x775ddc){if(_0x775ddc instanceof SDKError)return console['error'](_0x32404f(0x1e2)+_0x775ddc[_0x32404f(0x1b4)]),_0x775ddc['cause']&&console['error'](_0x32404f(0x1be)+_0x775ddc[_0x32404f(0x1a8)]),0x1;throw _0x775ddc;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1e0);['description']=a23_0x1a3ecf(0x1d2);async['execute'](_0x324010){const _0x48b92c=a23_0x1a3ecf,{options:_0x302475,args:_0x8b4590,tdx:_0x1b6a5a}=_0x324010,_0x155fe8=_0x302475;if(_0x8b4590['length']<0x2)return console[_0x48b92c(0x1db)](_0x48b92c(0x215)),console[_0x48b92c(0x1db)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x362fc2=_0x8b4590[0x0],_0x33733d=_0x8b4590[0x1];_0x155fe8['verbose']&&(console['error'](_0x48b92c(0x1d4)+_0x155fe8[_0x48b92c(0x21d)]),console['error'](_0x48b92c(0x1f0)+_0x362fc2),console[_0x48b92c(0x1db)]('Folder\x20name:\x20'+_0x33733d));let _0x22161f;if(_0x155fe8[_0x48b92c(0x1cc)]){const _0x391a09=_0x155fe8['parentFolder'],_0x467855=await withSpinner(_0x48b92c(0x207)+_0x362fc2+_0x48b92c(0x214),()=>_0x1b6a5a['segment'][_0x48b92c(0x1b8)](_0x362fc2),{'verbose':_0x155fe8[_0x48b92c(0x217)]}),_0xf577d7=_0x467855[_0x48b92c(0x1c4)],_0x105663=await withSpinner(_0x48b92c(0x1ec)+_0x391a09+_0x48b92c(0x214),()=>_0x1b6a5a[_0x48b92c(0x1d8)]['resolveFolderId'](_0xf577d7,_0x391a09),{'verbose':_0x155fe8[_0x48b92c(0x217)]});_0x22161f=_0x105663[_0x48b92c(0x1c4)],_0x155fe8['verbose']&&console[_0x48b92c(0x1db)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x22161f);}const _0x1d2d97={'name':_0x33733d,'description':_0x155fe8[_0x48b92c(0x1c6)],'parentFolderId':_0x22161f},_0x327530=await withSpinner('Creating\x20folder\x20\x27'+_0x33733d+'\x27...',()=>_0x1b6a5a[_0x48b92c(0x1d8)][_0x48b92c(0x1f7)](_0x362fc2,_0x1d2d97),{'verbose':_0x155fe8[_0x48b92c(0x217)]}),_0x673c03=_0x327530[_0x48b92c(0x1c4)];return console[_0x48b92c(0x1db)](_0x48b92c(0x1aa)+_0x673c03[_0x48b92c(0x1bc)]+_0x48b92c(0x20c)+_0x673c03['id']),await handleSDKOutput([_0x673c03],_0x155fe8),0x0;}}
@@ -1 +1 @@
1
- function a24_0x4389(_0x54be1c,_0x2dd73f){const _0x30f35f=a24_0x30f3();return a24_0x4389=function(_0x4389a4,_0x57101b){_0x4389a4=_0x4389a4-0x78;let _0x110305=_0x30f35f[_0x4389a4];return _0x110305;},a24_0x4389(_0x54be1c,_0x2dd73f);}const a24_0x1d0eb3=a24_0x4389;(function(_0xed5ec8,_0x2eee77){const _0x146548=a24_0x4389,_0x206c81=_0xed5ec8();while(!![]){try{const _0x1ece72=-parseInt(_0x146548(0x7d))/0x1+-parseInt(_0x146548(0x8b))/0x2+parseInt(_0x146548(0x88))/0x3+-parseInt(_0x146548(0x94))/0x4*(-parseInt(_0x146548(0x91))/0x5)+-parseInt(_0x146548(0x95))/0x6*(-parseInt(_0x146548(0x98))/0x7)+parseInt(_0x146548(0x7f))/0x8+-parseInt(_0x146548(0x79))/0x9;if(_0x1ece72===_0x2eee77)break;else _0x206c81['push'](_0x206c81['shift']());}catch(_0x4fc025){_0x206c81['push'](_0x206c81['shift']());}}}(a24_0x30f3,0x88978));function a24_0x30f3(){const _0x3313b7=['verbose','site','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','208076fQeqTA','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','2515712fpWgif','\x20\x20\x20Path:\x20','kind','createSegment','segment','error','Resolved\x20folder\x20ID:\x20','resolveParentId','resolvePathToResource','1689921QqhJiH','Resolving\x20folder\x20path\x20\x27','Site:\x20','1785390xVmGSk','Resolved\x20relative\x20path\x20to:\x20','description','data','Create\x20child\x20segment\x20with\x20filtering\x20rules','type','10PRZQEL','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','invisible','650728NgpwlW','478296RTfSPB','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','segmentPath','70toYkbN','ruleFile','\x27\x20with\x20ID:\x20','Parent\x20path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','name','Resolving\x20folder\x20\x27','\x27...','Resolving\x20parent\x20segment\x20\x27','rule','length','segment:create','folder','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segments','includes','3060396wiFSdx'];a24_0x30f3=function(){return _0x3313b7;};return a24_0x30f3();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a24_0x1d0eb3(0x9d)]=a24_0x1d0eb3(0xa3);[a24_0x1d0eb3(0x8d)]=a24_0x1d0eb3(0x8f);async['execute'](_0x17d510){const _0x10a400=a24_0x1d0eb3,{options:_0x250648,args:_0xe3ec74,tdx:_0x50715c}=_0x17d510,_0x42cf2a=_0x250648;if(_0xe3ec74[_0x10a400(0xa2)]===0x0)return console['error'](_0x10a400(0x92)),console[_0x10a400(0x84)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x10a400(0x84)]('Examples:'),console['error'](_0x10a400(0x96)),console[_0x10a400(0x84)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x10a400(0x84)](_0x10a400(0x9c)),0x1;const _0x723541=_0xe3ec74[0x0],_0x215608=_0x250648[_0x10a400(0x97)];let _0x29c2b5=_0x723541;_0x215608&&!_0x723541[_0x10a400(0x78)]('/')&&(_0x29c2b5=_0x215608+'/'+_0x723541,_0x42cf2a[_0x10a400(0x7a)]&&console[_0x10a400(0x84)](_0x10a400(0x8c)+_0x29c2b5));const _0x4035ff=parsePath(_0x29c2b5);if(_0x4035ff[_0x10a400(0xa6)][_0x10a400(0xa2)]<0x2)return console['error'](_0x10a400(0xa5)),console[_0x10a400(0x84)](_0x10a400(0x7c)),0x1;const _0x46e62b=_0x4035ff[_0x10a400(0xa6)][0x0],_0x37a615=getBaseName(_0x29c2b5),_0x205463=getParentPath(_0x29c2b5);_0x42cf2a[_0x10a400(0x7a)]&&(console['error'](_0x10a400(0x8a)+_0x42cf2a[_0x10a400(0x7b)]),console['error']('Target\x20path:\x20'+_0x29c2b5),console[_0x10a400(0x84)]('Parent:\x20'+_0x46e62b),console[_0x10a400(0x84)]('Segment\x20name:\x20'+_0x37a615),console[_0x10a400(0x84)](_0x10a400(0x9b)+_0x205463));const _0xa39a7b=await withSpinner(_0x10a400(0xa0)+_0x46e62b+_0x10a400(0x9f),()=>_0x50715c[_0x10a400(0x83)][_0x10a400(0x86)](_0x46e62b),{'verbose':_0x42cf2a[_0x10a400(0x7a)]}),_0x410a4f=_0xa39a7b[_0x10a400(0x8e)];let _0x4ca677;if(_0x4035ff[_0x10a400(0xa6)][_0x10a400(0xa2)]>0x2){const _0x3251e1=await withSpinner(_0x10a400(0x89)+_0x205463+'\x27...',()=>_0x50715c['segment'][_0x10a400(0x87)](_0x205463),{'verbose':_0x42cf2a[_0x10a400(0x7a)]}),_0x4b393e=_0x3251e1[_0x10a400(0x8e)];if(_0x4b393e['type']!=='folder'&&_0x4b393e[_0x10a400(0x90)]!=='parent')return console[_0x10a400(0x84)](_0x10a400(0x7e)),0x1;_0x4ca677=_0x4b393e['folderId'];}else{if(_0x42cf2a[_0x10a400(0xa4)]){const _0x429920=await withSpinner(_0x10a400(0x9e)+_0x42cf2a[_0x10a400(0xa4)]+_0x10a400(0x9f),()=>_0x50715c['segment']['resolveFolderId'](_0x410a4f,_0x42cf2a[_0x10a400(0xa4)]),{'verbose':_0x42cf2a[_0x10a400(0x7a)]});_0x4ca677=_0x429920[_0x10a400(0x8e)];}}_0x42cf2a['verbose']&&_0x4ca677&&console[_0x10a400(0x84)](_0x10a400(0x85)+_0x4ca677);const _0x273ffb=await loadJSONFromOptions(_0x42cf2a[_0x10a400(0xa1)],_0x42cf2a[_0x10a400(0x99)]),_0x29ebbf={'name':_0x37a615,'description':_0x42cf2a[_0x10a400(0x8d)],'rule':_0x273ffb,'kind':_0x42cf2a[_0x10a400(0x81)]!==undefined?parseInt(_0x42cf2a[_0x10a400(0x81)],0xa):undefined,'isVisible':_0x42cf2a[_0x10a400(0x93)]?![]:undefined,'segmentFolderId':_0x4ca677,'countPopulation':_0x42cf2a['noCountPopulation']?![]:undefined},_0x22d7e7=await withSpinner('Creating\x20segment\x20\x27'+_0x37a615+'\x27...',()=>_0x50715c[_0x10a400(0x83)][_0x10a400(0x82)](_0x410a4f,_0x29ebbf),{'verbose':_0x42cf2a[_0x10a400(0x7a)]}),_0xbfa5ea=_0x22d7e7['data'];return console['error']('✔\x20Created\x20segment\x20\x27'+_0xbfa5ea[_0x10a400(0x9d)]+_0x10a400(0x9a)+_0xbfa5ea['id']),_0x29c2b5!==_0x723541&&console['error'](_0x10a400(0x80)+_0x29c2b5),await handleSDKOutput([_0xbfa5ea],_0x42cf2a),0x0;}}
1
+ const a24_0xf7ece2=a24_0x4219;(function(_0x1cff80,_0x536201){const _0x14ad73=a24_0x4219,_0x4e93ee=_0x1cff80();while(!![]){try{const _0x5985ad=parseInt(_0x14ad73(0x137))/0x1+parseInt(_0x14ad73(0x14e))/0x2+-parseInt(_0x14ad73(0x156))/0x3*(parseInt(_0x14ad73(0x15c))/0x4)+parseInt(_0x14ad73(0x148))/0x5+parseInt(_0x14ad73(0x13f))/0x6*(-parseInt(_0x14ad73(0x15f))/0x7)+-parseInt(_0x14ad73(0x153))/0x8+-parseInt(_0x14ad73(0x161))/0x9*(-parseInt(_0x14ad73(0x162))/0xa);if(_0x5985ad===_0x536201)break;else _0x4e93ee['push'](_0x4e93ee['shift']());}catch(_0x5107ba){_0x4e93ee['push'](_0x4e93ee['shift']());}}}(a24_0x2638,0x97cf1));function a24_0x2638(){const _0x2c8bb8=['type','data','length','4063615UUqDpP','site','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','verbose','\x27...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','1260620PRLtsC','✔\x20Created\x20segment\x20\x27','folder','Create\x20child\x20segment\x20with\x20filtering\x20rules','ruleFile','6911408gaXDAp','parent','folderId','2613yJHERC','Resolving\x20folder\x20\x27','createSegment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segment','Segment\x20name:\x20','5524dPauWP','Site:\x20','name','637770lrivRw','rule','711fdSmYu','149200zUvtrc','execute','segments','Target\x20path:\x20','Resolving\x20folder\x20path\x20\x27','error','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','noCountPopulation','invisible','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','kind','Creating\x20segment\x20\x27','431313QKopgf','\x27\x20with\x20ID:\x20','Parent\x20path:\x20','resolveFolderId','description','segmentPath','Examples:','resolveParentId','24KChELM','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolvePathToResource','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Resolved\x20folder\x20ID:\x20'];a24_0x2638=function(){return _0x2c8bb8;};return a24_0x2638();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a24_0x4219(_0x4c48bd,_0xa583a5){const _0x263824=a24_0x2638();return a24_0x4219=function(_0x4219f9,_0x2e6c4d){_0x4219f9=_0x4219f9-0x12a;let _0x5b2d49=_0x263824[_0x4219f9];return _0x5b2d49;},a24_0x4219(_0x4c48bd,_0xa583a5);}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a24_0xf7ece2(0x15e)]='segment:create';[a24_0xf7ece2(0x13b)]=a24_0xf7ece2(0x151);async[a24_0xf7ece2(0x12a)](_0x4a9f65){const _0x23422e=a24_0xf7ece2,{options:_0x5a1f3d,args:_0xee06c5,tdx:_0x44599c}=_0x4a9f65,_0x118e23=_0x5a1f3d;if(_0xee06c5[_0x23422e(0x147)]===0x0)return console[_0x23422e(0x12e)](_0x23422e(0x14d)),console['error'](_0x23422e(0x159)),console[_0x23422e(0x12e)](_0x23422e(0x13d)),console['error'](_0x23422e(0x134)),console[_0x23422e(0x12e)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x23422e(0x12e)](_0x23422e(0x141)),0x1;const _0x8fdc75=_0xee06c5[0x0],_0x4ddd62=_0x5a1f3d[_0x23422e(0x13c)];let _0x498b5e=_0x8fdc75;_0x4ddd62&&!_0x8fdc75[_0x23422e(0x133)]('/')&&(_0x498b5e=_0x4ddd62+'/'+_0x8fdc75,_0x118e23[_0x23422e(0x14b)]&&console['error'](_0x23422e(0x12f)+_0x498b5e));const _0x1cef59=parsePath(_0x498b5e);if(_0x1cef59[_0x23422e(0x12b)]['length']<0x2)return console['error'](_0x23422e(0x14a)),console[_0x23422e(0x12e)](_0x23422e(0x130)),0x1;const _0x467c8d=_0x1cef59[_0x23422e(0x12b)][0x0],_0xf36a16=getBaseName(_0x498b5e),_0x4ba97f=getParentPath(_0x498b5e);_0x118e23[_0x23422e(0x14b)]&&(console[_0x23422e(0x12e)](_0x23422e(0x15d)+_0x118e23[_0x23422e(0x149)]),console[_0x23422e(0x12e)](_0x23422e(0x12c)+_0x498b5e),console[_0x23422e(0x12e)]('Parent:\x20'+_0x467c8d),console[_0x23422e(0x12e)](_0x23422e(0x15b)+_0xf36a16),console['error'](_0x23422e(0x139)+_0x4ba97f));const _0x57d1d1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x467c8d+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x13e)](_0x467c8d),{'verbose':_0x118e23['verbose']}),_0x2d0614=_0x57d1d1['data'];let _0x238862;if(_0x1cef59[_0x23422e(0x12b)]['length']>0x2){const _0x20caf1=await withSpinner(_0x23422e(0x12d)+_0x4ba97f+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x142)](_0x4ba97f),{'verbose':_0x118e23[_0x23422e(0x14b)]}),_0x3a49d4=_0x20caf1[_0x23422e(0x146)];if(_0x3a49d4[_0x23422e(0x145)]!=='folder'&&_0x3a49d4[_0x23422e(0x145)]!==_0x23422e(0x154))return console[_0x23422e(0x12e)](_0x23422e(0x143)),0x1;_0x238862=_0x3a49d4[_0x23422e(0x155)];}else{if(_0x118e23[_0x23422e(0x150)]){const _0x5cab00=await withSpinner(_0x23422e(0x157)+_0x118e23[_0x23422e(0x150)]+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x13a)](_0x2d0614,_0x118e23[_0x23422e(0x150)]),{'verbose':_0x118e23['verbose']});_0x238862=_0x5cab00[_0x23422e(0x146)];}}_0x118e23[_0x23422e(0x14b)]&&_0x238862&&console[_0x23422e(0x12e)](_0x23422e(0x144)+_0x238862);const _0x4d2a23=await loadJSONFromOptions(_0x118e23[_0x23422e(0x160)],_0x118e23[_0x23422e(0x152)]),_0x1dda19={'name':_0xf36a16,'description':_0x118e23[_0x23422e(0x13b)],'rule':_0x4d2a23,'kind':_0x118e23[_0x23422e(0x135)]!==undefined?parseInt(_0x118e23['kind'],0xa):undefined,'isVisible':_0x118e23[_0x23422e(0x132)]?![]:undefined,'segmentFolderId':_0x238862,'countPopulation':_0x118e23[_0x23422e(0x131)]?![]:undefined},_0x5c1a13=await withSpinner(_0x23422e(0x136)+_0xf36a16+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x158)](_0x2d0614,_0x1dda19),{'verbose':_0x118e23[_0x23422e(0x14b)]}),_0x1408bd=_0x5c1a13['data'];return console[_0x23422e(0x12e)](_0x23422e(0x14f)+_0x1408bd[_0x23422e(0x15e)]+_0x23422e(0x138)+_0x1408bd['id']),_0x498b5e!==_0x8fdc75&&console[_0x23422e(0x12e)](_0x23422e(0x140)+_0x498b5e),await handleSDKOutput([_0x1408bd],_0x118e23),0x0;}}
@@ -1 +1 @@
1
- const a25_0x3c5d29=a25_0x3dbc;function a25_0x3dbc(_0x2fbafd,_0x377d1f){const _0x3b47b7=a25_0x3b47();return a25_0x3dbc=function(_0x3dbc96,_0x39d720){_0x3dbc96=_0x3dbc96-0x173;let _0x143568=_0x3b47b7[_0x3dbc96];return _0x143568;},a25_0x3dbc(_0x2fbafd,_0x377d1f);}function a25_0x3b47(){const _0x1df7d3=['length','511304rHYZXY','35KULJwa','\x27...','171mxjBsk','segment','Error:\x20Parent\x20segment\x20name\x20is\x20required','166062ubXkrV','List\x20available\x20fields\x20for\x20segmentation','verbose','133128BMPeAM','site','Parent\x20segment:\x20','✔\x20Found\x20','data','\x20field','description','14bnsZtQ','listFields','161034bZrDif','194230PwBENG','104978JjrUda','732092NkYpya','error','name','execute','Site:\x20'];a25_0x3b47=function(){return _0x1df7d3;};return a25_0x3b47();}(function(_0x7143fe,_0x1f1a2b){const _0x35586a=a25_0x3dbc,_0x201b01=_0x7143fe();while(!![]){try{const _0x54aa53=parseInt(_0x35586a(0x178))/0x1+parseInt(_0x35586a(0x185))/0x2+parseInt(_0x35586a(0x188))/0x3+-parseInt(_0x35586a(0x179))/0x4+parseInt(_0x35586a(0x180))/0x5*(-parseInt(_0x35586a(0x176))/0x6)+parseInt(_0x35586a(0x174))/0x7*(-parseInt(_0x35586a(0x17f))/0x8)+parseInt(_0x35586a(0x182))/0x9*(parseInt(_0x35586a(0x177))/0xa);if(_0x54aa53===_0x1f1a2b)break;else _0x201b01['push'](_0x201b01['shift']());}catch(_0xfb9aff){_0x201b01['push'](_0x201b01['shift']());}}}(a25_0x3b47,0x1912c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a25_0x3c5d29(0x17b)]='segment:fields';[a25_0x3c5d29(0x173)]=a25_0x3c5d29(0x186);async[a25_0x3c5d29(0x17c)](_0x17644c){const _0x2bcb70=a25_0x3c5d29,{options:_0x1eedcc,args:_0x435f2c,tdx:_0x1722d3}=_0x17644c;if(_0x435f2c['length']===0x0)return console[_0x2bcb70(0x17a)](_0x2bcb70(0x184)),console[_0x2bcb70(0x17a)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x4a1085=_0x435f2c[0x0];_0x1eedcc[_0x2bcb70(0x187)]&&(console[_0x2bcb70(0x17a)](_0x2bcb70(0x17d)+_0x1eedcc[_0x2bcb70(0x189)]),console[_0x2bcb70(0x17a)](_0x2bcb70(0x18a)+_0x4a1085));const _0x47e3d4=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x4a1085+_0x2bcb70(0x181),()=>_0x1722d3[_0x2bcb70(0x183)][_0x2bcb70(0x175)](_0x4a1085),{'verbose':_0x1eedcc['verbose']}),_0x5c4f2e=_0x47e3d4[_0x2bcb70(0x18c)];return console[_0x2bcb70(0x17a)](_0x2bcb70(0x18b)+_0x5c4f2e[_0x2bcb70(0x17e)]+_0x2bcb70(0x18d)+(_0x5c4f2e['length']!==0x1?'s':'')),await handleSDKOutput(_0x5c4f2e,_0x1eedcc),0x0;}}
1
+ const a25_0x4bbd94=a25_0x5113;function a25_0x2e5c(){const _0x41fb56=['575OtyRJV','listFields','10170QcwBmu','name','497yCevWW','site','verbose','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','494324Gsfmin','407ynsLAr','30zASquD','356376dVQEJz','1373172UrciTS','segment','812hEImDr','List\x20available\x20fields\x20for\x20segmentation','length','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','description','✔\x20Found\x20','\x20field','Parent\x20segment:\x20','error','24080obPOvR','2950KokdUN','14975HsfZaO'];a25_0x2e5c=function(){return _0x41fb56;};return a25_0x2e5c();}(function(_0x2df506,_0x3b9818){const _0x7b2a8a=a25_0x5113,_0x1cbb08=_0x2df506();while(!![]){try{const _0x2e69a1=-parseInt(_0x7b2a8a(0x82))/0x1*(-parseInt(_0x7b2a8a(0x91))/0x2)+parseInt(_0x7b2a8a(0x8f))/0x3+parseInt(_0x7b2a8a(0x8b))/0x4+parseInt(_0x7b2a8a(0x81))/0x5*(parseInt(_0x7b2a8a(0x8d))/0x6)+parseInt(_0x7b2a8a(0x86))/0x7*(parseInt(_0x7b2a8a(0x9b))/0x8)+parseInt(_0x7b2a8a(0x84))/0x9*(parseInt(_0x7b2a8a(0x9c))/0xa)+-parseInt(_0x7b2a8a(0x8c))/0xb*(parseInt(_0x7b2a8a(0x8e))/0xc);if(_0x2e69a1===_0x3b9818)break;else _0x1cbb08['push'](_0x1cbb08['shift']());}catch(_0x30d052){_0x1cbb08['push'](_0x1cbb08['shift']());}}}(a25_0x2e5c,0x43dcc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a25_0x5113(_0x2ab147,_0x5ba92e){const _0x2e5c45=a25_0x2e5c();return a25_0x5113=function(_0x51133e,_0x405ecd){_0x51133e=_0x51133e-0x81;let _0x451d77=_0x2e5c45[_0x51133e];return _0x451d77;},a25_0x5113(_0x2ab147,_0x5ba92e);}export class SegmentFieldsCommand extends BaseCommand{[a25_0x4bbd94(0x85)]='segment:fields';[a25_0x4bbd94(0x96)]=a25_0x4bbd94(0x92);async['execute'](_0x79b9b0){const _0x146cbd=a25_0x4bbd94,{options:_0x19b7ff,args:_0x1e6d48,tdx:_0x468aaa}=_0x79b9b0;if(_0x1e6d48[_0x146cbd(0x93)]===0x0)return console['error'](_0x146cbd(0x8a)),console[_0x146cbd(0x9a)](_0x146cbd(0x95)),0x1;const _0x7f9f50=_0x1e6d48[0x0];_0x19b7ff[_0x146cbd(0x88)]&&(console[_0x146cbd(0x9a)](_0x146cbd(0x89)+_0x19b7ff[_0x146cbd(0x87)]),console[_0x146cbd(0x9a)](_0x146cbd(0x99)+_0x7f9f50));const _0x34b2e1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x7f9f50+'\x27...',()=>_0x468aaa[_0x146cbd(0x90)][_0x146cbd(0x83)](_0x7f9f50),{'verbose':_0x19b7ff[_0x146cbd(0x88)]}),_0x34834b=_0x34b2e1[_0x146cbd(0x94)];return console[_0x146cbd(0x9a)](_0x146cbd(0x97)+_0x34834b[_0x146cbd(0x93)]+_0x146cbd(0x98)+(_0x34834b[_0x146cbd(0x93)]!==0x1?'s':'')),await handleSDKOutput(_0x34834b,_0x19b7ff),0x0;}}
@@ -1 +1 @@
1
- const a26_0x128061=a26_0x31b9;function a26_0x31b9(_0x26e2ca,_0x3040e8){const _0x3b0a99=a26_0x3b0a();return a26_0x31b9=function(_0x31b997,_0x2de440){_0x31b997=_0x31b997-0x90;let _0x114bdb=_0x3b0a99[_0x31b997];return _0x114bdb;},a26_0x31b9(_0x26e2ca,_0x3040e8);}(function(_0x4b0877,_0x1c85ce){const _0x1ec776=a26_0x31b9,_0x59fe62=_0x4b0877();while(!![]){try{const _0x2d8f51=parseInt(_0x1ec776(0xa2))/0x1+parseInt(_0x1ec776(0xa4))/0x2+-parseInt(_0x1ec776(0xa6))/0x3*(-parseInt(_0x1ec776(0x9f))/0x4)+parseInt(_0x1ec776(0x91))/0x5+-parseInt(_0x1ec776(0xa7))/0x6*(-parseInt(_0x1ec776(0x90))/0x7)+parseInt(_0x1ec776(0x96))/0x8*(-parseInt(_0x1ec776(0x98))/0x9)+-parseInt(_0x1ec776(0x9c))/0xa*(parseInt(_0x1ec776(0x92))/0xb);if(_0x2d8f51===_0x1c85ce)break;else _0x59fe62['push'](_0x59fe62['shift']());}catch(_0x3ebf0e){_0x59fe62['push'](_0x59fe62['shift']());}}}(a26_0x3b0a,0xe6435));function a26_0x3b0a(){const _0x417798=['9363190DvFtBM','55XfpqNf','name','error','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','337128aMSHIN','Context\x20details:','261BbRdIY','segmentPath','format','json','3173050OndYQJ','Show\x20current\x20segment/folder\x20context','stringify','1700164CdtJwn','log','execute','300949OFqkzX','verbose','1446686bwTGjT','\x20\x20Path:\x20','3QQbncw','73680RjZHfr','segment:pwd','jsonl','245ZbFqKC'];a26_0x3b0a=function(){return _0x417798;};return a26_0x3b0a();}import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a26_0x128061(0x93)]=a26_0x128061(0xa8);['description']=a26_0x128061(0x9d);async[a26_0x128061(0xa1)](_0x5ae4a0){const _0x66ec81=a26_0x128061,{options:_0x5c5167}=_0x5ae4a0;try{const _0x1dda7a=_0x5c5167[_0x66ec81(0x99)];if(!_0x1dda7a)return _0x5c5167['format']==='json'||_0x5c5167['format']==='jsonl'?console[_0x66ec81(0xa0)](JSON[_0x66ec81(0x9e)]({'path':'/','type':'root'})):console[_0x66ec81(0xa0)]('/'),0x0;if(_0x5c5167[_0x66ec81(0x9a)]===_0x66ec81(0x9b)||_0x5c5167[_0x66ec81(0x9a)]===_0x66ec81(0xa9)){const _0xfcba51={'path':_0x1dda7a};console['log'](JSON[_0x66ec81(0x9e)](_0xfcba51));}else console[_0x66ec81(0xa0)](_0x1dda7a),_0x5c5167[_0x66ec81(0xa3)]&&(console['error'](''),console['error'](_0x66ec81(0x97)),console[_0x66ec81(0x94)](_0x66ec81(0xa5)+_0x1dda7a),console['error'](''),console[_0x66ec81(0x94)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x66ec81(0x94)](_0x66ec81(0x95)));return 0x0;}catch(_0x3a1993){throw _0x3a1993;}}}
1
+ const a26_0x10f538=a26_0x417b;(function(_0x405e2a,_0x72c23d){const _0x39d0db=a26_0x417b,_0x24f21c=_0x405e2a();while(!![]){try{const _0x99a0ea=parseInt(_0x39d0db(0x188))/0x1+parseInt(_0x39d0db(0x197))/0x2*(parseInt(_0x39d0db(0x18b))/0x3)+-parseInt(_0x39d0db(0x18c))/0x4*(parseInt(_0x39d0db(0x187))/0x5)+-parseInt(_0x39d0db(0x196))/0x6*(parseInt(_0x39d0db(0x18f))/0x7)+-parseInt(_0x39d0db(0x195))/0x8+parseInt(_0x39d0db(0x183))/0x9+parseInt(_0x39d0db(0x19a))/0xa;if(_0x99a0ea===_0x72c23d)break;else _0x24f21c['push'](_0x24f21c['shift']());}catch(_0x27e06a){_0x24f21c['push'](_0x24f21c['shift']());}}}(a26_0x1c5c,0xdf46e));function a26_0x417b(_0x44596c,_0x346cab){const _0x1c5c37=a26_0x1c5c();return a26_0x417b=function(_0x417be7,_0x52d87b){_0x417be7=_0x417be7-0x182;let _0x5850ef=_0x1c5c37[_0x417be7];return _0x5850ef;},a26_0x417b(_0x44596c,_0x346cab);}import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a26_0x10f538(0x198)]=a26_0x10f538(0x191);['description']=a26_0x10f538(0x193);async[a26_0x10f538(0x18a)](_0x242af6){const _0xe768fb=a26_0x10f538,{options:_0x386812}=_0x242af6;try{const _0x2eeacf=_0x386812[_0xe768fb(0x18e)];if(!_0x2eeacf)return _0x386812[_0xe768fb(0x185)]==='json'||_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x184)?console[_0xe768fb(0x189)](JSON['stringify']({'path':'/','type':'root'})):console[_0xe768fb(0x189)]('/'),0x0;if(_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x18d)||_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x184)){const _0x3eb377={'path':_0x2eeacf};console['log'](JSON[_0xe768fb(0x190)](_0x3eb377));}else console['log'](_0x2eeacf),_0x386812[_0xe768fb(0x194)]&&(console[_0xe768fb(0x199)](''),console[_0xe768fb(0x199)](_0xe768fb(0x186)),console[_0xe768fb(0x199)]('\x20\x20Path:\x20'+_0x2eeacf),console[_0xe768fb(0x199)](''),console['error'](_0xe768fb(0x192)),console[_0xe768fb(0x199)](_0xe768fb(0x182)));return 0x0;}catch(_0xfa42c3){throw _0xfa42c3;}}}function a26_0x1c5c(){const _0xfee966=['4405928TanZmq','721044agOQZY','80MQsEbb','name','error','4189690bHueru','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','12897360MJgyAD','jsonl','format','Context\x20details:','7055hUZvbJ','950606dvZJNG','log','execute','55530QVToYx','2824vwiZty','json','segmentPath','63FfWXol','stringify','segment:pwd','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Show\x20current\x20segment/folder\x20context','verbose'];a26_0x1c5c=function(){return _0xfee966;};return a26_0x1c5c();}
@@ -1 +1 @@
1
- const a27_0x51cf5c=a27_0x12cd;function a27_0x12cd(_0xd48412,_0x36eff4){const _0x47703a=a27_0x4770();return a27_0x12cd=function(_0x12cde2,_0x40622d){_0x12cde2=_0x12cde2-0x131;let _0x40a3b4=_0x47703a[_0x12cde2];return _0x40a3b4;},a27_0x12cd(_0xd48412,_0x36eff4);}(function(_0x35cc06,_0x4ac389){const _0x58cdbb=a27_0x12cd,_0x2b65eb=_0x35cc06();while(!![]){try{const _0x52a7aa=-parseInt(_0x58cdbb(0x139))/0x1*(-parseInt(_0x58cdbb(0x150))/0x2)+parseInt(_0x58cdbb(0x14b))/0x3+-parseInt(_0x58cdbb(0x14a))/0x4+parseInt(_0x58cdbb(0x13e))/0x5*(-parseInt(_0x58cdbb(0x155))/0x6)+parseInt(_0x58cdbb(0x13c))/0x7+parseInt(_0x58cdbb(0x15b))/0x8*(parseInt(_0x58cdbb(0x144))/0x9)+parseInt(_0x58cdbb(0x159))/0xa*(-parseInt(_0x58cdbb(0x134))/0xb);if(_0x52a7aa===_0x4ac389)break;else _0x2b65eb['push'](_0x2b65eb['shift']());}catch(_0x238897){_0x2b65eb['push'](_0x2b65eb['shift']());}}}(a27_0x4770,0xc4267));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x4770(){const _0x26756d=['703415cZTbkE','segment:update','Segment\x20ID:\x20','parentId','verbose','Resolved\x20type:\x20','3609OoTBBi','segmentPath','data','Resolving\x20path\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','632188ZJjksB','916146DEqwqi','\x20\x20\x20Path:\x20','segment','Resolving\x20folder\x20\x27','error','2XQsxpa','execute','Update\x20existing\x20child\x20segment','Parent\x20ID:\x20','rule','6LiYDHV','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x27...','description','1510dSraVK','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','13096IYhrNl','includes','folder','segmentName','resolvePathToResource','kind','resolveFolderId','ruleFile','Examples:','115027hVfMtp','updateSegmentById','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segmentId','type','1154035kgvAyW','Updating\x20segment\x20\x27','name','3957198KTVEsm','✔\x20Updated\x20segment\x20\x27'];a27_0x4770=function(){return _0x26756d;};return a27_0x4770();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0x51cf5c(0x13f);['description']=a27_0x51cf5c(0x152);async[a27_0x51cf5c(0x151)](_0x48135){const _0x2323ad=a27_0x51cf5c,{options:_0x3e9ff5,args:_0x2af222,tdx:_0x428484}=_0x48135,_0x4715b7=_0x3e9ff5;if(_0x2af222['length']===0x0)return console[_0x2323ad(0x14f)](_0x2323ad(0x148)),console[_0x2323ad(0x14f)](_0x2323ad(0x15a)),console['error'](_0x2323ad(0x133)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0x2323ad(0x156)),0x1;const _0x136f23=_0x2af222[0x0],_0x3f307c=_0x3e9ff5[_0x2323ad(0x145)];let _0x5f57f8=_0x136f23;_0x3f307c&&!_0x136f23[_0x2323ad(0x15c)]('/')&&(_0x5f57f8=_0x3f307c+'/'+_0x136f23,_0x4715b7[_0x2323ad(0x142)]&&console[_0x2323ad(0x14f)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5f57f8));const _0x164c62=await withSpinner(_0x2323ad(0x147)+_0x5f57f8+_0x2323ad(0x157),()=>_0x428484[_0x2323ad(0x14d)][_0x2323ad(0x15f)](_0x5f57f8),{'verbose':_0x4715b7[_0x2323ad(0x142)]}),_0x850af1=_0x164c62[_0x2323ad(0x146)];_0x4715b7[_0x2323ad(0x142)]&&console[_0x2323ad(0x14f)](_0x2323ad(0x143)+_0x850af1['type']);if(_0x850af1[_0x2323ad(0x138)]!==_0x2323ad(0x14d))return console[_0x2323ad(0x14f)]('Error:\x20Cannot\x20update\x20'+_0x850af1[_0x2323ad(0x138)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x2323ad(0x136)),0x1;if(!_0x850af1[_0x2323ad(0x137)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xd917e0=_0x850af1[_0x2323ad(0x141)],_0x5166c7=_0x850af1['segmentId'];_0x4715b7[_0x2323ad(0x142)]&&(console[_0x2323ad(0x14f)](_0x2323ad(0x153)+_0xd917e0),console[_0x2323ad(0x14f)](_0x2323ad(0x140)+_0x5166c7));let _0x2c5cf0;if(_0x4715b7['folder']){const _0x245b76=_0x4715b7[_0x2323ad(0x15d)],_0x45ecdc=await withSpinner(_0x2323ad(0x14e)+_0x245b76+_0x2323ad(0x157),()=>_0x428484[_0x2323ad(0x14d)][_0x2323ad(0x131)](_0xd917e0,_0x245b76),{'verbose':_0x4715b7['verbose']});_0x2c5cf0=parseInt(_0x45ecdc['data'],0xa),_0x4715b7[_0x2323ad(0x142)]&&console[_0x2323ad(0x14f)](_0x2323ad(0x149)+_0x2c5cf0);}const _0x55750e=await loadJSONFromOptions(_0x4715b7[_0x2323ad(0x154)],_0x4715b7[_0x2323ad(0x132)]),_0xf7737={'name':_0x4715b7[_0x2323ad(0x13b)],'description':_0x4715b7[_0x2323ad(0x158)],'rule':_0x55750e,'kind':_0x4715b7[_0x2323ad(0x160)]!==undefined?parseInt(_0x4715b7[_0x2323ad(0x160)],0xa):undefined,'segmentFolderId':_0x2c5cf0},_0x2fb761=await withSpinner(_0x2323ad(0x13a)+_0x850af1[_0x2323ad(0x15e)]+_0x2323ad(0x157),()=>_0x428484[_0x2323ad(0x14d)][_0x2323ad(0x135)](_0xd917e0,_0x5166c7,_0xf7737),{'verbose':_0x4715b7['verbose']}),_0x530a11=_0x2fb761[_0x2323ad(0x146)];return console['error'](_0x2323ad(0x13d)+_0x530a11[_0x2323ad(0x13b)]+'\x27'),_0x5f57f8!==_0x136f23&&console[_0x2323ad(0x14f)](_0x2323ad(0x14c)+_0x5f57f8),await handleSDKOutput([_0x530a11],_0x4715b7),0x0;}}
1
+ const a27_0xf515b0=a27_0x4795;(function(_0x1c50c5,_0x3322e4){const _0x2aa6cf=a27_0x4795,_0x349e17=_0x1c50c5();while(!![]){try{const _0x37e773=-parseInt(_0x2aa6cf(0x118))/0x1*(-parseInt(_0x2aa6cf(0x109))/0x2)+-parseInt(_0x2aa6cf(0x11e))/0x3+-parseInt(_0x2aa6cf(0x10b))/0x4*(-parseInt(_0x2aa6cf(0x11a))/0x5)+parseInt(_0x2aa6cf(0x117))/0x6+-parseInt(_0x2aa6cf(0x12b))/0x7+parseInt(_0x2aa6cf(0x110))/0x8+parseInt(_0x2aa6cf(0x12a))/0x9*(-parseInt(_0x2aa6cf(0x11c))/0xa);if(_0x37e773===_0x3322e4)break;else _0x349e17['push'](_0x349e17['shift']());}catch(_0x3bb2a2){_0x349e17['push'](_0x349e17['shift']());}}}(a27_0xa4c6,0x4b60e));function a27_0x4795(_0x34ee83,_0x20929e){const _0xa4c637=a27_0xa4c6();return a27_0x4795=function(_0x4795d5,_0x20b652){_0x4795d5=_0x4795d5-0xfe;let _0x4fd9a2=_0xa4c637[_0x4795d5];return _0x4fd9a2;},a27_0x4795(_0x34ee83,_0x20929e);}function a27_0xa4c6(){const _0x28b9e7=['3183504KwcyCj','segmentId','rule','\x27...','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolving\x20folder\x20\x27','length','2667714pDIrzw','3237fBGpGH','data','5vJWiAs','segment','10ggeiZv','name','1046808DjMolJ','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Segment\x20ID:\x20','segmentPath','Resolved\x20type:\x20','folder','verbose','ruleFile','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Error:\x20Cannot\x20update\x20','segmentName','resolveFolderId','4247487wpVCmp','2476082fhaJro','Examples:','includes','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent\x20ID:\x20','execute','Resolved\x20folder\x20ID:\x20','segment:update','INTERNAL','Updating\x20segment\x20\x27','✔\x20Updated\x20segment\x20\x27','description','updateSegmentById','136blTNIC','type','1682728lHoqBh','Update\x20existing\x20child\x20segment','resolvePathToResource','kind','error'];a27_0xa4c6=function(){return _0x28b9e7;};return a27_0xa4c6();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0xf515b0(0x103);[a27_0xf515b0(0x107)]=a27_0xf515b0(0x10c);async[a27_0xf515b0(0x101)](_0x152470){const _0x294218=a27_0xf515b0,{options:_0x471942,args:_0x511a53,tdx:_0x29ccbe}=_0x152470,_0x49154a=_0x471942;if(_0x511a53[_0x294218(0x116)]===0x0)return console[_0x294218(0x10f)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x294218(0x10f)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x294218(0x10f)](_0x294218(0x12c)),console[_0x294218(0x10f)](_0x294218(0x11f)),console[_0x294218(0x10f)](_0x294218(0xff)),0x1;const _0x21be47=_0x511a53[0x0],_0x48e5cf=_0x471942[_0x294218(0x121)];let _0x19d5b2=_0x21be47;_0x48e5cf&&!_0x21be47[_0x294218(0xfe)]('/')&&(_0x19d5b2=_0x48e5cf+'/'+_0x21be47,_0x49154a[_0x294218(0x124)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x19d5b2));const _0x5ab69e=await withSpinner('Resolving\x20path\x20\x27'+_0x19d5b2+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x10d)](_0x19d5b2),{'verbose':_0x49154a[_0x294218(0x124)]}),_0x44e97d=_0x5ab69e[_0x294218(0x119)];_0x49154a[_0x294218(0x124)]&&console[_0x294218(0x10f)](_0x294218(0x122)+_0x44e97d[_0x294218(0x10a)]);if(_0x44e97d[_0x294218(0x10a)]!==_0x294218(0x11b))return console[_0x294218(0x10f)](_0x294218(0x127)+_0x44e97d['type']+_0x294218(0x114)),console[_0x294218(0x10f)](_0x294218(0x126)),0x1;if(!_0x44e97d[_0x294218(0x111)])throw new SDKError(ErrorCode[_0x294218(0x104)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x115cd4=_0x44e97d['parentId'],_0x1c1c9e=_0x44e97d[_0x294218(0x111)];_0x49154a[_0x294218(0x124)]&&(console[_0x294218(0x10f)](_0x294218(0x100)+_0x115cd4),console[_0x294218(0x10f)](_0x294218(0x120)+_0x1c1c9e));let _0x404cbc;if(_0x49154a[_0x294218(0x123)]){const _0x559060=_0x49154a[_0x294218(0x123)],_0x3f7941=await withSpinner(_0x294218(0x115)+_0x559060+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x129)](_0x115cd4,_0x559060),{'verbose':_0x49154a[_0x294218(0x124)]});_0x404cbc=parseInt(_0x3f7941[_0x294218(0x119)],0xa),_0x49154a[_0x294218(0x124)]&&console[_0x294218(0x10f)](_0x294218(0x102)+_0x404cbc);}const _0x8add21=await loadJSONFromOptions(_0x49154a[_0x294218(0x112)],_0x49154a[_0x294218(0x125)]),_0x4fe11d={'name':_0x49154a[_0x294218(0x11d)],'description':_0x49154a[_0x294218(0x107)],'rule':_0x8add21,'kind':_0x49154a[_0x294218(0x10e)]!==undefined?parseInt(_0x49154a[_0x294218(0x10e)],0xa):undefined,'segmentFolderId':_0x404cbc},_0xe7a75b=await withSpinner(_0x294218(0x105)+_0x44e97d[_0x294218(0x128)]+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x108)](_0x115cd4,_0x1c1c9e,_0x4fe11d),{'verbose':_0x49154a[_0x294218(0x124)]}),_0x5c3e5b=_0xe7a75b[_0x294218(0x119)];return console[_0x294218(0x10f)](_0x294218(0x106)+_0x5c3e5b[_0x294218(0x11d)]+'\x27'),_0x19d5b2!==_0x21be47&&console[_0x294218(0x10f)]('\x20\x20\x20Path:\x20'+_0x19d5b2),await handleSDKOutput([_0x5c3e5b],_0x49154a),0x0;}}
@@ -1 +1 @@
1
- const a28_0x569401=a28_0xe759;(function(_0x44679e,_0x14b229){const _0xc83485=a28_0xe759,_0x501226=_0x44679e();while(!![]){try{const _0x557416=parseInt(_0xc83485(0x1cb))/0x1*(-parseInt(_0xc83485(0x1e7))/0x2)+parseInt(_0xc83485(0x1be))/0x3*(parseInt(_0xc83485(0x1ed))/0x4)+-parseInt(_0xc83485(0x1eb))/0x5*(-parseInt(_0xc83485(0x1e1))/0x6)+-parseInt(_0xc83485(0x1d7))/0x7+parseInt(_0xc83485(0x1d5))/0x8+-parseInt(_0xc83485(0x1cd))/0x9+-parseInt(_0xc83485(0x1d1))/0xa*(-parseInt(_0xc83485(0x1db))/0xb);if(_0x557416===_0x14b229)break;else _0x501226['push'](_0x501226['shift']());}catch(_0x5e64fb){_0x501226['push'](_0x501226['shift']());}}}(a28_0x3800,0xd3ee6));import{BaseCommand}from'./command.js';function a28_0xe759(_0x3c592a,_0xa7d8db){const _0x380075=a28_0x3800();return a28_0xe759=function(_0xe7592b,_0xf820c){_0xe7592b=_0xe7592b-0x1bb;let _0x48e269=_0x380075[_0xe7592b];return _0x48e269;},a28_0xe759(_0x3c592a,_0xa7d8db);}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a28_0x3800(){const _0x47532a=['Context\x20cleared.\x20Back\x20to\x20root.','folderPath','2415960fNrYSi','segment','8017758fjpITF','Parent\x20ID:\x20','data','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','11XiqpEf','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','join','fullPath','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','3022902WBEhAF','folderId','parentName','segmentPath','Target\x20path:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','17642qUTpBJ','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','resolvePathToResource','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','5BfcXJR','split','4SKWBsS','isAbsolute','error','execute','273342gehLNb','Use:\x20tdx\x20segment\x20use\x20','Resolving\x20path\x20\x27','length','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','session','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x27...','description','Site:\x20','Context\x20set\x20to:\x20','log','segment:use','53irlUvL','name','9452295MdJpmf','verbose','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','26343060usqbGi','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'];a28_0x3800=function(){return _0x47532a;};return a28_0x3800();}export class SegmentUseCommand extends BaseCommand{[a28_0x569401(0x1cc)]=a28_0x569401(0x1ca);[a28_0x569401(0x1c6)]=a28_0x569401(0x1e6);async[a28_0x569401(0x1bd)](_0x2e40a5){const _0x14d11c=a28_0x569401,{options:_0x583ff1,args:_0x35b85d,tdx:_0x3a9d83}=_0x2e40a5;if(_0x35b85d[_0x14d11c(0x1c1)]===0x0)return console['error']('Error:\x20Path\x20is\x20required'),console[_0x14d11c(0x1bc)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x14d11c(0x1bc)](_0x14d11c(0x1d0)),console[_0x14d11c(0x1bc)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x14d11c(0x1bc)](_0x14d11c(0x1ea)),console['error'](_0x14d11c(0x1e8)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1cf)),0x1;const _0x1de7a8=_0x35b85d[0x0],_0xedc921=_0x583ff1[_0x14d11c(0x1c3)];try{if(_0x1de7a8==='/')return saveSessionContext({'segment_path':undefined},_0xedc921),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x2bdc7f=_0x583ff1[_0x14d11c(0x1e4)];let _0x30b05d=_0x1de7a8;const _0x80eac0=parsePath(_0x1de7a8);if(!_0x80eac0[_0x14d11c(0x1bb)]){if(!_0x2bdc7f)return console[_0x14d11c(0x1bc)](_0x14d11c(0x1d2)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1e0)),0x1;if(_0x1de7a8==='..'){const _0xc8f93c=_0x2bdc7f[_0x14d11c(0x1ec)]('/')['slice'](0x0,-0x1)[_0x14d11c(0x1de)]('/');_0x30b05d=_0xc8f93c||'/';}else _0x1de7a8==='.'?_0x30b05d=_0x2bdc7f:_0x30b05d=_0x2bdc7f+'/'+_0x1de7a8;_0x583ff1[_0x14d11c(0x1ce)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x30b05d);}if(_0x30b05d==='/'||_0x30b05d==='')return saveSessionContext({'segment_path':undefined},_0xedc921),console[_0x14d11c(0x1c9)](_0x14d11c(0x1d3)),0x0;_0x30b05d=normalizePath(_0x30b05d);const _0x543aed=parsePath(_0x30b05d)['segments'];if(_0x543aed[_0x14d11c(0x1c1)]===0x0)return saveSessionContext({'segment_path':undefined},_0xedc921),console[_0x14d11c(0x1c9)](_0x14d11c(0x1d3)),0x0;_0x583ff1[_0x14d11c(0x1ce)]&&(console[_0x14d11c(0x1bc)](_0x14d11c(0x1c7)+_0x583ff1['site']),console['error'](_0x14d11c(0x1e5)+_0x30b05d));const _0x1b164e=await withSpinner(_0x14d11c(0x1c0)+_0x30b05d+_0x14d11c(0x1c5),()=>_0x3a9d83[_0x14d11c(0x1d6)][_0x14d11c(0x1e9)](_0x30b05d),{'verbose':_0x583ff1[_0x14d11c(0x1ce)]}),_0x42a4af=_0x1b164e[_0x14d11c(0x1d9)];_0x583ff1[_0x14d11c(0x1ce)]&&(console[_0x14d11c(0x1bc)]('Resolved\x20path\x20type:\x20'+_0x42a4af['type']),console[_0x14d11c(0x1bc)](_0x14d11c(0x1d8)+_0x42a4af['parentId']),_0x42a4af[_0x14d11c(0x1e2)]&&console[_0x14d11c(0x1bc)]('Folder\x20ID:\x20'+_0x42a4af[_0x14d11c(0x1e2)]));if(_0x42a4af['type']===_0x14d11c(0x1d6))return console[_0x14d11c(0x1bc)](_0x14d11c(0x1c4)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1da)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1bf)+_0x42a4af[_0x14d11c(0x1e3)]+(_0x42a4af[_0x14d11c(0x1d4)]?'/'+_0x42a4af[_0x14d11c(0x1d4)][_0x14d11c(0x1de)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x42a4af[_0x14d11c(0x1df)],'parent_segment':_0x42a4af[_0x14d11c(0x1e3)]},_0xedc921),console[_0x14d11c(0x1c9)](_0x14d11c(0x1c8)+_0x42a4af[_0x14d11c(0x1df)]),_0x583ff1['verbose']&&(console[_0x14d11c(0x1bc)](_0x14d11c(0x1c2)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1dd)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1dc))),0x0;}catch(_0x147880){throw _0x147880;}}}
1
+ function a28_0x2a9f(){const _0x4a561d=['type','515iARCZB','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Usage:\x20tdx\x20segment\x20use\x20<path>','segmentPath','isAbsolute','join','data','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','segment:use','verbose','Use:\x20tdx\x20segment\x20use\x20','description','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','slice','log','parentId','\x27...','folderPath','2114570efzVpJ','5811232bRwAKc','name','Context\x20set\x20to:\x20','execute','fullPath','Context\x20cleared.\x20Back\x20to\x20root.','parentName','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderId','Resolved\x20path\x20type:\x20','site','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','4224993ejLgEu','session','resolvePathToResource','split','Site:\x20','segments','length','4363404bkPcrr','error','19128GlYEKZ','1NWnQnC','6386282YDtgPf','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','15020MKblZW','13014dTTryK','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Folder\x20ID:\x20'];a28_0x2a9f=function(){return _0x4a561d;};return a28_0x2a9f();}const a28_0x252c63=a28_0x5dd3;(function(_0x8fd22c,_0x573107){const _0x269a11=a28_0x5dd3,_0x20ab05=_0x8fd22c();while(!![]){try{const _0x1cb7b3=parseInt(_0x269a11(0x18d))/0x1*(parseInt(_0x269a11(0x175))/0x2)+-parseInt(_0x269a11(0x183))/0x3+parseInt(_0x269a11(0x18c))/0x4*(-parseInt(_0x269a11(0x163))/0x5)+-parseInt(_0x269a11(0x18a))/0x6+parseInt(_0x269a11(0x18e))/0x7+-parseInt(_0x269a11(0x176))/0x8+-parseInt(_0x269a11(0x15e))/0x9*(-parseInt(_0x269a11(0x15d))/0xa);if(_0x1cb7b3===_0x573107)break;else _0x20ab05['push'](_0x20ab05['shift']());}catch(_0x219c3c){_0x20ab05['push'](_0x20ab05['shift']());}}}(a28_0x2a9f,0xc022c));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a28_0x5dd3(_0xd02058,_0x5a9782){const _0x2a9fd8=a28_0x2a9f();return a28_0x5dd3=function(_0x5dd302,_0x522cf4){_0x5dd302=_0x5dd302-0x15b;let _0x14aacd=_0x2a9fd8[_0x5dd302];return _0x14aacd;},a28_0x5dd3(_0xd02058,_0x5a9782);}export class SegmentUseCommand extends BaseCommand{[a28_0x252c63(0x177)]=a28_0x252c63(0x16b);[a28_0x252c63(0x16e)]=a28_0x252c63(0x164);async[a28_0x252c63(0x179)](_0x2e78eb){const _0x47ec38=a28_0x252c63,{options:_0x2e4bbc,args:_0x14bcc5,tdx:_0x150b38}=_0x2e78eb;if(_0x14bcc5[_0x47ec38(0x189)]===0x0)return console[_0x47ec38(0x18b)]('Error:\x20Path\x20is\x20required'),console[_0x47ec38(0x18b)](_0x47ec38(0x165)),console['error']('Examples:'),console[_0x47ec38(0x18b)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x47ec38(0x18b)](_0x47ec38(0x17e)),console['error'](_0x47ec38(0x160)),console['error'](_0x47ec38(0x15c)),0x1;const _0x51a752=_0x14bcc5[0x0],_0x39875b=_0x2e4bbc[_0x47ec38(0x184)];try{if(_0x51a752==='/')return saveSessionContext({'segment_path':undefined},_0x39875b),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x420f7a=_0x2e4bbc[_0x47ec38(0x166)];let _0x34927d=_0x51a752;const _0x288dc9=parsePath(_0x51a752);if(!_0x288dc9[_0x47ec38(0x167)]){if(!_0x420f7a)return console[_0x47ec38(0x18b)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console['error'](_0x47ec38(0x16a)),0x1;if(_0x51a752==='..'){const _0xd98d01=_0x420f7a[_0x47ec38(0x186)]('/')[_0x47ec38(0x170)](0x0,-0x1)[_0x47ec38(0x168)]('/');_0x34927d=_0xd98d01||'/';}else _0x51a752==='.'?_0x34927d=_0x420f7a:_0x34927d=_0x420f7a+'/'+_0x51a752;_0x2e4bbc[_0x47ec38(0x16c)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x34927d);}if(_0x34927d==='/'||_0x34927d==='')return saveSessionContext({'segment_path':undefined},_0x39875b),console[_0x47ec38(0x171)](_0x47ec38(0x17b)),0x0;_0x34927d=normalizePath(_0x34927d);const _0x115c31=parsePath(_0x34927d)[_0x47ec38(0x188)];if(_0x115c31[_0x47ec38(0x189)]===0x0)return saveSessionContext({'segment_path':undefined},_0x39875b),console[_0x47ec38(0x171)](_0x47ec38(0x17b)),0x0;_0x2e4bbc['verbose']&&(console['error'](_0x47ec38(0x187)+_0x2e4bbc[_0x47ec38(0x181)]),console['error'](_0x47ec38(0x17d)+_0x34927d));const _0x41f58e=await withSpinner('Resolving\x20path\x20\x27'+_0x34927d+_0x47ec38(0x173),()=>_0x150b38['segment'][_0x47ec38(0x185)](_0x34927d),{'verbose':_0x2e4bbc[_0x47ec38(0x16c)]}),_0xaf3309=_0x41f58e[_0x47ec38(0x169)];_0x2e4bbc[_0x47ec38(0x16c)]&&(console[_0x47ec38(0x18b)](_0x47ec38(0x180)+_0xaf3309[_0x47ec38(0x162)]),console[_0x47ec38(0x18b)]('Parent\x20ID:\x20'+_0xaf3309[_0x47ec38(0x172)]),_0xaf3309[_0x47ec38(0x17f)]&&console[_0x47ec38(0x18b)](_0x47ec38(0x161)+_0xaf3309[_0x47ec38(0x17f)]));if(_0xaf3309[_0x47ec38(0x162)]===_0x47ec38(0x15b))return console['error'](_0x47ec38(0x18f)),console[_0x47ec38(0x18b)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x47ec38(0x18b)](_0x47ec38(0x16d)+_0xaf3309[_0x47ec38(0x17c)]+(_0xaf3309[_0x47ec38(0x174)]?'/'+_0xaf3309[_0x47ec38(0x174)][_0x47ec38(0x168)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0xaf3309['fullPath'],'parent_segment':_0xaf3309[_0x47ec38(0x17c)]},_0x39875b),console['log'](_0x47ec38(0x178)+_0xaf3309[_0x47ec38(0x17a)]),_0x2e4bbc[_0x47ec38(0x16c)]&&(console[_0x47ec38(0x18b)](_0x47ec38(0x16f)),console['error'](_0x47ec38(0x182)),console[_0x47ec38(0x18b)](_0x47ec38(0x15f))),0x0;}catch(_0x1ed02a){throw _0x1ed02a;}}}