@treasuredata/tdx 0.16.13 → 0.16.15

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 (167) 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.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/anthropic-adapter.js +1 -1
  65. package/dist/proxy/claude-usage-tracker.js +1 -1
  66. package/dist/proxy/context-signature.js +1 -1
  67. package/dist/proxy/conversation-utils.js +1 -1
  68. package/dist/proxy/passthrough-server.js +1 -1
  69. package/dist/proxy/server.js +1 -1
  70. package/dist/proxy/session-cache.js +1 -1
  71. package/dist/proxy/sse-usage-parser.js +1 -1
  72. package/dist/sdk/agent/agent-config.js +1 -1
  73. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  74. package/dist/sdk/agent/agent-yaml.js +1 -1
  75. package/dist/sdk/agent/test/evaluator.js +1 -1
  76. package/dist/sdk/agent/test/executor.js +1 -1
  77. package/dist/sdk/agent/test/index.js +1 -1
  78. package/dist/sdk/agent/test/output.js +1 -1
  79. package/dist/sdk/agent/test/parser.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/endpoints.js +1 -1
  83. package/dist/sdk/client/engage-api-client.js +1 -1
  84. package/dist/sdk/client/http-client.js +1 -1
  85. package/dist/sdk/client/llm-api-client.js +1 -1
  86. package/dist/sdk/client/rate-limiter.js +1 -1
  87. package/dist/sdk/client/td-api-client.js +1 -1
  88. package/dist/sdk/client/trino-api-client.js +1 -1
  89. package/dist/sdk/client/workflow-client.js +1 -1
  90. package/dist/sdk/connection-validator.js +1 -1
  91. package/dist/sdk/connection.js +1 -1
  92. package/dist/sdk/engage.js +1 -1
  93. package/dist/sdk/errors.js +1 -1
  94. package/dist/sdk/index.js +1 -1
  95. package/dist/sdk/io/index.js +1 -1
  96. package/dist/sdk/io/node-filesystem.js +1 -1
  97. package/dist/sdk/job.js +1 -1
  98. package/dist/sdk/journey.js +1 -1
  99. package/dist/sdk/llm/chat-cache.js +1 -1
  100. package/dist/sdk/llm/index.js +1 -1
  101. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  102. package/dist/sdk/llm/model-aliases.js +1 -1
  103. package/dist/sdk/llm/model-factors.js +1 -1
  104. package/dist/sdk/query/index.js +1 -1
  105. package/dist/sdk/query/sql-parser.js +1 -1
  106. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  107. package/dist/sdk/segment/fields-display.js +1 -1
  108. package/dist/sdk/segment/file-discovery.js +1 -1
  109. package/dist/sdk/segment/journey-utils.js +1 -1
  110. package/dist/sdk/segment/journey-yaml.js +1 -1
  111. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  112. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  113. package/dist/sdk/segment/pull-workflow.js +1 -1
  114. package/dist/sdk/segment/push-workflow.js +1 -1
  115. package/dist/sdk/segment/resolution-context.js +1 -1
  116. package/dist/sdk/segment/segment-path-parser.js +1 -1
  117. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  118. package/dist/sdk/segment/target-resolution.js +1 -1
  119. package/dist/sdk/segment/tdx-config.js +1 -1
  120. package/dist/sdk/segment/validate-files.js +1 -1
  121. package/dist/sdk/segment/yaml-validator.js +1 -1
  122. package/dist/sdk/segment.js +1 -1
  123. package/dist/sdk/types/index.js +1 -1
  124. package/dist/sdk/types/progress.js +1 -1
  125. package/dist/sdk/user.js +1 -1
  126. package/dist/sdk/util/format-detector.js +1 -1
  127. package/dist/sdk/util/formatters.js +1 -1
  128. package/dist/sdk/util/index.js +1 -1
  129. package/dist/sdk/util/tree-formatter.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.js +1 -1
  148. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  149. package/dist/utils/logger/formatters/index.js +1 -1
  150. package/dist/utils/logger/handlers/console-handler.js +1 -1
  151. package/dist/utils/logger/handlers/file-handler.js +1 -1
  152. package/dist/utils/logger/handlers/index.js +1 -1
  153. package/dist/utils/logger/handlers/null-handler.js +1 -1
  154. package/dist/utils/logger/index.js +1 -1
  155. package/dist/utils/logger/logger.js +1 -1
  156. package/dist/utils/logger/types.js +1 -1
  157. package/dist/utils/option-validation.js +1 -1
  158. package/dist/utils/port.js +1 -1
  159. package/dist/utils/process.js +1 -1
  160. package/dist/utils/prompt.js +1 -1
  161. package/dist/utils/spinner.js +1 -1
  162. package/dist/utils/sse-parser.js +1 -1
  163. package/dist/utils/string-utils.js +1 -1
  164. package/dist/utils/table-ref-parser.js +1 -1
  165. package/dist/utils/tdx-logger.js +1 -1
  166. package/dist/utils/version-check.js +1 -1
  167. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x3805cc=a27_0x2522;(function(_0x181dd9,_0x14b232){const _0x143d69=a27_0x2522,_0x4f3b0b=_0x181dd9();while(!![]){try{const _0x50e669=parseInt(_0x143d69(0x10f))/0x1+parseInt(_0x143d69(0xbb))/0x2*(-parseInt(_0x143d69(0xd0))/0x3)+parseInt(_0x143d69(0xfc))/0x4*(-parseInt(_0x143d69(0xbc))/0x5)+-parseInt(_0x143d69(0xd5))/0x6+-parseInt(_0x143d69(0xf5))/0x7+parseInt(_0x143d69(0x11a))/0x8+parseInt(_0x143d69(0xf1))/0x9*(parseInt(_0x143d69(0x11d))/0xa);if(_0x50e669===_0x14b232)break;else _0x4f3b0b['push'](_0x4f3b0b['shift']());}catch(_0x495e7c){_0x4f3b0b['push'](_0x4f3b0b['shift']());}}}(a27_0x26cb,0x20010));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a27_0x2522(_0x20ca03,_0x422a0b){_0x20ca03=_0x20ca03-0x90;const _0x26cbbf=a27_0x26cb();let _0x25223f=_0x26cbbf[_0x20ca03];return _0x25223f;}function a27_0x26cb(){const _0x23581c=['Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Fetching\x20SQL\x20for\x20segment...','processedRows','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:show','✔\x20Created\x20folder\x20\x27','SEGMENT_FOLDER_NOT_FOUND','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Fetching\x20parent\x20segment\x20details...','site','Fetching\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','getFolder','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','SEGMENT_NOT_FOUND','type','data','Listing\x20folders\x20for\x20parent\x20\x27','folderId','Folder\x20ID:\x20','segment:folder:list','/app/ps/','segment','(root)','Use:\x20tdx\x20ps\x20show','15687CNNcOi','segment:folder:create','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','1734306xjUWen','cause','listFolders','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Resolving\x20parent\x20folder\x20\x27','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','log','804mgfwhw','trim','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','test','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20Opening\x20','length','message','Folder\x20name:\x20','Parent\x20ID:\x20','segment:desc','folder','Resolving\x20parent\x20segment\x20\x27','information_schema','setJobId','segmentPath','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','187377okSsfi','Executing\x20segment\x20query...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Options:','Create\x20segment\x20folder\x20for\x20organization','execute','url','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Get\x20SQL\x20query\x20for\x20child\x20segment','segmentName','segmentId','1198936bnqDyy','replace','code','1310VAPLUq','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','name','toLocaleString','jobId','\x20\x20Parent\x20segment:\x20','Creating\x20folder\x20\x27','fullPath','segment:folder:show','✔\x20Found\x20','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','parentSegment','/e/','verbose','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','elapsedTimeMillis','segment:sql','jsonl','green','query','Use:\x20tdx\x20ps\x20view\x20-w','parentFolder','folderPath','getParent','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','description','parent','includes','SQL\x20query:\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20folder\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','getSegmentSQL','Fetching\x20segment\x20details...','\x20\x20Segment\x20name:\x20','Examples:','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','✔\x20Query\x20completed:\x20Processed\x20','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','INVALID_ARGUMENT','segment:view','\x27\x20with\x20ID:\x20','Segment\x20ID:\x20','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','limit','Use:\x20tdx\x20ps\x20view','resolvePathToResource','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','SELECT\x20*\x20FROM\x20(\x0a','createFolder','2eNdtPI','2505ewUlUV','Resolved\x20relative\x20path\x20to:\x20','\x20\x20Cause:\x20','parentId','Resolving\x20\x27','resolveParentId','getSegment','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','format','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x27...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','stats','Resolved\x20type:\x20','error','Parent\x20name:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','105711YTasHi','Show\x20segment\x20folder\x20details','Error:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','304758EvlCxg','resolveFolderId'];a27_0x26cb=function(){return _0x23581c;};return a27_0x26cb();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x4f0969 from'chalk';async function resolveSegmentTarget(_0x391b63,_0x36656b,_0xfb5d6){const _0x174a9f=a27_0x2522;if(isYamlFilePath(_0x391b63))try{const _0x47093c=await resolveYamlFilePath(_0x391b63);return _0xfb5d6&&(console[_0x174a9f(0xcd)](_0x174a9f(0xc3)+_0x391b63),console[_0x174a9f(0xcd)](_0x174a9f(0x122)+_0x47093c[_0x174a9f(0x129)]),console[_0x174a9f(0xcd)](_0x174a9f(0xa9)+_0x47093c[_0x174a9f(0x118)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x47093c[_0x174a9f(0x98)]||_0x174a9f(0xef))),console[_0x174a9f(0xcd)]('\x20\x20Full\x20path:\x20'+_0x47093c[_0x174a9f(0x124)])),_0x47093c['fullPath'];}catch(_0x44eab9){throw new SDKError(ErrorCode[_0x174a9f(0xaf)],_0x174a9f(0xab)+_0x44eab9[_0x174a9f(0x105)]);}if(!_0x36656b)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x174a9f(0xfa));return _0x36656b+'/'+_0x391b63;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x3805cc(0x11f)]='segment:describe';[a27_0x3805cc(0x9d)]=a27_0x3805cc(0x127);async['execute'](_0x48ecb5){const _0x7915e3=a27_0x3805cc,{options:_0x564ec1,args:_0x4c7055,tdx:_0x2445e8}=_0x48ecb5,_0x58b613=_0x4c7055[0x0],_0x591b0e=!_0x58b613&&!!_0x564ec1['parentSegment'],_0x5f4f4f=_0x58b613||_0x564ec1[_0x7915e3(0x129)];if(!_0x5f4f4f)return console[_0x7915e3(0xcd)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x7915e3(0xcd)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error'](_0x7915e3(0xaa)),console['error'](_0x7915e3(0x128)),console[_0x7915e3(0xcd)](_0x7915e3(0xc4)),console[_0x7915e3(0xcd)](_0x7915e3(0xa1)),console['error'](_0x7915e3(0xda)),0x1;try{const _0xdf3b9c=_0x564ec1[_0x7915e3(0x10d)];let _0x2f30e8=_0x5f4f4f;!_0x591b0e&&_0xdf3b9c&&!_0x5f4f4f[_0x7915e3(0x9f)]('/')&&(_0x2f30e8=_0xdf3b9c+'/'+_0x5f4f4f,_0x564ec1['verbose']&&console[_0x7915e3(0xcd)](_0x7915e3(0xbd)+_0x2f30e8));const _0x5dcca5=await withSpinner('Resolving\x20path\x20\x27'+_0x2f30e8+_0x7915e3(0xc9),()=>_0x2445e8[_0x7915e3(0xee)][_0x7915e3(0xb7)](_0x2f30e8),{'verbose':_0x564ec1['verbose']}),_0xbfa14=_0x5dcca5['data'];_0x564ec1[_0x7915e3(0x12b)]&&(console[_0x7915e3(0xcd)](_0x7915e3(0xcc)+_0xbfa14[_0x7915e3(0xe7)]),console[_0x7915e3(0xcd)](_0x7915e3(0x107)+_0xbfa14[_0x7915e3(0xbf)]),_0xbfa14[_0x7915e3(0xea)]&&console[_0x7915e3(0xcd)](_0x7915e3(0xeb)+_0xbfa14[_0x7915e3(0xea)]),_0xbfa14[_0x7915e3(0x119)]&&console[_0x7915e3(0xcd)](_0x7915e3(0xb2)+_0xbfa14[_0x7915e3(0x119)]));if(_0xbfa14[_0x7915e3(0xe7)]===_0x7915e3(0x9e)){const _0x5d8ded=await withSpinner(_0x7915e3(0xe0),()=>_0x2445e8[_0x7915e3(0xee)][_0x7915e3(0x99)](_0xbfa14[_0x7915e3(0xbf)]),{'verbose':_0x564ec1[_0x7915e3(0x12b)]});await handleSingleObjectOutput(_0x5d8ded[_0x7915e3(0xe8)],_0x564ec1);}else{if(_0xbfa14[_0x7915e3(0xe7)]===_0x7915e3(0x109)){if(!_0xbfa14[_0x7915e3(0xea)])throw new SDKError(ErrorCode[_0x7915e3(0xdd)],_0x7915e3(0xa6));const _0x5259d2=await withSpinner('Fetching\x20folder\x20details...',()=>_0x2445e8[_0x7915e3(0xee)][_0x7915e3(0xe4)](_0xbfa14[_0x7915e3(0xea)]),{'verbose':_0x564ec1[_0x7915e3(0x12b)]});await handleSingleObjectOutput(_0x5259d2[_0x7915e3(0xe8)],_0x564ec1);}else{if(_0xbfa14[_0x7915e3(0xe7)]===_0x7915e3(0xee)){if(!_0xbfa14[_0x7915e3(0x119)])throw new SDKError(ErrorCode[_0x7915e3(0xe6)],_0x7915e3(0x9c));const _0x4da538=await withSpinner(_0x7915e3(0xa8),()=>_0x2445e8[_0x7915e3(0xee)][_0x7915e3(0xc2)](_0xbfa14[_0x7915e3(0xbf)],_0xbfa14['segmentId']),{'verbose':_0x564ec1[_0x7915e3(0x12b)]});await handleSingleObjectOutput(_0x4da538[_0x7915e3(0xe8)],_0x564ec1);}}}return 0x0;}catch(_0x250c57){if(_0x250c57 instanceof SDKError)return console[_0x7915e3(0xcd)]('Error:\x20'+_0x250c57[_0x7915e3(0x105)]),_0x250c57[_0x7915e3(0xf6)]&&console[_0x7915e3(0xcd)](_0x7915e3(0xbe)+_0x250c57[_0x7915e3(0xf6)]),0x1;throw _0x250c57;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x3805cc(0x11f)]=a27_0x3805cc(0xdb);['description']=a27_0x3805cc(0xcf);async[a27_0x3805cc(0x114)](_0x5adc87){const _0x190b8f=a27_0x3805cc,{options:_0x4cc1f8,args:_0x3faaf5,tdx:_0x4b4cbe}=_0x5adc87,_0x162a2f=_0x3faaf5[0x0];if(!_0x162a2f)return console[_0x190b8f(0xcd)](_0x190b8f(0x10e)),console[_0x190b8f(0xcd)](_0x190b8f(0xd3)),console[_0x190b8f(0xcd)](_0x190b8f(0xe3)),console[_0x190b8f(0xcd)](_0x190b8f(0xaa)),console[_0x190b8f(0xcd)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x190b8f(0xcd)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2454df=_0x4cc1f8['parentSegment'],_0x1931c4=await resolveSegmentTarget(_0x162a2f,_0x2454df,_0x4cc1f8['verbose']);_0x4cc1f8[_0x190b8f(0x12b)]&&console[_0x190b8f(0xcd)](_0x190b8f(0xc7)+_0x1931c4);const _0x5dba15=await withSpinner(_0x190b8f(0xc0)+_0x162a2f+_0x190b8f(0xc9),()=>_0x4b4cbe[_0x190b8f(0xee)]['resolvePathToResource'](_0x1931c4),{'verbose':_0x4cc1f8['verbose']}),_0x1e5a26=_0x5dba15[_0x190b8f(0xe8)];_0x4cc1f8[_0x190b8f(0x12b)]&&(console[_0x190b8f(0xcd)]('Resolved\x20type:\x20'+_0x1e5a26[_0x190b8f(0xe7)]),console['error'](_0x190b8f(0x107)+_0x1e5a26[_0x190b8f(0xbf)]));if(_0x1e5a26[_0x190b8f(0xe7)]===_0x190b8f(0x109))return console[_0x190b8f(0xcd)](_0x190b8f(0xdf)),console['error'](_0x190b8f(0xe5)),0x1;if(_0x1e5a26[_0x190b8f(0xe7)]==='parent')return console[_0x190b8f(0xcd)](_0x190b8f(0x102)),console[_0x190b8f(0xcd)](_0x190b8f(0xf0)),0x1;if(!_0x1e5a26['segmentId'])throw new SDKError(ErrorCode[_0x190b8f(0xe6)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x10e1ae=await withSpinner(_0x190b8f(0xd8),()=>_0x4b4cbe[_0x190b8f(0xee)][_0x190b8f(0xa7)](_0x1e5a26['parentId'],_0x1e5a26[_0x190b8f(0x119)]),{'verbose':_0x4cc1f8['verbose']});let _0x468270=_0x10e1ae['data'];const _0x4a60c4=resolveLimit(_0x4cc1f8[_0x190b8f(0xb5)],DEFAULT_DISPLAY_LIMIT),_0x2d3d73=/\bLIMIT\s+\d+/i[_0x190b8f(0xff)](_0x468270);!_0x2d3d73&&(_0x468270=_0x468270[_0x190b8f(0xfd)]()[_0x190b8f(0x11b)](/;+$/,''),_0x468270=_0x190b8f(0xb9)+_0x468270+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x4a60c4);_0x4cc1f8[_0x190b8f(0x12b)]&&console[_0x190b8f(0xcd)](_0x190b8f(0xa0)+_0x468270);const _0x52a610=await withProgressSpinner(_0x190b8f(0x110),async _0x111909=>{const _0x559af6=_0x190b8f,_0x42326d=await _0x4b4cbe[_0x559af6(0x95)][_0x559af6(0x114)](_0x468270,{'catalog':'td','schema':_0x559af6(0x10b),'onJobId':_0x19ae95=>{const _0x5a598e=_0x559af6;_0x111909[_0x5a598e(0x10c)](_0x19ae95);}});return _0x42326d;},{'verbose':_0x4cc1f8['verbose']}),_0x4fb20e=_0x52a610[_0x190b8f(0xe8)],_0x34841b=_0x4fb20e[_0x190b8f(0x121)]?_0x190b8f(0xad)+_0x4fb20e[_0x190b8f(0x121)]+']':'';return console[_0x190b8f(0xcd)](_0x190b8f(0xac)+_0x4fb20e[_0x190b8f(0xcb)][_0x190b8f(0xd9)][_0x190b8f(0x120)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x4fb20e['stats'][_0x190b8f(0x91)])+_0x34841b)),await handleQueryOutput(_0x4fb20e,_0x4cc1f8),0x0;}catch(_0x18e43b){if(_0x18e43b instanceof SDKError)return console[_0x190b8f(0xcd)]('✖\x20Query\x20failed\x20['+_0x18e43b[_0x190b8f(0x11c)]+']'),console[_0x190b8f(0xcd)]('\x0a'+_0x18e43b['message']),0x1;throw _0x18e43b;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x3805cc(0x11f)]=a27_0x3805cc(0xec);[a27_0x3805cc(0x9d)]=a27_0x3805cc(0x90);async['execute'](_0x12ce43){const _0x44e2dd=a27_0x3805cc,{options:_0x5d3b39,args:_0x59aabe,tdx:_0x145fea}=_0x12ce43;if(_0x59aabe['length']===0x0)return console[_0x44e2dd(0xcd)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x44e2dd(0xcd)](_0x44e2dd(0xc8)),0x1;const _0x21ef2e=_0x59aabe[0x0];try{_0x5d3b39['verbose']&&(console[_0x44e2dd(0xcd)](_0x44e2dd(0xb3)+_0x5d3b39['site']),console[_0x44e2dd(0xcd)](_0x44e2dd(0xce)+_0x21ef2e));const _0x33e6d9=await withSpinner(_0x44e2dd(0x10a)+_0x21ef2e+_0x44e2dd(0xc9),()=>_0x145fea[_0x44e2dd(0xee)]['resolveParentId'](_0x21ef2e),{'verbose':_0x5d3b39[_0x44e2dd(0x12b)]}),_0x3af434=_0x33e6d9['data'];_0x5d3b39[_0x44e2dd(0x12b)]&&console[_0x44e2dd(0xcd)](_0x44e2dd(0xa4)+_0x3af434);const _0xc40687=await withSpinner(_0x44e2dd(0xe9)+_0x21ef2e+_0x44e2dd(0xc9),()=>_0x145fea[_0x44e2dd(0xee)][_0x44e2dd(0xf7)](_0x3af434),{'verbose':_0x5d3b39[_0x44e2dd(0x12b)]}),_0x626b40=_0xc40687[_0x44e2dd(0xe8)];return console[_0x44e2dd(0xcd)](_0x44e2dd(0x126)+_0x626b40['length']+'\x20folder'+(_0x626b40[_0x44e2dd(0x104)]!==0x1?'s':'')),await handleSDKOutput(_0x626b40,_0x5d3b39),0x0;}catch(_0x3efcb5){if(_0x3efcb5 instanceof SDKError)return console['error']('Error:\x20'+_0x3efcb5[_0x44e2dd(0x105)]),_0x3efcb5[_0x44e2dd(0xf6)]&&console[_0x44e2dd(0xcd)](_0x44e2dd(0xbe)+_0x3efcb5[_0x44e2dd(0xf6)]),0x1;throw _0x3efcb5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x3805cc(0x11f)]=a27_0x3805cc(0x125);[a27_0x3805cc(0x9d)]=a27_0x3805cc(0xd1);async['execute'](_0x5348e3){const _0x51c506=a27_0x3805cc,{options:_0x5d0b86,args:_0x40b4db,tdx:_0x262108}=_0x5348e3;if(_0x40b4db[_0x51c506(0x104)]===0x0)return console[_0x51c506(0xcd)]('Error:\x20Folder\x20reference\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0xe6beee,childId:_0x5309ac}=parseSegmentRef(_0x40b4db[0x0]);_0x5d0b86[_0x51c506(0x12b)]&&(console[_0x51c506(0xcd)](_0x51c506(0xb3)+_0x5d0b86[_0x51c506(0xe1)]),console[_0x51c506(0xcd)](_0x51c506(0xce)+_0xe6beee),_0x5309ac&&console['error'](_0x51c506(0x106)+_0x5309ac));if(!_0x5309ac)return console[_0x51c506(0xcd)](_0x51c506(0x116)),0x1;const _0x28da7a=await withSpinner(_0x51c506(0x10a)+_0xe6beee+_0x51c506(0xc9),()=>_0x262108[_0x51c506(0xee)][_0x51c506(0xc1)](_0xe6beee),{'verbose':_0x5d0b86[_0x51c506(0x12b)]}),_0x5ac9b6=_0x28da7a['data'];_0x5d0b86[_0x51c506(0x12b)]&&console[_0x51c506(0xcd)](_0x51c506(0xa4)+_0x5ac9b6);const _0x10d20a=await withSpinner(_0x51c506(0xa2)+_0x5309ac+_0x51c506(0xc9),()=>_0x262108[_0x51c506(0xee)][_0x51c506(0xd6)](_0x5ac9b6,_0x5309ac),{'verbose':_0x5d0b86[_0x51c506(0x12b)]}),_0x315787=_0x10d20a['data'];_0x5d0b86[_0x51c506(0x12b)]&&console[_0x51c506(0xcd)]('Resolved\x20folder\x20ID:\x20'+_0x315787);const _0x3e920d=await withSpinner(_0x51c506(0xe2)+_0x5309ac+_0x51c506(0xc9),()=>_0x262108[_0x51c506(0xee)][_0x51c506(0xe4)](_0x315787),{'verbose':_0x5d0b86[_0x51c506(0x12b)]});return await handleSDKOutput([_0x3e920d[_0x51c506(0xe8)]],_0x5d0b86),0x0;}catch(_0x64c85c){if(_0x64c85c instanceof SDKError)return console[_0x51c506(0xcd)](_0x51c506(0xd2)+_0x64c85c[_0x51c506(0x105)]),_0x64c85c[_0x51c506(0xf6)]&&console[_0x51c506(0xcd)]('\x20\x20Cause:\x20'+_0x64c85c['cause']),0x1;throw _0x64c85c;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x3805cc(0x92);[a27_0x3805cc(0x9d)]=a27_0x3805cc(0x117);async[a27_0x3805cc(0x114)](_0x291dab){const _0x4767a7=a27_0x3805cc,{options:_0x198bf3,args:_0x39618a,tdx:_0x519884}=_0x291dab,_0x599a5a=_0x39618a[0x0];if(!_0x599a5a)return console[_0x4767a7(0xcd)](_0x4767a7(0x10e)),console[_0x4767a7(0xcd)](_0x4767a7(0x101)),console[_0x4767a7(0xcd)](_0x4767a7(0xf4)),console[_0x4767a7(0xcd)](_0x4767a7(0xaa)),console['error'](_0x4767a7(0x100)),console['error']('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x1169aa=_0x198bf3['parentSegment'],_0x484d1b=await resolveSegmentTarget(_0x599a5a,_0x1169aa,_0x198bf3['verbose']);_0x198bf3[_0x4767a7(0x12b)]&&console[_0x4767a7(0xcd)](_0x4767a7(0xc7)+_0x484d1b);const _0x465f97=await withSpinner(_0x4767a7(0xc0)+_0x599a5a+_0x4767a7(0xc9),()=>_0x519884[_0x4767a7(0xee)][_0x4767a7(0xb7)](_0x484d1b),{'verbose':_0x198bf3[_0x4767a7(0x12b)]}),_0x2db8a9=_0x465f97[_0x4767a7(0xe8)];_0x198bf3[_0x4767a7(0x12b)]&&(console[_0x4767a7(0xcd)](_0x4767a7(0xcc)+_0x2db8a9['type']),console['error']('Parent\x20ID:\x20'+_0x2db8a9['parentId']));if(_0x2db8a9['type']===_0x4767a7(0x109))return console[_0x4767a7(0xcd)](_0x4767a7(0xa3)),console[_0x4767a7(0xcd)](_0x4767a7(0xd4)),0x1;if(_0x2db8a9['type']===_0x4767a7(0x9e))return console[_0x4767a7(0xcd)](_0x4767a7(0xae)),console['error']('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x2db8a9['segmentId'])throw new SDKError(ErrorCode[_0x4767a7(0xe6)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x35214e=await withSpinner(_0x4767a7(0xd8),()=>_0x519884[_0x4767a7(0xee)][_0x4767a7(0xa7)](_0x2db8a9[_0x4767a7(0xbf)],_0x2db8a9[_0x4767a7(0x119)]),{'verbose':_0x198bf3['verbose']}),_0x461d6a=_0x35214e[_0x4767a7(0xe8)];return _0x198bf3[_0x4767a7(0xc6)]==='json'||_0x198bf3[_0x4767a7(0xc6)]===_0x4767a7(0x93)?await handleSDKOutput([{'sql':_0x461d6a}],_0x198bf3):console[_0x4767a7(0xfb)](_0x461d6a),0x0;}catch(_0x265dd5){if(_0x265dd5 instanceof SDKError)return console[_0x4767a7(0xcd)]('Error:\x20'+_0x265dd5[_0x4767a7(0x105)]),_0x265dd5['cause']&&console[_0x4767a7(0xcd)](_0x4767a7(0xbe)+_0x265dd5[_0x4767a7(0xf6)]),0x1;throw _0x265dd5;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x3805cc(0x11f)]=a27_0x3805cc(0xf2);[a27_0x3805cc(0x9d)]=a27_0x3805cc(0x113);async['execute'](_0x39f00f){const _0x518733=a27_0x3805cc,{options:_0x327b79,args:_0x5e2f2d,tdx:_0xab3ff9}=_0x39f00f,_0x213fe9=_0x327b79;if(_0x5e2f2d[_0x518733(0x104)]<0x2)return console[_0x518733(0xcd)](_0x518733(0xf8)),console[_0x518733(0xcd)](_0x518733(0x11e)),0x1;const _0x594447=_0x5e2f2d[0x0],_0x65903=_0x5e2f2d[0x1];_0x213fe9['verbose']&&(console[_0x518733(0xcd)](_0x518733(0xb3)+_0x213fe9[_0x518733(0xe1)]),console['error']('Parent\x20segment:\x20'+_0x594447),console['error'](_0x518733(0x106)+_0x65903));let _0x5649ae;if(_0x213fe9[_0x518733(0x97)]){const _0x25c471=_0x213fe9[_0x518733(0x97)],_0x45bfcb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x594447+'\x27...',()=>_0xab3ff9[_0x518733(0xee)][_0x518733(0xc1)](_0x594447),{'verbose':_0x213fe9[_0x518733(0x12b)]}),_0x5c8fb0=_0x45bfcb[_0x518733(0xe8)],_0x347ccd=await withSpinner(_0x518733(0xf9)+_0x25c471+_0x518733(0xc9),()=>_0xab3ff9['segment'][_0x518733(0xd6)](_0x5c8fb0,_0x25c471),{'verbose':_0x213fe9[_0x518733(0x12b)]});_0x5649ae=_0x347ccd[_0x518733(0xe8)],_0x213fe9[_0x518733(0x12b)]&&console[_0x518733(0xcd)](_0x518733(0xa5)+_0x5649ae);}const _0x1bed71={'name':_0x65903,'description':_0x213fe9[_0x518733(0x9d)],'parentFolderId':_0x5649ae},_0x5ac9ea=await withSpinner(_0x518733(0x123)+_0x65903+'\x27...',()=>_0xab3ff9[_0x518733(0xee)][_0x518733(0xba)](_0x594447,_0x1bed71),{'verbose':_0x213fe9[_0x518733(0x12b)]}),_0x3f451b=_0x5ac9ea[_0x518733(0xe8)];return console[_0x518733(0xcd)](_0x518733(0xdc)+_0x3f451b[_0x518733(0x11f)]+_0x518733(0xb1)+_0x3f451b['id']),await handleSDKOutput([_0x3f451b],_0x213fe9),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x3805cc(0x11f)]=a27_0x3805cc(0xb0);[a27_0x3805cc(0x9d)]='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x3c3fa2){const _0x3c4e59=a27_0x3805cc,{options:_0x1e040f,args:_0x4c04bd,tdx:_0x4fc70b}=_0x3c3fa2,_0x384d5f=_0x4c04bd[0x0];if(!_0x384d5f)return console['error'](_0x3c4e59(0xd7)),console[_0x3c4e59(0xcd)](_0x3c4e59(0xc5)),console[_0x3c4e59(0xcd)](_0x3c4e59(0xb4)),console[_0x3c4e59(0xcd)](_0x3c4e59(0x112)),console['error'](_0x3c4e59(0xf3)),console[_0x3c4e59(0xcd)](_0x3c4e59(0xaa)),console[_0x3c4e59(0xcd)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error'](_0x3c4e59(0x111)),console[_0x3c4e59(0xcd)](_0x3c4e59(0xca)),console[_0x3c4e59(0xcd)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2d22da=_0x1e040f['parentSegment'],_0x15042e=await resolveSegmentTarget(_0x384d5f,_0x2d22da,_0x1e040f[_0x3c4e59(0x12b)]);_0x1e040f[_0x3c4e59(0x12b)]&&console[_0x3c4e59(0xcd)](_0x3c4e59(0xc7)+_0x15042e);const _0x685e41=await withSpinner('Resolving\x20\x27'+_0x384d5f+_0x3c4e59(0xc9),()=>_0x4fc70b[_0x3c4e59(0xee)]['resolvePathToResource'](_0x15042e),{'verbose':_0x1e040f[_0x3c4e59(0x12b)]}),_0x436e6=_0x685e41['data'];_0x1e040f[_0x3c4e59(0x12b)]&&(console['error'](_0x3c4e59(0xcc)+_0x436e6[_0x3c4e59(0xe7)]),console[_0x3c4e59(0xcd)](_0x3c4e59(0x107)+_0x436e6['parentId']),_0x436e6[_0x3c4e59(0xea)]&&console[_0x3c4e59(0xcd)](_0x3c4e59(0xeb)+_0x436e6[_0x3c4e59(0xea)]),_0x436e6[_0x3c4e59(0x119)]&&console[_0x3c4e59(0xcd)]('Segment\x20ID:\x20'+_0x436e6[_0x3c4e59(0x119)]));if(_0x1e040f['web']){if(_0x436e6[_0x3c4e59(0xe7)]===_0x3c4e59(0x109))return console[_0x3c4e59(0xcd)](_0x3c4e59(0xfe)),0x1;if(_0x436e6[_0x3c4e59(0xe7)]==='parent')return console[_0x3c4e59(0xcd)](_0x3c4e59(0x9a)),console[_0x3c4e59(0xcd)](_0x3c4e59(0x96)),0x1;if(!_0x436e6['segmentId'])throw new SDKError(ErrorCode[_0x3c4e59(0xe6)],_0x3c4e59(0x9c));const _0x461acc=getConsoleNextUrl(_0x1e040f['site'],_0x3c4e59(0xed)+_0x436e6['parentId']+_0x3c4e59(0x12a)+_0x436e6['segmentId']);return console[_0x3c4e59(0xcd)](a27_0x4f0969[_0x3c4e59(0x94)]('✔')+_0x3c4e59(0x103)+a27_0x4f0969['cyan'](_0x461acc)),openBrowser(_0x461acc),0x0;}if(_0x436e6[_0x3c4e59(0xe7)]==='folder'){if(!_0x436e6['folderId'])throw new SDKError(ErrorCode[_0x3c4e59(0xdd)],_0x3c4e59(0xa6));const _0x9900e1=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4fc70b[_0x3c4e59(0xee)]['getFolder'](_0x436e6['folderId']),{'verbose':_0x1e040f[_0x3c4e59(0x12b)]});await handleSingleObjectOutput(_0x9900e1['data'],_0x1e040f);}else{if(_0x436e6[_0x3c4e59(0xe7)]===_0x3c4e59(0xee)){if(!_0x436e6[_0x3c4e59(0x119)])throw new SDKError(ErrorCode[_0x3c4e59(0xe6)],_0x3c4e59(0x9c));const _0x296616=await withSpinner(_0x3c4e59(0xa8),()=>_0x4fc70b['segment']['getSegment'](_0x436e6[_0x3c4e59(0xbf)],_0x436e6[_0x3c4e59(0x119)]),{'verbose':_0x1e040f[_0x3c4e59(0x12b)]}),_0x5a9919=getConsoleNextUrl(_0x1e040f[_0x3c4e59(0xe1)],_0x3c4e59(0xed)+_0x436e6[_0x3c4e59(0xbf)]+_0x3c4e59(0x12a)+_0x436e6[_0x3c4e59(0x119)]),_0x33c8ab=_0x296616[_0x3c4e59(0xe8)];_0x33c8ab[_0x3c4e59(0x115)]=_0x5a9919,await handleSingleObjectOutput(_0x33c8ab,_0x1e040f);}else return console[_0x3c4e59(0xcd)](_0x3c4e59(0x9b)),console[_0x3c4e59(0xcd)](_0x3c4e59(0xb6)),0x1;}return 0x0;}catch(_0x5bb80b){if(_0x5bb80b instanceof SDKError)return console[_0x3c4e59(0xcd)](_0x3c4e59(0xd2)+_0x5bb80b[_0x3c4e59(0x105)]),_0x5bb80b[_0x3c4e59(0xf6)]&&console[_0x3c4e59(0xcd)](_0x3c4e59(0xbe)+_0x5bb80b[_0x3c4e59(0xf6)]),0x1;throw _0x5bb80b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x3805cc(0x11f)]=a27_0x3805cc(0x108);[a27_0x3805cc(0x9d)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a27_0x3805cc(0x114)](_0x310859){const _0x299957=a27_0x3805cc,{options:_0xc8bfc4,args:_0x43c6c9,tdx:_0x5ae309}=_0x310859,_0x2254f1=_0x43c6c9[0x0];if(!_0x2254f1)return console[_0x299957(0xcd)](_0x299957(0x10e)),console[_0x299957(0xcd)](_0x299957(0xde)),console[_0x299957(0xcd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x299957(0xcd)](_0x299957(0xaa)),console[_0x299957(0xcd)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x299957(0xcd)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5d1c3a=_0xc8bfc4['parentSegment'],_0x9aa186=await resolveSegmentTarget(_0x2254f1,_0x5d1c3a,_0xc8bfc4[_0x299957(0x12b)]);_0xc8bfc4[_0x299957(0x12b)]&&console['error'](_0x299957(0xc7)+_0x9aa186);const _0x59028f=await withSpinner(_0x299957(0xc0)+_0x2254f1+_0x299957(0xc9),()=>_0x5ae309[_0x299957(0xee)][_0x299957(0xb7)](_0x9aa186),{'verbose':_0xc8bfc4[_0x299957(0x12b)]}),_0x38a069=_0x59028f['data'];_0xc8bfc4['verbose']&&(console[_0x299957(0xcd)](_0x299957(0xcc)+_0x38a069[_0x299957(0xe7)]),console[_0x299957(0xcd)](_0x299957(0x107)+_0x38a069[_0x299957(0xbf)]));if(_0x38a069['type']===_0x299957(0x109))return console[_0x299957(0xcd)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x38a069[_0x299957(0xe7)]===_0x299957(0x9e))return console[_0x299957(0xcd)](_0x299957(0xb8)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x38a069[_0x299957(0x119)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x542154=await withSpinner(_0x299957(0xd8),()=>_0x5ae309[_0x299957(0xee)][_0x299957(0xa7)](_0x38a069[_0x299957(0xbf)],_0x38a069[_0x299957(0x119)]),{'verbose':_0xc8bfc4['verbose']}),_0xe35e3=_0x542154['data'],_0x3555de=await executeSchemaQuery(_0xe35e3,_0x5ae309,_0xc8bfc4);return await handleQueryOutput(_0x3555de,_0xc8bfc4),0x0;}catch(_0x230cc1){if(_0x230cc1 instanceof SDKError)return console[_0x299957(0xcd)](_0x299957(0xd2)+_0x230cc1[_0x299957(0x105)]),_0x230cc1[_0x299957(0xf6)]&&console[_0x299957(0xcd)](_0x299957(0xbe)+_0x230cc1[_0x299957(0xf6)]),0x1;throw _0x230cc1;}}}
1
+ const a27_0x3e9fe7=a27_0x1fac;(function(_0x11abc8,_0x3ff2d7){const _0x5a275c=a27_0x1fac,_0x4c3bd7=_0x11abc8();while(!![]){try{const _0x33ad39=parseInt(_0x5a275c(0x237))/0x1*(parseInt(_0x5a275c(0x235))/0x2)+parseInt(_0x5a275c(0x233))/0x3*(-parseInt(_0x5a275c(0x21d))/0x4)+-parseInt(_0x5a275c(0x1fb))/0x5*(-parseInt(_0x5a275c(0x24a))/0x6)+-parseInt(_0x5a275c(0x23a))/0x7+-parseInt(_0x5a275c(0x1ba))/0x8*(parseInt(_0x5a275c(0x20b))/0x9)+parseInt(_0x5a275c(0x1ca))/0xa*(-parseInt(_0x5a275c(0x200))/0xb)+parseInt(_0x5a275c(0x1e8))/0xc;if(_0x33ad39===_0x3ff2d7)break;else _0x4c3bd7['push'](_0x4c3bd7['shift']());}catch(_0x254aa8){_0x4c3bd7['push'](_0x4c3bd7['shift']());}}}(a27_0x70ab,0x7f66f));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a27_0x1fac(_0x177b83,_0x1b0601){_0x177b83=_0x177b83-0x1a9;const _0x70ab54=a27_0x70ab();let _0x1facbf=_0x70ab54[_0x177b83];return _0x1facbf;}function a27_0x70ab(){const _0x334826=['Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segment','resolveFolderId','description','parentFolder','Fetching\x20segment\x20details...','setJobId','/app/ps/','green','54LGDqzo','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Folder\x20ID:\x20','type','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','folder','Parent\x20name:\x20','Examples:','parentSegment','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20folder','Usage:\x20tdx\x20sg\x20desc\x20<name>','cause','Folder\x20name:\x20','parentId','Resolved\x20type:\x20','Creating\x20folder\x20\x27','\x20\x20Cause:\x20','2726176fIkqEA','segment:folder:create','\x27\x20with\x20ID:\x20','segmentId','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','✔\x20Created\x20folder\x20\x27','verbose','✔\x20Found\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','execute','Show\x20segment\x20or\x20folder\x20details','Show\x20child\x20segment\x20schema\x20(column\x20types)','SQL\x20query:\x0a','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Segment\x20name:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','INVALID_ARGUMENT','Site:\x20','\x20rows\x20','includes','Fetching\x20folder\x20details...','segment:describe','3jPmCaj','Use:\x20tdx\x20ps\x20view\x20-w','662652TCIKtJ','log','3zuhxvX','Parent\x20segment:\x20','Fetching\x20parent\x20segment\x20details...','7194404IrQspi','\x20\x20Folder\x20path:\x20','getFolder','Resolved\x20parent\x20folder\x20ID:\x20','stats','Error:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Folder\x20reference\x20is\x20required','✖\x20Query\x20failed\x20[','Resolved\x20YAML\x20file:\x20','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Usage:\x20tdx\x20sg\x20sql\x20<name>','Target\x20path:\x20','810UhAGAQ','getSegmentSQL','/e/','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','(root)','processedRows','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','segment:folder:show','Fetching\x20folder\x20\x27','Use:\x20tdx\x20ps\x20show','jobId','information_schema','cyan','toLocaleString','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Executing\x20segment\x20query...','1246208vmSWza','\x20[Job\x20ID:\x20','replace','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','test','Parent\x20ID:\x20','data','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','jsonl','segment:view','message','format','createFolder','length','88510LGSvdz','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Resolving\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','Options:','segment:folder:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x27...','site','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','trim','resolveParentId','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','fullPath','Fetching\x20SQL\x20for\x20segment...','elapsedTimeMillis','SELECT\x20*\x20FROM\x20(\x0a','Segment\x20ID:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','listFolders','getSegment','Resolving\x20path\x20\x27','Show\x20segment\x20folder\x20details','Error:\x20Path\x20or\x20name\x20is\x20required','name','Resolving\x20parent\x20segment\x20\x27','Resolving\x20parent\x20folder\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','30936132mGxDBs','getParent','Resolving\x20folder\x20\x27','parent','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','error','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20parent\x20ID:\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','resolvePathToResource','segment:desc','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','SEGMENT_NOT_FOUND','\x20\x20Full\x20path:\x20','\x20\x20Parent\x20segment:\x20','Create\x20segment\x20folder\x20for\x20organization','12165Haldmx','SEGMENT_FOLDER_NOT_FOUND','\x20Opening\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment:sql','913rNCQhj','code'];a27_0x70ab=function(){return _0x334826;};return a27_0x70ab();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x2a88b8 from'chalk';async function resolveSegmentTarget(_0x563c4d,_0x12fea5,_0x544226){const _0x5e46ff=a27_0x1fac;if(isYamlFilePath(_0x563c4d))try{const _0x365047=await resolveYamlFilePath(_0x563c4d);return _0x544226&&(console['error'](_0x5e46ff(0x243)+_0x563c4d),console[_0x5e46ff(0x1ed)](_0x5e46ff(0x1f9)+_0x365047[_0x5e46ff(0x213)]),console[_0x5e46ff(0x1ed)](_0x5e46ff(0x22b)+_0x365047['segmentName']),console[_0x5e46ff(0x1ed)](_0x5e46ff(0x23b)+(_0x365047['folderPath']||_0x5e46ff(0x1ae))),console[_0x5e46ff(0x1ed)](_0x5e46ff(0x1f8)+_0x365047[_0x5e46ff(0x1d8)])),_0x365047[_0x5e46ff(0x1d8)];}catch(_0x10c246){throw new SDKError(ErrorCode[_0x5e46ff(0x22d)],_0x5e46ff(0x20c)+_0x10c246[_0x5e46ff(0x1c6)]);}if(!_0x12fea5)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x12fea5+'/'+_0x563c4d;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x3e9fe7(0x1e3)]=a27_0x3e9fe7(0x232);[a27_0x3e9fe7(0x205)]=a27_0x3e9fe7(0x227);async[a27_0x3e9fe7(0x226)](_0x135065){const _0x23d567=a27_0x3e9fe7,{options:_0x3739c9,args:_0x386cdd,tdx:_0x274db8}=_0x135065,_0x206510=_0x386cdd[0x0],_0xa7fca9=!_0x206510&&!!_0x3739c9[_0x23d567(0x213)],_0x14bb88=_0x206510||_0x3739c9[_0x23d567(0x213)];if(!_0x14bb88)return console['error'](_0x23d567(0x1e2)),console[_0x23d567(0x1ed)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x23d567(0x1ed)](_0x23d567(0x212)),console['error'](_0x23d567(0x247)),console[_0x23d567(0x1ed)](_0x23d567(0x245)),console[_0x23d567(0x1ed)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x23d567(0x1ed)](_0x23d567(0x22c)),0x1;try{const _0x20792f=_0x3739c9['segmentPath'];let _0x46ab21=_0x14bb88;!_0xa7fca9&&_0x20792f&&!_0x14bb88[_0x23d567(0x230)]('/')&&(_0x46ab21=_0x20792f+'/'+_0x14bb88,_0x3739c9[_0x23d567(0x223)]&&console[_0x23d567(0x1ed)]('Resolved\x20relative\x20path\x20to:\x20'+_0x46ab21));const _0x5a283d=await withSpinner(_0x23d567(0x1e0)+_0x46ab21+_0x23d567(0x1d1),()=>_0x274db8['segment'][_0x23d567(0x1f4)](_0x46ab21),{'verbose':_0x3739c9[_0x23d567(0x223)]}),_0x40fc32=_0x5a283d[_0x23d567(0x1c2)];_0x3739c9[_0x23d567(0x223)]&&(console[_0x23d567(0x1ed)](_0x23d567(0x21a)+_0x40fc32[_0x23d567(0x20e)]),console[_0x23d567(0x1ed)](_0x23d567(0x1c1)+_0x40fc32[_0x23d567(0x219)]),_0x40fc32[_0x23d567(0x1bd)]&&console[_0x23d567(0x1ed)](_0x23d567(0x20d)+_0x40fc32['folderId']),_0x40fc32[_0x23d567(0x220)]&&console[_0x23d567(0x1ed)](_0x23d567(0x1dc)+_0x40fc32['segmentId']));if(_0x40fc32[_0x23d567(0x20e)]===_0x23d567(0x1eb)){const _0x3bab36=await withSpinner(_0x23d567(0x239),()=>_0x274db8['segment'][_0x23d567(0x1e9)](_0x40fc32['parentId']),{'verbose':_0x3739c9[_0x23d567(0x223)]});await handleSingleObjectOutput(_0x3bab36['data'],_0x3739c9);}else{if(_0x40fc32[_0x23d567(0x20e)]===_0x23d567(0x210)){if(!_0x40fc32[_0x23d567(0x1bd)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0xfaa2d8=await withSpinner('Fetching\x20folder\x20details...',()=>_0x274db8['segment'][_0x23d567(0x23c)](_0x40fc32['folderId']),{'verbose':_0x3739c9['verbose']});await handleSingleObjectOutput(_0xfaa2d8[_0x23d567(0x1c2)],_0x3739c9);}else{if(_0x40fc32[_0x23d567(0x20e)]===_0x23d567(0x203)){if(!_0x40fc32['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x23d567(0x22a));const _0xd504b=await withSpinner(_0x23d567(0x207),()=>_0x274db8[_0x23d567(0x203)][_0x23d567(0x1df)](_0x40fc32['parentId'],_0x40fc32[_0x23d567(0x220)]),{'verbose':_0x3739c9[_0x23d567(0x223)]});await handleSingleObjectOutput(_0xd504b[_0x23d567(0x1c2)],_0x3739c9);}}}return 0x0;}catch(_0x18c391){if(_0x18c391 instanceof SDKError)return console[_0x23d567(0x1ed)]('Error:\x20'+_0x18c391[_0x23d567(0x1c6)]),_0x18c391[_0x23d567(0x217)]&&console['error'](_0x23d567(0x21c)+_0x18c391[_0x23d567(0x217)]),0x1;throw _0x18c391;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x3e9fe7(0x1e3)]='segment:show';['description']=a27_0x3e9fe7(0x1ab);async[a27_0x3e9fe7(0x226)](_0x35b183){const _0x5cd7ad=a27_0x3e9fe7,{options:_0x4bc5fa,args:_0x23c321,tdx:_0x205485}=_0x35b183,_0xbdb5d2=_0x23c321[0x0];if(!_0xbdb5d2)return console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1ef)),console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1ee)),console['error'](_0x5cd7ad(0x1bf)),console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x212)),console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1f3)),console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1f0)),0x1;try{const _0x2d9708=_0x4bc5fa[_0x5cd7ad(0x213)],_0x3bcf0f=await resolveSegmentTarget(_0xbdb5d2,_0x2d9708,_0x4bc5fa['verbose']);_0x4bc5fa[_0x5cd7ad(0x223)]&&console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x249)+_0x3bcf0f);const _0x144111=await withSpinner('Resolving\x20\x27'+_0xbdb5d2+'\x27...',()=>_0x205485[_0x5cd7ad(0x203)][_0x5cd7ad(0x1f4)](_0x3bcf0f),{'verbose':_0x4bc5fa[_0x5cd7ad(0x223)]}),_0xd2f8a6=_0x144111['data'];_0x4bc5fa[_0x5cd7ad(0x223)]&&(console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x21a)+_0xd2f8a6[_0x5cd7ad(0x20e)]),console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1c1)+_0xd2f8a6[_0x5cd7ad(0x219)]));if(_0xd2f8a6['type']==='folder')return console[_0x5cd7ad(0x1ed)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1e7)),0x1;if(_0xd2f8a6['type']===_0x5cd7ad(0x1eb))return console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1f1)),console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1b3)),0x1;if(!_0xd2f8a6['segmentId'])throw new SDKError(ErrorCode[_0x5cd7ad(0x1f7)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x115c11=await withSpinner(_0x5cd7ad(0x1d9),()=>_0x205485[_0x5cd7ad(0x203)]['getSegmentSQL'](_0xd2f8a6['parentId'],_0xd2f8a6[_0x5cd7ad(0x220)]),{'verbose':_0x4bc5fa['verbose']});let _0x5dbf75=_0x115c11[_0x5cd7ad(0x1c2)];const _0x2708a4=resolveLimit(_0x4bc5fa['limit'],DEFAULT_DISPLAY_LIMIT),_0x1123fc=/\bLIMIT\s+\d+/i[_0x5cd7ad(0x1c0)](_0x5dbf75);!_0x1123fc&&(_0x5dbf75=_0x5dbf75[_0x5cd7ad(0x1d5)]()[_0x5cd7ad(0x1bc)](/;+$/,''),_0x5dbf75=_0x5cd7ad(0x1db)+_0x5dbf75+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x2708a4);_0x4bc5fa[_0x5cd7ad(0x223)]&&console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x229)+_0x5dbf75);const _0x69d1df=await withProgressSpinner(_0x5cd7ad(0x1b9),async _0x5043c7=>{const _0x30009c=_0x5cd7ad,_0x83f00b=await _0x205485['query']['execute'](_0x5dbf75,{'catalog':'td','schema':_0x30009c(0x1b5),'onJobId':_0x222952=>{const _0x172e00=_0x30009c;_0x5043c7[_0x172e00(0x208)](_0x222952);}});return _0x83f00b;},{'verbose':_0x4bc5fa[_0x5cd7ad(0x223)]}),_0x415aa3=_0x69d1df['data'],_0x26d02a=_0x415aa3[_0x5cd7ad(0x1b4)]?_0x5cd7ad(0x1bb)+_0x415aa3[_0x5cd7ad(0x1b4)]+']':'';return console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x1cd)+_0x415aa3[_0x5cd7ad(0x23e)][_0x5cd7ad(0x1af)][_0x5cd7ad(0x1b7)]()+_0x5cd7ad(0x22f)+('in\x20'+formatElapsed(_0x415aa3['stats'][_0x5cd7ad(0x1da)])+_0x26d02a)),await handleQueryOutput(_0x415aa3,_0x4bc5fa),0x0;}catch(_0x350548){if(_0x350548 instanceof SDKError)return console[_0x5cd7ad(0x1ed)](_0x5cd7ad(0x242)+_0x350548[_0x5cd7ad(0x201)]+']'),console[_0x5cd7ad(0x1ed)]('\x0a'+_0x350548[_0x5cd7ad(0x1c6)]),0x1;throw _0x350548;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x3e9fe7(0x1cf);[a27_0x3e9fe7(0x205)]=a27_0x3e9fe7(0x1dd);async['execute'](_0x138764){const _0x4b99dd=a27_0x3e9fe7,{options:_0x18a1bc,args:_0x1ef00c,tdx:_0x5e6866}=_0x138764;if(_0x1ef00c[_0x4b99dd(0x1c9)]===0x0)return console[_0x4b99dd(0x1ed)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x4b99dd(0x1ed)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x217524=_0x1ef00c[0x0];try{_0x18a1bc[_0x4b99dd(0x223)]&&(console['error'](_0x4b99dd(0x22e)+_0x18a1bc['site']),console['error'](_0x4b99dd(0x211)+_0x217524));const _0x1c43df=await withSpinner(_0x4b99dd(0x1e4)+_0x217524+_0x4b99dd(0x1d1),()=>_0x5e6866[_0x4b99dd(0x203)][_0x4b99dd(0x1d6)](_0x217524),{'verbose':_0x18a1bc['verbose']}),_0x53e329=_0x1c43df[_0x4b99dd(0x1c2)];_0x18a1bc['verbose']&&console[_0x4b99dd(0x1ed)](_0x4b99dd(0x1f2)+_0x53e329);const _0x369021=await withSpinner(_0x4b99dd(0x244)+_0x217524+_0x4b99dd(0x1d1),()=>_0x5e6866[_0x4b99dd(0x203)][_0x4b99dd(0x1de)](_0x53e329),{'verbose':_0x18a1bc[_0x4b99dd(0x223)]}),_0x53861e=_0x369021[_0x4b99dd(0x1c2)];return console[_0x4b99dd(0x1ed)](_0x4b99dd(0x224)+_0x53861e[_0x4b99dd(0x1c9)]+_0x4b99dd(0x215)+(_0x53861e['length']!==0x1?'s':'')),await handleSDKOutput(_0x53861e,_0x18a1bc),0x0;}catch(_0x15c856){if(_0x15c856 instanceof SDKError)return console[_0x4b99dd(0x1ed)](_0x4b99dd(0x23f)+_0x15c856[_0x4b99dd(0x1c6)]),_0x15c856['cause']&&console[_0x4b99dd(0x1ed)](_0x4b99dd(0x21c)+_0x15c856[_0x4b99dd(0x217)]),0x1;throw _0x15c856;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x3e9fe7(0x1e3)]=a27_0x3e9fe7(0x1b1);[a27_0x3e9fe7(0x205)]=a27_0x3e9fe7(0x1e1);async[a27_0x3e9fe7(0x226)](_0x23cf37){const _0x415bd2=a27_0x3e9fe7,{options:_0x1d6cdc,args:_0x5c9ecf,tdx:_0x3aad4b}=_0x23cf37;if(_0x5c9ecf[_0x415bd2(0x1c9)]===0x0)return console['error'](_0x415bd2(0x241)),console['error'](_0x415bd2(0x202)),0x1;try{const {parentId:_0x12b9c3,childId:_0x5c7e1f}=parseSegmentRef(_0x5c9ecf[0x0]);_0x1d6cdc[_0x415bd2(0x223)]&&(console['error'](_0x415bd2(0x22e)+_0x1d6cdc[_0x415bd2(0x1d2)]),console[_0x415bd2(0x1ed)](_0x415bd2(0x211)+_0x12b9c3),_0x5c7e1f&&console[_0x415bd2(0x1ed)]('Folder\x20name:\x20'+_0x5c7e1f));if(!_0x5c7e1f)return console[_0x415bd2(0x1ed)](_0x415bd2(0x214)),0x1;const _0x46ca61=await withSpinner(_0x415bd2(0x1e4)+_0x12b9c3+_0x415bd2(0x1d1),()=>_0x3aad4b['segment'][_0x415bd2(0x1d6)](_0x12b9c3),{'verbose':_0x1d6cdc['verbose']}),_0x1607a3=_0x46ca61['data'];_0x1d6cdc[_0x415bd2(0x223)]&&console[_0x415bd2(0x1ed)](_0x415bd2(0x1f2)+_0x1607a3);const _0x8ccd72=await withSpinner(_0x415bd2(0x1ea)+_0x5c7e1f+_0x415bd2(0x1d1),()=>_0x3aad4b[_0x415bd2(0x203)][_0x415bd2(0x204)](_0x1607a3,_0x5c7e1f),{'verbose':_0x1d6cdc['verbose']}),_0xd270c6=_0x8ccd72[_0x415bd2(0x1c2)];_0x1d6cdc['verbose']&&console[_0x415bd2(0x1ed)]('Resolved\x20folder\x20ID:\x20'+_0xd270c6);const _0x2b4b44=await withSpinner(_0x415bd2(0x1b2)+_0x5c7e1f+_0x415bd2(0x1d1),()=>_0x3aad4b[_0x415bd2(0x203)]['getFolder'](_0xd270c6),{'verbose':_0x1d6cdc[_0x415bd2(0x223)]});return await handleSDKOutput([_0x2b4b44['data']],_0x1d6cdc),0x0;}catch(_0x18505b){if(_0x18505b instanceof SDKError)return console[_0x415bd2(0x1ed)](_0x415bd2(0x23f)+_0x18505b[_0x415bd2(0x1c6)]),_0x18505b[_0x415bd2(0x217)]&&console['error'](_0x415bd2(0x21c)+_0x18505b[_0x415bd2(0x217)]),0x1;throw _0x18505b;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x3e9fe7(0x1e3)]=a27_0x3e9fe7(0x1ff);[a27_0x3e9fe7(0x205)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x2e77ec){const _0x11a611=a27_0x3e9fe7,{options:_0x1663a8,args:_0x2d2ab1,tdx:_0x4234e1}=_0x2e77ec,_0x145eee=_0x2d2ab1[0x0];if(!_0x145eee)return console[_0x11a611(0x1ed)](_0x11a611(0x1ef)),console[_0x11a611(0x1ed)](_0x11a611(0x248)),console[_0x11a611(0x1ed)](_0x11a611(0x1d0)),console[_0x11a611(0x1ed)]('Examples:'),console['error'](_0x11a611(0x1d4)),console['error'](_0x11a611(0x221)),0x1;try{const _0x38b0e1=_0x1663a8['parentSegment'],_0x2cc727=await resolveSegmentTarget(_0x145eee,_0x38b0e1,_0x1663a8['verbose']);_0x1663a8[_0x11a611(0x223)]&&console['error'](_0x11a611(0x249)+_0x2cc727);const _0x22c970=await withSpinner(_0x11a611(0x1cc)+_0x145eee+_0x11a611(0x1d1),()=>_0x4234e1[_0x11a611(0x203)][_0x11a611(0x1f4)](_0x2cc727),{'verbose':_0x1663a8['verbose']}),_0x12ce11=_0x22c970[_0x11a611(0x1c2)];_0x1663a8['verbose']&&(console[_0x11a611(0x1ed)]('Resolved\x20type:\x20'+_0x12ce11['type']),console[_0x11a611(0x1ed)](_0x11a611(0x1c1)+_0x12ce11[_0x11a611(0x219)]));if(_0x12ce11[_0x11a611(0x20e)]===_0x11a611(0x210))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x11a611(0x1ed)](_0x11a611(0x1fe)),0x1;if(_0x12ce11['type']===_0x11a611(0x1eb))return console[_0x11a611(0x1ed)](_0x11a611(0x1d7)),console[_0x11a611(0x1ed)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x12ce11['segmentId'])throw new SDKError(ErrorCode[_0x11a611(0x1f7)],_0x11a611(0x22a));const _0x49b69c=await withSpinner(_0x11a611(0x1d9),()=>_0x4234e1['segment'][_0x11a611(0x1a9)](_0x12ce11[_0x11a611(0x219)],_0x12ce11[_0x11a611(0x220)]),{'verbose':_0x1663a8[_0x11a611(0x223)]}),_0x1287a5=_0x49b69c['data'];return _0x1663a8[_0x11a611(0x1c7)]==='json'||_0x1663a8[_0x11a611(0x1c7)]===_0x11a611(0x1c4)?await handleSDKOutput([{'sql':_0x1287a5}],_0x1663a8):console[_0x11a611(0x236)](_0x1287a5),0x0;}catch(_0x78ec7d){if(_0x78ec7d instanceof SDKError)return console[_0x11a611(0x1ed)](_0x11a611(0x23f)+_0x78ec7d[_0x11a611(0x1c6)]),_0x78ec7d[_0x11a611(0x217)]&&console['error']('\x20\x20Cause:\x20'+_0x78ec7d[_0x11a611(0x217)]),0x1;throw _0x78ec7d;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x3e9fe7(0x21e);[a27_0x3e9fe7(0x205)]=a27_0x3e9fe7(0x1fa);async['execute'](_0x518034){const _0x22ea68=a27_0x3e9fe7,{options:_0x5cefcc,args:_0x3ad0ba,tdx:_0x2660a6}=_0x518034,_0x50c5d8=_0x5cefcc;if(_0x3ad0ba[_0x22ea68(0x1c9)]<0x2)return console[_0x22ea68(0x1ed)](_0x22ea68(0x1f6)),console[_0x22ea68(0x1ed)](_0x22ea68(0x1b8)),0x1;const _0x1b001a=_0x3ad0ba[0x0],_0x9063c7=_0x3ad0ba[0x1];_0x50c5d8[_0x22ea68(0x223)]&&(console[_0x22ea68(0x1ed)]('Site:\x20'+_0x50c5d8['site']),console[_0x22ea68(0x1ed)](_0x22ea68(0x238)+_0x1b001a),console[_0x22ea68(0x1ed)](_0x22ea68(0x218)+_0x9063c7));let _0x2d0f0b;if(_0x50c5d8['parentFolder']){const _0x2e8d42=_0x50c5d8[_0x22ea68(0x206)],_0x16e1ca=await withSpinner(_0x22ea68(0x1e4)+_0x1b001a+_0x22ea68(0x1d1),()=>_0x2660a6[_0x22ea68(0x203)]['resolveParentId'](_0x1b001a),{'verbose':_0x50c5d8[_0x22ea68(0x223)]}),_0x1dc4a3=_0x16e1ca['data'],_0x1b1bc9=await withSpinner(_0x22ea68(0x1e5)+_0x2e8d42+_0x22ea68(0x1d1),()=>_0x2660a6[_0x22ea68(0x203)]['resolveFolderId'](_0x1dc4a3,_0x2e8d42),{'verbose':_0x50c5d8['verbose']});_0x2d0f0b=_0x1b1bc9[_0x22ea68(0x1c2)],_0x50c5d8[_0x22ea68(0x223)]&&console['error'](_0x22ea68(0x23d)+_0x2d0f0b);}const _0x405ae5={'name':_0x9063c7,'description':_0x50c5d8['description'],'parentFolderId':_0x2d0f0b},_0x26021a=await withSpinner(_0x22ea68(0x21b)+_0x9063c7+_0x22ea68(0x1d1),()=>_0x2660a6[_0x22ea68(0x203)][_0x22ea68(0x1c8)](_0x1b001a,_0x405ae5),{'verbose':_0x50c5d8[_0x22ea68(0x223)]}),_0x512175=_0x26021a[_0x22ea68(0x1c2)];return console[_0x22ea68(0x1ed)](_0x22ea68(0x222)+_0x512175['name']+_0x22ea68(0x21f)+_0x512175['id']),await handleSDKOutput([_0x512175],_0x50c5d8),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x3e9fe7(0x1e3)]=a27_0x3e9fe7(0x1c5);[a27_0x3e9fe7(0x205)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a27_0x3e9fe7(0x226)](_0x31d212){const _0x47fe25=a27_0x3e9fe7,{options:_0xab92c,args:_0x2eef14,tdx:_0x3b5af3}=_0x31d212,_0x47ddbf=_0x2eef14[0x0];if(!_0x47ddbf)return console['error'](_0x47fe25(0x240)),console[_0x47fe25(0x1ed)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x47fe25(0x1ed)](_0x47fe25(0x1be)),console[_0x47fe25(0x1ed)](_0x47fe25(0x1ce)),console[_0x47fe25(0x1ed)](_0x47fe25(0x246)),console[_0x47fe25(0x1ed)]('Examples:'),console[_0x47fe25(0x1ed)](_0x47fe25(0x1cb)),console['error'](_0x47fe25(0x1b0)),console[_0x47fe25(0x1ed)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x47fe25(0x1ed)](_0x47fe25(0x1ac)),0x1;try{const _0x371640=_0xab92c[_0x47fe25(0x213)],_0x44c22e=await resolveSegmentTarget(_0x47ddbf,_0x371640,_0xab92c[_0x47fe25(0x223)]);_0xab92c['verbose']&&console[_0x47fe25(0x1ed)](_0x47fe25(0x249)+_0x44c22e);const _0x5876bb=await withSpinner(_0x47fe25(0x1cc)+_0x47ddbf+_0x47fe25(0x1d1),()=>_0x3b5af3[_0x47fe25(0x203)]['resolvePathToResource'](_0x44c22e),{'verbose':_0xab92c[_0x47fe25(0x223)]}),_0x545c5b=_0x5876bb[_0x47fe25(0x1c2)];_0xab92c[_0x47fe25(0x223)]&&(console[_0x47fe25(0x1ed)]('Resolved\x20type:\x20'+_0x545c5b[_0x47fe25(0x20e)]),console[_0x47fe25(0x1ed)](_0x47fe25(0x1c1)+_0x545c5b[_0x47fe25(0x219)]),_0x545c5b[_0x47fe25(0x1bd)]&&console[_0x47fe25(0x1ed)]('Folder\x20ID:\x20'+_0x545c5b[_0x47fe25(0x1bd)]),_0x545c5b['segmentId']&&console[_0x47fe25(0x1ed)]('Segment\x20ID:\x20'+_0x545c5b['segmentId']));if(_0xab92c['web']){if(_0x545c5b[_0x47fe25(0x20e)]===_0x47fe25(0x210))return console[_0x47fe25(0x1ed)](_0x47fe25(0x1d3)),0x1;if(_0x545c5b[_0x47fe25(0x20e)]===_0x47fe25(0x1eb))return console[_0x47fe25(0x1ed)](_0x47fe25(0x20f)),console[_0x47fe25(0x1ed)](_0x47fe25(0x234)),0x1;if(!_0x545c5b['segmentId'])throw new SDKError(ErrorCode[_0x47fe25(0x1f7)],_0x47fe25(0x22a));const _0x2815fe=getConsoleNextUrl(_0xab92c['site'],'/app/ps/'+_0x545c5b[_0x47fe25(0x219)]+_0x47fe25(0x1aa)+_0x545c5b['segmentId']);return console[_0x47fe25(0x1ed)](a27_0x2a88b8[_0x47fe25(0x20a)]('✔')+_0x47fe25(0x1fd)+a27_0x2a88b8[_0x47fe25(0x1b6)](_0x2815fe)),openBrowser(_0x2815fe),0x0;}if(_0x545c5b[_0x47fe25(0x20e)]===_0x47fe25(0x210)){if(!_0x545c5b[_0x47fe25(0x1bd)])throw new SDKError(ErrorCode[_0x47fe25(0x1fc)],_0x47fe25(0x225));const _0x3b7d82=await withSpinner(_0x47fe25(0x231),()=>_0x3b5af3[_0x47fe25(0x203)][_0x47fe25(0x23c)](_0x545c5b[_0x47fe25(0x1bd)]),{'verbose':_0xab92c['verbose']});await handleSingleObjectOutput(_0x3b7d82[_0x47fe25(0x1c2)],_0xab92c);}else{if(_0x545c5b[_0x47fe25(0x20e)]===_0x47fe25(0x203)){if(!_0x545c5b[_0x47fe25(0x220)])throw new SDKError(ErrorCode[_0x47fe25(0x1f7)],_0x47fe25(0x22a));const _0x7e0698=await withSpinner('Fetching\x20segment\x20details...',()=>_0x3b5af3[_0x47fe25(0x203)][_0x47fe25(0x1df)](_0x545c5b['parentId'],_0x545c5b['segmentId']),{'verbose':_0xab92c['verbose']}),_0x478494=getConsoleNextUrl(_0xab92c['site'],_0x47fe25(0x209)+_0x545c5b[_0x47fe25(0x219)]+_0x47fe25(0x1aa)+_0x545c5b[_0x47fe25(0x220)]),_0x5dd17a=_0x7e0698['data'];_0x5dd17a['url']=_0x478494,await handleSingleObjectOutput(_0x5dd17a,_0xab92c);}else return console[_0x47fe25(0x1ed)](_0x47fe25(0x1c3)),console[_0x47fe25(0x1ed)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x3b5dcb){if(_0x3b5dcb instanceof SDKError)return console[_0x47fe25(0x1ed)](_0x47fe25(0x23f)+_0x3b5dcb[_0x47fe25(0x1c6)]),_0x3b5dcb[_0x47fe25(0x217)]&&console['error'](_0x47fe25(0x21c)+_0x3b5dcb[_0x47fe25(0x217)]),0x1;throw _0x3b5dcb;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x3e9fe7(0x1e3)]=a27_0x3e9fe7(0x1f5);[a27_0x3e9fe7(0x205)]=a27_0x3e9fe7(0x228);async[a27_0x3e9fe7(0x226)](_0x334fb3){const _0x5db291=a27_0x3e9fe7,{options:_0xdacb23,args:_0xb8fb07,tdx:_0x3faf5c}=_0x334fb3,_0x1c3380=_0xb8fb07[0x0];if(!_0x1c3380)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5db291(0x1ed)](_0x5db291(0x216)),console[_0x5db291(0x1ed)](_0x5db291(0x1ad)),console[_0x5db291(0x1ed)]('Examples:'),console[_0x5db291(0x1ed)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x5db291(0x1ed)](_0x5db291(0x1ec)),0x1;try{const _0x58e2ab=_0xdacb23[_0x5db291(0x213)],_0x39627b=await resolveSegmentTarget(_0x1c3380,_0x58e2ab,_0xdacb23[_0x5db291(0x223)]);_0xdacb23[_0x5db291(0x223)]&&console[_0x5db291(0x1ed)](_0x5db291(0x249)+_0x39627b);const _0x96672b=await withSpinner(_0x5db291(0x1cc)+_0x1c3380+_0x5db291(0x1d1),()=>_0x3faf5c[_0x5db291(0x203)][_0x5db291(0x1f4)](_0x39627b),{'verbose':_0xdacb23['verbose']}),_0x549903=_0x96672b['data'];_0xdacb23[_0x5db291(0x223)]&&(console[_0x5db291(0x1ed)](_0x5db291(0x21a)+_0x549903[_0x5db291(0x20e)]),console[_0x5db291(0x1ed)](_0x5db291(0x1c1)+_0x549903['parentId']));if(_0x549903[_0x5db291(0x20e)]===_0x5db291(0x210))return console[_0x5db291(0x1ed)](_0x5db291(0x1e6)),console[_0x5db291(0x1ed)](_0x5db291(0x1fe)),0x1;if(_0x549903[_0x5db291(0x20e)]===_0x5db291(0x1eb))return console[_0x5db291(0x1ed)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5db291(0x1ed)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x549903['segmentId'])throw new SDKError(ErrorCode[_0x5db291(0x1f7)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5a1b81=await withSpinner(_0x5db291(0x1d9),()=>_0x3faf5c[_0x5db291(0x203)]['getSegmentSQL'](_0x549903['parentId'],_0x549903[_0x5db291(0x220)]),{'verbose':_0xdacb23[_0x5db291(0x223)]}),_0x2009ab=_0x5a1b81['data'],_0x25d279=await executeSchemaQuery(_0x2009ab,_0x3faf5c,_0xdacb23);return await handleQueryOutput(_0x25d279,_0xdacb23),0x0;}catch(_0x342694){if(_0x342694 instanceof SDKError)return console['error'](_0x5db291(0x23f)+_0x342694[_0x5db291(0x1c6)]),_0x342694[_0x5db291(0x217)]&&console[_0x5db291(0x1ed)](_0x5db291(0x21c)+_0x342694['cause']),0x1;throw _0x342694;}}}
@@ -1 +1 @@
1
- const a28_0x5ac862=a28_0x28fb;(function(_0x4f037d,_0x37bb6c){const _0x56f449=a28_0x28fb,_0xf0094e=_0x4f037d();while(!![]){try{const _0x51bc4a=parseInt(_0x56f449(0x86))/0x1+parseInt(_0x56f449(0xa9))/0x2*(-parseInt(_0x56f449(0xa8))/0x3)+parseInt(_0x56f449(0x7a))/0x4+parseInt(_0x56f449(0xad))/0x5+-parseInt(_0x56f449(0xa1))/0x6+parseInt(_0x56f449(0x7e))/0x7+-parseInt(_0x56f449(0x96))/0x8*(parseInt(_0x56f449(0x87))/0x9);if(_0x51bc4a===_0x37bb6c)break;else _0xf0094e['push'](_0xf0094e['shift']());}catch(_0x5e1913){_0xf0094e['push'](_0xf0094e['shift']());}}}(a28_0x4438,0xebd87));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a28_0x28fb(_0x4873bf,_0x1b76ee){_0x4873bf=_0x4873bf-0x7a;const _0x443807=a28_0x4438();let _0x28fbf3=_0x443807[_0x4873bf];return _0x28fbf3;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a28_0x4438(){const _0x24b599=['8047495XHuZwU','type','\x20\x20\x20Path:\x20','folderId','error','1114224vjrSZj','noCountPopulation','Parent\x20path:\x20','Site:\x20','9177588WYMBtf','data','Parent:\x20','Examples:','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Creating\x20segment\x20\x27','invisible','ruleFile','170210aXNZrm','54BgCRqr','segment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','verbose','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segmentPath','Resolving\x20folder\x20\x27','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','includes','folder','createSegment','segments','1271672RZuFFi','kind','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','name','✔\x20Created\x20segment\x20\x27','resolvePathToResource','\x27\x20with\x20ID:\x20','length','rule','Segment\x20name:\x20','1654464VAxxqJ','description','Resolving\x20folder\x20path\x20\x27','\x27...','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','yellow','segment:create','12759RNGnQR','552krzhya','Target\x20path:\x20','resolveFolderId','Resolving\x20parent\x20segment\x20\x27'];a28_0x4438=function(){return _0x24b599;};return a28_0x4438();}import a28_0x393248 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x5ac862(0x9a)]=a28_0x5ac862(0xa7);[a28_0x5ac862(0xa2)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a28_0x5ac862(0x8b)](_0x480a24){const _0x34a58b=a28_0x5ac862;console[_0x34a58b(0xb1)](a28_0x393248[_0x34a58b(0xa6)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a28_0x393248['yellow'](_0x34a58b(0xa5)));const {options:_0x1044c8,args:_0x59fc44,tdx:_0x5b598f}=_0x480a24,_0xcd0fa5=_0x1044c8;if(_0x59fc44['length']===0x0)return console['error'](_0x34a58b(0x82)),console[_0x34a58b(0xb1)](_0x34a58b(0x89)),console['error'](_0x34a58b(0x81)),console['error'](_0x34a58b(0x99)),console[_0x34a58b(0xb1)](_0x34a58b(0x8e)),console[_0x34a58b(0xb1)](_0x34a58b(0x8a)),0x1;const _0x2eae43=_0x59fc44[0x0],_0x120b39=_0x1044c8[_0x34a58b(0x8f)];let _0x1d7cec=_0x2eae43;_0x120b39&&!_0x2eae43[_0x34a58b(0x92)]('/')&&(_0x1d7cec=_0x120b39+'/'+_0x2eae43,_0xcd0fa5['verbose']&&console[_0x34a58b(0xb1)]('Resolved\x20relative\x20path\x20to:\x20'+_0x1d7cec));const _0x37f7a5=parsePath(_0x1d7cec);if(_0x37f7a5[_0x34a58b(0x95)][_0x34a58b(0x9e)]<0x2)return console[_0x34a58b(0xb1)](_0x34a58b(0x91)),console[_0x34a58b(0xb1)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x131ed4=_0x37f7a5[_0x34a58b(0x95)][0x0],_0x55db35=getBaseName(_0x1d7cec),_0x39dd30=getParentPath(_0x1d7cec);_0xcd0fa5[_0x34a58b(0x8c)]&&(console[_0x34a58b(0xb1)](_0x34a58b(0x7d)+_0xcd0fa5['site']),console[_0x34a58b(0xb1)](_0x34a58b(0xaa)+_0x1d7cec),console[_0x34a58b(0xb1)](_0x34a58b(0x80)+_0x131ed4),console[_0x34a58b(0xb1)](_0x34a58b(0xa0)+_0x55db35),console['error'](_0x34a58b(0x7c)+_0x39dd30));const _0x20355e=await withSpinner(_0x34a58b(0xac)+_0x131ed4+_0x34a58b(0xa4),()=>_0x5b598f[_0x34a58b(0x88)]['resolveParentId'](_0x131ed4),{'verbose':_0xcd0fa5[_0x34a58b(0x8c)]}),_0x4445d4=_0x20355e[_0x34a58b(0x7f)];let _0x277696;if(_0x37f7a5['segments']['length']>0x2){const _0x588681=await withSpinner(_0x34a58b(0xa3)+_0x39dd30+_0x34a58b(0xa4),()=>_0x5b598f[_0x34a58b(0x88)][_0x34a58b(0x9c)](_0x39dd30),{'verbose':_0xcd0fa5[_0x34a58b(0x8c)]}),_0x80232e=_0x588681[_0x34a58b(0x7f)];if(_0x80232e[_0x34a58b(0xae)]!==_0x34a58b(0x93)&&_0x80232e[_0x34a58b(0xae)]!=='parent')return console[_0x34a58b(0xb1)](_0x34a58b(0x8d)),0x1;_0x277696=_0x80232e[_0x34a58b(0xb0)];}else{if(_0xcd0fa5['folder']){const _0x2cc6e6=await withSpinner(_0x34a58b(0x90)+_0xcd0fa5[_0x34a58b(0x93)]+_0x34a58b(0xa4),()=>_0x5b598f['segment'][_0x34a58b(0xab)](_0x4445d4,_0xcd0fa5[_0x34a58b(0x93)]),{'verbose':_0xcd0fa5[_0x34a58b(0x8c)]});_0x277696=_0x2cc6e6[_0x34a58b(0x7f)];}}_0xcd0fa5[_0x34a58b(0x8c)]&&_0x277696&&console['error'](_0x34a58b(0x98)+_0x277696);const _0x1523e8=await loadJSONFromOptions(_0xcd0fa5[_0x34a58b(0x9f)],_0xcd0fa5[_0x34a58b(0x85)]),_0x1c5986={'name':_0x55db35,'description':_0xcd0fa5[_0x34a58b(0xa2)],'rule':_0x1523e8,'kind':_0xcd0fa5[_0x34a58b(0x97)]!==undefined?parseInt(_0xcd0fa5[_0x34a58b(0x97)],0xa):undefined,'isVisible':_0xcd0fa5[_0x34a58b(0x84)]?![]:undefined,'segmentFolderId':_0x277696,'countPopulation':_0xcd0fa5[_0x34a58b(0x7b)]?![]:undefined},_0x269cde=await withSpinner(_0x34a58b(0x83)+_0x55db35+_0x34a58b(0xa4),()=>_0x5b598f[_0x34a58b(0x88)][_0x34a58b(0x94)](_0x4445d4,_0x1c5986),{'verbose':_0xcd0fa5[_0x34a58b(0x8c)]}),_0x535bb9=_0x269cde[_0x34a58b(0x7f)];return console[_0x34a58b(0xb1)](_0x34a58b(0x9b)+_0x535bb9[_0x34a58b(0x9a)]+_0x34a58b(0x9d)+_0x535bb9['id']),_0x1d7cec!==_0x2eae43&&console[_0x34a58b(0xb1)](_0x34a58b(0xaf)+_0x1d7cec),await handleSDKOutput([_0x535bb9],_0xcd0fa5),0x0;}}
1
+ function a28_0x18d1(_0x1a6d60,_0x143a39){_0x1a6d60=_0x1a6d60-0xd7;const _0xcf7039=a28_0xcf70();let _0x18d1bc=_0xcf7039[_0x1a6d60];return _0x18d1bc;}const a28_0x55caee=a28_0x18d1;function a28_0xcf70(){const _0x4ceb72=['Create\x20child\x20segment\x20with\x20filtering\x20rules','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','segmentPath','27yFnMgS','resolveFolderId','parent','ruleFile','createSegment','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segment:create','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','684154UJtCyy','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','error','resolvePathToResource','verbose','resolveParentId','site','99090tjQgZc','361084VTdKFv','noCountPopulation','7WElXoR','includes','description','folder','6BGVSpL','Resolving\x20folder\x20\x27','1133DFQXGv','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Parent:\x20','Segment\x20name:\x20','segment','13352rbDiOq','invisible','length','840355BQqAAC','kind','execute','Parent\x20path:\x20','segments','type','\x20\x20\x20Path:\x20','5544702NxoZdp','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x27...','yellow','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','249810oQpojP','name','data','Resolving\x20folder\x20path\x20\x27'];a28_0xcf70=function(){return _0x4ceb72;};return a28_0xcf70();}(function(_0x2c8eff,_0x356ddf){const _0x4dcc30=a28_0x18d1,_0x38f4b1=_0x2c8eff();while(!![]){try{const _0x303552=-parseInt(_0x4dcc30(0xf4))/0x1+-parseInt(_0x4dcc30(0xe5))/0x2+parseInt(_0x4dcc30(0x103))/0x3*(-parseInt(_0x4dcc30(0xfd))/0x4)+-parseInt(_0x4dcc30(0xd7))/0x5+parseInt(_0x4dcc30(0xde))/0x6*(parseInt(_0x4dcc30(0xff))/0x7)+-parseInt(_0x4dcc30(0x10a))/0x8*(-parseInt(_0x4dcc30(0xec))/0x9)+-parseInt(_0x4dcc30(0xfc))/0xa*(-parseInt(_0x4dcc30(0x105))/0xb);if(_0x303552===_0x356ddf)break;else _0x38f4b1['push'](_0x38f4b1['shift']());}catch(_0x84e9e8){_0x38f4b1['push'](_0x38f4b1['shift']());}}}(a28_0xcf70,0xc160f));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_0x374294 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x55caee(0xe6)]=a28_0x55caee(0xf2);[a28_0x55caee(0x101)]=a28_0x55caee(0xe9);async[a28_0x55caee(0xd9)](_0x591d82){const _0x570fa2=a28_0x55caee;console[_0x570fa2(0xf7)](a28_0x374294[_0x570fa2(0xe1)](_0x570fa2(0xf3))),console[_0x570fa2(0xf7)](a28_0x374294[_0x570fa2(0xe1)](_0x570fa2(0xdf)));const {options:_0x25e45b,args:_0x823568,tdx:_0x3a6eaf}=_0x591d82,_0x14c39e=_0x25e45b;if(_0x823568[_0x570fa2(0x10c)]===0x0)return console[_0x570fa2(0xf7)](_0x570fa2(0xe4)),console[_0x570fa2(0xf7)](_0x570fa2(0x106)),console[_0x570fa2(0xf7)]('Examples:'),console['error'](_0x570fa2(0xea)),console['error'](_0x570fa2(0xf1)),console[_0x570fa2(0xf7)](_0x570fa2(0xe3)),0x1;const _0x257a6e=_0x823568[0x0],_0x205b09=_0x25e45b[_0x570fa2(0xeb)];let _0x5bd058=_0x257a6e;_0x205b09&&!_0x257a6e[_0x570fa2(0x100)]('/')&&(_0x5bd058=_0x205b09+'/'+_0x257a6e,_0x14c39e[_0x570fa2(0xf9)]&&console[_0x570fa2(0xf7)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5bd058));const _0x349a37=parsePath(_0x5bd058);if(_0x349a37[_0x570fa2(0xdb)][_0x570fa2(0x10c)]<0x2)return console['error'](_0x570fa2(0xf6)),console[_0x570fa2(0xf7)](_0x570fa2(0xf5)),0x1;const _0x24646b=_0x349a37[_0x570fa2(0xdb)][0x0],_0x320dd0=getBaseName(_0x5bd058),_0x5cafb4=getParentPath(_0x5bd058);_0x14c39e[_0x570fa2(0xf9)]&&(console[_0x570fa2(0xf7)]('Site:\x20'+_0x14c39e[_0x570fa2(0xfb)]),console['error']('Target\x20path:\x20'+_0x5bd058),console[_0x570fa2(0xf7)](_0x570fa2(0x107)+_0x24646b),console['error'](_0x570fa2(0x108)+_0x320dd0),console[_0x570fa2(0xf7)](_0x570fa2(0xda)+_0x5cafb4));const _0x126e73=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x24646b+_0x570fa2(0xe0),()=>_0x3a6eaf[_0x570fa2(0x109)][_0x570fa2(0xfa)](_0x24646b),{'verbose':_0x14c39e[_0x570fa2(0xf9)]}),_0xef019c=_0x126e73['data'];let _0x31d86f;if(_0x349a37[_0x570fa2(0xdb)][_0x570fa2(0x10c)]>0x2){const _0x4fc68d=await withSpinner(_0x570fa2(0xe8)+_0x5cafb4+_0x570fa2(0xe0),()=>_0x3a6eaf['segment'][_0x570fa2(0xf8)](_0x5cafb4),{'verbose':_0x14c39e[_0x570fa2(0xf9)]}),_0x12d90f=_0x4fc68d['data'];if(_0x12d90f[_0x570fa2(0xdc)]!==_0x570fa2(0x102)&&_0x12d90f['type']!==_0x570fa2(0xee))return console[_0x570fa2(0xf7)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x31d86f=_0x12d90f['folderId'];}else{if(_0x14c39e[_0x570fa2(0x102)]){const _0x4d20ba=await withSpinner(_0x570fa2(0x104)+_0x14c39e[_0x570fa2(0x102)]+_0x570fa2(0xe0),()=>_0x3a6eaf[_0x570fa2(0x109)][_0x570fa2(0xed)](_0xef019c,_0x14c39e['folder']),{'verbose':_0x14c39e[_0x570fa2(0xf9)]});_0x31d86f=_0x4d20ba[_0x570fa2(0xe7)];}}_0x14c39e['verbose']&&_0x31d86f&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x31d86f);const _0x2e8f40=await loadJSONFromOptions(_0x14c39e['rule'],_0x14c39e[_0x570fa2(0xef)]),_0x5b6574={'name':_0x320dd0,'description':_0x14c39e['description'],'rule':_0x2e8f40,'kind':_0x14c39e[_0x570fa2(0xd8)]!==undefined?parseInt(_0x14c39e[_0x570fa2(0xd8)],0xa):undefined,'isVisible':_0x14c39e[_0x570fa2(0x10b)]?![]:undefined,'segmentFolderId':_0x31d86f,'countPopulation':_0x14c39e[_0x570fa2(0xfe)]?![]:undefined},_0x237dd7=await withSpinner('Creating\x20segment\x20\x27'+_0x320dd0+_0x570fa2(0xe0),()=>_0x3a6eaf[_0x570fa2(0x109)][_0x570fa2(0xf0)](_0xef019c,_0x5b6574),{'verbose':_0x14c39e['verbose']}),_0xde14e6=_0x237dd7[_0x570fa2(0xe7)];return console['error']('✔\x20Created\x20segment\x20\x27'+_0xde14e6[_0x570fa2(0xe6)]+_0x570fa2(0xe2)+_0xde14e6['id']),_0x5bd058!==_0x257a6e&&console[_0x570fa2(0xf7)](_0x570fa2(0xdd)+_0x5bd058),await handleSDKOutput([_0xde14e6],_0x14c39e),0x0;}}
@@ -1 +1 @@
1
- const a29_0x1e3ff9=a29_0x2c89;(function(_0x5e5225,_0x22acb2){const _0x518c0a=a29_0x2c89,_0x48a39=_0x5e5225();while(!![]){try{const _0x1d2ac9=parseInt(_0x518c0a(0x1f0))/0x1+-parseInt(_0x518c0a(0x1ee))/0x2+-parseInt(_0x518c0a(0x1d9))/0x3+-parseInt(_0x518c0a(0x1df))/0x4+-parseInt(_0x518c0a(0x1dd))/0x5*(-parseInt(_0x518c0a(0x1db))/0x6)+-parseInt(_0x518c0a(0x1dc))/0x7*(-parseInt(_0x518c0a(0x1f1))/0x8)+-parseInt(_0x518c0a(0x1d7))/0x9*(parseInt(_0x518c0a(0x1e4))/0xa);if(_0x1d2ac9===_0x22acb2)break;else _0x48a39['push'](_0x48a39['shift']());}catch(_0x118018){_0x48a39['push'](_0x48a39['shift']());}}}(a29_0x257b,0xcca5c));import{BaseCommand}from'./command.js';function a29_0x2c89(_0x519816,_0x4f0320){_0x519816=_0x519816-0x1d7;const _0x257b0b=a29_0x257b();let _0x2c8943=_0x257b0b[_0x519816];return _0x2c8943;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a29_0x257b(){const _0x3ae73b=['1187049eoHFQt','Error:\x20Parent\x20segment\x20name\x20is\x20required','6lJrcgo','371jMqcDe','6466780svnnXY','execute','3219032sZBjvE','json','verbose','length','segment','40SPtFLa','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','error','Listing\x20fields\x20for\x20\x27','✔\x20Found\x20','parentSegment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x27...','List\x20available\x20fields\x20for\x20segmentation','Parent\x20segment:\x20','1585556vaxOpo','site','1436501PZyfGk','169200vhluBI','2293542TLirKj','jsonl'];a29_0x257b=function(){return _0x3ae73b;};return a29_0x257b();}export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';['description']=a29_0x1e3ff9(0x1ec);async[a29_0x1e3ff9(0x1de)](_0x59647d){const _0x4611ed=a29_0x1e3ff9,{options:_0x4dd8b5,args:_0x3df206,tdx:_0x1a2ee8}=_0x59647d,_0x1169a2=_0x3df206[0x0]||_0x4dd8b5[_0x4611ed(0x1e9)];if(!_0x1169a2)return console[_0x4611ed(0x1e6)](_0x4611ed(0x1da)),console[_0x4611ed(0x1e6)](_0x4611ed(0x1e5)),console[_0x4611ed(0x1e6)](_0x4611ed(0x1ea)),0x1;_0x4dd8b5[_0x4611ed(0x1e1)]&&(console[_0x4611ed(0x1e6)]('Site:\x20'+_0x4dd8b5[_0x4611ed(0x1ef)]),console[_0x4611ed(0x1e6)](_0x4611ed(0x1ed)+_0x1169a2));const _0x46e93c=await withSpinner(_0x4611ed(0x1e7)+_0x1169a2+_0x4611ed(0x1eb),()=>_0x1a2ee8[_0x4611ed(0x1e3)]['listFields'](_0x1169a2),{'verbose':_0x4dd8b5[_0x4611ed(0x1e1)]}),_0x473726=_0x46e93c['data'];console['error'](_0x4611ed(0x1e8)+_0x473726[_0x4611ed(0x1e2)]+'\x20field'+(_0x473726[_0x4611ed(0x1e2)]!==0x1?'s':''));if(_0x4dd8b5[_0x4611ed(0x1e0)]||_0x4dd8b5[_0x4611ed(0x1d8)])return await handleSDKOutput(_0x473726,_0x4dd8b5),0x0;return displayFieldsHumanReadable(_0x473726,_0x1169a2),0x0;}}
1
+ const a29_0x56b708=a29_0x4dd6;function a29_0x4dd6(_0x40d388,_0x2186ff){_0x40d388=_0x40d388-0x192;const _0x1d722b=a29_0x1d72();let _0x4dd645=_0x1d722b[_0x40d388];return _0x4dd645;}(function(_0x19a24b,_0x36604a){const _0x1b55b8=a29_0x4dd6,_0xb40aaa=_0x19a24b();while(!![]){try{const _0x344e58=-parseInt(_0x1b55b8(0x19d))/0x1*(-parseInt(_0x1b55b8(0x195))/0x2)+parseInt(_0x1b55b8(0x1ad))/0x3*(-parseInt(_0x1b55b8(0x1a0))/0x4)+parseInt(_0x1b55b8(0x1a4))/0x5+-parseInt(_0x1b55b8(0x19c))/0x6*(parseInt(_0x1b55b8(0x19b))/0x7)+parseInt(_0x1b55b8(0x1a2))/0x8*(-parseInt(_0x1b55b8(0x199))/0x9)+-parseInt(_0x1b55b8(0x198))/0xa*(parseInt(_0x1b55b8(0x1af))/0xb)+parseInt(_0x1b55b8(0x193))/0xc;if(_0x344e58===_0x36604a)break;else _0xb40aaa['push'](_0xb40aaa['shift']());}catch(_0x487482){_0xb40aaa['push'](_0xb40aaa['shift']());}}}(a29_0x1d72,0xe68ce));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x1d72(){const _0x47aca3=['\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','2948444ogHlOD','verbose','3162480hnJXpd','listFields','2331830nSjAxK','Error:\x20Parent\x20segment\x20name\x20is\x20required','Listing\x20fields\x20for\x20\x27','data','length','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','List\x20available\x20fields\x20for\x20segmentation','parentSegment','segment:fields','3GWvrfJ','✔\x20Found\x20','506zppoiB','error','44609484lSbGPL','\x27...','12346fVxOhv','jsonl','Site:\x20','2880qmScrA','36cecYoh','site','73717USxSsb','978yPRSao','131fvZFsG','\x20field'];a29_0x1d72=function(){return _0x47aca3;};return a29_0x1d72();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x56b708(0x1ac);['description']=a29_0x56b708(0x1aa);async['execute'](_0x9f91e){const _0x3fec18=a29_0x56b708,{options:_0x184005,args:_0x2d7446,tdx:_0x43ed90}=_0x9f91e,_0x4a3f83=_0x2d7446[0x0]||_0x184005[_0x3fec18(0x1ab)];if(!_0x4a3f83)return console[_0x3fec18(0x192)](_0x3fec18(0x1a5)),console['error'](_0x3fec18(0x1a9)),console['error'](_0x3fec18(0x19f)),0x1;_0x184005[_0x3fec18(0x1a1)]&&(console['error'](_0x3fec18(0x197)+_0x184005[_0x3fec18(0x19a)]),console[_0x3fec18(0x192)]('Parent\x20segment:\x20'+_0x4a3f83));const _0x532258=await withSpinner(_0x3fec18(0x1a6)+_0x4a3f83+_0x3fec18(0x194),()=>_0x43ed90['segment'][_0x3fec18(0x1a3)](_0x4a3f83),{'verbose':_0x184005[_0x3fec18(0x1a1)]}),_0x3c69b0=_0x532258[_0x3fec18(0x1a7)];console[_0x3fec18(0x192)](_0x3fec18(0x1ae)+_0x3c69b0[_0x3fec18(0x1a8)]+_0x3fec18(0x19e)+(_0x3c69b0[_0x3fec18(0x1a8)]!==0x1?'s':''));if(_0x184005['json']||_0x184005[_0x3fec18(0x196)])return await handleSDKOutput(_0x3c69b0,_0x184005),0x0;return displayFieldsHumanReadable(_0x3c69b0,_0x4a3f83),0x0;}}
@@ -1 +1 @@
1
- const a30_0x1a286b=a30_0x30ea;(function(_0x1e56d6,_0x3ee70d){const _0xbd91da=a30_0x30ea,_0x5cbc22=_0x1e56d6();while(!![]){try{const _0x3e3d56=parseInt(_0xbd91da(0x10f))/0x1*(-parseInt(_0xbd91da(0xfb))/0x2)+parseInt(_0xbd91da(0x12c))/0x3+parseInt(_0xbd91da(0x10c))/0x4*(parseInt(_0xbd91da(0xff))/0x5)+-parseInt(_0xbd91da(0x124))/0x6+parseInt(_0xbd91da(0x13b))/0x7*(parseInt(_0xbd91da(0x116))/0x8)+parseInt(_0xbd91da(0x13d))/0x9*(parseInt(_0xbd91da(0x143))/0xa)+-parseInt(_0xbd91da(0x119))/0xb;if(_0x3e3d56===_0x3ee70d)break;else _0x5cbc22['push'](_0x5cbc22['shift']());}catch(_0x228483){_0x5cbc22['push'](_0x5cbc22['shift']());}}}(a30_0x39bb,0x591c4));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x46a44e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x12289d from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a30_0x39bb(){const _0x4b190b=['name','\x20journeys','\x0aChanges\x20to\x20\x27','163025PNBrCe','data','helpText','resourceName','Aborted.','verbose','length','utf-8','red','\x20\x20Target:\x20','parentName','counts','diff','32EkUIEf','setPhase','type','246079rQrdJw','journeyVersions','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','✔\x20All\x20files\x20are\x20up\x20to\x20date','parentSegment','activations','parent_segment','3208CDtQnL','\x20files?','\x20files\x20to\x20','1097833SMPsVd','segments','\x20unchanged\x20files','✔\x20Pulled\x20','isNew','\x20versions)','Write\x20','absolutePath','session','relativePath','error','1099140RpvEzg','Target\x20resource:\x20','message','filter','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dim','yellow','file','70239LuQCik','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','yes','Parent\x20segment:\x20','execute','\x20\x20🎯\x20','\x20segments','segment:pull','site','Pulling\x20segments\x20from\x20\x27','dirname','cyan','repeat','\x20changed\x20files','\x20with\x20','3297rfgcwK','Error:\x20','947124hdUUxb','files','hasChanges','✔\x20Context\x20set:\x20','\x20activations','targetDir','40ggcZCJ','green','journeys','errorCode','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','pullSegments','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','2AkNVjr'];a30_0x39bb=function(){return _0x4b190b;};return a30_0x39bb();}function a30_0x30ea(_0x8995a6,_0xbd4b71){_0x8995a6=_0x8995a6-0xf7;const _0x39bb56=a30_0x39bb();let _0x30ead0=_0x39bb56[_0x8995a6];return _0x30ead0;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x1a286b(0xfc)]=a30_0x1a286b(0x133);['description']=a30_0x1a286b(0xf8);async[a30_0x1a286b(0x130)](_0x3263df){const _0x5d33d2=a30_0x1a286b,{options:_0x5e90b6,args:_0x4cd080,tdx:_0x4cb8cf}=_0x3263df,_0x532d1e=_0x5e90b6,_0x34f287=await resolveTarget({'arg':_0x4cd080[0x0],'contextParent':_0x5e90b6[_0x5d33d2(0x113)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x34f287))return _0x34f287[_0x5d33d2(0xf7)]==='no_parent'?(console['error'](a30_0x46a44e[_0x5d33d2(0x12a)](_0x5d33d2(0xfa))),console[_0x5d33d2(0x123)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x5d33d2(0x123)](_0x5d33d2(0x111)),console[_0x5d33d2(0x123)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a30_0x46a44e[_0x5d33d2(0x107)](_0x5d33d2(0x13c)+_0x34f287[_0x5d33d2(0x126)]+'\x0a')),_0x34f287[_0x5d33d2(0x101)]&&console[_0x5d33d2(0x123)](a30_0x46a44e[_0x5d33d2(0x137)](_0x34f287[_0x5d33d2(0x101)]))),0x1;const _0x4b5a15=_0x34f287[_0x5d33d2(0x109)],_0x4ebc51=_0x34f287['targetDir'],_0xc4e61e=_0x34f287[_0x5d33d2(0x10e)]===_0x5d33d2(0x12b)?_0x34f287[_0x5d33d2(0x102)]:undefined;_0x532d1e[_0x5d33d2(0x104)]&&(console['error']('Site:\x20'+_0x532d1e[_0x5d33d2(0x134)]),console['error'](_0x5d33d2(0x12f)+_0x4b5a15),_0xc4e61e&&console['error'](_0x5d33d2(0x125)+_0xc4e61e));const _0x19d292=await withProgressSpinner(_0x5d33d2(0x135)+_0x4b5a15+'\x27...',_0x54da3e=>_0x4cb8cf['segment'][_0x5d33d2(0xf9)](_0x4b5a15,{'targetDir':_0x4ebc51,'targetResourceName':_0xc4e61e,'verbose':_0x532d1e[_0x5d33d2(0x104)],'progress':{'update':_0x295f01=>{const _0x43afad=_0x5d33d2;_0x54da3e[_0x43afad(0x10d)](_0x295f01),_0x532d1e[_0x43afad(0x104)]&&console[_0x43afad(0x123)]('\x20\x20'+_0x295f01);}}}),{'verbose':_0x532d1e[_0x5d33d2(0x104)]}),_0x17bbe6=_0x19d292[_0x5d33d2(0x100)];if(_0x17bbe6[_0x5d33d2(0x10a)][_0x5d33d2(0x11a)]===0x0&&_0x17bbe6['counts']['journeys']===0x0)return console[_0x5d33d2(0x123)](a30_0x46a44e[_0x5d33d2(0x12a)](_0x5d33d2(0x128)+_0x17bbe6[_0x5d33d2(0x109)]+'\x27')),0x0;const _0x18a3f1=_0x17bbe6[_0x5d33d2(0x13e)][_0x5d33d2(0x127)](_0x1049a9=>_0x1049a9[_0x5d33d2(0x11d)]),_0x13e8a4=_0x17bbe6['files']['filter'](_0x1c355a=>!_0x1c355a[_0x5d33d2(0x11d)]&&_0x1c355a[_0x5d33d2(0x13f)]),_0x445025=_0x17bbe6[_0x5d33d2(0x13e)][_0x5d33d2(0x127)](_0x2c9012=>!_0x2c9012[_0x5d33d2(0x11d)]&&!_0x2c9012[_0x5d33d2(0x13f)]);console[_0x5d33d2(0x123)]('\x0aPull\x20summary\x20for\x20\x27'+_0x17bbe6[_0x5d33d2(0x109)]+'\x27:'),console[_0x5d33d2(0x123)](_0x5d33d2(0x131)+a30_0x46a44e[_0x5d33d2(0x137)](_0x17bbe6['counts'][_0x5d33d2(0x11a)]+_0x5d33d2(0x132))+_0x5d33d2(0x13a)+a30_0x46a44e[_0x5d33d2(0x137)](_0x17bbe6[_0x5d33d2(0x10a)][_0x5d33d2(0x114)]+_0x5d33d2(0x141)));if(_0x17bbe6['counts'][_0x5d33d2(0x145)]>0x0){const _0x4e9ee5=_0x17bbe6[_0x5d33d2(0x10a)]['journeyVersions']>_0x17bbe6['counts'][_0x5d33d2(0x145)]?'\x20('+_0x17bbe6['counts'][_0x5d33d2(0x110)]+_0x5d33d2(0x11e):'';console[_0x5d33d2(0x123)]('\x20\x20🗺️\x20\x20'+a30_0x46a44e[_0x5d33d2(0x137)](_0x17bbe6[_0x5d33d2(0x10a)][_0x5d33d2(0x145)]+_0x5d33d2(0xfd))+a30_0x46a44e[_0x5d33d2(0x129)](_0x4e9ee5));}console['error']('\x20\x20'+a30_0x46a44e[_0x5d33d2(0x144)]('+\x20'+_0x18a3f1['length']+'\x20new\x20files')),console[_0x5d33d2(0x123)]('\x20\x20'+a30_0x46a44e[_0x5d33d2(0x12a)]('~\x20'+_0x13e8a4[_0x5d33d2(0x105)]+_0x5d33d2(0x139))),console[_0x5d33d2(0x123)]('\x20\x20'+a30_0x46a44e[_0x5d33d2(0x129)]('=\x20'+_0x445025['length']+_0x5d33d2(0x11b))),console[_0x5d33d2(0x123)](_0x5d33d2(0x108)+a30_0x46a44e[_0x5d33d2(0x137)](_0x17bbe6['targetDir'])+'\x0a');if(_0x13e8a4[_0x5d33d2(0x105)]>0x0)for(const _0x202783 of _0x13e8a4){console[_0x5d33d2(0x123)](_0x5d33d2(0xfe)+_0x202783[_0x5d33d2(0x122)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x5d33d2(0x123)](_0x202783[_0x5d33d2(0x10b)]),console[_0x5d33d2(0x123)]('─'[_0x5d33d2(0x138)](0x3c));}if(_0x532d1e['dryRun'])return console[_0x5d33d2(0x123)](a30_0x46a44e[_0x5d33d2(0x12a)](_0x5d33d2(0x12d))),0x0;if(_0x18a3f1[_0x5d33d2(0x105)]===0x0&&_0x13e8a4[_0x5d33d2(0x105)]===0x0)return console[_0x5d33d2(0x123)](a30_0x46a44e[_0x5d33d2(0x144)](_0x5d33d2(0x112))),saveSessionContext({'parent_segment':_0x17bbe6['parentName']},_0x532d1e['session']),console[_0x5d33d2(0x123)](a30_0x46a44e[_0x5d33d2(0x144)](_0x5d33d2(0x140)+a30_0x46a44e['dim'](_0x5d33d2(0x115))+'\x20=\x20'+a30_0x46a44e['cyan'](_0x17bbe6[_0x5d33d2(0x109)]))),0x0;if(!_0x532d1e[_0x5d33d2(0x12e)]){const _0x252f93=await confirmKey(_0x5d33d2(0x11f)+(_0x18a3f1[_0x5d33d2(0x105)]+_0x13e8a4['length'])+_0x5d33d2(0x117));if(!_0x252f93)return console[_0x5d33d2(0x123)](_0x5d33d2(0x103)),0x1;}for(const _0x1df9d5 of _0x17bbe6[_0x5d33d2(0x13e)]){if(_0x1df9d5['isNew']||_0x1df9d5['hasChanges']){const _0x787c3b=a30_0x12289d[_0x5d33d2(0x136)](_0x1df9d5['absolutePath']);!existsSync(_0x787c3b)&&mkdirSync(_0x787c3b,{'recursive':!![]}),writeFileSync(_0x1df9d5[_0x5d33d2(0x120)],_0x1df9d5['content'],_0x5d33d2(0x106));}}return console[_0x5d33d2(0x123)](a30_0x46a44e['green'](_0x5d33d2(0x11c)+(_0x18a3f1['length']+_0x13e8a4['length'])+_0x5d33d2(0x118)+_0x17bbe6[_0x5d33d2(0x142)])),saveSessionContext({'parent_segment':_0x17bbe6[_0x5d33d2(0x109)]},_0x532d1e[_0x5d33d2(0x121)]),console['error'](a30_0x46a44e[_0x5d33d2(0x144)](_0x5d33d2(0x140)+a30_0x46a44e[_0x5d33d2(0x129)]('parent_segment')+'\x20=\x20'+a30_0x46a44e[_0x5d33d2(0x137)](_0x17bbe6[_0x5d33d2(0x109)]))),0x0;}}
1
+ const a30_0x2ad7bc=a30_0x4665;(function(_0x54079f,_0x22f905){const _0x532e89=a30_0x4665,_0x4f242c=_0x54079f();while(!![]){try{const _0x160cee=parseInt(_0x532e89(0x206))/0x1+parseInt(_0x532e89(0x1f0))/0x2*(-parseInt(_0x532e89(0x1f7))/0x3)+-parseInt(_0x532e89(0x210))/0x4+parseInt(_0x532e89(0x1fd))/0x5*(parseInt(_0x532e89(0x1fa))/0x6)+parseInt(_0x532e89(0x221))/0x7+-parseInt(_0x532e89(0x223))/0x8*(-parseInt(_0x532e89(0x20a))/0x9)+-parseInt(_0x532e89(0x20e))/0xa;if(_0x160cee===_0x22f905)break;else _0x4f242c['push'](_0x4f242c['shift']());}catch(_0x4c8a7b){_0x4f242c['push'](_0x4f242c['shift']());}}}(a30_0x2079,0xde762));import{BaseCommand}from'./command.js';function a30_0x4665(_0x188e90,_0x550cca){_0x188e90=_0x188e90-0x1dd;const _0x207983=a30_0x2079();let _0x4665d7=_0x207983[_0x188e90];return _0x4665d7;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x47e098 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x534521 from'path';function a30_0x2079(){const _0x1c26ad=['verbose','124458wnEotw','Target\x20resource:\x20','journeyVersions','6bgyAub','errorCode','\x0aChanges\x20to\x20\x27','3390890QjSOWF','cyan','parent_segment','name','\x20\x20Target:\x20','segment:pull','type','\x20versions)','file','790939jZQcTN','setPhase','segments','\x20files\x20to\x20','441hGfYBc','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','content','\x20new\x20files','439130RsGsIp','segment','7185988ApzJrY','files','length','utf-8','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','green','✔\x20Pulled\x20','filter','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','session','diff','resourceName','targetDir','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','description','Write\x20','2106594FJKIYK','Pulling\x20segments\x20from\x20\x27','173800RqkbTJ','hasChanges','\x20unchanged\x20files','\x20segments','relativePath','pullSegments','repeat','isNew','yellow','error','absolutePath','red','parentSegment','\x20=\x20','site','\x20files?','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20changed\x20files','helpText','dim','execute','Parent\x20segment:\x20','\x0aPull\x20summary\x20for\x20\x27','4mBdiPK','cwd','journeys','no_parent','counts','dirname'];a30_0x2079=function(){return _0x1c26ad;};return a30_0x2079();}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_0x2ad7bc(0x200)]=a30_0x2ad7bc(0x202);[a30_0x2ad7bc(0x21f)]=a30_0x2ad7bc(0x219);async[a30_0x2ad7bc(0x1ed)](_0xfd2ed3){const _0x2993d4=a30_0x2ad7bc,{options:_0x190a8f,args:_0x3a1014,tdx:_0x434e3d}=_0xfd2ed3,_0x2b24e8=_0x190a8f,_0x2899fa=await resolveTarget({'arg':_0x3a1014[0x0],'contextParent':_0x190a8f[_0x2993d4(0x1e5)],'cwd':process[_0x2993d4(0x1f1)]()});if(!isSuccessfulResolution(_0x2899fa))return _0x2899fa[_0x2993d4(0x1fb)]===_0x2993d4(0x1f3)?(console['error'](a30_0x47e098[_0x2993d4(0x1e1)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2993d4(0x1e2)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x2993d4(0x1e2)](_0x2993d4(0x20b)),console[_0x2993d4(0x1e2)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x2993d4(0x1e2)](a30_0x47e098[_0x2993d4(0x1e4)]('Error:\x20'+_0x2899fa['message']+'\x0a')),_0x2899fa['helpText']&&console[_0x2993d4(0x1e2)](a30_0x47e098['cyan'](_0x2899fa[_0x2993d4(0x1eb)]))),0x1;const _0x1ea620=_0x2899fa['parentName'],_0x18ed2d=_0x2899fa['targetDir'],_0x5502f6=_0x2899fa[_0x2993d4(0x203)]===_0x2993d4(0x205)?_0x2899fa[_0x2993d4(0x21c)]:undefined;_0x2b24e8[_0x2993d4(0x1f6)]&&(console[_0x2993d4(0x1e2)]('Site:\x20'+_0x2b24e8[_0x2993d4(0x1e7)]),console[_0x2993d4(0x1e2)](_0x2993d4(0x1ee)+_0x1ea620),_0x5502f6&&console[_0x2993d4(0x1e2)](_0x2993d4(0x1f8)+_0x5502f6));const _0x7f82ef=await withProgressSpinner(_0x2993d4(0x222)+_0x1ea620+'\x27...',_0x13c588=>_0x434e3d[_0x2993d4(0x20f)][_0x2993d4(0x1de)](_0x1ea620,{'targetDir':_0x18ed2d,'targetResourceName':_0x5502f6,'verbose':_0x2b24e8['verbose'],'progress':{'update':_0x39b169=>{const _0x4c8e31=_0x2993d4;_0x13c588[_0x4c8e31(0x207)](_0x39b169),_0x2b24e8[_0x4c8e31(0x1f6)]&&console[_0x4c8e31(0x1e2)]('\x20\x20'+_0x39b169);}}}),{'verbose':_0x2b24e8[_0x2993d4(0x1f6)]}),_0x1dc96e=_0x7f82ef['data'];if(_0x1dc96e[_0x2993d4(0x1f4)][_0x2993d4(0x208)]===0x0&&_0x1dc96e['counts'][_0x2993d4(0x1f2)]===0x0)return console[_0x2993d4(0x1e2)](a30_0x47e098[_0x2993d4(0x1e1)](_0x2993d4(0x21e)+_0x1dc96e[_0x2993d4(0x215)]+'\x27')),0x0;const _0x4d3888=_0x1dc96e[_0x2993d4(0x211)][_0x2993d4(0x218)](_0x45bcde=>_0x45bcde[_0x2993d4(0x1e0)]),_0xa6e75c=_0x1dc96e['files']['filter'](_0xd3a64c=>!_0xd3a64c[_0x2993d4(0x1e0)]&&_0xd3a64c['hasChanges']),_0x1cc466=_0x1dc96e[_0x2993d4(0x211)]['filter'](_0x2744a6=>!_0x2744a6[_0x2993d4(0x1e0)]&&!_0x2744a6['hasChanges']);console['error'](_0x2993d4(0x1ef)+_0x1dc96e[_0x2993d4(0x215)]+'\x27:'),console[_0x2993d4(0x1e2)]('\x20\x20🎯\x20'+a30_0x47e098[_0x2993d4(0x1fe)](_0x1dc96e[_0x2993d4(0x1f4)][_0x2993d4(0x208)]+_0x2993d4(0x226))+'\x20with\x20'+a30_0x47e098[_0x2993d4(0x1fe)](_0x1dc96e[_0x2993d4(0x1f4)]['activations']+'\x20activations'));if(_0x1dc96e[_0x2993d4(0x1f4)][_0x2993d4(0x1f2)]>0x0){const _0x6f1183=_0x1dc96e[_0x2993d4(0x1f4)][_0x2993d4(0x1f9)]>_0x1dc96e[_0x2993d4(0x1f4)]['journeys']?'\x20('+_0x1dc96e[_0x2993d4(0x1f4)][_0x2993d4(0x1f9)]+_0x2993d4(0x204):'';console[_0x2993d4(0x1e2)]('\x20\x20🗺️\x20\x20'+a30_0x47e098['cyan'](_0x1dc96e[_0x2993d4(0x1f4)][_0x2993d4(0x1f2)]+'\x20journeys')+a30_0x47e098[_0x2993d4(0x1ec)](_0x6f1183));}console[_0x2993d4(0x1e2)]('\x20\x20'+a30_0x47e098[_0x2993d4(0x216)]('+\x20'+_0x4d3888[_0x2993d4(0x212)]+_0x2993d4(0x20d))),console[_0x2993d4(0x1e2)]('\x20\x20'+a30_0x47e098[_0x2993d4(0x1e1)]('~\x20'+_0xa6e75c[_0x2993d4(0x212)]+_0x2993d4(0x1ea))),console['error']('\x20\x20'+a30_0x47e098[_0x2993d4(0x1ec)]('=\x20'+_0x1cc466[_0x2993d4(0x212)]+_0x2993d4(0x225))),console['error'](_0x2993d4(0x201)+a30_0x47e098[_0x2993d4(0x1fe)](_0x1dc96e[_0x2993d4(0x21d)])+'\x0a');if(_0xa6e75c[_0x2993d4(0x212)]>0x0)for(const _0x270e00 of _0xa6e75c){console[_0x2993d4(0x1e2)](_0x2993d4(0x1fc)+_0x270e00[_0x2993d4(0x1dd)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x270e00[_0x2993d4(0x21b)]),console[_0x2993d4(0x1e2)]('─'[_0x2993d4(0x1df)](0x3c));}if(_0x2b24e8['dryRun'])return console[_0x2993d4(0x1e2)](a30_0x47e098['yellow'](_0x2993d4(0x214))),0x0;if(_0x4d3888[_0x2993d4(0x212)]===0x0&&_0xa6e75c[_0x2993d4(0x212)]===0x0)return console[_0x2993d4(0x1e2)](a30_0x47e098[_0x2993d4(0x216)](_0x2993d4(0x1e9))),saveSessionContext({'parent_segment':_0x1dc96e[_0x2993d4(0x215)]},_0x2b24e8['session']),console['error'](a30_0x47e098[_0x2993d4(0x216)]('✔\x20Context\x20set:\x20'+a30_0x47e098[_0x2993d4(0x1ec)](_0x2993d4(0x1ff))+_0x2993d4(0x1e6)+a30_0x47e098[_0x2993d4(0x1fe)](_0x1dc96e[_0x2993d4(0x215)]))),0x0;if(!_0x2b24e8['yes']){const _0x2299e6=await confirmKey(_0x2993d4(0x220)+(_0x4d3888['length']+_0xa6e75c[_0x2993d4(0x212)])+_0x2993d4(0x1e8));if(!_0x2299e6)return console['error']('Aborted.'),0x1;}for(const _0x5aebac of _0x1dc96e[_0x2993d4(0x211)]){if(_0x5aebac[_0x2993d4(0x1e0)]||_0x5aebac[_0x2993d4(0x224)]){const _0x350645=a30_0x534521[_0x2993d4(0x1f5)](_0x5aebac[_0x2993d4(0x1e3)]);!existsSync(_0x350645)&&mkdirSync(_0x350645,{'recursive':!![]}),writeFileSync(_0x5aebac[_0x2993d4(0x1e3)],_0x5aebac[_0x2993d4(0x20c)],_0x2993d4(0x213));}}return console[_0x2993d4(0x1e2)](a30_0x47e098[_0x2993d4(0x216)](_0x2993d4(0x217)+(_0x4d3888[_0x2993d4(0x212)]+_0xa6e75c[_0x2993d4(0x212)])+_0x2993d4(0x209)+_0x1dc96e[_0x2993d4(0x21d)])),saveSessionContext({'parent_segment':_0x1dc96e[_0x2993d4(0x215)]},_0x2b24e8[_0x2993d4(0x21a)]),console[_0x2993d4(0x1e2)](a30_0x47e098[_0x2993d4(0x216)]('✔\x20Context\x20set:\x20'+a30_0x47e098[_0x2993d4(0x1ec)](_0x2993d4(0x1ff))+'\x20=\x20'+a30_0x47e098[_0x2993d4(0x1fe)](_0x1dc96e[_0x2993d4(0x215)]))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x5ee0bc=a31_0x44e8;(function(_0x2e90b7,_0x856997){const _0x5a7ce4=a31_0x44e8,_0x46fbd7=_0x2e90b7();while(!![]){try{const _0x560c55=-parseInt(_0x5a7ce4(0x19f))/0x1*(parseInt(_0x5a7ce4(0x14a))/0x2)+parseInt(_0x5a7ce4(0x139))/0x3+-parseInt(_0x5a7ce4(0x151))/0x4+parseInt(_0x5a7ce4(0x119))/0x5*(parseInt(_0x5a7ce4(0x11a))/0x6)+-parseInt(_0x5a7ce4(0x160))/0x7+parseInt(_0x5a7ce4(0x113))/0x8+-parseInt(_0x5a7ce4(0x196))/0x9;if(_0x560c55===_0x856997)break;else _0x46fbd7['push'](_0x46fbd7['shift']());}catch(_0x1b8acf){_0x46fbd7['push'](_0x46fbd7['shift']());}}}(a31_0xbd6d,0x88485));function a31_0x44e8(_0x30308f,_0x35f2e4){_0x30308f=_0x30308f-0x104;const _0xbd6d42=a31_0xbd6d();let _0x44e881=_0xbd6d42[_0x30308f];return _0x44e881;}import{BaseCommand}from'./command.js';function a31_0xbd6d(){const _0x38f556=['relationships','add','/app/ps/','errorCode','file','verbose','state','Fetching\x20existing\x20activations...','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)','map','message','toUpdate','segments','\x20\x20Source:\x20','activations','\x0aPush\x20summary\x20for\x20\x27','push','changed','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','endsWith','isNew','site','red','2119056ItrZRJ','buildUserMaps','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','get','connection','journeyBundleId','listActivations','then','.yaml','updated','(Journey\x20will\x20be\x20deleted)','getJourney','cwd','yes','all','\x0a✔\x20Push\x20complete','set','7828tkHigG','.yml','Fetching\x20parent\x20segment\x20details...','Error:\x20Directory\x20not\x20found:\x20','no_parent','diff','createdSegmentIds','3215368yrarDF','Source\x20directory:\x20','createdAt','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20activations]','\x20updated','listFolders','getOutputSchemaWithCache','journeys','repeat','isScoped','toDelete','Push\x20','attributes','\x20\x20\x20\x20','1586963bmcQEG','length','segment','delete','\x20to\x20create','targetDir','\x20changed','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','updatedAt','new','scopedFolderPath','name','\x20YAML\x20files\x20found','\x20deleted','Fetching\x20existing\x20journeys...','cyan','yamlConfig','journey','green','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20to\x20update','\x20\x20🗺️\x20\x20Journeys:','journeyBundleName','/e/','resolveParentId','parentName','nameToId','helpText','Changes\x20to:','New\x20journey:','filePath','\x20folders\x20to\x20create','Changes\x20to\x20journey:','type','data','folderId','filter','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','deleted','segmentFolderId','dryRun','description','idToName','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20unchanged','unchanged','blue','audienceId','setPhase','\x20changes?','3041613sWRTUG','error','\x20new','New\x20segment:','getParent','list','toString','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','📁\x20','66xohtAf','dim','results','parentFolder','yellow','parent_name','\x20\x20Segments:\x20','folderPath','created','parentSegment','listSegments','Fetching\x20connections\x20for\x20name\x20resolution...','journeyId','\x20created','user','journeysOnly','3821456afyqlP','toCreate','join','\x20to\x20delete','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','No\x20','265RZDmrR','113322ZPXFhi','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Folders\x20to\x20create:','\x20\x20Activations:','existingJourney','Aborted.','/j/da/je','\x0aValidation\x20failed:'];a31_0xbd6d=function(){return _0x38f556;};return a31_0xbd6d();}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_0x373ca4 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{[a31_0x5ee0bc(0x16e)]='segment:push';[a31_0x5ee0bc(0x18d)]=a31_0x5ee0bc(0x154);async['execute'](_0x2230d9){const _0x22bf78=a31_0x5ee0bc,{options:_0x32036b,args:_0x57b215,tdx:_0x280edf}=_0x2230d9,_0x517492=_0x32036b,_0x471e76=await resolveTarget({'arg':_0x57b215[0x0],'contextParent':_0x32036b[_0x22bf78(0x10c)],'cwd':process[_0x22bf78(0x145)]()});if(!isSuccessfulResolution(_0x471e76))return _0x471e76[_0x22bf78(0x125)]===_0x22bf78(0x14e)?(console['error'](a31_0x373ca4[_0x22bf78(0x107)](_0x22bf78(0x134))),console[_0x22bf78(0x197)](_0x22bf78(0x12a)),console['error'](_0x22bf78(0x177)),console[_0x22bf78(0x197)](_0x22bf78(0x19d))):(console[_0x22bf78(0x197)](a31_0x373ca4['red']('Error:\x20'+_0x471e76[_0x22bf78(0x12c)]+'\x0a')),_0x471e76['helpText']&&console['error'](a31_0x373ca4['cyan'](_0x471e76[_0x22bf78(0x17f)]))),0x1;if(_0x471e76[_0x22bf78(0x185)]===_0x22bf78(0x108))return console['error'](a31_0x373ca4['red'](_0x22bf78(0x14d)+_0x471e76[_0x22bf78(0x165)]+'\x0a')),console[_0x22bf78(0x197)](a31_0x373ca4[_0x22bf78(0x172)](_0x22bf78(0x169))),0x1;const _0x29ea07=_0x471e76[_0x22bf78(0x17d)],_0xfcab42=_0x471e76[_0x22bf78(0x165)],_0x590ed7=_0x471e76[_0x22bf78(0x185)]===_0x22bf78(0x126)?_0x471e76[_0x22bf78(0x182)]:undefined,_0x1d6b64=getScopedDetails(_0x471e76),_0x3d9057=_0x1d6b64?.[_0x22bf78(0x15b)]??![],_0x5d8bac=_0x1d6b64?.[_0x22bf78(0x16d)]??'';if(!existsSync(_0xfcab42))return console['error'](a31_0x373ca4['red'](_0x22bf78(0x14d)+_0xfcab42+'\x0a')),console[_0x22bf78(0x197)](a31_0x373ca4['cyan'](_0x22bf78(0x169))),0x1;_0x517492['verbose']&&(console['error']('Site:\x20'+_0x517492[_0x22bf78(0x137)]),console[_0x22bf78(0x197)]('Parent\x20segment:\x20'+_0x29ea07),console[_0x22bf78(0x197)](_0x22bf78(0x152)+_0xfcab42),_0x3d9057&&console[_0x22bf78(0x197)]('Scoped\x20to\x20folder:\x20'+_0x5d8bac));const _0x378945=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x29ea07+'\x27...',()=>_0x280edf[_0x22bf78(0x162)][_0x22bf78(0x17c)](_0x29ea07),{'verbose':_0x517492[_0x22bf78(0x127)]}),_0x1be089=_0x378945[_0x22bf78(0x186)],[_0x5e532e,_0x246f79,_0x1e6f16,_0x4853f2,_0x17ca47]=await Promise[_0x22bf78(0x147)]([withSpinner(_0x22bf78(0x14c),()=>_0x280edf[_0x22bf78(0x162)][_0x22bf78(0x19a)](_0x1be089),{'verbose':_0x517492['verbose']}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x280edf[_0x22bf78(0x162)][_0x22bf78(0x10d)](_0x1be089),{'verbose':_0x517492[_0x22bf78(0x127)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x280edf['segment'][_0x22bf78(0x157)](_0x1be089),{'verbose':_0x517492[_0x22bf78(0x127)]}),withSpinner(_0x22bf78(0x171),()=>_0x280edf[_0x22bf78(0x174)]['listJourneysWithDetailsFromParentSegment'](_0x1be089,{'includeAllVersions':!![]}),{'verbose':_0x517492['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x280edf[_0x22bf78(0x111)][_0x22bf78(0x13a)](),{'verbose':_0x517492['verbose']})[_0x22bf78(0x140)](_0x48b45e=>_0x48b45e[_0x22bf78(0x186)])]),_0x2bff3b=_0x5e532e[_0x22bf78(0x186)],_0x42d128=extractRootFolderId(_0x2bff3b),_0x3b22d9=_0x246f79[_0x22bf78(0x186)],_0x496dfd=_0x1e6f16[_0x22bf78(0x186)],{journeys:_0x240785,activationStepsById:_0x23179f}=_0x4853f2[_0x22bf78(0x186)],_0x3fbc3c=new Map(_0x240785[_0x22bf78(0x12b)](_0x34aa60=>[_0x34aa60['id'],_0x34aa60])),_0x2fcee6=_0x240785[_0x22bf78(0x12b)](_0x1ca18a=>({'id':_0x1ca18a['id'],'name':_0x1ca18a[_0x22bf78(0x15e)][_0x22bf78(0x16e)],'journeyBundleName':_0x1ca18a[_0x22bf78(0x15e)][_0x22bf78(0x17a)]||'','journeyBundleId':_0x1ca18a[_0x22bf78(0x15e)][_0x22bf78(0x13e)]||'','versionNumber':_0x1ca18a[_0x22bf78(0x15e)]['versionNumber'],'description':_0x1ca18a[_0x22bf78(0x15e)]['description'],'state':_0x1ca18a[_0x22bf78(0x15e)][_0x22bf78(0x128)],'paused':_0x1ca18a[_0x22bf78(0x15e)]['paused'],'audienceId':_0x1ca18a['attributes'][_0x22bf78(0x193)],'folderId':_0x1ca18a[_0x22bf78(0x122)]?.[_0x22bf78(0x106)]?.[_0x22bf78(0x186)]?.['id'],'createdAt':_0x1ca18a[_0x22bf78(0x15e)][_0x22bf78(0x153)],'updatedAt':_0x1ca18a[_0x22bf78(0x15e)][_0x22bf78(0x16b)]})),{emailToId:_0x52f814,idToEmail:_0x362f17}=_0x17ca47,_0x89774c=await withSpinner(_0x22bf78(0x10e),async()=>{const _0xc0d07d=_0x22bf78,_0x105fee=await _0x280edf[_0xc0d07d(0x13d)][_0xc0d07d(0x19b)]();return buildConnectionMaps(_0x105fee);},{'verbose':_0x517492[_0x22bf78(0x127)]})['then'](_0x33fe21=>_0x33fe21['data']),_0x3a0280=_0x89774c[_0x22bf78(0x17e)],_0x449143=_0x89774c['idToName'],_0xf92b8d=_0x89774c['nameToType'],_0x1d194c={'emailToIdMap':_0x52f814,'connectionNameToIdMap':_0x3a0280,'connectionNameToTypeMap':_0xf92b8d,'getSchema':_0x576bd6=>_0x280edf[_0x22bf78(0x13d)][_0x22bf78(0x158)](_0x576bd6)};let {pathToId:_0x3883e6,idToPath:_0x26af44}=buildFolderMaps(_0x496dfd);const _0x20f7c0=buildSegmentLookupMap(_0x3b22d9,_0x26af44),_0x518ed1=buildSegmentNameToIdMap(_0x3b22d9),_0x5071bd=buildJourneyBundleLookupMap(_0x2fcee6,_0x26af44);let _0x2b0be7;if(_0x590ed7){if(!_0x590ed7[_0x22bf78(0x135)](_0x22bf78(0x14b))&&!_0x590ed7[_0x22bf78(0x135)](_0x22bf78(0x141)))return console[_0x22bf78(0x197)](a31_0x373ca4[_0x22bf78(0x138)](_0x22bf78(0x18f)+_0x590ed7+'\x0a')),0x1;_0x2b0be7=[_0x590ed7];}else _0x2b0be7=findYamlFiles(_0xfcab42);if(_0x2b0be7[_0x22bf78(0x161)]===0x0)return console[_0x22bf78(0x197)](a31_0x373ca4['red'](_0x22bf78(0x13b)+_0xfcab42+'\x0a')),console['error'](a31_0x373ca4['cyan'](_0x22bf78(0x16a))),0x1;let _0x3e52e0,_0x2dafc3;try{const _0x2fced8=parseAndClassifyYamlFiles(_0x2b0be7,_0xfcab42,{'skipSegments':_0x517492[_0x22bf78(0x112)]});_0x3e52e0=_0x2fced8['segments'],_0x2dafc3=_0x2fced8[_0x22bf78(0x159)];const _0xebbebb=validateParsedFiles(_0x2fced8,_0xfcab42);if(_0xebbebb['length']>0x0)return console[_0x22bf78(0x197)](a31_0x373ca4['red'](_0x22bf78(0x121))),console[_0x22bf78(0x197)](formatValidationErrors(_0xebbebb)),console[_0x22bf78(0x197)](a31_0x373ca4['yellow'](_0x22bf78(0x167))),0x1;}catch(_0x492745){return console['error'](a31_0x373ca4[_0x22bf78(0x138)]('Error\x20parsing\x20YAML:\x20'+(_0x492745 instanceof Error?_0x492745[_0x22bf78(0x12c)]:_0x492745))),0x1;}if(_0x3e52e0['length']===0x0&&_0x2dafc3[_0x22bf78(0x161)]===0x0){const _0x11efc3=_0x517492[_0x22bf78(0x112)]?_0x22bf78(0x174):'segment\x20or\x20journey';return console[_0x22bf78(0x197)](a31_0x373ca4[_0x22bf78(0x107)](_0x22bf78(0x118)+_0x11efc3+_0x22bf78(0x16f))),0x0;}const _0x31aabf=new Map();_0x3b22d9[_0x22bf78(0x161)]>0x0&&!_0x517492[_0x22bf78(0x112)]&&await withSpinner(_0x22bf78(0x129),async()=>{await batchAsync(_0x3b22d9,async _0x39ac9d=>{const _0x45f7e2=a31_0x44e8,_0x890a2=await _0x280edf[_0x45f7e2(0x162)][_0x45f7e2(0x13f)](_0x1be089,_0x39ac9d['id']);_0x31aabf[_0x45f7e2(0x149)](_0x39ac9d['id'],_0x890a2);});},{'verbose':_0x517492[_0x22bf78(0x127)]});const {segmentFiles:_0x420a70,foldersToCreate:_0x3dcf63}=await prepareSegmentFiles(_0x3e52e0,{'segmentByFolderAndName':_0x20f7c0,'activationsBySegmentId':_0x31aabf,'folderPathToId':_0x3883e6,'idToEmailMap':_0x362f17,'connectionIdToNameMap':_0x449143},_0x1d194c,_0x3d9057,_0x5d8bac),_0x561d59=_0x590ed7?[]:findSegmentsToDelete(_0x3b22d9,_0x3e52e0[_0x22bf78(0x12b)](({yamlConfig:_0x461ee0,folderPath:_0x5abc54})=>({'yamlConfig':_0x461ee0,'folderPath':resolveTDFolderPath(_0x5abc54,_0x3d9057,_0x5d8bac)})),_0x26af44,_0x5d8bac,_0x3d9057),{journeyFiles:_0x68c325,foldersToCreate:_0x5b36d8}=await withProgressSpinner('Preparing\x20journeys...',async _0x8cbdcd=>prepareJourneyFiles(_0x2dafc3,{'fetchJourney':async _0x472cb0=>_0x280edf['journey'][_0x22bf78(0x144)](_0x472cb0[_0x22bf78(0x10f)]),'journeyBundlesByFolderAndName':_0x5071bd,'folderPathToId':_0x3883e6,'idToEmailMap':_0x362f17,'connectionIdToNameMap':_0x449143,'existingSegments':_0x3b22d9,'parentId':_0x1be089,'deps':_0x280edf,'progress':{'update':_0x2ed902=>{const _0xd0afb4=_0x22bf78;_0x8cbdcd[_0xd0afb4(0x194)](_0x2ed902),_0x517492[_0xd0afb4(0x127)]&&console[_0xd0afb4(0x197)]('\x20\x20'+_0x2ed902);}},'journeyById':_0x3fbc3c,'activationStepsById':_0x23179f},_0x3d9057,_0x5d8bac),{'verbose':_0x517492[_0x22bf78(0x127)]})[_0x22bf78(0x140)](_0x1201c4=>_0x1201c4[_0x22bf78(0x186)]);for(const _0x273629 of _0x5b36d8){_0x3dcf63[_0x22bf78(0x123)](_0x273629);}const _0x490fb4=_0x590ed7?[]:findJourneysToDelete(_0x2fcee6,_0x2dafc3[_0x22bf78(0x12b)](({yamlConfig:_0x3aa248,folderPath:_0x401694})=>({'yamlConfig':_0x3aa248,'folderPath':resolveTDFolderPath(_0x401694,_0x3d9057,_0x5d8bac)})),_0x26af44,_0x5d8bac,_0x3d9057),_0x5d44ea=calculatePushStats(_0x420a70,_0x68c325,_0x3dcf63,_0x561d59,_0x490fb4,!!_0x517492[_0x22bf78(0x163)],!!_0x517492[_0x22bf78(0x112)]),_0x49e9aa=_0x5d44ea[_0x22bf78(0x12e)][_0x22bf78(0x16c)],_0x574c76=_0x5d44ea[_0x22bf78(0x12e)][_0x22bf78(0x133)],_0x9784da=_0x5d44ea[_0x22bf78(0x12e)][_0x22bf78(0x191)],_0x7701e5=_0x5d44ea[_0x22bf78(0x12e)][_0x22bf78(0x15c)],_0x49ba7b=_0x5d44ea['folders'][_0x22bf78(0x114)],_0x872ff1=_0x5d44ea[_0x22bf78(0x159)][_0x22bf78(0x16c)],_0x57661a=_0x5d44ea[_0x22bf78(0x159)][_0x22bf78(0x133)],_0x2ea0c3=_0x5d44ea[_0x22bf78(0x159)][_0x22bf78(0x191)],_0x51d55c=_0x5d44ea[_0x22bf78(0x159)][_0x22bf78(0x15c)],_0x415d57=_0x5d44ea[_0x22bf78(0x130)][_0x22bf78(0x147)],_0x40e9dd=_0x5d44ea[_0x22bf78(0x130)][_0x22bf78(0x114)],_0x588046=_0x5d44ea['activations'][_0x22bf78(0x12d)],_0xf884ec=_0x5d44ea['activations']['toDelete'];console['error'](_0x22bf78(0x131)+_0x29ea07+'\x27:');_0x49ba7b['length']>0x0&&console[_0x22bf78(0x197)]('\x20\x20'+a31_0x373ca4[_0x22bf78(0x192)](_0x22bf78(0x19e)+_0x49ba7b[_0x22bf78(0x161)]+_0x22bf78(0x183)));if(!_0x517492[_0x22bf78(0x112)]){console[_0x22bf78(0x197)]('\x20\x20📊\x20Segments:'),console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4[_0x22bf78(0x175)]('+\x20'+_0x49e9aa[_0x22bf78(0x161)]+_0x22bf78(0x198))),console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4[_0x22bf78(0x107)]('~\x20'+_0x574c76['length']+_0x22bf78(0x166)));if(_0x7701e5[_0x22bf78(0x161)]>0x0)console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4[_0x22bf78(0x138)]('-\x20'+_0x7701e5[_0x22bf78(0x161)]+_0x22bf78(0x116)));else _0x561d59[_0x22bf78(0x161)]>0x0&&!_0x517492['delete']&&console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4[_0x22bf78(0x104)](_0x561d59[_0x22bf78(0x161)]+_0x22bf78(0x176)));console[_0x22bf78(0x197)]('\x20\x20\x20\x20'+a31_0x373ca4[_0x22bf78(0x104)]('=\x20'+_0x9784da['length']+_0x22bf78(0x190)));}if(_0x68c325[_0x22bf78(0x161)]>0x0||_0x490fb4[_0x22bf78(0x161)]>0x0){console[_0x22bf78(0x197)](_0x22bf78(0x179)),console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4[_0x22bf78(0x175)]('+\x20'+_0x872ff1['length']+'\x20new')),console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4[_0x22bf78(0x107)]('~\x20'+_0x57661a[_0x22bf78(0x161)]+_0x22bf78(0x166)));if(_0x51d55c[_0x22bf78(0x161)]>0x0)console['error'](_0x22bf78(0x15f)+a31_0x373ca4[_0x22bf78(0x138)]('-\x20'+_0x51d55c[_0x22bf78(0x161)]+_0x22bf78(0x116)));else _0x490fb4[_0x22bf78(0x161)]>0x0&&!_0x517492[_0x22bf78(0x163)]&&console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4['dim'](_0x490fb4[_0x22bf78(0x161)]+_0x22bf78(0x176)));console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4['dim']('=\x20'+_0x2ea0c3['length']+_0x22bf78(0x190)));}_0x415d57['length']>0x0&&!_0x517492[_0x22bf78(0x112)]&&(console[_0x22bf78(0x197)](''),console['error'](_0x22bf78(0x11d)),_0x40e9dd[_0x22bf78(0x161)]>0x0&&console[_0x22bf78(0x197)]('\x20\x20\x20\x20'+a31_0x373ca4[_0x22bf78(0x175)]('+\x20'+_0x40e9dd['length']+_0x22bf78(0x164))),_0x588046['length']>0x0&&console[_0x22bf78(0x197)]('\x20\x20\x20\x20'+a31_0x373ca4['yellow']('~\x20'+_0x588046[_0x22bf78(0x161)]+_0x22bf78(0x178))),_0xf884ec[_0x22bf78(0x161)]>0x0&&console[_0x22bf78(0x197)](_0x22bf78(0x15f)+a31_0x373ca4[_0x22bf78(0x138)]('-\x20'+_0xf884ec[_0x22bf78(0x161)]+_0x22bf78(0x116))));console[_0x22bf78(0x197)](_0x22bf78(0x12f)+a31_0x373ca4['cyan'](_0xfcab42)+'\x0a');if(_0x49ba7b['length']>0x0){console[_0x22bf78(0x197)](_0x22bf78(0x11c));for(const _0x41040f of _0x49ba7b){console[_0x22bf78(0x197)]('\x20\x20'+a31_0x373ca4[_0x22bf78(0x192)]('+')+'\x20'+_0x41040f);}console[_0x22bf78(0x197)]('');}if(_0x49e9aa['length']>0x0&&!_0x517492[_0x22bf78(0x112)])for(const _0x5e849c of _0x49e9aa){const _0x110114=_0x5e849c[_0x22bf78(0x10a)]?_0x5e849c[_0x22bf78(0x10a)]+'/'+_0x5e849c[_0x22bf78(0x173)][_0x22bf78(0x16e)]:_0x5e849c['yamlConfig'][_0x22bf78(0x16e)],_0x29205f=_0x5e849c[_0x22bf78(0x173)]['activations']?.[_0x22bf78(0x161)]||0x0,_0x3531ce=_0x29205f>0x0?a31_0x373ca4[_0x22bf78(0x104)]('\x20['+_0x29205f+'\x20activations]'):'';console['error']('\x0a'+a31_0x373ca4[_0x22bf78(0x175)](_0x22bf78(0x199))+'\x20'+_0x110114+_0x3531ce),console[_0x22bf78(0x197)]('─'[_0x22bf78(0x15a)](0x3c)),_0x5e849c[_0x22bf78(0x14f)]&&console['error'](_0x5e849c[_0x22bf78(0x14f)]),console[_0x22bf78(0x197)]('─'[_0x22bf78(0x15a)](0x3c));}if(_0x7701e5[_0x22bf78(0x161)]>0x0&&!_0x517492[_0x22bf78(0x112)])for(const _0x5283c8 of _0x7701e5){const _0x480800=_0x5283c8[_0x22bf78(0x18b)]?_0x26af44['get'](_0x5283c8[_0x22bf78(0x18b)][_0x22bf78(0x19c)]())||'':'',_0x47635d=_0x480800?_0x480800+'/'+_0x5283c8[_0x22bf78(0x16e)]:_0x5283c8[_0x22bf78(0x16e)],_0x1d51ab=_0x31aabf[_0x22bf78(0x13c)](_0x5283c8['id'])||[],_0x109e2d=_0x1d51ab['length']>0x0?a31_0x373ca4[_0x22bf78(0x104)]('\x20['+_0x1d51ab['length']+_0x22bf78(0x155)):'';console['error']('\x0a'+a31_0x373ca4[_0x22bf78(0x138)]('Delete\x20segment:')+'\x20'+_0x47635d+_0x109e2d),console[_0x22bf78(0x197)]('─'[_0x22bf78(0x15a)](0x3c));const _0x49ab65=segmentWithActivationsToYaml(_0x5283c8,_0x1d51ab,undefined,_0x362f17,_0x449143),_0x431d7f=segmentToYamlString(_0x49ab65),_0x1425aa=generateDiff(_0x431d7f,'');console[_0x22bf78(0x197)](formatDiffWithColors(_0x1425aa)),console[_0x22bf78(0x197)]('─'[_0x22bf78(0x15a)](0x3c));}const _0x164eba=_0x420a70[_0x22bf78(0x188)](_0x38674e=>!_0x38674e[_0x22bf78(0x136)]&&_0x38674e['diff']);if(_0x164eba['length']>0x0&&!_0x517492['journeysOnly'])for(const _0x3db53a of _0x164eba){const _0x16eff3=_0x3db53a[_0x22bf78(0x10a)]?_0x3db53a['folderPath']+'/'+_0x3db53a[_0x22bf78(0x173)][_0x22bf78(0x16e)]:_0x3db53a[_0x22bf78(0x173)][_0x22bf78(0x16e)];console[_0x22bf78(0x197)]('\x0a'+a31_0x373ca4[_0x22bf78(0x107)](_0x22bf78(0x180))+'\x20'+_0x16eff3),console[_0x22bf78(0x197)]('─'[_0x22bf78(0x15a)](0x3c)),console[_0x22bf78(0x197)](_0x3db53a[_0x22bf78(0x14f)]),console[_0x22bf78(0x197)]('─'[_0x22bf78(0x15a)](0x3c));}if(_0x872ff1[_0x22bf78(0x161)]>0x0)for(const _0x49205f of _0x872ff1){const _0x9be2e8=_0x49205f[_0x22bf78(0x10a)]?_0x49205f['folderPath']+'/'+_0x49205f[_0x22bf78(0x173)]['name']:_0x49205f[_0x22bf78(0x173)][_0x22bf78(0x16e)];console['error']('\x0a'+a31_0x373ca4['green'](_0x22bf78(0x181))+'\x20'+_0x9be2e8),console[_0x22bf78(0x197)]('─'[_0x22bf78(0x15a)](0x3c)),_0x49205f[_0x22bf78(0x14f)]&&console[_0x22bf78(0x197)](_0x49205f[_0x22bf78(0x14f)]),console[_0x22bf78(0x197)]('─'['repeat'](0x3c));}const _0x202d8d=_0x68c325[_0x22bf78(0x188)](_0x4250ac=>!_0x4250ac[_0x22bf78(0x136)]&&_0x4250ac[_0x22bf78(0x14f)]);if(_0x202d8d[_0x22bf78(0x161)]>0x0)for(const _0x47941a of _0x202d8d){const _0xc4dc53=_0x47941a['folderPath']?_0x47941a[_0x22bf78(0x10a)]+'/'+_0x47941a['yamlConfig']['name']:_0x47941a[_0x22bf78(0x173)][_0x22bf78(0x16e)];console['error']('\x0a'+a31_0x373ca4[_0x22bf78(0x107)](_0x22bf78(0x184))+'\x20'+_0xc4dc53),console[_0x22bf78(0x197)]('─'['repeat'](0x3c)),console[_0x22bf78(0x197)](_0x47941a['diff']),console['error']('─'['repeat'](0x3c));}if(_0x51d55c[_0x22bf78(0x161)]>0x0)for(const _0x1a553f of _0x51d55c){const _0x54ddd4=_0x1a553f[_0x22bf78(0x187)]?_0x26af44[_0x22bf78(0x13c)](_0x1a553f[_0x22bf78(0x187)])||'':'',_0x5b4151=_0x54ddd4?_0x54ddd4+'/'+_0x1a553f[_0x22bf78(0x17a)]:_0x1a553f[_0x22bf78(0x17a)];console[_0x22bf78(0x197)]('\x0a'+a31_0x373ca4[_0x22bf78(0x138)]('Delete\x20journey:')+'\x20'+_0x5b4151),console[_0x22bf78(0x197)]('─'[_0x22bf78(0x15a)](0x3c)),console[_0x22bf78(0x197)](a31_0x373ca4['red'](_0x22bf78(0x143))),console['error']('─'[_0x22bf78(0x15a)](0x3c));}if(_0x517492[_0x22bf78(0x18c)])return console[_0x22bf78(0x197)](a31_0x373ca4['yellow'](_0x22bf78(0x11b))),0x0;const _0x1f91ae=_0x517492[_0x22bf78(0x112)]?![]:_0x49e9aa[_0x22bf78(0x161)]>0x0||_0x574c76[_0x22bf78(0x161)]>0x0||_0x7701e5['length']>0x0,_0x2f81ce=_0x872ff1[_0x22bf78(0x161)]>0x0||_0x57661a[_0x22bf78(0x161)]>0x0||_0x51d55c[_0x22bf78(0x161)]>0x0,_0x6c3fd5=_0x517492[_0x22bf78(0x112)]?![]:_0x415d57['length']>0x0,_0x363b88=_0x49ba7b[_0x22bf78(0x161)]>0x0;if(!_0x1f91ae&&!_0x2f81ce&&!_0x6c3fd5&&!_0x363b88){const _0x81682d=_0x517492[_0x22bf78(0x112)]?_0x22bf78(0x117):_0x22bf78(0x189);console['error'](a31_0x373ca4[_0x22bf78(0x175)](_0x81682d));if(_0x590ed7&&_0x2ea0c3[_0x22bf78(0x161)]===0x1){const _0x1af21e=_0x2ea0c3[0x0];if(_0x1af21e['existingJourney']?.['id']){const _0x5591f4=getConsoleNextUrl(_0x517492[_0x22bf78(0x137)],_0x22bf78(0x124)+_0x1be089+_0x22bf78(0x17b)+_0x1af21e[_0x22bf78(0x11e)]['id']+_0x22bf78(0x120));console[_0x22bf78(0x197)]('\x20\x20'+a31_0x373ca4['cyan'](_0x5591f4));}}return 0x0;}const _0x1ea475=_0x517492[_0x22bf78(0x112)]?_0x872ff1[_0x22bf78(0x161)]+_0x57661a[_0x22bf78(0x161)]+_0x51d55c[_0x22bf78(0x161)]+_0x49ba7b[_0x22bf78(0x161)]:_0x49e9aa[_0x22bf78(0x161)]+_0x574c76['length']+_0x7701e5[_0x22bf78(0x161)]+_0x872ff1[_0x22bf78(0x161)]+_0x57661a[_0x22bf78(0x161)]+_0x51d55c['length']+_0x49ba7b['length']+_0x415d57[_0x22bf78(0x161)];if(!_0x517492[_0x22bf78(0x146)]&&_0x1ea475>0x0){const _0x554a96=await confirmKey(_0x22bf78(0x15d)+_0x1ea475+_0x22bf78(0x195));if(!_0x554a96)return console[_0x22bf78(0x197)](_0x22bf78(0x11f)),0x1;}const _0x4387bb={'withProgress':async(_0x36a84e,_0x447e88)=>{const _0x386e25=_0x22bf78,_0x47b212=await withSpinner(_0x36a84e,_0x447e88,{'verbose':_0x517492[_0x386e25(0x127)]});return{'data':_0x47b212[_0x386e25(0x186)]};},'logInfo':_0x4e3247=>console[_0x22bf78(0x197)](a31_0x373ca4['blue']('✔\x20'+_0x4e3247)),'logSuccess':_0x23397c=>console[_0x22bf78(0x197)](a31_0x373ca4[_0x22bf78(0x175)]('✔\x20'+_0x23397c)),'logWarning':_0x1226f5=>console[_0x22bf78(0x197)](a31_0x373ca4[_0x22bf78(0x107)]('⚠\x20'+_0x1226f5)),'logDeleted':_0x3dabdb=>console['error'](a31_0x373ca4['red']('✔\x20'+_0x3dabdb))},_0x41366f={'segment':_0x280edf['segment'],'journey':_0x280edf[_0x22bf78(0x174)],'user':_0x280edf[_0x22bf78(0x111)],'connection':_0x280edf['connection']};_0x49ba7b[_0x22bf78(0x161)]>0x0&&(_0x3883e6=await executePushFolders(_0x41366f,_0x49ba7b,_0x3883e6,{'parentId':_0x1be089},_0x4387bb));const _0x5e78b1={'rootFolderId':_0x42d128,'folderPathToId':_0x3883e6,'folderIdToPath':_0x26af44,'segmentNameToId':_0x518ed1,'activationsBySegmentId':_0x31aabf,'emailToIdMap':_0x52f814,'idToEmailMap':_0x362f17,'connectionNameToIdMap':_0x89774c[_0x22bf78(0x17e)],'connectionIdToNameMap':_0x89774c[_0x22bf78(0x18e)],'connectionNameToTypeMap':_0xf92b8d},_0x23ee5c=await executePushSegments(_0x41366f,_0x517492[_0x22bf78(0x112)]?[]:_0x420a70,_0x5e78b1,{'parentId':_0x1be089},_0x4387bb),_0x113175=_0x23ee5c[_0x22bf78(0x10b)],_0x334a0e=_0x23ee5c[_0x22bf78(0x142)],_0x2147f4=_0x23ee5c['activations']['created'],_0x2863ed=_0x23ee5c[_0x22bf78(0x130)][_0x22bf78(0x142)],_0x338974=_0x23ee5c[_0x22bf78(0x130)][_0x22bf78(0x18a)],_0x3b51e2=await executePushSegmentDeletions(_0x41366f,_0x517492[_0x22bf78(0x112)]?[]:_0x7701e5,_0x4387bb);let _0x3afaf8=0x0,_0x426a20=0x0,_0x840c21=0x0;const _0x12dbc8=new Map(_0x518ed1);for(const [_0x5e4dc2,_0x75d652]of _0x23ee5c[_0x22bf78(0x150)]){_0x12dbc8[_0x22bf78(0x149)](_0x5e4dc2,_0x75d652);}if(_0x68c325[_0x22bf78(0x161)]>0x0){const _0x5e883c={..._0x5e78b1,'segmentNameToId':_0x12dbc8,'existingSegments':_0x3b22d9,'activationContext':_0x1d194c},_0x407025=await executePushJourneys(_0x41366f,_0x68c325,_0x5e883c,{'parentId':_0x1be089,'rootFolderId':_0x42d128,'verbose':_0x517492['verbose']},_0x4387bb);_0x3afaf8=_0x407025[_0x22bf78(0x10b)],_0x426a20=_0x407025[_0x22bf78(0x142)];if(_0x590ed7&&_0x407025[_0x22bf78(0x105)][_0x22bf78(0x161)]===0x1){const _0x237bd3=_0x407025['results'][0x0];if(_0x237bd3[_0x22bf78(0x10f)]){const _0x5afd2c=getConsoleNextUrl(_0x517492[_0x22bf78(0x137)],'/app/ps/'+_0x1be089+'/e/'+_0x237bd3[_0x22bf78(0x10f)]+_0x22bf78(0x120));console[_0x22bf78(0x197)]('\x20\x20'+a31_0x373ca4[_0x22bf78(0x172)](_0x5afd2c));}}}for(const _0x586af1 of _0x51d55c){console[_0x22bf78(0x197)](a31_0x373ca4[_0x22bf78(0x107)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x586af1[_0x22bf78(0x17a)])),_0x840c21++;}const _0xe6e6d1=[];if(_0x113175>0x0)_0xe6e6d1[_0x22bf78(0x132)](_0x113175+'\x20created');if(_0x334a0e>0x0)_0xe6e6d1[_0x22bf78(0x132)](_0x334a0e+_0x22bf78(0x156));if(_0x3b51e2>0x0)_0xe6e6d1[_0x22bf78(0x132)](_0x3b51e2+_0x22bf78(0x170));const _0x1fea8f=[];if(_0x3afaf8>0x0)_0x1fea8f[_0x22bf78(0x132)](_0x3afaf8+'\x20created');if(_0x426a20>0x0)_0x1fea8f[_0x22bf78(0x132)](_0x426a20+_0x22bf78(0x156));if(_0x840c21>0x0)_0x1fea8f[_0x22bf78(0x132)](_0x840c21+_0x22bf78(0x170));const _0x4a0a4b=[];if(_0x2147f4>0x0)_0x4a0a4b[_0x22bf78(0x132)](_0x2147f4+_0x22bf78(0x110));if(_0x2863ed>0x0)_0x4a0a4b[_0x22bf78(0x132)](_0x2863ed+'\x20updated');if(_0x338974>0x0)_0x4a0a4b[_0x22bf78(0x132)](_0x338974+'\x20deleted');return console['error'](a31_0x373ca4[_0x22bf78(0x175)](_0x22bf78(0x148))),_0xe6e6d1[_0x22bf78(0x161)]>0x0&&!_0x517492[_0x22bf78(0x112)]&&console[_0x22bf78(0x197)](_0x22bf78(0x109)+_0xe6e6d1[_0x22bf78(0x115)](',\x20')),_0x1fea8f[_0x22bf78(0x161)]>0x0&&console[_0x22bf78(0x197)]('\x20\x20Journeys:\x20'+_0x1fea8f['join'](',\x20')),_0x4a0a4b[_0x22bf78(0x161)]>0x0&&!_0x517492['journeysOnly']&&console[_0x22bf78(0x197)](_0x22bf78(0x168)+_0x4a0a4b[_0x22bf78(0x115)](',\x20')),0x0;}}
1
+ const a31_0x413917=a31_0x1442;(function(_0x18f0db,_0x561455){const _0x2b5e3e=a31_0x1442,_0x69bd9=_0x18f0db();while(!![]){try{const _0x372b3a=-parseInt(_0x2b5e3e(0xc3))/0x1*(-parseInt(_0x2b5e3e(0x120))/0x2)+-parseInt(_0x2b5e3e(0x14b))/0x3*(parseInt(_0x2b5e3e(0x103))/0x4)+parseInt(_0x2b5e3e(0x153))/0x5+-parseInt(_0x2b5e3e(0x137))/0x6+-parseInt(_0x2b5e3e(0x158))/0x7*(-parseInt(_0x2b5e3e(0x13f))/0x8)+-parseInt(_0x2b5e3e(0x14a))/0x9+-parseInt(_0x2b5e3e(0xfe))/0xa*(-parseInt(_0x2b5e3e(0x10c))/0xb);if(_0x372b3a===_0x561455)break;else _0x69bd9['push'](_0x69bd9['shift']());}catch(_0xda902d){_0x69bd9['push'](_0x69bd9['shift']());}}}(a31_0x4a06,0x1a7d4));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_0x31414d from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0x1442(_0x265192,_0x1469dd){_0x265192=_0x265192-0xc0;const _0x4a06cd=a31_0x4a06();let _0x14427e=_0x4a06cd[_0x265192];return _0x14427e;}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_0x413917(0x139);[a31_0x413917(0x145)]=a31_0x413917(0xd0);async[a31_0x413917(0x106)](_0x464a09){const _0x428592=a31_0x413917,{options:_0x4a8310,args:_0x202752,tdx:_0x25e126}=_0x464a09,_0x26a46a=_0x4a8310,_0xc1be30=await resolveTarget({'arg':_0x202752[0x0],'contextParent':_0x4a8310[_0x428592(0xe0)],'cwd':process[_0x428592(0x130)]()});if(!isSuccessfulResolution(_0xc1be30))return _0xc1be30['errorCode']===_0x428592(0x147)?(console[_0x428592(0x150)](a31_0x31414d['yellow'](_0x428592(0x11a))),console[_0x428592(0x150)](_0x428592(0xe6)),console['error'](_0x428592(0xcd)),console['error'](_0x428592(0xe3))):(console[_0x428592(0x150)](a31_0x31414d[_0x428592(0xe9)](_0x428592(0x122)+_0xc1be30[_0x428592(0x138)]+'\x0a')),_0xc1be30['helpText']&&console[_0x428592(0x150)](a31_0x31414d[_0x428592(0x11e)](_0xc1be30['helpText']))),0x1;if(_0xc1be30[_0x428592(0x12f)]===_0x428592(0x152))return console[_0x428592(0x150)](a31_0x31414d['red'](_0x428592(0x10a)+_0xc1be30[_0x428592(0xd5)]+'\x0a')),console[_0x428592(0x150)](a31_0x31414d[_0x428592(0x11e)](_0x428592(0xc9))),0x1;const _0x173726=_0xc1be30[_0x428592(0xdc)],_0x5334d5=_0xc1be30['targetDir'],_0x989e24=_0xc1be30[_0x428592(0x12f)]===_0x428592(0x144)?_0xc1be30[_0x428592(0x12c)]:undefined,_0x3b53e8=getScopedDetails(_0xc1be30),_0x591155=_0x3b53e8?.[_0x428592(0xf7)]??![],_0x91bc89=_0x3b53e8?.[_0x428592(0x117)]??'';if(!existsSync(_0x5334d5))return console[_0x428592(0x150)](a31_0x31414d[_0x428592(0xe9)](_0x428592(0x10a)+_0x5334d5+'\x0a')),console['error'](a31_0x31414d[_0x428592(0x11e)](_0x428592(0xc9))),0x1;_0x26a46a[_0x428592(0x11d)]&&(console[_0x428592(0x150)](_0x428592(0xe7)+_0x26a46a[_0x428592(0xe4)]),console[_0x428592(0x150)](_0x428592(0xc8)+_0x173726),console[_0x428592(0x150)]('Source\x20directory:\x20'+_0x5334d5),_0x591155&&console[_0x428592(0x150)]('Scoped\x20to\x20folder:\x20'+_0x91bc89));const _0x2c2ff7=await withSpinner(_0x428592(0x133)+_0x173726+_0x428592(0x14d),()=>_0x25e126[_0x428592(0xcc)][_0x428592(0x142)](_0x173726),{'verbose':_0x26a46a[_0x428592(0x11d)]}),_0x57525e=_0x2c2ff7[_0x428592(0x12e)],[_0x13cc60,_0x2cef23,_0xc539ce,_0x18c36b,_0x5f3fb5]=await Promise[_0x428592(0xd9)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x25e126[_0x428592(0xcc)]['getParent'](_0x57525e),{'verbose':_0x26a46a[_0x428592(0x11d)]}),withSpinner(_0x428592(0x134),()=>_0x25e126[_0x428592(0xcc)]['listSegments'](_0x57525e),{'verbose':_0x26a46a['verbose']}),withSpinner(_0x428592(0x156),()=>_0x25e126['segment']['listFolders'](_0x57525e),{'verbose':_0x26a46a[_0x428592(0x11d)]}),withSpinner(_0x428592(0x115),()=>_0x25e126['journey']['listJourneysWithDetailsFromParentSegment'](_0x57525e,{'includeAllVersions':!![]}),{'verbose':_0x26a46a['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x25e126[_0x428592(0x116)][_0x428592(0x11f)](),{'verbose':_0x26a46a['verbose']})['then'](_0x212517=>_0x212517[_0x428592(0x12e)])]),_0x1e40dd=_0x13cc60[_0x428592(0x12e)],_0x397f27=extractRootFolderId(_0x1e40dd),_0x362fc7=_0x2cef23[_0x428592(0x12e)],_0x3f44d6=_0xc539ce['data'],{journeys:_0x55a523,activationStepsById:_0x24124d}=_0x18c36b[_0x428592(0x12e)],_0x156217=new Map(_0x55a523[_0x428592(0xc6)](_0x9b99dd=>[_0x9b99dd['id'],_0x9b99dd])),_0x58d6f4=_0x55a523[_0x428592(0xc6)](_0x4b6b5f=>({'id':_0x4b6b5f['id'],'name':_0x4b6b5f[_0x428592(0x157)][_0x428592(0xfd)],'journeyBundleName':_0x4b6b5f[_0x428592(0x157)]['journeyBundleName']||'','journeyBundleId':_0x4b6b5f[_0x428592(0x157)][_0x428592(0xdd)]||'','versionNumber':_0x4b6b5f['attributes']['versionNumber'],'description':_0x4b6b5f[_0x428592(0x157)][_0x428592(0x145)],'state':_0x4b6b5f['attributes']['state'],'paused':_0x4b6b5f[_0x428592(0x157)]['paused'],'audienceId':_0x4b6b5f[_0x428592(0x157)][_0x428592(0x12d)],'folderId':_0x4b6b5f[_0x428592(0x10d)]?.[_0x428592(0xd4)]?.[_0x428592(0x12e)]?.['id'],'createdAt':_0x4b6b5f[_0x428592(0x157)]['createdAt'],'updatedAt':_0x4b6b5f[_0x428592(0x157)][_0x428592(0x14e)]})),{emailToId:_0x2f94a5,idToEmail:_0x5d8be6}=_0x5f3fb5,_0x526c79=await withSpinner(_0x428592(0x107),async()=>{const _0x2221da=_0x428592,_0x2a6c33=await _0x25e126['connection'][_0x2221da(0xf4)]();return buildConnectionMaps(_0x2a6c33);},{'verbose':_0x26a46a[_0x428592(0x11d)]})[_0x428592(0x155)](_0x47c526=>_0x47c526['data']),_0x4793fd=_0x526c79[_0x428592(0x149)],_0x14c163=_0x526c79[_0x428592(0x143)],_0x355342=_0x526c79[_0x428592(0xd7)],_0x50635f={'emailToIdMap':_0x2f94a5,'connectionNameToIdMap':_0x4793fd,'connectionNameToTypeMap':_0x355342,'getSchema':_0x238beb=>_0x25e126[_0x428592(0x141)][_0x428592(0xe1)](_0x238beb)};let {pathToId:_0x52395b,idToPath:_0x1417bc}=buildFolderMaps(_0x3f44d6);const _0x53f3ad=buildSegmentLookupMap(_0x362fc7,_0x1417bc),_0x41e1e9=buildSegmentNameToIdMap(_0x362fc7),_0x50e4fe=buildJourneyBundleLookupMap(_0x58d6f4,_0x1417bc);let _0x3078ad;if(_0x989e24){if(!_0x989e24['endsWith']('.yml')&&!_0x989e24['endsWith'](_0x428592(0xf8)))return console['error'](a31_0x31414d[_0x428592(0xe9)](_0x428592(0x12a)+_0x989e24+'\x0a')),0x1;_0x3078ad=[_0x989e24];}else _0x3078ad=findYamlFiles(_0x5334d5);if(_0x3078ad['length']===0x0)return console['error'](a31_0x31414d[_0x428592(0xe9)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5334d5+'\x0a')),console[_0x428592(0x150)](a31_0x31414d['cyan'](_0x428592(0x109))),0x1;let _0x2ddfe8,_0x1642b8;try{const _0x26748f=parseAndClassifyYamlFiles(_0x3078ad,_0x5334d5,{'skipSegments':_0x26a46a[_0x428592(0xee)]});_0x2ddfe8=_0x26748f['segments'],_0x1642b8=_0x26748f['journeys'];const _0x503967=validateParsedFiles(_0x26748f,_0x5334d5);if(_0x503967[_0x428592(0xdb)]>0x0)return console[_0x428592(0x150)](a31_0x31414d['red'](_0x428592(0x14c))),console[_0x428592(0x150)](formatValidationErrors(_0x503967)),console[_0x428592(0x150)](a31_0x31414d[_0x428592(0x121)](_0x428592(0xfc))),0x1;}catch(_0xaf4454){return console['error'](a31_0x31414d[_0x428592(0xe9)](_0x428592(0xe8)+(_0xaf4454 instanceof Error?_0xaf4454['message']:_0xaf4454))),0x1;}if(_0x2ddfe8[_0x428592(0xdb)]===0x0&&_0x1642b8[_0x428592(0xdb)]===0x0){const _0x40e17d=_0x26a46a[_0x428592(0xee)]?_0x428592(0xf0):'segment\x20or\x20journey';return console[_0x428592(0x150)](a31_0x31414d['yellow'](_0x428592(0x110)+_0x40e17d+_0x428592(0x146))),0x0;}const _0x44dc0d=new Map();_0x362fc7['length']>0x0&&!_0x26a46a[_0x428592(0xee)]&&await withSpinner(_0x428592(0xf9),async()=>{await batchAsync(_0x362fc7,async _0x496542=>{const _0x2e85a6=a31_0x1442,_0x3d3577=await _0x25e126[_0x2e85a6(0xcc)][_0x2e85a6(0x123)](_0x57525e,_0x496542['id']);_0x44dc0d[_0x2e85a6(0xf2)](_0x496542['id'],_0x3d3577);});},{'verbose':_0x26a46a['verbose']});const {segmentFiles:_0xd53b77,foldersToCreate:_0x35b370}=await prepareSegmentFiles(_0x2ddfe8,{'segmentByFolderAndName':_0x53f3ad,'activationsBySegmentId':_0x44dc0d,'folderPathToId':_0x52395b,'idToEmailMap':_0x5d8be6,'connectionIdToNameMap':_0x14c163},_0x50635f,_0x591155,_0x91bc89),_0x3cf42f=_0x989e24?[]:findSegmentsToDelete(_0x362fc7,_0x2ddfe8[_0x428592(0xc6)](({yamlConfig:_0x58b95e,folderPath:_0x50ba46})=>({'yamlConfig':_0x58b95e,'folderPath':resolveTDFolderPath(_0x50ba46,_0x591155,_0x91bc89)})),_0x1417bc,_0x91bc89,_0x591155),{journeyFiles:_0x483cd5,foldersToCreate:_0x571d16}=await withProgressSpinner('Preparing\x20journeys...',async _0x263689=>prepareJourneyFiles(_0x1642b8,{'fetchJourney':async _0x46b7ff=>_0x25e126[_0x428592(0xf0)][_0x428592(0xfb)](_0x46b7ff[_0x428592(0xf5)]),'journeyBundlesByFolderAndName':_0x50e4fe,'folderPathToId':_0x52395b,'idToEmailMap':_0x5d8be6,'connectionIdToNameMap':_0x14c163,'existingSegments':_0x362fc7,'parentId':_0x57525e,'deps':_0x25e126,'progress':{'update':_0x3c0fd1=>{const _0x16c7b6=_0x428592;_0x263689[_0x16c7b6(0x112)](_0x3c0fd1),_0x26a46a[_0x16c7b6(0x11d)]&&console[_0x16c7b6(0x150)]('\x20\x20'+_0x3c0fd1);}},'journeyById':_0x156217,'activationStepsById':_0x24124d},_0x591155,_0x91bc89),{'verbose':_0x26a46a[_0x428592(0x11d)]})['then'](_0x4c2eac=>_0x4c2eac[_0x428592(0x12e)]);for(const _0x4bcaec of _0x571d16){_0x35b370[_0x428592(0xe5)](_0x4bcaec);}const _0x3757c2=_0x989e24?[]:findJourneysToDelete(_0x58d6f4,_0x1642b8[_0x428592(0xc6)](({yamlConfig:_0x419c73,folderPath:_0x4b0de7})=>({'yamlConfig':_0x419c73,'folderPath':resolveTDFolderPath(_0x4b0de7,_0x591155,_0x91bc89)})),_0x1417bc,_0x91bc89,_0x591155),_0x1bb1ae=calculatePushStats(_0xd53b77,_0x483cd5,_0x35b370,_0x3cf42f,_0x3757c2,!!_0x26a46a[_0x428592(0x14f)],!!_0x26a46a[_0x428592(0xee)]),_0x1e7249=_0x1bb1ae[_0x428592(0xcf)]['new'],_0x13d9fc=_0x1bb1ae[_0x428592(0xcf)][_0x428592(0x105)],_0x3b91e2=_0x1bb1ae[_0x428592(0xcf)]['unchanged'],_0x48600b=_0x1bb1ae[_0x428592(0xcf)][_0x428592(0x102)],_0x438d15=_0x1bb1ae['folders']['toCreate'],_0x10d1b4=_0x1bb1ae[_0x428592(0xc5)][_0x428592(0xce)],_0x454f78=_0x1bb1ae['journeys']['changed'],_0x4fffa7=_0x1bb1ae['journeys'][_0x428592(0x100)],_0x568319=_0x1bb1ae['journeys'][_0x428592(0x102)],_0x3e8779=_0x1bb1ae[_0x428592(0xc1)]['all'],_0x30e434=_0x1bb1ae[_0x428592(0xc1)][_0x428592(0xd6)],_0x41fcd7=_0x1bb1ae['activations'][_0x428592(0xcb)],_0x5609d8=_0x1bb1ae[_0x428592(0xc1)][_0x428592(0x102)];console[_0x428592(0x150)](_0x428592(0x13e)+_0x173726+'\x27:');_0x438d15[_0x428592(0xdb)]>0x0&&console[_0x428592(0x150)]('\x20\x20'+a31_0x31414d[_0x428592(0x108)](_0x428592(0x131)+_0x438d15[_0x428592(0xdb)]+_0x428592(0x148)));if(!_0x26a46a['journeysOnly']){console[_0x428592(0x150)](_0x428592(0xdf)),console[_0x428592(0x150)](_0x428592(0x10f)+a31_0x31414d[_0x428592(0x136)]('+\x20'+_0x1e7249[_0x428592(0xdb)]+_0x428592(0x113))),console[_0x428592(0x150)](_0x428592(0x10f)+a31_0x31414d['yellow']('~\x20'+_0x13d9fc[_0x428592(0xdb)]+_0x428592(0x125)));if(_0x48600b[_0x428592(0xdb)]>0x0)console[_0x428592(0x150)](_0x428592(0x10f)+a31_0x31414d[_0x428592(0xe9)]('-\x20'+_0x48600b[_0x428592(0xdb)]+_0x428592(0x151)));else _0x3cf42f['length']>0x0&&!_0x26a46a[_0x428592(0x14f)]&&console[_0x428592(0x150)]('\x20\x20\x20\x20'+a31_0x31414d[_0x428592(0xef)](_0x3cf42f[_0x428592(0xdb)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x428592(0x150)](_0x428592(0x10f)+a31_0x31414d[_0x428592(0xef)]('=\x20'+_0x3b91e2[_0x428592(0xdb)]+_0x428592(0x13d)));}if(_0x483cd5[_0x428592(0xdb)]>0x0||_0x3757c2[_0x428592(0xdb)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x428592(0x150)]('\x20\x20\x20\x20'+a31_0x31414d['green']('+\x20'+_0x10d1b4[_0x428592(0xdb)]+_0x428592(0x113))),console[_0x428592(0x150)](_0x428592(0x10f)+a31_0x31414d[_0x428592(0x121)]('~\x20'+_0x454f78[_0x428592(0xdb)]+_0x428592(0x125)));if(_0x568319[_0x428592(0xdb)]>0x0)console['error']('\x20\x20\x20\x20'+a31_0x31414d[_0x428592(0xe9)]('-\x20'+_0x568319[_0x428592(0xdb)]+_0x428592(0x151)));else _0x3757c2[_0x428592(0xdb)]>0x0&&!_0x26a46a[_0x428592(0x14f)]&&console[_0x428592(0x150)](_0x428592(0x10f)+a31_0x31414d[_0x428592(0xef)](_0x3757c2[_0x428592(0xdb)]+_0x428592(0xc7)));console['error']('\x20\x20\x20\x20'+a31_0x31414d[_0x428592(0xef)]('=\x20'+_0x4fffa7[_0x428592(0xdb)]+'\x20unchanged'));}_0x3e8779[_0x428592(0xdb)]>0x0&&!_0x26a46a[_0x428592(0xee)]&&(console[_0x428592(0x150)](''),console[_0x428592(0x150)](_0x428592(0xec)),_0x30e434[_0x428592(0xdb)]>0x0&&console[_0x428592(0x150)](_0x428592(0x10f)+a31_0x31414d[_0x428592(0x136)]('+\x20'+_0x30e434['length']+_0x428592(0x127))),_0x41fcd7[_0x428592(0xdb)]>0x0&&console[_0x428592(0x150)]('\x20\x20\x20\x20'+a31_0x31414d['yellow']('~\x20'+_0x41fcd7['length']+_0x428592(0xeb))),_0x5609d8[_0x428592(0xdb)]>0x0&&console[_0x428592(0x150)](_0x428592(0x10f)+a31_0x31414d['red']('-\x20'+_0x5609d8[_0x428592(0xdb)]+_0x428592(0x151))));console['error']('\x20\x20Source:\x20'+a31_0x31414d[_0x428592(0x11e)](_0x5334d5)+'\x0a');if(_0x438d15[_0x428592(0xdb)]>0x0){console[_0x428592(0x150)](_0x428592(0x135));for(const _0x21f4f5 of _0x438d15){console[_0x428592(0x150)]('\x20\x20'+a31_0x31414d['blue']('+')+'\x20'+_0x21f4f5);}console[_0x428592(0x150)]('');}if(_0x1e7249[_0x428592(0xdb)]>0x0&&!_0x26a46a[_0x428592(0xee)])for(const _0x3e2296 of _0x1e7249){const _0x51f856=_0x3e2296[_0x428592(0x10e)]?_0x3e2296[_0x428592(0x10e)]+'/'+_0x3e2296['yamlConfig']['name']:_0x3e2296['yamlConfig'][_0x428592(0xfd)],_0x559e13=_0x3e2296[_0x428592(0xf1)]['activations']?.[_0x428592(0xdb)]||0x0,_0x48e212=_0x559e13>0x0?a31_0x31414d[_0x428592(0xef)]('\x20['+_0x559e13+_0x428592(0x111)):'';console[_0x428592(0x150)]('\x0a'+a31_0x31414d[_0x428592(0x136)](_0x428592(0x128))+'\x20'+_0x51f856+_0x48e212),console[_0x428592(0x150)]('─'['repeat'](0x3c)),_0x3e2296['diff']&&console[_0x428592(0x150)](_0x3e2296[_0x428592(0xed)]),console[_0x428592(0x150)]('─'[_0x428592(0xea)](0x3c));}if(_0x48600b['length']>0x0&&!_0x26a46a[_0x428592(0xee)])for(const _0x32e2f0 of _0x48600b){const _0x19aa61=_0x32e2f0[_0x428592(0xff)]?_0x1417bc[_0x428592(0x140)](_0x32e2f0[_0x428592(0xff)][_0x428592(0xfa)]())||'':'',_0x2dedab=_0x19aa61?_0x19aa61+'/'+_0x32e2f0[_0x428592(0xfd)]:_0x32e2f0['name'],_0x4afe06=_0x44dc0d[_0x428592(0x140)](_0x32e2f0['id'])||[],_0x4b4b6f=_0x4afe06[_0x428592(0xdb)]>0x0?a31_0x31414d[_0x428592(0xef)]('\x20['+_0x4afe06[_0x428592(0xdb)]+_0x428592(0x111)):'';console[_0x428592(0x150)]('\x0a'+a31_0x31414d[_0x428592(0xe9)]('Delete\x20segment:')+'\x20'+_0x2dedab+_0x4b4b6f),console[_0x428592(0x150)]('─'[_0x428592(0xea)](0x3c));const _0x2cd622=segmentWithActivationsToYaml(_0x32e2f0,_0x4afe06,undefined,_0x5d8be6,_0x14c163),_0x297eb2=segmentToYamlString(_0x2cd622),_0x18e8a0=generateDiff(_0x297eb2,'');console[_0x428592(0x150)](formatDiffWithColors(_0x18e8a0)),console[_0x428592(0x150)]('─'[_0x428592(0xea)](0x3c));}const _0x50c42a=_0xd53b77[_0x428592(0x124)](_0x4a71c9=>!_0x4a71c9[_0x428592(0x13a)]&&_0x4a71c9[_0x428592(0xed)]);if(_0x50c42a[_0x428592(0xdb)]>0x0&&!_0x26a46a[_0x428592(0xee)])for(const _0x353735 of _0x50c42a){const _0x3199c4=_0x353735[_0x428592(0x10e)]?_0x353735['folderPath']+'/'+_0x353735[_0x428592(0xf1)][_0x428592(0xfd)]:_0x353735['yamlConfig'][_0x428592(0xfd)];console[_0x428592(0x150)]('\x0a'+a31_0x31414d[_0x428592(0x121)](_0x428592(0x12b))+'\x20'+_0x3199c4),console['error']('─'[_0x428592(0xea)](0x3c)),console[_0x428592(0x150)](_0x353735[_0x428592(0xed)]),console['error']('─'[_0x428592(0xea)](0x3c));}if(_0x10d1b4['length']>0x0)for(const _0x5043cd of _0x10d1b4){const _0x19358b=_0x5043cd[_0x428592(0x10e)]?_0x5043cd[_0x428592(0x10e)]+'/'+_0x5043cd[_0x428592(0xf1)]['name']:_0x5043cd[_0x428592(0xf1)][_0x428592(0xfd)];console['error']('\x0a'+a31_0x31414d[_0x428592(0x136)](_0x428592(0xe2))+'\x20'+_0x19358b),console['error']('─'[_0x428592(0xea)](0x3c)),_0x5043cd[_0x428592(0xed)]&&console[_0x428592(0x150)](_0x5043cd[_0x428592(0xed)]),console['error']('─'[_0x428592(0xea)](0x3c));}const _0x48af22=_0x483cd5[_0x428592(0x124)](_0x2e0da1=>!_0x2e0da1[_0x428592(0x13a)]&&_0x2e0da1['diff']);if(_0x48af22['length']>0x0)for(const _0x25ac85 of _0x48af22){const _0x54afa1=_0x25ac85[_0x428592(0x10e)]?_0x25ac85[_0x428592(0x10e)]+'/'+_0x25ac85[_0x428592(0xf1)][_0x428592(0xfd)]:_0x25ac85[_0x428592(0xf1)][_0x428592(0xfd)];console[_0x428592(0x150)]('\x0a'+a31_0x31414d[_0x428592(0x121)]('Changes\x20to\x20journey:')+'\x20'+_0x54afa1),console[_0x428592(0x150)]('─'[_0x428592(0xea)](0x3c)),console[_0x428592(0x150)](_0x25ac85['diff']),console[_0x428592(0x150)]('─'[_0x428592(0xea)](0x3c));}if(_0x568319['length']>0x0)for(const _0x4182ad of _0x568319){const _0x843d6d=_0x4182ad[_0x428592(0x104)]?_0x1417bc[_0x428592(0x140)](_0x4182ad[_0x428592(0x104)])||'':'',_0x5ed170=_0x843d6d?_0x843d6d+'/'+_0x4182ad['journeyBundleName']:_0x4182ad['journeyBundleName'];console[_0x428592(0x150)]('\x0a'+a31_0x31414d['red'](_0x428592(0x11b))+'\x20'+_0x5ed170),console[_0x428592(0x150)]('─'[_0x428592(0xea)](0x3c)),console[_0x428592(0x150)](a31_0x31414d[_0x428592(0xe9)]('(Journey\x20will\x20be\x20deleted)')),console[_0x428592(0x150)]('─'[_0x428592(0xea)](0x3c));}if(_0x26a46a['dryRun'])return console[_0x428592(0x150)](a31_0x31414d[_0x428592(0x121)](_0x428592(0x13b))),0x0;const _0x17f606=_0x26a46a[_0x428592(0xee)]?![]:_0x1e7249[_0x428592(0xdb)]>0x0||_0x13d9fc[_0x428592(0xdb)]>0x0||_0x48600b[_0x428592(0xdb)]>0x0,_0x1f3946=_0x10d1b4[_0x428592(0xdb)]>0x0||_0x454f78[_0x428592(0xdb)]>0x0||_0x568319['length']>0x0,_0x11a689=_0x26a46a[_0x428592(0xee)]?![]:_0x3e8779['length']>0x0,_0x366000=_0x438d15[_0x428592(0xdb)]>0x0;if(!_0x17f606&&!_0x1f3946&&!_0x11a689&&!_0x366000){const _0x2da53d=_0x26a46a[_0x428592(0xee)]?_0x428592(0xda):_0x428592(0x11c);console[_0x428592(0x150)](a31_0x31414d[_0x428592(0x136)](_0x2da53d));if(_0x989e24&&_0x4fffa7[_0x428592(0xdb)]===0x1){const _0x2fb22=_0x4fffa7[0x0];if(_0x2fb22['existingJourney']?.['id']){const _0x4f26cc=getConsoleNextUrl(_0x26a46a[_0x428592(0xe4)],_0x428592(0xf3)+_0x57525e+_0x428592(0xd2)+_0x2fb22[_0x428592(0x154)]['id']+_0x428592(0x101));console[_0x428592(0x150)]('\x20\x20'+a31_0x31414d[_0x428592(0x11e)](_0x4f26cc));}}return 0x0;}const _0x24b96b=_0x26a46a[_0x428592(0xee)]?_0x10d1b4[_0x428592(0xdb)]+_0x454f78[_0x428592(0xdb)]+_0x568319[_0x428592(0xdb)]+_0x438d15['length']:_0x1e7249[_0x428592(0xdb)]+_0x13d9fc[_0x428592(0xdb)]+_0x48600b['length']+_0x10d1b4[_0x428592(0xdb)]+_0x454f78[_0x428592(0xdb)]+_0x568319[_0x428592(0xdb)]+_0x438d15[_0x428592(0xdb)]+_0x3e8779['length'];if(!_0x26a46a[_0x428592(0x13c)]&&_0x24b96b>0x0){const _0x37e4a1=await confirmKey(_0x428592(0xc4)+_0x24b96b+_0x428592(0xf6));if(!_0x37e4a1)return console[_0x428592(0x150)](_0x428592(0x129)),0x1;}const _0x52eed0={'withProgress':async(_0x5ef083,_0x3d65ff)=>{const _0x203d7c=_0x428592,_0x191863=await withSpinner(_0x5ef083,_0x3d65ff,{'verbose':_0x26a46a[_0x203d7c(0x11d)]});return{'data':_0x191863['data']};},'logInfo':_0x3079ef=>console[_0x428592(0x150)](a31_0x31414d[_0x428592(0x108)]('✔\x20'+_0x3079ef)),'logSuccess':_0x2a71b3=>console['error'](a31_0x31414d[_0x428592(0x136)]('✔\x20'+_0x2a71b3)),'logWarning':_0x856684=>console[_0x428592(0x150)](a31_0x31414d['yellow']('⚠\x20'+_0x856684)),'logDeleted':_0x534434=>console[_0x428592(0x150)](a31_0x31414d[_0x428592(0xe9)]('✔\x20'+_0x534434))},_0x2d4701={'segment':_0x25e126[_0x428592(0xcc)],'journey':_0x25e126[_0x428592(0xf0)],'user':_0x25e126['user'],'connection':_0x25e126[_0x428592(0x141)]};_0x438d15[_0x428592(0xdb)]>0x0&&(_0x52395b=await executePushFolders(_0x2d4701,_0x438d15,_0x52395b,{'parentId':_0x57525e},_0x52eed0));const _0x11de9c={'rootFolderId':_0x397f27,'folderPathToId':_0x52395b,'folderIdToPath':_0x1417bc,'segmentNameToId':_0x41e1e9,'activationsBySegmentId':_0x44dc0d,'emailToIdMap':_0x2f94a5,'idToEmailMap':_0x5d8be6,'connectionNameToIdMap':_0x526c79[_0x428592(0x149)],'connectionIdToNameMap':_0x526c79[_0x428592(0x143)],'connectionNameToTypeMap':_0x355342},_0x32002e=await executePushSegments(_0x2d4701,_0x26a46a[_0x428592(0xee)]?[]:_0xd53b77,_0x11de9c,{'parentId':_0x57525e},_0x52eed0),_0xc67b87=_0x32002e[_0x428592(0x118)],_0x597db5=_0x32002e[_0x428592(0xde)],_0x3e24a2=_0x32002e[_0x428592(0xc1)][_0x428592(0x118)],_0xc65365=_0x32002e[_0x428592(0xc1)][_0x428592(0xde)],_0x8a39b0=_0x32002e['activations'][_0x428592(0xd1)],_0x3e770e=await executePushSegmentDeletions(_0x2d4701,_0x26a46a[_0x428592(0xee)]?[]:_0x48600b,_0x52eed0);let _0x1fc32a=0x0,_0x4da53d=0x0,_0x2f0bf2=0x0;const _0x19ea49=new Map(_0x41e1e9);for(const [_0x3d5f15,_0x2c947a]of _0x32002e['createdSegmentIds']){_0x19ea49[_0x428592(0xf2)](_0x3d5f15,_0x2c947a);}if(_0x483cd5[_0x428592(0xdb)]>0x0){const _0x51c725={..._0x11de9c,'segmentNameToId':_0x19ea49,'existingSegments':_0x362fc7,'activationContext':_0x50635f},_0x24b67a=await executePushJourneys(_0x2d4701,_0x483cd5,_0x51c725,{'parentId':_0x57525e,'rootFolderId':_0x397f27,'verbose':_0x26a46a['verbose']},_0x52eed0);_0x1fc32a=_0x24b67a['created'],_0x4da53d=_0x24b67a[_0x428592(0xde)];if(_0x989e24&&_0x24b67a['results']['length']===0x1){const _0x2e834b=_0x24b67a[_0x428592(0x126)][0x0];if(_0x2e834b[_0x428592(0xf5)]){const _0x517e61=getConsoleNextUrl(_0x26a46a['site'],_0x428592(0xf3)+_0x57525e+'/e/'+_0x2e834b[_0x428592(0xf5)]+'/j/da/je');console['error']('\x20\x20'+a31_0x31414d['cyan'](_0x517e61));}}}for(const _0x3d5484 of _0x568319){console[_0x428592(0x150)](a31_0x31414d[_0x428592(0x121)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3d5484[_0x428592(0xca)])),_0x2f0bf2++;}const _0x56c2b7=[];if(_0xc67b87>0x0)_0x56c2b7[_0x428592(0xc2)](_0xc67b87+_0x428592(0xd8));if(_0x597db5>0x0)_0x56c2b7[_0x428592(0xc2)](_0x597db5+_0x428592(0x132));if(_0x3e770e>0x0)_0x56c2b7[_0x428592(0xc2)](_0x3e770e+_0x428592(0x119));const _0x36ab90=[];if(_0x1fc32a>0x0)_0x36ab90[_0x428592(0xc2)](_0x1fc32a+_0x428592(0xd8));if(_0x4da53d>0x0)_0x36ab90[_0x428592(0xc2)](_0x4da53d+_0x428592(0x132));if(_0x2f0bf2>0x0)_0x36ab90[_0x428592(0xc2)](_0x2f0bf2+'\x20deleted');const _0x8f9e8e=[];if(_0x3e24a2>0x0)_0x8f9e8e[_0x428592(0xc2)](_0x3e24a2+_0x428592(0xd8));if(_0xc65365>0x0)_0x8f9e8e[_0x428592(0xc2)](_0xc65365+'\x20updated');if(_0x8a39b0>0x0)_0x8f9e8e[_0x428592(0xc2)](_0x8a39b0+_0x428592(0x119));return console['error'](a31_0x31414d['green'](_0x428592(0xd3))),_0x56c2b7[_0x428592(0xdb)]>0x0&&!_0x26a46a[_0x428592(0xee)]&&console[_0x428592(0x150)](_0x428592(0x10b)+_0x56c2b7[_0x428592(0xc0)](',\x20')),_0x36ab90[_0x428592(0xdb)]>0x0&&console[_0x428592(0x150)]('\x20\x20Journeys:\x20'+_0x36ab90[_0x428592(0xc0)](',\x20')),_0x8f9e8e[_0x428592(0xdb)]>0x0&&!_0x26a46a['journeysOnly']&&console[_0x428592(0x150)](_0x428592(0x114)+_0x8f9e8e['join'](',\x20')),0x0;}}function a31_0x4a06(){const _0xc52b4=['join','activations','push','9523vrlppI','Push\x20','journeys','map','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Parent\x20segment:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journeyBundleName','toUpdate','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','new','segments','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','deleted','/e/','\x0a✔\x20Push\x20complete','parentFolder','targetDir','toCreate','nameToType','\x20created','all','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','length','parentName','journeyBundleId','updated','\x20\x20📊\x20Segments:','parentSegment','getOutputSchemaWithCache','New\x20journey:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','site','add','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)','Site:\x20','Error\x20parsing\x20YAML:\x20','red','repeat','\x20to\x20update','\x20\x20Activations:','diff','journeysOnly','dim','journey','yamlConfig','set','/app/ps/','list','journeyId','\x20changes?','isScoped','.yaml','Fetching\x20existing\x20activations...','toString','getJourney','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','name','70oVHNhf','segmentFolderId','unchanged','/j/da/je','toDelete','47636yqEqQz','folderId','changed','execute','Fetching\x20connections\x20for\x20name\x20resolution...','blue','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Segments:\x20','83963NRDrzy','relationships','folderPath','\x20\x20\x20\x20','No\x20','\x20activations]','setPhase','\x20new','\x20\x20Activations:\x20','Fetching\x20existing\x20journeys...','user','scopedFolderPath','created','\x20deleted','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Delete\x20journey:','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','verbose','cyan','buildUserMaps','16mmoaXv','yellow','Error:\x20','listActivations','filter','\x20changed','results','\x20to\x20create','New\x20segment:','Aborted.','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Changes\x20to:','filePath','audienceId','data','type','cwd','📁\x20','\x20updated','Resolving\x20parent\x20segment\x20\x27','Fetching\x20existing\x20segments...','Folders\x20to\x20create:','green','735996sKvjvt','message','segment:push','isNew','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','yes','\x20unchanged','\x0aPush\x20summary\x20for\x20\x27','768GnLOYP','get','connection','resolveParentId','idToName','file','description','\x20YAML\x20files\x20found','no_parent','\x20folders\x20to\x20create','nameToId','590301zSEnlt','3DblDyp','\x0aValidation\x20failed:','\x27...','updatedAt','delete','error','\x20to\x20delete','parent_name','835245iuhOik','existingJourney','then','Fetching\x20existing\x20folders...','attributes','875jMeiwo'];a31_0x4a06=function(){return _0xc52b4;};return a31_0x4a06();}
@@ -1 +1 @@
1
- const a32_0x414d1b=a32_0x3a42;(function(_0x1554a8,_0x3bb2b5){const _0x53abb2=a32_0x3a42,_0x36fcee=_0x1554a8();while(!![]){try{const _0x4f8226=-parseInt(_0x53abb2(0xdb))/0x1+parseInt(_0x53abb2(0xfa))/0x2*(-parseInt(_0x53abb2(0xed))/0x3)+-parseInt(_0x53abb2(0xf4))/0x4+parseInt(_0x53abb2(0xd7))/0x5*(-parseInt(_0x53abb2(0xf9))/0x6)+parseInt(_0x53abb2(0xf3))/0x7*(parseInt(_0x53abb2(0x105))/0x8)+parseInt(_0x53abb2(0x102))/0x9+parseInt(_0x53abb2(0xe6))/0xa*(parseInt(_0x53abb2(0xe0))/0xb);if(_0x4f8226===_0x3bb2b5)break;else _0x36fcee['push'](_0x36fcee['shift']());}catch(_0x2e199d){_0x36fcee['push'](_0x36fcee['shift']());}}}(a32_0xc98a,0x73ba0));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{SDKError,ErrorCode}from'../sdk/index.js';function a32_0xc98a(){const _0x4462ab=['Parent\x20ID:\x20','11987767TKmIPC','✔\x20Updated\x20segment\x20\x27','description','includes','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','20aovMni','segmentPath','Updating\x20segment\x20\x27','yellow','Segment\x20ID:\x20','segmentName','length','2833014FOATjs','Resolving\x20folder\x20\x27','segment','Resolving\x20path\x20\x27','Update\x20existing\x20child\x20segment','resolvePathToResource','314363tXNudP','1380636sOTRvx','updateSegmentById','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','INTERNAL','Examples:','4102602juddYo','2UAoKae','segmentId','error','Resolved\x20relative\x20path\x20to:\x20','rule','ruleFile','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','1523304libkbg','\x27...','segment:update','104HhrFWh','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','resolveFolderId','name','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folder','Error:\x20Cannot\x20update\x20','verbose','5PiZzuM','\x20\x20\x20Path:\x20','data','type','485387DlLtbK','execute','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','kind'];a32_0xc98a=function(){return _0x4462ab;};return a32_0xc98a();}import a32_0x328d74 from'chalk';function a32_0x3a42(_0x36b188,_0x381088){_0x36b188=_0x36b188-0xd2;const _0xc98a9=a32_0xc98a();let _0x3a429e=_0xc98a9[_0x36b188];return _0x3a429e;}export class SegmentUpdateCommand extends BaseCommand{[a32_0x414d1b(0xd2)]=a32_0x414d1b(0x104);[a32_0x414d1b(0xe2)]=a32_0x414d1b(0xf1);async[a32_0x414d1b(0xdc)](_0x123848){const _0x4afd8e=a32_0x414d1b;console[_0x4afd8e(0xfc)](a32_0x328d74['yellow'](_0x4afd8e(0xdd))),console[_0x4afd8e(0xfc)](a32_0x328d74[_0x4afd8e(0xe9)](_0x4afd8e(0xf6)));const {options:_0x49a3b3,args:_0x1e9b9d,tdx:_0x1e53a1}=_0x123848,_0x14af9e=_0x49a3b3;if(_0x1e9b9d[_0x4afd8e(0xec)]===0x0)return console[_0x4afd8e(0xfc)](_0x4afd8e(0x100)),console[_0x4afd8e(0xfc)](_0x4afd8e(0x101)),console['error'](_0x4afd8e(0xf8)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x4afd8e(0xfc)](_0x4afd8e(0xe5)),0x1;const _0x2d86a0=_0x1e9b9d[0x0],_0x571460=_0x49a3b3[_0x4afd8e(0xe7)];let _0x2e1f54=_0x2d86a0;_0x571460&&!_0x2d86a0[_0x4afd8e(0xe3)]('/')&&(_0x2e1f54=_0x571460+'/'+_0x2d86a0,_0x14af9e[_0x4afd8e(0xd6)]&&console['error'](_0x4afd8e(0xfd)+_0x2e1f54));const _0x95c256=await withSpinner(_0x4afd8e(0xf0)+_0x2e1f54+_0x4afd8e(0x103),()=>_0x1e53a1[_0x4afd8e(0xef)][_0x4afd8e(0xf2)](_0x2e1f54),{'verbose':_0x14af9e[_0x4afd8e(0xd6)]}),_0x3599e1=_0x95c256[_0x4afd8e(0xd9)];_0x14af9e['verbose']&&console[_0x4afd8e(0xfc)]('Resolved\x20type:\x20'+_0x3599e1['type']);if(_0x3599e1[_0x4afd8e(0xda)]!==_0x4afd8e(0xef))return console[_0x4afd8e(0xfc)](_0x4afd8e(0xd5)+_0x3599e1['type']+_0x4afd8e(0x106)),console[_0x4afd8e(0xfc)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3599e1[_0x4afd8e(0xfb)])throw new SDKError(ErrorCode[_0x4afd8e(0xf7)],_0x4afd8e(0xd3));const _0x5d98d4=_0x3599e1['parentId'],_0x7b47aa=_0x3599e1[_0x4afd8e(0xfb)];_0x14af9e[_0x4afd8e(0xd6)]&&(console[_0x4afd8e(0xfc)](_0x4afd8e(0xdf)+_0x5d98d4),console[_0x4afd8e(0xfc)](_0x4afd8e(0xea)+_0x7b47aa));let _0x4d48af;if(_0x14af9e['folder']){const _0x5d6cf2=_0x14af9e[_0x4afd8e(0xd4)],_0x461457=await withSpinner(_0x4afd8e(0xee)+_0x5d6cf2+_0x4afd8e(0x103),()=>_0x1e53a1[_0x4afd8e(0xef)][_0x4afd8e(0x107)](_0x5d98d4,_0x5d6cf2),{'verbose':_0x14af9e[_0x4afd8e(0xd6)]});_0x4d48af=parseInt(_0x461457[_0x4afd8e(0xd9)],0xa),_0x14af9e['verbose']&&console[_0x4afd8e(0xfc)](_0x4afd8e(0xe4)+_0x4d48af);}const _0x191d2e=await loadJSONFromOptions(_0x14af9e[_0x4afd8e(0xfe)],_0x14af9e[_0x4afd8e(0xff)]),_0x423f2d={'name':_0x14af9e['name'],'description':_0x14af9e[_0x4afd8e(0xe2)],'rule':_0x191d2e,'kind':_0x14af9e[_0x4afd8e(0xde)]!==undefined?parseInt(_0x14af9e[_0x4afd8e(0xde)],0xa):undefined,'segmentFolderId':_0x4d48af},_0x5bd9f0=await withSpinner(_0x4afd8e(0xe8)+_0x3599e1[_0x4afd8e(0xeb)]+_0x4afd8e(0x103),()=>_0x1e53a1[_0x4afd8e(0xef)][_0x4afd8e(0xf5)](_0x5d98d4,_0x7b47aa,_0x423f2d),{'verbose':_0x14af9e[_0x4afd8e(0xd6)]}),_0x5c97a9=_0x5bd9f0['data'];return console[_0x4afd8e(0xfc)](_0x4afd8e(0xe1)+_0x5c97a9[_0x4afd8e(0xd2)]+'\x27'),_0x2e1f54!==_0x2d86a0&&console[_0x4afd8e(0xfc)](_0x4afd8e(0xd8)+_0x2e1f54),await handleSDKOutput([_0x5c97a9],_0x14af9e),0x0;}}
1
+ const a32_0x509143=a32_0x36bf;function a32_0x455e(){const _0x1536db=['7294315zrJASc','data','ruleFile','segment:update','yellow','segmentName','2336694euaYXR','kind','name','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','INTERNAL','segment','includes','resolvePathToResource','1784090awfMBo','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','resolveFolderId','verbose','1302259hLpKBC','\x27...','\x20\x20\x20Path:\x20','error','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','8IIaRyz','rule','type','2786526kTtyKK','2097OQfEZY','Resolved\x20folder\x20ID:\x20','25190StlUtn','5598kcNSsS','length','parentId','Resolved\x20type:\x20','Update\x20existing\x20child\x20segment','Updating\x20segment\x20\x27','segmentPath','updateSegmentById','folder','Parent\x20ID:\x20','description','Segment\x20ID\x20missing\x20from\x20resolved\x20path','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Segment\x20ID:\x20','✔\x20Updated\x20segment\x20\x27','Examples:','Resolving\x20path\x20\x27','segmentId','1924KqLBbU'];a32_0x455e=function(){return _0x1536db;};return a32_0x455e();}function a32_0x36bf(_0x1b1062,_0x17761e){_0x1b1062=_0x1b1062-0x141;const _0x455e55=a32_0x455e();let _0x36bf12=_0x455e55[_0x1b1062];return _0x36bf12;}(function(_0x296e2f,_0x49f2af){const _0x1308b6=a32_0x36bf,_0x18d362=_0x296e2f();while(!![]){try{const _0x1d209c=parseInt(_0x1308b6(0x14d))/0x1+-parseInt(_0x1308b6(0x141))/0x2+-parseInt(_0x1308b6(0x156))/0x3*(-parseInt(_0x1308b6(0x16c))/0x4)+parseInt(_0x1308b6(0x149))/0x5+-parseInt(_0x1308b6(0x155))/0x6+-parseInt(_0x1308b6(0x16d))/0x7*(parseInt(_0x1308b6(0x152))/0x8)+-parseInt(_0x1308b6(0x159))/0x9*(-parseInt(_0x1308b6(0x158))/0xa);if(_0x1d209c===_0x49f2af)break;else _0x18d362['push'](_0x18d362['shift']());}catch(_0xc22408){_0x18d362['push'](_0x18d362['shift']());}}}(a32_0x455e,0xd8a05));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{SDKError,ErrorCode}from'../sdk/index.js';import a32_0x48b158 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a32_0x509143(0x143)]=a32_0x509143(0x170);[a32_0x509143(0x163)]=a32_0x509143(0x15d);async['execute'](_0x16a3be){const _0x1597cb=a32_0x509143;console[_0x1597cb(0x150)](a32_0x48b158[_0x1597cb(0x171)](_0x1597cb(0x165))),console['error'](a32_0x48b158[_0x1597cb(0x171)](_0x1597cb(0x151)));const {options:_0x2d5279,args:_0x44be8d,tdx:_0x43b258}=_0x16a3be,_0x227d7d=_0x2d5279;if(_0x44be8d[_0x1597cb(0x15a)]===0x0)return console[_0x1597cb(0x150)](_0x1597cb(0x166)),console[_0x1597cb(0x150)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x1597cb(0x150)](_0x1597cb(0x169)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0x1597cb(0x144)),0x1;const _0x416bb6=_0x44be8d[0x0],_0x5deea3=_0x2d5279[_0x1597cb(0x15f)];let _0x2e5ebb=_0x416bb6;_0x5deea3&&!_0x416bb6[_0x1597cb(0x147)]('/')&&(_0x2e5ebb=_0x5deea3+'/'+_0x416bb6,_0x227d7d[_0x1597cb(0x14c)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x2e5ebb));const _0x49c0e3=await withSpinner(_0x1597cb(0x16a)+_0x2e5ebb+_0x1597cb(0x14e),()=>_0x43b258[_0x1597cb(0x146)][_0x1597cb(0x148)](_0x2e5ebb),{'verbose':_0x227d7d[_0x1597cb(0x14c)]}),_0x38c352=_0x49c0e3[_0x1597cb(0x16e)];_0x227d7d[_0x1597cb(0x14c)]&&console[_0x1597cb(0x150)](_0x1597cb(0x15c)+_0x38c352[_0x1597cb(0x154)]);if(_0x38c352[_0x1597cb(0x154)]!==_0x1597cb(0x146))return console[_0x1597cb(0x150)]('Error:\x20Cannot\x20update\x20'+_0x38c352[_0x1597cb(0x154)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x1597cb(0x150)](_0x1597cb(0x14a)),0x1;if(!_0x38c352['segmentId'])throw new SDKError(ErrorCode[_0x1597cb(0x145)],_0x1597cb(0x164));const _0x38679d=_0x38c352[_0x1597cb(0x15b)],_0x32271f=_0x38c352[_0x1597cb(0x16b)];_0x227d7d[_0x1597cb(0x14c)]&&(console[_0x1597cb(0x150)](_0x1597cb(0x162)+_0x38679d),console[_0x1597cb(0x150)](_0x1597cb(0x167)+_0x32271f));let _0x4d75ec;if(_0x227d7d['folder']){const _0x4bf083=_0x227d7d[_0x1597cb(0x161)],_0x59667a=await withSpinner('Resolving\x20folder\x20\x27'+_0x4bf083+_0x1597cb(0x14e),()=>_0x43b258[_0x1597cb(0x146)][_0x1597cb(0x14b)](_0x38679d,_0x4bf083),{'verbose':_0x227d7d[_0x1597cb(0x14c)]});_0x4d75ec=parseInt(_0x59667a[_0x1597cb(0x16e)],0xa),_0x227d7d[_0x1597cb(0x14c)]&&console[_0x1597cb(0x150)](_0x1597cb(0x157)+_0x4d75ec);}const _0x1acce5=await loadJSONFromOptions(_0x227d7d[_0x1597cb(0x153)],_0x227d7d[_0x1597cb(0x16f)]),_0xc6595c={'name':_0x227d7d['name'],'description':_0x227d7d['description'],'rule':_0x1acce5,'kind':_0x227d7d[_0x1597cb(0x142)]!==undefined?parseInt(_0x227d7d[_0x1597cb(0x142)],0xa):undefined,'segmentFolderId':_0x4d75ec},_0x582367=await withSpinner(_0x1597cb(0x15e)+_0x38c352[_0x1597cb(0x172)]+_0x1597cb(0x14e),()=>_0x43b258['segment'][_0x1597cb(0x160)](_0x38679d,_0x32271f,_0xc6595c),{'verbose':_0x227d7d[_0x1597cb(0x14c)]}),_0x3ff1e1=_0x582367[_0x1597cb(0x16e)];return console['error'](_0x1597cb(0x168)+_0x3ff1e1['name']+'\x27'),_0x2e5ebb!==_0x416bb6&&console[_0x1597cb(0x150)](_0x1597cb(0x14f)+_0x2e5ebb),await handleSDKOutput([_0x3ff1e1],_0x227d7d),0x0;}}
@@ -1 +1 @@
1
- const a33_0x285627=a33_0x486f;(function(_0x372280,_0x441ef5){const _0x18c4ff=a33_0x486f,_0x5d7e77=_0x372280();while(!![]){try{const _0x30cba2=-parseInt(_0x18c4ff(0xc2))/0x1*(-parseInt(_0x18c4ff(0xa6))/0x2)+parseInt(_0x18c4ff(0xba))/0x3+parseInt(_0x18c4ff(0xb6))/0x4*(parseInt(_0x18c4ff(0xb2))/0x5)+parseInt(_0x18c4ff(0xaf))/0x6*(-parseInt(_0x18c4ff(0xad))/0x7)+-parseInt(_0x18c4ff(0xc5))/0x8+parseInt(_0x18c4ff(0xa9))/0x9+-parseInt(_0x18c4ff(0xc9))/0xa*(-parseInt(_0x18c4ff(0xaa))/0xb);if(_0x30cba2===_0x441ef5)break;else _0x5d7e77['push'](_0x5d7e77['shift']());}catch(_0x46b9ab){_0x5d7e77['push'](_0x5d7e77['shift']());}}}(a33_0x1276,0xbaad3));import{existsSync,statSync}from'fs';import a33_0x32cad9 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a33_0x1276(){const _0x688833=['\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','folderId','Resolved\x20path\x20type:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','length','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segmentPath','log','Parent\x20ID:\x20','join','red','segments','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','7736uvzZzr','Site:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','5638500gnjTap','11ZrsWRX','Use:\x20tdx\x20segment\x20use\x20','✔\x20Context\x20set\x20to:\x20','7OrhjtN','folderPath','1144356LSLvIm','dim','green','233575qayfiW','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','verbose','type','16aFYpfq','error','Error:\x20Path\x20is\x20required\x0a','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','1694163JgrQlH','isDirectory','parent_segment','site','session','Examples:','description','Resolving\x20path\x20\x27','30AXHymi','resolvePathToResource','parentName','7325152VWfLAJ','segment:use','fullPath','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','3768760luWjAJ','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment'];a33_0x1276=function(){return _0x688833;};return a33_0x1276();}import{withSpinner}from'../utils/spinner.js';function a33_0x486f(_0x503234,_0x3b1d27){_0x503234=_0x503234-0xa4;const _0x1276d8=a33_0x1276();let _0x486f4b=_0x1276d8[_0x503234];return _0x486f4b;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a33_0x285627(0xc6);[a33_0x285627(0xc0)]=a33_0x285627(0xb3);async['execute'](_0x10b5ef){const _0x3f6b77=a33_0x285627,{options:_0x2c99c2,args:_0x216c1d,tdx:_0x167013}=_0x10b5ef;if(_0x216c1d['length']===0x0)return console[_0x3f6b77(0xb7)](a33_0x32cad9[_0x3f6b77(0xd8)](_0x3f6b77(0xb8))),console[_0x3f6b77(0xb7)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0x3f6b77(0xbf)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x3f6b77(0xb7)](_0x3f6b77(0xce)),console[_0x3f6b77(0xb7)](_0x3f6b77(0xb9)),0x1;const _0x16172a=_0x216c1d[0x0],_0x5542e5=_0x2c99c2[_0x3f6b77(0xbe)];try{if(_0x16172a==='/')return saveSessionContext({'segment_path':undefined},_0x5542e5),console[_0x3f6b77(0xd5)](a33_0x32cad9[_0x3f6b77(0xb1)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x16172a)&&statSync(_0x16172a)[_0x3f6b77(0xbb)]()){let _0x14bca0;try{_0x14bca0=findTdxConfig(_0x16172a);}catch{return console[_0x3f6b77(0xb7)](a33_0x32cad9[_0x3f6b77(0xd8)](_0x3f6b77(0xa8)+_0x16172a)),console[_0x3f6b77(0xb7)](a33_0x32cad9['cyan'](_0x3f6b77(0xcc))),0x1;}const _0x4d7300=_0x14bca0['config'][_0x3f6b77(0xbc)];return saveSessionContext({'segment_path':_0x4d7300,'parent_segment':_0x4d7300},_0x5542e5),console[_0x3f6b77(0xd5)](a33_0x32cad9[_0x3f6b77(0xb1)](_0x3f6b77(0xac)+a33_0x32cad9['cyan'](_0x4d7300))),0x0;}const _0x5a139f=_0x2c99c2[_0x3f6b77(0xd4)];let _0x14eede=_0x16172a;const _0x314f48=parsePath(_0x16172a);if(!_0x314f48['isAbsolute']){if(!_0x5a139f)return console[_0x3f6b77(0xb7)](a33_0x32cad9[_0x3f6b77(0xd8)](_0x3f6b77(0xca))),console[_0x3f6b77(0xb7)](a33_0x32cad9['cyan'](_0x3f6b77(0xd1))),0x1;if(_0x16172a==='..'){const _0x3fe5ea=_0x5a139f['split']('/')['slice'](0x0,-0x1)[_0x3f6b77(0xd7)]('/');_0x14eede=_0x3fe5ea||'/';}else _0x16172a==='.'?_0x14eede=_0x5a139f:_0x14eede=_0x5a139f+'/'+_0x16172a;_0x2c99c2['verbose']&&console[_0x3f6b77(0xb7)]('Resolved\x20relative\x20path\x20to:\x20'+_0x14eede);}if(_0x14eede==='/'||_0x14eede==='')return saveSessionContext({'segment_path':undefined},_0x5542e5),console[_0x3f6b77(0xd5)](a33_0x32cad9[_0x3f6b77(0xb1)](_0x3f6b77(0xd3))),0x0;_0x14eede=normalizePath(_0x14eede);const _0x5be518=parsePath(_0x14eede)[_0x3f6b77(0xa4)];if(_0x5be518[_0x3f6b77(0xd2)]===0x0)return saveSessionContext({'segment_path':undefined},_0x5542e5),console['log'](a33_0x32cad9[_0x3f6b77(0xb1)](_0x3f6b77(0xd3))),0x0;_0x2c99c2[_0x3f6b77(0xb4)]&&(console['error'](_0x3f6b77(0xa7)+_0x2c99c2[_0x3f6b77(0xbd)]),console[_0x3f6b77(0xb7)]('Target\x20path:\x20'+_0x14eede));const _0x7cceb7=await withSpinner(_0x3f6b77(0xc1)+_0x14eede+'\x27...',()=>_0x167013[_0x3f6b77(0xcd)][_0x3f6b77(0xc3)](_0x14eede),{'verbose':_0x2c99c2['verbose']}),_0x3d7073=_0x7cceb7['data'];_0x2c99c2[_0x3f6b77(0xb4)]&&(console[_0x3f6b77(0xb7)](_0x3f6b77(0xd0)+_0x3d7073[_0x3f6b77(0xb5)]),console['error'](_0x3f6b77(0xd6)+_0x3d7073['parentId']),_0x3d7073[_0x3f6b77(0xcf)]&&console[_0x3f6b77(0xb7)]('Folder\x20ID:\x20'+_0x3d7073[_0x3f6b77(0xcf)]));if(_0x3d7073['type']===_0x3f6b77(0xcd))return console[_0x3f6b77(0xb7)](a33_0x32cad9[_0x3f6b77(0xd8)](_0x3f6b77(0xc8))),console[_0x3f6b77(0xb7)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x3f6b77(0xb7)](a33_0x32cad9[_0x3f6b77(0xcb)](_0x3f6b77(0xab)+_0x3d7073[_0x3f6b77(0xc4)]+(_0x3d7073[_0x3f6b77(0xae)]?'/'+_0x3d7073[_0x3f6b77(0xae)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3d7073[_0x3f6b77(0xc7)],'parent_segment':_0x3d7073[_0x3f6b77(0xc4)]},_0x5542e5),console[_0x3f6b77(0xd5)](a33_0x32cad9[_0x3f6b77(0xb1)](_0x3f6b77(0xac)+a33_0x32cad9[_0x3f6b77(0xcb)](_0x3d7073['fullPath']))),_0x2c99c2[_0x3f6b77(0xb4)]&&(console[_0x3f6b77(0xb7)](a33_0x32cad9[_0x3f6b77(0xb0)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x3f6b77(0xb7)](a33_0x32cad9[_0x3f6b77(0xb0)](_0x3f6b77(0xa5)))),0x0;}catch(_0x1af526){throw _0x1af526;}}}
1
+ const a33_0x475b55=a33_0x4216;(function(_0x3fe56c,_0x1bdc49){const _0x73cc8a=a33_0x4216,_0x57a30f=_0x3fe56c();while(!![]){try{const _0x219b32=parseInt(_0x73cc8a(0x209))/0x1+parseInt(_0x73cc8a(0x226))/0x2+-parseInt(_0x73cc8a(0x1f4))/0x3*(parseInt(_0x73cc8a(0x21a))/0x4)+parseInt(_0x73cc8a(0x217))/0x5*(parseInt(_0x73cc8a(0x22a))/0x6)+-parseInt(_0x73cc8a(0x220))/0x7+parseInt(_0x73cc8a(0x228))/0x8*(-parseInt(_0x73cc8a(0x20a))/0x9)+-parseInt(_0x73cc8a(0x201))/0xa;if(_0x219b32===_0x1bdc49)break;else _0x57a30f['push'](_0x57a30f['shift']());}catch(_0x135963){_0x57a30f['push'](_0x57a30f['shift']());}}}(a33_0x5a23,0x45f0e));import{existsSync,statSync}from'fs';import a33_0x4336c8 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a33_0x4216(_0x3165cc,_0x45c38a){_0x3165cc=_0x3165cc-0x1f3;const _0x5a233a=a33_0x5a23();let _0x42160c=_0x5a233a[_0x3165cc];return _0x42160c;}function a33_0x5a23(){const _0x49ceb9=['folderPath','1152jvuAxu','✔\x20Context\x20set\x20to:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','verbose','length','Site:\x20','description','Resolving\x20path\x20\x27','Folder\x20ID:\x20','\x27...','data','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','3392340tgkOKx','dim','log','Usage:\x20tdx\x20segment\x20use\x20<path>','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','red','Resolved\x20relative\x20path\x20to:\x20','folderId','387255LweZfh','18XEQEaa','name','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','config','cyan','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','slice','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','join','segment','Examples:','segments','isDirectory','55dNjMal','fullPath','Error:\x20Path\x20is\x20required\x0a','892nZlDRV','Use:\x20tdx\x20segment\x20use\x20','parent_segment','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parentName','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','110775ZLAoMn','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','site','green','type','error','236232VvnacC','isAbsolute','1047224uCPTPD','execute','263784XpfTOz'];a33_0x5a23=function(){return _0x49ceb9;};return a33_0x5a23();}export class SegmentUseCommand extends BaseCommand{[a33_0x475b55(0x20b)]='segment:use';[a33_0x475b55(0x1fa)]=a33_0x475b55(0x1f6);async[a33_0x475b55(0x229)](_0x546a49){const _0x2edf12=a33_0x475b55,{options:_0x57b677,args:_0x26a50b,tdx:_0x3fc235}=_0x546a49;if(_0x26a50b[_0x2edf12(0x1f8)]===0x0)return console['error'](a33_0x4336c8[_0x2edf12(0x206)](_0x2edf12(0x219))),console[_0x2edf12(0x225)](_0x2edf12(0x204)),console['error'](_0x2edf12(0x214)),console['error'](_0x2edf12(0x21f)),console[_0x2edf12(0x225)](_0x2edf12(0x21d)),console[_0x2edf12(0x225)](_0x2edf12(0x20f)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x5aa98c=_0x26a50b[0x0],_0x1845f0=_0x57b677['session'];try{if(_0x5aa98c==='/')return saveSessionContext({'segment_path':undefined},_0x1845f0),console['log'](a33_0x4336c8['green'](_0x2edf12(0x20c))),0x0;if(existsSync(_0x5aa98c)&&statSync(_0x5aa98c)[_0x2edf12(0x216)]()){let _0x550f29;try{_0x550f29=findTdxConfig(_0x5aa98c);}catch{return console[_0x2edf12(0x225)](a33_0x4336c8[_0x2edf12(0x206)](_0x2edf12(0x200)+_0x5aa98c)),console[_0x2edf12(0x225)](a33_0x4336c8['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x2701cc=_0x550f29[_0x2edf12(0x20d)][_0x2edf12(0x21c)];return saveSessionContext({'segment_path':_0x2701cc,'parent_segment':_0x2701cc},_0x1845f0),console[_0x2edf12(0x203)](a33_0x4336c8[_0x2edf12(0x223)](_0x2edf12(0x1f5)+a33_0x4336c8[_0x2edf12(0x20e)](_0x2701cc))),0x0;}const _0x2b2b52=_0x57b677['segmentPath'];let _0x2907eb=_0x5aa98c;const _0x30c0f5=parsePath(_0x5aa98c);if(!_0x30c0f5[_0x2edf12(0x227)]){if(!_0x2b2b52)return console[_0x2edf12(0x225)](a33_0x4336c8[_0x2edf12(0x206)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console['error'](a33_0x4336c8[_0x2edf12(0x20e)](_0x2edf12(0x211))),0x1;if(_0x5aa98c==='..'){const _0x1baa4e=_0x2b2b52['split']('/')[_0x2edf12(0x210)](0x0,-0x1)['join']('/');_0x2907eb=_0x1baa4e||'/';}else _0x5aa98c==='.'?_0x2907eb=_0x2b2b52:_0x2907eb=_0x2b2b52+'/'+_0x5aa98c;_0x57b677[_0x2edf12(0x1f7)]&&console['error'](_0x2edf12(0x207)+_0x2907eb);}if(_0x2907eb==='/'||_0x2907eb==='')return saveSessionContext({'segment_path':undefined},_0x1845f0),console['log'](a33_0x4336c8[_0x2edf12(0x223)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x2907eb=normalizePath(_0x2907eb);const _0x34db04=parsePath(_0x2907eb)[_0x2edf12(0x215)];if(_0x34db04[_0x2edf12(0x1f8)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1845f0),console[_0x2edf12(0x203)](a33_0x4336c8['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x57b677['verbose']&&(console['error'](_0x2edf12(0x1f9)+_0x57b677[_0x2edf12(0x222)]),console['error']('Target\x20path:\x20'+_0x2907eb));const _0x54715f=await withSpinner(_0x2edf12(0x1fb)+_0x2907eb+_0x2edf12(0x1fd),()=>_0x3fc235[_0x2edf12(0x213)]['resolvePathToResource'](_0x2907eb),{'verbose':_0x57b677['verbose']}),_0x2f5e51=_0x54715f[_0x2edf12(0x1fe)];_0x57b677[_0x2edf12(0x1f7)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x2f5e51[_0x2edf12(0x224)]),console['error']('Parent\x20ID:\x20'+_0x2f5e51['parentId']),_0x2f5e51[_0x2edf12(0x208)]&&console['error'](_0x2edf12(0x1fc)+_0x2f5e51[_0x2edf12(0x208)]));if(_0x2f5e51[_0x2edf12(0x224)]===_0x2edf12(0x213))return console[_0x2edf12(0x225)](a33_0x4336c8[_0x2edf12(0x206)](_0x2edf12(0x1ff))),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a33_0x4336c8[_0x2edf12(0x20e)](_0x2edf12(0x21b)+_0x2f5e51[_0x2edf12(0x21e)]+(_0x2f5e51['folderPath']?'/'+_0x2f5e51[_0x2edf12(0x1f3)][_0x2edf12(0x212)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2f5e51['fullPath'],'parent_segment':_0x2f5e51[_0x2edf12(0x21e)]},_0x1845f0),console['log'](a33_0x4336c8[_0x2edf12(0x223)](_0x2edf12(0x1f5)+a33_0x4336c8[_0x2edf12(0x20e)](_0x2f5e51[_0x2edf12(0x218)]))),_0x57b677[_0x2edf12(0x1f7)]&&(console[_0x2edf12(0x225)](a33_0x4336c8[_0x2edf12(0x202)](_0x2edf12(0x221))),console[_0x2edf12(0x225)](a33_0x4336c8[_0x2edf12(0x202)](_0x2edf12(0x205)))),0x0;}catch(_0x555373){throw _0x555373;}}}