@treasuredata/tdx 2026.3.15 → 2026.3.16

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 (202) hide show
  1. package/README.md +9 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/query/index.js +1 -1
  127. package/dist/sdk/query/sql-parser.js +1 -1
  128. package/dist/sdk/realtime.js +1 -1
  129. package/dist/sdk/schedule.js +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/fields-display.js +1 -1
  132. package/dist/sdk/segment/file-discovery.js +1 -1
  133. package/dist/sdk/segment/journey-utils.js +1 -1
  134. package/dist/sdk/segment/journey-validator.js +1 -1
  135. package/dist/sdk/segment/journey-yaml.js +1 -1
  136. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  137. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  138. package/dist/sdk/segment/pull-workflow.js +1 -1
  139. package/dist/sdk/segment/push-recovery.js +1 -1
  140. package/dist/sdk/segment/push-workflow.js +1 -1
  141. package/dist/sdk/segment/resolution-context.js +1 -1
  142. package/dist/sdk/segment/segment-path-parser.js +1 -1
  143. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  144. package/dist/sdk/segment/segment-validator.js +1 -1
  145. package/dist/sdk/segment/target-resolution.js +1 -1
  146. package/dist/sdk/segment/tdx-config.js +1 -1
  147. package/dist/sdk/segment/types/activation-schema.js +1 -1
  148. package/dist/sdk/segment/types/journey-def.js +1 -1
  149. package/dist/sdk/segment/types/journey-schema.js +1 -1
  150. package/dist/sdk/segment/types/segment-def.js +1 -1
  151. package/dist/sdk/segment/types/segment-schema.js +1 -1
  152. package/dist/sdk/segment/validate-files.js +1 -1
  153. package/dist/sdk/segment/yaml-validator.js +1 -1
  154. package/dist/sdk/segment.js +1 -1
  155. package/dist/sdk/types/index.js +1 -1
  156. package/dist/sdk/types/progress.js +1 -1
  157. package/dist/sdk/user.js +1 -1
  158. package/dist/sdk/util/format-detector.js +1 -1
  159. package/dist/sdk/util/formatters.js +1 -1
  160. package/dist/sdk/util/index.js +1 -1
  161. package/dist/sdk/util/paginate.js +1 -1
  162. package/dist/sdk/util/tree-formatter.js +1 -1
  163. package/dist/sdk/workflow/archive-validation.js +1 -1
  164. package/dist/sdk/workflow/clone-workflow.js +1 -1
  165. package/dist/sdk/workflow/index.js +1 -1
  166. package/dist/sdk/workflow/pull-workflow.js +1 -1
  167. package/dist/sdk/workflow/push-workflow.js +1 -1
  168. package/dist/sdk/workflow/tdx-config.js +1 -1
  169. package/dist/sdk/workflow/workflow-utils.js +1 -1
  170. package/dist/test-utils/command-runner.js +1 -1
  171. package/dist/test-utils/factories.js +1 -1
  172. package/dist/test-utils/fixtures.js +1 -1
  173. package/dist/test-utils/http-mock.js +1 -1
  174. package/dist/test-utils/index.js +1 -1
  175. package/dist/utils/async.js +1 -1
  176. package/dist/utils/colors.js +1 -1
  177. package/dist/utils/diff.js +1 -1
  178. package/dist/utils/file-permissions.js +1 -1
  179. package/dist/utils/file-reader.js +1 -1
  180. package/dist/utils/github-releases.js +1 -1
  181. package/dist/utils/global-cache.js +1 -1
  182. package/dist/utils/json-loader.js +1 -1
  183. package/dist/utils/local-cache.js +1 -1
  184. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  185. package/dist/utils/logger/formatters/index.js +1 -1
  186. package/dist/utils/logger/handlers/console-handler.js +1 -1
  187. package/dist/utils/logger/handlers/file-handler.js +1 -1
  188. package/dist/utils/logger/handlers/index.js +1 -1
  189. package/dist/utils/logger/handlers/null-handler.js +1 -1
  190. package/dist/utils/logger/index.js +1 -1
  191. package/dist/utils/logger/logger.js +1 -1
  192. package/dist/utils/logger/types.js +1 -1
  193. package/dist/utils/option-validation.js +1 -1
  194. package/dist/utils/process.js +1 -1
  195. package/dist/utils/prompt.js +1 -1
  196. package/dist/utils/spinner.js +1 -1
  197. package/dist/utils/sse-parser.js +1 -1
  198. package/dist/utils/string-utils.js +1 -1
  199. package/dist/utils/table-ref-parser.js +1 -1
  200. package/dist/utils/tdx-logger.js +1 -1
  201. package/dist/utils/version-check.js +1 -1
  202. package/package.json +2 -2
@@ -1 +1 @@
1
- const a40_0x2b90c7=a40_0x16f2;(function(_0x1c4758,_0x15ad26){const _0x430242=a40_0x16f2,_0x220ee=_0x1c4758();while(!![]){try{const _0x347223=parseInt(_0x430242(0x17a))/0x1+-parseInt(_0x430242(0x19c))/0x2+parseInt(_0x430242(0x19b))/0x3*(parseInt(_0x430242(0x1a2))/0x4)+parseInt(_0x430242(0x186))/0x5*(-parseInt(_0x430242(0x183))/0x6)+parseInt(_0x430242(0x1a3))/0x7*(-parseInt(_0x430242(0x1a5))/0x8)+parseInt(_0x430242(0x18c))/0x9*(-parseInt(_0x430242(0x190))/0xa)+parseInt(_0x430242(0x1a4))/0xb;if(_0x347223===_0x15ad26)break;else _0x220ee['push'](_0x220ee['shift']());}catch(_0x30e82a){_0x220ee['push'](_0x220ee['shift']());}}}(a40_0x29e2,0xb45c0));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a40_0x29e2(){const _0xcc9f89=['3kcsMHG','2134802jCPEYF','INTERNAL','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','Segment\x20ID:\x20','Examples:','1715864SKMoOs','57295VcAxbz','44593516BUbEWI','808ncnxHw','Resolved\x20folder\x20ID:\x20','kind','rule','error','577741cYCgqm','Update\x20existing\x20child\x20segment','Parent\x20ID:\x20','segmentName','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','yellow','\x20\x20\x20Path:\x20','segmentPath','description','6beOBsX','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','parentId','7371435VrVqcO','resolvePathToResource','verbose','segment','type','Error:\x20Cannot\x20update\x20','8581842dZQQRP','✔\x20Updated\x20segment\x20\x27','folder','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','10hNvjWb','Resolving\x20path\x20\x27','execute','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x27...','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','resolveFolderId','length','data','name'];a40_0x29e2=function(){return _0xcc9f89;};return a40_0x29e2();}import{SDKError,ErrorCode}from'../sdk/index.js';import a40_0x2fb233 from'chalk';function a40_0x16f2(_0x4c6dab,_0x356bf4){_0x4c6dab=_0x4c6dab-0x176;const _0x29e29a=a40_0x29e2();let _0x16f216=_0x29e29a[_0x4c6dab];return _0x16f216;}export class SegmentUpdateCommand extends BaseCommand{[a40_0x2b90c7(0x19a)]='segment:update';['description']=a40_0x2b90c7(0x17b);async[a40_0x2b90c7(0x192)](_0x289f2f){const _0x21786d=a40_0x2b90c7;console['error'](a40_0x2fb233[_0x21786d(0x17f)](_0x21786d(0x195))),console[_0x21786d(0x179)](a40_0x2fb233[_0x21786d(0x17f)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5e1881,args:_0x459626,tdx:_0x256dbc}=_0x289f2f,_0x40254a=_0x5e1881;if(_0x459626[_0x21786d(0x198)]===0x0)return console['error'](_0x21786d(0x18f)),console[_0x21786d(0x179)](_0x21786d(0x19e)),console[_0x21786d(0x179)](_0x21786d(0x1a1)),console[_0x21786d(0x179)](_0x21786d(0x17e)),console[_0x21786d(0x179)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2672bd=_0x459626[0x0],_0x43e503=_0x5e1881[_0x21786d(0x181)];let _0x31402a=_0x2672bd;_0x43e503&&!_0x2672bd['includes']('/')&&(_0x31402a=_0x43e503+'/'+_0x2672bd,_0x40254a[_0x21786d(0x188)]&&console['error'](_0x21786d(0x19f)+_0x31402a));const _0x14fbd2=await withSpinner(_0x21786d(0x191)+_0x31402a+_0x21786d(0x194),()=>_0x256dbc[_0x21786d(0x189)][_0x21786d(0x187)](_0x31402a),{'verbose':_0x40254a[_0x21786d(0x188)]}),_0x52df01=_0x14fbd2[_0x21786d(0x199)];_0x40254a[_0x21786d(0x188)]&&console[_0x21786d(0x179)]('Resolved\x20type:\x20'+_0x52df01['type']);if(_0x52df01[_0x21786d(0x18a)]!==_0x21786d(0x189))return console['error'](_0x21786d(0x18b)+_0x52df01[_0x21786d(0x18a)]+_0x21786d(0x193)),console[_0x21786d(0x179)](_0x21786d(0x184)),0x1;if(!_0x52df01['segmentId'])throw new SDKError(ErrorCode[_0x21786d(0x19d)],_0x21786d(0x196));const _0x1abce0=_0x52df01[_0x21786d(0x185)],_0x21599c=_0x52df01['segmentId'];_0x40254a['verbose']&&(console[_0x21786d(0x179)](_0x21786d(0x17c)+_0x1abce0),console['error'](_0x21786d(0x1a0)+_0x21599c));let _0x3de93d;if(_0x40254a[_0x21786d(0x18e)]){const _0xe9a1e5=_0x40254a['folder'],_0x502b1b=await withSpinner('Resolving\x20folder\x20\x27'+_0xe9a1e5+_0x21786d(0x194),()=>_0x256dbc[_0x21786d(0x189)][_0x21786d(0x197)](_0x1abce0,_0xe9a1e5),{'verbose':_0x40254a[_0x21786d(0x188)]});_0x3de93d=parseInt(_0x502b1b[_0x21786d(0x199)],0xa),_0x40254a[_0x21786d(0x188)]&&console[_0x21786d(0x179)](_0x21786d(0x176)+_0x3de93d);}const _0x6ad7e1=await loadJSONFromOptions(_0x40254a[_0x21786d(0x178)],_0x40254a['ruleFile']),_0x2ec66a={'name':_0x40254a[_0x21786d(0x19a)],'description':_0x40254a[_0x21786d(0x182)],'rule':_0x6ad7e1,'kind':_0x40254a[_0x21786d(0x177)]!==undefined?parseInt(_0x40254a['kind'],0xa):undefined,'segmentFolderId':_0x3de93d},_0x54c670=await withSpinner('Updating\x20segment\x20\x27'+_0x52df01[_0x21786d(0x17d)]+_0x21786d(0x194),()=>_0x256dbc[_0x21786d(0x189)]['updateSegmentById'](_0x1abce0,_0x21599c,_0x2ec66a),{'verbose':_0x40254a['verbose']}),_0x5a3d18=_0x54c670[_0x21786d(0x199)];return console[_0x21786d(0x179)](_0x21786d(0x18d)+_0x5a3d18[_0x21786d(0x19a)]+'\x27'),_0x31402a!==_0x2672bd&&console['error'](_0x21786d(0x180)+_0x31402a),await handleSDKOutput([_0x5a3d18],_0x40254a),0x0;}}
1
+ const a40_0x4e1aa5=a40_0x13a9;(function(_0x1e479b,_0x2421ec){const _0x19ee92=a40_0x13a9,_0x585b0b=_0x1e479b();while(!![]){try{const _0x1153ba=-parseInt(_0x19ee92(0x1e6))/0x1+-parseInt(_0x19ee92(0x1c4))/0x2+parseInt(_0x19ee92(0x1cb))/0x3+-parseInt(_0x19ee92(0x1cf))/0x4+-parseInt(_0x19ee92(0x1dc))/0x5*(-parseInt(_0x19ee92(0x1d8))/0x6)+-parseInt(_0x19ee92(0x1c1))/0x7+parseInt(_0x19ee92(0x1e4))/0x8;if(_0x1153ba===_0x2421ec)break;else _0x585b0b['push'](_0x585b0b['shift']());}catch(_0x47b040){_0x585b0b['push'](_0x585b0b['shift']());}}}(a40_0x20a3,0x850fa));function a40_0x20a3(){const _0x88e5af=['segment:update','ruleFile','\x20\x20\x20Path:\x20','name','description','parentId','32586PGqewI','data','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','type','595WUUyYD','folder','resolveFolderId','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Updating\x20segment\x20\x27','segment','Update\x20existing\x20child\x20segment','updateSegmentById','13514544kPwkyh','yellow','83484IZEeLi','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segmentId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x27...','4345432QQBHcz','resolvePathToResource','Parent\x20ID:\x20','1369702WHouCi','error','rule','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','Resolved\x20type:\x20','kind','1450065tXRIqv','segmentName','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','length','3539332ryHIqA','verbose','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'];a40_0x20a3=function(){return _0x88e5af;};return a40_0x20a3();}import{BaseCommand}from'./command.js';function a40_0x13a9(_0x5eb32e,_0xa871dc){_0x5eb32e=_0x5eb32e-0x1c0;const _0x20a3f0=a40_0x20a3();let _0x13a981=_0x20a3f0[_0x5eb32e];return _0x13a981;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a40_0x31846f from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a40_0x4e1aa5(0x1d2);[a40_0x4e1aa5(0x1d6)]=a40_0x4e1aa5(0x1e2);async[a40_0x4e1aa5(0x1c8)](_0x965e30){const _0xdb2169=a40_0x4e1aa5;console[_0xdb2169(0x1c5)](a40_0x31846f[_0xdb2169(0x1e5)](_0xdb2169(0x1cd))),console[_0xdb2169(0x1c5)](a40_0x31846f[_0xdb2169(0x1e5)](_0xdb2169(0x1e9)));const {options:_0x3b0ccc,args:_0x4ee074,tdx:_0x38c657}=_0x965e30,_0x102728=_0x3b0ccc;if(_0x4ee074[_0xdb2169(0x1ce)]===0x0)return console[_0xdb2169(0x1c5)](_0xdb2169(0x1c7)),console['error'](_0xdb2169(0x1da)),console[_0xdb2169(0x1c5)]('Examples:'),console[_0xdb2169(0x1c5)](_0xdb2169(0x1d1)),console[_0xdb2169(0x1c5)](_0xdb2169(0x1df)),0x1;const _0x268e1c=_0x4ee074[0x0],_0xc8a21e=_0x3b0ccc['segmentPath'];let _0x9f14d5=_0x268e1c;_0xc8a21e&&!_0x268e1c['includes']('/')&&(_0x9f14d5=_0xc8a21e+'/'+_0x268e1c,_0x102728['verbose']&&console[_0xdb2169(0x1c5)]('Resolved\x20relative\x20path\x20to:\x20'+_0x9f14d5));const _0x415992=await withSpinner('Resolving\x20path\x20\x27'+_0x9f14d5+'\x27...',()=>_0x38c657[_0xdb2169(0x1e1)][_0xdb2169(0x1c2)](_0x9f14d5),{'verbose':_0x102728[_0xdb2169(0x1d0)]}),_0x4aaf98=_0x415992[_0xdb2169(0x1d9)];_0x102728['verbose']&&console[_0xdb2169(0x1c5)](_0xdb2169(0x1c9)+_0x4aaf98[_0xdb2169(0x1db)]);if(_0x4aaf98[_0xdb2169(0x1db)]!=='segment')return console['error']('Error:\x20Cannot\x20update\x20'+_0x4aaf98[_0xdb2169(0x1db)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0xdb2169(0x1c5)](_0xdb2169(0x1e7)),0x1;if(!_0x4aaf98[_0xdb2169(0x1e8)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x487c11=_0x4aaf98[_0xdb2169(0x1d7)],_0x2f4f54=_0x4aaf98[_0xdb2169(0x1e8)];_0x102728[_0xdb2169(0x1d0)]&&(console[_0xdb2169(0x1c5)](_0xdb2169(0x1c3)+_0x487c11),console[_0xdb2169(0x1c5)]('Segment\x20ID:\x20'+_0x2f4f54));let _0x343016;if(_0x102728[_0xdb2169(0x1dd)]){const _0x1e74a1=_0x102728[_0xdb2169(0x1dd)],_0x392f68=await withSpinner('Resolving\x20folder\x20\x27'+_0x1e74a1+_0xdb2169(0x1c0),()=>_0x38c657['segment'][_0xdb2169(0x1de)](_0x487c11,_0x1e74a1),{'verbose':_0x102728['verbose']});_0x343016=parseInt(_0x392f68['data'],0xa),_0x102728[_0xdb2169(0x1d0)]&&console[_0xdb2169(0x1c5)]('Resolved\x20folder\x20ID:\x20'+_0x343016);}const _0x178390=await loadJSONFromOptions(_0x102728[_0xdb2169(0x1c6)],_0x102728[_0xdb2169(0x1d3)]),_0x49ff98={'name':_0x102728['name'],'description':_0x102728[_0xdb2169(0x1d6)],'rule':_0x178390,'kind':_0x102728[_0xdb2169(0x1ca)]!==undefined?parseInt(_0x102728['kind'],0xa):undefined,'segmentFolderId':_0x343016},_0x520c4d=await withSpinner(_0xdb2169(0x1e0)+_0x4aaf98[_0xdb2169(0x1cc)]+_0xdb2169(0x1c0),()=>_0x38c657[_0xdb2169(0x1e1)][_0xdb2169(0x1e3)](_0x487c11,_0x2f4f54,_0x49ff98),{'verbose':_0x102728[_0xdb2169(0x1d0)]}),_0x55495c=_0x520c4d[_0xdb2169(0x1d9)];return console[_0xdb2169(0x1c5)]('✔\x20Updated\x20segment\x20\x27'+_0x55495c[_0xdb2169(0x1d5)]+'\x27'),_0x9f14d5!==_0x268e1c&&console['error'](_0xdb2169(0x1d4)+_0x9f14d5),await handleSDKOutput([_0x55495c],_0x102728),0x0;}}
@@ -1 +1 @@
1
- const a41_0x344d73=a41_0x4b53;(function(_0x2c2bf0,_0x3485f0){const _0x1ab4ea=a41_0x4b53,_0x332e8c=_0x2c2bf0();while(!![]){try{const _0x30a259=parseInt(_0x1ab4ea(0x132))/0x1+parseInt(_0x1ab4ea(0x135))/0x2+parseInt(_0x1ab4ea(0x131))/0x3+parseInt(_0x1ab4ea(0x108))/0x4*(parseInt(_0x1ab4ea(0x12d))/0x5)+parseInt(_0x1ab4ea(0x121))/0x6*(-parseInt(_0x1ab4ea(0x10f))/0x7)+parseInt(_0x1ab4ea(0x105))/0x8+parseInt(_0x1ab4ea(0x109))/0x9*(-parseInt(_0x1ab4ea(0x10e))/0xa);if(_0x30a259===_0x3485f0)break;else _0x332e8c['push'](_0x332e8c['shift']());}catch(_0x4a995b){_0x332e8c['push'](_0x332e8c['shift']());}}}(a41_0x4bd3,0xe8a26));import{existsSync,statSync}from'fs';function a41_0x4b53(_0x54e57d,_0x1c86ac){_0x54e57d=_0x54e57d-0x104;const _0x4bd3c4=a41_0x4bd3();let _0x4b53cd=_0x4bd3c4[_0x54e57d];return _0x4b53cd;}import a41_0x14c6f7 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a41_0x4bd3(){const _0x30f861=['execute','2036AUKKOd','9087678tpjRtZ','\x27...','session','log','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','20VYtzTa','273flCgQb','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','folderPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','✔\x20Context\x20set\x20to:\x20','type','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','error','segment:use','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','data','verbose','parentName','green','split','isDirectory','229494mYMDxR','Folder\x20ID:\x20','Site:\x20','slice','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','red','description','Target\x20path:\x20','resolvePathToResource','name','parentId','dim','160uAEYBV','Resolved\x20relative\x20path\x20to:\x20','parent_segment','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','5064246YPLKGi','1079704yMblxT','Use:\x20tdx\x20segment\x20use\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','711738CxQleU','segment','cyan','length','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','folderId','Error:\x20Path\x20is\x20required\x0a','join','Parent\x20ID:\x20','isAbsolute','10592976HeiqWs','config'];a41_0x4bd3=function(){return _0x30f861;};return a41_0x4bd3();}export class SegmentUseCommand extends BaseCommand{[a41_0x344d73(0x12a)]=a41_0x344d73(0x119);[a41_0x344d73(0x127)]=a41_0x344d73(0x111);async[a41_0x344d73(0x107)](_0x574120){const _0x2d7940=a41_0x344d73,{options:_0x3cd322,args:_0x5a789d,tdx:_0x5994bc}=_0x574120;if(_0x5a789d[_0x2d7940(0x138)]===0x0)return console['error'](a41_0x14c6f7[_0x2d7940(0x126)](_0x2d7940(0x13c))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error']('Examples:'),console[_0x2d7940(0x118)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x2d7940(0x118)](_0x2d7940(0x117)),console[_0x2d7940(0x118)](_0x2d7940(0x11a)),console['error'](_0x2d7940(0x134)),0x1;const _0x304021=_0x5a789d[0x0],_0x5c8edb=_0x3cd322[_0x2d7940(0x10b)];try{if(_0x304021==='/')return saveSessionContext({'segment_path':undefined},_0x5c8edb),console[_0x2d7940(0x10c)](a41_0x14c6f7['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x304021)&&statSync(_0x304021)[_0x2d7940(0x120)]()){let _0x5fd343;try{_0x5fd343=findTdxConfig(_0x304021);}catch{return console['error'](a41_0x14c6f7[_0x2d7940(0x126)](_0x2d7940(0x10d)+_0x304021)),console[_0x2d7940(0x118)](a41_0x14c6f7[_0x2d7940(0x137)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x474763=_0x5fd343[_0x2d7940(0x106)][_0x2d7940(0x12f)];return saveSessionContext({'segment_path':_0x474763,'parent_segment':_0x474763},_0x5c8edb),console[_0x2d7940(0x10c)](a41_0x14c6f7['green'](_0x2d7940(0x114)+a41_0x14c6f7[_0x2d7940(0x137)](_0x474763))),0x0;}const _0x71aa09=_0x3cd322['segmentPath'];let _0x5eb4b8=_0x304021;const _0x2e5307=parsePath(_0x304021);if(!_0x2e5307[_0x2d7940(0x104)]){if(!_0x71aa09)return console[_0x2d7940(0x118)](a41_0x14c6f7[_0x2d7940(0x126)](_0x2d7940(0x130))),console[_0x2d7940(0x118)](a41_0x14c6f7[_0x2d7940(0x137)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x304021==='..'){const _0x51c0b6=_0x71aa09[_0x2d7940(0x11f)]('/')[_0x2d7940(0x124)](0x0,-0x1)['join']('/');_0x5eb4b8=_0x51c0b6||'/';}else _0x304021==='.'?_0x5eb4b8=_0x71aa09:_0x5eb4b8=_0x71aa09+'/'+_0x304021;_0x3cd322['verbose']&&console[_0x2d7940(0x118)](_0x2d7940(0x12e)+_0x5eb4b8);}if(_0x5eb4b8==='/'||_0x5eb4b8==='')return saveSessionContext({'segment_path':undefined},_0x5c8edb),console[_0x2d7940(0x10c)](a41_0x14c6f7[_0x2d7940(0x11e)](_0x2d7940(0x113))),0x0;_0x5eb4b8=normalizePath(_0x5eb4b8);const _0x5d4f77=parsePath(_0x5eb4b8)['segments'];if(_0x5d4f77[_0x2d7940(0x138)]===0x0)return saveSessionContext({'segment_path':undefined},_0x5c8edb),console[_0x2d7940(0x10c)](a41_0x14c6f7[_0x2d7940(0x11e)](_0x2d7940(0x113))),0x0;_0x3cd322[_0x2d7940(0x11c)]&&(console[_0x2d7940(0x118)](_0x2d7940(0x123)+_0x3cd322['site']),console[_0x2d7940(0x118)](_0x2d7940(0x128)+_0x5eb4b8));const _0x4cfa97=await withSpinner('Resolving\x20path\x20\x27'+_0x5eb4b8+_0x2d7940(0x10a),()=>_0x5994bc[_0x2d7940(0x136)][_0x2d7940(0x129)](_0x5eb4b8),{'verbose':_0x3cd322['verbose']}),_0x10b35e=_0x4cfa97[_0x2d7940(0x11b)];_0x3cd322[_0x2d7940(0x11c)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x10b35e['type']),console[_0x2d7940(0x118)](_0x2d7940(0x13e)+_0x10b35e[_0x2d7940(0x12b)]),_0x10b35e['folderId']&&console[_0x2d7940(0x118)](_0x2d7940(0x122)+_0x10b35e[_0x2d7940(0x13b)]));if(_0x10b35e[_0x2d7940(0x115)]===_0x2d7940(0x136))return console[_0x2d7940(0x118)](a41_0x14c6f7['red'](_0x2d7940(0x125))),console[_0x2d7940(0x118)](_0x2d7940(0x139)),console[_0x2d7940(0x118)](a41_0x14c6f7[_0x2d7940(0x137)](_0x2d7940(0x133)+_0x10b35e[_0x2d7940(0x11d)]+(_0x10b35e[_0x2d7940(0x112)]?'/'+_0x10b35e[_0x2d7940(0x112)][_0x2d7940(0x13d)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x10b35e[_0x2d7940(0x110)],'parent_segment':_0x10b35e['parentName']},_0x5c8edb),console['log'](a41_0x14c6f7[_0x2d7940(0x11e)](_0x2d7940(0x114)+a41_0x14c6f7[_0x2d7940(0x137)](_0x10b35e['fullPath']))),_0x3cd322[_0x2d7940(0x11c)]&&(console[_0x2d7940(0x118)](a41_0x14c6f7[_0x2d7940(0x12c)](_0x2d7940(0x116))),console[_0x2d7940(0x118)](a41_0x14c6f7[_0x2d7940(0x12c)](_0x2d7940(0x13a)))),0x0;}catch(_0x2333eb){throw _0x2333eb;}}}
1
+ const a41_0x308807=a41_0x3d48;(function(_0x126394,_0x4b6dbb){const _0x4e345d=a41_0x3d48,_0x22a4e0=_0x126394();while(!![]){try{const _0x49c2a7=parseInt(_0x4e345d(0x138))/0x1+parseInt(_0x4e345d(0x149))/0x2+parseInt(_0x4e345d(0x135))/0x3*(parseInt(_0x4e345d(0x13b))/0x4)+parseInt(_0x4e345d(0x141))/0x5*(parseInt(_0x4e345d(0x12b))/0x6)+-parseInt(_0x4e345d(0x11c))/0x7*(parseInt(_0x4e345d(0x114))/0x8)+-parseInt(_0x4e345d(0x126))/0x9+-parseInt(_0x4e345d(0x120))/0xa*(parseInt(_0x4e345d(0x140))/0xb);if(_0x49c2a7===_0x4b6dbb)break;else _0x22a4e0['push'](_0x22a4e0['shift']());}catch(_0x80b40f){_0x22a4e0['push'](_0x22a4e0['shift']());}}}(a41_0x579e,0x64960));import{existsSync,statSync}from'fs';import a41_0x40285b from'chalk';import{BaseCommand}from'./command.js';function a41_0x579e(){const _0x13e15e=['49220ybxTtw','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','log','error','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','22ZZTDDR','2630TyjfbB','✔\x20Context\x20set\x20to:\x20','folderPath','verbose','parent_segment','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','cyan','875248DJUFpt','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','length','Examples:','416cZjhZf','description','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','slice','Target\x20path:\x20','Folder\x20ID:\x20','split','\x27...','90706cTMyVe','Usage:\x20tdx\x20segment\x20use\x20<path>','isAbsolute','isDirectory','338200cBDxYS','Site:\x20','Parent\x20ID:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','1667781PfAvRC','red','segmentPath','parentName','Resolving\x20path\x20\x27','2724TvubFI','folderId','data','site','name','Use:\x20tdx\x20segment\x20use\x20','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#\x20Go\x20to\x20parent','join','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','141WlZxRR','type','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','84002cytHHj','green','execute'];a41_0x579e=function(){return _0x13e15e;};return a41_0x579e();}import{saveSessionContext}from'../core/session.js';function a41_0x3d48(_0x28e5dc,_0x585da6){_0x28e5dc=_0x28e5dc-0x112;const _0x579eaa=a41_0x579e();let _0x3d4887=_0x579eaa[_0x28e5dc];return _0x3d4887;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a41_0x308807(0x12f)]='segment:use';[a41_0x308807(0x115)]=a41_0x308807(0x13c);async[a41_0x308807(0x13a)](_0x169885){const _0x368526=a41_0x308807,{options:_0x19b4c7,args:_0x32106c,tdx:_0x3fef8a}=_0x169885;if(_0x32106c[_0x368526(0x112)]===0x0)return console['error'](a41_0x40285b[_0x368526(0x127)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x368526(0x13e)](_0x368526(0x11d)),console[_0x368526(0x13e)](_0x368526(0x113)),console[_0x368526(0x13e)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x368526(0x13e)](_0x368526(0x13f)),console[_0x368526(0x13e)](_0x368526(0x134)),console[_0x368526(0x13e)](_0x368526(0x132)),0x1;const _0x37c557=_0x32106c[0x0],_0x500143=_0x19b4c7['session'];try{if(_0x37c557==='/')return saveSessionContext({'segment_path':undefined},_0x500143),console[_0x368526(0x13d)](a41_0x40285b[_0x368526(0x139)](_0x368526(0x147))),0x0;if(existsSync(_0x37c557)&&statSync(_0x37c557)[_0x368526(0x11f)]()){let _0x4826b5;try{_0x4826b5=findTdxConfig(_0x37c557);}catch{return console['error'](a41_0x40285b[_0x368526(0x127)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x37c557)),console['error'](a41_0x40285b[_0x368526(0x148)](_0x368526(0x123))),0x1;}const _0x5a62cb=_0x4826b5['config'][_0x368526(0x145)];return saveSessionContext({'segment_path':_0x5a62cb,'parent_segment':_0x5a62cb},_0x500143),console[_0x368526(0x13d)](a41_0x40285b[_0x368526(0x139)](_0x368526(0x142)+a41_0x40285b[_0x368526(0x148)](_0x5a62cb))),0x0;}const _0x2e6e4c=_0x19b4c7[_0x368526(0x128)];let _0x4fc19c=_0x37c557;const _0x5aa15c=parsePath(_0x37c557);if(!_0x5aa15c[_0x368526(0x11e)]){if(!_0x2e6e4c)return console[_0x368526(0x13e)](a41_0x40285b[_0x368526(0x127)](_0x368526(0x137))),console[_0x368526(0x13e)](a41_0x40285b[_0x368526(0x148)](_0x368526(0x14a))),0x1;if(_0x37c557==='..'){const _0x30dd55=_0x2e6e4c[_0x368526(0x11a)]('/')[_0x368526(0x117)](0x0,-0x1)['join']('/');_0x4fc19c=_0x30dd55||'/';}else _0x37c557==='.'?_0x4fc19c=_0x2e6e4c:_0x4fc19c=_0x2e6e4c+'/'+_0x37c557;_0x19b4c7[_0x368526(0x144)]&&console[_0x368526(0x13e)](_0x368526(0x131)+_0x4fc19c);}if(_0x4fc19c==='/'||_0x4fc19c==='')return saveSessionContext({'segment_path':undefined},_0x500143),console[_0x368526(0x13d)](a41_0x40285b[_0x368526(0x139)](_0x368526(0x147))),0x0;_0x4fc19c=normalizePath(_0x4fc19c);const _0x2ea17a=parsePath(_0x4fc19c)['segments'];if(_0x2ea17a['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x500143),console[_0x368526(0x13d)](a41_0x40285b[_0x368526(0x139)](_0x368526(0x147))),0x0;_0x19b4c7['verbose']&&(console['error'](_0x368526(0x121)+_0x19b4c7[_0x368526(0x12e)]),console[_0x368526(0x13e)](_0x368526(0x118)+_0x4fc19c));const _0x1650ba=await withSpinner(_0x368526(0x12a)+_0x4fc19c+_0x368526(0x11b),()=>_0x3fef8a[_0x368526(0x124)]['resolvePathToResource'](_0x4fc19c),{'verbose':_0x19b4c7[_0x368526(0x144)]}),_0x30f5c2=_0x1650ba[_0x368526(0x12d)];_0x19b4c7[_0x368526(0x144)]&&(console[_0x368526(0x13e)]('Resolved\x20path\x20type:\x20'+_0x30f5c2[_0x368526(0x136)]),console[_0x368526(0x13e)](_0x368526(0x122)+_0x30f5c2['parentId']),_0x30f5c2[_0x368526(0x12c)]&&console[_0x368526(0x13e)](_0x368526(0x119)+_0x30f5c2[_0x368526(0x12c)]));if(_0x30f5c2[_0x368526(0x136)]===_0x368526(0x124))return console[_0x368526(0x13e)](a41_0x40285b['red'](_0x368526(0x125))),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x368526(0x13e)](a41_0x40285b[_0x368526(0x148)](_0x368526(0x130)+_0x30f5c2[_0x368526(0x129)]+(_0x30f5c2['folderPath']?'/'+_0x30f5c2[_0x368526(0x143)][_0x368526(0x133)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x30f5c2['fullPath'],'parent_segment':_0x30f5c2[_0x368526(0x129)]},_0x500143),console[_0x368526(0x13d)](a41_0x40285b[_0x368526(0x139)](_0x368526(0x142)+a41_0x40285b['cyan'](_0x30f5c2['fullPath']))),_0x19b4c7[_0x368526(0x144)]&&(console[_0x368526(0x13e)](a41_0x40285b['dim'](_0x368526(0x116))),console[_0x368526(0x13e)](a41_0x40285b['dim'](_0x368526(0x146)))),0x0;}catch(_0x5988c3){throw _0x5988c3;}}}
@@ -1 +1 @@
1
- const a42_0x16e33c=a42_0x2bec;(function(_0x583529,_0x3f3a49){const _0x7e8087=a42_0x2bec,_0x1b7df0=_0x583529();while(!![]){try{const _0x299b1d=parseInt(_0x7e8087(0x119))/0x1+parseInt(_0x7e8087(0x130))/0x2*(-parseInt(_0x7e8087(0x114))/0x3)+parseInt(_0x7e8087(0x12c))/0x4*(-parseInt(_0x7e8087(0x13f))/0x5)+-parseInt(_0x7e8087(0x13b))/0x6+parseInt(_0x7e8087(0x11a))/0x7+parseInt(_0x7e8087(0x11c))/0x8+parseInt(_0x7e8087(0x13e))/0x9;if(_0x299b1d===_0x3f3a49)break;else _0x1b7df0['push'](_0x1b7df0['shift']());}catch(_0x3bb4a8){_0x1b7df0['push'](_0x1b7df0['shift']());}}}(a42_0x5547,0xae966));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a42_0x509c3e from'chalk';function a42_0x5547(){const _0x5e2617=['Validate\x20segment\x20and\x20journey\x20YAML\x20files','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','log','no_parent','yellow','7402032vVSEXK','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','11688282WhXBoV','5JCznNP','dim','description','Error:\x20','\x20file(s)\x20with\x20errors,\x20','993OIEoox','message','helpText','cwd','targetDir','1015168mgHsEo','2462754LIkdnT','type','11249248cmECNl','Validation\x20failed:\x20','\x20file(s)\x20valid','length','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20warning(s)\x20found','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','error','parentSegment','\x20error(s)','validCount','valid','file','warningCount','red','filePath','5371580lSIxVX','.yaml','warnings','✔\x20All\x20','4714FrsKro','hasErrors','name','\x20valid','):\x20','errors'];a42_0x5547=function(){return _0x5e2617;};return a42_0x5547();}function a42_0x2bec(_0x4b08b1,_0x331d83){_0x4b08b1=_0x4b08b1-0x110;const _0x55477c=a42_0x5547();let _0x2bec18=_0x55477c[_0x4b08b1];return _0x2bec18;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a42_0x16e33c(0x132)]='segment:validate';[a42_0x16e33c(0x111)]=a42_0x16e33c(0x136);async['execute'](_0x214401){const _0x4bbb77=a42_0x16e33c,{options:_0x4d2dfa,args:_0x2d418d}=_0x214401,_0xd50b4a=_0x4d2dfa,_0x4c29d4=await resolveTarget({'arg':_0x2d418d[0x0],'contextParent':_0x4d2dfa[_0x4bbb77(0x124)],'cwd':process[_0x4bbb77(0x117)]()});if(!isSuccessfulResolution(_0x4c29d4))return _0x4c29d4['errorCode']===_0x4bbb77(0x139)?(console[_0x4bbb77(0x123)](a42_0x509c3e['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4bbb77(0x123)](_0x4bbb77(0x137)),console[_0x4bbb77(0x123)](_0x4bbb77(0x13d)),console[_0x4bbb77(0x123)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x4bbb77(0x123)](a42_0x509c3e[_0x4bbb77(0x12a)](_0x4bbb77(0x112)+_0x4c29d4[_0x4bbb77(0x115)]+'\x0a')),_0x4c29d4[_0x4bbb77(0x116)]&&console['error'](a42_0x509c3e[_0x4bbb77(0x13c)](_0x4c29d4[_0x4bbb77(0x116)]))),0x1;const _0x133ae7=_0x4c29d4[_0x4bbb77(0x118)],_0x549d25=_0x4c29d4[_0x4bbb77(0x11b)]===_0x4bbb77(0x128)?_0x4c29d4[_0x4bbb77(0x12b)]:undefined;if(!_0x549d25&&!existsSync(_0x133ae7))return console['error'](a42_0x509c3e[_0x4bbb77(0x12a)]('Error:\x20Directory\x20not\x20found:\x20'+_0x133ae7+'\x0a')),0x1;let _0x53e300;if(_0x549d25){if(!_0x549d25['endsWith']('.yml')&&!_0x549d25['endsWith'](_0x4bbb77(0x12d)))return console[_0x4bbb77(0x123)](a42_0x509c3e[_0x4bbb77(0x12a)](_0x4bbb77(0x120)+_0x549d25+'\x0a')),0x1;_0x53e300=[_0x549d25];}else _0x53e300=findYamlFiles(_0x133ae7);if(_0x53e300[_0x4bbb77(0x11f)]===0x0)return console[_0x4bbb77(0x123)](a42_0x509c3e[_0x4bbb77(0x12a)](_0x4bbb77(0x122)+_0x133ae7+'\x0a')),0x1;const _0x1b0cd4=validateYamlFiles(_0x53e300,_0x133ae7),_0x13c9e9=calculateSummary(_0x1b0cd4);for(const _0x3aad60 of _0x1b0cd4){if(!isValidationResult(_0x3aad60))continue;const {relativePath:_0x1a9769,source:_0x4f56ee,result:_0x398140,fileType:_0x27723e}=_0x3aad60,_0x50f688=_0x27723e;if(_0x398140[_0x4bbb77(0x127)]&&_0x398140[_0x4bbb77(0x12e)]['length']===0x0)_0xd50b4a['verbose']&&console[_0x4bbb77(0x138)](a42_0x509c3e['green']('✔\x20'+_0x1a9769)+a42_0x509c3e[_0x4bbb77(0x110)]('\x20('+_0x50f688+')'));else _0x398140['valid']?(console[_0x4bbb77(0x138)](a42_0x509c3e['yellow']('⚠\x20'+_0x1a9769)+a42_0x509c3e[_0x4bbb77(0x110)]('\x20('+_0x50f688+_0x4bbb77(0x134)+_0x398140[_0x4bbb77(0x12e)]['length']+'\x20warning(s)')),console['log'](formatValidationResult(_0x398140,_0x4f56ee,_0x1a9769))):(console['log'](a42_0x509c3e['red']('✖\x20'+_0x1a9769)+a42_0x509c3e[_0x4bbb77(0x110)]('\x20('+_0x50f688+'):\x20'+_0x398140[_0x4bbb77(0x135)][_0x4bbb77(0x11f)]+_0x4bbb77(0x125))),console['log'](formatValidationResult(_0x398140,_0x4f56ee,_0x1a9769)));}return console[_0x4bbb77(0x138)](''),_0x13c9e9[_0x4bbb77(0x131)]?(console[_0x4bbb77(0x138)](a42_0x509c3e[_0x4bbb77(0x12a)](_0x4bbb77(0x11d)+_0x13c9e9['invalidCount']+_0x4bbb77(0x113)+_0x13c9e9[_0x4bbb77(0x126)]+_0x4bbb77(0x133))),_0x13c9e9[_0x4bbb77(0x129)]>0x0&&console[_0x4bbb77(0x138)](a42_0x509c3e[_0x4bbb77(0x13a)](_0x13c9e9[_0x4bbb77(0x129)]+_0x4bbb77(0x121))),0x1):(console['log'](a42_0x509c3e['green'](_0x4bbb77(0x12f)+_0x13c9e9[_0x4bbb77(0x126)]+_0x4bbb77(0x11e))),_0x13c9e9[_0x4bbb77(0x129)]>0x0&&console[_0x4bbb77(0x138)](a42_0x509c3e[_0x4bbb77(0x13a)](_0x13c9e9[_0x4bbb77(0x129)]+_0x4bbb77(0x121))),0x0);}}
1
+ const a42_0x3906de=a42_0x13cf;(function(_0x3eb782,_0x4f4db0){const _0x22570f=a42_0x13cf,_0x3a97ac=_0x3eb782();while(!![]){try{const _0x1c9a5b=-parseInt(_0x22570f(0xeb))/0x1*(parseInt(_0x22570f(0x10d))/0x2)+parseInt(_0x22570f(0x100))/0x3*(parseInt(_0x22570f(0xe8))/0x4)+parseInt(_0x22570f(0x102))/0x5+-parseInt(_0x22570f(0x110))/0x6*(parseInt(_0x22570f(0x111))/0x7)+-parseInt(_0x22570f(0xf1))/0x8+parseInt(_0x22570f(0x10a))/0x9*(parseInt(_0x22570f(0xf5))/0xa)+parseInt(_0x22570f(0x101))/0xb*(parseInt(_0x22570f(0x113))/0xc);if(_0x1c9a5b===_0x4f4db0)break;else _0x3a97ac['push'](_0x3a97ac['shift']());}catch(_0x5a7ceb){_0x3a97ac['push'](_0x3a97ac['shift']());}}}(a42_0x4deb,0xec4e9));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a42_0x13cf(_0x2b7871,_0x32e23f){_0x2b7871=_0x2b7871-0xdd;const _0x4debff=a42_0x4deb();let _0x13cf31=_0x4debff[_0x2b7871];return _0x13cf31;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a42_0x5ec21f from'chalk';function a42_0x4deb(){const _0xbfa640=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','1vBofaT','green','Validation\x20failed:\x20','errorCode','):\x20','\x20file(s)\x20with\x20errors,\x20','14498960wcEbRJ','name','execute','validCount','11710550KCVwWi','description','\x20file(s)\x20valid','length','endsWith','cwd','parentSegment','filePath','warningCount','error','segment:validate','292833PrWhEG','2024sbzpaZ','8342890sErhHa','invalidCount','type','warnings','yellow','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','valid','.yml','9RMrTNr','\x20warning(s)\x20found','\x20error(s)','1958380qtMMtc','log','dim','370338UiGzUd','21zbIjZj','red','52968IvmCMu','Error:\x20Directory\x20not\x20found:\x20','.yaml','Error:\x20','\x20valid','hasErrors','file','verbose','no_parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','helpText','✔\x20All\x20','12OMEaBn','errors'];a42_0x4deb=function(){return _0xbfa640;};return a42_0x4deb();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a42_0x3906de(0xf2)]=a42_0x3906de(0xff);[a42_0x3906de(0xf6)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a42_0x3906de(0xf3)](_0x440c9e){const _0x2089e8=a42_0x3906de,{options:_0x440c2c,args:_0x239a98}=_0x440c9e,_0x5c6e04=_0x440c2c,_0x4ceb75=await resolveTarget({'arg':_0x239a98[0x0],'contextParent':_0x440c2c[_0x2089e8(0xfb)],'cwd':process[_0x2089e8(0xfa)]()});if(!isSuccessfulResolution(_0x4ceb75))return _0x4ceb75[_0x2089e8(0xee)]===_0x2089e8(0xe4)?(console[_0x2089e8(0xfe)](a42_0x5ec21f[_0x2089e8(0x106)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2089e8(0xfe)](_0x2089e8(0x107)),console[_0x2089e8(0xfe)](_0x2089e8(0xea)),console[_0x2089e8(0xfe)](_0x2089e8(0xe5))):(console[_0x2089e8(0xfe)](a42_0x5ec21f[_0x2089e8(0x112)](_0x2089e8(0xdf)+_0x4ceb75['message']+'\x0a')),_0x4ceb75[_0x2089e8(0xe6)]&&console[_0x2089e8(0xfe)](a42_0x5ec21f['cyan'](_0x4ceb75[_0x2089e8(0xe6)]))),0x1;const _0xbe1ab9=_0x4ceb75['targetDir'],_0x24dee2=_0x4ceb75[_0x2089e8(0x104)]===_0x2089e8(0xe2)?_0x4ceb75[_0x2089e8(0xfc)]:undefined;if(!_0x24dee2&&!existsSync(_0xbe1ab9))return console[_0x2089e8(0xfe)](a42_0x5ec21f[_0x2089e8(0x112)](_0x2089e8(0xdd)+_0xbe1ab9+'\x0a')),0x1;let _0x36ff50;if(_0x24dee2){if(!_0x24dee2[_0x2089e8(0xf9)](_0x2089e8(0x109))&&!_0x24dee2[_0x2089e8(0xf9)](_0x2089e8(0xde)))return console[_0x2089e8(0xfe)](a42_0x5ec21f[_0x2089e8(0x112)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x24dee2+'\x0a')),0x1;_0x36ff50=[_0x24dee2];}else _0x36ff50=findYamlFiles(_0xbe1ab9);if(_0x36ff50[_0x2089e8(0xf8)]===0x0)return console['error'](a42_0x5ec21f['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0xbe1ab9+'\x0a')),0x1;const _0xa2fc1b=validateYamlFiles(_0x36ff50,_0xbe1ab9),_0x2c9c2b=calculateSummary(_0xa2fc1b);for(const _0x1d1fb8 of _0xa2fc1b){if(!isValidationResult(_0x1d1fb8))continue;const {relativePath:_0x57f3c4,source:_0x1d2805,result:_0x35f7d0,fileType:_0xe628f2}=_0x1d1fb8,_0x189ad3=_0xe628f2;if(_0x35f7d0[_0x2089e8(0x108)]&&_0x35f7d0[_0x2089e8(0x105)][_0x2089e8(0xf8)]===0x0)_0x5c6e04[_0x2089e8(0xe3)]&&console[_0x2089e8(0x10e)](a42_0x5ec21f[_0x2089e8(0xec)]('✔\x20'+_0x57f3c4)+a42_0x5ec21f[_0x2089e8(0x10f)]('\x20('+_0x189ad3+')'));else _0x35f7d0[_0x2089e8(0x108)]?(console[_0x2089e8(0x10e)](a42_0x5ec21f[_0x2089e8(0x106)]('⚠\x20'+_0x57f3c4)+a42_0x5ec21f[_0x2089e8(0x10f)]('\x20('+_0x189ad3+_0x2089e8(0xef)+_0x35f7d0[_0x2089e8(0x105)][_0x2089e8(0xf8)]+'\x20warning(s)')),console[_0x2089e8(0x10e)](formatValidationResult(_0x35f7d0,_0x1d2805,_0x57f3c4))):(console['log'](a42_0x5ec21f[_0x2089e8(0x112)]('✖\x20'+_0x57f3c4)+a42_0x5ec21f['dim']('\x20('+_0x189ad3+_0x2089e8(0xef)+_0x35f7d0[_0x2089e8(0xe9)][_0x2089e8(0xf8)]+_0x2089e8(0x10c))),console[_0x2089e8(0x10e)](formatValidationResult(_0x35f7d0,_0x1d2805,_0x57f3c4)));}return console[_0x2089e8(0x10e)](''),_0x2c9c2b[_0x2089e8(0xe1)]?(console[_0x2089e8(0x10e)](a42_0x5ec21f[_0x2089e8(0x112)](_0x2089e8(0xed)+_0x2c9c2b[_0x2089e8(0x103)]+_0x2089e8(0xf0)+_0x2c9c2b[_0x2089e8(0xf4)]+_0x2089e8(0xe0))),_0x2c9c2b[_0x2089e8(0xfd)]>0x0&&console[_0x2089e8(0x10e)](a42_0x5ec21f['yellow'](_0x2c9c2b[_0x2089e8(0xfd)]+'\x20warning(s)\x20found')),0x1):(console[_0x2089e8(0x10e)](a42_0x5ec21f[_0x2089e8(0xec)](_0x2089e8(0xe7)+_0x2c9c2b[_0x2089e8(0xf4)]+_0x2089e8(0xf7))),_0x2c9c2b['warningCount']>0x0&&console[_0x2089e8(0x10e)](a42_0x5ec21f[_0x2089e8(0x106)](_0x2c9c2b[_0x2089e8(0xfd)]+_0x2089e8(0x10b))),0x0);}}
@@ -1 +1 @@
1
- const a43_0x10e381=a43_0x2d1b;function a43_0x2d1b(_0x44e5a7,_0x26741c){_0x44e5a7=_0x44e5a7-0x1a4;const _0x3af057=a43_0x3af0();let _0x2d1bbd=_0x3af057[_0x44e5a7];return _0x2d1bbd;}(function(_0x3ff349,_0x263583){const _0x74c3b1=a43_0x2d1b,_0x9b68e5=_0x3ff349();while(!![]){try{const _0x2804c3=parseInt(_0x74c3b1(0x1df))/0x1+parseInt(_0x74c3b1(0x1c3))/0x2+-parseInt(_0x74c3b1(0x1d9))/0x3+parseInt(_0x74c3b1(0x1c0))/0x4+-parseInt(_0x74c3b1(0x1c7))/0x5*(-parseInt(_0x74c3b1(0x1da))/0x6)+-parseInt(_0x74c3b1(0x1b0))/0x7*(parseInt(_0x74c3b1(0x1c5))/0x8)+-parseInt(_0x74c3b1(0x1d8))/0x9*(-parseInt(_0x74c3b1(0x1e4))/0xa);if(_0x2804c3===_0x263583)break;else _0x9b68e5['push'](_0x9b68e5['shift']());}catch(_0x541b72){_0x9b68e5['push'](_0x9b68e5['shift']());}}}(a43_0x3af0,0x7b3f7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a43_0x3af0(){const _0x4f5ec8=['error','segment','Building\x20hierarchy\x20tree...','execute','jsonl','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','279WpBZjK','2771274YRhElp','6yPLMOM','listRecursive','listWithPattern','data','/j/da','291567ZoiCRr','message','\x20folder','recursive','segments','146280nVNfRD','folder','Folder/pattern\x20arg:\x20','\x20journey','type','Site:\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','/e/','(not\x20set)','sort','name','log','Listing\x20folders,\x20segments,\x20and\x20journeys...','Resolving\x20parent\x20segment\x20\x27','✔\x20Built\x20tree\x20with\x20','maxDepth','List\x20folders\x20and\x20child\x20segments','\x20matching\x20\x27','journey','verbose',',\x20and\x20','No\x20items\x20match\x20pattern:\x20','children','replace','parentId','469xqjOFo',']\x20matching\x20\x27','✔\x20Found\x20','json','cause','format','journeys','filter','length','Recursive\x20mode:\x20enabled','Resolving\x20path\x20\x27','Set\x20a\x20parent\x20segment\x20context\x20first:','listUnifiedWithJourneys','dim','localeCompare','\x20\x20Cause:\x20','1975436BZVjIu','parentSegment','\x20segment','190652svkhOX','site','12448gJHhfn','\x27...','993065EVPWyg','folderId','test','includes','/app/ps/','journeyBundleName','Error:\x20','resolvePathToResource','folders','map','Parent\x20ID:\x20'];a43_0x3af0=function(){return _0x4f5ec8;};return a43_0x3af0();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a43_0x1974e0 from'chalk';export class SegmentsCommand extends BaseCommand{[a43_0x10e381(0x1ee)]='segments';['description']=a43_0x10e381(0x1a7);async[a43_0x10e381(0x1d5)](_0x1eaec7){const _0x51a0eb=a43_0x10e381,{options:_0x5226e7,args:_0x3adf9e}=_0x1eaec7,_0x333e4c=_0x5226e7[_0x51a0eb(0x1e2)],_0x446d68=_0x3adf9e[0x0];try{const _0x4502a1=_0x5226e7[_0x51a0eb(0x1c1)];_0x5226e7['verbose']&&(console[_0x51a0eb(0x1d2)](_0x51a0eb(0x1e9)+_0x5226e7['site']),console[_0x51a0eb(0x1d2)]('Parent\x20segment\x20context:\x20'+(_0x4502a1||_0x51a0eb(0x1ec))),_0x446d68&&console[_0x51a0eb(0x1d2)](_0x51a0eb(0x1e6)+_0x446d68),_0x333e4c&&console[_0x51a0eb(0x1d2)](_0x51a0eb(0x1b9)));if(!_0x4502a1)return console[_0x51a0eb(0x1d2)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x51a0eb(0x1d2)](''),console['error'](_0x51a0eb(0x1bb)),console[_0x51a0eb(0x1d2)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x51a0eb(0x1d2)](_0x51a0eb(0x1ea)),console['error'](''),console[_0x51a0eb(0x1d2)](_0x51a0eb(0x1d7)),0x1;const _0x3a9b76=_0x446d68&&(_0x446d68[_0x51a0eb(0x1ca)]('*')||_0x446d68[_0x51a0eb(0x1ca)]('?'));if(_0x3a9b76)return await this[_0x51a0eb(0x1dc)](_0x1eaec7,_0x4502a1,_0x446d68);const _0x31a601=_0x446d68?_0x4502a1+'/'+_0x446d68:_0x4502a1;return _0x333e4c?await this[_0x51a0eb(0x1db)](_0x1eaec7,_0x31a601):await this['listUnified'](_0x1eaec7,_0x31a601);}catch(_0x5eec93){if(_0x5eec93 instanceof SDKError)return console[_0x51a0eb(0x1d2)](_0x51a0eb(0x1cd)+_0x5eec93[_0x51a0eb(0x1e0)]),_0x5eec93[_0x51a0eb(0x1b4)]&&console['error'](_0x51a0eb(0x1bf)+_0x5eec93['cause']),0x1;throw _0x5eec93;}}async[a43_0x10e381(0x1dc)](_0x45caa7,_0x49cb64,_0x2156bd){const _0x1b1e2b=a43_0x10e381,{options:_0x2b1082,tdx:_0x3ca5c6}=_0x45caa7,_0x1c1f9b=await withSpinner(_0x1b1e2b(0x1a4)+_0x49cb64+_0x1b1e2b(0x1c6),()=>_0x3ca5c6[_0x1b1e2b(0x1d3)][_0x1b1e2b(0x1ce)](_0x49cb64),{'verbose':_0x2b1082['verbose']}),_0x500d3b=_0x1c1f9b[_0x1b1e2b(0x1dd)],_0x24e0ad=await withSpinner(_0x1b1e2b(0x1f0),()=>_0x3ca5c6[_0x1b1e2b(0x1d3)][_0x1b1e2b(0x1bc)](_0x500d3b[_0x1b1e2b(0x1af)],_0x500d3b[_0x1b1e2b(0x1c8)]),{'verbose':_0x2b1082[_0x1b1e2b(0x1aa)]}),{folders:_0x29b471,segments:_0x2ed3d0,journeys:_0x24b0b2}=_0x24e0ad[_0x1b1e2b(0x1dd)],_0x36945d=_0x2156bd[_0x1b1e2b(0x1ae)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1b1e2b(0x1ae)](/\*/g,'.*')[_0x1b1e2b(0x1ae)](/\?/g,'.'),_0x46ede1=new RegExp('^'+_0x36945d+'$','i'),_0x4ca6fa=_0x29b471[_0x1b1e2b(0x1b7)](_0x3338a5=>_0x46ede1[_0x1b1e2b(0x1c9)](_0x3338a5[_0x1b1e2b(0x1ee)])),_0x293224=_0x2ed3d0['filter'](_0x217f07=>_0x46ede1[_0x1b1e2b(0x1c9)](_0x217f07[_0x1b1e2b(0x1ee)])),_0xb8482=_0x24b0b2[_0x1b1e2b(0x1b7)](_0x392b8b=>_0x46ede1[_0x1b1e2b(0x1c9)](_0x392b8b[_0x1b1e2b(0x1cc)])),_0x2ab2c7=_0x4ca6fa['length']+_0x293224[_0x1b1e2b(0x1b8)]+_0xb8482['length'];console[_0x1b1e2b(0x1d2)](_0x1b1e2b(0x1b2)+_0x4ca6fa[_0x1b1e2b(0x1b8)]+_0x1b1e2b(0x1e1)+(_0x4ca6fa[_0x1b1e2b(0x1b8)]!==0x1?'s':'')+',\x20'+_0x293224[_0x1b1e2b(0x1b8)]+'\x20segment'+(_0x293224[_0x1b1e2b(0x1b8)]!==0x1?'s':'')+_0x1b1e2b(0x1ab)+_0xb8482[_0x1b1e2b(0x1b8)]+_0x1b1e2b(0x1e7)+(_0xb8482[_0x1b1e2b(0x1b8)]!==0x1?'s':'')+_0x1b1e2b(0x1a8)+_0x2156bd+'\x27');const _0x3cb208=_0x413330=>{const _0x12e3e8=_0x1b1e2b;return getConsoleNextUrl(_0x2b1082[_0x12e3e8(0x1c4)],'/app/ps/'+_0x500d3b['parentId']+_0x12e3e8(0x1eb)+_0x413330);},_0x48788c=_0x2b1082[_0x1b1e2b(0x1b5)]===_0x1b1e2b(0x1b3)||_0x2b1082[_0x1b1e2b(0x1b5)]===_0x1b1e2b(0x1d6);if(_0x48788c){const _0x30ef3e=[..._0x4ca6fa['map'](_0x9a9fec=>({..._0x9a9fec,'type':'folder'})),..._0x293224[_0x1b1e2b(0x1d0)](_0x220567=>({..._0x220567,'type':_0x1b1e2b(0x1d3),'url':_0x3cb208(_0x220567['id'])})),..._0xb8482[_0x1b1e2b(0x1d0)](_0x38d9c9=>({..._0x38d9c9,'name':_0x38d9c9[_0x1b1e2b(0x1cc)],'type':_0x1b1e2b(0x1a9)}))][_0x1b1e2b(0x1ed)]((_0x10a833,_0x509121)=>_0x10a833[_0x1b1e2b(0x1ee)][_0x1b1e2b(0x1be)](_0x509121[_0x1b1e2b(0x1ee)]));await handleSDKOutput(_0x30ef3e,_0x2b1082);}else{if(_0x2ab2c7===0x0)console[_0x1b1e2b(0x1ef)](_0x1b1e2b(0x1ac)+_0x2156bd);else{console[_0x1b1e2b(0x1ef)](a43_0x1974e0[_0x1b1e2b(0x1bd)]('['+_0x49cb64+_0x1b1e2b(0x1b1)+_0x2156bd+'\x27'));const _0x3ab0b0=formatFlatList(_0x4ca6fa,_0x293224,{'showMetadata':!![],'getSegmentUrl':_0x3cb208},_0xb8482);console[_0x1b1e2b(0x1ef)](_0x3ab0b0);}}return 0x0;}async['listUnified'](_0x1b5c3c,_0x4a2060){const _0x21fe32=a43_0x10e381,{options:_0x203ea0,tdx:_0x37ad24}=_0x1b5c3c,_0x4f6358=await withSpinner('Resolving\x20path\x20\x27'+_0x4a2060+'\x27...',()=>_0x37ad24[_0x21fe32(0x1d3)]['resolvePathToResource'](_0x4a2060),{'verbose':_0x203ea0[_0x21fe32(0x1aa)]}),_0x332191=_0x4f6358[_0x21fe32(0x1dd)];_0x203ea0['verbose']&&(console[_0x21fe32(0x1d2)](_0x21fe32(0x1d1)+_0x332191['parentId']),_0x332191['folderId']&&console['error']('Folder\x20ID:\x20'+_0x332191[_0x21fe32(0x1c8)]));const _0x8c7b18=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x37ad24[_0x21fe32(0x1d3)][_0x21fe32(0x1bc)](_0x332191[_0x21fe32(0x1af)],_0x332191['folderId']),{'verbose':_0x203ea0['verbose']}),{folders:_0x44a01b,segments:_0xb431f3,journeys:_0x49a1ba}=_0x8c7b18[_0x21fe32(0x1dd)],_0x382b76=_0x44a01b[_0x21fe32(0x1b8)]+_0xb431f3['length']+_0x49a1ba[_0x21fe32(0x1b8)];console['error'](_0x21fe32(0x1b2)+_0x44a01b[_0x21fe32(0x1b8)]+_0x21fe32(0x1e1)+(_0x44a01b['length']!==0x1?'s':'')+',\x20'+_0xb431f3[_0x21fe32(0x1b8)]+'\x20segment'+(_0xb431f3[_0x21fe32(0x1b8)]!==0x1?'s':'')+',\x20and\x20'+_0x49a1ba[_0x21fe32(0x1b8)]+_0x21fe32(0x1e7)+(_0x49a1ba[_0x21fe32(0x1b8)]!==0x1?'s':''));const _0x226c4c=_0x297c0a=>{const _0x460a0c=_0x21fe32;return getConsoleNextUrl(_0x203ea0[_0x460a0c(0x1c4)],_0x460a0c(0x1cb)+_0x332191[_0x460a0c(0x1af)]+'/e/'+_0x297c0a);},_0x2c9f9d=_0xc83e69=>{const _0x20fc4d=_0x21fe32;return getConsoleNextUrl(_0x203ea0[_0x20fc4d(0x1c4)],_0x20fc4d(0x1cb)+_0x332191[_0x20fc4d(0x1af)]+_0x20fc4d(0x1eb)+_0xc83e69+_0x20fc4d(0x1de));},_0x577c9c=_0x203ea0['format']===_0x21fe32(0x1b3)||_0x203ea0[_0x21fe32(0x1b5)]==='jsonl';if(_0x577c9c){const _0x1c00ba=[..._0x44a01b[_0x21fe32(0x1d0)](_0x4fdb19=>({..._0x4fdb19,'type':_0x21fe32(0x1e5)})),..._0xb431f3[_0x21fe32(0x1d0)](_0x3bdc31=>({..._0x3bdc31,'type':_0x21fe32(0x1d3),'url':_0x226c4c(_0x3bdc31['id'])})),..._0x49a1ba[_0x21fe32(0x1d0)](_0x94def=>({..._0x94def,'name':_0x94def[_0x21fe32(0x1cc)],'type':_0x21fe32(0x1a9),'url':_0x2c9f9d(_0x94def['id'])}))]['sort']((_0x34e6cb,_0x821873)=>_0x34e6cb[_0x21fe32(0x1ee)][_0x21fe32(0x1be)](_0x821873['name']));await handleSDKOutput(_0x1c00ba,_0x203ea0);}else{if(_0x382b76===0x0)console[_0x21fe32(0x1ef)](a43_0x1974e0['dim']('['+_0x4a2060+']')),console[_0x21fe32(0x1ef)]('(empty)');else{console[_0x21fe32(0x1ef)](a43_0x1974e0[_0x21fe32(0x1bd)]('['+_0x4a2060+']'));const _0x30d285=formatFlatList(_0x44a01b,_0xb431f3,{'showMetadata':!![],'getSegmentUrl':_0x226c4c,'getJourneyUrl':_0x2c9f9d},_0x49a1ba);console[_0x21fe32(0x1ef)](_0x30d285);}}return 0x0;}async[a43_0x10e381(0x1db)](_0x4defa0,_0x2fa1f4){const _0x5318cc=a43_0x10e381,{options:_0x5a1901,tdx:_0x2e9fee}=_0x4defa0,_0x45791c=await withSpinner(_0x5318cc(0x1ba)+_0x2fa1f4+_0x5318cc(0x1c6),()=>_0x2e9fee[_0x5318cc(0x1d3)][_0x5318cc(0x1ce)](_0x2fa1f4),{'verbose':_0x5a1901[_0x5318cc(0x1aa)]}),_0x3ea68d=_0x45791c[_0x5318cc(0x1dd)];_0x5a1901[_0x5318cc(0x1aa)]&&(console['error']('Parent\x20ID:\x20'+_0x3ea68d[_0x5318cc(0x1af)]),_0x3ea68d[_0x5318cc(0x1c8)]&&console['error']('Folder\x20ID:\x20'+_0x3ea68d[_0x5318cc(0x1c8)]));const _0x2209d1=_0x5a1901[_0x5318cc(0x1a6)]||0xa,_0x4c0438=await withSpinner(_0x5318cc(0x1d4),()=>_0x2e9fee[_0x5318cc(0x1d3)][_0x5318cc(0x1db)](_0x3ea68d[_0x5318cc(0x1af)],_0x3ea68d[_0x5318cc(0x1c8)],0x0,_0x2209d1),{'verbose':_0x5a1901[_0x5318cc(0x1aa)]}),_0x371b29=_0x4c0438['data'],_0x3b82c0=_0x20d18d=>{const _0x35c13b=_0x5318cc;let _0x517b99=0x0,_0x108bce=0x0,_0x342c6f=0x0;for(const _0x4bff8f of _0x20d18d){if(_0x4bff8f['type']==='folder')_0x517b99++;else{if(_0x4bff8f[_0x35c13b(0x1e8)]===_0x35c13b(0x1d3))_0x108bce++;else{if(_0x4bff8f[_0x35c13b(0x1e8)]===_0x35c13b(0x1a9))_0x342c6f++;}}if(_0x4bff8f[_0x35c13b(0x1ad)]){const _0x5e0a82=_0x3b82c0(_0x4bff8f['children']);_0x517b99+=_0x5e0a82[_0x35c13b(0x1cf)],_0x108bce+=_0x5e0a82[_0x35c13b(0x1e3)],_0x342c6f+=_0x5e0a82['journeys'];}}return{'folders':_0x517b99,'segments':_0x108bce,'journeys':_0x342c6f};},_0x4212c2=_0x3b82c0(_0x371b29);console[_0x5318cc(0x1d2)](_0x5318cc(0x1a5)+_0x4212c2[_0x5318cc(0x1cf)]+'\x20folder'+(_0x4212c2[_0x5318cc(0x1cf)]!==0x1?'s':'')+',\x20'+_0x4212c2[_0x5318cc(0x1e3)]+_0x5318cc(0x1c2)+(_0x4212c2['segments']!==0x1?'s':'')+_0x5318cc(0x1ab)+_0x4212c2[_0x5318cc(0x1b6)]+_0x5318cc(0x1e7)+(_0x4212c2[_0x5318cc(0x1b6)]!==0x1?'s':''));const _0x4acc22=_0x3132af=>{const _0x44b5dd=_0x5318cc;return getConsoleNextUrl(_0x5a1901[_0x44b5dd(0x1c4)],_0x44b5dd(0x1cb)+_0x3ea68d[_0x44b5dd(0x1af)]+'/e/'+_0x3132af);},_0x5eb0dd=_0x1c4407=>{const _0x38b244=_0x5318cc;return getConsoleNextUrl(_0x5a1901['site'],'/app/ps/'+_0x3ea68d[_0x38b244(0x1af)]+_0x38b244(0x1eb)+_0x1c4407+_0x38b244(0x1de));};if(_0x5a1901['format']===_0x5318cc(0x1b3)||_0x5a1901[_0x5318cc(0x1b5)]===_0x5318cc(0x1d6))await handleSDKOutput(_0x371b29,_0x5a1901);else{console[_0x5318cc(0x1ef)](a43_0x1974e0['dim']('['+_0x2fa1f4+']'));const _0x456418=formatTree(_0x371b29,{'showMetadata':!![],'getSegmentUrl':_0x4acc22,'getJourneyUrl':_0x5eb0dd});console['log'](_0x456418);}return 0x0;}}
1
+ const a43_0xe35d57=a43_0x5f58;(function(_0x4fb1f1,_0x251ce0){const _0x31a161=a43_0x5f58,_0x522493=_0x4fb1f1();while(!![]){try{const _0xad991f=-parseInt(_0x31a161(0x1e4))/0x1*(-parseInt(_0x31a161(0x1b5))/0x2)+-parseInt(_0x31a161(0x1ed))/0x3*(parseInt(_0x31a161(0x1da))/0x4)+-parseInt(_0x31a161(0x1fc))/0x5*(parseInt(_0x31a161(0x1cc))/0x6)+parseInt(_0x31a161(0x1db))/0x7+parseInt(_0x31a161(0x1b6))/0x8+-parseInt(_0x31a161(0x1f2))/0x9*(parseInt(_0x31a161(0x1d1))/0xa)+parseInt(_0x31a161(0x1b8))/0xb;if(_0xad991f===_0x251ce0)break;else _0x522493['push'](_0x522493['shift']());}catch(_0x25d56a){_0x522493['push'](_0x522493['shift']());}}}(a43_0x3af4,0x2276c));import{BaseCommand}from'./command.js';function a43_0x3af4(){const _0x1a1ad6=['Folder\x20ID:\x20','3lQRXvV','message','includes','✔\x20Built\x20tree\x20with\x20','verbose','7326btSlQs','Site:\x20','Resolving\x20parent\x20segment\x20\x27','listUnifiedWithJourneys','log','jsonl','cause','Listing\x20folders,\x20segments,\x20and\x20journeys...','journey','journeyBundleName','869435WxABdg','format','Resolving\x20path\x20\x27','/app/ps/',']\x20matching\x20\x27','resolvePathToResource','name','6yepezT','1503904vJohZx','\x20segment','1045011rfxEwk','folder','recursive','/e/','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','List\x20folders\x20and\x20child\x20segments','parentSegment','data','Parent\x20segment\x20context:\x20','listRecursive','Building\x20hierarchy\x20tree...','sort','error','\x20matching\x20\x27','parentId','\x20folder','(not\x20set)','folders','length','segment','6XBqvpZ','folderId','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','✔\x20Found\x20','\x5c$&','1850atiOLF','localeCompare','json','test','children','maxDepth','Parent\x20ID:\x20','journeys','Error:\x20','392096XwuxJK','916664RnuVwC','replace','(empty)','/j/da','site','Recursive\x20mode:\x20enabled','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','filter','listUnified','49908wZIUhu','type','dim','\x20journey',',\x20and\x20','\x27...','segments','map'];a43_0x3af4=function(){return _0x1a1ad6;};return a43_0x3af4();}function a43_0x5f58(_0x4804ae,_0x1a1c09){_0x4804ae=_0x4804ae-0x1b2;const _0x3af4a2=a43_0x3af4();let _0x5f58a3=_0x3af4a2[_0x4804ae];return _0x5f58a3;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a43_0x2ddec6 from'chalk';export class SegmentsCommand extends BaseCommand{[a43_0xe35d57(0x1b4)]=a43_0xe35d57(0x1ea);['description']=a43_0xe35d57(0x1bd);async['execute'](_0x3cbc34){const _0xb2a137=a43_0xe35d57,{options:_0x246b66,args:_0x59c3d7}=_0x3cbc34,_0x202e19=_0x246b66[_0xb2a137(0x1ba)],_0x1b93ed=_0x59c3d7[0x0];try{const _0x19e47a=_0x246b66[_0xb2a137(0x1be)];_0x246b66[_0xb2a137(0x1f1)]&&(console[_0xb2a137(0x1c4)](_0xb2a137(0x1f3)+_0x246b66[_0xb2a137(0x1df)]),console[_0xb2a137(0x1c4)](_0xb2a137(0x1c0)+(_0x19e47a||_0xb2a137(0x1c8))),_0x1b93ed&&console[_0xb2a137(0x1c4)]('Folder/pattern\x20arg:\x20'+_0x1b93ed),_0x202e19&&console['error'](_0xb2a137(0x1e0)));if(!_0x19e47a)return console[_0xb2a137(0x1c4)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0xb2a137(0x1c4)](''),console[_0xb2a137(0x1c4)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0xb2a137(0x1c4)](_0xb2a137(0x1ce)),console[_0xb2a137(0x1c4)](_0xb2a137(0x1bc)),console[_0xb2a137(0x1c4)](''),console['error'](_0xb2a137(0x1e1)),0x1;const _0x3c3521=_0x1b93ed&&(_0x1b93ed[_0xb2a137(0x1ef)]('*')||_0x1b93ed[_0xb2a137(0x1ef)]('?'));if(_0x3c3521)return await this['listWithPattern'](_0x3cbc34,_0x19e47a,_0x1b93ed);const _0x307636=_0x1b93ed?_0x19e47a+'/'+_0x1b93ed:_0x19e47a;return _0x202e19?await this[_0xb2a137(0x1c1)](_0x3cbc34,_0x307636):await this[_0xb2a137(0x1e3)](_0x3cbc34,_0x307636);}catch(_0x177b19){if(_0x177b19 instanceof SDKError)return console['error'](_0xb2a137(0x1d9)+_0x177b19[_0xb2a137(0x1ee)]),_0x177b19[_0xb2a137(0x1f8)]&&console['error']('\x20\x20Cause:\x20'+_0x177b19[_0xb2a137(0x1f8)]),0x1;throw _0x177b19;}}async['listWithPattern'](_0x56279d,_0x4d5034,_0x2968c6){const _0x528ee0=a43_0xe35d57,{options:_0x342901,tdx:_0x1201b1}=_0x56279d,_0x5d639f=await withSpinner(_0x528ee0(0x1f4)+_0x4d5034+_0x528ee0(0x1e9),()=>_0x1201b1['segment'][_0x528ee0(0x1b3)](_0x4d5034),{'verbose':_0x342901[_0x528ee0(0x1f1)]}),_0x250fb9=_0x5d639f[_0x528ee0(0x1bf)],_0x1e7676=await withSpinner(_0x528ee0(0x1f9),()=>_0x1201b1[_0x528ee0(0x1cb)][_0x528ee0(0x1f5)](_0x250fb9[_0x528ee0(0x1c6)],_0x250fb9[_0x528ee0(0x1cd)]),{'verbose':_0x342901[_0x528ee0(0x1f1)]}),{folders:_0x4b0adb,segments:_0x160322,journeys:_0x55c755}=_0x1e7676[_0x528ee0(0x1bf)],_0x4ccdfd=_0x2968c6[_0x528ee0(0x1dc)](/[.+^${}()|[\]\\]/g,_0x528ee0(0x1d0))[_0x528ee0(0x1dc)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x29c7de=new RegExp('^'+_0x4ccdfd+'$','i'),_0x542fb6=_0x4b0adb[_0x528ee0(0x1e2)](_0x2c58a7=>_0x29c7de[_0x528ee0(0x1d4)](_0x2c58a7[_0x528ee0(0x1b4)])),_0x7dfb84=_0x160322[_0x528ee0(0x1e2)](_0x3473ca=>_0x29c7de[_0x528ee0(0x1d4)](_0x3473ca[_0x528ee0(0x1b4)])),_0x48d186=_0x55c755['filter'](_0x4b65c0=>_0x29c7de[_0x528ee0(0x1d4)](_0x4b65c0[_0x528ee0(0x1fb)])),_0x2f70bf=_0x542fb6[_0x528ee0(0x1ca)]+_0x7dfb84[_0x528ee0(0x1ca)]+_0x48d186['length'];console[_0x528ee0(0x1c4)](_0x528ee0(0x1cf)+_0x542fb6[_0x528ee0(0x1ca)]+_0x528ee0(0x1c7)+(_0x542fb6['length']!==0x1?'s':'')+',\x20'+_0x7dfb84[_0x528ee0(0x1ca)]+_0x528ee0(0x1b7)+(_0x7dfb84[_0x528ee0(0x1ca)]!==0x1?'s':'')+',\x20and\x20'+_0x48d186[_0x528ee0(0x1ca)]+_0x528ee0(0x1e7)+(_0x48d186[_0x528ee0(0x1ca)]!==0x1?'s':'')+_0x528ee0(0x1c5)+_0x2968c6+'\x27');const _0x412c3b=_0x458e23=>{const _0x5e450a=_0x528ee0;return getConsoleNextUrl(_0x342901[_0x5e450a(0x1df)],_0x5e450a(0x1ff)+_0x250fb9[_0x5e450a(0x1c6)]+'/e/'+_0x458e23);},_0x48ccdb=_0x342901['format']===_0x528ee0(0x1d3)||_0x342901[_0x528ee0(0x1fd)]===_0x528ee0(0x1f7);if(_0x48ccdb){const _0x35635c=[..._0x542fb6[_0x528ee0(0x1eb)](_0x551665=>({..._0x551665,'type':_0x528ee0(0x1b9)})),..._0x7dfb84[_0x528ee0(0x1eb)](_0x2edc2e=>({..._0x2edc2e,'type':_0x528ee0(0x1cb),'url':_0x412c3b(_0x2edc2e['id'])})),..._0x48d186[_0x528ee0(0x1eb)](_0x15d93f=>({..._0x15d93f,'name':_0x15d93f['journeyBundleName'],'type':_0x528ee0(0x1fa)}))][_0x528ee0(0x1c3)]((_0x48bc4e,_0x205b36)=>_0x48bc4e['name'][_0x528ee0(0x1d2)](_0x205b36[_0x528ee0(0x1b4)]));await handleSDKOutput(_0x35635c,_0x342901);}else{if(_0x2f70bf===0x0)console[_0x528ee0(0x1f6)]('No\x20items\x20match\x20pattern:\x20'+_0x2968c6);else{console['log'](a43_0x2ddec6['dim']('['+_0x4d5034+_0x528ee0(0x1b2)+_0x2968c6+'\x27'));const _0xd9d20=formatFlatList(_0x542fb6,_0x7dfb84,{'showMetadata':!![],'getSegmentUrl':_0x412c3b},_0x48d186);console[_0x528ee0(0x1f6)](_0xd9d20);}}return 0x0;}async['listUnified'](_0x44ed11,_0x19865a){const _0x2a2b0e=a43_0xe35d57,{options:_0x3e773e,tdx:_0x2e8316}=_0x44ed11,_0x5a4413=await withSpinner(_0x2a2b0e(0x1fe)+_0x19865a+_0x2a2b0e(0x1e9),()=>_0x2e8316[_0x2a2b0e(0x1cb)]['resolvePathToResource'](_0x19865a),{'verbose':_0x3e773e[_0x2a2b0e(0x1f1)]}),_0x2e6650=_0x5a4413[_0x2a2b0e(0x1bf)];_0x3e773e[_0x2a2b0e(0x1f1)]&&(console[_0x2a2b0e(0x1c4)]('Parent\x20ID:\x20'+_0x2e6650['parentId']),_0x2e6650[_0x2a2b0e(0x1cd)]&&console[_0x2a2b0e(0x1c4)](_0x2a2b0e(0x1ec)+_0x2e6650[_0x2a2b0e(0x1cd)]));const _0x12d77b=await withSpinner(_0x2a2b0e(0x1f9),()=>_0x2e8316['segment'][_0x2a2b0e(0x1f5)](_0x2e6650[_0x2a2b0e(0x1c6)],_0x2e6650[_0x2a2b0e(0x1cd)]),{'verbose':_0x3e773e[_0x2a2b0e(0x1f1)]}),{folders:_0x28440f,segments:_0x1e19da,journeys:_0x19a05d}=_0x12d77b[_0x2a2b0e(0x1bf)],_0x4ca1fc=_0x28440f[_0x2a2b0e(0x1ca)]+_0x1e19da['length']+_0x19a05d[_0x2a2b0e(0x1ca)];console['error']('✔\x20Found\x20'+_0x28440f[_0x2a2b0e(0x1ca)]+_0x2a2b0e(0x1c7)+(_0x28440f['length']!==0x1?'s':'')+',\x20'+_0x1e19da[_0x2a2b0e(0x1ca)]+_0x2a2b0e(0x1b7)+(_0x1e19da[_0x2a2b0e(0x1ca)]!==0x1?'s':'')+_0x2a2b0e(0x1e8)+_0x19a05d[_0x2a2b0e(0x1ca)]+'\x20journey'+(_0x19a05d['length']!==0x1?'s':''));const _0x21fe12=_0x729b83=>{const _0x1b17b9=_0x2a2b0e;return getConsoleNextUrl(_0x3e773e['site'],_0x1b17b9(0x1ff)+_0x2e6650['parentId']+_0x1b17b9(0x1bb)+_0x729b83);},_0x2f4d4a=_0x3c38ca=>{const _0x537d8e=_0x2a2b0e;return getConsoleNextUrl(_0x3e773e[_0x537d8e(0x1df)],_0x537d8e(0x1ff)+_0x2e6650[_0x537d8e(0x1c6)]+_0x537d8e(0x1bb)+_0x3c38ca+_0x537d8e(0x1de));},_0x1b72dd=_0x3e773e['format']===_0x2a2b0e(0x1d3)||_0x3e773e[_0x2a2b0e(0x1fd)]===_0x2a2b0e(0x1f7);if(_0x1b72dd){const _0x1f065f=[..._0x28440f[_0x2a2b0e(0x1eb)](_0x19ad60=>({..._0x19ad60,'type':_0x2a2b0e(0x1b9)})),..._0x1e19da['map'](_0xe97bbe=>({..._0xe97bbe,'type':_0x2a2b0e(0x1cb),'url':_0x21fe12(_0xe97bbe['id'])})),..._0x19a05d[_0x2a2b0e(0x1eb)](_0x54f7be=>({..._0x54f7be,'name':_0x54f7be[_0x2a2b0e(0x1fb)],'type':_0x2a2b0e(0x1fa),'url':_0x2f4d4a(_0x54f7be['id'])}))][_0x2a2b0e(0x1c3)]((_0xe44d55,_0x58562b)=>_0xe44d55[_0x2a2b0e(0x1b4)][_0x2a2b0e(0x1d2)](_0x58562b[_0x2a2b0e(0x1b4)]));await handleSDKOutput(_0x1f065f,_0x3e773e);}else{if(_0x4ca1fc===0x0)console[_0x2a2b0e(0x1f6)](a43_0x2ddec6[_0x2a2b0e(0x1e6)]('['+_0x19865a+']')),console['log'](_0x2a2b0e(0x1dd));else{console[_0x2a2b0e(0x1f6)](a43_0x2ddec6[_0x2a2b0e(0x1e6)]('['+_0x19865a+']'));const _0x3f1595=formatFlatList(_0x28440f,_0x1e19da,{'showMetadata':!![],'getSegmentUrl':_0x21fe12,'getJourneyUrl':_0x2f4d4a},_0x19a05d);console[_0x2a2b0e(0x1f6)](_0x3f1595);}}return 0x0;}async[a43_0xe35d57(0x1c1)](_0x2cddc5,_0x3c2128){const _0x112bee=a43_0xe35d57,{options:_0x193830,tdx:_0x5de5f2}=_0x2cddc5,_0x3e64dc=await withSpinner(_0x112bee(0x1fe)+_0x3c2128+'\x27...',()=>_0x5de5f2['segment'][_0x112bee(0x1b3)](_0x3c2128),{'verbose':_0x193830[_0x112bee(0x1f1)]}),_0x3f639d=_0x3e64dc[_0x112bee(0x1bf)];_0x193830[_0x112bee(0x1f1)]&&(console['error'](_0x112bee(0x1d7)+_0x3f639d[_0x112bee(0x1c6)]),_0x3f639d[_0x112bee(0x1cd)]&&console['error'](_0x112bee(0x1ec)+_0x3f639d[_0x112bee(0x1cd)]));const _0x3c8f8a=_0x193830[_0x112bee(0x1d6)]||0xa,_0x3c6175=await withSpinner(_0x112bee(0x1c2),()=>_0x5de5f2[_0x112bee(0x1cb)][_0x112bee(0x1c1)](_0x3f639d['parentId'],_0x3f639d['folderId'],0x0,_0x3c8f8a),{'verbose':_0x193830[_0x112bee(0x1f1)]}),_0x3dfc82=_0x3c6175[_0x112bee(0x1bf)],_0x48bd6b=_0x4053ee=>{const _0x1cea24=_0x112bee;let _0x577254=0x0,_0x4aa849=0x0,_0x413c7f=0x0;for(const _0x17f6d1 of _0x4053ee){if(_0x17f6d1['type']==='folder')_0x577254++;else{if(_0x17f6d1[_0x1cea24(0x1e5)]==='segment')_0x4aa849++;else{if(_0x17f6d1[_0x1cea24(0x1e5)]==='journey')_0x413c7f++;}}if(_0x17f6d1[_0x1cea24(0x1d5)]){const _0x501730=_0x48bd6b(_0x17f6d1[_0x1cea24(0x1d5)]);_0x577254+=_0x501730[_0x1cea24(0x1c9)],_0x4aa849+=_0x501730[_0x1cea24(0x1ea)],_0x413c7f+=_0x501730[_0x1cea24(0x1d8)];}}return{'folders':_0x577254,'segments':_0x4aa849,'journeys':_0x413c7f};},_0x50476b=_0x48bd6b(_0x3dfc82);console[_0x112bee(0x1c4)](_0x112bee(0x1f0)+_0x50476b['folders']+_0x112bee(0x1c7)+(_0x50476b[_0x112bee(0x1c9)]!==0x1?'s':'')+',\x20'+_0x50476b[_0x112bee(0x1ea)]+'\x20segment'+(_0x50476b[_0x112bee(0x1ea)]!==0x1?'s':'')+',\x20and\x20'+_0x50476b[_0x112bee(0x1d8)]+_0x112bee(0x1e7)+(_0x50476b[_0x112bee(0x1d8)]!==0x1?'s':''));const _0x40ac67=_0x3ea18b=>{const _0x4be6d0=_0x112bee;return getConsoleNextUrl(_0x193830[_0x4be6d0(0x1df)],_0x4be6d0(0x1ff)+_0x3f639d[_0x4be6d0(0x1c6)]+_0x4be6d0(0x1bb)+_0x3ea18b);},_0x4a3a22=_0x2dbe45=>{const _0x2805b0=_0x112bee;return getConsoleNextUrl(_0x193830['site'],_0x2805b0(0x1ff)+_0x3f639d[_0x2805b0(0x1c6)]+'/e/'+_0x2dbe45+_0x2805b0(0x1de));};if(_0x193830[_0x112bee(0x1fd)]===_0x112bee(0x1d3)||_0x193830[_0x112bee(0x1fd)]===_0x112bee(0x1f7))await handleSDKOutput(_0x3dfc82,_0x193830);else{console[_0x112bee(0x1f6)](a43_0x2ddec6[_0x112bee(0x1e6)]('['+_0x3c2128+']'));const _0x1cbf93=formatTree(_0x3dfc82,{'showMetadata':!![],'getSegmentUrl':_0x40ac67,'getJourneyUrl':_0x4a3a22});console[_0x112bee(0x1f6)](_0x1cbf93);}return 0x0;}}
@@ -1 +1 @@
1
- function a44_0x13a3(){const _0x17e030=['✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','6793899IDhyyP','...','Database:\x20','data','args','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','2dAixMT','\x20row','23370570gwNpLH','4iBnPFm','✔\x20Retrieved\x20','Error:\x20','5399395nnPHVr','execute','1074102xzDxxg','cause','description','table','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','name','message','database','catalog','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','4872648AntkFt','3729342VYnjfg','validate','limit','Usage:\x20tdx\x20show\x20<database.table>','query','error','site','2626530wndyDt','showTable','Catalog:\x20','Limit:\x20','verbose','Querying\x20'];a44_0x13a3=function(){return _0x17e030;};return a44_0x13a3();}const a44_0xcc933=a44_0x2e04;(function(_0x5d2056,_0x58ba4b){const _0x1a91e7=a44_0x2e04,_0x99a0a9=_0x5d2056();while(!![]){try{const _0x103043=-parseInt(_0x1a91e7(0xef))/0x1*(-parseInt(_0x1a91e7(0xf7))/0x2)+parseInt(_0x1a91e7(0x103))/0x3+parseInt(_0x1a91e7(0xf2))/0x4*(-parseInt(_0x1a91e7(0xf5))/0x5)+parseInt(_0x1a91e7(0xe1))/0x6+parseInt(_0x1a91e7(0xe9))/0x7+parseInt(_0x1a91e7(0x102))/0x8+-parseInt(_0x1a91e7(0xf1))/0x9;if(_0x103043===_0x58ba4b)break;else _0x99a0a9['push'](_0x99a0a9['shift']());}catch(_0x5c2773){_0x99a0a9['push'](_0x99a0a9['shift']());}}}(a44_0x13a3,0xa0a50));function a44_0x2e04(_0x4a3e87,_0x35da1d){_0x4a3e87=_0x4a3e87-0xde;const _0x13a3d4=a44_0x13a3();let _0x2e0427=_0x13a3d4[_0x4a3e87];return _0x2e0427;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a44_0xcc933(0xfc)]='show';[a44_0xcc933(0xf9)]='Show\x20table\x20contents';async[a44_0xcc933(0xf6)](_0x316d98){const _0x435fe6=a44_0xcc933;return this[_0x435fe6(0xe2)](_0x316d98);}async['showTable'](_0x8b14f8){const _0x51efe2=a44_0xcc933,{options:_0xf59b0b,args:_0x3b8398,tdx:_0x2c8e09}=_0x8b14f8;let _0x2fd2f7;try{_0x2fd2f7=parseTableReference(_0x3b8398[0x0]);const _0x574d0a=_0xf59b0b[_0x51efe2(0xfe)];!_0x2fd2f7[_0x51efe2(0xfe)]&&_0x574d0a&&(_0x2fd2f7[_0x51efe2(0xfe)]=_0x574d0a);const _0x483899=validateTableDescribeReference(_0x2fd2f7);if(_0x483899)return console[_0x51efe2(0xdf)](_0x51efe2(0xf4)+_0x483899),console[_0x51efe2(0xdf)](_0x51efe2(0x106)),console['error'](_0x51efe2(0xe8)),console['error'](_0x51efe2(0xfb)),0x1;}catch(_0x4f5a54){return console['error'](_0x51efe2(0xf4)+_0x4f5a54[_0x51efe2(0xfd)]),console[_0x51efe2(0xdf)](_0x51efe2(0x106)),console['error'](_0x51efe2(0xe8)),console[_0x51efe2(0xdf)](_0x51efe2(0xfb)),0x1;}const _0x39c55d=_0x2fd2f7[_0x51efe2(0xff)],_0x44cd0b=_0x2fd2f7[_0x51efe2(0xfe)],_0x61643f=_0x2fd2f7[_0x51efe2(0xfa)],_0xeed77a=resolveLimit(_0xf59b0b[_0x51efe2(0x105)],DEFAULT_DISPLAY_LIMIT);try{_0xf59b0b[_0x51efe2(0xe5)]&&(console[_0x51efe2(0xdf)]('Site:\x20'+_0xf59b0b[_0x51efe2(0xe0)]),_0x39c55d&&console[_0x51efe2(0xdf)](_0x51efe2(0xe3)+_0x39c55d),console['error'](_0x51efe2(0xeb)+_0x44cd0b),console['error']('Table:\x20'+_0x61643f),console[_0x51efe2(0xdf)](_0x51efe2(0xe4)+_0xeed77a));const _0x30953b=_0x39c55d?_0x39c55d+'.'+_0x44cd0b+'.'+_0x61643f:_0x44cd0b+'.'+_0x61643f,_0x189f1=await withSpinner(_0x51efe2(0xe6)+_0x30953b+_0x51efe2(0xea),()=>_0x2c8e09[_0x51efe2(0xde)][_0x51efe2(0xe2)](_0x44cd0b,_0x61643f,_0xeed77a,_0x39c55d),{'verbose':_0xf59b0b[_0x51efe2(0xe5)]}),_0x4ced04=_0x189f1[_0x51efe2(0xec)],_0x44c27f=_0x4ced04[_0x51efe2(0xec)];return _0x44c27f['length']===0x0?console[_0x51efe2(0xdf)](_0x51efe2(0xe7)):console[_0x51efe2(0xdf)](_0x51efe2(0xf3)+_0x44c27f[_0x51efe2(0x101)]+_0x51efe2(0xf0)+(_0x44c27f[_0x51efe2(0x101)]!==0x1?'s':'')+'\x20from\x20'+_0x30953b),await handleSDKOutput(_0x44c27f,_0xf59b0b),0x0;}catch(_0xfdfb67){if(_0xfdfb67 instanceof SDKError)return console[_0x51efe2(0xdf)](_0x51efe2(0xf4)+_0xfdfb67[_0x51efe2(0xfd)]),_0xfdfb67[_0x51efe2(0xf8)]&&console[_0x51efe2(0xdf)]('\x20\x20Cause:\x20'+_0xfdfb67[_0x51efe2(0xf8)]),0x1;throw _0xfdfb67;}}[a44_0xcc933(0x104)](_0x16dc0f){const _0x2d834b=a44_0xcc933;if(_0x16dc0f[_0x2d834b(0xed)][_0x2d834b(0x101)]===0x0)return _0x2d834b(0xee);if(_0x16dc0f[_0x2d834b(0xed)][_0x2d834b(0x101)]>0x1)return _0x2d834b(0x100);return undefined;}}
1
+ const a44_0x11976f=a44_0x3307;function a44_0x3307(_0x1f70f9,_0x2ce2d7){_0x1f70f9=_0x1f70f9-0xb7;const _0x22700a=a44_0x2270();let _0x3307f5=_0x22700a[_0x1f70f9];return _0x3307f5;}(function(_0x18e679,_0x3fb817){const _0x2db4e2=a44_0x3307,_0x291470=_0x18e679();while(!![]){try{const _0x140c47=parseInt(_0x2db4e2(0xdf))/0x1+-parseInt(_0x2db4e2(0xdd))/0x2+parseInt(_0x2db4e2(0xd1))/0x3*(-parseInt(_0x2db4e2(0xd7))/0x4)+parseInt(_0x2db4e2(0xdc))/0x5+-parseInt(_0x2db4e2(0xba))/0x6*(parseInt(_0x2db4e2(0xd8))/0x7)+-parseInt(_0x2db4e2(0xbf))/0x8+parseInt(_0x2db4e2(0xd9))/0x9*(parseInt(_0x2db4e2(0xbe))/0xa);if(_0x140c47===_0x3fb817)break;else _0x291470['push'](_0x291470['shift']());}catch(_0x54a832){_0x291470['push'](_0x291470['shift']());}}}(a44_0x2270,0xd1c30));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x2270(){const _0x2388bc=['data','✔\x20Retrieved\x20','table','Catalog:\x20','\x20row','...','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Database:\x20','Show\x20table\x20contents','message','execute','args','Usage:\x20tdx\x20show\x20<database.table>','validate','Site:\x20','906gdaunr','limit','showTable','Error:\x20','site','catalog','2384kIYXaC','28EIsXhr','4622184pDsKOX','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','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','6171060viwBCX','915014rCIjgI','show','1176793GAsUpJ','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','length','query','\x20\x20Cause:\x20','error','2222562vcCvaL','verbose','database','Limit:\x20','20Hobeqt','3678128AhvVXK','Table:\x20','cause'];a44_0x2270=function(){return _0x2388bc;};return a44_0x2270();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a44_0x11976f(0xde);['description']=a44_0x11976f(0xca);async[a44_0x11976f(0xcc)](_0x5993c6){const _0x2e3e0f=a44_0x11976f;return this[_0x2e3e0f(0xd3)](_0x5993c6);}async['showTable'](_0x15045e){const _0x34d5b3=a44_0x11976f,{options:_0x5890ff,args:_0x5880bc,tdx:_0x228aca}=_0x15045e;let _0x577de2;try{_0x577de2=parseTableReference(_0x5880bc[0x0]);const _0x2be7f1=_0x5890ff['database'];!_0x577de2['database']&&_0x2be7f1&&(_0x577de2[_0x34d5b3(0xbc)]=_0x2be7f1);const _0x1f1cbc=validateTableDescribeReference(_0x577de2);if(_0x1f1cbc)return console[_0x34d5b3(0xb9)](_0x34d5b3(0xd4)+_0x1f1cbc),console['error'](_0x34d5b3(0xce)),console[_0x34d5b3(0xb9)](_0x34d5b3(0xe0)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x12edf0){return console[_0x34d5b3(0xb9)](_0x34d5b3(0xd4)+_0x12edf0[_0x34d5b3(0xcb)]),console['error'](_0x34d5b3(0xce)),console[_0x34d5b3(0xb9)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x34d5b3(0xc8)),0x1;}const _0x13f700=_0x577de2[_0x34d5b3(0xd6)],_0xc55e75=_0x577de2[_0x34d5b3(0xbc)],_0x48585a=_0x577de2[_0x34d5b3(0xc4)],_0x5dce3c=resolveLimit(_0x5890ff[_0x34d5b3(0xd2)],DEFAULT_DISPLAY_LIMIT);try{_0x5890ff['verbose']&&(console[_0x34d5b3(0xb9)](_0x34d5b3(0xd0)+_0x5890ff[_0x34d5b3(0xd5)]),_0x13f700&&console[_0x34d5b3(0xb9)](_0x34d5b3(0xc5)+_0x13f700),console[_0x34d5b3(0xb9)](_0x34d5b3(0xc9)+_0xc55e75),console[_0x34d5b3(0xb9)](_0x34d5b3(0xc0)+_0x48585a),console[_0x34d5b3(0xb9)](_0x34d5b3(0xbd)+_0x5dce3c));const _0x5a187c=_0x13f700?_0x13f700+'.'+_0xc55e75+'.'+_0x48585a:_0xc55e75+'.'+_0x48585a,_0x33f6fc=await withSpinner('Querying\x20'+_0x5a187c+_0x34d5b3(0xc7),()=>_0x228aca[_0x34d5b3(0xb7)]['showTable'](_0xc55e75,_0x48585a,_0x5dce3c,_0x13f700),{'verbose':_0x5890ff[_0x34d5b3(0xbb)]}),_0x468d32=_0x33f6fc['data'],_0x670c72=_0x468d32[_0x34d5b3(0xc2)];return _0x670c72[_0x34d5b3(0xe1)]===0x0?console[_0x34d5b3(0xb9)](_0x34d5b3(0xda)):console[_0x34d5b3(0xb9)](_0x34d5b3(0xc3)+_0x670c72[_0x34d5b3(0xe1)]+_0x34d5b3(0xc6)+(_0x670c72['length']!==0x1?'s':'')+'\x20from\x20'+_0x5a187c),await handleSDKOutput(_0x670c72,_0x5890ff),0x0;}catch(_0x2e9071){if(_0x2e9071 instanceof SDKError)return console['error'](_0x34d5b3(0xd4)+_0x2e9071[_0x34d5b3(0xcb)]),_0x2e9071[_0x34d5b3(0xc1)]&&console[_0x34d5b3(0xb9)](_0x34d5b3(0xb8)+_0x2e9071[_0x34d5b3(0xc1)]),0x1;throw _0x2e9071;}}[a44_0x11976f(0xcf)](_0x475a43){const _0x1a5e6e=a44_0x11976f;if(_0x475a43[_0x1a5e6e(0xcd)]['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(_0x475a43[_0x1a5e6e(0xcd)][_0x1a5e6e(0xe1)]>0x1)return _0x1a5e6e(0xdb);return undefined;}}
@@ -1 +1 @@
1
- const a45_0x2ffeb5=a45_0x4442;(function(_0x47c17d,_0x44b9e1){const _0x2b4151=a45_0x4442,_0x31b39b=_0x47c17d();while(!![]){try{const _0x350482=parseInt(_0x2b4151(0xe6))/0x1+-parseInt(_0x2b4151(0xf8))/0x2+parseInt(_0x2b4151(0xfc))/0x3+parseInt(_0x2b4151(0xff))/0x4*(-parseInt(_0x2b4151(0xde))/0x5)+-parseInt(_0x2b4151(0xf1))/0x6*(parseInt(_0x2b4151(0xf3))/0x7)+parseInt(_0x2b4151(0xfe))/0x8*(parseInt(_0x2b4151(0xec))/0x9)+parseInt(_0x2b4151(0xea))/0xa;if(_0x350482===_0x44b9e1)break;else _0x31b39b['push'](_0x31b39b['shift']());}catch(_0x17764c){_0x31b39b['push'](_0x31b39b['shift']());}}}(a45_0x383b,0x277cd));import{BaseCommand,printAuthError}from'./command.js';function a45_0x383b(){const _0x563cff=['site:\x20','green','displayWithSources','profile','Name:','236253JdniHh','CLI\x20flag','dim','\x20profile:\x20','3285400jDouLv','✗\x20Validation\x20failed:\x20','27kwuBRl','OAuth','User:','description','first_name','1153638EYnzmD','last_name','7chxVbs','bold','cyan','error','log','622870bvKqOa','jobs','account_id','profileSource','246714gTbmFj','Account\x20ID:','771320pqIzmI','12172zEDqqY','(from\x20','Credential\x20type:\x20','tdx','env','TDX_PROFILE\x20env','status','session','config','No\x20credential\x20found','yellow','445KXsxhZ','filter','red'];a45_0x383b=function(){return _0x563cff;};return a45_0x383b();}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a45_0x4f8982 from'chalk';function a45_0x4442(_0x1add34,_0x57e7bd){_0x1add34=_0x1add34-0xde;const _0x383bc5=a45_0x383b();let _0x44428e=_0x383bc5[_0x1add34];return _0x44428e;}export class StatusCommand extends BaseCommand{['name']='status';[a45_0x2ffeb5(0xef)]='Show\x20authentication\x20status\x20and\x20current\x20context';async['execute'](_0x5949f1){const _0x1fcb76=a45_0x2ffeb5,{options:_0x1431bb,tdx:_0xb0f04e}=_0x5949f1,_0x44b66b=_0x1431bb['site'],_0x6d6652=new GlobalContext(_0x1431bb),_0x27ac37=_0x6d6652[_0x1fcb76(0xe4)],_0x28d8b2=_0x6d6652[_0x1fcb76(0xfb)],_0x341a83=_0x28d8b2==='cli'?_0x1fcb76(0xe7):_0x28d8b2===_0x1fcb76(0x106)?_0x1fcb76(0x106):_0x28d8b2===_0x1fcb76(0x103)?_0x1fcb76(0x104):_0x28d8b2===_0x1fcb76(0x107)?_0x1fcb76(0x107):null,_0x124686=_0x27ac37?a45_0x4f8982['cyan'](_0x27ac37):a45_0x4f8982[_0x1fcb76(0xe8)]('N/A'),_0x42386d=_0x341a83?'\x20'+a45_0x4f8982['dim'](_0x1fcb76(0x100)+_0x341a83+')'):'';console[_0x1fcb76(0xf7)](a45_0x4f8982['bold'](_0x1fcb76(0x102))+_0x1fcb76(0xe9)+_0x124686+_0x42386d+'\x20'+a45_0x4f8982[_0x1fcb76(0xe8)]('(')+_0x1fcb76(0xe1)+a45_0x4f8982[_0x1fcb76(0xf5)](_0x44b66b)+a45_0x4f8982[_0x1fcb76(0xe8)](')'));const _0x306c38=await getOAuthTokens(_0x27ac37);if(_0x306c38)console['log'](_0x1fcb76(0x101)+a45_0x4f8982[_0x1fcb76(0xf5)](_0x1fcb76(0xed)));else{const _0x1a6be3=await resolveAPIKeyAsync(_0x44b66b,_0x27ac37);if(_0x1a6be3){const {source:_0x128194,isDeprecated:_0x1b9e26}=_0x1a6be3,_0x2e215a='Read\x20credential\x20from\x20'+a45_0x4f8982['cyan'](_0x128194);console[_0x1fcb76(0xf7)](_0x1b9e26?a45_0x4f8982[_0x1fcb76(0x109)](_0x2e215a):_0x2e215a);}else console[_0x1fcb76(0xf7)](a45_0x4f8982[_0x1fcb76(0x109)](_0x1fcb76(0x108)));}let _0x31d9d5=![];try{const _0x396210=await _0xb0f04e[_0x1fcb76(0xf9)]['getUserInfo']();console[_0x1fcb76(0xf7)](a45_0x4f8982[_0x1fcb76(0xe2)]('✓\x20Authentication\x20successful\x0a')),console[_0x1fcb76(0xf7)](a45_0x4f8982[_0x1fcb76(0xf4)](_0x1fcb76(0xee))+'\x20'+a45_0x4f8982[_0x1fcb76(0xf5)](_0x396210['email']));if(_0x396210[_0x1fcb76(0xf0)]||_0x396210[_0x1fcb76(0xf2)]){const _0x221668=[_0x396210[_0x1fcb76(0xf0)],_0x396210[_0x1fcb76(0xf2)]][_0x1fcb76(0xdf)](Boolean)['join']('\x20');console['log'](a45_0x4f8982[_0x1fcb76(0xf4)](_0x1fcb76(0xe5))+'\x20'+_0x221668);}_0x396210[_0x1fcb76(0xfa)]&&console['log'](a45_0x4f8982[_0x1fcb76(0xf4)](_0x1fcb76(0xfd))+'\x20'+a45_0x4f8982[_0x1fcb76(0x109)](_0x396210['account_id'])),_0x31d9d5=!![];}catch(_0x48dfae){_0x48dfae instanceof HTTPClientError&&_0x48dfae[_0x1fcb76(0x105)]===0x191?printAuthError(_0x48dfae,!![],_0x27ac37):console[_0x1fcb76(0xf6)](a45_0x4f8982[_0x1fcb76(0xe0)](_0x1fcb76(0xeb)+(_0x48dfae instanceof Error?_0x48dfae['message']:String(_0x48dfae))));}return console[_0x1fcb76(0xf7)](),_0x6d6652[_0x1fcb76(0xe3)](),_0x31d9d5?0x0:0x1;}}
1
+ const a45_0x2a7eb8=a45_0x9e28;(function(_0xd997c2,_0x496d44){const _0x174667=a45_0x9e28,_0x3c1ed1=_0xd997c2();while(!![]){try{const _0x2e3d16=parseInt(_0x174667(0xa5))/0x1+-parseInt(_0x174667(0xa2))/0x2*(parseInt(_0x174667(0xa8))/0x3)+-parseInt(_0x174667(0xc8))/0x4+-parseInt(_0x174667(0xb6))/0x5*(parseInt(_0x174667(0xc7))/0x6)+-parseInt(_0x174667(0xc9))/0x7+parseInt(_0x174667(0xb8))/0x8+parseInt(_0x174667(0xc2))/0x9;if(_0x2e3d16===_0x496d44)break;else _0x3c1ed1['push'](_0x3c1ed1['shift']());}catch(_0x54445e){_0x3c1ed1['push'](_0x3c1ed1['shift']());}}}(a45_0x2ff3,0xad0b3));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a45_0x524643 from'chalk';function a45_0x9e28(_0x1efefe,_0x1826a2){_0x1efefe=_0x1efefe-0x9f;const _0x2ff388=a45_0x2ff3();let _0x9e2838=_0x2ff388[_0x1efefe];return _0x9e2838;}export class StatusCommand extends BaseCommand{[a45_0x2a7eb8(0xab)]=a45_0x2a7eb8(0xa4);[a45_0x2a7eb8(0xba)]=a45_0x2a7eb8(0xb2);async[a45_0x2a7eb8(0xc5)](_0x25a5b2){const _0x21d8f7=a45_0x2a7eb8,{options:_0x308893,tdx:_0x97f677}=_0x25a5b2,_0x282079=_0x308893[_0x21d8f7(0xb7)],_0x3248c0=new GlobalContext(_0x308893),_0x2aa6a8=_0x3248c0[_0x21d8f7(0xc6)],_0x2a37d0=_0x3248c0['profileSource'],_0x28e3bb=_0x2a37d0==='cli'?'CLI\x20flag':_0x2a37d0==='session'?'session':_0x2a37d0===_0x21d8f7(0xbe)?_0x21d8f7(0xb5):_0x2a37d0===_0x21d8f7(0xb3)?_0x21d8f7(0xb3):null,_0x1fc8a8=_0x2aa6a8?a45_0x524643['cyan'](_0x2aa6a8):a45_0x524643[_0x21d8f7(0xb4)](_0x21d8f7(0xa0)),_0x536d6c=_0x28e3bb?'\x20'+a45_0x524643[_0x21d8f7(0xb4)](_0x21d8f7(0xaa)+_0x28e3bb+')'):'';console[_0x21d8f7(0xaf)](a45_0x524643[_0x21d8f7(0xb9)](_0x21d8f7(0xcb))+_0x21d8f7(0xa6)+_0x1fc8a8+_0x536d6c+'\x20'+a45_0x524643[_0x21d8f7(0xb4)]('(')+_0x21d8f7(0xc4)+a45_0x524643[_0x21d8f7(0xad)](_0x282079)+a45_0x524643[_0x21d8f7(0xb4)](')'));const _0x495fdd=await getOAuthTokens(_0x2aa6a8);if(_0x495fdd)console[_0x21d8f7(0xaf)](_0x21d8f7(0xae)+a45_0x524643['cyan']('OAuth'));else{const _0xef145a=await resolveAPIKeyAsync(_0x282079,_0x2aa6a8);if(_0xef145a){const {source:_0x34fe5b,isDeprecated:_0x4d34d5}=_0xef145a,_0x4c91c7=_0x21d8f7(0xa9)+a45_0x524643[_0x21d8f7(0xad)](_0x34fe5b);console[_0x21d8f7(0xaf)](_0x4d34d5?a45_0x524643[_0x21d8f7(0xa3)](_0x4c91c7):_0x4c91c7);}else console['log'](a45_0x524643[_0x21d8f7(0xa3)](_0x21d8f7(0xc0)));}let _0x576eb5=![];try{const _0x15aa9e=await _0x97f677[_0x21d8f7(0xa1)][_0x21d8f7(0xc3)]();console[_0x21d8f7(0xaf)](a45_0x524643['green'](_0x21d8f7(0xca))),console[_0x21d8f7(0xaf)](a45_0x524643[_0x21d8f7(0xb9)]('User:')+'\x20'+a45_0x524643[_0x21d8f7(0xad)](_0x15aa9e[_0x21d8f7(0xbb)]));if(_0x15aa9e[_0x21d8f7(0xbf)]||_0x15aa9e[_0x21d8f7(0xbc)]){const _0x498a00=[_0x15aa9e['first_name'],_0x15aa9e[_0x21d8f7(0xbc)]][_0x21d8f7(0x9f)](Boolean)[_0x21d8f7(0xb0)]('\x20');console['log'](a45_0x524643['bold']('Name:')+'\x20'+_0x498a00);}_0x15aa9e['account_id']&&console['log'](a45_0x524643['bold'](_0x21d8f7(0xa7))+'\x20'+a45_0x524643[_0x21d8f7(0xa3)](_0x15aa9e[_0x21d8f7(0xc1)])),_0x576eb5=!![];}catch(_0x589914){_0x589914 instanceof HTTPClientError&&_0x589914['status']===0x191?printAuthError(_0x589914,!![],_0x2aa6a8):console[_0x21d8f7(0xb1)](a45_0x524643['red'](_0x21d8f7(0xbd)+(_0x589914 instanceof Error?_0x589914['message']:String(_0x589914))));}return console['log'](),_0x3248c0[_0x21d8f7(0xac)](),_0x576eb5?0x0:0x1;}}function a45_0x2ff3(){const _0x20e5df=['config','dim','TDX_PROFILE\x20env','4274780LVVxzz','site','8721968KiJcXg','bold','description','email','last_name','✗\x20Validation\x20failed:\x20','env','first_name','No\x20credential\x20found','account_id','31789062BbcgrJ','getUserInfo','site:\x20','execute','profile','6sWCNWm','5345648TxYghF','8993775VYyEIS','✓\x20Authentication\x20successful\x0a','tdx','filter','N/A','jobs','1592198FsQUyK','yellow','status','358715qSTaWl','\x20profile:\x20','Account\x20ID:','3CFFysR','Read\x20credential\x20from\x20','(from\x20','name','displayWithSources','cyan','Credential\x20type:\x20','log','join','error','Show\x20authentication\x20status\x20and\x20current\x20context'];a45_0x2ff3=function(){return _0x20e5df;};return a45_0x2ff3();}
@@ -1 +1 @@
1
- const a46_0x2d6421=a46_0x4d99;function a46_0x563c(){const _0xc36bdd=['.*\x22','Note:\x20\x27','Table\x20pattern:\x20','\x20table','6800ryGKac','includes','Database:\x20','length','6BdkHxS','description','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','✔\x20Found\x20','Error:\x20','983258vkzwOb','9906580kSOVQM','62034IPypMQ','Error:\x20Pattern\x20\x27','error','data','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Database\x20\x27','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','database_name','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','11jnYDAS','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','📋\x20','verbose','tables','Site:\x20','name','8649pESCQx','721FayeDa','Database\x20pattern:\x20','121132ZzOLRx','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','4925240vxUZPC','listTables','table_name','cause','execute','547470BbDQBh','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','List\x20tables\x20in\x20a\x20database','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','limit','message','site','table','\x27\x20across\x20all\x20databases.','database','validate','log'];a46_0x563c=function(){return _0xc36bdd;};return a46_0x563c();}(function(_0x5e5cf1,_0x3adfd6){const _0x30f599=a46_0x4d99,_0x17e05a=_0x5e5cf1();while(!![]){try{const _0x3577d6=parseInt(_0x30f599(0x201))/0x1+-parseInt(_0x30f599(0x1eb))/0x2*(-parseInt(_0x30f599(0x1e6))/0x3)+-parseInt(_0x30f599(0x203))/0x4+parseInt(_0x30f599(0x208))/0x5+parseInt(_0x30f599(0x1ed))/0x6*(-parseInt(_0x30f599(0x1ff))/0x7)+-parseInt(_0x30f599(0x218))/0x8*(-parseInt(_0x30f599(0x1fe))/0x9)+parseInt(_0x30f599(0x1ec))/0xa*(parseInt(_0x30f599(0x1f7))/0xb);if(_0x3577d6===_0x3adfd6)break;else _0x17e05a['push'](_0x17e05a['shift']());}catch(_0x160d10){_0x17e05a['push'](_0x17e05a['shift']());}}}(a46_0x563c,0xb10ad));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x4d99(_0x4635cb,_0x93e393){_0x4635cb=_0x4635cb-0x1e3;const _0x563c86=a46_0x563c();let _0x4d998f=_0x563c86[_0x4635cb];return _0x4d998f;}import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a46_0x2d6421(0x1fd)]=a46_0x2d6421(0x1fb);[a46_0x2d6421(0x1e7)]=a46_0x2d6421(0x20a);async[a46_0x2d6421(0x207)](_0x4bcb44){const _0x169096=a46_0x2d6421,{options:_0x279eba,args:_0x126110,tdx:_0x156deb}=_0x4bcb44;let _0x134406;if(_0x126110[_0x169096(0x1e5)]===0x0)_0x134406={'database':undefined,'table':undefined,'original':''};else{if(_0x126110[_0x169096(0x1e5)]===0x1)try{_0x134406=parseTableReference(_0x126110[0x0]);if(_0x134406[_0x169096(0x20f)]&&!_0x134406[_0x169096(0x211)]&&!_0x134406['table'][_0x169096(0x1e3)]('*')&&!_0x134406[_0x169096(0x20f)][_0x169096(0x1e3)]('?'))return console[_0x169096(0x1ef)](_0x169096(0x1ee)+_0x126110[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x169096(0x1ef)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x134406[_0x169096(0x20f)]+'\x27?'),console[_0x169096(0x1ef)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x134406[_0x169096(0x20f)]+_0x169096(0x214)),console['error'](_0x169096(0x1e8)+_0x134406[_0x169096(0x20f)]),console[_0x169096(0x1ef)](_0x169096(0x20b)+_0x134406[_0x169096(0x20f)]),console[_0x169096(0x1ef)](''),console[_0x169096(0x1ef)](_0x169096(0x215)+_0x126110[0x0]+_0x169096(0x1f4)+_0x134406['table']+_0x169096(0x210)),0x1;}catch(_0x5e8f1d){return console[_0x169096(0x1ef)](_0x169096(0x1ea)+_0x5e8f1d[_0x169096(0x20d)]),0x1;}else return console['error']('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console['error'](_0x169096(0x1f6)),console[_0x169096(0x1ef)](_0x169096(0x1f8)),console[_0x169096(0x1ef)](_0x169096(0x1f1)),console['error'](_0x169096(0x1f2)),console['error']('Or\x20use\x20--in\x20flag:'),console[_0x169096(0x1ef)](_0x169096(0x209)),0x1;}const _0x48ac53=_0x279eba['database'];!_0x134406['database']&&_0x48ac53&&(_0x134406['database']=_0x48ac53);try{const _0x3c9b26=_0x11197b=>_0x11197b&&(_0x11197b[_0x169096(0x1e3)]('*')||_0x11197b[_0x169096(0x1e3)]('?')),_0x35fcac=_0x3c9b26(_0x134406[_0x169096(0x211)]);_0x279eba[_0x169096(0x1fa)]&&(console[_0x169096(0x1ef)](_0x169096(0x1fc)+_0x279eba[_0x169096(0x20e)]),_0x134406[_0x169096(0x211)]?_0x35fcac?console['error'](_0x169096(0x200)+_0x134406['database']):console['error'](_0x169096(0x1e4)+_0x134406[_0x169096(0x211)]):console['error']('Database:\x20all'),_0x134406['table']&&console[_0x169096(0x1ef)](_0x169096(0x216)+_0x134406[_0x169096(0x20f)]));const _0x4b06cc=_0x134406['database']&&!_0x35fcac?_0x134406[_0x169096(0x211)]:undefined,_0x5710a1=_0x35fcac?_0x134406[_0x169096(0x211)]:undefined,_0x717894=_0x134406['table'],_0x310824=resolveLimit(_0x279eba[_0x169096(0x20c)],DEFAULT_LISTING_LIMIT),_0x503b18=await withSpinner('Listing\x20tables...',()=>_0x156deb['query'][_0x169096(0x204)](_0x4b06cc,_0x717894,_0x5710a1,_0x310824),{'verbose':_0x279eba['verbose']}),_0x7ba03c=_0x503b18[_0x169096(0x1f0)];if(_0x7ba03c['length']===0x0&&_0x134406[_0x169096(0x211)]&&!_0x35fcac)return console[_0x169096(0x1ef)]('✖\x20No\x20tables\x20found'),console[_0x169096(0x1ef)](_0x169096(0x1f3)+_0x134406['database']+_0x169096(0x202)),0x1;console[_0x169096(0x1ef)](_0x169096(0x1e9)+_0x7ba03c['length']+_0x169096(0x217)+(_0x7ba03c['length']!==0x1?'s':''));if(isStructuredFormat(_0x279eba))await handleSDKOutput(_0x7ba03c,{..._0x279eba,'limit':_0x310824});else for(const _0x3cb909 of _0x7ba03c){const _0x1e314e=_0x3cb909['database_name']?_0x3cb909[_0x169096(0x1f5)]+'.':'';console[_0x169096(0x213)](_0x169096(0x1f9)+_0x1e314e+_0x3cb909[_0x169096(0x205)]);}return 0x0;}catch(_0x96abe6){if(_0x96abe6 instanceof SDKError)return console[_0x169096(0x1ef)](_0x169096(0x1ea)+_0x96abe6[_0x169096(0x20d)]),_0x96abe6[_0x169096(0x206)]&&console['error']('\x20\x20Cause:\x20'+_0x96abe6[_0x169096(0x206)]),0x1;throw _0x96abe6;}}[a46_0x2d6421(0x212)](_0x1ce7be){return undefined;}}
1
+ const a46_0x57f207=a46_0x5c07;(function(_0x32c6de,_0x3415fd){const _0x23c2bb=a46_0x5c07,_0x201f33=_0x32c6de();while(!![]){try{const _0x83da8d=parseInt(_0x23c2bb(0x209))/0x1*(-parseInt(_0x23c2bb(0x20f))/0x2)+-parseInt(_0x23c2bb(0x1df))/0x3*(parseInt(_0x23c2bb(0x217))/0x4)+parseInt(_0x23c2bb(0x1e6))/0x5*(parseInt(_0x23c2bb(0x1f2))/0x6)+-parseInt(_0x23c2bb(0x212))/0x7+-parseInt(_0x23c2bb(0x207))/0x8*(parseInt(_0x23c2bb(0x1ff))/0x9)+parseInt(_0x23c2bb(0x1e5))/0xa*(-parseInt(_0x23c2bb(0x20b))/0xb)+parseInt(_0x23c2bb(0x20a))/0xc;if(_0x83da8d===_0x3415fd)break;else _0x201f33['push'](_0x201f33['shift']());}catch(_0x239805){_0x201f33['push'](_0x201f33['shift']());}}}(a46_0x446e,0xc8ac6));function a46_0x446e(){const _0x540868=['\x27\x20across\x20all\x20databases.','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','37464lyyDfF','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','1314317CdqOpb','57593628mGeVip','396UycXuI','\x20table','List\x20tables\x20in\x20a\x20database','description','2bJgNAM','site','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','5956174NTaVRd','query','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x27\x20is\x20ambiguous.','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','1033012RRYOQd','name','Error:\x20','6yjzjQi','Note:\x20\x27','execute','log','Listing\x20tables...','Site:\x20','374030lRrvCT','21130CBWSFB','length','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','database','\x20\x20Use:\x20tdx\x20tables\x20\x22','.*\x22','Database:\x20','\x20\x20Cause:\x20','database_name','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Table\x20pattern:\x20','564JNDHlF','Or\x20use\x20--in\x20flag:','includes','📋\x20','error','Database\x20pattern:\x20','Database:\x20all','✔\x20Found\x20','message','validate','verbose','✖\x20No\x20tables\x20found','limit','666sykcKT','cause','tables','table_name','data','table'];a46_0x446e=function(){return _0x540868;};return a46_0x446e();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a46_0x5c07(_0x538a97,_0x22f4bf){_0x538a97=_0x538a97-0x1de;const _0x446e9d=a46_0x446e();let _0x5c0765=_0x446e9d[_0x538a97];return _0x5c0765;}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a46_0x57f207(0x218)]=a46_0x57f207(0x201);[a46_0x57f207(0x20e)]=a46_0x57f207(0x20d);async[a46_0x57f207(0x1e1)](_0x28e82c){const _0x547ca7=a46_0x57f207,{options:_0x3e366e,args:_0x39ab18,tdx:_0x953119}=_0x28e82c;let _0x59901c;if(_0x39ab18['length']===0x0)_0x59901c={'database':undefined,'table':undefined,'original':''};else{if(_0x39ab18[_0x547ca7(0x1e7)]===0x1)try{_0x59901c=parseTableReference(_0x39ab18[0x0]);if(_0x59901c[_0x547ca7(0x204)]&&!_0x59901c['database']&&!_0x59901c[_0x547ca7(0x204)][_0x547ca7(0x1f4)]('*')&&!_0x59901c[_0x547ca7(0x204)]['includes']('?'))return console['error']('Error:\x20Pattern\x20\x27'+_0x39ab18[0x0]+_0x547ca7(0x215)),console[_0x547ca7(0x1f6)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x59901c[_0x547ca7(0x204)]+'\x27?'),console[_0x547ca7(0x1f6)](_0x547ca7(0x1eb)+_0x59901c['table']+_0x547ca7(0x1ec)),console[_0x547ca7(0x1f6)](_0x547ca7(0x1f0)+_0x59901c[_0x547ca7(0x204)]),console[_0x547ca7(0x1f6)](_0x547ca7(0x1e9)+_0x59901c[_0x547ca7(0x204)]),console[_0x547ca7(0x1f6)](''),console[_0x547ca7(0x1f6)](_0x547ca7(0x1e0)+_0x39ab18[0x0]+_0x547ca7(0x211)+_0x59901c[_0x547ca7(0x204)]+_0x547ca7(0x205)),0x1;}catch(_0x3940f3){return console[_0x547ca7(0x1f6)](_0x547ca7(0x1de)+_0x3940f3[_0x547ca7(0x1fa)]),0x1;}else return console[_0x547ca7(0x1f6)](_0x547ca7(0x216)),console[_0x547ca7(0x1f6)](_0x547ca7(0x214)),console['error'](_0x547ca7(0x208)),console['error'](_0x547ca7(0x206)),console[_0x547ca7(0x1f6)](_0x547ca7(0x1e8)),console[_0x547ca7(0x1f6)](_0x547ca7(0x1f3)),console[_0x547ca7(0x1f6)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x2c8ae8=_0x3e366e[_0x547ca7(0x1ea)];!_0x59901c[_0x547ca7(0x1ea)]&&_0x2c8ae8&&(_0x59901c[_0x547ca7(0x1ea)]=_0x2c8ae8);try{const _0x2822f4=_0x5d7ff2=>_0x5d7ff2&&(_0x5d7ff2['includes']('*')||_0x5d7ff2[_0x547ca7(0x1f4)]('?')),_0x1c1886=_0x2822f4(_0x59901c[_0x547ca7(0x1ea)]);_0x3e366e[_0x547ca7(0x1fc)]&&(console[_0x547ca7(0x1f6)](_0x547ca7(0x1e4)+_0x3e366e[_0x547ca7(0x210)]),_0x59901c[_0x547ca7(0x1ea)]?_0x1c1886?console[_0x547ca7(0x1f6)](_0x547ca7(0x1f7)+_0x59901c['database']):console[_0x547ca7(0x1f6)](_0x547ca7(0x1ed)+_0x59901c[_0x547ca7(0x1ea)]):console['error'](_0x547ca7(0x1f8)),_0x59901c[_0x547ca7(0x204)]&&console[_0x547ca7(0x1f6)](_0x547ca7(0x1f1)+_0x59901c['table']));const _0x23363a=_0x59901c['database']&&!_0x1c1886?_0x59901c['database']:undefined,_0x44d3a5=_0x1c1886?_0x59901c['database']:undefined,_0x3086bc=_0x59901c[_0x547ca7(0x204)],_0x338af9=resolveLimit(_0x3e366e[_0x547ca7(0x1fe)],DEFAULT_LISTING_LIMIT),_0x50dd54=await withSpinner(_0x547ca7(0x1e3),()=>_0x953119[_0x547ca7(0x213)]['listTables'](_0x23363a,_0x3086bc,_0x44d3a5,_0x338af9),{'verbose':_0x3e366e[_0x547ca7(0x1fc)]}),_0xae9404=_0x50dd54[_0x547ca7(0x203)];if(_0xae9404['length']===0x0&&_0x59901c['database']&&!_0x1c1886)return console[_0x547ca7(0x1f6)](_0x547ca7(0x1fd)),console['error']('Database\x20\x27'+_0x59901c[_0x547ca7(0x1ea)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;console[_0x547ca7(0x1f6)](_0x547ca7(0x1f9)+_0xae9404[_0x547ca7(0x1e7)]+_0x547ca7(0x20c)+(_0xae9404[_0x547ca7(0x1e7)]!==0x1?'s':''));if(isStructuredFormat(_0x3e366e))await handleSDKOutput(_0xae9404,{..._0x3e366e,'limit':_0x338af9});else for(const _0x3e9e47 of _0xae9404){const _0x2f107a=_0x3e9e47[_0x547ca7(0x1ef)]?_0x3e9e47[_0x547ca7(0x1ef)]+'.':'';console[_0x547ca7(0x1e2)](_0x547ca7(0x1f5)+_0x2f107a+_0x3e9e47[_0x547ca7(0x202)]);}return 0x0;}catch(_0x51a911){if(_0x51a911 instanceof SDKError)return console[_0x547ca7(0x1f6)](_0x547ca7(0x1de)+_0x51a911[_0x547ca7(0x1fa)]),_0x51a911['cause']&&console[_0x547ca7(0x1f6)](_0x547ca7(0x1ee)+_0x51a911[_0x547ca7(0x200)]),0x1;throw _0x51a911;}}[a46_0x57f207(0x1fb)](_0x104681){return undefined;}}
@@ -1 +1 @@
1
- function a47_0x49dc(){const _0x472c5a=['llm_project','default','Error:\x20','includes','3926377JxvMyA','agent','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','4776LiRKuc','Default\x20profile\x20','length','database','.\x20Must\x20be\x20one\x20of:\x20','150SjVXFP','join','green','441JIUEPu','dim','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','log','Invalid\x20resource:\x20','\x0aUpdated:\x20','230226osNQIT','site','message','parent_segment','8478670GTzlYW','Session\x20','182588MtSoKP','profile','engage_workspace','1062409dgceCb','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','(session:\x20','16839eAkvqA','llm_agent','validate','unset','session','name','tdx.json','2174ATvNFn','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','error','Clear\x20session-level\x20or\x20default\x20context\x20values','Usage:\x20tdx\x20unset\x20<resource>\x0a','cleared'];a47_0x49dc=function(){return _0x472c5a;};return a47_0x49dc();}function a47_0x2424(_0x4731ba,_0x49a627){_0x4731ba=_0x4731ba-0x1e3;const _0x49dc1b=a47_0x49dc();let _0x24246a=_0x49dc1b[_0x4731ba];return _0x24246a;}const a47_0x1f2e8f=a47_0x2424;(function(_0x2f4d5e,_0x1c8538){const _0x2fed78=a47_0x2424,_0x230e05=_0x2f4d5e();while(!![]){try{const _0x3c5edf=parseInt(_0x2fed78(0x1e8))/0x1+-parseInt(_0x2fed78(0x1f2))/0x2*(parseInt(_0x2fed78(0x207))/0x3)+parseInt(_0x2fed78(0x1e5))/0x4+-parseInt(_0x2fed78(0x204))/0x5*(parseInt(_0x2fed78(0x20d))/0x6)+parseInt(_0x2fed78(0x1fc))/0x7+-parseInt(_0x2fed78(0x1ff))/0x8*(-parseInt(_0x2fed78(0x1eb))/0x9)+-parseInt(_0x2fed78(0x1e3))/0xa;if(_0x3c5edf===_0x1c8538)break;else _0x230e05['push'](_0x230e05['shift']());}catch(_0x1492a3){_0x230e05['push'](_0x230e05['shift']());}}}(a47_0x49dc,0x991e0));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a47_0x4c5645 from'chalk';import*as a47_0x30c3de from'node:path';export class UnsetCommand extends BaseCommand{[a47_0x1f2e8f(0x1f0)]=a47_0x1f2e8f(0x1ee);['description']=a47_0x1f2e8f(0x1f5);[a47_0x1f2e8f(0x1ed)](_0x42d519){const _0x37aced=a47_0x1f2e8f,{args:_0x4ea03,options:_0x177ee7}=_0x42d519,_0x529deb=_0x177ee7[_0x37aced(0x1f9)];if(_0x4ea03[_0x37aced(0x201)]===0x0)return _0x37aced(0x1f6)+_0x37aced(0x1fe)+_0x37aced(0x1e9)+_0x37aced(0x1f3);const _0x38b4d4=_0x4ea03[0x0],_0x417046=[_0x37aced(0x20e),_0x37aced(0x202),_0x37aced(0x210),_0x37aced(0x1f8),_0x37aced(0x1fd),'profile','engage_workspace'];if(!_0x417046[_0x37aced(0x1fb)](_0x38b4d4))return _0x37aced(0x20b)+_0x38b4d4+_0x37aced(0x203)+_0x417046[_0x37aced(0x205)](',\x20');if(_0x529deb&&_0x38b4d4!==_0x37aced(0x20e)&&_0x38b4d4!==_0x37aced(0x1e6))return _0x37aced(0x209);return undefined;}async['execute'](_0x1a5aaa){const _0x8db15a=a47_0x1f2e8f,{args:_0x449be3,options:_0x1d7c0f}=_0x1a5aaa,_0x3c792c=_0x1d7c0f[_0x8db15a(0x1f9)];cleanExpiredSessions();try{const _0x279d24=_0x449be3[0x0],_0x2afa7d=a47_0x30c3de[_0x8db15a(0x205)](getConfigDir(),_0x8db15a(0x1f1));if(_0x3c792c){if(_0x279d24==='site')return clearDefaultSiteFromUserConfig(),console[_0x8db15a(0x20a)]('Default\x20site\x20'+a47_0x4c5645[_0x8db15a(0x206)](_0x8db15a(0x1f7))),console[_0x8db15a(0x20a)](a47_0x4c5645[_0x8db15a(0x208)](_0x8db15a(0x20c)+_0x2afa7d)),0x0;if(_0x279d24==='profile')return clearActiveProfileFromUserConfig(),console[_0x8db15a(0x20a)](_0x8db15a(0x200)+a47_0x4c5645[_0x8db15a(0x206)](_0x8db15a(0x1f7))),console[_0x8db15a(0x20a)](a47_0x4c5645[_0x8db15a(0x208)](_0x8db15a(0x20c)+_0x2afa7d)),0x0;}const _0x393fa0=getSessionID(_0x1d7c0f[_0x8db15a(0x1ef)]),_0x3852e1={'site':_0x8db15a(0x20e),'database':_0x8db15a(0x202),'parent_segment':'parent_segment','llm_project':_0x8db15a(0x1f8),'agent':_0x8db15a(0x1ec),'profile':_0x8db15a(0x1e6),'engage_workspace':_0x8db15a(0x1e7)},_0x3a1a49=_0x3852e1[_0x279d24];return _0x3a1a49&&(clearSessionContextField(_0x3a1a49,_0x1d7c0f['session']),console['log'](_0x8db15a(0x1e4)+_0x279d24+'\x20'+a47_0x4c5645[_0x8db15a(0x206)](_0x8db15a(0x1f7))+'\x20'+a47_0x4c5645['dim'](_0x8db15a(0x1ea)+_0x393fa0+')'))),0x0;}catch(_0x19dade){return _0x19dade instanceof Error&&console[_0x8db15a(0x1f4)](_0x8db15a(0x1fa)+_0x19dade[_0x8db15a(0x20f)]),0x1;}}}
1
+ const a47_0x5b1fbf=a47_0x1e34;(function(_0xbc9340,_0x76623b){const _0x488c90=a47_0x1e34,_0x545e82=_0xbc9340();while(!![]){try{const _0x26c1d5=parseInt(_0x488c90(0x15a))/0x1+parseInt(_0x488c90(0x148))/0x2*(-parseInt(_0x488c90(0x150))/0x3)+parseInt(_0x488c90(0x14a))/0x4*(parseInt(_0x488c90(0x13c))/0x5)+parseInt(_0x488c90(0x143))/0x6+parseInt(_0x488c90(0x13e))/0x7+-parseInt(_0x488c90(0x15b))/0x8+-parseInt(_0x488c90(0x13d))/0x9;if(_0x26c1d5===_0x76623b)break;else _0x545e82['push'](_0x545e82['shift']());}catch(_0x29bbdb){_0x545e82['push'](_0x545e82['shift']());}}}(a47_0x4ac0,0x1e28d));function a47_0x1e34(_0x399a23,_0x599d32){_0x399a23=_0x399a23-0x13a;const _0x4ac0f4=a47_0x4ac0();let _0x1e34d6=_0x4ac0f4[_0x399a23];return _0x1e34d6;}import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a47_0x4ec1ec from'chalk';function a47_0x4ac0(){const _0x526e94=['profile','8qPTlRP','unset','tdx.json','session','log','Session\x20','90222MGReuC','validate','parent_segment','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','name','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','engage_workspace','green','error','Error:\x20','189832ijzwhj','1067008foFCkC','cleared','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','agent','Default\x20profile\x20','llm_agent','site','(session:\x20','239465SVJAuh','1224648wCrOJH','849499FDggjp','default','Default\x20site\x20','llm_project','includes','457368KozMvh','execute','dim','database','\x0aUpdated:\x20','6NBdDRx'];a47_0x4ac0=function(){return _0x526e94;};return a47_0x4ac0();}import*as a47_0x2cc858 from'node:path';export class UnsetCommand extends BaseCommand{[a47_0x5b1fbf(0x154)]=a47_0x5b1fbf(0x14b);['description']='Clear\x20session-level\x20or\x20default\x20context\x20values';[a47_0x5b1fbf(0x151)](_0x141d5b){const _0x160a78=a47_0x5b1fbf,{args:_0x260bc0,options:_0x4bcd6d}=_0x141d5b,_0x2b082b=_0x4bcd6d[_0x160a78(0x13f)];if(_0x260bc0['length']===0x0)return'Usage:\x20tdx\x20unset\x20<resource>\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a'+_0x160a78(0x15d)+_0x160a78(0x155);const _0x5f5c41=_0x260bc0[0x0],_0x194e29=[_0x160a78(0x13a),_0x160a78(0x146),_0x160a78(0x152),_0x160a78(0x141),_0x160a78(0x15e),_0x160a78(0x149),_0x160a78(0x156)];if(!_0x194e29[_0x160a78(0x142)](_0x5f5c41))return'Invalid\x20resource:\x20'+_0x5f5c41+'.\x20Must\x20be\x20one\x20of:\x20'+_0x194e29['join'](',\x20');if(_0x2b082b&&_0x5f5c41!==_0x160a78(0x13a)&&_0x5f5c41!==_0x160a78(0x149))return _0x160a78(0x153);return undefined;}async[a47_0x5b1fbf(0x144)](_0x15fe71){const _0x37f448=a47_0x5b1fbf,{args:_0x163a36,options:_0x5bfe91}=_0x15fe71,_0x47c3c0=_0x5bfe91['default'];cleanExpiredSessions();try{const _0x195c3c=_0x163a36[0x0],_0x2db92e=a47_0x2cc858['join'](getConfigDir(),_0x37f448(0x14c));if(_0x47c3c0){if(_0x195c3c===_0x37f448(0x13a))return clearDefaultSiteFromUserConfig(),console['log'](_0x37f448(0x140)+a47_0x4ec1ec[_0x37f448(0x157)]('cleared')),console[_0x37f448(0x14e)](a47_0x4ec1ec[_0x37f448(0x145)]('\x0aUpdated:\x20'+_0x2db92e)),0x0;if(_0x195c3c===_0x37f448(0x149))return clearActiveProfileFromUserConfig(),console[_0x37f448(0x14e)](_0x37f448(0x15f)+a47_0x4ec1ec[_0x37f448(0x157)](_0x37f448(0x15c))),console[_0x37f448(0x14e)](a47_0x4ec1ec[_0x37f448(0x145)](_0x37f448(0x147)+_0x2db92e)),0x0;}const _0x4bbd1d=getSessionID(_0x5bfe91[_0x37f448(0x14d)]),_0x37c68a={'site':_0x37f448(0x13a),'database':_0x37f448(0x146),'parent_segment':_0x37f448(0x152),'llm_project':_0x37f448(0x141),'agent':_0x37f448(0x160),'profile':_0x37f448(0x149),'engage_workspace':_0x37f448(0x156)},_0x3cbfb2=_0x37c68a[_0x195c3c];return _0x3cbfb2&&(clearSessionContextField(_0x3cbfb2,_0x5bfe91[_0x37f448(0x14d)]),console['log'](_0x37f448(0x14f)+_0x195c3c+'\x20'+a47_0x4ec1ec['green']('cleared')+'\x20'+a47_0x4ec1ec[_0x37f448(0x145)](_0x37f448(0x13b)+_0x4bbd1d+')'))),0x0;}catch(_0x5aed62){return _0x5aed62 instanceof Error&&console[_0x37f448(0x158)](_0x37f448(0x159)+_0x5aed62['message']),0x1;}}}
@@ -1 +1 @@
1
- const a48_0x47522b=a48_0x472e;(function(_0x4686d3,_0x201d4f){const _0x4efbe6=a48_0x472e,_0x1007d0=_0x4686d3();while(!![]){try{const _0x2755be=parseInt(_0x4efbe6(0xe3))/0x1*(parseInt(_0x4efbe6(0xc4))/0x2)+-parseInt(_0x4efbe6(0xbc))/0x3+-parseInt(_0x4efbe6(0xd3))/0x4+-parseInt(_0x4efbe6(0xd5))/0x5+-parseInt(_0x4efbe6(0xd4))/0x6*(-parseInt(_0x4efbe6(0xe4))/0x7)+-parseInt(_0x4efbe6(0xe6))/0x8*(parseInt(_0x4efbe6(0xe2))/0x9)+parseInt(_0x4efbe6(0xe0))/0xa;if(_0x2755be===_0x201d4f)break;else _0x1007d0['push'](_0x1007d0['shift']());}catch(_0x446c2f){_0x1007d0['push'](_0x1007d0['shift']());}}}(a48_0x43ce,0x77031));import{gt}from'semver';import a48_0x13b752 from'chalk';import{BaseCommand}from'./command.js';function a48_0x472e(_0x52d1c,_0x440148){_0x52d1c=_0x52d1c-0xb9;const _0x43cec0=a48_0x43ce();let _0x472e68=_0x43cec0[_0x52d1c];return _0x472e68;}import{getVersion,isDevVersion}from'../core/version.js';import{loadReleaseChannel}from'../core/config.js';import{fetchLatestVersion}from'../utils/version-check.js';import{crossSpawn}from'../utils/process.js';const PACKAGE_NAME=a48_0x47522b(0xdc);export function detectPackageManager(){const _0x19de69=a48_0x47522b,_0x2bf58b=process[_0x19de69(0xd6)][_0x19de69(0xbd)](),_0x5a95f3=process[_0x19de69(0xea)][0x1]??'';if(_0x2bf58b[_0x19de69(0xc1)]('bun')||_0x5a95f3[_0x19de69(0xc1)](_0x19de69(0xe7)))return _0x19de69(0xbe);if(_0x5a95f3[_0x19de69(0xc1)](_0x19de69(0xe8)))return'pnpm';if(_0x5a95f3[_0x19de69(0xc1)](_0x19de69(0xc8)))return'yarn';return _0x19de69(0xc2);}function a48_0x43ce(){const _0x23cb99=['toLowerCase','bun','Checking\x20','Upgrade\x20tdx\x20to\x20the\x20latest\x20version','includes','npm','Target\x20version:','22IgMLcQ','Would\x20run:','name','join','yarn','upgrade','error','Failed\x20to\x20check\x20for\x20updates:\x20','Latest\x20version:','green','add','Current\x20version:','Failed\x20to\x20run\x20','execute','Current\x20version:\x20','1222572sCFovc','66lNPEZr','1270750lBLxSa','execPath','yellow','latest','...','replace','cyan','@treasuredata/tdx','dim','Running:','install','24821100yRacQc','Upgrade\x20is\x20not\x20available\x20for\x20development\x20versions.','27muebHS','4349SPcShG','5957ddTVQV','Already\x20up\x20to\x20date\x20(','2423280yKVXnl','.bun/','pnpm','log','argv','message','next','red','1749942QDtYTC'];a48_0x43ce=function(){return _0x23cb99;};return a48_0x43ce();}export function buildInstallArgs(_0x2f23dc,_0x1595a5){const _0x4a3250=a48_0x47522b;switch(_0x2f23dc){case _0x4a3250(0xc8):return['global',_0x4a3250(0xce),_0x1595a5];case _0x4a3250(0xe8):return[_0x4a3250(0xce),'-g',_0x1595a5];default:return[_0x4a3250(0xdf),'-g',_0x1595a5];}}export class UpgradeCommand extends BaseCommand{[a48_0x47522b(0xc6)]=a48_0x47522b(0xc9);['description']=a48_0x47522b(0xc0);async[a48_0x47522b(0xd1)](_0x2f58de){const _0x2c9d4c=a48_0x47522b,{options:_0x42e7e9,args:_0x5087b9}=_0x2f58de,_0x2e0983=!!_0x42e7e9['dryRun'],{next:_0x3ef1bd,method:_0x4ee7c7}=_0x42e7e9,_0x5746b6=_0x3ef1bd?_0x2c9d4c(0xba):loadReleaseChannel(),_0x309828=_0x5746b6===_0x2c9d4c(0xba)?_0x2c9d4c(0xba):_0x2c9d4c(0xd8),_0x58f51b=_0x5087b9[0x0]?String(_0x5087b9[0x0])[_0x2c9d4c(0xda)](/^v/,''):undefined,_0x4cdaab=getVersion();if(isDevVersion())return console[_0x2c9d4c(0xca)](a48_0x13b752[_0x2c9d4c(0xd7)](_0x2c9d4c(0xe1))),console[_0x2c9d4c(0xca)](a48_0x13b752['dim'](_0x2c9d4c(0xd2)+_0x4cdaab)),0x1;let _0x4af8b4;if(_0x58f51b)_0x4af8b4=_0x58f51b,console['log'](a48_0x13b752['dim']('Current\x20version:')+'\x20'+_0x4cdaab),console['log'](a48_0x13b752['dim'](_0x2c9d4c(0xc3))+'\x20\x20'+a48_0x13b752[_0x2c9d4c(0xcd)](_0x58f51b)),console[_0x2c9d4c(0xe9)]();else{console[_0x2c9d4c(0xe9)](a48_0x13b752['dim'](_0x2c9d4c(0xbf)+PACKAGE_NAME+'@'+_0x309828+_0x2c9d4c(0xd9)));try{_0x4af8b4=await fetchLatestVersion(_0x5746b6);}catch(_0x5f0390){return console[_0x2c9d4c(0xca)](a48_0x13b752[_0x2c9d4c(0xbb)](_0x2c9d4c(0xcb)+(_0x5f0390 instanceof Error?_0x5f0390[_0x2c9d4c(0xb9)]:String(_0x5f0390)))),0x1;}if(!gt(_0x4af8b4,_0x4cdaab))return console[_0x2c9d4c(0xe9)](a48_0x13b752[_0x2c9d4c(0xcd)](_0x2c9d4c(0xe5)+_0x4cdaab+').')),0x0;console['log'](a48_0x13b752['dim'](_0x2c9d4c(0xcf))+'\x20'+_0x4cdaab),console['log'](a48_0x13b752[_0x2c9d4c(0xdd)](_0x2c9d4c(0xcc))+'\x20\x20'+a48_0x13b752[_0x2c9d4c(0xcd)](_0x4af8b4)),console[_0x2c9d4c(0xe9)]();}const _0x1e50f2=_0x4ee7c7??detectPackageManager(),_0x2b3057=_0x58f51b?PACKAGE_NAME+'@'+_0x58f51b:PACKAGE_NAME+'@'+_0x309828,_0x5a8d9c=buildInstallArgs(_0x1e50f2,_0x2b3057);if(_0x2e0983)return console[_0x2c9d4c(0xe9)](a48_0x13b752['dim'](_0x2c9d4c(0xc5))),console[_0x2c9d4c(0xe9)]('\x20\x20'+a48_0x13b752[_0x2c9d4c(0xdb)](_0x1e50f2+'\x20'+_0x5a8d9c[_0x2c9d4c(0xc7)]('\x20'))),0x0;return console[_0x2c9d4c(0xe9)](a48_0x13b752[_0x2c9d4c(0xdd)](_0x2c9d4c(0xde))+'\x20'+_0x1e50f2+'\x20'+_0x5a8d9c[_0x2c9d4c(0xc7)]('\x20')),console[_0x2c9d4c(0xe9)](),new Promise(_0x65dd00=>{const _0x5be201=_0x2c9d4c,_0x20e3d6=crossSpawn(_0x1e50f2,_0x5a8d9c,{'stdio':'inherit'});_0x20e3d6['on']('close',_0x5e0d9d=>{const _0x29e991=a48_0x472e;console[_0x29e991(0xe9)](),_0x5e0d9d===0x0?console['log'](a48_0x13b752['green']('Successfully\x20upgraded\x20to\x20'+_0x2b3057)):console[_0x29e991(0xca)](a48_0x13b752[_0x29e991(0xbb)]('Upgrade\x20failed\x20(exit\x20code\x20'+_0x5e0d9d+').')),_0x65dd00(_0x5e0d9d??0x1);}),_0x20e3d6['on'](_0x5be201(0xca),_0x4fd92f=>{const _0x41c6bd=_0x5be201;console['error'](a48_0x13b752[_0x41c6bd(0xbb)](_0x41c6bd(0xd0)+_0x1e50f2+':\x20'+_0x4fd92f['message'])),_0x65dd00(0x1);});});}}
1
+ function a48_0x2c28(_0x10f4e7,_0x396713){_0x10f4e7=_0x10f4e7-0x178;const _0x218afa=a48_0x218a();let _0x2c28b0=_0x218afa[_0x10f4e7];return _0x2c28b0;}const a48_0x41e0c3=a48_0x2c28;(function(_0x72415e,_0x308d71){const _0x29baf7=a48_0x2c28,_0x1a6cb1=_0x72415e();while(!![]){try{const _0x55facf=-parseInt(_0x29baf7(0x183))/0x1+parseInt(_0x29baf7(0x198))/0x2+parseInt(_0x29baf7(0x1a3))/0x3*(parseInt(_0x29baf7(0x18b))/0x4)+parseInt(_0x29baf7(0x199))/0x5*(-parseInt(_0x29baf7(0x17d))/0x6)+parseInt(_0x29baf7(0x188))/0x7+-parseInt(_0x29baf7(0x192))/0x8+-parseInt(_0x29baf7(0x19f))/0x9*(-parseInt(_0x29baf7(0x1a6))/0xa);if(_0x55facf===_0x308d71)break;else _0x1a6cb1['push'](_0x1a6cb1['shift']());}catch(_0x4a1164){_0x1a6cb1['push'](_0x1a6cb1['shift']());}}}(a48_0x218a,0x931d0));import{gt}from'semver';import a48_0x2fefa6 from'chalk';function a48_0x218a(){const _0x4ed58d=['upgrade','4909492uVhjXi','red','Current\x20version:\x20','16UGpOCf','yellow','Successfully\x20upgraded\x20to\x20','pnpm','close','description','dryRun','7204296pBlrex','.bun/','latest','npm','log','Would\x20run:','1136506sbIKeC','3108080mtyXBM','Target\x20version:','message','Upgrade\x20tdx\x20to\x20the\x20latest\x20version','add','includes','32724vVczCp','next','green','Latest\x20version:','103053RRMqtm','yarn','join','2050qsaBvW','toLowerCase','Upgrade\x20is\x20not\x20available\x20for\x20development\x20versions.','execPath','inherit','global','install','6uPwFHd','Upgrade\x20failed\x20(exit\x20code\x20','Current\x20version:','name','dim','replace','27664rFdJwO','@treasuredata/tdx','error','argv'];a48_0x218a=function(){return _0x4ed58d;};return a48_0x218a();}import{BaseCommand}from'./command.js';import{getVersion,isDevVersion}from'../core/version.js';import{loadReleaseChannel}from'../core/config.js';import{fetchLatestVersion}from'../utils/version-check.js';import{crossSpawn}from'../utils/process.js';const PACKAGE_NAME=a48_0x41e0c3(0x184);export function detectPackageManager(){const _0x3a6ea3=a48_0x41e0c3,_0x30bf4f=process[_0x3a6ea3(0x179)][_0x3a6ea3(0x1a7)](),_0x3b8dc9=process[_0x3a6ea3(0x186)][0x1]??'';if(_0x30bf4f['includes']('bun')||_0x3b8dc9[_0x3a6ea3(0x19e)](_0x3a6ea3(0x193)))return'bun';if(_0x3b8dc9[_0x3a6ea3(0x19e)]('pnpm'))return _0x3a6ea3(0x18e);if(_0x3b8dc9[_0x3a6ea3(0x19e)](_0x3a6ea3(0x1a4)))return _0x3a6ea3(0x1a4);return _0x3a6ea3(0x195);}export function buildInstallArgs(_0x3831f0,_0x29200b){const _0xf8af3c=a48_0x41e0c3;switch(_0x3831f0){case'yarn':return[_0xf8af3c(0x17b),_0xf8af3c(0x19d),_0x29200b];case'pnpm':return[_0xf8af3c(0x19d),'-g',_0x29200b];default:return[_0xf8af3c(0x17c),'-g',_0x29200b];}}export class UpgradeCommand extends BaseCommand{[a48_0x41e0c3(0x180)]=a48_0x41e0c3(0x187);[a48_0x41e0c3(0x190)]=a48_0x41e0c3(0x19c);async['execute'](_0x47625b){const _0x1d6de0=a48_0x41e0c3,{options:_0xafad80,args:_0x2e9bc2}=_0x47625b,_0x55077f=!!_0xafad80[_0x1d6de0(0x191)],{next:_0x197351,method:_0x19a81d}=_0xafad80,_0x43667b=_0x197351?_0x1d6de0(0x1a0):loadReleaseChannel(),_0x48b9dd=_0x43667b===_0x1d6de0(0x1a0)?'next':_0x1d6de0(0x194),_0x467a72=_0x2e9bc2[0x0]?String(_0x2e9bc2[0x0])[_0x1d6de0(0x182)](/^v/,''):undefined,_0x33bc82=getVersion();if(isDevVersion())return console[_0x1d6de0(0x185)](a48_0x2fefa6[_0x1d6de0(0x18c)](_0x1d6de0(0x178))),console[_0x1d6de0(0x185)](a48_0x2fefa6[_0x1d6de0(0x181)](_0x1d6de0(0x18a)+_0x33bc82)),0x1;let _0x494e74;if(_0x467a72)_0x494e74=_0x467a72,console[_0x1d6de0(0x196)](a48_0x2fefa6[_0x1d6de0(0x181)](_0x1d6de0(0x17f))+'\x20'+_0x33bc82),console[_0x1d6de0(0x196)](a48_0x2fefa6[_0x1d6de0(0x181)](_0x1d6de0(0x19a))+'\x20\x20'+a48_0x2fefa6[_0x1d6de0(0x1a1)](_0x467a72)),console[_0x1d6de0(0x196)]();else{console[_0x1d6de0(0x196)](a48_0x2fefa6['dim']('Checking\x20'+PACKAGE_NAME+'@'+_0x48b9dd+'...'));try{_0x494e74=await fetchLatestVersion(_0x43667b);}catch(_0x37e4c5){return console[_0x1d6de0(0x185)](a48_0x2fefa6[_0x1d6de0(0x189)]('Failed\x20to\x20check\x20for\x20updates:\x20'+(_0x37e4c5 instanceof Error?_0x37e4c5['message']:String(_0x37e4c5)))),0x1;}if(!gt(_0x494e74,_0x33bc82))return console['log'](a48_0x2fefa6[_0x1d6de0(0x1a1)]('Already\x20up\x20to\x20date\x20('+_0x33bc82+').')),0x0;console[_0x1d6de0(0x196)](a48_0x2fefa6['dim']('Current\x20version:')+'\x20'+_0x33bc82),console[_0x1d6de0(0x196)](a48_0x2fefa6['dim'](_0x1d6de0(0x1a2))+'\x20\x20'+a48_0x2fefa6['green'](_0x494e74)),console[_0x1d6de0(0x196)]();}const _0x17ba53=_0x19a81d??detectPackageManager(),_0x5d3ea3=_0x467a72?PACKAGE_NAME+'@'+_0x467a72:PACKAGE_NAME+'@'+_0x48b9dd,_0x45c67d=buildInstallArgs(_0x17ba53,_0x5d3ea3);if(_0x55077f)return console[_0x1d6de0(0x196)](a48_0x2fefa6[_0x1d6de0(0x181)](_0x1d6de0(0x197))),console['log']('\x20\x20'+a48_0x2fefa6['cyan'](_0x17ba53+'\x20'+_0x45c67d[_0x1d6de0(0x1a5)]('\x20'))),0x0;return console[_0x1d6de0(0x196)](a48_0x2fefa6[_0x1d6de0(0x181)]('Running:')+'\x20'+_0x17ba53+'\x20'+_0x45c67d['join']('\x20')),console[_0x1d6de0(0x196)](),new Promise(_0x50b8d3=>{const _0x150898=_0x1d6de0,_0x3cca8e=crossSpawn(_0x17ba53,_0x45c67d,{'stdio':_0x150898(0x17a)});_0x3cca8e['on'](_0x150898(0x18f),_0x24f71c=>{const _0x14f824=_0x150898;console[_0x14f824(0x196)](),_0x24f71c===0x0?console[_0x14f824(0x196)](a48_0x2fefa6[_0x14f824(0x1a1)](_0x14f824(0x18d)+_0x5d3ea3)):console[_0x14f824(0x185)](a48_0x2fefa6[_0x14f824(0x189)](_0x14f824(0x17e)+_0x24f71c+').')),_0x50b8d3(_0x24f71c??0x1);}),_0x3cca8e['on'](_0x150898(0x185),_0x5f5271=>{const _0x1dd9e6=_0x150898;console[_0x1dd9e6(0x185)](a48_0x2fefa6[_0x1dd9e6(0x189)]('Failed\x20to\x20run\x20'+_0x17ba53+':\x20'+_0x5f5271[_0x1dd9e6(0x19b)])),_0x50b8d3(0x1);});});}}
@@ -1 +1 @@
1
- const a49_0x5e7ef4=a49_0x54b5;(function(_0x880756,_0x4dc0bc){const _0x4d3c33=a49_0x54b5,_0x1a1a8a=_0x880756();while(!![]){try{const _0x3c4abf=-parseInt(_0x4d3c33(0x1a2))/0x1*(-parseInt(_0x4d3c33(0x199))/0x2)+-parseInt(_0x4d3c33(0x190))/0x3*(-parseInt(_0x4d3c33(0x182))/0x4)+parseInt(_0x4d3c33(0x1ab))/0x5*(parseInt(_0x4d3c33(0x1b6))/0x6)+parseInt(_0x4d3c33(0x1c2))/0x7*(-parseInt(_0x4d3c33(0x189))/0x8)+parseInt(_0x4d3c33(0x184))/0x9+parseInt(_0x4d3c33(0x1af))/0xa*(-parseInt(_0x4d3c33(0x1c4))/0xb)+-parseInt(_0x4d3c33(0x181))/0xc;if(_0x3c4abf===_0x4dc0bc)break;else _0x1a1a8a['push'](_0x1a1a8a['shift']());}catch(_0x102089){_0x1a1a8a['push'](_0x1a1a8a['shift']());}}}(a49_0xb0f0,0xa0d40));import{BaseCommand}from'./command.js';import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a49_0x60ba46 from'chalk';function a49_0x54b5(_0x3d033f,_0x447baa){_0x3d033f=_0x3d033f-0x17f;const _0xb0f0e=a49_0xb0f0();let _0x54b5e2=_0xb0f0e[_0x3d033f];return _0x54b5e2;}function a49_0xb0f0(){const _0x20f44a=['\x27\x20does\x20not\x20exist','session','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','green','Invalid\x20release\x20channel:\x20','188rzXBFq','name','join','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','Session\x20engage_workspace\x20set\x20to:\x20','NOT_FOUND','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','76645HXLBXA','agent','Verifying\x20workspace\x20\x27','release_channel','70uPBDtB','llm_project','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','Default\x20profile\x20set\x20to:\x20','parent_segment','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','408gHeXnQ','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','Set\x20session-level\x20context','tdx.json','site','code','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','Error:\x20','validate','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','\x27...','Error:\x20Profile\x20\x27','7231iooMKI','Session\x20context\x20','1473329hulqtg','engage_workspace','engage','llm_agent','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Session\x20llm_project\x20set\x20to:\x20','12669204yXXRSs','4ChbMfW','Session\x20database\x20set\x20to:\x20','5058045ttgkej','log','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','Release\x20channel\x20set\x20to:\x20','\x27\x20to\x20save\x20permanently','4616JNsxbQ','default','tdx','database','displayWithSources','cleared','error','3943704ydyFSh','dim','(session:\x20','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','\x0aSaved\x20to:\x20','INVALID_ARGUMENT','length','profile','includes','3502BApNzK','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces'];a49_0xb0f0=function(){return _0x20f44a;};return a49_0xb0f0();}import*as a49_0x415b15 from'node:path';export class UseCommand extends BaseCommand{[a49_0x5e7ef4(0x1a3)]='use';['description']=a49_0x5e7ef4(0x1b8);[a49_0x5e7ef4(0x1be)](_0x3c1078){const _0x5f1924=a49_0x5e7ef4,{args:_0x19f5df,options:_0x3d6c59}=_0x3c1078,_0x135de6=_0x3d6c59[_0x5f1924(0x18a)];if(_0x19f5df[_0x5f1924(0x196)]===0x0)return undefined;if(_0x19f5df['length']===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x5f1924(0x1a6)+_0x5f1924(0x1a7)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a'+_0x5f1924(0x1bf)+_0x5f1924(0x1a5)+_0x5f1924(0x1b4);const _0x27bbea=_0x19f5df[0x0],_0x453a5e=['site',_0x5f1924(0x18c),_0x5f1924(0x1b3),_0x5f1924(0x1b0),_0x5f1924(0x1ac),_0x5f1924(0x197),_0x5f1924(0x1c5),'release_channel'];if(!_0x453a5e[_0x5f1924(0x198)](_0x27bbea))return'Invalid\x20resource:\x20'+_0x27bbea+'.\x20Must\x20be\x20one\x20of:\x20'+_0x453a5e[_0x5f1924(0x1a4)](',\x20');if(_0x135de6&&_0x27bbea!==_0x5f1924(0x1ba)&&_0x27bbea!==_0x5f1924(0x197)&&_0x27bbea!==_0x5f1924(0x1ae))return _0x5f1924(0x1bc);if(_0x27bbea===_0x5f1924(0x1ae)&&!_0x135de6)return _0x5f1924(0x1b5);if(_0x27bbea===_0x5f1924(0x1ae)){const _0x5bc08e=_0x19f5df[0x1];if(_0x5bc08e!=='stable'&&_0x5bc08e!=='next')return _0x5f1924(0x1a1)+_0x5bc08e+_0x5f1924(0x1b1);}return undefined;}async['execute'](_0x5a6167){const _0x480440=a49_0x5e7ef4,{args:_0x146f19,options:_0x5d094c}=_0x5a6167,_0x581990=_0x5d094c['debug'],_0x21a6c1=_0x5d094c['clear'],_0x1ff975=_0x5d094c['default'];cleanExpiredSessions();try{if(_0x21a6c1){clearSessionContext(_0x5d094c[_0x480440(0x19d)]);const _0x3e17d3=getSessionID(_0x5d094c['session']);return console[_0x480440(0x185)](_0x480440(0x1c3)+a49_0x60ba46['green'](_0x480440(0x18e))+'\x20'+a49_0x60ba46[_0x480440(0x191)](_0x480440(0x192)+_0x3e17d3+')')),0x0;}if(_0x146f19[_0x480440(0x196)]===0x0){const _0x3df022=new GlobalContext(_0x5d094c);return _0x581990?_0x3df022[_0x480440(0x18d)]():_0x3df022['display'](),console['log'](a49_0x60ba46['dim'](_0x480440(0x19e))),console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)](_0x480440(0x1aa))),console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)](_0x480440(0x186))),0x0;}const _0x31e47d=_0x146f19[0x0],_0x547839=_0x146f19[0x1],_0x1ccf89=a49_0x415b15[_0x480440(0x1a4)](getConfigDir(),_0x480440(0x1b9));if(_0x1ff975){if(_0x31e47d==='site')return saveDefaultSiteToUserConfig(_0x547839),console['log']('Default\x20site\x20set\x20to:\x20'+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)),console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)](_0x480440(0x194)+_0x1ccf89)),0x0;if(_0x31e47d===_0x480440(0x197)){if(!profileExists(_0x547839))return console[_0x480440(0x18f)](_0x480440(0x1c1)+_0x547839+_0x480440(0x19c)),console['error'](_0x480440(0x193)),0x1;return saveActiveProfileToUserConfig(_0x547839),console[_0x480440(0x185)](_0x480440(0x1b2)+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)),console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)]('\x0aSaved\x20to:\x20'+_0x1ccf89)),0x0;}if(_0x31e47d==='release_channel')return saveReleaseChannel(_0x547839),console[_0x480440(0x185)](_0x480440(0x187)+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)),console[_0x480440(0x185)](a49_0x60ba46['dim']('\x0aSaved\x20to:\x20'+_0x1ccf89)),_0x547839==='next'?(console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)](_0x480440(0x19f))),console['log'](a49_0x60ba46['dim']('Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next'))):console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)](_0x480440(0x19a))),0x0;}if(_0x31e47d==='site'){const _0x2e006a=getSessionID(_0x5d094c[_0x480440(0x19d)]);return saveSessionContext({'site':_0x547839},_0x5d094c[_0x480440(0x19d)]),console[_0x480440(0x185)]('Session\x20site\x20set\x20to:\x20'+a49_0x60ba46['green'](_0x547839)+'\x20'+a49_0x60ba46[_0x480440(0x191)](_0x480440(0x192)+_0x2e006a+')')),console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0x547839+_0x480440(0x188))),0x0;}if(_0x31e47d==='profile'){if(!profileExists(_0x547839))return console[_0x480440(0x18f)](_0x480440(0x1c1)+_0x547839+_0x480440(0x19c)),console[_0x480440(0x18f)](_0x480440(0x193)),0x1;const _0x4ef38c=getSessionID(_0x5d094c[_0x480440(0x19d)]);return saveSessionContext({'profile':_0x547839},_0x5d094c[_0x480440(0x19d)]),console[_0x480440(0x185)]('Session\x20profile\x20set\x20to:\x20'+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)+'\x20'+a49_0x60ba46['dim'](_0x480440(0x192)+_0x4ef38c+')')),console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)](_0x480440(0x1b7)+_0x547839+_0x480440(0x188))),0x0;}const _0x5ca41c={},_0x1fb615=getSessionID(_0x5d094c['session']);switch(_0x31e47d){case _0x480440(0x18c):_0x5ca41c[_0x480440(0x18c)]=_0x547839,console['log'](_0x480440(0x183)+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)+'\x20'+a49_0x60ba46['dim'](_0x480440(0x192)+_0x1fb615+')'));break;case _0x480440(0x1b3):_0x5ca41c[_0x480440(0x1b3)]=_0x547839,console['log']('Session\x20parent_segment\x20set\x20to:\x20'+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)+'\x20'+a49_0x60ba46[_0x480440(0x191)]('(session:\x20'+_0x1fb615+')'));break;case'llm_project':_0x5ca41c[_0x480440(0x1b0)]=_0x547839,console[_0x480440(0x185)]('Session\x20llm_project\x20set\x20to:\x20'+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)+'\x20'+a49_0x60ba46[_0x480440(0x191)](_0x480440(0x192)+_0x1fb615+')'));break;case _0x480440(0x1ac):{const {projectName:_0x3526cb,agentName:_0x42eef1}=parseAgentRef(_0x547839);_0x42eef1?(_0x5ca41c[_0x480440(0x1b0)]=_0x3526cb,_0x5ca41c[_0x480440(0x1c7)]=_0x42eef1,console[_0x480440(0x185)](_0x480440(0x180)+a49_0x60ba46[_0x480440(0x1a0)](_0x3526cb)+'\x20'+a49_0x60ba46[_0x480440(0x191)](_0x480440(0x192)+_0x1fb615+')')),console[_0x480440(0x185)]('Session\x20agent\x20set\x20to:\x20'+a49_0x60ba46[_0x480440(0x1a0)](_0x42eef1)+'\x20'+a49_0x60ba46['dim']('(session:\x20'+_0x1fb615+')'))):(_0x5ca41c[_0x480440(0x1c7)]=_0x547839,console['log']('Session\x20agent\x20set\x20to:\x20'+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)+'\x20'+a49_0x60ba46[_0x480440(0x191)](_0x480440(0x192)+_0x1fb615+')')));break;}case'engage_workspace':{try{await withSpinner(_0x480440(0x1ad)+_0x547839+_0x480440(0x1c0),()=>_0x5a6167[_0x480440(0x18b)][_0x480440(0x1c6)]['resolveWorkspaceId'](_0x547839));}catch(_0x2f60ae){if(_0x2f60ae instanceof SDKError&&(_0x2f60ae['code']===ErrorCode[_0x480440(0x1a9)]||_0x2f60ae[_0x480440(0x1bb)]===ErrorCode[_0x480440(0x195)]))return console[_0x480440(0x18f)](_0x480440(0x1bd)+_0x2f60ae['message']),console[_0x480440(0x18f)](_0x480440(0x19b)),0x1;throw _0x2f60ae;}_0x5ca41c['engage_workspace']=_0x547839,console[_0x480440(0x185)](_0x480440(0x1a8)+a49_0x60ba46[_0x480440(0x1a0)](_0x547839)+'\x20'+a49_0x60ba46[_0x480440(0x191)]('(session:\x20'+_0x1fb615+')'));break;}}return saveSessionContext(_0x5ca41c,_0x5d094c['session']),console[_0x480440(0x185)](a49_0x60ba46[_0x480440(0x191)](_0x480440(0x17f))),0x0;}catch(_0xb6765e){return _0xb6765e instanceof Error&&console[_0x480440(0x18f)](_0x480440(0x1bd)+_0xb6765e['message']),0x1;}}}
1
+ const a49_0x598412=a49_0x324d;(function(_0x13b57d,_0x46eaef){const _0x35049d=a49_0x324d,_0x1b3dda=_0x13b57d();while(!![]){try{const _0x474819=-parseInt(_0x35049d(0xd5))/0x1*(-parseInt(_0x35049d(0xed))/0x2)+-parseInt(_0x35049d(0x111))/0x3+parseInt(_0x35049d(0x10e))/0x4+-parseInt(_0x35049d(0x10b))/0x5*(parseInt(_0x35049d(0xd9))/0x6)+-parseInt(_0x35049d(0xfa))/0x7+-parseInt(_0x35049d(0xff))/0x8+parseInt(_0x35049d(0xd4))/0x9*(parseInt(_0x35049d(0x10c))/0xa);if(_0x474819===_0x46eaef)break;else _0x1b3dda['push'](_0x1b3dda['shift']());}catch(_0x1bda23){_0x1b3dda['push'](_0x1b3dda['shift']());}}}(a49_0x3665,0x9b051));import{BaseCommand}from'./command.js';function a49_0x324d(_0x2294c4,_0x35223e){_0x2294c4=_0x2294c4-0xc6;const _0x36656e=a49_0x3665();let _0x324d83=_0x36656e[_0x2294c4];return _0x324d83;}function a49_0x3665(){const _0x1cdf91=['Error:\x20','9805000gBgxki','\x27...','log','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','database','\x27\x20to\x20save\x20permanently','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','engage_workspace','Session\x20parent_segment\x20set\x20to:\x20','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','\x0aSaved\x20to:\x20','5462965AJATnA','490LUuqMJ','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','703884xriRmU','site','(session:\x20','49014ljLkLB','displayWithSources','NOT_FOUND','parent_segment','code','Invalid\x20resource:\x20','Session\x20llm_project\x20set\x20to:\x20','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','Session\x20context\x20','llm_project','stable','\x27\x20does\x20not\x20exist','Session\x20profile\x20set\x20to:\x20','agent','session','373131CbBEWE','122Tjjcuo','default','release_channel','debug','6QpSWVU','Set\x20session-level\x20context','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','profile','llm_agent','use','dim','next','Session\x20database\x20set\x20to:\x20','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Default\x20site\x20set\x20to:\x20','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','length','Error:\x20Profile\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','tdx.json','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','.\x20Must\x20be\x20one\x20of:\x20','13474HiKtGd','display','INVALID_ARGUMENT','join','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','resolveWorkspaceId','Session\x20engage_workspace\x20set\x20to:\x20','green','includes','name','Default\x20profile\x20set\x20to:\x20','Session\x20agent\x20set\x20to:\x20','419013dWbspS','error','clear','message'];a49_0x3665=function(){return _0x1cdf91;};return a49_0x3665();}import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a49_0x35af8a from'chalk';import*as a49_0x4916f7 from'node:path';export class UseCommand extends BaseCommand{[a49_0x598412(0xf7)]=a49_0x598412(0xe0);['description']=a49_0x598412(0xda);['validate'](_0x49b126){const _0x3924d2=a49_0x598412,{args:_0x1553bf,options:_0x2796fd}=_0x49b126,_0x4ea255=_0x2796fd[_0x3924d2(0xd6)];if(_0x1553bf[_0x3924d2(0xe7)]===0x0)return undefined;if(_0x1553bf[_0x3924d2(0xe7)]===0x1)return _0x3924d2(0xe4)+_0x3924d2(0xe9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x3924d2(0xdd)+_0x3924d2(0xf2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a'+_0x3924d2(0xf1)+_0x3924d2(0xeb);const _0x31ec91=_0x1553bf[0x0],_0x32a7de=[_0x3924d2(0x10f),_0x3924d2(0x103),_0x3924d2(0xc8),_0x3924d2(0xce),_0x3924d2(0xd2),_0x3924d2(0xde),_0x3924d2(0x107),'release_channel'];if(!_0x32a7de[_0x3924d2(0xf6)](_0x31ec91))return _0x3924d2(0xca)+_0x31ec91+_0x3924d2(0xec)+_0x32a7de[_0x3924d2(0xf0)](',\x20');if(_0x4ea255&&_0x31ec91!==_0x3924d2(0x10f)&&_0x31ec91!=='profile'&&_0x31ec91!==_0x3924d2(0xd7))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';if(_0x31ec91===_0x3924d2(0xd7)&&!_0x4ea255)return _0x3924d2(0x109);if(_0x31ec91===_0x3924d2(0xd7)){const _0x6f93ac=_0x1553bf[0x1];if(_0x6f93ac!==_0x3924d2(0xcf)&&_0x6f93ac!==_0x3924d2(0xe2))return'Invalid\x20release\x20channel:\x20'+_0x6f93ac+'.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.';}return undefined;}async[a49_0x598412(0xdc)](_0x50d38b){const _0x2f1084=a49_0x598412,{args:_0x13007f,options:_0x10806c}=_0x50d38b,_0x4491f4=_0x10806c[_0x2f1084(0xd8)],_0x53bb3f=_0x10806c[_0x2f1084(0xfc)],_0x267afa=_0x10806c['default'];cleanExpiredSessions();try{if(_0x53bb3f){clearSessionContext(_0x10806c[_0x2f1084(0xd3)]);const _0x19a597=getSessionID(_0x10806c[_0x2f1084(0xd3)]);return console[_0x2f1084(0x101)](_0x2f1084(0xcd)+a49_0x35af8a['green']('cleared')+'\x20'+a49_0x35af8a['dim'](_0x2f1084(0x110)+_0x19a597+')')),0x0;}if(_0x13007f['length']===0x0){const _0x5704e6=new GlobalContext(_0x10806c);return _0x4491f4?_0x5704e6[_0x2f1084(0xc6)]():_0x5704e6[_0x2f1084(0xee)](),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0xdb))),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0xcc))),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)]('Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently')),0x0;}const _0x4fc5cb=_0x13007f[0x0],_0x1422b5=_0x13007f[0x1],_0x6159cc=a49_0x4916f7['join'](getConfigDir(),_0x2f1084(0xea));if(_0x267afa){if(_0x4fc5cb===_0x2f1084(0x10f))return saveDefaultSiteToUserConfig(_0x1422b5),console[_0x2f1084(0x101)](_0x2f1084(0xe5)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)),console['log'](a49_0x35af8a['dim'](_0x2f1084(0x10a)+_0x6159cc)),0x0;if(_0x4fc5cb===_0x2f1084(0xde)){if(!profileExists(_0x1422b5))return console[_0x2f1084(0xfb)]('Error:\x20Profile\x20\x27'+_0x1422b5+_0x2f1084(0xd0)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;return saveActiveProfileToUserConfig(_0x1422b5),console[_0x2f1084(0x101)](_0x2f1084(0xf8)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x10a)+_0x6159cc)),0x0;}if(_0x4fc5cb===_0x2f1084(0xd7))return saveReleaseChannel(_0x1422b5),console[_0x2f1084(0x101)]('Release\x20channel\x20set\x20to:\x20'+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)),console['log'](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x10a)+_0x6159cc)),_0x1422b5===_0x2f1084(0xe2)?(console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)]('\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.')),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)]('Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next'))):console['log'](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x106))),0x0;}if(_0x4fc5cb===_0x2f1084(0x10f)){const _0xab433b=getSessionID(_0x10806c['session']);return saveSessionContext({'site':_0x1422b5},_0x10806c[_0x2f1084(0xd3)]),console['log']('Session\x20site\x20set\x20to:\x20'+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xab433b+')')),console[_0x2f1084(0x101)](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x102)+_0x1422b5+_0x2f1084(0x104))),0x0;}if(_0x4fc5cb===_0x2f1084(0xde)){if(!profileExists(_0x1422b5))return console[_0x2f1084(0xfb)](_0x2f1084(0xe8)+_0x1422b5+'\x27\x20does\x20not\x20exist'),console[_0x2f1084(0xfb)](_0x2f1084(0x10d)),0x1;const _0x239495=getSessionID(_0x10806c['session']);return saveSessionContext({'profile':_0x1422b5},_0x10806c[_0x2f1084(0xd3)]),console[_0x2f1084(0x101)](_0x2f1084(0xd1)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)]('(session:\x20'+_0x239495+')')),console['log'](a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x105)+_0x1422b5+_0x2f1084(0x104))),0x0;}const _0x4ac7f2={},_0xe64c7=getSessionID(_0x10806c[_0x2f1084(0xd3)]);switch(_0x4fc5cb){case _0x2f1084(0x103):_0x4ac7f2['database']=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0xe3)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xe64c7+')'));break;case _0x2f1084(0xc8):_0x4ac7f2[_0x2f1084(0xc8)]=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0x108)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a['dim'](_0x2f1084(0x110)+_0xe64c7+')'));break;case _0x2f1084(0xce):_0x4ac7f2[_0x2f1084(0xce)]=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0xcb)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xe64c7+')'));break;case _0x2f1084(0xd2):{const {projectName:_0x2454ef,agentName:_0x1cee89}=parseAgentRef(_0x1422b5);_0x1cee89?(_0x4ac7f2[_0x2f1084(0xce)]=_0x2454ef,_0x4ac7f2[_0x2f1084(0xdf)]=_0x1cee89,console[_0x2f1084(0x101)](_0x2f1084(0xcb)+a49_0x35af8a['green'](_0x2454ef)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xe64c7+')')),console[_0x2f1084(0x101)](_0x2f1084(0xf9)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1cee89)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)]('(session:\x20'+_0xe64c7+')'))):(_0x4ac7f2[_0x2f1084(0xdf)]=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0xf9)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)](_0x2f1084(0x110)+_0xe64c7+')')));break;}case _0x2f1084(0x107):{try{await withSpinner('Verifying\x20workspace\x20\x27'+_0x1422b5+_0x2f1084(0x100),()=>_0x50d38b['tdx']['engage'][_0x2f1084(0xf3)](_0x1422b5));}catch(_0x18d812){if(_0x18d812 instanceof SDKError&&(_0x18d812[_0x2f1084(0xc9)]===ErrorCode[_0x2f1084(0xc7)]||_0x18d812[_0x2f1084(0xc9)]===ErrorCode[_0x2f1084(0xef)]))return console[_0x2f1084(0xfb)](_0x2f1084(0xfe)+_0x18d812[_0x2f1084(0xfd)]),console[_0x2f1084(0xfb)](_0x2f1084(0xe6)),0x1;throw _0x18d812;}_0x4ac7f2[_0x2f1084(0x107)]=_0x1422b5,console[_0x2f1084(0x101)](_0x2f1084(0xf4)+a49_0x35af8a[_0x2f1084(0xf5)](_0x1422b5)+'\x20'+a49_0x35af8a[_0x2f1084(0xe1)]('(session:\x20'+_0xe64c7+')'));break;}}return saveSessionContext(_0x4ac7f2,_0x10806c['session']),console['log'](a49_0x35af8a[_0x2f1084(0xe1)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x200ad4){return _0x200ad4 instanceof Error&&console[_0x2f1084(0xfb)](_0x2f1084(0xfe)+_0x200ad4[_0x2f1084(0xfd)]),0x1;}}}
@@ -1 +1 @@
1
- const a50_0x3a0c30=a50_0xac79;function a50_0x1f32(){const _0x1abdb7=['7122GUTDRu','cause','name','dim','email','Show\x20current\x20user\x20information','description','message','sort','3095196hLlNZN','Error:\x20','14486630HPStsG','64118JZHOEM','Unknown','list','execute','List\x20all\x20users\x20in\x20the\x20account','\x20user','getCurrent','administrator','Fetching\x20user\x20info...','data','log','Listing\x20users...','error','7041035PYSeRD','\x20(admin)','yellow','account_owner','👤\x20','2268372AKAhgW','5427GplXia','11Cizstj','verbose','\x20(owner)','user\x20list','user','32KWNeul','5999RnRmtB','localeCompare','length','\x20\x20Cause:\x20','10912mRrnup'];a50_0x1f32=function(){return _0x1abdb7;};return a50_0x1f32();}(function(_0x9718cc,_0xb45e79){const _0x3faa23=a50_0xac79,_0x1f3086=_0x9718cc();while(!![]){try{const _0x14223c=-parseInt(_0x3faa23(0x90))/0x1*(-parseInt(_0x3faa23(0x77))/0x2)+-parseInt(_0x3faa23(0x74))/0x3+parseInt(_0x3faa23(0x89))/0x4+parseInt(_0x3faa23(0x84))/0x5+-parseInt(_0x3faa23(0x6b))/0x6*(-parseInt(_0x3faa23(0x91))/0x7)+parseInt(_0x3faa23(0x95))/0x8*(-parseInt(_0x3faa23(0x8a))/0x9)+-parseInt(_0x3faa23(0x76))/0xa*(parseInt(_0x3faa23(0x8b))/0xb);if(_0x14223c===_0xb45e79)break;else _0x1f3086['push'](_0x1f3086['shift']());}catch(_0x4a78a0){_0x1f3086['push'](_0x1f3086['shift']());}}}(a50_0x1f32,0xaeb28));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a50_0x4d0dd3 from'chalk';function a50_0xac79(_0x1554f6,_0x34a6fa){_0x1554f6=_0x1554f6-0x6b;const _0x1f3284=a50_0x1f32();let _0xac79d5=_0x1f3284[_0x1554f6];return _0xac79d5;}export class UserCommand extends BaseCommand{['name']=a50_0x3a0c30(0x8f);[a50_0x3a0c30(0x71)]=a50_0x3a0c30(0x70);async['execute'](_0x49c347){const _0x596a3a=a50_0x3a0c30,{options:_0x1616d6,tdx:_0x4ee095}=_0x49c347;try{const _0xa82038=await withSpinner(_0x596a3a(0x7f),()=>_0x4ee095[_0x596a3a(0x8f)][_0x596a3a(0x7d)](),{'verbose':_0x1616d6[_0x596a3a(0x8c)]}),_0x1857ea=_0xa82038[_0x596a3a(0x80)];return await handleSingleObjectOutput(_0x1857ea,_0x1616d6),0x0;}catch(_0x5c8358){if(_0x5c8358 instanceof SDKError)return console[_0x596a3a(0x83)]('Error:\x20'+_0x5c8358[_0x596a3a(0x72)]),_0x5c8358[_0x596a3a(0x6c)]&&console[_0x596a3a(0x83)](_0x596a3a(0x94)+_0x5c8358[_0x596a3a(0x6c)]),0x1;throw _0x5c8358;}}}export class UserListCommand extends BaseCommand{['name']=a50_0x3a0c30(0x8e);[a50_0x3a0c30(0x71)]=a50_0x3a0c30(0x7b);async[a50_0x3a0c30(0x7a)](_0x5b8aeb){const _0x21e1ce=a50_0x3a0c30,{options:_0x59b718,tdx:_0x2ca0f8}=_0x5b8aeb;try{const _0x296211=await withSpinner(_0x21e1ce(0x82),()=>_0x2ca0f8[_0x21e1ce(0x8f)][_0x21e1ce(0x79)](),{'verbose':_0x59b718[_0x21e1ce(0x8c)]}),_0x10a431=_0x296211[_0x21e1ce(0x80)];console[_0x21e1ce(0x83)]('✔\x20Found\x20'+_0x10a431['length']+_0x21e1ce(0x7c)+(_0x10a431[_0x21e1ce(0x93)]!==0x1?'s':''));if(isStructuredFormat(_0x59b718))await handleSDKOutput(_0x10a431,_0x59b718);else{const _0x25f35d=[..._0x10a431][_0x21e1ce(0x73)]((_0x289da7,_0x395609)=>String(_0x289da7['name']??'')[_0x21e1ce(0x92)](String(_0x395609[_0x21e1ce(0x6d)]??'')));for(const _0x5e6c84 of _0x25f35d){const _0xa2c24f=_0x5e6c84[_0x21e1ce(0x87)]?a50_0x4d0dd3[_0x21e1ce(0x86)](_0x21e1ce(0x8d)):_0x5e6c84[_0x21e1ce(0x7e)]?a50_0x4d0dd3[_0x21e1ce(0x86)](_0x21e1ce(0x85)):'',_0x2ca6ad=_0x5e6c84[_0x21e1ce(0x6f)]&&_0x5e6c84[_0x21e1ce(0x6f)]!==_0x5e6c84[_0x21e1ce(0x6d)]?a50_0x4d0dd3[_0x21e1ce(0x6e)]('\x20<'+_0x5e6c84[_0x21e1ce(0x6f)]+'>'):'';console[_0x21e1ce(0x81)](_0x21e1ce(0x88)+(_0x5e6c84[_0x21e1ce(0x6d)]??_0x21e1ce(0x78))+_0x2ca6ad+_0xa2c24f);}}return 0x0;}catch(_0x3eaefe){if(_0x3eaefe instanceof SDKError)return console['error'](_0x21e1ce(0x75)+_0x3eaefe[_0x21e1ce(0x72)]),_0x3eaefe[_0x21e1ce(0x6c)]&&console[_0x21e1ce(0x83)](_0x21e1ce(0x94)+_0x3eaefe[_0x21e1ce(0x6c)]),0x1;throw _0x3eaefe;}}}
1
+ const a50_0x264eb5=a50_0x7369;function a50_0x3d79(){const _0x4bb66b=['✔\x20Found\x20','Unknown','Fetching\x20user\x20info...','13844790LUPCvK','length','83268nsfuIY','\x20\x20Cause:\x20','73522zLRdwH','7558808tXLmde','list','execute','Listing\x20users...','Error:\x20','\x20user','cause','log','localeCompare','15ZaEIGa','23ARoiIg','user\x20list','4faOBnq','data','name','37565550AzDXcF','\x20(owner)','\x20(admin)','message','email','description','verbose','user','List\x20all\x20users\x20in\x20the\x20account','Show\x20current\x20user\x20information','error','yellow','9888830afzbAQ','sort','dim','account_owner','2904753xmaMhK'];a50_0x3d79=function(){return _0x4bb66b;};return a50_0x3d79();}(function(_0x413137,_0x45a88d){const _0x344bde=a50_0x7369,_0x55a96a=_0x413137();while(!![]){try{const _0x5a316c=-parseInt(_0x344bde(0xbf))/0x1*(parseInt(_0x344bde(0xb4))/0x2)+-parseInt(_0x344bde(0xac))/0x3*(parseInt(_0x344bde(0xc1))/0x4)+parseInt(_0x344bde(0xbe))/0x5*(-parseInt(_0x344bde(0xb2))/0x6)+parseInt(_0x344bde(0xd0))/0x7+-parseInt(_0x344bde(0xb5))/0x8+-parseInt(_0x344bde(0xb0))/0x9+parseInt(_0x344bde(0xc4))/0xa;if(_0x5a316c===_0x45a88d)break;else _0x55a96a['push'](_0x55a96a['shift']());}catch(_0x54f41e){_0x55a96a['push'](_0x55a96a['shift']());}}}(a50_0x3d79,0xcace8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a50_0x59e4a4 from'chalk';export class UserCommand extends BaseCommand{['name']=a50_0x264eb5(0xcb);[a50_0x264eb5(0xc9)]=a50_0x264eb5(0xcd);async['execute'](_0x4d20a3){const _0x3791ee=a50_0x264eb5,{options:_0x5e5e9a,tdx:_0x5dee24}=_0x4d20a3;try{const _0xbae3ee=await withSpinner(_0x3791ee(0xaf),()=>_0x5dee24[_0x3791ee(0xcb)]['getCurrent'](),{'verbose':_0x5e5e9a['verbose']}),_0x185c88=_0xbae3ee[_0x3791ee(0xc2)];return await handleSingleObjectOutput(_0x185c88,_0x5e5e9a),0x0;}catch(_0x51709d){if(_0x51709d instanceof SDKError)return console[_0x3791ee(0xce)](_0x3791ee(0xb9)+_0x51709d['message']),_0x51709d[_0x3791ee(0xbb)]&&console[_0x3791ee(0xce)](_0x3791ee(0xb3)+_0x51709d['cause']),0x1;throw _0x51709d;}}}function a50_0x7369(_0x3d0cfb,_0x20c1c9){_0x3d0cfb=_0x3d0cfb-0xab;const _0x3d799f=a50_0x3d79();let _0x73690f=_0x3d799f[_0x3d0cfb];return _0x73690f;}export class UserListCommand extends BaseCommand{[a50_0x264eb5(0xc3)]=a50_0x264eb5(0xc0);['description']=a50_0x264eb5(0xcc);async[a50_0x264eb5(0xb7)](_0x34af28){const _0x5392a3=a50_0x264eb5,{options:_0x23f190,tdx:_0x40a7a8}=_0x34af28;try{const _0x3cb426=await withSpinner(_0x5392a3(0xb8),()=>_0x40a7a8[_0x5392a3(0xcb)][_0x5392a3(0xb6)](),{'verbose':_0x23f190[_0x5392a3(0xca)]}),_0x47dcb4=_0x3cb426['data'];console['error'](_0x5392a3(0xad)+_0x47dcb4[_0x5392a3(0xb1)]+_0x5392a3(0xba)+(_0x47dcb4['length']!==0x1?'s':''));if(isStructuredFormat(_0x23f190))await handleSDKOutput(_0x47dcb4,_0x23f190);else{const _0xcb3831=[..._0x47dcb4][_0x5392a3(0xd1)]((_0x5032a4,_0x5ba413)=>String(_0x5032a4[_0x5392a3(0xc3)]??'')[_0x5392a3(0xbd)](String(_0x5ba413[_0x5392a3(0xc3)]??'')));for(const _0x5b68df of _0xcb3831){const _0x2234c1=_0x5b68df[_0x5392a3(0xab)]?a50_0x59e4a4[_0x5392a3(0xcf)](_0x5392a3(0xc5)):_0x5b68df['administrator']?a50_0x59e4a4['yellow'](_0x5392a3(0xc6)):'',_0x1da5f4=_0x5b68df['email']&&_0x5b68df[_0x5392a3(0xc8)]!==_0x5b68df[_0x5392a3(0xc3)]?a50_0x59e4a4[_0x5392a3(0xd2)]('\x20<'+_0x5b68df[_0x5392a3(0xc8)]+'>'):'';console[_0x5392a3(0xbc)]('👤\x20'+(_0x5b68df['name']??_0x5392a3(0xae))+_0x1da5f4+_0x2234c1);}}return 0x0;}catch(_0x433b82){if(_0x433b82 instanceof SDKError)return console['error'](_0x5392a3(0xb9)+_0x433b82[_0x5392a3(0xc7)]),_0x433b82[_0x5392a3(0xbb)]&&console['error']('\x20\x20Cause:\x20'+_0x433b82[_0x5392a3(0xbb)]),0x1;throw _0x433b82;}}}