@treasuredata/tdx 0.4.3 → 0.4.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 (117) 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/engage-api-client.d.ts +135 -0
  6. package/dist/client/engage-api-client.d.ts.map +1 -0
  7. package/dist/client/engage-api-client.js +1 -0
  8. package/dist/client/engage-api-client.js.map +1 -0
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.js +1 -1
  13. package/dist/client/trino-api-client.js +1 -1
  14. package/dist/client/workflow-client.js +1 -1
  15. package/dist/commands/activations.js +1 -1
  16. package/dist/commands/api-command.js +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/command.d.ts.map +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/command.js.map +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.d.ts +197 -0
  27. package/dist/commands/engage-command.d.ts.map +1 -0
  28. package/dist/commands/engage-command.js +1 -0
  29. package/dist/commands/engage-command.js.map +1 -0
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pwd-command.js +1 -1
  40. package/dist/commands/segment-update-command.js +1 -1
  41. package/dist/commands/segment-use-command.js +1 -1
  42. package/dist/commands/segments.js +1 -1
  43. package/dist/commands/show.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/use-command.d.ts +1 -0
  46. package/dist/commands/use-command.d.ts.map +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/use-command.js.map +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.d.ts +1 -0
  58. package/dist/core/session.d.ts.map +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/session.js.map +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/server.js +1 -1
  64. package/dist/proxy/session-cache.js +1 -1
  65. package/dist/sdk/api.js +1 -1
  66. package/dist/sdk/engage.d.ts +256 -0
  67. package/dist/sdk/engage.d.ts.map +1 -0
  68. package/dist/sdk/engage.js +1 -0
  69. package/dist/sdk/engage.js.map +1 -0
  70. package/dist/sdk/errors.js +1 -1
  71. package/dist/sdk/index.d.ts +7 -0
  72. package/dist/sdk/index.d.ts.map +1 -1
  73. package/dist/sdk/index.js +1 -1
  74. package/dist/sdk/index.js.map +1 -1
  75. package/dist/sdk/job.js +1 -1
  76. package/dist/sdk/llm.js +1 -1
  77. package/dist/sdk/query.js +1 -1
  78. package/dist/sdk/segment.js +1 -1
  79. package/dist/sdk/workflow.js +1 -1
  80. package/dist/types/endpoints.d.ts +4 -0
  81. package/dist/types/endpoints.d.ts.map +1 -1
  82. package/dist/types/endpoints.js +1 -1
  83. package/dist/types/endpoints.js.map +1 -1
  84. package/dist/types/engage.d.ts +442 -0
  85. package/dist/types/engage.d.ts.map +1 -0
  86. package/dist/types/engage.js +1 -0
  87. package/dist/types/engage.js.map +1 -0
  88. package/dist/types/index.d.ts +2 -1
  89. package/dist/types/index.d.ts.map +1 -1
  90. package/dist/types/index.js +1 -1
  91. package/dist/utils/agent-ref-parser.js +1 -1
  92. package/dist/utils/chat-cache.js +1 -1
  93. package/dist/utils/colors.js +1 -1
  94. package/dist/utils/command-output.js +1 -1
  95. package/dist/utils/constants.js +1 -1
  96. package/dist/utils/file-permissions.js +1 -1
  97. package/dist/utils/format-detector.js +1 -1
  98. package/dist/utils/formatters.js +1 -1
  99. package/dist/utils/json-loader.js +1 -1
  100. package/dist/utils/llm-backup-utils.js +1 -1
  101. package/dist/utils/model-aliases.js +1 -1
  102. package/dist/utils/option-validation.js +1 -1
  103. package/dist/utils/port.js +1 -1
  104. package/dist/utils/process.js +1 -1
  105. package/dist/utils/prompt.js +1 -1
  106. package/dist/utils/segment-path-parser.js +1 -1
  107. package/dist/utils/segment-ref-parser.js +1 -1
  108. package/dist/utils/spinner.js +1 -1
  109. package/dist/utils/sql-parser.js +1 -1
  110. package/dist/utils/sse-parser.js +1 -1
  111. package/dist/utils/string-utils.js +1 -1
  112. package/dist/utils/table-ref-parser.js +1 -1
  113. package/dist/utils/tdx-logger.js +1 -1
  114. package/dist/utils/tree-formatter.js +1 -1
  115. package/dist/utils/version-check.js +1 -1
  116. package/dist/utils/workflow-utils.js +1 -1
  117. package/package.json +1 -1
@@ -1 +1 @@
1
- const a20_0x543648=a20_0x2916;(function(_0x3f9e47,_0x126779){const _0x5381b1=a20_0x2916,_0x36d536=_0x3f9e47();while(!![]){try{const _0x5d109a=parseInt(_0x5381b1(0x7e))/0x1+-parseInt(_0x5381b1(0x86))/0x2*(-parseInt(_0x5381b1(0x72))/0x3)+-parseInt(_0x5381b1(0x9a))/0x4+parseInt(_0x5381b1(0x88))/0x5+-parseInt(_0x5381b1(0x7d))/0x6+parseInt(_0x5381b1(0x7f))/0x7*(-parseInt(_0x5381b1(0x76))/0x8)+parseInt(_0x5381b1(0x68))/0x9;if(_0x5d109a===_0x126779)break;else _0x36d536['push'](_0x36d536['shift']());}catch(_0xc88975){_0x36d536['push'](_0x36d536['shift']());}}}(a20_0x2cf4,0xc8f74));function a20_0x2cf4(){const _0x1d8b7d=['error','Site:\x20','8427591hOISlk','updateParent','length','addAttributes','addBehaviors','verbose','attributesFile','Parent\x20segment:\x20','\x27...','site','3cvwNpx','customerGroup','Database:\x20','scheduleType','4466648Eaqtpq','Error:\x20Parent\x20segment\x20name\x20is\x20required','timezone','✔\x20Created\x20parent\x20segment\x20\x27','Fetching\x20current\x20configuration\x20for\x20\x27','segment:parent:update','attributes','6774648rlWfSp','465656csejWx','14VyBHuY','createParent','description','database','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','data','Updating\x20parent\x20segment\x20\x27','629634mjWEVl','scheduleOption','7388850JyPAtK','table','Update\x20existing\x20parent\x20segment\x20(audience)','execute','behaviors','segment','Table:\x20','Create\x20new\x20parent\x20segment\x20(audience)','name','Creating\x20parent\x20segment\x20\x27','behaviorsFile','getParentFull','customerGroupFile','addAttributesFile','\x27\x20with\x20ID:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','segment:parent:create','✔\x20Updated\x20parent\x20segment\x20\x27','502864JTGeyf'];a20_0x2cf4=function(){return _0x1d8b7d;};return a20_0x2cf4();}function a20_0x2916(_0x4bfb3f,_0x16452d){const _0x2cf4fe=a20_0x2cf4();return a20_0x2916=function(_0x2916ac,_0x599a59){_0x2916ac=_0x2916ac-0x68;let _0x4cb12a=_0x2cf4fe[_0x2916ac];return _0x4cb12a;},a20_0x2916(_0x4bfb3f,_0x16452d);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{['name']=a20_0x543648(0x98);['description']=a20_0x543648(0x8f);async[a20_0x543648(0x8b)](_0x4d185e){const _0x3c8688=a20_0x543648,{options:_0x97fc8e,args:_0x148981,tdx:_0x31fb4d}=_0x4d185e,_0x108dac=_0x97fc8e;if(_0x148981['length']===0x0)return console[_0x3c8688(0x9b)](_0x3c8688(0x77)),console[_0x3c8688(0x9b)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x43947a=_0x148981[0x0];if(!_0x108dac[_0x3c8688(0x82)]||!_0x108dac[_0x3c8688(0x89)])return console[_0x3c8688(0x9b)](_0x3c8688(0x97)),console[_0x3c8688(0x9b)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x108dac[_0x3c8688(0x6d)]&&(console[_0x3c8688(0x9b)](_0x3c8688(0x9c)+_0x108dac[_0x3c8688(0x71)]),console[_0x3c8688(0x9b)]('Name:\x20'+_0x43947a),console[_0x3c8688(0x9b)](_0x3c8688(0x74)+_0x108dac[_0x3c8688(0x82)]),console['error'](_0x3c8688(0x8e)+_0x108dac['table']));const _0x5109e6=await loadJSONFromOptions(_0x108dac[_0x3c8688(0x7c)],_0x108dac[_0x3c8688(0x6e)]),_0x59620d=await loadJSONFromOptions(_0x108dac['behaviors'],_0x108dac[_0x3c8688(0x92)]),_0x3f3bc2=await loadJSONFromOptions(_0x108dac[_0x3c8688(0x73)],_0x108dac[_0x3c8688(0x94)]),_0x45f93d={'name':_0x43947a,'description':_0x108dac[_0x3c8688(0x81)],'scheduleType':_0x108dac[_0x3c8688(0x75)],'scheduleOption':_0x108dac[_0x3c8688(0x87)],'timezone':_0x108dac[_0x3c8688(0x78)],'master':{'parentDatabaseName':_0x108dac[_0x3c8688(0x82)],'parentTableName':_0x108dac[_0x3c8688(0x89)]},'attributes':_0x5109e6,'behaviors':_0x59620d,'customerGroup':_0x3f3bc2},_0x5a85dc=await withSpinner(_0x3c8688(0x91)+_0x43947a+'\x27...',()=>_0x31fb4d[_0x3c8688(0x8d)][_0x3c8688(0x80)](_0x45f93d),{'verbose':_0x97fc8e[_0x3c8688(0x6d)]}),_0x195b63=_0x5a85dc[_0x3c8688(0x84)];return console[_0x3c8688(0x9b)](_0x3c8688(0x79)+_0x195b63[_0x3c8688(0x90)]+_0x3c8688(0x96)+_0x195b63['id']),await handleSDKOutput([_0x195b63],_0x97fc8e),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a20_0x543648(0x90)]=a20_0x543648(0x7b);[a20_0x543648(0x81)]=a20_0x543648(0x8a);async[a20_0x543648(0x8b)](_0x1095cd){const _0x3b771b=a20_0x543648,{options:_0x1db135,args:_0xe27c1c,tdx:_0x58ca3d}=_0x1095cd,_0x1e22b8=_0x1db135;if(_0xe27c1c[_0x3b771b(0x6a)]===0x0)return console[_0x3b771b(0x9b)](_0x3b771b(0x77)),console[_0x3b771b(0x9b)](_0x3b771b(0x83)),0x1;const _0x19a01b=_0xe27c1c[0x0];_0x1e22b8['verbose']&&(console[_0x3b771b(0x9b)](_0x3b771b(0x9c)+_0x1e22b8[_0x3b771b(0x71)]),console[_0x3b771b(0x9b)](_0x3b771b(0x6f)+_0x19a01b));const _0x27ec41=await withSpinner(_0x3b771b(0x7a)+_0x19a01b+_0x3b771b(0x70),()=>_0x58ca3d[_0x3b771b(0x8d)][_0x3b771b(0x93)](_0x19a01b),{'verbose':_0x1e22b8[_0x3b771b(0x6d)]}),_0x3d5e05=_0x27ec41[_0x3b771b(0x84)],_0x135543=await loadJSONFromOptions(_0x1e22b8[_0x3b771b(0x6b)],_0x1e22b8[_0x3b771b(0x95)]),_0x6946a0=await loadJSONFromOptions(_0x1e22b8[_0x3b771b(0x6c)],_0x1e22b8['addBehaviorsFile']),_0x2915da={'name':_0x3d5e05[_0x3b771b(0x90)],'description':_0x1e22b8[_0x3b771b(0x81)]!==undefined?_0x1e22b8[_0x3b771b(0x81)]:_0x3d5e05[_0x3b771b(0x81)],'scheduleType':_0x1e22b8['scheduleType']!==undefined?_0x1e22b8[_0x3b771b(0x75)]:_0x3d5e05[_0x3b771b(0x75)],'scheduleOption':_0x1e22b8[_0x3b771b(0x87)]!==undefined?_0x1e22b8['scheduleOption']:_0x3d5e05[_0x3b771b(0x87)],'timezone':_0x1e22b8[_0x3b771b(0x78)]!==undefined?_0x1e22b8[_0x3b771b(0x78)]:_0x3d5e05[_0x3b771b(0x78)],'master':_0x3d5e05['master'],'attributes':_0x135543?[..._0x3d5e05[_0x3b771b(0x7c)]||[],..._0x135543]:_0x3d5e05[_0x3b771b(0x7c)],'behaviors':_0x6946a0?[..._0x3d5e05[_0x3b771b(0x8c)]||[],..._0x6946a0]:_0x3d5e05[_0x3b771b(0x8c)],'customerGroup':_0x3d5e05[_0x3b771b(0x73)]},_0x4fc329=await withSpinner(_0x3b771b(0x85)+_0x19a01b+_0x3b771b(0x70),()=>_0x58ca3d[_0x3b771b(0x8d)][_0x3b771b(0x69)](_0x19a01b,_0x2915da),{'verbose':_0x1e22b8[_0x3b771b(0x6d)]}),_0x52e233=_0x4fc329[_0x3b771b(0x84)];return console[_0x3b771b(0x9b)](_0x3b771b(0x99)+_0x52e233['name']+'\x27'),await handleSDKOutput([_0x52e233],_0x1e22b8),0x0;}}
1
+ const a22_0x11fef3=a22_0x5ec7;(function(_0x4a4c8c,_0x5303df){const _0x1cca09=a22_0x5ec7,_0x3055e8=_0x4a4c8c();while(!![]){try{const _0x2231e2=-parseInt(_0x1cca09(0xcc))/0x1+-parseInt(_0x1cca09(0xb0))/0x2+-parseInt(_0x1cca09(0xc7))/0x3+parseInt(_0x1cca09(0xb8))/0x4*(parseInt(_0x1cca09(0xab))/0x5)+-parseInt(_0x1cca09(0xaa))/0x6+-parseInt(_0x1cca09(0xc6))/0x7+parseInt(_0x1cca09(0xbf))/0x8;if(_0x2231e2===_0x5303df)break;else _0x3055e8['push'](_0x3055e8['shift']());}catch(_0x57060a){_0x3055e8['push'](_0x3055e8['shift']());}}}(a22_0x2dc1,0x1ce46));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{[a22_0x11fef3(0xd8)]='segment:parent:create';[a22_0x11fef3(0xd2)]=a22_0x11fef3(0xc4);async['execute'](_0x38f072){const _0x50da32=a22_0x11fef3,{options:_0x39b11a,args:_0x5ec9b5,tdx:_0x5aed9c}=_0x38f072,_0x468663=_0x39b11a;if(_0x5ec9b5[_0x50da32(0xd3)]===0x0)return console[_0x50da32(0xba)](_0x50da32(0xaf)),console[_0x50da32(0xba)](_0x50da32(0xbb)),0x1;const _0x2e9b86=_0x5ec9b5[0x0];if(!_0x468663[_0x50da32(0xd9)]||!_0x468663[_0x50da32(0xb9)])return console[_0x50da32(0xba)](_0x50da32(0xb7)),console['error'](_0x50da32(0xbb)),0x1;_0x468663['verbose']&&(console[_0x50da32(0xba)](_0x50da32(0xd1)+_0x468663[_0x50da32(0xd7)]),console[_0x50da32(0xba)](_0x50da32(0xc1)+_0x2e9b86),console[_0x50da32(0xba)](_0x50da32(0xb5)+_0x468663[_0x50da32(0xd9)]),console[_0x50da32(0xba)](_0x50da32(0xb2)+_0x468663[_0x50da32(0xb9)]));const _0x4003ef=await loadJSONFromOptions(_0x468663[_0x50da32(0xbc)],_0x468663[_0x50da32(0xbd)]),_0x2cf637=await loadJSONFromOptions(_0x468663[_0x50da32(0xb4)],_0x468663[_0x50da32(0xae)]),_0x2a5da5=await loadJSONFromOptions(_0x468663[_0x50da32(0xcb)],_0x468663[_0x50da32(0xc3)]),_0x2f8075={'name':_0x2e9b86,'description':_0x468663[_0x50da32(0xd2)],'scheduleType':_0x468663[_0x50da32(0xca)],'scheduleOption':_0x468663[_0x50da32(0xcf)],'timezone':_0x468663[_0x50da32(0xd6)],'master':{'parentDatabaseName':_0x468663['database'],'parentTableName':_0x468663['table']},'attributes':_0x4003ef,'behaviors':_0x2cf637,'customerGroup':_0x2a5da5},_0x8e19df=await withSpinner(_0x50da32(0xc9)+_0x2e9b86+'\x27...',()=>_0x5aed9c[_0x50da32(0xc2)][_0x50da32(0xda)](_0x2f8075),{'verbose':_0x39b11a[_0x50da32(0xd4)]}),_0x406371=_0x8e19df[_0x50da32(0xad)];return console['error'](_0x50da32(0xcd)+_0x406371[_0x50da32(0xd8)]+_0x50da32(0xd5)+_0x406371['id']),await handleSDKOutput([_0x406371],_0x39b11a),0x0;}}function a22_0x5ec7(_0x5bc50f,_0x429b27){const _0x2dc197=a22_0x2dc1();return a22_0x5ec7=function(_0x5ec72c,_0x482d3b){_0x5ec72c=_0x5ec72c-0xa9;let _0x3424dc=_0x2dc197[_0x5ec72c];return _0x3424dc;},a22_0x5ec7(_0x5bc50f,_0x429b27);}function a22_0x2dc1(){const _0x11d1c6=['site','name','database','createParent','✔\x20Updated\x20parent\x20segment\x20\x27','1144224wCnlVW','5eJccJY','addBehaviors','data','behaviorsFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','412838CYxgFv','Fetching\x20current\x20configuration\x20for\x20\x27','Table:\x20','addBehaviorsFile','behaviors','Database:\x20','getParentFull','Error:\x20--database\x20and\x20--table\x20are\x20required','7972PXGEED','table','error','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','attributes','attributesFile','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','6916088pSKHls','addAttributes','Name:\x20','segment','customerGroupFile','Create\x20new\x20parent\x20segment\x20(audience)','Update\x20existing\x20parent\x20segment\x20(audience)','547414oUawiY','467922ybGolW','\x27...','Creating\x20parent\x20segment\x20\x27','scheduleType','customerGroup','116863bEsveh','✔\x20Created\x20parent\x20segment\x20\x27','updateParent','scheduleOption','master','Site:\x20','description','length','verbose','\x27\x20with\x20ID:\x20','timezone'];a22_0x2dc1=function(){return _0x11d1c6;};return a22_0x2dc1();}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';[a22_0x11fef3(0xd2)]=a22_0x11fef3(0xc5);async['execute'](_0x238a6a){const _0x572cc8=a22_0x11fef3,{options:_0x4a685a,args:_0x18bbc6,tdx:_0x35823d}=_0x238a6a,_0x5465af=_0x4a685a;if(_0x18bbc6['length']===0x0)return console[_0x572cc8(0xba)](_0x572cc8(0xaf)),console[_0x572cc8(0xba)](_0x572cc8(0xbe)),0x1;const _0x2be581=_0x18bbc6[0x0];_0x5465af[_0x572cc8(0xd4)]&&(console[_0x572cc8(0xba)]('Site:\x20'+_0x5465af[_0x572cc8(0xd7)]),console['error']('Parent\x20segment:\x20'+_0x2be581));const _0x426837=await withSpinner(_0x572cc8(0xb1)+_0x2be581+_0x572cc8(0xc8),()=>_0x35823d['segment'][_0x572cc8(0xb6)](_0x2be581),{'verbose':_0x5465af[_0x572cc8(0xd4)]}),_0x2be697=_0x426837[_0x572cc8(0xad)],_0x135511=await loadJSONFromOptions(_0x5465af[_0x572cc8(0xc0)],_0x5465af['addAttributesFile']),_0x397316=await loadJSONFromOptions(_0x5465af[_0x572cc8(0xac)],_0x5465af[_0x572cc8(0xb3)]),_0x556e61={'name':_0x2be697[_0x572cc8(0xd8)],'description':_0x5465af[_0x572cc8(0xd2)]!==undefined?_0x5465af['description']:_0x2be697[_0x572cc8(0xd2)],'scheduleType':_0x5465af[_0x572cc8(0xca)]!==undefined?_0x5465af['scheduleType']:_0x2be697[_0x572cc8(0xca)],'scheduleOption':_0x5465af[_0x572cc8(0xcf)]!==undefined?_0x5465af['scheduleOption']:_0x2be697[_0x572cc8(0xcf)],'timezone':_0x5465af[_0x572cc8(0xd6)]!==undefined?_0x5465af[_0x572cc8(0xd6)]:_0x2be697[_0x572cc8(0xd6)],'master':_0x2be697[_0x572cc8(0xd0)],'attributes':_0x135511?[..._0x2be697[_0x572cc8(0xbc)]||[],..._0x135511]:_0x2be697[_0x572cc8(0xbc)],'behaviors':_0x397316?[..._0x2be697[_0x572cc8(0xb4)]||[],..._0x397316]:_0x2be697['behaviors'],'customerGroup':_0x2be697[_0x572cc8(0xcb)]},_0x1b0498=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x2be581+'\x27...',()=>_0x35823d[_0x572cc8(0xc2)][_0x572cc8(0xce)](_0x2be581,_0x556e61),{'verbose':_0x5465af[_0x572cc8(0xd4)]}),_0x3cc4d9=_0x1b0498[_0x572cc8(0xad)];return console[_0x572cc8(0xba)](_0x572cc8(0xa9)+_0x3cc4d9[_0x572cc8(0xd8)]+'\x27'),await handleSDKOutput([_0x3cc4d9],_0x5465af),0x0;}}
@@ -1 +1 @@
1
- const a21_0x504124=a21_0xbd19;(function(_0x2064a1,_0x2af44c){const _0x5d8758=a21_0xbd19,_0x1c6afb=_0x2064a1();while(!![]){try{const _0x359819=parseInt(_0x5d8758(0x18a))/0x1*(parseInt(_0x5d8758(0x18f))/0x2)+-parseInt(_0x5d8758(0x19b))/0x3+-parseInt(_0x5d8758(0x198))/0x4+parseInt(_0x5d8758(0x190))/0x5+parseInt(_0x5d8758(0x18d))/0x6+-parseInt(_0x5d8758(0x195))/0x7+parseInt(_0x5d8758(0x19c))/0x8*(-parseInt(_0x5d8758(0x19d))/0x9);if(_0x359819===_0x2af44c)break;else _0x1c6afb['push'](_0x1c6afb['shift']());}catch(_0x3a42fe){_0x1c6afb['push'](_0x1c6afb['shift']());}}}(a21_0x1a79,0xf264c));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a21_0x504124(0x192)]=a21_0x504124(0x193);[a21_0x504124(0x191)]=a21_0x504124(0x18c);async[a21_0x504124(0x188)](_0x47a512){const _0x2ae5f6=a21_0x504124,{options:_0x42fea4}=_0x47a512;try{const _0x3d3208=listProfiles(),_0x44a480=getActiveProfile();if(_0x3d3208[_0x2ae5f6(0x189)]===0x0)return console['log'](_0x2ae5f6(0x19e)),console['log'](_0x2ae5f6(0x197)),console[_0x2ae5f6(0x196)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x8c10e3=_0x3d3208[_0x2ae5f6(0x194)](_0x1ccc1c=>{const _0x317f18=_0x2ae5f6,_0x3a6ec9=_0x1ccc1c[_0x317f18(0x192)]===_0x44a480,_0x4da949=getProfileParams(_0x1ccc1c[_0x317f18(0x199)]);return{'name':_0x1ccc1c['name'],'active':_0x3a6ec9,'scope':_0x1ccc1c[_0x317f18(0x19a)],'description':_0x1ccc1c[_0x317f18(0x199)]['description']||'','params':_0x4da949};});return await handleSDKOutput(_0x8c10e3,_0x42fea4),0x0;}catch(_0x200e74){return _0x200e74 instanceof Error&&console[_0x2ae5f6(0x18b)](_0x2ae5f6(0x18e)+_0x200e74['message']),0x1;}}}function a21_0xbd19(_0x491393,_0x33e910){const _0x1a7992=a21_0x1a79();return a21_0xbd19=function(_0xbd19fc,_0x47b5b6){_0xbd19fc=_0xbd19fc-0x188;let _0xad6435=_0x1a7992[_0xbd19fc];return _0xad6435;},a21_0xbd19(_0x491393,_0x33e910);}function a21_0x1a79(){const _0x189c4c=['8120200JcwjPu','description','name','profiles','map','1163064rvsoXe','log','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','621824ZWvHEm','config','scope','3006825kRtyHK','10149232ktcHfZ','9hmDMBV','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','execute','length','622730CpaWDf','error','List\x20all\x20available\x20profiles','8031666rfoxBI','Error:\x20','2AIUaLV'];a21_0x1a79=function(){return _0x189c4c;};return a21_0x1a79();}
1
+ const a23_0x3b266f=a23_0x3b60;(function(_0x16a397,_0x2ec0f9){const _0x3d3280=a23_0x3b60,_0x213c96=_0x16a397();while(!![]){try{const _0x382691=-parseInt(_0x3d3280(0x1c3))/0x1+-parseInt(_0x3d3280(0x1b8))/0x2+-parseInt(_0x3d3280(0x1b1))/0x3*(parseInt(_0x3d3280(0x1b5))/0x4)+parseInt(_0x3d3280(0x1bf))/0x5+-parseInt(_0x3d3280(0x1b7))/0x6*(parseInt(_0x3d3280(0x1b6))/0x7)+parseInt(_0x3d3280(0x1b9))/0x8*(parseInt(_0x3d3280(0x1c5))/0x9)+parseInt(_0x3d3280(0x1c6))/0xa;if(_0x382691===_0x2ec0f9)break;else _0x213c96['push'](_0x213c96['shift']());}catch(_0x2a610e){_0x213c96['push'](_0x213c96['shift']());}}}(a23_0x399c,0x576f2));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a23_0x3b60(_0x40e16e,_0x608abf){const _0x399cbd=a23_0x399c();return a23_0x3b60=function(_0x3b60ab,_0x511764){_0x3b60ab=_0x3b60ab-0x1b1;let _0x2248b3=_0x399cbd[_0x3b60ab];return _0x2248b3;},a23_0x3b60(_0x40e16e,_0x608abf);}function a23_0x399c(){const _0xb3cf93=['365172UyvJhj','957010BkYutR','4848632LrpMSx','log','profiles','description','Error:\x20','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2538775ktSzcC','error','execute','scope','508041UEcUNQ','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','9EtQNZc','7829080lzMOQh','87LtEVrL','name','length','\x20\x20Global:\x20~/.config/tdx/tdx.json','42568Vttset','28QOWMFh'];a23_0x399c=function(){return _0xb3cf93;};return a23_0x399c();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a23_0x3b266f(0x1b2)]=a23_0x3b266f(0x1bb);['description']='List\x20all\x20available\x20profiles';async[a23_0x3b266f(0x1c1)](_0x58df7f){const _0x490deb=a23_0x3b266f,{options:_0x82d60e}=_0x58df7f;try{const _0x56d865=listProfiles(),_0x33ae92=getActiveProfile();if(_0x56d865[_0x490deb(0x1b3)]===0x0)return console['log'](_0x490deb(0x1c4)),console[_0x490deb(0x1ba)](_0x490deb(0x1be)),console[_0x490deb(0x1ba)](_0x490deb(0x1b4)),0x0;const _0x31de42=_0x56d865['map'](_0x35eed0=>{const _0x2f6e1e=_0x490deb,_0x2e2f21=_0x35eed0[_0x2f6e1e(0x1b2)]===_0x33ae92,_0x1b76f3=getProfileParams(_0x35eed0['config']);return{'name':_0x35eed0[_0x2f6e1e(0x1b2)],'active':_0x2e2f21,'scope':_0x35eed0[_0x2f6e1e(0x1c2)],'description':_0x35eed0['config'][_0x2f6e1e(0x1bc)]||'','params':_0x1b76f3};});return await handleSDKOutput(_0x31de42,_0x82d60e),0x0;}catch(_0x3029fe){return _0x3029fe instanceof Error&&console[_0x490deb(0x1c0)](_0x490deb(0x1bd)+_0x3029fe['message']),0x1;}}}
@@ -1 +1 @@
1
- const a22_0x4402ef=a22_0x820a;(function(_0x202e10,_0x8045da){const _0x1f34ab=a22_0x820a,_0xa1e82d=_0x202e10();while(!![]){try{const _0x240c2a=parseInt(_0x1f34ab(0x1fc))/0x1+parseInt(_0x1f34ab(0x1ec))/0x2*(parseInt(_0x1f34ab(0x1e7))/0x3)+-parseInt(_0x1f34ab(0x1eb))/0x4*(-parseInt(_0x1f34ab(0x1e8))/0x5)+parseInt(_0x1f34ab(0x1f8))/0x6*(-parseInt(_0x1f34ab(0x1f1))/0x7)+-parseInt(_0x1f34ab(0x200))/0x8+parseInt(_0x1f34ab(0x1d9))/0x9*(parseInt(_0x1f34ab(0x1e5))/0xa)+parseInt(_0x1f34ab(0x1d5))/0xb*(-parseInt(_0x1f34ab(0x1e3))/0xc);if(_0x240c2a===_0x8045da)break;else _0xa1e82d['push'](_0xa1e82d['shift']());}catch(_0x41ad05){_0xa1e82d['push'](_0xa1e82d['shift']());}}}(a22_0x9cf7,0x59f45));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';function a22_0x9cf7(){const _0x3cd456=['380QspIoN','totalSplits','3fYvObV','16505jexUpb','length','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','824IOhDhF','727952XUbgVi','state','message','jobId','Statement\x20','131257PuRxtH','execute','join','Site:\x20','Catalog:\x20','processedRows','Error:\x20','114AMaplu','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','stats','SQL:\x20','691058QhWLUE','verbose','\x20splits','validate','5415376wZXWUL','query','error','elapsedTimeMillis','output','Schema:\x20','setJobId','data','4873VJCVWF','push','Executing\x20statement\x20','args','25749roTeBr','...','catalog','setPhase','information_schema','completedSplits','Executing\x20query\x20[','in\x20','database','Executing\x20query...','11976MxRJGL','file'];a22_0x9cf7=function(){return _0x3cd456;};return a22_0x9cf7();}function a22_0x820a(_0x30d04a,_0x4a1f91){const _0x9cf735=a22_0x9cf7();return a22_0x820a=function(_0x820ac3,_0x4d58f6){_0x820ac3=_0x820ac3-0x1d4;let _0x30715a=_0x9cf735[_0x820ac3];return _0x30715a;},a22_0x820a(_0x30d04a,_0x4a1f91);}import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']=a22_0x4402ef(0x201);['description']='Run\x20Trino\x20queries\x20(streaming)';async[a22_0x4402ef(0x1f2)](_0x172ce2){const _0x1ff00d=a22_0x4402ef,{options:_0x1afa73,args:_0x760183,tdx:_0xa529b7}=_0x172ce2,_0x4a4971=_0x760183[0x0],_0x312672=_0x1afa73[_0x1ff00d(0x1e4)];let _0xb0280f;if(_0x312672)try{_0xb0280f=readSqlStatementsFromFile(_0x312672);}catch(_0x279bef){return console[_0x1ff00d(0x202)](_0x1ff00d(0x1f7)+_0x279bef['message']),0x1;}else try{_0xb0280f=splitSqlStatements(_0x4a4971);}catch(_0x284ca2){return console[_0x1ff00d(0x202)](_0x1ff00d(0x1f7)+_0x284ca2[_0x1ff00d(0x1ee)]),0x1;}const _0x3ce267=_0x1afa73[_0x1ff00d(0x1e1)]||_0x1ff00d(0x1dd),_0x266385=_0x1afa73[_0x1ff00d(0x1db)];try{const _0x15adbd=[],_0x419d42=!!_0x1afa73[_0x1ff00d(0x204)];for(let _0x234861=0x0;_0x234861<_0xb0280f['length'];_0x234861++){const _0x2e29b8=_0xb0280f[_0x234861],_0xf715e8=_0x234861+0x1,_0x570b52=_0xb0280f[_0x1ff00d(0x1e9)],_0x31b9f6=_0x570b52>0x1;_0x1afa73[_0x1ff00d(0x1fd)]&&(console[_0x1ff00d(0x202)]('\x0a'+(_0x31b9f6?_0x1ff00d(0x1f0)+_0xf715e8+'/'+_0x570b52+':':'')),console[_0x1ff00d(0x202)](_0x1ff00d(0x1f4)+_0x1afa73['site']),console['error'](_0x1ff00d(0x1f5)+(_0x266385||'td')),console[_0x1ff00d(0x202)](_0x1ff00d(0x205)+_0x3ce267),console[_0x1ff00d(0x202)](_0x1ff00d(0x1fb)+_0x2e29b8));const _0x27dd4b=_0x31b9f6?_0x1ff00d(0x1d7)+_0xf715e8+'/'+_0x570b52+_0x1ff00d(0x1da):_0x1ff00d(0x1e2);try{const _0x4a1c24=await withQuerySpinner(_0x27dd4b,async _0x548954=>{const _0x4b97b1=_0x1ff00d,_0x7b65cc=await _0xa529b7[_0x4b97b1(0x201)]['execute'](_0x2e29b8,{'catalog':_0x266385,'schema':_0x3ce267,'onJobId':_0x1b296a=>{const _0x28adb9=_0x4b97b1;_0x548954[_0x28adb9(0x206)](_0x1b296a);},'onProgress':_0x37da0f=>{const _0x1f0cbb=_0x4b97b1;_0x548954[_0x1f0cbb(0x1dc)](_0x1f0cbb(0x1df)+_0x37da0f[_0x1f0cbb(0x1ed)]+']'),_0x548954['setExtra'](formatRows(_0x37da0f[_0x1f0cbb(0x1f6)])+'\x20rows\x20'+_0x37da0f[_0x1f0cbb(0x1de)]+'/'+_0x37da0f[_0x1f0cbb(0x1e6)]+_0x1f0cbb(0x1fe));}});return _0x7b65cc;},{'verbose':_0x1afa73['verbose']}),_0x323e06=_0x4a1c24[_0x1ff00d(0x1d4)],_0x281c37=_0x323e06[_0x1ff00d(0x1ef)]?'\x20[Job\x20ID:\x20'+_0x323e06['jobId']+']':'',_0x4e1508=_0x31b9f6?_0x1ff00d(0x1f0)+_0xf715e8+'/'+_0x570b52+'\x20-\x20':'';console[_0x1ff00d(0x202)]('✔\x20'+_0x4e1508+'Query\x20completed:\x20Processed\x20'+formatRows(_0x323e06[_0x1ff00d(0x1fa)]['processedRows'])+'\x20rows\x20'+(_0x1ff00d(0x1e0)+formatElapsed(_0x323e06['stats'][_0x1ff00d(0x203)])+_0x281c37));if(_0x31b9f6&&_0x419d42){const _0x2c5364=resolveOutputOptions(_0x1afa73),_0x24111f=await formatQueryOutput(_0x323e06,_0x2c5364);_0x15adbd[_0x1ff00d(0x1d6)](_0x24111f);}else await handleQueryOutput(_0x323e06,_0x1afa73);}catch(_0x3f59e5){const _0x58b7e1=_0x31b9f6?_0x1ff00d(0x1f0)+_0xf715e8+'/'+_0x570b52+':\x0a':'',_0x37fbdf=_0x3f59e5 instanceof SDKError?_0x3f59e5['originalMessage']:_0x3f59e5[_0x1ff00d(0x1ee)];return console[_0x1ff00d(0x202)](''+_0x58b7e1+_0x37fbdf),0x1;}}if(_0xb0280f[_0x1ff00d(0x1e9)]>0x1&&_0x419d42&&_0x15adbd[_0x1ff00d(0x1e9)]>0x0){const _0x57fb49=_0x15adbd[_0x1ff00d(0x1f3)]('\x0a');writeFileSync(_0x1afa73[_0x1ff00d(0x204)],_0x57fb49),console[_0x1ff00d(0x202)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x1afa73[_0x1ff00d(0x204)]);}return 0x0;}catch(_0x4b8a4e){throw _0x4b8a4e;}}[a22_0x4402ef(0x1ff)](_0x512173){const _0x4f22bc=a22_0x4402ef,_0x39f216=_0x512173[_0x4f22bc(0x1d8)][0x0],_0x278bbe=_0x512173['options'][_0x4f22bc(0x1e4)];if(!_0x39f216&&!_0x278bbe)return _0x4f22bc(0x1ea);if(_0x39f216&&_0x278bbe)return _0x4f22bc(0x1f9);return undefined;}}
1
+ const a24_0x5d2fc6=a24_0x1b00;function a24_0x1b00(_0x1ee25e,_0x314001){const _0x587708=a24_0x5877();return a24_0x1b00=function(_0x1b0002,_0x5bc754){_0x1b0002=_0x1b0002-0xaf;let _0x229aff=_0x587708[_0x1b0002];return _0x229aff;},a24_0x1b00(_0x1ee25e,_0x314001);}(function(_0x536666,_0x47977f){const _0x1b3127=a24_0x1b00,_0x309d77=_0x536666();while(!![]){try{const _0x33024f=parseInt(_0x1b3127(0xd9))/0x1*(parseInt(_0x1b3127(0xc1))/0x2)+-parseInt(_0x1b3127(0xd7))/0x3+parseInt(_0x1b3127(0xc3))/0x4*(parseInt(_0x1b3127(0xb7))/0x5)+parseInt(_0x1b3127(0xd4))/0x6+parseInt(_0x1b3127(0xca))/0x7+parseInt(_0x1b3127(0xe0))/0x8*(parseInt(_0x1b3127(0xd6))/0x9)+-parseInt(_0x1b3127(0xb1))/0xa*(parseInt(_0x1b3127(0xbf))/0xb);if(_0x33024f===_0x47977f)break;else _0x309d77['push'](_0x309d77['shift']());}catch(_0x1fbd7f){_0x309d77['push'](_0x309d77['shift']());}}}(a24_0x5877,0x81bfe));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a24_0x5877(){const _0x5afb20=['information_schema','3687576LAzqSj','query','state','Error:\x20','5590zAKZsx','file','jobId','\x20[Job\x20ID:\x20','error','Schema:\x20','4509705UhSUKN','processedRows','Executing\x20query\x20[','database','name','verbose','message','setExtra','43483tTjukx','elapsedTimeMillis','1975882AFNuAu','originalMessage','4HkSikZ','\x20splits','description','\x20rows\x20','Executing\x20query...','output','\x0aAll\x20results\x20saved\x20to\x20','4591524AORgPF','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','args','\x20-\x20','join','Query\x20completed:\x20Processed\x20','validate','Statement\x20','options','data','471618zYFcau','site','9PVSdHr','1032549GPyVia','completedSplits','1FhYLRI','push','length','Site:\x20','stats','setJobId'];a24_0x5877=function(){return _0x5afb20;};return a24_0x5877();}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';export class QueryCommand extends BaseCommand{[a24_0x5d2fc6(0xbb)]=a24_0x5d2fc6(0xe1);[a24_0x5d2fc6(0xc5)]='Run\x20Trino\x20queries\x20(streaming)';async['execute'](_0x360ba9){const _0x1b7c82=a24_0x5d2fc6,{options:_0x3d76e7,args:_0x558ec6,tdx:_0xbee988}=_0x360ba9,_0x274569=_0x558ec6[0x0],_0x4d464c=_0x3d76e7['file'];let _0x6b21d9;if(_0x4d464c)try{_0x6b21d9=readSqlStatementsFromFile(_0x4d464c);}catch(_0x1992af){return console[_0x1b7c82(0xb5)]('Error:\x20'+_0x1992af[_0x1b7c82(0xbd)]),0x1;}else try{_0x6b21d9=splitSqlStatements(_0x274569);}catch(_0x217dd4){return console['error'](_0x1b7c82(0xb0)+_0x217dd4['message']),0x1;}const _0x24ef0e=_0x3d76e7[_0x1b7c82(0xba)]||_0x1b7c82(0xdf),_0x2db84a=_0x3d76e7['catalog'];try{const _0x167e7e=[],_0x377a4c=!!_0x3d76e7[_0x1b7c82(0xc8)];for(let _0x230bf5=0x0;_0x230bf5<_0x6b21d9[_0x1b7c82(0xdb)];_0x230bf5++){const _0x213f10=_0x6b21d9[_0x230bf5],_0x9b4fd6=_0x230bf5+0x1,_0x3461db=_0x6b21d9['length'],_0xb79fa=_0x3461db>0x1;_0x3d76e7[_0x1b7c82(0xbc)]&&(console[_0x1b7c82(0xb5)]('\x0a'+(_0xb79fa?_0x1b7c82(0xd1)+_0x9b4fd6+'/'+_0x3461db+':':'')),console[_0x1b7c82(0xb5)](_0x1b7c82(0xdc)+_0x3d76e7[_0x1b7c82(0xd5)]),console['error']('Catalog:\x20'+(_0x2db84a||'td')),console['error'](_0x1b7c82(0xb6)+_0x24ef0e),console['error']('SQL:\x20'+_0x213f10));const _0x330c2b=_0xb79fa?'Executing\x20statement\x20'+_0x9b4fd6+'/'+_0x3461db+'...':_0x1b7c82(0xc7);try{const _0x43c712=await withQuerySpinner(_0x330c2b,async _0x13ebd6=>{const _0xabc58b=_0x1b7c82,_0x559451=await _0xbee988[_0xabc58b(0xe1)]['execute'](_0x213f10,{'catalog':_0x2db84a,'schema':_0x24ef0e,'onJobId':_0x261d83=>{const _0x577102=_0xabc58b;_0x13ebd6[_0x577102(0xde)](_0x261d83);},'onProgress':_0x23375e=>{const _0x344db3=_0xabc58b;_0x13ebd6['setPhase'](_0x344db3(0xb9)+_0x23375e[_0x344db3(0xaf)]+']'),_0x13ebd6[_0x344db3(0xbe)](formatRows(_0x23375e[_0x344db3(0xb8)])+'\x20rows\x20'+_0x23375e[_0x344db3(0xd8)]+'/'+_0x23375e['totalSplits']+_0x344db3(0xc4));}});return _0x559451;},{'verbose':_0x3d76e7[_0x1b7c82(0xbc)]}),_0x5de81c=_0x43c712[_0x1b7c82(0xd3)],_0x222119=_0x5de81c[_0x1b7c82(0xb3)]?_0x1b7c82(0xb4)+_0x5de81c[_0x1b7c82(0xb3)]+']':'',_0x38dafc=_0xb79fa?_0x1b7c82(0xd1)+_0x9b4fd6+'/'+_0x3461db+_0x1b7c82(0xcd):'';console[_0x1b7c82(0xb5)]('✔\x20'+_0x38dafc+_0x1b7c82(0xcf)+formatRows(_0x5de81c['stats'][_0x1b7c82(0xb8)])+_0x1b7c82(0xc6)+('in\x20'+formatElapsed(_0x5de81c[_0x1b7c82(0xdd)][_0x1b7c82(0xc0)])+_0x222119));if(_0xb79fa&&_0x377a4c){const _0x43e04b=resolveOutputOptions(_0x3d76e7),_0x415449=await formatQueryOutput(_0x5de81c,_0x43e04b);_0x167e7e[_0x1b7c82(0xda)](_0x415449);}else await handleQueryOutput(_0x5de81c,_0x3d76e7);}catch(_0x3c4e58){const _0x167cce=_0xb79fa?_0x1b7c82(0xd1)+_0x9b4fd6+'/'+_0x3461db+':\x0a':'',_0x27df0c=_0x3c4e58 instanceof SDKError?_0x3c4e58[_0x1b7c82(0xc2)]:_0x3c4e58[_0x1b7c82(0xbd)];return console[_0x1b7c82(0xb5)](''+_0x167cce+_0x27df0c),0x1;}}if(_0x6b21d9[_0x1b7c82(0xdb)]>0x1&&_0x377a4c&&_0x167e7e[_0x1b7c82(0xdb)]>0x0){const _0xfb328e=_0x167e7e[_0x1b7c82(0xce)]('\x0a');writeFileSync(_0x3d76e7['output'],_0xfb328e),console[_0x1b7c82(0xb5)](_0x1b7c82(0xc9)+_0x3d76e7['output']);}return 0x0;}catch(_0x2ec349){throw _0x2ec349;}}[a24_0x5d2fc6(0xd0)](_0x59dc21){const _0x37dd2d=a24_0x5d2fc6,_0x3f5271=_0x59dc21[_0x37dd2d(0xcc)][0x0],_0x1dfbd4=_0x59dc21[_0x37dd2d(0xd2)][_0x37dd2d(0xb2)];if(!_0x3f5271&&!_0x1dfbd4)return'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';if(_0x3f5271&&_0x1dfbd4)return _0x37dd2d(0xcb);return undefined;}}
@@ -1 +1 @@
1
- const a23_0x5bde68=a23_0x59cb;(function(_0x452969,_0xffc48e){const _0x156db5=a23_0x59cb,_0x593705=_0x452969();while(!![]){try{const _0x97a4b4=-parseInt(_0x156db5(0x1fc))/0x1+parseInt(_0x156db5(0x19e))/0x2+parseInt(_0x156db5(0x1f6))/0x3+parseInt(_0x156db5(0x208))/0x4+parseInt(_0x156db5(0x1b6))/0x5*(parseInt(_0x156db5(0x1f0))/0x6)+parseInt(_0x156db5(0x1de))/0x7*(parseInt(_0x156db5(0x1db))/0x8)+-parseInt(_0x156db5(0x1f8))/0x9;if(_0x97a4b4===_0xffc48e)break;else _0x593705['push'](_0x593705['shift']());}catch(_0x4368a0){_0x593705['push'](_0x593705['shift']());}}}(a23_0x2438,0x5a4aa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a23_0x2438(){const _0x1f81d0=['Error:\x20','stats','listFolders','Usage:\x20tdx\x20segment\x20sql\x20<path>','Error:\x20Parent\x20segment\x20name\x20is\x20required','data','getParent','INTERNAL','2512vSzlqC','jsonl','getSegment','2849aeAgps','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','processedRows','verbose','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','description','getParentSQL','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Folder\x20name:\x20','message','trim','resolvePathToResource','Usage:\x20tdx\x20segment\x20show\x20<path>','createFolder','segmentPath','Segment\x20ID:\x20','6fwAvTb','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','error','Fetching\x20segment\x20details...','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','length','660468ymZDzw','query','3791007QcVMGm','parentId','segment:folder:show','Resolved\x20parent\x20folder\x20ID:\x20','690862jEGTKO','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','jobId','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','segment:folder:list','code','in\x20','✖\x20Query\x20failed\x20[','Parent\x20name:\x20','segment:folder:create','SQL\x20query:\x0a','Fetching\x20folder\x20details...','1542656PQRPwr','parent','Examples:','json','Folder\x20ID\x20missing\x20from\x20resolved\x20path','SELECT\x20*\x20FROM\x20(\x0a','477470GjLIVX','replace','\x20folder','type','\x20\x20Cause:\x20','cause','\x20rows\x20','segment:show','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','test','site','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','folderId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','segment','includes','Site:\x20','execute','Resolved\x20relative\x20path\x20to:\x20','✔\x20Query\x20completed:\x20Processed\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','2547830qpPbek','\x27...','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentSegment','Create\x20segment\x20folder\x20for\x20organization','folder','Resolving\x20path\x20\x27','Parent\x20ID:\x20','Error:\x20Folder\x20reference\x20is\x20required','parentFolder','name','✔\x20Created\x20folder\x20\x27','getSegmentSQL','limit','segmentId','Resolved\x20type:\x20','format','information_schema','Show\x20segment\x20or\x20folder\x20details','Parent\x20segment:\x20','resolveParentId','log','Fetching\x20SQL\x20for\x20segment...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27\x20with\x20ID:\x20','Resolved\x20parent\x20ID:\x20','segment:describe','Executing\x20segment\x20query...'];a23_0x2438=function(){return _0x1f81d0;};return a23_0x2438();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x1d1);[a23_0x5bde68(0x1e3)]=a23_0x5bde68(0x1c9);async[a23_0x5bde68(0x1b2)](_0xd0dbba){const _0x79d0ae=a23_0x5bde68,{options:_0x858281,args:_0x5167c0,tdx:_0x3bd52e}=_0xd0dbba,_0x33002e=_0x5167c0[0x0],_0x145e57=!_0x33002e&&!!_0x858281[_0x79d0ae(0x1ba)],_0x4124b5=_0x33002e||_0x858281[_0x79d0ae(0x1ba)];if(!_0x4124b5)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x79d0ae(0x1f2)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x79d0ae(0x1f2)](_0x79d0ae(0x20a)),console['error'](_0x79d0ae(0x1ae)),console[_0x79d0ae(0x1f2)](_0x79d0ae(0x1a6)),console[_0x79d0ae(0x1f2)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x79d0ae(0x1f2)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x39d305=_0x858281['segmentPath'];let _0x210cf3=_0x4124b5;!_0x145e57&&_0x39d305&&!_0x4124b5[_0x79d0ae(0x1b0)]('/')&&(_0x210cf3=_0x39d305+'/'+_0x4124b5,_0x858281[_0x79d0ae(0x1e1)]&&console[_0x79d0ae(0x1f2)]('Resolved\x20relative\x20path\x20to:\x20'+_0x210cf3));const _0x5d394a=await withSpinner('Resolving\x20path\x20\x27'+_0x210cf3+_0x79d0ae(0x1b7),()=>_0x3bd52e[_0x79d0ae(0x1af)]['resolvePathToResource'](_0x210cf3),{'verbose':_0x858281[_0x79d0ae(0x1e1)]}),_0x3732a1=_0x5d394a[_0x79d0ae(0x1d8)];_0x858281['verbose']&&(console[_0x79d0ae(0x1f2)](_0x79d0ae(0x1c6)+_0x3732a1['type']),console[_0x79d0ae(0x1f2)](_0x79d0ae(0x1be)+_0x3732a1[_0x79d0ae(0x1f9)]),_0x3732a1[_0x79d0ae(0x1ad)]&&console[_0x79d0ae(0x1f2)]('Folder\x20ID:\x20'+_0x3732a1[_0x79d0ae(0x1ad)]),_0x3732a1['segmentId']&&console['error'](_0x79d0ae(0x1ef)+_0x3732a1['segmentId']));if(_0x3732a1['type']===_0x79d0ae(0x209)){const _0x54ef99=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x3bd52e[_0x79d0ae(0x1af)][_0x79d0ae(0x1d9)](_0x3732a1['parentId']),{'verbose':_0x858281['verbose']});await handleSingleObjectOutput(_0x54ef99[_0x79d0ae(0x1d8)],_0x858281);}else{if(_0x3732a1[_0x79d0ae(0x1a1)]===_0x79d0ae(0x1bc)){if(!_0x3732a1[_0x79d0ae(0x1ad)])throw new SDKError(ErrorCode[_0x79d0ae(0x1da)],_0x79d0ae(0x20c));const _0x2ade64=await withSpinner(_0x79d0ae(0x207),()=>_0x3bd52e['segment']['getFolder'](_0x3732a1[_0x79d0ae(0x1ad)]),{'verbose':_0x858281[_0x79d0ae(0x1e1)]});await handleSingleObjectOutput(_0x2ade64['data'],_0x858281);}else{if(_0x3732a1[_0x79d0ae(0x1a1)]===_0x79d0ae(0x1af)){if(!_0x3732a1[_0x79d0ae(0x1c5)])throw new SDKError(ErrorCode['INTERNAL'],_0x79d0ae(0x1b5));const _0x2304b8=await withSpinner(_0x79d0ae(0x1f3),()=>_0x3bd52e[_0x79d0ae(0x1af)][_0x79d0ae(0x1dd)](_0x3732a1['parentId'],_0x3732a1[_0x79d0ae(0x1c5)]),{'verbose':_0x858281[_0x79d0ae(0x1e1)]});await handleSingleObjectOutput(_0x2304b8[_0x79d0ae(0x1d8)],_0x858281);}}}return 0x0;}catch(_0x326a85){if(_0x326a85 instanceof SDKError)return console['error'](_0x79d0ae(0x1d3)+_0x326a85['message']),_0x326a85[_0x79d0ae(0x1a3)]&&console[_0x79d0ae(0x1f2)]('\x20\x20Cause:\x20'+_0x326a85[_0x79d0ae(0x1a3)]),0x1;throw _0x326a85;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x1a5);['description']='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a23_0x5bde68(0x1b2)](_0x283033){const _0x360b08=a23_0x5bde68,{options:_0x32397d,args:_0x4e07a8,tdx:_0x500c4d}=_0x283033,_0x31794e=_0x4e07a8[0x0],_0x1131cf=!_0x31794e&&!!_0x32397d[_0x360b08(0x1ba)],_0x181214=_0x31794e||_0x32397d[_0x360b08(0x1ba)];if(!_0x181214)return console['error'](_0x360b08(0x1ce)),console[_0x360b08(0x1f2)](_0x360b08(0x1ec)),console[_0x360b08(0x1f2)]('Examples:'),console['error'](_0x360b08(0x1e7)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x360b08(0x1f2)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x360b08(0x1f2)](_0x360b08(0x1e6)),0x1;try{const _0x1cb44e=_0x32397d[_0x360b08(0x1ee)];let _0x491cfa=_0x181214;!_0x1131cf&&_0x1cb44e&&!_0x181214['includes']('/')&&(_0x491cfa=_0x1cb44e+'/'+_0x181214,_0x32397d[_0x360b08(0x1e1)]&&console['error'](_0x360b08(0x1b3)+_0x491cfa));const _0x4b244a=await withSpinner(_0x360b08(0x1bd)+_0x491cfa+_0x360b08(0x1b7),()=>_0x500c4d[_0x360b08(0x1af)][_0x360b08(0x1eb)](_0x491cfa),{'verbose':_0x32397d[_0x360b08(0x1e1)]}),_0x4a92ea=_0x4b244a[_0x360b08(0x1d8)];_0x32397d[_0x360b08(0x1e1)]&&(console[_0x360b08(0x1f2)](_0x360b08(0x1c6)+_0x4a92ea[_0x360b08(0x1a1)]),console[_0x360b08(0x1f2)](_0x360b08(0x1be)+_0x4a92ea['parentId']));if(_0x4a92ea[_0x360b08(0x1a1)]==='folder')return console[_0x360b08(0x1f2)](_0x360b08(0x1f1)),console[_0x360b08(0x1f2)](_0x360b08(0x1f4)),0x1;let _0x13c98e;if(_0x4a92ea['type']==='parent'){const _0x4d1b55=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x500c4d[_0x360b08(0x1af)][_0x360b08(0x1e4)](_0x4a92ea[_0x360b08(0x1f9)]),{'verbose':_0x32397d[_0x360b08(0x1e1)]});_0x13c98e=_0x4d1b55[_0x360b08(0x1d8)];}else{if(!_0x4a92ea[_0x360b08(0x1c5)])throw new SDKError(ErrorCode[_0x360b08(0x1da)],_0x360b08(0x1b5));const _0x3e798f=await withSpinner(_0x360b08(0x1cd),()=>_0x500c4d[_0x360b08(0x1af)][_0x360b08(0x1c3)](_0x4a92ea[_0x360b08(0x1f9)],_0x4a92ea[_0x360b08(0x1c5)]),{'verbose':_0x32397d[_0x360b08(0x1e1)]});_0x13c98e=_0x3e798f[_0x360b08(0x1d8)];}const _0x5c9de8=resolveLimit(_0x32397d[_0x360b08(0x1c4)],DEFAULT_DISPLAY_LIMIT),_0x1d913d=/\bLIMIT\s+\d+/i[_0x360b08(0x1a7)](_0x13c98e);!_0x1d913d&&(_0x13c98e=_0x13c98e[_0x360b08(0x1ea)]()[_0x360b08(0x19f)](/;+$/,''),_0x13c98e=_0x360b08(0x19d)+_0x13c98e+_0x360b08(0x1fd)+_0x5c9de8);_0x32397d[_0x360b08(0x1e1)]&&console[_0x360b08(0x1f2)](_0x360b08(0x206)+_0x13c98e);const _0x1de18b=await withQuerySpinner(_0x360b08(0x1d2),async _0x5e1722=>{const _0x51eedb=_0x360b08,_0x4d823c=await _0x500c4d[_0x51eedb(0x1f7)]['execute'](_0x13c98e,{'catalog':'td','schema':_0x51eedb(0x1c8),'onJobId':_0x380d53=>{_0x5e1722['setJobId'](_0x380d53);}});return _0x4d823c;},{'verbose':_0x32397d['verbose']}),_0x2ac937=_0x1de18b[_0x360b08(0x1d8)],_0x1bbef6=_0x2ac937['jobId']?'\x20[Job\x20ID:\x20'+_0x2ac937[_0x360b08(0x1fe)]+']':'';return console[_0x360b08(0x1f2)](_0x360b08(0x1b4)+_0x2ac937[_0x360b08(0x1d4)][_0x360b08(0x1e0)]['toLocaleString']()+_0x360b08(0x1a4)+(_0x360b08(0x202)+formatElapsed(_0x2ac937['stats']['elapsedTimeMillis'])+_0x1bbef6)),await handleQueryOutput(_0x2ac937,_0x32397d),0x0;}catch(_0x5ef710){if(_0x5ef710 instanceof SDKError)return console[_0x360b08(0x1f2)](_0x360b08(0x203)+_0x5ef710[_0x360b08(0x201)]+']'),console[_0x360b08(0x1f2)]('\x0a'+_0x5ef710[_0x360b08(0x1e9)]),0x1;throw _0x5ef710;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x200);[a23_0x5bde68(0x1e3)]=a23_0x5bde68(0x1e5);async['execute'](_0x1de00c){const _0x5e1aed=a23_0x5bde68,{options:_0x1331c2,args:_0x598abc,tdx:_0x47739c}=_0x1de00c;if(_0x598abc['length']===0x0)return console[_0x5e1aed(0x1f2)](_0x5e1aed(0x1d7)),console[_0x5e1aed(0x1f2)](_0x5e1aed(0x1ac)),0x1;const _0xadfa6d=_0x598abc[0x0];try{_0x1331c2[_0x5e1aed(0x1e1)]&&(console[_0x5e1aed(0x1f2)]('Site:\x20'+_0x1331c2[_0x5e1aed(0x1a8)]),console['error'](_0x5e1aed(0x204)+_0xadfa6d));const _0x134f0c=await withSpinner(_0x5e1aed(0x1a9)+_0xadfa6d+_0x5e1aed(0x1b7),()=>_0x47739c[_0x5e1aed(0x1af)][_0x5e1aed(0x1cb)](_0xadfa6d),{'verbose':_0x1331c2[_0x5e1aed(0x1e1)]}),_0x1a8956=_0x134f0c[_0x5e1aed(0x1d8)];_0x1331c2['verbose']&&console['error'](_0x5e1aed(0x1d0)+_0x1a8956);const _0x350479=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0xadfa6d+_0x5e1aed(0x1b7),()=>_0x47739c[_0x5e1aed(0x1af)][_0x5e1aed(0x1d5)](_0x1a8956),{'verbose':_0x1331c2[_0x5e1aed(0x1e1)]}),_0x1c0cda=_0x350479[_0x5e1aed(0x1d8)];return console['error']('✔\x20Found\x20'+_0x1c0cda[_0x5e1aed(0x1f5)]+_0x5e1aed(0x1a0)+(_0x1c0cda[_0x5e1aed(0x1f5)]!==0x1?'s':'')),await handleSDKOutput(_0x1c0cda,_0x1331c2),0x0;}catch(_0x2fcbfd){if(_0x2fcbfd instanceof SDKError)return console[_0x5e1aed(0x1f2)](_0x5e1aed(0x1d3)+_0x2fcbfd['message']),_0x2fcbfd[_0x5e1aed(0x1a3)]&&console[_0x5e1aed(0x1f2)](_0x5e1aed(0x1a2)+_0x2fcbfd[_0x5e1aed(0x1a3)]),0x1;throw _0x2fcbfd;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x1fa);['description']='Show\x20segment\x20folder\x20details';async[a23_0x5bde68(0x1b2)](_0x173de7){const _0x459036=a23_0x5bde68,{options:_0x29e926,args:_0x4f42a1,tdx:_0x7ce0fb}=_0x173de7;if(_0x4f42a1[_0x459036(0x1f5)]===0x0)return console[_0x459036(0x1f2)](_0x459036(0x1bf)),console[_0x459036(0x1f2)](_0x459036(0x1aa)),0x1;try{const {parentId:_0x2a0131,childId:_0x1c1006}=parseSegmentRef(_0x4f42a1[0x0]);_0x29e926['verbose']&&(console[_0x459036(0x1f2)](_0x459036(0x1b1)+_0x29e926[_0x459036(0x1a8)]),console[_0x459036(0x1f2)](_0x459036(0x204)+_0x2a0131),_0x1c1006&&console[_0x459036(0x1f2)](_0x459036(0x1e8)+_0x1c1006));if(!_0x1c1006)return console[_0x459036(0x1f2)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x47d4d4=await withSpinner(_0x459036(0x1a9)+_0x2a0131+_0x459036(0x1b7),()=>_0x7ce0fb[_0x459036(0x1af)]['resolveParentId'](_0x2a0131),{'verbose':_0x29e926['verbose']}),_0x3348d6=_0x47d4d4[_0x459036(0x1d8)];_0x29e926[_0x459036(0x1e1)]&&console[_0x459036(0x1f2)](_0x459036(0x1d0)+_0x3348d6);const _0x24e4d7=await withSpinner('Resolving\x20folder\x20\x27'+_0x1c1006+_0x459036(0x1b7),()=>_0x7ce0fb[_0x459036(0x1af)]['resolveFolderId'](_0x3348d6,_0x1c1006),{'verbose':_0x29e926[_0x459036(0x1e1)]}),_0x262211=_0x24e4d7['data'];_0x29e926[_0x459036(0x1e1)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x262211);const _0x51e935=await withSpinner('Fetching\x20folder\x20\x27'+_0x1c1006+_0x459036(0x1b7),()=>_0x7ce0fb['segment']['getFolder'](_0x262211),{'verbose':_0x29e926[_0x459036(0x1e1)]});return await handleSDKOutput([_0x51e935[_0x459036(0x1d8)]],_0x29e926),0x0;}catch(_0x572aff){if(_0x572aff instanceof SDKError)return console['error'](_0x459036(0x1d3)+_0x572aff[_0x459036(0x1e9)]),_0x572aff[_0x459036(0x1a3)]&&console[_0x459036(0x1f2)](_0x459036(0x1a2)+_0x572aff[_0x459036(0x1a3)]),0x1;throw _0x572aff;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]='segment:sql';[a23_0x5bde68(0x1e3)]=a23_0x5bde68(0x1ab);async[a23_0x5bde68(0x1b2)](_0x4f7939){const _0x2ec5c5=a23_0x5bde68,{options:_0x13a79d,args:_0x30e003,tdx:_0x55f48b}=_0x4f7939,_0x15edc6=_0x30e003[0x0],_0x833fe8=!_0x15edc6&&!!_0x13a79d[_0x2ec5c5(0x1ba)],_0x397f89=_0x15edc6||_0x13a79d['parentSegment'];if(!_0x397f89)return console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1ce)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1d6)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x20a)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1ff)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1b9)),console['error'](_0x2ec5c5(0x1e2)),console[_0x2ec5c5(0x1f2)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x1bbe5f=_0x13a79d[_0x2ec5c5(0x1ee)];let _0x32334d=_0x397f89;!_0x833fe8&&_0x1bbe5f&&!_0x397f89[_0x2ec5c5(0x1b0)]('/')&&(_0x32334d=_0x1bbe5f+'/'+_0x397f89,_0x13a79d[_0x2ec5c5(0x1e1)]&&console[_0x2ec5c5(0x1f2)]('Resolved\x20relative\x20path\x20to:\x20'+_0x32334d));const _0x5015c4=await withSpinner('Resolving\x20path\x20\x27'+_0x32334d+'\x27...',()=>_0x55f48b[_0x2ec5c5(0x1af)]['resolvePathToResource'](_0x32334d),{'verbose':_0x13a79d[_0x2ec5c5(0x1e1)]}),_0x4a192d=_0x5015c4[_0x2ec5c5(0x1d8)];_0x13a79d[_0x2ec5c5(0x1e1)]&&(console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1c6)+_0x4a192d[_0x2ec5c5(0x1a1)]),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1be)+_0x4a192d[_0x2ec5c5(0x1f9)]));if(_0x4a192d[_0x2ec5c5(0x1a1)]==='folder')return console['error'](_0x2ec5c5(0x1b8)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1df)),0x1;let _0x54fbf3;if(_0x4a192d['type']==='parent'){const _0x568328=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x55f48b['segment'][_0x2ec5c5(0x1e4)](_0x4a192d['parentId']),{'verbose':_0x13a79d[_0x2ec5c5(0x1e1)]});_0x54fbf3=_0x568328['data'];}else{if(!_0x4a192d[_0x2ec5c5(0x1c5)])throw new SDKError(ErrorCode[_0x2ec5c5(0x1da)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x398c34=await withSpinner(_0x2ec5c5(0x1cd),()=>_0x55f48b[_0x2ec5c5(0x1af)][_0x2ec5c5(0x1c3)](_0x4a192d[_0x2ec5c5(0x1f9)],_0x4a192d[_0x2ec5c5(0x1c5)]),{'verbose':_0x13a79d[_0x2ec5c5(0x1e1)]});_0x54fbf3=_0x398c34[_0x2ec5c5(0x1d8)];}return _0x13a79d[_0x2ec5c5(0x1c7)]===_0x2ec5c5(0x20b)||_0x13a79d['format']===_0x2ec5c5(0x1dc)?await handleSDKOutput([{'sql':_0x54fbf3}],_0x13a79d):console[_0x2ec5c5(0x1cc)](_0x54fbf3),0x0;}catch(_0x53db5d){if(_0x53db5d instanceof SDKError)return console['error'](_0x2ec5c5(0x1d3)+_0x53db5d[_0x2ec5c5(0x1e9)]),_0x53db5d['cause']&&console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1a2)+_0x53db5d[_0x2ec5c5(0x1a3)]),0x1;throw _0x53db5d;}}}function a23_0x59cb(_0x1f3a32,_0x6eee0c){const _0x2438fb=a23_0x2438();return a23_0x59cb=function(_0x59cb6f,_0xd2b194){_0x59cb6f=_0x59cb6f-0x19d;let _0x463c48=_0x2438fb[_0x59cb6f];return _0x463c48;},a23_0x59cb(_0x1f3a32,_0x6eee0c);}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x205);[a23_0x5bde68(0x1e3)]=a23_0x5bde68(0x1bb);async[a23_0x5bde68(0x1b2)](_0x4c4514){const _0x295331=a23_0x5bde68,{options:_0x12cd68,args:_0x1307ec,tdx:_0x19308d}=_0x4c4514,_0x37832f=_0x12cd68;if(_0x1307ec[_0x295331(0x1f5)]<0x2)return console[_0x295331(0x1f2)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x2bfd2d=_0x1307ec[0x0],_0x4554a6=_0x1307ec[0x1];_0x37832f[_0x295331(0x1e1)]&&(console[_0x295331(0x1f2)](_0x295331(0x1b1)+_0x37832f[_0x295331(0x1a8)]),console[_0x295331(0x1f2)](_0x295331(0x1ca)+_0x2bfd2d),console[_0x295331(0x1f2)](_0x295331(0x1e8)+_0x4554a6));let _0x3cc720;if(_0x37832f[_0x295331(0x1c0)]){const _0x3749e2=_0x37832f[_0x295331(0x1c0)],_0x2b4ec0=await withSpinner(_0x295331(0x1a9)+_0x2bfd2d+_0x295331(0x1b7),()=>_0x19308d[_0x295331(0x1af)]['resolveParentId'](_0x2bfd2d),{'verbose':_0x37832f['verbose']}),_0x410157=_0x2b4ec0[_0x295331(0x1d8)],_0xd8cf48=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x3749e2+_0x295331(0x1b7),()=>_0x19308d[_0x295331(0x1af)]['resolveFolderId'](_0x410157,_0x3749e2),{'verbose':_0x37832f['verbose']});_0x3cc720=_0xd8cf48[_0x295331(0x1d8)],_0x37832f[_0x295331(0x1e1)]&&console[_0x295331(0x1f2)](_0x295331(0x1fb)+_0x3cc720);}const _0x594c21={'name':_0x4554a6,'description':_0x37832f[_0x295331(0x1e3)],'parentFolderId':_0x3cc720},_0x366ae0=await withSpinner('Creating\x20folder\x20\x27'+_0x4554a6+_0x295331(0x1b7),()=>_0x19308d[_0x295331(0x1af)][_0x295331(0x1ed)](_0x2bfd2d,_0x594c21),{'verbose':_0x37832f[_0x295331(0x1e1)]}),_0x3917c7=_0x366ae0[_0x295331(0x1d8)];return console[_0x295331(0x1f2)](_0x295331(0x1c2)+_0x3917c7['name']+_0x295331(0x1cf)+_0x3917c7['id']),await handleSDKOutput([_0x3917c7],_0x37832f),0x0;}}
1
+ function a25_0x6f8b(){const _0x475cc4=['error','\x27\x20with\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','SELECT\x20*\x20FROM\x20(\x0a','getParent','Examples:','Resolving\x20parent\x20folder\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','folderId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20show\x20<path>','\x20rows\x20','Error:\x20','cause','4VCaAJM','log','Fetching\x20folder\x20details...','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','name','parentFolder','INTERNAL','Resolving\x20parent\x20segment\x20\x27','segmentPath','getSegment','format','parent','folder','Site:\x20','type','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','getSegmentSQL','4nsDItI','Executing\x20segment\x20query...','\x27...','Parent\x20segment:\x20','execute','length','Show\x20segment\x20folder\x20details','listFolders','resolvePathToResource','trim','Usage:\x20tdx\x20segment\x20sql\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','json','✖\x20Query\x20failed\x20[','segment:folder:list','178407UUqJBb','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20type:\x20','segmentId','4911080kYQcPh','parentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','site','Fetching\x20folder\x20\x27','jobId','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','elapsedTimeMillis','in\x20','✔\x20Found\x20','Creating\x20folder\x20\x27','segment','✔\x20Query\x20completed:\x20Processed\x20','replace','description','Show\x20segment\x20or\x20folder\x20details','Folder\x20ID:\x20','query','507085wQRyXX','21197946YqHZEO','2466600shmbEi','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','jsonl','segment:folder:create','Fetching\x20parent\x20segment\x20details...','verbose','✔\x20Created\x20folder\x20\x27','resolveFolderId','processedRows','message','Fetching\x20SQL\x20for\x20segment...','createFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Path\x20or\x20name\x20is\x20required','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','1031859uMEnZJ','Resolving\x20path\x20\x27','60893YBbIYY','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:describe','248zckXGY','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','includes','getFolder','Resolved\x20relative\x20path\x20to:\x20','code','Usage:\x20tdx\x20segment\x20describe\x20<path>','Parent\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','84dyxcZH','parentSegment','data','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','test','\x20\x20Cause:\x20','Parent\x20ID:\x20','limit','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','information_schema','Resolved\x20parent\x20ID:\x20','getParentSQL','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','resolveParentId','Resolved\x20folder\x20ID:\x20','Resolving\x20folder\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','setJobId'];a25_0x6f8b=function(){return _0x475cc4;};return a25_0x6f8b();}const a25_0x15c124=a25_0x3915;(function(_0x1edfa0,_0x4334d2){const _0x28cd45=a25_0x3915,_0x216b98=_0x1edfa0();while(!![]){try{const _0x42df5b=-parseInt(_0x28cd45(0xcd))/0x1*(-parseInt(_0x28cd45(0x11f))/0x2)+parseInt(_0x28cd45(0xdf))/0x3+-parseInt(_0x28cd45(0x10e))/0x4*(-parseInt(_0x28cd45(0x133))/0x5)+parseInt(_0x28cd45(0xee))/0x6*(-parseInt(_0x28cd45(0xe1))/0x7)+-parseInt(_0x28cd45(0xe4))/0x8*(-parseInt(_0x28cd45(0x12f))/0x9)+-parseInt(_0x28cd45(0xcf))/0xa+-parseInt(_0x28cd45(0xce))/0xb;if(_0x42df5b===_0x4334d2)break;else _0x216b98['push'](_0x216b98['shift']());}catch(_0x2bf282){_0x216b98['push'](_0x216b98['shift']());}}}(a25_0x6f8b,0xa0f78));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a25_0x3915(_0x185223,_0x399166){const _0x6f8b7d=a25_0x6f8b();return a25_0x3915=function(_0x3915ad,_0x5cde36){_0x3915ad=_0x3915ad-0xc5;let _0x158695=_0x6f8b7d[_0x3915ad];return _0x158695;},a25_0x3915(_0x185223,_0x399166);}export class SegmentDescribeCommand extends BaseCommand{[a25_0x15c124(0x112)]=a25_0x15c124(0xe3);[a25_0x15c124(0xc9)]=a25_0x15c124(0xca);async[a25_0x15c124(0x123)](_0x239716){const _0x3dac85=a25_0x15c124,{options:_0x315d08,args:_0xf898f0,tdx:_0x2ec315}=_0x239716,_0x5b9330=_0xf898f0[0x0],_0x548f7c=!_0x5b9330&&!!_0x315d08['parentSegment'],_0x380002=_0x5b9330||_0x315d08[_0x3dac85(0xef)];if(!_0x380002)return console['error'](_0x3dac85(0xdd)),console[_0x3dac85(0x100)](_0x3dac85(0xeb)),console[_0x3dac85(0x100)](_0x3dac85(0x105)),console[_0x3dac85(0x100)](_0x3dac85(0xf1)),console[_0x3dac85(0x100)](_0x3dac85(0xdb)),console[_0x3dac85(0x100)](_0x3dac85(0xed)),console[_0x3dac85(0x100)](_0x3dac85(0x12b)),0x1;try{const _0x3b342e=_0x315d08[_0x3dac85(0x116)];let _0xb1d3af=_0x380002;!_0x548f7c&&_0x3b342e&&!_0x380002[_0x3dac85(0xe7)]('/')&&(_0xb1d3af=_0x3b342e+'/'+_0x380002,_0x315d08[_0x3dac85(0xd4)]&&console[_0x3dac85(0x100)]('Resolved\x20relative\x20path\x20to:\x20'+_0xb1d3af));const _0xbeacd6=await withSpinner(_0x3dac85(0xe0)+_0xb1d3af+_0x3dac85(0x121),()=>_0x2ec315[_0x3dac85(0xc6)][_0x3dac85(0x127)](_0xb1d3af),{'verbose':_0x315d08['verbose']}),_0x50f256=_0xbeacd6[_0x3dac85(0xf0)];_0x315d08[_0x3dac85(0xd4)]&&(console[_0x3dac85(0x100)](_0x3dac85(0x131)+_0x50f256[_0x3dac85(0x11c)]),console['error']('Parent\x20ID:\x20'+_0x50f256['parentId']),_0x50f256['folderId']&&console[_0x3dac85(0x100)](_0x3dac85(0xcb)+_0x50f256[_0x3dac85(0x108)]),_0x50f256[_0x3dac85(0x132)]&&console[_0x3dac85(0x100)]('Segment\x20ID:\x20'+_0x50f256[_0x3dac85(0x132)]));if(_0x50f256[_0x3dac85(0x11c)]==='parent'){const _0x50a450=await withSpinner(_0x3dac85(0xd3),()=>_0x2ec315[_0x3dac85(0xc6)][_0x3dac85(0x104)](_0x50f256[_0x3dac85(0x134)]),{'verbose':_0x315d08[_0x3dac85(0xd4)]});await handleSingleObjectOutput(_0x50a450[_0x3dac85(0xf0)],_0x315d08);}else{if(_0x50f256[_0x3dac85(0x11c)]===_0x3dac85(0x11a)){if(!_0x50f256[_0x3dac85(0x108)])throw new SDKError(ErrorCode[_0x3dac85(0x114)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3e6086=await withSpinner(_0x3dac85(0x110),()=>_0x2ec315[_0x3dac85(0xc6)][_0x3dac85(0xe8)](_0x50f256[_0x3dac85(0x108)]),{'verbose':_0x315d08[_0x3dac85(0xd4)]});await handleSingleObjectOutput(_0x3e6086[_0x3dac85(0xf0)],_0x315d08);}else{if(_0x50f256[_0x3dac85(0x11c)]===_0x3dac85(0xc6)){if(!_0x50f256[_0x3dac85(0x132)])throw new SDKError(ErrorCode[_0x3dac85(0x114)],_0x3dac85(0x102));const _0x3aba0b=await withSpinner('Fetching\x20segment\x20details...',()=>_0x2ec315[_0x3dac85(0xc6)][_0x3dac85(0x117)](_0x50f256['parentId'],_0x50f256[_0x3dac85(0x132)]),{'verbose':_0x315d08[_0x3dac85(0xd4)]});await handleSingleObjectOutput(_0x3aba0b[_0x3dac85(0xf0)],_0x315d08);}}}return 0x0;}catch(_0x7eb1a6){if(_0x7eb1a6 instanceof SDKError)return console[_0x3dac85(0x100)](_0x3dac85(0x10c)+_0x7eb1a6[_0x3dac85(0xd8)]),_0x7eb1a6[_0x3dac85(0x10d)]&&console[_0x3dac85(0x100)](_0x3dac85(0xf3)+_0x7eb1a6[_0x3dac85(0x10d)]),0x1;throw _0x7eb1a6;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a25_0x15c124(0xc9)]='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a25_0x15c124(0x123)](_0x38d1d8){const _0x4e7b1d=a25_0x15c124,{options:_0x233f15,args:_0x28a870,tdx:_0x540aeb}=_0x38d1d8,_0x23ba64=_0x28a870[0x0],_0x20c89a=!_0x23ba64&&!!_0x233f15[_0x4e7b1d(0xef)],_0x287ffb=_0x23ba64||_0x233f15['parentSegment'];if(!_0x287ffb)return console[_0x4e7b1d(0x100)](_0x4e7b1d(0x109)),console[_0x4e7b1d(0x100)](_0x4e7b1d(0x10a)),console[_0x4e7b1d(0x100)](_0x4e7b1d(0x105)),console[_0x4e7b1d(0x100)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x4e7b1d(0x100)](_0x4e7b1d(0xe2)),console[_0x4e7b1d(0x100)](_0x4e7b1d(0x11d)),console[_0x4e7b1d(0x100)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x36d5a3=_0x233f15[_0x4e7b1d(0x116)];let _0x1e9dc4=_0x287ffb;!_0x20c89a&&_0x36d5a3&&!_0x287ffb[_0x4e7b1d(0xe7)]('/')&&(_0x1e9dc4=_0x36d5a3+'/'+_0x287ffb,_0x233f15[_0x4e7b1d(0xd4)]&&console[_0x4e7b1d(0x100)](_0x4e7b1d(0xe9)+_0x1e9dc4));const _0x197d99=await withSpinner(_0x4e7b1d(0xe0)+_0x1e9dc4+_0x4e7b1d(0x121),()=>_0x540aeb['segment'][_0x4e7b1d(0x127)](_0x1e9dc4),{'verbose':_0x233f15['verbose']}),_0xe0b1bb=_0x197d99[_0x4e7b1d(0xf0)];_0x233f15[_0x4e7b1d(0xd4)]&&(console['error'](_0x4e7b1d(0x131)+_0xe0b1bb[_0x4e7b1d(0x11c)]),console['error'](_0x4e7b1d(0xf4)+_0xe0b1bb[_0x4e7b1d(0x134)]));if(_0xe0b1bb[_0x4e7b1d(0x11c)]===_0x4e7b1d(0x11a))return console[_0x4e7b1d(0x100)](_0x4e7b1d(0xfe)),console['error']('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x324610;if(_0xe0b1bb[_0x4e7b1d(0x11c)]===_0x4e7b1d(0x119)){const _0x518dfc=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x540aeb[_0x4e7b1d(0xc6)][_0x4e7b1d(0xf9)](_0xe0b1bb[_0x4e7b1d(0x134)]),{'verbose':_0x233f15[_0x4e7b1d(0xd4)]});_0x324610=_0x518dfc[_0x4e7b1d(0xf0)];}else{if(!_0xe0b1bb[_0x4e7b1d(0x132)])throw new SDKError(ErrorCode[_0x4e7b1d(0x114)],_0x4e7b1d(0x102));const _0x234910=await withSpinner(_0x4e7b1d(0xd9),()=>_0x540aeb[_0x4e7b1d(0xc6)][_0x4e7b1d(0x11e)](_0xe0b1bb[_0x4e7b1d(0x134)],_0xe0b1bb['segmentId']),{'verbose':_0x233f15[_0x4e7b1d(0xd4)]});_0x324610=_0x234910[_0x4e7b1d(0xf0)];}const _0x39f23f=resolveLimit(_0x233f15[_0x4e7b1d(0xf5)],DEFAULT_DISPLAY_LIMIT),_0x4051c4=/\bLIMIT\s+\d+/i[_0x4e7b1d(0xf2)](_0x324610);!_0x4051c4&&(_0x324610=_0x324610[_0x4e7b1d(0x128)]()[_0x4e7b1d(0xc8)](/;+$/,''),_0x324610=_0x4e7b1d(0x103)+_0x324610+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x39f23f);_0x233f15[_0x4e7b1d(0xd4)]&&console['error']('SQL\x20query:\x0a'+_0x324610);const _0x45cd9d=await withQuerySpinner(_0x4e7b1d(0x120),async _0x561463=>{const _0x5b7fac=_0x4e7b1d,_0x40fb20=await _0x540aeb[_0x5b7fac(0xcc)]['execute'](_0x324610,{'catalog':'td','schema':_0x5b7fac(0xf7),'onJobId':_0x1006e9=>{const _0x1f9583=_0x5b7fac;_0x561463[_0x1f9583(0xff)](_0x1006e9);}});return _0x40fb20;},{'verbose':_0x233f15['verbose']}),_0x14897f=_0x45cd9d['data'],_0x429f12=_0x14897f[_0x4e7b1d(0x138)]?'\x20[Job\x20ID:\x20'+_0x14897f['jobId']+']':'';return console[_0x4e7b1d(0x100)](_0x4e7b1d(0xc7)+_0x14897f['stats'][_0x4e7b1d(0xd7)]['toLocaleString']()+_0x4e7b1d(0x10b)+(_0x4e7b1d(0x13b)+formatElapsed(_0x14897f['stats'][_0x4e7b1d(0x13a)])+_0x429f12)),await handleQueryOutput(_0x14897f,_0x233f15),0x0;}catch(_0x564381){if(_0x564381 instanceof SDKError)return console[_0x4e7b1d(0x100)](_0x4e7b1d(0x12d)+_0x564381[_0x4e7b1d(0xea)]+']'),console[_0x4e7b1d(0x100)]('\x0a'+_0x564381['message']),0x1;throw _0x564381;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x15c124(0x112)]=a25_0x15c124(0x12e);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a25_0x15c124(0x123)](_0x579ac5){const _0x5393a6=a25_0x15c124,{options:_0x60c820,args:_0x4a5820,tdx:_0x37dfba}=_0x579ac5;if(_0x4a5820[_0x5393a6(0x124)]===0x0)return console[_0x5393a6(0x100)](_0x5393a6(0x135)),console['error'](_0x5393a6(0x12a)),0x1;const _0x3ab948=_0x4a5820[0x0];try{_0x60c820['verbose']&&(console['error'](_0x5393a6(0x11b)+_0x60c820['site']),console[_0x5393a6(0x100)](_0x5393a6(0xec)+_0x3ab948));const _0x32520c=await withSpinner(_0x5393a6(0x115)+_0x3ab948+_0x5393a6(0x121),()=>_0x37dfba['segment'][_0x5393a6(0xfb)](_0x3ab948),{'verbose':_0x60c820[_0x5393a6(0xd4)]}),_0x3ca0a4=_0x32520c[_0x5393a6(0xf0)];_0x60c820[_0x5393a6(0xd4)]&&console[_0x5393a6(0x100)](_0x5393a6(0xf8)+_0x3ca0a4);const _0x14189a=await withSpinner(_0x5393a6(0x107)+_0x3ab948+_0x5393a6(0x121),()=>_0x37dfba['segment'][_0x5393a6(0x126)](_0x3ca0a4),{'verbose':_0x60c820[_0x5393a6(0xd4)]}),_0x301d0d=_0x14189a[_0x5393a6(0xf0)];return console[_0x5393a6(0x100)](_0x5393a6(0x13c)+_0x301d0d[_0x5393a6(0x124)]+'\x20folder'+(_0x301d0d[_0x5393a6(0x124)]!==0x1?'s':'')),await handleSDKOutput(_0x301d0d,_0x60c820),0x0;}catch(_0x3e1331){if(_0x3e1331 instanceof SDKError)return console['error'](_0x5393a6(0x10c)+_0x3e1331[_0x5393a6(0xd8)]),_0x3e1331[_0x5393a6(0x10d)]&&console['error'](_0x5393a6(0xf3)+_0x3e1331[_0x5393a6(0x10d)]),0x1;throw _0x3e1331;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x15c124(0x112)]='segment:folder:show';['description']=a25_0x15c124(0x125);async[a25_0x15c124(0x123)](_0x4d659e){const _0x223219=a25_0x15c124,{options:_0x54352b,args:_0x110592,tdx:_0x3a3941}=_0x4d659e;if(_0x110592[_0x223219(0x124)]===0x0)return console[_0x223219(0x100)](_0x223219(0x130)),console[_0x223219(0x100)](_0x223219(0xf6)),0x1;try{const {parentId:_0x59ae7c,childId:_0xfecd51}=parseSegmentRef(_0x110592[0x0]);_0x54352b[_0x223219(0xd4)]&&(console[_0x223219(0x100)]('Site:\x20'+_0x54352b[_0x223219(0x136)]),console['error'](_0x223219(0xec)+_0x59ae7c),_0xfecd51&&console[_0x223219(0x100)]('Folder\x20name:\x20'+_0xfecd51));if(!_0xfecd51)return console[_0x223219(0x100)](_0x223219(0x111)),0x1;const _0x1e3aa9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x59ae7c+'\x27...',()=>_0x3a3941[_0x223219(0xc6)][_0x223219(0xfb)](_0x59ae7c),{'verbose':_0x54352b[_0x223219(0xd4)]}),_0x539f96=_0x1e3aa9[_0x223219(0xf0)];_0x54352b[_0x223219(0xd4)]&&console[_0x223219(0x100)](_0x223219(0xf8)+_0x539f96);const _0x147a71=await withSpinner(_0x223219(0xfd)+_0xfecd51+_0x223219(0x121),()=>_0x3a3941['segment'][_0x223219(0xd6)](_0x539f96,_0xfecd51),{'verbose':_0x54352b[_0x223219(0xd4)]}),_0x234923=_0x147a71['data'];_0x54352b[_0x223219(0xd4)]&&console[_0x223219(0x100)](_0x223219(0xfc)+_0x234923);const _0xa87699=await withSpinner(_0x223219(0x137)+_0xfecd51+_0x223219(0x121),()=>_0x3a3941[_0x223219(0xc6)][_0x223219(0xe8)](_0x234923),{'verbose':_0x54352b[_0x223219(0xd4)]});return await handleSDKOutput([_0xa87699[_0x223219(0xf0)]],_0x54352b),0x0;}catch(_0x393ed0){if(_0x393ed0 instanceof SDKError)return console['error']('Error:\x20'+_0x393ed0[_0x223219(0xd8)]),_0x393ed0[_0x223219(0x10d)]&&console['error'](_0x223219(0xf3)+_0x393ed0[_0x223219(0x10d)]),0x1;throw _0x393ed0;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x15c124(0x112)]='segment:sql';[a25_0x15c124(0xc9)]=a25_0x15c124(0xe5);async[a25_0x15c124(0x123)](_0x1db591){const _0x5d5c89=a25_0x15c124,{options:_0x11de56,args:_0x273500,tdx:_0x240785}=_0x1db591,_0x1575b7=_0x273500[0x0],_0x1c5001=!_0x1575b7&&!!_0x11de56[_0x5d5c89(0xef)],_0x392b42=_0x1575b7||_0x11de56[_0x5d5c89(0xef)];if(!_0x392b42)return console[_0x5d5c89(0x100)](_0x5d5c89(0x109)),console[_0x5d5c89(0x100)](_0x5d5c89(0x129)),console[_0x5d5c89(0x100)](_0x5d5c89(0x105)),console[_0x5d5c89(0x100)](_0x5d5c89(0xe6)),console[_0x5d5c89(0x100)](_0x5d5c89(0x139)),console[_0x5d5c89(0x100)](_0x5d5c89(0xd0)),console[_0x5d5c89(0x100)](_0x5d5c89(0x12b)),0x1;try{const _0x4715d5=_0x11de56[_0x5d5c89(0x116)];let _0x4718e6=_0x392b42;!_0x1c5001&&_0x4715d5&&!_0x392b42['includes']('/')&&(_0x4718e6=_0x4715d5+'/'+_0x392b42,_0x11de56['verbose']&&console[_0x5d5c89(0x100)](_0x5d5c89(0xe9)+_0x4718e6));const _0x75663b=await withSpinner(_0x5d5c89(0xe0)+_0x4718e6+_0x5d5c89(0x121),()=>_0x240785['segment'][_0x5d5c89(0x127)](_0x4718e6),{'verbose':_0x11de56[_0x5d5c89(0xd4)]}),_0x44198f=_0x75663b['data'];_0x11de56['verbose']&&(console[_0x5d5c89(0x100)](_0x5d5c89(0x131)+_0x44198f[_0x5d5c89(0x11c)]),console[_0x5d5c89(0x100)]('Parent\x20ID:\x20'+_0x44198f[_0x5d5c89(0x134)]));if(_0x44198f['type']===_0x5d5c89(0x11a))return console['error'](_0x5d5c89(0xdc)),console[_0x5d5c89(0x100)](_0x5d5c89(0xde)),0x1;let _0x3dfece;if(_0x44198f[_0x5d5c89(0x11c)]===_0x5d5c89(0x119)){const _0x3acb69=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x240785['segment'][_0x5d5c89(0xf9)](_0x44198f['parentId']),{'verbose':_0x11de56['verbose']});_0x3dfece=_0x3acb69['data'];}else{if(!_0x44198f[_0x5d5c89(0x132)])throw new SDKError(ErrorCode['INTERNAL'],_0x5d5c89(0x102));const _0x5e2894=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x240785[_0x5d5c89(0xc6)][_0x5d5c89(0x11e)](_0x44198f[_0x5d5c89(0x134)],_0x44198f[_0x5d5c89(0x132)]),{'verbose':_0x11de56[_0x5d5c89(0xd4)]});_0x3dfece=_0x5e2894[_0x5d5c89(0xf0)];}return _0x11de56[_0x5d5c89(0x118)]===_0x5d5c89(0x12c)||_0x11de56[_0x5d5c89(0x118)]===_0x5d5c89(0xd1)?await handleSDKOutput([{'sql':_0x3dfece}],_0x11de56):console[_0x5d5c89(0x10f)](_0x3dfece),0x0;}catch(_0x9b1e02){if(_0x9b1e02 instanceof SDKError)return console[_0x5d5c89(0x100)](_0x5d5c89(0x10c)+_0x9b1e02[_0x5d5c89(0xd8)]),_0x9b1e02['cause']&&console[_0x5d5c89(0x100)]('\x20\x20Cause:\x20'+_0x9b1e02[_0x5d5c89(0x10d)]),0x1;throw _0x9b1e02;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x15c124(0x112)]=a25_0x15c124(0xd2);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x15c124(0x123)](_0x292458){const _0x4f9487=a25_0x15c124,{options:_0x302cfa,args:_0x473409,tdx:_0x2108fe}=_0x292458,_0x8b89f9=_0x302cfa;if(_0x473409[_0x4f9487(0x124)]<0x2)return console[_0x4f9487(0x100)](_0x4f9487(0xfa)),console[_0x4f9487(0x100)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x36ab76=_0x473409[0x0],_0x19be06=_0x473409[0x1];_0x8b89f9[_0x4f9487(0xd4)]&&(console[_0x4f9487(0x100)](_0x4f9487(0x11b)+_0x8b89f9[_0x4f9487(0x136)]),console[_0x4f9487(0x100)](_0x4f9487(0x122)+_0x36ab76),console['error']('Folder\x20name:\x20'+_0x19be06));let _0x2eefc4;if(_0x8b89f9['parentFolder']){const _0x34c054=_0x8b89f9[_0x4f9487(0x113)],_0x539e2e=await withSpinner(_0x4f9487(0x115)+_0x36ab76+_0x4f9487(0x121),()=>_0x2108fe[_0x4f9487(0xc6)]['resolveParentId'](_0x36ab76),{'verbose':_0x8b89f9[_0x4f9487(0xd4)]}),_0x2480f0=_0x539e2e[_0x4f9487(0xf0)],_0x4ba96a=await withSpinner(_0x4f9487(0x106)+_0x34c054+_0x4f9487(0x121),()=>_0x2108fe[_0x4f9487(0xc6)][_0x4f9487(0xd6)](_0x2480f0,_0x34c054),{'verbose':_0x8b89f9[_0x4f9487(0xd4)]});_0x2eefc4=_0x4ba96a['data'],_0x8b89f9[_0x4f9487(0xd4)]&&console[_0x4f9487(0x100)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x2eefc4);}const _0x14605b={'name':_0x19be06,'description':_0x8b89f9[_0x4f9487(0xc9)],'parentFolderId':_0x2eefc4},_0x32126b=await withSpinner(_0x4f9487(0xc5)+_0x19be06+_0x4f9487(0x121),()=>_0x2108fe[_0x4f9487(0xc6)][_0x4f9487(0xda)](_0x36ab76,_0x14605b),{'verbose':_0x8b89f9['verbose']}),_0x2e8de0=_0x32126b[_0x4f9487(0xf0)];return console[_0x4f9487(0x100)](_0x4f9487(0xd5)+_0x2e8de0[_0x4f9487(0x112)]+_0x4f9487(0x101)+_0x2e8de0['id']),await handleSDKOutput([_0x2e8de0],_0x8b89f9),0x0;}}
@@ -1 +1 @@
1
- const a24_0x39026f=a24_0x3924;(function(_0xac719d,_0xab3466){const _0x6e32ac=a24_0x3924,_0x43fc98=_0xac719d();while(!![]){try{const _0x482103=-parseInt(_0x6e32ac(0x15a))/0x1+-parseInt(_0x6e32ac(0x170))/0x2*(parseInt(_0x6e32ac(0x187))/0x3)+parseInt(_0x6e32ac(0x161))/0x4+-parseInt(_0x6e32ac(0x17c))/0x5+-parseInt(_0x6e32ac(0x15f))/0x6*(-parseInt(_0x6e32ac(0x177))/0x7)+parseInt(_0x6e32ac(0x181))/0x8*(-parseInt(_0x6e32ac(0x17d))/0x9)+-parseInt(_0x6e32ac(0x16e))/0xa*(-parseInt(_0x6e32ac(0x183))/0xb);if(_0x482103===_0xab3466)break;else _0x43fc98['push'](_0x43fc98['shift']());}catch(_0x308c37){_0x43fc98['push'](_0x43fc98['shift']());}}}(a24_0x8107,0x6bbc7));function a24_0x3924(_0x5e5fb3,_0x2e81db){const _0x810753=a24_0x8107();return a24_0x3924=function(_0x3924c5,_0x3afd43){_0x3924c5=_0x3924c5-0x15a;let _0x1114ae=_0x810753[_0x3924c5];return _0x1114ae;},a24_0x3924(_0x5e5fb3,_0x2e81db);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a24_0x8107(){const _0x48700b=['Parent\x20path:\x20','45660RyTqbj','\x20\x20\x20Path:\x20','1306732lBTHMd','site','Parent:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','folder','noCountPopulation','data','\x27...','type','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Site:\x20','610860UqtfKA','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','3316PPnFBo','verbose','Segment\x20name:\x20','\x27\x20with\x20ID:\x20','folderId','segments','Resolving\x20folder\x20\x27','35pZIoUY','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','ruleFile','error','Resolving\x20parent\x20segment\x20\x27','3263515psQFCa','45ttgOyP','invisible','name','resolveParentId','134560uDEwVp','segment:create','231khYXJo','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','resolveFolderId','length','288FkYzzw','segment','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','310281OuzYfF','kind','Creating\x20segment\x20\x27','description'];a24_0x8107=function(){return _0x48700b;};return a24_0x8107();}export class SegmentCreateCommand extends BaseCommand{[a24_0x39026f(0x17f)]=a24_0x39026f(0x182);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x5d16cc){const _0x532881=a24_0x39026f,{options:_0x3c7b65,args:_0x51a72f,tdx:_0x235a33}=_0x5d16cc,_0x279338=_0x3c7b65;if(_0x51a72f[_0x532881(0x186)]===0x0)return console['error'](_0x532881(0x164)),console[_0x532881(0x17a)](_0x532881(0x184)),console[_0x532881(0x17a)]('Examples:'),console[_0x532881(0x17a)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x532881(0x17a)](_0x532881(0x16c)),console[_0x532881(0x17a)](_0x532881(0x189)),0x1;const _0x2119e6=_0x51a72f[0x0],_0x22f067=_0x3c7b65['segmentPath'];let _0xb48b10=_0x2119e6;_0x22f067&&!_0x2119e6['includes']('/')&&(_0xb48b10=_0x22f067+'/'+_0x2119e6,_0x279338[_0x532881(0x171)]&&console[_0x532881(0x17a)]('Resolved\x20relative\x20path\x20to:\x20'+_0xb48b10));const _0x407350=parsePath(_0xb48b10);if(_0x407350[_0x532881(0x175)][_0x532881(0x186)]<0x2)return console[_0x532881(0x17a)](_0x532881(0x16f)),console[_0x532881(0x17a)](_0x532881(0x16b)),0x1;const _0x1e9048=_0x407350['segments'][0x0],_0x17e1d0=getBaseName(_0xb48b10),_0x2339db=getParentPath(_0xb48b10);_0x279338['verbose']&&(console['error'](_0x532881(0x16d)+_0x279338[_0x532881(0x162)]),console[_0x532881(0x17a)]('Target\x20path:\x20'+_0xb48b10),console[_0x532881(0x17a)](_0x532881(0x163)+_0x1e9048),console[_0x532881(0x17a)](_0x532881(0x172)+_0x17e1d0),console['error'](_0x532881(0x15e)+_0x2339db));const _0x1ba771=await withSpinner(_0x532881(0x17b)+_0x1e9048+'\x27...',()=>_0x235a33[_0x532881(0x188)][_0x532881(0x180)](_0x1e9048),{'verbose':_0x279338[_0x532881(0x171)]}),_0x3adf59=_0x1ba771[_0x532881(0x168)];let _0x5a12c8;if(_0x407350['segments'][_0x532881(0x186)]>0x2){const _0x3f06e1=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x2339db+_0x532881(0x169),()=>_0x235a33[_0x532881(0x188)]['resolvePathToResource'](_0x2339db),{'verbose':_0x279338[_0x532881(0x171)]}),_0x3fb819=_0x3f06e1['data'];if(_0x3fb819['type']!==_0x532881(0x166)&&_0x3fb819[_0x532881(0x16a)]!=='parent')return console[_0x532881(0x17a)](_0x532881(0x178)),0x1;_0x5a12c8=_0x3fb819[_0x532881(0x174)];}else{if(_0x279338['folder']){const _0x3d7518=await withSpinner(_0x532881(0x176)+_0x279338[_0x532881(0x166)]+'\x27...',()=>_0x235a33[_0x532881(0x188)][_0x532881(0x185)](_0x3adf59,_0x279338[_0x532881(0x166)]),{'verbose':_0x279338['verbose']});_0x5a12c8=_0x3d7518[_0x532881(0x168)];}}_0x279338['verbose']&&_0x5a12c8&&console[_0x532881(0x17a)](_0x532881(0x165)+_0x5a12c8);const _0x1cb41e=await loadJSONFromOptions(_0x279338['rule'],_0x279338[_0x532881(0x179)]),_0x39ba96={'name':_0x17e1d0,'description':_0x279338[_0x532881(0x15d)],'rule':_0x1cb41e,'kind':_0x279338['kind']!==undefined?parseInt(_0x279338[_0x532881(0x15b)],0xa):undefined,'isVisible':_0x279338[_0x532881(0x17e)]?![]:undefined,'segmentFolderId':_0x5a12c8,'countPopulation':_0x279338[_0x532881(0x167)]?![]:undefined},_0xe5a8b1=await withSpinner(_0x532881(0x15c)+_0x17e1d0+'\x27...',()=>_0x235a33['segment']['createSegment'](_0x3adf59,_0x39ba96),{'verbose':_0x279338[_0x532881(0x171)]}),_0x460cd7=_0xe5a8b1[_0x532881(0x168)];return console[_0x532881(0x17a)]('✔\x20Created\x20segment\x20\x27'+_0x460cd7[_0x532881(0x17f)]+_0x532881(0x173)+_0x460cd7['id']),_0xb48b10!==_0x2119e6&&console[_0x532881(0x17a)](_0x532881(0x160)+_0xb48b10),await handleSDKOutput([_0x460cd7],_0x279338),0x0;}}
1
+ const a26_0x30ce8d=a26_0x5d6d;(function(_0x52b78f,_0x4dcb34){const _0xf24e76=a26_0x5d6d,_0x27ed35=_0x52b78f();while(!![]){try{const _0x17f71b=-parseInt(_0xf24e76(0xb7))/0x1*(parseInt(_0xf24e76(0xc3))/0x2)+parseInt(_0xf24e76(0xb8))/0x3+parseInt(_0xf24e76(0xca))/0x4+-parseInt(_0xf24e76(0xb1))/0x5*(-parseInt(_0xf24e76(0xdb))/0x6)+parseInt(_0xf24e76(0xdd))/0x7+-parseInt(_0xf24e76(0xb5))/0x8*(parseInt(_0xf24e76(0xdc))/0x9)+-parseInt(_0xf24e76(0xcf))/0xa;if(_0x17f71b===_0x4dcb34)break;else _0x27ed35['push'](_0x27ed35['shift']());}catch(_0x18d6f4){_0x27ed35['push'](_0x27ed35['shift']());}}}(a26_0x5395,0xb8c11));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a26_0x5d6d(_0x43d277,_0x32af43){const _0x5395d7=a26_0x5395();return a26_0x5d6d=function(_0x5d6df1,_0x446a0a){_0x5d6df1=_0x5d6df1-0xac;let _0x374b0f=_0x5395d7[_0x5d6df1];return _0x374b0f;},a26_0x5d6d(_0x43d277,_0x32af43);}import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x5395(){const _0x6fc99f=['1564192whYqvE','type','Resolved\x20relative\x20path\x20to:\x20','invisible','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','createSegment','5xHVrFU','includes','segment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1601528WReLls','error','99xvvzuF','3861225HAqgOn','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','kind','✔\x20Created\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','site','folder','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','name','\x27\x20with\x20ID:\x20','13132wJaFOl','Parent:\x20','description','\x27...','Resolving\x20folder\x20path\x20\x27','noCountPopulation','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','3675372DlTmal','Target\x20path:\x20','folderId','verbose','segmentPath','14109360vzBtEe','length','Segment\x20name:\x20','segment:create','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','parent','Site:\x20','segments','Resolving\x20folder\x20\x27','\x20\x20\x20Path:\x20','Examples:','4732386dqLcoB','18rfdBIS'];a26_0x5395=function(){return _0x6fc99f;};return a26_0x5395();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a26_0x30ce8d(0xc1)]=a26_0x30ce8d(0xd2);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a26_0x30ce8d(0xaf)](_0x1e0a21){const _0x8bf6b=a26_0x30ce8d,{options:_0x59a94f,args:_0x49f1a3,tdx:_0xe8c863}=_0x1e0a21,_0x532d60=_0x59a94f;if(_0x49f1a3[_0x8bf6b(0xd0)]===0x0)return console[_0x8bf6b(0xb6)](_0x8bf6b(0xae)),console['error'](_0x8bf6b(0xb4)),console[_0x8bf6b(0xb6)](_0x8bf6b(0xda)),console[_0x8bf6b(0xb6)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x8bf6b(0xb6)](_0x8bf6b(0xba)),console[_0x8bf6b(0xb6)](_0x8bf6b(0xc9)),0x1;const _0x469bed=_0x49f1a3[0x0],_0x431527=_0x59a94f[_0x8bf6b(0xce)];let _0x275cae=_0x469bed;_0x431527&&!_0x469bed[_0x8bf6b(0xb2)]('/')&&(_0x275cae=_0x431527+'/'+_0x469bed,_0x532d60[_0x8bf6b(0xcd)]&&console[_0x8bf6b(0xb6)](_0x8bf6b(0xac)+_0x275cae));const _0x22a24b=parsePath(_0x275cae);if(_0x22a24b[_0x8bf6b(0xd7)][_0x8bf6b(0xd0)]<0x2)return console[_0x8bf6b(0xb6)](_0x8bf6b(0xc0)),console['error'](_0x8bf6b(0xd3)),0x1;const _0x4970c1=_0x22a24b[_0x8bf6b(0xd7)][0x0],_0x592bc8=getBaseName(_0x275cae),_0x50d62e=getParentPath(_0x275cae);_0x532d60[_0x8bf6b(0xcd)]&&(console[_0x8bf6b(0xb6)](_0x8bf6b(0xd6)+_0x532d60[_0x8bf6b(0xbe)]),console[_0x8bf6b(0xb6)](_0x8bf6b(0xcb)+_0x275cae),console[_0x8bf6b(0xb6)](_0x8bf6b(0xc4)+_0x4970c1),console[_0x8bf6b(0xb6)](_0x8bf6b(0xd1)+_0x592bc8),console[_0x8bf6b(0xb6)]('Parent\x20path:\x20'+_0x50d62e));const _0x377b31=await withSpinner(_0x8bf6b(0xbd)+_0x4970c1+_0x8bf6b(0xc6),()=>_0xe8c863[_0x8bf6b(0xb3)]['resolveParentId'](_0x4970c1),{'verbose':_0x532d60['verbose']}),_0x537dd0=_0x377b31['data'];let _0x5e2673;if(_0x22a24b[_0x8bf6b(0xd7)][_0x8bf6b(0xd0)]>0x2){const _0x359ad8=await withSpinner(_0x8bf6b(0xc7)+_0x50d62e+_0x8bf6b(0xc6),()=>_0xe8c863[_0x8bf6b(0xb3)]['resolvePathToResource'](_0x50d62e),{'verbose':_0x532d60[_0x8bf6b(0xcd)]}),_0x4b71a8=_0x359ad8[_0x8bf6b(0xd4)];if(_0x4b71a8[_0x8bf6b(0xde)]!==_0x8bf6b(0xbf)&&_0x4b71a8[_0x8bf6b(0xde)]!==_0x8bf6b(0xd5))return console[_0x8bf6b(0xb6)](_0x8bf6b(0xb9)),0x1;_0x5e2673=_0x4b71a8[_0x8bf6b(0xcc)];}else{if(_0x532d60[_0x8bf6b(0xbf)]){const _0x1d2bb7=await withSpinner(_0x8bf6b(0xd8)+_0x532d60[_0x8bf6b(0xbf)]+_0x8bf6b(0xc6),()=>_0xe8c863[_0x8bf6b(0xb3)]['resolveFolderId'](_0x537dd0,_0x532d60[_0x8bf6b(0xbf)]),{'verbose':_0x532d60[_0x8bf6b(0xcd)]});_0x5e2673=_0x1d2bb7[_0x8bf6b(0xd4)];}}_0x532d60[_0x8bf6b(0xcd)]&&_0x5e2673&&console[_0x8bf6b(0xb6)]('Resolved\x20folder\x20ID:\x20'+_0x5e2673);const _0x23271b=await loadJSONFromOptions(_0x532d60['rule'],_0x532d60['ruleFile']),_0x53f600={'name':_0x592bc8,'description':_0x532d60[_0x8bf6b(0xc5)],'rule':_0x23271b,'kind':_0x532d60[_0x8bf6b(0xbb)]!==undefined?parseInt(_0x532d60[_0x8bf6b(0xbb)],0xa):undefined,'isVisible':_0x532d60[_0x8bf6b(0xad)]?![]:undefined,'segmentFolderId':_0x5e2673,'countPopulation':_0x532d60[_0x8bf6b(0xc8)]?![]:undefined},_0xb0256a=await withSpinner('Creating\x20segment\x20\x27'+_0x592bc8+_0x8bf6b(0xc6),()=>_0xe8c863[_0x8bf6b(0xb3)][_0x8bf6b(0xb0)](_0x537dd0,_0x53f600),{'verbose':_0x532d60['verbose']}),_0x188325=_0xb0256a[_0x8bf6b(0xd4)];return console[_0x8bf6b(0xb6)](_0x8bf6b(0xbc)+_0x188325[_0x8bf6b(0xc1)]+_0x8bf6b(0xc2)+_0x188325['id']),_0x275cae!==_0x469bed&&console[_0x8bf6b(0xb6)](_0x8bf6b(0xd9)+_0x275cae),await handleSDKOutput([_0x188325],_0x532d60),0x0;}}
@@ -1 +1 @@
1
- function a25_0x10b3(_0x13b197,_0x3744b5){const _0x176eff=a25_0x176e();return a25_0x10b3=function(_0x10b36b,_0x2a5e94){_0x10b36b=_0x10b36b-0x189;let _0x15561f=_0x176eff[_0x10b36b];return _0x15561f;},a25_0x10b3(_0x13b197,_0x3744b5);}const a25_0xb97ffd=a25_0x10b3;(function(_0x187dbb,_0x5008a8){const _0x24699d=a25_0x10b3,_0x39a604=_0x187dbb();while(!![]){try{const _0x48a188=parseInt(_0x24699d(0x18d))/0x1+-parseInt(_0x24699d(0x199))/0x2*(parseInt(_0x24699d(0x197))/0x3)+parseInt(_0x24699d(0x1a1))/0x4+-parseInt(_0x24699d(0x18c))/0x5+parseInt(_0x24699d(0x1a4))/0x6*(-parseInt(_0x24699d(0x1a7))/0x7)+-parseInt(_0x24699d(0x189))/0x8+-parseInt(_0x24699d(0x194))/0x9*(-parseInt(_0x24699d(0x190))/0xa);if(_0x48a188===_0x5008a8)break;else _0x39a604['push'](_0x39a604['shift']());}catch(_0x40a73c){_0x39a604['push'](_0x39a604['shift']());}}}(a25_0x176e,0xb1ac2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a25_0x176e(){const _0x40186a=['execute','length','1479770GXfKiI','verbose','✔\x20Found\x20','segment','9LeUncq','data','\x20field','3KxWmcX','Site:\x20','1792542XaNHyf','\x27...','error','site','listFields','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','segment:fields','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','5452344sRocFM','List\x20available\x20fields\x20for\x20segmentation','description','3784020gggLcF','Listing\x20fields\x20for\x20\x27','parentSegment','7kDhbXX','242992ZHJWow','Error:\x20Parent\x20segment\x20name\x20is\x20required','name','389725ZoXaMF','851943kKCXqG'];a25_0x176e=function(){return _0x40186a;};return a25_0x176e();}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a25_0xb97ffd(0x18b)]=a25_0xb97ffd(0x19f);[a25_0xb97ffd(0x1a3)]=a25_0xb97ffd(0x1a2);async[a25_0xb97ffd(0x18e)](_0x5b76e9){const _0x584f6a=a25_0xb97ffd,{options:_0xb5f8be,args:_0x5ac79f,tdx:_0x1d3da5}=_0x5b76e9,_0x3a7384=_0x5ac79f[0x0]||_0xb5f8be[_0x584f6a(0x1a6)];if(!_0x3a7384)return console['error'](_0x584f6a(0x18a)),console['error'](_0x584f6a(0x19e)),console[_0x584f6a(0x19b)](_0x584f6a(0x1a0)),0x1;_0xb5f8be[_0x584f6a(0x191)]&&(console[_0x584f6a(0x19b)](_0x584f6a(0x198)+_0xb5f8be[_0x584f6a(0x19c)]),console['error']('Parent\x20segment:\x20'+_0x3a7384));const _0x54ebbd=await withSpinner(_0x584f6a(0x1a5)+_0x3a7384+_0x584f6a(0x19a),()=>_0x1d3da5[_0x584f6a(0x193)][_0x584f6a(0x19d)](_0x3a7384),{'verbose':_0xb5f8be['verbose']}),_0xc6c047=_0x54ebbd[_0x584f6a(0x195)];return console[_0x584f6a(0x19b)](_0x584f6a(0x192)+_0xc6c047[_0x584f6a(0x18f)]+_0x584f6a(0x196)+(_0xc6c047['length']!==0x1?'s':'')),await handleSDKOutput(_0xc6c047,_0xb5f8be),0x0;}}
1
+ function a27_0xa3e3(){const _0x3c7810=['50RGdrwi','✔\x20Found\x20','data','Error:\x20Parent\x20segment\x20name\x20is\x20required','5717880CBkIWc','68cnhyAV','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','8dxYddn','parentSegment','454uTDMLk','name','Listing\x20fields\x20for\x20\x27','1035083sHWHpF','description','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','listFields','segment','328818idVYPi','List\x20available\x20fields\x20for\x20segmentation','error','27564OQeVWW','1166eulwIf','\x20field','verbose','133890NoQfIq','2129xxyhQr','12835251UeUyBQ','length'];a27_0xa3e3=function(){return _0x3c7810;};return a27_0xa3e3();}const a27_0x5a8095=a27_0x3bff;(function(_0x2632be,_0x70e19a){const _0x843b7c=a27_0x3bff,_0x5adb9d=_0x2632be();while(!![]){try{const _0x49f5eb=parseInt(_0x843b7c(0x198))/0x1*(parseInt(_0x843b7c(0x1a5))/0x2)+parseInt(_0x843b7c(0x1b4))/0x3*(-parseInt(_0x843b7c(0x1a0))/0x4)+-parseInt(_0x843b7c(0x19b))/0x5*(-parseInt(_0x843b7c(0x1ad))/0x6)+parseInt(_0x843b7c(0x1a8))/0x7*(-parseInt(_0x843b7c(0x1a3))/0x8)+parseInt(_0x843b7c(0x199))/0x9+-parseInt(_0x843b7c(0x19f))/0xa+-parseInt(_0x843b7c(0x1b1))/0xb*(parseInt(_0x843b7c(0x1b0))/0xc);if(_0x49f5eb===_0x70e19a)break;else _0x5adb9d['push'](_0x5adb9d['shift']());}catch(_0x2b3524){_0x5adb9d['push'](_0x5adb9d['shift']());}}}(a27_0xa3e3,0xb3973));function a27_0x3bff(_0x45f764,_0xa03f33){const _0xa3e3e=a27_0xa3e3();return a27_0x3bff=function(_0x3bff67,_0x2737a4){_0x3bff67=_0x3bff67-0x198;let _0x5878f3=_0xa3e3e[_0x3bff67];return _0x5878f3;},a27_0x3bff(_0x45f764,_0xa03f33);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x5a8095(0x1a6)]='segment:fields';[a27_0x5a8095(0x1a9)]=a27_0x5a8095(0x1ae);async['execute'](_0x5e7e2f){const _0x5f19af=a27_0x5a8095,{options:_0x2d08c1,args:_0x21bcae,tdx:_0x10f6e0}=_0x5e7e2f,_0x5a688c=_0x21bcae[0x0]||_0x2d08c1[_0x5f19af(0x1a4)];if(!_0x5a688c)return console[_0x5f19af(0x1af)](_0x5f19af(0x19e)),console[_0x5f19af(0x1af)](_0x5f19af(0x1a2)),console[_0x5f19af(0x1af)](_0x5f19af(0x1aa)),0x1;_0x2d08c1[_0x5f19af(0x1b3)]&&(console[_0x5f19af(0x1af)]('Site:\x20'+_0x2d08c1['site']),console[_0x5f19af(0x1af)](_0x5f19af(0x1a1)+_0x5a688c));const _0x1fbd88=await withSpinner(_0x5f19af(0x1a7)+_0x5a688c+'\x27...',()=>_0x10f6e0[_0x5f19af(0x1ac)][_0x5f19af(0x1ab)](_0x5a688c),{'verbose':_0x2d08c1[_0x5f19af(0x1b3)]}),_0x496f55=_0x1fbd88[_0x5f19af(0x19d)];return console[_0x5f19af(0x1af)](_0x5f19af(0x19c)+_0x496f55['length']+_0x5f19af(0x1b2)+(_0x496f55[_0x5f19af(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x496f55,_0x2d08c1),0x0;}}
@@ -1 +1 @@
1
- const a26_0x2db883=a26_0x28cb;(function(_0x50d1b1,_0xb8e3b8){const _0x4f90c5=a26_0x28cb,_0x3a8565=_0x50d1b1();while(!![]){try{const _0x37b64e=-parseInt(_0x4f90c5(0xc8))/0x1*(parseInt(_0x4f90c5(0xce))/0x2)+parseInt(_0x4f90c5(0xcb))/0x3+-parseInt(_0x4f90c5(0xd7))/0x4*(parseInt(_0x4f90c5(0xd0))/0x5)+parseInt(_0x4f90c5(0xde))/0x6+-parseInt(_0x4f90c5(0xda))/0x7*(-parseInt(_0x4f90c5(0xdc))/0x8)+-parseInt(_0x4f90c5(0xdd))/0x9+-parseInt(_0x4f90c5(0xd6))/0xa*(-parseInt(_0x4f90c5(0xcc))/0xb);if(_0x37b64e===_0xb8e3b8)break;else _0x3a8565['push'](_0x3a8565['shift']());}catch(_0x490b30){_0x3a8565['push'](_0x3a8565['shift']());}}}(a26_0x1a02,0x4a46f));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a26_0x2db883(0xd3)]=a26_0x2db883(0xdb);[a26_0x2db883(0xd1)]=a26_0x2db883(0xca);async[a26_0x2db883(0xc9)](_0x234f76){const _0x57afc0=a26_0x2db883,{options:_0x8a373f}=_0x234f76;try{const _0x33252b=_0x8a373f[_0x57afc0(0xd5)];if(!_0x33252b)return _0x8a373f[_0x57afc0(0xd2)]===_0x57afc0(0xcd)||_0x8a373f[_0x57afc0(0xd2)]===_0x57afc0(0xd9)?console[_0x57afc0(0xd8)](JSON[_0x57afc0(0xd4)]({'path':'/','type':'root'})):console[_0x57afc0(0xd8)]('/'),0x0;if(_0x8a373f['format']===_0x57afc0(0xcd)||_0x8a373f[_0x57afc0(0xd2)]==='jsonl'){const _0x5af748={'path':_0x33252b};console[_0x57afc0(0xd8)](JSON[_0x57afc0(0xd4)](_0x5af748));}else console[_0x57afc0(0xd8)](_0x33252b),_0x8a373f['verbose']&&(console[_0x57afc0(0xc7)](''),console['error'](_0x57afc0(0xcf)),console[_0x57afc0(0xc7)]('\x20\x20Path:\x20'+_0x33252b),console['error'](''),console[_0x57afc0(0xc7)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x57afc0(0xc7)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x56863f){throw _0x56863f;}}}function a26_0x28cb(_0xed4b0d,_0x404cd5){const _0x1a02a6=a26_0x1a02();return a26_0x28cb=function(_0x28cb5f,_0x1b9ddb){_0x28cb5f=_0x28cb5f-0xc7;let _0x209284=_0x1a02a6[_0x28cb5f];return _0x209284;},a26_0x28cb(_0xed4b0d,_0x404cd5);}function a26_0x1a02(){const _0x18dc32=['execute','Show\x20current\x20segment/folder\x20context','1479588gIxhAf','187YYdCVp','json','420482WtCsZE','Context\x20details:','18750mLEycG','description','format','name','stringify','segmentPath','220970dZSacP','344UTFAxY','log','jsonl','3129fVcFrx','segment:pwd','368QXGSsr','3623301ONnZhF','2100972lSMxSF','error','1DJkTmH'];a26_0x1a02=function(){return _0x18dc32;};return a26_0x1a02();}
1
+ function a28_0x3250(_0x398df8,_0x3e9812){const _0x2c521a=a28_0x2c52();return a28_0x3250=function(_0x32506,_0x453c97){_0x32506=_0x32506-0xf2;let _0x169b3e=_0x2c521a[_0x32506];return _0x169b3e;},a28_0x3250(_0x398df8,_0x3e9812);}function a28_0x2c52(){const _0x3a8641=['stringify','root','94806OwDJed','\x20\x20Path:\x20','error','126wtbqXj','11jmIQpQ','3JgVSzI','3152388VzQoZV','22037292rwygCh','name','4ystidF','4374675rJRPFb','segmentPath','4421310TEDquI','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','format','582066NgNFTO','verbose','json','Context\x20details:','segment:pwd','description','log','24VIjFRh','362034BRAzRL'];a28_0x2c52=function(){return _0x3a8641;};return a28_0x2c52();}const a28_0x5f0cb4=a28_0x3250;(function(_0x739ac9,_0x26af47){const _0x17928e=a28_0x3250,_0x36f44d=_0x739ac9();while(!![]){try{const _0x217083=-parseInt(_0x17928e(0xf4))/0x1*(parseInt(_0x17928e(0x109))/0x2)+-parseInt(_0x17928e(0xf5))/0x3*(parseInt(_0x17928e(0xf8))/0x4)+-parseInt(_0x17928e(0xf9))/0x5+parseInt(_0x17928e(0x106))/0x6*(parseInt(_0x17928e(0xf2))/0x7)+parseInt(_0x17928e(0x105))/0x8*(parseInt(_0x17928e(0xfe))/0x9)+-parseInt(_0x17928e(0xfb))/0xa*(parseInt(_0x17928e(0xf3))/0xb)+parseInt(_0x17928e(0xf6))/0xc;if(_0x217083===_0x26af47)break;else _0x36f44d['push'](_0x36f44d['shift']());}catch(_0x1afb97){_0x36f44d['push'](_0x36f44d['shift']());}}}(a28_0x2c52,0x9411e));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a28_0x5f0cb4(0xf7)]=a28_0x5f0cb4(0x102);[a28_0x5f0cb4(0x103)]='Show\x20current\x20segment/folder\x20context';async['execute'](_0x4bc9d1){const _0x223220=a28_0x5f0cb4,{options:_0x145043}=_0x4bc9d1;try{const _0x13e454=_0x145043[_0x223220(0xfa)];if(!_0x13e454)return _0x145043[_0x223220(0xfd)]===_0x223220(0x100)||_0x145043[_0x223220(0xfd)]==='jsonl'?console[_0x223220(0x104)](JSON[_0x223220(0x107)]({'path':'/','type':_0x223220(0x108)})):console[_0x223220(0x104)]('/'),0x0;if(_0x145043[_0x223220(0xfd)]==='json'||_0x145043[_0x223220(0xfd)]==='jsonl'){const _0x166a9c={'path':_0x13e454};console[_0x223220(0x104)](JSON['stringify'](_0x166a9c));}else console[_0x223220(0x104)](_0x13e454),_0x145043[_0x223220(0xff)]&&(console['error'](''),console[_0x223220(0x10b)](_0x223220(0x101)),console['error'](_0x223220(0x10a)+_0x13e454),console[_0x223220(0x10b)](''),console[_0x223220(0x10b)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console['error'](_0x223220(0xfc)));return 0x0;}catch(_0x13e731){throw _0x13e731;}}}
@@ -1 +1 @@
1
- const a27_0x4ea326=a27_0x4f26;(function(_0x47f1f5,_0x7c0191){const _0x17302c=a27_0x4f26,_0x158d0b=_0x47f1f5();while(!![]){try{const _0x4776b0=-parseInt(_0x17302c(0x154))/0x1+parseInt(_0x17302c(0x150))/0x2+-parseInt(_0x17302c(0x157))/0x3+parseInt(_0x17302c(0x14b))/0x4*(-parseInt(_0x17302c(0x14e))/0x5)+parseInt(_0x17302c(0x145))/0x6*(parseInt(_0x17302c(0x149))/0x7)+parseInt(_0x17302c(0x169))/0x8+parseInt(_0x17302c(0x147))/0x9;if(_0x4776b0===_0x7c0191)break;else _0x158d0b['push'](_0x158d0b['shift']());}catch(_0x337799){_0x158d0b['push'](_0x158d0b['shift']());}}}(a27_0xef06,0xbb63c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x4f26(_0x35cc63,_0x2b0667){const _0xef06eb=a27_0xef06();return a27_0x4f26=function(_0x4f26da,_0xb9c0aa){_0x4f26da=_0x4f26da-0x145;let _0x5f41ee=_0xef06eb[_0x4f26da];return _0x5f41ee;},a27_0x4f26(_0x35cc63,_0x2b0667);}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_0x4ea326(0x15d);[a27_0x4ea326(0x148)]=a27_0x4ea326(0x161);async['execute'](_0x3c2585){const _0x5ec769=a27_0x4ea326,{options:_0x15beb3,args:_0x3ee667,tdx:_0x54ee85}=_0x3c2585,_0x5ec885=_0x15beb3;if(_0x3ee667['length']===0x0)return console[_0x5ec769(0x151)](_0x5ec769(0x16a)),console[_0x5ec769(0x151)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x5ec769(0x151)](_0x5ec769(0x15a)),console[_0x5ec769(0x151)](_0x5ec769(0x14f)),console[_0x5ec769(0x151)](_0x5ec769(0x16c)),0x1;const _0xaa977f=_0x3ee667[0x0],_0x43261c=_0x15beb3[_0x5ec769(0x15b)];let _0x216c69=_0xaa977f;_0x43261c&&!_0xaa977f[_0x5ec769(0x16e)]('/')&&(_0x216c69=_0x43261c+'/'+_0xaa977f,_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x146)+_0x216c69));const _0x1cda58=await withSpinner(_0x5ec769(0x164)+_0x216c69+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)][_0x5ec769(0x15f)](_0x216c69),{'verbose':_0x5ec885[_0x5ec769(0x163)]}),_0x3f9225=_0x1cda58['data'];_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x15c)+_0x3f9225[_0x5ec769(0x14a)]);if(_0x3f9225[_0x5ec769(0x14a)]!==_0x5ec769(0x159))return console[_0x5ec769(0x151)](_0x5ec769(0x153)+_0x3f9225[_0x5ec769(0x14a)]+_0x5ec769(0x152)),console[_0x5ec769(0x151)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3f9225[_0x5ec769(0x14d)])throw new SDKError(ErrorCode[_0x5ec769(0x16b)],_0x5ec769(0x168));const _0xf38fc3=_0x3f9225[_0x5ec769(0x15e)],_0x23f6bb=_0x3f9225[_0x5ec769(0x14d)];_0x5ec885[_0x5ec769(0x163)]&&(console['error']('Parent\x20ID:\x20'+_0xf38fc3),console[_0x5ec769(0x151)]('Segment\x20ID:\x20'+_0x23f6bb));let _0x126a3b;if(_0x5ec885['folder']){const _0x18f7e0=_0x5ec885[_0x5ec769(0x162)],_0x1670c8=await withSpinner(_0x5ec769(0x167)+_0x18f7e0+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)][_0x5ec769(0x166)](_0xf38fc3,_0x18f7e0),{'verbose':_0x5ec885[_0x5ec769(0x163)]});_0x126a3b=parseInt(_0x1670c8[_0x5ec769(0x155)],0xa),_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x165)+_0x126a3b);}const _0x245444=await loadJSONFromOptions(_0x5ec885[_0x5ec769(0x160)],_0x5ec885[_0x5ec769(0x14c)]),_0x31ed1f={'name':_0x5ec885[_0x5ec769(0x158)],'description':_0x5ec885[_0x5ec769(0x148)],'rule':_0x245444,'kind':_0x5ec885[_0x5ec769(0x170)]!==undefined?parseInt(_0x5ec885[_0x5ec769(0x170)],0xa):undefined,'segmentFolderId':_0x126a3b},_0x261458=await withSpinner(_0x5ec769(0x156)+_0x3f9225[_0x5ec769(0x16d)]+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)]['updateSegmentById'](_0xf38fc3,_0x23f6bb,_0x31ed1f),{'verbose':_0x5ec885['verbose']}),_0x3bd63d=_0x261458[_0x5ec769(0x155)];return console[_0x5ec769(0x151)](_0x5ec769(0x16f)+_0x3bd63d[_0x5ec769(0x158)]+'\x27'),_0x216c69!==_0xaa977f&&console['error']('\x20\x20\x20Path:\x20'+_0x216c69),await handleSDKOutput([_0x3bd63d],_0x5ec885),0x0;}}function a27_0xef06(){const _0x578ac0=['data','Updating\x20segment\x20\x27','3088119vtOLzX','name','segment','Examples:','segmentPath','Resolved\x20type:\x20','segment:update','parentId','resolvePathToResource','rule','Update\x20existing\x20child\x20segment','folder','verbose','Resolving\x20path\x20\x27','Resolved\x20folder\x20ID:\x20','resolveFolderId','Resolving\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','5966048QSHvyL','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentName','includes','✔\x20Updated\x20segment\x20\x27','kind','\x27...','2224758akkpBn','Resolved\x20relative\x20path\x20to:\x20','11031021OcrYwN','description','14iBbDrv','type','656pEtBAi','ruleFile','segmentId','23515daKsSF','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','487912CzCARl','error','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','388754UyGyCJ'];a27_0xef06=function(){return _0x578ac0;};return a27_0xef06();}
1
+ const a29_0x112769=a29_0x4551;(function(_0x17abea,_0x2d9900){const _0x4dc7d9=a29_0x4551,_0x3518c3=_0x17abea();while(!![]){try{const _0x4404bb=-parseInt(_0x4dc7d9(0x204))/0x1*(-parseInt(_0x4dc7d9(0x1e3))/0x2)+-parseInt(_0x4dc7d9(0x1f2))/0x3+parseInt(_0x4dc7d9(0x1da))/0x4*(parseInt(_0x4dc7d9(0x1d7))/0x5)+parseInt(_0x4dc7d9(0x1eb))/0x6*(-parseInt(_0x4dc7d9(0x1ec))/0x7)+-parseInt(_0x4dc7d9(0x208))/0x8+-parseInt(_0x4dc7d9(0x1f8))/0x9*(-parseInt(_0x4dc7d9(0x1f1))/0xa)+parseInt(_0x4dc7d9(0x1e1))/0xb*(parseInt(_0x4dc7d9(0x1e9))/0xc);if(_0x4404bb===_0x2d9900)break;else _0x3518c3['push'](_0x3518c3['shift']());}catch(_0x333cdc){_0x3518c3['push'](_0x3518c3['shift']());}}}(a29_0x1f25,0xa24b9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x4551(_0x33bbfa,_0x394d37){const _0x1f25e2=a29_0x1f25();return a29_0x4551=function(_0x455111,_0x49f967){_0x455111=_0x455111-0x1d5;let _0x503293=_0x1f25e2[_0x455111];return _0x503293;},a29_0x4551(_0x33bbfa,_0x394d37);}import{loadJSONFromOptions}from'../utils/json-loader.js';function a29_0x1f25(){const _0x1da124=['Resolving\x20folder\x20\x27','error','132cmHEIb','updateSegmentById','1006762zzjlJd','\x20\x20\x20Path:\x20','Updating\x20segment\x20\x27','includes','segment:update','INTERNAL','944796TyotyE','rule','2411052XyICRG','21YzgqoJ','Resolved\x20folder\x20ID:\x20','Parent\x20ID:\x20','segmentId','Update\x20existing\x20child\x20segment','10392170CuUhMI','2378859foXKeC','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','length','9kwRwDX','segmentPath','verbose','ruleFile','type','parentId','\x27...','execute','name','folder','data','resolveFolderId','2wAoUIV','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','3364136LGBQjf','kind','Resolving\x20path\x20\x27','Segment\x20ID:\x20','77485jSSVpD','segmentName','resolvePathToResource','24VuQnfv','Examples:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','✔\x20Updated\x20segment\x20\x27','description'];a29_0x1f25=function(){return _0x1da124;};return a29_0x1f25();}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a29_0x112769(0x1e7);[a29_0x112769(0x1de)]=a29_0x112769(0x1f0);async[a29_0x112769(0x1ff)](_0x365e4e){const _0x58ca38=a29_0x112769,{options:_0x3f2f35,args:_0x2d55cf,tdx:_0x50e905}=_0x365e4e,_0x10f6b9=_0x3f2f35;if(_0x2d55cf[_0x58ca38(0x1f7)]===0x0)return console['error'](_0x58ca38(0x1f4)),console[_0x58ca38(0x1e0)](_0x58ca38(0x205)),console['error'](_0x58ca38(0x1db)),console['error'](_0x58ca38(0x1f6)),console[_0x58ca38(0x1e0)](_0x58ca38(0x206)),0x1;const _0x54122f=_0x2d55cf[0x0],_0x22a3dd=_0x3f2f35[_0x58ca38(0x1f9)];let _0x245cec=_0x54122f;_0x22a3dd&&!_0x54122f[_0x58ca38(0x1e6)]('/')&&(_0x245cec=_0x22a3dd+'/'+_0x54122f,_0x10f6b9['verbose']&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x245cec));const _0x4c7f1f=await withSpinner(_0x58ca38(0x1d5)+_0x245cec+_0x58ca38(0x1fe),()=>_0x50e905[_0x58ca38(0x1f5)][_0x58ca38(0x1d9)](_0x245cec),{'verbose':_0x10f6b9[_0x58ca38(0x1fa)]}),_0x437f03=_0x4c7f1f['data'];_0x10f6b9['verbose']&&console[_0x58ca38(0x1e0)]('Resolved\x20type:\x20'+_0x437f03[_0x58ca38(0x1fc)]);if(_0x437f03[_0x58ca38(0x1fc)]!=='segment')return console[_0x58ca38(0x1e0)]('Error:\x20Cannot\x20update\x20'+_0x437f03['type']+_0x58ca38(0x1f3)),console[_0x58ca38(0x1e0)](_0x58ca38(0x207)),0x1;if(!_0x437f03[_0x58ca38(0x1ef)])throw new SDKError(ErrorCode[_0x58ca38(0x1e8)],_0x58ca38(0x1dc));const _0x49de2f=_0x437f03[_0x58ca38(0x1fd)],_0x499395=_0x437f03[_0x58ca38(0x1ef)];_0x10f6b9['verbose']&&(console[_0x58ca38(0x1e0)](_0x58ca38(0x1ee)+_0x49de2f),console[_0x58ca38(0x1e0)](_0x58ca38(0x1d6)+_0x499395));let _0x150bc0;if(_0x10f6b9[_0x58ca38(0x201)]){const _0x32e06e=_0x10f6b9[_0x58ca38(0x201)],_0x3c05b9=await withSpinner(_0x58ca38(0x1df)+_0x32e06e+_0x58ca38(0x1fe),()=>_0x50e905[_0x58ca38(0x1f5)][_0x58ca38(0x203)](_0x49de2f,_0x32e06e),{'verbose':_0x10f6b9[_0x58ca38(0x1fa)]});_0x150bc0=parseInt(_0x3c05b9[_0x58ca38(0x202)],0xa),_0x10f6b9[_0x58ca38(0x1fa)]&&console[_0x58ca38(0x1e0)](_0x58ca38(0x1ed)+_0x150bc0);}const _0x5a4343=await loadJSONFromOptions(_0x10f6b9[_0x58ca38(0x1ea)],_0x10f6b9[_0x58ca38(0x1fb)]),_0x585f01={'name':_0x10f6b9[_0x58ca38(0x200)],'description':_0x10f6b9[_0x58ca38(0x1de)],'rule':_0x5a4343,'kind':_0x10f6b9[_0x58ca38(0x209)]!==undefined?parseInt(_0x10f6b9[_0x58ca38(0x209)],0xa):undefined,'segmentFolderId':_0x150bc0},_0x54e7d9=await withSpinner(_0x58ca38(0x1e5)+_0x437f03[_0x58ca38(0x1d8)]+_0x58ca38(0x1fe),()=>_0x50e905[_0x58ca38(0x1f5)][_0x58ca38(0x1e2)](_0x49de2f,_0x499395,_0x585f01),{'verbose':_0x10f6b9[_0x58ca38(0x1fa)]}),_0x23f468=_0x54e7d9[_0x58ca38(0x202)];return console['error'](_0x58ca38(0x1dd)+_0x23f468[_0x58ca38(0x200)]+'\x27'),_0x245cec!==_0x54122f&&console['error'](_0x58ca38(0x1e4)+_0x245cec),await handleSDKOutput([_0x23f468],_0x10f6b9),0x0;}}
@@ -1 +1 @@
1
- const a28_0x4d9f16=a28_0x37e1;function a28_0x37e1(_0x7c8dbf,_0xeb48fc){const _0x2fe9e3=a28_0x2fe9();return a28_0x37e1=function(_0x37e1cd,_0x3f067a){_0x37e1cd=_0x37e1cd-0x15f;let _0x896ae1=_0x2fe9e3[_0x37e1cd];return _0x896ae1;},a28_0x37e1(_0x7c8dbf,_0xeb48fc);}(function(_0x57ad55,_0x193d35){const _0x1f38f6=a28_0x37e1,_0x291c45=_0x57ad55();while(!![]){try{const _0x882518=parseInt(_0x1f38f6(0x160))/0x1*(-parseInt(_0x1f38f6(0x17c))/0x2)+parseInt(_0x1f38f6(0x17a))/0x3+parseInt(_0x1f38f6(0x17b))/0x4*(parseInt(_0x1f38f6(0x180))/0x5)+parseInt(_0x1f38f6(0x16b))/0x6*(-parseInt(_0x1f38f6(0x161))/0x7)+-parseInt(_0x1f38f6(0x169))/0x8+-parseInt(_0x1f38f6(0x18a))/0x9*(parseInt(_0x1f38f6(0x171))/0xa)+parseInt(_0x1f38f6(0x189))/0xb;if(_0x882518===_0x193d35)break;else _0x291c45['push'](_0x291c45['shift']());}catch(_0x2d1063){_0x291c45['push'](_0x291c45['shift']());}}}(a28_0x2fe9,0x2652c));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']=a28_0x4d9f16(0x18d);[a28_0x4d9f16(0x167)]=a28_0x4d9f16(0x17d);async[a28_0x4d9f16(0x183)](_0xebed9b){const _0x2cce9f=a28_0x4d9f16,{options:_0x25d644,args:_0x233e23,tdx:_0x1de6be}=_0xebed9b;if(_0x233e23[_0x2cce9f(0x175)]===0x0)return console[_0x2cce9f(0x16a)](_0x2cce9f(0x16c)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x162)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x16e)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x18f)),console[_0x2cce9f(0x16a)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x2cce9f(0x192)),console['error'](_0x2cce9f(0x178)),0x1;const _0x27372b=_0x233e23[0x0],_0x1720ad=_0x25d644['session'];try{if(_0x27372b==='/')return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x52c470=_0x25d644[_0x2cce9f(0x181)];let _0x23431b=_0x27372b;const _0x26ddd6=parsePath(_0x27372b);if(!_0x26ddd6[_0x2cce9f(0x173)]){if(!_0x52c470)return console[_0x2cce9f(0x16a)](_0x2cce9f(0x172)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x174)),0x1;if(_0x27372b==='..'){const _0x35fae8=_0x52c470[_0x2cce9f(0x170)]('/')[_0x2cce9f(0x190)](0x0,-0x1)[_0x2cce9f(0x179)]('/');_0x23431b=_0x35fae8||'/';}else _0x27372b==='.'?_0x23431b=_0x52c470:_0x23431b=_0x52c470+'/'+_0x27372b;_0x25d644[_0x2cce9f(0x166)]&&console['error'](_0x2cce9f(0x191)+_0x23431b);}if(_0x23431b==='/'||_0x23431b==='')return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x23431b=normalizePath(_0x23431b);const _0x2723cb=parsePath(_0x23431b)[_0x2cce9f(0x188)];if(_0x2723cb[_0x2cce9f(0x175)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x25d644['verbose']&&(console[_0x2cce9f(0x16a)]('Site:\x20'+_0x25d644['site']),console['error']('Target\x20path:\x20'+_0x23431b));const _0x109f1e=await withSpinner(_0x2cce9f(0x185)+_0x23431b+_0x2cce9f(0x184),()=>_0x1de6be[_0x2cce9f(0x17f)][_0x2cce9f(0x16d)](_0x23431b),{'verbose':_0x25d644['verbose']}),_0x262cf9=_0x109f1e[_0x2cce9f(0x182)];_0x25d644['verbose']&&(console['error'](_0x2cce9f(0x18b)+_0x262cf9[_0x2cce9f(0x17e)]),console[_0x2cce9f(0x16a)](_0x2cce9f(0x176)+_0x262cf9['parentId']),_0x262cf9[_0x2cce9f(0x186)]&&console[_0x2cce9f(0x16a)](_0x2cce9f(0x177)+_0x262cf9['folderId']));if(_0x262cf9[_0x2cce9f(0x17e)]==='segment')return console[_0x2cce9f(0x16a)](_0x2cce9f(0x164)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x18e)),console[_0x2cce9f(0x16a)]('Use:\x20tdx\x20segment\x20use\x20'+_0x262cf9['parentName']+(_0x262cf9[_0x2cce9f(0x16f)]?'/'+_0x262cf9[_0x2cce9f(0x16f)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x262cf9['fullPath'],'parent_segment':_0x262cf9[_0x2cce9f(0x168)]},_0x1720ad),console['log'](_0x2cce9f(0x187)+_0x262cf9[_0x2cce9f(0x15f)]),_0x25d644['verbose']&&(console['error'](_0x2cce9f(0x163)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x165)),console['error'](_0x2cce9f(0x193))),0x0;}catch(_0xcdc2b9){throw _0xcdc2b9;}}}function a28_0x2fe9(){const _0x277013=['type','segment','105FBLUMr','segmentPath','data','execute','\x27...','Resolving\x20path\x20\x27','folderId','Context\x20set\x20to:\x20','segments','5544143YBPAtF','130581aORrKX','Resolved\x20path\x20type:\x20','log','segment:use','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','slice','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','fullPath','139KgfEXz','13069CaFrkv','Usage:\x20tdx\x20segment\x20use\x20<path>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','verbose','description','parentName','781904YcCtqL','error','774dqGTzY','Error:\x20Path\x20is\x20required','resolvePathToResource','Examples:','folderPath','split','140mXcoxp','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','isAbsolute','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','length','Parent\x20ID:\x20','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','join','254322oNyOlP','54636RbdbFc','2546qRvESL','Set\x20current\x20segment/folder\x20context\x20for\x20navigation'];a28_0x2fe9=function(){return _0x277013;};return a28_0x2fe9();}
1
+ const a30_0x50b0c9=a30_0x1056;(function(_0x3e588b,_0x494549){const _0x249d3d=a30_0x1056,_0x7e0446=_0x3e588b();while(!![]){try{const _0x288e87=parseInt(_0x249d3d(0x161))/0x1+-parseInt(_0x249d3d(0x167))/0x2*(parseInt(_0x249d3d(0x160))/0x3)+-parseInt(_0x249d3d(0x163))/0x4+parseInt(_0x249d3d(0x144))/0x5*(parseInt(_0x249d3d(0x172))/0x6)+-parseInt(_0x249d3d(0x171))/0x7+parseInt(_0x249d3d(0x140))/0x8*(-parseInt(_0x249d3d(0x13f))/0x9)+parseInt(_0x249d3d(0x164))/0xa;if(_0x288e87===_0x494549)break;else _0x7e0446['push'](_0x7e0446['shift']());}catch(_0x8e1849){_0x7e0446['push'](_0x7e0446['shift']());}}}(a30_0x58ce,0xdb6e6));function a30_0x58ce(){const _0x28b98b=['65CjPqpA','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','segmentPath','folderId','Target\x20path:\x20','split','Resolving\x20path\x20\x27','execute','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Error:\x20Path\x20is\x20required','length','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Usage:\x20tdx\x20segment\x20use\x20<path>','parentId','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Parent\x20ID:\x20','Use:\x20tdx\x20segment\x20use\x20','error','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Resolved\x20relative\x20path\x20to:\x20','fullPath','join','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','verbose','log','Folder\x20ID:\x20','segment','slice','3kQAhcy','246365mgMxdg','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','1148788lFaheY','29762700aDqcuk','segment:use','isAbsolute','983842idZbdy','Examples:','Resolved\x20path\x20type:\x20','data','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','description','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Site:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','parentName','11279800omsTDe','211518JVtppG','resolvePathToResource','site','Context\x20cleared.\x20Back\x20to\x20root.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','8352NjoLzk','3376auPRom','folderPath','\x27...','type'];a30_0x58ce=function(){return _0x28b98b;};return a30_0x58ce();}import{BaseCommand}from'./command.js';function a30_0x1056(_0x45f6f3,_0x103927){const _0x58ce13=a30_0x58ce();return a30_0x1056=function(_0x105670,_0x2ae3b9){_0x105670=_0x105670-0x13b;let _0x5c3d42=_0x58ce13[_0x105670];return _0x5c3d42;},a30_0x1056(_0x45f6f3,_0x103927);}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']=a30_0x50b0c9(0x165);[a30_0x50b0c9(0x16c)]=a30_0x50b0c9(0x16f);async[a30_0x50b0c9(0x14b)](_0x273695){const _0x1e2ced=a30_0x50b0c9,{options:_0x3703f3,args:_0x2880b8,tdx:_0x49b664}=_0x273695;if(_0x2880b8[_0x1e2ced(0x14e)]===0x0)return console[_0x1e2ced(0x155)](_0x1e2ced(0x14d)),console[_0x1e2ced(0x155)](_0x1e2ced(0x150)),console[_0x1e2ced(0x155)](_0x1e2ced(0x168)),console[_0x1e2ced(0x155)](_0x1e2ced(0x162)),console[_0x1e2ced(0x155)](_0x1e2ced(0x16d)),console['error'](_0x1e2ced(0x145)),console['error'](_0x1e2ced(0x16b)),0x1;const _0x500701=_0x2880b8[0x0],_0x380690=_0x3703f3['session'];try{if(_0x500701==='/')return saveSessionContext({'segment_path':undefined},_0x380690),console[_0x1e2ced(0x15c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x558681=_0x3703f3[_0x1e2ced(0x146)];let _0x5697d4=_0x500701;const _0x23a50f=parsePath(_0x500701);if(!_0x23a50f[_0x1e2ced(0x166)]){if(!_0x558681)return console[_0x1e2ced(0x155)](_0x1e2ced(0x14c)),console[_0x1e2ced(0x155)](_0x1e2ced(0x14f)),0x1;if(_0x500701==='..'){const _0x3c8962=_0x558681[_0x1e2ced(0x149)]('/')[_0x1e2ced(0x15f)](0x0,-0x1)[_0x1e2ced(0x159)]('/');_0x5697d4=_0x3c8962||'/';}else _0x500701==='.'?_0x5697d4=_0x558681:_0x5697d4=_0x558681+'/'+_0x500701;_0x3703f3[_0x1e2ced(0x15b)]&&console[_0x1e2ced(0x155)](_0x1e2ced(0x157)+_0x5697d4);}if(_0x5697d4==='/'||_0x5697d4==='')return saveSessionContext({'segment_path':undefined},_0x380690),console[_0x1e2ced(0x15c)](_0x1e2ced(0x13d)),0x0;_0x5697d4=normalizePath(_0x5697d4);const _0x3df30a=parsePath(_0x5697d4)['segments'];if(_0x3df30a[_0x1e2ced(0x14e)]===0x0)return saveSessionContext({'segment_path':undefined},_0x380690),console[_0x1e2ced(0x15c)](_0x1e2ced(0x13d)),0x0;_0x3703f3['verbose']&&(console[_0x1e2ced(0x155)](_0x1e2ced(0x16e)+_0x3703f3[_0x1e2ced(0x13c)]),console[_0x1e2ced(0x155)](_0x1e2ced(0x148)+_0x5697d4));const _0x4892ec=await withSpinner(_0x1e2ced(0x14a)+_0x5697d4+_0x1e2ced(0x142),()=>_0x49b664[_0x1e2ced(0x15e)][_0x1e2ced(0x13b)](_0x5697d4),{'verbose':_0x3703f3['verbose']}),_0x16d59b=_0x4892ec[_0x1e2ced(0x16a)];_0x3703f3[_0x1e2ced(0x15b)]&&(console[_0x1e2ced(0x155)](_0x1e2ced(0x169)+_0x16d59b['type']),console[_0x1e2ced(0x155)](_0x1e2ced(0x153)+_0x16d59b[_0x1e2ced(0x151)]),_0x16d59b[_0x1e2ced(0x147)]&&console[_0x1e2ced(0x155)](_0x1e2ced(0x15d)+_0x16d59b['folderId']));if(_0x16d59b[_0x1e2ced(0x143)]===_0x1e2ced(0x15e))return console[_0x1e2ced(0x155)](_0x1e2ced(0x15a)),console[_0x1e2ced(0x155)](_0x1e2ced(0x156)),console[_0x1e2ced(0x155)](_0x1e2ced(0x154)+_0x16d59b[_0x1e2ced(0x170)]+(_0x16d59b[_0x1e2ced(0x141)]?'/'+_0x16d59b['folderPath'][_0x1e2ced(0x159)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x16d59b[_0x1e2ced(0x158)],'parent_segment':_0x16d59b[_0x1e2ced(0x170)]},_0x380690),console[_0x1e2ced(0x15c)]('Context\x20set\x20to:\x20'+_0x16d59b['fullPath']),_0x3703f3['verbose']&&(console[_0x1e2ced(0x155)](_0x1e2ced(0x13e)),console[_0x1e2ced(0x155)]('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0x1e2ced(0x155)](_0x1e2ced(0x152))),0x0;}catch(_0x12178e){throw _0x12178e;}}}
@@ -1 +1 @@
1
- const a29_0xf84c78=a29_0x80df;(function(_0x5f22ce,_0x567c60){const _0x425bcc=a29_0x80df,_0x1bb071=_0x5f22ce();while(!![]){try{const _0x148448=-parseInt(_0x425bcc(0x165))/0x1*(parseInt(_0x425bcc(0x175))/0x2)+-parseInt(_0x425bcc(0x15c))/0x3+parseInt(_0x425bcc(0x171))/0x4*(parseInt(_0x425bcc(0x142))/0x5)+-parseInt(_0x425bcc(0x14b))/0x6*(parseInt(_0x425bcc(0x148))/0x7)+parseInt(_0x425bcc(0x178))/0x8+parseInt(_0x425bcc(0x153))/0x9+parseInt(_0x425bcc(0x149))/0xa;if(_0x148448===_0x567c60)break;else _0x1bb071['push'](_0x1bb071['shift']());}catch(_0x18b141){_0x1bb071['push'](_0x1bb071['shift']());}}}(a29_0x2907,0xf347d));function a29_0x80df(_0x4937e3,_0x7cbc5f){const _0x2907ca=a29_0x2907();return a29_0x80df=function(_0x80dfcd,_0x3baaaf){_0x80dfcd=_0x80dfcd-0x140;let _0x3f0f7e=_0x2907ca[_0x80dfcd];return _0x3f0f7e;},a29_0x80df(_0x4937e3,_0x7cbc5f);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';function a29_0x2907(){const _0x25f8bc=['Folder\x20ID:\x20','log','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','42pikVBK','13477020xqpmum','No\x20parent\x20segments\x20match\x20pattern:\x20','797058ZLErAj','error','map','\x20parent\x20segment','listUnified','\x20segment','cause','localeCompare','5730579fzXXRp','replace','description','recursive','Listing\x20parent\x20segments...','Recursive\x20mode:\x20enabled','(empty)','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','site','1915956gavIbJ','sort','resolvePathToResource','folder','folderId','Listing\x20folders\x20and\x20segments...','segment','parentId','Listing\x20parent\x20segments\x20matching\x20\x27','7177KbNYGU','Building\x20hierarchy\x20tree...','verbose','listParents','✔\x20Built\x20tree\x20with\x20','Parent\x20ID:\x20','message','\x20matching\x20\x27','✔\x20Found\x20','Path/pattern\x20arg:\x20','json','listRecursive','12ARfVaJ','Resolving\x20context\x20path\x20\x27','data','segmentPath','76ookmQT','test','dim','2537088NPxiZR','listParentsWithPattern','execute','length','\x27...','population','👥\x20','jsonl','attributes','Error:\x20','[parent\x20segments]','name','672240nkxlRR','includes','format'];a29_0x2907=function(){return _0x25f8bc;};return a29_0x2907();}import a29_0x31bb3b from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0xf84c78(0x141)]='segments';[a29_0xf84c78(0x155)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a29_0xf84c78(0x17a)](_0x35932b){const _0x298757=a29_0xf84c78,{options:_0x2e3d50,args:_0x516794}=_0x35932b,_0x4d7ac2=_0x2e3d50[_0x298757(0x156)],_0x22a0b2=_0x516794[0x0];try{const _0x3b6876=_0x2e3d50[_0x298757(0x174)];_0x2e3d50[_0x298757(0x167)]&&(console['error']('Site:\x20'+_0x2e3d50[_0x298757(0x15b)]),console[_0x298757(0x14c)]('Current\x20context:\x20'+(_0x3b6876||'/')),_0x22a0b2&&console[_0x298757(0x14c)](_0x298757(0x16e)+_0x22a0b2),_0x4d7ac2&&console[_0x298757(0x14c)](_0x298757(0x158)));if(_0x22a0b2){const _0x508ffb=_0x22a0b2[_0x298757(0x143)]('*')||_0x22a0b2[_0x298757(0x143)]('?');if(_0x508ffb&&!_0x3b6876)return await this[_0x298757(0x179)](_0x35932b,_0x22a0b2);else return _0x508ffb?(console['error'](_0x298757(0x147)),console[_0x298757(0x14c)](_0x298757(0x15a)),0x1):_0x4d7ac2?await this['listRecursive'](_0x35932b,_0x22a0b2):await this[_0x298757(0x14f)](_0x35932b,_0x22a0b2);}if(!_0x3b6876)return await this[_0x298757(0x168)](_0x35932b);return _0x4d7ac2?await this[_0x298757(0x170)](_0x35932b,_0x3b6876):await this['listUnified'](_0x35932b,_0x3b6876);}catch(_0x12d0a0){if(_0x12d0a0 instanceof SDKError)return console[_0x298757(0x14c)](_0x298757(0x181)+_0x12d0a0[_0x298757(0x16b)]),_0x12d0a0[_0x298757(0x151)]&&console['error']('\x20\x20Cause:\x20'+_0x12d0a0[_0x298757(0x151)]),0x1;throw _0x12d0a0;}}async[a29_0xf84c78(0x179)](_0x542cd3,_0x575c69){const _0x2cc558=a29_0xf84c78,{options:_0x1b73c7,tdx:_0x169208}=_0x542cd3,_0x4ae15b=await withSpinner(_0x2cc558(0x164)+_0x575c69+'\x27...',()=>_0x169208[_0x2cc558(0x162)][_0x2cc558(0x168)](),{'verbose':_0x1b73c7['verbose']}),_0x580af9=_0x4ae15b[_0x2cc558(0x173)],_0x58abcc=_0x575c69['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x2cc558(0x154)](/\?/g,'.'),_0x5d7f7b=new RegExp('^'+_0x58abcc+'$','i'),_0x9d1c20=_0x580af9['filter'](_0x494d78=>_0x5d7f7b[_0x2cc558(0x176)](_0x494d78['attributes']['name']));console[_0x2cc558(0x14c)](_0x2cc558(0x16d)+_0x9d1c20[_0x2cc558(0x17b)]+_0x2cc558(0x14e)+(_0x9d1c20[_0x2cc558(0x17b)]!==0x1?'s':'')+_0x2cc558(0x16c)+_0x575c69+'\x27');if(_0x1b73c7[_0x2cc558(0x144)]==='json'||_0x1b73c7[_0x2cc558(0x144)]==='jsonl')await handleSDKOutput(_0x9d1c20,_0x1b73c7);else{if(_0x9d1c20[_0x2cc558(0x17b)]===0x0)console['log'](_0x2cc558(0x14a)+_0x575c69);else{console['log'](_0x2cc558(0x140));for(const _0x4bb183 of _0x9d1c20){const _0x4288e8=_0x4bb183['attributes'][_0x2cc558(0x17d)]?a29_0x31bb3b[_0x2cc558(0x177)]('\x20('+formatRows(_0x4bb183[_0x2cc558(0x180)]['population'])+')'):'';console[_0x2cc558(0x146)](_0x2cc558(0x17e)+_0x4bb183[_0x2cc558(0x180)][_0x2cc558(0x141)]+_0x4288e8);}}}return 0x0;}async[a29_0xf84c78(0x168)](_0x57a3b7){const _0x545582=a29_0xf84c78,{options:_0x4c5534,tdx:_0x16ae57}=_0x57a3b7,_0x8eaba5=await withSpinner(_0x545582(0x157),()=>_0x16ae57[_0x545582(0x162)][_0x545582(0x168)](),{'verbose':_0x4c5534[_0x545582(0x167)]}),_0x5093d3=_0x8eaba5[_0x545582(0x173)];console[_0x545582(0x14c)](_0x545582(0x16d)+_0x5093d3[_0x545582(0x17b)]+'\x20parent\x20segment'+(_0x5093d3[_0x545582(0x17b)]!==0x1?'s':''));if(_0x4c5534[_0x545582(0x144)]===_0x545582(0x16f)||_0x4c5534[_0x545582(0x144)]===_0x545582(0x17f))await handleSDKOutput(_0x5093d3,_0x4c5534);else{console[_0x545582(0x146)](_0x545582(0x140));for(const _0x3ce9a4 of _0x5093d3){const _0x550058=_0x3ce9a4[_0x545582(0x180)]['population']?a29_0x31bb3b[_0x545582(0x177)]('\x20('+formatRows(_0x3ce9a4['attributes'][_0x545582(0x17d)])+')'):'';console[_0x545582(0x146)](_0x545582(0x17e)+_0x3ce9a4[_0x545582(0x180)][_0x545582(0x141)]+_0x550058);}}return 0x0;}async[a29_0xf84c78(0x14f)](_0x655df9,_0x48a473){const _0x545d08=a29_0xf84c78,{options:_0x237186,tdx:_0x832194}=_0x655df9,_0x144a87=await withSpinner(_0x545d08(0x172)+_0x48a473+'\x27...',()=>_0x832194[_0x545d08(0x162)][_0x545d08(0x15e)](_0x48a473),{'verbose':_0x237186['verbose']}),_0x39cdd3=_0x144a87[_0x545d08(0x173)];_0x237186['verbose']&&(console[_0x545d08(0x14c)](_0x545d08(0x16a)+_0x39cdd3[_0x545d08(0x163)]),_0x39cdd3['folderId']&&console[_0x545d08(0x14c)](_0x545d08(0x145)+_0x39cdd3[_0x545d08(0x160)]));const _0x509565=await withSpinner(_0x545d08(0x161),()=>_0x832194['segment'][_0x545d08(0x14f)](_0x39cdd3[_0x545d08(0x163)],_0x39cdd3['folderId']),{'verbose':_0x237186[_0x545d08(0x167)]}),{folders:_0x58ec9c,segments:_0xd45f12}=_0x509565[_0x545d08(0x173)],_0x5c1c49=_0x58ec9c['length']+_0xd45f12[_0x545d08(0x17b)];console['error'](_0x545d08(0x16d)+_0x58ec9c[_0x545d08(0x17b)]+'\x20folder'+(_0x58ec9c[_0x545d08(0x17b)]!==0x1?'s':'')+'\x20and\x20'+_0xd45f12['length']+_0x545d08(0x150)+(_0xd45f12['length']!==0x1?'s':''));if(_0x237186['format']===_0x545d08(0x16f)||_0x237186[_0x545d08(0x144)]===_0x545d08(0x17f)){const _0x15d6fb=[..._0x58ec9c[_0x545d08(0x14d)](_0x34da7a=>({..._0x34da7a,'type':_0x545d08(0x15f)})),..._0xd45f12['map'](_0x4ac27d=>({..._0x4ac27d,'type':_0x545d08(0x162)}))][_0x545d08(0x15d)]((_0x3a4699,_0x37715f)=>_0x3a4699[_0x545d08(0x141)][_0x545d08(0x152)](_0x37715f[_0x545d08(0x141)]));await handleSDKOutput(_0x15d6fb,_0x237186);}else{if(_0x5c1c49===0x0)console[_0x545d08(0x146)](a29_0x31bb3b[_0x545d08(0x177)]('[/'+_0x48a473+']')),console[_0x545d08(0x146)](_0x545d08(0x159));else{console[_0x545d08(0x146)](a29_0x31bb3b[_0x545d08(0x177)]('[/'+_0x48a473+']'));const _0xeede00=formatFlatList(_0x58ec9c,_0xd45f12,{'showMetadata':!![]});console[_0x545d08(0x146)](_0xeede00);}}return 0x0;}async['listRecursive'](_0x5bb62e,_0x427637){const _0x40c732=a29_0xf84c78,{options:_0x4a5b33,tdx:_0x1ae9ad}=_0x5bb62e,_0x25e233=await withSpinner(_0x40c732(0x172)+_0x427637+_0x40c732(0x17c),()=>_0x1ae9ad[_0x40c732(0x162)]['resolvePathToResource'](_0x427637),{'verbose':_0x4a5b33[_0x40c732(0x167)]}),_0x251f67=_0x25e233['data'];_0x4a5b33[_0x40c732(0x167)]&&(console['error'](_0x40c732(0x16a)+_0x251f67[_0x40c732(0x163)]),_0x251f67[_0x40c732(0x160)]&&console[_0x40c732(0x14c)](_0x40c732(0x145)+_0x251f67['folderId']));const _0x3279c6=_0x4a5b33['maxDepth']||0xa,_0x59d7d9=await withSpinner(_0x40c732(0x166),()=>_0x1ae9ad[_0x40c732(0x162)][_0x40c732(0x170)](_0x251f67['parentId'],_0x251f67['folderId'],0x0,_0x3279c6),{'verbose':_0x4a5b33[_0x40c732(0x167)]}),_0x3faf71=_0x59d7d9[_0x40c732(0x173)];console[_0x40c732(0x14c)](_0x40c732(0x169)+_0x3faf71[_0x40c732(0x17b)]+'\x20top-level\x20items');if(_0x4a5b33[_0x40c732(0x144)]===_0x40c732(0x16f)||_0x4a5b33[_0x40c732(0x144)]===_0x40c732(0x17f))await handleSDKOutput(_0x3faf71,_0x4a5b33);else{console[_0x40c732(0x146)](a29_0x31bb3b[_0x40c732(0x177)]('[/'+_0x427637+']'));const _0x40d2f9=formatTree(_0x3faf71,{'showMetadata':!![]});console[_0x40c732(0x146)](_0x40d2f9);}return 0x0;}}
1
+ function a31_0x33cd(_0x425ec8,_0x29d04b){const _0xb14919=a31_0xb149();return a31_0x33cd=function(_0x33cd88,_0x2b6c86){_0x33cd88=_0x33cd88-0x125;let _0x2bcc52=_0xb14919[_0x33cd88];return _0x2bcc52;},a31_0x33cd(_0x425ec8,_0x29d04b);}function a31_0xb149(){const _0x18ee8f=['418jYtidj','resolvePathToResource','Error:\x20','Listing\x20parent\x20segments...','cause','execute','listUnified','Building\x20hierarchy\x20tree...','\x20parent\x20segment','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','attributes','includes','maxDepth','listRecursive','test','Current\x20context:\x20','name','sort','4660588nLfWtF','\x27...','Listing\x20folders\x20and\x20segments...','5AVQNdX','segments','jsonl','folder','Resolving\x20context\x20path\x20\x27','\x5c$&','279117iCBbpz','population','4687074gTaqid','verbose','2270317yhgLhF','map','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','segment','json','listParents','message','filter','45ZCpSBJ','\x20segment','\x20and\x20','description','14AYMjIt','417810FLVFQk','(empty)','folderId','length','[parent\x20segments]','data','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','✔\x20Found\x20','dim','segmentPath','Parent\x20ID:\x20','parentId','error','replace','format','No\x20parent\x20segments\x20match\x20pattern:\x20','log','Path/pattern\x20arg:\x20','675815XrtqTB','listParentsWithPattern','\x20matching\x20\x27','2645024DKqokD'];a31_0xb149=function(){return _0x18ee8f;};return a31_0xb149();}const a31_0x3472ad=a31_0x33cd;(function(_0x15a493,_0xa21c5){const _0x1b4bc2=a31_0x33cd,_0xfee7e4=_0x15a493();while(!![]){try{const _0x1006fa=parseInt(_0x1b4bc2(0x139))/0x1+-parseInt(_0x1b4bc2(0x126))/0x2*(parseInt(_0x1b4bc2(0x158))/0x3)+-parseInt(_0x1b4bc2(0x14f))/0x4*(parseInt(_0x1b4bc2(0x152))/0x5)+-parseInt(_0x1b4bc2(0x15a))/0x6+-parseInt(_0x1b4bc2(0x15c))/0x7+-parseInt(_0x1b4bc2(0x13c))/0x8*(-parseInt(_0x1b4bc2(0x164))/0x9)+parseInt(_0x1b4bc2(0x127))/0xa*(parseInt(_0x1b4bc2(0x13d))/0xb);if(_0x1006fa===_0xa21c5)break;else _0xfee7e4['push'](_0xfee7e4['shift']());}catch(_0xce0ba0){_0xfee7e4['push'](_0xfee7e4['shift']());}}}(a31_0xb149,0xf2d8f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a31_0x261bf0 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a31_0x3472ad(0x153);[a31_0x3472ad(0x125)]=a31_0x3472ad(0x12d);async[a31_0x3472ad(0x142)](_0x372984){const _0xdd96a6=a31_0x3472ad,{options:_0x8a8f57,args:_0x1bc63c}=_0x372984,_0x5db954=_0x8a8f57['recursive'],_0x538ab9=_0x1bc63c[0x0];try{const _0xa07db0=_0x8a8f57[_0xdd96a6(0x130)];_0x8a8f57['verbose']&&(console['error']('Site:\x20'+_0x8a8f57['site']),console[_0xdd96a6(0x133)](_0xdd96a6(0x14c)+(_0xa07db0||'/')),_0x538ab9&&console[_0xdd96a6(0x133)](_0xdd96a6(0x138)+_0x538ab9),_0x5db954&&console[_0xdd96a6(0x133)]('Recursive\x20mode:\x20enabled'));if(_0x538ab9){const _0x274171=_0x538ab9[_0xdd96a6(0x148)]('*')||_0x538ab9[_0xdd96a6(0x148)]('?');if(_0x274171&&!_0xa07db0)return await this[_0xdd96a6(0x13a)](_0x372984,_0x538ab9);else return _0x274171?(console[_0xdd96a6(0x133)](_0xdd96a6(0x146)),console[_0xdd96a6(0x133)](_0xdd96a6(0x15e)),0x1):_0x5db954?await this['listRecursive'](_0x372984,_0x538ab9):await this['listUnified'](_0x372984,_0x538ab9);}if(!_0xa07db0)return await this['listParents'](_0x372984);return _0x5db954?await this['listRecursive'](_0x372984,_0xa07db0):await this[_0xdd96a6(0x143)](_0x372984,_0xa07db0);}catch(_0x217071){if(_0x217071 instanceof SDKError)return console[_0xdd96a6(0x133)](_0xdd96a6(0x13f)+_0x217071[_0xdd96a6(0x162)]),_0x217071[_0xdd96a6(0x141)]&&console['error']('\x20\x20Cause:\x20'+_0x217071[_0xdd96a6(0x141)]),0x1;throw _0x217071;}}async[a31_0x3472ad(0x13a)](_0x20abfb,_0x18768e){const _0x4b6c2d=a31_0x3472ad,{options:_0xbce650,tdx:_0x365716}=_0x20abfb,_0xc5c9ad=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x18768e+'\x27...',()=>_0x365716[_0x4b6c2d(0x15f)]['listParents'](),{'verbose':_0xbce650[_0x4b6c2d(0x15b)]}),_0x1a035b=_0xc5c9ad[_0x4b6c2d(0x12c)],_0x45bdf1=_0x18768e[_0x4b6c2d(0x134)](/[.+^${}()|[\]\\]/g,_0x4b6c2d(0x157))[_0x4b6c2d(0x134)](/\*/g,'.*')[_0x4b6c2d(0x134)](/\?/g,'.'),_0x12a79c=new RegExp('^'+_0x45bdf1+'$','i'),_0x112942=_0x1a035b[_0x4b6c2d(0x163)](_0x5222d0=>_0x12a79c[_0x4b6c2d(0x14b)](_0x5222d0[_0x4b6c2d(0x147)]['name']));console[_0x4b6c2d(0x133)](_0x4b6c2d(0x12e)+_0x112942[_0x4b6c2d(0x12a)]+_0x4b6c2d(0x145)+(_0x112942[_0x4b6c2d(0x12a)]!==0x1?'s':'')+_0x4b6c2d(0x13b)+_0x18768e+'\x27');if(_0xbce650[_0x4b6c2d(0x135)]===_0x4b6c2d(0x160)||_0xbce650['format']==='jsonl')await handleSDKOutput(_0x112942,_0xbce650);else{if(_0x112942['length']===0x0)console[_0x4b6c2d(0x137)](_0x4b6c2d(0x136)+_0x18768e);else{console[_0x4b6c2d(0x137)](_0x4b6c2d(0x12b));for(const _0x2d0000 of _0x112942){const _0x40d39e=_0x2d0000[_0x4b6c2d(0x147)][_0x4b6c2d(0x159)]?a31_0x261bf0['dim']('\x20('+formatRows(_0x2d0000[_0x4b6c2d(0x147)][_0x4b6c2d(0x159)])+')'):'';console['log']('👥\x20'+_0x2d0000[_0x4b6c2d(0x147)][_0x4b6c2d(0x14d)]+_0x40d39e);}}}return 0x0;}async['listParents'](_0x42cbfd){const _0x477032=a31_0x3472ad,{options:_0x56f054,tdx:_0x84bb66}=_0x42cbfd,_0x21d847=await withSpinner(_0x477032(0x140),()=>_0x84bb66[_0x477032(0x15f)][_0x477032(0x161)](),{'verbose':_0x56f054[_0x477032(0x15b)]}),_0x4aa04d=_0x21d847[_0x477032(0x12c)];console['error'](_0x477032(0x12e)+_0x4aa04d['length']+_0x477032(0x145)+(_0x4aa04d[_0x477032(0x12a)]!==0x1?'s':''));if(_0x56f054[_0x477032(0x135)]===_0x477032(0x160)||_0x56f054['format']===_0x477032(0x154))await handleSDKOutput(_0x4aa04d,_0x56f054);else{console['log'](_0x477032(0x12b));for(const _0x2a3df0 of _0x4aa04d){const _0x57db37=_0x2a3df0[_0x477032(0x147)]['population']?a31_0x261bf0[_0x477032(0x12f)]('\x20('+formatRows(_0x2a3df0['attributes'][_0x477032(0x159)])+')'):'';console[_0x477032(0x137)]('👥\x20'+_0x2a3df0[_0x477032(0x147)][_0x477032(0x14d)]+_0x57db37);}}return 0x0;}async['listUnified'](_0x20788e,_0xf7d658){const _0x3603d7=a31_0x3472ad,{options:_0x57b762,tdx:_0x3e0eda}=_0x20788e,_0x412206=await withSpinner(_0x3603d7(0x156)+_0xf7d658+'\x27...',()=>_0x3e0eda[_0x3603d7(0x15f)][_0x3603d7(0x13e)](_0xf7d658),{'verbose':_0x57b762[_0x3603d7(0x15b)]}),_0xe0f522=_0x412206[_0x3603d7(0x12c)];_0x57b762[_0x3603d7(0x15b)]&&(console['error'](_0x3603d7(0x131)+_0xe0f522[_0x3603d7(0x132)]),_0xe0f522[_0x3603d7(0x129)]&&console['error']('Folder\x20ID:\x20'+_0xe0f522[_0x3603d7(0x129)]));const _0x40a7e7=await withSpinner(_0x3603d7(0x151),()=>_0x3e0eda[_0x3603d7(0x15f)][_0x3603d7(0x143)](_0xe0f522['parentId'],_0xe0f522[_0x3603d7(0x129)]),{'verbose':_0x57b762[_0x3603d7(0x15b)]}),{folders:_0x5772c5,segments:_0x2c3f5f}=_0x40a7e7[_0x3603d7(0x12c)],_0x186497=_0x5772c5['length']+_0x2c3f5f[_0x3603d7(0x12a)];console[_0x3603d7(0x133)](_0x3603d7(0x12e)+_0x5772c5[_0x3603d7(0x12a)]+'\x20folder'+(_0x5772c5['length']!==0x1?'s':'')+_0x3603d7(0x166)+_0x2c3f5f['length']+_0x3603d7(0x165)+(_0x2c3f5f['length']!==0x1?'s':''));if(_0x57b762[_0x3603d7(0x135)]===_0x3603d7(0x160)||_0x57b762[_0x3603d7(0x135)]===_0x3603d7(0x154)){const _0x41fc78=[..._0x5772c5[_0x3603d7(0x15d)](_0x55f783=>({..._0x55f783,'type':_0x3603d7(0x155)})),..._0x2c3f5f[_0x3603d7(0x15d)](_0x278c15=>({..._0x278c15,'type':_0x3603d7(0x15f)}))][_0x3603d7(0x14e)]((_0x2efc06,_0xbcee2c)=>_0x2efc06[_0x3603d7(0x14d)]['localeCompare'](_0xbcee2c['name']));await handleSDKOutput(_0x41fc78,_0x57b762);}else{if(_0x186497===0x0)console[_0x3603d7(0x137)](a31_0x261bf0[_0x3603d7(0x12f)]('[/'+_0xf7d658+']')),console[_0x3603d7(0x137)](_0x3603d7(0x128));else{console[_0x3603d7(0x137)](a31_0x261bf0[_0x3603d7(0x12f)]('[/'+_0xf7d658+']'));const _0x98613a=formatFlatList(_0x5772c5,_0x2c3f5f,{'showMetadata':!![]});console[_0x3603d7(0x137)](_0x98613a);}}return 0x0;}async[a31_0x3472ad(0x14a)](_0x5b8b79,_0x52f306){const _0xae4b77=a31_0x3472ad,{options:_0x413e16,tdx:_0xd6fa5}=_0x5b8b79,_0x5ce794=await withSpinner(_0xae4b77(0x156)+_0x52f306+_0xae4b77(0x150),()=>_0xd6fa5[_0xae4b77(0x15f)][_0xae4b77(0x13e)](_0x52f306),{'verbose':_0x413e16[_0xae4b77(0x15b)]}),_0x1cccf5=_0x5ce794[_0xae4b77(0x12c)];_0x413e16[_0xae4b77(0x15b)]&&(console[_0xae4b77(0x133)](_0xae4b77(0x131)+_0x1cccf5[_0xae4b77(0x132)]),_0x1cccf5[_0xae4b77(0x129)]&&console['error']('Folder\x20ID:\x20'+_0x1cccf5[_0xae4b77(0x129)]));const _0x562c78=_0x413e16[_0xae4b77(0x149)]||0xa,_0x5b696d=await withSpinner(_0xae4b77(0x144),()=>_0xd6fa5[_0xae4b77(0x15f)]['listRecursive'](_0x1cccf5[_0xae4b77(0x132)],_0x1cccf5[_0xae4b77(0x129)],0x0,_0x562c78),{'verbose':_0x413e16[_0xae4b77(0x15b)]}),_0x43825a=_0x5b696d[_0xae4b77(0x12c)];console[_0xae4b77(0x133)]('✔\x20Built\x20tree\x20with\x20'+_0x43825a[_0xae4b77(0x12a)]+'\x20top-level\x20items');if(_0x413e16[_0xae4b77(0x135)]===_0xae4b77(0x160)||_0x413e16[_0xae4b77(0x135)]===_0xae4b77(0x154))await handleSDKOutput(_0x43825a,_0x413e16);else{console[_0xae4b77(0x137)](a31_0x261bf0[_0xae4b77(0x12f)]('[/'+_0x52f306+']'));const _0x1fb913=formatTree(_0x43825a,{'showMetadata':!![]});console['log'](_0x1fb913);}return 0x0;}}
@@ -1 +1 @@
1
- const a30_0x27b6a9=a30_0x1bbd;(function(_0x502da1,_0x1b1702){const _0x188db0=a30_0x1bbd,_0x31228b=_0x502da1();while(!![]){try{const _0x3ef125=-parseInt(_0x188db0(0xbc))/0x1+parseInt(_0x188db0(0xb6))/0x2*(-parseInt(_0x188db0(0xca))/0x3)+parseInt(_0x188db0(0xc2))/0x4+parseInt(_0x188db0(0xb1))/0x5+parseInt(_0x188db0(0xcf))/0x6*(-parseInt(_0x188db0(0xc6))/0x7)+parseInt(_0x188db0(0xb2))/0x8+-parseInt(_0x188db0(0xbb))/0x9*(-parseInt(_0x188db0(0xc7))/0xa);if(_0x3ef125===_0x1b1702)break;else _0x31228b['push'](_0x31228b['shift']());}catch(_0x43a616){_0x31228b['push'](_0x31228b['shift']());}}}(a30_0x96ea,0x65c32));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a30_0x96ea(){const _0x1c6314=['✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','33692lTQnJW','Site:\x20','site','execute','name','67950akNNNm','656366WnVSTF','table','\x20\x20Cause:\x20','Show\x20table\x20contents','error','args','2798792ENNynp','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','data','✔\x20Retrieved\x20','21CvgEJs','1440BxVpfD','message','cause','105hOdyEc','Usage:\x20tdx\x20show\x20<database.table>','\x20row','show','showTable','1604838ZYUMgA','Catalog:\x20','...','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','database','Error:\x20','length','1233580hciASi','3452792KquALt','\x20from\x20','Querying\x20'];a30_0x96ea=function(){return _0x1c6314;};return a30_0x96ea();}function a30_0x1bbd(_0x11d40d,_0x3796db){const _0x96ea17=a30_0x96ea();return a30_0x1bbd=function(_0x1bbd77,_0x26ff0b){_0x1bbd77=_0x1bbd77-0xab;let _0x53a665=_0x96ea17[_0x1bbd77];return _0x53a665;},a30_0x1bbd(_0x11d40d,_0x3796db);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a30_0x27b6a9(0xba)]=a30_0x27b6a9(0xcd);['description']=a30_0x27b6a9(0xbf);async[a30_0x27b6a9(0xb9)](_0x48d375){return this['showTable'](_0x48d375);}async[a30_0x27b6a9(0xce)](_0x336e98){const _0x2ea7e2=a30_0x27b6a9,{options:_0x559687,args:_0x3cc433,tdx:_0x52a9db}=_0x336e98;let _0x862563;try{_0x862563=parseTableReference(_0x3cc433[0x0]);const _0x16fa75=_0x559687[_0x2ea7e2(0xae)];!_0x862563[_0x2ea7e2(0xae)]&&_0x16fa75&&(_0x862563[_0x2ea7e2(0xae)]=_0x16fa75);const _0x9e819b=validateTableDescribeReference(_0x862563);if(_0x9e819b)return console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xaf)+_0x9e819b),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xcb)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x2ea7e2(0xc0)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x4baa9b){return console[_0x2ea7e2(0xc0)]('Error:\x20'+_0x4baa9b[_0x2ea7e2(0xc8)]),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xcb)),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xc3)),console[_0x2ea7e2(0xc0)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x2fb66d=_0x862563['catalog'],_0x96c9ed=_0x862563[_0x2ea7e2(0xae)],_0x42df2d=_0x862563[_0x2ea7e2(0xbd)],_0x473758=resolveLimit(_0x559687['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x559687['verbose']&&(console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xb7)+_0x559687[_0x2ea7e2(0xb8)]),_0x2fb66d&&console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xab)+_0x2fb66d),console[_0x2ea7e2(0xc0)]('Database:\x20'+_0x96c9ed),console[_0x2ea7e2(0xc0)]('Table:\x20'+_0x42df2d),console[_0x2ea7e2(0xc0)]('Limit:\x20'+_0x473758));const _0x3d8619=_0x2fb66d?_0x2fb66d+'.'+_0x96c9ed+'.'+_0x42df2d:_0x96c9ed+'.'+_0x42df2d,_0xc6fca3=await withSpinner(_0x2ea7e2(0xb4)+_0x3d8619+_0x2ea7e2(0xac),()=>_0x52a9db['query'][_0x2ea7e2(0xce)](_0x96c9ed,_0x42df2d,_0x473758,_0x2fb66d),{'verbose':_0x559687['verbose']}),_0x2fbacd=_0xc6fca3[_0x2ea7e2(0xc4)],_0x3dfe09=_0x2fbacd[_0x2ea7e2(0xc4)];return _0x3dfe09[_0x2ea7e2(0xb0)]===0x0?console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xb5)):console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xc5)+_0x3dfe09['length']+_0x2ea7e2(0xcc)+(_0x3dfe09[_0x2ea7e2(0xb0)]!==0x1?'s':'')+_0x2ea7e2(0xb3)+_0x3d8619),await handleSDKOutput(_0x3dfe09,_0x559687),0x0;}catch(_0x21d4f4){if(_0x21d4f4 instanceof SDKError)return console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xaf)+_0x21d4f4[_0x2ea7e2(0xc8)]),_0x21d4f4[_0x2ea7e2(0xc9)]&&console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xbe)+_0x21d4f4[_0x2ea7e2(0xc9)]),0x1;throw _0x21d4f4;}}['validate'](_0x20a777){const _0x18f656=a30_0x27b6a9;if(_0x20a777['args']['length']===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x20a777[_0x18f656(0xc1)]['length']>0x1)return _0x18f656(0xad);return undefined;}}
1
+ function a32_0x1bff(){const _0x364879=['cause','27007640veiJjq','475846WYMPSO','Database:\x20','Limit:\x20','data','5354503AugtQB','Show\x20table\x20contents','\x20row','database','\x20from\x20','Usage:\x20tdx\x20show\x20<database.table>','9thvAKU','868236nJbQxG','6217380XSYMPM','371388iNduVq','error','\x20\x20Cause:\x20','1359017wpnRpn','name','Table:\x20','site','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Error:\x20','table','args','validate','Site:\x20','12cKaVHH','message','...','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','verbose','limit'];a32_0x1bff=function(){return _0x364879;};return a32_0x1bff();}const a32_0x3ca521=a32_0x3187;function a32_0x3187(_0x4dc7de,_0x527f7a){const _0x1bff1a=a32_0x1bff();return a32_0x3187=function(_0x318748,_0x3fcc9b){_0x318748=_0x318748-0x155;let _0x1fb040=_0x1bff1a[_0x318748];return _0x1fb040;},a32_0x3187(_0x4dc7de,_0x527f7a);}(function(_0x361cd6,_0x133561){const _0x2e9e23=a32_0x3187,_0x5f84ee=_0x361cd6();while(!![]){try{const _0x15bc15=-parseInt(_0x2e9e23(0x165))/0x1+-parseInt(_0x2e9e23(0x155))/0x2+parseInt(_0x2e9e23(0x16f))/0x3*(parseInt(_0x2e9e23(0x160))/0x4)+-parseInt(_0x2e9e23(0x161))/0x5+parseInt(_0x2e9e23(0x162))/0x6+-parseInt(_0x2e9e23(0x159))/0x7+parseInt(_0x2e9e23(0x179))/0x8*(parseInt(_0x2e9e23(0x15f))/0x9);if(_0x15bc15===_0x133561)break;else _0x5f84ee['push'](_0x5f84ee['shift']());}catch(_0x47cbb8){_0x5f84ee['push'](_0x5f84ee['shift']());}}}(a32_0x1bff,0xab148));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a32_0x3ca521(0x166)]='show';['description']=a32_0x3ca521(0x15a);async['execute'](_0x422a23){return this['showTable'](_0x422a23);}async['showTable'](_0x5597ec){const _0x4b74e8=a32_0x3ca521,{options:_0x168d2e,args:_0x411d81,tdx:_0x4a7367}=_0x5597ec;let _0x332b95;try{_0x332b95=parseTableReference(_0x411d81[0x0]);const _0x87583=_0x168d2e[_0x4b74e8(0x15c)];!_0x332b95[_0x4b74e8(0x15c)]&&_0x87583&&(_0x332b95[_0x4b74e8(0x15c)]=_0x87583);const _0x20cf72=validateTableDescribeReference(_0x332b95);if(_0x20cf72)return console[_0x4b74e8(0x163)](_0x4b74e8(0x16a)+_0x20cf72),console[_0x4b74e8(0x163)](_0x4b74e8(0x15e)),console[_0x4b74e8(0x163)](_0x4b74e8(0x169)),console[_0x4b74e8(0x163)](_0x4b74e8(0x174)),0x1;}catch(_0x48f0a5){return console[_0x4b74e8(0x163)](_0x4b74e8(0x16a)+_0x48f0a5[_0x4b74e8(0x170)]),console[_0x4b74e8(0x163)](_0x4b74e8(0x15e)),console[_0x4b74e8(0x163)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x4b74e8(0x174)),0x1;}const _0x101b07=_0x332b95['catalog'],_0x465ec8=_0x332b95['database'],_0x4a76a3=_0x332b95[_0x4b74e8(0x16b)],_0x9ae95d=resolveLimit(_0x168d2e[_0x4b74e8(0x177)],DEFAULT_DISPLAY_LIMIT);try{_0x168d2e[_0x4b74e8(0x176)]&&(console[_0x4b74e8(0x163)](_0x4b74e8(0x16e)+_0x168d2e[_0x4b74e8(0x168)]),_0x101b07&&console[_0x4b74e8(0x163)]('Catalog:\x20'+_0x101b07),console[_0x4b74e8(0x163)](_0x4b74e8(0x156)+_0x465ec8),console[_0x4b74e8(0x163)](_0x4b74e8(0x167)+_0x4a76a3),console[_0x4b74e8(0x163)](_0x4b74e8(0x157)+_0x9ae95d));const _0x4ab16d=_0x101b07?_0x101b07+'.'+_0x465ec8+'.'+_0x4a76a3:_0x465ec8+'.'+_0x4a76a3,_0x5c8c62=await withSpinner('Querying\x20'+_0x4ab16d+_0x4b74e8(0x171),()=>_0x4a7367['query']['showTable'](_0x465ec8,_0x4a76a3,_0x9ae95d,_0x101b07),{'verbose':_0x168d2e[_0x4b74e8(0x176)]}),_0x326480=_0x5c8c62[_0x4b74e8(0x158)],_0x9a70b9=_0x326480[_0x4b74e8(0x158)];return _0x9a70b9[_0x4b74e8(0x173)]===0x0?console[_0x4b74e8(0x163)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x4b74e8(0x163)]('✔\x20Retrieved\x20'+_0x9a70b9[_0x4b74e8(0x173)]+_0x4b74e8(0x15b)+(_0x9a70b9[_0x4b74e8(0x173)]!==0x1?'s':'')+_0x4b74e8(0x15d)+_0x4ab16d),await handleSDKOutput(_0x9a70b9,_0x168d2e),0x0;}catch(_0x154779){if(_0x154779 instanceof SDKError)return console[_0x4b74e8(0x163)](_0x4b74e8(0x16a)+_0x154779[_0x4b74e8(0x170)]),_0x154779[_0x4b74e8(0x178)]&&console[_0x4b74e8(0x163)](_0x4b74e8(0x164)+_0x154779['cause']),0x1;throw _0x154779;}}[a32_0x3ca521(0x16d)](_0x3a1d3d){const _0x57d7d5=a32_0x3ca521;if(_0x3a1d3d[_0x57d7d5(0x16c)]['length']===0x0)return _0x57d7d5(0x172);if(_0x3a1d3d[_0x57d7d5(0x16c)][_0x57d7d5(0x173)]>0x1)return _0x57d7d5(0x175);return undefined;}}