@treasuredata/tdx 2026.7.0 → 2026.7.1

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 (229) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-move-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/table-deleted.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.d.ts +1 -0
  105. package/dist/sdk/client/http-client.d.ts.map +1 -1
  106. package/dist/sdk/client/http-client.js +1 -1
  107. package/dist/sdk/client/http-client.js.map +1 -1
  108. package/dist/sdk/client/llm-api-client.js +1 -1
  109. package/dist/sdk/client/oauth-refresh.js +1 -1
  110. package/dist/sdk/client/rate-limiter.js +1 -1
  111. package/dist/sdk/client/td-api-client.js +1 -1
  112. package/dist/sdk/client/trino-api-client.js +1 -1
  113. package/dist/sdk/client/workflow-client.js +1 -1
  114. package/dist/sdk/connection-validator.js +1 -1
  115. package/dist/sdk/connection.js +1 -1
  116. package/dist/sdk/delivery.js +1 -1
  117. package/dist/sdk/engage/campaign-pull.js +1 -1
  118. package/dist/sdk/engage/campaign-push.js +1 -1
  119. package/dist/sdk/engage/campaign-validator.js +1 -1
  120. package/dist/sdk/engage/campaign-yaml.js +1 -1
  121. package/dist/sdk/engage/template-pull.js +1 -1
  122. package/dist/sdk/engage/template-push.js +1 -1
  123. package/dist/sdk/engage/template-validator.js +1 -1
  124. package/dist/sdk/engage/template-yaml.js +1 -1
  125. package/dist/sdk/engage/types/campaign-def.js +1 -1
  126. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  127. package/dist/sdk/engage/types/template-schema.js +1 -1
  128. package/dist/sdk/engage.js +1 -1
  129. package/dist/sdk/errors.js +1 -1
  130. package/dist/sdk/index.js +1 -1
  131. package/dist/sdk/io/index.js +1 -1
  132. package/dist/sdk/io/node-filesystem.js +1 -1
  133. package/dist/sdk/job.js +1 -1
  134. package/dist/sdk/journey.js +1 -1
  135. package/dist/sdk/llm/chat-cache.js +1 -1
  136. package/dist/sdk/llm/index.js +1 -1
  137. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  138. package/dist/sdk/llm/model-factors.js +1 -1
  139. package/dist/sdk/llm/user-settings.js +1 -1
  140. package/dist/sdk/personalization.js +1 -1
  141. package/dist/sdk/policy.js +1 -1
  142. package/dist/sdk/query/deleted-table-validation.js +1 -1
  143. package/dist/sdk/query/index.js +1 -1
  144. package/dist/sdk/query/sql-parser.js +1 -1
  145. package/dist/sdk/realtime.js +1 -1
  146. package/dist/sdk/schedule.js +1 -1
  147. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/fields-display.js +1 -1
  149. package/dist/sdk/segment/file-discovery.js +1 -1
  150. package/dist/sdk/segment/journey-utils.js +1 -1
  151. package/dist/sdk/segment/journey-validator.js +1 -1
  152. package/dist/sdk/segment/journey-yaml.js +1 -1
  153. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  154. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  155. package/dist/sdk/segment/pull-workflow.js +1 -1
  156. package/dist/sdk/segment/push-recovery.js +1 -1
  157. package/dist/sdk/segment/push-workflow.js +1 -1
  158. package/dist/sdk/segment/resolution-context.js +1 -1
  159. package/dist/sdk/segment/segment-path-parser.js +1 -1
  160. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  161. package/dist/sdk/segment/segment-validator.js +1 -1
  162. package/dist/sdk/segment/target-resolution.js +1 -1
  163. package/dist/sdk/segment/tdx-config.js +1 -1
  164. package/dist/sdk/segment/types/activation-schema.js +1 -1
  165. package/dist/sdk/segment/types/journey-def.js +1 -1
  166. package/dist/sdk/segment/types/journey-schema.js +1 -1
  167. package/dist/sdk/segment/types/segment-def.js +1 -1
  168. package/dist/sdk/segment/types/segment-schema.js +1 -1
  169. package/dist/sdk/segment/validate-files.js +1 -1
  170. package/dist/sdk/segment/yaml-validator.js +1 -1
  171. package/dist/sdk/segment.js +1 -1
  172. package/dist/sdk/types/index.js +1 -1
  173. package/dist/sdk/types/progress.js +1 -1
  174. package/dist/sdk/types/workspace.js +1 -1
  175. package/dist/sdk/user.js +1 -1
  176. package/dist/sdk/util/format-detector.js +1 -1
  177. package/dist/sdk/util/formatters.js +1 -1
  178. package/dist/sdk/util/index.js +1 -1
  179. package/dist/sdk/util/paginate.js +1 -1
  180. package/dist/sdk/util/tree-formatter.js +1 -1
  181. package/dist/sdk/util/tree-search.js +1 -1
  182. package/dist/sdk/workflow/archive-validation.js +1 -1
  183. package/dist/sdk/workflow/clone-workflow.js +1 -1
  184. package/dist/sdk/workflow/index.js +1 -1
  185. package/dist/sdk/workflow/pull-workflow.js +1 -1
  186. package/dist/sdk/workflow/push-workflow.js +1 -1
  187. package/dist/sdk/workflow/task-graph.js +1 -1
  188. package/dist/sdk/workflow/tdx-config.js +1 -1
  189. package/dist/sdk/workflow/workflow-utils.js +1 -1
  190. package/dist/sdk/workspace/access-tracker.js +1 -1
  191. package/dist/sdk/workspace/frontmatter.js +1 -1
  192. package/dist/sdk/workspace/git.js +1 -1
  193. package/dist/sdk/workspace/index.js +1 -1
  194. package/dist/sdk/workspace/templates.js +1 -1
  195. package/dist/sdk/workspace/weekly.js +1 -1
  196. package/dist/sdk/workspace/wikilinks.js +1 -1
  197. package/dist/test-utils/command-runner.js +1 -1
  198. package/dist/test-utils/factories.js +1 -1
  199. package/dist/test-utils/fixtures.js +1 -1
  200. package/dist/test-utils/http-mock.js +1 -1
  201. package/dist/test-utils/index.js +1 -1
  202. package/dist/utils/async.js +1 -1
  203. package/dist/utils/colors.js +1 -1
  204. package/dist/utils/diff.js +1 -1
  205. package/dist/utils/file-permissions.js +1 -1
  206. package/dist/utils/file-reader.js +1 -1
  207. package/dist/utils/github-releases.js +1 -1
  208. package/dist/utils/global-cache.js +1 -1
  209. package/dist/utils/json-loader.js +1 -1
  210. package/dist/utils/local-cache.js +1 -1
  211. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  212. package/dist/utils/logger/formatters/index.js +1 -1
  213. package/dist/utils/logger/handlers/console-handler.js +1 -1
  214. package/dist/utils/logger/handlers/file-handler.js +1 -1
  215. package/dist/utils/logger/handlers/index.js +1 -1
  216. package/dist/utils/logger/handlers/null-handler.js +1 -1
  217. package/dist/utils/logger/index.js +1 -1
  218. package/dist/utils/logger/logger.js +1 -1
  219. package/dist/utils/logger/types.js +1 -1
  220. package/dist/utils/option-validation.js +1 -1
  221. package/dist/utils/process.js +1 -1
  222. package/dist/utils/prompt.js +1 -1
  223. package/dist/utils/spinner.js +1 -1
  224. package/dist/utils/sse-parser.js +1 -1
  225. package/dist/utils/string-utils.js +1 -1
  226. package/dist/utils/table-ref-parser.js +1 -1
  227. package/dist/utils/tdx-logger.js +1 -1
  228. package/dist/utils/version-check.js +1 -1
  229. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x436909=a39_0x492d;(function(_0x5068e1,_0x419bf0){const _0x29143b=a39_0x492d,_0x3fd21b=_0x5068e1();while(!![]){try{const _0x2f850c=-parseInt(_0x29143b(0x188))/0x1+-parseInt(_0x29143b(0x18f))/0x2+-parseInt(_0x29143b(0x197))/0x3*(-parseInt(_0x29143b(0x184))/0x4)+-parseInt(_0x29143b(0x182))/0x5*(-parseInt(_0x29143b(0x18a))/0x6)+-parseInt(_0x29143b(0x195))/0x7*(-parseInt(_0x29143b(0x183))/0x8)+-parseInt(_0x29143b(0x191))/0x9+parseInt(_0x29143b(0x186))/0xa*(parseInt(_0x29143b(0x189))/0xb);if(_0x2f850c===_0x419bf0)break;else _0x3fd21b['push'](_0x3fd21b['shift']());}catch(_0xbdc96b){_0x3fd21b['push'](_0x3fd21b['shift']());}}}(a39_0x2427,0x6c44e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a39_0x492d(_0x350175,_0x482dee){_0x350175=_0x350175-0x181;const _0x242760=a39_0x2427();let _0x492d52=_0x242760[_0x350175];return _0x492d52;}function a39_0x2427(){const _0x2237d2=['\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','3792420YwOaEV','parentSegment','513302cyLgxZ','11zCjrvx','876JYybZG','data','List\x20available\x20fields\x20for\x20segmentation','segment:fields','verbose','1106792amfAIe','\x27...','5792805qpBEyo','name','Site:\x20','segment','14ECVwyL','Error:\x20Parent\x20segment\x20name\x20is\x20required','730557TLVBQN','length','error','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Listing\x20fields\x20for\x20\x27','description','29660WMghad','2659920DssmhQ','4pVambt'];a39_0x2427=function(){return _0x2237d2;};return a39_0x2427();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x436909(0x192)]=a39_0x436909(0x18d);[a39_0x436909(0x181)]=a39_0x436909(0x18c);async['execute'](_0x512a4a){const _0x24392a=a39_0x436909,{options:_0x281680,args:_0x9a9005,tdx:_0x19aacd}=_0x512a4a,_0x3a9c3f=_0x9a9005[0x0]||_0x281680[_0x24392a(0x187)];if(!_0x3a9c3f)return console[_0x24392a(0x199)](_0x24392a(0x196)),console[_0x24392a(0x199)](_0x24392a(0x19a)),console[_0x24392a(0x199)](_0x24392a(0x185)),0x1;_0x281680[_0x24392a(0x18e)]&&(console['error'](_0x24392a(0x193)+_0x281680['site']),console['error']('Parent\x20segment:\x20'+_0x3a9c3f));const _0x59c69f=await withSpinner(_0x24392a(0x19b)+_0x3a9c3f+_0x24392a(0x190),()=>_0x19aacd[_0x24392a(0x194)]['listFields'](_0x3a9c3f),{'verbose':_0x281680[_0x24392a(0x18e)]}),_0x4eb48a=_0x59c69f[_0x24392a(0x18b)];console[_0x24392a(0x199)]('✔\x20Found\x20'+_0x4eb48a['length']+'\x20field'+(_0x4eb48a[_0x24392a(0x198)]!==0x1?'s':''));if(_0x281680['json']||_0x281680['jsonl'])return await handleSDKOutput(_0x4eb48a,_0x281680),0x0;return displayFieldsHumanReadable(_0x4eb48a,_0x3a9c3f),0x0;}}
1
+ const a39_0x1f8d7b=a39_0x219f;(function(_0xebdfac,_0x4a4d83){const _0xfa8c74=a39_0x219f,_0x3e2882=_0xebdfac();while(!![]){try{const _0x273ca7=-parseInt(_0xfa8c74(0x8d))/0x1+-parseInt(_0xfa8c74(0x7f))/0x2*(-parseInt(_0xfa8c74(0x93))/0x3)+parseInt(_0xfa8c74(0x8e))/0x4+parseInt(_0xfa8c74(0x88))/0x5*(-parseInt(_0xfa8c74(0x85))/0x6)+parseInt(_0xfa8c74(0x8a))/0x7*(-parseInt(_0xfa8c74(0x94))/0x8)+parseInt(_0xfa8c74(0x89))/0x9*(-parseInt(_0xfa8c74(0x90))/0xa)+parseInt(_0xfa8c74(0x91))/0xb;if(_0x273ca7===_0x4a4d83)break;else _0x3e2882['push'](_0x3e2882['shift']());}catch(_0x25851a){_0x3e2882['push'](_0x3e2882['shift']());}}}(a39_0xdc4f,0x3224e));import{BaseCommand}from'./command.js';function a39_0x219f(_0x21856a,_0x1ee43d){_0x21856a=_0x21856a-0x7e;const _0xdc4f54=a39_0xdc4f();let _0x219f4c=_0xdc4f54[_0x21856a];return _0x219f4c;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a39_0xdc4f(){const _0x3058bc=['✔\x20Found\x20','3PVVPHR','1805048okSItI','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','listFields','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','site','name','217746wXOaZj','Listing\x20fields\x20for\x20\x27','parentSegment','segment','verbose','json','328974OqYvcx','\x20field','Site:\x20','25eAYmoD','486126SfGzGk','7eXkeQu','error','execute','225837DPPWzk','103792YTehtd','length','20JEmmxR','9946310eXLZac'];a39_0xdc4f=function(){return _0x3058bc;};return a39_0xdc4f();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x1f8d7b(0x7e)]='segment:fields';['description']='List\x20available\x20fields\x20for\x20segmentation';async[a39_0x1f8d7b(0x8c)](_0xc5c258){const _0x228481=a39_0x1f8d7b,{options:_0x3431e3,args:_0x507ea2,tdx:_0x26ddf6}=_0xc5c258,_0x1bb9aa=_0x507ea2[0x0]||_0x3431e3[_0x228481(0x81)];if(!_0x1bb9aa)return console[_0x228481(0x8b)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x228481(0x8b)](_0x228481(0x97)),console[_0x228481(0x8b)](_0x228481(0x95)),0x1;_0x3431e3[_0x228481(0x83)]&&(console[_0x228481(0x8b)](_0x228481(0x87)+_0x3431e3[_0x228481(0x98)]),console[_0x228481(0x8b)]('Parent\x20segment:\x20'+_0x1bb9aa));const _0x897cd6=await withSpinner(_0x228481(0x80)+_0x1bb9aa+'\x27...',()=>_0x26ddf6[_0x228481(0x82)][_0x228481(0x96)](_0x1bb9aa),{'verbose':_0x3431e3[_0x228481(0x83)]}),_0x1651ec=_0x897cd6['data'];console['error'](_0x228481(0x92)+_0x1651ec[_0x228481(0x8f)]+_0x228481(0x86)+(_0x1651ec[_0x228481(0x8f)]!==0x1?'s':''));if(_0x3431e3[_0x228481(0x84)]||_0x3431e3['jsonl'])return await handleSDKOutput(_0x1651ec,_0x3431e3),0x0;return displayFieldsHumanReadable(_0x1651ec,_0x1bb9aa),0x0;}}
@@ -1 +1 @@
1
- const a40_0x27c324=a40_0x3931;function a40_0x384e(){const _0x551251=['\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)','\x20→\x20','\x27\x20matches\x20','1128wPmSrG','folderId','\x27...','21yxyvfi','dryRun','for\x20move\x20to','\x27\x20to\x20folder\x20\x27','join','Searching\x20folders\x20for\x20\x27','map','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','includes','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','SEGMENT_NOT_FOUND','slot','resolveEntitiesInParent','Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','2941708Mdbqep','277774PfZKkr','red','[dry-run]\x20No\x20changes\x20made.\x20','description','some','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','explainAmbiguousName','1059684yoRglH','preserved:','\x20segment','\x20\x20(id\x20','verbose','Moving','forEach','74493IEFYlQ','moveSegments','cyan','segment:move','length','test','Segments:\x20','parentId','9132hgfjgN','push','Error:\x20\x27','Examples:','data','Searching\x20the\x20tree...','\x27,\x20\x27','\x20\x20•\x20','get','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','3713580dNerBj','\x27\x20—\x20','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','Checking','yellow','path','code','segment','segmentFolderId','Duplicate\x20segments\x20removed\x20(','name','rule\x20','601844EnHLGK','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','filter','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','error','\x20condition','has','\x20segment(s)\x20would\x20be\x20moved.','865StsWgS','toLowerCase'];a40_0x384e=function(){return _0x551251;};return a40_0x384e();}(function(_0x5b513a,_0xfc71da){const _0x57ada3=a40_0x3931,_0x51d8c4=_0x5b513a();while(!![]){try{const _0x3b58ce=-parseInt(_0x57ada3(0xaa))/0x1+-parseInt(_0x57ada3(0xcb))/0x2*(-parseInt(_0x57ada3(0xbb))/0x3)+parseInt(_0x57ada3(0x93))/0x4*(-parseInt(_0x57ada3(0xb3))/0x5)+-parseInt(_0x57ada3(0xd2))/0x6+-parseInt(_0x57ada3(0xca))/0x7+-parseInt(_0x57ada3(0xb8))/0x8*(-parseInt(_0x57ada3(0x8b))/0x9)+parseInt(_0x57ada3(0x9d))/0xa;if(_0x3b58ce===_0xfc71da)break;else _0x51d8c4['push'](_0x51d8c4['shift']());}catch(_0xddfdf5){_0x51d8c4['push'](_0x51d8c4['shift']());}}}(a40_0x384e,0xdfde3));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a40_0x3931(_0x311bda,_0x4dd50c){_0x311bda=_0x311bda-0x85;const _0x384e84=a40_0x384e();let _0x3931e9=_0x384e84[_0x311bda];return _0x3931e9;}import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import a40_0x53a960 from'chalk';export class SegmentMoveCommand extends BaseCommand{[a40_0x27c324(0xa8)]=a40_0x27c324(0x8e);[a40_0x27c324(0xce)]=a40_0x27c324(0xac);async['execute'](_0x4be43d){const _0x3db098=a40_0x27c324,{options:_0x4322cb,args:_0x15151c,tdx:_0x518a2e}=_0x4be43d,_0x3a1a71=_0x15151c,_0x5078e5=_0x4322cb['folder'];if(_0x3a1a71[_0x3db098(0x8f)]===0x0||!_0x5078e5)return console['error'](a40_0x53a960['red']('Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a')),console[_0x3db098(0xaf)](_0x3db098(0x9f)),console[_0x3db098(0xaf)](_0x3db098(0x96)),console['error'](_0x3db098(0xc2)),console[_0x3db098(0xaf)](_0x3db098(0xa0)),console[_0x3db098(0xaf)](_0x3db098(0xb5)),console[_0x3db098(0xaf)]('\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.'),0x1;_0x4322cb[_0x3db098(0x88)]&&(console[_0x3db098(0xaf)](_0x3db098(0x91)+_0x3a1a71[_0x3db098(0xbf)](',\x20')),console['error']('Target\x20folder:\x20'+_0x5078e5));const _0x342cc4=[...new Set(_0x3a1a71)];_0x342cc4['length']<_0x3a1a71[_0x3db098(0x8f)]&&console['error'](a40_0x53a960[_0x3db098(0xa2)](_0x3db098(0xa7)+_0x3a1a71[_0x3db098(0x8f)]+_0x3db098(0xb6)+_0x342cc4[_0x3db098(0x8f)]+').'));const _0x1ddc89=/^\d+$/,_0x17be82=_0x4322cb['parentSegment'],_0x6a9f=[..._0x342cc4,_0x5078e5][_0x3db098(0xcf)](_0x2c7f9d=>!_0x1ddc89[_0x3db098(0x90)](_0x2c7f9d));if(_0x6a9f&&!_0x17be82)return console[_0x3db098(0xaf)](a40_0x53a960[_0x3db098(0xcc)](_0x3db098(0xc8))),console['error'](_0x3db098(0xae)),console['error'](_0x3db098(0xc4)),console[_0x3db098(0xaf)](_0x3db098(0xd0)),0x1;const _0x6ccc1=_0x342cc4[_0x3db098(0x8f)],_0x7f780b=_0x4322cb[_0x3db098(0xbc)]===!![];let _0x30ea06;try{const _0x1d886d=await withSpinner((_0x7f780b?_0x3db098(0xa1):_0x3db098(0x89))+'\x20'+_0x6ccc1+_0x3db098(0x86)+(_0x6ccc1===0x1?'':'s')+'\x20'+((_0x7f780b?_0x3db098(0xbd):'to')+'\x20folder\x20\x27'+_0x5078e5+_0x3db098(0xba)),async()=>{const _0x556fc6=_0x3db098,_0x4b45d7=[];_0x342cc4[_0x556fc6(0x8a)]((_0x259145,_0x342ad8)=>{const _0x5636d1=_0x556fc6;if(!_0x1ddc89['test'](_0x259145))_0x4b45d7[_0x5636d1(0x94)]({'name':_0x259145,'expectType':_0x5636d1(0xa5),'slot':_0x342ad8});});if(!_0x1ddc89['test'](_0x5078e5))_0x4b45d7[_0x556fc6(0x94)]({'name':_0x5078e5,'expectType':'folder','slot':-0x1});const _0xfb4003=new Map();if(_0x4b45d7[_0x556fc6(0x8f)]>0x0){const _0xc7c5f2=await _0x518a2e[_0x556fc6(0xa5)][_0x556fc6(0xc7)](_0x17be82,_0x4b45d7[_0x556fc6(0xc1)](({name:_0x2c50d1,expectType:_0x48c092})=>({'name':_0x2c50d1,'expectType':_0x48c092})));_0xc7c5f2['forEach']((_0x19f65e,_0x3878d4)=>_0xfb4003['set'](_0x4b45d7[_0x3878d4][_0x556fc6(0xc6)],_0x19f65e['id']));}const _0x158e2e=_0x342cc4[_0x556fc6(0xc1)]((_0x3909f0,_0x8e0fd9)=>_0x1ddc89['test'](_0x3909f0)?_0x3909f0:_0xfb4003[_0x556fc6(0x9b)](_0x8e0fd9)),_0x3ed5c2=_0x1ddc89[_0x556fc6(0x90)](_0x5078e5)?_0x5078e5:_0xfb4003[_0x556fc6(0x9b)](-0x1);return _0x518a2e['segment'][_0x556fc6(0x8c)](_0x158e2e,_0x3ed5c2,_0x7f780b);},{'verbose':_0x4322cb[_0x3db098(0x88)]});_0x30ea06=_0x1d886d[_0x3db098(0x97)];}catch(_0x3e71ce){if(_0x3e71ce instanceof SDKError&&_0x3e71ce[_0x3db098(0xa4)]===ErrorCode[_0x3db098(0xc5)]&&_0x17be82)try{if(await this[_0x3db098(0xd1)](_0x518a2e,_0x17be82,_0x342cc4,_0x4322cb))return 0x1;}catch{}throw _0x3e71ce;}for(const _0x2d5cbc of _0x30ea06){const _0x2cc63f=_0x2d5cbc['ruleConditionCount'],_0x1094eb=_0x3db098(0xa9)+(_0x7f780b?_0x3db098(0xb1):_0x3db098(0x85))+'\x20'+_0x2cc63f+_0x3db098(0xb0)+(_0x2cc63f===0x1?'':'s');console[_0x3db098(0xaf)](_0x7f780b?a40_0x53a960['cyan'](_0x3db098(0x9c)+_0x2d5cbc['id']+'\x27\x20to\x20folder\x20\x27'+_0x2d5cbc[_0x3db098(0xa6)]+_0x3db098(0x9e)+_0x1094eb):a40_0x53a960['green']('✔\x20Moved\x20segment\x20\x27'+_0x2d5cbc['id']+_0x3db098(0xbe)+_0x2d5cbc[_0x3db098(0xa6)]+_0x3db098(0x9e)+_0x1094eb+'\x20(verified\x20by\x20re-read)'));}if(_0x7f780b)console[_0x3db098(0xaf)](a40_0x53a960[_0x3db098(0x8d)](_0x3db098(0xcd)+_0x6ccc1+_0x3db098(0xb2)));else _0x30ea06[_0x3db098(0x8f)]>0x1&&console[_0x3db098(0xaf)](a40_0x53a960['green']('✔\x20'+_0x30ea06[_0x3db098(0x8f)]+'\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact'));return await handleSDKOutput(_0x30ea06,_0x4322cb),0x0;}async[a40_0x27c324(0xd1)](_0x3a85c4,_0x458654,_0x5f48e6,_0x10709e){const _0x1fb36c=a40_0x27c324,_0x453beb=_0x5f48e6[_0x1fb36c(0xad)](_0x32b4be=>!/^\d+$/[_0x1fb36c(0x90)](_0x32b4be)&&!_0x32b4be[_0x1fb36c(0xc3)]('/'));if(_0x453beb['length']===0x0)return![];const _0x413da3=await withSpinner(_0x1fb36c(0xc0)+_0x453beb['join'](_0x1fb36c(0x99))+'\x27...',()=>_0x3a85c4[_0x1fb36c(0xa5)]['resolvePathToResource'](_0x458654),{'verbose':_0x10709e[_0x1fb36c(0x88)]}),_0x30d59e=(await withSpinner(_0x1fb36c(0x98),()=>_0x3a85c4['segment']['listRecursive'](_0x413da3[_0x1fb36c(0x97)][_0x1fb36c(0x92)],_0x413da3[_0x1fb36c(0x97)][_0x1fb36c(0xb9)],0x0,0xa),{'verbose':_0x10709e[_0x1fb36c(0x88)]}))[_0x1fb36c(0x97)];let _0x611d1e=![];for(const _0x35a081 of _0x453beb){const _0x2e9123=searchTreeByName(_0x30d59e,_0x35a081)[_0x1fb36c(0xad)](_0x180465=>_0x180465['type']===_0x1fb36c(0xa5)&&_0x180465[_0x1fb36c(0xa8)][_0x1fb36c(0xb4)]()===_0x35a081[_0x1fb36c(0xb4)]());if(_0x2e9123[_0x1fb36c(0x8f)]>0x1){_0x611d1e=!![],console['error'](a40_0x53a960['red'](_0x1fb36c(0x95)+_0x35a081+_0x1fb36c(0xb7)+_0x2e9123[_0x1fb36c(0x8f)]+'\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:'));for(const _0x553112 of _0x2e9123)console['error'](_0x1fb36c(0x9a)+_0x553112['path']+_0x1fb36c(0x87)+_0x553112['id']+')');}else _0x2e9123[_0x1fb36c(0x8f)]===0x1&&(_0x611d1e=!![],console[_0x1fb36c(0xaf)](a40_0x53a960[_0x1fb36c(0xcc)](_0x1fb36c(0x95)+_0x35a081+_0x1fb36c(0xab))),console[_0x1fb36c(0xaf)]('\x20\x20'+_0x2e9123[0x0][_0x1fb36c(0xa3)]+_0x1fb36c(0x87)+_0x2e9123[0x0]['id']+')'),console['error'](_0x1fb36c(0xc9)));}return _0x611d1e;}}
1
+ function a40_0x511d(){const _0x21fc85=['Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','push','path','281706ELpLkd','582805DepbgD','yellow','segmentFolderId','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','type','\x27...','\x27\x20—\x20','✔\x20Moved\x20segment\x20\x27','Moving','has','\x27\x20matches\x20','Error:\x20\x27','455MwAVoz','some','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','\x20→\x20','resolveEntitiesInParent','segment:move','\x20(verified\x20by\x20re-read)','test','listRecursive','verbose','description','Checking','for\x20move\x20to','length','126152pNlvgt','\x20\x20(id\x20','execute','get','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','name','cyan','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','Searching\x20the\x20tree...','moveSegments','parentId','89469ximXYS','map','\x20segment(s)\x20would\x20be\x20moved.','\x20folder\x20\x27','segment','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','error','555816EUHePH','4Olkibr','66ijpSCt','explainAmbiguousName','Segments:\x20','ruleConditionCount','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','forEach','\x20condition','SEGMENT_NOT_FOUND','resolvePathToResource','data','parentSegment','toLowerCase','262614MvtVNk','\x27\x20to\x20folder\x20\x27','69528OMpDDR','folder','Searching\x20folders\x20for\x20\x27','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','1370zmatDm','green','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','30hPbnQe','dryRun','Target\x20folder:\x20','red','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','filter','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','join','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:'];a40_0x511d=function(){return _0x21fc85;};return a40_0x511d();}const a40_0x26486c=a40_0x54af;function a40_0x54af(_0x4d5c99,_0x539978){_0x4d5c99=_0x4d5c99-0xe2;const _0x511dec=a40_0x511d();let _0x54af73=_0x511dec[_0x4d5c99];return _0x54af73;}(function(_0x5063b5,_0x537e2f){const _0x384ef9=a40_0x54af,_0x15b3d0=_0x5063b5();while(!![]){try{const _0x5c5efa=-parseInt(_0x384ef9(0x116))/0x1+-parseInt(_0x384ef9(0x10a))/0x2*(-parseInt(_0x384ef9(0x100))/0x3)+parseInt(_0x384ef9(0xf3))/0x4*(parseInt(_0x384ef9(0x117))/0x5)+-parseInt(_0x384ef9(0xf2))/0x6+parseInt(_0x384ef9(0x123))/0x7*(parseInt(_0x384ef9(0x131))/0x8)+-parseInt(_0x384ef9(0xeb))/0x9*(parseInt(_0x384ef9(0x107))/0xa)+-parseInt(_0x384ef9(0xf4))/0xb*(-parseInt(_0x384ef9(0x102))/0xc);if(_0x5c5efa===_0x537e2f)break;else _0x15b3d0['push'](_0x15b3d0['shift']());}catch(_0x3328ef){_0x15b3d0['push'](_0x15b3d0['shift']());}}}(a40_0x511d,0xb7de1));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import a40_0x56e066 from'chalk';export class SegmentMoveCommand extends BaseCommand{['name']=a40_0x26486c(0x128);[a40_0x26486c(0x12d)]=a40_0x26486c(0x109);async[a40_0x26486c(0xe2)](_0xfd2414){const _0xee756c=a40_0x26486c,{options:_0x2c2ae1,args:_0x50ee58,tdx:_0x3d08d3}=_0xfd2414,_0x219a95=_0x50ee58,_0x58ece1=_0x2c2ae1[_0xee756c(0x103)];if(_0x219a95[_0xee756c(0x130)]===0x0||!_0x58ece1)return console[_0xee756c(0xf1)](a40_0x56e066[_0xee756c(0x10d)](_0xee756c(0xf8))),console[_0xee756c(0xf1)](_0xee756c(0x11a)),console[_0xee756c(0xf1)]('Examples:'),console['error'](_0xee756c(0x125)),console[_0xee756c(0xf1)](_0xee756c(0x105)),console[_0xee756c(0xf1)]('\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)'),console[_0xee756c(0xf1)](_0xee756c(0x10e)),0x1;_0x2c2ae1[_0xee756c(0x12c)]&&(console[_0xee756c(0xf1)](_0xee756c(0xf6)+_0x219a95[_0xee756c(0x111)](',\x20')),console[_0xee756c(0xf1)](_0xee756c(0x10c)+_0x58ece1));const _0x19f77a=[...new Set(_0x219a95)];_0x19f77a[_0xee756c(0x130)]<_0x219a95[_0xee756c(0x130)]&&console[_0xee756c(0xf1)](a40_0x56e066[_0xee756c(0x118)]('Duplicate\x20segments\x20removed\x20('+_0x219a95[_0xee756c(0x130)]+_0xee756c(0x126)+_0x19f77a[_0xee756c(0x130)]+').'));const _0x445503=/^\d+$/,_0x51a444=_0x2c2ae1[_0xee756c(0xfe)],_0x40a521=[..._0x19f77a,_0x58ece1][_0xee756c(0x124)](_0x32cf48=>!_0x445503[_0xee756c(0x12a)](_0x32cf48));if(_0x40a521&&!_0x51a444)return console[_0xee756c(0xf1)](a40_0x56e066['red']('Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a')),console['error']('Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22'),console[_0xee756c(0xf1)](_0xee756c(0xe4)),console[_0xee756c(0xf1)](_0xee756c(0xf0)),0x1;const _0x24c673=_0x19f77a['length'],_0x4b810f=_0x2c2ae1[_0xee756c(0x10b)]===!![];let _0x58075a;try{const _0x2c62d2=await withSpinner((_0x4b810f?_0xee756c(0x12e):_0xee756c(0x11f))+'\x20'+_0x24c673+'\x20segment'+(_0x24c673===0x1?'':'s')+'\x20'+((_0x4b810f?_0xee756c(0x12f):'to')+_0xee756c(0xee)+_0x58ece1+_0xee756c(0x11c)),async()=>{const _0x47a58f=_0xee756c,_0x3af999=[];_0x19f77a[_0x47a58f(0xf9)]((_0x37ace3,_0x9e20d2)=>{if(!_0x445503['test'](_0x37ace3))_0x3af999['push']({'name':_0x37ace3,'expectType':'segment','slot':_0x9e20d2});});if(!_0x445503[_0x47a58f(0x12a)](_0x58ece1))_0x3af999[_0x47a58f(0x114)]({'name':_0x58ece1,'expectType':_0x47a58f(0x103),'slot':-0x1});const _0x51ee0e=new Map();if(_0x3af999[_0x47a58f(0x130)]>0x0){const _0x534e8f=await _0x3d08d3['segment'][_0x47a58f(0x127)](_0x51a444,_0x3af999[_0x47a58f(0xec)](({name:_0x4bc88d,expectType:_0x4577e5})=>({'name':_0x4bc88d,'expectType':_0x4577e5})));_0x534e8f[_0x47a58f(0xf9)]((_0x50cc9e,_0x1ec35b)=>_0x51ee0e['set'](_0x3af999[_0x1ec35b]['slot'],_0x50cc9e['id']));}const _0x5c12f1=_0x19f77a[_0x47a58f(0xec)]((_0x30e80a,_0x364a5b)=>_0x445503[_0x47a58f(0x12a)](_0x30e80a)?_0x30e80a:_0x51ee0e[_0x47a58f(0xe3)](_0x364a5b)),_0x4f67b9=_0x445503[_0x47a58f(0x12a)](_0x58ece1)?_0x58ece1:_0x51ee0e[_0x47a58f(0xe3)](-0x1);return _0x3d08d3[_0x47a58f(0xef)][_0x47a58f(0xe9)](_0x5c12f1,_0x4f67b9,_0x4b810f);},{'verbose':_0x2c2ae1[_0xee756c(0x12c)]});_0x58075a=_0x2c62d2[_0xee756c(0xfd)];}catch(_0x1303e1){if(_0x1303e1 instanceof SDKError&&_0x1303e1['code']===ErrorCode[_0xee756c(0xfb)]&&_0x51a444)try{if(await this[_0xee756c(0xf5)](_0x3d08d3,_0x51a444,_0x19f77a,_0x2c2ae1))return 0x1;}catch{}throw _0x1303e1;}for(const _0x4a345e of _0x58075a){const _0x3e110a=_0x4a345e[_0xee756c(0xf7)],_0xd147a0='rule\x20'+(_0x4b810f?_0xee756c(0x120):'preserved:')+'\x20'+_0x3e110a+_0xee756c(0xfa)+(_0x3e110a===0x1?'':'s');console['error'](_0x4b810f?a40_0x56e066['cyan'](_0xee756c(0x106)+_0x4a345e['id']+_0xee756c(0x101)+_0x4a345e[_0xee756c(0x119)]+_0xee756c(0x11d)+_0xd147a0):a40_0x56e066[_0xee756c(0x108)](_0xee756c(0x11e)+_0x4a345e['id']+_0xee756c(0x101)+_0x4a345e['segmentFolderId']+_0xee756c(0x11d)+_0xd147a0+_0xee756c(0x129)));}if(_0x4b810f)console['error'](a40_0x56e066[_0xee756c(0xe6)]('[dry-run]\x20No\x20changes\x20made.\x20'+_0x24c673+_0xee756c(0xed)));else _0x58075a['length']>0x1&&console[_0xee756c(0xf1)](a40_0x56e066[_0xee756c(0x108)]('✔\x20'+_0x58075a[_0xee756c(0x130)]+_0xee756c(0x110)));return await handleSDKOutput(_0x58075a,_0x2c2ae1),0x0;}async[a40_0x26486c(0xf5)](_0x29e955,_0x7794fb,_0x3050b6,_0x3e3dba){const _0x598d47=a40_0x26486c,_0x1b809b=_0x3050b6[_0x598d47(0x10f)](_0x1145d7=>!/^\d+$/[_0x598d47(0x12a)](_0x1145d7)&&!_0x1145d7['includes']('/'));if(_0x1b809b['length']===0x0)return![];const _0x4018e4=await withSpinner(_0x598d47(0x104)+_0x1b809b[_0x598d47(0x111)]('\x27,\x20\x27')+'\x27...',()=>_0x29e955[_0x598d47(0xef)][_0x598d47(0xfc)](_0x7794fb),{'verbose':_0x3e3dba['verbose']}),_0x1b49fe=(await withSpinner(_0x598d47(0xe8),()=>_0x29e955['segment'][_0x598d47(0x12b)](_0x4018e4[_0x598d47(0xfd)][_0x598d47(0xea)],_0x4018e4['data']['folderId'],0x0,0xa),{'verbose':_0x3e3dba[_0x598d47(0x12c)]}))['data'];let _0x9964c1=![];for(const _0x3803a1 of _0x1b809b){const _0x85e8e2=searchTreeByName(_0x1b49fe,_0x3803a1)[_0x598d47(0x10f)](_0x34d474=>_0x34d474[_0x598d47(0x11b)]==='segment'&&_0x34d474[_0x598d47(0xe5)][_0x598d47(0xff)]()===_0x3803a1['toLowerCase']());if(_0x85e8e2[_0x598d47(0x130)]>0x1){_0x9964c1=!![],console[_0x598d47(0xf1)](a40_0x56e066[_0x598d47(0x10d)]('Error:\x20\x27'+_0x3803a1+_0x598d47(0x121)+_0x85e8e2['length']+_0x598d47(0xe7)));for(const _0x544c74 of _0x85e8e2)console['error']('\x20\x20•\x20'+_0x544c74[_0x598d47(0x115)]+_0x598d47(0x132)+_0x544c74['id']+')');}else _0x85e8e2[_0x598d47(0x130)]===0x1&&(_0x9964c1=!![],console[_0x598d47(0xf1)](a40_0x56e066[_0x598d47(0x10d)](_0x598d47(0x122)+_0x3803a1+_0x598d47(0x112))),console['error']('\x20\x20'+_0x85e8e2[0x0]['path']+_0x598d47(0x132)+_0x85e8e2[0x0]['id']+')'),console['error'](_0x598d47(0x113)));}return _0x9964c1;}}
@@ -1 +1 @@
1
- const a41_0x2e2a6a=a41_0x5e28;(function(_0x2a89a5,_0x1fb443){const _0x498f38=a41_0x5e28,_0x34925d=_0x2a89a5();while(!![]){try{const _0x3fa593=-parseInt(_0x498f38(0x9e))/0x1*(-parseInt(_0x498f38(0xba))/0x2)+parseInt(_0x498f38(0xc5))/0x3+parseInt(_0x498f38(0xb2))/0x4+parseInt(_0x498f38(0xb5))/0x5+-parseInt(_0x498f38(0x9d))/0x6+-parseInt(_0x498f38(0xc2))/0x7*(parseInt(_0x498f38(0xa0))/0x8)+-parseInt(_0x498f38(0x92))/0x9;if(_0x3fa593===_0x1fb443)break;else _0x34925d['push'](_0x34925d['shift']());}catch(_0x1fa718){_0x34925d['push'](_0x34925d['shift']());}}}(a41_0x2b90,0xd1421));function a41_0x2b90(){const _0x520f4d=['counts','name','description','message','\x0aPull\x20summary\x20for\x20\x27','parentName','no_parent','✔\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','session','type','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','segment:pull','resourceName','filter','length','red','files','content','-\x20no\x20files\x20written','16577901enHXJo','journeyVersions','relativePath','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','execute','\x20segments','absolutePath','dirname','dim','\x20\x20Target:\x20','file','5965218PSDkQq','503bRyYOg','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)','5328cSUmIT','error','\x20changed\x20files','\x0aError:','verbose','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20\x20🎯\x20','cwd','Pulling\x20segments\x20from\x20\x27','Parent\x20segment:\x20','\x0aChanges\x20to\x20\x27','segments','data','pullSegments','green','\x20journeys','yellow','Error:\x20','5955604jKfDyL','setPhase','journeys','2319350sXOYNJ','✔\x20Pulled\x20','parent_segment','site','yes','1874bWXSIg','\x27...','parentSegment','hasChanges','Aborted.','\x20new\x20files','activations','cyan','546HJavNZ','helpText','targetDir','3963537UERILJ','\x20activations','Site:\x20'];a41_0x2b90=function(){return _0x520f4d;};return a41_0x2b90();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a41_0x5894c6 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a41_0x5e28(_0x3e4d24,_0x54baa2){_0x3e4d24=_0x3e4d24-0x81;const _0x2b90b4=a41_0x2b90();let _0x5e28c9=_0x2b90b4[_0x3e4d24];return _0x5e28c9;}import a41_0x55dce from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a41_0x2e2a6a(0xc9)]=a41_0x2e2a6a(0x8a);[a41_0x2e2a6a(0xca)]=a41_0x2e2a6a(0x89);async[a41_0x2e2a6a(0x96)](_0x288048){const _0x4d540a=a41_0x2e2a6a,{options:_0x83ef8d,args:_0x419f85,tdx:_0x1ab800}=_0x288048,_0x49ab7f=_0x83ef8d,_0x3ce2a6=await resolveTarget({'arg':_0x419f85[0x0],'contextParent':_0x83ef8d[_0x4d540a(0xbc)],'cwd':process[_0x4d540a(0xa7)]()});if(!isSuccessfulResolution(_0x3ce2a6))return _0x3ce2a6['errorCode']===_0x4d540a(0x84)?(console['error'](a41_0x5894c6['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x4d540a(0x9f)),console['error'](_0x4d540a(0x86)),console['error']('\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[_0x4d540a(0xa1)](a41_0x5894c6['red'](_0x4d540a(0xb1)+_0x3ce2a6[_0x4d540a(0x81)]+'\x0a')),_0x3ce2a6[_0x4d540a(0xc3)]&&console[_0x4d540a(0xa1)](a41_0x5894c6[_0x4d540a(0xc1)](_0x3ce2a6[_0x4d540a(0xc3)]))),0x1;const _0x1f032b=_0x3ce2a6[_0x4d540a(0x83)],_0x34caff=_0x3ce2a6[_0x4d540a(0xc4)],_0x45b75b=_0x3ce2a6[_0x4d540a(0x88)]===_0x4d540a(0x9c)?_0x3ce2a6[_0x4d540a(0x8b)]:undefined;_0x49ab7f[_0x4d540a(0xa4)]&&(console[_0x4d540a(0xa1)](_0x4d540a(0xc7)+_0x49ab7f[_0x4d540a(0xb8)]),console[_0x4d540a(0xa1)](_0x4d540a(0xa9)+_0x1f032b),_0x45b75b&&console[_0x4d540a(0xa1)]('Target\x20resource:\x20'+_0x45b75b));const _0x496015=await withProgressSpinner(_0x4d540a(0xa8)+_0x1f032b+_0x4d540a(0xbb),_0x149c87=>_0x1ab800['segment'][_0x4d540a(0xad)](_0x1f032b,{'targetDir':_0x34caff,'targetResourceName':_0x45b75b,'verbose':_0x49ab7f[_0x4d540a(0xa4)],'progress':{'update':_0x309abc=>{const _0x1797c7=_0x4d540a;_0x149c87[_0x1797c7(0xb3)](_0x309abc),_0x49ab7f['verbose']&&console[_0x1797c7(0xa1)]('\x20\x20'+_0x309abc);}}}),{'verbose':_0x49ab7f[_0x4d540a(0xa4)]}),_0x2c8e97=_0x496015[_0x4d540a(0xac)];if(_0x2c8e97['counts'][_0x4d540a(0xab)]===0x0&&_0x2c8e97['counts'][_0x4d540a(0xb4)]===0x0)return console[_0x4d540a(0xa1)](a41_0x5894c6[_0x4d540a(0xb0)](_0x4d540a(0xa5)+_0x2c8e97['parentName']+'\x27')),0x0;const _0xb8638e=_0x2c8e97[_0x4d540a(0x8f)]['filter'](_0x4423cc=>_0x4423cc['isNew']),_0x4fb2f8=_0x2c8e97[_0x4d540a(0x8f)][_0x4d540a(0x8c)](_0x340c7c=>!_0x340c7c['isNew']&&_0x340c7c['hasChanges']),_0x224106=_0x2c8e97[_0x4d540a(0x8f)][_0x4d540a(0x8c)](_0x4908c2=>!_0x4908c2['isNew']&&!_0x4908c2[_0x4d540a(0xbd)]);console[_0x4d540a(0xa1)](_0x4d540a(0x82)+_0x2c8e97['parentName']+'\x27:'),console[_0x4d540a(0xa1)](_0x4d540a(0xa6)+a41_0x5894c6[_0x4d540a(0xc1)](_0x2c8e97[_0x4d540a(0xc8)][_0x4d540a(0xab)]+_0x4d540a(0x97))+'\x20with\x20'+a41_0x5894c6['cyan'](_0x2c8e97[_0x4d540a(0xc8)][_0x4d540a(0xc0)]+_0x4d540a(0xc6)));if(_0x2c8e97['counts'][_0x4d540a(0xb4)]>0x0){const _0x420f0f=_0x2c8e97[_0x4d540a(0xc8)][_0x4d540a(0x93)]>_0x2c8e97[_0x4d540a(0xc8)][_0x4d540a(0xb4)]?'\x20('+_0x2c8e97[_0x4d540a(0xc8)][_0x4d540a(0x93)]+'\x20versions)':'';console[_0x4d540a(0xa1)]('\x20\x20🗺️\x20\x20'+a41_0x5894c6['cyan'](_0x2c8e97[_0x4d540a(0xc8)]['journeys']+_0x4d540a(0xaf))+a41_0x5894c6[_0x4d540a(0x9a)](_0x420f0f));}console[_0x4d540a(0xa1)]('\x20\x20'+a41_0x5894c6[_0x4d540a(0xae)]('+\x20'+_0xb8638e['length']+_0x4d540a(0xbf))),console[_0x4d540a(0xa1)]('\x20\x20'+a41_0x5894c6['yellow']('~\x20'+_0x4fb2f8['length']+_0x4d540a(0xa2))),console[_0x4d540a(0xa1)]('\x20\x20'+a41_0x5894c6['dim']('=\x20'+_0x224106['length']+'\x20unchanged\x20files')),console['error'](_0x4d540a(0x9b)+a41_0x5894c6[_0x4d540a(0xc1)](_0x2c8e97['targetDir'])+'\x0a');if(_0x4fb2f8[_0x4d540a(0x8d)]>0x0)for(const _0x1cbd56 of _0x4fb2f8){console[_0x4d540a(0xa1)](_0x4d540a(0xaa)+_0x1cbd56[_0x4d540a(0x94)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x1cbd56['diff']),console[_0x4d540a(0xa1)]('─'['repeat'](0x3c));}if(_0x49ab7f['dryRun'])return console[_0x4d540a(0xa1)](a41_0x5894c6[_0x4d540a(0xb0)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xb8638e[_0x4d540a(0x8d)]===0x0&&_0x4fb2f8[_0x4d540a(0x8d)]===0x0)return console[_0x4d540a(0xa1)](a41_0x5894c6[_0x4d540a(0xae)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2c8e97[_0x4d540a(0x83)]},_0x49ab7f[_0x4d540a(0x87)]),console['error'](a41_0x5894c6[_0x4d540a(0xae)](_0x4d540a(0x85)+a41_0x5894c6[_0x4d540a(0x9a)](_0x4d540a(0xb7))+'\x20=\x20'+a41_0x5894c6[_0x4d540a(0xc1)](_0x2c8e97['parentName']))),0x0;if(!_0x49ab7f[_0x4d540a(0xb9)]){if(!isInteractive())return console['error'](a41_0x5894c6[_0x4d540a(0x8e)](_0x4d540a(0xa3)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4d540a(0xa1)](a41_0x5894c6[_0x4d540a(0x9a)](_0x4d540a(0x95))),0x1;const _0x474ddc=await confirmKey('Write\x20'+(_0xb8638e[_0x4d540a(0x8d)]+_0x4fb2f8[_0x4d540a(0x8d)])+'\x20files?');if(!_0x474ddc)return console[_0x4d540a(0xa1)](a41_0x5894c6[_0x4d540a(0xb0)](_0x4d540a(0xbe)),_0x4d540a(0x91)),0x1;}for(const _0x582b73 of _0x2c8e97[_0x4d540a(0x8f)]){if(_0x582b73['isNew']||_0x582b73[_0x4d540a(0xbd)]){const _0x8d351c=a41_0x55dce[_0x4d540a(0x99)](_0x582b73[_0x4d540a(0x98)]);!existsSync(_0x8d351c)&&mkdirSync(_0x8d351c,{'recursive':!![]}),writeFileSync(_0x582b73['absolutePath'],_0x582b73[_0x4d540a(0x90)],'utf-8');}}return console[_0x4d540a(0xa1)](a41_0x5894c6[_0x4d540a(0xae)](_0x4d540a(0xb6)+(_0xb8638e['length']+_0x4fb2f8[_0x4d540a(0x8d)])+'\x20files\x20to\x20'+_0x2c8e97[_0x4d540a(0xc4)])),saveSessionContext({'parent_segment':_0x2c8e97['parentName']},_0x49ab7f[_0x4d540a(0x87)]),console['error'](a41_0x5894c6[_0x4d540a(0xae)](_0x4d540a(0x85)+a41_0x5894c6['dim'](_0x4d540a(0xb7))+'\x20=\x20'+a41_0x5894c6[_0x4d540a(0xc1)](_0x2c8e97['parentName']))),0x0;}}
1
+ const a41_0x5d0b68=a41_0x31de;(function(_0x248844,_0x1eadea){const _0x3d5913=a41_0x31de,_0x40e67f=_0x248844();while(!![]){try{const _0x1933b7=-parseInt(_0x3d5913(0x19b))/0x1+parseInt(_0x3d5913(0x197))/0x2+parseInt(_0x3d5913(0x16e))/0x3+-parseInt(_0x3d5913(0x198))/0x4*(parseInt(_0x3d5913(0x17e))/0x5)+-parseInt(_0x3d5913(0x16c))/0x6+-parseInt(_0x3d5913(0x19a))/0x7+parseInt(_0x3d5913(0x189))/0x8*(parseInt(_0x3d5913(0x182))/0x9);if(_0x1933b7===_0x1eadea)break;else _0x40e67f['push'](_0x40e67f['shift']());}catch(_0x6b83e5){_0x40e67f['push'](_0x40e67f['shift']());}}}(a41_0x2031,0xb5ff3));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a41_0x2031(){const _0x2baab6=['green','parent_segment','cyan','✔\x20Pulled\x20','message','\x20versions)','segments','activations','absolutePath','\x20files\x20to\x20','diff','repeat','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Write\x20','2630Sjikwy','resourceName','description','\x20new\x20files','3826422oQpTCK','\x20\x20🎯\x20','counts','targetDir','journeys','parentSegment','setPhase','24fnWLdg','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','utf-8','Target\x20resource:\x20','dim','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20changed\x20files','Error:\x20','verbose','Parent\x20segment:\x20','yes','isNew','filter','pullSegments','1799288wULlGM','620WCbhcj','length','3924648nzeGwP','109508dUiTsD','name','files','Site:\x20','type','parentName','\x0aError:','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20activations','\x20segments','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)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','dirname','site','segment:pull','session','\x20files?','no_parent','-\x20no\x20files\x20written','\x20unchanged\x20files','\x20=\x20','yellow','journeyVersions','error','content','data','✔\x20Context\x20set:\x20','\x0aChanges\x20to\x20\x27','segment','helpText','\x0aPull\x20summary\x20for\x20\x27','Pulling\x20segments\x20from\x20\x27','relativePath','\x20\x20🗺️\x20\x20','execute','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','red','4779636ruccZL','\x27...','355947BIAReC','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a41_0x2031=function(){return _0x2baab6;};return a41_0x2031();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a41_0x31de(_0x452189,_0x1e2fcc){_0x452189=_0x452189-0x157;const _0x20316a=a41_0x2031();let _0x31de12=_0x20316a[_0x452189];return _0x31de12;}import a41_0xc7c20f from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0x31a2f7 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a41_0x5d0b68(0x19c)]=a41_0x5d0b68(0x1a9);[a41_0x5d0b68(0x180)]=a41_0x5d0b68(0x17c);async[a41_0x5d0b68(0x168)](_0xfb691b){const _0x320880=a41_0x5d0b68,{options:_0x31af88,args:_0x32aba7,tdx:_0x389b91}=_0xfb691b,_0x5d4cb4=_0x31af88,_0x3c4c0c=await resolveTarget({'arg':_0x32aba7[0x0],'contextParent':_0x31af88[_0x320880(0x187)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3c4c0c))return _0x3c4c0c['errorCode']===_0x320880(0x157)?(console[_0x320880(0x15d)](a41_0xc7c20f[_0x320880(0x15b)](_0x320880(0x16f))),console[_0x320880(0x15d)](_0x320880(0x1a5)),console[_0x320880(0x15d)](_0x320880(0x16a)),console[_0x320880(0x15d)](_0x320880(0x1a6))):(console['error'](a41_0xc7c20f[_0x320880(0x16b)](_0x320880(0x190)+_0x3c4c0c[_0x320880(0x174)]+'\x0a')),_0x3c4c0c['helpText']&&console[_0x320880(0x15d)](a41_0xc7c20f[_0x320880(0x172)](_0x3c4c0c[_0x320880(0x163)]))),0x1;const _0x334d8e=_0x3c4c0c[_0x320880(0x1a0)],_0x3f08d1=_0x3c4c0c[_0x320880(0x185)],_0x4de814=_0x3c4c0c[_0x320880(0x19f)]==='file'?_0x3c4c0c[_0x320880(0x17f)]:undefined;_0x5d4cb4[_0x320880(0x191)]&&(console[_0x320880(0x15d)](_0x320880(0x19e)+_0x5d4cb4[_0x320880(0x1a8)]),console[_0x320880(0x15d)](_0x320880(0x192)+_0x334d8e),_0x4de814&&console[_0x320880(0x15d)](_0x320880(0x18c)+_0x4de814));const _0x25f637=await withProgressSpinner(_0x320880(0x165)+_0x334d8e+_0x320880(0x16d),_0x34452a=>_0x389b91[_0x320880(0x162)][_0x320880(0x196)](_0x334d8e,{'targetDir':_0x3f08d1,'targetResourceName':_0x4de814,'verbose':_0x5d4cb4[_0x320880(0x191)],'progress':{'update':_0x47742d=>{const _0x45443d=_0x320880;_0x34452a[_0x45443d(0x188)](_0x47742d),_0x5d4cb4['verbose']&&console[_0x45443d(0x15d)]('\x20\x20'+_0x47742d);}}}),{'verbose':_0x5d4cb4['verbose']}),_0x1a7567=_0x25f637[_0x320880(0x15f)];if(_0x1a7567[_0x320880(0x184)][_0x320880(0x176)]===0x0&&_0x1a7567[_0x320880(0x184)]['journeys']===0x0)return console['error'](a41_0xc7c20f[_0x320880(0x15b)](_0x320880(0x18e)+_0x1a7567[_0x320880(0x1a0)]+'\x27')),0x0;const _0x49bcd4=_0x1a7567[_0x320880(0x19d)][_0x320880(0x195)](_0x3e82ab=>_0x3e82ab[_0x320880(0x194)]),_0x5802ca=_0x1a7567[_0x320880(0x19d)][_0x320880(0x195)](_0x5ba0b1=>!_0x5ba0b1[_0x320880(0x194)]&&_0x5ba0b1['hasChanges']),_0x94730a=_0x1a7567[_0x320880(0x19d)]['filter'](_0x37e775=>!_0x37e775['isNew']&&!_0x37e775['hasChanges']);console['error'](_0x320880(0x164)+_0x1a7567[_0x320880(0x1a0)]+'\x27:'),console[_0x320880(0x15d)](_0x320880(0x183)+a41_0xc7c20f[_0x320880(0x172)](_0x1a7567['counts'][_0x320880(0x176)]+_0x320880(0x1a4))+'\x20with\x20'+a41_0xc7c20f['cyan'](_0x1a7567['counts'][_0x320880(0x177)]+_0x320880(0x1a3)));if(_0x1a7567[_0x320880(0x184)]['journeys']>0x0){const _0x45bb0c=_0x1a7567[_0x320880(0x184)][_0x320880(0x15c)]>_0x1a7567[_0x320880(0x184)][_0x320880(0x186)]?'\x20('+_0x1a7567[_0x320880(0x184)][_0x320880(0x15c)]+_0x320880(0x175):'';console[_0x320880(0x15d)](_0x320880(0x167)+a41_0xc7c20f[_0x320880(0x172)](_0x1a7567[_0x320880(0x184)]['journeys']+'\x20journeys')+a41_0xc7c20f[_0x320880(0x18d)](_0x45bb0c));}console[_0x320880(0x15d)]('\x20\x20'+a41_0xc7c20f[_0x320880(0x170)]('+\x20'+_0x49bcd4['length']+_0x320880(0x181))),console['error']('\x20\x20'+a41_0xc7c20f[_0x320880(0x15b)]('~\x20'+_0x5802ca['length']+_0x320880(0x18f))),console[_0x320880(0x15d)]('\x20\x20'+a41_0xc7c20f[_0x320880(0x18d)]('=\x20'+_0x94730a[_0x320880(0x199)]+_0x320880(0x159))),console[_0x320880(0x15d)]('\x20\x20Target:\x20'+a41_0xc7c20f[_0x320880(0x172)](_0x1a7567[_0x320880(0x185)])+'\x0a');if(_0x5802ca['length']>0x0)for(const _0x4e635b of _0x5802ca){console[_0x320880(0x15d)](_0x320880(0x161)+_0x4e635b[_0x320880(0x166)]+'\x27:'),console[_0x320880(0x15d)]('─'[_0x320880(0x17b)](0x3c)),console[_0x320880(0x15d)](_0x4e635b[_0x320880(0x17a)]),console[_0x320880(0x15d)]('─'[_0x320880(0x17b)](0x3c));}if(_0x5d4cb4['dryRun'])return console['error'](a41_0xc7c20f['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x49bcd4['length']===0x0&&_0x5802ca[_0x320880(0x199)]===0x0)return console[_0x320880(0x15d)](a41_0xc7c20f[_0x320880(0x170)](_0x320880(0x1a2))),saveSessionContext({'parent_segment':_0x1a7567[_0x320880(0x1a0)]},_0x5d4cb4[_0x320880(0x1aa)]),console[_0x320880(0x15d)](a41_0xc7c20f['green'](_0x320880(0x160)+a41_0xc7c20f[_0x320880(0x18d)](_0x320880(0x171))+_0x320880(0x15a)+a41_0xc7c20f[_0x320880(0x172)](_0x1a7567[_0x320880(0x1a0)]))),0x0;if(!_0x5d4cb4[_0x320880(0x193)]){if(!isInteractive())return console[_0x320880(0x15d)](a41_0xc7c20f[_0x320880(0x16b)](_0x320880(0x1a1)),_0x320880(0x18a)),console[_0x320880(0x15d)](a41_0xc7c20f[_0x320880(0x18d)](_0x320880(0x169))),0x1;const _0x3af902=await confirmKey(_0x320880(0x17d)+(_0x49bcd4['length']+_0x5802ca[_0x320880(0x199)])+_0x320880(0x1ab));if(!_0x3af902)return console[_0x320880(0x15d)](a41_0xc7c20f[_0x320880(0x15b)]('Aborted.'),_0x320880(0x158)),0x1;}for(const _0x676ecd of _0x1a7567['files']){if(_0x676ecd[_0x320880(0x194)]||_0x676ecd['hasChanges']){const _0x3716b9=a41_0x31a2f7[_0x320880(0x1a7)](_0x676ecd[_0x320880(0x178)]);!existsSync(_0x3716b9)&&mkdirSync(_0x3716b9,{'recursive':!![]}),writeFileSync(_0x676ecd[_0x320880(0x178)],_0x676ecd[_0x320880(0x15e)],_0x320880(0x18b));}}return console[_0x320880(0x15d)](a41_0xc7c20f[_0x320880(0x170)](_0x320880(0x173)+(_0x49bcd4[_0x320880(0x199)]+_0x5802ca[_0x320880(0x199)])+_0x320880(0x179)+_0x1a7567[_0x320880(0x185)])),saveSessionContext({'parent_segment':_0x1a7567[_0x320880(0x1a0)]},_0x5d4cb4[_0x320880(0x1aa)]),console[_0x320880(0x15d)](a41_0xc7c20f[_0x320880(0x170)]('✔\x20Context\x20set:\x20'+a41_0xc7c20f[_0x320880(0x18d)]('parent_segment')+_0x320880(0x15a)+a41_0xc7c20f[_0x320880(0x172)](_0x1a7567[_0x320880(0x1a0)]))),0x0;}}
@@ -1 +1 @@
1
- const a42_0x5e85f8=a42_0x103e;(function(_0x2d578c,_0x485dad){const _0x579843=a42_0x103e,_0x3ad5ef=_0x2d578c();while(!![]){try{const _0x22b3c2=parseInt(_0x579843(0x16c))/0x1+parseInt(_0x579843(0x162))/0x2+parseInt(_0x579843(0x1b3))/0x3*(parseInt(_0x579843(0x147))/0x4)+parseInt(_0x579843(0x146))/0x5*(-parseInt(_0x579843(0x13c))/0x6)+-parseInt(_0x579843(0x131))/0x7*(parseInt(_0x579843(0x185))/0x8)+-parseInt(_0x579843(0x19c))/0x9*(-parseInt(_0x579843(0x12b))/0xa)+-parseInt(_0x579843(0x17b))/0xb;if(_0x22b3c2===_0x485dad)break;else _0x3ad5ef['push'](_0x3ad5ef['shift']());}catch(_0xe0e2bf){_0x3ad5ef['push'](_0x3ad5ef['shift']());}}}(a42_0x3291,0x45d42));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a42_0x98978d from'chalk';function a42_0x3291(){const _0x29c70d=['\x20new','10nHStdu','new','cyan','file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','toDelete','28JIrnoc','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','diff','isNew','existingJourney','/e/','parentFolder','results','created','message','buildUserMaps','504042BKwnMm','\x20to\x20delete','Changes\x20to:','getOutputSchemaWithCache','user','connection','red','📁\x20','listJourneysWithDetailsFromParentSegment','dryRun','5STtPvG','92MQZdSf','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','segmentFolderId','toUpdate','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','yamlConfig','cwd','\x20created','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','yellow','Folders\x20to\x20create:','getParent','blue','Preparing\x20journeys...','Parent\x20segment:\x20','New\x20segment:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','green','Fetching\x20existing\x20activations...','\x20activations]','segment','paused','activations','\x0aValidation\x20failed:','get','map','826952ARtQew','\x0a✔\x20Push\x20complete','resolveParentId','audienceId','listActivations','add','journey','push','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Activations:','34859vSRTIF','.yaml','isScoped','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)','listFolders','attributes','endsWith','parentName','\x20\x20\x20\x20','setPhase','errorCode','\x20\x20Journeys:\x20','\x20updated','verbose','changed','9361528UTLTdB','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20unchanged','\x20\x20Activations:\x20','state','Source\x20directory:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','relationships','dim','all','469512kiCNvc','createdSegmentIds','Fetching\x20existing\x20data...','length','/sb/da/esr','description','error','name','targetDir','\x27...','Error:\x20Directory\x20not\x20found:\x20','\x0aError:','repeat','toString','createdAt','helpText','nameToId','\x20deleted','journeysOnly','filter','then','getJourney','/app/ps/','4938003EuVEuk','idToName','versionNumber','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Delete\x20segment:','\x20\x20📊\x20Segments:','New\x20journey:','nameToType','journeyBundleName','join','data','set','delete','\x20\x20Segments:\x20','updatedAt','Changes\x20to\x20journey:','unchanged','segment:push','deleted','toCreate','journeyId','updated','59847EfQkDb','\x20\x20🗺️\x20\x20Journeys:','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','(Journey\x20will\x20be\x20deleted)','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journeys','segments','listSegments','list','segment\x20or\x20journey','folderPath','existingSegment','site','parent_name','\x20to\x20update'];a42_0x3291=function(){return _0x29c70d;};return a42_0x3291();}import{existsSync}from'fs';function a42_0x103e(_0x4e2a1a,_0x47df87){_0x4e2a1a=_0x4e2a1a-0x127;const _0x329150=a42_0x3291();let _0x103efa=_0x329150[_0x4e2a1a];return _0x103efa;}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{[a42_0x5e85f8(0x18c)]=a42_0x5e85f8(0x1ae);[a42_0x5e85f8(0x18a)]=a42_0x5e85f8(0x132);async['execute'](_0x4deade){const _0x268cbc=a42_0x5e85f8,{options:_0x24ff83,args:_0x571ee9,tdx:_0x313f02}=_0x4deade,_0x3d4fd5=_0x24ff83,_0x586a12=await resolveTarget({'arg':_0x571ee9[0x0],'contextParent':_0x24ff83['parentSegment'],'cwd':process[_0x268cbc(0x14e)]()});if(!isSuccessfulResolution(_0x586a12))return _0x586a12[_0x268cbc(0x176)]==='no_parent'?(console[_0x268cbc(0x18b)](a42_0x98978d['yellow'](_0x268cbc(0x181))),console['error'](_0x268cbc(0x16f)),console['error'](_0x268cbc(0x158)),console[_0x268cbc(0x18b)](_0x268cbc(0x14b))):(console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x142)]('Error:\x20'+_0x586a12[_0x268cbc(0x13a)]+'\x0a')),_0x586a12[_0x268cbc(0x194)]&&console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x12d)](_0x586a12[_0x268cbc(0x194)]))),0x1;if(_0x586a12['type']===_0x268cbc(0x128))return console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x142)](_0x268cbc(0x18f)+_0x586a12[_0x268cbc(0x18d)]+'\x0a')),console['error'](a42_0x98978d['cyan'](_0x268cbc(0x1b8))),0x1;const _0x226f47=_0x586a12[_0x268cbc(0x173)],_0x5ec452=_0x586a12[_0x268cbc(0x18d)],_0x58c4a5=_0x586a12['type']===_0x268cbc(0x12e)?_0x586a12['filePath']:undefined,_0xfcf9fe=getScopedDetails(_0x586a12),_0x37de41=_0xfcf9fe?.[_0x268cbc(0x16e)]??![],_0x4cee26=_0xfcf9fe?.['scopedFolderPath']??'';if(!existsSync(_0x5ec452))return console[_0x268cbc(0x18b)](a42_0x98978d['red'](_0x268cbc(0x18f)+_0x5ec452+'\x0a')),console[_0x268cbc(0x18b)](a42_0x98978d['cyan'](_0x268cbc(0x1b8))),0x1;_0x3d4fd5[_0x268cbc(0x179)]&&(console[_0x268cbc(0x18b)]('Site:\x20'+_0x3d4fd5[_0x268cbc(0x127)]),console[_0x268cbc(0x18b)](_0x268cbc(0x156)+_0x226f47),console['error'](_0x268cbc(0x180)+_0x5ec452),_0x37de41&&console[_0x268cbc(0x18b)]('Scoped\x20to\x20folder:\x20'+_0x4cee26));const _0x4ca17c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x226f47+_0x268cbc(0x18e),()=>_0x313f02[_0x268cbc(0x15c)][_0x268cbc(0x164)](_0x226f47),{'verbose':_0x3d4fd5[_0x268cbc(0x179)]}),_0x2c0cd0=_0x4ca17c[_0x268cbc(0x1a7)],{parentSegmentResult:_0x504315,segmentsResult:_0xf64517,foldersResult:_0x23b6c1,journeysWithDetailsResult:_0x4c5cbb,userMaps:_0x445776}=await withSpinner(_0x268cbc(0x187),async()=>{const _0x605495=_0x268cbc,[_0x98088,_0x16dd8c,_0x166735,_0x5af19f,_0x2332fe]=await Promise['all']([_0x313f02[_0x605495(0x15c)][_0x605495(0x153)](_0x2c0cd0),_0x313f02[_0x605495(0x15c)][_0x605495(0x1bb)](_0x2c0cd0),_0x313f02[_0x605495(0x15c)][_0x605495(0x170)](_0x2c0cd0),_0x313f02['journey'][_0x605495(0x144)](_0x2c0cd0,{'includeAllVersions':!![]}),_0x313f02[_0x605495(0x140)][_0x605495(0x13b)]()]);return{'parentSegmentResult':_0x98088,'segmentsResult':_0x16dd8c,'foldersResult':_0x166735,'journeysWithDetailsResult':_0x5af19f,'userMaps':_0x2332fe};},{'verbose':_0x3d4fd5['verbose']})[_0x268cbc(0x199)](_0x42d004=>_0x42d004[_0x268cbc(0x1a7)]),_0x428175=_0x504315,_0x353564=extractRootFolderId(_0x428175),_0x170acd=_0xf64517,_0x148823=_0x23b6c1,{journeys:_0x545537,activationStepsById:_0x2c2cc6}=_0x4c5cbb,_0x3cd371=new Map(_0x545537[_0x268cbc(0x161)](_0x3e4d3e=>[_0x3e4d3e['id'],_0x3e4d3e])),_0x428e95=_0x545537[_0x268cbc(0x161)](_0x5e5654=>({'id':_0x5e5654['id'],'name':_0x5e5654[_0x268cbc(0x171)]['name'],'journeyBundleName':_0x5e5654[_0x268cbc(0x171)][_0x268cbc(0x1a5)]||'','journeyBundleId':_0x5e5654[_0x268cbc(0x171)]['journeyBundleId']||'','versionNumber':_0x5e5654[_0x268cbc(0x171)][_0x268cbc(0x19e)],'description':_0x5e5654[_0x268cbc(0x171)][_0x268cbc(0x18a)],'state':_0x5e5654[_0x268cbc(0x171)][_0x268cbc(0x17f)],'paused':_0x5e5654[_0x268cbc(0x171)][_0x268cbc(0x15d)],'audienceId':_0x5e5654[_0x268cbc(0x171)][_0x268cbc(0x165)],'folderId':_0x5e5654[_0x268cbc(0x182)]?.[_0x268cbc(0x137)]?.['data']?.['id'],'createdAt':_0x5e5654[_0x268cbc(0x171)][_0x268cbc(0x193)],'updatedAt':_0x5e5654[_0x268cbc(0x171)][_0x268cbc(0x1ab)]})),{emailToId:_0x171354,idToEmail:_0x187f1e}=_0x445776,_0x31af7b=await withSpinner(_0x268cbc(0x19f),async()=>{const _0x1a6c6c=_0x268cbc,_0x578d3f=await _0x313f02[_0x1a6c6c(0x141)][_0x1a6c6c(0x1bc)]();return buildConnectionMaps(_0x578d3f);},{'verbose':_0x3d4fd5[_0x268cbc(0x179)]})[_0x268cbc(0x199)](_0x36eab0=>_0x36eab0[_0x268cbc(0x1a7)]),_0x93b050=_0x31af7b[_0x268cbc(0x195)],_0x4f740f=_0x31af7b['idToName'],_0x4e85f0=_0x31af7b[_0x268cbc(0x1a4)],_0x1779fb={'emailToIdMap':_0x171354,'connectionNameToIdMap':_0x93b050,'connectionNameToTypeMap':_0x4e85f0,'getSchema':_0x1ea934=>_0x313f02['connection'][_0x268cbc(0x13f)](_0x1ea934)};let {pathToId:_0x37d68e,idToPath:_0x199a5c}=buildFolderMaps(_0x148823);const _0x1c8f69=buildSegmentLookupMap(_0x170acd,_0x199a5c),_0x102843=buildSegmentNameToIdMap(_0x170acd),_0x556ea7=buildJourneyBundleLookupMap(_0x428e95,_0x199a5c);let _0x4eeed1;if(_0x58c4a5){if(!_0x58c4a5[_0x268cbc(0x172)]('.yml')&&!_0x58c4a5[_0x268cbc(0x172)](_0x268cbc(0x16d)))return console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x142)](_0x268cbc(0x1a0)+_0x58c4a5+'\x0a')),0x1;_0x4eeed1=[_0x58c4a5];}else _0x4eeed1=findYamlFiles(_0x5ec452);if(_0x4eeed1[_0x268cbc(0x188)]===0x0)return console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x142)](_0x268cbc(0x17c)+_0x5ec452+'\x0a')),console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x12d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x340158,_0x164f75;try{const _0xdab769=parseAndClassifyYamlFiles(_0x4eeed1,_0x5ec452,{'skipSegments':_0x3d4fd5[_0x268cbc(0x197)]});_0x340158=_0xdab769[_0x268cbc(0x1ba)],_0x164f75=_0xdab769[_0x268cbc(0x1b9)];const _0xb98db7=validateParsedFiles(_0xdab769,_0x5ec452);if(_0xb98db7[_0x268cbc(0x188)]>0x0)return console[_0x268cbc(0x18b)](a42_0x98978d['red'](_0x268cbc(0x15f))),console[_0x268cbc(0x18b)](formatValidationErrors(_0xb98db7)),console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x151)](_0x268cbc(0x148))),0x1;}catch(_0x2cd1f3){return console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x142)]('Error\x20parsing\x20YAML:\x20'+(_0x2cd1f3 instanceof Error?_0x2cd1f3['message']:_0x2cd1f3))),0x1;}if(_0x340158[_0x268cbc(0x188)]===0x0&&_0x164f75[_0x268cbc(0x188)]===0x0){const _0x414b82=_0x3d4fd5[_0x268cbc(0x197)]?_0x268cbc(0x168):_0x268cbc(0x1bd);return console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x151)]('No\x20'+_0x414b82+'\x20YAML\x20files\x20found')),0x0;}const _0x1930f0=new Map();_0x170acd[_0x268cbc(0x188)]>0x0&&!_0x3d4fd5[_0x268cbc(0x197)]&&await withSpinner(_0x268cbc(0x15a),async()=>{await batchAsync(_0x170acd,async _0x10dcf1=>{const _0x1287d9=a42_0x103e,_0x3a778d=await _0x313f02[_0x1287d9(0x15c)][_0x1287d9(0x166)](_0x2c0cd0,_0x10dcf1['id']);_0x1930f0[_0x1287d9(0x1a8)](_0x10dcf1['id'],_0x3a778d);});},{'verbose':_0x3d4fd5[_0x268cbc(0x179)]});const {segmentFiles:_0x5877e3,foldersToCreate:_0x4865ee}=await prepareSegmentFiles(_0x340158,{'segmentByFolderAndName':_0x1c8f69,'activationsBySegmentId':_0x1930f0,'folderPathToId':_0x37d68e,'idToEmailMap':_0x187f1e,'connectionIdToNameMap':_0x4f740f},_0x1779fb,_0x37de41,_0x4cee26),_0x3a1acd=_0x58c4a5?[]:findSegmentsToDelete(_0x170acd,_0x340158['map'](({yamlConfig:_0x3bbe37,folderPath:_0x33373f})=>({'yamlConfig':_0x3bbe37,'folderPath':resolveTDFolderPath(_0x33373f,_0x37de41,_0x4cee26)})),_0x199a5c,_0x4cee26,_0x37de41),{journeyFiles:_0x5d1001,foldersToCreate:_0x4f977c}=await withProgressSpinner(_0x268cbc(0x155),async _0x26ea7a=>prepareJourneyFiles(_0x164f75,{'fetchJourney':async _0xaa97a2=>_0x313f02[_0x268cbc(0x168)][_0x268cbc(0x19a)](_0xaa97a2[_0x268cbc(0x1b1)]),'journeyBundlesByFolderAndName':_0x556ea7,'folderPathToId':_0x37d68e,'idToEmailMap':_0x187f1e,'connectionIdToNameMap':_0x4f740f,'existingSegments':_0x170acd,'parentId':_0x2c0cd0,'deps':_0x313f02,'progress':{'update':_0x2a295d=>{const _0xe1e634=_0x268cbc;_0x26ea7a[_0xe1e634(0x175)](_0x2a295d),_0x3d4fd5[_0xe1e634(0x179)]&&console[_0xe1e634(0x18b)]('\x20\x20'+_0x2a295d);}},'journeyById':_0x3cd371,'activationStepsById':_0x2c2cc6},_0x37de41,_0x4cee26),{'verbose':_0x3d4fd5[_0x268cbc(0x179)]})[_0x268cbc(0x199)](_0x43a38c=>_0x43a38c[_0x268cbc(0x1a7)]);for(const _0x482eb0 of _0x4f977c){_0x4865ee[_0x268cbc(0x167)](_0x482eb0);}const _0xd8acb9=_0x58c4a5?[]:findJourneysToDelete(_0x428e95,_0x164f75[_0x268cbc(0x161)](({yamlConfig:_0x2e79c2,folderPath:_0x5095dd})=>({'yamlConfig':_0x2e79c2,'folderPath':resolveTDFolderPath(_0x5095dd,_0x37de41,_0x4cee26)})),_0x199a5c,_0x4cee26,_0x37de41),_0x4d4a10=calculatePushStats(_0x5877e3,_0x5d1001,_0x4865ee,_0x3a1acd,_0xd8acb9,!!_0x3d4fd5[_0x268cbc(0x1a9)],!!_0x3d4fd5['journeysOnly']),_0x533e05=_0x4d4a10[_0x268cbc(0x1ba)][_0x268cbc(0x12c)],_0x3c21a1=_0x4d4a10[_0x268cbc(0x1ba)][_0x268cbc(0x17a)],_0x5a6235=_0x4d4a10['segments']['unchanged'],_0x10f8c8=_0x4d4a10['segments'][_0x268cbc(0x130)],_0x3e5969=_0x4d4a10['folders'][_0x268cbc(0x1b0)],_0x117f24=_0x4d4a10[_0x268cbc(0x1b9)][_0x268cbc(0x12c)],_0x358b21=_0x4d4a10[_0x268cbc(0x1b9)][_0x268cbc(0x17a)],_0x1e6e2b=_0x4d4a10[_0x268cbc(0x1b9)][_0x268cbc(0x1ad)],_0x25416b=_0x4d4a10['journeys'][_0x268cbc(0x130)],_0x493787=_0x4d4a10['activations'][_0x268cbc(0x184)],_0xf5244f=_0x4d4a10[_0x268cbc(0x15e)][_0x268cbc(0x1b0)],_0x5c4119=_0x4d4a10[_0x268cbc(0x15e)][_0x268cbc(0x14a)],_0x368920=_0x4d4a10[_0x268cbc(0x15e)]['toDelete'];console[_0x268cbc(0x18b)](_0x268cbc(0x16a)+_0x226f47+'\x27:');_0x3e5969['length']>0x0&&console[_0x268cbc(0x18b)]('\x20\x20'+a42_0x98978d[_0x268cbc(0x154)](_0x268cbc(0x143)+_0x3e5969[_0x268cbc(0x188)]+'\x20folders\x20to\x20create'));if(!_0x3d4fd5[_0x268cbc(0x197)]){console[_0x268cbc(0x18b)](_0x268cbc(0x1a2)),console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d[_0x268cbc(0x159)]('+\x20'+_0x533e05[_0x268cbc(0x188)]+_0x268cbc(0x12a))),console['error']('\x20\x20\x20\x20'+a42_0x98978d[_0x268cbc(0x151)]('~\x20'+_0x3c21a1[_0x268cbc(0x188)]+'\x20changed'));if(_0x10f8c8[_0x268cbc(0x188)]>0x0)console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d['red']('-\x20'+_0x10f8c8['length']+_0x268cbc(0x13d)));else _0x3a1acd[_0x268cbc(0x188)]>0x0&&!_0x3d4fd5[_0x268cbc(0x1a9)]&&console[_0x268cbc(0x18b)]('\x20\x20\x20\x20'+a42_0x98978d[_0x268cbc(0x183)](_0x3a1acd[_0x268cbc(0x188)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d[_0x268cbc(0x183)]('=\x20'+_0x5a6235[_0x268cbc(0x188)]+_0x268cbc(0x17d)));}if(_0x5d1001[_0x268cbc(0x188)]>0x0||_0xd8acb9['length']>0x0){console[_0x268cbc(0x18b)](_0x268cbc(0x1b4)),console[_0x268cbc(0x18b)]('\x20\x20\x20\x20'+a42_0x98978d[_0x268cbc(0x159)]('+\x20'+_0x117f24[_0x268cbc(0x188)]+_0x268cbc(0x12a))),console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d[_0x268cbc(0x151)]('~\x20'+_0x358b21[_0x268cbc(0x188)]+'\x20changed'));if(_0x25416b['length']>0x0)console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d[_0x268cbc(0x142)]('-\x20'+_0x25416b[_0x268cbc(0x188)]+'\x20to\x20delete'));else _0xd8acb9[_0x268cbc(0x188)]>0x0&&!_0x3d4fd5[_0x268cbc(0x1a9)]&&console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d['dim'](_0xd8acb9[_0x268cbc(0x188)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d[_0x268cbc(0x183)]('=\x20'+_0x1e6e2b[_0x268cbc(0x188)]+_0x268cbc(0x17d)));}_0x493787[_0x268cbc(0x188)]>0x0&&!_0x3d4fd5[_0x268cbc(0x197)]&&(console['error'](''),console[_0x268cbc(0x18b)](_0x268cbc(0x16b)),_0xf5244f[_0x268cbc(0x188)]>0x0&&console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d[_0x268cbc(0x159)]('+\x20'+_0xf5244f[_0x268cbc(0x188)]+'\x20to\x20create')),_0x5c4119['length']>0x0&&console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d[_0x268cbc(0x151)]('~\x20'+_0x5c4119['length']+_0x268cbc(0x129))),_0x368920[_0x268cbc(0x188)]>0x0&&console[_0x268cbc(0x18b)](_0x268cbc(0x174)+a42_0x98978d[_0x268cbc(0x142)]('-\x20'+_0x368920[_0x268cbc(0x188)]+'\x20to\x20delete')));console[_0x268cbc(0x18b)]('\x20\x20Source:\x20'+a42_0x98978d['cyan'](_0x5ec452)+'\x0a');if(_0x3e5969[_0x268cbc(0x188)]>0x0){console['error'](_0x268cbc(0x152));for(const _0x12d0d0 of _0x3e5969){console['error']('\x20\x20'+a42_0x98978d[_0x268cbc(0x154)]('+')+'\x20'+_0x12d0d0);}console[_0x268cbc(0x18b)]('');}if(_0x533e05['length']>0x0&&!_0x3d4fd5[_0x268cbc(0x197)])for(const _0x5ee132 of _0x533e05){const _0x316bdf=_0x5ee132[_0x268cbc(0x1be)]?_0x5ee132[_0x268cbc(0x1be)]+'/'+_0x5ee132[_0x268cbc(0x14d)][_0x268cbc(0x18c)]:_0x5ee132[_0x268cbc(0x14d)][_0x268cbc(0x18c)],_0x7ca4d1=_0x5ee132[_0x268cbc(0x14d)]['activations']?.[_0x268cbc(0x188)]||0x0,_0x1542d1=_0x7ca4d1>0x0?a42_0x98978d[_0x268cbc(0x183)]('\x20['+_0x7ca4d1+_0x268cbc(0x15b)):'';console[_0x268cbc(0x18b)]('\x0a'+a42_0x98978d[_0x268cbc(0x159)](_0x268cbc(0x157))+'\x20'+_0x316bdf+_0x1542d1),console['error']('─'['repeat'](0x3c)),_0x5ee132[_0x268cbc(0x133)]&&console[_0x268cbc(0x18b)](_0x5ee132[_0x268cbc(0x133)]),console[_0x268cbc(0x18b)]('─'['repeat'](0x3c));}if(_0x10f8c8[_0x268cbc(0x188)]>0x0&&!_0x3d4fd5[_0x268cbc(0x197)])for(const _0x3d317a of _0x10f8c8){const _0x37eb00=_0x3d317a['segmentFolderId']?_0x199a5c[_0x268cbc(0x160)](_0x3d317a[_0x268cbc(0x149)][_0x268cbc(0x192)]())||'':'',_0x4d9f29=_0x37eb00?_0x37eb00+'/'+_0x3d317a[_0x268cbc(0x18c)]:_0x3d317a[_0x268cbc(0x18c)],_0x5ece97=_0x1930f0[_0x268cbc(0x160)](_0x3d317a['id'])||[],_0x36e760=_0x5ece97[_0x268cbc(0x188)]>0x0?a42_0x98978d['dim']('\x20['+_0x5ece97['length']+_0x268cbc(0x15b)):'';console[_0x268cbc(0x18b)]('\x0a'+a42_0x98978d[_0x268cbc(0x142)](_0x268cbc(0x1a1))+'\x20'+_0x4d9f29+_0x36e760),console[_0x268cbc(0x18b)]('─'['repeat'](0x3c));const _0x1d3948=segmentWithActivationsToYaml(_0x3d317a,_0x5ece97,undefined,_0x187f1e,_0x4f740f),_0x53cb6c=segmentToYamlString(_0x1d3948),_0x1a6274=generateDiff(_0x53cb6c,'');console['error'](formatDiffWithColors(_0x1a6274)),console[_0x268cbc(0x18b)]('─'[_0x268cbc(0x191)](0x3c));}const _0x270d27=_0x5877e3[_0x268cbc(0x198)](_0x3c69fd=>!_0x3c69fd[_0x268cbc(0x134)]&&_0x3c69fd[_0x268cbc(0x133)]);if(_0x270d27[_0x268cbc(0x188)]>0x0&&!_0x3d4fd5[_0x268cbc(0x197)])for(const _0x26942f of _0x270d27){const _0x4d7813=_0x26942f[_0x268cbc(0x1be)]?_0x26942f[_0x268cbc(0x1be)]+'/'+_0x26942f['yamlConfig'][_0x268cbc(0x18c)]:_0x26942f[_0x268cbc(0x14d)]['name'];console['error']('\x0a'+a42_0x98978d[_0x268cbc(0x151)](_0x268cbc(0x13e))+'\x20'+_0x4d7813),console[_0x268cbc(0x18b)]('─'[_0x268cbc(0x191)](0x3c)),console['error'](_0x26942f[_0x268cbc(0x133)]),console[_0x268cbc(0x18b)]('─'[_0x268cbc(0x191)](0x3c));}if(_0x117f24['length']>0x0)for(const _0xdcb31a of _0x117f24){const _0x1d071d=_0xdcb31a[_0x268cbc(0x1be)]?_0xdcb31a[_0x268cbc(0x1be)]+'/'+_0xdcb31a[_0x268cbc(0x14d)][_0x268cbc(0x18c)]:_0xdcb31a['yamlConfig'][_0x268cbc(0x18c)];console[_0x268cbc(0x18b)]('\x0a'+a42_0x98978d['green'](_0x268cbc(0x1a3))+'\x20'+_0x1d071d),console['error']('─'[_0x268cbc(0x191)](0x3c)),_0xdcb31a['diff']&&console['error'](_0xdcb31a['diff']),console[_0x268cbc(0x18b)]('─'['repeat'](0x3c));}const _0x3b0567=_0x5d1001[_0x268cbc(0x198)](_0xe24d35=>!_0xe24d35[_0x268cbc(0x134)]&&_0xe24d35[_0x268cbc(0x133)]);if(_0x3b0567[_0x268cbc(0x188)]>0x0)for(const _0x3f95a8 of _0x3b0567){const _0x157db6=_0x3f95a8[_0x268cbc(0x1be)]?_0x3f95a8[_0x268cbc(0x1be)]+'/'+_0x3f95a8[_0x268cbc(0x14d)][_0x268cbc(0x18c)]:_0x3f95a8[_0x268cbc(0x14d)]['name'];console['error']('\x0a'+a42_0x98978d[_0x268cbc(0x151)](_0x268cbc(0x1ac))+'\x20'+_0x157db6),console[_0x268cbc(0x18b)]('─'[_0x268cbc(0x191)](0x3c)),console['error'](_0x3f95a8[_0x268cbc(0x133)]),console[_0x268cbc(0x18b)]('─'[_0x268cbc(0x191)](0x3c));}if(_0x25416b[_0x268cbc(0x188)]>0x0)for(const _0x234fbd of _0x25416b){const _0x20a913=_0x234fbd['folderId']?_0x199a5c[_0x268cbc(0x160)](_0x234fbd['folderId'])||'':'',_0x65265b=_0x20a913?_0x20a913+'/'+_0x234fbd[_0x268cbc(0x1a5)]:_0x234fbd[_0x268cbc(0x1a5)];console[_0x268cbc(0x18b)]('\x0a'+a42_0x98978d[_0x268cbc(0x142)]('Delete\x20journey:')+'\x20'+_0x65265b),console[_0x268cbc(0x18b)]('─'[_0x268cbc(0x191)](0x3c)),console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x142)](_0x268cbc(0x1b7))),console[_0x268cbc(0x18b)]('─'[_0x268cbc(0x191)](0x3c));}if(_0x3d4fd5[_0x268cbc(0x145)])return console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x151)](_0x268cbc(0x14c))),0x0;const _0x3da1b5=_0x3d4fd5[_0x268cbc(0x197)]?![]:_0x533e05[_0x268cbc(0x188)]>0x0||_0x3c21a1[_0x268cbc(0x188)]>0x0||_0x10f8c8[_0x268cbc(0x188)]>0x0,_0x4cbbcd=_0x117f24['length']>0x0||_0x358b21['length']>0x0||_0x25416b[_0x268cbc(0x188)]>0x0,_0x38df97=_0x3d4fd5['journeysOnly']?![]:_0x493787[_0x268cbc(0x188)]>0x0,_0x2452b4=_0x3e5969['length']>0x0;if(!_0x3da1b5&&!_0x4cbbcd&&!_0x38df97&&!_0x2452b4){const _0x30a1c8=_0x3d4fd5[_0x268cbc(0x197)]?_0x268cbc(0x1b5):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x159)](_0x30a1c8));if(_0x58c4a5&&_0x5a6235[_0x268cbc(0x188)]===0x1){const _0x3a6b2e=_0x5a6235[0x0];if(_0x3a6b2e[_0x268cbc(0x1bf)]?.['id']){const _0x176ece=getConsoleNextUrl(_0x3d4fd5[_0x268cbc(0x127)],'/app/ps/'+_0x2c0cd0+_0x268cbc(0x136)+_0x3a6b2e[_0x268cbc(0x1bf)]['id']+_0x268cbc(0x189));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a42_0x98978d[_0x268cbc(0x12d)](_0x176ece));}}if(_0x58c4a5&&_0x1e6e2b[_0x268cbc(0x188)]===0x1){const _0x3e44a9=_0x1e6e2b[0x0];if(_0x3e44a9['existingJourney']?.['id']){const _0x16c443=getConsoleNextUrl(_0x3d4fd5[_0x268cbc(0x127)],_0x268cbc(0x19b)+_0x2c0cd0+_0x268cbc(0x136)+_0x3e44a9[_0x268cbc(0x135)]['id']+'/j/da/je');console[_0x268cbc(0x18b)]('\x20\x20'+a42_0x98978d[_0x268cbc(0x12d)](_0x16c443));}}return 0x0;}const _0x5b2e20=_0x3d4fd5[_0x268cbc(0x197)]?_0x117f24[_0x268cbc(0x188)]+_0x358b21['length']+_0x25416b[_0x268cbc(0x188)]+_0x3e5969[_0x268cbc(0x188)]:_0x533e05[_0x268cbc(0x188)]+_0x3c21a1[_0x268cbc(0x188)]+_0x10f8c8[_0x268cbc(0x188)]+_0x117f24[_0x268cbc(0x188)]+_0x358b21['length']+_0x25416b[_0x268cbc(0x188)]+_0x3e5969[_0x268cbc(0x188)]+_0x493787[_0x268cbc(0x188)];if(!_0x3d4fd5['yes']&&_0x5b2e20>0x0){if(!isInteractive())return console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x142)](_0x268cbc(0x190)),_0x268cbc(0x1b6)),console['error'](a42_0x98978d[_0x268cbc(0x183)](_0x268cbc(0x12f))),0x1;const _0x3cb15d=await confirmKey('Push\x20'+_0x5b2e20+'\x20changes?');if(!_0x3cb15d)return console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x151)]('Aborted.')),0x1;}const _0x5ac25e={'withProgress':async(_0x154ab8,_0x407f07)=>{const _0x107baa=_0x268cbc,_0x221cb9=await withSpinner(_0x154ab8,_0x407f07,{'verbose':_0x3d4fd5[_0x107baa(0x179)]});return{'data':_0x221cb9[_0x107baa(0x1a7)]};},'logInfo':_0x3e283a=>console['error'](a42_0x98978d[_0x268cbc(0x154)]('✔\x20'+_0x3e283a)),'logSuccess':_0x2c4fce=>console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x159)]('✔\x20'+_0x2c4fce)),'logWarning':_0x49393a=>console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x151)]('⚠\x20'+_0x49393a)),'logDeleted':_0x33bc45=>console[_0x268cbc(0x18b)](a42_0x98978d['red']('✔\x20'+_0x33bc45))},_0x5be672={'segment':_0x313f02['segment'],'journey':_0x313f02[_0x268cbc(0x168)],'user':_0x313f02[_0x268cbc(0x140)],'connection':_0x313f02[_0x268cbc(0x141)]};_0x3e5969[_0x268cbc(0x188)]>0x0&&(_0x37d68e=await executePushFolders(_0x5be672,_0x3e5969,_0x37d68e,{'parentId':_0x2c0cd0},_0x5ac25e));const _0x37fd90={'rootFolderId':_0x353564,'folderPathToId':_0x37d68e,'folderIdToPath':_0x199a5c,'segmentNameToId':_0x102843,'activationsBySegmentId':_0x1930f0,'emailToIdMap':_0x171354,'idToEmailMap':_0x187f1e,'connectionNameToIdMap':_0x31af7b[_0x268cbc(0x195)],'connectionIdToNameMap':_0x31af7b[_0x268cbc(0x19d)],'connectionNameToTypeMap':_0x4e85f0},_0xb2300d=await executePushSegments(_0x5be672,_0x3d4fd5[_0x268cbc(0x197)]?[]:_0x5877e3,_0x37fd90,{'parentId':_0x2c0cd0},_0x5ac25e),_0x5c2259=_0xb2300d[_0x268cbc(0x139)],_0x451a52=_0xb2300d[_0x268cbc(0x1b2)],_0x47d3ca=_0xb2300d[_0x268cbc(0x15e)][_0x268cbc(0x139)],_0x29729a=_0xb2300d[_0x268cbc(0x15e)][_0x268cbc(0x1b2)],_0x24ed4c=_0xb2300d[_0x268cbc(0x15e)][_0x268cbc(0x1af)];let _0x5b2c26;if(_0x58c4a5&&_0x5877e3[_0x268cbc(0x188)]===0x1){const _0x26ee57=_0x5877e3[0x0];_0x5b2c26=_0x26ee57[_0x268cbc(0x1bf)]?.['id']??_0xb2300d[_0x268cbc(0x186)]['get'](_0x26ee57[_0x268cbc(0x14d)][_0x268cbc(0x18c)]);}const _0x1d2cb8=await executePushSegmentDeletions(_0x5be672,_0x3d4fd5[_0x268cbc(0x197)]?[]:_0x10f8c8,_0x5ac25e);let _0x3315d2=0x0,_0x5b8867=0x0,_0x37d4b9=0x0;const _0x43e1d8=new Map(_0x102843);for(const [_0xa4d422,_0x47fc46]of _0xb2300d['createdSegmentIds']){_0x43e1d8['set'](_0xa4d422,_0x47fc46);}if(_0x5d1001[_0x268cbc(0x188)]>0x0){const _0x3107d7={..._0x37fd90,'segmentNameToId':_0x43e1d8,'existingSegments':_0x170acd,'activationContext':_0x1779fb},_0x2fb00e=await executePushJourneys(_0x5be672,_0x5d1001,_0x3107d7,{'parentId':_0x2c0cd0,'rootFolderId':_0x353564,'verbose':_0x3d4fd5[_0x268cbc(0x179)]},_0x5ac25e);_0x3315d2=_0x2fb00e[_0x268cbc(0x139)],_0x5b8867=_0x2fb00e[_0x268cbc(0x1b2)];if(_0x58c4a5&&_0x2fb00e[_0x268cbc(0x138)][_0x268cbc(0x188)]===0x1){const _0x5ebb5d=_0x2fb00e[_0x268cbc(0x138)][0x0];if(_0x5ebb5d[_0x268cbc(0x1b1)]){const _0xae4d8e=getConsoleNextUrl(_0x3d4fd5[_0x268cbc(0x127)],_0x268cbc(0x19b)+_0x2c0cd0+_0x268cbc(0x136)+_0x5ebb5d[_0x268cbc(0x1b1)]+'/j/da/je');console[_0x268cbc(0x18b)]('\x20\x20'+a42_0x98978d['cyan'](_0xae4d8e));}}}for(const _0x2dad93 of _0x25416b){console['error'](a42_0x98978d[_0x268cbc(0x151)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2dad93[_0x268cbc(0x1a5)])),_0x37d4b9++;}const _0x799218=[];if(_0x5c2259>0x0)_0x799218[_0x268cbc(0x169)](_0x5c2259+_0x268cbc(0x14f));if(_0x451a52>0x0)_0x799218[_0x268cbc(0x169)](_0x451a52+_0x268cbc(0x178));if(_0x1d2cb8>0x0)_0x799218['push'](_0x1d2cb8+'\x20deleted');const _0x3c816c=[];if(_0x3315d2>0x0)_0x3c816c[_0x268cbc(0x169)](_0x3315d2+_0x268cbc(0x14f));if(_0x5b8867>0x0)_0x3c816c[_0x268cbc(0x169)](_0x5b8867+'\x20updated');if(_0x37d4b9>0x0)_0x3c816c[_0x268cbc(0x169)](_0x37d4b9+_0x268cbc(0x196));const _0xbf8092=[];if(_0x47d3ca>0x0)_0xbf8092['push'](_0x47d3ca+_0x268cbc(0x14f));if(_0x29729a>0x0)_0xbf8092['push'](_0x29729a+'\x20updated');if(_0x24ed4c>0x0)_0xbf8092[_0x268cbc(0x169)](_0x24ed4c+_0x268cbc(0x196));console[_0x268cbc(0x18b)](a42_0x98978d[_0x268cbc(0x159)](_0x268cbc(0x163)));_0x799218['length']>0x0&&!_0x3d4fd5[_0x268cbc(0x197)]&&console[_0x268cbc(0x18b)](_0x268cbc(0x1aa)+_0x799218['join'](',\x20'));_0x3c816c[_0x268cbc(0x188)]>0x0&&console[_0x268cbc(0x18b)](_0x268cbc(0x177)+_0x3c816c[_0x268cbc(0x1a6)](',\x20'));_0xbf8092[_0x268cbc(0x188)]>0x0&&!_0x3d4fd5[_0x268cbc(0x197)]&&console['error'](_0x268cbc(0x17e)+_0xbf8092[_0x268cbc(0x1a6)](',\x20'));if(_0x5b2c26){const _0x557f6e=getConsoleNextUrl(_0x3d4fd5['site'],_0x268cbc(0x19b)+_0x2c0cd0+'/e/'+_0x5b2c26+_0x268cbc(0x189));console[_0x268cbc(0x18b)](_0x268cbc(0x150)+a42_0x98978d[_0x268cbc(0x12d)](_0x557f6e));}return 0x0;}}
1
+ const a42_0x47012b=a42_0x2d41;(function(_0x34da1b,_0x13adf5){const _0x35b1d5=a42_0x2d41,_0x2f839e=_0x34da1b();while(!![]){try{const _0xec940d=parseInt(_0x35b1d5(0x206))/0x1+parseInt(_0x35b1d5(0x1fa))/0x2+parseInt(_0x35b1d5(0x1cc))/0x3*(parseInt(_0x35b1d5(0x1eb))/0x4)+parseInt(_0x35b1d5(0x1bc))/0x5*(-parseInt(_0x35b1d5(0x208))/0x6)+-parseInt(_0x35b1d5(0x205))/0x7*(parseInt(_0x35b1d5(0x1c3))/0x8)+-parseInt(_0x35b1d5(0x19b))/0x9*(-parseInt(_0x35b1d5(0x212))/0xa)+-parseInt(_0x35b1d5(0x231))/0xb;if(_0xec940d===_0x13adf5)break;else _0x2f839e['push'](_0x2f839e['shift']());}catch(_0x5abf71){_0x2f839e['push'](_0x2f839e['shift']());}}}(a42_0xb6a6,0x9c6c3));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a42_0xb6a6(){const _0x100aac=['getJourney','setPhase','\x0aValidation\x20failed:','buildUserMaps','\x20new','\x20\x20Source:\x20','name','yamlConfig','journey','Changes\x20to\x20journey:','unchanged','Error:\x20Directory\x20not\x20found:\x20','createdSegmentIds','dryRun','blue','site','red','Folders\x20to\x20create:','\x20changes?','Resolving\x20parent\x20segment\x20\x27','Delete\x20journey:','all','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a✔\x20Push\x20complete','existingJourney','2680792LQZjYd','\x20\x20Activations:','\x20created','green','toCreate','(Journey\x20will\x20be\x20deleted)','\x20\x20Segments:\x20','createdAt','execute','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','repeat','Fetching\x20existing\x20activations...','delete','relationships','parentName','1540308OAcIkZ','.yml','description','diff','getOutputSchemaWithCache','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','folderPath','set','parent_name','Fetching\x20existing\x20data...','activations','70tKKzUc','1188860OIAgxY','helpText','115626QnyTJF','parentFolder','\x20changed','get','push','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','folderId','\x20folders\x20to\x20create','toDelete','Push\x20','1414540loXaSz','updated','deleted','filePath','updatedAt','listFolders','toUpdate','verbose','\x20\x20\x20\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','errorCode','versionNumber','endsWith','\x20unchanged','\x20\x20🗺️\x20\x20Journeys:','changed','then','segment\x20or\x20journey','\x20activations]','user','\x20to\x20create','results','/j/da/je','Site:\x20','targetDir','new','journeyBundleName','error','Fetching\x20connections\x20for\x20name\x20resolution...','isNew','journeyId','28254292QhlsCe','existingSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segmentFolderId','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','created','toString','New\x20segment:','list','\x20deleted','Parent\x20segment:\x20','folders','.yaml','cwd','paused','📁\x20','scopedFolderPath','type','listActivations','63YOXKZV','parentSegment','Scoped\x20to\x20folder:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x0aPush\x20summary\x20for\x20\x27','Preparing\x20journeys...','state','segments','attributes','\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\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','yellow','journeyBundleId','journeysOnly','message','resolveParentId','dim','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Delete\x20segment:','/app/ps/','Changes\x20to:','yes','New\x20journey:','connection','nameToType','add','/sb/da/esr','getParent','length','\x20to\x20delete','5VbEkLK','Source\x20directory:\x20','join','\x0aError:','\x20YAML\x20files\x20found','listJourneysWithDetailsFromParentSegment','no_parent','312672nsAeOT','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','isScoped','nameToId','journeys','/e/','cyan','idToName','data','3doQSof','segment:push','map','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','filter','\x20updated'];a42_0xb6a6=function(){return _0x100aac;};return a42_0xb6a6();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a42_0x47a4d6 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';function a42_0x2d41(_0x41cfd2,_0x35d8ee){_0x41cfd2=_0x41cfd2-0x197;const _0xb6a691=a42_0xb6a6();let _0x2d4105=_0xb6a691[_0x41cfd2];return _0x2d4105;}export class SegmentPushCommand extends BaseCommand{[a42_0x47012b(0x1d8)]=a42_0x47012b(0x1cd);['description']=a42_0x47012b(0x235);async[a42_0x47012b(0x1f3)](_0x5bff39){const _0x21dabd=a42_0x47012b,{options:_0x2c51f5,args:_0x599ae0,tdx:_0x347fdb}=_0x5bff39,_0xf996b5=_0x2c51f5,_0x576174=await resolveTarget({'arg':_0x599ae0[0x0],'contextParent':_0x2c51f5[_0x21dabd(0x19c)],'cwd':process[_0x21dabd(0x23e)]()});if(!isSuccessfulResolution(_0x576174))return _0x576174[_0x21dabd(0x21c)]===_0x21dabd(0x1c2)?(console['error'](a42_0x47a4d6[_0x21dabd(0x1a7)](_0x21dabd(0x233))),console[_0x21dabd(0x22d)](_0x21dabd(0x19e)),console[_0x21dabd(0x22d)](_0x21dabd(0x1c4)),console['error'](_0x21dabd(0x1a4))):(console['error'](a42_0x47a4d6['red']('Error:\x20'+_0x576174[_0x21dabd(0x1aa)]+'\x0a')),_0x576174[_0x21dabd(0x207)]&&console[_0x21dabd(0x22d)](a42_0x47a4d6['cyan'](_0x576174['helpText']))),0x1;if(_0x576174[_0x21dabd(0x199)]===_0x21dabd(0x202))return console['error'](a42_0x47a4d6[_0x21dabd(0x1e2)](_0x21dabd(0x1dd)+_0x576174[_0x21dabd(0x22a)]+'\x0a')),console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1c9)](_0x21dabd(0x1a6))),0x1;const _0x55458b=_0x576174[_0x21dabd(0x1f9)],_0x43f0ee=_0x576174[_0x21dabd(0x22a)],_0x455084=_0x576174[_0x21dabd(0x199)]==='file'?_0x576174[_0x21dabd(0x215)]:undefined,_0x4fe7a9=getScopedDetails(_0x576174),_0x1567d4=_0x4fe7a9?.[_0x21dabd(0x1c5)]??![],_0x479466=_0x4fe7a9?.[_0x21dabd(0x198)]??'';if(!existsSync(_0x43f0ee))return console[_0x21dabd(0x22d)](a42_0x47a4d6['red'](_0x21dabd(0x1dd)+_0x43f0ee+'\x0a')),console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1c9)](_0x21dabd(0x1a6))),0x1;_0xf996b5['verbose']&&(console['error'](_0x21dabd(0x229)+_0xf996b5[_0x21dabd(0x1e1)]),console[_0x21dabd(0x22d)](_0x21dabd(0x23b)+_0x55458b),console[_0x21dabd(0x22d)](_0x21dabd(0x1bd)+_0x43f0ee),_0x1567d4&&console[_0x21dabd(0x22d)](_0x21dabd(0x19d)+_0x479466));const _0x2c4af6=await withSpinner(_0x21dabd(0x1e5)+_0x55458b+'\x27...',()=>_0x347fdb['segment'][_0x21dabd(0x1ab)](_0x55458b),{'verbose':_0xf996b5[_0x21dabd(0x219)]}),_0x25d918=_0x2c4af6['data'],{parentSegmentResult:_0x12d6af,segmentsResult:_0x48ec3f,foldersResult:_0x477fab,journeysWithDetailsResult:_0x2372a3,userMaps:_0x335dca}=await withSpinner(_0x21dabd(0x203),async()=>{const _0x15e5d2=_0x21dabd,[_0x13bf97,_0xe40296,_0x4880ef,_0x22622c,_0x5ce8ee]=await Promise[_0x15e5d2(0x1e7)]([_0x347fdb[_0x15e5d2(0x1ae)][_0x15e5d2(0x1b9)](_0x25d918),_0x347fdb[_0x15e5d2(0x1ae)]['listSegments'](_0x25d918),_0x347fdb['segment'][_0x15e5d2(0x217)](_0x25d918),_0x347fdb[_0x15e5d2(0x1da)][_0x15e5d2(0x1c1)](_0x25d918,{'includeAllVersions':!![]}),_0x347fdb['user'][_0x15e5d2(0x1d5)]()]);return{'parentSegmentResult':_0x13bf97,'segmentsResult':_0xe40296,'foldersResult':_0x4880ef,'journeysWithDetailsResult':_0x22622c,'userMaps':_0x5ce8ee};},{'verbose':_0xf996b5['verbose']})['then'](_0x21da2a=>_0x21da2a[_0x21dabd(0x1cb)]),_0x4e4098=_0x12d6af,_0x2e220b=extractRootFolderId(_0x4e4098),_0x40aaa5=_0x48ec3f,_0xc87105=_0x477fab,{journeys:_0x5179f8,activationStepsById:_0x10177c}=_0x2372a3,_0x1e9307=new Map(_0x5179f8[_0x21dabd(0x1ce)](_0x598e1f=>[_0x598e1f['id'],_0x598e1f])),_0x19c06f=_0x5179f8[_0x21dabd(0x1ce)](_0x1bcce4=>({'id':_0x1bcce4['id'],'name':_0x1bcce4[_0x21dabd(0x1a3)][_0x21dabd(0x1d8)],'journeyBundleName':_0x1bcce4['attributes'][_0x21dabd(0x22c)]||'','journeyBundleId':_0x1bcce4[_0x21dabd(0x1a3)][_0x21dabd(0x1a8)]||'','versionNumber':_0x1bcce4[_0x21dabd(0x1a3)][_0x21dabd(0x21d)],'description':_0x1bcce4[_0x21dabd(0x1a3)][_0x21dabd(0x1fc)],'state':_0x1bcce4['attributes'][_0x21dabd(0x1a1)],'paused':_0x1bcce4[_0x21dabd(0x1a3)][_0x21dabd(0x23f)],'audienceId':_0x1bcce4[_0x21dabd(0x1a3)]['audienceId'],'folderId':_0x1bcce4[_0x21dabd(0x1f8)]?.[_0x21dabd(0x209)]?.[_0x21dabd(0x1cb)]?.['id'],'createdAt':_0x1bcce4[_0x21dabd(0x1a3)][_0x21dabd(0x1f2)],'updatedAt':_0x1bcce4[_0x21dabd(0x1a3)][_0x21dabd(0x216)]})),{emailToId:_0x2a488f,idToEmail:_0x4bee35}=_0x335dca,_0x41abcd=await withSpinner(_0x21dabd(0x22e),async()=>{const _0x4f7a23=_0x21dabd,_0x411efb=await _0x347fdb[_0x4f7a23(0x1b5)][_0x4f7a23(0x239)]();return buildConnectionMaps(_0x411efb);},{'verbose':_0xf996b5[_0x21dabd(0x219)]})[_0x21dabd(0x222)](_0x1bb7ee=>_0x1bb7ee[_0x21dabd(0x1cb)]),_0x3cec3f=_0x41abcd[_0x21dabd(0x1c6)],_0x1d2160=_0x41abcd[_0x21dabd(0x1ca)],_0x6d8fbe=_0x41abcd[_0x21dabd(0x1b6)],_0x46aa9b={'emailToIdMap':_0x2a488f,'connectionNameToIdMap':_0x3cec3f,'connectionNameToTypeMap':_0x6d8fbe,'getSchema':_0x10555d=>_0x347fdb[_0x21dabd(0x1b5)][_0x21dabd(0x1fe)](_0x10555d)};let {pathToId:_0x5a72aa,idToPath:_0x2a7a57}=buildFolderMaps(_0xc87105);const _0x55cd82=buildSegmentLookupMap(_0x40aaa5,_0x2a7a57),_0x1088b6=buildSegmentNameToIdMap(_0x40aaa5),_0x5e486b=buildJourneyBundleLookupMap(_0x19c06f,_0x2a7a57);let _0x3c0fc7;if(_0x455084){if(!_0x455084[_0x21dabd(0x21e)](_0x21dabd(0x1fb))&&!_0x455084[_0x21dabd(0x21e)](_0x21dabd(0x23d)))return console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1e2)](_0x21dabd(0x21b)+_0x455084+'\x0a')),0x1;_0x3c0fc7=[_0x455084];}else _0x3c0fc7=findYamlFiles(_0x43f0ee);if(_0x3c0fc7['length']===0x0)return console[_0x21dabd(0x22d)](a42_0x47a4d6['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x43f0ee+'\x0a')),console['error'](a42_0x47a4d6[_0x21dabd(0x1c9)](_0x21dabd(0x1cf))),0x1;let _0x40bbc0,_0x3dd533;try{const _0x3683c8=parseAndClassifyYamlFiles(_0x3c0fc7,_0x43f0ee,{'skipSegments':_0xf996b5['journeysOnly']});_0x40bbc0=_0x3683c8[_0x21dabd(0x1a2)],_0x3dd533=_0x3683c8[_0x21dabd(0x1c7)];const _0xc1b5b6=validateParsedFiles(_0x3683c8,_0x43f0ee);if(_0xc1b5b6['length']>0x0)return console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1e2)](_0x21dabd(0x1d4))),console[_0x21dabd(0x22d)](formatValidationErrors(_0xc1b5b6)),console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1a7)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x49fdce){return console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1e2)]('Error\x20parsing\x20YAML:\x20'+(_0x49fdce instanceof Error?_0x49fdce[_0x21dabd(0x1aa)]:_0x49fdce))),0x1;}if(_0x40bbc0['length']===0x0&&_0x3dd533[_0x21dabd(0x1ba)]===0x0){const _0x16ce98=_0xf996b5[_0x21dabd(0x1a9)]?_0x21dabd(0x1da):_0x21dabd(0x223);return console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1a7)]('No\x20'+_0x16ce98+_0x21dabd(0x1c0))),0x0;}const _0x1f6d5f=new Map();_0x40aaa5[_0x21dabd(0x1ba)]>0x0&&!_0xf996b5[_0x21dabd(0x1a9)]&&await withSpinner(_0x21dabd(0x1f6),async()=>{await batchAsync(_0x40aaa5,async _0x53a25c=>{const _0xfc4d3e=a42_0x2d41,_0x2a1711=await _0x347fdb[_0xfc4d3e(0x1ae)][_0xfc4d3e(0x19a)](_0x25d918,_0x53a25c['id']);_0x1f6d5f[_0xfc4d3e(0x201)](_0x53a25c['id'],_0x2a1711);});},{'verbose':_0xf996b5[_0x21dabd(0x219)]});const {segmentFiles:_0x1e4452,foldersToCreate:_0xf870ee}=await prepareSegmentFiles(_0x40bbc0,{'segmentByFolderAndName':_0x55cd82,'activationsBySegmentId':_0x1f6d5f,'folderPathToId':_0x5a72aa,'idToEmailMap':_0x4bee35,'connectionIdToNameMap':_0x1d2160},_0x46aa9b,_0x1567d4,_0x479466),_0x503f27=_0x455084?[]:findSegmentsToDelete(_0x40aaa5,_0x40bbc0[_0x21dabd(0x1ce)](({yamlConfig:_0x4b5da5,folderPath:_0x56d33e})=>({'yamlConfig':_0x4b5da5,'folderPath':resolveTDFolderPath(_0x56d33e,_0x1567d4,_0x479466)})),_0x2a7a57,_0x479466,_0x1567d4),{journeyFiles:_0x29b9fc,foldersToCreate:_0x24ee71}=await withProgressSpinner(_0x21dabd(0x1a0),async _0x5cd335=>prepareJourneyFiles(_0x3dd533,{'fetchJourney':async _0x24011d=>_0x347fdb[_0x21dabd(0x1da)][_0x21dabd(0x1d2)](_0x24011d[_0x21dabd(0x230)]),'journeyBundlesByFolderAndName':_0x5e486b,'folderPathToId':_0x5a72aa,'idToEmailMap':_0x4bee35,'connectionIdToNameMap':_0x1d2160,'existingSegments':_0x40aaa5,'parentId':_0x25d918,'deps':_0x347fdb,'progress':{'update':_0x5ac590=>{const _0x1e9d3d=_0x21dabd;_0x5cd335[_0x1e9d3d(0x1d3)](_0x5ac590),_0xf996b5[_0x1e9d3d(0x219)]&&console[_0x1e9d3d(0x22d)]('\x20\x20'+_0x5ac590);}},'journeyById':_0x1e9307,'activationStepsById':_0x10177c},_0x1567d4,_0x479466),{'verbose':_0xf996b5['verbose']})['then'](_0x30230a=>_0x30230a[_0x21dabd(0x1cb)]);for(const _0x3251fd of _0x24ee71){_0xf870ee[_0x21dabd(0x1b7)](_0x3251fd);}const _0x129ad3=_0x455084?[]:findJourneysToDelete(_0x19c06f,_0x3dd533[_0x21dabd(0x1ce)](({yamlConfig:_0x54caf9,folderPath:_0x4a3570})=>({'yamlConfig':_0x54caf9,'folderPath':resolveTDFolderPath(_0x4a3570,_0x1567d4,_0x479466)})),_0x2a7a57,_0x479466,_0x1567d4),_0x43074d=calculatePushStats(_0x1e4452,_0x29b9fc,_0xf870ee,_0x503f27,_0x129ad3,!!_0xf996b5['delete'],!!_0xf996b5[_0x21dabd(0x1a9)]),_0x24fdce=_0x43074d['segments'][_0x21dabd(0x22b)],_0x1c4974=_0x43074d[_0x21dabd(0x1a2)][_0x21dabd(0x221)],_0x441e5c=_0x43074d[_0x21dabd(0x1a2)]['unchanged'],_0x32e05d=_0x43074d[_0x21dabd(0x1a2)][_0x21dabd(0x210)],_0x507e31=_0x43074d[_0x21dabd(0x23c)][_0x21dabd(0x1ef)],_0x4ca7b8=_0x43074d[_0x21dabd(0x1c7)][_0x21dabd(0x22b)],_0x157dd9=_0x43074d[_0x21dabd(0x1c7)][_0x21dabd(0x221)],_0x3a8747=_0x43074d[_0x21dabd(0x1c7)][_0x21dabd(0x1dc)],_0x193556=_0x43074d[_0x21dabd(0x1c7)]['toDelete'],_0x322be9=_0x43074d[_0x21dabd(0x204)][_0x21dabd(0x1e7)],_0x34dd7b=_0x43074d[_0x21dabd(0x204)][_0x21dabd(0x1ef)],_0x540087=_0x43074d[_0x21dabd(0x204)][_0x21dabd(0x218)],_0x18d379=_0x43074d['activations']['toDelete'];console[_0x21dabd(0x22d)](_0x21dabd(0x19f)+_0x55458b+'\x27:');_0x507e31['length']>0x0&&console[_0x21dabd(0x22d)]('\x20\x20'+a42_0x47a4d6[_0x21dabd(0x1e0)](_0x21dabd(0x197)+_0x507e31[_0x21dabd(0x1ba)]+_0x21dabd(0x20f)));if(!_0xf996b5[_0x21dabd(0x1a9)]){console[_0x21dabd(0x22d)]('\x20\x20📊\x20Segments:'),console[_0x21dabd(0x22d)](_0x21dabd(0x21a)+a42_0x47a4d6[_0x21dabd(0x1ee)]('+\x20'+_0x24fdce[_0x21dabd(0x1ba)]+_0x21dabd(0x1d6))),console[_0x21dabd(0x22d)](_0x21dabd(0x21a)+a42_0x47a4d6['yellow']('~\x20'+_0x1c4974[_0x21dabd(0x1ba)]+_0x21dabd(0x20a)));if(_0x32e05d['length']>0x0)console[_0x21dabd(0x22d)](_0x21dabd(0x21a)+a42_0x47a4d6['red']('-\x20'+_0x32e05d[_0x21dabd(0x1ba)]+_0x21dabd(0x1bb)));else _0x503f27['length']>0x0&&!_0xf996b5['delete']&&console[_0x21dabd(0x22d)]('\x20\x20\x20\x20'+a42_0x47a4d6[_0x21dabd(0x1ac)](_0x503f27[_0x21dabd(0x1ba)]+_0x21dabd(0x1ff)));console['error'](_0x21dabd(0x21a)+a42_0x47a4d6[_0x21dabd(0x1ac)]('=\x20'+_0x441e5c[_0x21dabd(0x1ba)]+'\x20unchanged'));}if(_0x29b9fc[_0x21dabd(0x1ba)]>0x0||_0x129ad3[_0x21dabd(0x1ba)]>0x0){console[_0x21dabd(0x22d)](_0x21dabd(0x220)),console[_0x21dabd(0x22d)](_0x21dabd(0x21a)+a42_0x47a4d6[_0x21dabd(0x1ee)]('+\x20'+_0x4ca7b8['length']+'\x20new')),console['error'](_0x21dabd(0x21a)+a42_0x47a4d6[_0x21dabd(0x1a7)]('~\x20'+_0x157dd9[_0x21dabd(0x1ba)]+_0x21dabd(0x20a)));if(_0x193556[_0x21dabd(0x1ba)]>0x0)console[_0x21dabd(0x22d)](_0x21dabd(0x21a)+a42_0x47a4d6[_0x21dabd(0x1e2)]('-\x20'+_0x193556[_0x21dabd(0x1ba)]+'\x20to\x20delete'));else _0x129ad3[_0x21dabd(0x1ba)]>0x0&&!_0xf996b5[_0x21dabd(0x1f7)]&&console[_0x21dabd(0x22d)]('\x20\x20\x20\x20'+a42_0x47a4d6[_0x21dabd(0x1ac)](_0x129ad3[_0x21dabd(0x1ba)]+_0x21dabd(0x1ff)));console['error'](_0x21dabd(0x21a)+a42_0x47a4d6[_0x21dabd(0x1ac)]('=\x20'+_0x3a8747[_0x21dabd(0x1ba)]+_0x21dabd(0x21f)));}_0x322be9[_0x21dabd(0x1ba)]>0x0&&!_0xf996b5[_0x21dabd(0x1a9)]&&(console[_0x21dabd(0x22d)](''),console[_0x21dabd(0x22d)](_0x21dabd(0x1ec)),_0x34dd7b[_0x21dabd(0x1ba)]>0x0&&console['error']('\x20\x20\x20\x20'+a42_0x47a4d6['green']('+\x20'+_0x34dd7b['length']+_0x21dabd(0x226))),_0x540087[_0x21dabd(0x1ba)]>0x0&&console[_0x21dabd(0x22d)](_0x21dabd(0x21a)+a42_0x47a4d6['yellow']('~\x20'+_0x540087[_0x21dabd(0x1ba)]+'\x20to\x20update')),_0x18d379[_0x21dabd(0x1ba)]>0x0&&console[_0x21dabd(0x22d)](_0x21dabd(0x21a)+a42_0x47a4d6[_0x21dabd(0x1e2)]('-\x20'+_0x18d379[_0x21dabd(0x1ba)]+_0x21dabd(0x1bb))));console[_0x21dabd(0x22d)](_0x21dabd(0x1d7)+a42_0x47a4d6[_0x21dabd(0x1c9)](_0x43f0ee)+'\x0a');if(_0x507e31[_0x21dabd(0x1ba)]>0x0){console[_0x21dabd(0x22d)](_0x21dabd(0x1e3));for(const _0x34d2ab of _0x507e31){console[_0x21dabd(0x22d)]('\x20\x20'+a42_0x47a4d6[_0x21dabd(0x1e0)]('+')+'\x20'+_0x34d2ab);}console[_0x21dabd(0x22d)]('');}if(_0x24fdce[_0x21dabd(0x1ba)]>0x0&&!_0xf996b5['journeysOnly'])for(const _0x109f40 of _0x24fdce){const _0x5d8506=_0x109f40['folderPath']?_0x109f40[_0x21dabd(0x200)]+'/'+_0x109f40[_0x21dabd(0x1d9)][_0x21dabd(0x1d8)]:_0x109f40[_0x21dabd(0x1d9)][_0x21dabd(0x1d8)],_0x5572c2=_0x109f40[_0x21dabd(0x1d9)][_0x21dabd(0x204)]?.[_0x21dabd(0x1ba)]||0x0,_0x24195d=_0x5572c2>0x0?a42_0x47a4d6[_0x21dabd(0x1ac)]('\x20['+_0x5572c2+_0x21dabd(0x224)):'';console['error']('\x0a'+a42_0x47a4d6['green'](_0x21dabd(0x238))+'\x20'+_0x5d8506+_0x24195d),console['error']('─'[_0x21dabd(0x1f5)](0x3c)),_0x109f40[_0x21dabd(0x1fd)]&&console[_0x21dabd(0x22d)](_0x109f40[_0x21dabd(0x1fd)]),console[_0x21dabd(0x22d)]('─'[_0x21dabd(0x1f5)](0x3c));}if(_0x32e05d[_0x21dabd(0x1ba)]>0x0&&!_0xf996b5[_0x21dabd(0x1a9)])for(const _0x2c7608 of _0x32e05d){const _0x4246e2=_0x2c7608[_0x21dabd(0x234)]?_0x2a7a57[_0x21dabd(0x20b)](_0x2c7608[_0x21dabd(0x234)][_0x21dabd(0x237)]())||'':'',_0x54c793=_0x4246e2?_0x4246e2+'/'+_0x2c7608[_0x21dabd(0x1d8)]:_0x2c7608[_0x21dabd(0x1d8)],_0x4a53de=_0x1f6d5f[_0x21dabd(0x20b)](_0x2c7608['id'])||[],_0x27a111=_0x4a53de['length']>0x0?a42_0x47a4d6['dim']('\x20['+_0x4a53de[_0x21dabd(0x1ba)]+_0x21dabd(0x224)):'';console[_0x21dabd(0x22d)]('\x0a'+a42_0x47a4d6['red'](_0x21dabd(0x1b0))+'\x20'+_0x54c793+_0x27a111),console['error']('─'[_0x21dabd(0x1f5)](0x3c));const _0x2c863a=segmentWithActivationsToYaml(_0x2c7608,_0x4a53de,undefined,_0x4bee35,_0x1d2160),_0x2d7c1d=segmentToYamlString(_0x2c863a),_0x2a748a=generateDiff(_0x2d7c1d,'');console[_0x21dabd(0x22d)](formatDiffWithColors(_0x2a748a)),console['error']('─'['repeat'](0x3c));}const _0x5456e7=_0x1e4452[_0x21dabd(0x1d0)](_0x4aead7=>!_0x4aead7[_0x21dabd(0x22f)]&&_0x4aead7[_0x21dabd(0x1fd)]);if(_0x5456e7[_0x21dabd(0x1ba)]>0x0&&!_0xf996b5[_0x21dabd(0x1a9)])for(const _0x2bc6cd of _0x5456e7){const _0x231abd=_0x2bc6cd[_0x21dabd(0x200)]?_0x2bc6cd['folderPath']+'/'+_0x2bc6cd[_0x21dabd(0x1d9)][_0x21dabd(0x1d8)]:_0x2bc6cd['yamlConfig'][_0x21dabd(0x1d8)];console[_0x21dabd(0x22d)]('\x0a'+a42_0x47a4d6['yellow'](_0x21dabd(0x1b2))+'\x20'+_0x231abd),console[_0x21dabd(0x22d)]('─'['repeat'](0x3c)),console[_0x21dabd(0x22d)](_0x2bc6cd[_0x21dabd(0x1fd)]),console[_0x21dabd(0x22d)]('─'[_0x21dabd(0x1f5)](0x3c));}if(_0x4ca7b8[_0x21dabd(0x1ba)]>0x0)for(const _0x359d7a of _0x4ca7b8){const _0x280eb7=_0x359d7a['folderPath']?_0x359d7a['folderPath']+'/'+_0x359d7a['yamlConfig']['name']:_0x359d7a[_0x21dabd(0x1d9)][_0x21dabd(0x1d8)];console[_0x21dabd(0x22d)]('\x0a'+a42_0x47a4d6[_0x21dabd(0x1ee)](_0x21dabd(0x1b4))+'\x20'+_0x280eb7),console[_0x21dabd(0x22d)]('─'['repeat'](0x3c)),_0x359d7a['diff']&&console[_0x21dabd(0x22d)](_0x359d7a[_0x21dabd(0x1fd)]),console[_0x21dabd(0x22d)]('─'[_0x21dabd(0x1f5)](0x3c));}const _0x8fde1a=_0x29b9fc['filter'](_0x9a14c9=>!_0x9a14c9[_0x21dabd(0x22f)]&&_0x9a14c9[_0x21dabd(0x1fd)]);if(_0x8fde1a[_0x21dabd(0x1ba)]>0x0)for(const _0x5781b7 of _0x8fde1a){const _0x119860=_0x5781b7[_0x21dabd(0x200)]?_0x5781b7[_0x21dabd(0x200)]+'/'+_0x5781b7['yamlConfig'][_0x21dabd(0x1d8)]:_0x5781b7['yamlConfig'][_0x21dabd(0x1d8)];console[_0x21dabd(0x22d)]('\x0a'+a42_0x47a4d6[_0x21dabd(0x1a7)](_0x21dabd(0x1db))+'\x20'+_0x119860),console[_0x21dabd(0x22d)]('─'[_0x21dabd(0x1f5)](0x3c)),console[_0x21dabd(0x22d)](_0x5781b7['diff']),console[_0x21dabd(0x22d)]('─'[_0x21dabd(0x1f5)](0x3c));}if(_0x193556['length']>0x0)for(const _0x5ce344 of _0x193556){const _0x50c5dc=_0x5ce344[_0x21dabd(0x20e)]?_0x2a7a57[_0x21dabd(0x20b)](_0x5ce344[_0x21dabd(0x20e)])||'':'',_0x1eb554=_0x50c5dc?_0x50c5dc+'/'+_0x5ce344[_0x21dabd(0x22c)]:_0x5ce344[_0x21dabd(0x22c)];console[_0x21dabd(0x22d)]('\x0a'+a42_0x47a4d6[_0x21dabd(0x1e2)](_0x21dabd(0x1e6))+'\x20'+_0x1eb554),console['error']('─'[_0x21dabd(0x1f5)](0x3c)),console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1e2)](_0x21dabd(0x1f0))),console['error']('─'[_0x21dabd(0x1f5)](0x3c));}if(_0xf996b5[_0x21dabd(0x1df)])return console[_0x21dabd(0x22d)](a42_0x47a4d6['yellow'](_0x21dabd(0x20d))),0x0;const _0x3630b8=_0xf996b5['journeysOnly']?![]:_0x24fdce['length']>0x0||_0x1c4974[_0x21dabd(0x1ba)]>0x0||_0x32e05d[_0x21dabd(0x1ba)]>0x0,_0x477ab7=_0x4ca7b8[_0x21dabd(0x1ba)]>0x0||_0x157dd9['length']>0x0||_0x193556[_0x21dabd(0x1ba)]>0x0,_0x44e9fd=_0xf996b5[_0x21dabd(0x1a9)]?![]:_0x322be9[_0x21dabd(0x1ba)]>0x0,_0x466614=_0x507e31[_0x21dabd(0x1ba)]>0x0;if(!_0x3630b8&&!_0x477ab7&&!_0x44e9fd&&!_0x466614){const _0x25c06b=_0xf996b5[_0x21dabd(0x1a9)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x21dabd(0x1af);console['error'](a42_0x47a4d6[_0x21dabd(0x1ee)](_0x25c06b));if(_0x455084&&_0x441e5c[_0x21dabd(0x1ba)]===0x1){const _0x4fe592=_0x441e5c[0x0];if(_0x4fe592[_0x21dabd(0x232)]?.['id']){const _0x263205=getConsoleNextUrl(_0xf996b5[_0x21dabd(0x1e1)],_0x21dabd(0x1b1)+_0x25d918+_0x21dabd(0x1c8)+_0x4fe592[_0x21dabd(0x232)]['id']+'/sb/da/esr');console[_0x21dabd(0x22d)](_0x21dabd(0x1f4)+a42_0x47a4d6['cyan'](_0x263205));}}if(_0x455084&&_0x3a8747['length']===0x1){const _0x4163e4=_0x3a8747[0x0];if(_0x4163e4['existingJourney']?.['id']){const _0x3c7f8b=getConsoleNextUrl(_0xf996b5[_0x21dabd(0x1e1)],'/app/ps/'+_0x25d918+'/e/'+_0x4163e4[_0x21dabd(0x1ea)]['id']+_0x21dabd(0x228));console[_0x21dabd(0x22d)]('\x20\x20'+a42_0x47a4d6[_0x21dabd(0x1c9)](_0x3c7f8b));}}return 0x0;}const _0x1b207e=_0xf996b5[_0x21dabd(0x1a9)]?_0x4ca7b8[_0x21dabd(0x1ba)]+_0x157dd9[_0x21dabd(0x1ba)]+_0x193556['length']+_0x507e31['length']:_0x24fdce['length']+_0x1c4974[_0x21dabd(0x1ba)]+_0x32e05d[_0x21dabd(0x1ba)]+_0x4ca7b8[_0x21dabd(0x1ba)]+_0x157dd9[_0x21dabd(0x1ba)]+_0x193556[_0x21dabd(0x1ba)]+_0x507e31['length']+_0x322be9[_0x21dabd(0x1ba)];if(!_0xf996b5[_0x21dabd(0x1b3)]&&_0x1b207e>0x0){if(!isInteractive())return console['error'](a42_0x47a4d6[_0x21dabd(0x1e2)](_0x21dabd(0x1bf)),_0x21dabd(0x1ad)),console['error'](a42_0x47a4d6['dim'](_0x21dabd(0x1e8))),0x1;const _0x19f4cd=await confirmKey(_0x21dabd(0x211)+_0x1b207e+_0x21dabd(0x1e4));if(!_0x19f4cd)return console['error'](a42_0x47a4d6['yellow']('Aborted.')),0x1;}const _0xebb37e={'withProgress':async(_0x5e35ef,_0x3fe564)=>{const _0xdf2f14=_0x21dabd,_0x2bd409=await withSpinner(_0x5e35ef,_0x3fe564,{'verbose':_0xf996b5['verbose']});return{'data':_0x2bd409[_0xdf2f14(0x1cb)]};},'logInfo':_0x198510=>console[_0x21dabd(0x22d)](a42_0x47a4d6['blue']('✔\x20'+_0x198510)),'logSuccess':_0x532ce7=>console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1ee)]('✔\x20'+_0x532ce7)),'logWarning':_0x398dbf=>console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1a7)]('⚠\x20'+_0x398dbf)),'logDeleted':_0x1256c6=>console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1e2)]('✔\x20'+_0x1256c6))},_0x20eaa6={'segment':_0x347fdb[_0x21dabd(0x1ae)],'journey':_0x347fdb[_0x21dabd(0x1da)],'user':_0x347fdb[_0x21dabd(0x225)],'connection':_0x347fdb[_0x21dabd(0x1b5)]};_0x507e31['length']>0x0&&(_0x5a72aa=await executePushFolders(_0x20eaa6,_0x507e31,_0x5a72aa,{'parentId':_0x25d918},_0xebb37e));const _0xd9a7c9={'rootFolderId':_0x2e220b,'folderPathToId':_0x5a72aa,'folderIdToPath':_0x2a7a57,'segmentNameToId':_0x1088b6,'activationsBySegmentId':_0x1f6d5f,'emailToIdMap':_0x2a488f,'idToEmailMap':_0x4bee35,'connectionNameToIdMap':_0x41abcd[_0x21dabd(0x1c6)],'connectionIdToNameMap':_0x41abcd[_0x21dabd(0x1ca)],'connectionNameToTypeMap':_0x6d8fbe},_0x386853=await executePushSegments(_0x20eaa6,_0xf996b5['journeysOnly']?[]:_0x1e4452,_0xd9a7c9,{'parentId':_0x25d918},_0xebb37e),_0x2b22dd=_0x386853[_0x21dabd(0x236)],_0x1d0128=_0x386853['updated'],_0x3a21ba=_0x386853[_0x21dabd(0x204)][_0x21dabd(0x236)],_0x3e7ff8=_0x386853[_0x21dabd(0x204)]['updated'],_0x1c7fc6=_0x386853[_0x21dabd(0x204)][_0x21dabd(0x214)];let _0x10b262;if(_0x455084&&_0x1e4452[_0x21dabd(0x1ba)]===0x1){const _0x197942=_0x1e4452[0x0];_0x10b262=_0x197942[_0x21dabd(0x232)]?.['id']??_0x386853[_0x21dabd(0x1de)][_0x21dabd(0x20b)](_0x197942[_0x21dabd(0x1d9)]['name']);}const _0x506451=await executePushSegmentDeletions(_0x20eaa6,_0xf996b5['journeysOnly']?[]:_0x32e05d,_0xebb37e);let _0x3f4d36=0x0,_0x2801f6=0x0,_0x233645=0x0;const _0x99080e=new Map(_0x1088b6);for(const [_0x247242,_0x4aaed0]of _0x386853[_0x21dabd(0x1de)]){_0x99080e['set'](_0x247242,_0x4aaed0);}if(_0x29b9fc[_0x21dabd(0x1ba)]>0x0){const _0x23e22c={..._0xd9a7c9,'segmentNameToId':_0x99080e,'existingSegments':_0x40aaa5,'activationContext':_0x46aa9b},_0x2fda85=await executePushJourneys(_0x20eaa6,_0x29b9fc,_0x23e22c,{'parentId':_0x25d918,'rootFolderId':_0x2e220b,'verbose':_0xf996b5[_0x21dabd(0x219)]},_0xebb37e);_0x3f4d36=_0x2fda85['created'],_0x2801f6=_0x2fda85[_0x21dabd(0x213)];if(_0x455084&&_0x2fda85[_0x21dabd(0x227)][_0x21dabd(0x1ba)]===0x1){const _0x2fc7d3=_0x2fda85[_0x21dabd(0x227)][0x0];if(_0x2fc7d3[_0x21dabd(0x230)]){const _0xdb3d5=getConsoleNextUrl(_0xf996b5[_0x21dabd(0x1e1)],_0x21dabd(0x1b1)+_0x25d918+_0x21dabd(0x1c8)+_0x2fc7d3[_0x21dabd(0x230)]+'/j/da/je');console[_0x21dabd(0x22d)]('\x20\x20'+a42_0x47a4d6[_0x21dabd(0x1c9)](_0xdb3d5));}}}for(const _0xac40b0 of _0x193556){console[_0x21dabd(0x22d)](a42_0x47a4d6[_0x21dabd(0x1a7)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0xac40b0[_0x21dabd(0x22c)])),_0x233645++;}const _0x5cb158=[];if(_0x2b22dd>0x0)_0x5cb158[_0x21dabd(0x20c)](_0x2b22dd+'\x20created');if(_0x1d0128>0x0)_0x5cb158[_0x21dabd(0x20c)](_0x1d0128+'\x20updated');if(_0x506451>0x0)_0x5cb158[_0x21dabd(0x20c)](_0x506451+_0x21dabd(0x23a));const _0x282499=[];if(_0x3f4d36>0x0)_0x282499[_0x21dabd(0x20c)](_0x3f4d36+_0x21dabd(0x1ed));if(_0x2801f6>0x0)_0x282499['push'](_0x2801f6+'\x20updated');if(_0x233645>0x0)_0x282499[_0x21dabd(0x20c)](_0x233645+_0x21dabd(0x23a));const _0x3092bf=[];if(_0x3a21ba>0x0)_0x3092bf['push'](_0x3a21ba+'\x20created');if(_0x3e7ff8>0x0)_0x3092bf['push'](_0x3e7ff8+_0x21dabd(0x1d1));if(_0x1c7fc6>0x0)_0x3092bf[_0x21dabd(0x20c)](_0x1c7fc6+_0x21dabd(0x23a));console[_0x21dabd(0x22d)](a42_0x47a4d6['green'](_0x21dabd(0x1e9)));_0x5cb158[_0x21dabd(0x1ba)]>0x0&&!_0xf996b5[_0x21dabd(0x1a9)]&&console[_0x21dabd(0x22d)](_0x21dabd(0x1f1)+_0x5cb158[_0x21dabd(0x1be)](',\x20'));_0x282499['length']>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x282499['join'](',\x20'));_0x3092bf[_0x21dabd(0x1ba)]>0x0&&!_0xf996b5[_0x21dabd(0x1a9)]&&console[_0x21dabd(0x22d)](_0x21dabd(0x1a5)+_0x3092bf['join'](',\x20'));if(_0x10b262){const _0x4130d1=getConsoleNextUrl(_0xf996b5[_0x21dabd(0x1e1)],'/app/ps/'+_0x25d918+_0x21dabd(0x1c8)+_0x10b262+_0x21dabd(0x1b8));console['error'](_0x21dabd(0x1f4)+a42_0x47a4d6[_0x21dabd(0x1c9)](_0x4130d1));}return 0x0;}}
@@ -1 +1 @@
1
- const a43_0x2a1065=a43_0x4c05;(function(_0x12033d,_0x9b0479){const _0x4b3fab=a43_0x4c05,_0x52b5af=_0x12033d();while(!![]){try{const _0x7e661f=parseInt(_0x4b3fab(0x1db))/0x1+-parseInt(_0x4b3fab(0x1f6))/0x2*(-parseInt(_0x4b3fab(0x1ef))/0x3)+parseInt(_0x4b3fab(0x1f5))/0x4*(-parseInt(_0x4b3fab(0x1e8))/0x5)+parseInt(_0x4b3fab(0x1e4))/0x6+-parseInt(_0x4b3fab(0x1ea))/0x7+parseInt(_0x4b3fab(0x1d2))/0x8*(parseInt(_0x4b3fab(0x1d1))/0x9)+-parseInt(_0x4b3fab(0x1dd))/0xa;if(_0x7e661f===_0x9b0479)break;else _0x52b5af['push'](_0x52b5af['shift']());}catch(_0x540370){_0x52b5af['push'](_0x52b5af['shift']());}}}(a43_0xaa84,0x21271));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a43_0xaa84(){const _0x154f7a=['Resolving\x20folder\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20path\x20\x27','segmentPath','updateSegmentById','9RaVLKq','776976TUndLL','Resolved\x20relative\x20path\x20to:\x20','parentId','INTERNAL','Updating\x20segment\x20\x27','segment','folder','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','✔\x20Updated\x20segment\x20\x27','225012dFistd','kind','638330SIzOHO','segmentName','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','name','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','description','1603860UympjI','rule','includes','Examples:','1210610XuxlQW','resolvePathToResource','1165332ApfIas','Segment\x20ID\x20missing\x20from\x20resolved\x20path','resolveFolderId','Segment\x20ID:\x20','verbose','12MWrqhU','segment:update','yellow','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','error','Parent\x20ID:\x20','4lKZhLW','9390UZMsaQ','execute','\x20\x20\x20Path:\x20','Resolved\x20folder\x20ID:\x20','\x27...'];a43_0xaa84=function(){return _0x154f7a;};return a43_0xaa84();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a43_0x4c05(_0x13cbb8,_0x4e2091){_0x13cbb8=_0x13cbb8-0x1d0;const _0xaa8456=a43_0xaa84();let _0x4c0520=_0xaa8456[_0x13cbb8];return _0x4c0520;}import a43_0x8834b4 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x2a1065(0x1e0)]=a43_0x2a1065(0x1f0);[a43_0x2a1065(0x1e3)]='Update\x20existing\x20child\x20segment';async[a43_0x2a1065(0x1f7)](_0x20452e){const _0x176e1a=a43_0x2a1065;console[_0x176e1a(0x1f3)](a43_0x8834b4[_0x176e1a(0x1f1)](_0x176e1a(0x1d9))),console['error'](a43_0x8834b4[_0x176e1a(0x1f1)](_0x176e1a(0x1fc)));const {options:_0x568287,args:_0xd08945,tdx:_0x498ea0}=_0x20452e,_0x450b1d=_0x568287;if(_0xd08945['length']===0x0)return console[_0x176e1a(0x1f3)](_0x176e1a(0x1df)),console[_0x176e1a(0x1f3)](_0x176e1a(0x1e2)),console[_0x176e1a(0x1f3)](_0x176e1a(0x1e7)),console[_0x176e1a(0x1f3)](_0x176e1a(0x1f2)),console[_0x176e1a(0x1f3)](_0x176e1a(0x1e1)),0x1;const _0x3a49fa=_0xd08945[0x0],_0x34f2e0=_0x568287[_0x176e1a(0x1fe)];let _0x5c73eb=_0x3a49fa;_0x34f2e0&&!_0x3a49fa[_0x176e1a(0x1e6)]('/')&&(_0x5c73eb=_0x34f2e0+'/'+_0x3a49fa,_0x450b1d[_0x176e1a(0x1ee)]&&console[_0x176e1a(0x1f3)](_0x176e1a(0x1d3)+_0x5c73eb));const _0x199659=await withSpinner(_0x176e1a(0x1fd)+_0x5c73eb+_0x176e1a(0x1fa),()=>_0x498ea0[_0x176e1a(0x1d7)][_0x176e1a(0x1e9)](_0x5c73eb),{'verbose':_0x450b1d[_0x176e1a(0x1ee)]}),_0x1e677e=_0x199659['data'];_0x450b1d[_0x176e1a(0x1ee)]&&console[_0x176e1a(0x1f3)]('Resolved\x20type:\x20'+_0x1e677e['type']);if(_0x1e677e['type']!==_0x176e1a(0x1d7))return console['error']('Error:\x20Cannot\x20update\x20'+_0x1e677e['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x176e1a(0x1f3)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x1e677e['segmentId'])throw new SDKError(ErrorCode[_0x176e1a(0x1d5)],_0x176e1a(0x1eb));const _0x15ff01=_0x1e677e[_0x176e1a(0x1d4)],_0xed06ff=_0x1e677e['segmentId'];_0x450b1d[_0x176e1a(0x1ee)]&&(console[_0x176e1a(0x1f3)](_0x176e1a(0x1f4)+_0x15ff01),console[_0x176e1a(0x1f3)](_0x176e1a(0x1ed)+_0xed06ff));let _0x242ab0;if(_0x450b1d[_0x176e1a(0x1d8)]){const _0x3fb6fe=_0x450b1d[_0x176e1a(0x1d8)],_0x2b7fb4=await withSpinner(_0x176e1a(0x1fb)+_0x3fb6fe+_0x176e1a(0x1fa),()=>_0x498ea0[_0x176e1a(0x1d7)][_0x176e1a(0x1ec)](_0x15ff01,_0x3fb6fe),{'verbose':_0x450b1d[_0x176e1a(0x1ee)]});_0x242ab0=parseInt(_0x2b7fb4['data'],0xa),_0x450b1d[_0x176e1a(0x1ee)]&&console[_0x176e1a(0x1f3)](_0x176e1a(0x1f9)+_0x242ab0);}const _0x5ea652=await loadJSONFromOptions(_0x450b1d[_0x176e1a(0x1e5)],_0x450b1d['ruleFile']),_0x44b7f6={'name':_0x450b1d[_0x176e1a(0x1e0)],'description':_0x450b1d[_0x176e1a(0x1e3)],'rule':_0x5ea652,'kind':_0x450b1d[_0x176e1a(0x1dc)]!==undefined?parseInt(_0x450b1d[_0x176e1a(0x1dc)],0xa):undefined,'segmentFolderId':_0x242ab0},_0x111a95=await withSpinner(_0x176e1a(0x1d6)+_0x1e677e[_0x176e1a(0x1de)]+_0x176e1a(0x1fa),()=>_0x498ea0[_0x176e1a(0x1d7)][_0x176e1a(0x1d0)](_0x15ff01,_0xed06ff,_0x44b7f6),{'verbose':_0x450b1d[_0x176e1a(0x1ee)]}),_0x32f894=_0x111a95['data'];return console['error'](_0x176e1a(0x1da)+_0x32f894[_0x176e1a(0x1e0)]+'\x27'),_0x5c73eb!==_0x3a49fa&&console[_0x176e1a(0x1f3)](_0x176e1a(0x1f8)+_0x5c73eb),await handleSDKOutput([_0x32f894],_0x450b1d),0x0;}}
1
+ const a43_0x310ee7=a43_0x374a;(function(_0x4866b6,_0x166c90){const _0x2b4308=a43_0x374a,_0x3a6464=_0x4866b6();while(!![]){try{const _0x8f54f=parseInt(_0x2b4308(0x137))/0x1+parseInt(_0x2b4308(0x135))/0x2+-parseInt(_0x2b4308(0x140))/0x3+-parseInt(_0x2b4308(0x14f))/0x4+parseInt(_0x2b4308(0x15a))/0x5*(-parseInt(_0x2b4308(0x148))/0x6)+parseInt(_0x2b4308(0x14b))/0x7+-parseInt(_0x2b4308(0x13a))/0x8*(parseInt(_0x2b4308(0x15b))/0x9);if(_0x8f54f===_0x166c90)break;else _0x3a6464['push'](_0x3a6464['shift']());}catch(_0x367710){_0x3a6464['push'](_0x3a6464['shift']());}}}(a43_0x357d,0xca736));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a43_0x357d(){const _0x1e3422=['Resolved\x20type:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','✔\x20Updated\x20segment\x20\x27','Resolving\x20folder\x20\x27','115HRfssv','337068rshOqz','includes','segmentName','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Resolving\x20path\x20\x27','2710328DUfxeO','segmentPath','848719DXFzvQ','Updating\x20segment\x20\x27','type','8fghnvk','\x27...','description','data','INTERNAL','Update\x20existing\x20child\x20segment','3572721QsjMmZ','segmentId','parentId','kind','name','segment:update','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','52968UUmneW','yellow','execute','7617309yGDmPn','error','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20\x20Path:\x20','4125716buDRkI','Resolved\x20relative\x20path\x20to:\x20','segment','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','length','rule','verbose'];a43_0x357d=function(){return _0x1e3422;};return a43_0x357d();}import{withSpinner}from'../utils/spinner.js';function a43_0x374a(_0x35dbcc,_0x344313){_0x35dbcc=_0x35dbcc-0x135;const _0x357df0=a43_0x357d();let _0x374aaa=_0x357df0[_0x35dbcc];return _0x374aaa;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a43_0x2cf46d from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x310ee7(0x144)]=a43_0x310ee7(0x145);[a43_0x310ee7(0x13c)]=a43_0x310ee7(0x13f);async[a43_0x310ee7(0x14a)](_0x304a0c){const _0x42da21=a43_0x310ee7;console[_0x42da21(0x14c)](a43_0x2cf46d[_0x42da21(0x149)](_0x42da21(0x157))),console[_0x42da21(0x14c)](a43_0x2cf46d['yellow'](_0x42da21(0x152)));const {options:_0x217de6,args:_0x3e9b4a,tdx:_0x4162db}=_0x304a0c,_0x79ba6=_0x217de6;if(_0x3e9b4a[_0x42da21(0x153)]===0x0)return console[_0x42da21(0x14c)](_0x42da21(0x14d)),console[_0x42da21(0x14c)](_0x42da21(0x147)),console[_0x42da21(0x14c)]('Examples:'),console[_0x42da21(0x14c)](_0x42da21(0x15e)),console[_0x42da21(0x14c)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x41b0a9=_0x3e9b4a[0x0],_0x559b3a=_0x217de6[_0x42da21(0x136)];let _0x405b3b=_0x41b0a9;_0x559b3a&&!_0x41b0a9[_0x42da21(0x15c)]('/')&&(_0x405b3b=_0x559b3a+'/'+_0x41b0a9,_0x79ba6[_0x42da21(0x155)]&&console[_0x42da21(0x14c)](_0x42da21(0x150)+_0x405b3b));const _0x1ee1ef=await withSpinner(_0x42da21(0x15f)+_0x405b3b+_0x42da21(0x13b),()=>_0x4162db[_0x42da21(0x151)]['resolvePathToResource'](_0x405b3b),{'verbose':_0x79ba6[_0x42da21(0x155)]}),_0x47f3c7=_0x1ee1ef[_0x42da21(0x13d)];_0x79ba6[_0x42da21(0x155)]&&console[_0x42da21(0x14c)](_0x42da21(0x156)+_0x47f3c7[_0x42da21(0x139)]);if(_0x47f3c7[_0x42da21(0x139)]!==_0x42da21(0x151))return console[_0x42da21(0x14c)]('Error:\x20Cannot\x20update\x20'+_0x47f3c7['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x42da21(0x14c)](_0x42da21(0x146)),0x1;if(!_0x47f3c7[_0x42da21(0x141)])throw new SDKError(ErrorCode[_0x42da21(0x13e)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4a2f16=_0x47f3c7[_0x42da21(0x142)],_0x24c194=_0x47f3c7[_0x42da21(0x141)];_0x79ba6[_0x42da21(0x155)]&&(console[_0x42da21(0x14c)]('Parent\x20ID:\x20'+_0x4a2f16),console['error']('Segment\x20ID:\x20'+_0x24c194));let _0x3999c0;if(_0x79ba6['folder']){const _0x2ed994=_0x79ba6['folder'],_0x3f5196=await withSpinner(_0x42da21(0x159)+_0x2ed994+_0x42da21(0x13b),()=>_0x4162db[_0x42da21(0x151)]['resolveFolderId'](_0x4a2f16,_0x2ed994),{'verbose':_0x79ba6[_0x42da21(0x155)]});_0x3999c0=parseInt(_0x3f5196[_0x42da21(0x13d)],0xa),_0x79ba6[_0x42da21(0x155)]&&console[_0x42da21(0x14c)]('Resolved\x20folder\x20ID:\x20'+_0x3999c0);}const _0x3f0efb=await loadJSONFromOptions(_0x79ba6[_0x42da21(0x154)],_0x79ba6['ruleFile']),_0x1b6b21={'name':_0x79ba6[_0x42da21(0x144)],'description':_0x79ba6[_0x42da21(0x13c)],'rule':_0x3f0efb,'kind':_0x79ba6[_0x42da21(0x143)]!==undefined?parseInt(_0x79ba6[_0x42da21(0x143)],0xa):undefined,'segmentFolderId':_0x3999c0},_0x227f23=await withSpinner(_0x42da21(0x138)+_0x47f3c7[_0x42da21(0x15d)]+_0x42da21(0x13b),()=>_0x4162db['segment']['updateSegmentById'](_0x4a2f16,_0x24c194,_0x1b6b21),{'verbose':_0x79ba6[_0x42da21(0x155)]}),_0x449ad0=_0x227f23[_0x42da21(0x13d)];return console[_0x42da21(0x14c)](_0x42da21(0x158)+_0x449ad0[_0x42da21(0x144)]+'\x27'),_0x405b3b!==_0x41b0a9&&console[_0x42da21(0x14c)](_0x42da21(0x14e)+_0x405b3b),await handleSDKOutput([_0x449ad0],_0x79ba6),0x0;}}
@@ -1 +1 @@
1
- const a44_0x5b8f8c=a44_0x55c5;function a44_0x55c5(_0x2a27c2,_0x1a163d){_0x2a27c2=_0x2a27c2-0xde;const _0x517480=a44_0x5174();let _0x55c543=_0x517480[_0x2a27c2];return _0x55c543;}(function(_0x577127,_0x42d629){const _0x457e99=a44_0x55c5,_0x58ec9a=_0x577127();while(!![]){try{const _0x52e619=-parseInt(_0x457e99(0xfd))/0x1+-parseInt(_0x457e99(0x116))/0x2*(-parseInt(_0x457e99(0xf1))/0x3)+-parseInt(_0x457e99(0x10c))/0x4*(parseInt(_0x457e99(0xfa))/0x5)+-parseInt(_0x457e99(0x102))/0x6+parseInt(_0x457e99(0xea))/0x7*(parseInt(_0x457e99(0x118))/0x8)+parseInt(_0x457e99(0x114))/0x9+parseInt(_0x457e99(0x106))/0xa*(-parseInt(_0x457e99(0x100))/0xb);if(_0x52e619===_0x42d629)break;else _0x58ec9a['push'](_0x58ec9a['shift']());}catch(_0x443351){_0x58ec9a['push'](_0x58ec9a['shift']());}}}(a44_0x5174,0x308d0));import{existsSync,statSync}from'fs';import a44_0x50065f 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';export class SegmentUseCommand extends BaseCommand{[a44_0x5b8f8c(0xf8)]=a44_0x5b8f8c(0x10e);['description']='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a44_0x5b8f8c(0xf7)](_0x5acc44){const _0x29ab5e=a44_0x5b8f8c,{options:_0x15689d,args:_0x510b6a,tdx:_0x1640b9}=_0x5acc44;if(_0x510b6a[_0x29ab5e(0xf9)]===0x0)return console['error'](a44_0x50065f[_0x29ab5e(0xe9)](_0x29ab5e(0x117))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x29ab5e(0xe1)](_0x29ab5e(0xee)),console[_0x29ab5e(0xe1)](_0x29ab5e(0xf4)),console[_0x29ab5e(0xe1)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x29ab5e(0xe1)](_0x29ab5e(0xe0)),console[_0x29ab5e(0xe1)](_0x29ab5e(0xe5)),0x1;const _0x3c2b0f=_0x510b6a[0x0],_0x230025=_0x15689d['session'];try{if(_0x3c2b0f==='/')return saveSessionContext({'segment_path':undefined},_0x230025),console['log'](a44_0x50065f[_0x29ab5e(0x10f)](_0x29ab5e(0xec))),0x0;if(existsSync(_0x3c2b0f)&&statSync(_0x3c2b0f)[_0x29ab5e(0x103)]()){let _0x5b9e64;try{_0x5b9e64=findTdxConfig(_0x3c2b0f);}catch{return console[_0x29ab5e(0xe1)](a44_0x50065f[_0x29ab5e(0xe9)](_0x29ab5e(0x109)+_0x3c2b0f)),console[_0x29ab5e(0xe1)](a44_0x50065f[_0x29ab5e(0xfb)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x3758f7=_0x5b9e64[_0x29ab5e(0xfc)]['parent_segment'];return saveSessionContext({'segment_path':_0x3758f7,'parent_segment':_0x3758f7},_0x230025),console[_0x29ab5e(0xeb)](a44_0x50065f[_0x29ab5e(0x10f)](_0x29ab5e(0x115)+a44_0x50065f[_0x29ab5e(0xfb)](_0x3758f7))),0x0;}const _0x485e93=_0x15689d['segmentPath'];let _0x267012=_0x3c2b0f;const _0x75edf0=parsePath(_0x3c2b0f);if(!_0x75edf0[_0x29ab5e(0x108)]){if(!_0x485e93)return console[_0x29ab5e(0xe1)](a44_0x50065f[_0x29ab5e(0xe9)](_0x29ab5e(0x107))),console[_0x29ab5e(0xe1)](a44_0x50065f[_0x29ab5e(0xfb)](_0x29ab5e(0x10a))),0x1;if(_0x3c2b0f==='..'){const _0x583fd0=_0x485e93[_0x29ab5e(0xf3)]('/')[_0x29ab5e(0xe6)](0x0,-0x1)[_0x29ab5e(0xe7)]('/');_0x267012=_0x583fd0||'/';}else _0x3c2b0f==='.'?_0x267012=_0x485e93:_0x267012=_0x485e93+'/'+_0x3c2b0f;_0x15689d[_0x29ab5e(0x111)]&&console['error'](_0x29ab5e(0xff)+_0x267012);}if(_0x267012==='/'||_0x267012==='')return saveSessionContext({'segment_path':undefined},_0x230025),console[_0x29ab5e(0xeb)](a44_0x50065f['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x267012=normalizePath(_0x267012);const _0x571fe1=parsePath(_0x267012)[_0x29ab5e(0xe2)];if(_0x571fe1[_0x29ab5e(0xf9)]===0x0)return saveSessionContext({'segment_path':undefined},_0x230025),console['log'](a44_0x50065f[_0x29ab5e(0x10f)](_0x29ab5e(0xec))),0x0;_0x15689d[_0x29ab5e(0x111)]&&(console[_0x29ab5e(0xe1)](_0x29ab5e(0xf5)+_0x15689d[_0x29ab5e(0xf0)]),console[_0x29ab5e(0xe1)]('Target\x20path:\x20'+_0x267012));const _0x42f0ba=await withSpinner(_0x29ab5e(0xed)+_0x267012+_0x29ab5e(0x113),()=>_0x1640b9[_0x29ab5e(0xe4)][_0x29ab5e(0xef)](_0x267012),{'verbose':_0x15689d[_0x29ab5e(0x111)]}),_0x3c6cc9=_0x42f0ba[_0x29ab5e(0x105)];_0x15689d[_0x29ab5e(0x111)]&&(console['error'](_0x29ab5e(0xde)+_0x3c6cc9[_0x29ab5e(0x112)]),console[_0x29ab5e(0xe1)](_0x29ab5e(0x10d)+_0x3c6cc9[_0x29ab5e(0xdf)]),_0x3c6cc9[_0x29ab5e(0x104)]&&console[_0x29ab5e(0xe1)](_0x29ab5e(0xf2)+_0x3c6cc9[_0x29ab5e(0x104)]));if(_0x3c6cc9[_0x29ab5e(0x112)]==='segment')return console[_0x29ab5e(0xe1)](a44_0x50065f[_0x29ab5e(0xe9)](_0x29ab5e(0xfe))),console[_0x29ab5e(0xe1)](_0x29ab5e(0x10b)),console[_0x29ab5e(0xe1)](a44_0x50065f[_0x29ab5e(0xfb)]('Use:\x20tdx\x20segment\x20use\x20'+_0x3c6cc9[_0x29ab5e(0xe3)]+(_0x3c6cc9[_0x29ab5e(0xf6)]?'/'+_0x3c6cc9['folderPath'][_0x29ab5e(0xe7)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3c6cc9['fullPath'],'parent_segment':_0x3c6cc9['parentName']},_0x230025),console[_0x29ab5e(0xeb)](a44_0x50065f[_0x29ab5e(0x10f)](_0x29ab5e(0x115)+a44_0x50065f['cyan'](_0x3c6cc9['fullPath']))),_0x15689d['verbose']&&(console[_0x29ab5e(0xe1)](a44_0x50065f[_0x29ab5e(0xe8)](_0x29ab5e(0x110))),console[_0x29ab5e(0xe1)](a44_0x50065f[_0x29ab5e(0xe8)](_0x29ab5e(0x101)))),0x0;}catch(_0x1098f3){throw _0x1098f3;}}}function a44_0x5174(){const _0x24f1b3=['666YrXZXR','Folder\x20ID:\x20','split','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Site:\x20','folderPath','execute','name','length','15KNcMAH','cyan','config','51658oJTcLz','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Resolved\x20relative\x20path\x20to:\x20','11geyONd','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','828474uWakjY','isDirectory','folderId','data','4093670iHcceZ','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','isAbsolute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','173452CgxvXb','Parent\x20ID:\x20','segment:use','green','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','verbose','type','\x27...','2513376KgcqwT','✔\x20Context\x20set\x20to:\x20','2306ypmLYO','Error:\x20Path\x20is\x20required\x0a','8JcdZnl','Resolved\x20path\x20type:\x20','parentId','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','error','segments','parentName','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','slice','join','dim','red','2749789AVHyxx','log','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Resolving\x20path\x20\x27','Examples:','resolvePathToResource','site'];a44_0x5174=function(){return _0x24f1b3;};return a44_0x5174();}
1
+ const a44_0x2431dc=a44_0x24c0;(function(_0xdb344c,_0x10764f){const _0x38b148=a44_0x24c0,_0x25c1eb=_0xdb344c();while(!![]){try{const _0x589fb1=-parseInt(_0x38b148(0x191))/0x1+-parseInt(_0x38b148(0x172))/0x2*(parseInt(_0x38b148(0x16c))/0x3)+parseInt(_0x38b148(0x18c))/0x4*(-parseInt(_0x38b148(0x17d))/0x5)+parseInt(_0x38b148(0x178))/0x6+parseInt(_0x38b148(0x16b))/0x7*(-parseInt(_0x38b148(0x18a))/0x8)+parseInt(_0x38b148(0x186))/0x9+parseInt(_0x38b148(0x19a))/0xa;if(_0x589fb1===_0x10764f)break;else _0x25c1eb['push'](_0x25c1eb['shift']());}catch(_0x2a5818){_0x25c1eb['push'](_0x25c1eb['shift']());}}}(a44_0x2aad,0x32be5));import{existsSync,statSync}from'fs';import a44_0x551f1a from'chalk';function a44_0x2aad(){const _0x12e0e6=['Set\x20current\x20segment/folder\x20context\x20for\x20navigation','data','error','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','✔\x20Context\x20set\x20to:\x20','segment:use','Resolved\x20path\x20type:\x20','400671UCsDxw','cyan','fullPath','resolvePathToResource','1424OSlfor','session','4OyLDzv','red','Use:\x20tdx\x20segment\x20use\x20','dim','Site:\x20','28437CipjqA','green','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','segment','type','log','segments','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','4772270MSTtpA','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','description','\x27...','parentName','name','Examples:','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Resolving\x20path\x20\x27','folderId','isAbsolute','Resolved\x20relative\x20path\x20to:\x20','parent_segment','11599LenRKh','213999lYvCqz','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Target\x20path:\x20','verbose','segmentPath','Usage:\x20tdx\x20segment\x20use\x20<path>','2JVlDIB','execute','join','isDirectory','slice','parentId','851466mrgWvd','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderPath','Folder\x20ID:\x20','305480EXZINN'];a44_0x2aad=function(){return _0x12e0e6;};return a44_0x2aad();}function a44_0x24c0(_0x3f3925,_0x129ead){_0x3f3925=_0x3f3925-0x160;const _0x2aad57=a44_0x2aad();let _0x24c081=_0x2aad57[_0x3f3925];return _0x24c081;}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a44_0x2431dc(0x163)]=a44_0x2431dc(0x184);[a44_0x2431dc(0x160)]=a44_0x2431dc(0x17e);async[a44_0x2431dc(0x173)](_0x124eb1){const _0x480971=a44_0x2431dc,{options:_0x2fd4a4,args:_0x2ff30c,tdx:_0x28d42b}=_0x124eb1;if(_0x2ff30c['length']===0x0)return console[_0x480971(0x180)](a44_0x551f1a[_0x480971(0x18d)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x480971(0x180)](_0x480971(0x171)),console[_0x480971(0x180)](_0x480971(0x164)),console[_0x480971(0x180)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x480971(0x180)](_0x480971(0x19b)),console[_0x480971(0x180)](_0x480971(0x193)),console['error'](_0x480971(0x16d)),0x1;const _0x2a3e5c=_0x2ff30c[0x0],_0x59ab09=_0x2fd4a4[_0x480971(0x18b)];try{if(_0x2a3e5c==='/')return saveSessionContext({'segment_path':undefined},_0x59ab09),console[_0x480971(0x197)](a44_0x551f1a['green'](_0x480971(0x182))),0x0;if(existsSync(_0x2a3e5c)&&statSync(_0x2a3e5c)[_0x480971(0x175)]()){let _0x3140fc;try{_0x3140fc=findTdxConfig(_0x2a3e5c);}catch{return console['error'](a44_0x551f1a[_0x480971(0x18d)](_0x480971(0x199)+_0x2a3e5c)),console[_0x480971(0x180)](a44_0x551f1a[_0x480971(0x187)](_0x480971(0x179))),0x1;}const _0x5e6ea0=_0x3140fc['config'][_0x480971(0x16a)];return saveSessionContext({'segment_path':_0x5e6ea0,'parent_segment':_0x5e6ea0},_0x59ab09),console[_0x480971(0x197)](a44_0x551f1a[_0x480971(0x192)](_0x480971(0x183)+a44_0x551f1a[_0x480971(0x187)](_0x5e6ea0))),0x0;}const _0x378137=_0x2fd4a4[_0x480971(0x170)];let _0x2545a9=_0x2a3e5c;const _0x1b860e=parsePath(_0x2a3e5c);if(!_0x1b860e[_0x480971(0x168)]){if(!_0x378137)return console[_0x480971(0x180)](a44_0x551f1a['red'](_0x480971(0x17a))),console[_0x480971(0x180)](a44_0x551f1a[_0x480971(0x187)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x2a3e5c==='..'){const _0x9055b9=_0x378137['split']('/')[_0x480971(0x176)](0x0,-0x1)[_0x480971(0x174)]('/');_0x2545a9=_0x9055b9||'/';}else _0x2a3e5c==='.'?_0x2545a9=_0x378137:_0x2545a9=_0x378137+'/'+_0x2a3e5c;_0x2fd4a4['verbose']&&console['error'](_0x480971(0x169)+_0x2545a9);}if(_0x2545a9==='/'||_0x2545a9==='')return saveSessionContext({'segment_path':undefined},_0x59ab09),console[_0x480971(0x197)](a44_0x551f1a[_0x480971(0x192)](_0x480971(0x182))),0x0;_0x2545a9=normalizePath(_0x2545a9);const _0x3ba099=parsePath(_0x2545a9)[_0x480971(0x198)];if(_0x3ba099['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x59ab09),console['log'](a44_0x551f1a['green'](_0x480971(0x182))),0x0;_0x2fd4a4[_0x480971(0x16f)]&&(console[_0x480971(0x180)](_0x480971(0x190)+_0x2fd4a4['site']),console[_0x480971(0x180)](_0x480971(0x16e)+_0x2545a9));const _0xa278f5=await withSpinner(_0x480971(0x166)+_0x2545a9+_0x480971(0x161),()=>_0x28d42b[_0x480971(0x195)][_0x480971(0x189)](_0x2545a9),{'verbose':_0x2fd4a4['verbose']}),_0x13930a=_0xa278f5[_0x480971(0x17f)];_0x2fd4a4[_0x480971(0x16f)]&&(console[_0x480971(0x180)](_0x480971(0x185)+_0x13930a['type']),console[_0x480971(0x180)]('Parent\x20ID:\x20'+_0x13930a[_0x480971(0x177)]),_0x13930a[_0x480971(0x167)]&&console['error'](_0x480971(0x17c)+_0x13930a[_0x480971(0x167)]));if(_0x13930a[_0x480971(0x196)]===_0x480971(0x195))return console[_0x480971(0x180)](a44_0x551f1a['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x480971(0x180)](_0x480971(0x165)),console[_0x480971(0x180)](a44_0x551f1a[_0x480971(0x187)](_0x480971(0x18e)+_0x13930a[_0x480971(0x162)]+(_0x13930a[_0x480971(0x17b)]?'/'+_0x13930a[_0x480971(0x17b)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x13930a['fullPath'],'parent_segment':_0x13930a['parentName']},_0x59ab09),console[_0x480971(0x197)](a44_0x551f1a[_0x480971(0x192)](_0x480971(0x183)+a44_0x551f1a['cyan'](_0x13930a[_0x480971(0x188)]))),_0x2fd4a4[_0x480971(0x16f)]&&(console['error'](a44_0x551f1a[_0x480971(0x18f)](_0x480971(0x181))),console[_0x480971(0x180)](a44_0x551f1a[_0x480971(0x18f)](_0x480971(0x194)))),0x0;}catch(_0x18aa73){throw _0x18aa73;}}}
@@ -1 +1 @@
1
- function a45_0x5361(){const _0x5841b8=['Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','filePath','green','valid','12kMTmXG','red','message','cwd','warningCount','file','5064GpCqsd','):\x20','error','✔\x20All\x20','\x20error(s)','33ieVTvB','\x20warning(s)\x20found','\x20file(s)\x20valid','Error:\x20Directory\x20not\x20found:\x20','2079288xnxLke','log','\x20valid','length','no_parent','yellow','\x20warning(s)','targetDir','138335HAZoCg','2317385fsUJmB','segment:validate','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','endsWith','verbose','hasErrors','helpText','\x20file(s)\x20with\x20errors,\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','857080FzDEsD','execute','name','validCount','1413Drltwd','111SiGDbN','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dim','Error:\x20','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','12568SXHlXC','warnings','203871sfVSMi','cyan'];a45_0x5361=function(){return _0x5841b8;};return a45_0x5361();}const a45_0x31463f=a45_0x4323;(function(_0x13b18f,_0x3caa08){const _0x5b2ec2=a45_0x4323,_0x52cd03=_0x13b18f();while(!![]){try{const _0x3d3f7a=parseInt(_0x5b2ec2(0x148))/0x1+parseInt(_0x5b2ec2(0x146))/0x2*(parseInt(_0x5b2ec2(0x13f))/0x3)+parseInt(_0x5b2ec2(0x128))/0x4+parseInt(_0x5b2ec2(0x130))/0x5*(parseInt(_0x5b2ec2(0x14e))/0x6)+-parseInt(_0x5b2ec2(0x131))/0x7+-parseInt(_0x5b2ec2(0x11f))/0x8*(parseInt(_0x5b2ec2(0x13e))/0x9)+parseInt(_0x5b2ec2(0x13a))/0xa*(-parseInt(_0x5b2ec2(0x124))/0xb);if(_0x3d3f7a===_0x3caa08)break;else _0x52cd03['push'](_0x52cd03['shift']());}catch(_0x70079e){_0x52cd03['push'](_0x52cd03['shift']());}}}(a45_0x5361,0x4f187));import{BaseCommand}from'./command.js';function a45_0x4323(_0x132608,_0x3ede6d){_0x132608=_0x132608-0x11b;const _0x536185=a45_0x5361();let _0x43233e=_0x536185[_0x132608];return _0x43233e;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x53e069 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a45_0x31463f(0x13c)]=a45_0x31463f(0x132);[a45_0x31463f(0x143)]=a45_0x31463f(0x139);async[a45_0x31463f(0x13b)](_0x529907){const _0x2108f1=a45_0x31463f,{options:_0x592427,args:_0xc90676}=_0x529907,_0xe4c390=_0x592427,_0x33e0fd=await resolveTarget({'arg':_0xc90676[0x0],'contextParent':_0x592427['parentSegment'],'cwd':process[_0x2108f1(0x11c)]()});if(!isSuccessfulResolution(_0x33e0fd))return _0x33e0fd['errorCode']===_0x2108f1(0x12c)?(console[_0x2108f1(0x121)](a45_0x53e069['yellow'](_0x2108f1(0x145))),console[_0x2108f1(0x121)](_0x2108f1(0x14a)),console[_0x2108f1(0x121)](_0x2108f1(0x133)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x2108f1(0x121)](a45_0x53e069['red'](_0x2108f1(0x142)+_0x33e0fd[_0x2108f1(0x11b)]+'\x0a')),_0x33e0fd[_0x2108f1(0x137)]&&console[_0x2108f1(0x121)](a45_0x53e069[_0x2108f1(0x149)](_0x33e0fd[_0x2108f1(0x137)]))),0x1;const _0x2a345a=_0x33e0fd[_0x2108f1(0x12f)],_0x1fe8e5=_0x33e0fd['type']===_0x2108f1(0x11e)?_0x33e0fd[_0x2108f1(0x14b)]:undefined;if(!_0x1fe8e5&&!existsSync(_0x2a345a))return console[_0x2108f1(0x121)](a45_0x53e069[_0x2108f1(0x14f)](_0x2108f1(0x127)+_0x2a345a+'\x0a')),0x1;let _0x2eb777;if(_0x1fe8e5){if(!_0x1fe8e5[_0x2108f1(0x134)]('.yml')&&!_0x1fe8e5['endsWith']('.yaml'))return console['error'](a45_0x53e069[_0x2108f1(0x14f)](_0x2108f1(0x140)+_0x1fe8e5+'\x0a')),0x1;_0x2eb777=[_0x1fe8e5];}else _0x2eb777=findYamlFiles(_0x2a345a);if(_0x2eb777[_0x2108f1(0x12b)]===0x0)return console['error'](a45_0x53e069[_0x2108f1(0x14f)](_0x2108f1(0x144)+_0x2a345a+'\x0a')),0x1;const _0x39ed8f=validateYamlFiles(_0x2eb777,_0x2a345a),_0x50e99e=calculateSummary(_0x39ed8f);for(const _0x593f23 of _0x39ed8f){if(!isValidationResult(_0x593f23))continue;const {relativePath:_0x3ff4bb,source:_0x28bddf,result:_0x48e9bd,fileType:_0x23d6db}=_0x593f23,_0x3d9403=_0x23d6db;if(_0x48e9bd[_0x2108f1(0x14d)]&&_0x48e9bd[_0x2108f1(0x147)]['length']===0x0)_0xe4c390[_0x2108f1(0x135)]&&console[_0x2108f1(0x129)](a45_0x53e069[_0x2108f1(0x14c)]('✔\x20'+_0x3ff4bb)+a45_0x53e069[_0x2108f1(0x141)]('\x20('+_0x3d9403+')'));else _0x48e9bd[_0x2108f1(0x14d)]?(console[_0x2108f1(0x129)](a45_0x53e069[_0x2108f1(0x12d)]('⚠\x20'+_0x3ff4bb)+a45_0x53e069[_0x2108f1(0x141)]('\x20('+_0x3d9403+_0x2108f1(0x120)+_0x48e9bd[_0x2108f1(0x147)][_0x2108f1(0x12b)]+_0x2108f1(0x12e))),console['log'](formatValidationResult(_0x48e9bd,_0x28bddf,_0x3ff4bb))):(console[_0x2108f1(0x129)](a45_0x53e069[_0x2108f1(0x14f)]('✖\x20'+_0x3ff4bb)+a45_0x53e069[_0x2108f1(0x141)]('\x20('+_0x3d9403+_0x2108f1(0x120)+_0x48e9bd['errors'][_0x2108f1(0x12b)]+_0x2108f1(0x123))),console[_0x2108f1(0x129)](formatValidationResult(_0x48e9bd,_0x28bddf,_0x3ff4bb)));}return console[_0x2108f1(0x129)](''),_0x50e99e[_0x2108f1(0x136)]?(console[_0x2108f1(0x129)](a45_0x53e069[_0x2108f1(0x14f)]('Validation\x20failed:\x20'+_0x50e99e['invalidCount']+_0x2108f1(0x138)+_0x50e99e[_0x2108f1(0x13d)]+_0x2108f1(0x12a))),_0x50e99e['warningCount']>0x0&&console[_0x2108f1(0x129)](a45_0x53e069[_0x2108f1(0x12d)](_0x50e99e['warningCount']+_0x2108f1(0x125))),0x1):(console[_0x2108f1(0x129)](a45_0x53e069[_0x2108f1(0x14c)](_0x2108f1(0x122)+_0x50e99e[_0x2108f1(0x13d)]+_0x2108f1(0x126))),_0x50e99e[_0x2108f1(0x11d)]>0x0&&console['log'](a45_0x53e069[_0x2108f1(0x12d)](_0x50e99e[_0x2108f1(0x11d)]+'\x20warning(s)\x20found')),0x0);}}
1
+ function a45_0x48da(_0x26ae25,_0x3d6a8e){_0x26ae25=_0x26ae25-0x114;const _0x11e176=a45_0x11e1();let _0x48da38=_0x11e176[_0x26ae25];return _0x48da38;}const a45_0x37aa5c=a45_0x48da;(function(_0x3f5c1d,_0x2f14af){const _0xc925aa=a45_0x48da,_0x28a932=_0x3f5c1d();while(!![]){try{const _0x4907ce=parseInt(_0xc925aa(0x136))/0x1+-parseInt(_0xc925aa(0x12b))/0x2*(parseInt(_0xc925aa(0x11e))/0x3)+-parseInt(_0xc925aa(0x138))/0x4+-parseInt(_0xc925aa(0x116))/0x5+-parseInt(_0xc925aa(0x12c))/0x6*(-parseInt(_0xc925aa(0x133))/0x7)+parseInt(_0xc925aa(0x121))/0x8*(-parseInt(_0xc925aa(0x11f))/0x9)+parseInt(_0xc925aa(0x114))/0xa;if(_0x4907ce===_0x2f14af)break;else _0x28a932['push'](_0x28a932['shift']());}catch(_0x2b7f4a){_0x28a932['push'](_0x28a932['shift']());}}}(a45_0x11e1,0x5e0c4));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x5dfb61 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a45_0x11e1(){const _0x459133=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','hasErrors','\x20valid','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','cyan','\x20warning(s)','message','verbose','dim','171514hQXTOp','438ZEBgZJ','validCount','\x20warning(s)\x20found','name','Error:\x20','helpText','type','3934ZMgwnf','length','\x20file(s)\x20valid','295265VhnzHS','warningCount','62560cagdUZ','filePath','yellow','valid','parentSegment','errorCode','\x20error(s)','execute','description','endsWith','.yml','Validate\x20segment\x20and\x20journey\x20YAML\x20files','14322410QdbCww','log','3777865XEdjft','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Directory\x20not\x20found:\x20','green','\x20file(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','error','3rnfYxN','18scwlrd','):\x20','2105368FEMIaw'];a45_0x11e1=function(){return _0x459133;};return a45_0x11e1();}export class SegmentValidateCommand extends BaseCommand{[a45_0x37aa5c(0x12f)]='segment:validate';[a45_0x37aa5c(0x140)]=a45_0x37aa5c(0x143);async[a45_0x37aa5c(0x13f)](_0x3fcf7b){const _0x27f833=a45_0x37aa5c,{options:_0x28492e,args:_0x27fb9e}=_0x3fcf7b,_0x5c1630=_0x28492e,_0x5bc909=await resolveTarget({'arg':_0x27fb9e[0x0],'contextParent':_0x28492e[_0x27f833(0x13c)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5bc909))return _0x5bc909[_0x27f833(0x13d)]==='no_parent'?(console['error'](a45_0x5dfb61[_0x27f833(0x13a)](_0x27f833(0x117))),console[_0x27f833(0x11d)](_0x27f833(0x125)),console[_0x27f833(0x11d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x27f833(0x11d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x27f833(0x11d)](a45_0x5dfb61[_0x27f833(0x11c)](_0x27f833(0x130)+_0x5bc909[_0x27f833(0x128)]+'\x0a')),_0x5bc909[_0x27f833(0x131)]&&console['error'](a45_0x5dfb61[_0x27f833(0x126)](_0x5bc909[_0x27f833(0x131)]))),0x1;const _0x3c22a8=_0x5bc909['targetDir'],_0x9ae726=_0x5bc909[_0x27f833(0x132)]==='file'?_0x5bc909[_0x27f833(0x139)]:undefined;if(!_0x9ae726&&!existsSync(_0x3c22a8))return console['error'](a45_0x5dfb61[_0x27f833(0x11c)](_0x27f833(0x118)+_0x3c22a8+'\x0a')),0x1;let _0x56ec84;if(_0x9ae726){if(!_0x9ae726['endsWith'](_0x27f833(0x142))&&!_0x9ae726[_0x27f833(0x141)]('.yaml'))return console[_0x27f833(0x11d)](a45_0x5dfb61[_0x27f833(0x11c)](_0x27f833(0x122)+_0x9ae726+'\x0a')),0x1;_0x56ec84=[_0x9ae726];}else _0x56ec84=findYamlFiles(_0x3c22a8);if(_0x56ec84['length']===0x0)return console['error'](a45_0x5dfb61[_0x27f833(0x11c)](_0x27f833(0x11b)+_0x3c22a8+'\x0a')),0x1;const _0x2dd47e=validateYamlFiles(_0x56ec84,_0x3c22a8),_0x4a620d=calculateSummary(_0x2dd47e);for(const _0x53d315 of _0x2dd47e){if(!isValidationResult(_0x53d315))continue;const {relativePath:_0x8d4f6,source:_0x19f63d,result:_0x42d3c0,fileType:_0x180c84}=_0x53d315,_0x1b17e1=_0x180c84;if(_0x42d3c0[_0x27f833(0x13b)]&&_0x42d3c0['warnings'][_0x27f833(0x134)]===0x0)_0x5c1630[_0x27f833(0x129)]&&console[_0x27f833(0x115)](a45_0x5dfb61['green']('✔\x20'+_0x8d4f6)+a45_0x5dfb61[_0x27f833(0x12a)]('\x20('+_0x1b17e1+')'));else _0x42d3c0[_0x27f833(0x13b)]?(console['log'](a45_0x5dfb61[_0x27f833(0x13a)]('⚠\x20'+_0x8d4f6)+a45_0x5dfb61[_0x27f833(0x12a)]('\x20('+_0x1b17e1+'):\x20'+_0x42d3c0['warnings'][_0x27f833(0x134)]+_0x27f833(0x127))),console[_0x27f833(0x115)](formatValidationResult(_0x42d3c0,_0x19f63d,_0x8d4f6))):(console[_0x27f833(0x115)](a45_0x5dfb61[_0x27f833(0x11c)]('✖\x20'+_0x8d4f6)+a45_0x5dfb61[_0x27f833(0x12a)]('\x20('+_0x1b17e1+_0x27f833(0x120)+_0x42d3c0['errors'][_0x27f833(0x134)]+_0x27f833(0x13e))),console['log'](formatValidationResult(_0x42d3c0,_0x19f63d,_0x8d4f6)));}return console['log'](''),_0x4a620d[_0x27f833(0x123)]?(console['log'](a45_0x5dfb61[_0x27f833(0x11c)]('Validation\x20failed:\x20'+_0x4a620d['invalidCount']+_0x27f833(0x11a)+_0x4a620d[_0x27f833(0x12d)]+_0x27f833(0x124))),_0x4a620d[_0x27f833(0x137)]>0x0&&console['log'](a45_0x5dfb61[_0x27f833(0x13a)](_0x4a620d[_0x27f833(0x137)]+_0x27f833(0x12e))),0x1):(console[_0x27f833(0x115)](a45_0x5dfb61[_0x27f833(0x119)]('✔\x20All\x20'+_0x4a620d[_0x27f833(0x12d)]+_0x27f833(0x135))),_0x4a620d[_0x27f833(0x137)]>0x0&&console[_0x27f833(0x115)](a45_0x5dfb61[_0x27f833(0x13a)](_0x4a620d[_0x27f833(0x137)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- const a46_0x52f5ee=a46_0x5266;(function(_0x4f55ab,_0x340f14){const _0x473214=a46_0x5266,_0x2ae634=_0x4f55ab();while(!![]){try{const _0x3449f1=-parseInt(_0x473214(0x142))/0x1*(-parseInt(_0x473214(0x12a))/0x2)+parseInt(_0x473214(0x14e))/0x3+parseInt(_0x473214(0x15f))/0x4*(-parseInt(_0x473214(0x125))/0x5)+parseInt(_0x473214(0x151))/0x6+parseInt(_0x473214(0x13d))/0x7+-parseInt(_0x473214(0x140))/0x8+-parseInt(_0x473214(0x167))/0x9;if(_0x3449f1===_0x340f14)break;else _0x2ae634['push'](_0x2ae634['shift']());}catch(_0x29c26b){_0x2ae634['push'](_0x2ae634['shift']());}}}(a46_0x9dea,0xe0e9c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x5266(_0x169999,_0x5c6d66){_0x169999=_0x169999-0x116;const _0x9dea8a=a46_0x9dea();let _0x526665=_0x9dea8a[_0x169999];return _0x526665;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a46_0x9dea(){const _0x335c13=['20306385cCkepe','/j/da','\x5c$&','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','localeCompare','description','Resolving\x20path\x20\x27','folders','\x20match','log','Building\x20hierarchy\x20tree...','(not\x20set)','jsonl','Error:\x20No\x20parent\x20segment\x20context\x20set.','execute','parentId','journeys','/app/ps/','\x27...','2593105lnVfQP','journey','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','filter','padEnd','863418OlYzae','toLowerCase','Set\x20a\x20parent\x20segment\x20context\x20first:','Resolving\x20parent\x20segment\x20\x27','\x20segment','...','name','cause','\x20folder','segment',',\x20and\x20',']\x20matching\x20\x27','Folder\x20ID:\x20','✔\x20Found\x20','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','recursive','/e/','Site:\x20','format','9382415sbZNDa','map','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','5422072ooYogT','\x20\x20Cause:\x20','2qVANJG','Listing\x20folders,\x20segments,\x20and\x20journeys...','listRecursive','List\x20folders\x20and\x20child\x20segments','length','Error:\x20','includes','No\x20folders\x20or\x20segments\x20match\x20','verbose','listUnified','\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.','test','4194075XZVzCW','data','(id\x20','7744332kXqyRY','\x20matching\x20\x27','error','size','type','journeyBundleName','site','Parent\x20ID:\x20','resolvePathToResource','json','✔\x20Built\x20tree\x20with\x20','sort','maxDepth','segments','8PWKgUd','dim','folder','replace','folderId','path','searchByName','\x20journey'];a46_0x9dea=function(){return _0x335c13;};return a46_0x9dea();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x1ad9db from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0x52f5ee(0x130)]='segments';[a46_0x52f5ee(0x117)]=a46_0x52f5ee(0x145);async[a46_0x52f5ee(0x120)](_0x51d7c4){const _0x36ab19=a46_0x52f5ee,{options:_0x2964d5,args:_0x455e8a}=_0x51d7c4,_0x10e9dc=_0x2964d5[_0x36ab19(0x139)],_0x44e385=_0x455e8a[0x0];try{const _0x3af6da=_0x2964d5['parentSegment'];_0x2964d5[_0x36ab19(0x14a)]&&(console[_0x36ab19(0x153)](_0x36ab19(0x13b)+_0x2964d5[_0x36ab19(0x157)]),console['error']('Parent\x20segment\x20context:\x20'+(_0x3af6da||_0x36ab19(0x11d))),_0x44e385&&console[_0x36ab19(0x153)]('Folder/pattern\x20arg:\x20'+_0x44e385),_0x10e9dc&&console[_0x36ab19(0x153)]('Recursive\x20mode:\x20enabled'));if(!_0x3af6da)return console['error'](_0x36ab19(0x11f)),console['error'](''),console[_0x36ab19(0x153)](_0x36ab19(0x12c)),console[_0x36ab19(0x153)](_0x36ab19(0x16a)),console[_0x36ab19(0x153)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x36ab19(0x153)](''),console['error'](_0x36ab19(0x138)),0x1;if(_0x44e385&&_0x10e9dc)return await this[_0x36ab19(0x165)](_0x51d7c4,_0x3af6da,_0x44e385);const _0x20df3b=_0x44e385&&(_0x44e385[_0x36ab19(0x148)]('*')||_0x44e385['includes']('?'));if(_0x20df3b)return await this['listWithPattern'](_0x51d7c4,_0x3af6da,_0x44e385);const _0x4bb748=_0x44e385?_0x3af6da+'/'+_0x44e385:_0x3af6da;return _0x10e9dc?await this[_0x36ab19(0x144)](_0x51d7c4,_0x4bb748):await this[_0x36ab19(0x14b)](_0x51d7c4,_0x4bb748);}catch(_0x556c43){if(_0x556c43 instanceof SDKError)return console[_0x36ab19(0x153)](_0x36ab19(0x147)+_0x556c43['message']),_0x556c43[_0x36ab19(0x131)]&&console[_0x36ab19(0x153)](_0x36ab19(0x141)+_0x556c43[_0x36ab19(0x131)]),0x1;throw _0x556c43;}}async['searchByName'](_0x4402e8,_0x260945,_0x3f5c11){const _0x37928f=a46_0x52f5ee,{options:_0xde9cc2,tdx:_0x50945a}=_0x4402e8,_0x131408='\x22'+_0x3f5c11+'\x22',_0x384acf=await withSpinner('Resolving\x20path\x20\x27'+_0x260945+_0x37928f(0x124),()=>_0x50945a[_0x37928f(0x133)]['resolvePathToResource'](_0x260945),{'verbose':_0xde9cc2[_0x37928f(0x14a)]}),_0x3e9146=_0x384acf[_0x37928f(0x14f)],_0x36d057=_0xde9cc2[_0x37928f(0x15d)]||0xa,_0x4432ab=await withSpinner(_0x37928f(0x13f)+_0x131408+_0x37928f(0x12f),()=>_0x50945a[_0x37928f(0x133)][_0x37928f(0x144)](_0x3e9146[_0x37928f(0x121)],_0x3e9146[_0x37928f(0x163)],0x0,_0x36d057),{'verbose':_0xde9cc2[_0x37928f(0x14a)]}),_0x5c3826=searchTreeByName(_0x4432ab[_0x37928f(0x14f)],_0x3f5c11),_0x286777=_0x2262e5=>getConsoleNextUrl(_0xde9cc2[_0x37928f(0x157)],_0x37928f(0x123)+_0x3e9146[_0x37928f(0x121)]+_0x37928f(0x13a)+_0x2262e5),_0x423874=[..._0x5c3826]['sort']((_0x2df1d8,_0x3ab8a5)=>_0x2df1d8[_0x37928f(0x164)]['localeCompare'](_0x3ab8a5['path'])),_0x466f28=0x32,_0x2b3546='Found\x20'+_0x5c3826[_0x37928f(0x146)]+_0x37928f(0x11a)+(_0x5c3826[_0x37928f(0x146)]!==0x1?'es':'');console[_0x37928f(0x153)](_0x5c3826[_0x37928f(0x146)]>_0x466f28?'✔\x20'+_0x2b3546+_0x37928f(0x14c):'✔\x20'+_0x2b3546);if(_0xde9cc2[_0x37928f(0x13c)]===_0x37928f(0x15a)||_0xde9cc2['format']===_0x37928f(0x11e)){const _0xc9ae68=_0x423874[_0x37928f(0x13e)](_0x521a39=>({..._0x521a39,..._0x521a39[_0x37928f(0x155)]===_0x37928f(0x133)?{'url':_0x286777(_0x521a39['id'])}:{}}));return await handleSDKOutput(_0xc9ae68,_0xde9cc2),0x0;}if(_0x5c3826[_0x37928f(0x146)]===0x0)return console[_0x37928f(0x11b)](_0x37928f(0x149)+_0x131408),0x0;for(const _0x158941 of _0x423874){console[_0x37928f(0x11b)](_0x158941[_0x37928f(0x155)][_0x37928f(0x129)](0x8)+'\x20'+_0x158941[_0x37928f(0x164)]+'\x20\x20'+a46_0x1ad9db[_0x37928f(0x160)](_0x37928f(0x150)+_0x158941['id']+')'));}const _0x79de40=_0x5c3826['filter'](_0x3a0dbf=>_0x3a0dbf[_0x37928f(0x155)]===_0x37928f(0x133)),_0x13cdc0=new Set(_0x79de40['map'](_0x49bb18=>_0x49bb18[_0x37928f(0x130)][_0x37928f(0x12b)]()))[_0x37928f(0x154)]===0x1;return _0x79de40['length']>0x1&&_0x13cdc0&&console[_0x37928f(0x11b)](a46_0x1ad9db[_0x37928f(0x160)]('\x0a'+_0x79de40['length']+_0x37928f(0x127))),0x0;}async['listWithPattern'](_0x1f3dfe,_0x1cf9cf,_0xd4e0f0){const _0x4c6d3c=a46_0x52f5ee,{options:_0x292378,tdx:_0x4219ce}=_0x1f3dfe,_0x410418=await withSpinner(_0x4c6d3c(0x12d)+_0x1cf9cf+_0x4c6d3c(0x124),()=>_0x4219ce[_0x4c6d3c(0x133)][_0x4c6d3c(0x159)](_0x1cf9cf),{'verbose':_0x292378[_0x4c6d3c(0x14a)]}),_0xf7e04b=_0x410418[_0x4c6d3c(0x14f)],_0x5419e7=await withSpinner(_0x4c6d3c(0x143),()=>_0x4219ce['segment']['listUnifiedWithJourneys'](_0xf7e04b[_0x4c6d3c(0x121)],_0xf7e04b[_0x4c6d3c(0x163)]),{'verbose':_0x292378[_0x4c6d3c(0x14a)]}),{folders:_0x31c5ce,segments:_0x4a494d,journeys:_0xfaa724}=_0x5419e7[_0x4c6d3c(0x14f)],_0x49b37a=_0xd4e0f0[_0x4c6d3c(0x162)](/[.+^${}()|[\]\\]/g,_0x4c6d3c(0x169))[_0x4c6d3c(0x162)](/\*/g,'.*')[_0x4c6d3c(0x162)](/\?/g,'.'),_0x5edbf5=new RegExp('^'+_0x49b37a+'$','i'),_0x1d4de2=_0x31c5ce['filter'](_0x1cf8aa=>_0x5edbf5[_0x4c6d3c(0x14d)](_0x1cf8aa[_0x4c6d3c(0x130)])),_0x430d5e=_0x4a494d[_0x4c6d3c(0x128)](_0x21854e=>_0x5edbf5[_0x4c6d3c(0x14d)](_0x21854e[_0x4c6d3c(0x130)])),_0x4ac214=_0xfaa724[_0x4c6d3c(0x128)](_0x4057c5=>_0x5edbf5[_0x4c6d3c(0x14d)](_0x4057c5[_0x4c6d3c(0x156)])),_0x22c1cd=_0x1d4de2[_0x4c6d3c(0x146)]+_0x430d5e['length']+_0x4ac214[_0x4c6d3c(0x146)];console[_0x4c6d3c(0x153)]('✔\x20Found\x20'+_0x1d4de2[_0x4c6d3c(0x146)]+_0x4c6d3c(0x132)+(_0x1d4de2['length']!==0x1?'s':'')+',\x20'+_0x430d5e[_0x4c6d3c(0x146)]+'\x20segment'+(_0x430d5e[_0x4c6d3c(0x146)]!==0x1?'s':'')+_0x4c6d3c(0x134)+_0x4ac214[_0x4c6d3c(0x146)]+_0x4c6d3c(0x166)+(_0x4ac214[_0x4c6d3c(0x146)]!==0x1?'s':'')+_0x4c6d3c(0x152)+_0xd4e0f0+'\x27');const _0xa30699=_0x1a1bb9=>{const _0x1ae92a=_0x4c6d3c;return getConsoleNextUrl(_0x292378['site'],_0x1ae92a(0x123)+_0xf7e04b['parentId']+_0x1ae92a(0x13a)+_0x1a1bb9);},_0x3e1403=_0x292378[_0x4c6d3c(0x13c)]===_0x4c6d3c(0x15a)||_0x292378[_0x4c6d3c(0x13c)]===_0x4c6d3c(0x11e);if(_0x3e1403){const _0x5ad439=[..._0x1d4de2[_0x4c6d3c(0x13e)](_0x2aed09=>({..._0x2aed09,'type':_0x4c6d3c(0x161)})),..._0x430d5e[_0x4c6d3c(0x13e)](_0x224321=>({..._0x224321,'type':_0x4c6d3c(0x133),'url':_0xa30699(_0x224321['id'])})),..._0x4ac214['map'](_0x1afe6f=>({..._0x1afe6f,'name':_0x1afe6f[_0x4c6d3c(0x156)],'type':_0x4c6d3c(0x126)}))][_0x4c6d3c(0x15c)]((_0x180b99,_0x97de14)=>_0x180b99[_0x4c6d3c(0x130)][_0x4c6d3c(0x116)](_0x97de14['name']));await handleSDKOutput(_0x5ad439,_0x292378);}else{if(_0x22c1cd===0x0)console[_0x4c6d3c(0x11b)]('No\x20items\x20match\x20pattern:\x20'+_0xd4e0f0);else{console[_0x4c6d3c(0x11b)](a46_0x1ad9db['dim']('['+_0x1cf9cf+_0x4c6d3c(0x135)+_0xd4e0f0+'\x27'));const _0x402886=formatFlatList(_0x1d4de2,_0x430d5e,{'showMetadata':!![],'getSegmentUrl':_0xa30699},_0x4ac214);console[_0x4c6d3c(0x11b)](_0x402886);}}return 0x0;}async['listUnified'](_0x4f441b,_0x2d812c){const _0x34f4f9=a46_0x52f5ee,{options:_0x41266f,tdx:_0x1507c5}=_0x4f441b,_0x588903=await withSpinner(_0x34f4f9(0x118)+_0x2d812c+'\x27...',()=>_0x1507c5['segment'][_0x34f4f9(0x159)](_0x2d812c),{'verbose':_0x41266f[_0x34f4f9(0x14a)]}),_0x1b6c73=_0x588903[_0x34f4f9(0x14f)];_0x41266f[_0x34f4f9(0x14a)]&&(console[_0x34f4f9(0x153)](_0x34f4f9(0x158)+_0x1b6c73[_0x34f4f9(0x121)]),_0x1b6c73[_0x34f4f9(0x163)]&&console[_0x34f4f9(0x153)](_0x34f4f9(0x136)+_0x1b6c73[_0x34f4f9(0x163)]));const _0x7b97b4=await withSpinner(_0x34f4f9(0x143),()=>_0x1507c5['segment']['listUnifiedWithJourneys'](_0x1b6c73[_0x34f4f9(0x121)],_0x1b6c73[_0x34f4f9(0x163)]),{'verbose':_0x41266f['verbose']}),{folders:_0x4d3fb4,segments:_0x2e1952,journeys:_0x1fcd50}=_0x7b97b4['data'],_0x295387=_0x4d3fb4['length']+_0x2e1952[_0x34f4f9(0x146)]+_0x1fcd50[_0x34f4f9(0x146)];console[_0x34f4f9(0x153)](_0x34f4f9(0x137)+_0x4d3fb4[_0x34f4f9(0x146)]+_0x34f4f9(0x132)+(_0x4d3fb4[_0x34f4f9(0x146)]!==0x1?'s':'')+',\x20'+_0x2e1952['length']+_0x34f4f9(0x12e)+(_0x2e1952[_0x34f4f9(0x146)]!==0x1?'s':'')+',\x20and\x20'+_0x1fcd50['length']+_0x34f4f9(0x166)+(_0x1fcd50[_0x34f4f9(0x146)]!==0x1?'s':''));const _0x3810cd=_0x1a80e1=>{const _0x2e5240=_0x34f4f9;return getConsoleNextUrl(_0x41266f[_0x2e5240(0x157)],_0x2e5240(0x123)+_0x1b6c73['parentId']+'/e/'+_0x1a80e1);},_0x272b6f=_0x3d48d3=>{const _0x4fd096=_0x34f4f9;return getConsoleNextUrl(_0x41266f[_0x4fd096(0x157)],_0x4fd096(0x123)+_0x1b6c73[_0x4fd096(0x121)]+_0x4fd096(0x13a)+_0x3d48d3+'/j/da');},_0x1daeed=_0x41266f[_0x34f4f9(0x13c)]===_0x34f4f9(0x15a)||_0x41266f['format']===_0x34f4f9(0x11e);if(_0x1daeed){const _0x18ad5b=[..._0x4d3fb4[_0x34f4f9(0x13e)](_0x380b42=>({..._0x380b42,'type':_0x34f4f9(0x161)})),..._0x2e1952[_0x34f4f9(0x13e)](_0x10d405=>({..._0x10d405,'type':_0x34f4f9(0x133),'url':_0x3810cd(_0x10d405['id'])})),..._0x1fcd50[_0x34f4f9(0x13e)](_0x43f6ec=>({..._0x43f6ec,'name':_0x43f6ec[_0x34f4f9(0x156)],'type':'journey','url':_0x272b6f(_0x43f6ec['id'])}))][_0x34f4f9(0x15c)]((_0x19a1c2,_0x24a437)=>_0x19a1c2['name'][_0x34f4f9(0x116)](_0x24a437[_0x34f4f9(0x130)]));await handleSDKOutput(_0x18ad5b,_0x41266f);}else{if(_0x295387===0x0)console[_0x34f4f9(0x11b)](a46_0x1ad9db['dim']('['+_0x2d812c+']')),console[_0x34f4f9(0x11b)]('(empty)');else{console[_0x34f4f9(0x11b)](a46_0x1ad9db[_0x34f4f9(0x160)]('['+_0x2d812c+']'));const _0x195993=formatFlatList(_0x4d3fb4,_0x2e1952,{'showMetadata':!![],'getSegmentUrl':_0x3810cd,'getJourneyUrl':_0x272b6f},_0x1fcd50);console[_0x34f4f9(0x11b)](_0x195993);}}return 0x0;}async[a46_0x52f5ee(0x144)](_0x37c12b,_0x22652b){const _0xa74c9c=a46_0x52f5ee,{options:_0x5bd214,tdx:_0x2877cd}=_0x37c12b,_0x1e9253=await withSpinner(_0xa74c9c(0x118)+_0x22652b+'\x27...',()=>_0x2877cd[_0xa74c9c(0x133)][_0xa74c9c(0x159)](_0x22652b),{'verbose':_0x5bd214[_0xa74c9c(0x14a)]}),_0x3449ce=_0x1e9253[_0xa74c9c(0x14f)];_0x5bd214[_0xa74c9c(0x14a)]&&(console['error'](_0xa74c9c(0x158)+_0x3449ce[_0xa74c9c(0x121)]),_0x3449ce[_0xa74c9c(0x163)]&&console[_0xa74c9c(0x153)](_0xa74c9c(0x136)+_0x3449ce[_0xa74c9c(0x163)]));const _0x4edf17=_0x5bd214['maxDepth']||0xa,_0x5515cb=await withSpinner(_0xa74c9c(0x11c),()=>_0x2877cd[_0xa74c9c(0x133)][_0xa74c9c(0x144)](_0x3449ce[_0xa74c9c(0x121)],_0x3449ce[_0xa74c9c(0x163)],0x0,_0x4edf17),{'verbose':_0x5bd214[_0xa74c9c(0x14a)]}),_0x31bcf3=_0x5515cb[_0xa74c9c(0x14f)],_0x43f504=_0x185955=>{const _0x5a9e3f=_0xa74c9c;let _0x40b0b4=0x0,_0x174d26=0x0,_0x3149c0=0x0;for(const _0x4bc138 of _0x185955){if(_0x4bc138[_0x5a9e3f(0x155)]===_0x5a9e3f(0x161))_0x40b0b4++;else{if(_0x4bc138[_0x5a9e3f(0x155)]===_0x5a9e3f(0x133))_0x174d26++;else{if(_0x4bc138[_0x5a9e3f(0x155)]===_0x5a9e3f(0x126))_0x3149c0++;}}if(_0x4bc138['children']){const _0x4f9765=_0x43f504(_0x4bc138['children']);_0x40b0b4+=_0x4f9765[_0x5a9e3f(0x119)],_0x174d26+=_0x4f9765[_0x5a9e3f(0x15e)],_0x3149c0+=_0x4f9765[_0x5a9e3f(0x122)];}}return{'folders':_0x40b0b4,'segments':_0x174d26,'journeys':_0x3149c0};},_0x4719fe=_0x43f504(_0x31bcf3);console[_0xa74c9c(0x153)](_0xa74c9c(0x15b)+_0x4719fe['folders']+_0xa74c9c(0x132)+(_0x4719fe[_0xa74c9c(0x119)]!==0x1?'s':'')+',\x20'+_0x4719fe[_0xa74c9c(0x15e)]+_0xa74c9c(0x12e)+(_0x4719fe['segments']!==0x1?'s':'')+',\x20and\x20'+_0x4719fe[_0xa74c9c(0x122)]+_0xa74c9c(0x166)+(_0x4719fe['journeys']!==0x1?'s':''));const _0x40ab91=_0x1d6908=>{const _0x8aba41=_0xa74c9c;return getConsoleNextUrl(_0x5bd214[_0x8aba41(0x157)],_0x8aba41(0x123)+_0x3449ce['parentId']+_0x8aba41(0x13a)+_0x1d6908);},_0x2325ee=_0xf513e1=>{const _0x5f0fdc=_0xa74c9c;return getConsoleNextUrl(_0x5bd214[_0x5f0fdc(0x157)],_0x5f0fdc(0x123)+_0x3449ce['parentId']+_0x5f0fdc(0x13a)+_0xf513e1+_0x5f0fdc(0x168));};if(_0x5bd214[_0xa74c9c(0x13c)]===_0xa74c9c(0x15a)||_0x5bd214[_0xa74c9c(0x13c)]===_0xa74c9c(0x11e))await handleSDKOutput(_0x31bcf3,_0x5bd214);else{console[_0xa74c9c(0x11b)](a46_0x1ad9db[_0xa74c9c(0x160)]('['+_0x22652b+']'));const _0x5ea156=formatTree(_0x31bcf3,{'showMetadata':!![],'getSegmentUrl':_0x40ab91,'getJourneyUrl':_0x2325ee});console['log'](_0x5ea156);}return 0x0;}}
1
+ function a46_0x5e2b(_0x3fac5b,_0x185205){_0x3fac5b=_0x3fac5b-0x18c;const _0x150088=a46_0x1500();let _0x5e2bfb=_0x150088[_0x3fac5b];return _0x5e2bfb;}const a46_0x5ae395=a46_0x5e2b;(function(_0x1dc7bd,_0x1a9517){const _0x82a02d=a46_0x5e2b,_0x5a93af=_0x1dc7bd();while(!![]){try{const _0x3ec511=parseInt(_0x82a02d(0x19c))/0x1*(-parseInt(_0x82a02d(0x1b4))/0x2)+-parseInt(_0x82a02d(0x1bb))/0x3*(parseInt(_0x82a02d(0x1dd))/0x4)+-parseInt(_0x82a02d(0x18c))/0x5+-parseInt(_0x82a02d(0x1a8))/0x6*(-parseInt(_0x82a02d(0x1db))/0x7)+-parseInt(_0x82a02d(0x1b1))/0x8*(parseInt(_0x82a02d(0x18d))/0x9)+parseInt(_0x82a02d(0x1a5))/0xa+parseInt(_0x82a02d(0x194))/0xb;if(_0x3ec511===_0x1a9517)break;else _0x5a93af['push'](_0x5a93af['shift']());}catch(_0x529a22){_0x5a93af['push'](_0x5a93af['shift']());}}}(a46_0x1500,0x54183));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x4c0c60 from'chalk';function a46_0x1500(){const _0x34801c=['207tJKBEF','name','format','log','/e/','No\x20items\x20match\x20pattern:\x20','\x5c$&','13583460rclSqd','type','searchByName','folders','Folder\x20ID:\x20','maxDepth','(empty)','description','279XTNtVu','Found\x20','✔\x20Found\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','verbose','Error:\x20No\x20parent\x20segment\x20context\x20set.','/j/da','filter','folderId','1448370eWuEzP','\x27...','Resolving\x20parent\x20segment\x20\x27','546zPtmny','cause','Searching\x20the\x20tree\x20for\x20names\x20matching\x20',',\x20and\x20','journeyBundleName','\x20match','resolvePathToResource','listUnifiedWithJourneys','dim','85784gwnxDg','\x20segment','size','1542IODqyi','json','children','✔\x20Built\x20tree\x20with\x20','segment','Resolving\x20path\x20\x27','(not\x20set)','6iCXkCO','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','data','journey','Folder/pattern\x20arg:\x20','path','execute','listUnified','sort','includes','toLowerCase','\x20folder','folder','test','length','parentId','Error:\x20','jsonl','site','journeys','/app/ps/','replace','parentSegment','message','\x20journey','Parent\x20ID:\x20','localeCompare','No\x20folders\x20or\x20segments\x20match\x20','Site:\x20','Building\x20hierarchy\x20tree...','recursive','listRecursive','5222BzePFE','\x20matching\x20\x27','223108gIrCHH','error','listWithPattern','Recursive\x20mode:\x20enabled','map','segments','2649200QhQOWe'];a46_0x1500=function(){return _0x34801c;};return a46_0x1500();}export class SegmentsCommand extends BaseCommand{[a46_0x5ae395(0x18e)]=a46_0x5ae395(0x1e2);[a46_0x5ae395(0x19b)]='List\x20folders\x20and\x20child\x20segments';async[a46_0x5ae395(0x1c1)](_0xaeaef5){const _0x12acfe=a46_0x5ae395,{options:_0x222f99,args:_0x1b9131}=_0xaeaef5,_0x395871=_0x222f99[_0x12acfe(0x1d9)],_0x4bdefd=_0x1b9131[0x0];try{const _0x1c3102=_0x222f99[_0x12acfe(0x1d1)];_0x222f99['verbose']&&(console['error'](_0x12acfe(0x1d7)+_0x222f99['site']),console[_0x12acfe(0x1de)]('Parent\x20segment\x20context:\x20'+(_0x1c3102||_0x12acfe(0x1ba))),_0x4bdefd&&console[_0x12acfe(0x1de)](_0x12acfe(0x1bf)+_0x4bdefd),_0x395871&&console[_0x12acfe(0x1de)](_0x12acfe(0x1e0)));if(!_0x1c3102)return console[_0x12acfe(0x1de)](_0x12acfe(0x1a1)),console[_0x12acfe(0x1de)](''),console[_0x12acfe(0x1de)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x12acfe(0x1de)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x12acfe(0x1de)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x12acfe(0x1de)](''),console[_0x12acfe(0x1de)](_0x12acfe(0x1bc)),0x1;if(_0x4bdefd&&_0x395871)return await this[_0x12acfe(0x196)](_0xaeaef5,_0x1c3102,_0x4bdefd);const _0x1e0425=_0x4bdefd&&(_0x4bdefd[_0x12acfe(0x1c4)]('*')||_0x4bdefd[_0x12acfe(0x1c4)]('?'));if(_0x1e0425)return await this['listWithPattern'](_0xaeaef5,_0x1c3102,_0x4bdefd);const _0x3e075b=_0x4bdefd?_0x1c3102+'/'+_0x4bdefd:_0x1c3102;return _0x395871?await this[_0x12acfe(0x1da)](_0xaeaef5,_0x3e075b):await this['listUnified'](_0xaeaef5,_0x3e075b);}catch(_0x5d1a60){if(_0x5d1a60 instanceof SDKError)return console[_0x12acfe(0x1de)](_0x12acfe(0x1cb)+_0x5d1a60[_0x12acfe(0x1d2)]),_0x5d1a60[_0x12acfe(0x1a9)]&&console[_0x12acfe(0x1de)]('\x20\x20Cause:\x20'+_0x5d1a60[_0x12acfe(0x1a9)]),0x1;throw _0x5d1a60;}}async[a46_0x5ae395(0x196)](_0x6b0680,_0x2aec86,_0x2917a9){const _0x556aca=a46_0x5ae395,{options:_0x1cbdfd,tdx:_0x529ea2}=_0x6b0680,_0x4bee84='\x22'+_0x2917a9+'\x22',_0x1af800=await withSpinner(_0x556aca(0x1b9)+_0x2aec86+_0x556aca(0x1a6),()=>_0x529ea2[_0x556aca(0x1b8)][_0x556aca(0x1ae)](_0x2aec86),{'verbose':_0x1cbdfd['verbose']}),_0x112fd2=_0x1af800[_0x556aca(0x1bd)],_0x523845=_0x1cbdfd[_0x556aca(0x199)]||0xa,_0x3afd87=await withSpinner(_0x556aca(0x1aa)+_0x4bee84+'...',()=>_0x529ea2['segment']['listRecursive'](_0x112fd2[_0x556aca(0x1ca)],_0x112fd2[_0x556aca(0x1a4)],0x0,_0x523845),{'verbose':_0x1cbdfd[_0x556aca(0x1a0)]}),_0x2315a2=searchTreeByName(_0x3afd87[_0x556aca(0x1bd)],_0x2917a9),_0x31ddc0=_0x4e537c=>getConsoleNextUrl(_0x1cbdfd[_0x556aca(0x1cd)],'/app/ps/'+_0x112fd2[_0x556aca(0x1ca)]+_0x556aca(0x191)+_0x4e537c),_0x149e6b=[..._0x2315a2][_0x556aca(0x1c3)]((_0x382852,_0x3d74ba)=>_0x382852['path'][_0x556aca(0x1d5)](_0x3d74ba[_0x556aca(0x1c0)])),_0x867695=0x32,_0x57ffbe=_0x556aca(0x19d)+_0x2315a2[_0x556aca(0x1c9)]+_0x556aca(0x1ad)+(_0x2315a2['length']!==0x1?'es':'');console[_0x556aca(0x1de)](_0x2315a2[_0x556aca(0x1c9)]>_0x867695?'✔\x20'+_0x57ffbe+'\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.':'✔\x20'+_0x57ffbe);if(_0x1cbdfd[_0x556aca(0x18f)]===_0x556aca(0x1b5)||_0x1cbdfd[_0x556aca(0x18f)]===_0x556aca(0x1cc)){const _0x52889e=_0x149e6b[_0x556aca(0x1e1)](_0x2c60a2=>({..._0x2c60a2,..._0x2c60a2[_0x556aca(0x195)]==='segment'?{'url':_0x31ddc0(_0x2c60a2['id'])}:{}}));return await handleSDKOutput(_0x52889e,_0x1cbdfd),0x0;}if(_0x2315a2['length']===0x0)return console[_0x556aca(0x190)](_0x556aca(0x1d6)+_0x4bee84),0x0;for(const _0x3fbbb1 of _0x149e6b){console[_0x556aca(0x190)](_0x3fbbb1[_0x556aca(0x195)]['padEnd'](0x8)+'\x20'+_0x3fbbb1[_0x556aca(0x1c0)]+'\x20\x20'+a46_0x4c0c60[_0x556aca(0x1b0)]('(id\x20'+_0x3fbbb1['id']+')'));}const _0x32418a=_0x2315a2[_0x556aca(0x1a3)](_0x1b849f=>_0x1b849f[_0x556aca(0x195)]===_0x556aca(0x1b8)),_0x5bc65f=new Set(_0x32418a['map'](_0x1168d3=>_0x1168d3[_0x556aca(0x18e)][_0x556aca(0x1c5)]()))[_0x556aca(0x1b3)]===0x1;return _0x32418a[_0x556aca(0x1c9)]>0x1&&_0x5bc65f&&console[_0x556aca(0x190)](a46_0x4c0c60['dim']('\x0a'+_0x32418a['length']+'\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.')),0x0;}async[a46_0x5ae395(0x1df)](_0xd9823f,_0x5ccdbb,_0x3127e3){const _0x4851b0=a46_0x5ae395,{options:_0xb497f0,tdx:_0x2560b6}=_0xd9823f,_0x56bf4d=await withSpinner(_0x4851b0(0x1a7)+_0x5ccdbb+_0x4851b0(0x1a6),()=>_0x2560b6[_0x4851b0(0x1b8)][_0x4851b0(0x1ae)](_0x5ccdbb),{'verbose':_0xb497f0[_0x4851b0(0x1a0)]}),_0x2ccf16=_0x56bf4d[_0x4851b0(0x1bd)],_0x2e5b83=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x2560b6[_0x4851b0(0x1b8)][_0x4851b0(0x1af)](_0x2ccf16['parentId'],_0x2ccf16[_0x4851b0(0x1a4)]),{'verbose':_0xb497f0['verbose']}),{folders:_0x54af2d,segments:_0x4fa9fe,journeys:_0x39eef6}=_0x2e5b83[_0x4851b0(0x1bd)],_0x4bb42d=_0x3127e3[_0x4851b0(0x1d0)](/[.+^${}()|[\]\\]/g,_0x4851b0(0x193))[_0x4851b0(0x1d0)](/\*/g,'.*')[_0x4851b0(0x1d0)](/\?/g,'.'),_0xd0ded5=new RegExp('^'+_0x4bb42d+'$','i'),_0xf5fa97=_0x54af2d[_0x4851b0(0x1a3)](_0x4368a2=>_0xd0ded5[_0x4851b0(0x1c8)](_0x4368a2[_0x4851b0(0x18e)])),_0xe14573=_0x4fa9fe[_0x4851b0(0x1a3)](_0x1eebfd=>_0xd0ded5['test'](_0x1eebfd[_0x4851b0(0x18e)])),_0x35d09a=_0x39eef6[_0x4851b0(0x1a3)](_0x41a253=>_0xd0ded5[_0x4851b0(0x1c8)](_0x41a253[_0x4851b0(0x1ac)])),_0x59c1a2=_0xf5fa97[_0x4851b0(0x1c9)]+_0xe14573[_0x4851b0(0x1c9)]+_0x35d09a[_0x4851b0(0x1c9)];console[_0x4851b0(0x1de)](_0x4851b0(0x19e)+_0xf5fa97[_0x4851b0(0x1c9)]+_0x4851b0(0x1c6)+(_0xf5fa97[_0x4851b0(0x1c9)]!==0x1?'s':'')+',\x20'+_0xe14573[_0x4851b0(0x1c9)]+_0x4851b0(0x1b2)+(_0xe14573[_0x4851b0(0x1c9)]!==0x1?'s':'')+_0x4851b0(0x1ab)+_0x35d09a[_0x4851b0(0x1c9)]+_0x4851b0(0x1d3)+(_0x35d09a[_0x4851b0(0x1c9)]!==0x1?'s':'')+_0x4851b0(0x1dc)+_0x3127e3+'\x27');const _0x5ad08c=_0x33e727=>{const _0x2c7870=_0x4851b0;return getConsoleNextUrl(_0xb497f0[_0x2c7870(0x1cd)],_0x2c7870(0x1cf)+_0x2ccf16[_0x2c7870(0x1ca)]+'/e/'+_0x33e727);},_0x3a4ff5=_0xb497f0[_0x4851b0(0x18f)]===_0x4851b0(0x1b5)||_0xb497f0[_0x4851b0(0x18f)]===_0x4851b0(0x1cc);if(_0x3a4ff5){const _0x29ac92=[..._0xf5fa97[_0x4851b0(0x1e1)](_0x479395=>({..._0x479395,'type':_0x4851b0(0x1c7)})),..._0xe14573['map'](_0xd84de0=>({..._0xd84de0,'type':_0x4851b0(0x1b8),'url':_0x5ad08c(_0xd84de0['id'])})),..._0x35d09a['map'](_0x6f9297=>({..._0x6f9297,'name':_0x6f9297[_0x4851b0(0x1ac)],'type':_0x4851b0(0x1be)}))][_0x4851b0(0x1c3)]((_0x422ab9,_0x59034f)=>_0x422ab9[_0x4851b0(0x18e)][_0x4851b0(0x1d5)](_0x59034f[_0x4851b0(0x18e)]));await handleSDKOutput(_0x29ac92,_0xb497f0);}else{if(_0x59c1a2===0x0)console[_0x4851b0(0x190)](_0x4851b0(0x192)+_0x3127e3);else{console['log'](a46_0x4c0c60[_0x4851b0(0x1b0)]('['+_0x5ccdbb+']\x20matching\x20\x27'+_0x3127e3+'\x27'));const _0x1a0ead=formatFlatList(_0xf5fa97,_0xe14573,{'showMetadata':!![],'getSegmentUrl':_0x5ad08c},_0x35d09a);console['log'](_0x1a0ead);}}return 0x0;}async[a46_0x5ae395(0x1c2)](_0x161e06,_0x590115){const _0x39e1fa=a46_0x5ae395,{options:_0x2c68e3,tdx:_0x3ca993}=_0x161e06,_0x1c7f83=await withSpinner(_0x39e1fa(0x1b9)+_0x590115+_0x39e1fa(0x1a6),()=>_0x3ca993[_0x39e1fa(0x1b8)]['resolvePathToResource'](_0x590115),{'verbose':_0x2c68e3[_0x39e1fa(0x1a0)]}),_0x3e45cb=_0x1c7f83[_0x39e1fa(0x1bd)];_0x2c68e3[_0x39e1fa(0x1a0)]&&(console['error'](_0x39e1fa(0x1d4)+_0x3e45cb[_0x39e1fa(0x1ca)]),_0x3e45cb[_0x39e1fa(0x1a4)]&&console[_0x39e1fa(0x1de)]('Folder\x20ID:\x20'+_0x3e45cb[_0x39e1fa(0x1a4)]));const _0x324e4f=await withSpinner(_0x39e1fa(0x19f),()=>_0x3ca993['segment'][_0x39e1fa(0x1af)](_0x3e45cb[_0x39e1fa(0x1ca)],_0x3e45cb[_0x39e1fa(0x1a4)]),{'verbose':_0x2c68e3[_0x39e1fa(0x1a0)]}),{folders:_0x493494,segments:_0x303cd4,journeys:_0xb78eed}=_0x324e4f[_0x39e1fa(0x1bd)],_0x2bd8d0=_0x493494[_0x39e1fa(0x1c9)]+_0x303cd4[_0x39e1fa(0x1c9)]+_0xb78eed[_0x39e1fa(0x1c9)];console[_0x39e1fa(0x1de)](_0x39e1fa(0x19e)+_0x493494['length']+_0x39e1fa(0x1c6)+(_0x493494[_0x39e1fa(0x1c9)]!==0x1?'s':'')+',\x20'+_0x303cd4[_0x39e1fa(0x1c9)]+_0x39e1fa(0x1b2)+(_0x303cd4[_0x39e1fa(0x1c9)]!==0x1?'s':'')+',\x20and\x20'+_0xb78eed[_0x39e1fa(0x1c9)]+_0x39e1fa(0x1d3)+(_0xb78eed[_0x39e1fa(0x1c9)]!==0x1?'s':''));const _0x20b97c=_0x5391f4=>{const _0x5a36cc=_0x39e1fa;return getConsoleNextUrl(_0x2c68e3[_0x5a36cc(0x1cd)],_0x5a36cc(0x1cf)+_0x3e45cb[_0x5a36cc(0x1ca)]+'/e/'+_0x5391f4);},_0x223345=_0x117021=>{const _0x562137=_0x39e1fa;return getConsoleNextUrl(_0x2c68e3[_0x562137(0x1cd)],'/app/ps/'+_0x3e45cb['parentId']+_0x562137(0x191)+_0x117021+_0x562137(0x1a2));},_0x21eeb0=_0x2c68e3[_0x39e1fa(0x18f)]===_0x39e1fa(0x1b5)||_0x2c68e3[_0x39e1fa(0x18f)]===_0x39e1fa(0x1cc);if(_0x21eeb0){const _0x369923=[..._0x493494['map'](_0x5d2348=>({..._0x5d2348,'type':_0x39e1fa(0x1c7)})),..._0x303cd4[_0x39e1fa(0x1e1)](_0x16697c=>({..._0x16697c,'type':_0x39e1fa(0x1b8),'url':_0x20b97c(_0x16697c['id'])})),..._0xb78eed[_0x39e1fa(0x1e1)](_0x32f210=>({..._0x32f210,'name':_0x32f210[_0x39e1fa(0x1ac)],'type':_0x39e1fa(0x1be),'url':_0x223345(_0x32f210['id'])}))][_0x39e1fa(0x1c3)]((_0x354d9f,_0xc6c70c)=>_0x354d9f[_0x39e1fa(0x18e)][_0x39e1fa(0x1d5)](_0xc6c70c['name']));await handleSDKOutput(_0x369923,_0x2c68e3);}else{if(_0x2bd8d0===0x0)console['log'](a46_0x4c0c60['dim']('['+_0x590115+']')),console[_0x39e1fa(0x190)](_0x39e1fa(0x19a));else{console[_0x39e1fa(0x190)](a46_0x4c0c60['dim']('['+_0x590115+']'));const _0x140b7d=formatFlatList(_0x493494,_0x303cd4,{'showMetadata':!![],'getSegmentUrl':_0x20b97c,'getJourneyUrl':_0x223345},_0xb78eed);console[_0x39e1fa(0x190)](_0x140b7d);}}return 0x0;}async[a46_0x5ae395(0x1da)](_0x5d85e7,_0x25caff){const _0xbb5c73=a46_0x5ae395,{options:_0x428512,tdx:_0x500cd7}=_0x5d85e7,_0x5910c5=await withSpinner(_0xbb5c73(0x1b9)+_0x25caff+_0xbb5c73(0x1a6),()=>_0x500cd7['segment'][_0xbb5c73(0x1ae)](_0x25caff),{'verbose':_0x428512['verbose']}),_0x28602a=_0x5910c5[_0xbb5c73(0x1bd)];_0x428512[_0xbb5c73(0x1a0)]&&(console['error'](_0xbb5c73(0x1d4)+_0x28602a[_0xbb5c73(0x1ca)]),_0x28602a[_0xbb5c73(0x1a4)]&&console[_0xbb5c73(0x1de)](_0xbb5c73(0x198)+_0x28602a['folderId']));const _0xc61d7e=_0x428512['maxDepth']||0xa,_0x3de457=await withSpinner(_0xbb5c73(0x1d8),()=>_0x500cd7[_0xbb5c73(0x1b8)]['listRecursive'](_0x28602a['parentId'],_0x28602a[_0xbb5c73(0x1a4)],0x0,_0xc61d7e),{'verbose':_0x428512[_0xbb5c73(0x1a0)]}),_0x36487a=_0x3de457[_0xbb5c73(0x1bd)],_0x3afbe8=_0x55ec00=>{const _0x50c99c=_0xbb5c73;let _0xc60881=0x0,_0x7e3e10=0x0,_0x14164a=0x0;for(const _0x157442 of _0x55ec00){if(_0x157442[_0x50c99c(0x195)]===_0x50c99c(0x1c7))_0xc60881++;else{if(_0x157442['type']===_0x50c99c(0x1b8))_0x7e3e10++;else{if(_0x157442['type']===_0x50c99c(0x1be))_0x14164a++;}}if(_0x157442[_0x50c99c(0x1b6)]){const _0x37e88a=_0x3afbe8(_0x157442[_0x50c99c(0x1b6)]);_0xc60881+=_0x37e88a['folders'],_0x7e3e10+=_0x37e88a['segments'],_0x14164a+=_0x37e88a[_0x50c99c(0x1ce)];}}return{'folders':_0xc60881,'segments':_0x7e3e10,'journeys':_0x14164a};},_0x1a12ff=_0x3afbe8(_0x36487a);console[_0xbb5c73(0x1de)](_0xbb5c73(0x1b7)+_0x1a12ff[_0xbb5c73(0x197)]+'\x20folder'+(_0x1a12ff['folders']!==0x1?'s':'')+',\x20'+_0x1a12ff[_0xbb5c73(0x1e2)]+_0xbb5c73(0x1b2)+(_0x1a12ff[_0xbb5c73(0x1e2)]!==0x1?'s':'')+_0xbb5c73(0x1ab)+_0x1a12ff[_0xbb5c73(0x1ce)]+_0xbb5c73(0x1d3)+(_0x1a12ff[_0xbb5c73(0x1ce)]!==0x1?'s':''));const _0x18f184=_0x23fd57=>{const _0x4fc74f=_0xbb5c73;return getConsoleNextUrl(_0x428512['site'],_0x4fc74f(0x1cf)+_0x28602a[_0x4fc74f(0x1ca)]+_0x4fc74f(0x191)+_0x23fd57);},_0x585a48=_0x14ad72=>{const _0x49208a=_0xbb5c73;return getConsoleNextUrl(_0x428512[_0x49208a(0x1cd)],_0x49208a(0x1cf)+_0x28602a[_0x49208a(0x1ca)]+_0x49208a(0x191)+_0x14ad72+_0x49208a(0x1a2));};if(_0x428512[_0xbb5c73(0x18f)]===_0xbb5c73(0x1b5)||_0x428512[_0xbb5c73(0x18f)]===_0xbb5c73(0x1cc))await handleSDKOutput(_0x36487a,_0x428512);else{console[_0xbb5c73(0x190)](a46_0x4c0c60[_0xbb5c73(0x1b0)]('['+_0x25caff+']'));const _0x7e1d7d=formatTree(_0x36487a,{'showMetadata':!![],'getSegmentUrl':_0x18f184,'getJourneyUrl':_0x585a48});console['log'](_0x7e1d7d);}return 0x0;}}