@treasuredata/tdx 0.16.2 → 0.16.4

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 (162) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.d.ts +3 -0
  25. package/dist/commands/mcp-command.d.ts.map +1 -1
  26. package/dist/commands/mcp-command.js +1 -1
  27. package/dist/commands/mcp-command.js.map +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/tables.js +1 -1
  43. package/dist/commands/unset-command.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/command-output.js +1 -1
  49. package/dist/core/config.js +1 -1
  50. package/dist/core/connection-cache.js +1 -1
  51. package/dist/core/constants.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.js +1 -1
  58. package/dist/core/user-cache.js +1 -1
  59. package/dist/core/version.js +1 -1
  60. package/dist/index.js +1 -1
  61. package/dist/mcp/server.js +1 -1
  62. package/dist/mcp/tools/index.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/anthropic-adapter.js +1 -1
  67. package/dist/proxy/claude-usage-tracker.js +1 -1
  68. package/dist/proxy/context-signature.js +1 -1
  69. package/dist/proxy/conversation-utils.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/api.js +1 -1
  83. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  84. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  85. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  86. package/dist/sdk/claude-agent/environment.d.ts +9 -0
  87. package/dist/sdk/claude-agent/environment.d.ts.map +1 -1
  88. package/dist/sdk/claude-agent/environment.js +1 -1
  89. package/dist/sdk/claude-agent/environment.js.map +1 -1
  90. package/dist/sdk/claude-agent/index.js +1 -1
  91. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  92. package/dist/sdk/client/cdp-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/rate-limiter.js +1 -1
  98. package/dist/sdk/client/td-api-client.js +1 -1
  99. package/dist/sdk/client/trino-api-client.js +1 -1
  100. package/dist/sdk/client/workflow-client.js +1 -1
  101. package/dist/sdk/connection-validator.js +1 -1
  102. package/dist/sdk/connection.js +1 -1
  103. package/dist/sdk/engage.js +1 -1
  104. package/dist/sdk/errors.js +1 -1
  105. package/dist/sdk/index.js +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/utils/async.js +1 -1
  148. package/dist/utils/colors.js +1 -1
  149. package/dist/utils/diff.js +1 -1
  150. package/dist/utils/file-permissions.js +1 -1
  151. package/dist/utils/json-loader.js +1 -1
  152. package/dist/utils/option-validation.js +1 -1
  153. package/dist/utils/port.js +1 -1
  154. package/dist/utils/process.js +1 -1
  155. package/dist/utils/prompt.js +1 -1
  156. package/dist/utils/spinner.js +1 -1
  157. package/dist/utils/sse-parser.js +1 -1
  158. package/dist/utils/string-utils.js +1 -1
  159. package/dist/utils/table-ref-parser.js +1 -1
  160. package/dist/utils/tdx-logger.js +1 -1
  161. package/dist/utils/version-check.js +1 -1
  162. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x2197db=a27_0x4947;(function(_0x1b4cf9,_0x219106){const _0x530ef6=a27_0x4947,_0x1452bd=_0x1b4cf9();while(!![]){try{const _0x2c3325=-parseInt(_0x530ef6(0xbc))/0x1+-parseInt(_0x530ef6(0xe2))/0x2+-parseInt(_0x530ef6(0x96))/0x3*(parseInt(_0x530ef6(0xdc))/0x4)+parseInt(_0x530ef6(0xe1))/0x5*(parseInt(_0x530ef6(0xca))/0x6)+parseInt(_0x530ef6(0xfb))/0x7+-parseInt(_0x530ef6(0xfc))/0x8+-parseInt(_0x530ef6(0x91))/0x9*(-parseInt(_0x530ef6(0xcc))/0xa);if(_0x2c3325===_0x219106)break;else _0x1452bd['push'](_0x1452bd['shift']());}catch(_0x23172f){_0x1452bd['push'](_0x1452bd['shift']());}}}(a27_0x5e46,0xce395));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a27_0x5e46(){const _0x43ebaa=['parentId','Resolved\x20relative\x20path\x20to:\x20','\x27\x20with\x20ID:\x20','format','segment:describe','Target\x20path:\x20','Executing\x20segment\x20query...','Parent\x20ID:\x20','parentFolder','getSegmentSQL','resolvePathToResource','Error:\x20','\x20\x20Folder\x20path:\x20','includes','2604tTUVCX','resolveParentId','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','140zXmXVq','1782718PqpFlo','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','jsonl','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','parent','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Fetching\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','cause','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','(root)','Examples:','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','folder','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Parent\x20segment:\x20','parentSegment','jobId','Resolving\x20path\x20\x27','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','verbose','2190216DGifTh','1069168XTSbeb','INVALID_ARGUMENT','Listing\x20folders\x20for\x20parent\x20\x27','replace','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','processedRows','green','✔\x20Found\x20','name','\x27...','log','Error:\x20Folder\x20reference\x20is\x20required','url','Resolved\x20parent\x20folder\x20ID:\x20','Use:\x20tdx\x20ps\x20view','segmentName','Parent\x20name:\x20','Fetching\x20folder\x20details...','Usage:\x20tdx\x20sg\x20show\x20<name>','type','message','listFolders','Use:\x20tdx\x20ps\x20show','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Segment\x20ID:\x20','Show\x20segment\x20folder\x20details','toLocaleString','Resolving\x20\x27','limit','elapsedTimeMillis','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','✔\x20Created\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','getFolder','\x20rows\x20','✖\x20Query\x20failed\x20[','in\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Resolving\x20folder\x20\x27','json','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Use:\x20tdx\x20ps\x20view\x20-w','segment:show','/app/ps/','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Get\x20SQL\x20query\x20for\x20child\x20segment','11623554zEIEDh','data','resolveFolderId','Fetching\x20segment\x20details...','folderPath','3633fDUooP','Usage:\x20tdx\x20sg\x20sql\x20<name>','Resolving\x20parent\x20folder\x20\x27','SEGMENT_NOT_FOUND','Resolving\x20parent\x20segment\x20\x27','createFolder','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','description','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20Cause:\x20','getParent','Error:\x20Path\x20or\x20name\x20is\x20required','test','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20desc','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','folderId','SQL\x20query:\x0a','fullPath','information_schema','web','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','code','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','site','execute','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20sql','\x20[Job\x20ID:\x20','trim','query','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment:folder:create','Show\x20folder\x20or\x20child\x20segment\x20details','setJobId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segmentId','1047265SKhYNg','length','error','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Fetching\x20parent\x20segment\x20details...','Resolved\x20type:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Site:\x20','segment:sql','getSegment','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Segment\x20name:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','173448rWVQZQ','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','20OtHCmR','\x20\x20Full\x20path:\x20'];a27_0x5e46=function(){return _0x43ebaa;};return a27_0x5e46();}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_0x4947(_0x5d427c,_0x3851fc){_0x5d427c=_0x5d427c-0x6c;const _0x5e46b1=a27_0x5e46();let _0x494723=_0x5e46b1[_0x5d427c];return _0x494723;}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_0x476a55 from'chalk';async function resolveSegmentTarget(_0x35530b,_0x4cf27b,_0x4666ad){const _0x1571ea=a27_0x4947;if(isYamlFilePath(_0x35530b))try{const _0x3b8992=await resolveYamlFilePath(_0x35530b);return _0x4666ad&&(console['error'](_0x1571ea(0x79)+_0x35530b),console['error']('\x20\x20Parent\x20segment:\x20'+_0x3b8992['parentSegment']),console[_0x1571ea(0xbe)](_0x1571ea(0xc8)+_0x3b8992[_0x1571ea(0x10b)]),console[_0x1571ea(0xbe)](_0x1571ea(0xda)+(_0x3b8992[_0x1571ea(0x95)]||_0x1571ea(0xf0))),console[_0x1571ea(0xbe)](_0x1571ea(0xcd)+_0x3b8992[_0x1571ea(0xa9)])),_0x3b8992[_0x1571ea(0xa9)];}catch(_0x938b66){throw new SDKError(ErrorCode[_0x1571ea(0xfd)],_0x1571ea(0xc3)+_0x938b66[_0x1571ea(0x6f)]);}if(!_0x4cf27b)throw new SDKError(ErrorCode[_0x1571ea(0xfd)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x4cf27b+'/'+_0x35530b;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0xd2);[a27_0x2197db(0x9d)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x2197db(0xb0)](_0x15015f){const _0x4dca11=a27_0x2197db,{options:_0x15fe73,args:_0x1c72e9,tdx:_0x33dfce}=_0x15015f,_0x5dd671=_0x1c72e9[0x0],_0x1fc3e9=!_0x5dd671&&!!_0x15fe73['parentSegment'],_0x25cfd2=_0x5dd671||_0x15fe73[_0x4dca11(0xf6)];if(!_0x25cfd2)return console[_0x4dca11(0xbe)](_0x4dca11(0xa2)),console[_0x4dca11(0xbe)](_0x4dca11(0x9f)),console[_0x4dca11(0xbe)](_0x4dca11(0xf1)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x4dca11(0xbe)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x4dca11(0xbe)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x4dca11(0x9c)),0x1;try{const _0x5e4ead=_0x15fe73['segmentPath'];let _0x2c059=_0x25cfd2;!_0x1fc3e9&&_0x5e4ead&&!_0x25cfd2[_0x4dca11(0xdb)]('/')&&(_0x2c059=_0x5e4ead+'/'+_0x25cfd2,_0x15fe73[_0x4dca11(0xfa)]&&console[_0x4dca11(0xbe)](_0x4dca11(0xcf)+_0x2c059));const _0x475ac9=await withSpinner(_0x4dca11(0xf8)+_0x2c059+_0x4dca11(0x105),()=>_0x33dfce[_0x4dca11(0x7c)]['resolvePathToResource'](_0x2c059),{'verbose':_0x15fe73[_0x4dca11(0xfa)]}),_0x419cef=_0x475ac9[_0x4dca11(0x92)];_0x15fe73['verbose']&&(console[_0x4dca11(0xbe)](_0x4dca11(0xc1)+_0x419cef['type']),console[_0x4dca11(0xbe)](_0x4dca11(0xd5)+_0x419cef[_0x4dca11(0xce)]),_0x419cef['folderId']&&console['error'](_0x4dca11(0xe5)+_0x419cef[_0x4dca11(0xa7)]),_0x419cef[_0x4dca11(0xbb)]&&console[_0x4dca11(0xbe)](_0x4dca11(0x73)+_0x419cef['segmentId']));if(_0x419cef['type']===_0x4dca11(0xe7)){const _0x4a6a78=await withSpinner(_0x4dca11(0xc0),()=>_0x33dfce['segment'][_0x4dca11(0xa1)](_0x419cef[_0x4dca11(0xce)]),{'verbose':_0x15fe73['verbose']});await handleSingleObjectOutput(_0x4a6a78['data'],_0x15fe73);}else{if(_0x419cef[_0x4dca11(0x6e)]===_0x4dca11(0xf3)){if(!_0x419cef[_0x4dca11(0xa7)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x14ed73=await withSpinner('Fetching\x20folder\x20details...',()=>_0x33dfce[_0x4dca11(0x7c)][_0x4dca11(0x81)](_0x419cef[_0x4dca11(0xa7)]),{'verbose':_0x15fe73['verbose']});await handleSingleObjectOutput(_0x14ed73[_0x4dca11(0x92)],_0x15fe73);}else{if(_0x419cef[_0x4dca11(0x6e)]===_0x4dca11(0x7c)){if(!_0x419cef[_0x4dca11(0xbb)])throw new SDKError(ErrorCode[_0x4dca11(0x99)],_0x4dca11(0x7f));const _0x29ace4=await withSpinner(_0x4dca11(0x94),()=>_0x33dfce['segment'][_0x4dca11(0xc6)](_0x419cef['parentId'],_0x419cef[_0x4dca11(0xbb)]),{'verbose':_0x15fe73[_0x4dca11(0xfa)]});await handleSingleObjectOutput(_0x29ace4[_0x4dca11(0x92)],_0x15fe73);}}}return 0x0;}catch(_0x21cf57){if(_0x21cf57 instanceof SDKError)return console['error'](_0x4dca11(0xd9)+_0x21cf57[_0x4dca11(0x6f)]),_0x21cf57[_0x4dca11(0xed)]&&console[_0x4dca11(0xbe)](_0x4dca11(0xa0)+_0x21cf57[_0x4dca11(0xed)]),0x1;throw _0x21cf57;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0x8d);['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x2197db(0xb0)](_0x16cff5){const _0x1552a9=a27_0x2197db,{options:_0x21c759,args:_0x3b7112,tdx:_0x2a6a02}=_0x16cff5,_0x4c568b=_0x3b7112[0x0];if(!_0x4c568b)return console[_0x1552a9(0xbe)](_0x1552a9(0xe8)),console[_0x1552a9(0xbe)](_0x1552a9(0x6d)),console[_0x1552a9(0xbe)](_0x1552a9(0xba)),console[_0x1552a9(0xbe)](_0x1552a9(0xf1)),console[_0x1552a9(0xbe)](_0x1552a9(0xef)),console[_0x1552a9(0xbe)](_0x1552a9(0xa4)),0x1;try{const _0x32dc15=_0x21c759[_0x1552a9(0xf6)],_0x2061ad=await resolveSegmentTarget(_0x4c568b,_0x32dc15,_0x21c759['verbose']);_0x21c759[_0x1552a9(0xfa)]&&console[_0x1552a9(0xbe)]('Target\x20path:\x20'+_0x2061ad);const _0x571603=await withSpinner(_0x1552a9(0x76)+_0x4c568b+_0x1552a9(0x105),()=>_0x2a6a02[_0x1552a9(0x7c)]['resolvePathToResource'](_0x2061ad),{'verbose':_0x21c759['verbose']}),_0x474d33=_0x571603[_0x1552a9(0x92)];_0x21c759['verbose']&&(console['error'](_0x1552a9(0xc1)+_0x474d33[_0x1552a9(0x6e)]),console[_0x1552a9(0xbe)](_0x1552a9(0xd5)+_0x474d33[_0x1552a9(0xce)]));if(_0x474d33['type']==='folder')return console[_0x1552a9(0xbe)](_0x1552a9(0xcb)),console[_0x1552a9(0xbe)](_0x1552a9(0xf9)),0x1;if(_0x474d33['type']===_0x1552a9(0xe7))return console[_0x1552a9(0xbe)](_0x1552a9(0xa6)),console[_0x1552a9(0xbe)](_0x1552a9(0x71)),0x1;if(!_0x474d33[_0x1552a9(0xbb)])throw new SDKError(ErrorCode[_0x1552a9(0x99)],_0x1552a9(0x7f));const _0xd895ae=await withSpinner(_0x1552a9(0x87),()=>_0x2a6a02['segment'][_0x1552a9(0xd7)](_0x474d33[_0x1552a9(0xce)],_0x474d33['segmentId']),{'verbose':_0x21c759[_0x1552a9(0xfa)]});let _0x49f8de=_0xd895ae[_0x1552a9(0x92)];const _0x578ec4=resolveLimit(_0x21c759[_0x1552a9(0x77)],DEFAULT_DISPLAY_LIMIT),_0x35eac5=/\bLIMIT\s+\d+/i[_0x1552a9(0xa3)](_0x49f8de);!_0x35eac5&&(_0x49f8de=_0x49f8de[_0x1552a9(0xb4)]()[_0x1552a9(0xff)](/;+$/,''),_0x49f8de='SELECT\x20*\x20FROM\x20(\x0a'+_0x49f8de+_0x1552a9(0xee)+_0x578ec4);_0x21c759['verbose']&&console['error'](_0x1552a9(0xa8)+_0x49f8de);const _0x29bccc=await withProgressSpinner(_0x1552a9(0xd4),async _0x2ace4e=>{const _0x291406=_0x1552a9,_0x3dc8ea=await _0x2a6a02[_0x291406(0xb5)]['execute'](_0x49f8de,{'catalog':'td','schema':_0x291406(0xaa),'onJobId':_0xa842d5=>{const _0x4c097e=_0x291406;_0x2ace4e[_0x4c097e(0xb9)](_0xa842d5);}});return _0x3dc8ea;},{'verbose':_0x21c759[_0x1552a9(0xfa)]}),_0x6b24e7=_0x29bccc[_0x1552a9(0x92)],_0x359681=_0x6b24e7[_0x1552a9(0xf7)]?_0x1552a9(0xb3)+_0x6b24e7[_0x1552a9(0xf7)]+']':'';return console[_0x1552a9(0xbe)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x6b24e7['stats'][_0x1552a9(0x101)][_0x1552a9(0x75)]()+_0x1552a9(0x82)+(_0x1552a9(0x84)+formatElapsed(_0x6b24e7['stats'][_0x1552a9(0x78)])+_0x359681)),await handleQueryOutput(_0x6b24e7,_0x21c759),0x0;}catch(_0xf62578){if(_0xf62578 instanceof SDKError)return console['error'](_0x1552a9(0x83)+_0xf62578[_0x1552a9(0xad)]+']'),console['error']('\x0a'+_0xf62578[_0x1552a9(0x6f)]),0x1;throw _0xf62578;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:folder:list';[a27_0x2197db(0x9d)]=a27_0x2197db(0x9e);async[a27_0x2197db(0xb0)](_0x10d283){const _0x48e6b9=a27_0x2197db,{options:_0x3180cc,args:_0xbbcee,tdx:_0x416021}=_0x10d283;if(_0xbbcee[_0x48e6b9(0xbd)]===0x0)return console[_0x48e6b9(0xbe)](_0x48e6b9(0x85)),console[_0x48e6b9(0xbe)](_0x48e6b9(0xdf)),0x1;const _0x3a318b=_0xbbcee[0x0];try{_0x3180cc[_0x48e6b9(0xfa)]&&(console['error'](_0x48e6b9(0xc4)+_0x3180cc[_0x48e6b9(0xaf)]),console[_0x48e6b9(0xbe)](_0x48e6b9(0x10c)+_0x3a318b));const _0x3ec682=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3a318b+_0x48e6b9(0x105),()=>_0x416021[_0x48e6b9(0x7c)][_0x48e6b9(0xdd)](_0x3a318b),{'verbose':_0x3180cc[_0x48e6b9(0xfa)]}),_0x321d96=_0x3ec682[_0x48e6b9(0x92)];_0x3180cc[_0x48e6b9(0xfa)]&&console[_0x48e6b9(0xbe)](_0x48e6b9(0xe6)+_0x321d96);const _0xd7fc6=await withSpinner(_0x48e6b9(0xfe)+_0x3a318b+_0x48e6b9(0x105),()=>_0x416021['segment'][_0x48e6b9(0x70)](_0x321d96),{'verbose':_0x3180cc[_0x48e6b9(0xfa)]}),_0x549662=_0xd7fc6[_0x48e6b9(0x92)];return console[_0x48e6b9(0xbe)](_0x48e6b9(0x103)+_0x549662['length']+'\x20folder'+(_0x549662['length']!==0x1?'s':'')),await handleSDKOutput(_0x549662,_0x3180cc),0x0;}catch(_0xced01b){if(_0xced01b instanceof SDKError)return console[_0x48e6b9(0xbe)]('Error:\x20'+_0xced01b[_0x48e6b9(0x6f)]),_0xced01b[_0x48e6b9(0xed)]&&console[_0x48e6b9(0xbe)]('\x20\x20Cause:\x20'+_0xced01b[_0x48e6b9(0xed)]),0x1;throw _0xced01b;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:folder:show';[a27_0x2197db(0x9d)]=a27_0x2197db(0x74);async['execute'](_0x9c84df){const _0x5086dc=a27_0x2197db,{options:_0x35b1b5,args:_0x3313cd,tdx:_0x66a397}=_0x9c84df;if(_0x3313cd[_0x5086dc(0xbd)]===0x0)return console[_0x5086dc(0xbe)](_0x5086dc(0x107)),console[_0x5086dc(0xbe)](_0x5086dc(0x7d)),0x1;try{const {parentId:_0x2b994c,childId:_0xab7273}=parseSegmentRef(_0x3313cd[0x0]);_0x35b1b5[_0x5086dc(0xfa)]&&(console[_0x5086dc(0xbe)](_0x5086dc(0xc4)+_0x35b1b5[_0x5086dc(0xaf)]),console[_0x5086dc(0xbe)](_0x5086dc(0x10c)+_0x2b994c),_0xab7273&&console[_0x5086dc(0xbe)]('Folder\x20name:\x20'+_0xab7273));if(!_0xab7273)return console['error'](_0x5086dc(0xe9)),0x1;const _0x2942a5=await withSpinner(_0x5086dc(0x9a)+_0x2b994c+_0x5086dc(0x105),()=>_0x66a397['segment']['resolveParentId'](_0x2b994c),{'verbose':_0x35b1b5[_0x5086dc(0xfa)]}),_0xa4c740=_0x2942a5['data'];_0x35b1b5[_0x5086dc(0xfa)]&&console['error'](_0x5086dc(0xe6)+_0xa4c740);const _0x338acd=await withSpinner(_0x5086dc(0x88)+_0xab7273+_0x5086dc(0x105),()=>_0x66a397[_0x5086dc(0x7c)][_0x5086dc(0x93)](_0xa4c740,_0xab7273),{'verbose':_0x35b1b5['verbose']}),_0x52323a=_0x338acd[_0x5086dc(0x92)];_0x35b1b5[_0x5086dc(0xfa)]&&console['error'](_0x5086dc(0x86)+_0x52323a);const _0x2062fa=await withSpinner(_0x5086dc(0xea)+_0xab7273+'\x27...',()=>_0x66a397['segment'][_0x5086dc(0x81)](_0x52323a),{'verbose':_0x35b1b5['verbose']});return await handleSDKOutput([_0x2062fa['data']],_0x35b1b5),0x0;}catch(_0x4cd9e0){if(_0x4cd9e0 instanceof SDKError)return console[_0x5086dc(0xbe)](_0x5086dc(0xd9)+_0x4cd9e0[_0x5086dc(0x6f)]),_0x4cd9e0[_0x5086dc(0xed)]&&console[_0x5086dc(0xbe)](_0x5086dc(0xa0)+_0x4cd9e0[_0x5086dc(0xed)]),0x1;throw _0x4cd9e0;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x2197db(0xc5);[a27_0x2197db(0x9d)]=a27_0x2197db(0x90);async[a27_0x2197db(0xb0)](_0x3510e2){const _0xda11c0=a27_0x2197db,{options:_0x9cb95b,args:_0x2b8646,tdx:_0x488912}=_0x3510e2,_0xc70c6c=_0x2b8646[0x0];if(!_0xc70c6c)return console['error'](_0xda11c0(0xe8)),console[_0xda11c0(0xbe)](_0xda11c0(0x97)),console[_0xda11c0(0xbe)](_0xda11c0(0xac)),console[_0xda11c0(0xbe)](_0xda11c0(0xf1)),console[_0xda11c0(0xbe)](_0xda11c0(0x8a)),console[_0xda11c0(0xbe)](_0xda11c0(0x8f)),0x1;try{const _0x33b2ab=_0x9cb95b[_0xda11c0(0xf6)],_0x376ca3=await resolveSegmentTarget(_0xc70c6c,_0x33b2ab,_0x9cb95b[_0xda11c0(0xfa)]);_0x9cb95b[_0xda11c0(0xfa)]&&console['error'](_0xda11c0(0xd3)+_0x376ca3);const _0x20454a=await withSpinner(_0xda11c0(0x76)+_0xc70c6c+'\x27...',()=>_0x488912[_0xda11c0(0x7c)][_0xda11c0(0xd8)](_0x376ca3),{'verbose':_0x9cb95b[_0xda11c0(0xfa)]}),_0x486f08=_0x20454a['data'];_0x9cb95b[_0xda11c0(0xfa)]&&(console[_0xda11c0(0xbe)](_0xda11c0(0xc1)+_0x486f08[_0xda11c0(0x6e)]),console[_0xda11c0(0xbe)](_0xda11c0(0xd5)+_0x486f08[_0xda11c0(0xce)]));if(_0x486f08[_0xda11c0(0x6e)]===_0xda11c0(0xf3))return console['error'](_0xda11c0(0xf4)),console[_0xda11c0(0xbe)](_0xda11c0(0x72)),0x1;if(_0x486f08[_0xda11c0(0x6e)]===_0xda11c0(0xe7))return console[_0xda11c0(0xbe)](_0xda11c0(0xe3)),console['error'](_0xda11c0(0xb2)),0x1;if(!_0x486f08[_0xda11c0(0xbb)])throw new SDKError(ErrorCode[_0xda11c0(0x99)],_0xda11c0(0x7f));const _0x2e2725=await withSpinner(_0xda11c0(0x87),()=>_0x488912[_0xda11c0(0x7c)][_0xda11c0(0xd7)](_0x486f08[_0xda11c0(0xce)],_0x486f08[_0xda11c0(0xbb)]),{'verbose':_0x9cb95b[_0xda11c0(0xfa)]}),_0x525ab2=_0x2e2725[_0xda11c0(0x92)];return _0x9cb95b['format']===_0xda11c0(0x89)||_0x9cb95b[_0xda11c0(0xd1)]===_0xda11c0(0xe4)?await handleSDKOutput([{'sql':_0x525ab2}],_0x9cb95b):console[_0xda11c0(0x106)](_0x525ab2),0x0;}catch(_0x136981){if(_0x136981 instanceof SDKError)return console[_0xda11c0(0xbe)](_0xda11c0(0xd9)+_0x136981[_0xda11c0(0x6f)]),_0x136981[_0xda11c0(0xed)]&&console['error'](_0xda11c0(0xa0)+_0x136981['cause']),0x1;throw _0x136981;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0xb7);[a27_0x2197db(0x9d)]='Create\x20segment\x20folder\x20for\x20organization';async[a27_0x2197db(0xb0)](_0x3f0283){const _0x258d4a=a27_0x2197db,{options:_0x359dd0,args:_0x3ad79a,tdx:_0x1660d1}=_0x3f0283,_0xb67f5a=_0x359dd0;if(_0x3ad79a[_0x258d4a(0xbd)]<0x2)return console[_0x258d4a(0xbe)](_0x258d4a(0xc2)),console['error'](_0x258d4a(0x100)),0x1;const _0x1819f9=_0x3ad79a[0x0],_0x29c9a7=_0x3ad79a[0x1];_0xb67f5a[_0x258d4a(0xfa)]&&(console['error'](_0x258d4a(0xc4)+_0xb67f5a[_0x258d4a(0xaf)]),console[_0x258d4a(0xbe)](_0x258d4a(0xf5)+_0x1819f9),console[_0x258d4a(0xbe)]('Folder\x20name:\x20'+_0x29c9a7));let _0x37b593;if(_0xb67f5a[_0x258d4a(0xd6)]){const _0x5311f7=_0xb67f5a['parentFolder'],_0x2c5900=await withSpinner(_0x258d4a(0x9a)+_0x1819f9+_0x258d4a(0x105),()=>_0x1660d1[_0x258d4a(0x7c)][_0x258d4a(0xdd)](_0x1819f9),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]}),_0x381ae6=_0x2c5900[_0x258d4a(0x92)],_0x46e7d1=await withSpinner(_0x258d4a(0x98)+_0x5311f7+_0x258d4a(0x105),()=>_0x1660d1[_0x258d4a(0x7c)][_0x258d4a(0x93)](_0x381ae6,_0x5311f7),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]});_0x37b593=_0x46e7d1[_0x258d4a(0x92)],_0xb67f5a['verbose']&&console[_0x258d4a(0xbe)](_0x258d4a(0x109)+_0x37b593);}const _0x37f961={'name':_0x29c9a7,'description':_0xb67f5a[_0x258d4a(0x9d)],'parentFolderId':_0x37b593},_0x453e8d=await withSpinner('Creating\x20folder\x20\x27'+_0x29c9a7+_0x258d4a(0x105),()=>_0x1660d1['segment'][_0x258d4a(0x9b)](_0x1819f9,_0x37f961),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]}),_0x25c0b1=_0x453e8d['data'];return console[_0x258d4a(0xbe)](_0x258d4a(0x7e)+_0x25c0b1[_0x258d4a(0x104)]+_0x258d4a(0xd0)+_0x25c0b1['id']),await handleSDKOutput([_0x25c0b1],_0xb67f5a),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:view';[a27_0x2197db(0x9d)]=a27_0x2197db(0xb8);async['execute'](_0x1ed5ed){const _0x365588=a27_0x2197db,{options:_0x4e0c7d,args:_0x363da3,tdx:_0x309c23}=_0x1ed5ed,_0x3e4212=_0x363da3[0x0];if(!_0x3e4212)return console[_0x365588(0xbe)](_0x365588(0xc7)),console['error'](_0x365588(0xbf)),console[_0x365588(0xbe)](_0x365588(0xec)),console[_0x365588(0xbe)]('Options:'),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x365588(0xbe)](_0x365588(0xf1)),console[_0x365588(0xbe)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x365588(0xbe)](_0x365588(0xae)),console[_0x365588(0xbe)](_0x365588(0xb6)),console[_0x365588(0xbe)](_0x365588(0xb1)),0x1;try{const _0x4eeb48=_0x4e0c7d[_0x365588(0xf6)],_0x54bc23=await resolveSegmentTarget(_0x3e4212,_0x4eeb48,_0x4e0c7d[_0x365588(0xfa)]);_0x4e0c7d[_0x365588(0xfa)]&&console[_0x365588(0xbe)](_0x365588(0xd3)+_0x54bc23);const _0x5c4d4f=await withSpinner(_0x365588(0x76)+_0x3e4212+_0x365588(0x105),()=>_0x309c23['segment']['resolvePathToResource'](_0x54bc23),{'verbose':_0x4e0c7d[_0x365588(0xfa)]}),_0x22374a=_0x5c4d4f[_0x365588(0x92)];_0x4e0c7d[_0x365588(0xfa)]&&(console[_0x365588(0xbe)](_0x365588(0xc1)+_0x22374a[_0x365588(0x6e)]),console[_0x365588(0xbe)](_0x365588(0xd5)+_0x22374a['parentId']),_0x22374a['folderId']&&console[_0x365588(0xbe)](_0x365588(0xe5)+_0x22374a[_0x365588(0xa7)]),_0x22374a[_0x365588(0xbb)]&&console[_0x365588(0xbe)](_0x365588(0x73)+_0x22374a[_0x365588(0xbb)]));if(_0x4e0c7d[_0x365588(0xab)]){if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xf3))return console['error']('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xe7))return console[_0x365588(0xbe)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x365588(0xbe)](_0x365588(0x8c)),0x1;if(!_0x22374a[_0x365588(0xbb)])throw new SDKError(ErrorCode[_0x365588(0x99)],_0x365588(0x7f));const _0x58cc54=getConsoleNextUrl(_0x4e0c7d[_0x365588(0xaf)],_0x365588(0x8e)+_0x22374a[_0x365588(0xce)]+'/e/'+_0x22374a['segmentId']);return console[_0x365588(0xbe)](a27_0x476a55[_0x365588(0x102)]('✔')+'\x20Opening\x20'+a27_0x476a55['cyan'](_0x58cc54)),openBrowser(_0x58cc54),0x0;}if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xf3)){if(!_0x22374a[_0x365588(0xa7)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x365588(0x7b));const _0xab0d6=await withSpinner(_0x365588(0x6c),()=>_0x309c23[_0x365588(0x7c)]['getFolder'](_0x22374a[_0x365588(0xa7)]),{'verbose':_0x4e0c7d[_0x365588(0xfa)]});await handleSingleObjectOutput(_0xab0d6[_0x365588(0x92)],_0x4e0c7d);}else{if(_0x22374a[_0x365588(0x6e)]==='segment'){if(!_0x22374a[_0x365588(0xbb)])throw new SDKError(ErrorCode[_0x365588(0x99)],_0x365588(0x7f));const _0x3d9b4c=await withSpinner('Fetching\x20segment\x20details...',()=>_0x309c23[_0x365588(0x7c)]['getSegment'](_0x22374a[_0x365588(0xce)],_0x22374a[_0x365588(0xbb)]),{'verbose':_0x4e0c7d[_0x365588(0xfa)]}),_0x52a4e7=getConsoleNextUrl(_0x4e0c7d['site'],_0x365588(0x8e)+_0x22374a['parentId']+'/e/'+_0x22374a['segmentId']),_0x257854=_0x3d9b4c[_0x365588(0x92)];_0x257854[_0x365588(0x108)]=_0x52a4e7,await handleSingleObjectOutput(_0x257854,_0x4e0c7d);}else return console[_0x365588(0xbe)](_0x365588(0x7a)),console['error'](_0x365588(0x10a)),0x1;}return 0x0;}catch(_0x5b059a){if(_0x5b059a instanceof SDKError)return console['error'](_0x365588(0xd9)+_0x5b059a[_0x365588(0x6f)]),_0x5b059a[_0x365588(0xed)]&&console[_0x365588(0xbe)](_0x365588(0xa0)+_0x5b059a['cause']),0x1;throw _0x5b059a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:desc';[a27_0x2197db(0x9d)]=a27_0x2197db(0xe0);async['execute'](_0x16525f){const _0xb5cc61=a27_0x2197db,{options:_0x3b103e,args:_0x5af98f,tdx:_0x25cc13}=_0x16525f,_0x2c9f4b=_0x5af98f[0x0];if(!_0x2c9f4b)return console['error'](_0xb5cc61(0xe8)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x8b)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xeb)),console['error'](_0xb5cc61(0xf1)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xde)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x80)),0x1;try{const _0x57a31a=_0x3b103e[_0xb5cc61(0xf6)],_0x58e8a4=await resolveSegmentTarget(_0x2c9f4b,_0x57a31a,_0x3b103e[_0xb5cc61(0xfa)]);_0x3b103e[_0xb5cc61(0xfa)]&&console['error'](_0xb5cc61(0xd3)+_0x58e8a4);const _0x2cd54f=await withSpinner(_0xb5cc61(0x76)+_0x2c9f4b+_0xb5cc61(0x105),()=>_0x25cc13['segment'][_0xb5cc61(0xd8)](_0x58e8a4),{'verbose':_0x3b103e[_0xb5cc61(0xfa)]}),_0x32f9ec=_0x2cd54f[_0xb5cc61(0x92)];_0x3b103e[_0xb5cc61(0xfa)]&&(console['error'](_0xb5cc61(0xc1)+_0x32f9ec[_0xb5cc61(0x6e)]),console['error'](_0xb5cc61(0xd5)+_0x32f9ec[_0xb5cc61(0xce)]));if(_0x32f9ec[_0xb5cc61(0x6e)]==='folder')return console['error'](_0xb5cc61(0xc9)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x72)),0x1;if(_0x32f9ec[_0xb5cc61(0x6e)]===_0xb5cc61(0xe7))return console[_0xb5cc61(0xbe)](_0xb5cc61(0xf2)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xa5)),0x1;if(!_0x32f9ec[_0xb5cc61(0xbb)])throw new SDKError(ErrorCode[_0xb5cc61(0x99)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2ab1a8=await withSpinner(_0xb5cc61(0x87),()=>_0x25cc13[_0xb5cc61(0x7c)][_0xb5cc61(0xd7)](_0x32f9ec['parentId'],_0x32f9ec[_0xb5cc61(0xbb)]),{'verbose':_0x3b103e['verbose']}),_0x1a8c64=_0x2ab1a8[_0xb5cc61(0x92)],_0x3a0dad=await executeSchemaQuery(_0x1a8c64,_0x25cc13,_0x3b103e);return await handleQueryOutput(_0x3a0dad,_0x3b103e),0x0;}catch(_0x1aaddb){if(_0x1aaddb instanceof SDKError)return console[_0xb5cc61(0xbe)](_0xb5cc61(0xd9)+_0x1aaddb[_0xb5cc61(0x6f)]),_0x1aaddb[_0xb5cc61(0xed)]&&console['error'](_0xb5cc61(0xa0)+_0x1aaddb[_0xb5cc61(0xed)]),0x1;throw _0x1aaddb;}}}
1
+ const a27_0x1f99ff=a27_0xbe89;(function(_0x184981,_0x25b6bc){const _0x279d5e=a27_0xbe89,_0x48d73b=_0x184981();while(!![]){try{const _0x3d4e7a=-parseInt(_0x279d5e(0x190))/0x1+-parseInt(_0x279d5e(0x1e1))/0x2*(parseInt(_0x279d5e(0x182))/0x3)+parseInt(_0x279d5e(0x17a))/0x4*(parseInt(_0x279d5e(0x1ca))/0x5)+-parseInt(_0x279d5e(0x1db))/0x6+-parseInt(_0x279d5e(0x1d4))/0x7*(parseInt(_0x279d5e(0x1b3))/0x8)+-parseInt(_0x279d5e(0x1bb))/0x9*(-parseInt(_0x279d5e(0x1df))/0xa)+parseInt(_0x279d5e(0x1b8))/0xb;if(_0x3d4e7a===_0x25b6bc)break;else _0x48d73b['push'](_0x48d73b['shift']());}catch(_0x463550){_0x48d73b['push'](_0x48d73b['shift']());}}}(a27_0x4bd5,0x441c1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a27_0xbe89(_0x55e1c3,_0x29cc1d){_0x55e1c3=_0x55e1c3-0x17a;const _0x4bd53a=a27_0x4bd5();let _0xbe8934=_0x4bd53a[_0x55e1c3];return _0xbe8934;}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';function a27_0x4bd5(){const _0x46ff28=['includes','segmentPath','\x27...','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','error','Parent\x20ID:\x20','Resolved\x20folder\x20ID:\x20','1124824oQZINa','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','folderId','format','getSegment','7461641iYrNoA','segment:folder:list','segment:desc','464994BlBrpS','code','SEGMENT_FOLDER_NOT_FOUND','segment:show','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Show\x20segment\x20folder\x20details','log','limit','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','setJobId','url','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Target\x20path:\x20','5OCzUbU','✔\x20Created\x20folder\x20\x27','folder','getFolder','Folder\x20name:\x20','Fetching\x20folder\x20\x27','SELECT\x20*\x20FROM\x20(\x0a','\x20rows\x20','SEGMENT_NOT_FOUND','createFolder','21uiPAUX','Options:','Folder\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Creating\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','882630MTHqnR','parentSegment','query','segment:folder:show','100EmFoRP','/e/','481654rBjXlv','site','green','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','parent','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','name','segment','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20Parent\x20segment:\x20','getSegmentSQL','jobId','parentFolder','Executing\x20segment\x20query...','Error:\x20Folder\x20reference\x20is\x20required','type','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','toLocaleString','Fetching\x20folder\x20details...','folderPath','resolveParentId','getParent','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20ps\x20sql','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','jsonl','cause','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','✔\x20Found\x20','description','information_schema','Show\x20segment\x20or\x20folder\x20details','Usage:\x20tdx\x20sg\x20desc\x20<name>','listFolders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Resolved\x20type:\x20','verbose','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Get\x20SQL\x20query\x20for\x20child\x20segment','Segment\x20ID:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Fetching\x20SQL\x20for\x20segment...','resolvePathToResource','242752xAusWu','elapsedTimeMillis','stats','Parent\x20name:\x20','Error:\x20','execute','length','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','3DLRzqx','Resolving\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:describe','✖\x20Query\x20failed\x20[','Fetching\x20parent\x20segment\x20details...','trim','message','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','segment:sql','INVALID_ARGUMENT','Resolved\x20parent\x20ID:\x20','166961FvHvqY','Use:\x20tdx\x20ps\x20desc','\x20[Job\x20ID:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Site:\x20','segmentId','resolveFolderId','replace','Use:\x20tdx\x20ps\x20view','fullPath','Listing\x20folders\x20for\x20parent\x20\x27','/app/ps/','Examples:','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','segment:view','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Resolving\x20parent\x20folder\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Show\x20child\x20segment\x20schema\x20(column\x20types)','Use:\x20tdx\x20ps\x20show','data','parentId','Resolved\x20YAML\x20file:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'];a27_0x4bd5=function(){return _0x46ff28;};return a27_0x4bd5();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x1450a5 from'chalk';async function resolveSegmentTarget(_0x39bf7d,_0x4ffd0e,_0x24750f){const _0x15c329=a27_0xbe89;if(isYamlFilePath(_0x39bf7d))try{const _0x47773b=await resolveYamlFilePath(_0x39bf7d);return _0x24750f&&(console[_0x15c329(0x1b0)](_0x15c329(0x1a8)+_0x39bf7d),console[_0x15c329(0x1b0)](_0x15c329(0x1ec)+_0x47773b[_0x15c329(0x1dc)]),console['error']('\x20\x20Segment\x20name:\x20'+_0x47773b['segmentName']),console[_0x15c329(0x1b0)]('\x20\x20Folder\x20path:\x20'+(_0x47773b[_0x15c329(0x1f6)]||'(root)')),console['error']('\x20\x20Full\x20path:\x20'+_0x47773b['fullPath'])),_0x47773b[_0x15c329(0x199)];}catch(_0x39dfad){throw new SDKError(ErrorCode[_0x15c329(0x18e)],_0x15c329(0x1fc)+_0x39dfad['message']);}if(!_0x4ffd0e)throw new SDKError(ErrorCode[_0x15c329(0x18e)],_0x15c329(0x1c8));return _0x4ffd0e+'/'+_0x39bf7d;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x1f99ff(0x1e7)]=a27_0x1f99ff(0x185);[a27_0x1f99ff(0x204)]=a27_0x1f99ff(0x206);async[a27_0x1f99ff(0x17f)](_0x5bbcff){const _0x3093fc=a27_0x1f99ff,{options:_0x52977d,args:_0x1f01a7,tdx:_0x13f340}=_0x5bbcff,_0x4dcafb=_0x1f01a7[0x0],_0x1a26e0=!_0x4dcafb&&!!_0x52977d[_0x3093fc(0x1dc)],_0x4768eb=_0x4dcafb||_0x52977d['parentSegment'];if(!_0x4768eb)return console[_0x3093fc(0x1b0)](_0x3093fc(0x210)),console[_0x3093fc(0x1b0)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x3093fc(0x1b0)](_0x3093fc(0x19c)),console[_0x3093fc(0x1b0)](_0x3093fc(0x1e4)),console[_0x3093fc(0x1b0)](_0x3093fc(0x201)),console['error'](_0x3093fc(0x181)),console[_0x3093fc(0x1b0)](_0x3093fc(0x1a1)),0x1;try{const _0x25736a=_0x52977d[_0x3093fc(0x1ad)];let _0x1c9063=_0x4768eb;!_0x1a26e0&&_0x25736a&&!_0x4768eb[_0x3093fc(0x1ac)]('/')&&(_0x1c9063=_0x25736a+'/'+_0x4768eb,_0x52977d[_0x3093fc(0x20b)]&&console[_0x3093fc(0x1b0)](_0x3093fc(0x19d)+_0x1c9063));const _0x941ab5=await withSpinner('Resolving\x20path\x20\x27'+_0x1c9063+_0x3093fc(0x1ae),()=>_0x13f340['segment']['resolvePathToResource'](_0x1c9063),{'verbose':_0x52977d[_0x3093fc(0x20b)]}),_0x568e50=_0x941ab5['data'];_0x52977d['verbose']&&(console[_0x3093fc(0x1b0)](_0x3093fc(0x20a)+_0x568e50[_0x3093fc(0x1f2)]),console[_0x3093fc(0x1b0)](_0x3093fc(0x1b1)+_0x568e50[_0x3093fc(0x1a7)]),_0x568e50['folderId']&&console['error'](_0x3093fc(0x1d6)+_0x568e50[_0x3093fc(0x1b5)]),_0x568e50[_0x3093fc(0x195)]&&console[_0x3093fc(0x1b0)](_0x3093fc(0x20f)+_0x568e50[_0x3093fc(0x195)]));if(_0x568e50[_0x3093fc(0x1f2)]===_0x3093fc(0x1e5)){const _0x56755b=await withSpinner(_0x3093fc(0x187),()=>_0x13f340['segment'][_0x3093fc(0x1f8)](_0x568e50[_0x3093fc(0x1a7)]),{'verbose':_0x52977d[_0x3093fc(0x20b)]});await handleSingleObjectOutput(_0x56755b[_0x3093fc(0x1a6)],_0x52977d);}else{if(_0x568e50[_0x3093fc(0x1f2)]==='folder'){if(!_0x568e50[_0x3093fc(0x1b5)])throw new SDKError(ErrorCode[_0x3093fc(0x1bd)],_0x3093fc(0x193));const _0x2bd164=await withSpinner('Fetching\x20folder\x20details...',()=>_0x13f340[_0x3093fc(0x1e8)][_0x3093fc(0x1cd)](_0x568e50[_0x3093fc(0x1b5)]),{'verbose':_0x52977d[_0x3093fc(0x20b)]});await handleSingleObjectOutput(_0x2bd164[_0x3093fc(0x1a6)],_0x52977d);}else{if(_0x568e50['type']===_0x3093fc(0x1e8)){if(!_0x568e50[_0x3093fc(0x195)])throw new SDKError(ErrorCode[_0x3093fc(0x1d2)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xb3bed8=await withSpinner('Fetching\x20segment\x20details...',()=>_0x13f340[_0x3093fc(0x1e8)][_0x3093fc(0x1b7)](_0x568e50[_0x3093fc(0x1a7)],_0x568e50[_0x3093fc(0x195)]),{'verbose':_0x52977d[_0x3093fc(0x20b)]});await handleSingleObjectOutput(_0xb3bed8[_0x3093fc(0x1a6)],_0x52977d);}}}return 0x0;}catch(_0x2afc4c){if(_0x2afc4c instanceof SDKError)return console[_0x3093fc(0x1b0)]('Error:\x20'+_0x2afc4c[_0x3093fc(0x189)]),_0x2afc4c[_0x3093fc(0x200)]&&console['error'](_0x3093fc(0x1c4)+_0x2afc4c[_0x3093fc(0x200)]),0x1;throw _0x2afc4c;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x1f99ff(0x1e7)]=a27_0x1f99ff(0x1be);[a27_0x1f99ff(0x204)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x1f99ff(0x17f)](_0x39b4ca){const _0x3ef4c5=a27_0x1f99ff,{options:_0x5d9b6e,args:_0xa8a78d,tdx:_0x2db86c}=_0x39b4ca,_0x15339e=_0xa8a78d[0x0];if(!_0x15339e)return console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x20c)),console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x1e9)),console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x209)),console[_0x3ef4c5(0x1b0)]('Examples:'),console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x19f)),console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x18c)),0x1;try{const _0x591b29=_0x5d9b6e['parentSegment'],_0xff3e4c=await resolveSegmentTarget(_0x15339e,_0x591b29,_0x5d9b6e[_0x3ef4c5(0x20b)]);_0x5d9b6e[_0x3ef4c5(0x20b)]&&console['error'](_0x3ef4c5(0x1c9)+_0xff3e4c);const _0x191686=await withSpinner('Resolving\x20\x27'+_0x15339e+_0x3ef4c5(0x1ae),()=>_0x2db86c[_0x3ef4c5(0x1e8)]['resolvePathToResource'](_0xff3e4c),{'verbose':_0x5d9b6e[_0x3ef4c5(0x20b)]}),_0x387fb3=_0x191686[_0x3ef4c5(0x1a6)];_0x5d9b6e[_0x3ef4c5(0x20b)]&&(console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x20a)+_0x387fb3[_0x3ef4c5(0x1f2)]),console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x1b1)+_0x387fb3['parentId']));if(_0x387fb3['type']===_0x3ef4c5(0x1cc))return console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x1ab)),console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x1a9)),0x1;if(_0x387fb3[_0x3ef4c5(0x1f2)]==='parent')return console['error'](_0x3ef4c5(0x1af)),console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x1a5)),0x1;if(!_0x387fb3['segmentId'])throw new SDKError(ErrorCode[_0x3ef4c5(0x1d2)],_0x3ef4c5(0x184));const _0x44af78=await withSpinner(_0x3ef4c5(0x212),()=>_0x2db86c[_0x3ef4c5(0x1e8)][_0x3ef4c5(0x1ed)](_0x387fb3[_0x3ef4c5(0x1a7)],_0x387fb3[_0x3ef4c5(0x195)]),{'verbose':_0x5d9b6e['verbose']});let _0x51d3d5=_0x44af78['data'];const _0x51e2ea=resolveLimit(_0x5d9b6e[_0x3ef4c5(0x1c3)],DEFAULT_DISPLAY_LIMIT),_0x479f01=/\bLIMIT\s+\d+/i['test'](_0x51d3d5);!_0x479f01&&(_0x51d3d5=_0x51d3d5[_0x3ef4c5(0x188)]()[_0x3ef4c5(0x197)](/;+$/,''),_0x51d3d5=_0x3ef4c5(0x1d0)+_0x51d3d5+_0x3ef4c5(0x18b)+_0x51e2ea);_0x5d9b6e[_0x3ef4c5(0x20b)]&&console['error']('SQL\x20query:\x0a'+_0x51d3d5);const _0x416ee4=await withProgressSpinner(_0x3ef4c5(0x1f0),async _0xc9cbf8=>{const _0xb26b6=_0x3ef4c5,_0x3f1ad1=await _0x2db86c[_0xb26b6(0x1dd)][_0xb26b6(0x17f)](_0x51d3d5,{'catalog':'td','schema':_0xb26b6(0x205),'onJobId':_0x233eab=>{const _0x5bfa86=_0xb26b6;_0xc9cbf8[_0x5bfa86(0x1c6)](_0x233eab);}});return _0x3f1ad1;},{'verbose':_0x5d9b6e[_0x3ef4c5(0x20b)]}),_0x12af51=_0x416ee4[_0x3ef4c5(0x1a6)],_0x4cee2c=_0x12af51['jobId']?_0x3ef4c5(0x192)+_0x12af51[_0x3ef4c5(0x1ee)]+']':'';return console[_0x3ef4c5(0x1b0)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x12af51[_0x3ef4c5(0x17c)]['processedRows'][_0x3ef4c5(0x1f4)]()+_0x3ef4c5(0x1d1)+('in\x20'+formatElapsed(_0x12af51[_0x3ef4c5(0x17c)][_0x3ef4c5(0x17b)])+_0x4cee2c)),await handleQueryOutput(_0x12af51,_0x5d9b6e),0x0;}catch(_0x1c7231){if(_0x1c7231 instanceof SDKError)return console[_0x3ef4c5(0x1b0)](_0x3ef4c5(0x186)+_0x1c7231[_0x3ef4c5(0x1bc)]+']'),console['error']('\x0a'+_0x1c7231[_0x3ef4c5(0x189)]),0x1;throw _0x1c7231;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x1f99ff(0x1b9);[a27_0x1f99ff(0x204)]=a27_0x1f99ff(0x1e6);async[a27_0x1f99ff(0x17f)](_0x30c372){const _0x1db081=a27_0x1f99ff,{options:_0x3f3b49,args:_0x4d0216,tdx:_0x259c48}=_0x30c372;if(_0x4d0216['length']===0x0)return console[_0x1db081(0x1b0)](_0x1db081(0x1bf)),console[_0x1db081(0x1b0)](_0x1db081(0x1c5)),0x1;const _0x29a6a9=_0x4d0216[0x0];try{_0x3f3b49['verbose']&&(console[_0x1db081(0x1b0)](_0x1db081(0x194)+_0x3f3b49['site']),console[_0x1db081(0x1b0)](_0x1db081(0x17d)+_0x29a6a9));const _0x2b4dbd=await withSpinner(_0x1db081(0x1f9)+_0x29a6a9+_0x1db081(0x1ae),()=>_0x259c48[_0x1db081(0x1e8)][_0x1db081(0x1f7)](_0x29a6a9),{'verbose':_0x3f3b49['verbose']}),_0x15bd6f=_0x2b4dbd[_0x1db081(0x1a6)];_0x3f3b49[_0x1db081(0x20b)]&&console['error'](_0x1db081(0x18f)+_0x15bd6f);const _0x17f25d=await withSpinner(_0x1db081(0x19a)+_0x29a6a9+_0x1db081(0x1ae),()=>_0x259c48[_0x1db081(0x1e8)][_0x1db081(0x208)](_0x15bd6f),{'verbose':_0x3f3b49['verbose']}),_0x8ced86=_0x17f25d[_0x1db081(0x1a6)];return console[_0x1db081(0x1b0)](_0x1db081(0x203)+_0x8ced86[_0x1db081(0x180)]+'\x20folder'+(_0x8ced86[_0x1db081(0x180)]!==0x1?'s':'')),await handleSDKOutput(_0x8ced86,_0x3f3b49),0x0;}catch(_0x104866){if(_0x104866 instanceof SDKError)return console[_0x1db081(0x1b0)](_0x1db081(0x17e)+_0x104866[_0x1db081(0x189)]),_0x104866[_0x1db081(0x200)]&&console[_0x1db081(0x1b0)](_0x1db081(0x1c4)+_0x104866[_0x1db081(0x200)]),0x1;throw _0x104866;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x1f99ff(0x1e7)]=a27_0x1f99ff(0x1de);[a27_0x1f99ff(0x204)]=a27_0x1f99ff(0x1c1);async[a27_0x1f99ff(0x17f)](_0x5f4291){const _0x26bc25=a27_0x1f99ff,{options:_0x5bdde9,args:_0x210d7b,tdx:_0x38f05e}=_0x5f4291;if(_0x210d7b[_0x26bc25(0x180)]===0x0)return console['error'](_0x26bc25(0x1f1)),console['error'](_0x26bc25(0x1fd)),0x1;try{const {parentId:_0xf32b2a,childId:_0x2eb4d5}=parseSegmentRef(_0x210d7b[0x0]);_0x5bdde9[_0x26bc25(0x20b)]&&(console['error'](_0x26bc25(0x194)+_0x5bdde9[_0x26bc25(0x1e2)]),console[_0x26bc25(0x1b0)]('Parent\x20name:\x20'+_0xf32b2a),_0x2eb4d5&&console[_0x26bc25(0x1b0)](_0x26bc25(0x1ce)+_0x2eb4d5));if(!_0x2eb4d5)return console[_0x26bc25(0x1b0)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x3c5ff7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf32b2a+'\x27...',()=>_0x38f05e[_0x26bc25(0x1e8)][_0x26bc25(0x1f7)](_0xf32b2a),{'verbose':_0x5bdde9[_0x26bc25(0x20b)]}),_0x465d8e=_0x3c5ff7[_0x26bc25(0x1a6)];_0x5bdde9[_0x26bc25(0x20b)]&&console['error'](_0x26bc25(0x18f)+_0x465d8e);const _0x5d8d74=await withSpinner('Resolving\x20folder\x20\x27'+_0x2eb4d5+_0x26bc25(0x1ae),()=>_0x38f05e[_0x26bc25(0x1e8)][_0x26bc25(0x196)](_0x465d8e,_0x2eb4d5),{'verbose':_0x5bdde9[_0x26bc25(0x20b)]}),_0x2ee47e=_0x5d8d74['data'];_0x5bdde9[_0x26bc25(0x20b)]&&console['error'](_0x26bc25(0x1b2)+_0x2ee47e);const _0x394b39=await withSpinner(_0x26bc25(0x1cf)+_0x2eb4d5+_0x26bc25(0x1ae),()=>_0x38f05e[_0x26bc25(0x1e8)]['getFolder'](_0x2ee47e),{'verbose':_0x5bdde9[_0x26bc25(0x20b)]});return await handleSDKOutput([_0x394b39[_0x26bc25(0x1a6)]],_0x5bdde9),0x0;}catch(_0x238418){if(_0x238418 instanceof SDKError)return console['error'](_0x26bc25(0x17e)+_0x238418[_0x26bc25(0x189)]),_0x238418[_0x26bc25(0x200)]&&console['error'](_0x26bc25(0x1c4)+_0x238418[_0x26bc25(0x200)]),0x1;throw _0x238418;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x1f99ff(0x1e7)]=a27_0x1f99ff(0x18d);[a27_0x1f99ff(0x204)]=a27_0x1f99ff(0x20e);async[a27_0x1f99ff(0x17f)](_0x2df9af){const _0x38787e=a27_0x1f99ff,{options:_0x91dc2e,args:_0x4e262f,tdx:_0x51ef4a}=_0x2df9af,_0x135b6a=_0x4e262f[0x0];if(!_0x135b6a)return console[_0x38787e(0x1b0)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x38787e(0x1b0)](_0x38787e(0x211)),console[_0x38787e(0x1b0)](_0x38787e(0x19c)),console[_0x38787e(0x1b0)](_0x38787e(0x1f3)),console[_0x38787e(0x1b0)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x1a7581=_0x91dc2e[_0x38787e(0x1dc)],_0x14f6cd=await resolveSegmentTarget(_0x135b6a,_0x1a7581,_0x91dc2e[_0x38787e(0x20b)]);_0x91dc2e[_0x38787e(0x20b)]&&console['error'](_0x38787e(0x1c9)+_0x14f6cd);const _0xb30847=await withSpinner(_0x38787e(0x183)+_0x135b6a+_0x38787e(0x1ae),()=>_0x51ef4a[_0x38787e(0x1e8)]['resolvePathToResource'](_0x14f6cd),{'verbose':_0x91dc2e[_0x38787e(0x20b)]}),_0x449178=_0xb30847[_0x38787e(0x1a6)];_0x91dc2e[_0x38787e(0x20b)]&&(console[_0x38787e(0x1b0)](_0x38787e(0x20a)+_0x449178[_0x38787e(0x1f2)]),console[_0x38787e(0x1b0)](_0x38787e(0x1b1)+_0x449178['parentId']));if(_0x449178[_0x38787e(0x1f2)]===_0x38787e(0x1cc))return console[_0x38787e(0x1b0)](_0x38787e(0x1aa)),console[_0x38787e(0x1b0)](_0x38787e(0x18a)),0x1;if(_0x449178[_0x38787e(0x1f2)]===_0x38787e(0x1e5))return console[_0x38787e(0x1b0)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x38787e(0x1b0)](_0x38787e(0x1fb)),0x1;if(!_0x449178[_0x38787e(0x195)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x38787e(0x184));const _0x441460=await withSpinner(_0x38787e(0x212),()=>_0x51ef4a[_0x38787e(0x1e8)][_0x38787e(0x1ed)](_0x449178['parentId'],_0x449178[_0x38787e(0x195)]),{'verbose':_0x91dc2e[_0x38787e(0x20b)]}),_0x320230=_0x441460['data'];return _0x91dc2e[_0x38787e(0x1b6)]==='json'||_0x91dc2e[_0x38787e(0x1b6)]===_0x38787e(0x1ff)?await handleSDKOutput([{'sql':_0x320230}],_0x91dc2e):console[_0x38787e(0x1c2)](_0x320230),0x0;}catch(_0x391c50){if(_0x391c50 instanceof SDKError)return console[_0x38787e(0x1b0)](_0x38787e(0x17e)+_0x391c50[_0x38787e(0x189)]),_0x391c50['cause']&&console[_0x38787e(0x1b0)]('\x20\x20Cause:\x20'+_0x391c50[_0x38787e(0x200)]),0x1;throw _0x391c50;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x1f99ff(0x1e7)]='segment:folder:create';[a27_0x1f99ff(0x204)]='Create\x20segment\x20folder\x20for\x20organization';async[a27_0x1f99ff(0x17f)](_0x40645e){const _0x522699=a27_0x1f99ff,{options:_0x494ed0,args:_0x361e84,tdx:_0xe9e4f9}=_0x40645e,_0x55be5e=_0x494ed0;if(_0x361e84[_0x522699(0x180)]<0x2)return console[_0x522699(0x1b0)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x522699(0x1d8)),0x1;const _0x4f32d6=_0x361e84[0x0],_0x19a950=_0x361e84[0x1];_0x55be5e[_0x522699(0x20b)]&&(console[_0x522699(0x1b0)](_0x522699(0x194)+_0x55be5e[_0x522699(0x1e2)]),console[_0x522699(0x1b0)]('Parent\x20segment:\x20'+_0x4f32d6),console['error'](_0x522699(0x1ce)+_0x19a950));let _0x36d4c0;if(_0x55be5e[_0x522699(0x1ef)]){const _0x678b6f=_0x55be5e[_0x522699(0x1ef)],_0x1f36bc=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4f32d6+_0x522699(0x1ae),()=>_0xe9e4f9[_0x522699(0x1e8)]['resolveParentId'](_0x4f32d6),{'verbose':_0x55be5e['verbose']}),_0x4e77d8=_0x1f36bc[_0x522699(0x1a6)],_0x44b3d8=await withSpinner(_0x522699(0x1a2)+_0x678b6f+_0x522699(0x1ae),()=>_0xe9e4f9[_0x522699(0x1e8)][_0x522699(0x196)](_0x4e77d8,_0x678b6f),{'verbose':_0x55be5e[_0x522699(0x20b)]});_0x36d4c0=_0x44b3d8[_0x522699(0x1a6)],_0x55be5e[_0x522699(0x20b)]&&console[_0x522699(0x1b0)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x36d4c0);}const _0x106caa={'name':_0x19a950,'description':_0x55be5e[_0x522699(0x204)],'parentFolderId':_0x36d4c0},_0xccfb15=await withSpinner(_0x522699(0x1d9)+_0x19a950+'\x27...',()=>_0xe9e4f9['segment'][_0x522699(0x1d3)](_0x4f32d6,_0x106caa),{'verbose':_0x55be5e[_0x522699(0x20b)]}),_0x1d0128=_0xccfb15[_0x522699(0x1a6)];return console[_0x522699(0x1b0)](_0x522699(0x1cb)+_0x1d0128[_0x522699(0x1e7)]+'\x27\x20with\x20ID:\x20'+_0x1d0128['id']),await handleSDKOutput([_0x1d0128],_0x55be5e),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a27_0x1f99ff(0x1a0);[a27_0x1f99ff(0x204)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a27_0x1f99ff(0x17f)](_0x298858){const _0x192b5b=a27_0x1f99ff,{options:_0x354ac7,args:_0x2249a0,tdx:_0x4b833b}=_0x298858,_0x5390c4=_0x2249a0[0x0];if(!_0x5390c4)return console[_0x192b5b(0x1b0)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x192b5b(0x1b0)](_0x192b5b(0x1da)),console[_0x192b5b(0x1b0)](_0x192b5b(0x1ea)),console[_0x192b5b(0x1b0)](_0x192b5b(0x1d5)),console[_0x192b5b(0x1b0)](_0x192b5b(0x1a3)),console[_0x192b5b(0x1b0)]('Examples:'),console[_0x192b5b(0x1b0)](_0x192b5b(0x1b4)),console[_0x192b5b(0x1b0)](_0x192b5b(0x1fe)),console[_0x192b5b(0x1b0)](_0x192b5b(0x1c0)),console[_0x192b5b(0x1b0)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x9de4c7=_0x354ac7[_0x192b5b(0x1dc)],_0x50d456=await resolveSegmentTarget(_0x5390c4,_0x9de4c7,_0x354ac7['verbose']);_0x354ac7['verbose']&&console['error'](_0x192b5b(0x1c9)+_0x50d456);const _0x475d3c=await withSpinner(_0x192b5b(0x183)+_0x5390c4+_0x192b5b(0x1ae),()=>_0x4b833b['segment'][_0x192b5b(0x213)](_0x50d456),{'verbose':_0x354ac7['verbose']}),_0x121025=_0x475d3c[_0x192b5b(0x1a6)];_0x354ac7['verbose']&&(console[_0x192b5b(0x1b0)]('Resolved\x20type:\x20'+_0x121025[_0x192b5b(0x1f2)]),console['error'](_0x192b5b(0x1b1)+_0x121025[_0x192b5b(0x1a7)]),_0x121025['folderId']&&console['error'](_0x192b5b(0x1d6)+_0x121025[_0x192b5b(0x1b5)]),_0x121025['segmentId']&&console['error'](_0x192b5b(0x20f)+_0x121025[_0x192b5b(0x195)]));if(_0x354ac7['web']){if(_0x121025[_0x192b5b(0x1f2)]===_0x192b5b(0x1cc))return console['error'](_0x192b5b(0x1fa)),0x1;if(_0x121025['type']===_0x192b5b(0x1e5))return console[_0x192b5b(0x1b0)](_0x192b5b(0x1d7)),console[_0x192b5b(0x1b0)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x121025[_0x192b5b(0x195)])throw new SDKError(ErrorCode[_0x192b5b(0x1d2)],_0x192b5b(0x184));const _0x595601=getConsoleNextUrl(_0x354ac7[_0x192b5b(0x1e2)],_0x192b5b(0x19b)+_0x121025['parentId']+_0x192b5b(0x1e0)+_0x121025[_0x192b5b(0x195)]);return console[_0x192b5b(0x1b0)](a27_0x1450a5[_0x192b5b(0x1e3)]('✔')+'\x20Opening\x20'+a27_0x1450a5['cyan'](_0x595601)),openBrowser(_0x595601),0x0;}if(_0x121025[_0x192b5b(0x1f2)]===_0x192b5b(0x1cc)){if(!_0x121025[_0x192b5b(0x1b5)])throw new SDKError(ErrorCode[_0x192b5b(0x1bd)],_0x192b5b(0x193));const _0x186b0a=await withSpinner(_0x192b5b(0x1f5),()=>_0x4b833b['segment']['getFolder'](_0x121025[_0x192b5b(0x1b5)]),{'verbose':_0x354ac7[_0x192b5b(0x20b)]});await handleSingleObjectOutput(_0x186b0a[_0x192b5b(0x1a6)],_0x354ac7);}else{if(_0x121025[_0x192b5b(0x1f2)]==='segment'){if(!_0x121025[_0x192b5b(0x195)])throw new SDKError(ErrorCode[_0x192b5b(0x1d2)],_0x192b5b(0x184));const _0x3ae488=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4b833b[_0x192b5b(0x1e8)]['getSegment'](_0x121025['parentId'],_0x121025[_0x192b5b(0x195)]),{'verbose':_0x354ac7['verbose']}),_0x4d1d2d=getConsoleNextUrl(_0x354ac7[_0x192b5b(0x1e2)],'/app/ps/'+_0x121025[_0x192b5b(0x1a7)]+'/e/'+_0x121025[_0x192b5b(0x195)]),_0x3819e1=_0x3ae488[_0x192b5b(0x1a6)];_0x3819e1[_0x192b5b(0x1c7)]=_0x4d1d2d,await handleSingleObjectOutput(_0x3819e1,_0x354ac7);}else return console[_0x192b5b(0x1b0)](_0x192b5b(0x20d)),console[_0x192b5b(0x1b0)](_0x192b5b(0x198)),0x1;}return 0x0;}catch(_0x2991ae){if(_0x2991ae instanceof SDKError)return console[_0x192b5b(0x1b0)](_0x192b5b(0x17e)+_0x2991ae[_0x192b5b(0x189)]),_0x2991ae[_0x192b5b(0x200)]&&console[_0x192b5b(0x1b0)]('\x20\x20Cause:\x20'+_0x2991ae[_0x192b5b(0x200)]),0x1;throw _0x2991ae;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x1f99ff(0x1e7)]=a27_0x1f99ff(0x1ba);[a27_0x1f99ff(0x204)]=a27_0x1f99ff(0x1a4);async[a27_0x1f99ff(0x17f)](_0x521bd9){const _0x3f0914=a27_0x1f99ff,{options:_0x51d298,args:_0x35b98b,tdx:_0x29dfb9}=_0x521bd9,_0x19900b=_0x35b98b[0x0];if(!_0x19900b)return console[_0x3f0914(0x1b0)](_0x3f0914(0x20c)),console[_0x3f0914(0x1b0)](_0x3f0914(0x207)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x3f0914(0x1b0)](_0x3f0914(0x19c)),console[_0x3f0914(0x1b0)](_0x3f0914(0x202)),console[_0x3f0914(0x1b0)](_0x3f0914(0x19e)),0x1;try{const _0x4b7cad=_0x51d298[_0x3f0914(0x1dc)],_0x15e04a=await resolveSegmentTarget(_0x19900b,_0x4b7cad,_0x51d298[_0x3f0914(0x20b)]);_0x51d298[_0x3f0914(0x20b)]&&console[_0x3f0914(0x1b0)]('Target\x20path:\x20'+_0x15e04a);const _0xa256d8=await withSpinner(_0x3f0914(0x183)+_0x19900b+_0x3f0914(0x1ae),()=>_0x29dfb9[_0x3f0914(0x1e8)][_0x3f0914(0x213)](_0x15e04a),{'verbose':_0x51d298[_0x3f0914(0x20b)]}),_0x3bc9d1=_0xa256d8['data'];_0x51d298[_0x3f0914(0x20b)]&&(console[_0x3f0914(0x1b0)]('Resolved\x20type:\x20'+_0x3bc9d1[_0x3f0914(0x1f2)]),console['error'](_0x3f0914(0x1b1)+_0x3bc9d1[_0x3f0914(0x1a7)]));if(_0x3bc9d1[_0x3f0914(0x1f2)]===_0x3f0914(0x1cc))return console['error'](_0x3f0914(0x1eb)),console['error'](_0x3f0914(0x18a)),0x1;if(_0x3bc9d1[_0x3f0914(0x1f2)]==='parent')return console[_0x3f0914(0x1b0)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x3f0914(0x191)),0x1;if(!_0x3bc9d1[_0x3f0914(0x195)])throw new SDKError(ErrorCode[_0x3f0914(0x1d2)],_0x3f0914(0x184));const _0x32200a=await withSpinner(_0x3f0914(0x212),()=>_0x29dfb9[_0x3f0914(0x1e8)][_0x3f0914(0x1ed)](_0x3bc9d1[_0x3f0914(0x1a7)],_0x3bc9d1['segmentId']),{'verbose':_0x51d298[_0x3f0914(0x20b)]}),_0x4e5d44=_0x32200a['data'],_0x14127e=await executeSchemaQuery(_0x4e5d44,_0x29dfb9,_0x51d298);return await handleQueryOutput(_0x14127e,_0x51d298),0x0;}catch(_0x444d2e){if(_0x444d2e instanceof SDKError)return console[_0x3f0914(0x1b0)](_0x3f0914(0x17e)+_0x444d2e[_0x3f0914(0x189)]),_0x444d2e[_0x3f0914(0x200)]&&console['error'](_0x3f0914(0x1c4)+_0x444d2e['cause']),0x1;throw _0x444d2e;}}}
@@ -1 +1 @@
1
- const a28_0x22317a=a28_0x3721;function a28_0x524a(){const _0x526474=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolved\x20folder\x20ID:\x20','execute','2430696pmeqnc','data','Resolving\x20parent\x20segment\x20\x27','folderId','resolveFolderId','Create\x20child\x20segment\x20with\x20filtering\x20rules','8999DlnSBQ','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folder','error','segment','resolveParentId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','name','Target\x20path:\x20','404570nuIBsO','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','3675261HaVppF','verbose','type','1289796xKzvbw','21pRpfWs','invisible','segments','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','5000140EXaExX','length','createSegment','Resolving\x20folder\x20path\x20\x27','\x27...','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','yellow','segmentPath','kind','24472737WUnlPS','10xRjvqs','Parent\x20path:\x20','Resolved\x20relative\x20path\x20to:\x20','description','Site:\x20','Resolving\x20folder\x20\x27','rule','62hctSZK','parent','noCountPopulation'];a28_0x524a=function(){return _0x526474;};return a28_0x524a();}function a28_0x3721(_0x32cae5,_0xf15c51){_0x32cae5=_0x32cae5-0x99;const _0x524a49=a28_0x524a();let _0x3721b5=_0x524a49[_0x32cae5];return _0x3721b5;}(function(_0x1d4231,_0x896bfd){const _0x5fba5=a28_0x3721,_0x52ca3f=_0x1d4231();while(!![]){try{const _0x55f486=-parseInt(_0x5fba5(0xb8))/0x1*(-parseInt(_0x5fba5(0xac))/0x2)+parseInt(_0x5fba5(0xc6))/0x3+parseInt(_0x5fba5(0x9b))/0x4+parseInt(_0x5fba5(0xc3))/0x5+-parseInt(_0x5fba5(0xc9))/0x6+-parseInt(_0x5fba5(0xca))/0x7*(-parseInt(_0x5fba5(0xb2))/0x8)+parseInt(_0x5fba5(0xa4))/0x9*(-parseInt(_0x5fba5(0xa5))/0xa);if(_0x55f486===_0x896bfd)break;else _0x52ca3f['push'](_0x52ca3f['shift']());}catch(_0x8e269){_0x52ca3f['push'](_0x52ca3f['shift']());}}}(a28_0x524a,0xc6545));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_0x20e808 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x22317a(0xc1)]='segment:create';['description']=a28_0x22317a(0xb7);async[a28_0x22317a(0xb1)](_0x566f38){const _0x22456d=a28_0x22317a;console[_0x22456d(0xbb)](a28_0x20e808['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x22456d(0xbb)](a28_0x20e808[_0x22456d(0xa1)](_0x22456d(0xa0)));const {options:_0x30f7f1,args:_0x1f35ef,tdx:_0xfddde0}=_0x566f38,_0x51247b=_0x30f7f1;if(_0x1f35ef[_0x22456d(0x9c)]===0x0)return console[_0x22456d(0xbb)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x22456d(0xbb)](_0x22456d(0xc0)),console[_0x22456d(0xbb)]('Examples:'),console[_0x22456d(0xbb)](_0x22456d(0xbf)),console['error'](_0x22456d(0xaf)),console[_0x22456d(0xbb)](_0x22456d(0xc4)),0x1;const _0x4d2179=_0x1f35ef[0x0],_0x4e1ee0=_0x30f7f1[_0x22456d(0xa2)];let _0x244763=_0x4d2179;_0x4e1ee0&&!_0x4d2179[_0x22456d(0xc5)]('/')&&(_0x244763=_0x4e1ee0+'/'+_0x4d2179,_0x51247b[_0x22456d(0xc7)]&&console[_0x22456d(0xbb)](_0x22456d(0xa7)+_0x244763));const _0x3e686e=parsePath(_0x244763);if(_0x3e686e[_0x22456d(0x99)]['length']<0x2)return console[_0x22456d(0xbb)](_0x22456d(0x9a)),console[_0x22456d(0xbb)](_0x22456d(0xb9)),0x1;const _0x5bfb4f=_0x3e686e['segments'][0x0],_0x4efa71=getBaseName(_0x244763),_0x10c945=getParentPath(_0x244763);_0x51247b[_0x22456d(0xc7)]&&(console[_0x22456d(0xbb)](_0x22456d(0xa9)+_0x51247b['site']),console[_0x22456d(0xbb)](_0x22456d(0xc2)+_0x244763),console[_0x22456d(0xbb)]('Parent:\x20'+_0x5bfb4f),console[_0x22456d(0xbb)]('Segment\x20name:\x20'+_0x4efa71),console[_0x22456d(0xbb)](_0x22456d(0xa6)+_0x10c945));const _0x4c4aa7=await withSpinner(_0x22456d(0xb4)+_0x5bfb4f+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0xbd)](_0x5bfb4f),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x2415e7=_0x4c4aa7[_0x22456d(0xb3)];let _0x3cdf54;if(_0x3e686e[_0x22456d(0x99)]['length']>0x2){const _0x3d2d23=await withSpinner(_0x22456d(0x9e)+_0x10c945+'\x27...',()=>_0xfddde0[_0x22456d(0xbc)]['resolvePathToResource'](_0x10c945),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x5860f2=_0x3d2d23[_0x22456d(0xb3)];if(_0x5860f2[_0x22456d(0xc8)]!=='folder'&&_0x5860f2[_0x22456d(0xc8)]!==_0x22456d(0xad))return console[_0x22456d(0xbb)](_0x22456d(0xbe)),0x1;_0x3cdf54=_0x5860f2[_0x22456d(0xb5)];}else{if(_0x51247b['folder']){const _0x10b910=await withSpinner(_0x22456d(0xaa)+_0x51247b[_0x22456d(0xba)]+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0xb6)](_0x2415e7,_0x51247b[_0x22456d(0xba)]),{'verbose':_0x51247b['verbose']});_0x3cdf54=_0x10b910['data'];}}_0x51247b[_0x22456d(0xc7)]&&_0x3cdf54&&console[_0x22456d(0xbb)](_0x22456d(0xb0)+_0x3cdf54);const _0x1f40b2=await loadJSONFromOptions(_0x51247b[_0x22456d(0xab)],_0x51247b['ruleFile']),_0x182694={'name':_0x4efa71,'description':_0x51247b[_0x22456d(0xa8)],'rule':_0x1f40b2,'kind':_0x51247b[_0x22456d(0xa3)]!==undefined?parseInt(_0x51247b['kind'],0xa):undefined,'isVisible':_0x51247b[_0x22456d(0xcb)]?![]:undefined,'segmentFolderId':_0x3cdf54,'countPopulation':_0x51247b[_0x22456d(0xae)]?![]:undefined},_0x43331a=await withSpinner('Creating\x20segment\x20\x27'+_0x4efa71+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0x9d)](_0x2415e7,_0x182694),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x356de0=_0x43331a['data'];return console[_0x22456d(0xbb)]('✔\x20Created\x20segment\x20\x27'+_0x356de0[_0x22456d(0xc1)]+'\x27\x20with\x20ID:\x20'+_0x356de0['id']),_0x244763!==_0x4d2179&&console['error']('\x20\x20\x20Path:\x20'+_0x244763),await handleSDKOutput([_0x356de0],_0x51247b),0x0;}}
1
+ const a28_0x1e7a6f=a28_0x5415;(function(_0x3ca0a0,_0x44047c){const _0x21d7f3=a28_0x5415,_0x395d3f=_0x3ca0a0();while(!![]){try{const _0x22e8ad=-parseInt(_0x21d7f3(0x18b))/0x1+parseInt(_0x21d7f3(0x187))/0x2*(parseInt(_0x21d7f3(0x19c))/0x3)+-parseInt(_0x21d7f3(0x193))/0x4+-parseInt(_0x21d7f3(0x1b2))/0x5+-parseInt(_0x21d7f3(0x1a8))/0x6+-parseInt(_0x21d7f3(0x199))/0x7+parseInt(_0x21d7f3(0x1b6))/0x8;if(_0x22e8ad===_0x44047c)break;else _0x395d3f['push'](_0x395d3f['shift']());}catch(_0x2c8892){_0x395d3f['push'](_0x395d3f['shift']());}}}(a28_0x5ec3,0xd13e9));import{BaseCommand}from'./command.js';function a28_0x5ec3(){const _0x5c37b3=['9189152boOGAi','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','3JIwFzt','verbose','segmentPath','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','kind','execute','ruleFile','segments','Segment\x20name:\x20','Examples:','name','\x27\x20with\x20ID:\x20','7536288HbcTGv','description','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','createSegment','parent','Resolving\x20folder\x20\x27','Resolving\x20parent\x20segment\x20\x27','folderId','Creating\x20segment\x20\x27','includes','451955wtVCqc','\x20\x20\x20Path:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','34049640kjPlTI','Create\x20child\x20segment\x20with\x20filtering\x20rules','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20path:\x20','\x27...','3410532nRMREF','resolveFolderId','Site:\x20','Resolved\x20relative\x20path\x20to:\x20','1111105XRlUoR','data','Resolving\x20folder\x20path\x20\x27','error','type','segment','resolvePathToResource','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','5336504QFFsJv','resolveParentId','invisible','length','segment:create','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'];a28_0x5ec3=function(){return _0x5c37b3;};return a28_0x5ec3();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a28_0x5415(_0x3d9549,_0x23e974){_0x3d9549=_0x3d9549-0x184;const _0x5ec3b4=a28_0x5ec3();let _0x54155e=_0x5ec3b4[_0x3d9549];return _0x54155e;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x29be60 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x1e7a6f(0x1a6)]=a28_0x1e7a6f(0x197);[a28_0x1e7a6f(0x1a9)]=a28_0x1e7a6f(0x1b7);async[a28_0x1e7a6f(0x1a1)](_0x1ec351){const _0x25e7ce=a28_0x1e7a6f;console['error'](a28_0x29be60['yellow'](_0x25e7ce(0x1b4))),console['error'](a28_0x29be60['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0xab525a,args:_0xf6c8e5,tdx:_0xd7a4fb}=_0x1ec351,_0x3a48ba=_0xab525a;if(_0xf6c8e5[_0x25e7ce(0x196)]===0x0)return console[_0x25e7ce(0x18e)](_0x25e7ce(0x184)),console[_0x25e7ce(0x18e)](_0x25e7ce(0x1b5)),console[_0x25e7ce(0x18e)](_0x25e7ce(0x1a5)),console[_0x25e7ce(0x18e)](_0x25e7ce(0x19b)),console[_0x25e7ce(0x18e)](_0x25e7ce(0x19a)),console[_0x25e7ce(0x18e)](_0x25e7ce(0x19f)),0x1;const _0x130367=_0xf6c8e5[0x0],_0xb5ae7c=_0xab525a[_0x25e7ce(0x19e)];let _0x2a1f2=_0x130367;_0xb5ae7c&&!_0x130367[_0x25e7ce(0x1b1)]('/')&&(_0x2a1f2=_0xb5ae7c+'/'+_0x130367,_0x3a48ba[_0x25e7ce(0x19d)]&&console[_0x25e7ce(0x18e)](_0x25e7ce(0x18a)+_0x2a1f2));const _0x7737e1=parsePath(_0x2a1f2);if(_0x7737e1['segments'][_0x25e7ce(0x196)]<0x2)return console['error'](_0x25e7ce(0x1aa)),console[_0x25e7ce(0x18e)](_0x25e7ce(0x192)),0x1;const _0x44dc4a=_0x7737e1[_0x25e7ce(0x1a3)][0x0],_0x166552=getBaseName(_0x2a1f2),_0x45f3bc=getParentPath(_0x2a1f2);_0x3a48ba[_0x25e7ce(0x19d)]&&(console[_0x25e7ce(0x18e)](_0x25e7ce(0x189)+_0x3a48ba['site']),console['error']('Target\x20path:\x20'+_0x2a1f2),console[_0x25e7ce(0x18e)]('Parent:\x20'+_0x44dc4a),console['error'](_0x25e7ce(0x1a4)+_0x166552),console[_0x25e7ce(0x18e)](_0x25e7ce(0x185)+_0x45f3bc));const _0x3e5be3=await withSpinner(_0x25e7ce(0x1ae)+_0x44dc4a+'\x27...',()=>_0xd7a4fb[_0x25e7ce(0x190)][_0x25e7ce(0x194)](_0x44dc4a),{'verbose':_0x3a48ba[_0x25e7ce(0x19d)]}),_0x4ced44=_0x3e5be3[_0x25e7ce(0x18c)];let _0x8deaf5;if(_0x7737e1[_0x25e7ce(0x1a3)][_0x25e7ce(0x196)]>0x2){const _0x4c3f68=await withSpinner(_0x25e7ce(0x18d)+_0x45f3bc+_0x25e7ce(0x186),()=>_0xd7a4fb[_0x25e7ce(0x190)][_0x25e7ce(0x191)](_0x45f3bc),{'verbose':_0x3a48ba[_0x25e7ce(0x19d)]}),_0xba6e78=_0x4c3f68[_0x25e7ce(0x18c)];if(_0xba6e78['type']!=='folder'&&_0xba6e78[_0x25e7ce(0x18f)]!==_0x25e7ce(0x1ac))return console[_0x25e7ce(0x18e)](_0x25e7ce(0x198)),0x1;_0x8deaf5=_0xba6e78[_0x25e7ce(0x1af)];}else{if(_0x3a48ba['folder']){const _0x40b77c=await withSpinner(_0x25e7ce(0x1ad)+_0x3a48ba['folder']+_0x25e7ce(0x186),()=>_0xd7a4fb[_0x25e7ce(0x190)][_0x25e7ce(0x188)](_0x4ced44,_0x3a48ba['folder']),{'verbose':_0x3a48ba[_0x25e7ce(0x19d)]});_0x8deaf5=_0x40b77c['data'];}}_0x3a48ba[_0x25e7ce(0x19d)]&&_0x8deaf5&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x8deaf5);const _0x311850=await loadJSONFromOptions(_0x3a48ba['rule'],_0x3a48ba[_0x25e7ce(0x1a2)]),_0x17e8d4={'name':_0x166552,'description':_0x3a48ba[_0x25e7ce(0x1a9)],'rule':_0x311850,'kind':_0x3a48ba['kind']!==undefined?parseInt(_0x3a48ba[_0x25e7ce(0x1a0)],0xa):undefined,'isVisible':_0x3a48ba[_0x25e7ce(0x195)]?![]:undefined,'segmentFolderId':_0x8deaf5,'countPopulation':_0x3a48ba['noCountPopulation']?![]:undefined},_0x65122d=await withSpinner(_0x25e7ce(0x1b0)+_0x166552+_0x25e7ce(0x186),()=>_0xd7a4fb[_0x25e7ce(0x190)][_0x25e7ce(0x1ab)](_0x4ced44,_0x17e8d4),{'verbose':_0x3a48ba['verbose']}),_0x267a47=_0x65122d[_0x25e7ce(0x18c)];return console[_0x25e7ce(0x18e)]('✔\x20Created\x20segment\x20\x27'+_0x267a47[_0x25e7ce(0x1a6)]+_0x25e7ce(0x1a7)+_0x267a47['id']),_0x2a1f2!==_0x130367&&console['error'](_0x25e7ce(0x1b3)+_0x2a1f2),await handleSDKOutput([_0x267a47],_0x3a48ba),0x0;}}
@@ -1 +1 @@
1
- const a29_0x3a8d8a=a29_0x1b74;(function(_0xc5867c,_0xd2fd1a){const _0x3be3f1=a29_0x1b74,_0x5d624a=_0xc5867c();while(!![]){try{const _0x6c7f72=-parseInt(_0x3be3f1(0x8a))/0x1+parseInt(_0x3be3f1(0x86))/0x2+parseInt(_0x3be3f1(0x71))/0x3+-parseInt(_0x3be3f1(0x80))/0x4+-parseInt(_0x3be3f1(0x7c))/0x5+-parseInt(_0x3be3f1(0x81))/0x6+parseInt(_0x3be3f1(0x7e))/0x7;if(_0x6c7f72===_0xd2fd1a)break;else _0x5d624a['push'](_0x5d624a['shift']());}catch(_0x2dad92){_0x5d624a['push'](_0x5d624a['shift']());}}}(a29_0x1e86,0x56f9a));function a29_0x1b74(_0x514ba7,_0xfa5cdd){_0x514ba7=_0x514ba7-0x71;const _0x1e86b1=a29_0x1e86();let _0x1b744f=_0x1e86b1[_0x514ba7];return _0x1b744f;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x1e86(){const _0x5d91c2=['1155044GxKQzm','description','\x20field','length','483139SPEvAj','645513KMCnzN','json','segment','verbose','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:fields','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','listFields','jsonl','456795xngnGj','✔\x20Found\x20','2791635kxGwQc','error','40472UQLOYW','1503792qjUKJE','parentSegment','site','Site:\x20','Listing\x20fields\x20for\x20\x27'];a29_0x1e86=function(){return _0x5d91c2;};return a29_0x1e86();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x3a8d8a(0x77);[a29_0x3a8d8a(0x87)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x3595b8){const _0x562d76=a29_0x3a8d8a,{options:_0x16751c,args:_0x4cef08,tdx:_0x5e8543}=_0x3595b8,_0x234753=_0x4cef08[0x0]||_0x16751c[_0x562d76(0x82)];if(!_0x234753)return console[_0x562d76(0x7f)](_0x562d76(0x75)),console['error'](_0x562d76(0x79)),console[_0x562d76(0x7f)](_0x562d76(0x76)),0x1;_0x16751c[_0x562d76(0x74)]&&(console[_0x562d76(0x7f)](_0x562d76(0x84)+_0x16751c[_0x562d76(0x83)]),console[_0x562d76(0x7f)]('Parent\x20segment:\x20'+_0x234753));const _0x3ade0e=await withSpinner(_0x562d76(0x85)+_0x234753+'\x27...',()=>_0x5e8543[_0x562d76(0x73)][_0x562d76(0x7a)](_0x234753),{'verbose':_0x16751c[_0x562d76(0x74)]}),_0x26cce8=_0x3ade0e[_0x562d76(0x78)];console[_0x562d76(0x7f)](_0x562d76(0x7d)+_0x26cce8['length']+_0x562d76(0x88)+(_0x26cce8[_0x562d76(0x89)]!==0x1?'s':''));if(_0x16751c[_0x562d76(0x72)]||_0x16751c[_0x562d76(0x7b)])return await handleSDKOutput(_0x26cce8,_0x16751c),0x0;return displayFieldsHumanReadable(_0x26cce8,_0x234753),0x0;}}
1
+ const a29_0x1dea00=a29_0x864d;(function(_0x268022,_0x5961a5){const _0x58e73f=a29_0x864d,_0x3a99b1=_0x268022();while(!![]){try{const _0x3a5fb3=-parseInt(_0x58e73f(0x162))/0x1+-parseInt(_0x58e73f(0x14f))/0x2*(parseInt(_0x58e73f(0x14b))/0x3)+-parseInt(_0x58e73f(0x150))/0x4+-parseInt(_0x58e73f(0x14a))/0x5*(parseInt(_0x58e73f(0x151))/0x6)+-parseInt(_0x58e73f(0x149))/0x7*(parseInt(_0x58e73f(0x15e))/0x8)+parseInt(_0x58e73f(0x163))/0x9*(parseInt(_0x58e73f(0x160))/0xa)+parseInt(_0x58e73f(0x14e))/0xb*(parseInt(_0x58e73f(0x159))/0xc);if(_0x3a5fb3===_0x5961a5)break;else _0x3a99b1['push'](_0x3a99b1['shift']());}catch(_0x17806e){_0x3a99b1['push'](_0x3a99b1['shift']());}}}(a29_0x39b4,0xda6f7));function a29_0x39b4(){const _0x2dc18c=['List\x20available\x20fields\x20for\x20segmentation','segment','12CRfipo','✔\x20Found\x20','execute','Error:\x20Parent\x20segment\x20name\x20is\x20required','description','344UBtUvh','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','10EeOjhf','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','626437HKvLIN','2737989mBfTCi','name','jsonl','site','error','140336sCiwXm','80UtUSUf','93kXtIkf','data','Parent\x20segment:\x20','54461847yvjYBK','103134YSexwR','3045524xpDipj','192048EOehBq','length','\x20field','parentSegment','Site:\x20','json'];a29_0x39b4=function(){return _0x2dc18c;};return a29_0x39b4();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x864d(_0xb36a0e,_0x1bd148){_0xb36a0e=_0xb36a0e-0x145;const _0x39b4b9=a29_0x39b4();let _0x864d94=_0x39b4b9[_0xb36a0e];return _0x864d94;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x1dea00(0x145)]='segment:fields';[a29_0x1dea00(0x15d)]=a29_0x1dea00(0x157);async[a29_0x1dea00(0x15b)](_0x438319){const _0x409b3e=a29_0x1dea00,{options:_0x5931c5,args:_0x10acd5,tdx:_0x252035}=_0x438319,_0x5b866c=_0x10acd5[0x0]||_0x5931c5[_0x409b3e(0x154)];if(!_0x5b866c)return console[_0x409b3e(0x148)](_0x409b3e(0x15c)),console[_0x409b3e(0x148)](_0x409b3e(0x161)),console['error'](_0x409b3e(0x15f)),0x1;_0x5931c5['verbose']&&(console[_0x409b3e(0x148)](_0x409b3e(0x155)+_0x5931c5[_0x409b3e(0x147)]),console['error'](_0x409b3e(0x14d)+_0x5b866c));const _0x25d8ba=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x5b866c+'\x27...',()=>_0x252035[_0x409b3e(0x158)]['listFields'](_0x5b866c),{'verbose':_0x5931c5['verbose']}),_0x8eed8c=_0x25d8ba[_0x409b3e(0x14c)];console[_0x409b3e(0x148)](_0x409b3e(0x15a)+_0x8eed8c['length']+_0x409b3e(0x153)+(_0x8eed8c[_0x409b3e(0x152)]!==0x1?'s':''));if(_0x5931c5[_0x409b3e(0x156)]||_0x5931c5[_0x409b3e(0x146)])return await handleSDKOutput(_0x8eed8c,_0x5931c5),0x0;return displayFieldsHumanReadable(_0x8eed8c,_0x5b866c),0x0;}}
@@ -1 +1 @@
1
- const a30_0x1eb9b3=a30_0x5d5a;(function(_0x3bfb99,_0x27304a){const _0x27cefb=a30_0x5d5a,_0x44dd34=_0x3bfb99();while(!![]){try{const _0x10bbde=parseInt(_0x27cefb(0x159))/0x1*(parseInt(_0x27cefb(0x175))/0x2)+parseInt(_0x27cefb(0x18e))/0x3+parseInt(_0x27cefb(0x17a))/0x4*(-parseInt(_0x27cefb(0x149))/0x5)+parseInt(_0x27cefb(0x167))/0x6*(-parseInt(_0x27cefb(0x168))/0x7)+parseInt(_0x27cefb(0x190))/0x8+-parseInt(_0x27cefb(0x193))/0x9+-parseInt(_0x27cefb(0x15e))/0xa*(-parseInt(_0x27cefb(0x18a))/0xb);if(_0x10bbde===_0x27304a)break;else _0x44dd34['push'](_0x44dd34['shift']());}catch(_0x322e5a){_0x44dd34['push'](_0x44dd34['shift']());}}}(a30_0x27b1,0xc1650));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a30_0x27b1(){const _0x42207d=['files','journeys','verbose','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)','execute','\x20versions)','\x20files\x20to\x20','Target\x20resource:\x20','absolutePath','length','\x20\x20🎯\x20','segments','yes','51689GLKxkn','Write\x20','site','\x20\x20Target:\x20','3063144gFLCSp','hasChanges','5755472SnkvlK','green','\x20journeys','7858269ySOMNe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','dim','\x20segments','✔\x20Context\x20set:\x20','journeyVersions','pullSegments','isNew','5BdDNvc','parentSegment','\x20changed\x20files','\x20files?','Aborted.','targetDir','resourceName','✔\x20Pulled\x20','segment:pull','cwd','content','message','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','segment','Error:\x20','2JeZDcV','Site:\x20','\x20activations','cyan','relativePath','710PrIzln','dirname','error','filter','name','data','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parent_segment','parentName','102diBoOn','224462vgTrQL','\x20with\x20','red','\x20\x20🗺️\x20\x20','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','diff','session','repeat','Pulling\x20segments\x20from\x20\x27','errorCode','\x20unchanged\x20files','utf-8','778642rQFWiH','\x0aChanges\x20to\x20\x27','\x20new\x20files','counts','no_parent','2569384OPXkwU','✔\x20All\x20files\x20are\x20up\x20to\x20date','description'];a30_0x27b1=function(){return _0x42207d;};return a30_0x27b1();}import a30_0x2ca5a0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x108ba8 from'path';function a30_0x5d5a(_0x194911,_0x511f87){_0x194911=_0x194911-0x144;const _0x27b1c7=a30_0x27b1();let _0x5d5ae9=_0x27b1c7[_0x194911];return _0x5d5ae9;}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_0x1eb9b3(0x162)]=a30_0x1eb9b3(0x151);[a30_0x1eb9b3(0x17c)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x1eb9b3(0x181)](_0x311b2a){const _0xe60ce9=a30_0x1eb9b3,{options:_0xa6b3e7,args:_0x31cafe,tdx:_0x4073dd}=_0x311b2a,_0x4e0792=_0xa6b3e7,_0x2af95d=await resolveTarget({'arg':_0x31cafe[0x0],'contextParent':_0xa6b3e7[_0xe60ce9(0x14a)],'cwd':process[_0xe60ce9(0x152)]()});if(!isSuccessfulResolution(_0x2af95d))return _0x2af95d[_0xe60ce9(0x172)]===_0xe60ce9(0x179)?(console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x164))),console['error'](_0xe60ce9(0x180)),console[_0xe60ce9(0x160)](_0xe60ce9(0x194)),console['error'](_0xe60ce9(0x16d))):(console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16a)](_0xe60ce9(0x158)+_0x2af95d[_0xe60ce9(0x154)]+'\x0a')),_0x2af95d['helpText']&&console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x2af95d['helpText']))),0x1;const _0xe6dda3=_0x2af95d[_0xe60ce9(0x166)],_0x24b80b=_0x2af95d[_0xe60ce9(0x14e)],_0x306f97=_0x2af95d['type']==='file'?_0x2af95d[_0xe60ce9(0x14f)]:undefined;_0x4e0792[_0xe60ce9(0x17f)]&&(console[_0xe60ce9(0x160)](_0xe60ce9(0x15a)+_0x4e0792[_0xe60ce9(0x18c)]),console['error']('Parent\x20segment:\x20'+_0xe6dda3),_0x306f97&&console['error'](_0xe60ce9(0x184)+_0x306f97));const _0x37e50f=await withProgressSpinner(_0xe60ce9(0x171)+_0xe6dda3+'\x27...',_0x4d42cc=>_0x4073dd[_0xe60ce9(0x157)][_0xe60ce9(0x147)](_0xe6dda3,{'targetDir':_0x24b80b,'targetResourceName':_0x306f97,'verbose':_0x4e0792[_0xe60ce9(0x17f)],'progress':{'update':_0x5d4c4c=>{const _0x3e64da=_0xe60ce9;_0x4d42cc['setPhase'](_0x5d4c4c),_0x4e0792[_0x3e64da(0x17f)]&&console['error']('\x20\x20'+_0x5d4c4c);}}}),{'verbose':_0x4e0792[_0xe60ce9(0x17f)]}),_0x1eb3f3=_0x37e50f[_0xe60ce9(0x163)];if(_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x188)]===0x0&&_0x1eb3f3['counts'][_0xe60ce9(0x17e)]===0x0)return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x155)+_0x1eb3f3[_0xe60ce9(0x166)]+'\x27')),0x0;const _0x2e54e9=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x3e3be0=>_0x3e3be0[_0xe60ce9(0x148)]),_0x2e5133=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x458b7d=>!_0x458b7d[_0xe60ce9(0x148)]&&_0x458b7d[_0xe60ce9(0x18f)]),_0x265409=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x21f4b7=>!_0x21f4b7[_0xe60ce9(0x148)]&&!_0x21f4b7[_0xe60ce9(0x18f)]);console[_0xe60ce9(0x160)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1eb3f3['parentName']+'\x27:'),console[_0xe60ce9(0x160)](_0xe60ce9(0x187)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x188)]+_0xe60ce9(0x144))+_0xe60ce9(0x169)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)]['activations']+_0xe60ce9(0x15b)));if(_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x17e)]>0x0){const _0x2bca4a=_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x146)]>_0x1eb3f3[_0xe60ce9(0x178)]['journeys']?'\x20('+_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x146)]+_0xe60ce9(0x182):'';console['error'](_0xe60ce9(0x16b)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x17e)]+_0xe60ce9(0x192))+a30_0x2ca5a0[_0xe60ce9(0x195)](_0x2bca4a));}console['error']('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x191)]('+\x20'+_0x2e54e9[_0xe60ce9(0x186)]+_0xe60ce9(0x177))),console[_0xe60ce9(0x160)]('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x16c)]('~\x20'+_0x2e5133[_0xe60ce9(0x186)]+_0xe60ce9(0x14b))),console['error']('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x195)]('=\x20'+_0x265409[_0xe60ce9(0x186)]+_0xe60ce9(0x173))),console['error'](_0xe60ce9(0x18d)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3['targetDir'])+'\x0a');if(_0x2e5133['length']>0x0)for(const _0x3302b7 of _0x2e5133){console['error'](_0xe60ce9(0x176)+_0x3302b7[_0xe60ce9(0x15d)]+'\x27:'),console['error']('─'[_0xe60ce9(0x170)](0x3c)),console[_0xe60ce9(0x160)](_0x3302b7[_0xe60ce9(0x16e)]),console[_0xe60ce9(0x160)]('─'[_0xe60ce9(0x170)](0x3c));}if(_0x4e0792['dryRun'])return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x156))),0x0;if(_0x2e54e9[_0xe60ce9(0x186)]===0x0&&_0x2e5133[_0xe60ce9(0x186)]===0x0)return console['error'](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x17b))),saveSessionContext({'parent_segment':_0x1eb3f3[_0xe60ce9(0x166)]},_0x4e0792['session']),console[_0xe60ce9(0x160)](a30_0x2ca5a0['green'](_0xe60ce9(0x145)+a30_0x2ca5a0['dim'](_0xe60ce9(0x165))+'\x20=\x20'+a30_0x2ca5a0['cyan'](_0x1eb3f3[_0xe60ce9(0x166)]))),0x0;if(!_0x4e0792[_0xe60ce9(0x189)]){const _0x33f273=await confirmKey(_0xe60ce9(0x18b)+(_0x2e54e9[_0xe60ce9(0x186)]+_0x2e5133['length'])+_0xe60ce9(0x14c));if(!_0x33f273)return console[_0xe60ce9(0x160)](_0xe60ce9(0x14d)),0x1;}for(const _0x536de6 of _0x1eb3f3[_0xe60ce9(0x17d)]){if(_0x536de6[_0xe60ce9(0x148)]||_0x536de6['hasChanges']){const _0x36772a=a30_0x108ba8[_0xe60ce9(0x15f)](_0x536de6['absolutePath']);!existsSync(_0x36772a)&&mkdirSync(_0x36772a,{'recursive':!![]}),writeFileSync(_0x536de6[_0xe60ce9(0x185)],_0x536de6[_0xe60ce9(0x153)],_0xe60ce9(0x174));}}return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x150)+(_0x2e54e9[_0xe60ce9(0x186)]+_0x2e5133['length'])+_0xe60ce9(0x183)+_0x1eb3f3[_0xe60ce9(0x14e)])),saveSessionContext({'parent_segment':_0x1eb3f3['parentName']},_0x4e0792[_0xe60ce9(0x16f)]),console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x145)+a30_0x2ca5a0[_0xe60ce9(0x195)]('parent_segment')+'\x20=\x20'+a30_0x2ca5a0['cyan'](_0x1eb3f3['parentName']))),0x0;}}
1
+ const a30_0x576b1b=a30_0x4cf8;(function(_0x2dda33,_0x9b1e28){const _0x3aa76d=a30_0x4cf8,_0xe108df=_0x2dda33();while(!![]){try{const _0x287174=-parseInt(_0x3aa76d(0x1d7))/0x1*(parseInt(_0x3aa76d(0x1e7))/0x2)+parseInt(_0x3aa76d(0x1d3))/0x3+parseInt(_0x3aa76d(0x20d))/0x4+parseInt(_0x3aa76d(0x20a))/0x5*(-parseInt(_0x3aa76d(0x1f2))/0x6)+parseInt(_0x3aa76d(0x1e4))/0x7*(-parseInt(_0x3aa76d(0x1de))/0x8)+parseInt(_0x3aa76d(0x208))/0x9+-parseInt(_0x3aa76d(0x218))/0xa*(-parseInt(_0x3aa76d(0x200))/0xb);if(_0x287174===_0x9b1e28)break;else _0xe108df['push'](_0xe108df['shift']());}catch(_0x5390e4){_0xe108df['push'](_0xe108df['shift']());}}}(a30_0x119b,0x1b86a));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';function a30_0x4cf8(_0x446955,_0x1631dc){_0x446955=_0x446955-0x1cb;const _0x119b81=a30_0x119b();let _0x4cf8a8=_0x119b81[_0x446955];return _0x4cf8a8;}import{saveSessionContext}from'../core/session.js';import a30_0x39d626 from'chalk';function a30_0x119b(){const _0x469ef0=['\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','22sJPAfk','Write\x20','utf-8','data','✔\x20All\x20files\x20are\x20up\x20to\x20date','Error:\x20','targetDir','1006664edCICo','segments','\x20changed\x20files','resourceName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aPull\x20summary\x20for\x20\x27','7FyAlRS','session','parentSegment','8796ZQObYI','\x20segments','error','cyan','activations','Site:\x20','content','parentName','yes','repeat','\x20files?','6Dpgkye','name','pullSegments','green','\x20unchanged\x20files','\x20journeys','\x20with\x20','\x27...','cwd','helpText','hasChanges','errorCode','\x20new\x20files','length','8217wnytsq','Pulling\x20segments\x20from\x20\x27','filter','no_parent','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)','isNew','setPhase','\x20\x20Target:\x20','1230858CGNVjK','Parent\x20segment:\x20','325830ykhzuu','\x20=\x20','\x20\x20🎯\x20','507712ZENyok','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','message','files','counts','\x0aChanges\x20to\x20\x27','journeyVersions','description','relativePath','journeys','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','1020yERwCp','file','diff','\x20activations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20\x20🗺️\x20\x20','✔\x20Pulled\x20','yellow','segment:pull','red','dim','\x20files\x20to\x20','verbose','type','181851LDBSAR','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','absolutePath'];a30_0x119b=function(){return _0x469ef0;};return a30_0x119b();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0xad718e 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_0x576b1b(0x1f3)]=a30_0x576b1b(0x1cd);[a30_0x576b1b(0x214)]=a30_0x576b1b(0x217);async['execute'](_0x4ff08c){const _0x2b4a43=a30_0x576b1b,{options:_0x5b536a,args:_0x50b557,tdx:_0x512841}=_0x4ff08c,_0x260c6e=_0x5b536a,_0x4cd840=await resolveTarget({'arg':_0x50b557[0x0],'contextParent':_0x5b536a[_0x2b4a43(0x1e6)],'cwd':process[_0x2b4a43(0x1fa)]()});if(!isSuccessfulResolution(_0x4cd840))return _0x4cd840[_0x2b4a43(0x1fd)]===_0x2b4a43(0x203)?(console['error'](a30_0x39d626[_0x2b4a43(0x1cc)](_0x2b4a43(0x1e2))),console['error'](_0x2b4a43(0x204)),console['error'](_0x2b4a43(0x21c)),console['error'](_0x2b4a43(0x20e))):(console[_0x2b4a43(0x1e9)](a30_0x39d626[_0x2b4a43(0x1ce)](_0x2b4a43(0x1dc)+_0x4cd840[_0x2b4a43(0x20f)]+'\x0a')),_0x4cd840['helpText']&&console['error'](a30_0x39d626[_0x2b4a43(0x1ea)](_0x4cd840[_0x2b4a43(0x1fb)]))),0x1;const _0x82d9c5=_0x4cd840[_0x2b4a43(0x1ee)],_0x1d49d2=_0x4cd840[_0x2b4a43(0x1dd)],_0x13eb72=_0x4cd840[_0x2b4a43(0x1d2)]===_0x2b4a43(0x219)?_0x4cd840[_0x2b4a43(0x1e1)]:undefined;_0x260c6e['verbose']&&(console[_0x2b4a43(0x1e9)](_0x2b4a43(0x1ec)+_0x260c6e['site']),console[_0x2b4a43(0x1e9)](_0x2b4a43(0x209)+_0x82d9c5),_0x13eb72&&console[_0x2b4a43(0x1e9)]('Target\x20resource:\x20'+_0x13eb72));const _0x18869f=await withProgressSpinner(_0x2b4a43(0x201)+_0x82d9c5+_0x2b4a43(0x1f9),_0xd5b38c=>_0x512841['segment'][_0x2b4a43(0x1f4)](_0x82d9c5,{'targetDir':_0x1d49d2,'targetResourceName':_0x13eb72,'verbose':_0x260c6e[_0x2b4a43(0x1d1)],'progress':{'update':_0x9eae7d=>{const _0x152a4c=_0x2b4a43;_0xd5b38c[_0x152a4c(0x206)](_0x9eae7d),_0x260c6e[_0x152a4c(0x1d1)]&&console['error']('\x20\x20'+_0x9eae7d);}}}),{'verbose':_0x260c6e[_0x2b4a43(0x1d1)]}),_0x199aae=_0x18869f[_0x2b4a43(0x1da)];if(_0x199aae[_0x2b4a43(0x211)][_0x2b4a43(0x1df)]===0x0&&_0x199aae[_0x2b4a43(0x211)][_0x2b4a43(0x216)]===0x0)return console[_0x2b4a43(0x1e9)](a30_0x39d626[_0x2b4a43(0x1cc)](_0x2b4a43(0x1d4)+_0x199aae[_0x2b4a43(0x1ee)]+'\x27')),0x0;const _0xb0c0ef=_0x199aae[_0x2b4a43(0x210)][_0x2b4a43(0x202)](_0x44d1eb=>_0x44d1eb[_0x2b4a43(0x205)]),_0x3738ca=_0x199aae[_0x2b4a43(0x210)][_0x2b4a43(0x202)](_0x6f7eb=>!_0x6f7eb[_0x2b4a43(0x205)]&&_0x6f7eb[_0x2b4a43(0x1fc)]),_0x41b517=_0x199aae[_0x2b4a43(0x210)][_0x2b4a43(0x202)](_0x3efba3=>!_0x3efba3[_0x2b4a43(0x205)]&&!_0x3efba3[_0x2b4a43(0x1fc)]);console[_0x2b4a43(0x1e9)](_0x2b4a43(0x1e3)+_0x199aae[_0x2b4a43(0x1ee)]+'\x27:'),console[_0x2b4a43(0x1e9)](_0x2b4a43(0x20c)+a30_0x39d626[_0x2b4a43(0x1ea)](_0x199aae[_0x2b4a43(0x211)][_0x2b4a43(0x1df)]+_0x2b4a43(0x1e8))+_0x2b4a43(0x1f8)+a30_0x39d626[_0x2b4a43(0x1ea)](_0x199aae['counts'][_0x2b4a43(0x1eb)]+_0x2b4a43(0x21b)));if(_0x199aae[_0x2b4a43(0x211)]['journeys']>0x0){const _0x8dc69a=_0x199aae[_0x2b4a43(0x211)][_0x2b4a43(0x213)]>_0x199aae['counts'][_0x2b4a43(0x216)]?'\x20('+_0x199aae[_0x2b4a43(0x211)][_0x2b4a43(0x213)]+'\x20versions)':'';console[_0x2b4a43(0x1e9)](_0x2b4a43(0x21d)+a30_0x39d626[_0x2b4a43(0x1ea)](_0x199aae['counts'][_0x2b4a43(0x216)]+_0x2b4a43(0x1f7))+a30_0x39d626[_0x2b4a43(0x1cf)](_0x8dc69a));}console[_0x2b4a43(0x1e9)]('\x20\x20'+a30_0x39d626[_0x2b4a43(0x1f5)]('+\x20'+_0xb0c0ef[_0x2b4a43(0x1ff)]+_0x2b4a43(0x1fe))),console[_0x2b4a43(0x1e9)]('\x20\x20'+a30_0x39d626[_0x2b4a43(0x1cc)]('~\x20'+_0x3738ca[_0x2b4a43(0x1ff)]+_0x2b4a43(0x1e0))),console[_0x2b4a43(0x1e9)]('\x20\x20'+a30_0x39d626['dim']('=\x20'+_0x41b517[_0x2b4a43(0x1ff)]+_0x2b4a43(0x1f6))),console['error'](_0x2b4a43(0x207)+a30_0x39d626[_0x2b4a43(0x1ea)](_0x199aae[_0x2b4a43(0x1dd)])+'\x0a');if(_0x3738ca[_0x2b4a43(0x1ff)]>0x0)for(const _0x2027a5 of _0x3738ca){console['error'](_0x2b4a43(0x212)+_0x2027a5[_0x2b4a43(0x215)]+'\x27:'),console[_0x2b4a43(0x1e9)]('─'[_0x2b4a43(0x1f0)](0x3c)),console[_0x2b4a43(0x1e9)](_0x2027a5[_0x2b4a43(0x21a)]),console[_0x2b4a43(0x1e9)]('─'[_0x2b4a43(0x1f0)](0x3c));}if(_0x260c6e['dryRun'])return console['error'](a30_0x39d626[_0x2b4a43(0x1cc)](_0x2b4a43(0x1d6))),0x0;if(_0xb0c0ef[_0x2b4a43(0x1ff)]===0x0&&_0x3738ca[_0x2b4a43(0x1ff)]===0x0)return console[_0x2b4a43(0x1e9)](a30_0x39d626[_0x2b4a43(0x1f5)](_0x2b4a43(0x1db))),saveSessionContext({'parent_segment':_0x199aae[_0x2b4a43(0x1ee)]},_0x260c6e[_0x2b4a43(0x1e5)]),console[_0x2b4a43(0x1e9)](a30_0x39d626[_0x2b4a43(0x1f5)]('✔\x20Context\x20set:\x20'+a30_0x39d626['dim']('parent_segment')+_0x2b4a43(0x20b)+a30_0x39d626[_0x2b4a43(0x1ea)](_0x199aae[_0x2b4a43(0x1ee)]))),0x0;if(!_0x260c6e[_0x2b4a43(0x1ef)]){const _0x50241e=await confirmKey(_0x2b4a43(0x1d8)+(_0xb0c0ef['length']+_0x3738ca[_0x2b4a43(0x1ff)])+_0x2b4a43(0x1f1));if(!_0x50241e)return console['error']('Aborted.'),0x1;}for(const _0x30833c of _0x199aae[_0x2b4a43(0x210)]){if(_0x30833c[_0x2b4a43(0x205)]||_0x30833c['hasChanges']){const _0x4f7ca2=a30_0xad718e['dirname'](_0x30833c[_0x2b4a43(0x1d5)]);!existsSync(_0x4f7ca2)&&mkdirSync(_0x4f7ca2,{'recursive':!![]}),writeFileSync(_0x30833c[_0x2b4a43(0x1d5)],_0x30833c[_0x2b4a43(0x1ed)],_0x2b4a43(0x1d9));}}return console[_0x2b4a43(0x1e9)](a30_0x39d626[_0x2b4a43(0x1f5)](_0x2b4a43(0x1cb)+(_0xb0c0ef[_0x2b4a43(0x1ff)]+_0x3738ca[_0x2b4a43(0x1ff)])+_0x2b4a43(0x1d0)+_0x199aae[_0x2b4a43(0x1dd)])),saveSessionContext({'parent_segment':_0x199aae[_0x2b4a43(0x1ee)]},_0x260c6e[_0x2b4a43(0x1e5)]),console['error'](a30_0x39d626[_0x2b4a43(0x1f5)]('✔\x20Context\x20set:\x20'+a30_0x39d626[_0x2b4a43(0x1cf)]('parent_segment')+'\x20=\x20'+a30_0x39d626[_0x2b4a43(0x1ea)](_0x199aae[_0x2b4a43(0x1ee)]))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x625ab3=a31_0x1f3d;(function(_0x17070a,_0x15db42){const _0x167ea4=a31_0x1f3d,_0x18bd36=_0x17070a();while(!![]){try{const _0xca1da4=-parseInt(_0x167ea4(0x23c))/0x1+-parseInt(_0x167ea4(0x1eb))/0x2*(parseInt(_0x167ea4(0x23a))/0x3)+parseInt(_0x167ea4(0x21d))/0x4*(parseInt(_0x167ea4(0x1f4))/0x5)+-parseInt(_0x167ea4(0x1fa))/0x6+-parseInt(_0x167ea4(0x211))/0x7+parseInt(_0x167ea4(0x236))/0x8*(-parseInt(_0x167ea4(0x1c4))/0x9)+parseInt(_0x167ea4(0x21c))/0xa;if(_0xca1da4===_0x15db42)break;else _0x18bd36['push'](_0x18bd36['shift']());}catch(_0x1dcc85){_0x18bd36['push'](_0x18bd36['shift']());}}}(a31_0x214c,0xef342));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x460526 from'chalk';function a31_0x214c(){const _0x4db2fa=['Resolving\x20parent\x20segment\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Segments:\x20','nameToId','new','user','getJourney','data','push','\x20\x20Activations:','journeys','.yaml','createdSegmentIds','diff','results','\x20\x20\x20\x20','name','toUpdate','message','7905033sRVOrT','/j/da/je','green','\x20updated','journeyBundleId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Changes\x20to:','paused','Error:\x20','unchanged','\x20\x20🗺️\x20\x20Journeys:','dim','journeysOnly','add','\x20to\x20create','getParent','segmentFolderId','createdAt','parentName','file','New\x20journey:','toDelete','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20to\x20delete','no_parent','folderPath','errorCode','segment:push','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20created','parentSegment','Changes\x20to\x20journey:','join','isNew','type','blue','\x20new','\x20YAML\x20files\x20found','set','2HKjyJB','\x20changed','📁\x20','filter','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','idToName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','red','error','90gdsuTz','execute','Fetching\x20existing\x20activations...','activations','setPhase','/app/ps/','9408990lBOclW','verbose','Delete\x20segment:','Fetching\x20users\x20for\x20email\x20resolution...','list','Site:\x20','folders','segments','journeyBundleName','(Journey\x20will\x20be\x20deleted)','\x0aValidation\x20failed:','\x20changes?','updated','toString','\x20deleted','parent_name','listFolders','/e/','filePath','all','changed','resolveParentId','segment\x20or\x20journey','5702753vPegOd','site','then','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','getOutputSchemaWithCache','audienceId','Scoped\x20to\x20folder:\x20','listSegments','yellow','repeat','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','53260930lZgNSM','323488UzoIMQ','\x20activations]','state','delete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','folderId','map','existingJourney','journeyId','\x20unchanged','Folders\x20to\x20create:','length','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x27...','dryRun','deleted','\x20to\x20update','Parent\x20segment:\x20','nameToType','segment','connection','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','8KrFtsL','description','\x0aPush\x20summary\x20for\x20\x27','\x20folders\x20to\x20create','2856369UsUDkK','New\x20segment:','1588707MzVkIF','\x20\x20Journeys:\x20','created','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Source:\x20','listJourneysWithDetailsFromParentSegment','cyan','Source\x20directory:\x20','Preparing\x20journeys...','attributes','Error:\x20Directory\x20not\x20found:\x20','yamlConfig','Push\x20','relationships','get','helpText','Fetching\x20existing\x20folders...'];a31_0x214c=function(){return _0x4db2fa;};return a31_0x214c();}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0x1f3d(_0x3ed3bd,_0x2a6633){_0x3ed3bd=_0x3ed3bd-0x1bd;const _0x214c81=a31_0x214c();let _0x1f3d56=_0x214c81[_0x3ed3bd];return _0x1f3d56;}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x625ab3(0x1c1)]=a31_0x625ab3(0x1df);[a31_0x625ab3(0x237)]=a31_0x625ab3(0x1da);async[a31_0x625ab3(0x1f5)](_0x27af5d){const _0x442e75=a31_0x625ab3,{options:_0x6307bf,args:_0x15d764,tdx:_0x6ed082}=_0x27af5d,_0x3559f0=_0x6307bf,_0x39499c=await resolveTarget({'arg':_0x15d764[0x0],'contextParent':_0x6307bf[_0x442e75(0x1e2)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x39499c))return _0x39499c[_0x442e75(0x1de)]===_0x442e75(0x1dc)?(console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x1c9))),console['error'](_0x442e75(0x1ef)),console[_0x442e75(0x1f3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x442e75(0x1f3)](_0x442e75(0x214))):(console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x1cc)+_0x39499c[_0x442e75(0x1c3)]+'\x0a')),_0x39499c[_0x442e75(0x24b)]&&console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x242)](_0x39499c[_0x442e75(0x24b)]))),0x1;if(_0x39499c[_0x442e75(0x1e6)]===_0x442e75(0x209))return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x246)+_0x39499c['targetDir']+'\x0a')),console[_0x442e75(0x1f3)](a31_0x460526['cyan'](_0x442e75(0x22a))),0x1;const _0x25fa43=_0x39499c[_0x442e75(0x1d6)],_0x2c29ea=_0x39499c['targetDir'],_0x40056b=_0x39499c['type']===_0x442e75(0x1d7)?_0x39499c[_0x442e75(0x20c)]:undefined,_0xc6b29f=getScopedDetails(_0x39499c),_0x4e4612=_0xc6b29f?.['isScoped']??![],_0x3a704d=_0xc6b29f?.['scopedFolderPath']??'';if(!existsSync(_0x2c29ea))return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x246)+_0x2c29ea+'\x0a')),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x242)](_0x442e75(0x22a))),0x1;_0x3559f0[_0x442e75(0x1fb)]&&(console['error'](_0x442e75(0x1ff)+_0x3559f0[_0x442e75(0x212)]),console['error'](_0x442e75(0x22f)+_0x25fa43),console[_0x442e75(0x1f3)](_0x442e75(0x243)+_0x2c29ea),_0x4e4612&&console['error'](_0x442e75(0x217)+_0x3a704d));const _0x2462b8=await withSpinner(_0x442e75(0x24d)+_0x25fa43+_0x442e75(0x22b),()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x20f)](_0x25fa43),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),_0x4125d0=_0x2462b8[_0x442e75(0x254)],[_0x210c2d,_0x5b0fea,_0x1b1a2c,_0x232479,_0x2a3ee8]=await Promise[_0x442e75(0x20d)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x6ed082['segment'][_0x442e75(0x1d3)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x218)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner(_0x442e75(0x24c),()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x20a)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x6ed082['journey'][_0x442e75(0x241)](_0x4125d0,{'includeAllVersions':!![]}),{'verbose':_0x3559f0['verbose']}),withSpinner(_0x442e75(0x1fd),()=>_0x6ed082[_0x442e75(0x252)]['buildUserMaps'](),{'verbose':_0x3559f0[_0x442e75(0x1fb)]})['then'](_0x2a43b6=>_0x2a43b6[_0x442e75(0x254)])]),_0x324575=_0x210c2d[_0x442e75(0x254)],_0x2675be=extractRootFolderId(_0x324575),_0x3df0f4=_0x5b0fea['data'],_0x2ae49f=_0x1b1a2c[_0x442e75(0x254)],{journeys:_0x17a6f4,activationStepsById:_0x40be6f}=_0x232479['data'],_0x18bdcd=new Map(_0x17a6f4[_0x442e75(0x224)](_0x2891bb=>[_0x2891bb['id'],_0x2891bb])),_0x98fabf=_0x17a6f4['map'](_0xd1e852=>({'id':_0xd1e852['id'],'name':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1c1)],'journeyBundleName':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x202)]||'','journeyBundleId':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1c8)]||'','versionNumber':_0xd1e852[_0x442e75(0x245)]['versionNumber'],'description':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x237)],'state':_0xd1e852['attributes'][_0x442e75(0x21f)],'paused':_0xd1e852['attributes'][_0x442e75(0x1cb)],'audienceId':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x216)],'folderId':_0xd1e852[_0x442e75(0x249)]?.['parentFolder']?.[_0x442e75(0x254)]?.['id'],'createdAt':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1d5)],'updatedAt':_0xd1e852[_0x442e75(0x245)]['updatedAt']})),{emailToId:_0x1c071a,idToEmail:_0x2511fb}=_0x2a3ee8,_0xf99f15=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x4d4962=_0x442e75,_0x31de26=await _0x6ed082[_0x4d4962(0x232)][_0x4d4962(0x1fe)]();return buildConnectionMaps(_0x31de26);},{'verbose':_0x3559f0['verbose']})[_0x442e75(0x213)](_0x3fd3c0=>_0x3fd3c0[_0x442e75(0x254)]),_0x2aa561=_0xf99f15['nameToId'],_0x551e17=_0xf99f15[_0x442e75(0x1f0)],_0xf9bea7=_0xf99f15[_0x442e75(0x230)],_0x4f4722={'emailToIdMap':_0x1c071a,'connectionNameToIdMap':_0x2aa561,'connectionNameToTypeMap':_0xf9bea7,'getSchema':_0x199721=>_0x6ed082[_0x442e75(0x232)][_0x442e75(0x215)](_0x199721)};let {pathToId:_0x3ab026,idToPath:_0x164f3c}=buildFolderMaps(_0x2ae49f);const _0x429a9d=buildSegmentLookupMap(_0x3df0f4,_0x164f3c),_0x4c8fa9=buildSegmentNameToIdMap(_0x3df0f4),_0x541252=buildJourneyBundleLookupMap(_0x98fabf,_0x164f3c);let _0x137222;if(_0x40056b){if(!_0x40056b['endsWith']('.yml')&&!_0x40056b['endsWith'](_0x442e75(0x258)))return console['error'](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x221)+_0x40056b+'\x0a')),0x1;_0x137222=[_0x40056b];}else _0x137222=findYamlFiles(_0x2c29ea);if(_0x137222['length']===0x0)return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x235)+_0x2c29ea+'\x0a')),console['error'](a31_0x460526['cyan'](_0x442e75(0x1e0))),0x1;let _0x69fe46,_0x5a7250;try{const _0x4ddbfd=parseAndClassifyYamlFiles(_0x137222,_0x2c29ea,{'skipSegments':_0x3559f0[_0x442e75(0x1d0)]});_0x69fe46=_0x4ddbfd['segments'],_0x5a7250=_0x4ddbfd[_0x442e75(0x257)];const _0x2740dc=validateParsedFiles(_0x4ddbfd,_0x2c29ea);if(_0x2740dc[_0x442e75(0x229)]>0x0)return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x204))),console['error'](formatValidationErrors(_0x2740dc)),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x233))),0x1;}catch(_0x1ad06e){return console['error'](a31_0x460526[_0x442e75(0x1f2)]('Error\x20parsing\x20YAML:\x20'+(_0x1ad06e instanceof Error?_0x1ad06e[_0x442e75(0x1c3)]:_0x1ad06e))),0x1;}if(_0x69fe46[_0x442e75(0x229)]===0x0&&_0x5a7250[_0x442e75(0x229)]===0x0){const _0xb93bf9=_0x3559f0['journeysOnly']?_0x442e75(0x234):_0x442e75(0x210);return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)]('No\x20'+_0xb93bf9+_0x442e75(0x1e9))),0x0;}const _0x118a94=new Map();_0x3df0f4[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&await withSpinner(_0x442e75(0x1f6),async()=>{await batchAsync(_0x3df0f4,async _0x4adb04=>{const _0x5830e9=a31_0x1f3d,_0xb8bc1=await _0x6ed082[_0x5830e9(0x231)]['listActivations'](_0x4125d0,_0x4adb04['id']);_0x118a94[_0x5830e9(0x1ea)](_0x4adb04['id'],_0xb8bc1);});},{'verbose':_0x3559f0['verbose']});const {segmentFiles:_0x8f1aa1,foldersToCreate:_0x23cec8}=await prepareSegmentFiles(_0x69fe46,{'segmentByFolderAndName':_0x429a9d,'activationsBySegmentId':_0x118a94,'folderPathToId':_0x3ab026,'idToEmailMap':_0x2511fb,'connectionIdToNameMap':_0x551e17},_0x4f4722,_0x4e4612,_0x3a704d),_0xb4b40e=_0x40056b?[]:findSegmentsToDelete(_0x3df0f4,_0x69fe46[_0x442e75(0x224)](({yamlConfig:_0x435e53,folderPath:_0xcaa047})=>({'yamlConfig':_0x435e53,'folderPath':resolveTDFolderPath(_0xcaa047,_0x4e4612,_0x3a704d)})),_0x164f3c,_0x3a704d,_0x4e4612),{journeyFiles:_0xfc62b0,foldersToCreate:_0x775ebe}=await withProgressSpinner(_0x442e75(0x244),async _0x1df54e=>prepareJourneyFiles(_0x5a7250,{'fetchJourney':async _0x178e4d=>_0x6ed082[_0x442e75(0x234)][_0x442e75(0x253)](_0x178e4d['journeyId']),'journeyBundlesByFolderAndName':_0x541252,'folderPathToId':_0x3ab026,'idToEmailMap':_0x2511fb,'connectionIdToNameMap':_0x551e17,'existingSegments':_0x3df0f4,'parentId':_0x4125d0,'deps':_0x6ed082,'progress':{'update':_0x23f539=>{const _0x3ecc90=_0x442e75;_0x1df54e[_0x3ecc90(0x1f8)](_0x23f539),_0x3559f0[_0x3ecc90(0x1fb)]&&console[_0x3ecc90(0x1f3)]('\x20\x20'+_0x23f539);}},'journeyById':_0x18bdcd,'activationStepsById':_0x40be6f},_0x4e4612,_0x3a704d),{'verbose':_0x3559f0[_0x442e75(0x1fb)]})['then'](_0x5a0c1d=>_0x5a0c1d['data']);for(const _0x23097c of _0x775ebe){_0x23cec8[_0x442e75(0x1d1)](_0x23097c);}const _0x306724=_0x40056b?[]:findJourneysToDelete(_0x98fabf,_0x5a7250[_0x442e75(0x224)](({yamlConfig:_0x43aeed,folderPath:_0x21bb8b})=>({'yamlConfig':_0x43aeed,'folderPath':resolveTDFolderPath(_0x21bb8b,_0x4e4612,_0x3a704d)})),_0x164f3c,_0x3a704d,_0x4e4612),_0xd40c5=calculatePushStats(_0x8f1aa1,_0xfc62b0,_0x23cec8,_0xb4b40e,_0x306724,!!_0x3559f0[_0x442e75(0x220)],!!_0x3559f0[_0x442e75(0x1d0)]),_0x3b2ce7=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x251)],_0x221901=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x20e)],_0x371ec2=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x1cd)],_0x2c1310=_0xd40c5['segments'][_0x442e75(0x1d9)],_0x56cb34=_0xd40c5[_0x442e75(0x200)]['toCreate'],_0x1cbb81=_0xd40c5[_0x442e75(0x257)][_0x442e75(0x251)],_0x272eb5=_0xd40c5['journeys'][_0x442e75(0x20e)],_0x44917d=_0xd40c5['journeys']['unchanged'],_0x2cd0f4=_0xd40c5['journeys']['toDelete'],_0x2e0acb=_0xd40c5[_0x442e75(0x1f7)][_0x442e75(0x20d)],_0x5d6aee=_0xd40c5[_0x442e75(0x1f7)]['toCreate'],_0x3e510a=_0xd40c5[_0x442e75(0x1f7)][_0x442e75(0x1c2)],_0x1b3316=_0xd40c5['activations'][_0x442e75(0x1d9)];console[_0x442e75(0x1f3)](_0x442e75(0x238)+_0x25fa43+'\x27:');_0x56cb34[_0x442e75(0x229)]>0x0&&console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x1e7)](_0x442e75(0x1ed)+_0x56cb34[_0x442e75(0x229)]+_0x442e75(0x239)));if(!_0x3559f0[_0x442e75(0x1d0)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x3b2ce7[_0x442e75(0x229)]+_0x442e75(0x1e8))),console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x219)]('~\x20'+_0x221901['length']+_0x442e75(0x1ec)));if(_0x2c1310[_0x442e75(0x229)]>0x0)console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x2c1310[_0x442e75(0x229)]+_0x442e75(0x1db)));else _0xb4b40e['length']>0x0&&!_0x3559f0[_0x442e75(0x220)]&&console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)](_0xb4b40e[_0x442e75(0x229)]+_0x442e75(0x222)));console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)]('=\x20'+_0x371ec2[_0x442e75(0x229)]+_0x442e75(0x227)));}if(_0xfc62b0[_0x442e75(0x229)]>0x0||_0x306724[_0x442e75(0x229)]>0x0){console[_0x442e75(0x1f3)](_0x442e75(0x1ce)),console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x1cbb81[_0x442e75(0x229)]+_0x442e75(0x1e8))),console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x219)]('~\x20'+_0x272eb5[_0x442e75(0x229)]+_0x442e75(0x1ec)));if(_0x2cd0f4[_0x442e75(0x229)]>0x0)console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x2cd0f4[_0x442e75(0x229)]+_0x442e75(0x1db)));else _0x306724[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x220)]&&console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)](_0x306724[_0x442e75(0x229)]+_0x442e75(0x222)));console['error']('\x20\x20\x20\x20'+a31_0x460526['dim']('=\x20'+_0x44917d[_0x442e75(0x229)]+'\x20unchanged'));}_0x2e0acb[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&(console['error'](''),console[_0x442e75(0x1f3)](_0x442e75(0x256)),_0x5d6aee[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x5d6aee[_0x442e75(0x229)]+_0x442e75(0x1d2))),_0x3e510a[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526['yellow']('~\x20'+_0x3e510a['length']+_0x442e75(0x22e))),_0x1b3316[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x1b3316['length']+_0x442e75(0x1db))));console['error'](_0x442e75(0x240)+a31_0x460526['cyan'](_0x2c29ea)+'\x0a');if(_0x56cb34[_0x442e75(0x229)]>0x0){console[_0x442e75(0x1f3)](_0x442e75(0x228));for(const _0x217bf6 of _0x56cb34){console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x1e7)]('+')+'\x20'+_0x217bf6);}console[_0x442e75(0x1f3)]('');}if(_0x3b2ce7['length']>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x2d1ac3 of _0x3b2ce7){const _0x384f99=_0x2d1ac3[_0x442e75(0x1dd)]?_0x2d1ac3['folderPath']+'/'+_0x2d1ac3[_0x442e75(0x247)]['name']:_0x2d1ac3[_0x442e75(0x247)][_0x442e75(0x1c1)],_0x44a7b4=_0x2d1ac3['yamlConfig']['activations']?.[_0x442e75(0x229)]||0x0,_0x48b689=_0x44a7b4>0x0?a31_0x460526['dim']('\x20['+_0x44a7b4+_0x442e75(0x21e)):'';console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x1c6)](_0x442e75(0x23b))+'\x20'+_0x384f99+_0x48b689),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),_0x2d1ac3[_0x442e75(0x1be)]&&console[_0x442e75(0x1f3)](_0x2d1ac3[_0x442e75(0x1be)]),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}if(_0x2c1310[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x3e7a32 of _0x2c1310){const _0x28d7fd=_0x3e7a32['segmentFolderId']?_0x164f3c[_0x442e75(0x24a)](_0x3e7a32[_0x442e75(0x1d4)][_0x442e75(0x207)]())||'':'',_0x1e257b=_0x28d7fd?_0x28d7fd+'/'+_0x3e7a32[_0x442e75(0x1c1)]:_0x3e7a32[_0x442e75(0x1c1)],_0x407ed4=_0x118a94[_0x442e75(0x24a)](_0x3e7a32['id'])||[],_0x3417c5=_0x407ed4[_0x442e75(0x229)]>0x0?a31_0x460526[_0x442e75(0x1cf)]('\x20['+_0x407ed4[_0x442e75(0x229)]+_0x442e75(0x21e)):'';console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526['red'](_0x442e75(0x1fc))+'\x20'+_0x1e257b+_0x3417c5),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));const _0x2bd1e9=segmentWithActivationsToYaml(_0x3e7a32,_0x407ed4,undefined,_0x2511fb,_0x551e17),_0x3effb9=segmentToYamlString(_0x2bd1e9),_0x7e8839=generateDiff(_0x3effb9,'');console[_0x442e75(0x1f3)](formatDiffWithColors(_0x7e8839)),console[_0x442e75(0x1f3)]('─'['repeat'](0x3c));}const _0x4f64af=_0x8f1aa1[_0x442e75(0x1ee)](_0x2fd02e=>!_0x2fd02e[_0x442e75(0x1e5)]&&_0x2fd02e[_0x442e75(0x1be)]);if(_0x4f64af['length']>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x27a756 of _0x4f64af){const _0x569598=_0x27a756['folderPath']?_0x27a756[_0x442e75(0x1dd)]+'/'+_0x27a756['yamlConfig'][_0x442e75(0x1c1)]:_0x27a756[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526['yellow'](_0x442e75(0x1ca))+'\x20'+_0x569598),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](_0x27a756[_0x442e75(0x1be)]),console['error']('─'[_0x442e75(0x21a)](0x3c));}if(_0x1cbb81[_0x442e75(0x229)]>0x0)for(const _0x2f4ba4 of _0x1cbb81){const _0x57ae3a=_0x2f4ba4[_0x442e75(0x1dd)]?_0x2f4ba4['folderPath']+'/'+_0x2f4ba4[_0x442e75(0x247)][_0x442e75(0x1c1)]:_0x2f4ba4[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x1c6)](_0x442e75(0x1d8))+'\x20'+_0x57ae3a),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),_0x2f4ba4[_0x442e75(0x1be)]&&console[_0x442e75(0x1f3)](_0x2f4ba4[_0x442e75(0x1be)]),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}const _0x48f748=_0xfc62b0[_0x442e75(0x1ee)](_0xb20d0d=>!_0xb20d0d[_0x442e75(0x1e5)]&&_0xb20d0d[_0x442e75(0x1be)]);if(_0x48f748[_0x442e75(0x229)]>0x0)for(const _0x44f9ab of _0x48f748){const _0x4497f6=_0x44f9ab['folderPath']?_0x44f9ab[_0x442e75(0x1dd)]+'/'+_0x44f9ab[_0x442e75(0x247)][_0x442e75(0x1c1)]:_0x44f9ab[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x219)](_0x442e75(0x1e3))+'\x20'+_0x4497f6),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](_0x44f9ab[_0x442e75(0x1be)]),console['error']('─'[_0x442e75(0x21a)](0x3c));}if(_0x2cd0f4[_0x442e75(0x229)]>0x0)for(const _0x571834 of _0x2cd0f4){const _0xb7302c=_0x571834[_0x442e75(0x223)]?_0x164f3c['get'](_0x571834['folderId'])||'':'',_0x3781b2=_0xb7302c?_0xb7302c+'/'+_0x571834[_0x442e75(0x202)]:_0x571834[_0x442e75(0x202)];console['error']('\x0a'+a31_0x460526[_0x442e75(0x1f2)]('Delete\x20journey:')+'\x20'+_0x3781b2),console['error']('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x203))),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}if(_0x3559f0[_0x442e75(0x22c)])return console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x24e))),0x0;const _0x4d2f72=_0x3559f0[_0x442e75(0x1d0)]?![]:_0x3b2ce7[_0x442e75(0x229)]>0x0||_0x221901['length']>0x0||_0x2c1310[_0x442e75(0x229)]>0x0,_0x1ea4f4=_0x1cbb81[_0x442e75(0x229)]>0x0||_0x272eb5[_0x442e75(0x229)]>0x0||_0x2cd0f4[_0x442e75(0x229)]>0x0,_0x2d2fa7=_0x3559f0['journeysOnly']?![]:_0x2e0acb[_0x442e75(0x229)]>0x0,_0xb4c0a9=_0x56cb34['length']>0x0;if(!_0x4d2f72&&!_0x1ea4f4&&!_0x2d2fa7&&!_0xb4c0a9){const _0x1d3a27=_0x3559f0[_0x442e75(0x1d0)]?_0x442e75(0x1f1):_0x442e75(0x23f);console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1c6)](_0x1d3a27));if(_0x40056b&&_0x44917d['length']===0x1){const _0x44c5d0=_0x44917d[0x0];if(_0x44c5d0[_0x442e75(0x225)]?.['id']){const _0x191e96=getConsoleNextUrl(_0x3559f0['site'],_0x442e75(0x1f9)+_0x4125d0+_0x442e75(0x20b)+_0x44c5d0[_0x442e75(0x225)]['id']+_0x442e75(0x1c5));console['error']('\x20\x20'+a31_0x460526[_0x442e75(0x242)](_0x191e96));}}return 0x0;}const _0x152b4c=_0x3559f0[_0x442e75(0x1d0)]?_0x1cbb81['length']+_0x272eb5[_0x442e75(0x229)]+_0x2cd0f4[_0x442e75(0x229)]+_0x56cb34['length']:_0x3b2ce7[_0x442e75(0x229)]+_0x221901['length']+_0x2c1310[_0x442e75(0x229)]+_0x1cbb81[_0x442e75(0x229)]+_0x272eb5[_0x442e75(0x229)]+_0x2cd0f4[_0x442e75(0x229)]+_0x56cb34['length']+_0x2e0acb[_0x442e75(0x229)];if(!_0x3559f0['yes']&&_0x152b4c>0x0){const _0x42dd88=await confirmKey(_0x442e75(0x248)+_0x152b4c+_0x442e75(0x205));if(!_0x42dd88)return console[_0x442e75(0x1f3)]('Aborted.'),0x1;}const _0x1bd359={'withProgress':async(_0x34d816,_0x41455d)=>{const _0x52520d=_0x442e75,_0x348d76=await withSpinner(_0x34d816,_0x41455d,{'verbose':_0x3559f0[_0x52520d(0x1fb)]});return{'data':_0x348d76[_0x52520d(0x254)]};},'logInfo':_0x3bdfa6=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1e7)]('✔\x20'+_0x3bdfa6)),'logSuccess':_0x26f254=>console['error'](a31_0x460526[_0x442e75(0x1c6)]('✔\x20'+_0x26f254)),'logWarning':_0x49e693=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)]('⚠\x20'+_0x49e693)),'logDeleted':_0x144b5c=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)]('✔\x20'+_0x144b5c))},_0x4fb15e={'segment':_0x6ed082[_0x442e75(0x231)],'journey':_0x6ed082[_0x442e75(0x234)],'user':_0x6ed082[_0x442e75(0x252)],'connection':_0x6ed082[_0x442e75(0x232)]};_0x56cb34[_0x442e75(0x229)]>0x0&&(_0x3ab026=await executePushFolders(_0x4fb15e,_0x56cb34,_0x3ab026,{'parentId':_0x4125d0},_0x1bd359));const _0x25bdbe={'rootFolderId':_0x2675be,'folderPathToId':_0x3ab026,'folderIdToPath':_0x164f3c,'segmentNameToId':_0x4c8fa9,'activationsBySegmentId':_0x118a94,'emailToIdMap':_0x1c071a,'idToEmailMap':_0x2511fb,'connectionNameToIdMap':_0xf99f15[_0x442e75(0x250)],'connectionIdToNameMap':_0xf99f15[_0x442e75(0x1f0)],'connectionNameToTypeMap':_0xf9bea7},_0x1e832f=await executePushSegments(_0x4fb15e,_0x3559f0['journeysOnly']?[]:_0x8f1aa1,_0x25bdbe,{'parentId':_0x4125d0},_0x1bd359),_0x2ce961=_0x1e832f[_0x442e75(0x23e)],_0x23cfdf=_0x1e832f[_0x442e75(0x206)],_0x29938d=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x23e)],_0x41b1ee=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x206)],_0x3ad44f=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x22d)],_0x1873e4=await executePushSegmentDeletions(_0x4fb15e,_0x3559f0['journeysOnly']?[]:_0x2c1310,_0x1bd359);let _0x316c79=0x0,_0x404128=0x0,_0x477aec=0x0;const _0x2af236=new Map(_0x4c8fa9);for(const [_0x53796d,_0x5204d2]of _0x1e832f[_0x442e75(0x1bd)]){_0x2af236[_0x442e75(0x1ea)](_0x53796d,_0x5204d2);}if(_0xfc62b0[_0x442e75(0x229)]>0x0){const _0x14dacb={..._0x25bdbe,'segmentNameToId':_0x2af236,'existingSegments':_0x3df0f4,'activationContext':_0x4f4722},_0x189092=await executePushJourneys(_0x4fb15e,_0xfc62b0,_0x14dacb,{'parentId':_0x4125d0,'rootFolderId':_0x2675be,'verbose':_0x3559f0[_0x442e75(0x1fb)]},_0x1bd359);_0x316c79=_0x189092['created'],_0x404128=_0x189092['updated'];if(_0x40056b&&_0x189092[_0x442e75(0x1bf)][_0x442e75(0x229)]===0x1){const _0x1e46c3=_0x189092[_0x442e75(0x1bf)][0x0];if(_0x1e46c3[_0x442e75(0x226)]){const _0x38139a=getConsoleNextUrl(_0x3559f0[_0x442e75(0x212)],_0x442e75(0x1f9)+_0x4125d0+_0x442e75(0x20b)+_0x1e46c3['journeyId']+_0x442e75(0x1c5));console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x242)](_0x38139a));}}}for(const _0x2e6a64 of _0x2cd0f4){console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x21b)+_0x2e6a64['journeyBundleName'])),_0x477aec++;}const _0x15be24=[];if(_0x2ce961>0x0)_0x15be24['push'](_0x2ce961+_0x442e75(0x1e1));if(_0x23cfdf>0x0)_0x15be24['push'](_0x23cfdf+'\x20updated');if(_0x1873e4>0x0)_0x15be24[_0x442e75(0x255)](_0x1873e4+_0x442e75(0x208));const _0xefbbba=[];if(_0x316c79>0x0)_0xefbbba[_0x442e75(0x255)](_0x316c79+'\x20created');if(_0x404128>0x0)_0xefbbba[_0x442e75(0x255)](_0x404128+_0x442e75(0x1c7));if(_0x477aec>0x0)_0xefbbba[_0x442e75(0x255)](_0x477aec+_0x442e75(0x208));const _0x595a25=[];if(_0x29938d>0x0)_0x595a25[_0x442e75(0x255)](_0x29938d+_0x442e75(0x1e1));if(_0x41b1ee>0x0)_0x595a25[_0x442e75(0x255)](_0x41b1ee+_0x442e75(0x1c7));if(_0x3ad44f>0x0)_0x595a25['push'](_0x3ad44f+_0x442e75(0x208));return console['error'](a31_0x460526[_0x442e75(0x1c6)]('\x0a✔\x20Push\x20complete')),_0x15be24[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&console['error'](_0x442e75(0x24f)+_0x15be24[_0x442e75(0x1e4)](',\x20')),_0xefbbba[_0x442e75(0x229)]>0x0&&console[_0x442e75(0x1f3)](_0x442e75(0x23d)+_0xefbbba['join'](',\x20')),_0x595a25[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&console[_0x442e75(0x1f3)]('\x20\x20Activations:\x20'+_0x595a25[_0x442e75(0x1e4)](',\x20')),0x0;}}
1
+ const a31_0x16db10=a31_0x36af;function a31_0x3ddf(){const _0x5f34c7=['No\x20','isScoped','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','resolveParentId','join','4611786fTERdF','segment\x20or\x20journey','📁\x20','data','error','createdSegmentIds','setPhase','message','deleted','16918810sNDfFF','parent_name','parentFolder','Resolving\x20parent\x20segment\x20\x27','list','idToName','\x20\x20Activations:\x20','556577ZtcgPi','getJourney','diff','new','length','segment:push','5kqpQhJ','getParent','toString','no_parent','/j/da/je','red','add','798556kxhqed','buildUserMaps','\x20deleted','folders','Scoped\x20to\x20folder:\x20','6149416xkvsfJ','get','toUpdate','yes','scopedFolderPath','green','dryRun','(Journey\x20will\x20be\x20deleted)','connection','.yml','journeysOnly','/e/','yellow','listFolders','segments','description','created','cyan','name','Error:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','repeat','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Fetching\x20existing\x20folders...','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aPush\x20summary\x20for\x20\x27','Push\x20','\x20\x20📊\x20Segments:','delete','relationships','Error:\x20Directory\x20not\x20found:\x20','dim','\x20to\x20delete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','state','segmentFolderId','blue','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','New\x20segment:','\x0aValidation\x20failed:','endsWith','225LYoHcO','journey','journeys','errorCode','\x20\x20Segments:\x20','getOutputSchemaWithCache','toDelete','3SYcifq','verbose','\x20unchanged','Site:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','yamlConfig','\x20\x20\x20\x20','\x0a✔\x20Push\x20complete','activations','map','Changes\x20to:','site','Fetching\x20users\x20for\x20email\x20resolution...','New\x20journey:','\x20changed','file','toCreate','then','journeyId','Preparing\x20journeys...','all','\x27...','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20🗺️\x20\x20Journeys:','nameToId','helpText','Delete\x20segment:','Fetching\x20parent\x20segment\x20details...','\x20to\x20create','filter','versionNumber','set','results','/app/ps/','\x20new','listJourneysWithDetailsFromParentSegment','parentSegment','\x20to\x20update','journeyBundleId','execute','32936DAOGKR','2066960AncgYi','Aborted.','updated','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20updated','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyBundleName','targetDir','\x20YAML\x20files\x20found','Changes\x20to\x20journey:','\x20folders\x20to\x20create','Source\x20directory:\x20','audienceId','\x20activations]','isNew','segment','.yaml','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','type','push','existingJourney','Fetching\x20existing\x20activations...','folderId','attributes','\x20changes?','\x20\x20Source:\x20','folderPath','Parent\x20segment:\x20','Fetching\x20existing\x20journeys...','cwd'];a31_0x3ddf=function(){return _0x5f34c7;};return a31_0x3ddf();}function a31_0x36af(_0x28a363,_0x471248){_0x28a363=_0x28a363-0x130;const _0x3ddf54=a31_0x3ddf();let _0x36af83=_0x3ddf54[_0x28a363];return _0x36af83;}(function(_0x2d90de,_0x918a1d){const _0x308318=a31_0x36af,_0x3b8da5=_0x2d90de();while(!![]){try{const _0x32f55f=-parseInt(_0x308318(0x196))/0x1+parseInt(_0x308318(0x1a3))/0x2*(parseInt(_0x308318(0x139))/0x3)+parseInt(_0x308318(0x162))/0x4+parseInt(_0x308318(0x19c))/0x5*(-parseInt(_0x308318(0x186))/0x6)+-parseInt(_0x308318(0x1a8))/0x7+parseInt(_0x308318(0x161))/0x8*(parseInt(_0x308318(0x132))/0x9)+parseInt(_0x308318(0x18f))/0xa;if(_0x32f55f===_0x918a1d)break;else _0x3b8da5['push'](_0x3b8da5['shift']());}catch(_0x5ab8fb){_0x3b8da5['push'](_0x3b8da5['shift']());}}}(a31_0x3ddf,0x7bcf8));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x2cda6e from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a31_0x16db10(0x19b);[a31_0x16db10(0x1b7)]=a31_0x16db10(0x174);async[a31_0x16db10(0x160)](_0xe1aa25){const _0x3d981c=a31_0x16db10,{options:_0x363482,args:_0x38deef,tdx:_0x490c94}=_0xe1aa25,_0x1d463a=_0x363482,_0x282dc9=await resolveTarget({'arg':_0x38deef[0x0],'contextParent':_0x363482[_0x3d981c(0x15d)],'cwd':process[_0x3d981c(0x180)]()});if(!isSuccessfulResolution(_0x282dc9))return _0x282dc9[_0x3d981c(0x135)]===_0x3d981c(0x19f)?(console['error'](a31_0x2cda6e[_0x3d981c(0x1b4)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3d981c(0x13d)),console[_0x3d981c(0x18a)](_0x3d981c(0x183)),console[_0x3d981c(0x18a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x1bb)+_0x282dc9['message']+'\x0a')),_0x282dc9[_0x3d981c(0x152)]&&console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b9)](_0x282dc9[_0x3d981c(0x152)]))),0x1;if(_0x282dc9[_0x3d981c(0x175)]===_0x3d981c(0x190))return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)]('Error:\x20Directory\x20not\x20found:\x20'+_0x282dc9[_0x3d981c(0x16a)]+'\x0a')),console[_0x3d981c(0x18a)](a31_0x2cda6e['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x214f66=_0x282dc9['parentName'],_0x19ca64=_0x282dc9['targetDir'],_0xf1d1d2=_0x282dc9[_0x3d981c(0x175)]===_0x3d981c(0x148)?_0x282dc9['filePath']:undefined,_0xd84ddc=getScopedDetails(_0x282dc9),_0x4e9fb7=_0xd84ddc?.[_0x3d981c(0x182)]??![],_0x5ae5bd=_0xd84ddc?.[_0x3d981c(0x1ac)]??'';if(!existsSync(_0x19ca64))return console['error'](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x1c6)+_0x19ca64+'\x0a')),console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b9)](_0x3d981c(0x1cd))),0x1;_0x1d463a[_0x3d981c(0x13a)]&&(console[_0x3d981c(0x18a)](_0x3d981c(0x13c)+_0x1d463a[_0x3d981c(0x144)]),console['error'](_0x3d981c(0x17e)+_0x214f66),console[_0x3d981c(0x18a)](_0x3d981c(0x16e)+_0x19ca64),_0x4e9fb7&&console[_0x3d981c(0x18a)](_0x3d981c(0x1a7)+_0x5ae5bd));const _0x9d2496=await withSpinner(_0x3d981c(0x192)+_0x214f66+_0x3d981c(0x14e),()=>_0x490c94['segment'][_0x3d981c(0x184)](_0x214f66),{'verbose':_0x1d463a['verbose']}),_0x277fb6=_0x9d2496[_0x3d981c(0x189)],[_0x59a614,_0x434b1c,_0x30ea27,_0x1a6733,_0x46cab7]=await Promise[_0x3d981c(0x14d)]([withSpinner(_0x3d981c(0x154),()=>_0x490c94[_0x3d981c(0x172)][_0x3d981c(0x19d)](_0x277fb6),{'verbose':_0x1d463a[_0x3d981c(0x13a)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x490c94[_0x3d981c(0x172)]['listSegments'](_0x277fb6),{'verbose':_0x1d463a['verbose']}),withSpinner(_0x3d981c(0x1bf),()=>_0x490c94[_0x3d981c(0x172)][_0x3d981c(0x1b5)](_0x277fb6),{'verbose':_0x1d463a[_0x3d981c(0x13a)]}),withSpinner(_0x3d981c(0x17f),()=>_0x490c94[_0x3d981c(0x133)][_0x3d981c(0x15c)](_0x277fb6,{'includeAllVersions':!![]}),{'verbose':_0x1d463a[_0x3d981c(0x13a)]}),withSpinner(_0x3d981c(0x145),()=>_0x490c94['user'][_0x3d981c(0x1a4)](),{'verbose':_0x1d463a[_0x3d981c(0x13a)]})[_0x3d981c(0x14a)](_0x4d1e6c=>_0x4d1e6c['data'])]),_0x53b951=_0x59a614[_0x3d981c(0x189)],_0x9549c2=extractRootFolderId(_0x53b951),_0x4d59b4=_0x434b1c[_0x3d981c(0x189)],_0x2229e5=_0x30ea27[_0x3d981c(0x189)],{journeys:_0x3b0001,activationStepsById:_0x146edd}=_0x1a6733[_0x3d981c(0x189)],_0x1f60ea=new Map(_0x3b0001['map'](_0x3733df=>[_0x3733df['id'],_0x3733df])),_0x3e3db3=_0x3b0001[_0x3d981c(0x142)](_0x214545=>({'id':_0x214545['id'],'name':_0x214545[_0x3d981c(0x17a)]['name'],'journeyBundleName':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x169)]||'','journeyBundleId':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x15f)]||'','versionNumber':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x157)],'description':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x1b7)],'state':_0x214545['attributes'][_0x3d981c(0x1ca)],'paused':_0x214545[_0x3d981c(0x17a)]['paused'],'audienceId':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x16f)],'folderId':_0x214545[_0x3d981c(0x1c5)]?.[_0x3d981c(0x191)]?.[_0x3d981c(0x189)]?.['id'],'createdAt':_0x214545[_0x3d981c(0x17a)]['createdAt'],'updatedAt':_0x214545[_0x3d981c(0x17a)]['updatedAt']})),{emailToId:_0x2a2518,idToEmail:_0x48b1b5}=_0x46cab7,_0x184de6=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2c895b=_0x3d981c,_0xd503e9=await _0x490c94[_0x2c895b(0x1b0)][_0x2c895b(0x193)]();return buildConnectionMaps(_0xd503e9);},{'verbose':_0x1d463a[_0x3d981c(0x13a)]})[_0x3d981c(0x14a)](_0x5f55e6=>_0x5f55e6['data']),_0x35915d=_0x184de6['nameToId'],_0x37962e=_0x184de6[_0x3d981c(0x194)],_0xf66870=_0x184de6['nameToType'],_0x41292a={'emailToIdMap':_0x2a2518,'connectionNameToIdMap':_0x35915d,'connectionNameToTypeMap':_0xf66870,'getSchema':_0x173bbd=>_0x490c94[_0x3d981c(0x1b0)][_0x3d981c(0x137)](_0x173bbd)};let {pathToId:_0x4bc5d7,idToPath:_0x3a84d4}=buildFolderMaps(_0x2229e5);const _0x389cf6=buildSegmentLookupMap(_0x4d59b4,_0x3a84d4),_0x252f3c=buildSegmentNameToIdMap(_0x4d59b4),_0x22cb7d=buildJourneyBundleLookupMap(_0x3e3db3,_0x3a84d4);let _0x17831d;if(_0xf1d1d2){if(!_0xf1d1d2['endsWith'](_0x3d981c(0x1b1))&&!_0xf1d1d2[_0x3d981c(0x131)](_0x3d981c(0x173)))return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x14f)+_0xf1d1d2+'\x0a')),0x1;_0x17831d=[_0xf1d1d2];}else _0x17831d=findYamlFiles(_0x19ca64);if(_0x17831d[_0x3d981c(0x19a)]===0x0)return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x165)+_0x19ca64+'\x0a')),console['error'](a31_0x2cda6e['cyan'](_0x3d981c(0x1c9))),0x1;let _0x88d12a,_0x2b3463;try{const _0xa0c432=parseAndClassifyYamlFiles(_0x17831d,_0x19ca64,{'skipSegments':_0x1d463a[_0x3d981c(0x1b2)]});_0x88d12a=_0xa0c432[_0x3d981c(0x1b6)],_0x2b3463=_0xa0c432[_0x3d981c(0x134)];const _0xf0219=validateParsedFiles(_0xa0c432,_0x19ca64);if(_0xf0219[_0x3d981c(0x19a)]>0x0)return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x130))),console[_0x3d981c(0x18a)](formatValidationErrors(_0xf0219)),console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x168))),0x1;}catch(_0x552cfc){return console[_0x3d981c(0x18a)](a31_0x2cda6e['red']('Error\x20parsing\x20YAML:\x20'+(_0x552cfc instanceof Error?_0x552cfc[_0x3d981c(0x18d)]:_0x552cfc))),0x1;}if(_0x88d12a[_0x3d981c(0x19a)]===0x0&&_0x2b3463[_0x3d981c(0x19a)]===0x0){const _0x2f2bb9=_0x1d463a[_0x3d981c(0x1b2)]?_0x3d981c(0x133):_0x3d981c(0x187);return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x181)+_0x2f2bb9+_0x3d981c(0x16b))),0x0;}const _0x2589aa=new Map();_0x4d59b4[_0x3d981c(0x19a)]>0x0&&!_0x1d463a['journeysOnly']&&await withSpinner(_0x3d981c(0x178),async()=>{await batchAsync(_0x4d59b4,async _0x28a6ad=>{const _0x57a48a=a31_0x36af,_0xb5d0d3=await _0x490c94[_0x57a48a(0x172)]['listActivations'](_0x277fb6,_0x28a6ad['id']);_0x2589aa[_0x57a48a(0x158)](_0x28a6ad['id'],_0xb5d0d3);});},{'verbose':_0x1d463a['verbose']});const {segmentFiles:_0x34aa01,foldersToCreate:_0x2e9412}=await prepareSegmentFiles(_0x88d12a,{'segmentByFolderAndName':_0x389cf6,'activationsBySegmentId':_0x2589aa,'folderPathToId':_0x4bc5d7,'idToEmailMap':_0x48b1b5,'connectionIdToNameMap':_0x37962e},_0x41292a,_0x4e9fb7,_0x5ae5bd),_0x5ccdc8=_0xf1d1d2?[]:findSegmentsToDelete(_0x4d59b4,_0x88d12a[_0x3d981c(0x142)](({yamlConfig:_0x3dcc5f,folderPath:_0x2ebb98})=>({'yamlConfig':_0x3dcc5f,'folderPath':resolveTDFolderPath(_0x2ebb98,_0x4e9fb7,_0x5ae5bd)})),_0x3a84d4,_0x5ae5bd,_0x4e9fb7),{journeyFiles:_0x3d55fe,foldersToCreate:_0x1b9f73}=await withProgressSpinner(_0x3d981c(0x14c),async _0x56636b=>prepareJourneyFiles(_0x2b3463,{'fetchJourney':async _0x41bcb8=>_0x490c94[_0x3d981c(0x133)][_0x3d981c(0x197)](_0x41bcb8[_0x3d981c(0x14b)]),'journeyBundlesByFolderAndName':_0x22cb7d,'folderPathToId':_0x4bc5d7,'idToEmailMap':_0x48b1b5,'connectionIdToNameMap':_0x37962e,'existingSegments':_0x4d59b4,'parentId':_0x277fb6,'deps':_0x490c94,'progress':{'update':_0x43fb54=>{const _0x3e66a7=_0x3d981c;_0x56636b[_0x3e66a7(0x18c)](_0x43fb54),_0x1d463a[_0x3e66a7(0x13a)]&&console[_0x3e66a7(0x18a)]('\x20\x20'+_0x43fb54);}},'journeyById':_0x1f60ea,'activationStepsById':_0x146edd},_0x4e9fb7,_0x5ae5bd),{'verbose':_0x1d463a[_0x3d981c(0x13a)]})[_0x3d981c(0x14a)](_0x11cd60=>_0x11cd60[_0x3d981c(0x189)]);for(const _0x12e0f2 of _0x1b9f73){_0x2e9412[_0x3d981c(0x1a2)](_0x12e0f2);}const _0x1aebd5=_0xf1d1d2?[]:findJourneysToDelete(_0x3e3db3,_0x2b3463[_0x3d981c(0x142)](({yamlConfig:_0x23d393,folderPath:_0x13673a})=>({'yamlConfig':_0x23d393,'folderPath':resolveTDFolderPath(_0x13673a,_0x4e9fb7,_0x5ae5bd)})),_0x3a84d4,_0x5ae5bd,_0x4e9fb7),_0x34fce3=calculatePushStats(_0x34aa01,_0x3d55fe,_0x2e9412,_0x5ccdc8,_0x1aebd5,!!_0x1d463a['delete'],!!_0x1d463a['journeysOnly']),_0x262735=_0x34fce3[_0x3d981c(0x1b6)][_0x3d981c(0x199)],_0x9787b7=_0x34fce3['segments']['changed'],_0x492b3e=_0x34fce3[_0x3d981c(0x1b6)]['unchanged'],_0xd35789=_0x34fce3[_0x3d981c(0x1b6)]['toDelete'],_0x1b0bde=_0x34fce3[_0x3d981c(0x1a6)][_0x3d981c(0x149)],_0x4199f5=_0x34fce3[_0x3d981c(0x134)]['new'],_0xe6756a=_0x34fce3[_0x3d981c(0x134)]['changed'],_0x36e264=_0x34fce3['journeys']['unchanged'],_0x197ae4=_0x34fce3['journeys'][_0x3d981c(0x138)],_0x1fa064=_0x34fce3[_0x3d981c(0x141)][_0x3d981c(0x14d)],_0x1645a2=_0x34fce3['activations'][_0x3d981c(0x149)],_0x3f519f=_0x34fce3['activations'][_0x3d981c(0x1aa)],_0x19950a=_0x34fce3['activations'][_0x3d981c(0x138)];console['error'](_0x3d981c(0x1c1)+_0x214f66+'\x27:');_0x1b0bde[_0x3d981c(0x19a)]>0x0&&console[_0x3d981c(0x18a)]('\x20\x20'+a31_0x2cda6e['blue'](_0x3d981c(0x188)+_0x1b0bde[_0x3d981c(0x19a)]+_0x3d981c(0x16d)));if(!_0x1d463a[_0x3d981c(0x1b2)]){console[_0x3d981c(0x18a)](_0x3d981c(0x1c3)),console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e['green']('+\x20'+_0x262735[_0x3d981c(0x19a)]+_0x3d981c(0x15b))),console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1b4)]('~\x20'+_0x9787b7[_0x3d981c(0x19a)]+_0x3d981c(0x147)));if(_0xd35789['length']>0x0)console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e['red']('-\x20'+_0xd35789['length']+'\x20to\x20delete'));else _0x5ccdc8[_0x3d981c(0x19a)]>0x0&&!_0x1d463a[_0x3d981c(0x1c4)]&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e['dim'](_0x5ccdc8[_0x3d981c(0x19a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1c7)]('=\x20'+_0x492b3e['length']+_0x3d981c(0x13b)));}if(_0x3d55fe[_0x3d981c(0x19a)]>0x0||_0x1aebd5[_0x3d981c(0x19a)]>0x0){console[_0x3d981c(0x18a)](_0x3d981c(0x150)),console[_0x3d981c(0x18a)]('\x20\x20\x20\x20'+a31_0x2cda6e[_0x3d981c(0x1ad)]('+\x20'+_0x4199f5[_0x3d981c(0x19a)]+_0x3d981c(0x15b))),console['error'](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1b4)]('~\x20'+_0xe6756a['length']+_0x3d981c(0x147)));if(_0x197ae4[_0x3d981c(0x19a)]>0x0)console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1a1)]('-\x20'+_0x197ae4['length']+'\x20to\x20delete'));else _0x1aebd5['length']>0x0&&!_0x1d463a[_0x3d981c(0x1c4)]&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1c7)](_0x1aebd5[_0x3d981c(0x19a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1c7)]('=\x20'+_0x36e264[_0x3d981c(0x19a)]+_0x3d981c(0x13b)));}_0x1fa064[_0x3d981c(0x19a)]>0x0&&!_0x1d463a[_0x3d981c(0x1b2)]&&(console[_0x3d981c(0x18a)](''),console[_0x3d981c(0x18a)]('\x20\x20Activations:'),_0x1645a2['length']>0x0&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1ad)]('+\x20'+_0x1645a2['length']+_0x3d981c(0x155))),_0x3f519f[_0x3d981c(0x19a)]>0x0&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1b4)]('~\x20'+_0x3f519f[_0x3d981c(0x19a)]+_0x3d981c(0x15e))),_0x19950a[_0x3d981c(0x19a)]>0x0&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e['red']('-\x20'+_0x19950a[_0x3d981c(0x19a)]+_0x3d981c(0x1c8))));console[_0x3d981c(0x18a)](_0x3d981c(0x17c)+a31_0x2cda6e[_0x3d981c(0x1b9)](_0x19ca64)+'\x0a');if(_0x1b0bde[_0x3d981c(0x19a)]>0x0){console[_0x3d981c(0x18a)]('Folders\x20to\x20create:');for(const _0x156569 of _0x1b0bde){console[_0x3d981c(0x18a)]('\x20\x20'+a31_0x2cda6e[_0x3d981c(0x1cc)]('+')+'\x20'+_0x156569);}console[_0x3d981c(0x18a)]('');}if(_0x262735[_0x3d981c(0x19a)]>0x0&&!_0x1d463a[_0x3d981c(0x1b2)])for(const _0x32980a of _0x262735){const _0x518a26=_0x32980a[_0x3d981c(0x17d)]?_0x32980a[_0x3d981c(0x17d)]+'/'+_0x32980a[_0x3d981c(0x13e)]['name']:_0x32980a['yamlConfig'][_0x3d981c(0x1ba)],_0x54212c=_0x32980a[_0x3d981c(0x13e)][_0x3d981c(0x141)]?.[_0x3d981c(0x19a)]||0x0,_0x136545=_0x54212c>0x0?a31_0x2cda6e[_0x3d981c(0x1c7)]('\x20['+_0x54212c+_0x3d981c(0x170)):'';console['error']('\x0a'+a31_0x2cda6e[_0x3d981c(0x1ad)](_0x3d981c(0x1ce))+'\x20'+_0x518a26+_0x136545),console['error']('─'['repeat'](0x3c)),_0x32980a[_0x3d981c(0x198)]&&console[_0x3d981c(0x18a)](_0x32980a['diff']),console['error']('─'[_0x3d981c(0x1bd)](0x3c));}if(_0xd35789[_0x3d981c(0x19a)]>0x0&&!_0x1d463a[_0x3d981c(0x1b2)])for(const _0x4d3324 of _0xd35789){const _0x35b411=_0x4d3324[_0x3d981c(0x1cb)]?_0x3a84d4['get'](_0x4d3324['segmentFolderId'][_0x3d981c(0x19e)]())||'':'',_0x55f886=_0x35b411?_0x35b411+'/'+_0x4d3324[_0x3d981c(0x1ba)]:_0x4d3324['name'],_0x5c2c81=_0x2589aa['get'](_0x4d3324['id'])||[],_0x2c551d=_0x5c2c81[_0x3d981c(0x19a)]>0x0?a31_0x2cda6e[_0x3d981c(0x1c7)]('\x20['+_0x5c2c81[_0x3d981c(0x19a)]+'\x20activations]'):'';console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x153))+'\x20'+_0x55f886+_0x2c551d),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));const _0x46bd92=segmentWithActivationsToYaml(_0x4d3324,_0x5c2c81,undefined,_0x48b1b5,_0x37962e),_0x41c788=segmentToYamlString(_0x46bd92),_0x1e1dd7=generateDiff(_0x41c788,'');console[_0x3d981c(0x18a)](formatDiffWithColors(_0x1e1dd7)),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));}const _0x2e432b=_0x34aa01[_0x3d981c(0x156)](_0x1db990=>!_0x1db990['isNew']&&_0x1db990[_0x3d981c(0x198)]);if(_0x2e432b[_0x3d981c(0x19a)]>0x0&&!_0x1d463a['journeysOnly'])for(const _0x26c49c of _0x2e432b){const _0x560383=_0x26c49c['folderPath']?_0x26c49c['folderPath']+'/'+_0x26c49c['yamlConfig'][_0x3d981c(0x1ba)]:_0x26c49c[_0x3d981c(0x13e)][_0x3d981c(0x1ba)];console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x143))+'\x20'+_0x560383),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c)),console['error'](_0x26c49c[_0x3d981c(0x198)]),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));}if(_0x4199f5[_0x3d981c(0x19a)]>0x0)for(const _0x48d31b of _0x4199f5){const _0xc210bf=_0x48d31b[_0x3d981c(0x17d)]?_0x48d31b[_0x3d981c(0x17d)]+'/'+_0x48d31b['yamlConfig']['name']:_0x48d31b['yamlConfig'][_0x3d981c(0x1ba)];console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1ad)](_0x3d981c(0x146))+'\x20'+_0xc210bf),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c)),_0x48d31b['diff']&&console[_0x3d981c(0x18a)](_0x48d31b[_0x3d981c(0x198)]),console['error']('─'[_0x3d981c(0x1bd)](0x3c));}const _0x13cc6c=_0x3d55fe['filter'](_0xdc7af2=>!_0xdc7af2[_0x3d981c(0x171)]&&_0xdc7af2[_0x3d981c(0x198)]);if(_0x13cc6c[_0x3d981c(0x19a)]>0x0)for(const _0x56af26 of _0x13cc6c){const _0x313eca=_0x56af26[_0x3d981c(0x17d)]?_0x56af26[_0x3d981c(0x17d)]+'/'+_0x56af26['yamlConfig'][_0x3d981c(0x1ba)]:_0x56af26[_0x3d981c(0x13e)][_0x3d981c(0x1ba)];console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x16c))+'\x20'+_0x313eca),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c)),console[_0x3d981c(0x18a)](_0x56af26['diff']),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));}if(_0x197ae4[_0x3d981c(0x19a)]>0x0)for(const _0x13e8d9 of _0x197ae4){const _0x842a07=_0x13e8d9[_0x3d981c(0x179)]?_0x3a84d4[_0x3d981c(0x1a9)](_0x13e8d9['folderId'])||'':'',_0x42a9d9=_0x842a07?_0x842a07+'/'+_0x13e8d9['journeyBundleName']:_0x13e8d9[_0x3d981c(0x169)];console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1a1)]('Delete\x20journey:')+'\x20'+_0x42a9d9),console[_0x3d981c(0x18a)]('─'['repeat'](0x3c)),console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x1af))),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));}if(_0x1d463a[_0x3d981c(0x1ae)])return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x166))),0x0;const _0x4ed55a=_0x1d463a[_0x3d981c(0x1b2)]?![]:_0x262735[_0x3d981c(0x19a)]>0x0||_0x9787b7[_0x3d981c(0x19a)]>0x0||_0xd35789[_0x3d981c(0x19a)]>0x0,_0x5b78a8=_0x4199f5['length']>0x0||_0xe6756a[_0x3d981c(0x19a)]>0x0||_0x197ae4[_0x3d981c(0x19a)]>0x0,_0x491c0a=_0x1d463a[_0x3d981c(0x1b2)]?![]:_0x1fa064[_0x3d981c(0x19a)]>0x0,_0xb54366=_0x1b0bde[_0x3d981c(0x19a)]>0x0;if(!_0x4ed55a&&!_0x5b78a8&&!_0x491c0a&&!_0xb54366){const _0x4a7bc9=_0x1d463a[_0x3d981c(0x1b2)]?_0x3d981c(0x1c0):_0x3d981c(0x1bc);console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1ad)](_0x4a7bc9));if(_0xf1d1d2&&_0x36e264[_0x3d981c(0x19a)]===0x1){const _0xd7f290=_0x36e264[0x0];if(_0xd7f290[_0x3d981c(0x177)]?.['id']){const _0xbf524=getConsoleNextUrl(_0x1d463a[_0x3d981c(0x144)],_0x3d981c(0x15a)+_0x277fb6+_0x3d981c(0x1b3)+_0xd7f290[_0x3d981c(0x177)]['id']+_0x3d981c(0x1a0));console['error']('\x20\x20'+a31_0x2cda6e[_0x3d981c(0x1b9)](_0xbf524));}}return 0x0;}const _0x4dfce3=_0x1d463a[_0x3d981c(0x1b2)]?_0x4199f5['length']+_0xe6756a[_0x3d981c(0x19a)]+_0x197ae4[_0x3d981c(0x19a)]+_0x1b0bde[_0x3d981c(0x19a)]:_0x262735[_0x3d981c(0x19a)]+_0x9787b7[_0x3d981c(0x19a)]+_0xd35789[_0x3d981c(0x19a)]+_0x4199f5['length']+_0xe6756a[_0x3d981c(0x19a)]+_0x197ae4[_0x3d981c(0x19a)]+_0x1b0bde[_0x3d981c(0x19a)]+_0x1fa064[_0x3d981c(0x19a)];if(!_0x1d463a[_0x3d981c(0x1ab)]&&_0x4dfce3>0x0){const _0x8fe338=await confirmKey(_0x3d981c(0x1c2)+_0x4dfce3+_0x3d981c(0x17b));if(!_0x8fe338)return console['error'](_0x3d981c(0x163)),0x1;}const _0x9c7dcc={'withProgress':async(_0x1d0e27,_0x2c1d35)=>{const _0x933f4=_0x3d981c,_0x338197=await withSpinner(_0x1d0e27,_0x2c1d35,{'verbose':_0x1d463a[_0x933f4(0x13a)]});return{'data':_0x338197[_0x933f4(0x189)]};},'logInfo':_0x31128b=>console[_0x3d981c(0x18a)](a31_0x2cda6e['blue']('✔\x20'+_0x31128b)),'logSuccess':_0x214c37=>console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1ad)]('✔\x20'+_0x214c37)),'logWarning':_0x16ba7e=>console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)]('⚠\x20'+_0x16ba7e)),'logDeleted':_0x1a7536=>console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)]('✔\x20'+_0x1a7536))},_0x12fa25={'segment':_0x490c94['segment'],'journey':_0x490c94[_0x3d981c(0x133)],'user':_0x490c94['user'],'connection':_0x490c94[_0x3d981c(0x1b0)]};_0x1b0bde[_0x3d981c(0x19a)]>0x0&&(_0x4bc5d7=await executePushFolders(_0x12fa25,_0x1b0bde,_0x4bc5d7,{'parentId':_0x277fb6},_0x9c7dcc));const _0x11fda6={'rootFolderId':_0x9549c2,'folderPathToId':_0x4bc5d7,'folderIdToPath':_0x3a84d4,'segmentNameToId':_0x252f3c,'activationsBySegmentId':_0x2589aa,'emailToIdMap':_0x2a2518,'idToEmailMap':_0x48b1b5,'connectionNameToIdMap':_0x184de6[_0x3d981c(0x151)],'connectionIdToNameMap':_0x184de6[_0x3d981c(0x194)],'connectionNameToTypeMap':_0xf66870},_0x1fce7a=await executePushSegments(_0x12fa25,_0x1d463a[_0x3d981c(0x1b2)]?[]:_0x34aa01,_0x11fda6,{'parentId':_0x277fb6},_0x9c7dcc),_0x18a911=_0x1fce7a[_0x3d981c(0x1b8)],_0x3d3909=_0x1fce7a['updated'],_0x37164c=_0x1fce7a[_0x3d981c(0x141)]['created'],_0x4cb91e=_0x1fce7a[_0x3d981c(0x141)][_0x3d981c(0x164)],_0x3f3e67=_0x1fce7a[_0x3d981c(0x141)][_0x3d981c(0x18e)],_0x2ad8f6=await executePushSegmentDeletions(_0x12fa25,_0x1d463a[_0x3d981c(0x1b2)]?[]:_0xd35789,_0x9c7dcc);let _0x4c2f2a=0x0,_0x5c847f=0x0,_0x275cbe=0x0;const _0x190687=new Map(_0x252f3c);for(const [_0x2fcc68,_0x4880d0]of _0x1fce7a[_0x3d981c(0x18b)]){_0x190687[_0x3d981c(0x158)](_0x2fcc68,_0x4880d0);}if(_0x3d55fe[_0x3d981c(0x19a)]>0x0){const _0x229deb={..._0x11fda6,'segmentNameToId':_0x190687,'existingSegments':_0x4d59b4,'activationContext':_0x41292a},_0x15b9fe=await executePushJourneys(_0x12fa25,_0x3d55fe,_0x229deb,{'parentId':_0x277fb6,'rootFolderId':_0x9549c2,'verbose':_0x1d463a['verbose']},_0x9c7dcc);_0x4c2f2a=_0x15b9fe[_0x3d981c(0x1b8)],_0x5c847f=_0x15b9fe['updated'];if(_0xf1d1d2&&_0x15b9fe[_0x3d981c(0x159)][_0x3d981c(0x19a)]===0x1){const _0x2b33f0=_0x15b9fe['results'][0x0];if(_0x2b33f0[_0x3d981c(0x14b)]){const _0x1cc975=getConsoleNextUrl(_0x1d463a[_0x3d981c(0x144)],'/app/ps/'+_0x277fb6+_0x3d981c(0x1b3)+_0x2b33f0[_0x3d981c(0x14b)]+_0x3d981c(0x1a0));console['error']('\x20\x20'+a31_0x2cda6e[_0x3d981c(0x1b9)](_0x1cc975));}}}for(const _0x37d2ee of _0x197ae4){console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x1be)+_0x37d2ee[_0x3d981c(0x169)])),_0x275cbe++;}const _0x47f6fc=[];if(_0x18a911>0x0)_0x47f6fc[_0x3d981c(0x176)](_0x18a911+'\x20created');if(_0x3d3909>0x0)_0x47f6fc[_0x3d981c(0x176)](_0x3d3909+_0x3d981c(0x167));if(_0x2ad8f6>0x0)_0x47f6fc[_0x3d981c(0x176)](_0x2ad8f6+_0x3d981c(0x1a5));const _0x18dcfe=[];if(_0x4c2f2a>0x0)_0x18dcfe['push'](_0x4c2f2a+'\x20created');if(_0x5c847f>0x0)_0x18dcfe[_0x3d981c(0x176)](_0x5c847f+_0x3d981c(0x167));if(_0x275cbe>0x0)_0x18dcfe[_0x3d981c(0x176)](_0x275cbe+_0x3d981c(0x1a5));const _0x98d9b=[];if(_0x37164c>0x0)_0x98d9b[_0x3d981c(0x176)](_0x37164c+'\x20created');if(_0x4cb91e>0x0)_0x98d9b[_0x3d981c(0x176)](_0x4cb91e+_0x3d981c(0x167));if(_0x3f3e67>0x0)_0x98d9b['push'](_0x3f3e67+'\x20deleted');return console['error'](a31_0x2cda6e[_0x3d981c(0x1ad)](_0x3d981c(0x140))),_0x47f6fc['length']>0x0&&!_0x1d463a[_0x3d981c(0x1b2)]&&console[_0x3d981c(0x18a)](_0x3d981c(0x136)+_0x47f6fc[_0x3d981c(0x185)](',\x20')),_0x18dcfe['length']>0x0&&console[_0x3d981c(0x18a)]('\x20\x20Journeys:\x20'+_0x18dcfe['join'](',\x20')),_0x98d9b['length']>0x0&&!_0x1d463a[_0x3d981c(0x1b2)]&&console[_0x3d981c(0x18a)](_0x3d981c(0x195)+_0x98d9b[_0x3d981c(0x185)](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a32_0x3a1a4e=a32_0x3364;(function(_0x220113,_0x1a882b){const _0x4d352b=a32_0x3364,_0x446456=_0x220113();while(!![]){try{const _0x211b7d=parseInt(_0x4d352b(0xb7))/0x1+-parseInt(_0x4d352b(0x94))/0x2*(-parseInt(_0x4d352b(0xb6))/0x3)+-parseInt(_0x4d352b(0x9f))/0x4+-parseInt(_0x4d352b(0x8d))/0x5+parseInt(_0x4d352b(0xb8))/0x6*(-parseInt(_0x4d352b(0x8b))/0x7)+parseInt(_0x4d352b(0x8c))/0x8+parseInt(_0x4d352b(0x95))/0x9;if(_0x211b7d===_0x1a882b)break;else _0x446456['push'](_0x446456['shift']());}catch(_0x187db1){_0x446456['push'](_0x446456['shift']());}}}(a32_0x352f,0x9532a));function a32_0x352f(){const _0x1719d5=['yellow','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','data','includes','Resolving\x20folder\x20\x27','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','verbose','531978MBFkLm','1085334ASOzyj','24NOWToF','updateSegmentById','1901872DSyvxo','4705896Ekwtjm','5836985EDqnzJ','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','length','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','type','8HVxbYJ','12745341vmEdnt','kind','Resolving\x20path\x20\x27','rule','Parent\x20ID:\x20','resolveFolderId','segmentId','Resolved\x20type:\x20','parentId','\x27...','3734916NwZkvs','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','error','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:update','resolvePathToResource','✔\x20Updated\x20segment\x20\x27','Update\x20existing\x20child\x20segment','ruleFile','folder','name','INTERNAL'];a32_0x352f=function(){return _0x1719d5;};return a32_0x352f();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a32_0x3364(_0xa507a0,_0x2324c9){_0xa507a0=_0xa507a0-0x8b;const _0x352fa6=a32_0x352f();let _0x3364b7=_0x352fa6[_0xa507a0];return _0x3364b7;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a32_0x3b0f77 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a32_0x3a1a4e(0xaa)]=a32_0x3a1a4e(0xa4);['description']=a32_0x3a1a4e(0xa7);async[a32_0x3a1a4e(0xaf)](_0x10eece){const _0x1e1867=a32_0x3a1a4e;console[_0x1e1867(0xa2)](a32_0x3b0f77[_0x1e1867(0xac)](_0x1e1867(0x8e))),console['error'](a32_0x3b0f77[_0x1e1867(0xac)](_0x1e1867(0x8f)));const {options:_0x56a71a,args:_0x4fa394,tdx:_0x1e1ff1}=_0x10eece,_0xf17b73=_0x56a71a;if(_0x4fa394[_0x1e1867(0x90)]===0x0)return console['error'](_0x1e1867(0xa3)),console['error'](_0x1e1867(0xa1)),console[_0x1e1867(0xa2)]('Examples:'),console[_0x1e1867(0xa2)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x1e1867(0xa2)](_0x1e1867(0xae)),0x1;const _0x1cf282=_0x4fa394[0x0],_0x520a2c=_0x56a71a['segmentPath'];let _0x518793=_0x1cf282;_0x520a2c&&!_0x1cf282[_0x1e1867(0xb1)]('/')&&(_0x518793=_0x520a2c+'/'+_0x1cf282,_0xf17b73[_0x1e1867(0xb5)]&&console[_0x1e1867(0xa2)](_0x1e1867(0xb4)+_0x518793));const _0x4c03b8=await withSpinner(_0x1e1867(0x97)+_0x518793+_0x1e1867(0x9e),()=>_0x1e1ff1[_0x1e1867(0xad)][_0x1e1867(0xa5)](_0x518793),{'verbose':_0xf17b73[_0x1e1867(0xb5)]}),_0x4ecbe3=_0x4c03b8['data'];_0xf17b73[_0x1e1867(0xb5)]&&console['error'](_0x1e1867(0x9c)+_0x4ecbe3[_0x1e1867(0x93)]);if(_0x4ecbe3[_0x1e1867(0x93)]!==_0x1e1867(0xad))return console[_0x1e1867(0xa2)](_0x1e1867(0x92)+_0x4ecbe3['type']+_0x1e1867(0x91)),console[_0x1e1867(0xa2)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x4ecbe3[_0x1e1867(0x9b)])throw new SDKError(ErrorCode[_0x1e1867(0xab)],_0x1e1867(0xa0));const _0x3b3c79=_0x4ecbe3[_0x1e1867(0x9d)],_0x32620a=_0x4ecbe3[_0x1e1867(0x9b)];_0xf17b73['verbose']&&(console[_0x1e1867(0xa2)](_0x1e1867(0x99)+_0x3b3c79),console['error'](_0x1e1867(0xb3)+_0x32620a));let _0xe867b;if(_0xf17b73[_0x1e1867(0xa9)]){const _0x55c92c=_0xf17b73[_0x1e1867(0xa9)],_0x3bc594=await withSpinner(_0x1e1867(0xb2)+_0x55c92c+_0x1e1867(0x9e),()=>_0x1e1ff1[_0x1e1867(0xad)][_0x1e1867(0x9a)](_0x3b3c79,_0x55c92c),{'verbose':_0xf17b73[_0x1e1867(0xb5)]});_0xe867b=parseInt(_0x3bc594['data'],0xa),_0xf17b73['verbose']&&console['error']('Resolved\x20folder\x20ID:\x20'+_0xe867b);}const _0x45d334=await loadJSONFromOptions(_0xf17b73[_0x1e1867(0x98)],_0xf17b73[_0x1e1867(0xa8)]),_0x33beae={'name':_0xf17b73[_0x1e1867(0xaa)],'description':_0xf17b73['description'],'rule':_0x45d334,'kind':_0xf17b73[_0x1e1867(0x96)]!==undefined?parseInt(_0xf17b73['kind'],0xa):undefined,'segmentFolderId':_0xe867b},_0xebf3f4=await withSpinner('Updating\x20segment\x20\x27'+_0x4ecbe3['segmentName']+'\x27...',()=>_0x1e1ff1['segment'][_0x1e1867(0xb9)](_0x3b3c79,_0x32620a,_0x33beae),{'verbose':_0xf17b73[_0x1e1867(0xb5)]}),_0x42c8f4=_0xebf3f4[_0x1e1867(0xb0)];return console[_0x1e1867(0xa2)](_0x1e1867(0xa6)+_0x42c8f4['name']+'\x27'),_0x518793!==_0x1cf282&&console[_0x1e1867(0xa2)]('\x20\x20\x20Path:\x20'+_0x518793),await handleSDKOutput([_0x42c8f4],_0xf17b73),0x0;}}
1
+ const a32_0x1281d1=a32_0xd69a;(function(_0x130e65,_0x2fd81b){const _0x394d4d=a32_0xd69a,_0x53efe6=_0x130e65();while(!![]){try{const _0x501df4=-parseInt(_0x394d4d(0x184))/0x1+-parseInt(_0x394d4d(0x174))/0x2*(-parseInt(_0x394d4d(0x171))/0x3)+-parseInt(_0x394d4d(0x16d))/0x4*(-parseInt(_0x394d4d(0x16c))/0x5)+-parseInt(_0x394d4d(0x18c))/0x6*(parseInt(_0x394d4d(0x177))/0x7)+-parseInt(_0x394d4d(0x164))/0x8*(-parseInt(_0x394d4d(0x182))/0x9)+parseInt(_0x394d4d(0x175))/0xa+-parseInt(_0x394d4d(0x188))/0xb;if(_0x501df4===_0x2fd81b)break;else _0x53efe6['push'](_0x53efe6['shift']());}catch(_0x38f721){_0x53efe6['push'](_0x53efe6['shift']());}}}(a32_0x5de4,0xa3509));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x5de4(){const _0x3f14a9=['data','993300EVkmUT','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20relative\x20path\x20to:\x20','error','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','\x20\x20\x20Path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','424nJVtQO','description','segmentName','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','resolvePathToResource','Error:\x20Cannot\x20update\x20','segment','740IsQMPB','27812MhuWhB','resolveFolderId','yellow','segmentPath','10779oDwfxf','type','✔\x20Updated\x20segment\x20\x27','236fXLLXa','6744860XYMFVR','Segment\x20ID:\x20','14BoHwXh','length','execute','Resolved\x20type:\x20','parentId','kind','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20folder\x20ID:\x20','rule','folder','Resolving\x20path\x20\x27','117225cYRZxh','Segment\x20ID\x20missing\x20from\x20resolved\x20path','460512sdZniq','segmentId','Updating\x20segment\x20\x27','name','14930080hgBUuf','segment:update','\x27...'];a32_0x5de4=function(){return _0x3f14a9;};return a32_0x5de4();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a32_0xd69a(_0x3b64e1,_0xa1950d){_0x3b64e1=_0x3b64e1-0x163;const _0x5de458=a32_0x5de4();let _0xd69a65=_0x5de458[_0x3b64e1];return _0xd69a65;}import{SDKError,ErrorCode}from'../sdk/index.js';import a32_0x2e4f4e from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a32_0x1281d1(0x189);[a32_0x1281d1(0x165)]='Update\x20existing\x20child\x20segment';async[a32_0x1281d1(0x179)](_0x21f0e9){const _0x515598=a32_0x1281d1;console[_0x515598(0x18f)](a32_0x2e4f4e[_0x515598(0x16f)](_0x515598(0x163))),console['error'](a32_0x2e4f4e[_0x515598(0x16f)](_0x515598(0x193)));const {options:_0x1d2556,args:_0x179101,tdx:_0x342914}=_0x21f0e9,_0x11e86e=_0x1d2556;if(_0x179101[_0x515598(0x178)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x515598(0x18f)](_0x515598(0x17d)),console[_0x515598(0x18f)]('Examples:'),console[_0x515598(0x18f)](_0x515598(0x190)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2b6be1=_0x179101[0x0],_0x83e6d1=_0x1d2556[_0x515598(0x170)];let _0xba3d5e=_0x2b6be1;_0x83e6d1&&!_0x2b6be1['includes']('/')&&(_0xba3d5e=_0x83e6d1+'/'+_0x2b6be1,_0x11e86e[_0x515598(0x191)]&&console[_0x515598(0x18f)](_0x515598(0x18e)+_0xba3d5e));const _0x17ece1=await withSpinner(_0x515598(0x181)+_0xba3d5e+_0x515598(0x18a),()=>_0x342914[_0x515598(0x16b)][_0x515598(0x169)](_0xba3d5e),{'verbose':_0x11e86e['verbose']}),_0x11ec3d=_0x17ece1[_0x515598(0x18b)];_0x11e86e[_0x515598(0x191)]&&console[_0x515598(0x18f)](_0x515598(0x17a)+_0x11ec3d[_0x515598(0x172)]);if(_0x11ec3d[_0x515598(0x172)]!==_0x515598(0x16b))return console[_0x515598(0x18f)](_0x515598(0x16a)+_0x11ec3d['type']+_0x515598(0x18d)),console[_0x515598(0x18f)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x11ec3d[_0x515598(0x185)])throw new SDKError(ErrorCode['INTERNAL'],_0x515598(0x183));const _0x5e14c5=_0x11ec3d[_0x515598(0x17b)],_0x2f109c=_0x11ec3d[_0x515598(0x185)];_0x11e86e[_0x515598(0x191)]&&(console[_0x515598(0x18f)](_0x515598(0x168)+_0x5e14c5),console[_0x515598(0x18f)](_0x515598(0x176)+_0x2f109c));let _0x148c81;if(_0x11e86e[_0x515598(0x180)]){const _0x610b28=_0x11e86e[_0x515598(0x180)],_0x29fb2e=await withSpinner(_0x515598(0x167)+_0x610b28+_0x515598(0x18a),()=>_0x342914[_0x515598(0x16b)][_0x515598(0x16e)](_0x5e14c5,_0x610b28),{'verbose':_0x11e86e[_0x515598(0x191)]});_0x148c81=parseInt(_0x29fb2e[_0x515598(0x18b)],0xa),_0x11e86e[_0x515598(0x191)]&&console['error'](_0x515598(0x17e)+_0x148c81);}const _0x524527=await loadJSONFromOptions(_0x11e86e[_0x515598(0x17f)],_0x11e86e['ruleFile']),_0x8a1a6b={'name':_0x11e86e[_0x515598(0x187)],'description':_0x11e86e['description'],'rule':_0x524527,'kind':_0x11e86e[_0x515598(0x17c)]!==undefined?parseInt(_0x11e86e[_0x515598(0x17c)],0xa):undefined,'segmentFolderId':_0x148c81},_0x251a3f=await withSpinner(_0x515598(0x186)+_0x11ec3d[_0x515598(0x166)]+_0x515598(0x18a),()=>_0x342914[_0x515598(0x16b)]['updateSegmentById'](_0x5e14c5,_0x2f109c,_0x8a1a6b),{'verbose':_0x11e86e[_0x515598(0x191)]}),_0x5d7a42=_0x251a3f[_0x515598(0x18b)];return console['error'](_0x515598(0x173)+_0x5d7a42[_0x515598(0x187)]+'\x27'),_0xba3d5e!==_0x2b6be1&&console[_0x515598(0x18f)](_0x515598(0x192)+_0xba3d5e),await handleSDKOutput([_0x5d7a42],_0x11e86e),0x0;}}
@@ -1 +1 @@
1
- const a33_0x46cf5b=a33_0x4a1c;(function(_0x3d08c5,_0xb663ae){const _0x2d15bc=a33_0x4a1c,_0x2c69ff=_0x3d08c5();while(!![]){try{const _0x6dcf=parseInt(_0x2d15bc(0x85))/0x1+-parseInt(_0x2d15bc(0x93))/0x2+parseInt(_0x2d15bc(0xb6))/0x3*(-parseInt(_0x2d15bc(0x86))/0x4)+-parseInt(_0x2d15bc(0x8d))/0x5*(-parseInt(_0x2d15bc(0x99))/0x6)+-parseInt(_0x2d15bc(0xaa))/0x7+parseInt(_0x2d15bc(0xa5))/0x8+-parseInt(_0x2d15bc(0xa4))/0x9*(-parseInt(_0x2d15bc(0x91))/0xa);if(_0x6dcf===_0xb663ae)break;else _0x2c69ff['push'](_0x2c69ff['shift']());}catch(_0x556231){_0x2c69ff['push'](_0x2c69ff['shift']());}}}(a33_0x3ed7,0xdec73));function a33_0x4a1c(_0xb66d27,_0x40d15d){_0xb66d27=_0xb66d27-0x7b;const _0x3ed781=a33_0x3ed7();let _0x4a1c79=_0x3ed781[_0xb66d27];return _0x4a1c79;}import{existsSync,statSync}from'fs';import a33_0x5d2d04 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a33_0x3ed7(){const _0x5169b8=['4707peDgQt','13671016mpWMNw','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','folderPath','7264096dnsJWV','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','segmentPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','join','segment','Use:\x20tdx\x20segment\x20use\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','name','green','9tTPvXY','error','site','session','data','cyan','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','isAbsolute','type','parentName','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','617811LgAjCm','827636lgrZzv','fullPath','Site:\x20','segments','\x27...','verbose','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','700FWaroG','segment:use','split','Resolving\x20path\x20\x27','35770YqIEBq','parentId','3538890iFqkQb','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Error:\x20Path\x20is\x20required\x0a','slice','red','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','6126rJbChQ','Examples:','✔\x20Context\x20set\x20to:\x20','config','description','dim','folderId','log','length','Resolved\x20path\x20type:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context'];a33_0x3ed7=function(){return _0x5169b8;};return a33_0x3ed7();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x46cf5b(0xb4)]=a33_0x46cf5b(0x8e);[a33_0x46cf5b(0x9d)]=a33_0x46cf5b(0xad);async['execute'](_0x3ad962){const _0x397078=a33_0x46cf5b,{options:_0x5edc00,args:_0x19eca2,tdx:_0x4d4e67}=_0x3ad962;if(_0x19eca2[_0x397078(0xa1)]===0x0)return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x95))),console[_0x397078(0x7b)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x397078(0x7b)](_0x397078(0x9a)),console[_0x397078(0x7b)](_0x397078(0x80)),console['error'](_0x397078(0x94)),console[_0x397078(0x7b)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x397078(0x7b)](_0x397078(0xae)),0x1;const _0x5794f1=_0x19eca2[0x0],_0x3fc88f=_0x5edc00[_0x397078(0x7d)];try{if(_0x5794f1==='/')return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0xb3))),0x0;if(existsSync(_0x5794f1)&&statSync(_0x5794f1)['isDirectory']()){let _0x1666ba;try{_0x1666ba=findTdxConfig(_0x5794f1);}catch{return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x8c)+_0x5794f1)),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)](_0x397078(0xb2))),0x1;}const _0xce6969=_0x1666ba[_0x397078(0x9c)]['parent_segment'];return saveSessionContext({'segment_path':_0xce6969,'parent_segment':_0xce6969},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04['green'](_0x397078(0x9b)+a33_0x5d2d04[_0x397078(0x7f)](_0xce6969))),0x0;}const _0x3e8a8e=_0x5edc00[_0x397078(0xac)];let _0x3af29e=_0x5794f1;const _0x359fb3=parsePath(_0x5794f1);if(!_0x359fb3[_0x397078(0x81)]){if(!_0x3e8a8e)return console['error'](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0xa6))),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x5794f1==='..'){const _0xb34bb6=_0x3e8a8e[_0x397078(0x8f)]('/')[_0x397078(0x96)](0x0,-0x1)[_0x397078(0xaf)]('/');_0x3af29e=_0xb34bb6||'/';}else _0x5794f1==='.'?_0x3af29e=_0x3e8a8e:_0x3af29e=_0x3e8a8e+'/'+_0x5794f1;_0x5edc00['verbose']&&console['error'](_0x397078(0xa8)+_0x3af29e);}if(_0x3af29e==='/'||_0x3af29e==='')return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3af29e=normalizePath(_0x3af29e);const _0x29263b=parsePath(_0x3af29e)[_0x397078(0x89)];if(_0x29263b[_0x397078(0xa1)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0xb3))),0x0;_0x5edc00[_0x397078(0x8b)]&&(console[_0x397078(0x7b)](_0x397078(0x88)+_0x5edc00[_0x397078(0x7c)]),console[_0x397078(0x7b)]('Target\x20path:\x20'+_0x3af29e));const _0x2f6ca3=await withSpinner(_0x397078(0x90)+_0x3af29e+_0x397078(0x8a),()=>_0x4d4e67['segment'][_0x397078(0xa7)](_0x3af29e),{'verbose':_0x5edc00['verbose']}),_0x174b87=_0x2f6ca3[_0x397078(0x7e)];_0x5edc00[_0x397078(0x8b)]&&(console[_0x397078(0x7b)](_0x397078(0xa2)+_0x174b87[_0x397078(0x82)]),console['error']('Parent\x20ID:\x20'+_0x174b87[_0x397078(0x92)]),_0x174b87[_0x397078(0x9f)]&&console['error']('Folder\x20ID:\x20'+_0x174b87['folderId']));if(_0x174b87[_0x397078(0x82)]===_0x397078(0xb0))return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x84))),console[_0x397078(0x7b)](_0x397078(0x98)),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)](_0x397078(0xb1)+_0x174b87[_0x397078(0x83)]+(_0x174b87[_0x397078(0xa9)]?'/'+_0x174b87['folderPath'][_0x397078(0xaf)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x174b87[_0x397078(0x87)],'parent_segment':_0x174b87[_0x397078(0x83)]},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0x9b)+a33_0x5d2d04['cyan'](_0x174b87[_0x397078(0x87)]))),_0x5edc00['verbose']&&(console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x9e)](_0x397078(0xa3))),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x9e)](_0x397078(0xab)))),0x0;}catch(_0x53c9b6){throw _0x53c9b6;}}}
1
+ const a33_0x38a3e6=a33_0x312a;(function(_0xf36978,_0x5b331f){const _0x4355e0=a33_0x312a,_0x156e8e=_0xf36978();while(!![]){try{const _0x5d093b=-parseInt(_0x4355e0(0x1a3))/0x1*(parseInt(_0x4355e0(0x1cb))/0x2)+parseInt(_0x4355e0(0x1d1))/0x3+parseInt(_0x4355e0(0x1a1))/0x4+-parseInt(_0x4355e0(0x1cc))/0x5+-parseInt(_0x4355e0(0x1ac))/0x6*(-parseInt(_0x4355e0(0x1c4))/0x7)+parseInt(_0x4355e0(0x19f))/0x8+parseInt(_0x4355e0(0x1c2))/0x9;if(_0x5d093b===_0x5b331f)break;else _0x156e8e['push'](_0x156e8e['shift']());}catch(_0x335213){_0x156e8e['push'](_0x156e8e['shift']());}}}(a33_0x5e8d,0x530c9));import{existsSync,statSync}from'fs';import a33_0x50e8dc from'chalk';function a33_0x5e8d(){const _0x219224=['Resolving\x20path\x20\x27','error','parentName','data','execute','type','585696uNUdlO','slice','991844dYbEzU','segments','1uocOhR','Folder\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','verbose','Target\x20path:\x20','segmentPath','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','folderPath','name','1728bTJHSQ','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','log','Site:\x20','Use:\x20tdx\x20segment\x20use\x20','length','Examples:','parentId','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Parent\x20ID:\x20','folderId','✔\x20Context\x20set\x20to:\x20','isAbsolute','dim','fullPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment','description','4152996rNsreV','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','280VMMJKS','isDirectory','split','config','red','resolvePathToResource','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','838330BcrtJj','754865wIgrPk','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','cyan','green','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','348510LBYdxP','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','session'];a33_0x5e8d=function(){return _0x219224;};return a33_0x5e8d();}function a33_0x312a(_0x5503d1,_0x2d20ce){_0x5503d1=_0x5503d1-0x197;const _0x5e8d6f=a33_0x5e8d();let _0x312aa8=_0x5e8d6f[_0x5503d1];return _0x312aa8;}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x38a3e6(0x1ab)]=a33_0x38a3e6(0x1af);[a33_0x38a3e6(0x1c1)]=a33_0x38a3e6(0x197);async[a33_0x38a3e6(0x19d)](_0x373290){const _0x40ab74=a33_0x38a3e6,{options:_0x20630a,args:_0x5ad31c,tdx:_0x25ad4a}=_0x373290;if(_0x5ad31c[_0x40ab74(0x1b5)]===0x0)return console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1c8)]('Error:\x20Path\x20is\x20required\x0a')),console['error'](_0x40ab74(0x1ad)),console[_0x40ab74(0x19a)](_0x40ab74(0x1b6)),console['error'](_0x40ab74(0x1a9)),console[_0x40ab74(0x19a)](_0x40ab74(0x1c3)),console[_0x40ab74(0x19a)](_0x40ab74(0x1cd)),console[_0x40ab74(0x19a)](_0x40ab74(0x1d0)),0x1;const _0x8a4e4f=_0x5ad31c[0x0],_0x1bbf4f=_0x20630a[_0x40ab74(0x198)];try{if(_0x8a4e4f==='/')return saveSessionContext({'segment_path':undefined},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)](_0x40ab74(0x1b8))),0x0;if(existsSync(_0x8a4e4f)&&statSync(_0x8a4e4f)[_0x40ab74(0x1c5)]()){let _0x316643;try{_0x316643=findTdxConfig(_0x8a4e4f);}catch{return console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1c8)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x8a4e4f)),console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1ce)](_0x40ab74(0x1bf))),0x1;}const _0x44f9c9=_0x316643[_0x40ab74(0x1c7)]['parent_segment'];return saveSessionContext({'segment_path':_0x44f9c9,'parent_segment':_0x44f9c9},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)](_0x40ab74(0x1bb)+a33_0x50e8dc[_0x40ab74(0x1ce)](_0x44f9c9))),0x0;}const _0x317cb3=_0x20630a[_0x40ab74(0x1a8)];let _0x324743=_0x8a4e4f;const _0x167c0f=parsePath(_0x8a4e4f);if(!_0x167c0f[_0x40ab74(0x1bc)]){if(!_0x317cb3)return console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1c8)](_0x40ab74(0x1ae))),console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1ce)](_0x40ab74(0x1b1))),0x1;if(_0x8a4e4f==='..'){const _0xd7a2c=_0x317cb3[_0x40ab74(0x1c6)]('/')[_0x40ab74(0x1a0)](0x0,-0x1)['join']('/');_0x324743=_0xd7a2c||'/';}else _0x8a4e4f==='.'?_0x324743=_0x317cb3:_0x324743=_0x317cb3+'/'+_0x8a4e4f;_0x20630a[_0x40ab74(0x1a6)]&&console[_0x40ab74(0x19a)](_0x40ab74(0x1a5)+_0x324743);}if(_0x324743==='/'||_0x324743==='')return saveSessionContext({'segment_path':undefined},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)](_0x40ab74(0x1b8))),0x0;_0x324743=normalizePath(_0x324743);const _0x3a3e67=parsePath(_0x324743)[_0x40ab74(0x1a2)];if(_0x3a3e67[_0x40ab74(0x1b5)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)](_0x40ab74(0x1b8))),0x0;_0x20630a[_0x40ab74(0x1a6)]&&(console['error'](_0x40ab74(0x1b3)+_0x20630a['site']),console['error'](_0x40ab74(0x1a7)+_0x324743));const _0x3302bf=await withSpinner(_0x40ab74(0x199)+_0x324743+'\x27...',()=>_0x25ad4a[_0x40ab74(0x1c0)][_0x40ab74(0x1c9)](_0x324743),{'verbose':_0x20630a['verbose']}),_0x1785a2=_0x3302bf[_0x40ab74(0x19c)];_0x20630a[_0x40ab74(0x1a6)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x1785a2[_0x40ab74(0x19e)]),console[_0x40ab74(0x19a)](_0x40ab74(0x1b9)+_0x1785a2[_0x40ab74(0x1b7)]),_0x1785a2[_0x40ab74(0x1ba)]&&console[_0x40ab74(0x19a)](_0x40ab74(0x1a4)+_0x1785a2[_0x40ab74(0x1ba)]));if(_0x1785a2[_0x40ab74(0x19e)]==='segment')return console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1c8)](_0x40ab74(0x1ca))),console[_0x40ab74(0x19a)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a33_0x50e8dc[_0x40ab74(0x1ce)](_0x40ab74(0x1b4)+_0x1785a2[_0x40ab74(0x19b)]+(_0x1785a2[_0x40ab74(0x1aa)]?'/'+_0x1785a2[_0x40ab74(0x1aa)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1785a2['fullPath'],'parent_segment':_0x1785a2['parentName']},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)]('✔\x20Context\x20set\x20to:\x20'+a33_0x50e8dc[_0x40ab74(0x1ce)](_0x1785a2[_0x40ab74(0x1be)]))),_0x20630a[_0x40ab74(0x1a6)]&&(console['error'](a33_0x50e8dc[_0x40ab74(0x1bd)](_0x40ab74(0x1b0))),console['error'](a33_0x50e8dc['dim']('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x2c935a){throw _0x2c935a;}}}