@treasuredata/tdx 2026.3.53 → 2026.4.55

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 (254) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/delivery-command.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-campaign-pull-command.js +1 -1
  26. package/dist/commands/engage-campaign-push-command.js +1 -1
  27. package/dist/commands/engage-campaign-validate-command.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-template-pull-command.js +1 -1
  30. package/dist/commands/engage-template-push-command.js +1 -1
  31. package/dist/commands/engage-template-validate-command.js +1 -1
  32. package/dist/commands/job-command.js +1 -1
  33. package/dist/commands/journey-command.js +1 -1
  34. package/dist/commands/journey-validate-command.js +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/mcp-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.d.ts +27 -0
  61. package/dist/commands/workflow-command.d.ts.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/commands/workflow-command.js.map +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.d.ts +10 -0
  90. package/dist/sdk/agent/agent-config.d.ts.map +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-config.js.map +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.d.ts +61 -3
  95. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  98. package/dist/sdk/agent/test/evaluator.js +1 -1
  99. package/dist/sdk/agent/test/executor.js +1 -1
  100. package/dist/sdk/agent/test/index.js +1 -1
  101. package/dist/sdk/agent/test/output.js +1 -1
  102. package/dist/sdk/agent/test/parser.js +1 -1
  103. package/dist/sdk/agent/tool-target-registry.js +1 -1
  104. package/dist/sdk/agent/types/agent-def.d.ts +43 -0
  105. package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
  106. package/dist/sdk/api.js +1 -1
  107. package/dist/sdk/cas/cas-api-client.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  109. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  110. package/dist/sdk/cas/index.js +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/client/cdp-api-client.js +1 -1
  114. package/dist/sdk/client/delivery-api-client.js +1 -1
  115. package/dist/sdk/client/endpoints.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.d.ts +73 -1
  119. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  120. package/dist/sdk/client/llm-api-client.js +1 -1
  121. package/dist/sdk/client/llm-api-client.js.map +1 -1
  122. package/dist/sdk/client/oauth-refresh.js +1 -1
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.d.ts +28 -1
  127. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  128. package/dist/sdk/client/workflow-client.js +1 -1
  129. package/dist/sdk/client/workflow-client.js.map +1 -1
  130. package/dist/sdk/connection-validator.js +1 -1
  131. package/dist/sdk/connection.js +1 -1
  132. package/dist/sdk/delivery.js +1 -1
  133. package/dist/sdk/engage/campaign-pull.js +1 -1
  134. package/dist/sdk/engage/campaign-push.js +1 -1
  135. package/dist/sdk/engage/campaign-validator.js +1 -1
  136. package/dist/sdk/engage/campaign-yaml.js +1 -1
  137. package/dist/sdk/engage/template-pull.js +1 -1
  138. package/dist/sdk/engage/template-push.js +1 -1
  139. package/dist/sdk/engage/template-validator.js +1 -1
  140. package/dist/sdk/engage/template-yaml.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.d.ts.map +1 -1
  153. package/dist/sdk/llm/index.js +1 -1
  154. package/dist/sdk/llm/index.js.map +1 -1
  155. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/personalization.js +1 -1
  158. package/dist/sdk/policy.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.js +1 -1
  166. package/dist/sdk/segment/journey-utils.js +1 -1
  167. package/dist/sdk/segment/journey-validator.js +1 -1
  168. package/dist/sdk/segment/journey-yaml.js +1 -1
  169. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  170. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/pull-workflow.js +1 -1
  172. package/dist/sdk/segment/push-recovery.js +1 -1
  173. package/dist/sdk/segment/push-workflow.js +1 -1
  174. package/dist/sdk/segment/resolution-context.js +1 -1
  175. package/dist/sdk/segment/segment-path-parser.js +1 -1
  176. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  177. package/dist/sdk/segment/segment-validator.js +1 -1
  178. package/dist/sdk/segment/target-resolution.js +1 -1
  179. package/dist/sdk/segment/tdx-config.js +1 -1
  180. package/dist/sdk/segment/types/activation-schema.js +1 -1
  181. package/dist/sdk/segment/types/journey-def.js +1 -1
  182. package/dist/sdk/segment/types/journey-schema.js +1 -1
  183. package/dist/sdk/segment/types/segment-def.js +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/validate-files.js +1 -1
  186. package/dist/sdk/segment/yaml-validator.js +1 -1
  187. package/dist/sdk/segment.js +1 -1
  188. package/dist/sdk/types/index.d.ts +2 -2
  189. package/dist/sdk/types/index.d.ts.map +1 -1
  190. package/dist/sdk/types/index.js +1 -1
  191. package/dist/sdk/types/index.js.map +1 -1
  192. package/dist/sdk/types/llm.d.ts +158 -0
  193. package/dist/sdk/types/llm.d.ts.map +1 -1
  194. package/dist/sdk/types/progress.js +1 -1
  195. package/dist/sdk/types/workflow.d.ts +26 -0
  196. package/dist/sdk/types/workflow.d.ts.map +1 -1
  197. package/dist/sdk/types/workspace.js +1 -1
  198. package/dist/sdk/user.js +1 -1
  199. package/dist/sdk/util/format-detector.js +1 -1
  200. package/dist/sdk/util/formatters.js +1 -1
  201. package/dist/sdk/util/index.js +1 -1
  202. package/dist/sdk/util/paginate.js +1 -1
  203. package/dist/sdk/util/tree-formatter.js +1 -1
  204. package/dist/sdk/workflow/archive-validation.js +1 -1
  205. package/dist/sdk/workflow/clone-workflow.js +1 -1
  206. package/dist/sdk/workflow/index.d.ts +22 -0
  207. package/dist/sdk/workflow/index.d.ts.map +1 -1
  208. package/dist/sdk/workflow/index.js +1 -1
  209. package/dist/sdk/workflow/index.js.map +1 -1
  210. package/dist/sdk/workflow/pull-workflow.js +1 -1
  211. package/dist/sdk/workflow/push-workflow.js +1 -1
  212. package/dist/sdk/workflow/tdx-config.js +1 -1
  213. package/dist/sdk/workflow/workflow-utils.js +1 -1
  214. package/dist/sdk/workspace/frontmatter.js +1 -1
  215. package/dist/sdk/workspace/git.js +1 -1
  216. package/dist/sdk/workspace/index.js +1 -1
  217. package/dist/sdk/workspace/templates.js +1 -1
  218. package/dist/sdk/workspace/weekly.js +1 -1
  219. package/dist/sdk/workspace/wikilinks.js +1 -1
  220. package/dist/test-utils/command-runner.js +1 -1
  221. package/dist/test-utils/factories.js +1 -1
  222. package/dist/test-utils/fixtures.js +1 -1
  223. package/dist/test-utils/http-mock.js +1 -1
  224. package/dist/test-utils/index.js +1 -1
  225. package/dist/utils/async.js +1 -1
  226. package/dist/utils/colors.js +1 -1
  227. package/dist/utils/diff.js +1 -1
  228. package/dist/utils/file-permissions.js +1 -1
  229. package/dist/utils/file-reader.js +1 -1
  230. package/dist/utils/github-releases.js +1 -1
  231. package/dist/utils/global-cache.js +1 -1
  232. package/dist/utils/json-loader.js +1 -1
  233. package/dist/utils/local-cache.js +1 -1
  234. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  235. package/dist/utils/logger/formatters/index.js +1 -1
  236. package/dist/utils/logger/handlers/console-handler.js +1 -1
  237. package/dist/utils/logger/handlers/file-handler.js +1 -1
  238. package/dist/utils/logger/handlers/index.js +1 -1
  239. package/dist/utils/logger/handlers/null-handler.js +1 -1
  240. package/dist/utils/logger/index.js +1 -1
  241. package/dist/utils/logger/logger.js +1 -1
  242. package/dist/utils/logger/types.js +1 -1
  243. package/dist/utils/option-validation.js +1 -1
  244. package/dist/utils/process.d.ts.map +1 -1
  245. package/dist/utils/process.js +1 -1
  246. package/dist/utils/process.js.map +1 -1
  247. package/dist/utils/prompt.js +1 -1
  248. package/dist/utils/spinner.js +1 -1
  249. package/dist/utils/sse-parser.js +1 -1
  250. package/dist/utils/string-utils.js +1 -1
  251. package/dist/utils/table-ref-parser.js +1 -1
  252. package/dist/utils/tdx-logger.js +1 -1
  253. package/dist/utils/version-check.js +1 -1
  254. package/package.json +2 -2
@@ -1 +1 @@
1
- function a40_0x8060(_0x499393,_0x215edd){_0x499393=_0x499393-0x88;const _0x17b30a=a40_0x17b3();let _0x806065=_0x17b30a[_0x499393];return _0x806065;}const a40_0x530ffa=a40_0x8060;(function(_0x358727,_0x5658de){const _0x3ffdbc=a40_0x8060,_0x262241=_0x358727();while(!![]){try{const _0x113871=parseInt(_0x3ffdbc(0xa9))/0x1+parseInt(_0x3ffdbc(0x97))/0x2*(parseInt(_0x3ffdbc(0xc9))/0x3)+-parseInt(_0x3ffdbc(0x89))/0x4+parseInt(_0x3ffdbc(0xa8))/0x5*(-parseInt(_0x3ffdbc(0xc8))/0x6)+-parseInt(_0x3ffdbc(0xbc))/0x7*(-parseInt(_0x3ffdbc(0xda))/0x8)+-parseInt(_0x3ffdbc(0x92))/0x9+-parseInt(_0x3ffdbc(0xcb))/0xa*(-parseInt(_0x3ffdbc(0xbe))/0xb);if(_0x113871===_0x5658de)break;else _0x262241['push'](_0x262241['shift']());}catch(_0x36bf30){_0x262241['push'](_0x262241['shift']());}}}(a40_0x17b3,0xce621));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_0x44cd55 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x1da32a from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x530ffa(0x8b)]=a40_0x530ffa(0xb5);[a40_0x530ffa(0x9a)]=a40_0x530ffa(0xc1);async[a40_0x530ffa(0xd6)](_0x49b342){const _0x265448=a40_0x530ffa,{options:_0x559a28,args:_0x3e40a1,tdx:_0x2fd7ee}=_0x49b342,_0x50577a=_0x559a28,_0x342328=await resolveTarget({'arg':_0x3e40a1[0x0],'contextParent':_0x559a28[_0x265448(0xc4)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x342328))return _0x342328[_0x265448(0xa6)]==='no_parent'?(console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xae)](_0x265448(0xc7))),console['error'](_0x265448(0xa2)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x265448(0x9b)](_0x265448(0xb0))):(console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xca)](_0x265448(0xb6)+_0x342328[_0x265448(0x93)]+'\x0a')),_0x342328[_0x265448(0xa7)]&&console[_0x265448(0x9b)](a40_0x44cd55['cyan'](_0x342328[_0x265448(0xa7)]))),0x1;const _0x80468e=_0x342328[_0x265448(0xab)],_0x12064f=_0x342328[_0x265448(0xbb)],_0x1c0ba0=_0x342328[_0x265448(0x94)]==='file'?_0x342328[_0x265448(0xc5)]:undefined;_0x50577a['verbose']&&(console[_0x265448(0x9b)](_0x265448(0xb2)+_0x50577a[_0x265448(0x8a)]),console['error'](_0x265448(0xc2)+_0x80468e),_0x1c0ba0&&console['error'](_0x265448(0xb1)+_0x1c0ba0));const _0xca285e=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x80468e+_0x265448(0xa3),_0x1aa760=>_0x2fd7ee[_0x265448(0xd8)]['pullSegments'](_0x80468e,{'targetDir':_0x12064f,'targetResourceName':_0x1c0ba0,'verbose':_0x50577a[_0x265448(0xcf)],'progress':{'update':_0x3ed3ab=>{const _0x54d3e5=_0x265448;_0x1aa760[_0x54d3e5(0xa0)](_0x3ed3ab),_0x50577a[_0x54d3e5(0xcf)]&&console[_0x54d3e5(0x9b)]('\x20\x20'+_0x3ed3ab);}}}),{'verbose':_0x50577a[_0x265448(0xcf)]}),_0xfcb2c4=_0xca285e['data'];if(_0xfcb2c4[_0x265448(0xd1)][_0x265448(0xa4)]===0x0&&_0xfcb2c4[_0x265448(0xd1)][_0x265448(0x8f)]===0x0)return console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xae)](_0x265448(0xa5)+_0xfcb2c4[_0x265448(0xab)]+'\x27')),0x0;const _0x14858b=_0xfcb2c4['files']['filter'](_0x39596f=>_0x39596f[_0x265448(0xaf)]),_0x2397fd=_0xfcb2c4[_0x265448(0x9c)][_0x265448(0xd9)](_0x3f46a1=>!_0x3f46a1[_0x265448(0xaf)]&&_0x3f46a1[_0x265448(0x9e)]),_0x21c57=_0xfcb2c4[_0x265448(0x9c)][_0x265448(0xd9)](_0x22e079=>!_0x22e079[_0x265448(0xaf)]&&!_0x22e079[_0x265448(0x9e)]);console[_0x265448(0x9b)](_0x265448(0xce)+_0xfcb2c4[_0x265448(0xab)]+'\x27:'),console['error'](_0x265448(0xb3)+a40_0x44cd55['cyan'](_0xfcb2c4['counts'][_0x265448(0xa4)]+_0x265448(0xcc))+_0x265448(0xcd)+a40_0x44cd55['cyan'](_0xfcb2c4[_0x265448(0xd1)]['activations']+_0x265448(0xaa)));if(_0xfcb2c4[_0x265448(0xd1)]['journeys']>0x0){const _0x15c086=_0xfcb2c4[_0x265448(0xd1)]['journeyVersions']>_0xfcb2c4['counts']['journeys']?'\x20('+_0xfcb2c4[_0x265448(0xd1)][_0x265448(0x98)]+_0x265448(0xbd):'';console['error']('\x20\x20🗺️\x20\x20'+a40_0x44cd55[_0x265448(0x96)](_0xfcb2c4['counts'][_0x265448(0x8f)]+_0x265448(0xb4))+a40_0x44cd55[_0x265448(0x8c)](_0x15c086));}console[_0x265448(0x9b)]('\x20\x20'+a40_0x44cd55[_0x265448(0xac)]('+\x20'+_0x14858b['length']+_0x265448(0xd2))),console['error']('\x20\x20'+a40_0x44cd55[_0x265448(0xae)]('~\x20'+_0x2397fd[_0x265448(0x8d)]+'\x20changed\x20files')),console[_0x265448(0x9b)]('\x20\x20'+a40_0x44cd55[_0x265448(0x8c)]('=\x20'+_0x21c57[_0x265448(0x8d)]+_0x265448(0x9f))),console['error'](_0x265448(0xc3)+a40_0x44cd55[_0x265448(0x96)](_0xfcb2c4['targetDir'])+'\x0a');if(_0x2397fd[_0x265448(0x8d)]>0x0)for(const _0x3c0946 of _0x2397fd){console['error'](_0x265448(0x88)+_0x3c0946[_0x265448(0xd5)]+'\x27:'),console[_0x265448(0x9b)]('─'['repeat'](0x3c)),console['error'](_0x3c0946[_0x265448(0xa1)]),console[_0x265448(0x9b)]('─'[_0x265448(0x95)](0x3c));}if(_0x50577a[_0x265448(0xba)])return console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xae)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x14858b['length']===0x0&&_0x2397fd[_0x265448(0x8d)]===0x0)return console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xac)](_0x265448(0x99))),saveSessionContext({'parent_segment':_0xfcb2c4[_0x265448(0xab)]},_0x50577a[_0x265448(0x8e)]),console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xac)](_0x265448(0xc6)+a40_0x44cd55[_0x265448(0x8c)](_0x265448(0xd7))+'\x20=\x20'+a40_0x44cd55[_0x265448(0x96)](_0xfcb2c4[_0x265448(0xab)]))),0x0;if(!_0x50577a[_0x265448(0xbf)]){if(!isInteractive())return console['error'](a40_0x44cd55[_0x265448(0xca)](_0x265448(0xc0)),_0x265448(0x90)),console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0x8c)](_0x265448(0x9d))),0x1;const _0x5e7564=await confirmKey(_0x265448(0xd0)+(_0x14858b['length']+_0x2397fd[_0x265448(0x8d)])+_0x265448(0xd3));if(!_0x5e7564)return console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xae)](_0x265448(0xdb)),_0x265448(0xad)),0x1;}for(const _0x29fc5b of _0xfcb2c4[_0x265448(0x9c)]){if(_0x29fc5b[_0x265448(0xaf)]||_0x29fc5b[_0x265448(0x9e)]){const _0x3360f1=a40_0x1da32a[_0x265448(0xd4)](_0x29fc5b[_0x265448(0xb9)]);!existsSync(_0x3360f1)&&mkdirSync(_0x3360f1,{'recursive':!![]}),writeFileSync(_0x29fc5b[_0x265448(0xb9)],_0x29fc5b[_0x265448(0x91)],_0x265448(0xb7));}}return console['error'](a40_0x44cd55[_0x265448(0xac)]('✔\x20Pulled\x20'+(_0x14858b[_0x265448(0x8d)]+_0x2397fd[_0x265448(0x8d)])+_0x265448(0xb8)+_0xfcb2c4[_0x265448(0xbb)])),saveSessionContext({'parent_segment':_0xfcb2c4[_0x265448(0xab)]},_0x50577a[_0x265448(0x8e)]),console[_0x265448(0x9b)](a40_0x44cd55['green'](_0x265448(0xc6)+a40_0x44cd55[_0x265448(0x8c)](_0x265448(0xd7))+'\x20=\x20'+a40_0x44cd55['cyan'](_0xfcb2c4['parentName']))),0x0;}}function a40_0x17b3(){const _0x2936a2=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasChanges','\x20unchanged\x20files','setPhase','diff','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)','\x27...','segments','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','errorCode','helpText','5ezWXtn','1596452HkUvLM','\x20activations','parentName','green','-\x20no\x20files\x20written','yellow','isNew','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Target\x20resource:\x20','Site:\x20','\x20\x20🎯\x20','\x20journeys','segment:pull','Error:\x20','utf-8','\x20files\x20to\x20','absolutePath','dryRun','targetDir','7366212FsWoJY','\x20versions)','99847pnJnHQ','yes','\x0aError:','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Parent\x20segment:\x20','\x20\x20Target:\x20','parentSegment','resourceName','✔\x20Context\x20set:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','4157346jzJsjD','3732qqmUZX','red','30PlCvIB','\x20segments','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','verbose','Write\x20','counts','\x20new\x20files','\x20files?','dirname','relativePath','execute','parent_segment','segment','filter','8BRWOsg','Aborted.','\x0aChanges\x20to\x20\x27','5973384oEpQBp','site','name','dim','length','session','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','content','8074125VDjEft','message','type','repeat','cyan','2014SkkVhc','journeyVersions','✔\x20All\x20files\x20are\x20up\x20to\x20date','description','error','files'];a40_0x17b3=function(){return _0x2936a2;};return a40_0x17b3();}
1
+ const a40_0x3ab3a2=a40_0x4a9f;(function(_0x2f0864,_0x188a4c){const _0xa3d161=a40_0x4a9f,_0x542705=_0x2f0864();while(!![]){try{const _0x15886c=parseInt(_0xa3d161(0x11b))/0x1*(parseInt(_0xa3d161(0x129))/0x2)+-parseInt(_0xa3d161(0x159))/0x3+parseInt(_0xa3d161(0x151))/0x4+parseInt(_0xa3d161(0x125))/0x5*(parseInt(_0xa3d161(0x147))/0x6)+parseInt(_0xa3d161(0x145))/0x7+-parseInt(_0xa3d161(0x122))/0x8+-parseInt(_0xa3d161(0x162))/0x9*(parseInt(_0xa3d161(0x15c))/0xa);if(_0x15886c===_0x188a4c)break;else _0x542705['push'](_0x542705['shift']());}catch(_0x44c305){_0x542705['push'](_0x542705['shift']());}}}(a40_0x29f9,0xe90b4));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_0xa1ed51 from'chalk';function a40_0x4a9f(_0x5dec67,_0x4a279a){_0x5dec67=_0x5dec67-0x113;const _0x29f95f=a40_0x29f9();let _0x4a9fe0=_0x29f95f[_0x5dec67];return _0x4a9fe0;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x228cba from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x3ab3a2(0x12b)]=a40_0x3ab3a2(0x119);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x41bceb){const _0x4bfa46=a40_0x3ab3a2,{options:_0x221f68,args:_0x1ac085,tdx:_0x4e1f66}=_0x41bceb,_0x1f1d0d=_0x221f68,_0x729970=await resolveTarget({'arg':_0x1ac085[0x0],'contextParent':_0x221f68[_0x4bfa46(0x113)],'cwd':process[_0x4bfa46(0x130)]()});if(!isSuccessfulResolution(_0x729970))return _0x729970[_0x4bfa46(0x131)]==='no_parent'?(console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x115)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4bfa46(0x127)](_0x4bfa46(0x114)),console[_0x4bfa46(0x127)](_0x4bfa46(0x146)),console['error'](_0x4bfa46(0x160))):(console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x144)]('Error:\x20'+_0x729970['message']+'\x0a')),_0x729970[_0x4bfa46(0x15b)]&&console[_0x4bfa46(0x127)](a40_0xa1ed51['cyan'](_0x729970[_0x4bfa46(0x15b)]))),0x1;const _0x230ea0=_0x729970[_0x4bfa46(0x150)],_0x2e20f0=_0x729970[_0x4bfa46(0x15e)],_0x1f3cc0=_0x729970[_0x4bfa46(0x12a)]===_0x4bfa46(0x14e)?_0x729970[_0x4bfa46(0x124)]:undefined;_0x1f1d0d[_0x4bfa46(0x133)]&&(console['error']('Site:\x20'+_0x1f1d0d[_0x4bfa46(0x155)]),console[_0x4bfa46(0x127)](_0x4bfa46(0x13e)+_0x230ea0),_0x1f3cc0&&console['error'](_0x4bfa46(0x137)+_0x1f3cc0));const _0x19ab41=await withProgressSpinner(_0x4bfa46(0x161)+_0x230ea0+_0x4bfa46(0x121),_0x258134=>_0x4e1f66[_0x4bfa46(0x14f)][_0x4bfa46(0x140)](_0x230ea0,{'targetDir':_0x2e20f0,'targetResourceName':_0x1f3cc0,'verbose':_0x1f1d0d[_0x4bfa46(0x133)],'progress':{'update':_0x58be94=>{const _0x5321f1=_0x4bfa46;_0x258134[_0x5321f1(0x12e)](_0x58be94),_0x1f1d0d[_0x5321f1(0x133)]&&console['error']('\x20\x20'+_0x58be94);}}}),{'verbose':_0x1f1d0d[_0x4bfa46(0x133)]}),_0x3a0a4a=_0x19ab41[_0x4bfa46(0x13a)];if(_0x3a0a4a[_0x4bfa46(0x13f)][_0x4bfa46(0x14a)]===0x0&&_0x3a0a4a[_0x4bfa46(0x13f)][_0x4bfa46(0x116)]===0x0)return console['error'](a40_0xa1ed51['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x3a0a4a['parentName']+'\x27')),0x0;const _0xc891fa=_0x3a0a4a['files'][_0x4bfa46(0x135)](_0x2d096f=>_0x2d096f[_0x4bfa46(0x139)]),_0x2be762=_0x3a0a4a[_0x4bfa46(0x12f)][_0x4bfa46(0x135)](_0x454542=>!_0x454542[_0x4bfa46(0x139)]&&_0x454542[_0x4bfa46(0x157)]),_0x8c3d70=_0x3a0a4a[_0x4bfa46(0x12f)]['filter'](_0x4bfc60=>!_0x4bfc60[_0x4bfa46(0x139)]&&!_0x4bfc60[_0x4bfa46(0x157)]);console[_0x4bfa46(0x127)](_0x4bfa46(0x12d)+_0x3a0a4a[_0x4bfa46(0x150)]+'\x27:'),console[_0x4bfa46(0x127)](_0x4bfa46(0x143)+a40_0xa1ed51['cyan'](_0x3a0a4a['counts'][_0x4bfa46(0x14a)]+_0x4bfa46(0x118))+_0x4bfa46(0x11e)+a40_0xa1ed51[_0x4bfa46(0x154)](_0x3a0a4a[_0x4bfa46(0x13f)][_0x4bfa46(0x141)]+_0x4bfa46(0x158)));if(_0x3a0a4a['counts']['journeys']>0x0){const _0x1d2864=_0x3a0a4a[_0x4bfa46(0x13f)][_0x4bfa46(0x132)]>_0x3a0a4a[_0x4bfa46(0x13f)][_0x4bfa46(0x116)]?'\x20('+_0x3a0a4a['counts'][_0x4bfa46(0x132)]+'\x20versions)':'';console[_0x4bfa46(0x127)]('\x20\x20🗺️\x20\x20'+a40_0xa1ed51[_0x4bfa46(0x154)](_0x3a0a4a[_0x4bfa46(0x13f)]['journeys']+_0x4bfa46(0x142))+a40_0xa1ed51['dim'](_0x1d2864));}console[_0x4bfa46(0x127)]('\x20\x20'+a40_0xa1ed51[_0x4bfa46(0x14d)]('+\x20'+_0xc891fa['length']+_0x4bfa46(0x136))),console[_0x4bfa46(0x127)]('\x20\x20'+a40_0xa1ed51[_0x4bfa46(0x115)]('~\x20'+_0x2be762[_0x4bfa46(0x148)]+_0x4bfa46(0x12c))),console[_0x4bfa46(0x127)]('\x20\x20'+a40_0xa1ed51[_0x4bfa46(0x15a)]('=\x20'+_0x8c3d70[_0x4bfa46(0x148)]+_0x4bfa46(0x11f))),console[_0x4bfa46(0x127)](_0x4bfa46(0x11c)+a40_0xa1ed51['cyan'](_0x3a0a4a[_0x4bfa46(0x15e)])+'\x0a');if(_0x2be762[_0x4bfa46(0x148)]>0x0)for(const _0x72d2a7 of _0x2be762){console['error']('\x0aChanges\x20to\x20\x27'+_0x72d2a7[_0x4bfa46(0x11d)]+'\x27:'),console['error']('─'[_0x4bfa46(0x11a)](0x3c)),console[_0x4bfa46(0x127)](_0x72d2a7[_0x4bfa46(0x120)]),console['error']('─'[_0x4bfa46(0x11a)](0x3c));}if(_0x1f1d0d[_0x4bfa46(0x14c)])return console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x115)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xc891fa['length']===0x0&&_0x2be762[_0x4bfa46(0x148)]===0x0)return console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x14d)](_0x4bfa46(0x138))),saveSessionContext({'parent_segment':_0x3a0a4a[_0x4bfa46(0x150)]},_0x1f1d0d[_0x4bfa46(0x15f)]),console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x14d)](_0x4bfa46(0x117)+a40_0xa1ed51[_0x4bfa46(0x15a)]('parent_segment')+_0x4bfa46(0x152)+a40_0xa1ed51[_0x4bfa46(0x154)](_0x3a0a4a[_0x4bfa46(0x150)]))),0x0;if(!_0x1f1d0d[_0x4bfa46(0x156)]){if(!isInteractive())return console['error'](a40_0xa1ed51[_0x4bfa46(0x144)](_0x4bfa46(0x123)),_0x4bfa46(0x128)),console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x15a)](_0x4bfa46(0x149))),0x1;const _0x453424=await confirmKey('Write\x20'+(_0xc891fa['length']+_0x2be762[_0x4bfa46(0x148)])+'\x20files?');if(!_0x453424)return console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x115)](_0x4bfa46(0x13c)),_0x4bfa46(0x134)),0x1;}for(const _0xde5d1b of _0x3a0a4a[_0x4bfa46(0x12f)]){if(_0xde5d1b['isNew']||_0xde5d1b[_0x4bfa46(0x157)]){const _0x4b11c0=a40_0x228cba[_0x4bfa46(0x13d)](_0xde5d1b[_0x4bfa46(0x163)]);!existsSync(_0x4b11c0)&&mkdirSync(_0x4b11c0,{'recursive':!![]}),writeFileSync(_0xde5d1b['absolutePath'],_0xde5d1b[_0x4bfa46(0x126)],_0x4bfa46(0x153));}}return console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x14d)](_0x4bfa46(0x15d)+(_0xc891fa[_0x4bfa46(0x148)]+_0x2be762[_0x4bfa46(0x148)])+_0x4bfa46(0x14b)+_0x3a0a4a['targetDir'])),saveSessionContext({'parent_segment':_0x3a0a4a[_0x4bfa46(0x150)]},_0x1f1d0d[_0x4bfa46(0x15f)]),console[_0x4bfa46(0x127)](a40_0xa1ed51[_0x4bfa46(0x14d)](_0x4bfa46(0x117)+a40_0xa1ed51[_0x4bfa46(0x15a)](_0x4bfa46(0x13b))+_0x4bfa46(0x152)+a40_0xa1ed51[_0x4bfa46(0x154)](_0x3a0a4a[_0x4bfa46(0x150)]))),0x0;}}function a40_0x29f9(){const _0x38a3f3=['Aborted.','dirname','Parent\x20segment:\x20','counts','pullSegments','activations','\x20journeys','\x20\x20🎯\x20','red','13058535hfZYiK','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','6dqYkRQ','length','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','segments','\x20files\x20to\x20','dryRun','green','file','segment','parentName','2843812IKDdmx','\x20=\x20','utf-8','cyan','site','yes','hasChanges','\x20activations','2995116JTooHR','dim','helpText','9968630yadFFT','✔\x20Pulled\x20','targetDir','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Pulling\x20segments\x20from\x20\x27','27CkkFkP','absolutePath','parentSegment','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)','yellow','journeys','✔\x20Context\x20set:\x20','\x20segments','segment:pull','repeat','127TsSEzG','\x20\x20Target:\x20','relativePath','\x20with\x20','\x20unchanged\x20files','diff','\x27...','5956192pEcqzZ','\x0aError:','resourceName','8880850xLfXIz','content','error','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','21030dvwusG','type','name','\x20changed\x20files','\x0aPull\x20summary\x20for\x20\x27','setPhase','files','cwd','errorCode','journeyVersions','verbose','-\x20no\x20files\x20written','filter','\x20new\x20files','Target\x20resource:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','isNew','data','parent_segment'];a40_0x29f9=function(){return _0x38a3f3;};return a40_0x29f9();}
@@ -1 +1 @@
1
- const a41_0x53cc46=a41_0x50f7;(function(_0x4d2346,_0x1012c9){const _0x20c176=a41_0x50f7,_0x56c188=_0x4d2346();while(!![]){try{const _0x4c8bfa=-parseInt(_0x20c176(0x1ab))/0x1*(-parseInt(_0x20c176(0x1f7))/0x2)+parseInt(_0x20c176(0x210))/0x3+parseInt(_0x20c176(0x197))/0x4*(-parseInt(_0x20c176(0x1ef))/0x5)+parseInt(_0x20c176(0x204))/0x6*(parseInt(_0x20c176(0x192))/0x7)+parseInt(_0x20c176(0x21c))/0x8*(-parseInt(_0x20c176(0x20c))/0x9)+-parseInt(_0x20c176(0x1e0))/0xa+-parseInt(_0x20c176(0x211))/0xb*(-parseInt(_0x20c176(0x1e5))/0xc);if(_0x4c8bfa===_0x1012c9)break;else _0x56c188['push'](_0x56c188['shift']());}catch(_0x4a0c05){_0x56c188['push'](_0x56c188['shift']());}}}(a41_0x28ae,0x570a8));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_0x28ae(){const _0x40d908=['287088tXUqqo','\x20deleted','segmentFolderId','new','connection','yamlConfig','targetDir','Changes\x20to:','\x20\x20🗺️\x20\x20Journeys:','audienceId','journey','get','Fetching\x20connections\x20for\x20name\x20resolution...','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x27...','dim','isNew','delete','dryRun','Scoped\x20to\x20folder:\x20','31KAkysz','changed','updatedAt','Error\x20parsing\x20YAML:\x20','getJourney','\x20\x20Activations:','Parent\x20segment:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','filePath','parentName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','join','Resolving\x20parent\x20segment\x20\x27','\x20\x20Segments:\x20','\x20\x20Source:\x20','nameToType','listActivations','No\x20','list','journeyId','cyan','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','attributes','type','red','description','unchanged','errorCode','\x0aError:','verbose','user','then','message','results','journeysOnly','Site:\x20','length','\x20changed','\x20to\x20create','updated','\x20new','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20changes?','\x20created','Push\x20','getOutputSchemaWithCache','endsWith','Fetching\x20existing\x20activations...','Fetching\x20existing\x20data...','\x20\x20📊\x20Segments:','segment\x20or\x20journey','name','3534300GkbGjy','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','site','journeys','push','2264724OYOaDw','paused','Delete\x20segment:','.yml','/app/ps/','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','created','idToName','Delete\x20journey:','segment','20KllqgY','📁\x20','filter','Error:\x20','createdSegmentIds','Changes\x20to\x20journey:','segment:push','nameToId','3346povMSq','journeyBundleName','buildUserMaps','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','versionNumber','blue','add','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Aborted.','\x0a✔\x20Push\x20complete','\x20\x20\x20\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','30qnbPNI','isScoped','segments','diff','repeat','\x0aPush\x20summary\x20for\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20activations]','36117oHkTVB','map','folderPath','\x20\x20Journeys:\x20','1260081IQAXAJ','33qnacSM','helpText','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','/e/','toDelete','folders','\x20to\x20update','no_parent','parentSegment','file','relationships','208UAfAgP','Preparing\x20journeys...','error','Source\x20directory:\x20','green','yellow','listSegments','createdAt','/sb/da/esr','New\x20journey:','\x20to\x20delete','data','existingJourney','\x20updated','activations','\x20unchanged','folderId','Error:\x20Directory\x20not\x20found:\x20','parent_name','setPhase','Folders\x20to\x20create:','88627KGqaiq','existingSegment','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','/j/da/je','toCreate'];a41_0x28ae=function(){return _0x40d908;};return a41_0x28ae();}import a41_0x3995d9 from'chalk';function a41_0x50f7(_0x9c714c,_0x567b86){_0x9c714c=_0x9c714c-0x186;const _0x28ae3b=a41_0x28ae();let _0x50f7b9=_0x28ae3b[_0x9c714c];return _0x50f7b9;}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_0x53cc46(0x1df)]=a41_0x53cc46(0x1f5);[a41_0x53cc46(0x1c5)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x117ca7){const _0x55d8f8=a41_0x53cc46,{options:_0x29bc49,args:_0x47a581,tdx:_0x1f1e50}=_0x117ca7,_0x52386b=_0x29bc49,_0x266825=await resolveTarget({'arg':_0x47a581[0x0],'contextParent':_0x29bc49[_0x55d8f8(0x219)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x266825))return _0x266825[_0x55d8f8(0x1c7)]===_0x55d8f8(0x218)?(console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x221)](_0x55d8f8(0x1c0))),console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b2)),console[_0x55d8f8(0x21e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x55d8f8(0x21e)](_0x55d8f8(0x1ff))):(console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x1f2)+_0x266825['message']+'\x0a')),_0x266825[_0x55d8f8(0x212)]&&console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1bf)](_0x266825[_0x55d8f8(0x212)]))),0x1;if(_0x266825[_0x55d8f8(0x1c3)]===_0x55d8f8(0x18f))return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x18e)+_0x266825[_0x55d8f8(0x19d)]+'\x0a')),console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1bf)](_0x55d8f8(0x1e1))),0x1;const _0x4ae897=_0x266825[_0x55d8f8(0x1b4)],_0x195c24=_0x266825[_0x55d8f8(0x19d)],_0x302d82=_0x266825[_0x55d8f8(0x1c3)]===_0x55d8f8(0x21a)?_0x266825[_0x55d8f8(0x1b3)]:undefined,_0x392d54=getScopedDetails(_0x266825),_0x1cb9fe=_0x392d54?.[_0x55d8f8(0x205)]??![],_0x31c68c=_0x392d54?.['scopedFolderPath']??'';if(!existsSync(_0x195c24))return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x18e)+_0x195c24+'\x0a')),console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1bf)](_0x55d8f8(0x1e1))),0x1;_0x52386b[_0x55d8f8(0x1c9)]&&(console['error'](_0x55d8f8(0x1cf)+_0x52386b[_0x55d8f8(0x1e2)]),console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b1)+_0x4ae897),console['error'](_0x55d8f8(0x21f)+_0x195c24),_0x1cb9fe&&console['error'](_0x55d8f8(0x1aa)+_0x31c68c));const _0x4efe94=await withSpinner(_0x55d8f8(0x1b7)+_0x4ae897+_0x55d8f8(0x1a5),()=>_0x1f1e50['segment']['resolveParentId'](_0x4ae897),{'verbose':_0x52386b[_0x55d8f8(0x1c9)]}),_0x5cf378=_0x4efe94[_0x55d8f8(0x188)],{parentSegmentResult:_0x91dc16,segmentsResult:_0x4160f8,foldersResult:_0x33baeb,journeysWithDetailsResult:_0x1b6f12,userMaps:_0x3fbf46}=await withSpinner(_0x55d8f8(0x1dc),async()=>{const _0x3415a7=_0x55d8f8,[_0x52c367,_0x760281,_0x44abd2,_0x3f9990,_0x18f1f2]=await Promise['all']([_0x1f1e50[_0x3415a7(0x1ee)]['getParent'](_0x5cf378),_0x1f1e50[_0x3415a7(0x1ee)][_0x3415a7(0x222)](_0x5cf378),_0x1f1e50[_0x3415a7(0x1ee)]['listFolders'](_0x5cf378),_0x1f1e50['journey']['listJourneysWithDetailsFromParentSegment'](_0x5cf378,{'includeAllVersions':!![]}),_0x1f1e50['user'][_0x3415a7(0x1f9)]()]);return{'parentSegmentResult':_0x52c367,'segmentsResult':_0x760281,'foldersResult':_0x44abd2,'journeysWithDetailsResult':_0x3f9990,'userMaps':_0x18f1f2};},{'verbose':_0x52386b[_0x55d8f8(0x1c9)]})[_0x55d8f8(0x1cb)](_0x24e8c6=>_0x24e8c6[_0x55d8f8(0x188)]),_0x3e35ef=_0x91dc16,_0x74ef83=extractRootFolderId(_0x3e35ef),_0x6e3a3a=_0x4160f8,_0x240895=_0x33baeb,{journeys:_0x3cf232,activationStepsById:_0x9689dc}=_0x1b6f12,_0x5d5fc9=new Map(_0x3cf232['map'](_0x42de0c=>[_0x42de0c['id'],_0x42de0c])),_0x5528d5=_0x3cf232[_0x55d8f8(0x20d)](_0x5ee5d3=>({'id':_0x5ee5d3['id'],'name':_0x5ee5d3[_0x55d8f8(0x1c2)]['name'],'journeyBundleName':_0x5ee5d3['attributes'][_0x55d8f8(0x1f8)]||'','journeyBundleId':_0x5ee5d3[_0x55d8f8(0x1c2)]['journeyBundleId']||'','versionNumber':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1fc)],'description':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1c5)],'state':_0x5ee5d3[_0x55d8f8(0x1c2)]['state'],'paused':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1e6)],'audienceId':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1a0)],'folderId':_0x5ee5d3[_0x55d8f8(0x21b)]?.['parentFolder']?.[_0x55d8f8(0x188)]?.['id'],'createdAt':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x223)],'updatedAt':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1ad)]})),{emailToId:_0x62f96b,idToEmail:_0x4b87d9}=_0x3fbf46,_0x1f4009=await withSpinner(_0x55d8f8(0x1a3),async()=>{const _0x1b9545=_0x55d8f8,_0x14a945=await _0x1f1e50['connection'][_0x1b9545(0x1bd)]();return buildConnectionMaps(_0x14a945);},{'verbose':_0x52386b[_0x55d8f8(0x1c9)]})['then'](_0x45820c=>_0x45820c[_0x55d8f8(0x188)]),_0x42ccda=_0x1f4009[_0x55d8f8(0x1f6)],_0x539866=_0x1f4009[_0x55d8f8(0x1ec)],_0x36b7f1=_0x1f4009[_0x55d8f8(0x1ba)],_0x1f2e28={'emailToIdMap':_0x62f96b,'connectionNameToIdMap':_0x42ccda,'connectionNameToTypeMap':_0x36b7f1,'getSchema':_0x385257=>_0x1f1e50[_0x55d8f8(0x19b)][_0x55d8f8(0x1d9)](_0x385257)};let {pathToId:_0xb31353,idToPath:_0x39ef94}=buildFolderMaps(_0x240895);const _0x2411b2=buildSegmentLookupMap(_0x6e3a3a,_0x39ef94),_0x59df3e=buildSegmentNameToIdMap(_0x6e3a3a),_0x1e62a3=buildJourneyBundleLookupMap(_0x5528d5,_0x39ef94);let _0x5bed44;if(_0x302d82){if(!_0x302d82[_0x55d8f8(0x1da)](_0x55d8f8(0x1e8))&&!_0x302d82['endsWith']('.yaml'))return console['error'](a41_0x3995d9['red'](_0x55d8f8(0x20a)+_0x302d82+'\x0a')),0x1;_0x5bed44=[_0x302d82];}else _0x5bed44=findYamlFiles(_0x195c24);if(_0x5bed44['length']===0x0)return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x213)+_0x195c24+'\x0a')),console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1bf)](_0x55d8f8(0x1c1))),0x1;let _0x3945d6,_0x16e2b5;try{const _0x42a076=parseAndClassifyYamlFiles(_0x5bed44,_0x195c24,{'skipSegments':_0x52386b[_0x55d8f8(0x1ce)]});_0x3945d6=_0x42a076[_0x55d8f8(0x206)],_0x16e2b5=_0x42a076[_0x55d8f8(0x1e3)];const _0x334ece=validateParsedFiles(_0x42a076,_0x195c24);if(_0x334ece[_0x55d8f8(0x1d0)]>0x0)return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)]('\x0aValidation\x20failed:')),console[_0x55d8f8(0x21e)](formatValidationErrors(_0x334ece)),console['error'](a41_0x3995d9[_0x55d8f8(0x221)](_0x55d8f8(0x1d5))),0x1;}catch(_0x222c55){return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x1ae)+(_0x222c55 instanceof Error?_0x222c55[_0x55d8f8(0x1cc)]:_0x222c55))),0x1;}if(_0x3945d6[_0x55d8f8(0x1d0)]===0x0&&_0x16e2b5[_0x55d8f8(0x1d0)]===0x0){const _0x148e42=_0x52386b[_0x55d8f8(0x1ce)]?'journey':_0x55d8f8(0x1de);return console[_0x55d8f8(0x21e)](a41_0x3995d9['yellow'](_0x55d8f8(0x1bc)+_0x148e42+'\x20YAML\x20files\x20found')),0x0;}const _0x21271e=new Map();_0x6e3a3a[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1ce)]&&await withSpinner(_0x55d8f8(0x1db),async()=>{await batchAsync(_0x6e3a3a,async _0x5c1108=>{const _0xf96cb0=a41_0x50f7,_0x5c1e9f=await _0x1f1e50[_0xf96cb0(0x1ee)][_0xf96cb0(0x1bb)](_0x5cf378,_0x5c1108['id']);_0x21271e['set'](_0x5c1108['id'],_0x5c1e9f);});},{'verbose':_0x52386b['verbose']});const {segmentFiles:_0x375edf,foldersToCreate:_0x56ca53}=await prepareSegmentFiles(_0x3945d6,{'segmentByFolderAndName':_0x2411b2,'activationsBySegmentId':_0x21271e,'folderPathToId':_0xb31353,'idToEmailMap':_0x4b87d9,'connectionIdToNameMap':_0x539866},_0x1f2e28,_0x1cb9fe,_0x31c68c),_0x26ee29=_0x302d82?[]:findSegmentsToDelete(_0x6e3a3a,_0x3945d6[_0x55d8f8(0x20d)](({yamlConfig:_0xeda895,folderPath:_0x2451a6})=>({'yamlConfig':_0xeda895,'folderPath':resolveTDFolderPath(_0x2451a6,_0x1cb9fe,_0x31c68c)})),_0x39ef94,_0x31c68c,_0x1cb9fe),{journeyFiles:_0x3b1235,foldersToCreate:_0x2e1e16}=await withProgressSpinner(_0x55d8f8(0x21d),async _0x197354=>prepareJourneyFiles(_0x16e2b5,{'fetchJourney':async _0x10074d=>_0x1f1e50[_0x55d8f8(0x1a1)][_0x55d8f8(0x1af)](_0x10074d['journeyId']),'journeyBundlesByFolderAndName':_0x1e62a3,'folderPathToId':_0xb31353,'idToEmailMap':_0x4b87d9,'connectionIdToNameMap':_0x539866,'existingSegments':_0x6e3a3a,'parentId':_0x5cf378,'deps':_0x1f1e50,'progress':{'update':_0x69e672=>{const _0xca1b33=_0x55d8f8;_0x197354[_0xca1b33(0x190)](_0x69e672),_0x52386b[_0xca1b33(0x1c9)]&&console['error']('\x20\x20'+_0x69e672);}},'journeyById':_0x5d5fc9,'activationStepsById':_0x9689dc},_0x1cb9fe,_0x31c68c),{'verbose':_0x52386b[_0x55d8f8(0x1c9)]})[_0x55d8f8(0x1cb)](_0x4a92c0=>_0x4a92c0[_0x55d8f8(0x188)]);for(const _0x199a53 of _0x2e1e16){_0x56ca53[_0x55d8f8(0x1fe)](_0x199a53);}const _0x1b21e6=_0x302d82?[]:findJourneysToDelete(_0x5528d5,_0x16e2b5['map'](({yamlConfig:_0x4ec3be,folderPath:_0xffc60b})=>({'yamlConfig':_0x4ec3be,'folderPath':resolveTDFolderPath(_0xffc60b,_0x1cb9fe,_0x31c68c)})),_0x39ef94,_0x31c68c,_0x1cb9fe),_0x56371a=calculatePushStats(_0x375edf,_0x3b1235,_0x56ca53,_0x26ee29,_0x1b21e6,!!_0x52386b[_0x55d8f8(0x1a8)],!!_0x52386b[_0x55d8f8(0x1ce)]),_0x19ca6e=_0x56371a['segments'][_0x55d8f8(0x19a)],_0x444a69=_0x56371a[_0x55d8f8(0x206)][_0x55d8f8(0x1ac)],_0x2511a5=_0x56371a[_0x55d8f8(0x206)][_0x55d8f8(0x1c6)],_0x35c966=_0x56371a[_0x55d8f8(0x206)][_0x55d8f8(0x215)],_0x21aed2=_0x56371a[_0x55d8f8(0x216)][_0x55d8f8(0x196)],_0x344ed8=_0x56371a['journeys'][_0x55d8f8(0x19a)],_0xe7ce5e=_0x56371a['journeys'][_0x55d8f8(0x1ac)],_0x51a373=_0x56371a[_0x55d8f8(0x1e3)]['unchanged'],_0x4c273b=_0x56371a[_0x55d8f8(0x1e3)][_0x55d8f8(0x215)],_0x27472a=_0x56371a['activations']['all'],_0x48a8f8=_0x56371a[_0x55d8f8(0x18b)]['toCreate'],_0x23c2f3=_0x56371a[_0x55d8f8(0x18b)]['toUpdate'],_0xe83a33=_0x56371a[_0x55d8f8(0x18b)][_0x55d8f8(0x215)];console[_0x55d8f8(0x21e)](_0x55d8f8(0x209)+_0x4ae897+'\x27:');_0x21aed2[_0x55d8f8(0x1d0)]>0x0&&console[_0x55d8f8(0x21e)]('\x20\x20'+a41_0x3995d9[_0x55d8f8(0x1fd)](_0x55d8f8(0x1f0)+_0x21aed2[_0x55d8f8(0x1d0)]+'\x20folders\x20to\x20create'));if(!_0x52386b['journeysOnly']){console[_0x55d8f8(0x21e)](_0x55d8f8(0x1dd)),console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x220)]('+\x20'+_0x19ca6e['length']+_0x55d8f8(0x1d4))),console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x221)]('~\x20'+_0x444a69[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1d1)));if(_0x35c966['length']>0x0)console['error'](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1c4)]('-\x20'+_0x35c966['length']+_0x55d8f8(0x187)));else _0x26ee29[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1a8)]&&console['error'](_0x55d8f8(0x202)+a41_0x3995d9['dim'](_0x26ee29[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1a4)));console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1a6)]('=\x20'+_0x2511a5[_0x55d8f8(0x1d0)]+_0x55d8f8(0x18c)));}if(_0x3b1235[_0x55d8f8(0x1d0)]>0x0||_0x1b21e6[_0x55d8f8(0x1d0)]>0x0){console[_0x55d8f8(0x21e)](_0x55d8f8(0x19f)),console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x220)]('+\x20'+_0x344ed8[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1d4))),console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x221)]('~\x20'+_0xe7ce5e[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1d1)));if(_0x4c273b[_0x55d8f8(0x1d0)]>0x0)console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1c4)]('-\x20'+_0x4c273b['length']+_0x55d8f8(0x187)));else _0x1b21e6[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b['delete']&&console[_0x55d8f8(0x21e)]('\x20\x20\x20\x20'+a41_0x3995d9['dim'](_0x1b21e6['length']+_0x55d8f8(0x1a4)));console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1a6)]('=\x20'+_0x51a373[_0x55d8f8(0x1d0)]+_0x55d8f8(0x18c)));}_0x27472a[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1ce)]&&(console[_0x55d8f8(0x21e)](''),console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b0)),_0x48a8f8['length']>0x0&&console[_0x55d8f8(0x21e)]('\x20\x20\x20\x20'+a41_0x3995d9[_0x55d8f8(0x220)]('+\x20'+_0x48a8f8[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1d2))),_0x23c2f3[_0x55d8f8(0x1d0)]>0x0&&console['error'](_0x55d8f8(0x202)+a41_0x3995d9['yellow']('~\x20'+_0x23c2f3['length']+_0x55d8f8(0x217))),_0xe83a33['length']>0x0&&console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1c4)]('-\x20'+_0xe83a33[_0x55d8f8(0x1d0)]+_0x55d8f8(0x187))));console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b9)+a41_0x3995d9[_0x55d8f8(0x1bf)](_0x195c24)+'\x0a');if(_0x21aed2['length']>0x0){console[_0x55d8f8(0x21e)](_0x55d8f8(0x191));for(const _0x110c77 of _0x21aed2){console[_0x55d8f8(0x21e)]('\x20\x20'+a41_0x3995d9[_0x55d8f8(0x1fd)]('+')+'\x20'+_0x110c77);}console[_0x55d8f8(0x21e)]('');}if(_0x19ca6e[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b['journeysOnly'])for(const _0x5f4bd3 of _0x19ca6e){const _0x61d813=_0x5f4bd3[_0x55d8f8(0x20e)]?_0x5f4bd3[_0x55d8f8(0x20e)]+'/'+_0x5f4bd3['yamlConfig'][_0x55d8f8(0x1df)]:_0x5f4bd3[_0x55d8f8(0x19c)][_0x55d8f8(0x1df)],_0x2316a3=_0x5f4bd3[_0x55d8f8(0x19c)][_0x55d8f8(0x18b)]?.[_0x55d8f8(0x1d0)]||0x0,_0x435f3=_0x2316a3>0x0?a41_0x3995d9[_0x55d8f8(0x1a6)]('\x20['+_0x2316a3+_0x55d8f8(0x20b)):'';console[_0x55d8f8(0x21e)]('\x0a'+a41_0x3995d9[_0x55d8f8(0x220)]('New\x20segment:')+'\x20'+_0x61d813+_0x435f3),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c)),_0x5f4bd3[_0x55d8f8(0x207)]&&console[_0x55d8f8(0x21e)](_0x5f4bd3['diff']),console[_0x55d8f8(0x21e)]('─'['repeat'](0x3c));}if(_0x35c966['length']>0x0&&!_0x52386b[_0x55d8f8(0x1ce)])for(const _0x3c5be6 of _0x35c966){const _0x1c1af0=_0x3c5be6[_0x55d8f8(0x199)]?_0x39ef94[_0x55d8f8(0x1a2)](_0x3c5be6[_0x55d8f8(0x199)]['toString']())||'':'',_0x497f95=_0x1c1af0?_0x1c1af0+'/'+_0x3c5be6[_0x55d8f8(0x1df)]:_0x3c5be6['name'],_0x50f3b1=_0x21271e[_0x55d8f8(0x1a2)](_0x3c5be6['id'])||[],_0x4d4414=_0x50f3b1[_0x55d8f8(0x1d0)]>0x0?a41_0x3995d9['dim']('\x20['+_0x50f3b1[_0x55d8f8(0x1d0)]+_0x55d8f8(0x20b)):'';console[_0x55d8f8(0x21e)]('\x0a'+a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x1e7))+'\x20'+_0x497f95+_0x4d4414),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c));const _0x319bbb=segmentWithActivationsToYaml(_0x3c5be6,_0x50f3b1,undefined,_0x4b87d9,_0x539866),_0x5421ae=segmentToYamlString(_0x319bbb),_0x22d532=generateDiff(_0x5421ae,'');console[_0x55d8f8(0x21e)](formatDiffWithColors(_0x22d532)),console[_0x55d8f8(0x21e)]('─'['repeat'](0x3c));}const _0x2514f4=_0x375edf[_0x55d8f8(0x1f1)](_0xd5dddd=>!_0xd5dddd[_0x55d8f8(0x1a7)]&&_0xd5dddd[_0x55d8f8(0x207)]);if(_0x2514f4[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1ce)])for(const _0x2858f9 of _0x2514f4){const _0x3f8cbe=_0x2858f9[_0x55d8f8(0x20e)]?_0x2858f9[_0x55d8f8(0x20e)]+'/'+_0x2858f9[_0x55d8f8(0x19c)][_0x55d8f8(0x1df)]:_0x2858f9[_0x55d8f8(0x19c)]['name'];console['error']('\x0a'+a41_0x3995d9['yellow'](_0x55d8f8(0x19e))+'\x20'+_0x3f8cbe),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c)),console['error'](_0x2858f9[_0x55d8f8(0x207)]),console[_0x55d8f8(0x21e)]('─'['repeat'](0x3c));}if(_0x344ed8[_0x55d8f8(0x1d0)]>0x0)for(const _0x2383fd of _0x344ed8){const _0x5a44c2=_0x2383fd['folderPath']?_0x2383fd[_0x55d8f8(0x20e)]+'/'+_0x2383fd[_0x55d8f8(0x19c)][_0x55d8f8(0x1df)]:_0x2383fd[_0x55d8f8(0x19c)]['name'];console[_0x55d8f8(0x21e)]('\x0a'+a41_0x3995d9[_0x55d8f8(0x220)](_0x55d8f8(0x186))+'\x20'+_0x5a44c2),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c)),_0x2383fd[_0x55d8f8(0x207)]&&console['error'](_0x2383fd[_0x55d8f8(0x207)]),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c));}const _0x2600dc=_0x3b1235[_0x55d8f8(0x1f1)](_0x32f52a=>!_0x32f52a[_0x55d8f8(0x1a7)]&&_0x32f52a[_0x55d8f8(0x207)]);if(_0x2600dc[_0x55d8f8(0x1d0)]>0x0)for(const _0x368c1e of _0x2600dc){const _0x8df2db=_0x368c1e[_0x55d8f8(0x20e)]?_0x368c1e[_0x55d8f8(0x20e)]+'/'+_0x368c1e['yamlConfig']['name']:_0x368c1e[_0x55d8f8(0x19c)][_0x55d8f8(0x1df)];console['error']('\x0a'+a41_0x3995d9[_0x55d8f8(0x221)](_0x55d8f8(0x1f4))+'\x20'+_0x8df2db),console[_0x55d8f8(0x21e)]('─'['repeat'](0x3c)),console[_0x55d8f8(0x21e)](_0x368c1e[_0x55d8f8(0x207)]),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c));}if(_0x4c273b[_0x55d8f8(0x1d0)]>0x0)for(const _0x5f4c2d of _0x4c273b){const _0x1d6197=_0x5f4c2d[_0x55d8f8(0x18d)]?_0x39ef94[_0x55d8f8(0x1a2)](_0x5f4c2d[_0x55d8f8(0x18d)])||'':'',_0xe31ed6=_0x1d6197?_0x1d6197+'/'+_0x5f4c2d['journeyBundleName']:_0x5f4c2d['journeyBundleName'];console[_0x55d8f8(0x21e)]('\x0a'+a41_0x3995d9['red'](_0x55d8f8(0x1ed))+'\x20'+_0xe31ed6),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c)),console[_0x55d8f8(0x21e)](a41_0x3995d9['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c));}if(_0x52386b[_0x55d8f8(0x1a9)])return console[_0x55d8f8(0x21e)](a41_0x3995d9['yellow'](_0x55d8f8(0x1ea))),0x0;const _0x4de4d6=_0x52386b[_0x55d8f8(0x1ce)]?![]:_0x19ca6e[_0x55d8f8(0x1d0)]>0x0||_0x444a69[_0x55d8f8(0x1d0)]>0x0||_0x35c966[_0x55d8f8(0x1d0)]>0x0,_0x20e73a=_0x344ed8['length']>0x0||_0xe7ce5e[_0x55d8f8(0x1d0)]>0x0||_0x4c273b[_0x55d8f8(0x1d0)]>0x0,_0x576e3b=_0x52386b[_0x55d8f8(0x1ce)]?![]:_0x27472a[_0x55d8f8(0x1d0)]>0x0,_0x3542b8=_0x21aed2[_0x55d8f8(0x1d0)]>0x0;if(!_0x4de4d6&&!_0x20e73a&&!_0x576e3b&&!_0x3542b8){const _0x37c8cb=_0x52386b['journeysOnly']?_0x55d8f8(0x1b5):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x220)](_0x37c8cb));if(_0x302d82&&_0x2511a5[_0x55d8f8(0x1d0)]===0x1){const _0x3f4259=_0x2511a5[0x0];if(_0x3f4259['existingSegment']?.['id']){const _0x293090=getConsoleNextUrl(_0x52386b['site'],'/app/ps/'+_0x5cf378+_0x55d8f8(0x214)+_0x3f4259[_0x55d8f8(0x193)]['id']+_0x55d8f8(0x224));console[_0x55d8f8(0x21e)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x3995d9[_0x55d8f8(0x1bf)](_0x293090));}}if(_0x302d82&&_0x51a373[_0x55d8f8(0x1d0)]===0x1){const _0x41408b=_0x51a373[0x0];if(_0x41408b[_0x55d8f8(0x189)]?.['id']){const _0x423fee=getConsoleNextUrl(_0x52386b[_0x55d8f8(0x1e2)],_0x55d8f8(0x1e9)+_0x5cf378+_0x55d8f8(0x214)+_0x41408b[_0x55d8f8(0x189)]['id']+_0x55d8f8(0x195));console[_0x55d8f8(0x21e)]('\x20\x20'+a41_0x3995d9['cyan'](_0x423fee));}}return 0x0;}const _0x104c40=_0x52386b[_0x55d8f8(0x1ce)]?_0x344ed8[_0x55d8f8(0x1d0)]+_0xe7ce5e[_0x55d8f8(0x1d0)]+_0x4c273b['length']+_0x21aed2['length']:_0x19ca6e[_0x55d8f8(0x1d0)]+_0x444a69[_0x55d8f8(0x1d0)]+_0x35c966[_0x55d8f8(0x1d0)]+_0x344ed8['length']+_0xe7ce5e['length']+_0x4c273b['length']+_0x21aed2[_0x55d8f8(0x1d0)]+_0x27472a[_0x55d8f8(0x1d0)];if(!_0x52386b[_0x55d8f8(0x1fa)]&&_0x104c40>0x0){if(!isInteractive())return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x1c8)),_0x55d8f8(0x1fb)),console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1a6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xb1f349=await confirmKey(_0x55d8f8(0x1d8)+_0x104c40+_0x55d8f8(0x1d6));if(!_0xb1f349)return console[_0x55d8f8(0x21e)](a41_0x3995d9['yellow'](_0x55d8f8(0x200))),0x1;}const _0x1d72e9={'withProgress':async(_0x52bdc8,_0x456d51)=>{const _0xc3c366=_0x55d8f8,_0x5493f1=await withSpinner(_0x52bdc8,_0x456d51,{'verbose':_0x52386b[_0xc3c366(0x1c9)]});return{'data':_0x5493f1['data']};},'logInfo':_0x3b25ff=>console[_0x55d8f8(0x21e)](a41_0x3995d9['blue']('✔\x20'+_0x3b25ff)),'logSuccess':_0x1267fd=>console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x220)]('✔\x20'+_0x1267fd)),'logWarning':_0x5ab237=>console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x221)]('⚠\x20'+_0x5ab237)),'logDeleted':_0x2448b0=>console['error'](a41_0x3995d9['red']('✔\x20'+_0x2448b0))},_0x127581={'segment':_0x1f1e50[_0x55d8f8(0x1ee)],'journey':_0x1f1e50['journey'],'user':_0x1f1e50[_0x55d8f8(0x1ca)],'connection':_0x1f1e50['connection']};_0x21aed2[_0x55d8f8(0x1d0)]>0x0&&(_0xb31353=await executePushFolders(_0x127581,_0x21aed2,_0xb31353,{'parentId':_0x5cf378},_0x1d72e9));const _0x174e3d={'rootFolderId':_0x74ef83,'folderPathToId':_0xb31353,'folderIdToPath':_0x39ef94,'segmentNameToId':_0x59df3e,'activationsBySegmentId':_0x21271e,'emailToIdMap':_0x62f96b,'idToEmailMap':_0x4b87d9,'connectionNameToIdMap':_0x1f4009['nameToId'],'connectionIdToNameMap':_0x1f4009[_0x55d8f8(0x1ec)],'connectionNameToTypeMap':_0x36b7f1},_0x3b9d61=await executePushSegments(_0x127581,_0x52386b[_0x55d8f8(0x1ce)]?[]:_0x375edf,_0x174e3d,{'parentId':_0x5cf378},_0x1d72e9),_0x2affda=_0x3b9d61['created'],_0x96894a=_0x3b9d61[_0x55d8f8(0x1d3)],_0x29d306=_0x3b9d61[_0x55d8f8(0x18b)]['created'],_0x30e7d8=_0x3b9d61[_0x55d8f8(0x18b)][_0x55d8f8(0x1d3)],_0x53c018=_0x3b9d61['activations']['deleted'];let _0x2531cd;if(_0x302d82&&_0x375edf[_0x55d8f8(0x1d0)]===0x1){const _0x4d9ab0=_0x375edf[0x0];_0x2531cd=_0x4d9ab0[_0x55d8f8(0x193)]?.['id']??_0x3b9d61[_0x55d8f8(0x1f3)][_0x55d8f8(0x1a2)](_0x4d9ab0[_0x55d8f8(0x19c)]['name']);}const _0x24c4d6=await executePushSegmentDeletions(_0x127581,_0x52386b['journeysOnly']?[]:_0x35c966,_0x1d72e9);let _0x87e8b1=0x0,_0x36c33e=0x0,_0x208129=0x0;const _0x5908c4=new Map(_0x59df3e);for(const [_0x1a23ec,_0x812c5a]of _0x3b9d61[_0x55d8f8(0x1f3)]){_0x5908c4['set'](_0x1a23ec,_0x812c5a);}if(_0x3b1235[_0x55d8f8(0x1d0)]>0x0){const _0x12377b={..._0x174e3d,'segmentNameToId':_0x5908c4,'existingSegments':_0x6e3a3a,'activationContext':_0x1f2e28},_0x36d7a6=await executePushJourneys(_0x127581,_0x3b1235,_0x12377b,{'parentId':_0x5cf378,'rootFolderId':_0x74ef83,'verbose':_0x52386b[_0x55d8f8(0x1c9)]},_0x1d72e9);_0x87e8b1=_0x36d7a6[_0x55d8f8(0x1eb)],_0x36c33e=_0x36d7a6[_0x55d8f8(0x1d3)];if(_0x302d82&&_0x36d7a6[_0x55d8f8(0x1cd)][_0x55d8f8(0x1d0)]===0x1){const _0x35b6f2=_0x36d7a6['results'][0x0];if(_0x35b6f2[_0x55d8f8(0x1be)]){const _0x5a2a53=getConsoleNextUrl(_0x52386b[_0x55d8f8(0x1e2)],'/app/ps/'+_0x5cf378+_0x55d8f8(0x214)+_0x35b6f2[_0x55d8f8(0x1be)]+_0x55d8f8(0x195));console['error']('\x20\x20'+a41_0x3995d9['cyan'](_0x5a2a53));}}}for(const _0xaf5279 of _0x4c273b){console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x221)](_0x55d8f8(0x194)+_0xaf5279[_0x55d8f8(0x1f8)])),_0x208129++;}const _0x494ae2=[];if(_0x2affda>0x0)_0x494ae2[_0x55d8f8(0x1e4)](_0x2affda+_0x55d8f8(0x1d7));if(_0x96894a>0x0)_0x494ae2[_0x55d8f8(0x1e4)](_0x96894a+_0x55d8f8(0x18a));if(_0x24c4d6>0x0)_0x494ae2[_0x55d8f8(0x1e4)](_0x24c4d6+_0x55d8f8(0x198));const _0x46a494=[];if(_0x87e8b1>0x0)_0x46a494[_0x55d8f8(0x1e4)](_0x87e8b1+'\x20created');if(_0x36c33e>0x0)_0x46a494[_0x55d8f8(0x1e4)](_0x36c33e+_0x55d8f8(0x18a));if(_0x208129>0x0)_0x46a494[_0x55d8f8(0x1e4)](_0x208129+'\x20deleted');const _0x2ce4a8=[];if(_0x29d306>0x0)_0x2ce4a8[_0x55d8f8(0x1e4)](_0x29d306+_0x55d8f8(0x1d7));if(_0x30e7d8>0x0)_0x2ce4a8['push'](_0x30e7d8+_0x55d8f8(0x18a));if(_0x53c018>0x0)_0x2ce4a8[_0x55d8f8(0x1e4)](_0x53c018+_0x55d8f8(0x198));console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x220)](_0x55d8f8(0x201)));_0x494ae2['length']>0x0&&!_0x52386b[_0x55d8f8(0x1ce)]&&console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b8)+_0x494ae2[_0x55d8f8(0x1b6)](',\x20'));_0x46a494['length']>0x0&&console[_0x55d8f8(0x21e)](_0x55d8f8(0x20f)+_0x46a494[_0x55d8f8(0x1b6)](',\x20'));_0x2ce4a8[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1ce)]&&console[_0x55d8f8(0x21e)]('\x20\x20Activations:\x20'+_0x2ce4a8[_0x55d8f8(0x1b6)](',\x20'));if(_0x2531cd){const _0x851fba=getConsoleNextUrl(_0x52386b[_0x55d8f8(0x1e2)],_0x55d8f8(0x1e9)+_0x5cf378+_0x55d8f8(0x214)+_0x2531cd+_0x55d8f8(0x224));console['error'](_0x55d8f8(0x203)+a41_0x3995d9['cyan'](_0x851fba));}return 0x0;}}
1
+ const a41_0x4631f1=a41_0x5e14;(function(_0x516b6c,_0x2cf5fb){const _0x4e6008=a41_0x5e14,_0x13d08d=_0x516b6c();while(!![]){try{const _0x4cf785=parseInt(_0x4e6008(0x108))/0x1*(parseInt(_0x4e6008(0xc3))/0x2)+-parseInt(_0x4e6008(0xc1))/0x3*(parseInt(_0x4e6008(0xc6))/0x4)+parseInt(_0x4e6008(0xa4))/0x5+parseInt(_0x4e6008(0x102))/0x6+-parseInt(_0x4e6008(0xac))/0x7+parseInt(_0x4e6008(0x128))/0x8+-parseInt(_0x4e6008(0x106))/0x9;if(_0x4cf785===_0x2cf5fb)break;else _0x13d08d['push'](_0x13d08d['shift']());}catch(_0x4a6636){_0x13d08d['push'](_0x13d08d['shift']());}}}(a41_0xb66d,0x851c9));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x4b1a1c from'chalk';function a41_0x5e14(_0x52055b,_0x5a3320){_0x52055b=_0x52055b-0xa1;const _0xb66d3d=a41_0xb66d();let _0x5e14ee=_0xb66d3d[_0x52055b];return _0x5e14ee;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a41_0xb66d(){const _0x59d2e7=['Changes\x20to\x20journey:','1997520PcqELK','getJourney','nameToId','toDelete','setPhase','(Journey\x20will\x20be\x20deleted)','data','targetDir','3302271NSqpPe','changed','\x20unchanged','/app/ps/','\x0aValidation\x20failed:','parentSegment','add','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','No\x20','journeysOnly','getParent','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','folders','\x20deleted','set','journey','verbose','then','idToName','activations','Aborted.','542814wbkipU','results','694tRqJJv','New\x20journey:','Resolving\x20parent\x20segment\x20\x27','8nHHCzn','segment','yes','\x20to\x20create','green','buildUserMaps','existingSegment','Folders\x20to\x20create:','errorCode','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Site:\x20','red','repeat','connection','Error:\x20','dim','Preparing\x20journeys...','nameToType','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','updated','parentName','attributes','resolveParentId','file','\x20\x20Activations:\x20','Parent\x20segment:\x20','\x0a✔\x20Push\x20complete','/sb/da/esr','get','list','toString','paused','folderPath','/e/','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20folders\x20to\x20create','segment\x20or\x20journey','createdSegmentIds','push','length','journeyBundleName','map','\x20updated','listSegments','journeyBundleId','diff','\x20to\x20delete','.yaml','parent_name','\x20\x20Segments:\x20','journeys','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','.yml','new','name','description','\x20\x20\x20\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Journeys:\x20','747780YCgXlc','Delete\x20journey:','toCreate','yamlConfig','3793671jTGHvw','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','2521GocbmS','Fetching\x20existing\x20data...','\x20to\x20update','Scoped\x20to\x20folder:\x20','isNew','yellow','\x20created','New\x20segment:','\x20changed','Error\x20parsing\x20YAML:\x20','message','/j/da/je','\x0aError:','versionNumber','listActivations','user','\x20new','toUpdate','createdAt','Delete\x20segment:','relationships','isScoped','\x20activations]','\x20\x20📊\x20Segments:','\x20\x20Source:\x20','Push\x20','site','segmentFolderId','\x27...','all','delete','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','3211616RLykmf','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','join','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','listFolders','audienceId','filePath','cyan','Changes\x20to:','Fetching\x20existing\x20activations...','blue','unchanged','helpText','created','journeyId','segments','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','scopedFolderPath','updatedAt','error','endsWith','\x0aPush\x20summary\x20for\x20\x27','cwd','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'];a41_0xb66d=function(){return _0x59d2e7;};return a41_0xb66d();}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_0x4631f1(0xfc)]='segment:push';[a41_0x4631f1(0xfd)]=a41_0x4631f1(0x127);async['execute'](_0x590b23){const _0x477df6=a41_0x4631f1,{options:_0x1a426b,args:_0x193eab,tdx:_0x31d8fc}=_0x590b23,_0x3f3f5e=_0x1a426b,_0x357b19=await resolveTarget({'arg':_0x193eab[0x0],'contextParent':_0x1a426b[_0x477df6(0xb1)],'cwd':process[_0x477df6(0xa1)]()});if(!isSuccessfulResolution(_0x357b19))return _0x357b19[_0x477df6(0xce)]==='no_parent'?(console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0x10d)](_0x477df6(0xe8))),console['error']('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)'),console[_0x477df6(0x13b)](_0x477df6(0x107)),console[_0x477df6(0x13b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0xd4)+_0x357b19[_0x477df6(0x112)]+'\x0a')),_0x357b19[_0x477df6(0x134)]&&console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0x12f)](_0x357b19['helpText']))),0x1;if(_0x357b19['type']===_0x477df6(0xf6))return console['error'](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0x100)+_0x357b19[_0x477df6(0xab)]+'\x0a')),console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0x12f)](_0x477df6(0xb3))),0x1;const _0x514c92=_0x357b19[_0x477df6(0xda)],_0x4a0cf8=_0x357b19[_0x477df6(0xab)],_0x1a64be=_0x357b19['type']===_0x477df6(0xdd)?_0x357b19[_0x477df6(0x12e)]:undefined,_0x16f44a=getScopedDetails(_0x357b19),_0x2cb06a=_0x16f44a?.[_0x477df6(0x11d)]??![],_0x5ae5c7=_0x16f44a?.[_0x477df6(0x139)]??'';if(!existsSync(_0x4a0cf8))return console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0x100)+_0x4a0cf8+'\x0a')),console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0x12f)](_0x477df6(0xb3))),0x1;_0x3f3f5e['verbose']&&(console[_0x477df6(0x13b)](_0x477df6(0xd0)+_0x3f3f5e['site']),console[_0x477df6(0x13b)](_0x477df6(0xdf)+_0x514c92),console['error']('Source\x20directory:\x20'+_0x4a0cf8),_0x2cb06a&&console[_0x477df6(0x13b)](_0x477df6(0x10b)+_0x5ae5c7));const _0x5bc658=await withSpinner(_0x477df6(0xc5)+_0x514c92+_0x477df6(0x124),()=>_0x31d8fc[_0x477df6(0xc7)][_0x477df6(0xdc)](_0x514c92),{'verbose':_0x3f3f5e[_0x477df6(0xbc)]}),_0x898cd8=_0x5bc658['data'],{parentSegmentResult:_0x543ac8,segmentsResult:_0x10918e,foldersResult:_0x4ae360,journeysWithDetailsResult:_0x231ef6,userMaps:_0x52a9f5}=await withSpinner(_0x477df6(0x109),async()=>{const _0x1a4ceb=_0x477df6,[_0x472d82,_0x12fa38,_0x1db847,_0x44d397,_0xf6dfcc]=await Promise[_0x1a4ceb(0x125)]([_0x31d8fc[_0x1a4ceb(0xc7)][_0x1a4ceb(0xb6)](_0x898cd8),_0x31d8fc[_0x1a4ceb(0xc7)][_0x1a4ceb(0xf1)](_0x898cd8),_0x31d8fc[_0x1a4ceb(0xc7)][_0x1a4ceb(0x12c)](_0x898cd8),_0x31d8fc[_0x1a4ceb(0xbb)]['listJourneysWithDetailsFromParentSegment'](_0x898cd8,{'includeAllVersions':!![]}),_0x31d8fc[_0x1a4ceb(0x117)][_0x1a4ceb(0xcb)]()]);return{'parentSegmentResult':_0x472d82,'segmentsResult':_0x12fa38,'foldersResult':_0x1db847,'journeysWithDetailsResult':_0x44d397,'userMaps':_0xf6dfcc};},{'verbose':_0x3f3f5e[_0x477df6(0xbc)]})[_0x477df6(0xbd)](_0x3bc4f0=>_0x3bc4f0[_0x477df6(0xaa)]),_0x4d9824=_0x543ac8,_0x302df1=extractRootFolderId(_0x4d9824),_0x51a23d=_0x10918e,_0x580608=_0x4ae360,{journeys:_0x8748c3,activationStepsById:_0x34db6b}=_0x231ef6,_0x571ca0=new Map(_0x8748c3[_0x477df6(0xef)](_0x2199bb=>[_0x2199bb['id'],_0x2199bb])),_0x41767e=_0x8748c3[_0x477df6(0xef)](_0x406da9=>({'id':_0x406da9['id'],'name':_0x406da9[_0x477df6(0xdb)][_0x477df6(0xfc)],'journeyBundleName':_0x406da9[_0x477df6(0xdb)]['journeyBundleName']||'','journeyBundleId':_0x406da9[_0x477df6(0xdb)][_0x477df6(0xf2)]||'','versionNumber':_0x406da9[_0x477df6(0xdb)][_0x477df6(0x115)],'description':_0x406da9[_0x477df6(0xdb)][_0x477df6(0xfd)],'state':_0x406da9[_0x477df6(0xdb)]['state'],'paused':_0x406da9[_0x477df6(0xdb)][_0x477df6(0xe5)],'audienceId':_0x406da9[_0x477df6(0xdb)][_0x477df6(0x12d)],'folderId':_0x406da9[_0x477df6(0x11c)]?.['parentFolder']?.['data']?.['id'],'createdAt':_0x406da9['attributes'][_0x477df6(0x11a)],'updatedAt':_0x406da9[_0x477df6(0xdb)][_0x477df6(0x13a)]})),{emailToId:_0x2e9ae5,idToEmail:_0x59db80}=_0x52a9f5,_0x4a5ae0=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x4639f8=_0x477df6,_0x3e525e=await _0x31d8fc[_0x4639f8(0xd3)][_0x4639f8(0xe3)]();return buildConnectionMaps(_0x3e525e);},{'verbose':_0x3f3f5e[_0x477df6(0xbc)]})[_0x477df6(0xbd)](_0x170a45=>_0x170a45['data']),_0xc9adc=_0x4a5ae0[_0x477df6(0xa6)],_0x2aec35=_0x4a5ae0[_0x477df6(0xbe)],_0x34512a=_0x4a5ae0[_0x477df6(0xd7)],_0x4ddc4e={'emailToIdMap':_0x2e9ae5,'connectionNameToIdMap':_0xc9adc,'connectionNameToTypeMap':_0x34512a,'getSchema':_0x42462c=>_0x31d8fc[_0x477df6(0xd3)]['getOutputSchemaWithCache'](_0x42462c)};let {pathToId:_0x48c81e,idToPath:_0x4f787d}=buildFolderMaps(_0x580608);const _0x281c7d=buildSegmentLookupMap(_0x51a23d,_0x4f787d),_0x128aa6=buildSegmentNameToIdMap(_0x51a23d),_0x4cc4eb=buildJourneyBundleLookupMap(_0x41767e,_0x4f787d);let _0x40bef6;if(_0x1a64be){if(!_0x1a64be[_0x477df6(0x13c)](_0x477df6(0xfa))&&!_0x1a64be['endsWith'](_0x477df6(0xf5)))return console['error'](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0xd8)+_0x1a64be+'\x0a')),0x1;_0x40bef6=[_0x1a64be];}else _0x40bef6=findYamlFiles(_0x4a0cf8);if(_0x40bef6[_0x477df6(0xed)]===0x0)return console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0xb7)+_0x4a0cf8+'\x0a')),console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0x12f)](_0x477df6(0x12b))),0x1;let _0xa535ac,_0x346ea1;try{const _0x21deda=parseAndClassifyYamlFiles(_0x40bef6,_0x4a0cf8,{'skipSegments':_0x3f3f5e[_0x477df6(0xb5)]});_0xa535ac=_0x21deda[_0x477df6(0x137)],_0x346ea1=_0x21deda[_0x477df6(0xf8)];const _0x4a78b2=validateParsedFiles(_0x21deda,_0x4a0cf8);if(_0x4a78b2[_0x477df6(0xed)]>0x0)return console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0xb0))),console[_0x477df6(0x13b)](formatValidationErrors(_0x4a78b2)),console['error'](a41_0x4b1a1c['yellow'](_0x477df6(0x138))),0x1;}catch(_0x50eae4){return console['error'](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0x111)+(_0x50eae4 instanceof Error?_0x50eae4['message']:_0x50eae4))),0x1;}if(_0xa535ac[_0x477df6(0xed)]===0x0&&_0x346ea1[_0x477df6(0xed)]===0x0){const _0x15cccf=_0x3f3f5e['journeysOnly']?_0x477df6(0xbb):_0x477df6(0xea);return console[_0x477df6(0x13b)](a41_0x4b1a1c['yellow'](_0x477df6(0xb4)+_0x15cccf+'\x20YAML\x20files\x20found')),0x0;}const _0x69b19b=new Map();_0x51a23d['length']>0x0&&!_0x3f3f5e[_0x477df6(0xb5)]&&await withSpinner(_0x477df6(0x131),async()=>{await batchAsync(_0x51a23d,async _0x580b7c=>{const _0x131e77=a41_0x5e14,_0x564d0d=await _0x31d8fc['segment'][_0x131e77(0x116)](_0x898cd8,_0x580b7c['id']);_0x69b19b[_0x131e77(0xba)](_0x580b7c['id'],_0x564d0d);});},{'verbose':_0x3f3f5e[_0x477df6(0xbc)]});const {segmentFiles:_0x5d174d,foldersToCreate:_0x4ac5fd}=await prepareSegmentFiles(_0xa535ac,{'segmentByFolderAndName':_0x281c7d,'activationsBySegmentId':_0x69b19b,'folderPathToId':_0x48c81e,'idToEmailMap':_0x59db80,'connectionIdToNameMap':_0x2aec35},_0x4ddc4e,_0x2cb06a,_0x5ae5c7),_0x47bee5=_0x1a64be?[]:findSegmentsToDelete(_0x51a23d,_0xa535ac[_0x477df6(0xef)](({yamlConfig:_0x248339,folderPath:_0x4494b4})=>({'yamlConfig':_0x248339,'folderPath':resolveTDFolderPath(_0x4494b4,_0x2cb06a,_0x5ae5c7)})),_0x4f787d,_0x5ae5c7,_0x2cb06a),{journeyFiles:_0x45d8ca,foldersToCreate:_0x577e18}=await withProgressSpinner(_0x477df6(0xd6),async _0x233e30=>prepareJourneyFiles(_0x346ea1,{'fetchJourney':async _0x19f45d=>_0x31d8fc[_0x477df6(0xbb)][_0x477df6(0xa5)](_0x19f45d[_0x477df6(0x136)]),'journeyBundlesByFolderAndName':_0x4cc4eb,'folderPathToId':_0x48c81e,'idToEmailMap':_0x59db80,'connectionIdToNameMap':_0x2aec35,'existingSegments':_0x51a23d,'parentId':_0x898cd8,'deps':_0x31d8fc,'progress':{'update':_0xd8d8e0=>{const _0xdafcef=_0x477df6;_0x233e30[_0xdafcef(0xa8)](_0xd8d8e0),_0x3f3f5e[_0xdafcef(0xbc)]&&console[_0xdafcef(0x13b)]('\x20\x20'+_0xd8d8e0);}},'journeyById':_0x571ca0,'activationStepsById':_0x34db6b},_0x2cb06a,_0x5ae5c7),{'verbose':_0x3f3f5e[_0x477df6(0xbc)]})[_0x477df6(0xbd)](_0x3be769=>_0x3be769[_0x477df6(0xaa)]);for(const _0x92d5bc of _0x577e18){_0x4ac5fd[_0x477df6(0xb2)](_0x92d5bc);}const _0x470e62=_0x1a64be?[]:findJourneysToDelete(_0x41767e,_0x346ea1[_0x477df6(0xef)](({yamlConfig:_0x591a15,folderPath:_0x3026c5})=>({'yamlConfig':_0x591a15,'folderPath':resolveTDFolderPath(_0x3026c5,_0x2cb06a,_0x5ae5c7)})),_0x4f787d,_0x5ae5c7,_0x2cb06a),_0x599e39=calculatePushStats(_0x5d174d,_0x45d8ca,_0x4ac5fd,_0x47bee5,_0x470e62,!!_0x3f3f5e[_0x477df6(0x126)],!!_0x3f3f5e[_0x477df6(0xb5)]),_0x6ce210=_0x599e39[_0x477df6(0x137)][_0x477df6(0xfb)],_0x27f67c=_0x599e39[_0x477df6(0x137)][_0x477df6(0xad)],_0x52fcd9=_0x599e39['segments'][_0x477df6(0x133)],_0x288d54=_0x599e39[_0x477df6(0x137)][_0x477df6(0xa7)],_0xf56549=_0x599e39[_0x477df6(0xb8)][_0x477df6(0x104)],_0x56e970=_0x599e39[_0x477df6(0xf8)][_0x477df6(0xfb)],_0x588e4b=_0x599e39[_0x477df6(0xf8)][_0x477df6(0xad)],_0x516586=_0x599e39[_0x477df6(0xf8)][_0x477df6(0x133)],_0x556b62=_0x599e39[_0x477df6(0xf8)][_0x477df6(0xa7)],_0x14c35e=_0x599e39[_0x477df6(0xbf)][_0x477df6(0x125)],_0x403c51=_0x599e39[_0x477df6(0xbf)][_0x477df6(0x104)],_0x555a9c=_0x599e39[_0x477df6(0xbf)][_0x477df6(0x119)],_0x3f13f0=_0x599e39['activations']['toDelete'];console['error'](_0x477df6(0x13d)+_0x514c92+'\x27:');_0xf56549['length']>0x0&&console[_0x477df6(0x13b)]('\x20\x20'+a41_0x4b1a1c['blue']('📁\x20'+_0xf56549[_0x477df6(0xed)]+_0x477df6(0xe9)));if(!_0x3f3f5e[_0x477df6(0xb5)]){console[_0x477df6(0x13b)](_0x477df6(0x11f)),console['error']('\x20\x20\x20\x20'+a41_0x4b1a1c[_0x477df6(0xca)]('+\x20'+_0x6ce210[_0x477df6(0xed)]+_0x477df6(0x118))),console[_0x477df6(0x13b)](_0x477df6(0xfe)+a41_0x4b1a1c['yellow']('~\x20'+_0x27f67c[_0x477df6(0xed)]+_0x477df6(0x110)));if(_0x288d54[_0x477df6(0xed)]>0x0)console[_0x477df6(0x13b)](_0x477df6(0xfe)+a41_0x4b1a1c['red']('-\x20'+_0x288d54['length']+_0x477df6(0xf4)));else _0x47bee5['length']>0x0&&!_0x3f3f5e[_0x477df6(0x126)]&&console[_0x477df6(0x13b)](_0x477df6(0xfe)+a41_0x4b1a1c[_0x477df6(0xd5)](_0x47bee5[_0x477df6(0xed)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x477df6(0x13b)](_0x477df6(0xfe)+a41_0x4b1a1c[_0x477df6(0xd5)]('=\x20'+_0x52fcd9[_0x477df6(0xed)]+_0x477df6(0xae)));}if(_0x45d8ca[_0x477df6(0xed)]>0x0||_0x470e62[_0x477df6(0xed)]>0x0){console[_0x477df6(0x13b)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x477df6(0x13b)](_0x477df6(0xfe)+a41_0x4b1a1c[_0x477df6(0xca)]('+\x20'+_0x56e970['length']+_0x477df6(0x118))),console['error'](_0x477df6(0xfe)+a41_0x4b1a1c[_0x477df6(0x10d)]('~\x20'+_0x588e4b[_0x477df6(0xed)]+_0x477df6(0x110)));if(_0x556b62[_0x477df6(0xed)]>0x0)console['error'](_0x477df6(0xfe)+a41_0x4b1a1c['red']('-\x20'+_0x556b62[_0x477df6(0xed)]+_0x477df6(0xf4)));else _0x470e62[_0x477df6(0xed)]>0x0&&!_0x3f3f5e['delete']&&console[_0x477df6(0x13b)](_0x477df6(0xfe)+a41_0x4b1a1c[_0x477df6(0xd5)](_0x470e62[_0x477df6(0xed)]+_0x477df6(0xf9)));console['error'](_0x477df6(0xfe)+a41_0x4b1a1c['dim']('=\x20'+_0x516586[_0x477df6(0xed)]+_0x477df6(0xae)));}_0x14c35e[_0x477df6(0xed)]>0x0&&!_0x3f3f5e['journeysOnly']&&(console[_0x477df6(0x13b)](''),console['error']('\x20\x20Activations:'),_0x403c51[_0x477df6(0xed)]>0x0&&console[_0x477df6(0x13b)](_0x477df6(0xfe)+a41_0x4b1a1c[_0x477df6(0xca)]('+\x20'+_0x403c51[_0x477df6(0xed)]+_0x477df6(0xc9))),_0x555a9c[_0x477df6(0xed)]>0x0&&console[_0x477df6(0x13b)](_0x477df6(0xfe)+a41_0x4b1a1c[_0x477df6(0x10d)]('~\x20'+_0x555a9c['length']+_0x477df6(0x10a))),_0x3f13f0[_0x477df6(0xed)]>0x0&&console[_0x477df6(0x13b)]('\x20\x20\x20\x20'+a41_0x4b1a1c[_0x477df6(0xd1)]('-\x20'+_0x3f13f0['length']+'\x20to\x20delete')));console[_0x477df6(0x13b)](_0x477df6(0x120)+a41_0x4b1a1c[_0x477df6(0x12f)](_0x4a0cf8)+'\x0a');if(_0xf56549['length']>0x0){console[_0x477df6(0x13b)](_0x477df6(0xcd));for(const _0xe3a80b of _0xf56549){console['error']('\x20\x20'+a41_0x4b1a1c[_0x477df6(0x132)]('+')+'\x20'+_0xe3a80b);}console[_0x477df6(0x13b)]('');}if(_0x6ce210['length']>0x0&&!_0x3f3f5e[_0x477df6(0xb5)])for(const _0x560313 of _0x6ce210){const _0xbd156a=_0x560313[_0x477df6(0xe6)]?_0x560313['folderPath']+'/'+_0x560313[_0x477df6(0x105)][_0x477df6(0xfc)]:_0x560313[_0x477df6(0x105)][_0x477df6(0xfc)],_0x4b9017=_0x560313['yamlConfig'][_0x477df6(0xbf)]?.['length']||0x0,_0x34d0dc=_0x4b9017>0x0?a41_0x4b1a1c[_0x477df6(0xd5)]('\x20['+_0x4b9017+_0x477df6(0x11e)):'';console[_0x477df6(0x13b)]('\x0a'+a41_0x4b1a1c['green'](_0x477df6(0x10f))+'\x20'+_0xbd156a+_0x34d0dc),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c)),_0x560313[_0x477df6(0xf3)]&&console[_0x477df6(0x13b)](_0x560313[_0x477df6(0xf3)]),console[_0x477df6(0x13b)]('─'['repeat'](0x3c));}if(_0x288d54['length']>0x0&&!_0x3f3f5e[_0x477df6(0xb5)])for(const _0x245d7b of _0x288d54){const _0x4276a7=_0x245d7b[_0x477df6(0x123)]?_0x4f787d[_0x477df6(0xe2)](_0x245d7b['segmentFolderId'][_0x477df6(0xe4)]())||'':'',_0x2f5c79=_0x4276a7?_0x4276a7+'/'+_0x245d7b[_0x477df6(0xfc)]:_0x245d7b['name'],_0x45ce06=_0x69b19b['get'](_0x245d7b['id'])||[],_0x30f639=_0x45ce06[_0x477df6(0xed)]>0x0?a41_0x4b1a1c[_0x477df6(0xd5)]('\x20['+_0x45ce06[_0x477df6(0xed)]+'\x20activations]'):'';console[_0x477df6(0x13b)]('\x0a'+a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0x11b))+'\x20'+_0x2f5c79+_0x30f639),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c));const _0x314adf=segmentWithActivationsToYaml(_0x245d7b,_0x45ce06,undefined,_0x59db80,_0x2aec35),_0x20d4d8=segmentToYamlString(_0x314adf),_0x51aa42=generateDiff(_0x20d4d8,'');console[_0x477df6(0x13b)](formatDiffWithColors(_0x51aa42)),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c));}const _0x3280ea=_0x5d174d['filter'](_0x3ae1cb=>!_0x3ae1cb[_0x477df6(0x10c)]&&_0x3ae1cb['diff']);if(_0x3280ea[_0x477df6(0xed)]>0x0&&!_0x3f3f5e[_0x477df6(0xb5)])for(const _0xbf288c of _0x3280ea){const _0x5e0d27=_0xbf288c[_0x477df6(0xe6)]?_0xbf288c['folderPath']+'/'+_0xbf288c['yamlConfig']['name']:_0xbf288c[_0x477df6(0x105)][_0x477df6(0xfc)];console[_0x477df6(0x13b)]('\x0a'+a41_0x4b1a1c['yellow'](_0x477df6(0x130))+'\x20'+_0x5e0d27),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c)),console[_0x477df6(0x13b)](_0xbf288c[_0x477df6(0xf3)]),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c));}if(_0x56e970['length']>0x0)for(const _0x1fdfcb of _0x56e970){const _0x1f0222=_0x1fdfcb[_0x477df6(0xe6)]?_0x1fdfcb[_0x477df6(0xe6)]+'/'+_0x1fdfcb[_0x477df6(0x105)][_0x477df6(0xfc)]:_0x1fdfcb[_0x477df6(0x105)][_0x477df6(0xfc)];console[_0x477df6(0x13b)]('\x0a'+a41_0x4b1a1c['green'](_0x477df6(0xc4))+'\x20'+_0x1f0222),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c)),_0x1fdfcb[_0x477df6(0xf3)]&&console[_0x477df6(0x13b)](_0x1fdfcb[_0x477df6(0xf3)]),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c));}const _0x1a92be=_0x45d8ca['filter'](_0x4c720a=>!_0x4c720a[_0x477df6(0x10c)]&&_0x4c720a[_0x477df6(0xf3)]);if(_0x1a92be['length']>0x0)for(const _0x293b84 of _0x1a92be){const _0x2f5c83=_0x293b84[_0x477df6(0xe6)]?_0x293b84[_0x477df6(0xe6)]+'/'+_0x293b84['yamlConfig'][_0x477df6(0xfc)]:_0x293b84[_0x477df6(0x105)]['name'];console['error']('\x0a'+a41_0x4b1a1c['yellow'](_0x477df6(0xa3))+'\x20'+_0x2f5c83),console['error']('─'[_0x477df6(0xd2)](0x3c)),console[_0x477df6(0x13b)](_0x293b84[_0x477df6(0xf3)]),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c));}if(_0x556b62[_0x477df6(0xed)]>0x0)for(const _0x4bfd3b of _0x556b62){const _0x1ccf38=_0x4bfd3b['folderId']?_0x4f787d[_0x477df6(0xe2)](_0x4bfd3b['folderId'])||'':'',_0x58d725=_0x1ccf38?_0x1ccf38+'/'+_0x4bfd3b[_0x477df6(0xee)]:_0x4bfd3b[_0x477df6(0xee)];console[_0x477df6(0x13b)]('\x0a'+a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0x103))+'\x20'+_0x58d725),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c)),console['error'](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0xa9))),console[_0x477df6(0x13b)]('─'[_0x477df6(0xd2)](0x3c));}if(_0x3f3f5e['dryRun'])return console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0x10d)](_0x477df6(0x129))),0x0;const _0x2ce2bf=_0x3f3f5e[_0x477df6(0xb5)]?![]:_0x6ce210[_0x477df6(0xed)]>0x0||_0x27f67c[_0x477df6(0xed)]>0x0||_0x288d54[_0x477df6(0xed)]>0x0,_0x3727c2=_0x56e970[_0x477df6(0xed)]>0x0||_0x588e4b['length']>0x0||_0x556b62['length']>0x0,_0x4676dc=_0x3f3f5e[_0x477df6(0xb5)]?![]:_0x14c35e[_0x477df6(0xed)]>0x0,_0x15da03=_0xf56549[_0x477df6(0xed)]>0x0;if(!_0x2ce2bf&&!_0x3727c2&&!_0x4676dc&&!_0x15da03){const _0x32c68a=_0x3f3f5e[_0x477df6(0xb5)]?_0x477df6(0xcf):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0xca)](_0x32c68a));if(_0x1a64be&&_0x52fcd9[_0x477df6(0xed)]===0x1){const _0x377ef7=_0x52fcd9[0x0];if(_0x377ef7[_0x477df6(0xcc)]?.['id']){const _0x161585=getConsoleNextUrl(_0x3f3f5e['site'],_0x477df6(0xaf)+_0x898cd8+_0x477df6(0xe7)+_0x377ef7[_0x477df6(0xcc)]['id']+_0x477df6(0xe1));console[_0x477df6(0x13b)](_0x477df6(0xff)+a41_0x4b1a1c['cyan'](_0x161585));}}if(_0x1a64be&&_0x516586[_0x477df6(0xed)]===0x1){const _0x1b595c=_0x516586[0x0];if(_0x1b595c['existingJourney']?.['id']){const _0x1b97ca=getConsoleNextUrl(_0x3f3f5e['site'],_0x477df6(0xaf)+_0x898cd8+_0x477df6(0xe7)+_0x1b595c['existingJourney']['id']+_0x477df6(0x113));console[_0x477df6(0x13b)]('\x20\x20'+a41_0x4b1a1c[_0x477df6(0x12f)](_0x1b97ca));}}return 0x0;}const _0x3883dd=_0x3f3f5e[_0x477df6(0xb5)]?_0x56e970['length']+_0x588e4b[_0x477df6(0xed)]+_0x556b62[_0x477df6(0xed)]+_0xf56549['length']:_0x6ce210[_0x477df6(0xed)]+_0x27f67c['length']+_0x288d54[_0x477df6(0xed)]+_0x56e970[_0x477df6(0xed)]+_0x588e4b[_0x477df6(0xed)]+_0x556b62['length']+_0xf56549[_0x477df6(0xed)]+_0x14c35e[_0x477df6(0xed)];if(!_0x3f3f5e[_0x477df6(0xc8)]&&_0x3883dd>0x0){if(!isInteractive())return console['error'](a41_0x4b1a1c[_0x477df6(0xd1)](_0x477df6(0x114)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0xd5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x166e7b=await confirmKey(_0x477df6(0x121)+_0x3883dd+'\x20changes?');if(!_0x166e7b)return console[_0x477df6(0x13b)](a41_0x4b1a1c['yellow'](_0x477df6(0xc0))),0x1;}const _0x2434de={'withProgress':async(_0x1036de,_0x3f2367)=>{const _0x378f55=_0x477df6,_0x3969c3=await withSpinner(_0x1036de,_0x3f2367,{'verbose':_0x3f3f5e[_0x378f55(0xbc)]});return{'data':_0x3969c3[_0x378f55(0xaa)]};},'logInfo':_0x2f3e86=>console[_0x477df6(0x13b)](a41_0x4b1a1c['blue']('✔\x20'+_0x2f3e86)),'logSuccess':_0x42fe1a=>console[_0x477df6(0x13b)](a41_0x4b1a1c['green']('✔\x20'+_0x42fe1a)),'logWarning':_0x366783=>console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0x10d)]('⚠\x20'+_0x366783)),'logDeleted':_0x56dfab=>console['error'](a41_0x4b1a1c['red']('✔\x20'+_0x56dfab))},_0x5aee98={'segment':_0x31d8fc['segment'],'journey':_0x31d8fc[_0x477df6(0xbb)],'user':_0x31d8fc['user'],'connection':_0x31d8fc[_0x477df6(0xd3)]};_0xf56549[_0x477df6(0xed)]>0x0&&(_0x48c81e=await executePushFolders(_0x5aee98,_0xf56549,_0x48c81e,{'parentId':_0x898cd8},_0x2434de));const _0x3237ce={'rootFolderId':_0x302df1,'folderPathToId':_0x48c81e,'folderIdToPath':_0x4f787d,'segmentNameToId':_0x128aa6,'activationsBySegmentId':_0x69b19b,'emailToIdMap':_0x2e9ae5,'idToEmailMap':_0x59db80,'connectionNameToIdMap':_0x4a5ae0['nameToId'],'connectionIdToNameMap':_0x4a5ae0['idToName'],'connectionNameToTypeMap':_0x34512a},_0x4003a6=await executePushSegments(_0x5aee98,_0x3f3f5e['journeysOnly']?[]:_0x5d174d,_0x3237ce,{'parentId':_0x898cd8},_0x2434de),_0x3221ed=_0x4003a6[_0x477df6(0x135)],_0xd31ebe=_0x4003a6[_0x477df6(0xd9)],_0xca45a3=_0x4003a6[_0x477df6(0xbf)]['created'],_0x41721c=_0x4003a6[_0x477df6(0xbf)][_0x477df6(0xd9)],_0xa1d2d1=_0x4003a6[_0x477df6(0xbf)]['deleted'];let _0x1c5540;if(_0x1a64be&&_0x5d174d[_0x477df6(0xed)]===0x1){const _0xa4a51f=_0x5d174d[0x0];_0x1c5540=_0xa4a51f[_0x477df6(0xcc)]?.['id']??_0x4003a6[_0x477df6(0xeb)][_0x477df6(0xe2)](_0xa4a51f[_0x477df6(0x105)][_0x477df6(0xfc)]);}const _0x32d481=await executePushSegmentDeletions(_0x5aee98,_0x3f3f5e[_0x477df6(0xb5)]?[]:_0x288d54,_0x2434de);let _0x222240=0x0,_0x2dbb64=0x0,_0x53a095=0x0;const _0x42444e=new Map(_0x128aa6);for(const [_0x74f63,_0x29fd5c]of _0x4003a6['createdSegmentIds']){_0x42444e[_0x477df6(0xba)](_0x74f63,_0x29fd5c);}if(_0x45d8ca[_0x477df6(0xed)]>0x0){const _0x2b3c33={..._0x3237ce,'segmentNameToId':_0x42444e,'existingSegments':_0x51a23d,'activationContext':_0x4ddc4e},_0x21f123=await executePushJourneys(_0x5aee98,_0x45d8ca,_0x2b3c33,{'parentId':_0x898cd8,'rootFolderId':_0x302df1,'verbose':_0x3f3f5e[_0x477df6(0xbc)]},_0x2434de);_0x222240=_0x21f123['created'],_0x2dbb64=_0x21f123[_0x477df6(0xd9)];if(_0x1a64be&&_0x21f123[_0x477df6(0xc2)][_0x477df6(0xed)]===0x1){const _0x35c152=_0x21f123['results'][0x0];if(_0x35c152[_0x477df6(0x136)]){const _0xbc3ff4=getConsoleNextUrl(_0x3f3f5e[_0x477df6(0x122)],_0x477df6(0xaf)+_0x898cd8+_0x477df6(0xe7)+_0x35c152[_0x477df6(0x136)]+'/j/da/je');console['error']('\x20\x20'+a41_0x4b1a1c[_0x477df6(0x12f)](_0xbc3ff4));}}}for(const _0x14c32c of _0x556b62){console[_0x477df6(0x13b)](a41_0x4b1a1c[_0x477df6(0x10d)](_0x477df6(0xa2)+_0x14c32c[_0x477df6(0xee)])),_0x53a095++;}const _0x480321=[];if(_0x3221ed>0x0)_0x480321[_0x477df6(0xec)](_0x3221ed+_0x477df6(0x10e));if(_0xd31ebe>0x0)_0x480321['push'](_0xd31ebe+_0x477df6(0xf0));if(_0x32d481>0x0)_0x480321['push'](_0x32d481+_0x477df6(0xb9));const _0x5ae3f0=[];if(_0x222240>0x0)_0x5ae3f0[_0x477df6(0xec)](_0x222240+_0x477df6(0x10e));if(_0x2dbb64>0x0)_0x5ae3f0[_0x477df6(0xec)](_0x2dbb64+_0x477df6(0xf0));if(_0x53a095>0x0)_0x5ae3f0['push'](_0x53a095+_0x477df6(0xb9));const _0x3f5dd8=[];if(_0xca45a3>0x0)_0x3f5dd8[_0x477df6(0xec)](_0xca45a3+_0x477df6(0x10e));if(_0x41721c>0x0)_0x3f5dd8[_0x477df6(0xec)](_0x41721c+_0x477df6(0xf0));if(_0xa1d2d1>0x0)_0x3f5dd8[_0x477df6(0xec)](_0xa1d2d1+'\x20deleted');console[_0x477df6(0x13b)](a41_0x4b1a1c['green'](_0x477df6(0xe0)));_0x480321[_0x477df6(0xed)]>0x0&&!_0x3f3f5e[_0x477df6(0xb5)]&&console[_0x477df6(0x13b)](_0x477df6(0xf7)+_0x480321['join'](',\x20'));_0x5ae3f0[_0x477df6(0xed)]>0x0&&console['error'](_0x477df6(0x101)+_0x5ae3f0[_0x477df6(0x12a)](',\x20'));_0x3f5dd8[_0x477df6(0xed)]>0x0&&!_0x3f3f5e[_0x477df6(0xb5)]&&console[_0x477df6(0x13b)](_0x477df6(0xde)+_0x3f5dd8['join'](',\x20'));if(_0x1c5540){const _0x4cfc86=getConsoleNextUrl(_0x3f3f5e[_0x477df6(0x122)],_0x477df6(0xaf)+_0x898cd8+'/e/'+_0x1c5540+_0x477df6(0xe1));console[_0x477df6(0x13b)](_0x477df6(0xff)+a41_0x4b1a1c[_0x477df6(0x12f)](_0x4cfc86));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x7abfbd=a42_0xd831;function a42_0x14ac(){const _0x7c902=['rule','12GFIacG','674359ufuNov','updateSegmentById','length','531SfmTsb','59399SVeuHQ','segmentId','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','verbose','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Segment\x20ID:\x20','parentId','name','error','449232pkucqW','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','includes','10mCIdbK','segment','resolveFolderId','segment:update','\x20\x20\x20Path:\x20','folder','\x27...','690385zEHcZW','data','Resolving\x20folder\x20\x27','4nVMTeE','type','✔\x20Updated\x20segment\x20\x27','118811yXwmjz','INTERNAL','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Updating\x20segment\x20\x27','Update\x20existing\x20child\x20segment','execute','Segment\x20ID\x20missing\x20from\x20resolved\x20path','1984fWgmor','description','154004JwVdWl','Error:\x20Cannot\x20update\x20','yellow','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','ruleFile','Resolved\x20folder\x20ID:\x20'];a42_0x14ac=function(){return _0x7c902;};return a42_0x14ac();}(function(_0x18b560,_0x33828c){const _0x277047=a42_0xd831,_0xfcd896=_0x18b560();while(!![]){try{const _0x6ca63=-parseInt(_0x277047(0x75))/0x1*(parseInt(_0x277047(0x8c))/0x2)+parseInt(_0x277047(0x7f))/0x3+parseInt(_0x277047(0x99))/0x4+-parseInt(_0x277047(0x89))/0x5+parseInt(_0x277047(0xa1))/0x6*(parseInt(_0x277047(0xa2))/0x7)+parseInt(_0x277047(0x97))/0x8*(-parseInt(_0x277047(0x74))/0x9)+-parseInt(_0x277047(0x82))/0xa*(-parseInt(_0x277047(0x8f))/0xb);if(_0x6ca63===_0x33828c)break;else _0xfcd896['push'](_0xfcd896['shift']());}catch(_0x36a7af){_0xfcd896['push'](_0xfcd896['shift']());}}}(a42_0x14ac,0x1d595));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a42_0xd831(_0x38e1e5,_0x2333a6){_0x38e1e5=_0x38e1e5-0x73;const _0x14acfb=a42_0x14ac();let _0xd83138=_0x14acfb[_0x38e1e5];return _0xd83138;}import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x47276b from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x7abfbd(0x7d)]=a42_0x7abfbd(0x85);[a42_0x7abfbd(0x98)]=a42_0x7abfbd(0x94);async[a42_0x7abfbd(0x95)](_0x40f2c3){const _0x3cde38=a42_0x7abfbd;console['error'](a42_0x47276b['yellow'](_0x3cde38(0x78))),console[_0x3cde38(0x7e)](a42_0x47276b[_0x3cde38(0x9b)](_0x3cde38(0x92)));const {options:_0x4218be,args:_0x3f1de7,tdx:_0x1db81d}=_0x40f2c3,_0x547099=_0x4218be;if(_0x3f1de7[_0x3cde38(0x73)]===0x0)return console[_0x3cde38(0x7e)](_0x3cde38(0x80)),console['error']('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x3cde38(0x7e)]('Examples:'),console[_0x3cde38(0x7e)](_0x3cde38(0x7a)),console[_0x3cde38(0x7e)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1f8f41=_0x3f1de7[0x0],_0xe36c60=_0x4218be[_0x3cde38(0x77)];let _0x3a8e1b=_0x1f8f41;_0xe36c60&&!_0x1f8f41[_0x3cde38(0x81)]('/')&&(_0x3a8e1b=_0xe36c60+'/'+_0x1f8f41,_0x547099['verbose']&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x3a8e1b));const _0x4bc500=await withSpinner('Resolving\x20path\x20\x27'+_0x3a8e1b+_0x3cde38(0x88),()=>_0x1db81d['segment']['resolvePathToResource'](_0x3a8e1b),{'verbose':_0x547099[_0x3cde38(0x79)]}),_0x3a714f=_0x4bc500['data'];_0x547099[_0x3cde38(0x79)]&&console[_0x3cde38(0x7e)]('Resolved\x20type:\x20'+_0x3a714f[_0x3cde38(0x8d)]);if(_0x3a714f[_0x3cde38(0x8d)]!==_0x3cde38(0x83))return console[_0x3cde38(0x7e)](_0x3cde38(0x9a)+_0x3a714f[_0x3cde38(0x8d)]+_0x3cde38(0x9d)),console[_0x3cde38(0x7e)](_0x3cde38(0x91)),0x1;if(!_0x3a714f[_0x3cde38(0x76)])throw new SDKError(ErrorCode[_0x3cde38(0x90)],_0x3cde38(0x96));const _0x2af4e7=_0x3a714f[_0x3cde38(0x7c)],_0xeb6a6=_0x3a714f['segmentId'];_0x547099[_0x3cde38(0x79)]&&(console[_0x3cde38(0x7e)]('Parent\x20ID:\x20'+_0x2af4e7),console[_0x3cde38(0x7e)](_0x3cde38(0x7b)+_0xeb6a6));let _0x164550;if(_0x547099[_0x3cde38(0x87)]){const _0xdb6949=_0x547099[_0x3cde38(0x87)],_0x1d7f7c=await withSpinner(_0x3cde38(0x8b)+_0xdb6949+_0x3cde38(0x88),()=>_0x1db81d[_0x3cde38(0x83)][_0x3cde38(0x84)](_0x2af4e7,_0xdb6949),{'verbose':_0x547099[_0x3cde38(0x79)]});_0x164550=parseInt(_0x1d7f7c['data'],0xa),_0x547099[_0x3cde38(0x79)]&&console[_0x3cde38(0x7e)](_0x3cde38(0x9f)+_0x164550);}const _0x26acc5=await loadJSONFromOptions(_0x547099[_0x3cde38(0xa0)],_0x547099[_0x3cde38(0x9e)]),_0x1a10bd={'name':_0x547099[_0x3cde38(0x7d)],'description':_0x547099[_0x3cde38(0x98)],'rule':_0x26acc5,'kind':_0x547099['kind']!==undefined?parseInt(_0x547099[_0x3cde38(0x9c)],0xa):undefined,'segmentFolderId':_0x164550},_0x1a1373=await withSpinner(_0x3cde38(0x93)+_0x3a714f['segmentName']+_0x3cde38(0x88),()=>_0x1db81d['segment'][_0x3cde38(0xa3)](_0x2af4e7,_0xeb6a6,_0x1a10bd),{'verbose':_0x547099['verbose']}),_0x2f4a40=_0x1a1373[_0x3cde38(0x8a)];return console[_0x3cde38(0x7e)](_0x3cde38(0x8e)+_0x2f4a40[_0x3cde38(0x7d)]+'\x27'),_0x3a8e1b!==_0x1f8f41&&console[_0x3cde38(0x7e)](_0x3cde38(0x86)+_0x3a8e1b),await handleSDKOutput([_0x2f4a40],_0x547099),0x0;}}
1
+ const a42_0x365763=a42_0x58a6;function a42_0x58a6(_0x3ad6ab,_0x3fdf9){_0x3ad6ab=_0x3ad6ab-0x8a;const _0x1961db=a42_0x1961();let _0x58a6d5=_0x1961db[_0x3ad6ab];return _0x58a6d5;}(function(_0x2be889,_0x41a49b){const _0x1037cc=a42_0x58a6,_0x3ad7da=_0x2be889();while(!![]){try{const _0x16ce54=parseInt(_0x1037cc(0xa1))/0x1*(-parseInt(_0x1037cc(0xae))/0x2)+parseInt(_0x1037cc(0x97))/0x3+-parseInt(_0x1037cc(0x96))/0x4+-parseInt(_0x1037cc(0xb2))/0x5*(-parseInt(_0x1037cc(0x94))/0x6)+parseInt(_0x1037cc(0xa7))/0x7*(-parseInt(_0x1037cc(0x8b))/0x8)+parseInt(_0x1037cc(0x9b))/0x9*(parseInt(_0x1037cc(0xac))/0xa)+parseInt(_0x1037cc(0x98))/0xb;if(_0x16ce54===_0x41a49b)break;else _0x3ad7da['push'](_0x3ad7da['shift']());}catch(_0x524ca7){_0x3ad7da['push'](_0x3ad7da['shift']());}}}(a42_0x1961,0x81ee8));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_0x157b1e from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x365763(0xa0)]='segment:update';['description']=a42_0x365763(0xa9);async['execute'](_0x2a7f95){const _0x2aafde=a42_0x365763;console['error'](a42_0x157b1e['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x2aafde(0x8e)](a42_0x157b1e[_0x2aafde(0xa5)](_0x2aafde(0xa8)));const {options:_0x586a9b,args:_0x4c0b7b,tdx:_0x1e44e2}=_0x2a7f95,_0x3bed52=_0x586a9b;if(_0x4c0b7b['length']===0x0)return console[_0x2aafde(0x8e)](_0x2aafde(0xa3)),console['error'](_0x2aafde(0x9c)),console[_0x2aafde(0x8e)](_0x2aafde(0xab)),console[_0x2aafde(0x8e)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x32b25e=_0x4c0b7b[0x0],_0x53a95e=_0x586a9b[_0x2aafde(0xb4)];let _0x4d6ae4=_0x32b25e;_0x53a95e&&!_0x32b25e[_0x2aafde(0x8f)]('/')&&(_0x4d6ae4=_0x53a95e+'/'+_0x32b25e,_0x3bed52['verbose']&&console['error'](_0x2aafde(0xaa)+_0x4d6ae4));const _0x3aeebc=await withSpinner(_0x2aafde(0xa4)+_0x4d6ae4+_0x2aafde(0xa6),()=>_0x1e44e2[_0x2aafde(0x8d)][_0x2aafde(0x95)](_0x4d6ae4),{'verbose':_0x3bed52[_0x2aafde(0xa2)]}),_0x1a9830=_0x3aeebc[_0x2aafde(0xb3)];_0x3bed52[_0x2aafde(0xa2)]&&console[_0x2aafde(0x8e)]('Resolved\x20type:\x20'+_0x1a9830['type']);if(_0x1a9830['type']!==_0x2aafde(0x8d))return console[_0x2aafde(0x8e)](_0x2aafde(0x8c)+_0x1a9830['type']+_0x2aafde(0x99)),console[_0x2aafde(0x8e)](_0x2aafde(0xaf)),0x1;if(!_0x1a9830[_0x2aafde(0x93)])throw new SDKError(ErrorCode[_0x2aafde(0x91)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1c39e8=_0x1a9830['parentId'],_0x5466bd=_0x1a9830[_0x2aafde(0x93)];_0x3bed52[_0x2aafde(0xa2)]&&(console['error'](_0x2aafde(0xb5)+_0x1c39e8),console[_0x2aafde(0x8e)](_0x2aafde(0x9f)+_0x5466bd));let _0x4820be;if(_0x3bed52[_0x2aafde(0x8a)]){const _0x10d624=_0x3bed52[_0x2aafde(0x8a)],_0x57f44a=await withSpinner(_0x2aafde(0xb0)+_0x10d624+_0x2aafde(0xa6),()=>_0x1e44e2[_0x2aafde(0x8d)]['resolveFolderId'](_0x1c39e8,_0x10d624),{'verbose':_0x3bed52['verbose']});_0x4820be=parseInt(_0x57f44a['data'],0xa),_0x3bed52[_0x2aafde(0xa2)]&&console[_0x2aafde(0x8e)]('Resolved\x20folder\x20ID:\x20'+_0x4820be);}const _0x2a49ba=await loadJSONFromOptions(_0x3bed52[_0x2aafde(0x9a)],_0x3bed52[_0x2aafde(0xad)]),_0x40b138={'name':_0x3bed52[_0x2aafde(0xa0)],'description':_0x3bed52[_0x2aafde(0x90)],'rule':_0x2a49ba,'kind':_0x3bed52[_0x2aafde(0x9d)]!==undefined?parseInt(_0x3bed52['kind'],0xa):undefined,'segmentFolderId':_0x4820be},_0x5aa5ee=await withSpinner('Updating\x20segment\x20\x27'+_0x1a9830['segmentName']+_0x2aafde(0xa6),()=>_0x1e44e2['segment'][_0x2aafde(0x9e)](_0x1c39e8,_0x5466bd,_0x40b138),{'verbose':_0x3bed52['verbose']}),_0x6237b4=_0x5aa5ee['data'];return console[_0x2aafde(0x8e)](_0x2aafde(0x92)+_0x6237b4[_0x2aafde(0xa0)]+'\x27'),_0x4d6ae4!==_0x32b25e&&console[_0x2aafde(0x8e)](_0x2aafde(0xb1)+_0x4d6ae4),await handleSDKOutput([_0x6237b4],_0x3bed52),0x0;}}function a42_0x1961(){const _0x4f82c0=['Resolving\x20folder\x20\x27','\x20\x20\x20Path:\x20','705ouUPkm','data','segmentPath','Parent\x20ID:\x20','folder','52856KdAGHJ','Error:\x20Cannot\x20update\x20','segment','error','includes','description','INTERNAL','✔\x20Updated\x20segment\x20\x27','segmentId','21234xoICDz','resolvePathToResource','2537292oknwfb','2790414nGcfGC','603581UZwuJg','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','rule','66006cEeVrs','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','kind','updateSegmentById','Segment\x20ID:\x20','name','5KRYVxY','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','yellow','\x27...','133OsvNXu','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Update\x20existing\x20child\x20segment','Resolved\x20relative\x20path\x20to:\x20','Examples:','20tKsejr','ruleFile','82648fuUkaq','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'];a42_0x1961=function(){return _0x4f82c0;};return a42_0x1961();}
@@ -1 +1 @@
1
- const a43_0x3e6c52=a43_0x9bd9;(function(_0x8603e9,_0x58033d){const _0x1a7749=a43_0x9bd9,_0x4528ee=_0x8603e9();while(!![]){try{const _0x548c0d=-parseInt(_0x1a7749(0x165))/0x1+parseInt(_0x1a7749(0x150))/0x2*(-parseInt(_0x1a7749(0x13e))/0x3)+parseInt(_0x1a7749(0x148))/0x4+-parseInt(_0x1a7749(0x157))/0x5+-parseInt(_0x1a7749(0x14a))/0x6*(-parseInt(_0x1a7749(0x141))/0x7)+parseInt(_0x1a7749(0x158))/0x8*(parseInt(_0x1a7749(0x134))/0x9)+parseInt(_0x1a7749(0x13a))/0xa*(parseInt(_0x1a7749(0x153))/0xb);if(_0x548c0d===_0x58033d)break;else _0x4528ee['push'](_0x4528ee['shift']());}catch(_0x1c894a){_0x4528ee['push'](_0x4528ee['shift']());}}}(a43_0x55d0,0x890ee));import{existsSync,statSync}from'fs';import a43_0x5e6920 from'chalk';function a43_0x55d0(){const _0xd336c5=['isDirectory','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','44PpKcrV','✔\x20Context\x20set\x20to:\x20','join','Target\x20path:\x20','2977390wLaVga','1548952dGpYae','type','Site:\x20','verbose','folderPath','Error:\x20Path\x20is\x20required\x0a','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','execute','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','site','Resolved\x20path\x20type:\x20','895532vGwNte','cyan','\x27...','45puJwHg','Usage:\x20tdx\x20segment\x20use\x20<path>','segment:use','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentName','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','871330LQINJZ','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment','name','3345915fsGOnG','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Folder\x20ID:\x20','6944903PVOdOM','session','slice','log','red','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','error','3435796rBaYvr','fullPath','6PXxgut','length','segments','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','split','green','2hIfuhy'];a43_0x55d0=function(){return _0xd336c5;};return a43_0x55d0();}import{BaseCommand}from'./command.js';function a43_0x9bd9(_0x3f4801,_0x2dc634){_0x3f4801=_0x3f4801-0x133;const _0x55d072=a43_0x55d0();let _0x9bd9e3=_0x55d072[_0x3f4801];return _0x9bd9e3;}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_0x3e6c52(0x13d)]=a43_0x3e6c52(0x136);['description']='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x3e6c52(0x15f)](_0x341cd6){const _0x4762a9=a43_0x3e6c52,{options:_0x3e575a,args:_0x4eb0c4,tdx:_0x3debc6}=_0x341cd6;if(_0x4eb0c4[_0x4762a9(0x14b)]===0x0)return console['error'](a43_0x5e6920['red'](_0x4762a9(0x15d))),console[_0x4762a9(0x147)](_0x4762a9(0x135)),console[_0x4762a9(0x147)](_0x4762a9(0x161)),console[_0x4762a9(0x147)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x4762a9(0x147)](_0x4762a9(0x152)),console[_0x4762a9(0x147)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x4762a9(0x160)),0x1;const _0x427aeb=_0x4eb0c4[0x0],_0x15cf73=_0x3e575a[_0x4762a9(0x142)];try{if(_0x427aeb==='/')return saveSessionContext({'segment_path':undefined},_0x15cf73),console['log'](a43_0x5e6920[_0x4762a9(0x14f)](_0x4762a9(0x162))),0x0;if(existsSync(_0x427aeb)&&statSync(_0x427aeb)[_0x4762a9(0x151)]()){let _0x1aff40;try{_0x1aff40=findTdxConfig(_0x427aeb);}catch{return console[_0x4762a9(0x147)](a43_0x5e6920[_0x4762a9(0x145)](_0x4762a9(0x137)+_0x427aeb)),console[_0x4762a9(0x147)](a43_0x5e6920['cyan'](_0x4762a9(0x13b))),0x1;}const _0x124a93=_0x1aff40['config']['parent_segment'];return saveSessionContext({'segment_path':_0x124a93,'parent_segment':_0x124a93},_0x15cf73),console[_0x4762a9(0x144)](a43_0x5e6920[_0x4762a9(0x14f)](_0x4762a9(0x154)+a43_0x5e6920[_0x4762a9(0x166)](_0x124a93))),0x0;}const _0x53b2d9=_0x3e575a['segmentPath'];let _0x45c6f7=_0x427aeb;const _0x46eb3e=parsePath(_0x427aeb);if(!_0x46eb3e['isAbsolute']){if(!_0x53b2d9)return console[_0x4762a9(0x147)](a43_0x5e6920['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x4762a9(0x147)](a43_0x5e6920[_0x4762a9(0x166)](_0x4762a9(0x15e))),0x1;if(_0x427aeb==='..'){const _0x4f21ce=_0x53b2d9[_0x4762a9(0x14e)]('/')[_0x4762a9(0x143)](0x0,-0x1)[_0x4762a9(0x155)]('/');_0x45c6f7=_0x4f21ce||'/';}else _0x427aeb==='.'?_0x45c6f7=_0x53b2d9:_0x45c6f7=_0x53b2d9+'/'+_0x427aeb;_0x3e575a[_0x4762a9(0x15b)]&&console[_0x4762a9(0x147)]('Resolved\x20relative\x20path\x20to:\x20'+_0x45c6f7);}if(_0x45c6f7==='/'||_0x45c6f7==='')return saveSessionContext({'segment_path':undefined},_0x15cf73),console['log'](a43_0x5e6920['green'](_0x4762a9(0x162))),0x0;_0x45c6f7=normalizePath(_0x45c6f7);const _0x1bd250=parsePath(_0x45c6f7)[_0x4762a9(0x14c)];if(_0x1bd250[_0x4762a9(0x14b)]===0x0)return saveSessionContext({'segment_path':undefined},_0x15cf73),console['log'](a43_0x5e6920[_0x4762a9(0x14f)](_0x4762a9(0x162))),0x0;_0x3e575a[_0x4762a9(0x15b)]&&(console[_0x4762a9(0x147)](_0x4762a9(0x15a)+_0x3e575a[_0x4762a9(0x163)]),console['error'](_0x4762a9(0x156)+_0x45c6f7));const _0x517179=await withSpinner('Resolving\x20path\x20\x27'+_0x45c6f7+_0x4762a9(0x133),()=>_0x3debc6[_0x4762a9(0x13c)]['resolvePathToResource'](_0x45c6f7),{'verbose':_0x3e575a[_0x4762a9(0x15b)]}),_0x10d96e=_0x517179['data'];_0x3e575a[_0x4762a9(0x15b)]&&(console[_0x4762a9(0x147)](_0x4762a9(0x164)+_0x10d96e[_0x4762a9(0x159)]),console[_0x4762a9(0x147)]('Parent\x20ID:\x20'+_0x10d96e['parentId']),_0x10d96e['folderId']&&console[_0x4762a9(0x147)](_0x4762a9(0x140)+_0x10d96e['folderId']));if(_0x10d96e[_0x4762a9(0x159)]===_0x4762a9(0x13c))return console['error'](a43_0x5e6920[_0x4762a9(0x145)](_0x4762a9(0x14d))),console[_0x4762a9(0x147)](_0x4762a9(0x13f)),console[_0x4762a9(0x147)](a43_0x5e6920[_0x4762a9(0x166)]('Use:\x20tdx\x20segment\x20use\x20'+_0x10d96e[_0x4762a9(0x138)]+(_0x10d96e[_0x4762a9(0x15c)]?'/'+_0x10d96e['folderPath'][_0x4762a9(0x155)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x10d96e[_0x4762a9(0x149)],'parent_segment':_0x10d96e['parentName']},_0x15cf73),console[_0x4762a9(0x144)](a43_0x5e6920[_0x4762a9(0x14f)](_0x4762a9(0x154)+a43_0x5e6920[_0x4762a9(0x166)](_0x10d96e[_0x4762a9(0x149)]))),_0x3e575a[_0x4762a9(0x15b)]&&(console[_0x4762a9(0x147)](a43_0x5e6920['dim'](_0x4762a9(0x139))),console[_0x4762a9(0x147)](a43_0x5e6920['dim'](_0x4762a9(0x146)))),0x0;}catch(_0x51a401){throw _0x51a401;}}}
1
+ function a43_0x4d2c(){const _0x3165dd=['11031658bqpeEF','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20Path\x20is\x20required\x0a','session','red','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','description','log','Target\x20path:\x20','green','parentName','parent_segment','Use:\x20tdx\x20segment\x20use\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','site','split','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','type','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','name','Resolving\x20path\x20\x27','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','dim','48153ZRVsMY','error','isDirectory','fullPath','Resolved\x20path\x20type:\x20','data','492BUWaKy','segment:use','slice','5260064nyPWYs','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','18cCqkdi','\x27...','7111850StQWdQ','5gOtbTb','config','segmentPath','cyan','length','Examples:','join','verbose','resolvePathToResource','404RIcbpc','Parent\x20ID:\x20','execute','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','✔\x20Context\x20set\x20to:\x20','920852kfGFBh','segment','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segments','6271ZWzuun','1376136ICpiDS','folderPath','folderId'];a43_0x4d2c=function(){return _0x3165dd;};return a43_0x4d2c();}const a43_0x3da0ab=a43_0x3e18;(function(_0x51ec2e,_0x21f993){const _0xc55b54=a43_0x3e18,_0x332511=_0x51ec2e();while(!![]){try{const _0x1b0b92=parseInt(_0xc55b54(0x15a))/0x1*(parseInt(_0xc55b54(0x151))/0x2)+-parseInt(_0xc55b54(0x15b))/0x3+parseInt(_0xc55b54(0x156))/0x4*(-parseInt(_0xc55b54(0x148))/0x5)+-parseInt(_0xc55b54(0x140))/0x6*(-parseInt(_0xc55b54(0x13a))/0x7)+parseInt(_0xc55b54(0x143))/0x8*(parseInt(_0xc55b54(0x145))/0x9)+-parseInt(_0xc55b54(0x147))/0xa+-parseInt(_0xc55b54(0x15e))/0xb;if(_0x1b0b92===_0x21f993)break;else _0x332511['push'](_0x332511['shift']());}catch(_0x5e9fd4){_0x332511['push'](_0x332511['shift']());}}}(a43_0x4d2c,0xb55c0));import{existsSync,statSync}from'fs';import a43_0x5438e7 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x3e18(_0x11cfd1,_0x2004c4){_0x11cfd1=_0x11cfd1-0x137;const _0x4d2c4c=a43_0x4d2c();let _0x3e18f5=_0x4d2c4c[_0x11cfd1];return _0x3e18f5;}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_0x3da0ab(0x174)]=a43_0x3da0ab(0x141);[a43_0x3da0ab(0x164)]=a43_0x3da0ab(0x16b);async[a43_0x3da0ab(0x153)](_0x350d3b){const _0xb30f68=a43_0x3da0ab,{options:_0x162a2e,args:_0x320412,tdx:_0x2c196b}=_0x350d3b;if(_0x320412[_0xb30f68(0x14c)]===0x0)return console[_0xb30f68(0x13b)](a43_0x5438e7[_0xb30f68(0x162)](_0xb30f68(0x160))),console['error'](_0xb30f68(0x170)),console[_0xb30f68(0x13b)](_0xb30f68(0x14d)),console[_0xb30f68(0x13b)](_0xb30f68(0x173)),console[_0xb30f68(0x13b)](_0xb30f68(0x144)),console[_0xb30f68(0x13b)](_0xb30f68(0x15f)),console[_0xb30f68(0x13b)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x3866d0=_0x320412[0x0],_0x2f939a=_0x162a2e[_0xb30f68(0x161)];try{if(_0x3866d0==='/')return saveSessionContext({'segment_path':undefined},_0x2f939a),console[_0xb30f68(0x165)](a43_0x5438e7['green'](_0xb30f68(0x16e))),0x0;if(existsSync(_0x3866d0)&&statSync(_0x3866d0)[_0xb30f68(0x13c)]()){let _0x4f3785;try{_0x4f3785=findTdxConfig(_0x3866d0);}catch{return console[_0xb30f68(0x13b)](a43_0x5438e7['red'](_0xb30f68(0x171)+_0x3866d0)),console[_0xb30f68(0x13b)](a43_0x5438e7['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x175dfd=_0x4f3785[_0xb30f68(0x149)][_0xb30f68(0x169)];return saveSessionContext({'segment_path':_0x175dfd,'parent_segment':_0x175dfd},_0x2f939a),console[_0xb30f68(0x165)](a43_0x5438e7[_0xb30f68(0x167)](_0xb30f68(0x155)+a43_0x5438e7[_0xb30f68(0x14b)](_0x175dfd))),0x0;}const _0x4d4f51=_0x162a2e[_0xb30f68(0x14a)];let _0x5a6618=_0x3866d0;const _0x143a37=parsePath(_0x3866d0);if(!_0x143a37['isAbsolute']){if(!_0x4d4f51)return console[_0xb30f68(0x13b)](a43_0x5438e7[_0xb30f68(0x162)](_0xb30f68(0x137))),console['error'](a43_0x5438e7[_0xb30f68(0x14b)](_0xb30f68(0x154))),0x1;if(_0x3866d0==='..'){const _0xa9adb1=_0x4d4f51[_0xb30f68(0x16d)]('/')[_0xb30f68(0x142)](0x0,-0x1)[_0xb30f68(0x14e)]('/');_0x5a6618=_0xa9adb1||'/';}else _0x3866d0==='.'?_0x5a6618=_0x4d4f51:_0x5a6618=_0x4d4f51+'/'+_0x3866d0;_0x162a2e[_0xb30f68(0x14f)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x5a6618);}if(_0x5a6618==='/'||_0x5a6618==='')return saveSessionContext({'segment_path':undefined},_0x2f939a),console[_0xb30f68(0x165)](a43_0x5438e7['green'](_0xb30f68(0x16e))),0x0;_0x5a6618=normalizePath(_0x5a6618);const _0x2032e6=parsePath(_0x5a6618)[_0xb30f68(0x159)];if(_0x2032e6[_0xb30f68(0x14c)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2f939a),console[_0xb30f68(0x165)](a43_0x5438e7['green'](_0xb30f68(0x16e))),0x0;_0x162a2e[_0xb30f68(0x14f)]&&(console[_0xb30f68(0x13b)]('Site:\x20'+_0x162a2e[_0xb30f68(0x16c)]),console[_0xb30f68(0x13b)](_0xb30f68(0x166)+_0x5a6618));const _0xdebd8f=await withSpinner(_0xb30f68(0x175)+_0x5a6618+_0xb30f68(0x146),()=>_0x2c196b['segment'][_0xb30f68(0x150)](_0x5a6618),{'verbose':_0x162a2e[_0xb30f68(0x14f)]}),_0x1fd235=_0xdebd8f[_0xb30f68(0x13f)];_0x162a2e['verbose']&&(console[_0xb30f68(0x13b)](_0xb30f68(0x13e)+_0x1fd235['type']),console['error'](_0xb30f68(0x152)+_0x1fd235['parentId']),_0x1fd235[_0xb30f68(0x15d)]&&console[_0xb30f68(0x13b)](_0xb30f68(0x16f)+_0x1fd235['folderId']));if(_0x1fd235[_0xb30f68(0x172)]===_0xb30f68(0x157))return console[_0xb30f68(0x13b)](a43_0x5438e7['red'](_0xb30f68(0x138))),console[_0xb30f68(0x13b)](_0xb30f68(0x158)),console[_0xb30f68(0x13b)](a43_0x5438e7[_0xb30f68(0x14b)](_0xb30f68(0x16a)+_0x1fd235[_0xb30f68(0x168)]+(_0x1fd235[_0xb30f68(0x15c)]?'/'+_0x1fd235[_0xb30f68(0x15c)][_0xb30f68(0x14e)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1fd235[_0xb30f68(0x13d)],'parent_segment':_0x1fd235[_0xb30f68(0x168)]},_0x2f939a),console[_0xb30f68(0x165)](a43_0x5438e7[_0xb30f68(0x167)](_0xb30f68(0x155)+a43_0x5438e7[_0xb30f68(0x14b)](_0x1fd235[_0xb30f68(0x13d)]))),_0x162a2e['verbose']&&(console['error'](a43_0x5438e7[_0xb30f68(0x139)](_0xb30f68(0x163))),console[_0xb30f68(0x13b)](a43_0x5438e7[_0xb30f68(0x139)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x47d4b9){throw _0x47d4b9;}}}
@@ -1 +1 @@
1
- const a44_0x572956=a44_0x297d;(function(_0x1c5392,_0x2a1ed3){const _0x4618c4=a44_0x297d,_0x2b053a=_0x1c5392();while(!![]){try{const _0x27e39d=-parseInt(_0x4618c4(0x1a0))/0x1*(-parseInt(_0x4618c4(0x1a3))/0x2)+-parseInt(_0x4618c4(0x1b0))/0x3+parseInt(_0x4618c4(0x1ad))/0x4+parseInt(_0x4618c4(0x196))/0x5*(-parseInt(_0x4618c4(0x197))/0x6)+parseInt(_0x4618c4(0x1b7))/0x7+parseInt(_0x4618c4(0x1c0))/0x8+-parseInt(_0x4618c4(0x1ae))/0x9;if(_0x27e39d===_0x2a1ed3)break;else _0x2b053a['push'](_0x2b053a['shift']());}catch(_0x57c977){_0x2b053a['push'](_0x2b053a['shift']());}}}(a44_0x1799,0x98688));import{BaseCommand}from'./command.js';function a44_0x297d(_0x5c6d0f,_0x569f92){_0x5c6d0f=_0x5c6d0f-0x194;const _0x1799dc=a44_0x1799();let _0x297d45=_0x1799dc[_0x5c6d0f];return _0x297d45;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x7a817f from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x1799(){const _0x5da35a=['438yBLiBl','Error:\x20Directory\x20not\x20found:\x20','errors','endsWith','red','dim','valid','file','\x20warning(s)\x20found','11121cIyUpf','.yaml','yellow','112NVfney','helpText','verbose','filePath','message','invalidCount','):\x20','description','parentSegment','error','3533100cWOGja','7253001nJAoaa','Error:\x20','3558447HwiKvk','warnings','Validation\x20failed:\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','warningCount','\x20error(s)','targetDir','7801052ctslzg','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20file(s)\x20valid','validCount','\x20warning(s)','\x20file(s)\x20with\x20errors,\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','log','no_parent','7066208BXwFAc','errorCode','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','name','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','green','length','cwd','60785qqRfSU'];a44_0x1799=function(){return _0x5da35a;};return a44_0x1799();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x572956(0x1c3)]='segment:validate';[a44_0x572956(0x1aa)]=a44_0x572956(0x1b3);async['execute'](_0x1c8c75){const _0xa8fbda=a44_0x572956,{options:_0x492783,args:_0x25c1e2}=_0x1c8c75,_0x1e3868=_0x492783,_0x4f4101=await resolveTarget({'arg':_0x25c1e2[0x0],'contextParent':_0x492783[_0xa8fbda(0x1ab)],'cwd':process[_0xa8fbda(0x195)]()});if(!isSuccessfulResolution(_0x4f4101))return _0x4f4101[_0xa8fbda(0x1c1)]===_0xa8fbda(0x1bf)?(console[_0xa8fbda(0x1ac)](a44_0x7a817f['yellow'](_0xa8fbda(0x1c2))),console[_0xa8fbda(0x1ac)](_0xa8fbda(0x1c4)),console[_0xa8fbda(0x1ac)]('\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['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0xa8fbda(0x1ac)](a44_0x7a817f[_0xa8fbda(0x19b)](_0xa8fbda(0x1af)+_0x4f4101[_0xa8fbda(0x1a7)]+'\x0a')),_0x4f4101[_0xa8fbda(0x1a4)]&&console['error'](a44_0x7a817f['cyan'](_0x4f4101[_0xa8fbda(0x1a4)]))),0x1;const _0x588aef=_0x4f4101[_0xa8fbda(0x1b6)],_0x30f2e7=_0x4f4101['type']===_0xa8fbda(0x19e)?_0x4f4101[_0xa8fbda(0x1a6)]:undefined;if(!_0x30f2e7&&!existsSync(_0x588aef))return console['error'](a44_0x7a817f[_0xa8fbda(0x19b)](_0xa8fbda(0x198)+_0x588aef+'\x0a')),0x1;let _0x2767e3;if(_0x30f2e7){if(!_0x30f2e7[_0xa8fbda(0x19a)]('.yml')&&!_0x30f2e7['endsWith'](_0xa8fbda(0x1a1)))return console[_0xa8fbda(0x1ac)](a44_0x7a817f[_0xa8fbda(0x19b)](_0xa8fbda(0x1bd)+_0x30f2e7+'\x0a')),0x1;_0x2767e3=[_0x30f2e7];}else _0x2767e3=findYamlFiles(_0x588aef);if(_0x2767e3[_0xa8fbda(0x194)]===0x0)return console[_0xa8fbda(0x1ac)](a44_0x7a817f[_0xa8fbda(0x19b)](_0xa8fbda(0x1b8)+_0x588aef+'\x0a')),0x1;const _0x5e0d2b=validateYamlFiles(_0x2767e3,_0x588aef),_0x2cb2c5=calculateSummary(_0x5e0d2b);for(const _0x3d00ac of _0x5e0d2b){if(!isValidationResult(_0x3d00ac))continue;const {relativePath:_0x42d05a,source:_0x3720bf,result:_0xf6d2c3,fileType:_0x33a8aa}=_0x3d00ac,_0x1c5e6e=_0x33a8aa;if(_0xf6d2c3[_0xa8fbda(0x19d)]&&_0xf6d2c3[_0xa8fbda(0x1b1)][_0xa8fbda(0x194)]===0x0)_0x1e3868[_0xa8fbda(0x1a5)]&&console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x1c5)]('✔\x20'+_0x42d05a)+a44_0x7a817f[_0xa8fbda(0x19c)]('\x20('+_0x1c5e6e+')'));else _0xf6d2c3[_0xa8fbda(0x19d)]?(console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x1a2)]('⚠\x20'+_0x42d05a)+a44_0x7a817f[_0xa8fbda(0x19c)]('\x20('+_0x1c5e6e+_0xa8fbda(0x1a9)+_0xf6d2c3[_0xa8fbda(0x1b1)][_0xa8fbda(0x194)]+_0xa8fbda(0x1bb))),console['log'](formatValidationResult(_0xf6d2c3,_0x3720bf,_0x42d05a))):(console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x19b)]('✖\x20'+_0x42d05a)+a44_0x7a817f['dim']('\x20('+_0x1c5e6e+_0xa8fbda(0x1a9)+_0xf6d2c3[_0xa8fbda(0x199)][_0xa8fbda(0x194)]+_0xa8fbda(0x1b5))),console[_0xa8fbda(0x1be)](formatValidationResult(_0xf6d2c3,_0x3720bf,_0x42d05a)));}return console['log'](''),_0x2cb2c5['hasErrors']?(console[_0xa8fbda(0x1be)](a44_0x7a817f['red'](_0xa8fbda(0x1b2)+_0x2cb2c5[_0xa8fbda(0x1a8)]+_0xa8fbda(0x1bc)+_0x2cb2c5[_0xa8fbda(0x1ba)]+'\x20valid')),_0x2cb2c5[_0xa8fbda(0x1b4)]>0x0&&console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x1a2)](_0x2cb2c5['warningCount']+_0xa8fbda(0x19f))),0x1):(console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x1c5)]('✔\x20All\x20'+_0x2cb2c5['validCount']+_0xa8fbda(0x1b9))),_0x2cb2c5[_0xa8fbda(0x1b4)]>0x0&&console['log'](a44_0x7a817f['yellow'](_0x2cb2c5[_0xa8fbda(0x1b4)]+_0xa8fbda(0x19f))),0x0);}}
1
+ const a44_0x11c569=a44_0x3ce1;(function(_0x3ecf73,_0x5cfc4c){const _0x278519=a44_0x3ce1,_0xf10c46=_0x3ecf73();while(!![]){try{const _0x2db923=parseInt(_0x278519(0x122))/0x1+-parseInt(_0x278519(0x150))/0x2+-parseInt(_0x278519(0x12c))/0x3*(-parseInt(_0x278519(0x142))/0x4)+-parseInt(_0x278519(0x14b))/0x5*(-parseInt(_0x278519(0x13d))/0x6)+parseInt(_0x278519(0x13a))/0x7*(-parseInt(_0x278519(0x128))/0x8)+parseInt(_0x278519(0x12d))/0x9*(parseInt(_0x278519(0x153))/0xa)+-parseInt(_0x278519(0x124))/0xb;if(_0x2db923===_0x5cfc4c)break;else _0xf10c46['push'](_0xf10c46['shift']());}catch(_0x221f2e){_0xf10c46['push'](_0xf10c46['shift']());}}}(a44_0x5efb,0x2f028));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x3ce1(_0x3cd81d,_0x54a4b8){_0x3cd81d=_0x3cd81d-0x120;const _0x5efb1a=a44_0x5efb();let _0x3ce148=_0x5efb1a[_0x3cd81d];return _0x3ce148;}function a44_0x5efb(){const _0x542eb5=['no_parent','203ZSCDxG','hasErrors','valid','12WwiGMP','targetDir','length','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','errorCode','8kVyBPc','.yml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20error(s)','error','type','yellow','segment:validate','\x20warning(s)\x20found','687185hoYIWP','):\x20','Validation\x20failed:\x20','endsWith','errors','586260BKAxMu','dim','description','356910RAcWdG','log','green','69597uOItBt','cwd','3893593zEvOag','✔\x20All\x20','filePath','\x20warning(s)','37528bUXPHB','warningCount','\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','\x20file(s)\x20with\x20errors,\x20','464991OEDgGC','81kpZzrP','name','.yaml','validCount','red','verbose','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20','helpText','warnings','\x20file(s)\x20valid'];a44_0x5efb=function(){return _0x542eb5;};return a44_0x5efb();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x53b091 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_0x11c569(0x12e)]=a44_0x11c569(0x149);[a44_0x11c569(0x152)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0x11c569(0x133)](_0x134dc9){const _0x27d06c=a44_0x11c569,{options:_0x177e9a,args:_0x36b0f9}=_0x134dc9,_0x1c6a11=_0x177e9a,_0x293d9a=await resolveTarget({'arg':_0x36b0f9[0x0],'contextParent':_0x177e9a['parentSegment'],'cwd':process[_0x27d06c(0x123)]()});if(!isSuccessfulResolution(_0x293d9a))return _0x293d9a[_0x27d06c(0x141)]===_0x27d06c(0x139)?(console[_0x27d06c(0x146)](a44_0x53b091['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x27d06c(0x146)](_0x27d06c(0x140)),console['error'](_0x27d06c(0x12a)),console[_0x27d06c(0x146)](_0x27d06c(0x134))):(console[_0x27d06c(0x146)](a44_0x53b091['red'](_0x27d06c(0x135)+_0x293d9a['message']+'\x0a')),_0x293d9a[_0x27d06c(0x136)]&&console[_0x27d06c(0x146)](a44_0x53b091['cyan'](_0x293d9a[_0x27d06c(0x136)]))),0x1;const _0x230e8c=_0x293d9a[_0x27d06c(0x13e)],_0x5ce672=_0x293d9a[_0x27d06c(0x147)]==='file'?_0x293d9a[_0x27d06c(0x126)]:undefined;if(!_0x5ce672&&!existsSync(_0x230e8c))return console['error'](a44_0x53b091[_0x27d06c(0x131)]('Error:\x20Directory\x20not\x20found:\x20'+_0x230e8c+'\x0a')),0x1;let _0x56182c;if(_0x5ce672){if(!_0x5ce672[_0x27d06c(0x14e)](_0x27d06c(0x143))&&!_0x5ce672[_0x27d06c(0x14e)](_0x27d06c(0x12f)))return console['error'](a44_0x53b091[_0x27d06c(0x131)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x5ce672+'\x0a')),0x1;_0x56182c=[_0x5ce672];}else _0x56182c=findYamlFiles(_0x230e8c);if(_0x56182c[_0x27d06c(0x13f)]===0x0)return console[_0x27d06c(0x146)](a44_0x53b091[_0x27d06c(0x131)](_0x27d06c(0x144)+_0x230e8c+'\x0a')),0x1;const _0x3e4056=validateYamlFiles(_0x56182c,_0x230e8c),_0x458645=calculateSummary(_0x3e4056);for(const _0x25fcc4 of _0x3e4056){if(!isValidationResult(_0x25fcc4))continue;const {relativePath:_0x592681,source:_0x41b2f9,result:_0x3eb4d6,fileType:_0x5c54c6}=_0x25fcc4,_0x27c123=_0x5c54c6;if(_0x3eb4d6[_0x27d06c(0x13c)]&&_0x3eb4d6[_0x27d06c(0x137)][_0x27d06c(0x13f)]===0x0)_0x1c6a11[_0x27d06c(0x132)]&&console['log'](a44_0x53b091[_0x27d06c(0x121)]('✔\x20'+_0x592681)+a44_0x53b091['dim']('\x20('+_0x27c123+')'));else _0x3eb4d6[_0x27d06c(0x13c)]?(console['log'](a44_0x53b091[_0x27d06c(0x148)]('⚠\x20'+_0x592681)+a44_0x53b091['dim']('\x20('+_0x27c123+_0x27d06c(0x14c)+_0x3eb4d6[_0x27d06c(0x137)][_0x27d06c(0x13f)]+_0x27d06c(0x127))),console['log'](formatValidationResult(_0x3eb4d6,_0x41b2f9,_0x592681))):(console['log'](a44_0x53b091['red']('✖\x20'+_0x592681)+a44_0x53b091[_0x27d06c(0x151)]('\x20('+_0x27c123+_0x27d06c(0x14c)+_0x3eb4d6[_0x27d06c(0x14f)]['length']+_0x27d06c(0x145))),console[_0x27d06c(0x120)](formatValidationResult(_0x3eb4d6,_0x41b2f9,_0x592681)));}return console[_0x27d06c(0x120)](''),_0x458645[_0x27d06c(0x13b)]?(console[_0x27d06c(0x120)](a44_0x53b091[_0x27d06c(0x131)](_0x27d06c(0x14d)+_0x458645['invalidCount']+_0x27d06c(0x12b)+_0x458645['validCount']+'\x20valid')),_0x458645[_0x27d06c(0x129)]>0x0&&console[_0x27d06c(0x120)](a44_0x53b091[_0x27d06c(0x148)](_0x458645['warningCount']+'\x20warning(s)\x20found')),0x1):(console['log'](a44_0x53b091[_0x27d06c(0x121)](_0x27d06c(0x125)+_0x458645[_0x27d06c(0x130)]+_0x27d06c(0x138))),_0x458645[_0x27d06c(0x129)]>0x0&&console['log'](a44_0x53b091['yellow'](_0x458645['warningCount']+_0x27d06c(0x14a))),0x0);}}
@@ -1 +1 @@
1
- function a45_0xfbb4(_0x4d1d49,_0x2ac2ac){_0x4d1d49=_0x4d1d49-0x117;const _0x39c075=a45_0x39c0();let _0xfbb4f2=_0x39c075[_0x4d1d49];return _0xfbb4f2;}const a45_0x5f14a8=a45_0xfbb4;(function(_0x8a7598,_0xb65b82){const _0x4e1812=a45_0xfbb4,_0x4ec2df=_0x8a7598();while(!![]){try{const _0x3b3600=-parseInt(_0x4e1812(0x129))/0x1*(-parseInt(_0x4e1812(0x12a))/0x2)+parseInt(_0x4e1812(0x153))/0x3*(parseInt(_0x4e1812(0x11f))/0x4)+parseInt(_0x4e1812(0x13d))/0x5+-parseInt(_0x4e1812(0x13e))/0x6*(-parseInt(_0x4e1812(0x130))/0x7)+parseInt(_0x4e1812(0x160))/0x8*(-parseInt(_0x4e1812(0x155))/0x9)+-parseInt(_0x4e1812(0x152))/0xa*(parseInt(_0x4e1812(0x117))/0xb)+-parseInt(_0x4e1812(0x146))/0xc*(parseInt(_0x4e1812(0x11a))/0xd);if(_0x3b3600===_0xb65b82)break;else _0x4ec2df['push'](_0x4ec2df['shift']());}catch(_0x3c4e58){_0x4ec2df['push'](_0x4ec2df['shift']());}}}(a45_0x39c0,0xbdc3d));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_0x493241 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x5f14a8(0x149)]='segments';[a45_0x5f14a8(0x14f)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x5f14a8(0x11b)](_0x396528){const _0x20814a=a45_0x5f14a8,{options:_0x59d498,args:_0x3e9260}=_0x396528,_0x48b3cd=_0x59d498['recursive'],_0x283bae=_0x3e9260[0x0];try{const _0x500c9f=_0x59d498[_0x20814a(0x141)];_0x59d498[_0x20814a(0x136)]&&(console['error'](_0x20814a(0x132)+_0x59d498[_0x20814a(0x162)]),console[_0x20814a(0x15b)](_0x20814a(0x126)+(_0x500c9f||_0x20814a(0x15d))),_0x283bae&&console['error'](_0x20814a(0x134)+_0x283bae),_0x48b3cd&&console[_0x20814a(0x15b)]('Recursive\x20mode:\x20enabled'));if(!_0x500c9f)return console[_0x20814a(0x15b)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x20814a(0x15b)](''),console['error']('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x20814a(0x15b)](_0x20814a(0x13a)),console[_0x20814a(0x15b)](_0x20814a(0x145)),console[_0x20814a(0x15b)](''),console['error'](_0x20814a(0x12d)),0x1;const _0x4b9701=_0x283bae&&(_0x283bae[_0x20814a(0x133)]('*')||_0x283bae[_0x20814a(0x133)]('?'));if(_0x4b9701)return await this['listWithPattern'](_0x396528,_0x500c9f,_0x283bae);const _0x3aeccb=_0x283bae?_0x500c9f+'/'+_0x283bae:_0x500c9f;return _0x48b3cd?await this[_0x20814a(0x11d)](_0x396528,_0x3aeccb):await this['listUnified'](_0x396528,_0x3aeccb);}catch(_0xd63e1){if(_0xd63e1 instanceof SDKError)return console[_0x20814a(0x15b)](_0x20814a(0x118)+_0xd63e1[_0x20814a(0x159)]),_0xd63e1[_0x20814a(0x135)]&&console[_0x20814a(0x15b)]('\x20\x20Cause:\x20'+_0xd63e1['cause']),0x1;throw _0xd63e1;}}async[a45_0x5f14a8(0x120)](_0x9386e9,_0x1e95b5,_0x3375d0){const _0x4c6d3f=a45_0x5f14a8,{options:_0x3d893f,tdx:_0x198035}=_0x9386e9,_0x14f108=await withSpinner(_0x4c6d3f(0x119)+_0x1e95b5+_0x4c6d3f(0x12c),()=>_0x198035[_0x4c6d3f(0x14b)][_0x4c6d3f(0x15f)](_0x1e95b5),{'verbose':_0x3d893f[_0x4c6d3f(0x136)]}),_0x52391e=_0x14f108[_0x4c6d3f(0x138)],_0x46bc4d=await withSpinner(_0x4c6d3f(0x15a),()=>_0x198035[_0x4c6d3f(0x14b)]['listUnifiedWithJourneys'](_0x52391e[_0x4c6d3f(0x156)],_0x52391e[_0x4c6d3f(0x151)]),{'verbose':_0x3d893f[_0x4c6d3f(0x136)]}),{folders:_0x545598,segments:_0x1fb24a,journeys:_0x1b3887}=_0x46bc4d[_0x4c6d3f(0x138)],_0x580b0c=_0x3375d0['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x4c6d3f(0x12f)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x51e3a6=new RegExp('^'+_0x580b0c+'$','i'),_0x3f7ce1=_0x545598[_0x4c6d3f(0x12e)](_0x487d9e=>_0x51e3a6['test'](_0x487d9e[_0x4c6d3f(0x149)])),_0x114dd3=_0x1fb24a['filter'](_0xfbf8ab=>_0x51e3a6[_0x4c6d3f(0x158)](_0xfbf8ab[_0x4c6d3f(0x149)])),_0xd35a5f=_0x1b3887[_0x4c6d3f(0x12e)](_0x4bf410=>_0x51e3a6[_0x4c6d3f(0x158)](_0x4bf410[_0x4c6d3f(0x11e)])),_0x99861=_0x3f7ce1[_0x4c6d3f(0x13f)]+_0x114dd3['length']+_0xd35a5f[_0x4c6d3f(0x13f)];console['error']('✔\x20Found\x20'+_0x3f7ce1[_0x4c6d3f(0x13f)]+'\x20folder'+(_0x3f7ce1[_0x4c6d3f(0x13f)]!==0x1?'s':'')+',\x20'+_0x114dd3['length']+_0x4c6d3f(0x137)+(_0x114dd3['length']!==0x1?'s':'')+_0x4c6d3f(0x14d)+_0xd35a5f[_0x4c6d3f(0x13f)]+_0x4c6d3f(0x139)+(_0xd35a5f[_0x4c6d3f(0x13f)]!==0x1?'s':'')+_0x4c6d3f(0x161)+_0x3375d0+'\x27');const _0x1343f6=_0x19628d=>{const _0x33740e=_0x4c6d3f;return getConsoleNextUrl(_0x3d893f['site'],_0x33740e(0x14a)+_0x52391e[_0x33740e(0x156)]+_0x33740e(0x142)+_0x19628d);},_0x2b4df5=_0x3d893f[_0x4c6d3f(0x140)]==='json'||_0x3d893f['format']==='jsonl';if(_0x2b4df5){const _0xcb1268=[..._0x3f7ce1[_0x4c6d3f(0x15c)](_0x3c7593=>({..._0x3c7593,'type':'folder'})),..._0x114dd3[_0x4c6d3f(0x15c)](_0xd8b133=>({..._0xd8b133,'type':_0x4c6d3f(0x14b),'url':_0x1343f6(_0xd8b133['id'])})),..._0xd35a5f['map'](_0x2bc576=>({..._0x2bc576,'name':_0x2bc576['journeyBundleName'],'type':'journey'}))][_0x4c6d3f(0x122)]((_0x3b5660,_0x61ff90)=>_0x3b5660['name'][_0x4c6d3f(0x128)](_0x61ff90['name']));await handleSDKOutput(_0xcb1268,_0x3d893f);}else{if(_0x99861===0x0)console['log']('No\x20items\x20match\x20pattern:\x20'+_0x3375d0);else{console[_0x4c6d3f(0x148)](a45_0x493241[_0x4c6d3f(0x124)]('['+_0x1e95b5+_0x4c6d3f(0x163)+_0x3375d0+'\x27'));const _0x158a83=formatFlatList(_0x3f7ce1,_0x114dd3,{'showMetadata':!![],'getSegmentUrl':_0x1343f6},_0xd35a5f);console[_0x4c6d3f(0x148)](_0x158a83);}}return 0x0;}async['listUnified'](_0x5f998f,_0x56f303){const _0x1366e1=a45_0x5f14a8,{options:_0x12062e,tdx:_0x134b7a}=_0x5f998f,_0x49e567=await withSpinner(_0x1366e1(0x123)+_0x56f303+'\x27...',()=>_0x134b7a[_0x1366e1(0x14b)][_0x1366e1(0x15f)](_0x56f303),{'verbose':_0x12062e[_0x1366e1(0x136)]}),_0x38460d=_0x49e567['data'];_0x12062e[_0x1366e1(0x136)]&&(console['error'](_0x1366e1(0x143)+_0x38460d['parentId']),_0x38460d[_0x1366e1(0x151)]&&console[_0x1366e1(0x15b)]('Folder\x20ID:\x20'+_0x38460d[_0x1366e1(0x151)]));const _0x406950=await withSpinner(_0x1366e1(0x15a),()=>_0x134b7a[_0x1366e1(0x14b)][_0x1366e1(0x14c)](_0x38460d[_0x1366e1(0x156)],_0x38460d['folderId']),{'verbose':_0x12062e[_0x1366e1(0x136)]}),{folders:_0x344c20,segments:_0x524875,journeys:_0x50b4f6}=_0x406950[_0x1366e1(0x138)],_0x4463c9=_0x344c20[_0x1366e1(0x13f)]+_0x524875[_0x1366e1(0x13f)]+_0x50b4f6['length'];console[_0x1366e1(0x15b)](_0x1366e1(0x14e)+_0x344c20['length']+'\x20folder'+(_0x344c20[_0x1366e1(0x13f)]!==0x1?'s':'')+',\x20'+_0x524875[_0x1366e1(0x13f)]+_0x1366e1(0x137)+(_0x524875[_0x1366e1(0x13f)]!==0x1?'s':'')+_0x1366e1(0x14d)+_0x50b4f6[_0x1366e1(0x13f)]+'\x20journey'+(_0x50b4f6['length']!==0x1?'s':''));const _0x1c2d08=_0x5624ab=>{const _0x5eab66=_0x1366e1;return getConsoleNextUrl(_0x12062e['site'],'/app/ps/'+_0x38460d[_0x5eab66(0x156)]+_0x5eab66(0x142)+_0x5624ab);},_0x19c54a=_0x30f13b=>{const _0x57e173=_0x1366e1;return getConsoleNextUrl(_0x12062e[_0x57e173(0x162)],_0x57e173(0x14a)+_0x38460d[_0x57e173(0x156)]+_0x57e173(0x142)+_0x30f13b+_0x57e173(0x131));},_0x2a20eb=_0x12062e[_0x1366e1(0x140)]==='json'||_0x12062e[_0x1366e1(0x140)]===_0x1366e1(0x12b);if(_0x2a20eb){const _0x321e4c=[..._0x344c20[_0x1366e1(0x15c)](_0x3988a6=>({..._0x3988a6,'type':_0x1366e1(0x127)})),..._0x524875[_0x1366e1(0x15c)](_0x53c644=>({..._0x53c644,'type':_0x1366e1(0x14b),'url':_0x1c2d08(_0x53c644['id'])})),..._0x50b4f6[_0x1366e1(0x15c)](_0x180801=>({..._0x180801,'name':_0x180801[_0x1366e1(0x11e)],'type':'journey','url':_0x19c54a(_0x180801['id'])}))][_0x1366e1(0x122)]((_0xf36f5f,_0x3f0021)=>_0xf36f5f['name']['localeCompare'](_0x3f0021[_0x1366e1(0x149)]));await handleSDKOutput(_0x321e4c,_0x12062e);}else{if(_0x4463c9===0x0)console[_0x1366e1(0x148)](a45_0x493241[_0x1366e1(0x124)]('['+_0x56f303+']')),console[_0x1366e1(0x148)](_0x1366e1(0x164));else{console[_0x1366e1(0x148)](a45_0x493241[_0x1366e1(0x124)]('['+_0x56f303+']'));const _0x4b23f9=formatFlatList(_0x344c20,_0x524875,{'showMetadata':!![],'getSegmentUrl':_0x1c2d08,'getJourneyUrl':_0x19c54a},_0x50b4f6);console['log'](_0x4b23f9);}}return 0x0;}async[a45_0x5f14a8(0x11d)](_0x55dced,_0x573d3f){const _0x11eb38=a45_0x5f14a8,{options:_0x3d2308,tdx:_0x11c7be}=_0x55dced,_0x4127de=await withSpinner(_0x11eb38(0x123)+_0x573d3f+_0x11eb38(0x12c),()=>_0x11c7be[_0x11eb38(0x14b)][_0x11eb38(0x15f)](_0x573d3f),{'verbose':_0x3d2308[_0x11eb38(0x136)]}),_0x52b1eb=_0x4127de['data'];_0x3d2308[_0x11eb38(0x136)]&&(console['error'](_0x11eb38(0x143)+_0x52b1eb[_0x11eb38(0x156)]),_0x52b1eb[_0x11eb38(0x151)]&&console[_0x11eb38(0x15b)](_0x11eb38(0x11c)+_0x52b1eb['folderId']));const _0x34cc60=_0x3d2308[_0x11eb38(0x121)]||0xa,_0x4968c4=await withSpinner(_0x11eb38(0x150),()=>_0x11c7be[_0x11eb38(0x14b)][_0x11eb38(0x11d)](_0x52b1eb[_0x11eb38(0x156)],_0x52b1eb[_0x11eb38(0x151)],0x0,_0x34cc60),{'verbose':_0x3d2308[_0x11eb38(0x136)]}),_0x3875c0=_0x4968c4[_0x11eb38(0x138)],_0x31e6c4=_0x4de07d=>{const _0x32eac4=_0x11eb38;let _0x3569d4=0x0,_0x263fda=0x0,_0x139699=0x0;for(const _0x4e595c of _0x4de07d){if(_0x4e595c[_0x32eac4(0x147)]===_0x32eac4(0x127))_0x3569d4++;else{if(_0x4e595c[_0x32eac4(0x147)]===_0x32eac4(0x14b))_0x263fda++;else{if(_0x4e595c['type']===_0x32eac4(0x157))_0x139699++;}}if(_0x4e595c[_0x32eac4(0x13c)]){const _0x25e0e2=_0x31e6c4(_0x4e595c[_0x32eac4(0x13c)]);_0x3569d4+=_0x25e0e2['folders'],_0x263fda+=_0x25e0e2[_0x32eac4(0x154)],_0x139699+=_0x25e0e2['journeys'];}}return{'folders':_0x3569d4,'segments':_0x263fda,'journeys':_0x139699};},_0x4d1a0f=_0x31e6c4(_0x3875c0);console['error'](_0x11eb38(0x125)+_0x4d1a0f[_0x11eb38(0x15e)]+'\x20folder'+(_0x4d1a0f['folders']!==0x1?'s':'')+',\x20'+_0x4d1a0f[_0x11eb38(0x154)]+_0x11eb38(0x137)+(_0x4d1a0f[_0x11eb38(0x154)]!==0x1?'s':'')+_0x11eb38(0x14d)+_0x4d1a0f['journeys']+_0x11eb38(0x139)+(_0x4d1a0f[_0x11eb38(0x13b)]!==0x1?'s':''));const _0xb21db=_0x54270d=>{const _0x50fdf4=_0x11eb38;return getConsoleNextUrl(_0x3d2308['site'],_0x50fdf4(0x14a)+_0x52b1eb[_0x50fdf4(0x156)]+_0x50fdf4(0x142)+_0x54270d);},_0x186672=_0x4d1555=>{const _0x10bc7a=_0x11eb38;return getConsoleNextUrl(_0x3d2308[_0x10bc7a(0x162)],_0x10bc7a(0x14a)+_0x52b1eb[_0x10bc7a(0x156)]+_0x10bc7a(0x142)+_0x4d1555+_0x10bc7a(0x131));};if(_0x3d2308[_0x11eb38(0x140)]===_0x11eb38(0x144)||_0x3d2308[_0x11eb38(0x140)]===_0x11eb38(0x12b))await handleSDKOutput(_0x3875c0,_0x3d2308);else{console[_0x11eb38(0x148)](a45_0x493241[_0x11eb38(0x124)]('['+_0x573d3f+']'));const _0x367e98=formatTree(_0x3875c0,{'showMetadata':!![],'getSegmentUrl':_0xb21db,'getJourneyUrl':_0x186672});console[_0x11eb38(0x148)](_0x367e98);}return 0x0;}}function a45_0x39c0(){const _0x57a0ab=[']\x20matching\x20\x27','(empty)','1674926pIFKDU','Error:\x20','Resolving\x20parent\x20segment\x20\x27','546UrtOBp','execute','Folder\x20ID:\x20','listRecursive','journeyBundleName','964rglSEU','listWithPattern','maxDepth','sort','Resolving\x20path\x20\x27','dim','✔\x20Built\x20tree\x20with\x20','Parent\x20segment\x20context:\x20','folder','localeCompare','7xENdVF','352346NzlNIw','jsonl','\x27...','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','filter','replace','46697hEtBtW','/j/da','Site:\x20','includes','Folder/pattern\x20arg:\x20','cause','verbose','\x20segment','data','\x20journey','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','journeys','children','6495470lZtNlK','1338zBmIHa','length','format','parentSegment','/e/','Parent\x20ID:\x20','json','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','789000cuYZJN','type','log','name','/app/ps/','segment','listUnifiedWithJourneys',',\x20and\x20','✔\x20Found\x20','description','Building\x20hierarchy\x20tree...','folderId','80aVmCut','16335tVialV','segments','15642HNRhEE','parentId','journey','test','message','Listing\x20folders,\x20segments,\x20and\x20journeys...','error','map','(not\x20set)','folders','resolvePathToResource','2648nEveeN','\x20matching\x20\x27','site'];a45_0x39c0=function(){return _0x57a0ab;};return a45_0x39c0();}
1
+ const a45_0x2df4b1=a45_0xf0d3;function a45_0xf0d3(_0x40ab8e,_0x149c8c){_0x40ab8e=_0x40ab8e-0xf6;const _0x5626ab=a45_0x5626();let _0xf0d320=_0x5626ab[_0x40ab8e];return _0xf0d320;}(function(_0x529307,_0xeb68ce){const _0x5e0d2f=a45_0xf0d3,_0x4fe107=_0x529307();while(!![]){try{const _0x1f42af=-parseInt(_0x5e0d2f(0x119))/0x1*(parseInt(_0x5e0d2f(0x13d))/0x2)+-parseInt(_0x5e0d2f(0x10a))/0x3*(-parseInt(_0x5e0d2f(0x129))/0x4)+-parseInt(_0x5e0d2f(0x111))/0x5+-parseInt(_0x5e0d2f(0xfd))/0x6*(-parseInt(_0x5e0d2f(0x13c))/0x7)+parseInt(_0x5e0d2f(0x127))/0x8*(-parseInt(_0x5e0d2f(0x13e))/0x9)+parseInt(_0x5e0d2f(0x107))/0xa+parseInt(_0x5e0d2f(0x135))/0xb*(parseInt(_0x5e0d2f(0x133))/0xc);if(_0x1f42af===_0xeb68ce)break;else _0x4fe107['push'](_0x4fe107['shift']());}catch(_0x1cbb01){_0x4fe107['push'](_0x4fe107['shift']());}}}(a45_0x5626,0x66956));import{BaseCommand}from'./command.js';function a45_0x5626(){const _0xaf63a0=['dim','listUnifiedWithJourneys','localeCompare','Resolving\x20path\x20\x27','message','4091215TxoHHu','maxDepth','jsonl','Folder/pattern\x20arg:\x20','journeys','\x20\x20Cause:\x20','journey','folders','613JfqtSO','journeyBundleName','/app/ps/','Building\x20hierarchy\x20tree...','Listing\x20folders,\x20segments,\x20and\x20journeys...','listRecursive','Error:\x20','segment','No\x20items\x20match\x20pattern:\x20','map','Parent\x20ID:\x20','format','Parent\x20segment\x20context:\x20','List\x20folders\x20and\x20child\x20segments','160cwLYym','filter','108JSfrOJ','name','(empty)','Folder\x20ID:\x20','parentId','type','length','data','✔\x20Found\x20','Recursive\x20mode:\x20enabled','62196ifRfhn','error','1397yopRhy','resolvePathToResource','site','recursive','replace','execute','folderId','7896gePiSn','850DHoGlt','139257RGBtZE','(not\x20set)','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','segments','includes','cause','Error:\x20No\x20parent\x20segment\x20context\x20set.','/j/da','verbose','\x20folder','json','2478VyKmPY','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20journey','\x20segment','\x20matching\x20\x27','✔\x20Built\x20tree\x20with\x20','/e/','log','\x5c$&',',\x20and\x20','3915980haSpUn','test','listWithPattern','32523FRhqxr','sort'];a45_0x5626=function(){return _0xaf63a0;};return a45_0x5626();}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_0x48edfd from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x2df4b1(0x12a)]='segments';['description']=a45_0x2df4b1(0x126);async[a45_0x2df4b1(0x13a)](_0x1ce996){const _0x3ee36f=a45_0x2df4b1,{options:_0x40b29d,args:_0x392eb2}=_0x1ce996,_0x409762=_0x40b29d[_0x3ee36f(0x138)],_0x5271aa=_0x392eb2[0x0];try{const _0x190834=_0x40b29d['parentSegment'];_0x40b29d[_0x3ee36f(0xfa)]&&(console[_0x3ee36f(0x134)]('Site:\x20'+_0x40b29d[_0x3ee36f(0x137)]),console[_0x3ee36f(0x134)](_0x3ee36f(0x125)+(_0x190834||_0x3ee36f(0x13f))),_0x5271aa&&console[_0x3ee36f(0x134)](_0x3ee36f(0x114)+_0x5271aa),_0x409762&&console[_0x3ee36f(0x134)](_0x3ee36f(0x132)));if(!_0x190834)return console['error'](_0x3ee36f(0xf8)),console['error'](''),console[_0x3ee36f(0x134)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x3ee36f(0x134)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x3ee36f(0x134)](_0x3ee36f(0xfe)),console[_0x3ee36f(0x134)](''),console[_0x3ee36f(0x134)](_0x3ee36f(0x140)),0x1;const _0x1f2d3e=_0x5271aa&&(_0x5271aa[_0x3ee36f(0xf6)]('*')||_0x5271aa[_0x3ee36f(0xf6)]('?'));if(_0x1f2d3e)return await this[_0x3ee36f(0x109)](_0x1ce996,_0x190834,_0x5271aa);const _0x434cbb=_0x5271aa?_0x190834+'/'+_0x5271aa:_0x190834;return _0x409762?await this[_0x3ee36f(0x11e)](_0x1ce996,_0x434cbb):await this['listUnified'](_0x1ce996,_0x434cbb);}catch(_0x556098){if(_0x556098 instanceof SDKError)return console[_0x3ee36f(0x134)](_0x3ee36f(0x11f)+_0x556098[_0x3ee36f(0x110)]),_0x556098[_0x3ee36f(0xf7)]&&console[_0x3ee36f(0x134)](_0x3ee36f(0x116)+_0x556098[_0x3ee36f(0xf7)]),0x1;throw _0x556098;}}async['listWithPattern'](_0x26948d,_0x1aeaac,_0x4c0248){const _0x2bb252=a45_0x2df4b1,{options:_0x2c0e74,tdx:_0x5b055e}=_0x26948d,_0x40f178=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1aeaac+'\x27...',()=>_0x5b055e[_0x2bb252(0x120)]['resolvePathToResource'](_0x1aeaac),{'verbose':_0x2c0e74[_0x2bb252(0xfa)]}),_0x348fb0=_0x40f178['data'],_0x15a904=await withSpinner(_0x2bb252(0x11d),()=>_0x5b055e['segment']['listUnifiedWithJourneys'](_0x348fb0[_0x2bb252(0x12d)],_0x348fb0[_0x2bb252(0x13b)]),{'verbose':_0x2c0e74[_0x2bb252(0xfa)]}),{folders:_0x5e64cd,segments:_0x2439a7,journeys:_0x330e9f}=_0x15a904[_0x2bb252(0x130)],_0x32142c=_0x4c0248['replace'](/[.+^${}()|[\]\\]/g,_0x2bb252(0x105))[_0x2bb252(0x139)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x42637b=new RegExp('^'+_0x32142c+'$','i'),_0xa4c28a=_0x5e64cd[_0x2bb252(0x128)](_0x892ee9=>_0x42637b[_0x2bb252(0x108)](_0x892ee9[_0x2bb252(0x12a)])),_0x56ed7e=_0x2439a7[_0x2bb252(0x128)](_0x1fd411=>_0x42637b[_0x2bb252(0x108)](_0x1fd411['name'])),_0x1e90bf=_0x330e9f['filter'](_0x223b9b=>_0x42637b[_0x2bb252(0x108)](_0x223b9b[_0x2bb252(0x11a)])),_0x40ef09=_0xa4c28a[_0x2bb252(0x12f)]+_0x56ed7e['length']+_0x1e90bf['length'];console[_0x2bb252(0x134)](_0x2bb252(0x131)+_0xa4c28a[_0x2bb252(0x12f)]+'\x20folder'+(_0xa4c28a[_0x2bb252(0x12f)]!==0x1?'s':'')+',\x20'+_0x56ed7e[_0x2bb252(0x12f)]+_0x2bb252(0x100)+(_0x56ed7e[_0x2bb252(0x12f)]!==0x1?'s':'')+_0x2bb252(0x106)+_0x1e90bf['length']+_0x2bb252(0xff)+(_0x1e90bf['length']!==0x1?'s':'')+_0x2bb252(0x101)+_0x4c0248+'\x27');const _0x50b874=_0x706036=>{const _0x4e1deb=_0x2bb252;return getConsoleNextUrl(_0x2c0e74[_0x4e1deb(0x137)],_0x4e1deb(0x11b)+_0x348fb0['parentId']+_0x4e1deb(0x103)+_0x706036);},_0x48047b=_0x2c0e74['format']===_0x2bb252(0xfc)||_0x2c0e74[_0x2bb252(0x124)]===_0x2bb252(0x113);if(_0x48047b){const _0x3e9454=[..._0xa4c28a[_0x2bb252(0x122)](_0x37a0c9=>({..._0x37a0c9,'type':'folder'})),..._0x56ed7e['map'](_0x2eccb1=>({..._0x2eccb1,'type':_0x2bb252(0x120),'url':_0x50b874(_0x2eccb1['id'])})),..._0x1e90bf[_0x2bb252(0x122)](_0x5d18a2=>({..._0x5d18a2,'name':_0x5d18a2[_0x2bb252(0x11a)],'type':_0x2bb252(0x117)}))][_0x2bb252(0x10b)]((_0x377ec9,_0x4495db)=>_0x377ec9[_0x2bb252(0x12a)][_0x2bb252(0x10e)](_0x4495db[_0x2bb252(0x12a)]));await handleSDKOutput(_0x3e9454,_0x2c0e74);}else{if(_0x40ef09===0x0)console[_0x2bb252(0x104)](_0x2bb252(0x121)+_0x4c0248);else{console[_0x2bb252(0x104)](a45_0x48edfd['dim']('['+_0x1aeaac+']\x20matching\x20\x27'+_0x4c0248+'\x27'));const _0x11f65a=formatFlatList(_0xa4c28a,_0x56ed7e,{'showMetadata':!![],'getSegmentUrl':_0x50b874},_0x1e90bf);console[_0x2bb252(0x104)](_0x11f65a);}}return 0x0;}async['listUnified'](_0x4d7af7,_0xf53be7){const _0x1abe07=a45_0x2df4b1,{options:_0x1e815e,tdx:_0x505db4}=_0x4d7af7,_0x2b9ae3=await withSpinner(_0x1abe07(0x10f)+_0xf53be7+'\x27...',()=>_0x505db4[_0x1abe07(0x120)][_0x1abe07(0x136)](_0xf53be7),{'verbose':_0x1e815e[_0x1abe07(0xfa)]}),_0xc37a1a=_0x2b9ae3[_0x1abe07(0x130)];_0x1e815e[_0x1abe07(0xfa)]&&(console[_0x1abe07(0x134)](_0x1abe07(0x123)+_0xc37a1a[_0x1abe07(0x12d)]),_0xc37a1a[_0x1abe07(0x13b)]&&console[_0x1abe07(0x134)]('Folder\x20ID:\x20'+_0xc37a1a[_0x1abe07(0x13b)]));const _0x27d4bf=await withSpinner(_0x1abe07(0x11d),()=>_0x505db4[_0x1abe07(0x120)][_0x1abe07(0x10d)](_0xc37a1a[_0x1abe07(0x12d)],_0xc37a1a[_0x1abe07(0x13b)]),{'verbose':_0x1e815e[_0x1abe07(0xfa)]}),{folders:_0x11e7d3,segments:_0x3219aa,journeys:_0x3251c5}=_0x27d4bf[_0x1abe07(0x130)],_0x1e55cb=_0x11e7d3[_0x1abe07(0x12f)]+_0x3219aa['length']+_0x3251c5[_0x1abe07(0x12f)];console[_0x1abe07(0x134)](_0x1abe07(0x131)+_0x11e7d3[_0x1abe07(0x12f)]+_0x1abe07(0xfb)+(_0x11e7d3[_0x1abe07(0x12f)]!==0x1?'s':'')+',\x20'+_0x3219aa[_0x1abe07(0x12f)]+_0x1abe07(0x100)+(_0x3219aa[_0x1abe07(0x12f)]!==0x1?'s':'')+_0x1abe07(0x106)+_0x3251c5[_0x1abe07(0x12f)]+_0x1abe07(0xff)+(_0x3251c5[_0x1abe07(0x12f)]!==0x1?'s':''));const _0x44d9b5=_0x4d671b=>{const _0x5b0ed0=_0x1abe07;return getConsoleNextUrl(_0x1e815e[_0x5b0ed0(0x137)],_0x5b0ed0(0x11b)+_0xc37a1a['parentId']+_0x5b0ed0(0x103)+_0x4d671b);},_0x587764=_0x51f43b=>{const _0x5493f7=_0x1abe07;return getConsoleNextUrl(_0x1e815e[_0x5493f7(0x137)],'/app/ps/'+_0xc37a1a[_0x5493f7(0x12d)]+'/e/'+_0x51f43b+_0x5493f7(0xf9));},_0x4c69c5=_0x1e815e['format']===_0x1abe07(0xfc)||_0x1e815e[_0x1abe07(0x124)]==='jsonl';if(_0x4c69c5){const _0x198883=[..._0x11e7d3[_0x1abe07(0x122)](_0x59f6e8=>({..._0x59f6e8,'type':'folder'})),..._0x3219aa[_0x1abe07(0x122)](_0x4383bc=>({..._0x4383bc,'type':_0x1abe07(0x120),'url':_0x44d9b5(_0x4383bc['id'])})),..._0x3251c5[_0x1abe07(0x122)](_0x133764=>({..._0x133764,'name':_0x133764[_0x1abe07(0x11a)],'type':_0x1abe07(0x117),'url':_0x587764(_0x133764['id'])}))][_0x1abe07(0x10b)]((_0x125231,_0x425702)=>_0x125231[_0x1abe07(0x12a)][_0x1abe07(0x10e)](_0x425702[_0x1abe07(0x12a)]));await handleSDKOutput(_0x198883,_0x1e815e);}else{if(_0x1e55cb===0x0)console[_0x1abe07(0x104)](a45_0x48edfd[_0x1abe07(0x10c)]('['+_0xf53be7+']')),console['log'](_0x1abe07(0x12b));else{console[_0x1abe07(0x104)](a45_0x48edfd['dim']('['+_0xf53be7+']'));const _0x1fb017=formatFlatList(_0x11e7d3,_0x3219aa,{'showMetadata':!![],'getSegmentUrl':_0x44d9b5,'getJourneyUrl':_0x587764},_0x3251c5);console['log'](_0x1fb017);}}return 0x0;}async['listRecursive'](_0xeedb77,_0x399499){const _0x2362ca=a45_0x2df4b1,{options:_0x2e3a3,tdx:_0x2b745f}=_0xeedb77,_0x57b595=await withSpinner(_0x2362ca(0x10f)+_0x399499+'\x27...',()=>_0x2b745f[_0x2362ca(0x120)]['resolvePathToResource'](_0x399499),{'verbose':_0x2e3a3[_0x2362ca(0xfa)]}),_0xeac7da=_0x57b595[_0x2362ca(0x130)];_0x2e3a3[_0x2362ca(0xfa)]&&(console[_0x2362ca(0x134)](_0x2362ca(0x123)+_0xeac7da['parentId']),_0xeac7da[_0x2362ca(0x13b)]&&console['error'](_0x2362ca(0x12c)+_0xeac7da[_0x2362ca(0x13b)]));const _0x50fa4b=_0x2e3a3[_0x2362ca(0x112)]||0xa,_0xa165d3=await withSpinner(_0x2362ca(0x11c),()=>_0x2b745f[_0x2362ca(0x120)]['listRecursive'](_0xeac7da[_0x2362ca(0x12d)],_0xeac7da[_0x2362ca(0x13b)],0x0,_0x50fa4b),{'verbose':_0x2e3a3['verbose']}),_0x46cc4c=_0xa165d3[_0x2362ca(0x130)],_0x4b050c=_0x396ead=>{const _0x15707d=_0x2362ca;let _0x4e8964=0x0,_0x477e6d=0x0,_0x2ad894=0x0;for(const _0x410aee of _0x396ead){if(_0x410aee[_0x15707d(0x12e)]==='folder')_0x4e8964++;else{if(_0x410aee[_0x15707d(0x12e)]===_0x15707d(0x120))_0x477e6d++;else{if(_0x410aee[_0x15707d(0x12e)]===_0x15707d(0x117))_0x2ad894++;}}if(_0x410aee['children']){const _0x51b844=_0x4b050c(_0x410aee['children']);_0x4e8964+=_0x51b844[_0x15707d(0x118)],_0x477e6d+=_0x51b844[_0x15707d(0x141)],_0x2ad894+=_0x51b844[_0x15707d(0x115)];}}return{'folders':_0x4e8964,'segments':_0x477e6d,'journeys':_0x2ad894};},_0x4ca6b7=_0x4b050c(_0x46cc4c);console[_0x2362ca(0x134)](_0x2362ca(0x102)+_0x4ca6b7[_0x2362ca(0x118)]+'\x20folder'+(_0x4ca6b7[_0x2362ca(0x118)]!==0x1?'s':'')+',\x20'+_0x4ca6b7['segments']+_0x2362ca(0x100)+(_0x4ca6b7[_0x2362ca(0x141)]!==0x1?'s':'')+_0x2362ca(0x106)+_0x4ca6b7['journeys']+_0x2362ca(0xff)+(_0x4ca6b7['journeys']!==0x1?'s':''));const _0x3672ae=_0x53d847=>{const _0x6f9a1f=_0x2362ca;return getConsoleNextUrl(_0x2e3a3[_0x6f9a1f(0x137)],_0x6f9a1f(0x11b)+_0xeac7da['parentId']+_0x6f9a1f(0x103)+_0x53d847);},_0x679bbf=_0x5c5de2=>{const _0x47d2cf=_0x2362ca;return getConsoleNextUrl(_0x2e3a3[_0x47d2cf(0x137)],_0x47d2cf(0x11b)+_0xeac7da[_0x47d2cf(0x12d)]+_0x47d2cf(0x103)+_0x5c5de2+_0x47d2cf(0xf9));};if(_0x2e3a3[_0x2362ca(0x124)]===_0x2362ca(0xfc)||_0x2e3a3[_0x2362ca(0x124)]===_0x2362ca(0x113))await handleSDKOutput(_0x46cc4c,_0x2e3a3);else{console[_0x2362ca(0x104)](a45_0x48edfd[_0x2362ca(0x10c)]('['+_0x399499+']'));const _0x595347=formatTree(_0x46cc4c,{'showMetadata':!![],'getSegmentUrl':_0x3672ae,'getJourneyUrl':_0x679bbf});console[_0x2362ca(0x104)](_0x595347);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x29eafe=a46_0x8a53;(function(_0x2a619b,_0x32317d){const _0x2dbf9c=a46_0x8a53,_0x25f0d1=_0x2a619b();while(!![]){try{const _0x76441b=parseInt(_0x2dbf9c(0x1fe))/0x1*(-parseInt(_0x2dbf9c(0x1f5))/0x2)+-parseInt(_0x2dbf9c(0x208))/0x3+-parseInt(_0x2dbf9c(0x212))/0x4*(parseInt(_0x2dbf9c(0x209))/0x5)+-parseInt(_0x2dbf9c(0x206))/0x6+parseInt(_0x2dbf9c(0x1ea))/0x7*(parseInt(_0x2dbf9c(0x1f9))/0x8)+-parseInt(_0x2dbf9c(0x20f))/0x9*(-parseInt(_0x2dbf9c(0x1f6))/0xa)+-parseInt(_0x2dbf9c(0x1ed))/0xb*(-parseInt(_0x2dbf9c(0x20c))/0xc);if(_0x76441b===_0x32317d)break;else _0x25f0d1['push'](_0x25f0d1['shift']());}catch(_0x250844){_0x25f0d1['push'](_0x25f0d1['shift']());}}}(a46_0x15dc,0x27946));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';function a46_0x8a53(_0x3ff8bd,_0x1c3372){_0x3ff8bd=_0x3ff8bd-0x1e5;const _0x15dcd3=a46_0x15dc();let _0x8a5334=_0x15dcd3[_0x3ff8bd];return _0x8a5334;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a46_0x15dc(){const _0x4d2108=['Error:\x20','853530nTwBLg','Database:\x20','540330NBHvaU','55355zgEFsk','Limit:\x20','name','156CyUyLx','verbose','Catalog:\x20','212661uZrtMK','cause','site','4hBzPEY','Site:\x20','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','\x20\x20Cause:\x20','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','Table:\x20','84euwdDi','showTable','length','533093EZwJJx','data','...','catalog','Show\x20table\x20contents','database','error','query','18770ElMTvT','20kQgQsd','table','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','72808yEXufu','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Usage:\x20tdx\x20show\x20<database.table>','message','args','31qEHyIY','execute','\x20row','limit','Querying\x20','description','validate'];a46_0x15dc=function(){return _0x4d2108;};return a46_0x15dc();}export class ShowCommand extends BaseCommand{[a46_0x29eafe(0x20b)]='show';[a46_0x29eafe(0x203)]=a46_0x29eafe(0x1f1);async[a46_0x29eafe(0x1ff)](_0x2b5906){const _0x2dfdff=a46_0x29eafe;return this[_0x2dfdff(0x1eb)](_0x2b5906);}async['showTable'](_0x77b0ba){const _0xe42f26=a46_0x29eafe,{options:_0x211d5b,args:_0x19b8cb,tdx:_0x53c96f}=_0x77b0ba;let _0x4c3479;try{_0x4c3479=parseTableReference(_0x19b8cb[0x0]);const _0x5ae6af=_0x211d5b[_0xe42f26(0x1f2)];!_0x4c3479[_0xe42f26(0x1f2)]&&_0x5ae6af&&(_0x4c3479[_0xe42f26(0x1f2)]=_0x5ae6af);const _0x2e4ae0=validateTableDescribeReference(_0x4c3479);if(_0x2e4ae0)return console['error']('Error:\x20'+_0x2e4ae0),console[_0xe42f26(0x1f3)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xe42f26(0x1f3)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0xe42f26(0x1f3)](_0xe42f26(0x1fa)),0x1;}catch(_0x3e07ff){return console['error'](_0xe42f26(0x205)+_0x3e07ff[_0xe42f26(0x1fc)]),console['error'](_0xe42f26(0x1fb)),console[_0xe42f26(0x1f3)](_0xe42f26(0x1f8)),console['error'](_0xe42f26(0x1fa)),0x1;}const _0x12149b=_0x4c3479[_0xe42f26(0x1f0)],_0x16528c=_0x4c3479[_0xe42f26(0x1f2)],_0x5f00de=_0x4c3479[_0xe42f26(0x1f7)],_0x28d4f4=resolveLimit(_0x211d5b[_0xe42f26(0x201)],DEFAULT_DISPLAY_LIMIT);try{_0x211d5b[_0xe42f26(0x20d)]&&(console[_0xe42f26(0x1f3)](_0xe42f26(0x1e5)+_0x211d5b[_0xe42f26(0x211)]),_0x12149b&&console[_0xe42f26(0x1f3)](_0xe42f26(0x20e)+_0x12149b),console[_0xe42f26(0x1f3)](_0xe42f26(0x207)+_0x16528c),console[_0xe42f26(0x1f3)](_0xe42f26(0x1e9)+_0x5f00de),console['error'](_0xe42f26(0x20a)+_0x28d4f4));const _0x2ece19=_0x12149b?_0x12149b+'.'+_0x16528c+'.'+_0x5f00de:_0x16528c+'.'+_0x5f00de,_0xbc8a6c=await withSpinner(_0xe42f26(0x202)+_0x2ece19+_0xe42f26(0x1ef),()=>_0x53c96f[_0xe42f26(0x1f4)][_0xe42f26(0x1eb)](_0x16528c,_0x5f00de,_0x28d4f4,_0x12149b),{'verbose':_0x211d5b['verbose']}),_0xcd603a=_0xbc8a6c[_0xe42f26(0x1ee)],_0x5eeea3=_0xcd603a[_0xe42f26(0x1ee)];return _0x5eeea3[_0xe42f26(0x1ec)]===0x0?console[_0xe42f26(0x1f3)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console['error']('✔\x20Retrieved\x20'+_0x5eeea3['length']+_0xe42f26(0x200)+(_0x5eeea3[_0xe42f26(0x1ec)]!==0x1?'s':'')+'\x20from\x20'+_0x2ece19),await handleSDKOutput(_0x5eeea3,_0x211d5b),0x0;}catch(_0x39cf1e){if(_0x39cf1e instanceof SDKError)return console[_0xe42f26(0x1f3)](_0xe42f26(0x205)+_0x39cf1e[_0xe42f26(0x1fc)]),_0x39cf1e[_0xe42f26(0x210)]&&console[_0xe42f26(0x1f3)](_0xe42f26(0x1e7)+_0x39cf1e[_0xe42f26(0x210)]),0x1;throw _0x39cf1e;}}[a46_0x29eafe(0x204)](_0x3fc607){const _0x169548=a46_0x29eafe;if(_0x3fc607[_0x169548(0x1fd)][_0x169548(0x1ec)]===0x0)return _0x169548(0x1e6);if(_0x3fc607['args'][_0x169548(0x1ec)]>0x1)return _0x169548(0x1e8);return undefined;}}
1
+ const a46_0x5ea505=a46_0x2cd8;function a46_0x2cd8(_0x443ab1,_0x10a127){_0x443ab1=_0x443ab1-0xb6;const _0x512718=a46_0x5127();let _0x2cd891=_0x512718[_0x443ab1];return _0x2cd891;}(function(_0x4fc500,_0x495e0e){const _0x181a61=a46_0x2cd8,_0x379a2c=_0x4fc500();while(!![]){try{const _0x120ca1=parseInt(_0x181a61(0xb9))/0x1+parseInt(_0x181a61(0xba))/0x2*(-parseInt(_0x181a61(0xd9))/0x3)+-parseInt(_0x181a61(0xbc))/0x4+parseInt(_0x181a61(0xcf))/0x5*(-parseInt(_0x181a61(0xd5))/0x6)+-parseInt(_0x181a61(0xc9))/0x7*(parseInt(_0x181a61(0xd3))/0x8)+-parseInt(_0x181a61(0xdc))/0x9+parseInt(_0x181a61(0xd2))/0xa;if(_0x120ca1===_0x495e0e)break;else _0x379a2c['push'](_0x379a2c['shift']());}catch(_0x2d71e3){_0x379a2c['push'](_0x379a2c['shift']());}}}(a46_0x5127,0x6afa5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x5127(){const _0x8f5a3d=['Site:\x20','database','data','Catalog:\x20','description','name','limit','verbose','\x20from\x20','7bWBQkb','Database:\x20','...','error','Show\x20table\x20contents','table','251945pcVyGX','query','message','11474090NGapga','1215296aeGELo','\x20\x20Cause:\x20','6yVuHUC','Error:\x20','site','show','35418qnhLup','showTable','cause','1015659gJInni','catalog','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','✔\x20Retrieved\x20','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','length','Usage:\x20tdx\x20show\x20<database.table>','validate','741317nphEHP','94oRdCBb','args','2322044aNjiDv','Querying\x20','Limit:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'];a46_0x5127=function(){return _0x8f5a3d;};return a46_0x5127();}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_0x5ea505(0xc5)]=a46_0x5ea505(0xd8);[a46_0x5ea505(0xc4)]=a46_0x5ea505(0xcd);async['execute'](_0x536492){const _0x1ddcf7=a46_0x5ea505;return this[_0x1ddcf7(0xda)](_0x536492);}async[a46_0x5ea505(0xda)](_0x5ea6ae){const _0x173a0e=a46_0x5ea505,{options:_0xd183f9,args:_0x1c3ffa,tdx:_0x72fb49}=_0x5ea6ae;let _0x313a5f;try{_0x313a5f=parseTableReference(_0x1c3ffa[0x0]);const _0x5c3999=_0xd183f9[_0x173a0e(0xc1)];!_0x313a5f[_0x173a0e(0xc1)]&&_0x5c3999&&(_0x313a5f[_0x173a0e(0xc1)]=_0x5c3999);const _0x121933=validateTableDescribeReference(_0x313a5f);if(_0x121933)return console[_0x173a0e(0xcc)](_0x173a0e(0xd6)+_0x121933),console[_0x173a0e(0xcc)](_0x173a0e(0xb7)),console[_0x173a0e(0xcc)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x46653){return console[_0x173a0e(0xcc)](_0x173a0e(0xd6)+_0x46653[_0x173a0e(0xd1)]),console[_0x173a0e(0xcc)](_0x173a0e(0xb7)),console[_0x173a0e(0xcc)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x173a0e(0xbf)),0x1;}const _0x49bd02=_0x313a5f[_0x173a0e(0xdd)],_0x10ce71=_0x313a5f[_0x173a0e(0xc1)],_0x517bed=_0x313a5f[_0x173a0e(0xce)],_0x158aaa=resolveLimit(_0xd183f9[_0x173a0e(0xc6)],DEFAULT_DISPLAY_LIMIT);try{_0xd183f9[_0x173a0e(0xc7)]&&(console[_0x173a0e(0xcc)](_0x173a0e(0xc0)+_0xd183f9[_0x173a0e(0xd7)]),_0x49bd02&&console[_0x173a0e(0xcc)](_0x173a0e(0xc3)+_0x49bd02),console[_0x173a0e(0xcc)](_0x173a0e(0xca)+_0x10ce71),console[_0x173a0e(0xcc)]('Table:\x20'+_0x517bed),console[_0x173a0e(0xcc)](_0x173a0e(0xbe)+_0x158aaa));const _0x57a78e=_0x49bd02?_0x49bd02+'.'+_0x10ce71+'.'+_0x517bed:_0x10ce71+'.'+_0x517bed,_0x47e5f5=await withSpinner(_0x173a0e(0xbd)+_0x57a78e+_0x173a0e(0xcb),()=>_0x72fb49[_0x173a0e(0xd0)][_0x173a0e(0xda)](_0x10ce71,_0x517bed,_0x158aaa,_0x49bd02),{'verbose':_0xd183f9[_0x173a0e(0xc7)]}),_0xf1b154=_0x47e5f5[_0x173a0e(0xc2)],_0x4a21b2=_0xf1b154[_0x173a0e(0xc2)];return _0x4a21b2[_0x173a0e(0xb6)]===0x0?console[_0x173a0e(0xcc)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x173a0e(0xcc)](_0x173a0e(0xdf)+_0x4a21b2[_0x173a0e(0xb6)]+'\x20row'+(_0x4a21b2['length']!==0x1?'s':'')+_0x173a0e(0xc8)+_0x57a78e),await handleSDKOutput(_0x4a21b2,_0xd183f9),0x0;}catch(_0x4ed2bf){if(_0x4ed2bf instanceof SDKError)return console[_0x173a0e(0xcc)]('Error:\x20'+_0x4ed2bf[_0x173a0e(0xd1)]),_0x4ed2bf[_0x173a0e(0xdb)]&&console[_0x173a0e(0xcc)](_0x173a0e(0xd4)+_0x4ed2bf[_0x173a0e(0xdb)]),0x1;throw _0x4ed2bf;}}[a46_0x5ea505(0xb8)](_0x3c264a){const _0x3f8ae2=a46_0x5ea505;if(_0x3c264a[_0x3f8ae2(0xbb)]['length']===0x0)return _0x3f8ae2(0xe0);if(_0x3c264a[_0x3f8ae2(0xbb)]['length']>0x1)return _0x3f8ae2(0xde);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x1ea7fa=a47_0x27d3;(function(_0xd9bc1d,_0x39c873){const _0x3ef412=a47_0x27d3,_0x2a91c3=_0xd9bc1d();while(!![]){try{const _0x11aee3=-parseInt(_0x3ef412(0xf8))/0x1+-parseInt(_0x3ef412(0x115))/0x2+parseInt(_0x3ef412(0x102))/0x3+parseInt(_0x3ef412(0x110))/0x4+parseInt(_0x3ef412(0xfa))/0x5+-parseInt(_0x3ef412(0x101))/0x6*(parseInt(_0x3ef412(0x123))/0x7)+parseInt(_0x3ef412(0x116))/0x8;if(_0x11aee3===_0x39c873)break;else _0x2a91c3['push'](_0x2a91c3['shift']());}catch(_0x5c05fc){_0x2a91c3['push'](_0x2a91c3['shift']());}}}(a47_0x5660,0x6d7c6));import{BaseCommand,printAuthError}from'./command.js';function a47_0x5660(){const _0x2d36b6=['displayWithSources','700656JoItXK','green','1574870txJjve','jobs','Read\x20credential\x20from\x20','last_name','tdx','first_name','yellow','12xmvBdu','1883514SAZIrb','profile','\x20profile:\x20','User:','config','log','N/A','account_id','session','✓\x20Authentication\x20successful\x0a','Name:','site:\x20','getUserInfo','execute','3566488atjAcA','Show\x20authentication\x20status\x20and\x20current\x20context','cyan','No\x20credential\x20found','email','612010xlwgNz','1525304WldZFh','name','profileSource','cli','Credential\x20type:\x20','env','red','message','description','✗\x20Validation\x20failed:\x20','OAuth','dim','join','1994937bPLdul','bold','Account\x20ID:'];a47_0x5660=function(){return _0x2d36b6;};return a47_0x5660();}function a47_0x27d3(_0x40815e,_0xe65e23){_0x40815e=_0x40815e-0xf5;const _0x56606f=a47_0x5660();let _0x27d370=_0x56606f[_0x40815e];return _0x27d370;}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_0x51c7e1 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1ea7fa(0x117)]='status';[a47_0x1ea7fa(0x11e)]=a47_0x1ea7fa(0x111);async[a47_0x1ea7fa(0x10f)](_0x2433f2){const _0xcf2b52=a47_0x1ea7fa,{options:_0xe10298,tdx:_0x10d844}=_0x2433f2,_0x48802f=_0xe10298['site'],_0xa3b7b6=new GlobalContext(_0xe10298),_0x2d9a73=_0xa3b7b6[_0xcf2b52(0x103)],_0x406635=_0xa3b7b6[_0xcf2b52(0x118)],_0x324df2=_0x406635===_0xcf2b52(0x119)?'CLI\x20flag':_0x406635==='session'?_0xcf2b52(0x10a):_0x406635===_0xcf2b52(0x11b)?'TDX_PROFILE\x20env':_0x406635===_0xcf2b52(0x106)?_0xcf2b52(0x106):null,_0x59b9b0=_0x2d9a73?a47_0x51c7e1['cyan'](_0x2d9a73):a47_0x51c7e1[_0xcf2b52(0x121)](_0xcf2b52(0x108)),_0x3f3a47=_0x324df2?'\x20'+a47_0x51c7e1[_0xcf2b52(0x121)]('(from\x20'+_0x324df2+')'):'';console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0xf5)](_0xcf2b52(0xfe))+_0xcf2b52(0x104)+_0x59b9b0+_0x3f3a47+'\x20'+a47_0x51c7e1['dim']('(')+_0xcf2b52(0x10d)+a47_0x51c7e1[_0xcf2b52(0x112)](_0x48802f)+a47_0x51c7e1[_0xcf2b52(0x121)](')'));const _0x462210=await getOAuthTokens(_0x2d9a73);if(_0x462210)console[_0xcf2b52(0x107)](_0xcf2b52(0x11a)+a47_0x51c7e1[_0xcf2b52(0x112)](_0xcf2b52(0x120)));else{const _0x246ea6=await resolveAPIKeyAsync(_0x48802f,_0x2d9a73);if(_0x246ea6){const {source:_0x39a9d4,isDeprecated:_0x18bb63}=_0x246ea6,_0x3a7f5e=_0xcf2b52(0xfc)+a47_0x51c7e1[_0xcf2b52(0x112)](_0x39a9d4);console['log'](_0x18bb63?a47_0x51c7e1[_0xcf2b52(0x100)](_0x3a7f5e):_0x3a7f5e);}else console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0x100)](_0xcf2b52(0x113)));}let _0x4ff258=![];try{const _0x35777d=await _0x10d844[_0xcf2b52(0xfb)][_0xcf2b52(0x10e)]();console['log'](a47_0x51c7e1[_0xcf2b52(0xf9)](_0xcf2b52(0x10b))),console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0xf5)](_0xcf2b52(0x105))+'\x20'+a47_0x51c7e1[_0xcf2b52(0x112)](_0x35777d[_0xcf2b52(0x114)]));if(_0x35777d[_0xcf2b52(0xff)]||_0x35777d[_0xcf2b52(0xfd)]){const _0x3a1ee3=[_0x35777d['first_name'],_0x35777d[_0xcf2b52(0xfd)]]['filter'](Boolean)[_0xcf2b52(0x122)]('\x20');console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0xf5)](_0xcf2b52(0x10c))+'\x20'+_0x3a1ee3);}_0x35777d[_0xcf2b52(0x109)]&&console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0xf5)](_0xcf2b52(0xf6))+'\x20'+a47_0x51c7e1[_0xcf2b52(0x100)](_0x35777d['account_id'])),_0x4ff258=!![];}catch(_0x1ac55f){_0x1ac55f instanceof HTTPClientError&&_0x1ac55f['status']===0x191?printAuthError(_0x1ac55f,!![],_0x2d9a73):console['error'](a47_0x51c7e1[_0xcf2b52(0x11c)](_0xcf2b52(0x11f)+(_0x1ac55f instanceof Error?_0x1ac55f[_0xcf2b52(0x11d)]:String(_0x1ac55f))));}return console[_0xcf2b52(0x107)](),_0xa3b7b6[_0xcf2b52(0xf7)](),_0x4ff258?0x0:0x1;}}
1
+ function a47_0x49f1(){const _0x4031e1=['profileSource','red','Credential\x20type:\x20','first_name','No\x20credential\x20found','Read\x20credential\x20from\x20','OAuth','config','error','2koMtBF','✓\x20Authentication\x20successful\x0a','tdx','jobs','N/A','email','bold','description','cli','2899233XoRcdk','5529600LqnPpM','yellow','✗\x20Validation\x20failed:\x20','514172eVBpdY','TDX_PROFILE\x20env','name','execute','310vfwVYH','cyan','join','session','Account\x20ID:','1243877VbZvnu','displayWithSources','2905yHjKHv','dim','4638abtXdH','7025328wUGWum','6czSdpY','status','getUserInfo','\x20profile:\x20','green','log','account_id','1294249kNkLZx','filter','Show\x20authentication\x20status\x20and\x20current\x20context','last_name'];a47_0x49f1=function(){return _0x4031e1;};return a47_0x49f1();}const a47_0x4e380d=a47_0x5eaf;(function(_0x5128b4,_0x565a90){const _0x5d5184=a47_0x5eaf,_0x5812a2=_0x5128b4();while(!![]){try{const _0x7e1046=-parseInt(_0x5d5184(0x168))/0x1*(parseInt(_0x5d5184(0x152))/0x2)+-parseInt(_0x5d5184(0x16e))/0x3*(-parseInt(_0x5d5184(0x15f))/0x4)+-parseInt(_0x5d5184(0x15c))/0x5+-parseInt(_0x5d5184(0x16c))/0x6*(parseInt(_0x5d5184(0x16a))/0x7)+-parseInt(_0x5d5184(0x16d))/0x8+parseInt(_0x5d5184(0x15b))/0x9+-parseInt(_0x5d5184(0x163))/0xa*(-parseInt(_0x5d5184(0x175))/0xb);if(_0x7e1046===_0x565a90)break;else _0x5812a2['push'](_0x5812a2['shift']());}catch(_0x3bc57a){_0x5812a2['push'](_0x5812a2['shift']());}}}(a47_0x49f1,0xa5806));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x5eaf(_0x148b22,_0x468f61){_0x148b22=_0x148b22-0x150;const _0x49f1a0=a47_0x49f1();let _0x5eaf4f=_0x49f1a0[_0x148b22];return _0x5eaf4f;}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x29e0e5 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x4e380d(0x161)]=a47_0x4e380d(0x16f);[a47_0x4e380d(0x159)]=a47_0x4e380d(0x177);async[a47_0x4e380d(0x162)](_0x24fc21){const _0x3ed08f=a47_0x4e380d,{options:_0x575613,tdx:_0x10b804}=_0x24fc21,_0x5e5c3b=_0x575613['site'],_0x24f74d=new GlobalContext(_0x575613),_0x2cbdaf=_0x24f74d['profile'],_0x16b335=_0x24f74d[_0x3ed08f(0x179)],_0x205587=_0x16b335===_0x3ed08f(0x15a)?'CLI\x20flag':_0x16b335==='session'?_0x3ed08f(0x166):_0x16b335==='env'?_0x3ed08f(0x160):_0x16b335===_0x3ed08f(0x150)?'config':null,_0x339aaf=_0x2cbdaf?a47_0x29e0e5[_0x3ed08f(0x164)](_0x2cbdaf):a47_0x29e0e5['dim'](_0x3ed08f(0x156)),_0x18e93d=_0x205587?'\x20'+a47_0x29e0e5['dim']('(from\x20'+_0x205587+')'):'';console[_0x3ed08f(0x173)](a47_0x29e0e5[_0x3ed08f(0x158)](_0x3ed08f(0x154))+_0x3ed08f(0x171)+_0x339aaf+_0x18e93d+'\x20'+a47_0x29e0e5['dim']('(')+'site:\x20'+a47_0x29e0e5[_0x3ed08f(0x164)](_0x5e5c3b)+a47_0x29e0e5[_0x3ed08f(0x16b)](')'));const _0x3e0ec2=await getOAuthTokens(_0x2cbdaf);if(_0x3e0ec2)console['log'](_0x3ed08f(0x17b)+a47_0x29e0e5[_0x3ed08f(0x164)](_0x3ed08f(0x17f)));else{const _0x2c32df=await resolveAPIKeyAsync(_0x5e5c3b,_0x2cbdaf);if(_0x2c32df){const {source:_0x1a0bea,isDeprecated:_0x3cf42b}=_0x2c32df,_0x24eaef=_0x3ed08f(0x17e)+a47_0x29e0e5[_0x3ed08f(0x164)](_0x1a0bea);console['log'](_0x3cf42b?a47_0x29e0e5[_0x3ed08f(0x15d)](_0x24eaef):_0x24eaef);}else console[_0x3ed08f(0x173)](a47_0x29e0e5[_0x3ed08f(0x15d)](_0x3ed08f(0x17d)));}let _0x492c03=![];try{const _0xb97e8=await _0x10b804[_0x3ed08f(0x155)][_0x3ed08f(0x170)]();console['log'](a47_0x29e0e5[_0x3ed08f(0x172)](_0x3ed08f(0x153))),console['log'](a47_0x29e0e5[_0x3ed08f(0x158)]('User:')+'\x20'+a47_0x29e0e5[_0x3ed08f(0x164)](_0xb97e8[_0x3ed08f(0x157)]));if(_0xb97e8[_0x3ed08f(0x17c)]||_0xb97e8[_0x3ed08f(0x178)]){const _0x4daa00=[_0xb97e8[_0x3ed08f(0x17c)],_0xb97e8[_0x3ed08f(0x178)]][_0x3ed08f(0x176)](Boolean)[_0x3ed08f(0x165)]('\x20');console[_0x3ed08f(0x173)](a47_0x29e0e5['bold']('Name:')+'\x20'+_0x4daa00);}_0xb97e8['account_id']&&console[_0x3ed08f(0x173)](a47_0x29e0e5[_0x3ed08f(0x158)](_0x3ed08f(0x167))+'\x20'+a47_0x29e0e5[_0x3ed08f(0x15d)](_0xb97e8[_0x3ed08f(0x174)])),_0x492c03=!![];}catch(_0x198f53){_0x198f53 instanceof HTTPClientError&&_0x198f53[_0x3ed08f(0x16f)]===0x191?printAuthError(_0x198f53,!![],_0x2cbdaf):console[_0x3ed08f(0x151)](a47_0x29e0e5[_0x3ed08f(0x17a)](_0x3ed08f(0x15e)+(_0x198f53 instanceof Error?_0x198f53['message']:String(_0x198f53))));}return console[_0x3ed08f(0x173)](),_0x24f74d[_0x3ed08f(0x169)](),_0x492c03?0x0:0x1;}}