@treasuredata/tdx 2026.3.29 → 2026.3.31

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 (268) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.d.ts.map +1 -1
  5. package/dist/cli-categories.js +1 -1
  6. package/dist/cli-categories.js.map +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/agent-command.js +1 -1
  12. package/dist/commands/agent-test-command.js +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/api-command.js.map +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/auth-login-command.js +1 -1
  17. package/dist/commands/cas-command.d.ts +55 -0
  18. package/dist/commands/cas-command.d.ts.map +1 -0
  19. package/dist/commands/cas-command.js +1 -0
  20. package/dist/commands/cas-command.js.map +1 -0
  21. package/dist/commands/cas-segment-command.d.ts +18 -0
  22. package/dist/commands/cas-segment-command.d.ts.map +1 -0
  23. package/dist/commands/cas-segment-command.js +1 -0
  24. package/dist/commands/cas-segment-command.js.map +1 -0
  25. package/dist/commands/chat-command.js +1 -1
  26. package/dist/commands/claude-command.js +1 -1
  27. package/dist/commands/claude-statusline-command.js +1 -1
  28. package/dist/commands/claude-usage-command.js +1 -1
  29. package/dist/commands/command.js +1 -1
  30. package/dist/commands/connection-command.js +1 -1
  31. package/dist/commands/databases.js +1 -1
  32. package/dist/commands/delivery-command.js +1 -1
  33. package/dist/commands/describe.js +1 -1
  34. package/dist/commands/engage-campaign-pull-command.js +1 -1
  35. package/dist/commands/engage-campaign-push-command.js +1 -1
  36. package/dist/commands/engage-campaign-validate-command.js +1 -1
  37. package/dist/commands/engage-command.js +1 -1
  38. package/dist/commands/engage-template-pull-command.js +1 -1
  39. package/dist/commands/engage-template-push-command.js +1 -1
  40. package/dist/commands/engage-template-validate-command.js +1 -1
  41. package/dist/commands/job-command.js +1 -1
  42. package/dist/commands/journey-command.js +1 -1
  43. package/dist/commands/journey-validate-command.js +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/mcp-command.js +1 -1
  46. package/dist/commands/parent-segment-command.js +1 -1
  47. package/dist/commands/policy-command.js +1 -1
  48. package/dist/commands/profile-command.js +1 -1
  49. package/dist/commands/profiles-command.js +1 -1
  50. package/dist/commands/query-command.js +1 -1
  51. package/dist/commands/schedule-command.js +1 -1
  52. package/dist/commands/segment-command.js +1 -1
  53. package/dist/commands/segment-create-command.js +1 -1
  54. package/dist/commands/segment-fields-command.js +1 -1
  55. package/dist/commands/segment-pull-command.js +1 -1
  56. package/dist/commands/segment-push-command.js +1 -1
  57. package/dist/commands/segment-update-command.js +1 -1
  58. package/dist/commands/segment-use-command.js +1 -1
  59. package/dist/commands/segment-validate-command.js +1 -1
  60. package/dist/commands/segments.js +1 -1
  61. package/dist/commands/show.js +1 -1
  62. package/dist/commands/status-command.js +1 -1
  63. package/dist/commands/tables.js +1 -1
  64. package/dist/commands/unset-command.d.ts.map +1 -1
  65. package/dist/commands/unset-command.js +1 -1
  66. package/dist/commands/unset-command.js.map +1 -1
  67. package/dist/commands/upgrade-command.js +1 -1
  68. package/dist/commands/use-command.d.ts.map +1 -1
  69. package/dist/commands/use-command.js +1 -1
  70. package/dist/commands/use-command.js.map +1 -1
  71. package/dist/commands/user-command.js +1 -1
  72. package/dist/commands/workflow-command.js +1 -1
  73. package/dist/core/auth.js +1 -1
  74. package/dist/core/command-output.js +1 -1
  75. package/dist/core/config.js +1 -1
  76. package/dist/core/connection-cache.js +1 -1
  77. package/dist/core/constants.js +1 -1
  78. package/dist/core/credential-cache.js +1 -1
  79. package/dist/core/global-context.d.ts +1 -0
  80. package/dist/core/global-context.d.ts.map +1 -1
  81. package/dist/core/global-context.js +1 -1
  82. package/dist/core/global-context.js.map +1 -1
  83. package/dist/core/keychain.js +1 -1
  84. package/dist/core/oauth-keychain.js +1 -1
  85. package/dist/core/oauth.js +1 -1
  86. package/dist/core/profile.js +1 -1
  87. package/dist/core/project-config.js +1 -1
  88. package/dist/core/session.d.ts +2 -1
  89. package/dist/core/session.d.ts.map +1 -1
  90. package/dist/core/session.js +1 -1
  91. package/dist/core/session.js.map +1 -1
  92. package/dist/core/user-cache.js +1 -1
  93. package/dist/core/version.js +1 -1
  94. package/dist/index.js +1 -1
  95. package/dist/mcp/server.js +1 -1
  96. package/dist/mcp/tools/index.js +1 -1
  97. package/dist/mcp/tools/tdx-run.js +1 -1
  98. package/dist/mcp/tools/tdx-search.js +1 -1
  99. package/dist/mcp/utils.js +1 -1
  100. package/dist/proxy/claude-usage-tracker.js +1 -1
  101. package/dist/proxy/passthrough-server.js +1 -1
  102. package/dist/proxy/sse-usage-parser.js +1 -1
  103. package/dist/sdk/agent/agent-config.js +1 -1
  104. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  105. package/dist/sdk/agent/agent-yaml.js +1 -1
  106. package/dist/sdk/agent/test/evaluator.js +1 -1
  107. package/dist/sdk/agent/test/executor.js +1 -1
  108. package/dist/sdk/agent/test/index.js +1 -1
  109. package/dist/sdk/agent/test/output.js +1 -1
  110. package/dist/sdk/agent/test/parser.js +1 -1
  111. package/dist/sdk/agent/tool-target-registry.js +1 -1
  112. package/dist/sdk/api.js +1 -1
  113. package/dist/sdk/cas/cas-api-client.d.ts +77 -0
  114. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -0
  115. package/dist/sdk/cas/cas-api-client.js +1 -0
  116. package/dist/sdk/cas/cas-api-client.js.map +1 -0
  117. package/dist/sdk/cas/cas-audience-yaml.d.ts +32 -0
  118. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -0
  119. package/dist/sdk/cas/cas-audience-yaml.js +1 -0
  120. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -0
  121. package/dist/sdk/cas/cas-segment-yaml.d.ts +38 -0
  122. package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -0
  123. package/dist/sdk/cas/cas-segment-yaml.js +1 -0
  124. package/dist/sdk/cas/cas-segment-yaml.js.map +1 -0
  125. package/dist/sdk/cas/index.d.ts +61 -0
  126. package/dist/sdk/cas/index.d.ts.map +1 -0
  127. package/dist/sdk/cas/index.js +1 -0
  128. package/dist/sdk/cas/index.js.map +1 -0
  129. package/dist/sdk/cas/pull-workflow.d.ts +53 -0
  130. package/dist/sdk/cas/pull-workflow.d.ts.map +1 -0
  131. package/dist/sdk/cas/pull-workflow.js +1 -0
  132. package/dist/sdk/cas/pull-workflow.js.map +1 -0
  133. package/dist/sdk/cas/push-workflow.d.ts +50 -0
  134. package/dist/sdk/cas/push-workflow.d.ts.map +1 -0
  135. package/dist/sdk/cas/push-workflow.js +1 -0
  136. package/dist/sdk/cas/push-workflow.js.map +1 -0
  137. package/dist/sdk/cas/types.d.ts +115 -0
  138. package/dist/sdk/cas/types.d.ts.map +1 -0
  139. package/dist/sdk/cas/types.js +1 -0
  140. package/dist/sdk/cas/types.js.map +1 -0
  141. package/dist/sdk/client/cdp-api-client.js +1 -1
  142. package/dist/sdk/client/delivery-api-client.js +1 -1
  143. package/dist/sdk/client/endpoints.d.ts +4 -0
  144. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  145. package/dist/sdk/client/endpoints.js +1 -1
  146. package/dist/sdk/client/endpoints.js.map +1 -1
  147. package/dist/sdk/client/engage-api-client.js +1 -1
  148. package/dist/sdk/client/http-client.js +1 -1
  149. package/dist/sdk/client/llm-api-client.js +1 -1
  150. package/dist/sdk/client/oauth-refresh.js +1 -1
  151. package/dist/sdk/client/rate-limiter.js +1 -1
  152. package/dist/sdk/client/td-api-client.js +1 -1
  153. package/dist/sdk/client/trino-api-client.js +1 -1
  154. package/dist/sdk/client/workflow-client.js +1 -1
  155. package/dist/sdk/connection-validator.js +1 -1
  156. package/dist/sdk/connection.js +1 -1
  157. package/dist/sdk/delivery.js +1 -1
  158. package/dist/sdk/engage/campaign-pull.js +1 -1
  159. package/dist/sdk/engage/campaign-push.js +1 -1
  160. package/dist/sdk/engage/campaign-validator.js +1 -1
  161. package/dist/sdk/engage/campaign-yaml.js +1 -1
  162. package/dist/sdk/engage/template-pull.js +1 -1
  163. package/dist/sdk/engage/template-push.js +1 -1
  164. package/dist/sdk/engage/template-validator.js +1 -1
  165. package/dist/sdk/engage/template-yaml.js +1 -1
  166. package/dist/sdk/engage/types/campaign-def.js +1 -1
  167. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  168. package/dist/sdk/engage/types/template-schema.js +1 -1
  169. package/dist/sdk/engage.js +1 -1
  170. package/dist/sdk/errors.js +1 -1
  171. package/dist/sdk/index.d.ts +6 -0
  172. package/dist/sdk/index.d.ts.map +1 -1
  173. package/dist/sdk/index.js +1 -1
  174. package/dist/sdk/index.js.map +1 -1
  175. package/dist/sdk/io/index.js +1 -1
  176. package/dist/sdk/io/node-filesystem.js +1 -1
  177. package/dist/sdk/job.js +1 -1
  178. package/dist/sdk/journey.js +1 -1
  179. package/dist/sdk/llm/chat-cache.js +1 -1
  180. package/dist/sdk/llm/index.js +1 -1
  181. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  182. package/dist/sdk/llm/model-factors.js +1 -1
  183. package/dist/sdk/personalization.js +1 -1
  184. package/dist/sdk/policy.js +1 -1
  185. package/dist/sdk/query/index.js +1 -1
  186. package/dist/sdk/query/sql-parser.js +1 -1
  187. package/dist/sdk/realtime.js +1 -1
  188. package/dist/sdk/schedule.js +1 -1
  189. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  190. package/dist/sdk/segment/fields-display.js +1 -1
  191. package/dist/sdk/segment/file-discovery.js +1 -1
  192. package/dist/sdk/segment/journey-utils.js +1 -1
  193. package/dist/sdk/segment/journey-validator.js +1 -1
  194. package/dist/sdk/segment/journey-yaml.js +1 -1
  195. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  196. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  197. package/dist/sdk/segment/pull-workflow.js +1 -1
  198. package/dist/sdk/segment/push-recovery.js +1 -1
  199. package/dist/sdk/segment/push-workflow.js +1 -1
  200. package/dist/sdk/segment/resolution-context.js +1 -1
  201. package/dist/sdk/segment/segment-path-parser.js +1 -1
  202. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  203. package/dist/sdk/segment/segment-validator.js +1 -1
  204. package/dist/sdk/segment/target-resolution.js +1 -1
  205. package/dist/sdk/segment/tdx-config.js +1 -1
  206. package/dist/sdk/segment/types/activation-schema.js +1 -1
  207. package/dist/sdk/segment/types/journey-def.js +1 -1
  208. package/dist/sdk/segment/types/journey-schema.js +1 -1
  209. package/dist/sdk/segment/types/segment-def.js +1 -1
  210. package/dist/sdk/segment/types/segment-schema.js +1 -1
  211. package/dist/sdk/segment/validate-files.js +1 -1
  212. package/dist/sdk/segment/yaml-validator.js +1 -1
  213. package/dist/sdk/segment.js +1 -1
  214. package/dist/sdk/types/cas.d.ts +242 -0
  215. package/dist/sdk/types/cas.d.ts.map +1 -0
  216. package/dist/sdk/types/cas.js +1 -0
  217. package/dist/sdk/types/cas.js.map +1 -0
  218. package/dist/sdk/types/index.d.ts +3 -1
  219. package/dist/sdk/types/index.d.ts.map +1 -1
  220. package/dist/sdk/types/index.js +1 -1
  221. package/dist/sdk/types/index.js.map +1 -1
  222. package/dist/sdk/types/progress.js +1 -1
  223. package/dist/sdk/user.js +1 -1
  224. package/dist/sdk/util/format-detector.js +1 -1
  225. package/dist/sdk/util/formatters.js +1 -1
  226. package/dist/sdk/util/index.js +1 -1
  227. package/dist/sdk/util/paginate.js +1 -1
  228. package/dist/sdk/util/tree-formatter.js +1 -1
  229. package/dist/sdk/workflow/archive-validation.js +1 -1
  230. package/dist/sdk/workflow/clone-workflow.js +1 -1
  231. package/dist/sdk/workflow/index.js +1 -1
  232. package/dist/sdk/workflow/pull-workflow.js +1 -1
  233. package/dist/sdk/workflow/push-workflow.js +1 -1
  234. package/dist/sdk/workflow/tdx-config.js +1 -1
  235. package/dist/sdk/workflow/workflow-utils.js +1 -1
  236. package/dist/test-utils/command-runner.js +1 -1
  237. package/dist/test-utils/factories.js +1 -1
  238. package/dist/test-utils/fixtures.js +1 -1
  239. package/dist/test-utils/http-mock.js +1 -1
  240. package/dist/test-utils/index.js +1 -1
  241. package/dist/utils/async.js +1 -1
  242. package/dist/utils/colors.js +1 -1
  243. package/dist/utils/diff.js +1 -1
  244. package/dist/utils/file-permissions.js +1 -1
  245. package/dist/utils/file-reader.js +1 -1
  246. package/dist/utils/github-releases.js +1 -1
  247. package/dist/utils/global-cache.js +1 -1
  248. package/dist/utils/json-loader.js +1 -1
  249. package/dist/utils/local-cache.js +1 -1
  250. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  251. package/dist/utils/logger/formatters/index.js +1 -1
  252. package/dist/utils/logger/handlers/console-handler.js +1 -1
  253. package/dist/utils/logger/handlers/file-handler.js +1 -1
  254. package/dist/utils/logger/handlers/index.js +1 -1
  255. package/dist/utils/logger/handlers/null-handler.js +1 -1
  256. package/dist/utils/logger/index.js +1 -1
  257. package/dist/utils/logger/logger.js +1 -1
  258. package/dist/utils/logger/types.js +1 -1
  259. package/dist/utils/option-validation.js +1 -1
  260. package/dist/utils/process.js +1 -1
  261. package/dist/utils/prompt.js +1 -1
  262. package/dist/utils/spinner.js +1 -1
  263. package/dist/utils/sse-parser.js +1 -1
  264. package/dist/utils/string-utils.js +1 -1
  265. package/dist/utils/table-ref-parser.js +1 -1
  266. package/dist/utils/tdx-logger.js +1 -1
  267. package/dist/utils/version-check.js +1 -1
  268. package/package.json +1 -1
@@ -1 +1 @@
1
- const a22_0x3307d5=a22_0xde97;(function(_0x1e024e,_0x299409){const _0x8d9954=a22_0xde97,_0x466d36=_0x1e024e();while(!![]){try{const _0x57a0ba=-parseInt(_0x8d9954(0xd4))/0x1*(-parseInt(_0x8d9954(0xaa))/0x2)+-parseInt(_0x8d9954(0xd1))/0x3+-parseInt(_0x8d9954(0xaf))/0x4+parseInt(_0x8d9954(0xd3))/0x5+parseInt(_0x8d9954(0xe4))/0x6*(parseInt(_0x8d9954(0xc9))/0x7)+parseInt(_0x8d9954(0xdc))/0x8*(parseInt(_0x8d9954(0xb1))/0x9)+parseInt(_0x8d9954(0xcd))/0xa*(parseInt(_0x8d9954(0xd9))/0xb);if(_0x57a0ba===_0x299409)break;else _0x466d36['push'](_0x466d36['shift']());}catch(_0x389483){_0x466d36['push'](_0x466d36['shift']());}}}(a22_0x500d,0xc2d67));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';import a22_0x466e26 from'chalk';function a22_0x500d(){const _0x5c1c99=['dryRun','cyan','✔\x20Context\x20set:\x20','config','hasChanges','\x20templates','filter','repeat','yellow','\x0aPull\x20summary\x20for\x20workspace\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','data','error','Pull\x20templates\x20to\x20YAML\x20files','engage','\x20files?','Pulling\x20templates\x20from\x20\x27','cwd','name','counts','888468ThuOJK','length','✔\x20All\x20files\x20are\x20up\x20to\x20date','files','17470330maAflP','session','absolutePath','verbose','2077218REJCMf','diff','2252740voYwUn','3nGwvlD','Aborted.','setPhase','\x27...','targetDir','11kredAQ','yes','red','8PuzJAt','-\x20no\x20files\x20written','Write\x20','isNew','dirname','\x0aChanges\x20to\x20\x27','workspace','engage_workspace','18ASdEnh','dim','green','templates','utf-8','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','workspaceName','\x20\x20Target:\x20','\x20changed\x20files','\x20=\x20','46426tUmVkN','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Workspace\x20is\x20required.','relativePath','5556136thREQp','\x20unchanged\x20files','2083527vHlQPb','No\x20templates\x20found\x20in\x20workspace\x20\x27','description'];a22_0x500d=function(){return _0x5c1c99;};return a22_0x500d();}import{existsSync,mkdirSync,writeFileSync}from'fs';function a22_0xde97(_0x1d4ff4,_0x5ef9f2){_0x1d4ff4=_0x1d4ff4-0xa7;const _0x500dcf=a22_0x500d();let _0xde9715=_0x500dcf[_0x1d4ff4];return _0xde9715;}import a22_0x1085ff from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a22_0x3307d5(0xc7)]='engage:template:pull';[a22_0x3307d5(0xb3)]=a22_0x3307d5(0xc2);async['execute'](_0x8d0132){const _0x6bdc71=a22_0x3307d5,{options:_0x2c6c12,args:_0x3e4b6c,tdx:_0xc42279}=_0x8d0132,_0x31fe48=_0x2c6c12,_0xd153b4=await resolveWorkspaceName(_0x3e4b6c[0x0],_0x31fe48);if(!_0xd153b4)return console[_0x6bdc71(0xc1)](a22_0x466e26[_0x6bdc71(0xbc)](_0x6bdc71(0xad))),console[_0x6bdc71(0xc1)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console[_0x6bdc71(0xc1)](_0x6bdc71(0xab)),console[_0x6bdc71(0xc1)](_0x6bdc71(0xe9)),0x1;const _0x349d1e=await withProgressSpinner(_0x6bdc71(0xc5)+_0xd153b4+_0x6bdc71(0xd7),_0x2a3540=>pullTemplates({'engage':_0xc42279[_0x6bdc71(0xc3)]},_0xd153b4,{'templateName':_0x31fe48['name'],'progress':{'update':_0x55a0dd=>{const _0x1bd83c=_0x6bdc71;_0x2a3540[_0x1bd83c(0xd6)](_0x55a0dd);}}}),{'verbose':_0x31fe48[_0x6bdc71(0xd0)]}),_0x5b02e5=_0x349d1e[_0x6bdc71(0xc0)];if(_0x5b02e5[_0x6bdc71(0xc8)][_0x6bdc71(0xe7)]===0x0)return console['error'](a22_0x466e26[_0x6bdc71(0xbc)](_0x6bdc71(0xb2)+_0x5b02e5[_0x6bdc71(0xea)]+'\x27')),0x0;const _0x181016=_0x5b02e5[_0x6bdc71(0xcc)][_0x6bdc71(0xba)](_0x20e36c=>_0x20e36c['isNew']),_0xef2f39=_0x5b02e5[_0x6bdc71(0xcc)]['filter'](_0x58cd0b=>!_0x58cd0b[_0x6bdc71(0xdf)]&&_0x58cd0b[_0x6bdc71(0xb8)]),_0x4f2541=_0x5b02e5['files'][_0x6bdc71(0xba)](_0x13c188=>!_0x13c188[_0x6bdc71(0xdf)]&&!_0x13c188['hasChanges']);console['error'](_0x6bdc71(0xbd)+_0x5b02e5[_0x6bdc71(0xea)]+'\x27:'),console['error']('\x20\x20'+a22_0x466e26['cyan'](_0x5b02e5['counts'][_0x6bdc71(0xe7)]+_0x6bdc71(0xb9))),console[_0x6bdc71(0xc1)]('\x20\x20'+a22_0x466e26[_0x6bdc71(0xe6)]('+\x20'+_0x181016[_0x6bdc71(0xca)]+'\x20new\x20files')),console[_0x6bdc71(0xc1)]('\x20\x20'+a22_0x466e26[_0x6bdc71(0xbc)]('~\x20'+_0xef2f39[_0x6bdc71(0xca)]+_0x6bdc71(0xa8))),console[_0x6bdc71(0xc1)]('\x20\x20'+a22_0x466e26[_0x6bdc71(0xe5)]('=\x20'+_0x4f2541[_0x6bdc71(0xca)]+_0x6bdc71(0xb0))),console[_0x6bdc71(0xc1)](_0x6bdc71(0xa7)+a22_0x466e26[_0x6bdc71(0xb5)](_0x5b02e5[_0x6bdc71(0xd8)])+'\x0a');if(_0xef2f39[_0x6bdc71(0xca)]>0x0)for(const _0x4175a9 of _0xef2f39){console['error'](_0x6bdc71(0xe1)+_0x4175a9[_0x6bdc71(0xae)]+'\x27:'),console[_0x6bdc71(0xc1)]('─'[_0x6bdc71(0xbb)](0x3c)),console[_0x6bdc71(0xc1)](_0x4175a9[_0x6bdc71(0xd2)]),console[_0x6bdc71(0xc1)]('─'['repeat'](0x3c));}if(_0x31fe48[_0x6bdc71(0xb4)])return console['error'](a22_0x466e26[_0x6bdc71(0xbc)](_0x6bdc71(0xac))),0x0;if(_0x181016['length']===0x0&&_0xef2f39[_0x6bdc71(0xca)]===0x0)return console[_0x6bdc71(0xc1)](a22_0x466e26[_0x6bdc71(0xe6)](_0x6bdc71(0xcb))),saveSessionContext({'engage_workspace':_0x5b02e5[_0x6bdc71(0xea)]},_0x31fe48[_0x6bdc71(0xce)]),0x0;if(!_0x31fe48[_0x6bdc71(0xda)]){if(!isInteractive())return console['error'](a22_0x466e26[_0x6bdc71(0xdb)]('\x0aError:'),_0x6bdc71(0xbe)),console['error'](a22_0x466e26['dim'](_0x6bdc71(0xbf))),0x1;const _0x571a79=await confirmKey(_0x6bdc71(0xde)+(_0x181016[_0x6bdc71(0xca)]+_0xef2f39[_0x6bdc71(0xca)])+_0x6bdc71(0xc4));if(!_0x571a79)return console[_0x6bdc71(0xc1)](a22_0x466e26['yellow'](_0x6bdc71(0xd5)),_0x6bdc71(0xdd)),0x1;}for(const _0x3703ce of _0x5b02e5[_0x6bdc71(0xcc)]){if(_0x3703ce['isNew']||_0x3703ce[_0x6bdc71(0xb8)]){const _0x307be4=a22_0x1085ff[_0x6bdc71(0xe0)](_0x3703ce[_0x6bdc71(0xcf)]);!existsSync(_0x307be4)&&mkdirSync(_0x307be4,{'recursive':!![]}),writeFileSync(_0x3703ce['absolutePath'],_0x3703ce['content'],_0x6bdc71(0xe8));}}return console[_0x6bdc71(0xc1)](a22_0x466e26['green']('✔\x20Pulled\x20'+(_0x181016[_0x6bdc71(0xca)]+_0xef2f39[_0x6bdc71(0xca)])+'\x20files\x20to\x20'+_0x5b02e5['targetDir'])),saveSessionContext({'engage_workspace':_0x5b02e5[_0x6bdc71(0xea)]},_0x31fe48[_0x6bdc71(0xce)]),console[_0x6bdc71(0xc1)](a22_0x466e26['green'](_0x6bdc71(0xb6)+a22_0x466e26['dim'](_0x6bdc71(0xe3))+_0x6bdc71(0xa9)+a22_0x466e26[_0x6bdc71(0xb5)](_0x5b02e5[_0x6bdc71(0xea)]))),0x0;}}async function resolveWorkspaceName(_0x3f4a10,_0x26b442){const _0x3dfe6f=a22_0x3307d5;if(_0x3f4a10)return _0x3f4a10;if(_0x26b442[_0x3dfe6f(0xe2)])return _0x26b442[_0x3dfe6f(0xe2)];const _0x17f5bc=tryFindTdxConfig(process[_0x3dfe6f(0xc6)]());if(_0x17f5bc?.[_0x3dfe6f(0xb7)][_0x3dfe6f(0xe3)])return _0x17f5bc[_0x3dfe6f(0xb7)]['engage_workspace'];const _0xdf280f=loadSessionContext(_0x26b442[_0x3dfe6f(0xce)]);if(_0xdf280f?.[_0x3dfe6f(0xe3)])return _0xdf280f[_0x3dfe6f(0xe3)];return undefined;}
1
+ const a24_0x1954a7=a24_0x5d09;(function(_0x36882d,_0xaab862){const _0x340149=a24_0x5d09,_0x2f0cb1=_0x36882d();while(!![]){try{const _0x3f432a=-parseInt(_0x340149(0x112))/0x1+-parseInt(_0x340149(0x108))/0x2+parseInt(_0x340149(0xe6))/0x3+parseInt(_0x340149(0xef))/0x4+-parseInt(_0x340149(0x10c))/0x5*(parseInt(_0x340149(0x103))/0x6)+-parseInt(_0x340149(0x111))/0x7+parseInt(_0x340149(0xe7))/0x8;if(_0x3f432a===_0xaab862)break;else _0x2f0cb1['push'](_0x2f0cb1['shift']());}catch(_0x41f079){_0x2f0cb1['push'](_0x2f0cb1['shift']());}}}(a24_0x56d5,0x6b2a7));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';import a24_0x3ee56e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a24_0x5d09(_0x1ee72f,_0x222474){_0x1ee72f=_0x1ee72f-0xdb;const _0x56d5e7=a24_0x56d5();let _0x5d095d=_0x56d5e7[_0x1ee72f];return _0x5d095d;}import a24_0x25f8e3 from'path';function a24_0x56d5(){const _0x4370ba=['\x0aError:','session','1046624NwEvPx','yes','files','Pulling\x20templates\x20from\x20\x27','filter','green','description','setPhase','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','name','absolutePath','Aborted.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','execute','yellow','repeat','diff','\x20templates','hasChanges','\x0aChanges\x20to\x20\x27','42WOFNwJ','content','cwd','config','✔\x20All\x20files\x20are\x20up\x20to\x20date','161172lQGuMh','data','counts','engage_workspace','550195OFSaxh','engage:template:pull','workspace','cyan','error','103754fuHWDq','42995MPlbac','\x20changed\x20files','isNew','relativePath','Workspace\x20is\x20required.','dim','targetDir','verbose','dirname','workspaceName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','\x20new\x20files','\x20=\x20','✔\x20Pulled\x20','\x20files\x20to\x20','688905KlflHe','6850688douXQH','templates','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','✔\x20Context\x20set:\x20','Pull\x20templates\x20to\x20YAML\x20files'];a24_0x56d5=function(){return _0x4370ba;};return a24_0x56d5();}import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a24_0x1954a7(0xf8)]=a24_0x1954a7(0x10d);[a24_0x1954a7(0xf5)]=a24_0x1954a7(0xec);async[a24_0x1954a7(0xfc)](_0x2b05c6){const _0x1e4e39=a24_0x1954a7,{options:_0x230b29,args:_0xbffa63,tdx:_0x2f959b}=_0x2b05c6,_0x26a71b=_0x230b29,_0x2ac999=await resolveWorkspaceName(_0xbffa63[0x0],_0x26a71b);if(!_0x2ac999)return console[_0x1e4e39(0x110)](a24_0x3ee56e[_0x1e4e39(0xfd)](_0x1e4e39(0x116))),console[_0x1e4e39(0x110)](_0x1e4e39(0xf7)),console[_0x1e4e39(0x110)](_0x1e4e39(0xe1)),console[_0x1e4e39(0x110)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x7554b0=await withProgressSpinner(_0x1e4e39(0xf2)+_0x2ac999+'\x27...',_0x4c6fdd=>pullTemplates({'engage':_0x2f959b['engage']},_0x2ac999,{'templateName':_0x26a71b[_0x1e4e39(0xf8)],'progress':{'update':_0x57fd2f=>{const _0x2a4347=_0x1e4e39;_0x4c6fdd[_0x2a4347(0xf6)](_0x57fd2f);}}}),{'verbose':_0x26a71b[_0x1e4e39(0xdd)]}),_0x5d8013=_0x7554b0[_0x1e4e39(0x109)];if(_0x5d8013['counts'][_0x1e4e39(0xe8)]===0x0)return console[_0x1e4e39(0x110)](a24_0x3ee56e[_0x1e4e39(0xfd)]('No\x20templates\x20found\x20in\x20workspace\x20\x27'+_0x5d8013[_0x1e4e39(0xdf)]+'\x27')),0x0;const _0x264294=_0x5d8013[_0x1e4e39(0xf1)][_0x1e4e39(0xf3)](_0x4fdb9c=>_0x4fdb9c[_0x1e4e39(0x114)]),_0x1b2034=_0x5d8013[_0x1e4e39(0xf1)][_0x1e4e39(0xf3)](_0x331522=>!_0x331522['isNew']&&_0x331522[_0x1e4e39(0x101)]),_0x3ab82d=_0x5d8013[_0x1e4e39(0xf1)][_0x1e4e39(0xf3)](_0x2239fc=>!_0x2239fc['isNew']&&!_0x2239fc[_0x1e4e39(0x101)]);console[_0x1e4e39(0x110)]('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x5d8013[_0x1e4e39(0xdf)]+'\x27:'),console[_0x1e4e39(0x110)]('\x20\x20'+a24_0x3ee56e[_0x1e4e39(0x10f)](_0x5d8013[_0x1e4e39(0x10a)][_0x1e4e39(0xe8)]+_0x1e4e39(0x100))),console['error']('\x20\x20'+a24_0x3ee56e['green']('+\x20'+_0x264294['length']+_0x1e4e39(0xe2))),console[_0x1e4e39(0x110)]('\x20\x20'+a24_0x3ee56e[_0x1e4e39(0xfd)]('~\x20'+_0x1b2034[_0x1e4e39(0xea)]+_0x1e4e39(0x113))),console[_0x1e4e39(0x110)]('\x20\x20'+a24_0x3ee56e[_0x1e4e39(0xdb)]('=\x20'+_0x3ab82d[_0x1e4e39(0xea)]+'\x20unchanged\x20files')),console[_0x1e4e39(0x110)]('\x20\x20Target:\x20'+a24_0x3ee56e[_0x1e4e39(0x10f)](_0x5d8013[_0x1e4e39(0xdc)])+'\x0a');if(_0x1b2034[_0x1e4e39(0xea)]>0x0)for(const _0x2b7c5d of _0x1b2034){console[_0x1e4e39(0x110)](_0x1e4e39(0x102)+_0x2b7c5d[_0x1e4e39(0x115)]+'\x27:'),console[_0x1e4e39(0x110)]('─'['repeat'](0x3c)),console[_0x1e4e39(0x110)](_0x2b7c5d[_0x1e4e39(0xff)]),console[_0x1e4e39(0x110)]('─'[_0x1e4e39(0xfe)](0x3c));}if(_0x26a71b['dryRun'])return console[_0x1e4e39(0x110)](a24_0x3ee56e['yellow'](_0x1e4e39(0xfb))),0x0;if(_0x264294[_0x1e4e39(0xea)]===0x0&&_0x1b2034[_0x1e4e39(0xea)]===0x0)return console['error'](a24_0x3ee56e[_0x1e4e39(0xf4)](_0x1e4e39(0x107))),saveSessionContext({'engage_workspace':_0x5d8013['workspaceName']},_0x26a71b[_0x1e4e39(0xee)]),0x0;if(!_0x26a71b[_0x1e4e39(0xf0)]){if(!isInteractive())return console[_0x1e4e39(0x110)](a24_0x3ee56e['red'](_0x1e4e39(0xed)),_0x1e4e39(0xe9)),console[_0x1e4e39(0x110)](a24_0x3ee56e['dim'](_0x1e4e39(0xe0))),0x1;const _0x57d7f=await confirmKey('Write\x20'+(_0x264294[_0x1e4e39(0xea)]+_0x1b2034[_0x1e4e39(0xea)])+'\x20files?');if(!_0x57d7f)return console[_0x1e4e39(0x110)](a24_0x3ee56e[_0x1e4e39(0xfd)](_0x1e4e39(0xfa)),'-\x20no\x20files\x20written'),0x1;}for(const _0x1dea89 of _0x5d8013['files']){if(_0x1dea89[_0x1e4e39(0x114)]||_0x1dea89[_0x1e4e39(0x101)]){const _0x6658f5=a24_0x25f8e3[_0x1e4e39(0xde)](_0x1dea89[_0x1e4e39(0xf9)]);!existsSync(_0x6658f5)&&mkdirSync(_0x6658f5,{'recursive':!![]}),writeFileSync(_0x1dea89['absolutePath'],_0x1dea89[_0x1e4e39(0x104)],'utf-8');}}return console[_0x1e4e39(0x110)](a24_0x3ee56e['green'](_0x1e4e39(0xe4)+(_0x264294[_0x1e4e39(0xea)]+_0x1b2034['length'])+_0x1e4e39(0xe5)+_0x5d8013[_0x1e4e39(0xdc)])),saveSessionContext({'engage_workspace':_0x5d8013[_0x1e4e39(0xdf)]},_0x26a71b[_0x1e4e39(0xee)]),console['error'](a24_0x3ee56e[_0x1e4e39(0xf4)](_0x1e4e39(0xeb)+a24_0x3ee56e[_0x1e4e39(0xdb)](_0x1e4e39(0x10b))+_0x1e4e39(0xe3)+a24_0x3ee56e[_0x1e4e39(0x10f)](_0x5d8013['workspaceName']))),0x0;}}async function resolveWorkspaceName(_0x2591c5,_0x5dadf8){const _0x34991e=a24_0x1954a7;if(_0x2591c5)return _0x2591c5;if(_0x5dadf8[_0x34991e(0x10e)])return _0x5dadf8[_0x34991e(0x10e)];const _0x46d03b=tryFindTdxConfig(process[_0x34991e(0x105)]());if(_0x46d03b?.[_0x34991e(0x106)]['engage_workspace'])return _0x46d03b[_0x34991e(0x106)][_0x34991e(0x10b)];const _0xb3b482=loadSessionContext(_0x5dadf8['session']);if(_0xb3b482?.['engage_workspace'])return _0xb3b482[_0x34991e(0x10b)];return undefined;}
@@ -1 +1 @@
1
- const a23_0x3bdc13=a23_0x10dd;(function(_0x2c14ee,_0x52b430){const _0x1ab4fa=a23_0x10dd,_0xefc4f1=_0x2c14ee();while(!![]){try{const _0x4203ca=-parseInt(_0x1ab4fa(0x15e))/0x1+parseInt(_0x1ab4fa(0x16a))/0x2+-parseInt(_0x1ab4fa(0x129))/0x3*(-parseInt(_0x1ab4fa(0x133))/0x4)+parseInt(_0x1ab4fa(0x13d))/0x5*(-parseInt(_0x1ab4fa(0x131))/0x6)+-parseInt(_0x1ab4fa(0x167))/0x7+parseInt(_0x1ab4fa(0x169))/0x8*(-parseInt(_0x1ab4fa(0x171))/0x9)+parseInt(_0x1ab4fa(0x149))/0xa*(parseInt(_0x1ab4fa(0x15b))/0xb);if(_0x4203ca===_0x52b430)break;else _0xefc4f1['push'](_0xefc4f1['shift']());}catch(_0x22829c){_0xefc4f1['push'](_0xefc4f1['shift']());}}}(a23_0x205c,0x2fe26));function a23_0x205c(){const _0x194677=['resolveWorkspaceId','resolve','21291KFZRdo','dryRun','verbose','\x20template\x20files','\x20templates','dirname','setPhase','\x20errors:','535938xxncdn','red','12BvRpOA','def','engage','✔\x20All\x20templates\x20are\x20up\x20to\x20date','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','errors','✔\x20Updated\x20','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','error','config','5JyXevH','\x0aPush\x20summary\x20for\x20workspace\x20\x27','yellow','session','length','cwd','\x20templates?','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','Pushing\x20templates...','filter','data','updated','1990jyeuNs','update','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x20\x20\x20\x20','\x20new\x20templates:','\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','Aborted.','\x0aError:','templateId','dim','\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','message','\x20templates\x20to\x20update:','1\x20template\x20file:\x20','engage_workspace','create','yes','Preparing\x20push\x20to\x20workspace\x20\x27','49830VRrSfA','execute','Resolving\x20references...','273803BYJXPT','action','\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)','-\x20no\x20changes\x20applied','path','valid','workspace','name','✔\x20Created\x20','1981826xEGYSz','Workspace\x20is\x20required.','424PqHNHv','271290MzizKX','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','relativePath','engage:template:push','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','created','36684dgtSBx','Push\x20'];a23_0x205c=function(){return _0x194677;};return a23_0x205c();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a23_0x10dd(_0xa0181b,_0x3e6727){_0xa0181b=_0xa0181b-0x126;const _0x205c22=a23_0x205c();let _0x10dd39=_0x205c22[_0xa0181b];return _0x10dd39;}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a23_0x37f5e5 from'chalk';import a23_0x33dae5 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{['name']=a23_0x3bdc13(0x16e);['description']=a23_0x3bdc13(0x137);async[a23_0x3bdc13(0x15c)](_0x11fe36){const _0x21acb6=a23_0x3bdc13,{options:_0x1a292b,args:_0x5e9b73,tdx:_0x3bb9e5}=_0x11fe36,_0x4e5fdf=_0x1a292b,_0x1d0cbe=_0x5e9b73[0x0],_0x2accbe=_0x1d0cbe?a23_0x33dae5[_0x21acb6(0x128)](_0x1d0cbe):undefined,_0x55e3b5=_0x2accbe?isYamlFile(_0x2accbe):![];let _0x550084;if(_0x55e3b5&&_0x2accbe)_0x550084=a23_0x33dae5['dirname'](_0x2accbe);else _0x2accbe?_0x550084=_0x2accbe:_0x550084=process[_0x21acb6(0x142)]();let _0x38ab72;const _0x4b5638=tryFindTdxConfig(_0x550084);_0x4b5638?.['config']['engage_workspace']&&(_0x38ab72=_0x4b5638[_0x21acb6(0x13c)][_0x21acb6(0x157)],!_0x55e3b5&&(_0x550084=_0x4b5638['configDir']));_0x4e5fdf[_0x21acb6(0x164)]&&(_0x38ab72=_0x4e5fdf[_0x21acb6(0x164)]);if(!_0x38ab72){const _0x3a66ed=loadSessionContext(_0x4e5fdf['session']);_0x3a66ed?.[_0x21acb6(0x157)]&&(_0x38ab72=_0x3a66ed[_0x21acb6(0x157)]);}if(!_0x38ab72)return console[_0x21acb6(0x13b)](a23_0x37f5e5[_0x21acb6(0x13f)](_0x21acb6(0x168))),console['error'](_0x21acb6(0x153)),console[_0x21acb6(0x13b)](_0x21acb6(0x160)),console[_0x21acb6(0x13b)](_0x21acb6(0x14e)),console[_0x21acb6(0x13b)](_0x21acb6(0x14b)),0x1;let _0x5e51a8;_0x55e3b5&&_0x2accbe?_0x5e51a8=[parseTemplateFile(_0x2accbe,a23_0x33dae5[_0x21acb6(0x12e)](_0x2accbe))]:_0x5e51a8=discoverAndParseTemplateFiles(_0x550084);if(_0x5e51a8[_0x21acb6(0x141)]===0x0)return console[_0x21acb6(0x13b)](a23_0x37f5e5['yellow']('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x550084)),console['error'](a23_0x37f5e5['dim'](_0x21acb6(0x13a))),0x1;const _0xb98eb6=_0x5e51a8[_0x21acb6(0x141)]===0x1?_0x21acb6(0x156)+_0x5e51a8[0x0][_0x21acb6(0x134)][_0x21acb6(0x165)]:_0x5e51a8['length']+_0x21acb6(0x12c);console['error']('Found\x20'+a23_0x37f5e5['cyan'](_0xb98eb6));let _0xd73001=![];for(const _0x435db5 of _0x5e51a8){const _0x55ed39=validateTemplateDef(_0x435db5[_0x21acb6(0x134)]);if(!_0x55ed39[_0x21acb6(0x163)]){_0xd73001=!![],console[_0x21acb6(0x13b)](a23_0x37f5e5[_0x21acb6(0x132)]('\x0aValidation\x20errors\x20in\x20'+_0x435db5[_0x21acb6(0x16d)]+':'));for(const _0x536aba of _0x55ed39[_0x21acb6(0x138)]){console['error']('\x20\x20'+a23_0x37f5e5[_0x21acb6(0x132)]('✗')+'\x20'+_0x536aba['path']+':\x20'+_0x536aba[_0x21acb6(0x154)]);}}for(const _0x390c9c of _0x55ed39['warnings']){console[_0x21acb6(0x13b)]('\x20\x20'+a23_0x37f5e5[_0x21acb6(0x13f)]('⚠')+'\x20'+_0x390c9c[_0x21acb6(0x162)]+':\x20'+_0x390c9c[_0x21acb6(0x154)]);}}if(_0xd73001)return console['error'](a23_0x37f5e5[_0x21acb6(0x132)](_0x21acb6(0x16f))),0x1;const _0x1f817d=await _0x3bb9e5[_0x21acb6(0x135)][_0x21acb6(0x127)](_0x38ab72),_0x5081b3=await withProgressSpinner(_0x21acb6(0x15a)+_0x38ab72+'\x27...',_0x1b05fc=>preparePush({'engage':_0x3bb9e5['engage']},_0x5e51a8,_0x1f817d,{'progress':{'update':_0x19607b=>_0x1b05fc[_0x21acb6(0x12f)](_0x19607b)}}),{'verbose':_0x4e5fdf[_0x21acb6(0x12b)]}),_0x188428=_0x5081b3[_0x21acb6(0x147)];await withProgressSpinner(_0x21acb6(0x15d),_0x196e9f=>resolveAndBuildInputs({'engage':_0x3bb9e5[_0x21acb6(0x135)]},_0x188428,_0x1f817d,{'progress':{'update':_0x4ff64a=>_0x196e9f[_0x21acb6(0x12f)](_0x4ff64a)}}),{'verbose':_0x4e5fdf['verbose']});const _0x48397e=_0x188428[_0x21acb6(0x146)](_0x3eff58=>_0x3eff58[_0x21acb6(0x15f)]===_0x21acb6(0x158)),_0x44b61d=_0x188428[_0x21acb6(0x146)](_0x210fda=>_0x210fda['action']===_0x21acb6(0x14a));console['error'](_0x21acb6(0x13e)+_0x38ab72+'\x27:');if(_0x48397e[_0x21acb6(0x141)]>0x0){console[_0x21acb6(0x13b)]('\x20\x20'+a23_0x37f5e5[_0x21acb6(0x16c)]('+\x20'+_0x48397e[_0x21acb6(0x141)]+_0x21acb6(0x14d)));for(const _0x32c992 of _0x48397e){console[_0x21acb6(0x13b)](_0x21acb6(0x14c)+a23_0x37f5e5[_0x21acb6(0x16c)]('+')+'\x20'+_0x32c992['def'][_0x21acb6(0x165)]);}}if(_0x44b61d['length']>0x0){console[_0x21acb6(0x13b)]('\x20\x20'+a23_0x37f5e5['yellow']('~\x20'+_0x44b61d[_0x21acb6(0x141)]+_0x21acb6(0x155)));for(const _0x53365b of _0x44b61d){console[_0x21acb6(0x13b)]('\x20\x20\x20\x20'+a23_0x37f5e5[_0x21acb6(0x13f)]('~')+'\x20'+_0x53365b[_0x21acb6(0x134)]['name']);}}if(_0x48397e['length']===0x0&&_0x44b61d[_0x21acb6(0x141)]===0x0)return console[_0x21acb6(0x13b)](a23_0x37f5e5[_0x21acb6(0x16c)](_0x21acb6(0x136))),0x0;if(_0x4e5fdf[_0x21acb6(0x12a)])return console['error'](a23_0x37f5e5[_0x21acb6(0x13f)](_0x21acb6(0x144))),0x0;if(!_0x4e5fdf[_0x21acb6(0x159)]){if(!isInteractive())return console[_0x21acb6(0x13b)](a23_0x37f5e5['red'](_0x21acb6(0x150)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x21acb6(0x13b)](a23_0x37f5e5['dim'](_0x21acb6(0x16b))),0x1;const _0x41923c=await confirmKey(_0x21acb6(0x126)+(_0x48397e[_0x21acb6(0x141)]+_0x44b61d[_0x21acb6(0x141)])+_0x21acb6(0x143));if(!_0x41923c)return console[_0x21acb6(0x13b)](a23_0x37f5e5[_0x21acb6(0x13f)](_0x21acb6(0x14f)),_0x21acb6(0x161)),0x1;}const _0x5cb2e1=await withProgressSpinner(_0x21acb6(0x145),_0x26dc6a=>executePush({'engage':_0x3bb9e5[_0x21acb6(0x135)]},_0x188428,{'progress':{'update':_0x31996a=>_0x26dc6a[_0x21acb6(0x12f)](_0x31996a)}}),{'verbose':_0x4e5fdf[_0x21acb6(0x12b)]}),_0x466e9e=_0x5cb2e1[_0x21acb6(0x147)];for(const _0xad822c of _0x466e9e['results']){if(_0xad822c[_0x21acb6(0x151)]&&(_0xad822c[_0x21acb6(0x15f)]===_0x21acb6(0x170)||_0xad822c['action']===_0x21acb6(0x148))){const _0x39e623=getTemplateUrl(_0x4e5fdf['site'],_0x1f817d,_0xad822c[_0x21acb6(0x151)]),_0x1ef8f7=_0xad822c[_0x21acb6(0x15f)]===_0x21acb6(0x170)?'+':'~',_0x20da1d=_0xad822c['action']===_0x21acb6(0x170)?a23_0x37f5e5[_0x21acb6(0x16c)](_0x1ef8f7):a23_0x37f5e5['yellow'](_0x1ef8f7);console[_0x21acb6(0x13b)]('\x20\x20'+_0x20da1d+'\x20'+hyperlink(_0xad822c['name'],_0x39e623)+'\x20'+a23_0x37f5e5[_0x21acb6(0x152)](_0x39e623));}}_0x466e9e[_0x21acb6(0x170)]>0x0&&console[_0x21acb6(0x13b)](a23_0x37f5e5['green'](_0x21acb6(0x166)+_0x466e9e['created']+_0x21acb6(0x12d)));_0x466e9e[_0x21acb6(0x148)]>0x0&&console[_0x21acb6(0x13b)](a23_0x37f5e5['green'](_0x21acb6(0x139)+_0x466e9e[_0x21acb6(0x148)]+_0x21acb6(0x12d)));if(_0x466e9e['errors'][_0x21acb6(0x141)]>0x0){console['error'](a23_0x37f5e5['red']('✘\x20'+_0x466e9e[_0x21acb6(0x138)][_0x21acb6(0x141)]+_0x21acb6(0x130)));for(const _0x4b7d9e of _0x466e9e[_0x21acb6(0x138)]){console[_0x21acb6(0x13b)]('\x20\x20'+a23_0x37f5e5[_0x21acb6(0x132)](_0x4b7d9e['name'])+':\x20'+_0x4b7d9e['error']);}}return saveSessionContext({'engage_workspace':_0x38ab72},_0x4e5fdf[_0x21acb6(0x140)]),_0x466e9e[_0x21acb6(0x138)][_0x21acb6(0x141)]>0x0?0x1:0x0;}}
1
+ const a25_0x1d9ab3=a25_0xe6bf;function a25_0xe6bf(_0x86f2e7,_0x3677be){_0x86f2e7=_0x86f2e7-0x180;const _0x47fd08=a25_0x47fd();let _0xe6bf77=_0x47fd08[_0x86f2e7];return _0xe6bf77;}(function(_0x3e3706,_0xc567df){const _0x2c0598=a25_0xe6bf,_0x2495de=_0x3e3706();while(!![]){try{const _0x1eac54=parseInt(_0x2c0598(0x184))/0x1*(-parseInt(_0x2c0598(0x1c6))/0x2)+-parseInt(_0x2c0598(0x1c1))/0x3+-parseInt(_0x2c0598(0x199))/0x4*(parseInt(_0x2c0598(0x1a0))/0x5)+-parseInt(_0x2c0598(0x198))/0x6+-parseInt(_0x2c0598(0x1af))/0x7+parseInt(_0x2c0598(0x187))/0x8*(parseInt(_0x2c0598(0x1c2))/0x9)+parseInt(_0x2c0598(0x18a))/0xa;if(_0x1eac54===_0xc567df)break;else _0x2495de['push'](_0x2495de['shift']());}catch(_0x37b608){_0x2495de['push'](_0x2495de['shift']());}}}(a25_0x47fd,0x5fce9));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a25_0x47fd(){const _0x27a236=['Found\x20','Preparing\x20push\x20to\x20workspace\x20\x27','6488pxqpUQ','\x0aValidation\x20errors\x20in\x20','action','488fvPsbw','engage_workspace','updated','14595120tEwbmE','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20template\x20YAML\x20files\x20found\x20in\x20','update','dim','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','templateId','create','\x27...','engage:template:push','config','Resolving\x20references...','dirname','valid','2822286ypQDgn','1128ghVlbl','-\x20no\x20changes\x20applied','def','created','resolve','\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)','configDir','5395oPAQzQ','✔\x20Created\x20','warnings','length','setPhase','execute','error','\x20templates','Aborted.','path','dryRun','yes','1\x20template\x20file:\x20','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x20\x20\x20\x20','2887318WyoRNt','Pushing\x20templates...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','Workspace\x20is\x20required.','site','\x0aPush\x20summary\x20for\x20workspace\x20\x27','✔\x20Updated\x20','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','workspace','\x20template\x20files','message','engage','yellow','\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','cwd','results','name','Push\x20','87708kFRTgK','71802ItUrHJ','green','relativePath','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','104LnuhxY','errors','verbose','red'];a25_0x47fd=function(){return _0x27a236;};return a25_0x47fd();}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a25_0x67137 from'chalk';import a25_0x3ecf4e 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{['name']=a25_0x1d9ab3(0x193);['description']=a25_0x1d9ab3(0x1c5);async[a25_0x1d9ab3(0x1a5)](_0x143537){const _0x1fefc1=a25_0x1d9ab3,{options:_0x646438,args:_0xac7894,tdx:_0x2e1512}=_0x143537,_0x20af82=_0x646438,_0x27bbaa=_0xac7894[0x0],_0x39b5cd=_0x27bbaa?a25_0x3ecf4e[_0x1fefc1(0x19d)](_0x27bbaa):undefined,_0x516c96=_0x39b5cd?isYamlFile(_0x39b5cd):![];let _0x35bad6;if(_0x516c96&&_0x39b5cd)_0x35bad6=a25_0x3ecf4e[_0x1fefc1(0x196)](_0x39b5cd);else _0x39b5cd?_0x35bad6=_0x39b5cd:_0x35bad6=process[_0x1fefc1(0x1bd)]();let _0x2b5a3f;const _0x1cfd3e=tryFindTdxConfig(_0x35bad6);_0x1cfd3e?.['config']['engage_workspace']&&(_0x2b5a3f=_0x1cfd3e[_0x1fefc1(0x194)][_0x1fefc1(0x188)],!_0x516c96&&(_0x35bad6=_0x1cfd3e[_0x1fefc1(0x19f)]));_0x20af82[_0x1fefc1(0x1b7)]&&(_0x2b5a3f=_0x20af82['workspace']);if(!_0x2b5a3f){const _0x3bdb6c=loadSessionContext(_0x20af82['session']);_0x3bdb6c?.[_0x1fefc1(0x188)]&&(_0x2b5a3f=_0x3bdb6c[_0x1fefc1(0x188)]);}if(!_0x2b5a3f)return console[_0x1fefc1(0x1a6)](a25_0x67137['yellow'](_0x1fefc1(0x1b2))),console[_0x1fefc1(0x1a6)](_0x1fefc1(0x1bc)),console['error'](_0x1fefc1(0x19e)),console['error']('\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'),console['error'](_0x1fefc1(0x1b6)),0x1;let _0x37636a;_0x516c96&&_0x39b5cd?_0x37636a=[parseTemplateFile(_0x39b5cd,a25_0x3ecf4e[_0x1fefc1(0x196)](_0x39b5cd))]:_0x37636a=discoverAndParseTemplateFiles(_0x35bad6);if(_0x37636a[_0x1fefc1(0x1a3)]===0x0)return console[_0x1fefc1(0x1a6)](a25_0x67137[_0x1fefc1(0x1bb)](_0x1fefc1(0x18c)+_0x35bad6)),console[_0x1fefc1(0x1a6)](a25_0x67137[_0x1fefc1(0x18e)](_0x1fefc1(0x1ad))),0x1;const _0x7d4078=_0x37636a['length']===0x1?_0x1fefc1(0x1ac)+_0x37636a[0x0][_0x1fefc1(0x19b)][_0x1fefc1(0x1bf)]:_0x37636a[_0x1fefc1(0x1a3)]+_0x1fefc1(0x1b8);console[_0x1fefc1(0x1a6)](_0x1fefc1(0x182)+a25_0x67137['cyan'](_0x7d4078));let _0x3157cd=![];for(const _0x5d11d4 of _0x37636a){const _0x20dfcc=validateTemplateDef(_0x5d11d4[_0x1fefc1(0x19b)]);if(!_0x20dfcc[_0x1fefc1(0x197)]){_0x3157cd=!![],console[_0x1fefc1(0x1a6)](a25_0x67137['red'](_0x1fefc1(0x185)+_0x5d11d4[_0x1fefc1(0x1c4)]+':'));for(const _0x234186 of _0x20dfcc[_0x1fefc1(0x1c7)]){console[_0x1fefc1(0x1a6)]('\x20\x20'+a25_0x67137['red']('✗')+'\x20'+_0x234186['path']+':\x20'+_0x234186['message']);}}for(const _0x361ba6 of _0x20dfcc[_0x1fefc1(0x1a2)]){console[_0x1fefc1(0x1a6)]('\x20\x20'+a25_0x67137['yellow']('⚠')+'\x20'+_0x361ba6[_0x1fefc1(0x1a9)]+':\x20'+_0x361ba6[_0x1fefc1(0x1b9)]);}}if(_0x3157cd)return console['error'](a25_0x67137[_0x1fefc1(0x181)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x51ba19=await _0x2e1512['engage']['resolveWorkspaceId'](_0x2b5a3f),_0x3a737f=await withProgressSpinner(_0x1fefc1(0x183)+_0x2b5a3f+_0x1fefc1(0x192),_0x2857a6=>preparePush({'engage':_0x2e1512[_0x1fefc1(0x1ba)]},_0x37636a,_0x51ba19,{'progress':{'update':_0x35e5a6=>_0x2857a6[_0x1fefc1(0x1a4)](_0x35e5a6)}}),{'verbose':_0x20af82[_0x1fefc1(0x180)]}),_0x4015d1=_0x3a737f['data'];await withProgressSpinner(_0x1fefc1(0x195),_0x26c863=>resolveAndBuildInputs({'engage':_0x2e1512[_0x1fefc1(0x1ba)]},_0x4015d1,_0x51ba19,{'progress':{'update':_0x294eec=>_0x26c863[_0x1fefc1(0x1a4)](_0x294eec)}}),{'verbose':_0x20af82[_0x1fefc1(0x180)]});const _0x4e6d52=_0x4015d1['filter'](_0x593385=>_0x593385[_0x1fefc1(0x186)]===_0x1fefc1(0x191)),_0x14ce20=_0x4015d1['filter'](_0x3c75b5=>_0x3c75b5[_0x1fefc1(0x186)]===_0x1fefc1(0x18d));console[_0x1fefc1(0x1a6)](_0x1fefc1(0x1b4)+_0x2b5a3f+'\x27:');if(_0x4e6d52[_0x1fefc1(0x1a3)]>0x0){console[_0x1fefc1(0x1a6)]('\x20\x20'+a25_0x67137['green']('+\x20'+_0x4e6d52[_0x1fefc1(0x1a3)]+'\x20new\x20templates:'));for(const _0x543578 of _0x4e6d52){console[_0x1fefc1(0x1a6)]('\x20\x20\x20\x20'+a25_0x67137['green']('+')+'\x20'+_0x543578[_0x1fefc1(0x19b)][_0x1fefc1(0x1bf)]);}}if(_0x14ce20['length']>0x0){console[_0x1fefc1(0x1a6)]('\x20\x20'+a25_0x67137[_0x1fefc1(0x1bb)]('~\x20'+_0x14ce20[_0x1fefc1(0x1a3)]+'\x20templates\x20to\x20update:'));for(const _0x10c3db of _0x14ce20){console[_0x1fefc1(0x1a6)](_0x1fefc1(0x1ae)+a25_0x67137[_0x1fefc1(0x1bb)]('~')+'\x20'+_0x10c3db[_0x1fefc1(0x19b)][_0x1fefc1(0x1bf)]);}}if(_0x4e6d52[_0x1fefc1(0x1a3)]===0x0&&_0x14ce20[_0x1fefc1(0x1a3)]===0x0)return console[_0x1fefc1(0x1a6)](a25_0x67137[_0x1fefc1(0x1c3)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x20af82[_0x1fefc1(0x1aa)])return console['error'](a25_0x67137[_0x1fefc1(0x1bb)](_0x1fefc1(0x1b1))),0x0;if(!_0x20af82[_0x1fefc1(0x1ab)]){if(!isInteractive())return console['error'](a25_0x67137[_0x1fefc1(0x181)]('\x0aError:'),_0x1fefc1(0x18b)),console['error'](a25_0x67137[_0x1fefc1(0x18e)](_0x1fefc1(0x18f))),0x1;const _0x2a9fc9=await confirmKey(_0x1fefc1(0x1c0)+(_0x4e6d52[_0x1fefc1(0x1a3)]+_0x14ce20[_0x1fefc1(0x1a3)])+'\x20templates?');if(!_0x2a9fc9)return console['error'](a25_0x67137[_0x1fefc1(0x1bb)](_0x1fefc1(0x1a8)),_0x1fefc1(0x19a)),0x1;}const _0x17c6c8=await withProgressSpinner(_0x1fefc1(0x1b0),_0x431163=>executePush({'engage':_0x2e1512[_0x1fefc1(0x1ba)]},_0x4015d1,{'progress':{'update':_0x2e94ca=>_0x431163['setPhase'](_0x2e94ca)}}),{'verbose':_0x20af82[_0x1fefc1(0x180)]}),_0x16d569=_0x17c6c8['data'];for(const _0x37af78 of _0x16d569[_0x1fefc1(0x1be)]){if(_0x37af78[_0x1fefc1(0x190)]&&(_0x37af78[_0x1fefc1(0x186)]==='created'||_0x37af78['action']==='updated')){const _0x44c2bc=getTemplateUrl(_0x20af82[_0x1fefc1(0x1b3)],_0x51ba19,_0x37af78[_0x1fefc1(0x190)]),_0x5ba440=_0x37af78[_0x1fefc1(0x186)]===_0x1fefc1(0x19c)?'+':'~',_0x3642a3=_0x37af78[_0x1fefc1(0x186)]===_0x1fefc1(0x19c)?a25_0x67137['green'](_0x5ba440):a25_0x67137[_0x1fefc1(0x1bb)](_0x5ba440);console[_0x1fefc1(0x1a6)]('\x20\x20'+_0x3642a3+'\x20'+hyperlink(_0x37af78[_0x1fefc1(0x1bf)],_0x44c2bc)+'\x20'+a25_0x67137['dim'](_0x44c2bc));}}_0x16d569['created']>0x0&&console[_0x1fefc1(0x1a6)](a25_0x67137[_0x1fefc1(0x1c3)](_0x1fefc1(0x1a1)+_0x16d569[_0x1fefc1(0x19c)]+_0x1fefc1(0x1a7)));_0x16d569[_0x1fefc1(0x189)]>0x0&&console[_0x1fefc1(0x1a6)](a25_0x67137['green'](_0x1fefc1(0x1b5)+_0x16d569[_0x1fefc1(0x189)]+'\x20templates'));if(_0x16d569[_0x1fefc1(0x1c7)][_0x1fefc1(0x1a3)]>0x0){console[_0x1fefc1(0x1a6)](a25_0x67137['red']('✘\x20'+_0x16d569[_0x1fefc1(0x1c7)][_0x1fefc1(0x1a3)]+'\x20errors:'));for(const _0x483fe1 of _0x16d569[_0x1fefc1(0x1c7)]){console['error']('\x20\x20'+a25_0x67137[_0x1fefc1(0x181)](_0x483fe1[_0x1fefc1(0x1bf)])+':\x20'+_0x483fe1[_0x1fefc1(0x1a6)]);}}return saveSessionContext({'engage_workspace':_0x2b5a3f},_0x20af82['session']),_0x16d569[_0x1fefc1(0x1c7)][_0x1fefc1(0x1a3)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a24_0x56358d=a24_0x419c;(function(_0xfaf926,_0x5613d5){const _0x3f5d22=a24_0x419c,_0x885feb=_0xfaf926();while(!![]){try{const _0x38b766=-parseInt(_0x3f5d22(0x115))/0x1*(parseInt(_0x3f5d22(0x120))/0x2)+parseInt(_0x3f5d22(0x11c))/0x3*(parseInt(_0x3f5d22(0x122))/0x4)+-parseInt(_0x3f5d22(0x125))/0x5+-parseInt(_0x3f5d22(0x13a))/0x6*(parseInt(_0x3f5d22(0x133))/0x7)+parseInt(_0x3f5d22(0x10c))/0x8*(parseInt(_0x3f5d22(0x128))/0x9)+parseInt(_0x3f5d22(0x11e))/0xa+parseInt(_0x3f5d22(0x12c))/0xb;if(_0x38b766===_0x5613d5)break;else _0x885feb['push'](_0x885feb['shift']());}catch(_0x3899b6){_0x885feb['push'](_0x885feb['shift']());}}}(a24_0x2302,0x70f7a));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a24_0x419c(_0x3bbc16,_0x139da3){_0x3bbc16=_0x3bbc16-0x10b;const _0x230286=a24_0x2302();let _0x419ca2=_0x230286[_0x3bbc16];return _0x419ca2;}import a24_0x4c29d1 from'chalk';import a24_0x127fdf from'path';function a24_0x2302(){const _0x1773d5=['green','2495097mpxfaT','Validation\x20failed:\x20','name','endsWith','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','✔\x20All\x20','filter','7kyqrUW','dirname','No\x20template\x20YAML\x20files\x20found\x20in\x20','warnings','reason','\x20valid','\x20error(s)','4311666qRaJVk','template','skippedCount','407112svebPo','\x20(skipped:\x20','.yml','verbose','validCount','valid','cwd','invalidCount','red','3UfgVbf','Validate\x20template\x20YAML\x20files','\x20template(s)\x20valid','execute','dim','hasErrors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','4206XzXAkG','resolve','4594040OjDiDE','relativePath','360970rTBRFT','errors','716JrVhEL','\x20warning(s)\x20found','warningCount','397610hCtcln','log','length','153rYcTFj','yellow','error'];a24_0x2302=function(){return _0x1773d5;};return a24_0x2302();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a24_0x56358d(0x12e)]='engage:template:validate';['description']=a24_0x56358d(0x116);async[a24_0x56358d(0x118)](_0x1ac647){const _0x24c77b=a24_0x56358d,{options:_0x578074,args:_0x4b4cce}=_0x1ac647,_0x579d83=_0x578074,_0x3d64d1=_0x4b4cce[0x0],_0x56b13c=_0x3d64d1?a24_0x127fdf[_0x24c77b(0x11d)](_0x3d64d1):undefined,_0x2e3d1f=_0x56b13c?isYamlFile(_0x56b13c):![];let _0x1993a9,_0x2ed785;if(_0x2e3d1f&&_0x56b13c)_0x1993a9=a24_0x127fdf[_0x24c77b(0x134)](_0x56b13c),_0x2ed785=_0x56b13c;else _0x56b13c?_0x1993a9=_0x56b13c:_0x1993a9=process[_0x24c77b(0x112)]();if(!_0x2ed785&&!existsSync(_0x1993a9))return console[_0x24c77b(0x12a)](a24_0x4c29d1[_0x24c77b(0x114)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1993a9+'\x0a')),0x1;let _0x56a8dd;if(_0x2ed785){if(!_0x2ed785[_0x24c77b(0x12f)](_0x24c77b(0x10e))&&!_0x2ed785[_0x24c77b(0x12f)]('.yaml'))return console[_0x24c77b(0x12a)](a24_0x4c29d1[_0x24c77b(0x114)](_0x24c77b(0x130)+_0x2ed785+'\x0a')),0x1;_0x56a8dd=[_0x2ed785];}else _0x56a8dd=findYamlFiles(_0x1993a9);if(_0x56a8dd[_0x24c77b(0x127)]===0x0)return console[_0x24c77b(0x12a)](a24_0x4c29d1[_0x24c77b(0x114)](_0x24c77b(0x11b)+_0x1993a9+'\x0a')),0x1;const _0x17e6f6=validateYamlFiles(_0x56a8dd,_0x1993a9,{'filterType':_0x24c77b(0x13b)}),_0x47ab81=calculateSummary(_0x17e6f6),_0x4044be=_0x17e6f6[_0x24c77b(0x132)](isValidationResult);if(_0x4044be[_0x24c77b(0x127)]===0x0)return console['error'](a24_0x4c29d1[_0x24c77b(0x129)](_0x24c77b(0x135)+_0x1993a9+'\x0a')),_0x47ab81[_0x24c77b(0x10b)]>0x0&&console['error'](a24_0x4c29d1['dim']('('+_0x47ab81[_0x24c77b(0x10b)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x40d86b of _0x17e6f6){if(!isValidationResult(_0x40d86b)){_0x579d83[_0x24c77b(0x10f)]&&console['log'](a24_0x4c29d1[_0x24c77b(0x119)]('-\x20'+_0x40d86b[_0x24c77b(0x11f)]+_0x24c77b(0x10d)+_0x40d86b[_0x24c77b(0x137)]+')'));continue;}const {relativePath:_0x3aa291,source:_0x1c87e3,result:_0x279b27}=_0x40d86b;if(_0x279b27[_0x24c77b(0x111)]&&_0x279b27[_0x24c77b(0x136)][_0x24c77b(0x127)]===0x0)_0x579d83[_0x24c77b(0x10f)]&&console['log'](a24_0x4c29d1['green']('✔\x20'+_0x3aa291));else _0x279b27[_0x24c77b(0x111)]?(console[_0x24c77b(0x126)](a24_0x4c29d1[_0x24c77b(0x129)]('⚠\x20'+_0x3aa291+':\x20'+_0x279b27[_0x24c77b(0x136)][_0x24c77b(0x127)]+'\x20warning(s)')),console[_0x24c77b(0x126)](formatValidationResult(_0x279b27,_0x1c87e3,_0x3aa291))):(console[_0x24c77b(0x126)](a24_0x4c29d1[_0x24c77b(0x114)]('✖\x20'+_0x3aa291+':\x20'+_0x279b27[_0x24c77b(0x121)]['length']+_0x24c77b(0x139))),console[_0x24c77b(0x126)](formatValidationResult(_0x279b27,_0x1c87e3,_0x3aa291)));}return console[_0x24c77b(0x126)](''),_0x47ab81[_0x24c77b(0x11a)]?(console[_0x24c77b(0x126)](a24_0x4c29d1[_0x24c77b(0x114)](_0x24c77b(0x12d)+_0x47ab81[_0x24c77b(0x113)]+'\x20template(s)\x20with\x20errors,\x20'+_0x47ab81[_0x24c77b(0x110)]+_0x24c77b(0x138))),_0x47ab81['warningCount']>0x0&&console['log'](a24_0x4c29d1[_0x24c77b(0x129)](_0x47ab81[_0x24c77b(0x124)]+_0x24c77b(0x123))),_0x47ab81[_0x24c77b(0x10b)]>0x0&&console[_0x24c77b(0x126)](a24_0x4c29d1['dim'](_0x47ab81[_0x24c77b(0x10b)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x24c77b(0x126)](a24_0x4c29d1[_0x24c77b(0x12b)](_0x24c77b(0x131)+_0x47ab81[_0x24c77b(0x110)]+_0x24c77b(0x117))),_0x47ab81['warningCount']>0x0&&console[_0x24c77b(0x126)](a24_0x4c29d1[_0x24c77b(0x129)](_0x47ab81[_0x24c77b(0x124)]+_0x24c77b(0x123))),_0x47ab81['skippedCount']>0x0&&console[_0x24c77b(0x126)](a24_0x4c29d1[_0x24c77b(0x119)](_0x47ab81[_0x24c77b(0x10b)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
1
+ const a26_0xc1efe6=a26_0x3c6b;(function(_0x216e02,_0x44bccb){const _0x153723=a26_0x3c6b,_0x124513=_0x216e02();while(!![]){try{const _0x5c47c6=-parseInt(_0x153723(0x16f))/0x1*(-parseInt(_0x153723(0x173))/0x2)+-parseInt(_0x153723(0x17a))/0x3*(parseInt(_0x153723(0x195))/0x4)+parseInt(_0x153723(0x191))/0x5+parseInt(_0x153723(0x180))/0x6*(parseInt(_0x153723(0x171))/0x7)+parseInt(_0x153723(0x18b))/0x8*(parseInt(_0x153723(0x18a))/0x9)+-parseInt(_0x153723(0x17c))/0xa*(parseInt(_0x153723(0x178))/0xb)+-parseInt(_0x153723(0x185))/0xc*(-parseInt(_0x153723(0x182))/0xd);if(_0x5c47c6===_0x44bccb)break;else _0x124513['push'](_0x124513['shift']());}catch(_0x29206c){_0x124513['push'](_0x124513['shift']());}}}(a26_0x567b,0x28c10));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x4e0d4a from'chalk';import a26_0x25bcd9 from'path';function a26_0x3c6b(_0x597ef3,_0x342689){_0x597ef3=_0x597ef3-0x169;const _0x567b8c=a26_0x567b();let _0x3c6bc0=_0x567b8c[_0x597ef3];return _0x3c6bc0;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a26_0x567b(){const _0x209128=['verbose','\x20error(s)','1771VQYeKA','yellow','159ZynhVv','template','12180PcSyab','warningCount','validCount','.yaml','6882CnGuKh','Error:\x20Directory\x20not\x20found:\x20','73879grcYCs','name','filter','192PQLBoU','invalidCount','relativePath','hasErrors','\x20non-template\x20file(s)\x20skipped)','1962wUUKWd','3496DaAGYU','\x20warning(s)\x20found','error','\x20(skipped:\x20','\x20valid','warnings','800500yMBmAm','dirname','\x20template(s)\x20with\x20errors,\x20','\x20warning(s)','14588lsRyqG','Validation\x20failed:\x20','green','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','skippedCount','dim','log','\x20template(s)\x20valid','length','1ekxiCt','endsWith','525peZyUI','engage:template:validate','247996PBqSAv','valid','errors'];a26_0x567b=function(){return _0x209128;};return a26_0x567b();}export class EngageTemplateValidateCommand extends BaseCommand{[a26_0xc1efe6(0x183)]=a26_0xc1efe6(0x172);['description']='Validate\x20template\x20YAML\x20files';async['execute'](_0x5a9df5){const _0x18993c=a26_0xc1efe6,{options:_0x12fe9d,args:_0x3f068e}=_0x5a9df5,_0x4422b9=_0x12fe9d,_0x2debc8=_0x3f068e[0x0],_0x81d1ee=_0x2debc8?a26_0x25bcd9['resolve'](_0x2debc8):undefined,_0x41ba8f=_0x81d1ee?isYamlFile(_0x81d1ee):![];let _0x3d9707,_0xe5cf4e;if(_0x41ba8f&&_0x81d1ee)_0x3d9707=a26_0x25bcd9[_0x18993c(0x192)](_0x81d1ee),_0xe5cf4e=_0x81d1ee;else _0x81d1ee?_0x3d9707=_0x81d1ee:_0x3d9707=process['cwd']();if(!_0xe5cf4e&&!existsSync(_0x3d9707))return console[_0x18993c(0x18d)](a26_0x4e0d4a['red'](_0x18993c(0x181)+_0x3d9707+'\x0a')),0x1;let _0x53601d;if(_0xe5cf4e){if(!_0xe5cf4e[_0x18993c(0x170)]('.yml')&&!_0xe5cf4e['endsWith'](_0x18993c(0x17f)))return console['error'](a26_0x4e0d4a[_0x18993c(0x169)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xe5cf4e+'\x0a')),0x1;_0x53601d=[_0xe5cf4e];}else _0x53601d=findYamlFiles(_0x3d9707);if(_0x53601d[_0x18993c(0x16e)]===0x0)return console[_0x18993c(0x18d)](a26_0x4e0d4a[_0x18993c(0x169)](_0x18993c(0x198)+_0x3d9707+'\x0a')),0x1;const _0x27fcbe=validateYamlFiles(_0x53601d,_0x3d9707,{'filterType':_0x18993c(0x17b)}),_0xd157cb=calculateSummary(_0x27fcbe),_0xe35413=_0x27fcbe[_0x18993c(0x184)](isValidationResult);if(_0xe35413[_0x18993c(0x16e)]===0x0)return console[_0x18993c(0x18d)](a26_0x4e0d4a[_0x18993c(0x179)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x3d9707+'\x0a')),_0xd157cb['skippedCount']>0x0&&console[_0x18993c(0x18d)](a26_0x4e0d4a[_0x18993c(0x16b)]('('+_0xd157cb[_0x18993c(0x16a)]+_0x18993c(0x189))),0x0;for(const _0x3284b0 of _0x27fcbe){if(!isValidationResult(_0x3284b0)){_0x4422b9[_0x18993c(0x176)]&&console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x16b)]('-\x20'+_0x3284b0[_0x18993c(0x187)]+_0x18993c(0x18e)+_0x3284b0['reason']+')'));continue;}const {relativePath:_0x432bff,source:_0x54a9f7,result:_0x48555a}=_0x3284b0;if(_0x48555a[_0x18993c(0x174)]&&_0x48555a[_0x18993c(0x190)][_0x18993c(0x16e)]===0x0)_0x4422b9['verbose']&&console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x197)]('✔\x20'+_0x432bff));else _0x48555a[_0x18993c(0x174)]?(console['log'](a26_0x4e0d4a[_0x18993c(0x179)]('⚠\x20'+_0x432bff+':\x20'+_0x48555a['warnings'][_0x18993c(0x16e)]+_0x18993c(0x194))),console['log'](formatValidationResult(_0x48555a,_0x54a9f7,_0x432bff))):(console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x169)]('✖\x20'+_0x432bff+':\x20'+_0x48555a[_0x18993c(0x175)][_0x18993c(0x16e)]+_0x18993c(0x177))),console[_0x18993c(0x16c)](formatValidationResult(_0x48555a,_0x54a9f7,_0x432bff)));}return console[_0x18993c(0x16c)](''),_0xd157cb[_0x18993c(0x188)]?(console['log'](a26_0x4e0d4a[_0x18993c(0x169)](_0x18993c(0x196)+_0xd157cb[_0x18993c(0x186)]+_0x18993c(0x193)+_0xd157cb[_0x18993c(0x17e)]+_0x18993c(0x18f))),_0xd157cb[_0x18993c(0x17d)]>0x0&&console[_0x18993c(0x16c)](a26_0x4e0d4a['yellow'](_0xd157cb[_0x18993c(0x17d)]+_0x18993c(0x18c))),_0xd157cb[_0x18993c(0x16a)]>0x0&&console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x16b)](_0xd157cb['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x197)]('✔\x20All\x20'+_0xd157cb[_0x18993c(0x17e)]+_0x18993c(0x16d))),_0xd157cb[_0x18993c(0x17d)]>0x0&&console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x179)](_0xd157cb[_0x18993c(0x17d)]+_0x18993c(0x18c))),_0xd157cb[_0x18993c(0x16a)]>0x0&&console[_0x18993c(0x16c)](a26_0x4e0d4a['dim'](_0xd157cb[_0x18993c(0x16a)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
@@ -1 +1 @@
1
- const a25_0x216208=a25_0x5286;function a25_0x3cde(){const _0x54350f=['status','debug','job:kill','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','length','76jhHTcg','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','\x20\x20Job\x20ID:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','6558656abkOFh','trino','hive','12qjtUji','46155142klhzar','execute','map','Status\x20filter:\x20','priority','...','push','red','presto','job:result','h\x20ago','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','submit','List\x20jobs','✔\x20Retrieved\x20','created_at','getTime','log','d\x20ago','jobs','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','verbose','green','\x20job','Kill\x20a\x20job','site','end_at','Getting\x20job\x20details...','3kwrgOz','file','limit','start_at','Job\x20type:\x20','show','round','Submitting\x20kill\x20request...','query','description','Submitting\x20job...','✔\x20Found\x20','4407425WtDoAd','error','\x20jobs','user_name','floor','url','result','information_schema','571734cndZsG','validate','yes','60SKrAdl','Database:\x20','database','data','\x20row','Getting\x20job\x20results...','dim','m\x20ago','job_id','args','success','INVALID_ARGUMENT','substring','now','190NlXbEI','name','\x27\x20to\x20verify\x20the\x20job\x20status','type','4779532FCJaFx','Query:\x20','jobType','461419GbAtNy','Limit:\x20','39325aYpoaf'];a25_0x3cde=function(){return _0x54350f;};return a25_0x3cde();}(function(_0x4e739b,_0x5cef3d){const _0x24d955=a25_0x5286,_0x4d97bb=_0x4e739b();while(!![]){try{const _0x4adf67=parseInt(_0x24d955(0x1b4))/0x1*(parseInt(_0x24d955(0x160))/0x2)+-parseInt(_0x24d955(0x186))/0x3*(parseInt(_0x24d955(0x1af))/0x4)+-parseInt(_0x24d955(0x192))/0x5+parseInt(_0x24d955(0x19d))/0x6*(-parseInt(_0x24d955(0x1b2))/0x7)+-parseInt(_0x24d955(0x166))/0x8+-parseInt(_0x24d955(0x19a))/0x9*(parseInt(_0x24d955(0x1ab))/0xa)+-parseInt(_0x24d955(0x16a))/0xb*(-parseInt(_0x24d955(0x169))/0xc);if(_0x4adf67===_0x5cef3d)break;else _0x4d97bb['push'](_0x4d97bb['shift']());}catch(_0x5c4d5c){_0x4d97bb['push'](_0x4d97bb['shift']());}}}(a25_0x3cde,0xe28a4));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';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x5313d5 from'chalk';function formatDuration(_0x1b74ed){const _0x347069=a25_0x5286;if(_0x1b74ed<0x3c)return _0x1b74ed+'s';if(_0x1b74ed<0xe10)return Math['floor'](_0x1b74ed/0x3c)+'m\x20'+_0x1b74ed%0x3c+'s';const _0x2fa946=Math['floor'](_0x1b74ed/0xe10),_0xba196=Math[_0x347069(0x196)](_0x1b74ed%0xe10/0x3c);return _0xba196>0x0?_0x2fa946+'h\x20'+_0xba196+'m':_0x2fa946+'h';}function formatRelativeTime(_0x357155){const _0x509729=a25_0x5286,_0x4d0f90=Date[_0x509729(0x1aa)]()-_0x357155['getTime'](),_0x1641be=Math[_0x509729(0x196)](Math['abs'](_0x4d0f90)/0x3e8);if(_0x1641be<0x3c)return'just\x20now';const _0xc206ac=Math['floor'](_0x1641be/0x3c);if(_0xc206ac<0x3c)return _0xc206ac+_0x509729(0x1a4);const _0x1698be=Math[_0x509729(0x196)](_0xc206ac/0x3c);if(_0x1698be<0x18)return _0x1698be+_0x509729(0x174);const _0x423b1b=Math['floor'](_0x1698be/0x18);if(_0x423b1b<0x1e)return _0x423b1b+_0x509729(0x17c);return Math[_0x509729(0x196)](_0x423b1b/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']=a25_0x216208(0x17d);[a25_0x216208(0x18f)]=a25_0x216208(0x177);async['execute'](_0x6f4072){const _0x1a1d21=a25_0x216208,{options:_0x58ee33,tdx:_0x56eb5e}=_0x6f4072,_0x3a0de7=resolveLimit(_0x58ee33[_0x1a1d21(0x188)],DEFAULT_DISPLAY_LIMIT),_0xfad2e=_0x58ee33[_0x1a1d21(0x1b5)];_0x58ee33['verbose']&&(console[_0x1a1d21(0x193)](_0x1a1d21(0x1b3)+_0x3a0de7+_0x1a1d21(0x194)),_0xfad2e&&console[_0x1a1d21(0x193)](_0x1a1d21(0x16d)+_0xfad2e));const _0x52b7c9=await withSpinner('Listing\x20jobs...',()=>_0x56eb5e[_0x1a1d21(0x17d)]['list']({'from':0x0,'to':_0x3a0de7-0x1,'status':_0xfad2e}),{'verbose':_0x58ee33[_0x1a1d21(0x17f)]}),_0x34595c=_0x52b7c9[_0x1a1d21(0x1a0)];console[_0x1a1d21(0x193)](_0x1a1d21(0x191)+_0x34595c[_0x1a1d21(0x15f)]+_0x1a1d21(0x181)+(_0x34595c[_0x1a1d21(0x15f)]!==0x1?'s':''));const _0x11239f=_0x58ee33[_0x1a1d21(0x183)];if(isStructuredFormat(_0x58ee33)){const _0x483cbf=_0x34595c[_0x1a1d21(0x16c)](_0x212618=>{const _0x54f67e=_0x1a1d21;let _0x32bf0e;if(_0x212618[_0x54f67e(0x189)]&&_0x212618['end_at']){const _0x35fbf7=new Date(_0x212618[_0x54f67e(0x189)])[_0x54f67e(0x17a)](),_0x5c75a2=new Date(_0x212618[_0x54f67e(0x184)])['getTime']();_0x32bf0e=Math['round']((_0x5c75a2-_0x35fbf7)/0x3e8);}return{'job_id':_0x212618[_0x54f67e(0x1a5)],'type':_0x212618[_0x54f67e(0x1ae)]===_0x54f67e(0x172)?_0x54f67e(0x167):_0x212618[_0x54f67e(0x1ae)],'status':_0x212618['status'],'user_name':_0x212618[_0x54f67e(0x195)],'duration_sec':_0x32bf0e,'created_at':_0x212618[_0x54f67e(0x179)],'started_at':_0x212618[_0x54f67e(0x189)],'end_at':_0x212618[_0x54f67e(0x184)]};});await handleSDKOutput(_0x483cbf,_0x58ee33);}else for(const _0x5730c6 of _0x34595c){const _0x1489a2=_0x5730c6[_0x1a1d21(0x1b5)]===_0x1a1d21(0x1a7)?a25_0x5313d5[_0x1a1d21(0x180)]:_0x5730c6['status']==='error'?a25_0x5313d5[_0x1a1d21(0x171)]:a25_0x5313d5[_0x1a1d21(0x1a3)],_0x24c006=_0x1489a2(_0x5730c6[_0x1a1d21(0x1b5)]),_0x54f2e9=getJobUrl(_0x11239f,_0x5730c6[_0x1a1d21(0x1a5)]),_0x44e641=hyperlink(_0x5730c6[_0x1a1d21(0x1a5)],_0x54f2e9),_0x3512bb=a25_0x5313d5[_0x1a1d21(0x1a3)](_0x5730c6[_0x1a1d21(0x1ae)]==='presto'?_0x1a1d21(0x167):_0x5730c6[_0x1a1d21(0x1ae)]),_0x5b6fb9=[];if(_0x5730c6[_0x1a1d21(0x189)]&&_0x5730c6[_0x1a1d21(0x184)]){const _0x4f320e=Math[_0x1a1d21(0x18c)]((new Date(_0x5730c6['end_at'])[_0x1a1d21(0x17a)]()-new Date(_0x5730c6[_0x1a1d21(0x189)])[_0x1a1d21(0x17a)]())/0x3e8);_0x5b6fb9[_0x1a1d21(0x170)](formatDuration(_0x4f320e));}if(_0x5730c6[_0x1a1d21(0x184)])_0x5b6fb9[_0x1a1d21(0x170)](formatRelativeTime(new Date(_0x5730c6[_0x1a1d21(0x184)])));else _0x5730c6[_0x1a1d21(0x189)]&&_0x5b6fb9[_0x1a1d21(0x170)](formatRelativeTime(new Date(_0x5730c6[_0x1a1d21(0x189)])));const _0x4d74d2=_0x5b6fb9['length']>0x0?a25_0x5313d5[_0x1a1d21(0x1a3)]('\x20'+_0x5b6fb9['join'](',\x20')):'';console[_0x1a1d21(0x17b)]('⚡\x20'+_0x44e641+'\x20'+_0x3512bb+'\x20'+_0x24c006+_0x4d74d2);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x216208(0x1ac)]='job:show';[a25_0x216208(0x18f)]='Show\x20job\x20details';['validate'](_0x42e531){const _0xe01d72=a25_0x216208,_0xbc30d5=_0x42e531[_0xe01d72(0x1a6)][0x0];if(!_0xbc30d5)return _0xe01d72(0x162);return undefined;}async[a25_0x216208(0x16b)](_0x250d20){const _0x3b661e=a25_0x216208,{options:_0x25485b,args:_0x493c9e,tdx:_0x3bc87b}=_0x250d20,_0x575e1e=_0x493c9e[0x0],_0x45740e=await withSpinner(_0x3b661e(0x185),()=>_0x3bc87b[_0x3b661e(0x17d)][_0x3b661e(0x18b)](_0x575e1e),{'verbose':_0x25485b[_0x3b661e(0x17f)]}),_0x1b1d5c=_0x45740e[_0x3b661e(0x1a0)];let _0x5ec8b7;if(_0x1b1d5c[_0x3b661e(0x189)]&&_0x1b1d5c[_0x3b661e(0x184)]){const _0x1020f9=new Date(_0x1b1d5c[_0x3b661e(0x189)])[_0x3b661e(0x17a)](),_0x321829=new Date(_0x1b1d5c[_0x3b661e(0x184)])[_0x3b661e(0x17a)]();_0x5ec8b7=Math[_0x3b661e(0x18c)]((_0x321829-_0x1020f9)/0x3e8);}const _0x2cc2e4={'job_id':_0x1b1d5c[_0x3b661e(0x1a5)],'type':_0x1b1d5c[_0x3b661e(0x1ae)],'status':_0x1b1d5c['status'],..._0x1b1d5c['user_name']&&{'user_name':_0x1b1d5c[_0x3b661e(0x195)]},..._0x5ec8b7!==undefined&&{'duration_sec':_0x5ec8b7},..._0x1b1d5c[_0x3b661e(0x179)]&&{'created_at':_0x1b1d5c['created_at']},..._0x1b1d5c[_0x3b661e(0x189)]&&{'started_at':_0x1b1d5c[_0x3b661e(0x189)]},..._0x1b1d5c['end_at']&&{'end_at':_0x1b1d5c[_0x3b661e(0x184)]},..._0x1b1d5c[_0x3b661e(0x19f)]&&{'database':_0x1b1d5c[_0x3b661e(0x19f)]},..._0x1b1d5c[_0x3b661e(0x16e)]!==undefined&&{'priority':_0x1b1d5c[_0x3b661e(0x16e)]},..._0x1b1d5c[_0x3b661e(0x197)]&&{'url':_0x1b1d5c[_0x3b661e(0x197)]},..._0x1b1d5c[_0x3b661e(0x18e)]&&{'query':_0x1b1d5c[_0x3b661e(0x18e)]},..._0x1b1d5c[_0x3b661e(0x1b6)]&&{'debug':_0x1b1d5c[_0x3b661e(0x1b6)]}};return await handleSingleObjectOutput(_0x2cc2e4,_0x25485b),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x216208(0x1ac)]=a25_0x216208(0x1b7);[a25_0x216208(0x18f)]=a25_0x216208(0x182);[a25_0x216208(0x19b)](_0x32a37f){const _0x13bfd3=a25_0x216208,_0x40acfa=_0x32a37f[_0x13bfd3(0x1a6)][0x0];if(!_0x40acfa)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async['execute'](_0x3e8438){const _0x2e0364=a25_0x216208,{options:_0x12fffa,args:_0xcccba7,tdx:_0x45cce6}=_0x3e8438,_0x381785=_0xcccba7[0x0];if(!_0x12fffa[_0x2e0364(0x19c)]){const _0x343ee9=await confirm(_0x2e0364(0x161)+_0x381785+'?');if(!_0x343ee9)return console['error']('Cancelled'),0x0;}return await withSpinner(_0x2e0364(0x18d),()=>_0x45cce6[_0x2e0364(0x17d)]['kill'](_0x381785),{'verbose':_0x12fffa[_0x2e0364(0x17f)]}),console['error'](_0x2e0364(0x1b8)+_0x381785),console[_0x2e0364(0x193)](_0x2e0364(0x165)+_0x381785+_0x2e0364(0x1ad)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a25_0x216208(0x1ac)]='job:submit';[a25_0x216208(0x18f)]='Submit\x20a\x20job';async['execute'](_0x3c0469){const _0x31eee4=a25_0x216208,{options:_0x31bdb6,args:_0x3db221,tdx:_0x4f3e38}=_0x3c0469,_0x587afc=_0x31bdb6[_0x31eee4(0x1b1)]||'trino',_0x505365=_0x31bdb6[_0x31eee4(0x187)],_0x33e6aa=_0x31bdb6['database']||_0x31eee4(0x199),_0x3525f0=_0x31bdb6[_0x31eee4(0x198)];if(_0x587afc!=='trino'&&_0x587afc!==_0x31eee4(0x168))throw new SDKError(ErrorCode[_0x31eee4(0x1a8)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x2fe155;if(_0x505365){if(_0x3db221[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x248554=readSqlStatementsFromFile(_0x505365);if(_0x248554[_0x31eee4(0x15f)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x248554['length']>0x1)throw new SDKError(ErrorCode[_0x31eee4(0x1a8)],_0x31eee4(0x17e));_0x2fe155=_0x248554[0x0];}else{if(!_0x3db221[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x31eee4(0x175));_0x2fe155=_0x3db221[0x0];}_0x31bdb6[_0x31eee4(0x17f)]&&(console[_0x31eee4(0x193)](_0x31eee4(0x18a)+_0x587afc),console[_0x31eee4(0x193)](_0x31eee4(0x19e)+_0x33e6aa),console[_0x31eee4(0x193)](_0x31eee4(0x1b0)+_0x2fe155[_0x31eee4(0x1a9)](0x0,0x64)+(_0x2fe155[_0x31eee4(0x15f)]>0x64?_0x31eee4(0x16f):'')));const _0x3ee7cd=await withSpinner(_0x31eee4(0x190),()=>_0x4f3e38[_0x31eee4(0x17d)][_0x31eee4(0x176)](_0x33e6aa,_0x2fe155,_0x587afc,_0x3525f0),{'verbose':_0x31bdb6['verbose']}),_0x59f1fd=_0x3ee7cd[_0x31eee4(0x1a0)];return console['error']('✔\x20Job\x20submitted'),console['error'](_0x31eee4(0x164)+_0x59f1fd['job_id']),await handleSDKOutput([_0x59f1fd],_0x31bdb6),0x0;}}function a25_0x5286(_0x214932,_0x5b969f){_0x214932=_0x214932-0x15f;const _0x3cde17=a25_0x3cde();let _0x528622=_0x3cde17[_0x214932];return _0x528622;}export class JobResultCommand extends BaseCommand{[a25_0x216208(0x1ac)]=a25_0x216208(0x173);[a25_0x216208(0x18f)]='Get\x20job\x20results';[a25_0x216208(0x19b)](_0x58cb4e){const _0x11c030=a25_0x216208,_0x357c87=_0x58cb4e['args'][0x0];if(!_0x357c87)return _0x11c030(0x163);return undefined;}async[a25_0x216208(0x16b)](_0x344778){const _0x488fde=a25_0x216208,{options:_0x3abb6f,args:_0xe88ebc,tdx:_0x4b721e}=_0x344778,_0x3f50e2=_0xe88ebc[0x0],_0x515e31=await withSpinner(_0x488fde(0x1a2),()=>_0x4b721e[_0x488fde(0x17d)][_0x488fde(0x198)](_0x3f50e2),{'verbose':_0x3abb6f[_0x488fde(0x17f)]}),_0x279da4=_0x515e31[_0x488fde(0x1a0)];return console[_0x488fde(0x193)](_0x488fde(0x178)+_0x279da4[_0x488fde(0x15f)]+_0x488fde(0x1a1)+(_0x279da4[_0x488fde(0x15f)]!==0x1?'s':'')),await handleSDKOutput(_0x279da4,_0x3abb6f),0x0;}}
1
+ const a27_0x442de4=a27_0x3a3c;(function(_0x3e1507,_0x428d72){const _0x398712=a27_0x3a3c,_0x336d94=_0x3e1507();while(!![]){try{const _0x28fd29=-parseInt(_0x398712(0xdc))/0x1+-parseInt(_0x398712(0xd9))/0x2+-parseInt(_0x398712(0xb8))/0x3+-parseInt(_0x398712(0xb1))/0x4+parseInt(_0x398712(0xaa))/0x5*(-parseInt(_0x398712(0xe0))/0x6)+parseInt(_0x398712(0xc6))/0x7+parseInt(_0x398712(0xa4))/0x8;if(_0x28fd29===_0x428d72)break;else _0x336d94['push'](_0x336d94['shift']());}catch(_0x4fa5ad){_0x336d94['push'](_0x336d94['shift']());}}}(a27_0x582c,0x77ff5));function a27_0x3a3c(_0x3eb5ab,_0x46e773){_0x3eb5ab=_0x3eb5ab-0x92;const _0x582cb3=a27_0x582c();let _0x3a3c96=_0x582cb3[_0x3eb5ab];return _0x3a3c96;}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';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x28b99f from'chalk';function formatDuration(_0x471b7){const _0x2b987f=a27_0x3a3c;if(_0x471b7<0x3c)return _0x471b7+'s';if(_0x471b7<0xe10)return Math['floor'](_0x471b7/0x3c)+'m\x20'+_0x471b7%0x3c+'s';const _0x42daf5=Math[_0x2b987f(0xa6)](_0x471b7/0xe10),_0x17be6e=Math[_0x2b987f(0xa6)](_0x471b7%0xe10/0x3c);return _0x17be6e>0x0?_0x42daf5+'h\x20'+_0x17be6e+'m':_0x42daf5+'h';}function formatRelativeTime(_0x4a1f6c){const _0x3a88ed=a27_0x3a3c,_0x6afe12=Date[_0x3a88ed(0xe1)]()-_0x4a1f6c['getTime'](),_0x398014=Math[_0x3a88ed(0xa6)](Math['abs'](_0x6afe12)/0x3e8);if(_0x398014<0x3c)return _0x3a88ed(0xae);const _0x4d7751=Math[_0x3a88ed(0xa6)](_0x398014/0x3c);if(_0x4d7751<0x3c)return _0x4d7751+_0x3a88ed(0xe4);const _0x8af203=Math[_0x3a88ed(0xa6)](_0x4d7751/0x3c);if(_0x8af203<0x18)return _0x8af203+'h\x20ago';const _0x527766=Math[_0x3a88ed(0xa6)](_0x8af203/0x18);if(_0x527766<0x1e)return _0x527766+'d\x20ago';return Math['floor'](_0x527766/0x1e)+_0x3a88ed(0xd3);}export class JobListCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xba);[a27_0x442de4(0xe7)]=a27_0x442de4(0xda);async[a27_0x442de4(0xcf)](_0xfbba7d){const _0xe32e18=a27_0x442de4,{options:_0x4f51c6,tdx:_0x5145b6}=_0xfbba7d,_0x40db22=resolveLimit(_0x4f51c6[_0xe32e18(0xc4)],DEFAULT_DISPLAY_LIMIT),_0x2a20ae=_0x4f51c6[_0xe32e18(0xd4)];_0x4f51c6[_0xe32e18(0xb7)]&&(console[_0xe32e18(0xbc)](_0xe32e18(0xa8)+_0x40db22+'\x20jobs'),_0x2a20ae&&console[_0xe32e18(0xbc)](_0xe32e18(0xa2)+_0x2a20ae));const _0x241006=await withSpinner(_0xe32e18(0xd2),()=>_0x5145b6[_0xe32e18(0xba)][_0xe32e18(0x9b)]({'from':0x0,'to':_0x40db22-0x1,'status':_0x2a20ae}),{'verbose':_0x4f51c6['verbose']}),_0x5d7b0a=_0x241006[_0xe32e18(0x9c)];console[_0xe32e18(0xbc)](_0xe32e18(0xe3)+_0x5d7b0a['length']+_0xe32e18(0xab)+(_0x5d7b0a[_0xe32e18(0x95)]!==0x1?'s':''));const _0x27e356=_0x4f51c6[_0xe32e18(0x9d)];if(isStructuredFormat(_0x4f51c6)){const _0x57a2be=_0x5d7b0a['map'](_0x1e5f66=>{const _0x49835a=_0xe32e18;let _0x3e9873;if(_0x1e5f66[_0x49835a(0x9e)]&&_0x1e5f66[_0x49835a(0xc2)]){const _0x30aa9a=new Date(_0x1e5f66[_0x49835a(0x9e)])[_0x49835a(0xb2)](),_0x1307ee=new Date(_0x1e5f66[_0x49835a(0xc2)])[_0x49835a(0xb2)]();_0x3e9873=Math[_0x49835a(0xac)]((_0x1307ee-_0x30aa9a)/0x3e8);}return{'job_id':_0x1e5f66[_0x49835a(0xad)],'type':_0x1e5f66[_0x49835a(0xd6)]===_0x49835a(0x99)?_0x49835a(0xaf):_0x1e5f66[_0x49835a(0xd6)],'status':_0x1e5f66[_0x49835a(0xd4)],'user_name':_0x1e5f66[_0x49835a(0xde)],'duration_sec':_0x3e9873,'created_at':_0x1e5f66[_0x49835a(0xbf)],'started_at':_0x1e5f66[_0x49835a(0x9e)],'end_at':_0x1e5f66[_0x49835a(0xc2)]};});await handleSDKOutput(_0x57a2be,_0x4f51c6);}else for(const _0x375217 of _0x5d7b0a){const _0x5ddf3f=_0x375217[_0xe32e18(0xd4)]===_0xe32e18(0xc8)?a27_0x28b99f[_0xe32e18(0xcb)]:_0x375217[_0xe32e18(0xd4)]===_0xe32e18(0xbc)?a27_0x28b99f[_0xe32e18(0x97)]:a27_0x28b99f[_0xe32e18(0xa7)],_0x137c2e=_0x5ddf3f(_0x375217['status']),_0x24dd12=getJobUrl(_0x27e356,_0x375217[_0xe32e18(0xad)]),_0xe1ddb5=hyperlink(_0x375217[_0xe32e18(0xad)],_0x24dd12),_0x569806=a27_0x28b99f['dim'](_0x375217['type']===_0xe32e18(0x99)?_0xe32e18(0xaf):_0x375217['type']),_0x2f12e6=[];if(_0x375217[_0xe32e18(0x9e)]&&_0x375217[_0xe32e18(0xc2)]){const _0x3ee344=Math[_0xe32e18(0xac)]((new Date(_0x375217[_0xe32e18(0xc2)])[_0xe32e18(0xb2)]()-new Date(_0x375217['start_at'])[_0xe32e18(0xb2)]())/0x3e8);_0x2f12e6['push'](formatDuration(_0x3ee344));}if(_0x375217['end_at'])_0x2f12e6[_0xe32e18(0xcd)](formatRelativeTime(new Date(_0x375217[_0xe32e18(0xc2)])));else _0x375217[_0xe32e18(0x9e)]&&_0x2f12e6['push'](formatRelativeTime(new Date(_0x375217[_0xe32e18(0x9e)])));const _0x28a9df=_0x2f12e6[_0xe32e18(0x95)]>0x0?a27_0x28b99f['dim']('\x20'+_0x2f12e6[_0xe32e18(0xbd)](',\x20')):'';console['log']('⚡\x20'+_0xe1ddb5+'\x20'+_0x569806+'\x20'+_0x137c2e+_0x28a9df);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x442de4(0xd1)]='job:show';[a27_0x442de4(0xe7)]=a27_0x442de4(0xe5);['validate'](_0x3f854c){const _0x4630a5=a27_0x442de4,_0x42a961=_0x3f854c[_0x4630a5(0xd7)][0x0];if(!_0x42a961)return _0x4630a5(0xdb);return undefined;}async['execute'](_0x426d90){const _0x5e4815=a27_0x442de4,{options:_0x5595ba,args:_0x26a0e2,tdx:_0x5a7928}=_0x426d90,_0xb728bc=_0x26a0e2[0x0],_0x69b054=await withSpinner(_0x5e4815(0xd0),()=>_0x5a7928[_0x5e4815(0xba)][_0x5e4815(0xdf)](_0xb728bc),{'verbose':_0x5595ba['verbose']}),_0x3cf9cb=_0x69b054[_0x5e4815(0x9c)];let _0x5ac279;if(_0x3cf9cb[_0x5e4815(0x9e)]&&_0x3cf9cb[_0x5e4815(0xc2)]){const _0x511426=new Date(_0x3cf9cb['start_at'])[_0x5e4815(0xb2)](),_0x2198e1=new Date(_0x3cf9cb['end_at'])[_0x5e4815(0xb2)]();_0x5ac279=Math[_0x5e4815(0xac)]((_0x2198e1-_0x511426)/0x3e8);}const _0x2ca293={'job_id':_0x3cf9cb[_0x5e4815(0xad)],'type':_0x3cf9cb[_0x5e4815(0xd6)],'status':_0x3cf9cb[_0x5e4815(0xd4)],..._0x3cf9cb[_0x5e4815(0xde)]&&{'user_name':_0x3cf9cb[_0x5e4815(0xde)]},..._0x5ac279!==undefined&&{'duration_sec':_0x5ac279},..._0x3cf9cb[_0x5e4815(0xbf)]&&{'created_at':_0x3cf9cb[_0x5e4815(0xbf)]},..._0x3cf9cb[_0x5e4815(0x9e)]&&{'started_at':_0x3cf9cb[_0x5e4815(0x9e)]},..._0x3cf9cb[_0x5e4815(0xc2)]&&{'end_at':_0x3cf9cb[_0x5e4815(0xc2)]},..._0x3cf9cb['database']&&{'database':_0x3cf9cb[_0x5e4815(0xb5)]},..._0x3cf9cb[_0x5e4815(0xa0)]!==undefined&&{'priority':_0x3cf9cb[_0x5e4815(0xa0)]},..._0x3cf9cb[_0x5e4815(0xc7)]&&{'url':_0x3cf9cb['url']},..._0x3cf9cb[_0x5e4815(0xce)]&&{'query':_0x3cf9cb['query']},..._0x3cf9cb[_0x5e4815(0x94)]&&{'debug':_0x3cf9cb[_0x5e4815(0x94)]}};return await handleSingleObjectOutput(_0x2ca293,_0x5595ba),0x0;}}function a27_0x582c(){const _0x2a2eda=['2508116Befely','getTime','information_schema','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','database','Submit\x20a\x20job','verbose','1051443sbgTkw','hive','jobs','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','error','join','...','created_at','job:submit','\x27\x20to\x20verify\x20the\x20job\x20status','end_at','validate','limit','Job\x20type:\x20','2390829pduXFt','url','success','Query:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','green','Cancelled','push','query','execute','Getting\x20job\x20details...','name','Listing\x20jobs...','mo\x20ago','status','\x20\x20Job\x20ID:\x20','type','args','✔\x20Retrieved\x20','1954548YKSsec','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','630627RCoRtL','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','user_name','show','6ZENkRH','now','Get\x20job\x20results','✔\x20Found\x20','m\x20ago','Show\x20job\x20details','job:result','description','jobType','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','file','debug','length','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','red','Kill\x20a\x20job','presto','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','list','data','site','start_at','Submitting\x20job...','priority','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Status\x20filter:\x20','INVALID_ARGUMENT','28193728iAbyvA','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','floor','dim','Limit:\x20','substring','3944215VaJLTS','\x20job','round','job_id','just\x20now','trino','result'];a27_0x582c=function(){return _0x2a2eda;};return a27_0x582c();}export class JobKillCommand extends BaseCommand{['name']='job:kill';['description']=a27_0x442de4(0x98);['validate'](_0x4c56cb){const _0x39811e=a27_0x442de4,_0x5dc34b=_0x4c56cb[_0x39811e(0xd7)][0x0];if(!_0x5dc34b)return _0x39811e(0x96);return undefined;}async[a27_0x442de4(0xcf)](_0x14bb32){const _0x447642=a27_0x442de4,{options:_0x1c1712,args:_0xed0273,tdx:_0x1b9e66}=_0x14bb32,_0x36099e=_0xed0273[0x0];if(!_0x1c1712['yes']){const _0x36b397=await confirm(_0x447642(0xb4)+_0x36099e+'?');if(!_0x36b397)return console[_0x447642(0xbc)](_0x447642(0xcc)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x1b9e66[_0x447642(0xba)]['kill'](_0x36099e),{'verbose':_0x1c1712[_0x447642(0xb7)]}),console[_0x447642(0xbc)](_0x447642(0x92)+_0x36099e),console[_0x447642(0xbc)](_0x447642(0xca)+_0x36099e+_0x447642(0xc1)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xc0);['description']=a27_0x442de4(0xb6);async[a27_0x442de4(0xcf)](_0x138a2c){const _0x9a24b4=a27_0x442de4,{options:_0x47f27a,args:_0x324092,tdx:_0xaeb696}=_0x138a2c,_0x58b160=_0x47f27a[_0x9a24b4(0xe8)]||_0x9a24b4(0xaf),_0x590aaa=_0x47f27a[_0x9a24b4(0x93)],_0x26191f=_0x47f27a['database']||_0x9a24b4(0xb3),_0x5230dc=_0x47f27a['result'];if(_0x58b160!==_0x9a24b4(0xaf)&&_0x58b160!==_0x9a24b4(0xb9))throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xa1));let _0x3d2474;if(_0x590aaa){if(_0x324092[0x0])throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xbb));const _0x310d6d=readSqlStatementsFromFile(_0x590aaa);if(_0x310d6d[_0x9a24b4(0x95)]===0x0)throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x310d6d[_0x9a24b4(0x95)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x9a24b4(0x9a));_0x3d2474=_0x310d6d[0x0];}else{if(!_0x324092[0x0])throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xa5));_0x3d2474=_0x324092[0x0];}_0x47f27a['verbose']&&(console[_0x9a24b4(0xbc)](_0x9a24b4(0xc5)+_0x58b160),console[_0x9a24b4(0xbc)]('Database:\x20'+_0x26191f),console[_0x9a24b4(0xbc)](_0x9a24b4(0xc9)+_0x3d2474[_0x9a24b4(0xa9)](0x0,0x64)+(_0x3d2474['length']>0x64?_0x9a24b4(0xbe):'')));const _0x2bf56f=await withSpinner(_0x9a24b4(0x9f),()=>_0xaeb696[_0x9a24b4(0xba)]['submit'](_0x26191f,_0x3d2474,_0x58b160,_0x5230dc),{'verbose':_0x47f27a['verbose']}),_0x59086f=_0x2bf56f[_0x9a24b4(0x9c)];return console[_0x9a24b4(0xbc)]('✔\x20Job\x20submitted'),console[_0x9a24b4(0xbc)](_0x9a24b4(0xd5)+_0x59086f['job_id']),await handleSDKOutput([_0x59086f],_0x47f27a),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xe6);[a27_0x442de4(0xe7)]=a27_0x442de4(0xe2);[a27_0x442de4(0xc3)](_0x31e154){const _0x5b7f49=a27_0x442de4,_0x7a33f5=_0x31e154[_0x5b7f49(0xd7)][0x0];if(!_0x7a33f5)return _0x5b7f49(0xdd);return undefined;}async[a27_0x442de4(0xcf)](_0x5bfa92){const _0xddf19b=a27_0x442de4,{options:_0x503bf2,args:_0x54cea7,tdx:_0x2c1078}=_0x5bfa92,_0x3cf430=_0x54cea7[0x0],_0x2a6d37=await withSpinner('Getting\x20job\x20results...',()=>_0x2c1078['jobs'][_0xddf19b(0xb0)](_0x3cf430),{'verbose':_0x503bf2[_0xddf19b(0xb7)]}),_0xa0abfe=_0x2a6d37['data'];return console[_0xddf19b(0xbc)](_0xddf19b(0xd8)+_0xa0abfe[_0xddf19b(0x95)]+'\x20row'+(_0xa0abfe[_0xddf19b(0x95)]!==0x1?'s':'')),await handleSDKOutput(_0xa0abfe,_0x503bf2),0x0;}}
@@ -1 +1 @@
1
- const a26_0x1f2943=a26_0x3384;(function(_0x490af1,_0x36545f){const _0x5c1d36=a26_0x3384,_0x2b97bc=_0x490af1();while(!![]){try{const _0x4c5f26=-parseInt(_0x5c1d36(0xb4))/0x1*(-parseInt(_0x5c1d36(0x169))/0x2)+-parseInt(_0x5c1d36(0x178))/0x3+parseInt(_0x5c1d36(0xac))/0x4+-parseInt(_0x5c1d36(0x16d))/0x5+parseInt(_0x5c1d36(0xce))/0x6+-parseInt(_0x5c1d36(0x10f))/0x7*(parseInt(_0x5c1d36(0x93))/0x8)+-parseInt(_0x5c1d36(0xf1))/0x9;if(_0x4c5f26===_0x36545f)break;else _0x2b97bc['push'](_0x2b97bc['shift']());}catch(_0x29187a){_0x2b97bc['push'](_0x2b97bc['shift']());}}}(a26_0x36a7,0xb16cd));import a26_0x54538f from'chalk';function a26_0x36a7(){const _0x425f09=['Target\x20directory:\x20','links','\x22\x20resumed','targetDir','Table:\x20','\x0aChanges\x20to\x20\x27','Error:\x20Invalid\x20--type\x20\x22','activation','7GhKGJY','List\x20journeys\x20in\x20current\x20context','helpText','includeHistory','✔\x20Context\x20set:\x20','completed','bold','tdx.json','Listing\x20journey\x20versions...','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x20new\x20files','dim','\x20version','listFolders','createdAt','✔\x20Pulled\x20','map','Resuming\x20journey...','stringify','journey:pull','List\x20activations\x20for\x20a\x20journey','journey:resume','exitOrJumpRate','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','activation_','/app/ps/','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','List\x20all\x20versions\x20of\x20a\x20journey','versionNumber','database','relative','Error:\x20Stage\x20\x22','execute','connector_config','\x20\x20Journey\x20ID:\x20','\x20Created\x20v','Getting\x20column\x20mapping...','listJourneysWithFolders','getActivation','Database:\x20','green','/j/da','Getting\x20journey\x20statistics...','session','✔\x20Journey\x20\x22','listVersions','Warning:\x20Could\x20not\x20resolve\x20segment\x20','relativePath','error','version','filter','exitOrJumpSize','INVALID_ARGUMENT','base','getLatestJourneyId','sort','length','state','reentryMode','values','jsonl','replace','dryRun','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20(draft)\x20—\x20\x22','renderStats','pause','conversion','message','/j/da/je','Resolving\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','errorCode','description','kind','join','format','Fetching\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','(paused)','journeyId','filePath','buildIdToEmailMap','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','paused','Listing\x20journey\x20activations...','\x20\x20Consolidating\x20duplicate\x20segment:\x20','✔\x20Found\x20','\x20journey','690346ahbNtD','journeyBundleId','site','goalSize','5371825dIFoHm','blue','Pattern:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','no_parent','updatedAt','Show\x20journey\x20details','folderId','completionRate','Pause\x20a\x20running\x20journey','attributes','1525770GftyuU','folders','No\x20journeys\x20found','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','📁\x20','segments','utf-8','.yml','\x20\x20Parent\x20segment:\x20','diff','split','all','goal','folderPath','(root)','resolveParentId','args','setPhase','launched','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)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20journeys','json','parentSegment','audienceId','\x20journey\x20files\x20to\x20','rule','draft','hasChanges','Write\x20','\x20(ID:\x20','user','milestoneSize','Cancelled','history','repeat','journeyStages','\x20\x20Name:\x20','set','4557488LsEjQc','journey','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Getting\x20journey\x20details...','\x20\x20Preserving\x20local\x20segment\x20name:\x20','getParentFull','listJourneysFromParentSegment','localeCompare','journey:activations','Journey\x20name:\x20','table','push','\x20not\x20found.\x20Available:\x20','/e/','\x0aPull\x20summary:','No\x20statistics\x20available\x20for\x20journey:\x20','options',',\x20version:\x20','has','getStatistics','\x20\x20Statistics\x20not\x20available','\x20\x20Target:\x20','Fetching\x20journeys\x20and\x20folders...','Resolving\x20parent\x20segment...','Error:\x20Journey\x20\x27','5395340rbkFDM','Options:','cwd','Listing\x20journeys...','Folder\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','test','yes','2IlGcPR','verbose','journey:push','cyan','size','file','journeys','getJourney','type','completeMilestoneRate','get','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','enteredSize','\x20\x20-\x20','\x20=\x20','log','(completed)','then','parent_segment','Parent\x20segment:\x20','from','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','includeStats','journey:stats','journey:versions','yellow','7060818CmiKkf','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Input:\x20','resolveSegment','activationParams','entries','(archived)','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20Opening\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Found\x20','stages','Show\x20journey\x20statistics','getSegment','resolveJourneyId','getColumnMapping','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','journey:columns','Getting\x20version\x20','connection','journey:version:view','isNew','find','journeyBundleName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journey:view','Fetching\x20users\x20and\x20connections...','listActivationsFlat','Pausing\x20journey...','content','🗺️\x20','segment','\x20changed\x20files','web','3029490tLOgOw','journey:pause','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','-\x20no\x20files\x20written','createVersion','name','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','toLowerCase','hasPeriod','stageNameMap','data','\x20files?','Error:\x20--version\x20option\x20is\x20required','segmentName','Getting\x20journey\x20traffic\x20data...','\x20->\x20','\x22\x20paused','Error:\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x20\x20Folder\x20path:\x20','add','(draft)'];a26_0x36a7=function(){return _0x425f09;};return a26_0x36a7();}import a26_0x4622ae 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';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(_0x58dd8b){const _0x28d469=a26_0x3384;return!_0x58dd8b&&(console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x28d469(0x13f)](_0x28d469(0x126))),!!_0x58dd8b;}function withJsonFormat(_0x364ac8){const _0x3e81b6=a26_0x3384;if(!_0x364ac8['format']&&!_0x364ac8[_0x3e81b6(0x82)]&&!_0x364ac8[_0x3e81b6(0x14b)]&&!_0x364ac8['tsv'])return{..._0x364ac8,'format':_0x3e81b6(0x82),'json':!![]};return _0x364ac8;}function formatJourneyState(_0x428333){const _0x436f30=a26_0x3384;switch(_0x428333){case _0x436f30(0x7e):return a26_0x54538f['green']('(running)');case _0x436f30(0x87):return a26_0x54538f['dim'](_0x436f30(0x106));case _0x436f30(0x164):return a26_0x54538f[_0x436f30(0xcd)](_0x436f30(0x15e));case _0x436f30(0x114):return a26_0x54538f[_0x436f30(0x16e)](_0x436f30(0xc4));case'archived':return a26_0x54538f['dim'](_0x436f30(0xd4));default:return'('+_0x428333+')';}}function formatJourneyItem(_0x302838,_0x137d5f='',_0x3eeabf){const _0x1f3d4e=a26_0x3384,_0x1b858e=formatJourneyState(_0x302838[_0x1f3d4e(0x148)]),_0x59d457=_0x3eeabf?hyperlink(_0x302838['journeyBundleName'],_0x3eeabf):_0x302838['journeyBundleName'];return _0x137d5f+_0x1f3d4e(0xed)+_0x59d457+'\x20'+_0x1b858e;}function escapeRegex(_0x382f60){const _0x3bbf44=a26_0x3384;return _0x382f60[_0x3bbf44(0x14c)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x27f732){const _0xe42a4f=a26_0x3384,_0x5d4cd6=_0x27f732[_0xe42a4f(0x182)]('*')[_0xe42a4f(0x11f)](escapeRegex);return new RegExp(_0x5d4cd6['join']('.*'),'i');}function buildRuleToNameMapping(_0x1cdee6){const _0x29ddc7=a26_0x3384,_0x105560=new Map();if(_0x1cdee6['segments'])for(const [_0xe96b88,_0x5d0b62]of Object[_0x29ddc7(0xd3)](_0x1cdee6[_0x29ddc7(0x17d)])){if(_0x5d0b62['rule']){const _0x8bb198=serializeRule(_0x5d0b62[_0x29ddc7(0x86)]),_0x4b5e6b=_0x105560[_0x29ddc7(0xbe)](_0x8bb198);_0x4b5e6b?_0x4b5e6b[_0x29ddc7(0x9e)](_0xe96b88):_0x105560[_0x29ddc7(0x92)](_0x8bb198,[_0xe96b88]);}}return _0x105560;}async function resolveJourneyIdFromInput(_0x5ad562,_0x37b563,_0x232015){const _0x32c0a2=a26_0x3384,_0x62a615=await resolveJourneyTarget(_0x5ad562,_0x37b563[_0x32c0a2(0x83)],_0x37b563[_0x32c0a2(0xb5)]),_0x963a0e=_0x62a615[_0x32c0a2(0x83)];if(!_0x963a0e)throw new SDKError(ErrorCode[_0x32c0a2(0x143)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x5dc434=await withSpinner(_0x32c0a2(0xaa),()=>_0x232015['segment'][_0x32c0a2(0x7b)](_0x963a0e),{'verbose':_0x37b563[_0x32c0a2(0xb5)]}),_0x4a600b=_0x5dc434[_0x32c0a2(0xfb)],_0x3ad48b=await withSpinner(_0x32c0a2(0x155),()=>_0x232015[_0x32c0a2(0x94)][_0x32c0a2(0xdc)](_0x4a600b,_0x62a615['journeyName']),{'verbose':_0x37b563['verbose']});return{'journeyId':_0x3ad48b[_0x32c0a2(0xfb)],'journeyName':_0x62a615['journeyName'],'parentSegmentId':_0x4a600b};}async function resolveJourneyTarget(_0x240206,_0x4b6c0f,_0xc2405){const _0x3b814c=a26_0x3384;if(isYamlFilePath(_0x240206))try{const _0x3498bc=await resolveYamlFilePath(_0x240206);return _0xc2405&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x240206),console[_0x3b814c(0x13f)](_0x3b814c(0x180)+_0x3498bc['parentSegment']),console[_0x3b814c(0x13f)](_0x3b814c(0x91)+_0x3498bc[_0x3b814c(0xfe)]),console[_0x3b814c(0x13f)](_0x3b814c(0x104)+(_0x3498bc[_0x3b814c(0x79)]||_0x3b814c(0x7a)))),{'journeyName':_0x3498bc[_0x3b814c(0xfe)],'parentSegment':_0x3498bc[_0x3b814c(0x83)],'resolved':_0x3498bc};}catch(_0x496baf){throw new SDKError(ErrorCode[_0x3b814c(0x143)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x496baf[_0x3b814c(0x153)]);}if(!_0x4b6c0f)throw new SDKError(ErrorCode[_0x3b814c(0x143)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x240206,'parentSegment':_0x4b6c0f};}export class JourneyListCommand extends BaseCommand{[a26_0x1f2943(0xf6)]='journey:list';[a26_0x1f2943(0x158)]=a26_0x1f2943(0x110);async[a26_0x1f2943(0x12f)](_0x938723){const _0x4cfe59=a26_0x1f2943,{options:_0x41ba82,args:_0xb77569,tdx:_0x4c5a13}=_0x938723,_0x36ac8=_0xb77569[0x0],_0x13b9f6=_0x41ba82[_0x4cfe59(0x83)];if(!_0x13b9f6)return console[_0x4cfe59(0x13f)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x4cfe59(0x13f)](_0x4cfe59(0x129)),0x1;const _0xb3f1b7=await withSpinner(_0x4cfe59(0xaa),()=>_0x4c5a13[_0x4cfe59(0xee)]['resolveParentId'](_0x13b9f6),{'verbose':_0x41ba82[_0x4cfe59(0xb5)]}),_0x5857f5=_0xb3f1b7[_0x4cfe59(0xfb)];_0x41ba82[_0x4cfe59(0xb5)]&&(console[_0x4cfe59(0x13f)]('Parent\x20segment:\x20'+_0x13b9f6+_0x4cfe59(0x8a)+_0x5857f5+')'),_0x36ac8&&console[_0x4cfe59(0x13f)](_0x4cfe59(0x16f)+_0x36ac8));const _0x5ebfef=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x4c5a13['segment'][_0x4cfe59(0x98)](_0x5857f5),{'verbose':_0x41ba82[_0x4cfe59(0xb5)]}),_0x1585dd=_0x5ebfef[_0x4cfe59(0xfb)],_0x436b92=_0x1585dd['rootFolderId'],_0x4ce539=await withSpinner(_0x4cfe59(0xaf),()=>_0x4c5a13[_0x4cfe59(0x94)][_0x4cfe59(0x134)](_0x5857f5,_0x436b92),{'verbose':_0x41ba82[_0x4cfe59(0xb5)]});let _0x573b6b=_0x4ce539[_0x4cfe59(0xfb)][_0x4cfe59(0xba)];const _0x55fd71=_0x4ce539['data'][_0x4cfe59(0x179)],_0x5a72ff=new Map();for(const _0x4a9ad6 of _0x55fd71){_0x5a72ff[_0x4cfe59(0x92)](_0x4a9ad6['id'],_0x4a9ad6[_0x4cfe59(0xf6)]);}if(_0x36ac8){const _0x1341d5=globToRegex(_0x36ac8);_0x573b6b=_0x573b6b[_0x4cfe59(0x141)](_0x3c4069=>_0x1341d5[_0x4cfe59(0xb2)](_0x3c4069[_0x4cfe59(0xe6)]));}console['error'](_0x4cfe59(0x167)+_0x573b6b[_0x4cfe59(0x147)]+_0x4cfe59(0x168)+(_0x573b6b[_0x4cfe59(0x147)]!==0x1?'s':''));const _0x17b9a6=_0x27a837=>{const _0x3d27b5=_0x4cfe59;return getConsoleNextUrl(_0x41ba82['site'],_0x3d27b5(0x128)+_0x5857f5+_0x3d27b5(0xa0)+_0x27a837+_0x3d27b5(0x138));};if(_0x41ba82[_0x4cfe59(0x15b)]===_0x4cfe59(0x9d))await handleSDKOutput(_0x573b6b,_0x41ba82);else{if(_0x41ba82[_0x4cfe59(0x15b)]===_0x4cfe59(0x82)){const _0xfe3ad1=_0x573b6b[_0x4cfe59(0x11f)](_0x2e5bbd=>({..._0x2e5bbd,'url':_0x17b9a6(_0x2e5bbd['id'])}));await handleSDKOutput(_0xfe3ad1,_0x41ba82);}else{console[_0x4cfe59(0xc3)]('['+_0x13b9f6+']');const _0x338851=new Map(),_0x1f2b6a=[];for(const _0x485f12 of _0x573b6b){if(!_0x485f12[_0x4cfe59(0x174)]||_0x485f12[_0x4cfe59(0x174)]===_0x436b92)_0x1f2b6a[_0x4cfe59(0x9e)](_0x485f12);else{const _0x358d38=_0x338851['get'](_0x485f12[_0x4cfe59(0x174)])||[];_0x358d38[_0x4cfe59(0x9e)](_0x485f12),_0x338851[_0x4cfe59(0x92)](_0x485f12[_0x4cfe59(0x174)],_0x358d38);}}const _0x41ef1e=(_0x19cc19,_0x20d7a4)=>_0x19cc19['journeyBundleName'][_0x4cfe59(0x9a)](_0x20d7a4[_0x4cfe59(0xe6)],undefined,{'sensitivity':_0x4cfe59(0x144)});_0x1f2b6a['sort'](_0x41ef1e);for(const _0x436c3e of _0x1f2b6a){console[_0x4cfe59(0xc3)](formatJourneyItem(_0x436c3e,'',_0x17b9a6(_0x436c3e['id'])));}const _0x2c040e=[..._0x338851['entries']()][_0x4cfe59(0x146)]((_0x29bd26,_0x108d57)=>{const _0x108177=_0x4cfe59,_0x3f0028=_0x5a72ff[_0x108177(0xbe)](_0x29bd26[0x0])||_0x29bd26[0x0],_0x293409=_0x5a72ff[_0x108177(0xbe)](_0x108d57[0x0])||_0x108d57[0x0];return _0x3f0028[_0x108177(0x9a)](_0x293409,undefined,{'sensitivity':'base'});});for(const [_0x37a20f,_0x419f9d]of _0x2c040e){const _0x5f8c0e=_0x5a72ff[_0x4cfe59(0xbe)](_0x37a20f)||_0x37a20f;console['log'](_0x4cfe59(0x17c)+_0x5f8c0e),_0x419f9d[_0x4cfe59(0x146)](_0x41ef1e);for(const _0x14371b of _0x419f9d){console[_0x4cfe59(0xc3)](formatJourneyItem(_0x14371b,'\x20\x20',_0x17b9a6(_0x14371b['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a26_0x1f2943(0xe8);[a26_0x1f2943(0x158)]=a26_0x1f2943(0x173);async[a26_0x1f2943(0x12f)](_0x56fe4c){const _0x306e00=a26_0x1f2943,{options:_0x6a1b7,args:_0x30dd53,tdx:_0x474580}=_0x56fe4c,_0x2195e0=_0x30dd53[0x0];if(!_0x2195e0)return console[_0x306e00(0x13f)](_0x306e00(0xdf)),console[_0x306e00(0x13f)](_0x306e00(0x103)),console[_0x306e00(0x13f)](_0x306e00(0xad)),console[_0x306e00(0x13f)](_0x306e00(0x17b)),0x1;_0x6a1b7[_0x306e00(0xb5)]&&console[_0x306e00(0x13f)]('Input:\x20'+_0x2195e0);const {journeyId:_0x23cd91,parentSegmentId:_0x5a6c58}=await resolveJourneyIdFromInput(_0x2195e0,_0x6a1b7,_0x474580);if(_0x6a1b7[_0x306e00(0xf0)]){const _0x5ecc32=getConsoleNextUrl(_0x6a1b7[_0x306e00(0x16b)],_0x306e00(0x128)+_0x5a6c58+_0x306e00(0xa0)+_0x23cd91+_0x306e00(0x154));return console[_0x306e00(0x13f)](a26_0x54538f[_0x306e00(0x137)]('✔')+_0x306e00(0xd6)+a26_0x54538f['cyan'](_0x5ecc32)),openBrowser(_0x5ecc32),0x0;}const _0x497e04=await withSpinner(_0x306e00(0x96),()=>_0x474580['journey'][_0x306e00(0xbb)](_0x23cd91),{'verbose':_0x6a1b7[_0x306e00(0xb5)]}),_0x54a6f0=_0x497e04[_0x306e00(0xfb)],_0x48add6=_0x6a1b7[_0x306e00(0xca)];let _0x1b7d02;if(_0x48add6)try{const _0x29691c=await withSpinner(_0x306e00(0x139),()=>_0x474580[_0x306e00(0x94)]['getStatistics'](_0x23cd91),{'verbose':_0x6a1b7['verbose']});_0x1b7d02=_0x29691c['data'];}catch{_0x6a1b7[_0x306e00(0xb5)]&&console[_0x306e00(0x13f)](_0x306e00(0xa7));}const _0x49f681=getConsoleNextUrl(_0x6a1b7[_0x306e00(0x16b)],_0x306e00(0x128)+_0x5a6c58+_0x306e00(0xa0)+_0x23cd91+_0x306e00(0x154)),_0x1a0079={'id':_0x54a6f0['id'],'name':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0xf6)],'description':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0x158)],'state':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0x148)],'paused':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0x164)],'reentry_mode':_0x54a6f0['attributes'][_0x306e00(0x149)],'stages':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0x90)]?.[_0x306e00(0x147)]||0x0,..._0x54a6f0[_0x306e00(0x177)][_0x306e00(0x78)]&&{'goal':_0x54a6f0['attributes'][_0x306e00(0x78)]['name']},..._0x1b7d02&&{'statistics':{'size':_0x1b7d02[_0x306e00(0xb8)],'entered':_0x1b7d02[_0x306e00(0xc0)],'goal_achieved':_0x1b7d02[_0x306e00(0x16c)],'completion_rate':_0x1b7d02[_0x306e00(0x175)],'exit_or_jump':_0x1b7d02[_0x306e00(0x142)],'exit_or_jump_rate':_0x1b7d02[_0x306e00(0x125)],'stages':_0x1b7d02[_0x306e00(0xd9)]}},'url':_0x49f681};return await handleSingleObjectOutput(_0x1a0079,_0x6a1b7),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xcb);[a26_0x1f2943(0x158)]=a26_0x1f2943(0xda);async[a26_0x1f2943(0x12f)](_0x113108){const _0xd8fb71=a26_0x1f2943,{options:_0xda035e,args:_0x569ced,tdx:_0xde8bcd}=_0x113108,_0xe068f3=_0x569ced[0x0];if(!requireNameOrPath(_0xe068f3))return 0x1;_0xda035e[_0xd8fb71(0xb5)]&&console[_0xd8fb71(0x13f)](_0xd8fb71(0xd0)+_0xe068f3);const _0x1b5896=_0xda035e,_0x23d891=_0x1b5896[_0xd8fb71(0xc8)],_0x5bfb81=_0x1b5896['to'],_0x4aeb5f=_0x1b5896[_0xd8fb71(0x112)],_0x21817e=_0x1b5896['stage'];_0x4aeb5f&&!_0x23d891&&!_0x5bfb81&&console[_0xd8fb71(0x13f)](_0xd8fb71(0xcf));const _0x302ed1=_0x4aeb5f?withJsonFormat(_0xda035e):_0xda035e,{journeyId:_0x392356,journeyName:_0x1eba9b}=await resolveJourneyIdFromInput(_0xe068f3,_0x302ed1,_0xde8bcd),_0xdb6932=_0x23d891||_0x5bfb81?{'from':_0x23d891,'to':_0x5bfb81}:undefined,_0x15540f=await withSpinner(_0xd8fb71(0x139),()=>Promise['all']([_0xde8bcd[_0xd8fb71(0x94)][_0xd8fb71(0xbb)](_0x392356),_0xde8bcd[_0xd8fb71(0x94)][_0xd8fb71(0xa6)](_0x392356,_0xdb6932)]),{'verbose':_0x302ed1[_0xd8fb71(0xb5)]}),[_0xc1bb74,_0x174127]=_0x15540f['data'];if(!_0x174127||_0x174127[_0xd8fb71(0x15f)]===null)return console[_0xd8fb71(0x13f)](_0xd8fb71(0xa2)+_0x1eba9b),console[_0xd8fb71(0x13f)](_0xd8fb71(0xc9)),0x0;const _0xe7314d=buildStageNameMap(_0xc1bb74),_0x258c54=!!(_0xdb6932&&_0x174127['history']?.[_0xd8fb71(0x147)]),_0x3d0357={'stageNameMap':_0xe7314d,'hasPeriod':_0x258c54,'includeHistory':!!_0x4aeb5f};if(_0x21817e&&_0x174127[_0xd8fb71(0xd9)]){const _0x13e399=_0x174127[_0xd8fb71(0xd9)]['find'](_0xd9bcf2=>{const _0x4dcf36=_0xd8fb71,_0x5ad380=_0xe7314d[_0x4dcf36(0xbe)](_0xd9bcf2['id'])??'';return _0x5ad380[_0x4dcf36(0xf8)]()===_0x21817e[_0x4dcf36(0xf8)]();});if(_0x13e399)return await handleSingleObjectOutput(formatStageStats(_0x13e399,_0x3d0357),_0x302ed1),0x0;const _0x4eee59=_0x174127[_0xd8fb71(0xd9)][_0xd8fb71(0x11f)](_0xebf1fe=>_0xe7314d[_0xd8fb71(0xbe)](_0xebf1fe['id'])??_0xebf1fe['id']);return console[_0xd8fb71(0x13f)](_0xd8fb71(0x12e)+_0x21817e+'\x22\x20not\x20found'),console['error']('Available\x20stages:\x20'+_0x4eee59[_0xd8fb71(0x15a)](',\x20')),0x1;}const _0x19a4bc=_0x174127['stages']?.['map'](_0x4153f4=>formatStageStats(_0x4153f4,_0x3d0357)),_0x218578=assembleJourneyStats(_0x174127,{'from':_0x23d891,'to':_0x5bfb81,'includeHistory':_0x4aeb5f});return await this[_0xd8fb71(0x150)](_0x218578,_0x19a4bc??[],_0x302ed1),0x0;}async[a26_0x1f2943(0x150)](_0x114115,_0x2d2402,_0x6b8cbe){const _0x1332a5=a26_0x1f2943,_0x2a20ee=_0x6b8cbe['format']==='json'||_0x6b8cbe[_0x1332a5(0x15b)]===_0x1332a5(0x14b)||_0x6b8cbe[_0x1332a5(0x82)]||_0x6b8cbe[_0x1332a5(0x14b)];if(_0x2a20ee){_0x114115[_0x1332a5(0xd9)]=_0x2d2402,await handleSingleObjectOutput(_0x114115,_0x6b8cbe);return;}await handleSingleObjectOutput(_0x114115,_0x6b8cbe);for(const _0x56ea0c of _0x2d2402){console[_0x1332a5(0xc3)](''),console[_0x1332a5(0xc3)](String(a26_0x54538f[_0x1332a5(0xb7)][_0x1332a5(0x115)]('['+_0x56ea0c[_0x1332a5(0xf6)]+']'))+a26_0x54538f[_0x1332a5(0x11a)]('\x20'+_0x56ea0c['id']));const {id:_0x389438,name:_0x84f0f5,..._0x1f93be}=_0x56ea0c;await handleSingleObjectOutput(_0x1f93be,_0x6b8cbe);}}}export class JourneyTrafficCommand extends BaseCommand{[a26_0x1f2943(0xf6)]='journey:traffic';[a26_0x1f2943(0x158)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async['execute'](_0x59a5fa){const _0x5600ea=a26_0x1f2943,{options:_0x3cfc37,args:_0x6cba6a,tdx:_0x4b33c1}=_0x59a5fa,_0x147f49=_0x6cba6a[0x0];if(!requireNameOrPath(_0x147f49))return 0x1;_0x3cfc37['verbose']&&console[_0x5600ea(0x13f)](_0x5600ea(0xd0)+_0x147f49);const _0x5cdbf5=_0x3cfc37,_0x26e660=_0x5cdbf5[_0x5600ea(0xbc)],_0x3536cc=_0x5cdbf5[_0x5600ea(0xc8)],_0x1f1791=_0x5cdbf5['to'],_0x31f1aa=_0x5cdbf5['limit'];if(_0x26e660&&_0x26e660!=='conversion'&&_0x26e660!=='activation')return console[_0x5600ea(0x13f)](_0x5600ea(0x10d)+_0x26e660+_0x5600ea(0x162)),0x1;const _0x2020d7=withJsonFormat(_0x3cfc37),{journeyId:_0x1957ed,journeyName:_0x49c515}=await resolveJourneyIdFromInput(_0x147f49,_0x2020d7,_0x4b33c1),_0x4d37d7={'type':_0x26e660,'from':_0x3536cc,'to':_0x1f1791,'limit':_0x31f1aa},_0x14635b=await withSpinner(_0x5600ea(0xff),()=>_0x4b33c1[_0x5600ea(0x94)]['getTrafficData'](_0x1957ed,_0x4d37d7),{'verbose':_0x2020d7[_0x5600ea(0xb5)]}),_0x5f547a=_0x14635b[_0x5600ea(0xfb)],_0x2ebd7b=_0x5f547a['conversion']&&(_0x5f547a['conversion']['nodes'][_0x5600ea(0x147)]>0x0||_0x5f547a[_0x5600ea(0x152)][_0x5600ea(0x108)][_0x5600ea(0x147)]>0x0),_0x512a79=_0x5f547a[_0x5600ea(0x10e)]&&_0x5f547a[_0x5600ea(0x10e)][_0x5600ea(0x147)]>0x0;if(!_0x2ebd7b&&!_0x512a79)return console[_0x5600ea(0x13f)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x49c515),console['error'](_0x5600ea(0xd5)),_0x3536cc&&_0x1f1791&&console['error'](_0x5600ea(0xf3)),0x0;return await handleSingleObjectOutput(_0x5f547a,_0x2020d7),0x0;}}function formatStageStats(_0x395ea4,_0x3aacd6){const _0x52d784=a26_0x1f2943,_0x135540=_0x3aacd6['hasPeriod']&&_0x395ea4[_0x52d784(0x8e)]?.['length']?aggregateStageHistory(_0x395ea4[_0x52d784(0x8e)]):{'size':_0x395ea4[_0x52d784(0xb8)],'entered':_0x395ea4[_0x52d784(0xc0)],'milestone':_0x395ea4[_0x52d784(0x8c)],'milestone_rate':_0x395ea4[_0x52d784(0xbd)],'exit_or_jump':_0x395ea4[_0x52d784(0x142)],'exit_or_jump_rate':_0x395ea4['exitOrJumpRate']},_0x5263c4={'id':_0x395ea4['id'],'name':_0x3aacd6[_0x52d784(0xfa)][_0x52d784(0xbe)](_0x395ea4['id'])??_0x395ea4['id'],..._0x135540};return _0x3aacd6[_0x52d784(0xf9)]&&_0x3aacd6[_0x52d784(0x112)]&&_0x395ea4['history']&&(_0x5263c4['history']=_0x395ea4[_0x52d784(0x8e)]),_0x5263c4;}function a26_0x3384(_0x30ed0b,_0x47e5dd){_0x30ed0b=_0x30ed0b-0x77;const _0x36a720=a26_0x36a7();let _0x3384a3=_0x36a720[_0x30ed0b];return _0x3384a3;}export class JourneyPauseCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xf2);['description']=a26_0x1f2943(0x176);async[a26_0x1f2943(0x12f)](_0x36d3e1){const _0x3b505a=a26_0x1f2943,{options:_0x4495f8,args:_0x2e003b,tdx:_0x5485af}=_0x36d3e1,_0x2a9e62=_0x2e003b[0x0];if(!requireNameOrPath(_0x2a9e62))return 0x1;_0x4495f8[_0x3b505a(0xb5)]&&console[_0x3b505a(0x13f)](_0x3b505a(0xd0)+_0x2a9e62);const {journeyId:_0x4e850c,journeyName:_0x42b3b5}=await resolveJourneyIdFromInput(_0x2a9e62,_0x4495f8,_0x5485af);if(!_0x4495f8[_0x3b505a(0xb3)]){const _0x277966=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x42b3b5+'\x22?');if(!_0x277966)return console['error'](_0x3b505a(0x8d)),0x0;}const _0x59a40a=await withSpinner(_0x3b505a(0xeb),()=>_0x5485af[_0x3b505a(0x94)][_0x3b505a(0x151)](_0x4e850c),{'verbose':_0x4495f8[_0x3b505a(0xb5)]}),_0x135261=_0x59a40a[_0x3b505a(0xfb)];return console[_0x3b505a(0x13f)](_0x3b505a(0x13b)+_0x135261[_0x3b505a(0x177)]['name']+_0x3b505a(0x101)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0x124);['description']='Resume\x20a\x20paused\x20journey';async[a26_0x1f2943(0x12f)](_0x1ce487){const _0x82492=a26_0x1f2943,{options:_0x3ad323,args:_0x219cfc,tdx:_0x329f81}=_0x1ce487,_0x5861d7=_0x219cfc[0x0];if(!requireNameOrPath(_0x5861d7))return 0x1;_0x3ad323[_0x82492(0xb5)]&&console[_0x82492(0x13f)](_0x82492(0xd0)+_0x5861d7);const {journeyId:_0x4e9380,journeyName:_0x5b78d1}=await resolveJourneyIdFromInput(_0x5861d7,_0x3ad323,_0x329f81);if(!_0x3ad323[_0x82492(0xb3)]){const _0x5c5938=await confirm(_0x82492(0xd7)+_0x5b78d1+'\x22?');if(!_0x5c5938)return console[_0x82492(0x13f)](_0x82492(0x8d)),0x0;}const _0x5d4834=await withSpinner(_0x82492(0x120),()=>_0x329f81[_0x82492(0x94)]['resume'](_0x4e9380),{'verbose':_0x3ad323[_0x82492(0xb5)]}),_0x4fa2af=_0x5d4834[_0x82492(0xfb)];return console[_0x82492(0x13f)](_0x82492(0x13b)+_0x4fa2af[_0x82492(0x177)]['name']+_0x82492(0x109)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a26_0x1f2943(0x122);[a26_0x1f2943(0x158)]=a26_0x1f2943(0xb1);async['execute'](_0x5d8cc9){const _0x2c4252=a26_0x1f2943,{options:_0x227d72,args:_0x2fd729,tdx:_0xbb16ab}=_0x5d8cc9,_0x15f85e=_0x227d72,_0x34c47b=_0x2fd729[0x0],_0x5547b1=_0x34c47b&&isYamlFilePath(_0x34c47b),_0x2b8f94=await resolveTarget({'arg':_0x5547b1?_0x34c47b:undefined,'contextParent':_0x227d72[_0x2c4252(0x83)],'cwd':process[_0x2c4252(0xae)]()});if(!isSuccessfulResolution(_0x2b8f94))return _0x2b8f94[_0x2c4252(0x157)]===_0x2c4252(0x171)?(console[_0x2c4252(0x13f)](a26_0x54538f['yellow'](_0x2c4252(0xe7))),console[_0x2c4252(0x13f)](_0x2c4252(0x7f)),console[_0x2c4252(0x13f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x2c4252(0x170)),console['error'](_0x2c4252(0x80))):(console[_0x2c4252(0x13f)](a26_0x54538f['red'](_0x2c4252(0x102)+_0x2b8f94[_0x2c4252(0x153)]+'\x0a')),_0x2b8f94['helpText']&&console[_0x2c4252(0x13f)](a26_0x54538f[_0x2c4252(0xb7)](_0x2b8f94[_0x2c4252(0x111)]))),0x1;let _0x25b557=_0x5547b1?undefined:_0x34c47b,_0x254944,_0x305d86;_0x2b8f94['type']===_0x2c4252(0xb9)&&(_0x25b557=_0x2b8f94['resourceName'],_0x254944=_0x2b8f94[_0x2c4252(0x160)],_0x305d86=_0x2b8f94[_0x2c4252(0x79)]);const _0x2f8ce1=_0x2b8f94['parentName'],_0x3ad230=_0x2b8f94[_0x2c4252(0x10a)];_0x15f85e[_0x2c4252(0xb5)]&&(console['error'](_0x2c4252(0xc7)+_0x2f8ce1),console['error'](_0x2c4252(0x107)+_0x3ad230),_0x25b557&&console['error'](_0x2c4252(0x9c)+_0x25b557),_0x254944&&console[_0x2c4252(0x13f)]('Target\x20file:\x20'+_0x254944),_0x305d86&&console[_0x2c4252(0x13f)](_0x2c4252(0xb0)+_0x305d86));const _0x3ae003=await withSpinner(_0x2c4252(0xaa),()=>_0xbb16ab[_0x2c4252(0xee)]['resolveParentId'](_0x2f8ce1),{'verbose':_0x227d72[_0x2c4252(0xb5)]}),_0x53efb3=_0x3ae003[_0x2c4252(0xfb)],{journeys:_0x510b0f,folders:_0x1ac91e}=await withSpinner(_0x2c4252(0xa9),async()=>{const _0x35ee20=_0x2c4252,[_0x5ee3d0,_0x4cf9ce]=await Promise[_0x35ee20(0x77)]([_0xbb16ab['journey'][_0x35ee20(0x99)](_0x53efb3,undefined,{'includeAllVersions':!![]}),_0xbb16ab[_0x35ee20(0xee)][_0x35ee20(0x11c)](_0x53efb3)]);return{'journeys':_0x5ee3d0,'folders':_0x4cf9ce};},{'verbose':_0x227d72[_0x2c4252(0xb5)]})[_0x2c4252(0xc5)](_0x4085ba=>_0x4085ba['data']);let _0x3a0c31=_0x510b0f;const _0x1c6983=buildFolderIdToPathMap(_0x1ac91e);if(_0x25b557){const _0x2f32e8=_0x3a0c31[_0x2c4252(0x141)](_0x5799d7=>_0x5799d7[_0x2c4252(0xe6)][_0x2c4252(0xf8)]()===_0x25b557[_0x2c4252(0xf8)]());if(_0x2f32e8[_0x2c4252(0x147)]===0x0)return console[_0x2c4252(0x13f)]('Error:\x20Journey\x20not\x20found:\x20'+_0x25b557),console[_0x2c4252(0x13f)](_0x2c4252(0x118)),0x1;_0x3a0c31=_0x2f32e8;}if(_0x305d86!==undefined){const _0x134158=_0x3a0c31[_0x2c4252(0x141)](_0x1332af=>{const _0x5cddbc=_0x2c4252,_0x118f87=_0x1332af['folderId']?_0x1c6983[_0x5cddbc(0xbe)](_0x1332af[_0x5cddbc(0x174)])||'':'';return _0x118f87===_0x305d86;});if(_0x134158[_0x2c4252(0x147)]===0x0&&_0x3a0c31[_0x2c4252(0x147)]>0x0){console[_0x2c4252(0x13f)](_0x2c4252(0xab)+_0x25b557+'\x27\x20not\x20found\x20in\x20'+(_0x305d86||'root\x20folder')),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x1b2842 of _0x3a0c31){const _0x1fa1aa=_0x1b2842['folderId']?_0x1c6983[_0x2c4252(0xbe)](_0x1b2842['folderId'])||'':'';console[_0x2c4252(0x13f)](_0x2c4252(0xc1)+(_0x1fa1aa||_0x2c4252(0x7a))+'/'+_0x1b2842[_0x2c4252(0xe6)]);}return 0x1;}_0x3a0c31=_0x134158;}if(_0x3a0c31[_0x2c4252(0x147)]===0x0)return console[_0x2c4252(0x13f)](_0x2c4252(0x17a)),0x0;const _0xe4f056=new Map();for(const _0x50dc3d of _0x3a0c31){const _0xc2089c=_0x50dc3d[_0x2c4252(0x16a)];!_0xe4f056[_0x2c4252(0xa5)](_0xc2089c)&&_0xe4f056['set'](_0xc2089c,[]),_0xe4f056['get'](_0xc2089c)[_0x2c4252(0x9e)](_0x50dc3d);}for(const _0x5d44b6 of _0xe4f056['values']()){_0x5d44b6['sort']((_0x2891c7,_0x4d67ed)=>(_0x2891c7['versionNumber']||0x0)-(_0x4d67ed[_0x2c4252(0x12b)]||0x0));}const _0x222755=[],{idToEmailMap:_0x42d0aa,connectionIdToNameMap:_0x34cf94}=await withSpinner(_0x2c4252(0xe9),async()=>{const _0x14927b=_0x2c4252,[_0x261a87,_0x469714]=await Promise[_0x14927b(0x77)]([_0xbb16ab[_0x14927b(0x8b)][_0x14927b(0x161)](),_0xbb16ab['connection']['buildIdToNameMap']()]);return{'idToEmailMap':_0x261a87,'connectionIdToNameMap':_0x469714};},{'verbose':_0x227d72[_0x2c4252(0xb5)]})[_0x2c4252(0xc5)](_0xd893fd=>_0xd893fd[_0x2c4252(0xfb)]);for(const _0x57932d of _0xe4f056[_0x2c4252(0x14a)]()){const _0x30f126=_0x57932d[0x0][_0x2c4252(0xe6)],_0x491a88=_0x57932d[0x0][_0x2c4252(0x174)],_0xb0fabe=_0x491a88?_0x1c6983[_0x2c4252(0xbe)](_0x491a88)||'':'',_0x1ca72e=_0xb0fabe?a26_0x4622ae[_0x2c4252(0x15a)](_0x3ad230,_0xb0fabe):_0x3ad230,_0x26eb41=_0x254944||a26_0x4622ae[_0x2c4252(0x15a)](_0x1ca72e,sanitizeFileName(_0x30f126)+'.yml');let _0x46b6d5,_0x355e25;if(existsSync(_0x26eb41))try{const _0x13905e=readFileSync(_0x26eb41,_0x2c4252(0x17e)),_0x131906=parseYamlString(_0x13905e);_0x355e25=_0x131906,_0x46b6d5=buildRuleToNameMapping(_0x131906),_0x15f85e[_0x2c4252(0xb5)]&&_0x46b6d5[_0x2c4252(0xb8)]>0x0&&console['error'](_0x2c4252(0xd8)+_0x46b6d5[_0x2c4252(0xb8)]+_0x2c4252(0x14e)+_0x30f126);}catch(_0xf59a54){_0x15f85e['verbose']&&console[_0x2c4252(0x13f)](_0x2c4252(0xf7)+_0xf59a54[_0x2c4252(0x153)]);}const _0x51f364=[],_0x3a7990=new Set(),_0x40ca5e=new Map(),_0x324b64=new Map(),_0xc56779=new Set(),_0x1a50ad=new Map(),_0x3f69fa=new Map(),_0x569968=createJumpTargetCache();await withProgressSpinner(_0x2c4252(0x15c)+_0x30f126+'...',async _0x2ca0a5=>{const _0x327dbb=_0x2c4252;for(const _0x1cf6bd of _0x57932d){const _0x3f5268=_0x57932d[_0x327dbb(0x147)]>0x1?_0x1cf6bd[_0x327dbb(0xe6)]+'\x20v'+(_0x1cf6bd[_0x327dbb(0x12b)]||0x1):_0x1cf6bd[_0x327dbb(0xe6)];_0x2ca0a5[_0x327dbb(0x7d)](_0x327dbb(0x15c)+_0x3f5268);const _0x82b6a3=await _0xbb16ab[_0x327dbb(0x94)]['getJourney'](_0x1cf6bd['id']),_0x1a706e=_0x82b6a3[_0x327dbb(0x177)]?.[_0x327dbb(0x84)],_0x4495ca={'resolveSegment':async _0x5971ca=>{const _0x2dee3b=_0x327dbb;if(!_0x1a706e)return{'name':_0x5971ca,'isJourneyLocal':![]};const _0x1625b1=_0x40ca5e[_0x2dee3b(0xbe)](_0x5971ca);if(_0x1625b1)return _0x1625b1;try{const _0xbb2834=await _0xbb16ab[_0x2dee3b(0xee)][_0x2dee3b(0xdb)](_0x1a706e,_0x5971ca),_0x33b57f=_0xbb2834[_0x2dee3b(0x159)]===SEGMENT_KIND_JOURNEY;let _0x235566,_0x4da10a=_0xbb2834[_0x2dee3b(0xf6)];if(_0x33b57f&&_0xbb2834[_0x2dee3b(0x86)]){const _0x2eda6b=await segmentResponseToDef(_0xbb2834,{'resolveSegmentName':async _0x48a190=>{const _0x35897c=_0x2dee3b,_0x436d76=_0x40ca5e[_0x35897c(0xbe)](_0x48a190);if(_0x436d76)return _0x436d76[_0x35897c(0xf6)];const _0x193623=await _0x4495ca[_0x35897c(0xd1)](_0x48a190);return _0x193623[_0x35897c(0xf6)];}}),_0x46bdf2=_0x2eda6b['rule'];_0x235566={'description':_0xbb2834[_0x2dee3b(0x158)],'rule':_0x46bdf2};const _0x3c423e=serializeRule(_0x46bdf2),_0x25a91d=_0x324b64['get'](_0x3c423e);if(_0x25a91d)_0x4da10a=_0x25a91d,_0x235566=undefined,_0x15f85e[_0x2dee3b(0xb5)]&&console['error'](_0x2dee3b(0x166)+_0xbb2834[_0x2dee3b(0xf6)]+_0x2dee3b(0x100)+_0x25a91d);else{let _0x14b740=![];if(_0x46b6d5){const _0x4354a1=_0x46b6d5[_0x2dee3b(0xbe)](_0x3c423e);if(_0x4354a1){const _0x9a5b38=_0x4354a1['find'](_0x53aa55=>!_0x3a7990[_0x2dee3b(0xa5)](_0x53aa55));_0x9a5b38&&(_0x4da10a=_0x9a5b38,_0x3a7990[_0x2dee3b(0x105)](_0x9a5b38),_0x324b64[_0x2dee3b(0x92)](_0x3c423e,_0x9a5b38),_0x14b740=!![],_0x15f85e[_0x2dee3b(0xb5)]&&console[_0x2dee3b(0x13f)](_0x2dee3b(0x97)+_0x9a5b38+'\x20(rule\x20match)'));}}if(!_0x14b740){const _0x4a5d07=generateJourneyLocalName(_0xbb2834['name']);_0x4a5d07&&(_0x4da10a=_0x4a5d07);let _0x311650=_0x4da10a,_0x178302=0x2;while(_0x3a7990[_0x2dee3b(0xa5)](_0x311650)){_0x311650=_0x4da10a+'_'+_0x178302,_0x178302++;}_0x3a7990['add'](_0x311650),_0x324b64['set'](_0x3c423e,_0x311650),_0x4da10a=_0x311650;}}}const _0x270b74={'name':_0x4da10a,'isJourneyLocal':_0x33b57f,'definition':_0x235566};return _0x40ca5e[_0x2dee3b(0x92)](_0x5971ca,_0x270b74),_0x270b74;}catch(_0xb50cca){return _0x227d72[_0x2dee3b(0xb5)]&&console['error'](_0x2dee3b(0x13d)+_0x5971ca+':\x20'+_0xb50cca[_0x2dee3b(0x153)]),{'name':_0x5971ca,'isJourneyLocal':![]};}},'resolveActivation':async _0x399910=>{const _0x114e01=_0x327dbb,_0xc33ec7=_0x1a50ad[_0x114e01(0xbe)](_0x399910);if(_0xc33ec7)return _0xc33ec7;try{const _0x1736ac=await _0xbb16ab[_0x114e01(0x94)][_0x114e01(0x135)](_0x1cf6bd['id'],_0x399910),_0x13f80b=journeyActivationStepToYaml(_0x1736ac,_0x42d0aa,_0x34cf94),_0x236db7=JSON[_0x114e01(0x121)]({'name':_0x13f80b[_0x114e01(0xf6)],'connection':_0x13f80b[_0x114e01(0xe2)],'connector_config':_0x13f80b[_0x114e01(0x130)]}),_0x8d7cbe=_0x3f69fa[_0x114e01(0xbe)](_0x236db7);if(_0x8d7cbe){const _0x4c9fb4={'name':_0x8d7cbe,'isJourneyLocal':!![],'definition':_0x13f80b};return _0x1a50ad['set'](_0x399910,_0x4c9fb4),_0x4c9fb4;}const _0x4ed2b8=_0x1736ac[_0x114e01(0x177)][_0x114e01(0xd2)][_0x114e01(0xf6)]||_0x399910,_0x5c6760=sanitizeYamlKey(_0x4ed2b8)||_0x114e01(0x127)+_0x399910;let _0x44fce4=_0x5c6760,_0x48ca67=0x2;while(_0xc56779[_0x114e01(0xa5)](_0x44fce4)){_0x44fce4=_0x5c6760+'_'+_0x48ca67,_0x48ca67++;}_0xc56779[_0x114e01(0x105)](_0x44fce4),_0x3f69fa[_0x114e01(0x92)](_0x236db7,_0x44fce4);const _0x4edac7={'name':_0x44fce4,'isJourneyLocal':!![],'definition':_0x13f80b};return _0x1a50ad[_0x114e01(0x92)](_0x399910,_0x4edac7),_0x4edac7;}catch(_0x1ace99){return _0x227d72[_0x114e01(0xb5)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x399910+':\x20'+_0x1ace99[_0x114e01(0x153)]),{'name':_0x399910,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1eaf21,_0x3da0a8)=>{const _0x394bb4=_0x327dbb;return resolveJumpTarget(_0x1eaf21,_0x3da0a8,_0x569968,_0x26c085=>_0xbb16ab[_0x394bb4(0x94)][_0x394bb4(0xbb)](_0x26c085));}},_0xf5ffe9=await journeyResponseToDef(_0x82b6a3,_0x4495ca);_0x51f364[_0x327dbb(0x9e)]({'item':_0x1cf6bd,'yaml':_0xf5ffe9});}},{'verbose':_0x227d72[_0x2c4252(0xb5)]});const _0x150b37=await _0xbb16ab[_0x2c4252(0x94)][_0x2c4252(0x145)](_0x57932d[0x0][_0x2c4252(0x16a)]),_0x4fe69e=buildMergedJourneyDef(_0x51f364,_0x46b6d5,_0x150b37),_0x57eb71=normalizeJourneyDef(_0x4fe69e,_0x355e25),_0x4e0f63=toYamlString(_0x57eb71),_0x1f3491=_0x254944||a26_0x4622ae[_0x2c4252(0x15a)](_0x1ca72e,sanitizeFileName(_0x30f126)+_0x2c4252(0x17f));!_0x254944&&_0xb0fabe&&!existsSync(_0x1ca72e)&&mkdirSync(_0x1ca72e,{'recursive':!![]});const _0x1c4458=a26_0x4622ae[_0x2c4252(0x12d)](process[_0x2c4252(0xae)](),_0x1f3491);if(existsSync(_0x1f3491)){const _0x441fe5=readFileSync(_0x1f3491,'utf-8'),_0x2042b7=generateDiff(_0x441fe5,_0x4e0f63),_0x409b43=hasChanges(_0x2042b7);_0x222755[_0x2c4252(0x9e)]({'relativePath':_0x1c4458,'absolutePath':_0x1f3491,'content':_0x4e0f63,'isNew':![],'hasChanges':_0x409b43,'diff':_0x409b43?formatDiffWithColors(_0x2042b7):undefined});}else _0x222755[_0x2c4252(0x9e)]({'relativePath':_0x1c4458,'absolutePath':_0x1f3491,'content':_0x4e0f63,'isNew':!![],'hasChanges':![]});}const _0x2305a5=_0x222755['filter'](_0x4ee84a=>_0x4ee84a[_0x2c4252(0xe4)]),_0x6562d2=_0x222755[_0x2c4252(0x141)](_0x221224=>!_0x221224[_0x2c4252(0xe4)]&&_0x221224['hasChanges']),_0x2cc358=_0x222755['filter'](_0x282506=>!_0x282506['isNew']&&!_0x282506['hasChanges']),_0x57c0fb=_0x3a0c31[_0x2c4252(0x147)],_0x28e5dc=_0xe4f056[_0x2c4252(0xb8)],_0x308008=_0x57c0fb>_0x28e5dc?'\x20('+_0x57c0fb+'\x20versions)':'';console[_0x2c4252(0x13f)](_0x2c4252(0xa1)),console[_0x2c4252(0x13f)]('\x20\x20'+a26_0x54538f['cyan'](_0x28e5dc+_0x2c4252(0x81))+a26_0x54538f['dim'](_0x308008)),console[_0x2c4252(0x13f)]('\x20\x20'+a26_0x54538f[_0x2c4252(0x137)]('+\x20'+_0x2305a5['length']+_0x2c4252(0x119))),console[_0x2c4252(0x13f)]('\x20\x20'+a26_0x54538f['yellow']('~\x20'+_0x6562d2[_0x2c4252(0x147)]+_0x2c4252(0xef))),console['error']('\x20\x20'+a26_0x54538f[_0x2c4252(0x11a)]('=\x20'+_0x2cc358[_0x2c4252(0x147)]+'\x20unchanged\x20files')),console[_0x2c4252(0x13f)](_0x2c4252(0xa8)+a26_0x54538f[_0x2c4252(0xb7)](_0x3ad230)+'\x0a');if(_0x6562d2[_0x2c4252(0x147)]>0x0)for(const _0xa3d75c of _0x6562d2){console[_0x2c4252(0x13f)](_0x2c4252(0x10c)+_0xa3d75c[_0x2c4252(0x13e)]+'\x27:'),console['error']('─'[_0x2c4252(0x8f)](0x3c)),console['error'](_0xa3d75c[_0x2c4252(0x181)]),console['error']('─'[_0x2c4252(0x8f)](0x3c));}if(_0x15f85e[_0x2c4252(0x14d)])return console[_0x2c4252(0x13f)](a26_0x54538f[_0x2c4252(0xcd)](_0x2c4252(0xbf))),0x0;if(_0x2305a5[_0x2c4252(0x147)]===0x0&&_0x6562d2[_0x2c4252(0x147)]===0x0)return console[_0x2c4252(0x13f)](a26_0x54538f['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2f8ce1},_0x15f85e['session']),console['error'](a26_0x54538f[_0x2c4252(0x137)](_0x2c4252(0x113)+a26_0x54538f[_0x2c4252(0x11a)](_0x2c4252(0xc6))+_0x2c4252(0xc2)+a26_0x54538f[_0x2c4252(0xb7)](_0x2f8ce1))),0x0;if(!_0x15f85e[_0x2c4252(0xb3)]&&(_0x2305a5['length']>0x0||_0x6562d2[_0x2c4252(0x147)]>0x0)){if(!isInteractive())return console['error'](a26_0x54538f['red']('\x0aError:'),_0x2c4252(0x95)),console[_0x2c4252(0x13f)](a26_0x54538f['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x39b51f=await confirmKey(_0x2c4252(0x89)+(_0x2305a5['length']+_0x6562d2[_0x2c4252(0x147)])+_0x2c4252(0xfc));if(!_0x39b51f)return console[_0x2c4252(0x13f)](a26_0x54538f[_0x2c4252(0xcd)]('Aborted.'),_0x2c4252(0xf4)),0x1;}!existsSync(_0x3ad230)&&mkdirSync(_0x3ad230,{'recursive':!![]});const _0x5d744a=a26_0x4622ae[_0x2c4252(0x15a)](_0x3ad230,_0x2c4252(0x116));writeFileSync(_0x5d744a,createTdxConfigContent(_0x2f8ce1),_0x2c4252(0x17e));for(const _0x301f38 of _0x222755){(_0x301f38[_0x2c4252(0xe4)]||_0x301f38[_0x2c4252(0x88)])&&writeFileSync(_0x301f38['absolutePath'],_0x301f38[_0x2c4252(0xec)],'utf-8');}return console[_0x2c4252(0x13f)](a26_0x54538f['green'](_0x2c4252(0x11e)+(_0x2305a5['length']+_0x6562d2[_0x2c4252(0x147)])+_0x2c4252(0x85)+_0x3ad230)),saveSessionContext({'parent_segment':_0x2f8ce1},_0x15f85e[_0x2c4252(0x13a)]),console[_0x2c4252(0x13f)](a26_0x54538f[_0x2c4252(0x137)]('✔\x20Context\x20set:\x20'+a26_0x54538f['dim'](_0x2c4252(0xc6))+'\x20=\x20'+a26_0x54538f['cyan'](_0x2f8ce1))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xe0);[a26_0x1f2943(0x158)]='Show\x20journey\x20table\x20column\x20mapping';async[a26_0x1f2943(0x12f)](_0x450ce8){const _0x5d697d=a26_0x1f2943,{options:_0x10fd74,args:_0x579a70,tdx:_0x2cea1c}=_0x450ce8,_0x4e1709=_0x579a70[0x0];if(!requireNameOrPath(_0x4e1709))return 0x1;_0x10fd74['verbose']&&console[_0x5d697d(0x13f)](_0x5d697d(0xd0)+_0x4e1709);const {journeyId:_0x2bdbff}=await resolveJourneyIdFromInput(_0x4e1709,_0x10fd74,_0x2cea1c),_0x43df7d=await withSpinner(_0x5d697d(0x133),()=>_0x2cea1c[_0x5d697d(0x94)][_0x5d697d(0xdd)](_0x2bdbff),{'verbose':_0x10fd74[_0x5d697d(0xb5)]}),_0x5f3545=_0x43df7d['data'];return console[_0x5d697d(0xc3)](_0x5d697d(0x136)+_0x5f3545[_0x5d697d(0x12c)]),console['log'](_0x5d697d(0x10b)+_0x5f3545[_0x5d697d(0x9d)]),await handleSDKOutput(_0x5f3545['columns'],_0x10fd74),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a26_0x1f2943(0x9b);['description']=a26_0x1f2943(0x123);async[a26_0x1f2943(0x12f)](_0x1cb9af){const _0x45fe7d=a26_0x1f2943,{options:_0x1bd901,args:_0x55cbf4,tdx:_0x511a33}=_0x1cb9af,_0x2a1a4a=_0x55cbf4[0x0];if(!requireNameOrPath(_0x2a1a4a))return 0x1;_0x1bd901['verbose']&&console[_0x45fe7d(0x13f)]('Input:\x20'+_0x2a1a4a);const {journeyId:_0xea7a5b}=await resolveJourneyIdFromInput(_0x2a1a4a,_0x1bd901,_0x511a33),_0x1d6eb4=await withSpinner(_0x45fe7d(0x165),()=>_0x511a33[_0x45fe7d(0x94)][_0x45fe7d(0xea)](_0xea7a5b),{'verbose':_0x1bd901[_0x45fe7d(0xb5)]}),_0x210d90=_0x1d6eb4[_0x45fe7d(0xfb)];return console[_0x45fe7d(0x13f)](_0x45fe7d(0xd8)+_0x210d90[_0x45fe7d(0x147)]+'\x20activation'+(_0x210d90[_0x45fe7d(0x147)]!==0x1?'s':'')),await handleSDKOutput(_0x210d90,_0x1bd901),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xb6);[a26_0x1f2943(0x158)]=a26_0x1f2943(0xde);['segmentPushCommand']=new SegmentPushCommand();async[a26_0x1f2943(0x12f)](_0x1b0fc4){const _0x5433e2=a26_0x1f2943,_0x209039=_0x1b0fc4[_0x5433e2(0x7c)][0x0];let _0x43103a;if(_0x209039){const _0x367672=await resolveTarget({'arg':_0x209039,'contextParent':_0x1b0fc4['options'][_0x5433e2(0x83)],'cwd':process['cwd']()});isSuccessfulResolution(_0x367672)&&_0x367672['type']==='file'&&(_0x43103a=_0x367672['filePath']);}const _0x3e48db={..._0x1b0fc4,'options':{..._0x1b0fc4[_0x5433e2(0xa3)],'journeysOnly':!![],..._0x43103a&&{'singleFilePath':_0x43103a}}};return this['segmentPushCommand'][_0x5433e2(0x12f)](_0x3e48db);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a26_0x1f2943(0xcc);[a26_0x1f2943(0x158)]=a26_0x1f2943(0x12a);async[a26_0x1f2943(0x12f)](_0x136192){const _0x8f297c=a26_0x1f2943,{options:_0xb7df9a,args:_0x547d17,tdx:_0x560aa0}=_0x136192,_0x587899=_0x547d17[0x0];if(!requireNameOrPath(_0x587899))return 0x1;if(_0xb7df9a[_0x8f297c(0xb5)])console[_0x8f297c(0x13f)](_0x8f297c(0xd0)+_0x587899);const {journeyId:_0x5262f7}=await resolveJourneyIdFromInput(_0x587899,_0xb7df9a,_0x560aa0),_0x5766bd=await withSpinner(_0x8f297c(0x117),()=>_0x560aa0['journey']['listVersions'](_0x5262f7),{'verbose':_0xb7df9a[_0x8f297c(0xb5)]}),{bundleName:_0x610a7f,versions:_0x4f2f1b,latestJourneyId:_0xadcee1}=_0x5766bd[_0x8f297c(0xfb)];console[_0x8f297c(0x13f)](_0x610a7f+':\x20'+_0x4f2f1b[_0x8f297c(0x147)]+_0x8f297c(0x11b)+(_0x4f2f1b[_0x8f297c(0x147)]!==0x1?'s':''));const _0x5d070a=_0x4f2f1b['map'](_0x36bd62=>({'version':_0x36bd62[_0x8f297c(0x12b)],'journey_id':_0x36bd62['journeyId'],'name':_0x36bd62[_0x8f297c(0xf6)],'state':_0x36bd62[_0x8f297c(0x148)],'paused':_0x36bd62[_0x8f297c(0x164)],'latest':_0x36bd62[_0x8f297c(0x15f)]===_0xadcee1,'created_at':_0x36bd62[_0x8f297c(0x11d)]}));return await handleSDKOutput(_0x5d070a,_0xb7df9a),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';[a26_0x1f2943(0x158)]=a26_0x1f2943(0x15d);async[a26_0x1f2943(0x12f)](_0x342d3e){const _0x447b0d=a26_0x1f2943,{options:_0x38fd30,args:_0x3d0d82,tdx:_0x35eda0}=_0x342d3e,_0x20f773=_0x3d0d82[0x0];if(!requireNameOrPath(_0x20f773))return 0x1;if(_0x38fd30[_0x447b0d(0xb5)])console['error'](_0x447b0d(0xd0)+_0x20f773);const {journeyId:_0xc6ad79,journeyName:_0x1d3118}=await resolveJourneyIdFromInput(_0x20f773,_0x38fd30,_0x35eda0);if(!_0x38fd30[_0x447b0d(0xb3)]){const _0x4f7bdf=await confirm(_0x447b0d(0x156)+_0x1d3118+'\x22?');if(!_0x4f7bdf)return console[_0x447b0d(0x13f)](_0x447b0d(0x8d)),0x0;}const _0x3acbf5=await withSpinner('Creating\x20new\x20version...',()=>_0x35eda0['journey'][_0x447b0d(0xf5)](_0xc6ad79),{'verbose':_0x38fd30['verbose']}),_0x779355=_0x3acbf5[_0x447b0d(0xfb)];return console[_0x447b0d(0x13f)](a26_0x54538f[_0x447b0d(0x137)]('✔')+_0x447b0d(0x132)+_0x779355[_0x447b0d(0x177)][_0x447b0d(0x12b)]+_0x447b0d(0x14f)+_0x779355[_0x447b0d(0x177)][_0x447b0d(0xf6)]+'\x22'),console[_0x447b0d(0x13f)](_0x447b0d(0x131)+_0x779355['id']),await handleSingleObjectOutput({'id':_0x779355['id'],'name':_0x779355[_0x447b0d(0x177)]['name'],'version':_0x779355[_0x447b0d(0x177)][_0x447b0d(0x12b)],'state':_0x779355['attributes'][_0x447b0d(0x148)],'bundle_id':_0x779355[_0x447b0d(0x177)]['journeyBundleId'],'created_at':_0x779355[_0x447b0d(0x177)][_0x447b0d(0x11d)]},_0x38fd30),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xe3);[a26_0x1f2943(0x158)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a26_0x1f2943(0x12f)](_0x5d5582){const _0x3bc503=a26_0x1f2943,{options:_0x1264a9,args:_0x974190,tdx:_0x2105d1}=_0x5d5582,_0x4233b2=_0x974190[0x0];if(!requireNameOrPath(_0x4233b2))return 0x1;const _0x4720af=_0x1264a9[_0x3bc503(0x140)];if(!_0x4720af)return console[_0x3bc503(0x13f)](_0x3bc503(0xfd)),console[_0x3bc503(0x13f)](_0x3bc503(0x163)),0x1;const _0x5d2693=parseInt(_0x4720af,0xa);if(isNaN(_0x5d2693)||_0x5d2693<0x1)return console[_0x3bc503(0x13f)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x4720af),0x1;if(_0x1264a9[_0x3bc503(0xb5)])console['error'](_0x3bc503(0xd0)+_0x4233b2+_0x3bc503(0xa4)+_0x5d2693);const {journeyId:_0x10f6ad,parentSegmentId:_0x6102f2}=await resolveJourneyIdFromInput(_0x4233b2,_0x1264a9,_0x2105d1),_0x5df5c3=await withSpinner('Resolving\x20version...',()=>_0x2105d1[_0x3bc503(0x94)][_0x3bc503(0x13c)](_0x10f6ad),{'verbose':_0x1264a9[_0x3bc503(0xb5)]}),{versions:_0x14c8bd,latestJourneyId:_0x1089dc}=_0x5df5c3[_0x3bc503(0xfb)],_0x3feff9=_0x14c8bd[_0x3bc503(0xe5)](_0x688f68=>_0x688f68[_0x3bc503(0x12b)]===_0x5d2693);if(!_0x3feff9){const _0x4f9acb=_0x14c8bd[_0x3bc503(0x11f)](_0x54b5e9=>'v'+_0x54b5e9['versionNumber'])[_0x3bc503(0x15a)](',\x20');return console['error']('Error:\x20Version\x20'+_0x5d2693+_0x3bc503(0x9f)+_0x4f9acb),0x1;}const _0x495e21=await withSpinner(_0x3bc503(0xe1)+_0x5d2693+'\x20details...',()=>_0x2105d1[_0x3bc503(0x94)]['getJourney'](_0x3feff9[_0x3bc503(0x15f)]),{'verbose':_0x1264a9[_0x3bc503(0xb5)]}),_0x174a4a=_0x495e21[_0x3bc503(0xfb)],_0x1af7be=getConsoleNextUrl(_0x1264a9[_0x3bc503(0x16b)],_0x3bc503(0x128)+_0x6102f2+_0x3bc503(0xa0)+_0x3feff9[_0x3bc503(0x15f)]+_0x3bc503(0x154));return await handleSingleObjectOutput({'id':_0x174a4a['id'],'name':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0xf6)],'version':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x12b)],'description':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x158)],'state':_0x174a4a['attributes'][_0x3bc503(0x148)],'paused':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x164)],'reentry_mode':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x149)],'stages':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x90)]?.[_0x3bc503(0x147)]||0x0,..._0x174a4a['attributes'][_0x3bc503(0x78)]&&{'goal':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x78)][_0x3bc503(0xf6)]},'latest':_0x3feff9['journeyId']===_0x1089dc,'created_at':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x11d)],'updated_at':_0x174a4a['attributes'][_0x3bc503(0x172)],'url':_0x1af7be},_0x1264a9),0x0;}}
1
+ const a28_0x8121c3=a28_0x1d56;(function(_0x3e555c,_0xf479a7){const _0x38261c=a28_0x1d56,_0x5542d3=_0x3e555c();while(!![]){try{const _0x43e27d=parseInt(_0x38261c(0x28e))/0x1*(-parseInt(_0x38261c(0x230))/0x2)+parseInt(_0x38261c(0x20e))/0x3+parseInt(_0x38261c(0x276))/0x4*(-parseInt(_0x38261c(0x2b5))/0x5)+parseInt(_0x38261c(0x1e2))/0x6*(-parseInt(_0x38261c(0x289))/0x7)+-parseInt(_0x38261c(0x243))/0x8*(-parseInt(_0x38261c(0x1ea))/0x9)+parseInt(_0x38261c(0x2b4))/0xa*(-parseInt(_0x38261c(0x22b))/0xb)+parseInt(_0x38261c(0x268))/0xc;if(_0x43e27d===_0xf479a7)break;else _0x5542d3['push'](_0x5542d3['shift']());}catch(_0xc4852e){_0x5542d3['push'](_0x5542d3['shift']());}}}(a28_0x1230,0x6e371));import a28_0x302f34 from'chalk';import a28_0x1221b1 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 a28_0x1d56(_0x4d69a8,_0xf440ff){_0x4d69a8=_0x4d69a8-0x1c9;const _0x1230f9=a28_0x1230();let _0x1d566b=_0x1230f9[_0x4d69a8];return _0x1d566b;}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';function a28_0x1230(){const _0x2f5e54=['reentryMode','size','✔\x20Pulled\x20','\x22\x20resumed','buildIdToEmailMap','43373OwZJgs','No\x20statistics\x20available\x20for\x20journey:\x20','journey:versions','\x20\x20Consolidating\x20duplicate\x20segment:\x20','data','26tZtDag','folders','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','parentSegment','getColumnMapping','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','yellow','Listing\x20journey\x20versions...','stages','resume','renderStats','Parent\x20segment:\x20','journey:version:create','resolveSegment','Error:\x20Journey\x20\x27','table','options','stage','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','887064YjvOCK','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','web','rootFolderId','Resolved\x20YAML\x20file:\x20','goal','exitOrJumpSize','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Invalid\x20--type\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','errorCode','✔\x20Journey\x20\x22','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','bold','filePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','limit','connection','entries','test','createdAt','INVALID_ARGUMENT','journeyBundleId','Resolving\x20version...','cwd','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','relativePath','\x20\x20Parent\x20segment:\x20','journey:pull','version','has','connector_config','base','\x20journey','length','12753600QMVQaD','error','Show\x20journey\x20details','Getting\x20journey\x20details...','from','Error:\x20','dim','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Pausing\x20journey...','(running)','getSegment','completeMilestoneRate','(paused)','\x20=\x20','872uAIlxm','split','journeyStages','hasPeriod','then','\x20files?','replace','description','find','tsv','filter','nodes','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x5c$&','log','\x0aPull\x20summary:','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x20versions)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','14bZHnhk','type','no_parent','cyan','exitOrJumpRate','3061cyshfv','Target\x20directory:\x20','utf-8','\x20\x20Statistics\x20not\x20available','dryRun','pause','history','journey:push','set','journey:traffic','getTrafficData','/j/da/je','Error:\x20Journey\x20not\x20found:\x20','name','journey','(draft)','draft','Input:\x20','audienceId','\x27\x20not\x20found\x20in\x20','Cancelled','parentName','all','site','Error:\x20Stage\x20\x22','rule','updatedAt','toLowerCase','journeyId','\x20not\x20found.\x20Available:\x20','segment','\x20->\x20','journey:stats','List\x20journeys\x20in\x20current\x20context','targetDir','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Folder\x20path:\x20','goalSize','1490IHtXau','15685hwBCLr','\x0aError:','Fetching\x20parent\x20segment...','Database:\x20','blue','file','state','Resolving\x20journey...','Fetching\x20journeys\x20and\x20folders...','links','conversion',',\x20version:\x20','journeyName','join','Fetching\x20','content','\x20unchanged\x20files','format','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20new\x20files','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','message','segments','\x22\x20paused','helpText','completed','resolveJourneyId','segmentPushCommand','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','jsonl','activation','(root)','getJourney','\x20(ID:\x20','/app/ps/','\x0aChanges\x20to\x20\x27','tdx.json','-\x20no\x20files\x20written','🗺️\x20','archived','green','launched','folderPath','segmentName','red','\x20\x20Journey\x20ID:\x20','resourceName','470292YmgdVi','✔\x20Found\x20','args','user','yes','/e/','activation_','\x20version','9aKKRvb','attributes','versionNumber','Write\x20','Getting\x20journey\x20statistics...','Resolving\x20parent\x20segment...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','isNew','repeat','getLatestJourneyId','completionRate','journey:activations','paused','Options:','add','folderId','(archived)','resolveParentId','getStatistics','stageNameMap','get','createVersion','verbose','/j/da','Folder\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','hasChanges','push','milestoneSize','values','Show\x20journey\x20table\x20column\x20mapping','(completed)','map','enteredSize','Aborted.','✔\x20Context\x20set:\x20','2237064OrkMVW','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','json','includeStats','Getting\x20column\x20mapping...','Resume\x20a\x20paused\x20journey','✔\x20All\x20files\x20are\x20up\x20to\x20date','setPhase','execute','journeyBundleName','Error:\x20--version\x20option\x20is\x20required','sort','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','buildIdToNameMap','listVersions','\x20\x20-\x20','Error:\x20Invalid\x20version\x20number:\x20','listActivationsFlat','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Error:\x20Version\x20','localeCompare','journey:pause'];a28_0x1230=function(){return _0x2f5e54;};return a28_0x1230();}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x24f18c){const _0x2ff002=a28_0x1d56;return!_0x24f18c&&(console[_0x2ff002(0x269)](_0x2ff002(0x1cf)),console[_0x2ff002(0x269)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x24f18c;}function withJsonFormat(_0x3faab5){const _0x3628ad=a28_0x1d56;if(!_0x3faab5['format']&&!_0x3faab5[_0x3628ad(0x212)]&&!_0x3faab5[_0x3628ad(0x1d0)]&&!_0x3faab5[_0x3628ad(0x27f)])return{..._0x3faab5,'format':_0x3628ad(0x212),'json':!![]};return _0x3faab5;}function formatJourneyState(_0x5f390a){const _0x58ead8=a28_0x1d56;switch(_0x5f390a){case _0x58ead8(0x1dc):return a28_0x302f34['green'](_0x58ead8(0x271));case _0x58ead8(0x29e):return a28_0x302f34[_0x58ead8(0x26e)](_0x58ead8(0x29d));case'paused':return a28_0x302f34['yellow'](_0x58ead8(0x274));case _0x58ead8(0x1cc):return a28_0x302f34[_0x58ead8(0x2b9)](_0x58ead8(0x209));case _0x58ead8(0x1da):return a28_0x302f34[_0x58ead8(0x26e)](_0x58ead8(0x1fa));default:return'('+_0x5f390a+')';}}function formatJourneyItem(_0xcdb75f,_0x1cf908='',_0x6ddf3a){const _0x7c4e76=a28_0x1d56,_0x53d245=formatJourneyState(_0xcdb75f[_0x7c4e76(0x2bb)]),_0x29a1a2=_0x6ddf3a?hyperlink(_0xcdb75f[_0x7c4e76(0x219)],_0x6ddf3a):_0xcdb75f['journeyBundleName'];return _0x1cf908+_0x7c4e76(0x1d9)+_0x29a1a2+'\x20'+_0x53d245;}function escapeRegex(_0x556749){const _0x385d06=a28_0x1d56;return _0x556749[_0x385d06(0x27c)](/[.*+?^${}()|[\]\\]/g,_0x385d06(0x283));}function globToRegex(_0x2893f3){const _0x47d79b=a28_0x1d56,_0x4e4000=_0x2893f3[_0x47d79b(0x277)]('*')[_0x47d79b(0x20a)](escapeRegex);return new RegExp(_0x4e4000['join']('.*'),'i');}function buildRuleToNameMapping(_0x330fd7){const _0x290747=a28_0x1d56,_0x2aed75=new Map();if(_0x330fd7[_0x290747(0x1c9)])for(const [_0x4374a4,_0x4a66c3]of Object[_0x290747(0x256)](_0x330fd7[_0x290747(0x1c9)])){if(_0x4a66c3[_0x290747(0x2a7)]){const _0x458604=serializeRule(_0x4a66c3['rule']),_0x463ab6=_0x2aed75[_0x290747(0x1fe)](_0x458604);_0x463ab6?_0x463ab6[_0x290747(0x205)](_0x4374a4):_0x2aed75[_0x290747(0x296)](_0x458604,[_0x4374a4]);}}return _0x2aed75;}async function resolveJourneyIdFromInput(_0x435975,_0x275dbb,_0x5615d6){const _0x311703=a28_0x1d56,_0x53963c=await resolveJourneyTarget(_0x435975,_0x275dbb['parentSegment'],_0x275dbb['verbose']),_0x44f85c=_0x53963c[_0x311703(0x233)];if(!_0x44f85c)throw new SDKError(ErrorCode[_0x311703(0x259)],_0x311703(0x2b1));const _0x14436f=await withSpinner(_0x311703(0x1ef),()=>_0x5615d6[_0x311703(0x2ac)][_0x311703(0x1fb)](_0x44f85c),{'verbose':_0x275dbb[_0x311703(0x200)]}),_0x333e26=_0x14436f[_0x311703(0x22f)],_0x20359e=await withSpinner(_0x311703(0x2bc),()=>_0x5615d6[_0x311703(0x29c)][_0x311703(0x1cd)](_0x333e26,_0x53963c[_0x311703(0x2c1)]),{'verbose':_0x275dbb[_0x311703(0x200)]});return{'journeyId':_0x20359e['data'],'journeyName':_0x53963c['journeyName'],'parentSegmentId':_0x333e26};}async function resolveJourneyTarget(_0x3ccccb,_0x182c6d,_0x26ad24){const _0x4992ba=a28_0x1d56;if(isYamlFilePath(_0x3ccccb))try{const _0x4403c0=await resolveYamlFilePath(_0x3ccccb);return _0x26ad24&&(console['error'](_0x4992ba(0x248)+_0x3ccccb),console['error'](_0x4992ba(0x260)+_0x4403c0[_0x4992ba(0x233)]),console['error']('\x20\x20Name:\x20'+_0x4403c0[_0x4992ba(0x1de)]),console[_0x4992ba(0x269)](_0x4992ba(0x2b2)+(_0x4403c0[_0x4992ba(0x1dd)]||_0x4992ba(0x1d2)))),{'journeyName':_0x4403c0[_0x4992ba(0x1de)],'parentSegment':_0x4403c0[_0x4992ba(0x233)],'resolved':_0x4403c0};}catch(_0x15006f){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4992ba(0x235)+_0x15006f[_0x4992ba(0x2ca)]);}if(!_0x182c6d)throw new SDKError(ErrorCode[_0x4992ba(0x259)],_0x4992ba(0x24b));return{'journeyName':_0x3ccccb,'parentSegment':_0x182c6d};}export class JourneyListCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:list';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x2af);async[a28_0x8121c3(0x218)](_0x5745fb){const _0x4d29e0=a28_0x8121c3,{options:_0x1a731f,args:_0x536c7d,tdx:_0x283246}=_0x5745fb,_0x43483c=_0x536c7d[0x0],_0x56bc31=_0x1a731f[_0x4d29e0(0x233)];if(!_0x56bc31)return console[_0x4d29e0(0x269)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x4d29e0(0x269)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x35d1c1=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x283246[_0x4d29e0(0x2ac)][_0x4d29e0(0x1fb)](_0x56bc31),{'verbose':_0x1a731f[_0x4d29e0(0x200)]}),_0x237e52=_0x35d1c1[_0x4d29e0(0x22f)];_0x1a731f[_0x4d29e0(0x200)]&&(console[_0x4d29e0(0x269)](_0x4d29e0(0x23b)+_0x56bc31+_0x4d29e0(0x1d4)+_0x237e52+')'),_0x43483c&&console['error']('Pattern:\x20'+_0x43483c));const _0x4bf15e=await withSpinner(_0x4d29e0(0x2b7),()=>_0x283246[_0x4d29e0(0x2ac)]['getParentFull'](_0x237e52),{'verbose':_0x1a731f[_0x4d29e0(0x200)]}),_0x1a8710=_0x4bf15e[_0x4d29e0(0x22f)],_0x4089f1=_0x1a8710[_0x4d29e0(0x247)],_0x57fd40=await withSpinner('Listing\x20journeys...',()=>_0x283246['journey']['listJourneysWithFolders'](_0x237e52,_0x4089f1),{'verbose':_0x1a731f['verbose']});let _0x3e8814=_0x57fd40[_0x4d29e0(0x22f)]['journeys'];const _0x2f5c96=_0x57fd40[_0x4d29e0(0x22f)][_0x4d29e0(0x231)],_0x74409d=new Map();for(const _0x169549 of _0x2f5c96){_0x74409d[_0x4d29e0(0x296)](_0x169549['id'],_0x169549[_0x4d29e0(0x29b)]);}if(_0x43483c){const _0x326c1e=globToRegex(_0x43483c);_0x3e8814=_0x3e8814['filter'](_0x59fe89=>_0x326c1e[_0x4d29e0(0x257)](_0x59fe89['journeyBundleName']));}console[_0x4d29e0(0x269)](_0x4d29e0(0x1e3)+_0x3e8814[_0x4d29e0(0x267)]+_0x4d29e0(0x266)+(_0x3e8814[_0x4d29e0(0x267)]!==0x1?'s':''));const _0x2451a1=_0x2a942a=>{const _0x477550=_0x4d29e0;return getConsoleNextUrl(_0x1a731f[_0x477550(0x2a5)],'/app/ps/'+_0x237e52+'/e/'+_0x2a942a+_0x477550(0x201));};if(_0x1a731f['format']==='table')await handleSDKOutput(_0x3e8814,_0x1a731f);else{if(_0x1a731f[_0x4d29e0(0x2c6)]===_0x4d29e0(0x212)){const _0x11fda9=_0x3e8814['map'](_0x75fdac=>({..._0x75fdac,'url':_0x2451a1(_0x75fdac['id'])}));await handleSDKOutput(_0x11fda9,_0x1a731f);}else{console[_0x4d29e0(0x284)]('['+_0x56bc31+']');const _0x3c828b=new Map(),_0xfb0209=[];for(const _0x107b13 of _0x3e8814){if(!_0x107b13[_0x4d29e0(0x1f9)]||_0x107b13[_0x4d29e0(0x1f9)]===_0x4089f1)_0xfb0209[_0x4d29e0(0x205)](_0x107b13);else{const _0x328a04=_0x3c828b['get'](_0x107b13[_0x4d29e0(0x1f9)])||[];_0x328a04['push'](_0x107b13),_0x3c828b[_0x4d29e0(0x296)](_0x107b13[_0x4d29e0(0x1f9)],_0x328a04);}}const _0x2cd5e8=(_0x2d2edb,_0x3a8003)=>_0x2d2edb[_0x4d29e0(0x219)][_0x4d29e0(0x224)](_0x3a8003['journeyBundleName'],undefined,{'sensitivity':'base'});_0xfb0209[_0x4d29e0(0x21b)](_0x2cd5e8);for(const _0x1cb3d1 of _0xfb0209){console[_0x4d29e0(0x284)](formatJourneyItem(_0x1cb3d1,'',_0x2451a1(_0x1cb3d1['id'])));}const _0x49c706=[..._0x3c828b[_0x4d29e0(0x256)]()][_0x4d29e0(0x21b)]((_0x3fbd5e,_0x33812c)=>{const _0x9031d4=_0x4d29e0,_0x3ae4b7=_0x74409d[_0x9031d4(0x1fe)](_0x3fbd5e[0x0])||_0x3fbd5e[0x0],_0x350f72=_0x74409d[_0x9031d4(0x1fe)](_0x33812c[0x0])||_0x33812c[0x0];return _0x3ae4b7[_0x9031d4(0x224)](_0x350f72,undefined,{'sensitivity':_0x9031d4(0x265)});});for(const [_0x2fae6f,_0xbd71ad]of _0x49c706){const _0x4079bd=_0x74409d[_0x4d29e0(0x1fe)](_0x2fae6f)||_0x2fae6f;console[_0x4d29e0(0x284)]('📁\x20'+_0x4079bd),_0xbd71ad[_0x4d29e0(0x21b)](_0x2cd5e8);for(const _0x385624 of _0xbd71ad){console[_0x4d29e0(0x284)](formatJourneyItem(_0x385624,'\x20\x20',_0x2451a1(_0x385624['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:view';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x26a);async[a28_0x8121c3(0x218)](_0x468cff){const _0x50198b=a28_0x8121c3,{options:_0x34e725,args:_0x1e818f,tdx:_0x5cc3db}=_0x468cff,_0x42d810=_0x1e818f[0x0];if(!_0x42d810)return console[_0x50198b(0x269)](_0x50198b(0x1cf)),console[_0x50198b(0x269)](_0x50198b(0x26f)),console[_0x50198b(0x269)](_0x50198b(0x1f7)),console[_0x50198b(0x269)](_0x50198b(0x2c9)),0x1;_0x34e725[_0x50198b(0x200)]&&console[_0x50198b(0x269)]('Input:\x20'+_0x42d810);const {journeyId:_0x54a756,parentSegmentId:_0x392c04}=await resolveJourneyIdFromInput(_0x42d810,_0x34e725,_0x5cc3db);if(_0x34e725[_0x50198b(0x246)]){const _0x3f30b3=getConsoleNextUrl(_0x34e725[_0x50198b(0x2a5)],_0x50198b(0x1d5)+_0x392c04+'/e/'+_0x54a756+_0x50198b(0x299));return console['error'](a28_0x302f34['green']('✔')+'\x20Opening\x20'+a28_0x302f34[_0x50198b(0x28c)](_0x3f30b3)),openBrowser(_0x3f30b3),0x0;}const _0x407c76=await withSpinner(_0x50198b(0x26b),()=>_0x5cc3db['journey'][_0x50198b(0x1d3)](_0x54a756),{'verbose':_0x34e725[_0x50198b(0x200)]}),_0x5bcdf1=_0x407c76['data'],_0x456dc7=_0x34e725[_0x50198b(0x213)];let _0x4693e7;if(_0x456dc7)try{const _0x152670=await withSpinner(_0x50198b(0x1ee),()=>_0x5cc3db[_0x50198b(0x29c)]['getStatistics'](_0x54a756),{'verbose':_0x34e725[_0x50198b(0x200)]});_0x4693e7=_0x152670[_0x50198b(0x22f)];}catch{_0x34e725['verbose']&&console[_0x50198b(0x269)](_0x50198b(0x291));}const _0x1f7739=getConsoleNextUrl(_0x34e725[_0x50198b(0x2a5)],_0x50198b(0x1d5)+_0x392c04+_0x50198b(0x1e7)+_0x54a756+_0x50198b(0x299)),_0x47b1a1={'id':_0x5bcdf1['id'],'name':_0x5bcdf1[_0x50198b(0x1eb)]['name'],'description':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x27d)],'state':_0x5bcdf1[_0x50198b(0x1eb)]['state'],'paused':_0x5bcdf1['attributes'][_0x50198b(0x1f6)],'reentry_mode':_0x5bcdf1['attributes'][_0x50198b(0x226)],'stages':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x278)]?.[_0x50198b(0x267)]||0x0,..._0x5bcdf1['attributes'][_0x50198b(0x249)]&&{'goal':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x249)][_0x50198b(0x29b)]},..._0x4693e7&&{'statistics':{'size':_0x4693e7[_0x50198b(0x227)],'entered':_0x4693e7[_0x50198b(0x20b)],'goal_achieved':_0x4693e7[_0x50198b(0x2b3)],'completion_rate':_0x4693e7[_0x50198b(0x1f4)],'exit_or_jump':_0x4693e7[_0x50198b(0x24a)],'exit_or_jump_rate':_0x4693e7[_0x50198b(0x28d)],'stages':_0x4693e7['stages']}},'url':_0x1f7739};return await handleSingleObjectOutput(_0x47b1a1,_0x34e725),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x2ae);[a28_0x8121c3(0x27d)]='Show\x20journey\x20statistics';async[a28_0x8121c3(0x218)](_0x184ad0){const _0xf3c551=a28_0x8121c3,{options:_0x125f12,args:_0x34ba27,tdx:_0x1eb1b1}=_0x184ad0,_0x152015=_0x34ba27[0x0];if(!requireNameOrPath(_0x152015))return 0x1;_0x125f12[_0xf3c551(0x200)]&&console[_0xf3c551(0x269)](_0xf3c551(0x29f)+_0x152015);const _0x3001a0=_0x125f12,_0x3611f1=_0x3001a0[_0xf3c551(0x26c)],_0x4c225d=_0x3001a0['to'],_0x5e7d27=_0x3001a0['includeHistory'],_0x3e97cb=_0x3001a0[_0xf3c551(0x241)];_0x5e7d27&&!_0x3611f1&&!_0x4c225d&&console[_0xf3c551(0x269)](_0xf3c551(0x250));const _0x5ed05d=_0x5e7d27?withJsonFormat(_0x125f12):_0x125f12,{journeyId:_0x524f0f,journeyName:_0x502a10}=await resolveJourneyIdFromInput(_0x152015,_0x5ed05d,_0x1eb1b1),_0x1b489a=_0x3611f1||_0x4c225d?{'from':_0x3611f1,'to':_0x4c225d}:undefined,_0x3d1aba=await withSpinner(_0xf3c551(0x1ee),()=>Promise[_0xf3c551(0x2a4)]([_0x1eb1b1[_0xf3c551(0x29c)][_0xf3c551(0x1d3)](_0x524f0f),_0x1eb1b1[_0xf3c551(0x29c)][_0xf3c551(0x1fc)](_0x524f0f,_0x1b489a)]),{'verbose':_0x5ed05d['verbose']}),[_0x491e70,_0x2f042f]=_0x3d1aba[_0xf3c551(0x22f)];if(!_0x2f042f||_0x2f042f[_0xf3c551(0x2aa)]===null)return console[_0xf3c551(0x269)](_0xf3c551(0x22c)+_0x502a10),console[_0xf3c551(0x269)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x26c006=buildStageNameMap(_0x491e70),_0x45f132=!!(_0x1b489a&&_0x2f042f[_0xf3c551(0x294)]?.[_0xf3c551(0x267)]),_0x8c6b9a={'stageNameMap':_0x26c006,'hasPeriod':_0x45f132,'includeHistory':!!_0x5e7d27};if(_0x3e97cb&&_0x2f042f[_0xf3c551(0x238)]){const _0x1a9bd3=_0x2f042f[_0xf3c551(0x238)][_0xf3c551(0x27e)](_0x453b5d=>{const _0xc9bfe3=_0xf3c551,_0x528656=_0x26c006[_0xc9bfe3(0x1fe)](_0x453b5d['id'])??'';return _0x528656['toLowerCase']()===_0x3e97cb[_0xc9bfe3(0x2a9)]();});if(_0x1a9bd3)return await handleSingleObjectOutput(formatStageStats(_0x1a9bd3,_0x8c6b9a),_0x5ed05d),0x0;const _0x260739=_0x2f042f[_0xf3c551(0x238)][_0xf3c551(0x20a)](_0x2e50d4=>_0x26c006['get'](_0x2e50d4['id'])??_0x2e50d4['id']);return console[_0xf3c551(0x269)](_0xf3c551(0x2a6)+_0x3e97cb+'\x22\x20not\x20found'),console[_0xf3c551(0x269)]('Available\x20stages:\x20'+_0x260739[_0xf3c551(0x2c2)](',\x20')),0x1;}const _0x3aab88=_0x2f042f['stages']?.[_0xf3c551(0x20a)](_0x35ae59=>formatStageStats(_0x35ae59,_0x8c6b9a)),_0x38966c=assembleJourneyStats(_0x2f042f,{'from':_0x3611f1,'to':_0x4c225d,'includeHistory':_0x5e7d27});return await this[_0xf3c551(0x23a)](_0x38966c,_0x3aab88??[],_0x5ed05d),0x0;}async[a28_0x8121c3(0x23a)](_0x36348a,_0x59c1c5,_0x2050c8){const _0x1494a5=a28_0x8121c3,_0x4bd49c=_0x2050c8['format']==='json'||_0x2050c8[_0x1494a5(0x2c6)]===_0x1494a5(0x1d0)||_0x2050c8['json']||_0x2050c8[_0x1494a5(0x1d0)];if(_0x4bd49c){_0x36348a[_0x1494a5(0x238)]=_0x59c1c5,await handleSingleObjectOutput(_0x36348a,_0x2050c8);return;}await handleSingleObjectOutput(_0x36348a,_0x2050c8);for(const _0x5ef6d0 of _0x59c1c5){console[_0x1494a5(0x284)](''),console[_0x1494a5(0x284)](String(a28_0x302f34[_0x1494a5(0x28c)][_0x1494a5(0x251)]('['+_0x5ef6d0[_0x1494a5(0x29b)]+']'))+a28_0x302f34[_0x1494a5(0x26e)]('\x20'+_0x5ef6d0['id']));const {id:_0x5e3082,name:_0x191461,..._0x50f1da}=_0x5ef6d0;await handleSingleObjectOutput(_0x50f1da,_0x2050c8);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x297);[a28_0x8121c3(0x27d)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x8121c3(0x218)](_0x5129bd){const _0x55f6d9=a28_0x8121c3,{options:_0x5b48dc,args:_0x20db8e,tdx:_0x33dac8}=_0x5129bd,_0x3e8454=_0x20db8e[0x0];if(!requireNameOrPath(_0x3e8454))return 0x1;_0x5b48dc[_0x55f6d9(0x200)]&&console[_0x55f6d9(0x269)]('Input:\x20'+_0x3e8454);const _0x3973e9=_0x5b48dc,_0xc60782=_0x3973e9[_0x55f6d9(0x28a)],_0x4ce6d7=_0x3973e9[_0x55f6d9(0x26c)],_0xa711e6=_0x3973e9['to'],_0x20421f=_0x3973e9[_0x55f6d9(0x254)];if(_0xc60782&&_0xc60782!==_0x55f6d9(0x2bf)&&_0xc60782!=='activation')return console['error'](_0x55f6d9(0x24c)+_0xc60782+_0x55f6d9(0x222)),0x1;const _0xdf27a=withJsonFormat(_0x5b48dc),{journeyId:_0x49a1d5,journeyName:_0x4e1edd}=await resolveJourneyIdFromInput(_0x3e8454,_0xdf27a,_0x33dac8),_0x40e753={'type':_0xc60782,'from':_0x4ce6d7,'to':_0xa711e6,'limit':_0x20421f},_0x37ba18=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x33dac8[_0x55f6d9(0x29c)][_0x55f6d9(0x298)](_0x49a1d5,_0x40e753),{'verbose':_0xdf27a[_0x55f6d9(0x200)]}),_0x311cf4=_0x37ba18[_0x55f6d9(0x22f)],_0x2af6a7=_0x311cf4[_0x55f6d9(0x2bf)]&&(_0x311cf4[_0x55f6d9(0x2bf)][_0x55f6d9(0x281)][_0x55f6d9(0x267)]>0x0||_0x311cf4['conversion'][_0x55f6d9(0x2be)][_0x55f6d9(0x267)]>0x0),_0x53ebb2=_0x311cf4['activation']&&_0x311cf4[_0x55f6d9(0x1d1)][_0x55f6d9(0x267)]>0x0;if(!_0x2af6a7&&!_0x53ebb2)return console['error'](_0x55f6d9(0x244)+_0x4e1edd),console[_0x55f6d9(0x269)](_0x55f6d9(0x2c7)),_0x4ce6d7&&_0xa711e6&&console[_0x55f6d9(0x269)](_0x55f6d9(0x1f0)),0x0;return await handleSingleObjectOutput(_0x311cf4,_0xdf27a),0x0;}}function formatStageStats(_0x405f82,_0x3a6908){const _0x5a3919=a28_0x8121c3,_0x6befed=_0x3a6908[_0x5a3919(0x279)]&&_0x405f82[_0x5a3919(0x294)]?.[_0x5a3919(0x267)]?aggregateStageHistory(_0x405f82[_0x5a3919(0x294)]):{'size':_0x405f82[_0x5a3919(0x227)],'entered':_0x405f82[_0x5a3919(0x20b)],'milestone':_0x405f82[_0x5a3919(0x206)],'milestone_rate':_0x405f82[_0x5a3919(0x273)],'exit_or_jump':_0x405f82[_0x5a3919(0x24a)],'exit_or_jump_rate':_0x405f82[_0x5a3919(0x28d)]},_0xdcec5c={'id':_0x405f82['id'],'name':_0x3a6908[_0x5a3919(0x1fd)]['get'](_0x405f82['id'])??_0x405f82['id'],..._0x6befed};return _0x3a6908[_0x5a3919(0x279)]&&_0x3a6908['includeHistory']&&_0x405f82['history']&&(_0xdcec5c['history']=_0x405f82['history']),_0xdcec5c;}export class JourneyPauseCommand extends BaseCommand{['name']=a28_0x8121c3(0x225);[a28_0x8121c3(0x27d)]='Pause\x20a\x20running\x20journey';async['execute'](_0x464b39){const _0x143dbb=a28_0x8121c3,{options:_0x2f217e,args:_0x5df915,tdx:_0x591f85}=_0x464b39,_0x36342b=_0x5df915[0x0];if(!requireNameOrPath(_0x36342b))return 0x1;_0x2f217e[_0x143dbb(0x200)]&&console[_0x143dbb(0x269)](_0x143dbb(0x29f)+_0x36342b);const {journeyId:_0x2fb911,journeyName:_0x57438e}=await resolveJourneyIdFromInput(_0x36342b,_0x2f217e,_0x591f85);if(!_0x2f217e[_0x143dbb(0x1e6)]){const _0x3cadce=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x57438e+'\x22?');if(!_0x3cadce)return console['error']('Cancelled'),0x0;}const _0x2701ee=await withSpinner(_0x143dbb(0x270),()=>_0x591f85[_0x143dbb(0x29c)][_0x143dbb(0x293)](_0x2fb911),{'verbose':_0x2f217e[_0x143dbb(0x200)]}),_0x1a7872=_0x2701ee[_0x143dbb(0x22f)];return console['error'](_0x143dbb(0x24f)+_0x1a7872[_0x143dbb(0x1eb)][_0x143dbb(0x29b)]+_0x143dbb(0x1ca)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:resume';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x215);async[a28_0x8121c3(0x218)](_0x472298){const _0x7f3887=a28_0x8121c3,{options:_0x6328a6,args:_0x2f7abe,tdx:_0x1c836d}=_0x472298,_0x3085d4=_0x2f7abe[0x0];if(!requireNameOrPath(_0x3085d4))return 0x1;_0x6328a6[_0x7f3887(0x200)]&&console[_0x7f3887(0x269)](_0x7f3887(0x29f)+_0x3085d4);const {journeyId:_0x43f7db,journeyName:_0x18abe3}=await resolveJourneyIdFromInput(_0x3085d4,_0x6328a6,_0x1c836d);if(!_0x6328a6[_0x7f3887(0x1e6)]){const _0x817a37=await confirm(_0x7f3887(0x286)+_0x18abe3+'\x22?');if(!_0x817a37)return console[_0x7f3887(0x269)](_0x7f3887(0x2a2)),0x0;}const _0x375f2f=await withSpinner('Resuming\x20journey...',()=>_0x1c836d[_0x7f3887(0x29c)][_0x7f3887(0x239)](_0x43f7db),{'verbose':_0x6328a6[_0x7f3887(0x200)]}),_0x53e536=_0x375f2f[_0x7f3887(0x22f)];return console['error'](_0x7f3887(0x24f)+_0x53e536[_0x7f3887(0x1eb)]['name']+_0x7f3887(0x229)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x261);[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x203);async['execute'](_0x3aa9c2){const _0x16baf0=a28_0x8121c3,{options:_0x22f106,args:_0x4275eb,tdx:_0x1c6ff0}=_0x3aa9c2,_0x174d81=_0x22f106,_0x2cb844=_0x4275eb[0x0],_0x3c129e=_0x2cb844&&isYamlFilePath(_0x2cb844),_0xb69cb8=await resolveTarget({'arg':_0x3c129e?_0x2cb844:undefined,'contextParent':_0x22f106['parentSegment'],'cwd':process[_0x16baf0(0x25c)]()});if(!isSuccessfulResolution(_0xb69cb8))return _0xb69cb8[_0x16baf0(0x24e)]===_0x16baf0(0x28b)?(console['error'](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x20f))),console[_0x16baf0(0x269)]('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)'),console[_0x16baf0(0x269)](_0x16baf0(0x288)),console['error'](_0x16baf0(0x25e)),console[_0x16baf0(0x269)](_0x16baf0(0x210))):(console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1df)](_0x16baf0(0x26d)+_0xb69cb8[_0x16baf0(0x2ca)]+'\x0a')),_0xb69cb8['helpText']&&console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x28c)](_0xb69cb8[_0x16baf0(0x1cb)]))),0x1;let _0x102905=_0x3c129e?undefined:_0x2cb844,_0x42ab65,_0x4e88c4;_0xb69cb8[_0x16baf0(0x28a)]===_0x16baf0(0x2ba)&&(_0x102905=_0xb69cb8[_0x16baf0(0x1e1)],_0x42ab65=_0xb69cb8[_0x16baf0(0x252)],_0x4e88c4=_0xb69cb8[_0x16baf0(0x1dd)]);const _0x15c4ad=_0xb69cb8[_0x16baf0(0x2a3)],_0x5cad98=_0xb69cb8[_0x16baf0(0x2b0)];_0x174d81[_0x16baf0(0x200)]&&(console[_0x16baf0(0x269)]('Parent\x20segment:\x20'+_0x15c4ad),console['error'](_0x16baf0(0x28f)+_0x5cad98),_0x102905&&console[_0x16baf0(0x269)]('Journey\x20name:\x20'+_0x102905),_0x42ab65&&console['error']('Target\x20file:\x20'+_0x42ab65),_0x4e88c4&&console['error'](_0x16baf0(0x202)+_0x4e88c4));const _0x14a0d3=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x1c6ff0[_0x16baf0(0x2ac)][_0x16baf0(0x1fb)](_0x15c4ad),{'verbose':_0x22f106[_0x16baf0(0x200)]}),_0xd2addd=_0x14a0d3[_0x16baf0(0x22f)],{journeys:_0xe27630,folders:_0x48e964}=await withSpinner(_0x16baf0(0x2bd),async()=>{const _0x2c7608=_0x16baf0,[_0x3d62c5,_0x42f65f]=await Promise[_0x2c7608(0x2a4)]([_0x1c6ff0[_0x2c7608(0x29c)]['listJourneysFromParentSegment'](_0xd2addd,undefined,{'includeAllVersions':!![]}),_0x1c6ff0[_0x2c7608(0x2ac)]['listFolders'](_0xd2addd)]);return{'journeys':_0x3d62c5,'folders':_0x42f65f};},{'verbose':_0x22f106[_0x16baf0(0x200)]})[_0x16baf0(0x27a)](_0x491af3=>_0x491af3[_0x16baf0(0x22f)]);let _0x28a983=_0xe27630;const _0x5a6313=buildFolderIdToPathMap(_0x48e964);if(_0x102905){const _0x338960=_0x28a983[_0x16baf0(0x280)](_0x4b5012=>_0x4b5012[_0x16baf0(0x219)][_0x16baf0(0x2a9)]()===_0x102905[_0x16baf0(0x2a9)]());if(_0x338960['length']===0x0)return console[_0x16baf0(0x269)](_0x16baf0(0x29a)+_0x102905),console[_0x16baf0(0x269)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x28a983=_0x338960;}if(_0x4e88c4!==undefined){const _0x2d812a=_0x28a983[_0x16baf0(0x280)](_0x358145=>{const _0x2ed7b7=_0x16baf0,_0x4b6149=_0x358145[_0x2ed7b7(0x1f9)]?_0x5a6313[_0x2ed7b7(0x1fe)](_0x358145['folderId'])||'':'';return _0x4b6149===_0x4e88c4;});if(_0x2d812a[_0x16baf0(0x267)]===0x0&&_0x28a983[_0x16baf0(0x267)]>0x0){console[_0x16baf0(0x269)](_0x16baf0(0x23e)+_0x102905+_0x16baf0(0x2a1)+(_0x4e88c4||'root\x20folder')),console['error'](_0x16baf0(0x245));for(const _0x2fdf29 of _0x28a983){const _0x2ebe1b=_0x2fdf29[_0x16baf0(0x1f9)]?_0x5a6313[_0x16baf0(0x1fe)](_0x2fdf29['folderId'])||'':'';console['error'](_0x16baf0(0x21f)+(_0x2ebe1b||_0x16baf0(0x1d2))+'/'+_0x2fdf29[_0x16baf0(0x219)]);}return 0x1;}_0x28a983=_0x2d812a;}if(_0x28a983[_0x16baf0(0x267)]===0x0)return console[_0x16baf0(0x269)]('No\x20journeys\x20found'),0x0;const _0x2c2c15=new Map();for(const _0x409348 of _0x28a983){const _0x29c7a6=_0x409348[_0x16baf0(0x25a)];!_0x2c2c15[_0x16baf0(0x263)](_0x29c7a6)&&_0x2c2c15[_0x16baf0(0x296)](_0x29c7a6,[]),_0x2c2c15[_0x16baf0(0x1fe)](_0x29c7a6)[_0x16baf0(0x205)](_0x409348);}for(const _0x31f10a of _0x2c2c15[_0x16baf0(0x207)]()){_0x31f10a[_0x16baf0(0x21b)]((_0x3e7339,_0x304884)=>(_0x3e7339[_0x16baf0(0x1ec)]||0x0)-(_0x304884['versionNumber']||0x0));}const _0x4b89a9=[],{idToEmailMap:_0xedb31b,connectionIdToNameMap:_0x505950}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0xdc2be3=_0x16baf0,[_0x3f7368,_0x5477aa]=await Promise[_0xdc2be3(0x2a4)]([_0x1c6ff0[_0xdc2be3(0x1e5)][_0xdc2be3(0x22a)](),_0x1c6ff0[_0xdc2be3(0x255)][_0xdc2be3(0x21d)]()]);return{'idToEmailMap':_0x3f7368,'connectionIdToNameMap':_0x5477aa};},{'verbose':_0x22f106[_0x16baf0(0x200)]})[_0x16baf0(0x27a)](_0x3f5159=>_0x3f5159['data']);for(const _0x20ac2e of _0x2c2c15[_0x16baf0(0x207)]()){const _0x41b9ba=_0x20ac2e[0x0][_0x16baf0(0x219)],_0x53c17a=_0x20ac2e[0x0]['folderId'],_0x25524a=_0x53c17a?_0x5a6313[_0x16baf0(0x1fe)](_0x53c17a)||'':'',_0x260ce8=_0x25524a?a28_0x1221b1[_0x16baf0(0x2c2)](_0x5cad98,_0x25524a):_0x5cad98,_0x1a16f3=_0x42ab65||a28_0x1221b1[_0x16baf0(0x2c2)](_0x260ce8,sanitizeFileName(_0x41b9ba)+'.yml');let _0x42729c,_0x531252;if(existsSync(_0x1a16f3))try{const _0x39530b=readFileSync(_0x1a16f3,_0x16baf0(0x290)),_0x25d8a4=parseYamlString(_0x39530b);_0x531252=_0x25d8a4,_0x42729c=buildRuleToNameMapping(_0x25d8a4),_0x174d81['verbose']&&_0x42729c['size']>0x0&&console[_0x16baf0(0x269)]('Found\x20'+_0x42729c[_0x16baf0(0x227)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x41b9ba);}catch(_0x28feb1){_0x174d81[_0x16baf0(0x200)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x28feb1[_0x16baf0(0x2ca)]);}const _0x11e0ec=[],_0x5036b0=new Set(),_0x5d7089=new Map(),_0x2c0f2a=new Map(),_0x1f554a=new Set(),_0x4a91e6=new Map(),_0x1b484c=new Map(),_0x5be43f=createJumpTargetCache();await withProgressSpinner(_0x16baf0(0x2c3)+_0x41b9ba+'...',async _0x542e12=>{const _0x28f0c3=_0x16baf0;for(const _0x26dc6e of _0x20ac2e){const _0x42c7df=_0x20ac2e['length']>0x1?_0x26dc6e[_0x28f0c3(0x219)]+'\x20v'+(_0x26dc6e[_0x28f0c3(0x1ec)]||0x1):_0x26dc6e['journeyBundleName'];_0x542e12[_0x28f0c3(0x217)]('Fetching\x20'+_0x42c7df);const _0x50ff9a=await _0x1c6ff0[_0x28f0c3(0x29c)][_0x28f0c3(0x1d3)](_0x26dc6e['id']),_0x4f3f47=_0x50ff9a[_0x28f0c3(0x1eb)]?.[_0x28f0c3(0x2a0)],_0xce222a={'resolveSegment':async _0x19dfbd=>{const _0x44777a=_0x28f0c3;if(!_0x4f3f47)return{'name':_0x19dfbd,'isJourneyLocal':![]};const _0x4b932b=_0x5d7089['get'](_0x19dfbd);if(_0x4b932b)return _0x4b932b;try{const _0x38e7dc=await _0x1c6ff0['segment'][_0x44777a(0x272)](_0x4f3f47,_0x19dfbd),_0x4a9b55=_0x38e7dc['kind']===SEGMENT_KIND_JOURNEY;let _0x5606ab,_0x179655=_0x38e7dc[_0x44777a(0x29b)];if(_0x4a9b55&&_0x38e7dc['rule']){const _0x45ef98=await segmentResponseToDef(_0x38e7dc,{'resolveSegmentName':async _0x5643d0=>{const _0x5cf244=_0x44777a,_0xe3f62d=_0x5d7089[_0x5cf244(0x1fe)](_0x5643d0);if(_0xe3f62d)return _0xe3f62d[_0x5cf244(0x29b)];const _0x18be7b=await _0xce222a[_0x5cf244(0x23d)](_0x5643d0);return _0x18be7b[_0x5cf244(0x29b)];}}),_0x119b38=_0x45ef98['rule'];_0x5606ab={'description':_0x38e7dc['description'],'rule':_0x119b38};const _0x4c2e9=serializeRule(_0x119b38),_0x475dda=_0x2c0f2a['get'](_0x4c2e9);if(_0x475dda)_0x179655=_0x475dda,_0x5606ab=undefined,_0x174d81[_0x44777a(0x200)]&&console[_0x44777a(0x269)](_0x44777a(0x22e)+_0x38e7dc[_0x44777a(0x29b)]+_0x44777a(0x2ad)+_0x475dda);else{let _0x3f79b4=![];if(_0x42729c){const _0x1bef58=_0x42729c[_0x44777a(0x1fe)](_0x4c2e9);if(_0x1bef58){const _0x2422c3=_0x1bef58[_0x44777a(0x27e)](_0x5b5125=>!_0x5036b0[_0x44777a(0x263)](_0x5b5125));_0x2422c3&&(_0x179655=_0x2422c3,_0x5036b0[_0x44777a(0x1f8)](_0x2422c3),_0x2c0f2a[_0x44777a(0x296)](_0x4c2e9,_0x2422c3),_0x3f79b4=!![],_0x174d81[_0x44777a(0x200)]&&console[_0x44777a(0x269)](_0x44777a(0x24d)+_0x2422c3+'\x20(rule\x20match)'));}}if(!_0x3f79b4){const _0x309c87=generateJourneyLocalName(_0x38e7dc[_0x44777a(0x29b)]);_0x309c87&&(_0x179655=_0x309c87);let _0x1c7194=_0x179655,_0x4964e7=0x2;while(_0x5036b0[_0x44777a(0x263)](_0x1c7194)){_0x1c7194=_0x179655+'_'+_0x4964e7,_0x4964e7++;}_0x5036b0[_0x44777a(0x1f8)](_0x1c7194),_0x2c0f2a['set'](_0x4c2e9,_0x1c7194),_0x179655=_0x1c7194;}}}const _0x1da7e0={'name':_0x179655,'isJourneyLocal':_0x4a9b55,'definition':_0x5606ab};return _0x5d7089['set'](_0x19dfbd,_0x1da7e0),_0x1da7e0;}catch(_0x1985f9){return _0x22f106['verbose']&&console[_0x44777a(0x269)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x19dfbd+':\x20'+_0x1985f9[_0x44777a(0x2ca)]),{'name':_0x19dfbd,'isJourneyLocal':![]};}},'resolveActivation':async _0x1dd663=>{const _0x10941d=_0x28f0c3,_0x5996fb=_0x4a91e6[_0x10941d(0x1fe)](_0x1dd663);if(_0x5996fb)return _0x5996fb;try{const _0x31a54d=await _0x1c6ff0['journey']['getActivation'](_0x26dc6e['id'],_0x1dd663),_0x322cda=journeyActivationStepToYaml(_0x31a54d,_0xedb31b,_0x505950),_0x45c858=JSON['stringify']({'name':_0x322cda[_0x10941d(0x29b)],'connection':_0x322cda[_0x10941d(0x255)],'connector_config':_0x322cda[_0x10941d(0x264)]}),_0x59c80f=_0x1b484c['get'](_0x45c858);if(_0x59c80f){const _0x33bf96={'name':_0x59c80f,'isJourneyLocal':!![],'definition':_0x322cda};return _0x4a91e6[_0x10941d(0x296)](_0x1dd663,_0x33bf96),_0x33bf96;}const _0x2243be=_0x31a54d[_0x10941d(0x1eb)]['activationParams'][_0x10941d(0x29b)]||_0x1dd663,_0x5ec699=sanitizeYamlKey(_0x2243be)||_0x10941d(0x1e8)+_0x1dd663;let _0x53761c=_0x5ec699,_0x1da8fa=0x2;while(_0x1f554a[_0x10941d(0x263)](_0x53761c)){_0x53761c=_0x5ec699+'_'+_0x1da8fa,_0x1da8fa++;}_0x1f554a[_0x10941d(0x1f8)](_0x53761c),_0x1b484c[_0x10941d(0x296)](_0x45c858,_0x53761c);const _0x216877={'name':_0x53761c,'isJourneyLocal':!![],'definition':_0x322cda};return _0x4a91e6[_0x10941d(0x296)](_0x1dd663,_0x216877),_0x216877;}catch(_0x1d54db){return _0x22f106['verbose']&&console[_0x10941d(0x269)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x1dd663+':\x20'+_0x1d54db[_0x10941d(0x2ca)]),{'name':_0x1dd663,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5c9482,_0x2ac975)=>{const _0x58f23a=_0x28f0c3;return resolveJumpTarget(_0x5c9482,_0x2ac975,_0x5be43f,_0x5d6b6d=>_0x1c6ff0[_0x58f23a(0x29c)][_0x58f23a(0x1d3)](_0x5d6b6d));}},_0x429618=await journeyResponseToDef(_0x50ff9a,_0xce222a);_0x11e0ec[_0x28f0c3(0x205)]({'item':_0x26dc6e,'yaml':_0x429618});}},{'verbose':_0x22f106['verbose']});const _0x5f34e0=await _0x1c6ff0[_0x16baf0(0x29c)][_0x16baf0(0x1f3)](_0x20ac2e[0x0]['journeyBundleId']),_0x71bcf1=buildMergedJourneyDef(_0x11e0ec,_0x42729c,_0x5f34e0),_0x162efb=normalizeJourneyDef(_0x71bcf1,_0x531252),_0x5c4fe2=toYamlString(_0x162efb),_0x3a796d=_0x42ab65||a28_0x1221b1[_0x16baf0(0x2c2)](_0x260ce8,sanitizeFileName(_0x41b9ba)+'.yml');!_0x42ab65&&_0x25524a&&!existsSync(_0x260ce8)&&mkdirSync(_0x260ce8,{'recursive':!![]});const _0x4f7883=a28_0x1221b1['relative'](process[_0x16baf0(0x25c)](),_0x3a796d);if(existsSync(_0x3a796d)){const _0x2655fe=readFileSync(_0x3a796d,_0x16baf0(0x290)),_0x219c30=generateDiff(_0x2655fe,_0x5c4fe2),_0x2b3631=hasChanges(_0x219c30);_0x4b89a9['push']({'relativePath':_0x4f7883,'absolutePath':_0x3a796d,'content':_0x5c4fe2,'isNew':![],'hasChanges':_0x2b3631,'diff':_0x2b3631?formatDiffWithColors(_0x219c30):undefined});}else _0x4b89a9[_0x16baf0(0x205)]({'relativePath':_0x4f7883,'absolutePath':_0x3a796d,'content':_0x5c4fe2,'isNew':!![],'hasChanges':![]});}const _0xb57cf9=_0x4b89a9[_0x16baf0(0x280)](_0x147301=>_0x147301['isNew']),_0x5d4e70=_0x4b89a9[_0x16baf0(0x280)](_0x1fd168=>!_0x1fd168[_0x16baf0(0x1f1)]&&_0x1fd168['hasChanges']),_0x518b5f=_0x4b89a9[_0x16baf0(0x280)](_0x4b42cf=>!_0x4b42cf[_0x16baf0(0x1f1)]&&!_0x4b42cf[_0x16baf0(0x204)]),_0x578ffd=_0x28a983[_0x16baf0(0x267)],_0x3133b1=_0x2c2c15[_0x16baf0(0x227)],_0x1b2478=_0x578ffd>_0x3133b1?'\x20('+_0x578ffd+_0x16baf0(0x287):'';console[_0x16baf0(0x269)](_0x16baf0(0x285)),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34['cyan'](_0x3133b1+'\x20journeys')+a28_0x302f34[_0x16baf0(0x26e)](_0x1b2478)),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x1db)]('+\x20'+_0xb57cf9['length']+_0x16baf0(0x2c8))),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x236)]('~\x20'+_0x5d4e70[_0x16baf0(0x267)]+'\x20changed\x20files')),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x26e)]('=\x20'+_0x518b5f[_0x16baf0(0x267)]+_0x16baf0(0x2c5))),console[_0x16baf0(0x269)]('\x20\x20Target:\x20'+a28_0x302f34[_0x16baf0(0x28c)](_0x5cad98)+'\x0a');if(_0x5d4e70[_0x16baf0(0x267)]>0x0)for(const _0x27579a of _0x5d4e70){console['error'](_0x16baf0(0x1d6)+_0x27579a[_0x16baf0(0x25f)]+'\x27:'),console[_0x16baf0(0x269)]('─'[_0x16baf0(0x1f2)](0x3c)),console[_0x16baf0(0x269)](_0x27579a['diff']),console[_0x16baf0(0x269)]('─'[_0x16baf0(0x1f2)](0x3c));}if(_0x174d81[_0x16baf0(0x292)])return console['error'](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x253))),0x0;if(_0xb57cf9['length']===0x0&&_0x5d4e70['length']===0x0)return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x216))),saveSessionContext({'parent_segment':_0x15c4ad},_0x174d81['session']),console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x20d)+a28_0x302f34[_0x16baf0(0x26e)](_0x16baf0(0x25d))+_0x16baf0(0x275)+a28_0x302f34[_0x16baf0(0x28c)](_0x15c4ad))),0x0;if(!_0x174d81[_0x16baf0(0x1e6)]&&(_0xb57cf9['length']>0x0||_0x5d4e70[_0x16baf0(0x267)]>0x0)){if(!isInteractive())return console['error'](a28_0x302f34[_0x16baf0(0x1df)](_0x16baf0(0x2b6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a28_0x302f34[_0x16baf0(0x26e)](_0x16baf0(0x211))),0x1;const _0x430957=await confirmKey(_0x16baf0(0x1ed)+(_0xb57cf9[_0x16baf0(0x267)]+_0x5d4e70[_0x16baf0(0x267)])+_0x16baf0(0x27b));if(!_0x430957)return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x20c)),_0x16baf0(0x1d8)),0x1;}!existsSync(_0x5cad98)&&mkdirSync(_0x5cad98,{'recursive':!![]});const _0x10135d=a28_0x1221b1[_0x16baf0(0x2c2)](_0x5cad98,_0x16baf0(0x1d7));writeFileSync(_0x10135d,createTdxConfigContent(_0x15c4ad),_0x16baf0(0x290));for(const _0x24d906 of _0x4b89a9){(_0x24d906[_0x16baf0(0x1f1)]||_0x24d906[_0x16baf0(0x204)])&&writeFileSync(_0x24d906['absolutePath'],_0x24d906[_0x16baf0(0x2c4)],'utf-8');}return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x228)+(_0xb57cf9[_0x16baf0(0x267)]+_0x5d4e70[_0x16baf0(0x267)])+'\x20journey\x20files\x20to\x20'+_0x5cad98)),saveSessionContext({'parent_segment':_0x15c4ad},_0x174d81['session']),console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)]('✔\x20Context\x20set:\x20'+a28_0x302f34['dim'](_0x16baf0(0x25d))+_0x16baf0(0x275)+a28_0x302f34[_0x16baf0(0x28c)](_0x15c4ad))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:columns';['description']=a28_0x8121c3(0x208);async['execute'](_0x3a4598){const _0x2ea626=a28_0x8121c3,{options:_0x105fce,args:_0x8cd976,tdx:_0x17a7d5}=_0x3a4598,_0x18fbbc=_0x8cd976[0x0];if(!requireNameOrPath(_0x18fbbc))return 0x1;_0x105fce[_0x2ea626(0x200)]&&console['error'](_0x2ea626(0x29f)+_0x18fbbc);const {journeyId:_0x5b5ed0}=await resolveJourneyIdFromInput(_0x18fbbc,_0x105fce,_0x17a7d5),_0x2caf00=await withSpinner(_0x2ea626(0x214),()=>_0x17a7d5[_0x2ea626(0x29c)][_0x2ea626(0x234)](_0x5b5ed0),{'verbose':_0x105fce['verbose']}),_0xe1741d=_0x2caf00['data'];return console[_0x2ea626(0x284)](_0x2ea626(0x2b8)+_0xe1741d['database']),console[_0x2ea626(0x284)]('Table:\x20'+_0xe1741d[_0x2ea626(0x23f)]),await handleSDKOutput(_0xe1741d['columns'],_0x105fce),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x1f5);['description']='List\x20activations\x20for\x20a\x20journey';async['execute'](_0xc0b104){const _0xef6335=a28_0x8121c3,{options:_0x70b25a,args:_0x177bcd,tdx:_0x31e188}=_0xc0b104,_0x4c3455=_0x177bcd[0x0];if(!requireNameOrPath(_0x4c3455))return 0x1;_0x70b25a[_0xef6335(0x200)]&&console[_0xef6335(0x269)](_0xef6335(0x29f)+_0x4c3455);const {journeyId:_0x251ce2}=await resolveJourneyIdFromInput(_0x4c3455,_0x70b25a,_0x31e188),_0x5147fc=await withSpinner('Listing\x20journey\x20activations...',()=>_0x31e188[_0xef6335(0x29c)][_0xef6335(0x221)](_0x251ce2),{'verbose':_0x70b25a[_0xef6335(0x200)]}),_0x49b36d=_0x5147fc[_0xef6335(0x22f)];return console[_0xef6335(0x269)]('Found\x20'+_0x49b36d[_0xef6335(0x267)]+'\x20activation'+(_0x49b36d[_0xef6335(0x267)]!==0x1?'s':'')),await handleSDKOutput(_0x49b36d,_0x70b25a),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x295);['description']=a28_0x8121c3(0x21c);[a28_0x8121c3(0x1ce)]=new SegmentPushCommand();async[a28_0x8121c3(0x218)](_0x184fed){const _0x5970bb=a28_0x8121c3,_0x55ebee=_0x184fed[_0x5970bb(0x1e4)][0x0];let _0x16ddc6;if(_0x55ebee){const _0x4e2afb=await resolveTarget({'arg':_0x55ebee,'contextParent':_0x184fed[_0x5970bb(0x240)][_0x5970bb(0x233)],'cwd':process[_0x5970bb(0x25c)]()});isSuccessfulResolution(_0x4e2afb)&&_0x4e2afb['type']===_0x5970bb(0x2ba)&&(_0x16ddc6=_0x4e2afb[_0x5970bb(0x252)]);}const _0x5bc085={..._0x184fed,'options':{..._0x184fed[_0x5970bb(0x240)],'journeysOnly':!![],..._0x16ddc6&&{'singleFilePath':_0x16ddc6}}};return this['segmentPushCommand']['execute'](_0x5bc085);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x22d);[a28_0x8121c3(0x27d)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a28_0x8121c3(0x218)](_0x49f404){const _0x311013=a28_0x8121c3,{options:_0x2ce19d,args:_0x1cfd6e,tdx:_0x46f95c}=_0x49f404,_0xa4c23e=_0x1cfd6e[0x0];if(!requireNameOrPath(_0xa4c23e))return 0x1;if(_0x2ce19d['verbose'])console[_0x311013(0x269)](_0x311013(0x29f)+_0xa4c23e);const {journeyId:_0x5ded7c}=await resolveJourneyIdFromInput(_0xa4c23e,_0x2ce19d,_0x46f95c),_0x298bfe=await withSpinner(_0x311013(0x237),()=>_0x46f95c[_0x311013(0x29c)][_0x311013(0x21e)](_0x5ded7c),{'verbose':_0x2ce19d[_0x311013(0x200)]}),{bundleName:_0x1c8330,versions:_0x1a3852,latestJourneyId:_0x39fed4}=_0x298bfe[_0x311013(0x22f)];console['error'](_0x1c8330+':\x20'+_0x1a3852[_0x311013(0x267)]+_0x311013(0x1e9)+(_0x1a3852[_0x311013(0x267)]!==0x1?'s':''));const _0x3acdc0=_0x1a3852[_0x311013(0x20a)](_0x1434d3=>({'version':_0x1434d3[_0x311013(0x1ec)],'journey_id':_0x1434d3[_0x311013(0x2aa)],'name':_0x1434d3[_0x311013(0x29b)],'state':_0x1434d3[_0x311013(0x2bb)],'paused':_0x1434d3[_0x311013(0x1f6)],'latest':_0x1434d3[_0x311013(0x2aa)]===_0x39fed4,'created_at':_0x1434d3[_0x311013(0x258)]}));return await handleSDKOutput(_0x3acdc0,_0x2ce19d),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x23c);[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x242);async[a28_0x8121c3(0x218)](_0x1afee5){const _0x4d927b=a28_0x8121c3,{options:_0x3afe97,args:_0x40abc0,tdx:_0x26cb13}=_0x1afee5,_0x110008=_0x40abc0[0x0];if(!requireNameOrPath(_0x110008))return 0x1;if(_0x3afe97[_0x4d927b(0x200)])console[_0x4d927b(0x269)](_0x4d927b(0x29f)+_0x110008);const {journeyId:_0x193cf4,journeyName:_0x13405b}=await resolveJourneyIdFromInput(_0x110008,_0x3afe97,_0x26cb13);if(!_0x3afe97[_0x4d927b(0x1e6)]){const _0x392019=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x13405b+'\x22?');if(!_0x392019)return console['error'](_0x4d927b(0x2a2)),0x0;}const _0x507381=await withSpinner('Creating\x20new\x20version...',()=>_0x26cb13['journey'][_0x4d927b(0x1ff)](_0x193cf4),{'verbose':_0x3afe97[_0x4d927b(0x200)]}),_0x1787d7=_0x507381[_0x4d927b(0x22f)];return console[_0x4d927b(0x269)](a28_0x302f34[_0x4d927b(0x1db)]('✔')+'\x20Created\x20v'+_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x1ec)]+'\x20(draft)\x20—\x20\x22'+_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x29b)]+'\x22'),console['error'](_0x4d927b(0x1e0)+_0x1787d7['id']),await handleSingleObjectOutput({'id':_0x1787d7['id'],'name':_0x1787d7[_0x4d927b(0x1eb)]['name'],'version':_0x1787d7[_0x4d927b(0x1eb)]['versionNumber'],'state':_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x2bb)],'bundle_id':_0x1787d7[_0x4d927b(0x1eb)]['journeyBundleId'],'created_at':_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x258)]},_0x3afe97),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x282);async['execute'](_0x261c93){const _0x485edb=a28_0x8121c3,{options:_0x167bcb,args:_0x4649a5,tdx:_0x19001b}=_0x261c93,_0x587b0c=_0x4649a5[0x0];if(!requireNameOrPath(_0x587b0c))return 0x1;const _0x594ff4=_0x167bcb[_0x485edb(0x262)];if(!_0x594ff4)return console[_0x485edb(0x269)](_0x485edb(0x21a)),console['error'](_0x485edb(0x232)),0x1;const _0x57b134=parseInt(_0x594ff4,0xa);if(isNaN(_0x57b134)||_0x57b134<0x1)return console[_0x485edb(0x269)](_0x485edb(0x220)+_0x594ff4),0x1;if(_0x167bcb['verbose'])console[_0x485edb(0x269)](_0x485edb(0x29f)+_0x587b0c+_0x485edb(0x2c0)+_0x57b134);const {journeyId:_0x5d9ef8,parentSegmentId:_0x30d4e8}=await resolveJourneyIdFromInput(_0x587b0c,_0x167bcb,_0x19001b),_0x58d412=await withSpinner(_0x485edb(0x25b),()=>_0x19001b['journey']['listVersions'](_0x5d9ef8),{'verbose':_0x167bcb[_0x485edb(0x200)]}),{versions:_0x3372b8,latestJourneyId:_0xd51f57}=_0x58d412[_0x485edb(0x22f)],_0x10ea4a=_0x3372b8['find'](_0x36b257=>_0x36b257['versionNumber']===_0x57b134);if(!_0x10ea4a){const _0x5b50ba=_0x3372b8['map'](_0x25733e=>'v'+_0x25733e[_0x485edb(0x1ec)])[_0x485edb(0x2c2)](',\x20');return console[_0x485edb(0x269)](_0x485edb(0x223)+_0x57b134+_0x485edb(0x2ab)+_0x5b50ba),0x1;}const _0x4e754c=await withSpinner('Getting\x20version\x20'+_0x57b134+'\x20details...',()=>_0x19001b['journey'][_0x485edb(0x1d3)](_0x10ea4a[_0x485edb(0x2aa)]),{'verbose':_0x167bcb[_0x485edb(0x200)]}),_0x1778c4=_0x4e754c[_0x485edb(0x22f)],_0x1d09bf=getConsoleNextUrl(_0x167bcb[_0x485edb(0x2a5)],'/app/ps/'+_0x30d4e8+_0x485edb(0x1e7)+_0x10ea4a['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x1778c4['id'],'name':_0x1778c4['attributes'][_0x485edb(0x29b)],'version':_0x1778c4['attributes'][_0x485edb(0x1ec)],'description':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x27d)],'state':_0x1778c4['attributes'][_0x485edb(0x2bb)],'paused':_0x1778c4['attributes'][_0x485edb(0x1f6)],'reentry_mode':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x226)],'stages':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x278)]?.['length']||0x0,..._0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x249)]&&{'goal':_0x1778c4['attributes'][_0x485edb(0x249)]['name']},'latest':_0x10ea4a[_0x485edb(0x2aa)]===_0xd51f57,'created_at':_0x1778c4['attributes']['createdAt'],'updated_at':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x2a8)],'url':_0x1d09bf},_0x167bcb),0x0;}}
@@ -1 +1 @@
1
- const a27_0x27b0ba=a27_0x240c;(function(_0x4a08d7,_0x46f704){const _0x4cdd40=a27_0x240c,_0x2d45f9=_0x4a08d7();while(!![]){try{const _0x4e9895=parseInt(_0x4cdd40(0x183))/0x1+-parseInt(_0x4cdd40(0x17f))/0x2+parseInt(_0x4cdd40(0x196))/0x3*(parseInt(_0x4cdd40(0x18e))/0x4)+-parseInt(_0x4cdd40(0x1a6))/0x5*(parseInt(_0x4cdd40(0x185))/0x6)+-parseInt(_0x4cdd40(0x1b2))/0x7*(parseInt(_0x4cdd40(0x1a5))/0x8)+-parseInt(_0x4cdd40(0x19a))/0x9*(parseInt(_0x4cdd40(0x194))/0xa)+parseInt(_0x4cdd40(0x189))/0xb*(parseInt(_0x4cdd40(0x1a2))/0xc);if(_0x4e9895===_0x46f704)break;else _0x2d45f9['push'](_0x2d45f9['shift']());}catch(_0x3e0b08){_0x2d45f9['push'](_0x2d45f9['shift']());}}}(a27_0x3cf1,0x50ab2));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a27_0x5a7ac9 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a27_0x240c(_0x5bd8d2,_0x570304){_0x5bd8d2=_0x5bd8d2-0x177;const _0x3cf186=a27_0x3cf1();let _0x240c28=_0x3cf186[_0x5bd8d2];return _0x240c28;}export class JourneyValidateCommand extends BaseCommand{[a27_0x27b0ba(0x17d)]='journey:validate';['description']=a27_0x27b0ba(0x1b1);async['execute'](_0x328335){const _0x43a977=a27_0x27b0ba,{options:_0xe636cd,args:_0x1fea56}=_0x328335,_0x2cf6b8=_0xe636cd,_0x5d385b=await resolveTarget({'arg':_0x1fea56[0x0],'contextParent':_0xe636cd[_0x43a977(0x18b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5d385b))return _0x5d385b[_0x43a977(0x1b3)]===_0x43a977(0x18d)?(console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x19e)](_0x43a977(0x17a))),console[_0x43a977(0x1af)](_0x43a977(0x1a9)),console[_0x43a977(0x1af)](_0x43a977(0x17c)),console[_0x43a977(0x1af)](_0x43a977(0x186))):(console['error'](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x187)+_0x5d385b[_0x43a977(0x178)]+'\x0a')),_0x5d385b['helpText']&&console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x1ad)](_0x5d385b[_0x43a977(0x197)]))),0x1;const _0x13c809=_0x5d385b[_0x43a977(0x1a0)],_0x39f710=_0x5d385b['type']===_0x43a977(0x182)?_0x5d385b[_0x43a977(0x1a4)]:undefined;if(!_0x39f710&&!existsSync(_0x13c809))return console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x191)+_0x13c809+'\x0a')),0x1;let _0x372854;if(_0x39f710){if(!_0x39f710[_0x43a977(0x181)](_0x43a977(0x1b4))&&!_0x39f710[_0x43a977(0x181)](_0x43a977(0x179)))return console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x17e)+_0x39f710+'\x0a')),0x1;_0x372854=[_0x39f710];}else _0x372854=findYamlFiles(_0x13c809);if(_0x372854[_0x43a977(0x195)]===0x0)return console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x19f)+_0x13c809+'\x0a')),0x1;const _0x3132f6=validateYamlFiles(_0x372854,_0x13c809,{'filterType':_0x43a977(0x184)}),_0x3f7308=calculateSummary(_0x3132f6),_0x5d144d=_0x3132f6['filter'](isValidationResult);if(_0x5d144d[_0x43a977(0x195)]===0x0)return console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x19e)](_0x43a977(0x1b0)+_0x13c809+'\x0a')),_0x3f7308[_0x43a977(0x18c)]>0x0&&console[_0x43a977(0x1af)](a27_0x5a7ac9['dim']('('+_0x3f7308['skippedCount']+_0x43a977(0x180))),0x0;for(const _0x409bd3 of _0x3132f6){if(!isValidationResult(_0x409bd3)){_0x2cf6b8['verbose']&&console['log'](a27_0x5a7ac9[_0x43a977(0x199)]('-\x20'+_0x409bd3['relativePath']+_0x43a977(0x1ab)+_0x409bd3[_0x43a977(0x18a)]+')'));continue;}const {relativePath:_0x5c5a32,source:_0x23675b,result:_0x1309f5}=_0x409bd3;if(_0x1309f5[_0x43a977(0x1a3)]&&_0x1309f5['warnings'][_0x43a977(0x195)]===0x0)_0x2cf6b8[_0x43a977(0x177)]&&console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x190)]('✔\x20'+_0x5c5a32));else _0x1309f5['valid']?(console['log'](a27_0x5a7ac9[_0x43a977(0x19e)]('⚠\x20'+_0x5c5a32+':\x20'+_0x1309f5[_0x43a977(0x19d)][_0x43a977(0x195)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x1309f5,_0x23675b,_0x5c5a32))):(console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x1ac)]('✖\x20'+_0x5c5a32+':\x20'+_0x1309f5[_0x43a977(0x1aa)][_0x43a977(0x195)]+_0x43a977(0x18f))),console[_0x43a977(0x1a1)](formatValidationResult(_0x1309f5,_0x23675b,_0x5c5a32)));}return console[_0x43a977(0x1a1)](''),_0x3f7308[_0x43a977(0x192)]?(console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x1a8)+_0x3f7308['invalidCount']+_0x43a977(0x188)+_0x3f7308[_0x43a977(0x19c)]+_0x43a977(0x198))),_0x3f7308[_0x43a977(0x1ae)]>0x0&&console[_0x43a977(0x1a1)](a27_0x5a7ac9['yellow'](_0x3f7308[_0x43a977(0x1ae)]+_0x43a977(0x1a7))),_0x3f7308[_0x43a977(0x18c)]>0x0&&console['log'](a27_0x5a7ac9[_0x43a977(0x199)](_0x3f7308[_0x43a977(0x18c)]+_0x43a977(0x17b))),0x1):(console['log'](a27_0x5a7ac9[_0x43a977(0x190)](_0x43a977(0x19b)+_0x3f7308[_0x43a977(0x19c)]+_0x43a977(0x193))),_0x3f7308[_0x43a977(0x1ae)]>0x0&&console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x19e)](_0x3f7308[_0x43a977(0x1ae)]+_0x43a977(0x1a7))),_0x3f7308[_0x43a977(0x18c)]>0x0&&console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x199)](_0x3f7308[_0x43a977(0x18c)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}function a27_0x3cf1(){const _0x194bce=['green','Error:\x20Directory\x20not\x20found:\x20','hasErrors','\x20journey(s)\x20valid','2790dluIcR','length','1580370ecssCa','helpText','\x20valid','dim','9855DNQIUa','✔\x20All\x20','validCount','warnings','yellow','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','targetDir','log','24YVbzNW','valid','filePath','9736QzQmtm','25QCywGc','\x20warning(s)\x20found','Validation\x20failed:\x20','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','errors','\x20(skipped:\x20','red','cyan','warningCount','error','No\x20journey\x20YAML\x20files\x20found\x20in\x20','Validate\x20journey\x20YAML\x20files','1687rGtVIq','errorCode','.yml','verbose','message','.yaml','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20segment\x20file(s)\x20skipped','\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','name','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','1116696lhKhPs','\x20segment\x20file(s)\x20skipped)','endsWith','file','94126EzIdBT','journey','159276fMdkXu','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20','\x20journey(s)\x20with\x20errors,\x20','5496601TMoUuK','reason','parentSegment','skippedCount','no_parent','4RqNJrK','\x20error(s)'];a27_0x3cf1=function(){return _0x194bce;};return a27_0x3cf1();}
1
+ const a29_0x42974e=a29_0x18b6;(function(_0x12725e,_0x4a5397){const _0x498d09=a29_0x18b6,_0x549d91=_0x12725e();while(!![]){try{const _0x55d281=-parseInt(_0x498d09(0x11b))/0x1+-parseInt(_0x498d09(0x131))/0x2+parseInt(_0x498d09(0x12a))/0x3+-parseInt(_0x498d09(0x105))/0x4*(-parseInt(_0x498d09(0x125))/0x5)+-parseInt(_0x498d09(0x117))/0x6*(parseInt(_0x498d09(0x116))/0x7)+parseInt(_0x498d09(0x12f))/0x8*(parseInt(_0x498d09(0x130))/0x9)+parseInt(_0x498d09(0x11f))/0xa*(-parseInt(_0x498d09(0x121))/0xb);if(_0x55d281===_0x4a5397)break;else _0x549d91['push'](_0x549d91['shift']());}catch(_0x5aeeb1){_0x549d91['push'](_0x549d91['shift']());}}}(a29_0x3195,0x6a6da));function a29_0x3195(){const _0x1d2fa1=['reason','Error:\x20Directory\x20not\x20found:\x20','warnings','160648BBGSTz','message','hasErrors','Error:\x20','\x20segment\x20file(s)\x20skipped)','file','filePath','\x20segment\x20file(s)\x20skipped','\x20valid','helpText','\x20warning(s)','cwd','invalidCount','red','execute','yellow','relativePath','4298xODEzy','1074FqHEAE','warningCount','length','\x20journey(s)\x20valid','76048VZJBoV','description','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','journey:validate','67030djOqSX','Validation\x20failed:\x20','1122pAqVqF','journey','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filter','10DtcMJQ','\x20journey(s)\x20with\x20errors,\x20','targetDir','endsWith','skippedCount','2490546OUNRMO','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','error','no_parent','log','272jiXPLL','139257wqqRfO','261996HLhQgf','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','green','\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','\x20(skipped:\x20','.yml','type','dim','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parentSegment','name','cyan','✔\x20All\x20'];a29_0x3195=function(){return _0x1d2fa1;};return a29_0x3195();}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0xca69d from'chalk';function a29_0x18b6(_0x5e1be1,_0xf77827){_0x5e1be1=_0x5e1be1-0xfc;const _0x31950f=a29_0x3195();let _0x18b634=_0x31950f[_0x5e1be1];return _0x18b634;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a29_0x42974e(0xff)]=a29_0x42974e(0x11e);[a29_0x42974e(0x11c)]='Validate\x20journey\x20YAML\x20files';async[a29_0x42974e(0x113)](_0x3ac383){const _0x8bb23a=a29_0x42974e,{options:_0x105cd1,args:_0x22e03b}=_0x3ac383,_0x682c09=_0x105cd1,_0x2ffc0c=await resolveTarget({'arg':_0x22e03b[0x0],'contextParent':_0x105cd1[_0x8bb23a(0xfe)],'cwd':process[_0x8bb23a(0x110)]()});if(!isSuccessfulResolution(_0x2ffc0c))return _0x2ffc0c['errorCode']===_0x8bb23a(0x12d)?(console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x114)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x8bb23a(0x11d)),console['error'](_0x8bb23a(0x135)),console[_0x8bb23a(0x12c)](_0x8bb23a(0x123))):(console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0x108)+_0x2ffc0c[_0x8bb23a(0x106)]+'\x0a')),_0x2ffc0c['helpText']&&console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x100)](_0x2ffc0c[_0x8bb23a(0x10e)]))),0x1;const _0x524d72=_0x2ffc0c[_0x8bb23a(0x127)],_0x5e25aa=_0x2ffc0c[_0x8bb23a(0x138)]===_0x8bb23a(0x10a)?_0x2ffc0c[_0x8bb23a(0x10b)]:undefined;if(!_0x5e25aa&&!existsSync(_0x524d72))return console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0x103)+_0x524d72+'\x0a')),0x1;let _0x80880f;if(_0x5e25aa){if(!_0x5e25aa['endsWith'](_0x8bb23a(0x137))&&!_0x5e25aa[_0x8bb23a(0x128)]('.yaml'))return console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0x12b)+_0x5e25aa+'\x0a')),0x1;_0x80880f=[_0x5e25aa];}else _0x80880f=findYamlFiles(_0x524d72);if(_0x80880f['length']===0x0)return console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0xfd)+_0x524d72+'\x0a')),0x1;const _0x2cf25b=validateYamlFiles(_0x80880f,_0x524d72,{'filterType':_0x8bb23a(0x122)}),_0x5a08d0=calculateSummary(_0x2cf25b),_0x393274=_0x2cf25b[_0x8bb23a(0x124)](isValidationResult);if(_0x393274[_0x8bb23a(0x119)]===0x0)return console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x114)](_0x8bb23a(0x132)+_0x524d72+'\x0a')),_0x5a08d0['skippedCount']>0x0&&console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0xfc)]('('+_0x5a08d0['skippedCount']+_0x8bb23a(0x109))),0x0;for(const _0x25fbf5 of _0x2cf25b){if(!isValidationResult(_0x25fbf5)){_0x682c09['verbose']&&console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0xfc)]('-\x20'+_0x25fbf5[_0x8bb23a(0x115)]+_0x8bb23a(0x136)+_0x25fbf5[_0x8bb23a(0x102)]+')'));continue;}const {relativePath:_0x3544ef,source:_0x2caf70,result:_0x5c7f02}=_0x25fbf5;if(_0x5c7f02['valid']&&_0x5c7f02[_0x8bb23a(0x104)]['length']===0x0)_0x682c09['verbose']&&console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0x134)]('✔\x20'+_0x3544ef));else _0x5c7f02['valid']?(console[_0x8bb23a(0x12e)](a29_0xca69d['yellow']('⚠\x20'+_0x3544ef+':\x20'+_0x5c7f02[_0x8bb23a(0x104)][_0x8bb23a(0x119)]+_0x8bb23a(0x10f))),console[_0x8bb23a(0x12e)](formatValidationResult(_0x5c7f02,_0x2caf70,_0x3544ef))):(console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0x112)]('✖\x20'+_0x3544ef+':\x20'+_0x5c7f02['errors'][_0x8bb23a(0x119)]+'\x20error(s)')),console['log'](formatValidationResult(_0x5c7f02,_0x2caf70,_0x3544ef)));}return console[_0x8bb23a(0x12e)](''),_0x5a08d0[_0x8bb23a(0x107)]?(console['log'](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0x120)+_0x5a08d0[_0x8bb23a(0x111)]+_0x8bb23a(0x126)+_0x5a08d0['validCount']+_0x8bb23a(0x10d))),_0x5a08d0['warningCount']>0x0&&console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0x114)](_0x5a08d0[_0x8bb23a(0x118)]+_0x8bb23a(0x133))),_0x5a08d0[_0x8bb23a(0x129)]>0x0&&console['log'](a29_0xca69d[_0x8bb23a(0xfc)](_0x5a08d0[_0x8bb23a(0x129)]+_0x8bb23a(0x10c))),0x1):(console[_0x8bb23a(0x12e)](a29_0xca69d['green'](_0x8bb23a(0x101)+_0x5a08d0['validCount']+_0x8bb23a(0x11a))),_0x5a08d0[_0x8bb23a(0x118)]>0x0&&console[_0x8bb23a(0x12e)](a29_0xca69d['yellow'](_0x5a08d0[_0x8bb23a(0x118)]+_0x8bb23a(0x133))),_0x5a08d0[_0x8bb23a(0x129)]>0x0&&console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0xfc)](_0x5a08d0[_0x8bb23a(0x129)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}