@treasuredata/tdx 2026.6.1 → 2026.6.3

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 (241) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-command.js.map +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segment-validate-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/status-command.js +1 -1
  53. package/dist/commands/table-deleted.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.d.ts +2 -2
  61. package/dist/commands/workflow-command.d.ts.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/commands/workflow-command.js.map +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.js +1 -1
  90. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  91. package/dist/sdk/agent/agent-yaml.js +1 -1
  92. package/dist/sdk/agent/test/evaluator.js +1 -1
  93. package/dist/sdk/agent/test/executor.js +1 -1
  94. package/dist/sdk/agent/test/index.js +1 -1
  95. package/dist/sdk/agent/test/output.js +1 -1
  96. package/dist/sdk/agent/test/parser.js +1 -1
  97. package/dist/sdk/agent/tool-target-registry.js +1 -1
  98. package/dist/sdk/api.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.js +1 -1
  100. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  101. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  102. package/dist/sdk/cas/index.js +1 -1
  103. package/dist/sdk/cas/pull-workflow.js +1 -1
  104. package/dist/sdk/cas/push-workflow.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.js +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/http-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js +1 -1
  111. package/dist/sdk/client/oauth-refresh.js +1 -1
  112. package/dist/sdk/client/rate-limiter.js +1 -1
  113. package/dist/sdk/client/td-api-client.js +1 -1
  114. package/dist/sdk/client/trino-api-client.js +1 -1
  115. package/dist/sdk/client/workflow-client.d.ts +23 -1
  116. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js.map +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.js +1 -1
  136. package/dist/sdk/io/index.js +1 -1
  137. package/dist/sdk/io/node-filesystem.js +1 -1
  138. package/dist/sdk/job.js +1 -1
  139. package/dist/sdk/journey.js +1 -1
  140. package/dist/sdk/llm/chat-cache.js +1 -1
  141. package/dist/sdk/llm/index.js +1 -1
  142. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  143. package/dist/sdk/llm/model-factors.js +1 -1
  144. package/dist/sdk/llm/user-settings.js +1 -1
  145. package/dist/sdk/personalization.js +1 -1
  146. package/dist/sdk/policy.js +1 -1
  147. package/dist/sdk/query/deleted-table-validation.js +1 -1
  148. package/dist/sdk/query/index.js +1 -1
  149. package/dist/sdk/query/sql-parser.js +1 -1
  150. package/dist/sdk/realtime.js +1 -1
  151. package/dist/sdk/schedule.js +1 -1
  152. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/fields-display.js +1 -1
  154. package/dist/sdk/segment/file-discovery.js +1 -1
  155. package/dist/sdk/segment/journey-utils.js +1 -1
  156. package/dist/sdk/segment/journey-validator.js +1 -1
  157. package/dist/sdk/segment/journey-yaml.js +1 -1
  158. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  159. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/pull-workflow.js +1 -1
  161. package/dist/sdk/segment/push-recovery.js +1 -1
  162. package/dist/sdk/segment/push-workflow.js +1 -1
  163. package/dist/sdk/segment/resolution-context.js +1 -1
  164. package/dist/sdk/segment/segment-path-parser.js +1 -1
  165. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  166. package/dist/sdk/segment/segment-validator.js +1 -1
  167. package/dist/sdk/segment/target-resolution.js +1 -1
  168. package/dist/sdk/segment/tdx-config.js +1 -1
  169. package/dist/sdk/segment/types/activation-schema.js +1 -1
  170. package/dist/sdk/segment/types/journey-def.js +1 -1
  171. package/dist/sdk/segment/types/journey-schema.js +1 -1
  172. package/dist/sdk/segment/types/segment-def.js +1 -1
  173. package/dist/sdk/segment/types/segment-schema.js +1 -1
  174. package/dist/sdk/segment/validate-files.js +1 -1
  175. package/dist/sdk/segment/yaml-validator.js +1 -1
  176. package/dist/sdk/segment.js +1 -1
  177. package/dist/sdk/types/index.js +1 -1
  178. package/dist/sdk/types/progress.js +1 -1
  179. package/dist/sdk/types/workflow.d.ts +1 -1
  180. package/dist/sdk/types/workflow.d.ts.map +1 -1
  181. package/dist/sdk/types/workspace.js +1 -1
  182. package/dist/sdk/user.js +1 -1
  183. package/dist/sdk/util/format-detector.js +1 -1
  184. package/dist/sdk/util/formatters.js +1 -1
  185. package/dist/sdk/util/index.js +1 -1
  186. package/dist/sdk/util/paginate.js +1 -1
  187. package/dist/sdk/util/tree-formatter.js +1 -1
  188. package/dist/sdk/workflow/archive-validation.js +1 -1
  189. package/dist/sdk/workflow/clone-workflow.js +1 -1
  190. package/dist/sdk/workflow/index.d.ts +23 -2
  191. package/dist/sdk/workflow/index.d.ts.map +1 -1
  192. package/dist/sdk/workflow/index.js +1 -1
  193. package/dist/sdk/workflow/index.js.map +1 -1
  194. package/dist/sdk/workflow/pull-workflow.js +1 -1
  195. package/dist/sdk/workflow/push-workflow.d.ts +4 -0
  196. package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
  197. package/dist/sdk/workflow/push-workflow.js +1 -1
  198. package/dist/sdk/workflow/push-workflow.js.map +1 -1
  199. package/dist/sdk/workflow/task-graph.js +1 -1
  200. package/dist/sdk/workflow/tdx-config.js +1 -1
  201. package/dist/sdk/workflow/workflow-utils.js +1 -1
  202. package/dist/sdk/workspace/access-tracker.js +1 -1
  203. package/dist/sdk/workspace/frontmatter.js +1 -1
  204. package/dist/sdk/workspace/git.js +1 -1
  205. package/dist/sdk/workspace/index.js +1 -1
  206. package/dist/sdk/workspace/templates.js +1 -1
  207. package/dist/sdk/workspace/weekly.js +1 -1
  208. package/dist/sdk/workspace/wikilinks.js +1 -1
  209. package/dist/test-utils/command-runner.js +1 -1
  210. package/dist/test-utils/factories.js +1 -1
  211. package/dist/test-utils/fixtures.js +1 -1
  212. package/dist/test-utils/http-mock.js +1 -1
  213. package/dist/test-utils/index.js +1 -1
  214. package/dist/utils/async.js +1 -1
  215. package/dist/utils/colors.js +1 -1
  216. package/dist/utils/diff.js +1 -1
  217. package/dist/utils/file-permissions.js +1 -1
  218. package/dist/utils/file-reader.js +1 -1
  219. package/dist/utils/github-releases.js +1 -1
  220. package/dist/utils/global-cache.js +1 -1
  221. package/dist/utils/json-loader.js +1 -1
  222. package/dist/utils/local-cache.js +1 -1
  223. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  224. package/dist/utils/logger/formatters/index.js +1 -1
  225. package/dist/utils/logger/handlers/console-handler.js +1 -1
  226. package/dist/utils/logger/handlers/file-handler.js +1 -1
  227. package/dist/utils/logger/handlers/index.js +1 -1
  228. package/dist/utils/logger/handlers/null-handler.js +1 -1
  229. package/dist/utils/logger/index.js +1 -1
  230. package/dist/utils/logger/logger.js +1 -1
  231. package/dist/utils/logger/types.js +1 -1
  232. package/dist/utils/option-validation.js +1 -1
  233. package/dist/utils/process.js +1 -1
  234. package/dist/utils/prompt.js +1 -1
  235. package/dist/utils/spinner.js +1 -1
  236. package/dist/utils/sse-parser.js +1 -1
  237. package/dist/utils/string-utils.js +1 -1
  238. package/dist/utils/table-ref-parser.js +1 -1
  239. package/dist/utils/tdx-logger.js +1 -1
  240. package/dist/utils/version-check.js +1 -1
  241. package/package.json +1 -1
@@ -1 +1 @@
1
- function a39_0x3f59(_0x3b1821,_0x17c754){_0x3b1821=_0x3b1821-0x1b9;const _0x6bcd1=a39_0x6bcd();let _0x3f5976=_0x6bcd1[_0x3b1821];return _0x3f5976;}const a39_0x43b705=a39_0x3f59;(function(_0x4dfe8e,_0x274a53){const _0x1c2804=a39_0x3f59,_0x1a890e=_0x4dfe8e();while(!![]){try{const _0x40955f=-parseInt(_0x1c2804(0x1c0))/0x1+-parseInt(_0x1c2804(0x1c8))/0x2+parseInt(_0x1c2804(0x1d5))/0x3*(parseInt(_0x1c2804(0x1d2))/0x4)+parseInt(_0x1c2804(0x1d3))/0x5+-parseInt(_0x1c2804(0x1cf))/0x6+parseInt(_0x1c2804(0x1d1))/0x7*(-parseInt(_0x1c2804(0x1d0))/0x8)+parseInt(_0x1c2804(0x1c7))/0x9;if(_0x40955f===_0x274a53)break;else _0x1a890e['push'](_0x1a890e['shift']());}catch(_0x1f16d8){_0x1a890e['push'](_0x1a890e['shift']());}}}(a39_0x6bcd,0xd12e1));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a39_0x6bcd(){const _0x1df6ad=['Site:\x20','site','List\x20available\x20fields\x20for\x20segmentation','verbose','46710045UzNldI','2949962btaMTx','Parent\x20segment:\x20','segment','error','\x20field','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x27...','3896070khPsKx','8008zFdrht','11900lyVvWl','4pJdkqG','496070eCORPe','Listing\x20fields\x20for\x20\x27','1139256UdGbrM','json','execute','jsonl','listFields','data','✔\x20Found\x20','length','986144TSkvZc','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'];a39_0x6bcd=function(){return _0x1df6ad;};return a39_0x6bcd();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';['description']=a39_0x43b705(0x1c5);async[a39_0x43b705(0x1ba)](_0xcead16){const _0x2998c4=a39_0x43b705,{options:_0x4ab6ce,args:_0x16e538,tdx:_0x54049d}=_0xcead16,_0x52049b=_0x16e538[0x0]||_0x4ab6ce['parentSegment'];if(!_0x52049b)return console[_0x2998c4(0x1cb)](_0x2998c4(0x1c1)),console['error'](_0x2998c4(0x1c2)),console['error'](_0x2998c4(0x1cd)),0x1;_0x4ab6ce[_0x2998c4(0x1c6)]&&(console[_0x2998c4(0x1cb)](_0x2998c4(0x1c3)+_0x4ab6ce[_0x2998c4(0x1c4)]),console['error'](_0x2998c4(0x1c9)+_0x52049b));const _0x4e4b3b=await withSpinner(_0x2998c4(0x1d4)+_0x52049b+_0x2998c4(0x1ce),()=>_0x54049d[_0x2998c4(0x1ca)][_0x2998c4(0x1bc)](_0x52049b),{'verbose':_0x4ab6ce['verbose']}),_0x2ad8eb=_0x4e4b3b[_0x2998c4(0x1bd)];console[_0x2998c4(0x1cb)](_0x2998c4(0x1be)+_0x2ad8eb['length']+_0x2998c4(0x1cc)+(_0x2ad8eb[_0x2998c4(0x1bf)]!==0x1?'s':''));if(_0x4ab6ce[_0x2998c4(0x1b9)]||_0x4ab6ce[_0x2998c4(0x1bb)])return await handleSDKOutput(_0x2ad8eb,_0x4ab6ce),0x0;return displayFieldsHumanReadable(_0x2ad8eb,_0x52049b),0x0;}}
1
+ const a39_0x1aab3f=a39_0x58ef;(function(_0x7dee2d,_0x1bd2ee){const _0x1f9672=a39_0x58ef,_0x3c233d=_0x7dee2d();while(!![]){try{const _0x468dcd=parseInt(_0x1f9672(0x10b))/0x1+-parseInt(_0x1f9672(0x116))/0x2*(parseInt(_0x1f9672(0x105))/0x3)+-parseInt(_0x1f9672(0x11e))/0x4*(parseInt(_0x1f9672(0x120))/0x5)+-parseInt(_0x1f9672(0x107))/0x6+-parseInt(_0x1f9672(0x104))/0x7*(-parseInt(_0x1f9672(0x114))/0x8)+parseInt(_0x1f9672(0x10e))/0x9*(parseInt(_0x1f9672(0x106))/0xa)+parseInt(_0x1f9672(0x10c))/0xb;if(_0x468dcd===_0x1bd2ee)break;else _0x3c233d['push'](_0x3c233d['shift']());}catch(_0x27b189){_0x3c233d['push'](_0x3c233d['shift']());}}}(a39_0x9361,0x3c40f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a39_0x58ef(_0x40252a,_0x42825e){_0x40252a=_0x40252a-0x103;const _0x93616e=a39_0x9361();let _0x58ef6b=_0x93616e[_0x40252a];return _0x58ef6b;}function a39_0x9361(){const _0x23a24a=['Listing\x20fields\x20for\x20\x27','324UJIrBO','Parent\x20segment:\x20','error','name','execute','verbose','312ilNSNu','Error:\x20Parent\x20segment\x20name\x20is\x20required','18wEihns','length','parentSegment','listFields','segment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20field','data','20ndTJCm','description','460100yGyDen','jsonl','26621KbHzja','101259HXSIiZ','61060ErnQCe','2860026azNnHI','site','Site:\x20','\x27...','64936aFgOcu','11597058birIBE'];a39_0x9361=function(){return _0x23a24a;};return a39_0x9361();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x1aab3f(0x111)]='segment:fields';[a39_0x1aab3f(0x11f)]='List\x20available\x20fields\x20for\x20segmentation';async[a39_0x1aab3f(0x112)](_0x14573e){const _0x1cb83f=a39_0x1aab3f,{options:_0x79707c,args:_0x55d8c9,tdx:_0x474a66}=_0x14573e,_0x1c387a=_0x55d8c9[0x0]||_0x79707c[_0x1cb83f(0x118)];if(!_0x1c387a)return console[_0x1cb83f(0x110)](_0x1cb83f(0x115)),console[_0x1cb83f(0x110)](_0x1cb83f(0x11b)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x79707c[_0x1cb83f(0x113)]&&(console[_0x1cb83f(0x110)](_0x1cb83f(0x109)+_0x79707c[_0x1cb83f(0x108)]),console['error'](_0x1cb83f(0x10f)+_0x1c387a));const _0x19a078=await withSpinner(_0x1cb83f(0x10d)+_0x1c387a+_0x1cb83f(0x10a),()=>_0x474a66[_0x1cb83f(0x11a)][_0x1cb83f(0x119)](_0x1c387a),{'verbose':_0x79707c[_0x1cb83f(0x113)]}),_0x13fa11=_0x19a078[_0x1cb83f(0x11d)];console[_0x1cb83f(0x110)]('✔\x20Found\x20'+_0x13fa11['length']+_0x1cb83f(0x11c)+(_0x13fa11[_0x1cb83f(0x117)]!==0x1?'s':''));if(_0x79707c['json']||_0x79707c[_0x1cb83f(0x103)])return await handleSDKOutput(_0x13fa11,_0x79707c),0x0;return displayFieldsHumanReadable(_0x13fa11,_0x1c387a),0x0;}}
@@ -1 +1 @@
1
- const a40_0x3b6a46=a40_0x2fd3;function a40_0x2fd3(_0x56f22b,_0x499d18){_0x56f22b=_0x56f22b-0xc4;const _0x23d122=a40_0x23d1();let _0x2fd312=_0x23d122[_0x56f22b];return _0x2fd312;}(function(_0x1262ae,_0x5865cc){const _0x5c7e81=a40_0x2fd3,_0x39d93c=_0x1262ae();while(!![]){try{const _0xdcef9b=-parseInt(_0x5c7e81(0xc5))/0x1*(-parseInt(_0x5c7e81(0x10e))/0x2)+parseInt(_0x5c7e81(0xd5))/0x3*(-parseInt(_0x5c7e81(0xc4))/0x4)+parseInt(_0x5c7e81(0xf2))/0x5+-parseInt(_0x5c7e81(0x10f))/0x6*(parseInt(_0x5c7e81(0x102))/0x7)+-parseInt(_0x5c7e81(0xca))/0x8+parseInt(_0x5c7e81(0xe9))/0x9+parseInt(_0x5c7e81(0xd6))/0xa;if(_0xdcef9b===_0x5865cc)break;else _0x39d93c['push'](_0x39d93c['shift']());}catch(_0xbe9a54){_0x39d93c['push'](_0x39d93c['shift']());}}}(a40_0x23d1,0x55eb7));import{BaseCommand}from'./command.js';function a40_0x23d1(){const _0x1039c1=['isNew','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20files\x20to\x20','Parent\x20segment:\x20','2221615kwREup','files','\x20=\x20','red','error','\x20changed\x20files','session','absolutePath','segments','\x20\x20🎯\x20','Target\x20resource:\x20','\x20\x20Target:\x20','Write\x20','yes','cyan','\x20new\x20files','42623BxgZLq','journeyVersions','\x20\x20🗺️\x20\x20','helpText','parent_segment','Error:\x20','segment','targetDir','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20All\x20files\x20are\x20up\x20to\x20date','pullSegments','26oyXovH','642uBDgSE','\x20with\x20','length','168332KuCzEM','5374gUAUZb','file','dryRun','utf-8','description','3291232KSclVv','execute','parentName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x0aError:','resourceName','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)','\x20files?','segment:pull','\x20journeys','39PwizdU','9392690HxcknB','counts','\x20segments','cwd','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','no_parent','\x20unchanged\x20files','dim','\x20activations','hasChanges','✔\x20Context\x20set:\x20','activations','yellow','setPhase','filter','diff','errorCode','-\x20no\x20files\x20written','4576311vUbJVz','journeys','Site:\x20','verbose','green'];a40_0x23d1=function(){return _0x1039c1;};return a40_0x23d1();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x202750 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x43e415 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{['name']=a40_0x3b6a46(0xd3);[a40_0x3b6a46(0xc9)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x3b6a46(0xcb)](_0x129d7e){const _0x3d56c5=a40_0x3b6a46,{options:_0x22bf27,args:_0xbe231b,tdx:_0x1077db}=_0x129d7e,_0xbc40ef=_0x22bf27,_0x535ade=await resolveTarget({'arg':_0xbe231b[0x0],'contextParent':_0x22bf27['parentSegment'],'cwd':process[_0x3d56c5(0xd9)]()});if(!isSuccessfulResolution(_0x535ade))return _0x535ade[_0x3d56c5(0xe7)]===_0x3d56c5(0xdc)?(console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3d56c5(0xd1)),console[_0x3d56c5(0xf6)](_0x3d56c5(0xdb)),console[_0x3d56c5(0xf6)](_0x3d56c5(0xce))):(console[_0x3d56c5(0xf6)](a40_0x202750['red'](_0x3d56c5(0x107)+_0x535ade['message']+'\x0a')),_0x535ade['helpText']&&console['error'](a40_0x202750[_0x3d56c5(0x100)](_0x535ade[_0x3d56c5(0x105)]))),0x1;const _0x39adb2=_0x535ade[_0x3d56c5(0xcc)],_0x1d4ac1=_0x535ade[_0x3d56c5(0x109)],_0x2c5b02=_0x535ade[_0x3d56c5(0x10a)]===_0x3d56c5(0xc6)?_0x535ade[_0x3d56c5(0xd0)]:undefined;_0xbc40ef[_0x3d56c5(0xec)]&&(console['error'](_0x3d56c5(0xeb)+_0xbc40ef['site']),console[_0x3d56c5(0xf6)](_0x3d56c5(0xf1)+_0x39adb2),_0x2c5b02&&console['error'](_0x3d56c5(0xfc)+_0x2c5b02));const _0x4120fe=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x39adb2+'\x27...',_0x49465b=>_0x1077db[_0x3d56c5(0x108)][_0x3d56c5(0x10d)](_0x39adb2,{'targetDir':_0x1d4ac1,'targetResourceName':_0x2c5b02,'verbose':_0xbc40ef[_0x3d56c5(0xec)],'progress':{'update':_0x5045ee=>{const _0x592081=_0x3d56c5;_0x49465b[_0x592081(0xe4)](_0x5045ee),_0xbc40ef[_0x592081(0xec)]&&console[_0x592081(0xf6)]('\x20\x20'+_0x5045ee);}}}),{'verbose':_0xbc40ef[_0x3d56c5(0xec)]}),_0x1fc416=_0x4120fe[_0x3d56c5(0xda)];if(_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xfa)]===0x0&&_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xea)]===0x0)return console['error'](a40_0x202750['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x1fc416[_0x3d56c5(0xcc)]+'\x27')),0x0;const _0x4d5640=_0x1fc416[_0x3d56c5(0xf3)][_0x3d56c5(0xe5)](_0x4262c4=>_0x4262c4['isNew']),_0x595b34=_0x1fc416[_0x3d56c5(0xf3)][_0x3d56c5(0xe5)](_0x52a8d9=>!_0x52a8d9[_0x3d56c5(0xee)]&&_0x52a8d9[_0x3d56c5(0xe0)]),_0x27dbbb=_0x1fc416['files'][_0x3d56c5(0xe5)](_0x560c8d=>!_0x560c8d[_0x3d56c5(0xee)]&&!_0x560c8d[_0x3d56c5(0xe0)]);console[_0x3d56c5(0xf6)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1fc416[_0x3d56c5(0xcc)]+'\x27:'),console['error'](_0x3d56c5(0xfb)+a40_0x202750['cyan'](_0x1fc416['counts'][_0x3d56c5(0xfa)]+_0x3d56c5(0xd8))+_0x3d56c5(0x110)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xe2)]+_0x3d56c5(0xdf)));if(_0x1fc416['counts'][_0x3d56c5(0xea)]>0x0){const _0x4bd90b=_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0x103)]>_0x1fc416['counts'][_0x3d56c5(0xea)]?'\x20('+_0x1fc416['counts'][_0x3d56c5(0x103)]+'\x20versions)':'';console[_0x3d56c5(0xf6)](_0x3d56c5(0x104)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416['counts'][_0x3d56c5(0xea)]+_0x3d56c5(0xd4))+a40_0x202750[_0x3d56c5(0xde)](_0x4bd90b));}console[_0x3d56c5(0xf6)]('\x20\x20'+a40_0x202750[_0x3d56c5(0xed)]('+\x20'+_0x4d5640[_0x3d56c5(0x111)]+_0x3d56c5(0x101))),console['error']('\x20\x20'+a40_0x202750['yellow']('~\x20'+_0x595b34[_0x3d56c5(0x111)]+_0x3d56c5(0xf7))),console['error']('\x20\x20'+a40_0x202750[_0x3d56c5(0xde)]('=\x20'+_0x27dbbb['length']+_0x3d56c5(0xdd))),console[_0x3d56c5(0xf6)](_0x3d56c5(0xfd)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0x109)])+'\x0a');if(_0x595b34['length']>0x0)for(const _0x597136 of _0x595b34){console['error']('\x0aChanges\x20to\x20\x27'+_0x597136['relativePath']+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x3d56c5(0xf6)](_0x597136[_0x3d56c5(0xe6)]),console[_0x3d56c5(0xf6)]('─'['repeat'](0x3c));}if(_0xbc40ef[_0x3d56c5(0xc7)])return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)](_0x3d56c5(0xef))),0x0;if(_0x4d5640[_0x3d56c5(0x111)]===0x0&&_0x595b34[_0x3d56c5(0x111)]===0x0)return console['error'](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0x10c))),saveSessionContext({'parent_segment':_0x1fc416[_0x3d56c5(0xcc)]},_0xbc40ef[_0x3d56c5(0xf8)]),console['error'](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0xe1)+a40_0x202750[_0x3d56c5(0xde)]('parent_segment')+_0x3d56c5(0xf4)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416['parentName']))),0x0;if(!_0xbc40ef[_0x3d56c5(0xff)]){if(!isInteractive())return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xf5)](_0x3d56c5(0xcf)),_0x3d56c5(0x10b)),console[_0x3d56c5(0xf6)](a40_0x202750['dim'](_0x3d56c5(0xcd))),0x1;const _0x58473f=await confirmKey(_0x3d56c5(0xfe)+(_0x4d5640['length']+_0x595b34['length'])+_0x3d56c5(0xd2));if(!_0x58473f)return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)]('Aborted.'),_0x3d56c5(0xe8)),0x1;}for(const _0x57798e of _0x1fc416[_0x3d56c5(0xf3)]){if(_0x57798e[_0x3d56c5(0xee)]||_0x57798e[_0x3d56c5(0xe0)]){const _0x18b3c2=a40_0x43e415['dirname'](_0x57798e[_0x3d56c5(0xf9)]);!existsSync(_0x18b3c2)&&mkdirSync(_0x18b3c2,{'recursive':!![]}),writeFileSync(_0x57798e[_0x3d56c5(0xf9)],_0x57798e['content'],_0x3d56c5(0xc8));}}return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xed)]('✔\x20Pulled\x20'+(_0x4d5640[_0x3d56c5(0x111)]+_0x595b34[_0x3d56c5(0x111)])+_0x3d56c5(0xf0)+_0x1fc416['targetDir'])),saveSessionContext({'parent_segment':_0x1fc416[_0x3d56c5(0xcc)]},_0xbc40ef[_0x3d56c5(0xf8)]),console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0xe1)+a40_0x202750['dim'](_0x3d56c5(0x106))+_0x3d56c5(0xf4)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0xcc)]))),0x0;}}
1
+ const a40_0x28f4c6=a40_0x5c6f;(function(_0x3feb58,_0x138234){const _0x339704=a40_0x5c6f,_0x57abc8=_0x3feb58();while(!![]){try{const _0x4ea70c=-parseInt(_0x339704(0x172))/0x1*(-parseInt(_0x339704(0x142))/0x2)+-parseInt(_0x339704(0x13a))/0x3+-parseInt(_0x339704(0x12e))/0x4+-parseInt(_0x339704(0x153))/0x5*(parseInt(_0x339704(0x159))/0x6)+-parseInt(_0x339704(0x16a))/0x7+-parseInt(_0x339704(0x14d))/0x8*(parseInt(_0x339704(0x147))/0x9)+parseInt(_0x339704(0x151))/0xa;if(_0x4ea70c===_0x138234)break;else _0x57abc8['push'](_0x57abc8['shift']());}catch(_0x5a5c90){_0x57abc8['push'](_0x57abc8['shift']());}}}(a40_0x4fed,0x311fd));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 a40_0x57eed1 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x496a99 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x5c6f(_0x562f30,_0x5ad2b2){_0x562f30=_0x562f30-0x12c;const _0x4fed0a=a40_0x4fed();let _0x5c6f27=_0x4fed0a[_0x562f30];return _0x5c6f27;}export class SegmentPullCommand extends BaseCommand{[a40_0x28f4c6(0x14e)]=a40_0x28f4c6(0x138);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x28f4c6(0x16c)](_0x180dc7){const _0x1e52ac=a40_0x28f4c6,{options:_0x10378b,args:_0x4ffc24,tdx:_0x205f97}=_0x180dc7,_0x239f1d=_0x10378b,_0x4d8fe6=await resolveTarget({'arg':_0x4ffc24[0x0],'contextParent':_0x10378b[_0x1e52ac(0x163)],'cwd':process[_0x1e52ac(0x14f)]()});if(!isSuccessfulResolution(_0x4d8fe6))return _0x4d8fe6[_0x1e52ac(0x16b)]===_0x1e52ac(0x148)?(console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x145)](_0x1e52ac(0x17b))),console[_0x1e52ac(0x157)](_0x1e52ac(0x15a)),console[_0x1e52ac(0x157)](_0x1e52ac(0x156)),console[_0x1e52ac(0x157)](_0x1e52ac(0x158))):(console[_0x1e52ac(0x157)](a40_0x57eed1['red']('Error:\x20'+_0x4d8fe6[_0x1e52ac(0x13f)]+'\x0a')),_0x4d8fe6[_0x1e52ac(0x155)]&&console[_0x1e52ac(0x157)](a40_0x57eed1['cyan'](_0x4d8fe6[_0x1e52ac(0x155)]))),0x1;const _0x5dc365=_0x4d8fe6[_0x1e52ac(0x173)],_0x4c9258=_0x4d8fe6[_0x1e52ac(0x161)],_0x309171=_0x4d8fe6[_0x1e52ac(0x134)]===_0x1e52ac(0x16d)?_0x4d8fe6[_0x1e52ac(0x168)]:undefined;_0x239f1d[_0x1e52ac(0x137)]&&(console[_0x1e52ac(0x157)](_0x1e52ac(0x146)+_0x239f1d[_0x1e52ac(0x16e)]),console[_0x1e52ac(0x157)]('Parent\x20segment:\x20'+_0x5dc365),_0x309171&&console[_0x1e52ac(0x157)](_0x1e52ac(0x139)+_0x309171));const _0x31dea2=await withProgressSpinner(_0x1e52ac(0x133)+_0x5dc365+'\x27...',_0x52fdbb=>_0x205f97[_0x1e52ac(0x17c)][_0x1e52ac(0x141)](_0x5dc365,{'targetDir':_0x4c9258,'targetResourceName':_0x309171,'verbose':_0x239f1d[_0x1e52ac(0x137)],'progress':{'update':_0x1108c6=>{const _0x3f16d2=_0x1e52ac;_0x52fdbb[_0x3f16d2(0x140)](_0x1108c6),_0x239f1d[_0x3f16d2(0x137)]&&console[_0x3f16d2(0x157)]('\x20\x20'+_0x1108c6);}}}),{'verbose':_0x239f1d[_0x1e52ac(0x137)]}),_0x2d4610=_0x31dea2[_0x1e52ac(0x165)];if(_0x2d4610[_0x1e52ac(0x17d)][_0x1e52ac(0x12f)]===0x0&&_0x2d4610[_0x1e52ac(0x17d)]['journeys']===0x0)return console[_0x1e52ac(0x157)](a40_0x57eed1['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x2d4610[_0x1e52ac(0x173)]+'\x27')),0x0;const _0x10f69e=_0x2d4610['files'][_0x1e52ac(0x13d)](_0x31c8a2=>_0x31c8a2[_0x1e52ac(0x167)]),_0x40d163=_0x2d4610[_0x1e52ac(0x15d)][_0x1e52ac(0x13d)](_0x45ba4d=>!_0x45ba4d[_0x1e52ac(0x167)]&&_0x45ba4d[_0x1e52ac(0x176)]),_0x1d3784=_0x2d4610[_0x1e52ac(0x15d)][_0x1e52ac(0x13d)](_0x4fd7a4=>!_0x4fd7a4[_0x1e52ac(0x167)]&&!_0x4fd7a4[_0x1e52ac(0x176)]);console[_0x1e52ac(0x157)](_0x1e52ac(0x15b)+_0x2d4610[_0x1e52ac(0x173)]+'\x27:'),console[_0x1e52ac(0x157)]('\x20\x20🎯\x20'+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610[_0x1e52ac(0x17d)][_0x1e52ac(0x12f)]+_0x1e52ac(0x130))+_0x1e52ac(0x135)+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610['counts'][_0x1e52ac(0x162)]+_0x1e52ac(0x154)));if(_0x2d4610[_0x1e52ac(0x17d)][_0x1e52ac(0x175)]>0x0){const _0x1d9695=_0x2d4610[_0x1e52ac(0x17d)][_0x1e52ac(0x166)]>_0x2d4610[_0x1e52ac(0x17d)]['journeys']?'\x20('+_0x2d4610['counts'][_0x1e52ac(0x166)]+_0x1e52ac(0x152):'';console[_0x1e52ac(0x157)](_0x1e52ac(0x13e)+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610['counts']['journeys']+_0x1e52ac(0x14a))+a40_0x57eed1[_0x1e52ac(0x15c)](_0x1d9695));}console[_0x1e52ac(0x157)]('\x20\x20'+a40_0x57eed1[_0x1e52ac(0x12d)]('+\x20'+_0x10f69e[_0x1e52ac(0x15e)]+_0x1e52ac(0x131))),console[_0x1e52ac(0x157)]('\x20\x20'+a40_0x57eed1['yellow']('~\x20'+_0x40d163[_0x1e52ac(0x15e)]+'\x20changed\x20files')),console['error']('\x20\x20'+a40_0x57eed1[_0x1e52ac(0x15c)]('=\x20'+_0x1d3784['length']+'\x20unchanged\x20files')),console[_0x1e52ac(0x157)]('\x20\x20Target:\x20'+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610['targetDir'])+'\x0a');if(_0x40d163[_0x1e52ac(0x15e)]>0x0)for(const _0x4a22c7 of _0x40d163){console[_0x1e52ac(0x157)](_0x1e52ac(0x160)+_0x4a22c7[_0x1e52ac(0x13c)]+'\x27:'),console[_0x1e52ac(0x157)]('─'[_0x1e52ac(0x17a)](0x3c)),console['error'](_0x4a22c7['diff']),console[_0x1e52ac(0x157)]('─'[_0x1e52ac(0x17a)](0x3c));}if(_0x239f1d[_0x1e52ac(0x150)])return console['error'](a40_0x57eed1['yellow'](_0x1e52ac(0x178))),0x0;if(_0x10f69e[_0x1e52ac(0x15e)]===0x0&&_0x40d163[_0x1e52ac(0x15e)]===0x0)return console['error'](a40_0x57eed1['green'](_0x1e52ac(0x149))),saveSessionContext({'parent_segment':_0x2d4610[_0x1e52ac(0x173)]},_0x239f1d[_0x1e52ac(0x15f)]),console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x12d)](_0x1e52ac(0x16f)+a40_0x57eed1[_0x1e52ac(0x15c)](_0x1e52ac(0x177))+'\x20=\x20'+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610[_0x1e52ac(0x173)]))),0x0;if(!_0x239f1d[_0x1e52ac(0x170)]){if(!isInteractive())return console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x179)](_0x1e52ac(0x14c)),_0x1e52ac(0x171)),console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x15c)](_0x1e52ac(0x169))),0x1;const _0x2a055d=await confirmKey('Write\x20'+(_0x10f69e[_0x1e52ac(0x15e)]+_0x40d163[_0x1e52ac(0x15e)])+_0x1e52ac(0x17e));if(!_0x2a055d)return console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x145)](_0x1e52ac(0x13b)),_0x1e52ac(0x14b)),0x1;}for(const _0x2064a7 of _0x2d4610[_0x1e52ac(0x15d)]){if(_0x2064a7[_0x1e52ac(0x167)]||_0x2064a7[_0x1e52ac(0x176)]){const _0x418d36=a40_0x496a99[_0x1e52ac(0x144)](_0x2064a7['absolutePath']);!existsSync(_0x418d36)&&mkdirSync(_0x418d36,{'recursive':!![]}),writeFileSync(_0x2064a7[_0x1e52ac(0x143)],_0x2064a7[_0x1e52ac(0x164)],'utf-8');}}return console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x12d)](_0x1e52ac(0x174)+(_0x10f69e[_0x1e52ac(0x15e)]+_0x40d163[_0x1e52ac(0x15e)])+_0x1e52ac(0x12c)+_0x2d4610[_0x1e52ac(0x161)])),saveSessionContext({'parent_segment':_0x2d4610[_0x1e52ac(0x173)]},_0x239f1d[_0x1e52ac(0x15f)]),console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x12d)]('✔\x20Context\x20set:\x20'+a40_0x57eed1['dim'](_0x1e52ac(0x177))+_0x1e52ac(0x136)+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610[_0x1e52ac(0x173)]))),0x0;}}function a40_0x4fed(){const _0x49c918=['counts','\x20files?','\x20files\x20to\x20','green','933428uZGmrU','segments','\x20segments','\x20new\x20files','cyan','Pulling\x20segments\x20from\x20\x27','type','\x20with\x20','\x20=\x20','verbose','segment:pull','Target\x20resource:\x20','184635IlPSDa','Aborted.','relativePath','filter','\x20\x20🗺️\x20\x20','message','setPhase','pullSegments','14QcQinr','absolutePath','dirname','yellow','Site:\x20','1251GZCzzt','no_parent','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20journeys','-\x20no\x20files\x20written','\x0aError:','7928RXhVNQ','name','cwd','dryRun','6641660HrnngI','\x20versions)','800LCvvqA','\x20activations','helpText','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','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','3252NbDiRd','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)','\x0aPull\x20summary\x20for\x20\x27','dim','files','length','session','\x0aChanges\x20to\x20\x27','targetDir','activations','parentSegment','content','data','journeyVersions','isNew','resourceName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2236913uzLlgF','errorCode','execute','file','site','✔\x20Context\x20set:\x20','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','53711bddutl','parentName','✔\x20Pulled\x20','journeys','hasChanges','parent_segment','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','red','repeat','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segment'];a40_0x4fed=function(){return _0x49c918;};return a40_0x4fed();}
@@ -1 +1 @@
1
- const a41_0x14ca61=a41_0x5468;(function(_0x5d0c68,_0x5e788d){const _0x579c80=a41_0x5468,_0x52084b=_0x5d0c68();while(!![]){try{const _0x3aca70=parseInt(_0x579c80(0x119))/0x1+parseInt(_0x579c80(0xbc))/0x2*(-parseInt(_0x579c80(0x95))/0x3)+-parseInt(_0x579c80(0xc7))/0x4+-parseInt(_0x579c80(0xcb))/0x5*(-parseInt(_0x579c80(0xf2))/0x6)+parseInt(_0x579c80(0xe3))/0x7+parseInt(_0x579c80(0xe9))/0x8+parseInt(_0x579c80(0xf1))/0x9*(-parseInt(_0x579c80(0x82))/0xa);if(_0x3aca70===_0x5e788d)break;else _0x52084b['push'](_0x52084b['shift']());}catch(_0x457816){_0x52084b['push'](_0x52084b['shift']());}}}(a41_0x8ea5,0x8e7e4));import{BaseCommand}from'./command.js';function a41_0x5468(_0x290d2a,_0xfb1cfd){_0x290d2a=_0x290d2a-0x81;const _0x8ea5a9=a41_0x8ea5();let _0x54687c=_0x8ea5a9[_0x290d2a];return _0x54687c;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a41_0x8ea5(){const _0x3b774e=['380wcQFWe','\x20deleted','segment:push','existingSegment','data','results','existingJourney','filePath','buildUserMaps','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','error','idToName','\x20to\x20delete','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segments','map','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error\x20parsing\x20YAML:\x20','parentSegment','4842zIAMgr','execute','\x20\x20\x20\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Delete\x20journey:','isNew','toCreate','getJourney','push','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','updated','Parent\x20segment:\x20','user','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20to\x20create','segment','created','\x20unchanged','then','/j/da/je','list','attributes','errorCode','listFolders','delete','targetDir','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Source\x20directory:\x20','folderPath','Changes\x20to:','journeyBundleName','\x20\x20Activations:\x20','updatedAt','filter','parentFolder','Folders\x20to\x20create:','cwd','\x20new','/app/ps/','754AHHeJY','toDelete','Error:\x20Directory\x20not\x20found:\x20','journeysOnly','green','.yaml','Error:\x20','folders','Fetching\x20existing\x20activations...','red','activations','1809452UNnPWX','\x0aPush\x20summary\x20for\x20\x27','journey','Changes\x20to\x20journey:','1055vaxlmg','/sb/da/esr','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','parentName','(Journey\x20will\x20be\x20deleted)','getParent','versionNumber','cyan','listJourneysWithDetailsFromParentSegment','nameToId','description','name','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)','length','helpText','get','diff','No\x20','repeat','.yml','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','toUpdate','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','6397797iEiQDi','changed','\x20updated','\x0aError:','folderId','new','5756536QsjwFN','journeyBundleId','segmentFolderId','yes','\x20folders\x20to\x20create','Site:\x20','state','\x20\x20Segments:\x20','375183hbfasZ','25446BUVwik','yamlConfig','unchanged','join','Fetching\x20existing\x20data...','blue','verbose','journeys','audienceId','Preparing\x20journeys...','/e/','no_parent','relationships','Resolving\x20parent\x20segment\x20\x27','site','\x20created','set','endsWith','\x20\x20📊\x20Segments:','message','paused','\x20activations]','resolveParentId','connection','all','dim','\x20changed','\x0a✔\x20Push\x20complete','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','type','journeyId','add','toString','getOutputSchemaWithCache','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','isScoped','yellow','deleted','nameToType','700210WjdeWJ','Fetching\x20connections\x20for\x20name\x20resolution...','\x0aValidation\x20failed:'];a41_0x8ea5=function(){return _0x3b774e;};return a41_0x8ea5();}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 a41_0x403a54 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x14ca61(0xd6)]=a41_0x14ca61(0x84);[a41_0x14ca61(0xd5)]=a41_0x14ca61(0x9e);async[a41_0x14ca61(0x96)](_0x1cc975){const _0x338d19=a41_0x14ca61,{options:_0x58df5f,args:_0x2264b0,tdx:_0xcfaebb}=_0x1cc975,_0x3bf5f8=_0x58df5f,_0x2279c4=await resolveTarget({'arg':_0x2264b0[0x0],'contextParent':_0x58df5f[_0x338d19(0x94)],'cwd':process[_0x338d19(0xb9)]()});if(!isSuccessfulResolution(_0x2279c4))return _0x2279c4[_0x338d19(0xab)]===_0x338d19(0xfd)?(console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0x8f))),console[_0x338d19(0x8c)](_0x338d19(0xd7)),console[_0x338d19(0x8c)](_0x338d19(0xe0)),console[_0x338d19(0x8c)](_0x338d19(0x8b))):(console['error'](a41_0x403a54['red'](_0x338d19(0xc2)+_0x2279c4[_0x338d19(0x105)]+'\x0a')),_0x2279c4[_0x338d19(0xd9)]&&console['error'](a41_0x403a54['cyan'](_0x2279c4[_0x338d19(0xd9)]))),0x1;if(_0x2279c4[_0x338d19(0x10f)]==='parent_name')return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xbe)+_0x2279c4[_0x338d19(0xae)]+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)](_0x338d19(0x92))),0x1;const _0x109c65=_0x2279c4[_0x338d19(0xce)],_0x56ceae=_0x2279c4[_0x338d19(0xae)],_0x3ba8ee=_0x2279c4[_0x338d19(0x10f)]==='file'?_0x2279c4[_0x338d19(0x89)]:undefined,_0xb1476a=getScopedDetails(_0x2279c4),_0x267418=_0xb1476a?.[_0x338d19(0x115)]??![],_0x48c578=_0xb1476a?.['scopedFolderPath']??'';if(!existsSync(_0x56ceae))return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xbe)+_0x56ceae+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3bf5f8[_0x338d19(0xf8)]&&(console[_0x338d19(0x8c)](_0x338d19(0xee)+_0x3bf5f8[_0x338d19(0x100)]),console[_0x338d19(0x8c)](_0x338d19(0xa0)+_0x109c65),console['error'](_0x338d19(0xb0)+_0x56ceae),_0x267418&&console[_0x338d19(0x8c)]('Scoped\x20to\x20folder:\x20'+_0x48c578));const _0x46503d=await withSpinner(_0x338d19(0xff)+_0x109c65+'\x27...',()=>_0xcfaebb[_0x338d19(0xa4)][_0x338d19(0x108)](_0x109c65),{'verbose':_0x3bf5f8[_0x338d19(0xf8)]}),_0x60511c=_0x46503d[_0x338d19(0x86)],{parentSegmentResult:_0x795b52,segmentsResult:_0x4d04e0,foldersResult:_0x5d7c60,journeysWithDetailsResult:_0x2f23a0,userMaps:_0x198ee1}=await withSpinner(_0x338d19(0xf6),async()=>{const _0x293695=_0x338d19,[_0x5a5a62,_0x1e7988,_0x1c008e,_0xe1b2cd,_0x5af9f8]=await Promise[_0x293695(0x10a)]([_0xcfaebb[_0x293695(0xa4)][_0x293695(0xd0)](_0x60511c),_0xcfaebb[_0x293695(0xa4)]['listSegments'](_0x60511c),_0xcfaebb['segment'][_0x293695(0xac)](_0x60511c),_0xcfaebb[_0x293695(0xc9)][_0x293695(0xd3)](_0x60511c,{'includeAllVersions':!![]}),_0xcfaebb[_0x293695(0xa1)][_0x293695(0x8a)]()]);return{'parentSegmentResult':_0x5a5a62,'segmentsResult':_0x1e7988,'foldersResult':_0x1c008e,'journeysWithDetailsResult':_0xe1b2cd,'userMaps':_0x5af9f8};},{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})['then'](_0x53efdd=>_0x53efdd[_0x338d19(0x86)]),_0xf31112=_0x795b52,_0x31e8d7=extractRootFolderId(_0xf31112),_0xf88703=_0x4d04e0,_0x36ac6a=_0x5d7c60,{journeys:_0x25f488,activationStepsById:_0x5d286d}=_0x2f23a0,_0x4b2199=new Map(_0x25f488[_0x338d19(0x91)](_0x1220b9=>[_0x1220b9['id'],_0x1220b9])),_0x2e8281=_0x25f488[_0x338d19(0x91)](_0x4f8c44=>({'id':_0x4f8c44['id'],'name':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xd6)],'journeyBundleName':_0x4f8c44['attributes']['journeyBundleName']||'','journeyBundleId':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xea)]||'','versionNumber':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xd1)],'description':_0x4f8c44[_0x338d19(0xaa)]['description'],'state':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xef)],'paused':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0x106)],'audienceId':_0x4f8c44['attributes'][_0x338d19(0xfa)],'folderId':_0x4f8c44[_0x338d19(0xfe)]?.[_0x338d19(0xb7)]?.[_0x338d19(0x86)]?.['id'],'createdAt':_0x4f8c44[_0x338d19(0xaa)]['createdAt'],'updatedAt':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xb5)]})),{emailToId:_0x24965a,idToEmail:_0x4ecd49}=_0x198ee1,_0x22f074=await withSpinner(_0x338d19(0x11a),async()=>{const _0x5bca86=_0x338d19,_0x594c27=await _0xcfaebb[_0x5bca86(0x109)][_0x5bca86(0xa9)]();return buildConnectionMaps(_0x594c27);},{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})[_0x338d19(0xa7)](_0x1b0c08=>_0x1b0c08[_0x338d19(0x86)]),_0xf8a484=_0x22f074[_0x338d19(0xd4)],_0x57f034=_0x22f074[_0x338d19(0x8d)],_0x2eb6be=_0x22f074[_0x338d19(0x118)],_0x33e173={'emailToIdMap':_0x24965a,'connectionNameToIdMap':_0xf8a484,'connectionNameToTypeMap':_0x2eb6be,'getSchema':_0x547750=>_0xcfaebb['connection'][_0x338d19(0x113)](_0x547750)};let {pathToId:_0x42a99e,idToPath:_0x35e68b}=buildFolderMaps(_0x36ac6a);const _0x15cbe2=buildSegmentLookupMap(_0xf88703,_0x35e68b),_0x46da74=buildSegmentNameToIdMap(_0xf88703),_0x417abe=buildJourneyBundleLookupMap(_0x2e8281,_0x35e68b);let _0x2644c6;if(_0x3ba8ee){if(!_0x3ba8ee[_0x338d19(0x103)](_0x338d19(0xde))&&!_0x3ba8ee['endsWith'](_0x338d19(0xc1)))return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3ba8ee+'\x0a')),0x1;_0x2644c6=[_0x3ba8ee];}else _0x2644c6=findYamlFiles(_0x56ceae);if(_0x2644c6['length']===0x0)return console['error'](a41_0x403a54['red'](_0x338d19(0xaf)+_0x56ceae+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)](_0x338d19(0x98))),0x1;let _0x37141a,_0x3c78e7;try{const _0x2d0a73=parseAndClassifyYamlFiles(_0x2644c6,_0x56ceae,{'skipSegments':_0x3bf5f8[_0x338d19(0xbf)]});_0x37141a=_0x2d0a73[_0x338d19(0x90)],_0x3c78e7=_0x2d0a73[_0x338d19(0xf9)];const _0x583013=validateParsedFiles(_0x2d0a73,_0x56ceae);if(_0x583013['length']>0x0)return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x81))),console['error'](formatValidationErrors(_0x583013)),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xa2))),0x1;}catch(_0x454885){return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x93)+(_0x454885 instanceof Error?_0x454885[_0x338d19(0x105)]:_0x454885))),0x1;}if(_0x37141a[_0x338d19(0xd8)]===0x0&&_0x3c78e7[_0x338d19(0xd8)]===0x0){const _0x1418e9=_0x3bf5f8['journeysOnly']?_0x338d19(0xc9):'segment\x20or\x20journey';return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xdc)+_0x1418e9+'\x20YAML\x20files\x20found')),0x0;}const _0x37e5fd=new Map();_0xf88703['length']>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&await withSpinner(_0x338d19(0xc4),async()=>{await batchAsync(_0xf88703,async _0x5a8605=>{const _0x57168e=a41_0x5468,_0x8357f0=await _0xcfaebb[_0x57168e(0xa4)]['listActivations'](_0x60511c,_0x5a8605['id']);_0x37e5fd[_0x57168e(0x102)](_0x5a8605['id'],_0x8357f0);});},{'verbose':_0x3bf5f8['verbose']});const {segmentFiles:_0x57fd90,foldersToCreate:_0x44f61e}=await prepareSegmentFiles(_0x37141a,{'segmentByFolderAndName':_0x15cbe2,'activationsBySegmentId':_0x37e5fd,'folderPathToId':_0x42a99e,'idToEmailMap':_0x4ecd49,'connectionIdToNameMap':_0x57f034},_0x33e173,_0x267418,_0x48c578),_0x463058=_0x3ba8ee?[]:findSegmentsToDelete(_0xf88703,_0x37141a[_0x338d19(0x91)](({yamlConfig:_0x136dfd,folderPath:_0xd78b02})=>({'yamlConfig':_0x136dfd,'folderPath':resolveTDFolderPath(_0xd78b02,_0x267418,_0x48c578)})),_0x35e68b,_0x48c578,_0x267418),{journeyFiles:_0x47e664,foldersToCreate:_0x40da00}=await withProgressSpinner(_0x338d19(0xfb),async _0x6abad3=>prepareJourneyFiles(_0x3c78e7,{'fetchJourney':async _0x55454e=>_0xcfaebb['journey'][_0x338d19(0x9c)](_0x55454e[_0x338d19(0x110)]),'journeyBundlesByFolderAndName':_0x417abe,'folderPathToId':_0x42a99e,'idToEmailMap':_0x4ecd49,'connectionIdToNameMap':_0x57f034,'existingSegments':_0xf88703,'parentId':_0x60511c,'deps':_0xcfaebb,'progress':{'update':_0x1576d9=>{const _0xf6ce9d=_0x338d19;_0x6abad3['setPhase'](_0x1576d9),_0x3bf5f8['verbose']&&console[_0xf6ce9d(0x8c)]('\x20\x20'+_0x1576d9);}},'journeyById':_0x4b2199,'activationStepsById':_0x5d286d},_0x267418,_0x48c578),{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})[_0x338d19(0xa7)](_0xa3b858=>_0xa3b858['data']);for(const _0x517f54 of _0x40da00){_0x44f61e[_0x338d19(0x111)](_0x517f54);}const _0x54e2a1=_0x3ba8ee?[]:findJourneysToDelete(_0x2e8281,_0x3c78e7[_0x338d19(0x91)](({yamlConfig:_0x16f5fd,folderPath:_0x388728})=>({'yamlConfig':_0x16f5fd,'folderPath':resolveTDFolderPath(_0x388728,_0x267418,_0x48c578)})),_0x35e68b,_0x48c578,_0x267418),_0x838f31=calculatePushStats(_0x57fd90,_0x47e664,_0x44f61e,_0x463058,_0x54e2a1,!!_0x3bf5f8[_0x338d19(0xad)],!!_0x3bf5f8[_0x338d19(0xbf)]),_0xa97ce8=_0x838f31[_0x338d19(0x90)]['new'],_0x71f2c3=_0x838f31['segments']['changed'],_0xaf855a=_0x838f31[_0x338d19(0x90)]['unchanged'],_0xa37a59=_0x838f31[_0x338d19(0x90)]['toDelete'],_0x323d9e=_0x838f31[_0x338d19(0xc3)]['toCreate'],_0x2deb78=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xe8)],_0x24801d=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xe4)],_0x4c1a3a=_0x838f31['journeys'][_0x338d19(0xf4)],_0x10fac7=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xbd)],_0x372b24=_0x838f31[_0x338d19(0xc6)][_0x338d19(0x10a)],_0x4388f6=_0x838f31[_0x338d19(0xc6)][_0x338d19(0x9b)],_0x419292=_0x838f31['activations'][_0x338d19(0xe1)],_0x435056=_0x838f31[_0x338d19(0xc6)]['toDelete'];console[_0x338d19(0x8c)](_0x338d19(0xc8)+_0x109c65+'\x27:');_0x323d9e[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xf7)]('📁\x20'+_0x323d9e[_0x338d19(0xd8)]+_0x338d19(0xed)));if(!_0x3bf5f8[_0x338d19(0xbf)]){console['error'](_0x338d19(0x104)),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0xa97ce8[_0x338d19(0xd8)]+_0x338d19(0xba))),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x71f2c3[_0x338d19(0xd8)]+_0x338d19(0x10c)));if(_0xa37a59[_0x338d19(0xd8)]>0x0)console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0xa37a59[_0x338d19(0xd8)]+_0x338d19(0x8e)));else _0x463058[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xad)]&&console['error'](_0x338d19(0x97)+a41_0x403a54['dim'](_0x463058[_0x338d19(0xd8)]+_0x338d19(0x10e)));console[_0x338d19(0x8c)]('\x20\x20\x20\x20'+a41_0x403a54[_0x338d19(0x10b)]('=\x20'+_0xaf855a[_0x338d19(0xd8)]+_0x338d19(0xa6)));}if(_0x47e664[_0x338d19(0xd8)]>0x0||_0x54e2a1[_0x338d19(0xd8)]>0x0){console[_0x338d19(0x8c)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0x2deb78['length']+'\x20new')),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x24801d[_0x338d19(0xd8)]+_0x338d19(0x10c)));if(_0x10fac7[_0x338d19(0xd8)]>0x0)console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0x10fac7[_0x338d19(0xd8)]+_0x338d19(0x8e)));else _0x54e2a1[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8['delete']&&console[_0x338d19(0x8c)]('\x20\x20\x20\x20'+a41_0x403a54[_0x338d19(0x10b)](_0x54e2a1[_0x338d19(0xd8)]+_0x338d19(0x10e)));console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54['dim']('=\x20'+_0x4c1a3a['length']+'\x20unchanged'));}_0x372b24[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&(console[_0x338d19(0x8c)](''),console['error']('\x20\x20Activations:'),_0x4388f6['length']>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0x4388f6[_0x338d19(0xd8)]+_0x338d19(0xa3))),_0x419292['length']>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x419292[_0x338d19(0xd8)]+'\x20to\x20update')),_0x435056[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0x435056['length']+_0x338d19(0x8e))));console[_0x338d19(0x8c)]('\x20\x20Source:\x20'+a41_0x403a54['cyan'](_0x56ceae)+'\x0a');if(_0x323d9e[_0x338d19(0xd8)]>0x0){console['error'](_0x338d19(0xb8));for(const _0x1acd13 of _0x323d9e){console['error']('\x20\x20'+a41_0x403a54['blue']('+')+'\x20'+_0x1acd13);}console[_0x338d19(0x8c)]('');}if(_0xa97ce8['length']>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x5d734b of _0xa97ce8){const _0x14c36b=_0x5d734b[_0x338d19(0xb1)]?_0x5d734b[_0x338d19(0xb1)]+'/'+_0x5d734b[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x5d734b[_0x338d19(0xf3)][_0x338d19(0xd6)],_0x2bf307=_0x5d734b['yamlConfig']['activations']?.[_0x338d19(0xd8)]||0x0,_0x5177cf=_0x2bf307>0x0?a41_0x403a54[_0x338d19(0x10b)]('\x20['+_0x2bf307+_0x338d19(0x107)):'';console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc0)]('New\x20segment:')+'\x20'+_0x14c36b+_0x5177cf),console['error']('─'[_0x338d19(0xdd)](0x3c)),_0x5d734b[_0x338d19(0xdb)]&&console['error'](_0x5d734b['diff']),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}if(_0xa37a59[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x33b0db of _0xa37a59){const _0x33249e=_0x33b0db['segmentFolderId']?_0x35e68b['get'](_0x33b0db[_0x338d19(0xeb)][_0x338d19(0x112)]())||'':'',_0x16f38c=_0x33249e?_0x33249e+'/'+_0x33b0db[_0x338d19(0xd6)]:_0x33b0db[_0x338d19(0xd6)],_0x4c0651=_0x37e5fd[_0x338d19(0xda)](_0x33b0db['id'])||[],_0xaa7fcf=_0x4c0651['length']>0x0?a41_0x403a54[_0x338d19(0x10b)]('\x20['+_0x4c0651[_0x338d19(0xd8)]+_0x338d19(0x107)):'';console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc5)]('Delete\x20segment:')+'\x20'+_0x16f38c+_0xaa7fcf),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));const _0x27b568=segmentWithActivationsToYaml(_0x33b0db,_0x4c0651,undefined,_0x4ecd49,_0x57f034),_0x2f7b69=segmentToYamlString(_0x27b568),_0x3801bc=generateDiff(_0x2f7b69,'');console[_0x338d19(0x8c)](formatDiffWithColors(_0x3801bc)),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}const _0x18d3f5=_0x57fd90[_0x338d19(0xb6)](_0x272a65=>!_0x272a65[_0x338d19(0x9a)]&&_0x272a65[_0x338d19(0xdb)]);if(_0x18d3f5[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x5ca497 of _0x18d3f5){const _0x59a82e=_0x5ca497[_0x338d19(0xb1)]?_0x5ca497[_0x338d19(0xb1)]+'/'+_0x5ca497[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x5ca497[_0x338d19(0xf3)][_0x338d19(0xd6)];console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xb2))+'\x20'+_0x59a82e),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console[_0x338d19(0x8c)](_0x5ca497[_0x338d19(0xdb)]),console['error']('─'[_0x338d19(0xdd)](0x3c));}if(_0x2deb78['length']>0x0)for(const _0x4d0c00 of _0x2deb78){const _0x53fb32=_0x4d0c00[_0x338d19(0xb1)]?_0x4d0c00[_0x338d19(0xb1)]+'/'+_0x4d0c00[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x4d0c00[_0x338d19(0xf3)][_0x338d19(0xd6)];console['error']('\x0a'+a41_0x403a54[_0x338d19(0xc0)]('New\x20journey:')+'\x20'+_0x53fb32),console[_0x338d19(0x8c)]('─'['repeat'](0x3c)),_0x4d0c00[_0x338d19(0xdb)]&&console['error'](_0x4d0c00['diff']),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}const _0x2b8725=_0x47e664[_0x338d19(0xb6)](_0x16ac38=>!_0x16ac38['isNew']&&_0x16ac38[_0x338d19(0xdb)]);if(_0x2b8725['length']>0x0)for(const _0x3730b3 of _0x2b8725){const _0x1c33ee=_0x3730b3[_0x338d19(0xb1)]?_0x3730b3[_0x338d19(0xb1)]+'/'+_0x3730b3[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x3730b3[_0x338d19(0xf3)]['name'];console['error']('\x0a'+a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xca))+'\x20'+_0x1c33ee),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console[_0x338d19(0x8c)](_0x3730b3[_0x338d19(0xdb)]),console[_0x338d19(0x8c)]('─'['repeat'](0x3c));}if(_0x10fac7[_0x338d19(0xd8)]>0x0)for(const _0x56a160 of _0x10fac7){const _0x4e315b=_0x56a160[_0x338d19(0xe7)]?_0x35e68b['get'](_0x56a160[_0x338d19(0xe7)])||'':'',_0x46abce=_0x4e315b?_0x4e315b+'/'+_0x56a160[_0x338d19(0xb3)]:_0x56a160[_0x338d19(0xb3)];console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x99))+'\x20'+_0x46abce),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console['error'](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xcf))),console[_0x338d19(0x8c)]('─'['repeat'](0x3c));}if(_0x3bf5f8[_0x338d19(0xdf)])return console['error'](a41_0x403a54['yellow'](_0x338d19(0xe2))),0x0;const _0x2adb42=_0x3bf5f8[_0x338d19(0xbf)]?![]:_0xa97ce8[_0x338d19(0xd8)]>0x0||_0x71f2c3[_0x338d19(0xd8)]>0x0||_0xa37a59[_0x338d19(0xd8)]>0x0,_0x256116=_0x2deb78[_0x338d19(0xd8)]>0x0||_0x24801d[_0x338d19(0xd8)]>0x0||_0x10fac7[_0x338d19(0xd8)]>0x0,_0x9a865b=_0x3bf5f8[_0x338d19(0xbf)]?![]:_0x372b24['length']>0x0,_0x29a387=_0x323d9e[_0x338d19(0xd8)]>0x0;if(!_0x2adb42&&!_0x256116&&!_0x9a865b&&!_0x29a387){const _0x1953e2=_0x3bf5f8[_0x338d19(0xbf)]?_0x338d19(0x114):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc0)](_0x1953e2));if(_0x3ba8ee&&_0xaf855a['length']===0x1){const _0x204638=_0xaf855a[0x0];if(_0x204638[_0x338d19(0x85)]?.['id']){const _0x2818de=getConsoleNextUrl(_0x3bf5f8[_0x338d19(0x100)],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x204638[_0x338d19(0x85)]['id']+_0x338d19(0xcc));console[_0x338d19(0x8c)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x2818de));}}if(_0x3ba8ee&&_0x4c1a3a[_0x338d19(0xd8)]===0x1){const _0x29584b=_0x4c1a3a[0x0];if(_0x29584b[_0x338d19(0x88)]?.['id']){const _0x1475d8=getConsoleNextUrl(_0x3bf5f8[_0x338d19(0x100)],_0x338d19(0xbb)+_0x60511c+'/e/'+_0x29584b[_0x338d19(0x88)]['id']+_0x338d19(0xa8));console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x1475d8));}}return 0x0;}const _0x421232=_0x3bf5f8[_0x338d19(0xbf)]?_0x2deb78[_0x338d19(0xd8)]+_0x24801d[_0x338d19(0xd8)]+_0x10fac7['length']+_0x323d9e[_0x338d19(0xd8)]:_0xa97ce8[_0x338d19(0xd8)]+_0x71f2c3[_0x338d19(0xd8)]+_0xa37a59[_0x338d19(0xd8)]+_0x2deb78[_0x338d19(0xd8)]+_0x24801d['length']+_0x10fac7['length']+_0x323d9e[_0x338d19(0xd8)]+_0x372b24['length'];if(!_0x3bf5f8[_0x338d19(0xec)]&&_0x421232>0x0){if(!isInteractive())return console[_0x338d19(0x8c)](a41_0x403a54['red'](_0x338d19(0xe6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x10b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x16db10=await confirmKey('Push\x20'+_0x421232+'\x20changes?');if(!_0x16db10)return console['error'](a41_0x403a54[_0x338d19(0x116)]('Aborted.')),0x1;}const _0x33956b={'withProgress':async(_0x1b593a,_0x4bba5a)=>{const _0x53fe0e=_0x338d19,_0x2c631d=await withSpinner(_0x1b593a,_0x4bba5a,{'verbose':_0x3bf5f8[_0x53fe0e(0xf8)]});return{'data':_0x2c631d['data']};},'logInfo':_0xf92c74=>console[_0x338d19(0x8c)](a41_0x403a54['blue']('✔\x20'+_0xf92c74)),'logSuccess':_0x1b005d=>console['error'](a41_0x403a54[_0x338d19(0xc0)]('✔\x20'+_0x1b005d)),'logWarning':_0x3d2ec2=>console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)]('⚠\x20'+_0x3d2ec2)),'logDeleted':_0x320bba=>console[_0x338d19(0x8c)](a41_0x403a54['red']('✔\x20'+_0x320bba))},_0x40473a={'segment':_0xcfaebb['segment'],'journey':_0xcfaebb[_0x338d19(0xc9)],'user':_0xcfaebb[_0x338d19(0xa1)],'connection':_0xcfaebb[_0x338d19(0x109)]};_0x323d9e[_0x338d19(0xd8)]>0x0&&(_0x42a99e=await executePushFolders(_0x40473a,_0x323d9e,_0x42a99e,{'parentId':_0x60511c},_0x33956b));const _0x11088b={'rootFolderId':_0x31e8d7,'folderPathToId':_0x42a99e,'folderIdToPath':_0x35e68b,'segmentNameToId':_0x46da74,'activationsBySegmentId':_0x37e5fd,'emailToIdMap':_0x24965a,'idToEmailMap':_0x4ecd49,'connectionNameToIdMap':_0x22f074['nameToId'],'connectionIdToNameMap':_0x22f074[_0x338d19(0x8d)],'connectionNameToTypeMap':_0x2eb6be},_0x1ee785=await executePushSegments(_0x40473a,_0x3bf5f8[_0x338d19(0xbf)]?[]:_0x57fd90,_0x11088b,{'parentId':_0x60511c},_0x33956b),_0x52b4ac=_0x1ee785[_0x338d19(0xa5)],_0x148e6c=_0x1ee785['updated'],_0x3a8a19=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0xa5)],_0x11328c=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0x9f)],_0x1c4682=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0x117)];let _0x17571e;if(_0x3ba8ee&&_0x57fd90[_0x338d19(0xd8)]===0x1){const _0x39464a=_0x57fd90[0x0];_0x17571e=_0x39464a[_0x338d19(0x85)]?.['id']??_0x1ee785['createdSegmentIds'][_0x338d19(0xda)](_0x39464a[_0x338d19(0xf3)][_0x338d19(0xd6)]);}const _0x1fd65a=await executePushSegmentDeletions(_0x40473a,_0x3bf5f8[_0x338d19(0xbf)]?[]:_0xa37a59,_0x33956b);let _0x39e6f0=0x0,_0x127afd=0x0,_0x26e77a=0x0;const _0x215422=new Map(_0x46da74);for(const [_0xdc14c4,_0x3133f6]of _0x1ee785['createdSegmentIds']){_0x215422[_0x338d19(0x102)](_0xdc14c4,_0x3133f6);}if(_0x47e664[_0x338d19(0xd8)]>0x0){const _0x5e2c9e={..._0x11088b,'segmentNameToId':_0x215422,'existingSegments':_0xf88703,'activationContext':_0x33e173},_0x5fcb26=await executePushJourneys(_0x40473a,_0x47e664,_0x5e2c9e,{'parentId':_0x60511c,'rootFolderId':_0x31e8d7,'verbose':_0x3bf5f8['verbose']},_0x33956b);_0x39e6f0=_0x5fcb26[_0x338d19(0xa5)],_0x127afd=_0x5fcb26[_0x338d19(0x9f)];if(_0x3ba8ee&&_0x5fcb26[_0x338d19(0x87)][_0x338d19(0xd8)]===0x1){const _0x3ac777=_0x5fcb26[_0x338d19(0x87)][0x0];if(_0x3ac777[_0x338d19(0x110)]){const _0x441f15=getConsoleNextUrl(_0x3bf5f8['site'],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x3ac777[_0x338d19(0x110)]+'/j/da/je');console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x441f15));}}}for(const _0x354fb3 of _0x10fac7){console['error'](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xcd)+_0x354fb3[_0x338d19(0xb3)])),_0x26e77a++;}const _0x31f1d6=[];if(_0x52b4ac>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x52b4ac+_0x338d19(0x101));if(_0x148e6c>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x148e6c+_0x338d19(0xe5));if(_0x1fd65a>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x1fd65a+_0x338d19(0x83));const _0x5ac671=[];if(_0x39e6f0>0x0)_0x5ac671[_0x338d19(0x9d)](_0x39e6f0+'\x20created');if(_0x127afd>0x0)_0x5ac671['push'](_0x127afd+'\x20updated');if(_0x26e77a>0x0)_0x5ac671[_0x338d19(0x9d)](_0x26e77a+_0x338d19(0x83));const _0x1e2d49=[];if(_0x3a8a19>0x0)_0x1e2d49['push'](_0x3a8a19+'\x20created');if(_0x11328c>0x0)_0x1e2d49[_0x338d19(0x9d)](_0x11328c+_0x338d19(0xe5));if(_0x1c4682>0x0)_0x1e2d49[_0x338d19(0x9d)](_0x1c4682+_0x338d19(0x83));console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc0)](_0x338d19(0x10d)));_0x31f1d6[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&console[_0x338d19(0x8c)](_0x338d19(0xf0)+_0x31f1d6[_0x338d19(0xf5)](',\x20'));_0x5ac671[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)]('\x20\x20Journeys:\x20'+_0x5ac671[_0x338d19(0xf5)](',\x20'));_0x1e2d49[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&console[_0x338d19(0x8c)](_0x338d19(0xb4)+_0x1e2d49['join'](',\x20'));if(_0x17571e){const _0x11a42=getConsoleNextUrl(_0x3bf5f8['site'],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x17571e+_0x338d19(0xcc));console[_0x338d19(0x8c)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x11a42));}return 0x0;}}
1
+ const a41_0x2630ef=a41_0x3235;(function(_0x30f908,_0x5eb8e7){const _0x1c0fa8=a41_0x3235,_0x2741db=_0x30f908();while(!![]){try{const _0x32b353=parseInt(_0x1c0fa8(0x204))/0x1*(-parseInt(_0x1c0fa8(0x1f9))/0x2)+parseInt(_0x1c0fa8(0x1af))/0x3*(parseInt(_0x1c0fa8(0x1fa))/0x4)+parseInt(_0x1c0fa8(0x1ae))/0x5*(parseInt(_0x1c0fa8(0x1ad))/0x6)+parseInt(_0x1c0fa8(0x1d7))/0x7+-parseInt(_0x1c0fa8(0x220))/0x8+-parseInt(_0x1c0fa8(0x22b))/0x9*(-parseInt(_0x1c0fa8(0x1b0))/0xa)+-parseInt(_0x1c0fa8(0x1b7))/0xb;if(_0x32b353===_0x5eb8e7)break;else _0x2741db['push'](_0x2741db['shift']());}catch(_0x219806){_0x2741db['push'](_0x2741db['shift']());}}}(a41_0x5499,0x21a75));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a41_0x5499(){const _0x1cf227=['createdAt','message','updatedAt','unchanged','journeyBundleName','versionNumber','1167039bSWZDN','user','join','repeat','parentSegment','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','paused','dim','diff','map','Error\x20parsing\x20YAML:\x20','delete','\x27...','then','\x20deleted','parentFolder','\x20\x20Source:\x20','red','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','existingJourney','filePath','toDelete','New\x20segment:','activations','blue','journeys','site','dryRun','toCreate','yamlConfig','\x20\x20Activations:\x20','/e/','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)','scopedFolderPath','helpText','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','errorCode','20766pKRIvn','385QgRHLu','26085ttHXiK','20zszqiO','segments','data','folders','cwd','\x20unchanged','updated','421542emNIBY','yes','error','file','Parent\x20segment:\x20','\x0aError:','.yaml','\x20to\x20update','length','state','Aborted.','folderPath','getOutputSchemaWithCache','journey','parentName','\x20to\x20create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20🗺️\x20\x20Journeys:','getJourney','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','type','execute','no_parent','No\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','journeysOnly','name','\x20to\x20delete','nameToId','\x20YAML\x20files\x20found','green','Error:\x20Directory\x20not\x20found:\x20','148596ZLraSD','nameToType','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','toUpdate','\x0aValidation\x20failed:','New\x20journey:','\x20\x20Segments:\x20','\x20new','getParent','(Journey\x20will\x20be\x20deleted)','Fetching\x20existing\x20data...','Delete\x20journey:','listActivations','Scoped\x20to\x20folder:\x20','\x0aPush\x20summary\x20for\x20\x27','results','setPhase','/app/ps/','yellow','filter','Source\x20directory:\x20','add','buildUserMaps','resolveParentId','created','/sb/da/esr','\x20activations]','targetDir','\x20changed','audienceId','\x20\x20\x20\x20','list','existingSegment','\x20created','2DXxNPo','4bXTHRz','\x20\x20Journeys:\x20','listSegments','Push\x20','segmentFolderId','folderId','deleted','toString','listFolders','endsWith','119057PFigyE','\x0a✔\x20Push\x20complete','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','attributes','changed','all','isScoped','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Changes\x20to\x20journey:','\x20changes?','journeyId','cyan','set','📁\x20','\x20folders\x20to\x20create','connection','.yml','segment','\x20updated','push','verbose','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','idToName','get','Site:\x20','parent_name','Changes\x20to:','2084304IxhHix','/j/da/je','Preparing\x20journeys...','segment\x20or\x20journey','createdSegmentIds'];a41_0x5499=function(){return _0x1cf227;};return a41_0x5499();}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 a41_0x4b7560 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a41_0x3235(_0x116129,_0x319a2c){_0x116129=_0x116129-0x1a3;const _0x54994e=a41_0x5499();let _0x3235ca=_0x54994e[_0x116129];return _0x3235ca;}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{[a41_0x2630ef(0x1d1)]='segment:push';['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments';async[a41_0x2630ef(0x1cc)](_0x17b97d){const _0x144808=a41_0x2630ef,{options:_0x522c50,args:_0x5cc4d1,tdx:_0x5c4431}=_0x17b97d,_0x469508=_0x522c50,_0x3e9e1b=await resolveTarget({'arg':_0x5cc4d1[0x0],'contextParent':_0x522c50[_0x144808(0x22f)],'cwd':process[_0x144808(0x1b4)]()});if(!isSuccessfulResolution(_0x3e9e1b))return _0x3e9e1b[_0x144808(0x1ac)]===_0x144808(0x1cd)?(console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x144808(0x1b9)](_0x144808(0x1a8)),console[_0x144808(0x1b9)](_0x144808(0x1c7)),console[_0x144808(0x1b9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)]('Error:\x20'+_0x3e9e1b[_0x144808(0x226)]+'\x0a')),_0x3e9e1b[_0x144808(0x1aa)]&&console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x210)](_0x3e9e1b[_0x144808(0x1aa)]))),0x1;if(_0x3e9e1b[_0x144808(0x1cb)]===_0x144808(0x21e))return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1d6)+_0x3e9e1b[_0x144808(0x1f2)]+'\x0a')),console[_0x144808(0x1b9)](a41_0x4b7560['cyan'](_0x144808(0x20b))),0x1;const _0x5884fe=_0x3e9e1b[_0x144808(0x1c5)],_0x2df33b=_0x3e9e1b['targetDir'],_0x5f027c=_0x3e9e1b[_0x144808(0x1cb)]===_0x144808(0x1ba)?_0x3e9e1b[_0x144808(0x23f)]:undefined,_0x13f9bb=getScopedDetails(_0x3e9e1b),_0x4d88b6=_0x13f9bb?.[_0x144808(0x20a)]??![],_0x4b6be3=_0x13f9bb?.[_0x144808(0x1a9)]??'';if(!existsSync(_0x2df33b))return console[_0x144808(0x1b9)](a41_0x4b7560['red'](_0x144808(0x1d6)+_0x2df33b+'\x0a')),console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x210)](_0x144808(0x20b))),0x1;_0x469508[_0x144808(0x219)]&&(console['error'](_0x144808(0x21d)+_0x469508[_0x144808(0x245)]),console[_0x144808(0x1b9)](_0x144808(0x1bb)+_0x5884fe),console[_0x144808(0x1b9)](_0x144808(0x1eb)+_0x2df33b),_0x4d88b6&&console[_0x144808(0x1b9)](_0x144808(0x1e4)+_0x4b6be3));const _0x45f302=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5884fe+_0x144808(0x237),()=>_0x5c4431['segment'][_0x144808(0x1ee)](_0x5884fe),{'verbose':_0x469508[_0x144808(0x219)]}),_0x264fc1=_0x45f302[_0x144808(0x1b2)],{parentSegmentResult:_0xc305d6,segmentsResult:_0x2a9979,foldersResult:_0x57f9c6,journeysWithDetailsResult:_0x155b06,userMaps:_0x253ef3}=await withSpinner(_0x144808(0x1e1),async()=>{const _0x3d7cac=_0x144808,[_0x124fd5,_0x59fa18,_0x1eead2,_0x59fc3c,_0x4a8877]=await Promise[_0x3d7cac(0x209)]([_0x5c4431[_0x3d7cac(0x216)][_0x3d7cac(0x1df)](_0x264fc1),_0x5c4431['segment'][_0x3d7cac(0x1fc)](_0x264fc1),_0x5c4431[_0x3d7cac(0x216)][_0x3d7cac(0x202)](_0x264fc1),_0x5c4431[_0x3d7cac(0x1c4)]['listJourneysWithDetailsFromParentSegment'](_0x264fc1,{'includeAllVersions':!![]}),_0x5c4431[_0x3d7cac(0x22c)][_0x3d7cac(0x1ed)]()]);return{'parentSegmentResult':_0x124fd5,'segmentsResult':_0x59fa18,'foldersResult':_0x1eead2,'journeysWithDetailsResult':_0x59fc3c,'userMaps':_0x4a8877};},{'verbose':_0x469508['verbose']})[_0x144808(0x238)](_0xb0b2e4=>_0xb0b2e4[_0x144808(0x1b2)]),_0x435baa=_0xc305d6,_0x21950f=extractRootFolderId(_0x435baa),_0x29c75e=_0x2a9979,_0x236e02=_0x57f9c6,{journeys:_0x4a5015,activationStepsById:_0x30454d}=_0x155b06,_0x515f15=new Map(_0x4a5015[_0x144808(0x234)](_0x2c3de8=>[_0x2c3de8['id'],_0x2c3de8])),_0x3f1f1c=_0x4a5015['map'](_0x4b6879=>({'id':_0x4b6879['id'],'name':_0x4b6879['attributes']['name'],'journeyBundleName':_0x4b6879[_0x144808(0x207)][_0x144808(0x229)]||'','journeyBundleId':_0x4b6879[_0x144808(0x207)]['journeyBundleId']||'','versionNumber':_0x4b6879[_0x144808(0x207)][_0x144808(0x22a)],'description':_0x4b6879[_0x144808(0x207)]['description'],'state':_0x4b6879[_0x144808(0x207)][_0x144808(0x1c0)],'paused':_0x4b6879[_0x144808(0x207)][_0x144808(0x231)],'audienceId':_0x4b6879[_0x144808(0x207)][_0x144808(0x1f4)],'folderId':_0x4b6879['relationships']?.[_0x144808(0x23a)]?.[_0x144808(0x1b2)]?.['id'],'createdAt':_0x4b6879['attributes'][_0x144808(0x225)],'updatedAt':_0x4b6879[_0x144808(0x207)][_0x144808(0x227)]})),{emailToId:_0x3bd6f4,idToEmail:_0x49e3bf}=_0x253ef3,_0x5b1faa=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x292bf1=_0x144808,_0x4cd2de=await _0x5c4431[_0x292bf1(0x214)][_0x292bf1(0x1f6)]();return buildConnectionMaps(_0x4cd2de);},{'verbose':_0x469508[_0x144808(0x219)]})[_0x144808(0x238)](_0xedc400=>_0xedc400['data']),_0x3a33b3=_0x5b1faa['nameToId'],_0x7e06f9=_0x5b1faa['idToName'],_0x4b20ef=_0x5b1faa[_0x144808(0x1d8)],_0x119efc={'emailToIdMap':_0x3bd6f4,'connectionNameToIdMap':_0x3a33b3,'connectionNameToTypeMap':_0x4b20ef,'getSchema':_0x59cbf9=>_0x5c4431[_0x144808(0x214)][_0x144808(0x1c3)](_0x59cbf9)};let {pathToId:_0x23f319,idToPath:_0x256f45}=buildFolderMaps(_0x236e02);const _0x944acb=buildSegmentLookupMap(_0x29c75e,_0x256f45),_0x5c20c8=buildSegmentNameToIdMap(_0x29c75e),_0x3dde10=buildJourneyBundleLookupMap(_0x3f1f1c,_0x256f45);let _0x4bdbf9;if(_0x5f027c){if(!_0x5f027c['endsWith'](_0x144808(0x215))&&!_0x5f027c[_0x144808(0x203)](_0x144808(0x1bd)))return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1ca)+_0x5f027c+'\x0a')),0x1;_0x4bdbf9=[_0x5f027c];}else _0x4bdbf9=findYamlFiles(_0x2df33b);if(_0x4bdbf9['length']===0x0)return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1cf)+_0x2df33b+'\x0a')),console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x210)](_0x144808(0x20c))),0x1;let _0x5e9883,_0x2a4686;try{const _0xdc56e6=parseAndClassifyYamlFiles(_0x4bdbf9,_0x2df33b,{'skipSegments':_0x469508[_0x144808(0x1d0)]});_0x5e9883=_0xdc56e6[_0x144808(0x1b1)],_0x2a4686=_0xdc56e6['journeys'];const _0x9b09a7=validateParsedFiles(_0xdc56e6,_0x2df33b);if(_0x9b09a7[_0x144808(0x1bf)]>0x0)return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1db))),console[_0x144808(0x1b9)](formatValidationErrors(_0x9b09a7)),console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x412b6e){return console['error'](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x235)+(_0x412b6e instanceof Error?_0x412b6e[_0x144808(0x226)]:_0x412b6e))),0x1;}if(_0x5e9883[_0x144808(0x1bf)]===0x0&&_0x2a4686[_0x144808(0x1bf)]===0x0){const _0x5e2907=_0x469508[_0x144808(0x1d0)]?_0x144808(0x1c4):_0x144808(0x223);return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)](_0x144808(0x1ce)+_0x5e2907+_0x144808(0x1d4))),0x0;}const _0x273936=new Map();_0x29c75e['length']>0x0&&!_0x469508[_0x144808(0x1d0)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x29c75e,async _0x22a28e=>{const _0x5b25df=a41_0x3235,_0x49df5d=await _0x5c4431[_0x5b25df(0x216)][_0x5b25df(0x1e3)](_0x264fc1,_0x22a28e['id']);_0x273936[_0x5b25df(0x211)](_0x22a28e['id'],_0x49df5d);});},{'verbose':_0x469508[_0x144808(0x219)]});const {segmentFiles:_0x340ed0,foldersToCreate:_0x226f7d}=await prepareSegmentFiles(_0x5e9883,{'segmentByFolderAndName':_0x944acb,'activationsBySegmentId':_0x273936,'folderPathToId':_0x23f319,'idToEmailMap':_0x49e3bf,'connectionIdToNameMap':_0x7e06f9},_0x119efc,_0x4d88b6,_0x4b6be3),_0x573fd6=_0x5f027c?[]:findSegmentsToDelete(_0x29c75e,_0x5e9883['map'](({yamlConfig:_0x35fc82,folderPath:_0x4bbfe5})=>({'yamlConfig':_0x35fc82,'folderPath':resolveTDFolderPath(_0x4bbfe5,_0x4d88b6,_0x4b6be3)})),_0x256f45,_0x4b6be3,_0x4d88b6),{journeyFiles:_0x3d479e,foldersToCreate:_0x29b433}=await withProgressSpinner(_0x144808(0x222),async _0x5fd03b=>prepareJourneyFiles(_0x2a4686,{'fetchJourney':async _0x5a7df6=>_0x5c4431[_0x144808(0x1c4)][_0x144808(0x1c9)](_0x5a7df6['journeyId']),'journeyBundlesByFolderAndName':_0x3dde10,'folderPathToId':_0x23f319,'idToEmailMap':_0x49e3bf,'connectionIdToNameMap':_0x7e06f9,'existingSegments':_0x29c75e,'parentId':_0x264fc1,'deps':_0x5c4431,'progress':{'update':_0x5957ae=>{const _0x53c1cb=_0x144808;_0x5fd03b[_0x53c1cb(0x1e7)](_0x5957ae),_0x469508[_0x53c1cb(0x219)]&&console[_0x53c1cb(0x1b9)]('\x20\x20'+_0x5957ae);}},'journeyById':_0x515f15,'activationStepsById':_0x30454d},_0x4d88b6,_0x4b6be3),{'verbose':_0x469508[_0x144808(0x219)]})[_0x144808(0x238)](_0x5e7205=>_0x5e7205[_0x144808(0x1b2)]);for(const _0x483cb3 of _0x29b433){_0x226f7d[_0x144808(0x1ec)](_0x483cb3);}const _0x649983=_0x5f027c?[]:findJourneysToDelete(_0x3f1f1c,_0x2a4686[_0x144808(0x234)](({yamlConfig:_0xa81275,folderPath:_0x302c28})=>({'yamlConfig':_0xa81275,'folderPath':resolveTDFolderPath(_0x302c28,_0x4d88b6,_0x4b6be3)})),_0x256f45,_0x4b6be3,_0x4d88b6),_0x1b2efd=calculatePushStats(_0x340ed0,_0x3d479e,_0x226f7d,_0x573fd6,_0x649983,!!_0x469508[_0x144808(0x236)],!!_0x469508['journeysOnly']),_0x1be47c=_0x1b2efd['segments']['new'],_0x4d6736=_0x1b2efd['segments'][_0x144808(0x208)],_0x156988=_0x1b2efd[_0x144808(0x1b1)]['unchanged'],_0x4bc49e=_0x1b2efd[_0x144808(0x1b1)]['toDelete'],_0x3f3ec3=_0x1b2efd[_0x144808(0x1b3)][_0x144808(0x1a4)],_0x5144ff=_0x1b2efd[_0x144808(0x244)]['new'],_0x5aa412=_0x1b2efd[_0x144808(0x244)][_0x144808(0x208)],_0x247e6f=_0x1b2efd['journeys'][_0x144808(0x228)],_0x3c83d3=_0x1b2efd[_0x144808(0x244)][_0x144808(0x240)],_0x992d89=_0x1b2efd[_0x144808(0x242)][_0x144808(0x209)],_0x1c337e=_0x1b2efd['activations'][_0x144808(0x1a4)],_0x22668a=_0x1b2efd[_0x144808(0x242)][_0x144808(0x1da)],_0x495c97=_0x1b2efd[_0x144808(0x242)]['toDelete'];console[_0x144808(0x1b9)](_0x144808(0x1e5)+_0x5884fe+'\x27:');_0x3f3ec3[_0x144808(0x1bf)]>0x0&&console[_0x144808(0x1b9)]('\x20\x20'+a41_0x4b7560[_0x144808(0x243)](_0x144808(0x212)+_0x3f3ec3[_0x144808(0x1bf)]+_0x144808(0x213)));if(!_0x469508['journeysOnly']){console[_0x144808(0x1b9)]('\x20\x20📊\x20Segments:'),console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x1d5)]('+\x20'+_0x1be47c['length']+_0x144808(0x1de))),console[_0x144808(0x1b9)]('\x20\x20\x20\x20'+a41_0x4b7560[_0x144808(0x1e9)]('~\x20'+_0x4d6736[_0x144808(0x1bf)]+'\x20changed'));if(_0x4bc49e[_0x144808(0x1bf)]>0x0)console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x23c)]('-\x20'+_0x4bc49e['length']+_0x144808(0x1d2)));else _0x573fd6[_0x144808(0x1bf)]>0x0&&!_0x469508['delete']&&console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x232)](_0x573fd6['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x232)]('=\x20'+_0x156988[_0x144808(0x1bf)]+_0x144808(0x1b5)));}if(_0x3d479e[_0x144808(0x1bf)]>0x0||_0x649983['length']>0x0){console[_0x144808(0x1b9)](_0x144808(0x1c8)),console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560['green']('+\x20'+_0x5144ff[_0x144808(0x1bf)]+_0x144808(0x1de))),console['error'](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x1e9)]('~\x20'+_0x5aa412[_0x144808(0x1bf)]+_0x144808(0x1f3)));if(_0x3c83d3[_0x144808(0x1bf)]>0x0)console[_0x144808(0x1b9)]('\x20\x20\x20\x20'+a41_0x4b7560[_0x144808(0x23c)]('-\x20'+_0x3c83d3[_0x144808(0x1bf)]+_0x144808(0x1d2)));else _0x649983[_0x144808(0x1bf)]>0x0&&!_0x469508[_0x144808(0x236)]&&console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x232)](_0x649983['length']+_0x144808(0x230)));console['error']('\x20\x20\x20\x20'+a41_0x4b7560[_0x144808(0x232)]('=\x20'+_0x247e6f[_0x144808(0x1bf)]+_0x144808(0x1b5)));}_0x992d89[_0x144808(0x1bf)]>0x0&&!_0x469508[_0x144808(0x1d0)]&&(console['error'](''),console['error']('\x20\x20Activations:'),_0x1c337e['length']>0x0&&console['error'](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x1d5)]('+\x20'+_0x1c337e[_0x144808(0x1bf)]+_0x144808(0x1c6))),_0x22668a[_0x144808(0x1bf)]>0x0&&console['error'](_0x144808(0x1f5)+a41_0x4b7560['yellow']('~\x20'+_0x22668a[_0x144808(0x1bf)]+_0x144808(0x1be))),_0x495c97[_0x144808(0x1bf)]>0x0&&console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x23c)]('-\x20'+_0x495c97[_0x144808(0x1bf)]+_0x144808(0x1d2))));console['error'](_0x144808(0x23b)+a41_0x4b7560[_0x144808(0x210)](_0x2df33b)+'\x0a');if(_0x3f3ec3[_0x144808(0x1bf)]>0x0){console[_0x144808(0x1b9)]('Folders\x20to\x20create:');for(const _0x2efc21 of _0x3f3ec3){console[_0x144808(0x1b9)]('\x20\x20'+a41_0x4b7560[_0x144808(0x243)]('+')+'\x20'+_0x2efc21);}console['error']('');}if(_0x1be47c['length']>0x0&&!_0x469508['journeysOnly'])for(const _0x324fe5 of _0x1be47c){const _0x3b9d4d=_0x324fe5[_0x144808(0x1c2)]?_0x324fe5['folderPath']+'/'+_0x324fe5['yamlConfig'][_0x144808(0x1d1)]:_0x324fe5[_0x144808(0x1a5)]['name'],_0x3696f7=_0x324fe5[_0x144808(0x1a5)][_0x144808(0x242)]?.['length']||0x0,_0x1fbe44=_0x3696f7>0x0?a41_0x4b7560[_0x144808(0x232)]('\x20['+_0x3696f7+_0x144808(0x1f1)):'';console['error']('\x0a'+a41_0x4b7560[_0x144808(0x1d5)](_0x144808(0x241))+'\x20'+_0x3b9d4d+_0x1fbe44),console['error']('─'[_0x144808(0x22e)](0x3c)),_0x324fe5['diff']&&console[_0x144808(0x1b9)](_0x324fe5['diff']),console['error']('─'[_0x144808(0x22e)](0x3c));}if(_0x4bc49e['length']>0x0&&!_0x469508[_0x144808(0x1d0)])for(const _0x273f73 of _0x4bc49e){const _0x4e3536=_0x273f73[_0x144808(0x1fe)]?_0x256f45[_0x144808(0x21c)](_0x273f73[_0x144808(0x1fe)][_0x144808(0x201)]())||'':'',_0x52c258=_0x4e3536?_0x4e3536+'/'+_0x273f73[_0x144808(0x1d1)]:_0x273f73['name'],_0x5cbfa6=_0x273936[_0x144808(0x21c)](_0x273f73['id'])||[],_0x1256e9=_0x5cbfa6[_0x144808(0x1bf)]>0x0?a41_0x4b7560[_0x144808(0x232)]('\x20['+_0x5cbfa6[_0x144808(0x1bf)]+_0x144808(0x1f1)):'';console[_0x144808(0x1b9)]('\x0a'+a41_0x4b7560[_0x144808(0x23c)]('Delete\x20segment:')+'\x20'+_0x52c258+_0x1256e9),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c));const _0x2ba42=segmentWithActivationsToYaml(_0x273f73,_0x5cbfa6,undefined,_0x49e3bf,_0x7e06f9),_0x35a955=segmentToYamlString(_0x2ba42),_0x3bb2f8=generateDiff(_0x35a955,'');console['error'](formatDiffWithColors(_0x3bb2f8)),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c));}const _0x3f9090=_0x340ed0[_0x144808(0x1ea)](_0x132677=>!_0x132677['isNew']&&_0x132677['diff']);if(_0x3f9090[_0x144808(0x1bf)]>0x0&&!_0x469508[_0x144808(0x1d0)])for(const _0x1b8ef5 of _0x3f9090){const _0x517609=_0x1b8ef5[_0x144808(0x1c2)]?_0x1b8ef5['folderPath']+'/'+_0x1b8ef5[_0x144808(0x1a5)][_0x144808(0x1d1)]:_0x1b8ef5[_0x144808(0x1a5)][_0x144808(0x1d1)];console[_0x144808(0x1b9)]('\x0a'+a41_0x4b7560[_0x144808(0x1e9)](_0x144808(0x21f))+'\x20'+_0x517609),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c)),console[_0x144808(0x1b9)](_0x1b8ef5[_0x144808(0x233)]),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c));}if(_0x5144ff[_0x144808(0x1bf)]>0x0)for(const _0x2eb8da of _0x5144ff){const _0x1b30ad=_0x2eb8da[_0x144808(0x1c2)]?_0x2eb8da[_0x144808(0x1c2)]+'/'+_0x2eb8da['yamlConfig']['name']:_0x2eb8da['yamlConfig']['name'];console['error']('\x0a'+a41_0x4b7560[_0x144808(0x1d5)](_0x144808(0x1dc))+'\x20'+_0x1b30ad),console[_0x144808(0x1b9)]('─'['repeat'](0x3c)),_0x2eb8da['diff']&&console['error'](_0x2eb8da[_0x144808(0x233)]),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c));}const _0xc32dcf=_0x3d479e['filter'](_0x5e6e72=>!_0x5e6e72['isNew']&&_0x5e6e72['diff']);if(_0xc32dcf[_0x144808(0x1bf)]>0x0)for(const _0x31f793 of _0xc32dcf){const _0x2d277a=_0x31f793[_0x144808(0x1c2)]?_0x31f793[_0x144808(0x1c2)]+'/'+_0x31f793['yamlConfig'][_0x144808(0x1d1)]:_0x31f793[_0x144808(0x1a5)][_0x144808(0x1d1)];console[_0x144808(0x1b9)]('\x0a'+a41_0x4b7560['yellow'](_0x144808(0x20d))+'\x20'+_0x2d277a),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c)),console[_0x144808(0x1b9)](_0x31f793[_0x144808(0x233)]),console['error']('─'[_0x144808(0x22e)](0x3c));}if(_0x3c83d3[_0x144808(0x1bf)]>0x0)for(const _0x34532c of _0x3c83d3){const _0x1ef5e9=_0x34532c[_0x144808(0x1ff)]?_0x256f45[_0x144808(0x21c)](_0x34532c[_0x144808(0x1ff)])||'':'',_0x2eb171=_0x1ef5e9?_0x1ef5e9+'/'+_0x34532c[_0x144808(0x229)]:_0x34532c[_0x144808(0x229)];console[_0x144808(0x1b9)]('\x0a'+a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1e2))+'\x20'+_0x2eb171),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c)),console['error'](a41_0x4b7560['red'](_0x144808(0x1e0))),console['error']('─'['repeat'](0x3c));}if(_0x469508[_0x144808(0x1a3)])return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x3cabb3=_0x469508['journeysOnly']?![]:_0x1be47c[_0x144808(0x1bf)]>0x0||_0x4d6736[_0x144808(0x1bf)]>0x0||_0x4bc49e['length']>0x0,_0x509b75=_0x5144ff[_0x144808(0x1bf)]>0x0||_0x5aa412[_0x144808(0x1bf)]>0x0||_0x3c83d3[_0x144808(0x1bf)]>0x0,_0x20c356=_0x469508[_0x144808(0x1d0)]?![]:_0x992d89[_0x144808(0x1bf)]>0x0,_0x4d5a4e=_0x3f3ec3[_0x144808(0x1bf)]>0x0;if(!_0x3cabb3&&!_0x509b75&&!_0x20c356&&!_0x4d5a4e){const _0x1dff4c=_0x469508[_0x144808(0x1d0)]?_0x144808(0x21a):_0x144808(0x1ab);console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1d5)](_0x1dff4c));if(_0x5f027c&&_0x156988['length']===0x1){const _0x3c88b5=_0x156988[0x0];if(_0x3c88b5['existingSegment']?.['id']){const _0x2716ed=getConsoleNextUrl(_0x469508[_0x144808(0x245)],_0x144808(0x1e8)+_0x264fc1+_0x144808(0x1a7)+_0x3c88b5[_0x144808(0x1f7)]['id']+_0x144808(0x1f0));console[_0x144808(0x1b9)](_0x144808(0x1d9)+a41_0x4b7560[_0x144808(0x210)](_0x2716ed));}}if(_0x5f027c&&_0x247e6f[_0x144808(0x1bf)]===0x1){const _0xbb7903=_0x247e6f[0x0];if(_0xbb7903[_0x144808(0x23e)]?.['id']){const _0x5eda8a=getConsoleNextUrl(_0x469508[_0x144808(0x245)],_0x144808(0x1e8)+_0x264fc1+_0x144808(0x1a7)+_0xbb7903[_0x144808(0x23e)]['id']+_0x144808(0x221));console['error']('\x20\x20'+a41_0x4b7560[_0x144808(0x210)](_0x5eda8a));}}return 0x0;}const _0x539ce6=_0x469508['journeysOnly']?_0x5144ff[_0x144808(0x1bf)]+_0x5aa412[_0x144808(0x1bf)]+_0x3c83d3[_0x144808(0x1bf)]+_0x3f3ec3[_0x144808(0x1bf)]:_0x1be47c[_0x144808(0x1bf)]+_0x4d6736[_0x144808(0x1bf)]+_0x4bc49e['length']+_0x5144ff[_0x144808(0x1bf)]+_0x5aa412[_0x144808(0x1bf)]+_0x3c83d3[_0x144808(0x1bf)]+_0x3f3ec3[_0x144808(0x1bf)]+_0x992d89[_0x144808(0x1bf)];if(!_0x469508[_0x144808(0x1b8)]&&_0x539ce6>0x0){if(!isInteractive())return console['error'](a41_0x4b7560['red'](_0x144808(0x1bc)),_0x144808(0x23d)),console[_0x144808(0x1b9)](a41_0x4b7560['dim'](_0x144808(0x206))),0x1;const _0x1b9c60=await confirmKey(_0x144808(0x1fd)+_0x539ce6+_0x144808(0x20e));if(!_0x1b9c60)return console['error'](a41_0x4b7560[_0x144808(0x1e9)](_0x144808(0x1c1))),0x1;}const _0x949536={'withProgress':async(_0xd54edd,_0x1cb92f)=>{const _0x27367b=_0x144808,_0x5837ad=await withSpinner(_0xd54edd,_0x1cb92f,{'verbose':_0x469508[_0x27367b(0x219)]});return{'data':_0x5837ad['data']};},'logInfo':_0x280074=>console[_0x144808(0x1b9)](a41_0x4b7560['blue']('✔\x20'+_0x280074)),'logSuccess':_0x463d24=>console[_0x144808(0x1b9)](a41_0x4b7560['green']('✔\x20'+_0x463d24)),'logWarning':_0x595a30=>console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)]('⚠\x20'+_0x595a30)),'logDeleted':_0x3c4c58=>console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)]('✔\x20'+_0x3c4c58))},_0x105ecb={'segment':_0x5c4431['segment'],'journey':_0x5c4431[_0x144808(0x1c4)],'user':_0x5c4431[_0x144808(0x22c)],'connection':_0x5c4431[_0x144808(0x214)]};_0x3f3ec3[_0x144808(0x1bf)]>0x0&&(_0x23f319=await executePushFolders(_0x105ecb,_0x3f3ec3,_0x23f319,{'parentId':_0x264fc1},_0x949536));const _0x3366d5={'rootFolderId':_0x21950f,'folderPathToId':_0x23f319,'folderIdToPath':_0x256f45,'segmentNameToId':_0x5c20c8,'activationsBySegmentId':_0x273936,'emailToIdMap':_0x3bd6f4,'idToEmailMap':_0x49e3bf,'connectionNameToIdMap':_0x5b1faa[_0x144808(0x1d3)],'connectionIdToNameMap':_0x5b1faa[_0x144808(0x21b)],'connectionNameToTypeMap':_0x4b20ef},_0x5b239e=await executePushSegments(_0x105ecb,_0x469508['journeysOnly']?[]:_0x340ed0,_0x3366d5,{'parentId':_0x264fc1},_0x949536),_0x296be5=_0x5b239e[_0x144808(0x1ef)],_0x80fb31=_0x5b239e[_0x144808(0x1b6)],_0x5b1325=_0x5b239e[_0x144808(0x242)][_0x144808(0x1ef)],_0x2dc384=_0x5b239e[_0x144808(0x242)][_0x144808(0x1b6)],_0x51bb9f=_0x5b239e[_0x144808(0x242)][_0x144808(0x200)];let _0xc30d24;if(_0x5f027c&&_0x340ed0[_0x144808(0x1bf)]===0x1){const _0x1628eb=_0x340ed0[0x0];_0xc30d24=_0x1628eb[_0x144808(0x1f7)]?.['id']??_0x5b239e[_0x144808(0x224)][_0x144808(0x21c)](_0x1628eb[_0x144808(0x1a5)][_0x144808(0x1d1)]);}const _0x4c8045=await executePushSegmentDeletions(_0x105ecb,_0x469508[_0x144808(0x1d0)]?[]:_0x4bc49e,_0x949536);let _0x506be7=0x0,_0x2eed54=0x0,_0x54f69d=0x0;const _0x583eef=new Map(_0x5c20c8);for(const [_0x404fbd,_0x40f5e0]of _0x5b239e[_0x144808(0x224)]){_0x583eef[_0x144808(0x211)](_0x404fbd,_0x40f5e0);}if(_0x3d479e[_0x144808(0x1bf)]>0x0){const _0x458b1d={..._0x3366d5,'segmentNameToId':_0x583eef,'existingSegments':_0x29c75e,'activationContext':_0x119efc},_0x29ad9b=await executePushJourneys(_0x105ecb,_0x3d479e,_0x458b1d,{'parentId':_0x264fc1,'rootFolderId':_0x21950f,'verbose':_0x469508[_0x144808(0x219)]},_0x949536);_0x506be7=_0x29ad9b[_0x144808(0x1ef)],_0x2eed54=_0x29ad9b[_0x144808(0x1b6)];if(_0x5f027c&&_0x29ad9b[_0x144808(0x1e6)][_0x144808(0x1bf)]===0x1){const _0x548e71=_0x29ad9b['results'][0x0];if(_0x548e71['journeyId']){const _0x2a5cea=getConsoleNextUrl(_0x469508['site'],_0x144808(0x1e8)+_0x264fc1+_0x144808(0x1a7)+_0x548e71[_0x144808(0x20f)]+_0x144808(0x221));console['error']('\x20\x20'+a41_0x4b7560[_0x144808(0x210)](_0x2a5cea));}}}for(const _0x134a4a of _0x3c83d3){console['error'](a41_0x4b7560[_0x144808(0x1e9)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x134a4a[_0x144808(0x229)])),_0x54f69d++;}const _0x111fac=[];if(_0x296be5>0x0)_0x111fac['push'](_0x296be5+_0x144808(0x1f8));if(_0x80fb31>0x0)_0x111fac[_0x144808(0x218)](_0x80fb31+_0x144808(0x217));if(_0x4c8045>0x0)_0x111fac[_0x144808(0x218)](_0x4c8045+_0x144808(0x239));const _0x3d08c6=[];if(_0x506be7>0x0)_0x3d08c6[_0x144808(0x218)](_0x506be7+_0x144808(0x1f8));if(_0x2eed54>0x0)_0x3d08c6['push'](_0x2eed54+_0x144808(0x217));if(_0x54f69d>0x0)_0x3d08c6['push'](_0x54f69d+_0x144808(0x239));const _0x43b77e=[];if(_0x5b1325>0x0)_0x43b77e[_0x144808(0x218)](_0x5b1325+'\x20created');if(_0x2dc384>0x0)_0x43b77e[_0x144808(0x218)](_0x2dc384+'\x20updated');if(_0x51bb9f>0x0)_0x43b77e[_0x144808(0x218)](_0x51bb9f+_0x144808(0x239));console['error'](a41_0x4b7560['green'](_0x144808(0x205)));_0x111fac['length']>0x0&&!_0x469508[_0x144808(0x1d0)]&&console['error'](_0x144808(0x1dd)+_0x111fac[_0x144808(0x22d)](',\x20'));_0x3d08c6[_0x144808(0x1bf)]>0x0&&console[_0x144808(0x1b9)](_0x144808(0x1fb)+_0x3d08c6['join'](',\x20'));_0x43b77e[_0x144808(0x1bf)]>0x0&&!_0x469508[_0x144808(0x1d0)]&&console['error'](_0x144808(0x1a6)+_0x43b77e[_0x144808(0x22d)](',\x20'));if(_0xc30d24){const _0x5c80f5=getConsoleNextUrl(_0x469508[_0x144808(0x245)],_0x144808(0x1e8)+_0x264fc1+_0x144808(0x1a7)+_0xc30d24+_0x144808(0x1f0));console[_0x144808(0x1b9)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x4b7560[_0x144808(0x210)](_0x5c80f5));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x438ec5=a42_0x2238;(function(_0x568438,_0x569d65){const _0x2026c3=a42_0x2238,_0x56f6fb=_0x568438();while(!![]){try{const _0x1f0d7d=-parseInt(_0x2026c3(0x1cd))/0x1+parseInt(_0x2026c3(0x1d6))/0x2+parseInt(_0x2026c3(0x1de))/0x3+parseInt(_0x2026c3(0x1dc))/0x4*(parseInt(_0x2026c3(0x1ed))/0x5)+-parseInt(_0x2026c3(0x1e2))/0x6*(parseInt(_0x2026c3(0x1d4))/0x7)+parseInt(_0x2026c3(0x1db))/0x8+parseInt(_0x2026c3(0x1ec))/0x9;if(_0x1f0d7d===_0x569d65)break;else _0x56f6fb['push'](_0x56f6fb['shift']());}catch(_0x1ea9a9){_0x56f6fb['push'](_0x56f6fb['shift']());}}}(a42_0x5359,0x37d0f));import{BaseCommand}from'./command.js';function a42_0x5359(){const _0x1d8222=['length','segment','folder','383490gRcHjl','Updating\x20segment\x20\x27','data','segmentName','ruleFile','name','parentId','\x27...','description','segment:update','1115307IuWaGG','45495hFmFXz','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','rule','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','updateSegmentById','Segment\x20ID:\x20','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentId','segmentPath','Resolving\x20path\x20\x27','223018vvTsfq','Examples:','kind','includes','yellow','✔\x20Updated\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','35IWMmlj','Update\x20existing\x20child\x20segment','562984sifaUe','type','error','verbose','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','1440480foTgTr','64ITfMCA','Resolved\x20folder\x20ID:\x20','120471GYlvPn'];a42_0x5359=function(){return _0x1d8222;};return a42_0x5359();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a42_0x2238(_0x5df1b3,_0x5dee8d){_0x5df1b3=_0x5df1b3-0x1ca;const _0x53592c=a42_0x5359();let _0x22386d=_0x53592c[_0x5df1b3];return _0x22386d;}import a42_0x3359d3 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x438ec5(0x1e7)]=a42_0x438ec5(0x1eb);[a42_0x438ec5(0x1ea)]=a42_0x438ec5(0x1d5);async['execute'](_0x24d347){const _0x45dec7=a42_0x438ec5;console['error'](a42_0x3359d3[_0x45dec7(0x1d1)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a42_0x3359d3['yellow'](_0x45dec7(0x1d3)));const {options:_0x299f17,args:_0x2fa068,tdx:_0x5e8023}=_0x24d347,_0x3b01cc=_0x299f17;if(_0x2fa068[_0x45dec7(0x1df)]===0x0)return console[_0x45dec7(0x1d8)](_0x45dec7(0x1f5)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1f1)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1ce)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1ee)),console['error'](_0x45dec7(0x1f9)),0x1;const _0x4219f5=_0x2fa068[0x0],_0x15d364=_0x299f17[_0x45dec7(0x1cb)];let _0x4e6088=_0x4219f5;_0x15d364&&!_0x4219f5[_0x45dec7(0x1d0)]('/')&&(_0x4e6088=_0x15d364+'/'+_0x4219f5,_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)](_0x45dec7(0x1f0)+_0x4e6088));const _0x499bd2=await withSpinner(_0x45dec7(0x1cc)+_0x4e6088+_0x45dec7(0x1e9),()=>_0x5e8023[_0x45dec7(0x1e0)][_0x45dec7(0x1ef)](_0x4e6088),{'verbose':_0x3b01cc[_0x45dec7(0x1d9)]}),_0x1c7707=_0x499bd2[_0x45dec7(0x1e4)];_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)]('Resolved\x20type:\x20'+_0x1c7707[_0x45dec7(0x1d7)]);if(_0x1c7707[_0x45dec7(0x1d7)]!==_0x45dec7(0x1e0))return console[_0x45dec7(0x1d8)]('Error:\x20Cannot\x20update\x20'+_0x1c7707[_0x45dec7(0x1d7)]+_0x45dec7(0x1da)),console[_0x45dec7(0x1d8)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x1c7707[_0x45dec7(0x1ca)])throw new SDKError(ErrorCode[_0x45dec7(0x1f8)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5ac470=_0x1c7707[_0x45dec7(0x1e8)],_0xcbe376=_0x1c7707[_0x45dec7(0x1ca)];_0x3b01cc[_0x45dec7(0x1d9)]&&(console[_0x45dec7(0x1d8)](_0x45dec7(0x1f3)+_0x5ac470),console['error'](_0x45dec7(0x1f7)+_0xcbe376));let _0x1a795e;if(_0x3b01cc['folder']){const _0x82f74e=_0x3b01cc[_0x45dec7(0x1e1)],_0x2e73fb=await withSpinner(_0x45dec7(0x1f2)+_0x82f74e+_0x45dec7(0x1e9),()=>_0x5e8023[_0x45dec7(0x1e0)]['resolveFolderId'](_0x5ac470,_0x82f74e),{'verbose':_0x3b01cc['verbose']});_0x1a795e=parseInt(_0x2e73fb[_0x45dec7(0x1e4)],0xa),_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)](_0x45dec7(0x1dd)+_0x1a795e);}const _0x4d98b7=await loadJSONFromOptions(_0x3b01cc[_0x45dec7(0x1f4)],_0x3b01cc[_0x45dec7(0x1e6)]),_0x2846e0={'name':_0x3b01cc[_0x45dec7(0x1e7)],'description':_0x3b01cc[_0x45dec7(0x1ea)],'rule':_0x4d98b7,'kind':_0x3b01cc['kind']!==undefined?parseInt(_0x3b01cc[_0x45dec7(0x1cf)],0xa):undefined,'segmentFolderId':_0x1a795e},_0x42fd8a=await withSpinner(_0x45dec7(0x1e3)+_0x1c7707[_0x45dec7(0x1e5)]+'\x27...',()=>_0x5e8023[_0x45dec7(0x1e0)][_0x45dec7(0x1f6)](_0x5ac470,_0xcbe376,_0x2846e0),{'verbose':_0x3b01cc['verbose']}),_0x30fa8d=_0x42fd8a[_0x45dec7(0x1e4)];return console[_0x45dec7(0x1d8)](_0x45dec7(0x1d2)+_0x30fa8d[_0x45dec7(0x1e7)]+'\x27'),_0x4e6088!==_0x4219f5&&console[_0x45dec7(0x1d8)]('\x20\x20\x20Path:\x20'+_0x4e6088),await handleSDKOutput([_0x30fa8d],_0x3b01cc),0x0;}}
1
+ function a42_0x10a8(_0xb651ad,_0x36dcdd){_0xb651ad=_0xb651ad-0x1b6;const _0x55e3f2=a42_0x55e3();let _0x10a832=_0x55e3f2[_0xb651ad];return _0x10a832;}const a42_0x1991b5=a42_0x10a8;(function(_0x1f21f5,_0x3d3481){const _0x315fd1=a42_0x10a8,_0x35b4f6=_0x1f21f5();while(!![]){try{const _0x2d1dcd=-parseInt(_0x315fd1(0x1db))/0x1+parseInt(_0x315fd1(0x1d2))/0x2*(-parseInt(_0x315fd1(0x1c4))/0x3)+parseInt(_0x315fd1(0x1be))/0x4*(parseInt(_0x315fd1(0x1e1))/0x5)+parseInt(_0x315fd1(0x1ca))/0x6*(-parseInt(_0x315fd1(0x1bc))/0x7)+-parseInt(_0x315fd1(0x1d3))/0x8+-parseInt(_0x315fd1(0x1d5))/0x9+-parseInt(_0x315fd1(0x1d4))/0xa*(-parseInt(_0x315fd1(0x1cf))/0xb);if(_0x2d1dcd===_0x3d3481)break;else _0x35b4f6['push'](_0x35b4f6['shift']());}catch(_0x360a6b){_0x35b4f6['push'](_0x35b4f6['shift']());}}}(a42_0x55e3,0x9a2b1));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a42_0x55e3(){const _0xbf17b8=['description','includes','segmentPath','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','length','1024191BgKEwR','folder','resolvePathToResource','Resolved\x20type:\x20','error','Resolving\x20path\x20\x27','3938905BBvAlV','Update\x20existing\x20child\x20segment','rule','type','\x27...','data','Resolved\x20folder\x20ID:\x20','yellow','Examples:','name','verbose','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:update','7BjbEBh','segmentId','4tdZfjH','execute','Segment\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','3YZLpGJ','✔\x20Updated\x20segment\x20\x27','Updating\x20segment\x20\x27','segment','kind','Resolving\x20folder\x20\x27','1002678JEuErK','Parent\x20ID:\x20','Error:\x20Cannot\x20update\x20','segmentName','Resolved\x20relative\x20path\x20to:\x20','220DXTMqE','resolveFolderId','parentId','760546aSgJRc','5511824PFrcwX','1494060chylnO','7954857wVfHVS'];a42_0x55e3=function(){return _0xbf17b8;};return a42_0x55e3();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x5cb2a8 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x1991b5(0x1b6)]=a42_0x1991b5(0x1bb);['description']=a42_0x1991b5(0x1e2);async[a42_0x1991b5(0x1bf)](_0x45072e){const _0x24958e=a42_0x1991b5;console[_0x24958e(0x1df)](a42_0x5cb2a8[_0x24958e(0x1e8)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x24958e(0x1df)](a42_0x5cb2a8[_0x24958e(0x1e8)](_0x24958e(0x1d9)));const {options:_0x15f896,args:_0x3eaca8,tdx:_0x674465}=_0x45072e,_0x179956=_0x15f896;if(_0x3eaca8[_0x24958e(0x1da)]===0x0)return console[_0x24958e(0x1df)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x24958e(0x1c2)),console[_0x24958e(0x1df)](_0x24958e(0x1e9)),console[_0x24958e(0x1df)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x24958e(0x1df)](_0x24958e(0x1b9)),0x1;const _0x3dbd9c=_0x3eaca8[0x0],_0xf9965d=_0x15f896[_0x24958e(0x1d8)];let _0x3e5ac2=_0x3dbd9c;_0xf9965d&&!_0x3dbd9c[_0x24958e(0x1d7)]('/')&&(_0x3e5ac2=_0xf9965d+'/'+_0x3dbd9c,_0x179956[_0x24958e(0x1b7)]&&console['error'](_0x24958e(0x1ce)+_0x3e5ac2));const _0x5e67ea=await withSpinner(_0x24958e(0x1e0)+_0x3e5ac2+_0x24958e(0x1e5),()=>_0x674465[_0x24958e(0x1c7)][_0x24958e(0x1dd)](_0x3e5ac2),{'verbose':_0x179956[_0x24958e(0x1b7)]}),_0x156756=_0x5e67ea[_0x24958e(0x1e6)];_0x179956[_0x24958e(0x1b7)]&&console[_0x24958e(0x1df)](_0x24958e(0x1de)+_0x156756[_0x24958e(0x1e4)]);if(_0x156756[_0x24958e(0x1e4)]!==_0x24958e(0x1c7))return console['error'](_0x24958e(0x1cc)+_0x156756['type']+_0x24958e(0x1c3)),console[_0x24958e(0x1df)](_0x24958e(0x1c1)),0x1;if(!_0x156756['segmentId'])throw new SDKError(ErrorCode[_0x24958e(0x1b8)],_0x24958e(0x1ba));const _0x41a1c6=_0x156756[_0x24958e(0x1d1)],_0x54bbed=_0x156756[_0x24958e(0x1bd)];_0x179956['verbose']&&(console[_0x24958e(0x1df)](_0x24958e(0x1cb)+_0x41a1c6),console[_0x24958e(0x1df)](_0x24958e(0x1c0)+_0x54bbed));let _0x13f904;if(_0x179956['folder']){const _0x1cf34a=_0x179956[_0x24958e(0x1dc)],_0x426875=await withSpinner(_0x24958e(0x1c9)+_0x1cf34a+_0x24958e(0x1e5),()=>_0x674465[_0x24958e(0x1c7)][_0x24958e(0x1d0)](_0x41a1c6,_0x1cf34a),{'verbose':_0x179956[_0x24958e(0x1b7)]});_0x13f904=parseInt(_0x426875[_0x24958e(0x1e6)],0xa),_0x179956['verbose']&&console[_0x24958e(0x1df)](_0x24958e(0x1e7)+_0x13f904);}const _0x2961ee=await loadJSONFromOptions(_0x179956[_0x24958e(0x1e3)],_0x179956['ruleFile']),_0x4b0f2d={'name':_0x179956[_0x24958e(0x1b6)],'description':_0x179956[_0x24958e(0x1d6)],'rule':_0x2961ee,'kind':_0x179956[_0x24958e(0x1c8)]!==undefined?parseInt(_0x179956['kind'],0xa):undefined,'segmentFolderId':_0x13f904},_0x45b0ea=await withSpinner(_0x24958e(0x1c6)+_0x156756[_0x24958e(0x1cd)]+_0x24958e(0x1e5),()=>_0x674465[_0x24958e(0x1c7)]['updateSegmentById'](_0x41a1c6,_0x54bbed,_0x4b0f2d),{'verbose':_0x179956[_0x24958e(0x1b7)]}),_0x5ae55a=_0x45b0ea[_0x24958e(0x1e6)];return console[_0x24958e(0x1df)](_0x24958e(0x1c5)+_0x5ae55a[_0x24958e(0x1b6)]+'\x27'),_0x3e5ac2!==_0x3dbd9c&&console[_0x24958e(0x1df)]('\x20\x20\x20Path:\x20'+_0x3e5ac2),await handleSDKOutput([_0x5ae55a],_0x179956),0x0;}}
@@ -1 +1 @@
1
- const a43_0x1e5fe8=a43_0xc216;function a43_0xc216(_0x6d523d,_0x51f4c2){_0x6d523d=_0x6d523d-0x1b5;const _0x46c7b6=a43_0x46c7();let _0xc216cc=_0x46c7b6[_0x6d523d];return _0xc216cc;}(function(_0x4b7eb1,_0x15613a){const _0x4a6147=a43_0xc216,_0x373a41=_0x4b7eb1();while(!![]){try{const _0x37cbcc=parseInt(_0x4a6147(0x1c1))/0x1*(parseInt(_0x4a6147(0x1d7))/0x2)+parseInt(_0x4a6147(0x1ce))/0x3*(-parseInt(_0x4a6147(0x1b5))/0x4)+parseInt(_0x4a6147(0x1ed))/0x5+-parseInt(_0x4a6147(0x1e8))/0x6*(-parseInt(_0x4a6147(0x1b9))/0x7)+parseInt(_0x4a6147(0x1c7))/0x8+parseInt(_0x4a6147(0x1cb))/0x9*(parseInt(_0x4a6147(0x1eb))/0xa)+-parseInt(_0x4a6147(0x1ec))/0xb*(parseInt(_0x4a6147(0x1c4))/0xc);if(_0x37cbcc===_0x15613a)break;else _0x373a41['push'](_0x373a41['shift']());}catch(_0x5b260a){_0x373a41['push'](_0x373a41['shift']());}}}(a43_0x46c7,0x9f545));import{existsSync,statSync}from'fs';import a43_0x2f55a6 from'chalk';function a43_0x46c7(){const _0x12ffec=['Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Target\x20path:\x20','106776tVjWrO','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','slice','3479480ZUUxBV','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','109773SfiDCI','parentName','Usage:\x20tdx\x20segment\x20use\x20<path>','31599SshwSG','type','segment','session','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','segmentPath','dim','execute','10214KjdyRF','log','cyan','segment:use','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','join','fullPath','isAbsolute','folderId','green','description','split','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','error','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Site:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','1333842YstPfE','segments','isDirectory','910FmCPKc','3124olxrKc','1701610DItbpO','folderPath','length','Folder\x20ID:\x20','config','Resolved\x20path\x20type:\x20','Resolved\x20relative\x20path\x20to:\x20','68DsrwiI','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','name','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','7pyIfob','red','parentId','resolvePathToResource','Examples:','Error:\x20Path\x20is\x20required\x0a','verbose','Resolving\x20path\x20\x27','245lcZsLq'];a43_0x46c7=function(){return _0x12ffec;};return a43_0x46c7();}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{[a43_0x1e5fe8(0x1b7)]=a43_0x1e5fe8(0x1da);[a43_0x1e5fe8(0x1e1)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x1e5fe8(0x1d6)](_0x189a4c){const _0x3f98f2=a43_0x1e5fe8,{options:_0x1867e9,args:_0x1cbecc,tdx:_0x33704a}=_0x189a4c;if(_0x1cbecc['length']===0x0)return console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1ba)](_0x3f98f2(0x1be))),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1cd)),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1bd)),console['error'](_0x3f98f2(0x1ca)),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1d2)),console['error'](_0x3f98f2(0x1c5)),console['error'](_0x3f98f2(0x1d3)),0x1;const _0x117fba=_0x1cbecc[0x0],_0x1cd632=_0x1867e9[_0x3f98f2(0x1d1)];try{if(_0x117fba==='/')return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6['green'](_0x3f98f2(0x1e7))),0x0;if(existsSync(_0x117fba)&&statSync(_0x117fba)[_0x3f98f2(0x1ea)]()){let _0x11c2a7;try{_0x11c2a7=findTdxConfig(_0x117fba);}catch{return console['error'](a43_0x2f55a6[_0x3f98f2(0x1ba)](_0x3f98f2(0x1db)+_0x117fba)),console['error'](a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x3f98f2(0x1b8))),0x1;}const _0x217199=_0x11c2a7[_0x3f98f2(0x1f1)]['parent_segment'];return saveSessionContext({'segment_path':_0x217199,'parent_segment':_0x217199},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6['green'](_0x3f98f2(0x1c9)+a43_0x2f55a6['cyan'](_0x217199))),0x0;}const _0x1a8431=_0x1867e9[_0x3f98f2(0x1d4)];let _0x2ec79d=_0x117fba;const _0x2f706b=parsePath(_0x117fba);if(!_0x2f706b[_0x3f98f2(0x1de)]){if(!_0x1a8431)return console['error'](a43_0x2f55a6['red'](_0x3f98f2(0x1b6))),console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x3f98f2(0x1e5))),0x1;if(_0x117fba==='..'){const _0x5b7c38=_0x1a8431[_0x3f98f2(0x1e2)]('/')[_0x3f98f2(0x1c6)](0x0,-0x1)[_0x3f98f2(0x1dc)]('/');_0x2ec79d=_0x5b7c38||'/';}else _0x117fba==='.'?_0x2ec79d=_0x1a8431:_0x2ec79d=_0x1a8431+'/'+_0x117fba;_0x1867e9['verbose']&&console['error'](_0x3f98f2(0x1f3)+_0x2ec79d);}if(_0x2ec79d==='/'||_0x2ec79d==='')return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1e7))),0x0;_0x2ec79d=normalizePath(_0x2ec79d);const _0x242dcf=parsePath(_0x2ec79d)[_0x3f98f2(0x1e9)];if(_0x242dcf[_0x3f98f2(0x1ef)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1e7))),0x0;_0x1867e9[_0x3f98f2(0x1bf)]&&(console['error'](_0x3f98f2(0x1e6)+_0x1867e9['site']),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1c3)+_0x2ec79d));const _0x39e575=await withSpinner(_0x3f98f2(0x1c0)+_0x2ec79d+'\x27...',()=>_0x33704a[_0x3f98f2(0x1d0)][_0x3f98f2(0x1bc)](_0x2ec79d),{'verbose':_0x1867e9[_0x3f98f2(0x1bf)]}),_0x1e387e=_0x39e575['data'];_0x1867e9[_0x3f98f2(0x1bf)]&&(console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1f2)+_0x1e387e[_0x3f98f2(0x1cf)]),console[_0x3f98f2(0x1e4)]('Parent\x20ID:\x20'+_0x1e387e[_0x3f98f2(0x1bb)]),_0x1e387e[_0x3f98f2(0x1df)]&&console['error'](_0x3f98f2(0x1f0)+_0x1e387e[_0x3f98f2(0x1df)]));if(_0x1e387e[_0x3f98f2(0x1cf)]==='segment')return console[_0x3f98f2(0x1e4)](a43_0x2f55a6['red'](_0x3f98f2(0x1c8))),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1e3)),console['error'](a43_0x2f55a6['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x1e387e[_0x3f98f2(0x1cc)]+(_0x1e387e[_0x3f98f2(0x1ee)]?'/'+_0x1e387e[_0x3f98f2(0x1ee)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1e387e[_0x3f98f2(0x1dd)],'parent_segment':_0x1e387e[_0x3f98f2(0x1cc)]},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1c9)+a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x1e387e['fullPath']))),_0x1867e9[_0x3f98f2(0x1bf)]&&(console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1d5)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x3f98f2(0x1e4)](a43_0x2f55a6['dim'](_0x3f98f2(0x1c2)))),0x0;}catch(_0x41c86a){throw _0x41c86a;}}}
1
+ const a43_0x4a532f=a43_0x52a5;(function(_0x4203ab,_0x14047a){const _0x4fd53f=a43_0x52a5,_0x276d42=_0x4203ab();while(!![]){try{const _0x76e369=-parseInt(_0x4fd53f(0x16d))/0x1*(-parseInt(_0x4fd53f(0x190))/0x2)+-parseInt(_0x4fd53f(0x197))/0x3*(-parseInt(_0x4fd53f(0x182))/0x4)+-parseInt(_0x4fd53f(0x1a0))/0x5*(parseInt(_0x4fd53f(0x18e))/0x6)+parseInt(_0x4fd53f(0x16f))/0x7*(parseInt(_0x4fd53f(0x19a))/0x8)+parseInt(_0x4fd53f(0x183))/0x9+parseInt(_0x4fd53f(0x18d))/0xa+-parseInt(_0x4fd53f(0x196))/0xb;if(_0x76e369===_0x14047a)break;else _0x276d42['push'](_0x276d42['shift']());}catch(_0x38ed12){_0x276d42['push'](_0x276d42['shift']());}}}(a43_0x4edb,0x7be09));import{existsSync,statSync}from'fs';import a43_0x2c181a from'chalk';import{BaseCommand}from'./command.js';function a43_0x4edb(){const _0x7819f1=['folderPath','segment:use','isDirectory','11128557uizBpI','6eCjcZR','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segment','381496vTVrnc','split','type','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','execute','1825cHuaOV','verbose','red','dim','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','data','Error:\x20Path\x20is\x20required\x0a','Usage:\x20tdx\x20segment\x20use\x20<path>','join','129VxFCaw','parentId','133MjlQeg','Use:\x20tdx\x20segment\x20use\x20','site','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','length','description','Parent\x20ID:\x20','cyan','segments','Resolving\x20path\x20\x27','parentName','Folder\x20ID:\x20','segmentPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20set\x20to:\x20','log','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolved\x20path\x20type:\x20','1238992XYyhKv','3329352DZxgVE','\x27...','name','parent_segment','session','green','error','folderId','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','isAbsolute','1302430vMecUJ','13602VmeMAT','Target\x20path:\x20','4974VORzHL','fullPath','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'];a43_0x4edb=function(){return _0x7819f1;};return a43_0x4edb();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x52a5(_0x312d8f,_0x2abdcd){_0x312d8f=_0x312d8f-0x165;const _0x4edb57=a43_0x4edb();let _0x52a58f=_0x4edb57[_0x312d8f];return _0x52a58f;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x4a532f(0x185)]=a43_0x4a532f(0x194);[a43_0x4a532f(0x174)]=a43_0x4a532f(0x19d);async[a43_0x4a532f(0x19f)](_0x2a2f83){const _0x50b999=a43_0x4a532f,{options:_0x5281ed,args:_0x43b5f9,tdx:_0x37dc4a}=_0x2a2f83;if(_0x43b5f9[_0x50b999(0x173)]===0x0)return console['error'](a43_0x2c181a[_0x50b999(0x166)](_0x50b999(0x16a))),console['error'](_0x50b999(0x16b)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x50b999(0x189)](_0x50b999(0x180)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x1dd5a2=_0x43b5f9[0x0],_0x2b0f36=_0x5281ed[_0x50b999(0x187)];try{if(_0x1dd5a2==='/')return saveSessionContext({'segment_path':undefined},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a['green'](_0x50b999(0x172))),0x0;if(existsSync(_0x1dd5a2)&&statSync(_0x1dd5a2)[_0x50b999(0x195)]()){let _0x3be864;try{_0x3be864=findTdxConfig(_0x1dd5a2);}catch{return console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x166)](_0x50b999(0x198)+_0x1dd5a2)),console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x176)](_0x50b999(0x17c))),0x1;}const _0x5972e6=_0x3be864['config'][_0x50b999(0x186)];return saveSessionContext({'segment_path':_0x5972e6,'parent_segment':_0x5972e6},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a['green'](_0x50b999(0x17d)+a43_0x2c181a['cyan'](_0x5972e6))),0x0;}const _0x52db98=_0x5281ed[_0x50b999(0x17b)];let _0x56691a=_0x1dd5a2;const _0x298e83=parsePath(_0x1dd5a2);if(!_0x298e83[_0x50b999(0x18c)]){if(!_0x52db98)return console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x166)](_0x50b999(0x19e))),console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x176)](_0x50b999(0x17f))),0x1;if(_0x1dd5a2==='..'){const _0x22a4e9=_0x52db98[_0x50b999(0x19b)]('/')['slice'](0x0,-0x1)['join']('/');_0x56691a=_0x22a4e9||'/';}else _0x1dd5a2==='.'?_0x56691a=_0x52db98:_0x56691a=_0x52db98+'/'+_0x1dd5a2;_0x5281ed['verbose']&&console[_0x50b999(0x189)]('Resolved\x20relative\x20path\x20to:\x20'+_0x56691a);}if(_0x56691a==='/'||_0x56691a==='')return saveSessionContext({'segment_path':undefined},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a[_0x50b999(0x188)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x56691a=normalizePath(_0x56691a);const _0x355a6a=parsePath(_0x56691a)[_0x50b999(0x177)];if(_0x355a6a[_0x50b999(0x173)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a[_0x50b999(0x188)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x5281ed[_0x50b999(0x165)]&&(console[_0x50b999(0x189)]('Site:\x20'+_0x5281ed[_0x50b999(0x171)]),console['error'](_0x50b999(0x18f)+_0x56691a));const _0x4f446e=await withSpinner(_0x50b999(0x178)+_0x56691a+_0x50b999(0x184),()=>_0x37dc4a['segment']['resolvePathToResource'](_0x56691a),{'verbose':_0x5281ed[_0x50b999(0x165)]}),_0x456915=_0x4f446e[_0x50b999(0x169)];_0x5281ed['verbose']&&(console['error'](_0x50b999(0x181)+_0x456915['type']),console[_0x50b999(0x189)](_0x50b999(0x175)+_0x456915[_0x50b999(0x16e)]),_0x456915[_0x50b999(0x18a)]&&console[_0x50b999(0x189)](_0x50b999(0x17a)+_0x456915[_0x50b999(0x18a)]));if(_0x456915[_0x50b999(0x19c)]===_0x50b999(0x199))return console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x166)](_0x50b999(0x192))),console[_0x50b999(0x189)](_0x50b999(0x168)),console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x176)](_0x50b999(0x170)+_0x456915[_0x50b999(0x179)]+(_0x456915['folderPath']?'/'+_0x456915[_0x50b999(0x193)][_0x50b999(0x16c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x456915[_0x50b999(0x191)],'parent_segment':_0x456915[_0x50b999(0x179)]},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a[_0x50b999(0x188)](_0x50b999(0x17d)+a43_0x2c181a['cyan'](_0x456915[_0x50b999(0x191)]))),_0x5281ed['verbose']&&(console['error'](a43_0x2c181a['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x167)](_0x50b999(0x18b)))),0x0;}catch(_0x398b34){throw _0x398b34;}}}
@@ -1 +1 @@
1
- const a44_0x5e7e65=a44_0x3b35;(function(_0x356041,_0xe0b07b){const _0x1efc62=a44_0x3b35,_0x323110=_0x356041();while(!![]){try{const _0x3da0a6=parseInt(_0x1efc62(0x1cb))/0x1+parseInt(_0x1efc62(0x1aa))/0x2+-parseInt(_0x1efc62(0x1c8))/0x3+parseInt(_0x1efc62(0x1a8))/0x4+-parseInt(_0x1efc62(0x1d2))/0x5+parseInt(_0x1efc62(0x1b7))/0x6*(parseInt(_0x1efc62(0x1b5))/0x7)+parseInt(_0x1efc62(0x1ad))/0x8*(-parseInt(_0x1efc62(0x1c9))/0x9);if(_0x3da0a6===_0xe0b07b)break;else _0x323110['push'](_0x323110['shift']());}catch(_0x41b360){_0x323110['push'](_0x323110['shift']());}}}(a44_0x3386,0x8a5c8));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 a44_0x4b1dcd from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x3b35(_0x5805a1,_0x440d8c){_0x5805a1=_0x5805a1-0x1a6;const _0x3386a0=a44_0x3386();let _0x3b35c5=_0x3386a0[_0x5805a1];return _0x3b35c5;}function a44_0x3386(){const _0x270253=['8nVYjyQ','.yaml','targetDir','Validate\x20segment\x20and\x20journey\x20YAML\x20files','verbose','cyan','\x20error(s)','\x20valid','131558baSBoC','\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','354pEwphC','):\x20','helpText','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20','red','filePath','valid','errorCode','message','Error:\x20Directory\x20not\x20found:\x20','green','dim','execute','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20file(s)\x20valid','length','1874319qQYBwW','9740511QmBkho','invalidCount','1080514NMeBtn','warningCount','log','.yml','hasErrors','Validation\x20failed:\x20','\x20warning(s)\x20found','4864030YXYLaL','segment:validate','\x20warning(s)','errors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','warnings','856844QHRZjB','error','1686030BubZhu','endsWith','validCount'];a44_0x3386=function(){return _0x270253;};return a44_0x3386();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x5e7e65(0x1d3);['description']=a44_0x5e7e65(0x1b0);async[a44_0x5e7e65(0x1c4)](_0x3ed5b1){const _0x1ba9dc=a44_0x5e7e65,{options:_0x15dea4,args:_0x1f4e27}=_0x3ed5b1,_0x29ba87=_0x15dea4,_0xefc5d7=await resolveTarget({'arg':_0x1f4e27[0x0],'contextParent':_0x15dea4['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xefc5d7))return _0xefc5d7[_0x1ba9dc(0x1bf)]==='no_parent'?(console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)](_0x1ba9dc(0x1ba))),console[_0x1ba9dc(0x1a9)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x1ba9dc(0x1a9)](_0x1ba9dc(0x1b6)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1bb)+_0xefc5d7[_0x1ba9dc(0x1c0)]+'\x0a')),_0xefc5d7[_0x1ba9dc(0x1b9)]&&console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1b2)](_0xefc5d7[_0x1ba9dc(0x1b9)]))),0x1;const _0x4d994b=_0xefc5d7[_0x1ba9dc(0x1af)],_0x221a8b=_0xefc5d7['type']==='file'?_0xefc5d7[_0x1ba9dc(0x1bd)]:undefined;if(!_0x221a8b&&!existsSync(_0x4d994b))return console['error'](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1c1)+_0x4d994b+'\x0a')),0x1;let _0x3f5685;if(_0x221a8b){if(!_0x221a8b[_0x1ba9dc(0x1ab)](_0x1ba9dc(0x1ce))&&!_0x221a8b[_0x1ba9dc(0x1ab)](_0x1ba9dc(0x1ae)))return console['error'](a44_0x4b1dcd['red'](_0x1ba9dc(0x1c5)+_0x221a8b+'\x0a')),0x1;_0x3f5685=[_0x221a8b];}else _0x3f5685=findYamlFiles(_0x4d994b);if(_0x3f5685[_0x1ba9dc(0x1c7)]===0x0)return console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1d6)+_0x4d994b+'\x0a')),0x1;const _0x58f5b8=validateYamlFiles(_0x3f5685,_0x4d994b),_0x51f053=calculateSummary(_0x58f5b8);for(const _0x21b1b0 of _0x58f5b8){if(!isValidationResult(_0x21b1b0))continue;const {relativePath:_0x2923d9,source:_0x5e535f,result:_0x4aae20,fileType:_0x200631}=_0x21b1b0,_0x123994=_0x200631;if(_0x4aae20[_0x1ba9dc(0x1be)]&&_0x4aae20[_0x1ba9dc(0x1a7)]['length']===0x0)_0x29ba87[_0x1ba9dc(0x1b1)]&&console['log'](a44_0x4b1dcd['green']('✔\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+')'));else _0x4aae20[_0x1ba9dc(0x1be)]?(console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)]('⚠\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+_0x1ba9dc(0x1b8)+_0x4aae20['warnings']['length']+_0x1ba9dc(0x1d4))),console[_0x1ba9dc(0x1cd)](formatValidationResult(_0x4aae20,_0x5e535f,_0x2923d9))):(console['log'](a44_0x4b1dcd[_0x1ba9dc(0x1bc)]('✖\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+_0x1ba9dc(0x1b8)+_0x4aae20[_0x1ba9dc(0x1d5)]['length']+_0x1ba9dc(0x1b3))),console[_0x1ba9dc(0x1cd)](formatValidationResult(_0x4aae20,_0x5e535f,_0x2923d9)));}return console[_0x1ba9dc(0x1cd)](''),_0x51f053[_0x1ba9dc(0x1cf)]?(console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1d0)+_0x51f053[_0x1ba9dc(0x1ca)]+'\x20file(s)\x20with\x20errors,\x20'+_0x51f053[_0x1ba9dc(0x1ac)]+_0x1ba9dc(0x1b4))),_0x51f053[_0x1ba9dc(0x1cc)]>0x0&&console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd['yellow'](_0x51f053[_0x1ba9dc(0x1cc)]+_0x1ba9dc(0x1d1))),0x1):(console['log'](a44_0x4b1dcd[_0x1ba9dc(0x1c2)]('✔\x20All\x20'+_0x51f053[_0x1ba9dc(0x1ac)]+_0x1ba9dc(0x1c6))),_0x51f053[_0x1ba9dc(0x1cc)]>0x0&&console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)](_0x51f053['warningCount']+_0x1ba9dc(0x1d1))),0x0);}}
1
+ function a44_0x2e69(_0x2dd4f0,_0x2ad33c){_0x2dd4f0=_0x2dd4f0-0x193;const _0x28b425=a44_0x28b4();let _0x2e698a=_0x28b425[_0x2dd4f0];return _0x2e698a;}const a44_0x10405c=a44_0x2e69;(function(_0x259295,_0x598b2a){const _0x15afda=a44_0x2e69,_0x3a30c2=_0x259295();while(!![]){try{const _0x1aa554=-parseInt(_0x15afda(0x1ac))/0x1+parseInt(_0x15afda(0x1a1))/0x2+parseInt(_0x15afda(0x1c2))/0x3*(-parseInt(_0x15afda(0x198))/0x4)+parseInt(_0x15afda(0x197))/0x5+parseInt(_0x15afda(0x19d))/0x6+parseInt(_0x15afda(0x193))/0x7+parseInt(_0x15afda(0x1be))/0x8*(-parseInt(_0x15afda(0x1bd))/0x9);if(_0x1aa554===_0x598b2a)break;else _0x3a30c2['push'](_0x3a30c2['shift']());}catch(_0x492193){_0x3a30c2['push'](_0x3a30c2['shift']());}}}(a44_0x28b4,0x858ab));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a44_0x28b4(){const _0x49cefe=['execute','endsWith','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','name','Validate\x20segment\x20and\x20journey\x20YAML\x20files','\x20file(s)\x20valid','red','cyan','):\x20','invalidCount','yellow','hasErrors','1720323fzlbrw','16ItASlb','errorCode','warningCount','length','7017rtUbjl','segment:validate','errors','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','272580dpaFHV','dim','log','\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','3364835EPtVrh','1588KCsubA','Validation\x20failed:\x20','description','\x20warning(s)\x20found','.yaml','5886120JkFQXQ','✔\x20All\x20','targetDir','\x20warning(s)','1997094QgEETz','\x20valid','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','error','valid','Error:\x20Directory\x20not\x20found:\x20','green','warnings','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','helpText','\x20file(s)\x20with\x20errors,\x20','833610IKHbir','parentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','validCount'];a44_0x28b4=function(){return _0x49cefe;};return a44_0x28b4();}import{existsSync}from'fs';import a44_0x5c5671 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{[a44_0x10405c(0x1b4)]=a44_0x10405c(0x1c3);[a44_0x10405c(0x19a)]=a44_0x10405c(0x1b5);async[a44_0x10405c(0x1b0)](_0x53c464){const _0x26e8dc=a44_0x10405c,{options:_0x17f9af,args:_0x3c0424}=_0x53c464,_0x17d251=_0x17f9af,_0x1709d9=await resolveTarget({'arg':_0x3c0424[0x0],'contextParent':_0x17f9af[_0x26e8dc(0x1ad)],'cwd':process[_0x26e8dc(0x1b2)]()});if(!isSuccessfulResolution(_0x1709d9))return _0x1709d9[_0x26e8dc(0x1bf)]==='no_parent'?(console['error'](a44_0x5c5671[_0x26e8dc(0x1bb)](_0x26e8dc(0x1a3))),console['error'](_0x26e8dc(0x1c5)),console[_0x26e8dc(0x1a4)](_0x26e8dc(0x196)),console[_0x26e8dc(0x1a4)](_0x26e8dc(0x1b3))):(console[_0x26e8dc(0x1a4)](a44_0x5c5671[_0x26e8dc(0x1b7)]('Error:\x20'+_0x1709d9['message']+'\x0a')),_0x1709d9[_0x26e8dc(0x1aa)]&&console[_0x26e8dc(0x1a4)](a44_0x5c5671[_0x26e8dc(0x1b8)](_0x1709d9[_0x26e8dc(0x1aa)]))),0x1;const _0x54d991=_0x1709d9[_0x26e8dc(0x19f)],_0x106855=_0x1709d9['type']==='file'?_0x1709d9['filePath']:undefined;if(!_0x106855&&!existsSync(_0x54d991))return console[_0x26e8dc(0x1a4)](a44_0x5c5671[_0x26e8dc(0x1b7)](_0x26e8dc(0x1a6)+_0x54d991+'\x0a')),0x1;let _0x5e1df8;if(_0x106855){if(!_0x106855[_0x26e8dc(0x1b1)]('.yml')&&!_0x106855[_0x26e8dc(0x1b1)](_0x26e8dc(0x19c)))return console[_0x26e8dc(0x1a4)](a44_0x5c5671[_0x26e8dc(0x1b7)](_0x26e8dc(0x1a9)+_0x106855+'\x0a')),0x1;_0x5e1df8=[_0x106855];}else _0x5e1df8=findYamlFiles(_0x54d991);if(_0x5e1df8['length']===0x0)return console['error'](a44_0x5c5671[_0x26e8dc(0x1b7)](_0x26e8dc(0x1ae)+_0x54d991+'\x0a')),0x1;const _0x33307c=validateYamlFiles(_0x5e1df8,_0x54d991),_0x45dff1=calculateSummary(_0x33307c);for(const _0x4870ba of _0x33307c){if(!isValidationResult(_0x4870ba))continue;const {relativePath:_0x2c7608,source:_0x4b1834,result:_0x261c3b,fileType:_0x2e67d6}=_0x4870ba,_0x417600=_0x2e67d6;if(_0x261c3b['valid']&&_0x261c3b[_0x26e8dc(0x1a8)][_0x26e8dc(0x1c1)]===0x0)_0x17d251['verbose']&&console['log'](a44_0x5c5671[_0x26e8dc(0x1a7)]('✔\x20'+_0x2c7608)+a44_0x5c5671[_0x26e8dc(0x194)]('\x20('+_0x417600+')'));else _0x261c3b[_0x26e8dc(0x1a5)]?(console['log'](a44_0x5c5671[_0x26e8dc(0x1bb)]('⚠\x20'+_0x2c7608)+a44_0x5c5671[_0x26e8dc(0x194)]('\x20('+_0x417600+_0x26e8dc(0x1b9)+_0x261c3b[_0x26e8dc(0x1a8)]['length']+_0x26e8dc(0x1a0))),console[_0x26e8dc(0x195)](formatValidationResult(_0x261c3b,_0x4b1834,_0x2c7608))):(console[_0x26e8dc(0x195)](a44_0x5c5671[_0x26e8dc(0x1b7)]('✖\x20'+_0x2c7608)+a44_0x5c5671[_0x26e8dc(0x194)]('\x20('+_0x417600+_0x26e8dc(0x1b9)+_0x261c3b[_0x26e8dc(0x1c4)][_0x26e8dc(0x1c1)]+'\x20error(s)')),console[_0x26e8dc(0x195)](formatValidationResult(_0x261c3b,_0x4b1834,_0x2c7608)));}return console[_0x26e8dc(0x195)](''),_0x45dff1[_0x26e8dc(0x1bc)]?(console[_0x26e8dc(0x195)](a44_0x5c5671[_0x26e8dc(0x1b7)](_0x26e8dc(0x199)+_0x45dff1[_0x26e8dc(0x1ba)]+_0x26e8dc(0x1ab)+_0x45dff1[_0x26e8dc(0x1af)]+_0x26e8dc(0x1a2))),_0x45dff1[_0x26e8dc(0x1c0)]>0x0&&console['log'](a44_0x5c5671[_0x26e8dc(0x1bb)](_0x45dff1[_0x26e8dc(0x1c0)]+_0x26e8dc(0x19b))),0x1):(console[_0x26e8dc(0x195)](a44_0x5c5671[_0x26e8dc(0x1a7)](_0x26e8dc(0x19e)+_0x45dff1[_0x26e8dc(0x1af)]+_0x26e8dc(0x1b6))),_0x45dff1[_0x26e8dc(0x1c0)]>0x0&&console[_0x26e8dc(0x195)](a44_0x5c5671['yellow'](_0x45dff1[_0x26e8dc(0x1c0)]+_0x26e8dc(0x19b))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x374368=a45_0x3f88;(function(_0x557c85,_0x34fefc){const _0x37bdd7=a45_0x3f88,_0x2b9d1b=_0x557c85();while(!![]){try{const _0x3e1548=parseInt(_0x37bdd7(0xbb))/0x1+parseInt(_0x37bdd7(0xde))/0x2*(-parseInt(_0x37bdd7(0xe4))/0x3)+parseInt(_0x37bdd7(0xb1))/0x4+-parseInt(_0x37bdd7(0xf4))/0x5*(parseInt(_0x37bdd7(0xda))/0x6)+-parseInt(_0x37bdd7(0xeb))/0x7+-parseInt(_0x37bdd7(0xed))/0x8+parseInt(_0x37bdd7(0xb5))/0x9*(parseInt(_0x37bdd7(0xb7))/0xa);if(_0x3e1548===_0x34fefc)break;else _0x2b9d1b['push'](_0x2b9d1b['shift']());}catch(_0x3d8385){_0x2b9d1b['push'](_0x2b9d1b['shift']());}}}(a45_0x54b5,0x68deb));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x54b5(){const _0x4aa04e=['Folder\x20ID:\x20','2pUxaFH','replace','\x20folder','cause','journey','listRecursive','2122122MaVgtU','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','description','jsonl','folders','listWithPattern','folder','5979792efdEYi','length','3289432nmQCRt','localeCompare','verbose','List\x20folders\x20and\x20child\x20segments','log','site','journeys','10VCudkZ','includes',',\x20and\x20','dim','(not\x20set)','No\x20items\x20match\x20pattern:\x20','data','Building\x20hierarchy\x20tree...','359896Kyjlgp','segments','map','listUnifiedWithJourneys','19334043zxOXcQ','Set\x20a\x20parent\x20segment\x20context\x20first:','10nbHfeM',']\x20matching\x20\x27','\x5c$&','name','340959bRpHWj','maxDepth','Error:\x20No\x20parent\x20segment\x20context\x20set.','/app/ps/','\x20\x20Cause:\x20','Resolving\x20path\x20\x27','/e/','✔\x20Built\x20tree\x20with\x20','sort','Site:\x20','listUnified','parentId','json','Parent\x20segment\x20context:\x20','test','Error:\x20','\x20segment','\x20journey','type','segment','children','Folder/pattern\x20arg:\x20','\x27...','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Listing\x20folders,\x20segments,\x20and\x20journeys...','filter','resolvePathToResource','/j/da','journeyBundleName','format','✔\x20Found\x20','530412fwwVVk','error','folderId'];a45_0x54b5=function(){return _0x4aa04e;};return a45_0x54b5();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x39f889 from'chalk';function a45_0x3f88(_0x25f75f,_0x415558){_0x25f75f=_0x25f75f-0xaf;const _0x54b532=a45_0x54b5();let _0x3f8844=_0x54b532[_0x25f75f];return _0x3f8844;}export class SegmentsCommand extends BaseCommand{[a45_0x374368(0xba)]='segments';[a45_0x374368(0xe6)]=a45_0x374368(0xf0);async['execute'](_0x31176d){const _0x5b9c03=a45_0x374368,{options:_0x53c058,args:_0x1590b8}=_0x31176d,_0x447c65=_0x53c058['recursive'],_0x240b9a=_0x1590b8[0x0];try{const _0x17484f=_0x53c058['parentSegment'];_0x53c058[_0x5b9c03(0xef)]&&(console[_0x5b9c03(0xdb)](_0x5b9c03(0xc4)+_0x53c058[_0x5b9c03(0xf2)]),console[_0x5b9c03(0xdb)](_0x5b9c03(0xc8)+(_0x17484f||_0x5b9c03(0xf8))),_0x240b9a&&console['error'](_0x5b9c03(0xd0)+_0x240b9a),_0x447c65&&console[_0x5b9c03(0xdb)]('Recursive\x20mode:\x20enabled'));if(!_0x17484f)return console[_0x5b9c03(0xdb)](_0x5b9c03(0xbd)),console[_0x5b9c03(0xdb)](''),console[_0x5b9c03(0xdb)](_0x5b9c03(0xb6)),console[_0x5b9c03(0xdb)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x5b9c03(0xdb)](_0x5b9c03(0xd2)),console[_0x5b9c03(0xdb)](''),console[_0x5b9c03(0xdb)](_0x5b9c03(0xe5)),0x1;const _0x528df2=_0x240b9a&&(_0x240b9a[_0x5b9c03(0xf5)]('*')||_0x240b9a[_0x5b9c03(0xf5)]('?'));if(_0x528df2)return await this[_0x5b9c03(0xe9)](_0x31176d,_0x17484f,_0x240b9a);const _0x54b278=_0x240b9a?_0x17484f+'/'+_0x240b9a:_0x17484f;return _0x447c65?await this[_0x5b9c03(0xe3)](_0x31176d,_0x54b278):await this[_0x5b9c03(0xc5)](_0x31176d,_0x54b278);}catch(_0x1752e2){if(_0x1752e2 instanceof SDKError)return console['error'](_0x5b9c03(0xca)+_0x1752e2['message']),_0x1752e2[_0x5b9c03(0xe1)]&&console[_0x5b9c03(0xdb)](_0x5b9c03(0xbf)+_0x1752e2[_0x5b9c03(0xe1)]),0x1;throw _0x1752e2;}}async[a45_0x374368(0xe9)](_0x16b8ef,_0x38d716,_0xb4fbb2){const _0x3872d1=a45_0x374368,{options:_0x3dfb6b,tdx:_0x879183}=_0x16b8ef,_0x45b249=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x38d716+'\x27...',()=>_0x879183[_0x3872d1(0xce)][_0x3872d1(0xd5)](_0x38d716),{'verbose':_0x3dfb6b[_0x3872d1(0xef)]}),_0x4dc054=_0x45b249[_0x3872d1(0xaf)],_0x217c53=await withSpinner(_0x3872d1(0xd3),()=>_0x879183[_0x3872d1(0xce)]['listUnifiedWithJourneys'](_0x4dc054['parentId'],_0x4dc054[_0x3872d1(0xdc)]),{'verbose':_0x3dfb6b[_0x3872d1(0xef)]}),{folders:_0x109dd4,segments:_0x4063eb,journeys:_0x4c628c}=_0x217c53[_0x3872d1(0xaf)],_0x42f723=_0xb4fbb2['replace'](/[.+^${}()|[\]\\]/g,_0x3872d1(0xb9))[_0x3872d1(0xdf)](/\*/g,'.*')[_0x3872d1(0xdf)](/\?/g,'.'),_0x2c85a9=new RegExp('^'+_0x42f723+'$','i'),_0x16150a=_0x109dd4[_0x3872d1(0xd4)](_0x197098=>_0x2c85a9[_0x3872d1(0xc9)](_0x197098[_0x3872d1(0xba)])),_0x20366b=_0x4063eb[_0x3872d1(0xd4)](_0x9db5bf=>_0x2c85a9[_0x3872d1(0xc9)](_0x9db5bf[_0x3872d1(0xba)])),_0x41d808=_0x4c628c[_0x3872d1(0xd4)](_0x4583ed=>_0x2c85a9[_0x3872d1(0xc9)](_0x4583ed[_0x3872d1(0xd7)])),_0x3c4446=_0x16150a['length']+_0x20366b[_0x3872d1(0xec)]+_0x41d808[_0x3872d1(0xec)];console[_0x3872d1(0xdb)](_0x3872d1(0xd9)+_0x16150a['length']+_0x3872d1(0xe0)+(_0x16150a['length']!==0x1?'s':'')+',\x20'+_0x20366b[_0x3872d1(0xec)]+_0x3872d1(0xcb)+(_0x20366b[_0x3872d1(0xec)]!==0x1?'s':'')+_0x3872d1(0xf6)+_0x41d808[_0x3872d1(0xec)]+_0x3872d1(0xcc)+(_0x41d808[_0x3872d1(0xec)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0xb4fbb2+'\x27');const _0x5418ae=_0x53de74=>{const _0x2fa9f7=_0x3872d1;return getConsoleNextUrl(_0x3dfb6b[_0x2fa9f7(0xf2)],_0x2fa9f7(0xbe)+_0x4dc054['parentId']+_0x2fa9f7(0xc1)+_0x53de74);},_0xd7d9b5=_0x3dfb6b[_0x3872d1(0xd8)]===_0x3872d1(0xc7)||_0x3dfb6b[_0x3872d1(0xd8)]===_0x3872d1(0xe7);if(_0xd7d9b5){const _0x43bc0e=[..._0x16150a[_0x3872d1(0xb3)](_0x26058f=>({..._0x26058f,'type':'folder'})),..._0x20366b[_0x3872d1(0xb3)](_0x2afbaf=>({..._0x2afbaf,'type':_0x3872d1(0xce),'url':_0x5418ae(_0x2afbaf['id'])})),..._0x41d808[_0x3872d1(0xb3)](_0x792a77=>({..._0x792a77,'name':_0x792a77['journeyBundleName'],'type':_0x3872d1(0xe2)}))][_0x3872d1(0xc3)]((_0x569ee5,_0xe4bdb)=>_0x569ee5[_0x3872d1(0xba)][_0x3872d1(0xee)](_0xe4bdb['name']));await handleSDKOutput(_0x43bc0e,_0x3dfb6b);}else{if(_0x3c4446===0x0)console[_0x3872d1(0xf1)](_0x3872d1(0xf9)+_0xb4fbb2);else{console[_0x3872d1(0xf1)](a45_0x39f889[_0x3872d1(0xf7)]('['+_0x38d716+_0x3872d1(0xb8)+_0xb4fbb2+'\x27'));const _0x173abb=formatFlatList(_0x16150a,_0x20366b,{'showMetadata':!![],'getSegmentUrl':_0x5418ae},_0x41d808);console['log'](_0x173abb);}}return 0x0;}async[a45_0x374368(0xc5)](_0x4368e,_0x55959f){const _0x36cb43=a45_0x374368,{options:_0x1b5774,tdx:_0x2f0f8d}=_0x4368e,_0x4ccc70=await withSpinner('Resolving\x20path\x20\x27'+_0x55959f+_0x36cb43(0xd1),()=>_0x2f0f8d['segment'][_0x36cb43(0xd5)](_0x55959f),{'verbose':_0x1b5774['verbose']}),_0x5dbece=_0x4ccc70['data'];_0x1b5774[_0x36cb43(0xef)]&&(console['error']('Parent\x20ID:\x20'+_0x5dbece['parentId']),_0x5dbece[_0x36cb43(0xdc)]&&console[_0x36cb43(0xdb)](_0x36cb43(0xdd)+_0x5dbece[_0x36cb43(0xdc)]));const _0x1196df=await withSpinner(_0x36cb43(0xd3),()=>_0x2f0f8d[_0x36cb43(0xce)][_0x36cb43(0xb4)](_0x5dbece[_0x36cb43(0xc6)],_0x5dbece[_0x36cb43(0xdc)]),{'verbose':_0x1b5774[_0x36cb43(0xef)]}),{folders:_0x12dbdf,segments:_0xb4bbb,journeys:_0x1cfb90}=_0x1196df[_0x36cb43(0xaf)],_0x11346d=_0x12dbdf[_0x36cb43(0xec)]+_0xb4bbb[_0x36cb43(0xec)]+_0x1cfb90[_0x36cb43(0xec)];console['error'](_0x36cb43(0xd9)+_0x12dbdf[_0x36cb43(0xec)]+_0x36cb43(0xe0)+(_0x12dbdf['length']!==0x1?'s':'')+',\x20'+_0xb4bbb[_0x36cb43(0xec)]+_0x36cb43(0xcb)+(_0xb4bbb[_0x36cb43(0xec)]!==0x1?'s':'')+',\x20and\x20'+_0x1cfb90['length']+_0x36cb43(0xcc)+(_0x1cfb90[_0x36cb43(0xec)]!==0x1?'s':''));const _0x15e872=_0x3e51aa=>{const _0x5224b0=_0x36cb43;return getConsoleNextUrl(_0x1b5774[_0x5224b0(0xf2)],_0x5224b0(0xbe)+_0x5dbece[_0x5224b0(0xc6)]+_0x5224b0(0xc1)+_0x3e51aa);},_0x1b15cc=_0x88e6c8=>{const _0x18ed62=_0x36cb43;return getConsoleNextUrl(_0x1b5774[_0x18ed62(0xf2)],_0x18ed62(0xbe)+_0x5dbece[_0x18ed62(0xc6)]+_0x18ed62(0xc1)+_0x88e6c8+_0x18ed62(0xd6));},_0x6dca45=_0x1b5774['format']==='json'||_0x1b5774['format']===_0x36cb43(0xe7);if(_0x6dca45){const _0x2f667b=[..._0x12dbdf[_0x36cb43(0xb3)](_0x1ae7fb=>({..._0x1ae7fb,'type':_0x36cb43(0xea)})),..._0xb4bbb['map'](_0x11d3e9=>({..._0x11d3e9,'type':'segment','url':_0x15e872(_0x11d3e9['id'])})),..._0x1cfb90[_0x36cb43(0xb3)](_0x97e74b=>({..._0x97e74b,'name':_0x97e74b[_0x36cb43(0xd7)],'type':'journey','url':_0x1b15cc(_0x97e74b['id'])}))][_0x36cb43(0xc3)]((_0x443953,_0x5ee85a)=>_0x443953[_0x36cb43(0xba)][_0x36cb43(0xee)](_0x5ee85a[_0x36cb43(0xba)]));await handleSDKOutput(_0x2f667b,_0x1b5774);}else{if(_0x11346d===0x0)console[_0x36cb43(0xf1)](a45_0x39f889[_0x36cb43(0xf7)]('['+_0x55959f+']')),console[_0x36cb43(0xf1)]('(empty)');else{console[_0x36cb43(0xf1)](a45_0x39f889[_0x36cb43(0xf7)]('['+_0x55959f+']'));const _0x467ac4=formatFlatList(_0x12dbdf,_0xb4bbb,{'showMetadata':!![],'getSegmentUrl':_0x15e872,'getJourneyUrl':_0x1b15cc},_0x1cfb90);console[_0x36cb43(0xf1)](_0x467ac4);}}return 0x0;}async['listRecursive'](_0x204588,_0x2f3eb3){const _0xe3075c=a45_0x374368,{options:_0x177c0c,tdx:_0x2f8f45}=_0x204588,_0x2ad667=await withSpinner(_0xe3075c(0xc0)+_0x2f3eb3+_0xe3075c(0xd1),()=>_0x2f8f45['segment'][_0xe3075c(0xd5)](_0x2f3eb3),{'verbose':_0x177c0c[_0xe3075c(0xef)]}),_0x4861cb=_0x2ad667[_0xe3075c(0xaf)];_0x177c0c[_0xe3075c(0xef)]&&(console['error']('Parent\x20ID:\x20'+_0x4861cb[_0xe3075c(0xc6)]),_0x4861cb['folderId']&&console[_0xe3075c(0xdb)]('Folder\x20ID:\x20'+_0x4861cb['folderId']));const _0x4b4f99=_0x177c0c[_0xe3075c(0xbc)]||0xa,_0x29d683=await withSpinner(_0xe3075c(0xb0),()=>_0x2f8f45[_0xe3075c(0xce)][_0xe3075c(0xe3)](_0x4861cb[_0xe3075c(0xc6)],_0x4861cb['folderId'],0x0,_0x4b4f99),{'verbose':_0x177c0c[_0xe3075c(0xef)]}),_0x567e10=_0x29d683[_0xe3075c(0xaf)],_0x5b2e4d=_0x458723=>{const _0x98e747=_0xe3075c;let _0x2380f8=0x0,_0x4ceb09=0x0,_0x45aa38=0x0;for(const _0x483af0 of _0x458723){if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xea))_0x2380f8++;else{if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xce))_0x4ceb09++;else{if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xe2))_0x45aa38++;}}if(_0x483af0[_0x98e747(0xcf)]){const _0x4ba37e=_0x5b2e4d(_0x483af0['children']);_0x2380f8+=_0x4ba37e[_0x98e747(0xe8)],_0x4ceb09+=_0x4ba37e['segments'],_0x45aa38+=_0x4ba37e['journeys'];}}return{'folders':_0x2380f8,'segments':_0x4ceb09,'journeys':_0x45aa38};},_0x113aad=_0x5b2e4d(_0x567e10);console[_0xe3075c(0xdb)](_0xe3075c(0xc2)+_0x113aad[_0xe3075c(0xe8)]+_0xe3075c(0xe0)+(_0x113aad[_0xe3075c(0xe8)]!==0x1?'s':'')+',\x20'+_0x113aad[_0xe3075c(0xb2)]+_0xe3075c(0xcb)+(_0x113aad[_0xe3075c(0xb2)]!==0x1?'s':'')+_0xe3075c(0xf6)+_0x113aad[_0xe3075c(0xf3)]+_0xe3075c(0xcc)+(_0x113aad[_0xe3075c(0xf3)]!==0x1?'s':''));const _0x584bc8=_0x3a5bbf=>{const _0x5c0b5b=_0xe3075c;return getConsoleNextUrl(_0x177c0c[_0x5c0b5b(0xf2)],_0x5c0b5b(0xbe)+_0x4861cb[_0x5c0b5b(0xc6)]+_0x5c0b5b(0xc1)+_0x3a5bbf);},_0x4f1f73=_0x5649d9=>{const _0x59337e=_0xe3075c;return getConsoleNextUrl(_0x177c0c[_0x59337e(0xf2)],_0x59337e(0xbe)+_0x4861cb[_0x59337e(0xc6)]+_0x59337e(0xc1)+_0x5649d9+_0x59337e(0xd6));};if(_0x177c0c['format']===_0xe3075c(0xc7)||_0x177c0c[_0xe3075c(0xd8)]===_0xe3075c(0xe7))await handleSDKOutput(_0x567e10,_0x177c0c);else{console[_0xe3075c(0xf1)](a45_0x39f889[_0xe3075c(0xf7)]('['+_0x2f3eb3+']'));const _0x502f99=formatTree(_0x567e10,{'showMetadata':!![],'getSegmentUrl':_0x584bc8,'getJourneyUrl':_0x4f1f73});console[_0xe3075c(0xf1)](_0x502f99);}return 0x0;}}
1
+ const a45_0x422d4e=a45_0x315f;(function(_0x3531d6,_0x2f35b3){const _0x168562=a45_0x315f,_0x43821e=_0x3531d6();while(!![]){try{const _0x2c4abe=-parseInt(_0x168562(0xbd))/0x1+-parseInt(_0x168562(0xab))/0x2+-parseInt(_0x168562(0xe9))/0x3+parseInt(_0x168562(0xbe))/0x4*(-parseInt(_0x168562(0xb8))/0x5)+-parseInt(_0x168562(0xd3))/0x6+parseInt(_0x168562(0xeb))/0x7+parseInt(_0x168562(0xb6))/0x8;if(_0x2c4abe===_0x2f35b3)break;else _0x43821e['push'](_0x43821e['shift']());}catch(_0x2dfa63){_0x43821e['push'](_0x43821e['shift']());}}}(a45_0x1367,0x919d1));function a45_0x315f(_0xe586bc,_0x56aa2f){_0xe586bc=_0xe586bc-0x9d;const _0x1367fe=a45_0x1367();let _0x315f11=_0x1367fe[_0xe586bc];return _0x315f11;}function a45_0x1367(){const _0xe124f2=['Resolving\x20path\x20\x27','parentId','21092680rhUQoB','Set\x20a\x20parent\x20segment\x20context\x20first:','20xsGLWt','✔\x20Built\x20tree\x20with\x20','log','jsonl','data','746535zuszkc','103808gXpcoe','Error:\x20','verbose','listRecursive','Resolving\x20parent\x20segment\x20\x27','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20folder','\x20matching\x20\x27','\x20journey','type','name','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','parentSegment','format','error','\x27...','No\x20items\x20match\x20pattern:\x20','folderId','Parent\x20ID:\x20','cause','sort','1029828rCGIju','journeys','site','length','journey','listWithPattern','✔\x20Found\x20','dim','includes','execute','Site:\x20','/j/da','Recursive\x20mode:\x20enabled','Folder/pattern\x20arg:\x20','\x20segment','description','test','map','(empty)','folders',',\x20and\x20','\x5c$&','1357626EfQzDn','json','778575rhgoAp','listUnified','folder','listUnifiedWithJourneys','(not\x20set)','message','segment','filter','segments','journeyBundleName','List\x20folders\x20and\x20child\x20segments','Parent\x20segment\x20context:\x20','replace','resolvePathToResource','/app/ps/','maxDepth','1353708XwQChR','Building\x20hierarchy\x20tree...','/e/','localeCompare',']\x20matching\x20\x27','Folder\x20ID:\x20','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','children','Error:\x20No\x20parent\x20segment\x20context\x20set.'];a45_0x1367=function(){return _0xe124f2;};return a45_0x1367();}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{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xcbdf15 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x422d4e(0xc8)]=a45_0x422d4e(0xa3);[a45_0x422d4e(0xe2)]=a45_0x422d4e(0xa5);async[a45_0x422d4e(0xdc)](_0x3da091){const _0x213ef0=a45_0x422d4e,{options:_0x26e652,args:_0x1006d3}=_0x3da091,_0x119ff5=_0x26e652['recursive'],_0x12901a=_0x1006d3[0x0];try{const _0x27dc46=_0x26e652[_0x213ef0(0xca)];_0x26e652[_0x213ef0(0xc0)]&&(console[_0x213ef0(0xcc)](_0x213ef0(0xdd)+_0x26e652[_0x213ef0(0xd5)]),console[_0x213ef0(0xcc)](_0x213ef0(0xa6)+(_0x27dc46||_0x213ef0(0x9f))),_0x12901a&&console[_0x213ef0(0xcc)](_0x213ef0(0xe0)+_0x12901a),_0x119ff5&&console['error'](_0x213ef0(0xdf)));if(!_0x27dc46)return console['error'](_0x213ef0(0xb3)),console['error'](''),console[_0x213ef0(0xcc)](_0x213ef0(0xb7)),console[_0x213ef0(0xcc)](_0x213ef0(0xc9)),console[_0x213ef0(0xcc)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console['error'](''),console[_0x213ef0(0xcc)](_0x213ef0(0xb1)),0x1;const _0x26cf26=_0x12901a&&(_0x12901a[_0x213ef0(0xdb)]('*')||_0x12901a['includes']('?'));if(_0x26cf26)return await this[_0x213ef0(0xd8)](_0x3da091,_0x27dc46,_0x12901a);const _0x4aabcb=_0x12901a?_0x27dc46+'/'+_0x12901a:_0x27dc46;return _0x119ff5?await this['listRecursive'](_0x3da091,_0x4aabcb):await this['listUnified'](_0x3da091,_0x4aabcb);}catch(_0x635513){if(_0x635513 instanceof SDKError)return console[_0x213ef0(0xcc)](_0x213ef0(0xbf)+_0x635513[_0x213ef0(0xa0)]),_0x635513[_0x213ef0(0xd1)]&&console[_0x213ef0(0xcc)]('\x20\x20Cause:\x20'+_0x635513[_0x213ef0(0xd1)]),0x1;throw _0x635513;}}async[a45_0x422d4e(0xd8)](_0x10a5e6,_0x4b8917,_0x38c286){const _0x477137=a45_0x422d4e,{options:_0x4f9e97,tdx:_0x302904}=_0x10a5e6,_0x2e4e79=await withSpinner(_0x477137(0xc2)+_0x4b8917+_0x477137(0xcd),()=>_0x302904[_0x477137(0xa1)][_0x477137(0xa8)](_0x4b8917),{'verbose':_0x4f9e97[_0x477137(0xc0)]}),_0x32712e=_0x2e4e79[_0x477137(0xbc)],_0x392e6a=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x302904[_0x477137(0xa1)]['listUnifiedWithJourneys'](_0x32712e[_0x477137(0xb5)],_0x32712e[_0x477137(0xcf)]),{'verbose':_0x4f9e97['verbose']}),{folders:_0x2ec527,segments:_0x238009,journeys:_0xf98f7d}=_0x392e6a[_0x477137(0xbc)],_0x8b2f22=_0x38c286['replace'](/[.+^${}()|[\]\\]/g,_0x477137(0xe8))[_0x477137(0xa7)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1a35a9=new RegExp('^'+_0x8b2f22+'$','i'),_0x390099=_0x2ec527[_0x477137(0xa2)](_0x2a2604=>_0x1a35a9[_0x477137(0xe3)](_0x2a2604[_0x477137(0xc8)])),_0xdc28ee=_0x238009['filter'](_0x107382=>_0x1a35a9[_0x477137(0xe3)](_0x107382[_0x477137(0xc8)])),_0x2bf0e5=_0xf98f7d[_0x477137(0xa2)](_0x3aabaf=>_0x1a35a9[_0x477137(0xe3)](_0x3aabaf[_0x477137(0xa4)])),_0x1e9361=_0x390099['length']+_0xdc28ee[_0x477137(0xd6)]+_0x2bf0e5[_0x477137(0xd6)];console[_0x477137(0xcc)](_0x477137(0xd9)+_0x390099['length']+_0x477137(0xc4)+(_0x390099[_0x477137(0xd6)]!==0x1?'s':'')+',\x20'+_0xdc28ee['length']+'\x20segment'+(_0xdc28ee[_0x477137(0xd6)]!==0x1?'s':'')+_0x477137(0xe7)+_0x2bf0e5[_0x477137(0xd6)]+_0x477137(0xc6)+(_0x2bf0e5[_0x477137(0xd6)]!==0x1?'s':'')+_0x477137(0xc5)+_0x38c286+'\x27');const _0xf61831=_0xfd18d5=>{const _0x309b71=_0x477137;return getConsoleNextUrl(_0x4f9e97[_0x309b71(0xd5)],_0x309b71(0xa9)+_0x32712e['parentId']+'/e/'+_0xfd18d5);},_0x50063b=_0x4f9e97['format']===_0x477137(0xea)||_0x4f9e97[_0x477137(0xcb)]===_0x477137(0xbb);if(_0x50063b){const _0x23b081=[..._0x390099[_0x477137(0xe4)](_0x420f5=>({..._0x420f5,'type':'folder'})),..._0xdc28ee[_0x477137(0xe4)](_0x3d8952=>({..._0x3d8952,'type':_0x477137(0xa1),'url':_0xf61831(_0x3d8952['id'])})),..._0x2bf0e5[_0x477137(0xe4)](_0xdbf276=>({..._0xdbf276,'name':_0xdbf276[_0x477137(0xa4)],'type':'journey'}))][_0x477137(0xd2)]((_0x34429d,_0x117e3e)=>_0x34429d[_0x477137(0xc8)]['localeCompare'](_0x117e3e['name']));await handleSDKOutput(_0x23b081,_0x4f9e97);}else{if(_0x1e9361===0x0)console['log'](_0x477137(0xce)+_0x38c286);else{console[_0x477137(0xba)](a45_0xcbdf15[_0x477137(0xda)]('['+_0x4b8917+_0x477137(0xaf)+_0x38c286+'\x27'));const _0x282ac6=formatFlatList(_0x390099,_0xdc28ee,{'showMetadata':!![],'getSegmentUrl':_0xf61831},_0x2bf0e5);console[_0x477137(0xba)](_0x282ac6);}}return 0x0;}async[a45_0x422d4e(0xec)](_0x10488d,_0x543482){const _0x1d7a7d=a45_0x422d4e,{options:_0x469930,tdx:_0x4a96bc}=_0x10488d,_0x105621=await withSpinner(_0x1d7a7d(0xb4)+_0x543482+'\x27...',()=>_0x4a96bc[_0x1d7a7d(0xa1)][_0x1d7a7d(0xa8)](_0x543482),{'verbose':_0x469930[_0x1d7a7d(0xc0)]}),_0x480e3f=_0x105621[_0x1d7a7d(0xbc)];_0x469930['verbose']&&(console[_0x1d7a7d(0xcc)](_0x1d7a7d(0xd0)+_0x480e3f[_0x1d7a7d(0xb5)]),_0x480e3f[_0x1d7a7d(0xcf)]&&console[_0x1d7a7d(0xcc)]('Folder\x20ID:\x20'+_0x480e3f[_0x1d7a7d(0xcf)]));const _0x112234=await withSpinner(_0x1d7a7d(0xc3),()=>_0x4a96bc[_0x1d7a7d(0xa1)][_0x1d7a7d(0x9e)](_0x480e3f[_0x1d7a7d(0xb5)],_0x480e3f[_0x1d7a7d(0xcf)]),{'verbose':_0x469930['verbose']}),{folders:_0x4e6fd8,segments:_0xfd36ae,journeys:_0xd6a53}=_0x112234['data'],_0x26e18a=_0x4e6fd8[_0x1d7a7d(0xd6)]+_0xfd36ae[_0x1d7a7d(0xd6)]+_0xd6a53['length'];console[_0x1d7a7d(0xcc)]('✔\x20Found\x20'+_0x4e6fd8[_0x1d7a7d(0xd6)]+_0x1d7a7d(0xc4)+(_0x4e6fd8[_0x1d7a7d(0xd6)]!==0x1?'s':'')+',\x20'+_0xfd36ae[_0x1d7a7d(0xd6)]+_0x1d7a7d(0xe1)+(_0xfd36ae[_0x1d7a7d(0xd6)]!==0x1?'s':'')+_0x1d7a7d(0xe7)+_0xd6a53['length']+_0x1d7a7d(0xc6)+(_0xd6a53['length']!==0x1?'s':''));const _0x58df67=_0x394631=>{const _0x20fb47=_0x1d7a7d;return getConsoleNextUrl(_0x469930['site'],'/app/ps/'+_0x480e3f['parentId']+_0x20fb47(0xad)+_0x394631);},_0x349f8a=_0x235f7b=>{const _0x2fb4da=_0x1d7a7d;return getConsoleNextUrl(_0x469930[_0x2fb4da(0xd5)],_0x2fb4da(0xa9)+_0x480e3f[_0x2fb4da(0xb5)]+_0x2fb4da(0xad)+_0x235f7b+_0x2fb4da(0xde));},_0x1af93a=_0x469930[_0x1d7a7d(0xcb)]===_0x1d7a7d(0xea)||_0x469930['format']==='jsonl';if(_0x1af93a){const _0x25c9c9=[..._0x4e6fd8[_0x1d7a7d(0xe4)](_0x3054e9=>({..._0x3054e9,'type':_0x1d7a7d(0x9d)})),..._0xfd36ae[_0x1d7a7d(0xe4)](_0x328734=>({..._0x328734,'type':_0x1d7a7d(0xa1),'url':_0x58df67(_0x328734['id'])})),..._0xd6a53[_0x1d7a7d(0xe4)](_0x5ba83f=>({..._0x5ba83f,'name':_0x5ba83f[_0x1d7a7d(0xa4)],'type':_0x1d7a7d(0xd7),'url':_0x349f8a(_0x5ba83f['id'])}))][_0x1d7a7d(0xd2)]((_0x1ef257,_0x27da7e)=>_0x1ef257[_0x1d7a7d(0xc8)][_0x1d7a7d(0xae)](_0x27da7e[_0x1d7a7d(0xc8)]));await handleSDKOutput(_0x25c9c9,_0x469930);}else{if(_0x26e18a===0x0)console[_0x1d7a7d(0xba)](a45_0xcbdf15['dim']('['+_0x543482+']')),console[_0x1d7a7d(0xba)](_0x1d7a7d(0xe5));else{console[_0x1d7a7d(0xba)](a45_0xcbdf15[_0x1d7a7d(0xda)]('['+_0x543482+']'));const _0x221ad1=formatFlatList(_0x4e6fd8,_0xfd36ae,{'showMetadata':!![],'getSegmentUrl':_0x58df67,'getJourneyUrl':_0x349f8a},_0xd6a53);console['log'](_0x221ad1);}}return 0x0;}async[a45_0x422d4e(0xc1)](_0x61b9d4,_0xf40c49){const _0x414716=a45_0x422d4e,{options:_0x324177,tdx:_0x1dce0a}=_0x61b9d4,_0x54f1bb=await withSpinner('Resolving\x20path\x20\x27'+_0xf40c49+'\x27...',()=>_0x1dce0a['segment']['resolvePathToResource'](_0xf40c49),{'verbose':_0x324177[_0x414716(0xc0)]}),_0x30a1f8=_0x54f1bb['data'];_0x324177[_0x414716(0xc0)]&&(console['error'](_0x414716(0xd0)+_0x30a1f8[_0x414716(0xb5)]),_0x30a1f8[_0x414716(0xcf)]&&console[_0x414716(0xcc)](_0x414716(0xb0)+_0x30a1f8['folderId']));const _0x1cf352=_0x324177[_0x414716(0xaa)]||0xa,_0x280d4b=await withSpinner(_0x414716(0xac),()=>_0x1dce0a[_0x414716(0xa1)][_0x414716(0xc1)](_0x30a1f8[_0x414716(0xb5)],_0x30a1f8['folderId'],0x0,_0x1cf352),{'verbose':_0x324177['verbose']}),_0x44186b=_0x280d4b[_0x414716(0xbc)],_0x452e0c=_0x4eceeb=>{const _0x322182=_0x414716;let _0x19dc16=0x0,_0x20fa1f=0x0,_0x1ddb5e=0x0;for(const _0x39c364 of _0x4eceeb){if(_0x39c364[_0x322182(0xc7)]===_0x322182(0x9d))_0x19dc16++;else{if(_0x39c364[_0x322182(0xc7)]===_0x322182(0xa1))_0x20fa1f++;else{if(_0x39c364[_0x322182(0xc7)]===_0x322182(0xd7))_0x1ddb5e++;}}if(_0x39c364[_0x322182(0xb2)]){const _0x3059fc=_0x452e0c(_0x39c364[_0x322182(0xb2)]);_0x19dc16+=_0x3059fc[_0x322182(0xe6)],_0x20fa1f+=_0x3059fc[_0x322182(0xa3)],_0x1ddb5e+=_0x3059fc[_0x322182(0xd4)];}}return{'folders':_0x19dc16,'segments':_0x20fa1f,'journeys':_0x1ddb5e};},_0xc21de5=_0x452e0c(_0x44186b);console[_0x414716(0xcc)](_0x414716(0xb9)+_0xc21de5['folders']+_0x414716(0xc4)+(_0xc21de5[_0x414716(0xe6)]!==0x1?'s':'')+',\x20'+_0xc21de5[_0x414716(0xa3)]+_0x414716(0xe1)+(_0xc21de5['segments']!==0x1?'s':'')+_0x414716(0xe7)+_0xc21de5[_0x414716(0xd4)]+'\x20journey'+(_0xc21de5['journeys']!==0x1?'s':''));const _0x3b04c3=_0x275a27=>{const _0x3386c5=_0x414716;return getConsoleNextUrl(_0x324177[_0x3386c5(0xd5)],_0x3386c5(0xa9)+_0x30a1f8[_0x3386c5(0xb5)]+'/e/'+_0x275a27);},_0x23b5b7=_0xe62707=>{const _0x250dad=_0x414716;return getConsoleNextUrl(_0x324177[_0x250dad(0xd5)],'/app/ps/'+_0x30a1f8['parentId']+'/e/'+_0xe62707+_0x250dad(0xde));};if(_0x324177[_0x414716(0xcb)]==='json'||_0x324177[_0x414716(0xcb)]===_0x414716(0xbb))await handleSDKOutput(_0x44186b,_0x324177);else{console[_0x414716(0xba)](a45_0xcbdf15[_0x414716(0xda)]('['+_0xf40c49+']'));const _0x2c5097=formatTree(_0x44186b,{'showMetadata':!![],'getSegmentUrl':_0x3b04c3,'getJourneyUrl':_0x23b5b7});console[_0x414716(0xba)](_0x2c5097);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x155ac3=a46_0x8b59;function a46_0x2254(){const _0x1e3b96=['Catalog:\x20','showTable','9433341oPznrr','verbose','site','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','3533202iYSHlu','✔\x20Retrieved\x20','671978KaeVbF','validate','args','5178685sDMJuc','\x20row','name','error','description','\x20from\x20','limit','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','show','message','20kVHxhI','2vzmLMw','Database:\x20','\x20\x20Cause:\x20','catalog','cause','Site:\x20','784923PLEDer','Error:\x20','Limit:\x20','query','database','2103983ExnuQl','8dvbmES','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','data','Querying\x20','965808OLeDYW'];a46_0x2254=function(){return _0x1e3b96;};return a46_0x2254();}function a46_0x8b59(_0x4c4598,_0x1467bb){_0x4c4598=_0x4c4598-0xcf;const _0x225459=a46_0x2254();let _0x8b59a4=_0x225459[_0x4c4598];return _0x8b59a4;}(function(_0x3baad0,_0xc9caf0){const _0xd7ae57=a46_0x8b59,_0x3763d3=_0x3baad0();while(!![]){try{const _0x37b758=-parseInt(_0xd7ae57(0xee))/0x1+-parseInt(_0xd7ae57(0xd3))/0x2*(-parseInt(_0xd7ae57(0xd9))/0x3)+parseInt(_0xd7ae57(0xe4))/0x4+-parseInt(_0xd7ae57(0xf1))/0x5+-parseInt(_0xd7ae57(0xec))/0x6+-parseInt(_0xd7ae57(0xde))/0x7*(-parseInt(_0xd7ae57(0xdf))/0x8)+parseInt(_0xd7ae57(0xe7))/0x9*(parseInt(_0xd7ae57(0xd2))/0xa);if(_0x37b758===_0xc9caf0)break;else _0x3763d3['push'](_0x3763d3['shift']());}catch(_0x3c7440){_0x3763d3['push'](_0x3763d3['shift']());}}}(a46_0x2254,0x934f2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x155ac3(0xf3)]=a46_0x155ac3(0xd0);[a46_0x155ac3(0xf5)]='Show\x20table\x20contents';async['execute'](_0x5d4892){const _0x162656=a46_0x155ac3;return this[_0x162656(0xe6)](_0x5d4892);}async[a46_0x155ac3(0xe6)](_0x1665aa){const _0x16f6cd=a46_0x155ac3,{options:_0x1c6c03,args:_0x501144,tdx:_0x4174a2}=_0x1665aa;let _0x4f02e8;try{_0x4f02e8=parseTableReference(_0x501144[0x0]);const _0x55d815=_0x1c6c03[_0x16f6cd(0xdd)];!_0x4f02e8['database']&&_0x55d815&&(_0x4f02e8['database']=_0x55d815);const _0x43ff6e=validateTableDescribeReference(_0x4f02e8);if(_0x43ff6e)return console[_0x16f6cd(0xf4)]('Error:\x20'+_0x43ff6e),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe0)),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe1)),console[_0x16f6cd(0xf4)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x6dad0a){return console[_0x16f6cd(0xf4)](_0x16f6cd(0xda)+_0x6dad0a[_0x16f6cd(0xd1)]),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe0)),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe1)),console[_0x16f6cd(0xf4)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x55eb7d=_0x4f02e8[_0x16f6cd(0xd6)],_0x57b7e8=_0x4f02e8[_0x16f6cd(0xdd)],_0x6c9910=_0x4f02e8['table'],_0x5788d7=resolveLimit(_0x1c6c03[_0x16f6cd(0xf7)],DEFAULT_DISPLAY_LIMIT);try{_0x1c6c03['verbose']&&(console[_0x16f6cd(0xf4)](_0x16f6cd(0xd8)+_0x1c6c03[_0x16f6cd(0xe9)]),_0x55eb7d&&console[_0x16f6cd(0xf4)](_0x16f6cd(0xe5)+_0x55eb7d),console[_0x16f6cd(0xf4)](_0x16f6cd(0xd4)+_0x57b7e8),console[_0x16f6cd(0xf4)]('Table:\x20'+_0x6c9910),console[_0x16f6cd(0xf4)](_0x16f6cd(0xdb)+_0x5788d7));const _0x4dcd69=_0x55eb7d?_0x55eb7d+'.'+_0x57b7e8+'.'+_0x6c9910:_0x57b7e8+'.'+_0x6c9910,_0x4ff296=await withSpinner(_0x16f6cd(0xe3)+_0x4dcd69+'...',()=>_0x4174a2[_0x16f6cd(0xdc)][_0x16f6cd(0xe6)](_0x57b7e8,_0x6c9910,_0x5788d7,_0x55eb7d),{'verbose':_0x1c6c03[_0x16f6cd(0xe8)]}),_0x21ed21=_0x4ff296[_0x16f6cd(0xe2)],_0xfbb4b3=_0x21ed21[_0x16f6cd(0xe2)];return _0xfbb4b3[_0x16f6cd(0xeb)]===0x0?console[_0x16f6cd(0xf4)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x16f6cd(0xf4)](_0x16f6cd(0xed)+_0xfbb4b3[_0x16f6cd(0xeb)]+_0x16f6cd(0xf2)+(_0xfbb4b3['length']!==0x1?'s':'')+_0x16f6cd(0xf6)+_0x4dcd69),await handleSDKOutput(_0xfbb4b3,_0x1c6c03),0x0;}catch(_0x126549){if(_0x126549 instanceof SDKError)return console[_0x16f6cd(0xf4)](_0x16f6cd(0xda)+_0x126549[_0x16f6cd(0xd1)]),_0x126549[_0x16f6cd(0xd7)]&&console['error'](_0x16f6cd(0xd5)+_0x126549[_0x16f6cd(0xd7)]),0x1;throw _0x126549;}}[a46_0x155ac3(0xef)](_0x3e2853){const _0x8850c4=a46_0x155ac3;if(_0x3e2853['args'][_0x8850c4(0xeb)]===0x0)return _0x8850c4(0xcf);if(_0x3e2853[_0x8850c4(0xf0)][_0x8850c4(0xeb)]>0x1)return _0x8850c4(0xea);return undefined;}}
1
+ function a46_0x3ef5(_0x111d0e,_0x18cc2a){_0x111d0e=_0x111d0e-0x13f;const _0x298708=a46_0x2987();let _0x3ef5cc=_0x298708[_0x111d0e];return _0x3ef5cc;}const a46_0x22d128=a46_0x3ef5;(function(_0x22cf56,_0x5a3277){const _0x4566f2=a46_0x3ef5,_0x41b806=_0x22cf56();while(!![]){try{const _0x1b371c=-parseInt(_0x4566f2(0x15f))/0x1+-parseInt(_0x4566f2(0x145))/0x2*(-parseInt(_0x4566f2(0x167))/0x3)+-parseInt(_0x4566f2(0x14e))/0x4+-parseInt(_0x4566f2(0x144))/0x5*(parseInt(_0x4566f2(0x150))/0x6)+parseInt(_0x4566f2(0x168))/0x7*(parseInt(_0x4566f2(0x143))/0x8)+parseInt(_0x4566f2(0x15c))/0x9*(-parseInt(_0x4566f2(0x158))/0xa)+parseInt(_0x4566f2(0x169))/0xb;if(_0x1b371c===_0x5a3277)break;else _0x41b806['push'](_0x41b806['shift']());}catch(_0x2562c6){_0x41b806['push'](_0x41b806['shift']());}}}(a46_0x2987,0x394fc));function a46_0x2987(){const _0x37e9f5=['Querying\x20','10mGBWoR','cause','\x20row','data','2217627TdpCuh','limit','query','142718FGdwPi','Usage:\x20tdx\x20show\x20<database.table>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Database:\x20','Site:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','message','66mNLlLp','7NvgcSm','2100428anFcKZ','validate','name','Error:\x20','...','2949712yoMhWQ','64805yyPHmD','7936McVZuS','catalog','length','database','execute','show','Table:\x20','verbose','showTable','40512ynObUG','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','6peaDVP','args','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','table','Show\x20table\x20contents','description','error'];a46_0x2987=function(){return _0x37e9f5;};return a46_0x2987();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x22d128(0x140)]=a46_0x22d128(0x14a);[a46_0x22d128(0x155)]=a46_0x22d128(0x154);async[a46_0x22d128(0x149)](_0x2f61ea){const _0x2c6c99=a46_0x22d128;return this[_0x2c6c99(0x14d)](_0x2f61ea);}async[a46_0x22d128(0x14d)](_0x38fc8f){const _0x178bdc=a46_0x22d128,{options:_0x45650f,args:_0xab2ef7,tdx:_0x59dc37}=_0x38fc8f;let _0x4d67b4;try{_0x4d67b4=parseTableReference(_0xab2ef7[0x0]);const _0x424cbd=_0x45650f[_0x178bdc(0x148)];!_0x4d67b4[_0x178bdc(0x148)]&&_0x424cbd&&(_0x4d67b4['database']=_0x424cbd);const _0x204a9c=validateTableDescribeReference(_0x4d67b4);if(_0x204a9c)return console[_0x178bdc(0x156)](_0x178bdc(0x141)+_0x204a9c),console[_0x178bdc(0x156)](_0x178bdc(0x160)),console[_0x178bdc(0x156)](_0x178bdc(0x14f)),console[_0x178bdc(0x156)](_0x178bdc(0x165)),0x1;}catch(_0x3e9900){return console[_0x178bdc(0x156)](_0x178bdc(0x141)+_0x3e9900[_0x178bdc(0x166)]),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console['error'](_0x178bdc(0x14f)),console[_0x178bdc(0x156)](_0x178bdc(0x165)),0x1;}const _0xd17a10=_0x4d67b4[_0x178bdc(0x146)],_0x488fd0=_0x4d67b4[_0x178bdc(0x148)],_0x53db89=_0x4d67b4[_0x178bdc(0x153)],_0x116ecb=resolveLimit(_0x45650f[_0x178bdc(0x15d)],DEFAULT_DISPLAY_LIMIT);try{_0x45650f['verbose']&&(console[_0x178bdc(0x156)](_0x178bdc(0x163)+_0x45650f['site']),_0xd17a10&&console['error']('Catalog:\x20'+_0xd17a10),console[_0x178bdc(0x156)](_0x178bdc(0x162)+_0x488fd0),console[_0x178bdc(0x156)](_0x178bdc(0x14b)+_0x53db89),console['error']('Limit:\x20'+_0x116ecb));const _0x25b04f=_0xd17a10?_0xd17a10+'.'+_0x488fd0+'.'+_0x53db89:_0x488fd0+'.'+_0x53db89,_0x39f748=await withSpinner(_0x178bdc(0x157)+_0x25b04f+_0x178bdc(0x142),()=>_0x59dc37[_0x178bdc(0x15e)][_0x178bdc(0x14d)](_0x488fd0,_0x53db89,_0x116ecb,_0xd17a10),{'verbose':_0x45650f[_0x178bdc(0x14c)]}),_0x48275d=_0x39f748[_0x178bdc(0x15b)],_0x5b919e=_0x48275d[_0x178bdc(0x15b)];return _0x5b919e[_0x178bdc(0x147)]===0x0?console[_0x178bdc(0x156)](_0x178bdc(0x164)):console[_0x178bdc(0x156)]('✔\x20Retrieved\x20'+_0x5b919e[_0x178bdc(0x147)]+_0x178bdc(0x15a)+(_0x5b919e[_0x178bdc(0x147)]!==0x1?'s':'')+'\x20from\x20'+_0x25b04f),await handleSDKOutput(_0x5b919e,_0x45650f),0x0;}catch(_0x2d3307){if(_0x2d3307 instanceof SDKError)return console[_0x178bdc(0x156)](_0x178bdc(0x141)+_0x2d3307[_0x178bdc(0x166)]),_0x2d3307[_0x178bdc(0x159)]&&console[_0x178bdc(0x156)]('\x20\x20Cause:\x20'+_0x2d3307['cause']),0x1;throw _0x2d3307;}}[a46_0x22d128(0x13f)](_0x2f8d94){const _0x129ffb=a46_0x22d128;if(_0x2f8d94['args'][_0x129ffb(0x147)]===0x0)return _0x129ffb(0x152);if(_0x2f8d94[_0x129ffb(0x151)][_0x129ffb(0x147)]>0x1)return _0x129ffb(0x161);return undefined;}}
@@ -1 +1 @@
1
- function a47_0x413c(_0x260386,_0x2c6561){_0x260386=_0x260386-0xf7;const _0x503aea=a47_0x503a();let _0x413cef=_0x503aea[_0x260386];return _0x413cef;}const a47_0x1f5950=a47_0x413c;(function(_0x4dc3fb,_0x48d836){const _0x243a2e=a47_0x413c,_0x4b3e50=_0x4dc3fb();while(!![]){try{const _0x180cc7=-parseInt(_0x243a2e(0x109))/0x1+parseInt(_0x243a2e(0xfc))/0x2+parseInt(_0x243a2e(0x114))/0x3+parseInt(_0x243a2e(0x103))/0x4*(-parseInt(_0x243a2e(0x11b))/0x5)+-parseInt(_0x243a2e(0x100))/0x6*(parseInt(_0x243a2e(0x111))/0x7)+parseInt(_0x243a2e(0x10c))/0x8+-parseInt(_0x243a2e(0x118))/0x9*(parseInt(_0x243a2e(0x112))/0xa);if(_0x180cc7===_0x48d836)break;else _0x4b3e50['push'](_0x4b3e50['shift']());}catch(_0x147627){_0x4b3e50['push'](_0x4b3e50['shift']());}}}(a47_0x503a,0x852f3));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x503a(){const _0x687a09=['profile','5ildObN','tdx','cyan','error','displayWithSources','session','bold','No\x20credential\x20found','Credential\x20type:\x20','red','N/A','1702534RfSOAO','TDX_PROFILE\x20env','status','log','24wDLnkG','Show\x20authentication\x20status\x20and\x20current\x20context','yellow','2069876SqAUfR','filter','OAuth','site:\x20','description','account_id','475421FyazQY','getUserInfo','dim','5525416gXofAI','cli','name','env','last_name','522718OIHggA','80WuYUnT','first_name','2955543RyaQCY','config','✓\x20Authentication\x20successful\x0a','green','776268sYexTl','User:'];a47_0x503a=function(){return _0x687a09;};return a47_0x503a();}import a47_0x1999ba from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1f5950(0x10e)]=a47_0x1f5950(0xfe);[a47_0x1f5950(0x107)]=a47_0x1f5950(0x101);async['execute'](_0x13426e){const _0x17f400=a47_0x1f5950,{options:_0x44a32,tdx:_0x12bd46}=_0x13426e,_0x27a751=_0x44a32['site'],_0x1b66f8=new GlobalContext(_0x44a32),_0x57301d=_0x1b66f8[_0x17f400(0x11a)],_0x532537=_0x1b66f8['profileSource'],_0x2fa5f8=_0x532537===_0x17f400(0x10d)?'CLI\x20flag':_0x532537===_0x17f400(0x120)?_0x17f400(0x120):_0x532537===_0x17f400(0x10f)?_0x17f400(0xfd):_0x532537==='config'?_0x17f400(0x115):null,_0x3d2f18=_0x57301d?a47_0x1999ba['cyan'](_0x57301d):a47_0x1999ba[_0x17f400(0x10b)](_0x17f400(0xfb)),_0x170ad5=_0x2fa5f8?'\x20'+a47_0x1999ba[_0x17f400(0x10b)]('(from\x20'+_0x2fa5f8+')'):'';console['log'](a47_0x1999ba[_0x17f400(0xf7)](_0x17f400(0x11c))+'\x20profile:\x20'+_0x3d2f18+_0x170ad5+'\x20'+a47_0x1999ba[_0x17f400(0x10b)]('(')+_0x17f400(0x106)+a47_0x1999ba[_0x17f400(0x11d)](_0x27a751)+a47_0x1999ba['dim'](')'));const _0x5184e8=await getOAuthTokens(_0x57301d);if(_0x5184e8)console[_0x17f400(0xff)](_0x17f400(0xf9)+a47_0x1999ba['cyan'](_0x17f400(0x105)));else{const _0x216e00=await resolveAPIKeyAsync(_0x27a751,_0x57301d);if(_0x216e00){const {source:_0x2007ba,isDeprecated:_0x1c34f6}=_0x216e00,_0x4608d2='Read\x20credential\x20from\x20'+a47_0x1999ba['cyan'](_0x2007ba);console[_0x17f400(0xff)](_0x1c34f6?a47_0x1999ba[_0x17f400(0x102)](_0x4608d2):_0x4608d2);}else console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0x102)](_0x17f400(0xf8)));}let _0x9e01fe=![];try{const _0x268e1d=await _0x12bd46['jobs'][_0x17f400(0x10a)]();console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0x117)](_0x17f400(0x116))),console['log'](a47_0x1999ba[_0x17f400(0xf7)](_0x17f400(0x119))+'\x20'+a47_0x1999ba[_0x17f400(0x11d)](_0x268e1d['email']));if(_0x268e1d[_0x17f400(0x113)]||_0x268e1d['last_name']){const _0x238b4b=[_0x268e1d[_0x17f400(0x113)],_0x268e1d[_0x17f400(0x110)]][_0x17f400(0x104)](Boolean)['join']('\x20');console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0xf7)]('Name:')+'\x20'+_0x238b4b);}_0x268e1d[_0x17f400(0x108)]&&console[_0x17f400(0xff)](a47_0x1999ba['bold']('Account\x20ID:')+'\x20'+a47_0x1999ba[_0x17f400(0x102)](_0x268e1d[_0x17f400(0x108)])),_0x9e01fe=!![];}catch(_0xbc0ba0){_0xbc0ba0 instanceof HTTPClientError&&_0xbc0ba0['status']===0x191?printAuthError(_0xbc0ba0,!![],_0x57301d):console[_0x17f400(0x11e)](a47_0x1999ba[_0x17f400(0xfa)]('✗\x20Validation\x20failed:\x20'+(_0xbc0ba0 instanceof Error?_0xbc0ba0['message']:String(_0xbc0ba0))));}return console[_0x17f400(0xff)](),_0x1b66f8[_0x17f400(0x11f)](),_0x9e01fe?0x0:0x1;}}
1
+ function a47_0x5c16(){const _0x433548=['env','2403176NwMyYt','profileSource','email','N/A','join','description','User:','site:\x20','profile','status','displayWithSources','last_name','Credential\x20type:\x20','yellow','green','config','2267736ySdIAl','TDX_PROFILE\x20env','getUserInfo','filter','574584CneyfY','Account\x20ID:','905DTOVsa','name','bold','CLI\x20flag','15163776mpWmBg','message','(from\x20','jobs','session','cli','tdx','dim','Read\x20credential\x20from\x20','3000305JgzLLu','3580IMemjT','first_name','cyan','5891767iPQUsY','log','✗\x20Validation\x20failed:\x20','\x20profile:\x20'];a47_0x5c16=function(){return _0x433548;};return a47_0x5c16();}const a47_0xa52181=a47_0x3ee2;(function(_0x6677aa,_0x174885){const _0xde3dc1=a47_0x3ee2,_0x19d19c=_0x6677aa();while(!![]){try{const _0x1be13a=parseInt(_0xde3dc1(0xa0))/0x1*(parseInt(_0xde3dc1(0xae))/0x2)+-parseInt(_0xde3dc1(0xc6))/0x3+parseInt(_0xde3dc1(0xb6))/0x4+parseInt(_0xde3dc1(0xad))/0x5+-parseInt(_0xde3dc1(0x9e))/0x6+parseInt(_0xde3dc1(0xb1))/0x7+-parseInt(_0xde3dc1(0xa4))/0x8;if(_0x1be13a===_0x174885)break;else _0x19d19c['push'](_0x19d19c['shift']());}catch(_0x1dca5d){_0x19d19c['push'](_0x19d19c['shift']());}}}(a47_0x5c16,0xdf78a));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x3ee2(_0x455048,_0x1ac0d3){_0x455048=_0x455048-0x9b;const _0x5c16d1=a47_0x5c16();let _0x3ee2bc=_0x5c16d1[_0x455048];return _0x3ee2bc;}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x3441f5 from'chalk';export class StatusCommand extends BaseCommand{[a47_0xa52181(0xa1)]='status';[a47_0xa52181(0xbb)]='Show\x20authentication\x20status\x20and\x20current\x20context';async['execute'](_0x232a79){const _0x1e5ee7=a47_0xa52181,{options:_0x3def89,tdx:_0xc329e6}=_0x232a79,_0x2a004e=_0x3def89['site'],_0xd744cb=new GlobalContext(_0x3def89),_0x4a0bd0=_0xd744cb[_0x1e5ee7(0xbe)],_0x76df3d=_0xd744cb[_0x1e5ee7(0xb7)],_0x1f36bc=_0x76df3d===_0x1e5ee7(0xa9)?_0x1e5ee7(0xa3):_0x76df3d===_0x1e5ee7(0xa8)?_0x1e5ee7(0xa8):_0x76df3d===_0x1e5ee7(0xb5)?_0x1e5ee7(0x9b):_0x76df3d===_0x1e5ee7(0xc5)?_0x1e5ee7(0xc5):null,_0x41f56d=_0x4a0bd0?a47_0x3441f5[_0x1e5ee7(0xb0)](_0x4a0bd0):a47_0x3441f5[_0x1e5ee7(0xab)](_0x1e5ee7(0xb9)),_0x29aa51=_0x1f36bc?'\x20'+a47_0x3441f5[_0x1e5ee7(0xab)](_0x1e5ee7(0xa6)+_0x1f36bc+')'):'';console['log'](a47_0x3441f5[_0x1e5ee7(0xa2)](_0x1e5ee7(0xaa))+_0x1e5ee7(0xb4)+_0x41f56d+_0x29aa51+'\x20'+a47_0x3441f5['dim']('(')+_0x1e5ee7(0xbd)+a47_0x3441f5[_0x1e5ee7(0xb0)](_0x2a004e)+a47_0x3441f5[_0x1e5ee7(0xab)](')'));const _0x581af6=await getOAuthTokens(_0x4a0bd0);if(_0x581af6)console[_0x1e5ee7(0xb2)](_0x1e5ee7(0xc2)+a47_0x3441f5[_0x1e5ee7(0xb0)]('OAuth'));else{const _0x57410f=await resolveAPIKeyAsync(_0x2a004e,_0x4a0bd0);if(_0x57410f){const {source:_0x3fdf9a,isDeprecated:_0x45d043}=_0x57410f,_0x2ccd35=_0x1e5ee7(0xac)+a47_0x3441f5[_0x1e5ee7(0xb0)](_0x3fdf9a);console['log'](_0x45d043?a47_0x3441f5[_0x1e5ee7(0xc3)](_0x2ccd35):_0x2ccd35);}else console[_0x1e5ee7(0xb2)](a47_0x3441f5['yellow']('No\x20credential\x20found'));}let _0x428485=![];try{const _0x5d8a30=await _0xc329e6[_0x1e5ee7(0xa7)][_0x1e5ee7(0x9c)]();console[_0x1e5ee7(0xb2)](a47_0x3441f5[_0x1e5ee7(0xc4)]('✓\x20Authentication\x20successful\x0a')),console[_0x1e5ee7(0xb2)](a47_0x3441f5[_0x1e5ee7(0xa2)](_0x1e5ee7(0xbc))+'\x20'+a47_0x3441f5['cyan'](_0x5d8a30[_0x1e5ee7(0xb8)]));if(_0x5d8a30[_0x1e5ee7(0xaf)]||_0x5d8a30['last_name']){const _0x4a61d5=[_0x5d8a30[_0x1e5ee7(0xaf)],_0x5d8a30[_0x1e5ee7(0xc1)]][_0x1e5ee7(0x9d)](Boolean)[_0x1e5ee7(0xba)]('\x20');console['log'](a47_0x3441f5[_0x1e5ee7(0xa2)]('Name:')+'\x20'+_0x4a61d5);}_0x5d8a30['account_id']&&console['log'](a47_0x3441f5[_0x1e5ee7(0xa2)](_0x1e5ee7(0x9f))+'\x20'+a47_0x3441f5[_0x1e5ee7(0xc3)](_0x5d8a30['account_id'])),_0x428485=!![];}catch(_0x1b0c54){_0x1b0c54 instanceof HTTPClientError&&_0x1b0c54[_0x1e5ee7(0xbf)]===0x191?printAuthError(_0x1b0c54,!![],_0x4a0bd0):console['error'](a47_0x3441f5['red'](_0x1e5ee7(0xb3)+(_0x1b0c54 instanceof Error?_0x1b0c54[_0x1e5ee7(0xa5)]:String(_0x1b0c54))));}return console[_0x1e5ee7(0xb2)](),_0xd744cb[_0x1e5ee7(0xc0)](),_0x428485?0x0:0x1;}}