@treasuredata/tdx 0.8.9 → 0.8.11

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 (134) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.d.ts +19 -1
  6. package/dist/client/cdp-api-client.d.ts.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/cdp-api-client.js.map +1 -1
  9. package/dist/client/engage-api-client.js +1 -1
  10. package/dist/client/http-client.js +1 -1
  11. package/dist/client/llm-api-client.js +1 -1
  12. package/dist/client/rate-limiter.js +1 -1
  13. package/dist/client/td-api-client.js +1 -1
  14. package/dist/client/trino-api-client.js +1 -1
  15. package/dist/client/workflow-client.js +1 -1
  16. package/dist/commands/activations.js +1 -1
  17. package/dist/commands/api-command.js +1 -1
  18. package/dist/commands/auth-command.js +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/connection-command.js +1 -1
  25. package/dist/commands/context-command.js +1 -1
  26. package/dist/commands/databases.js +1 -1
  27. package/dist/commands/describe.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.d.ts.map +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-push-command.js.map +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/use-command.js +1 -1
  49. package/dist/commands/user-command.js +1 -1
  50. package/dist/commands/workflow-command.js +1 -1
  51. package/dist/core/auth.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/claude-usage-tracker.js +1 -1
  64. package/dist/proxy/context-signature.js +1 -1
  65. package/dist/proxy/conversation-utils.js +1 -1
  66. package/dist/proxy/server.js +1 -1
  67. package/dist/proxy/session-cache.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/connection.js +1 -1
  70. package/dist/sdk/engage.js +1 -1
  71. package/dist/sdk/errors.js +1 -1
  72. package/dist/sdk/index.js +1 -1
  73. package/dist/sdk/job.js +1 -1
  74. package/dist/sdk/journey.d.ts +15 -1
  75. package/dist/sdk/journey.d.ts.map +1 -1
  76. package/dist/sdk/journey.js +1 -1
  77. package/dist/sdk/journey.js.map +1 -1
  78. package/dist/sdk/llm.js +1 -1
  79. package/dist/sdk/query.js +1 -1
  80. package/dist/sdk/segment/child-segment-yaml.d.ts +4 -0
  81. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  82. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  83. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  84. package/dist/sdk/segment/journey-yaml.d.ts +11 -0
  85. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  86. package/dist/sdk/segment/journey-yaml.js +1 -1
  87. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  88. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  89. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  90. package/dist/sdk/segment.d.ts +15 -1
  91. package/dist/sdk/segment.d.ts.map +1 -1
  92. package/dist/sdk/segment.js +1 -1
  93. package/dist/sdk/segment.js.map +1 -1
  94. package/dist/sdk/user.js +1 -1
  95. package/dist/sdk/workflow.js +1 -1
  96. package/dist/types/cdp.d.ts +67 -0
  97. package/dist/types/cdp.d.ts.map +1 -1
  98. package/dist/types/endpoints.js +1 -1
  99. package/dist/types/index.d.ts +1 -1
  100. package/dist/types/index.d.ts.map +1 -1
  101. package/dist/types/index.js +1 -1
  102. package/dist/utils/agent-ref-parser.js +1 -1
  103. package/dist/utils/async.js +1 -1
  104. package/dist/utils/chat-cache.js +1 -1
  105. package/dist/utils/colors.js +1 -1
  106. package/dist/utils/command-output.js +1 -1
  107. package/dist/utils/constants.js +1 -1
  108. package/dist/utils/diff.js +1 -1
  109. package/dist/utils/fields-display.js +1 -1
  110. package/dist/utils/file-permissions.js +1 -1
  111. package/dist/utils/format-detector.js +1 -1
  112. package/dist/utils/formatters.js +1 -1
  113. package/dist/utils/journey-utils.js +1 -1
  114. package/dist/utils/json-loader.js +1 -1
  115. package/dist/utils/llm-backup-utils.js +1 -1
  116. package/dist/utils/model-aliases.js +1 -1
  117. package/dist/utils/model-factors.js +1 -1
  118. package/dist/utils/option-validation.js +1 -1
  119. package/dist/utils/port.js +1 -1
  120. package/dist/utils/process.js +1 -1
  121. package/dist/utils/prompt.js +1 -1
  122. package/dist/utils/segment-path-parser.js +1 -1
  123. package/dist/utils/segment-ref-parser.js +1 -1
  124. package/dist/utils/spinner.js +1 -1
  125. package/dist/utils/sql-parser.js +1 -1
  126. package/dist/utils/sse-parser.js +1 -1
  127. package/dist/utils/string-utils.js +1 -1
  128. package/dist/utils/table-ref-parser.js +1 -1
  129. package/dist/utils/tdx-config.js +1 -1
  130. package/dist/utils/tdx-logger.js +1 -1
  131. package/dist/utils/tree-formatter.js +1 -1
  132. package/dist/utils/version-check.js +1 -1
  133. package/dist/utils/workflow-utils.js +1 -1
  134. package/package.json +1 -1
@@ -1 +1 @@
1
- const a18_0x45c824=a18_0x57fb;(function(_0x53d1e4,_0x40c8b1){const _0xd88a62=a18_0x57fb,_0xa99427=_0x53d1e4();while(!![]){try{const _0x5061ea=-parseInt(_0xd88a62(0x18b))/0x1+parseInt(_0xd88a62(0x1a1))/0x2+-parseInt(_0xd88a62(0x1ab))/0x3*(parseInt(_0xd88a62(0x18c))/0x4)+parseInt(_0xd88a62(0x1a9))/0x5+parseInt(_0xd88a62(0x1a0))/0x6+-parseInt(_0xd88a62(0x19f))/0x7+-parseInt(_0xd88a62(0x190))/0x8;if(_0x5061ea===_0x40c8b1)break;else _0xa99427['push'](_0xa99427['shift']());}catch(_0x41e73f){_0xa99427['push'](_0xa99427['shift']());}}}(a18_0x4ab6,0x2c057));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x60a2e8 from'chalk';function a18_0x57fb(_0x14c9cf,_0x5dae12){_0x14c9cf=_0x14c9cf-0x183;const _0x4ab6ab=a18_0x4ab6();let _0x57fb87=_0x4ab6ab[_0x14c9cf];return _0x57fb87;}export function printAuthError(_0x29eb51,_0x40350e=![],_0x321b90){const _0x4785a2=a18_0x57fb,_0xb1c8cd=_0x29eb51['problemDetails']?.[_0x4785a2(0x1a2)]||_0x29eb51[_0x4785a2(0x186)];console[_0x4785a2(0x183)](a18_0x60a2e8['red'](_0x4785a2(0x184))),console['error'](a18_0x60a2e8[_0x4785a2(0x185)](_0x4785a2(0x189)+_0xb1c8cd));if(_0x40350e){const _0x3bb2e2=_0x321b90?_0x4785a2(0x19c)+_0x321b90:'';console[_0x4785a2(0x183)](_0x4785a2(0x197)),console['error'](_0x4785a2(0x192)+_0x3bb2e2+'\x0a'),console[_0x4785a2(0x183)](_0x4785a2(0x198)),console['error']('\x20\x20tdx\x20auth'+_0x3bb2e2);}}export class BaseCommand{[a18_0x45c824(0x1a5)](_0x520944){const _0x5ea5e3=a18_0x45c824,{options:_0x4bdec6}=_0x520944,_0x237263=_0x4bdec6[_0x5ea5e3(0x195)];if(_0x237263!==undefined){const _0x34b56f=typeof _0x237263===_0x5ea5e3(0x188)?_0x237263:parseInt(_0x237263,0xa);if(isNaN(_0x34b56f))return _0x5ea5e3(0x1aa)+_0x237263+'.\x20Must\x20be\x20a\x20number.';const _0x5d9d29=validateLimitOption(_0x34b56f);if(!_0x5d9d29['isValid'])return _0x5d9d29['error'];_0x520944['options'][_0x5ea5e3(0x195)]=_0x5d9d29['value'];}return undefined;}[a18_0x45c824(0x19b)](_0x5f183f){return undefined;}async[a18_0x45c824(0x18a)](_0x80d2a8){const _0xa750f=a18_0x45c824;try{const _0x2fe838=this[_0xa750f(0x1a5)](_0x80d2a8);if(_0x2fe838)return console[_0xa750f(0x183)](_0xa750f(0x1a7)+_0x2fe838),0x1;const _0xc61d06=this['validate'](_0x80d2a8);if(_0xc61d06){const _0xb000ae=/^\s*(Usage|Note|Warning|Error):/i['test'](_0xc61d06);return _0xb000ae?console['error'](_0xc61d06):console[_0xa750f(0x183)](_0xa750f(0x1a7)+_0xc61d06),0x1;}const _0x5eef11=await this[_0xa750f(0x18d)](_0x80d2a8);return _0x5eef11??0x0;}catch(_0x421eed){if(_0x421eed instanceof Error){if(_0x421eed instanceof HTTPClientError&&_0x421eed[_0xa750f(0x18f)]===0x191){const _0x134739=_0x80d2a8['options'][_0xa750f(0x1a4)];return printAuthError(_0x421eed,!![],_0x134739),_0x421eed['stack']&&_0x80d2a8[_0xa750f(0x19d)]&&(_0x80d2a8[_0xa750f(0x19d)][_0xa750f(0x19a)][_0xa750f(0x18e)]('Authentication\x20error\x20stack\x20trace:'),_0x80d2a8[_0xa750f(0x19d)]['logger']['debug'](_0x421eed[_0xa750f(0x1a8)])),0x1;}console[_0xa750f(0x183)](a18_0x60a2e8['red'](_0xa750f(0x1a7)+_0x421eed[_0xa750f(0x186)]));_0x421eed instanceof SDKError&&_0x421eed[_0xa750f(0x19e)]&&console['error'](a18_0x60a2e8['yellow'](_0x421eed['helpText']));const _0x348218=_0x421eed instanceof SDKError&&_0x421eed['category']===ErrorCategory['USER_ERROR'];_0x421eed[_0xa750f(0x1a8)]&&!_0x348218&&console[_0xa750f(0x183)]('\x0aStack\x20trace:\x0a'+_0x421eed[_0xa750f(0x1a8)]);}else console['error'](_0xa750f(0x1a7)+String(_0x421eed));return 0x1;}}}export class CommandRegistry{['commands']=new Map();[a18_0x45c824(0x1ac)](_0x4e42a9){const _0x5f42a7=a18_0x45c824;if(this[_0x5f42a7(0x199)][_0x5f42a7(0x1a3)](_0x4e42a9[_0x5f42a7(0x187)]))throw new Error(_0x5f42a7(0x196)+_0x4e42a9['name']+_0x5f42a7(0x193));this[_0x5f42a7(0x199)]['set'](_0x4e42a9[_0x5f42a7(0x187)],_0x4e42a9);}[a18_0x45c824(0x191)](_0x4a1d63){const _0x3cc604=a18_0x45c824;return this[_0x3cc604(0x199)][_0x3cc604(0x191)](_0x4a1d63);}['getAll'](){const _0x57a195=a18_0x45c824;return Array[_0x57a195(0x1a6)](this[_0x57a195(0x199)][_0x57a195(0x194)]());}[a18_0x45c824(0x1a3)](_0x448dab){const _0x2f4521=a18_0x45c824;return this[_0x2f4521(0x199)][_0x2f4521(0x1a3)](_0x448dab);}}function a18_0x4ab6(){const _0xea0039=['Reason:\x20','run','131525lbzRuO','11384nfuBRL','execute','debug','status','329624UMCQnh','get','\x20\x20tdx\x20auth\x20setup','\x27\x20is\x20already\x20registered','values','limit','Command\x20\x27','\x0aTo\x20set\x20up\x20authentication:','To\x20check\x20your\x20current\x20auth\x20status:','commands','logger','validate','\x20--profile\x20','tdx','helpText','365757wwTjOa','1454124HLnxvf','4812ycvcRZ','detail','has','profile','validateGlobalOptions','from','Error:\x20','stack','1528380RJLWcG','Invalid\x20limit\x20value:\x20','153sGPnPl','register','error','Authentication\x20failed','red','message','name','number'];a18_0x4ab6=function(){return _0xea0039;};return a18_0x4ab6();}export const registry=new CommandRegistry();
1
+ const a18_0x436ed6=a18_0x1cc0;(function(_0x5a065c,_0x5232bc){const _0x5a5548=a18_0x1cc0,_0x1c1d3a=_0x5a065c();while(!![]){try{const _0x580dd0=parseInt(_0x5a5548(0x1b1))/0x1*(-parseInt(_0x5a5548(0x1c2))/0x2)+parseInt(_0x5a5548(0x1b8))/0x3+-parseInt(_0x5a5548(0x1c1))/0x4*(-parseInt(_0x5a5548(0x1cc))/0x5)+parseInt(_0x5a5548(0x1d4))/0x6+-parseInt(_0x5a5548(0x1c4))/0x7+parseInt(_0x5a5548(0x1d2))/0x8*(parseInt(_0x5a5548(0x1ae))/0x9)+-parseInt(_0x5a5548(0x1bd))/0xa;if(_0x580dd0===_0x5232bc)break;else _0x1c1d3a['push'](_0x1c1d3a['shift']());}catch(_0xe7e2d7){_0x1c1d3a['push'](_0x1c1d3a['shift']());}}}(a18_0x5d90,0xbe810));import{validateLimitOption}from'../utils/option-validation.js';function a18_0x5d90(){const _0x5c0717=['174792arEigk','\x0aTo\x20set\x20up\x20authentication:','6273192EqLhRu','error','values','options','tdx','isValid','test','profile','Authentication\x20error\x20stack\x20trace:','has','limit','207SmeGyM','\x27\x20is\x20already\x20registered','detail','1DuROwV','Invalid\x20limit\x20value:\x20','validateGlobalOptions','number','commands','debug','USER_ERROR','63213vERkQR','get','.\x20Must\x20be\x20a\x20number.','red','helpText','3982890evhuYS','run','Error:\x20','Authentication\x20failed','276YnQPtU','1860682kqIoAi','message','3640735TvmfAt','\x20--profile\x20','\x20\x20tdx\x20auth\x20setup','name','execute','set','validate','value','76805uVaLNx','getAll','from','problemDetails','logger','category'];a18_0x5d90=function(){return _0x5c0717;};return a18_0x5d90();}function a18_0x1cc0(_0x1fcd53,_0x37568f){_0x1fcd53=_0x1fcd53-0x1a9;const _0x5d90fa=a18_0x5d90();let _0x1cc03c=_0x5d90fa[_0x1fcd53];return _0x1cc03c;}import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x1d85be from'chalk';export function printAuthError(_0x305d2,_0x337362=![],_0x5a710b){const _0xdde4e1=a18_0x1cc0,_0x212f9b=_0x305d2[_0xdde4e1(0x1cf)]?.[_0xdde4e1(0x1b0)]||_0x305d2[_0xdde4e1(0x1c3)];console[_0xdde4e1(0x1d5)](a18_0x1d85be[_0xdde4e1(0x1bb)](_0xdde4e1(0x1c0))),console[_0xdde4e1(0x1d5)](a18_0x1d85be[_0xdde4e1(0x1bb)]('Reason:\x20'+_0x212f9b));if(_0x337362){const _0x38c257=_0x5a710b?_0xdde4e1(0x1c5)+_0x5a710b:'';console[_0xdde4e1(0x1d5)](_0xdde4e1(0x1d3)),console[_0xdde4e1(0x1d5)](_0xdde4e1(0x1c6)+_0x38c257+'\x0a'),console[_0xdde4e1(0x1d5)]('To\x20check\x20your\x20current\x20auth\x20status:'),console[_0xdde4e1(0x1d5)]('\x20\x20tdx\x20auth'+_0x38c257);}}export class BaseCommand{[a18_0x436ed6(0x1b3)](_0x45e08a){const _0x4627f1=a18_0x436ed6,{options:_0x5864da}=_0x45e08a,_0x37a38f=_0x5864da[_0x4627f1(0x1ad)];if(_0x37a38f!==undefined){const _0x35cea5=typeof _0x37a38f===_0x4627f1(0x1b4)?_0x37a38f:parseInt(_0x37a38f,0xa);if(isNaN(_0x35cea5))return _0x4627f1(0x1b2)+_0x37a38f+_0x4627f1(0x1ba);const _0x159c4b=validateLimitOption(_0x35cea5);if(!_0x159c4b[_0x4627f1(0x1d9)])return _0x159c4b['error'];_0x45e08a[_0x4627f1(0x1d7)][_0x4627f1(0x1ad)]=_0x159c4b[_0x4627f1(0x1cb)];}return undefined;}['validate'](_0x4d0cd0){return undefined;}async[a18_0x436ed6(0x1be)](_0x40151f){const _0x42632c=a18_0x436ed6;try{const _0x100a43=this[_0x42632c(0x1b3)](_0x40151f);if(_0x100a43)return console[_0x42632c(0x1d5)]('Error:\x20'+_0x100a43),0x1;const _0x38d93d=this[_0x42632c(0x1ca)](_0x40151f);if(_0x38d93d){const _0x32176d=/^\s*(Usage|Note|Warning|Error):/i[_0x42632c(0x1a9)](_0x38d93d);return _0x32176d?console[_0x42632c(0x1d5)](_0x38d93d):console[_0x42632c(0x1d5)](_0x42632c(0x1bf)+_0x38d93d),0x1;}const _0x2b2e60=await this[_0x42632c(0x1c8)](_0x40151f);return _0x2b2e60??0x0;}catch(_0x44654b){if(_0x44654b instanceof Error){if(_0x44654b instanceof HTTPClientError&&_0x44654b['status']===0x191){const _0x1ce233=_0x40151f['options'][_0x42632c(0x1aa)];return printAuthError(_0x44654b,!![],_0x1ce233),_0x44654b['stack']&&_0x40151f[_0x42632c(0x1d8)]&&(_0x40151f[_0x42632c(0x1d8)]['logger'][_0x42632c(0x1b6)](_0x42632c(0x1ab)),_0x40151f[_0x42632c(0x1d8)][_0x42632c(0x1d0)]['debug'](_0x44654b['stack'])),0x1;}console[_0x42632c(0x1d5)](a18_0x1d85be[_0x42632c(0x1bb)]('Error:\x20'+_0x44654b[_0x42632c(0x1c3)]));_0x44654b instanceof SDKError&&_0x44654b['helpText']&&console[_0x42632c(0x1d5)](a18_0x1d85be['yellow'](_0x44654b[_0x42632c(0x1bc)]));const _0x556704=_0x44654b instanceof SDKError&&_0x44654b[_0x42632c(0x1d1)]===ErrorCategory[_0x42632c(0x1b7)];_0x44654b['stack']&&!_0x556704&&console[_0x42632c(0x1d5)]('\x0aStack\x20trace:\x0a'+_0x44654b['stack']);}else console[_0x42632c(0x1d5)]('Error:\x20'+String(_0x44654b));return 0x1;}}}export class CommandRegistry{[a18_0x436ed6(0x1b5)]=new Map();['register'](_0x2bf04b){const _0x4e58a9=a18_0x436ed6;if(this[_0x4e58a9(0x1b5)][_0x4e58a9(0x1ac)](_0x2bf04b[_0x4e58a9(0x1c7)]))throw new Error('Command\x20\x27'+_0x2bf04b[_0x4e58a9(0x1c7)]+_0x4e58a9(0x1af));this[_0x4e58a9(0x1b5)][_0x4e58a9(0x1c9)](_0x2bf04b['name'],_0x2bf04b);}[a18_0x436ed6(0x1b9)](_0x37e86c){const _0xd76147=a18_0x436ed6;return this[_0xd76147(0x1b5)][_0xd76147(0x1b9)](_0x37e86c);}[a18_0x436ed6(0x1cd)](){const _0x532af9=a18_0x436ed6;return Array[_0x532af9(0x1ce)](this[_0x532af9(0x1b5)][_0x532af9(0x1d6)]());}[a18_0x436ed6(0x1ac)](_0x32c39c){const _0x206ea3=a18_0x436ed6;return this[_0x206ea3(0x1b5)][_0x206ea3(0x1ac)](_0x32c39c);}}export const registry=new CommandRegistry();
@@ -1 +1 @@
1
- const a19_0x4ad2ff=a19_0x1ce6;(function(_0x2f3550,_0x1af4c1){const _0x19a3c4=a19_0x1ce6,_0xd5f557=_0x2f3550();while(!![]){try{const _0x42bf53=parseInt(_0x19a3c4(0xb2))/0x1+parseInt(_0x19a3c4(0xb1))/0x2+-parseInt(_0x19a3c4(0x96))/0x3+-parseInt(_0x19a3c4(0x9e))/0x4+parseInt(_0x19a3c4(0xbc))/0x5*(parseInt(_0x19a3c4(0x98))/0x6)+parseInt(_0x19a3c4(0x9f))/0x7*(parseInt(_0x19a3c4(0xb8))/0x8)+parseInt(_0x19a3c4(0xb9))/0x9*(-parseInt(_0x19a3c4(0xc1))/0xa);if(_0x42bf53===_0x1af4c1)break;else _0xd5f557['push'](_0xd5f557['shift']());}catch(_0x44bdec){_0xd5f557['push'](_0xd5f557['shift']());}}}(a19_0x4131,0xdaf34));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../utils/command-output.js';function a19_0x4131(){const _0xb42d8=['max','\x27...','length','cyan','verbose','3403696nUdAdj','14lHAyKy','limit','\x20connection','owner','name','Fetching\x20connection\x20\x27','map','Looking\x20up\x20connection:\x20','\x20-\x20','Site:\x20','Show\x20connection\x20details','Listing\x20connections...','push','connection:list','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','data','join','table','2274356xasdsW','832054oVMqFv','description','site','type','padStart','connection','6483320spFFdc','172620coEplx','List\x20all\x20result\x20output\x20connections','resolve','2495gqdPzK','error','connection:show','validate','execute','1000ulyiJu','1891209ctFlVj','output','8490zViLQj'];a19_0x4131=function(){return _0xb42d8;};return a19_0x4131();}function a19_0x1ce6(_0x137ffc,_0x5da522){_0x137ffc=_0x137ffc-0x96;const _0x41316f=a19_0x4131();let _0x1ce6e6=_0x41316f[_0x137ffc];return _0x1ce6e6;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import a19_0x249db0 from'chalk';export class ConnectionListCommand extends BaseCommand{[a19_0x4ad2ff(0xa3)]=a19_0x4ad2ff(0xac);[a19_0x4ad2ff(0xb3)]=a19_0x4ad2ff(0xba);async[a19_0x4ad2ff(0xc0)](_0x51c6fe){const _0x3388dd=a19_0x4ad2ff,{options:_0x21591e,tdx:_0xa18f87}=_0x51c6fe;_0x21591e[_0x3388dd(0x9d)]&&console['error'](_0x3388dd(0xa8)+_0x21591e[_0x3388dd(0xb4)]);const _0x15b66b=resolveLimit(_0x21591e[_0x3388dd(0xa0)],DEFAULT_LISTING_LIMIT),_0x8727a9=await withSpinner(_0x3388dd(0xaa),()=>_0xa18f87[_0x3388dd(0xb7)]['list'](),{'verbose':_0x21591e['verbose']}),_0xfa40f8=_0x8727a9[_0x3388dd(0xae)];console[_0x3388dd(0xbd)]('✔\x20Found\x20'+_0xfa40f8['length']+_0x3388dd(0xa1)+(_0xfa40f8[_0x3388dd(0x9b)]!==0x1?'s':''));if(isStructuredFormat(_0x21591e)){const _0x4dfc50=_0xfa40f8['slice'](0x0,_0x15b66b);await handleSDKOutput(_0x4dfc50,{..._0x21591e,'limit':_0x15b66b});}else{const _0x30d151=_0xfa40f8[_0x3388dd(0x9b)]>0x0?Math[_0x3388dd(0x99)](..._0xfa40f8[_0x3388dd(0xa5)](_0x4104b2=>_0x4104b2[_0x3388dd(0xb5)][_0x3388dd(0x9b)])):0x0,_0x517fef=[];for(const _0x3f30ee of _0xfa40f8){const _0x46c0b0=a19_0x249db0[_0x3388dd(0x9c)](_0x3f30ee[_0x3388dd(0xb5)][_0x3388dd(0xb6)](_0x30d151)),_0x4b060a=_0x3f30ee[_0x3388dd(0xa2)]?.['name']?_0x3388dd(0xa7)+a19_0x249db0['dim'](_0x3f30ee[_0x3388dd(0xa2)]['name']):'';_0x517fef[_0x3388dd(0xab)](_0x46c0b0+'\x20\x20'+_0x3f30ee[_0x3388dd(0xa3)]+_0x4b060a);}await writeOutput(_0x517fef[_0x3388dd(0xaf)]('\x0a'),_0x21591e[_0x3388dd(0x97)],_0x3388dd(0xb0));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a19_0x4ad2ff(0xa3)]=a19_0x4ad2ff(0xbe);['description']=a19_0x4ad2ff(0xa9);[a19_0x4ad2ff(0xbf)](_0x5d27bb){const _0x41c47a=a19_0x4ad2ff,{args:_0x8103f9}=_0x5d27bb;if(!_0x8103f9[0x0])return _0x41c47a(0xad);return undefined;}async[a19_0x4ad2ff(0xc0)](_0x67fa25){const _0x94c1b0=a19_0x4ad2ff,{options:_0x5a9d8e,args:_0x434713,tdx:_0x1f983a}=_0x67fa25,_0x2fb924=_0x434713[0x0];_0x5a9d8e['verbose']&&(console['error']('Site:\x20'+_0x5a9d8e[_0x94c1b0(0xb4)]),console['error'](_0x94c1b0(0xa6)+_0x2fb924));const _0x3b9ecd=await withSpinner(_0x94c1b0(0xa4)+_0x2fb924+_0x94c1b0(0x9a),()=>_0x1f983a[_0x94c1b0(0xb7)][_0x94c1b0(0xbb)](_0x2fb924),{'verbose':_0x5a9d8e['verbose']}),_0x5e94c8=_0x3b9ecd[_0x94c1b0(0xae)];return console[_0x94c1b0(0xbd)]('✔\x20Found\x20connection:\x20'+_0x5e94c8[_0x94c1b0(0xa3)]),await handleSingleObjectOutput(_0x5e94c8,_0x5a9d8e),0x0;}}
1
+ const a19_0x5195d8=a19_0x1b54;(function(_0x4bb768,_0x314433){const _0x489521=a19_0x1b54,_0x452c36=_0x4bb768();while(!![]){try{const _0x2eb4bc=-parseInt(_0x489521(0x95))/0x1+parseInt(_0x489521(0x9e))/0x2*(-parseInt(_0x489521(0x91))/0x3)+parseInt(_0x489521(0x9f))/0x4*(-parseInt(_0x489521(0x97))/0x5)+parseInt(_0x489521(0xb0))/0x6+-parseInt(_0x489521(0x93))/0x7*(-parseInt(_0x489521(0x94))/0x8)+-parseInt(_0x489521(0x96))/0x9*(parseInt(_0x489521(0xa0))/0xa)+-parseInt(_0x489521(0xac))/0xb*(-parseInt(_0x489521(0xa5))/0xc);if(_0x2eb4bc===_0x314433)break;else _0x452c36['push'](_0x452c36['shift']());}catch(_0x55a737){_0x452c36['push'](_0x452c36['shift']());}}}(a19_0x10db,0xe5864));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import a19_0x2e26d9 from'chalk';export class ConnectionListCommand extends BaseCommand{[a19_0x5195d8(0xab)]='connection:list';[a19_0x5195d8(0xaf)]='List\x20all\x20result\x20output\x20connections';async[a19_0x5195d8(0x90)](_0x1d16eb){const _0x2938d1=a19_0x5195d8,{options:_0x4e8f35,tdx:_0x5a494b}=_0x1d16eb;_0x4e8f35[_0x2938d1(0xa2)]&&console[_0x2938d1(0xa7)](_0x2938d1(0xae)+_0x4e8f35[_0x2938d1(0x9b)]);const _0x2022d7=resolveLimit(_0x4e8f35[_0x2938d1(0xa9)],DEFAULT_LISTING_LIMIT),_0x5cb514=await withSpinner(_0x2938d1(0x92),()=>_0x5a494b['connection'][_0x2938d1(0x8f)](),{'verbose':_0x4e8f35[_0x2938d1(0xa2)]}),_0x370ad2=_0x5cb514[_0x2938d1(0xad)];console[_0x2938d1(0xa7)](_0x2938d1(0x9c)+_0x370ad2['length']+'\x20connection'+(_0x370ad2[_0x2938d1(0xa6)]!==0x1?'s':''));if(isStructuredFormat(_0x4e8f35)){const _0x2cd4f9=_0x370ad2[_0x2938d1(0x8e)](0x0,_0x2022d7);await handleSDKOutput(_0x2cd4f9,{..._0x4e8f35,'limit':_0x2022d7});}else{const _0x4c905d=_0x370ad2[_0x2938d1(0xa6)]>0x0?Math['max'](..._0x370ad2['map'](_0x3e2441=>_0x3e2441['type'][_0x2938d1(0xa6)])):0x0,_0x29e4b5=[];for(const _0x1dc788 of _0x370ad2){const _0x302365=a19_0x2e26d9['cyan'](_0x1dc788[_0x2938d1(0xb3)][_0x2938d1(0xa3)](_0x4c905d)),_0xd14ee6=_0x1dc788[_0x2938d1(0xb1)]?.['name']?'\x20-\x20'+a19_0x2e26d9['dim'](_0x1dc788['owner']['name']):'';_0x29e4b5['push'](_0x302365+'\x20\x20'+_0x1dc788[_0x2938d1(0xab)]+_0xd14ee6);}await writeOutput(_0x29e4b5['join']('\x0a'),_0x4e8f35['output'],_0x2938d1(0x9d));}return 0x0;}}function a19_0x1b54(_0x1c6be2,_0x1552a3){_0x1c6be2=_0x1c6be2-0x8d;const _0x10db15=a19_0x10db();let _0x1b5456=_0x10db15[_0x1c6be2];return _0x1b5456;}export class ConnectionShowCommand extends BaseCommand{[a19_0x5195d8(0xab)]=a19_0x5195d8(0xa8);[a19_0x5195d8(0xaf)]=a19_0x5195d8(0xa4);[a19_0x5195d8(0x9a)](_0x334b27){const _0x2d2e4c=a19_0x5195d8,{args:_0x2cf962}=_0x334b27;if(!_0x2cf962[0x0])return _0x2d2e4c(0x8d);return undefined;}async['execute'](_0x26f92b){const _0x327c9b=a19_0x5195d8,{options:_0x3605c0,args:_0x413db8,tdx:_0x13a08f}=_0x26f92b,_0x192980=_0x413db8[0x0];_0x3605c0[_0x327c9b(0xa2)]&&(console['error']('Site:\x20'+_0x3605c0[_0x327c9b(0x9b)]),console[_0x327c9b(0xa7)](_0x327c9b(0x98)+_0x192980));const _0x3471a5=await withSpinner(_0x327c9b(0xa1)+_0x192980+_0x327c9b(0xb2),()=>_0x13a08f['connection'][_0x327c9b(0x99)](_0x192980),{'verbose':_0x3605c0[_0x327c9b(0xa2)]}),_0x36e06a=_0x3471a5[_0x327c9b(0xad)];return console[_0x327c9b(0xa7)](_0x327c9b(0xaa)+_0x36e06a[_0x327c9b(0xab)]),await handleSingleObjectOutput(_0x36e06a,_0x3605c0),0x0;}}function a19_0x10db(){const _0x592937=['118615DUsaGn','136gSmOCg','835568goyYuC','18153BKPINZ','1565vlQerE','Looking\x20up\x20connection:\x20','resolve','validate','site','✔\x20Found\x20','table','194ZYqxmK','664KADhgg','8470WQroFn','Fetching\x20connection\x20\x27','verbose','padStart','Show\x20connection\x20details','108MAHfBy','length','error','connection:show','limit','✔\x20Found\x20connection:\x20','name','2801051XJEIka','data','Site:\x20','description','8902836pySTzD','owner','\x27...','type','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','slice','list','execute','16317LFssDA','Listing\x20connections...'];a19_0x10db=function(){return _0x592937;};return a19_0x10db();}
@@ -1 +1 @@
1
- function a20_0x2262(_0x46709a,_0x1db6c6){_0x46709a=_0x46709a-0x1a9;const _0x428400=a20_0x4284();let _0x2262a1=_0x428400[_0x46709a];return _0x2262a1;}const a20_0x1421f9=a20_0x2262;(function(_0x207b60,_0x4d6d5c){const _0x58dcd0=a20_0x2262,_0x117bed=_0x207b60();while(!![]){try{const _0x4affd9=-parseInt(_0x58dcd0(0x1ba))/0x1*(parseInt(_0x58dcd0(0x1b0))/0x2)+parseInt(_0x58dcd0(0x1ab))/0x3+-parseInt(_0x58dcd0(0x1b7))/0x4+-parseInt(_0x58dcd0(0x1bd))/0x5+parseInt(_0x58dcd0(0x1bf))/0x6*(-parseInt(_0x58dcd0(0x1b4))/0x7)+parseInt(_0x58dcd0(0x1b1))/0x8+parseInt(_0x58dcd0(0x1be))/0x9;if(_0x4affd9===_0x4d6d5c)break;else _0x117bed['push'](_0x117bed['shift']());}catch(_0x2941a1){_0x117bed['push'](_0x117bed['shift']());}}}(a20_0x4284,0x61719));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a20_0x11cc8a from'chalk';export class ContextCommand extends BaseCommand{[a20_0x1421f9(0x1b5)]=a20_0x1421f9(0x1bb);['description']='Show\x20current\x20resolved\x20context';async[a20_0x1421f9(0x1b2)](_0x4e004f){const _0x4793cb=a20_0x1421f9,{options:_0xb04b6b}=_0x4e004f,_0xeef48f=_0xb04b6b[_0x4793cb(0x1ad)],_0x1eacd1=_0xb04b6b['clear'];console[_0x4793cb(0x1a9)](a20_0x11cc8a[_0x4793cb(0x1aa)]('Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.')),console[_0x4793cb(0x1a9)](a20_0x11cc8a[_0x4793cb(0x1aa)](_0x4793cb(0x1b8))),console['warn'](a20_0x11cc8a['yellow']('\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a')),cleanExpiredSessions();try{if(_0x1eacd1){clearSessionContext(_0xb04b6b[_0x4793cb(0x1bc)]);const _0x5c81b1=_0xb04b6b[_0x4793cb(0x1bc)]||getCurrentSessionPID()[_0x4793cb(0x1b6)]();return console[_0x4793cb(0x1ac)](_0x4793cb(0x1b9)+_0x5c81b1+')'),0x0;}const _0x204a0c=new GlobalContext(_0xb04b6b);return _0xeef48f?_0x204a0c[_0x4793cb(0x1b3)]():_0x204a0c[_0x4793cb(0x1af)](),0x0;}catch(_0x3c88c0){return _0x3c88c0 instanceof Error&&console['error'](_0x4793cb(0x1ae)+_0x3c88c0[_0x4793cb(0x1c0)]),0x1;}}}function a20_0x4284(){const _0x12cc8d=['\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','Session\x20context\x20cleared\x20(session:\x20','38OHpcEx','context','session','3101740jwGISi','4160736uritJA','2010jdVVmn','message','warn','yellow','675879WPOcnJ','log','debug','Error:\x20','display','6178qZUxkK','6059784CKRhbf','execute','displayWithSources','1127nAYPRZ','name','toString','1017104rjaxxm'];a20_0x4284=function(){return _0x12cc8d;};return a20_0x4284();}
1
+ const a20_0x254d49=a20_0x417d;function a20_0x417d(_0x3a432c,_0x5275fa){_0x3a432c=_0x3a432c-0x1a1;const _0x8456b5=a20_0x8456();let _0x417da4=_0x8456b5[_0x3a432c];return _0x417da4;}(function(_0x5633b5,_0x5c9fcf){const _0x5d5f76=a20_0x417d,_0x5970fe=_0x5633b5();while(!![]){try{const _0x234d97=parseInt(_0x5d5f76(0x1ab))/0x1*(parseInt(_0x5d5f76(0x1a8))/0x2)+parseInt(_0x5d5f76(0x1a7))/0x3*(parseInt(_0x5d5f76(0x1a2))/0x4)+parseInt(_0x5d5f76(0x1b5))/0x5+parseInt(_0x5d5f76(0x1ad))/0x6+parseInt(_0x5d5f76(0x1b4))/0x7+-parseInt(_0x5d5f76(0x1b0))/0x8+-parseInt(_0x5d5f76(0x1af))/0x9;if(_0x234d97===_0x5c9fcf)break;else _0x5970fe['push'](_0x5970fe['shift']());}catch(_0xe3c426){_0x5970fe['push'](_0x5970fe['shift']());}}}(a20_0x8456,0xc5308));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';function a20_0x8456(){const _0xcf10fa=['8154528antWtV','message','debug','yellow','8438395YyIePm','2641650zJufrK','clear','263348KGEGAr','description','Session\x20context\x20cleared\x20(session:\x20','Show\x20current\x20resolved\x20context','session','15CWWweV','1951226OBcoam','execute','warn','1aYnxLB','log','4966056LACaHM','Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.','18353565ySiOCL'];a20_0x8456=function(){return _0xcf10fa;};return a20_0x8456();}import a20_0xfcc852 from'chalk';export class ContextCommand extends BaseCommand{['name']='context';[a20_0x254d49(0x1a3)]=a20_0x254d49(0x1a5);async[a20_0x254d49(0x1a9)](_0x3e7738){const _0x267a84=a20_0x254d49,{options:_0x57c04a}=_0x3e7738,_0xd815f1=_0x57c04a[_0x267a84(0x1b2)],_0x26ed53=_0x57c04a[_0x267a84(0x1a1)];console[_0x267a84(0x1aa)](a20_0xfcc852[_0x267a84(0x1b3)](_0x267a84(0x1ae))),console[_0x267a84(0x1aa)](a20_0xfcc852['yellow']('\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context')),console[_0x267a84(0x1aa)](a20_0xfcc852['yellow']('\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a')),cleanExpiredSessions();try{if(_0x26ed53){clearSessionContext(_0x57c04a[_0x267a84(0x1a6)]);const _0x1ba13a=_0x57c04a[_0x267a84(0x1a6)]||getCurrentSessionPID()['toString']();return console[_0x267a84(0x1ac)](_0x267a84(0x1a4)+_0x1ba13a+')'),0x0;}const _0xf61f51=new GlobalContext(_0x57c04a);return _0xd815f1?_0xf61f51['displayWithSources']():_0xf61f51['display'](),0x0;}catch(_0x13aada){return _0x13aada instanceof Error&&console['error']('Error:\x20'+_0x13aada[_0x267a84(0x1b1)]),0x1;}}}
@@ -1 +1 @@
1
- const a21_0x50f282=a21_0x432e;(function(_0x3c8b3e,_0x1c102b){const _0x132af4=a21_0x432e,_0x55227c=_0x3c8b3e();while(!![]){try{const _0x57453f=-parseInt(_0x132af4(0x11b))/0x1+parseInt(_0x132af4(0x111))/0x2*(parseInt(_0x132af4(0x11f))/0x3)+-parseInt(_0x132af4(0x11e))/0x4+parseInt(_0x132af4(0x113))/0x5+parseInt(_0x132af4(0x118))/0x6*(-parseInt(_0x132af4(0x121))/0x7)+parseInt(_0x132af4(0x11d))/0x8+parseInt(_0x132af4(0x114))/0x9*(parseInt(_0x132af4(0x12a))/0xa);if(_0x57453f===_0x1c102b)break;else _0x55227c['push'](_0x55227c['shift']());}catch(_0x11f145){_0x55227c['push'](_0x55227c['shift']());}}}(a21_0x5442,0x97877));function a21_0x432e(_0x57059f,_0x16daea){_0x57059f=_0x57059f-0x110;const _0x5442c6=a21_0x5442();let _0x432eec=_0x5442c6[_0x57059f];return _0x432eec;}function a21_0x5442(){const _0x326c23=['Listing\x20databases...','description','name','site','databases','3080XcATfp','✔\x20Found\x20','14vSEwpZ','data','30815FkczNA','79209urfnSZ','execute','Site:\x20','query','6tgwsdm','\x20database','error','969572VLMfid','verbose','3898488hbJOXx','4910084rHeQnz','14793EoTxsh','Pattern:\x20','2946601BuDPqk','limit','Error:\x20','message'];a21_0x5442=function(){return _0x326c23;};return a21_0x5442();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a21_0x50f282(0x127)]=a21_0x50f282(0x129);[a21_0x50f282(0x126)]='List\x20all\x20databases';async[a21_0x50f282(0x115)](_0x29f44a){const _0x3405a2=a21_0x50f282,{options:_0x1894c2,args:_0x33a148,tdx:_0x2eb09e}=_0x29f44a,_0x1b5dc8=_0x33a148[0x0];try{_0x1894c2['verbose']&&(console[_0x3405a2(0x11a)](_0x3405a2(0x116)+_0x1894c2[_0x3405a2(0x128)]),_0x1b5dc8&&console[_0x3405a2(0x11a)](_0x3405a2(0x120)+_0x1b5dc8));const _0x187f1c=resolveLimit(_0x1894c2[_0x3405a2(0x122)],DEFAULT_LISTING_LIMIT),_0x5dabd0=await withSpinner(_0x3405a2(0x125),()=>_0x2eb09e[_0x3405a2(0x117)]['listDatabases'](_0x1b5dc8,_0x187f1c),{'verbose':_0x1894c2[_0x3405a2(0x11c)]}),_0x543e10=_0x5dabd0[_0x3405a2(0x112)];return console[_0x3405a2(0x11a)](_0x3405a2(0x110)+_0x543e10['length']+_0x3405a2(0x119)+(_0x543e10['length']!==0x1?'s':'')),await handleSDKOutput(_0x543e10,{..._0x1894c2,'limit':_0x187f1c}),0x0;}catch(_0x142fba){if(_0x142fba instanceof SDKError)return console[_0x3405a2(0x11a)](_0x3405a2(0x123)+_0x142fba[_0x3405a2(0x124)]),_0x142fba['cause']&&console[_0x3405a2(0x11a)]('\x20\x20Cause:\x20'+_0x142fba['cause']),0x1;throw _0x142fba;}}}
1
+ const a21_0xe9cfe9=a21_0x565a;(function(_0x3d6072,_0x2c5153){const _0x11ff35=a21_0x565a,_0x43f981=_0x3d6072();while(!![]){try{const _0x202089=-parseInt(_0x11ff35(0xe9))/0x1*(-parseInt(_0x11ff35(0xdb))/0x2)+parseInt(_0x11ff35(0xee))/0x3+parseInt(_0x11ff35(0xdf))/0x4*(parseInt(_0x11ff35(0xde))/0x5)+parseInt(_0x11ff35(0xe7))/0x6+-parseInt(_0x11ff35(0xda))/0x7+parseInt(_0x11ff35(0xd8))/0x8+-parseInt(_0x11ff35(0xd3))/0x9;if(_0x202089===_0x2c5153)break;else _0x43f981['push'](_0x43f981['shift']());}catch(_0x515421){_0x43f981['push'](_0x43f981['shift']());}}}(a21_0x5dc3,0x2eb3b));import{BaseCommand}from'./command.js';function a21_0x5dc3(){const _0x3709cd=['Pattern:\x20','707610JzKLDY','✔\x20Found\x20','1162053mlRXAO','List\x20all\x20databases','execute','listDatabases','cause','939488djRiUK','description','1443155HmFegf','2DnvIlH','\x20\x20Cause:\x20','Error:\x20','25EUsZLV','88732laKjcH','name','verbose','message','\x20database','site','data','databases','317646oPfZhy','limit','9411FSdGGo','error','length','query'];a21_0x5dc3=function(){return _0x3709cd;};return a21_0x5dc3();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a21_0x565a(_0x517fa5,_0x434bce){_0x517fa5=_0x517fa5-0xd2;const _0x5dc3ac=a21_0x5dc3();let _0x565ab3=_0x5dc3ac[_0x517fa5];return _0x565ab3;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a21_0xe9cfe9(0xe0)]=a21_0xe9cfe9(0xe6);[a21_0xe9cfe9(0xd9)]=a21_0xe9cfe9(0xd4);async[a21_0xe9cfe9(0xd5)](_0x49c558){const _0x10c124=a21_0xe9cfe9,{options:_0x23cd93,args:_0x17f494,tdx:_0x41fe90}=_0x49c558,_0x5a14b6=_0x17f494[0x0];try{_0x23cd93['verbose']&&(console['error']('Site:\x20'+_0x23cd93[_0x10c124(0xe4)]),_0x5a14b6&&console[_0x10c124(0xea)](_0x10c124(0xed)+_0x5a14b6));const _0x58d3f4=resolveLimit(_0x23cd93[_0x10c124(0xe8)],DEFAULT_LISTING_LIMIT),_0x1c7220=await withSpinner('Listing\x20databases...',()=>_0x41fe90[_0x10c124(0xec)][_0x10c124(0xd6)](_0x5a14b6,_0x58d3f4),{'verbose':_0x23cd93[_0x10c124(0xe1)]}),_0x5f0927=_0x1c7220[_0x10c124(0xe5)];return console[_0x10c124(0xea)](_0x10c124(0xd2)+_0x5f0927[_0x10c124(0xeb)]+_0x10c124(0xe3)+(_0x5f0927[_0x10c124(0xeb)]!==0x1?'s':'')),await handleSDKOutput(_0x5f0927,{..._0x23cd93,'limit':_0x58d3f4}),0x0;}catch(_0x588bf3){if(_0x588bf3 instanceof SDKError)return console[_0x10c124(0xea)](_0x10c124(0xdd)+_0x588bf3[_0x10c124(0xe2)]),_0x588bf3[_0x10c124(0xd7)]&&console[_0x10c124(0xea)](_0x10c124(0xdc)+_0x588bf3[_0x10c124(0xd7)]),0x1;throw _0x588bf3;}}}
@@ -1 +1 @@
1
- const a22_0x29fe53=a22_0x39e2;(function(_0x26ab1f,_0x14b648){const _0x57c235=a22_0x39e2,_0x53be3d=_0x26ab1f();while(!![]){try{const _0x2278f7=-parseInt(_0x57c235(0xd1))/0x1+-parseInt(_0x57c235(0xd3))/0x2*(parseInt(_0x57c235(0xbd))/0x3)+-parseInt(_0x57c235(0xc2))/0x4+-parseInt(_0x57c235(0xc7))/0x5+parseInt(_0x57c235(0xc0))/0x6+parseInt(_0x57c235(0xb9))/0x7+parseInt(_0x57c235(0xc1))/0x8;if(_0x2278f7===_0x14b648)break;else _0x53be3d['push'](_0x53be3d['shift']());}catch(_0x3d436b){_0x53be3d['push'](_0x53be3d['shift']());}}}(a22_0x39cf,0x5dce4));function a22_0x39cf(){const _0x2ba434=['database','922560oQFDOt','description','\x20\x20Cause:\x20','describe','length','error','Table\x20\x27','query','site','✖\x20Table\x20not\x20found','77480VJgPCH','✔\x20Found\x20','552718wvfMnq','execute','Describing\x20table\x20','Table:\x20','Describe\x20table\x20schema','\x20column','args','verbose','cause','name','Database:\x20','Site:\x20','1106000DSRLTU','validate','\x27\x20does\x20not\x20exist','message','6MuKUpU','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','describeTable','1032168WGcfzi','8146624NvvooF','597672LwEukg','data','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','Error:\x20'];a22_0x39cf=function(){return _0x2ba434;};return a22_0x39cf();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a22_0x39e2(_0x5c9a86,_0x38a7d1){_0x5c9a86=_0x5c9a86-0xae;const _0x39cf25=a22_0x39cf();let _0x39e2a3=_0x39cf25[_0x5c9a86];return _0x39e2a3;}import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a22_0x29fe53(0xb6)]=a22_0x29fe53(0xca);[a22_0x29fe53(0xc8)]=a22_0x29fe53(0xb1);async[a22_0x29fe53(0xae)](_0x15f2b0){return this['describeTable'](_0x15f2b0);}async[a22_0x29fe53(0xbf)](_0x37b11f){const _0x354a27=a22_0x29fe53,{options:_0x542975,args:_0x56b5f0,tdx:_0x582645}=_0x37b11f;let _0x514e0e;try{_0x514e0e=parseTableReference(_0x56b5f0[0x0]);const _0x2fd746=_0x542975[_0x354a27(0xc6)];!_0x514e0e[_0x354a27(0xc6)]&&_0x2fd746&&(_0x514e0e['database']=_0x2fd746);const _0x5023cd=validateTableDescribeReference(_0x514e0e);if(_0x5023cd)return console[_0x354a27(0xcc)](_0x354a27(0xc5)+_0x5023cd),0x1;}catch(_0x52dbbe){return console['error'](_0x354a27(0xc5)+_0x52dbbe[_0x354a27(0xbc)]),0x1;}const _0x351ff2=_0x514e0e[_0x354a27(0xc6)],_0x53bab7=_0x514e0e['table'];try{_0x542975['verbose']&&(console[_0x354a27(0xcc)](_0x354a27(0xb8)+_0x542975[_0x354a27(0xcf)]),console[_0x354a27(0xcc)](_0x354a27(0xb7)+_0x351ff2),console[_0x354a27(0xcc)](_0x354a27(0xb0)+_0x53bab7));const _0x2f70f0=await withSpinner(_0x354a27(0xaf)+_0x351ff2+'.'+_0x53bab7+'...',()=>_0x582645[_0x354a27(0xce)][_0x354a27(0xbf)](_0x351ff2,_0x53bab7),{'verbose':_0x542975[_0x354a27(0xb4)]}),_0x58284a=_0x2f70f0[_0x354a27(0xc3)];if(_0x58284a[_0x354a27(0xcb)]===0x0)return console[_0x354a27(0xcc)](_0x354a27(0xd0)),console[_0x354a27(0xcc)](_0x354a27(0xcd)+_0x351ff2+'.'+_0x53bab7+_0x354a27(0xbb)),0x1;return console[_0x354a27(0xcc)](_0x354a27(0xd2)+_0x58284a[_0x354a27(0xcb)]+_0x354a27(0xb2)+(_0x58284a['length']!==0x1?'s':'')+'\x20in\x20'+_0x351ff2+'.'+_0x53bab7),await handleSDKOutput(_0x58284a,_0x542975),0x0;}catch(_0x4f61e3){if(_0x4f61e3 instanceof SDKError)return console[_0x354a27(0xcc)](_0x354a27(0xc5)+_0x4f61e3[_0x354a27(0xbc)]),_0x4f61e3[_0x354a27(0xb5)]&&console[_0x354a27(0xcc)](_0x354a27(0xc9)+_0x4f61e3[_0x354a27(0xb5)]),0x1;throw _0x4f61e3;}}[a22_0x29fe53(0xba)](_0x7efa08){const _0x14813e=a22_0x29fe53;if(_0x7efa08[_0x14813e(0xb3)][_0x14813e(0xcb)]===0x0)return _0x14813e(0xc4);if(_0x7efa08[_0x14813e(0xb3)]['length']>0x1)return _0x14813e(0xbe);return undefined;}}
1
+ const a22_0x5e0e56=a22_0x17a1;(function(_0x86c2c2,_0x31b7bf){const _0x5562be=a22_0x17a1,_0x41429b=_0x86c2c2();while(!![]){try{const _0x51f02a=-parseInt(_0x5562be(0x175))/0x1+parseInt(_0x5562be(0x163))/0x2*(-parseInt(_0x5562be(0x16c))/0x3)+parseInt(_0x5562be(0x151))/0x4+-parseInt(_0x5562be(0x173))/0x5+parseInt(_0x5562be(0x161))/0x6+parseInt(_0x5562be(0x160))/0x7*(parseInt(_0x5562be(0x157))/0x8)+-parseInt(_0x5562be(0x167))/0x9*(-parseInt(_0x5562be(0x158))/0xa);if(_0x51f02a===_0x31b7bf)break;else _0x41429b['push'](_0x41429b['shift']());}catch(_0xb63066){_0x41429b['push'](_0x41429b['shift']());}}}(a22_0x2242,0xb4b84));import{BaseCommand}from'./command.js';function a22_0x17a1(_0x99048e,_0x14c8c1){_0x99048e=_0x99048e-0x151;const _0x2242cd=a22_0x2242();let _0x17a10f=_0x2242cd[_0x99048e];return _0x17a10f;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a22_0x5e0e56(0x159)]=a22_0x5e0e56(0x170);[a22_0x5e0e56(0x15b)]='Describe\x20table\x20schema';async[a22_0x5e0e56(0x15f)](_0x2e9bb9){const _0x3f81a3=a22_0x5e0e56;return this[_0x3f81a3(0x153)](_0x2e9bb9);}async[a22_0x5e0e56(0x153)](_0x5cab63){const _0x4c8dfa=a22_0x5e0e56,{options:_0x21abb9,args:_0x2085e3,tdx:_0x3e1a90}=_0x5cab63;let _0x424f7c;try{_0x424f7c=parseTableReference(_0x2085e3[0x0]);const _0x277e9b=_0x21abb9[_0x4c8dfa(0x168)];!_0x424f7c[_0x4c8dfa(0x168)]&&_0x277e9b&&(_0x424f7c[_0x4c8dfa(0x168)]=_0x277e9b);const _0x54fb70=validateTableDescribeReference(_0x424f7c);if(_0x54fb70)return console[_0x4c8dfa(0x152)]('Error:\x20'+_0x54fb70),0x1;}catch(_0x121818){return console['error'](_0x4c8dfa(0x176)+_0x121818['message']),0x1;}const _0x41e28d=_0x424f7c[_0x4c8dfa(0x168)],_0x54e02c=_0x424f7c[_0x4c8dfa(0x162)];try{_0x21abb9['verbose']&&(console[_0x4c8dfa(0x152)](_0x4c8dfa(0x174)+_0x21abb9['site']),console[_0x4c8dfa(0x152)](_0x4c8dfa(0x177)+_0x41e28d),console[_0x4c8dfa(0x152)](_0x4c8dfa(0x171)+_0x54e02c));const _0x3790f3=await withSpinner(_0x4c8dfa(0x166)+_0x41e28d+'.'+_0x54e02c+'...',()=>_0x3e1a90[_0x4c8dfa(0x16f)]['describeTable'](_0x41e28d,_0x54e02c),{'verbose':_0x21abb9[_0x4c8dfa(0x16a)]}),_0x2aad47=_0x3790f3[_0x4c8dfa(0x165)];if(_0x2aad47[_0x4c8dfa(0x16e)]===0x0)return console[_0x4c8dfa(0x152)](_0x4c8dfa(0x169)),console[_0x4c8dfa(0x152)](_0x4c8dfa(0x164)+_0x41e28d+'.'+_0x54e02c+_0x4c8dfa(0x154)),0x1;return console[_0x4c8dfa(0x152)](_0x4c8dfa(0x15c)+_0x2aad47[_0x4c8dfa(0x16e)]+_0x4c8dfa(0x156)+(_0x2aad47[_0x4c8dfa(0x16e)]!==0x1?'s':'')+_0x4c8dfa(0x16d)+_0x41e28d+'.'+_0x54e02c),await handleSDKOutput(_0x2aad47,_0x21abb9),0x0;}catch(_0xe8d3cb){if(_0xe8d3cb instanceof SDKError)return console[_0x4c8dfa(0x152)](_0x4c8dfa(0x176)+_0xe8d3cb[_0x4c8dfa(0x172)]),_0xe8d3cb[_0x4c8dfa(0x16b)]&&console[_0x4c8dfa(0x152)](_0x4c8dfa(0x15e)+_0xe8d3cb['cause']),0x1;throw _0xe8d3cb;}}[a22_0x5e0e56(0x15d)](_0x31849a){const _0x1e707d=a22_0x5e0e56;if(_0x31849a[_0x1e707d(0x155)]['length']===0x0)return _0x1e707d(0x15a);if(_0x31849a[_0x1e707d(0x155)][_0x1e707d(0x16e)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options';return undefined;}}function a22_0x2242(){const _0x1f85c3=['✔\x20Found\x20','validate','\x20\x20Cause:\x20','execute','2250031ruBwwQ','3673062PZOffG','table','1652972DpyKFf','Table\x20\x27','data','Describing\x20table\x20','581814xwqQyD','database','✖\x20Table\x20not\x20found','verbose','cause','3TJFNVB','\x20in\x20','length','query','describe','Table:\x20','message','2287660FaPUMa','Site:\x20','1301175aneVNN','Error:\x20','Database:\x20','6824zbuYyG','error','describeTable','\x27\x20does\x20not\x20exist','args','\x20column','16jKssXR','320ePeDei','name','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','description'];a22_0x2242=function(){return _0x1f85c3;};return a22_0x2242();}
@@ -1 +1 @@
1
- const a23_0x1f4098=a23_0x4f5f;(function(_0x6fddf3,_0x28b676){const _0x2a71a1=a23_0x4f5f,_0x350d6f=_0x6fddf3();while(!![]){try{const _0x275601=parseInt(_0x2a71a1(0x1db))/0x1+parseInt(_0x2a71a1(0x1ae))/0x2*(parseInt(_0x2a71a1(0x1e7))/0x3)+-parseInt(_0x2a71a1(0x1c3))/0x4+-parseInt(_0x2a71a1(0x224))/0x5*(parseInt(_0x2a71a1(0x200))/0x6)+-parseInt(_0x2a71a1(0x213))/0x7+parseInt(_0x2a71a1(0x1af))/0x8*(-parseInt(_0x2a71a1(0x1da))/0x9)+-parseInt(_0x2a71a1(0x1b8))/0xa*(-parseInt(_0x2a71a1(0x219))/0xb);if(_0x275601===_0x28b676)break;else _0x350d6f['push'](_0x350d6f['shift']());}catch(_0x2696e3){_0x350d6f['push'](_0x350d6f['shift']());}}}(a23_0x5cf8,0xd10c1));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';function a23_0x5cf8(){const _0x3cf84d=['Set\x20workspace\x20context\x20for\x20Engage\x20commands','Workspace\x20\x27','engage:workspaces','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','type','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Error:\x20Workspace\x20name\x20is\x20required','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','getTemplateFull','Deleting\x20template\x20\x27','Resume\x20a\x20paused\x20campaign','Template\x20\x27','Launching\x20campaign\x20\x27','listWorkspaces','2AybNWE','344JUbGYV','resolveWorkspaceId','updateTemplate','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','getCampaign','fromEntries','Creating\x20template\x20\x27','data','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','30010gWOgYo','engage_workspace','Deleting\x20workspace\x20\x27','Duplicate\x20a\x20campaign','resumeCampaign','Pause\x20a\x20campaign','listTemplates','Operation\x20cancelled','engage:workspace:use','engage','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','5619880HCVAlU','log','List\x20campaigns','engage:campaigns','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','segmentName','segmentId','Fetching\x20template\x20\x27','limit','error','Create\x20a\x20workspace','engage:campaign:update','engage:workspace:show','description','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','MISSING_ARGUMENT','Pausing\x20campaign\x20\x27','engage:workspace:update','updateWorkspace','\x27\x20paused\x20successfully','deleteWorkspace','Options:\x20--name,\x20--description','Updating\x20campaign\x20\x27','83115bXPHcy','954571ZUFyBz','keys','resolvePathToResource','engage:template:delete','plaintext','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Fetching\x20campaigns...','launchCampaign','getWorkspace','parentId','Delete\x20an\x20email\x20template','updateCampaign','2900814LXmjIT','execute','Deleting\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','listCampaigns','session','yes','Show\x20email\x20template\x20details','engage:template:update','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Fetching\x20templates...','full','entries','pauseCampaign','filter','length','getWorkspaceFull','Show\x20workspace\x20details','parentName','Create\x20a\x20new\x20campaign','html','workspace','Verifying\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','258lEWXBC','duplicateCampaign','subject','\x27...','engage:campaign:show','engage:campaign:pause','verbose','Workspace\x20is\x20required\x20for\x20this\x20operation','engage:template:show','startAt','Update\x20a\x20workspace','Create\x20an\x20email\x20template','Engage\x20workspace\x20set\x20to:\x20','createCampaign','name','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','engage:campaign:create','createTemplate','Resuming\x20campaign\x20\x27','7407022xuAXwb','emailSenderId','List\x20email\x20templates','Fetching\x20workspace\x20\x27','engage:workspace:delete','Error:\x20--name\x20is\x20required','12221axDUaY','editorType','\x27\x20deleted\x20successfully','engage:campaign:resume','status','deleteTemplate','Creating\x20campaign\x20\x27','segment','Fetching\x20campaign\x20\x27','Campaign\x20\x27','Delete\x20a\x20workspace','178970lVJbPB','\x27?\x20This\x20cannot\x20be\x20undone.','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','timezone','Creating\x20workspace\x20\x27','jsonColumns','Show\x20campaign\x20details','engage:templates'];a23_0x5cf8=function(){return _0x3cf84d;};return a23_0x5cf8();}import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x1cc136,_0xaf554f,_0xe77f59=![]){const _0xb6b5f6=a23_0x4f5f;if(_0x1cc136[_0xb6b5f6(0x1fd)])return await _0xaf554f[_0xb6b5f6(0x1c1)][_0xb6b5f6(0x1b0)](_0x1cc136[_0xb6b5f6(0x1fd)]);const _0x38754e=loadSessionContext(_0x1cc136[_0xb6b5f6(0x1ec)]);if(_0x38754e?.['engage_workspace'])return await _0xaf554f[_0xb6b5f6(0x1c1)]['resolveWorkspaceId'](_0x38754e[_0xb6b5f6(0x1b9)]);if(_0xe77f59)throw new SDKError(ErrorCode[_0xb6b5f6(0x1d2)],_0xb6b5f6(0x207),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x444258,_0x1c8922){const _0x54d666=a23_0x4f5f;if(!_0x444258[_0x54d666(0x220)])return{};const _0x54fe60=_0x444258[_0x54d666(0x220)],_0x28c729=await _0x1c8922['segment'][_0x54d666(0x1dd)](_0x54fe60);return{'audienceId':_0x28c729[_0x54d666(0x1e4)],'audienceName':_0x28c729[_0x54d666(0x1fa)],..._0x28c729['segmentId']&&{'segmentId':_0x28c729[_0x54d666(0x1c9)],'segmentName':_0x28c729[_0x54d666(0x1c8)]}};}function buildConnectorConfig(_0x20856c){const _0x38fda9=a23_0x4f5f,_0x444fef=_0x20856c[_0x38fda9(0x214)],_0x457c04=_0x20856c[_0x38fda9(0x229)];if(!_0x444fef&&!_0x457c04)return undefined;return{..._0x444fef&&{'emailSenderId':_0x444fef},..._0x457c04&&{'jsonColumns':_0x457c04}};}export class EngageCampaignsCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1c6);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1c5);async[a23_0x1f4098(0x1e8)](_0x4a61de){const _0x18b2d9=a23_0x1f4098,{options:_0x1c5ab5,args:_0x46c222,tdx:_0x3d74b2}=_0x4a61de,_0x44c04f=_0x46c222[0x0],_0x57cf95=resolveLimit(_0x1c5ab5[_0x18b2d9(0x1cb)],DEFAULT_LLM_LIMIT),_0x27c413=_0x1c5ab5,_0x58d5ea=_0x27c413[_0x18b2d9(0x1a4)],_0x340095=_0x27c413[_0x18b2d9(0x21d)],_0x1f4443=await resolveWorkspaceIdFromOptions(_0x27c413,_0x3d74b2),_0x296fe2=await withSpinner(_0x18b2d9(0x1e1),()=>_0x3d74b2[_0x18b2d9(0x1c1)][_0x18b2d9(0x1eb)]({'type':_0x58d5ea,'status':_0x340095,'workspaceId':_0x1f4443,'limit':_0x57cf95}),{'verbose':_0x1c5ab5[_0x18b2d9(0x206)]});let _0x25fe0d=_0x296fe2[_0x18b2d9(0x1b6)];return _0x44c04f&&(_0x25fe0d=_0x296fe2[_0x18b2d9(0x1b6)][_0x18b2d9(0x1f6)](_0x78a42e=>matchGlobPattern(_0x78a42e[_0x18b2d9(0x20e)],_0x44c04f))),await handleSDKOutput(_0x25fe0d,_0x1c5ab5),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x204);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x19e);async[a23_0x1f4098(0x1e8)](_0x446a3d){const _0x10c633=a23_0x1f4098,{options:_0x5785f5,args:_0x12186f,tdx:_0x3682da}=_0x446a3d;if(_0x12186f[_0x10c633(0x1f7)]===0x0)return console[_0x10c633(0x1cc)](_0x10c633(0x1f1)),console[_0x10c633(0x1cc)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x1aac02=_0x12186f[0x0],_0xb9c003=_0x5785f5,_0x65d937=await resolveWorkspaceIdFromOptions(_0xb9c003,_0x3682da),_0x2fb3a0=_0xb9c003[_0x10c633(0x1f3)];if(_0x2fb3a0){const _0x41cec9=await withSpinner(_0x10c633(0x221)+_0x1aac02+_0x10c633(0x203),()=>_0x3682da[_0x10c633(0x1c1)]['getCampaignFull'](_0x1aac02,_0x65d937),{'verbose':_0x5785f5[_0x10c633(0x206)]});await handleSDKOutput([_0x41cec9],_0x5785f5);}else{const _0x2295d5=await withSpinner(_0x10c633(0x221)+_0x1aac02+_0x10c633(0x203),()=>_0x3682da[_0x10c633(0x1c1)][_0x10c633(0x1b3)](_0x1aac02,_0x65d937),{'verbose':_0x5785f5[_0x10c633(0x206)]});await handleSDKOutput([_0x2295d5],_0x5785f5);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a23_0x1f4098(0x210);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1fb);async[a23_0x1f4098(0x1e8)](_0x2fbacd){const _0xe6ac4d=a23_0x1f4098,{options:_0x20328c,tdx:_0x2a550b}=_0x2fbacd,_0x150d65=_0x20328c,_0x2fbe44=_0x150d65['name'],_0x54d419=_0x150d65[_0xe6ac4d(0x1a4)];if(!_0x2fbe44)return console[_0xe6ac4d(0x1cc)]('Error:\x20--name\x20is\x20required'),console['error'](_0xe6ac4d(0x1c7)),0x1;if(!_0x54d419)return console[_0xe6ac4d(0x1cc)](_0xe6ac4d(0x1e0)),console['error'](_0xe6ac4d(0x1c7)),0x1;const _0x34712c=await resolveWorkspaceIdFromOptions(_0x150d65,_0x2a550b,!![]),_0x52bdc2=await resolveSegmentFromOptions(_0x150d65,_0x2a550b),_0x123f4e=buildConnectorConfig(_0x150d65),_0x527178={'name':_0x2fbe44,'campaignType':_0x54d419,'workspaceId':_0x34712c,'description':_0x150d65[_0xe6ac4d(0x1d0)],..._0x52bdc2,'connectorConfig':_0x123f4e,'startAt':_0x150d65[_0xe6ac4d(0x209)],'timezone':_0x150d65['timezone']},_0x4141a0=await withSpinner(_0xe6ac4d(0x21f)+_0x2fbe44+_0xe6ac4d(0x203),()=>_0x2a550b[_0xe6ac4d(0x1c1)][_0xe6ac4d(0x20d)](_0x527178));return await handleSDKOutput([_0x4141a0[_0xe6ac4d(0x1b6)]],_0x20328c),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1ce);[a23_0x1f4098(0x1d0)]='Update\x20a\x20campaign';async[a23_0x1f4098(0x1e8)](_0x52c22d){const _0x3de4bf=a23_0x1f4098,{options:_0x25dcbb,args:_0x397402,tdx:_0x5939b1}=_0x52c22d;if(_0x397402[_0x3de4bf(0x1f7)]===0x0)return console['error'](_0x3de4bf(0x1f1)),console[_0x3de4bf(0x1cc)](_0x3de4bf(0x1d1)),0x1;const _0x427073=_0x397402[0x0],_0x13af2d=_0x25dcbb,_0x5b9791=await resolveWorkspaceIdFromOptions(_0x13af2d,_0x5939b1),_0x40eb03=await resolveSegmentFromOptions(_0x13af2d,_0x5939b1),_0x2ea8b9=buildConnectorConfig(_0x13af2d),_0x34be0e={'name':_0x13af2d[_0x3de4bf(0x20e)],'description':_0x13af2d[_0x3de4bf(0x1d0)],..._0x40eb03,'connectorConfig':_0x2ea8b9,'startAt':_0x13af2d[_0x3de4bf(0x209)],'timezone':_0x13af2d[_0x3de4bf(0x227)]},_0x41ca66=Object[_0x3de4bf(0x1b4)](Object[_0x3de4bf(0x1f4)](_0x34be0e)[_0x3de4bf(0x1f6)](([,_0x94de60])=>_0x94de60!==undefined));if(Object['keys'](_0x41ca66)['length']===0x0)return console['error'](_0x3de4bf(0x1f0)),console['error']('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0xd9cc12=await withSpinner(_0x3de4bf(0x1d9)+_0x427073+_0x3de4bf(0x203),()=>_0x5939b1[_0x3de4bf(0x1c1)][_0x3de4bf(0x1e6)](_0x427073,_0x41ca66,_0x5b9791),{'verbose':_0x25dcbb[_0x3de4bf(0x206)]});return await handleSDKOutput([_0xd9cc12[_0x3de4bf(0x1b6)]],_0x25dcbb),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a23_0x1f4098(0x20e)]='engage:campaign:delete';['description']='Delete\x20a\x20campaign';async[a23_0x1f4098(0x1e8)](_0x3d0ff1){const _0x3f38b5=a23_0x1f4098,{options:_0x3f9908,args:_0x2d6d67,tdx:_0x400bca}=_0x3d0ff1;if(_0x2d6d67[_0x3f38b5(0x1f7)]===0x0)return console[_0x3f38b5(0x1cc)](_0x3f38b5(0x1f1)),console[_0x3f38b5(0x1cc)](_0x3f38b5(0x1b7)),0x1;const _0x5770eb=_0x2d6d67[0x0],_0x6b3bbe=_0x3f9908,_0x2ec830=await resolveWorkspaceIdFromOptions(_0x6b3bbe,_0x400bca);if(!_0x3f9908['yes']){const _0xd58779=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x5770eb+_0x3f38b5(0x225));if(!_0xd58779)return console[_0x3f38b5(0x1c4)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x3f38b5(0x1e9)+_0x5770eb+_0x3f38b5(0x203),()=>_0x400bca['engage']['deleteCampaign'](_0x5770eb,_0x2ec830),{'verbose':_0x3f9908[_0x3f38b5(0x206)]}),console[_0x3f38b5(0x1c4)](_0x3f38b5(0x222)+_0x5770eb+_0x3f38b5(0x21b)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a23_0x1f4098(0x20e)]='engage:campaign:launch';[a23_0x1f4098(0x1d0)]='Launch\x20a\x20campaign';async['execute'](_0x20d549){const _0x1243f4=a23_0x1f4098,{options:_0x30b0d4,args:_0x4e0506,tdx:_0x5bbe1c}=_0x20d549;if(_0x4e0506[_0x1243f4(0x1f7)]===0x0)return console[_0x1243f4(0x1cc)](_0x1243f4(0x1f1)),console[_0x1243f4(0x1cc)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0xfb150=_0x4e0506[0x0],_0x1a81a1=_0x30b0d4,_0x142e00=await resolveWorkspaceIdFromOptions(_0x1a81a1,_0x5bbe1c);return await withSpinner(_0x1243f4(0x1ac)+_0xfb150+_0x1243f4(0x203),()=>_0x5bbe1c['engage'][_0x1243f4(0x1e2)](_0xfb150,_0x142e00),{'verbose':_0x30b0d4[_0x1243f4(0x206)]}),console[_0x1243f4(0x1c4)]('Campaign\x20\x27'+_0xfb150+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x205);['description']=a23_0x1f4098(0x1bd);async[a23_0x1f4098(0x1e8)](_0x4d508c){const _0x289ee6=a23_0x1f4098,{options:_0xfa6a4,args:_0x1e3449,tdx:_0x4c2feb}=_0x4d508c;if(_0x1e3449['length']===0x0)return console['error'](_0x289ee6(0x1f1)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x52c2ff=_0x1e3449[0x0],_0x1d30e3=_0xfa6a4,_0x21a89d=await resolveWorkspaceIdFromOptions(_0x1d30e3,_0x4c2feb);return await withSpinner(_0x289ee6(0x1d3)+_0x52c2ff+_0x289ee6(0x203),()=>_0x4c2feb[_0x289ee6(0x1c1)][_0x289ee6(0x1f5)](_0x52c2ff,_0x21a89d),{'verbose':_0xfa6a4[_0x289ee6(0x206)]}),console[_0x289ee6(0x1c4)](_0x289ee6(0x222)+_0x52c2ff+_0x289ee6(0x1d6)),0x0;}}function a23_0x4f5f(_0x1d80bb,_0x3e61b0){_0x1d80bb=_0x1d80bb-0x19e;const _0x5cf884=a23_0x5cf8();let _0x4f5f4a=_0x5cf884[_0x1d80bb];return _0x4f5f4a;}export class EngageCampaignResumeCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x21c);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1aa);async[a23_0x1f4098(0x1e8)](_0x127b01){const _0x40a730=a23_0x1f4098,{options:_0x4e69e6,args:_0x55da76,tdx:_0x1b79b2}=_0x127b01;if(_0x55da76[_0x40a730(0x1f7)]===0x0)return console[_0x40a730(0x1cc)](_0x40a730(0x1f1)),console[_0x40a730(0x1cc)](_0x40a730(0x1a3)),0x1;const _0x2b4a03=_0x55da76[0x0],_0x5825c3=_0x4e69e6,_0x4cc41f=await resolveWorkspaceIdFromOptions(_0x5825c3,_0x1b79b2);return await withSpinner(_0x40a730(0x212)+_0x2b4a03+_0x40a730(0x203),()=>_0x1b79b2[_0x40a730(0x1c1)][_0x40a730(0x1bc)](_0x2b4a03,_0x4cc41f),{'verbose':_0x4e69e6[_0x40a730(0x206)]}),console[_0x40a730(0x1c4)](_0x40a730(0x222)+_0x2b4a03+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']='engage:campaign:duplicate';['description']=a23_0x1f4098(0x1bb);async[a23_0x1f4098(0x1e8)](_0x87e594){const _0x3a41d9=a23_0x1f4098,{options:_0x2c2bb6,args:_0x52548e,tdx:_0x183f8b}=_0x87e594;if(_0x52548e[_0x3a41d9(0x1f7)]===0x0)return console[_0x3a41d9(0x1cc)](_0x3a41d9(0x1f1)),console[_0x3a41d9(0x1cc)](_0x3a41d9(0x1b2)),0x1;const _0x36e326=_0x52548e[0x0],_0x43a17e=_0x2c2bb6,_0x4ec7d7=await resolveWorkspaceIdFromOptions(_0x43a17e,_0x183f8b),_0x1d0fd3=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x36e326+_0x3a41d9(0x203),()=>_0x183f8b[_0x3a41d9(0x1c1)][_0x3a41d9(0x201)](_0x36e326,_0x4ec7d7),{'verbose':_0x2c2bb6[_0x3a41d9(0x206)]});return await handleSDKOutput([_0x1d0fd3['data']],_0x2c2bb6),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a23_0x1f4098(0x19f);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x215);async[a23_0x1f4098(0x1e8)](_0x18e1b2){const _0x53b23e=a23_0x1f4098,{options:_0x1aec83,args:_0x24855a,tdx:_0xac177a}=_0x18e1b2,_0x5d317a=_0x24855a[0x0],_0x3235b9=resolveLimit(_0x1aec83[_0x53b23e(0x1cb)],DEFAULT_LLM_LIMIT),_0x1ffa42=_0x1aec83,_0x12f06b=await resolveWorkspaceIdFromOptions(_0x1ffa42,_0xac177a),_0x24fd69=await withSpinner(_0x53b23e(0x1f2),()=>_0xac177a[_0x53b23e(0x1c1)][_0x53b23e(0x1be)]({'workspaceId':_0x12f06b,'limit':_0x3235b9}),{'verbose':_0x1aec83[_0x53b23e(0x206)]});let _0x32973f=_0x24fd69[_0x53b23e(0x1b6)];return _0x5d317a&&(_0x32973f=_0x24fd69['data']['filter'](_0x331bb6=>matchGlobPattern(_0x331bb6[_0x53b23e(0x20e)],_0x5d317a))),await handleSDKOutput(_0x32973f,_0x1aec83),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x208);['description']=a23_0x1f4098(0x1ee);async[a23_0x1f4098(0x1e8)](_0x1e4802){const _0x223b79=a23_0x1f4098,{options:_0x919a81,args:_0x4a8c32,tdx:_0x2556cc}=_0x1e4802;if(_0x4a8c32[_0x223b79(0x1f7)]===0x0)return console[_0x223b79(0x1cc)](_0x223b79(0x1c2)),console[_0x223b79(0x1cc)](_0x223b79(0x1a5)),0x1;const _0x341ca5=_0x4a8c32[0x0],_0x5ad968=_0x919a81,_0x2d1e1b=await resolveWorkspaceIdFromOptions(_0x5ad968,_0x2556cc),_0x3c66a8=_0x5ad968[_0x223b79(0x1f3)];if(_0x3c66a8){const _0x28e432=await withSpinner(_0x223b79(0x1ca)+_0x341ca5+_0x223b79(0x203),()=>_0x2556cc[_0x223b79(0x1c1)][_0x223b79(0x1a8)](_0x341ca5,_0x2d1e1b),{'verbose':_0x919a81[_0x223b79(0x206)]});await handleSDKOutput([_0x28e432],_0x919a81);}else{const _0x512ad0=await withSpinner(_0x223b79(0x1ca)+_0x341ca5+_0x223b79(0x203),()=>_0x2556cc['engage']['getTemplate'](_0x341ca5,_0x2d1e1b),{'verbose':_0x919a81[_0x223b79(0x206)]});await handleSDKOutput([_0x512ad0],_0x919a81);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a23_0x1f4098(0x20e)]='engage:template:create';['description']=a23_0x1f4098(0x20b);async['execute'](_0xf2e07f){const _0x2e3ba6=a23_0x1f4098,{options:_0x1f87ca,tdx:_0x4e1a69}=_0xf2e07f,_0x437703=_0x1f87ca,_0x3646cd=_0x437703[_0x2e3ba6(0x20e)],_0x251d67=_0x437703[_0x2e3ba6(0x202)],_0x378690=_0x437703['html'];if(!_0x3646cd)return console[_0x2e3ba6(0x1cc)](_0x2e3ba6(0x218)),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x251d67)return console[_0x2e3ba6(0x1cc)]('Error:\x20--subject\x20is\x20required'),0x1;if(!_0x378690)return console[_0x2e3ba6(0x1cc)]('Error:\x20--html\x20is\x20required'),0x1;const _0x4812e9=await resolveWorkspaceIdFromOptions(_0x437703,_0x4e1a69,!![]),_0x2b1319={'name':_0x3646cd,'subjectTemplate':_0x251d67,'htmlTemplate':_0x378690,'workspaceId':_0x4812e9,'plaintextTemplate':_0x437703['plaintext'],'editorType':_0x437703[_0x2e3ba6(0x21a)]},_0x47332a=await withSpinner(_0x2e3ba6(0x1b5)+_0x3646cd+_0x2e3ba6(0x203),()=>_0x4e1a69[_0x2e3ba6(0x1c1)][_0x2e3ba6(0x211)](_0x2b1319));return await handleSDKOutput([_0x47332a[_0x2e3ba6(0x1b6)]],_0x1f87ca),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1ef);[a23_0x1f4098(0x1d0)]='Update\x20an\x20email\x20template';async[a23_0x1f4098(0x1e8)](_0x54918e){const _0xe32298=a23_0x1f4098,{options:_0x3de851,args:_0x4df99f,tdx:_0x3cffeb}=_0x54918e;if(_0x4df99f['length']===0x0)return console[_0xe32298(0x1cc)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0xe32298(0x1cc)]('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x43db6a=_0x4df99f[0x0],_0x4b8ab6=_0x3de851,_0x53aa18=await resolveWorkspaceIdFromOptions(_0x4b8ab6,_0x3cffeb),_0x12ed89={'name':_0x4b8ab6[_0xe32298(0x20e)],'subjectTemplate':_0x4b8ab6[_0xe32298(0x202)],'htmlTemplate':_0x4b8ab6[_0xe32298(0x1fc)],'plaintextTemplate':_0x4b8ab6[_0xe32298(0x1df)]},_0x55ceff=Object[_0xe32298(0x1b4)](Object['entries'](_0x12ed89)[_0xe32298(0x1f6)](([,_0x1ddbe0])=>_0x1ddbe0!==undefined));if(Object[_0xe32298(0x1dc)](_0x55ceff)[_0xe32298(0x1f7)]===0x0)return console[_0xe32298(0x1cc)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0xe32298(0x1a7)),0x1;const _0x23f056=await withSpinner('Updating\x20template\x20\x27'+_0x43db6a+_0xe32298(0x203),()=>_0x3cffeb[_0xe32298(0x1c1)][_0xe32298(0x1b1)](_0x43db6a,_0x55ceff,_0x53aa18),{'verbose':_0x3de851['verbose']});return await handleSDKOutput([_0x23f056[_0xe32298(0x1b6)]],_0x3de851),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1de);['description']=a23_0x1f4098(0x1e5);async['execute'](_0x18ab5b){const _0x4fec77=a23_0x1f4098,{options:_0x56db1a,args:_0x43197a,tdx:_0x573fba}=_0x18ab5b;if(_0x43197a[_0x4fec77(0x1f7)]===0x0)return console['error'](_0x4fec77(0x1c2)),console[_0x4fec77(0x1cc)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x1d4f01=_0x43197a[0x0],_0x50510d=_0x56db1a,_0x3a8d84=await resolveWorkspaceIdFromOptions(_0x50510d,_0x573fba);if(!_0x56db1a[_0x4fec77(0x1ed)]){const _0x43eed2=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x1d4f01+_0x4fec77(0x225));if(!_0x43eed2)return console[_0x4fec77(0x1c4)](_0x4fec77(0x1bf)),0x0;}return await withSpinner(_0x4fec77(0x1a9)+_0x1d4f01+_0x4fec77(0x203),()=>_0x573fba[_0x4fec77(0x1c1)][_0x4fec77(0x21e)](_0x1d4f01,_0x3a8d84),{'verbose':_0x56db1a[_0x4fec77(0x206)]}),console['log'](_0x4fec77(0x1ab)+_0x1d4f01+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1a2);['description']='List\x20workspaces';async[a23_0x1f4098(0x1e8)](_0x195ded){const _0x1e0b66=a23_0x1f4098,{options:_0x55795f,args:_0x491d0d,tdx:_0x180982}=_0x195ded,_0x1677b6=_0x491d0d[0x0],_0x2278de=resolveLimit(_0x55795f[_0x1e0b66(0x1cb)],DEFAULT_LLM_LIMIT),_0x10d70f=await withSpinner('Fetching\x20workspaces...',()=>_0x180982[_0x1e0b66(0x1c1)][_0x1e0b66(0x1ad)]({'limit':_0x2278de}),{'verbose':_0x55795f[_0x1e0b66(0x206)]});let _0x79afdd=_0x10d70f[_0x1e0b66(0x1b6)];return _0x1677b6&&(_0x79afdd=_0x10d70f[_0x1e0b66(0x1b6)][_0x1e0b66(0x1f6)](_0x2554f2=>matchGlobPattern(_0x2554f2[_0x1e0b66(0x20e)],_0x1677b6))),await handleSDKOutput(_0x79afdd,_0x55795f),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1cf);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1f9);async[a23_0x1f4098(0x1e8)](_0x33a0a3){const _0x31167e=a23_0x1f4098,{options:_0x4a85e9,args:_0x4a0ebc,tdx:_0x4b1c96}=_0x33a0a3;if(_0x4a0ebc['length']===0x0)return console[_0x31167e(0x1cc)](_0x31167e(0x226)),console[_0x31167e(0x1cc)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x5877bc=_0x4a0ebc[0x0],_0x3a1554=_0x4a85e9,_0x44d86a=_0x3a1554['full'];if(_0x44d86a){const _0x4654ac=await withSpinner(_0x31167e(0x216)+_0x5877bc+_0x31167e(0x203),()=>_0x4b1c96[_0x31167e(0x1c1)][_0x31167e(0x1f8)](_0x5877bc),{'verbose':_0x4a85e9[_0x31167e(0x206)]});await handleSDKOutput([_0x4654ac],_0x4a85e9);}else{const _0x58ce07=await withSpinner(_0x31167e(0x216)+_0x5877bc+_0x31167e(0x203),()=>_0x4b1c96['engage'][_0x31167e(0x1e3)](_0x5877bc),{'verbose':_0x4a85e9[_0x31167e(0x206)]});await handleSDKOutput([_0x58ce07],_0x4a85e9);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a23_0x1f4098(0x20e)]='engage:workspace:create';['description']=a23_0x1f4098(0x1cd);async[a23_0x1f4098(0x1e8)](_0x31d992){const _0x17f9aa=a23_0x1f4098,{options:_0x229271,tdx:_0x17c821}=_0x31d992,_0x31e037=_0x229271,_0x2d6558=_0x31e037['name'];if(!_0x2d6558)return console[_0x17f9aa(0x1cc)](_0x17f9aa(0x218)),console[_0x17f9aa(0x1cc)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x273de2={'name':_0x2d6558,'description':_0x31e037['description']},_0x9ffc57=await withSpinner(_0x17f9aa(0x228)+_0x2d6558+_0x17f9aa(0x203),()=>_0x17c821[_0x17f9aa(0x1c1)]['createWorkspace'](_0x273de2));return await handleSDKOutput([_0x9ffc57['data']],_0x229271),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']=a23_0x1f4098(0x1d4);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x20a);async[a23_0x1f4098(0x1e8)](_0xc8f6a){const _0xb235d6=a23_0x1f4098,{options:_0x34119f,args:_0x251414,tdx:_0xb0ca9c}=_0xc8f6a;if(_0x251414['length']===0x0)return console[_0xb235d6(0x1cc)](_0xb235d6(0x226)),console[_0xb235d6(0x1cc)](_0xb235d6(0x1ff)),0x1;const _0x93626a=_0x251414[0x0],_0x34cb00=_0x34119f,_0x42cd1a={'name':_0x34cb00[_0xb235d6(0x20e)],'description':_0x34cb00[_0xb235d6(0x1d0)]},_0x1728b0=Object[_0xb235d6(0x1b4)](Object[_0xb235d6(0x1f4)](_0x42cd1a)[_0xb235d6(0x1f6)](([,_0x42f266])=>_0x42f266!==undefined));if(Object['keys'](_0x1728b0)[_0xb235d6(0x1f7)]===0x0)return console[_0xb235d6(0x1cc)](_0xb235d6(0x1f0)),console[_0xb235d6(0x1cc)](_0xb235d6(0x1d8)),0x1;const _0x1abd1a=await withSpinner('Updating\x20workspace\x20\x27'+_0x93626a+_0xb235d6(0x203),()=>_0xb0ca9c[_0xb235d6(0x1c1)][_0xb235d6(0x1d5)](_0x93626a,_0x1728b0),{'verbose':_0x34119f[_0xb235d6(0x206)]});return await handleSDKOutput([_0x1abd1a[_0xb235d6(0x1b6)]],_0x34119f),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x217);['description']=a23_0x1f4098(0x223);async['execute'](_0x4a9235){const _0x1eafb3=a23_0x1f4098,{options:_0x3a5190,args:_0x3a5d29,tdx:_0x28e57}=_0x4a9235;if(_0x3a5d29['length']===0x0)return console[_0x1eafb3(0x1cc)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x1eafb3(0x20f)),0x1;const _0xcac4b=_0x3a5d29[0x0];if(!_0x3a5190[_0x1eafb3(0x1ed)]){const _0x35775f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0xcac4b+_0x1eafb3(0x225));if(!_0x35775f)return console[_0x1eafb3(0x1c4)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x1eafb3(0x1ba)+_0xcac4b+_0x1eafb3(0x203),()=>_0x28e57[_0x1eafb3(0x1c1)][_0x1eafb3(0x1d7)](_0xcac4b),{'verbose':_0x3a5190['verbose']}),console[_0x1eafb3(0x1c4)](_0x1eafb3(0x1a1)+_0xcac4b+_0x1eafb3(0x21b)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1c0);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1a0);async[a23_0x1f4098(0x1e8)](_0x2df5c5){const _0x38af9d=a23_0x1f4098,{options:_0x58318f,args:_0x4ecffc,tdx:_0x5c1d30}=_0x2df5c5;if(_0x4ecffc[_0x38af9d(0x1f7)]===0x0)return console[_0x38af9d(0x1cc)](_0x38af9d(0x1a6)),console['error'](_0x38af9d(0x1ea)),0x1;const _0x2f6ec0=_0x4ecffc[0x0];await withSpinner(_0x38af9d(0x1fe)+_0x2f6ec0+_0x38af9d(0x203),()=>_0x5c1d30[_0x38af9d(0x1c1)][_0x38af9d(0x1b0)](_0x2f6ec0));const _0x2800d9=_0x58318f[_0x38af9d(0x1ec)]||undefined;return saveSessionContext({'engage_workspace':_0x2f6ec0},_0x2800d9),console[_0x38af9d(0x1c4)](_0x38af9d(0x20c)+_0x2f6ec0),console[_0x38af9d(0x1c4)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
1
+ const a23_0x363197=a23_0x1b95;(function(_0xa3ea05,_0x51a865){const _0x318752=a23_0x1b95,_0x3d840e=_0xa3ea05();while(!![]){try{const _0x2eda92=parseInt(_0x318752(0x140))/0x1+-parseInt(_0x318752(0x1a2))/0x2*(parseInt(_0x318752(0x144))/0x3)+-parseInt(_0x318752(0x194))/0x4*(parseInt(_0x318752(0x174))/0x5)+parseInt(_0x318752(0x15e))/0x6*(-parseInt(_0x318752(0x161))/0x7)+-parseInt(_0x318752(0x146))/0x8*(-parseInt(_0x318752(0x183))/0x9)+parseInt(_0x318752(0x15b))/0xa*(parseInt(_0x318752(0x170))/0xb)+-parseInt(_0x318752(0x127))/0xc;if(_0x2eda92===_0x51a865)break;else _0x3d840e['push'](_0x3d840e['shift']());}catch(_0x4ca0e2){_0x3d840e['push'](_0x3d840e['shift']());}}}(a23_0xd6ff,0x69a78));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a23_0xd6ff(){const _0x3e4722=['Engage\x20workspace\x20set\x20to:\x20','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','9331308BpyiUL','Fetching\x20campaigns...','engage:campaign:delete','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','jsonColumns','pauseCampaign','deleteTemplate','Error:\x20Workspace\x20name\x20is\x20required','engage:template:create','limit','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','full','segment','Options:\x20--name,\x20--description','Fetching\x20template\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','description','Duplicating\x20campaign\x20\x27','List\x20workspaces','Update\x20a\x20workspace','Update\x20an\x20email\x20template','engage:campaign:update','error','length','engage:templates','732130uQuZNY','Pause\x20a\x20campaign','listWorkspaces','createCampaign','12LCQEwJ','engage:workspace:create','8PEyFPK','Show\x20campaign\x20details','Updating\x20workspace\x20\x27','Creating\x20template\x20\x27','engage:workspaces','resolvePathToResource','Template\x20\x27','Fetching\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Error:\x20--html\x20is\x20required','yes','Update\x20a\x20campaign','deleteCampaign','subject','Delete\x20a\x20workspace','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','engage:campaign:show','Fetching\x20workspace\x20\x27','data','listCampaigns','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','240tRJCQM','Duplicate\x20a\x20campaign','entries','42vqnZpX','parentId','List\x20email\x20templates','141673ZdAwuh','getTemplate','\x27...','Campaign\x20\x27','engage:template:update','resumeCampaign','Workspace\x20is\x20required\x20for\x20this\x20operation','startAt','Pausing\x20campaign\x20\x27','launchCampaign','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','keys','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','createTemplate','engage:workspace:use','285329RoAzXS','plaintext','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','updateWorkspace','77655jikbGZ','engage_workspace','engage:workspace:update','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','segmentId','engage:campaign:launch','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Create\x20a\x20new\x20campaign','\x27\x20launched\x20successfully','parentName','getWorkspaceFull','Set\x20workspace\x20context\x20for\x20Engage\x20commands','log','Delete\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','5686587zZDzDw','filter','Deleting\x20template\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Create\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','engage:campaign:create','Error:\x20--name\x20is\x20required','duplicateCampaign','engage','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Verifying\x20workspace\x20\x27','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','session','84LiXGIi','status','execute','verbose','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','engage:template:show','engage:workspace:show','type','timezone','segmentName','Operation\x20cancelled','name','workspace','\x27\x20deleted\x20successfully','154158JEZvKz','updateCampaign','getCampaign','Launch\x20a\x20campaign','engage:template:delete','getTemplateFull','resolveWorkspaceId','Fetching\x20templates...','html','fromEntries','Resuming\x20campaign\x20\x27','engage:campaign:duplicate','Error:\x20--subject\x20is\x20required','Deleting\x20campaign\x20\x27'];a23_0xd6ff=function(){return _0x3e4722;};return a23_0xd6ff();}import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a23_0x1b95(_0x16dd4b,_0xe4b32e){_0x16dd4b=_0x16dd4b-0x11a;const _0xd6ff9b=a23_0xd6ff();let _0x1b9537=_0xd6ff9b[_0x16dd4b];return _0x1b9537;}async function resolveWorkspaceIdFromOptions(_0x149473,_0x3c886f,_0x16e77b=![]){const _0x172bbc=a23_0x1b95;if(_0x149473[_0x172bbc(0x1a0)])return await _0x3c886f[_0x172bbc(0x18e)][_0x172bbc(0x11d)](_0x149473[_0x172bbc(0x1a0)]);const _0x10a254=loadSessionContext(_0x149473[_0x172bbc(0x193)]);if(_0x10a254?.['engage_workspace'])return await _0x3c886f['engage'][_0x172bbc(0x11d)](_0x10a254[_0x172bbc(0x175)]);if(_0x16e77b)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x172bbc(0x167),undefined,{'helpText':_0x172bbc(0x12a)});return undefined;}async function resolveSegmentFromOptions(_0x41a044,_0x44c5ec){const _0x2c9431=a23_0x1b95;if(!_0x41a044[_0x2c9431(0x133)])return{};const _0xee102b=_0x41a044[_0x2c9431(0x133)],_0x5c661f=await _0x44c5ec[_0x2c9431(0x133)][_0x2c9431(0x14b)](_0xee102b);return{'audienceId':_0x5c661f[_0x2c9431(0x15f)],'audienceName':_0x5c661f[_0x2c9431(0x17d)],..._0x5c661f[_0x2c9431(0x178)]&&{'segmentId':_0x5c661f[_0x2c9431(0x178)],'segmentName':_0x5c661f[_0x2c9431(0x19d)]}};}function buildConnectorConfig(_0x11b10a){const _0x7a460b=a23_0x1b95,_0x9ba02c=_0x11b10a['emailSenderId'],_0x3ebd97=_0x11b10a[_0x7a460b(0x12b)];if(!_0x9ba02c&&!_0x3ebd97)return undefined;return{..._0x9ba02c&&{'emailSenderId':_0x9ba02c},..._0x3ebd97&&{'jsonColumns':_0x3ebd97}};}export class EngageCampaignsCommand extends BaseCommand{[a23_0x363197(0x19f)]='engage:campaigns';[a23_0x363197(0x137)]='List\x20campaigns';async[a23_0x363197(0x196)](_0x57f243){const _0x1439a4=a23_0x363197,{options:_0x5b0ba0,args:_0x268ff3,tdx:_0x21e715}=_0x57f243,_0x799441=_0x268ff3[0x0],_0x57f593=resolveLimit(_0x5b0ba0[_0x1439a4(0x130)],DEFAULT_LLM_LIMIT),_0x5c088b=_0x5b0ba0,_0x35b12b=_0x5c088b[_0x1439a4(0x19b)],_0x41acf0=_0x5c088b[_0x1439a4(0x195)],_0x305bc3=await resolveWorkspaceIdFromOptions(_0x5c088b,_0x21e715),_0x100051=await withSpinner(_0x1439a4(0x128),()=>_0x21e715['engage'][_0x1439a4(0x159)]({'type':_0x35b12b,'status':_0x41acf0,'workspaceId':_0x305bc3,'limit':_0x57f593}),{'verbose':_0x5b0ba0[_0x1439a4(0x197)]});let _0x49c9ae=_0x100051[_0x1439a4(0x158)];return _0x799441&&(_0x49c9ae=_0x100051[_0x1439a4(0x158)][_0x1439a4(0x184)](_0x174fb1=>matchGlobPattern(_0x174fb1[_0x1439a4(0x19f)],_0x799441))),await handleSDKOutput(_0x49c9ae,_0x5b0ba0),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x156);[a23_0x363197(0x137)]=a23_0x363197(0x147);async[a23_0x363197(0x196)](_0x2e2577){const _0x2c3886=a23_0x363197,{options:_0x827833,args:_0x20ead2,tdx:_0x45ddfc}=_0x2e2577;if(_0x20ead2[_0x2c3886(0x13e)]===0x0)return console[_0x2c3886(0x13d)](_0x2c3886(0x126)),console['error'](_0x2c3886(0x155)),0x1;const _0x2b52b1=_0x20ead2[0x0],_0x216a6e=_0x827833,_0x59906e=await resolveWorkspaceIdFromOptions(_0x216a6e,_0x45ddfc),_0x120306=_0x216a6e[_0x2c3886(0x132)];if(_0x120306){const _0x2f48ef=await withSpinner(_0x2c3886(0x14d)+_0x2b52b1+_0x2c3886(0x163),()=>_0x45ddfc['engage']['getCampaignFull'](_0x2b52b1,_0x59906e),{'verbose':_0x827833['verbose']});await handleSDKOutput([_0x2f48ef],_0x827833);}else{const _0x4f13fc=await withSpinner(_0x2c3886(0x14d)+_0x2b52b1+'\x27...',()=>_0x45ddfc[_0x2c3886(0x18e)][_0x2c3886(0x1a4)](_0x2b52b1,_0x59906e),{'verbose':_0x827833[_0x2c3886(0x197)]});await handleSDKOutput([_0x4f13fc],_0x827833);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x18b);[a23_0x363197(0x137)]=a23_0x363197(0x17b);async[a23_0x363197(0x196)](_0x50c8d6){const _0x17c710=a23_0x363197,{options:_0x37387c,tdx:_0x20bf67}=_0x50c8d6,_0x40a08d=_0x37387c,_0x5d200d=_0x40a08d['name'],_0xf55176=_0x40a08d['type'];if(!_0x5d200d)return console['error'](_0x17c710(0x18c)),console[_0x17c710(0x13d)](_0x17c710(0x14e)),0x1;if(!_0xf55176)return console[_0x17c710(0x13d)](_0x17c710(0x131)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x3826f2=await resolveWorkspaceIdFromOptions(_0x40a08d,_0x20bf67,!![]),_0x4febaa=await resolveSegmentFromOptions(_0x40a08d,_0x20bf67),_0x1dc26b=buildConnectorConfig(_0x40a08d),_0x2c26cd={'name':_0x5d200d,'campaignType':_0xf55176,'workspaceId':_0x3826f2,'description':_0x40a08d[_0x17c710(0x137)],..._0x4febaa,'connectorConfig':_0x1dc26b,'startAt':_0x40a08d[_0x17c710(0x168)],'timezone':_0x40a08d[_0x17c710(0x19c)]},_0x3bcd14=await withSpinner('Creating\x20campaign\x20\x27'+_0x5d200d+_0x17c710(0x163),()=>_0x20bf67[_0x17c710(0x18e)][_0x17c710(0x143)](_0x2c26cd));return await handleSDKOutput([_0x3bcd14[_0x17c710(0x158)]],_0x37387c),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a23_0x363197(0x13c);[a23_0x363197(0x137)]=a23_0x363197(0x151);async[a23_0x363197(0x196)](_0x3027f7){const _0x2e6170=a23_0x363197,{options:_0x8f872d,args:_0x282075,tdx:_0x5aadb1}=_0x3027f7;if(_0x282075[_0x2e6170(0x13e)]===0x0)return console[_0x2e6170(0x13d)](_0x2e6170(0x126)),console['error'](_0x2e6170(0x18f)),0x1;const _0x3c42e9=_0x282075[0x0],_0x489a2a=_0x8f872d,_0xd9c239=await resolveWorkspaceIdFromOptions(_0x489a2a,_0x5aadb1),_0xe6980e=await resolveSegmentFromOptions(_0x489a2a,_0x5aadb1),_0x590deb=buildConnectorConfig(_0x489a2a),_0x4ee371={'name':_0x489a2a['name'],'description':_0x489a2a[_0x2e6170(0x137)],..._0xe6980e,'connectorConfig':_0x590deb,'startAt':_0x489a2a[_0x2e6170(0x168)],'timezone':_0x489a2a[_0x2e6170(0x19c)]},_0x3a5649=Object[_0x2e6170(0x120)](Object[_0x2e6170(0x15d)](_0x4ee371)[_0x2e6170(0x184)](([,_0x30e1a4])=>_0x30e1a4!==undefined));if(Object[_0x2e6170(0x16c)](_0x3a5649)['length']===0x0)return console[_0x2e6170(0x13d)](_0x2e6170(0x16d)),console[_0x2e6170(0x13d)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x313d99=await withSpinner('Updating\x20campaign\x20\x27'+_0x3c42e9+_0x2e6170(0x163),()=>_0x5aadb1[_0x2e6170(0x18e)][_0x2e6170(0x1a3)](_0x3c42e9,_0x3a5649,_0xd9c239),{'verbose':_0x8f872d[_0x2e6170(0x197)]});return await handleSDKOutput([_0x313d99[_0x2e6170(0x158)]],_0x8f872d),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x129);[a23_0x363197(0x137)]='Delete\x20a\x20campaign';async['execute'](_0x3140e3){const _0x47c08c=a23_0x363197,{options:_0x81092f,args:_0x22bc5c,tdx:_0x1d9b3a}=_0x3140e3;if(_0x22bc5c['length']===0x0)return console[_0x47c08c(0x13d)](_0x47c08c(0x126)),console[_0x47c08c(0x13d)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x65c4c2=_0x22bc5c[0x0],_0xce7e9f=_0x81092f,_0x2e0dd3=await resolveWorkspaceIdFromOptions(_0xce7e9f,_0x1d9b3a);if(!_0x81092f[_0x47c08c(0x150)]){const _0xc0c4f6=await confirm(_0x47c08c(0x177)+_0x65c4c2+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0xc0c4f6)return console[_0x47c08c(0x180)](_0x47c08c(0x19e)),0x0;}return await withSpinner(_0x47c08c(0x124)+_0x65c4c2+_0x47c08c(0x163),()=>_0x1d9b3a[_0x47c08c(0x18e)][_0x47c08c(0x152)](_0x65c4c2,_0x2e0dd3),{'verbose':_0x81092f[_0x47c08c(0x197)]}),console[_0x47c08c(0x180)](_0x47c08c(0x164)+_0x65c4c2+_0x47c08c(0x1a1)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x179);[a23_0x363197(0x137)]=a23_0x363197(0x11a);async[a23_0x363197(0x196)](_0x500962){const _0x5708b0=a23_0x363197,{options:_0x5575a8,args:_0x392964,tdx:_0x322373}=_0x500962;if(_0x392964[_0x5708b0(0x13e)]===0x0)return console[_0x5708b0(0x13d)](_0x5708b0(0x126)),console[_0x5708b0(0x13d)](_0x5708b0(0x172)),0x1;const _0x4176dc=_0x392964[0x0],_0x36bc27=_0x5575a8,_0x34a1d7=await resolveWorkspaceIdFromOptions(_0x36bc27,_0x322373);return await withSpinner('Launching\x20campaign\x20\x27'+_0x4176dc+_0x5708b0(0x163),()=>_0x322373[_0x5708b0(0x18e)][_0x5708b0(0x16a)](_0x4176dc,_0x34a1d7),{'verbose':_0x5575a8['verbose']}),console[_0x5708b0(0x180)](_0x5708b0(0x164)+_0x4176dc+_0x5708b0(0x17c)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a23_0x363197(0x19f)]='engage:campaign:pause';[a23_0x363197(0x137)]=a23_0x363197(0x141);async[a23_0x363197(0x196)](_0xa4b1f9){const _0x370d4b=a23_0x363197,{options:_0x1cd92c,args:_0x285bfe,tdx:_0x11e517}=_0xa4b1f9;if(_0x285bfe[_0x370d4b(0x13e)]===0x0)return console[_0x370d4b(0x13d)](_0x370d4b(0x126)),console[_0x370d4b(0x13d)](_0x370d4b(0x187)),0x1;const _0x1601e4=_0x285bfe[0x0],_0x33adb7=_0x1cd92c,_0x42288f=await resolveWorkspaceIdFromOptions(_0x33adb7,_0x11e517);return await withSpinner(_0x370d4b(0x169)+_0x1601e4+_0x370d4b(0x163),()=>_0x11e517[_0x370d4b(0x18e)][_0x370d4b(0x12c)](_0x1601e4,_0x42288f),{'verbose':_0x1cd92c[_0x370d4b(0x197)]}),console[_0x370d4b(0x180)]('Campaign\x20\x27'+_0x1601e4+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a23_0x363197(0x19f)]='engage:campaign:resume';[a23_0x363197(0x137)]='Resume\x20a\x20paused\x20campaign';async[a23_0x363197(0x196)](_0x1eebca){const _0x381a61=a23_0x363197,{options:_0x1e6bb9,args:_0x282717,tdx:_0x39dee1}=_0x1eebca;if(_0x282717[_0x381a61(0x13e)]===0x0)return console[_0x381a61(0x13d)](_0x381a61(0x126)),console['error'](_0x381a61(0x182)),0x1;const _0x11130e=_0x282717[0x0],_0x16849f=_0x1e6bb9,_0x39cc1d=await resolveWorkspaceIdFromOptions(_0x16849f,_0x39dee1);return await withSpinner(_0x381a61(0x121)+_0x11130e+_0x381a61(0x163),()=>_0x39dee1[_0x381a61(0x18e)][_0x381a61(0x166)](_0x11130e,_0x39cc1d),{'verbose':_0x1e6bb9['verbose']}),console[_0x381a61(0x180)]('Campaign\x20\x27'+_0x11130e+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a23_0x363197(0x122);[a23_0x363197(0x137)]=a23_0x363197(0x15c);async[a23_0x363197(0x196)](_0x3dcdee){const _0x1c1ed3=a23_0x363197,{options:_0x4d33cb,args:_0x19b013,tdx:_0x519f50}=_0x3dcdee;if(_0x19b013[_0x1c1ed3(0x13e)]===0x0)return console[_0x1c1ed3(0x13d)](_0x1c1ed3(0x126)),console[_0x1c1ed3(0x13d)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x52bd5a=_0x19b013[0x0],_0x33ffc0=_0x4d33cb,_0x58c8d5=await resolveWorkspaceIdFromOptions(_0x33ffc0,_0x519f50),_0x2e472a=await withSpinner(_0x1c1ed3(0x138)+_0x52bd5a+'\x27...',()=>_0x519f50[_0x1c1ed3(0x18e)][_0x1c1ed3(0x18d)](_0x52bd5a,_0x58c8d5),{'verbose':_0x4d33cb['verbose']});return await handleSDKOutput([_0x2e472a[_0x1c1ed3(0x158)]],_0x4d33cb),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x13f);['description']=a23_0x363197(0x160);async[a23_0x363197(0x196)](_0x263528){const _0x17450d=a23_0x363197,{options:_0x45c60e,args:_0x151962,tdx:_0x2f2435}=_0x263528,_0x4a5b97=_0x151962[0x0],_0x22db4a=resolveLimit(_0x45c60e['limit'],DEFAULT_LLM_LIMIT),_0x4bd6bc=_0x45c60e,_0x5e718e=await resolveWorkspaceIdFromOptions(_0x4bd6bc,_0x2f2435),_0x2e6b75=await withSpinner(_0x17450d(0x11e),()=>_0x2f2435[_0x17450d(0x18e)]['listTemplates']({'workspaceId':_0x5e718e,'limit':_0x22db4a}),{'verbose':_0x45c60e[_0x17450d(0x197)]});let _0x5ed82b=_0x2e6b75['data'];return _0x4a5b97&&(_0x5ed82b=_0x2e6b75[_0x17450d(0x158)][_0x17450d(0x184)](_0x2014b2=>matchGlobPattern(_0x2014b2[_0x17450d(0x19f)],_0x4a5b97))),await handleSDKOutput(_0x5ed82b,_0x45c60e),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x199);[a23_0x363197(0x137)]='Show\x20email\x20template\x20details';async['execute'](_0x2509a5){const _0xff491=a23_0x363197,{options:_0x4c995c,args:_0x421fb1,tdx:_0x4a19b9}=_0x2509a5;if(_0x421fb1[_0xff491(0x13e)]===0x0)return console[_0xff491(0x13d)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0xff491(0x13d)](_0xff491(0x192)),0x1;const _0x43dcf4=_0x421fb1[0x0],_0x1d167d=_0x4c995c,_0x139d59=await resolveWorkspaceIdFromOptions(_0x1d167d,_0x4a19b9),_0x21245a=_0x1d167d[_0xff491(0x132)];if(_0x21245a){const _0x6ed042=await withSpinner(_0xff491(0x135)+_0x43dcf4+_0xff491(0x163),()=>_0x4a19b9[_0xff491(0x18e)][_0xff491(0x11c)](_0x43dcf4,_0x139d59),{'verbose':_0x4c995c[_0xff491(0x197)]});await handleSDKOutput([_0x6ed042],_0x4c995c);}else{const _0xa6bdff=await withSpinner(_0xff491(0x135)+_0x43dcf4+_0xff491(0x163),()=>_0x4a19b9[_0xff491(0x18e)][_0xff491(0x162)](_0x43dcf4,_0x139d59),{'verbose':_0x4c995c[_0xff491(0x197)]});await handleSDKOutput([_0xa6bdff],_0x4c995c);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x12f);['description']=a23_0x363197(0x188);async[a23_0x363197(0x196)](_0x1e01ba){const _0x339fe2=a23_0x363197,{options:_0x317330,tdx:_0xf2ddd}=_0x1e01ba,_0x434f22=_0x317330,_0x810761=_0x434f22[_0x339fe2(0x19f)],_0x2314e4=_0x434f22[_0x339fe2(0x153)],_0x58a61a=_0x434f22[_0x339fe2(0x11f)];if(!_0x810761)return console['error'](_0x339fe2(0x18c)),console[_0x339fe2(0x13d)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x2314e4)return console['error'](_0x339fe2(0x123)),0x1;if(!_0x58a61a)return console[_0x339fe2(0x13d)](_0x339fe2(0x14f)),0x1;const _0x2d35db=await resolveWorkspaceIdFromOptions(_0x434f22,_0xf2ddd,!![]),_0x1c72d8={'name':_0x810761,'subjectTemplate':_0x2314e4,'htmlTemplate':_0x58a61a,'workspaceId':_0x2d35db,'plaintextTemplate':_0x434f22[_0x339fe2(0x171)],'editorType':_0x434f22['editorType']},_0x342250=await withSpinner(_0x339fe2(0x149)+_0x810761+_0x339fe2(0x163),()=>_0xf2ddd[_0x339fe2(0x18e)][_0x339fe2(0x16e)](_0x1c72d8));return await handleSDKOutput([_0x342250[_0x339fe2(0x158)]],_0x317330),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x165);['description']=a23_0x363197(0x13b);async[a23_0x363197(0x196)](_0x9ba86a){const _0x45e38f=a23_0x363197,{options:_0x444a08,args:_0x5022a7,tdx:_0x387dd9}=_0x9ba86a;if(_0x5022a7[_0x45e38f(0x13e)]===0x0)return console[_0x45e38f(0x13d)](_0x45e38f(0x198)),console[_0x45e38f(0x13d)]('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x48250b=_0x5022a7[0x0],_0x3a7b26=_0x444a08,_0x589dac=await resolveWorkspaceIdFromOptions(_0x3a7b26,_0x387dd9),_0x24888c={'name':_0x3a7b26[_0x45e38f(0x19f)],'subjectTemplate':_0x3a7b26[_0x45e38f(0x153)],'htmlTemplate':_0x3a7b26['html'],'plaintextTemplate':_0x3a7b26[_0x45e38f(0x171)]},_0xe9fa0=Object['fromEntries'](Object[_0x45e38f(0x15d)](_0x24888c)[_0x45e38f(0x184)](([,_0x2e2c3a])=>_0x2e2c3a!==undefined));if(Object['keys'](_0xe9fa0)['length']===0x0)return console['error'](_0x45e38f(0x16d)),console['error'](_0x45e38f(0x16b)),0x1;const _0xd28f27=await withSpinner('Updating\x20template\x20\x27'+_0x48250b+_0x45e38f(0x163),()=>_0x387dd9['engage']['updateTemplate'](_0x48250b,_0xe9fa0,_0x589dac),{'verbose':_0x444a08[_0x45e38f(0x197)]});return await handleSDKOutput([_0xd28f27[_0x45e38f(0x158)]],_0x444a08),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x11b);[a23_0x363197(0x137)]=a23_0x363197(0x181);async[a23_0x363197(0x196)](_0x432b40){const _0x216631=a23_0x363197,{options:_0x579d11,args:_0x443159,tdx:_0x3bacba}=_0x432b40;if(_0x443159[_0x216631(0x13e)]===0x0)return console[_0x216631(0x13d)](_0x216631(0x198)),console[_0x216631(0x13d)](_0x216631(0x189)),0x1;const _0x4767a3=_0x443159[0x0],_0x271b07=_0x579d11,_0x9b725d=await resolveWorkspaceIdFromOptions(_0x271b07,_0x3bacba);if(!_0x579d11[_0x216631(0x150)]){const _0x281e6e=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x4767a3+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x281e6e)return console[_0x216631(0x180)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x216631(0x185)+_0x4767a3+'\x27...',()=>_0x3bacba[_0x216631(0x18e)][_0x216631(0x12d)](_0x4767a3,_0x9b725d),{'verbose':_0x579d11[_0x216631(0x197)]}),console['log'](_0x216631(0x14c)+_0x4767a3+_0x216631(0x1a1)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']=a23_0x363197(0x14a);[a23_0x363197(0x137)]=a23_0x363197(0x139);async[a23_0x363197(0x196)](_0x1fbe13){const _0x47f1a3=a23_0x363197,{options:_0x9209fb,args:_0x3622a0,tdx:_0x11ade0}=_0x1fbe13,_0x5b26b8=_0x3622a0[0x0],_0x1c6f81=resolveLimit(_0x9209fb['limit'],DEFAULT_LLM_LIMIT),_0x5b4bfb=await withSpinner('Fetching\x20workspaces...',()=>_0x11ade0[_0x47f1a3(0x18e)][_0x47f1a3(0x142)]({'limit':_0x1c6f81}),{'verbose':_0x9209fb['verbose']});let _0x586f90=_0x5b4bfb[_0x47f1a3(0x158)];return _0x5b26b8&&(_0x586f90=_0x5b4bfb[_0x47f1a3(0x158)][_0x47f1a3(0x184)](_0x3232d3=>matchGlobPattern(_0x3232d3[_0x47f1a3(0x19f)],_0x5b26b8))),await handleSDKOutput(_0x586f90,_0x9209fb),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x19a);[a23_0x363197(0x137)]='Show\x20workspace\x20details';async[a23_0x363197(0x196)](_0x101f83){const _0x36e232=a23_0x363197,{options:_0x4d6900,args:_0x2074ac,tdx:_0x457024}=_0x101f83;if(_0x2074ac[_0x36e232(0x13e)]===0x0)return console[_0x36e232(0x13d)](_0x36e232(0x191)),console[_0x36e232(0x13d)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x54ceb2=_0x2074ac[0x0],_0x372bd2=_0x4d6900,_0x5abb85=_0x372bd2[_0x36e232(0x132)];if(_0x5abb85){const _0x3ac14a=await withSpinner(_0x36e232(0x157)+_0x54ceb2+_0x36e232(0x163),()=>_0x457024['engage'][_0x36e232(0x17e)](_0x54ceb2),{'verbose':_0x4d6900[_0x36e232(0x197)]});await handleSDKOutput([_0x3ac14a],_0x4d6900);}else{const _0x2d4da7=await withSpinner('Fetching\x20workspace\x20\x27'+_0x54ceb2+'\x27...',()=>_0x457024['engage']['getWorkspace'](_0x54ceb2),{'verbose':_0x4d6900[_0x36e232(0x197)]});await handleSDKOutput([_0x2d4da7],_0x4d6900);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a23_0x363197(0x145);['description']='Create\x20a\x20workspace';async[a23_0x363197(0x196)](_0x570a87){const _0x30ae04=a23_0x363197,{options:_0x1c6664,tdx:_0x196669}=_0x570a87,_0x4ce21a=_0x1c6664,_0x2414ef=_0x4ce21a[_0x30ae04(0x19f)];if(!_0x2414ef)return console[_0x30ae04(0x13d)](_0x30ae04(0x18c)),console[_0x30ae04(0x13d)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x328205={'name':_0x2414ef,'description':_0x4ce21a[_0x30ae04(0x137)]},_0x32abb7=await withSpinner('Creating\x20workspace\x20\x27'+_0x2414ef+'\x27...',()=>_0x196669[_0x30ae04(0x18e)]['createWorkspace'](_0x328205));return await handleSDKOutput([_0x32abb7['data']],_0x1c6664),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x176);['description']=a23_0x363197(0x13a);async[a23_0x363197(0x196)](_0x229927){const _0x56593d=a23_0x363197,{options:_0xbf4e4b,args:_0x230f26,tdx:_0x215648}=_0x229927;if(_0x230f26['length']===0x0)return console[_0x56593d(0x13d)](_0x56593d(0x191)),console['error'](_0x56593d(0x15a)),0x1;const _0x53aadb=_0x230f26[0x0],_0x13a00e=_0xbf4e4b,_0x2f4551={'name':_0x13a00e[_0x56593d(0x19f)],'description':_0x13a00e[_0x56593d(0x137)]},_0x570196=Object[_0x56593d(0x120)](Object['entries'](_0x2f4551)['filter'](([,_0x113d9d])=>_0x113d9d!==undefined));if(Object[_0x56593d(0x16c)](_0x570196)[_0x56593d(0x13e)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x56593d(0x13d)](_0x56593d(0x134)),0x1;const _0x1bed7a=await withSpinner(_0x56593d(0x148)+_0x53aadb+'\x27...',()=>_0x215648[_0x56593d(0x18e)][_0x56593d(0x173)](_0x53aadb,_0x570196),{'verbose':_0xbf4e4b['verbose']});return await handleSDKOutput([_0x1bed7a[_0x56593d(0x158)]],_0xbf4e4b),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a23_0x363197(0x19f)]='engage:workspace:delete';[a23_0x363197(0x137)]=a23_0x363197(0x154);async[a23_0x363197(0x196)](_0xcbd1e){const _0x25a334=a23_0x363197,{options:_0xa72a3e,args:_0x2a2992,tdx:_0x14e925}=_0xcbd1e;if(_0x2a2992['length']===0x0)return console[_0x25a334(0x13d)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x25a334(0x13d)](_0x25a334(0x186)),0x1;const _0x2ef304=_0x2a2992[0x0];if(!_0xa72a3e['yes']){const _0x5ee856=await confirm(_0x25a334(0x17a)+_0x2ef304+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x5ee856)return console[_0x25a334(0x180)](_0x25a334(0x19e)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x2ef304+_0x25a334(0x163),()=>_0x14e925[_0x25a334(0x18e)]['deleteWorkspace'](_0x2ef304),{'verbose':_0xa72a3e[_0x25a334(0x197)]}),console[_0x25a334(0x180)]('Workspace\x20\x27'+_0x2ef304+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a23_0x363197(0x19f)]=a23_0x363197(0x16f);[a23_0x363197(0x137)]=a23_0x363197(0x17f);async['execute'](_0x175308){const _0x580d09=a23_0x363197,{options:_0x23f4df,args:_0x8ab10b,tdx:_0x23f814}=_0x175308;if(_0x8ab10b[_0x580d09(0x13e)]===0x0)return console[_0x580d09(0x13d)](_0x580d09(0x12e)),console[_0x580d09(0x13d)](_0x580d09(0x136)),0x1;const _0x122c3d=_0x8ab10b[0x0];await withSpinner(_0x580d09(0x190)+_0x122c3d+_0x580d09(0x163),()=>_0x23f814['engage']['resolveWorkspaceId'](_0x122c3d));const _0xd13c90=_0x23f4df[_0x580d09(0x193)]||undefined;return saveSessionContext({'engage_workspace':_0x122c3d},_0xd13c90),console['log'](_0x580d09(0x125)+_0x122c3d),console[_0x580d09(0x180)](_0x580d09(0x18a)),0x0;}}
@@ -1 +1 @@
1
- function a24_0x21db(_0x5b01f2,_0x179a14){_0x5b01f2=_0x5b01f2-0x189;const _0x13b6b5=a24_0x13b6();let _0x21dbda=_0x13b6b5[_0x5b01f2];return _0x21dbda;}const a24_0x23bd53=a24_0x21db;(function(_0x9a1eb,_0x3b3e92){const _0x882f99=a24_0x21db,_0x2621f8=_0x9a1eb();while(!![]){try{const _0x1a1622=parseInt(_0x882f99(0x1cd))/0x1+-parseInt(_0x882f99(0x194))/0x2+parseInt(_0x882f99(0x19b))/0x3+parseInt(_0x882f99(0x1c7))/0x4*(parseInt(_0x882f99(0x1aa))/0x5)+-parseInt(_0x882f99(0x1b4))/0x6*(parseInt(_0x882f99(0x18a))/0x7)+-parseInt(_0x882f99(0x1ac))/0x8+-parseInt(_0x882f99(0x1b3))/0x9*(parseInt(_0x882f99(0x1cb))/0xa);if(_0x1a1622===_0x3b3e92)break;else _0x2621f8['push'](_0x2621f8['shift']());}catch(_0x29dacf){_0x2621f8['push'](_0x2621f8['shift']());}}}(a24_0x13b6,0x93189));function a24_0x13b6(){const _0x24146d=['\x20row','55512hRwlnt','6mjGulg','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','job:submit','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Cancelled','cause','hive','query','Error:\x20Job\x20ID\x20is\x20required','Error:\x20Query\x20is\x20required','jobType','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','status','Database:\x20','round','Submit\x20a\x20job','\x20\x20Cause:\x20','yes','✔\x20Found\x20','28312ArEJCf','Kill\x20a\x20job','Submitting\x20kill\x20request...','database','260jRgOaA','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','956039DwJRKK','getTime','url','job:kill','created_at','length','\x20jobs','error','Query:\x20','debug','76027rNLhqT','file','kill','end_at','map','Get\x20job\x20results','Error:\x20','result','Getting\x20job\x20results...','job_id','442842iWoKsS','verbose','Submitting\x20job...','✔\x20Job\x20submitted','trino','start_at','execute','2594685gkNURB','Usage:\x20job\x20show\x20<job-id>','user_name','type','data','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Limit:\x20','...','limit','Status\x20filter:\x20','description','priority','list','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','jobs','145xyRiaI','name','8248328WfXpSK','Job\x20type:\x20','message','\x27\x20to\x20verify\x20the\x20job\x20status','Listing\x20jobs...','\x20\x20Job\x20ID:\x20'];a24_0x13b6=function(){return _0x24146d;};return a24_0x13b6();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a24_0x23bd53(0x1ab)]=a24_0x23bd53(0x1a9);[a24_0x23bd53(0x1a5)]='List\x20jobs';async[a24_0x23bd53(0x19a)](_0x11c25c){const _0x3156f2=a24_0x23bd53,{options:_0x2e59e3,tdx:_0x339a13}=_0x11c25c;try{const _0x2eeae1=resolveLimit(_0x2e59e3[_0x3156f2(0x1a3)],DEFAULT_DISPLAY_LIMIT),_0x6ec49e=_0x2e59e3['status'];_0x2e59e3[_0x3156f2(0x195)]&&(console[_0x3156f2(0x1d4)](_0x3156f2(0x1a1)+_0x2eeae1+_0x3156f2(0x1d3)),_0x6ec49e&&console['error'](_0x3156f2(0x1a4)+_0x6ec49e));const _0x52803c=await withSpinner(_0x3156f2(0x1b0),()=>_0x339a13[_0x3156f2(0x1a9)][_0x3156f2(0x1a7)]({'from':0x0,'to':_0x2eeae1-0x1,'status':_0x6ec49e}),{'verbose':_0x2e59e3[_0x3156f2(0x195)]}),_0x35c43a=_0x52803c[_0x3156f2(0x19f)];console[_0x3156f2(0x1d4)](_0x3156f2(0x1c6)+_0x35c43a['length']+'\x20job'+(_0x35c43a[_0x3156f2(0x1d2)]!==0x1?'s':''));const _0x1c6f9c=_0x35c43a[_0x3156f2(0x18e)](_0x54715d=>{const _0x37c351=_0x3156f2;let _0x90bb10;if(_0x54715d[_0x37c351(0x199)]&&_0x54715d[_0x37c351(0x18d)]){const _0x56d416=new Date(_0x54715d[_0x37c351(0x199)])[_0x37c351(0x1ce)](),_0x413bc2=new Date(_0x54715d[_0x37c351(0x18d)])['getTime']();_0x90bb10=Math['round']((_0x413bc2-_0x56d416)/0x3e8);}return{'job_id':_0x54715d[_0x37c351(0x193)],'type':_0x54715d['type'],'status':_0x54715d['status'],'user_name':_0x54715d[_0x37c351(0x19d)],'duration_sec':_0x90bb10,'created_at':_0x54715d[_0x37c351(0x1d1)],'started_at':_0x54715d[_0x37c351(0x199)],'end_at':_0x54715d[_0x37c351(0x18d)]};});return await handleSDKOutput(_0x1c6f9c,_0x2e59e3),0x0;}catch(_0x311daa){if(_0x311daa instanceof SDKError)return console[_0x3156f2(0x1d4)](_0x3156f2(0x190)+_0x311daa[_0x3156f2(0x1ae)]),_0x311daa[_0x3156f2(0x1b9)]&&console[_0x3156f2(0x1d4)](_0x3156f2(0x1c4)+_0x311daa[_0x3156f2(0x1b9)]),0x1;throw _0x311daa;}}}export class JobShowCommand extends BaseCommand{[a24_0x23bd53(0x1ab)]='job:show';[a24_0x23bd53(0x1a5)]='Show\x20job\x20details';async['execute'](_0x3cee69){const _0x5362a4=a24_0x23bd53,{options:_0x13bd74,args:_0x1ef47e,tdx:_0x4934ab}=_0x3cee69,_0x19dd33=_0x1ef47e[0x0];if(!_0x19dd33)return console[_0x5362a4(0x1d4)](_0x5362a4(0x1bc)),console['error'](_0x5362a4(0x19c)),0x1;try{const _0x2a0c8f=await withSpinner('Getting\x20job\x20details...',()=>_0x4934ab['jobs']['show'](_0x19dd33),{'verbose':_0x13bd74[_0x5362a4(0x195)]}),_0xc961c3=_0x2a0c8f[_0x5362a4(0x19f)];let _0x392552;if(_0xc961c3[_0x5362a4(0x199)]&&_0xc961c3[_0x5362a4(0x18d)]){const _0x59c918=new Date(_0xc961c3[_0x5362a4(0x199)])['getTime'](),_0x4964d3=new Date(_0xc961c3[_0x5362a4(0x18d)])[_0x5362a4(0x1ce)]();_0x392552=Math[_0x5362a4(0x1c2)]((_0x4964d3-_0x59c918)/0x3e8);}const _0x387411={'job_id':_0xc961c3[_0x5362a4(0x193)],'type':_0xc961c3[_0x5362a4(0x19e)],'status':_0xc961c3[_0x5362a4(0x1c0)],..._0xc961c3[_0x5362a4(0x19d)]&&{'user_name':_0xc961c3[_0x5362a4(0x19d)]},..._0x392552!==undefined&&{'duration_sec':_0x392552},..._0xc961c3[_0x5362a4(0x1d1)]&&{'created_at':_0xc961c3[_0x5362a4(0x1d1)]},..._0xc961c3[_0x5362a4(0x199)]&&{'started_at':_0xc961c3[_0x5362a4(0x199)]},..._0xc961c3[_0x5362a4(0x18d)]&&{'end_at':_0xc961c3['end_at']},..._0xc961c3[_0x5362a4(0x1ca)]&&{'database':_0xc961c3[_0x5362a4(0x1ca)]},..._0xc961c3[_0x5362a4(0x1a6)]!==undefined&&{'priority':_0xc961c3[_0x5362a4(0x1a6)]},..._0xc961c3[_0x5362a4(0x1cf)]&&{'url':_0xc961c3[_0x5362a4(0x1cf)]},..._0xc961c3[_0x5362a4(0x1bb)]&&{'query':_0xc961c3[_0x5362a4(0x1bb)]},..._0xc961c3[_0x5362a4(0x189)]&&{'debug':_0xc961c3[_0x5362a4(0x189)]}};return await handleSingleObjectOutput(_0x387411,_0x13bd74),0x0;}catch(_0x583ccb){if(_0x583ccb instanceof SDKError)return console[_0x5362a4(0x1d4)]('Error:\x20'+_0x583ccb[_0x5362a4(0x1ae)]),_0x583ccb['cause']&&console['error'](_0x5362a4(0x1c4)+_0x583ccb[_0x5362a4(0x1b9)]),0x1;throw _0x583ccb;}}}export class JobKillCommand extends BaseCommand{[a24_0x23bd53(0x1ab)]=a24_0x23bd53(0x1d0);['description']=a24_0x23bd53(0x1c8);async[a24_0x23bd53(0x19a)](_0x1ce50a){const _0x59344f=a24_0x23bd53,{options:_0x2f3a0c,args:_0x11694a,tdx:_0x377919}=_0x1ce50a,_0x5c7b10=_0x11694a[0x0];if(!_0x5c7b10)return console[_0x59344f(0x1d4)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x59344f(0x1d4)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x2f3a0c[_0x59344f(0x1c5)]){const _0x29b37c=await confirm(_0x59344f(0x1b7)+_0x5c7b10+'?');if(!_0x29b37c)return console[_0x59344f(0x1d4)](_0x59344f(0x1b8)),0x0;}return await withSpinner(_0x59344f(0x1c9),()=>_0x377919['jobs'][_0x59344f(0x18c)](_0x5c7b10),{'verbose':_0x2f3a0c[_0x59344f(0x195)]}),console['error'](_0x59344f(0x1a8)+_0x5c7b10),console[_0x59344f(0x1d4)](_0x59344f(0x1bf)+_0x5c7b10+_0x59344f(0x1af)),0x0;}catch(_0x168a48){if(_0x168a48 instanceof SDKError)return console[_0x59344f(0x1d4)]('Error:\x20'+_0x168a48[_0x59344f(0x1ae)]),_0x168a48[_0x59344f(0x1b9)]&&console[_0x59344f(0x1d4)]('\x20\x20Cause:\x20'+_0x168a48['cause']),0x1;throw _0x168a48;}}}export class JobSubmitCommand extends BaseCommand{['name']=a24_0x23bd53(0x1b6);[a24_0x23bd53(0x1a5)]=a24_0x23bd53(0x1c3);async[a24_0x23bd53(0x19a)](_0x538365){const _0x3dce40=a24_0x23bd53,{options:_0x3a707d,args:_0x20a131,tdx:_0xcc9578}=_0x538365;try{const _0x364af5=_0x3a707d[_0x3dce40(0x1be)]||_0x3dce40(0x198),_0x17ead8=_0x3a707d[_0x3dce40(0x18b)],_0x10457e=_0x3a707d['database']||'information_schema';if(_0x364af5!=='trino'&&_0x364af5!==_0x3dce40(0x1ba))return console[_0x3dce40(0x1d4)](_0x3dce40(0x1a0)),0x1;let _0x4dbf3a;if(_0x17ead8){if(_0x20a131[0x0])return console[_0x3dce40(0x1d4)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x52ae4a=readSqlStatementsFromFile(_0x17ead8);if(_0x52ae4a[_0x3dce40(0x1d2)]===0x0)return console['error'](_0x3dce40(0x1cc)),0x1;if(_0x52ae4a[_0x3dce40(0x1d2)]>0x1)return console[_0x3dce40(0x1d4)](_0x3dce40(0x1b5)),0x1;_0x4dbf3a=_0x52ae4a[0x0];}else{if(!_0x20a131[0x0])return console[_0x3dce40(0x1d4)](_0x3dce40(0x1bd)),console['error']('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0x4dbf3a=_0x20a131[0x0];}_0x3a707d[_0x3dce40(0x195)]&&(console[_0x3dce40(0x1d4)](_0x3dce40(0x1ad)+_0x364af5),console['error'](_0x3dce40(0x1c1)+_0x10457e),console[_0x3dce40(0x1d4)](_0x3dce40(0x1d5)+_0x4dbf3a['substring'](0x0,0x64)+(_0x4dbf3a[_0x3dce40(0x1d2)]>0x64?_0x3dce40(0x1a2):'')));const _0x25e43b=await withSpinner(_0x3dce40(0x196),()=>_0xcc9578['jobs']['submit'](_0x10457e,_0x4dbf3a,_0x364af5),{'verbose':_0x3a707d['verbose']}),_0x530c78=_0x25e43b['data'];return console[_0x3dce40(0x1d4)](_0x3dce40(0x197)),console[_0x3dce40(0x1d4)](_0x3dce40(0x1b1)+_0x530c78['job_id']),await handleSDKOutput([_0x530c78],_0x3a707d),0x0;}catch(_0x29a8d7){if(_0x29a8d7 instanceof SDKError)return console[_0x3dce40(0x1d4)](_0x3dce40(0x190)+_0x29a8d7[_0x3dce40(0x1ae)]),_0x29a8d7[_0x3dce40(0x1b9)]&&console[_0x3dce40(0x1d4)](_0x3dce40(0x1c4)+_0x29a8d7[_0x3dce40(0x1b9)]),0x1;throw _0x29a8d7;}}}export class JobResultCommand extends BaseCommand{[a24_0x23bd53(0x1ab)]='job:result';[a24_0x23bd53(0x1a5)]=a24_0x23bd53(0x18f);async[a24_0x23bd53(0x19a)](_0x2e335e){const _0x366368=a24_0x23bd53,{options:_0x54a84b,args:_0x2e81f7,tdx:_0x33c031}=_0x2e335e,_0x3b3b4f=_0x2e81f7[0x0];if(!_0x3b3b4f)return console['error'](_0x366368(0x1bc)),console['error']('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0x356c17=await withSpinner(_0x366368(0x192),()=>_0x33c031[_0x366368(0x1a9)][_0x366368(0x191)](_0x3b3b4f),{'verbose':_0x54a84b[_0x366368(0x195)]}),_0x5275fb=_0x356c17[_0x366368(0x19f)];return console['error']('✔\x20Retrieved\x20'+_0x5275fb['length']+_0x366368(0x1b2)+(_0x5275fb[_0x366368(0x1d2)]!==0x1?'s':'')),await handleSDKOutput(_0x5275fb,_0x54a84b),0x0;}catch(_0x3db591){if(_0x3db591 instanceof SDKError)return console['error']('Error:\x20'+_0x3db591[_0x366368(0x1ae)]),_0x3db591['cause']&&console[_0x366368(0x1d4)]('\x20\x20Cause:\x20'+_0x3db591[_0x366368(0x1b9)]),0x1;throw _0x3db591;}}}
1
+ function a24_0x16ed(_0x2cf33b,_0x2d4970){_0x2cf33b=_0x2cf33b-0x194;const _0x46a4b5=a24_0x46a4();let _0x16ed73=_0x46a4b5[_0x2cf33b];return _0x16ed73;}const a24_0x3cf15e=a24_0x16ed;(function(_0x3addee,_0x49df55){const _0x32f6c7=a24_0x16ed,_0x4141da=_0x3addee();while(!![]){try{const _0x573067=-parseInt(_0x32f6c7(0x1c3))/0x1*(parseInt(_0x32f6c7(0x1df))/0x2)+-parseInt(_0x32f6c7(0x1c8))/0x3*(-parseInt(_0x32f6c7(0x1b5))/0x4)+parseInt(_0x32f6c7(0x1dc))/0x5*(parseInt(_0x32f6c7(0x1a1))/0x6)+-parseInt(_0x32f6c7(0x1cd))/0x7*(parseInt(_0x32f6c7(0x1db))/0x8)+-parseInt(_0x32f6c7(0x1c7))/0x9*(-parseInt(_0x32f6c7(0x1cf))/0xa)+parseInt(_0x32f6c7(0x19f))/0xb+parseInt(_0x32f6c7(0x1e7))/0xc*(-parseInt(_0x32f6c7(0x198))/0xd);if(_0x573067===_0x49df55)break;else _0x4141da['push'](_0x4141da['shift']());}catch(_0x4923a5){_0x4141da['push'](_0x4141da['shift']());}}}(a24_0x46a4,0xdea5c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a24_0x46a4(){const _0x45eb0a=['Error:\x20','13292192zIxVnv','5aZlKLP','status','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','2hbuGHx','Usage:\x20job\x20show\x20<job-id>','type','start_at','Get\x20job\x20results','✔\x20Job\x20submitted','end_at','Getting\x20job\x20details...','1484232KCuOTu','Cancelled','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','database','Show\x20job\x20details','\x20\x20Cause:\x20','job:kill','26OuMeWp','Usage:\x20job\x20result\x20<job-id>','Listing\x20jobs...','created_at','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','show','url','17946500mZdZiG','\x20\x20Job\x20ID:\x20','5911962hyOoFG','error','Error:\x20Query\x20is\x20required','trino','job:submit','user_name','limit','✔\x20Found\x20','\x20jobs','name','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','execute','List\x20jobs','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','query','Status\x20filter:\x20','map','hive','\x27\x20to\x20verify\x20the\x20job\x20status','cause','2606276ZKiJTv','Getting\x20job\x20results...','information_schema','round','length','jobs','file','job:result','description','result','submit','Error:\x20Job\x20ID\x20is\x20required','priority','Submit\x20a\x20job','1194417gQqpIO','data','jobType','yes','6721929eBUhtZ','3MaHqMY','Query:\x20','verbose','Job\x20type:\x20','Usage:\x20job\x20kill\x20<job-id>','7HHFdFm','job_id','10fYUALa','Submitting\x20job...','message','Kill\x20a\x20job','list','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','debug','getTime','...','Limit:\x20','kill'];a24_0x46a4=function(){return _0x45eb0a;};return a24_0x46a4();}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a24_0x3cf15e(0x1aa)]=a24_0x3cf15e(0x1ba);[a24_0x3cf15e(0x1bd)]=a24_0x3cf15e(0x1ad);async[a24_0x3cf15e(0x1ac)](_0x1a709a){const _0x214c93=a24_0x3cf15e,{options:_0x23a574,tdx:_0x56c3f5}=_0x1a709a;try{const _0x31ce28=resolveLimit(_0x23a574[_0x214c93(0x1a7)],DEFAULT_DISPLAY_LIMIT),_0x2c3b90=_0x23a574['status'];_0x23a574[_0x214c93(0x1ca)]&&(console[_0x214c93(0x1a2)](_0x214c93(0x1d8)+_0x31ce28+_0x214c93(0x1a9)),_0x2c3b90&&console[_0x214c93(0x1a2)](_0x214c93(0x1b0)+_0x2c3b90));const _0x24018f=await withSpinner(_0x214c93(0x19a),()=>_0x56c3f5[_0x214c93(0x1ba)][_0x214c93(0x1d3)]({'from':0x0,'to':_0x31ce28-0x1,'status':_0x2c3b90}),{'verbose':_0x23a574[_0x214c93(0x1ca)]}),_0x39d0da=_0x24018f[_0x214c93(0x1c4)];console['error'](_0x214c93(0x1a8)+_0x39d0da['length']+'\x20job'+(_0x39d0da['length']!==0x1?'s':''));const _0x9516ad=_0x39d0da[_0x214c93(0x1b1)](_0x5dc62f=>{const _0x37f3ce=_0x214c93;let _0x969675;if(_0x5dc62f['start_at']&&_0x5dc62f['end_at']){const _0x38b526=new Date(_0x5dc62f[_0x37f3ce(0x1e2)])[_0x37f3ce(0x1d6)](),_0x485fa7=new Date(_0x5dc62f[_0x37f3ce(0x1e5)])[_0x37f3ce(0x1d6)]();_0x969675=Math[_0x37f3ce(0x1b8)]((_0x485fa7-_0x38b526)/0x3e8);}return{'job_id':_0x5dc62f[_0x37f3ce(0x1ce)],'type':_0x5dc62f[_0x37f3ce(0x1e1)],'status':_0x5dc62f['status'],'user_name':_0x5dc62f[_0x37f3ce(0x1a6)],'duration_sec':_0x969675,'created_at':_0x5dc62f[_0x37f3ce(0x19b)],'started_at':_0x5dc62f[_0x37f3ce(0x1e2)],'end_at':_0x5dc62f['end_at']};});return await handleSDKOutput(_0x9516ad,_0x23a574),0x0;}catch(_0x4816c2){if(_0x4816c2 instanceof SDKError)return console[_0x214c93(0x1a2)](_0x214c93(0x1da)+_0x4816c2[_0x214c93(0x1d1)]),_0x4816c2['cause']&&console[_0x214c93(0x1a2)](_0x214c93(0x196)+_0x4816c2[_0x214c93(0x1b4)]),0x1;throw _0x4816c2;}}}export class JobShowCommand extends BaseCommand{[a24_0x3cf15e(0x1aa)]='job:show';[a24_0x3cf15e(0x1bd)]=a24_0x3cf15e(0x195);async['execute'](_0x3a489e){const _0x427f5e=a24_0x3cf15e,{options:_0x98cc2e,args:_0x170125,tdx:_0x287d31}=_0x3a489e,_0x345955=_0x170125[0x0];if(!_0x345955)return console[_0x427f5e(0x1a2)](_0x427f5e(0x1c0)),console['error'](_0x427f5e(0x1e0)),0x1;try{const _0x3dc788=await withSpinner(_0x427f5e(0x1e6),()=>_0x287d31[_0x427f5e(0x1ba)][_0x427f5e(0x19d)](_0x345955),{'verbose':_0x98cc2e[_0x427f5e(0x1ca)]}),_0x26295b=_0x3dc788['data'];let _0x2955cc;if(_0x26295b[_0x427f5e(0x1e2)]&&_0x26295b[_0x427f5e(0x1e5)]){const _0x103ddc=new Date(_0x26295b['start_at'])[_0x427f5e(0x1d6)](),_0xba31e5=new Date(_0x26295b[_0x427f5e(0x1e5)])['getTime']();_0x2955cc=Math[_0x427f5e(0x1b8)]((_0xba31e5-_0x103ddc)/0x3e8);}const _0x17096b={'job_id':_0x26295b[_0x427f5e(0x1ce)],'type':_0x26295b[_0x427f5e(0x1e1)],'status':_0x26295b[_0x427f5e(0x1dd)],..._0x26295b[_0x427f5e(0x1a6)]&&{'user_name':_0x26295b[_0x427f5e(0x1a6)]},..._0x2955cc!==undefined&&{'duration_sec':_0x2955cc},..._0x26295b[_0x427f5e(0x19b)]&&{'created_at':_0x26295b['created_at']},..._0x26295b[_0x427f5e(0x1e2)]&&{'started_at':_0x26295b[_0x427f5e(0x1e2)]},..._0x26295b['end_at']&&{'end_at':_0x26295b[_0x427f5e(0x1e5)]},..._0x26295b[_0x427f5e(0x194)]&&{'database':_0x26295b[_0x427f5e(0x194)]},..._0x26295b[_0x427f5e(0x1c1)]!==undefined&&{'priority':_0x26295b[_0x427f5e(0x1c1)]},..._0x26295b[_0x427f5e(0x19e)]&&{'url':_0x26295b[_0x427f5e(0x19e)]},..._0x26295b['query']&&{'query':_0x26295b[_0x427f5e(0x1af)]},..._0x26295b[_0x427f5e(0x1d5)]&&{'debug':_0x26295b[_0x427f5e(0x1d5)]}};return await handleSingleObjectOutput(_0x17096b,_0x98cc2e),0x0;}catch(_0x7ac6af){if(_0x7ac6af instanceof SDKError)return console[_0x427f5e(0x1a2)](_0x427f5e(0x1da)+_0x7ac6af[_0x427f5e(0x1d1)]),_0x7ac6af[_0x427f5e(0x1b4)]&&console[_0x427f5e(0x1a2)](_0x427f5e(0x196)+_0x7ac6af[_0x427f5e(0x1b4)]),0x1;throw _0x7ac6af;}}}export class JobKillCommand extends BaseCommand{[a24_0x3cf15e(0x1aa)]=a24_0x3cf15e(0x197);[a24_0x3cf15e(0x1bd)]=a24_0x3cf15e(0x1d2);async['execute'](_0x58d702){const _0x5018d4=a24_0x3cf15e,{options:_0x1c87c8,args:_0x36febe,tdx:_0x561530}=_0x58d702,_0x5f1de8=_0x36febe[0x0];if(!_0x5f1de8)return console[_0x5018d4(0x1a2)](_0x5018d4(0x1c0)),console['error'](_0x5018d4(0x1cc)),0x1;try{if(!_0x1c87c8[_0x5018d4(0x1c6)]){const _0x5966f6=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x5f1de8+'?');if(!_0x5966f6)return console[_0x5018d4(0x1a2)](_0x5018d4(0x1e8)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x561530[_0x5018d4(0x1ba)][_0x5018d4(0x1d9)](_0x5f1de8),{'verbose':_0x1c87c8['verbose']}),console['error'](_0x5018d4(0x1ae)+_0x5f1de8),console[_0x5018d4(0x1a2)](_0x5018d4(0x19c)+_0x5f1de8+_0x5018d4(0x1b3)),0x0;}catch(_0x9c5db6){if(_0x9c5db6 instanceof SDKError)return console[_0x5018d4(0x1a2)](_0x5018d4(0x1da)+_0x9c5db6[_0x5018d4(0x1d1)]),_0x9c5db6['cause']&&console[_0x5018d4(0x1a2)](_0x5018d4(0x196)+_0x9c5db6[_0x5018d4(0x1b4)]),0x1;throw _0x9c5db6;}}}export class JobSubmitCommand extends BaseCommand{[a24_0x3cf15e(0x1aa)]=a24_0x3cf15e(0x1a5);[a24_0x3cf15e(0x1bd)]=a24_0x3cf15e(0x1c2);async[a24_0x3cf15e(0x1ac)](_0x89c2c9){const _0x54d5a7=a24_0x3cf15e,{options:_0x106559,args:_0x3ecea4,tdx:_0x259d4c}=_0x89c2c9;try{const _0x11d2e6=_0x106559[_0x54d5a7(0x1c5)]||_0x54d5a7(0x1a4),_0x386fcb=_0x106559[_0x54d5a7(0x1bb)],_0xc888d7=_0x106559[_0x54d5a7(0x194)]||_0x54d5a7(0x1b7);if(_0x11d2e6!=='trino'&&_0x11d2e6!==_0x54d5a7(0x1b2))return console[_0x54d5a7(0x1a2)]('Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'),0x1;let _0x24f76d;if(_0x386fcb){if(_0x3ecea4[0x0])return console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1ab)),0x1;const _0x2e74b8=readSqlStatementsFromFile(_0x386fcb);if(_0x2e74b8[_0x54d5a7(0x1b9)]===0x0)return console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1e9)),0x1;if(_0x2e74b8['length']>0x1)return console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1de)),0x1;_0x24f76d=_0x2e74b8[0x0];}else{if(!_0x3ecea4[0x0])return console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1a3)),console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1d4)),0x1;_0x24f76d=_0x3ecea4[0x0];}_0x106559[_0x54d5a7(0x1ca)]&&(console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1cb)+_0x11d2e6),console[_0x54d5a7(0x1a2)]('Database:\x20'+_0xc888d7),console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1c9)+_0x24f76d['substring'](0x0,0x64)+(_0x24f76d[_0x54d5a7(0x1b9)]>0x64?_0x54d5a7(0x1d7):'')));const _0x445f7a=await withSpinner(_0x54d5a7(0x1d0),()=>_0x259d4c[_0x54d5a7(0x1ba)][_0x54d5a7(0x1bf)](_0xc888d7,_0x24f76d,_0x11d2e6),{'verbose':_0x106559[_0x54d5a7(0x1ca)]}),_0x5769cc=_0x445f7a[_0x54d5a7(0x1c4)];return console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1e4)),console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1a0)+_0x5769cc[_0x54d5a7(0x1ce)]),await handleSDKOutput([_0x5769cc],_0x106559),0x0;}catch(_0x579df2){if(_0x579df2 instanceof SDKError)return console[_0x54d5a7(0x1a2)](_0x54d5a7(0x1da)+_0x579df2[_0x54d5a7(0x1d1)]),_0x579df2[_0x54d5a7(0x1b4)]&&console['error']('\x20\x20Cause:\x20'+_0x579df2[_0x54d5a7(0x1b4)]),0x1;throw _0x579df2;}}}export class JobResultCommand extends BaseCommand{[a24_0x3cf15e(0x1aa)]=a24_0x3cf15e(0x1bc);[a24_0x3cf15e(0x1bd)]=a24_0x3cf15e(0x1e3);async[a24_0x3cf15e(0x1ac)](_0x372681){const _0x137719=a24_0x3cf15e,{options:_0x587378,args:_0x3a235a,tdx:_0x28f339}=_0x372681,_0x156439=_0x3a235a[0x0];if(!_0x156439)return console[_0x137719(0x1a2)](_0x137719(0x1c0)),console['error'](_0x137719(0x199)),0x1;try{const _0x43e4b3=await withSpinner(_0x137719(0x1b6),()=>_0x28f339[_0x137719(0x1ba)][_0x137719(0x1be)](_0x156439),{'verbose':_0x587378['verbose']}),_0x42ab92=_0x43e4b3['data'];return console[_0x137719(0x1a2)]('✔\x20Retrieved\x20'+_0x42ab92[_0x137719(0x1b9)]+'\x20row'+(_0x42ab92[_0x137719(0x1b9)]!==0x1?'s':'')),await handleSDKOutput(_0x42ab92,_0x587378),0x0;}catch(_0x580810){if(_0x580810 instanceof SDKError)return console['error']('Error:\x20'+_0x580810['message']),_0x580810[_0x137719(0x1b4)]&&console[_0x137719(0x1a2)](_0x137719(0x196)+_0x580810['cause']),0x1;throw _0x580810;}}}
@@ -1 +1 @@
1
- const a25_0x175ab7=a25_0x10d4;(function(_0x4af31f,_0x53ce1a){const _0xd06bfb=a25_0x10d4,_0x183759=_0x4af31f();while(!![]){try{const _0x2d8993=-parseInt(_0xd06bfb(0x213))/0x1+parseInt(_0xd06bfb(0x1e9))/0x2+parseInt(_0xd06bfb(0x1f5))/0x3+parseInt(_0xd06bfb(0x1c4))/0x4*(-parseInt(_0xd06bfb(0x1f9))/0x5)+parseInt(_0xd06bfb(0x192))/0x6*(parseInt(_0xd06bfb(0x1fd))/0x7)+-parseInt(_0xd06bfb(0x1c3))/0x8*(parseInt(_0xd06bfb(0x1bf))/0x9)+parseInt(_0xd06bfb(0x1d7))/0xa*(parseInt(_0xd06bfb(0x1e3))/0xb);if(_0x2d8993===_0x53ce1a)break;else _0x183759['push'](_0x183759['shift']());}catch(_0x5b12cb){_0x183759['push'](_0x183759['shift']());}}}(a25_0x5800,0x7631d));import a25_0x3058f5 from'chalk';import a25_0x102f81 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{apiToYamlAsync,toYamlString}from'../sdk/segment/journey-yaml.js';import{apiRuleToYaml}from'../sdk/segment/child-segment-yaml.js';import{getSegmentRootDir,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';function a25_0x10d4(_0x5ed995,_0x10a211){_0x5ed995=_0x5ed995-0x186;const _0x580072=a25_0x5800();let _0x10d4c3=_0x580072[_0x5ed995];return _0x10d4c3;}import{sanitizeFileName}from'../utils/string-utils.js';const SEGMENT_KIND_JOURNEY=0x3;function formatJourneyState(_0x490e05){const _0x119127=a25_0x10d4;switch(_0x490e05){case'launched':return a25_0x3058f5[_0x119127(0x1ba)](_0x490e05);case'draft':return a25_0x3058f5['gray'](_0x490e05);case'archived':return a25_0x3058f5[_0x119127(0x219)](_0x490e05);default:return _0x490e05;}}function formatJourneyItem(_0x33a0aa,_0x55a8bb=''){const _0x32a72c=a25_0x10d4,_0x3925af=formatJourneyState(_0x33a0aa[_0x32a72c(0x1a9)]),_0x279bec=_0x33a0aa[_0x32a72c(0x1f6)]?a25_0x3058f5['yellow']('\x20(paused)'):'';return _0x55a8bb+_0x32a72c(0x18b)+_0x33a0aa[_0x32a72c(0x212)]+'\x20('+_0x3925af+')'+_0x279bec;}function escapeRegex(_0x2cb926){const _0x425906=a25_0x10d4;return _0x2cb926[_0x425906(0x210)](/[.*+?^${}()|[\]\\]/g,_0x425906(0x1f0));}function globToRegex(_0x582e04){const _0x37b743=a25_0x10d4,_0x1af6e2=_0x582e04[_0x37b743(0x1e0)]('*')[_0x37b743(0x201)](escapeRegex);return new RegExp(_0x1af6e2[_0x37b743(0x1a1)]('.*'),'i');}function resolveJourneyTarget(_0x4f5c6a,_0x375d0a,_0x532754){const _0x366624=a25_0x10d4;if(isYamlFilePath(_0x4f5c6a))try{const _0x3c76e2=resolveYamlFilePath(_0x4f5c6a);return _0x532754&&(console[_0x366624(0x19a)](_0x366624(0x1b5)+_0x4f5c6a),console['error'](_0x366624(0x1cd)+_0x3c76e2[_0x366624(0x1fa)]),console[_0x366624(0x19a)](_0x366624(0x21b)+_0x3c76e2[_0x366624(0x1aa)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x3c76e2[_0x366624(0x190)]||_0x366624(0x1e5)))),{'journeyName':_0x3c76e2['segmentName'],'parentSegment':_0x3c76e2[_0x366624(0x1fa)],'resolved':_0x3c76e2};}catch(_0x5eda09){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x5eda09[_0x366624(0x1a0)]);}if(!_0x375d0a)throw new SDKError(ErrorCode[_0x366624(0x1c6)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x4f5c6a,'parentSegment':_0x375d0a};}function a25_0x5800(){const _0x9dd462=['resolveParentId','split','✔\x20Found\x20','\x20journey','33zongiX','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','(root)','yaml','cyan','toLowerCase','451556bmjYQe','yes','Export\x20journey(s)\x20as\x20YAML\x20files','getParentFull','✔\x20Pulled\x20','totalEntered','\x22\x20resumed','\x5c$&','length','stages','audienceId','cwd','956106GeqVwq','paused','goal','Input:\x20','190yYDxeX','parentSegment','getJourney','log','180649wxzJKz','\x20\x20Statistics\x20not\x20available','listFolders','Fetching\x20folders...','map','isNew','\x20new\x20files','Found\x20existing\x20tdx.json\x20at:\x20','Usage:\x20journey\x20view\x20<name-or-path>','format','getSegment','\x20(ID:\x20','launched','Fetching\x20','journey:pause','Resume\x20a\x20paused\x20journey','draft','name','\x22\x20paused','replace','push','journeyBundleName','314415CNNDWZ','absolutePath','table','kind','✔\x20Journey\x20\x22','latest','dim','Pattern:\x20','\x20\x20Name:\x20','.yml','totalGoalAchieved','Show\x20journey\x20details','\x22\x20not\x20found','📁\x20','Resuming\x20journey...','Resolving\x20parent\x20segment...','hasChanges','values','find','data','Warning:\x20Could\x20not\x20resolve\x20segment\x20','includeStats','\x20journey\x20files\x20to\x20','journeyStages','content','Usage:\x20journey\x20stats\x20<name-or-path>','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','item','resolveJourneyId','...','🗺️\x20','diff','Using\x20parent\x20segment:\x20','population','yellow','folderPath','Usage:\x20journey\x20resume\x20<name-or-path>','18DOswuo','filter','\x20\x20Target:\x20','get','verbose','goalRate','version_number','Getting\x20journey\x20details...','error','Parent\x20segment:\x20','Listing\x20journeys...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','versionNumber','journey','message','join','size','Warning:\x20Stage\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','resume','Resolving\x20journey...','journeyName','\x20changed\x20files','state','segmentName','\x20files?','segments','No\x20journeys\x20found','bundle_id','Error:\x20Journey\x20not\x20found:\x20','folderId','rule','exited','stage','version','Resolved\x20YAML\x20file:\x20','Cancelled','No\x20statistics\x20available\x20for\x20journey:\x20','journeyBundleId','repeat','green','journey:resume','attributes','Pausing\x20journey...','Fetching\x20parent\x20segment...','3750291RbCENm','bundle_name','conversionRate','journeyId','8mXUsDL','82588WibrBJ','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','INVALID_ARGUMENT','journey:list','entered','has','description','Aborted.','stageName','\x20\x20Parent\x20segment:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','all','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','max','segment','set','Getting\x20journey\x20statistics...','Write\x20','utf-8','4593080OOCNJN','journey:pull','Usage:\x20journey\x20pause\x20<name-or-path>','dirname','test','reentryMode','\x20unchanged\x20files','execute'];a25_0x5800=function(){return _0x9dd462;};return a25_0x5800();}export class JourneyListCommand extends BaseCommand{['name']=a25_0x175ab7(0x1c7);[a25_0x175ab7(0x1ca)]='List\x20journeys\x20in\x20current\x20context';async[a25_0x175ab7(0x1de)](_0x318cae){const _0x5cc63e=a25_0x175ab7,{options:_0x30fd6b,args:_0x130090,tdx:_0x3109b2}=_0x318cae,_0xfb5520=_0x130090[0x0],_0x5d45df=_0x30fd6b[_0x5cc63e(0x1fa)];if(!_0x5d45df)return console[_0x5cc63e(0x19a)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x5cc63e(0x19a)](_0x5cc63e(0x1d0)),0x1;const _0x2be339=await withSpinner(_0x5cc63e(0x222),()=>_0x3109b2[_0x5cc63e(0x1d2)][_0x5cc63e(0x1df)](_0x5d45df),{'verbose':_0x30fd6b[_0x5cc63e(0x196)]}),_0x33230f=_0x2be339[_0x5cc63e(0x226)];_0x30fd6b['verbose']&&(console[_0x5cc63e(0x19a)](_0x5cc63e(0x19b)+_0x5d45df+_0x5cc63e(0x208)+_0x33230f+')'),_0xfb5520&&console[_0x5cc63e(0x19a)](_0x5cc63e(0x21a)+_0xfb5520));const [_0x404c48,_0x173f8c,_0x68ee]=await Promise[_0x5cc63e(0x1cf)]([withSpinner(_0x5cc63e(0x1be),()=>_0x3109b2[_0x5cc63e(0x1d2)][_0x5cc63e(0x1ec)](_0x33230f),{'verbose':_0x30fd6b[_0x5cc63e(0x196)]}),withSpinner(_0x5cc63e(0x200),()=>_0x3109b2[_0x5cc63e(0x1d2)][_0x5cc63e(0x1ff)](_0x33230f),{'verbose':_0x30fd6b[_0x5cc63e(0x196)]}),withSpinner(_0x5cc63e(0x19c),()=>_0x3109b2[_0x5cc63e(0x19f)]['listJourneysFromParentSegment'](_0x33230f),{'verbose':_0x30fd6b[_0x5cc63e(0x196)]})]),_0x586b8c=_0x404c48[_0x5cc63e(0x226)],_0x8d8a62=_0x173f8c['data'];let _0x2171d2=_0x68ee[_0x5cc63e(0x226)];const _0x2142df=_0x586b8c['rootFolderId'],_0x45e936=new Map();for(const _0x405c0a of _0x8d8a62){_0x45e936[_0x5cc63e(0x1d3)](_0x405c0a['id'],_0x405c0a['name']);}if(_0xfb5520){const _0x50a1b0=globToRegex(_0xfb5520);_0x2171d2=_0x2171d2[_0x5cc63e(0x193)](_0xbb4636=>_0x50a1b0[_0x5cc63e(0x1db)](_0xbb4636[_0x5cc63e(0x212)]));}console[_0x5cc63e(0x19a)](_0x5cc63e(0x1e1)+_0x2171d2['length']+_0x5cc63e(0x1e2)+(_0x2171d2['length']!==0x1?'s':''));if(_0x30fd6b['format']===_0x5cc63e(0x215))await handleSDKOutput(_0x2171d2,_0x30fd6b);else{if(_0x30fd6b[_0x5cc63e(0x206)]==='json')await handleSDKOutput(_0x2171d2,_0x30fd6b);else{console[_0x5cc63e(0x1fc)]('['+_0x5d45df+']');const _0x1ec4ce=new Map(),_0x1725ed=[];for(const _0x4a0035 of _0x2171d2){if(!_0x4a0035[_0x5cc63e(0x1b0)]||_0x4a0035[_0x5cc63e(0x1b0)]===_0x2142df)_0x1725ed['push'](_0x4a0035);else{const _0x5c9d9e=_0x1ec4ce[_0x5cc63e(0x195)](_0x4a0035[_0x5cc63e(0x1b0)])||[];_0x5c9d9e[_0x5cc63e(0x211)](_0x4a0035),_0x1ec4ce[_0x5cc63e(0x1d3)](_0x4a0035[_0x5cc63e(0x1b0)],_0x5c9d9e);}}for(const _0x1a65d6 of _0x1725ed){console[_0x5cc63e(0x1fc)](formatJourneyItem(_0x1a65d6));}for(const [_0x80a39c,_0xde2eda]of _0x1ec4ce){const _0xc2e127=_0x45e936[_0x5cc63e(0x195)](_0x80a39c)||_0x80a39c;console[_0x5cc63e(0x1fc)](_0x5cc63e(0x220)+_0xc2e127);for(const _0x57c01 of _0xde2eda){console[_0x5cc63e(0x1fc)](formatJourneyItem(_0x57c01,'\x20\x20'));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a25_0x175ab7(0x1ca)]=a25_0x175ab7(0x21e);async['execute'](_0x3d0c62){const _0x10413e=a25_0x175ab7,{options:_0x57cb16,args:_0x2b8046,tdx:_0x6b9b26}=_0x3d0c62,_0x4f1df8=_0x2b8046[0x0];if(!_0x4f1df8)return console[_0x10413e(0x19a)](_0x10413e(0x187)),console[_0x10413e(0x19a)](_0x10413e(0x205)),0x1;_0x57cb16[_0x10413e(0x196)]&&console['error'](_0x10413e(0x1f8)+_0x4f1df8);const _0x23a1dc=resolveJourneyTarget(_0x4f1df8,_0x57cb16[_0x10413e(0x1fa)],_0x57cb16[_0x10413e(0x196)]),_0x493a9f=await withSpinner(_0x10413e(0x222),()=>_0x6b9b26['segment'][_0x10413e(0x1df)](_0x23a1dc[_0x10413e(0x1fa)]),{'verbose':_0x57cb16['verbose']}),_0x138f94=_0x493a9f[_0x10413e(0x226)],_0x4cb669=await withSpinner(_0x10413e(0x1a6),()=>_0x6b9b26[_0x10413e(0x19f)]['resolveJourneyId'](_0x138f94,_0x23a1dc[_0x10413e(0x1a7)]),{'verbose':_0x57cb16[_0x10413e(0x196)]}),_0xd59793=_0x4cb669[_0x10413e(0x226)],_0x112405=await withSpinner(_0x10413e(0x199),()=>_0x6b9b26['journey'][_0x10413e(0x1fb)](_0xd59793),{'verbose':_0x57cb16[_0x10413e(0x196)]}),_0x3896d3=_0x112405[_0x10413e(0x226)],_0x541eba=_0x57cb16[_0x10413e(0x228)];let _0x5c7a8c;if(_0x541eba)try{const _0x214ec1=await withSpinner(_0x10413e(0x1d4),()=>_0x6b9b26[_0x10413e(0x19f)]['getStatistics'](_0xd59793),{'verbose':_0x57cb16[_0x10413e(0x196)]});_0x5c7a8c=_0x214ec1[_0x10413e(0x226)];}catch{_0x57cb16[_0x10413e(0x196)]&&console[_0x10413e(0x19a)](_0x10413e(0x1fe));}const _0x35f2be={'id':_0x3896d3['id'],'name':_0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x20e)],'description':_0x3896d3[_0x10413e(0x1bc)]['description'],'state':_0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x1a9)],'paused':_0x3896d3[_0x10413e(0x1bc)]['paused'],'reentry_mode':_0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x1dc)],'stages':_0x3896d3['attributes'][_0x10413e(0x22a)]?.[_0x10413e(0x1f1)]||0x0,..._0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x1f7)]&&{'goal':_0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x1f7)][_0x10413e(0x20e)]},..._0x5c7a8c&&{'statistics':{'total_entered':_0x5c7a8c['totalEntered'],'goal_achieved':_0x5c7a8c[_0x10413e(0x21d)],'goal_rate':_0x5c7a8c['goalRate'],'stages':_0x5c7a8c['stages']}}};return await handleSingleObjectOutput(_0x35f2be,_0x57cb16),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']='journey:stats';[a25_0x175ab7(0x1ca)]='Show\x20journey\x20statistics';async[a25_0x175ab7(0x1de)](_0x536ebf){const _0x8f7866=a25_0x175ab7,{options:_0x454a8f,args:_0x11defc,tdx:_0x527f48}=_0x536ebf,_0xae6838=_0x11defc[0x0];if(!_0xae6838)return console['error'](_0x8f7866(0x187)),console[_0x8f7866(0x19a)](_0x8f7866(0x186)),0x1;_0x454a8f[_0x8f7866(0x196)]&&console['error'](_0x8f7866(0x1f8)+_0xae6838);const _0x34a047=resolveJourneyTarget(_0xae6838,_0x454a8f[_0x8f7866(0x1fa)],_0x454a8f[_0x8f7866(0x196)]),_0x30cfd6=await withSpinner(_0x8f7866(0x222),()=>_0x527f48[_0x8f7866(0x1d2)]['resolveParentId'](_0x34a047[_0x8f7866(0x1fa)]),{'verbose':_0x454a8f[_0x8f7866(0x196)]}),_0x443e07=_0x30cfd6[_0x8f7866(0x226)],_0x5aaac0=await withSpinner(_0x8f7866(0x1a6),()=>_0x527f48[_0x8f7866(0x19f)][_0x8f7866(0x189)](_0x443e07,_0x34a047[_0x8f7866(0x1a7)]),{'verbose':_0x454a8f[_0x8f7866(0x196)]}),_0x54871a=_0x5aaac0[_0x8f7866(0x226)],_0x5e65a0=await withSpinner(_0x8f7866(0x1d4),()=>_0x527f48[_0x8f7866(0x19f)]['getStatistics'](_0x54871a),{'verbose':_0x454a8f[_0x8f7866(0x196)]}),_0x1f8237=_0x5e65a0[_0x8f7866(0x226)];if(!_0x1f8237||_0x1f8237['journeyId']===null)return console[_0x8f7866(0x19a)](_0x8f7866(0x1b7)+_0x34a047[_0x8f7866(0x1a7)]),console[_0x8f7866(0x19a)](_0x8f7866(0x1c5)),0x0;const _0xa186b5={'journey_id':_0x1f8237[_0x8f7866(0x1c2)],'total_entered':_0x1f8237[_0x8f7866(0x1ee)],'goal_achieved':_0x1f8237[_0x8f7866(0x21d)],'goal_rate':_0x1f8237[_0x8f7866(0x197)],'stages':_0x1f8237[_0x8f7866(0x1f2)]?.['map'](_0x44f3ea=>({'name':_0x44f3ea[_0x8f7866(0x1cc)],'population':_0x44f3ea[_0x8f7866(0x18e)],'entered':_0x44f3ea[_0x8f7866(0x1c8)],'exited':_0x44f3ea[_0x8f7866(0x1b2)],'conversion_rate':_0x44f3ea[_0x8f7866(0x1c1)]}))},_0x51a835=_0x454a8f[_0x8f7866(0x1b3)];if(_0x51a835&&_0x1f8237[_0x8f7866(0x1f2)]){const _0x286a36=_0x1f8237[_0x8f7866(0x1f2)][_0x8f7866(0x225)](_0x29a9f2=>_0x29a9f2[_0x8f7866(0x1cc)][_0x8f7866(0x1e8)]()===_0x51a835[_0x8f7866(0x1e8)]());if(_0x286a36)return await handleSingleObjectOutput({'stage_name':_0x286a36['stageName'],'population':_0x286a36[_0x8f7866(0x18e)],'entered':_0x286a36[_0x8f7866(0x1c8)],'exited':_0x286a36[_0x8f7866(0x1b2)],'conversion_rate':_0x286a36[_0x8f7866(0x1c1)]},_0x454a8f),0x0;console[_0x8f7866(0x19a)](_0x8f7866(0x1a3)+_0x51a835+_0x8f7866(0x21f));}return await handleSingleObjectOutput(_0xa186b5,_0x454a8f),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a25_0x175ab7(0x20e)]=a25_0x175ab7(0x20b);[a25_0x175ab7(0x1ca)]='Pause\x20a\x20running\x20journey';async['execute'](_0x3c31d9){const _0x4f8827=a25_0x175ab7,{options:_0x41a617,args:_0x1ac390,tdx:_0x18a3ce}=_0x3c31d9,_0x56e747=_0x1ac390[0x0];if(!_0x56e747)return console['error'](_0x4f8827(0x187)),console[_0x4f8827(0x19a)](_0x4f8827(0x1d9)),0x1;_0x41a617['verbose']&&console[_0x4f8827(0x19a)](_0x4f8827(0x1f8)+_0x56e747);const _0x36e966=resolveJourneyTarget(_0x56e747,_0x41a617['parentSegment'],_0x41a617[_0x4f8827(0x196)]),_0x3dd961=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x18a3ce['segment'][_0x4f8827(0x1df)](_0x36e966[_0x4f8827(0x1fa)]),{'verbose':_0x41a617[_0x4f8827(0x196)]}),_0x8eb344=_0x3dd961[_0x4f8827(0x226)],_0x3ab48e=await withSpinner('Resolving\x20journey...',()=>_0x18a3ce[_0x4f8827(0x19f)]['resolveJourneyId'](_0x8eb344,_0x36e966[_0x4f8827(0x1a7)]),{'verbose':_0x41a617[_0x4f8827(0x196)]}),_0x5d9b30=_0x3ab48e[_0x4f8827(0x226)];if(!_0x41a617[_0x4f8827(0x1ea)]){const _0x47a693=await confirm(_0x4f8827(0x19d)+_0x36e966['journeyName']+'\x22?');if(!_0x47a693)return console['error'](_0x4f8827(0x1b6)),0x0;}const _0x5ae42d=await withSpinner(_0x4f8827(0x1bd),()=>_0x18a3ce[_0x4f8827(0x19f)]['pause'](_0x5d9b30),{'verbose':_0x41a617[_0x4f8827(0x196)]}),_0x2a884b=_0x5ae42d[_0x4f8827(0x226)];return console[_0x4f8827(0x19a)](_0x4f8827(0x217)+_0x2a884b[_0x4f8827(0x1bc)][_0x4f8827(0x20e)]+_0x4f8827(0x20f)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a25_0x175ab7(0x20e)]=a25_0x175ab7(0x1bb);[a25_0x175ab7(0x1ca)]=a25_0x175ab7(0x20c);async[a25_0x175ab7(0x1de)](_0x14ac99){const _0x5be7ad=a25_0x175ab7,{options:_0x28c96c,args:_0x58d390,tdx:_0x1725b0}=_0x14ac99,_0x3b3e6c=_0x58d390[0x0];if(!_0x3b3e6c)return console['error'](_0x5be7ad(0x187)),console['error'](_0x5be7ad(0x191)),0x1;_0x28c96c[_0x5be7ad(0x196)]&&console[_0x5be7ad(0x19a)]('Input:\x20'+_0x3b3e6c);const _0x3f5260=resolveJourneyTarget(_0x3b3e6c,_0x28c96c['parentSegment'],_0x28c96c[_0x5be7ad(0x196)]),_0x573987=await withSpinner(_0x5be7ad(0x222),()=>_0x1725b0[_0x5be7ad(0x1d2)][_0x5be7ad(0x1df)](_0x3f5260[_0x5be7ad(0x1fa)]),{'verbose':_0x28c96c['verbose']}),_0x56e748=_0x573987[_0x5be7ad(0x226)],_0x315eb5=await withSpinner(_0x5be7ad(0x1a6),()=>_0x1725b0[_0x5be7ad(0x19f)][_0x5be7ad(0x189)](_0x56e748,_0x3f5260['journeyName']),{'verbose':_0x28c96c[_0x5be7ad(0x196)]}),_0x22a4f3=_0x315eb5[_0x5be7ad(0x226)];if(!_0x28c96c[_0x5be7ad(0x1ea)]){const _0x4f3a69=await confirm(_0x5be7ad(0x1e4)+_0x3f5260[_0x5be7ad(0x1a7)]+'\x22?');if(!_0x4f3a69)return console[_0x5be7ad(0x19a)](_0x5be7ad(0x1b6)),0x0;}const _0x15edef=await withSpinner(_0x5be7ad(0x221),()=>_0x1725b0[_0x5be7ad(0x19f)][_0x5be7ad(0x1a5)](_0x22a4f3),{'verbose':_0x28c96c[_0x5be7ad(0x196)]}),_0x3dca1d=_0x15edef['data'];return console[_0x5be7ad(0x19a)](_0x5be7ad(0x217)+_0x3dca1d[_0x5be7ad(0x1bc)][_0x5be7ad(0x20e)]+_0x5be7ad(0x1ef)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a25_0x175ab7(0x20e)]=a25_0x175ab7(0x1d8);['description']=a25_0x175ab7(0x1eb);async[a25_0x175ab7(0x1de)](_0x2c0fee){const _0x2c5895=a25_0x175ab7,{options:_0x1575ad,args:_0x3aedfb,tdx:_0x1e82ec}=_0x2c0fee,_0x2521e2=_0x1575ad,_0xac4b83=_0x3aedfb[0x0],_0x5de7f9=findTdxConfigPath();let _0x2798de,_0x3e5b94;if(_0x5de7f9){const _0x55246c=loadTdxConfig(_0x5de7f9);_0x2798de=_0x55246c['parent_segment'],_0x3e5b94=a25_0x102f81[_0x2c5895(0x1da)](_0x5de7f9),_0x2521e2[_0x2c5895(0x196)]&&(console[_0x2c5895(0x19a)](_0x2c5895(0x204)+_0x5de7f9),console[_0x2c5895(0x19a)](_0x2c5895(0x18d)+_0x2798de));}else{_0x2798de=_0x1575ad[_0x2c5895(0x1fa)];if(!_0x2798de)return console[_0x2c5895(0x19a)](a25_0x3058f5[_0x2c5895(0x18f)]('Parent\x20segment\x20context\x20not\x20set.\x0a')),console[_0x2c5895(0x19a)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x2c5895(0x19a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x2c5895(0x1ce)),0x1;_0x3e5b94=getSegmentRootDir(sanitizeFileName(_0x2798de));}const _0x59d879=await withSpinner(_0x2c5895(0x222),()=>_0x1e82ec[_0x2c5895(0x1d2)][_0x2c5895(0x1df)](_0x2798de),{'verbose':_0x1575ad[_0x2c5895(0x196)]}),_0x13d461=_0x59d879[_0x2c5895(0x226)],_0x21c885=await withSpinner(_0x2c5895(0x19c),()=>_0x1e82ec[_0x2c5895(0x19f)]['listJourneysFromParentSegment'](_0x13d461),{'verbose':_0x1575ad[_0x2c5895(0x196)]});let _0x32ed1f=_0x21c885['data'];if(_0xac4b83){const _0x5a258c=_0x32ed1f['filter'](_0x1189d9=>_0x1189d9[_0x2c5895(0x212)][_0x2c5895(0x1e8)]()===_0xac4b83[_0x2c5895(0x1e8)]());if(_0x5a258c[_0x2c5895(0x1f1)]===0x0)return console[_0x2c5895(0x19a)](_0x2c5895(0x1af)+_0xac4b83),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x32ed1f=_0x5a258c;}if(_0x32ed1f['length']===0x0)return console[_0x2c5895(0x19a)](_0x2c5895(0x1ad)),0x0;const _0x3269b2=new Map();for(const _0x2487fa of _0x32ed1f){const _0xb2d4c1=_0x2487fa[_0x2c5895(0x1b8)];!_0x3269b2[_0x2c5895(0x1c9)](_0xb2d4c1)&&_0x3269b2[_0x2c5895(0x1d3)](_0xb2d4c1,[]),_0x3269b2[_0x2c5895(0x195)](_0xb2d4c1)['push'](_0x2487fa);}for(const _0x1e04f0 of _0x3269b2[_0x2c5895(0x224)]()){_0x1e04f0['sort']((_0x166853,_0x5dffed)=>(_0x166853[_0x2c5895(0x19e)]||0x0)-(_0x5dffed[_0x2c5895(0x19e)]||0x0));}const _0x519287=[];for(const _0x2b0278 of _0x3269b2['values']()){const _0x25bfdb=_0x2b0278[0x0][_0x2c5895(0x212)],_0x17187d=[];for(const _0x2b5e1a of _0x2b0278){const _0x4fb066=await withSpinner(_0x2c5895(0x20a)+_0x2b5e1a['journeyBundleName']+'\x20v'+(_0x2b5e1a['versionNumber']||0x1)+_0x2c5895(0x18a),()=>_0x1e82ec[_0x2c5895(0x19f)][_0x2c5895(0x1fb)](_0x2b5e1a['id']),{'verbose':_0x1575ad[_0x2c5895(0x196)]}),_0x50e558=_0x4fb066['data'],_0x307d6f=_0x50e558[_0x2c5895(0x1bc)]?.[_0x2c5895(0x1f3)],_0x14e51c={'resolveSegment':async _0x3d871e=>{const _0x24cf6d=_0x2c5895;if(!_0x307d6f)return{'name':_0x3d871e,'isJourneyLocal':![]};try{const _0x4c83e6=await _0x1e82ec['segment'][_0x24cf6d(0x207)](_0x307d6f,_0x3d871e),_0x272742=_0x4c83e6[_0x24cf6d(0x216)]===SEGMENT_KIND_JOURNEY;let _0x53e653;return _0x272742&&_0x4c83e6[_0x24cf6d(0x1b1)]&&(_0x53e653={'description':_0x4c83e6[_0x24cf6d(0x1ca)],'rule':apiRuleToYaml(_0x4c83e6[_0x24cf6d(0x1b1)])}),{'name':_0x4c83e6[_0x24cf6d(0x20e)],'isJourneyLocal':_0x272742,'definition':_0x53e653};}catch(_0xb7d48a){return _0x1575ad[_0x24cf6d(0x196)]&&console[_0x24cf6d(0x19a)](_0x24cf6d(0x227)+_0x3d871e+':\x20'+_0xb7d48a[_0x24cf6d(0x1a0)]),{'name':_0x3d871e,'isJourneyLocal':![]};}}},_0x337737=await apiToYamlAsync(_0x50e558,_0x14e51c);_0x17187d[_0x2c5895(0x211)]({'item':_0x2b5e1a,'yaml':_0x337737});}const _0x301f30=_0x17187d[0x0][_0x2c5895(0x1e6)],_0x51e90b=Math[_0x2c5895(0x1d1)](..._0x17187d['map'](_0x10904a=>_0x10904a[_0x2c5895(0x188)][_0x2c5895(0x19e)]||0x0));let _0x5a6fa9;if(_0x17187d[_0x2c5895(0x1f1)]===0x1)_0x5a6fa9=_0x301f30;else{const _0x140465=_0x17187d['map'](_0x30871b=>{const _0x32b6fb=_0x2c5895,_0x702a0e=(_0x30871b[_0x32b6fb(0x188)]['versionNumber']||0x0)===_0x51e90b,_0x36f4cd={'name':_0x30871b[_0x32b6fb(0x1e6)][_0x32b6fb(0x1b4)]||_0x30871b[_0x32b6fb(0x188)][_0x32b6fb(0x20e)],'state':_0x30871b[_0x32b6fb(0x188)][_0x32b6fb(0x1a9)]==='launched'?_0x32b6fb(0x209):_0x32b6fb(0x20d),'stages':_0x30871b[_0x32b6fb(0x1e6)][_0x32b6fb(0x1f2)]||[],'id':_0x30871b['yaml']['id'],'version_number':_0x30871b['yaml'][_0x32b6fb(0x198)]};return _0x702a0e&&(_0x36f4cd[_0x32b6fb(0x218)]=!![]),_0x36f4cd;});_0x5a6fa9={'type':_0x2c5895(0x19f),'name':_0x301f30[_0x2c5895(0x20e)],'description':_0x301f30[_0x2c5895(0x1ca)],'segments':_0x301f30[_0x2c5895(0x1ac)],'goal':_0x301f30[_0x2c5895(0x1f7)],'reentry':_0x301f30['reentry'],'versions':_0x140465,'bundle_id':_0x301f30[_0x2c5895(0x1ae)],'bundle_name':_0x301f30[_0x2c5895(0x1c0)]};}const _0x45cf2f=toYamlString(_0x5a6fa9),_0x403422=sanitizeFileName(_0x25bfdb),_0x129ae1=a25_0x102f81[_0x2c5895(0x1a1)](_0x3e5b94,_0x403422+_0x2c5895(0x21c)),_0x3f4efe=a25_0x102f81['relative'](process[_0x2c5895(0x1f4)](),_0x129ae1);if(existsSync(_0x129ae1)){const _0x1403b6=readFileSync(_0x129ae1,_0x2c5895(0x1d6)),_0x4c810e=generateDiff(_0x1403b6,_0x45cf2f),_0x24a09f=hasChanges(_0x4c810e);_0x519287[_0x2c5895(0x211)]({'relativePath':_0x3f4efe,'absolutePath':_0x129ae1,'content':_0x45cf2f,'isNew':![],'hasChanges':_0x24a09f,'diff':_0x24a09f?formatDiffWithColors(_0x4c810e):undefined});}else _0x519287[_0x2c5895(0x211)]({'relativePath':_0x3f4efe,'absolutePath':_0x129ae1,'content':_0x45cf2f,'isNew':!![],'hasChanges':![]});}const _0x3dcab9=_0x519287[_0x2c5895(0x193)](_0x24494b=>_0x24494b['isNew']),_0x59c338=_0x519287[_0x2c5895(0x193)](_0x5db6e9=>!_0x5db6e9['isNew']&&_0x5db6e9['hasChanges']),_0x57cf32=_0x519287['filter'](_0x353ee1=>!_0x353ee1[_0x2c5895(0x202)]&&!_0x353ee1[_0x2c5895(0x223)]),_0x5542cc=_0x32ed1f[_0x2c5895(0x1f1)],_0x3dbe69=_0x3269b2[_0x2c5895(0x1a2)],_0x535912=_0x5542cc>_0x3dbe69?'\x20('+_0x5542cc+'\x20versions)':'';console[_0x2c5895(0x19a)]('\x0aPull\x20summary:'),console[_0x2c5895(0x19a)]('\x20\x20'+a25_0x3058f5[_0x2c5895(0x1e7)](_0x3dbe69+'\x20journeys')+a25_0x3058f5[_0x2c5895(0x219)](_0x535912)),console[_0x2c5895(0x19a)]('\x20\x20'+a25_0x3058f5[_0x2c5895(0x1ba)]('+\x20'+_0x3dcab9[_0x2c5895(0x1f1)]+_0x2c5895(0x203))),console['error']('\x20\x20'+a25_0x3058f5[_0x2c5895(0x18f)]('~\x20'+_0x59c338[_0x2c5895(0x1f1)]+_0x2c5895(0x1a8))),console[_0x2c5895(0x19a)]('\x20\x20'+a25_0x3058f5[_0x2c5895(0x219)]('=\x20'+_0x57cf32[_0x2c5895(0x1f1)]+_0x2c5895(0x1dd))),console[_0x2c5895(0x19a)](_0x2c5895(0x194)+a25_0x3058f5[_0x2c5895(0x1e7)](_0x3e5b94)+'\x0a');if(_0x59c338['length']>0x0)for(const _0x5f2b03 of _0x59c338){console['error']('\x0aChanges\x20to\x20\x27'+_0x5f2b03['relativePath']+'\x27:'),console[_0x2c5895(0x19a)]('─'[_0x2c5895(0x1b9)](0x3c)),console['error'](_0x5f2b03[_0x2c5895(0x18c)]),console[_0x2c5895(0x19a)]('─'[_0x2c5895(0x1b9)](0x3c));}if(_0x2521e2['dryRun'])return console[_0x2c5895(0x19a)](a25_0x3058f5[_0x2c5895(0x18f)](_0x2c5895(0x1a4))),0x0;if(_0x3dcab9['length']===0x0&&_0x59c338[_0x2c5895(0x1f1)]===0x0)return console[_0x2c5895(0x19a)](a25_0x3058f5[_0x2c5895(0x1ba)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),0x0;if(!_0x2521e2[_0x2c5895(0x1ea)]&&(_0x3dcab9[_0x2c5895(0x1f1)]>0x0||_0x59c338[_0x2c5895(0x1f1)]>0x0)){const _0xdb4810=await confirmKey(_0x2c5895(0x1d5)+(_0x3dcab9[_0x2c5895(0x1f1)]+_0x59c338[_0x2c5895(0x1f1)])+_0x2c5895(0x1ab));if(!_0xdb4810)return console[_0x2c5895(0x19a)](_0x2c5895(0x1cb)),0x1;}!existsSync(_0x3e5b94)&&mkdirSync(_0x3e5b94,{'recursive':!![]});for(const _0x169267 of _0x519287){(_0x169267[_0x2c5895(0x202)]||_0x169267[_0x2c5895(0x223)])&&writeFileSync(_0x169267[_0x2c5895(0x214)],_0x169267[_0x2c5895(0x22b)],_0x2c5895(0x1d6));}return console[_0x2c5895(0x19a)](a25_0x3058f5['green'](_0x2c5895(0x1ed)+(_0x3dcab9[_0x2c5895(0x1f1)]+_0x59c338[_0x2c5895(0x1f1)])+_0x2c5895(0x229)+_0x3e5b94)),0x0;}}
1
+ const a25_0x341cac=a25_0x4100;(function(_0x30b303,_0x1db5e7){const _0x3500aa=a25_0x4100,_0x58d4a8=_0x30b303();while(!![]){try{const _0x380ab7=-parseInt(_0x3500aa(0xc4))/0x1+parseInt(_0x3500aa(0xe8))/0x2+-parseInt(_0x3500aa(0x9b))/0x3*(parseInt(_0x3500aa(0xfc))/0x4)+parseInt(_0x3500aa(0x116))/0x5+parseInt(_0x3500aa(0xdd))/0x6*(parseInt(_0x3500aa(0xd4))/0x7)+-parseInt(_0x3500aa(0xba))/0x8*(-parseInt(_0x3500aa(0xd2))/0x9)+parseInt(_0x3500aa(0xa4))/0xa*(parseInt(_0x3500aa(0x11e))/0xb);if(_0x380ab7===_0x1db5e7)break;else _0x58d4a8['push'](_0x58d4a8['shift']());}catch(_0x3aae44){_0x58d4a8['push'](_0x58d4a8['shift']());}}}(a25_0x197d,0x48f38));import a25_0x3af5ef from'chalk';function a25_0x4100(_0x3fd731,_0x96c0b5){_0x3fd731=_0x3fd731-0x98;const _0x197d8b=a25_0x197d();let _0x410071=_0x197d8b[_0x3fd731];return _0x410071;}import a25_0xf55e6f from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{apiToYamlAsync,toYamlString}from'../sdk/segment/journey-yaml.js';import{apiRuleToYaml}from'../sdk/segment/child-segment-yaml.js';import{getSegmentRootDir,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{sanitizeFileName}from'../utils/string-utils.js';const SEGMENT_KIND_JOURNEY=0x3;function formatJourneyState(_0x4c2347){const _0xd930fc=a25_0x4100;switch(_0x4c2347){case'launched':return a25_0x3af5ef[_0xd930fc(0x10a)](_0x4c2347);case _0xd930fc(0xa1):return a25_0x3af5ef['gray'](_0x4c2347);case _0xd930fc(0xb1):return a25_0x3af5ef['dim'](_0x4c2347);default:return _0x4c2347;}}function formatJourneyItem(_0x3f9f5e,_0x2bc7df=''){const _0x59c868=a25_0x4100,_0x52530a=formatJourneyState(_0x3f9f5e[_0x59c868(0x98)]),_0x3b7e42=_0x3f9f5e[_0x59c868(0x99)]?a25_0x3af5ef[_0x59c868(0xbf)](_0x59c868(0x109)):'';return _0x2bc7df+'🗺️\x20'+_0x3f9f5e[_0x59c868(0xd8)]+'\x20('+_0x52530a+')'+_0x3b7e42;}function escapeRegex(_0x4f4525){const _0x53e2f2=a25_0x4100;return _0x4f4525[_0x53e2f2(0x9e)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x380838){const _0x321c16=a25_0x4100,_0x2ed5fd=_0x380838[_0x321c16(0xab)]('*')[_0x321c16(0xe1)](escapeRegex);return new RegExp(_0x2ed5fd[_0x321c16(0xc7)]('.*'),'i');}function resolveJourneyTarget(_0x5da44f,_0x31359b,_0x5278b4){const _0x217c62=a25_0x4100;if(isYamlFilePath(_0x5da44f))try{const _0x44d4cd=resolveYamlFilePath(_0x5da44f);return _0x5278b4&&(console[_0x217c62(0x135)](_0x217c62(0xbd)+_0x5da44f),console[_0x217c62(0x135)](_0x217c62(0xa3)+_0x44d4cd[_0x217c62(0xe2)]),console[_0x217c62(0x135)](_0x217c62(0xfe)+_0x44d4cd[_0x217c62(0x9c)]),console[_0x217c62(0x135)](_0x217c62(0x102)+(_0x44d4cd[_0x217c62(0xc0)]||_0x217c62(0xcf)))),{'journeyName':_0x44d4cd[_0x217c62(0x9c)],'parentSegment':_0x44d4cd['parentSegment'],'resolved':_0x44d4cd};}catch(_0x18a265){throw new SDKError(ErrorCode[_0x217c62(0xe4)],_0x217c62(0xbb)+_0x18a265[_0x217c62(0xca)]);}if(!_0x31359b)throw new SDKError(ErrorCode[_0x217c62(0xe4)],_0x217c62(0xe0));return{'journeyName':_0x5da44f,'parentSegment':_0x31359b};}export class JourneyListCommand extends BaseCommand{[a25_0x341cac(0xf0)]='journey:list';['description']=a25_0x341cac(0x127);async[a25_0x341cac(0xcd)](_0x40a162){const _0x1ece56=a25_0x341cac,{options:_0x1e292e,args:_0x175e5b,tdx:_0x173849}=_0x40a162,_0x1c70c5=_0x175e5b[0x0],_0x51edfb=_0x1e292e[_0x1ece56(0xe2)];if(!_0x51edfb)return console['error'](_0x1ece56(0xda)),console[_0x1ece56(0x135)](_0x1ece56(0xa9)),0x1;const _0x30b435=await withSpinner(_0x1ece56(0xf9),()=>_0x173849[_0x1ece56(0x129)]['resolveParentId'](_0x51edfb),{'verbose':_0x1e292e['verbose']}),_0x1f628b=_0x30b435['data'];_0x1e292e[_0x1ece56(0xf5)]&&(console[_0x1ece56(0x135)](_0x1ece56(0xc9)+_0x51edfb+_0x1ece56(0x100)+_0x1f628b+')'),_0x1c70c5&&console['error'](_0x1ece56(0xae)+_0x1c70c5));const [_0x487da9,_0x430d66,_0xb5fbe5]=await Promise['all']([withSpinner(_0x1ece56(0xd1),()=>_0x173849[_0x1ece56(0x129)]['getParentFull'](_0x1f628b),{'verbose':_0x1e292e[_0x1ece56(0xf5)]}),withSpinner('Fetching\x20folders...',()=>_0x173849[_0x1ece56(0x129)]['listFolders'](_0x1f628b),{'verbose':_0x1e292e['verbose']}),withSpinner('Listing\x20journeys...',()=>_0x173849[_0x1ece56(0xb2)]['listJourneysFromParentSegment'](_0x1f628b),{'verbose':_0x1e292e[_0x1ece56(0xf5)]})]),_0x1fcab3=_0x487da9[_0x1ece56(0x112)],_0x484099=_0x430d66[_0x1ece56(0x112)];let _0x3e5037=_0xb5fbe5[_0x1ece56(0x112)];const _0x1ff0ed=_0x1fcab3['rootFolderId'],_0x3d8a84=new Map();for(const _0x9f3c37 of _0x484099){_0x3d8a84[_0x1ece56(0x121)](_0x9f3c37['id'],_0x9f3c37[_0x1ece56(0xf0)]);}if(_0x1c70c5){const _0x2d5e86=globToRegex(_0x1c70c5);_0x3e5037=_0x3e5037[_0x1ece56(0x119)](_0x5d0ab5=>_0x2d5e86[_0x1ece56(0x12c)](_0x5d0ab5['journeyBundleName']));}console[_0x1ece56(0x135)](_0x1ece56(0xea)+_0x3e5037[_0x1ece56(0xf8)]+_0x1ece56(0xb6)+(_0x3e5037[_0x1ece56(0xf8)]!==0x1?'s':''));if(_0x1e292e[_0x1ece56(0xf2)]==='table')await handleSDKOutput(_0x3e5037,_0x1e292e);else{if(_0x1e292e[_0x1ece56(0xf2)]===_0x1ece56(0xc1))await handleSDKOutput(_0x3e5037,_0x1e292e);else{console[_0x1ece56(0x11f)]('['+_0x51edfb+']');const _0x3e4527=new Map(),_0x51a30d=[];for(const _0x3d97e5 of _0x3e5037){if(!_0x3d97e5[_0x1ece56(0x120)]||_0x3d97e5[_0x1ece56(0x120)]===_0x1ff0ed)_0x51a30d['push'](_0x3d97e5);else{const _0x2180a5=_0x3e4527[_0x1ece56(0x138)](_0x3d97e5['folderId'])||[];_0x2180a5['push'](_0x3d97e5),_0x3e4527[_0x1ece56(0x121)](_0x3d97e5[_0x1ece56(0x120)],_0x2180a5);}}for(const _0x3ee0c5 of _0x51a30d){console[_0x1ece56(0x11f)](formatJourneyItem(_0x3ee0c5));}for(const [_0xd5bb9a,_0x586d38]of _0x3e4527){const _0x117b94=_0x3d8a84['get'](_0xd5bb9a)||_0xd5bb9a;console[_0x1ece56(0x11f)](_0x1ece56(0xa2)+_0x117b94);for(const _0x1cdeb0 of _0x586d38){console['log'](formatJourneyItem(_0x1cdeb0,'\x20\x20'));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a25_0x341cac(0xf0)]='journey:view';[a25_0x341cac(0xb9)]=a25_0x341cac(0xd3);async[a25_0x341cac(0xcd)](_0x46d530){const _0x19059d=a25_0x341cac,{options:_0x353555,args:_0x59ad9e,tdx:_0x2d7a7c}=_0x46d530,_0x1a6d44=_0x59ad9e[0x0];if(!_0x1a6d44)return console['error'](_0x19059d(0x107)),console[_0x19059d(0x135)](_0x19059d(0x13a)),0x1;_0x353555['verbose']&&console[_0x19059d(0x135)](_0x19059d(0x10e)+_0x1a6d44);const _0x192786=resolveJourneyTarget(_0x1a6d44,_0x353555[_0x19059d(0xe2)],_0x353555[_0x19059d(0xf5)]),_0x2a22c6=await withSpinner(_0x19059d(0xf9),()=>_0x2d7a7c[_0x19059d(0x129)][_0x19059d(0xb8)](_0x192786[_0x19059d(0xe2)]),{'verbose':_0x353555[_0x19059d(0xf5)]}),_0x7fea05=_0x2a22c6[_0x19059d(0x112)],_0x133e42=await withSpinner(_0x19059d(0xe6),()=>_0x2d7a7c[_0x19059d(0xb2)]['resolveJourneyId'](_0x7fea05,_0x192786[_0x19059d(0x9f)]),{'verbose':_0x353555['verbose']}),_0x2fbb5f=_0x133e42['data'],_0x2d0dd8=await withSpinner(_0x19059d(0xaa),()=>_0x2d7a7c[_0x19059d(0xb2)]['getJourney'](_0x2fbb5f),{'verbose':_0x353555['verbose']}),_0x2fc7a7=_0x2d0dd8[_0x19059d(0x112)],_0x5723bd=_0x353555[_0x19059d(0xa5)];let _0x4a7df1;if(_0x5723bd)try{const _0x58775b=await withSpinner(_0x19059d(0x131),()=>_0x2d7a7c[_0x19059d(0xb2)][_0x19059d(0x132)](_0x2fbb5f),{'verbose':_0x353555[_0x19059d(0xf5)]});_0x4a7df1=_0x58775b['data'];}catch{_0x353555[_0x19059d(0xf5)]&&console[_0x19059d(0x135)](_0x19059d(0x11a));}const _0x1f3179={'id':_0x2fc7a7['id'],'name':_0x2fc7a7[_0x19059d(0xa0)][_0x19059d(0xf0)],'description':_0x2fc7a7[_0x19059d(0xa0)][_0x19059d(0xb9)],'state':_0x2fc7a7[_0x19059d(0xa0)][_0x19059d(0x98)],'paused':_0x2fc7a7[_0x19059d(0xa0)][_0x19059d(0x99)],'reentry_mode':_0x2fc7a7['attributes'][_0x19059d(0xc3)],'stages':_0x2fc7a7[_0x19059d(0xa0)][_0x19059d(0x105)]?.[_0x19059d(0xf8)]||0x0,..._0x2fc7a7['attributes'][_0x19059d(0x122)]&&{'goal':_0x2fc7a7[_0x19059d(0xa0)][_0x19059d(0x122)][_0x19059d(0xf0)]},..._0x4a7df1&&{'statistics':{'total_entered':_0x4a7df1[_0x19059d(0xad)],'goal_achieved':_0x4a7df1[_0x19059d(0x114)],'goal_rate':_0x4a7df1[_0x19059d(0x106)],'stages':_0x4a7df1[_0x19059d(0xd6)]}}};return await handleSingleObjectOutput(_0x1f3179,_0x353555),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a25_0x341cac(0xf0)]=a25_0x341cac(0xee);['description']=a25_0x341cac(0x128);async[a25_0x341cac(0xcd)](_0x3b9827){const _0x5d2aac=a25_0x341cac,{options:_0x4d8cd1,args:_0x35590d,tdx:_0x5dc3f1}=_0x3b9827,_0x58175b=_0x35590d[0x0];if(!_0x58175b)return console[_0x5d2aac(0x135)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5d2aac(0x135)](_0x5d2aac(0x104)),0x1;_0x4d8cd1['verbose']&&console[_0x5d2aac(0x135)]('Input:\x20'+_0x58175b);const _0x41bdc8=resolveJourneyTarget(_0x58175b,_0x4d8cd1[_0x5d2aac(0xe2)],_0x4d8cd1[_0x5d2aac(0xf5)]),_0x4d66a7=await withSpinner(_0x5d2aac(0xf9),()=>_0x5dc3f1[_0x5d2aac(0x129)][_0x5d2aac(0xb8)](_0x41bdc8['parentSegment']),{'verbose':_0x4d8cd1[_0x5d2aac(0xf5)]}),_0x3a451c=_0x4d66a7['data'],_0x59b27e=await withSpinner(_0x5d2aac(0xe6),()=>_0x5dc3f1[_0x5d2aac(0xb2)][_0x5d2aac(0x108)](_0x3a451c,_0x41bdc8['journeyName']),{'verbose':_0x4d8cd1['verbose']}),_0x578dc0=_0x59b27e['data'],_0xadb28=await withSpinner(_0x5d2aac(0x131),()=>_0x5dc3f1[_0x5d2aac(0xb2)][_0x5d2aac(0x132)](_0x578dc0),{'verbose':_0x4d8cd1[_0x5d2aac(0xf5)]}),_0x21b628=_0xadb28['data'];if(!_0x21b628||_0x21b628[_0x5d2aac(0x10f)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x41bdc8[_0x5d2aac(0x9f)]),console[_0x5d2aac(0x135)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x38735e={'journey_id':_0x21b628[_0x5d2aac(0x10f)],'total_entered':_0x21b628[_0x5d2aac(0xad)],'goal_achieved':_0x21b628[_0x5d2aac(0x114)],'goal_rate':_0x21b628[_0x5d2aac(0x106)],'stages':_0x21b628[_0x5d2aac(0xd6)]?.[_0x5d2aac(0xe1)](_0x10010f=>({'name':_0x10010f[_0x5d2aac(0x133)],'population':_0x10010f['population'],'entered':_0x10010f[_0x5d2aac(0xc5)],'exited':_0x10010f[_0x5d2aac(0xcb)],'conversion_rate':_0x10010f[_0x5d2aac(0xac)]}))},_0x315549=_0x4d8cd1['stage'];if(_0x315549&&_0x21b628[_0x5d2aac(0xd6)]){const _0x13bd7e=_0x21b628[_0x5d2aac(0xd6)][_0x5d2aac(0xd0)](_0x25d29c=>_0x25d29c[_0x5d2aac(0x133)][_0x5d2aac(0xb0)]()===_0x315549[_0x5d2aac(0xb0)]());if(_0x13bd7e)return await handleSingleObjectOutput({'stage_name':_0x13bd7e[_0x5d2aac(0x133)],'population':_0x13bd7e[_0x5d2aac(0x115)],'entered':_0x13bd7e['entered'],'exited':_0x13bd7e['exited'],'conversion_rate':_0x13bd7e['conversionRate']},_0x4d8cd1),0x0;console['error'](_0x5d2aac(0xb7)+_0x315549+_0x5d2aac(0xf3));}return await handleSingleObjectOutput(_0x38735e,_0x4d8cd1),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a25_0x341cac(0xf0)]='journey:pause';[a25_0x341cac(0xb9)]=a25_0x341cac(0xb5);async['execute'](_0x40f7d9){const _0x2dea42=a25_0x341cac,{options:_0x140cd4,args:_0x46045e,tdx:_0x2a30bf}=_0x40f7d9,_0xc04061=_0x46045e[0x0];if(!_0xc04061)return console['error'](_0x2dea42(0x107)),console[_0x2dea42(0x135)](_0x2dea42(0x103)),0x1;_0x140cd4['verbose']&&console[_0x2dea42(0x135)]('Input:\x20'+_0xc04061);const _0x15849d=resolveJourneyTarget(_0xc04061,_0x140cd4[_0x2dea42(0xe2)],_0x140cd4[_0x2dea42(0xf5)]),_0x4d5a45=await withSpinner(_0x2dea42(0xf9),()=>_0x2a30bf[_0x2dea42(0x129)][_0x2dea42(0xb8)](_0x15849d[_0x2dea42(0xe2)]),{'verbose':_0x140cd4[_0x2dea42(0xf5)]}),_0x121ed6=_0x4d5a45[_0x2dea42(0x112)],_0x544615=await withSpinner(_0x2dea42(0xe6),()=>_0x2a30bf['journey'][_0x2dea42(0x108)](_0x121ed6,_0x15849d[_0x2dea42(0x9f)]),{'verbose':_0x140cd4[_0x2dea42(0xf5)]}),_0x556eaf=_0x544615[_0x2dea42(0x112)];if(!_0x140cd4['yes']){const _0x4842d1=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x15849d['journeyName']+'\x22?');if(!_0x4842d1)return console['error'](_0x2dea42(0xf6)),0x0;}const _0x4b40f5=await withSpinner(_0x2dea42(0xfa),()=>_0x2a30bf[_0x2dea42(0xb2)][_0x2dea42(0xfb)](_0x556eaf),{'verbose':_0x140cd4[_0x2dea42(0xf5)]}),_0xe08628=_0x4b40f5[_0x2dea42(0x112)];return console['error'](_0x2dea42(0xb4)+_0xe08628['attributes'][_0x2dea42(0xf0)]+_0x2dea42(0xce)),0x0;}}function a25_0x197d(){const _0x5c8bf4=['Fetching\x20parent\x20segment...','198vWeTsK','Show\x20journey\x20details','14cowQmH','diff','stages','Usage:\x20journey\x20resume\x20<name-or-path>','journeyBundleName','\x20unchanged\x20files','Error:\x20Parent\x20segment\x20context\x20required','yaml','hasChanges','255216dqDbne','segments','rule','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','map','parentSegment','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','INVALID_ARGUMENT','values','Resolving\x20journey...','repeat','897142eqhGma','✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Found\x20','versionNumber','max','latest','journey:stats','size','name','Parent\x20segment\x20context\x20not\x20set.\x0a','format','\x22\x20not\x20found','Export\x20journey(s)\x20as\x20YAML\x20files','verbose','Cancelled','push','length','Resolving\x20parent\x20segment...','Pausing\x20journey...','pause','40NPZWZe','\x20journeys','\x20\x20Name:\x20','cyan','\x20(ID:\x20','launched','\x20\x20Folder\x20path:\x20','Usage:\x20journey\x20pause\x20<name-or-path>','Usage:\x20journey\x20stats\x20<name-or-path>','journeyStages','goalRate','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','resolveJourneyId','\x20(paused)','green','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','has','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Input:\x20','journeyId','Resume\x20a\x20paused\x20journey','✔\x20Pulled\x20','data','Listing\x20journeys...','totalGoalAchieved','population','272515foNLRW','No\x20journeys\x20found','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','filter','\x20\x20Statistics\x20not\x20available','version','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','relative','2618WSxTwl','log','folderId','set','goal','yes','version_number','kind','dryRun','List\x20journeys\x20in\x20current\x20context','Show\x20journey\x20statistics','segment','.yml','\x20files?','test','Found\x20existing\x20tdx.json\x20at:\x20','parent_segment','absolutePath','audienceId','Getting\x20journey\x20statistics...','getStatistics','stageName','\x20\x20Target:\x20','error','reentry','journeyBundleId','get','\x20changed\x20files','Usage:\x20journey\x20view\x20<name-or-path>','\x20journey\x20files\x20to\x20','state','paused','isNew','162381Wbsaht','segmentName','dim','replace','journeyName','attributes','draft','📁\x20','\x20\x20Parent\x20segment:\x20','17210MvMmwY','includeStats','bundle_id','...','item','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Getting\x20journey\x20details...','split','conversionRate','totalEntered','Pattern:\x20','Write\x20','toLowerCase','archived','journey','resume','✔\x20Journey\x20\x22','Pause\x20a\x20running\x20journey','\x20journey','Warning:\x20Stage\x20\x22','resolveParentId','description','3208UZpyPo','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','journey:pull','Resolved\x20YAML\x20file:\x20','\x20new\x20files','yellow','folderPath','json','\x0aPull\x20summary:','reentryMode','166488xiCZWG','entered','\x20versions)','join','Resuming\x20journey...','Parent\x20segment:\x20','message','exited','getJourney','execute','\x22\x20paused','(root)','find'];a25_0x197d=function(){return _0x5c8bf4;};return a25_0x197d();}export class JourneyResumeCommand extends BaseCommand{[a25_0x341cac(0xf0)]='journey:resume';[a25_0x341cac(0xb9)]=a25_0x341cac(0x110);async[a25_0x341cac(0xcd)](_0x31ced8){const _0x336743=a25_0x341cac,{options:_0x5910c2,args:_0x2e53d0,tdx:_0x56f529}=_0x31ced8,_0x547876=_0x2e53d0[0x0];if(!_0x547876)return console[_0x336743(0x135)](_0x336743(0x107)),console[_0x336743(0x135)](_0x336743(0xd7)),0x1;_0x5910c2['verbose']&&console[_0x336743(0x135)](_0x336743(0x10e)+_0x547876);const _0x13ea20=resolveJourneyTarget(_0x547876,_0x5910c2['parentSegment'],_0x5910c2['verbose']),_0x27416d=await withSpinner(_0x336743(0xf9),()=>_0x56f529[_0x336743(0x129)][_0x336743(0xb8)](_0x13ea20[_0x336743(0xe2)]),{'verbose':_0x5910c2[_0x336743(0xf5)]}),_0x4fefbd=_0x27416d[_0x336743(0x112)],_0x1ddf24=await withSpinner(_0x336743(0xe6),()=>_0x56f529[_0x336743(0xb2)]['resolveJourneyId'](_0x4fefbd,_0x13ea20['journeyName']),{'verbose':_0x5910c2[_0x336743(0xf5)]}),_0x49a8ca=_0x1ddf24[_0x336743(0x112)];if(!_0x5910c2[_0x336743(0x123)]){const _0x4afd40=await confirm(_0x336743(0x11c)+_0x13ea20[_0x336743(0x9f)]+'\x22?');if(!_0x4afd40)return console[_0x336743(0x135)]('Cancelled'),0x0;}const _0x1fef98=await withSpinner(_0x336743(0xc8),()=>_0x56f529[_0x336743(0xb2)][_0x336743(0xb3)](_0x49a8ca),{'verbose':_0x5910c2[_0x336743(0xf5)]}),_0x372f77=_0x1fef98[_0x336743(0x112)];return console[_0x336743(0x135)]('✔\x20Journey\x20\x22'+_0x372f77['attributes'][_0x336743(0xf0)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a25_0x341cac(0xf0)]=a25_0x341cac(0xbc);[a25_0x341cac(0xb9)]=a25_0x341cac(0xf4);async[a25_0x341cac(0xcd)](_0x454f37){const _0x56fae8=a25_0x341cac,{options:_0x48ac92,args:_0x2b62b6,tdx:_0x22f2e6}=_0x454f37,_0x8fe89=_0x48ac92,_0x412df3=_0x2b62b6[0x0],_0x71497b=findTdxConfigPath();let _0x4a3387,_0x5cdc2a;if(_0x71497b){const _0x429753=loadTdxConfig(_0x71497b);_0x4a3387=_0x429753[_0x56fae8(0x12e)],_0x5cdc2a=a25_0xf55e6f['dirname'](_0x71497b),_0x8fe89[_0x56fae8(0xf5)]&&(console[_0x56fae8(0x135)](_0x56fae8(0x12d)+_0x71497b),console[_0x56fae8(0x135)]('Using\x20parent\x20segment:\x20'+_0x4a3387));}else{_0x4a3387=_0x48ac92[_0x56fae8(0xe2)];if(!_0x4a3387)return console[_0x56fae8(0x135)](a25_0x3af5ef[_0x56fae8(0xbf)](_0x56fae8(0xf1))),console[_0x56fae8(0x135)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x56fae8(0x135)](_0x56fae8(0xe3)),0x1;_0x5cdc2a=getSegmentRootDir(sanitizeFileName(_0x4a3387));}const _0x1e99ec=await withSpinner(_0x56fae8(0xf9),()=>_0x22f2e6['segment'][_0x56fae8(0xb8)](_0x4a3387),{'verbose':_0x48ac92[_0x56fae8(0xf5)]}),_0x301cf0=_0x1e99ec[_0x56fae8(0x112)],_0x5a2acd=await withSpinner(_0x56fae8(0x113),()=>_0x22f2e6['journey']['listJourneysFromParentSegment'](_0x301cf0),{'verbose':_0x48ac92['verbose']});let _0x223e7d=_0x5a2acd[_0x56fae8(0x112)];if(_0x412df3){const _0x3d835b=_0x223e7d['filter'](_0x177647=>_0x177647[_0x56fae8(0xd8)][_0x56fae8(0xb0)]()===_0x412df3[_0x56fae8(0xb0)]());if(_0x3d835b['length']===0x0)return console[_0x56fae8(0x135)]('Error:\x20Journey\x20not\x20found:\x20'+_0x412df3),console[_0x56fae8(0x135)](_0x56fae8(0x118)),0x1;_0x223e7d=_0x3d835b;}if(_0x223e7d['length']===0x0)return console[_0x56fae8(0x135)](_0x56fae8(0x117)),0x0;const _0x29f73a=new Map();for(const _0x1d87b4 of _0x223e7d){const _0x2fea32=_0x1d87b4[_0x56fae8(0x137)];!_0x29f73a[_0x56fae8(0x10c)](_0x2fea32)&&_0x29f73a[_0x56fae8(0x121)](_0x2fea32,[]),_0x29f73a[_0x56fae8(0x138)](_0x2fea32)[_0x56fae8(0xf7)](_0x1d87b4);}for(const _0x18d83a of _0x29f73a[_0x56fae8(0xe5)]()){_0x18d83a['sort']((_0xc62a20,_0x5c5ecf)=>(_0xc62a20[_0x56fae8(0xeb)]||0x0)-(_0x5c5ecf[_0x56fae8(0xeb)]||0x0));}const _0x1c8244=[];for(const _0xf08e20 of _0x29f73a['values']()){const _0x13b85f=_0xf08e20[0x0][_0x56fae8(0xd8)],_0x27e838=[];for(const _0x5d39c1 of _0xf08e20){const _0x565c31=await withSpinner('Fetching\x20'+_0x5d39c1['journeyBundleName']+'\x20v'+(_0x5d39c1[_0x56fae8(0xeb)]||0x1)+_0x56fae8(0xa7),()=>_0x22f2e6[_0x56fae8(0xb2)][_0x56fae8(0xcc)](_0x5d39c1['id']),{'verbose':_0x48ac92[_0x56fae8(0xf5)]}),_0x3de0c5=_0x565c31[_0x56fae8(0x112)],_0x97e2f8=_0x3de0c5['attributes']?.[_0x56fae8(0x130)],_0x4a84d0={'resolveSegment':async _0x10bc84=>{const _0x1a1c04=_0x56fae8;if(!_0x97e2f8)return{'name':_0x10bc84,'isJourneyLocal':![]};try{const _0x49fbcb=await _0x22f2e6[_0x1a1c04(0x129)]['getSegment'](_0x97e2f8,_0x10bc84),_0x272cd7=_0x49fbcb[_0x1a1c04(0x125)]===SEGMENT_KIND_JOURNEY;let _0x10d00a;return _0x272cd7&&_0x49fbcb[_0x1a1c04(0xdf)]&&(_0x10d00a={'description':_0x49fbcb['description'],'rule':apiRuleToYaml(_0x49fbcb[_0x1a1c04(0xdf)])}),{'name':_0x49fbcb[_0x1a1c04(0xf0)],'isJourneyLocal':_0x272cd7,'definition':_0x10d00a};}catch(_0x1897de){return _0x48ac92[_0x1a1c04(0xf5)]&&console[_0x1a1c04(0x135)](_0x1a1c04(0x10d)+_0x10bc84+':\x20'+_0x1897de[_0x1a1c04(0xca)]),{'name':_0x10bc84,'isJourneyLocal':![]};}}},_0x25d7f1=await apiToYamlAsync(_0x3de0c5,_0x4a84d0);_0x27e838[_0x56fae8(0xf7)]({'item':_0x5d39c1,'yaml':_0x25d7f1});}const _0x1cdb2c=_0x27e838[0x0][_0x56fae8(0xdb)],_0x381def=Math[_0x56fae8(0xec)](..._0x27e838[_0x56fae8(0xe1)](_0x536a0f=>_0x536a0f['item'][_0x56fae8(0xeb)]||0x0));let _0x4c8868;if(_0x27e838[_0x56fae8(0xf8)]===0x1)_0x4c8868=_0x1cdb2c;else{const _0x209876=_0x27e838[_0x56fae8(0xe1)](_0x604776=>{const _0xad830a=_0x56fae8,_0x2c0d10=(_0x604776['item'][_0xad830a(0xeb)]||0x0)===_0x381def,_0x4ec254={'name':_0x604776[_0xad830a(0xdb)][_0xad830a(0x11b)]||_0x604776[_0xad830a(0xa8)][_0xad830a(0xf0)],'state':_0x604776[_0xad830a(0xa8)][_0xad830a(0x98)]===_0xad830a(0x101)?_0xad830a(0x101):_0xad830a(0xa1),'stages':_0x604776[_0xad830a(0xdb)][_0xad830a(0xd6)]||[],'id':_0x604776['yaml']['id'],'version_number':_0x604776[_0xad830a(0xdb)][_0xad830a(0x124)]};return _0x2c0d10&&(_0x4ec254[_0xad830a(0xed)]=!![]),_0x4ec254;});_0x4c8868={'type':_0x56fae8(0xb2),'name':_0x1cdb2c['name'],'description':_0x1cdb2c[_0x56fae8(0xb9)],'segments':_0x1cdb2c[_0x56fae8(0xde)],'goal':_0x1cdb2c[_0x56fae8(0x122)],'reentry':_0x1cdb2c[_0x56fae8(0x136)],'versions':_0x209876,'bundle_id':_0x1cdb2c[_0x56fae8(0xa6)],'bundle_name':_0x1cdb2c['bundle_name']};}const _0x47cc04=toYamlString(_0x4c8868),_0x1ea7dc=sanitizeFileName(_0x13b85f),_0x59b1e4=a25_0xf55e6f[_0x56fae8(0xc7)](_0x5cdc2a,_0x1ea7dc+_0x56fae8(0x12a)),_0x469498=a25_0xf55e6f[_0x56fae8(0x11d)](process['cwd'](),_0x59b1e4);if(existsSync(_0x59b1e4)){const _0x44904c=readFileSync(_0x59b1e4,'utf-8'),_0x2cb048=generateDiff(_0x44904c,_0x47cc04),_0xfea490=hasChanges(_0x2cb048);_0x1c8244['push']({'relativePath':_0x469498,'absolutePath':_0x59b1e4,'content':_0x47cc04,'isNew':![],'hasChanges':_0xfea490,'diff':_0xfea490?formatDiffWithColors(_0x2cb048):undefined});}else _0x1c8244['push']({'relativePath':_0x469498,'absolutePath':_0x59b1e4,'content':_0x47cc04,'isNew':!![],'hasChanges':![]});}const _0x9358b1=_0x1c8244[_0x56fae8(0x119)](_0x264efe=>_0x264efe['isNew']),_0xea2681=_0x1c8244[_0x56fae8(0x119)](_0x2551de=>!_0x2551de[_0x56fae8(0x9a)]&&_0x2551de[_0x56fae8(0xdc)]),_0x4c5b1f=_0x1c8244['filter'](_0x294d16=>!_0x294d16[_0x56fae8(0x9a)]&&!_0x294d16[_0x56fae8(0xdc)]),_0x56a4ff=_0x223e7d[_0x56fae8(0xf8)],_0x1065db=_0x29f73a[_0x56fae8(0xef)],_0x7ed19f=_0x56a4ff>_0x1065db?'\x20('+_0x56a4ff+_0x56fae8(0xc6):'';console[_0x56fae8(0x135)](_0x56fae8(0xc2)),console['error']('\x20\x20'+a25_0x3af5ef[_0x56fae8(0xff)](_0x1065db+_0x56fae8(0xfd))+a25_0x3af5ef['dim'](_0x7ed19f)),console['error']('\x20\x20'+a25_0x3af5ef['green']('+\x20'+_0x9358b1[_0x56fae8(0xf8)]+_0x56fae8(0xbe))),console[_0x56fae8(0x135)]('\x20\x20'+a25_0x3af5ef[_0x56fae8(0xbf)]('~\x20'+_0xea2681[_0x56fae8(0xf8)]+_0x56fae8(0x139))),console[_0x56fae8(0x135)]('\x20\x20'+a25_0x3af5ef[_0x56fae8(0x9d)]('=\x20'+_0x4c5b1f[_0x56fae8(0xf8)]+_0x56fae8(0xd9))),console[_0x56fae8(0x135)](_0x56fae8(0x134)+a25_0x3af5ef[_0x56fae8(0xff)](_0x5cdc2a)+'\x0a');if(_0xea2681['length']>0x0)for(const _0x23dfa5 of _0xea2681){console['error']('\x0aChanges\x20to\x20\x27'+_0x23dfa5['relativePath']+'\x27:'),console[_0x56fae8(0x135)]('─'['repeat'](0x3c)),console[_0x56fae8(0x135)](_0x23dfa5[_0x56fae8(0xd5)]),console[_0x56fae8(0x135)]('─'[_0x56fae8(0xe7)](0x3c));}if(_0x8fe89[_0x56fae8(0x126)])return console['error'](a25_0x3af5ef['yellow'](_0x56fae8(0x10b))),0x0;if(_0x9358b1['length']===0x0&&_0xea2681[_0x56fae8(0xf8)]===0x0)return console['error'](a25_0x3af5ef[_0x56fae8(0x10a)](_0x56fae8(0xe9))),0x0;if(!_0x8fe89['yes']&&(_0x9358b1['length']>0x0||_0xea2681['length']>0x0)){const _0x527cb2=await confirmKey(_0x56fae8(0xaf)+(_0x9358b1['length']+_0xea2681[_0x56fae8(0xf8)])+_0x56fae8(0x12b));if(!_0x527cb2)return console[_0x56fae8(0x135)]('Aborted.'),0x1;}!existsSync(_0x5cdc2a)&&mkdirSync(_0x5cdc2a,{'recursive':!![]});for(const _0x41823a of _0x1c8244){(_0x41823a[_0x56fae8(0x9a)]||_0x41823a['hasChanges'])&&writeFileSync(_0x41823a[_0x56fae8(0x12f)],_0x41823a['content'],'utf-8');}return console[_0x56fae8(0x135)](a25_0x3af5ef[_0x56fae8(0x10a)](_0x56fae8(0x111)+(_0x9358b1[_0x56fae8(0xf8)]+_0xea2681[_0x56fae8(0xf8)])+_0x56fae8(0x13b)+_0x5cdc2a)),0x0;}}