@treasuredata/tdx 2026.4.4 → 2026.4.5

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 (231) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.d.ts +2 -0
  168. package/dist/sdk/types/workspace.d.ts.map +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.d.ts +5 -0
  184. package/dist/sdk/workspace/access-tracker.d.ts.map +1 -0
  185. package/dist/sdk/workspace/access-tracker.js +1 -0
  186. package/dist/sdk/workspace/access-tracker.js.map +1 -0
  187. package/dist/sdk/workspace/frontmatter.js +1 -1
  188. package/dist/sdk/workspace/git.d.ts +1 -1
  189. package/dist/sdk/workspace/git.d.ts.map +1 -1
  190. package/dist/sdk/workspace/git.js +1 -1
  191. package/dist/sdk/workspace/git.js.map +1 -1
  192. package/dist/sdk/workspace/index.d.ts +8 -0
  193. package/dist/sdk/workspace/index.d.ts.map +1 -1
  194. package/dist/sdk/workspace/index.js +1 -1
  195. package/dist/sdk/workspace/index.js.map +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/weekly.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x24eb11=a39_0xd74c;(function(_0x4f4626,_0x375188){const _0x4d8fcb=a39_0xd74c,_0x15c3fd=_0x4f4626();while(!![]){try{const _0x2b36e0=parseInt(_0x4d8fcb(0x112))/0x1+-parseInt(_0x4d8fcb(0x122))/0x2*(-parseInt(_0x4d8fcb(0x120))/0x3)+-parseInt(_0x4d8fcb(0x125))/0x4+-parseInt(_0x4d8fcb(0x11a))/0x5*(-parseInt(_0x4d8fcb(0x124))/0x6)+parseInt(_0x4d8fcb(0x121))/0x7+parseInt(_0x4d8fcb(0x129))/0x8*(-parseInt(_0x4d8fcb(0x123))/0x9)+parseInt(_0x4d8fcb(0x117))/0xa*(-parseInt(_0x4d8fcb(0x12a))/0xb);if(_0x2b36e0===_0x375188)break;else _0x15c3fd['push'](_0x15c3fd['shift']());}catch(_0x1b24d9){_0x15c3fd['push'](_0x15c3fd['shift']());}}}(a39_0x2314,0x226b9));function a39_0xd74c(_0x1b3e52,_0x376b8b){_0x1b3e52=_0x1b3e52-0x112;const _0x23145a=a39_0x2314();let _0xd74cea=_0x23145a[_0x1b3e52];return _0xd74cea;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a39_0x2314(){const _0x11be10=['parentSegment','json','5CzXnHi','length','segment:fields','data','segment','description','9jMWVvR','805035EhfHaL','106082WgtFZv','9pgiboW','1452804RHZLTW','567432MymoDF','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','Listing\x20fields\x20for\x20\x27','1440456camcBA','153307aNgzWb','List\x20available\x20fields\x20for\x20segmentation','Parent\x20segment:\x20','execute','58134iuxsVt','name','✔\x20Found\x20','verbose','error','80BJxTKr'];a39_0x2314=function(){return _0x11be10;};return a39_0x2314();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x24eb11(0x113)]=a39_0x24eb11(0x11c);[a39_0x24eb11(0x11f)]=a39_0x24eb11(0x12b);async[a39_0x24eb11(0x12d)](_0x293b9f){const _0x2660e6=a39_0x24eb11,{options:_0x43e9fe,args:_0x16cf6d,tdx:_0x57755c}=_0x293b9f,_0x4b291e=_0x16cf6d[0x0]||_0x43e9fe[_0x2660e6(0x118)];if(!_0x4b291e)return console[_0x2660e6(0x116)](_0x2660e6(0x126)),console[_0x2660e6(0x116)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x2660e6(0x116)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x43e9fe[_0x2660e6(0x115)]&&(console['error']('Site:\x20'+_0x43e9fe['site']),console[_0x2660e6(0x116)](_0x2660e6(0x12c)+_0x4b291e));const _0x1729b8=await withSpinner(_0x2660e6(0x128)+_0x4b291e+_0x2660e6(0x127),()=>_0x57755c[_0x2660e6(0x11e)]['listFields'](_0x4b291e),{'verbose':_0x43e9fe['verbose']}),_0x3a7a73=_0x1729b8[_0x2660e6(0x11d)];console['error'](_0x2660e6(0x114)+_0x3a7a73['length']+'\x20field'+(_0x3a7a73[_0x2660e6(0x11b)]!==0x1?'s':''));if(_0x43e9fe[_0x2660e6(0x119)]||_0x43e9fe['jsonl'])return await handleSDKOutput(_0x3a7a73,_0x43e9fe),0x0;return displayFieldsHumanReadable(_0x3a7a73,_0x4b291e),0x0;}}
1
+ function a39_0x3146(){const _0x503397=['Listing\x20fields\x20for\x20\x27','listFields','error','577143FCXfXU','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','verbose','✔\x20Found\x20','1605318wdVFYs','segment','776034qHjNEk','jsonl','description','List\x20available\x20fields\x20for\x20segmentation','Parent\x20segment:\x20','site','36TbaKPz','\x20field','\x27...','12oTiDTa','5182600TNosoW','length','segment:fields','Error:\x20Parent\x20segment\x20name\x20is\x20required','592053vqWOwf','365165vqcSrS','data','10273gdrXWo','json'];a39_0x3146=function(){return _0x503397;};return a39_0x3146();}function a39_0xcb72(_0xd34f04,_0x442a45){_0xd34f04=_0xd34f04-0x1d3;const _0x3146dd=a39_0x3146();let _0xcb72cc=_0x3146dd[_0xd34f04];return _0xcb72cc;}const a39_0x2c1827=a39_0xcb72;(function(_0x20a08e,_0x1db325){const _0x1c241f=a39_0xcb72,_0x57b4b7=_0x20a08e();while(!![]){try{const _0xa73cee=parseInt(_0x1c241f(0x1ea))/0x1+-parseInt(_0x1c241f(0x1d9))/0x2+parseInt(_0x1c241f(0x1d7))/0x3+parseInt(_0x1c241f(0x1df))/0x4*(parseInt(_0x1c241f(0x1e8))/0x5)+parseInt(_0x1c241f(0x1e2))/0x6*(parseInt(_0x1c241f(0x1e7))/0x7)+-parseInt(_0x1c241f(0x1e3))/0x8+parseInt(_0x1c241f(0x1d3))/0x9;if(_0xa73cee===_0x1db325)break;else _0x57b4b7['push'](_0x57b4b7['shift']());}catch(_0x47f4ae){_0x57b4b7['push'](_0x57b4b7['shift']());}}}(a39_0x3146,0x61af7));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a39_0x2c1827(0x1e5);[a39_0x2c1827(0x1db)]=a39_0x2c1827(0x1dc);async['execute'](_0xf636b1){const _0x210dd5=a39_0x2c1827,{options:_0x22facd,args:_0x1773ed,tdx:_0x339a9d}=_0xf636b1,_0xa56480=_0x1773ed[0x0]||_0x22facd['parentSegment'];if(!_0xa56480)return console[_0x210dd5(0x1ee)](_0x210dd5(0x1e6)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x210dd5(0x1ee)](_0x210dd5(0x1d4)),0x1;_0x22facd[_0x210dd5(0x1d5)]&&(console['error']('Site:\x20'+_0x22facd[_0x210dd5(0x1de)]),console[_0x210dd5(0x1ee)](_0x210dd5(0x1dd)+_0xa56480));const _0x123f68=await withSpinner(_0x210dd5(0x1ec)+_0xa56480+_0x210dd5(0x1e1),()=>_0x339a9d[_0x210dd5(0x1d8)][_0x210dd5(0x1ed)](_0xa56480),{'verbose':_0x22facd[_0x210dd5(0x1d5)]}),_0xdc1c0a=_0x123f68[_0x210dd5(0x1e9)];console[_0x210dd5(0x1ee)](_0x210dd5(0x1d6)+_0xdc1c0a[_0x210dd5(0x1e4)]+_0x210dd5(0x1e0)+(_0xdc1c0a[_0x210dd5(0x1e4)]!==0x1?'s':''));if(_0x22facd[_0x210dd5(0x1eb)]||_0x22facd[_0x210dd5(0x1da)])return await handleSDKOutput(_0xdc1c0a,_0x22facd),0x0;return displayFieldsHumanReadable(_0xdc1c0a,_0xa56480),0x0;}}
@@ -1 +1 @@
1
- const a40_0x42779b=a40_0x4b98;(function(_0x5caa72,_0x4c6e79){const _0x1bdefe=a40_0x4b98,_0x4e8a0c=_0x5caa72();while(!![]){try{const _0x2beb06=-parseInt(_0x1bdefe(0x1e1))/0x1+parseInt(_0x1bdefe(0x207))/0x2+-parseInt(_0x1bdefe(0x219))/0x3+-parseInt(_0x1bdefe(0x1e8))/0x4*(parseInt(_0x1bdefe(0x222))/0x5)+parseInt(_0x1bdefe(0x1fd))/0x6+-parseInt(_0x1bdefe(0x20b))/0x7*(-parseInt(_0x1bdefe(0x204))/0x8)+parseInt(_0x1bdefe(0x209))/0x9;if(_0x2beb06===_0x4c6e79)break;else _0x4e8a0c['push'](_0x4e8a0c['shift']());}catch(_0x185d88){_0x4e8a0c['push'](_0x4e8a0c['shift']());}}}(a40_0x5b09,0x914ad));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_0x2f071c from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x5b09(){const _0x3a83a=['\x20segments','name','pullSegments','isNew','red','no_parent','diff','\x20=\x20','Aborted.','yellow','\x20unchanged\x20files','utf-8','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','content','\x20journeys','\x20\x20🗺️\x20\x20','journeyVersions','yes','Error:\x20','5843340tAbLZN','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20files?','relativePath','dim','\x20with\x20','segment','989256RlJvLg','session','parent_segment','31438ekQyii','execute','11421846NPVEBO','✔\x20Pulled\x20','21KCqfrS','error','repeat','\x20versions)','Site:\x20','helpText','message','counts','\x0aError:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','description','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','hasChanges','\x20changed\x20files','2594994XijuuB','parentName','targetDir','dryRun','verbose','activations','segments','\x0aChanges\x20to\x20\x27','length','3695wzapPw','site','setPhase','green','resourceName','-\x20no\x20files\x20written','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)','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20new\x20files','cyan','journeys','parentSegment','\x20\x20🎯\x20','Target\x20resource:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','files','data','632306rNuiXx','absolutePath','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','✔\x20Context\x20set:\x20','cwd','filter','\x20files\x20to\x20','2908lqedPu','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation'];a40_0x5b09=function(){return _0x3a83a;};return a40_0x5b09();}import a40_0x18cfd0 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x4b98(_0x3f4d8c,_0x565c9f){_0x3f4d8c=_0x3f4d8c-0x1d8;const _0x5b0908=a40_0x5b09();let _0x4b988f=_0x5b0908[_0x3f4d8c];return _0x4b988f;}export class SegmentPullCommand extends BaseCommand{[a40_0x42779b(0x1eb)]='segment:pull';[a40_0x42779b(0x215)]=a40_0x42779b(0x1f6);async[a40_0x42779b(0x208)](_0x376330){const _0x3d1dc8=a40_0x42779b,{options:_0xed70be,args:_0xffa492,tdx:_0x45fa9e}=_0x376330,_0x369d1b=_0xed70be,_0xf7fbf2=await resolveTarget({'arg':_0xffa492[0x0],'contextParent':_0xed70be[_0x3d1dc8(0x1db)],'cwd':process[_0x3d1dc8(0x1e5)]()});if(!isSuccessfulResolution(_0xf7fbf2))return _0xf7fbf2['errorCode']===_0x3d1dc8(0x1ef)?(console['error'](a40_0x2f071c[_0x3d1dc8(0x1f3)](_0x3d1dc8(0x216))),console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x228)),console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x1fe)),console['error'](_0x3d1dc8(0x22a))):(console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x1ee)](_0x3d1dc8(0x1fc)+_0xf7fbf2[_0x3d1dc8(0x211)]+'\x0a')),_0xf7fbf2[_0x3d1dc8(0x210)]&&console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x1d9)](_0xf7fbf2[_0x3d1dc8(0x210)]))),0x1;const _0x4508ee=_0xf7fbf2[_0x3d1dc8(0x21a)],_0x7d5a5e=_0xf7fbf2[_0x3d1dc8(0x21b)],_0x167510=_0xf7fbf2['type']==='file'?_0xf7fbf2[_0x3d1dc8(0x226)]:undefined;_0x369d1b[_0x3d1dc8(0x21d)]&&(console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x20f)+_0x369d1b[_0x3d1dc8(0x223)]),console['error']('Parent\x20segment:\x20'+_0x4508ee),_0x167510&&console['error'](_0x3d1dc8(0x1dd)+_0x167510));const _0x1cf5e9=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4508ee+'\x27...',_0x35dc94=>_0x45fa9e[_0x3d1dc8(0x203)][_0x3d1dc8(0x1ec)](_0x4508ee,{'targetDir':_0x7d5a5e,'targetResourceName':_0x167510,'verbose':_0x369d1b[_0x3d1dc8(0x21d)],'progress':{'update':_0x487e66=>{const _0x4c9ac3=_0x3d1dc8;_0x35dc94[_0x4c9ac3(0x224)](_0x487e66),_0x369d1b[_0x4c9ac3(0x21d)]&&console[_0x4c9ac3(0x20c)]('\x20\x20'+_0x487e66);}}}),{'verbose':_0x369d1b[_0x3d1dc8(0x21d)]}),_0x4f2e69=_0x1cf5e9[_0x3d1dc8(0x1e0)];if(_0x4f2e69[_0x3d1dc8(0x212)][_0x3d1dc8(0x21f)]===0x0&&_0x4f2e69[_0x3d1dc8(0x212)][_0x3d1dc8(0x1da)]===0x0)return console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x1f3)](_0x3d1dc8(0x1e3)+_0x4f2e69[_0x3d1dc8(0x21a)]+'\x27')),0x0;const _0x290ca8=_0x4f2e69[_0x3d1dc8(0x1df)][_0x3d1dc8(0x1e6)](_0x339aac=>_0x339aac[_0x3d1dc8(0x1ed)]),_0x3441f3=_0x4f2e69['files'][_0x3d1dc8(0x1e6)](_0x4f0245=>!_0x4f0245[_0x3d1dc8(0x1ed)]&&_0x4f0245[_0x3d1dc8(0x217)]),_0x2c107d=_0x4f2e69[_0x3d1dc8(0x1df)][_0x3d1dc8(0x1e6)](_0x4fc41a=>!_0x4fc41a['isNew']&&!_0x4fc41a['hasChanges']);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x4f2e69[_0x3d1dc8(0x21a)]+'\x27:'),console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x1dc)+a40_0x2f071c[_0x3d1dc8(0x1d9)](_0x4f2e69[_0x3d1dc8(0x212)]['segments']+_0x3d1dc8(0x1ea))+_0x3d1dc8(0x202)+a40_0x2f071c[_0x3d1dc8(0x1d9)](_0x4f2e69['counts'][_0x3d1dc8(0x21e)]+'\x20activations'));if(_0x4f2e69[_0x3d1dc8(0x212)][_0x3d1dc8(0x1da)]>0x0){const _0x14eb11=_0x4f2e69['counts'][_0x3d1dc8(0x1fa)]>_0x4f2e69[_0x3d1dc8(0x212)]['journeys']?'\x20('+_0x4f2e69['counts'][_0x3d1dc8(0x1fa)]+_0x3d1dc8(0x20e):'';console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x1f9)+a40_0x2f071c[_0x3d1dc8(0x1d9)](_0x4f2e69[_0x3d1dc8(0x212)][_0x3d1dc8(0x1da)]+_0x3d1dc8(0x1f8))+a40_0x2f071c[_0x3d1dc8(0x201)](_0x14eb11));}console[_0x3d1dc8(0x20c)]('\x20\x20'+a40_0x2f071c['green']('+\x20'+_0x290ca8['length']+_0x3d1dc8(0x1d8))),console[_0x3d1dc8(0x20c)]('\x20\x20'+a40_0x2f071c[_0x3d1dc8(0x1f3)]('~\x20'+_0x3441f3[_0x3d1dc8(0x221)]+_0x3d1dc8(0x218))),console[_0x3d1dc8(0x20c)]('\x20\x20'+a40_0x2f071c[_0x3d1dc8(0x201)]('=\x20'+_0x2c107d['length']+_0x3d1dc8(0x1f4))),console[_0x3d1dc8(0x20c)]('\x20\x20Target:\x20'+a40_0x2f071c['cyan'](_0x4f2e69[_0x3d1dc8(0x21b)])+'\x0a');if(_0x3441f3['length']>0x0)for(const _0x33206b of _0x3441f3){console['error'](_0x3d1dc8(0x220)+_0x33206b[_0x3d1dc8(0x200)]+'\x27:'),console[_0x3d1dc8(0x20c)]('─'['repeat'](0x3c)),console[_0x3d1dc8(0x20c)](_0x33206b[_0x3d1dc8(0x1f0)]),console['error']('─'[_0x3d1dc8(0x20d)](0x3c));}if(_0x369d1b[_0x3d1dc8(0x21c)])return console[_0x3d1dc8(0x20c)](a40_0x2f071c['yellow'](_0x3d1dc8(0x229))),0x0;if(_0x290ca8[_0x3d1dc8(0x221)]===0x0&&_0x3441f3[_0x3d1dc8(0x221)]===0x0)return console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x225)](_0x3d1dc8(0x1de))),saveSessionContext({'parent_segment':_0x4f2e69[_0x3d1dc8(0x21a)]},_0x369d1b[_0x3d1dc8(0x205)]),console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x225)](_0x3d1dc8(0x1e4)+a40_0x2f071c[_0x3d1dc8(0x201)](_0x3d1dc8(0x206))+_0x3d1dc8(0x1f1)+a40_0x2f071c['cyan'](_0x4f2e69['parentName']))),0x0;if(!_0x369d1b[_0x3d1dc8(0x1fb)]){if(!isInteractive())return console['error'](a40_0x2f071c[_0x3d1dc8(0x1ee)](_0x3d1dc8(0x213)),_0x3d1dc8(0x214)),console['error'](a40_0x2f071c['dim'](_0x3d1dc8(0x1e9))),0x1;const _0x32372a=await confirmKey('Write\x20'+(_0x290ca8[_0x3d1dc8(0x221)]+_0x3441f3[_0x3d1dc8(0x221)])+_0x3d1dc8(0x1ff));if(!_0x32372a)return console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x1f3)](_0x3d1dc8(0x1f2)),_0x3d1dc8(0x227)),0x1;}for(const _0x1aa6f4 of _0x4f2e69['files']){if(_0x1aa6f4[_0x3d1dc8(0x1ed)]||_0x1aa6f4[_0x3d1dc8(0x217)]){const _0x512bbe=a40_0x18cfd0['dirname'](_0x1aa6f4[_0x3d1dc8(0x1e2)]);!existsSync(_0x512bbe)&&mkdirSync(_0x512bbe,{'recursive':!![]}),writeFileSync(_0x1aa6f4[_0x3d1dc8(0x1e2)],_0x1aa6f4[_0x3d1dc8(0x1f7)],_0x3d1dc8(0x1f5));}}return console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x225)](_0x3d1dc8(0x20a)+(_0x290ca8[_0x3d1dc8(0x221)]+_0x3441f3[_0x3d1dc8(0x221)])+_0x3d1dc8(0x1e7)+_0x4f2e69['targetDir'])),saveSessionContext({'parent_segment':_0x4f2e69[_0x3d1dc8(0x21a)]},_0x369d1b[_0x3d1dc8(0x205)]),console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x225)](_0x3d1dc8(0x1e4)+a40_0x2f071c[_0x3d1dc8(0x201)]('parent_segment')+'\x20=\x20'+a40_0x2f071c[_0x3d1dc8(0x1d9)](_0x4f2e69['parentName']))),0x0;}}
1
+ const a40_0x454dcb=a40_0x53e1;(function(_0x306df8,_0x890643){const _0x4bf28a=a40_0x53e1,_0x3117f6=_0x306df8();while(!![]){try{const _0x3778e0=parseInt(_0x4bf28a(0x1c6))/0x1*(-parseInt(_0x4bf28a(0x1f5))/0x2)+-parseInt(_0x4bf28a(0x1df))/0x3*(parseInt(_0x4bf28a(0x1ef))/0x4)+-parseInt(_0x4bf28a(0x1cc))/0x5*(-parseInt(_0x4bf28a(0x1c4))/0x6)+parseInt(_0x4bf28a(0x1e3))/0x7*(-parseInt(_0x4bf28a(0x1dd))/0x8)+-parseInt(_0x4bf28a(0x1c2))/0x9+-parseInt(_0x4bf28a(0x1ca))/0xa*(-parseInt(_0x4bf28a(0x1da))/0xb)+parseInt(_0x4bf28a(0x1f8))/0xc;if(_0x3778e0===_0x890643)break;else _0x3117f6['push'](_0x3117f6['shift']());}catch(_0x5070d2){_0x3117f6['push'](_0x3117f6['shift']());}}}(a40_0x513b,0x68e6a));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_0x2761ce from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x27bd1a from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x53e1(_0x127374,_0x43999c){_0x127374=_0x127374-0x1bd;const _0x513bce=a40_0x513b();let _0x53e149=_0x513bce[_0x127374];return _0x53e149;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x454dcb(0x1f2)]=a40_0x454dcb(0x1c9);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x454dcb(0x205)](_0xa18c4e){const _0xfc9541=a40_0x454dcb,{options:_0x252fed,args:_0x1b8abd,tdx:_0x53b3e6}=_0xa18c4e,_0xe394a4=_0x252fed,_0x296230=await resolveTarget({'arg':_0x1b8abd[0x0],'contextParent':_0x252fed['parentSegment'],'cwd':process[_0xfc9541(0x1fd)]()});if(!isSuccessfulResolution(_0x296230))return _0x296230[_0xfc9541(0x1e7)]==='no_parent'?(console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1e0)](_0xfc9541(0x1f7))),console[_0xfc9541(0x1d3)](_0xfc9541(0x1ee)),console[_0xfc9541(0x1d3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0xfc9541(0x1d3)](_0xfc9541(0x1d5))):(console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1e2)](_0xfc9541(0x201)+_0x296230['message']+'\x0a')),_0x296230[_0xfc9541(0x209)]&&console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1ff)](_0x296230[_0xfc9541(0x209)]))),0x1;const _0x396100=_0x296230['parentName'],_0x1ad6de=_0x296230[_0xfc9541(0x1fa)],_0x32dd8f=_0x296230[_0xfc9541(0x1c8)]===_0xfc9541(0x1ed)?_0x296230[_0xfc9541(0x206)]:undefined;_0xe394a4[_0xfc9541(0x1eb)]&&(console['error'](_0xfc9541(0x1e1)+_0xe394a4[_0xfc9541(0x1ce)]),console['error']('Parent\x20segment:\x20'+_0x396100),_0x32dd8f&&console[_0xfc9541(0x1d3)]('Target\x20resource:\x20'+_0x32dd8f));const _0x2b4d2e=await withProgressSpinner(_0xfc9541(0x1fb)+_0x396100+_0xfc9541(0x1e9),_0x10a5cc=>_0x53b3e6[_0xfc9541(0x1db)][_0xfc9541(0x1f4)](_0x396100,{'targetDir':_0x1ad6de,'targetResourceName':_0x32dd8f,'verbose':_0xe394a4[_0xfc9541(0x1eb)],'progress':{'update':_0x1a24a3=>{const _0x3fd2cf=_0xfc9541;_0x10a5cc[_0x3fd2cf(0x1d1)](_0x1a24a3),_0xe394a4['verbose']&&console[_0x3fd2cf(0x1d3)]('\x20\x20'+_0x1a24a3);}}}),{'verbose':_0xe394a4[_0xfc9541(0x1eb)]}),_0x1c8f42=_0x2b4d2e[_0xfc9541(0x1be)];if(_0x1c8f42['counts'][_0xfc9541(0x1c0)]===0x0&&_0x1c8f42[_0xfc9541(0x1d2)][_0xfc9541(0x1d0)]===0x0)return console[_0xfc9541(0x1d3)](a40_0x2761ce['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x1c8f42[_0xfc9541(0x200)]+'\x27')),0x0;const _0x4374be=_0x1c8f42[_0xfc9541(0x204)]['filter'](_0x48797b=>_0x48797b[_0xfc9541(0x1fc)]),_0x4253c0=_0x1c8f42['files'][_0xfc9541(0x1cd)](_0x259b49=>!_0x259b49['isNew']&&_0x259b49['hasChanges']),_0x443877=_0x1c8f42[_0xfc9541(0x204)][_0xfc9541(0x1cd)](_0x1f2281=>!_0x1f2281['isNew']&&!_0x1f2281[_0xfc9541(0x1f0)]);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x1c8f42[_0xfc9541(0x200)]+'\x27:'),console['error'](_0xfc9541(0x207)+a40_0x2761ce[_0xfc9541(0x1ff)](_0x1c8f42['counts'][_0xfc9541(0x1c0)]+'\x20segments')+'\x20with\x20'+a40_0x2761ce[_0xfc9541(0x1ff)](_0x1c8f42[_0xfc9541(0x1d2)][_0xfc9541(0x1c7)]+_0xfc9541(0x1bf)));if(_0x1c8f42[_0xfc9541(0x1d2)][_0xfc9541(0x1d0)]>0x0){const _0x4f4f06=_0x1c8f42[_0xfc9541(0x1d2)]['journeyVersions']>_0x1c8f42[_0xfc9541(0x1d2)]['journeys']?'\x20('+_0x1c8f42[_0xfc9541(0x1d2)]['journeyVersions']+_0xfc9541(0x1fe):'';console['error'](_0xfc9541(0x1cb)+a40_0x2761ce['cyan'](_0x1c8f42['counts'][_0xfc9541(0x1d0)]+_0xfc9541(0x1bd))+a40_0x2761ce[_0xfc9541(0x1e6)](_0x4f4f06));}console[_0xfc9541(0x1d3)]('\x20\x20'+a40_0x2761ce[_0xfc9541(0x1d8)]('+\x20'+_0x4374be[_0xfc9541(0x1f6)]+'\x20new\x20files')),console[_0xfc9541(0x1d3)]('\x20\x20'+a40_0x2761ce[_0xfc9541(0x1e0)]('~\x20'+_0x4253c0[_0xfc9541(0x1f6)]+'\x20changed\x20files')),console['error']('\x20\x20'+a40_0x2761ce[_0xfc9541(0x1e6)]('=\x20'+_0x443877[_0xfc9541(0x1f6)]+_0xfc9541(0x1f9))),console[_0xfc9541(0x1d3)]('\x20\x20Target:\x20'+a40_0x2761ce['cyan'](_0x1c8f42[_0xfc9541(0x1fa)])+'\x0a');if(_0x4253c0['length']>0x0)for(const _0x26a230 of _0x4253c0){console['error']('\x0aChanges\x20to\x20\x27'+_0x26a230[_0xfc9541(0x1de)]+'\x27:'),console[_0xfc9541(0x1d3)]('─'[_0xfc9541(0x203)](0x3c)),console[_0xfc9541(0x1d3)](_0x26a230['diff']),console[_0xfc9541(0x1d3)]('─'[_0xfc9541(0x203)](0x3c));}if(_0xe394a4[_0xfc9541(0x1ec)])return console['error'](a40_0x2761ce[_0xfc9541(0x1e0)](_0xfc9541(0x1cf))),0x0;if(_0x4374be['length']===0x0&&_0x4253c0[_0xfc9541(0x1f6)]===0x0)return console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1d8)](_0xfc9541(0x1d9))),saveSessionContext({'parent_segment':_0x1c8f42['parentName']},_0xe394a4['session']),console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1d8)](_0xfc9541(0x1ea)+a40_0x2761ce['dim'](_0xfc9541(0x1d6))+_0xfc9541(0x1d4)+a40_0x2761ce['cyan'](_0x1c8f42[_0xfc9541(0x200)]))),0x0;if(!_0xe394a4[_0xfc9541(0x1f3)]){if(!isInteractive())return console[_0xfc9541(0x1d3)](a40_0x2761ce['red'](_0xfc9541(0x1c5)),_0xfc9541(0x202)),console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1e6)](_0xfc9541(0x1d7))),0x1;const _0x178fd7=await confirmKey(_0xfc9541(0x1c1)+(_0x4374be[_0xfc9541(0x1f6)]+_0x4253c0[_0xfc9541(0x1f6)])+_0xfc9541(0x1c3));if(!_0x178fd7)return console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1e0)](_0xfc9541(0x1e4)),'-\x20no\x20files\x20written'),0x1;}for(const _0x52b9ad of _0x1c8f42['files']){if(_0x52b9ad[_0xfc9541(0x1fc)]||_0x52b9ad[_0xfc9541(0x1f0)]){const _0x3209d1=a40_0x27bd1a['dirname'](_0x52b9ad[_0xfc9541(0x1e8)]);!existsSync(_0x3209d1)&&mkdirSync(_0x3209d1,{'recursive':!![]}),writeFileSync(_0x52b9ad[_0xfc9541(0x1e8)],_0x52b9ad[_0xfc9541(0x1dc)],_0xfc9541(0x208));}}return console['error'](a40_0x2761ce['green']('✔\x20Pulled\x20'+(_0x4374be['length']+_0x4253c0[_0xfc9541(0x1f6)])+_0xfc9541(0x1e5)+_0x1c8f42[_0xfc9541(0x1fa)])),saveSessionContext({'parent_segment':_0x1c8f42['parentName']},_0xe394a4[_0xfc9541(0x1f1)]),console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1d8)]('✔\x20Context\x20set:\x20'+a40_0x2761ce['dim']('parent_segment')+_0xfc9541(0x1d4)+a40_0x2761ce['cyan'](_0x1c8f42['parentName']))),0x0;}}function a40_0x513b(){const _0x39f22c=['\x20files\x20to\x20','dim','errorCode','absolutePath','\x27...','✔\x20Context\x20set:\x20','verbose','dryRun','file','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)','483588YuYnRV','hasChanges','session','name','yes','pullSegments','2KBsIlS','length','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','14853888kTICSW','\x20unchanged\x20files','targetDir','Pulling\x20segments\x20from\x20\x27','isNew','cwd','\x20versions)','cyan','parentName','Error:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','repeat','files','execute','resourceName','\x20\x20🎯\x20','utf-8','helpText','\x20journeys','data','\x20activations','segments','Write\x20','2509191ucuLHA','\x20files?','1443738eBTtVI','\x0aError:','479485KhXILe','activations','type','segment:pull','10UsremE','\x20\x20🗺️\x20\x20','5pLFRHt','filter','site','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journeys','setPhase','counts','error','\x20=\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parent_segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','✔\x20All\x20files\x20are\x20up\x20to\x20date','7326517ArESRp','segment','content','2128cwcSwP','relativePath','18DaTCZT','yellow','Site:\x20','red','6083BZKrlD','Aborted.'];a40_0x513b=function(){return _0x39f22c;};return a40_0x513b();}
@@ -1 +1 @@
1
- const a41_0xd7865d=a41_0x5566;(function(_0x15b817,_0x16eef4){const _0x480be9=a41_0x5566,_0x2717d6=_0x15b817();while(!![]){try{const _0x1e853a=-parseInt(_0x480be9(0x1b1))/0x1*(-parseInt(_0x480be9(0x178))/0x2)+-parseInt(_0x480be9(0x18c))/0x3+-parseInt(_0x480be9(0x16f))/0x4+parseInt(_0x480be9(0x1df))/0x5+parseInt(_0x480be9(0x18d))/0x6+-parseInt(_0x480be9(0x1af))/0x7+parseInt(_0x480be9(0x171))/0x8;if(_0x1e853a===_0x16eef4)break;else _0x2717d6['push'](_0x2717d6['shift']());}catch(_0x26a330){_0x2717d6['push'](_0x2717d6['shift']());}}}(a41_0x4688,0x689b8));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a41_0x4688(){const _0x30726e=['listSegments','2963093rXNMrW','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','226121vFBmxL','isNew','error','endsWith','listJourneysWithDetailsFromParentSegment','map','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','idToName','\x20\x20Source:\x20','nameToType','listFolders','Folders\x20to\x20create:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','site','get','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','No\x20','filter','getJourney','segmentFolderId','parentSegment','parent_name','message','type','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Delete\x20journey:','join','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','execute','segment','set','\x20updated','attributes','length','existingJourney','\x20\x20🗺️\x20\x20Journeys:','blue','journeys','journeyId','\x0a✔\x20Push\x20complete','yamlConfig','\x20to\x20delete','listActivations','329860hUHTMP','/app/ps/','red','Parent\x20segment:\x20','New\x20journey:','journey','unchanged','\x27...','dryRun','\x20\x20Segments:\x20','Resolving\x20parent\x20segment\x20\x27','push','filePath','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','green','resolveParentId','\x20created','Error:\x20','cwd','(Journey\x20will\x20be\x20deleted)','\x0aValidation\x20failed:','\x20\x20Activations:\x20','segment\x20or\x20journey','toCreate','/e/','toString','.yaml','new','\x20folders\x20to\x20create','\x20activations]','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','diff','versionNumber','\x0aError:','folders','Fetching\x20existing\x20data...','.yml','nameToId','journeyBundleName','📁\x20','connection','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20deleted','targetDir','Push\x20','Site:\x20','1402996YEzGmA','\x20YAML\x20files\x20found','7069896LEKTwJ','then','parentFolder','changed','toDelete','existingSegment','name','2npTXvv','journeysOnly','all','\x20\x20Journeys:\x20','segments','\x0aPush\x20summary\x20for\x20\x27','yellow','updated','folderId','Changes\x20to\x20journey:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20new','audienceId','Preparing\x20journeys...','no_parent','description','repeat','helpText','createdAt','created','674502jJXGxe','1509144GXNKFp','\x20changes?','errorCode','\x20\x20📊\x20Segments:','New\x20segment:','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','results','data','folderPath','/j/da/je','file','Changes\x20to:','activations','isScoped','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20unchanged','dim','createdSegmentIds','relationships','toUpdate','verbose','/sb/da/esr','\x20\x20\x20\x20','state','delete','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20existing\x20activations...','add','\x20changed','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','buildUserMaps','\x20\x20Activations:','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a41_0x4688=function(){return _0x30726e;};return a41_0x4688();}import a41_0x1166f8 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';function a41_0x5566(_0x476f36,_0x5cf0fe){_0x476f36=_0x476f36-0x14b;const _0x4688f9=a41_0x4688();let _0x55663d=_0x4688f9[_0x476f36];return _0x55663d;}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_0xd7865d(0x177)]='segment:push';['description']=a41_0xd7865d(0x15f);async[a41_0xd7865d(0x1d0)](_0x398a32){const _0x48062a=a41_0xd7865d,{options:_0x57b848,args:_0x2d0f2e,tdx:_0x3e083f}=_0x398a32,_0x27fd8d=_0x57b848,_0x5bbf09=await resolveTarget({'arg':_0x2d0f2e[0x0],'contextParent':_0x57b848[_0x48062a(0x1c7)],'cwd':process[_0x48062a(0x153)]()});if(!isSuccessfulResolution(_0x5bbf09))return _0x5bbf09[_0x48062a(0x18f)]===_0x48062a(0x186)?(console['error'](a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x1bd))),console[_0x48062a(0x1b3)](_0x48062a(0x1b7)),console[_0x48062a(0x1b3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x48062a(0x1b3)](_0x48062a(0x1cc))):(console['error'](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x152)+_0x5bbf09[_0x48062a(0x1c9)]+'\x0a')),_0x5bbf09[_0x48062a(0x189)]&&console['error'](a41_0x1166f8[_0x48062a(0x1c0)](_0x5bbf09[_0x48062a(0x189)]))),0x1;if(_0x5bbf09[_0x48062a(0x1ca)]===_0x48062a(0x1c8))return console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x1a6)+_0x5bbf09[_0x48062a(0x16c)]+'\x0a')),console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1c0)](_0x48062a(0x1c1))),0x1;const _0x386efd=_0x5bbf09[_0x48062a(0x1cb)],_0x953c20=_0x5bbf09[_0x48062a(0x16c)],_0x2561be=_0x5bbf09[_0x48062a(0x1ca)]===_0x48062a(0x197)?_0x5bbf09[_0x48062a(0x14d)]:undefined,_0x35d127=getScopedDetails(_0x5bbf09),_0x7d4a6c=_0x35d127?.[_0x48062a(0x19a)]??![],_0x32b939=_0x35d127?.['scopedFolderPath']??'';if(!existsSync(_0x953c20))return console['error'](a41_0x1166f8[_0x48062a(0x1e1)]('Error:\x20Directory\x20not\x20found:\x20'+_0x953c20+'\x0a')),console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1c0)](_0x48062a(0x1c1))),0x1;_0x27fd8d['verbose']&&(console[_0x48062a(0x1b3)](_0x48062a(0x16e)+_0x27fd8d[_0x48062a(0x1be)]),console[_0x48062a(0x1b3)](_0x48062a(0x1e2)+_0x386efd),console[_0x48062a(0x1b3)]('Source\x20directory:\x20'+_0x953c20),_0x7d4a6c&&console[_0x48062a(0x1b3)]('Scoped\x20to\x20folder:\x20'+_0x32b939));const _0x4412bf=await withSpinner(_0x48062a(0x14b)+_0x386efd+_0x48062a(0x1e6),()=>_0x3e083f[_0x48062a(0x1d1)][_0x48062a(0x150)](_0x386efd),{'verbose':_0x27fd8d[_0x48062a(0x1a1)]}),_0x47c6d9=_0x4412bf['data'],{parentSegmentResult:_0x1ae2ae,segmentsResult:_0x3e883a,foldersResult:_0xedf463,journeysWithDetailsResult:_0x1ccb2b,userMaps:_0x3deed7}=await withSpinner(_0x48062a(0x164),async()=>{const _0x181058=_0x48062a,[_0x1c4ad9,_0x72605a,_0x350b5c,_0x29bf99,_0xeb0210]=await Promise['all']([_0x3e083f[_0x181058(0x1d1)]['getParent'](_0x47c6d9),_0x3e083f['segment'][_0x181058(0x1ae)](_0x47c6d9),_0x3e083f[_0x181058(0x1d1)][_0x181058(0x1bb)](_0x47c6d9),_0x3e083f[_0x181058(0x1e4)][_0x181058(0x1b5)](_0x47c6d9,{'includeAllVersions':!![]}),_0x3e083f['user'][_0x181058(0x1ab)]()]);return{'parentSegmentResult':_0x1c4ad9,'segmentsResult':_0x72605a,'foldersResult':_0x350b5c,'journeysWithDetailsResult':_0x29bf99,'userMaps':_0xeb0210};},{'verbose':_0x27fd8d['verbose']})[_0x48062a(0x172)](_0xd0b4bb=>_0xd0b4bb['data']),_0x49c17d=_0x1ae2ae,_0x408201=extractRootFolderId(_0x49c17d),_0xb985c9=_0x3e883a,_0x1f65dc=_0xedf463,{journeys:_0x479dcf,activationStepsById:_0x127b78}=_0x1ccb2b,_0x5d7d27=new Map(_0x479dcf[_0x48062a(0x1b6)](_0x2cef0f=>[_0x2cef0f['id'],_0x2cef0f])),_0x3b30c5=_0x479dcf[_0x48062a(0x1b6)](_0x54e0a5=>({'id':_0x54e0a5['id'],'name':_0x54e0a5[_0x48062a(0x1d4)]['name'],'journeyBundleName':_0x54e0a5[_0x48062a(0x1d4)][_0x48062a(0x167)]||'','journeyBundleId':_0x54e0a5[_0x48062a(0x1d4)]['journeyBundleId']||'','versionNumber':_0x54e0a5['attributes'][_0x48062a(0x161)],'description':_0x54e0a5[_0x48062a(0x1d4)][_0x48062a(0x187)],'state':_0x54e0a5[_0x48062a(0x1d4)][_0x48062a(0x1a4)],'paused':_0x54e0a5['attributes']['paused'],'audienceId':_0x54e0a5[_0x48062a(0x1d4)][_0x48062a(0x184)],'folderId':_0x54e0a5[_0x48062a(0x19f)]?.[_0x48062a(0x173)]?.[_0x48062a(0x194)]?.['id'],'createdAt':_0x54e0a5['attributes'][_0x48062a(0x18a)],'updatedAt':_0x54e0a5['attributes']['updatedAt']})),{emailToId:_0x1ad832,idToEmail:_0x85eed3}=_0x3deed7,_0x3fac77=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x109ea7=_0x48062a,_0x5cf921=await _0x3e083f[_0x109ea7(0x169)]['list']();return buildConnectionMaps(_0x5cf921);},{'verbose':_0x27fd8d[_0x48062a(0x1a1)]})[_0x48062a(0x172)](_0x3902e7=>_0x3902e7['data']),_0x18336b=_0x3fac77[_0x48062a(0x166)],_0x4259fa=_0x3fac77[_0x48062a(0x1b8)],_0x402ad8=_0x3fac77[_0x48062a(0x1ba)],_0x49715a={'emailToIdMap':_0x1ad832,'connectionNameToIdMap':_0x18336b,'connectionNameToTypeMap':_0x402ad8,'getSchema':_0x2437c8=>_0x3e083f['connection']['getOutputSchemaWithCache'](_0x2437c8)};let {pathToId:_0xecbe09,idToPath:_0xe30381}=buildFolderMaps(_0x1f65dc);const _0x2abb70=buildSegmentLookupMap(_0xb985c9,_0xe30381),_0x55f76c=buildSegmentNameToIdMap(_0xb985c9),_0x5bb728=buildJourneyBundleLookupMap(_0x3b30c5,_0xe30381);let _0x53e389;if(_0x2561be){if(!_0x2561be[_0x48062a(0x1b4)](_0x48062a(0x165))&&!_0x2561be[_0x48062a(0x1b4)](_0x48062a(0x15b)))return console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x14e)+_0x2561be+'\x0a')),0x1;_0x53e389=[_0x2561be];}else _0x53e389=findYamlFiles(_0x953c20);if(_0x53e389[_0x48062a(0x1d5)]===0x0)return console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x1ad)+_0x953c20+'\x0a')),console['error'](a41_0x1166f8[_0x48062a(0x1c0)](_0x48062a(0x192))),0x1;let _0xe41cad,_0x45a363;try{const _0xffb259=parseAndClassifyYamlFiles(_0x53e389,_0x953c20,{'skipSegments':_0x27fd8d['journeysOnly']});_0xe41cad=_0xffb259[_0x48062a(0x17c)],_0x45a363=_0xffb259[_0x48062a(0x1d9)];const _0x4b8028=validateParsedFiles(_0xffb259,_0x953c20);if(_0x4b8028[_0x48062a(0x1d5)]>0x0)return console[_0x48062a(0x1b3)](a41_0x1166f8['red'](_0x48062a(0x155))),console['error'](formatValidationErrors(_0x4b8028)),console['error'](a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x1cf))),0x1;}catch(_0x39e899){return console['error'](a41_0x1166f8[_0x48062a(0x1e1)]('Error\x20parsing\x20YAML:\x20'+(_0x39e899 instanceof Error?_0x39e899[_0x48062a(0x1c9)]:_0x39e899))),0x1;}if(_0xe41cad[_0x48062a(0x1d5)]===0x0&&_0x45a363[_0x48062a(0x1d5)]===0x0){const _0x2b0904=_0x27fd8d[_0x48062a(0x179)]?_0x48062a(0x1e4):_0x48062a(0x157);return console[_0x48062a(0x1b3)](a41_0x1166f8['yellow'](_0x48062a(0x1c3)+_0x2b0904+_0x48062a(0x170))),0x0;}const _0x121fa7=new Map();_0xb985c9[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)]&&await withSpinner(_0x48062a(0x1a7),async()=>{await batchAsync(_0xb985c9,async _0x112766=>{const _0x29bc27=a41_0x5566,_0x42b3a9=await _0x3e083f['segment'][_0x29bc27(0x1de)](_0x47c6d9,_0x112766['id']);_0x121fa7[_0x29bc27(0x1d2)](_0x112766['id'],_0x42b3a9);});},{'verbose':_0x27fd8d[_0x48062a(0x1a1)]});const {segmentFiles:_0x8e3ad5,foldersToCreate:_0x1afa44}=await prepareSegmentFiles(_0xe41cad,{'segmentByFolderAndName':_0x2abb70,'activationsBySegmentId':_0x121fa7,'folderPathToId':_0xecbe09,'idToEmailMap':_0x85eed3,'connectionIdToNameMap':_0x4259fa},_0x49715a,_0x7d4a6c,_0x32b939),_0x1360bf=_0x2561be?[]:findSegmentsToDelete(_0xb985c9,_0xe41cad[_0x48062a(0x1b6)](({yamlConfig:_0x2c9dda,folderPath:_0x14b28e})=>({'yamlConfig':_0x2c9dda,'folderPath':resolveTDFolderPath(_0x14b28e,_0x7d4a6c,_0x32b939)})),_0xe30381,_0x32b939,_0x7d4a6c),{journeyFiles:_0x3bef82,foldersToCreate:_0xf349b7}=await withProgressSpinner(_0x48062a(0x185),async _0x55fc4b=>prepareJourneyFiles(_0x45a363,{'fetchJourney':async _0x185214=>_0x3e083f['journey'][_0x48062a(0x1c5)](_0x185214[_0x48062a(0x1da)]),'journeyBundlesByFolderAndName':_0x5bb728,'folderPathToId':_0xecbe09,'idToEmailMap':_0x85eed3,'connectionIdToNameMap':_0x4259fa,'existingSegments':_0xb985c9,'parentId':_0x47c6d9,'deps':_0x3e083f,'progress':{'update':_0x3c59a8=>{const _0x4e9d5c=_0x48062a;_0x55fc4b['setPhase'](_0x3c59a8),_0x27fd8d[_0x4e9d5c(0x1a1)]&&console['error']('\x20\x20'+_0x3c59a8);}},'journeyById':_0x5d7d27,'activationStepsById':_0x127b78},_0x7d4a6c,_0x32b939),{'verbose':_0x27fd8d[_0x48062a(0x1a1)]})[_0x48062a(0x172)](_0x214336=>_0x214336[_0x48062a(0x194)]);for(const _0x379575 of _0xf349b7){_0x1afa44[_0x48062a(0x1a8)](_0x379575);}const _0x5155bc=_0x2561be?[]:findJourneysToDelete(_0x3b30c5,_0x45a363[_0x48062a(0x1b6)](({yamlConfig:_0xd26123,folderPath:_0x50b7c5})=>({'yamlConfig':_0xd26123,'folderPath':resolveTDFolderPath(_0x50b7c5,_0x7d4a6c,_0x32b939)})),_0xe30381,_0x32b939,_0x7d4a6c),_0x5e2d07=calculatePushStats(_0x8e3ad5,_0x3bef82,_0x1afa44,_0x1360bf,_0x5155bc,!!_0x27fd8d[_0x48062a(0x1a5)],!!_0x27fd8d['journeysOnly']),_0x2430b6=_0x5e2d07[_0x48062a(0x17c)][_0x48062a(0x15c)],_0x1944c2=_0x5e2d07[_0x48062a(0x17c)][_0x48062a(0x174)],_0x29d699=_0x5e2d07[_0x48062a(0x17c)][_0x48062a(0x1e5)],_0x9979c4=_0x5e2d07[_0x48062a(0x17c)][_0x48062a(0x175)],_0x407833=_0x5e2d07[_0x48062a(0x163)][_0x48062a(0x158)],_0x241618=_0x5e2d07[_0x48062a(0x1d9)][_0x48062a(0x15c)],_0x2e84fe=_0x5e2d07[_0x48062a(0x1d9)]['changed'],_0x122cbc=_0x5e2d07[_0x48062a(0x1d9)][_0x48062a(0x1e5)],_0xd8e16d=_0x5e2d07[_0x48062a(0x1d9)]['toDelete'],_0x261a26=_0x5e2d07['activations'][_0x48062a(0x17a)],_0x374036=_0x5e2d07['activations'][_0x48062a(0x158)],_0x179933=_0x5e2d07[_0x48062a(0x199)][_0x48062a(0x1a0)],_0x13d298=_0x5e2d07[_0x48062a(0x199)][_0x48062a(0x175)];console[_0x48062a(0x1b3)](_0x48062a(0x17d)+_0x386efd+'\x27:');_0x407833[_0x48062a(0x1d5)]>0x0&&console[_0x48062a(0x1b3)]('\x20\x20'+a41_0x1166f8[_0x48062a(0x1d8)](_0x48062a(0x168)+_0x407833[_0x48062a(0x1d5)]+_0x48062a(0x15d)));if(!_0x27fd8d[_0x48062a(0x179)]){console['error'](_0x48062a(0x190)),console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x14f)]('+\x20'+_0x2430b6[_0x48062a(0x1d5)]+'\x20new')),console['error'](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x17e)]('~\x20'+_0x1944c2[_0x48062a(0x1d5)]+_0x48062a(0x1a9)));if(_0x9979c4[_0x48062a(0x1d5)]>0x0)console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x1e1)]('-\x20'+_0x9979c4[_0x48062a(0x1d5)]+_0x48062a(0x1dd)));else _0x1360bf['length']>0x0&&!_0x27fd8d[_0x48062a(0x1a5)]&&console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8['dim'](_0x1360bf[_0x48062a(0x1d5)]+_0x48062a(0x1aa)));console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x19d)]('=\x20'+_0x29d699['length']+'\x20unchanged'));}if(_0x3bef82[_0x48062a(0x1d5)]>0x0||_0x5155bc[_0x48062a(0x1d5)]>0x0){console[_0x48062a(0x1b3)](_0x48062a(0x1d7)),console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8['green']('+\x20'+_0x241618['length']+_0x48062a(0x183))),console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x17e)]('~\x20'+_0x2e84fe['length']+_0x48062a(0x1a9)));if(_0xd8e16d[_0x48062a(0x1d5)]>0x0)console[_0x48062a(0x1b3)]('\x20\x20\x20\x20'+a41_0x1166f8[_0x48062a(0x1e1)]('-\x20'+_0xd8e16d[_0x48062a(0x1d5)]+_0x48062a(0x1dd)));else _0x5155bc[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x1a5)]&&console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x19d)](_0x5155bc[_0x48062a(0x1d5)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x19d)]('=\x20'+_0x122cbc[_0x48062a(0x1d5)]+_0x48062a(0x19c)));}_0x261a26[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)]&&(console[_0x48062a(0x1b3)](''),console[_0x48062a(0x1b3)](_0x48062a(0x1ac)),_0x374036['length']>0x0&&console[_0x48062a(0x1b3)]('\x20\x20\x20\x20'+a41_0x1166f8[_0x48062a(0x14f)]('+\x20'+_0x374036['length']+'\x20to\x20create')),_0x179933[_0x48062a(0x1d5)]>0x0&&console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x17e)]('~\x20'+_0x179933[_0x48062a(0x1d5)]+'\x20to\x20update')),_0x13d298[_0x48062a(0x1d5)]>0x0&&console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x1e1)]('-\x20'+_0x13d298[_0x48062a(0x1d5)]+_0x48062a(0x1dd))));console[_0x48062a(0x1b3)](_0x48062a(0x1b9)+a41_0x1166f8[_0x48062a(0x1c0)](_0x953c20)+'\x0a');if(_0x407833[_0x48062a(0x1d5)]>0x0){console[_0x48062a(0x1b3)](_0x48062a(0x1bc));for(const _0x4b40db of _0x407833){console[_0x48062a(0x1b3)]('\x20\x20'+a41_0x1166f8[_0x48062a(0x1d8)]('+')+'\x20'+_0x4b40db);}console[_0x48062a(0x1b3)]('');}if(_0x2430b6[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)])for(const _0x2a4456 of _0x2430b6){const _0x4f9d63=_0x2a4456[_0x48062a(0x195)]?_0x2a4456[_0x48062a(0x195)]+'/'+_0x2a4456[_0x48062a(0x1dc)][_0x48062a(0x177)]:_0x2a4456[_0x48062a(0x1dc)][_0x48062a(0x177)],_0xc6d42f=_0x2a4456[_0x48062a(0x1dc)][_0x48062a(0x199)]?.['length']||0x0,_0x5d5006=_0xc6d42f>0x0?a41_0x1166f8[_0x48062a(0x19d)]('\x20['+_0xc6d42f+_0x48062a(0x15e)):'';console[_0x48062a(0x1b3)]('\x0a'+a41_0x1166f8['green'](_0x48062a(0x191))+'\x20'+_0x4f9d63+_0x5d5006),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c)),_0x2a4456[_0x48062a(0x160)]&&console[_0x48062a(0x1b3)](_0x2a4456['diff']),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));}if(_0x9979c4[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)])for(const _0x56cecb of _0x9979c4){const _0x33c2f8=_0x56cecb[_0x48062a(0x1c6)]?_0xe30381[_0x48062a(0x1bf)](_0x56cecb[_0x48062a(0x1c6)][_0x48062a(0x15a)]())||'':'',_0x5e4d2f=_0x33c2f8?_0x33c2f8+'/'+_0x56cecb[_0x48062a(0x177)]:_0x56cecb[_0x48062a(0x177)],_0x2d5c99=_0x121fa7['get'](_0x56cecb['id'])||[],_0x296d53=_0x2d5c99[_0x48062a(0x1d5)]>0x0?a41_0x1166f8['dim']('\x20['+_0x2d5c99[_0x48062a(0x1d5)]+'\x20activations]'):'';console[_0x48062a(0x1b3)]('\x0a'+a41_0x1166f8['red']('Delete\x20segment:')+'\x20'+_0x5e4d2f+_0x296d53),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));const _0xdd744=segmentWithActivationsToYaml(_0x56cecb,_0x2d5c99,undefined,_0x85eed3,_0x4259fa),_0x11ba5f=segmentToYamlString(_0xdd744),_0x4bbf09=generateDiff(_0x11ba5f,'');console[_0x48062a(0x1b3)](formatDiffWithColors(_0x4bbf09)),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));}const _0x1a8611=_0x8e3ad5[_0x48062a(0x1c4)](_0x36cd89=>!_0x36cd89[_0x48062a(0x1b2)]&&_0x36cd89[_0x48062a(0x160)]);if(_0x1a8611[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)])for(const _0x2bac07 of _0x1a8611){const _0x54cddd=_0x2bac07[_0x48062a(0x195)]?_0x2bac07[_0x48062a(0x195)]+'/'+_0x2bac07[_0x48062a(0x1dc)]['name']:_0x2bac07[_0x48062a(0x1dc)][_0x48062a(0x177)];console[_0x48062a(0x1b3)]('\x0a'+a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x198))+'\x20'+_0x54cddd),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c)),console[_0x48062a(0x1b3)](_0x2bac07['diff']),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));}if(_0x241618[_0x48062a(0x1d5)]>0x0)for(const _0x879fb of _0x241618){const _0x4c3d5b=_0x879fb[_0x48062a(0x195)]?_0x879fb[_0x48062a(0x195)]+'/'+_0x879fb[_0x48062a(0x1dc)][_0x48062a(0x177)]:_0x879fb['yamlConfig'][_0x48062a(0x177)];console['error']('\x0a'+a41_0x1166f8['green'](_0x48062a(0x1e3))+'\x20'+_0x4c3d5b),console['error']('─'[_0x48062a(0x188)](0x3c)),_0x879fb['diff']&&console[_0x48062a(0x1b3)](_0x879fb['diff']),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));}const _0x1cfe1b=_0x3bef82[_0x48062a(0x1c4)](_0x17ffb4=>!_0x17ffb4['isNew']&&_0x17ffb4[_0x48062a(0x160)]);if(_0x1cfe1b['length']>0x0)for(const _0xf66301 of _0x1cfe1b){const _0x3d5e00=_0xf66301[_0x48062a(0x195)]?_0xf66301[_0x48062a(0x195)]+'/'+_0xf66301['yamlConfig'][_0x48062a(0x177)]:_0xf66301[_0x48062a(0x1dc)][_0x48062a(0x177)];console['error']('\x0a'+a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x181))+'\x20'+_0x3d5e00),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c)),console['error'](_0xf66301['diff']),console[_0x48062a(0x1b3)]('─'['repeat'](0x3c));}if(_0xd8e16d[_0x48062a(0x1d5)]>0x0)for(const _0x5c7d46 of _0xd8e16d){const _0x2d4489=_0x5c7d46['folderId']?_0xe30381[_0x48062a(0x1bf)](_0x5c7d46[_0x48062a(0x180)])||'':'',_0x48c8ab=_0x2d4489?_0x2d4489+'/'+_0x5c7d46[_0x48062a(0x167)]:_0x5c7d46[_0x48062a(0x167)];console['error']('\x0a'+a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x1cd))+'\x20'+_0x48c8ab),console[_0x48062a(0x1b3)]('─'['repeat'](0x3c)),console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x154))),console[_0x48062a(0x1b3)]('─'['repeat'](0x3c));}if(_0x27fd8d[_0x48062a(0x1e7)])return console['error'](a41_0x1166f8['yellow'](_0x48062a(0x182))),0x0;const _0x1d0e76=_0x27fd8d[_0x48062a(0x179)]?![]:_0x2430b6['length']>0x0||_0x1944c2[_0x48062a(0x1d5)]>0x0||_0x9979c4['length']>0x0,_0x5a6957=_0x241618[_0x48062a(0x1d5)]>0x0||_0x2e84fe[_0x48062a(0x1d5)]>0x0||_0xd8e16d[_0x48062a(0x1d5)]>0x0,_0x33f4b1=_0x27fd8d[_0x48062a(0x179)]?![]:_0x261a26[_0x48062a(0x1d5)]>0x0,_0x474b85=_0x407833['length']>0x0;if(!_0x1d0e76&&!_0x5a6957&&!_0x33f4b1&&!_0x474b85){const _0xf0bcac=_0x27fd8d[_0x48062a(0x179)]?_0x48062a(0x19b):_0x48062a(0x1c2);console[_0x48062a(0x1b3)](a41_0x1166f8['green'](_0xf0bcac));if(_0x2561be&&_0x29d699['length']===0x1){const _0x5ccbd6=_0x29d699[0x0];if(_0x5ccbd6[_0x48062a(0x176)]?.['id']){const _0x50fe66=getConsoleNextUrl(_0x27fd8d[_0x48062a(0x1be)],_0x48062a(0x1e0)+_0x47c6d9+_0x48062a(0x159)+_0x5ccbd6['existingSegment']['id']+'/sb/da/esr');console[_0x48062a(0x1b3)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x1166f8[_0x48062a(0x1c0)](_0x50fe66));}}if(_0x2561be&&_0x122cbc['length']===0x1){const _0x1b86cc=_0x122cbc[0x0];if(_0x1b86cc[_0x48062a(0x1d6)]?.['id']){const _0x52dbc8=getConsoleNextUrl(_0x27fd8d[_0x48062a(0x1be)],_0x48062a(0x1e0)+_0x47c6d9+_0x48062a(0x159)+_0x1b86cc[_0x48062a(0x1d6)]['id']+'/j/da/je');console['error']('\x20\x20'+a41_0x1166f8[_0x48062a(0x1c0)](_0x52dbc8));}}return 0x0;}const _0x2b848d=_0x27fd8d[_0x48062a(0x179)]?_0x241618[_0x48062a(0x1d5)]+_0x2e84fe[_0x48062a(0x1d5)]+_0xd8e16d['length']+_0x407833[_0x48062a(0x1d5)]:_0x2430b6[_0x48062a(0x1d5)]+_0x1944c2[_0x48062a(0x1d5)]+_0x9979c4['length']+_0x241618[_0x48062a(0x1d5)]+_0x2e84fe[_0x48062a(0x1d5)]+_0xd8e16d['length']+_0x407833[_0x48062a(0x1d5)]+_0x261a26['length'];if(!_0x27fd8d['yes']&&_0x2b848d>0x0){if(!isInteractive())return console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x162)),_0x48062a(0x16a)),console['error'](a41_0x1166f8[_0x48062a(0x19d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x119f9d=await confirmKey(_0x48062a(0x16d)+_0x2b848d+_0x48062a(0x18e));if(!_0x119f9d)return console[_0x48062a(0x1b3)](a41_0x1166f8['yellow']('Aborted.')),0x1;}const _0x2a4cf7={'withProgress':async(_0x2a8118,_0x4b21dd)=>{const _0x3a4a50=_0x48062a,_0x10164c=await withSpinner(_0x2a8118,_0x4b21dd,{'verbose':_0x27fd8d[_0x3a4a50(0x1a1)]});return{'data':_0x10164c[_0x3a4a50(0x194)]};},'logInfo':_0x3ad5c8=>console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1d8)]('✔\x20'+_0x3ad5c8)),'logSuccess':_0x96a02f=>console['error'](a41_0x1166f8[_0x48062a(0x14f)]('✔\x20'+_0x96a02f)),'logWarning':_0x2e4d33=>console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x17e)]('⚠\x20'+_0x2e4d33)),'logDeleted':_0x51e738=>console['error'](a41_0x1166f8[_0x48062a(0x1e1)]('✔\x20'+_0x51e738))},_0x3cb865={'segment':_0x3e083f[_0x48062a(0x1d1)],'journey':_0x3e083f[_0x48062a(0x1e4)],'user':_0x3e083f['user'],'connection':_0x3e083f['connection']};_0x407833[_0x48062a(0x1d5)]>0x0&&(_0xecbe09=await executePushFolders(_0x3cb865,_0x407833,_0xecbe09,{'parentId':_0x47c6d9},_0x2a4cf7));const _0x360659={'rootFolderId':_0x408201,'folderPathToId':_0xecbe09,'folderIdToPath':_0xe30381,'segmentNameToId':_0x55f76c,'activationsBySegmentId':_0x121fa7,'emailToIdMap':_0x1ad832,'idToEmailMap':_0x85eed3,'connectionNameToIdMap':_0x3fac77['nameToId'],'connectionIdToNameMap':_0x3fac77[_0x48062a(0x1b8)],'connectionNameToTypeMap':_0x402ad8},_0x2543ff=await executePushSegments(_0x3cb865,_0x27fd8d[_0x48062a(0x179)]?[]:_0x8e3ad5,_0x360659,{'parentId':_0x47c6d9},_0x2a4cf7),_0x19e345=_0x2543ff[_0x48062a(0x18b)],_0x457de2=_0x2543ff['updated'],_0x47e980=_0x2543ff[_0x48062a(0x199)][_0x48062a(0x18b)],_0x1d8162=_0x2543ff[_0x48062a(0x199)][_0x48062a(0x17f)],_0x397974=_0x2543ff[_0x48062a(0x199)]['deleted'];let _0x2f416f;if(_0x2561be&&_0x8e3ad5[_0x48062a(0x1d5)]===0x1){const _0x143b44=_0x8e3ad5[0x0];_0x2f416f=_0x143b44[_0x48062a(0x176)]?.['id']??_0x2543ff[_0x48062a(0x19e)]['get'](_0x143b44[_0x48062a(0x1dc)]['name']);}const _0x30f4c1=await executePushSegmentDeletions(_0x3cb865,_0x27fd8d[_0x48062a(0x179)]?[]:_0x9979c4,_0x2a4cf7);let _0x3c4223=0x0,_0x4272a4=0x0,_0x543684=0x0;const _0x11dd3d=new Map(_0x55f76c);for(const [_0x43133e,_0x4f93b8]of _0x2543ff[_0x48062a(0x19e)]){_0x11dd3d['set'](_0x43133e,_0x4f93b8);}if(_0x3bef82[_0x48062a(0x1d5)]>0x0){const _0x4225d0={..._0x360659,'segmentNameToId':_0x11dd3d,'existingSegments':_0xb985c9,'activationContext':_0x49715a},_0x148f03=await executePushJourneys(_0x3cb865,_0x3bef82,_0x4225d0,{'parentId':_0x47c6d9,'rootFolderId':_0x408201,'verbose':_0x27fd8d[_0x48062a(0x1a1)]},_0x2a4cf7);_0x3c4223=_0x148f03[_0x48062a(0x18b)],_0x4272a4=_0x148f03[_0x48062a(0x17f)];if(_0x2561be&&_0x148f03[_0x48062a(0x193)][_0x48062a(0x1d5)]===0x1){const _0x28064d=_0x148f03[_0x48062a(0x193)][0x0];if(_0x28064d['journeyId']){const _0x4f68db=getConsoleNextUrl(_0x27fd8d[_0x48062a(0x1be)],'/app/ps/'+_0x47c6d9+'/e/'+_0x28064d[_0x48062a(0x1da)]+_0x48062a(0x196));console[_0x48062a(0x1b3)]('\x20\x20'+a41_0x1166f8[_0x48062a(0x1c0)](_0x4f68db));}}}for(const _0x187eaf of _0xd8e16d){console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x1b0)+_0x187eaf['journeyBundleName'])),_0x543684++;}const _0x30518f=[];if(_0x19e345>0x0)_0x30518f[_0x48062a(0x14c)](_0x19e345+_0x48062a(0x151));if(_0x457de2>0x0)_0x30518f['push'](_0x457de2+_0x48062a(0x1d3));if(_0x30f4c1>0x0)_0x30518f[_0x48062a(0x14c)](_0x30f4c1+'\x20deleted');const _0x3312ef=[];if(_0x3c4223>0x0)_0x3312ef['push'](_0x3c4223+'\x20created');if(_0x4272a4>0x0)_0x3312ef[_0x48062a(0x14c)](_0x4272a4+_0x48062a(0x1d3));if(_0x543684>0x0)_0x3312ef[_0x48062a(0x14c)](_0x543684+_0x48062a(0x16b));const _0x45e98b=[];if(_0x47e980>0x0)_0x45e98b[_0x48062a(0x14c)](_0x47e980+'\x20created');if(_0x1d8162>0x0)_0x45e98b[_0x48062a(0x14c)](_0x1d8162+_0x48062a(0x1d3));if(_0x397974>0x0)_0x45e98b[_0x48062a(0x14c)](_0x397974+'\x20deleted');console[_0x48062a(0x1b3)](a41_0x1166f8['green'](_0x48062a(0x1db)));_0x30518f[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)]&&console[_0x48062a(0x1b3)](_0x48062a(0x1e8)+_0x30518f['join'](',\x20'));_0x3312ef[_0x48062a(0x1d5)]>0x0&&console[_0x48062a(0x1b3)](_0x48062a(0x17b)+_0x3312ef[_0x48062a(0x1ce)](',\x20'));_0x45e98b[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)]&&console[_0x48062a(0x1b3)](_0x48062a(0x156)+_0x45e98b[_0x48062a(0x1ce)](',\x20'));if(_0x2f416f){const _0xf23326=getConsoleNextUrl(_0x27fd8d[_0x48062a(0x1be)],'/app/ps/'+_0x47c6d9+'/e/'+_0x2f416f+_0x48062a(0x1a2));console[_0x48062a(0x1b3)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x1166f8[_0x48062a(0x1c0)](_0xf23326));}return 0x0;}}
1
+ function a41_0x1c44(){const _0x1cdc76=['Delete\x20journey:','created','238937ZXfDOl','name','createdAt','list','push','nameToType','\x0aPush\x20summary\x20for\x20\x27','toCreate','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','updated','Error\x20parsing\x20YAML:\x20','getJourney','20MgDNtY','paused','dim','relationships','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Source\x20directory:\x20','existingJourney','folderId','/e/','\x0a✔\x20Push\x20complete','createdSegmentIds','\x20unchanged','resolveParentId','📁\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Scoped\x20to\x20folder:\x20','\x20YAML\x20files\x20found','\x20\x20\x20\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','versionNumber','\x0aValidation\x20failed:','folderPath','736169pMamar','5925OcKtXm','no_parent','journey','\x20updated','segment:push','activations','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Activations:','/sb/da/esr','description','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','unchanged','idToName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','red','length','yes','join','\x20folders\x20to\x20create','dryRun','\x20to\x20create','\x27...','cyan','folders','(Journey\x20will\x20be\x20deleted)','/app/ps/','768GneyTr','existingSegment','parentFolder','Parent\x20segment:\x20','data','Changes\x20to\x20journey:','\x20activations]','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','No\x20','diff','isScoped','errorCode','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)','user','toDelete','delete','set','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','site','.yml','audienceId','journeys','green','segmentFolderId','targetDir','filter','new','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','repeat','listJourneysWithDetailsFromParentSegment','1936701uePLDf','Fetching\x20existing\x20data...','\x20\x20Journeys:\x20','Delete\x20segment:','Resolving\x20parent\x20segment\x20\x27','\x20created','/j/da/je','verbose','changed','\x20changed','then','toString','yellow','isNew','\x20\x20🗺️\x20\x20Journeys:','2qvRFnp','journeyBundleId','Error:\x20','Site:\x20','\x0aError:','segment','toUpdate','journeyId','275368bSZwgs','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','get','cwd','journeyBundleName','\x20new','440202KHPMQr','\x20deleted','yamlConfig','\x20\x20Activations:\x20','helpText','155898BQoGun','Fetching\x20connections\x20for\x20name\x20resolution...','file','journeysOnly','nameToId','parentName','blue','endsWith','attributes','connection','New\x20segment:','segments','updatedAt','add','getOutputSchemaWithCache','listSegments','type','all','parentSegment','deleted','.yaml','execute','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20changes?','error','parent_name','map','results'];a41_0x1c44=function(){return _0x1cdc76;};return a41_0x1c44();}const a41_0x371069=a41_0x13ea;(function(_0x2f96b5,_0x59c424){const _0x594831=a41_0x13ea,_0x16a64a=_0x2f96b5();while(!![]){try{const _0x27cedd=-parseInt(_0x594831(0x196))/0x1*(parseInt(_0x594831(0x164))/0x2)+-parseInt(_0x594831(0x173))/0x3+-parseInt(_0x594831(0x136))/0x4*(-parseInt(_0x594831(0x11c))/0x5)+-parseInt(_0x594831(0x178))/0x6+-parseInt(_0x594831(0x11b))/0x7+parseInt(_0x594831(0x16c))/0x8+-parseInt(_0x594831(0x155))/0x9*(-parseInt(_0x594831(0x104))/0xa);if(_0x27cedd===_0x59c424)break;else _0x16a64a['push'](_0x16a64a['shift']());}catch(_0x107fe3){_0x16a64a['push'](_0x16a64a['shift']());}}}(a41_0x1c44,0x2ad8a));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x13ea(_0x5420f7,_0x205ba2){_0x5420f7=_0x5420f7-0x103;const _0x1c44a9=a41_0x1c44();let _0x13ea35=_0x1c44a9[_0x5420f7];return _0x13ea35;}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_0x1da7e8 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_0x371069(0x197)]=a41_0x371069(0x120);[a41_0x371069(0x125)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x371069(0x18d)](_0x26d6ca){const _0x4d8171=a41_0x371069,{options:_0x6a884f,args:_0x84b618,tdx:_0xdb3b32}=_0x26d6ca,_0x16110a=_0x6a884f,_0x2c0b25=await resolveTarget({'arg':_0x84b618[0x0],'contextParent':_0x6a884f[_0x4d8171(0x18a)],'cwd':process[_0x4d8171(0x170)]()});if(!isSuccessfulResolution(_0x2c0b25))return _0x2c0b25[_0x4d8171(0x142)]===_0x4d8171(0x11d)?(console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x13d))),console['error'](_0x4d8171(0x143)),console[_0x4d8171(0x190)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x4d8171(0x190)](_0x4d8171(0x16e))):(console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x166)+_0x2c0b25[_0x4d8171(0x16d)]+'\x0a')),_0x2c0b25[_0x4d8171(0x177)]&&console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x132)](_0x2c0b25['helpText']))),0x1;if(_0x2c0b25[_0x4d8171(0x188)]===_0x4d8171(0x191))return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2c0b25[_0x4d8171(0x14f)]+'\x0a')),console['error'](a41_0x1da7e8[_0x4d8171(0x132)](_0x4d8171(0x126))),0x1;const _0x35937d=_0x2c0b25[_0x4d8171(0x17d)],_0x238d59=_0x2c0b25[_0x4d8171(0x14f)],_0x285a8a=_0x2c0b25[_0x4d8171(0x188)]===_0x4d8171(0x17a)?_0x2c0b25['filePath']:undefined,_0x16f0a2=getScopedDetails(_0x2c0b25),_0x4ce003=_0x16f0a2?.[_0x4d8171(0x141)]??![],_0x53fd84=_0x16f0a2?.['scopedFolderPath']??'';if(!existsSync(_0x238d59))return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)]('Error:\x20Directory\x20not\x20found:\x20'+_0x238d59+'\x0a')),console[_0x4d8171(0x190)](a41_0x1da7e8['cyan'](_0x4d8171(0x126))),0x1;_0x16110a[_0x4d8171(0x15c)]&&(console[_0x4d8171(0x190)](_0x4d8171(0x167)+_0x16110a[_0x4d8171(0x149)]),console[_0x4d8171(0x190)](_0x4d8171(0x139)+_0x35937d),console['error'](_0x4d8171(0x109)+_0x238d59),_0x4ce003&&console[_0x4d8171(0x190)](_0x4d8171(0x114)+_0x53fd84));const _0x2e65ea=await withSpinner(_0x4d8171(0x159)+_0x35937d+_0x4d8171(0x131),()=>_0xdb3b32[_0x4d8171(0x169)][_0x4d8171(0x110)](_0x35937d),{'verbose':_0x16110a['verbose']}),_0x4e0472=_0x2e65ea[_0x4d8171(0x13a)],{parentSegmentResult:_0x583fdf,segmentsResult:_0xd0c3ff,foldersResult:_0x147ee9,journeysWithDetailsResult:_0x183c45,userMaps:_0x40c8cc}=await withSpinner(_0x4d8171(0x156),async()=>{const _0x80a251=_0x4d8171,[_0x4ff010,_0x5238db,_0x5011eb,_0x3d0ca8,_0x4d3e29]=await Promise[_0x80a251(0x189)]([_0xdb3b32[_0x80a251(0x169)]['getParent'](_0x4e0472),_0xdb3b32['segment'][_0x80a251(0x187)](_0x4e0472),_0xdb3b32[_0x80a251(0x169)]['listFolders'](_0x4e0472),_0xdb3b32['journey'][_0x80a251(0x154)](_0x4e0472,{'includeAllVersions':!![]}),_0xdb3b32[_0x80a251(0x144)]['buildUserMaps']()]);return{'parentSegmentResult':_0x4ff010,'segmentsResult':_0x5238db,'foldersResult':_0x5011eb,'journeysWithDetailsResult':_0x3d0ca8,'userMaps':_0x4d3e29};},{'verbose':_0x16110a[_0x4d8171(0x15c)]})[_0x4d8171(0x15f)](_0x906c2e=>_0x906c2e[_0x4d8171(0x13a)]),_0x1cd807=_0x583fdf,_0x47327f=extractRootFolderId(_0x1cd807),_0x59fa00=_0xd0c3ff,_0x5da345=_0x147ee9,{journeys:_0x118ad9,activationStepsById:_0x5b9fbd}=_0x183c45,_0x4473a4=new Map(_0x118ad9[_0x4d8171(0x192)](_0xe328df=>[_0xe328df['id'],_0xe328df])),_0x20f990=_0x118ad9[_0x4d8171(0x192)](_0x12860b=>({'id':_0x12860b['id'],'name':_0x12860b[_0x4d8171(0x180)]['name'],'journeyBundleName':_0x12860b['attributes'][_0x4d8171(0x171)]||'','journeyBundleId':_0x12860b['attributes'][_0x4d8171(0x165)]||'','versionNumber':_0x12860b[_0x4d8171(0x180)][_0x4d8171(0x118)],'description':_0x12860b['attributes'][_0x4d8171(0x125)],'state':_0x12860b[_0x4d8171(0x180)]['state'],'paused':_0x12860b['attributes'][_0x4d8171(0x105)],'audienceId':_0x12860b[_0x4d8171(0x180)][_0x4d8171(0x14b)],'folderId':_0x12860b[_0x4d8171(0x107)]?.[_0x4d8171(0x138)]?.[_0x4d8171(0x13a)]?.['id'],'createdAt':_0x12860b[_0x4d8171(0x180)][_0x4d8171(0x198)],'updatedAt':_0x12860b[_0x4d8171(0x180)][_0x4d8171(0x184)]})),{emailToId:_0x2bf6cb,idToEmail:_0xbe1ec1}=_0x40c8cc,_0x4b8781=await withSpinner(_0x4d8171(0x179),async()=>{const _0x3d0e89=_0x4d8171,_0x2a8464=await _0xdb3b32[_0x3d0e89(0x181)][_0x3d0e89(0x199)]();return buildConnectionMaps(_0x2a8464);},{'verbose':_0x16110a['verbose']})['then'](_0x1c94b1=>_0x1c94b1[_0x4d8171(0x13a)]),_0x27d7cd=_0x4b8781[_0x4d8171(0x17c)],_0x3f5de4=_0x4b8781[_0x4d8171(0x128)],_0x2e66c5=_0x4b8781[_0x4d8171(0x19b)],_0x529bd6={'emailToIdMap':_0x2bf6cb,'connectionNameToIdMap':_0x27d7cd,'connectionNameToTypeMap':_0x2e66c5,'getSchema':_0x548b3b=>_0xdb3b32[_0x4d8171(0x181)][_0x4d8171(0x186)](_0x548b3b)};let {pathToId:_0x4dd412,idToPath:_0x543bd4}=buildFolderMaps(_0x5da345);const _0x1541c2=buildSegmentLookupMap(_0x59fa00,_0x543bd4),_0x54808d=buildSegmentNameToIdMap(_0x59fa00),_0x2ff4e1=buildJourneyBundleLookupMap(_0x20f990,_0x543bd4);let _0x5ae342;if(_0x285a8a){if(!_0x285a8a[_0x4d8171(0x17f)](_0x4d8171(0x14a))&&!_0x285a8a['endsWith'](_0x4d8171(0x18c)))return console[_0x4d8171(0x190)](a41_0x1da7e8['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x285a8a+'\x0a')),0x1;_0x5ae342=[_0x285a8a];}else _0x5ae342=findYamlFiles(_0x238d59);if(_0x5ae342[_0x4d8171(0x12b)]===0x0)return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x148)+_0x238d59+'\x0a')),console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x132)](_0x4d8171(0x152))),0x1;let _0x1554f0,_0x25ba01;try{const _0x612795=parseAndClassifyYamlFiles(_0x5ae342,_0x238d59,{'skipSegments':_0x16110a[_0x4d8171(0x17b)]});_0x1554f0=_0x612795[_0x4d8171(0x183)],_0x25ba01=_0x612795['journeys'];const _0x595a9f=validateParsedFiles(_0x612795,_0x238d59);if(_0x595a9f[_0x4d8171(0x12b)]>0x0)return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x119))),console[_0x4d8171(0x190)](formatValidationErrors(_0x595a9f)),console['error'](a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x117))),0x1;}catch(_0x44d9e2){return console['error'](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x1a0)+(_0x44d9e2 instanceof Error?_0x44d9e2[_0x4d8171(0x16d)]:_0x44d9e2))),0x1;}if(_0x1554f0[_0x4d8171(0x12b)]===0x0&&_0x25ba01[_0x4d8171(0x12b)]===0x0){const _0x2cf847=_0x16110a[_0x4d8171(0x17b)]?'journey':'segment\x20or\x20journey';return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x13f)+_0x2cf847+_0x4d8171(0x115))),0x0;}const _0x577ef2=new Map();_0x59fa00[_0x4d8171(0x12b)]>0x0&&!_0x16110a[_0x4d8171(0x17b)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x59fa00,async _0x3dd863=>{const _0x6957ab=a41_0x13ea,_0x3fb20b=await _0xdb3b32['segment']['listActivations'](_0x4e0472,_0x3dd863['id']);_0x577ef2[_0x6957ab(0x147)](_0x3dd863['id'],_0x3fb20b);});},{'verbose':_0x16110a[_0x4d8171(0x15c)]});const {segmentFiles:_0xf0b64a,foldersToCreate:_0x3f4451}=await prepareSegmentFiles(_0x1554f0,{'segmentByFolderAndName':_0x1541c2,'activationsBySegmentId':_0x577ef2,'folderPathToId':_0x4dd412,'idToEmailMap':_0xbe1ec1,'connectionIdToNameMap':_0x3f5de4},_0x529bd6,_0x4ce003,_0x53fd84),_0x466cc7=_0x285a8a?[]:findSegmentsToDelete(_0x59fa00,_0x1554f0[_0x4d8171(0x192)](({yamlConfig:_0x81f9dd,folderPath:_0x1d5715})=>({'yamlConfig':_0x81f9dd,'folderPath':resolveTDFolderPath(_0x1d5715,_0x4ce003,_0x53fd84)})),_0x543bd4,_0x53fd84,_0x4ce003),{journeyFiles:_0x34e40e,foldersToCreate:_0x2bfbc9}=await withProgressSpinner('Preparing\x20journeys...',async _0x5b9470=>prepareJourneyFiles(_0x25ba01,{'fetchJourney':async _0x246f73=>_0xdb3b32[_0x4d8171(0x11e)][_0x4d8171(0x103)](_0x246f73['journeyId']),'journeyBundlesByFolderAndName':_0x2ff4e1,'folderPathToId':_0x4dd412,'idToEmailMap':_0xbe1ec1,'connectionIdToNameMap':_0x3f5de4,'existingSegments':_0x59fa00,'parentId':_0x4e0472,'deps':_0xdb3b32,'progress':{'update':_0x11f677=>{const _0x55567=_0x4d8171;_0x5b9470['setPhase'](_0x11f677),_0x16110a['verbose']&&console[_0x55567(0x190)]('\x20\x20'+_0x11f677);}},'journeyById':_0x4473a4,'activationStepsById':_0x5b9fbd},_0x4ce003,_0x53fd84),{'verbose':_0x16110a[_0x4d8171(0x15c)]})['then'](_0x4e3da5=>_0x4e3da5[_0x4d8171(0x13a)]);for(const _0x13e688 of _0x2bfbc9){_0x3f4451[_0x4d8171(0x185)](_0x13e688);}const _0x44980c=_0x285a8a?[]:findJourneysToDelete(_0x20f990,_0x25ba01['map'](({yamlConfig:_0x1c491c,folderPath:_0x5929d1})=>({'yamlConfig':_0x1c491c,'folderPath':resolveTDFolderPath(_0x5929d1,_0x4ce003,_0x53fd84)})),_0x543bd4,_0x53fd84,_0x4ce003),_0x68701b=calculatePushStats(_0xf0b64a,_0x34e40e,_0x3f4451,_0x466cc7,_0x44980c,!!_0x16110a[_0x4d8171(0x146)],!!_0x16110a[_0x4d8171(0x17b)]),_0x41b29d=_0x68701b[_0x4d8171(0x183)]['new'],_0x1d0c5c=_0x68701b[_0x4d8171(0x183)][_0x4d8171(0x15d)],_0x1946c4=_0x68701b[_0x4d8171(0x183)][_0x4d8171(0x127)],_0x57a1a1=_0x68701b[_0x4d8171(0x183)][_0x4d8171(0x145)],_0x3a0096=_0x68701b[_0x4d8171(0x133)][_0x4d8171(0x19d)],_0x1e0c3a=_0x68701b[_0x4d8171(0x14c)][_0x4d8171(0x151)],_0x2f8712=_0x68701b[_0x4d8171(0x14c)][_0x4d8171(0x15d)],_0x1b338b=_0x68701b[_0x4d8171(0x14c)][_0x4d8171(0x127)],_0x148519=_0x68701b['journeys']['toDelete'],_0xe41cf=_0x68701b[_0x4d8171(0x121)][_0x4d8171(0x189)],_0x4410c4=_0x68701b[_0x4d8171(0x121)][_0x4d8171(0x19d)],_0x5baec2=_0x68701b['activations'][_0x4d8171(0x16a)],_0x561196=_0x68701b[_0x4d8171(0x121)][_0x4d8171(0x145)];console[_0x4d8171(0x190)](_0x4d8171(0x19c)+_0x35937d+'\x27:');_0x3a0096['length']>0x0&&console[_0x4d8171(0x190)]('\x20\x20'+a41_0x1da7e8['blue'](_0x4d8171(0x111)+_0x3a0096[_0x4d8171(0x12b)]+_0x4d8171(0x12e)));if(!_0x16110a[_0x4d8171(0x17b)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x14d)]('+\x20'+_0x41b29d[_0x4d8171(0x12b)]+'\x20new')),console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8['yellow']('~\x20'+_0x1d0c5c['length']+_0x4d8171(0x15e)));if(_0x57a1a1[_0x4d8171(0x12b)]>0x0)console[_0x4d8171(0x190)]('\x20\x20\x20\x20'+a41_0x1da7e8[_0x4d8171(0x12a)]('-\x20'+_0x57a1a1[_0x4d8171(0x12b)]+'\x20to\x20delete'));else _0x466cc7['length']>0x0&&!_0x16110a[_0x4d8171(0x146)]&&console[_0x4d8171(0x190)]('\x20\x20\x20\x20'+a41_0x1da7e8['dim'](_0x466cc7['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x106)]('=\x20'+_0x1946c4[_0x4d8171(0x12b)]+'\x20unchanged'));}if(_0x34e40e[_0x4d8171(0x12b)]>0x0||_0x44980c[_0x4d8171(0x12b)]>0x0){console[_0x4d8171(0x190)](_0x4d8171(0x163)),console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x14d)]('+\x20'+_0x1e0c3a['length']+_0x4d8171(0x172))),console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x161)]('~\x20'+_0x2f8712[_0x4d8171(0x12b)]+_0x4d8171(0x15e)));if(_0x148519[_0x4d8171(0x12b)]>0x0)console['error']('\x20\x20\x20\x20'+a41_0x1da7e8[_0x4d8171(0x12a)]('-\x20'+_0x148519[_0x4d8171(0x12b)]+'\x20to\x20delete'));else _0x44980c['length']>0x0&&!_0x16110a['delete']&&console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8['dim'](_0x44980c[_0x4d8171(0x12b)]+_0x4d8171(0x112)));console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x106)]('=\x20'+_0x1b338b[_0x4d8171(0x12b)]+_0x4d8171(0x10f)));}_0xe41cf['length']>0x0&&!_0x16110a[_0x4d8171(0x17b)]&&(console[_0x4d8171(0x190)](''),console[_0x4d8171(0x190)](_0x4d8171(0x123)),_0x4410c4['length']>0x0&&console[_0x4d8171(0x190)]('\x20\x20\x20\x20'+a41_0x1da7e8['green']('+\x20'+_0x4410c4[_0x4d8171(0x12b)]+_0x4d8171(0x130))),_0x5baec2['length']>0x0&&console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x161)]('~\x20'+_0x5baec2['length']+'\x20to\x20update')),_0x561196[_0x4d8171(0x12b)]>0x0&&console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x12a)]('-\x20'+_0x561196[_0x4d8171(0x12b)]+'\x20to\x20delete')));console[_0x4d8171(0x190)]('\x20\x20Source:\x20'+a41_0x1da7e8['cyan'](_0x238d59)+'\x0a');if(_0x3a0096[_0x4d8171(0x12b)]>0x0){console[_0x4d8171(0x190)]('Folders\x20to\x20create:');for(const _0x3e070f of _0x3a0096){console[_0x4d8171(0x190)]('\x20\x20'+a41_0x1da7e8[_0x4d8171(0x17e)]('+')+'\x20'+_0x3e070f);}console[_0x4d8171(0x190)]('');}if(_0x41b29d[_0x4d8171(0x12b)]>0x0&&!_0x16110a['journeysOnly'])for(const _0xdca793 of _0x41b29d){const _0x1954c3=_0xdca793['folderPath']?_0xdca793[_0x4d8171(0x11a)]+'/'+_0xdca793['yamlConfig']['name']:_0xdca793['yamlConfig'][_0x4d8171(0x197)],_0x1b79b3=_0xdca793[_0x4d8171(0x175)][_0x4d8171(0x121)]?.['length']||0x0,_0x222a21=_0x1b79b3>0x0?a41_0x1da7e8[_0x4d8171(0x106)]('\x20['+_0x1b79b3+_0x4d8171(0x13c)):'';console['error']('\x0a'+a41_0x1da7e8['green'](_0x4d8171(0x182))+'\x20'+_0x1954c3+_0x222a21),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c)),_0xdca793[_0x4d8171(0x140)]&&console[_0x4d8171(0x190)](_0xdca793['diff']),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c));}if(_0x57a1a1[_0x4d8171(0x12b)]>0x0&&!_0x16110a['journeysOnly'])for(const _0x3832a6 of _0x57a1a1){const _0x3dc917=_0x3832a6[_0x4d8171(0x14e)]?_0x543bd4[_0x4d8171(0x16f)](_0x3832a6[_0x4d8171(0x14e)][_0x4d8171(0x160)]())||'':'',_0x100256=_0x3dc917?_0x3dc917+'/'+_0x3832a6['name']:_0x3832a6[_0x4d8171(0x197)],_0x4581c8=_0x577ef2[_0x4d8171(0x16f)](_0x3832a6['id'])||[],_0x4b3465=_0x4581c8[_0x4d8171(0x12b)]>0x0?a41_0x1da7e8[_0x4d8171(0x106)]('\x20['+_0x4581c8['length']+'\x20activations]'):'';console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8['red'](_0x4d8171(0x158))+'\x20'+_0x100256+_0x4b3465),console['error']('─'['repeat'](0x3c));const _0x45e9d5=segmentWithActivationsToYaml(_0x3832a6,_0x4581c8,undefined,_0xbe1ec1,_0x3f5de4),_0x391ce5=segmentToYamlString(_0x45e9d5),_0x455aad=generateDiff(_0x391ce5,'');console['error'](formatDiffWithColors(_0x455aad)),console['error']('─'[_0x4d8171(0x153)](0x3c));}const _0x1a5b2e=_0xf0b64a[_0x4d8171(0x150)](_0x37920e=>!_0x37920e[_0x4d8171(0x162)]&&_0x37920e[_0x4d8171(0x140)]);if(_0x1a5b2e['length']>0x0&&!_0x16110a[_0x4d8171(0x17b)])for(const _0x4650ab of _0x1a5b2e){const _0x3882fb=_0x4650ab[_0x4d8171(0x11a)]?_0x4650ab[_0x4d8171(0x11a)]+'/'+_0x4650ab[_0x4d8171(0x175)][_0x4d8171(0x197)]:_0x4650ab[_0x4d8171(0x175)]['name'];console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8[_0x4d8171(0x161)]('Changes\x20to:')+'\x20'+_0x3882fb),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c)),console[_0x4d8171(0x190)](_0x4650ab[_0x4d8171(0x140)]),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c));}if(_0x1e0c3a[_0x4d8171(0x12b)]>0x0)for(const _0x47dd6a of _0x1e0c3a){const _0x251266=_0x47dd6a['folderPath']?_0x47dd6a[_0x4d8171(0x11a)]+'/'+_0x47dd6a[_0x4d8171(0x175)][_0x4d8171(0x197)]:_0x47dd6a['yamlConfig'][_0x4d8171(0x197)];console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8['green']('New\x20journey:')+'\x20'+_0x251266),console[_0x4d8171(0x190)]('─'['repeat'](0x3c)),_0x47dd6a[_0x4d8171(0x140)]&&console[_0x4d8171(0x190)](_0x47dd6a[_0x4d8171(0x140)]),console['error']('─'[_0x4d8171(0x153)](0x3c));}const _0x23e719=_0x34e40e[_0x4d8171(0x150)](_0x28de9e=>!_0x28de9e[_0x4d8171(0x162)]&&_0x28de9e['diff']);if(_0x23e719[_0x4d8171(0x12b)]>0x0)for(const _0x2a0be6 of _0x23e719){const _0xb620f5=_0x2a0be6[_0x4d8171(0x11a)]?_0x2a0be6['folderPath']+'/'+_0x2a0be6[_0x4d8171(0x175)][_0x4d8171(0x197)]:_0x2a0be6[_0x4d8171(0x175)][_0x4d8171(0x197)];console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x13b))+'\x20'+_0xb620f5),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c)),console[_0x4d8171(0x190)](_0x2a0be6[_0x4d8171(0x140)]),console['error']('─'[_0x4d8171(0x153)](0x3c));}if(_0x148519[_0x4d8171(0x12b)]>0x0)for(const _0x34358d of _0x148519){const _0x4e6b33=_0x34358d[_0x4d8171(0x10b)]?_0x543bd4[_0x4d8171(0x16f)](_0x34358d['folderId'])||'':'',_0x29da38=_0x4e6b33?_0x4e6b33+'/'+_0x34358d[_0x4d8171(0x171)]:_0x34358d[_0x4d8171(0x171)];console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8['red'](_0x4d8171(0x194))+'\x20'+_0x29da38),console['error']('─'[_0x4d8171(0x153)](0x3c)),console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x134))),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c));}if(_0x16110a[_0x4d8171(0x12f)])return console[_0x4d8171(0x190)](a41_0x1da7e8['yellow'](_0x4d8171(0x122))),0x0;const _0xadf3f1=_0x16110a[_0x4d8171(0x17b)]?![]:_0x41b29d[_0x4d8171(0x12b)]>0x0||_0x1d0c5c[_0x4d8171(0x12b)]>0x0||_0x57a1a1[_0x4d8171(0x12b)]>0x0,_0x26cb96=_0x1e0c3a[_0x4d8171(0x12b)]>0x0||_0x2f8712[_0x4d8171(0x12b)]>0x0||_0x148519[_0x4d8171(0x12b)]>0x0,_0x3f9e86=_0x16110a['journeysOnly']?![]:_0xe41cf['length']>0x0,_0x3c78cd=_0x3a0096[_0x4d8171(0x12b)]>0x0;if(!_0xadf3f1&&!_0x26cb96&&!_0x3f9e86&&!_0x3c78cd){const _0x4dbc7a=_0x16110a['journeysOnly']?_0x4d8171(0x18e):_0x4d8171(0x108);console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x14d)](_0x4dbc7a));if(_0x285a8a&&_0x1946c4['length']===0x1){const _0x381dd3=_0x1946c4[0x0];if(_0x381dd3['existingSegment']?.['id']){const _0x5574fd=getConsoleNextUrl(_0x16110a[_0x4d8171(0x149)],_0x4d8171(0x135)+_0x4e0472+'/e/'+_0x381dd3[_0x4d8171(0x137)]['id']+_0x4d8171(0x124));console[_0x4d8171(0x190)](_0x4d8171(0x13e)+a41_0x1da7e8['cyan'](_0x5574fd));}}if(_0x285a8a&&_0x1b338b[_0x4d8171(0x12b)]===0x1){const _0xf0e02b=_0x1b338b[0x0];if(_0xf0e02b[_0x4d8171(0x10a)]?.['id']){const _0x31c5f1=getConsoleNextUrl(_0x16110a['site'],'/app/ps/'+_0x4e0472+'/e/'+_0xf0e02b[_0x4d8171(0x10a)]['id']+_0x4d8171(0x15b));console[_0x4d8171(0x190)]('\x20\x20'+a41_0x1da7e8[_0x4d8171(0x132)](_0x31c5f1));}}return 0x0;}const _0x5d3072=_0x16110a['journeysOnly']?_0x1e0c3a[_0x4d8171(0x12b)]+_0x2f8712[_0x4d8171(0x12b)]+_0x148519[_0x4d8171(0x12b)]+_0x3a0096['length']:_0x41b29d['length']+_0x1d0c5c[_0x4d8171(0x12b)]+_0x57a1a1['length']+_0x1e0c3a[_0x4d8171(0x12b)]+_0x2f8712[_0x4d8171(0x12b)]+_0x148519['length']+_0x3a0096[_0x4d8171(0x12b)]+_0xe41cf[_0x4d8171(0x12b)];if(!_0x16110a[_0x4d8171(0x12c)]&&_0x5d3072>0x0){if(!isInteractive())return console[_0x4d8171(0x190)](a41_0x1da7e8['red'](_0x4d8171(0x168)),_0x4d8171(0x19e)),console['error'](a41_0x1da7e8[_0x4d8171(0x106)](_0x4d8171(0x129))),0x1;const _0x231aa6=await confirmKey('Push\x20'+_0x5d3072+_0x4d8171(0x18f));if(!_0x231aa6)return console[_0x4d8171(0x190)](a41_0x1da7e8['yellow']('Aborted.')),0x1;}const _0x1c36b8={'withProgress':async(_0x170272,_0x56ee8b)=>{const _0x5aef60=_0x4d8171,_0x562130=await withSpinner(_0x170272,_0x56ee8b,{'verbose':_0x16110a[_0x5aef60(0x15c)]});return{'data':_0x562130[_0x5aef60(0x13a)]};},'logInfo':_0x1b95ba=>console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x17e)]('✔\x20'+_0x1b95ba)),'logSuccess':_0x44af60=>console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x14d)]('✔\x20'+_0x44af60)),'logWarning':_0xbad3cd=>console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x161)]('⚠\x20'+_0xbad3cd)),'logDeleted':_0xfc9df8=>console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)]('✔\x20'+_0xfc9df8))},_0x97db95={'segment':_0xdb3b32[_0x4d8171(0x169)],'journey':_0xdb3b32[_0x4d8171(0x11e)],'user':_0xdb3b32[_0x4d8171(0x144)],'connection':_0xdb3b32[_0x4d8171(0x181)]};_0x3a0096['length']>0x0&&(_0x4dd412=await executePushFolders(_0x97db95,_0x3a0096,_0x4dd412,{'parentId':_0x4e0472},_0x1c36b8));const _0x4d14fd={'rootFolderId':_0x47327f,'folderPathToId':_0x4dd412,'folderIdToPath':_0x543bd4,'segmentNameToId':_0x54808d,'activationsBySegmentId':_0x577ef2,'emailToIdMap':_0x2bf6cb,'idToEmailMap':_0xbe1ec1,'connectionNameToIdMap':_0x4b8781[_0x4d8171(0x17c)],'connectionIdToNameMap':_0x4b8781[_0x4d8171(0x128)],'connectionNameToTypeMap':_0x2e66c5},_0x4282d7=await executePushSegments(_0x97db95,_0x16110a['journeysOnly']?[]:_0xf0b64a,_0x4d14fd,{'parentId':_0x4e0472},_0x1c36b8),_0xe33271=_0x4282d7[_0x4d8171(0x195)],_0x40814f=_0x4282d7['updated'],_0x17a993=_0x4282d7['activations'][_0x4d8171(0x195)],_0x591f6a=_0x4282d7[_0x4d8171(0x121)][_0x4d8171(0x19f)],_0x309bf3=_0x4282d7[_0x4d8171(0x121)][_0x4d8171(0x18b)];let _0x44cc9f;if(_0x285a8a&&_0xf0b64a[_0x4d8171(0x12b)]===0x1){const _0x26eaa1=_0xf0b64a[0x0];_0x44cc9f=_0x26eaa1['existingSegment']?.['id']??_0x4282d7[_0x4d8171(0x10e)][_0x4d8171(0x16f)](_0x26eaa1[_0x4d8171(0x175)][_0x4d8171(0x197)]);}const _0x3f11da=await executePushSegmentDeletions(_0x97db95,_0x16110a['journeysOnly']?[]:_0x57a1a1,_0x1c36b8);let _0x181640=0x0,_0x52d691=0x0,_0x294e1e=0x0;const _0x3b20c8=new Map(_0x54808d);for(const [_0x3ff585,_0x5f42a8]of _0x4282d7[_0x4d8171(0x10e)]){_0x3b20c8[_0x4d8171(0x147)](_0x3ff585,_0x5f42a8);}if(_0x34e40e[_0x4d8171(0x12b)]>0x0){const _0x1d0943={..._0x4d14fd,'segmentNameToId':_0x3b20c8,'existingSegments':_0x59fa00,'activationContext':_0x529bd6},_0x508487=await executePushJourneys(_0x97db95,_0x34e40e,_0x1d0943,{'parentId':_0x4e0472,'rootFolderId':_0x47327f,'verbose':_0x16110a[_0x4d8171(0x15c)]},_0x1c36b8);_0x181640=_0x508487[_0x4d8171(0x195)],_0x52d691=_0x508487[_0x4d8171(0x19f)];if(_0x285a8a&&_0x508487[_0x4d8171(0x193)][_0x4d8171(0x12b)]===0x1){const _0x16bb89=_0x508487[_0x4d8171(0x193)][0x0];if(_0x16bb89[_0x4d8171(0x16b)]){const _0x2c836f=getConsoleNextUrl(_0x16110a[_0x4d8171(0x149)],_0x4d8171(0x135)+_0x4e0472+_0x4d8171(0x10c)+_0x16bb89[_0x4d8171(0x16b)]+_0x4d8171(0x15b));console[_0x4d8171(0x190)]('\x20\x20'+a41_0x1da7e8[_0x4d8171(0x132)](_0x2c836f));}}}for(const _0x56d68e of _0x148519){console['error'](a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x113)+_0x56d68e[_0x4d8171(0x171)])),_0x294e1e++;}const _0x43079e=[];if(_0xe33271>0x0)_0x43079e['push'](_0xe33271+_0x4d8171(0x15a));if(_0x40814f>0x0)_0x43079e[_0x4d8171(0x19a)](_0x40814f+_0x4d8171(0x11f));if(_0x3f11da>0x0)_0x43079e[_0x4d8171(0x19a)](_0x3f11da+_0x4d8171(0x174));const _0xe71a12=[];if(_0x181640>0x0)_0xe71a12['push'](_0x181640+_0x4d8171(0x15a));if(_0x52d691>0x0)_0xe71a12[_0x4d8171(0x19a)](_0x52d691+_0x4d8171(0x11f));if(_0x294e1e>0x0)_0xe71a12[_0x4d8171(0x19a)](_0x294e1e+_0x4d8171(0x174));const _0x37b13a=[];if(_0x17a993>0x0)_0x37b13a[_0x4d8171(0x19a)](_0x17a993+_0x4d8171(0x15a));if(_0x591f6a>0x0)_0x37b13a[_0x4d8171(0x19a)](_0x591f6a+_0x4d8171(0x11f));if(_0x309bf3>0x0)_0x37b13a['push'](_0x309bf3+_0x4d8171(0x174));console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x14d)](_0x4d8171(0x10d)));_0x43079e['length']>0x0&&!_0x16110a[_0x4d8171(0x17b)]&&console[_0x4d8171(0x190)]('\x20\x20Segments:\x20'+_0x43079e[_0x4d8171(0x12d)](',\x20'));_0xe71a12[_0x4d8171(0x12b)]>0x0&&console[_0x4d8171(0x190)](_0x4d8171(0x157)+_0xe71a12[_0x4d8171(0x12d)](',\x20'));_0x37b13a['length']>0x0&&!_0x16110a[_0x4d8171(0x17b)]&&console[_0x4d8171(0x190)](_0x4d8171(0x176)+_0x37b13a['join'](',\x20'));if(_0x44cc9f){const _0x18abd8=getConsoleNextUrl(_0x16110a[_0x4d8171(0x149)],'/app/ps/'+_0x4e0472+_0x4d8171(0x10c)+_0x44cc9f+_0x4d8171(0x124));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x1da7e8[_0x4d8171(0x132)](_0x18abd8));}return 0x0;}}
@@ -1 +1 @@
1
- function a42_0xced4(){const _0x26c95f=['description','segment','Resolved\x20folder\x20ID:\x20','Resolved\x20type:\x20','72AxZJUw','228676PqVwhD','segment:update','1602762guLDZK','kind','verbose','folder','Resolving\x20path\x20\x27','6FOGPkD','5930712VmYzjM','segmentId','length','parentId','Parent\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','565433Aedaoq','error','segmentPath','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','✔\x20Updated\x20segment\x20\x27','yellow','resolvePathToResource','INTERNAL','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','328710pGqIme','name','\x27...','includes','588yeMImW','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20Path:\x20','95TkzWvH','execute','data','6526SRLABJ','Error:\x20Cannot\x20update\x20','8262499pBPhOj','Updating\x20segment\x20\x27','1ZAjeav','Segment\x20ID:\x20','resolveFolderId'];a42_0xced4=function(){return _0x26c95f;};return a42_0xced4();}const a42_0x38cb81=a42_0x2390;(function(_0xda3255,_0xb47c12){const _0x4a1a97=a42_0x2390,_0x49111c=_0xda3255();while(!![]){try{const _0x1b07bf=-parseInt(_0x4a1a97(0xa5))/0x1*(-parseInt(_0x4a1a97(0xa1))/0x2)+-parseInt(_0x4a1a97(0xaf))/0x3+parseInt(_0x4a1a97(0xad))/0x4*(-parseInt(_0x4a1a97(0x9e))/0x5)+-parseInt(_0x4a1a97(0xb4))/0x6*(parseInt(_0x4a1a97(0xa3))/0x7)+parseInt(_0x4a1a97(0xb5))/0x8+-parseInt(_0x4a1a97(0xac))/0x9*(-parseInt(_0x4a1a97(0xc6))/0xa)+parseInt(_0x4a1a97(0xbd))/0xb*(parseInt(_0x4a1a97(0xca))/0xc);if(_0x1b07bf===_0xb47c12)break;else _0x49111c['push'](_0x49111c['shift']());}catch(_0x489bde){_0x49111c['push'](_0x49111c['shift']());}}}(a42_0xced4,0xb11f7));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x2849d3 from'chalk';function a42_0x2390(_0x28496f,_0x51511c){_0x28496f=_0x28496f-0x9c;const _0xced4dc=a42_0xced4();let _0x239053=_0xced4dc[_0x28496f];return _0x239053;}export class SegmentUpdateCommand extends BaseCommand{[a42_0x38cb81(0xc7)]=a42_0x38cb81(0xae);['description']='Update\x20existing\x20child\x20segment';async[a42_0x38cb81(0x9f)](_0x108c74){const _0x3c7add=a42_0x38cb81;console['error'](a42_0x2849d3[_0x3c7add(0xc2)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x3c7add(0xbe)](a42_0x2849d3[_0x3c7add(0xc2)](_0x3c7add(0xba)));const {options:_0x434919,args:_0x264999,tdx:_0x37882f}=_0x108c74,_0x353a18=_0x434919;if(_0x264999[_0x3c7add(0xb7)]===0x0)return console[_0x3c7add(0xbe)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x3c7add(0xbc)),console[_0x3c7add(0xbe)]('Examples:'),console[_0x3c7add(0xbe)](_0x3c7add(0xc0)),console[_0x3c7add(0xbe)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x279e50=_0x264999[0x0],_0x2dcbe4=_0x434919[_0x3c7add(0xbf)];let _0x515e46=_0x279e50;_0x2dcbe4&&!_0x279e50[_0x3c7add(0xc9)]('/')&&(_0x515e46=_0x2dcbe4+'/'+_0x279e50,_0x353a18[_0x3c7add(0xb1)]&&console[_0x3c7add(0xbe)]('Resolved\x20relative\x20path\x20to:\x20'+_0x515e46));const _0x5b6252=await withSpinner(_0x3c7add(0xb3)+_0x515e46+_0x3c7add(0xc8),()=>_0x37882f[_0x3c7add(0xa9)][_0x3c7add(0xc3)](_0x515e46),{'verbose':_0x353a18[_0x3c7add(0xb1)]}),_0xf6fd37=_0x5b6252[_0x3c7add(0xa0)];_0x353a18[_0x3c7add(0xb1)]&&console['error'](_0x3c7add(0xab)+_0xf6fd37[_0x3c7add(0xbb)]);if(_0xf6fd37[_0x3c7add(0xbb)]!==_0x3c7add(0xa9))return console[_0x3c7add(0xbe)](_0x3c7add(0xa2)+_0xf6fd37[_0x3c7add(0xbb)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x3c7add(0xbe)](_0x3c7add(0xc5)),0x1;if(!_0xf6fd37[_0x3c7add(0xb6)])throw new SDKError(ErrorCode[_0x3c7add(0xc4)],_0x3c7add(0x9c));const _0x3fdaca=_0xf6fd37[_0x3c7add(0xb8)],_0x3328c1=_0xf6fd37[_0x3c7add(0xb6)];_0x353a18[_0x3c7add(0xb1)]&&(console[_0x3c7add(0xbe)](_0x3c7add(0xb9)+_0x3fdaca),console['error'](_0x3c7add(0xa6)+_0x3328c1));let _0x253844;if(_0x353a18[_0x3c7add(0xb2)]){const _0x4edd91=_0x353a18[_0x3c7add(0xb2)],_0x31d5b1=await withSpinner('Resolving\x20folder\x20\x27'+_0x4edd91+_0x3c7add(0xc8),()=>_0x37882f['segment'][_0x3c7add(0xa7)](_0x3fdaca,_0x4edd91),{'verbose':_0x353a18[_0x3c7add(0xb1)]});_0x253844=parseInt(_0x31d5b1[_0x3c7add(0xa0)],0xa),_0x353a18[_0x3c7add(0xb1)]&&console[_0x3c7add(0xbe)](_0x3c7add(0xaa)+_0x253844);}const _0x1dad22=await loadJSONFromOptions(_0x353a18['rule'],_0x353a18['ruleFile']),_0x8ab9c6={'name':_0x353a18[_0x3c7add(0xc7)],'description':_0x353a18[_0x3c7add(0xa8)],'rule':_0x1dad22,'kind':_0x353a18[_0x3c7add(0xb0)]!==undefined?parseInt(_0x353a18[_0x3c7add(0xb0)],0xa):undefined,'segmentFolderId':_0x253844},_0x47cc9c=await withSpinner(_0x3c7add(0xa4)+_0xf6fd37['segmentName']+_0x3c7add(0xc8),()=>_0x37882f[_0x3c7add(0xa9)]['updateSegmentById'](_0x3fdaca,_0x3328c1,_0x8ab9c6),{'verbose':_0x353a18[_0x3c7add(0xb1)]}),_0x58fbde=_0x47cc9c[_0x3c7add(0xa0)];return console[_0x3c7add(0xbe)](_0x3c7add(0xc1)+_0x58fbde[_0x3c7add(0xc7)]+'\x27'),_0x515e46!==_0x279e50&&console[_0x3c7add(0xbe)](_0x3c7add(0x9d)+_0x515e46),await handleSDKOutput([_0x58fbde],_0x353a18),0x0;}}
1
+ function a42_0x6119(){const _0x4e5b53=['628693ZccvOr','Resolved\x20type:\x20','\x27...','description','Parent\x20ID:\x20','name','segmentId','7433625YetBcE','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','852928mlPYZk','INTERNAL','Resolved\x20relative\x20path\x20to:\x20','segmentName','rule','segment','updateSegmentById','678498vMGwfY','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentPath','6290912gZgtco','\x20\x20\x20Path:\x20','ruleFile','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','28uZBgMJ','type','4kGxINO','resolveFolderId','Resolved\x20folder\x20ID:\x20','12299427vFdCsh','yellow','Resolving\x20path\x20\x27','275TIxLuA','1757830Ecphpn','error','verbose','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','kind','data','✔\x20Updated\x20segment\x20\x27','21aPdXDW','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','folder','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Updating\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'];a42_0x6119=function(){return _0x4e5b53;};return a42_0x6119();}const a42_0x4a91aa=a42_0x16e9;(function(_0x5c4a5f,_0xb9128f){const _0x1bfa85=a42_0x16e9,_0x505964=_0x5c4a5f();while(!![]){try{const _0x5496f9=parseInt(_0x1bfa85(0x19f))/0x1*(parseInt(_0x1bfa85(0x18b))/0x2)+-parseInt(_0x1bfa85(0x199))/0x3*(-parseInt(_0x1bfa85(0x1a9))/0x4)+parseInt(_0x1bfa85(0x1a6))/0x5+-parseInt(_0x1bfa85(0x1b0))/0x6*(-parseInt(_0x1bfa85(0x189))/0x7)+-parseInt(_0x1bfa85(0x184))/0x8+parseInt(_0x1bfa85(0x18e))/0x9+parseInt(_0x1bfa85(0x192))/0xa*(-parseInt(_0x1bfa85(0x191))/0xb);if(_0x5496f9===_0xb9128f)break;else _0x505964['push'](_0x505964['shift']());}catch(_0x26144a){_0x505964['push'](_0x505964['shift']());}}}(a42_0x6119,0xd58eb));function a42_0x16e9(_0x1b2660,_0x537a16){_0x1b2660=_0x1b2660-0x184;const _0x6119f4=a42_0x6119();let _0x16e965=_0x6119f4[_0x1b2660];return _0x16e965;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x270418 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x4a91aa(0x1a4)]='segment:update';[a42_0x4a91aa(0x1a2)]='Update\x20existing\x20child\x20segment';async['execute'](_0x4e3251){const _0x4ff58d=a42_0x4a91aa;console[_0x4ff58d(0x193)](a42_0x270418[_0x4ff58d(0x18f)](_0x4ff58d(0x19c))),console[_0x4ff58d(0x193)](a42_0x270418[_0x4ff58d(0x18f)](_0x4ff58d(0x195)));const {options:_0x5f590a,args:_0x49de0b,tdx:_0x2127d5}=_0x4e3251,_0x4d0934=_0x5f590a;if(_0x49de0b['length']===0x0)return console[_0x4ff58d(0x193)](_0x4ff58d(0x19e)),console[_0x4ff58d(0x193)](_0x4ff58d(0x1a8)),console[_0x4ff58d(0x193)](_0x4ff58d(0x187)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x4ff58d(0x193)](_0x4ff58d(0x188)),0x1;const _0x5dec78=_0x49de0b[0x0],_0x495d03=_0x5f590a[_0x4ff58d(0x1b2)];let _0x248f24=_0x5dec78;_0x495d03&&!_0x5dec78['includes']('/')&&(_0x248f24=_0x495d03+'/'+_0x5dec78,_0x4d0934[_0x4ff58d(0x194)]&&console['error'](_0x4ff58d(0x1ab)+_0x248f24));const _0x79d675=await withSpinner(_0x4ff58d(0x190)+_0x248f24+_0x4ff58d(0x1a1),()=>_0x2127d5[_0x4ff58d(0x1ae)]['resolvePathToResource'](_0x248f24),{'verbose':_0x4d0934[_0x4ff58d(0x194)]}),_0x33f8ec=_0x79d675[_0x4ff58d(0x197)];_0x4d0934[_0x4ff58d(0x194)]&&console['error'](_0x4ff58d(0x1a0)+_0x33f8ec['type']);if(_0x33f8ec['type']!=='segment')return console[_0x4ff58d(0x193)]('Error:\x20Cannot\x20update\x20'+_0x33f8ec[_0x4ff58d(0x18a)]+_0x4ff58d(0x1b1)),console[_0x4ff58d(0x193)](_0x4ff58d(0x19a)),0x1;if(!_0x33f8ec[_0x4ff58d(0x1a5)])throw new SDKError(ErrorCode[_0x4ff58d(0x1aa)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3b6043=_0x33f8ec['parentId'],_0x245af3=_0x33f8ec[_0x4ff58d(0x1a5)];_0x4d0934['verbose']&&(console[_0x4ff58d(0x193)](_0x4ff58d(0x1a3)+_0x3b6043),console[_0x4ff58d(0x193)](_0x4ff58d(0x1a7)+_0x245af3));let _0x2683dc;if(_0x4d0934[_0x4ff58d(0x19b)]){const _0xb98b3a=_0x4d0934[_0x4ff58d(0x19b)],_0x390cfe=await withSpinner('Resolving\x20folder\x20\x27'+_0xb98b3a+_0x4ff58d(0x1a1),()=>_0x2127d5['segment'][_0x4ff58d(0x18c)](_0x3b6043,_0xb98b3a),{'verbose':_0x4d0934[_0x4ff58d(0x194)]});_0x2683dc=parseInt(_0x390cfe[_0x4ff58d(0x197)],0xa),_0x4d0934[_0x4ff58d(0x194)]&&console[_0x4ff58d(0x193)](_0x4ff58d(0x18d)+_0x2683dc);}const _0x5ad0f0=await loadJSONFromOptions(_0x4d0934[_0x4ff58d(0x1ad)],_0x4d0934[_0x4ff58d(0x186)]),_0x171078={'name':_0x4d0934[_0x4ff58d(0x1a4)],'description':_0x4d0934[_0x4ff58d(0x1a2)],'rule':_0x5ad0f0,'kind':_0x4d0934[_0x4ff58d(0x196)]!==undefined?parseInt(_0x4d0934[_0x4ff58d(0x196)],0xa):undefined,'segmentFolderId':_0x2683dc},_0x1b90f4=await withSpinner(_0x4ff58d(0x19d)+_0x33f8ec[_0x4ff58d(0x1ac)]+_0x4ff58d(0x1a1),()=>_0x2127d5[_0x4ff58d(0x1ae)][_0x4ff58d(0x1af)](_0x3b6043,_0x245af3,_0x171078),{'verbose':_0x4d0934[_0x4ff58d(0x194)]}),_0x4b49fa=_0x1b90f4[_0x4ff58d(0x197)];return console[_0x4ff58d(0x193)](_0x4ff58d(0x198)+_0x4b49fa[_0x4ff58d(0x1a4)]+'\x27'),_0x248f24!==_0x5dec78&&console[_0x4ff58d(0x193)](_0x4ff58d(0x185)+_0x248f24),await handleSDKOutput([_0x4b49fa],_0x4d0934),0x0;}}
@@ -1 +1 @@
1
- const a43_0x1edf78=a43_0x2173;(function(_0x1881f4,_0x2157a9){const _0x200b0f=a43_0x2173,_0x42995a=_0x1881f4();while(!![]){try{const _0x4d2cc3=parseInt(_0x200b0f(0x1ff))/0x1+parseInt(_0x200b0f(0x205))/0x2+-parseInt(_0x200b0f(0x1fb))/0x3+-parseInt(_0x200b0f(0x21a))/0x4*(parseInt(_0x200b0f(0x216))/0x5)+parseInt(_0x200b0f(0x1fc))/0x6*(parseInt(_0x200b0f(0x212))/0x7)+-parseInt(_0x200b0f(0x1f1))/0x8*(-parseInt(_0x200b0f(0x20f))/0x9)+parseInt(_0x200b0f(0x208))/0xa*(parseInt(_0x200b0f(0x222))/0xb);if(_0x4d2cc3===_0x2157a9)break;else _0x42995a['push'](_0x42995a['shift']());}catch(_0x103d69){_0x42995a['push'](_0x42995a['shift']());}}}(a43_0x1bbc,0xd7c4f));import{existsSync,statSync}from'fs';import a43_0x5d0b9e from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x2173(_0x10ae4a,_0x1f17e1){_0x10ae4a=_0x10ae4a-0x1ef;const _0x1bbc55=a43_0x1bbc();let _0x21732f=_0x1bbc55[_0x10ae4a];return _0x21732f;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a43_0x1bbc(){const _0x443da9=['Folder\x20ID:\x20','length','join','\x27...','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','4483959NBtkxq','1380kXGiej','name','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','1002807ZACPas','segment','isAbsolute','type','split','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','1950954ZVkcVU','segmentPath','folderId','173100mEuuTG','red','session','Error:\x20Path\x20is\x20required\x0a','parentName','cyan','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','9MIHpuT','green','isDirectory','16177tHcBQM','✔\x20Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','fullPath','8783205AdvVtW','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Usage:\x20tdx\x20segment\x20use\x20<path>','parentId','4twmvkM','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','log','config','folderPath','verbose','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Examples:','22yWYpri','segment:use','slice','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','error','execute','12725208frJaFj','dim','description','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'];a43_0x1bbc=function(){return _0x443da9;};return a43_0x1bbc();}export class SegmentUseCommand extends BaseCommand{[a43_0x1edf78(0x1fd)]=a43_0x1edf78(0x223);[a43_0x1edf78(0x1f3)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x1edf78(0x1f0)](_0xb6443a){const _0x574005=a43_0x1edf78,{options:_0x45f105,args:_0x4f6365,tdx:_0x1d1edf}=_0xb6443a;if(_0x4f6365[_0x574005(0x1f6)]===0x0)return console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x209)](_0x574005(0x20b))),console['error'](_0x574005(0x218)),console[_0x574005(0x1ef)](_0x574005(0x221)),console[_0x574005(0x1ef)](_0x574005(0x1f9)),console[_0x574005(0x1ef)](_0x574005(0x1fe)),console[_0x574005(0x1ef)](_0x574005(0x214)),console[_0x574005(0x1ef)](_0x574005(0x217)),0x1;const _0x5e8fc9=_0x4f6365[0x0],_0x427c95=_0x45f105[_0x574005(0x20a)];try{if(_0x5e8fc9==='/')return saveSessionContext({'segment_path':undefined},_0x427c95),console[_0x574005(0x21c)](a43_0x5d0b9e['green'](_0x574005(0x20e))),0x0;if(existsSync(_0x5e8fc9)&&statSync(_0x5e8fc9)[_0x574005(0x211)]()){let _0x528274;try{_0x528274=findTdxConfig(_0x5e8fc9);}catch{return console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x209)](_0x574005(0x21b)+_0x5e8fc9)),console[_0x574005(0x1ef)](a43_0x5d0b9e['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x5ba7d0=_0x528274[_0x574005(0x21d)]['parent_segment'];return saveSessionContext({'segment_path':_0x5ba7d0,'parent_segment':_0x5ba7d0},_0x427c95),console['log'](a43_0x5d0b9e['green'](_0x574005(0x213)+a43_0x5d0b9e[_0x574005(0x20d)](_0x5ba7d0))),0x0;}const _0x3f7925=_0x45f105[_0x574005(0x206)];let _0x3ad885=_0x5e8fc9;const _0xe7f909=parsePath(_0x5e8fc9);if(!_0xe7f909[_0x574005(0x201)]){if(!_0x3f7925)return console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x209)](_0x574005(0x1fa))),console['error'](a43_0x5d0b9e['cyan'](_0x574005(0x220))),0x1;if(_0x5e8fc9==='..'){const _0x536474=_0x3f7925[_0x574005(0x203)]('/')[_0x574005(0x224)](0x0,-0x1)[_0x574005(0x1f7)]('/');_0x3ad885=_0x536474||'/';}else _0x5e8fc9==='.'?_0x3ad885=_0x3f7925:_0x3ad885=_0x3f7925+'/'+_0x5e8fc9;_0x45f105[_0x574005(0x21f)]&&console['error'](_0x574005(0x226)+_0x3ad885);}if(_0x3ad885==='/'||_0x3ad885==='')return saveSessionContext({'segment_path':undefined},_0x427c95),console[_0x574005(0x21c)](a43_0x5d0b9e[_0x574005(0x210)](_0x574005(0x20e))),0x0;_0x3ad885=normalizePath(_0x3ad885);const _0x25d3b2=parsePath(_0x3ad885)['segments'];if(_0x25d3b2[_0x574005(0x1f6)]===0x0)return saveSessionContext({'segment_path':undefined},_0x427c95),console['log'](a43_0x5d0b9e[_0x574005(0x210)](_0x574005(0x20e))),0x0;_0x45f105[_0x574005(0x21f)]&&(console[_0x574005(0x1ef)]('Site:\x20'+_0x45f105['site']),console[_0x574005(0x1ef)]('Target\x20path:\x20'+_0x3ad885));const _0x45f180=await withSpinner('Resolving\x20path\x20\x27'+_0x3ad885+_0x574005(0x1f8),()=>_0x1d1edf[_0x574005(0x200)][_0x574005(0x225)](_0x3ad885),{'verbose':_0x45f105[_0x574005(0x21f)]}),_0x1e9157=_0x45f180['data'];_0x45f105[_0x574005(0x21f)]&&(console[_0x574005(0x1ef)]('Resolved\x20path\x20type:\x20'+_0x1e9157[_0x574005(0x202)]),console[_0x574005(0x1ef)]('Parent\x20ID:\x20'+_0x1e9157[_0x574005(0x219)]),_0x1e9157[_0x574005(0x207)]&&console[_0x574005(0x1ef)](_0x574005(0x1f5)+_0x1e9157[_0x574005(0x207)]));if(_0x1e9157[_0x574005(0x202)]===_0x574005(0x200))return console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x209)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x574005(0x1ef)](_0x574005(0x204)),console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x20d)]('Use:\x20tdx\x20segment\x20use\x20'+_0x1e9157['parentName']+(_0x1e9157[_0x574005(0x21e)]?'/'+_0x1e9157['folderPath'][_0x574005(0x1f7)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1e9157['fullPath'],'parent_segment':_0x1e9157[_0x574005(0x20c)]},_0x427c95),console[_0x574005(0x21c)](a43_0x5d0b9e['green'](_0x574005(0x213)+a43_0x5d0b9e[_0x574005(0x20d)](_0x1e9157[_0x574005(0x215)]))),_0x45f105['verbose']&&(console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x1f2)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a43_0x5d0b9e[_0x574005(0x1f2)](_0x574005(0x1f4)))),0x0;}catch(_0x3df6d2){throw _0x3df6d2;}}}
1
+ const a43_0xe04106=a43_0x4059;(function(_0x4b06cf,_0x2503ca){const _0x4bf7ea=a43_0x4059,_0x623cef=_0x4b06cf();while(!![]){try{const _0x4ab515=parseInt(_0x4bf7ea(0x1fa))/0x1*(-parseInt(_0x4bf7ea(0x208))/0x2)+parseInt(_0x4bf7ea(0x1ee))/0x3*(-parseInt(_0x4bf7ea(0x1fb))/0x4)+parseInt(_0x4bf7ea(0x209))/0x5*(parseInt(_0x4bf7ea(0x1dc))/0x6)+-parseInt(_0x4bf7ea(0x20b))/0x7*(parseInt(_0x4bf7ea(0x1f6))/0x8)+parseInt(_0x4bf7ea(0x20d))/0x9+parseInt(_0x4bf7ea(0x1d7))/0xa*(-parseInt(_0x4bf7ea(0x1f5))/0xb)+parseInt(_0x4bf7ea(0x1d8))/0xc;if(_0x4ab515===_0x2503ca)break;else _0x623cef['push'](_0x623cef['shift']());}catch(_0x259435){_0x623cef['push'](_0x623cef['shift']());}}}(a43_0x13c4,0xb6bfe));import{existsSync,statSync}from'fs';import a43_0xfe8d48 from'chalk';function a43_0x13c4(){const _0x5af57f=['name','verbose','length','fullPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Target\x20path:\x20','config','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','261djaqLF','Examples:','execute','segments','data','type','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','22jYOQfo','24FBPaur','folderPath','parentId','\x27...','1372218CGeRrs','6908TPhPsQ','site','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','dim','slice','green','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','join','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','2FXfmWK','6867605tibczo','Resolved\x20path\x20type:\x20','2802590QMxfcX','Folder\x20ID:\x20','2004669MBspmf','description','✔\x20Context\x20set\x20to:\x20','error','4211790YPFQCo','32618580rquFFH','session','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','segment:use','6RUlcfZ','Use:\x20tdx\x20segment\x20use\x20','cyan','parent_segment','segment','isAbsolute','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','segmentPath','red','log'];a43_0x13c4=function(){return _0x5af57f;};return a43_0x13c4();}import{BaseCommand}from'./command.js';function a43_0x4059(_0x16dd5f,_0x3dbdd2){_0x16dd5f=_0x16dd5f-0x1d6;const _0x13c44c=a43_0x13c4();let _0x4059a6=_0x13c44c[_0x16dd5f];return _0x4059a6;}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_0xe04106(0x1e6)]=a43_0xe04106(0x1db);[a43_0xe04106(0x20e)]=a43_0xe04106(0x1da);async[a43_0xe04106(0x1f0)](_0x5f209f){const _0x280d2c=a43_0xe04106,{options:_0x46258c,args:_0x2f81c0,tdx:_0x502a4a}=_0x5f209f;if(_0x2f81c0['length']===0x0)return console['error'](a43_0xfe8d48['red']('Error:\x20Path\x20is\x20required\x0a')),console[_0x280d2c(0x1d6)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0x280d2c(0x1ef)),console[_0x280d2c(0x1d6)](_0x280d2c(0x1ff)),console[_0x280d2c(0x1d6)](_0x280d2c(0x1fe)),console[_0x280d2c(0x1d6)](_0x280d2c(0x1fd)),console['error'](_0x280d2c(0x1e2)),0x1;const _0x4670e0=_0x2f81c0[0x0],_0x4d42d9=_0x46258c[_0x280d2c(0x1d9)];try{if(_0x4670e0==='/')return saveSessionContext({'segment_path':undefined},_0x4d42d9),console['log'](a43_0xfe8d48[_0x280d2c(0x202)](_0x280d2c(0x1f4))),0x0;if(existsSync(_0x4670e0)&&statSync(_0x4670e0)['isDirectory']()){let _0x5c6e83;try{_0x5c6e83=findTdxConfig(_0x4670e0);}catch{return console['error'](a43_0xfe8d48[_0x280d2c(0x1e4)](_0x280d2c(0x206)+_0x4670e0)),console[_0x280d2c(0x1d6)](a43_0xfe8d48[_0x280d2c(0x1de)](_0x280d2c(0x1ed))),0x1;}const _0x9a4454=_0x5c6e83[_0x280d2c(0x1ec)][_0x280d2c(0x1df)];return saveSessionContext({'segment_path':_0x9a4454,'parent_segment':_0x9a4454},_0x4d42d9),console[_0x280d2c(0x1e5)](a43_0xfe8d48['green'](_0x280d2c(0x20f)+a43_0xfe8d48[_0x280d2c(0x1de)](_0x9a4454))),0x0;}const _0x2ecf92=_0x46258c[_0x280d2c(0x1e3)];let _0x40b927=_0x4670e0;const _0x10fc45=parsePath(_0x4670e0);if(!_0x10fc45[_0x280d2c(0x1e1)]){if(!_0x2ecf92)return console[_0x280d2c(0x1d6)](a43_0xfe8d48[_0x280d2c(0x1e4)](_0x280d2c(0x1ea))),console[_0x280d2c(0x1d6)](a43_0xfe8d48[_0x280d2c(0x1de)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x4670e0==='..'){const _0xe0ae33=_0x2ecf92['split']('/')[_0x280d2c(0x201)](0x0,-0x1)[_0x280d2c(0x205)]('/');_0x40b927=_0xe0ae33||'/';}else _0x4670e0==='.'?_0x40b927=_0x2ecf92:_0x40b927=_0x2ecf92+'/'+_0x4670e0;_0x46258c[_0x280d2c(0x1e7)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x40b927);}if(_0x40b927==='/'||_0x40b927==='')return saveSessionContext({'segment_path':undefined},_0x4d42d9),console[_0x280d2c(0x1e5)](a43_0xfe8d48[_0x280d2c(0x202)](_0x280d2c(0x1f4))),0x0;_0x40b927=normalizePath(_0x40b927);const _0x33ac66=parsePath(_0x40b927)[_0x280d2c(0x1f1)];if(_0x33ac66[_0x280d2c(0x1e8)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4d42d9),console['log'](a43_0xfe8d48[_0x280d2c(0x202)](_0x280d2c(0x1f4))),0x0;_0x46258c[_0x280d2c(0x1e7)]&&(console[_0x280d2c(0x1d6)]('Site:\x20'+_0x46258c[_0x280d2c(0x1fc)]),console[_0x280d2c(0x1d6)](_0x280d2c(0x1eb)+_0x40b927));const _0x1206fd=await withSpinner('Resolving\x20path\x20\x27'+_0x40b927+_0x280d2c(0x1f9),()=>_0x502a4a['segment']['resolvePathToResource'](_0x40b927),{'verbose':_0x46258c['verbose']}),_0x240d3c=_0x1206fd[_0x280d2c(0x1f2)];_0x46258c['verbose']&&(console[_0x280d2c(0x1d6)](_0x280d2c(0x20a)+_0x240d3c[_0x280d2c(0x1f3)]),console['error']('Parent\x20ID:\x20'+_0x240d3c[_0x280d2c(0x1f8)]),_0x240d3c['folderId']&&console[_0x280d2c(0x1d6)](_0x280d2c(0x20c)+_0x240d3c['folderId']));if(_0x240d3c[_0x280d2c(0x1f3)]===_0x280d2c(0x1e0))return console[_0x280d2c(0x1d6)](a43_0xfe8d48['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x280d2c(0x1d6)](_0x280d2c(0x204)),console['error'](a43_0xfe8d48[_0x280d2c(0x1de)](_0x280d2c(0x1dd)+_0x240d3c['parentName']+(_0x240d3c[_0x280d2c(0x1f7)]?'/'+_0x240d3c[_0x280d2c(0x1f7)][_0x280d2c(0x205)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x240d3c[_0x280d2c(0x1e9)],'parent_segment':_0x240d3c['parentName']},_0x4d42d9),console['log'](a43_0xfe8d48[_0x280d2c(0x202)]('✔\x20Context\x20set\x20to:\x20'+a43_0xfe8d48[_0x280d2c(0x1de)](_0x240d3c[_0x280d2c(0x1e9)]))),_0x46258c['verbose']&&(console['error'](a43_0xfe8d48['dim'](_0x280d2c(0x203))),console[_0x280d2c(0x1d6)](a43_0xfe8d48[_0x280d2c(0x200)](_0x280d2c(0x207)))),0x0;}catch(_0x3f8c38){throw _0x3f8c38;}}}
@@ -1 +1 @@
1
- const a44_0x4a8205=a44_0x4f88;(function(_0x5de3a0,_0x7bcde5){const _0x2f2064=a44_0x4f88,_0x264087=_0x5de3a0();while(!![]){try{const _0x2b5a24=parseInt(_0x2f2064(0xde))/0x1*(parseInt(_0x2f2064(0xd7))/0x2)+-parseInt(_0x2f2064(0xe2))/0x3+parseInt(_0x2f2064(0xfb))/0x4*(-parseInt(_0x2f2064(0xf4))/0x5)+-parseInt(_0x2f2064(0xfd))/0x6+parseInt(_0x2f2064(0x100))/0x7*(-parseInt(_0x2f2064(0xe8))/0x8)+-parseInt(_0x2f2064(0xda))/0x9+parseInt(_0x2f2064(0xd4))/0xa*(parseInt(_0x2f2064(0x103))/0xb);if(_0x2b5a24===_0x7bcde5)break;else _0x264087['push'](_0x264087['shift']());}catch(_0x38c7cc){_0x264087['push'](_0x264087['shift']());}}}(a44_0x3da6,0x51de7));function a44_0x4f88(_0x297655,_0x47fdba){_0x297655=_0x297655-0xd4;const _0x3da6db=a44_0x3da6();let _0x4f888b=_0x3da6db[_0x297655];return _0x4f888b;}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_0x480bc4 from'chalk';function a44_0x3da6(){const _0x397a1a=['Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','2264nNxFQI','message','yellow','log','invalidCount','segment:validate','helpText','parentSegment','\x20file(s)\x20with\x20errors,\x20','\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','Validation\x20failed:\x20','green','408190UfsBbE','endsWith','):\x20','errorCode','cyan','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','8dwqRBg','warnings','2273100PZLsJv','warningCount','✔\x20All\x20','9478yunSNo','cwd','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','15719374qtyubY','\x20file(s)\x20valid','Validate\x20segment\x20and\x20journey\x20YAML\x20files','hasErrors','10oBigKY','verbose','file','2MWrZgx','red','no_parent','1714941dTLrzy','\x20warning(s)\x20found','error','Error:\x20Directory\x20not\x20found:\x20','51713vYKlZs','execute','type','description','88665ptpjxP','targetDir','dim','.yml','length'];a44_0x3da6=function(){return _0x397a1a;};return a44_0x3da6();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x4a8205(0xed);[a44_0x4a8205(0xe1)]=a44_0x4a8205(0x105);async[a44_0x4a8205(0xdf)](_0x110171){const _0x3691a8=a44_0x4a8205,{options:_0x45721d,args:_0x109320}=_0x110171,_0x250c6d=_0x45721d,_0x4ff6ef=await resolveTarget({'arg':_0x109320[0x0],'contextParent':_0x45721d[_0x3691a8(0xef)],'cwd':process[_0x3691a8(0x101)]()});if(!isSuccessfulResolution(_0x4ff6ef))return _0x4ff6ef[_0x3691a8(0xf7)]===_0x3691a8(0xd9)?(console['error'](a44_0x480bc4['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3691a8(0xdc)](_0x3691a8(0xe7)),console[_0x3691a8(0xdc)](_0x3691a8(0xf1)),console[_0x3691a8(0xdc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x3691a8(0xdc)](a44_0x480bc4[_0x3691a8(0xd8)]('Error:\x20'+_0x4ff6ef[_0x3691a8(0xe9)]+'\x0a')),_0x4ff6ef[_0x3691a8(0xee)]&&console[_0x3691a8(0xdc)](a44_0x480bc4[_0x3691a8(0xf8)](_0x4ff6ef['helpText']))),0x1;const _0x158113=_0x4ff6ef[_0x3691a8(0xe3)],_0x5fc5ff=_0x4ff6ef[_0x3691a8(0xe0)]===_0x3691a8(0xd6)?_0x4ff6ef['filePath']:undefined;if(!_0x5fc5ff&&!existsSync(_0x158113))return console[_0x3691a8(0xdc)](a44_0x480bc4[_0x3691a8(0xd8)](_0x3691a8(0xdd)+_0x158113+'\x0a')),0x1;let _0x442f9f;if(_0x5fc5ff){if(!_0x5fc5ff['endsWith'](_0x3691a8(0xe5))&&!_0x5fc5ff[_0x3691a8(0xf5)]('.yaml'))return console[_0x3691a8(0xdc)](a44_0x480bc4[_0x3691a8(0xd8)](_0x3691a8(0x102)+_0x5fc5ff+'\x0a')),0x1;_0x442f9f=[_0x5fc5ff];}else _0x442f9f=findYamlFiles(_0x158113);if(_0x442f9f[_0x3691a8(0xe6)]===0x0)return console[_0x3691a8(0xdc)](a44_0x480bc4['red'](_0x3691a8(0xfa)+_0x158113+'\x0a')),0x1;const _0x2a237e=validateYamlFiles(_0x442f9f,_0x158113),_0x526c3d=calculateSummary(_0x2a237e);for(const _0xbb76c8 of _0x2a237e){if(!isValidationResult(_0xbb76c8))continue;const {relativePath:_0x58f0d3,source:_0x301d2c,result:_0x295e8a,fileType:_0x1e2906}=_0xbb76c8,_0x947429=_0x1e2906;if(_0x295e8a['valid']&&_0x295e8a[_0x3691a8(0xfc)][_0x3691a8(0xe6)]===0x0)_0x250c6d[_0x3691a8(0xd5)]&&console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xf3)]('✔\x20'+_0x58f0d3)+a44_0x480bc4['dim']('\x20('+_0x947429+')'));else _0x295e8a['valid']?(console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xea)]('⚠\x20'+_0x58f0d3)+a44_0x480bc4[_0x3691a8(0xe4)]('\x20('+_0x947429+'):\x20'+_0x295e8a[_0x3691a8(0xfc)][_0x3691a8(0xe6)]+'\x20warning(s)')),console[_0x3691a8(0xeb)](formatValidationResult(_0x295e8a,_0x301d2c,_0x58f0d3))):(console['log'](a44_0x480bc4['red']('✖\x20'+_0x58f0d3)+a44_0x480bc4[_0x3691a8(0xe4)]('\x20('+_0x947429+_0x3691a8(0xf6)+_0x295e8a['errors'][_0x3691a8(0xe6)]+'\x20error(s)')),console[_0x3691a8(0xeb)](formatValidationResult(_0x295e8a,_0x301d2c,_0x58f0d3)));}return console[_0x3691a8(0xeb)](''),_0x526c3d[_0x3691a8(0x106)]?(console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xd8)](_0x3691a8(0xf2)+_0x526c3d[_0x3691a8(0xec)]+_0x3691a8(0xf0)+_0x526c3d[_0x3691a8(0xf9)]+'\x20valid')),_0x526c3d[_0x3691a8(0xfe)]>0x0&&console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xea)](_0x526c3d[_0x3691a8(0xfe)]+_0x3691a8(0xdb))),0x1):(console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xf3)](_0x3691a8(0xff)+_0x526c3d[_0x3691a8(0xf9)]+_0x3691a8(0x104))),_0x526c3d[_0x3691a8(0xfe)]>0x0&&console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xea)](_0x526c3d[_0x3691a8(0xfe)]+_0x3691a8(0xdb))),0x0);}}
1
+ const a44_0x4afc6e=a44_0x3fd5;(function(_0x51367c,_0x1ff64a){const _0x45cb0c=a44_0x3fd5,_0xa7d346=_0x51367c();while(!![]){try{const _0x1623cb=-parseInt(_0x45cb0c(0x1b5))/0x1*(parseInt(_0x45cb0c(0x1c9))/0x2)+parseInt(_0x45cb0c(0x1bd))/0x3+-parseInt(_0x45cb0c(0x1ba))/0x4*(-parseInt(_0x45cb0c(0x1a1))/0x5)+parseInt(_0x45cb0c(0x1a9))/0x6+parseInt(_0x45cb0c(0x1c7))/0x7+-parseInt(_0x45cb0c(0x1a2))/0x8+-parseInt(_0x45cb0c(0x1aa))/0x9;if(_0x1623cb===_0x1ff64a)break;else _0xa7d346['push'](_0xa7d346['shift']());}catch(_0x47907b){_0xa7d346['push'](_0xa7d346['shift']());}}}(a44_0x397c,0x3dcfa));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x397c(){const _0x32dbc2=['Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','5HSivSB','1932840qRxeDk','.yml','red','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','valid','name','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','914676cMcnYo','3115908ZNXvSm','filePath','Validate\x20segment\x20and\x20journey\x20YAML\x20files','\x20error(s)','warningCount','message','helpText','green','\x20warning(s)','yellow','verbose','2333XYeCUV','hasErrors','error','type','.yaml','838076jhJmuA','✔\x20All\x20','\x20file(s)\x20with\x20errors,\x20','531795FGYwLF','dim','endsWith','Error:\x20','no_parent','errorCode','file','):\x20','warnings','Error:\x20Directory\x20not\x20found:\x20','3108546GFuvvm','length','122fYHyXg','invalidCount','\x20valid','\x20warning(s)\x20found','\x20file(s)\x20valid','cwd','log'];a44_0x397c=function(){return _0x32dbc2;};return a44_0x397c();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a44_0x3fd5(_0x5df766,_0x26ce11){_0x5df766=_0x5df766-0x19a;const _0x397c8b=a44_0x397c();let _0x3fd54c=_0x397c8b[_0x5df766];return _0x3fd54c;}import{existsSync}from'fs';import a44_0x5c1c37 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_0x4afc6e(0x1a7)]='segment:validate';['description']=a44_0x4afc6e(0x1ac);async['execute'](_0x1f70bf){const _0x2d6fda=a44_0x4afc6e,{options:_0x231eff,args:_0x54f423}=_0x1f70bf,_0x3bf603=_0x231eff,_0x2403fb=await resolveTarget({'arg':_0x54f423[0x0],'contextParent':_0x231eff['parentSegment'],'cwd':process[_0x2d6fda(0x19e)]()});if(!isSuccessfulResolution(_0x2403fb))return _0x2403fb[_0x2d6fda(0x1c2)]===_0x2d6fda(0x1c1)?(console[_0x2d6fda(0x1b7)](a44_0x5c1c37[_0x2d6fda(0x1b3)](_0x2d6fda(0x1a8))),console['error'](_0x2d6fda(0x1a0)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x2d6fda(0x1b7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x2d6fda(0x1b7)](a44_0x5c1c37['red'](_0x2d6fda(0x1c0)+_0x2403fb[_0x2d6fda(0x1af)]+'\x0a')),_0x2403fb[_0x2d6fda(0x1b0)]&&console[_0x2d6fda(0x1b7)](a44_0x5c1c37['cyan'](_0x2403fb[_0x2d6fda(0x1b0)]))),0x1;const _0x3385e4=_0x2403fb['targetDir'],_0x2e658c=_0x2403fb[_0x2d6fda(0x1b8)]===_0x2d6fda(0x1c3)?_0x2403fb[_0x2d6fda(0x1ab)]:undefined;if(!_0x2e658c&&!existsSync(_0x3385e4))return console[_0x2d6fda(0x1b7)](a44_0x5c1c37[_0x2d6fda(0x1a4)](_0x2d6fda(0x1c6)+_0x3385e4+'\x0a')),0x1;let _0x1b5e31;if(_0x2e658c){if(!_0x2e658c[_0x2d6fda(0x1bf)](_0x2d6fda(0x1a3))&&!_0x2e658c['endsWith'](_0x2d6fda(0x1b9)))return console[_0x2d6fda(0x1b7)](a44_0x5c1c37[_0x2d6fda(0x1a4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x2e658c+'\x0a')),0x1;_0x1b5e31=[_0x2e658c];}else _0x1b5e31=findYamlFiles(_0x3385e4);if(_0x1b5e31[_0x2d6fda(0x1c8)]===0x0)return console[_0x2d6fda(0x1b7)](a44_0x5c1c37[_0x2d6fda(0x1a4)](_0x2d6fda(0x1a5)+_0x3385e4+'\x0a')),0x1;const _0x46afa6=validateYamlFiles(_0x1b5e31,_0x3385e4),_0x576d14=calculateSummary(_0x46afa6);for(const _0x1b77f6 of _0x46afa6){if(!isValidationResult(_0x1b77f6))continue;const {relativePath:_0x5b3cbb,source:_0x4c658b,result:_0x6c5eda,fileType:_0x14d386}=_0x1b77f6,_0x28686f=_0x14d386;if(_0x6c5eda['valid']&&_0x6c5eda[_0x2d6fda(0x1c5)][_0x2d6fda(0x1c8)]===0x0)_0x3bf603[_0x2d6fda(0x1b4)]&&console[_0x2d6fda(0x19f)](a44_0x5c1c37['green']('✔\x20'+_0x5b3cbb)+a44_0x5c1c37[_0x2d6fda(0x1be)]('\x20('+_0x28686f+')'));else _0x6c5eda[_0x2d6fda(0x1a6)]?(console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1b3)]('⚠\x20'+_0x5b3cbb)+a44_0x5c1c37['dim']('\x20('+_0x28686f+_0x2d6fda(0x1c4)+_0x6c5eda[_0x2d6fda(0x1c5)][_0x2d6fda(0x1c8)]+_0x2d6fda(0x1b2))),console['log'](formatValidationResult(_0x6c5eda,_0x4c658b,_0x5b3cbb))):(console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1a4)]('✖\x20'+_0x5b3cbb)+a44_0x5c1c37[_0x2d6fda(0x1be)]('\x20('+_0x28686f+_0x2d6fda(0x1c4)+_0x6c5eda['errors'][_0x2d6fda(0x1c8)]+_0x2d6fda(0x1ad))),console[_0x2d6fda(0x19f)](formatValidationResult(_0x6c5eda,_0x4c658b,_0x5b3cbb)));}return console[_0x2d6fda(0x19f)](''),_0x576d14[_0x2d6fda(0x1b6)]?(console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1a4)]('Validation\x20failed:\x20'+_0x576d14[_0x2d6fda(0x19a)]+_0x2d6fda(0x1bc)+_0x576d14['validCount']+_0x2d6fda(0x19b))),_0x576d14['warningCount']>0x0&&console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1b3)](_0x576d14[_0x2d6fda(0x1ae)]+_0x2d6fda(0x19c))),0x1):(console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1b1)](_0x2d6fda(0x1bb)+_0x576d14['validCount']+_0x2d6fda(0x19d))),_0x576d14['warningCount']>0x0&&console['log'](a44_0x5c1c37['yellow'](_0x576d14[_0x2d6fda(0x1ae)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- const a45_0x28e287=a45_0x1d64;(function(_0x43eead,_0x52a20d){const _0x4d792f=a45_0x1d64,_0x48d81e=_0x43eead();while(!![]){try{const _0x3cc39c=parseInt(_0x4d792f(0x194))/0x1+parseInt(_0x4d792f(0x190))/0x2*(parseInt(_0x4d792f(0x172))/0x3)+parseInt(_0x4d792f(0x1a4))/0x4+parseInt(_0x4d792f(0x184))/0x5+-parseInt(_0x4d792f(0x18d))/0x6+-parseInt(_0x4d792f(0x18f))/0x7+-parseInt(_0x4d792f(0x1b2))/0x8;if(_0x3cc39c===_0x52a20d)break;else _0x48d81e['push'](_0x48d81e['shift']());}catch(_0x584724){_0x48d81e['push'](_0x48d81e['shift']());}}}(a45_0x3c99,0xd2151));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_0x5d103e from'chalk';function a45_0x1d64(_0x1e6eb2,_0x9218b9){_0x1e6eb2=_0x1e6eb2-0x166;const _0x3c9967=a45_0x3c99();let _0x1d64a9=_0x3c9967[_0x1e6eb2];return _0x1d64a9;}function a45_0x3c99(){const _0x16f4df=['format','resolvePathToResource','Parent\x20ID:\x20','dim','type','execute','parentId','listUnifiedWithJourneys','7062840HRLUwl','Recursive\x20mode:\x20enabled','✔\x20Found\x20','replace','Folder/pattern\x20arg:\x20','List\x20folders\x20and\x20child\x20segments','folder','journeyBundleName',',\x20and\x20','Folder\x20ID:\x20','✔\x20Built\x20tree\x20with\x20','maxDepth','log','Parent\x20segment\x20context:\x20','12GBgdiu','Resolving\x20parent\x20segment\x20\x27','error','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20segment','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','map','\x20journey','listRecursive','journeys','includes','(not\x20set)','Set\x20a\x20parent\x20segment\x20context\x20first:','/j/da','(empty)','journey','length','/app/ps/','6769815fYJkOq','listUnified','localeCompare','jsonl','cause','\x20matching\x20\x27','site','\x27...','recursive','4190148PAoOvq','folderId','11528818ydXXOj','768992XKZmWu','test','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x20\x20Cause:\x20','48079ZXcdei','\x5c$&','Resolving\x20path\x20\x27','json','Site:\x20','verbose','segment','segments','Error:\x20','/e/','children','\x20folder','No\x20items\x20match\x20pattern:\x20','name','data','folders','4594632UDopIQ','sort','parentSegment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22',']\x20matching\x20\x27','filter'];a45_0x3c99=function(){return _0x16f4df;};return a45_0x3c99();}export class SegmentsCommand extends BaseCommand{[a45_0x28e287(0x1a1)]='segments';['description']=a45_0x28e287(0x169);async[a45_0x28e287(0x1af)](_0x534638){const _0x3573d5=a45_0x28e287,{options:_0x3cb5a8,args:_0x2e7b7f}=_0x534638,_0x1768c6=_0x3cb5a8[_0x3573d5(0x18c)],_0x39b362=_0x2e7b7f[0x0];try{const _0x464922=_0x3cb5a8[_0x3573d5(0x1a6)];_0x3cb5a8[_0x3573d5(0x199)]&&(console[_0x3573d5(0x174)](_0x3573d5(0x198)+_0x3cb5a8['site']),console[_0x3573d5(0x174)](_0x3573d5(0x171)+(_0x464922||_0x3573d5(0x17d))),_0x39b362&&console[_0x3573d5(0x174)](_0x3573d5(0x168)+_0x39b362),_0x1768c6&&console[_0x3573d5(0x174)](_0x3573d5(0x1b3)));if(!_0x464922)return console[_0x3573d5(0x174)](_0x3573d5(0x192)),console['error'](''),console[_0x3573d5(0x174)](_0x3573d5(0x17e)),console[_0x3573d5(0x174)](_0x3573d5(0x1a7)),console['error'](_0x3573d5(0x177)),console['error'](''),console[_0x3573d5(0x174)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x37da11=_0x39b362&&(_0x39b362[_0x3573d5(0x17c)]('*')||_0x39b362[_0x3573d5(0x17c)]('?'));if(_0x37da11)return await this['listWithPattern'](_0x534638,_0x464922,_0x39b362);const _0x155dac=_0x39b362?_0x464922+'/'+_0x39b362:_0x464922;return _0x1768c6?await this[_0x3573d5(0x17a)](_0x534638,_0x155dac):await this['listUnified'](_0x534638,_0x155dac);}catch(_0x2e3c2f){if(_0x2e3c2f instanceof SDKError)return console[_0x3573d5(0x174)](_0x3573d5(0x19c)+_0x2e3c2f['message']),_0x2e3c2f[_0x3573d5(0x188)]&&console[_0x3573d5(0x174)](_0x3573d5(0x193)+_0x2e3c2f[_0x3573d5(0x188)]),0x1;throw _0x2e3c2f;}}async['listWithPattern'](_0x3abf24,_0x34038f,_0x24dcf8){const _0x10e8bb=a45_0x28e287,{options:_0x18bfd4,tdx:_0x27bc7d}=_0x3abf24,_0x53c24a=await withSpinner(_0x10e8bb(0x173)+_0x34038f+'\x27...',()=>_0x27bc7d[_0x10e8bb(0x19a)][_0x10e8bb(0x1ab)](_0x34038f),{'verbose':_0x18bfd4[_0x10e8bb(0x199)]}),_0x4de152=_0x53c24a[_0x10e8bb(0x1a2)],_0x2e6d5e=await withSpinner(_0x10e8bb(0x175),()=>_0x27bc7d['segment'][_0x10e8bb(0x1b1)](_0x4de152[_0x10e8bb(0x1b0)],_0x4de152[_0x10e8bb(0x18e)]),{'verbose':_0x18bfd4[_0x10e8bb(0x199)]}),{folders:_0x2e643f,segments:_0xe9fed0,journeys:_0x51ea51}=_0x2e6d5e['data'],_0x40543d=_0x24dcf8['replace'](/[.+^${}()|[\]\\]/g,_0x10e8bb(0x195))[_0x10e8bb(0x167)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x15a150=new RegExp('^'+_0x40543d+'$','i'),_0x28341b=_0x2e643f[_0x10e8bb(0x1a9)](_0x503fdf=>_0x15a150[_0x10e8bb(0x191)](_0x503fdf[_0x10e8bb(0x1a1)])),_0x380ad8=_0xe9fed0[_0x10e8bb(0x1a9)](_0x25d55d=>_0x15a150[_0x10e8bb(0x191)](_0x25d55d[_0x10e8bb(0x1a1)])),_0x58cf58=_0x51ea51[_0x10e8bb(0x1a9)](_0x5df918=>_0x15a150[_0x10e8bb(0x191)](_0x5df918[_0x10e8bb(0x16b)])),_0x2f57b3=_0x28341b['length']+_0x380ad8[_0x10e8bb(0x182)]+_0x58cf58[_0x10e8bb(0x182)];console[_0x10e8bb(0x174)](_0x10e8bb(0x166)+_0x28341b[_0x10e8bb(0x182)]+_0x10e8bb(0x19f)+(_0x28341b[_0x10e8bb(0x182)]!==0x1?'s':'')+',\x20'+_0x380ad8[_0x10e8bb(0x182)]+'\x20segment'+(_0x380ad8[_0x10e8bb(0x182)]!==0x1?'s':'')+_0x10e8bb(0x16c)+_0x58cf58['length']+_0x10e8bb(0x179)+(_0x58cf58['length']!==0x1?'s':'')+_0x10e8bb(0x189)+_0x24dcf8+'\x27');const _0x158ea0=_0x363ef3=>{const _0x164b8d=_0x10e8bb;return getConsoleNextUrl(_0x18bfd4[_0x164b8d(0x18a)],'/app/ps/'+_0x4de152[_0x164b8d(0x1b0)]+'/e/'+_0x363ef3);},_0x5664cf=_0x18bfd4[_0x10e8bb(0x1aa)]==='json'||_0x18bfd4[_0x10e8bb(0x1aa)]===_0x10e8bb(0x187);if(_0x5664cf){const _0x35b95e=[..._0x28341b[_0x10e8bb(0x178)](_0x331400=>({..._0x331400,'type':_0x10e8bb(0x16a)})),..._0x380ad8[_0x10e8bb(0x178)](_0x463d60=>({..._0x463d60,'type':_0x10e8bb(0x19a),'url':_0x158ea0(_0x463d60['id'])})),..._0x58cf58['map'](_0xe104b4=>({..._0xe104b4,'name':_0xe104b4['journeyBundleName'],'type':_0x10e8bb(0x181)}))][_0x10e8bb(0x1a5)]((_0x23b994,_0x4ebcf9)=>_0x23b994[_0x10e8bb(0x1a1)][_0x10e8bb(0x186)](_0x4ebcf9[_0x10e8bb(0x1a1)]));await handleSDKOutput(_0x35b95e,_0x18bfd4);}else{if(_0x2f57b3===0x0)console[_0x10e8bb(0x170)](_0x10e8bb(0x1a0)+_0x24dcf8);else{console['log'](a45_0x5d103e[_0x10e8bb(0x1ad)]('['+_0x34038f+_0x10e8bb(0x1a8)+_0x24dcf8+'\x27'));const _0x266532=formatFlatList(_0x28341b,_0x380ad8,{'showMetadata':!![],'getSegmentUrl':_0x158ea0},_0x58cf58);console[_0x10e8bb(0x170)](_0x266532);}}return 0x0;}async[a45_0x28e287(0x185)](_0x5df54f,_0x388e40){const _0x3bb38=a45_0x28e287,{options:_0x12effa,tdx:_0x38f4aa}=_0x5df54f,_0xf04b5b=await withSpinner(_0x3bb38(0x196)+_0x388e40+_0x3bb38(0x18b),()=>_0x38f4aa['segment'][_0x3bb38(0x1ab)](_0x388e40),{'verbose':_0x12effa['verbose']}),_0x3e223e=_0xf04b5b[_0x3bb38(0x1a2)];_0x12effa[_0x3bb38(0x199)]&&(console[_0x3bb38(0x174)]('Parent\x20ID:\x20'+_0x3e223e[_0x3bb38(0x1b0)]),_0x3e223e[_0x3bb38(0x18e)]&&console[_0x3bb38(0x174)](_0x3bb38(0x16d)+_0x3e223e[_0x3bb38(0x18e)]));const _0x52f1f3=await withSpinner(_0x3bb38(0x175),()=>_0x38f4aa[_0x3bb38(0x19a)][_0x3bb38(0x1b1)](_0x3e223e[_0x3bb38(0x1b0)],_0x3e223e['folderId']),{'verbose':_0x12effa[_0x3bb38(0x199)]}),{folders:_0x4b1287,segments:_0x17c512,journeys:_0x3b5f6c}=_0x52f1f3['data'],_0x51dffb=_0x4b1287[_0x3bb38(0x182)]+_0x17c512[_0x3bb38(0x182)]+_0x3b5f6c['length'];console[_0x3bb38(0x174)](_0x3bb38(0x166)+_0x4b1287[_0x3bb38(0x182)]+_0x3bb38(0x19f)+(_0x4b1287['length']!==0x1?'s':'')+',\x20'+_0x17c512['length']+_0x3bb38(0x176)+(_0x17c512[_0x3bb38(0x182)]!==0x1?'s':'')+_0x3bb38(0x16c)+_0x3b5f6c[_0x3bb38(0x182)]+_0x3bb38(0x179)+(_0x3b5f6c[_0x3bb38(0x182)]!==0x1?'s':''));const _0x142cdd=_0xc9e7b=>{const _0x4de448=_0x3bb38;return getConsoleNextUrl(_0x12effa[_0x4de448(0x18a)],_0x4de448(0x183)+_0x3e223e[_0x4de448(0x1b0)]+'/e/'+_0xc9e7b);},_0x160dac=_0x5cc018=>{const _0x11b61c=_0x3bb38;return getConsoleNextUrl(_0x12effa['site'],_0x11b61c(0x183)+_0x3e223e[_0x11b61c(0x1b0)]+'/e/'+_0x5cc018+'/j/da');},_0x4546a2=_0x12effa['format']==='json'||_0x12effa[_0x3bb38(0x1aa)]==='jsonl';if(_0x4546a2){const _0xda6ac8=[..._0x4b1287['map'](_0x5cb4a0=>({..._0x5cb4a0,'type':'folder'})),..._0x17c512[_0x3bb38(0x178)](_0x4258dc=>({..._0x4258dc,'type':_0x3bb38(0x19a),'url':_0x142cdd(_0x4258dc['id'])})),..._0x3b5f6c[_0x3bb38(0x178)](_0x1b57b0=>({..._0x1b57b0,'name':_0x1b57b0[_0x3bb38(0x16b)],'type':_0x3bb38(0x181),'url':_0x160dac(_0x1b57b0['id'])}))]['sort']((_0x19afd8,_0xe0ca27)=>_0x19afd8['name'][_0x3bb38(0x186)](_0xe0ca27[_0x3bb38(0x1a1)]));await handleSDKOutput(_0xda6ac8,_0x12effa);}else{if(_0x51dffb===0x0)console[_0x3bb38(0x170)](a45_0x5d103e[_0x3bb38(0x1ad)]('['+_0x388e40+']')),console[_0x3bb38(0x170)](_0x3bb38(0x180));else{console['log'](a45_0x5d103e['dim']('['+_0x388e40+']'));const _0x106483=formatFlatList(_0x4b1287,_0x17c512,{'showMetadata':!![],'getSegmentUrl':_0x142cdd,'getJourneyUrl':_0x160dac},_0x3b5f6c);console[_0x3bb38(0x170)](_0x106483);}}return 0x0;}async['listRecursive'](_0x1a4daf,_0x35285e){const _0x912074=a45_0x28e287,{options:_0x457356,tdx:_0xd07ac4}=_0x1a4daf,_0x26b3f0=await withSpinner(_0x912074(0x196)+_0x35285e+_0x912074(0x18b),()=>_0xd07ac4[_0x912074(0x19a)][_0x912074(0x1ab)](_0x35285e),{'verbose':_0x457356[_0x912074(0x199)]}),_0xcb977e=_0x26b3f0['data'];_0x457356['verbose']&&(console[_0x912074(0x174)](_0x912074(0x1ac)+_0xcb977e[_0x912074(0x1b0)]),_0xcb977e['folderId']&&console['error'](_0x912074(0x16d)+_0xcb977e[_0x912074(0x18e)]));const _0x52a585=_0x457356[_0x912074(0x16f)]||0xa,_0x2858e2=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0xd07ac4[_0x912074(0x19a)][_0x912074(0x17a)](_0xcb977e[_0x912074(0x1b0)],_0xcb977e[_0x912074(0x18e)],0x0,_0x52a585),{'verbose':_0x457356[_0x912074(0x199)]}),_0x11e1bb=_0x2858e2[_0x912074(0x1a2)],_0x2e3625=_0x1eb6db=>{const _0x4248bb=_0x912074;let _0x18be34=0x0,_0x41be51=0x0,_0xb7d255=0x0;for(const _0x4d7eb0 of _0x1eb6db){if(_0x4d7eb0[_0x4248bb(0x1ae)]===_0x4248bb(0x16a))_0x18be34++;else{if(_0x4d7eb0[_0x4248bb(0x1ae)]==='segment')_0x41be51++;else{if(_0x4d7eb0[_0x4248bb(0x1ae)]===_0x4248bb(0x181))_0xb7d255++;}}if(_0x4d7eb0['children']){const _0x5c4095=_0x2e3625(_0x4d7eb0[_0x4248bb(0x19e)]);_0x18be34+=_0x5c4095[_0x4248bb(0x1a3)],_0x41be51+=_0x5c4095[_0x4248bb(0x19b)],_0xb7d255+=_0x5c4095[_0x4248bb(0x17b)];}}return{'folders':_0x18be34,'segments':_0x41be51,'journeys':_0xb7d255};},_0x2d90f3=_0x2e3625(_0x11e1bb);console[_0x912074(0x174)](_0x912074(0x16e)+_0x2d90f3[_0x912074(0x1a3)]+_0x912074(0x19f)+(_0x2d90f3[_0x912074(0x1a3)]!==0x1?'s':'')+',\x20'+_0x2d90f3[_0x912074(0x19b)]+'\x20segment'+(_0x2d90f3[_0x912074(0x19b)]!==0x1?'s':'')+_0x912074(0x16c)+_0x2d90f3[_0x912074(0x17b)]+_0x912074(0x179)+(_0x2d90f3[_0x912074(0x17b)]!==0x1?'s':''));const _0x500ad5=_0x128486=>{const _0x28fbd8=_0x912074;return getConsoleNextUrl(_0x457356[_0x28fbd8(0x18a)],_0x28fbd8(0x183)+_0xcb977e[_0x28fbd8(0x1b0)]+_0x28fbd8(0x19d)+_0x128486);},_0x2301d1=_0x73d048=>{const _0x46e01f=_0x912074;return getConsoleNextUrl(_0x457356[_0x46e01f(0x18a)],'/app/ps/'+_0xcb977e[_0x46e01f(0x1b0)]+_0x46e01f(0x19d)+_0x73d048+_0x46e01f(0x17f));};if(_0x457356[_0x912074(0x1aa)]===_0x912074(0x197)||_0x457356[_0x912074(0x1aa)]===_0x912074(0x187))await handleSDKOutput(_0x11e1bb,_0x457356);else{console['log'](a45_0x5d103e[_0x912074(0x1ad)]('['+_0x35285e+']'));const _0xa1c201=formatTree(_0x11e1bb,{'showMetadata':!![],'getSegmentUrl':_0x500ad5,'getJourneyUrl':_0x2301d1});console[_0x912074(0x170)](_0xa1c201);}return 0x0;}}
1
+ const a45_0x115dd3=a45_0x49b4;(function(_0xcdefcf,_0x41f562){const _0x50f879=a45_0x49b4,_0x259b15=_0xcdefcf();while(!![]){try{const _0x8dcef2=parseInt(_0x50f879(0x20c))/0x1*(parseInt(_0x50f879(0x22d))/0x2)+-parseInt(_0x50f879(0x226))/0x3*(-parseInt(_0x50f879(0x229))/0x4)+parseInt(_0x50f879(0x1fb))/0x5+parseInt(_0x50f879(0x217))/0x6*(-parseInt(_0x50f879(0x1ed))/0x7)+parseInt(_0x50f879(0x1f1))/0x8*(parseInt(_0x50f879(0x200))/0x9)+parseInt(_0x50f879(0x1fe))/0xa+-parseInt(_0x50f879(0x20d))/0xb;if(_0x8dcef2===_0x41f562)break;else _0x259b15['push'](_0x259b15['shift']());}catch(_0x269359){_0x259b15['push'](_0x259b15['shift']());}}}(a45_0x227f,0x38019));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';function a45_0x227f(){const _0x3656e3=['✔\x20Built\x20tree\x20with\x20','test','\x20segment','folders','filter','1104845HKaEnR','No\x20items\x20match\x20pattern:\x20','error','1973460qFOMJL','List\x20folders\x20and\x20child\x20segments','330741VfVelp','Parent\x20ID:\x20','parentSegment','\x20matching\x20\x27','execute','(not\x20set)','segments','verbose',',\x20and\x20','/e/','map','Resolving\x20path\x20\x27','102457wUODCB','5848986vHJvFp','journey','includes','maxDepth','cause','Parent\x20segment\x20context:\x20','\x27...','✔\x20Found\x20','\x20folder','dim','6gYwylE','replace','format','/j/da','type','localeCompare','Folder\x20ID:\x20','jsonl','resolvePathToResource','parentId','name','site',']\x20matching\x20\x27','listUnifiedWithJourneys','/app/ps/','191067UZXSBY','\x20\x20Cause:\x20','Recursive\x20mode:\x20enabled','4aRRbON','\x20journey','message','journeyBundleName','6HtIpNr','log','json','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','data','Set\x20a\x20parent\x20segment\x20context\x20first:','folder','journeys','children','listWithPattern','(empty)','folderId','Folder/pattern\x20arg:\x20','3027409KFIikc','listRecursive','sort','Listing\x20folders,\x20segments,\x20and\x20journeys...','88TosjsO','segment','length','Resolving\x20parent\x20segment\x20\x27','listUnified'];a45_0x227f=function(){return _0x3656e3;};return a45_0x227f();}function a45_0x49b4(_0x4d27d0,_0x1bba9a){_0x4d27d0=_0x4d27d0-0x1e9;const _0x227fbd=a45_0x227f();let _0x49b410=_0x227fbd[_0x4d27d0];return _0x49b410;}import a45_0x5590f4 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x115dd3(0x221)]='segments';['description']=a45_0x115dd3(0x1ff);async[a45_0x115dd3(0x204)](_0x45ea5c){const _0x323c34=a45_0x115dd3,{options:_0x344c6d,args:_0x4d8696}=_0x45ea5c,_0x305b3c=_0x344c6d['recursive'],_0x1dffb1=_0x4d8696[0x0];try{const _0x2b5f4e=_0x344c6d[_0x323c34(0x202)];_0x344c6d['verbose']&&(console[_0x323c34(0x1fd)]('Site:\x20'+_0x344c6d[_0x323c34(0x222)]),console[_0x323c34(0x1fd)](_0x323c34(0x212)+(_0x2b5f4e||_0x323c34(0x205))),_0x1dffb1&&console[_0x323c34(0x1fd)](_0x323c34(0x1ec)+_0x1dffb1),_0x305b3c&&console[_0x323c34(0x1fd)](_0x323c34(0x228)));if(!_0x2b5f4e)return console[_0x323c34(0x1fd)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x323c34(0x1fd)](''),console[_0x323c34(0x1fd)](_0x323c34(0x232)),console[_0x323c34(0x1fd)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x323c34(0x1fd)](_0x323c34(0x230)),console[_0x323c34(0x1fd)](''),console[_0x323c34(0x1fd)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x38c748=_0x1dffb1&&(_0x1dffb1[_0x323c34(0x20f)]('*')||_0x1dffb1[_0x323c34(0x20f)]('?'));if(_0x38c748)return await this['listWithPattern'](_0x45ea5c,_0x2b5f4e,_0x1dffb1);const _0x46bd19=_0x1dffb1?_0x2b5f4e+'/'+_0x1dffb1:_0x2b5f4e;return _0x305b3c?await this[_0x323c34(0x1ee)](_0x45ea5c,_0x46bd19):await this['listUnified'](_0x45ea5c,_0x46bd19);}catch(_0x3d00dd){if(_0x3d00dd instanceof SDKError)return console['error']('Error:\x20'+_0x3d00dd[_0x323c34(0x22b)]),_0x3d00dd[_0x323c34(0x211)]&&console[_0x323c34(0x1fd)](_0x323c34(0x227)+_0x3d00dd['cause']),0x1;throw _0x3d00dd;}}async[a45_0x115dd3(0x1e9)](_0x2d9f8e,_0x45b26a,_0x10fd8b){const _0x274231=a45_0x115dd3,{options:_0x433911,tdx:_0x51e580}=_0x2d9f8e,_0x11dc97=await withSpinner(_0x274231(0x1f4)+_0x45b26a+_0x274231(0x213),()=>_0x51e580[_0x274231(0x1f2)][_0x274231(0x21f)](_0x45b26a),{'verbose':_0x433911[_0x274231(0x207)]}),_0x40bfba=_0x11dc97[_0x274231(0x231)],_0x5abf23=await withSpinner(_0x274231(0x1f0),()=>_0x51e580['segment'][_0x274231(0x224)](_0x40bfba[_0x274231(0x220)],_0x40bfba[_0x274231(0x1eb)]),{'verbose':_0x433911['verbose']}),{folders:_0x23409a,segments:_0x1a37d3,journeys:_0x25ea82}=_0x5abf23['data'],_0x2e5827=_0x10fd8b[_0x274231(0x218)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x274231(0x218)](/\?/g,'.'),_0x5c73f6=new RegExp('^'+_0x2e5827+'$','i'),_0x13e56b=_0x23409a[_0x274231(0x1fa)](_0x3e1270=>_0x5c73f6[_0x274231(0x1f7)](_0x3e1270[_0x274231(0x221)])),_0x1ff421=_0x1a37d3[_0x274231(0x1fa)](_0x3db123=>_0x5c73f6[_0x274231(0x1f7)](_0x3db123[_0x274231(0x221)])),_0x28622b=_0x25ea82[_0x274231(0x1fa)](_0x5f06a5=>_0x5c73f6[_0x274231(0x1f7)](_0x5f06a5[_0x274231(0x22c)])),_0x2dff1c=_0x13e56b[_0x274231(0x1f3)]+_0x1ff421['length']+_0x28622b['length'];console[_0x274231(0x1fd)]('✔\x20Found\x20'+_0x13e56b[_0x274231(0x1f3)]+_0x274231(0x215)+(_0x13e56b['length']!==0x1?'s':'')+',\x20'+_0x1ff421[_0x274231(0x1f3)]+_0x274231(0x1f8)+(_0x1ff421['length']!==0x1?'s':'')+',\x20and\x20'+_0x28622b['length']+'\x20journey'+(_0x28622b[_0x274231(0x1f3)]!==0x1?'s':'')+_0x274231(0x203)+_0x10fd8b+'\x27');const _0x363b61=_0x36840c=>{const _0x384cb8=_0x274231;return getConsoleNextUrl(_0x433911[_0x384cb8(0x222)],_0x384cb8(0x225)+_0x40bfba['parentId']+_0x384cb8(0x209)+_0x36840c);},_0x369cd9=_0x433911[_0x274231(0x219)]===_0x274231(0x22f)||_0x433911[_0x274231(0x219)]===_0x274231(0x21e);if(_0x369cd9){const _0x4e2458=[..._0x13e56b[_0x274231(0x20a)](_0x4d7099=>({..._0x4d7099,'type':'folder'})),..._0x1ff421[_0x274231(0x20a)](_0x403aa3=>({..._0x403aa3,'type':_0x274231(0x1f2),'url':_0x363b61(_0x403aa3['id'])})),..._0x28622b[_0x274231(0x20a)](_0x5b03d1=>({..._0x5b03d1,'name':_0x5b03d1[_0x274231(0x22c)],'type':_0x274231(0x20e)}))][_0x274231(0x1ef)]((_0x13fcfa,_0x504d2b)=>_0x13fcfa['name'][_0x274231(0x21c)](_0x504d2b['name']));await handleSDKOutput(_0x4e2458,_0x433911);}else{if(_0x2dff1c===0x0)console[_0x274231(0x22e)](_0x274231(0x1fc)+_0x10fd8b);else{console[_0x274231(0x22e)](a45_0x5590f4[_0x274231(0x216)]('['+_0x45b26a+_0x274231(0x223)+_0x10fd8b+'\x27'));const _0x5170a3=formatFlatList(_0x13e56b,_0x1ff421,{'showMetadata':!![],'getSegmentUrl':_0x363b61},_0x28622b);console[_0x274231(0x22e)](_0x5170a3);}}return 0x0;}async[a45_0x115dd3(0x1f5)](_0x1f7978,_0x4cee64){const _0x66b39e=a45_0x115dd3,{options:_0x8634f8,tdx:_0x5002ac}=_0x1f7978,_0x3a1ba5=await withSpinner(_0x66b39e(0x20b)+_0x4cee64+_0x66b39e(0x213),()=>_0x5002ac[_0x66b39e(0x1f2)][_0x66b39e(0x21f)](_0x4cee64),{'verbose':_0x8634f8[_0x66b39e(0x207)]}),_0x439189=_0x3a1ba5[_0x66b39e(0x231)];_0x8634f8[_0x66b39e(0x207)]&&(console['error'](_0x66b39e(0x201)+_0x439189['parentId']),_0x439189[_0x66b39e(0x1eb)]&&console[_0x66b39e(0x1fd)](_0x66b39e(0x21d)+_0x439189['folderId']));const _0x552ef9=await withSpinner(_0x66b39e(0x1f0),()=>_0x5002ac[_0x66b39e(0x1f2)]['listUnifiedWithJourneys'](_0x439189[_0x66b39e(0x220)],_0x439189[_0x66b39e(0x1eb)]),{'verbose':_0x8634f8[_0x66b39e(0x207)]}),{folders:_0x3c3c16,segments:_0x325b3a,journeys:_0x2eb20f}=_0x552ef9[_0x66b39e(0x231)],_0x35984f=_0x3c3c16[_0x66b39e(0x1f3)]+_0x325b3a[_0x66b39e(0x1f3)]+_0x2eb20f['length'];console[_0x66b39e(0x1fd)](_0x66b39e(0x214)+_0x3c3c16[_0x66b39e(0x1f3)]+_0x66b39e(0x215)+(_0x3c3c16[_0x66b39e(0x1f3)]!==0x1?'s':'')+',\x20'+_0x325b3a['length']+_0x66b39e(0x1f8)+(_0x325b3a[_0x66b39e(0x1f3)]!==0x1?'s':'')+_0x66b39e(0x208)+_0x2eb20f[_0x66b39e(0x1f3)]+_0x66b39e(0x22a)+(_0x2eb20f['length']!==0x1?'s':''));const _0x29978b=_0x54069f=>{const _0x1eaa89=_0x66b39e;return getConsoleNextUrl(_0x8634f8[_0x1eaa89(0x222)],'/app/ps/'+_0x439189[_0x1eaa89(0x220)]+'/e/'+_0x54069f);},_0x13ab1c=_0x4faca0=>{const _0x38e7a6=_0x66b39e;return getConsoleNextUrl(_0x8634f8[_0x38e7a6(0x222)],_0x38e7a6(0x225)+_0x439189[_0x38e7a6(0x220)]+_0x38e7a6(0x209)+_0x4faca0+_0x38e7a6(0x21a));},_0xd87523=_0x8634f8['format']===_0x66b39e(0x22f)||_0x8634f8[_0x66b39e(0x219)]===_0x66b39e(0x21e);if(_0xd87523){const _0x2c5e0d=[..._0x3c3c16[_0x66b39e(0x20a)](_0x49f6e1=>({..._0x49f6e1,'type':'folder'})),..._0x325b3a[_0x66b39e(0x20a)](_0x4287a7=>({..._0x4287a7,'type':_0x66b39e(0x1f2),'url':_0x29978b(_0x4287a7['id'])})),..._0x2eb20f[_0x66b39e(0x20a)](_0x5837fc=>({..._0x5837fc,'name':_0x5837fc[_0x66b39e(0x22c)],'type':_0x66b39e(0x20e),'url':_0x13ab1c(_0x5837fc['id'])}))][_0x66b39e(0x1ef)]((_0x260bbb,_0x1febf5)=>_0x260bbb['name']['localeCompare'](_0x1febf5['name']));await handleSDKOutput(_0x2c5e0d,_0x8634f8);}else{if(_0x35984f===0x0)console['log'](a45_0x5590f4['dim']('['+_0x4cee64+']')),console[_0x66b39e(0x22e)](_0x66b39e(0x1ea));else{console[_0x66b39e(0x22e)](a45_0x5590f4[_0x66b39e(0x216)]('['+_0x4cee64+']'));const _0x37f574=formatFlatList(_0x3c3c16,_0x325b3a,{'showMetadata':!![],'getSegmentUrl':_0x29978b,'getJourneyUrl':_0x13ab1c},_0x2eb20f);console['log'](_0x37f574);}}return 0x0;}async['listRecursive'](_0x20adc2,_0x40449d){const _0x23737f=a45_0x115dd3,{options:_0x5867e5,tdx:_0x406259}=_0x20adc2,_0xfe077a=await withSpinner(_0x23737f(0x20b)+_0x40449d+_0x23737f(0x213),()=>_0x406259['segment'][_0x23737f(0x21f)](_0x40449d),{'verbose':_0x5867e5[_0x23737f(0x207)]}),_0x1a0e23=_0xfe077a['data'];_0x5867e5[_0x23737f(0x207)]&&(console[_0x23737f(0x1fd)](_0x23737f(0x201)+_0x1a0e23[_0x23737f(0x220)]),_0x1a0e23[_0x23737f(0x1eb)]&&console[_0x23737f(0x1fd)](_0x23737f(0x21d)+_0x1a0e23['folderId']));const _0x240efd=_0x5867e5[_0x23737f(0x210)]||0xa,_0x33c5f1=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x406259['segment'][_0x23737f(0x1ee)](_0x1a0e23['parentId'],_0x1a0e23['folderId'],0x0,_0x240efd),{'verbose':_0x5867e5['verbose']}),_0x33204c=_0x33c5f1[_0x23737f(0x231)],_0x57e15c=_0x24d9f9=>{const _0x54755f=_0x23737f;let _0x3103a7=0x0,_0x2106b5=0x0,_0x15dc05=0x0;for(const _0x3e8ce8 of _0x24d9f9){if(_0x3e8ce8[_0x54755f(0x21b)]===_0x54755f(0x233))_0x3103a7++;else{if(_0x3e8ce8[_0x54755f(0x21b)]==='segment')_0x2106b5++;else{if(_0x3e8ce8[_0x54755f(0x21b)]==='journey')_0x15dc05++;}}if(_0x3e8ce8[_0x54755f(0x235)]){const _0x15d987=_0x57e15c(_0x3e8ce8[_0x54755f(0x235)]);_0x3103a7+=_0x15d987['folders'],_0x2106b5+=_0x15d987['segments'],_0x15dc05+=_0x15d987[_0x54755f(0x234)];}}return{'folders':_0x3103a7,'segments':_0x2106b5,'journeys':_0x15dc05};},_0x1b619f=_0x57e15c(_0x33204c);console[_0x23737f(0x1fd)](_0x23737f(0x1f6)+_0x1b619f[_0x23737f(0x1f9)]+_0x23737f(0x215)+(_0x1b619f['folders']!==0x1?'s':'')+',\x20'+_0x1b619f[_0x23737f(0x206)]+'\x20segment'+(_0x1b619f['segments']!==0x1?'s':'')+',\x20and\x20'+_0x1b619f[_0x23737f(0x234)]+_0x23737f(0x22a)+(_0x1b619f[_0x23737f(0x234)]!==0x1?'s':''));const _0x4d0df4=_0x27e0fd=>{const _0x2f1b32=_0x23737f;return getConsoleNextUrl(_0x5867e5[_0x2f1b32(0x222)],_0x2f1b32(0x225)+_0x1a0e23[_0x2f1b32(0x220)]+_0x2f1b32(0x209)+_0x27e0fd);},_0x1fd8da=_0x2afda1=>{const _0x26e2e7=_0x23737f;return getConsoleNextUrl(_0x5867e5[_0x26e2e7(0x222)],_0x26e2e7(0x225)+_0x1a0e23['parentId']+_0x26e2e7(0x209)+_0x2afda1+_0x26e2e7(0x21a));};if(_0x5867e5[_0x23737f(0x219)]===_0x23737f(0x22f)||_0x5867e5['format']===_0x23737f(0x21e))await handleSDKOutput(_0x33204c,_0x5867e5);else{console['log'](a45_0x5590f4[_0x23737f(0x216)]('['+_0x40449d+']'));const _0x420af2=formatTree(_0x33204c,{'showMetadata':!![],'getSegmentUrl':_0x4d0df4,'getJourneyUrl':_0x1fd8da});console[_0x23737f(0x22e)](_0x420af2);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x2fcb5=a46_0x73b7;(function(_0x335ac9,_0x4b36c9){const _0x3d1187=a46_0x73b7,_0x511029=_0x335ac9();while(!![]){try{const _0x49856e=-parseInt(_0x3d1187(0xd8))/0x1+parseInt(_0x3d1187(0xe4))/0x2*(-parseInt(_0x3d1187(0xf3))/0x3)+parseInt(_0x3d1187(0xdf))/0x4+-parseInt(_0x3d1187(0xf1))/0x5+parseInt(_0x3d1187(0xf9))/0x6+-parseInt(_0x3d1187(0xea))/0x7*(parseInt(_0x3d1187(0xd4))/0x8)+parseInt(_0x3d1187(0xe0))/0x9*(parseInt(_0x3d1187(0xe6))/0xa);if(_0x49856e===_0x4b36c9)break;else _0x511029['push'](_0x511029['shift']());}catch(_0x12c723){_0x511029['push'](_0x511029['shift']());}}}(a46_0x1ec3,0x8493e));function a46_0x1ec3(){const _0x14c412=['171811IXGUDL','✔\x20Retrieved\x20','\x20\x20Cause:\x20','Querying\x20','Site:\x20','error','showTable','1269656EvHYzf','17714466weEfto','database','show','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','10406LYYHvt','message','10xHZlPs','table','args','...','14wdigwk','query','Catalog:\x20','execute','\x20row','Limit:\x20','verbose','4120970urYfCT','Database:\x20','312ODhXjN','catalog','site','limit','Table:\x20','description','267114pmIBDp','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.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','data','Error:\x20','1000208kqXQqH','length','Usage:\x20tdx\x20show\x20<database.table>','Show\x20table\x20contents'];a46_0x1ec3=function(){return _0x14c412;};return a46_0x1ec3();}import{BaseCommand}from'./command.js';function a46_0x73b7(_0x2980db,_0x2a4bd7){_0x2980db=_0x2980db-0xd2;const _0x1ec3cf=a46_0x1ec3();let _0x73b7b4=_0x1ec3cf[_0x2980db];return _0x73b7b4;}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{['name']=a46_0x2fcb5(0xe2);[a46_0x2fcb5(0xf8)]=a46_0x2fcb5(0xd7);async[a46_0x2fcb5(0xed)](_0x39ae3c){const _0x5cafce=a46_0x2fcb5;return this[_0x5cafce(0xde)](_0x39ae3c);}async[a46_0x2fcb5(0xde)](_0x280421){const _0x95b623=a46_0x2fcb5,{options:_0x276e25,args:_0x18e1e2,tdx:_0x156a1d}=_0x280421;let _0x4f2793;try{_0x4f2793=parseTableReference(_0x18e1e2[0x0]);const _0x2e17a8=_0x276e25[_0x95b623(0xe1)];!_0x4f2793[_0x95b623(0xe1)]&&_0x2e17a8&&(_0x4f2793['database']=_0x2e17a8);const _0x7da5f9=validateTableDescribeReference(_0x4f2793);if(_0x7da5f9)return console[_0x95b623(0xdd)](_0x95b623(0xd3)+_0x7da5f9),console[_0x95b623(0xdd)](_0x95b623(0xd6)),console[_0x95b623(0xdd)](_0x95b623(0xfa)),console[_0x95b623(0xdd)](_0x95b623(0xe3)),0x1;}catch(_0x16d228){return console[_0x95b623(0xdd)](_0x95b623(0xd3)+_0x16d228[_0x95b623(0xe5)]),console[_0x95b623(0xdd)]('Usage:\x20tdx\x20show\x20<database.table>'),console['error'](_0x95b623(0xfa)),console[_0x95b623(0xdd)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x5a080e=_0x4f2793[_0x95b623(0xf4)],_0x766cc9=_0x4f2793['database'],_0xe0c224=_0x4f2793[_0x95b623(0xe7)],_0x34160b=resolveLimit(_0x276e25[_0x95b623(0xf6)],DEFAULT_DISPLAY_LIMIT);try{_0x276e25['verbose']&&(console['error'](_0x95b623(0xdc)+_0x276e25[_0x95b623(0xf5)]),_0x5a080e&&console[_0x95b623(0xdd)](_0x95b623(0xec)+_0x5a080e),console[_0x95b623(0xdd)](_0x95b623(0xf2)+_0x766cc9),console[_0x95b623(0xdd)](_0x95b623(0xf7)+_0xe0c224),console[_0x95b623(0xdd)](_0x95b623(0xef)+_0x34160b));const _0x207c2c=_0x5a080e?_0x5a080e+'.'+_0x766cc9+'.'+_0xe0c224:_0x766cc9+'.'+_0xe0c224,_0x5a72ae=await withSpinner(_0x95b623(0xdb)+_0x207c2c+_0x95b623(0xe9),()=>_0x156a1d[_0x95b623(0xeb)][_0x95b623(0xde)](_0x766cc9,_0xe0c224,_0x34160b,_0x5a080e),{'verbose':_0x276e25[_0x95b623(0xf0)]}),_0x23231d=_0x5a72ae[_0x95b623(0xd2)],_0x408e1f=_0x23231d[_0x95b623(0xd2)];return _0x408e1f[_0x95b623(0xd5)]===0x0?console[_0x95b623(0xdd)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x95b623(0xdd)](_0x95b623(0xd9)+_0x408e1f[_0x95b623(0xd5)]+_0x95b623(0xee)+(_0x408e1f[_0x95b623(0xd5)]!==0x1?'s':'')+'\x20from\x20'+_0x207c2c),await handleSDKOutput(_0x408e1f,_0x276e25),0x0;}catch(_0x174022){if(_0x174022 instanceof SDKError)return console[_0x95b623(0xdd)](_0x95b623(0xd3)+_0x174022[_0x95b623(0xe5)]),_0x174022['cause']&&console['error'](_0x95b623(0xda)+_0x174022['cause']),0x1;throw _0x174022;}}['validate'](_0x1a1d1e){const _0x472268=a46_0x2fcb5;if(_0x1a1d1e[_0x472268(0xe8)][_0x472268(0xd5)]===0x0)return'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';if(_0x1a1d1e[_0x472268(0xe8)][_0x472268(0xd5)]>0x1)return _0x472268(0xfb);return undefined;}}
1
+ function a46_0x1a11(_0x13efea,_0xb98f05){_0x13efea=_0x13efea-0x1f1;const _0x486f60=a46_0x486f();let _0x1a1105=_0x486f60[_0x13efea];return _0x1a1105;}const a46_0x29de96=a46_0x1a11;(function(_0x213814,_0x4b330d){const _0x25fdb2=a46_0x1a11,_0x31eecb=_0x213814();while(!![]){try{const _0x5735da=parseInt(_0x25fdb2(0x1f5))/0x1+-parseInt(_0x25fdb2(0x1f2))/0x2+parseInt(_0x25fdb2(0x1f3))/0x3*(-parseInt(_0x25fdb2(0x212))/0x4)+-parseInt(_0x25fdb2(0x1fc))/0x5+parseInt(_0x25fdb2(0x207))/0x6*(-parseInt(_0x25fdb2(0x200))/0x7)+-parseInt(_0x25fdb2(0x216))/0x8*(parseInt(_0x25fdb2(0x203))/0x9)+parseInt(_0x25fdb2(0x20a))/0xa*(parseInt(_0x25fdb2(0x214))/0xb);if(_0x5735da===_0x4b330d)break;else _0x31eecb['push'](_0x31eecb['shift']());}catch(_0x5a25cd){_0x31eecb['push'](_0x31eecb['shift']());}}}(a46_0x486f,0x19fa5));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_0x29de96(0x1f1)]=a46_0x29de96(0x1fd);[a46_0x29de96(0x1fa)]=a46_0x29de96(0x208);async[a46_0x29de96(0x1f7)](_0x1bc7da){return this['showTable'](_0x1bc7da);}async[a46_0x29de96(0x1f8)](_0x141be9){const _0x46c2a4=a46_0x29de96,{options:_0x4128a2,args:_0xef14b,tdx:_0x2c23c1}=_0x141be9;let _0x35ce18;try{_0x35ce18=parseTableReference(_0xef14b[0x0]);const _0x5ed40d=_0x4128a2[_0x46c2a4(0x1f4)];!_0x35ce18[_0x46c2a4(0x1f4)]&&_0x5ed40d&&(_0x35ce18[_0x46c2a4(0x1f4)]=_0x5ed40d);const _0x2aad0a=validateTableDescribeReference(_0x35ce18);if(_0x2aad0a)return console[_0x46c2a4(0x1ff)]('Error:\x20'+_0x2aad0a),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x20e)),console[_0x46c2a4(0x1ff)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x1fb)),0x1;}catch(_0x1abca4){return console[_0x46c2a4(0x1ff)](_0x46c2a4(0x206)+_0x1abca4['message']),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x20e)),console['error'](_0x46c2a4(0x204)),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x1fb)),0x1;}const _0x54ddc5=_0x35ce18[_0x46c2a4(0x202)],_0x2da9f4=_0x35ce18['database'],_0xb8f3d8=_0x35ce18[_0x46c2a4(0x215)],_0x1df07f=resolveLimit(_0x4128a2['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x4128a2['verbose']&&(console[_0x46c2a4(0x1ff)]('Site:\x20'+_0x4128a2['site']),_0x54ddc5&&console[_0x46c2a4(0x1ff)]('Catalog:\x20'+_0x54ddc5),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x201)+_0x2da9f4),console['error'](_0x46c2a4(0x209)+_0xb8f3d8),console[_0x46c2a4(0x1ff)]('Limit:\x20'+_0x1df07f));const _0x2aec89=_0x54ddc5?_0x54ddc5+'.'+_0x2da9f4+'.'+_0xb8f3d8:_0x2da9f4+'.'+_0xb8f3d8,_0x5a0409=await withSpinner('Querying\x20'+_0x2aec89+_0x46c2a4(0x20c),()=>_0x2c23c1[_0x46c2a4(0x217)][_0x46c2a4(0x1f8)](_0x2da9f4,_0xb8f3d8,_0x1df07f,_0x54ddc5),{'verbose':_0x4128a2[_0x46c2a4(0x20d)]}),_0x5b8e68=_0x5a0409[_0x46c2a4(0x211)],_0x2f73fe=_0x5b8e68[_0x46c2a4(0x211)];return _0x2f73fe[_0x46c2a4(0x1f9)]===0x0?console['error']('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x46c2a4(0x1ff)](_0x46c2a4(0x213)+_0x2f73fe['length']+_0x46c2a4(0x205)+(_0x2f73fe[_0x46c2a4(0x1f9)]!==0x1?'s':'')+'\x20from\x20'+_0x2aec89),await handleSDKOutput(_0x2f73fe,_0x4128a2),0x0;}catch(_0x5a6f7b){if(_0x5a6f7b instanceof SDKError)return console[_0x46c2a4(0x1ff)]('Error:\x20'+_0x5a6f7b[_0x46c2a4(0x20b)]),_0x5a6f7b[_0x46c2a4(0x1f6)]&&console[_0x46c2a4(0x1ff)]('\x20\x20Cause:\x20'+_0x5a6f7b['cause']),0x1;throw _0x5a6f7b;}}[a46_0x29de96(0x1fe)](_0x41225f){const _0xdaf245=a46_0x29de96;if(_0x41225f['args']['length']===0x0)return _0xdaf245(0x210);if(_0x41225f[_0xdaf245(0x20f)][_0xdaf245(0x1f9)]>0x1)return _0xdaf245(0x218);return undefined;}}function a46_0x486f(){const _0x5efd39=['1239oYFnMy','database','31799ZEScdD','cause','execute','showTable','length','description','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','145485lhAbLx','show','validate','error','7iANkjN','Database:\x20','catalog','23823USDhBx','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20row','Error:\x20','9642fatgzY','Show\x20table\x20contents','Table:\x20','2050PyXafD','message','...','verbose','Usage:\x20tdx\x20show\x20<database.table>','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','data','404jEOzNl','✔\x20Retrieved\x20','13519VnPDuN','table','8XbmUKA','query','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','name','204550kIbXip'];a46_0x486f=function(){return _0x5efd39;};return a46_0x486f();}
@@ -1 +1 @@
1
- const a47_0x589762=a47_0x4702;function a47_0x4702(_0x2dd39f,_0x31cfe6){_0x2dd39f=_0x2dd39f-0xc3;const _0x51759f=a47_0x5175();let _0x4702b6=_0x51759f[_0x2dd39f];return _0x4702b6;}(function(_0x358937,_0x5ec5c2){const _0x14d058=a47_0x4702,_0x354aa6=_0x358937();while(!![]){try{const _0x2bc41f=-parseInt(_0x14d058(0xd1))/0x1*(parseInt(_0x14d058(0xc4))/0x2)+-parseInt(_0x14d058(0xcc))/0x3*(-parseInt(_0x14d058(0xca))/0x4)+parseInt(_0x14d058(0xdb))/0x5*(parseInt(_0x14d058(0xed))/0x6)+-parseInt(_0x14d058(0xc9))/0x7+-parseInt(_0x14d058(0xdc))/0x8*(-parseInt(_0x14d058(0xde))/0x9)+parseInt(_0x14d058(0xf0))/0xa*(-parseInt(_0x14d058(0xcf))/0xb)+parseInt(_0x14d058(0xcb))/0xc*(parseInt(_0x14d058(0xc5))/0xd);if(_0x2bc41f===_0x5ec5c2)break;else _0x354aa6['push'](_0x354aa6['shift']());}catch(_0x264ba5){_0x354aa6['push'](_0x354aa6['shift']());}}}(a47_0x5175,0xedc83));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';import a47_0x3527d4 from'chalk';function a47_0x5175(){const _0x10642a=['name','displayWithSources','session','getUserInfo','log','Show\x20authentication\x20status\x20and\x20current\x20context','bold','status','dim','last_name','email','description','\x20profile:\x20','213348SAdKdP','profile','message','79930fOryBH','CLI\x20flag','yellow','✗\x20Validation\x20failed:\x20','92qevoiH','255632lAVyUc','(from\x20','Account\x20ID:','jobs','15456uxuauK','3396356dzcVgP','876kHUOSp','3KijaIQ','tdx','env','1419RyrkbA','site','33787qXXBuq','filter','cyan','profileSource','first_name','account_id','site:\x20','execute','cli','join','45ISYWbQ','952aaQdsg','No\x20credential\x20found','72369DhqLaP','N/A'];a47_0x5175=function(){return _0x10642a;};return a47_0x5175();}export class StatusCommand extends BaseCommand{[a47_0x589762(0xe0)]=a47_0x589762(0xe7);[a47_0x589762(0xeb)]=a47_0x589762(0xe5);async[a47_0x589762(0xd8)](_0x5aba07){const _0x45018c=a47_0x589762,{options:_0x55050c,tdx:_0x119abd}=_0x5aba07,_0x21af5b=_0x55050c[_0x45018c(0xd0)],_0x3699b8=new GlobalContext(_0x55050c),_0x3b02f9=_0x3699b8[_0x45018c(0xee)],_0x48a3f2=_0x3699b8[_0x45018c(0xd4)],_0x1de4b6=_0x48a3f2===_0x45018c(0xd9)?_0x45018c(0xf1):_0x48a3f2==='session'?_0x45018c(0xe2):_0x48a3f2===_0x45018c(0xce)?'TDX_PROFILE\x20env':_0x48a3f2==='config'?'config':null,_0x4678ba=_0x3b02f9?a47_0x3527d4['cyan'](_0x3b02f9):a47_0x3527d4[_0x45018c(0xe8)](_0x45018c(0xdf)),_0x3892e6=_0x1de4b6?'\x20'+a47_0x3527d4[_0x45018c(0xe8)](_0x45018c(0xc6)+_0x1de4b6+')'):'';console[_0x45018c(0xe4)](a47_0x3527d4[_0x45018c(0xe6)](_0x45018c(0xcd))+_0x45018c(0xec)+_0x4678ba+_0x3892e6+'\x20'+a47_0x3527d4[_0x45018c(0xe8)]('(')+_0x45018c(0xd7)+a47_0x3527d4[_0x45018c(0xd3)](_0x21af5b)+a47_0x3527d4[_0x45018c(0xe8)](')'));const _0x6eaf81=await getOAuthTokens(_0x3b02f9);if(_0x6eaf81)console['log']('Credential\x20type:\x20'+a47_0x3527d4[_0x45018c(0xd3)]('OAuth'));else{const _0x4c3479=await resolveAPIKeyAsync(_0x21af5b,_0x3b02f9);if(_0x4c3479){const {source:_0x3d50c1,isDeprecated:_0x3592be}=_0x4c3479,_0x21667d='Read\x20credential\x20from\x20'+a47_0x3527d4[_0x45018c(0xd3)](_0x3d50c1);console[_0x45018c(0xe4)](_0x3592be?a47_0x3527d4[_0x45018c(0xf2)](_0x21667d):_0x21667d);}else console[_0x45018c(0xe4)](a47_0x3527d4['yellow'](_0x45018c(0xdd)));}let _0x52a99e=![];try{const _0x363cee=await _0x119abd[_0x45018c(0xc8)][_0x45018c(0xe3)]();console[_0x45018c(0xe4)](a47_0x3527d4['green']('✓\x20Authentication\x20successful\x0a')),console[_0x45018c(0xe4)](a47_0x3527d4[_0x45018c(0xe6)]('User:')+'\x20'+a47_0x3527d4['cyan'](_0x363cee[_0x45018c(0xea)]));if(_0x363cee[_0x45018c(0xd5)]||_0x363cee[_0x45018c(0xe9)]){const _0x20c66b=[_0x363cee[_0x45018c(0xd5)],_0x363cee['last_name']][_0x45018c(0xd2)](Boolean)[_0x45018c(0xda)]('\x20');console[_0x45018c(0xe4)](a47_0x3527d4[_0x45018c(0xe6)]('Name:')+'\x20'+_0x20c66b);}_0x363cee[_0x45018c(0xd6)]&&console[_0x45018c(0xe4)](a47_0x3527d4[_0x45018c(0xe6)](_0x45018c(0xc7))+'\x20'+a47_0x3527d4[_0x45018c(0xf2)](_0x363cee[_0x45018c(0xd6)])),_0x52a99e=!![];}catch(_0x38b013){_0x38b013 instanceof HTTPClientError&&_0x38b013[_0x45018c(0xe7)]===0x191?printAuthError(_0x38b013,!![],_0x3b02f9):console['error'](a47_0x3527d4['red'](_0x45018c(0xc3)+(_0x38b013 instanceof Error?_0x38b013[_0x45018c(0xef)]:String(_0x38b013))));}return console[_0x45018c(0xe4)](),_0x3699b8[_0x45018c(0xe1)](),_0x52a99e?0x0:0x1;}}
1
+ const a47_0x2a7e33=a47_0x3ff0;(function(_0x85ad07,_0xb5cbe0){const _0x5cfcc6=a47_0x3ff0,_0x5b7343=_0x85ad07();while(!![]){try{const _0x36752d=-parseInt(_0x5cfcc6(0xce))/0x1*(-parseInt(_0x5cfcc6(0xeb))/0x2)+parseInt(_0x5cfcc6(0xcd))/0x3+-parseInt(_0x5cfcc6(0xc4))/0x4*(parseInt(_0x5cfcc6(0xd4))/0x5)+parseInt(_0x5cfcc6(0xe9))/0x6*(parseInt(_0x5cfcc6(0xe7))/0x7)+parseInt(_0x5cfcc6(0xc9))/0x8*(parseInt(_0x5cfcc6(0xdc))/0x9)+-parseInt(_0x5cfcc6(0xdb))/0xa+-parseInt(_0x5cfcc6(0xe8))/0xb;if(_0x36752d===_0xb5cbe0)break;else _0x5b7343['push'](_0x5b7343['shift']());}catch(_0x36885c){_0x5b7343['push'](_0x5b7343['shift']());}}}(a47_0x6ac3,0xb8381));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x3ff0(_0x348837,_0x41b150){_0x348837=_0x348837-0xc2;const _0x6ac3f0=a47_0x6ac3();let _0x3ff08d=_0x6ac3f0[_0x348837];return _0x3ff08d;}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x297ac9 from'chalk';export class StatusCommand extends BaseCommand{['name']=a47_0x2a7e33(0xc6);[a47_0x2a7e33(0xca)]=a47_0x2a7e33(0xc8);async[a47_0x2a7e33(0xe2)](_0x508bb8){const _0x2d79cc=a47_0x2a7e33,{options:_0x1d529d,tdx:_0x5b960b}=_0x508bb8,_0xed0ea6=_0x1d529d['site'],_0x42b7c2=new GlobalContext(_0x1d529d),_0x2a1831=_0x42b7c2['profile'],_0x338ac8=_0x42b7c2['profileSource'],_0x4ab062=_0x338ac8==='cli'?_0x2d79cc(0xe6):_0x338ac8===_0x2d79cc(0xc5)?_0x2d79cc(0xc5):_0x338ac8==='env'?'TDX_PROFILE\x20env':_0x338ac8==='config'?_0x2d79cc(0xd6):null,_0x57ea11=_0x2a1831?a47_0x297ac9[_0x2d79cc(0xdf)](_0x2a1831):a47_0x297ac9[_0x2d79cc(0xd0)](_0x2d79cc(0xc3)),_0x3e6526=_0x4ab062?'\x20'+a47_0x297ac9['dim'](_0x2d79cc(0xea)+_0x4ab062+')'):'';console['log'](a47_0x297ac9[_0x2d79cc(0xd1)]('tdx')+'\x20profile:\x20'+_0x57ea11+_0x3e6526+'\x20'+a47_0x297ac9[_0x2d79cc(0xd0)]('(')+_0x2d79cc(0xd8)+a47_0x297ac9[_0x2d79cc(0xdf)](_0xed0ea6)+a47_0x297ac9[_0x2d79cc(0xd0)](')'));const _0x2e2653=await getOAuthTokens(_0x2a1831);if(_0x2e2653)console[_0x2d79cc(0xd7)]('Credential\x20type:\x20'+a47_0x297ac9[_0x2d79cc(0xdf)]('OAuth'));else{const _0x54d18=await resolveAPIKeyAsync(_0xed0ea6,_0x2a1831);if(_0x54d18){const {source:_0x3ae5b0,isDeprecated:_0x49998a}=_0x54d18,_0x10e789=_0x2d79cc(0xcb)+a47_0x297ac9[_0x2d79cc(0xdf)](_0x3ae5b0);console['log'](_0x49998a?a47_0x297ac9[_0x2d79cc(0xcc)](_0x10e789):_0x10e789);}else console[_0x2d79cc(0xd7)](a47_0x297ac9[_0x2d79cc(0xcc)]('No\x20credential\x20found'));}let _0x2d4c10=![];try{const _0x2e9e97=await _0x5b960b[_0x2d79cc(0xd5)][_0x2d79cc(0xde)]();console[_0x2d79cc(0xd7)](a47_0x297ac9['green'](_0x2d79cc(0xe3))),console['log'](a47_0x297ac9['bold']('User:')+'\x20'+a47_0x297ac9['cyan'](_0x2e9e97[_0x2d79cc(0xe5)]));if(_0x2e9e97[_0x2d79cc(0xda)]||_0x2e9e97[_0x2d79cc(0xc7)]){const _0x2aa3df=[_0x2e9e97[_0x2d79cc(0xda)],_0x2e9e97[_0x2d79cc(0xc7)]][_0x2d79cc(0xcf)](Boolean)[_0x2d79cc(0xc2)]('\x20');console['log'](a47_0x297ac9[_0x2d79cc(0xd1)](_0x2d79cc(0xd3))+'\x20'+_0x2aa3df);}_0x2e9e97[_0x2d79cc(0xe4)]&&console[_0x2d79cc(0xd7)](a47_0x297ac9[_0x2d79cc(0xd1)](_0x2d79cc(0xd2))+'\x20'+a47_0x297ac9[_0x2d79cc(0xcc)](_0x2e9e97['account_id'])),_0x2d4c10=!![];}catch(_0x1e07de){_0x1e07de instanceof HTTPClientError&&_0x1e07de[_0x2d79cc(0xc6)]===0x191?printAuthError(_0x1e07de,!![],_0x2a1831):console[_0x2d79cc(0xe1)](a47_0x297ac9[_0x2d79cc(0xd9)](_0x2d79cc(0xe0)+(_0x1e07de instanceof Error?_0x1e07de[_0x2d79cc(0xdd)]:String(_0x1e07de))));}return console[_0x2d79cc(0xd7)](),_0x42b7c2['displayWithSources'](),_0x2d4c10?0x0:0x1;}}function a47_0x6ac3(){const _0x14ec30=['status','last_name','Show\x20authentication\x20status\x20and\x20current\x20context','11082072eiIkxZ','description','Read\x20credential\x20from\x20','yellow','4168935gMMznW','53dXPiPR','filter','dim','bold','Account\x20ID:','Name:','111115gNPAra','jobs','config','log','site:\x20','red','first_name','4814930HtMvja','9qdHDpu','message','getUserInfo','cyan','✗\x20Validation\x20failed:\x20','error','execute','✓\x20Authentication\x20successful\x0a','account_id','email','CLI\x20flag','14fklmQj','28694138IJXbKj','3793830fOMoea','(from\x20','35414BRMdFz','join','N/A','204piXphl','session'];a47_0x6ac3=function(){return _0x14ec30;};return a47_0x6ac3();}