@treasuredata/tdx 0.29.5 → 2026.3.0

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 (256) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.d.ts.map +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/databases.js.map +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.d.ts +97 -1
  27. package/dist/commands/engage-command.d.ts.map +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-command.js.map +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.d.ts.map +1 -1
  34. package/dist/commands/job-command.js +1 -1
  35. package/dist/commands/job-command.js.map +1 -1
  36. package/dist/commands/journey-command.js +1 -1
  37. package/dist/commands/journey-validate-command.js +1 -1
  38. package/dist/commands/llm-command.js +1 -1
  39. package/dist/commands/mcp-command.js +1 -1
  40. package/dist/commands/parent-segment-command.js +1 -1
  41. package/dist/commands/profile-command.js +1 -1
  42. package/dist/commands/profiles-command.js +1 -1
  43. package/dist/commands/query-command.js +1 -1
  44. package/dist/commands/schedule-command.js +1 -1
  45. package/dist/commands/segment-command.js +1 -1
  46. package/dist/commands/segment-create-command.js +1 -1
  47. package/dist/commands/segment-fields-command.js +1 -1
  48. package/dist/commands/segment-pull-command.js +1 -1
  49. package/dist/commands/segment-push-command.js +1 -1
  50. package/dist/commands/segment-update-command.js +1 -1
  51. package/dist/commands/segment-use-command.js +1 -1
  52. package/dist/commands/segment-validate-command.js +1 -1
  53. package/dist/commands/segments.js +1 -1
  54. package/dist/commands/show.js +1 -1
  55. package/dist/commands/status-command.js +1 -1
  56. package/dist/commands/tables.d.ts.map +1 -1
  57. package/dist/commands/tables.js +1 -1
  58. package/dist/commands/tables.js.map +1 -1
  59. package/dist/commands/unset-command.js +1 -1
  60. package/dist/commands/upgrade-command.js +1 -1
  61. package/dist/commands/use-command.js +1 -1
  62. package/dist/commands/user-command.js +1 -1
  63. package/dist/commands/workflow-command.js +1 -1
  64. package/dist/core/auth.d.ts +8 -5
  65. package/dist/core/auth.d.ts.map +1 -1
  66. package/dist/core/auth.js +1 -1
  67. package/dist/core/auth.js.map +1 -1
  68. package/dist/core/command-output.js +1 -1
  69. package/dist/core/config.d.ts +38 -6
  70. package/dist/core/config.d.ts.map +1 -1
  71. package/dist/core/config.js +1 -1
  72. package/dist/core/config.js.map +1 -1
  73. package/dist/core/connection-cache.js +1 -1
  74. package/dist/core/constants.js +1 -1
  75. package/dist/core/credential-cache.js +1 -1
  76. package/dist/core/global-context.d.ts +1 -0
  77. package/dist/core/global-context.d.ts.map +1 -1
  78. package/dist/core/global-context.js +1 -1
  79. package/dist/core/global-context.js.map +1 -1
  80. package/dist/core/keychain.js +1 -1
  81. package/dist/core/profile.js +1 -1
  82. package/dist/core/project-config.js +1 -1
  83. package/dist/core/session.js +1 -1
  84. package/dist/core/user-cache.js +1 -1
  85. package/dist/core/version.d.ts +3 -3
  86. package/dist/core/version.js +1 -1
  87. package/dist/index.js +1 -1
  88. package/dist/mcp/server.js +1 -1
  89. package/dist/mcp/tools/index.js +1 -1
  90. package/dist/mcp/tools/tdx-run.js +1 -1
  91. package/dist/mcp/tools/tdx-search.js +1 -1
  92. package/dist/mcp/utils.js +1 -1
  93. package/dist/proxy/claude-usage-tracker.js +1 -1
  94. package/dist/proxy/passthrough-server.js +1 -1
  95. package/dist/proxy/sse-usage-parser.js +1 -1
  96. package/dist/sdk/agent/agent-config.js +1 -1
  97. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  98. package/dist/sdk/agent/agent-yaml.js +1 -1
  99. package/dist/sdk/agent/test/evaluator.js +1 -1
  100. package/dist/sdk/agent/test/executor.js +1 -1
  101. package/dist/sdk/agent/test/index.js +1 -1
  102. package/dist/sdk/agent/test/output.js +1 -1
  103. package/dist/sdk/agent/test/parser.js +1 -1
  104. package/dist/sdk/agent/tool-target-registry.js +1 -1
  105. package/dist/sdk/api.js +1 -1
  106. package/dist/sdk/api.js.map +1 -1
  107. package/dist/sdk/client/cdp-api-client.js +1 -1
  108. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  109. package/dist/sdk/client/delivery-api-client.js +1 -1
  110. package/dist/sdk/client/delivery-api-client.js.map +1 -1
  111. package/dist/sdk/client/endpoints.d.ts +16 -0
  112. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  113. package/dist/sdk/client/endpoints.js +1 -1
  114. package/dist/sdk/client/endpoints.js.map +1 -1
  115. package/dist/sdk/client/engage-api-client.d.ts +47 -1
  116. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  117. package/dist/sdk/client/engage-api-client.js +1 -1
  118. package/dist/sdk/client/engage-api-client.js.map +1 -1
  119. package/dist/sdk/client/http-client.js +1 -1
  120. package/dist/sdk/client/llm-api-client.js +1 -1
  121. package/dist/sdk/client/llm-api-client.js.map +1 -1
  122. package/dist/sdk/client/rate-limiter.js +1 -1
  123. package/dist/sdk/client/td-api-client.js +1 -1
  124. package/dist/sdk/client/td-api-client.js.map +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/trino-api-client.js.map +1 -1
  127. package/dist/sdk/client/workflow-client.js +1 -1
  128. package/dist/sdk/client/workflow-client.js.map +1 -1
  129. package/dist/sdk/connection-validator.js +1 -1
  130. package/dist/sdk/connection.js +1 -1
  131. package/dist/sdk/delivery.js +1 -1
  132. package/dist/sdk/engage/campaign-pull.js +1 -1
  133. package/dist/sdk/engage/campaign-push.js +1 -1
  134. package/dist/sdk/engage/campaign-validator.js +1 -1
  135. package/dist/sdk/engage/campaign-yaml.js +1 -1
  136. package/dist/sdk/engage/template-pull.js +1 -1
  137. package/dist/sdk/engage/template-push.js +1 -1
  138. package/dist/sdk/engage/template-validator.js +1 -1
  139. package/dist/sdk/engage/template-yaml.js +1 -1
  140. package/dist/sdk/engage/types/campaign-def.js +1 -1
  141. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  142. package/dist/sdk/engage/types/template-schema.js +1 -1
  143. package/dist/sdk/engage.d.ts +95 -4
  144. package/dist/sdk/engage.d.ts.map +1 -1
  145. package/dist/sdk/engage.js +1 -1
  146. package/dist/sdk/engage.js.map +1 -1
  147. package/dist/sdk/errors.js +1 -1
  148. package/dist/sdk/index.d.ts +10 -0
  149. package/dist/sdk/index.d.ts.map +1 -1
  150. package/dist/sdk/index.js +1 -1
  151. package/dist/sdk/index.js.map +1 -1
  152. package/dist/sdk/io/index.js +1 -1
  153. package/dist/sdk/io/node-filesystem.js +1 -1
  154. package/dist/sdk/job.js +1 -1
  155. package/dist/sdk/journey.d.ts +2 -0
  156. package/dist/sdk/journey.d.ts.map +1 -1
  157. package/dist/sdk/journey.js +1 -1
  158. package/dist/sdk/journey.js.map +1 -1
  159. package/dist/sdk/llm/chat-cache.js +1 -1
  160. package/dist/sdk/llm/index.js +1 -1
  161. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  162. package/dist/sdk/llm/model-factors.js +1 -1
  163. package/dist/sdk/personalization.js +1 -1
  164. package/dist/sdk/personalization.js.map +1 -1
  165. package/dist/sdk/query/index.js +1 -1
  166. package/dist/sdk/query/sql-parser.js +1 -1
  167. package/dist/sdk/realtime.js +1 -1
  168. package/dist/sdk/realtime.js.map +1 -1
  169. package/dist/sdk/schedule.js +1 -1
  170. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/fields-display.js +1 -1
  172. package/dist/sdk/segment/file-discovery.js +1 -1
  173. package/dist/sdk/segment/journey-utils.js +1 -1
  174. package/dist/sdk/segment/journey-validator.js +1 -1
  175. package/dist/sdk/segment/journey-yaml.js +1 -1
  176. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  177. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  178. package/dist/sdk/segment/parent-segment-yaml.js.map +1 -1
  179. package/dist/sdk/segment/pull-workflow.js +1 -1
  180. package/dist/sdk/segment/push-recovery.js +1 -1
  181. package/dist/sdk/segment/push-workflow.js +1 -1
  182. package/dist/sdk/segment/resolution-context.js +1 -1
  183. package/dist/sdk/segment/segment-path-parser.js +1 -1
  184. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  185. package/dist/sdk/segment/segment-validator.js +1 -1
  186. package/dist/sdk/segment/target-resolution.js +1 -1
  187. package/dist/sdk/segment/tdx-config.js +1 -1
  188. package/dist/sdk/segment/types/activation-schema.js +1 -1
  189. package/dist/sdk/segment/types/journey-def.js +1 -1
  190. package/dist/sdk/segment/types/journey-schema.js +1 -1
  191. package/dist/sdk/segment/types/segment-def.js +1 -1
  192. package/dist/sdk/segment/types/segment-schema.js +1 -1
  193. package/dist/sdk/segment/validate-files.js +1 -1
  194. package/dist/sdk/segment/yaml-validator.js +1 -1
  195. package/dist/sdk/segment.js +1 -1
  196. package/dist/sdk/types/engage.d.ts +119 -0
  197. package/dist/sdk/types/engage.d.ts.map +1 -1
  198. package/dist/sdk/types/index.d.ts +1 -1
  199. package/dist/sdk/types/index.d.ts.map +1 -1
  200. package/dist/sdk/types/index.js +1 -1
  201. package/dist/sdk/types/index.js.map +1 -1
  202. package/dist/sdk/types/progress.js +1 -1
  203. package/dist/sdk/user.js +1 -1
  204. package/dist/sdk/util/format-detector.js +1 -1
  205. package/dist/sdk/util/formatters.js +1 -1
  206. package/dist/sdk/util/index.d.ts +1 -0
  207. package/dist/sdk/util/index.d.ts.map +1 -1
  208. package/dist/sdk/util/index.js +1 -1
  209. package/dist/sdk/util/index.js.map +1 -1
  210. package/dist/sdk/util/paginate.d.ts +18 -0
  211. package/dist/sdk/util/paginate.d.ts.map +1 -0
  212. package/dist/sdk/util/paginate.js +1 -0
  213. package/dist/sdk/util/paginate.js.map +1 -0
  214. package/dist/sdk/util/tree-formatter.js +1 -1
  215. package/dist/sdk/workflow/archive-validation.js +1 -1
  216. package/dist/sdk/workflow/clone-workflow.js +1 -1
  217. package/dist/sdk/workflow/index.d.ts.map +1 -1
  218. package/dist/sdk/workflow/index.js +1 -1
  219. package/dist/sdk/workflow/index.js.map +1 -1
  220. package/dist/sdk/workflow/pull-workflow.js +1 -1
  221. package/dist/sdk/workflow/push-workflow.js +1 -1
  222. package/dist/sdk/workflow/tdx-config.js +1 -1
  223. package/dist/sdk/workflow/workflow-utils.js +1 -1
  224. package/dist/test-utils/command-runner.js +1 -1
  225. package/dist/test-utils/factories.js +1 -1
  226. package/dist/test-utils/fixtures.js +1 -1
  227. package/dist/test-utils/http-mock.js +1 -1
  228. package/dist/test-utils/index.js +1 -1
  229. package/dist/utils/async.js +1 -1
  230. package/dist/utils/colors.js +1 -1
  231. package/dist/utils/diff.js +1 -1
  232. package/dist/utils/file-permissions.js +1 -1
  233. package/dist/utils/file-reader.js +1 -1
  234. package/dist/utils/github-releases.js +1 -1
  235. package/dist/utils/global-cache.js +1 -1
  236. package/dist/utils/json-loader.js +1 -1
  237. package/dist/utils/local-cache.js +1 -1
  238. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  239. package/dist/utils/logger/formatters/index.js +1 -1
  240. package/dist/utils/logger/handlers/console-handler.js +1 -1
  241. package/dist/utils/logger/handlers/file-handler.js +1 -1
  242. package/dist/utils/logger/handlers/index.js +1 -1
  243. package/dist/utils/logger/handlers/null-handler.js +1 -1
  244. package/dist/utils/logger/index.js +1 -1
  245. package/dist/utils/logger/logger.js +1 -1
  246. package/dist/utils/logger/types.js +1 -1
  247. package/dist/utils/option-validation.js +1 -1
  248. package/dist/utils/process.js +1 -1
  249. package/dist/utils/prompt.js +1 -1
  250. package/dist/utils/spinner.js +1 -1
  251. package/dist/utils/sse-parser.js +1 -1
  252. package/dist/utils/string-utils.js +1 -1
  253. package/dist/utils/table-ref-parser.js +1 -1
  254. package/dist/utils/tdx-logger.js +1 -1
  255. package/dist/utils/version-check.js +1 -1
  256. package/package.json +2 -1
@@ -1 +1 @@
1
- const a21_0x3b20be=a21_0x105d;(function(_0x30d86d,_0x34c711){const _0x4665d1=a21_0x105d,_0x5d3053=_0x30d86d();while(!![]){try{const _0x448dad=parseInt(_0x4665d1(0x15a))/0x1+parseInt(_0x4665d1(0x132))/0x2*(parseInt(_0x4665d1(0x13c))/0x3)+-parseInt(_0x4665d1(0x156))/0x4+-parseInt(_0x4665d1(0x159))/0x5*(parseInt(_0x4665d1(0x14d))/0x6)+parseInt(_0x4665d1(0x14c))/0x7*(-parseInt(_0x4665d1(0x16c))/0x8)+-parseInt(_0x4665d1(0x16f))/0x9*(-parseInt(_0x4665d1(0x13e))/0xa)+parseInt(_0x4665d1(0x158))/0xb;if(_0x448dad===_0x34c711)break;else _0x5d3053['push'](_0x5d3053['shift']());}catch(_0x465fe7){_0x5d3053['push'](_0x5d3053['shift']());}}}(a21_0x2311,0xa111f));import{BaseCommand}from'./command.js';function a21_0x105d(_0x5d1cfb,_0x57b49f){_0x5d1cfb=_0x5d1cfb-0x130;const _0x2311c1=a21_0x2311();let _0x105d94=_0x2311c1[_0x5d1cfb];return _0x105d94;}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 a21_0x51c4d3 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a21_0x39a5e2 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';function a21_0x2311(){const _0x51719d=['hasChanges','green','utf-8','dirname','cyan','error','\x0aPull\x20summary\x20for\x20workspace\x20\x27','config','files','✔\x20Pulled\x20','\x20files?','targetDir','✔\x20All\x20files\x20are\x20up\x20to\x20date','87577HjamLy','127734QxhVrA','No\x20templates\x20found\x20in\x20workspace\x20\x27','counts','✔\x20Context\x20set:\x20','templates','cwd','engage_workspace','description','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','1127684JDYIzu','\x27...','5926481PILkOL','25LHmJKv','412008Cujgpn','red','Pulling\x20templates\x20from\x20\x27','\x20templates','\x20\x20Target:\x20','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','setPhase','content','dim','diff','filter','\x20files\x20to\x20','engage','isNew','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','verbose','session','yellow','656CdFLWa','\x20unchanged\x20files','repeat','9VgtLBe','dryRun','absolutePath','\x0aError:','\x0aChanges\x20to\x20\x27','workspace','6IEbnlo','data','Aborted.','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Pull\x20templates\x20to\x20YAML\x20files','workspaceName','length','\x20new\x20files','\x20changed\x20files','266811jEtlsx','yes','8564210rrEkww'];a21_0x2311=function(){return _0x51719d;};return a21_0x2311();}export class EngageTemplatePullCommand extends BaseCommand{[a21_0x3b20be(0x135)]='engage:template:pull';[a21_0x3b20be(0x154)]=a21_0x3b20be(0x137);async['execute'](_0x1a237a){const _0xb3f703=a21_0x3b20be,{options:_0x1869bf,args:_0x4252a0,tdx:_0x3c6c10}=_0x1a237a,_0x2615f8=_0x1869bf,_0x3a855c=await resolveWorkspaceName(_0x4252a0[0x0],_0x2615f8);if(!_0x3a855c)return console[_0xb3f703(0x144)](a21_0x51c4d3[_0xb3f703(0x16b)]('Workspace\x20is\x20required.')),console[_0xb3f703(0x144)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console[_0xb3f703(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>'),console[_0xb3f703(0x144)](_0xb3f703(0x15f)),0x1;const _0x4f9d4c=await withProgressSpinner(_0xb3f703(0x15c)+_0x3a855c+_0xb3f703(0x157),_0x1d0866=>pullTemplates({'engage':_0x3c6c10[_0xb3f703(0x166)]},_0x3a855c,{'templateName':_0x2615f8[_0xb3f703(0x135)],'progress':{'update':_0x1ff804=>{const _0x2d8428=_0xb3f703;_0x1d0866[_0x2d8428(0x160)](_0x1ff804);}}}),{'verbose':_0x2615f8[_0xb3f703(0x169)]}),_0x2767e7=_0x4f9d4c[_0xb3f703(0x133)];if(_0x2767e7[_0xb3f703(0x14f)][_0xb3f703(0x151)]===0x0)return console['error'](a21_0x51c4d3[_0xb3f703(0x16b)](_0xb3f703(0x14e)+_0x2767e7[_0xb3f703(0x138)]+'\x27')),0x0;const _0x4f7f66=_0x2767e7[_0xb3f703(0x147)][_0xb3f703(0x164)](_0x20962c=>_0x20962c[_0xb3f703(0x167)]),_0x382676=_0x2767e7['files']['filter'](_0x1726c6=>!_0x1726c6['isNew']&&_0x1726c6[_0xb3f703(0x13f)]),_0x4da8cc=_0x2767e7[_0xb3f703(0x147)][_0xb3f703(0x164)](_0x47beac=>!_0x47beac[_0xb3f703(0x167)]&&!_0x47beac[_0xb3f703(0x13f)]);console[_0xb3f703(0x144)](_0xb3f703(0x145)+_0x2767e7[_0xb3f703(0x138)]+'\x27:'),console['error']('\x20\x20'+a21_0x51c4d3[_0xb3f703(0x143)](_0x2767e7[_0xb3f703(0x14f)][_0xb3f703(0x151)]+_0xb3f703(0x15d))),console[_0xb3f703(0x144)]('\x20\x20'+a21_0x51c4d3['green']('+\x20'+_0x4f7f66['length']+_0xb3f703(0x13a))),console[_0xb3f703(0x144)]('\x20\x20'+a21_0x51c4d3[_0xb3f703(0x16b)]('~\x20'+_0x382676[_0xb3f703(0x139)]+_0xb3f703(0x13b))),console[_0xb3f703(0x144)]('\x20\x20'+a21_0x51c4d3[_0xb3f703(0x162)]('=\x20'+_0x4da8cc[_0xb3f703(0x139)]+_0xb3f703(0x16d))),console[_0xb3f703(0x144)](_0xb3f703(0x15e)+a21_0x51c4d3[_0xb3f703(0x143)](_0x2767e7[_0xb3f703(0x14a)])+'\x0a');if(_0x382676['length']>0x0)for(const _0x575203 of _0x382676){console[_0xb3f703(0x144)](_0xb3f703(0x130)+_0x575203['relativePath']+'\x27:'),console[_0xb3f703(0x144)]('─'[_0xb3f703(0x16e)](0x3c)),console[_0xb3f703(0x144)](_0x575203[_0xb3f703(0x163)]),console[_0xb3f703(0x144)]('─'[_0xb3f703(0x16e)](0x3c));}if(_0x2615f8[_0xb3f703(0x170)])return console[_0xb3f703(0x144)](a21_0x51c4d3[_0xb3f703(0x16b)](_0xb3f703(0x168))),0x0;if(_0x4f7f66[_0xb3f703(0x139)]===0x0&&_0x382676[_0xb3f703(0x139)]===0x0)return console['error'](a21_0x51c4d3[_0xb3f703(0x140)](_0xb3f703(0x14b))),saveSessionContext({'engage_workspace':_0x2767e7[_0xb3f703(0x138)]},_0x2615f8[_0xb3f703(0x16a)]),0x0;if(!_0x2615f8[_0xb3f703(0x13d)]){if(!isInteractive())return console[_0xb3f703(0x144)](a21_0x51c4d3[_0xb3f703(0x15b)](_0xb3f703(0x172)),_0xb3f703(0x155)),console[_0xb3f703(0x144)](a21_0x51c4d3[_0xb3f703(0x162)](_0xb3f703(0x136))),0x1;const _0x58a828=await confirmKey('Write\x20'+(_0x4f7f66[_0xb3f703(0x139)]+_0x382676[_0xb3f703(0x139)])+_0xb3f703(0x149));if(!_0x58a828)return console[_0xb3f703(0x144)](a21_0x51c4d3[_0xb3f703(0x16b)](_0xb3f703(0x134)),'-\x20no\x20files\x20written'),0x1;}for(const _0x4847ab of _0x2767e7[_0xb3f703(0x147)]){if(_0x4847ab[_0xb3f703(0x167)]||_0x4847ab['hasChanges']){const _0x50bf19=a21_0x39a5e2[_0xb3f703(0x142)](_0x4847ab[_0xb3f703(0x171)]);!existsSync(_0x50bf19)&&mkdirSync(_0x50bf19,{'recursive':!![]}),writeFileSync(_0x4847ab[_0xb3f703(0x171)],_0x4847ab[_0xb3f703(0x161)],_0xb3f703(0x141));}}return console['error'](a21_0x51c4d3[_0xb3f703(0x140)](_0xb3f703(0x148)+(_0x4f7f66['length']+_0x382676[_0xb3f703(0x139)])+_0xb3f703(0x165)+_0x2767e7['targetDir'])),saveSessionContext({'engage_workspace':_0x2767e7[_0xb3f703(0x138)]},_0x2615f8[_0xb3f703(0x16a)]),console[_0xb3f703(0x144)](a21_0x51c4d3[_0xb3f703(0x140)](_0xb3f703(0x150)+a21_0x51c4d3[_0xb3f703(0x162)](_0xb3f703(0x153))+'\x20=\x20'+a21_0x51c4d3[_0xb3f703(0x143)](_0x2767e7['workspaceName']))),0x0;}}async function resolveWorkspaceName(_0x1f37b2,_0x42c81e){const _0x49469f=a21_0x3b20be;if(_0x1f37b2)return _0x1f37b2;if(_0x42c81e[_0x49469f(0x131)])return _0x42c81e['workspace'];const _0x53255d=tryFindTdxConfig(process[_0x49469f(0x152)]());if(_0x53255d?.[_0x49469f(0x146)][_0x49469f(0x153)])return _0x53255d[_0x49469f(0x146)][_0x49469f(0x153)];const _0x42200b=loadSessionContext(_0x42c81e[_0x49469f(0x16a)]);if(_0x42200b?.['engage_workspace'])return _0x42200b[_0x49469f(0x153)];return undefined;}
1
+ const a21_0x2879bc=a21_0x1b56;(function(_0x347b6e,_0x3a19b1){const _0x12198c=a21_0x1b56,_0xb007fb=_0x347b6e();while(!![]){try{const _0xc5965=-parseInt(_0x12198c(0x169))/0x1+parseInt(_0x12198c(0x189))/0x2*(parseInt(_0x12198c(0x161))/0x3)+-parseInt(_0x12198c(0x17f))/0x4*(-parseInt(_0x12198c(0x19b))/0x5)+-parseInt(_0x12198c(0x193))/0x6*(-parseInt(_0x12198c(0x175))/0x7)+-parseInt(_0x12198c(0x180))/0x8+-parseInt(_0x12198c(0x184))/0x9*(-parseInt(_0x12198c(0x198))/0xa)+parseInt(_0x12198c(0x195))/0xb*(-parseInt(_0x12198c(0x19c))/0xc);if(_0xc5965===_0x3a19b1)break;else _0xb007fb['push'](_0xb007fb['shift']());}catch(_0x14fdde){_0xb007fb['push'](_0xb007fb['shift']());}}}(a21_0x365a,0xd8763));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 a21_0x39fab4 from'chalk';function a21_0x365a(){const _0x7a948f=['\x20files\x20to\x20','945237TQfEoc','\x20changed\x20files','\x0aChanges\x20to\x20\x27','relativePath','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','session','files','workspaceName','yellow','targetDir','filter','✔\x20Context\x20set:\x20','254037xnBIux','templates','counts','\x20\x20Target:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','name','\x20unchanged\x20files','\x27...','\x0aError:','✔\x20Pulled\x20','666752uwFnBs','8088680aTdISZ','cyan','dryRun','dirname','9QibMfm','repeat','\x20new\x20files','red','length','581278Kvjzur','\x20templates','error','engage','execute','isNew','Pulling\x20templates\x20from\x20\x27','green','verbose','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','54btwNIa','Write\x20','7004162qaRBke','yes','hasChanges','15843930oBOqpe','\x20files?','engage_workspace','40sizVYe','24Xultgp','Pull\x20templates\x20to\x20YAML\x20files','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','dim','-\x20no\x20files\x20written','\x0aPull\x20summary\x20for\x20workspace\x20\x27','No\x20templates\x20found\x20in\x20workspace\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','9MGCRJX','diff','data','absolutePath','content','Workspace\x20is\x20required.','config'];a21_0x365a=function(){return _0x7a948f;};return a21_0x365a();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a21_0x5c4837 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';function a21_0x1b56(_0x2ee15b,_0x683fe1){_0x2ee15b=_0x2ee15b-0x15d;const _0x365a20=a21_0x365a();let _0x1b5620=_0x365a20[_0x2ee15b];return _0x1b5620;}export class EngageTemplatePullCommand extends BaseCommand{['name']='engage:template:pull';['description']=a21_0x2879bc(0x19d);async[a21_0x2879bc(0x18d)](_0x5eeaa6){const _0x35f587=a21_0x2879bc,{options:_0x5d5192,args:_0x4a6e39,tdx:_0x22c1c6}=_0x5eeaa6,_0x34bec8=_0x5d5192,_0x564b1e=await resolveWorkspaceName(_0x4a6e39[0x0],_0x34bec8);if(!_0x564b1e)return console[_0x35f587(0x18b)](a21_0x39fab4[_0x35f587(0x171)](_0x35f587(0x166))),console[_0x35f587(0x18b)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console['error'](_0x35f587(0x179)),console[_0x35f587(0x18b)](_0x35f587(0x19e)),0x1;const _0x3c81d7=await withProgressSpinner(_0x35f587(0x18f)+_0x564b1e+_0x35f587(0x17c),_0x539174=>pullTemplates({'engage':_0x22c1c6[_0x35f587(0x18c)]},_0x564b1e,{'templateName':_0x34bec8[_0x35f587(0x17a)],'progress':{'update':_0xaf91a6=>{_0x539174['setPhase'](_0xaf91a6);}}}),{'verbose':_0x34bec8[_0x35f587(0x191)]}),_0x198de8=_0x3c81d7[_0x35f587(0x163)];if(_0x198de8[_0x35f587(0x177)][_0x35f587(0x176)]===0x0)return console[_0x35f587(0x18b)](a21_0x39fab4[_0x35f587(0x171)](_0x35f587(0x15f)+_0x198de8[_0x35f587(0x170)]+'\x27')),0x0;const _0x2b30d6=_0x198de8['files'][_0x35f587(0x173)](_0x103756=>_0x103756['isNew']),_0x15dbfb=_0x198de8[_0x35f587(0x16f)][_0x35f587(0x173)](_0x1c1f05=>!_0x1c1f05['isNew']&&_0x1c1f05[_0x35f587(0x197)]),_0x2681c9=_0x198de8[_0x35f587(0x16f)][_0x35f587(0x173)](_0x46e8fc=>!_0x46e8fc[_0x35f587(0x18e)]&&!_0x46e8fc[_0x35f587(0x197)]);console['error'](_0x35f587(0x15e)+_0x198de8[_0x35f587(0x170)]+'\x27:'),console['error']('\x20\x20'+a21_0x39fab4['cyan'](_0x198de8[_0x35f587(0x177)][_0x35f587(0x176)]+_0x35f587(0x18a))),console[_0x35f587(0x18b)]('\x20\x20'+a21_0x39fab4[_0x35f587(0x190)]('+\x20'+_0x2b30d6[_0x35f587(0x188)]+_0x35f587(0x186))),console[_0x35f587(0x18b)]('\x20\x20'+a21_0x39fab4[_0x35f587(0x171)]('~\x20'+_0x15dbfb[_0x35f587(0x188)]+_0x35f587(0x16a))),console['error']('\x20\x20'+a21_0x39fab4[_0x35f587(0x19f)]('=\x20'+_0x2681c9[_0x35f587(0x188)]+_0x35f587(0x17b))),console[_0x35f587(0x18b)](_0x35f587(0x178)+a21_0x39fab4[_0x35f587(0x181)](_0x198de8[_0x35f587(0x172)])+'\x0a');if(_0x15dbfb[_0x35f587(0x188)]>0x0)for(const _0x100eda of _0x15dbfb){console[_0x35f587(0x18b)](_0x35f587(0x16b)+_0x100eda[_0x35f587(0x16c)]+'\x27:'),console[_0x35f587(0x18b)]('─'[_0x35f587(0x185)](0x3c)),console['error'](_0x100eda[_0x35f587(0x162)]),console[_0x35f587(0x18b)]('─'[_0x35f587(0x185)](0x3c));}if(_0x34bec8[_0x35f587(0x182)])return console[_0x35f587(0x18b)](a21_0x39fab4[_0x35f587(0x171)](_0x35f587(0x160))),0x0;if(_0x2b30d6[_0x35f587(0x188)]===0x0&&_0x15dbfb[_0x35f587(0x188)]===0x0)return console['error'](a21_0x39fab4[_0x35f587(0x190)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x198de8[_0x35f587(0x170)]},_0x34bec8[_0x35f587(0x16e)]),0x0;if(!_0x34bec8[_0x35f587(0x196)]){if(!isInteractive())return console[_0x35f587(0x18b)](a21_0x39fab4[_0x35f587(0x187)](_0x35f587(0x17d)),_0x35f587(0x192)),console[_0x35f587(0x18b)](a21_0x39fab4[_0x35f587(0x19f)](_0x35f587(0x16d))),0x1;const _0x198ca9=await confirmKey(_0x35f587(0x194)+(_0x2b30d6['length']+_0x15dbfb[_0x35f587(0x188)])+_0x35f587(0x199));if(!_0x198ca9)return console[_0x35f587(0x18b)](a21_0x39fab4['yellow']('Aborted.'),_0x35f587(0x15d)),0x1;}for(const _0x33740a of _0x198de8['files']){if(_0x33740a[_0x35f587(0x18e)]||_0x33740a[_0x35f587(0x197)]){const _0x152ea0=a21_0x5c4837[_0x35f587(0x183)](_0x33740a[_0x35f587(0x164)]);!existsSync(_0x152ea0)&&mkdirSync(_0x152ea0,{'recursive':!![]}),writeFileSync(_0x33740a['absolutePath'],_0x33740a[_0x35f587(0x165)],'utf-8');}}return console[_0x35f587(0x18b)](a21_0x39fab4[_0x35f587(0x190)](_0x35f587(0x17e)+(_0x2b30d6[_0x35f587(0x188)]+_0x15dbfb['length'])+_0x35f587(0x168)+_0x198de8[_0x35f587(0x172)])),saveSessionContext({'engage_workspace':_0x198de8[_0x35f587(0x170)]},_0x34bec8[_0x35f587(0x16e)]),console['error'](a21_0x39fab4[_0x35f587(0x190)](_0x35f587(0x174)+a21_0x39fab4[_0x35f587(0x19f)]('engage_workspace')+'\x20=\x20'+a21_0x39fab4[_0x35f587(0x181)](_0x198de8[_0x35f587(0x170)]))),0x0;}}async function resolveWorkspaceName(_0x1e76e1,_0x5e8e1e){const _0x5cba69=a21_0x2879bc;if(_0x1e76e1)return _0x1e76e1;if(_0x5e8e1e['workspace'])return _0x5e8e1e['workspace'];const _0x4fc740=tryFindTdxConfig(process['cwd']());if(_0x4fc740?.[_0x5cba69(0x167)][_0x5cba69(0x19a)])return _0x4fc740[_0x5cba69(0x167)][_0x5cba69(0x19a)];const _0x216d35=loadSessionContext(_0x5e8e1e[_0x5cba69(0x16e)]);if(_0x216d35?.[_0x5cba69(0x19a)])return _0x216d35['engage_workspace'];return undefined;}
@@ -1 +1 @@
1
- function a22_0x4d42(){const _0x44aac2=['yellow','green','\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','960073RDETgG','update','cyan','resolveWorkspaceId','templateId','\x20templates','5TXWviz','1584248lbbiAu','configDir','-\x20no\x20changes\x20applied','name','def','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\x0aPush\x20summary\x20for\x20workspace\x20\x27','setPhase','execute','error','538353ChUJWA','\x20templates?','2020720YuMKge','Aborted.','session','\x0aValidation\x20errors\x20in\x20','Push\x20','\x20errors:','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','relativePath','action','\x0aError:','verbose','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','engage:template:push','length','230942XTZNhU','Preparing\x20push\x20to\x20workspace\x20\x27','config','\x20template\x20files','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','red','✔\x20Updated\x20','56oPowwG','engage','dryRun','dirname','116166ZpYIGq','created','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Workspace\x20is\x20required.','data','\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)','22tSfvQc','filter','engage_workspace','Pushing\x20templates...','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','Found\x20','\x20\x20\x20\x20','warnings','dim','updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','workspace','resolve','message','6GSckvj','9318200aieawA','create','No\x20template\x20YAML\x20files\x20found\x20in\x20','errors','path'];a22_0x4d42=function(){return _0x44aac2;};return a22_0x4d42();}const a22_0x53a33b=a22_0x1889;(function(_0x39cdb8,_0x36db8e){const _0x520b32=a22_0x1889,_0x2a7861=_0x39cdb8();while(!![]){try{const _0x4078d1=parseInt(_0x520b32(0x101))/0x1+-parseInt(_0x520b32(0x122))/0x2*(-parseInt(_0x520b32(0xf8))/0x3)+-parseInt(_0x520b32(0x114))/0x4+parseInt(_0x520b32(0x107))/0x5*(parseInt(_0x520b32(0x12d))/0x6)+parseInt(_0x520b32(0x129))/0x7*(-parseInt(_0x520b32(0x108))/0x8)+-parseInt(_0x520b32(0x112))/0x9+parseInt(_0x520b32(0xf9))/0xa*(parseInt(_0x520b32(0x133))/0xb);if(_0x4078d1===_0x36db8e)break;else _0x2a7861['push'](_0x2a7861['shift']());}catch(_0x557f9a){_0x2a7861['push'](_0x2a7861['shift']());}}}(a22_0x4d42,0xe1c63));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a22_0x1889(_0x5b9f6d,_0x580a63){_0x5b9f6d=_0x5b9f6d-0xf8;const _0x4d42c9=a22_0x4d42();let _0x18893b=_0x4d42c9[_0x5b9f6d];return _0x18893b;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a22_0x33aa9d from'chalk';import a22_0x4c0050 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']=a22_0x53a33b(0x120);['description']=a22_0x53a33b(0x126);async[a22_0x53a33b(0x110)](_0x8ade17){const _0x3ce16c=a22_0x53a33b,{options:_0x403fe0,args:_0x6175b6,tdx:_0x40a3c5}=_0x8ade17,_0x29faea=_0x403fe0,_0x50cf02=_0x6175b6[0x0],_0x2307a7=_0x50cf02?a22_0x4c0050[_0x3ce16c(0x13f)](_0x50cf02):undefined,_0x1bd2da=_0x2307a7?isYamlFile(_0x2307a7):![];let _0x236bf4;if(_0x1bd2da&&_0x2307a7)_0x236bf4=a22_0x4c0050[_0x3ce16c(0x12c)](_0x2307a7);else _0x2307a7?_0x236bf4=_0x2307a7:_0x236bf4=process['cwd']();let _0x1fe40e;const _0x4dda0e=tryFindTdxConfig(_0x236bf4);_0x4dda0e?.['config'][_0x3ce16c(0x135)]&&(_0x1fe40e=_0x4dda0e[_0x3ce16c(0x124)][_0x3ce16c(0x135)],!_0x1bd2da&&(_0x236bf4=_0x4dda0e[_0x3ce16c(0x109)]));_0x29faea[_0x3ce16c(0x13e)]&&(_0x1fe40e=_0x29faea[_0x3ce16c(0x13e)]);if(!_0x1fe40e){const _0x3f7df1=loadSessionContext(_0x29faea[_0x3ce16c(0x116)]);_0x3f7df1?.[_0x3ce16c(0x135)]&&(_0x1fe40e=_0x3f7df1[_0x3ce16c(0x135)]);}if(!_0x1fe40e)return console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0xfe)](_0x3ce16c(0x130))),console['error'](_0x3ce16c(0x100)),console['error'](_0x3ce16c(0x132)),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[_0x3ce16c(0x111)](_0x3ce16c(0x137)),0x1;let _0x2c5be3;_0x1bd2da&&_0x2307a7?_0x2c5be3=[parseTemplateFile(_0x2307a7,a22_0x4c0050['dirname'](_0x2307a7))]:_0x2c5be3=discoverAndParseTemplateFiles(_0x236bf4);if(_0x2c5be3[_0x3ce16c(0x121)]===0x0)return console['error'](a22_0x33aa9d[_0x3ce16c(0xfe)](_0x3ce16c(0xfb)+_0x236bf4)),console[_0x3ce16c(0x111)](a22_0x33aa9d['dim'](_0x3ce16c(0x11f))),0x1;const _0x13310a=_0x2c5be3['length']===0x1?'1\x20template\x20file:\x20'+_0x2c5be3[0x0][_0x3ce16c(0x10c)][_0x3ce16c(0x10b)]:_0x2c5be3[_0x3ce16c(0x121)]+_0x3ce16c(0x125);console[_0x3ce16c(0x111)](_0x3ce16c(0x138)+a22_0x33aa9d[_0x3ce16c(0x103)](_0x13310a));let _0xd9ab4a=![];for(const _0x5b92e7 of _0x2c5be3){const _0x309246=validateTemplateDef(_0x5b92e7[_0x3ce16c(0x10c)]);if(!_0x309246['valid']){_0xd9ab4a=!![],console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x127)](_0x3ce16c(0x117)+_0x5b92e7[_0x3ce16c(0x11b)]+':'));for(const _0x15e44c of _0x309246['errors']){console[_0x3ce16c(0x111)]('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0x127)]('✗')+'\x20'+_0x15e44c['path']+':\x20'+_0x15e44c[_0x3ce16c(0x140)]);}}for(const _0x199035 of _0x309246[_0x3ce16c(0x13a)]){console[_0x3ce16c(0x111)]('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0xfe)]('⚠')+'\x20'+_0x199035[_0x3ce16c(0xfd)]+':\x20'+_0x199035[_0x3ce16c(0x140)]);}}if(_0xd9ab4a)return console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x127)](_0x3ce16c(0x11a))),0x1;const _0x299ccc=await _0x40a3c5[_0x3ce16c(0x12a)][_0x3ce16c(0x104)](_0x1fe40e),_0x1da7d0=await withProgressSpinner(_0x3ce16c(0x123)+_0x1fe40e+'\x27...',_0x2856be=>preparePush({'engage':_0x40a3c5['engage']},_0x2c5be3,_0x299ccc,{'progress':{'update':_0x118052=>_0x2856be[_0x3ce16c(0x10f)](_0x118052)}}),{'verbose':_0x29faea['verbose']}),_0x131816=_0x1da7d0[_0x3ce16c(0x131)];await withProgressSpinner('Resolving\x20references...',_0x5a742b=>resolveAndBuildInputs({'engage':_0x40a3c5['engage']},_0x131816,_0x299ccc,{'progress':{'update':_0xfd1f36=>_0x5a742b['setPhase'](_0xfd1f36)}}),{'verbose':_0x29faea[_0x3ce16c(0x11e)]});const _0x1d0388=_0x131816[_0x3ce16c(0x134)](_0x1b798e=>_0x1b798e[_0x3ce16c(0x11c)]===_0x3ce16c(0xfa)),_0x5287b2=_0x131816[_0x3ce16c(0x134)](_0x5953b0=>_0x5953b0['action']===_0x3ce16c(0x102));console[_0x3ce16c(0x111)](_0x3ce16c(0x10e)+_0x1fe40e+'\x27:');if(_0x1d0388[_0x3ce16c(0x121)]>0x0){console[_0x3ce16c(0x111)]('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0xff)]('+\x20'+_0x1d0388[_0x3ce16c(0x121)]+'\x20new\x20templates:'));for(const _0x167798 of _0x1d0388){console[_0x3ce16c(0x111)]('\x20\x20\x20\x20'+a22_0x33aa9d[_0x3ce16c(0xff)]('+')+'\x20'+_0x167798[_0x3ce16c(0x10c)][_0x3ce16c(0x10b)]);}}if(_0x5287b2[_0x3ce16c(0x121)]>0x0){console['error']('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0xfe)]('~\x20'+_0x5287b2[_0x3ce16c(0x121)]+'\x20templates\x20to\x20update:'));for(const _0x115877 of _0x5287b2){console[_0x3ce16c(0x111)](_0x3ce16c(0x139)+a22_0x33aa9d['yellow']('~')+'\x20'+_0x115877[_0x3ce16c(0x10c)][_0x3ce16c(0x10b)]);}}if(_0x1d0388[_0x3ce16c(0x121)]===0x0&&_0x5287b2['length']===0x0)return console['error'](a22_0x33aa9d[_0x3ce16c(0xff)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x29faea[_0x3ce16c(0x12b)])return console['error'](a22_0x33aa9d[_0x3ce16c(0xfe)](_0x3ce16c(0x10d))),0x0;if(!_0x29faea['yes']){if(!isInteractive())return console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x127)](_0x3ce16c(0x11d)),_0x3ce16c(0x13d)),console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x13b)](_0x3ce16c(0x12f))),0x1;const _0x1790af=await confirmKey(_0x3ce16c(0x118)+(_0x1d0388[_0x3ce16c(0x121)]+_0x5287b2[_0x3ce16c(0x121)])+_0x3ce16c(0x113));if(!_0x1790af)return console['error'](a22_0x33aa9d['yellow'](_0x3ce16c(0x115)),_0x3ce16c(0x10a)),0x1;}const _0x1a50a0=await withProgressSpinner(_0x3ce16c(0x136),_0x747bf8=>executePush({'engage':_0x40a3c5[_0x3ce16c(0x12a)]},_0x131816,{'progress':{'update':_0x2571cc=>_0x747bf8['setPhase'](_0x2571cc)}}),{'verbose':_0x29faea[_0x3ce16c(0x11e)]}),_0x304a52=_0x1a50a0[_0x3ce16c(0x131)];for(const _0x291240 of _0x304a52['results']){if(_0x291240[_0x3ce16c(0x105)]&&(_0x291240['action']===_0x3ce16c(0x12e)||_0x291240[_0x3ce16c(0x11c)]===_0x3ce16c(0x13c))){const _0x2cb2da=getTemplateUrl(_0x29faea['site'],_0x299ccc,_0x291240[_0x3ce16c(0x105)]),_0x43f919=_0x291240['action']===_0x3ce16c(0x12e)?'+':'~',_0x17e2c0=_0x291240[_0x3ce16c(0x11c)]==='created'?a22_0x33aa9d[_0x3ce16c(0xff)](_0x43f919):a22_0x33aa9d[_0x3ce16c(0xfe)](_0x43f919);console[_0x3ce16c(0x111)]('\x20\x20'+_0x17e2c0+'\x20'+hyperlink(_0x291240[_0x3ce16c(0x10b)],_0x2cb2da)+'\x20'+a22_0x33aa9d[_0x3ce16c(0x13b)](_0x2cb2da));}}_0x304a52[_0x3ce16c(0x12e)]>0x0&&console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0xff)]('✔\x20Created\x20'+_0x304a52[_0x3ce16c(0x12e)]+'\x20templates'));_0x304a52[_0x3ce16c(0x13c)]>0x0&&console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0xff)](_0x3ce16c(0x128)+_0x304a52[_0x3ce16c(0x13c)]+_0x3ce16c(0x106)));if(_0x304a52[_0x3ce16c(0xfc)][_0x3ce16c(0x121)]>0x0){console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x127)]('✘\x20'+_0x304a52[_0x3ce16c(0xfc)][_0x3ce16c(0x121)]+_0x3ce16c(0x119)));for(const _0x305d4e of _0x304a52[_0x3ce16c(0xfc)]){console['error']('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0x127)](_0x305d4e[_0x3ce16c(0x10b)])+':\x20'+_0x305d4e[_0x3ce16c(0x111)]);}}return saveSessionContext({'engage_workspace':_0x1fe40e},_0x29faea[_0x3ce16c(0x116)]),_0x304a52['errors']['length']>0x0?0x1:0x0;}}
1
+ function a22_0x46d7(){const _0x33c3ea=['3119340AeLhKd','engage_workspace','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','engage:template:push','cwd','red','resolve','name','filter','updated','Found\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20template\x20files','created','verbose','\x20\x20\x20\x20','45uUSJdh','site','5982bTVOGp','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','message','session','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','✔\x20Updated\x20','1772656bTFDFn','configDir','dryRun','1173462CIMSEK','engage','cyan','errors','\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','\x20new\x20templates:','relativePath','length','\x20templates\x20to\x20update:','execute','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x20errors:','Preparing\x20push\x20to\x20workspace\x20\x27','-\x20no\x20changes\x20applied','189524rUUWEg','\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)','setPhase','\x27...','results','error','11394124uTzYEt','config','templateId','1\x20template\x20file:\x20','description','yellow','dim','51NcrxCN','✔\x20Created\x20','\x20templates?','workspace','def','valid','dirname','action','path','Resolving\x20references...','42461091sJGzdv','data','green','update','\x0aValidation\x20errors\x20in\x20','Push\x20','resolveWorkspaceId'];a22_0x46d7=function(){return _0x33c3ea;};return a22_0x46d7();}function a22_0x55d5(_0x3a205c,_0x44f3d9){_0x3a205c=_0x3a205c-0x1b7;const _0x46d761=a22_0x46d7();let _0x55d580=_0x46d761[_0x3a205c];return _0x55d580;}const a22_0x164782=a22_0x55d5;(function(_0x3ea84b,_0x2081ac){const _0x43dad8=a22_0x55d5,_0x16b7ee=_0x3ea84b();while(!![]){try{const _0x8843=-parseInt(_0x43dad8(0x1fc))/0x1+-parseInt(_0x43dad8(0x1e1))/0x2+parseInt(_0x43dad8(0x1d0))/0x3*(parseInt(_0x43dad8(0x1c3))/0x4)+parseInt(_0x43dad8(0x1f1))/0x5*(-parseInt(_0x43dad8(0x1f3))/0x6)+-parseInt(_0x43dad8(0x1c9))/0x7+-parseInt(_0x43dad8(0x1f9))/0x8+parseInt(_0x43dad8(0x1da))/0x9;if(_0x8843===_0x2081ac)break;else _0x16b7ee['push'](_0x16b7ee['shift']());}catch(_0x292976){_0x16b7ee['push'](_0x16b7ee['shift']());}}}(a22_0x46d7,0xe3875));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{isYamlFile}from'../sdk/segment/file-discovery.js';import a22_0x34d889 from'chalk';import a22_0x498ba5 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{[a22_0x164782(0x1e8)]=a22_0x164782(0x1e4);[a22_0x164782(0x1cd)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a22_0x164782(0x1be)](_0x24fa63){const _0x188a42=a22_0x164782,{options:_0x5ace48,args:_0x448094,tdx:_0x530c44}=_0x24fa63,_0x29b20f=_0x5ace48,_0x20dbaa=_0x448094[0x0],_0x17f1b9=_0x20dbaa?a22_0x498ba5[_0x188a42(0x1e7)](_0x20dbaa):undefined,_0x11a5fc=_0x17f1b9?isYamlFile(_0x17f1b9):![];let _0x5bda3a;if(_0x11a5fc&&_0x17f1b9)_0x5bda3a=a22_0x498ba5['dirname'](_0x17f1b9);else _0x17f1b9?_0x5bda3a=_0x17f1b9:_0x5bda3a=process[_0x188a42(0x1e5)]();let _0x4bf234;const _0x7f4a65=tryFindTdxConfig(_0x5bda3a);_0x7f4a65?.[_0x188a42(0x1ca)][_0x188a42(0x1e2)]&&(_0x4bf234=_0x7f4a65['config'][_0x188a42(0x1e2)],!_0x11a5fc&&(_0x5bda3a=_0x7f4a65[_0x188a42(0x1fa)]));_0x29b20f[_0x188a42(0x1d3)]&&(_0x4bf234=_0x29b20f[_0x188a42(0x1d3)]);if(!_0x4bf234){const _0x274508=loadSessionContext(_0x29b20f['session']);_0x274508?.[_0x188a42(0x1e2)]&&(_0x4bf234=_0x274508['engage_workspace']);}if(!_0x4bf234)return console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1ce)]('Workspace\x20is\x20required.')),console[_0x188a42(0x1c8)]('\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'),console['error'](_0x188a42(0x1c4)),console[_0x188a42(0x1c8)](_0x188a42(0x1b9)),console[_0x188a42(0x1c8)](_0x188a42(0x1f7)),0x1;let _0xf88c03;_0x11a5fc&&_0x17f1b9?_0xf88c03=[parseTemplateFile(_0x17f1b9,a22_0x498ba5[_0x188a42(0x1d6)](_0x17f1b9))]:_0xf88c03=discoverAndParseTemplateFiles(_0x5bda3a);if(_0xf88c03[_0x188a42(0x1bc)]===0x0)return console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1ce)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x5bda3a)),console['error'](a22_0x34d889['dim'](_0x188a42(0x1e3))),0x1;const _0x183c72=_0xf88c03[_0x188a42(0x1bc)]===0x1?_0x188a42(0x1cc)+_0xf88c03[0x0][_0x188a42(0x1d4)]['name']:_0xf88c03[_0x188a42(0x1bc)]+_0x188a42(0x1ed);console[_0x188a42(0x1c8)](_0x188a42(0x1eb)+a22_0x34d889[_0x188a42(0x1fe)](_0x183c72));let _0x58a390=![];for(const _0x3e8309 of _0xf88c03){const _0xfd6f7d=validateTemplateDef(_0x3e8309[_0x188a42(0x1d4)]);if(!_0xfd6f7d[_0x188a42(0x1d5)]){_0x58a390=!![],console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1e6)](_0x188a42(0x1de)+_0x3e8309[_0x188a42(0x1bb)]+':'));for(const _0x1bf7e9 of _0xfd6f7d[_0x188a42(0x1b7)]){console[_0x188a42(0x1c8)]('\x20\x20'+a22_0x34d889[_0x188a42(0x1e6)]('✗')+'\x20'+_0x1bf7e9[_0x188a42(0x1d8)]+':\x20'+_0x1bf7e9['message']);}}for(const _0x58c358 of _0xfd6f7d['warnings']){console[_0x188a42(0x1c8)]('\x20\x20'+a22_0x34d889['yellow']('⚠')+'\x20'+_0x58c358['path']+':\x20'+_0x58c358[_0x188a42(0x1f5)]);}}if(_0x58a390)return console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1e6)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x3c09aa=await _0x530c44[_0x188a42(0x1fd)][_0x188a42(0x1e0)](_0x4bf234),_0x3a24c1=await withProgressSpinner(_0x188a42(0x1c1)+_0x4bf234+_0x188a42(0x1c6),_0x358dae=>preparePush({'engage':_0x530c44[_0x188a42(0x1fd)]},_0xf88c03,_0x3c09aa,{'progress':{'update':_0xcf4561=>_0x358dae[_0x188a42(0x1c5)](_0xcf4561)}}),{'verbose':_0x29b20f['verbose']}),_0xada9e0=_0x3a24c1[_0x188a42(0x1db)];await withProgressSpinner(_0x188a42(0x1d9),_0x5a9c4d=>resolveAndBuildInputs({'engage':_0x530c44[_0x188a42(0x1fd)]},_0xada9e0,_0x3c09aa,{'progress':{'update':_0x4b3af6=>_0x5a9c4d['setPhase'](_0x4b3af6)}}),{'verbose':_0x29b20f[_0x188a42(0x1ef)]});const _0x3dde38=_0xada9e0[_0x188a42(0x1e9)](_0x4c7fbf=>_0x4c7fbf['action']==='create'),_0x3e76e3=_0xada9e0[_0x188a42(0x1e9)](_0x11f224=>_0x11f224['action']===_0x188a42(0x1dd));console['error'](_0x188a42(0x1bf)+_0x4bf234+'\x27:');if(_0x3dde38['length']>0x0){console['error']('\x20\x20'+a22_0x34d889[_0x188a42(0x1dc)]('+\x20'+_0x3dde38[_0x188a42(0x1bc)]+_0x188a42(0x1ba)));for(const _0x19db1f of _0x3dde38){console[_0x188a42(0x1c8)](_0x188a42(0x1f0)+a22_0x34d889['green']('+')+'\x20'+_0x19db1f[_0x188a42(0x1d4)][_0x188a42(0x1e8)]);}}if(_0x3e76e3['length']>0x0){console[_0x188a42(0x1c8)]('\x20\x20'+a22_0x34d889[_0x188a42(0x1ce)]('~\x20'+_0x3e76e3[_0x188a42(0x1bc)]+_0x188a42(0x1bd)));for(const _0x114e5b of _0x3e76e3){console[_0x188a42(0x1c8)](_0x188a42(0x1f0)+a22_0x34d889[_0x188a42(0x1ce)]('~')+'\x20'+_0x114e5b[_0x188a42(0x1d4)]['name']);}}if(_0x3dde38[_0x188a42(0x1bc)]===0x0&&_0x3e76e3[_0x188a42(0x1bc)]===0x0)return console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1dc)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x29b20f[_0x188a42(0x1fb)])return console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1ce)](_0x188a42(0x1f4))),0x0;if(!_0x29b20f['yes']){if(!isInteractive())return console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1e6)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x188a42(0x1c8)](a22_0x34d889['dim'](_0x188a42(0x1ec))),0x1;const _0x1d2a37=await confirmKey(_0x188a42(0x1df)+(_0x3dde38[_0x188a42(0x1bc)]+_0x3e76e3[_0x188a42(0x1bc)])+_0x188a42(0x1d2));if(!_0x1d2a37)return console['error'](a22_0x34d889[_0x188a42(0x1ce)]('Aborted.'),_0x188a42(0x1c2)),0x1;}const _0x7a4d57=await withProgressSpinner('Pushing\x20templates...',_0x179ee8=>executePush({'engage':_0x530c44[_0x188a42(0x1fd)]},_0xada9e0,{'progress':{'update':_0x73f70f=>_0x179ee8[_0x188a42(0x1c5)](_0x73f70f)}}),{'verbose':_0x29b20f[_0x188a42(0x1ef)]}),_0x29b4e5=_0x7a4d57['data'];for(const _0x26d101 of _0x29b4e5[_0x188a42(0x1c7)]){if(_0x26d101[_0x188a42(0x1cb)]&&(_0x26d101[_0x188a42(0x1d7)]===_0x188a42(0x1ee)||_0x26d101[_0x188a42(0x1d7)]==='updated')){const _0xc3261=getTemplateUrl(_0x29b20f[_0x188a42(0x1f2)],_0x3c09aa,_0x26d101['templateId']),_0x4b0e93=_0x26d101['action']===_0x188a42(0x1ee)?'+':'~',_0x1ff6e9=_0x26d101[_0x188a42(0x1d7)]==='created'?a22_0x34d889[_0x188a42(0x1dc)](_0x4b0e93):a22_0x34d889[_0x188a42(0x1ce)](_0x4b0e93);console[_0x188a42(0x1c8)]('\x20\x20'+_0x1ff6e9+'\x20'+hyperlink(_0x26d101[_0x188a42(0x1e8)],_0xc3261)+'\x20'+a22_0x34d889[_0x188a42(0x1cf)](_0xc3261));}}_0x29b4e5[_0x188a42(0x1ee)]>0x0&&console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1dc)](_0x188a42(0x1d1)+_0x29b4e5['created']+_0x188a42(0x1b8)));_0x29b4e5[_0x188a42(0x1ea)]>0x0&&console[_0x188a42(0x1c8)](a22_0x34d889[_0x188a42(0x1dc)](_0x188a42(0x1f8)+_0x29b4e5['updated']+'\x20templates'));if(_0x29b4e5[_0x188a42(0x1b7)][_0x188a42(0x1bc)]>0x0){console[_0x188a42(0x1c8)](a22_0x34d889['red']('✘\x20'+_0x29b4e5[_0x188a42(0x1b7)]['length']+_0x188a42(0x1c0)));for(const _0x1a9b14 of _0x29b4e5['errors']){console[_0x188a42(0x1c8)]('\x20\x20'+a22_0x34d889['red'](_0x1a9b14[_0x188a42(0x1e8)])+':\x20'+_0x1a9b14[_0x188a42(0x1c8)]);}}return saveSessionContext({'engage_workspace':_0x4bf234},_0x29b20f[_0x188a42(0x1f6)]),_0x29b4e5[_0x188a42(0x1b7)]['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a23_0x13a385=a23_0x668f;(function(_0x5bea20,_0x33f07){const _0x57e6b5=a23_0x668f,_0xe1176e=_0x5bea20();while(!![]){try{const _0x3f7bbd=-parseInt(_0x57e6b5(0x18a))/0x1*(parseInt(_0x57e6b5(0x186))/0x2)+parseInt(_0x57e6b5(0x1af))/0x3+parseInt(_0x57e6b5(0x19e))/0x4+parseInt(_0x57e6b5(0x199))/0x5*(parseInt(_0x57e6b5(0x1b3))/0x6)+-parseInt(_0x57e6b5(0x19b))/0x7*(parseInt(_0x57e6b5(0x1b4))/0x8)+-parseInt(_0x57e6b5(0x1a9))/0x9+parseInt(_0x57e6b5(0x197))/0xa;if(_0x3f7bbd===_0x33f07)break;else _0xe1176e['push'](_0xe1176e['shift']());}catch(_0x2b94c0){_0xe1176e['push'](_0xe1176e['shift']());}}}(a23_0x223f,0x5788a));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a23_0x668f(_0xb29cae,_0x591b1a){_0xb29cae=_0xb29cae-0x186;const _0x223f96=a23_0x223f();let _0x668f85=_0x223f96[_0xb29cae];return _0x668f85;}import a23_0x58e041 from'chalk';function a23_0x223f(){const _0x233966=['length','\x20non-template\x20file(s)\x20skipped','warnings','template','valid','2421333ORKMFW','\x20warning(s)','\x20non-template\x20file(s)\x20skipped)','endsWith','warningCount','green','213879QzCNuo','engage:template:validate','.yml','log','2568GPHVuL','17704tgDQkd','2pAErCL','relativePath','\x20template(s)\x20with\x20errors,\x20','invalidCount','109591BjCghU','yellow','verbose','errors','description','validCount','error','resolve','✔\x20All\x20','red','\x20valid','\x20warning(s)\x20found','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','4103140VZEnpp','dim','6980WlaTGi','No\x20template\x20YAML\x20files\x20found\x20in\x20','1218QYkbZd','name','reason','172532XZpdHc','\x20(skipped:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','cwd','filter','skippedCount'];a23_0x223f=function(){return _0x233966;};return a23_0x223f();}import a23_0x7b9175 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a23_0x13a385(0x19c)]=a23_0x13a385(0x1b0);[a23_0x13a385(0x18e)]='Validate\x20template\x20YAML\x20files';async['execute'](_0x560581){const _0x4a90f2=a23_0x13a385,{options:_0x5cb705,args:_0x5ab12d}=_0x560581,_0x33736f=_0x5cb705,_0x25f818=_0x5ab12d[0x0],_0x1a448b=_0x25f818?a23_0x7b9175[_0x4a90f2(0x191)](_0x25f818):undefined,_0x832db9=_0x1a448b?isYamlFile(_0x1a448b):![];let _0x2c1611,_0x99387;if(_0x832db9&&_0x1a448b)_0x2c1611=a23_0x7b9175['dirname'](_0x1a448b),_0x99387=_0x1a448b;else _0x1a448b?_0x2c1611=_0x1a448b:_0x2c1611=process[_0x4a90f2(0x1a1)]();if(!_0x99387&&!existsSync(_0x2c1611))return console[_0x4a90f2(0x190)](a23_0x58e041['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x2c1611+'\x0a')),0x1;let _0x1a9310;if(_0x99387){if(!_0x99387[_0x4a90f2(0x1ac)](_0x4a90f2(0x1b1))&&!_0x99387['endsWith']('.yaml'))return console['error'](a23_0x58e041['red'](_0x4a90f2(0x1a0)+_0x99387+'\x0a')),0x1;_0x1a9310=[_0x99387];}else _0x1a9310=findYamlFiles(_0x2c1611);if(_0x1a9310['length']===0x0)return console[_0x4a90f2(0x190)](a23_0x58e041[_0x4a90f2(0x193)](_0x4a90f2(0x196)+_0x2c1611+'\x0a')),0x1;const _0x26b44e=validateYamlFiles(_0x1a9310,_0x2c1611,{'filterType':_0x4a90f2(0x1a7)}),_0x10dee0=calculateSummary(_0x26b44e),_0x5d6ace=_0x26b44e[_0x4a90f2(0x1a2)](isValidationResult);if(_0x5d6ace[_0x4a90f2(0x1a4)]===0x0)return console['error'](a23_0x58e041[_0x4a90f2(0x18b)](_0x4a90f2(0x19a)+_0x2c1611+'\x0a')),_0x10dee0[_0x4a90f2(0x1a3)]>0x0&&console[_0x4a90f2(0x190)](a23_0x58e041[_0x4a90f2(0x198)]('('+_0x10dee0[_0x4a90f2(0x1a3)]+_0x4a90f2(0x1ab))),0x0;for(const _0x85aceb of _0x26b44e){if(!isValidationResult(_0x85aceb)){_0x33736f[_0x4a90f2(0x18c)]&&console[_0x4a90f2(0x1b2)](a23_0x58e041[_0x4a90f2(0x198)]('-\x20'+_0x85aceb[_0x4a90f2(0x187)]+_0x4a90f2(0x19f)+_0x85aceb[_0x4a90f2(0x19d)]+')'));continue;}const {relativePath:_0x47802e,source:_0x3471dd,result:_0x3d0bfe}=_0x85aceb;if(_0x3d0bfe[_0x4a90f2(0x1a8)]&&_0x3d0bfe[_0x4a90f2(0x1a6)]['length']===0x0)_0x33736f[_0x4a90f2(0x18c)]&&console[_0x4a90f2(0x1b2)](a23_0x58e041[_0x4a90f2(0x1ae)]('✔\x20'+_0x47802e));else _0x3d0bfe[_0x4a90f2(0x1a8)]?(console[_0x4a90f2(0x1b2)](a23_0x58e041['yellow']('⚠\x20'+_0x47802e+':\x20'+_0x3d0bfe[_0x4a90f2(0x1a6)][_0x4a90f2(0x1a4)]+_0x4a90f2(0x1aa))),console[_0x4a90f2(0x1b2)](formatValidationResult(_0x3d0bfe,_0x3471dd,_0x47802e))):(console[_0x4a90f2(0x1b2)](a23_0x58e041[_0x4a90f2(0x193)]('✖\x20'+_0x47802e+':\x20'+_0x3d0bfe[_0x4a90f2(0x18d)]['length']+'\x20error(s)')),console[_0x4a90f2(0x1b2)](formatValidationResult(_0x3d0bfe,_0x3471dd,_0x47802e)));}return console[_0x4a90f2(0x1b2)](''),_0x10dee0['hasErrors']?(console[_0x4a90f2(0x1b2)](a23_0x58e041[_0x4a90f2(0x193)]('Validation\x20failed:\x20'+_0x10dee0[_0x4a90f2(0x189)]+_0x4a90f2(0x188)+_0x10dee0[_0x4a90f2(0x18f)]+_0x4a90f2(0x194))),_0x10dee0[_0x4a90f2(0x1ad)]>0x0&&console[_0x4a90f2(0x1b2)](a23_0x58e041['yellow'](_0x10dee0[_0x4a90f2(0x1ad)]+_0x4a90f2(0x195))),_0x10dee0[_0x4a90f2(0x1a3)]>0x0&&console[_0x4a90f2(0x1b2)](a23_0x58e041[_0x4a90f2(0x198)](_0x10dee0[_0x4a90f2(0x1a3)]+_0x4a90f2(0x1a5))),0x1):(console[_0x4a90f2(0x1b2)](a23_0x58e041['green'](_0x4a90f2(0x192)+_0x10dee0['validCount']+'\x20template(s)\x20valid')),_0x10dee0['warningCount']>0x0&&console[_0x4a90f2(0x1b2)](a23_0x58e041[_0x4a90f2(0x18b)](_0x10dee0[_0x4a90f2(0x1ad)]+_0x4a90f2(0x195))),_0x10dee0[_0x4a90f2(0x1a3)]>0x0&&console[_0x4a90f2(0x1b2)](a23_0x58e041[_0x4a90f2(0x198)](_0x10dee0[_0x4a90f2(0x1a3)]+_0x4a90f2(0x1a5))),0x0);}}
1
+ const a23_0x30560e=a23_0x528f;(function(_0x1350ec,_0x121fc6){const _0x17ccec=a23_0x528f,_0x4bff96=_0x1350ec();while(!![]){try{const _0x23fe3b=-parseInt(_0x17ccec(0xc8))/0x1*(-parseInt(_0x17ccec(0xcc))/0x2)+parseInt(_0x17ccec(0xbf))/0x3+parseInt(_0x17ccec(0xe9))/0x4+-parseInt(_0x17ccec(0xc5))/0x5+-parseInt(_0x17ccec(0xca))/0x6+-parseInt(_0x17ccec(0xdf))/0x7+parseInt(_0x17ccec(0xcd))/0x8*(-parseInt(_0x17ccec(0xdd))/0x9);if(_0x23fe3b===_0x121fc6)break;else _0x4bff96['push'](_0x4bff96['shift']());}catch(_0x6a13a1){_0x4bff96['push'](_0x4bff96['shift']());}}}(a23_0x1e42,0xdfc12));function a23_0x528f(_0x3492fd,_0x2c23f4){_0x3492fd=_0x3492fd-0xbc;const _0x1e4206=a23_0x1e42();let _0x528ff6=_0x1e4206[_0x3492fd];return _0x528ff6;}import{BaseCommand}from'./command.js';function a23_0x1e42(){const _0x259432=['warnings','yellow','Validation\x20failed:\x20','relativePath','errors','reason','Validate\x20template\x20YAML\x20files','green','6738812KfhTkc','execute','red','✔\x20All\x20','5453352IdjviB','.yaml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20warning(s)','\x20valid','4454625nOvLRz','skippedCount','invalidCount','1PyCWwT','\x20non-template\x20file(s)\x20skipped)','6212160dJFhGS','dirname','2365742gzeLJi','58960hyUrKS','\x20template(s)\x20with\x20errors,\x20','.yml','engage:template:validate','error','validCount','filter','hasErrors','length','template','No\x20template\x20YAML\x20files\x20found\x20in\x20','dim','verbose','log','warningCount','resolve','324MFWeAF','\x20non-template\x20file(s)\x20skipped','11040785ySjqlt','valid'];a23_0x1e42=function(){return _0x259432;};return a23_0x1e42();}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a23_0x2b5bd4 from'chalk';import a23_0x276c78 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a23_0x30560e(0xd0);['description']=a23_0x30560e(0xe7);async[a23_0x30560e(0xbc)](_0x34b312){const _0x164996=a23_0x30560e,{options:_0x1a4bf6,args:_0x1047cf}=_0x34b312,_0x4991fd=_0x1a4bf6,_0x284392=_0x1047cf[0x0],_0x126b25=_0x284392?a23_0x276c78[_0x164996(0xdc)](_0x284392):undefined,_0x1678af=_0x126b25?isYamlFile(_0x126b25):![];let _0x1afc6e,_0x10d155;if(_0x1678af&&_0x126b25)_0x1afc6e=a23_0x276c78[_0x164996(0xcb)](_0x126b25),_0x10d155=_0x126b25;else _0x126b25?_0x1afc6e=_0x126b25:_0x1afc6e=process['cwd']();if(!_0x10d155&&!existsSync(_0x1afc6e))return console['error'](a23_0x2b5bd4[_0x164996(0xbd)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1afc6e+'\x0a')),0x1;let _0x532eca;if(_0x10d155){if(!_0x10d155['endsWith'](_0x164996(0xcf))&&!_0x10d155['endsWith'](_0x164996(0xc0)))return console[_0x164996(0xd1)](a23_0x2b5bd4[_0x164996(0xbd)](_0x164996(0xc2)+_0x10d155+'\x0a')),0x1;_0x532eca=[_0x10d155];}else _0x532eca=findYamlFiles(_0x1afc6e);if(_0x532eca[_0x164996(0xd5)]===0x0)return console[_0x164996(0xd1)](a23_0x2b5bd4[_0x164996(0xbd)](_0x164996(0xc1)+_0x1afc6e+'\x0a')),0x1;const _0xec36ce=validateYamlFiles(_0x532eca,_0x1afc6e,{'filterType':_0x164996(0xd6)}),_0x408f0f=calculateSummary(_0xec36ce),_0x56a787=_0xec36ce[_0x164996(0xd3)](isValidationResult);if(_0x56a787[_0x164996(0xd5)]===0x0)return console[_0x164996(0xd1)](a23_0x2b5bd4[_0x164996(0xe2)](_0x164996(0xd7)+_0x1afc6e+'\x0a')),_0x408f0f['skippedCount']>0x0&&console[_0x164996(0xd1)](a23_0x2b5bd4[_0x164996(0xd8)]('('+_0x408f0f[_0x164996(0xc6)]+_0x164996(0xc9))),0x0;for(const _0x4d0fba of _0xec36ce){if(!isValidationResult(_0x4d0fba)){_0x4991fd['verbose']&&console[_0x164996(0xda)](a23_0x2b5bd4[_0x164996(0xd8)]('-\x20'+_0x4d0fba[_0x164996(0xe4)]+'\x20(skipped:\x20'+_0x4d0fba[_0x164996(0xe6)]+')'));continue;}const {relativePath:_0x157d3e,source:_0x170dae,result:_0x31a969}=_0x4d0fba;if(_0x31a969[_0x164996(0xe0)]&&_0x31a969[_0x164996(0xe1)]['length']===0x0)_0x4991fd[_0x164996(0xd9)]&&console[_0x164996(0xda)](a23_0x2b5bd4[_0x164996(0xe8)]('✔\x20'+_0x157d3e));else _0x31a969[_0x164996(0xe0)]?(console['log'](a23_0x2b5bd4[_0x164996(0xe2)]('⚠\x20'+_0x157d3e+':\x20'+_0x31a969['warnings']['length']+_0x164996(0xc3))),console[_0x164996(0xda)](formatValidationResult(_0x31a969,_0x170dae,_0x157d3e))):(console['log'](a23_0x2b5bd4[_0x164996(0xbd)]('✖\x20'+_0x157d3e+':\x20'+_0x31a969[_0x164996(0xe5)][_0x164996(0xd5)]+'\x20error(s)')),console[_0x164996(0xda)](formatValidationResult(_0x31a969,_0x170dae,_0x157d3e)));}return console[_0x164996(0xda)](''),_0x408f0f[_0x164996(0xd4)]?(console['log'](a23_0x2b5bd4[_0x164996(0xbd)](_0x164996(0xe3)+_0x408f0f[_0x164996(0xc7)]+_0x164996(0xce)+_0x408f0f['validCount']+_0x164996(0xc4))),_0x408f0f['warningCount']>0x0&&console[_0x164996(0xda)](a23_0x2b5bd4[_0x164996(0xe2)](_0x408f0f['warningCount']+'\x20warning(s)\x20found')),_0x408f0f['skippedCount']>0x0&&console['log'](a23_0x2b5bd4['dim'](_0x408f0f['skippedCount']+_0x164996(0xde))),0x1):(console[_0x164996(0xda)](a23_0x2b5bd4[_0x164996(0xe8)](_0x164996(0xbe)+_0x408f0f[_0x164996(0xd2)]+'\x20template(s)\x20valid')),_0x408f0f[_0x164996(0xdb)]>0x0&&console['log'](a23_0x2b5bd4[_0x164996(0xe2)](_0x408f0f[_0x164996(0xdb)]+'\x20warning(s)\x20found')),_0x408f0f['skippedCount']>0x0&&console['log'](a23_0x2b5bd4[_0x164996(0xd8)](_0x408f0f[_0x164996(0xc6)]+_0x164996(0xde))),0x0);}}
@@ -1 +1 @@
1
- {"version":3,"file":"job-command.d.ts","sourceRoot":"","sources":["../../src/commands/job-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAShE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,WAAW,eAAe;IAE7B,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM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x1+-parseInt(_0x1860ec(0x140))/0x2*(-parseInt(_0x1860ec(0x141))/0x3)+parseInt(_0x1860ec(0x13f))/0x4*(parseInt(_0x1860ec(0x161))/0x5)+-parseInt(_0x1860ec(0x172))/0x6*(-parseInt(_0x1860ec(0x184))/0x7)+-parseInt(_0x1860ec(0x143))/0x8*(-parseInt(_0x1860ec(0x164))/0x9)+parseInt(_0x1860ec(0x171))/0xa*(-parseInt(_0x1860ec(0x179))/0xb)+parseInt(_0x1860ec(0x14a))/0xc;if(_0x7e87eb===_0x56cdfc)break;else _0x83760['push'](_0x83760['shift']());}catch(_0x3ec51a){_0x83760['push'](_0x83760['shift']());}}}(a24_0x3c3c,0x4ac6a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a24_0x50ea(_0x4a84ad,_0x58f837){_0x4a84ad=_0x4a84ad-0x13f;const _0x3c3cf4=a24_0x3c3c();let _0x50eae=_0x3c3cf4[_0x4a84ad];return _0x50eae;}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a24_0x3c3c(){const _0x58004d=['5565lThAPk','✔\x20Retrieved\x20','48bZcfkZ','validate','priority','Submitting\x20kill\x20request...','Cancelled','execute','start_at','4911372WIzmWR','✔\x20Job\x20submitted','verbose','name','List\x20jobs','Getting\x20job\x20details...','job_id','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submit\x20a\x20job','end_at','map','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Listing\x20jobs...','limit','status','url','Query:\x20','jobType','\x20job','kill','database','getTime','\x20jobs','5YKTCtz','result','job:kill','380763PanWHp','\x20row','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','hive','type','user_name','job:submit','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Kill\x20a\x20job','information_schema','20fMQhMq','201336INyoxC','trino','Submitting\x20job...','Status\x20filter:\x20','list','jobs','Show\x20job\x20details','3304664zynKNH','created_at','debug','error','substring','args','270357LCyCQy','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job:show','job:result','Job\x20type:\x20','91XWfnVo','length','description','Get\x20job\x20results','data','file','89944GoMBiP','60ZozDcU'];a24_0x3c3c=function(){return _0x58004d;};return a24_0x3c3c();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{[a24_0x19316b(0x14d)]='jobs';[a24_0x19316b(0x186)]=a24_0x19316b(0x14e);async['execute'](_0x58393b){const _0x18fd43=a24_0x19316b,{options:_0x127266,tdx:_0x144590}=_0x58393b,_0x302813=resolveLimit(_0x127266[_0x18fd43(0x157)],DEFAULT_DISPLAY_LIMIT),_0xe1d61d=_0x127266[_0x18fd43(0x158)];_0x127266[_0x18fd43(0x14c)]&&(console[_0x18fd43(0x17c)]('Limit:\x20'+_0x302813+_0x18fd43(0x160)),_0xe1d61d&&console[_0x18fd43(0x17c)](_0x18fd43(0x175)+_0xe1d61d));const _0x12fbab=await withSpinner(_0x18fd43(0x156),()=>_0x144590[_0x18fd43(0x177)][_0x18fd43(0x176)]({'from':0x0,'to':_0x302813-0x1,'status':_0xe1d61d}),{'verbose':_0x127266[_0x18fd43(0x14c)]}),_0x3d3c2c=_0x12fbab[_0x18fd43(0x188)];console[_0x18fd43(0x17c)]('✔\x20Found\x20'+_0x3d3c2c[_0x18fd43(0x185)]+_0x18fd43(0x15c)+(_0x3d3c2c[_0x18fd43(0x185)]!==0x1?'s':''));const _0x433ccf=_0x3d3c2c[_0x18fd43(0x154)](_0x327591=>{const _0x5a7941=_0x18fd43;let _0x5ec334;if(_0x327591[_0x5a7941(0x149)]&&_0x327591[_0x5a7941(0x153)]){const _0x5efb3c=new Date(_0x327591[_0x5a7941(0x149)])[_0x5a7941(0x15f)](),_0x485d2b=new Date(_0x327591[_0x5a7941(0x153)])[_0x5a7941(0x15f)]();_0x5ec334=Math['round']((_0x485d2b-_0x5efb3c)/0x3e8);}return{'job_id':_0x327591[_0x5a7941(0x150)],'type':_0x327591[_0x5a7941(0x16b)],'status':_0x327591[_0x5a7941(0x158)],'user_name':_0x327591[_0x5a7941(0x16c)],'duration_sec':_0x5ec334,'created_at':_0x327591['created_at'],'started_at':_0x327591[_0x5a7941(0x149)],'end_at':_0x327591[_0x5a7941(0x153)]};});return await handleSDKOutput(_0x433ccf,_0x127266),0x0;}}export class JobShowCommand extends BaseCommand{[a24_0x19316b(0x14d)]=a24_0x19316b(0x181);['description']=a24_0x19316b(0x178);[a24_0x19316b(0x144)](_0x4e9278){const _0x83e13a=_0x4e9278['args'][0x0];if(!_0x83e13a)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async['execute'](_0x32ddbd){const _0x260a78=a24_0x19316b,{options:_0x4d675a,args:_0x5ef71b,tdx:_0x385d17}=_0x32ddbd,_0x3ad940=_0x5ef71b[0x0],_0x4e48c4=await withSpinner(_0x260a78(0x14f),()=>_0x385d17['jobs']['show'](_0x3ad940),{'verbose':_0x4d675a[_0x260a78(0x14c)]}),_0x161e97=_0x4e48c4['data'];let _0x5e1fc9;if(_0x161e97['start_at']&&_0x161e97[_0x260a78(0x153)]){const _0x519feb=new Date(_0x161e97[_0x260a78(0x149)])[_0x260a78(0x15f)](),_0x142833=new Date(_0x161e97[_0x260a78(0x153)])['getTime']();_0x5e1fc9=Math['round']((_0x142833-_0x519feb)/0x3e8);}const _0x194e22={'job_id':_0x161e97[_0x260a78(0x150)],'type':_0x161e97['type'],'status':_0x161e97[_0x260a78(0x158)],..._0x161e97['user_name']&&{'user_name':_0x161e97['user_name']},..._0x5e1fc9!==undefined&&{'duration_sec':_0x5e1fc9},..._0x161e97[_0x260a78(0x17a)]&&{'created_at':_0x161e97['created_at']},..._0x161e97[_0x260a78(0x149)]&&{'started_at':_0x161e97['start_at']},..._0x161e97[_0x260a78(0x153)]&&{'end_at':_0x161e97[_0x260a78(0x153)]},..._0x161e97[_0x260a78(0x15e)]&&{'database':_0x161e97['database']},..._0x161e97[_0x260a78(0x145)]!==undefined&&{'priority':_0x161e97[_0x260a78(0x145)]},..._0x161e97[_0x260a78(0x159)]&&{'url':_0x161e97[_0x260a78(0x159)]},..._0x161e97['query']&&{'query':_0x161e97['query']},..._0x161e97['debug']&&{'debug':_0x161e97[_0x260a78(0x17b)]}};return await handleSingleObjectOutput(_0x194e22,_0x4d675a),0x0;}}export class JobKillCommand extends BaseCommand{[a24_0x19316b(0x14d)]=a24_0x19316b(0x163);[a24_0x19316b(0x186)]=a24_0x19316b(0x16f);['validate'](_0x55d631){const _0x2d7eb3=a24_0x19316b,_0x5957ee=_0x55d631[_0x2d7eb3(0x17e)][0x0];if(!_0x5957ee)return _0x2d7eb3(0x169);return undefined;}async[a24_0x19316b(0x148)](_0xffa2e7){const _0x431492=a24_0x19316b,{options:_0x3f5747,args:_0x2ad95a,tdx:_0x3bdfe1}=_0xffa2e7,_0x16487a=_0x2ad95a[0x0];if(!_0x3f5747['yes']){const _0x2af971=await confirm(_0x431492(0x180)+_0x16487a+'?');if(!_0x2af971)return console[_0x431492(0x17c)](_0x431492(0x147)),0x0;}return await withSpinner(_0x431492(0x146),()=>_0x3bdfe1['jobs'][_0x431492(0x15d)](_0x16487a),{'verbose':_0x3f5747[_0x431492(0x14c)]}),console[_0x431492(0x17c)](_0x431492(0x167)+_0x16487a),console[_0x431492(0x17c)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x16487a+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a24_0x19316b(0x14d)]=a24_0x19316b(0x16d);[a24_0x19316b(0x186)]=a24_0x19316b(0x152);async[a24_0x19316b(0x148)](_0x535154){const _0x5414b0=a24_0x19316b,{options:_0x347618,args:_0xea3229,tdx:_0x9d57e}=_0x535154,_0x5343e5=_0x347618[_0x5414b0(0x15b)]||_0x5414b0(0x173),_0x57b105=_0x347618[_0x5414b0(0x189)],_0x5a7978=_0x347618[_0x5414b0(0x15e)]||_0x5414b0(0x170),_0x2e65bc=_0x347618[_0x5414b0(0x162)];if(_0x5343e5!==_0x5414b0(0x173)&&_0x5343e5!==_0x5414b0(0x16a))throw new SDKError(ErrorCode[_0x5414b0(0x168)],_0x5414b0(0x16e));let _0x5e3477;if(_0x57b105){if(_0xea3229[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5414b0(0x151));const _0x53c650=readSqlStatementsFromFile(_0x57b105);if(_0x53c650[_0x5414b0(0x185)]===0x0)throw new SDKError(ErrorCode[_0x5414b0(0x168)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x53c650[_0x5414b0(0x185)]>0x1)throw new SDKError(ErrorCode[_0x5414b0(0x168)],_0x5414b0(0x166));_0x5e3477=_0x53c650[0x0];}else{if(!_0xea3229[0x0])throw new SDKError(ErrorCode[_0x5414b0(0x168)],_0x5414b0(0x155));_0x5e3477=_0xea3229[0x0];}_0x347618['verbose']&&(console[_0x5414b0(0x17c)](_0x5414b0(0x183)+_0x5343e5),console[_0x5414b0(0x17c)]('Database:\x20'+_0x5a7978),console[_0x5414b0(0x17c)](_0x5414b0(0x15a)+_0x5e3477[_0x5414b0(0x17d)](0x0,0x64)+(_0x5e3477[_0x5414b0(0x185)]>0x64?'...':'')));const _0x20d8b0=await withSpinner(_0x5414b0(0x174),()=>_0x9d57e['jobs']['submit'](_0x5a7978,_0x5e3477,_0x5343e5,_0x2e65bc),{'verbose':_0x347618['verbose']}),_0x3fee40=_0x20d8b0[_0x5414b0(0x188)];return console[_0x5414b0(0x17c)](_0x5414b0(0x14b)),console['error']('\x20\x20Job\x20ID:\x20'+_0x3fee40[_0x5414b0(0x150)]),await handleSDKOutput([_0x3fee40],_0x347618),0x0;}}export class JobResultCommand extends BaseCommand{[a24_0x19316b(0x14d)]=a24_0x19316b(0x182);[a24_0x19316b(0x186)]=a24_0x19316b(0x187);['validate'](_0x27a07b){const _0x34cd76=_0x27a07b['args'][0x0];if(!_0x34cd76)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a24_0x19316b(0x148)](_0x18e1b2){const _0x455b74=a24_0x19316b,{options:_0x535318,args:_0x1fa0b2,tdx:_0x5a24a1}=_0x18e1b2,_0x307992=_0x1fa0b2[0x0],_0x93b7c9=await withSpinner('Getting\x20job\x20results...',()=>_0x5a24a1[_0x455b74(0x177)][_0x455b74(0x162)](_0x307992),{'verbose':_0x535318[_0x455b74(0x14c)]}),_0xc7182a=_0x93b7c9[_0x455b74(0x188)];return console[_0x455b74(0x17c)](_0x455b74(0x142)+_0xc7182a[_0x455b74(0x185)]+_0x455b74(0x165)+(_0xc7182a[_0x455b74(0x185)]!==0x1?'s':'')),await handleSDKOutput(_0xc7182a,_0x535318),0x0;}}
1
+ const a24_0x3bcd1e=a24_0x4a09;(function(_0x3bce98,_0x2bf650){const _0x4baa5f=a24_0x4a09,_0x4a418f=_0x3bce98();while(!![]){try{const _0x380b41=-parseInt(_0x4baa5f(0x23a))/0x1*(-parseInt(_0x4baa5f(0x214))/0x2)+-parseInt(_0x4baa5f(0x227))/0x3*(-parseInt(_0x4baa5f(0x23c))/0x4)+parseInt(_0x4baa5f(0x22e))/0x5*(-parseInt(_0x4baa5f(0x1f6))/0x6)+parseInt(_0x4baa5f(0x249))/0x7*(-parseInt(_0x4baa5f(0x235))/0x8)+-parseInt(_0x4baa5f(0x233))/0x9+parseInt(_0x4baa5f(0x20f))/0xa*(-parseInt(_0x4baa5f(0x218))/0xb)+-parseInt(_0x4baa5f(0x24b))/0xc*(-parseInt(_0x4baa5f(0x21c))/0xd);if(_0x380b41===_0x2bf650)break;else _0x4a418f['push'](_0x4a418f['shift']());}catch(_0x592d2c){_0x4a418f['push'](_0x4a418f['shift']());}}}(a24_0x36fa,0x3ea83));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 a24_0x5027a2 from'chalk';function formatDuration(_0x2e772b){const _0x43413f=a24_0x4a09;if(_0x2e772b<0x3c)return _0x2e772b+'s';if(_0x2e772b<0xe10)return Math[_0x43413f(0x20e)](_0x2e772b/0x3c)+'m\x20'+_0x2e772b%0x3c+'s';const _0x4e3937=Math[_0x43413f(0x20e)](_0x2e772b/0xe10),_0x4ce8c9=Math[_0x43413f(0x20e)](_0x2e772b%0xe10/0x3c);return _0x4ce8c9>0x0?_0x4e3937+'h\x20'+_0x4ce8c9+'m':_0x4e3937+'h';}function a24_0x36fa(){const _0xe1ba28=['List\x20jobs','dim','✔\x20Retrieved\x20','job_id','Get\x20job\x20results','floor','170EDTXSd','just\x20now','red','result','Submit\x20a\x20job','16dJoQZG','file','priority','Job\x20type:\x20','219747XFYdEl','log','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','verbose','17082VLDIYH','validate','error','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','round','\x20jobs','...','Getting\x20job\x20results...','abs','join','map','21759SORQAU','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','name','\x20\x20Job\x20ID:\x20','push','m\x20ago','\x20job','37965MQPUFV','database','\x20row','execute','substring','912258xMVTOF','Kill\x20a\x20job','457144ejOZYW','Listing\x20jobs...','length','description','jobType','42495VKskDQ','✔\x20Job\x20submitted','164odITgA','INVALID_ARGUMENT','now','start_at','show','hive','mo\x20ago','query','Status\x20filter:\x20','yes','job:submit','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','jobs','14gPptHk','h\x20ago','4992HVukMo','Database:\x20','d\x20ago','args','Limit:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','Getting\x20job\x20details...','294UiYCkt','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','end_at','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','submit','✔\x20Found\x20','Submitting\x20kill\x20request...','presto','url','type','status','user_name','created_at','debug','job:result','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','getTime','trino','data'];a24_0x36fa=function(){return _0xe1ba28;};return a24_0x36fa();}function formatRelativeTime(_0x130b7d){const _0x5db1fa=a24_0x4a09,_0x5afaed=Date[_0x5db1fa(0x23e)]()-_0x130b7d['getTime'](),_0x562d92=Math[_0x5db1fa(0x20e)](Math[_0x5db1fa(0x224)](_0x5afaed)/0x3e8);if(_0x562d92<0x3c)return _0x5db1fa(0x210);const _0x5e6c85=Math[_0x5db1fa(0x20e)](_0x562d92/0x3c);if(_0x5e6c85<0x3c)return _0x5e6c85+_0x5db1fa(0x22c);const _0x3c3709=Math[_0x5db1fa(0x20e)](_0x5e6c85/0x3c);if(_0x3c3709<0x18)return _0x3c3709+_0x5db1fa(0x24a);const _0x285e30=Math[_0x5db1fa(0x20e)](_0x3c3709/0x18);if(_0x285e30<0x1e)return _0x285e30+_0x5db1fa(0x24d);return Math[_0x5db1fa(0x20e)](_0x285e30/0x1e)+_0x5db1fa(0x242);}export class JobListCommand extends BaseCommand{['name']=a24_0x3bcd1e(0x248);[a24_0x3bcd1e(0x238)]=a24_0x3bcd1e(0x209);async[a24_0x3bcd1e(0x231)](_0x53b039){const _0x5c83d7=a24_0x3bcd1e,{options:_0x358d1c,tdx:_0x288c8a}=_0x53b039,_0x421325=resolveLimit(_0x358d1c['limit'],DEFAULT_DISPLAY_LIMIT),_0x50a887=_0x358d1c[_0x5c83d7(0x200)];_0x358d1c['verbose']&&(console['error'](_0x5c83d7(0x1f3)+_0x421325+_0x5c83d7(0x221)),_0x50a887&&console[_0x5c83d7(0x21e)](_0x5c83d7(0x244)+_0x50a887));const _0x5e6cb4=await withSpinner(_0x5c83d7(0x236),()=>_0x288c8a['jobs']['list']({'from':0x0,'to':_0x421325-0x1,'status':_0x50a887}),{'verbose':_0x358d1c[_0x5c83d7(0x21b)]}),_0x378052=_0x5e6cb4[_0x5c83d7(0x208)];console['error'](_0x5c83d7(0x1fb)+_0x378052[_0x5c83d7(0x237)]+_0x5c83d7(0x22d)+(_0x378052[_0x5c83d7(0x237)]!==0x1?'s':''));const _0x551640=_0x358d1c['site'];if(isStructuredFormat(_0x358d1c)){const _0x2b99e3=_0x378052[_0x5c83d7(0x226)](_0x14e0a8=>{const _0x37f00b=_0x5c83d7;let _0x45cefd;if(_0x14e0a8[_0x37f00b(0x23f)]&&_0x14e0a8['end_at']){const _0x56f62b=new Date(_0x14e0a8[_0x37f00b(0x23f)])[_0x37f00b(0x206)](),_0x50c97c=new Date(_0x14e0a8[_0x37f00b(0x1f8)])[_0x37f00b(0x206)]();_0x45cefd=Math[_0x37f00b(0x220)]((_0x50c97c-_0x56f62b)/0x3e8);}return{'job_id':_0x14e0a8[_0x37f00b(0x20c)],'type':_0x14e0a8['type']===_0x37f00b(0x1fd)?_0x37f00b(0x207):_0x14e0a8[_0x37f00b(0x1ff)],'status':_0x14e0a8[_0x37f00b(0x200)],'user_name':_0x14e0a8['user_name'],'duration_sec':_0x45cefd,'created_at':_0x14e0a8[_0x37f00b(0x202)],'started_at':_0x14e0a8[_0x37f00b(0x23f)],'end_at':_0x14e0a8['end_at']};});await handleSDKOutput(_0x2b99e3,_0x358d1c);}else for(const _0x4f408b of _0x378052){const _0x38dd97=_0x4f408b['status']==='success'?a24_0x5027a2['green']:_0x4f408b[_0x5c83d7(0x200)]===_0x5c83d7(0x21e)?a24_0x5027a2[_0x5c83d7(0x211)]:a24_0x5027a2[_0x5c83d7(0x20a)],_0x39d8b1=_0x38dd97(_0x4f408b[_0x5c83d7(0x200)]),_0x55e357=getJobUrl(_0x551640,_0x4f408b[_0x5c83d7(0x20c)]),_0xc186d5=hyperlink(_0x4f408b[_0x5c83d7(0x20c)],_0x55e357),_0xb6dfe8=a24_0x5027a2['dim'](_0x4f408b[_0x5c83d7(0x1ff)]==='presto'?_0x5c83d7(0x207):_0x4f408b['type']),_0x543e0b=[];if(_0x4f408b['start_at']&&_0x4f408b[_0x5c83d7(0x1f8)]){const _0x25996a=Math[_0x5c83d7(0x220)]((new Date(_0x4f408b['end_at'])[_0x5c83d7(0x206)]()-new Date(_0x4f408b[_0x5c83d7(0x23f)])[_0x5c83d7(0x206)]())/0x3e8);_0x543e0b[_0x5c83d7(0x22b)](formatDuration(_0x25996a));}if(_0x4f408b[_0x5c83d7(0x1f8)])_0x543e0b[_0x5c83d7(0x22b)](formatRelativeTime(new Date(_0x4f408b['end_at'])));else _0x4f408b[_0x5c83d7(0x23f)]&&_0x543e0b[_0x5c83d7(0x22b)](formatRelativeTime(new Date(_0x4f408b['start_at'])));const _0x5715e7=_0x543e0b[_0x5c83d7(0x237)]>0x0?a24_0x5027a2[_0x5c83d7(0x20a)]('\x20'+_0x543e0b[_0x5c83d7(0x225)](',\x20')):'';console[_0x5c83d7(0x219)]('⚡\x20'+_0xc186d5+'\x20'+_0xb6dfe8+'\x20'+_0x39d8b1+_0x5715e7);}return 0x0;}}function a24_0x4a09(_0x5f13b9,_0x3851db){_0x5f13b9=_0x5f13b9-0x1f2;const _0x36fa13=a24_0x36fa();let _0x4a09cd=_0x36fa13[_0x5f13b9];return _0x4a09cd;}export class JobShowCommand extends BaseCommand{[a24_0x3bcd1e(0x229)]='job:show';['description']='Show\x20job\x20details';['validate'](_0x4f7c78){const _0x4face4=a24_0x3bcd1e,_0x5ad018=_0x4f7c78[_0x4face4(0x1f2)][0x0];if(!_0x5ad018)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a24_0x3bcd1e(0x231)](_0x5c945b){const _0xd0f04=a24_0x3bcd1e,{options:_0x70966,args:_0x28a56d,tdx:_0x226c16}=_0x5c945b,_0x5bf1e9=_0x28a56d[0x0],_0x178d19=await withSpinner(_0xd0f04(0x1f5),()=>_0x226c16['jobs'][_0xd0f04(0x240)](_0x5bf1e9),{'verbose':_0x70966[_0xd0f04(0x21b)]}),_0x6c0909=_0x178d19[_0xd0f04(0x208)];let _0x5e2cda;if(_0x6c0909['start_at']&&_0x6c0909['end_at']){const _0x1c7f48=new Date(_0x6c0909[_0xd0f04(0x23f)])[_0xd0f04(0x206)](),_0x1557e8=new Date(_0x6c0909['end_at'])[_0xd0f04(0x206)]();_0x5e2cda=Math[_0xd0f04(0x220)]((_0x1557e8-_0x1c7f48)/0x3e8);}const _0x135b04={'job_id':_0x6c0909[_0xd0f04(0x20c)],'type':_0x6c0909[_0xd0f04(0x1ff)],'status':_0x6c0909[_0xd0f04(0x200)],..._0x6c0909[_0xd0f04(0x201)]&&{'user_name':_0x6c0909['user_name']},..._0x5e2cda!==undefined&&{'duration_sec':_0x5e2cda},..._0x6c0909[_0xd0f04(0x202)]&&{'created_at':_0x6c0909[_0xd0f04(0x202)]},..._0x6c0909['start_at']&&{'started_at':_0x6c0909[_0xd0f04(0x23f)]},..._0x6c0909['end_at']&&{'end_at':_0x6c0909[_0xd0f04(0x1f8)]},..._0x6c0909['database']&&{'database':_0x6c0909[_0xd0f04(0x22f)]},..._0x6c0909[_0xd0f04(0x216)]!==undefined&&{'priority':_0x6c0909[_0xd0f04(0x216)]},..._0x6c0909['url']&&{'url':_0x6c0909[_0xd0f04(0x1fe)]},..._0x6c0909[_0xd0f04(0x243)]&&{'query':_0x6c0909[_0xd0f04(0x243)]},..._0x6c0909[_0xd0f04(0x203)]&&{'debug':_0x6c0909['debug']}};return await handleSingleObjectOutput(_0x135b04,_0x70966),0x0;}}export class JobKillCommand extends BaseCommand{[a24_0x3bcd1e(0x229)]='job:kill';[a24_0x3bcd1e(0x238)]=a24_0x3bcd1e(0x234);[a24_0x3bcd1e(0x21d)](_0x5a6786){const _0x17bb8c=a24_0x3bcd1e,_0x45eb67=_0x5a6786['args'][0x0];if(!_0x45eb67)return _0x17bb8c(0x21a);return undefined;}async['execute'](_0x5443d6){const _0x43557f=a24_0x3bcd1e,{options:_0x4cde92,args:_0x28ac47,tdx:_0x4651f4}=_0x5443d6,_0x321240=_0x28ac47[0x0];if(!_0x4cde92[_0x43557f(0x245)]){const _0x26022f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x321240+'?');if(!_0x26022f)return console[_0x43557f(0x21e)]('Cancelled'),0x0;}return await withSpinner(_0x43557f(0x1fc),()=>_0x4651f4['jobs']['kill'](_0x321240),{'verbose':_0x4cde92[_0x43557f(0x21b)]}),console[_0x43557f(0x21e)](_0x43557f(0x205)+_0x321240),console[_0x43557f(0x21e)](_0x43557f(0x1f9)+_0x321240+_0x43557f(0x1f4)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a24_0x3bcd1e(0x229)]=a24_0x3bcd1e(0x246);[a24_0x3bcd1e(0x238)]=a24_0x3bcd1e(0x213);async[a24_0x3bcd1e(0x231)](_0x493c66){const _0x54cc6d=a24_0x3bcd1e,{options:_0x1263e9,args:_0x5ab15f,tdx:_0x1594f4}=_0x493c66,_0x610d85=_0x1263e9[_0x54cc6d(0x239)]||_0x54cc6d(0x207),_0x395508=_0x1263e9[_0x54cc6d(0x215)],_0x19efb7=_0x1263e9[_0x54cc6d(0x22f)]||'information_schema',_0xc5de7b=_0x1263e9[_0x54cc6d(0x212)];if(_0x610d85!=='trino'&&_0x610d85!==_0x54cc6d(0x241))throw new SDKError(ErrorCode[_0x54cc6d(0x23d)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x915753;if(_0x395508){if(_0x5ab15f[0x0])throw new SDKError(ErrorCode[_0x54cc6d(0x23d)],_0x54cc6d(0x21f));const _0x541af0=readSqlStatementsFromFile(_0x395508);if(_0x541af0[_0x54cc6d(0x237)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x541af0['length']>0x1)throw new SDKError(ErrorCode[_0x54cc6d(0x23d)],_0x54cc6d(0x247));_0x915753=_0x541af0[0x0];}else{if(!_0x5ab15f[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x54cc6d(0x1f7));_0x915753=_0x5ab15f[0x0];}_0x1263e9[_0x54cc6d(0x21b)]&&(console[_0x54cc6d(0x21e)](_0x54cc6d(0x217)+_0x610d85),console[_0x54cc6d(0x21e)](_0x54cc6d(0x24c)+_0x19efb7),console['error']('Query:\x20'+_0x915753[_0x54cc6d(0x232)](0x0,0x64)+(_0x915753[_0x54cc6d(0x237)]>0x64?_0x54cc6d(0x222):'')));const _0x2eeb33=await withSpinner('Submitting\x20job...',()=>_0x1594f4[_0x54cc6d(0x248)][_0x54cc6d(0x1fa)](_0x19efb7,_0x915753,_0x610d85,_0xc5de7b),{'verbose':_0x1263e9[_0x54cc6d(0x21b)]}),_0x21d6cb=_0x2eeb33['data'];return console[_0x54cc6d(0x21e)](_0x54cc6d(0x23b)),console['error'](_0x54cc6d(0x22a)+_0x21d6cb[_0x54cc6d(0x20c)]),await handleSDKOutput([_0x21d6cb],_0x1263e9),0x0;}}export class JobResultCommand extends BaseCommand{[a24_0x3bcd1e(0x229)]=a24_0x3bcd1e(0x204);[a24_0x3bcd1e(0x238)]=a24_0x3bcd1e(0x20d);[a24_0x3bcd1e(0x21d)](_0x5ac9c6){const _0x2ee97f=a24_0x3bcd1e,_0x3f66f6=_0x5ac9c6[_0x2ee97f(0x1f2)][0x0];if(!_0x3f66f6)return _0x2ee97f(0x228);return undefined;}async[a24_0x3bcd1e(0x231)](_0x4712bd){const _0x3ebc0c=a24_0x3bcd1e,{options:_0x18f65e,args:_0x22c5fd,tdx:_0x42b80c}=_0x4712bd,_0x1d24b2=_0x22c5fd[0x0],_0x58ffe9=await withSpinner(_0x3ebc0c(0x223),()=>_0x42b80c[_0x3ebc0c(0x248)][_0x3ebc0c(0x212)](_0x1d24b2),{'verbose':_0x18f65e[_0x3ebc0c(0x21b)]}),_0x597080=_0x58ffe9[_0x3ebc0c(0x208)];return console[_0x3ebc0c(0x21e)](_0x3ebc0c(0x20b)+_0x597080[_0x3ebc0c(0x237)]+_0x3ebc0c(0x230)+(_0x597080[_0x3ebc0c(0x237)]!==0x1?'s':'')),await handleSDKOutput(_0x597080,_0x18f65e),0x0;}}
@@ -1 +1 @@
1
- {"version":3,"file":"job-command.js","sourceRoot":"","sources":["../../src/commands/job-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAsB,MAAM,2BAA2B,CAAC;AAC1G,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IACpC,IAAI,GAAG,MAAM,CAAC;IACd,WAAW,GAAG,WAAW,CAAC;IAEnC,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,OA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IACX,CAAC;CACF"}
@@ -1 +1 @@
1
- const a25_0x25349b=a25_0x5d07;(function(_0x7286b1,_0x55397f){const _0x5c5924=a25_0x5d07,_0x389a67=_0x7286b1();while(!![]){try{const _0x229a23=-parseInt(_0x5c5924(0x169))/0x1+-parseInt(_0x5c5924(0x1f7))/0x2*(parseInt(_0x5c5924(0x152))/0x3)+parseInt(_0x5c5924(0x205))/0x4+parseInt(_0x5c5924(0x1da))/0x5*(-parseInt(_0x5c5924(0x206))/0x6)+-parseInt(_0x5c5924(0x1fb))/0x7+-parseInt(_0x5c5924(0x1fe))/0x8*(-parseInt(_0x5c5924(0x183))/0x9)+-parseInt(_0x5c5924(0x1d9))/0xa*(-parseInt(_0x5c5924(0x158))/0xb);if(_0x229a23===_0x55397f)break;else _0x389a67['push'](_0x389a67['shift']());}catch(_0x34a8dd){_0x389a67['push'](_0x389a67['shift']());}}}(a25_0x27cf,0x24840));import a25_0x3b0196 from'chalk';import a25_0x20df61 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';function a25_0x27cf(){const _0x5d5823=['conversion','journey:stats','\x20changed\x20files','versionNumber','milestoneSize','getTrafficData','activation','data','join','\x20\x20Preserving\x20local\x20segment\x20name:\x20','replace','journey','List\x20journeys\x20in\x20current\x20context','then','115636umWzoy','length','yellow','includeStats','session','site','folderPath','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)','tsv','Input:\x20','description','createVersion','Warning:\x20Could\x20not\x20resolve\x20segment\x20','hasPeriod','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','parent_segment','Pausing\x20journey...','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Show\x20journey\x20table\x20column\x20mapping','Resolving\x20parent\x20segment...','📁\x20','journeyStages','absolutePath','List\x20all\x20versions\x20of\x20a\x20journey','Database:\x20','filter','787095IhzUJV','\x27\x20not\x20found\x20in\x20','\x0aPull\x20summary:','Show\x20journey\x20details','columns','connector_config','\x20\x20Target:\x20','renderStats','journey:traffic','rule','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','values','\x20\x20Consolidating\x20duplicate\x20segment:\x20','listActivationsFlat','getLatestJourneyId','base','no_parent','stageNameMap','\x20\x20Folder\x20path:\x20','✔\x20Journey\x20\x22','map','\x20(rule\x20match)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','getJourney','execute','stages','launched','add','getActivation','listFolders','type','Show\x20journey\x20statistics','split','find','activationParams','nodes','filePath','Creating\x20new\x20version...','Error:\x20Invalid\x20version\x20number:\x20','goal','links','get','utf-8','Error:\x20Journey\x20\x27','(draft)','message','resolveSegment','content','Getting\x20journey\x20statistics...','Found\x20','journeyBundleId','segments','Journey\x20name:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','enteredSize','Error:\x20Journey\x20not\x20found:\x20','/e/','\x20new\x20files','segmentName','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Fetching\x20','\x20not\x20found.\x20Available:\x20','blue','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20','red',',\x20version:\x20','resume','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','stage','Cancelled','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeyName','has','\x20unchanged\x20files','attributes','updatedAt','from','journeys','journey:columns','listVersions','\x20files?','database','parentName','560zLUEbg','1349965RDgdun','\x20journey\x20files\x20to\x20','.yml','web','localeCompare','completeMilestoneRate','Target\x20file:\x20','listJourneysFromParentSegment','\x20=\x20','Resolving\x20journey...','entries','size','(archived)','exitOrJumpRate','/j/da','args','errorCode','\x20->\x20','getSegment','rootFolderId','reentryMode','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journey:list','table','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','draft','getColumnMapping','cyan','6022LmVmfF','limit','exitOrJumpSize','Pattern:\x20','1486954ILoGWr','getStatistics','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','16WaMHoK','yes','state','Listing\x20journey\x20activations...','parentSegment','pause','log','1004868PnytAi','6HEeEAA','\x22\x20resumed','name','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','segment','user','goalSize','options','all','\x20details...','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','/app/ps/','journey:view','Warning:\x20Could\x20not\x20resolve\x20activation\x20','repeat','Listing\x20journey\x20versions...','journey:version:create','No\x20journeys\x20found','history','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Getting\x20column\x20mapping...','segmentPushCommand','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','json','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','helpText','\x20Created\x20v','journey:pull','journey:push','sort','cwd','verbose','resolveParentId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','paused','resourceName','completed','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20(ID:\x20','\x20journeys','diff','Error:\x20Stage\x20\x22','tdx.json','\x22\x20paused','Fetching\x20journeys\x20and\x20folders...','✔\x20Context\x20set:\x20','format','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journey:versions','Getting\x20journey\x20details...','Aborted.','🗺️\x20','\x20journey','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20(draft)\x20—\x20\x22','Options:','-\x20no\x20files\x20written','INVALID_ARGUMENT','stringify','journeyBundleName','List\x20activations\x20for\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','isNew','folderId','error','set','\x0aError:','Error:\x20Invalid\x20--type\x20\x22','root\x20folder','jsonl','\x5c$&','Write\x20','includeHistory','/j/da/je','audienceId','toLowerCase','Resume\x20a\x20paused\x20journey','(paused)','journey:version:view','(root)','dim','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20\x20Journey\x20ID:\x20','buildIdToEmailMap','createdAt','(running)','\x20activation','journeyId','Listing\x20journeys...','hasChanges','folders','buildIdToNameMap','12kPFhcN','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','(completed)','push','connection','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','65516MmpuTL','green','Export\x20journey(s)\x20as\x20YAML\x20files'];a25_0x27cf=function(){return _0x5d5823;};return a25_0x27cf();}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(_0x57a415){const _0x16a58b=a25_0x5d07;return!_0x57a415&&(console[_0x16a58b(0x136)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x16a58b(0x136)](_0x16a58b(0x1f3))),!!_0x57a415;}function withJsonFormat(_0x32adfe){const _0x3cea86=a25_0x5d07;if(!_0x32adfe[_0x3cea86(0x124)]&&!_0x32adfe['json']&&!_0x32adfe[_0x3cea86(0x13b)]&&!_0x32adfe[_0x3cea86(0x171)])return{..._0x32adfe,'format':'json','json':!![]};return _0x32adfe;}function formatJourneyState(_0x57988b){const _0x192e53=a25_0x5d07;switch(_0x57988b){case _0x192e53(0x19e):return a25_0x3b0196['green'](_0x192e53(0x14b));case _0x192e53(0x1f4):return a25_0x3b0196[_0x192e53(0x146)](_0x192e53(0x1b0));case'paused':return a25_0x3b0196[_0x192e53(0x16b)](_0x192e53(0x143));case _0x192e53(0x11a):return a25_0x3b0196[_0x192e53(0x1c2)](_0x192e53(0x154));case'archived':return a25_0x3b0196[_0x192e53(0x146)](_0x192e53(0x1e6));default:return'('+_0x57988b+')';}}function formatJourneyItem(_0x3f0f1a,_0xb12f2a='',_0x496016){const _0x4a6329=a25_0x5d07,_0x3abaf6=formatJourneyState(_0x3f0f1a['state']),_0x455031=_0x496016?hyperlink(_0x3f0f1a[_0x4a6329(0x131)],_0x496016):_0x3f0f1a['journeyBundleName'];return _0xb12f2a+_0x4a6329(0x129)+_0x455031+'\x20'+_0x3abaf6;}function escapeRegex(_0x3a71b7){const _0x1fb841=a25_0x5d07;return _0x3a71b7[_0x1fb841(0x165)](/[.*+?^${}()|[\]\\]/g,_0x1fb841(0x13c));}function globToRegex(_0x53a3e9){const _0x510753=a25_0x5d07,_0x16c4d1=_0x53a3e9[_0x510753(0x1a4)]('*')[_0x510753(0x198)](escapeRegex);return new RegExp(_0x16c4d1[_0x510753(0x163)]('.*'),'i');}function buildRuleToNameMapping(_0x1b68f1){const _0x370890=a25_0x5d07,_0x461895=new Map();if(_0x1b68f1[_0x370890(0x1b7)])for(const [_0x32bb3a,_0x1c373e]of Object[_0x370890(0x1e4)](_0x1b68f1[_0x370890(0x1b7)])){if(_0x1c373e[_0x370890(0x18c)]){const _0x53d73c=serializeRule(_0x1c373e[_0x370890(0x18c)]),_0x36d2f5=_0x461895[_0x370890(0x1ad)](_0x53d73c);_0x36d2f5?_0x36d2f5[_0x370890(0x155)](_0x32bb3a):_0x461895[_0x370890(0x137)](_0x53d73c,[_0x32bb3a]);}}return _0x461895;}async function resolveJourneyIdFromInput(_0x563f26,_0x5405da,_0x3b9597){const _0x2fa483=a25_0x5d07,_0x33bf19=await resolveJourneyTarget(_0x563f26,_0x5405da['parentSegment'],_0x5405da[_0x2fa483(0x225)]),_0x12e212=_0x33bf19[_0x2fa483(0x202)];if(!_0x12e212)throw new SDKError(ErrorCode[_0x2fa483(0x12f)],_0x2fa483(0x209));const _0x206a7a=await withSpinner(_0x2fa483(0x17c),()=>_0x3b9597[_0x2fa483(0x20a)][_0x2fa483(0x226)](_0x12e212),{'verbose':_0x5405da[_0x2fa483(0x225)]}),_0x13e85c=_0x206a7a[_0x2fa483(0x162)],_0x314454=await withSpinner(_0x2fa483(0x1e3),()=>_0x3b9597[_0x2fa483(0x166)]['resolveJourneyId'](_0x13e85c,_0x33bf19[_0x2fa483(0x1cd)]),{'verbose':_0x5405da[_0x2fa483(0x225)]});return{'journeyId':_0x314454['data'],'journeyName':_0x33bf19[_0x2fa483(0x1cd)],'parentSegmentId':_0x13e85c};}async function resolveJourneyTarget(_0x44f522,_0x3a674c,_0xf9f729){const _0x3c28bd=a25_0x5d07;if(isYamlFilePath(_0x44f522))try{const _0x50a061=await resolveYamlFilePath(_0x44f522);return _0xf9f729&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x44f522),console[_0x3c28bd(0x136)]('\x20\x20Parent\x20segment:\x20'+_0x50a061[_0x3c28bd(0x202)]),console[_0x3c28bd(0x136)]('\x20\x20Name:\x20'+_0x50a061[_0x3c28bd(0x1be)]),console[_0x3c28bd(0x136)](_0x3c28bd(0x196)+(_0x50a061[_0x3c28bd(0x16f)]||_0x3c28bd(0x145)))),{'journeyName':_0x50a061[_0x3c28bd(0x1be)],'parentSegment':_0x50a061[_0x3c28bd(0x202)],'resolved':_0x50a061};}catch(_0x1a4a46){throw new SDKError(ErrorCode[_0x3c28bd(0x12f)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1a4a46[_0x3c28bd(0x1b1)]);}if(!_0x3a674c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3c28bd(0x17a));return{'journeyName':_0x44f522,'parentSegment':_0x3a674c};}export class JourneyListCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x1f1);['description']=a25_0x25349b(0x167);async[a25_0x25349b(0x19c)](_0x249a1c){const _0x2409ff=a25_0x25349b,{options:_0xae0a4a,args:_0x3627c7,tdx:_0x3260ad}=_0x249a1c,_0x2bb37b=_0x3627c7[0x0],_0xbf0aca=_0xae0a4a[_0x2409ff(0x202)];if(!_0xbf0aca)return console[_0x2409ff(0x136)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x2409ff(0x136)](_0x2409ff(0x18d)),0x1;const _0x391e46=await withSpinner(_0x2409ff(0x17c),()=>_0x3260ad['segment'][_0x2409ff(0x226)](_0xbf0aca),{'verbose':_0xae0a4a[_0x2409ff(0x225)]}),_0x59e134=_0x391e46['data'];_0xae0a4a[_0x2409ff(0x225)]&&(console[_0x2409ff(0x136)]('Parent\x20segment:\x20'+_0xbf0aca+_0x2409ff(0x11c)+_0x59e134+')'),_0x2bb37b&&console[_0x2409ff(0x136)](_0x2409ff(0x1fa)+_0x2bb37b));const _0x446201=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x3260ad[_0x2409ff(0x20a)]['getParentFull'](_0x59e134),{'verbose':_0xae0a4a[_0x2409ff(0x225)]}),_0xf57f5d=_0x446201[_0x2409ff(0x162)],_0x2237ed=_0xf57f5d[_0x2409ff(0x1ed)],_0x50f315=await withSpinner(_0x2409ff(0x14e),()=>_0x3260ad[_0x2409ff(0x166)]['listJourneysWithFolders'](_0x59e134,_0x2237ed),{'verbose':_0xae0a4a[_0x2409ff(0x225)]});let _0x5b2c8e=_0x50f315[_0x2409ff(0x162)][_0x2409ff(0x1d3)];const _0x32720c=_0x50f315[_0x2409ff(0x162)][_0x2409ff(0x150)],_0x3e409c=new Map();for(const _0xf3f267 of _0x32720c){_0x3e409c[_0x2409ff(0x137)](_0xf3f267['id'],_0xf3f267['name']);}if(_0x2bb37b){const _0x143c4b=globToRegex(_0x2bb37b);_0x5b2c8e=_0x5b2c8e[_0x2409ff(0x182)](_0xbb9fde=>_0x143c4b['test'](_0xbb9fde[_0x2409ff(0x131)]));}console[_0x2409ff(0x136)]('✔\x20Found\x20'+_0x5b2c8e['length']+_0x2409ff(0x12a)+(_0x5b2c8e[_0x2409ff(0x16a)]!==0x1?'s':''));const _0x18bce0=_0x4dfe21=>{const _0x379a92=_0x2409ff;return getConsoleNextUrl(_0xae0a4a['site'],_0x379a92(0x211)+_0x59e134+'/e/'+_0x4dfe21+_0x379a92(0x1e8));};if(_0xae0a4a[_0x2409ff(0x124)]===_0x2409ff(0x1f2))await handleSDKOutput(_0x5b2c8e,_0xae0a4a);else{if(_0xae0a4a['format']==='json'){const _0x25c209=_0x5b2c8e[_0x2409ff(0x198)](_0x526224=>({..._0x526224,'url':_0x18bce0(_0x526224['id'])}));await handleSDKOutput(_0x25c209,_0xae0a4a);}else{console[_0x2409ff(0x204)]('['+_0xbf0aca+']');const _0x128165=new Map(),_0x3dc750=[];for(const _0x4e22d3 of _0x5b2c8e){if(!_0x4e22d3[_0x2409ff(0x135)]||_0x4e22d3[_0x2409ff(0x135)]===_0x2237ed)_0x3dc750['push'](_0x4e22d3);else{const _0x4099a4=_0x128165[_0x2409ff(0x1ad)](_0x4e22d3[_0x2409ff(0x135)])||[];_0x4099a4[_0x2409ff(0x155)](_0x4e22d3),_0x128165[_0x2409ff(0x137)](_0x4e22d3[_0x2409ff(0x135)],_0x4099a4);}}const _0x45c776=(_0x27bb19,_0x4ba54a)=>_0x27bb19[_0x2409ff(0x131)][_0x2409ff(0x1de)](_0x4ba54a[_0x2409ff(0x131)],undefined,{'sensitivity':_0x2409ff(0x193)});_0x3dc750['sort'](_0x45c776);for(const _0x5aa30e of _0x3dc750){console[_0x2409ff(0x204)](formatJourneyItem(_0x5aa30e,'',_0x18bce0(_0x5aa30e['id'])));}const _0x556b98=[..._0x128165[_0x2409ff(0x1e4)]()][_0x2409ff(0x223)]((_0x37a1f5,_0x373419)=>{const _0x125d0a=_0x2409ff,_0x2dd0e9=_0x3e409c[_0x125d0a(0x1ad)](_0x37a1f5[0x0])||_0x37a1f5[0x0],_0x28a52e=_0x3e409c[_0x125d0a(0x1ad)](_0x373419[0x0])||_0x373419[0x0];return _0x2dd0e9[_0x125d0a(0x1de)](_0x28a52e,undefined,{'sensitivity':_0x125d0a(0x193)});});for(const [_0x30386c,_0xa03e6a]of _0x556b98){const _0x1916a3=_0x3e409c[_0x2409ff(0x1ad)](_0x30386c)||_0x30386c;console[_0x2409ff(0x204)](_0x2409ff(0x17d)+_0x1916a3),_0xa03e6a[_0x2409ff(0x223)](_0x45c776);for(const _0x1c2dda of _0xa03e6a){console[_0x2409ff(0x204)](formatJourneyItem(_0x1c2dda,'\x20\x20',_0x18bce0(_0x1c2dda['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x212);[a25_0x25349b(0x173)]=a25_0x25349b(0x186);async[a25_0x25349b(0x19c)](_0x5eeaa4){const _0x13cfc2=a25_0x25349b,{options:_0x4dd7d2,args:_0xe1de7e,tdx:_0x29e4eb}=_0x5eeaa4,_0x390365=_0xe1de7e[0x0];if(!_0x390365)return console[_0x13cfc2(0x136)](_0x13cfc2(0x21c)),console[_0x13cfc2(0x136)](_0x13cfc2(0x1c3)),console['error'](_0x13cfc2(0x12d)),console['error'](_0x13cfc2(0x147)),0x1;_0x4dd7d2['verbose']&&console[_0x13cfc2(0x136)](_0x13cfc2(0x172)+_0x390365);const {journeyId:_0x31c1f2,parentSegmentId:_0x17c527}=await resolveJourneyIdFromInput(_0x390365,_0x4dd7d2,_0x29e4eb);if(_0x4dd7d2[_0x13cfc2(0x1dd)]){const _0x2f1778=getConsoleNextUrl(_0x4dd7d2[_0x13cfc2(0x16e)],_0x13cfc2(0x211)+_0x17c527+'/e/'+_0x31c1f2+'/j/da/je');return console[_0x13cfc2(0x136)](a25_0x3b0196['green']('✔')+'\x20Opening\x20'+a25_0x3b0196[_0x13cfc2(0x1f6)](_0x2f1778)),openBrowser(_0x2f1778),0x0;}const _0x3fd459=await withSpinner(_0x13cfc2(0x127),()=>_0x29e4eb[_0x13cfc2(0x166)]['getJourney'](_0x31c1f2),{'verbose':_0x4dd7d2['verbose']}),_0x5973ae=_0x3fd459['data'],_0x44322a=_0x4dd7d2[_0x13cfc2(0x16c)];let _0x110463;if(_0x44322a)try{const _0x115db6=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x29e4eb[_0x13cfc2(0x166)][_0x13cfc2(0x1fc)](_0x31c1f2),{'verbose':_0x4dd7d2['verbose']});_0x110463=_0x115db6[_0x13cfc2(0x162)];}catch{_0x4dd7d2[_0x13cfc2(0x225)]&&console[_0x13cfc2(0x136)]('\x20\x20Statistics\x20not\x20available');}const _0x58c19d=getConsoleNextUrl(_0x4dd7d2[_0x13cfc2(0x16e)],_0x13cfc2(0x211)+_0x17c527+'/e/'+_0x31c1f2+_0x13cfc2(0x13f)),_0x56b931={'id':_0x5973ae['id'],'name':_0x5973ae[_0x13cfc2(0x1d0)][_0x13cfc2(0x208)],'description':_0x5973ae[_0x13cfc2(0x1d0)][_0x13cfc2(0x173)],'state':_0x5973ae[_0x13cfc2(0x1d0)]['state'],'paused':_0x5973ae[_0x13cfc2(0x1d0)]['paused'],'reentry_mode':_0x5973ae[_0x13cfc2(0x1d0)][_0x13cfc2(0x1ee)],'stages':_0x5973ae['attributes'][_0x13cfc2(0x17e)]?.[_0x13cfc2(0x16a)]||0x0,..._0x5973ae[_0x13cfc2(0x1d0)][_0x13cfc2(0x1ab)]&&{'goal':_0x5973ae['attributes'][_0x13cfc2(0x1ab)][_0x13cfc2(0x208)]},..._0x110463&&{'statistics':{'size':_0x110463['size'],'entered':_0x110463[_0x13cfc2(0x1ba)],'goal_achieved':_0x110463[_0x13cfc2(0x20c)],'completion_rate':_0x110463['completionRate'],'exit_or_jump':_0x110463['exitOrJumpSize'],'exit_or_jump_rate':_0x110463[_0x13cfc2(0x1e7)],'stages':_0x110463['stages']}},'url':_0x58c19d};return await handleSingleObjectOutput(_0x56b931,_0x4dd7d2),0x0;}}function a25_0x5d07(_0x505f54,_0x12144a){_0x505f54=_0x505f54-0x119;const _0x27cf05=a25_0x27cf();let _0x5d074c=_0x27cf05[_0x505f54];return _0x5d074c;}export class JourneyStatsCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x15c);['description']=a25_0x25349b(0x1a3);async['execute'](_0x142c26){const _0x3f9de5=a25_0x25349b,{options:_0x4d2ea1,args:_0x33dc92,tdx:_0x4e5e9f}=_0x142c26,_0x7b41ef=_0x33dc92[0x0];if(!requireNameOrPath(_0x7b41ef))return 0x1;_0x4d2ea1['verbose']&&console['error'](_0x3f9de5(0x172)+_0x7b41ef);const _0x400f76=_0x4d2ea1,_0x29ac28=_0x400f76[_0x3f9de5(0x1d2)],_0x126cd5=_0x400f76['to'],_0x55a7ba=_0x400f76[_0x3f9de5(0x13e)],_0x23eb90=_0x400f76[_0x3f9de5(0x1ca)];_0x55a7ba&&!_0x29ac28&&!_0x126cd5&&console[_0x3f9de5(0x136)](_0x3f9de5(0x1ef));const _0x398e41=_0x55a7ba?withJsonFormat(_0x4d2ea1):_0x4d2ea1,{journeyId:_0xe0295f,journeyName:_0x411727}=await resolveJourneyIdFromInput(_0x7b41ef,_0x398e41,_0x4e5e9f),_0x270be7=_0x29ac28||_0x126cd5?{'from':_0x29ac28,'to':_0x126cd5}:undefined,_0x1ddcfd=await withSpinner(_0x3f9de5(0x1b4),()=>Promise[_0x3f9de5(0x20e)]([_0x4e5e9f[_0x3f9de5(0x166)][_0x3f9de5(0x19b)](_0xe0295f),_0x4e5e9f[_0x3f9de5(0x166)][_0x3f9de5(0x1fc)](_0xe0295f,_0x270be7)]),{'verbose':_0x398e41[_0x3f9de5(0x225)]}),[_0x4749a5,_0x132bc3]=_0x1ddcfd[_0x3f9de5(0x162)];if(!_0x132bc3||_0x132bc3[_0x3f9de5(0x14d)]===null)return console[_0x3f9de5(0x136)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x411727),console[_0x3f9de5(0x136)](_0x3f9de5(0x12b)),0x0;const _0x504c80=buildStageNameMap(_0x4749a5),_0x1a7b6=!!(_0x270be7&&_0x132bc3[_0x3f9de5(0x218)]?.['length']),_0x267829={'stageNameMap':_0x504c80,'hasPeriod':_0x1a7b6,'includeHistory':!!_0x55a7ba};if(_0x23eb90&&_0x132bc3[_0x3f9de5(0x19d)]){const _0x45d75a=_0x132bc3[_0x3f9de5(0x19d)][_0x3f9de5(0x1a5)](_0x300552=>{const _0x5f23be=_0x3f9de5,_0x9c2d3=_0x504c80[_0x5f23be(0x1ad)](_0x300552['id'])??'';return _0x9c2d3[_0x5f23be(0x141)]()===_0x23eb90[_0x5f23be(0x141)]();});if(_0x45d75a)return await handleSingleObjectOutput(formatStageStats(_0x45d75a,_0x267829),_0x398e41),0x0;const _0x11e6ce=_0x132bc3[_0x3f9de5(0x19d)]['map'](_0x218132=>_0x504c80[_0x3f9de5(0x1ad)](_0x218132['id'])??_0x218132['id']);return console['error'](_0x3f9de5(0x11f)+_0x23eb90+'\x22\x20not\x20found'),console[_0x3f9de5(0x136)]('Available\x20stages:\x20'+_0x11e6ce['join'](',\x20')),0x1;}const _0x1110e8=_0x132bc3[_0x3f9de5(0x19d)]?.[_0x3f9de5(0x198)](_0x78a06f=>formatStageStats(_0x78a06f,_0x267829)),_0x1eec54=assembleJourneyStats(_0x132bc3,{'from':_0x29ac28,'to':_0x126cd5,'includeHistory':_0x55a7ba});return await this[_0x3f9de5(0x18a)](_0x1eec54,_0x1110e8??[],_0x398e41),0x0;}async[a25_0x25349b(0x18a)](_0x2df0f9,_0x191621,_0xf8ec1d){const _0x13d4ce=a25_0x25349b,_0x5cff03=_0xf8ec1d[_0x13d4ce(0x124)]===_0x13d4ce(0x21d)||_0xf8ec1d[_0x13d4ce(0x124)]===_0x13d4ce(0x13b)||_0xf8ec1d[_0x13d4ce(0x21d)]||_0xf8ec1d[_0x13d4ce(0x13b)];if(_0x5cff03){_0x2df0f9['stages']=_0x191621,await handleSingleObjectOutput(_0x2df0f9,_0xf8ec1d);return;}await handleSingleObjectOutput(_0x2df0f9,_0xf8ec1d);for(const _0x2a868f of _0x191621){console[_0x13d4ce(0x204)](''),console[_0x13d4ce(0x204)](String(a25_0x3b0196['cyan']['bold']('['+_0x2a868f[_0x13d4ce(0x208)]+']'))+a25_0x3b0196[_0x13d4ce(0x146)]('\x20'+_0x2a868f['id']));const {id:_0x510b44,name:_0x3a5b8f,..._0x42f0b6}=_0x2a868f;await handleSingleObjectOutput(_0x42f0b6,_0xf8ec1d);}}}export class JourneyTrafficCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x18b);[a25_0x25349b(0x173)]=a25_0x25349b(0x153);async[a25_0x25349b(0x19c)](_0x102c45){const _0x2f76c0=a25_0x25349b,{options:_0x30d296,args:_0x50e614,tdx:_0x397e74}=_0x102c45,_0x2b2354=_0x50e614[0x0];if(!requireNameOrPath(_0x2b2354))return 0x1;_0x30d296['verbose']&&console[_0x2f76c0(0x136)](_0x2f76c0(0x172)+_0x2b2354);const _0x8d374f=_0x30d296,_0x534982=_0x8d374f[_0x2f76c0(0x1a2)],_0x3fe00c=_0x8d374f[_0x2f76c0(0x1d2)],_0x25962a=_0x8d374f['to'],_0x4ba617=_0x8d374f[_0x2f76c0(0x1f8)];if(_0x534982&&_0x534982!==_0x2f76c0(0x15b)&&_0x534982!==_0x2f76c0(0x161))return console[_0x2f76c0(0x136)](_0x2f76c0(0x139)+_0x534982+_0x2f76c0(0x210)),0x1;const _0x128a0a=withJsonFormat(_0x30d296),{journeyId:_0x4361e2,journeyName:_0xb9ff1b}=await resolveJourneyIdFromInput(_0x2b2354,_0x128a0a,_0x397e74),_0xf57436={'type':_0x534982,'from':_0x3fe00c,'to':_0x25962a,'limit':_0x4ba617},_0xa1ca84=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x397e74[_0x2f76c0(0x166)][_0x2f76c0(0x160)](_0x4361e2,_0xf57436),{'verbose':_0x128a0a[_0x2f76c0(0x225)]}),_0x35f760=_0xa1ca84[_0x2f76c0(0x162)],_0x95617e=_0x35f760['conversion']&&(_0x35f760[_0x2f76c0(0x15b)][_0x2f76c0(0x1a7)][_0x2f76c0(0x16a)]>0x0||_0x35f760[_0x2f76c0(0x15b)][_0x2f76c0(0x1ac)][_0x2f76c0(0x16a)]>0x0),_0x213220=_0x35f760[_0x2f76c0(0x161)]&&_0x35f760[_0x2f76c0(0x161)][_0x2f76c0(0x16a)]>0x0;if(!_0x95617e&&!_0x213220)return console[_0x2f76c0(0x136)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0xb9ff1b),console['error'](_0x2f76c0(0x157)),_0x3fe00c&&_0x25962a&&console[_0x2f76c0(0x136)](_0x2f76c0(0x1fd)),0x0;return await handleSingleObjectOutput(_0x35f760,_0x128a0a),0x0;}}function formatStageStats(_0x43bba7,_0x3d2fc3){const _0x29a211=a25_0x25349b,_0x175629=_0x3d2fc3[_0x29a211(0x176)]&&_0x43bba7['history']?.[_0x29a211(0x16a)]?aggregateStageHistory(_0x43bba7[_0x29a211(0x218)]):{'size':_0x43bba7[_0x29a211(0x1e5)],'entered':_0x43bba7[_0x29a211(0x1ba)],'milestone':_0x43bba7[_0x29a211(0x15f)],'milestone_rate':_0x43bba7[_0x29a211(0x1df)],'exit_or_jump':_0x43bba7[_0x29a211(0x1f9)],'exit_or_jump_rate':_0x43bba7[_0x29a211(0x1e7)]},_0x30eda0={'id':_0x43bba7['id'],'name':_0x3d2fc3[_0x29a211(0x195)][_0x29a211(0x1ad)](_0x43bba7['id'])??_0x43bba7['id'],..._0x175629};return _0x3d2fc3['hasPeriod']&&_0x3d2fc3[_0x29a211(0x13e)]&&_0x43bba7[_0x29a211(0x218)]&&(_0x30eda0[_0x29a211(0x218)]=_0x43bba7[_0x29a211(0x218)]),_0x30eda0;}export class JourneyPauseCommand extends BaseCommand{[a25_0x25349b(0x208)]='journey:pause';[a25_0x25349b(0x173)]='Pause\x20a\x20running\x20journey';async[a25_0x25349b(0x19c)](_0x4fa99e){const _0x43101b=a25_0x25349b,{options:_0x5bb287,args:_0x1f9d17,tdx:_0x1378cd}=_0x4fa99e,_0x3aa34e=_0x1f9d17[0x0];if(!requireNameOrPath(_0x3aa34e))return 0x1;_0x5bb287['verbose']&&console[_0x43101b(0x136)]('Input:\x20'+_0x3aa34e);const {journeyId:_0x1b69f1,journeyName:_0x5c02ea}=await resolveJourneyIdFromInput(_0x3aa34e,_0x5bb287,_0x1378cd);if(!_0x5bb287['yes']){const _0x4e9990=await confirm(_0x43101b(0x133)+_0x5c02ea+'\x22?');if(!_0x4e9990)return console[_0x43101b(0x136)](_0x43101b(0x1cb)),0x0;}const _0x47f655=await withSpinner(_0x43101b(0x179),()=>_0x1378cd[_0x43101b(0x166)][_0x43101b(0x203)](_0x1b69f1),{'verbose':_0x5bb287[_0x43101b(0x225)]}),_0x193dd3=_0x47f655[_0x43101b(0x162)];return console['error'](_0x43101b(0x197)+_0x193dd3[_0x43101b(0x1d0)]['name']+_0x43101b(0x121)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a25_0x25349b(0x208)]='journey:resume';[a25_0x25349b(0x173)]=a25_0x25349b(0x142);async[a25_0x25349b(0x19c)](_0x15b963){const _0x1b7a3f=a25_0x25349b,{options:_0x3872f3,args:_0x1ccb9d,tdx:_0x414ae1}=_0x15b963,_0x530a5e=_0x1ccb9d[0x0];if(!requireNameOrPath(_0x530a5e))return 0x1;_0x3872f3[_0x1b7a3f(0x225)]&&console['error'](_0x1b7a3f(0x172)+_0x530a5e);const {journeyId:_0x3befc0,journeyName:_0x5e51aa}=await resolveJourneyIdFromInput(_0x530a5e,_0x3872f3,_0x414ae1);if(!_0x3872f3[_0x1b7a3f(0x1ff)]){const _0x1a614e=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x5e51aa+'\x22?');if(!_0x1a614e)return console[_0x1b7a3f(0x136)](_0x1b7a3f(0x1cb)),0x0;}const _0x3554dc=await withSpinner('Resuming\x20journey...',()=>_0x414ae1[_0x1b7a3f(0x166)][_0x1b7a3f(0x1c8)](_0x3befc0),{'verbose':_0x3872f3[_0x1b7a3f(0x225)]}),_0xdd8c3a=_0x3554dc['data'];return console['error']('✔\x20Journey\x20\x22'+_0xdd8c3a['attributes'][_0x1b7a3f(0x208)]+_0x1b7a3f(0x207)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x221);[a25_0x25349b(0x173)]=a25_0x25349b(0x15a);async[a25_0x25349b(0x19c)](_0x1b36db){const _0x32a4e6=a25_0x25349b,{options:_0x304071,args:_0x1830a8,tdx:_0x51ce4d}=_0x1b36db,_0x581fc0=_0x304071,_0x34bf87=_0x1830a8[0x0],_0x279e37=_0x34bf87&&isYamlFilePath(_0x34bf87),_0x5e6225=await resolveTarget({'arg':_0x279e37?_0x34bf87:undefined,'contextParent':_0x304071['parentSegment'],'cwd':process[_0x32a4e6(0x224)]()});if(!isSuccessfulResolution(_0x5e6225))return _0x5e6225[_0x32a4e6(0x1ea)]===_0x32a4e6(0x194)?(console['error'](a25_0x3b0196['yellow'](_0x32a4e6(0x227))),console[_0x32a4e6(0x136)](_0x32a4e6(0x170)),console[_0x32a4e6(0x136)](_0x32a4e6(0x19a)),console[_0x32a4e6(0x136)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x32a4e6(0x136)](_0x32a4e6(0x219))):(console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x1c6)](_0x32a4e6(0x1c5)+_0x5e6225[_0x32a4e6(0x1b1)]+'\x0a')),_0x5e6225[_0x32a4e6(0x21f)]&&console[_0x32a4e6(0x136)](a25_0x3b0196['cyan'](_0x5e6225[_0x32a4e6(0x21f)]))),0x1;let _0x59e7b7=_0x279e37?undefined:_0x34bf87,_0x6bfea1,_0x1689cc;_0x5e6225[_0x32a4e6(0x1a2)]==='file'&&(_0x59e7b7=_0x5e6225[_0x32a4e6(0x119)],_0x6bfea1=_0x5e6225['filePath'],_0x1689cc=_0x5e6225[_0x32a4e6(0x16f)]);const _0x357074=_0x5e6225[_0x32a4e6(0x1d8)],_0x491b82=_0x5e6225['targetDir'];_0x581fc0[_0x32a4e6(0x225)]&&(console[_0x32a4e6(0x136)]('Parent\x20segment:\x20'+_0x357074),console[_0x32a4e6(0x136)]('Target\x20directory:\x20'+_0x491b82),_0x59e7b7&&console[_0x32a4e6(0x136)](_0x32a4e6(0x1b8)+_0x59e7b7),_0x6bfea1&&console[_0x32a4e6(0x136)](_0x32a4e6(0x1e0)+_0x6bfea1),_0x1689cc&&console['error']('Folder\x20path:\x20'+_0x1689cc));const _0xe3ce06=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x51ce4d['segment']['resolveParentId'](_0x357074),{'verbose':_0x304071[_0x32a4e6(0x225)]}),_0x26073b=_0xe3ce06[_0x32a4e6(0x162)],{journeys:_0xe9217d,folders:_0x2e0f33}=await withSpinner(_0x32a4e6(0x122),async()=>{const _0x158ea5=_0x32a4e6,[_0x4b7e54,_0x4c6f46]=await Promise[_0x158ea5(0x20e)]([_0x51ce4d[_0x158ea5(0x166)][_0x158ea5(0x1e1)](_0x26073b,undefined,{'includeAllVersions':!![]}),_0x51ce4d[_0x158ea5(0x20a)][_0x158ea5(0x1a1)](_0x26073b)]);return{'journeys':_0x4b7e54,'folders':_0x4c6f46};},{'verbose':_0x304071[_0x32a4e6(0x225)]})[_0x32a4e6(0x168)](_0x4c08=>_0x4c08[_0x32a4e6(0x162)]);let _0x296845=_0xe9217d;const _0x3843ea=buildFolderIdToPathMap(_0x2e0f33);if(_0x59e7b7){const _0x575d8d=_0x296845['filter'](_0x501b65=>_0x501b65[_0x32a4e6(0x131)][_0x32a4e6(0x141)]()===_0x59e7b7[_0x32a4e6(0x141)]());if(_0x575d8d[_0x32a4e6(0x16a)]===0x0)return console[_0x32a4e6(0x136)](_0x32a4e6(0x1bb)+_0x59e7b7),console['error'](_0x32a4e6(0x1bf)),0x1;_0x296845=_0x575d8d;}if(_0x1689cc!==undefined){const _0x2c5d43=_0x296845[_0x32a4e6(0x182)](_0x291a40=>{const _0x377294=_0x32a4e6,_0x41dab7=_0x291a40[_0x377294(0x135)]?_0x3843ea[_0x377294(0x1ad)](_0x291a40[_0x377294(0x135)])||'':'';return _0x41dab7===_0x1689cc;});if(_0x2c5d43['length']===0x0&&_0x296845[_0x32a4e6(0x16a)]>0x0){console[_0x32a4e6(0x136)](_0x32a4e6(0x1af)+_0x59e7b7+_0x32a4e6(0x184)+(_0x1689cc||_0x32a4e6(0x13a))),console[_0x32a4e6(0x136)](_0x32a4e6(0x1c4));for(const _0x13d652 of _0x296845){const _0xd7bcd2=_0x13d652[_0x32a4e6(0x135)]?_0x3843ea[_0x32a4e6(0x1ad)](_0x13d652[_0x32a4e6(0x135)])||'':'';console[_0x32a4e6(0x136)]('\x20\x20-\x20'+(_0xd7bcd2||_0x32a4e6(0x145))+'/'+_0x13d652['journeyBundleName']);}return 0x1;}_0x296845=_0x2c5d43;}if(_0x296845['length']===0x0)return console[_0x32a4e6(0x136)](_0x32a4e6(0x217)),0x0;const _0x721d2c=new Map();for(const _0x4809d4 of _0x296845){const _0x560f5d=_0x4809d4[_0x32a4e6(0x1b6)];!_0x721d2c[_0x32a4e6(0x1ce)](_0x560f5d)&&_0x721d2c['set'](_0x560f5d,[]),_0x721d2c[_0x32a4e6(0x1ad)](_0x560f5d)[_0x32a4e6(0x155)](_0x4809d4);}for(const _0x5b110f of _0x721d2c[_0x32a4e6(0x18f)]()){_0x5b110f['sort']((_0x2dfd61,_0x591336)=>(_0x2dfd61[_0x32a4e6(0x15e)]||0x0)-(_0x591336[_0x32a4e6(0x15e)]||0x0));}const _0x3a488d=[],{idToEmailMap:_0x3663c0,connectionIdToNameMap:_0x3ba23d}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x587b3d=_0x32a4e6,[_0x5b18c4,_0x2d9c90]=await Promise[_0x587b3d(0x20e)]([_0x51ce4d[_0x587b3d(0x20b)][_0x587b3d(0x149)](),_0x51ce4d[_0x587b3d(0x156)][_0x587b3d(0x151)]()]);return{'idToEmailMap':_0x5b18c4,'connectionIdToNameMap':_0x2d9c90};},{'verbose':_0x304071[_0x32a4e6(0x225)]})[_0x32a4e6(0x168)](_0x3b308e=>_0x3b308e[_0x32a4e6(0x162)]);for(const _0x584cb9 of _0x721d2c[_0x32a4e6(0x18f)]()){const _0x371e1b=_0x584cb9[0x0]['journeyBundleName'],_0x524990=_0x584cb9[0x0][_0x32a4e6(0x135)],_0xae731a=_0x524990?_0x3843ea[_0x32a4e6(0x1ad)](_0x524990)||'':'',_0x2050d5=_0xae731a?a25_0x20df61[_0x32a4e6(0x163)](_0x491b82,_0xae731a):_0x491b82,_0x59c95f=_0x6bfea1||a25_0x20df61['join'](_0x2050d5,sanitizeFileName(_0x371e1b)+'.yml');let _0xc6a6ca,_0x47844c;if(existsSync(_0x59c95f))try{const _0x575093=readFileSync(_0x59c95f,_0x32a4e6(0x1ae)),_0x86d399=parseYamlString(_0x575093);_0x47844c=_0x86d399,_0xc6a6ca=buildRuleToNameMapping(_0x86d399),_0x581fc0['verbose']&&_0xc6a6ca[_0x32a4e6(0x1e5)]>0x0&&console[_0x32a4e6(0x136)](_0x32a4e6(0x1b5)+_0xc6a6ca[_0x32a4e6(0x1e5)]+_0x32a4e6(0x18e)+_0x371e1b);}catch(_0x3a60fa){_0x581fc0['verbose']&&console['error'](_0x32a4e6(0x1c9)+_0x3a60fa[_0x32a4e6(0x1b1)]);}const _0x3be44f=[],_0x3a6477=new Set(),_0x261a90=new Map(),_0x29ccfa=new Map(),_0x278587=new Set(),_0x2edd64=new Map(),_0x531d54=new Map(),_0x16d469=createJumpTargetCache();await withProgressSpinner(_0x32a4e6(0x1c0)+_0x371e1b+'...',async _0x58dba5=>{const _0x572b09=_0x32a4e6;for(const _0x3a33a8 of _0x584cb9){const _0x4a4928=_0x584cb9[_0x572b09(0x16a)]>0x1?_0x3a33a8[_0x572b09(0x131)]+'\x20v'+(_0x3a33a8[_0x572b09(0x15e)]||0x1):_0x3a33a8[_0x572b09(0x131)];_0x58dba5['setPhase']('Fetching\x20'+_0x4a4928);const _0x29c63d=await _0x51ce4d[_0x572b09(0x166)][_0x572b09(0x19b)](_0x3a33a8['id']),_0xaa03cb=_0x29c63d['attributes']?.[_0x572b09(0x140)],_0x38147a={'resolveSegment':async _0x4c8534=>{const _0x4e2d68=_0x572b09;if(!_0xaa03cb)return{'name':_0x4c8534,'isJourneyLocal':![]};const _0x16b32d=_0x261a90[_0x4e2d68(0x1ad)](_0x4c8534);if(_0x16b32d)return _0x16b32d;try{const _0x48419d=await _0x51ce4d[_0x4e2d68(0x20a)][_0x4e2d68(0x1ec)](_0xaa03cb,_0x4c8534),_0x394966=_0x48419d['kind']===SEGMENT_KIND_JOURNEY;let _0xc52d62,_0x5cb20a=_0x48419d[_0x4e2d68(0x208)];if(_0x394966&&_0x48419d[_0x4e2d68(0x18c)]){const _0x339551=await segmentResponseToDef(_0x48419d,{'resolveSegmentName':async _0x144695=>{const _0x1ef660=_0x4e2d68,_0x1584c3=_0x261a90['get'](_0x144695);if(_0x1584c3)return _0x1584c3[_0x1ef660(0x208)];const _0x1f2f52=await _0x38147a[_0x1ef660(0x1b2)](_0x144695);return _0x1f2f52[_0x1ef660(0x208)];}}),_0x211006=_0x339551[_0x4e2d68(0x18c)];_0xc52d62={'description':_0x48419d['description'],'rule':_0x211006};const _0x55eac5=serializeRule(_0x211006),_0x5abb81=_0x29ccfa[_0x4e2d68(0x1ad)](_0x55eac5);if(_0x5abb81)_0x5cb20a=_0x5abb81,_0xc52d62=undefined,_0x581fc0[_0x4e2d68(0x225)]&&console[_0x4e2d68(0x136)](_0x4e2d68(0x190)+_0x48419d['name']+_0x4e2d68(0x1eb)+_0x5abb81);else{let _0x461ca8=![];if(_0xc6a6ca){const _0x510419=_0xc6a6ca['get'](_0x55eac5);if(_0x510419){const _0x205b31=_0x510419[_0x4e2d68(0x1a5)](_0x3babdf=>!_0x3a6477[_0x4e2d68(0x1ce)](_0x3babdf));_0x205b31&&(_0x5cb20a=_0x205b31,_0x3a6477[_0x4e2d68(0x19f)](_0x205b31),_0x29ccfa[_0x4e2d68(0x137)](_0x55eac5,_0x205b31),_0x461ca8=!![],_0x581fc0['verbose']&&console[_0x4e2d68(0x136)](_0x4e2d68(0x164)+_0x205b31+_0x4e2d68(0x199)));}}if(!_0x461ca8){const _0x25f8df=generateJourneyLocalName(_0x48419d[_0x4e2d68(0x208)]);_0x25f8df&&(_0x5cb20a=_0x25f8df);let _0x37d24e=_0x5cb20a,_0x106bd9=0x2;while(_0x3a6477[_0x4e2d68(0x1ce)](_0x37d24e)){_0x37d24e=_0x5cb20a+'_'+_0x106bd9,_0x106bd9++;}_0x3a6477['add'](_0x37d24e),_0x29ccfa[_0x4e2d68(0x137)](_0x55eac5,_0x37d24e),_0x5cb20a=_0x37d24e;}}}const _0x2026c4={'name':_0x5cb20a,'isJourneyLocal':_0x394966,'definition':_0xc52d62};return _0x261a90['set'](_0x4c8534,_0x2026c4),_0x2026c4;}catch(_0x2de49b){return _0x304071[_0x4e2d68(0x225)]&&console[_0x4e2d68(0x136)](_0x4e2d68(0x175)+_0x4c8534+':\x20'+_0x2de49b[_0x4e2d68(0x1b1)]),{'name':_0x4c8534,'isJourneyLocal':![]};}},'resolveActivation':async _0x142fba=>{const _0xc50045=_0x572b09,_0x2218a9=_0x2edd64[_0xc50045(0x1ad)](_0x142fba);if(_0x2218a9)return _0x2218a9;try{const _0x70d449=await _0x51ce4d[_0xc50045(0x166)][_0xc50045(0x1a0)](_0x3a33a8['id'],_0x142fba),_0x330e07=journeyActivationStepToYaml(_0x70d449,_0x3663c0,_0x3ba23d),_0x1f03d0=JSON[_0xc50045(0x130)]({'name':_0x330e07['name'],'connection':_0x330e07[_0xc50045(0x156)],'connector_config':_0x330e07[_0xc50045(0x188)]}),_0x7b165e=_0x531d54[_0xc50045(0x1ad)](_0x1f03d0);if(_0x7b165e){const _0x322fca={'name':_0x7b165e,'isJourneyLocal':!![],'definition':_0x330e07};return _0x2edd64[_0xc50045(0x137)](_0x142fba,_0x322fca),_0x322fca;}const _0x3a1886=_0x70d449[_0xc50045(0x1d0)][_0xc50045(0x1a6)]['name']||_0x142fba,_0x4d973f=sanitizeYamlKey(_0x3a1886)||'activation_'+_0x142fba;let _0x54c52d=_0x4d973f,_0xc232fa=0x2;while(_0x278587[_0xc50045(0x1ce)](_0x54c52d)){_0x54c52d=_0x4d973f+'_'+_0xc232fa,_0xc232fa++;}_0x278587['add'](_0x54c52d),_0x531d54[_0xc50045(0x137)](_0x1f03d0,_0x54c52d);const _0x3882b4={'name':_0x54c52d,'isJourneyLocal':!![],'definition':_0x330e07};return _0x2edd64[_0xc50045(0x137)](_0x142fba,_0x3882b4),_0x3882b4;}catch(_0x446409){return _0x304071[_0xc50045(0x225)]&&console[_0xc50045(0x136)](_0xc50045(0x213)+_0x142fba+':\x20'+_0x446409[_0xc50045(0x1b1)]),{'name':_0x142fba,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x456f09,_0x527076)=>{const _0x6d6fb=_0x572b09;return resolveJumpTarget(_0x456f09,_0x527076,_0x16d469,_0x20892f=>_0x51ce4d[_0x6d6fb(0x166)]['getJourney'](_0x20892f));}},_0x125d35=await journeyResponseToDef(_0x29c63d,_0x38147a);_0x3be44f[_0x572b09(0x155)]({'item':_0x3a33a8,'yaml':_0x125d35});}},{'verbose':_0x304071[_0x32a4e6(0x225)]});const _0x3ad710=await _0x51ce4d[_0x32a4e6(0x166)][_0x32a4e6(0x192)](_0x584cb9[0x0]['journeyBundleId']),_0x2c80ae=buildMergedJourneyDef(_0x3be44f,_0xc6a6ca,_0x3ad710),_0x6763f8=normalizeJourneyDef(_0x2c80ae,_0x47844c),_0x44c202=toYamlString(_0x6763f8),_0xcb4520=_0x6bfea1||a25_0x20df61['join'](_0x2050d5,sanitizeFileName(_0x371e1b)+_0x32a4e6(0x1dc));!_0x6bfea1&&_0xae731a&&!existsSync(_0x2050d5)&&mkdirSync(_0x2050d5,{'recursive':!![]});const _0x275ee1=a25_0x20df61['relative'](process[_0x32a4e6(0x224)](),_0xcb4520);if(existsSync(_0xcb4520)){const _0x65eed=readFileSync(_0xcb4520,_0x32a4e6(0x1ae)),_0x2a2e96=generateDiff(_0x65eed,_0x44c202),_0xea6696=hasChanges(_0x2a2e96);_0x3a488d[_0x32a4e6(0x155)]({'relativePath':_0x275ee1,'absolutePath':_0xcb4520,'content':_0x44c202,'isNew':![],'hasChanges':_0xea6696,'diff':_0xea6696?formatDiffWithColors(_0x2a2e96):undefined});}else _0x3a488d[_0x32a4e6(0x155)]({'relativePath':_0x275ee1,'absolutePath':_0xcb4520,'content':_0x44c202,'isNew':!![],'hasChanges':![]});}const _0x2029e1=_0x3a488d[_0x32a4e6(0x182)](_0xcbcbb7=>_0xcbcbb7['isNew']),_0x3cc8d1=_0x3a488d[_0x32a4e6(0x182)](_0x415c8a=>!_0x415c8a['isNew']&&_0x415c8a[_0x32a4e6(0x14f)]),_0x2c98cc=_0x3a488d['filter'](_0x11d1fc=>!_0x11d1fc[_0x32a4e6(0x134)]&&!_0x11d1fc[_0x32a4e6(0x14f)]),_0x2f4c68=_0x296845['length'],_0x5c1478=_0x721d2c[_0x32a4e6(0x1e5)],_0xd3d5df=_0x2f4c68>_0x5c1478?'\x20('+_0x2f4c68+'\x20versions)':'';console[_0x32a4e6(0x136)](_0x32a4e6(0x185)),console[_0x32a4e6(0x136)]('\x20\x20'+a25_0x3b0196[_0x32a4e6(0x1f6)](_0x5c1478+_0x32a4e6(0x11d))+a25_0x3b0196[_0x32a4e6(0x146)](_0xd3d5df)),console[_0x32a4e6(0x136)]('\x20\x20'+a25_0x3b0196[_0x32a4e6(0x159)]('+\x20'+_0x2029e1[_0x32a4e6(0x16a)]+_0x32a4e6(0x1bd))),console[_0x32a4e6(0x136)]('\x20\x20'+a25_0x3b0196[_0x32a4e6(0x16b)]('~\x20'+_0x3cc8d1[_0x32a4e6(0x16a)]+_0x32a4e6(0x15d))),console['error']('\x20\x20'+a25_0x3b0196[_0x32a4e6(0x146)]('=\x20'+_0x2c98cc[_0x32a4e6(0x16a)]+_0x32a4e6(0x1cf))),console[_0x32a4e6(0x136)](_0x32a4e6(0x189)+a25_0x3b0196['cyan'](_0x491b82)+'\x0a');if(_0x3cc8d1[_0x32a4e6(0x16a)]>0x0)for(const _0x578f3d of _0x3cc8d1){console[_0x32a4e6(0x136)]('\x0aChanges\x20to\x20\x27'+_0x578f3d['relativePath']+'\x27:'),console[_0x32a4e6(0x136)]('─'[_0x32a4e6(0x214)](0x3c)),console[_0x32a4e6(0x136)](_0x578f3d[_0x32a4e6(0x11e)]),console[_0x32a4e6(0x136)]('─'[_0x32a4e6(0x214)](0x3c));}if(_0x581fc0['dryRun'])return console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x16b)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2029e1['length']===0x0&&_0x3cc8d1[_0x32a4e6(0x16a)]===0x0)return console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x159)](_0x32a4e6(0x1b9))),saveSessionContext({'parent_segment':_0x357074},_0x581fc0[_0x32a4e6(0x16d)]),console[_0x32a4e6(0x136)](a25_0x3b0196['green'](_0x32a4e6(0x123)+a25_0x3b0196[_0x32a4e6(0x146)](_0x32a4e6(0x178))+'\x20=\x20'+a25_0x3b0196[_0x32a4e6(0x1f6)](_0x357074))),0x0;if(!_0x581fc0[_0x32a4e6(0x1ff)]&&(_0x2029e1['length']>0x0||_0x3cc8d1['length']>0x0)){if(!isInteractive())return console['error'](a25_0x3b0196[_0x32a4e6(0x1c6)](_0x32a4e6(0x138)),_0x32a4e6(0x1f0)),console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x146)](_0x32a4e6(0x125))),0x1;const _0x51cb1d=await confirmKey(_0x32a4e6(0x13d)+(_0x2029e1['length']+_0x3cc8d1['length'])+_0x32a4e6(0x1d6));if(!_0x51cb1d)return console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x16b)](_0x32a4e6(0x128)),_0x32a4e6(0x12e)),0x1;}!existsSync(_0x491b82)&&mkdirSync(_0x491b82,{'recursive':!![]});const _0x38d722=a25_0x20df61[_0x32a4e6(0x163)](_0x491b82,_0x32a4e6(0x120));writeFileSync(_0x38d722,createTdxConfigContent(_0x357074),_0x32a4e6(0x1ae));for(const _0x371fe5 of _0x3a488d){(_0x371fe5[_0x32a4e6(0x134)]||_0x371fe5[_0x32a4e6(0x14f)])&&writeFileSync(_0x371fe5[_0x32a4e6(0x17f)],_0x371fe5[_0x32a4e6(0x1b3)],_0x32a4e6(0x1ae));}return console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x159)]('✔\x20Pulled\x20'+(_0x2029e1[_0x32a4e6(0x16a)]+_0x3cc8d1[_0x32a4e6(0x16a)])+_0x32a4e6(0x1db)+_0x491b82)),saveSessionContext({'parent_segment':_0x357074},_0x581fc0[_0x32a4e6(0x16d)]),console[_0x32a4e6(0x136)](a25_0x3b0196['green']('✔\x20Context\x20set:\x20'+a25_0x3b0196[_0x32a4e6(0x146)]('parent_segment')+_0x32a4e6(0x1e2)+a25_0x3b0196[_0x32a4e6(0x1f6)](_0x357074))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a25_0x25349b(0x1d4);[a25_0x25349b(0x173)]=a25_0x25349b(0x17b);async[a25_0x25349b(0x19c)](_0x2c9dd3){const _0x2c5a61=a25_0x25349b,{options:_0x495c0a,args:_0x4af77,tdx:_0x5e2f57}=_0x2c9dd3,_0x2e85c5=_0x4af77[0x0];if(!requireNameOrPath(_0x2e85c5))return 0x1;_0x495c0a[_0x2c5a61(0x225)]&&console[_0x2c5a61(0x136)](_0x2c5a61(0x172)+_0x2e85c5);const {journeyId:_0x170b4e}=await resolveJourneyIdFromInput(_0x2e85c5,_0x495c0a,_0x5e2f57),_0x2021c2=await withSpinner(_0x2c5a61(0x21a),()=>_0x5e2f57[_0x2c5a61(0x166)][_0x2c5a61(0x1f5)](_0x170b4e),{'verbose':_0x495c0a[_0x2c5a61(0x225)]}),_0x369d06=_0x2021c2[_0x2c5a61(0x162)];return console[_0x2c5a61(0x204)](_0x2c5a61(0x181)+_0x369d06[_0x2c5a61(0x1d7)]),console[_0x2c5a61(0x204)]('Table:\x20'+_0x369d06[_0x2c5a61(0x1f2)]),await handleSDKOutput(_0x369d06[_0x2c5a61(0x187)],_0x495c0a),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a25_0x25349b(0x208)]='journey:activations';[a25_0x25349b(0x173)]=a25_0x25349b(0x132);async['execute'](_0x2d0309){const _0x392c73=a25_0x25349b,{options:_0xfdb4f2,args:_0x262ac3,tdx:_0x34a0e3}=_0x2d0309,_0x3b3f31=_0x262ac3[0x0];if(!requireNameOrPath(_0x3b3f31))return 0x1;_0xfdb4f2[_0x392c73(0x225)]&&console[_0x392c73(0x136)](_0x392c73(0x172)+_0x3b3f31);const {journeyId:_0x3c3c53}=await resolveJourneyIdFromInput(_0x3b3f31,_0xfdb4f2,_0x34a0e3),_0x17d533=await withSpinner(_0x392c73(0x201),()=>_0x34a0e3['journey'][_0x392c73(0x191)](_0x3c3c53),{'verbose':_0xfdb4f2[_0x392c73(0x225)]}),_0x518a4a=_0x17d533['data'];return console[_0x392c73(0x136)](_0x392c73(0x1b5)+_0x518a4a['length']+_0x392c73(0x14c)+(_0x518a4a[_0x392c73(0x16a)]!==0x1?'s':'')),await handleSDKOutput(_0x518a4a,_0xfdb4f2),0x0;}}export class JourneyPushCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x222);[a25_0x25349b(0x173)]=a25_0x25349b(0x177);[a25_0x25349b(0x21b)]=new SegmentPushCommand();async[a25_0x25349b(0x19c)](_0x4686e8){const _0x2ab34e=a25_0x25349b,_0x2d7e67=_0x4686e8[_0x2ab34e(0x1e9)][0x0];let _0x568b01;if(_0x2d7e67){const _0xd1d8e0=await resolveTarget({'arg':_0x2d7e67,'contextParent':_0x4686e8[_0x2ab34e(0x20d)][_0x2ab34e(0x202)],'cwd':process['cwd']()});isSuccessfulResolution(_0xd1d8e0)&&_0xd1d8e0[_0x2ab34e(0x1a2)]==='file'&&(_0x568b01=_0xd1d8e0[_0x2ab34e(0x1a8)]);}const _0x55a413={..._0x4686e8,'options':{..._0x4686e8[_0x2ab34e(0x20d)],'journeysOnly':!![],..._0x568b01&&{'singleFilePath':_0x568b01}}};return this['segmentPushCommand'][_0x2ab34e(0x19c)](_0x55a413);}}export class JourneyVersionsCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x126);[a25_0x25349b(0x173)]=a25_0x25349b(0x180);async[a25_0x25349b(0x19c)](_0x386445){const _0x3fc56e=a25_0x25349b,{options:_0x1cd342,args:_0x24e992,tdx:_0x12b5e5}=_0x386445,_0x572da6=_0x24e992[0x0];if(!requireNameOrPath(_0x572da6))return 0x1;if(_0x1cd342['verbose'])console[_0x3fc56e(0x136)](_0x3fc56e(0x172)+_0x572da6);const {journeyId:_0x413d7a}=await resolveJourneyIdFromInput(_0x572da6,_0x1cd342,_0x12b5e5),_0x5c6f04=await withSpinner(_0x3fc56e(0x215),()=>_0x12b5e5[_0x3fc56e(0x166)]['listVersions'](_0x413d7a),{'verbose':_0x1cd342[_0x3fc56e(0x225)]}),{bundleName:_0x50d99b,versions:_0x157bcd,latestJourneyId:_0x396790}=_0x5c6f04['data'];console[_0x3fc56e(0x136)](_0x50d99b+':\x20'+_0x157bcd[_0x3fc56e(0x16a)]+'\x20version'+(_0x157bcd[_0x3fc56e(0x16a)]!==0x1?'s':''));const _0x1d1a23=_0x157bcd['map'](_0x214754=>({'version':_0x214754['versionNumber'],'journey_id':_0x214754['journeyId'],'name':_0x214754['name'],'state':_0x214754[_0x3fc56e(0x200)],'paused':_0x214754[_0x3fc56e(0x228)],'latest':_0x214754[_0x3fc56e(0x14d)]===_0x396790,'created_at':_0x214754['createdAt']}));return await handleSDKOutput(_0x1d1a23,_0x1cd342),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a25_0x25349b(0x216);['description']=a25_0x25349b(0x21e);async[a25_0x25349b(0x19c)](_0x175202){const _0x15db10=a25_0x25349b,{options:_0x3c89de,args:_0x21ea6a,tdx:_0x176a6f}=_0x175202,_0x47f507=_0x21ea6a[0x0];if(!requireNameOrPath(_0x47f507))return 0x1;if(_0x3c89de[_0x15db10(0x225)])console[_0x15db10(0x136)](_0x15db10(0x172)+_0x47f507);const {journeyId:_0xe7d0b7,journeyName:_0xcab33b}=await resolveJourneyIdFromInput(_0x47f507,_0x3c89de,_0x176a6f);if(!_0x3c89de[_0x15db10(0x1ff)]){const _0x382a36=await confirm(_0x15db10(0x11b)+_0xcab33b+'\x22?');if(!_0x382a36)return console[_0x15db10(0x136)]('Cancelled'),0x0;}const _0x4de047=await withSpinner(_0x15db10(0x1a9),()=>_0x176a6f[_0x15db10(0x166)][_0x15db10(0x174)](_0xe7d0b7),{'verbose':_0x3c89de[_0x15db10(0x225)]}),_0x4f2597=_0x4de047['data'];return console['error'](a25_0x3b0196[_0x15db10(0x159)]('✔')+_0x15db10(0x220)+_0x4f2597['attributes']['versionNumber']+_0x15db10(0x12c)+_0x4f2597['attributes'][_0x15db10(0x208)]+'\x22'),console['error'](_0x15db10(0x148)+_0x4f2597['id']),await handleSingleObjectOutput({'id':_0x4f2597['id'],'name':_0x4f2597[_0x15db10(0x1d0)]['name'],'version':_0x4f2597[_0x15db10(0x1d0)][_0x15db10(0x15e)],'state':_0x4f2597[_0x15db10(0x1d0)][_0x15db10(0x200)],'bundle_id':_0x4f2597[_0x15db10(0x1d0)][_0x15db10(0x1b6)],'created_at':_0x4f2597[_0x15db10(0x1d0)][_0x15db10(0x14a)]},_0x3c89de),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a25_0x25349b(0x144);['description']=a25_0x25349b(0x1cc);async['execute'](_0x46c19e){const _0x483c9b=a25_0x25349b,{options:_0x3eaa8f,args:_0xc04e28,tdx:_0x1bfe95}=_0x46c19e,_0x1f3364=_0xc04e28[0x0];if(!requireNameOrPath(_0x1f3364))return 0x1;const _0x5ca31e=_0x3eaa8f['version'];if(!_0x5ca31e)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x483c9b(0x136)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x307206=parseInt(_0x5ca31e,0xa);if(isNaN(_0x307206)||_0x307206<0x1)return console[_0x483c9b(0x136)](_0x483c9b(0x1aa)+_0x5ca31e),0x1;if(_0x3eaa8f[_0x483c9b(0x225)])console[_0x483c9b(0x136)](_0x483c9b(0x172)+_0x1f3364+_0x483c9b(0x1c7)+_0x307206);const {journeyId:_0x304066,parentSegmentId:_0x499162}=await resolveJourneyIdFromInput(_0x1f3364,_0x3eaa8f,_0x1bfe95),_0x389759=await withSpinner('Resolving\x20version...',()=>_0x1bfe95[_0x483c9b(0x166)][_0x483c9b(0x1d5)](_0x304066),{'verbose':_0x3eaa8f['verbose']}),{versions:_0x437495,latestJourneyId:_0x4a8619}=_0x389759['data'],_0x1e249b=_0x437495[_0x483c9b(0x1a5)](_0x2c7226=>_0x2c7226[_0x483c9b(0x15e)]===_0x307206);if(!_0x1e249b){const _0x4a4e5c=_0x437495['map'](_0x48b457=>'v'+_0x48b457[_0x483c9b(0x15e)])['join'](',\x20');return console['error']('Error:\x20Version\x20'+_0x307206+_0x483c9b(0x1c1)+_0x4a4e5c),0x1;}const _0x1ed8b6=await withSpinner('Getting\x20version\x20'+_0x307206+_0x483c9b(0x20f),()=>_0x1bfe95[_0x483c9b(0x166)][_0x483c9b(0x19b)](_0x1e249b[_0x483c9b(0x14d)]),{'verbose':_0x3eaa8f[_0x483c9b(0x225)]}),_0x7173c0=_0x1ed8b6[_0x483c9b(0x162)],_0x35d8c6=getConsoleNextUrl(_0x3eaa8f[_0x483c9b(0x16e)],_0x483c9b(0x211)+_0x499162+_0x483c9b(0x1bc)+_0x1e249b['journeyId']+_0x483c9b(0x13f));return await handleSingleObjectOutput({'id':_0x7173c0['id'],'name':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x208)],'version':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x15e)],'description':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x173)],'state':_0x7173c0[_0x483c9b(0x1d0)]['state'],'paused':_0x7173c0[_0x483c9b(0x1d0)]['paused'],'reentry_mode':_0x7173c0['attributes'][_0x483c9b(0x1ee)],'stages':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x17e)]?.['length']||0x0,..._0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x1ab)]&&{'goal':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x1ab)][_0x483c9b(0x208)]},'latest':_0x1e249b[_0x483c9b(0x14d)]===_0x4a8619,'created_at':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x14a)],'updated_at':_0x7173c0['attributes'][_0x483c9b(0x1d1)],'url':_0x35d8c6},_0x3eaa8f),0x0;}}
1
+ const a25_0x50e1e5=a25_0x2745;(function(_0x5a36e0,_0x4939ff){const _0x23b05e=a25_0x2745,_0x4f91af=_0x5a36e0();while(!![]){try{const _0x293579=parseInt(_0x23b05e(0x1dd))/0x1+parseInt(_0x23b05e(0x160))/0x2*(-parseInt(_0x23b05e(0x1ef))/0x3)+-parseInt(_0x23b05e(0x169))/0x4+parseInt(_0x23b05e(0x22c))/0x5+parseInt(_0x23b05e(0x190))/0x6*(parseInt(_0x23b05e(0x1d9))/0x7)+-parseInt(_0x23b05e(0x18c))/0x8*(parseInt(_0x23b05e(0x168))/0x9)+-parseInt(_0x23b05e(0x1f3))/0xa*(-parseInt(_0x23b05e(0x241))/0xb);if(_0x293579===_0x4939ff)break;else _0x4f91af['push'](_0x4f91af['shift']());}catch(_0x3f3857){_0x4f91af['push'](_0x4f91af['shift']());}}}(a25_0x35a2,0xd6648));import a25_0x38e234 from'chalk';import a25_0x51aa01 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';function a25_0x2745(_0x30fb84,_0x243c24){_0x30fb84=_0x30fb84-0x152;const _0x35a2fb=a25_0x35a2();let _0x274544=_0x35a2fb[_0x30fb84];return _0x274544;}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(_0x33331e){const _0x52a4f2=a25_0x2745;return!_0x33331e&&(console['error'](_0x52a4f2(0x203)),console[_0x52a4f2(0x157)](_0x52a4f2(0x22b))),!!_0x33331e;}function withJsonFormat(_0x2614e6){const _0x44fa80=a25_0x2745;if(!_0x2614e6[_0x44fa80(0x213)]&&!_0x2614e6[_0x44fa80(0x1c5)]&&!_0x2614e6['jsonl']&&!_0x2614e6[_0x44fa80(0x1c4)])return{..._0x2614e6,'format':_0x44fa80(0x1c5),'json':!![]};return _0x2614e6;}function formatJourneyState(_0x521cf7){const _0x440196=a25_0x2745;switch(_0x521cf7){case _0x440196(0x219):return a25_0x38e234[_0x440196(0x1d0)](_0x440196(0x208));case _0x440196(0x1ee):return a25_0x38e234['dim'](_0x440196(0x19b));case _0x440196(0x1b5):return a25_0x38e234[_0x440196(0x1db)]('(paused)');case'completed':return a25_0x38e234[_0x440196(0x152)](_0x440196(0x18e));case _0x440196(0x1ba):return a25_0x38e234['dim']('(archived)');default:return'('+_0x521cf7+')';}}function formatJourneyItem(_0x24e006,_0xc0884b='',_0x59e78f){const _0x59479a=a25_0x2745,_0x448f35=formatJourneyState(_0x24e006[_0x59479a(0x214)]),_0x1a0d5b=_0x59e78f?hyperlink(_0x24e006['journeyBundleName'],_0x59e78f):_0x24e006['journeyBundleName'];return _0xc0884b+_0x59479a(0x1b3)+_0x1a0d5b+'\x20'+_0x448f35;}function escapeRegex(_0x3e4a27){const _0x9af394=a25_0x2745;return _0x3e4a27[_0x9af394(0x20e)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x553055){const _0x22c41f=a25_0x2745,_0x3fd75b=_0x553055['split']('*')[_0x22c41f(0x16b)](escapeRegex);return new RegExp(_0x3fd75b[_0x22c41f(0x204)]('.*'),'i');}function buildRuleToNameMapping(_0x17218f){const _0x50e56d=a25_0x2745,_0x287fe3=new Map();if(_0x17218f[_0x50e56d(0x23d)])for(const [_0x35c619,_0x287cec]of Object['entries'](_0x17218f[_0x50e56d(0x23d)])){if(_0x287cec[_0x50e56d(0x195)]){const _0x5528ed=serializeRule(_0x287cec[_0x50e56d(0x195)]),_0x80d0cc=_0x287fe3[_0x50e56d(0x1d2)](_0x5528ed);_0x80d0cc?_0x80d0cc[_0x50e56d(0x16a)](_0x35c619):_0x287fe3[_0x50e56d(0x211)](_0x5528ed,[_0x35c619]);}}return _0x287fe3;}async function resolveJourneyIdFromInput(_0x244120,_0x51d7be,_0x4d0883){const _0x3a865a=a25_0x2745,_0x692a37=await resolveJourneyTarget(_0x244120,_0x51d7be['parentSegment'],_0x51d7be[_0x3a865a(0x227)]),_0x3c3721=_0x692a37[_0x3a865a(0x1e8)];if(!_0x3c3721)throw new SDKError(ErrorCode[_0x3a865a(0x1f1)],_0x3a865a(0x180));const _0x3735e9=await withSpinner(_0x3a865a(0x1c6),()=>_0x4d0883[_0x3a865a(0x22e)][_0x3a865a(0x24c)](_0x3c3721),{'verbose':_0x51d7be[_0x3a865a(0x227)]}),_0x292e8a=_0x3735e9[_0x3a865a(0x174)],_0x440f95=await withSpinner('Resolving\x20journey...',()=>_0x4d0883[_0x3a865a(0x20f)][_0x3a865a(0x1eb)](_0x292e8a,_0x692a37[_0x3a865a(0x1a3)]),{'verbose':_0x51d7be[_0x3a865a(0x227)]});return{'journeyId':_0x440f95[_0x3a865a(0x174)],'journeyName':_0x692a37[_0x3a865a(0x1a3)],'parentSegmentId':_0x292e8a};}async function resolveJourneyTarget(_0x386fe7,_0x160f76,_0x59eec0){const _0x5796c9=a25_0x2745;if(isYamlFilePath(_0x386fe7))try{const _0x16a38b=await resolveYamlFilePath(_0x386fe7);return _0x59eec0&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x386fe7),console[_0x5796c9(0x157)]('\x20\x20Parent\x20segment:\x20'+_0x16a38b[_0x5796c9(0x1e8)]),console[_0x5796c9(0x157)](_0x5796c9(0x201)+_0x16a38b[_0x5796c9(0x263)]),console['error'](_0x5796c9(0x21c)+(_0x16a38b[_0x5796c9(0x1d8)]||_0x5796c9(0x246)))),{'journeyName':_0x16a38b[_0x5796c9(0x263)],'parentSegment':_0x16a38b['parentSegment'],'resolved':_0x16a38b};}catch(_0x427a79){throw new SDKError(ErrorCode[_0x5796c9(0x1f1)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x427a79[_0x5796c9(0x240)]);}if(!_0x160f76)throw new SDKError(ErrorCode[_0x5796c9(0x1f1)],_0x5796c9(0x183));return{'journeyName':_0x386fe7,'parentSegment':_0x160f76};}export class JourneyListCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x15b);['description']=a25_0x50e1e5(0x24e);async[a25_0x50e1e5(0x192)](_0x51020c){const _0x8ed274=a25_0x50e1e5,{options:_0x1f5671,args:_0x4ff7e1,tdx:_0x3d8628}=_0x51020c,_0x378fb7=_0x4ff7e1[0x0],_0x29f5c6=_0x1f5671['parentSegment'];if(!_0x29f5c6)return console['error'](_0x8ed274(0x1a8)),console[_0x8ed274(0x157)](_0x8ed274(0x1fa)),0x1;const _0x320a39=await withSpinner(_0x8ed274(0x1c6),()=>_0x3d8628[_0x8ed274(0x22e)]['resolveParentId'](_0x29f5c6),{'verbose':_0x1f5671[_0x8ed274(0x227)]}),_0x285097=_0x320a39[_0x8ed274(0x174)];_0x1f5671['verbose']&&(console['error'](_0x8ed274(0x23a)+_0x29f5c6+_0x8ed274(0x197)+_0x285097+')'),_0x378fb7&&console[_0x8ed274(0x157)](_0x8ed274(0x173)+_0x378fb7));const _0x174938=await withSpinner(_0x8ed274(0x25a),()=>_0x3d8628[_0x8ed274(0x22e)][_0x8ed274(0x184)](_0x285097),{'verbose':_0x1f5671[_0x8ed274(0x227)]}),_0x4807a0=_0x174938[_0x8ed274(0x174)],_0x16149d=_0x4807a0[_0x8ed274(0x19f)],_0x4a9356=await withSpinner(_0x8ed274(0x233),()=>_0x3d8628['journey'][_0x8ed274(0x264)](_0x285097,_0x16149d),{'verbose':_0x1f5671[_0x8ed274(0x227)]});let _0x530f2c=_0x4a9356[_0x8ed274(0x174)][_0x8ed274(0x16e)];const _0x456cb1=_0x4a9356['data'][_0x8ed274(0x262)],_0x19bd4d=new Map();for(const _0x4c0422 of _0x456cb1){_0x19bd4d[_0x8ed274(0x211)](_0x4c0422['id'],_0x4c0422[_0x8ed274(0x17d)]);}if(_0x378fb7){const _0x3e7b77=globToRegex(_0x378fb7);_0x530f2c=_0x530f2c['filter'](_0x4b0732=>_0x3e7b77[_0x8ed274(0x1b6)](_0x4b0732[_0x8ed274(0x1dc)]));}console['error'](_0x8ed274(0x156)+_0x530f2c[_0x8ed274(0x18a)]+_0x8ed274(0x260)+(_0x530f2c[_0x8ed274(0x18a)]!==0x1?'s':''));const _0x54a5ad=_0x300013=>{const _0x505377=_0x8ed274;return getConsoleNextUrl(_0x1f5671[_0x505377(0x22d)],_0x505377(0x16c)+_0x285097+_0x505377(0x247)+_0x300013+_0x505377(0x1bb));};if(_0x1f5671[_0x8ed274(0x213)]===_0x8ed274(0x250))await handleSDKOutput(_0x530f2c,_0x1f5671);else{if(_0x1f5671['format']==='json'){const _0x4f9e36=_0x530f2c[_0x8ed274(0x16b)](_0x3296e6=>({..._0x3296e6,'url':_0x54a5ad(_0x3296e6['id'])}));await handleSDKOutput(_0x4f9e36,_0x1f5671);}else{console[_0x8ed274(0x23c)]('['+_0x29f5c6+']');const _0x44b18f=new Map(),_0x2836c8=[];for(const _0x3835ec of _0x530f2c){if(!_0x3835ec[_0x8ed274(0x1f0)]||_0x3835ec[_0x8ed274(0x1f0)]===_0x16149d)_0x2836c8[_0x8ed274(0x16a)](_0x3835ec);else{const _0x13a1c6=_0x44b18f[_0x8ed274(0x1d2)](_0x3835ec[_0x8ed274(0x1f0)])||[];_0x13a1c6[_0x8ed274(0x16a)](_0x3835ec),_0x44b18f[_0x8ed274(0x211)](_0x3835ec[_0x8ed274(0x1f0)],_0x13a1c6);}}const _0x5a3bca=(_0x1e2440,_0x19025a)=>_0x1e2440[_0x8ed274(0x1dc)][_0x8ed274(0x1be)](_0x19025a[_0x8ed274(0x1dc)],undefined,{'sensitivity':_0x8ed274(0x21f)});_0x2836c8[_0x8ed274(0x1a2)](_0x5a3bca);for(const _0x1a2959 of _0x2836c8){console[_0x8ed274(0x23c)](formatJourneyItem(_0x1a2959,'',_0x54a5ad(_0x1a2959['id'])));}const _0x49c94a=[..._0x44b18f[_0x8ed274(0x1bc)]()]['sort']((_0x9e686e,_0x9578ae)=>{const _0x3e1073=_0x8ed274,_0x994e9a=_0x19bd4d['get'](_0x9e686e[0x0])||_0x9e686e[0x0],_0x1d46f7=_0x19bd4d[_0x3e1073(0x1d2)](_0x9578ae[0x0])||_0x9578ae[0x0];return _0x994e9a['localeCompare'](_0x1d46f7,undefined,{'sensitivity':'base'});});for(const [_0x4730e0,_0xa0ed14]of _0x49c94a){const _0x52fc67=_0x19bd4d['get'](_0x4730e0)||_0x4730e0;console['log'](_0x8ed274(0x1b9)+_0x52fc67),_0xa0ed14[_0x8ed274(0x1a2)](_0x5a3bca);for(const _0x4e1caf of _0xa0ed14){console[_0x8ed274(0x23c)](formatJourneyItem(_0x4e1caf,'\x20\x20',_0x54a5ad(_0x4e1caf['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]='journey:view';[a25_0x50e1e5(0x1e3)]=a25_0x50e1e5(0x162);async[a25_0x50e1e5(0x192)](_0x3fd9c4){const _0x10c122=a25_0x50e1e5,{options:_0x5e7d1c,args:_0x1f4cef,tdx:_0x475bbd}=_0x3fd9c4,_0x1beb32=_0x1f4cef[0x0];if(!_0x1beb32)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x10c122(0x157)](_0x10c122(0x161)),console[_0x10c122(0x157)](_0x10c122(0x234)),console[_0x10c122(0x157)](_0x10c122(0x1d5)),0x1;_0x5e7d1c[_0x10c122(0x227)]&&console[_0x10c122(0x157)](_0x10c122(0x153)+_0x1beb32);const {journeyId:_0x3f0b3,parentSegmentId:_0xdeca21}=await resolveJourneyIdFromInput(_0x1beb32,_0x5e7d1c,_0x475bbd);if(_0x5e7d1c[_0x10c122(0x202)]){const _0x134821=getConsoleNextUrl(_0x5e7d1c[_0x10c122(0x22d)],'/app/ps/'+_0xdeca21+_0x10c122(0x247)+_0x3f0b3+_0x10c122(0x179));return console[_0x10c122(0x157)](a25_0x38e234[_0x10c122(0x1d0)]('✔')+_0x10c122(0x1cf)+a25_0x38e234[_0x10c122(0x1e2)](_0x134821)),openBrowser(_0x134821),0x0;}const _0x4ee935=await withSpinner(_0x10c122(0x191),()=>_0x475bbd[_0x10c122(0x20f)][_0x10c122(0x221)](_0x3f0b3),{'verbose':_0x5e7d1c[_0x10c122(0x227)]}),_0x32cede=_0x4ee935[_0x10c122(0x174)],_0x285a8d=_0x5e7d1c[_0x10c122(0x205)];let _0x449509;if(_0x285a8d)try{const _0x4f693a=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x475bbd[_0x10c122(0x20f)]['getStatistics'](_0x3f0b3),{'verbose':_0x5e7d1c[_0x10c122(0x227)]});_0x449509=_0x4f693a['data'];}catch{_0x5e7d1c[_0x10c122(0x227)]&&console[_0x10c122(0x157)]('\x20\x20Statistics\x20not\x20available');}const _0x383608=getConsoleNextUrl(_0x5e7d1c['site'],'/app/ps/'+_0xdeca21+'/e/'+_0x3f0b3+_0x10c122(0x179)),_0x1d0952={'id':_0x32cede['id'],'name':_0x32cede[_0x10c122(0x248)][_0x10c122(0x17d)],'description':_0x32cede['attributes'][_0x10c122(0x1e3)],'state':_0x32cede[_0x10c122(0x248)][_0x10c122(0x214)],'paused':_0x32cede[_0x10c122(0x248)][_0x10c122(0x1b5)],'reentry_mode':_0x32cede[_0x10c122(0x248)][_0x10c122(0x200)],'stages':_0x32cede[_0x10c122(0x248)][_0x10c122(0x182)]?.[_0x10c122(0x18a)]||0x0,..._0x32cede[_0x10c122(0x248)][_0x10c122(0x181)]&&{'goal':_0x32cede[_0x10c122(0x248)][_0x10c122(0x181)][_0x10c122(0x17d)]},..._0x449509&&{'statistics':{'size':_0x449509[_0x10c122(0x251)],'entered':_0x449509[_0x10c122(0x245)],'goal_achieved':_0x449509[_0x10c122(0x1d4)],'completion_rate':_0x449509['completionRate'],'exit_or_jump':_0x449509['exitOrJumpSize'],'exit_or_jump_rate':_0x449509[_0x10c122(0x20b)],'stages':_0x449509[_0x10c122(0x194)]}},'url':_0x383608};return await handleSingleObjectOutput(_0x1d0952,_0x5e7d1c),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x189);[a25_0x50e1e5(0x1e3)]=a25_0x50e1e5(0x256);async['execute'](_0x28f3ac){const _0x335ab8=a25_0x50e1e5,{options:_0x4ae0ea,args:_0x20eb31,tdx:_0x4e805f}=_0x28f3ac,_0x5cac33=_0x20eb31[0x0];if(!requireNameOrPath(_0x5cac33))return 0x1;_0x4ae0ea[_0x335ab8(0x227)]&&console[_0x335ab8(0x157)](_0x335ab8(0x153)+_0x5cac33);const _0x3ade1d=_0x4ae0ea,_0x2db3d4=_0x3ade1d[_0x335ab8(0x186)],_0x3c67d2=_0x3ade1d['to'],_0x171122=_0x3ade1d['includeHistory'],_0x387475=_0x3ade1d[_0x335ab8(0x226)];_0x171122&&!_0x2db3d4&&!_0x3c67d2&&console[_0x335ab8(0x157)](_0x335ab8(0x175));const _0x47aee1=_0x171122?withJsonFormat(_0x4ae0ea):_0x4ae0ea,{journeyId:_0x45a7a8,journeyName:_0x2df624}=await resolveJourneyIdFromInput(_0x5cac33,_0x47aee1,_0x4e805f),_0x40805f=_0x2db3d4||_0x3c67d2?{'from':_0x2db3d4,'to':_0x3c67d2}:undefined,_0x3a39c6=await withSpinner(_0x335ab8(0x210),()=>Promise[_0x335ab8(0x199)]([_0x4e805f[_0x335ab8(0x20f)][_0x335ab8(0x221)](_0x45a7a8),_0x4e805f[_0x335ab8(0x20f)][_0x335ab8(0x1b2)](_0x45a7a8,_0x40805f)]),{'verbose':_0x47aee1['verbose']}),[_0xcc49a5,_0x261836]=_0x3a39c6[_0x335ab8(0x174)];if(!_0x261836||_0x261836[_0x335ab8(0x1d7)]===null)return console[_0x335ab8(0x157)](_0x335ab8(0x230)+_0x2df624),console[_0x335ab8(0x157)](_0x335ab8(0x209)),0x0;const _0x1aad5f=buildStageNameMap(_0xcc49a5),_0x3fbc12=!!(_0x40805f&&_0x261836[_0x335ab8(0x225)]?.[_0x335ab8(0x18a)]),_0x5551d7={'stageNameMap':_0x1aad5f,'hasPeriod':_0x3fbc12,'includeHistory':!!_0x171122};if(_0x387475&&_0x261836[_0x335ab8(0x194)]){const _0x5aa8eb=_0x261836['stages'][_0x335ab8(0x1a0)](_0x347c81=>{const _0x507ff6=_0x335ab8,_0x4d1626=_0x1aad5f[_0x507ff6(0x1d2)](_0x347c81['id'])??'';return _0x4d1626['toLowerCase']()===_0x387475[_0x507ff6(0x21d)]();});if(_0x5aa8eb)return await handleSingleObjectOutput(formatStageStats(_0x5aa8eb,_0x5551d7),_0x47aee1),0x0;const _0x5253b5=_0x261836[_0x335ab8(0x194)][_0x335ab8(0x16b)](_0x53ef7c=>_0x1aad5f[_0x335ab8(0x1d2)](_0x53ef7c['id'])??_0x53ef7c['id']);return console[_0x335ab8(0x157)](_0x335ab8(0x198)+_0x387475+_0x335ab8(0x20a)),console[_0x335ab8(0x157)](_0x335ab8(0x15f)+_0x5253b5[_0x335ab8(0x204)](',\x20')),0x1;}const _0x5cb5da=_0x261836['stages']?.[_0x335ab8(0x16b)](_0x1c2c76=>formatStageStats(_0x1c2c76,_0x5551d7)),_0x516d3d=assembleJourneyStats(_0x261836,{'from':_0x2db3d4,'to':_0x3c67d2,'includeHistory':_0x171122});return await this[_0x335ab8(0x1bf)](_0x516d3d,_0x5cb5da??[],_0x47aee1),0x0;}async[a25_0x50e1e5(0x1bf)](_0x22ab96,_0x2a1b54,_0x507328){const _0x4d1993=a25_0x50e1e5,_0x536f99=_0x507328[_0x4d1993(0x213)]===_0x4d1993(0x1c5)||_0x507328[_0x4d1993(0x213)]===_0x4d1993(0x17f)||_0x507328[_0x4d1993(0x1c5)]||_0x507328['jsonl'];if(_0x536f99){_0x22ab96[_0x4d1993(0x194)]=_0x2a1b54,await handleSingleObjectOutput(_0x22ab96,_0x507328);return;}await handleSingleObjectOutput(_0x22ab96,_0x507328);for(const _0x3bb7bc of _0x2a1b54){console[_0x4d1993(0x23c)](''),console[_0x4d1993(0x23c)](String(a25_0x38e234[_0x4d1993(0x1e2)][_0x4d1993(0x255)]('['+_0x3bb7bc[_0x4d1993(0x17d)]+']'))+a25_0x38e234[_0x4d1993(0x17a)]('\x20'+_0x3bb7bc['id']));const {id:_0xf51186,name:_0xa041b6,..._0xb701e9}=_0x3bb7bc;await handleSingleObjectOutput(_0xb701e9,_0x507328);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a25_0x50e1e5(0x21e);[a25_0x50e1e5(0x1e3)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a25_0x50e1e5(0x192)](_0x2fc088){const _0x5e869c=a25_0x50e1e5,{options:_0x29ff61,args:_0x4c9851,tdx:_0x5dfb24}=_0x2fc088,_0x227523=_0x4c9851[0x0];if(!requireNameOrPath(_0x227523))return 0x1;_0x29ff61[_0x5e869c(0x227)]&&console[_0x5e869c(0x157)](_0x5e869c(0x153)+_0x227523);const _0x47e9f7=_0x29ff61,_0x23acab=_0x47e9f7[_0x5e869c(0x1da)],_0x3286d5=_0x47e9f7[_0x5e869c(0x186)],_0x3b8c5f=_0x47e9f7['to'],_0x7cc0bd=_0x47e9f7[_0x5e869c(0x1e5)];if(_0x23acab&&_0x23acab!==_0x5e869c(0x19d)&&_0x23acab!==_0x5e869c(0x1c7))return console['error']('Error:\x20Invalid\x20--type\x20\x22'+_0x23acab+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x29347c=withJsonFormat(_0x29ff61),{journeyId:_0x346050,journeyName:_0x76d666}=await resolveJourneyIdFromInput(_0x227523,_0x29347c,_0x5dfb24),_0x3bc043={'type':_0x23acab,'from':_0x3286d5,'to':_0x3b8c5f,'limit':_0x7cc0bd},_0x1c677d=await withSpinner(_0x5e869c(0x1bd),()=>_0x5dfb24['journey'][_0x5e869c(0x1e1)](_0x346050,_0x3bc043),{'verbose':_0x29347c[_0x5e869c(0x227)]}),_0x38356d=_0x1c677d[_0x5e869c(0x174)],_0x19f249=_0x38356d['conversion']&&(_0x38356d[_0x5e869c(0x19d)][_0x5e869c(0x155)][_0x5e869c(0x18a)]>0x0||_0x38356d[_0x5e869c(0x19d)][_0x5e869c(0x158)][_0x5e869c(0x18a)]>0x0),_0x578dd3=_0x38356d[_0x5e869c(0x1c7)]&&_0x38356d[_0x5e869c(0x1c7)][_0x5e869c(0x18a)]>0x0;if(!_0x19f249&&!_0x578dd3)return console[_0x5e869c(0x157)](_0x5e869c(0x1c8)+_0x76d666),console['error'](_0x5e869c(0x238)),_0x3286d5&&_0x3b8c5f&&console['error'](_0x5e869c(0x187)),0x0;return await handleSingleObjectOutput(_0x38356d,_0x29347c),0x0;}}function formatStageStats(_0xfb02c4,_0x5bf894){const _0x54b036=a25_0x50e1e5,_0x2cd95a=_0x5bf894['hasPeriod']&&_0xfb02c4[_0x54b036(0x225)]?.[_0x54b036(0x18a)]?aggregateStageHistory(_0xfb02c4[_0x54b036(0x225)]):{'size':_0xfb02c4[_0x54b036(0x251)],'entered':_0xfb02c4['enteredSize'],'milestone':_0xfb02c4[_0x54b036(0x178)],'milestone_rate':_0xfb02c4[_0x54b036(0x253)],'exit_or_jump':_0xfb02c4[_0x54b036(0x1b8)],'exit_or_jump_rate':_0xfb02c4[_0x54b036(0x20b)]},_0x4302ef={'id':_0xfb02c4['id'],'name':_0x5bf894[_0x54b036(0x18b)][_0x54b036(0x1d2)](_0xfb02c4['id'])??_0xfb02c4['id'],..._0x2cd95a};return _0x5bf894[_0x54b036(0x176)]&&_0x5bf894[_0x54b036(0x1b0)]&&_0xfb02c4['history']&&(_0x4302ef[_0x54b036(0x225)]=_0xfb02c4[_0x54b036(0x225)]),_0x4302ef;}export class JourneyPauseCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x249);[a25_0x50e1e5(0x1e3)]='Pause\x20a\x20running\x20journey';async['execute'](_0x6e9a6d){const _0x175b1d=a25_0x50e1e5,{options:_0xb48fdf,args:_0x2f3d87,tdx:_0x5381ba}=_0x6e9a6d,_0x1fa127=_0x2f3d87[0x0];if(!requireNameOrPath(_0x1fa127))return 0x1;_0xb48fdf['verbose']&&console[_0x175b1d(0x157)]('Input:\x20'+_0x1fa127);const {journeyId:_0x52fcc0,journeyName:_0x3a695e}=await resolveJourneyIdFromInput(_0x1fa127,_0xb48fdf,_0x5381ba);if(!_0xb48fdf['yes']){const _0x4b3fd5=await confirm(_0x175b1d(0x1d3)+_0x3a695e+'\x22?');if(!_0x4b3fd5)return console[_0x175b1d(0x157)](_0x175b1d(0x1b4)),0x0;}const _0x39278a=await withSpinner(_0x175b1d(0x1a1),()=>_0x5381ba['journey'][_0x175b1d(0x229)](_0x52fcc0),{'verbose':_0xb48fdf['verbose']}),_0x1e87a9=_0x39278a['data'];return console[_0x175b1d(0x157)]('✔\x20Journey\x20\x22'+_0x1e87a9[_0x175b1d(0x248)]['name']+_0x175b1d(0x1c3)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x1e9);['description']='Resume\x20a\x20paused\x20journey';async[a25_0x50e1e5(0x192)](_0x597825){const _0x39ec6f=a25_0x50e1e5,{options:_0x21dffb,args:_0x100ac4,tdx:_0x44f93b}=_0x597825,_0x1151c0=_0x100ac4[0x0];if(!requireNameOrPath(_0x1151c0))return 0x1;_0x21dffb[_0x39ec6f(0x227)]&&console[_0x39ec6f(0x157)]('Input:\x20'+_0x1151c0);const {journeyId:_0x540c9e,journeyName:_0x410388}=await resolveJourneyIdFromInput(_0x1151c0,_0x21dffb,_0x44f93b);if(!_0x21dffb[_0x39ec6f(0x23e)]){const _0x5a4c0a=await confirm(_0x39ec6f(0x1d6)+_0x410388+'\x22?');if(!_0x5a4c0a)return console['error'](_0x39ec6f(0x1b4)),0x0;}const _0x2f1da5=await withSpinner('Resuming\x20journey...',()=>_0x44f93b[_0x39ec6f(0x20f)][_0x39ec6f(0x1b1)](_0x540c9e),{'verbose':_0x21dffb[_0x39ec6f(0x227)]}),_0x559423=_0x2f1da5['data'];return console[_0x39ec6f(0x157)](_0x39ec6f(0x165)+_0x559423['attributes'][_0x39ec6f(0x17d)]+_0x39ec6f(0x1f2)),0x0;}}function a25_0x35a2(){const _0x103a68=['25122hUNUpS','Getting\x20journey\x20details...','execute','journey:version:create','stages','rule','\x20unchanged\x20files','\x20(ID:\x20','Error:\x20Stage\x20\x22','all','Error:\x20Journey\x20\x27','(draft)','\x20=\x20','conversion','options','rootFolderId','find','Pausing\x20journey...','sort','journeyName','\x20version','errorCode','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','filter','Error:\x20Parent\x20segment\x20context\x20required','\x20\x20-\x20','helpText','parentName','kind','journey:push','database','root\x20folder','includeHistory','resume','getStatistics','🗺️\x20','Cancelled','paused','test','...','exitOrJumpSize','📁\x20','archived','/j/da','entries','Getting\x20journey\x20traffic\x20data...','localeCompare','renderStats','\x20\x20Consolidating\x20duplicate\x20segment:\x20','diff','Warning:\x20Could\x20not\x20resolve\x20segment\x20','\x22\x20paused','tsv','json','Resolving\x20parent\x20segment...','activation','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journey:versions','cwd','hasChanges','\x20journey\x20files\x20to\x20','Listing\x20journey\x20activations...','\x20Opening\x20','green','Write\x20','get','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','goalSize','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','journeyId','folderPath','1904vXDkal','type','yellow','journeyBundleName','1526279NhSqkA','Error:\x20Invalid\x20version\x20number:\x20','content','journey:columns','getTrafficData','cyan','description','utf-8','limit','\x20journeys','\x27\x20not\x20found\x20in\x20','parentSegment','journey:resume','red','resolveJourneyId','.yml','versionNumber','draft','9cFVQUe','folderId','INVALID_ARGUMENT','\x22\x20resumed','67120ejMMXK','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journey:version:view','args','then','journeyBundleId','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20versions)','getLatestJourneyId','relativePath','Fetching\x20journeys\x20and\x20folders...','columns','reentryMode','\x20\x20Name:\x20','web','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','join','includeStats','journey:activations','dryRun','(running)','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x22\x20not\x20found','exitOrJumpRate','filePath','Error:\x20Version\x20','replace','journey','Getting\x20journey\x20statistics...','set','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','format','state','Fetching\x20users\x20and\x20connections...','getColumnMapping','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20->\x20','launched','Table:\x20','createdAt','\x20\x20Folder\x20path:\x20','toLowerCase','journey:traffic','base','\x20\x20Target:\x20','getJourney','absolutePath','journey:pull','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','history','stage','verbose','activation_','pause','Getting\x20column\x20mapping...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','818945kuMCsD','site','segment','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','No\x20statistics\x20available\x20for\x20journey:\x20','resourceName','\x20files?','Listing\x20journeys...','Options:','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','connection','Folder\x20path:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','getActivation','Parent\x20segment:\x20','listVersions','log','segments','yes','\x20changed\x20files','message','1034pemotI','createVersion','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)','Show\x20journey\x20table\x20column\x20mapping','enteredSize','(root)','/e/','attributes','journey:pause','-\x20no\x20files\x20written','\x0aPull\x20summary:','resolveParentId','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','List\x20journeys\x20in\x20current\x20context','\x20(draft)\x20—\x20\x22','table','size','List\x20activations\x20for\x20a\x20journey','completeMilestoneRate','segmentPushCommand','bold','Show\x20journey\x20statistics','no_parent','Error:\x20','resolveSegment','Fetching\x20parent\x20segment...','✔\x20Pulled\x20','Fetching\x20','Journey\x20name:\x20','activationParams','\x20(rule\x20match)','\x20journey','has','folders','segmentName','listJourneysWithFolders','repeat','blue','Input:\x20','session','nodes','✔\x20Found\x20','error','links','\x20\x20Preserving\x20local\x20segment\x20name:\x20','setPhase','journey:list','No\x20journeys\x20found','file','values','Available\x20stages:\x20','879530BpDllU','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Show\x20journey\x20details','Listing\x20journey\x20versions...','buildIdToNameMap','✔\x20Journey\x20\x22','buildIdToEmailMap','targetDir','90RiozXM','4698732tAIRXV','push','map','/app/ps/','Error:\x20Journey\x20not\x20found:\x20','journeys','add','\x0aChanges\x20to\x20\x27','parent_segment','isNew','Pattern:\x20','data','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','hasPeriod','\x20Created\x20v','milestoneSize','/j/da/je','dim','Target\x20file:\x20','user','name','\x20not\x20found.\x20Available:\x20','jsonl','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','goal','journeyStages','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','getParentFull','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','from','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','\x20new\x20files','journey:stats','length','stageNameMap','70184hfWpoc','version','(completed)','✔\x20Context\x20set:\x20'];a25_0x35a2=function(){return _0x103a68;};return a25_0x35a2();}export class JourneyPullCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x223);[a25_0x50e1e5(0x1e3)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a25_0x50e1e5(0x192)](_0x4a1558){const _0xb08a43=a25_0x50e1e5,{options:_0x1768d7,args:_0x389a25,tdx:_0x3d471c}=_0x4a1558,_0x44c259=_0x1768d7,_0x529914=_0x389a25[0x0],_0x1effb7=_0x529914&&isYamlFilePath(_0x529914),_0x3ef122=await resolveTarget({'arg':_0x1effb7?_0x529914:undefined,'contextParent':_0x1768d7['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3ef122))return _0x3ef122[_0xb08a43(0x1a5)]===_0xb08a43(0x257)?(console[_0xb08a43(0x157)](a25_0x38e234[_0xb08a43(0x1db)](_0xb08a43(0x185))),console[_0xb08a43(0x157)](_0xb08a43(0x243)),console[_0xb08a43(0x157)](_0xb08a43(0x1f9)),console['error'](_0xb08a43(0x217)),console[_0xb08a43(0x157)](_0xb08a43(0x224))):(console[_0xb08a43(0x157)](a25_0x38e234[_0xb08a43(0x1ea)](_0xb08a43(0x258)+_0x3ef122['message']+'\x0a')),_0x3ef122[_0xb08a43(0x1aa)]&&console[_0xb08a43(0x157)](a25_0x38e234[_0xb08a43(0x1e2)](_0x3ef122[_0xb08a43(0x1aa)]))),0x1;let _0x311e6c=_0x1effb7?undefined:_0x529914,_0x1680a5,_0x44e276;_0x3ef122[_0xb08a43(0x1da)]===_0xb08a43(0x15d)&&(_0x311e6c=_0x3ef122[_0xb08a43(0x231)],_0x1680a5=_0x3ef122[_0xb08a43(0x20c)],_0x44e276=_0x3ef122[_0xb08a43(0x1d8)]);const _0x59818f=_0x3ef122[_0xb08a43(0x1ab)],_0xcb962e=_0x3ef122[_0xb08a43(0x167)];_0x44c259['verbose']&&(console[_0xb08a43(0x157)]('Parent\x20segment:\x20'+_0x59818f),console['error']('Target\x20directory:\x20'+_0xcb962e),_0x311e6c&&console[_0xb08a43(0x157)](_0xb08a43(0x25d)+_0x311e6c),_0x1680a5&&console['error'](_0xb08a43(0x17b)+_0x1680a5),_0x44e276&&console[_0xb08a43(0x157)](_0xb08a43(0x237)+_0x44e276));const _0x769ba7=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3d471c[_0xb08a43(0x22e)][_0xb08a43(0x24c)](_0x59818f),{'verbose':_0x1768d7[_0xb08a43(0x227)]}),_0x45898c=_0x769ba7[_0xb08a43(0x174)],{journeys:_0x241ab5,folders:_0x1590ca}=await withSpinner(_0xb08a43(0x1fe),async()=>{const _0x1f0811=_0xb08a43,[_0x1902d7,_0x126824]=await Promise[_0x1f0811(0x199)]([_0x3d471c[_0x1f0811(0x20f)]['listJourneysFromParentSegment'](_0x45898c,undefined,{'includeAllVersions':!![]}),_0x3d471c[_0x1f0811(0x22e)]['listFolders'](_0x45898c)]);return{'journeys':_0x1902d7,'folders':_0x126824};},{'verbose':_0x1768d7[_0xb08a43(0x227)]})[_0xb08a43(0x1f7)](_0x459e1e=>_0x459e1e[_0xb08a43(0x174)]);let _0x21cfb4=_0x241ab5;const _0x32c81c=buildFolderIdToPathMap(_0x1590ca);if(_0x311e6c){const _0x3612fb=_0x21cfb4['filter'](_0x253c6b=>_0x253c6b[_0xb08a43(0x1dc)][_0xb08a43(0x21d)]()===_0x311e6c[_0xb08a43(0x21d)]());if(_0x3612fb[_0xb08a43(0x18a)]===0x0)return console[_0xb08a43(0x157)](_0xb08a43(0x16d)+_0x311e6c),console['error'](_0xb08a43(0x24d)),0x1;_0x21cfb4=_0x3612fb;}if(_0x44e276!==undefined){const _0x12a57c=_0x21cfb4[_0xb08a43(0x1a7)](_0x1a55b0=>{const _0x3ebb6f=_0xb08a43,_0x45c526=_0x1a55b0[_0x3ebb6f(0x1f0)]?_0x32c81c[_0x3ebb6f(0x1d2)](_0x1a55b0[_0x3ebb6f(0x1f0)])||'':'';return _0x45c526===_0x44e276;});if(_0x12a57c[_0xb08a43(0x18a)]===0x0&&_0x21cfb4[_0xb08a43(0x18a)]>0x0){console[_0xb08a43(0x157)](_0xb08a43(0x19a)+_0x311e6c+_0xb08a43(0x1e7)+(_0x44e276||_0xb08a43(0x1af))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x4162b0 of _0x21cfb4){const _0x28c091=_0x4162b0['folderId']?_0x32c81c[_0xb08a43(0x1d2)](_0x4162b0['folderId'])||'':'';console['error'](_0xb08a43(0x1a9)+(_0x28c091||_0xb08a43(0x246))+'/'+_0x4162b0[_0xb08a43(0x1dc)]);}return 0x1;}_0x21cfb4=_0x12a57c;}if(_0x21cfb4[_0xb08a43(0x18a)]===0x0)return console['error'](_0xb08a43(0x15c)),0x0;const _0x47f3c1=new Map();for(const _0x59bbab of _0x21cfb4){const _0x20dbe6=_0x59bbab[_0xb08a43(0x1f8)];!_0x47f3c1[_0xb08a43(0x261)](_0x20dbe6)&&_0x47f3c1[_0xb08a43(0x211)](_0x20dbe6,[]),_0x47f3c1[_0xb08a43(0x1d2)](_0x20dbe6)['push'](_0x59bbab);}for(const _0x353af7 of _0x47f3c1[_0xb08a43(0x15e)]()){_0x353af7[_0xb08a43(0x1a2)]((_0x19e114,_0x19332c)=>(_0x19e114[_0xb08a43(0x1ed)]||0x0)-(_0x19332c['versionNumber']||0x0));}const _0x3b0f8a=[],{idToEmailMap:_0x2707cd,connectionIdToNameMap:_0x178a97}=await withSpinner(_0xb08a43(0x215),async()=>{const _0x37bde6=_0xb08a43,[_0x5e116a,_0x2667f7]=await Promise[_0x37bde6(0x199)]([_0x3d471c[_0x37bde6(0x17c)][_0x37bde6(0x166)](),_0x3d471c[_0x37bde6(0x236)][_0x37bde6(0x164)]()]);return{'idToEmailMap':_0x5e116a,'connectionIdToNameMap':_0x2667f7};},{'verbose':_0x1768d7[_0xb08a43(0x227)]})[_0xb08a43(0x1f7)](_0x30d3b7=>_0x30d3b7['data']);for(const _0x4a1445 of _0x47f3c1[_0xb08a43(0x15e)]()){const _0x48fa00=_0x4a1445[0x0]['journeyBundleName'],_0x52c869=_0x4a1445[0x0][_0xb08a43(0x1f0)],_0x36d999=_0x52c869?_0x32c81c[_0xb08a43(0x1d2)](_0x52c869)||'':'',_0x602045=_0x36d999?a25_0x51aa01[_0xb08a43(0x204)](_0xcb962e,_0x36d999):_0xcb962e,_0x3a763b=_0x1680a5||a25_0x51aa01[_0xb08a43(0x204)](_0x602045,sanitizeFileName(_0x48fa00)+_0xb08a43(0x1ec));let _0x17dc17,_0xf0e909;if(existsSync(_0x3a763b))try{const _0x22bf8e=readFileSync(_0x3a763b,_0xb08a43(0x1e4)),_0x58085c=parseYamlString(_0x22bf8e);_0xf0e909=_0x58085c,_0x17dc17=buildRuleToNameMapping(_0x58085c),_0x44c259['verbose']&&_0x17dc17[_0xb08a43(0x251)]>0x0&&console[_0xb08a43(0x157)]('Found\x20'+_0x17dc17[_0xb08a43(0x251)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x48fa00);}catch(_0x718194){_0x44c259[_0xb08a43(0x227)]&&console[_0xb08a43(0x157)](_0xb08a43(0x22f)+_0x718194[_0xb08a43(0x240)]);}const _0x5d817e=[],_0x349ec4=new Set(),_0x5beb2=new Map(),_0x44b623=new Map(),_0x3beab5=new Set(),_0x588128=new Map(),_0x5466cb=new Map(),_0x54c976=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x48fa00+_0xb08a43(0x1b7),async _0x4f6573=>{const _0x4eece4=_0xb08a43;for(const _0x2229cd of _0x4a1445){const _0xb2f6ad=_0x4a1445[_0x4eece4(0x18a)]>0x1?_0x2229cd[_0x4eece4(0x1dc)]+'\x20v'+(_0x2229cd['versionNumber']||0x1):_0x2229cd[_0x4eece4(0x1dc)];_0x4f6573[_0x4eece4(0x15a)](_0x4eece4(0x25c)+_0xb2f6ad);const _0x139cfc=await _0x3d471c[_0x4eece4(0x20f)][_0x4eece4(0x221)](_0x2229cd['id']),_0x24972e=_0x139cfc[_0x4eece4(0x248)]?.['audienceId'],_0x4460b9={'resolveSegment':async _0x3c9925=>{const _0x4203ee=_0x4eece4;if(!_0x24972e)return{'name':_0x3c9925,'isJourneyLocal':![]};const _0x42b86d=_0x5beb2[_0x4203ee(0x1d2)](_0x3c9925);if(_0x42b86d)return _0x42b86d;try{const _0x5d457e=await _0x3d471c['segment']['getSegment'](_0x24972e,_0x3c9925),_0x45995b=_0x5d457e[_0x4203ee(0x1ac)]===SEGMENT_KIND_JOURNEY;let _0xb401f5,_0x193c3e=_0x5d457e[_0x4203ee(0x17d)];if(_0x45995b&&_0x5d457e[_0x4203ee(0x195)]){const _0x454026=await segmentResponseToDef(_0x5d457e,{'resolveSegmentName':async _0x5712af=>{const _0x27ded8=_0x4203ee,_0x2fa70d=_0x5beb2[_0x27ded8(0x1d2)](_0x5712af);if(_0x2fa70d)return _0x2fa70d['name'];const _0x1574cf=await _0x4460b9[_0x27ded8(0x259)](_0x5712af);return _0x1574cf[_0x27ded8(0x17d)];}}),_0x303617=_0x454026[_0x4203ee(0x195)];_0xb401f5={'description':_0x5d457e[_0x4203ee(0x1e3)],'rule':_0x303617};const _0x116bb5=serializeRule(_0x303617),_0xa86085=_0x44b623[_0x4203ee(0x1d2)](_0x116bb5);if(_0xa86085)_0x193c3e=_0xa86085,_0xb401f5=undefined,_0x44c259[_0x4203ee(0x227)]&&console[_0x4203ee(0x157)](_0x4203ee(0x1c0)+_0x5d457e[_0x4203ee(0x17d)]+_0x4203ee(0x218)+_0xa86085);else{let _0x1b17cf=![];if(_0x17dc17){const _0x294e5e=_0x17dc17[_0x4203ee(0x1d2)](_0x116bb5);if(_0x294e5e){const _0x220dfd=_0x294e5e[_0x4203ee(0x1a0)](_0x4000de=>!_0x349ec4[_0x4203ee(0x261)](_0x4000de));_0x220dfd&&(_0x193c3e=_0x220dfd,_0x349ec4[_0x4203ee(0x16f)](_0x220dfd),_0x44b623['set'](_0x116bb5,_0x220dfd),_0x1b17cf=!![],_0x44c259[_0x4203ee(0x227)]&&console[_0x4203ee(0x157)](_0x4203ee(0x159)+_0x220dfd+_0x4203ee(0x25f)));}}if(!_0x1b17cf){const _0xfcddc=generateJourneyLocalName(_0x5d457e[_0x4203ee(0x17d)]);_0xfcddc&&(_0x193c3e=_0xfcddc);let _0x485e3a=_0x193c3e,_0x45ecad=0x2;while(_0x349ec4[_0x4203ee(0x261)](_0x485e3a)){_0x485e3a=_0x193c3e+'_'+_0x45ecad,_0x45ecad++;}_0x349ec4[_0x4203ee(0x16f)](_0x485e3a),_0x44b623[_0x4203ee(0x211)](_0x116bb5,_0x485e3a),_0x193c3e=_0x485e3a;}}}const _0x3fe9c6={'name':_0x193c3e,'isJourneyLocal':_0x45995b,'definition':_0xb401f5};return _0x5beb2[_0x4203ee(0x211)](_0x3c9925,_0x3fe9c6),_0x3fe9c6;}catch(_0x2e29a4){return _0x1768d7['verbose']&&console[_0x4203ee(0x157)](_0x4203ee(0x1c2)+_0x3c9925+':\x20'+_0x2e29a4[_0x4203ee(0x240)]),{'name':_0x3c9925,'isJourneyLocal':![]};}},'resolveActivation':async _0x488728=>{const _0x20e769=_0x4eece4,_0x3fbfa4=_0x588128['get'](_0x488728);if(_0x3fbfa4)return _0x3fbfa4;try{const _0x471076=await _0x3d471c[_0x20e769(0x20f)][_0x20e769(0x239)](_0x2229cd['id'],_0x488728),_0x1cb950=journeyActivationStepToYaml(_0x471076,_0x2707cd,_0x178a97),_0x8a7c44=JSON['stringify']({'name':_0x1cb950[_0x20e769(0x17d)],'connection':_0x1cb950[_0x20e769(0x236)],'connector_config':_0x1cb950['connector_config']}),_0x5d5794=_0x5466cb[_0x20e769(0x1d2)](_0x8a7c44);if(_0x5d5794){const _0x12c5a0={'name':_0x5d5794,'isJourneyLocal':!![],'definition':_0x1cb950};return _0x588128[_0x20e769(0x211)](_0x488728,_0x12c5a0),_0x12c5a0;}const _0x11cb6c=_0x471076[_0x20e769(0x248)][_0x20e769(0x25e)][_0x20e769(0x17d)]||_0x488728,_0x411607=sanitizeYamlKey(_0x11cb6c)||_0x20e769(0x228)+_0x488728;let _0x3ed642=_0x411607,_0x10ed06=0x2;while(_0x3beab5[_0x20e769(0x261)](_0x3ed642)){_0x3ed642=_0x411607+'_'+_0x10ed06,_0x10ed06++;}_0x3beab5[_0x20e769(0x16f)](_0x3ed642),_0x5466cb[_0x20e769(0x211)](_0x8a7c44,_0x3ed642);const _0x3102a5={'name':_0x3ed642,'isJourneyLocal':!![],'definition':_0x1cb950};return _0x588128[_0x20e769(0x211)](_0x488728,_0x3102a5),_0x3102a5;}catch(_0xbe491b){return _0x1768d7['verbose']&&console[_0x20e769(0x157)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x488728+':\x20'+_0xbe491b['message']),{'name':_0x488728,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x28a593,_0x3e2b03)=>{const _0x46c840=_0x4eece4;return resolveJumpTarget(_0x28a593,_0x3e2b03,_0x54c976,_0x458174=>_0x3d471c[_0x46c840(0x20f)]['getJourney'](_0x458174));}},_0x536ca8=await journeyResponseToDef(_0x139cfc,_0x4460b9);_0x5d817e[_0x4eece4(0x16a)]({'item':_0x2229cd,'yaml':_0x536ca8});}},{'verbose':_0x1768d7[_0xb08a43(0x227)]});const _0x1a2e35=await _0x3d471c['journey'][_0xb08a43(0x1fc)](_0x4a1445[0x0][_0xb08a43(0x1f8)]),_0x430fca=buildMergedJourneyDef(_0x5d817e,_0x17dc17,_0x1a2e35),_0x4967d3=normalizeJourneyDef(_0x430fca,_0xf0e909),_0x454863=toYamlString(_0x4967d3),_0x3ab4ed=_0x1680a5||a25_0x51aa01['join'](_0x602045,sanitizeFileName(_0x48fa00)+_0xb08a43(0x1ec));!_0x1680a5&&_0x36d999&&!existsSync(_0x602045)&&mkdirSync(_0x602045,{'recursive':!![]});const _0x4e5a69=a25_0x51aa01['relative'](process[_0xb08a43(0x1cb)](),_0x3ab4ed);if(existsSync(_0x3ab4ed)){const _0x27594a=readFileSync(_0x3ab4ed,_0xb08a43(0x1e4)),_0x4061a4=generateDiff(_0x27594a,_0x454863),_0xf0c61d=hasChanges(_0x4061a4);_0x3b0f8a[_0xb08a43(0x16a)]({'relativePath':_0x4e5a69,'absolutePath':_0x3ab4ed,'content':_0x454863,'isNew':![],'hasChanges':_0xf0c61d,'diff':_0xf0c61d?formatDiffWithColors(_0x4061a4):undefined});}else _0x3b0f8a['push']({'relativePath':_0x4e5a69,'absolutePath':_0x3ab4ed,'content':_0x454863,'isNew':!![],'hasChanges':![]});}const _0x7459a2=_0x3b0f8a['filter'](_0x498020=>_0x498020['isNew']),_0xce0d07=_0x3b0f8a['filter'](_0x38699c=>!_0x38699c['isNew']&&_0x38699c[_0xb08a43(0x1cc)]),_0x3d4d62=_0x3b0f8a['filter'](_0x5d25b7=>!_0x5d25b7[_0xb08a43(0x172)]&&!_0x5d25b7[_0xb08a43(0x1cc)]),_0x88eeaa=_0x21cfb4['length'],_0x4e2bcc=_0x47f3c1[_0xb08a43(0x251)],_0x2500de=_0x88eeaa>_0x4e2bcc?'\x20('+_0x88eeaa+_0xb08a43(0x1fb):'';console[_0xb08a43(0x157)](_0xb08a43(0x24b)),console[_0xb08a43(0x157)]('\x20\x20'+a25_0x38e234[_0xb08a43(0x1e2)](_0x4e2bcc+_0xb08a43(0x1e6))+a25_0x38e234['dim'](_0x2500de)),console[_0xb08a43(0x157)]('\x20\x20'+a25_0x38e234[_0xb08a43(0x1d0)]('+\x20'+_0x7459a2[_0xb08a43(0x18a)]+_0xb08a43(0x188))),console[_0xb08a43(0x157)]('\x20\x20'+a25_0x38e234[_0xb08a43(0x1db)]('~\x20'+_0xce0d07[_0xb08a43(0x18a)]+_0xb08a43(0x23f))),console['error']('\x20\x20'+a25_0x38e234[_0xb08a43(0x17a)]('=\x20'+_0x3d4d62['length']+_0xb08a43(0x196))),console['error'](_0xb08a43(0x220)+a25_0x38e234[_0xb08a43(0x1e2)](_0xcb962e)+'\x0a');if(_0xce0d07['length']>0x0)for(const _0x482799 of _0xce0d07){console[_0xb08a43(0x157)](_0xb08a43(0x170)+_0x482799[_0xb08a43(0x1fd)]+'\x27:'),console[_0xb08a43(0x157)]('─'[_0xb08a43(0x265)](0x3c)),console[_0xb08a43(0x157)](_0x482799[_0xb08a43(0x1c1)]),console[_0xb08a43(0x157)]('─'['repeat'](0x3c));}if(_0x44c259[_0xb08a43(0x207)])return console['error'](a25_0x38e234['yellow'](_0xb08a43(0x1c9))),0x0;if(_0x7459a2[_0xb08a43(0x18a)]===0x0&&_0xce0d07[_0xb08a43(0x18a)]===0x0)return console['error'](a25_0x38e234[_0xb08a43(0x1d0)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x59818f},_0x44c259[_0xb08a43(0x154)]),console['error'](a25_0x38e234[_0xb08a43(0x1d0)](_0xb08a43(0x18f)+a25_0x38e234[_0xb08a43(0x17a)]('parent_segment')+_0xb08a43(0x19c)+a25_0x38e234[_0xb08a43(0x1e2)](_0x59818f))),0x0;if(!_0x44c259[_0xb08a43(0x23e)]&&(_0x7459a2['length']>0x0||_0xce0d07[_0xb08a43(0x18a)]>0x0)){if(!isInteractive())return console['error'](a25_0x38e234[_0xb08a43(0x1ea)]('\x0aError:'),_0xb08a43(0x1f4)),console[_0xb08a43(0x157)](a25_0x38e234['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x464844=await confirmKey(_0xb08a43(0x1d1)+(_0x7459a2[_0xb08a43(0x18a)]+_0xce0d07[_0xb08a43(0x18a)])+_0xb08a43(0x232));if(!_0x464844)return console[_0xb08a43(0x157)](a25_0x38e234['yellow']('Aborted.'),_0xb08a43(0x24a)),0x1;}!existsSync(_0xcb962e)&&mkdirSync(_0xcb962e,{'recursive':!![]});const _0x162856=a25_0x51aa01[_0xb08a43(0x204)](_0xcb962e,'tdx.json');writeFileSync(_0x162856,createTdxConfigContent(_0x59818f),_0xb08a43(0x1e4));for(const _0xee4cfc of _0x3b0f8a){(_0xee4cfc[_0xb08a43(0x172)]||_0xee4cfc[_0xb08a43(0x1cc)])&&writeFileSync(_0xee4cfc[_0xb08a43(0x222)],_0xee4cfc[_0xb08a43(0x1df)],_0xb08a43(0x1e4));}return console[_0xb08a43(0x157)](a25_0x38e234[_0xb08a43(0x1d0)](_0xb08a43(0x25b)+(_0x7459a2[_0xb08a43(0x18a)]+_0xce0d07[_0xb08a43(0x18a)])+_0xb08a43(0x1cd)+_0xcb962e)),saveSessionContext({'parent_segment':_0x59818f},_0x44c259[_0xb08a43(0x154)]),console[_0xb08a43(0x157)](a25_0x38e234[_0xb08a43(0x1d0)](_0xb08a43(0x18f)+a25_0x38e234[_0xb08a43(0x17a)](_0xb08a43(0x171))+_0xb08a43(0x19c)+a25_0x38e234[_0xb08a43(0x1e2)](_0x59818f))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x1e0);[a25_0x50e1e5(0x1e3)]=a25_0x50e1e5(0x244);async[a25_0x50e1e5(0x192)](_0x2a8417){const _0x5daf1a=a25_0x50e1e5,{options:_0x220cbf,args:_0x727b08,tdx:_0x27b12e}=_0x2a8417,_0x4fc041=_0x727b08[0x0];if(!requireNameOrPath(_0x4fc041))return 0x1;_0x220cbf[_0x5daf1a(0x227)]&&console[_0x5daf1a(0x157)](_0x5daf1a(0x153)+_0x4fc041);const {journeyId:_0x1b71f5}=await resolveJourneyIdFromInput(_0x4fc041,_0x220cbf,_0x27b12e),_0x3d5a40=await withSpinner(_0x5daf1a(0x22a),()=>_0x27b12e[_0x5daf1a(0x20f)][_0x5daf1a(0x216)](_0x1b71f5),{'verbose':_0x220cbf[_0x5daf1a(0x227)]}),_0x10c11a=_0x3d5a40[_0x5daf1a(0x174)];return console['log']('Database:\x20'+_0x10c11a[_0x5daf1a(0x1ae)]),console['log'](_0x5daf1a(0x21a)+_0x10c11a['table']),await handleSDKOutput(_0x10c11a[_0x5daf1a(0x1ff)],_0x220cbf),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x206);[a25_0x50e1e5(0x1e3)]=a25_0x50e1e5(0x252);async[a25_0x50e1e5(0x192)](_0x5e8497){const _0x399625=a25_0x50e1e5,{options:_0x2e3e32,args:_0x3810b2,tdx:_0x5e0d7c}=_0x5e8497,_0x2f3f48=_0x3810b2[0x0];if(!requireNameOrPath(_0x2f3f48))return 0x1;_0x2e3e32[_0x399625(0x227)]&&console['error'](_0x399625(0x153)+_0x2f3f48);const {journeyId:_0x5e56dd}=await resolveJourneyIdFromInput(_0x2f3f48,_0x2e3e32,_0x5e0d7c),_0x446238=await withSpinner(_0x399625(0x1ce),()=>_0x5e0d7c[_0x399625(0x20f)]['listActivationsFlat'](_0x5e56dd),{'verbose':_0x2e3e32[_0x399625(0x227)]}),_0x15b10c=_0x446238[_0x399625(0x174)];return console[_0x399625(0x157)]('Found\x20'+_0x15b10c[_0x399625(0x18a)]+'\x20activation'+(_0x15b10c[_0x399625(0x18a)]!==0x1?'s':'')),await handleSDKOutput(_0x15b10c,_0x2e3e32),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a25_0x50e1e5(0x1ad);[a25_0x50e1e5(0x1e3)]=a25_0x50e1e5(0x1a6);[a25_0x50e1e5(0x254)]=new SegmentPushCommand();async[a25_0x50e1e5(0x192)](_0x13d5ae){const _0x39d294=a25_0x50e1e5,_0x27847b=_0x13d5ae[_0x39d294(0x1f6)][0x0];let _0x3e054c;if(_0x27847b){const _0x541f48=await resolveTarget({'arg':_0x27847b,'contextParent':_0x13d5ae[_0x39d294(0x19e)][_0x39d294(0x1e8)],'cwd':process['cwd']()});isSuccessfulResolution(_0x541f48)&&_0x541f48[_0x39d294(0x1da)]===_0x39d294(0x15d)&&(_0x3e054c=_0x541f48[_0x39d294(0x20c)]);}const _0x14705b={..._0x13d5ae,'options':{..._0x13d5ae[_0x39d294(0x19e)],'journeysOnly':!![],..._0x3e054c&&{'singleFilePath':_0x3e054c}}};return this['segmentPushCommand'][_0x39d294(0x192)](_0x14705b);}}export class JourneyVersionsCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x1ca);[a25_0x50e1e5(0x1e3)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a25_0x50e1e5(0x192)](_0x27a6a4){const _0x5e3401=a25_0x50e1e5,{options:_0x5d8b4a,args:_0x3540a3,tdx:_0x2ae612}=_0x27a6a4,_0x585b23=_0x3540a3[0x0];if(!requireNameOrPath(_0x585b23))return 0x1;if(_0x5d8b4a['verbose'])console[_0x5e3401(0x157)](_0x5e3401(0x153)+_0x585b23);const {journeyId:_0x1eec9b}=await resolveJourneyIdFromInput(_0x585b23,_0x5d8b4a,_0x2ae612),_0x4e3066=await withSpinner(_0x5e3401(0x163),()=>_0x2ae612[_0x5e3401(0x20f)][_0x5e3401(0x23b)](_0x1eec9b),{'verbose':_0x5d8b4a[_0x5e3401(0x227)]}),{bundleName:_0x4d7862,versions:_0x16b673,latestJourneyId:_0x19195b}=_0x4e3066[_0x5e3401(0x174)];console['error'](_0x4d7862+':\x20'+_0x16b673[_0x5e3401(0x18a)]+_0x5e3401(0x1a4)+(_0x16b673[_0x5e3401(0x18a)]!==0x1?'s':''));const _0x4bd77f=_0x16b673[_0x5e3401(0x16b)](_0x513656=>({'version':_0x513656['versionNumber'],'journey_id':_0x513656[_0x5e3401(0x1d7)],'name':_0x513656[_0x5e3401(0x17d)],'state':_0x513656[_0x5e3401(0x214)],'paused':_0x513656[_0x5e3401(0x1b5)],'latest':_0x513656[_0x5e3401(0x1d7)]===_0x19195b,'created_at':_0x513656['createdAt']}));return await handleSDKOutput(_0x4bd77f,_0x5d8b4a),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a25_0x50e1e5(0x193);[a25_0x50e1e5(0x1e3)]=a25_0x50e1e5(0x212);async[a25_0x50e1e5(0x192)](_0x41818e){const _0x56b1e2=a25_0x50e1e5,{options:_0x596328,args:_0x30cd00,tdx:_0x1c37e2}=_0x41818e,_0x3466e0=_0x30cd00[0x0];if(!requireNameOrPath(_0x3466e0))return 0x1;if(_0x596328['verbose'])console['error']('Input:\x20'+_0x3466e0);const {journeyId:_0x4deb28,journeyName:_0x5bef84}=await resolveJourneyIdFromInput(_0x3466e0,_0x596328,_0x1c37e2);if(!_0x596328[_0x56b1e2(0x23e)]){const _0x166633=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x5bef84+'\x22?');if(!_0x166633)return console[_0x56b1e2(0x157)]('Cancelled'),0x0;}const _0x548692=await withSpinner('Creating\x20new\x20version...',()=>_0x1c37e2[_0x56b1e2(0x20f)][_0x56b1e2(0x242)](_0x4deb28),{'verbose':_0x596328[_0x56b1e2(0x227)]}),_0x31d60d=_0x548692[_0x56b1e2(0x174)];return console['error'](a25_0x38e234['green']('✔')+_0x56b1e2(0x177)+_0x31d60d[_0x56b1e2(0x248)]['versionNumber']+_0x56b1e2(0x24f)+_0x31d60d[_0x56b1e2(0x248)][_0x56b1e2(0x17d)]+'\x22'),console[_0x56b1e2(0x157)]('\x20\x20Journey\x20ID:\x20'+_0x31d60d['id']),await handleSingleObjectOutput({'id':_0x31d60d['id'],'name':_0x31d60d[_0x56b1e2(0x248)][_0x56b1e2(0x17d)],'version':_0x31d60d[_0x56b1e2(0x248)][_0x56b1e2(0x1ed)],'state':_0x31d60d[_0x56b1e2(0x248)]['state'],'bundle_id':_0x31d60d[_0x56b1e2(0x248)][_0x56b1e2(0x1f8)],'created_at':_0x31d60d[_0x56b1e2(0x248)][_0x56b1e2(0x21b)]},_0x596328),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a25_0x50e1e5(0x17d)]=a25_0x50e1e5(0x1f5);[a25_0x50e1e5(0x1e3)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a25_0x50e1e5(0x192)](_0x466534){const _0x33a9c4=a25_0x50e1e5,{options:_0x62a375,args:_0x3c9790,tdx:_0x2bfd6f}=_0x466534,_0x17e3e3=_0x3c9790[0x0];if(!requireNameOrPath(_0x17e3e3))return 0x1;const _0x36a348=_0x62a375[_0x33a9c4(0x18d)];if(!_0x36a348)return console[_0x33a9c4(0x157)]('Error:\x20--version\x20option\x20is\x20required'),console['error'](_0x33a9c4(0x235)),0x1;const _0x321b97=parseInt(_0x36a348,0xa);if(isNaN(_0x321b97)||_0x321b97<0x1)return console[_0x33a9c4(0x157)](_0x33a9c4(0x1de)+_0x36a348),0x1;if(_0x62a375[_0x33a9c4(0x227)])console[_0x33a9c4(0x157)](_0x33a9c4(0x153)+_0x17e3e3+',\x20version:\x20'+_0x321b97);const {journeyId:_0x49787a,parentSegmentId:_0x1752a2}=await resolveJourneyIdFromInput(_0x17e3e3,_0x62a375,_0x2bfd6f),_0x121668=await withSpinner('Resolving\x20version...',()=>_0x2bfd6f[_0x33a9c4(0x20f)]['listVersions'](_0x49787a),{'verbose':_0x62a375[_0x33a9c4(0x227)]}),{versions:_0x2521f8,latestJourneyId:_0xbfe944}=_0x121668[_0x33a9c4(0x174)],_0xb3e84f=_0x2521f8['find'](_0x1cbcb4=>_0x1cbcb4[_0x33a9c4(0x1ed)]===_0x321b97);if(!_0xb3e84f){const _0x3532ad=_0x2521f8[_0x33a9c4(0x16b)](_0x320603=>'v'+_0x320603[_0x33a9c4(0x1ed)])[_0x33a9c4(0x204)](',\x20');return console[_0x33a9c4(0x157)](_0x33a9c4(0x20d)+_0x321b97+_0x33a9c4(0x17e)+_0x3532ad),0x1;}const _0x1deb5f=await withSpinner('Getting\x20version\x20'+_0x321b97+'\x20details...',()=>_0x2bfd6f[_0x33a9c4(0x20f)][_0x33a9c4(0x221)](_0xb3e84f['journeyId']),{'verbose':_0x62a375[_0x33a9c4(0x227)]}),_0x4b2dc1=_0x1deb5f[_0x33a9c4(0x174)],_0x535467=getConsoleNextUrl(_0x62a375['site'],'/app/ps/'+_0x1752a2+'/e/'+_0xb3e84f[_0x33a9c4(0x1d7)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x4b2dc1['id'],'name':_0x4b2dc1[_0x33a9c4(0x248)]['name'],'version':_0x4b2dc1['attributes'][_0x33a9c4(0x1ed)],'description':_0x4b2dc1[_0x33a9c4(0x248)][_0x33a9c4(0x1e3)],'state':_0x4b2dc1[_0x33a9c4(0x248)][_0x33a9c4(0x214)],'paused':_0x4b2dc1[_0x33a9c4(0x248)][_0x33a9c4(0x1b5)],'reentry_mode':_0x4b2dc1[_0x33a9c4(0x248)][_0x33a9c4(0x200)],'stages':_0x4b2dc1[_0x33a9c4(0x248)]['journeyStages']?.[_0x33a9c4(0x18a)]||0x0,..._0x4b2dc1['attributes'][_0x33a9c4(0x181)]&&{'goal':_0x4b2dc1[_0x33a9c4(0x248)]['goal']['name']},'latest':_0xb3e84f[_0x33a9c4(0x1d7)]===_0xbfe944,'created_at':_0x4b2dc1[_0x33a9c4(0x248)]['createdAt'],'updated_at':_0x4b2dc1['attributes']['updatedAt'],'url':_0x535467},_0x62a375),0x0;}}