@treasuredata/tdx 2026.3.54 → 2026.3.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
- const a23_0x193716=a23_0x1665;(function(_0x48f4fe,_0x49cf34){const _0x245553=a23_0x1665,_0x57b232=_0x48f4fe();while(!![]){try{const _0x15663b=parseInt(_0x245553(0x137))/0x1+parseInt(_0x245553(0x135))/0x2*(-parseInt(_0x245553(0x12f))/0x3)+-parseInt(_0x245553(0x110))/0x4*(-parseInt(_0x245553(0x139))/0x5)+parseInt(_0x245553(0x116))/0x6*(-parseInt(_0x245553(0x149))/0x7)+-parseInt(_0x245553(0x114))/0x8*(-parseInt(_0x245553(0x10e))/0x9)+parseInt(_0x245553(0x121))/0xa+-parseInt(_0x245553(0x144))/0xb*(parseInt(_0x245553(0x10f))/0xc);if(_0x15663b===_0x49cf34)break;else _0x57b232['push'](_0x57b232['shift']());}catch(_0x34f5ef){_0x57b232['push'](_0x57b232['shift']());}}}(a23_0x4a8f,0x32e8e));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a23_0x1665(_0xeb02c9,_0xa66657){_0xeb02c9=_0xeb02c9-0x10d;const _0x4a8f2f=a23_0x4a8f();let _0x1665f6=_0x4a8f2f[_0xeb02c9];return _0x1665f6;}import a23_0x26c0a3 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x38cf8f from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x193716(0x126)]='engage:template:pull';[a23_0x193716(0x148)]=a23_0x193716(0x112);async['execute'](_0x41bea8){const _0x4cc23b=a23_0x193716,{options:_0x2c5063,args:_0x5990ba,tdx:_0x20be03}=_0x41bea8,_0x20f5ee=_0x2c5063,_0x1a1bcb=await resolveWorkspaceName(_0x5990ba[0x0],_0x20f5ee);if(!_0x1a1bcb)return console['error'](a23_0x26c0a3[_0x4cc23b(0x11d)](_0x4cc23b(0x11a))),console[_0x4cc23b(0x13d)](_0x4cc23b(0x117)),console[_0x4cc23b(0x13d)](_0x4cc23b(0x11e)),console[_0x4cc23b(0x13d)](_0x4cc23b(0x12d)),0x1;const _0x54253a=await withProgressSpinner(_0x4cc23b(0x146)+_0x1a1bcb+_0x4cc23b(0x11c),_0x423e2d=>pullTemplates({'engage':_0x20be03[_0x4cc23b(0x134)]},_0x1a1bcb,{'templateName':_0x20f5ee[_0x4cc23b(0x126)],'progress':{'update':_0x191258=>{const _0xf9c298=_0x4cc23b;_0x423e2d[_0xf9c298(0x12e)](_0x191258);}}}),{'verbose':_0x20f5ee[_0x4cc23b(0x124)]}),_0x1c4a7d=_0x54253a[_0x4cc23b(0x113)];if(_0x1c4a7d[_0x4cc23b(0x130)][_0x4cc23b(0x13e)]===0x0)return console[_0x4cc23b(0x13d)](a23_0x26c0a3[_0x4cc23b(0x11d)]('No\x20templates\x20found\x20in\x20workspace\x20\x27'+_0x1c4a7d[_0x4cc23b(0x13b)]+'\x27')),0x0;const _0x38014a=_0x1c4a7d[_0x4cc23b(0x14b)][_0x4cc23b(0x127)](_0x5e70ff=>_0x5e70ff[_0x4cc23b(0x10d)]),_0x5cfbd4=_0x1c4a7d[_0x4cc23b(0x14b)][_0x4cc23b(0x127)](_0x27e81c=>!_0x27e81c['isNew']&&_0x27e81c[_0x4cc23b(0x140)]),_0x27b0fe=_0x1c4a7d['files'][_0x4cc23b(0x127)](_0x5381ce=>!_0x5381ce['isNew']&&!_0x5381ce[_0x4cc23b(0x140)]);console[_0x4cc23b(0x13d)](_0x4cc23b(0x12b)+_0x1c4a7d[_0x4cc23b(0x13b)]+'\x27:'),console[_0x4cc23b(0x13d)]('\x20\x20'+a23_0x26c0a3[_0x4cc23b(0x12c)](_0x1c4a7d[_0x4cc23b(0x130)][_0x4cc23b(0x13e)]+_0x4cc23b(0x138))),console['error']('\x20\x20'+a23_0x26c0a3['green']('+\x20'+_0x38014a[_0x4cc23b(0x111)]+_0x4cc23b(0x147))),console[_0x4cc23b(0x13d)]('\x20\x20'+a23_0x26c0a3[_0x4cc23b(0x11d)]('~\x20'+_0x5cfbd4[_0x4cc23b(0x111)]+_0x4cc23b(0x119))),console[_0x4cc23b(0x13d)]('\x20\x20'+a23_0x26c0a3[_0x4cc23b(0x13a)]('=\x20'+_0x27b0fe[_0x4cc23b(0x111)]+_0x4cc23b(0x141))),console[_0x4cc23b(0x13d)]('\x20\x20Target:\x20'+a23_0x26c0a3['cyan'](_0x1c4a7d[_0x4cc23b(0x13c)])+'\x0a');if(_0x5cfbd4[_0x4cc23b(0x111)]>0x0)for(const _0x1543e8 of _0x5cfbd4){console[_0x4cc23b(0x13d)](_0x4cc23b(0x115)+_0x1543e8[_0x4cc23b(0x14a)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x4cc23b(0x13d)](_0x1543e8[_0x4cc23b(0x14c)]),console['error']('─'[_0x4cc23b(0x129)](0x3c));}if(_0x20f5ee['dryRun'])return console[_0x4cc23b(0x13d)](a23_0x26c0a3[_0x4cc23b(0x11d)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x38014a[_0x4cc23b(0x111)]===0x0&&_0x5cfbd4['length']===0x0)return console[_0x4cc23b(0x13d)](a23_0x26c0a3['green'](_0x4cc23b(0x132))),saveSessionContext({'engage_workspace':_0x1c4a7d[_0x4cc23b(0x13b)]},_0x20f5ee['session']),0x0;if(!_0x20f5ee['yes']){if(!isInteractive())return console[_0x4cc23b(0x13d)](a23_0x26c0a3[_0x4cc23b(0x136)]('\x0aError:'),_0x4cc23b(0x143)),console[_0x4cc23b(0x13d)](a23_0x26c0a3[_0x4cc23b(0x13a)](_0x4cc23b(0x13f))),0x1;const _0x445d22=await confirmKey(_0x4cc23b(0x118)+(_0x38014a[_0x4cc23b(0x111)]+_0x5cfbd4['length'])+_0x4cc23b(0x133));if(!_0x445d22)return console[_0x4cc23b(0x13d)](a23_0x26c0a3[_0x4cc23b(0x11d)]('Aborted.'),_0x4cc23b(0x12a)),0x1;}for(const _0x5a77f8 of _0x1c4a7d[_0x4cc23b(0x14b)]){if(_0x5a77f8[_0x4cc23b(0x10d)]||_0x5a77f8[_0x4cc23b(0x140)]){const _0x2b96ec=a23_0x38cf8f[_0x4cc23b(0x131)](_0x5a77f8[_0x4cc23b(0x145)]);!existsSync(_0x2b96ec)&&mkdirSync(_0x2b96ec,{'recursive':!![]}),writeFileSync(_0x5a77f8[_0x4cc23b(0x145)],_0x5a77f8['content'],'utf-8');}}return console[_0x4cc23b(0x13d)](a23_0x26c0a3[_0x4cc23b(0x11f)](_0x4cc23b(0x11b)+(_0x38014a[_0x4cc23b(0x111)]+_0x5cfbd4[_0x4cc23b(0x111)])+'\x20files\x20to\x20'+_0x1c4a7d[_0x4cc23b(0x13c)])),saveSessionContext({'engage_workspace':_0x1c4a7d['workspaceName']},_0x20f5ee['session']),console['error'](a23_0x26c0a3[_0x4cc23b(0x11f)]('✔\x20Context\x20set:\x20'+a23_0x26c0a3[_0x4cc23b(0x13a)](_0x4cc23b(0x122))+_0x4cc23b(0x125)+a23_0x26c0a3[_0x4cc23b(0x12c)](_0x1c4a7d[_0x4cc23b(0x13b)]))),0x0;}}function a23_0x4a8f(){const _0x2a5af1=['Pull\x20templates\x20to\x20YAML\x20files','data','87200ZqnPXF','\x0aChanges\x20to\x20\x27','60042BbgTOG','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','Write\x20','\x20changed\x20files','Workspace\x20is\x20required.','✔\x20Pulled\x20','\x27...','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','green','session','2391600HQxajh','engage_workspace','workspace','verbose','\x20=\x20','name','filter','cwd','repeat','-\x20no\x20files\x20written','\x0aPull\x20summary\x20for\x20workspace\x20\x27','cyan','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','setPhase','205347xTNPly','counts','dirname','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20files?','engage','10hnISIt','red','390135USdXQD','\x20templates','5UbEcyJ','dim','workspaceName','targetDir','error','templates','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasChanges','\x20unchanged\x20files','config','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','35431nHAXZc','absolutePath','Pulling\x20templates\x20from\x20\x27','\x20new\x20files','description','42dcxkpp','relativePath','files','diff','isNew','18uVjOBx','708ZuuXWE','599028tqsJvw','length'];a23_0x4a8f=function(){return _0x2a5af1;};return a23_0x4a8f();}async function resolveWorkspaceName(_0x277dec,_0x5ac093){const _0x468d16=a23_0x193716;if(_0x277dec)return _0x277dec;if(_0x5ac093['workspace'])return _0x5ac093[_0x468d16(0x123)];const _0x5d8c19=tryFindTdxConfig(process[_0x468d16(0x128)]());if(_0x5d8c19?.[_0x468d16(0x142)][_0x468d16(0x122)])return _0x5d8c19['config'][_0x468d16(0x122)];const _0x2de0ee=loadSessionContext(_0x5ac093[_0x468d16(0x120)]);if(_0x2de0ee?.['engage_workspace'])return _0x2de0ee['engage_workspace'];return undefined;}
1
+ const a23_0x3bd4a4=a23_0x5862;(function(_0x555c0,_0x4a8023){const _0x2af7fc=a23_0x5862,_0x4ba022=_0x555c0();while(!![]){try{const _0x9fed87=parseInt(_0x2af7fc(0xd8))/0x1*(-parseInt(_0x2af7fc(0xe3))/0x2)+parseInt(_0x2af7fc(0xe5))/0x3+-parseInt(_0x2af7fc(0xd9))/0x4+-parseInt(_0x2af7fc(0xeb))/0x5*(parseInt(_0x2af7fc(0xd1))/0x6)+parseInt(_0x2af7fc(0xbb))/0x7*(-parseInt(_0x2af7fc(0xc1))/0x8)+parseInt(_0x2af7fc(0xc7))/0x9+parseInt(_0x2af7fc(0xf7))/0xa*(parseInt(_0x2af7fc(0xdb))/0xb);if(_0x9fed87===_0x4a8023)break;else _0x4ba022['push'](_0x4ba022['shift']());}catch(_0x2ce329){_0x4ba022['push'](_0x4ba022['shift']());}}}(a23_0x2c76,0xbeb45));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a23_0x2c76(){const _0x473b1a=['dirname','templates','\x20new\x20files','8PCiWwv','isNew','content','absolutePath','workspaceName','dryRun','10661976fQNLke','yes','workspace','description','-\x20no\x20files\x20written','engage','\x0aChanges\x20to\x20\x27','green','Write\x20','hasChanges','360aHtEXf','\x20\x20Target:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','filter','diff','relativePath','utf-8','12plmUes','320060sFPhUt','data','11izfMLk','Pull\x20templates\x20to\x20YAML\x20files','cyan','\x20files\x20to\x20','\x20=\x20','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','session','✔\x20Pulled\x20','92152fXwwzu','\x20files?','188952vkSxVJ','No\x20templates\x20found\x20in\x20workspace\x20\x27','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','length','\x20templates','25120SJFwBN','error','cwd','\x20unchanged\x20files','counts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','config','repeat','yellow','verbose','dim','engage_workspace','7716550UpIinx','\x0aPull\x20summary\x20for\x20workspace\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','2126677PwZIeX','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','files'];a23_0x2c76=function(){return _0x473b1a;};return a23_0x2c76();}function a23_0x5862(_0x27f4ee,_0x36bc93){_0x27f4ee=_0x27f4ee-0xb8;const _0x2c764e=a23_0x2c76();let _0x5862f0=_0x2c764e[_0x27f4ee];return _0x5862f0;}import a23_0x45c048 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x5898b4 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x3bd4a4(0xe7)]='engage:template:pull';[a23_0x3bd4a4(0xca)]=a23_0x3bd4a4(0xdc);async['execute'](_0x5b6fad){const _0x5c8291=a23_0x3bd4a4,{options:_0x432d62,args:_0x9a9da9,tdx:_0x1788b1}=_0x5b6fad,_0x3a3c32=_0x432d62,_0x4a5c55=await resolveWorkspaceName(_0x9a9da9[0x0],_0x3a3c32);if(!_0x4a5c55)return console['error'](a23_0x45c048['yellow']('Workspace\x20is\x20required.')),console[_0x5c8291(0xec)](_0x5c8291(0xba)),console[_0x5c8291(0xec)](_0x5c8291(0xe8)),console[_0x5c8291(0xec)](_0x5c8291(0xe0)),0x1;const _0x423116=await withProgressSpinner('Pulling\x20templates\x20from\x20\x27'+_0x4a5c55+'\x27...',_0x3b2d1c=>pullTemplates({'engage':_0x1788b1[_0x5c8291(0xcc)]},_0x4a5c55,{'templateName':_0x3a3c32[_0x5c8291(0xe7)],'progress':{'update':_0x2d66e1=>{_0x3b2d1c['setPhase'](_0x2d66e1);}}}),{'verbose':_0x3a3c32[_0x5c8291(0xf4)]}),_0x3c0194=_0x423116[_0x5c8291(0xda)];if(_0x3c0194['counts'][_0x5c8291(0xbf)]===0x0)return console[_0x5c8291(0xec)](a23_0x45c048[_0x5c8291(0xf3)](_0x5c8291(0xe6)+_0x3c0194[_0x5c8291(0xc5)]+'\x27')),0x0;const _0x489af6=_0x3c0194[_0x5c8291(0xbd)][_0x5c8291(0xd4)](_0x3e44bc=>_0x3e44bc[_0x5c8291(0xc2)]),_0x1c70c1=_0x3c0194[_0x5c8291(0xbd)][_0x5c8291(0xd4)](_0x3fd48a=>!_0x3fd48a['isNew']&&_0x3fd48a[_0x5c8291(0xd0)]),_0x2e4ef8=_0x3c0194[_0x5c8291(0xbd)][_0x5c8291(0xd4)](_0x38329d=>!_0x38329d[_0x5c8291(0xc2)]&&!_0x38329d[_0x5c8291(0xd0)]);console[_0x5c8291(0xec)](_0x5c8291(0xb8)+_0x3c0194[_0x5c8291(0xc5)]+'\x27:'),console[_0x5c8291(0xec)]('\x20\x20'+a23_0x45c048[_0x5c8291(0xdd)](_0x3c0194[_0x5c8291(0xef)][_0x5c8291(0xbf)]+_0x5c8291(0xea))),console[_0x5c8291(0xec)]('\x20\x20'+a23_0x45c048['green']('+\x20'+_0x489af6[_0x5c8291(0xe9)]+_0x5c8291(0xc0))),console[_0x5c8291(0xec)]('\x20\x20'+a23_0x45c048[_0x5c8291(0xf3)]('~\x20'+_0x1c70c1[_0x5c8291(0xe9)]+'\x20changed\x20files')),console['error']('\x20\x20'+a23_0x45c048[_0x5c8291(0xf5)]('=\x20'+_0x2e4ef8[_0x5c8291(0xe9)]+_0x5c8291(0xee))),console[_0x5c8291(0xec)](_0x5c8291(0xd2)+a23_0x45c048[_0x5c8291(0xdd)](_0x3c0194['targetDir'])+'\x0a');if(_0x1c70c1[_0x5c8291(0xe9)]>0x0)for(const _0x412052 of _0x1c70c1){console[_0x5c8291(0xec)](_0x5c8291(0xcd)+_0x412052[_0x5c8291(0xd6)]+'\x27:'),console[_0x5c8291(0xec)]('─'['repeat'](0x3c)),console[_0x5c8291(0xec)](_0x412052[_0x5c8291(0xd5)]),console[_0x5c8291(0xec)]('─'[_0x5c8291(0xf2)](0x3c));}if(_0x3a3c32[_0x5c8291(0xc6)])return console[_0x5c8291(0xec)](a23_0x45c048[_0x5c8291(0xf3)](_0x5c8291(0xbc))),0x0;if(_0x489af6['length']===0x0&&_0x1c70c1['length']===0x0)return console[_0x5c8291(0xec)](a23_0x45c048[_0x5c8291(0xce)](_0x5c8291(0xb9))),saveSessionContext({'engage_workspace':_0x3c0194[_0x5c8291(0xc5)]},_0x3a3c32['session']),0x0;if(!_0x3a3c32[_0x5c8291(0xc8)]){if(!isInteractive())return console[_0x5c8291(0xec)](a23_0x45c048['red']('\x0aError:'),_0x5c8291(0xf0)),console[_0x5c8291(0xec)](a23_0x45c048['dim'](_0x5c8291(0xd3))),0x1;const _0x1db27=await confirmKey(_0x5c8291(0xcf)+(_0x489af6['length']+_0x1c70c1[_0x5c8291(0xe9)])+_0x5c8291(0xe4));if(!_0x1db27)return console[_0x5c8291(0xec)](a23_0x45c048['yellow']('Aborted.'),_0x5c8291(0xcb)),0x1;}for(const _0x44cdb2 of _0x3c0194['files']){if(_0x44cdb2[_0x5c8291(0xc2)]||_0x44cdb2[_0x5c8291(0xd0)]){const _0x3b8e61=a23_0x5898b4[_0x5c8291(0xbe)](_0x44cdb2['absolutePath']);!existsSync(_0x3b8e61)&&mkdirSync(_0x3b8e61,{'recursive':!![]}),writeFileSync(_0x44cdb2[_0x5c8291(0xc4)],_0x44cdb2[_0x5c8291(0xc3)],_0x5c8291(0xd7));}}return console[_0x5c8291(0xec)](a23_0x45c048[_0x5c8291(0xce)](_0x5c8291(0xe2)+(_0x489af6[_0x5c8291(0xe9)]+_0x1c70c1['length'])+_0x5c8291(0xde)+_0x3c0194['targetDir'])),saveSessionContext({'engage_workspace':_0x3c0194['workspaceName']},_0x3a3c32[_0x5c8291(0xe1)]),console[_0x5c8291(0xec)](a23_0x45c048[_0x5c8291(0xce)]('✔\x20Context\x20set:\x20'+a23_0x45c048[_0x5c8291(0xf5)](_0x5c8291(0xf6))+_0x5c8291(0xdf)+a23_0x45c048[_0x5c8291(0xdd)](_0x3c0194[_0x5c8291(0xc5)]))),0x0;}}async function resolveWorkspaceName(_0x5adebe,_0x491bbd){const _0x55a3da=a23_0x3bd4a4;if(_0x5adebe)return _0x5adebe;if(_0x491bbd['workspace'])return _0x491bbd[_0x55a3da(0xc9)];const _0x149474=tryFindTdxConfig(process[_0x55a3da(0xed)]());if(_0x149474?.[_0x55a3da(0xf1)][_0x55a3da(0xf6)])return _0x149474[_0x55a3da(0xf1)][_0x55a3da(0xf6)];const _0x4f7696=loadSessionContext(_0x491bbd[_0x55a3da(0xe1)]);if(_0x4f7696?.[_0x55a3da(0xf6)])return _0x4f7696[_0x55a3da(0xf6)];return undefined;}
@@ -1 +1 @@
1
- const a24_0x8033de=a24_0x37e5;(function(_0x56bcc2,_0x1089d1){const _0x27e092=a24_0x37e5,_0x1d211a=_0x56bcc2();while(!![]){try{const _0x28e00c=-parseInt(_0x27e092(0xde))/0x1*(-parseInt(_0x27e092(0xe9))/0x2)+-parseInt(_0x27e092(0x100))/0x3*(parseInt(_0x27e092(0xec))/0x4)+parseInt(_0x27e092(0xfa))/0x5+parseInt(_0x27e092(0xe0))/0x6*(-parseInt(_0x27e092(0xf6))/0x7)+parseInt(_0x27e092(0xd0))/0x8*(parseInt(_0x27e092(0xd8))/0x9)+-parseInt(_0x27e092(0xe3))/0xa+parseInt(_0x27e092(0xbd))/0xb;if(_0x28e00c===_0x1089d1)break;else _0x1d211a['push'](_0x1d211a['shift']());}catch(_0x408a72){_0x1d211a['push'](_0x1d211a['shift']());}}}(a24_0x15df,0xc007d));import{BaseCommand}from'./command.js';function a24_0x15df(){const _0x55387b=['16458222JIZeFp','message','Aborted.','filter','update','resolveWorkspaceId','cwd','red','\x20new\x20templates:','\x0aError:','templateId','Preparing\x20push\x20to\x20workspace\x20\x27','verbose','dryRun','dim','\x27...','green','\x20\x20\x20\x20','workspace','11992PCtXlF','✔\x20Created\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','config','setPhase','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','engage','yellow','6111ZXAQDq','length','execute','resolve','No\x20template\x20YAML\x20files\x20found\x20in\x20','Resolving\x20references...','77Xwttyi','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2382cAALIv','engage_workspace','created','15421690PHVwWr','data','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','errors','1\x20template\x20file:\x20','Found\x20','27758bhiHSv','Workspace\x20is\x20required.','description','1076nkWggl','error','path','create','\x20templates','name','\x20errors:','action','site','session','10423xuVLqw','\x20templates?','Pushing\x20templates...','✔\x20Updated\x20','4036190BaElsA','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','cyan','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','def','16395eOVWdV','-\x20no\x20changes\x20applied','results','updated','valid','relativePath','yes','warnings','\x0aValidation\x20errors\x20in\x20'];a24_0x15df=function(){return _0x55387b;};return a24_0x15df();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x129c70 from'chalk';import a24_0x127784 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';function a24_0x37e5(_0x986465,_0x59d6c0){_0x986465=_0x986465-0xbc;const _0x15df5d=a24_0x15df();let _0x37e55c=_0x15df5d[_0x986465];return _0x37e55c;}import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x8033de(0xf1)]='engage:template:push';[a24_0x8033de(0xeb)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x8033de(0xda)](_0x7bafa6){const _0x3ace9c=a24_0x8033de,{options:_0x1a7207,args:_0x50244d,tdx:_0x3a3f65}=_0x7bafa6,_0x40c7d1=_0x1a7207,_0x13d60e=_0x50244d[0x0],_0x4a16b7=_0x13d60e?a24_0x127784[_0x3ace9c(0xdb)](_0x13d60e):undefined,_0x1dde34=_0x4a16b7?isYamlFile(_0x4a16b7):![];let _0x5eb842;if(_0x1dde34&&_0x4a16b7)_0x5eb842=a24_0x127784['dirname'](_0x4a16b7);else _0x4a16b7?_0x5eb842=_0x4a16b7:_0x5eb842=process[_0x3ace9c(0xc3)]();let _0x261f50;const _0x1ffa12=tryFindTdxConfig(_0x5eb842);_0x1ffa12?.['config'][_0x3ace9c(0xe1)]&&(_0x261f50=_0x1ffa12[_0x3ace9c(0xd3)][_0x3ace9c(0xe1)],!_0x1dde34&&(_0x5eb842=_0x1ffa12['configDir']));_0x40c7d1[_0x3ace9c(0xcf)]&&(_0x261f50=_0x40c7d1[_0x3ace9c(0xcf)]);if(!_0x261f50){const _0x437e7a=loadSessionContext(_0x40c7d1[_0x3ace9c(0xf5)]);_0x437e7a?.[_0x3ace9c(0xe1)]&&(_0x261f50=_0x437e7a['engage_workspace']);}if(!_0x261f50)return console['error'](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xea))),console[_0x3ace9c(0xed)](_0x3ace9c(0xfc)),console[_0x3ace9c(0xed)](_0x3ace9c(0xd5)),console[_0x3ace9c(0xed)](_0x3ace9c(0xd2)),console[_0x3ace9c(0xed)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x211a54;_0x1dde34&&_0x4a16b7?_0x211a54=[parseTemplateFile(_0x4a16b7,a24_0x127784['dirname'](_0x4a16b7))]:_0x211a54=discoverAndParseTemplateFiles(_0x5eb842);if(_0x211a54[_0x3ace9c(0xd9)]===0x0)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xdc)+_0x5eb842)),console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcb)](_0x3ace9c(0xfb))),0x1;const _0x241892=_0x211a54['length']===0x1?_0x3ace9c(0xe7)+_0x211a54[0x0][_0x3ace9c(0xff)][_0x3ace9c(0xf1)]:_0x211a54[_0x3ace9c(0xd9)]+'\x20template\x20files';console[_0x3ace9c(0xed)](_0x3ace9c(0xe8)+a24_0x129c70[_0x3ace9c(0xfd)](_0x241892));let _0x362103=![];for(const _0x4b7076 of _0x211a54){const _0x22ba1c=validateTemplateDef(_0x4b7076[_0x3ace9c(0xff)]);if(!_0x22ba1c[_0x3ace9c(0x104)]){_0x362103=!![],console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xbc)+_0x4b7076[_0x3ace9c(0x105)]+':'));for(const _0x8acefa of _0x22ba1c[_0x3ace9c(0xe6)]){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xc4)]('✗')+'\x20'+_0x8acefa['path']+':\x20'+_0x8acefa['message']);}}for(const _0x150948 of _0x22ba1c[_0x3ace9c(0x107)]){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xd7)]('⚠')+'\x20'+_0x150948[_0x3ace9c(0xee)]+':\x20'+_0x150948[_0x3ace9c(0xbe)]);}}if(_0x362103)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xfe))),0x1;const _0x2204fc=await _0x3a3f65[_0x3ace9c(0xd6)][_0x3ace9c(0xc2)](_0x261f50),_0x160b09=await withProgressSpinner(_0x3ace9c(0xc8)+_0x261f50+_0x3ace9c(0xcc),_0x8180ca=>preparePush({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x211a54,_0x2204fc,{'progress':{'update':_0x49f2cd=>_0x8180ca[_0x3ace9c(0xd4)](_0x49f2cd)}}),{'verbose':_0x40c7d1['verbose']}),_0x201529=_0x160b09[_0x3ace9c(0xe4)];await withProgressSpinner(_0x3ace9c(0xdd),_0x16ba48=>resolveAndBuildInputs({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x201529,_0x2204fc,{'progress':{'update':_0x1e85d5=>_0x16ba48[_0x3ace9c(0xd4)](_0x1e85d5)}}),{'verbose':_0x40c7d1[_0x3ace9c(0xc9)]});const _0x1c9113=_0x201529[_0x3ace9c(0xc0)](_0x843618=>_0x843618['action']===_0x3ace9c(0xef)),_0x138caf=_0x201529[_0x3ace9c(0xc0)](_0x33991a=>_0x33991a['action']===_0x3ace9c(0xc1));console[_0x3ace9c(0xed)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x261f50+'\x27:');if(_0x1c9113[_0x3ace9c(0xd9)]>0x0){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xcd)]('+\x20'+_0x1c9113[_0x3ace9c(0xd9)]+_0x3ace9c(0xc5)));for(const _0x175fb0 of _0x1c9113){console[_0x3ace9c(0xed)](_0x3ace9c(0xce)+a24_0x129c70[_0x3ace9c(0xcd)]('+')+'\x20'+_0x175fb0['def']['name']);}}if(_0x138caf[_0x3ace9c(0xd9)]>0x0){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xd7)]('~\x20'+_0x138caf[_0x3ace9c(0xd9)]+'\x20templates\x20to\x20update:'));for(const _0x18c323 of _0x138caf){console['error'](_0x3ace9c(0xce)+a24_0x129c70['yellow']('~')+'\x20'+_0x18c323[_0x3ace9c(0xff)][_0x3ace9c(0xf1)]);}}if(_0x1c9113[_0x3ace9c(0xd9)]===0x0&&_0x138caf[_0x3ace9c(0xd9)]===0x0)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcd)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x40c7d1[_0x3ace9c(0xca)])return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xe5))),0x0;if(!_0x40c7d1[_0x3ace9c(0x106)]){if(!isInteractive())return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xc6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcb)](_0x3ace9c(0xdf))),0x1;const _0x520fd7=await confirmKey('Push\x20'+(_0x1c9113[_0x3ace9c(0xd9)]+_0x138caf[_0x3ace9c(0xd9)])+_0x3ace9c(0xf7));if(!_0x520fd7)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xbf)),_0x3ace9c(0x101)),0x1;}const _0x150f19=await withProgressSpinner(_0x3ace9c(0xf8),_0x90197c=>executePush({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x201529,{'progress':{'update':_0x166e75=>_0x90197c[_0x3ace9c(0xd4)](_0x166e75)}}),{'verbose':_0x40c7d1[_0x3ace9c(0xc9)]}),_0x364315=_0x150f19[_0x3ace9c(0xe4)];for(const _0x2b173e of _0x364315[_0x3ace9c(0x102)]){if(_0x2b173e[_0x3ace9c(0xc7)]&&(_0x2b173e['action']===_0x3ace9c(0xe2)||_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0x103))){const _0x7f05d1=getTemplateUrl(_0x40c7d1[_0x3ace9c(0xf4)],_0x2204fc,_0x2b173e[_0x3ace9c(0xc7)]),_0xb45d90=_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0xe2)?'+':'~',_0x29f2fa=_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0xe2)?a24_0x129c70[_0x3ace9c(0xcd)](_0xb45d90):a24_0x129c70['yellow'](_0xb45d90);console['error']('\x20\x20'+_0x29f2fa+'\x20'+hyperlink(_0x2b173e[_0x3ace9c(0xf1)],_0x7f05d1)+'\x20'+a24_0x129c70['dim'](_0x7f05d1));}}_0x364315[_0x3ace9c(0xe2)]>0x0&&console['error'](a24_0x129c70[_0x3ace9c(0xcd)](_0x3ace9c(0xd1)+_0x364315[_0x3ace9c(0xe2)]+'\x20templates'));_0x364315[_0x3ace9c(0x103)]>0x0&&console['error'](a24_0x129c70[_0x3ace9c(0xcd)](_0x3ace9c(0xf9)+_0x364315[_0x3ace9c(0x103)]+_0x3ace9c(0xf0)));if(_0x364315[_0x3ace9c(0xe6)]['length']>0x0){console[_0x3ace9c(0xed)](a24_0x129c70['red']('✘\x20'+_0x364315[_0x3ace9c(0xe6)][_0x3ace9c(0xd9)]+_0x3ace9c(0xf2)));for(const _0x100b57 of _0x364315['errors']){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70['red'](_0x100b57['name'])+':\x20'+_0x100b57[_0x3ace9c(0xed)]);}}return saveSessionContext({'engage_workspace':_0x261f50},_0x40c7d1['session']),_0x364315[_0x3ace9c(0xe6)][_0x3ace9c(0xd9)]>0x0?0x1:0x0;}}
1
+ const a24_0x1e540b=a24_0xf4ad;(function(_0x3f5a1f,_0x21db37){const _0x141816=a24_0xf4ad,_0xbba0b4=_0x3f5a1f();while(!![]){try{const _0x2a83bf=parseInt(_0x141816(0x197))/0x1+-parseInt(_0x141816(0x18c))/0x2+-parseInt(_0x141816(0x176))/0x3*(-parseInt(_0x141816(0x17c))/0x4)+-parseInt(_0x141816(0x18d))/0x5+-parseInt(_0x141816(0x182))/0x6+-parseInt(_0x141816(0x185))/0x7*(parseInt(_0x141816(0x18a))/0x8)+parseInt(_0x141816(0x157))/0x9;if(_0x2a83bf===_0x21db37)break;else _0xbba0b4['push'](_0xbba0b4['shift']());}catch(_0x435fd2){_0xbba0b4['push'](_0xbba0b4['shift']());}}}(a24_0x2b36,0x3d380));import{BaseCommand}from'./command.js';function a24_0x2b36(){const _0x56391f=['633910hMYstm','yellow','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','relativePath','create','dryRun','def','update','verbose','-\x20no\x20changes\x20applied','71783SkWMtM','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','No\x20template\x20YAML\x20files\x20found\x20in\x20','message','Pushing\x20templates...','templateId','9598536FcHqit','session','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x27...','1\x20template\x20file:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dirname','errors','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','red','data','updated','filter','created','valid','action','config','Push\x20','engage:template:push','yes','\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','\x20templates','cwd','site','error','\x20errors:','dim','cyan','Aborted.','3YQeEKx','✔\x20Created\x20','engage','✔\x20Updated\x20','✔\x20All\x20templates\x20are\x20up\x20to\x20date','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','99976CtVhen','engage_workspace','green','name','configDir','\x20templates\x20to\x20update:','2689596NkfrHy','length','setPhase','49xalfbF','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x20template\x20files','warnings','workspace','314872vxkFBj','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','123936HOsqYE'];a24_0x2b36=function(){return _0x56391f;};return a24_0x2b36();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x9e832c from'chalk';function a24_0xf4ad(_0x2bbb9f,_0x3b0e3c){_0x2bbb9f=_0x2bbb9f-0x155;const _0x2b3685=a24_0x2b36();let _0xf4adcc=_0x2b3685[_0x2bbb9f];return _0xf4adcc;}import a24_0xe3418a from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x1e540b(0x17f)]=a24_0x1e540b(0x169);['description']='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async['execute'](_0x11ab84){const _0x5d1867=a24_0x1e540b,{options:_0xeb24a9,args:_0x56b597,tdx:_0x4075f7}=_0x11ab84,_0x5cff63=_0xeb24a9,_0x3b6ad3=_0x56b597[0x0],_0x325506=_0x3b6ad3?a24_0xe3418a['resolve'](_0x3b6ad3):undefined,_0x13b8d0=_0x325506?isYamlFile(_0x325506):![];let _0x270f2f;if(_0x13b8d0&&_0x325506)_0x270f2f=a24_0xe3418a['dirname'](_0x325506);else _0x325506?_0x270f2f=_0x325506:_0x270f2f=process[_0x5d1867(0x16f)]();let _0x3a09ca;const _0x2cab5f=tryFindTdxConfig(_0x270f2f);_0x2cab5f?.['config'][_0x5d1867(0x17d)]&&(_0x3a09ca=_0x2cab5f[_0x5d1867(0x167)][_0x5d1867(0x17d)],!_0x13b8d0&&(_0x270f2f=_0x2cab5f[_0x5d1867(0x180)]));_0x5cff63[_0x5d1867(0x189)]&&(_0x3a09ca=_0x5cff63[_0x5d1867(0x189)]);if(!_0x3a09ca){const _0x31cf43=loadSessionContext(_0x5cff63[_0x5d1867(0x158)]);_0x31cf43?.[_0x5d1867(0x17d)]&&(_0x3a09ca=_0x31cf43[_0x5d1867(0x17d)]);}if(!_0x3a09ca)return console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x18e)]('Workspace\x20is\x20required.')),console[_0x5d1867(0x171)](_0x5d1867(0x15f)),console[_0x5d1867(0x171)](_0x5d1867(0x16d)),console['error'](_0x5d1867(0x16c)),console[_0x5d1867(0x171)](_0x5d1867(0x159)),0x1;let _0x3f634;_0x13b8d0&&_0x325506?_0x3f634=[parseTemplateFile(_0x325506,a24_0xe3418a[_0x5d1867(0x15d)](_0x325506))]:_0x3f634=discoverAndParseTemplateFiles(_0x270f2f);if(_0x3f634[_0x5d1867(0x183)]===0x0)return console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x18e)](_0x5d1867(0x199)+_0x270f2f)),console[_0x5d1867(0x171)](a24_0x9e832c['dim'](_0x5d1867(0x17b))),0x1;const _0x402a80=_0x3f634['length']===0x1?_0x5d1867(0x15b)+_0x3f634[0x0]['def'][_0x5d1867(0x17f)]:_0x3f634[_0x5d1867(0x183)]+_0x5d1867(0x187);console[_0x5d1867(0x171)]('Found\x20'+a24_0x9e832c[_0x5d1867(0x174)](_0x402a80));let _0x4e2228=![];for(const _0x3606dd of _0x3f634){const _0x5d506e=validateTemplateDef(_0x3606dd[_0x5d1867(0x193)]);if(!_0x5d506e[_0x5d1867(0x165)]){_0x4e2228=!![],console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x160)]('\x0aValidation\x20errors\x20in\x20'+_0x3606dd[_0x5d1867(0x190)]+':'));for(const _0x41700f of _0x5d506e[_0x5d1867(0x15e)]){console[_0x5d1867(0x171)]('\x20\x20'+a24_0x9e832c[_0x5d1867(0x160)]('✗')+'\x20'+_0x41700f['path']+':\x20'+_0x41700f[_0x5d1867(0x19a)]);}}for(const _0x51d642 of _0x5d506e[_0x5d1867(0x188)]){console[_0x5d1867(0x171)]('\x20\x20'+a24_0x9e832c['yellow']('⚠')+'\x20'+_0x51d642['path']+':\x20'+_0x51d642[_0x5d1867(0x19a)]);}}if(_0x4e2228)return console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x160)](_0x5d1867(0x198))),0x1;const _0xae6f4f=await _0x4075f7['engage']['resolveWorkspaceId'](_0x3a09ca),_0x2edbab=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x3a09ca+_0x5d1867(0x15a),_0x141167=>preparePush({'engage':_0x4075f7['engage']},_0x3f634,_0xae6f4f,{'progress':{'update':_0x157891=>_0x141167[_0x5d1867(0x184)](_0x157891)}}),{'verbose':_0x5cff63[_0x5d1867(0x195)]}),_0x560f7f=_0x2edbab['data'];await withProgressSpinner('Resolving\x20references...',_0xf95502=>resolveAndBuildInputs({'engage':_0x4075f7['engage']},_0x560f7f,_0xae6f4f,{'progress':{'update':_0x1e5ae9=>_0xf95502[_0x5d1867(0x184)](_0x1e5ae9)}}),{'verbose':_0x5cff63[_0x5d1867(0x195)]});const _0x234adf=_0x560f7f[_0x5d1867(0x163)](_0x171c39=>_0x171c39[_0x5d1867(0x166)]===_0x5d1867(0x191)),_0x1f21f3=_0x560f7f['filter'](_0x5d4136=>_0x5d4136[_0x5d1867(0x166)]===_0x5d1867(0x194));console['error'](_0x5d1867(0x186)+_0x3a09ca+'\x27:');if(_0x234adf[_0x5d1867(0x183)]>0x0){console['error']('\x20\x20'+a24_0x9e832c[_0x5d1867(0x17e)]('+\x20'+_0x234adf['length']+'\x20new\x20templates:'));for(const _0x3c7376 of _0x234adf){console[_0x5d1867(0x171)](_0x5d1867(0x16b)+a24_0x9e832c[_0x5d1867(0x17e)]('+')+'\x20'+_0x3c7376[_0x5d1867(0x193)][_0x5d1867(0x17f)]);}}if(_0x1f21f3[_0x5d1867(0x183)]>0x0){console[_0x5d1867(0x171)]('\x20\x20'+a24_0x9e832c[_0x5d1867(0x18e)]('~\x20'+_0x1f21f3[_0x5d1867(0x183)]+_0x5d1867(0x181)));for(const _0x49031d of _0x1f21f3){console[_0x5d1867(0x171)]('\x20\x20\x20\x20'+a24_0x9e832c[_0x5d1867(0x18e)]('~')+'\x20'+_0x49031d[_0x5d1867(0x193)]['name']);}}if(_0x234adf[_0x5d1867(0x183)]===0x0&&_0x1f21f3['length']===0x0)return console['error'](a24_0x9e832c[_0x5d1867(0x17e)](_0x5d1867(0x17a))),0x0;if(_0x5cff63[_0x5d1867(0x192)])return console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x18e)](_0x5d1867(0x18b))),0x0;if(!_0x5cff63[_0x5d1867(0x16a)]){if(!isInteractive())return console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x160)]('\x0aError:'),_0x5d1867(0x18f)),console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x173)](_0x5d1867(0x15c))),0x1;const _0x3b043b=await confirmKey(_0x5d1867(0x168)+(_0x234adf[_0x5d1867(0x183)]+_0x1f21f3[_0x5d1867(0x183)])+'\x20templates?');if(!_0x3b043b)return console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x18e)](_0x5d1867(0x175)),_0x5d1867(0x196)),0x1;}const _0x50e243=await withProgressSpinner(_0x5d1867(0x155),_0x4f0a66=>executePush({'engage':_0x4075f7[_0x5d1867(0x178)]},_0x560f7f,{'progress':{'update':_0x51434a=>_0x4f0a66[_0x5d1867(0x184)](_0x51434a)}}),{'verbose':_0x5cff63[_0x5d1867(0x195)]}),_0x3eda29=_0x50e243[_0x5d1867(0x161)];for(const _0x56c35e of _0x3eda29['results']){if(_0x56c35e[_0x5d1867(0x156)]&&(_0x56c35e[_0x5d1867(0x166)]===_0x5d1867(0x164)||_0x56c35e[_0x5d1867(0x166)]===_0x5d1867(0x162))){const _0x21ad72=getTemplateUrl(_0x5cff63[_0x5d1867(0x170)],_0xae6f4f,_0x56c35e[_0x5d1867(0x156)]),_0x400641=_0x56c35e[_0x5d1867(0x166)]===_0x5d1867(0x164)?'+':'~',_0x3eea93=_0x56c35e[_0x5d1867(0x166)]===_0x5d1867(0x164)?a24_0x9e832c['green'](_0x400641):a24_0x9e832c[_0x5d1867(0x18e)](_0x400641);console[_0x5d1867(0x171)]('\x20\x20'+_0x3eea93+'\x20'+hyperlink(_0x56c35e[_0x5d1867(0x17f)],_0x21ad72)+'\x20'+a24_0x9e832c[_0x5d1867(0x173)](_0x21ad72));}}_0x3eda29['created']>0x0&&console['error'](a24_0x9e832c[_0x5d1867(0x17e)](_0x5d1867(0x177)+_0x3eda29['created']+_0x5d1867(0x16e)));_0x3eda29[_0x5d1867(0x162)]>0x0&&console[_0x5d1867(0x171)](a24_0x9e832c[_0x5d1867(0x17e)](_0x5d1867(0x179)+_0x3eda29['updated']+_0x5d1867(0x16e)));if(_0x3eda29[_0x5d1867(0x15e)]['length']>0x0){console[_0x5d1867(0x171)](a24_0x9e832c['red']('✘\x20'+_0x3eda29[_0x5d1867(0x15e)]['length']+_0x5d1867(0x172)));for(const _0x26370b of _0x3eda29[_0x5d1867(0x15e)]){console[_0x5d1867(0x171)]('\x20\x20'+a24_0x9e832c[_0x5d1867(0x160)](_0x26370b[_0x5d1867(0x17f)])+':\x20'+_0x26370b['error']);}}return saveSessionContext({'engage_workspace':_0x3a09ca},_0x5cff63[_0x5d1867(0x158)]),_0x3eda29[_0x5d1867(0x15e)][_0x5d1867(0x183)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a25_0x38325d=a25_0x28e0;(function(_0x1551ae,_0x6b0c06){const _0x5a18f9=a25_0x28e0,_0x2ea48b=_0x1551ae();while(!![]){try{const _0x51bd36=-parseInt(_0x5a18f9(0x168))/0x1*(parseInt(_0x5a18f9(0x170))/0x2)+-parseInt(_0x5a18f9(0x17a))/0x3*(parseInt(_0x5a18f9(0x161))/0x4)+-parseInt(_0x5a18f9(0x17f))/0x5+parseInt(_0x5a18f9(0x183))/0x6*(parseInt(_0x5a18f9(0x180))/0x7)+parseInt(_0x5a18f9(0x172))/0x8*(-parseInt(_0x5a18f9(0x164))/0x9)+-parseInt(_0x5a18f9(0x166))/0xa+-parseInt(_0x5a18f9(0x189))/0xb*(-parseInt(_0x5a18f9(0x188))/0xc);if(_0x51bd36===_0x6b0c06)break;else _0x2ea48b['push'](_0x2ea48b['shift']());}catch(_0x3286e8){_0x2ea48b['push'](_0x2ea48b['shift']());}}}(a25_0x1f6d,0x4e86e));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a25_0x28e0(_0xda459,_0x37dbe7){_0xda459=_0xda459-0x15a;const _0x1f6d98=a25_0x1f6d();let _0x28e068=_0x1f6d98[_0xda459];return _0x28e068;}import a25_0x182233 from'chalk';import a25_0x4b5647 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a25_0x1f6d(){const _0x34328b=['errors','8SKfSgi','endsWith','relativePath','7083urLMKh','\x20valid','5900870HAbwew','✔\x20All\x20','7593olpaoI','skippedCount','engage:template:validate','warnings','.yaml','name','cwd','template','102ljjvjw','yellow','2824SESsZO','invalidCount','verbose','reason','valid','length','validCount','\x20template(s)\x20with\x20errors,\x20','624306lZEang','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20error(s)','.yml','\x20warning(s)\x20found','1578550kyuawB','1253693SNjHUB','\x20non-template\x20file(s)\x20skipped)','Validation\x20failed:\x20','18WQjSkl','dirname','execute','dim','\x20non-template\x20file(s)\x20skipped','36DnIfld','6495148DgPTEM','error','green','red','warningCount','log','\x20(skipped:\x20','Error:\x20Directory\x20not\x20found:\x20'];a25_0x1f6d=function(){return _0x34328b;};return a25_0x1f6d();}export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x38325d(0x16d)]=a25_0x38325d(0x16a);['description']='Validate\x20template\x20YAML\x20files';async[a25_0x38325d(0x185)](_0x1c845f){const _0x184eeb=a25_0x38325d,{options:_0x5e7858,args:_0x4e5b97}=_0x1c845f,_0x1cc518=_0x5e7858,_0x15a1fb=_0x4e5b97[0x0],_0x221f67=_0x15a1fb?a25_0x4b5647['resolve'](_0x15a1fb):undefined,_0x8da8ce=_0x221f67?isYamlFile(_0x221f67):![];let _0x6b0f8d,_0x26322e;if(_0x8da8ce&&_0x221f67)_0x6b0f8d=a25_0x4b5647[_0x184eeb(0x184)](_0x221f67),_0x26322e=_0x221f67;else _0x221f67?_0x6b0f8d=_0x221f67:_0x6b0f8d=process[_0x184eeb(0x16e)]();if(!_0x26322e&&!existsSync(_0x6b0f8d))return console[_0x184eeb(0x18a)](a25_0x182233['red'](_0x184eeb(0x15f)+_0x6b0f8d+'\x0a')),0x1;let _0x1fbaa9;if(_0x26322e){if(!_0x26322e[_0x184eeb(0x162)](_0x184eeb(0x17d))&&!_0x26322e['endsWith'](_0x184eeb(0x16c)))return console[_0x184eeb(0x18a)](a25_0x182233[_0x184eeb(0x15b)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x26322e+'\x0a')),0x1;_0x1fbaa9=[_0x26322e];}else _0x1fbaa9=findYamlFiles(_0x6b0f8d);if(_0x1fbaa9['length']===0x0)return console[_0x184eeb(0x18a)](a25_0x182233['red'](_0x184eeb(0x17b)+_0x6b0f8d+'\x0a')),0x1;const _0x1208bf=validateYamlFiles(_0x1fbaa9,_0x6b0f8d,{'filterType':_0x184eeb(0x16f)}),_0x17753e=calculateSummary(_0x1208bf),_0x3be874=_0x1208bf['filter'](isValidationResult);if(_0x3be874[_0x184eeb(0x177)]===0x0)return console[_0x184eeb(0x18a)](a25_0x182233[_0x184eeb(0x171)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x6b0f8d+'\x0a')),_0x17753e[_0x184eeb(0x169)]>0x0&&console['error'](a25_0x182233[_0x184eeb(0x186)]('('+_0x17753e[_0x184eeb(0x169)]+_0x184eeb(0x181))),0x0;for(const _0x2b2b63 of _0x1208bf){if(!isValidationResult(_0x2b2b63)){_0x1cc518[_0x184eeb(0x174)]&&console['log'](a25_0x182233[_0x184eeb(0x186)]('-\x20'+_0x2b2b63[_0x184eeb(0x163)]+_0x184eeb(0x15e)+_0x2b2b63[_0x184eeb(0x175)]+')'));continue;}const {relativePath:_0xd38bf7,source:_0x47f14e,result:_0x2b393c}=_0x2b2b63;if(_0x2b393c[_0x184eeb(0x176)]&&_0x2b393c['warnings'][_0x184eeb(0x177)]===0x0)_0x1cc518[_0x184eeb(0x174)]&&console[_0x184eeb(0x15d)](a25_0x182233[_0x184eeb(0x15a)]('✔\x20'+_0xd38bf7));else _0x2b393c[_0x184eeb(0x176)]?(console[_0x184eeb(0x15d)](a25_0x182233[_0x184eeb(0x171)]('⚠\x20'+_0xd38bf7+':\x20'+_0x2b393c[_0x184eeb(0x16b)][_0x184eeb(0x177)]+'\x20warning(s)')),console[_0x184eeb(0x15d)](formatValidationResult(_0x2b393c,_0x47f14e,_0xd38bf7))):(console[_0x184eeb(0x15d)](a25_0x182233[_0x184eeb(0x15b)]('✖\x20'+_0xd38bf7+':\x20'+_0x2b393c[_0x184eeb(0x160)][_0x184eeb(0x177)]+_0x184eeb(0x17c))),console[_0x184eeb(0x15d)](formatValidationResult(_0x2b393c,_0x47f14e,_0xd38bf7)));}return console[_0x184eeb(0x15d)](''),_0x17753e['hasErrors']?(console[_0x184eeb(0x15d)](a25_0x182233['red'](_0x184eeb(0x182)+_0x17753e[_0x184eeb(0x173)]+_0x184eeb(0x179)+_0x17753e[_0x184eeb(0x178)]+_0x184eeb(0x165))),_0x17753e['warningCount']>0x0&&console[_0x184eeb(0x15d)](a25_0x182233['yellow'](_0x17753e[_0x184eeb(0x15c)]+_0x184eeb(0x17e))),_0x17753e[_0x184eeb(0x169)]>0x0&&console['log'](a25_0x182233[_0x184eeb(0x186)](_0x17753e[_0x184eeb(0x169)]+_0x184eeb(0x187))),0x1):(console['log'](a25_0x182233[_0x184eeb(0x15a)](_0x184eeb(0x167)+_0x17753e['validCount']+'\x20template(s)\x20valid')),_0x17753e['warningCount']>0x0&&console[_0x184eeb(0x15d)](a25_0x182233[_0x184eeb(0x171)](_0x17753e['warningCount']+_0x184eeb(0x17e))),_0x17753e['skippedCount']>0x0&&console['log'](a25_0x182233['dim'](_0x17753e[_0x184eeb(0x169)]+_0x184eeb(0x187))),0x0);}}
1
+ function a25_0x5a6d(_0x16b4f0,_0x500aa1){_0x16b4f0=_0x16b4f0-0x6c;const _0x446546=a25_0x4465();let _0x5a6d9b=_0x446546[_0x16b4f0];return _0x5a6d9b;}const a25_0xa9cc38=a25_0x5a6d;(function(_0x38d002,_0x550846){const _0x147d4d=a25_0x5a6d,_0x1e533b=_0x38d002();while(!![]){try{const _0x1934d8=-parseInt(_0x147d4d(0x72))/0x1+-parseInt(_0x147d4d(0x82))/0x2*(-parseInt(_0x147d4d(0x95))/0x3)+parseInt(_0x147d4d(0x93))/0x4+-parseInt(_0x147d4d(0x7b))/0x5*(-parseInt(_0x147d4d(0x6c))/0x6)+-parseInt(_0x147d4d(0x8f))/0x7+parseInt(_0x147d4d(0x6d))/0x8*(-parseInt(_0x147d4d(0x86))/0x9)+parseInt(_0x147d4d(0x87))/0xa;if(_0x1934d8===_0x550846)break;else _0x1e533b['push'](_0x1e533b['shift']());}catch(_0x381578){_0x1e533b['push'](_0x1e533b['shift']());}}}(a25_0x4465,0x1a9e4));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x2270a4 from'chalk';import a25_0xf7ed14 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0xa9cc38(0x92)]='engage:template:validate';[a25_0xa9cc38(0x8b)]=a25_0xa9cc38(0x6f);async[a25_0xa9cc38(0x91)](_0x103b79){const _0x4c904d=a25_0xa9cc38,{options:_0x324a5b,args:_0x6cb31b}=_0x103b79,_0x3be767=_0x324a5b,_0x401128=_0x6cb31b[0x0],_0x314ddb=_0x401128?a25_0xf7ed14['resolve'](_0x401128):undefined,_0x1fd1b3=_0x314ddb?isYamlFile(_0x314ddb):![];let _0x213309,_0x17bc5f;if(_0x1fd1b3&&_0x314ddb)_0x213309=a25_0xf7ed14['dirname'](_0x314ddb),_0x17bc5f=_0x314ddb;else _0x314ddb?_0x213309=_0x314ddb:_0x213309=process[_0x4c904d(0x83)]();if(!_0x17bc5f&&!existsSync(_0x213309))return console[_0x4c904d(0x98)](a25_0x2270a4[_0x4c904d(0x8a)](_0x4c904d(0x9a)+_0x213309+'\x0a')),0x1;let _0x8e24b0;if(_0x17bc5f){if(!_0x17bc5f[_0x4c904d(0x94)](_0x4c904d(0x7f))&&!_0x17bc5f[_0x4c904d(0x94)]('.yaml'))return console['error'](a25_0x2270a4['red'](_0x4c904d(0x8d)+_0x17bc5f+'\x0a')),0x1;_0x8e24b0=[_0x17bc5f];}else _0x8e24b0=findYamlFiles(_0x213309);if(_0x8e24b0[_0x4c904d(0x8c)]===0x0)return console['error'](a25_0x2270a4[_0x4c904d(0x8a)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x213309+'\x0a')),0x1;const _0x4c8220=validateYamlFiles(_0x8e24b0,_0x213309,{'filterType':_0x4c904d(0x90)}),_0x4094fc=calculateSummary(_0x4c8220),_0x1ad9d1=_0x4c8220[_0x4c904d(0x85)](isValidationResult);if(_0x1ad9d1[_0x4c904d(0x8c)]===0x0)return console[_0x4c904d(0x98)](a25_0x2270a4[_0x4c904d(0x81)](_0x4c904d(0x7e)+_0x213309+'\x0a')),_0x4094fc[_0x4c904d(0x89)]>0x0&&console['error'](a25_0x2270a4[_0x4c904d(0x7d)]('('+_0x4094fc[_0x4c904d(0x89)]+_0x4c904d(0x96))),0x0;for(const _0x22674e of _0x4c8220){if(!isValidationResult(_0x22674e)){_0x3be767[_0x4c904d(0x76)]&&console[_0x4c904d(0x7a)](a25_0x2270a4['dim']('-\x20'+_0x22674e['relativePath']+_0x4c904d(0x84)+_0x22674e[_0x4c904d(0x88)]+')'));continue;}const {relativePath:_0x1dd5d8,source:_0x499f3b,result:_0x33698c}=_0x22674e;if(_0x33698c[_0x4c904d(0x70)]&&_0x33698c[_0x4c904d(0x9b)][_0x4c904d(0x8c)]===0x0)_0x3be767[_0x4c904d(0x76)]&&console[_0x4c904d(0x7a)](a25_0x2270a4['green']('✔\x20'+_0x1dd5d8));else _0x33698c[_0x4c904d(0x70)]?(console[_0x4c904d(0x7a)](a25_0x2270a4[_0x4c904d(0x81)]('⚠\x20'+_0x1dd5d8+':\x20'+_0x33698c[_0x4c904d(0x9b)][_0x4c904d(0x8c)]+_0x4c904d(0x77))),console[_0x4c904d(0x7a)](formatValidationResult(_0x33698c,_0x499f3b,_0x1dd5d8))):(console[_0x4c904d(0x7a)](a25_0x2270a4[_0x4c904d(0x8a)]('✖\x20'+_0x1dd5d8+':\x20'+_0x33698c[_0x4c904d(0x74)][_0x4c904d(0x8c)]+_0x4c904d(0x79))),console['log'](formatValidationResult(_0x33698c,_0x499f3b,_0x1dd5d8)));}return console['log'](''),_0x4094fc[_0x4c904d(0x71)]?(console[_0x4c904d(0x7a)](a25_0x2270a4['red']('Validation\x20failed:\x20'+_0x4094fc[_0x4c904d(0x80)]+'\x20template(s)\x20with\x20errors,\x20'+_0x4094fc['validCount']+_0x4c904d(0x75))),_0x4094fc['warningCount']>0x0&&console['log'](a25_0x2270a4[_0x4c904d(0x81)](_0x4094fc[_0x4c904d(0x7c)]+_0x4c904d(0x97))),_0x4094fc[_0x4c904d(0x89)]>0x0&&console[_0x4c904d(0x7a)](a25_0x2270a4[_0x4c904d(0x7d)](_0x4094fc[_0x4c904d(0x89)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x4c904d(0x7a)](a25_0x2270a4[_0x4c904d(0x8e)](_0x4c904d(0x6e)+_0x4094fc[_0x4c904d(0x99)]+_0x4c904d(0x73))),_0x4094fc[_0x4c904d(0x7c)]>0x0&&console[_0x4c904d(0x7a)](a25_0x2270a4['yellow'](_0x4094fc[_0x4c904d(0x7c)]+_0x4c904d(0x97))),_0x4094fc[_0x4c904d(0x89)]>0x0&&console['log'](a25_0x2270a4[_0x4c904d(0x7d)](_0x4094fc[_0x4c904d(0x89)]+_0x4c904d(0x78))),0x0);}}function a25_0x4465(){const _0xe2340d=['skippedCount','red','description','length','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','green','374255vGgivb','template','execute','name','363120RDAUMu','endsWith','1371dLBfNF','\x20non-template\x20file(s)\x20skipped)','\x20warning(s)\x20found','error','validCount','Error:\x20Directory\x20not\x20found:\x20','warnings','42yDKxGN','489608KegDui','✔\x20All\x20','Validate\x20template\x20YAML\x20files','valid','hasErrors','172617xgJjBf','\x20template(s)\x20valid','errors','\x20valid','verbose','\x20warning(s)','\x20non-template\x20file(s)\x20skipped','\x20error(s)','log','133735tcYHSx','warningCount','dim','No\x20template\x20YAML\x20files\x20found\x20in\x20','.yml','invalidCount','yellow','112FARxlp','cwd','\x20(skipped:\x20','filter','27odRWas','2151120iNAIwj','reason'];a25_0x4465=function(){return _0xe2340d;};return a25_0x4465();}
@@ -1 +1 @@
1
- const a26_0x4fd919=a26_0x60da;function a26_0x60da(_0x3f4645,_0x1a4951){_0x3f4645=_0x3f4645-0x1c7;const _0x9dc464=a26_0x9dc4();let _0x60da95=_0x9dc464[_0x3f4645];return _0x60da95;}(function(_0xe438d0,_0x92a403){const _0x5b721c=a26_0x60da,_0x2dcba2=_0xe438d0();while(!![]){try{const _0xe9a898=parseInt(_0x5b721c(0x1e8))/0x1+-parseInt(_0x5b721c(0x1f2))/0x2*(-parseInt(_0x5b721c(0x200))/0x3)+parseInt(_0x5b721c(0x1cf))/0x4*(parseInt(_0x5b721c(0x1cb))/0x5)+-parseInt(_0x5b721c(0x1ca))/0x6+-parseInt(_0x5b721c(0x20d))/0x7+parseInt(_0x5b721c(0x1cc))/0x8*(-parseInt(_0x5b721c(0x1ff))/0x9)+parseInt(_0x5b721c(0x1f7))/0xa*(parseInt(_0x5b721c(0x21e))/0xb);if(_0xe9a898===_0x92a403)break;else _0x2dcba2['push'](_0x2dcba2['shift']());}catch(_0x1b0bad){_0x2dcba2['push'](_0x2dcba2['shift']());}}}(a26_0x9dc4,0xd5531));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a26_0x9dc4(){const _0x338335=['floor','...','jobs','map','Submitting\x20kill\x20request...','substring','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','11TIIVkP','show','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Query:\x20','Getting\x20job\x20results...','length','job_id','7554300WWlDNP','1565owgftu','8pKJMTl','start_at','execute','14152EBkeRi','user_name','push','Submitting\x20job...','✔\x20Found\x20','job:result','abs','presto','red','data','round','limit','join','debug','d\x20ago','Cancelled','log','list','status','green','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Get\x20job\x20results','\x20row','job:submit','1311787REnOYm','✔\x20Job\x20submitted','h\x20ago','validate','Kill\x20a\x20job','created_at','file','getTime','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Getting\x20job\x20details...','227126hJXwWT','now','priority','name','result','16535990LksakQ','end_at','Show\x20job\x20details','job:show','No\x20SQL\x20statements\x20found\x20in\x20file','dim','information_schema','List\x20jobs','11688237dUuVOI','3gsHWtl','verbose','database','trino','Listing\x20jobs...','type','\x27\x20to\x20verify\x20the\x20job\x20status','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','just\x20now','args','success','\x20job','url','5283761LiOEwf','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','m\x20ago','hive','error','jobType','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','description'];a26_0x9dc4=function(){return _0x338335;};return a26_0x9dc4();}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x1cb628 from'chalk';function formatDuration(_0x98000d){const _0x1aab72=a26_0x60da;if(_0x98000d<0x3c)return _0x98000d+'s';if(_0x98000d<0xe10)return Math[_0x1aab72(0x217)](_0x98000d/0x3c)+'m\x20'+_0x98000d%0x3c+'s';const _0x1aa12c=Math[_0x1aab72(0x217)](_0x98000d/0xe10),_0x5432ea=Math[_0x1aab72(0x217)](_0x98000d%0xe10/0x3c);return _0x5432ea>0x0?_0x1aa12c+'h\x20'+_0x5432ea+'m':_0x1aa12c+'h';}function formatRelativeTime(_0x1799ac){const _0x59a4c4=a26_0x60da,_0x4295b3=Date[_0x59a4c4(0x1f3)]()-_0x1799ac[_0x59a4c4(0x1ef)](),_0x3fa49c=Math['floor'](Math[_0x59a4c4(0x1d5)](_0x4295b3)/0x3e8);if(_0x3fa49c<0x3c)return _0x59a4c4(0x208);const _0x234245=Math[_0x59a4c4(0x217)](_0x3fa49c/0x3c);if(_0x234245<0x3c)return _0x234245+_0x59a4c4(0x20f);const _0x4ea579=Math[_0x59a4c4(0x217)](_0x234245/0x3c);if(_0x4ea579<0x18)return _0x4ea579+_0x59a4c4(0x1ea);const _0x39c35f=Math['floor'](_0x4ea579/0x18);if(_0x39c35f<0x1e)return _0x39c35f+_0x59a4c4(0x1dd);return Math[_0x59a4c4(0x217)](_0x39c35f/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']=a26_0x4fd919(0x219);[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1fe);async[a26_0x4fd919(0x1ce)](_0x77bd3d){const _0x568b0d=a26_0x4fd919,{options:_0x22efe8,tdx:_0x52ed2f}=_0x77bd3d,_0x446a4b=resolveLimit(_0x22efe8[_0x568b0d(0x1da)],DEFAULT_DISPLAY_LIMIT),_0x50ed3c=_0x22efe8[_0x568b0d(0x1e1)];_0x22efe8[_0x568b0d(0x201)]&&(console[_0x568b0d(0x211)]('Limit:\x20'+_0x446a4b+'\x20jobs'),_0x50ed3c&&console['error']('Status\x20filter:\x20'+_0x50ed3c));const _0x33abab=await withSpinner(_0x568b0d(0x204),()=>_0x52ed2f['jobs'][_0x568b0d(0x1e0)]({'from':0x0,'to':_0x446a4b-0x1,'status':_0x50ed3c}),{'verbose':_0x22efe8[_0x568b0d(0x201)]}),_0x46b54e=_0x33abab['data'];console['error'](_0x568b0d(0x1d3)+_0x46b54e[_0x568b0d(0x1c8)]+_0x568b0d(0x20b)+(_0x46b54e[_0x568b0d(0x1c8)]!==0x1?'s':''));const _0xa9edbf=_0x22efe8['site'];if(isStructuredFormat(_0x22efe8)){const _0x4e58e4=_0x46b54e[_0x568b0d(0x21a)](_0xa06a9f=>{const _0x164de7=_0x568b0d;let _0x193dbc;if(_0xa06a9f['start_at']&&_0xa06a9f[_0x164de7(0x1f8)]){const _0x415eb=new Date(_0xa06a9f[_0x164de7(0x1cd)])[_0x164de7(0x1ef)](),_0x24258b=new Date(_0xa06a9f[_0x164de7(0x1f8)])[_0x164de7(0x1ef)]();_0x193dbc=Math[_0x164de7(0x1d9)]((_0x24258b-_0x415eb)/0x3e8);}return{'job_id':_0xa06a9f[_0x164de7(0x1c9)],'type':_0xa06a9f['type']===_0x164de7(0x1d6)?_0x164de7(0x203):_0xa06a9f[_0x164de7(0x205)],'status':_0xa06a9f[_0x164de7(0x1e1)],'user_name':_0xa06a9f[_0x164de7(0x1d0)],'duration_sec':_0x193dbc,'created_at':_0xa06a9f[_0x164de7(0x1ed)],'started_at':_0xa06a9f[_0x164de7(0x1cd)],'end_at':_0xa06a9f[_0x164de7(0x1f8)]};});await handleSDKOutput(_0x4e58e4,_0x22efe8);}else for(const _0xf8f390 of _0x46b54e){const _0x61f957=_0xf8f390[_0x568b0d(0x1e1)]===_0x568b0d(0x20a)?a26_0x1cb628[_0x568b0d(0x1e2)]:_0xf8f390[_0x568b0d(0x1e1)]===_0x568b0d(0x211)?a26_0x1cb628[_0x568b0d(0x1d7)]:a26_0x1cb628[_0x568b0d(0x1fc)],_0x4a9cda=_0x61f957(_0xf8f390[_0x568b0d(0x1e1)]),_0x16b5c2=getJobUrl(_0xa9edbf,_0xf8f390[_0x568b0d(0x1c9)]),_0x1a1c8e=hyperlink(_0xf8f390['job_id'],_0x16b5c2),_0x11e8c6=a26_0x1cb628[_0x568b0d(0x1fc)](_0xf8f390[_0x568b0d(0x205)]==='presto'?'trino':_0xf8f390[_0x568b0d(0x205)]),_0x1a1230=[];if(_0xf8f390[_0x568b0d(0x1cd)]&&_0xf8f390[_0x568b0d(0x1f8)]){const _0x11f590=Math[_0x568b0d(0x1d9)]((new Date(_0xf8f390[_0x568b0d(0x1f8)])[_0x568b0d(0x1ef)]()-new Date(_0xf8f390[_0x568b0d(0x1cd)])[_0x568b0d(0x1ef)]())/0x3e8);_0x1a1230[_0x568b0d(0x1d1)](formatDuration(_0x11f590));}if(_0xf8f390[_0x568b0d(0x1f8)])_0x1a1230[_0x568b0d(0x1d1)](formatRelativeTime(new Date(_0xf8f390[_0x568b0d(0x1f8)])));else _0xf8f390[_0x568b0d(0x1cd)]&&_0x1a1230[_0x568b0d(0x1d1)](formatRelativeTime(new Date(_0xf8f390[_0x568b0d(0x1cd)])));const _0x1fe0cf=_0x1a1230[_0x568b0d(0x1c8)]>0x0?a26_0x1cb628[_0x568b0d(0x1fc)]('\x20'+_0x1a1230[_0x568b0d(0x1db)](',\x20')):'';console[_0x568b0d(0x1df)]('⚡\x20'+_0x1a1c8e+'\x20'+_0x11e8c6+'\x20'+_0x4a9cda+_0x1fe0cf);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1fa);[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1f9);['validate'](_0x10f476){const _0x4793a4=a26_0x4fd919,_0x2d810b=_0x10f476[_0x4793a4(0x209)][0x0];if(!_0x2d810b)return _0x4793a4(0x215);return undefined;}async[a26_0x4fd919(0x1ce)](_0xfbf524){const _0x2ac5d9=a26_0x4fd919,{options:_0x480f4c,args:_0x3a7079,tdx:_0x1314ce}=_0xfbf524,_0x3c4acd=_0x3a7079[0x0],_0xa603a0=await withSpinner(_0x2ac5d9(0x1f1),()=>_0x1314ce[_0x2ac5d9(0x219)][_0x2ac5d9(0x21f)](_0x3c4acd),{'verbose':_0x480f4c['verbose']}),_0xc81805=_0xa603a0[_0x2ac5d9(0x1d8)];let _0x1c2e45;if(_0xc81805['start_at']&&_0xc81805[_0x2ac5d9(0x1f8)]){const _0x8ffb18=new Date(_0xc81805[_0x2ac5d9(0x1cd)])[_0x2ac5d9(0x1ef)](),_0x32305e=new Date(_0xc81805[_0x2ac5d9(0x1f8)])[_0x2ac5d9(0x1ef)]();_0x1c2e45=Math['round']((_0x32305e-_0x8ffb18)/0x3e8);}const _0x4a5d15={'job_id':_0xc81805[_0x2ac5d9(0x1c9)],'type':_0xc81805[_0x2ac5d9(0x205)],'status':_0xc81805['status'],..._0xc81805[_0x2ac5d9(0x1d0)]&&{'user_name':_0xc81805[_0x2ac5d9(0x1d0)]},..._0x1c2e45!==undefined&&{'duration_sec':_0x1c2e45},..._0xc81805[_0x2ac5d9(0x1ed)]&&{'created_at':_0xc81805['created_at']},..._0xc81805[_0x2ac5d9(0x1cd)]&&{'started_at':_0xc81805[_0x2ac5d9(0x1cd)]},..._0xc81805[_0x2ac5d9(0x1f8)]&&{'end_at':_0xc81805['end_at']},..._0xc81805[_0x2ac5d9(0x202)]&&{'database':_0xc81805['database']},..._0xc81805[_0x2ac5d9(0x1f4)]!==undefined&&{'priority':_0xc81805[_0x2ac5d9(0x1f4)]},..._0xc81805[_0x2ac5d9(0x20c)]&&{'url':_0xc81805[_0x2ac5d9(0x20c)]},..._0xc81805['query']&&{'query':_0xc81805['query']},..._0xc81805['debug']&&{'debug':_0xc81805[_0x2ac5d9(0x1dc)]}};return await handleSingleObjectOutput(_0x4a5d15,_0x480f4c),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]='job:kill';[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1ec);[a26_0x4fd919(0x1eb)](_0xae416e){const _0x65eb0=a26_0x4fd919,_0x4384ba=_0xae416e[_0x65eb0(0x209)][0x0];if(!_0x4384ba)return _0x65eb0(0x214);return undefined;}async['execute'](_0x203031){const _0x1db736=a26_0x4fd919,{options:_0x224f57,args:_0x4588d2,tdx:_0xc29d00}=_0x203031,_0x50498d=_0x4588d2[0x0];if(!_0x224f57['yes']){const _0x2d5d8d=await confirm(_0x1db736(0x1f0)+_0x50498d+'?');if(!_0x2d5d8d)return console[_0x1db736(0x211)](_0x1db736(0x1de)),0x0;}return await withSpinner(_0x1db736(0x21b),()=>_0xc29d00['jobs']['kill'](_0x50498d),{'verbose':_0x224f57[_0x1db736(0x201)]}),console[_0x1db736(0x211)](_0x1db736(0x207)+_0x50498d),console[_0x1db736(0x211)](_0x1db736(0x1e3)+_0x50498d+_0x1db736(0x206)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1e7);['description']='Submit\x20a\x20job';async[a26_0x4fd919(0x1ce)](_0x1db8d7){const _0x885f27=a26_0x4fd919,{options:_0x17b0d0,args:_0x3499fb,tdx:_0x114f19}=_0x1db8d7,_0x32e44c=_0x17b0d0[_0x885f27(0x212)]||_0x885f27(0x203),_0x2611bb=_0x17b0d0[_0x885f27(0x1ee)],_0x1bfa4b=_0x17b0d0[_0x885f27(0x202)]||_0x885f27(0x1fd),_0x5c6a4b=_0x17b0d0[_0x885f27(0x1f6)];if(_0x32e44c!==_0x885f27(0x203)&&_0x32e44c!==_0x885f27(0x210))throw new SDKError(ErrorCode[_0x885f27(0x220)],_0x885f27(0x21d));let _0x257ecf;if(_0x2611bb){if(_0x3499fb[0x0])throw new SDKError(ErrorCode[_0x885f27(0x220)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x354bd1=readSqlStatementsFromFile(_0x2611bb);if(_0x354bd1[_0x885f27(0x1c8)]===0x0)throw new SDKError(ErrorCode[_0x885f27(0x220)],_0x885f27(0x1fb));if(_0x354bd1[_0x885f27(0x1c8)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x885f27(0x20e));_0x257ecf=_0x354bd1[0x0];}else{if(!_0x3499fb[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x885f27(0x1e4));_0x257ecf=_0x3499fb[0x0];}_0x17b0d0[_0x885f27(0x201)]&&(console[_0x885f27(0x211)]('Job\x20type:\x20'+_0x32e44c),console[_0x885f27(0x211)](_0x885f27(0x213)+_0x1bfa4b),console['error'](_0x885f27(0x222)+_0x257ecf[_0x885f27(0x21c)](0x0,0x64)+(_0x257ecf[_0x885f27(0x1c8)]>0x64?_0x885f27(0x218):'')));const _0x1e2ca1=await withSpinner(_0x885f27(0x1d2),()=>_0x114f19[_0x885f27(0x219)]['submit'](_0x1bfa4b,_0x257ecf,_0x32e44c,_0x5c6a4b),{'verbose':_0x17b0d0[_0x885f27(0x201)]}),_0xd81f9d=_0x1e2ca1[_0x885f27(0x1d8)];return console[_0x885f27(0x211)](_0x885f27(0x1e9)),console[_0x885f27(0x211)]('\x20\x20Job\x20ID:\x20'+_0xd81f9d[_0x885f27(0x1c9)]),await handleSDKOutput([_0xd81f9d],_0x17b0d0),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1d4);['description']=a26_0x4fd919(0x1e5);[a26_0x4fd919(0x1eb)](_0x1d88b6){const _0x260a97=a26_0x4fd919,_0x176618=_0x1d88b6['args'][0x0];if(!_0x176618)return _0x260a97(0x221);return undefined;}async[a26_0x4fd919(0x1ce)](_0x3e878e){const _0x4f79bc=a26_0x4fd919,{options:_0x3b23b0,args:_0x4ef9dc,tdx:_0x1691bb}=_0x3e878e,_0x3ef827=_0x4ef9dc[0x0],_0x3a9b23=await withSpinner(_0x4f79bc(0x1c7),()=>_0x1691bb[_0x4f79bc(0x219)]['result'](_0x3ef827),{'verbose':_0x3b23b0[_0x4f79bc(0x201)]}),_0x58bc97=_0x3a9b23[_0x4f79bc(0x1d8)];return console[_0x4f79bc(0x211)]('✔\x20Retrieved\x20'+_0x58bc97[_0x4f79bc(0x1c8)]+_0x4f79bc(0x1e6)+(_0x58bc97[_0x4f79bc(0x1c8)]!==0x1?'s':'')),await handleSDKOutput(_0x58bc97,_0x3b23b0),0x0;}}
1
+ const a26_0x38cb67=a26_0x11d9;(function(_0x26c6ff,_0x1f91b7){const _0x1d1755=a26_0x11d9,_0x1e6d6b=_0x26c6ff();while(!![]){try{const _0x5a4cfc=-parseInt(_0x1d1755(0x220))/0x1+parseInt(_0x1d1755(0x20d))/0x2+parseInt(_0x1d1755(0x21a))/0x3+-parseInt(_0x1d1755(0x228))/0x4+-parseInt(_0x1d1755(0x209))/0x5*(-parseInt(_0x1d1755(0x1ed))/0x6)+-parseInt(_0x1d1755(0x225))/0x7*(parseInt(_0x1d1755(0x1d6))/0x8)+-parseInt(_0x1d1755(0x20e))/0x9*(-parseInt(_0x1d1755(0x1eb))/0xa);if(_0x5a4cfc===_0x1f91b7)break;else _0x1e6d6b['push'](_0x1e6d6b['shift']());}catch(_0x3a825c){_0x1e6d6b['push'](_0x1e6d6b['shift']());}}}(a26_0x2f7c,0x37e3d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a26_0x11d9(_0x1228e6,_0x38724b){_0x1228e6=_0x1228e6-0x1cf;const _0x2f7c7f=a26_0x2f7c();let _0x11d9ac=_0x2f7c7f[_0x1228e6];return _0x11d9ac;}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3afaeb from'chalk';function formatDuration(_0x49a9f8){const _0x4491f8=a26_0x11d9;if(_0x49a9f8<0x3c)return _0x49a9f8+'s';if(_0x49a9f8<0xe10)return Math[_0x4491f8(0x223)](_0x49a9f8/0x3c)+'m\x20'+_0x49a9f8%0x3c+'s';const _0x477e86=Math[_0x4491f8(0x223)](_0x49a9f8/0xe10),_0x823843=Math['floor'](_0x49a9f8%0xe10/0x3c);return _0x823843>0x0?_0x477e86+'h\x20'+_0x823843+'m':_0x477e86+'h';}function a26_0x2f7c(){const _0x2c356f=['presto','error','kill','Job\x20type:\x20','type','INVALID_ARGUMENT','length','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','1032726JVInrv','Listing\x20jobs...','hive','round','red','job_id','172334JIdLoJ','green','push','floor','validate','19908lEShKc','Database:\x20','priority','172072lSGKWP','\x20row','getTime','log','mo\x20ago','show','data','args','1224gpuWfz','query','✔\x20Retrieved\x20','now','substring','...','job:submit','jobs','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','yes','verbose','Getting\x20job\x20details...','h\x20ago','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job:result','status','dim','\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Query:\x20','database','10tykgeX','Submit\x20a\x20job','30FhpWSz','execute','limit','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','map','name','join','information_schema','Status\x20filter:\x20','start_at','\x20\x20Job\x20ID:\x20','job:show','trino','No\x20SQL\x20statements\x20found\x20in\x20file','end_at','\x20jobs','Getting\x20job\x20results...','\x27\x20to\x20verify\x20the\x20job\x20status','url','description','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','file','result','user_name','jobType','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job:kill','debug','146085QrsBrr','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','List\x20jobs','abs','415468VwNheI','1632132YCmjBP','d\x20ago','created_at','m\x20ago'];a26_0x2f7c=function(){return _0x2c356f;};return a26_0x2f7c();}function formatRelativeTime(_0x3c2a42){const _0x2b8892=a26_0x11d9,_0x4c5761=Date[_0x2b8892(0x1d9)]()-_0x3c2a42[_0x2b8892(0x1d0)](),_0x31a642=Math[_0x2b8892(0x223)](Math[_0x2b8892(0x20c)](_0x4c5761)/0x3e8);if(_0x31a642<0x3c)return'just\x20now';const _0x4c46ce=Math[_0x2b8892(0x223)](_0x31a642/0x3c);if(_0x4c46ce<0x3c)return _0x4c46ce+_0x2b8892(0x211);const _0x2b089c=Math[_0x2b8892(0x223)](_0x4c46ce/0x3c);if(_0x2b089c<0x18)return _0x2b089c+_0x2b8892(0x1e2);const _0x348893=Math[_0x2b8892(0x223)](_0x2b089c/0x18);if(_0x348893<0x1e)return _0x348893+_0x2b8892(0x20f);return Math[_0x2b8892(0x223)](_0x348893/0x1e)+_0x2b8892(0x1d2);}export class JobListCommand extends BaseCommand{[a26_0x38cb67(0x1f2)]=a26_0x38cb67(0x1dd);[a26_0x38cb67(0x200)]=a26_0x38cb67(0x20b);async[a26_0x38cb67(0x1ee)](_0x4749d2){const _0x47f8d0=a26_0x38cb67,{options:_0x3e4771,tdx:_0x33a758}=_0x4749d2,_0x471f94=resolveLimit(_0x3e4771[_0x47f8d0(0x1ef)],DEFAULT_DISPLAY_LIMIT),_0x5c0df0=_0x3e4771[_0x47f8d0(0x1e5)];_0x3e4771['verbose']&&(console[_0x47f8d0(0x213)]('Limit:\x20'+_0x471f94+_0x47f8d0(0x1fc)),_0x5c0df0&&console[_0x47f8d0(0x213)](_0x47f8d0(0x1f5)+_0x5c0df0));const _0x52e903=await withSpinner(_0x47f8d0(0x21b),()=>_0x33a758['jobs']['list']({'from':0x0,'to':_0x471f94-0x1,'status':_0x5c0df0}),{'verbose':_0x3e4771[_0x47f8d0(0x1e0)]}),_0x477d6d=_0x52e903[_0x47f8d0(0x1d4)];console[_0x47f8d0(0x213)]('✔\x20Found\x20'+_0x477d6d['length']+_0x47f8d0(0x1e7)+(_0x477d6d[_0x47f8d0(0x218)]!==0x1?'s':''));const _0x63e844=_0x3e4771['site'];if(isStructuredFormat(_0x3e4771)){const _0x36863f=_0x477d6d[_0x47f8d0(0x1f1)](_0x544131=>{const _0x17efaa=_0x47f8d0;let _0xaed71;if(_0x544131['start_at']&&_0x544131[_0x17efaa(0x1fb)]){const _0x39d3e2=new Date(_0x544131['start_at'])[_0x17efaa(0x1d0)](),_0x360394=new Date(_0x544131[_0x17efaa(0x1fb)])[_0x17efaa(0x1d0)]();_0xaed71=Math[_0x17efaa(0x21d)]((_0x360394-_0x39d3e2)/0x3e8);}return{'job_id':_0x544131[_0x17efaa(0x21f)],'type':_0x544131[_0x17efaa(0x216)]===_0x17efaa(0x212)?'trino':_0x544131['type'],'status':_0x544131[_0x17efaa(0x1e5)],'user_name':_0x544131['user_name'],'duration_sec':_0xaed71,'created_at':_0x544131[_0x17efaa(0x210)],'started_at':_0x544131[_0x17efaa(0x1f6)],'end_at':_0x544131[_0x17efaa(0x1fb)]};});await handleSDKOutput(_0x36863f,_0x3e4771);}else for(const _0x356ca4 of _0x477d6d){const _0x529984=_0x356ca4[_0x47f8d0(0x1e5)]==='success'?a26_0x3afaeb[_0x47f8d0(0x221)]:_0x356ca4[_0x47f8d0(0x1e5)]===_0x47f8d0(0x213)?a26_0x3afaeb[_0x47f8d0(0x21e)]:a26_0x3afaeb['dim'],_0x5f5c88=_0x529984(_0x356ca4[_0x47f8d0(0x1e5)]),_0x4a5253=getJobUrl(_0x63e844,_0x356ca4[_0x47f8d0(0x21f)]),_0x356c08=hyperlink(_0x356ca4['job_id'],_0x4a5253),_0x3c165b=a26_0x3afaeb[_0x47f8d0(0x1e6)](_0x356ca4[_0x47f8d0(0x216)]===_0x47f8d0(0x212)?_0x47f8d0(0x1f9):_0x356ca4[_0x47f8d0(0x216)]),_0x475439=[];if(_0x356ca4[_0x47f8d0(0x1f6)]&&_0x356ca4[_0x47f8d0(0x1fb)]){const _0x1d8842=Math[_0x47f8d0(0x21d)]((new Date(_0x356ca4[_0x47f8d0(0x1fb)])[_0x47f8d0(0x1d0)]()-new Date(_0x356ca4[_0x47f8d0(0x1f6)])[_0x47f8d0(0x1d0)]())/0x3e8);_0x475439['push'](formatDuration(_0x1d8842));}if(_0x356ca4[_0x47f8d0(0x1fb)])_0x475439[_0x47f8d0(0x222)](formatRelativeTime(new Date(_0x356ca4[_0x47f8d0(0x1fb)])));else _0x356ca4[_0x47f8d0(0x1f6)]&&_0x475439[_0x47f8d0(0x222)](formatRelativeTime(new Date(_0x356ca4[_0x47f8d0(0x1f6)])));const _0x25ba62=_0x475439[_0x47f8d0(0x218)]>0x0?a26_0x3afaeb[_0x47f8d0(0x1e6)]('\x20'+_0x475439[_0x47f8d0(0x1f3)](',\x20')):'';console[_0x47f8d0(0x1d1)]('⚡\x20'+_0x356c08+'\x20'+_0x3c165b+'\x20'+_0x5f5c88+_0x25ba62);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x38cb67(0x1f8);[a26_0x38cb67(0x200)]='Show\x20job\x20details';[a26_0x38cb67(0x224)](_0x1ca205){const _0x36bc01=a26_0x38cb67,_0x270e46=_0x1ca205[_0x36bc01(0x1d5)][0x0];if(!_0x270e46)return _0x36bc01(0x201);return undefined;}async[a26_0x38cb67(0x1ee)](_0x581272){const _0x113a0a=a26_0x38cb67,{options:_0x1b9d23,args:_0x3865e5,tdx:_0x22316e}=_0x581272,_0x59cbce=_0x3865e5[0x0],_0x41c0ed=await withSpinner(_0x113a0a(0x1e1),()=>_0x22316e[_0x113a0a(0x1dd)][_0x113a0a(0x1d3)](_0x59cbce),{'verbose':_0x1b9d23['verbose']}),_0x24522a=_0x41c0ed['data'];let _0x239421;if(_0x24522a[_0x113a0a(0x1f6)]&&_0x24522a[_0x113a0a(0x1fb)]){const _0x2bab6c=new Date(_0x24522a['start_at'])['getTime'](),_0x1cfaf2=new Date(_0x24522a[_0x113a0a(0x1fb)])[_0x113a0a(0x1d0)]();_0x239421=Math['round']((_0x1cfaf2-_0x2bab6c)/0x3e8);}const _0x4c932a={'job_id':_0x24522a[_0x113a0a(0x21f)],'type':_0x24522a['type'],'status':_0x24522a['status'],..._0x24522a[_0x113a0a(0x204)]&&{'user_name':_0x24522a[_0x113a0a(0x204)]},..._0x239421!==undefined&&{'duration_sec':_0x239421},..._0x24522a[_0x113a0a(0x210)]&&{'created_at':_0x24522a[_0x113a0a(0x210)]},..._0x24522a[_0x113a0a(0x1f6)]&&{'started_at':_0x24522a[_0x113a0a(0x1f6)]},..._0x24522a[_0x113a0a(0x1fb)]&&{'end_at':_0x24522a[_0x113a0a(0x1fb)]},..._0x24522a[_0x113a0a(0x1ea)]&&{'database':_0x24522a['database']},..._0x24522a[_0x113a0a(0x227)]!==undefined&&{'priority':_0x24522a[_0x113a0a(0x227)]},..._0x24522a[_0x113a0a(0x1ff)]&&{'url':_0x24522a[_0x113a0a(0x1ff)]},..._0x24522a[_0x113a0a(0x1d7)]&&{'query':_0x24522a[_0x113a0a(0x1d7)]},..._0x24522a['debug']&&{'debug':_0x24522a[_0x113a0a(0x208)]}};return await handleSingleObjectOutput(_0x4c932a,_0x1b9d23),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x38cb67(0x1f2)]=a26_0x38cb67(0x207);['description']='Kill\x20a\x20job';['validate'](_0x266173){const _0x37a79c=a26_0x38cb67,_0x2bbcd6=_0x266173[_0x37a79c(0x1d5)][0x0];if(!_0x2bbcd6)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0x38cb67(0x1ee)](_0xedc9dd){const _0xa9ef9e=a26_0x38cb67,{options:_0x25ebb5,args:_0x1c6c4e,tdx:_0x4ca46f}=_0xedc9dd,_0x2d6018=_0x1c6c4e[0x0];if(!_0x25ebb5[_0xa9ef9e(0x1df)]){const _0x5790d7=await confirm(_0xa9ef9e(0x206)+_0x2d6018+'?');if(!_0x5790d7)return console[_0xa9ef9e(0x213)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x4ca46f[_0xa9ef9e(0x1dd)][_0xa9ef9e(0x214)](_0x2d6018),{'verbose':_0x25ebb5[_0xa9ef9e(0x1e0)]}),console[_0xa9ef9e(0x213)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x2d6018),console[_0xa9ef9e(0x213)](_0xa9ef9e(0x1f0)+_0x2d6018+_0xa9ef9e(0x1fe)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x38cb67(0x1f2)]=a26_0x38cb67(0x1dc);['description']=a26_0x38cb67(0x1ec);async[a26_0x38cb67(0x1ee)](_0x230a1f){const _0x4999b3=a26_0x38cb67,{options:_0x41fecc,args:_0x58660c,tdx:_0x4ab56a}=_0x230a1f,_0x3bdd4e=_0x41fecc[_0x4999b3(0x205)]||'trino',_0xf485c1=_0x41fecc[_0x4999b3(0x202)],_0x3b39ae=_0x41fecc[_0x4999b3(0x1ea)]||_0x4999b3(0x1f4),_0x5893a3=_0x41fecc['result'];if(_0x3bdd4e!=='trino'&&_0x3bdd4e!==_0x4999b3(0x21c))throw new SDKError(ErrorCode[_0x4999b3(0x217)],_0x4999b3(0x1de));let _0x34d35d;if(_0xf485c1){if(_0x58660c[0x0])throw new SDKError(ErrorCode[_0x4999b3(0x217)],_0x4999b3(0x20a));const _0x187e65=readSqlStatementsFromFile(_0xf485c1);if(_0x187e65['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4999b3(0x1fa));if(_0x187e65[_0x4999b3(0x218)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4999b3(0x219));_0x34d35d=_0x187e65[0x0];}else{if(!_0x58660c[0x0])throw new SDKError(ErrorCode[_0x4999b3(0x217)],_0x4999b3(0x1e3));_0x34d35d=_0x58660c[0x0];}_0x41fecc[_0x4999b3(0x1e0)]&&(console[_0x4999b3(0x213)](_0x4999b3(0x215)+_0x3bdd4e),console[_0x4999b3(0x213)](_0x4999b3(0x226)+_0x3b39ae),console['error'](_0x4999b3(0x1e9)+_0x34d35d[_0x4999b3(0x1da)](0x0,0x64)+(_0x34d35d[_0x4999b3(0x218)]>0x64?_0x4999b3(0x1db):'')));const _0x4d731d=await withSpinner('Submitting\x20job...',()=>_0x4ab56a[_0x4999b3(0x1dd)]['submit'](_0x3b39ae,_0x34d35d,_0x3bdd4e,_0x5893a3),{'verbose':_0x41fecc[_0x4999b3(0x1e0)]}),_0x2774e2=_0x4d731d[_0x4999b3(0x1d4)];return console[_0x4999b3(0x213)]('✔\x20Job\x20submitted'),console[_0x4999b3(0x213)](_0x4999b3(0x1f7)+_0x2774e2[_0x4999b3(0x21f)]),await handleSDKOutput([_0x2774e2],_0x41fecc),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x38cb67(0x1f2)]=a26_0x38cb67(0x1e4);[a26_0x38cb67(0x200)]='Get\x20job\x20results';[a26_0x38cb67(0x224)](_0x335794){const _0x14b92e=a26_0x38cb67,_0x1f8957=_0x335794[_0x14b92e(0x1d5)][0x0];if(!_0x1f8957)return _0x14b92e(0x1e8);return undefined;}async['execute'](_0x3640ac){const _0x3fe809=a26_0x38cb67,{options:_0x5019f6,args:_0x195e87,tdx:_0x52bfc2}=_0x3640ac,_0x4f500b=_0x195e87[0x0],_0x299d7f=await withSpinner(_0x3fe809(0x1fd),()=>_0x52bfc2[_0x3fe809(0x1dd)][_0x3fe809(0x203)](_0x4f500b),{'verbose':_0x5019f6[_0x3fe809(0x1e0)]}),_0x13c857=_0x299d7f['data'];return console['error'](_0x3fe809(0x1d8)+_0x13c857[_0x3fe809(0x218)]+_0x3fe809(0x1cf)+(_0x13c857[_0x3fe809(0x218)]!==0x1?'s':'')),await handleSDKOutput(_0x13c857,_0x5019f6),0x0;}}
@@ -1 +1 @@
1
- const a27_0x511dbc=a27_0x1a99;(function(_0xe64560,_0x25c92d){const _0x13ceea=a27_0x1a99,_0x1df65f=_0xe64560();while(!![]){try{const _0x245dd5=parseInt(_0x13ceea(0x29a))/0x1*(parseInt(_0x13ceea(0x1ed))/0x2)+parseInt(_0x13ceea(0x2cd))/0x3*(-parseInt(_0x13ceea(0x217))/0x4)+-parseInt(_0x13ceea(0x2c6))/0x5+parseInt(_0x13ceea(0x2a7))/0x6+parseInt(_0x13ceea(0x1d3))/0x7+-parseInt(_0x13ceea(0x27c))/0x8*(parseInt(_0x13ceea(0x1e9))/0x9)+-parseInt(_0x13ceea(0x291))/0xa*(-parseInt(_0x13ceea(0x1fe))/0xb);if(_0x245dd5===_0x25c92d)break;else _0x1df65f['push'](_0x1df65f['shift']());}catch(_0x13e1e9){_0x1df65f['push'](_0x1df65f['shift']());}}}(a27_0x215c,0xa2451));import a27_0x43744a from'chalk';import a27_0x303d57 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';function a27_0x1a99(_0x1a91ee,_0xcaad39){_0x1a91ee=_0x1a91ee-0x1c7;const _0x215c59=a27_0x215c();let _0x1a9982=_0x215c59[_0x1a91ee];return _0x1a9982;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x28c9c5){const _0x41f619=a27_0x1a99;return!_0x28c9c5&&(console[_0x41f619(0x290)](_0x41f619(0x24e)),console[_0x41f619(0x290)](_0x41f619(0x21b))),!!_0x28c9c5;}function withJsonFormat(_0x306828){const _0x276579=a27_0x1a99;if(!_0x306828['format']&&!_0x306828[_0x276579(0x25b)]&&!_0x306828[_0x276579(0x1cd)]&&!_0x306828[_0x276579(0x250)])return{..._0x306828,'format':_0x276579(0x25b),'json':!![]};return _0x306828;}function formatJourneyState(_0x585232){const _0x1e8827=a27_0x1a99;switch(_0x585232){case _0x1e8827(0x242):return a27_0x43744a[_0x1e8827(0x29c)]('(running)');case _0x1e8827(0x1d4):return a27_0x43744a['dim'](_0x1e8827(0x1e4));case _0x1e8827(0x203):return a27_0x43744a[_0x1e8827(0x294)](_0x1e8827(0x1c7));case _0x1e8827(0x1ff):return a27_0x43744a['blue'](_0x1e8827(0x222));case _0x1e8827(0x1f2):return a27_0x43744a[_0x1e8827(0x23d)](_0x1e8827(0x23e));default:return'('+_0x585232+')';}}function formatJourneyItem(_0x2639d1,_0x6ea31a='',_0x138eff){const _0x1b77c1=a27_0x1a99,_0x2cdc85=formatJourneyState(_0x2639d1[_0x1b77c1(0x24f)]),_0x5853a0=_0x138eff?hyperlink(_0x2639d1[_0x1b77c1(0x2bb)],_0x138eff):_0x2639d1['journeyBundleName'];return _0x6ea31a+'🗺️\x20'+_0x5853a0+'\x20'+_0x2cdc85;}function escapeRegex(_0x195215){const _0x58da43=a27_0x1a99;return _0x195215[_0x58da43(0x25a)](/[.*+?^${}()|[\]\\]/g,_0x58da43(0x22f));}function globToRegex(_0x51428c){const _0x376c19=a27_0x1a99,_0x571374=_0x51428c[_0x376c19(0x260)]('*')[_0x376c19(0x20c)](escapeRegex);return new RegExp(_0x571374[_0x376c19(0x299)]('.*'),'i');}function buildRuleToNameMapping(_0x14fd26){const _0x50284d=a27_0x1a99,_0x3219ef=new Map();if(_0x14fd26[_0x50284d(0x24b)])for(const [_0x2fe671,_0x56fe2f]of Object[_0x50284d(0x1cb)](_0x14fd26['segments'])){if(_0x56fe2f[_0x50284d(0x1d8)]){const _0x2ccbcb=serializeRule(_0x56fe2f[_0x50284d(0x1d8)]),_0x46c1aa=_0x3219ef[_0x50284d(0x1f9)](_0x2ccbcb);_0x46c1aa?_0x46c1aa['push'](_0x2fe671):_0x3219ef[_0x50284d(0x2b0)](_0x2ccbcb,[_0x2fe671]);}}return _0x3219ef;}async function resolveJourneyIdFromInput(_0x8f38c0,_0x8ccd76,_0x14d589){const _0x48f785=a27_0x1a99,_0xe449ac=await resolveJourneyTarget(_0x8f38c0,_0x8ccd76[_0x48f785(0x220)],_0x8ccd76[_0x48f785(0x1e3)]),_0x2637d3=_0xe449ac[_0x48f785(0x220)];if(!_0x2637d3)throw new SDKError(ErrorCode[_0x48f785(0x1e2)],_0x48f785(0x1fa));const _0x138fca=await withSpinner(_0x48f785(0x2c3),()=>_0x14d589['segment'][_0x48f785(0x21f)](_0x2637d3),{'verbose':_0x8ccd76[_0x48f785(0x1e3)]}),_0x13e18b=_0x138fca['data'],_0xc6bda0=await withSpinner(_0x48f785(0x2cc),()=>_0x14d589[_0x48f785(0x24d)]['resolveJourneyId'](_0x13e18b,_0xe449ac[_0x48f785(0x25e)]),{'verbose':_0x8ccd76[_0x48f785(0x1e3)]});return{'journeyId':_0xc6bda0['data'],'journeyName':_0xe449ac['journeyName'],'parentSegmentId':_0x13e18b};}async function resolveJourneyTarget(_0x17f3c0,_0x30eceb,_0x2e6eea){const _0x397c6c=a27_0x1a99;if(isYamlFilePath(_0x17f3c0))try{const _0x20ec0c=await resolveYamlFilePath(_0x17f3c0);return _0x2e6eea&&(console[_0x397c6c(0x290)](_0x397c6c(0x28d)+_0x17f3c0),console[_0x397c6c(0x290)](_0x397c6c(0x27f)+_0x20ec0c['parentSegment']),console[_0x397c6c(0x290)]('\x20\x20Name:\x20'+_0x20ec0c['segmentName']),console[_0x397c6c(0x290)](_0x397c6c(0x25c)+(_0x20ec0c[_0x397c6c(0x27b)]||_0x397c6c(0x23b)))),{'journeyName':_0x20ec0c[_0x397c6c(0x27d)],'parentSegment':_0x20ec0c[_0x397c6c(0x220)],'resolved':_0x20ec0c};}catch(_0x5dd925){throw new SDKError(ErrorCode[_0x397c6c(0x1e2)],_0x397c6c(0x21e)+_0x5dd925[_0x397c6c(0x28e)]);}if(!_0x30eceb)throw new SDKError(ErrorCode[_0x397c6c(0x1e2)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x17f3c0,'parentSegment':_0x30eceb};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x511dbc(0x225)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x511dbc(0x229)](_0x3a9a22){const _0xed7d61=a27_0x511dbc,{options:_0x5d4b4e,args:_0x55aabd,tdx:_0x3e5c7d}=_0x3a9a22,_0x4d24c4=_0x55aabd[0x0],_0x4b48ee=_0x5d4b4e['parentSegment'];if(!_0x4b48ee)return console[_0xed7d61(0x290)](_0xed7d61(0x213)),console[_0xed7d61(0x290)](_0xed7d61(0x241)),0x1;const _0x6be85e=await withSpinner(_0xed7d61(0x2c3),()=>_0x3e5c7d['segment'][_0xed7d61(0x21f)](_0x4b48ee),{'verbose':_0x5d4b4e[_0xed7d61(0x1e3)]}),_0x4aad3b=_0x6be85e[_0xed7d61(0x253)];_0x5d4b4e[_0xed7d61(0x1e3)]&&(console[_0xed7d61(0x290)](_0xed7d61(0x2b5)+_0x4b48ee+_0xed7d61(0x1d7)+_0x4aad3b+')'),_0x4d24c4&&console[_0xed7d61(0x290)]('Pattern:\x20'+_0x4d24c4));const _0x4d99dd=await withSpinner(_0xed7d61(0x240),()=>_0x3e5c7d[_0xed7d61(0x207)]['getParentFull'](_0x4aad3b),{'verbose':_0x5d4b4e['verbose']}),_0x315711=_0x4d99dd[_0xed7d61(0x253)],_0x4a6aca=_0x315711[_0xed7d61(0x1ca)],_0x3d1517=await withSpinner(_0xed7d61(0x243),()=>_0x3e5c7d[_0xed7d61(0x24d)][_0xed7d61(0x20d)](_0x4aad3b,_0x4a6aca),{'verbose':_0x5d4b4e[_0xed7d61(0x1e3)]});let _0x57f69f=_0x3d1517[_0xed7d61(0x253)]['journeys'];const _0x25e973=_0x3d1517[_0xed7d61(0x253)]['folders'],_0x3f490d=new Map();for(const _0x4e8f25 of _0x25e973){_0x3f490d['set'](_0x4e8f25['id'],_0x4e8f25[_0xed7d61(0x2ac)]);}if(_0x4d24c4){const _0x4110ae=globToRegex(_0x4d24c4);_0x57f69f=_0x57f69f[_0xed7d61(0x266)](_0x501ff6=>_0x4110ae[_0xed7d61(0x20f)](_0x501ff6[_0xed7d61(0x2bb)]));}console[_0xed7d61(0x290)]('✔\x20Found\x20'+_0x57f69f[_0xed7d61(0x284)]+_0xed7d61(0x20a)+(_0x57f69f[_0xed7d61(0x284)]!==0x1?'s':''));const _0x351eae=_0xe55dce=>{const _0x346d2a=_0xed7d61;return getConsoleNextUrl(_0x5d4b4e[_0x346d2a(0x2b8)],_0x346d2a(0x236)+_0x4aad3b+'/e/'+_0xe55dce+_0x346d2a(0x2bd));};if(_0x5d4b4e[_0xed7d61(0x1ce)]==='table')await handleSDKOutput(_0x57f69f,_0x5d4b4e);else{if(_0x5d4b4e[_0xed7d61(0x1ce)]===_0xed7d61(0x25b)){const _0xb81f83=_0x57f69f[_0xed7d61(0x20c)](_0x324f17=>({..._0x324f17,'url':_0x351eae(_0x324f17['id'])}));await handleSDKOutput(_0xb81f83,_0x5d4b4e);}else{console[_0xed7d61(0x279)]('['+_0x4b48ee+']');const _0x11878c=new Map(),_0x5260e9=[];for(const _0x1a0a7f of _0x57f69f){if(!_0x1a0a7f[_0xed7d61(0x216)]||_0x1a0a7f[_0xed7d61(0x216)]===_0x4a6aca)_0x5260e9[_0xed7d61(0x202)](_0x1a0a7f);else{const _0x4fefb8=_0x11878c[_0xed7d61(0x1f9)](_0x1a0a7f['folderId'])||[];_0x4fefb8[_0xed7d61(0x202)](_0x1a0a7f),_0x11878c[_0xed7d61(0x2b0)](_0x1a0a7f['folderId'],_0x4fefb8);}}const _0x3f06d6=(_0x337f3b,_0x46a208)=>_0x337f3b[_0xed7d61(0x2bb)][_0xed7d61(0x285)](_0x46a208['journeyBundleName'],undefined,{'sensitivity':_0xed7d61(0x280)});_0x5260e9[_0xed7d61(0x234)](_0x3f06d6);for(const _0xbdcc87 of _0x5260e9){console[_0xed7d61(0x279)](formatJourneyItem(_0xbdcc87,'',_0x351eae(_0xbdcc87['id'])));}const _0x585473=[..._0x11878c[_0xed7d61(0x1cb)]()][_0xed7d61(0x234)]((_0x2e7e0b,_0x16d70e)=>{const _0x589935=_0xed7d61,_0x1f6ef7=_0x3f490d[_0x589935(0x1f9)](_0x2e7e0b[0x0])||_0x2e7e0b[0x0],_0x5d0405=_0x3f490d['get'](_0x16d70e[0x0])||_0x16d70e[0x0];return _0x1f6ef7[_0x589935(0x285)](_0x5d0405,undefined,{'sensitivity':_0x589935(0x280)});});for(const [_0x21b4f1,_0x9923bf]of _0x585473){const _0xbccc7d=_0x3f490d['get'](_0x21b4f1)||_0x21b4f1;console[_0xed7d61(0x279)](_0xed7d61(0x230)+_0xbccc7d),_0x9923bf[_0xed7d61(0x234)](_0x3f06d6);for(const _0x2b72c2 of _0x9923bf){console[_0xed7d61(0x279)](formatJourneyItem(_0x2b72c2,'\x20\x20',_0x351eae(_0x2b72c2['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x28b);[a27_0x511dbc(0x225)]='Show\x20journey\x20details';async['execute'](_0xf7b1c2){const _0x514c81=a27_0x511dbc,{options:_0xd563c8,args:_0x193302,tdx:_0x245e47}=_0xf7b1c2,_0x543fd4=_0x193302[0x0];if(!_0x543fd4)return console[_0x514c81(0x290)](_0x514c81(0x24e)),console[_0x514c81(0x290)](_0x514c81(0x1d6)),console[_0x514c81(0x290)](_0x514c81(0x1f6)),console[_0x514c81(0x290)](_0x514c81(0x255)),0x1;_0xd563c8[_0x514c81(0x1e3)]&&console[_0x514c81(0x290)](_0x514c81(0x257)+_0x543fd4);const {journeyId:_0x1f7a98,parentSegmentId:_0x54f891}=await resolveJourneyIdFromInput(_0x543fd4,_0xd563c8,_0x245e47);if(_0xd563c8[_0x514c81(0x264)]){const _0x138bc9=getConsoleNextUrl(_0xd563c8['site'],_0x514c81(0x236)+_0x54f891+_0x514c81(0x1dd)+_0x1f7a98+_0x514c81(0x23a));return console[_0x514c81(0x290)](a27_0x43744a['green']('✔')+_0x514c81(0x2c0)+a27_0x43744a['cyan'](_0x138bc9)),openBrowser(_0x138bc9),0x0;}const _0x3dad8c=await withSpinner(_0x514c81(0x1e0),()=>_0x245e47['journey'][_0x514c81(0x1fb)](_0x1f7a98),{'verbose':_0xd563c8[_0x514c81(0x1e3)]}),_0x41ba43=_0x3dad8c[_0x514c81(0x253)],_0x39d9f3=_0xd563c8[_0x514c81(0x2c1)];let _0x3a91e2;if(_0x39d9f3)try{const _0x134913=await withSpinner(_0x514c81(0x28c),()=>_0x245e47[_0x514c81(0x24d)][_0x514c81(0x226)](_0x1f7a98),{'verbose':_0xd563c8[_0x514c81(0x1e3)]});_0x3a91e2=_0x134913[_0x514c81(0x253)];}catch{_0xd563c8[_0x514c81(0x1e3)]&&console[_0x514c81(0x290)](_0x514c81(0x26f));}const _0x2e21d9=getConsoleNextUrl(_0xd563c8[_0x514c81(0x2b8)],_0x514c81(0x236)+_0x54f891+_0x514c81(0x1dd)+_0x1f7a98+_0x514c81(0x23a)),_0x2e3722={'id':_0x41ba43['id'],'name':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x2ac)],'description':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x225)],'state':_0x41ba43['attributes'][_0x514c81(0x24f)],'paused':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x203)],'reentry_mode':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x206)],'stages':_0x41ba43[_0x514c81(0x1e5)]['journeyStages']?.['length']||0x0,..._0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x292)]&&{'goal':_0x41ba43[_0x514c81(0x1e5)]['goal'][_0x514c81(0x2ac)]},..._0x3a91e2&&{'statistics':{'size':_0x3a91e2['size'],'entered':_0x3a91e2['enteredSize'],'goal_achieved':_0x3a91e2[_0x514c81(0x2a1)],'completion_rate':_0x3a91e2[_0x514c81(0x23c)],'exit_or_jump':_0x3a91e2['exitOrJumpSize'],'exit_or_jump_rate':_0x3a91e2['exitOrJumpRate'],'stages':_0x3a91e2[_0x514c81(0x2b9)]}},'url':_0x2e21d9};return await handleSingleObjectOutput(_0x2e3722,_0xd563c8),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:stats';[a27_0x511dbc(0x225)]='Show\x20journey\x20statistics';async['execute'](_0x14700b){const _0x4774e1=a27_0x511dbc,{options:_0x5cf05a,args:_0x45db6b,tdx:_0x576cab}=_0x14700b,_0x48bf32=_0x45db6b[0x0];if(!requireNameOrPath(_0x48bf32))return 0x1;_0x5cf05a[_0x4774e1(0x1e3)]&&console[_0x4774e1(0x290)](_0x4774e1(0x257)+_0x48bf32);const _0x35d477=_0x5cf05a,_0x377900=_0x35d477[_0x4774e1(0x1f1)],_0x12461d=_0x35d477['to'],_0x3a77f2=_0x35d477[_0x4774e1(0x2bc)],_0x29cf6f=_0x35d477[_0x4774e1(0x227)];_0x3a77f2&&!_0x377900&&!_0x12461d&&console[_0x4774e1(0x290)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x721956=_0x3a77f2?withJsonFormat(_0x5cf05a):_0x5cf05a,{journeyId:_0x4ca1f4,journeyName:_0x50621c}=await resolveJourneyIdFromInput(_0x48bf32,_0x721956,_0x576cab),_0x50bcb4=_0x377900||_0x12461d?{'from':_0x377900,'to':_0x12461d}:undefined,_0x310af4=await withSpinner(_0x4774e1(0x28c),()=>Promise[_0x4774e1(0x245)]([_0x576cab[_0x4774e1(0x24d)][_0x4774e1(0x1fb)](_0x4ca1f4),_0x576cab[_0x4774e1(0x24d)]['getStatistics'](_0x4ca1f4,_0x50bcb4)]),{'verbose':_0x721956[_0x4774e1(0x1e3)]}),[_0x1aaacb,_0x8a4a34]=_0x310af4['data'];if(!_0x8a4a34||_0x8a4a34[_0x4774e1(0x2a5)]===null)return console[_0x4774e1(0x290)](_0x4774e1(0x247)+_0x50621c),console[_0x4774e1(0x290)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x42a78d=buildStageNameMap(_0x1aaacb),_0x252258=!!(_0x50bcb4&&_0x8a4a34['history']?.[_0x4774e1(0x284)]),_0x1f5a81={'stageNameMap':_0x42a78d,'hasPeriod':_0x252258,'includeHistory':!!_0x3a77f2};if(_0x29cf6f&&_0x8a4a34[_0x4774e1(0x2b9)]){const _0x4ccf0d=_0x8a4a34[_0x4774e1(0x2b9)][_0x4774e1(0x239)](_0x5d4c79=>{const _0x13e4d2=_0x4774e1,_0x1c3e28=_0x42a78d['get'](_0x5d4c79['id'])??'';return _0x1c3e28['toLowerCase']()===_0x29cf6f[_0x13e4d2(0x273)]();});if(_0x4ccf0d)return await handleSingleObjectOutput(formatStageStats(_0x4ccf0d,_0x1f5a81),_0x721956),0x0;const _0x2ca367=_0x8a4a34[_0x4774e1(0x2b9)][_0x4774e1(0x20c)](_0x4c7699=>_0x42a78d[_0x4774e1(0x1f9)](_0x4c7699['id'])??_0x4c7699['id']);return console[_0x4774e1(0x290)](_0x4774e1(0x28a)+_0x29cf6f+_0x4774e1(0x20e)),console[_0x4774e1(0x290)](_0x4774e1(0x26c)+_0x2ca367[_0x4774e1(0x299)](',\x20')),0x1;}const _0x3c4050=_0x8a4a34[_0x4774e1(0x2b9)]?.['map'](_0x5db373=>formatStageStats(_0x5db373,_0x1f5a81)),_0x136a5c=assembleJourneyStats(_0x8a4a34,{'from':_0x377900,'to':_0x12461d,'includeHistory':_0x3a77f2});return await this[_0x4774e1(0x258)](_0x136a5c,_0x3c4050??[],_0x721956),0x0;}async['renderStats'](_0x5ae606,_0x45cf32,_0x17b7ca){const _0x5dcb50=a27_0x511dbc,_0xc3e9bf=_0x17b7ca['format']==='json'||_0x17b7ca[_0x5dcb50(0x1ce)]===_0x5dcb50(0x1cd)||_0x17b7ca[_0x5dcb50(0x25b)]||_0x17b7ca[_0x5dcb50(0x1cd)];if(_0xc3e9bf){_0x5ae606['stages']=_0x45cf32,await handleSingleObjectOutput(_0x5ae606,_0x17b7ca);return;}await handleSingleObjectOutput(_0x5ae606,_0x17b7ca);for(const _0x317783 of _0x45cf32){console['log'](''),console[_0x5dcb50(0x279)](String(a27_0x43744a[_0x5dcb50(0x232)]['bold']('['+_0x317783[_0x5dcb50(0x2ac)]+']'))+a27_0x43744a[_0x5dcb50(0x23d)]('\x20'+_0x317783['id']));const {id:_0x194aeb,name:_0x4146b7,..._0x2e62bd}=_0x317783;await handleSingleObjectOutput(_0x2e62bd,_0x17b7ca);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x246);['description']=a27_0x511dbc(0x219);async[a27_0x511dbc(0x229)](_0x56aec2){const _0xfd53cf=a27_0x511dbc,{options:_0x53e6bb,args:_0x15585a,tdx:_0x4823df}=_0x56aec2,_0xdbecc7=_0x15585a[0x0];if(!requireNameOrPath(_0xdbecc7))return 0x1;_0x53e6bb['verbose']&&console[_0xfd53cf(0x290)](_0xfd53cf(0x257)+_0xdbecc7);const _0x406d2c=_0x53e6bb,_0x5c9761=_0x406d2c[_0xfd53cf(0x26d)],_0x3e88c3=_0x406d2c['from'],_0x229b2b=_0x406d2c['to'],_0x46a257=_0x406d2c[_0xfd53cf(0x261)];if(_0x5c9761&&_0x5c9761!==_0xfd53cf(0x2a6)&&_0x5c9761!==_0xfd53cf(0x214))return console['error'](_0xfd53cf(0x2b1)+_0x5c9761+_0xfd53cf(0x21a)),0x1;const _0xbc0c01=withJsonFormat(_0x53e6bb),{journeyId:_0x2a500a,journeyName:_0x455c09}=await resolveJourneyIdFromInput(_0xdbecc7,_0xbc0c01,_0x4823df),_0x283c8e={'type':_0x5c9761,'from':_0x3e88c3,'to':_0x229b2b,'limit':_0x46a257},_0x40e6cb=await withSpinner(_0xfd53cf(0x21d),()=>_0x4823df[_0xfd53cf(0x24d)][_0xfd53cf(0x282)](_0x2a500a,_0x283c8e),{'verbose':_0xbc0c01[_0xfd53cf(0x1e3)]}),_0x39f174=_0x40e6cb['data'],_0x4caffd=_0x39f174[_0xfd53cf(0x2a6)]&&(_0x39f174['conversion'][_0xfd53cf(0x2c4)]['length']>0x0||_0x39f174[_0xfd53cf(0x2a6)][_0xfd53cf(0x29e)][_0xfd53cf(0x284)]>0x0),_0xe0120d=_0x39f174[_0xfd53cf(0x214)]&&_0x39f174[_0xfd53cf(0x214)][_0xfd53cf(0x284)]>0x0;if(!_0x4caffd&&!_0xe0120d)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x455c09),console[_0xfd53cf(0x290)](_0xfd53cf(0x274)),_0x3e88c3&&_0x229b2b&&console['error']('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x39f174,_0xbc0c01),0x0;}}function formatStageStats(_0x410a5d,_0x2b73e2){const _0x575516=a27_0x511dbc,_0x946736=_0x2b73e2['hasPeriod']&&_0x410a5d[_0x575516(0x2c5)]?.['length']?aggregateStageHistory(_0x410a5d['history']):{'size':_0x410a5d[_0x575516(0x201)],'entered':_0x410a5d[_0x575516(0x210)],'milestone':_0x410a5d['milestoneSize'],'milestone_rate':_0x410a5d['completeMilestoneRate'],'exit_or_jump':_0x410a5d[_0x575516(0x2cb)],'exit_or_jump_rate':_0x410a5d[_0x575516(0x1dc)]},_0x163aee={'id':_0x410a5d['id'],'name':_0x2b73e2['stageNameMap'][_0x575516(0x1f9)](_0x410a5d['id'])??_0x410a5d['id'],..._0x946736};return _0x2b73e2[_0x575516(0x224)]&&_0x2b73e2['includeHistory']&&_0x410a5d[_0x575516(0x2c5)]&&(_0x163aee[_0x575516(0x2c5)]=_0x410a5d[_0x575516(0x2c5)]),_0x163aee;}export class JourneyPauseCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x1eb);[a27_0x511dbc(0x225)]=a27_0x511dbc(0x24a);async[a27_0x511dbc(0x229)](_0x7e0167){const _0x4cacfb=a27_0x511dbc,{options:_0x5ba591,args:_0x20ece1,tdx:_0x4d65f3}=_0x7e0167,_0x36ed7c=_0x20ece1[0x0];if(!requireNameOrPath(_0x36ed7c))return 0x1;_0x5ba591[_0x4cacfb(0x1e3)]&&console[_0x4cacfb(0x290)]('Input:\x20'+_0x36ed7c);const {journeyId:_0x1c2f70,journeyName:_0x3f13cc}=await resolveJourneyIdFromInput(_0x36ed7c,_0x5ba591,_0x4d65f3);if(!_0x5ba591[_0x4cacfb(0x1cf)]){const _0x5097d8=await confirm(_0x4cacfb(0x2a2)+_0x3f13cc+'\x22?');if(!_0x5097d8)return console[_0x4cacfb(0x290)](_0x4cacfb(0x259)),0x0;}const _0x1e4a44=await withSpinner(_0x4cacfb(0x1de),()=>_0x4d65f3[_0x4cacfb(0x24d)][_0x4cacfb(0x254)](_0x1c2f70),{'verbose':_0x5ba591[_0x4cacfb(0x1e3)]}),_0x4efcdc=_0x1e4a44[_0x4cacfb(0x253)];return console[_0x4cacfb(0x290)](_0x4cacfb(0x25d)+_0x4efcdc[_0x4cacfb(0x1e5)][_0x4cacfb(0x2ac)]+_0x4cacfb(0x2ad)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:resume';[a27_0x511dbc(0x225)]='Resume\x20a\x20paused\x20journey';async[a27_0x511dbc(0x229)](_0x369920){const _0x268665=a27_0x511dbc,{options:_0x26a731,args:_0x1559cc,tdx:_0x4fac32}=_0x369920,_0x1f2b8c=_0x1559cc[0x0];if(!requireNameOrPath(_0x1f2b8c))return 0x1;_0x26a731[_0x268665(0x1e3)]&&console[_0x268665(0x290)](_0x268665(0x257)+_0x1f2b8c);const {journeyId:_0x3eae6f,journeyName:_0x13b547}=await resolveJourneyIdFromInput(_0x1f2b8c,_0x26a731,_0x4fac32);if(!_0x26a731[_0x268665(0x1cf)]){const _0x5de853=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x13b547+'\x22?');if(!_0x5de853)return console[_0x268665(0x290)](_0x268665(0x259)),0x0;}const _0x4ea8bc=await withSpinner('Resuming\x20journey...',()=>_0x4fac32['journey']['resume'](_0x3eae6f),{'verbose':_0x26a731[_0x268665(0x1e3)]}),_0x39f45a=_0x4ea8bc[_0x268665(0x253)];return console[_0x268665(0x290)](_0x268665(0x25d)+_0x39f45a['attributes']['name']+_0x268665(0x2cf)),0x0;}}function a27_0x215c(){const _0x48abbf=['replace','json','\x20\x20Folder\x20path:\x20','✔\x20Journey\x20\x22','journeyName','\x20journeys','split','limit','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Found\x20','web','resolveSegment','filter','Getting\x20column\x20mapping...','\x27\x20not\x20found\x20in\x20','table','isNew','\x20files?','Available\x20stages:\x20','type','\x20Created\x20v','\x20\x20Statistics\x20not\x20available','Warning:\x20Could\x20not\x20resolve\x20activation\x20','session','stringify','toLowerCase','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','values','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','log','cwd','folderPath','16ikekEx','segmentName','getSegment','\x20\x20Parent\x20segment:\x20','base','file','getTrafficData','getActivation','length','localeCompare','Journey\x20name:\x20','buildIdToNameMap','\x20(draft)\x20—\x20\x22','\x20version','Error:\x20Stage\x20\x22','journey:view','Getting\x20journey\x20statistics...','Resolved\x20YAML\x20file:\x20','message','hasChanges','error','10ttkwCQ','goal','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','yellow','listFolders','listJourneysFromParentSegment','add','options','join','408GhmxMz','Warning:\x20Could\x20not\x20resolve\x20segment\x20','green','journey:pull','links','listActivationsFlat','\x20activation','goalSize','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20Version\x20','journeyId','conversion','4782954fgTltZ','Folder\x20path:\x20',',\x20version:\x20','setPhase','audienceId','name','\x22\x20paused','List\x20all\x20versions\x20of\x20a\x20journey','createdAt','set','Error:\x20Invalid\x20--type\x20\x22','absolutePath','errorCode','Fetching\x20','Parent\x20segment:\x20','journey:versions','parent_segment','site','stages','journey:version:create','journeyBundleName','includeHistory','/j/da','versionNumber','activationParams','\x20Opening\x20','includeStats','...','Resolving\x20parent\x20segment...','nodes','history','4525565fWongF','Listing\x20journey\x20activations...','red','Fetching\x20users\x20and\x20connections...','helpText','exitOrJumpSize','Resolving\x20journey...','3462891iKtWwE','filePath','\x22\x20resumed','(paused)','Error:\x20Journey\x20not\x20found:\x20','No\x20journeys\x20found','rootFolderId','entries','journeyBundleId','jsonl','format','yes','user','then','Error:\x20--version\x20option\x20is\x20required','7093849whfcpS','draft','-\x20no\x20files\x20written','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x20(ID:\x20','rule','✔\x20Context\x20set:\x20','Error:\x20','createVersion','exitOrJumpRate','/e/','Pausing\x20journey...','\x20\x20Journey\x20ID:\x20','Getting\x20journey\x20details...','journey:activations','INVALID_ARGUMENT','verbose','(draft)','attributes','getColumnMapping','Write\x20','Export\x20journey(s)\x20as\x20YAML\x20files','1563183UyUGiW','repeat','journey:pause','relativePath','4538HTzsev','\x20\x20Consolidating\x20duplicate\x20segment:\x20','has','listVersions','from','archived','version','activation_','connector_config','Options:','Database:\x20','journeyStages','get','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','getJourney','Show\x20journey\x20table\x20column\x20mapping','args','3686353ToESlW','completed','✔\x20Pulled\x20','size','push','paused','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Table:\x20','reentryMode','segment','connection','\x20unchanged\x20files','\x20journey','Error:\x20Journey\x20\x27','map','listJourneysWithFolders','\x22\x20not\x20found','test','enteredSize','targetDir','✔\x20All\x20files\x20are\x20up\x20to\x20date','Error:\x20Parent\x20segment\x20context\x20required','activation','buildIdToEmailMap','folderId','4guccYx','\x20not\x20found.\x20Available:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Resolving\x20version...','Getting\x20journey\x20traffic\x20data...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','resolveParentId','parentSegment','Listing\x20journey\x20versions...','(completed)','parentName','hasPeriod','description','getStatistics','stage','segmentPushCommand','execute','Fetching\x20journeys\x20and\x20folders...','.yml','\x20(rule\x20match)','\x20versions)','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','\x5c$&','📁\x20','database','cyan','Creating\x20new\x20version...','sort','\x20new\x20files','/app/ps/','\x20journey\x20files\x20to\x20','content','find','/j/da/je','(root)','completionRate','dim','(archived)','utf-8','Fetching\x20parent\x20segment...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','launched','Listing\x20journeys...','diff','all','journey:traffic','No\x20statistics\x20available\x20for\x20journey:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','getLatestJourneyId','Pause\x20a\x20running\x20journey','segments','kind','journey','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','state','tsv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aPull\x20summary:','data','pause','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20\x20-\x20','Input:\x20','renderStats','Cancelled'];a27_0x215c=function(){return _0x48abbf;};return a27_0x215c();}export class JourneyPullCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x29d);['description']=a27_0x511dbc(0x1e8);async[a27_0x511dbc(0x229)](_0x1f0183){const _0x5dd557=a27_0x511dbc,{options:_0x32d24a,args:_0x26f6f3,tdx:_0x34b05d}=_0x1f0183,_0x1dc154=_0x32d24a,_0x5f0c25=_0x26f6f3[0x0],_0x31714c=_0x5f0c25&&isYamlFilePath(_0x5f0c25),_0x1974af=await resolveTarget({'arg':_0x31714c?_0x5f0c25:undefined,'contextParent':_0x32d24a[_0x5dd557(0x220)],'cwd':process[_0x5dd557(0x27a)]()});if(!isSuccessfulResolution(_0x1974af))return _0x1974af[_0x5dd557(0x2b3)]==='no_parent'?(console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x294)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x5dd557(0x22e)),console[_0x5dd557(0x290)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x5dd557(0x290)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x5dd557(0x290)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a27_0x43744a['red'](_0x5dd557(0x1da)+_0x1974af[_0x5dd557(0x28e)]+'\x0a')),_0x1974af[_0x5dd557(0x2ca)]&&console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x232)](_0x1974af[_0x5dd557(0x2ca)]))),0x1;let _0x3f591b=_0x31714c?undefined:_0x5f0c25,_0x376a04,_0x515a76;_0x1974af['type']===_0x5dd557(0x281)&&(_0x3f591b=_0x1974af['resourceName'],_0x376a04=_0x1974af[_0x5dd557(0x2ce)],_0x515a76=_0x1974af[_0x5dd557(0x27b)]);const _0x39ad06=_0x1974af[_0x5dd557(0x223)],_0x369aed=_0x1974af[_0x5dd557(0x211)];_0x1dc154['verbose']&&(console['error']('Parent\x20segment:\x20'+_0x39ad06),console[_0x5dd557(0x290)]('Target\x20directory:\x20'+_0x369aed),_0x3f591b&&console[_0x5dd557(0x290)](_0x5dd557(0x286)+_0x3f591b),_0x376a04&&console['error']('Target\x20file:\x20'+_0x376a04),_0x515a76&&console['error'](_0x5dd557(0x2a8)+_0x515a76));const _0x216ce0=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x34b05d['segment'][_0x5dd557(0x21f)](_0x39ad06),{'verbose':_0x32d24a[_0x5dd557(0x1e3)]}),_0x2618e3=_0x216ce0[_0x5dd557(0x253)],{journeys:_0x59ff24,folders:_0x3a60ee}=await withSpinner(_0x5dd557(0x22a),async()=>{const _0x4672f9=_0x5dd557,[_0x54ff2d,_0x7c4f97]=await Promise[_0x4672f9(0x245)]([_0x34b05d[_0x4672f9(0x24d)][_0x4672f9(0x296)](_0x2618e3,undefined,{'includeAllVersions':!![]}),_0x34b05d[_0x4672f9(0x207)][_0x4672f9(0x295)](_0x2618e3)]);return{'journeys':_0x54ff2d,'folders':_0x7c4f97};},{'verbose':_0x32d24a[_0x5dd557(0x1e3)]})[_0x5dd557(0x1d1)](_0x1904ec=>_0x1904ec[_0x5dd557(0x253)]);let _0xcadd8=_0x59ff24;const _0x3a3f66=buildFolderIdToPathMap(_0x3a60ee);if(_0x3f591b){const _0x4cf2f6=_0xcadd8[_0x5dd557(0x266)](_0x3042b7=>_0x3042b7[_0x5dd557(0x2bb)]['toLowerCase']()===_0x3f591b[_0x5dd557(0x273)]());if(_0x4cf2f6[_0x5dd557(0x284)]===0x0)return console['error'](_0x5dd557(0x1c8)+_0x3f591b),console[_0x5dd557(0x290)](_0x5dd557(0x204)),0x1;_0xcadd8=_0x4cf2f6;}if(_0x515a76!==undefined){const _0x25062b=_0xcadd8[_0x5dd557(0x266)](_0x39395e=>{const _0x34120c=_0x5dd557,_0x68d21e=_0x39395e[_0x34120c(0x216)]?_0x3a3f66[_0x34120c(0x1f9)](_0x39395e['folderId'])||'':'';return _0x68d21e===_0x515a76;});if(_0x25062b[_0x5dd557(0x284)]===0x0&&_0xcadd8['length']>0x0){console[_0x5dd557(0x290)](_0x5dd557(0x20b)+_0x3f591b+_0x5dd557(0x268)+(_0x515a76||'root\x20folder')),console[_0x5dd557(0x290)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x2ef3fe of _0xcadd8){const _0x217562=_0x2ef3fe[_0x5dd557(0x216)]?_0x3a3f66[_0x5dd557(0x1f9)](_0x2ef3fe[_0x5dd557(0x216)])||'':'';console[_0x5dd557(0x290)](_0x5dd557(0x256)+(_0x217562||'(root)')+'/'+_0x2ef3fe['journeyBundleName']);}return 0x1;}_0xcadd8=_0x25062b;}if(_0xcadd8[_0x5dd557(0x284)]===0x0)return console[_0x5dd557(0x290)](_0x5dd557(0x1c9)),0x0;const _0x59ae4c=new Map();for(const _0x52161b of _0xcadd8){const _0x39854c=_0x52161b[_0x5dd557(0x1cc)];!_0x59ae4c[_0x5dd557(0x1ef)](_0x39854c)&&_0x59ae4c['set'](_0x39854c,[]),_0x59ae4c[_0x5dd557(0x1f9)](_0x39854c)[_0x5dd557(0x202)](_0x52161b);}for(const _0x1ed008 of _0x59ae4c['values']()){_0x1ed008['sort']((_0x261771,_0x1f0679)=>(_0x261771[_0x5dd557(0x2be)]||0x0)-(_0x1f0679['versionNumber']||0x0));}const _0x429447=[],{idToEmailMap:_0x5c8b99,connectionIdToNameMap:_0x40f3d5}=await withSpinner(_0x5dd557(0x2c9),async()=>{const _0x423751=_0x5dd557,[_0x41eb38,_0x322580]=await Promise[_0x423751(0x245)]([_0x34b05d[_0x423751(0x1d0)][_0x423751(0x215)](),_0x34b05d[_0x423751(0x208)][_0x423751(0x287)]()]);return{'idToEmailMap':_0x41eb38,'connectionIdToNameMap':_0x322580};},{'verbose':_0x32d24a[_0x5dd557(0x1e3)]})[_0x5dd557(0x1d1)](_0x3e1edc=>_0x3e1edc[_0x5dd557(0x253)]);for(const _0x27cf56 of _0x59ae4c[_0x5dd557(0x275)]()){const _0x4c4545=_0x27cf56[0x0][_0x5dd557(0x2bb)],_0x48bfbf=_0x27cf56[0x0][_0x5dd557(0x216)],_0x51b26a=_0x48bfbf?_0x3a3f66[_0x5dd557(0x1f9)](_0x48bfbf)||'':'',_0xa25dde=_0x51b26a?a27_0x303d57[_0x5dd557(0x299)](_0x369aed,_0x51b26a):_0x369aed,_0x363452=_0x376a04||a27_0x303d57[_0x5dd557(0x299)](_0xa25dde,sanitizeFileName(_0x4c4545)+_0x5dd557(0x22b));let _0x408a10,_0x2e3ba2;if(existsSync(_0x363452))try{const _0x4f8cda=readFileSync(_0x363452,_0x5dd557(0x23f)),_0x8807f3=parseYamlString(_0x4f8cda);_0x2e3ba2=_0x8807f3,_0x408a10=buildRuleToNameMapping(_0x8807f3),_0x1dc154['verbose']&&_0x408a10['size']>0x0&&console['error'](_0x5dd557(0x263)+_0x408a10[_0x5dd557(0x201)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x4c4545);}catch(_0x25e4e4){_0x1dc154[_0x5dd557(0x1e3)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x25e4e4['message']);}const _0x50ef38=[],_0x219cb2=new Set(),_0x43aa9e=new Map(),_0x54c445=new Map(),_0x57dbe3=new Set(),_0x2ace5d=new Map(),_0x3221ca=new Map(),_0x36cc9a=createJumpTargetCache();await withProgressSpinner(_0x5dd557(0x2b4)+_0x4c4545+_0x5dd557(0x2c2),async _0x3a03eb=>{const _0x21a660=_0x5dd557;for(const _0x1a7e68 of _0x27cf56){const _0x36de4c=_0x27cf56['length']>0x1?_0x1a7e68[_0x21a660(0x2bb)]+'\x20v'+(_0x1a7e68[_0x21a660(0x2be)]||0x1):_0x1a7e68[_0x21a660(0x2bb)];_0x3a03eb[_0x21a660(0x2aa)](_0x21a660(0x2b4)+_0x36de4c);const _0x13409a=await _0x34b05d[_0x21a660(0x24d)][_0x21a660(0x1fb)](_0x1a7e68['id']),_0x1bc445=_0x13409a['attributes']?.[_0x21a660(0x2ab)],_0xf007de={'resolveSegment':async _0x1338dc=>{const _0x3713cc=_0x21a660;if(!_0x1bc445)return{'name':_0x1338dc,'isJourneyLocal':![]};const _0x2c91ed=_0x43aa9e[_0x3713cc(0x1f9)](_0x1338dc);if(_0x2c91ed)return _0x2c91ed;try{const _0x4db57a=await _0x34b05d['segment'][_0x3713cc(0x27e)](_0x1bc445,_0x1338dc),_0x58ff78=_0x4db57a[_0x3713cc(0x24c)]===SEGMENT_KIND_JOURNEY;let _0x9260f,_0x4c6b50=_0x4db57a['name'];if(_0x58ff78&&_0x4db57a['rule']){const _0xd32b82=await segmentResponseToDef(_0x4db57a,{'resolveSegmentName':async _0x1c1ebb=>{const _0x264a93=_0x3713cc,_0x10c41c=_0x43aa9e[_0x264a93(0x1f9)](_0x1c1ebb);if(_0x10c41c)return _0x10c41c[_0x264a93(0x2ac)];const _0x4def9e=await _0xf007de[_0x264a93(0x265)](_0x1c1ebb);return _0x4def9e['name'];}}),_0x391c81=_0xd32b82[_0x3713cc(0x1d8)];_0x9260f={'description':_0x4db57a[_0x3713cc(0x225)],'rule':_0x391c81};const _0x176c08=serializeRule(_0x391c81),_0x265c41=_0x54c445[_0x3713cc(0x1f9)](_0x176c08);if(_0x265c41)_0x4c6b50=_0x265c41,_0x9260f=undefined,_0x1dc154[_0x3713cc(0x1e3)]&&console[_0x3713cc(0x290)](_0x3713cc(0x1ee)+_0x4db57a[_0x3713cc(0x2ac)]+'\x20->\x20'+_0x265c41);else{let _0x217596=![];if(_0x408a10){const _0x348d0e=_0x408a10[_0x3713cc(0x1f9)](_0x176c08);if(_0x348d0e){const _0x53d16c=_0x348d0e[_0x3713cc(0x239)](_0xb38560=>!_0x219cb2[_0x3713cc(0x1ef)](_0xb38560));_0x53d16c&&(_0x4c6b50=_0x53d16c,_0x219cb2[_0x3713cc(0x297)](_0x53d16c),_0x54c445['set'](_0x176c08,_0x53d16c),_0x217596=!![],_0x1dc154[_0x3713cc(0x1e3)]&&console['error'](_0x3713cc(0x277)+_0x53d16c+_0x3713cc(0x22c)));}}if(!_0x217596){const _0x3836ea=generateJourneyLocalName(_0x4db57a['name']);_0x3836ea&&(_0x4c6b50=_0x3836ea);let _0x4140e2=_0x4c6b50,_0x21ce2e=0x2;while(_0x219cb2['has'](_0x4140e2)){_0x4140e2=_0x4c6b50+'_'+_0x21ce2e,_0x21ce2e++;}_0x219cb2[_0x3713cc(0x297)](_0x4140e2),_0x54c445[_0x3713cc(0x2b0)](_0x176c08,_0x4140e2),_0x4c6b50=_0x4140e2;}}}const _0x5313d5={'name':_0x4c6b50,'isJourneyLocal':_0x58ff78,'definition':_0x9260f};return _0x43aa9e[_0x3713cc(0x2b0)](_0x1338dc,_0x5313d5),_0x5313d5;}catch(_0x169ac4){return _0x32d24a['verbose']&&console['error'](_0x3713cc(0x29b)+_0x1338dc+':\x20'+_0x169ac4[_0x3713cc(0x28e)]),{'name':_0x1338dc,'isJourneyLocal':![]};}},'resolveActivation':async _0x2b3e15=>{const _0x1d70ae=_0x21a660,_0x462d45=_0x2ace5d[_0x1d70ae(0x1f9)](_0x2b3e15);if(_0x462d45)return _0x462d45;try{const _0x4793d4=await _0x34b05d[_0x1d70ae(0x24d)][_0x1d70ae(0x283)](_0x1a7e68['id'],_0x2b3e15),_0x355b8d=journeyActivationStepToYaml(_0x4793d4,_0x5c8b99,_0x40f3d5),_0x1f3729=JSON[_0x1d70ae(0x272)]({'name':_0x355b8d[_0x1d70ae(0x2ac)],'connection':_0x355b8d[_0x1d70ae(0x208)],'connector_config':_0x355b8d[_0x1d70ae(0x1f5)]}),_0xa8eef0=_0x3221ca['get'](_0x1f3729);if(_0xa8eef0){const _0x133edc={'name':_0xa8eef0,'isJourneyLocal':!![],'definition':_0x355b8d};return _0x2ace5d['set'](_0x2b3e15,_0x133edc),_0x133edc;}const _0x1cdbf9=_0x4793d4[_0x1d70ae(0x1e5)][_0x1d70ae(0x2bf)][_0x1d70ae(0x2ac)]||_0x2b3e15,_0x2acdbf=sanitizeYamlKey(_0x1cdbf9)||_0x1d70ae(0x1f4)+_0x2b3e15;let _0x2579b1=_0x2acdbf,_0x3202a6=0x2;while(_0x57dbe3[_0x1d70ae(0x1ef)](_0x2579b1)){_0x2579b1=_0x2acdbf+'_'+_0x3202a6,_0x3202a6++;}_0x57dbe3[_0x1d70ae(0x297)](_0x2579b1),_0x3221ca[_0x1d70ae(0x2b0)](_0x1f3729,_0x2579b1);const _0x5edcac={'name':_0x2579b1,'isJourneyLocal':!![],'definition':_0x355b8d};return _0x2ace5d['set'](_0x2b3e15,_0x5edcac),_0x5edcac;}catch(_0x4b7daa){return _0x32d24a[_0x1d70ae(0x1e3)]&&console['error'](_0x1d70ae(0x270)+_0x2b3e15+':\x20'+_0x4b7daa[_0x1d70ae(0x28e)]),{'name':_0x2b3e15,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1da5ed,_0x3640f7)=>{const _0x42ba80=_0x21a660;return resolveJumpTarget(_0x1da5ed,_0x3640f7,_0x36cc9a,_0xb79474=>_0x34b05d[_0x42ba80(0x24d)][_0x42ba80(0x1fb)](_0xb79474));}},_0x12f993=await journeyResponseToDef(_0x13409a,_0xf007de);_0x50ef38[_0x21a660(0x202)]({'item':_0x1a7e68,'yaml':_0x12f993});}},{'verbose':_0x32d24a['verbose']});const _0x554d01=await _0x34b05d[_0x5dd557(0x24d)][_0x5dd557(0x249)](_0x27cf56[0x0][_0x5dd557(0x1cc)]),_0x286191=buildMergedJourneyDef(_0x50ef38,_0x408a10,_0x554d01),_0x2f3969=normalizeJourneyDef(_0x286191,_0x2e3ba2),_0x197a5b=toYamlString(_0x2f3969),_0x19183f=_0x376a04||a27_0x303d57[_0x5dd557(0x299)](_0xa25dde,sanitizeFileName(_0x4c4545)+_0x5dd557(0x22b));!_0x376a04&&_0x51b26a&&!existsSync(_0xa25dde)&&mkdirSync(_0xa25dde,{'recursive':!![]});const _0x40ca62=a27_0x303d57['relative'](process[_0x5dd557(0x27a)](),_0x19183f);if(existsSync(_0x19183f)){const _0x2fe1f8=readFileSync(_0x19183f,'utf-8'),_0x5cfeeb=generateDiff(_0x2fe1f8,_0x197a5b),_0xe20145=hasChanges(_0x5cfeeb);_0x429447[_0x5dd557(0x202)]({'relativePath':_0x40ca62,'absolutePath':_0x19183f,'content':_0x197a5b,'isNew':![],'hasChanges':_0xe20145,'diff':_0xe20145?formatDiffWithColors(_0x5cfeeb):undefined});}else _0x429447['push']({'relativePath':_0x40ca62,'absolutePath':_0x19183f,'content':_0x197a5b,'isNew':!![],'hasChanges':![]});}const _0x17a88f=_0x429447['filter'](_0x51055b=>_0x51055b['isNew']),_0x31bd18=_0x429447[_0x5dd557(0x266)](_0x5bd33d=>!_0x5bd33d[_0x5dd557(0x26a)]&&_0x5bd33d['hasChanges']),_0x52bb6c=_0x429447['filter'](_0x15213a=>!_0x15213a[_0x5dd557(0x26a)]&&!_0x15213a[_0x5dd557(0x28f)]),_0x22e9f0=_0xcadd8['length'],_0x6b1e36=_0x59ae4c[_0x5dd557(0x201)],_0x5287e3=_0x22e9f0>_0x6b1e36?'\x20('+_0x22e9f0+_0x5dd557(0x22d):'';console['error'](_0x5dd557(0x252)),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x6b1e36+_0x5dd557(0x25f))+a27_0x43744a['dim'](_0x5287e3)),console['error']('\x20\x20'+a27_0x43744a[_0x5dd557(0x29c)]('+\x20'+_0x17a88f[_0x5dd557(0x284)]+_0x5dd557(0x235))),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a[_0x5dd557(0x294)]('~\x20'+_0x31bd18[_0x5dd557(0x284)]+'\x20changed\x20files')),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a['dim']('=\x20'+_0x52bb6c['length']+_0x5dd557(0x209))),console[_0x5dd557(0x290)]('\x20\x20Target:\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x369aed)+'\x0a');if(_0x31bd18['length']>0x0)for(const _0x1945fd of _0x31bd18){console[_0x5dd557(0x290)]('\x0aChanges\x20to\x20\x27'+_0x1945fd[_0x5dd557(0x1ec)]+'\x27:'),console[_0x5dd557(0x290)]('─'[_0x5dd557(0x1ea)](0x3c)),console['error'](_0x1945fd[_0x5dd557(0x244)]),console[_0x5dd557(0x290)]('─'['repeat'](0x3c));}if(_0x1dc154['dryRun'])return console['error'](a27_0x43744a[_0x5dd557(0x294)](_0x5dd557(0x248))),0x0;if(_0x17a88f[_0x5dd557(0x284)]===0x0&&_0x31bd18['length']===0x0)return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x212))),saveSessionContext({'parent_segment':_0x39ad06},_0x1dc154[_0x5dd557(0x271)]),console['error'](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x1d9)+a27_0x43744a[_0x5dd557(0x23d)]('parent_segment')+'\x20=\x20'+a27_0x43744a['cyan'](_0x39ad06))),0x0;if(!_0x1dc154[_0x5dd557(0x1cf)]&&(_0x17a88f['length']>0x0||_0x31bd18[_0x5dd557(0x284)]>0x0)){if(!isInteractive())return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x2c8)]('\x0aError:'),_0x5dd557(0x2a3)),console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x23d)](_0x5dd557(0x251))),0x1;const _0x2f1688=await confirmKey(_0x5dd557(0x1e7)+(_0x17a88f[_0x5dd557(0x284)]+_0x31bd18[_0x5dd557(0x284)])+_0x5dd557(0x26b));if(!_0x2f1688)return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x294)]('Aborted.'),_0x5dd557(0x1d5)),0x1;}!existsSync(_0x369aed)&&mkdirSync(_0x369aed,{'recursive':!![]});const _0x561a85=a27_0x303d57[_0x5dd557(0x299)](_0x369aed,'tdx.json');writeFileSync(_0x561a85,createTdxConfigContent(_0x39ad06),_0x5dd557(0x23f));for(const _0x5eb9f5 of _0x429447){(_0x5eb9f5[_0x5dd557(0x26a)]||_0x5eb9f5[_0x5dd557(0x28f)])&&writeFileSync(_0x5eb9f5[_0x5dd557(0x2b2)],_0x5eb9f5[_0x5dd557(0x238)],_0x5dd557(0x23f));}return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x200)+(_0x17a88f[_0x5dd557(0x284)]+_0x31bd18['length'])+_0x5dd557(0x237)+_0x369aed)),saveSessionContext({'parent_segment':_0x39ad06},_0x1dc154[_0x5dd557(0x271)]),console[_0x5dd557(0x290)](a27_0x43744a['green'](_0x5dd557(0x1d9)+a27_0x43744a[_0x5dd557(0x23d)](_0x5dd557(0x2b7))+'\x20=\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x39ad06))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a27_0x511dbc(0x225)]=a27_0x511dbc(0x1fc);async[a27_0x511dbc(0x229)](_0x887335){const _0x1500d9=a27_0x511dbc,{options:_0x1b9dc7,args:_0x21f75f,tdx:_0x46e7db}=_0x887335,_0x4479c5=_0x21f75f[0x0];if(!requireNameOrPath(_0x4479c5))return 0x1;_0x1b9dc7[_0x1500d9(0x1e3)]&&console[_0x1500d9(0x290)](_0x1500d9(0x257)+_0x4479c5);const {journeyId:_0x22fd0a}=await resolveJourneyIdFromInput(_0x4479c5,_0x1b9dc7,_0x46e7db),_0x42b059=await withSpinner(_0x1500d9(0x267),()=>_0x46e7db[_0x1500d9(0x24d)][_0x1500d9(0x1e6)](_0x22fd0a),{'verbose':_0x1b9dc7['verbose']}),_0x2e4b50=_0x42b059[_0x1500d9(0x253)];return console[_0x1500d9(0x279)](_0x1500d9(0x1f7)+_0x2e4b50[_0x1500d9(0x231)]),console[_0x1500d9(0x279)](_0x1500d9(0x205)+_0x2e4b50[_0x1500d9(0x269)]),await handleSDKOutput(_0x2e4b50['columns'],_0x1b9dc7),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x1e1);[a27_0x511dbc(0x225)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x511dbc(0x229)](_0x30c6ed){const _0x1c45c7=a27_0x511dbc,{options:_0x180226,args:_0x351c0e,tdx:_0x4b9119}=_0x30c6ed,_0x40cc86=_0x351c0e[0x0];if(!requireNameOrPath(_0x40cc86))return 0x1;_0x180226[_0x1c45c7(0x1e3)]&&console[_0x1c45c7(0x290)](_0x1c45c7(0x257)+_0x40cc86);const {journeyId:_0x2c8abb}=await resolveJourneyIdFromInput(_0x40cc86,_0x180226,_0x4b9119),_0x5e0d4c=await withSpinner(_0x1c45c7(0x2c7),()=>_0x4b9119[_0x1c45c7(0x24d)][_0x1c45c7(0x29f)](_0x2c8abb),{'verbose':_0x180226['verbose']}),_0x4baf60=_0x5e0d4c['data'];return console[_0x1c45c7(0x290)](_0x1c45c7(0x263)+_0x4baf60[_0x1c45c7(0x284)]+_0x1c45c7(0x2a0)+(_0x4baf60['length']!==0x1?'s':'')),await handleSDKOutput(_0x4baf60,_0x180226),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:push';[a27_0x511dbc(0x225)]=a27_0x511dbc(0x293);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x511dbc(0x229)](_0x3b1778){const _0x50d3c5=a27_0x511dbc,_0x4750f4=_0x3b1778[_0x50d3c5(0x1fd)][0x0];let _0x53ebd2;if(_0x4750f4){const _0xbc8a1c=await resolveTarget({'arg':_0x4750f4,'contextParent':_0x3b1778[_0x50d3c5(0x298)][_0x50d3c5(0x220)],'cwd':process[_0x50d3c5(0x27a)]()});isSuccessfulResolution(_0xbc8a1c)&&_0xbc8a1c['type']==='file'&&(_0x53ebd2=_0xbc8a1c[_0x50d3c5(0x2ce)]);}const _0x80780c={..._0x3b1778,'options':{..._0x3b1778[_0x50d3c5(0x298)],'journeysOnly':!![],..._0x53ebd2&&{'singleFilePath':_0x53ebd2}}};return this[_0x50d3c5(0x228)]['execute'](_0x80780c);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a27_0x511dbc(0x2b6);[a27_0x511dbc(0x225)]=a27_0x511dbc(0x2ae);async[a27_0x511dbc(0x229)](_0x90b254){const _0x1ea319=a27_0x511dbc,{options:_0x34a93f,args:_0x38d910,tdx:_0x3583d6}=_0x90b254,_0x42ee2e=_0x38d910[0x0];if(!requireNameOrPath(_0x42ee2e))return 0x1;if(_0x34a93f['verbose'])console[_0x1ea319(0x290)](_0x1ea319(0x257)+_0x42ee2e);const {journeyId:_0x17b66b}=await resolveJourneyIdFromInput(_0x42ee2e,_0x34a93f,_0x3583d6),_0x4855ae=await withSpinner(_0x1ea319(0x221),()=>_0x3583d6[_0x1ea319(0x24d)][_0x1ea319(0x1f0)](_0x17b66b),{'verbose':_0x34a93f[_0x1ea319(0x1e3)]}),{bundleName:_0xd4cfbd,versions:_0x3e7980,latestJourneyId:_0x4c67ef}=_0x4855ae[_0x1ea319(0x253)];console[_0x1ea319(0x290)](_0xd4cfbd+':\x20'+_0x3e7980[_0x1ea319(0x284)]+_0x1ea319(0x289)+(_0x3e7980[_0x1ea319(0x284)]!==0x1?'s':''));const _0x5df20d=_0x3e7980[_0x1ea319(0x20c)](_0x304666=>({'version':_0x304666[_0x1ea319(0x2be)],'journey_id':_0x304666[_0x1ea319(0x2a5)],'name':_0x304666[_0x1ea319(0x2ac)],'state':_0x304666['state'],'paused':_0x304666[_0x1ea319(0x203)],'latest':_0x304666[_0x1ea319(0x2a5)]===_0x4c67ef,'created_at':_0x304666['createdAt']}));return await handleSDKOutput(_0x5df20d,_0x34a93f),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x2ba);['description']=a27_0x511dbc(0x276);async[a27_0x511dbc(0x229)](_0x431522){const _0x4cabd5=a27_0x511dbc,{options:_0x49d896,args:_0x79fc78,tdx:_0x17b6b7}=_0x431522,_0xb78b1b=_0x79fc78[0x0];if(!requireNameOrPath(_0xb78b1b))return 0x1;if(_0x49d896[_0x4cabd5(0x1e3)])console[_0x4cabd5(0x290)](_0x4cabd5(0x257)+_0xb78b1b);const {journeyId:_0x45ecec,journeyName:_0x1e7d46}=await resolveJourneyIdFromInput(_0xb78b1b,_0x49d896,_0x17b6b7);if(!_0x49d896['yes']){const _0x4de838=await confirm(_0x4cabd5(0x278)+_0x1e7d46+'\x22?');if(!_0x4de838)return console[_0x4cabd5(0x290)](_0x4cabd5(0x259)),0x0;}const _0x155c82=await withSpinner(_0x4cabd5(0x233),()=>_0x17b6b7[_0x4cabd5(0x24d)][_0x4cabd5(0x1db)](_0x45ecec),{'verbose':_0x49d896[_0x4cabd5(0x1e3)]}),_0x21628d=_0x155c82['data'];return console[_0x4cabd5(0x290)](a27_0x43744a['green']('✔')+_0x4cabd5(0x26e)+_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2be)]+_0x4cabd5(0x288)+_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2ac)]+'\x22'),console[_0x4cabd5(0x290)](_0x4cabd5(0x1df)+_0x21628d['id']),await handleSingleObjectOutput({'id':_0x21628d['id'],'name':_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2ac)],'version':_0x21628d['attributes'][_0x4cabd5(0x2be)],'state':_0x21628d['attributes'][_0x4cabd5(0x24f)],'bundle_id':_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x1cc)],'created_at':_0x21628d[_0x4cabd5(0x1e5)]['createdAt']},_0x49d896),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:version:view';[a27_0x511dbc(0x225)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x511dbc(0x229)](_0x46057b){const _0x27ce79=a27_0x511dbc,{options:_0x3006d0,args:_0x3eb20a,tdx:_0x18821a}=_0x46057b,_0x42397e=_0x3eb20a[0x0];if(!requireNameOrPath(_0x42397e))return 0x1;const _0x230acb=_0x3006d0[_0x27ce79(0x1f3)];if(!_0x230acb)return console['error'](_0x27ce79(0x1d2)),console[_0x27ce79(0x290)](_0x27ce79(0x262)),0x1;const _0x3ea895=parseInt(_0x230acb,0xa);if(isNaN(_0x3ea895)||_0x3ea895<0x1)return console[_0x27ce79(0x290)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x230acb),0x1;if(_0x3006d0['verbose'])console[_0x27ce79(0x290)](_0x27ce79(0x257)+_0x42397e+_0x27ce79(0x2a9)+_0x3ea895);const {journeyId:_0x3c1655,parentSegmentId:_0x523549}=await resolveJourneyIdFromInput(_0x42397e,_0x3006d0,_0x18821a),_0x39ad2a=await withSpinner(_0x27ce79(0x21c),()=>_0x18821a['journey'][_0x27ce79(0x1f0)](_0x3c1655),{'verbose':_0x3006d0[_0x27ce79(0x1e3)]}),{versions:_0x2298c3,latestJourneyId:_0x2187f3}=_0x39ad2a[_0x27ce79(0x253)],_0x20e857=_0x2298c3['find'](_0x274d8c=>_0x274d8c['versionNumber']===_0x3ea895);if(!_0x20e857){const _0x14b59b=_0x2298c3[_0x27ce79(0x20c)](_0x15116e=>'v'+_0x15116e[_0x27ce79(0x2be)])[_0x27ce79(0x299)](',\x20');return console[_0x27ce79(0x290)](_0x27ce79(0x2a4)+_0x3ea895+_0x27ce79(0x218)+_0x14b59b),0x1;}const _0x49e6d0=await withSpinner('Getting\x20version\x20'+_0x3ea895+'\x20details...',()=>_0x18821a[_0x27ce79(0x24d)]['getJourney'](_0x20e857['journeyId']),{'verbose':_0x3006d0[_0x27ce79(0x1e3)]}),_0x227f1a=_0x49e6d0[_0x27ce79(0x253)],_0x34cca8=getConsoleNextUrl(_0x3006d0[_0x27ce79(0x2b8)],_0x27ce79(0x236)+_0x523549+_0x27ce79(0x1dd)+_0x20e857[_0x27ce79(0x2a5)]+_0x27ce79(0x23a));return await handleSingleObjectOutput({'id':_0x227f1a['id'],'name':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x2ac)],'version':_0x227f1a[_0x27ce79(0x1e5)]['versionNumber'],'description':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x225)],'state':_0x227f1a[_0x27ce79(0x1e5)]['state'],'paused':_0x227f1a[_0x27ce79(0x1e5)]['paused'],'reentry_mode':_0x227f1a['attributes'][_0x27ce79(0x206)],'stages':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x1f8)]?.[_0x27ce79(0x284)]||0x0,..._0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x292)]&&{'goal':_0x227f1a['attributes'][_0x27ce79(0x292)][_0x27ce79(0x2ac)]},'latest':_0x20e857[_0x27ce79(0x2a5)]===_0x2187f3,'created_at':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x2af)],'updated_at':_0x227f1a['attributes']['updatedAt'],'url':_0x34cca8},_0x3006d0),0x0;}}
1
+ const a27_0x53a51e=a27_0x5b9d;(function(_0x11fa17,_0x5dac7a){const _0x430ecd=a27_0x5b9d,_0x47201d=_0x11fa17();while(!![]){try{const _0x23daca=parseInt(_0x430ecd(0x18e))/0x1+-parseInt(_0x430ecd(0x1d7))/0x2*(-parseInt(_0x430ecd(0x1ae))/0x3)+parseInt(_0x430ecd(0x1ac))/0x4*(parseInt(_0x430ecd(0x15e))/0x5)+parseInt(_0x430ecd(0x1a2))/0x6*(parseInt(_0x430ecd(0x168))/0x7)+parseInt(_0x430ecd(0x16f))/0x8+-parseInt(_0x430ecd(0xf6))/0x9+-parseInt(_0x430ecd(0x17b))/0xa;if(_0x23daca===_0x5dac7a)break;else _0x47201d['push'](_0x47201d['shift']());}catch(_0x4dd1fe){_0x47201d['push'](_0x47201d['shift']());}}}(a27_0x34ea,0x1a42f));import a27_0x564625 from'chalk';import a27_0x2ae22b from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a27_0x5b9d(_0x39a1b7,_0x5cfbb6){_0x39a1b7=_0x39a1b7-0xef;const _0x34ea60=a27_0x34ea();let _0x5b9d39=_0x34ea60[_0x39a1b7];return _0x5b9d39;}import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';function a27_0x34ea(){const _0x4f01de=['Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','content','createVersion','\x20=\x20','diff','includeHistory','2644420nESpnw','buildIdToEmailMap','exitOrJumpRate','Fetching\x20','listFolders','Error:\x20Journey\x20not\x20found:\x20','absolutePath','journeyBundleId','\x20changed\x20files','folderId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','file','kind','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22',',\x20version:\x20','conversion','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','journey:push','100977eXbDQF','journey','(draft)','\x20activation','Getting\x20column\x20mapping...','connection','Resolving\x20version...','isNew','error','Target\x20directory:\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Creating\x20new\x20version...','Warning:\x20Could\x20not\x20resolve\x20segment\x20','.yml','size','paused','segmentName','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','List\x20activations\x20for\x20a\x20journey','nodes','678CSaXZK','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Parent\x20segment:\x20','\x20(rule\x20match)','columns','filePath','log','\x20(ID:\x20','yellow','12WNPbgF','archived','57YVDumh','renderStats','Options:','\x20Created\x20v','listJourneysFromParentSegment','session','journey:view','(root)','Resolving\x20parent\x20segment...','\x22\x20paused','Pause\x20a\x20running\x20journey','Write\x20','green','completionRate','blue','\x20(draft)\x20—\x20\x22','exitOrJumpSize','getStatistics','listJourneysWithFolders','relativePath','json','table','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x0aChanges\x20to\x20\x27','journeyId','dryRun','journeyName','Input:\x20','Show\x20journey\x20details','join','milestoneSize','resourceName','Fetching\x20journeys\x20and\x20folders...','segmentPushCommand','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20\x20Statistics\x20not\x20available','journey:stats','stages','\x20journey\x20files\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Resume\x20a\x20paused\x20journey','10588mLPSvI','...','database','type','Error:\x20Journey\x20\x27','length','\x20\x20Folder\x20path:\x20','\x20->\x20','pause','parent_segment','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','List\x20all\x20versions\x20of\x20a\x20journey','journey:traffic','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Fetching\x20parent\x20segment...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Available\x20stages:\x20','repeat','add','cwd','all','getColumnMapping','INVALID_ARGUMENT','completeMilestoneRate','Resolved\x20YAML\x20file:\x20','yes','execute','updatedAt','has','Warning:\x20Could\x20not\x20resolve\x20activation\x20','filter','Target\x20file:\x20','List\x20journeys\x20in\x20current\x20context','user','Fetching\x20users\x20and\x20connections...','\x20\x20Target:\x20','history','\x20\x20Name:\x20','listActivationsFlat','\x0aPull\x20summary:','entries','createdAt','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Stage\x20\x22','relative','sort','limit','set','getActivation','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','741501hKJcji','Pausing\x20journey...','description','get','data','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','attributes','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','find','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20new\x20files','then','Getting\x20journey\x20statistics...','(completed)','Resuming\x20journey...','journey:resume','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','name','/app/ps/','journey:pause','journeys','red','folderPath','format','hasChanges','setPhase','test','Error:\x20Invalid\x20version\x20number:\x20','getJourney','folders','Resolving\x20journey...','Cancelled','options','getSegment','goalSize','✔\x20Journey\x20\x22','Show\x20journey\x20statistics','Getting\x20version\x20','push','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x22\x20resumed','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','verbose','getLatestJourneyId','Folder\x20path:\x20','Error:\x20--version\x20option\x20is\x20required','helpText','\x20unchanged\x20files','versionNumber','\x5c$&','goal','state','Found\x20','base','journey:activations','/e/','reentryMode','No\x20statistics\x20available\x20for\x20journey:\x20','localeCompare','\x22\x20not\x20found','utf-8','targetDir','Getting\x20journey\x20details...','(paused)','/j/da/je','segment','-\x20no\x20files\x20written','Show\x20journey\x20table\x20column\x20mapping','enteredSize','split','errorCode','args','\x20version','rule','\x20journey','Database:\x20','\x20versions)','activation','Listing\x20journey\x20versions...','\x20not\x20found.\x20Available:\x20','completed','message','journeyBundleName','journey:versions','segments','\x20files?','✔\x20Pulled\x20','Journey\x20name:\x20','Listing\x20journey\x20activations...','dim','connector_config','Table:\x20','hasPeriod','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','includeStats','toLowerCase','Export\x20journey(s)\x20as\x20YAML\x20files','\x20Opening\x20','resolveSegment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Listing\x20journeys...','bold','Error:\x20Parent\x20segment\x20context\x20required','331225meyIci','listVersions','\x20\x20Journey\x20ID:\x20','getParentFull','rootFolderId','parentSegment','launched','site','from','values','3241NzbVcv','getTrafficData','jsonl','journeyStages','root\x20folder','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','web','14248JUJxtg','links','cyan','map','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','journey:columns'];a27_0x34ea=function(){return _0x4f01de;};return a27_0x34ea();}import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x21ac62){const _0x41bf13=a27_0x5b9d;return!_0x21ac62&&(console['error'](_0x41bf13(0x1c4)),console[_0x41bf13(0x196)](_0x41bf13(0x107))),!!_0x21ac62;}function withJsonFormat(_0x480afb){const _0x283b06=a27_0x5b9d;if(!_0x480afb[_0x283b06(0x10e)]&&!_0x480afb[_0x283b06(0x1c2)]&&!_0x480afb[_0x283b06(0x16a)]&&!_0x480afb['tsv'])return{..._0x480afb,'format':'json','json':!![]};return _0x480afb;}function formatJourneyState(_0x35194e){const _0x33f103=a27_0x5b9d;switch(_0x35194e){case _0x33f103(0x164):return a27_0x564625[_0x33f103(0x1ba)]('(running)');case'draft':return a27_0x564625[_0x33f103(0x150)](_0x33f103(0x190));case _0x33f103(0x19d):return a27_0x564625[_0x33f103(0x1ab)](_0x33f103(0x136));case _0x33f103(0x147):return a27_0x564625[_0x33f103(0x1bc)](_0x33f103(0x104));case _0x33f103(0x1ad):return a27_0x564625[_0x33f103(0x150)]('(archived)');default:return'('+_0x35194e+')';}}function formatJourneyItem(_0x18b61d,_0x2eff6a='',_0x5efc69){const _0x517a89=a27_0x5b9d,_0x43ada1=formatJourneyState(_0x18b61d['state']),_0x57184e=_0x5efc69?hyperlink(_0x18b61d['journeyBundleName'],_0x5efc69):_0x18b61d[_0x517a89(0x149)];return _0x2eff6a+'🗺️\x20'+_0x57184e+'\x20'+_0x43ada1;}function escapeRegex(_0x169c2f){const _0x317fee=a27_0x5b9d;return _0x169c2f['replace'](/[.*+?^${}()|[\]\\]/g,_0x317fee(0x128));}function globToRegex(_0x2041fb){const _0x41dd9e=a27_0x5b9d,_0x2201ee=_0x2041fb[_0x41dd9e(0x13c)]('*')[_0x41dd9e(0x172)](escapeRegex);return new RegExp(_0x2201ee[_0x41dd9e(0x1cb)]('.*'),'i');}function buildRuleToNameMapping(_0x2bdc21){const _0x1e42c9=a27_0x5b9d,_0x5c0fcb=new Map();if(_0x2bdc21[_0x1e42c9(0x14b)])for(const [_0x4bc7de,_0xad402d]of Object[_0x1e42c9(0x1ff)](_0x2bdc21[_0x1e42c9(0x14b)])){if(_0xad402d[_0x1e42c9(0x140)]){const _0x5c3f61=serializeRule(_0xad402d[_0x1e42c9(0x140)]),_0x43bf98=_0x5c0fcb['get'](_0x5c3f61);_0x43bf98?_0x43bf98[_0x1e42c9(0x11d)](_0x4bc7de):_0x5c0fcb[_0x1e42c9(0xf3)](_0x5c3f61,[_0x4bc7de]);}}return _0x5c0fcb;}async function resolveJourneyIdFromInput(_0x478e04,_0x47ea59,_0x41165d){const _0x1135b3=a27_0x5b9d,_0x4c0939=await resolveJourneyTarget(_0x478e04,_0x47ea59['parentSegment'],_0x47ea59[_0x1135b3(0x121)]),_0x4fb05e=_0x4c0939[_0x1135b3(0x163)];if(!_0x4fb05e)throw new SDKError(ErrorCode[_0x1135b3(0x1ed)],_0x1135b3(0x1e4));const _0x1d7afa=await withSpinner(_0x1135b3(0x1b6),()=>_0x41165d['segment']['resolveParentId'](_0x4fb05e),{'verbose':_0x47ea59[_0x1135b3(0x121)]}),_0x324265=_0x1d7afa[_0x1135b3(0xfa)],_0x3afd40=await withSpinner(_0x1135b3(0x115),()=>_0x41165d[_0x1135b3(0x18f)]['resolveJourneyId'](_0x324265,_0x4c0939[_0x1135b3(0x1c8)]),{'verbose':_0x47ea59['verbose']});return{'journeyId':_0x3afd40[_0x1135b3(0xfa)],'journeyName':_0x4c0939[_0x1135b3(0x1c8)],'parentSegmentId':_0x324265};}async function resolveJourneyTarget(_0x350958,_0x488d80,_0xeb57b0){const _0x2bd994=a27_0x5b9d;if(isYamlFilePath(_0x350958))try{const _0x1c9d37=await resolveYamlFilePath(_0x350958);return _0xeb57b0&&(console[_0x2bd994(0x196)](_0x2bd994(0x1ef)+_0x350958),console['error']('\x20\x20Parent\x20segment:\x20'+_0x1c9d37['parentSegment']),console[_0x2bd994(0x196)](_0x2bd994(0x1fc)+_0x1c9d37[_0x2bd994(0x19e)]),console[_0x2bd994(0x196)](_0x2bd994(0x1dd)+(_0x1c9d37[_0x2bd994(0x10d)]||_0x2bd994(0x1b5)))),{'journeyName':_0x1c9d37[_0x2bd994(0x19e)],'parentSegment':_0x1c9d37[_0x2bd994(0x163)],'resolved':_0x1c9d37};}catch(_0x3fe76f){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x3fe76f[_0x2bd994(0x148)]);}if(!_0x488d80)throw new SDKError(ErrorCode[_0x2bd994(0x1ed)],_0x2bd994(0x201));return{'journeyName':_0x350958,'parentSegment':_0x488d80};}export class JourneyListCommand extends BaseCommand{[a27_0x53a51e(0x108)]='journey:list';['description']=a27_0x53a51e(0x1f7);async['execute'](_0x5a5bf0){const _0x32549f=a27_0x53a51e,{options:_0xc59df9,args:_0x56d760,tdx:_0x5afd8c}=_0x5a5bf0,_0x16e08c=_0x56d760[0x0],_0x47ba5c=_0xc59df9[_0x32549f(0x163)];if(!_0x47ba5c)return console[_0x32549f(0x196)](_0x32549f(0x15d)),console[_0x32549f(0x196)](_0x32549f(0x188)),0x1;const _0x1d29d9=await withSpinner(_0x32549f(0x1b6),()=>_0x5afd8c[_0x32549f(0x138)]['resolveParentId'](_0x47ba5c),{'verbose':_0xc59df9[_0x32549f(0x121)]}),_0x57ce32=_0x1d29d9['data'];_0xc59df9[_0x32549f(0x121)]&&(console[_0x32549f(0x196)](_0x32549f(0x1a5)+_0x47ba5c+_0x32549f(0x1aa)+_0x57ce32+')'),_0x16e08c&&console[_0x32549f(0x196)]('Pattern:\x20'+_0x16e08c));const _0x2ad3a2=await withSpinner(_0x32549f(0x1e5),()=>_0x5afd8c[_0x32549f(0x138)][_0x32549f(0x161)](_0x57ce32),{'verbose':_0xc59df9[_0x32549f(0x121)]}),_0x2e267f=_0x2ad3a2[_0x32549f(0xfa)],_0x44c1ac=_0x2e267f[_0x32549f(0x162)],_0x22f4cd=await withSpinner(_0x32549f(0x15b),()=>_0x5afd8c[_0x32549f(0x18f)][_0x32549f(0x1c0)](_0x57ce32,_0x44c1ac),{'verbose':_0xc59df9[_0x32549f(0x121)]});let _0x1bacfe=_0x22f4cd['data'][_0x32549f(0x10b)];const _0x559cd9=_0x22f4cd[_0x32549f(0xfa)][_0x32549f(0x114)],_0xa81fd3=new Map();for(const _0x5db01e of _0x559cd9){_0xa81fd3['set'](_0x5db01e['id'],_0x5db01e[_0x32549f(0x108)]);}if(_0x16e08c){const _0xbceb1e=globToRegex(_0x16e08c);_0x1bacfe=_0x1bacfe[_0x32549f(0x1f5)](_0x10fac6=>_0xbceb1e[_0x32549f(0x111)](_0x10fac6[_0x32549f(0x149)]));}console['error']('✔\x20Found\x20'+_0x1bacfe[_0x32549f(0x1dc)]+_0x32549f(0x141)+(_0x1bacfe[_0x32549f(0x1dc)]!==0x1?'s':''));const _0x443fec=_0x3f50a0=>{const _0x38470f=_0x32549f;return getConsoleNextUrl(_0xc59df9[_0x38470f(0x165)],'/app/ps/'+_0x57ce32+'/e/'+_0x3f50a0+'/j/da');};if(_0xc59df9[_0x32549f(0x10e)]===_0x32549f(0x1c3))await handleSDKOutput(_0x1bacfe,_0xc59df9);else{if(_0xc59df9[_0x32549f(0x10e)]===_0x32549f(0x1c2)){const _0x19d1b8=_0x1bacfe[_0x32549f(0x172)](_0x2d78ad=>({..._0x2d78ad,'url':_0x443fec(_0x2d78ad['id'])}));await handleSDKOutput(_0x19d1b8,_0xc59df9);}else{console[_0x32549f(0x1a9)]('['+_0x47ba5c+']');const _0x15ebcd=new Map(),_0x331348=[];for(const _0x388b1c of _0x1bacfe){if(!_0x388b1c['folderId']||_0x388b1c[_0x32549f(0x184)]===_0x44c1ac)_0x331348['push'](_0x388b1c);else{const _0x353caa=_0x15ebcd[_0x32549f(0xf9)](_0x388b1c[_0x32549f(0x184)])||[];_0x353caa['push'](_0x388b1c),_0x15ebcd[_0x32549f(0xf3)](_0x388b1c[_0x32549f(0x184)],_0x353caa);}}const _0x372c43=(_0x36ba96,_0x52f02b)=>_0x36ba96[_0x32549f(0x149)][_0x32549f(0x131)](_0x52f02b[_0x32549f(0x149)],undefined,{'sensitivity':'base'});_0x331348['sort'](_0x372c43);for(const _0x1f4050 of _0x331348){console[_0x32549f(0x1a9)](formatJourneyItem(_0x1f4050,'',_0x443fec(_0x1f4050['id'])));}const _0x5b8c82=[..._0x15ebcd[_0x32549f(0x1ff)]()][_0x32549f(0xf1)]((_0x335034,_0x168932)=>{const _0x18a5ec=_0x32549f,_0x357d9e=_0xa81fd3[_0x18a5ec(0xf9)](_0x335034[0x0])||_0x335034[0x0],_0x5ceb33=_0xa81fd3[_0x18a5ec(0xf9)](_0x168932[0x0])||_0x168932[0x0];return _0x357d9e[_0x18a5ec(0x131)](_0x5ceb33,undefined,{'sensitivity':_0x18a5ec(0x12c)});});for(const [_0x486f07,_0x424b6c]of _0x5b8c82){const _0x2fd838=_0xa81fd3[_0x32549f(0xf9)](_0x486f07)||_0x486f07;console[_0x32549f(0x1a9)]('📁\x20'+_0x2fd838),_0x424b6c[_0x32549f(0xf1)](_0x372c43);for(const _0x456ecd of _0x424b6c){console[_0x32549f(0x1a9)](formatJourneyItem(_0x456ecd,'\x20\x20',_0x443fec(_0x456ecd['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x53a51e(0x1b4);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1ca);async[a27_0x53a51e(0x1f1)](_0x1bca66){const _0x936275=a27_0x53a51e,{options:_0x1fb520,args:_0x18141e,tdx:_0x5e7617}=_0x1bca66,_0x1954c6=_0x18141e[0x0];if(!_0x1954c6)return console[_0x936275(0x196)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x936275(0x196)](_0x936275(0xfb)),console['error'](_0x936275(0x1b0)),console[_0x936275(0x196)](_0x936275(0x120)),0x1;_0x1fb520[_0x936275(0x121)]&&console[_0x936275(0x196)]('Input:\x20'+_0x1954c6);const {journeyId:_0x304529,parentSegmentId:_0x2d3100}=await resolveJourneyIdFromInput(_0x1954c6,_0x1fb520,_0x5e7617);if(_0x1fb520[_0x936275(0x16e)]){const _0x4abd88=getConsoleNextUrl(_0x1fb520[_0x936275(0x165)],_0x936275(0x109)+_0x2d3100+'/e/'+_0x304529+_0x936275(0x137));return console[_0x936275(0x196)](a27_0x564625[_0x936275(0x1ba)]('✔')+_0x936275(0x158)+a27_0x564625['cyan'](_0x4abd88)),openBrowser(_0x4abd88),0x0;}const _0x4b7fc8=await withSpinner(_0x936275(0x135),()=>_0x5e7617[_0x936275(0x18f)][_0x936275(0x113)](_0x304529),{'verbose':_0x1fb520[_0x936275(0x121)]}),_0x4c9d51=_0x4b7fc8[_0x936275(0xfa)],_0x5ee5bf=_0x1fb520[_0x936275(0x155)];let _0x9ca0e3;if(_0x5ee5bf)try{const _0x16bc8b=await withSpinner(_0x936275(0x103),()=>_0x5e7617[_0x936275(0x18f)][_0x936275(0x1bf)](_0x304529),{'verbose':_0x1fb520[_0x936275(0x121)]});_0x9ca0e3=_0x16bc8b[_0x936275(0xfa)];}catch{_0x1fb520[_0x936275(0x121)]&&console[_0x936275(0x196)](_0x936275(0x1d1));}const _0x1017f1=getConsoleNextUrl(_0x1fb520['site'],_0x936275(0x109)+_0x2d3100+_0x936275(0x12e)+_0x304529+_0x936275(0x137)),_0x240f7f={'id':_0x4c9d51['id'],'name':_0x4c9d51['attributes']['name'],'description':_0x4c9d51[_0x936275(0xfc)]['description'],'state':_0x4c9d51[_0x936275(0xfc)][_0x936275(0x12a)],'paused':_0x4c9d51[_0x936275(0xfc)]['paused'],'reentry_mode':_0x4c9d51[_0x936275(0xfc)][_0x936275(0x12f)],'stages':_0x4c9d51[_0x936275(0xfc)][_0x936275(0x16b)]?.[_0x936275(0x1dc)]||0x0,..._0x4c9d51[_0x936275(0xfc)][_0x936275(0x129)]&&{'goal':_0x4c9d51[_0x936275(0xfc)][_0x936275(0x129)]['name']},..._0x9ca0e3&&{'statistics':{'size':_0x9ca0e3['size'],'entered':_0x9ca0e3[_0x936275(0x13b)],'goal_achieved':_0x9ca0e3[_0x936275(0x119)],'completion_rate':_0x9ca0e3[_0x936275(0x1bb)],'exit_or_jump':_0x9ca0e3['exitOrJumpSize'],'exit_or_jump_rate':_0x9ca0e3['exitOrJumpRate'],'stages':_0x9ca0e3[_0x936275(0x1d3)]}},'url':_0x1017f1};return await handleSingleObjectOutput(_0x240f7f,_0x1fb520),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x1d2);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x11b);async[a27_0x53a51e(0x1f1)](_0x24ab8e){const _0x2054c2=a27_0x53a51e,{options:_0x177ed6,args:_0xc53f19,tdx:_0x275651}=_0x24ab8e,_0x118843=_0xc53f19[0x0];if(!requireNameOrPath(_0x118843))return 0x1;_0x177ed6[_0x2054c2(0x121)]&&console[_0x2054c2(0x196)]('Input:\x20'+_0x118843);const _0x40b6f0=_0x177ed6,_0x5591a5=_0x40b6f0[_0x2054c2(0x166)],_0x206ef6=_0x40b6f0['to'],_0x5d2c7f=_0x40b6f0[_0x2054c2(0x17a)],_0x4a2635=_0x40b6f0['stage'];_0x5d2c7f&&!_0x5591a5&&!_0x206ef6&&console[_0x2054c2(0x196)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x286d01=_0x5d2c7f?withJsonFormat(_0x177ed6):_0x177ed6,{journeyId:_0x32b91c,journeyName:_0x131ea8}=await resolveJourneyIdFromInput(_0x118843,_0x286d01,_0x275651),_0x278b14=_0x5591a5||_0x206ef6?{'from':_0x5591a5,'to':_0x206ef6}:undefined,_0x104b5d=await withSpinner(_0x2054c2(0x103),()=>Promise['all']([_0x275651[_0x2054c2(0x18f)][_0x2054c2(0x113)](_0x32b91c),_0x275651[_0x2054c2(0x18f)][_0x2054c2(0x1bf)](_0x32b91c,_0x278b14)]),{'verbose':_0x286d01[_0x2054c2(0x121)]}),[_0x463e6c,_0x14c633]=_0x104b5d[_0x2054c2(0xfa)];if(!_0x14c633||_0x14c633[_0x2054c2(0x1c6)]===null)return console[_0x2054c2(0x196)](_0x2054c2(0x130)+_0x131ea8),console[_0x2054c2(0x196)](_0x2054c2(0x1e1)),0x0;const _0x40d2b9=buildStageNameMap(_0x463e6c),_0x218c74=!!(_0x278b14&&_0x14c633[_0x2054c2(0x1fb)]?.['length']),_0x47b915={'stageNameMap':_0x40d2b9,'hasPeriod':_0x218c74,'includeHistory':!!_0x5d2c7f};if(_0x4a2635&&_0x14c633[_0x2054c2(0x1d3)]){const _0x516cd6=_0x14c633[_0x2054c2(0x1d3)][_0x2054c2(0xff)](_0x1d88da=>{const _0x181a2d=_0x2054c2,_0x3272f2=_0x40d2b9[_0x181a2d(0xf9)](_0x1d88da['id'])??'';return _0x3272f2[_0x181a2d(0x156)]()===_0x4a2635['toLowerCase']();});if(_0x516cd6)return await handleSingleObjectOutput(formatStageStats(_0x516cd6,_0x47b915),_0x286d01),0x0;const _0x184a03=_0x14c633[_0x2054c2(0x1d3)][_0x2054c2(0x172)](_0x5bdcdf=>_0x40d2b9['get'](_0x5bdcdf['id'])??_0x5bdcdf['id']);return console[_0x2054c2(0x196)](_0x2054c2(0xef)+_0x4a2635+_0x2054c2(0x132)),console[_0x2054c2(0x196)](_0x2054c2(0x1e7)+_0x184a03[_0x2054c2(0x1cb)](',\x20')),0x1;}const _0x59d68d=_0x14c633[_0x2054c2(0x1d3)]?.[_0x2054c2(0x172)](_0x1163b0=>formatStageStats(_0x1163b0,_0x47b915)),_0x454529=assembleJourneyStats(_0x14c633,{'from':_0x5591a5,'to':_0x206ef6,'includeHistory':_0x5d2c7f});return await this[_0x2054c2(0x1af)](_0x454529,_0x59d68d??[],_0x286d01),0x0;}async[a27_0x53a51e(0x1af)](_0x439c39,_0xe97e80,_0x494841){const _0x124548=a27_0x53a51e,_0x1aa118=_0x494841['format']===_0x124548(0x1c2)||_0x494841['format']===_0x124548(0x16a)||_0x494841[_0x124548(0x1c2)]||_0x494841[_0x124548(0x16a)];if(_0x1aa118){_0x439c39[_0x124548(0x1d3)]=_0xe97e80,await handleSingleObjectOutput(_0x439c39,_0x494841);return;}await handleSingleObjectOutput(_0x439c39,_0x494841);for(const _0x1a0cb8 of _0xe97e80){console[_0x124548(0x1a9)](''),console[_0x124548(0x1a9)](String(a27_0x564625[_0x124548(0x171)][_0x124548(0x15c)]('['+_0x1a0cb8[_0x124548(0x108)]+']'))+a27_0x564625[_0x124548(0x150)]('\x20'+_0x1a0cb8['id']));const {id:_0x3c41bf,name:_0x1fb37f,..._0x290208}=_0x1a0cb8;await handleSingleObjectOutput(_0x290208,_0x494841);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x1e3);[a27_0x53a51e(0xf8)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a27_0x53a51e(0x1f1)](_0x263b42){const _0x3d89d7=a27_0x53a51e,{options:_0x4331e0,args:_0x4e23fb,tdx:_0x1a015c}=_0x263b42,_0x12ac1e=_0x4e23fb[0x0];if(!requireNameOrPath(_0x12ac1e))return 0x1;_0x4331e0[_0x3d89d7(0x121)]&&console[_0x3d89d7(0x196)](_0x3d89d7(0x1c9)+_0x12ac1e);const _0x1c9668=_0x4331e0,_0x215b4a=_0x1c9668[_0x3d89d7(0x1da)],_0x4c09fb=_0x1c9668[_0x3d89d7(0x166)],_0x4e1343=_0x1c9668['to'],_0x57f89b=_0x1c9668[_0x3d89d7(0xf2)];if(_0x215b4a&&_0x215b4a!==_0x3d89d7(0x18a)&&_0x215b4a!=='activation')return console[_0x3d89d7(0x196)]('Error:\x20Invalid\x20--type\x20\x22'+_0x215b4a+_0x3d89d7(0x198)),0x1;const _0x321eb4=withJsonFormat(_0x4331e0),{journeyId:_0x46272f,journeyName:_0x1be614}=await resolveJourneyIdFromInput(_0x12ac1e,_0x321eb4,_0x1a015c),_0x129157={'type':_0x215b4a,'from':_0x4c09fb,'to':_0x4e1343,'limit':_0x57f89b},_0x56f486=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x1a015c[_0x3d89d7(0x18f)][_0x3d89d7(0x169)](_0x46272f,_0x129157),{'verbose':_0x321eb4['verbose']}),_0x311f94=_0x56f486[_0x3d89d7(0xfa)],_0x4c2973=_0x311f94[_0x3d89d7(0x18a)]&&(_0x311f94[_0x3d89d7(0x18a)][_0x3d89d7(0x1a1)][_0x3d89d7(0x1dc)]>0x0||_0x311f94[_0x3d89d7(0x18a)][_0x3d89d7(0x170)][_0x3d89d7(0x1dc)]>0x0),_0x146a49=_0x311f94[_0x3d89d7(0x144)]&&_0x311f94['activation'][_0x3d89d7(0x1dc)]>0x0;if(!_0x4c2973&&!_0x146a49)return console[_0x3d89d7(0x196)](_0x3d89d7(0x1a3)+_0x1be614),console[_0x3d89d7(0x196)](_0x3d89d7(0xfe)),_0x4c09fb&&_0x4e1343&&console[_0x3d89d7(0x196)](_0x3d89d7(0x185)),0x0;return await handleSingleObjectOutput(_0x311f94,_0x321eb4),0x0;}}function formatStageStats(_0xd47ce5,_0x2fd0e7){const _0x49acd9=a27_0x53a51e,_0x39dfb0=_0x2fd0e7[_0x49acd9(0x153)]&&_0xd47ce5[_0x49acd9(0x1fb)]?.['length']?aggregateStageHistory(_0xd47ce5[_0x49acd9(0x1fb)]):{'size':_0xd47ce5[_0x49acd9(0x19c)],'entered':_0xd47ce5[_0x49acd9(0x13b)],'milestone':_0xd47ce5[_0x49acd9(0x1cc)],'milestone_rate':_0xd47ce5[_0x49acd9(0x1ee)],'exit_or_jump':_0xd47ce5[_0x49acd9(0x1be)],'exit_or_jump_rate':_0xd47ce5[_0x49acd9(0x17d)]},_0x58b7f6={'id':_0xd47ce5['id'],'name':_0x2fd0e7['stageNameMap'][_0x49acd9(0xf9)](_0xd47ce5['id'])??_0xd47ce5['id'],..._0x39dfb0};return _0x2fd0e7[_0x49acd9(0x153)]&&_0x2fd0e7[_0x49acd9(0x17a)]&&_0xd47ce5[_0x49acd9(0x1fb)]&&(_0x58b7f6['history']=_0xd47ce5[_0x49acd9(0x1fb)]),_0x58b7f6;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x53a51e(0x10a);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1b8);async[a27_0x53a51e(0x1f1)](_0x2b8829){const _0x567bfc=a27_0x53a51e,{options:_0x5793e0,args:_0xf569ea,tdx:_0x1e89ee}=_0x2b8829,_0x1af1f0=_0xf569ea[0x0];if(!requireNameOrPath(_0x1af1f0))return 0x1;_0x5793e0[_0x567bfc(0x121)]&&console[_0x567bfc(0x196)](_0x567bfc(0x1c9)+_0x1af1f0);const {journeyId:_0x4d824d,journeyName:_0x5d562e}=await resolveJourneyIdFromInput(_0x1af1f0,_0x5793e0,_0x1e89ee);if(!_0x5793e0['yes']){const _0x20fe79=await confirm(_0x567bfc(0xf5)+_0x5d562e+'\x22?');if(!_0x20fe79)return console[_0x567bfc(0x196)]('Cancelled'),0x0;}const _0x1fcb49=await withSpinner(_0x567bfc(0xf7),()=>_0x1e89ee[_0x567bfc(0x18f)][_0x567bfc(0x1df)](_0x4d824d),{'verbose':_0x5793e0[_0x567bfc(0x121)]}),_0x20ecf2=_0x1fcb49[_0x567bfc(0xfa)];return console['error'](_0x567bfc(0x11a)+_0x20ecf2[_0x567bfc(0xfc)][_0x567bfc(0x108)]+_0x567bfc(0x1b7)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x53a51e(0x106);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1d6);async[a27_0x53a51e(0x1f1)](_0x359150){const _0x484d4f=a27_0x53a51e,{options:_0x2fc28c,args:_0x11392e,tdx:_0x2717cb}=_0x359150,_0x561988=_0x11392e[0x0];if(!requireNameOrPath(_0x561988))return 0x1;_0x2fc28c[_0x484d4f(0x121)]&&console[_0x484d4f(0x196)]('Input:\x20'+_0x561988);const {journeyId:_0x2cae2e,journeyName:_0x2f94e4}=await resolveJourneyIdFromInput(_0x561988,_0x2fc28c,_0x2717cb);if(!_0x2fc28c['yes']){const _0x4e6c93=await confirm(_0x484d4f(0x19f)+_0x2f94e4+'\x22?');if(!_0x4e6c93)return console[_0x484d4f(0x196)](_0x484d4f(0x116)),0x0;}const _0x160dd7=await withSpinner(_0x484d4f(0x105),()=>_0x2717cb[_0x484d4f(0x18f)]['resume'](_0x2cae2e),{'verbose':_0x2fc28c['verbose']}),_0x335cd8=_0x160dd7['data'];return console[_0x484d4f(0x196)](_0x484d4f(0x11a)+_0x335cd8[_0x484d4f(0xfc)]['name']+_0x484d4f(0x11f)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x53a51e(0x108)]='journey:pull';[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x157);async[a27_0x53a51e(0x1f1)](_0x24c8c3){const _0x35a253=a27_0x53a51e,{options:_0x34653a,args:_0x4dc1ba,tdx:_0x2dea17}=_0x24c8c3,_0x588306=_0x34653a,_0x2f829f=_0x4dc1ba[0x0],_0x37f9eb=_0x2f829f&&isYamlFilePath(_0x2f829f),_0x3607d0=await resolveTarget({'arg':_0x37f9eb?_0x2f829f:undefined,'contextParent':_0x34653a[_0x35a253(0x163)],'cwd':process[_0x35a253(0x1ea)]()});if(!isSuccessfulResolution(_0x3607d0))return _0x3607d0[_0x35a253(0x13d)]==='no_parent'?(console[_0x35a253(0x196)](a27_0x564625['yellow'](_0x35a253(0x154))),console[_0x35a253(0x196)](_0x35a253(0x16d)),console[_0x35a253(0x196)](_0x35a253(0x1d5)),console[_0x35a253(0x196)](_0x35a253(0x100)),console['error'](_0x35a253(0x1a4))):(console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x10c)]('Error:\x20'+_0x3607d0[_0x35a253(0x148)]+'\x0a')),_0x3607d0[_0x35a253(0x125)]&&console['error'](a27_0x564625[_0x35a253(0x171)](_0x3607d0[_0x35a253(0x125)]))),0x1;let _0x16d25f=_0x37f9eb?undefined:_0x2f829f,_0x8bdabd,_0x24d66d;_0x3607d0[_0x35a253(0x1da)]===_0x35a253(0x186)&&(_0x16d25f=_0x3607d0[_0x35a253(0x1cd)],_0x8bdabd=_0x3607d0['filePath'],_0x24d66d=_0x3607d0[_0x35a253(0x10d)]);const _0x201ec8=_0x3607d0['parentName'],_0x4c075e=_0x3607d0[_0x35a253(0x134)];_0x588306[_0x35a253(0x121)]&&(console[_0x35a253(0x196)](_0x35a253(0x1a5)+_0x201ec8),console['error'](_0x35a253(0x197)+_0x4c075e),_0x16d25f&&console[_0x35a253(0x196)](_0x35a253(0x14e)+_0x16d25f),_0x8bdabd&&console[_0x35a253(0x196)](_0x35a253(0x1f6)+_0x8bdabd),_0x24d66d&&console[_0x35a253(0x196)](_0x35a253(0x123)+_0x24d66d));const _0x8148a0=await withSpinner(_0x35a253(0x1b6),()=>_0x2dea17[_0x35a253(0x138)]['resolveParentId'](_0x201ec8),{'verbose':_0x34653a[_0x35a253(0x121)]}),_0x52011f=_0x8148a0[_0x35a253(0xfa)],{journeys:_0x2413a6,folders:_0x2fc8b0}=await withSpinner(_0x35a253(0x1ce),async()=>{const _0x272e88=_0x35a253,[_0x1a8730,_0xe818d7]=await Promise['all']([_0x2dea17[_0x272e88(0x18f)][_0x272e88(0x1b2)](_0x52011f,undefined,{'includeAllVersions':!![]}),_0x2dea17[_0x272e88(0x138)][_0x272e88(0x17f)](_0x52011f)]);return{'journeys':_0x1a8730,'folders':_0xe818d7};},{'verbose':_0x34653a[_0x35a253(0x121)]})['then'](_0x225fe6=>_0x225fe6[_0x35a253(0xfa)]);let _0x4e8e5b=_0x2413a6;const _0x38ef0f=buildFolderIdToPathMap(_0x2fc8b0);if(_0x16d25f){const _0x12b43b=_0x4e8e5b[_0x35a253(0x1f5)](_0x158e91=>_0x158e91[_0x35a253(0x149)][_0x35a253(0x156)]()===_0x16d25f[_0x35a253(0x156)]());if(_0x12b43b[_0x35a253(0x1dc)]===0x0)return console[_0x35a253(0x196)](_0x35a253(0x180)+_0x16d25f),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x4e8e5b=_0x12b43b;}if(_0x24d66d!==undefined){const _0x409ae8=_0x4e8e5b[_0x35a253(0x1f5)](_0x199892=>{const _0x589f44=_0x35a253,_0x150849=_0x199892[_0x589f44(0x184)]?_0x38ef0f[_0x589f44(0xf9)](_0x199892['folderId'])||'':'';return _0x150849===_0x24d66d;});if(_0x409ae8['length']===0x0&&_0x4e8e5b[_0x35a253(0x1dc)]>0x0){console['error'](_0x35a253(0x1db)+_0x16d25f+'\x27\x20not\x20found\x20in\x20'+(_0x24d66d||_0x35a253(0x16c))),console[_0x35a253(0x196)](_0x35a253(0x18c));for(const _0x387359 of _0x4e8e5b){const _0x52650a=_0x387359[_0x35a253(0x184)]?_0x38ef0f[_0x35a253(0xf9)](_0x387359[_0x35a253(0x184)])||'':'';console[_0x35a253(0x196)]('\x20\x20-\x20'+(_0x52650a||_0x35a253(0x1b5))+'/'+_0x387359[_0x35a253(0x149)]);}return 0x1;}_0x4e8e5b=_0x409ae8;}if(_0x4e8e5b['length']===0x0)return console[_0x35a253(0x196)]('No\x20journeys\x20found'),0x0;const _0x15dce8=new Map();for(const _0x313346 of _0x4e8e5b){const _0x38938d=_0x313346['journeyBundleId'];!_0x15dce8['has'](_0x38938d)&&_0x15dce8[_0x35a253(0xf3)](_0x38938d,[]),_0x15dce8[_0x35a253(0xf9)](_0x38938d)[_0x35a253(0x11d)](_0x313346);}for(const _0x299d26 of _0x15dce8['values']()){_0x299d26[_0x35a253(0xf1)]((_0xc7d769,_0x16cf61)=>(_0xc7d769[_0x35a253(0x127)]||0x0)-(_0x16cf61[_0x35a253(0x127)]||0x0));}const _0x140b8d=[],{idToEmailMap:_0x5c709c,connectionIdToNameMap:_0x586ae3}=await withSpinner(_0x35a253(0x1f9),async()=>{const _0x33e20f=_0x35a253,[_0x4a4c9e,_0x1d3d54]=await Promise[_0x33e20f(0x1eb)]([_0x2dea17[_0x33e20f(0x1f8)][_0x33e20f(0x17c)](),_0x2dea17[_0x33e20f(0x193)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x4a4c9e,'connectionIdToNameMap':_0x1d3d54};},{'verbose':_0x34653a[_0x35a253(0x121)]})[_0x35a253(0x102)](_0x1cc420=>_0x1cc420['data']);for(const _0xe5d873 of _0x15dce8[_0x35a253(0x167)]()){const _0x4460a9=_0xe5d873[0x0][_0x35a253(0x149)],_0x2c58bb=_0xe5d873[0x0][_0x35a253(0x184)],_0x3ba6d6=_0x2c58bb?_0x38ef0f[_0x35a253(0xf9)](_0x2c58bb)||'':'',_0xba407c=_0x3ba6d6?a27_0x2ae22b['join'](_0x4c075e,_0x3ba6d6):_0x4c075e,_0x38ec39=_0x8bdabd||a27_0x2ae22b[_0x35a253(0x1cb)](_0xba407c,sanitizeFileName(_0x4460a9)+_0x35a253(0x19b));let _0x19b60f,_0x10c93c;if(existsSync(_0x38ec39))try{const _0x3d1ecc=readFileSync(_0x38ec39,'utf-8'),_0x52aa91=parseYamlString(_0x3d1ecc);_0x10c93c=_0x52aa91,_0x19b60f=buildRuleToNameMapping(_0x52aa91),_0x588306[_0x35a253(0x121)]&&_0x19b60f[_0x35a253(0x19c)]>0x0&&console[_0x35a253(0x196)]('Found\x20'+_0x19b60f['size']+_0x35a253(0x1d0)+_0x4460a9);}catch(_0x25d266){_0x588306[_0x35a253(0x121)]&&console[_0x35a253(0x196)](_0x35a253(0xfd)+_0x25d266[_0x35a253(0x148)]);}const _0x22a5d8=[],_0x5116e5=new Set(),_0xde3919=new Map(),_0xbfc2e5=new Map(),_0x579cc2=new Set(),_0x1f7245=new Map(),_0x1903ab=new Map(),_0x257c49=createJumpTargetCache();await withProgressSpinner(_0x35a253(0x17e)+_0x4460a9+_0x35a253(0x1d8),async _0x2da00e=>{const _0x2c04e3=_0x35a253;for(const _0x210298 of _0xe5d873){const _0x9184e9=_0xe5d873[_0x2c04e3(0x1dc)]>0x1?_0x210298[_0x2c04e3(0x149)]+'\x20v'+(_0x210298[_0x2c04e3(0x127)]||0x1):_0x210298['journeyBundleName'];_0x2da00e[_0x2c04e3(0x110)]('Fetching\x20'+_0x9184e9);const _0x12368c=await _0x2dea17['journey'][_0x2c04e3(0x113)](_0x210298['id']),_0x84b709=_0x12368c[_0x2c04e3(0xfc)]?.['audienceId'],_0x1fc397={'resolveSegment':async _0x52d2c0=>{const _0x51b9f1=_0x2c04e3;if(!_0x84b709)return{'name':_0x52d2c0,'isJourneyLocal':![]};const _0x21db33=_0xde3919[_0x51b9f1(0xf9)](_0x52d2c0);if(_0x21db33)return _0x21db33;try{const _0x5a8a79=await _0x2dea17[_0x51b9f1(0x138)][_0x51b9f1(0x118)](_0x84b709,_0x52d2c0),_0x23f5d4=_0x5a8a79[_0x51b9f1(0x187)]===SEGMENT_KIND_JOURNEY;let _0x5a274d,_0x13a09f=_0x5a8a79[_0x51b9f1(0x108)];if(_0x23f5d4&&_0x5a8a79[_0x51b9f1(0x140)]){const _0x331e88=await segmentResponseToDef(_0x5a8a79,{'resolveSegmentName':async _0x300922=>{const _0x1ab168=_0x51b9f1,_0x5d1173=_0xde3919[_0x1ab168(0xf9)](_0x300922);if(_0x5d1173)return _0x5d1173[_0x1ab168(0x108)];const _0x4dbe9b=await _0x1fc397[_0x1ab168(0x159)](_0x300922);return _0x4dbe9b[_0x1ab168(0x108)];}}),_0xb17715=_0x331e88[_0x51b9f1(0x140)];_0x5a274d={'description':_0x5a8a79[_0x51b9f1(0xf8)],'rule':_0xb17715};const _0x5e8a75=serializeRule(_0xb17715),_0x228c7a=_0xbfc2e5[_0x51b9f1(0xf9)](_0x5e8a75);if(_0x228c7a)_0x13a09f=_0x228c7a,_0x5a274d=undefined,_0x588306['verbose']&&console[_0x51b9f1(0x196)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x5a8a79[_0x51b9f1(0x108)]+_0x51b9f1(0x1de)+_0x228c7a);else{let _0x1964b3=![];if(_0x19b60f){const _0x12fc79=_0x19b60f[_0x51b9f1(0xf9)](_0x5e8a75);if(_0x12fc79){const _0x4794da=_0x12fc79[_0x51b9f1(0xff)](_0xede5e1=>!_0x5116e5[_0x51b9f1(0x1f3)](_0xede5e1));_0x4794da&&(_0x13a09f=_0x4794da,_0x5116e5[_0x51b9f1(0x1e9)](_0x4794da),_0xbfc2e5[_0x51b9f1(0xf3)](_0x5e8a75,_0x4794da),_0x1964b3=!![],_0x588306[_0x51b9f1(0x121)]&&console[_0x51b9f1(0x196)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x4794da+_0x51b9f1(0x1a6)));}}if(!_0x1964b3){const _0x5337f0=generateJourneyLocalName(_0x5a8a79[_0x51b9f1(0x108)]);_0x5337f0&&(_0x13a09f=_0x5337f0);let _0x5a9d8b=_0x13a09f,_0x554c85=0x2;while(_0x5116e5[_0x51b9f1(0x1f3)](_0x5a9d8b)){_0x5a9d8b=_0x13a09f+'_'+_0x554c85,_0x554c85++;}_0x5116e5[_0x51b9f1(0x1e9)](_0x5a9d8b),_0xbfc2e5[_0x51b9f1(0xf3)](_0x5e8a75,_0x5a9d8b),_0x13a09f=_0x5a9d8b;}}}const _0xe84fe7={'name':_0x13a09f,'isJourneyLocal':_0x23f5d4,'definition':_0x5a274d};return _0xde3919[_0x51b9f1(0xf3)](_0x52d2c0,_0xe84fe7),_0xe84fe7;}catch(_0x42fb5d){return _0x34653a[_0x51b9f1(0x121)]&&console[_0x51b9f1(0x196)](_0x51b9f1(0x19a)+_0x52d2c0+':\x20'+_0x42fb5d['message']),{'name':_0x52d2c0,'isJourneyLocal':![]};}},'resolveActivation':async _0x6a0988=>{const _0x2ed7c1=_0x2c04e3,_0x559a57=_0x1f7245[_0x2ed7c1(0xf9)](_0x6a0988);if(_0x559a57)return _0x559a57;try{const _0x49bc5c=await _0x2dea17[_0x2ed7c1(0x18f)][_0x2ed7c1(0xf4)](_0x210298['id'],_0x6a0988),_0x5c7441=journeyActivationStepToYaml(_0x49bc5c,_0x5c709c,_0x586ae3),_0xee63ae=JSON['stringify']({'name':_0x5c7441['name'],'connection':_0x5c7441[_0x2ed7c1(0x193)],'connector_config':_0x5c7441[_0x2ed7c1(0x151)]}),_0x4331cb=_0x1903ab[_0x2ed7c1(0xf9)](_0xee63ae);if(_0x4331cb){const _0x41ff98={'name':_0x4331cb,'isJourneyLocal':!![],'definition':_0x5c7441};return _0x1f7245[_0x2ed7c1(0xf3)](_0x6a0988,_0x41ff98),_0x41ff98;}const _0x59cb3b=_0x49bc5c['attributes']['activationParams'][_0x2ed7c1(0x108)]||_0x6a0988,_0x2c73b5=sanitizeYamlKey(_0x59cb3b)||'activation_'+_0x6a0988;let _0x598158=_0x2c73b5,_0x5bfba5=0x2;while(_0x579cc2[_0x2ed7c1(0x1f3)](_0x598158)){_0x598158=_0x2c73b5+'_'+_0x5bfba5,_0x5bfba5++;}_0x579cc2[_0x2ed7c1(0x1e9)](_0x598158),_0x1903ab['set'](_0xee63ae,_0x598158);const _0x4e7b91={'name':_0x598158,'isJourneyLocal':!![],'definition':_0x5c7441};return _0x1f7245[_0x2ed7c1(0xf3)](_0x6a0988,_0x4e7b91),_0x4e7b91;}catch(_0x4e4e5d){return _0x34653a['verbose']&&console[_0x2ed7c1(0x196)](_0x2ed7c1(0x1f4)+_0x6a0988+':\x20'+_0x4e4e5d[_0x2ed7c1(0x148)]),{'name':_0x6a0988,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x2d7fd4,_0x4f9e39)=>{const _0x4d8e3b=_0x2c04e3;return resolveJumpTarget(_0x2d7fd4,_0x4f9e39,_0x257c49,_0xee3a5=>_0x2dea17[_0x4d8e3b(0x18f)]['getJourney'](_0xee3a5));}},_0x2895d4=await journeyResponseToDef(_0x12368c,_0x1fc397);_0x22a5d8[_0x2c04e3(0x11d)]({'item':_0x210298,'yaml':_0x2895d4});}},{'verbose':_0x34653a[_0x35a253(0x121)]});const _0x1face8=await _0x2dea17[_0x35a253(0x18f)][_0x35a253(0x122)](_0xe5d873[0x0][_0x35a253(0x182)]),_0x1ae337=buildMergedJourneyDef(_0x22a5d8,_0x19b60f,_0x1face8),_0x376381=normalizeJourneyDef(_0x1ae337,_0x10c93c),_0x38b865=toYamlString(_0x376381),_0x4f85d7=_0x8bdabd||a27_0x2ae22b[_0x35a253(0x1cb)](_0xba407c,sanitizeFileName(_0x4460a9)+'.yml');!_0x8bdabd&&_0x3ba6d6&&!existsSync(_0xba407c)&&mkdirSync(_0xba407c,{'recursive':!![]});const _0x151d1a=a27_0x2ae22b[_0x35a253(0xf0)](process[_0x35a253(0x1ea)](),_0x4f85d7);if(existsSync(_0x4f85d7)){const _0x3a29bb=readFileSync(_0x4f85d7,_0x35a253(0x133)),_0x51980c=generateDiff(_0x3a29bb,_0x38b865),_0x2b970d=hasChanges(_0x51980c);_0x140b8d['push']({'relativePath':_0x151d1a,'absolutePath':_0x4f85d7,'content':_0x38b865,'isNew':![],'hasChanges':_0x2b970d,'diff':_0x2b970d?formatDiffWithColors(_0x51980c):undefined});}else _0x140b8d[_0x35a253(0x11d)]({'relativePath':_0x151d1a,'absolutePath':_0x4f85d7,'content':_0x38b865,'isNew':!![],'hasChanges':![]});}const _0x5c2a94=_0x140b8d[_0x35a253(0x1f5)](_0x4795a4=>_0x4795a4[_0x35a253(0x195)]),_0x187844=_0x140b8d[_0x35a253(0x1f5)](_0x4e0dce=>!_0x4e0dce['isNew']&&_0x4e0dce[_0x35a253(0x10f)]),_0x5bcf4b=_0x140b8d[_0x35a253(0x1f5)](_0x226e1e=>!_0x226e1e[_0x35a253(0x195)]&&!_0x226e1e['hasChanges']),_0x4af3ed=_0x4e8e5b[_0x35a253(0x1dc)],_0x232e2a=_0x15dce8[_0x35a253(0x19c)],_0x2d1fcd=_0x4af3ed>_0x232e2a?'\x20('+_0x4af3ed+_0x35a253(0x143):'';console[_0x35a253(0x196)](_0x35a253(0x1fe)),console['error']('\x20\x20'+a27_0x564625[_0x35a253(0x171)](_0x232e2a+'\x20journeys')+a27_0x564625[_0x35a253(0x150)](_0x2d1fcd)),console['error']('\x20\x20'+a27_0x564625[_0x35a253(0x1ba)]('+\x20'+_0x5c2a94[_0x35a253(0x1dc)]+_0x35a253(0x101))),console[_0x35a253(0x196)]('\x20\x20'+a27_0x564625[_0x35a253(0x1ab)]('~\x20'+_0x187844['length']+_0x35a253(0x183))),console['error']('\x20\x20'+a27_0x564625[_0x35a253(0x150)]('=\x20'+_0x5bcf4b[_0x35a253(0x1dc)]+_0x35a253(0x126))),console[_0x35a253(0x196)](_0x35a253(0x1fa)+a27_0x564625[_0x35a253(0x171)](_0x4c075e)+'\x0a');if(_0x187844[_0x35a253(0x1dc)]>0x0)for(const _0xea825c of _0x187844){console['error'](_0x35a253(0x1c5)+_0xea825c[_0x35a253(0x1c1)]+'\x27:'),console['error']('─'[_0x35a253(0x1e8)](0x3c)),console['error'](_0xea825c[_0x35a253(0x179)]),console[_0x35a253(0x196)]('─'[_0x35a253(0x1e8)](0x3c));}if(_0x588306[_0x35a253(0x1c7)])return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ab)](_0x35a253(0x11e))),0x0;if(_0x5c2a94[_0x35a253(0x1dc)]===0x0&&_0x187844['length']===0x0)return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ba)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x201ec8},_0x588306[_0x35a253(0x1b3)]),console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ba)]('✔\x20Context\x20set:\x20'+a27_0x564625[_0x35a253(0x150)](_0x35a253(0x1e0))+_0x35a253(0x178)+a27_0x564625[_0x35a253(0x171)](_0x201ec8))),0x0;if(!_0x588306['yes']&&(_0x5c2a94[_0x35a253(0x1dc)]>0x0||_0x187844[_0x35a253(0x1dc)]>0x0)){if(!isInteractive())return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x10c)]('\x0aError:'),_0x35a253(0x15a)),console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x150)](_0x35a253(0x18b))),0x1;const _0x1fbdf4=await confirmKey(_0x35a253(0x1b9)+(_0x5c2a94['length']+_0x187844[_0x35a253(0x1dc)])+_0x35a253(0x14c));if(!_0x1fbdf4)return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ab)]('Aborted.'),_0x35a253(0x139)),0x1;}!existsSync(_0x4c075e)&&mkdirSync(_0x4c075e,{'recursive':!![]});const _0x11d29c=a27_0x2ae22b['join'](_0x4c075e,'tdx.json');writeFileSync(_0x11d29c,createTdxConfigContent(_0x201ec8),_0x35a253(0x133));for(const _0x40b209 of _0x140b8d){(_0x40b209[_0x35a253(0x195)]||_0x40b209[_0x35a253(0x10f)])&&writeFileSync(_0x40b209[_0x35a253(0x181)],_0x40b209[_0x35a253(0x176)],_0x35a253(0x133));}return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ba)](_0x35a253(0x14d)+(_0x5c2a94['length']+_0x187844[_0x35a253(0x1dc)])+_0x35a253(0x1d4)+_0x4c075e)),saveSessionContext({'parent_segment':_0x201ec8},_0x588306[_0x35a253(0x1b3)]),console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ba)]('✔\x20Context\x20set:\x20'+a27_0x564625[_0x35a253(0x150)](_0x35a253(0x1e0))+_0x35a253(0x178)+a27_0x564625[_0x35a253(0x171)](_0x201ec8))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x174);['description']=a27_0x53a51e(0x13a);async[a27_0x53a51e(0x1f1)](_0x3f84a2){const _0x40407b=a27_0x53a51e,{options:_0x3a2b6a,args:_0x355e83,tdx:_0x1b4575}=_0x3f84a2,_0x479a33=_0x355e83[0x0];if(!requireNameOrPath(_0x479a33))return 0x1;_0x3a2b6a[_0x40407b(0x121)]&&console[_0x40407b(0x196)]('Input:\x20'+_0x479a33);const {journeyId:_0x1262fa}=await resolveJourneyIdFromInput(_0x479a33,_0x3a2b6a,_0x1b4575),_0x3ba217=await withSpinner(_0x40407b(0x192),()=>_0x1b4575['journey'][_0x40407b(0x1ec)](_0x1262fa),{'verbose':_0x3a2b6a[_0x40407b(0x121)]}),_0x107dbc=_0x3ba217[_0x40407b(0xfa)];return console[_0x40407b(0x1a9)](_0x40407b(0x142)+_0x107dbc[_0x40407b(0x1d9)]),console[_0x40407b(0x1a9)](_0x40407b(0x152)+_0x107dbc['table']),await handleSDKOutput(_0x107dbc[_0x40407b(0x1a7)],_0x3a2b6a),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x12d);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1a0);async[a27_0x53a51e(0x1f1)](_0x681c63){const _0x2c8faf=a27_0x53a51e,{options:_0x864663,args:_0x5bf70b,tdx:_0xaa584a}=_0x681c63,_0x439de7=_0x5bf70b[0x0];if(!requireNameOrPath(_0x439de7))return 0x1;_0x864663[_0x2c8faf(0x121)]&&console[_0x2c8faf(0x196)](_0x2c8faf(0x1c9)+_0x439de7);const {journeyId:_0x46eeb4}=await resolveJourneyIdFromInput(_0x439de7,_0x864663,_0xaa584a),_0x79dac8=await withSpinner(_0x2c8faf(0x14f),()=>_0xaa584a[_0x2c8faf(0x18f)][_0x2c8faf(0x1fd)](_0x46eeb4),{'verbose':_0x864663[_0x2c8faf(0x121)]}),_0x4d85ae=_0x79dac8[_0x2c8faf(0xfa)];return console[_0x2c8faf(0x196)](_0x2c8faf(0x12b)+_0x4d85ae[_0x2c8faf(0x1dc)]+_0x2c8faf(0x191)+(_0x4d85ae[_0x2c8faf(0x1dc)]!==0x1?'s':'')),await handleSDKOutput(_0x4d85ae,_0x864663),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x18d);['description']=a27_0x53a51e(0x173);[a27_0x53a51e(0x1cf)]=new SegmentPushCommand();async[a27_0x53a51e(0x1f1)](_0x303bd2){const _0x39bbf3=a27_0x53a51e,_0x5a21d4=_0x303bd2[_0x39bbf3(0x13e)][0x0];let _0x494bde;if(_0x5a21d4){const _0x500ddd=await resolveTarget({'arg':_0x5a21d4,'contextParent':_0x303bd2[_0x39bbf3(0x117)][_0x39bbf3(0x163)],'cwd':process[_0x39bbf3(0x1ea)]()});isSuccessfulResolution(_0x500ddd)&&_0x500ddd['type']===_0x39bbf3(0x186)&&(_0x494bde=_0x500ddd[_0x39bbf3(0x1a8)]);}const _0x213b2c={..._0x303bd2,'options':{..._0x303bd2[_0x39bbf3(0x117)],'journeysOnly':!![],..._0x494bde&&{'singleFilePath':_0x494bde}}};return this[_0x39bbf3(0x1cf)][_0x39bbf3(0x1f1)](_0x213b2c);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x14a);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1e2);async[a27_0x53a51e(0x1f1)](_0x16d5f0){const _0x4bb37c=a27_0x53a51e,{options:_0x38ea07,args:_0x28ceae,tdx:_0x206cab}=_0x16d5f0,_0x4982e7=_0x28ceae[0x0];if(!requireNameOrPath(_0x4982e7))return 0x1;if(_0x38ea07['verbose'])console[_0x4bb37c(0x196)](_0x4bb37c(0x1c9)+_0x4982e7);const {journeyId:_0x2b1ed9}=await resolveJourneyIdFromInput(_0x4982e7,_0x38ea07,_0x206cab),_0x23c0a6=await withSpinner(_0x4bb37c(0x145),()=>_0x206cab[_0x4bb37c(0x18f)][_0x4bb37c(0x15f)](_0x2b1ed9),{'verbose':_0x38ea07[_0x4bb37c(0x121)]}),{bundleName:_0x3b1ff8,versions:_0x387598,latestJourneyId:_0x4e5a18}=_0x23c0a6[_0x4bb37c(0xfa)];console[_0x4bb37c(0x196)](_0x3b1ff8+':\x20'+_0x387598[_0x4bb37c(0x1dc)]+_0x4bb37c(0x13f)+(_0x387598[_0x4bb37c(0x1dc)]!==0x1?'s':''));const _0x2f3074=_0x387598[_0x4bb37c(0x172)](_0x29d467=>({'version':_0x29d467['versionNumber'],'journey_id':_0x29d467[_0x4bb37c(0x1c6)],'name':_0x29d467['name'],'state':_0x29d467[_0x4bb37c(0x12a)],'paused':_0x29d467['paused'],'latest':_0x29d467[_0x4bb37c(0x1c6)]===_0x4e5a18,'created_at':_0x29d467[_0x4bb37c(0x200)]}));return await handleSDKOutput(_0x2f3074,_0x38ea07),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x53a51e(0x108)]='journey:version:create';[a27_0x53a51e(0xf8)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x53a51e(0x1f1)](_0x41c815){const _0x217db4=a27_0x53a51e,{options:_0x5d5205,args:_0x46a9f3,tdx:_0x426c99}=_0x41c815,_0x2c66e8=_0x46a9f3[0x0];if(!requireNameOrPath(_0x2c66e8))return 0x1;if(_0x5d5205['verbose'])console[_0x217db4(0x196)]('Input:\x20'+_0x2c66e8);const {journeyId:_0x1181e8,journeyName:_0x143f76}=await resolveJourneyIdFromInput(_0x2c66e8,_0x5d5205,_0x426c99);if(!_0x5d5205[_0x217db4(0x1f0)]){const _0x2af9db=await confirm(_0x217db4(0x175)+_0x143f76+'\x22?');if(!_0x2af9db)return console[_0x217db4(0x196)](_0x217db4(0x116)),0x0;}const _0x19ca77=await withSpinner(_0x217db4(0x199),()=>_0x426c99['journey'][_0x217db4(0x177)](_0x1181e8),{'verbose':_0x5d5205[_0x217db4(0x121)]}),_0x3a4bef=_0x19ca77[_0x217db4(0xfa)];return console[_0x217db4(0x196)](a27_0x564625['green']('✔')+_0x217db4(0x1b1)+_0x3a4bef[_0x217db4(0xfc)][_0x217db4(0x127)]+_0x217db4(0x1bd)+_0x3a4bef['attributes'][_0x217db4(0x108)]+'\x22'),console[_0x217db4(0x196)](_0x217db4(0x160)+_0x3a4bef['id']),await handleSingleObjectOutput({'id':_0x3a4bef['id'],'name':_0x3a4bef[_0x217db4(0xfc)][_0x217db4(0x108)],'version':_0x3a4bef['attributes']['versionNumber'],'state':_0x3a4bef['attributes'][_0x217db4(0x12a)],'bundle_id':_0x3a4bef[_0x217db4(0xfc)][_0x217db4(0x182)],'created_at':_0x3a4bef[_0x217db4(0xfc)][_0x217db4(0x200)]},_0x5d5205),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x53a51e(0x108)]='journey:version:view';['description']=a27_0x53a51e(0x1e6);async[a27_0x53a51e(0x1f1)](_0x4a6521){const _0x45bbd1=a27_0x53a51e,{options:_0x2bd522,args:_0x274fc2,tdx:_0x571e12}=_0x4a6521,_0x1f4668=_0x274fc2[0x0];if(!requireNameOrPath(_0x1f4668))return 0x1;const _0x51aa14=_0x2bd522['version'];if(!_0x51aa14)return console['error'](_0x45bbd1(0x124)),console[_0x45bbd1(0x196)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x41c54e=parseInt(_0x51aa14,0xa);if(isNaN(_0x41c54e)||_0x41c54e<0x1)return console[_0x45bbd1(0x196)](_0x45bbd1(0x112)+_0x51aa14),0x1;if(_0x2bd522[_0x45bbd1(0x121)])console[_0x45bbd1(0x196)]('Input:\x20'+_0x1f4668+_0x45bbd1(0x189)+_0x41c54e);const {journeyId:_0x547959,parentSegmentId:_0x4186e5}=await resolveJourneyIdFromInput(_0x1f4668,_0x2bd522,_0x571e12),_0x538417=await withSpinner(_0x45bbd1(0x194),()=>_0x571e12['journey'][_0x45bbd1(0x15f)](_0x547959),{'verbose':_0x2bd522[_0x45bbd1(0x121)]}),{versions:_0x4a2493,latestJourneyId:_0x3516de}=_0x538417['data'],_0x2d75b3=_0x4a2493[_0x45bbd1(0xff)](_0x57becc=>_0x57becc[_0x45bbd1(0x127)]===_0x41c54e);if(!_0x2d75b3){const _0x11de64=_0x4a2493['map'](_0x1256d1=>'v'+_0x1256d1['versionNumber'])[_0x45bbd1(0x1cb)](',\x20');return console[_0x45bbd1(0x196)]('Error:\x20Version\x20'+_0x41c54e+_0x45bbd1(0x146)+_0x11de64),0x1;}const _0x14a644=await withSpinner(_0x45bbd1(0x11c)+_0x41c54e+'\x20details...',()=>_0x571e12[_0x45bbd1(0x18f)]['getJourney'](_0x2d75b3['journeyId']),{'verbose':_0x2bd522[_0x45bbd1(0x121)]}),_0xbf1e05=_0x14a644[_0x45bbd1(0xfa)],_0x235709=getConsoleNextUrl(_0x2bd522[_0x45bbd1(0x165)],_0x45bbd1(0x109)+_0x4186e5+_0x45bbd1(0x12e)+_0x2d75b3[_0x45bbd1(0x1c6)]+_0x45bbd1(0x137));return await handleSingleObjectOutput({'id':_0xbf1e05['id'],'name':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x108)],'version':_0xbf1e05['attributes'][_0x45bbd1(0x127)],'description':_0xbf1e05[_0x45bbd1(0xfc)]['description'],'state':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x12a)],'paused':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x19d)],'reentry_mode':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x12f)],'stages':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x16b)]?.[_0x45bbd1(0x1dc)]||0x0,..._0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x129)]&&{'goal':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x129)][_0x45bbd1(0x108)]},'latest':_0x2d75b3[_0x45bbd1(0x1c6)]===_0x3516de,'created_at':_0xbf1e05['attributes']['createdAt'],'updated_at':_0xbf1e05['attributes'][_0x45bbd1(0x1f2)],'url':_0x235709},_0x2bd522),0x0;}}
@@ -1 +1 @@
1
- function a28_0x5a78(_0x41f6dd,_0xfeb678){_0x41f6dd=_0x41f6dd-0x1ee;const _0xff674f=a28_0xff67();let _0x5a786f=_0xff674f[_0x41f6dd];return _0x5a786f;}const a28_0x5f2990=a28_0x5a78;(function(_0x20a0ae,_0x101fc4){const _0x5527ef=a28_0x5a78,_0x388ed4=_0x20a0ae();while(!![]){try{const _0x305b71=parseInt(_0x5527ef(0x205))/0x1*(parseInt(_0x5527ef(0x21e))/0x2)+-parseInt(_0x5527ef(0x214))/0x3*(-parseInt(_0x5527ef(0x217))/0x4)+parseInt(_0x5527ef(0x228))/0x5+-parseInt(_0x5527ef(0x209))/0x6*(-parseInt(_0x5527ef(0x1f9))/0x7)+-parseInt(_0x5527ef(0x22b))/0x8+parseInt(_0x5527ef(0x212))/0x9*(-parseInt(_0x5527ef(0x207))/0xa)+-parseInt(_0x5527ef(0x1fe))/0xb*(parseInt(_0x5527ef(0x1ee))/0xc);if(_0x305b71===_0x101fc4)break;else _0x388ed4['push'](_0x388ed4['shift']());}catch(_0x3e83d8){_0x388ed4['push'](_0x388ed4['shift']());}}}(a28_0xff67,0x2775a));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0xff67(){const _0x4d9144=['valid','yellow','\x20valid','675fyYxPI','name','3vILwVX','No\x20journey\x20YAML\x20files\x20found\x20in\x20','Error:\x20','820628ZlgKvR','message','warnings','\x20journey(s)\x20with\x20errors,\x20','\x20segment\x20file(s)\x20skipped','red','type','87830MubaGw','✔\x20All\x20','errors','journey:validate','cyan','description','.yaml','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','Validation\x20failed:\x20','1075725ushoxA','helpText','error','756624jMzkfS','4558296mdWazh','filePath','file','\x20journey(s)\x20valid','\x20segment\x20file(s)\x20skipped)','\x20warning(s)\x20found','Validate\x20journey\x20YAML\x20files','\x20warning(s)','filter','warningCount','log','14hbOBkM','length','verbose','targetDir','dim','11ytIsMV','journey','relativePath','Error:\x20Directory\x20not\x20found:\x20','cwd','parentSegment','validCount','7HwfHfR','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','33270xicSAz','green','473640DWQVmJ','.yml','\x20(skipped:\x20','skippedCount','hasErrors','errorCode'];a28_0xff67=function(){return _0x4d9144;};return a28_0xff67();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x4b8a24 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x5f2990(0x213)]=a28_0x5f2990(0x221);[a28_0x5f2990(0x223)]=a28_0x5f2990(0x1f4);async['execute'](_0x4394dd){const _0x5c4605=a28_0x5f2990,{options:_0x48788f,args:_0x5504b6}=_0x4394dd,_0x6839cc=_0x48788f,_0x1f5470=await resolveTarget({'arg':_0x5504b6[0x0],'contextParent':_0x48788f[_0x5c4605(0x203)],'cwd':process[_0x5c4605(0x202)]()});if(!isSuccessfulResolution(_0x1f5470))return _0x1f5470[_0x5c4605(0x20e)]==='no_parent'?(console[_0x5c4605(0x22a)](a28_0x4b8a24[_0x5c4605(0x210)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5c4605(0x22a)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x5c4605(0x22a)](_0x5c4605(0x226)),console[_0x5c4605(0x22a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x5c4605(0x22a)](a28_0x4b8a24[_0x5c4605(0x21c)](_0x5c4605(0x216)+_0x1f5470[_0x5c4605(0x218)]+'\x0a')),_0x1f5470[_0x5c4605(0x229)]&&console['error'](a28_0x4b8a24[_0x5c4605(0x222)](_0x1f5470['helpText']))),0x1;const _0x358a6f=_0x1f5470[_0x5c4605(0x1fc)],_0x249508=_0x1f5470[_0x5c4605(0x21d)]===_0x5c4605(0x1f0)?_0x1f5470[_0x5c4605(0x1ef)]:undefined;if(!_0x249508&&!existsSync(_0x358a6f))return console[_0x5c4605(0x22a)](a28_0x4b8a24['red'](_0x5c4605(0x201)+_0x358a6f+'\x0a')),0x1;let _0x37b67c;if(_0x249508){if(!_0x249508[_0x5c4605(0x225)](_0x5c4605(0x20a))&&!_0x249508[_0x5c4605(0x225)](_0x5c4605(0x224)))return console[_0x5c4605(0x22a)](a28_0x4b8a24['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x249508+'\x0a')),0x1;_0x37b67c=[_0x249508];}else _0x37b67c=findYamlFiles(_0x358a6f);if(_0x37b67c[_0x5c4605(0x1fa)]===0x0)return console[_0x5c4605(0x22a)](a28_0x4b8a24['red'](_0x5c4605(0x206)+_0x358a6f+'\x0a')),0x1;const _0x53a130=validateYamlFiles(_0x37b67c,_0x358a6f,{'filterType':_0x5c4605(0x1ff)}),_0x49b7c7=calculateSummary(_0x53a130),_0x28a1bd=_0x53a130[_0x5c4605(0x1f6)](isValidationResult);if(_0x28a1bd['length']===0x0)return console[_0x5c4605(0x22a)](a28_0x4b8a24[_0x5c4605(0x210)](_0x5c4605(0x215)+_0x358a6f+'\x0a')),_0x49b7c7[_0x5c4605(0x20c)]>0x0&&console[_0x5c4605(0x22a)](a28_0x4b8a24['dim']('('+_0x49b7c7['skippedCount']+_0x5c4605(0x1f2))),0x0;for(const _0x6e3a21 of _0x53a130){if(!isValidationResult(_0x6e3a21)){_0x6839cc['verbose']&&console[_0x5c4605(0x1f8)](a28_0x4b8a24[_0x5c4605(0x1fd)]('-\x20'+_0x6e3a21[_0x5c4605(0x200)]+_0x5c4605(0x20b)+_0x6e3a21['reason']+')'));continue;}const {relativePath:_0xd089e4,source:_0x1ac4bc,result:_0x5c2e48}=_0x6e3a21;if(_0x5c2e48[_0x5c4605(0x20f)]&&_0x5c2e48[_0x5c4605(0x219)][_0x5c4605(0x1fa)]===0x0)_0x6839cc[_0x5c4605(0x1fb)]&&console[_0x5c4605(0x1f8)](a28_0x4b8a24[_0x5c4605(0x208)]('✔\x20'+_0xd089e4));else _0x5c2e48[_0x5c4605(0x20f)]?(console[_0x5c4605(0x1f8)](a28_0x4b8a24[_0x5c4605(0x210)]('⚠\x20'+_0xd089e4+':\x20'+_0x5c2e48['warnings']['length']+_0x5c4605(0x1f5))),console['log'](formatValidationResult(_0x5c2e48,_0x1ac4bc,_0xd089e4))):(console['log'](a28_0x4b8a24['red']('✖\x20'+_0xd089e4+':\x20'+_0x5c2e48[_0x5c4605(0x220)][_0x5c4605(0x1fa)]+'\x20error(s)')),console[_0x5c4605(0x1f8)](formatValidationResult(_0x5c2e48,_0x1ac4bc,_0xd089e4)));}return console[_0x5c4605(0x1f8)](''),_0x49b7c7[_0x5c4605(0x20d)]?(console[_0x5c4605(0x1f8)](a28_0x4b8a24[_0x5c4605(0x21c)](_0x5c4605(0x227)+_0x49b7c7['invalidCount']+_0x5c4605(0x21a)+_0x49b7c7[_0x5c4605(0x204)]+_0x5c4605(0x211))),_0x49b7c7[_0x5c4605(0x1f7)]>0x0&&console[_0x5c4605(0x1f8)](a28_0x4b8a24[_0x5c4605(0x210)](_0x49b7c7['warningCount']+'\x20warning(s)\x20found')),_0x49b7c7['skippedCount']>0x0&&console['log'](a28_0x4b8a24[_0x5c4605(0x1fd)](_0x49b7c7[_0x5c4605(0x20c)]+_0x5c4605(0x21b))),0x1):(console[_0x5c4605(0x1f8)](a28_0x4b8a24[_0x5c4605(0x208)](_0x5c4605(0x21f)+_0x49b7c7['validCount']+_0x5c4605(0x1f1))),_0x49b7c7[_0x5c4605(0x1f7)]>0x0&&console[_0x5c4605(0x1f8)](a28_0x4b8a24[_0x5c4605(0x210)](_0x49b7c7[_0x5c4605(0x1f7)]+_0x5c4605(0x1f3))),_0x49b7c7['skippedCount']>0x0&&console[_0x5c4605(0x1f8)](a28_0x4b8a24[_0x5c4605(0x1fd)](_0x49b7c7[_0x5c4605(0x20c)]+_0x5c4605(0x21b))),0x0);}}
1
+ function a28_0x5bec(){const _0x4d0898=['journey:validate','315936GUPsop','skippedCount','helpText','type','reason','40yGKYSe','log','✔\x20All\x20','3IMrWNa','\x20valid','message','196216jNtuXy','Validate\x20journey\x20YAML\x20files','Error:\x20','152984ORiEmI','red','errorCode','error','\x20segment\x20file(s)\x20skipped','2218018gnPXPw','verbose','15pcgljW','journey','name','description','no_parent','warnings','24UIeivm','validCount','yellow','63GMHoMI','endsWith','invalidCount','parentSegment','202012hXgsLb','execute','hasErrors','\x20warning(s)\x20found','\x20(skipped:\x20','\x20journey(s)\x20valid','1060856ogvFKr','green','file','No\x20journey\x20YAML\x20files\x20found\x20in\x20','.yaml','warningCount','\x20warning(s)','relativePath','23826iDzBRP','cwd','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','length','dim','targetDir'];a28_0x5bec=function(){return _0x4d0898;};return a28_0x5bec();}const a28_0x6ccda0=a28_0x1559;(function(_0x2f8416,_0x451941){const _0x16360b=a28_0x1559,_0x1bee5c=_0x2f8416();while(!![]){try{const _0x5b2588=parseInt(_0x16360b(0x186))/0x1+parseInt(_0x16360b(0x172))/0x2+-parseInt(_0x16360b(0x16c))/0x3*(-parseInt(_0x16360b(0x18c))/0x4)+-parseInt(_0x16360b(0x179))/0x5*(parseInt(_0x16360b(0x15d))/0x6)+parseInt(_0x16360b(0x182))/0x7*(parseInt(_0x16360b(0x16f))/0x8)+parseInt(_0x16360b(0x164))/0x9*(-parseInt(_0x16360b(0x169))/0xa)+parseInt(_0x16360b(0x177))/0xb*(-parseInt(_0x16360b(0x17f))/0xc);if(_0x5b2588===_0x451941)break;else _0x1bee5c['push'](_0x1bee5c['shift']());}catch(_0x328a4a){_0x1bee5c['push'](_0x1bee5c['shift']());}}}(a28_0x5bec,0x32fd8));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1559(_0x2ddf87,_0x4b6a4b){_0x2ddf87=_0x2ddf87-0x15b;const _0x5bec23=a28_0x5bec();let _0x155947=_0x5bec23[_0x2ddf87];return _0x155947;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0xbac2f from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x6ccda0(0x17b)]=a28_0x6ccda0(0x163);[a28_0x6ccda0(0x17c)]=a28_0x6ccda0(0x170);async[a28_0x6ccda0(0x187)](_0x5be25d){const _0x9aad5=a28_0x6ccda0,{options:_0x5ad5b3,args:_0x3a4f6b}=_0x5be25d,_0x573711=_0x5ad5b3,_0x1f0b03=await resolveTarget({'arg':_0x3a4f6b[0x0],'contextParent':_0x5ad5b3[_0x9aad5(0x185)],'cwd':process[_0x9aad5(0x15e)]()});if(!isSuccessfulResolution(_0x1f0b03))return _0x1f0b03[_0x9aad5(0x174)]===_0x9aad5(0x17d)?(console[_0x9aad5(0x175)](a28_0xbac2f[_0x9aad5(0x181)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x9aad5(0x175)](_0x9aad5(0x15f)),console[_0x9aad5(0x175)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\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\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x9aad5(0x175)](a28_0xbac2f[_0x9aad5(0x173)](_0x9aad5(0x171)+_0x1f0b03[_0x9aad5(0x16e)]+'\x0a')),_0x1f0b03[_0x9aad5(0x166)]&&console[_0x9aad5(0x175)](a28_0xbac2f['cyan'](_0x1f0b03[_0x9aad5(0x166)]))),0x1;const _0x18372c=_0x1f0b03[_0x9aad5(0x162)],_0x595a6c=_0x1f0b03[_0x9aad5(0x167)]===_0x9aad5(0x18e)?_0x1f0b03['filePath']:undefined;if(!_0x595a6c&&!existsSync(_0x18372c))return console[_0x9aad5(0x175)](a28_0xbac2f[_0x9aad5(0x173)]('Error:\x20Directory\x20not\x20found:\x20'+_0x18372c+'\x0a')),0x1;let _0x12b514;if(_0x595a6c){if(!_0x595a6c['endsWith']('.yml')&&!_0x595a6c[_0x9aad5(0x183)](_0x9aad5(0x190)))return console[_0x9aad5(0x175)](a28_0xbac2f[_0x9aad5(0x173)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x595a6c+'\x0a')),0x1;_0x12b514=[_0x595a6c];}else _0x12b514=findYamlFiles(_0x18372c);if(_0x12b514[_0x9aad5(0x160)]===0x0)return console[_0x9aad5(0x175)](a28_0xbac2f[_0x9aad5(0x173)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x18372c+'\x0a')),0x1;const _0x33f075=validateYamlFiles(_0x12b514,_0x18372c,{'filterType':_0x9aad5(0x17a)}),_0x5f13c5=calculateSummary(_0x33f075),_0x278113=_0x33f075['filter'](isValidationResult);if(_0x278113['length']===0x0)return console[_0x9aad5(0x175)](a28_0xbac2f[_0x9aad5(0x181)](_0x9aad5(0x18f)+_0x18372c+'\x0a')),_0x5f13c5[_0x9aad5(0x165)]>0x0&&console[_0x9aad5(0x175)](a28_0xbac2f[_0x9aad5(0x161)]('('+_0x5f13c5[_0x9aad5(0x165)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x4e1733 of _0x33f075){if(!isValidationResult(_0x4e1733)){_0x573711[_0x9aad5(0x178)]&&console['log'](a28_0xbac2f[_0x9aad5(0x161)]('-\x20'+_0x4e1733[_0x9aad5(0x15c)]+_0x9aad5(0x18a)+_0x4e1733[_0x9aad5(0x168)]+')'));continue;}const {relativePath:_0x264899,source:_0x331ad6,result:_0x13f2f5}=_0x4e1733;if(_0x13f2f5['valid']&&_0x13f2f5[_0x9aad5(0x17e)]['length']===0x0)_0x573711['verbose']&&console[_0x9aad5(0x16a)](a28_0xbac2f[_0x9aad5(0x18d)]('✔\x20'+_0x264899));else _0x13f2f5['valid']?(console['log'](a28_0xbac2f[_0x9aad5(0x181)]('⚠\x20'+_0x264899+':\x20'+_0x13f2f5[_0x9aad5(0x17e)][_0x9aad5(0x160)]+_0x9aad5(0x15b))),console[_0x9aad5(0x16a)](formatValidationResult(_0x13f2f5,_0x331ad6,_0x264899))):(console['log'](a28_0xbac2f[_0x9aad5(0x173)]('✖\x20'+_0x264899+':\x20'+_0x13f2f5['errors'][_0x9aad5(0x160)]+'\x20error(s)')),console[_0x9aad5(0x16a)](formatValidationResult(_0x13f2f5,_0x331ad6,_0x264899)));}return console['log'](''),_0x5f13c5[_0x9aad5(0x188)]?(console['log'](a28_0xbac2f[_0x9aad5(0x173)]('Validation\x20failed:\x20'+_0x5f13c5[_0x9aad5(0x184)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x5f13c5[_0x9aad5(0x180)]+_0x9aad5(0x16d))),_0x5f13c5[_0x9aad5(0x191)]>0x0&&console[_0x9aad5(0x16a)](a28_0xbac2f[_0x9aad5(0x181)](_0x5f13c5['warningCount']+_0x9aad5(0x189))),_0x5f13c5[_0x9aad5(0x165)]>0x0&&console[_0x9aad5(0x16a)](a28_0xbac2f[_0x9aad5(0x161)](_0x5f13c5[_0x9aad5(0x165)]+_0x9aad5(0x176))),0x1):(console[_0x9aad5(0x16a)](a28_0xbac2f[_0x9aad5(0x18d)](_0x9aad5(0x16b)+_0x5f13c5[_0x9aad5(0x180)]+_0x9aad5(0x18b))),_0x5f13c5['warningCount']>0x0&&console[_0x9aad5(0x16a)](a28_0xbac2f['yellow'](_0x5f13c5['warningCount']+'\x20warning(s)\x20found')),_0x5f13c5[_0x9aad5(0x165)]>0x0&&console['log'](a28_0xbac2f[_0x9aad5(0x161)](_0x5f13c5[_0x9aad5(0x165)]+_0x9aad5(0x176))),0x0);}}