@treasuredata/tdx 0.16.9 → 0.16.10

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 (198) hide show
  1. package/README.md +3 -2
  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/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.d.ts.map +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js.map +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-command.js +1 -1
  22. package/dist/commands/job-command.js +1 -1
  23. package/dist/commands/journey-command.js +1 -1
  24. package/dist/commands/journey-validate-command.js +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-proxy.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/segment-command.js +1 -1
  33. package/dist/commands/segment-create-command.js +1 -1
  34. package/dist/commands/segment-fields-command.js +1 -1
  35. package/dist/commands/segment-pull-command.js +1 -1
  36. package/dist/commands/segment-push-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segment-validate-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/status-command.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/unset-command.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/user-command.js +1 -1
  47. package/dist/commands/workflow-command.js +1 -1
  48. package/dist/core/auth.js +1 -1
  49. package/dist/core/command-output.js +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/connection-cache.js +1 -1
  52. package/dist/core/constants.js +1 -1
  53. package/dist/core/credential-cache.js +1 -1
  54. package/dist/core/global-context.js +1 -1
  55. package/dist/core/keychain.js +1 -1
  56. package/dist/core/profile.js +1 -1
  57. package/dist/core/project-config.js +1 -1
  58. package/dist/core/session.js +1 -1
  59. package/dist/core/user-cache.js +1 -1
  60. package/dist/core/version.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/mcp/server.js +1 -1
  63. package/dist/mcp/tools/index.js +1 -1
  64. package/dist/mcp/tools/tdx-run.js +1 -1
  65. package/dist/mcp/tools/tdx-search.js +1 -1
  66. package/dist/mcp/utils.js +1 -1
  67. package/dist/proxy/anthropic-adapter.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.d.ts +31 -0
  69. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  70. package/dist/proxy/claude-usage-tracker.js +1 -1
  71. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  72. package/dist/proxy/context-signature.js +1 -1
  73. package/dist/proxy/conversation-utils.js +1 -1
  74. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  75. package/dist/proxy/passthrough-server.js +1 -1
  76. package/dist/proxy/passthrough-server.js.map +1 -1
  77. package/dist/proxy/server.js +1 -1
  78. package/dist/proxy/session-cache.js +1 -1
  79. package/dist/proxy/sse-usage-parser.js +1 -1
  80. package/dist/sdk/agent/agent-config.js +1 -1
  81. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  82. package/dist/sdk/agent/agent-yaml.js +1 -1
  83. package/dist/sdk/agent/test/evaluator.js +1 -1
  84. package/dist/sdk/agent/test/executor.js +1 -1
  85. package/dist/sdk/agent/test/index.js +1 -1
  86. package/dist/sdk/agent/test/output.js +1 -1
  87. package/dist/sdk/agent/test/parser.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/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/rate-limiter.js +1 -1
  95. package/dist/sdk/client/td-api-client.js +1 -1
  96. package/dist/sdk/client/trino-api-client.js +1 -1
  97. package/dist/sdk/client/workflow-client.js +1 -1
  98. package/dist/sdk/connection-validator.js +1 -1
  99. package/dist/sdk/connection.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.d.ts +0 -1
  103. package/dist/sdk/index.d.ts.map +1 -1
  104. package/dist/sdk/index.js +1 -1
  105. package/dist/sdk/index.js.map +1 -1
  106. package/dist/sdk/io/index.js +1 -1
  107. package/dist/sdk/io/node-filesystem.js +1 -1
  108. package/dist/sdk/job.js +1 -1
  109. package/dist/sdk/journey.js +1 -1
  110. package/dist/sdk/llm/chat-cache.js +1 -1
  111. package/dist/sdk/llm/index.js +1 -1
  112. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  113. package/dist/sdk/llm/model-aliases.js +1 -1
  114. package/dist/sdk/llm/model-factors.js +1 -1
  115. package/dist/sdk/query/index.js +1 -1
  116. package/dist/sdk/query/sql-parser.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-yaml.js +1 -1
  122. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  123. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  124. package/dist/sdk/segment/pull-workflow.js +1 -1
  125. package/dist/sdk/segment/push-workflow.js +1 -1
  126. package/dist/sdk/segment/resolution-context.js +1 -1
  127. package/dist/sdk/segment/segment-path-parser.js +1 -1
  128. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  129. package/dist/sdk/segment/target-resolution.js +1 -1
  130. package/dist/sdk/segment/tdx-config.js +1 -1
  131. package/dist/sdk/segment/validate-files.js +1 -1
  132. package/dist/sdk/segment/yaml-validator.js +1 -1
  133. package/dist/sdk/segment.js +1 -1
  134. package/dist/sdk/types/index.js +1 -1
  135. package/dist/sdk/types/progress.js +1 -1
  136. package/dist/sdk/user.js +1 -1
  137. package/dist/sdk/util/format-detector.js +1 -1
  138. package/dist/sdk/util/formatters.js +1 -1
  139. package/dist/sdk/util/index.js +1 -1
  140. package/dist/sdk/util/tree-formatter.js +1 -1
  141. package/dist/sdk/workflow/clone-workflow.js +1 -1
  142. package/dist/sdk/workflow/index.js +1 -1
  143. package/dist/sdk/workflow/pull-workflow.js +1 -1
  144. package/dist/sdk/workflow/push-workflow.js +1 -1
  145. package/dist/sdk/workflow/tdx-config.js +1 -1
  146. package/dist/sdk/workflow/workflow-utils.js +1 -1
  147. package/dist/test-utils/command-runner.js +1 -1
  148. package/dist/test-utils/factories.js +1 -1
  149. package/dist/test-utils/fixtures.js +1 -1
  150. package/dist/test-utils/http-mock.js +1 -1
  151. package/dist/test-utils/index.js +1 -1
  152. package/dist/utils/async.js +1 -1
  153. package/dist/utils/colors.js +1 -1
  154. package/dist/utils/diff.js +1 -1
  155. package/dist/utils/file-permissions.js +1 -1
  156. package/dist/utils/global-cache.js +1 -1
  157. package/dist/utils/json-loader.js +1 -1
  158. package/dist/utils/local-cache.js +1 -1
  159. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  160. package/dist/utils/logger/formatters/index.js +1 -1
  161. package/dist/utils/logger/handlers/console-handler.js +1 -1
  162. package/dist/utils/logger/handlers/file-handler.js +1 -1
  163. package/dist/utils/logger/handlers/index.js +1 -1
  164. package/dist/utils/logger/handlers/null-handler.js +1 -1
  165. package/dist/utils/logger/index.js +1 -1
  166. package/dist/utils/logger/logger.js +1 -1
  167. package/dist/utils/logger/types.js +1 -1
  168. package/dist/utils/option-validation.js +1 -1
  169. package/dist/utils/port.js +1 -1
  170. package/dist/utils/process.js +1 -1
  171. package/dist/utils/prompt.js +1 -1
  172. package/dist/utils/spinner.js +1 -1
  173. package/dist/utils/sse-parser.js +1 -1
  174. package/dist/utils/string-utils.js +1 -1
  175. package/dist/utils/table-ref-parser.js +1 -1
  176. package/dist/utils/tdx-logger.js +1 -1
  177. package/dist/utils/version-check.js +1 -1
  178. package/package.json +1 -1
  179. package/dist/sdk/claude-agent/claude-agent-client.d.ts +0 -73
  180. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +0 -1
  181. package/dist/sdk/claude-agent/claude-agent-client.js +0 -1
  182. package/dist/sdk/claude-agent/claude-agent-client.js.map +0 -1
  183. package/dist/sdk/claude-agent/environment.d.ts +0 -59
  184. package/dist/sdk/claude-agent/environment.d.ts.map +0 -1
  185. package/dist/sdk/claude-agent/environment.js +0 -1
  186. package/dist/sdk/claude-agent/environment.js.map +0 -1
  187. package/dist/sdk/claude-agent/index.d.ts +0 -15
  188. package/dist/sdk/claude-agent/index.d.ts.map +0 -1
  189. package/dist/sdk/claude-agent/index.js +0 -1
  190. package/dist/sdk/claude-agent/index.js.map +0 -1
  191. package/dist/sdk/claude-agent/system-prompts.d.ts +0 -22
  192. package/dist/sdk/claude-agent/system-prompts.d.ts.map +0 -1
  193. package/dist/sdk/claude-agent/system-prompts.js +0 -1
  194. package/dist/sdk/claude-agent/system-prompts.js.map +0 -1
  195. package/dist/sdk/claude-agent/types.d.ts +0 -107
  196. package/dist/sdk/claude-agent/types.d.ts.map +0 -1
  197. package/dist/sdk/claude-agent/types.js +0 -1
  198. package/dist/sdk/claude-agent/types.js.map +0 -1
@@ -1 +1 @@
1
- const a24_0x588ef6=a24_0x38fa;(function(_0x413445,_0xed12be){const _0x227688=a24_0x38fa,_0x5707c9=_0x413445();while(!![]){try{const _0x1d8bf9=-parseInt(_0x227688(0x165))/0x1*(parseInt(_0x227688(0x124))/0x2)+-parseInt(_0x227688(0x147))/0x3+-parseInt(_0x227688(0x134))/0x4+-parseInt(_0x227688(0x173))/0x5*(-parseInt(_0x227688(0x179))/0x6)+parseInt(_0x227688(0x158))/0x7+-parseInt(_0x227688(0x128))/0x8*(-parseInt(_0x227688(0x182))/0x9)+parseInt(_0x227688(0x136))/0xa*(parseInt(_0x227688(0x171))/0xb);if(_0x1d8bf9===_0xed12be)break;else _0x5707c9['push'](_0x5707c9['shift']());}catch(_0x30e32d){_0x5707c9['push'](_0x5707c9['shift']());}}}(a24_0x1cc1,0x5c43d));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a24_0x4429d6 from'node:path';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';function a24_0x38fa(_0x1c8c05,_0x53e585){_0x1c8c05=_0x1c8c05-0x11e;const _0x1cc1f7=a24_0x1cc1();let _0x38fac4=_0x1cc1f7[_0x1c8c05];return _0x38fac4;}import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a24_0x54d590 from'prompts';import a24_0x308155 from'chalk';function validateProfileName(_0x85816f){const _0x3f9846=a24_0x38fa;if(!_0x85816f||!_0x85816f[_0x3f9846(0x14f)]())return'Profile\x20name\x20cannot\x20be\x20empty';const _0x1e97b2=_0x85816f['trim']();if(!/^[a-zA-Z0-9_-]+$/[_0x3f9846(0x183)](_0x1e97b2))return'Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore';if(profileExists(_0x1e97b2))return _0x3f9846(0x146)+_0x1e97b2+_0x3f9846(0x156);return!![];}function a24_0x1cc1(){const _0xb1c415=['llm_project','us01','You\x20can\x20find\x20your\x20API\x20key\x20at:','5577176ADWdGZ','\x27\x20does\x20not\x20exist.','site','split','\x0aSetup\x20cancelled','apiKey','\x0aOperation\x20cancelled','Remove\x20a\x20profile','Site\x20name\x20cannot\x20be\x20empty','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','profile:use','green','966456YkvQHN','\x20Profile\x20\x27','7730CmkWsB','\x20API\x20key\x20removed\x20from\x20system\x20keychain','log','name','\x27\x20updated:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','tdx:\x20profile\x20remove','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Enter\x20your\x20TD\x20API\x20key:','(cleared)','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','config','\x0aAvailable\x20profiles:','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20--default\x27\x20to\x20save\x20permanently','Profile\x20\x27','2260389apqTkm','execute','\x20API\x20key\x20saved\x20to\x20system\x20keychain','tdx.json','confirm','session','customSite','Session\x20profile\x20set\x20to:\x20','trim','includes','default','profile:set','Enter\x20profile\x20name:','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','profileName','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','\x27\x20created','2613408NPPMRO','Enter\x20site\x20name:','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','logLevel','message','validate','bold','join','create','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','ERROR','profile','Enter\x20description\x20(optional):','1101KgjQEH','parent_segment','VALID_KEYS','email','\x27\x20requires\x20API\x20key\x20validation.','red','Site\x20was\x20not\x20changed.','dim','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Validating\x20API\x20key...','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','API\x20key\x20cannot\x20be\x20empty','5357ZGXkeL','✗\x20Validation\x20failed:\x20','5sVlfQX','llm_agent','(session:\x20','Operation\x20cancelled','\x20\x20(no\x20profiles\x20found)','length','91398ZEkJdk','Create\x20a\x20new\x20profile','password','\x20\x20tdx\x20--profile\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','error','status','description','9qmgnNT','test','/app/mp/ak','warn','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','tdx:\x20profile\x20create','jobs','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','text','Set\x20a\x20profile\x20configuration\x20value','\x20\x20-\x20','getUserInfo','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','yellow','162EQmfpf'];a24_0x1cc1=function(){return _0xb1c415;};return a24_0x1cc1();}export class ProfileCreateCommand extends BaseCommand{['name']='profile:create';[a24_0x588ef6(0x181)]=a24_0x588ef6(0x17a);async[a24_0x588ef6(0x148)](_0x5a9a3b){const _0x4ab030=a24_0x588ef6,{options:_0x3aa5e1,args:_0xdbc03b}=_0x5a9a3b;console['log'](a24_0x308155[_0x4ab030(0x15e)](_0x4ab030(0x187)));let _0x19ee8c;if(_0xdbc03b[_0x4ab030(0x178)]>0x0&&_0xdbc03b[0x0]){const _0x4b7617=_0xdbc03b[0x0][_0x4ab030(0x14f)](),_0x1f2096=validateProfileName(_0x4b7617);if(_0x1f2096!==!![])return console[_0x4ab030(0x17f)](a24_0x308155[_0x4ab030(0x16a)](_0x1f2096)),0x1;_0x19ee8c=_0x4b7617;}else{const _0x584baf=await a24_0x54d590({'type':_0x4ab030(0x11e),'name':'profileName','message':_0x4ab030(0x153),'validate':validateProfileName});if(!_0x584baf[_0x4ab030(0x155)])return console[_0x4ab030(0x138)](_0x4ab030(0x12c)),0x1;_0x19ee8c=_0x584baf[_0x4ab030(0x155)][_0x4ab030(0x14f)]();}const _0x3332bc=await a24_0x54d590({'type':_0x4ab030(0x11e),'name':'description','message':_0x4ab030(0x164)}),_0x3766d9=_0x3332bc[_0x4ab030(0x181)]?.[_0x4ab030(0x14f)]()||undefined,_0x178aab=_0x3aa5e1[_0x4ab030(0x12a)]||_0x4ab030(0x126),{choices:_0x156d52,initialIndex:_0x3b8854}=buildSiteChoices(_0x178aab),_0x37c7ab=await a24_0x54d590({'type':'select','name':_0x4ab030(0x12a),'message':_0x4ab030(0x161)+_0x19ee8c+'\x27:','choices':_0x156d52,'initial':_0x3b8854});if(!_0x37c7ab[_0x4ab030(0x12a)])return console[_0x4ab030(0x138)](_0x4ab030(0x12c)),0x1;let _0x3d285c;if(_0x37c7ab[_0x4ab030(0x12a)]==='other'){const _0x1cf8fb=await a24_0x54d590({'type':'text','name':_0x4ab030(0x14d),'message':_0x4ab030(0x159),'initial':_0x4ab030(0x126),'validate':_0xd9a2fe=>{const _0x4049cc=_0x4ab030;if(!_0xd9a2fe||!_0xd9a2fe[_0x4049cc(0x14f)]())return _0x4049cc(0x130);if(!/^[a-z0-9-]+$/[_0x4049cc(0x183)](_0xd9a2fe[_0x4049cc(0x14f)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x1cf8fb[_0x4ab030(0x14d)])return console['log'](_0x4ab030(0x12c)),0x1;_0x3d285c=_0x1cf8fb[_0x4ab030(0x14d)];}else _0x3d285c=_0x37c7ab['site'];const _0x547d63=resolveSite(_0x3d285c);console[_0x4ab030(0x138)](_0x4ab030(0x13e)+_0x547d63),console[_0x4ab030(0x138)](_0x4ab030(0x127)),console[_0x4ab030(0x138)]('\x20\x20'+getConsoleUrl(_0x547d63,_0x4ab030(0x184)));const _0x3fe3b5=await a24_0x54d590({'type':_0x4ab030(0x17b),'name':'apiKey','message':_0x4ab030(0x13f),'validate':_0x116087=>{if(!_0x116087||!_0x116087['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3fe3b5[_0x4ab030(0x12d)])return console[_0x4ab030(0x138)]('\x0aSetup\x20cancelled'),0x1;const _0x2caebd=_0x3fe3b5[_0x4ab030(0x12d)];console[_0x4ab030(0x138)](_0x4ab030(0x16e));try{const _0xf7eb7f=TDX[_0x4ab030(0x160)]({'site':_0x547d63,'apiKey':_0x2caebd[_0x4ab030(0x14f)](),'logLevel':_0x3aa5e1['logLevel']??LogLevel['ERROR']}),_0x47a215=await _0xf7eb7f[_0x4ab030(0x188)]['getUserInfo']();console[_0x4ab030(0x138)](a24_0x308155[_0x4ab030(0x133)]('✓')+_0x4ab030(0x144)+_0x47a215[_0x4ab030(0x168)]+')');const _0x2efcae=await isKeychainAvailable();_0x2efcae?(await saveAPIKeyAsync(_0x2caebd['trim'](),_0x547d63,_0x19ee8c),console[_0x4ab030(0x138)](a24_0x308155['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x19ee8c+')')):(console[_0x4ab030(0x185)](a24_0x308155[_0x4ab030(0x123)](_0x4ab030(0x18a))),console[_0x4ab030(0x185)](a24_0x308155[_0x4ab030(0x123)](_0x4ab030(0x17d))));const _0x2405c6={'site':_0x547d63,..._0x3766d9&&{'description':_0x3766d9}};return saveProfileToUserConfig(_0x19ee8c,_0x2405c6),console['log'](a24_0x308155[_0x4ab030(0x133)]('✓')+'\x20Profile\x20\x27'+_0x19ee8c+_0x4ab030(0x157)),console[_0x4ab030(0x138)](),console[_0x4ab030(0x138)](_0x4ab030(0x16f)),console[_0x4ab030(0x138)](_0x4ab030(0x17c)+_0x19ee8c+_0x4ab030(0x13b)),console[_0x4ab030(0x138)](_0x4ab030(0x17c)+_0x19ee8c+_0x4ab030(0x16d)),0x0;}catch(_0x341a3c){if(_0x341a3c instanceof HTTPClientError&&_0x341a3c[_0x4ab030(0x180)]===0x191)return printAuthError(_0x341a3c),0x1;return console['error'](a24_0x308155[_0x4ab030(0x16a)]('✗\x20Validation\x20failed:\x20'+(_0x341a3c instanceof Error?_0x341a3c[_0x4ab030(0x15c)]:String(_0x341a3c)))),console[_0x4ab030(0x17f)](_0x4ab030(0x17e)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a24_0x588ef6(0x139)]='profile:remove';[a24_0x588ef6(0x181)]=a24_0x588ef6(0x12f);['validate'](_0x57d084){const _0x2789a7=a24_0x588ef6,{args:_0x5ae278}=_0x57d084;if(_0x5ae278[_0x2789a7(0x178)]===0x0)return _0x2789a7(0x154);return undefined;}async[a24_0x588ef6(0x148)](_0x58378b){const _0x4ef1c1=a24_0x588ef6,{args:_0x4b3c87}=_0x58378b,_0x133c71=_0x4b3c87[0x0];console[_0x4ef1c1(0x138)](a24_0x308155[_0x4ef1c1(0x15e)](_0x4ef1c1(0x13c)));if(!profileExists(_0x133c71)){console[_0x4ef1c1(0x17f)](a24_0x308155[_0x4ef1c1(0x16a)](_0x4ef1c1(0x146)+_0x133c71+'\x27\x20does\x20not\x20exist.')),console['log'](_0x4ef1c1(0x143));const _0xa89db7=listProfiles();if(_0xa89db7[_0x4ef1c1(0x178)]===0x0)console[_0x4ef1c1(0x138)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x44d2f0 of _0xa89db7){console[_0x4ef1c1(0x138)](_0x4ef1c1(0x120)+_0x44d2f0[_0x4ef1c1(0x139)]);}return 0x1;}const _0x206694=await a24_0x54d590({'type':_0x4ef1c1(0x14b),'name':'confirm','message':_0x4ef1c1(0x131)+_0x133c71+'\x27?','initial':![]});if(!_0x206694[_0x4ef1c1(0x14b)])return console[_0x4ef1c1(0x138)]('Removal\x20cancelled'),0x0;try{removeProfileFromUserConfig(_0x133c71),console[_0x4ef1c1(0x138)](a24_0x308155[_0x4ef1c1(0x133)]('✓')+_0x4ef1c1(0x135)+_0x133c71+'\x27\x20removed\x20from\x20configuration');}catch(_0x3db900){return console[_0x4ef1c1(0x17f)](a24_0x308155[_0x4ef1c1(0x16a)]('Failed\x20to\x20remove\x20profile:\x20'+(_0x3db900 instanceof Error?_0x3db900[_0x4ef1c1(0x15c)]:String(_0x3db900)))),0x1;}const _0x33d8c4=await isKeychainAvailable();if(_0x33d8c4){const _0x50d460=await deleteKeychainAPIKey(_0x133c71);_0x50d460&&console['log'](a24_0x308155['green']('✓')+_0x4ef1c1(0x137));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a24_0x588ef6(0x139)]=a24_0x588ef6(0x152);['description']=a24_0x588ef6(0x11f);static ['VALID_KEYS']=[a24_0x588ef6(0x12a),'database',a24_0x588ef6(0x166),a24_0x588ef6(0x125),a24_0x588ef6(0x174),'description'];[a24_0x588ef6(0x15d)](_0x3363c9){const _0x56b0c6=a24_0x588ef6,{args:_0x447680,options:_0x79aee4}=_0x3363c9,_0x3c2b34=_0x79aee4[_0x56b0c6(0x163)]||getActiveProfile();if(!_0x3c2b34)return _0x56b0c6(0x186);if(_0x447680[_0x56b0c6(0x178)]===0x0)return _0x56b0c6(0x13d)+ProfileSetCommand[_0x56b0c6(0x167)][_0x56b0c6(0x15f)](',\x20');const _0x2df9d2=_0x447680[0x0];if(!_0x2df9d2[_0x56b0c6(0x150)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x56b0c6(0x167)][_0x56b0c6(0x15f)](',\x20');const [_0x5341e1]=_0x2df9d2[_0x56b0c6(0x12b)]('=',0x2);if(!ProfileSetCommand[_0x56b0c6(0x167)][_0x56b0c6(0x150)](_0x5341e1))return'Unknown\x20key\x20\x27'+_0x5341e1+'\x27.\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x56b0c6(0x167)][_0x56b0c6(0x15f)](',\x20');return undefined;}async[a24_0x588ef6(0x148)](_0x526070){const _0x2ebeff=a24_0x588ef6,{args:_0x29ece3,options:_0x55861f}=_0x526070,_0x7f1014=_0x55861f[_0x2ebeff(0x163)]||getActiveProfile(),[_0x3f4cdf,..._0x777121]=_0x29ece3[0x0][_0x2ebeff(0x12b)]('='),_0x18edd9=_0x777121[_0x2ebeff(0x15f)]('=');console['log'](a24_0x308155[_0x2ebeff(0x15e)]('tdx:\x20profile\x20set'));if(!profileExists(_0x7f1014)){const _0xa0bd78=await a24_0x54d590({'type':_0x2ebeff(0x14b),'name':_0x2ebeff(0x160),'message':_0x2ebeff(0x146)+_0x7f1014+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0xa0bd78['create'])return console[_0x2ebeff(0x138)](_0x2ebeff(0x176)),0x1;}const _0x38296c=loadProfile(_0x7f1014),_0x5b3f0d=_0x38296c?.[_0x2ebeff(0x142)]||{};if(_0x3f4cdf===_0x2ebeff(0x12a)){const _0xfc788d=resolveSite(_0x18edd9);console[_0x2ebeff(0x138)]('Changing\x20site\x20to\x20\x27'+_0xfc788d+_0x2ebeff(0x169)),console[_0x2ebeff(0x138)](_0x2ebeff(0x15a)),console[_0x2ebeff(0x138)]('\x20\x20'+getConsoleUrl(_0xfc788d,_0x2ebeff(0x184)));const _0x316d4c=await a24_0x54d590({'type':_0x2ebeff(0x17b),'name':_0x2ebeff(0x12d),'message':_0x2ebeff(0x122),'validate':_0x109f9d=>{const _0x1a5de1=_0x2ebeff;if(!_0x109f9d||!_0x109f9d[_0x1a5de1(0x14f)]())return _0x1a5de1(0x170);return!![];}});if(!_0x316d4c['apiKey'])return console[_0x2ebeff(0x138)](_0x2ebeff(0x12e)),0x1;console[_0x2ebeff(0x138)](_0x2ebeff(0x16e));try{const _0x1a0ca5=TDX[_0x2ebeff(0x160)]({'site':_0xfc788d,'apiKey':_0x316d4c[_0x2ebeff(0x12d)][_0x2ebeff(0x14f)](),'logLevel':_0x55861f[_0x2ebeff(0x15b)]??LogLevel[_0x2ebeff(0x162)]}),_0x48d0bb=await _0x1a0ca5[_0x2ebeff(0x188)][_0x2ebeff(0x121)]();console[_0x2ebeff(0x138)](a24_0x308155['green']('✓')+_0x2ebeff(0x144)+_0x48d0bb[_0x2ebeff(0x168)]+')');const _0x3ad7ef=await isKeychainAvailable();_0x3ad7ef?(await saveAPIKeyAsync(_0x316d4c['apiKey'][_0x2ebeff(0x14f)](),_0xfc788d,_0x7f1014),console['log'](a24_0x308155[_0x2ebeff(0x133)]('✓')+_0x2ebeff(0x149))):console['warn'](a24_0x308155[_0x2ebeff(0x123)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x5b3f0d[_0x2ebeff(0x12a)]=_0xfc788d;}catch(_0x3f3609){if(_0x3f3609 instanceof HTTPClientError&&_0x3f3609[_0x2ebeff(0x180)]===0x191)return printAuthError(_0x3f3609),0x1;return console[_0x2ebeff(0x17f)](a24_0x308155[_0x2ebeff(0x16a)](_0x2ebeff(0x172)+(_0x3f3609 instanceof Error?_0x3f3609[_0x2ebeff(0x15c)]:String(_0x3f3609)))),console[_0x2ebeff(0x17f)](_0x2ebeff(0x16b)),0x1;}}else _0x5b3f0d[_0x3f4cdf]=_0x18edd9||undefined;return saveProfileToUserConfig(_0x7f1014,_0x5b3f0d),console['log'](a24_0x308155[_0x2ebeff(0x133)]('✓')+'\x20Profile\x20\x27'+_0x7f1014+_0x2ebeff(0x13a)+_0x3f4cdf+'='+(_0x18edd9||_0x2ebeff(0x140))),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a24_0x588ef6(0x132);['description']='Set\x20session\x20profile';['validate'](_0x3dd0d5){const _0x295964=a24_0x588ef6,{args:_0x58fb1a}=_0x3dd0d5;if(_0x58fb1a[_0x295964(0x178)]===0x0)return _0x295964(0x141);return undefined;}async[a24_0x588ef6(0x148)](_0x131df7){const _0xb60ed=a24_0x588ef6,{args:_0xf0dd40,options:_0x31c64b}=_0x131df7,_0x1c9e8b=_0xf0dd40[0x0],_0x432faf=_0x31c64b[_0xb60ed(0x151)];cleanExpiredSessions();if(!profileExists(_0x1c9e8b)){console[_0xb60ed(0x17f)](a24_0x308155[_0xb60ed(0x16a)]('Profile\x20\x27'+_0x1c9e8b+_0xb60ed(0x129))),console['log']('\x0aAvailable\x20profiles:');const _0x2adde8=listProfiles();if(_0x2adde8['length']===0x0)console[_0xb60ed(0x138)](_0xb60ed(0x177));else for(const _0x40fac9 of _0x2adde8){console[_0xb60ed(0x138)](_0xb60ed(0x120)+_0x40fac9['name']);}return 0x1;}if(_0x432faf){const _0x477398=a24_0x4429d6['join'](getConfigDir(),_0xb60ed(0x14a));return saveActiveProfileToUserConfig(_0x1c9e8b),console[_0xb60ed(0x138)]('Default\x20profile\x20set\x20to:\x20'+a24_0x308155['green'](_0x1c9e8b)),console[_0xb60ed(0x138)](a24_0x308155[_0xb60ed(0x16c)]('\x0aSaved\x20to:\x20'+_0x477398)),0x0;}const _0x3b6bbf=_0x31c64b[_0xb60ed(0x14c)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x1c9e8b},_0x31c64b[_0xb60ed(0x14c)]),console[_0xb60ed(0x138)](_0xb60ed(0x14e)+a24_0x308155[_0xb60ed(0x133)](_0x1c9e8b)+'\x20'+a24_0x308155[_0xb60ed(0x16c)](_0xb60ed(0x175)+_0x3b6bbf+')')),console[_0xb60ed(0x138)](a24_0x308155[_0xb60ed(0x16c)](_0xb60ed(0x189)+_0x1c9e8b+_0xb60ed(0x145))),0x0;}}
1
+ const a24_0x3cce5f=a24_0x5d6f;(function(_0x2c95fb,_0x487cb9){const _0x2fd970=a24_0x5d6f,_0x5da276=_0x2c95fb();while(!![]){try{const _0x24e4a6=parseInt(_0x2fd970(0xc1))/0x1+-parseInt(_0x2fd970(0xd8))/0x2+-parseInt(_0x2fd970(0xe8))/0x3+-parseInt(_0x2fd970(0xf9))/0x4*(-parseInt(_0x2fd970(0xf8))/0x5)+parseInt(_0x2fd970(0xcc))/0x6*(parseInt(_0x2fd970(0x116))/0x7)+-parseInt(_0x2fd970(0xcf))/0x8*(-parseInt(_0x2fd970(0xbf))/0x9)+parseInt(_0x2fd970(0xac))/0xa*(parseInt(_0x2fd970(0xbe))/0xb);if(_0x24e4a6===_0x487cb9)break;else _0x5da276['push'](_0x5da276['shift']());}catch(_0x198de7){_0x5da276['push'](_0x5da276['shift']());}}}(a24_0x3ee8,0x312bb));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';function a24_0x5d6f(_0x568412,_0x267c44){_0x568412=_0x568412-0xab;const _0x3ee8f5=a24_0x3ee8();let _0x5d6f1f=_0x3ee8f5[_0x568412];return _0x5d6f1f;}import{getConfigDir}from'../core/config.js';import*as a24_0x5d1f35 from'node:path';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a24_0x9316dd from'prompts';import a24_0x361b0f from'chalk';function validateProfileName(_0x132868){const _0x2404bd=a24_0x5d6f;if(!_0x132868||!_0x132868[_0x2404bd(0xd6)]())return _0x2404bd(0xd7);const _0x5dbb68=_0x132868['trim']();if(!/^[a-zA-Z0-9_-]+$/[_0x2404bd(0x11a)](_0x5dbb68))return _0x2404bd(0xf3);if(profileExists(_0x5dbb68))return _0x2404bd(0x115)+_0x5dbb68+_0x2404bd(0x10a);return!![];}export class ProfileCreateCommand extends BaseCommand{[a24_0x3cce5f(0xe1)]=a24_0x3cce5f(0xe2);[a24_0x3cce5f(0xbd)]=a24_0x3cce5f(0xf0);async[a24_0x3cce5f(0xc9)](_0x2177cd){const _0x327a67=a24_0x3cce5f,{options:_0x326fb3,args:_0x8f6126}=_0x2177cd;console[_0x327a67(0xdb)](a24_0x361b0f['bold']('tdx:\x20profile\x20create'));let _0x165d71;if(_0x8f6126[_0x327a67(0xb4)]>0x0&&_0x8f6126[0x0]){const _0x5bc2e5=_0x8f6126[0x0]['trim'](),_0x4cb0ba=validateProfileName(_0x5bc2e5);if(_0x4cb0ba!==!![])return console[_0x327a67(0xfc)](a24_0x361b0f['red'](_0x4cb0ba)),0x1;_0x165d71=_0x5bc2e5;}else{const _0x35285b=await a24_0x9316dd({'type':_0x327a67(0x105),'name':_0x327a67(0xd2),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x35285b[_0x327a67(0xd2)])return console[_0x327a67(0xdb)](_0x327a67(0xcb)),0x1;_0x165d71=_0x35285b[_0x327a67(0xd2)]['trim']();}const _0x332f46=await a24_0x9316dd({'type':_0x327a67(0x105),'name':_0x327a67(0xbd),'message':_0x327a67(0xbc)}),_0x291bb8=_0x332f46[_0x327a67(0xbd)]?.[_0x327a67(0xd6)]()||undefined,_0x1f1dd7=_0x326fb3[_0x327a67(0xc2)]||_0x327a67(0xea),{choices:_0x3a96c0,initialIndex:_0x519ab2}=buildSiteChoices(_0x1f1dd7),_0x482da6=await a24_0x9316dd({'type':'select','name':_0x327a67(0xc2),'message':_0x327a67(0x118)+_0x165d71+'\x27:','choices':_0x3a96c0,'initial':_0x519ab2});if(!_0x482da6['site'])return console[_0x327a67(0xdb)](_0x327a67(0xcb)),0x1;let _0x207bb4;if(_0x482da6[_0x327a67(0xc2)]===_0x327a67(0xf6)){const _0x173d6e=await a24_0x9316dd({'type':_0x327a67(0x105),'name':_0x327a67(0xec),'message':'Enter\x20site\x20name:','initial':'us01','validate':_0x389257=>{const _0x19b3a4=_0x327a67;if(!_0x389257||!_0x389257[_0x19b3a4(0xd6)]())return _0x19b3a4(0xc3);if(!/^[a-z0-9-]+$/[_0x19b3a4(0x11a)](_0x389257[_0x19b3a4(0xd6)]()))return _0x19b3a4(0x114);return!![];}});if(!_0x173d6e[_0x327a67(0xec)])return console[_0x327a67(0xdb)](_0x327a67(0xcb)),0x1;_0x207bb4=_0x173d6e[_0x327a67(0xec)];}else _0x207bb4=_0x482da6['site'];const _0x42c8b8=resolveSite(_0x207bb4);console[_0x327a67(0xdb)](_0x327a67(0xb8)+_0x42c8b8),console[_0x327a67(0xdb)](_0x327a67(0x106)),console[_0x327a67(0xdb)]('\x20\x20'+getConsoleUrl(_0x42c8b8,'/app/mp/ak'));const _0x1ba07a=await a24_0x9316dd({'type':_0x327a67(0xb7),'name':_0x327a67(0x10d),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x18a0e4=>{const _0x566e41=_0x327a67;if(!_0x18a0e4||!_0x18a0e4[_0x566e41(0xd6)]())return _0x566e41(0xb1);return!![];}});if(!_0x1ba07a[_0x327a67(0x10d)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x51fe6c=_0x1ba07a['apiKey'];console[_0x327a67(0xdb)](_0x327a67(0xe4));try{const _0x2e4af0=TDX[_0x327a67(0x113)]({'site':_0x42c8b8,'apiKey':_0x51fe6c[_0x327a67(0xd6)](),'logLevel':_0x326fb3[_0x327a67(0xbb)]??LogLevel['ERROR']}),_0x357709=await _0x2e4af0['jobs']['getUserInfo']();console['log'](a24_0x361b0f['green']('✓')+_0x327a67(0xae)+_0x357709[_0x327a67(0xb9)]+')');const _0x317474=await isKeychainAvailable();_0x317474?(await saveAPIKeyAsync(_0x51fe6c[_0x327a67(0xd6)](),_0x42c8b8,_0x165d71),console[_0x327a67(0xdb)](a24_0x361b0f[_0x327a67(0x100)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x165d71+')')):(console['warn'](a24_0x361b0f[_0x327a67(0x109)](_0x327a67(0xff))),console[_0x327a67(0xf1)](a24_0x361b0f[_0x327a67(0x109)](_0x327a67(0x10c))));const _0x1782a6={'site':_0x42c8b8,..._0x291bb8&&{'description':_0x291bb8}};return saveProfileToUserConfig(_0x165d71,_0x1782a6),console[_0x327a67(0xdb)](a24_0x361b0f['green']('✓')+'\x20Profile\x20\x27'+_0x165d71+_0x327a67(0xfa)),console[_0x327a67(0xdb)](),console[_0x327a67(0xdb)](_0x327a67(0x112)),console[_0x327a67(0xdb)]('\x20\x20tdx\x20--profile\x20'+_0x165d71+_0x327a67(0xad)),console[_0x327a67(0xdb)]('\x20\x20tdx\x20--profile\x20'+_0x165d71+_0x327a67(0x10f)),0x0;}catch(_0x450f90){if(_0x450f90 instanceof HTTPClientError&&_0x450f90['status']===0x191)return printAuthError(_0x450f90),0x1;return console['error'](a24_0x361b0f['red'](_0x327a67(0xdf)+(_0x450f90 instanceof Error?_0x450f90['message']:String(_0x450f90)))),console[_0x327a67(0xfc)]('Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.'),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a24_0x3cce5f(0xe1)]=a24_0x3cce5f(0x101);['description']=a24_0x3cce5f(0x111);[a24_0x3cce5f(0xd0)](_0x117906){const _0x354a74=a24_0x3cce5f,{args:_0x591ae}=_0x117906;if(_0x591ae['length']===0x0)return _0x354a74(0xba);return undefined;}async[a24_0x3cce5f(0xc9)](_0x2630a7){const _0x256cdb=a24_0x3cce5f,{args:_0x4bfe21}=_0x2630a7,_0x2be74c=_0x4bfe21[0x0];console[_0x256cdb(0xdb)](a24_0x361b0f['bold'](_0x256cdb(0xc8)));if(!profileExists(_0x2be74c)){console[_0x256cdb(0xfc)](a24_0x361b0f[_0x256cdb(0xfd)](_0x256cdb(0x115)+_0x2be74c+_0x256cdb(0x10b))),console[_0x256cdb(0xdb)](_0x256cdb(0xf5));const _0x4917ac=listProfiles();if(_0x4917ac[_0x256cdb(0xb4)]===0x0)console['log']('\x20\x20(no\x20profiles\x20found)');else for(const _0x3237e7 of _0x4917ac){console['log']('\x20\x20-\x20'+_0x3237e7[_0x256cdb(0xe1)]);}return 0x1;}const _0x49247c=await a24_0x9316dd({'type':'confirm','name':'confirm','message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x2be74c+'\x27?','initial':![]});if(!_0x49247c[_0x256cdb(0xf2)])return console[_0x256cdb(0xdb)](_0x256cdb(0x107)),0x0;try{removeProfileFromUserConfig(_0x2be74c),console['log'](a24_0x361b0f[_0x256cdb(0x100)]('✓')+_0x256cdb(0x108)+_0x2be74c+_0x256cdb(0xd1));}catch(_0x3b195d){return console[_0x256cdb(0xfc)](a24_0x361b0f[_0x256cdb(0xfd)](_0x256cdb(0xd4)+(_0x3b195d instanceof Error?_0x3b195d[_0x256cdb(0x110)]:String(_0x3b195d)))),0x1;}const _0x3cfc05=await isKeychainAvailable();if(_0x3cfc05){const _0x10bcad=await deleteKeychainAPIKey(_0x2be74c);_0x10bcad&&console[_0x256cdb(0xdb)](a24_0x361b0f[_0x256cdb(0x100)]('✓')+_0x256cdb(0x102));}return 0x0;}}function a24_0x3ee8(){const _0x1218e1=['\x27\x20created','llm_agent','error','red','\x20\x20(no\x20profiles\x20found)','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','green','profile:remove','\x20API\x20key\x20removed\x20from\x20system\x20keychain','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','text','You\x20can\x20find\x20your\x20API\x20key\x20at:','Removal\x20cancelled','\x20Profile\x20\x27','yellow','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','\x27\x20does\x20not\x20exist.','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','apiKey','dim','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','message','Remove\x20a\x20profile','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','create','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Profile\x20\x27','450303RDQRPJ','split','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','config','test','(session:\x20','10BadQfY','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','/app/mp/ak','API\x20key\x20cannot\x20be\x20empty','\x0aOperation\x20cancelled','Set\x20session\x20profile','length','profile','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','password','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','email','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','logLevel','Enter\x20description\x20(optional):','description','957539mlFzms','3609HdvCpH','getUserInfo','75594kvbJpo','site','Site\x20name\x20cannot\x20be\x20empty','VALID_KEYS','profile:use','\x20--default\x27\x20to\x20save\x20permanently','\x27\x20updated:\x20','tdx:\x20profile\x20remove','execute','\x27\x20requires\x20API\x20key\x20validation.','\x0aSetup\x20cancelled','6aUwbPi','profile:set','\x27.\x0a\x0aValid\x20keys:\x20','7224iLBsfn','validate','\x27\x20removed\x20from\x20configuration','profileName','\x27\x20does\x20not\x20exist.\x20Create\x20it?','Failed\x20to\x20remove\x20profile:\x20','\x0aSaved\x20to:\x20','trim','Profile\x20name\x20cannot\x20be\x20empty','537790EFqRTL','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','status','log','\x20\x20-\x20','tdx.json','\x20API\x20key\x20saved\x20to\x20system\x20keychain','✗\x20Validation\x20failed:\x20','join','name','profile:create','Site\x20was\x20not\x20changed.','Validating\x20API\x20key...','Operation\x20cancelled','toString','session','1008297srtnPl','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','us01','tdx:\x20profile\x20set','customSite','database','includes','default','Create\x20a\x20new\x20profile','warn','confirm','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','llm_project','\x0aAvailable\x20profiles:','other','Set\x20a\x20profile\x20configuration\x20value','1330KnRKbF','3268IHQCng'];a24_0x3ee8=function(){return _0x1218e1;};return a24_0x3ee8();}export class ProfileSetCommand extends BaseCommand{[a24_0x3cce5f(0xe1)]=a24_0x3cce5f(0xcd);[a24_0x3cce5f(0xbd)]=a24_0x3cce5f(0xf7);static [a24_0x3cce5f(0xc4)]=['site',a24_0x3cce5f(0xed),'parent_segment',a24_0x3cce5f(0xf4),a24_0x3cce5f(0xfb),'description'];[a24_0x3cce5f(0xd0)](_0x5bc053){const _0x7be330=a24_0x3cce5f,{args:_0x2429d3,options:_0x4b6a93}=_0x5bc053,_0x28c741=_0x4b6a93[_0x7be330(0xb5)]||getActiveProfile();if(!_0x28c741)return _0x7be330(0x103);if(_0x2429d3[_0x7be330(0xb4)]===0x0)return _0x7be330(0xb6)+ProfileSetCommand[_0x7be330(0xc4)][_0x7be330(0xe0)](',\x20');const _0x1736d0=_0x2429d3[0x0];if(!_0x1736d0[_0x7be330(0xee)]('='))return _0x7be330(0x104)+ProfileSetCommand['VALID_KEYS'][_0x7be330(0xe0)](',\x20');const [_0x57b485]=_0x1736d0[_0x7be330(0x117)]('=',0x2);if(!ProfileSetCommand[_0x7be330(0xc4)][_0x7be330(0xee)](_0x57b485))return'Unknown\x20key\x20\x27'+_0x57b485+_0x7be330(0xce)+ProfileSetCommand['VALID_KEYS'][_0x7be330(0xe0)](',\x20');return undefined;}async[a24_0x3cce5f(0xc9)](_0xbfccbf){const _0x5f50f9=a24_0x3cce5f,{args:_0x4371cf,options:_0x1e8f64}=_0xbfccbf,_0x353945=_0x1e8f64[_0x5f50f9(0xb5)]||getActiveProfile(),[_0x254552,..._0x2c23fd]=_0x4371cf[0x0]['split']('='),_0x1819e5=_0x2c23fd[_0x5f50f9(0xe0)]('=');console['log'](a24_0x361b0f['bold'](_0x5f50f9(0xeb)));if(!profileExists(_0x353945)){const _0x49a8dc=await a24_0x9316dd({'type':_0x5f50f9(0xf2),'name':'create','message':_0x5f50f9(0x115)+_0x353945+_0x5f50f9(0xd3),'initial':!![]});if(!_0x49a8dc[_0x5f50f9(0x113)])return console[_0x5f50f9(0xdb)](_0x5f50f9(0xe5)),0x1;}const _0x231dc7=loadProfile(_0x353945),_0x394764=_0x231dc7?.[_0x5f50f9(0x119)]||{};if(_0x254552===_0x5f50f9(0xc2)){const _0x9182bc=resolveSite(_0x1819e5);console['log']('Changing\x20site\x20to\x20\x27'+_0x9182bc+_0x5f50f9(0xca)),console[_0x5f50f9(0xdb)](_0x5f50f9(0xaf)),console['log']('\x20\x20'+getConsoleUrl(_0x9182bc,_0x5f50f9(0xb0)));const _0x36ae56=await a24_0x9316dd({'type':_0x5f50f9(0xb7),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x4f2bfa=>{const _0x244a1d=_0x5f50f9;if(!_0x4f2bfa||!_0x4f2bfa[_0x244a1d(0xd6)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x36ae56[_0x5f50f9(0x10d)])return console[_0x5f50f9(0xdb)](_0x5f50f9(0xb2)),0x1;console[_0x5f50f9(0xdb)](_0x5f50f9(0xe4));try{const _0x3b569c=TDX[_0x5f50f9(0x113)]({'site':_0x9182bc,'apiKey':_0x36ae56['apiKey']['trim'](),'logLevel':_0x1e8f64[_0x5f50f9(0xbb)]??LogLevel['ERROR']}),_0x2cfc1e=await _0x3b569c['jobs'][_0x5f50f9(0xc0)]();console[_0x5f50f9(0xdb)](a24_0x361b0f[_0x5f50f9(0x100)]('✓')+_0x5f50f9(0xae)+_0x2cfc1e['email']+')');const _0x25f85e=await isKeychainAvailable();_0x25f85e?(await saveAPIKeyAsync(_0x36ae56[_0x5f50f9(0x10d)][_0x5f50f9(0xd6)](),_0x9182bc,_0x353945),console[_0x5f50f9(0xdb)](a24_0x361b0f[_0x5f50f9(0x100)]('✓')+_0x5f50f9(0xde))):console[_0x5f50f9(0xf1)](a24_0x361b0f[_0x5f50f9(0x109)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x394764[_0x5f50f9(0xc2)]=_0x9182bc;}catch(_0x1b8eb8){if(_0x1b8eb8 instanceof HTTPClientError&&_0x1b8eb8[_0x5f50f9(0xda)]===0x191)return printAuthError(_0x1b8eb8),0x1;return console[_0x5f50f9(0xfc)](a24_0x361b0f[_0x5f50f9(0xfd)](_0x5f50f9(0xdf)+(_0x1b8eb8 instanceof Error?_0x1b8eb8[_0x5f50f9(0x110)]:String(_0x1b8eb8)))),console['error'](_0x5f50f9(0xe3)),0x1;}}else _0x394764[_0x254552]=_0x1819e5||undefined;return saveProfileToUserConfig(_0x353945,_0x394764),console[_0x5f50f9(0xdb)](a24_0x361b0f[_0x5f50f9(0x100)]('✓')+'\x20Profile\x20\x27'+_0x353945+_0x5f50f9(0xc7)+_0x254552+'='+(_0x1819e5||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{[a24_0x3cce5f(0xe1)]=a24_0x3cce5f(0xc5);[a24_0x3cce5f(0xbd)]=a24_0x3cce5f(0xb3);[a24_0x3cce5f(0xd0)](_0x637c79){const _0x3b8896=a24_0x3cce5f,{args:_0x2eebd0}=_0x637c79;if(_0x2eebd0[_0x3b8896(0xb4)]===0x0)return _0x3b8896(0xd9);return undefined;}async[a24_0x3cce5f(0xc9)](_0x40a0f5){const _0x3a3723=a24_0x3cce5f,{args:_0x167ec3,options:_0x4bd0d6}=_0x40a0f5,_0x2ca155=_0x167ec3[0x0],_0x1b505d=_0x4bd0d6[_0x3a3723(0xef)];cleanExpiredSessions();if(!profileExists(_0x2ca155)){console['error'](a24_0x361b0f[_0x3a3723(0xfd)]('Profile\x20\x27'+_0x2ca155+'\x27\x20does\x20not\x20exist.')),console[_0x3a3723(0xdb)](_0x3a3723(0xf5));const _0x1fd1b4=listProfiles();if(_0x1fd1b4[_0x3a3723(0xb4)]===0x0)console[_0x3a3723(0xdb)](_0x3a3723(0xfe));else for(const _0x404815 of _0x1fd1b4){console[_0x3a3723(0xdb)](_0x3a3723(0xdc)+_0x404815[_0x3a3723(0xe1)]);}return 0x1;}if(_0x1b505d){const _0x2ed513=a24_0x5d1f35[_0x3a3723(0xe0)](getConfigDir(),_0x3a3723(0xdd));return saveActiveProfileToUserConfig(_0x2ca155),console[_0x3a3723(0xdb)]('Default\x20profile\x20set\x20to:\x20'+a24_0x361b0f['green'](_0x2ca155)),console[_0x3a3723(0xdb)](a24_0x361b0f['dim'](_0x3a3723(0xd5)+_0x2ed513)),0x0;}const _0x5c41fd=_0x4bd0d6[_0x3a3723(0xe7)]||getCurrentSessionPID()[_0x3a3723(0xe6)]();return saveSessionContext({'profile':_0x2ca155},_0x4bd0d6[_0x3a3723(0xe7)]),console[_0x3a3723(0xdb)]('Session\x20profile\x20set\x20to:\x20'+a24_0x361b0f[_0x3a3723(0x100)](_0x2ca155)+'\x20'+a24_0x361b0f[_0x3a3723(0x10e)](_0x3a3723(0xab)+_0x5c41fd+')')),console[_0x3a3723(0xdb)](a24_0x361b0f[_0x3a3723(0x10e)](_0x3a3723(0xe9)+_0x2ca155+_0x3a3723(0xc6))),0x0;}}
@@ -1 +1 @@
1
- const a25_0x27d504=a25_0x1f37;(function(_0x2ec3a7,_0x44beec){const _0x4b450d=a25_0x1f37,_0xbd895c=_0x2ec3a7();while(!![]){try{const _0x4b0b9b=parseInt(_0x4b450d(0x1b3))/0x1+parseInt(_0x4b450d(0x1a7))/0x2+parseInt(_0x4b450d(0x1af))/0x3+parseInt(_0x4b450d(0x1b5))/0x4*(-parseInt(_0x4b450d(0x1ab))/0x5)+parseInt(_0x4b450d(0x1b4))/0x6+-parseInt(_0x4b450d(0x1b2))/0x7*(-parseInt(_0x4b450d(0x1a4))/0x8)+parseInt(_0x4b450d(0x1ae))/0x9*(-parseInt(_0x4b450d(0x1a3))/0xa);if(_0x4b0b9b===_0x44beec)break;else _0xbd895c['push'](_0xbd895c['shift']());}catch(_0x13df0e){_0xbd895c['push'](_0xbd895c['shift']());}}}(a25_0x5f2c,0x9e9d0));function a25_0x1f37(_0x4447b4,_0x196115){_0x4447b4=_0x4447b4-0x1a2;const _0x5f2cd5=a25_0x5f2c();let _0x1f3732=_0x5f2cd5[_0x4447b4];return _0x1f3732;}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a25_0x27d504(0x1aa)]='profiles';[a25_0x27d504(0x1ad)]=a25_0x27d504(0x1a2);async[a25_0x27d504(0x1a8)](_0x2596db){const _0x3b43e1=a25_0x27d504,{options:_0x3d4e31}=_0x2596db;try{const _0x7b6a54=listProfiles(),_0x50b1dc=getActiveProfile();if(_0x7b6a54[_0x3b43e1(0x1a5)]===0x0)return console[_0x3b43e1(0x1ac)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console['log'](_0x3b43e1(0x1b6)),console['log']('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x34b9b5=_0x7b6a54[_0x3b43e1(0x1b0)](_0x221643=>{const _0x18bbf1=_0x3b43e1,_0x3c52e7=_0x221643[_0x18bbf1(0x1aa)]===_0x50b1dc,_0x4cb192=getProfileParams(_0x221643[_0x18bbf1(0x1a9)]);return{'name':_0x221643[_0x18bbf1(0x1aa)],'active':_0x3c52e7,'scope':_0x221643['scope'],'description':_0x221643[_0x18bbf1(0x1a9)]['description']||'','params':_0x4cb192};});return await handleSDKOutput(_0x34b9b5,_0x3d4e31),0x0;}catch(_0x3bc0fe){return _0x3bc0fe instanceof Error&&console['error'](_0x3b43e1(0x1a6)+_0x3bc0fe[_0x3b43e1(0x1b1)]),0x1;}}}function a25_0x5f2c(){const _0x3c233e=['\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','List\x20all\x20available\x20profiles','4110afgear','7970168xsDvhu','length','Error:\x20','1622592CEoCng','execute','config','name','20jjzPGM','log','description','59481pnkRUR','378294bJesDJ','map','message','7Owesdr','711742CrDFRh','7510920zLGxLq','531248QZpkvO'];a25_0x5f2c=function(){return _0x3c233e;};return a25_0x5f2c();}
1
+ const a25_0x51ec05=a25_0x4429;function a25_0x2afb(){const _0x2c97d0=['\x20\x20Global:\x20~/.config/tdx/tdx.json','96cAuKVG','12KbbnTH','1294730BFfEAH','Error:\x20','48LTCWhB','length','6JDorsq','profiles','1121450mrENCg','map','List\x20all\x20available\x20profiles','message','263600NSdStd','log','161965TOwSyU','18VPlmFs','103532dlsGpA','name','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','884105SsyNGF','167181FFIOZl','config','description','scope'];a25_0x2afb=function(){return _0x2c97d0;};return a25_0x2afb();}(function(_0x2f2278,_0x182dce){const _0x287517=a25_0x4429,_0x599553=_0x2f2278();while(!![]){try{const _0x581066=parseInt(_0x287517(0x6f))/0x1+-parseInt(_0x287517(0x71))/0x2+parseInt(_0x287517(0x7c))/0x3*(parseInt(_0x287517(0x87))/0x4)+parseInt(_0x287517(0x75))/0x5*(parseInt(_0x287517(0x81))/0x6)+-parseInt(_0x287517(0x76))/0x7*(-parseInt(_0x287517(0x7f))/0x8)+parseInt(_0x287517(0x70))/0x9*(parseInt(_0x287517(0x7d))/0xa)+parseInt(_0x287517(0x83))/0xb*(-parseInt(_0x287517(0x7b))/0xc);if(_0x581066===_0x182dce)break;else _0x599553['push'](_0x599553['shift']());}catch(_0x4487f2){_0x599553['push'](_0x599553['shift']());}}}(a25_0x2afb,0x21830));import{BaseCommand}from'./command.js';function a25_0x4429(_0x5958f9,_0x1ba32d){_0x5958f9=_0x5958f9-0x6f;const _0x2afb4f=a25_0x2afb();let _0x442928=_0x2afb4f[_0x5958f9];return _0x442928;}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a25_0x51ec05(0x72)]=a25_0x51ec05(0x82);[a25_0x51ec05(0x78)]=a25_0x51ec05(0x85);async['execute'](_0x341b1a){const _0x38a198=a25_0x51ec05,{options:_0x16d3da}=_0x341b1a;try{const _0x221852=listProfiles(),_0x329b9e=getActiveProfile();if(_0x221852[_0x38a198(0x80)]===0x0)return console['log'](_0x38a198(0x73)),console[_0x38a198(0x88)](_0x38a198(0x74)),console['log'](_0x38a198(0x7a)),0x0;const _0x59e57a=_0x221852[_0x38a198(0x84)](_0x5c72f8=>{const _0x163a6a=_0x38a198,_0xc82d88=_0x5c72f8[_0x163a6a(0x72)]===_0x329b9e,_0x15bd82=getProfileParams(_0x5c72f8['config']);return{'name':_0x5c72f8[_0x163a6a(0x72)],'active':_0xc82d88,'scope':_0x5c72f8[_0x163a6a(0x79)],'description':_0x5c72f8[_0x163a6a(0x77)][_0x163a6a(0x78)]||'','params':_0x15bd82};});return await handleSDKOutput(_0x59e57a,_0x16d3da),0x0;}catch(_0x19ed7b){return _0x19ed7b instanceof Error&&console['error'](_0x38a198(0x7e)+_0x19ed7b[_0x38a198(0x86)]),0x1;}}}
@@ -1 +1 @@
1
- function a26_0x1fda(){const _0x2a3d56=['Executing\x20query\x20[','21168277CWPxjP','message','jobId','6089290ZmdoJc','site','verbose','catalog','output','\x0aAll\x20results\x20saved\x20to\x20','608NqNaej','12232RbKbUx','Catalog:\x20','4067jUvNqR','10RPInUL','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','...','10700096aWMWYE','3700365QLtpPu','12bdlbtE','processedRows','file','Run\x20Trino\x20queries\x20(streaming)','data','totalSplits','Executing\x20statement\x20','\x20[Job\x20ID:\x20','elapsedTimeMillis','execute','error','push','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','Error:\x20','\x20-\x20','4981536ZbIQAM','length','query','stats','Site:\x20','6cUkxKt','1041BjEwlp','validate','options','\x20rows\x20','name','join','information_schema','database','\x20splits','Statement\x20','No\x20SQL\x20provided','4nCCCEn','args'];a26_0x1fda=function(){return _0x2a3d56;};return a26_0x1fda();}const a26_0x189b56=a26_0x59b9;(function(_0x10600f,_0x2f571e){const _0x3b7857=a26_0x59b9,_0x47995d=_0x10600f();while(!![]){try{const _0x498ac6=-parseInt(_0x3b7857(0x1ef))/0x1*(-parseInt(_0x3b7857(0x206))/0x2)+-parseInt(_0x3b7857(0x20e))/0x3*(parseInt(_0x3b7857(0x1fa))/0x4)+parseInt(_0x3b7857(0x200))/0x5*(parseInt(_0x3b7857(0x1ee))/0x6)+parseInt(_0x3b7857(0x209))/0x7*(-parseInt(_0x3b7857(0x207))/0x8)+parseInt(_0x3b7857(0x1e9))/0x9*(parseInt(_0x3b7857(0x20a))/0xa)+-parseInt(_0x3b7857(0x20d))/0xb+-parseInt(_0x3b7857(0x20f))/0xc*(-parseInt(_0x3b7857(0x1fd))/0xd);if(_0x498ac6===_0x2f571e)break;else _0x47995d['push'](_0x47995d['shift']());}catch(_0x11047e){_0x47995d['push'](_0x47995d['shift']());}}}(a26_0x1fda,0x97c2f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';function a26_0x59b9(_0x1d63dd,_0x89af05){_0x1d63dd=_0x1d63dd-0x1df;const _0x1fdadf=a26_0x1fda();let _0x59b9c4=_0x1fdadf[_0x1d63dd];return _0x59b9c4;}import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a26_0x189b56(0x1f3)]=a26_0x189b56(0x1eb);['description']=a26_0x189b56(0x212);async[a26_0x189b56(0x1e3)](_0x534925){const _0x3eb782=a26_0x189b56,{options:_0x405e4c,args:_0x313f70,tdx:_0x1d0d89}=_0x534925,_0x2b46b2=_0x313f70[0x0],_0x35d0c1=_0x405e4c['file'];let _0x4c9437;try{if(_0x35d0c1)_0x4c9437=readSqlStatementsFromFile(_0x35d0c1);else{if(_0x2b46b2==='-')_0x4c9437=await readSqlStatementsFromStdin();else{if(_0x2b46b2&&isSqlFilePath(_0x2b46b2))_0x4c9437=readSqlStatementsFromFile(_0x2b46b2);else{if(_0x2b46b2)_0x4c9437=splitSqlStatements(_0x2b46b2);else throw new Error(_0x3eb782(0x1f9));}}}}catch(_0x362583){return console['error'](_0x3eb782(0x1e7)+_0x362583[_0x3eb782(0x1fe)]),0x1;}const _0x5c74d3=_0x405e4c[_0x3eb782(0x1f6)]||_0x3eb782(0x1f5),_0x59b86c=_0x405e4c[_0x3eb782(0x203)];try{const _0x5caddb=[],_0x9f64ff=!!_0x405e4c['output'];for(let _0x5b0930=0x0;_0x5b0930<_0x4c9437[_0x3eb782(0x1ea)];_0x5b0930++){const _0x4d979e=_0x4c9437[_0x5b0930],_0x399a7f=_0x5b0930+0x1,_0x5232db=_0x4c9437[_0x3eb782(0x1ea)],_0x2eabe4=_0x5232db>0x1;_0x405e4c[_0x3eb782(0x202)]&&(console['error']('\x0a'+(_0x2eabe4?_0x3eb782(0x1f8)+_0x399a7f+'/'+_0x5232db+':':'')),console[_0x3eb782(0x1e4)](_0x3eb782(0x1ed)+_0x405e4c[_0x3eb782(0x201)]),console[_0x3eb782(0x1e4)](_0x3eb782(0x208)+(_0x59b86c||'td')),console[_0x3eb782(0x1e4)]('Schema:\x20'+_0x5c74d3),console[_0x3eb782(0x1e4)]('SQL:\x20'+_0x4d979e));const _0xd58a7b=_0x2eabe4?_0x3eb782(0x1e0)+_0x399a7f+'/'+_0x5232db+_0x3eb782(0x20c):'Executing\x20query...';try{const _0x746e83=await withProgressSpinner(_0xd58a7b,async _0x5a62bc=>{const _0x5d210f=_0x3eb782,_0x38ecec=await _0x1d0d89[_0x5d210f(0x1eb)]['execute'](_0x4d979e,{'catalog':_0x59b86c,'schema':_0x5c74d3,'onJobId':_0x5526fd=>{_0x5a62bc['setJobId'](_0x5526fd);},'onProgress':_0x32a364=>{const _0x3672a8=_0x5d210f;_0x5a62bc['setPhase'](_0x3672a8(0x1fc)+_0x32a364['state']+']'),_0x5a62bc['setExtra'](formatRows(_0x32a364[_0x3672a8(0x210)])+_0x3672a8(0x1f2)+_0x32a364['completedSplits']+'/'+_0x32a364[_0x3672a8(0x1df)]+_0x3672a8(0x1f7));}});return _0x38ecec;},{'verbose':_0x405e4c[_0x3eb782(0x202)]}),_0x5d8a90=_0x746e83[_0x3eb782(0x213)],_0x1e26dc=_0x5d8a90[_0x3eb782(0x1ff)]?_0x3eb782(0x1e1)+_0x5d8a90[_0x3eb782(0x1ff)]+']':'',_0x204c14=_0x2eabe4?_0x3eb782(0x1f8)+_0x399a7f+'/'+_0x5232db+_0x3eb782(0x1e8):'';console['error']('✔\x20'+_0x204c14+'Query\x20completed:\x20Processed\x20'+formatRows(_0x5d8a90[_0x3eb782(0x1ec)][_0x3eb782(0x210)])+_0x3eb782(0x1f2)+('in\x20'+formatElapsed(_0x5d8a90[_0x3eb782(0x1ec)][_0x3eb782(0x1e2)])+_0x1e26dc));if(_0x2eabe4&&_0x9f64ff){const _0x1cfbbf=resolveOutputOptions(_0x405e4c),_0x2b16a6=await formatQueryOutput(_0x5d8a90,_0x1cfbbf);_0x5caddb[_0x3eb782(0x1e5)](_0x2b16a6);}else await handleQueryOutput(_0x5d8a90,_0x405e4c);}catch(_0x1e1108){const _0x1e7d8f=_0x2eabe4?_0x3eb782(0x1f8)+_0x399a7f+'/'+_0x5232db+':\x0a':'',_0x5dec47=_0x1e1108 instanceof SDKError?_0x1e1108['originalMessage']:_0x1e1108[_0x3eb782(0x1fe)];return console[_0x3eb782(0x1e4)](''+_0x1e7d8f+_0x5dec47),0x1;}}if(_0x4c9437[_0x3eb782(0x1ea)]>0x1&&_0x9f64ff&&_0x5caddb[_0x3eb782(0x1ea)]>0x0){const _0x48eac6=_0x5caddb[_0x3eb782(0x1f4)]('\x0a');writeFileSync(_0x405e4c[_0x3eb782(0x204)],_0x48eac6),console[_0x3eb782(0x1e4)](_0x3eb782(0x205)+_0x405e4c['output']);}return 0x0;}catch(_0x3ae9c4){throw _0x3ae9c4;}}[a26_0x189b56(0x1f0)](_0x53b6ac){const _0xcb8f36=a26_0x189b56,_0x5995fc=_0x53b6ac[_0xcb8f36(0x1fb)][0x0],_0x488080=_0x53b6ac[_0xcb8f36(0x1f1)][_0xcb8f36(0x211)];if(!_0x5995fc&&!_0x488080)return _0xcb8f36(0x1e6);if(_0x5995fc&&_0x488080)return _0xcb8f36(0x20b);return undefined;}}
1
+ const a26_0x441eef=a26_0x391d;(function(_0x2d4754,_0x28c2d2){const _0x493fe2=a26_0x391d,_0x4e5b9b=_0x2d4754();while(!![]){try{const _0x107ff4=-parseInt(_0x493fe2(0x1b4))/0x1*(parseInt(_0x493fe2(0x1ae))/0x2)+parseInt(_0x493fe2(0x1c4))/0x3*(parseInt(_0x493fe2(0x1ac))/0x4)+parseInt(_0x493fe2(0x1a2))/0x5+parseInt(_0x493fe2(0x1a8))/0x6+-parseInt(_0x493fe2(0x1cb))/0x7*(parseInt(_0x493fe2(0x1a5))/0x8)+parseInt(_0x493fe2(0x1c5))/0x9+-parseInt(_0x493fe2(0x1c7))/0xa;if(_0x107ff4===_0x28c2d2)break;else _0x4e5b9b['push'](_0x4e5b9b['shift']());}catch(_0x1a9598){_0x4e5b9b['push'](_0x4e5b9b['shift']());}}}(a26_0x20df,0xd340c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';function a26_0x20df(){const _0x214d43=['Error:\x20','...','Run\x20Trino\x20queries\x20(streaming)','\x20rows\x20','Site:\x20','3444Ehmebk','error','verbose','name','stats','join','push','site','Schema:\x20','Executing\x20query\x20[','options','SQL:\x20','message','information_schema','elapsedTimeMillis','originalMessage','9750SOlong','4836267RwEzcS','output','5308680TXeagK','validate','in\x20','execute','7rWslRb','data','setExtra','Executing\x20statement\x20','file','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','query','Statement\x20','\x20-\x20','2683770zwPJrG','length','\x20[Job\x20ID:\x20','9018776TLmuhy','processedRows','setPhase','7742532qoXYZD','jobId','state','Executing\x20query...','1480ujgOxc','\x20splits','606cTHHJt'];a26_0x20df=function(){return _0x214d43;};return a26_0x20df();}import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';function a26_0x391d(_0x4e2feb,_0x52d990){_0x4e2feb=_0x4e2feb-0x19a;const _0x20df89=a26_0x20df();let _0x391d19=_0x20df89[_0x4e2feb];return _0x391d19;}export class QueryCommand extends BaseCommand{[a26_0x441eef(0x1b7)]=a26_0x441eef(0x19f);['description']=a26_0x441eef(0x1b1);async[a26_0x441eef(0x1ca)](_0x592610){const _0x3a5098=a26_0x441eef,{options:_0x300cf0,args:_0x5c52a6,tdx:_0x100ab8}=_0x592610,_0xf8c3ad=_0x5c52a6[0x0],_0x3f22e3=_0x300cf0[_0x3a5098(0x19d)];let _0x23343e;try{if(_0x3f22e3)_0x23343e=readSqlStatementsFromFile(_0x3f22e3);else{if(_0xf8c3ad==='-')_0x23343e=await readSqlStatementsFromStdin();else{if(_0xf8c3ad&&isSqlFilePath(_0xf8c3ad))_0x23343e=readSqlStatementsFromFile(_0xf8c3ad);else{if(_0xf8c3ad)_0x23343e=splitSqlStatements(_0xf8c3ad);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x1b35e0){return console['error'](_0x3a5098(0x1af)+_0x1b35e0[_0x3a5098(0x1c0)]),0x1;}const _0x243b5c=_0x300cf0['database']||_0x3a5098(0x1c1),_0x41e89a=_0x300cf0['catalog'];try{const _0x5e2292=[],_0x49d0fb=!!_0x300cf0[_0x3a5098(0x1c6)];for(let _0x3014ac=0x0;_0x3014ac<_0x23343e[_0x3a5098(0x1a3)];_0x3014ac++){const _0x121e78=_0x23343e[_0x3014ac],_0x132724=_0x3014ac+0x1,_0x37af09=_0x23343e[_0x3a5098(0x1a3)],_0x5e1d9d=_0x37af09>0x1;_0x300cf0[_0x3a5098(0x1b6)]&&(console['error']('\x0a'+(_0x5e1d9d?_0x3a5098(0x1a0)+_0x132724+'/'+_0x37af09+':':'')),console[_0x3a5098(0x1b5)](_0x3a5098(0x1b3)+_0x300cf0[_0x3a5098(0x1bb)]),console[_0x3a5098(0x1b5)]('Catalog:\x20'+(_0x41e89a||'td')),console[_0x3a5098(0x1b5)](_0x3a5098(0x1bc)+_0x243b5c),console['error'](_0x3a5098(0x1bf)+_0x121e78));const _0x3d99c9=_0x5e1d9d?_0x3a5098(0x19c)+_0x132724+'/'+_0x37af09+_0x3a5098(0x1b0):_0x3a5098(0x1ab);try{const _0x2db9c7=await withProgressSpinner(_0x3d99c9,async _0x370e9e=>{const _0x33604e=_0x3a5098,_0x4a806b=await _0x100ab8[_0x33604e(0x19f)]['execute'](_0x121e78,{'catalog':_0x41e89a,'schema':_0x243b5c,'onJobId':_0x11106e=>{_0x370e9e['setJobId'](_0x11106e);},'onProgress':_0x2b0e3b=>{const _0x543ba8=_0x33604e;_0x370e9e[_0x543ba8(0x1a7)](_0x543ba8(0x1bd)+_0x2b0e3b[_0x543ba8(0x1aa)]+']'),_0x370e9e[_0x543ba8(0x19b)](formatRows(_0x2b0e3b[_0x543ba8(0x1a6)])+_0x543ba8(0x1b2)+_0x2b0e3b['completedSplits']+'/'+_0x2b0e3b['totalSplits']+_0x543ba8(0x1ad));}});return _0x4a806b;},{'verbose':_0x300cf0[_0x3a5098(0x1b6)]}),_0xd30bb6=_0x2db9c7[_0x3a5098(0x19a)],_0x18e3bb=_0xd30bb6[_0x3a5098(0x1a9)]?_0x3a5098(0x1a4)+_0xd30bb6[_0x3a5098(0x1a9)]+']':'',_0x3ee738=_0x5e1d9d?_0x3a5098(0x1a0)+_0x132724+'/'+_0x37af09+_0x3a5098(0x1a1):'';console['error']('✔\x20'+_0x3ee738+'Query\x20completed:\x20Processed\x20'+formatRows(_0xd30bb6[_0x3a5098(0x1b8)][_0x3a5098(0x1a6)])+_0x3a5098(0x1b2)+(_0x3a5098(0x1c9)+formatElapsed(_0xd30bb6[_0x3a5098(0x1b8)][_0x3a5098(0x1c2)])+_0x18e3bb));if(_0x5e1d9d&&_0x49d0fb){const _0x2973e1=resolveOutputOptions(_0x300cf0),_0x54c48d=await formatQueryOutput(_0xd30bb6,_0x2973e1);_0x5e2292[_0x3a5098(0x1ba)](_0x54c48d);}else await handleQueryOutput(_0xd30bb6,_0x300cf0);}catch(_0x2df3ef){const _0x435e45=_0x5e1d9d?_0x3a5098(0x1a0)+_0x132724+'/'+_0x37af09+':\x0a':'',_0x5f30b5=_0x2df3ef instanceof SDKError?_0x2df3ef[_0x3a5098(0x1c3)]:_0x2df3ef[_0x3a5098(0x1c0)];return console['error'](''+_0x435e45+_0x5f30b5),0x1;}}if(_0x23343e['length']>0x1&&_0x49d0fb&&_0x5e2292[_0x3a5098(0x1a3)]>0x0){const _0x3f634c=_0x5e2292[_0x3a5098(0x1b9)]('\x0a');writeFileSync(_0x300cf0['output'],_0x3f634c),console[_0x3a5098(0x1b5)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x300cf0[_0x3a5098(0x1c6)]);}return 0x0;}catch(_0x33cd0b){throw _0x33cd0b;}}[a26_0x441eef(0x1c8)](_0x52e45a){const _0xc143b1=a26_0x441eef,_0x139188=_0x52e45a['args'][0x0],_0x3cfa60=_0x52e45a[_0xc143b1(0x1be)][_0xc143b1(0x19d)];if(!_0x139188&&!_0x3cfa60)return _0xc143b1(0x19e);if(_0x139188&&_0x3cfa60)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
@@ -1 +1 @@
1
- const a27_0x2cbd8e=a27_0x30c6;(function(_0x38d533,_0x4be7a1){const _0x2f2666=a27_0x30c6,_0x40928a=_0x38d533();while(!![]){try{const _0x1f0566=parseInt(_0x2f2666(0x25c))/0x1+-parseInt(_0x2f2666(0x1d5))/0x2*(parseInt(_0x2f2666(0x254))/0x3)+-parseInt(_0x2f2666(0x1e6))/0x4*(-parseInt(_0x2f2666(0x1bd))/0x5)+-parseInt(_0x2f2666(0x1db))/0x6*(-parseInt(_0x2f2666(0x1c9))/0x7)+parseInt(_0x2f2666(0x216))/0x8*(-parseInt(_0x2f2666(0x1c4))/0x9)+-parseInt(_0x2f2666(0x245))/0xa*(-parseInt(_0x2f2666(0x1d4))/0xb)+-parseInt(_0x2f2666(0x1df))/0xc;if(_0x1f0566===_0x4be7a1)break;else _0x40928a['push'](_0x40928a['shift']());}catch(_0x950b68){_0x40928a['push'](_0x40928a['shift']());}}}(a27_0x518e,0xcf86c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';function a27_0x518e(){const _0x109d05=['getParent','segment:view','Fetching\x20SQL\x20for\x20segment...','parentId','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Folder\x20ID:\x20','Options:','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20Full\x20path:\x20','/e/','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','toLocaleString','Resolving\x20parent\x20segment\x20\x27','code','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Resolving\x20folder\x20\x27','parent','Examples:','folderPath','site','getSegmentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','cyan','Usage:\x20tdx\x20sg\x20show\x20<name>','limit','parentSegment','length','folder','Resolving\x20parent\x20folder\x20\x27','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','type','Site:\x20','information_schema','in\x20','resolvePathToResource','segment:folder:create','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','SEGMENT_NOT_FOUND','Show\x20child\x20segment\x20schema\x20(column\x20types)','format','folderId','Target\x20path:\x20','Creating\x20folder\x20\x27','Parent\x20ID:\x20','32KAxlRs','\x20\x20Parent\x20segment:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Use:\x20tdx\x20ps\x20view\x20-w','cause','Segment\x20ID:\x20','Fetching\x20folder\x20details...','/app/ps/','parentFolder','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20sql','url','green','getFolder','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','log','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','stats','Get\x20SQL\x20query\x20for\x20child\x20segment','query','description','✖\x20Query\x20failed\x20[','data','replace','Resolved\x20parent\x20folder\x20ID:\x20','✔\x20Created\x20folder\x20\x27','fullPath','resolveFolderId','segment','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:folder:list','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','resolveParentId','\x20folder','Usage:\x20tdx\x20sg\x20desc\x20<name>','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','execute','Use:\x20tdx\x20ps\x20show','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20Opening\x20','Resolving\x20path\x20\x27','8151730vmcPwb','Usage:\x20tdx\x20sg\x20sql\x20<name>','message','trim','SEGMENT_FOLDER_NOT_FOUND','includes','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Fetching\x20segment\x20details...','name','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','error','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Folder\x20name:\x20','177876XUXhUP','\x27...','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','jobId','✔\x20Found\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Use:\x20tdx\x20ps\x20desc','elapsedTimeMillis','777097hawHIf','segmentName','891180zAKCxn','\x20\x20Cause:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','web','\x20rows\x20','Show\x20segment\x20or\x20folder\x20details','(root)','1793628XGrmhA','Resolving\x20\x27','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','2269862aqbThO','SELECT\x20*\x20FROM\x20(\x0a','Resolved\x20folder\x20ID:\x20','getSegment','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segment:folder:show','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','segment:sql','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','11wOTVMj','34Bmijkd','Use:\x20tdx\x20ps\x20view','\x20\x20Folder\x20path:\x20','segmentId','setJobId','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','24FNVhxK','Show\x20segment\x20folder\x20details','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','22059576hOlLZg','verbose','processedRows','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','SQL\x20query:\x0a','Error:\x20Folder\x20reference\x20is\x20required','Folder\x20ID\x20missing\x20from\x20resolved\x20path','36NmpaAK','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>'];a27_0x518e=function(){return _0x109d05;};return a27_0x518e();}import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0xa1272f from'chalk';function a27_0x30c6(_0x2229fd,_0x4267d7){_0x2229fd=_0x2229fd-0x1bc;const _0x518e58=a27_0x518e();let _0x30c671=_0x518e58[_0x2229fd];return _0x30c671;}async function resolveSegmentTarget(_0x29850d,_0x363fd9,_0x32b975){const _0x44a05d=a27_0x30c6;if(isYamlFilePath(_0x29850d))try{const _0x2ed2f7=await resolveYamlFilePath(_0x29850d);return _0x32b975&&(console[_0x44a05d(0x251)]('Resolved\x20YAML\x20file:\x20'+_0x29850d),console[_0x44a05d(0x251)](_0x44a05d(0x217)+_0x2ed2f7[_0x44a05d(0x202)]),console[_0x44a05d(0x251)]('\x20\x20Segment\x20name:\x20'+_0x2ed2f7[_0x44a05d(0x1bc)]),console[_0x44a05d(0x251)](_0x44a05d(0x1d7)+(_0x2ed2f7[_0x44a05d(0x1fb)]||_0x44a05d(0x1c3))),console[_0x44a05d(0x251)](_0x44a05d(0x1f1)+_0x2ed2f7[_0x44a05d(0x233)])),_0x2ed2f7[_0x44a05d(0x233)];}catch(_0x4a8d36){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x44a05d(0x252)+_0x4a8d36[_0x44a05d(0x247)]);}if(!_0x363fd9)throw new SDKError(ErrorCode[_0x44a05d(0x1d2)],_0x44a05d(0x238));return _0x363fd9+'/'+_0x29850d;}export class SegmentDescribeCommand extends BaseCommand{['name']='segment:describe';[a27_0x2cbd8e(0x22d)]=a27_0x2cbd8e(0x1c2);async[a27_0x2cbd8e(0x23f)](_0x19486a){const _0x5c50ed=a27_0x2cbd8e,{options:_0x39b05e,args:_0x1101f5,tdx:_0x52668e}=_0x19486a,_0x4c45e0=_0x1101f5[0x0],_0xc8e702=!_0x4c45e0&&!!_0x39b05e[_0x5c50ed(0x202)],_0x34ea03=_0x4c45e0||_0x39b05e['parentSegment'];if(!_0x34ea03)return console[_0x5c50ed(0x251)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x5c50ed(0x251)](_0x5c50ed(0x1e8)),console['error'](_0x5c50ed(0x1fa)),console[_0x5c50ed(0x251)](_0x5c50ed(0x23e)),console[_0x5c50ed(0x251)](_0x5c50ed(0x1e2)),console['error'](_0x5c50ed(0x24f)),console[_0x5c50ed(0x251)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x470bd7=_0x39b05e['segmentPath'];let _0x4d3e96=_0x34ea03;!_0xc8e702&&_0x470bd7&&!_0x34ea03[_0x5c50ed(0x24a)]('/')&&(_0x4d3e96=_0x470bd7+'/'+_0x34ea03,_0x39b05e[_0x5c50ed(0x1e0)]&&console['error'](_0x5c50ed(0x1de)+_0x4d3e96));const _0x492a17=await withSpinner(_0x5c50ed(0x244)+_0x4d3e96+_0x5c50ed(0x255),()=>_0x52668e[_0x5c50ed(0x235)][_0x5c50ed(0x20c)](_0x4d3e96),{'verbose':_0x39b05e[_0x5c50ed(0x1e0)]}),_0x5a3013=_0x492a17[_0x5c50ed(0x22f)];_0x39b05e[_0x5c50ed(0x1e0)]&&(console[_0x5c50ed(0x251)](_0x5c50ed(0x24b)+_0x5a3013[_0x5c50ed(0x208)]),console['error'](_0x5c50ed(0x215)+_0x5a3013[_0x5c50ed(0x1ec)]),_0x5a3013[_0x5c50ed(0x212)]&&console[_0x5c50ed(0x251)](_0x5c50ed(0x1ee)+_0x5a3013[_0x5c50ed(0x212)]),_0x5a3013[_0x5c50ed(0x1d8)]&&console[_0x5c50ed(0x251)]('Segment\x20ID:\x20'+_0x5a3013[_0x5c50ed(0x1d8)]));if(_0x5a3013[_0x5c50ed(0x208)]==='parent'){const _0x22f73c=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x52668e[_0x5c50ed(0x235)][_0x5c50ed(0x1e9)](_0x5a3013['parentId']),{'verbose':_0x39b05e[_0x5c50ed(0x1e0)]});await handleSingleObjectOutput(_0x22f73c['data'],_0x39b05e);}else{if(_0x5a3013['type']===_0x5c50ed(0x204)){if(!_0x5a3013[_0x5c50ed(0x212)])throw new SDKError(ErrorCode[_0x5c50ed(0x249)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1d8395=await withSpinner(_0x5c50ed(0x21c),()=>_0x52668e[_0x5c50ed(0x235)]['getFolder'](_0x5a3013[_0x5c50ed(0x212)]),{'verbose':_0x39b05e[_0x5c50ed(0x1e0)]});await handleSingleObjectOutput(_0x1d8395['data'],_0x39b05e);}else{if(_0x5a3013['type']===_0x5c50ed(0x235)){if(!_0x5a3013[_0x5c50ed(0x1d8)])throw new SDKError(ErrorCode[_0x5c50ed(0x20f)],_0x5c50ed(0x1dd));const _0x2516d3=await withSpinner(_0x5c50ed(0x24d),()=>_0x52668e[_0x5c50ed(0x235)][_0x5c50ed(0x1cc)](_0x5a3013[_0x5c50ed(0x1ec)],_0x5a3013[_0x5c50ed(0x1d8)]),{'verbose':_0x39b05e[_0x5c50ed(0x1e0)]});await handleSingleObjectOutput(_0x2516d3['data'],_0x39b05e);}}}return 0x0;}catch(_0x5bcd15){if(_0x5bcd15 instanceof SDKError)return console[_0x5c50ed(0x251)](_0x5c50ed(0x1c7)+_0x5bcd15['message']),_0x5bcd15['cause']&&console[_0x5c50ed(0x251)]('\x20\x20Cause:\x20'+_0x5bcd15[_0x5c50ed(0x21a)]),0x1;throw _0x5bcd15;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x2cbd8e(0x24e)]='segment:show';[a27_0x2cbd8e(0x22d)]=a27_0x2cbd8e(0x23d);async[a27_0x2cbd8e(0x23f)](_0x13e016){const _0xd78574=a27_0x2cbd8e,{options:_0x2d9660,args:_0x59a9a2,tdx:_0x4e4f26}=_0x13e016,_0x317636=_0x59a9a2[0x0];if(!_0x317636)return console['error'](_0xd78574(0x225)),console[_0xd78574(0x251)](_0xd78574(0x200)),console['error'](_0xd78574(0x239)),console[_0xd78574(0x251)]('Examples:'),console[_0xd78574(0x251)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0xd78574(0x251)](_0xd78574(0x1d3)),0x1;try{const _0x3fb06f=_0x2d9660['parentSegment'],_0x51fa14=await resolveSegmentTarget(_0x317636,_0x3fb06f,_0x2d9660['verbose']);_0x2d9660[_0xd78574(0x1e0)]&&console[_0xd78574(0x251)](_0xd78574(0x213)+_0x51fa14);const _0x1f153a=await withSpinner(_0xd78574(0x1c5)+_0x317636+_0xd78574(0x255),()=>_0x4e4f26[_0xd78574(0x235)][_0xd78574(0x20c)](_0x51fa14),{'verbose':_0x2d9660[_0xd78574(0x1e0)]}),_0x22ed69=_0x1f153a['data'];_0x2d9660['verbose']&&(console[_0xd78574(0x251)]('Resolved\x20type:\x20'+_0x22ed69[_0xd78574(0x208)]),console[_0xd78574(0x251)](_0xd78574(0x215)+_0x22ed69[_0xd78574(0x1ec)]));if(_0x22ed69['type']===_0xd78574(0x204))return console[_0xd78574(0x251)](_0xd78574(0x1da)),console[_0xd78574(0x251)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x22ed69[_0xd78574(0x208)]===_0xd78574(0x1f9))return console[_0xd78574(0x251)](_0xd78574(0x1cf)),console['error'](_0xd78574(0x240)),0x1;if(!_0x22ed69['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xd78574(0x1dd));const _0x2dad67=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x4e4f26[_0xd78574(0x235)][_0xd78574(0x1fd)](_0x22ed69[_0xd78574(0x1ec)],_0x22ed69[_0xd78574(0x1d8)]),{'verbose':_0x2d9660[_0xd78574(0x1e0)]});let _0x2d9d7f=_0x2dad67['data'];const _0x4748a3=resolveLimit(_0x2d9660[_0xd78574(0x201)],DEFAULT_DISPLAY_LIMIT),_0x567e8f=/\bLIMIT\s+\d+/i['test'](_0x2d9d7f);!_0x567e8f&&(_0x2d9d7f=_0x2d9d7f[_0xd78574(0x248)]()[_0xd78574(0x230)](/;+$/,''),_0x2d9d7f=_0xd78574(0x1ca)+_0x2d9d7f+_0xd78574(0x218)+_0x4748a3);_0x2d9660[_0xd78574(0x1e0)]&&console[_0xd78574(0x251)](_0xd78574(0x1e3)+_0x2d9d7f);const _0x1186a0=await withProgressSpinner('Executing\x20segment\x20query...',async _0x681e7f=>{const _0x1dc083=_0xd78574,_0x53d8e9=await _0x4e4f26[_0x1dc083(0x22c)][_0x1dc083(0x23f)](_0x2d9d7f,{'catalog':'td','schema':_0x1dc083(0x20a),'onJobId':_0x168d2d=>{const _0x27d291=_0x1dc083;_0x681e7f[_0x27d291(0x1d9)](_0x168d2d);}});return _0x53d8e9;},{'verbose':_0x2d9660[_0xd78574(0x1e0)]}),_0x4611f9=_0x1186a0['data'],_0xcf2b53=_0x4611f9[_0xd78574(0x257)]?_0xd78574(0x1e7)+_0x4611f9[_0xd78574(0x257)]+']':'';return console[_0xd78574(0x251)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x4611f9[_0xd78574(0x22a)][_0xd78574(0x1e1)][_0xd78574(0x1f4)]()+_0xd78574(0x1c1)+(_0xd78574(0x20b)+formatElapsed(_0x4611f9['stats'][_0xd78574(0x25b)])+_0xcf2b53)),await handleQueryOutput(_0x4611f9,_0x2d9660),0x0;}catch(_0x1adaea){if(_0x1adaea instanceof SDKError)return console['error'](_0xd78574(0x22e)+_0x1adaea[_0xd78574(0x1f6)]+']'),console[_0xd78574(0x251)]('\x0a'+_0x1adaea['message']),0x1;throw _0x1adaea;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x2cbd8e(0x24e)]=a27_0x2cbd8e(0x237);[a27_0x2cbd8e(0x22d)]=a27_0x2cbd8e(0x1bf);async[a27_0x2cbd8e(0x23f)](_0x3bacbb){const _0x77cfd6=a27_0x2cbd8e,{options:_0x2db9ab,args:_0x2728c0,tdx:_0x458e63}=_0x3bacbb;if(_0x2728c0['length']===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x77cfd6(0x251)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x5c5c35=_0x2728c0[0x0];try{_0x2db9ab['verbose']&&(console['error'](_0x77cfd6(0x209)+_0x2db9ab[_0x77cfd6(0x1fc)]),console[_0x77cfd6(0x251)]('Parent\x20name:\x20'+_0x5c5c35));const _0x30af15=await withSpinner(_0x77cfd6(0x1f5)+_0x5c5c35+'\x27...',()=>_0x458e63['segment'][_0x77cfd6(0x23a)](_0x5c5c35),{'verbose':_0x2db9ab[_0x77cfd6(0x1e0)]}),_0x1f2bb1=_0x30af15[_0x77cfd6(0x22f)];_0x2db9ab['verbose']&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x1f2bb1);const _0x509307=await withSpinner(_0x77cfd6(0x1f0)+_0x5c5c35+'\x27...',()=>_0x458e63['segment']['listFolders'](_0x1f2bb1),{'verbose':_0x2db9ab[_0x77cfd6(0x1e0)]}),_0x5d4559=_0x509307['data'];return console['error'](_0x77cfd6(0x258)+_0x5d4559['length']+_0x77cfd6(0x23b)+(_0x5d4559['length']!==0x1?'s':'')),await handleSDKOutput(_0x5d4559,_0x2db9ab),0x0;}catch(_0x511c22){if(_0x511c22 instanceof SDKError)return console['error'](_0x77cfd6(0x1c7)+_0x511c22[_0x77cfd6(0x247)]),_0x511c22[_0x77cfd6(0x21a)]&&console[_0x77cfd6(0x251)](_0x77cfd6(0x1be)+_0x511c22['cause']),0x1;throw _0x511c22;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a27_0x2cbd8e(0x1ce);['description']=a27_0x2cbd8e(0x1dc);async['execute'](_0x3ecf97){const _0x37e18e=a27_0x2cbd8e,{options:_0x3cd6a2,args:_0x117e19,tdx:_0x2b9320}=_0x3ecf97;if(_0x117e19[_0x37e18e(0x203)]===0x0)return console[_0x37e18e(0x251)](_0x37e18e(0x1e4)),console[_0x37e18e(0x251)](_0x37e18e(0x1cd)),0x1;try{const {parentId:_0x14b60c,childId:_0x3a4169}=parseSegmentRef(_0x117e19[0x0]);_0x3cd6a2[_0x37e18e(0x1e0)]&&(console[_0x37e18e(0x251)](_0x37e18e(0x209)+_0x3cd6a2[_0x37e18e(0x1fc)]),console[_0x37e18e(0x251)]('Parent\x20name:\x20'+_0x14b60c),_0x3a4169&&console[_0x37e18e(0x251)](_0x37e18e(0x253)+_0x3a4169));if(!_0x3a4169)return console[_0x37e18e(0x251)](_0x37e18e(0x259)),0x1;const _0x3f54c4=await withSpinner(_0x37e18e(0x1f5)+_0x14b60c+_0x37e18e(0x255),()=>_0x2b9320['segment'][_0x37e18e(0x23a)](_0x14b60c),{'verbose':_0x3cd6a2[_0x37e18e(0x1e0)]}),_0x385f16=_0x3f54c4[_0x37e18e(0x22f)];_0x3cd6a2['verbose']&&console[_0x37e18e(0x251)]('Resolved\x20parent\x20ID:\x20'+_0x385f16);const _0x3ce489=await withSpinner(_0x37e18e(0x1f8)+_0x3a4169+_0x37e18e(0x255),()=>_0x2b9320[_0x37e18e(0x235)]['resolveFolderId'](_0x385f16,_0x3a4169),{'verbose':_0x3cd6a2[_0x37e18e(0x1e0)]}),_0x5cf521=_0x3ce489[_0x37e18e(0x22f)];_0x3cd6a2[_0x37e18e(0x1e0)]&&console[_0x37e18e(0x251)](_0x37e18e(0x1cb)+_0x5cf521);const _0x23779d=await withSpinner('Fetching\x20folder\x20\x27'+_0x3a4169+_0x37e18e(0x255),()=>_0x2b9320[_0x37e18e(0x235)][_0x37e18e(0x224)](_0x5cf521),{'verbose':_0x3cd6a2[_0x37e18e(0x1e0)]});return await handleSDKOutput([_0x23779d[_0x37e18e(0x22f)]],_0x3cd6a2),0x0;}catch(_0x1003cb){if(_0x1003cb instanceof SDKError)return console['error'](_0x37e18e(0x1c7)+_0x1003cb[_0x37e18e(0x247)]),_0x1003cb[_0x37e18e(0x21a)]&&console[_0x37e18e(0x251)]('\x20\x20Cause:\x20'+_0x1003cb[_0x37e18e(0x21a)]),0x1;throw _0x1003cb;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x2cbd8e(0x24e)]=a27_0x2cbd8e(0x1d1);['description']=a27_0x2cbd8e(0x22b);async[a27_0x2cbd8e(0x23f)](_0x425a9f){const _0x54daa4=a27_0x2cbd8e,{options:_0x1b67ef,args:_0xafbf6,tdx:_0x511644}=_0x425a9f,_0x528615=_0xafbf6[0x0];if(!_0x528615)return console[_0x54daa4(0x251)](_0x54daa4(0x225)),console[_0x54daa4(0x251)](_0x54daa4(0x246)),console[_0x54daa4(0x251)](_0x54daa4(0x250)),console[_0x54daa4(0x251)]('Examples:'),console['error'](_0x54daa4(0x226)),console[_0x54daa4(0x251)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x527da1=_0x1b67ef[_0x54daa4(0x202)],_0x2a1f00=await resolveSegmentTarget(_0x528615,_0x527da1,_0x1b67ef[_0x54daa4(0x1e0)]);_0x1b67ef[_0x54daa4(0x1e0)]&&console[_0x54daa4(0x251)](_0x54daa4(0x213)+_0x2a1f00);const _0x3ac45d=await withSpinner('Resolving\x20\x27'+_0x528615+_0x54daa4(0x255),()=>_0x511644[_0x54daa4(0x235)]['resolvePathToResource'](_0x2a1f00),{'verbose':_0x1b67ef[_0x54daa4(0x1e0)]}),_0x3b2188=_0x3ac45d[_0x54daa4(0x22f)];_0x1b67ef[_0x54daa4(0x1e0)]&&(console[_0x54daa4(0x251)](_0x54daa4(0x24b)+_0x3b2188[_0x54daa4(0x208)]),console[_0x54daa4(0x251)](_0x54daa4(0x215)+_0x3b2188[_0x54daa4(0x1ec)]));if(_0x3b2188[_0x54daa4(0x208)]==='folder')return console[_0x54daa4(0x251)](_0x54daa4(0x1f3)),console[_0x54daa4(0x251)](_0x54daa4(0x1ed)),0x1;if(_0x3b2188[_0x54daa4(0x208)]===_0x54daa4(0x1f9))return console[_0x54daa4(0x251)](_0x54daa4(0x236)),console['error'](_0x54daa4(0x221)),0x1;if(!_0x3b2188['segmentId'])throw new SDKError(ErrorCode[_0x54daa4(0x20f)],_0x54daa4(0x1dd));const _0x395203=await withSpinner(_0x54daa4(0x1eb),()=>_0x511644['segment'][_0x54daa4(0x1fd)](_0x3b2188[_0x54daa4(0x1ec)],_0x3b2188[_0x54daa4(0x1d8)]),{'verbose':_0x1b67ef[_0x54daa4(0x1e0)]}),_0x2b047e=_0x395203[_0x54daa4(0x22f)];return _0x1b67ef[_0x54daa4(0x211)]==='json'||_0x1b67ef[_0x54daa4(0x211)]==='jsonl'?await handleSDKOutput([{'sql':_0x2b047e}],_0x1b67ef):console[_0x54daa4(0x228)](_0x2b047e),0x0;}catch(_0x4551f7){if(_0x4551f7 instanceof SDKError)return console[_0x54daa4(0x251)]('Error:\x20'+_0x4551f7['message']),_0x4551f7[_0x54daa4(0x21a)]&&console[_0x54daa4(0x251)](_0x54daa4(0x1be)+_0x4551f7[_0x54daa4(0x21a)]),0x1;throw _0x4551f7;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x2cbd8e(0x24e)]=a27_0x2cbd8e(0x20d);[a27_0x2cbd8e(0x22d)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x599ae0){const _0x6b9cdb=a27_0x2cbd8e,{options:_0x4d8574,args:_0x83bdd9,tdx:_0x25e165}=_0x599ae0,_0x24634a=_0x4d8574;if(_0x83bdd9['length']<0x2)return console[_0x6b9cdb(0x251)](_0x6b9cdb(0x207)),console[_0x6b9cdb(0x251)](_0x6b9cdb(0x20e)),0x1;const _0x1771dc=_0x83bdd9[0x0],_0x401e58=_0x83bdd9[0x1];_0x24634a[_0x6b9cdb(0x1e0)]&&(console[_0x6b9cdb(0x251)](_0x6b9cdb(0x209)+_0x24634a[_0x6b9cdb(0x1fc)]),console[_0x6b9cdb(0x251)]('Parent\x20segment:\x20'+_0x1771dc),console[_0x6b9cdb(0x251)](_0x6b9cdb(0x253)+_0x401e58));let _0x36aeca;if(_0x24634a[_0x6b9cdb(0x21e)]){const _0x3a4000=_0x24634a[_0x6b9cdb(0x21e)],_0x2dbba3=await withSpinner(_0x6b9cdb(0x1f5)+_0x1771dc+'\x27...',()=>_0x25e165['segment'][_0x6b9cdb(0x23a)](_0x1771dc),{'verbose':_0x24634a[_0x6b9cdb(0x1e0)]}),_0x146e65=_0x2dbba3['data'],_0x221021=await withSpinner(_0x6b9cdb(0x205)+_0x3a4000+'\x27...',()=>_0x25e165[_0x6b9cdb(0x235)][_0x6b9cdb(0x234)](_0x146e65,_0x3a4000),{'verbose':_0x24634a[_0x6b9cdb(0x1e0)]});_0x36aeca=_0x221021[_0x6b9cdb(0x22f)],_0x24634a[_0x6b9cdb(0x1e0)]&&console[_0x6b9cdb(0x251)](_0x6b9cdb(0x231)+_0x36aeca);}const _0x32a16a={'name':_0x401e58,'description':_0x24634a['description'],'parentFolderId':_0x36aeca},_0x2e18a9=await withSpinner(_0x6b9cdb(0x214)+_0x401e58+_0x6b9cdb(0x255),()=>_0x25e165[_0x6b9cdb(0x235)]['createFolder'](_0x1771dc,_0x32a16a),{'verbose':_0x24634a[_0x6b9cdb(0x1e0)]}),_0x2df6c5=_0x2e18a9['data'];return console[_0x6b9cdb(0x251)](_0x6b9cdb(0x232)+_0x2df6c5[_0x6b9cdb(0x24e)]+_0x6b9cdb(0x21f)+_0x2df6c5['id']),await handleSDKOutput([_0x2df6c5],_0x24634a),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x2cbd8e(0x24e)]=a27_0x2cbd8e(0x1ea);[a27_0x2cbd8e(0x22d)]='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x5c5575){const _0x894c78=a27_0x2cbd8e,{options:_0x47441b,args:_0x1d5368,tdx:_0x29950}=_0x5c5575,_0xc253d3=_0x1d5368[0x0];if(!_0xc253d3)return console['error'](_0x894c78(0x256)),console[_0x894c78(0x251)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x894c78(0x251)](_0x894c78(0x1fe)),console[_0x894c78(0x251)](_0x894c78(0x1ef)),console[_0x894c78(0x251)](_0x894c78(0x1f7)),console[_0x894c78(0x251)](_0x894c78(0x1fa)),console['error'](_0x894c78(0x24c)),console[_0x894c78(0x251)](_0x894c78(0x1c6)),console['error'](_0x894c78(0x227)),console[_0x894c78(0x251)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x20cfd3=_0x47441b['parentSegment'],_0x501375=await resolveSegmentTarget(_0xc253d3,_0x20cfd3,_0x47441b[_0x894c78(0x1e0)]);_0x47441b[_0x894c78(0x1e0)]&&console[_0x894c78(0x251)](_0x894c78(0x213)+_0x501375);const _0x351de2=await withSpinner(_0x894c78(0x1c5)+_0xc253d3+_0x894c78(0x255),()=>_0x29950['segment'][_0x894c78(0x20c)](_0x501375),{'verbose':_0x47441b[_0x894c78(0x1e0)]}),_0x5ce147=_0x351de2[_0x894c78(0x22f)];_0x47441b[_0x894c78(0x1e0)]&&(console['error']('Resolved\x20type:\x20'+_0x5ce147[_0x894c78(0x208)]),console[_0x894c78(0x251)](_0x894c78(0x215)+_0x5ce147[_0x894c78(0x1ec)]),_0x5ce147['folderId']&&console[_0x894c78(0x251)]('Folder\x20ID:\x20'+_0x5ce147[_0x894c78(0x212)]),_0x5ce147[_0x894c78(0x1d8)]&&console[_0x894c78(0x251)](_0x894c78(0x21b)+_0x5ce147['segmentId']));if(_0x47441b[_0x894c78(0x1c0)]){if(_0x5ce147['type']===_0x894c78(0x204))return console[_0x894c78(0x251)](_0x894c78(0x241)),0x1;if(_0x5ce147[_0x894c78(0x208)]===_0x894c78(0x1f9))return console[_0x894c78(0x251)](_0x894c78(0x220)),console[_0x894c78(0x251)](_0x894c78(0x219)),0x1;if(!_0x5ce147[_0x894c78(0x1d8)])throw new SDKError(ErrorCode[_0x894c78(0x20f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3b9c16=getConsoleNextUrl(_0x47441b[_0x894c78(0x1fc)],'/app/ps/'+_0x5ce147[_0x894c78(0x1ec)]+'/e/'+_0x5ce147[_0x894c78(0x1d8)]);return console['error'](a27_0xa1272f[_0x894c78(0x223)]('✔')+_0x894c78(0x243)+a27_0xa1272f[_0x894c78(0x1ff)](_0x3b9c16)),openBrowser(_0x3b9c16),0x0;}if(_0x5ce147[_0x894c78(0x208)]===_0x894c78(0x204)){if(!_0x5ce147[_0x894c78(0x212)])throw new SDKError(ErrorCode[_0x894c78(0x249)],_0x894c78(0x1e5));const _0x5dc572=await withSpinner(_0x894c78(0x21c),()=>_0x29950[_0x894c78(0x235)][_0x894c78(0x224)](_0x5ce147[_0x894c78(0x212)]),{'verbose':_0x47441b[_0x894c78(0x1e0)]});await handleSingleObjectOutput(_0x5dc572[_0x894c78(0x22f)],_0x47441b);}else{if(_0x5ce147['type']==='segment'){if(!_0x5ce147[_0x894c78(0x1d8)])throw new SDKError(ErrorCode[_0x894c78(0x20f)],_0x894c78(0x1dd));const _0x5f1e40=await withSpinner(_0x894c78(0x24d),()=>_0x29950[_0x894c78(0x235)][_0x894c78(0x1cc)](_0x5ce147[_0x894c78(0x1ec)],_0x5ce147[_0x894c78(0x1d8)]),{'verbose':_0x47441b[_0x894c78(0x1e0)]}),_0xa83bb3=getConsoleNextUrl(_0x47441b['site'],_0x894c78(0x21d)+_0x5ce147[_0x894c78(0x1ec)]+_0x894c78(0x1f2)+_0x5ce147[_0x894c78(0x1d8)]),_0x28a584=_0x5f1e40[_0x894c78(0x22f)];_0x28a584[_0x894c78(0x222)]=_0xa83bb3,await handleSingleObjectOutput(_0x28a584,_0x47441b);}else return console[_0x894c78(0x251)](_0x894c78(0x206)),console['error'](_0x894c78(0x1d6)),0x1;}return 0x0;}catch(_0x1fe771){if(_0x1fe771 instanceof SDKError)return console[_0x894c78(0x251)](_0x894c78(0x1c7)+_0x1fe771[_0x894c78(0x247)]),_0x1fe771[_0x894c78(0x21a)]&&console[_0x894c78(0x251)]('\x20\x20Cause:\x20'+_0x1fe771[_0x894c78(0x21a)]),0x1;throw _0x1fe771;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x2cbd8e(0x24e)]='segment:desc';[a27_0x2cbd8e(0x22d)]=a27_0x2cbd8e(0x210);async[a27_0x2cbd8e(0x23f)](_0x5d032c){const _0x544a14=a27_0x2cbd8e,{options:_0x454992,args:_0x3d3a1c,tdx:_0x58091c}=_0x5d032c,_0x2c0f2a=_0x3d3a1c[0x0];if(!_0x2c0f2a)return console[_0x544a14(0x251)](_0x544a14(0x225)),console[_0x544a14(0x251)](_0x544a14(0x23c)),console[_0x544a14(0x251)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x544a14(0x251)]('Examples:'),console[_0x544a14(0x251)](_0x544a14(0x229)),console[_0x544a14(0x251)](_0x544a14(0x1d0)),0x1;try{const _0x596ed6=_0x454992[_0x544a14(0x202)],_0x25af62=await resolveSegmentTarget(_0x2c0f2a,_0x596ed6,_0x454992[_0x544a14(0x1e0)]);_0x454992['verbose']&&console['error'](_0x544a14(0x213)+_0x25af62);const _0x2b8d43=await withSpinner(_0x544a14(0x1c5)+_0x2c0f2a+_0x544a14(0x255),()=>_0x58091c['segment'][_0x544a14(0x20c)](_0x25af62),{'verbose':_0x454992[_0x544a14(0x1e0)]}),_0x181bd8=_0x2b8d43[_0x544a14(0x22f)];_0x454992[_0x544a14(0x1e0)]&&(console['error']('Resolved\x20type:\x20'+_0x181bd8['type']),console[_0x544a14(0x251)](_0x544a14(0x215)+_0x181bd8[_0x544a14(0x1ec)]));if(_0x181bd8[_0x544a14(0x208)]===_0x544a14(0x204))return console[_0x544a14(0x251)](_0x544a14(0x1c8)),console[_0x544a14(0x251)](_0x544a14(0x1ed)),0x1;if(_0x181bd8['type']===_0x544a14(0x1f9))return console[_0x544a14(0x251)](_0x544a14(0x242)),console[_0x544a14(0x251)](_0x544a14(0x25a)),0x1;if(!_0x181bd8['segmentId'])throw new SDKError(ErrorCode[_0x544a14(0x20f)],_0x544a14(0x1dd));const _0x5d1e8b=await withSpinner(_0x544a14(0x1eb),()=>_0x58091c[_0x544a14(0x235)][_0x544a14(0x1fd)](_0x181bd8[_0x544a14(0x1ec)],_0x181bd8['segmentId']),{'verbose':_0x454992[_0x544a14(0x1e0)]}),_0x36fefa=_0x5d1e8b[_0x544a14(0x22f)],_0x2cbd4a=await executeSchemaQuery(_0x36fefa,_0x58091c,_0x454992);return await handleQueryOutput(_0x2cbd4a,_0x454992),0x0;}catch(_0xa55ece){if(_0xa55ece instanceof SDKError)return console[_0x544a14(0x251)]('Error:\x20'+_0xa55ece['message']),_0xa55ece['cause']&&console[_0x544a14(0x251)](_0x544a14(0x1be)+_0xa55ece['cause']),0x1;throw _0xa55ece;}}}
1
+ function a27_0x17f9(){const _0x182f9f=['Parent\x20ID:\x20','INVALID_ARGUMENT','Site:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','segment:show','4430JgdZjl','Use:\x20tdx\x20ps\x20desc','Use:\x20tdx\x20ps\x20view\x20-w','stats','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','verbose','5593798NXDzQP','\x20rows\x20','\x20\x20Cause:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolved\x20parent\x20folder\x20ID:\x20','8grUUtV','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','folderId','Resolving\x20\x27','folder','Show\x20segment\x20folder\x20details','jsonl','error','message','folderPath','Resolved\x20parent\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Show\x20child\x20segment\x20schema\x20(column\x20types)','green','cause','getParent','Folder\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','Error:\x20Path\x20or\x20name\x20is\x20required','segment:desc','parentSegment','Usage:\x20tdx\x20sg\x20sql\x20<name>','Listing\x20folders\x20for\x20parent\x20\x27','code','Executing\x20segment\x20query...','Resolving\x20path\x20\x27','getSegmentSQL','format','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','/e/','1592252EqAQPV','/app/ps/','type','Resolving\x20folder\x20\x27','Use:\x20tdx\x20ps\x20show','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','✔\x20Found\x20','Fetching\x20folder\x20\x27','getSegment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolving\x20parent\x20segment\x20\x27','url','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Resolved\x20folder\x20ID:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','segment:folder:create','Segment\x20ID:\x20','8332308zsKTBy','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_NOT_FOUND','\x20\x20Segment\x20name:\x20','length','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20Folder\x20path:\x20','information_schema','json','5674EkTbBx','✖\x20Query\x20failed\x20[','Usage:\x20tdx\x20segment\x20describe\x20<path>','toLocaleString','SEGMENT_FOLDER_NOT_FOUND','1661iilNQB','name','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Fetching\x20segment\x20details...','Usage:\x20tdx\x20sg\x20show\x20<name>','SELECT\x20*\x20FROM\x20(\x0a','segment:sql','createFolder','Folder\x20name:\x20','log','setJobId','\x27\x20with\x20ID:\x20','parentFolder','SQL\x20query:\x0a','Get\x20SQL\x20query\x20for\x20child\x20segment','resolveFolderId','resolvePathToResource','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x27...','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','591583lIWgTV','in\x20','cyan','Error:\x20Parent\x20segment\x20name\x20is\x20required','318wnuypz','10MwdlxL','(root)','7786143GdQtSY','Parent\x20segment:\x20','web','test','segment:folder:list','segment','Options:','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Target\x20path:\x20','fullPath','resolveParentId','includes','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','✔\x20Created\x20folder\x20\x27','Fetching\x20SQL\x20for\x20segment...','parentId','site','\x20\x20Parent\x20segment:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20name:\x20','Error:\x20Folder\x20reference\x20is\x20required','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Examples:','parent','processedRows','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Create\x20segment\x20folder\x20for\x20organization','jobId','\x20[Job\x20ID:\x20','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','listFolders','getFolder','Resolved\x20YAML\x20file:\x20','data','6CmcSNp','segmentName','description','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','segmentId','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20Opening\x20'];a27_0x17f9=function(){return _0x182f9f;};return a27_0x17f9();}const a27_0x3a25bb=a27_0x5181;(function(_0x4f0049,_0x504897){const _0x494863=a27_0x5181,_0x48c2cb=_0x4f0049();while(!![]){try{const _0x2a2a15=-parseInt(_0x494863(0xa9))/0x1+-parseInt(_0x494863(0x12d))/0x2*(parseInt(_0x494863(0xad))/0x3)+-parseInt(_0x494863(0x111))/0x4*(-parseInt(_0x494863(0xae))/0x5)+-parseInt(_0x494863(0xd7))/0x6*(-parseInt(_0x494863(0xec))/0x7)+parseInt(_0x494863(0xf3))/0x8*(parseInt(_0x494863(0xb0))/0x9)+-parseInt(_0x494863(0xe6))/0xa*(-parseInt(_0x494863(0x132))/0xb)+-parseInt(_0x494863(0x124))/0xc;if(_0x2a2a15===_0x504897)break;else _0x48c2cb['push'](_0x48c2cb['shift']());}catch(_0x3b8b71){_0x48c2cb['push'](_0x48c2cb['shift']());}}}(a27_0x17f9,0xe5a34));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x44cc2a from'chalk';async function resolveSegmentTarget(_0xd5037d,_0x5268f9,_0x54c9cf){const _0xccfbb0=a27_0x5181;if(isYamlFilePath(_0xd5037d))try{const _0x3ea59f=await resolveYamlFilePath(_0xd5037d);return _0x54c9cf&&(console[_0xccfbb0(0xfa)](_0xccfbb0(0xd5)+_0xd5037d),console[_0xccfbb0(0xfa)](_0xccfbb0(0xc1)+_0x3ea59f[_0xccfbb0(0x107)]),console[_0xccfbb0(0xfa)](_0xccfbb0(0x127)+_0x3ea59f[_0xccfbb0(0xd8)]),console['error'](_0xccfbb0(0x12a)+(_0x3ea59f[_0xccfbb0(0xfc)]||_0xccfbb0(0xaf))),console[_0xccfbb0(0xfa)]('\x20\x20Full\x20path:\x20'+_0x3ea59f[_0xccfbb0(0xb9)])),_0x3ea59f[_0xccfbb0(0xb9)];}catch(_0x523e22){throw new SDKError(ErrorCode[_0xccfbb0(0xe1)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x523e22[_0xccfbb0(0xfb)]);}if(!_0x5268f9)throw new SDKError(ErrorCode[_0xccfbb0(0xe1)],_0xccfbb0(0xe3));return _0x5268f9+'/'+_0xd5037d;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x3a25bb(0x133)]='segment:describe';[a27_0x3a25bb(0xd9)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x3a25bb(0x137)](_0x3dc7e6){const _0x49b0dd=a27_0x3a25bb,{options:_0x5a10fa,args:_0x386903,tdx:_0x4be2f8}=_0x3dc7e6,_0x528b35=_0x386903[0x0],_0x55d0f6=!_0x528b35&&!!_0x5a10fa[_0x49b0dd(0x107)],_0xad312c=_0x528b35||_0x5a10fa[_0x49b0dd(0x107)];if(!_0xad312c)return console[_0x49b0dd(0xfa)](_0x49b0dd(0x105)),console[_0x49b0dd(0xfa)](_0x49b0dd(0x12f)),console[_0x49b0dd(0xfa)](_0x49b0dd(0xc9)),console[_0x49b0dd(0xfa)](_0x49b0dd(0xa5)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x49b0dd(0xfa)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x49b0dd(0xfa)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x18b4e2=_0x5a10fa['segmentPath'];let _0x4781ff=_0xad312c;!_0x55d0f6&&_0x18b4e2&&!_0xad312c[_0x49b0dd(0xbb)]('/')&&(_0x4781ff=_0x18b4e2+'/'+_0xad312c,_0x5a10fa[_0x49b0dd(0xeb)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x4781ff));const _0x5f4fc5=await withSpinner(_0x49b0dd(0x10c)+_0x4781ff+_0x49b0dd(0xa7),()=>_0x4be2f8['segment']['resolvePathToResource'](_0x4781ff),{'verbose':_0x5a10fa[_0x49b0dd(0xeb)]}),_0x2050f4=_0x5f4fc5['data'];_0x5a10fa['verbose']&&(console[_0x49b0dd(0xfa)]('Resolved\x20type:\x20'+_0x2050f4['type']),console['error']('Parent\x20ID:\x20'+_0x2050f4[_0x49b0dd(0xbf)]),_0x2050f4[_0x49b0dd(0xf5)]&&console['error'](_0x49b0dd(0x103)+_0x2050f4[_0x49b0dd(0xf5)]),_0x2050f4[_0x49b0dd(0xdd)]&&console[_0x49b0dd(0xfa)]('Segment\x20ID:\x20'+_0x2050f4[_0x49b0dd(0xdd)]));if(_0x2050f4[_0x49b0dd(0x113)]===_0x49b0dd(0xca)){const _0x6f3cac=await withSpinner(_0x49b0dd(0x104),()=>_0x4be2f8[_0x49b0dd(0xb5)][_0x49b0dd(0x102)](_0x2050f4['parentId']),{'verbose':_0x5a10fa[_0x49b0dd(0xeb)]});await handleSingleObjectOutput(_0x6f3cac[_0x49b0dd(0xd6)],_0x5a10fa);}else{if(_0x2050f4[_0x49b0dd(0x113)]===_0x49b0dd(0xf7)){if(!_0x2050f4['folderId'])throw new SDKError(ErrorCode[_0x49b0dd(0x131)],_0x49b0dd(0xef));const _0x25049b=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4be2f8[_0x49b0dd(0xb5)][_0x49b0dd(0xd4)](_0x2050f4[_0x49b0dd(0xf5)]),{'verbose':_0x5a10fa[_0x49b0dd(0xeb)]});await handleSingleObjectOutput(_0x25049b[_0x49b0dd(0xd6)],_0x5a10fa);}else{if(_0x2050f4[_0x49b0dd(0x113)]===_0x49b0dd(0xb5)){if(!_0x2050f4['segmentId'])throw new SDKError(ErrorCode[_0x49b0dd(0x126)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x48bff2=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4be2f8['segment'][_0x49b0dd(0x119)](_0x2050f4[_0x49b0dd(0xbf)],_0x2050f4[_0x49b0dd(0xdd)]),{'verbose':_0x5a10fa['verbose']});await handleSingleObjectOutput(_0x48bff2[_0x49b0dd(0xd6)],_0x5a10fa);}}}return 0x0;}catch(_0x252ddc){if(_0x252ddc instanceof SDKError)return console[_0x49b0dd(0xfa)](_0x49b0dd(0xdb)+_0x252ddc[_0x49b0dd(0xfb)]),_0x252ddc[_0x49b0dd(0x101)]&&console['error'](_0x49b0dd(0xee)+_0x252ddc[_0x49b0dd(0x101)]),0x1;throw _0x252ddc;}}}function a27_0x5181(_0x4bf813,_0x8088b5){_0x4bf813=_0x4bf813-0x9f;const _0x17f9a0=a27_0x17f9();let _0x518111=_0x17f9a0[_0x4bf813];return _0x518111;}export class SegmentShowCommand extends BaseCommand{[a27_0x3a25bb(0x133)]=a27_0x3a25bb(0xe5);['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x3a25bb(0x137)](_0x357077){const _0x4ef923=a27_0x3a25bb,{options:_0x35a1c1,args:_0x2281b9,tdx:_0x2cc718}=_0x357077,_0x141488=_0x2281b9[0x0];if(!_0x141488)return console[_0x4ef923(0xfa)](_0x4ef923(0x11e)),console[_0x4ef923(0xfa)](_0x4ef923(0x13a)),console[_0x4ef923(0xfa)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x4ef923(0xfa)](_0x4ef923(0xc9)),console[_0x4ef923(0xfa)](_0x4ef923(0x125)),console[_0x4ef923(0xfa)](_0x4ef923(0xf1)),0x1;try{const _0x2bc10f=_0x35a1c1[_0x4ef923(0x107)],_0x1f0142=await resolveSegmentTarget(_0x141488,_0x2bc10f,_0x35a1c1[_0x4ef923(0xeb)]);_0x35a1c1[_0x4ef923(0xeb)]&&console[_0x4ef923(0xfa)](_0x4ef923(0xb8)+_0x1f0142);const _0x4e3ab0=await withSpinner('Resolving\x20\x27'+_0x141488+_0x4ef923(0xa7),()=>_0x2cc718[_0x4ef923(0xb5)]['resolvePathToResource'](_0x1f0142),{'verbose':_0x35a1c1['verbose']}),_0x806f9b=_0x4e3ab0[_0x4ef923(0xd6)];_0x35a1c1['verbose']&&(console[_0x4ef923(0xfa)]('Resolved\x20type:\x20'+_0x806f9b[_0x4ef923(0x113)]),console['error'](_0x4ef923(0xe0)+_0x806f9b[_0x4ef923(0xbf)]));if(_0x806f9b['type']===_0x4ef923(0xf7))return console[_0x4ef923(0xfa)](_0x4ef923(0xcc)),console[_0x4ef923(0xfa)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x806f9b[_0x4ef923(0x113)]===_0x4ef923(0xca))return console[_0x4ef923(0xfa)](_0x4ef923(0x11a)),console[_0x4ef923(0xfa)](_0x4ef923(0x115)),0x1;if(!_0x806f9b['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4ef923(0xc3));const _0x18c014=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2cc718[_0x4ef923(0xb5)][_0x4ef923(0x10d)](_0x806f9b[_0x4ef923(0xbf)],_0x806f9b[_0x4ef923(0xdd)]),{'verbose':_0x35a1c1[_0x4ef923(0xeb)]});let _0x479404=_0x18c014[_0x4ef923(0xd6)];const _0x4e57dd=resolveLimit(_0x35a1c1['limit'],DEFAULT_DISPLAY_LIMIT),_0x2f1ece=/\bLIMIT\s+\d+/i[_0x4ef923(0xb3)](_0x479404);!_0x2f1ece&&(_0x479404=_0x479404['trim']()['replace'](/;+$/,''),_0x479404=_0x4ef923(0x13b)+_0x479404+_0x4ef923(0xc4)+_0x4e57dd);_0x35a1c1[_0x4ef923(0xeb)]&&console['error'](_0x4ef923(0xa1)+_0x479404);const _0x5cfc72=await withProgressSpinner(_0x4ef923(0x10b),async _0x54b5bd=>{const _0x1d74f2=_0x4ef923,_0x524492=await _0x2cc718['query']['execute'](_0x479404,{'catalog':'td','schema':_0x1d74f2(0x12b),'onJobId':_0x1bb6c8=>{const _0x447344=_0x1d74f2;_0x54b5bd[_0x447344(0x140)](_0x1bb6c8);}});return _0x524492;},{'verbose':_0x35a1c1[_0x4ef923(0xeb)]}),_0x11e854=_0x5cfc72[_0x4ef923(0xd6)],_0x8368c1=_0x11e854['jobId']?_0x4ef923(0xd0)+_0x11e854[_0x4ef923(0xcf)]+']':'';return console[_0x4ef923(0xfa)](_0x4ef923(0xd1)+_0x11e854[_0x4ef923(0xe9)][_0x4ef923(0xcb)][_0x4ef923(0x130)]()+_0x4ef923(0xed)+(_0x4ef923(0xaa)+formatElapsed(_0x11e854[_0x4ef923(0xe9)]['elapsedTimeMillis'])+_0x8368c1)),await handleQueryOutput(_0x11e854,_0x35a1c1),0x0;}catch(_0x22c81e){if(_0x22c81e instanceof SDKError)return console['error'](_0x4ef923(0x12e)+_0x22c81e[_0x4ef923(0x10a)]+']'),console[_0x4ef923(0xfa)]('\x0a'+_0x22c81e['message']),0x1;throw _0x22c81e;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x3a25bb(0xb4);['description']=a27_0x3a25bb(0x121);async[a27_0x3a25bb(0x137)](_0x4fb214){const _0x44161d=a27_0x3a25bb,{options:_0x24d45f,args:_0xb0770a,tdx:_0x1f3ddc}=_0x4fb214;if(_0xb0770a['length']===0x0)return console[_0x44161d(0xfa)](_0x44161d(0xac)),console[_0x44161d(0xfa)](_0x44161d(0xa8)),0x1;const _0x1617a8=_0xb0770a[0x0];try{_0x24d45f[_0x44161d(0xeb)]&&(console['error'](_0x44161d(0xe2)+_0x24d45f[_0x44161d(0xc0)]),console[_0x44161d(0xfa)](_0x44161d(0xc5)+_0x1617a8));const _0x23c78b=await withSpinner(_0x44161d(0x11c)+_0x1617a8+_0x44161d(0xa7),()=>_0x1f3ddc[_0x44161d(0xb5)][_0x44161d(0xba)](_0x1617a8),{'verbose':_0x24d45f['verbose']}),_0xccbbcf=_0x23c78b[_0x44161d(0xd6)];_0x24d45f['verbose']&&console['error'](_0x44161d(0xfd)+_0xccbbcf);const _0x5c5cc4=await withSpinner(_0x44161d(0x109)+_0x1617a8+'\x27...',()=>_0x1f3ddc[_0x44161d(0xb5)][_0x44161d(0xd3)](_0xccbbcf),{'verbose':_0x24d45f[_0x44161d(0xeb)]}),_0xf01122=_0x5c5cc4[_0x44161d(0xd6)];return console[_0x44161d(0xfa)](_0x44161d(0x117)+_0xf01122['length']+'\x20folder'+(_0xf01122[_0x44161d(0x128)]!==0x1?'s':'')),await handleSDKOutput(_0xf01122,_0x24d45f),0x0;}catch(_0xfd9764){if(_0xfd9764 instanceof SDKError)return console[_0x44161d(0xfa)]('Error:\x20'+_0xfd9764[_0x44161d(0xfb)]),_0xfd9764[_0x44161d(0x101)]&&console[_0x44161d(0xfa)]('\x20\x20Cause:\x20'+_0xfd9764[_0x44161d(0x101)]),0x1;throw _0xfd9764;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';['description']=a27_0x3a25bb(0xf8);async['execute'](_0x2e1f2a){const _0x404e6d=a27_0x3a25bb,{options:_0x3915c3,args:_0x55a4d6,tdx:_0x2aa2b1}=_0x2e1f2a;if(_0x55a4d6[_0x404e6d(0x128)]===0x0)return console[_0x404e6d(0xfa)](_0x404e6d(0xc6)),console[_0x404e6d(0xfa)](_0x404e6d(0xcd)),0x1;try{const {parentId:_0x29916f,childId:_0xc8ea19}=parseSegmentRef(_0x55a4d6[0x0]);_0x3915c3['verbose']&&(console['error'](_0x404e6d(0xe2)+_0x3915c3[_0x404e6d(0xc0)]),console[_0x404e6d(0xfa)]('Parent\x20name:\x20'+_0x29916f),_0xc8ea19&&console[_0x404e6d(0xfa)](_0x404e6d(0x13e)+_0xc8ea19));if(!_0xc8ea19)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x1041bf=await withSpinner(_0x404e6d(0x11c)+_0x29916f+_0x404e6d(0xa7),()=>_0x2aa2b1['segment'][_0x404e6d(0xba)](_0x29916f),{'verbose':_0x3915c3[_0x404e6d(0xeb)]}),_0x5d991e=_0x1041bf[_0x404e6d(0xd6)];_0x3915c3['verbose']&&console[_0x404e6d(0xfa)](_0x404e6d(0xfd)+_0x5d991e);const _0xeb057b=await withSpinner(_0x404e6d(0x114)+_0xc8ea19+_0x404e6d(0xa7),()=>_0x2aa2b1[_0x404e6d(0xb5)][_0x404e6d(0xa3)](_0x5d991e,_0xc8ea19),{'verbose':_0x3915c3[_0x404e6d(0xeb)]}),_0x2137c7=_0xeb057b['data'];_0x3915c3[_0x404e6d(0xeb)]&&console[_0x404e6d(0xfa)](_0x404e6d(0x120)+_0x2137c7);const _0x2e2452=await withSpinner(_0x404e6d(0x118)+_0xc8ea19+_0x404e6d(0xa7),()=>_0x2aa2b1[_0x404e6d(0xb5)][_0x404e6d(0xd4)](_0x2137c7),{'verbose':_0x3915c3[_0x404e6d(0xeb)]});return await handleSDKOutput([_0x2e2452[_0x404e6d(0xd6)]],_0x3915c3),0x0;}catch(_0x17bcfe){if(_0x17bcfe instanceof SDKError)return console[_0x404e6d(0xfa)](_0x404e6d(0xdb)+_0x17bcfe['message']),_0x17bcfe[_0x404e6d(0x101)]&&console[_0x404e6d(0xfa)](_0x404e6d(0xee)+_0x17bcfe[_0x404e6d(0x101)]),0x1;throw _0x17bcfe;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x3a25bb(0x133)]=a27_0x3a25bb(0x13c);[a27_0x3a25bb(0xd9)]=a27_0x3a25bb(0xa2);async[a27_0x3a25bb(0x137)](_0x31e261){const _0x273e7e=a27_0x3a25bb,{options:_0x1eabea,args:_0x3226c6,tdx:_0x3f7bb2}=_0x31e261,_0xa3cb78=_0x3226c6[0x0];if(!_0xa3cb78)return console['error'](_0x273e7e(0x11e)),console[_0x273e7e(0xfa)](_0x273e7e(0x108)),console[_0x273e7e(0xfa)](_0x273e7e(0xa6)),console['error'](_0x273e7e(0xc9)),console[_0x273e7e(0xfa)](_0x273e7e(0xd2)),console[_0x273e7e(0xfa)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x377cba=_0x1eabea['parentSegment'],_0x162d76=await resolveSegmentTarget(_0xa3cb78,_0x377cba,_0x1eabea['verbose']);_0x1eabea[_0x273e7e(0xeb)]&&console['error'](_0x273e7e(0xb8)+_0x162d76);const _0x4206a3=await withSpinner(_0x273e7e(0xf6)+_0xa3cb78+_0x273e7e(0xa7),()=>_0x3f7bb2[_0x273e7e(0xb5)][_0x273e7e(0xa4)](_0x162d76),{'verbose':_0x1eabea[_0x273e7e(0xeb)]}),_0x3c7851=_0x4206a3[_0x273e7e(0xd6)];_0x1eabea[_0x273e7e(0xeb)]&&(console[_0x273e7e(0xfa)]('Resolved\x20type:\x20'+_0x3c7851[_0x273e7e(0x113)]),console['error'](_0x273e7e(0xe0)+_0x3c7851['parentId']));if(_0x3c7851['type']===_0x273e7e(0xf7))return console[_0x273e7e(0xfa)](_0x273e7e(0xda)),console[_0x273e7e(0xfa)](_0x273e7e(0xde)),0x1;if(_0x3c7851['type']===_0x273e7e(0xca))return console[_0x273e7e(0xfa)](_0x273e7e(0x136)),console[_0x273e7e(0xfa)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x3c7851['segmentId'])throw new SDKError(ErrorCode[_0x273e7e(0x126)],_0x273e7e(0xc3));const _0x4374ed=await withSpinner(_0x273e7e(0xbe),()=>_0x3f7bb2[_0x273e7e(0xb5)]['getSegmentSQL'](_0x3c7851[_0x273e7e(0xbf)],_0x3c7851['segmentId']),{'verbose':_0x1eabea[_0x273e7e(0xeb)]}),_0x18bcc4=_0x4374ed[_0x273e7e(0xd6)];return _0x1eabea['format']===_0x273e7e(0x12c)||_0x1eabea[_0x273e7e(0x10e)]===_0x273e7e(0xf9)?await handleSDKOutput([{'sql':_0x18bcc4}],_0x1eabea):console[_0x273e7e(0x13f)](_0x18bcc4),0x0;}catch(_0x56ce9c){if(_0x56ce9c instanceof SDKError)return console[_0x273e7e(0xfa)](_0x273e7e(0xdb)+_0x56ce9c[_0x273e7e(0xfb)]),_0x56ce9c[_0x273e7e(0x101)]&&console[_0x273e7e(0xfa)](_0x273e7e(0xee)+_0x56ce9c[_0x273e7e(0x101)]),0x1;throw _0x56ce9c;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x3a25bb(0x133)]=a27_0x3a25bb(0x122);[a27_0x3a25bb(0xd9)]=a27_0x3a25bb(0xce);async['execute'](_0x4254ce){const _0x2ccdea=a27_0x3a25bb,{options:_0x4ee20e,args:_0x358425,tdx:_0x2579c4}=_0x4254ce,_0x45eac4=_0x4ee20e;if(_0x358425[_0x2ccdea(0x128)]<0x2)return console[_0x2ccdea(0xfa)](_0x2ccdea(0x134)),console[_0x2ccdea(0xfa)](_0x2ccdea(0x129)),0x1;const _0x5ed44a=_0x358425[0x0],_0x23c890=_0x358425[0x1];_0x45eac4[_0x2ccdea(0xeb)]&&(console['error'](_0x2ccdea(0xe2)+_0x45eac4[_0x2ccdea(0xc0)]),console['error'](_0x2ccdea(0xb1)+_0x5ed44a),console[_0x2ccdea(0xfa)]('Folder\x20name:\x20'+_0x23c890));let _0x56a075;if(_0x45eac4['parentFolder']){const _0x3b7286=_0x45eac4[_0x2ccdea(0xa0)],_0x303df6=await withSpinner(_0x2ccdea(0x11c)+_0x5ed44a+_0x2ccdea(0xa7),()=>_0x2579c4[_0x2ccdea(0xb5)][_0x2ccdea(0xba)](_0x5ed44a),{'verbose':_0x45eac4[_0x2ccdea(0xeb)]}),_0x4d6e38=_0x303df6[_0x2ccdea(0xd6)],_0x40db9c=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x3b7286+_0x2ccdea(0xa7),()=>_0x2579c4[_0x2ccdea(0xb5)]['resolveFolderId'](_0x4d6e38,_0x3b7286),{'verbose':_0x45eac4[_0x2ccdea(0xeb)]});_0x56a075=_0x40db9c[_0x2ccdea(0xd6)],_0x45eac4[_0x2ccdea(0xeb)]&&console[_0x2ccdea(0xfa)](_0x2ccdea(0xf2)+_0x56a075);}const _0xebecb2={'name':_0x23c890,'description':_0x45eac4[_0x2ccdea(0xd9)],'parentFolderId':_0x56a075},_0x1f3d6f=await withSpinner('Creating\x20folder\x20\x27'+_0x23c890+_0x2ccdea(0xa7),()=>_0x2579c4['segment'][_0x2ccdea(0x13d)](_0x5ed44a,_0xebecb2),{'verbose':_0x45eac4[_0x2ccdea(0xeb)]}),_0x2fd9c3=_0x1f3d6f[_0x2ccdea(0xd6)];return console[_0x2ccdea(0xfa)](_0x2ccdea(0xbd)+_0x2fd9c3[_0x2ccdea(0x133)]+_0x2ccdea(0x9f)+_0x2fd9c3['id']),await handleSDKOutput([_0x2fd9c3],_0x45eac4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x3a25bb(0x133)]='segment:view';[a27_0x3a25bb(0xd9)]=a27_0x3a25bb(0xf0);async[a27_0x3a25bb(0x137)](_0x2812df){const _0x387c90=a27_0x3a25bb,{options:_0x554806,args:_0x37c03c,tdx:_0x12239a}=_0x2812df,_0x11ab76=_0x37c03c[0x0];if(!_0x11ab76)return console[_0x387c90(0xfa)](_0x387c90(0x10f)),console[_0x387c90(0xfa)](_0x387c90(0xb7)),console[_0x387c90(0xfa)](_0x387c90(0xea)),console[_0x387c90(0xfa)](_0x387c90(0xb6)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x387c90(0xfa)](_0x387c90(0xc9)),console[_0x387c90(0xfa)](_0x387c90(0xc8)),console[_0x387c90(0xfa)](_0x387c90(0xe4)),console['error'](_0x387c90(0x116)),console['error'](_0x387c90(0xbc)),0x1;try{const _0x549233=_0x554806[_0x387c90(0x107)],_0x1ae494=await resolveSegmentTarget(_0x11ab76,_0x549233,_0x554806['verbose']);_0x554806[_0x387c90(0xeb)]&&console[_0x387c90(0xfa)]('Target\x20path:\x20'+_0x1ae494);const _0xb3ab56=await withSpinner(_0x387c90(0xf6)+_0x11ab76+'\x27...',()=>_0x12239a[_0x387c90(0xb5)]['resolvePathToResource'](_0x1ae494),{'verbose':_0x554806[_0x387c90(0xeb)]}),_0x592d83=_0xb3ab56[_0x387c90(0xd6)];_0x554806[_0x387c90(0xeb)]&&(console[_0x387c90(0xfa)]('Resolved\x20type:\x20'+_0x592d83[_0x387c90(0x113)]),console[_0x387c90(0xfa)](_0x387c90(0xe0)+_0x592d83[_0x387c90(0xbf)]),_0x592d83[_0x387c90(0xf5)]&&console[_0x387c90(0xfa)](_0x387c90(0x103)+_0x592d83['folderId']),_0x592d83[_0x387c90(0xdd)]&&console['error'](_0x387c90(0x123)+_0x592d83[_0x387c90(0xdd)]));if(_0x554806[_0x387c90(0xb2)]){if(_0x592d83[_0x387c90(0x113)]===_0x387c90(0xf7))return console[_0x387c90(0xfa)](_0x387c90(0xc2)),0x1;if(_0x592d83['type']===_0x387c90(0xca))return console[_0x387c90(0xfa)](_0x387c90(0xfe)),console[_0x387c90(0xfa)](_0x387c90(0xe8)),0x1;if(!_0x592d83[_0x387c90(0xdd)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x387c90(0xc3));const _0x45d762=getConsoleNextUrl(_0x554806[_0x387c90(0xc0)],_0x387c90(0x112)+_0x592d83[_0x387c90(0xbf)]+'/e/'+_0x592d83[_0x387c90(0xdd)]);return console['error'](a27_0x44cc2a[_0x387c90(0x100)]('✔')+_0x387c90(0xdf)+a27_0x44cc2a[_0x387c90(0xab)](_0x45d762)),openBrowser(_0x45d762),0x0;}if(_0x592d83[_0x387c90(0x113)]===_0x387c90(0xf7)){if(!_0x592d83[_0x387c90(0xf5)])throw new SDKError(ErrorCode[_0x387c90(0x131)],_0x387c90(0xef));const _0x565094=await withSpinner(_0x387c90(0xc7),()=>_0x12239a['segment'][_0x387c90(0xd4)](_0x592d83[_0x387c90(0xf5)]),{'verbose':_0x554806[_0x387c90(0xeb)]});await handleSingleObjectOutput(_0x565094[_0x387c90(0xd6)],_0x554806);}else{if(_0x592d83[_0x387c90(0x113)]===_0x387c90(0xb5)){if(!_0x592d83[_0x387c90(0xdd)])throw new SDKError(ErrorCode[_0x387c90(0x126)],_0x387c90(0xc3));const _0x4db2da=await withSpinner(_0x387c90(0x139),()=>_0x12239a['segment'][_0x387c90(0x119)](_0x592d83['parentId'],_0x592d83[_0x387c90(0xdd)]),{'verbose':_0x554806[_0x387c90(0xeb)]}),_0x29eef9=getConsoleNextUrl(_0x554806[_0x387c90(0xc0)],_0x387c90(0x112)+_0x592d83[_0x387c90(0xbf)]+_0x387c90(0x110)+_0x592d83['segmentId']),_0x5869dd=_0x4db2da[_0x387c90(0xd6)];_0x5869dd[_0x387c90(0x11d)]=_0x29eef9,await handleSingleObjectOutput(_0x5869dd,_0x554806);}else return console[_0x387c90(0xfa)](_0x387c90(0xf4)),console[_0x387c90(0xfa)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x403991){if(_0x403991 instanceof SDKError)return console[_0x387c90(0xfa)](_0x387c90(0xdb)+_0x403991[_0x387c90(0xfb)]),_0x403991[_0x387c90(0x101)]&&console['error'](_0x387c90(0xee)+_0x403991['cause']),0x1;throw _0x403991;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x3a25bb(0x133)]=a27_0x3a25bb(0x106);[a27_0x3a25bb(0xd9)]=a27_0x3a25bb(0xff);async['execute'](_0x5bae86){const _0x55138a=a27_0x3a25bb,{options:_0x3aff9d,args:_0x5e0ba0,tdx:_0x1c67bc}=_0x5bae86,_0x51a3ce=_0x5e0ba0[0x0];if(!_0x51a3ce)return console[_0x55138a(0xfa)](_0x55138a(0x11e)),console[_0x55138a(0xfa)](_0x55138a(0xdc)),console[_0x55138a(0xfa)](_0x55138a(0x138)),console[_0x55138a(0xfa)](_0x55138a(0xc9)),console[_0x55138a(0xfa)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x55138a(0xfa)](_0x55138a(0x11f)),0x1;try{const _0x1e973e=_0x3aff9d[_0x55138a(0x107)],_0x1f632c=await resolveSegmentTarget(_0x51a3ce,_0x1e973e,_0x3aff9d['verbose']);_0x3aff9d[_0x55138a(0xeb)]&&console['error']('Target\x20path:\x20'+_0x1f632c);const _0x122ce3=await withSpinner('Resolving\x20\x27'+_0x51a3ce+_0x55138a(0xa7),()=>_0x1c67bc['segment']['resolvePathToResource'](_0x1f632c),{'verbose':_0x3aff9d[_0x55138a(0xeb)]}),_0x53c42c=_0x122ce3[_0x55138a(0xd6)];_0x3aff9d[_0x55138a(0xeb)]&&(console[_0x55138a(0xfa)]('Resolved\x20type:\x20'+_0x53c42c[_0x55138a(0x113)]),console[_0x55138a(0xfa)](_0x55138a(0xe0)+_0x53c42c[_0x55138a(0xbf)]));if(_0x53c42c[_0x55138a(0x113)]===_0x55138a(0xf7))return console[_0x55138a(0xfa)](_0x55138a(0x11b)),console[_0x55138a(0xfa)](_0x55138a(0xde)),0x1;if(_0x53c42c[_0x55138a(0x113)]===_0x55138a(0xca))return console[_0x55138a(0xfa)](_0x55138a(0x135)),console[_0x55138a(0xfa)](_0x55138a(0xe7)),0x1;if(!_0x53c42c[_0x55138a(0xdd)])throw new SDKError(ErrorCode[_0x55138a(0x126)],_0x55138a(0xc3));const _0x1a7582=await withSpinner(_0x55138a(0xbe),()=>_0x1c67bc[_0x55138a(0xb5)][_0x55138a(0x10d)](_0x53c42c[_0x55138a(0xbf)],_0x53c42c[_0x55138a(0xdd)]),{'verbose':_0x3aff9d[_0x55138a(0xeb)]}),_0x163ffa=_0x1a7582['data'],_0x12acf4=await executeSchemaQuery(_0x163ffa,_0x1c67bc,_0x3aff9d);return await handleQueryOutput(_0x12acf4,_0x3aff9d),0x0;}catch(_0x4022cb){if(_0x4022cb instanceof SDKError)return console[_0x55138a(0xfa)](_0x55138a(0xdb)+_0x4022cb[_0x55138a(0xfb)]),_0x4022cb['cause']&&console[_0x55138a(0xfa)](_0x55138a(0xee)+_0x4022cb['cause']),0x1;throw _0x4022cb;}}}
@@ -1 +1 @@
1
- function a28_0x1a67(){const _0x1c8f34=['\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','type','ruleFile','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','kind','segment','1074129IFHAgP','yellow','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27\x20with\x20ID:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segment:create','\x27...','site','Resolving\x20folder\x20\x27','Resolved\x20folder\x20ID:\x20','9HJtNOw','segmentPath','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Segment\x20name:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','verbose','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','folder','2LzTDQK','5394270olFGJy','1526180IXSjIp','noCountPopulation','2178MQZrbJ','resolvePathToResource','invisible','includes','✔\x20Created\x20segment\x20\x27','Examples:','name','Creating\x20segment\x20\x27','6766738QNgnzy','300895iCPvCt','resolveFolderId','description','length','rule','\x20\x20\x20Path:\x20','error','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','segments','resolveParentId','Parent:\x20','execute','2295DgtJzI','createSegment','Parent\x20path:\x20','495408PiCAss','Resolving\x20parent\x20segment\x20\x27','16BKSrAc','data','Target\x20path:\x20'];a28_0x1a67=function(){return _0x1c8f34;};return a28_0x1a67();}function a28_0x58cc(_0x22ff8e,_0x389040){_0x22ff8e=_0x22ff8e-0x1e9;const _0x1a6727=a28_0x1a67();let _0x58cc1b=_0x1a6727[_0x22ff8e];return _0x58cc1b;}const a28_0x26d545=a28_0x58cc;(function(_0x4b9d1a,_0x38d1a1){const _0x310ba9=a28_0x58cc,_0x370322=_0x4b9d1a();while(!![]){try{const _0x4b2f05=parseInt(_0x310ba9(0x1f3))/0x1*(parseInt(_0x310ba9(0x20f))/0x2)+parseInt(_0x310ba9(0x21a))/0x3+-parseInt(_0x310ba9(0x1f5))/0x4+-parseInt(_0x310ba9(0x20c))/0x5*(parseInt(_0x310ba9(0x1f7))/0x6)+-parseInt(_0x310ba9(0x200))/0x7*(parseInt(_0x310ba9(0x211))/0x8)+parseInt(_0x310ba9(0x1ea))/0x9*(-parseInt(_0x310ba9(0x1f4))/0xa)+parseInt(_0x310ba9(0x1ff))/0xb;if(_0x4b2f05===_0x38d1a1)break;else _0x370322['push'](_0x370322['shift']());}catch(_0x4183fd){_0x370322['push'](_0x370322['shift']());}}}(a28_0x1a67,0x4808a));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';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x1ced8c from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x26d545(0x1fd)]=a28_0x26d545(0x21f);['description']=a28_0x26d545(0x1ee);async[a28_0x26d545(0x20b)](_0x4eb5f8){const _0x458843=a28_0x26d545;console[_0x458843(0x206)](a28_0x1ced8c[_0x458843(0x21b)](_0x458843(0x207))),console['error'](a28_0x1ced8c[_0x458843(0x21b)](_0x458843(0x214)));const {options:_0x139370,args:_0x59dba8,tdx:_0x46d41f}=_0x4eb5f8,_0x35a872=_0x139370;if(_0x59dba8[_0x458843(0x203)]===0x0)return console[_0x458843(0x206)](_0x458843(0x21c)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x458843(0x206)](_0x458843(0x1fc)),console['error'](_0x458843(0x1ec)),console[_0x458843(0x206)](_0x458843(0x1f0)),console[_0x458843(0x206)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2d276a=_0x59dba8[0x0],_0x5b9cab=_0x139370[_0x458843(0x1eb)];let _0x318d99=_0x2d276a;_0x5b9cab&&!_0x2d276a[_0x458843(0x1fa)]('/')&&(_0x318d99=_0x5b9cab+'/'+_0x2d276a,_0x35a872[_0x458843(0x1ef)]&&console[_0x458843(0x206)]('Resolved\x20relative\x20path\x20to:\x20'+_0x318d99));const _0x3a3d96=parsePath(_0x318d99);if(_0x3a3d96[_0x458843(0x208)][_0x458843(0x203)]<0x2)return console[_0x458843(0x206)](_0x458843(0x21e)),console[_0x458843(0x206)](_0x458843(0x217)),0x1;const _0x352949=_0x3a3d96['segments'][0x0],_0xde378=getBaseName(_0x318d99),_0x4a92a9=getParentPath(_0x318d99);_0x35a872['verbose']&&(console[_0x458843(0x206)]('Site:\x20'+_0x35a872[_0x458843(0x221)]),console[_0x458843(0x206)](_0x458843(0x213)+_0x318d99),console[_0x458843(0x206)](_0x458843(0x20a)+_0x352949),console[_0x458843(0x206)](_0x458843(0x1ed)+_0xde378),console['error'](_0x458843(0x20e)+_0x4a92a9));const _0x22039f=await withSpinner(_0x458843(0x210)+_0x352949+'\x27...',()=>_0x46d41f['segment'][_0x458843(0x209)](_0x352949),{'verbose':_0x35a872[_0x458843(0x1ef)]}),_0x3bfbfa=_0x22039f['data'];let _0x36fb34;if(_0x3a3d96['segments'][_0x458843(0x203)]>0x2){const _0x4a76cb=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x4a92a9+_0x458843(0x220),()=>_0x46d41f[_0x458843(0x219)][_0x458843(0x1f8)](_0x4a92a9),{'verbose':_0x35a872[_0x458843(0x1ef)]}),_0x284c4a=_0x4a76cb[_0x458843(0x212)];if(_0x284c4a[_0x458843(0x215)]!==_0x458843(0x1f2)&&_0x284c4a['type']!=='parent')return console[_0x458843(0x206)](_0x458843(0x1f1)),0x1;_0x36fb34=_0x284c4a['folderId'];}else{if(_0x35a872[_0x458843(0x1f2)]){const _0x5599a4=await withSpinner(_0x458843(0x222)+_0x35a872[_0x458843(0x1f2)]+_0x458843(0x220),()=>_0x46d41f['segment'][_0x458843(0x201)](_0x3bfbfa,_0x35a872[_0x458843(0x1f2)]),{'verbose':_0x35a872['verbose']});_0x36fb34=_0x5599a4['data'];}}_0x35a872[_0x458843(0x1ef)]&&_0x36fb34&&console[_0x458843(0x206)](_0x458843(0x1e9)+_0x36fb34);const _0x14ffeb=await loadJSONFromOptions(_0x35a872[_0x458843(0x204)],_0x35a872[_0x458843(0x216)]),_0x92c48={'name':_0xde378,'description':_0x35a872[_0x458843(0x202)],'rule':_0x14ffeb,'kind':_0x35a872[_0x458843(0x218)]!==undefined?parseInt(_0x35a872['kind'],0xa):undefined,'isVisible':_0x35a872[_0x458843(0x1f9)]?![]:undefined,'segmentFolderId':_0x36fb34,'countPopulation':_0x35a872[_0x458843(0x1f6)]?![]:undefined},_0x63b85e=await withSpinner(_0x458843(0x1fe)+_0xde378+'\x27...',()=>_0x46d41f[_0x458843(0x219)][_0x458843(0x20d)](_0x3bfbfa,_0x92c48),{'verbose':_0x35a872[_0x458843(0x1ef)]}),_0x53839c=_0x63b85e[_0x458843(0x212)];return console[_0x458843(0x206)](_0x458843(0x1fb)+_0x53839c[_0x458843(0x1fd)]+_0x458843(0x21d)+_0x53839c['id']),_0x318d99!==_0x2d276a&&console[_0x458843(0x206)](_0x458843(0x205)+_0x318d99),await handleSDKOutput([_0x53839c],_0x35a872),0x0;}}
1
+ function a28_0x54f9(){const _0x1d815c=['segmentPath','3608612zcLGot','type','Resolving\x20folder\x20path\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','289701RYwcDz','582875zbtmbB','folderId','5565360mYDVbA','1838PsjAQU','description','Creating\x20segment\x20\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolving\x20folder\x20\x27','error','1726970DRDGUr','✔\x20Created\x20segment\x20\x27','\x27...','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','invisible','length','Site:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','verbose','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','resolveFolderId','yellow','data','Resolving\x20parent\x20segment\x20\x27','includes','2671976spFTJm','424gUNGQU','createSegment','resolveParentId','resolvePathToResource','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x27\x20with\x20ID:\x20','segments','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Examples:','\x20\x20\x20Path:\x20','Target\x20path:\x20','Parent:\x20','573PLMkHG','site','name','segment','folder','Segment\x20name:\x20','kind'];a28_0x54f9=function(){return _0x1d815c;};return a28_0x54f9();}const a28_0x3286ae=a28_0x341d;(function(_0x2a1b64,_0x1e71a7){const _0x59f1ca=a28_0x341d,_0x5355a0=_0x2a1b64();while(!![]){try{const _0x1fbf56=-parseInt(_0x59f1ca(0x19e))/0x1+-parseInt(_0x59f1ca(0x1a1))/0x2*(-parseInt(_0x59f1ca(0x191))/0x3)+-parseInt(_0x59f1ca(0x1b6))/0x4+parseInt(_0x59f1ca(0x1a7))/0x5+-parseInt(_0x59f1ca(0x1a0))/0x6+parseInt(_0x59f1ca(0x199))/0x7+-parseInt(_0x59f1ca(0x1b7))/0x8*(-parseInt(_0x59f1ca(0x19d))/0x9);if(_0x1fbf56===_0x1e71a7)break;else _0x5355a0['push'](_0x5355a0['shift']());}catch(_0x267033){_0x5355a0['push'](_0x5355a0['shift']());}}}(a28_0x54f9,0x89b3b));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';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a28_0x341d(_0x1ae7b1,_0x2988db){_0x1ae7b1=_0x1ae7b1-0x189;const _0x54f999=a28_0x54f9();let _0x341d02=_0x54f999[_0x1ae7b1];return _0x341d02;}import a28_0x270aa2 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x3286ae(0x193)]='segment:create';[a28_0x3286ae(0x1a2)]=a28_0x3286ae(0x1a4);async['execute'](_0x306cc0){const _0x5ee894=a28_0x3286ae;console['error'](a28_0x270aa2[_0x5ee894(0x1b2)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x5ee894(0x1a6)](a28_0x270aa2[_0x5ee894(0x1b2)](_0x5ee894(0x1aa)));const {options:_0x42328f,args:_0x4df85c,tdx:_0x2e4482}=_0x306cc0,_0x128e63=_0x42328f;if(_0x4df85c[_0x5ee894(0x1ac)]===0x0)return console[_0x5ee894(0x1a6)](_0x5ee894(0x19c)),console[_0x5ee894(0x1a6)](_0x5ee894(0x189)),console[_0x5ee894(0x1a6)](_0x5ee894(0x18d)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x5ee894(0x1ae)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x78aba3=_0x4df85c[0x0],_0x27b535=_0x42328f[_0x5ee894(0x198)];let _0xbfcfad=_0x78aba3;_0x27b535&&!_0x78aba3[_0x5ee894(0x1b5)]('/')&&(_0xbfcfad=_0x27b535+'/'+_0x78aba3,_0x128e63[_0x5ee894(0x1af)]&&console[_0x5ee894(0x1a6)]('Resolved\x20relative\x20path\x20to:\x20'+_0xbfcfad));const _0x2c26b6=parsePath(_0xbfcfad);if(_0x2c26b6[_0x5ee894(0x18b)][_0x5ee894(0x1ac)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x5ee894(0x1a6)](_0x5ee894(0x1b0)),0x1;const _0x47e48a=_0x2c26b6[_0x5ee894(0x18b)][0x0],_0x549a8c=getBaseName(_0xbfcfad),_0x2059c4=getParentPath(_0xbfcfad);_0x128e63[_0x5ee894(0x1af)]&&(console['error'](_0x5ee894(0x1ad)+_0x128e63[_0x5ee894(0x192)]),console[_0x5ee894(0x1a6)](_0x5ee894(0x18f)+_0xbfcfad),console['error'](_0x5ee894(0x190)+_0x47e48a),console[_0x5ee894(0x1a6)](_0x5ee894(0x196)+_0x549a8c),console[_0x5ee894(0x1a6)]('Parent\x20path:\x20'+_0x2059c4));const _0x5454fd=await withSpinner(_0x5ee894(0x1b4)+_0x47e48a+_0x5ee894(0x1a9),()=>_0x2e4482[_0x5ee894(0x194)][_0x5ee894(0x1b9)](_0x47e48a),{'verbose':_0x128e63['verbose']}),_0x136f78=_0x5454fd['data'];let _0x494569;if(_0x2c26b6['segments'][_0x5ee894(0x1ac)]>0x2){const _0xcaf63d=await withSpinner(_0x5ee894(0x19b)+_0x2059c4+'\x27...',()=>_0x2e4482['segment'][_0x5ee894(0x1ba)](_0x2059c4),{'verbose':_0x128e63['verbose']}),_0x17a37d=_0xcaf63d['data'];if(_0x17a37d[_0x5ee894(0x19a)]!=='folder'&&_0x17a37d[_0x5ee894(0x19a)]!=='parent')return console[_0x5ee894(0x1a6)](_0x5ee894(0x18c)),0x1;_0x494569=_0x17a37d[_0x5ee894(0x19f)];}else{if(_0x128e63[_0x5ee894(0x195)]){const _0x14a401=await withSpinner(_0x5ee894(0x1a5)+_0x128e63[_0x5ee894(0x195)]+_0x5ee894(0x1a9),()=>_0x2e4482[_0x5ee894(0x194)][_0x5ee894(0x1b1)](_0x136f78,_0x128e63[_0x5ee894(0x195)]),{'verbose':_0x128e63[_0x5ee894(0x1af)]});_0x494569=_0x14a401['data'];}}_0x128e63[_0x5ee894(0x1af)]&&_0x494569&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x494569);const _0x49ac3c=await loadJSONFromOptions(_0x128e63['rule'],_0x128e63['ruleFile']),_0x509376={'name':_0x549a8c,'description':_0x128e63[_0x5ee894(0x1a2)],'rule':_0x49ac3c,'kind':_0x128e63[_0x5ee894(0x197)]!==undefined?parseInt(_0x128e63['kind'],0xa):undefined,'isVisible':_0x128e63[_0x5ee894(0x1ab)]?![]:undefined,'segmentFolderId':_0x494569,'countPopulation':_0x128e63['noCountPopulation']?![]:undefined},_0x363e51=await withSpinner(_0x5ee894(0x1a3)+_0x549a8c+_0x5ee894(0x1a9),()=>_0x2e4482[_0x5ee894(0x194)][_0x5ee894(0x1b8)](_0x136f78,_0x509376),{'verbose':_0x128e63[_0x5ee894(0x1af)]}),_0x1cb270=_0x363e51[_0x5ee894(0x1b3)];return console['error'](_0x5ee894(0x1a8)+_0x1cb270[_0x5ee894(0x193)]+_0x5ee894(0x18a)+_0x1cb270['id']),_0xbfcfad!==_0x78aba3&&console['error'](_0x5ee894(0x18e)+_0xbfcfad),await handleSDKOutput([_0x1cb270],_0x128e63),0x0;}}
@@ -1 +1 @@
1
- const a29_0x1f7fb7=a29_0x1506;(function(_0x1d9b78,_0x92378a){const _0x1bc3d3=a29_0x1506,_0x197149=_0x1d9b78();while(!![]){try{const _0x2396fa=parseInt(_0x1bc3d3(0x1f8))/0x1*(parseInt(_0x1bc3d3(0x1ed))/0x2)+parseInt(_0x1bc3d3(0x1e4))/0x3+parseInt(_0x1bc3d3(0x1e9))/0x4*(parseInt(_0x1bc3d3(0x1eb))/0x5)+parseInt(_0x1bc3d3(0x1f2))/0x6+parseInt(_0x1bc3d3(0x1f6))/0x7+-parseInt(_0x1bc3d3(0x1e7))/0x8+-parseInt(_0x1bc3d3(0x1ec))/0x9;if(_0x2396fa===_0x92378a)break;else _0x197149['push'](_0x197149['shift']());}catch(_0x1983f5){_0x197149['push'](_0x197149['shift']());}}}(a29_0x3afc,0xcd6d6));import{BaseCommand}from'./command.js';function a29_0x1506(_0x36d639,_0x1ef6d3){_0x36d639=_0x36d639-0x1e1;const _0x3afc9a=a29_0x3afc();let _0x1506bb=_0x3afc9a[_0x36d639];return _0x1506bb;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x1f7fb7(0x1f7)]=a29_0x1f7fb7(0x1f0);[a29_0x1f7fb7(0x1e2)]='List\x20available\x20fields\x20for\x20segmentation';async[a29_0x1f7fb7(0x1e5)](_0x41bb43){const _0x458274=a29_0x1f7fb7,{options:_0x108375,args:_0x115a44,tdx:_0x55240a}=_0x41bb43,_0x5590f5=_0x115a44[0x0]||_0x108375['parentSegment'];if(!_0x5590f5)return console[_0x458274(0x1ea)](_0x458274(0x1ee)),console[_0x458274(0x1ea)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x458274(0x1ea)](_0x458274(0x1e8)),0x1;_0x108375[_0x458274(0x1f5)]&&(console[_0x458274(0x1ea)](_0x458274(0x1f9)+_0x108375[_0x458274(0x1e3)]),console[_0x458274(0x1ea)]('Parent\x20segment:\x20'+_0x5590f5));const _0x3d4b19=await withSpinner(_0x458274(0x1f3)+_0x5590f5+_0x458274(0x1f1),()=>_0x55240a['segment'][_0x458274(0x1ef)](_0x5590f5),{'verbose':_0x108375[_0x458274(0x1f5)]}),_0x4906d7=_0x3d4b19[_0x458274(0x1e6)];console[_0x458274(0x1ea)](_0x458274(0x1f4)+_0x4906d7['length']+_0x458274(0x1e1)+(_0x4906d7['length']!==0x1?'s':''));if(_0x108375['json']||_0x108375['jsonl'])return await handleSDKOutput(_0x4906d7,_0x108375),0x0;return displayFieldsHumanReadable(_0x4906d7,_0x5590f5),0x0;}}function a29_0x3afc(){const _0x288980=['error','7055635pewcNs','21415176EFvJeq','2uhpuxc','Error:\x20Parent\x20segment\x20name\x20is\x20required','listFields','segment:fields','\x27...','6160122mZvgVL','Listing\x20fields\x20for\x20\x27','✔\x20Found\x20','verbose','6143704rpmtqm','name','843277KCrthV','Site:\x20','\x20field','description','site','957843hmSqfg','execute','data','10057200fJwXat','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','4XQaqbp'];a29_0x3afc=function(){return _0x288980;};return a29_0x3afc();}
1
+ const a29_0x4ea29d=a29_0x14db;(function(_0x3a98a2,_0x136985){const _0x4d17ed=a29_0x14db,_0x590ef8=_0x3a98a2();while(!![]){try{const _0x5a0a7b=parseInt(_0x4d17ed(0x142))/0x1*(-parseInt(_0x4d17ed(0x145))/0x2)+parseInt(_0x4d17ed(0x153))/0x3*(-parseInt(_0x4d17ed(0x150))/0x4)+parseInt(_0x4d17ed(0x14a))/0x5*(parseInt(_0x4d17ed(0x136))/0x6)+parseInt(_0x4d17ed(0x14c))/0x7*(-parseInt(_0x4d17ed(0x14d))/0x8)+parseInt(_0x4d17ed(0x144))/0x9*(-parseInt(_0x4d17ed(0x135))/0xa)+-parseInt(_0x4d17ed(0x138))/0xb*(-parseInt(_0x4d17ed(0x13b))/0xc)+parseInt(_0x4d17ed(0x13e))/0xd;if(_0x5a0a7b===_0x136985)break;else _0x590ef8['push'](_0x590ef8['shift']());}catch(_0x15acc5){_0x590ef8['push'](_0x590ef8['shift']());}}}(a29_0xb9be,0x4b6bf));import{BaseCommand}from'./command.js';function a29_0x14db(_0x1d7565,_0x26ea2b){_0x1d7565=_0x1d7565-0x135;const _0xb9beb9=a29_0xb9be();let _0x14dbb8=_0xb9beb9[_0x1d7565];return _0x14dbb8;}function a29_0xb9be(){const _0x2fdde5=['\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Listing\x20fields\x20for\x20\x27','1573359QTlBdA','670kFnhzd','6nbTPke','name','13519EKxzhR','List\x20available\x20fields\x20for\x20segmentation','execute','2076aqQizW','Site:\x20','error','15815852HTDycE','parentSegment','\x20field','segment','1qCAdij','verbose','49347hkafvq','612314UaqPQq','\x27...','Error:\x20Parent\x20segment\x20name\x20is\x20required','length','jsonl','2824330SyrWJv','Parent\x20segment:\x20','7fSUHXB','3897512kUMWYg','json','description','4rOamGR'];a29_0xb9be=function(){return _0x2fdde5;};return a29_0xb9be();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x4ea29d(0x137)]='segment:fields';[a29_0x4ea29d(0x14f)]=a29_0x4ea29d(0x139);async[a29_0x4ea29d(0x13a)](_0x5b67d4){const _0x3d839a=a29_0x4ea29d,{options:_0x5d5b48,args:_0x402c9f,tdx:_0x9a80f2}=_0x5b67d4,_0x1db2d4=_0x402c9f[0x0]||_0x5d5b48[_0x3d839a(0x13f)];if(!_0x1db2d4)return console['error'](_0x3d839a(0x147)),console[_0x3d839a(0x13d)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console['error'](_0x3d839a(0x151)),0x1;_0x5d5b48['verbose']&&(console['error'](_0x3d839a(0x13c)+_0x5d5b48['site']),console[_0x3d839a(0x13d)](_0x3d839a(0x14b)+_0x1db2d4));const _0x2a8cef=await withSpinner(_0x3d839a(0x152)+_0x1db2d4+_0x3d839a(0x146),()=>_0x9a80f2[_0x3d839a(0x141)]['listFields'](_0x1db2d4),{'verbose':_0x5d5b48[_0x3d839a(0x143)]}),_0x392a6d=_0x2a8cef['data'];console[_0x3d839a(0x13d)]('✔\x20Found\x20'+_0x392a6d[_0x3d839a(0x148)]+_0x3d839a(0x140)+(_0x392a6d[_0x3d839a(0x148)]!==0x1?'s':''));if(_0x5d5b48[_0x3d839a(0x14e)]||_0x5d5b48[_0x3d839a(0x149)])return await handleSDKOutput(_0x392a6d,_0x5d5b48),0x0;return displayFieldsHumanReadable(_0x392a6d,_0x1db2d4),0x0;}}
@@ -1 +1 @@
1
- const a30_0x39325f=a30_0x146d;(function(_0x590b63,_0x5dd862){const _0x48d40d=a30_0x146d,_0x4edbc9=_0x590b63();while(!![]){try{const _0x2071c0=parseInt(_0x48d40d(0x202))/0x1*(parseInt(_0x48d40d(0x1c4))/0x2)+-parseInt(_0x48d40d(0x1dc))/0x3*(parseInt(_0x48d40d(0x1c7))/0x4)+parseInt(_0x48d40d(0x1fb))/0x5+parseInt(_0x48d40d(0x1c2))/0x6*(-parseInt(_0x48d40d(0x1d2))/0x7)+-parseInt(_0x48d40d(0x1f9))/0x8+-parseInt(_0x48d40d(0x1e2))/0x9+parseInt(_0x48d40d(0x1e8))/0xa;if(_0x2071c0===_0x5dd862)break;else _0x4edbc9['push'](_0x4edbc9['shift']());}catch(_0x4157cd){_0x4edbc9['push'](_0x4edbc9['shift']());}}}(a30_0xecb3,0x817a5));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x188918 from'chalk';function a30_0x146d(_0x4c91ac,_0x2a5f45){_0x4c91ac=_0x4c91ac-0x1bc;const _0xecb376=a30_0xecb3();let _0x146dc0=_0xecb376[_0x4c91ac];return _0x146dc0;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x38caea from'path';function a30_0xecb3(){const _0x52c45a=['message','6209UfwStY','cwd','isNew','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','filter','\x20files\x20to\x20','\x20activations','green','segments','yellow','987060pArJNy','activations','helpText','\x0aPull\x20summary\x20for\x20\x27','journeys','✔\x20All\x20files\x20are\x20up\x20to\x20date','6363972KaoTvm','dim','cyan','counts','resourceName','files','7494110sfWALm','\x20new\x20files','content','parent_segment','yes','✔\x20Context\x20set:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Write\x20','segment:pull','Pulling\x20segments\x20from\x20\x27','\x20journeys','\x20\x20🎯\x20','parentSegment','Target\x20resource:\x20','length','\x20=\x20','repeat','1320592JosAYG','error','3661925NBekRn','setPhase','file','absolutePath','\x20with\x20','\x20changed\x20files','parentName','20dTnPSe','utf-8','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','dirname','hasChanges','Error:\x20','execute','\x20\x20Target:\x20','segment','114eUXucs','targetDir','26660LwvLKc','\x20\x20🗺️\x20\x20','data','4hLiZUs','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Site:\x20','Parent\x20segment:\x20','diff','session','name','journeyVersions','no_parent','verbose'];a30_0xecb3=function(){return _0x52c45a;};return a30_0xecb3();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x39325f(0x1cd)]=a30_0x39325f(0x1f0);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x39325f(0x1bf)](_0x5c9a8d){const _0xbd23b3=a30_0x39325f,{options:_0x46c820,args:_0x2b8c6e,tdx:_0x14667e}=_0x5c9a8d,_0x545c7b=_0x46c820,_0x40858d=await resolveTarget({'arg':_0x2b8c6e[0x0],'contextParent':_0x46c820[_0xbd23b3(0x1f4)],'cwd':process[_0xbd23b3(0x1d3)]()});if(!isSuccessfulResolution(_0x40858d))return _0x40858d['errorCode']===_0xbd23b3(0x1cf)?(console[_0xbd23b3(0x1fa)](a30_0x188918[_0xbd23b3(0x1db)](_0xbd23b3(0x1ee))),console[_0xbd23b3(0x1fa)](_0xbd23b3(0x204)),console[_0xbd23b3(0x1fa)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0xbd23b3(0x1fa)](_0xbd23b3(0x1c8))):(console[_0xbd23b3(0x1fa)](a30_0x188918['red'](_0xbd23b3(0x1be)+_0x40858d[_0xbd23b3(0x1d1)]+'\x0a')),_0x40858d[_0xbd23b3(0x1de)]&&console[_0xbd23b3(0x1fa)](a30_0x188918[_0xbd23b3(0x1e4)](_0x40858d[_0xbd23b3(0x1de)]))),0x1;const _0x1ce797=_0x40858d[_0xbd23b3(0x201)],_0x84a065=_0x40858d['targetDir'],_0x590de3=_0x40858d['type']===_0xbd23b3(0x1fd)?_0x40858d[_0xbd23b3(0x1e6)]:undefined;_0x545c7b['verbose']&&(console[_0xbd23b3(0x1fa)](_0xbd23b3(0x1c9)+_0x545c7b['site']),console['error'](_0xbd23b3(0x1ca)+_0x1ce797),_0x590de3&&console[_0xbd23b3(0x1fa)](_0xbd23b3(0x1f5)+_0x590de3));const _0x203ada=await withProgressSpinner(_0xbd23b3(0x1f1)+_0x1ce797+'\x27...',_0x2bb94a=>_0x14667e[_0xbd23b3(0x1c1)]['pullSegments'](_0x1ce797,{'targetDir':_0x84a065,'targetResourceName':_0x590de3,'verbose':_0x545c7b[_0xbd23b3(0x1d0)],'progress':{'update':_0x55d226=>{const _0x31dca2=_0xbd23b3;_0x2bb94a[_0x31dca2(0x1fc)](_0x55d226),_0x545c7b['verbose']&&console['error']('\x20\x20'+_0x55d226);}}}),{'verbose':_0x545c7b[_0xbd23b3(0x1d0)]}),_0xdebe7=_0x203ada[_0xbd23b3(0x1c6)];if(_0xdebe7['counts']['segments']===0x0&&_0xdebe7['counts']['journeys']===0x0)return console[_0xbd23b3(0x1fa)](a30_0x188918['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0xdebe7[_0xbd23b3(0x201)]+'\x27')),0x0;const _0x1afad8=_0xdebe7[_0xbd23b3(0x1e7)][_0xbd23b3(0x1d6)](_0x59e374=>_0x59e374['isNew']),_0x2caa03=_0xdebe7[_0xbd23b3(0x1e7)][_0xbd23b3(0x1d6)](_0x4bbb04=>!_0x4bbb04['isNew']&&_0x4bbb04[_0xbd23b3(0x1bd)]),_0x4e578a=_0xdebe7[_0xbd23b3(0x1e7)][_0xbd23b3(0x1d6)](_0x5b31cb=>!_0x5b31cb[_0xbd23b3(0x1d4)]&&!_0x5b31cb[_0xbd23b3(0x1bd)]);console[_0xbd23b3(0x1fa)](_0xbd23b3(0x1df)+_0xdebe7[_0xbd23b3(0x201)]+'\x27:'),console[_0xbd23b3(0x1fa)](_0xbd23b3(0x1f3)+a30_0x188918[_0xbd23b3(0x1e4)](_0xdebe7[_0xbd23b3(0x1e5)][_0xbd23b3(0x1da)]+'\x20segments')+_0xbd23b3(0x1ff)+a30_0x188918['cyan'](_0xdebe7[_0xbd23b3(0x1e5)][_0xbd23b3(0x1dd)]+_0xbd23b3(0x1d8)));if(_0xdebe7[_0xbd23b3(0x1e5)][_0xbd23b3(0x1e0)]>0x0){const _0x12ed9f=_0xdebe7[_0xbd23b3(0x1e5)][_0xbd23b3(0x1ce)]>_0xdebe7[_0xbd23b3(0x1e5)]['journeys']?'\x20('+_0xdebe7[_0xbd23b3(0x1e5)][_0xbd23b3(0x1ce)]+'\x20versions)':'';console[_0xbd23b3(0x1fa)](_0xbd23b3(0x1c5)+a30_0x188918[_0xbd23b3(0x1e4)](_0xdebe7[_0xbd23b3(0x1e5)]['journeys']+_0xbd23b3(0x1f2))+a30_0x188918[_0xbd23b3(0x1e3)](_0x12ed9f));}console[_0xbd23b3(0x1fa)]('\x20\x20'+a30_0x188918['green']('+\x20'+_0x1afad8[_0xbd23b3(0x1f6)]+_0xbd23b3(0x1e9))),console['error']('\x20\x20'+a30_0x188918[_0xbd23b3(0x1db)]('~\x20'+_0x2caa03[_0xbd23b3(0x1f6)]+_0xbd23b3(0x200))),console[_0xbd23b3(0x1fa)]('\x20\x20'+a30_0x188918[_0xbd23b3(0x1e3)]('=\x20'+_0x4e578a[_0xbd23b3(0x1f6)]+'\x20unchanged\x20files')),console[_0xbd23b3(0x1fa)](_0xbd23b3(0x1c0)+a30_0x188918[_0xbd23b3(0x1e4)](_0xdebe7[_0xbd23b3(0x1c3)])+'\x0a');if(_0x2caa03[_0xbd23b3(0x1f6)]>0x0)for(const _0x14be47 of _0x2caa03){console['error']('\x0aChanges\x20to\x20\x27'+_0x14be47['relativePath']+'\x27:'),console['error']('─'[_0xbd23b3(0x1f8)](0x3c)),console['error'](_0x14be47[_0xbd23b3(0x1cb)]),console[_0xbd23b3(0x1fa)]('─'['repeat'](0x3c));}if(_0x545c7b['dryRun'])return console[_0xbd23b3(0x1fa)](a30_0x188918[_0xbd23b3(0x1db)](_0xbd23b3(0x1d5))),0x0;if(_0x1afad8[_0xbd23b3(0x1f6)]===0x0&&_0x2caa03['length']===0x0)return console[_0xbd23b3(0x1fa)](a30_0x188918[_0xbd23b3(0x1d9)](_0xbd23b3(0x1e1))),saveSessionContext({'parent_segment':_0xdebe7[_0xbd23b3(0x201)]},_0x545c7b[_0xbd23b3(0x1cc)]),console[_0xbd23b3(0x1fa)](a30_0x188918[_0xbd23b3(0x1d9)](_0xbd23b3(0x1ed)+a30_0x188918['dim']('parent_segment')+_0xbd23b3(0x1f7)+a30_0x188918[_0xbd23b3(0x1e4)](_0xdebe7[_0xbd23b3(0x201)]))),0x0;if(!_0x545c7b[_0xbd23b3(0x1ec)]){const _0x8181cc=await confirmKey(_0xbd23b3(0x1ef)+(_0x1afad8[_0xbd23b3(0x1f6)]+_0x2caa03[_0xbd23b3(0x1f6)])+'\x20files?');if(!_0x8181cc)return console[_0xbd23b3(0x1fa)]('Aborted.'),0x1;}for(const _0x3a3eb3 of _0xdebe7[_0xbd23b3(0x1e7)]){if(_0x3a3eb3[_0xbd23b3(0x1d4)]||_0x3a3eb3[_0xbd23b3(0x1bd)]){const _0x3e152a=a30_0x38caea[_0xbd23b3(0x1bc)](_0x3a3eb3[_0xbd23b3(0x1fe)]);!existsSync(_0x3e152a)&&mkdirSync(_0x3e152a,{'recursive':!![]}),writeFileSync(_0x3a3eb3['absolutePath'],_0x3a3eb3[_0xbd23b3(0x1ea)],_0xbd23b3(0x203));}}return console[_0xbd23b3(0x1fa)](a30_0x188918[_0xbd23b3(0x1d9)]('✔\x20Pulled\x20'+(_0x1afad8[_0xbd23b3(0x1f6)]+_0x2caa03[_0xbd23b3(0x1f6)])+_0xbd23b3(0x1d7)+_0xdebe7['targetDir'])),saveSessionContext({'parent_segment':_0xdebe7[_0xbd23b3(0x201)]},_0x545c7b[_0xbd23b3(0x1cc)]),console['error'](a30_0x188918[_0xbd23b3(0x1d9)](_0xbd23b3(0x1ed)+a30_0x188918[_0xbd23b3(0x1e3)](_0xbd23b3(0x1eb))+_0xbd23b3(0x1f7)+a30_0x188918[_0xbd23b3(0x1e4)](_0xdebe7[_0xbd23b3(0x201)]))),0x0;}}
1
+ const a30_0x39ad92=a30_0x45e6;(function(_0x4751ba,_0x5df6c4){const _0x10ee53=a30_0x45e6,_0x269cac=_0x4751ba();while(!![]){try{const _0x20b78f=-parseInt(_0x10ee53(0x1fe))/0x1*(-parseInt(_0x10ee53(0x20f))/0x2)+parseInt(_0x10ee53(0x21b))/0x3*(parseInt(_0x10ee53(0x200))/0x4)+-parseInt(_0x10ee53(0x213))/0x5+parseInt(_0x10ee53(0x218))/0x6*(parseInt(_0x10ee53(0x22c))/0x7)+parseInt(_0x10ee53(0x1ff))/0x8+parseInt(_0x10ee53(0x1e1))/0x9*(-parseInt(_0x10ee53(0x1ec))/0xa)+parseInt(_0x10ee53(0x212))/0xb;if(_0x20b78f===_0x5df6c4)break;else _0x269cac['push'](_0x269cac['shift']());}catch(_0x406bfd){_0x269cac['push'](_0x269cac['shift']());}}}(a30_0xfd00,0x5bdb8));function a30_0x45e6(_0x1c8a40,_0x1253fd){_0x1c8a40=_0x1c8a40-0x1e1;const _0xfd007d=a30_0xfd00();let _0x45e6a5=_0xfd007d[_0x1c8a40];return _0x45e6a5;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x402196 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x575189 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x39ad92(0x1ee)]='segment:pull';[a30_0x39ad92(0x226)]=a30_0x39ad92(0x1e2);async[a30_0x39ad92(0x216)](_0x2117f8){const _0x8591fa=a30_0x39ad92,{options:_0x2a3b05,args:_0x105d22,tdx:_0x9ca083}=_0x2117f8,_0x160209=_0x2a3b05,_0x154ba4=await resolveTarget({'arg':_0x105d22[0x0],'contextParent':_0x2a3b05[_0x8591fa(0x1f5)],'cwd':process[_0x8591fa(0x208)]()});if(!isSuccessfulResolution(_0x154ba4))return _0x154ba4[_0x8591fa(0x21a)]===_0x8591fa(0x1eb)?(console['error'](a30_0x402196[_0x8591fa(0x22b)](_0x8591fa(0x201))),console[_0x8591fa(0x1e9)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x8591fa(0x214)),console[_0x8591fa(0x1e9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a30_0x402196[_0x8591fa(0x1f6)]('Error:\x20'+_0x154ba4[_0x8591fa(0x1e3)]+'\x0a')),_0x154ba4[_0x8591fa(0x21d)]&&console[_0x8591fa(0x1e9)](a30_0x402196['cyan'](_0x154ba4[_0x8591fa(0x21d)]))),0x1;const _0x65ddb5=_0x154ba4[_0x8591fa(0x1f7)],_0x3fc5c5=_0x154ba4['targetDir'],_0x9a9151=_0x154ba4[_0x8591fa(0x21e)]===_0x8591fa(0x20a)?_0x154ba4[_0x8591fa(0x1e4)]:undefined;_0x160209[_0x8591fa(0x229)]&&(console[_0x8591fa(0x1e9)](_0x8591fa(0x220)+_0x160209[_0x8591fa(0x1fb)]),console[_0x8591fa(0x1e9)](_0x8591fa(0x210)+_0x65ddb5),_0x9a9151&&console['error']('Target\x20resource:\x20'+_0x9a9151));const _0x17413e=await withProgressSpinner(_0x8591fa(0x1fd)+_0x65ddb5+'\x27...',_0x16d6bd=>_0x9ca083[_0x8591fa(0x1ef)]['pullSegments'](_0x65ddb5,{'targetDir':_0x3fc5c5,'targetResourceName':_0x9a9151,'verbose':_0x160209[_0x8591fa(0x229)],'progress':{'update':_0x2e2034=>{const _0x1c7d5e=_0x8591fa;_0x16d6bd[_0x1c7d5e(0x228)](_0x2e2034),_0x160209[_0x1c7d5e(0x229)]&&console[_0x1c7d5e(0x1e9)]('\x20\x20'+_0x2e2034);}}}),{'verbose':_0x160209[_0x8591fa(0x229)]}),_0x1fc07c=_0x17413e['data'];if(_0x1fc07c[_0x8591fa(0x206)][_0x8591fa(0x215)]===0x0&&_0x1fc07c[_0x8591fa(0x206)][_0x8591fa(0x224)]===0x0)return console[_0x8591fa(0x1e9)](a30_0x402196[_0x8591fa(0x22b)](_0x8591fa(0x1f0)+_0x1fc07c[_0x8591fa(0x1f7)]+'\x27')),0x0;const _0x345ce1=_0x1fc07c[_0x8591fa(0x209)][_0x8591fa(0x20e)](_0x2345ef=>_0x2345ef[_0x8591fa(0x203)]),_0x28b102=_0x1fc07c['files'][_0x8591fa(0x20e)](_0x34ae84=>!_0x34ae84[_0x8591fa(0x203)]&&_0x34ae84[_0x8591fa(0x21f)]),_0x1eeeab=_0x1fc07c[_0x8591fa(0x209)]['filter'](_0x35af3e=>!_0x35af3e[_0x8591fa(0x203)]&&!_0x35af3e['hasChanges']);console['error'](_0x8591fa(0x204)+_0x1fc07c[_0x8591fa(0x1f7)]+'\x27:'),console[_0x8591fa(0x1e9)](_0x8591fa(0x20d)+a30_0x402196[_0x8591fa(0x20c)](_0x1fc07c['counts'][_0x8591fa(0x215)]+_0x8591fa(0x1f8))+'\x20with\x20'+a30_0x402196[_0x8591fa(0x20c)](_0x1fc07c[_0x8591fa(0x206)][_0x8591fa(0x222)]+_0x8591fa(0x227)));if(_0x1fc07c['counts'][_0x8591fa(0x224)]>0x0){const _0x261d29=_0x1fc07c['counts'][_0x8591fa(0x223)]>_0x1fc07c[_0x8591fa(0x206)]['journeys']?'\x20('+_0x1fc07c['counts'][_0x8591fa(0x223)]+_0x8591fa(0x1fc):'';console[_0x8591fa(0x1e9)]('\x20\x20🗺️\x20\x20'+a30_0x402196['cyan'](_0x1fc07c[_0x8591fa(0x206)]['journeys']+_0x8591fa(0x1ea))+a30_0x402196[_0x8591fa(0x221)](_0x261d29));}console[_0x8591fa(0x1e9)]('\x20\x20'+a30_0x402196[_0x8591fa(0x1e7)]('+\x20'+_0x345ce1[_0x8591fa(0x1f4)]+_0x8591fa(0x22a))),console[_0x8591fa(0x1e9)]('\x20\x20'+a30_0x402196['yellow']('~\x20'+_0x28b102[_0x8591fa(0x1f4)]+_0x8591fa(0x1fa))),console[_0x8591fa(0x1e9)]('\x20\x20'+a30_0x402196[_0x8591fa(0x221)]('=\x20'+_0x1eeeab['length']+_0x8591fa(0x225))),console[_0x8591fa(0x1e9)](_0x8591fa(0x211)+a30_0x402196[_0x8591fa(0x20c)](_0x1fc07c['targetDir'])+'\x0a');if(_0x28b102[_0x8591fa(0x1f4)]>0x0)for(const _0x36cfbd of _0x28b102){console[_0x8591fa(0x1e9)](_0x8591fa(0x219)+_0x36cfbd['relativePath']+'\x27:'),console[_0x8591fa(0x1e9)]('─'[_0x8591fa(0x1e5)](0x3c)),console['error'](_0x36cfbd[_0x8591fa(0x1f3)]),console[_0x8591fa(0x1e9)]('─'['repeat'](0x3c));}if(_0x160209[_0x8591fa(0x217)])return console[_0x8591fa(0x1e9)](a30_0x402196['yellow'](_0x8591fa(0x205))),0x0;if(_0x345ce1[_0x8591fa(0x1f4)]===0x0&&_0x28b102[_0x8591fa(0x1f4)]===0x0)return console[_0x8591fa(0x1e9)](a30_0x402196['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1fc07c[_0x8591fa(0x1f7)]},_0x160209[_0x8591fa(0x22d)]),console['error'](a30_0x402196['green'](_0x8591fa(0x207)+a30_0x402196[_0x8591fa(0x221)]('parent_segment')+_0x8591fa(0x21c)+a30_0x402196[_0x8591fa(0x20c)](_0x1fc07c[_0x8591fa(0x1f7)]))),0x0;if(!_0x160209[_0x8591fa(0x1ed)]){const _0x58251a=await confirmKey('Write\x20'+(_0x345ce1['length']+_0x28b102[_0x8591fa(0x1f4)])+'\x20files?');if(!_0x58251a)return console[_0x8591fa(0x1e9)]('Aborted.'),0x1;}for(const _0x28b1a1 of _0x1fc07c[_0x8591fa(0x209)]){if(_0x28b1a1[_0x8591fa(0x203)]||_0x28b1a1[_0x8591fa(0x21f)]){const _0x1eb52a=a30_0x575189[_0x8591fa(0x1e8)](_0x28b1a1[_0x8591fa(0x202)]);!existsSync(_0x1eb52a)&&mkdirSync(_0x1eb52a,{'recursive':!![]}),writeFileSync(_0x28b1a1[_0x8591fa(0x202)],_0x28b1a1[_0x8591fa(0x1f9)],_0x8591fa(0x1f1));}}return console['error'](a30_0x402196[_0x8591fa(0x1e7)](_0x8591fa(0x1e6)+(_0x345ce1[_0x8591fa(0x1f4)]+_0x28b102[_0x8591fa(0x1f4)])+_0x8591fa(0x1f2)+_0x1fc07c[_0x8591fa(0x20b)])),saveSessionContext({'parent_segment':_0x1fc07c[_0x8591fa(0x1f7)]},_0x160209[_0x8591fa(0x22d)]),console[_0x8591fa(0x1e9)](a30_0x402196['green'](_0x8591fa(0x207)+a30_0x402196[_0x8591fa(0x221)]('parent_segment')+_0x8591fa(0x21c)+a30_0x402196[_0x8591fa(0x20c)](_0x1fc07c[_0x8591fa(0x1f7)]))),0x0;}}function a30_0xfd00(){const _0xe232c6=['\x0aChanges\x20to\x20\x27','errorCode','3kVVpeT','\x20=\x20','helpText','type','hasChanges','Site:\x20','dim','activations','journeyVersions','journeys','\x20unchanged\x20files','description','\x20activations','setPhase','verbose','\x20new\x20files','yellow','343924dPBAVf','session','333nMYAvY','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','message','resourceName','repeat','✔\x20Pulled\x20','green','dirname','error','\x20journeys','no_parent','26090wYEIzo','yes','name','segment','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','utf-8','\x20files\x20to\x20','diff','length','parentSegment','red','parentName','\x20segments','content','\x20changed\x20files','site','\x20versions)','Pulling\x20segments\x20from\x20\x27','1924EBIGKs','4468016RQbuRk','12836stmecl','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','absolutePath','isNew','\x0aPull\x20summary\x20for\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','counts','✔\x20Context\x20set:\x20','cwd','files','file','targetDir','cyan','\x20\x20🎯\x20','filter','20NUbxbF','Parent\x20segment:\x20','\x20\x20Target:\x20','3168440PgCAKA','2226710txQvrJ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','segments','execute','dryRun','6eBNitQ'];a30_0xfd00=function(){return _0xe232c6;};return a30_0xfd00();}