@treasuredata/tdx 2026.3.13 → 2026.3.14

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 (201) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-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/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a19_0x29d27a=a19_0x26dd;(function(_0x541251,_0x57fe4d){const _0x277c8b=a19_0x26dd,_0x458b14=_0x541251();while(!![]){try{const _0x5a666d=parseInt(_0x277c8b(0x126))/0x1+-parseInt(_0x277c8b(0x124))/0x2*(-parseInt(_0x277c8b(0x11d))/0x3)+parseInt(_0x277c8b(0x109))/0x4*(-parseInt(_0x277c8b(0xf1))/0x5)+-parseInt(_0x277c8b(0xef))/0x6*(parseInt(_0x277c8b(0xe8))/0x7)+parseInt(_0x277c8b(0x10e))/0x8+-parseInt(_0x277c8b(0x123))/0x9+parseInt(_0x277c8b(0x100))/0xa;if(_0x5a666d===_0x57fe4d)break;else _0x458b14['push'](_0x458b14['shift']());}catch(_0x1b0731){_0x458b14['push'](_0x458b14['shift']());}}}(a19_0x39c6,0x677e7));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a19_0x26dd(_0x1cfaa2,_0x76c060){_0x1cfaa2=_0x1cfaa2-0xe2;const _0x39c62c=a19_0x39c6();let _0x26ddb2=_0x39c62c[_0x1cfaa2];return _0x26ddb2;}function a19_0x39c6(){const _0x4aee56=['3RCrLqO','message','yes','cwd','relativePath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','5624334RioRBu','834826LlGRmk','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','690140VyUbTQ','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','setPhase','map','\x20errors:','red','-\x20no\x20changes\x20applied','description','verbose','\x20campaigns\x20to\x20update:','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','engage','Workspace\x20is\x20required.','7ynZClt','results','def','engage_workspace','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','\x20\x20\x20\x20','site','3056340ulCLQJ','valid','23810idXnic','engage:campaign:push','dryRun','dirname','configDir','\x0aError:','Found\x20','error','config','dim','campaign_type','Aborted.','warnings','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','filter','5247060ZAxsKy','campaignId','Push\x20','name','path','segment','yellow','update','✔\x20Updated\x20','164OtIkXA','data','updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','create','969680VMNTQk','execute','Resolving\x20references...','action','\x20campaigns?','1\x20campaign\x20file:\x20','✔\x20Created\x20','workspace','errors','length','green','\x20campaigns','session','\x20new\x20campaigns:','created'];a19_0x39c6=function(){return _0x4aee56;};return a19_0x39c6();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a19_0x541383 from'chalk';import a19_0x16c9dc from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a19_0x29d27a(0x103)]=a19_0x29d27a(0xf2);[a19_0x29d27a(0xe2)]=a19_0x29d27a(0xfe);async[a19_0x29d27a(0x10f)](_0x598762){const _0x33e4d5=a19_0x29d27a,{options:_0x1d0ef9,args:_0x37a6c0,tdx:_0x2b321c}=_0x598762,_0x2bca96=_0x1d0ef9,_0x511a3c=_0x37a6c0[0x0],_0x520a9a=_0x511a3c?a19_0x16c9dc['resolve'](_0x511a3c):undefined,_0x3ac5a8=_0x520a9a?isYamlFile(_0x520a9a):![];let _0x3980ad;if(_0x3ac5a8&&_0x520a9a)_0x3980ad=a19_0x16c9dc[_0x33e4d5(0xf4)](_0x520a9a);else _0x520a9a?_0x3980ad=_0x520a9a:_0x3980ad=process[_0x33e4d5(0x120)]();let _0x54e487;const _0x330656=tryFindTdxConfig(_0x3980ad);_0x330656?.[_0x33e4d5(0xf9)][_0x33e4d5(0xeb)]&&(_0x54e487=_0x330656[_0x33e4d5(0xf9)]['engage_workspace'],!_0x3ac5a8&&(_0x3980ad=_0x330656[_0x33e4d5(0xf5)]));_0x2bca96['workspace']&&(_0x54e487=_0x2bca96[_0x33e4d5(0x115)]);if(!_0x54e487){const _0xfc57cf=loadSessionContext(_0x2bca96[_0x33e4d5(0x11a)]);_0xfc57cf?.[_0x33e4d5(0xeb)]&&(_0x54e487=_0xfc57cf[_0x33e4d5(0xeb)]);}if(!_0x54e487)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x106)](_0x33e4d5(0xe7))),console[_0x33e4d5(0xf8)]('\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console[_0x33e4d5(0xf8)](_0x33e4d5(0x10c)),console[_0x33e4d5(0xf8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console[_0x33e4d5(0xf8)](_0x33e4d5(0x125)),0x1;let _0x2df3bf;_0x3ac5a8&&_0x520a9a?_0x2df3bf=[_0x520a9a]:_0x2df3bf=discoverCampaignFiles(_0x3980ad);if(_0x2df3bf[_0x33e4d5(0x117)]===0x0)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x106)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x3980ad)),console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0xfa)](_0x33e4d5(0xec))),0x1;const _0xf15d44=_0x2df3bf[_0x33e4d5(0x129)](_0x51f6f9=>parseCampaignFile(_0x51f6f9,a19_0x16c9dc[_0x33e4d5(0xf4)](_0x51f6f9))),_0x1da844=_0xf15d44[_0x33e4d5(0x117)]===0x1?_0x33e4d5(0x113)+_0xf15d44[0x0][_0x33e4d5(0xea)][_0x33e4d5(0x103)]:_0xf15d44[_0x33e4d5(0x117)]+'\x20campaign\x20files';console[_0x33e4d5(0xf8)](_0x33e4d5(0xf7)+a19_0x541383['cyan'](_0x1da844));let _0x2fc044=![];for(const _0x322e4c of _0xf15d44){const _0xfced9a=validateCampaignDef(_0x322e4c[_0x33e4d5(0xea)]);if(!_0xfced9a[_0x33e4d5(0xf0)]){_0x2fc044=!![],console['error'](a19_0x541383[_0x33e4d5(0x12b)]('\x0aValidation\x20errors\x20in\x20'+_0x322e4c[_0x33e4d5(0x121)]+':'));for(const _0x51df36 of _0xfced9a[_0x33e4d5(0x116)]){console[_0x33e4d5(0xf8)]('\x20\x20'+a19_0x541383[_0x33e4d5(0x12b)]('✗')+'\x20'+_0x51df36[_0x33e4d5(0x104)]+':\x20'+_0x51df36[_0x33e4d5(0x11e)]);}}for(const _0x4c9d87 of _0xfced9a[_0x33e4d5(0xfd)]){console[_0x33e4d5(0xf8)]('\x20\x20'+a19_0x541383[_0x33e4d5(0x106)]('⚠')+'\x20'+_0x4c9d87['path']+':\x20'+_0x4c9d87[_0x33e4d5(0x11e)]);}}if(_0x2fc044)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x12b)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x280039=await _0x2b321c[_0x33e4d5(0xe6)]['resolveWorkspaceId'](_0x54e487),_0x380e87=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x54e487+'\x27...',_0x58ad33=>preparePush({'engage':_0x2b321c[_0x33e4d5(0xe6)],'segment':_0x2b321c[_0x33e4d5(0x105)]},_0xf15d44,_0x280039,{'progress':{'update':_0x11628d=>_0x58ad33[_0x33e4d5(0x128)](_0x11628d)}}),{'verbose':_0x2bca96[_0x33e4d5(0xe3)]}),_0x2564cf=_0x380e87[_0x33e4d5(0x10a)];await withProgressSpinner(_0x33e4d5(0x110),_0x431753=>resolveAndBuildInputs({'engage':_0x2b321c[_0x33e4d5(0xe6)],'segment':_0x2b321c[_0x33e4d5(0x105)]},_0x2564cf,_0x280039,{'progress':{'update':_0x348676=>_0x431753[_0x33e4d5(0x128)](_0x348676)}}),{'verbose':_0x2bca96[_0x33e4d5(0xe3)]});const _0x5f02b1=_0x2564cf['filter'](_0x3e3772=>_0x3e3772[_0x33e4d5(0x111)]===_0x33e4d5(0x10d)),_0x56ad5e=_0x2564cf[_0x33e4d5(0xff)](_0x2b789a=>_0x2b789a[_0x33e4d5(0x111)]===_0x33e4d5(0x107));console[_0x33e4d5(0xf8)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x54e487+'\x27:');if(_0x5f02b1['length']>0x0){console['error']('\x20\x20'+a19_0x541383[_0x33e4d5(0x118)]('+\x20'+_0x5f02b1[_0x33e4d5(0x117)]+_0x33e4d5(0x11b)));for(const _0x28a6b2 of _0x5f02b1){console[_0x33e4d5(0xf8)](_0x33e4d5(0xed)+a19_0x541383[_0x33e4d5(0x118)]('+')+'\x20'+_0x28a6b2[_0x33e4d5(0xea)][_0x33e4d5(0x103)]+'\x20('+_0x28a6b2[_0x33e4d5(0xea)][_0x33e4d5(0xfb)]+')');}}if(_0x56ad5e[_0x33e4d5(0x117)]>0x0){console[_0x33e4d5(0xf8)]('\x20\x20'+a19_0x541383[_0x33e4d5(0x106)]('~\x20'+_0x56ad5e['length']+_0x33e4d5(0xe4)));for(const _0x28ae5e of _0x56ad5e){console['error'](_0x33e4d5(0xed)+a19_0x541383[_0x33e4d5(0x106)]('~')+'\x20'+_0x28ae5e[_0x33e4d5(0xea)][_0x33e4d5(0x103)]+'\x20('+_0x28ae5e['def']['campaign_type']+')');}}if(_0x5f02b1[_0x33e4d5(0x117)]===0x0&&_0x56ad5e[_0x33e4d5(0x117)]===0x0)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x118)](_0x33e4d5(0xe5))),0x0;if(_0x2bca96[_0x33e4d5(0xf3)])return console[_0x33e4d5(0xf8)](a19_0x541383['yellow'](_0x33e4d5(0x127))),0x0;if(!_0x2bca96[_0x33e4d5(0x11f)]){if(!isInteractive())return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x12b)](_0x33e4d5(0xf6)),_0x33e4d5(0x122)),console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0xfa)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5f4dfb=await confirmKey(_0x33e4d5(0x102)+(_0x5f02b1[_0x33e4d5(0x117)]+_0x56ad5e[_0x33e4d5(0x117)])+_0x33e4d5(0x112));if(!_0x5f4dfb)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x106)](_0x33e4d5(0xfc)),_0x33e4d5(0x12c)),0x1;}const _0x3bb6ce=await withProgressSpinner('Pushing\x20campaigns...',_0x306aed=>executePush({'engage':_0x2b321c[_0x33e4d5(0xe6)],'segment':_0x2b321c[_0x33e4d5(0x105)]},_0x2564cf,{'progress':{'update':_0x4bb0a4=>_0x306aed[_0x33e4d5(0x128)](_0x4bb0a4)}}),{'verbose':_0x2bca96['verbose']}),_0x1ac1df=_0x3bb6ce['data'];for(const _0x31e704 of _0x1ac1df[_0x33e4d5(0xe9)]){if(_0x31e704[_0x33e4d5(0x101)]&&(_0x31e704[_0x33e4d5(0x111)]==='created'||_0x31e704[_0x33e4d5(0x111)]===_0x33e4d5(0x10b))){const _0x4b2f98=getCampaignUrl(_0x2bca96[_0x33e4d5(0xee)],_0x280039,_0x31e704[_0x33e4d5(0x101)]),_0x39977e=_0x31e704[_0x33e4d5(0x111)]===_0x33e4d5(0x11c)?'+':'~',_0x1b3117=_0x31e704[_0x33e4d5(0x111)]===_0x33e4d5(0x11c)?a19_0x541383[_0x33e4d5(0x118)](_0x39977e):a19_0x541383['yellow'](_0x39977e);console[_0x33e4d5(0xf8)]('\x20\x20'+_0x1b3117+'\x20'+hyperlink(_0x31e704['name'],_0x4b2f98)+'\x20'+a19_0x541383[_0x33e4d5(0xfa)](_0x4b2f98));}}_0x1ac1df[_0x33e4d5(0x11c)]>0x0&&console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x118)](_0x33e4d5(0x114)+_0x1ac1df[_0x33e4d5(0x11c)]+_0x33e4d5(0x119)));_0x1ac1df[_0x33e4d5(0x10b)]>0x0&&console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x118)](_0x33e4d5(0x108)+_0x1ac1df[_0x33e4d5(0x10b)]+_0x33e4d5(0x119)));if(_0x1ac1df[_0x33e4d5(0x116)][_0x33e4d5(0x117)]>0x0){console['error'](a19_0x541383[_0x33e4d5(0x12b)]('✘\x20'+_0x1ac1df[_0x33e4d5(0x116)]['length']+_0x33e4d5(0x12a)));for(const _0x588807 of _0x1ac1df[_0x33e4d5(0x116)]){console[_0x33e4d5(0xf8)]('\x20\x20'+a19_0x541383[_0x33e4d5(0x12b)](_0x588807['name'])+':\x20'+_0x588807['error']);}}return saveSessionContext({'engage_workspace':_0x54e487},_0x2bca96[_0x33e4d5(0x11a)]),_0x1ac1df[_0x33e4d5(0x116)][_0x33e4d5(0x117)]>0x0?0x1:0x0;}}
1
+ const a19_0xb804de=a19_0x3795;function a19_0x3795(_0x50324a,_0x627efc){_0x50324a=_0x50324a-0x1b9;const _0x40d5c0=a19_0x40d5();let _0x379505=_0x40d5c0[_0x50324a];return _0x379505;}(function(_0x17b23d,_0x635bb6){const _0x168392=a19_0x3795,_0x57d4aa=_0x17b23d();while(!![]){try{const _0x17ce8d=-parseInt(_0x168392(0x1ca))/0x1+parseInt(_0x168392(0x1c8))/0x2*(-parseInt(_0x168392(0x1fa))/0x3)+-parseInt(_0x168392(0x1d3))/0x4*(-parseInt(_0x168392(0x1cf))/0x5)+parseInt(_0x168392(0x1f2))/0x6*(parseInt(_0x168392(0x1fb))/0x7)+-parseInt(_0x168392(0x1e6))/0x8*(parseInt(_0x168392(0x1dc))/0x9)+-parseInt(_0x168392(0x201))/0xa*(-parseInt(_0x168392(0x1ef))/0xb)+-parseInt(_0x168392(0x1e4))/0xc*(-parseInt(_0x168392(0x1ea))/0xd);if(_0x17ce8d===_0x635bb6)break;else _0x57d4aa['push'](_0x57d4aa['shift']());}catch(_0x31acdf){_0x57d4aa['push'](_0x57d4aa['shift']());}}}(a19_0x40d5,0x4e7a1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a19_0x528359 from'chalk';import a19_0x516b73 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';function a19_0x40d5(){const _0x1a8f63=['Workspace\x20is\x20required.','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','setPhase','\x20campaigns?','34EBeLnr','yes','198037WuKuPn','Push\x20','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','name','\x20campaigns\x20to\x20update:','10JbXXsZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','site','update','397892pJMsqU','map','updated','green','Resolving\x20references...','engage','Aborted.','red','\x0aPush\x20summary\x20for\x20workspace\x20\x27','8667TchySd','data','workspace','error','✔\x20Updated\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','relativePath','yellow','48wTUZXi','length','4432tTHZeg','configDir','✔\x20Created\x20','path','327548fvRIsn','campaign_type','segment','engage:campaign:push','dirname','4595569wACOjc','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','create','6uyTzpL','def','campaignId','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','errors','warnings','session','cwd','36081ZXSpBa','3779510RTiTvb','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','\x20campaign\x20files','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','1\x20campaign\x20file:\x20','action','10wPDZYq','valid','Pushing\x20campaigns...','engage_workspace','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dim','verbose','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','resolve','\x20campaigns','message','execute','Preparing\x20push\x20to\x20workspace\x20\x27','filter','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\x27...','created'];a19_0x40d5=function(){return _0x1a8f63;};return a19_0x40d5();}import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a19_0xb804de(0x1cd)]=a19_0xb804de(0x1ed);['description']=a19_0xb804de(0x1fc);async[a19_0xb804de(0x1be)](_0x54a330){const _0x174f5f=a19_0xb804de,{options:_0x5438c4,args:_0x530e9a,tdx:_0x59c715}=_0x54a330,_0x42b8b4=_0x5438c4,_0x1217e4=_0x530e9a[0x0],_0x129ff5=_0x1217e4?a19_0x516b73[_0x174f5f(0x1bb)](_0x1217e4):undefined,_0x11d079=_0x129ff5?isYamlFile(_0x129ff5):![];let _0x1ad533;if(_0x11d079&&_0x129ff5)_0x1ad533=a19_0x516b73[_0x174f5f(0x1ee)](_0x129ff5);else _0x129ff5?_0x1ad533=_0x129ff5:_0x1ad533=process[_0x174f5f(0x1f9)]();let _0x2ee460;const _0x48e39a=tryFindTdxConfig(_0x1ad533);_0x48e39a?.['config'][_0x174f5f(0x204)]&&(_0x2ee460=_0x48e39a['config']['engage_workspace'],!_0x11d079&&(_0x1ad533=_0x48e39a[_0x174f5f(0x1e7)]));_0x42b8b4[_0x174f5f(0x1de)]&&(_0x2ee460=_0x42b8b4['workspace']);if(!_0x2ee460){const _0x137aab=loadSessionContext(_0x42b8b4['session']);_0x137aab?.['engage_workspace']&&(_0x2ee460=_0x137aab['engage_workspace']);}if(!_0x2ee460)return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1e3)](_0x174f5f(0x1c4))),console['error'](_0x174f5f(0x1ba)),console[_0x174f5f(0x1df)](_0x174f5f(0x1d0)),console[_0x174f5f(0x1df)](_0x174f5f(0x1e1)),console[_0x174f5f(0x1df)](_0x174f5f(0x1cc)),0x1;let _0x4b149;_0x11d079&&_0x129ff5?_0x4b149=[_0x129ff5]:_0x4b149=discoverCampaignFiles(_0x1ad533);if(_0x4b149[_0x174f5f(0x1e5)]===0x0)return console['error'](a19_0x528359[_0x174f5f(0x1e3)](_0x174f5f(0x1f0)+_0x1ad533)),console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x206)](_0x174f5f(0x1f5))),0x1;const _0x31d655=_0x4b149[_0x174f5f(0x1d4)](_0x306f15=>parseCampaignFile(_0x306f15,a19_0x516b73[_0x174f5f(0x1ee)](_0x306f15))),_0x759185=_0x31d655[_0x174f5f(0x1e5)]===0x1?_0x174f5f(0x1ff)+_0x31d655[0x0]['def']['name']:_0x31d655[_0x174f5f(0x1e5)]+_0x174f5f(0x1fd);console[_0x174f5f(0x1df)]('Found\x20'+a19_0x528359['cyan'](_0x759185));let _0x41688a=![];for(const _0x35c8dd of _0x31d655){const _0x36ac53=validateCampaignDef(_0x35c8dd[_0x174f5f(0x1f3)]);if(!_0x36ac53[_0x174f5f(0x202)]){_0x41688a=!![],console['error'](a19_0x528359[_0x174f5f(0x1da)]('\x0aValidation\x20errors\x20in\x20'+_0x35c8dd[_0x174f5f(0x1e2)]+':'));for(const _0x187770 of _0x36ac53[_0x174f5f(0x1f6)]){console['error']('\x20\x20'+a19_0x528359[_0x174f5f(0x1da)]('✗')+'\x20'+_0x187770['path']+':\x20'+_0x187770[_0x174f5f(0x1bd)]);}}for(const _0x40434c of _0x36ac53[_0x174f5f(0x1f7)]){console[_0x174f5f(0x1df)]('\x20\x20'+a19_0x528359[_0x174f5f(0x1e3)]('⚠')+'\x20'+_0x40434c[_0x174f5f(0x1e9)]+':\x20'+_0x40434c[_0x174f5f(0x1bd)]);}}if(_0x41688a)return console[_0x174f5f(0x1df)](a19_0x528359['red'](_0x174f5f(0x1fe))),0x1;const _0x45edb6=await _0x59c715[_0x174f5f(0x1d8)]['resolveWorkspaceId'](_0x2ee460),_0x533614=await withProgressSpinner(_0x174f5f(0x1bf)+_0x2ee460+_0x174f5f(0x1c2),_0x2d23d2=>preparePush({'engage':_0x59c715[_0x174f5f(0x1d8)],'segment':_0x59c715[_0x174f5f(0x1ec)]},_0x31d655,_0x45edb6,{'progress':{'update':_0x5f15da=>_0x2d23d2[_0x174f5f(0x1c6)](_0x5f15da)}}),{'verbose':_0x42b8b4[_0x174f5f(0x1b9)]}),_0x257bf8=_0x533614[_0x174f5f(0x1dd)];await withProgressSpinner(_0x174f5f(0x1d7),_0x8df3b7=>resolveAndBuildInputs({'engage':_0x59c715['engage'],'segment':_0x59c715['segment']},_0x257bf8,_0x45edb6,{'progress':{'update':_0x8bc2ad=>_0x8df3b7['setPhase'](_0x8bc2ad)}}),{'verbose':_0x42b8b4[_0x174f5f(0x1b9)]});const _0x682b7d=_0x257bf8[_0x174f5f(0x1c0)](_0x3cb729=>_0x3cb729[_0x174f5f(0x200)]===_0x174f5f(0x1f1)),_0x166c76=_0x257bf8[_0x174f5f(0x1c0)](_0x19871e=>_0x19871e[_0x174f5f(0x200)]===_0x174f5f(0x1d2));console[_0x174f5f(0x1df)](_0x174f5f(0x1db)+_0x2ee460+'\x27:');if(_0x682b7d[_0x174f5f(0x1e5)]>0x0){console['error']('\x20\x20'+a19_0x528359[_0x174f5f(0x1d6)]('+\x20'+_0x682b7d[_0x174f5f(0x1e5)]+'\x20new\x20campaigns:'));for(const _0x47f695 of _0x682b7d){console[_0x174f5f(0x1df)]('\x20\x20\x20\x20'+a19_0x528359['green']('+')+'\x20'+_0x47f695['def'][_0x174f5f(0x1cd)]+'\x20('+_0x47f695[_0x174f5f(0x1f3)][_0x174f5f(0x1eb)]+')');}}if(_0x166c76['length']>0x0){console[_0x174f5f(0x1df)]('\x20\x20'+a19_0x528359[_0x174f5f(0x1e3)]('~\x20'+_0x166c76[_0x174f5f(0x1e5)]+_0x174f5f(0x1ce)));for(const _0x317ebb of _0x166c76){console['error']('\x20\x20\x20\x20'+a19_0x528359[_0x174f5f(0x1e3)]('~')+'\x20'+_0x317ebb[_0x174f5f(0x1f3)][_0x174f5f(0x1cd)]+'\x20('+_0x317ebb[_0x174f5f(0x1f3)][_0x174f5f(0x1eb)]+')');}}if(_0x682b7d[_0x174f5f(0x1e5)]===0x0&&_0x166c76[_0x174f5f(0x1e5)]===0x0)return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1d6)]('✔\x20All\x20campaigns\x20are\x20up\x20to\x20date')),0x0;if(_0x42b8b4['dryRun'])return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1e3)](_0x174f5f(0x1c1))),0x0;if(!_0x42b8b4[_0x174f5f(0x1c9)]){if(!isInteractive())return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1da)]('\x0aError:'),_0x174f5f(0x1c5)),console[_0x174f5f(0x1df)](a19_0x528359['dim'](_0x174f5f(0x205))),0x1;const _0x4c94ae=await confirmKey(_0x174f5f(0x1cb)+(_0x682b7d[_0x174f5f(0x1e5)]+_0x166c76[_0x174f5f(0x1e5)])+_0x174f5f(0x1c7));if(!_0x4c94ae)return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1e3)](_0x174f5f(0x1d9)),'-\x20no\x20changes\x20applied'),0x1;}const _0x463eba=await withProgressSpinner(_0x174f5f(0x203),_0x823878=>executePush({'engage':_0x59c715[_0x174f5f(0x1d8)],'segment':_0x59c715[_0x174f5f(0x1ec)]},_0x257bf8,{'progress':{'update':_0x3c7f13=>_0x823878[_0x174f5f(0x1c6)](_0x3c7f13)}}),{'verbose':_0x42b8b4[_0x174f5f(0x1b9)]}),_0x5edb28=_0x463eba[_0x174f5f(0x1dd)];for(const _0xd0f557 of _0x5edb28['results']){if(_0xd0f557[_0x174f5f(0x1f4)]&&(_0xd0f557['action']===_0x174f5f(0x1c3)||_0xd0f557[_0x174f5f(0x200)]===_0x174f5f(0x1d5))){const _0x58a16c=getCampaignUrl(_0x42b8b4[_0x174f5f(0x1d1)],_0x45edb6,_0xd0f557['campaignId']),_0x5e7ce1=_0xd0f557[_0x174f5f(0x200)]===_0x174f5f(0x1c3)?'+':'~',_0x25ebd3=_0xd0f557['action']===_0x174f5f(0x1c3)?a19_0x528359[_0x174f5f(0x1d6)](_0x5e7ce1):a19_0x528359['yellow'](_0x5e7ce1);console[_0x174f5f(0x1df)]('\x20\x20'+_0x25ebd3+'\x20'+hyperlink(_0xd0f557[_0x174f5f(0x1cd)],_0x58a16c)+'\x20'+a19_0x528359['dim'](_0x58a16c));}}_0x5edb28[_0x174f5f(0x1c3)]>0x0&&console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1d6)](_0x174f5f(0x1e8)+_0x5edb28[_0x174f5f(0x1c3)]+'\x20campaigns'));_0x5edb28[_0x174f5f(0x1d5)]>0x0&&console['error'](a19_0x528359['green'](_0x174f5f(0x1e0)+_0x5edb28['updated']+_0x174f5f(0x1bc)));if(_0x5edb28[_0x174f5f(0x1f6)][_0x174f5f(0x1e5)]>0x0){console['error'](a19_0x528359[_0x174f5f(0x1da)]('✘\x20'+_0x5edb28[_0x174f5f(0x1f6)]['length']+'\x20errors:'));for(const _0x38e209 of _0x5edb28[_0x174f5f(0x1f6)]){console[_0x174f5f(0x1df)]('\x20\x20'+a19_0x528359['red'](_0x38e209[_0x174f5f(0x1cd)])+':\x20'+_0x38e209[_0x174f5f(0x1df)]);}}return saveSessionContext({'engage_workspace':_0x2ee460},_0x42b8b4[_0x174f5f(0x1f8)]),_0x5edb28[_0x174f5f(0x1f6)]['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a20_0x215e69=a20_0x3669;(function(_0x18e635,_0x5bc6f2){const _0x3077fe=a20_0x3669,_0x423156=_0x18e635();while(!![]){try{const _0x53e068=-parseInt(_0x3077fe(0x1d2))/0x1*(-parseInt(_0x3077fe(0x1d7))/0x2)+parseInt(_0x3077fe(0x1dc))/0x3+-parseInt(_0x3077fe(0x1d0))/0x4+-parseInt(_0x3077fe(0x1f2))/0x5*(parseInt(_0x3077fe(0x1f4))/0x6)+parseInt(_0x3077fe(0x1e4))/0x7+-parseInt(_0x3077fe(0x1db))/0x8+parseInt(_0x3077fe(0x1fa))/0x9;if(_0x53e068===_0x5bc6f2)break;else _0x423156['push'](_0x423156['shift']());}catch(_0x4d0e36){_0x423156['push'](_0x423156['shift']());}}}(a20_0x1e29,0x91402));import{BaseCommand}from'./command.js';function a20_0x3669(_0x2167aa,_0x2bcbe8){_0x2167aa=_0x2167aa-0x1cb;const _0x1e297f=a20_0x1e29();let _0x366924=_0x1e297f[_0x2167aa];return _0x366924;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a20_0x1e29(){const _0x3dca21=['.yaml','1594341ZxcwXj','\x20non-campaign\x20file(s)\x20skipped)','verbose','length','\x20(skipped:\x20','\x20non-campaign\x20file(s)\x20skipped','✔\x20All\x20','1300060zvMwvH','\x20warning(s)','121jEQEfz','dirname','warningCount','log','red','18152bIgOlP','endsWith','Error:\x20Directory\x20not\x20found:\x20','\x20campaign(s)\x20with\x20errors,\x20','173232ngBeTt','1234557mDesfL','invalidCount','engage:campaign:validate','errors','hasErrors','\x20warning(s)\x20found','\x20campaign(s)\x20valid','campaign','459865HjZKep','reason','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cwd','dim','Validate\x20campaign\x20YAML\x20files','warnings','relativePath','valid','error','validCount','skippedCount','.yml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','320smmcZw','name','76026BNWucy','filter','green','\x20error(s)','yellow'];a20_0x1e29=function(){return _0x3dca21;};return a20_0x1e29();}import a20_0x2af9bb from'chalk';import a20_0x571a25 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a20_0x215e69(0x1f3)]=a20_0x215e69(0x1de);['description']=a20_0x215e69(0x1e9);async['execute'](_0x5568c6){const _0x418035=a20_0x215e69,{options:_0x5ad493,args:_0x5e81cb}=_0x5568c6,_0x57c175=_0x5ad493,_0x5a7154=_0x5e81cb[0x0],_0x449cf4=_0x5a7154?a20_0x571a25['resolve'](_0x5a7154):undefined,_0x41a3b3=_0x449cf4?isYamlFile(_0x449cf4):![];let _0x13da8c,_0x443c13;if(_0x41a3b3&&_0x449cf4)_0x13da8c=a20_0x571a25[_0x418035(0x1d3)](_0x449cf4),_0x443c13=_0x449cf4;else _0x449cf4?_0x13da8c=_0x449cf4:_0x13da8c=process[_0x418035(0x1e7)]();if(!_0x443c13&&!existsSync(_0x13da8c))return console[_0x418035(0x1ed)](a20_0x2af9bb[_0x418035(0x1d6)](_0x418035(0x1d9)+_0x13da8c+'\x0a')),0x1;let _0x5e8715;if(_0x443c13){if(!_0x443c13[_0x418035(0x1d8)](_0x418035(0x1f0))&&!_0x443c13[_0x418035(0x1d8)](_0x418035(0x1f9)))return console['error'](a20_0x2af9bb[_0x418035(0x1d6)](_0x418035(0x1f1)+_0x443c13+'\x0a')),0x1;_0x5e8715=[_0x443c13];}else _0x5e8715=findYamlFiles(_0x13da8c);if(_0x5e8715[_0x418035(0x1cc)]===0x0)return console[_0x418035(0x1ed)](a20_0x2af9bb['red'](_0x418035(0x1e6)+_0x13da8c+'\x0a')),0x1;const _0x296a4d=validateYamlFiles(_0x5e8715,_0x13da8c,{'filterType':_0x418035(0x1e3)}),_0x31e8c8=calculateSummary(_0x296a4d),_0x22d983=_0x296a4d[_0x418035(0x1f5)](isValidationResult);if(_0x22d983[_0x418035(0x1cc)]===0x0)return console['error'](a20_0x2af9bb[_0x418035(0x1f8)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x13da8c+'\x0a')),_0x31e8c8[_0x418035(0x1ef)]>0x0&&console[_0x418035(0x1ed)](a20_0x2af9bb[_0x418035(0x1e8)]('('+_0x31e8c8[_0x418035(0x1ef)]+_0x418035(0x1fb))),0x0;for(const _0x2d9105 of _0x296a4d){if(!isValidationResult(_0x2d9105)){_0x57c175[_0x418035(0x1cb)]&&console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1e8)]('-\x20'+_0x2d9105[_0x418035(0x1eb)]+_0x418035(0x1cd)+_0x2d9105[_0x418035(0x1e5)]+')'));continue;}const {relativePath:_0xe511ea,source:_0x1078aa,result:_0x3f35cf}=_0x2d9105;if(_0x3f35cf[_0x418035(0x1ec)]&&_0x3f35cf['warnings'][_0x418035(0x1cc)]===0x0)_0x57c175[_0x418035(0x1cb)]&&console[_0x418035(0x1d5)](a20_0x2af9bb['green']('✔\x20'+_0xe511ea));else _0x3f35cf[_0x418035(0x1ec)]?(console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1f8)]('⚠\x20'+_0xe511ea+':\x20'+_0x3f35cf[_0x418035(0x1ea)][_0x418035(0x1cc)]+_0x418035(0x1d1))),console[_0x418035(0x1d5)](formatValidationResult(_0x3f35cf,_0x1078aa,_0xe511ea))):(console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1d6)]('✖\x20'+_0xe511ea+':\x20'+_0x3f35cf[_0x418035(0x1df)][_0x418035(0x1cc)]+_0x418035(0x1f7))),console[_0x418035(0x1d5)](formatValidationResult(_0x3f35cf,_0x1078aa,_0xe511ea)));}return console[_0x418035(0x1d5)](''),_0x31e8c8[_0x418035(0x1e0)]?(console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1d6)]('Validation\x20failed:\x20'+_0x31e8c8[_0x418035(0x1dd)]+_0x418035(0x1da)+_0x31e8c8['validCount']+'\x20valid')),_0x31e8c8[_0x418035(0x1d4)]>0x0&&console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1f8)](_0x31e8c8[_0x418035(0x1d4)]+'\x20warning(s)\x20found')),_0x31e8c8[_0x418035(0x1ef)]>0x0&&console['log'](a20_0x2af9bb[_0x418035(0x1e8)](_0x31e8c8['skippedCount']+_0x418035(0x1ce))),0x1):(console['log'](a20_0x2af9bb[_0x418035(0x1f6)](_0x418035(0x1cf)+_0x31e8c8[_0x418035(0x1ee)]+_0x418035(0x1e2))),_0x31e8c8[_0x418035(0x1d4)]>0x0&&console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1f8)](_0x31e8c8[_0x418035(0x1d4)]+_0x418035(0x1e1))),_0x31e8c8[_0x418035(0x1ef)]>0x0&&console[_0x418035(0x1d5)](a20_0x2af9bb['dim'](_0x31e8c8[_0x418035(0x1ef)]+_0x418035(0x1ce))),0x0);}}
1
+ const a20_0x1d4d71=a20_0xaf7d;(function(_0xbdd3d4,_0x1f427a){const _0x147964=a20_0xaf7d,_0x78d5de=_0xbdd3d4();while(!![]){try{const _0x10f406=-parseInt(_0x147964(0x1b3))/0x1+-parseInt(_0x147964(0x1aa))/0x2*(parseInt(_0x147964(0x1a1))/0x3)+parseInt(_0x147964(0x195))/0x4+parseInt(_0x147964(0x1ab))/0x5*(-parseInt(_0x147964(0x1b1))/0x6)+-parseInt(_0x147964(0x19c))/0x7+-parseInt(_0x147964(0x1af))/0x8+-parseInt(_0x147964(0x185))/0x9*(-parseInt(_0x147964(0x193))/0xa);if(_0x10f406===_0x1f427a)break;else _0x78d5de['push'](_0x78d5de['shift']());}catch(_0x8f12c8){_0x78d5de['push'](_0x78d5de['shift']());}}}(a20_0x5088,0x6599b));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a20_0x5088(){const _0x2dfb0f=['name','resolve','Validation\x20failed:\x20','9zGMQES','cwd','filter','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)','log','\x20warning(s)\x20found','warnings','valid','\x20error(s)','warningCount','skippedCount','✔\x20All\x20','yellow','15658730JIICuW','length','2970608SCvxav','dirname','reason','dim','verbose','Validate\x20campaign\x20YAML\x20files','\x20campaign(s)\x20valid','5787173EkPFjz','campaign','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','relativePath','error','69tMdAKL','green','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','description','\x20valid','errors','\x20(skipped:\x20','endsWith','\x20non-campaign\x20file(s)\x20skipped','15554GNafrd','115jaVEwM','Error:\x20Directory\x20not\x20found:\x20','\x20campaign(s)\x20with\x20errors,\x20','red','4875368UXomhi','.yml','15642OaKqae','validCount','217378GQSiYJ'];a20_0x5088=function(){return _0x2dfb0f;};return a20_0x5088();}function a20_0xaf7d(_0x400bb2,_0x234bf6){_0x400bb2=_0x400bb2-0x184;const _0x5088dc=a20_0x5088();let _0xaf7de7=_0x5088dc[_0x400bb2];return _0xaf7de7;}import a20_0x268542 from'chalk';import a20_0xa10da8 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a20_0x1d4d71(0x1b4)]='engage:campaign:validate';[a20_0x1d4d71(0x1a4)]=a20_0x1d4d71(0x19a);async['execute'](_0x1c3055){const _0x138de3=a20_0x1d4d71,{options:_0x5617f9,args:_0x11d862}=_0x1c3055,_0x1664f1=_0x5617f9,_0x460ea4=_0x11d862[0x0],_0x870760=_0x460ea4?a20_0xa10da8[_0x138de3(0x1b5)](_0x460ea4):undefined,_0x530776=_0x870760?isYamlFile(_0x870760):![];let _0x3112b0,_0x12d6d2;if(_0x530776&&_0x870760)_0x3112b0=a20_0xa10da8[_0x138de3(0x196)](_0x870760),_0x12d6d2=_0x870760;else _0x870760?_0x3112b0=_0x870760:_0x3112b0=process[_0x138de3(0x186)]();if(!_0x12d6d2&&!existsSync(_0x3112b0))return console['error'](a20_0x268542['red'](_0x138de3(0x1ac)+_0x3112b0+'\x0a')),0x1;let _0x7d8580;if(_0x12d6d2){if(!_0x12d6d2[_0x138de3(0x1a8)](_0x138de3(0x1b0))&&!_0x12d6d2[_0x138de3(0x1a8)]('.yaml'))return console[_0x138de3(0x1a0)](a20_0x268542[_0x138de3(0x1ae)](_0x138de3(0x1a3)+_0x12d6d2+'\x0a')),0x1;_0x7d8580=[_0x12d6d2];}else _0x7d8580=findYamlFiles(_0x3112b0);if(_0x7d8580['length']===0x0)return console[_0x138de3(0x1a0)](a20_0x268542[_0x138de3(0x1ae)](_0x138de3(0x19e)+_0x3112b0+'\x0a')),0x1;const _0x3ee7c2=validateYamlFiles(_0x7d8580,_0x3112b0,{'filterType':_0x138de3(0x19d)}),_0x48649e=calculateSummary(_0x3ee7c2),_0x168ca5=_0x3ee7c2[_0x138de3(0x187)](isValidationResult);if(_0x168ca5[_0x138de3(0x194)]===0x0)return console[_0x138de3(0x1a0)](a20_0x268542[_0x138de3(0x192)](_0x138de3(0x188)+_0x3112b0+'\x0a')),_0x48649e[_0x138de3(0x190)]>0x0&&console[_0x138de3(0x1a0)](a20_0x268542[_0x138de3(0x198)]('('+_0x48649e[_0x138de3(0x190)]+'\x20non-campaign\x20file(s)\x20skipped)')),0x0;for(const _0x52b246 of _0x3ee7c2){if(!isValidationResult(_0x52b246)){_0x1664f1[_0x138de3(0x199)]&&console[_0x138de3(0x18a)](a20_0x268542['dim']('-\x20'+_0x52b246[_0x138de3(0x19f)]+_0x138de3(0x1a7)+_0x52b246[_0x138de3(0x197)]+')'));continue;}const {relativePath:_0x4921d7,source:_0x1fe526,result:_0x542376}=_0x52b246;if(_0x542376['valid']&&_0x542376[_0x138de3(0x18c)][_0x138de3(0x194)]===0x0)_0x1664f1[_0x138de3(0x199)]&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x1a2)]('✔\x20'+_0x4921d7));else _0x542376[_0x138de3(0x18d)]?(console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x192)]('⚠\x20'+_0x4921d7+':\x20'+_0x542376['warnings'][_0x138de3(0x194)]+_0x138de3(0x189))),console[_0x138de3(0x18a)](formatValidationResult(_0x542376,_0x1fe526,_0x4921d7))):(console['log'](a20_0x268542[_0x138de3(0x1ae)]('✖\x20'+_0x4921d7+':\x20'+_0x542376[_0x138de3(0x1a6)][_0x138de3(0x194)]+_0x138de3(0x18e))),console[_0x138de3(0x18a)](formatValidationResult(_0x542376,_0x1fe526,_0x4921d7)));}return console[_0x138de3(0x18a)](''),_0x48649e['hasErrors']?(console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x1ae)](_0x138de3(0x184)+_0x48649e['invalidCount']+_0x138de3(0x1ad)+_0x48649e[_0x138de3(0x1b2)]+_0x138de3(0x1a5))),_0x48649e[_0x138de3(0x18f)]>0x0&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x192)](_0x48649e['warningCount']+_0x138de3(0x18b))),_0x48649e['skippedCount']>0x0&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x198)](_0x48649e[_0x138de3(0x190)]+_0x138de3(0x1a9))),0x1):(console['log'](a20_0x268542[_0x138de3(0x1a2)](_0x138de3(0x191)+_0x48649e[_0x138de3(0x1b2)]+_0x138de3(0x19b))),_0x48649e[_0x138de3(0x18f)]>0x0&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x192)](_0x48649e[_0x138de3(0x18f)]+_0x138de3(0x18b))),_0x48649e[_0x138de3(0x190)]>0x0&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x198)](_0x48649e[_0x138de3(0x190)]+_0x138de3(0x1a9))),0x0);}}
@@ -1 +1 @@
1
- const a21_0x1786d2=a21_0x472b;(function(_0x47b02b,_0x59dd03){const _0x287a2f=a21_0x472b,_0x4a2c25=_0x47b02b();while(!![]){try{const _0x639e1e=parseInt(_0x287a2f(0x152))/0x1+-parseInt(_0x287a2f(0xc1))/0x2*(parseInt(_0x287a2f(0xf0))/0x3)+parseInt(_0x287a2f(0x12a))/0x4+parseInt(_0x287a2f(0x91))/0x5*(parseInt(_0x287a2f(0xc9))/0x6)+-parseInt(_0x287a2f(0x9f))/0x7+-parseInt(_0x287a2f(0x129))/0x8+-parseInt(_0x287a2f(0xed))/0x9*(parseInt(_0x287a2f(0xef))/0xa);if(_0x639e1e===_0x59dd03)break;else _0x4a2c25['push'](_0x4a2c25['shift']());}catch(_0x5e0bf7){_0x4a2c25['push'](_0x4a2c25['shift']());}}}(a21_0x242b,0x2b03d));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl,getTemplateUrl,getWorkspaceUrl}from'../sdk/client/endpoints.js';import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a21_0x46c0be from'chalk';export async function resolveWorkspaceIdFromOptions(_0x3ee583,_0x49edaa,_0x57ff13=![]){const _0x5f3013=a21_0x472b;if(_0x3ee583[_0x5f3013(0xd7)])return await _0x49edaa[_0x5f3013(0x14e)][_0x5f3013(0xb3)](_0x3ee583['workspace']);const _0x17c66d=loadSessionContext(_0x3ee583[_0x5f3013(0x157)]);if(_0x17c66d?.['engage_workspace'])return await _0x49edaa[_0x5f3013(0x14e)][_0x5f3013(0xb3)](_0x17c66d[_0x5f3013(0xb0)]);if(_0x57ff13)throw new SDKError(ErrorCode[_0x5f3013(0x109)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':_0x5f3013(0xec)});return undefined;}async function resolveSegmentFromOptions(_0x1fdac9,_0x3c3f4f){const _0x141888=a21_0x472b;if(!_0x1fdac9[_0x141888(0x10c)])return{};const _0x3e6ff2=_0x1fdac9[_0x141888(0x10c)],_0x514323=await _0x3c3f4f['segment']['resolvePathToResource'](_0x3e6ff2);return{'audienceId':_0x514323[_0x141888(0x10d)],'audienceName':_0x514323[_0x141888(0x14c)],..._0x514323[_0x141888(0xa0)]&&{'segmentId':_0x514323[_0x141888(0xa0)],'segmentName':_0x514323[_0x141888(0xa7)]}};}function buildConnectorConfig(_0x547029){const _0x3c6021=a21_0x472b,_0x35a660=_0x547029[_0x3c6021(0xeb)],_0x49e2a8=_0x547029[_0x3c6021(0xe4)];if(!_0x35a660&&!_0x49e2a8)return undefined;return{..._0x35a660&&{'emailSenderId':_0x35a660},..._0x49e2a8&&{'jsonColumns':_0x49e2a8}};}export class EngageCampaignsCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x98);['description']=a21_0x1786d2(0x123);async['execute'](_0x3d33a2){const _0x27ff42=a21_0x1786d2,{options:_0x5c99eb,args:_0x3d6d84,tdx:_0x4639c8}=_0x3d33a2,_0x212d2b=_0x3d6d84[0x0],_0x355f80=resolveLimit(_0x5c99eb[_0x27ff42(0x137)],DEFAULT_LLM_LIMIT),_0x102f91=_0x5c99eb,_0x30f4da=_0x102f91['type'],_0x44f998=[_0x27ff42(0xc7),_0x27ff42(0xe3),_0x27ff42(0x124),_0x27ff42(0x108)],_0x3cb138=_0x102f91[_0x27ff42(0x118)],_0x21ad7e=_0x3cb138?.['toUpperCase']();if(_0x21ad7e&&!_0x44f998[_0x27ff42(0x12f)](_0x21ad7e))return console[_0x27ff42(0xb5)](_0x27ff42(0x13f)+_0x3cb138+_0x27ff42(0x9d)+_0x44f998[_0x27ff42(0xe6)](',\x20')),0x1;const _0x295239=await resolveWorkspaceIdFromOptions(_0x102f91,_0x4639c8),_0xa45a78=await withSpinner(_0x27ff42(0xbf),()=>_0x4639c8['engage'][_0x27ff42(0x114)]({'type':_0x30f4da,'status':_0x21ad7e,'workspaceId':_0x295239,'limit':_0x355f80}),{'verbose':_0x5c99eb[_0x27ff42(0x142)]});let _0x226036=_0xa45a78[_0x27ff42(0x147)];_0x21ad7e&&(_0x226036=_0x226036[_0x27ff42(0x105)](_0x13c9b2=>_0x13c9b2['status'][_0x27ff42(0x101)]()===_0x21ad7e));_0x212d2b&&(_0x226036=_0x226036[_0x27ff42(0x105)](_0x12d531=>matchGlobPattern(_0x12d531[_0x27ff42(0xcb)],_0x212d2b)));const _0x575585=_0x5c99eb[_0x27ff42(0xf4)];if(isStructuredFormat(_0x5c99eb)){const _0x386256=_0x226036[_0x27ff42(0xff)](_0x4a8833=>({..._0x4a8833,'url':_0x4a8833[_0x27ff42(0x94)]?getCampaignUrl(_0x575585,_0x4a8833[_0x27ff42(0x94)],_0x4a8833['id']):undefined}));await handleSDKOutput(_0x386256,_0x5c99eb);}else for(const _0x1eeb85 of _0x226036){const _0x56a574=a21_0x46c0be['dim']('\x20('+_0x1eeb85[_0x27ff42(0x118)]['toLowerCase']()+')'),_0x518b9c=_0x1eeb85['workspaceId']?getCampaignUrl(_0x575585,_0x1eeb85[_0x27ff42(0x94)],_0x1eeb85['id']):undefined,_0x1ce700=_0x518b9c?hyperlink(_0x1eeb85[_0x27ff42(0xcb)],_0x518b9c):_0x1eeb85[_0x27ff42(0xcb)];console['log']('📧\x20'+_0x1ce700+_0x56a574);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']=a21_0x1786d2(0xf3);['description']='Show\x20campaign\x20details';async[a21_0x1786d2(0xfb)](_0x16f2b0){const _0x400121=a21_0x1786d2,{options:_0x58b15f,args:_0x4b8969,tdx:_0x314aad}=_0x16f2b0;if(_0x4b8969[_0x400121(0x141)]===0x0)return console[_0x400121(0xb5)](_0x400121(0xe9)),console['error'](_0x400121(0x12c)),0x1;const _0x334996=_0x4b8969[0x0],_0x268103=_0x58b15f,_0x223e42=await resolveWorkspaceIdFromOptions(_0x268103,_0x314aad),_0x3d32f0=_0x268103['full'],_0x5d26ce=_0x58b15f[_0x400121(0xf4)];if(_0x3d32f0){const _0x5103b8=await withSpinner(_0x400121(0x13e)+_0x334996+_0x400121(0x133),()=>_0x314aad[_0x400121(0x14e)][_0x400121(0x136)](_0x334996,_0x223e42),{'verbose':_0x58b15f[_0x400121(0x142)]}),_0x5e2721=_0x5103b8[_0x400121(0x147)],_0x567d68=_0x5e2721[_0x400121(0x8e)][_0x400121(0x94)]?getCampaignUrl(_0x5d26ce,_0x5e2721[_0x400121(0x8e)][_0x400121(0x94)],_0x5e2721['id']):undefined;await handleSDKOutput([{..._0x5e2721,..._0x567d68&&{'url':_0x567d68}}],_0x58b15f);}else{const _0x16c1e5=await withSpinner(_0x400121(0x13e)+_0x334996+_0x400121(0x133),()=>_0x314aad[_0x400121(0x14e)][_0x400121(0xa4)](_0x334996,_0x223e42),{'verbose':_0x58b15f[_0x400121(0x142)]}),_0x25429b=_0x16c1e5[_0x400121(0x147)],_0x5664d1=_0x25429b[_0x400121(0x94)]?getCampaignUrl(_0x5d26ce,_0x25429b[_0x400121(0x94)],_0x25429b['id']):undefined;await handleSingleObjectOutput({..._0x25429b,..._0x5664d1&&{'url':_0x5664d1}},_0x58b15f);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x144);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x146);async['execute'](_0x32b99a){const _0x2ada0e=a21_0x1786d2,{options:_0x4c5092,tdx:_0x473289}=_0x32b99a,_0x3bf0ef=_0x4c5092,_0x1ee7f=_0x3bf0ef['name'],_0x1d396c=_0x3bf0ef['type'];if(!_0x1ee7f)return console[_0x2ada0e(0xb5)](_0x2ada0e(0xf5)),console[_0x2ada0e(0xb5)](_0x2ada0e(0x103)),0x1;if(!_0x1d396c)return console[_0x2ada0e(0xb5)](_0x2ada0e(0x111)),console[_0x2ada0e(0xb5)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x5be6a0=await resolveWorkspaceIdFromOptions(_0x3bf0ef,_0x473289,!![]),_0x289613=await resolveSegmentFromOptions(_0x3bf0ef,_0x473289),_0x2173b9=buildConnectorConfig(_0x3bf0ef),_0x163102={'name':_0x1ee7f,'campaignType':_0x1d396c,'workspaceId':_0x5be6a0,'description':_0x3bf0ef[_0x2ada0e(0xbb)],..._0x289613,'connectorConfig':_0x2173b9,'startAt':_0x3bf0ef[_0x2ada0e(0x89)],'timezone':_0x3bf0ef[_0x2ada0e(0x14a)]},_0x272050=await withSpinner(_0x2ada0e(0xd1)+_0x1ee7f+_0x2ada0e(0x133),()=>_0x473289[_0x2ada0e(0x14e)]['createCampaign'](_0x163102));return await handleSDKOutput([_0x272050['data']],_0x4c5092),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xf1);['description']=a21_0x1786d2(0xa1);async['execute'](_0x75da1d){const _0x384ecf=a21_0x1786d2,{options:_0x119e02,args:_0x4ef86f,tdx:_0x5110ee}=_0x75da1d;if(_0x4ef86f[_0x384ecf(0x141)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x384ecf(0x113)),0x1;const _0x90074e=_0x4ef86f[0x0],_0x3f7bb0=_0x119e02,_0x1f1353=await resolveWorkspaceIdFromOptions(_0x3f7bb0,_0x5110ee),_0x1d520f=await resolveSegmentFromOptions(_0x3f7bb0,_0x5110ee),_0x241b87=buildConnectorConfig(_0x3f7bb0),_0x1ffce3={'name':_0x3f7bb0[_0x384ecf(0xcb)],'description':_0x3f7bb0['description'],..._0x1d520f,'connectorConfig':_0x241b87,'startAt':_0x3f7bb0[_0x384ecf(0x89)],'timezone':_0x3f7bb0[_0x384ecf(0x14a)]},_0x496fbd=Object[_0x384ecf(0xf7)](Object['entries'](_0x1ffce3)[_0x384ecf(0x105)](([,_0x5e76a2])=>_0x5e76a2!==undefined));if(Object[_0x384ecf(0xc5)](_0x496fbd)[_0x384ecf(0x141)]===0x0)return console[_0x384ecf(0xb5)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x384ecf(0xb5)](_0x384ecf(0x8c)),0x1;const _0x1f84cb=await withSpinner(_0x384ecf(0x11d)+_0x90074e+_0x384ecf(0x133),()=>_0x5110ee[_0x384ecf(0x14e)]['updateCampaign'](_0x90074e,_0x496fbd,_0x1f1353),{'verbose':_0x119e02['verbose']});return await handleSDKOutput([_0x1f84cb[_0x384ecf(0x147)]],_0x119e02),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xbc);['description']=a21_0x1786d2(0x86);async[a21_0x1786d2(0xfb)](_0x3f0738){const _0x1193e1=a21_0x1786d2,{options:_0x312984,args:_0x4c92f0,tdx:_0x490c6a}=_0x3f0738;if(_0x4c92f0['length']===0x0)return console[_0x1193e1(0xb5)](_0x1193e1(0xe9)),console[_0x1193e1(0xb5)](_0x1193e1(0x119)),0x1;const _0x149457=_0x4c92f0[0x0],_0x44cd9b=_0x312984,_0x38b8e9=await resolveWorkspaceIdFromOptions(_0x44cd9b,_0x490c6a);if(!_0x312984[_0x1193e1(0x90)]){const _0x23f66c=await confirm(_0x1193e1(0xa6)+_0x149457+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x23f66c)return console[_0x1193e1(0x117)](_0x1193e1(0x15a)),0x0;}return await withSpinner(_0x1193e1(0x158)+_0x149457+'\x27...',()=>_0x490c6a['engage'][_0x1193e1(0xaa)](_0x149457,_0x38b8e9),{'verbose':_0x312984[_0x1193e1(0x142)]}),console[_0x1193e1(0x117)](_0x1193e1(0xbd)+_0x149457+_0x1193e1(0x126)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']=a21_0x1786d2(0xcd);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xd9);async['execute'](_0x3bd68d){const _0x259b22=a21_0x1786d2,{options:_0xdc3a18,args:_0x119033,tdx:_0x57ae01}=_0x3bd68d;if(_0x119033[_0x259b22(0x141)]===0x0)return console[_0x259b22(0xb5)](_0x259b22(0xe9)),console[_0x259b22(0xb5)](_0x259b22(0xaf)),0x1;const _0x3d5b58=_0x119033[0x0],_0x5bbaba=_0xdc3a18,_0x4c2046=await resolveWorkspaceIdFromOptions(_0x5bbaba,_0x57ae01);return await withSpinner(_0x259b22(0xb6)+_0x3d5b58+_0x259b22(0x133),()=>_0x57ae01['engage'][_0x259b22(0xad)](_0x3d5b58,_0x4c2046),{'verbose':_0xdc3a18[_0x259b22(0x142)]}),console[_0x259b22(0x117)](_0x259b22(0xbd)+_0x3d5b58+_0x259b22(0xdb)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x14f);['description']=a21_0x1786d2(0x11f);async['execute'](_0x46386f){const _0x582681=a21_0x1786d2,{options:_0x281316,args:_0x1c045b,tdx:_0x2952ee}=_0x46386f;if(_0x1c045b[_0x582681(0x141)]===0x0)return console[_0x582681(0xb5)](_0x582681(0xe9)),console['error'](_0x582681(0x130)),0x1;const _0x3b8a33=_0x1c045b[0x0],_0x3f7d70=_0x281316,_0x2ad01d=await resolveWorkspaceIdFromOptions(_0x3f7d70,_0x2952ee);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x3b8a33+_0x582681(0x133),()=>_0x2952ee[_0x582681(0x14e)]['pauseCampaign'](_0x3b8a33,_0x2ad01d),{'verbose':_0x281316['verbose']}),console[_0x582681(0x117)]('Campaign\x20\x27'+_0x3b8a33+_0x582681(0xc4)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x13a);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x128);async[a21_0x1786d2(0xfb)](_0x333e51){const _0x52c33e=a21_0x1786d2,{options:_0x4550e4,args:_0x11c712,tdx:_0x263bcc}=_0x333e51;if(_0x11c712[_0x52c33e(0x141)]===0x0)return console[_0x52c33e(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x52c33e(0xb5)](_0x52c33e(0xa9)),0x1;const _0x103285=_0x11c712[0x0],_0xb6b891=_0x4550e4,_0x4ab5d6=await resolveWorkspaceIdFromOptions(_0xb6b891,_0x263bcc);return await withSpinner(_0x52c33e(0xd0)+_0x103285+_0x52c33e(0x133),()=>_0x263bcc[_0x52c33e(0x14e)]['resumeCampaign'](_0x103285,_0x4ab5d6),{'verbose':_0x4550e4[_0x52c33e(0x142)]}),console[_0x52c33e(0x117)](_0x52c33e(0xbd)+_0x103285+_0x52c33e(0x127)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a21_0x1786d2(0xc8);['description']=a21_0x1786d2(0xfc);async['execute'](_0x423e98){const _0x1e4dba=a21_0x1786d2,{options:_0x438873,args:_0x16d155,tdx:_0x4167c5}=_0x423e98;if(_0x16d155[_0x1e4dba(0x141)]===0x0)return console[_0x1e4dba(0xb5)](_0x1e4dba(0xe9)),console[_0x1e4dba(0xb5)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x4bf9a5=_0x16d155[0x0],_0x4956ec=_0x438873,_0x482a74=await resolveWorkspaceIdFromOptions(_0x4956ec,_0x4167c5),_0x349e5e=await withSpinner(_0x1e4dba(0xd3)+_0x4bf9a5+'\x27...',()=>_0x4167c5[_0x1e4dba(0x14e)][_0x1e4dba(0xce)](_0x4bf9a5,_0x482a74),{'verbose':_0x438873[_0x1e4dba(0x142)]});return await handleSDKOutput([_0x349e5e[_0x1e4dba(0x147)]],_0x438873),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a21_0x1786d2(0xcc);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xdf);async[a21_0x1786d2(0xfb)](_0x28e134){const _0x328084=a21_0x1786d2,{options:_0x138906,args:_0xc7cbfc,tdx:_0x2111da}=_0x28e134,_0x1fdc73=_0xc7cbfc[0x0],_0x4f11c2=resolveLimit(_0x138906['limit'],DEFAULT_LLM_LIMIT),_0x198a85=_0x138906,_0xe9778d=await resolveWorkspaceIdFromOptions(_0x198a85,_0x2111da),_0x59b137=await withSpinner('Fetching\x20templates...',()=>_0x2111da[_0x328084(0x14e)][_0x328084(0xd5)]({'workspaceId':_0xe9778d,'limit':_0x4f11c2}),{'verbose':_0x138906['verbose']});let _0x16d8f9=_0x59b137[_0x328084(0x147)];_0x1fdc73&&(_0x16d8f9=_0x59b137[_0x328084(0x147)][_0x328084(0x105)](_0x275b85=>matchGlobPattern(_0x275b85[_0x328084(0xcb)],_0x1fdc73)));const _0x1e3ade=_0x138906['site'];if(isStructuredFormat(_0x138906))await handleSDKOutput(_0x16d8f9,_0x138906);else for(const _0x4ad3f6 of _0x16d8f9){const _0x2bb228=_0x4ad3f6['workspaceId']?getTemplateUrl(_0x1e3ade,_0x4ad3f6['workspaceId'],_0x4ad3f6['id']):undefined,_0x260b15=_0x2bb228?hyperlink(_0x4ad3f6[_0x328084(0xcb)],_0x2bb228):_0x4ad3f6[_0x328084(0xcb)];console[_0x328084(0x117)](_0x328084(0xc3)+_0x260b15);}return 0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xa3);[a21_0x1786d2(0xbb)]='Show\x20email\x20template\x20details';async[a21_0x1786d2(0xfb)](_0xb180ff){const _0x239bbd=a21_0x1786d2,{options:_0x2a7334,args:_0x30b689,tdx:_0x17b8b1}=_0xb180ff;if(_0x30b689[_0x239bbd(0x141)]===0x0)return console['error'](_0x239bbd(0x120)),console[_0x239bbd(0xb5)](_0x239bbd(0x9a)),0x1;const _0x5ca5bb=_0x30b689[0x0],_0x1d8e8a=_0x2a7334,_0x23ab84=await resolveWorkspaceIdFromOptions(_0x1d8e8a,_0x17b8b1),_0x4a848a=_0x1d8e8a['full'];if(_0x4a848a){const _0x1379fe=await withSpinner(_0x239bbd(0xe8)+_0x5ca5bb+_0x239bbd(0x133),()=>_0x17b8b1['engage'][_0x239bbd(0xa2)](_0x5ca5bb,_0x23ab84),{'verbose':_0x2a7334[_0x239bbd(0x142)]});await handleSDKOutput([_0x1379fe],_0x2a7334);}else{const _0x371e64=await withSpinner(_0x239bbd(0xe8)+_0x5ca5bb+_0x239bbd(0x133),()=>_0x17b8b1[_0x239bbd(0x14e)][_0x239bbd(0x154)](_0x5ca5bb,_0x23ab84),{'verbose':_0x2a7334[_0x239bbd(0x142)]});await handleSDKOutput([_0x371e64],_0x2a7334);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xe2);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x97);async[a21_0x1786d2(0xfb)](_0x470fb0){const _0x26850e=a21_0x1786d2,{options:_0x4d1e25,tdx:_0x4aa360}=_0x470fb0,_0x11b05a=_0x4d1e25,_0xd2ecb6=_0x11b05a[_0x26850e(0xcb)],_0x4c8de3=_0x11b05a[_0x26850e(0x8b)],_0x2f1bdb=_0x11b05a[_0x26850e(0xfa)],_0x440f65=_0x11b05a[_0x26850e(0x102)];if(!_0xd2ecb6)return console[_0x26850e(0xb5)]('Error:\x20--name\x20is\x20required'),console[_0x26850e(0xb5)](_0x26850e(0x153)),0x1;if(!_0x4c8de3)return console['error'](_0x26850e(0xd6)),0x1;if(_0x2f1bdb&&_0x440f65)return console['error'](_0x26850e(0x116)),0x1;const _0x4fcb3c=_0x440f65?readFileContent(_0x440f65):_0x2f1bdb;if(!_0x4fcb3c)return console[_0x26850e(0xb5)](_0x26850e(0x156)),0x1;const _0x769dff=await resolveWorkspaceIdFromOptions(_0x11b05a,_0x4aa360,!![]),_0x15bfdc={'name':_0xd2ecb6,'subjectTemplate':_0x4c8de3,'htmlTemplate':_0x4fcb3c,'workspaceId':_0x769dff,'plaintextTemplate':_0x11b05a[_0x26850e(0xcf)],'editorType':_0x11b05a[_0x26850e(0xfd)]??_0x26850e(0xf2)},_0xc702b9=await withSpinner('Creating\x20template\x20\x27'+_0xd2ecb6+'\x27...',()=>_0x4aa360['engage'][_0x26850e(0xc6)](_0x15bfdc));return await handleSDKOutput([_0xc702b9[_0x26850e(0x147)]],_0x4d1e25),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xb8);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x13c);async[a21_0x1786d2(0xfb)](_0x2df3bb){const _0xcff02f=a21_0x1786d2,{options:_0x21de69,args:_0x29747d,tdx:_0x1032d3}=_0x2df3bb;if(_0x29747d[_0xcff02f(0x141)]===0x0)return console['error'](_0xcff02f(0x120)),console[_0xcff02f(0xb5)](_0xcff02f(0xe0)),0x1;const _0x13a530=_0x29747d[0x0],_0x463f43=_0x21de69,_0x3f04a5=_0x463f43[_0xcff02f(0xfa)],_0x14d31f=_0x463f43['htmlFile'];if(_0x3f04a5&&_0x14d31f)return console[_0xcff02f(0xb5)](_0xcff02f(0x116)),0x1;const _0x420623=_0x14d31f?readFileContent(_0x14d31f):_0x3f04a5,_0x17e0f2=await resolveWorkspaceIdFromOptions(_0x463f43,_0x1032d3),_0x542796={'name':_0x463f43[_0xcff02f(0xcb)],'subjectTemplate':_0x463f43['subject'],'htmlTemplate':_0x420623,'plaintextTemplate':_0x463f43[_0xcff02f(0xcf)]},_0x3b77b0=Object[_0xcff02f(0xf7)](Object[_0xcff02f(0x104)](_0x542796)[_0xcff02f(0x105)](([,_0x10d2ca])=>_0x10d2ca!==undefined));if(Object['keys'](_0x3b77b0)[_0xcff02f(0x141)]===0x0)return console[_0xcff02f(0xb5)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error']('Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext'),0x1;const _0x1c76d1=await withSpinner(_0xcff02f(0x12b)+_0x13a530+_0xcff02f(0x133),()=>_0x1032d3['engage'][_0xcff02f(0x11c)](_0x13a530,_0x3b77b0,_0x17e0f2),{'verbose':_0x21de69[_0xcff02f(0x142)]});return await handleSDKOutput([_0x1c76d1['data']],_0x21de69),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xee);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x13b);async[a21_0x1786d2(0xfb)](_0x1c9938){const _0x1fc459=a21_0x1786d2,{options:_0x45b199,args:_0x14630c,tdx:_0x990f9f}=_0x1c9938;if(_0x14630c[_0x1fc459(0x141)]===0x0)return console[_0x1fc459(0xb5)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x1fc459(0xb5)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x2c421a=_0x14630c[0x0],_0xb9652d=_0x45b199,_0x2933df=await resolveWorkspaceIdFromOptions(_0xb9652d,_0x990f9f);if(!_0x45b199[_0x1fc459(0x90)]){const _0x472561=await confirm(_0x1fc459(0x11b)+_0x2c421a+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x472561)return console[_0x1fc459(0x117)](_0x1fc459(0x15a)),0x0;}return await withSpinner(_0x1fc459(0xfe)+_0x2c421a+'\x27...',()=>_0x990f9f[_0x1fc459(0x14e)][_0x1fc459(0xe7)](_0x2c421a,_0x2933df),{'verbose':_0x45b199[_0x1fc459(0x142)]}),console[_0x1fc459(0x117)]('Template\x20\x27'+_0x2c421a+'\x27\x20deleted\x20successfully'),0x0;}}function a21_0x242b(){const _0x41ed14=['Updating\x20campaign\x20\x27','engage:always-on-campaign:finish','Pause\x20a\x20campaign','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','🏢\x20','Resuming\x20always-on\x20campaign\x20\x27','List\x20campaigns','PAUSED','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','\x27\x20deleted\x20successfully','\x27\x20resumed\x20successfully','Resume\x20a\x20paused\x20campaign','882024zYFsQf','387828vHRMHi','Updating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','engage:workspace:show','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','includes','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','full','\x27...','engage:workspaces','engage:always-on-campaigns','getCampaignFull','limit','audienceName','Pausing\x20always-on\x20campaign\x20\x27','engage:campaign:resume','Delete\x20an\x20email\x20template','Update\x20an\x20email\x20template','pauseAlwaysOnCampaign','Fetching\x20campaign\x20\x27','Error:\x20Invalid\x20status\x20\x22','FINISHED','length','verbose','Finish\x20an\x20always-on\x20campaign','engage:campaign:create','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','Create\x20a\x20new\x20campaign','data','getWorkspace','listWorkspaces','timezone','engage:always-on-campaign:pause','parentName','dim','engage','engage:campaign:pause','engage:always-on-campaign:duplicate','Verifying\x20workspace\x20\x27','308371CvShYl','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','getTemplate','Error:\x20Workspace\x20name\x20is\x20required','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','session','Deleting\x20campaign\x20\x27','toLowerCase','Operation\x20cancelled','\x27?\x20This\x20cannot\x20be\x20undone.','Delete\x20a\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>','startAt','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','subject','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Update\x20an\x20always-on\x20campaign','attributes','Set\x20workspace\x20context\x20for\x20Engage\x20commands','yes','130yamxSe','Updating\x20workspace\x20\x27','audienceId','workspaceId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>','Create\x20an\x20email\x20template','engage:campaigns','Creating\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Fetching\x20always-on\x20campaign\x20\x27','\x22.\x20Valid\x20values:\x20','Duplicate\x20an\x20always-on\x20campaign','734132TTkUHn','segmentId','Update\x20a\x20campaign','getTemplateFull','engage:template:show','getCampaign','\x27\x20finished\x20successfully','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','segmentName','Fetching\x20workspaces...','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','deleteCampaign','Launching\x20always-on\x20campaign\x20\x27','Always-on\x20campaign\x20\x27','launchCampaign','listAlwaysOnCampaigns','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','engage_workspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:always-on-campaign:update','resolveWorkspaceId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','error','Launching\x20campaign\x20\x27','resumeAlwaysOnCampaign','engage:template:update','Duplicating\x20always-on\x20campaign\x20\x27','createWorkspace','description','engage:campaign:delete','Campaign\x20\x27','List\x20workspaces','Fetching\x20campaigns...','engage:always-on-campaign:create','154764iKsUUx','updateWorkspace','📝\x20','\x27\x20paused\x20successfully','keys','createTemplate','DRAFT','engage:campaign:duplicate','72294zfVfZs','Launch\x20an\x20always-on\x20campaign','name','engage:templates','engage:campaign:launch','duplicateCampaign','plaintext','Resuming\x20campaign\x20\x27','Creating\x20campaign\x20\x27','Workspace\x20\x27','Duplicating\x20campaign\x20\x27','createAlwaysOnCampaign','listTemplates','Error:\x20--subject\x20is\x20required','workspace','Create\x20a\x20workspace','Launch\x20a\x20campaign','LIVE','\x27\x20launched\x20successfully','type','Fetching\x20workspace\x20\x27','launchAlwaysOnCampaign','List\x20email\x20templates','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Update\x20a\x20workspace','engage:template:create','ACTIVE','jsonColumns','Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>','join','deleteTemplate','Fetching\x20template\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:workspace:delete','emailSenderId','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','428121jFENiX','engage:template:delete','20ZIFVpS','9UfcLpv','engage:campaign:update','grapesjs','engage:campaign:show','site','Error:\x20--name\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27','fromEntries','Finishing\x20always-on\x20campaign\x20\x27','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','html','execute','Duplicate\x20a\x20campaign','editorType','Deleting\x20template\x20\x27','map','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','toUpperCase','htmlFile','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','entries','filter','engage:always-on-campaign:delete','📧\x20','COMPLETED','MISSING_ARGUMENT','getAlwaysOnCampaignFull','enableUtmTracking','segment','parentId','Deleting\x20workspace\x20\x27','Delete\x20a\x20workspace','Resume\x20a\x20paused\x20always-on\x20campaign','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:always-on-campaign:launch','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','listCampaigns','Deleting\x20always-on\x20campaign\x20\x27','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','log','status','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','updateTemplate'];a21_0x242b=function(){return _0x41ed14;};return a21_0x242b();}export class EngageWorkspacesCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x134);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xbe);async['execute'](_0x4538bb){const _0x49d9f7=a21_0x1786d2,{options:_0x6000fb,args:_0x48408b,tdx:_0x4a4e22}=_0x4538bb,_0x50da44=_0x48408b[0x0],_0x223c2b=resolveLimit(_0x6000fb['limit'],DEFAULT_LLM_LIMIT),_0x24f3a8=await withSpinner(_0x49d9f7(0xa8),()=>_0x4a4e22[_0x49d9f7(0x14e)][_0x49d9f7(0x149)]({'limit':_0x223c2b}),{'verbose':_0x6000fb['verbose']});let _0x694e17=_0x24f3a8[_0x49d9f7(0x147)];_0x50da44&&(_0x694e17=_0x24f3a8[_0x49d9f7(0x147)][_0x49d9f7(0x105)](_0x5f5855=>matchGlobPattern(_0x5f5855[_0x49d9f7(0xcb)],_0x50da44)));const _0x22ac30=_0x6000fb[_0x49d9f7(0xf4)];if(isStructuredFormat(_0x6000fb))await handleSDKOutput(_0x694e17,_0x6000fb);else for(const _0x60fb17 of _0x694e17){const _0x59b563=getWorkspaceUrl(_0x22ac30,_0x60fb17['id']),_0x5ca740=hyperlink(_0x60fb17[_0x49d9f7(0xcb)],_0x59b563);console[_0x49d9f7(0x117)](_0x49d9f7(0x121)+_0x5ca740);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a21_0x1786d2(0x12d);[a21_0x1786d2(0xbb)]='Show\x20workspace\x20details';async['execute'](_0x1333c4){const _0x5ce4a6=a21_0x1786d2,{options:_0x421ec9,args:_0x52d8b0,tdx:_0x555ced}=_0x1333c4;if(_0x52d8b0[_0x5ce4a6(0x141)]===0x0)return console[_0x5ce4a6(0xb5)](_0x5ce4a6(0x8a)),console[_0x5ce4a6(0xb5)](_0x5ce4a6(0x87)),0x1;const _0x5d6663=_0x52d8b0[0x0],_0xa34c52=_0x421ec9,_0x159c29=_0xa34c52[_0x5ce4a6(0x132)];if(_0x159c29){const _0x1908ee=await withSpinner(_0x5ce4a6(0xdd)+_0x5d6663+_0x5ce4a6(0x133),()=>_0x555ced[_0x5ce4a6(0x14e)]['getWorkspaceFull'](_0x5d6663),{'verbose':_0x421ec9[_0x5ce4a6(0x142)]});await handleSDKOutput([_0x1908ee],_0x421ec9);}else{const _0x257a24=await withSpinner(_0x5ce4a6(0xdd)+_0x5d6663+_0x5ce4a6(0x133),()=>_0x555ced[_0x5ce4a6(0x14e)][_0x5ce4a6(0x148)](_0x5d6663),{'verbose':_0x421ec9[_0x5ce4a6(0x142)]});await handleSDKOutput([_0x257a24],_0x421ec9);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']='engage:workspace:create';['description']=a21_0x1786d2(0xd8);async[a21_0x1786d2(0xfb)](_0x5e7fd9){const _0x3aa72a=a21_0x1786d2,{options:_0x1be572,tdx:_0x341c29}=_0x5e7fd9,_0x18cdaa=_0x1be572,_0xa6d9cb=_0x18cdaa['name'];if(!_0xa6d9cb)return console[_0x3aa72a(0xb5)](_0x3aa72a(0xf5)),console[_0x3aa72a(0xb5)](_0x3aa72a(0x100)),0x1;const _0x18f4ef={'name':_0xa6d9cb,'description':_0x18cdaa['description']},_0x30db64=await withSpinner('Creating\x20workspace\x20\x27'+_0xa6d9cb+'\x27...',()=>_0x341c29[_0x3aa72a(0x14e)][_0x3aa72a(0xba)](_0x18f4ef));return await handleSDKOutput([_0x30db64[_0x3aa72a(0x147)]],_0x1be572),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]='engage:workspace:update';[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xe1);async[a21_0x1786d2(0xfb)](_0x318003){const _0x9917a6=a21_0x1786d2,{options:_0x204267,args:_0xb2fa35,tdx:_0x3f66fd}=_0x318003;if(_0xb2fa35[_0x9917a6(0x141)]===0x0)return console[_0x9917a6(0xb5)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x9917a6(0xb5)](_0x9917a6(0x9b)),0x1;const _0x31999c=_0xb2fa35[0x0],_0x3978ec=_0x204267,_0x3edd31={'name':_0x3978ec[_0x9917a6(0xcb)],'description':_0x3978ec[_0x9917a6(0xbb)]},_0x4f54b8=Object[_0x9917a6(0xf7)](Object[_0x9917a6(0x104)](_0x3edd31)['filter'](([,_0x3f2a4b])=>_0x3f2a4b!==undefined));if(Object[_0x9917a6(0xc5)](_0x4f54b8)[_0x9917a6(0x141)]===0x0)return console['error'](_0x9917a6(0xf9)),console['error']('Options:\x20--name,\x20--description'),0x1;const _0x120ce5=await withSpinner(_0x9917a6(0x92)+_0x31999c+_0x9917a6(0x133),()=>_0x3f66fd[_0x9917a6(0x14e)][_0x9917a6(0xc2)](_0x31999c,_0x4f54b8),{'verbose':_0x204267[_0x9917a6(0x142)]});return await handleSDKOutput([_0x120ce5['data']],_0x204267),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xea);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x10f);async['execute'](_0x15a708){const _0x2e50d0=a21_0x1786d2,{options:_0x5b5129,args:_0x369876,tdx:_0x45dd19}=_0x15a708;if(_0x369876[_0x2e50d0(0x141)]===0x0)return console['error'](_0x2e50d0(0x8a)),console['error'](_0x2e50d0(0x12e)),0x1;const _0x11fcb8=_0x369876[0x0];if(!_0x5b5129[_0x2e50d0(0x90)]){const _0x1e2aa5=await confirm(_0x2e50d0(0xb1)+_0x11fcb8+_0x2e50d0(0x15b));if(!_0x1e2aa5)return console['log'](_0x2e50d0(0x15a)),0x0;}return await withSpinner(_0x2e50d0(0x10e)+_0x11fcb8+_0x2e50d0(0x133),()=>_0x45dd19['engage']['deleteWorkspace'](_0x11fcb8),{'verbose':_0x5b5129[_0x2e50d0(0x142)]}),console['log'](_0x2e50d0(0xd2)+_0x11fcb8+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x135);[a21_0x1786d2(0xbb)]='List\x20always-on\x20campaigns';async[a21_0x1786d2(0xfb)](_0x26cb97){const _0x55d3f7=a21_0x1786d2,{options:_0x11bace,args:_0x15481f,tdx:_0x39dd70}=_0x26cb97,_0x516863=_0x15481f[0x0],_0x197e2a=resolveLimit(_0x11bace[_0x55d3f7(0x137)],DEFAULT_LLM_LIMIT),_0x25d476=_0x11bace,_0x10aaec=_0x25d476[_0x55d3f7(0xdc)],_0x4e6ee7=[_0x55d3f7(0xc7),_0x55d3f7(0xda),_0x55d3f7(0x124),_0x55d3f7(0x140)],_0x268265=_0x25d476[_0x55d3f7(0x118)],_0x335536=_0x268265?.[_0x55d3f7(0x101)]();if(_0x335536&&!_0x4e6ee7[_0x55d3f7(0x12f)](_0x335536))return console['error'](_0x55d3f7(0x13f)+_0x268265+_0x55d3f7(0x9d)+_0x4e6ee7[_0x55d3f7(0xe6)](',\x20')),0x1;const _0x13d945=await resolveWorkspaceIdFromOptions(_0x25d476,_0x39dd70,!![]),_0x263d9b=await withSpinner('Fetching\x20always-on\x20campaigns...',()=>_0x39dd70[_0x55d3f7(0x14e)][_0x55d3f7(0xae)]({'workspaceId':_0x13d945,'type':_0x10aaec,'status':_0x335536,'limit':_0x197e2a}),{'verbose':_0x11bace['verbose']});let _0x646663=_0x263d9b[_0x55d3f7(0x147)];_0x335536&&(_0x646663=_0x646663['filter'](_0xa9a177=>_0xa9a177[_0x55d3f7(0x118)][_0x55d3f7(0x101)]()===_0x335536));_0x516863&&(_0x646663=_0x646663[_0x55d3f7(0x105)](_0x2e510b=>matchGlobPattern(_0x2e510b[_0x55d3f7(0xcb)],_0x516863)));const _0x461932=_0x11bace[_0x55d3f7(0xf4)];if(isStructuredFormat(_0x11bace)){const _0x462df8=_0x646663[_0x55d3f7(0xff)](_0x314c0f=>({..._0x314c0f,'url':getCampaignUrl(_0x461932,_0x314c0f[_0x55d3f7(0x94)],_0x314c0f['id'])}));await handleSDKOutput(_0x462df8,_0x11bace);}else for(const _0x251823 of _0x646663){const _0x55c380=a21_0x46c0be[_0x55d3f7(0x14d)]('\x20('+_0x251823['status'][_0x55d3f7(0x159)]()+')'),_0x101fa0=getCampaignUrl(_0x461932,_0x251823[_0x55d3f7(0x94)],_0x251823['id']),_0x2c5ed7=hyperlink(_0x251823[_0x55d3f7(0xcb)],_0x101fa0);console[_0x55d3f7(0x117)](_0x55d3f7(0x107)+_0x2c5ed7+_0x55c380);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{[a21_0x1786d2(0xcb)]='engage:always-on-campaign:show';[a21_0x1786d2(0xbb)]='Show\x20always-on\x20campaign\x20details';async[a21_0x1786d2(0xfb)](_0x1ee112){const _0x270864=a21_0x1786d2,{options:_0x245c20,args:_0x458df4,tdx:_0x383bd5}=_0x1ee112;if(_0x458df4['length']===0x0)return console[_0x270864(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x270864(0xe5)),0x1;const _0x246c51=_0x458df4[0x0],_0xd67c9f=_0x245c20,_0x2b0b4c=await resolveWorkspaceIdFromOptions(_0xd67c9f,_0x383bd5,!![]),_0xf7917c=_0xd67c9f[_0x270864(0x132)],_0x3728e8=_0x245c20[_0x270864(0xf4)];if(_0xf7917c){const _0x4584c4=await withSpinner('Fetching\x20always-on\x20campaign\x20\x27'+_0x246c51+_0x270864(0x133),()=>_0x383bd5[_0x270864(0x14e)][_0x270864(0x10a)](_0x2b0b4c,_0x246c51),{'verbose':_0x245c20[_0x270864(0x142)]}),_0x1fa90f=_0x4584c4[_0x270864(0x147)],_0x5e4233=getCampaignUrl(_0x3728e8,_0x1fa90f[_0x270864(0x8e)]['workspaceId'],_0x1fa90f['id']);await handleSDKOutput([{..._0x1fa90f,'url':_0x5e4233}],_0x245c20);}else{const _0x301991=await withSpinner(_0x270864(0x9c)+_0x246c51+_0x270864(0x133),()=>_0x383bd5[_0x270864(0x14e)]['getAlwaysOnCampaign'](_0x2b0b4c,_0x246c51),{'verbose':_0x245c20[_0x270864(0x142)]}),_0x44154e=_0x301991[_0x270864(0x147)],_0x44a84c=getCampaignUrl(_0x3728e8,_0x44154e[_0x270864(0x94)],_0x44154e['id']);await handleSingleObjectOutput({..._0x44154e,'url':_0x44a84c},_0x245c20);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xc0);[a21_0x1786d2(0xbb)]='Create\x20a\x20new\x20always-on\x20campaign';async[a21_0x1786d2(0xfb)](_0x396a06){const _0x32d191=a21_0x1786d2,{options:_0x304f48,tdx:_0x268b5b}=_0x396a06,_0x22dabf=_0x304f48,_0x13695f=_0x22dabf[_0x32d191(0xcb)],_0x3c6c5d=_0x22dabf[_0x32d191(0xdc)];if(!_0x13695f)return console[_0x32d191(0xb5)](_0x32d191(0xf5)),console[_0x32d191(0xb5)](_0x32d191(0xb4)),0x1;if(!_0x3c6c5d)return console[_0x32d191(0xb5)](_0x32d191(0x111)),console[_0x32d191(0xb5)](_0x32d191(0xb4)),0x1;const _0x3297f7=await resolveWorkspaceIdFromOptions(_0x22dabf,_0x268b5b,!![]),_0x553f9c=await resolveSegmentFromOptions(_0x22dabf,_0x268b5b),_0x4de3f5={'name':_0x13695f,'campaignType':_0x3c6c5d,'workspaceId':_0x3297f7,'description':_0x22dabf[_0x32d191(0xbb)],'audienceId':_0x553f9c[_0x32d191(0x93)],'audienceName':_0x553f9c[_0x32d191(0x138)],'enableUtmTracking':_0x22dabf[_0x32d191(0x10b)]},_0x1fa9e6=await withSpinner(_0x32d191(0x99)+_0x13695f+_0x32d191(0x133),()=>_0x268b5b[_0x32d191(0x14e)][_0x32d191(0xd4)](_0x3297f7,_0x4de3f5));return await handleSDKOutput([_0x1fa9e6[_0x32d191(0x147)]],_0x304f48),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xb2);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x8d);async[a21_0x1786d2(0xfb)](_0x1432ef){const _0x8732a7=a21_0x1786d2,{options:_0x2d2293,args:_0x1e0621,tdx:_0x1b1829}=_0x1432ef;if(_0x1e0621[_0x8732a7(0x141)]===0x0)return console['error'](_0x8732a7(0xe9)),console['error']('Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x11508e=_0x1e0621[0x0],_0x2cd980=_0x2d2293,_0x38889c=await resolveWorkspaceIdFromOptions(_0x2cd980,_0x1b1829,!![]),_0x2bf3fb=await resolveSegmentFromOptions(_0x2cd980,_0x1b1829),_0x35caaf={'name':_0x2cd980[_0x8732a7(0xcb)],'description':_0x2cd980['description'],'audienceId':_0x2bf3fb['audienceId'],'audienceName':_0x2bf3fb[_0x8732a7(0x138)],'enableUtmTracking':_0x2cd980[_0x8732a7(0x10b)]},_0x3bd153=Object[_0x8732a7(0xf7)](Object[_0x8732a7(0x104)](_0x35caaf)['filter'](([,_0x8741fb])=>_0x8741fb!==undefined));if(Object[_0x8732a7(0xc5)](_0x3bd153)['length']===0x0)return console['error'](_0x8732a7(0xf9)),console[_0x8732a7(0xb5)](_0x8732a7(0x145)),0x1;const _0xfdb818=await withSpinner('Updating\x20always-on\x20campaign\x20\x27'+_0x11508e+_0x8732a7(0x133),()=>_0x1b1829[_0x8732a7(0x14e)]['updateAlwaysOnCampaign'](_0x38889c,_0x11508e,_0x3bd153),{'verbose':_0x2d2293[_0x8732a7(0x142)]});return await handleSDKOutput([_0xfdb818[_0x8732a7(0x147)]],_0x2d2293),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x106);[a21_0x1786d2(0xbb)]='Delete\x20an\x20always-on\x20campaign';async[a21_0x1786d2(0xfb)](_0x4daa6d){const _0xd5e7bf=a21_0x1786d2,{options:_0x5171b0,args:_0x2a28d9,tdx:_0xc11a64}=_0x4daa6d;if(_0x2a28d9[_0xd5e7bf(0x141)]===0x0)return console[_0xd5e7bf(0xb5)](_0xd5e7bf(0xe9)),console[_0xd5e7bf(0xb5)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>'),0x1;const _0x237425=_0x2a28d9[0x0],_0x76201d=_0x5171b0,_0x5de449=await resolveWorkspaceIdFromOptions(_0x76201d,_0xc11a64,!![]);if(!_0x5171b0[_0xd5e7bf(0x90)]){const _0x16674b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27'+_0x237425+_0xd5e7bf(0x15b));if(!_0x16674b)return console['log'](_0xd5e7bf(0x15a)),0x0;}return await withSpinner(_0xd5e7bf(0x115)+_0x237425+_0xd5e7bf(0x133),()=>_0xc11a64['engage']['deleteAlwaysOnCampaign'](_0x5de449,_0x237425),{'verbose':_0x5171b0[_0xd5e7bf(0x142)]}),console['log']('Always-on\x20campaign\x20\x27'+_0x237425+_0xd5e7bf(0x126)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x112);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xca);async[a21_0x1786d2(0xfb)](_0x411536){const _0x463fac=a21_0x1786d2,{options:_0x2963e0,args:_0xfe770e,tdx:_0x5d0d3b}=_0x411536;if(_0xfe770e[_0x463fac(0x141)]===0x0)return console[_0x463fac(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x463fac(0x88)),0x1;const _0x1a91d5=_0xfe770e[0x0],_0x1eafea=_0x2963e0,_0x5724cc=await resolveWorkspaceIdFromOptions(_0x1eafea,_0x5d0d3b,!![]);return await withSpinner(_0x463fac(0xab)+_0x1a91d5+'\x27...',()=>_0x5d0d3b[_0x463fac(0x14e)][_0x463fac(0xde)](_0x5724cc,_0x1a91d5),{'verbose':_0x2963e0[_0x463fac(0x142)]}),console['log'](_0x463fac(0xac)+_0x1a91d5+_0x463fac(0xdb)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{['name']=a21_0x1786d2(0x14b);[a21_0x1786d2(0xbb)]='Pause\x20an\x20always-on\x20campaign';async[a21_0x1786d2(0xfb)](_0x5f3b25){const _0xa2ece6=a21_0x1786d2,{options:_0x5688bb,args:_0x2fce25,tdx:_0x5599cb}=_0x5f3b25;if(_0x2fce25[_0xa2ece6(0x141)]===0x0)return console[_0xa2ece6(0xb5)](_0xa2ece6(0xe9)),console[_0xa2ece6(0xb5)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>'),0x1;const _0x1d74dc=_0x2fce25[0x0],_0x2a7bbb=_0x5688bb,_0x3934d2=await resolveWorkspaceIdFromOptions(_0x2a7bbb,_0x5599cb,!![]);return await withSpinner(_0xa2ece6(0x139)+_0x1d74dc+'\x27...',()=>_0x5599cb[_0xa2ece6(0x14e)][_0xa2ece6(0x13d)](_0x3934d2,_0x1d74dc),{'verbose':_0x5688bb[_0xa2ece6(0x142)]}),console[_0xa2ece6(0x117)]('Always-on\x20campaign\x20\x27'+_0x1d74dc+'\x27\x20paused\x20successfully'),0x0;}}function a21_0x472b(_0x5eba59,_0x36795d){_0x5eba59=_0x5eba59-0x86;const _0x242bb7=a21_0x242b();let _0x472b27=_0x242bb7[_0x5eba59];return _0x472b27;}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a21_0x1786d2(0xcb)]='engage:always-on-campaign:resume';[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x110);async[a21_0x1786d2(0xfb)](_0x244748){const _0x5a4f13=a21_0x1786d2,{options:_0x466b76,args:_0x2aaafa,tdx:_0x24272b}=_0x244748;if(_0x2aaafa[_0x5a4f13(0x141)]===0x0)return console[_0x5a4f13(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x5a4f13(0xb5)](_0x5a4f13(0x125)),0x1;const _0x486707=_0x2aaafa[0x0],_0x3b82dc=_0x466b76,_0x251c4f=await resolveWorkspaceIdFromOptions(_0x3b82dc,_0x24272b,!![]);return await withSpinner(_0x5a4f13(0x122)+_0x486707+_0x5a4f13(0x133),()=>_0x24272b[_0x5a4f13(0x14e)][_0x5a4f13(0xb7)](_0x251c4f,_0x486707),{'verbose':_0x466b76[_0x5a4f13(0x142)]}),console[_0x5a4f13(0x117)]('Always-on\x20campaign\x20\x27'+_0x486707+_0x5a4f13(0x127)),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x11e);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x143);async[a21_0x1786d2(0xfb)](_0x1f0aa2){const _0xa8dc5c=a21_0x1786d2,{options:_0x50ac2c,args:_0x3d2e44,tdx:_0xffc213}=_0x1f0aa2;if(_0x3d2e44[_0xa8dc5c(0x141)]===0x0)return console[_0xa8dc5c(0xb5)](_0xa8dc5c(0xe9)),console['error'](_0xa8dc5c(0x96)),0x1;const _0x93dfe0=_0x3d2e44[0x0],_0x4ed630=_0x50ac2c,_0x48c9fc=await resolveWorkspaceIdFromOptions(_0x4ed630,_0xffc213,!![]);if(!_0x50ac2c[_0xa8dc5c(0x90)]){const _0x467d9e=await confirm(_0xa8dc5c(0xf6)+_0x93dfe0+_0xa8dc5c(0x15b));if(!_0x467d9e)return console[_0xa8dc5c(0x117)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0xa8dc5c(0xf8)+_0x93dfe0+_0xa8dc5c(0x133),()=>_0xffc213[_0xa8dc5c(0x14e)]['finishAlwaysOnCampaign'](_0x48c9fc,_0x93dfe0),{'verbose':_0x50ac2c[_0xa8dc5c(0x142)]}),console['log'](_0xa8dc5c(0xac)+_0x93dfe0+_0xa8dc5c(0xa5)),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x150);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x9e);async[a21_0x1786d2(0xfb)](_0x40838d){const _0x549ff2=a21_0x1786d2,{options:_0x3a644f,args:_0x5ec207,tdx:_0x477d3b}=_0x40838d;if(_0x5ec207[_0x549ff2(0x141)]===0x0)return console[_0x549ff2(0xb5)](_0x549ff2(0xe9)),console[_0x549ff2(0xb5)](_0x549ff2(0x95)),0x1;const _0x287936=_0x5ec207[0x0],_0x6dfa68=_0x3a644f,_0x28b01b=await resolveWorkspaceIdFromOptions(_0x6dfa68,_0x477d3b,!![]),_0x2c0e3a=_0x6dfa68[_0x549ff2(0xcb)],_0x57bae3=await withSpinner(_0x549ff2(0xb9)+_0x287936+_0x549ff2(0x133),()=>_0x477d3b[_0x549ff2(0x14e)]['duplicateAlwaysOnCampaign'](_0x28b01b,_0x287936,_0x2c0e3a),{'verbose':_0x3a644f[_0x549ff2(0x142)]});return await handleSDKOutput([_0x57bae3[_0x549ff2(0x147)]],_0x3a644f),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a21_0x1786d2(0xcb)]='engage:workspace:use';[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x8f);async['execute'](_0xd0223b){const _0x5168eb=a21_0x1786d2,{options:_0x4cb82c,args:_0x3afff9,tdx:_0x3bdee7}=_0xd0223b;if(_0x3afff9[_0x5168eb(0x141)]===0x0)return console[_0x5168eb(0xb5)](_0x5168eb(0x155)),console[_0x5168eb(0xb5)](_0x5168eb(0x131)),0x1;const _0x448da7=_0x3afff9[0x0];await withSpinner(_0x5168eb(0x151)+_0x448da7+_0x5168eb(0x133),()=>_0x3bdee7[_0x5168eb(0x14e)][_0x5168eb(0xb3)](_0x448da7));const _0x21896c=_0x4cb82c[_0x5168eb(0x157)]||undefined;return saveSessionContext({'engage_workspace':_0x448da7},_0x21896c),console[_0x5168eb(0x117)]('Engage\x20workspace\x20set\x20to:\x20'+_0x448da7),console[_0x5168eb(0x117)](_0x5168eb(0x11a)),0x0;}}
1
+ const a21_0x37d13a=a21_0x1caa;(function(_0x1f5747,_0x4143bc){const _0x21c9a7=a21_0x1caa,_0x220373=_0x1f5747();while(!![]){try{const _0x3b684e=-parseInt(_0x21c9a7(0xf0))/0x1*(-parseInt(_0x21c9a7(0x15c))/0x2)+parseInt(_0x21c9a7(0x1b3))/0x3+-parseInt(_0x21c9a7(0x187))/0x4*(-parseInt(_0x21c9a7(0x1a8))/0x5)+parseInt(_0x21c9a7(0x127))/0x6*(parseInt(_0x21c9a7(0x132))/0x7)+parseInt(_0x21c9a7(0x12e))/0x8+parseInt(_0x21c9a7(0xf1))/0x9*(parseInt(_0x21c9a7(0x1ba))/0xa)+-parseInt(_0x21c9a7(0x10a))/0xb*(parseInt(_0x21c9a7(0x170))/0xc);if(_0x3b684e===_0x4143bc)break;else _0x220373['push'](_0x220373['shift']());}catch(_0x11d79f){_0x220373['push'](_0x220373['shift']());}}}(a21_0x9435,0xccf28));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';function a21_0x1caa(_0x1a025f,_0x49f3f8){_0x1a025f=_0x1a025f-0xe6;const _0x9435a6=a21_0x9435();let _0x1caad2=_0x9435a6[_0x1a025f];return _0x1caad2;}import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl,getTemplateUrl,getWorkspaceUrl}from'../sdk/client/endpoints.js';import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a21_0x1a6dad from'chalk';export async function resolveWorkspaceIdFromOptions(_0x2057f7,_0x565046,_0xde1a9=![]){const _0x348796=a21_0x1caa;if(_0x2057f7[_0x348796(0x19b)])return await _0x565046[_0x348796(0x164)][_0x348796(0x11a)](_0x2057f7[_0x348796(0x19b)]);const _0x25c36c=loadSessionContext(_0x2057f7[_0x348796(0xf5)]);if(_0x25c36c?.['engage_workspace'])return await _0x565046[_0x348796(0x164)]['resolveWorkspaceId'](_0x25c36c[_0x348796(0x1ab)]);if(_0xde1a9)throw new SDKError(ErrorCode[_0x348796(0x140)],_0x348796(0x1ac),undefined,{'helpText':_0x348796(0x193)});return undefined;}async function resolveSegmentFromOptions(_0x17d336,_0x932c73){const _0x412b59=a21_0x1caa;if(!_0x17d336[_0x412b59(0x144)])return{};const _0x2ec8b6=_0x17d336['segment'],_0x5ad1aa=await _0x932c73[_0x412b59(0x144)]['resolvePathToResource'](_0x2ec8b6);return{'audienceId':_0x5ad1aa[_0x412b59(0x14e)],'audienceName':_0x5ad1aa[_0x412b59(0x17c)],..._0x5ad1aa[_0x412b59(0x1bf)]&&{'segmentId':_0x5ad1aa['segmentId'],'segmentName':_0x5ad1aa['segmentName']}};}function buildConnectorConfig(_0x2f7215){const _0x5b46c8=a21_0x1caa,_0x310d05=_0x2f7215[_0x5b46c8(0xfc)],_0x3ecfd1=_0x2f7215[_0x5b46c8(0x14b)];if(!_0x310d05&&!_0x3ecfd1)return undefined;return{..._0x310d05&&{'emailSenderId':_0x310d05},..._0x3ecfd1&&{'jsonColumns':_0x3ecfd1}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a21_0x37d13a(0x1b0);['description']=a21_0x37d13a(0x160);async[a21_0x37d13a(0x11f)](_0x262b89){const _0x4c9023=a21_0x37d13a,{options:_0x377f8c,args:_0x1713a1,tdx:_0x1b28fd}=_0x262b89,_0x36ea2d=_0x1713a1[0x0],_0x457c84=resolveLimit(_0x377f8c[_0x4c9023(0x169)],DEFAULT_LLM_LIMIT),_0x3cb0e5=_0x377f8c,_0x28ec1f=_0x3cb0e5[_0x4c9023(0xea)],_0x13b9e8=[_0x4c9023(0x1af),_0x4c9023(0x147),_0x4c9023(0x149),_0x4c9023(0x178)],_0x506a05=_0x3cb0e5['status'],_0xb8aee3=_0x506a05?.[_0x4c9023(0x19e)]();if(_0xb8aee3&&!_0x13b9e8[_0x4c9023(0x13e)](_0xb8aee3))return console[_0x4c9023(0xf7)](_0x4c9023(0x15e)+_0x506a05+'\x22.\x20Valid\x20values:\x20'+_0x13b9e8[_0x4c9023(0x17e)](',\x20')),0x1;const _0xdd0af3=await resolveWorkspaceIdFromOptions(_0x3cb0e5,_0x1b28fd),_0x23253f=await withSpinner(_0x4c9023(0x186),()=>_0x1b28fd['engage']['listCampaigns']({'type':_0x28ec1f,'status':_0xb8aee3,'workspaceId':_0xdd0af3,'limit':_0x457c84}),{'verbose':_0x377f8c[_0x4c9023(0xe6)]});let _0x1accdf=_0x23253f[_0x4c9023(0x166)];_0xb8aee3&&(_0x1accdf=_0x1accdf['filter'](_0x3a48c7=>_0x3a48c7[_0x4c9023(0x102)]['toUpperCase']()===_0xb8aee3));_0x36ea2d&&(_0x1accdf=_0x1accdf['filter'](_0x102c7f=>matchGlobPattern(_0x102c7f[_0x4c9023(0x105)],_0x36ea2d)));const _0x45bda7=_0x377f8c[_0x4c9023(0x10e)];if(isStructuredFormat(_0x377f8c)){const _0x2e7c0d=_0x1accdf[_0x4c9023(0x101)](_0x4ff877=>({..._0x4ff877,'url':_0x4ff877['workspaceId']?getCampaignUrl(_0x45bda7,_0x4ff877[_0x4c9023(0x198)],_0x4ff877['id']):undefined}));await handleSDKOutput(_0x2e7c0d,_0x377f8c);}else for(const _0x446681 of _0x1accdf){const _0x42e922=a21_0x1a6dad[_0x4c9023(0x195)]('\x20('+_0x446681[_0x4c9023(0x102)][_0x4c9023(0x133)]()+')'),_0x309de8=_0x446681[_0x4c9023(0x198)]?getCampaignUrl(_0x45bda7,_0x446681[_0x4c9023(0x198)],_0x446681['id']):undefined,_0x1669ba=_0x309de8?hyperlink(_0x446681[_0x4c9023(0x105)],_0x309de8):_0x446681[_0x4c9023(0x105)];console[_0x4c9023(0x19c)](_0x4c9023(0x18a)+_0x1669ba+_0x42e922);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0xfa);[a21_0x37d13a(0x1a0)]='Show\x20campaign\x20details';async[a21_0x37d13a(0x11f)](_0x213b1e){const _0x48ef1f=a21_0x37d13a,{options:_0x4ebb23,args:_0x159438,tdx:_0x5d2bcf}=_0x213b1e;if(_0x159438[_0x48ef1f(0x134)]===0x0)return console['error'](_0x48ef1f(0x114)),console[_0x48ef1f(0xf7)](_0x48ef1f(0x116)),0x1;const _0x44a4a9=_0x159438[0x0],_0x300acc=_0x4ebb23,_0x2c381a=await resolveWorkspaceIdFromOptions(_0x300acc,_0x5d2bcf),_0x8812c7=_0x300acc[_0x48ef1f(0x16d)],_0x343840=_0x4ebb23[_0x48ef1f(0x10e)];if(_0x8812c7){const _0x5ebdce=await withSpinner(_0x48ef1f(0x15d)+_0x44a4a9+_0x48ef1f(0x192),()=>_0x5d2bcf['engage'][_0x48ef1f(0x182)](_0x44a4a9,_0x2c381a),{'verbose':_0x4ebb23[_0x48ef1f(0xe6)]}),_0x59a023=_0x5ebdce['data'],_0x3cc0d8=_0x59a023['attributes'][_0x48ef1f(0x198)]?getCampaignUrl(_0x343840,_0x59a023['attributes'][_0x48ef1f(0x198)],_0x59a023['id']):undefined;await handleSDKOutput([{..._0x59a023,..._0x3cc0d8&&{'url':_0x3cc0d8}}],_0x4ebb23);}else{const _0x212f71=await withSpinner(_0x48ef1f(0x15d)+_0x44a4a9+_0x48ef1f(0x192),()=>_0x5d2bcf[_0x48ef1f(0x164)][_0x48ef1f(0x130)](_0x44a4a9,_0x2c381a),{'verbose':_0x4ebb23[_0x48ef1f(0xe6)]}),_0x2d64a4=_0x212f71[_0x48ef1f(0x166)],_0x23c585=_0x2d64a4[_0x48ef1f(0x198)]?getCampaignUrl(_0x343840,_0x2d64a4['workspaceId'],_0x2d64a4['id']):undefined;await handleSingleObjectOutput({..._0x2d64a4,..._0x23c585&&{'url':_0x23c585}},_0x4ebb23);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a21_0x37d13a(0x129);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x17a);async[a21_0x37d13a(0x11f)](_0x4694ca){const _0x5748f5=a21_0x37d13a,{options:_0xbdd397,tdx:_0x5073f3}=_0x4694ca,_0x10d112=_0xbdd397,_0x494986=_0x10d112[_0x5748f5(0x105)],_0x20a7b0=_0x10d112[_0x5748f5(0xea)];if(!_0x494986)return console['error'](_0x5748f5(0x14c)),console[_0x5748f5(0xf7)](_0x5748f5(0x17b)),0x1;if(!_0x20a7b0)return console[_0x5748f5(0xf7)](_0x5748f5(0x123)),console[_0x5748f5(0xf7)](_0x5748f5(0x17b)),0x1;const _0x3719e3=await resolveWorkspaceIdFromOptions(_0x10d112,_0x5073f3,!![]),_0x2d1d40=await resolveSegmentFromOptions(_0x10d112,_0x5073f3),_0x15ea15=buildConnectorConfig(_0x10d112),_0xde13e3={'name':_0x494986,'campaignType':_0x20a7b0,'workspaceId':_0x3719e3,'description':_0x10d112[_0x5748f5(0x1a0)],..._0x2d1d40,'connectorConfig':_0x15ea15,'startAt':_0x10d112[_0x5748f5(0x103)],'timezone':_0x10d112[_0x5748f5(0x18b)]},_0x4b3ae7=await withSpinner(_0x5748f5(0x163)+_0x494986+_0x5748f5(0x192),()=>_0x5073f3[_0x5748f5(0x164)]['createCampaign'](_0xde13e3));return await handleSDKOutput([_0x4b3ae7[_0x5748f5(0x166)]],_0xbdd397),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a21_0x37d13a(0xe8);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x1b4);async[a21_0x37d13a(0x11f)](_0x4ed295){const _0xeb7ec=a21_0x37d13a,{options:_0x5353a6,args:_0x14d623,tdx:_0x20242c}=_0x4ed295;if(_0x14d623[_0xeb7ec(0x134)]===0x0)return console[_0xeb7ec(0xf7)](_0xeb7ec(0x114)),console[_0xeb7ec(0xf7)](_0xeb7ec(0x197)),0x1;const _0xfa05e4=_0x14d623[0x0],_0x3ee0d5=_0x5353a6,_0xdd5f5c=await resolveWorkspaceIdFromOptions(_0x3ee0d5,_0x20242c),_0x2bfa20=await resolveSegmentFromOptions(_0x3ee0d5,_0x20242c),_0x6327ac=buildConnectorConfig(_0x3ee0d5),_0x1c646a={'name':_0x3ee0d5[_0xeb7ec(0x105)],'description':_0x3ee0d5[_0xeb7ec(0x1a0)],..._0x2bfa20,'connectorConfig':_0x6327ac,'startAt':_0x3ee0d5[_0xeb7ec(0x103)],'timezone':_0x3ee0d5['timezone']},_0x4b522b=Object[_0xeb7ec(0xeb)](Object[_0xeb7ec(0xf2)](_0x1c646a)[_0xeb7ec(0x1a1)](([,_0x3e0d11])=>_0x3e0d11!==undefined));if(Object[_0xeb7ec(0x119)](_0x4b522b)[_0xeb7ec(0x134)]===0x0)return console[_0xeb7ec(0xf7)](_0xeb7ec(0x15f)),console['error'](_0xeb7ec(0x15a)),0x1;const _0x59e6e6=await withSpinner(_0xeb7ec(0x12a)+_0xfa05e4+_0xeb7ec(0x192),()=>_0x20242c[_0xeb7ec(0x164)]['updateCampaign'](_0xfa05e4,_0x4b522b,_0xdd5f5c),{'verbose':_0x5353a6[_0xeb7ec(0xe6)]});return await handleSDKOutput([_0x59e6e6[_0xeb7ec(0x166)]],_0x5353a6),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x120);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x14d);async[a21_0x37d13a(0x11f)](_0x599813){const _0x4d0e02=a21_0x37d13a,{options:_0x242e32,args:_0x1e1445,tdx:_0x3b8ee5}=_0x599813;if(_0x1e1445[_0x4d0e02(0x134)]===0x0)return console[_0x4d0e02(0xf7)](_0x4d0e02(0x114)),console[_0x4d0e02(0xf7)](_0x4d0e02(0x183)),0x1;const _0x2f783c=_0x1e1445[0x0],_0x41f090=_0x242e32,_0x4b06a3=await resolveWorkspaceIdFromOptions(_0x41f090,_0x3b8ee5);if(!_0x242e32[_0x4d0e02(0x1a9)]){const _0x21486b=await confirm(_0x4d0e02(0x13b)+_0x2f783c+_0x4d0e02(0x107));if(!_0x21486b)return console[_0x4d0e02(0x19c)](_0x4d0e02(0x173)),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x2f783c+_0x4d0e02(0x192),()=>_0x3b8ee5[_0x4d0e02(0x164)][_0x4d0e02(0x113)](_0x2f783c,_0x4b06a3),{'verbose':_0x242e32[_0x4d0e02(0xe6)]}),console[_0x4d0e02(0x19c)]('Campaign\x20\x27'+_0x2f783c+_0x4d0e02(0x1ae)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x1a3);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x1bd);async[a21_0x37d13a(0x11f)](_0x4ed7cc){const _0x46e082=a21_0x37d13a,{options:_0x1966ca,args:_0xae352f,tdx:_0x2c1a93}=_0x4ed7cc;if(_0xae352f[_0x46e082(0x134)]===0x0)return console['error'](_0x46e082(0x114)),console['error'](_0x46e082(0x12d)),0x1;const _0x36c669=_0xae352f[0x0],_0x43cca5=_0x1966ca,_0x3ef2c3=await resolveWorkspaceIdFromOptions(_0x43cca5,_0x2c1a93);return await withSpinner(_0x46e082(0x179)+_0x36c669+_0x46e082(0x192),()=>_0x2c1a93['engage'][_0x46e082(0x13c)](_0x36c669,_0x3ef2c3),{'verbose':_0x1966ca['verbose']}),console[_0x46e082(0x19c)](_0x46e082(0x1b6)+_0x36c669+_0x46e082(0x1be)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a21_0x37d13a(0x105)]='engage:campaign:pause';['description']=a21_0x37d13a(0x1c0);async['execute'](_0x70ea9b){const _0xafad5a=a21_0x37d13a,{options:_0x2741ad,args:_0x55724c,tdx:_0x55361e}=_0x70ea9b;if(_0x55724c[_0xafad5a(0x134)]===0x0)return console['error'](_0xafad5a(0x114)),console[_0xafad5a(0xf7)](_0xafad5a(0x188)),0x1;const _0x4257bb=_0x55724c[0x0],_0x4bf2cf=_0x2741ad,_0x15860b=await resolveWorkspaceIdFromOptions(_0x4bf2cf,_0x55361e);return await withSpinner(_0xafad5a(0x152)+_0x4257bb+_0xafad5a(0x192),()=>_0x55361e['engage'][_0xafad5a(0x1bc)](_0x4257bb,_0x15860b),{'verbose':_0x2741ad[_0xafad5a(0xe6)]}),console[_0xafad5a(0x19c)]('Campaign\x20\x27'+_0x4257bb+_0xafad5a(0x1a7)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x177);['description']=a21_0x37d13a(0x190);async[a21_0x37d13a(0x11f)](_0x5deee8){const _0x23880e=a21_0x37d13a,{options:_0xcce1f,args:_0x11f503,tdx:_0x5c99cd}=_0x5deee8;if(_0x11f503['length']===0x0)return console[_0x23880e(0xf7)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x23880e(0xf7)](_0x23880e(0x16e)),0x1;const _0x1eb85f=_0x11f503[0x0],_0x32febe=_0xcce1f,_0x5c2627=await resolveWorkspaceIdFromOptions(_0x32febe,_0x5c99cd);return await withSpinner(_0x23880e(0x10d)+_0x1eb85f+'\x27...',()=>_0x5c99cd[_0x23880e(0x164)][_0x23880e(0x13f)](_0x1eb85f,_0x5c2627),{'verbose':_0xcce1f['verbose']}),console[_0x23880e(0x19c)](_0x23880e(0x1b6)+_0x1eb85f+_0x23880e(0x125)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a21_0x37d13a(0x105)]='engage:campaign:duplicate';[a21_0x37d13a(0x1a0)]='Duplicate\x20a\x20campaign';async[a21_0x37d13a(0x11f)](_0x598186){const _0x4c6882=a21_0x37d13a,{options:_0x53c009,args:_0xffd883,tdx:_0x3d367b}=_0x598186;if(_0xffd883[_0x4c6882(0x134)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4c6882(0xf7)](_0x4c6882(0xe9)),0x1;const _0x2fb48f=_0xffd883[0x0],_0x3f0b89=_0x53c009,_0x303d3f=await resolveWorkspaceIdFromOptions(_0x3f0b89,_0x3d367b),_0x7b8787=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x2fb48f+'\x27...',()=>_0x3d367b[_0x4c6882(0x164)][_0x4c6882(0x1a4)](_0x2fb48f,_0x303d3f),{'verbose':_0x53c009[_0x4c6882(0xe6)]});return await handleSDKOutput([_0x7b8787[_0x4c6882(0x166)]],_0x53c009),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x139);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x10f);async[a21_0x37d13a(0x11f)](_0x4950ed){const _0x21ba11=a21_0x37d13a,{options:_0x39cdb7,args:_0x422295,tdx:_0x424743}=_0x4950ed,_0x470927=_0x422295[0x0],_0x347922=resolveLimit(_0x39cdb7[_0x21ba11(0x169)],DEFAULT_LLM_LIMIT),_0x4586fa=_0x39cdb7,_0x5d0d02=await resolveWorkspaceIdFromOptions(_0x4586fa,_0x424743),_0x4f22f3=await withSpinner(_0x21ba11(0x1b5),()=>_0x424743[_0x21ba11(0x164)]['listTemplates']({'workspaceId':_0x5d0d02,'limit':_0x347922}),{'verbose':_0x39cdb7[_0x21ba11(0xe6)]});let _0x53a51c=_0x4f22f3['data'];_0x470927&&(_0x53a51c=_0x4f22f3[_0x21ba11(0x166)][_0x21ba11(0x1a1)](_0xc0f89b=>matchGlobPattern(_0xc0f89b[_0x21ba11(0x105)],_0x470927)));const _0x20db1d=_0x39cdb7[_0x21ba11(0x10e)];if(isStructuredFormat(_0x39cdb7))await handleSDKOutput(_0x53a51c,_0x39cdb7);else for(const _0x382e73 of _0x53a51c){const _0x52cd0a=_0x382e73[_0x21ba11(0x198)]?getTemplateUrl(_0x20db1d,_0x382e73[_0x21ba11(0x198)],_0x382e73['id']):undefined,_0x29bb38=_0x52cd0a?hyperlink(_0x382e73[_0x21ba11(0x105)],_0x52cd0a):_0x382e73[_0x21ba11(0x105)];console[_0x21ba11(0x19c)]('📝\x20'+_0x29bb38);}return 0x0;}}function a21_0x9435(){const _0xcc19d7=['Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','workspaceId','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Show\x20email\x20template\x20details','workspace','log','Update\x20an\x20email\x20template','toUpperCase','deleteWorkspace','description','filter','Deleting\x20always-on\x20campaign\x20\x27','engage:campaign:launch','duplicateCampaign','Error:\x20Workspace\x20name\x20is\x20required','resumeAlwaysOnCampaign','\x27\x20paused\x20successfully','20GbyYjP','yes','Delete\x20an\x20email\x20template','engage_workspace','Workspace\x20is\x20required\x20for\x20this\x20operation','\x27\x20finished\x20successfully','\x27\x20deleted\x20successfully','DRAFT','engage:campaigns','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Launch\x20an\x20always-on\x20campaign','278604yCELpe','Update\x20a\x20campaign','Fetching\x20templates...','Campaign\x20\x27','engage:workspaces','Updating\x20template\x20\x27','engage:workspace:update','11477490giYGfV','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','pauseCampaign','Launch\x20a\x20campaign','\x27\x20launched\x20successfully','segmentId','Pause\x20a\x20campaign','verbose','subject','engage:campaign:update','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','type','fromEntries','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27','Create\x20a\x20workspace','listAlwaysOnCampaigns','getTemplate','363277JGyWkd','9Bysumb','entries','plaintext','Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>','session','duplicateAlwaysOnCampaign','error','createTemplate','engage:always-on-campaign:resume','engage:campaign:show','Update\x20a\x20workspace','emailSenderId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Resuming\x20always-on\x20campaign\x20\x27','Duplicate\x20an\x20always-on\x20campaign','map','status','startAt','updateAlwaysOnCampaign','name','Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27?\x20This\x20cannot\x20be\x20undone.','Delete\x20an\x20always-on\x20campaign','pauseAlwaysOnCampaign','11JCEUCt','LIVE','Create\x20an\x20email\x20template','Resuming\x20campaign\x20\x27','site','List\x20email\x20templates','createWorkspace','finishAlwaysOnCampaign','Always-on\x20campaign\x20\x27','deleteCampaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','grapesjs','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','engage:always-on-campaign:delete','engage:template:create','keys','resolveWorkspaceId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>','engage:always-on-campaigns','Creating\x20always-on\x20campaign\x20\x27','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','execute','engage:campaign:delete','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','\x22.\x20Valid\x20values:\x20','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','\x27\x20resumed\x20successfully','Update\x20an\x20always-on\x20campaign','12HPZpoU','Updating\x20workspace\x20\x27','engage:campaign:create','Updating\x20campaign\x20\x27','Finish\x20an\x20always-on\x20campaign','Verifying\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','1954448MPfixG','attributes','getCampaign','Template\x20\x27','1526910CAMsrL','toLowerCase','length','Error:\x20--subject\x20is\x20required','Set\x20workspace\x20context\x20for\x20Engage\x20commands','getAlwaysOnCampaign','Duplicating\x20always-on\x20campaign\x20\x27','engage:templates','getAlwaysOnCampaignFull','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','launchCampaign','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','includes','resumeCampaign','MISSING_ARGUMENT','Updating\x20always-on\x20campaign\x20\x27','engage:always-on-campaign:create','Launching\x20always-on\x20campaign\x20\x27','segment','html','getWorkspaceFull','ACTIVE','engage:workspace:create','PAUSED','Pause\x20an\x20always-on\x20campaign','jsonColumns','Error:\x20--name\x20is\x20required','Delete\x20a\x20campaign','parentId','Fetching\x20workspaces...','🏢\x20','deleteAlwaysOnCampaign','Pausing\x20campaign\x20\x27','Finishing\x20always-on\x20campaign\x20\x27','Workspace\x20\x27','Options:\x20--name,\x20--description','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:always-on-campaign:launch','engage:always-on-campaign:duplicate','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','launchAlwaysOnCampaign','2rUXCwe','Fetching\x20campaign\x20\x27','Error:\x20Invalid\x20status\x20\x22','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','List\x20campaigns','updateWorkspace','enableUtmTracking','Creating\x20campaign\x20\x27','engage','audienceName','data','engage:workspace:delete','engage:always-on-campaign:pause','limit','Fetching\x20always-on\x20campaign\x20\x27','deleteTemplate','htmlFile','full','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Fetching\x20always-on\x20campaigns...','23857248ZijTHI','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','FINISHED','Operation\x20cancelled','listWorkspaces','Fetching\x20template\x20\x27','engage:template:show','engage:campaign:resume','COMPLETED','Launching\x20campaign\x20\x27','Create\x20a\x20new\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','parentName','engage:always-on-campaign:update','join','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>','Show\x20workspace\x20details','getCampaignFull','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','engage:always-on-campaign:finish','engage:template:delete','Fetching\x20campaigns...','543108YcisTH','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Delete\x20a\x20workspace','📧\x20','timezone','editorType','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','List\x20always-on\x20campaigns','Resume\x20a\x20paused\x20campaign','Creating\x20workspace\x20\x27','\x27...','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','dim','Creating\x20template\x20\x27'];a21_0x9435=function(){return _0xcc19d7;};return a21_0x9435();}export class EngageTemplateShowCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x176);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x19a);async['execute'](_0x5eecc7){const _0x1d9fc2=a21_0x37d13a,{options:_0x55b590,args:_0x37b836,tdx:_0x3bcc6e}=_0x5eecc7;if(_0x37b836[_0x1d9fc2(0x134)]===0x0)return console[_0x1d9fc2(0xf7)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0xba5d5c=_0x37b836[0x0],_0x18f196=_0x55b590,_0x193a43=await resolveWorkspaceIdFromOptions(_0x18f196,_0x3bcc6e),_0x339a2a=_0x18f196[_0x1d9fc2(0x16d)];if(_0x339a2a){const _0x3a587d=await withSpinner('Fetching\x20template\x20\x27'+_0xba5d5c+_0x1d9fc2(0x192),()=>_0x3bcc6e['engage']['getTemplateFull'](_0xba5d5c,_0x193a43),{'verbose':_0x55b590[_0x1d9fc2(0xe6)]});await handleSDKOutput([_0x3a587d],_0x55b590);}else{const _0x1d2922=await withSpinner(_0x1d9fc2(0x175)+_0xba5d5c+_0x1d9fc2(0x192),()=>_0x3bcc6e[_0x1d9fc2(0x164)][_0x1d9fc2(0xef)](_0xba5d5c,_0x193a43),{'verbose':_0x55b590[_0x1d9fc2(0xe6)]});await handleSDKOutput([_0x1d2922],_0x55b590);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x118);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x10c);async[a21_0x37d13a(0x11f)](_0x442e8d){const _0x454ff4=a21_0x37d13a,{options:_0x43d6cd,tdx:_0x125807}=_0x442e8d,_0x41b90c=_0x43d6cd,_0x21c1bd=_0x41b90c[_0x454ff4(0x105)],_0x10314e=_0x41b90c[_0x454ff4(0xe7)],_0x137e95=_0x41b90c[_0x454ff4(0x145)],_0x4d2ad0=_0x41b90c['htmlFile'];if(!_0x21c1bd)return console[_0x454ff4(0xf7)](_0x454ff4(0x14c)),console[_0x454ff4(0xf7)](_0x454ff4(0x199)),0x1;if(!_0x10314e)return console[_0x454ff4(0xf7)](_0x454ff4(0x135)),0x1;if(_0x137e95&&_0x4d2ad0)return console[_0x454ff4(0xf7)](_0x454ff4(0x17f)),0x1;const _0x2d3663=_0x4d2ad0?readFileContent(_0x4d2ad0):_0x137e95;if(!_0x2d3663)return console[_0x454ff4(0xf7)](_0x454ff4(0x11e)),0x1;const _0x30d109=await resolveWorkspaceIdFromOptions(_0x41b90c,_0x125807,!![]),_0xdbe75d={'name':_0x21c1bd,'subjectTemplate':_0x10314e,'htmlTemplate':_0x2d3663,'workspaceId':_0x30d109,'plaintextTemplate':_0x41b90c['plaintext'],'editorType':_0x41b90c[_0x454ff4(0x18c)]??_0x454ff4(0x115)},_0x5de063=await withSpinner(_0x454ff4(0x196)+_0x21c1bd+_0x454ff4(0x192),()=>_0x125807[_0x454ff4(0x164)][_0x454ff4(0xf8)](_0xdbe75d));return await handleSDKOutput([_0x5de063[_0x454ff4(0x166)]],_0x43d6cd),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a21_0x37d13a(0x105)]='engage:template:update';[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x19d);async[a21_0x37d13a(0x11f)](_0x310a27){const _0x3a95ed=a21_0x37d13a,{options:_0x3b421e,args:_0x341aac,tdx:_0x2c0d06}=_0x310a27;if(_0x341aac[_0x3a95ed(0x134)]===0x0)return console['error'](_0x3a95ed(0x1b1)),console['error']('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x4dd959=_0x341aac[0x0],_0xea615c=_0x3b421e,_0x154f23=_0xea615c[_0x3a95ed(0x145)],_0x25a580=_0xea615c[_0x3a95ed(0x16c)];if(_0x154f23&&_0x25a580)return console[_0x3a95ed(0xf7)]('Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file'),0x1;const _0x33a77a=_0x25a580?readFileContent(_0x25a580):_0x154f23,_0x505c06=await resolveWorkspaceIdFromOptions(_0xea615c,_0x2c0d06),_0x3f292b={'name':_0xea615c[_0x3a95ed(0x105)],'subjectTemplate':_0xea615c[_0x3a95ed(0xe7)],'htmlTemplate':_0x33a77a,'plaintextTemplate':_0xea615c[_0x3a95ed(0xf3)]},_0x269676=Object[_0x3a95ed(0xeb)](Object[_0x3a95ed(0xf2)](_0x3f292b)[_0x3a95ed(0x1a1)](([,_0x4e0956])=>_0x4e0956!==undefined));if(Object['keys'](_0x269676)[_0x3a95ed(0x134)]===0x0)return console[_0x3a95ed(0xf7)](_0x3a95ed(0x15f)),console[_0x3a95ed(0xf7)](_0x3a95ed(0x13d)),0x1;const _0x3defcd=await withSpinner(_0x3a95ed(0x1b8)+_0x4dd959+_0x3a95ed(0x192),()=>_0x2c0d06[_0x3a95ed(0x164)]['updateTemplate'](_0x4dd959,_0x269676,_0x505c06),{'verbose':_0x3b421e[_0x3a95ed(0xe6)]});return await handleSDKOutput([_0x3defcd[_0x3a95ed(0x166)]],_0x3b421e),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x185);['description']=a21_0x37d13a(0x1aa);async[a21_0x37d13a(0x11f)](_0x6c266f){const _0x248609=a21_0x37d13a,{options:_0x52608d,args:_0x551515,tdx:_0x337a93}=_0x6c266f;if(_0x551515[_0x248609(0x134)]===0x0)return console[_0x248609(0xf7)](_0x248609(0x1b1)),console[_0x248609(0xf7)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x3407e3=_0x551515[0x0],_0x521e97=_0x52608d,_0x107290=await resolveWorkspaceIdFromOptions(_0x521e97,_0x337a93);if(!_0x52608d[_0x248609(0x1a9)]){const _0x51a49f=await confirm(_0x248609(0xfe)+_0x3407e3+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x51a49f)return console[_0x248609(0x19c)](_0x248609(0x173)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x3407e3+_0x248609(0x192),()=>_0x337a93[_0x248609(0x164)][_0x248609(0x16b)](_0x3407e3,_0x107290),{'verbose':_0x52608d[_0x248609(0xe6)]}),console[_0x248609(0x19c)](_0x248609(0x131)+_0x3407e3+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x1b7);[a21_0x37d13a(0x1a0)]='List\x20workspaces';async[a21_0x37d13a(0x11f)](_0x368277){const _0x32f81b=a21_0x37d13a,{options:_0x32ef8c,args:_0x3e7fb7,tdx:_0x728979}=_0x368277,_0x2756a8=_0x3e7fb7[0x0],_0x5e9d6f=resolveLimit(_0x32ef8c['limit'],DEFAULT_LLM_LIMIT),_0x595120=await withSpinner(_0x32f81b(0x14f),()=>_0x728979[_0x32f81b(0x164)][_0x32f81b(0x174)]({'limit':_0x5e9d6f}),{'verbose':_0x32ef8c[_0x32f81b(0xe6)]});let _0x843440=_0x595120[_0x32f81b(0x166)];_0x2756a8&&(_0x843440=_0x595120['data'][_0x32f81b(0x1a1)](_0x1d82ff=>matchGlobPattern(_0x1d82ff[_0x32f81b(0x105)],_0x2756a8)));const _0x39ff1b=_0x32ef8c['site'];if(isStructuredFormat(_0x32ef8c))await handleSDKOutput(_0x843440,_0x32ef8c);else for(const _0x1cec1d of _0x843440){const _0x334d01=getWorkspaceUrl(_0x39ff1b,_0x1cec1d['id']),_0x5d5fae=hyperlink(_0x1cec1d[_0x32f81b(0x105)],_0x334d01);console['log'](_0x32f81b(0x150)+_0x5d5fae);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']='engage:workspace:show';[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x181);async[a21_0x37d13a(0x11f)](_0xc49ad1){const _0x4b4cbc=a21_0x37d13a,{options:_0x3892da,args:_0x5773ba,tdx:_0x1aeafb}=_0xc49ad1;if(_0x5773ba[_0x4b4cbc(0x134)]===0x0)return console[_0x4b4cbc(0xf7)](_0x4b4cbc(0x18d)),console[_0x4b4cbc(0xf7)](_0x4b4cbc(0x121)),0x1;const _0x40b05d=_0x5773ba[0x0],_0x2e3fb0=_0x3892da,_0x2163e2=_0x2e3fb0[_0x4b4cbc(0x16d)];if(_0x2163e2){const _0x944707=await withSpinner('Fetching\x20workspace\x20\x27'+_0x40b05d+_0x4b4cbc(0x192),()=>_0x1aeafb[_0x4b4cbc(0x164)][_0x4b4cbc(0x146)](_0x40b05d),{'verbose':_0x3892da[_0x4b4cbc(0xe6)]});await handleSDKOutput([_0x944707],_0x3892da);}else{const _0x18cae7=await withSpinner('Fetching\x20workspace\x20\x27'+_0x40b05d+_0x4b4cbc(0x192),()=>_0x1aeafb[_0x4b4cbc(0x164)]['getWorkspace'](_0x40b05d),{'verbose':_0x3892da[_0x4b4cbc(0xe6)]});await handleSDKOutput([_0x18cae7],_0x3892da);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a21_0x37d13a(0x148);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0xed);async[a21_0x37d13a(0x11f)](_0x337355){const _0x1b326c=a21_0x37d13a,{options:_0x127e4e,tdx:_0x3b65ea}=_0x337355,_0xd48459=_0x127e4e,_0x6246a=_0xd48459['name'];if(!_0x6246a)return console[_0x1b326c(0xf7)]('Error:\x20--name\x20is\x20required'),console['error'](_0x1b326c(0x18e)),0x1;const _0x53ae03={'name':_0x6246a,'description':_0xd48459[_0x1b326c(0x1a0)]},_0x187890=await withSpinner(_0x1b326c(0x191)+_0x6246a+_0x1b326c(0x192),()=>_0x3b65ea[_0x1b326c(0x164)][_0x1b326c(0x110)](_0x53ae03));return await handleSDKOutput([_0x187890[_0x1b326c(0x166)]],_0x127e4e),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x1b9);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0xfb);async[a21_0x37d13a(0x11f)](_0x3910a4){const _0x171f6b=a21_0x37d13a,{options:_0x308002,args:_0x1683c3,tdx:_0xa0639e}=_0x3910a4;if(_0x1683c3[_0x171f6b(0x134)]===0x0)return console['error'](_0x171f6b(0x18d)),console[_0x171f6b(0xf7)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x2f52bb=_0x1683c3[0x0],_0x5d660b=_0x308002,_0x4c1a65={'name':_0x5d660b['name'],'description':_0x5d660b[_0x171f6b(0x1a0)]},_0xe49f20=Object[_0x171f6b(0xeb)](Object[_0x171f6b(0xf2)](_0x4c1a65)[_0x171f6b(0x1a1)](([,_0x2459f4])=>_0x2459f4!==undefined));if(Object[_0x171f6b(0x119)](_0xe49f20)['length']===0x0)return console[_0x171f6b(0xf7)](_0x171f6b(0x15f)),console[_0x171f6b(0xf7)](_0x171f6b(0x155)),0x1;const _0x4c5773=await withSpinner(_0x171f6b(0x128)+_0x2f52bb+_0x171f6b(0x192),()=>_0xa0639e[_0x171f6b(0x164)][_0x171f6b(0x161)](_0x2f52bb,_0xe49f20),{'verbose':_0x308002['verbose']});return await handleSDKOutput([_0x4c5773['data']],_0x308002),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a21_0x37d13a(0x167);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x189);async[a21_0x37d13a(0x11f)](_0x1aa079){const _0x1aa867=a21_0x37d13a,{options:_0x5b76e6,args:_0x391ed5,tdx:_0x40a6ad}=_0x1aa079;if(_0x391ed5[_0x1aa867(0x134)]===0x0)return console['error'](_0x1aa867(0x18d)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x183cec=_0x391ed5[0x0];if(!_0x5b76e6[_0x1aa867(0x1a9)]){const _0x5180e8=await confirm(_0x1aa867(0x157)+_0x183cec+_0x1aa867(0x107));if(!_0x5180e8)return console[_0x1aa867(0x19c)](_0x1aa867(0x173)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x183cec+'\x27...',()=>_0x40a6ad[_0x1aa867(0x164)][_0x1aa867(0x19f)](_0x183cec),{'verbose':_0x5b76e6['verbose']}),console[_0x1aa867(0x19c)](_0x1aa867(0x154)+_0x183cec+_0x1aa867(0x1ae)),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x11c);['description']=a21_0x37d13a(0x18f);async['execute'](_0xa0e6fd){const _0x4b332f=a21_0x37d13a,{options:_0x452660,args:_0x3487ef,tdx:_0x50411f}=_0xa0e6fd,_0x29a86c=_0x3487ef[0x0],_0x52684c=resolveLimit(_0x452660[_0x4b332f(0x169)],DEFAULT_LLM_LIMIT),_0x3f6134=_0x452660,_0x535e38=_0x3f6134['type'],_0x2c118c=['DRAFT',_0x4b332f(0x10b),_0x4b332f(0x149),_0x4b332f(0x172)],_0x5cd4c7=_0x3f6134['status'],_0xacc4b5=_0x5cd4c7?.['toUpperCase']();if(_0xacc4b5&&!_0x2c118c[_0x4b332f(0x13e)](_0xacc4b5))return console[_0x4b332f(0xf7)](_0x4b332f(0x15e)+_0x5cd4c7+_0x4b332f(0x122)+_0x2c118c['join'](',\x20')),0x1;const _0x370585=await resolveWorkspaceIdFromOptions(_0x3f6134,_0x50411f,!![]),_0x2d73a3=await withSpinner(_0x4b332f(0x16f),()=>_0x50411f[_0x4b332f(0x164)][_0x4b332f(0xee)]({'workspaceId':_0x370585,'type':_0x535e38,'status':_0xacc4b5,'limit':_0x52684c}),{'verbose':_0x452660[_0x4b332f(0xe6)]});let _0x8232d3=_0x2d73a3['data'];_0xacc4b5&&(_0x8232d3=_0x8232d3[_0x4b332f(0x1a1)](_0x1d981b=>_0x1d981b[_0x4b332f(0x102)][_0x4b332f(0x19e)]()===_0xacc4b5));_0x29a86c&&(_0x8232d3=_0x8232d3[_0x4b332f(0x1a1)](_0x56d65d=>matchGlobPattern(_0x56d65d[_0x4b332f(0x105)],_0x29a86c)));const _0x555d5f=_0x452660['site'];if(isStructuredFormat(_0x452660)){const _0x1f26ac=_0x8232d3[_0x4b332f(0x101)](_0x197561=>({..._0x197561,'url':getCampaignUrl(_0x555d5f,_0x197561[_0x4b332f(0x198)],_0x197561['id'])}));await handleSDKOutput(_0x1f26ac,_0x452660);}else for(const _0x1e2acb of _0x8232d3){const _0x15038e=a21_0x1a6dad['dim']('\x20('+_0x1e2acb['status'][_0x4b332f(0x133)]()+')'),_0x19fa9d=getCampaignUrl(_0x555d5f,_0x1e2acb[_0x4b332f(0x198)],_0x1e2acb['id']),_0x2e3da2=hyperlink(_0x1e2acb[_0x4b332f(0x105)],_0x19fa9d);console[_0x4b332f(0x19c)](_0x4b332f(0x18a)+_0x2e3da2+_0x15038e);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{['name']='engage:always-on-campaign:show';[a21_0x37d13a(0x1a0)]='Show\x20always-on\x20campaign\x20details';async[a21_0x37d13a(0x11f)](_0x25a227){const _0x5498ac=a21_0x37d13a,{options:_0x17811e,args:_0x14b448,tdx:_0x5a3a48}=_0x25a227;if(_0x14b448['length']===0x0)return console[_0x5498ac(0xf7)](_0x5498ac(0x114)),console[_0x5498ac(0xf7)](_0x5498ac(0xf4)),0x1;const _0xc2ab59=_0x14b448[0x0],_0x191d3d=_0x17811e,_0x2fb618=await resolveWorkspaceIdFromOptions(_0x191d3d,_0x5a3a48,!![]),_0x3188e3=_0x191d3d['full'],_0x48790f=_0x17811e[_0x5498ac(0x10e)];if(_0x3188e3){const _0x3d4d18=await withSpinner(_0x5498ac(0x16a)+_0xc2ab59+'\x27...',()=>_0x5a3a48[_0x5498ac(0x164)][_0x5498ac(0x13a)](_0x2fb618,_0xc2ab59),{'verbose':_0x17811e['verbose']}),_0xb8880=_0x3d4d18[_0x5498ac(0x166)],_0x447fa3=getCampaignUrl(_0x48790f,_0xb8880[_0x5498ac(0x12f)]['workspaceId'],_0xb8880['id']);await handleSDKOutput([{..._0xb8880,'url':_0x447fa3}],_0x17811e);}else{const _0x1ada9a=await withSpinner(_0x5498ac(0x16a)+_0xc2ab59+_0x5498ac(0x192),()=>_0x5a3a48[_0x5498ac(0x164)][_0x5498ac(0x137)](_0x2fb618,_0xc2ab59),{'verbose':_0x17811e[_0x5498ac(0xe6)]}),_0x3bf9b5=_0x1ada9a[_0x5498ac(0x166)],_0x517ef6=getCampaignUrl(_0x48790f,_0x3bf9b5[_0x5498ac(0x198)],_0x3bf9b5['id']);await handleSingleObjectOutput({..._0x3bf9b5,'url':_0x517ef6},_0x17811e);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x142);[a21_0x37d13a(0x1a0)]='Create\x20a\x20new\x20always-on\x20campaign';async[a21_0x37d13a(0x11f)](_0x47dd38){const _0x2e96bd=a21_0x37d13a,{options:_0x4c2544,tdx:_0x2e20c9}=_0x47dd38,_0x3fd68d=_0x4c2544,_0x298ce2=_0x3fd68d[_0x2e96bd(0x105)],_0x4674ab=_0x3fd68d[_0x2e96bd(0xea)];if(!_0x298ce2)return console[_0x2e96bd(0xf7)](_0x2e96bd(0x14c)),console[_0x2e96bd(0xf7)](_0x2e96bd(0x171)),0x1;if(!_0x4674ab)return console[_0x2e96bd(0xf7)](_0x2e96bd(0x123)),console['error'](_0x2e96bd(0x171)),0x1;const _0x830629=await resolveWorkspaceIdFromOptions(_0x3fd68d,_0x2e20c9,!![]),_0x2bbd21=await resolveSegmentFromOptions(_0x3fd68d,_0x2e20c9),_0x21e4f8={'name':_0x298ce2,'campaignType':_0x4674ab,'workspaceId':_0x830629,'description':_0x3fd68d['description'],'audienceId':_0x2bbd21['audienceId'],'audienceName':_0x2bbd21[_0x2e96bd(0x165)],'enableUtmTracking':_0x3fd68d[_0x2e96bd(0x162)]},_0x1a6596=await withSpinner(_0x2e96bd(0x11d)+_0x298ce2+_0x2e96bd(0x192),()=>_0x2e20c9[_0x2e96bd(0x164)]['createAlwaysOnCampaign'](_0x830629,_0x21e4f8));return await handleSDKOutput([_0x1a6596[_0x2e96bd(0x166)]],_0x4c2544),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{['name']=a21_0x37d13a(0x17d);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x126);async[a21_0x37d13a(0x11f)](_0x593b8c){const _0x344e4b=a21_0x37d13a,{options:_0x40d10a,args:_0x17d794,tdx:_0x14fe63}=_0x593b8c;if(_0x17d794[_0x344e4b(0x134)]===0x0)return console[_0x344e4b(0xf7)](_0x344e4b(0x114)),console[_0x344e4b(0xf7)](_0x344e4b(0x106)),0x1;const _0x2a7016=_0x17d794[0x0],_0x375933=_0x40d10a,_0x24e0b8=await resolveWorkspaceIdFromOptions(_0x375933,_0x14fe63,!![]),_0x3288fe=await resolveSegmentFromOptions(_0x375933,_0x14fe63),_0x2aa69f={'name':_0x375933[_0x344e4b(0x105)],'description':_0x375933[_0x344e4b(0x1a0)],'audienceId':_0x3288fe['audienceId'],'audienceName':_0x3288fe['audienceName'],'enableUtmTracking':_0x375933[_0x344e4b(0x162)]},_0x398397=Object[_0x344e4b(0xeb)](Object['entries'](_0x2aa69f)[_0x344e4b(0x1a1)](([,_0x56f6fe])=>_0x56f6fe!==undefined));if(Object[_0x344e4b(0x119)](_0x398397)['length']===0x0)return console[_0x344e4b(0xf7)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x344e4b(0xf7)](_0x344e4b(0x156)),0x1;const _0x4ef443=await withSpinner(_0x344e4b(0x141)+_0x2a7016+_0x344e4b(0x192),()=>_0x14fe63[_0x344e4b(0x164)][_0x344e4b(0x104)](_0x24e0b8,_0x2a7016,_0x398397),{'verbose':_0x40d10a[_0x344e4b(0xe6)]});return await handleSDKOutput([_0x4ef443[_0x344e4b(0x166)]],_0x40d10a),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{['name']=a21_0x37d13a(0x117);['description']=a21_0x37d13a(0x108);async[a21_0x37d13a(0x11f)](_0x265ff6){const _0x10b135=a21_0x37d13a,{options:_0x42ecad,args:_0x1fb549,tdx:_0x130b8e}=_0x265ff6;if(_0x1fb549['length']===0x0)return console[_0x10b135(0xf7)](_0x10b135(0x114)),console[_0x10b135(0xf7)](_0x10b135(0xfd)),0x1;const _0xaa37bc=_0x1fb549[0x0],_0x438f38=_0x42ecad,_0x238592=await resolveWorkspaceIdFromOptions(_0x438f38,_0x130b8e,!![]);if(!_0x42ecad[_0x10b135(0x1a9)]){const _0x455811=await confirm(_0x10b135(0xec)+_0xaa37bc+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x455811)return console[_0x10b135(0x19c)](_0x10b135(0x173)),0x0;}return await withSpinner(_0x10b135(0x1a2)+_0xaa37bc+'\x27...',()=>_0x130b8e['engage'][_0x10b135(0x151)](_0x238592,_0xaa37bc),{'verbose':_0x42ecad[_0x10b135(0xe6)]}),console[_0x10b135(0x19c)](_0x10b135(0x112)+_0xaa37bc+_0x10b135(0x1ae)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x158);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x1b2);async[a21_0x37d13a(0x11f)](_0x180781){const _0x291a09=a21_0x37d13a,{options:_0x4e5498,args:_0x8e195d,tdx:_0xd29ae8}=_0x180781;if(_0x8e195d[_0x291a09(0x134)]===0x0)return console[_0x291a09(0xf7)](_0x291a09(0x114)),console[_0x291a09(0xf7)](_0x291a09(0x11b)),0x1;const _0x4ddc7a=_0x8e195d[0x0],_0x5e639a=_0x4e5498,_0x42f655=await resolveWorkspaceIdFromOptions(_0x5e639a,_0xd29ae8,!![]);return await withSpinner(_0x291a09(0x143)+_0x4ddc7a+_0x291a09(0x192),()=>_0xd29ae8['engage'][_0x291a09(0x15b)](_0x42f655,_0x4ddc7a),{'verbose':_0x4e5498[_0x291a09(0xe6)]}),console[_0x291a09(0x19c)]('Always-on\x20campaign\x20\x27'+_0x4ddc7a+_0x291a09(0x1be)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{['name']=a21_0x37d13a(0x168);['description']=a21_0x37d13a(0x14a);async['execute'](_0x43c8bc){const _0x14bde2=a21_0x37d13a,{options:_0x296c9d,args:_0x395361,tdx:_0x35b1ca}=_0x43c8bc;if(_0x395361[_0x14bde2(0x134)]===0x0)return console[_0x14bde2(0xf7)](_0x14bde2(0x114)),console[_0x14bde2(0xf7)](_0x14bde2(0x180)),0x1;const _0x677d0c=_0x395361[0x0],_0x32d0f3=_0x296c9d,_0x523963=await resolveWorkspaceIdFromOptions(_0x32d0f3,_0x35b1ca,!![]);return await withSpinner('Pausing\x20always-on\x20campaign\x20\x27'+_0x677d0c+_0x14bde2(0x192),()=>_0x35b1ca[_0x14bde2(0x164)][_0x14bde2(0x109)](_0x523963,_0x677d0c),{'verbose':_0x296c9d[_0x14bde2(0xe6)]}),console[_0x14bde2(0x19c)](_0x14bde2(0x112)+_0x677d0c+_0x14bde2(0x1a7)),0x0;}}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0xf9);[a21_0x37d13a(0x1a0)]='Resume\x20a\x20paused\x20always-on\x20campaign';async['execute'](_0x3034d5){const _0x2382a1=a21_0x37d13a,{options:_0x45d016,args:_0x5e6819,tdx:_0x30909e}=_0x3034d5;if(_0x5e6819[_0x2382a1(0x134)]===0x0)return console[_0x2382a1(0xf7)](_0x2382a1(0x114)),console['error'](_0x2382a1(0x194)),0x1;const _0xea394a=_0x5e6819[0x0],_0x1b8b4b=_0x45d016,_0x1edbd0=await resolveWorkspaceIdFromOptions(_0x1b8b4b,_0x30909e,!![]);return await withSpinner(_0x2382a1(0xff)+_0xea394a+_0x2382a1(0x192),()=>_0x30909e['engage'][_0x2382a1(0x1a6)](_0x1edbd0,_0xea394a),{'verbose':_0x45d016[_0x2382a1(0xe6)]}),console[_0x2382a1(0x19c)](_0x2382a1(0x112)+_0xea394a+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x184);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x12b);async[a21_0x37d13a(0x11f)](_0x47ceea){const _0xd1a660=a21_0x37d13a,{options:_0xd4714,args:_0xfa8996,tdx:_0x2dcc0a}=_0x47ceea;if(_0xfa8996[_0xd1a660(0x134)]===0x0)return console[_0xd1a660(0xf7)](_0xd1a660(0x114)),console[_0xd1a660(0xf7)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>'),0x1;const _0x5e62ac=_0xfa8996[0x0],_0x24923a=_0xd4714,_0x46cb2e=await resolveWorkspaceIdFromOptions(_0x24923a,_0x2dcc0a,!![]);if(!_0xd4714[_0xd1a660(0x1a9)]){const _0x439f8f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27'+_0x5e62ac+_0xd1a660(0x107));if(!_0x439f8f)return console[_0xd1a660(0x19c)](_0xd1a660(0x173)),0x0;}return await withSpinner(_0xd1a660(0x153)+_0x5e62ac+_0xd1a660(0x192),()=>_0x2dcc0a[_0xd1a660(0x164)][_0xd1a660(0x111)](_0x46cb2e,_0x5e62ac),{'verbose':_0xd4714[_0xd1a660(0xe6)]}),console['log'](_0xd1a660(0x112)+_0x5e62ac+_0xd1a660(0x1ad)),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x159);['description']=a21_0x37d13a(0x100);async[a21_0x37d13a(0x11f)](_0x5f082b){const _0x30f739=a21_0x37d13a,{options:_0x5854bb,args:_0x169c36,tdx:_0x449f95}=_0x5f082b;if(_0x169c36[_0x30f739(0x134)]===0x0)return console[_0x30f739(0xf7)](_0x30f739(0x114)),console[_0x30f739(0xf7)](_0x30f739(0x124)),0x1;const _0x4f884b=_0x169c36[0x0],_0x5ab393=_0x5854bb,_0x389c82=await resolveWorkspaceIdFromOptions(_0x5ab393,_0x449f95,!![]),_0x5c1447=_0x5ab393[_0x30f739(0x105)],_0x24045e=await withSpinner(_0x30f739(0x138)+_0x4f884b+'\x27...',()=>_0x449f95['engage'][_0x30f739(0xf6)](_0x389c82,_0x4f884b,_0x5c1447),{'verbose':_0x5854bb[_0x30f739(0xe6)]});return await handleSDKOutput([_0x24045e[_0x30f739(0x166)]],_0x5854bb),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a21_0x37d13a(0x105)]='engage:workspace:use';['description']=a21_0x37d13a(0x136);async['execute'](_0x4e2b34){const _0x2ed009=a21_0x37d13a,{options:_0x35ecc7,args:_0x2391ae,tdx:_0x155775}=_0x4e2b34;if(_0x2391ae[_0x2ed009(0x134)]===0x0)return console[_0x2ed009(0xf7)](_0x2ed009(0x1a5)),console[_0x2ed009(0xf7)](_0x2ed009(0x1bb)),0x1;const _0x26a2f8=_0x2391ae[0x0];await withSpinner(_0x2ed009(0x12c)+_0x26a2f8+'\x27...',()=>_0x155775[_0x2ed009(0x164)][_0x2ed009(0x11a)](_0x26a2f8));const _0xe7585=_0x35ecc7[_0x2ed009(0xf5)]||undefined;return saveSessionContext({'engage_workspace':_0x26a2f8},_0xe7585),console[_0x2ed009(0x19c)]('Engage\x20workspace\x20set\x20to:\x20'+_0x26a2f8),console[_0x2ed009(0x19c)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
@@ -1 +1 @@
1
- const a22_0x22b3e0=a22_0x3cf4;(function(_0x271199,_0x2291fd){const _0x4b2bbe=a22_0x3cf4,_0x2f6ded=_0x271199();while(!![]){try{const _0x53f3f6=parseInt(_0x4b2bbe(0xc9))/0x1+parseInt(_0x4b2bbe(0xb8))/0x2*(-parseInt(_0x4b2bbe(0xd3))/0x3)+-parseInt(_0x4b2bbe(0xd9))/0x4*(parseInt(_0x4b2bbe(0xd7))/0x5)+-parseInt(_0x4b2bbe(0xce))/0x6+parseInt(_0x4b2bbe(0xef))/0x7+-parseInt(_0x4b2bbe(0xcf))/0x8+parseInt(_0x4b2bbe(0xd2))/0x9;if(_0x53f3f6===_0x2291fd)break;else _0x2f6ded['push'](_0x2f6ded['shift']());}catch(_0x3de14f){_0x2f6ded['push'](_0x2f6ded['shift']());}}}(a22_0x2f1d,0x4ab6d));function a22_0x3cf4(_0x1e8f6c,_0x58bd0c){_0x1e8f6c=_0x1e8f6c-0xb8;const _0x2f1d0e=a22_0x2f1d();let _0x3cf416=_0x2f1d0e[_0x1e8f6c];return _0x3cf416;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a22_0x2d5bfa from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a22_0x194a3 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';function a22_0x2f1d(){const _0x131c5d=['\x20unchanged\x20files','workspaceName','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','dim','repeat','285890wTBqti','absolutePath','utf-8','engage:template:pull','files','1381008ksCkzx','1818712agVTnA','Aborted.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','4709673PZiuwP','3CAcJJP','Workspace\x20is\x20required.','\x0aError:','session','85QeYdYD','yellow','44584oERbIR','\x0aPull\x20summary\x20for\x20workspace\x20\x27','engage_workspace','length','\x20files\x20to\x20','setPhase','\x20new\x20files','dryRun','-\x20no\x20files\x20written','config','name','yes','red','\x0aChanges\x20to\x20\x27','error','counts','\x20templates','execute','data','filter','workspace','\x20changed\x20files','3733478apBGbY','hasChanges','green','779046WZjBnn','templates','diff','content','✔\x20Pulled\x20','✔\x20Context\x20set:\x20','\x20=\x20','targetDir','\x20files?','isNew','No\x20templates\x20found\x20in\x20workspace\x20\x27','cyan'];a22_0x2f1d=function(){return _0x131c5d;};return a22_0x2f1d();}export class EngageTemplatePullCommand extends BaseCommand{[a22_0x22b3e0(0xe3)]=a22_0x22b3e0(0xcc);['description']='Pull\x20templates\x20to\x20YAML\x20files';async[a22_0x22b3e0(0xea)](_0x2dbf75){const _0x357e09=a22_0x22b3e0,{options:_0x336161,args:_0x4eeecd,tdx:_0x8c771}=_0x2dbf75,_0x533b7b=_0x336161,_0x21a7b4=await resolveWorkspaceName(_0x4eeecd[0x0],_0x533b7b);if(!_0x21a7b4)return console[_0x357e09(0xe7)](a22_0x2d5bfa['yellow'](_0x357e09(0xd4))),console[_0x357e09(0xe7)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console[_0x357e09(0xe7)](_0x357e09(0xc6)),console['error']('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x74db30=await withProgressSpinner('Pulling\x20templates\x20from\x20\x27'+_0x21a7b4+'\x27...',_0x21dc40=>pullTemplates({'engage':_0x8c771['engage']},_0x21a7b4,{'templateName':_0x533b7b['name'],'progress':{'update':_0x420903=>{const _0x5a20b9=_0x357e09;_0x21dc40[_0x5a20b9(0xde)](_0x420903);}}}),{'verbose':_0x533b7b['verbose']}),_0x35c886=_0x74db30[_0x357e09(0xeb)];if(_0x35c886[_0x357e09(0xe8)][_0x357e09(0xb9)]===0x0)return console['error'](a22_0x2d5bfa[_0x357e09(0xd8)](_0x357e09(0xc2)+_0x35c886['workspaceName']+'\x27')),0x0;const _0x4f3328=_0x35c886['files'][_0x357e09(0xec)](_0x127f1d=>_0x127f1d[_0x357e09(0xc1)]),_0x2d62de=_0x35c886[_0x357e09(0xcd)][_0x357e09(0xec)](_0x44bf3f=>!_0x44bf3f[_0x357e09(0xc1)]&&_0x44bf3f[_0x357e09(0xf0)]),_0x5f167=_0x35c886['files'][_0x357e09(0xec)](_0xd81b95=>!_0xd81b95[_0x357e09(0xc1)]&&!_0xd81b95[_0x357e09(0xf0)]);console[_0x357e09(0xe7)](_0x357e09(0xda)+_0x35c886['workspaceName']+'\x27:'),console['error']('\x20\x20'+a22_0x2d5bfa[_0x357e09(0xc3)](_0x35c886['counts'][_0x357e09(0xb9)]+_0x357e09(0xe9))),console[_0x357e09(0xe7)]('\x20\x20'+a22_0x2d5bfa[_0x357e09(0xf1)]('+\x20'+_0x4f3328['length']+_0x357e09(0xdf))),console[_0x357e09(0xe7)]('\x20\x20'+a22_0x2d5bfa[_0x357e09(0xd8)]('~\x20'+_0x2d62de[_0x357e09(0xdc)]+_0x357e09(0xee))),console[_0x357e09(0xe7)]('\x20\x20'+a22_0x2d5bfa[_0x357e09(0xc7)]('=\x20'+_0x5f167[_0x357e09(0xdc)]+_0x357e09(0xc4))),console[_0x357e09(0xe7)]('\x20\x20Target:\x20'+a22_0x2d5bfa[_0x357e09(0xc3)](_0x35c886[_0x357e09(0xbf)])+'\x0a');if(_0x2d62de[_0x357e09(0xdc)]>0x0)for(const _0x1b8a04 of _0x2d62de){console[_0x357e09(0xe7)](_0x357e09(0xe6)+_0x1b8a04['relativePath']+'\x27:'),console[_0x357e09(0xe7)]('─'[_0x357e09(0xc8)](0x3c)),console['error'](_0x1b8a04[_0x357e09(0xba)]),console[_0x357e09(0xe7)]('─'[_0x357e09(0xc8)](0x3c));}if(_0x533b7b[_0x357e09(0xe0)])return console[_0x357e09(0xe7)](a22_0x2d5bfa[_0x357e09(0xd8)](_0x357e09(0xd1))),0x0;if(_0x4f3328[_0x357e09(0xdc)]===0x0&&_0x2d62de[_0x357e09(0xdc)]===0x0)return console[_0x357e09(0xe7)](a22_0x2d5bfa[_0x357e09(0xf1)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x35c886[_0x357e09(0xc5)]},_0x533b7b[_0x357e09(0xd6)]),0x0;if(!_0x533b7b[_0x357e09(0xe4)]){if(!isInteractive())return console[_0x357e09(0xe7)](a22_0x2d5bfa[_0x357e09(0xe5)](_0x357e09(0xd5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x357e09(0xe7)](a22_0x2d5bfa['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x15098c=await confirmKey('Write\x20'+(_0x4f3328[_0x357e09(0xdc)]+_0x2d62de[_0x357e09(0xdc)])+_0x357e09(0xc0));if(!_0x15098c)return console[_0x357e09(0xe7)](a22_0x2d5bfa[_0x357e09(0xd8)](_0x357e09(0xd0)),_0x357e09(0xe1)),0x1;}for(const _0x3100f3 of _0x35c886[_0x357e09(0xcd)]){if(_0x3100f3[_0x357e09(0xc1)]||_0x3100f3['hasChanges']){const _0x5bd713=a22_0x194a3['dirname'](_0x3100f3[_0x357e09(0xca)]);!existsSync(_0x5bd713)&&mkdirSync(_0x5bd713,{'recursive':!![]}),writeFileSync(_0x3100f3['absolutePath'],_0x3100f3[_0x357e09(0xbb)],_0x357e09(0xcb));}}return console['error'](a22_0x2d5bfa['green'](_0x357e09(0xbc)+(_0x4f3328[_0x357e09(0xdc)]+_0x2d62de['length'])+_0x357e09(0xdd)+_0x35c886['targetDir'])),saveSessionContext({'engage_workspace':_0x35c886[_0x357e09(0xc5)]},_0x533b7b[_0x357e09(0xd6)]),console['error'](a22_0x2d5bfa['green'](_0x357e09(0xbd)+a22_0x2d5bfa[_0x357e09(0xc7)](_0x357e09(0xdb))+_0x357e09(0xbe)+a22_0x2d5bfa['cyan'](_0x35c886[_0x357e09(0xc5)]))),0x0;}}async function resolveWorkspaceName(_0x378d9a,_0x28bdf8){const _0x17adef=a22_0x22b3e0;if(_0x378d9a)return _0x378d9a;if(_0x28bdf8['workspace'])return _0x28bdf8[_0x17adef(0xed)];const _0x5f33de=tryFindTdxConfig(process['cwd']());if(_0x5f33de?.[_0x17adef(0xe2)][_0x17adef(0xdb)])return _0x5f33de[_0x17adef(0xe2)][_0x17adef(0xdb)];const _0x1b746f=loadSessionContext(_0x28bdf8[_0x17adef(0xd6)]);if(_0x1b746f?.[_0x17adef(0xdb)])return _0x1b746f['engage_workspace'];return undefined;}
1
+ const a22_0x91e169=a22_0x53b0;(function(_0x22cebd,_0x807e8d){const _0x4dc6c1=a22_0x53b0,_0x14219a=_0x22cebd();while(!![]){try{const _0x5ac80a=parseInt(_0x4dc6c1(0xb3))/0x1+parseInt(_0x4dc6c1(0x9e))/0x2*(parseInt(_0x4dc6c1(0xb2))/0x3)+-parseInt(_0x4dc6c1(0x9f))/0x4*(parseInt(_0x4dc6c1(0x8d))/0x5)+-parseInt(_0x4dc6c1(0x7f))/0x6*(parseInt(_0x4dc6c1(0x90))/0x7)+parseInt(_0x4dc6c1(0x89))/0x8+parseInt(_0x4dc6c1(0xa2))/0x9*(parseInt(_0x4dc6c1(0x9d))/0xa)+-parseInt(_0x4dc6c1(0x93))/0xb*(parseInt(_0x4dc6c1(0xae))/0xc);if(_0x5ac80a===_0x807e8d)break;else _0x14219a['push'](_0x14219a['shift']());}catch(_0x169664){_0x14219a['push'](_0x14219a['shift']());}}}(a22_0x3856,0x69866));import{BaseCommand}from'./command.js';function a22_0x53b0(_0x9efa83,_0x486bde){_0x9efa83=_0x9efa83-0x75;const _0x38568b=a22_0x3856();let _0x53b0c5=_0x38568b[_0x9efa83];return _0x53b0c5;}function a22_0x3856(){const _0x21203d=['7611003lDBrwG','yellow','hasChanges','error','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x20templates','workspaceName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','targetDir','\x27...','data','isNew','636EflACs','templates','Pull\x20templates\x20to\x20YAML\x20files','No\x20templates\x20found\x20in\x20workspace\x20\x27','239310tMSbSP','253186Abflxf','workspace','engage','\x0aError:','red','session','content','dirname','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','engage_workspace','\x0aChanges\x20to\x20\x27','dryRun','Write\x20','counts','6CKkyph','\x20files?','filter','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','config','diff','cwd','✔\x20Context\x20set:\x20','absolutePath','✔\x20Pulled\x20','4475672UeaQFu','relativePath','Aborted.','description','1064340tivssQ','files','execute','2393657dZpLTV','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','\x20unchanged\x20files','255211iuQqRc','\x20new\x20files','\x20=\x20','setPhase','dim','cyan','\x0aPull\x20summary\x20for\x20workspace\x20\x27','length','name','\x20\x20Target:\x20','10QxtlqC','14vuYuTr','4qDBauv','Pulling\x20templates\x20from\x20\x27','green'];a22_0x3856=function(){return _0x21203d;};return a22_0x3856();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a22_0x43aa0f from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a22_0x15da9f from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a22_0x91e169(0x9b)]='engage:template:pull';[a22_0x91e169(0x8c)]=a22_0x91e169(0xb0);async[a22_0x91e169(0x8f)](_0x465a4c){const _0x1b342e=a22_0x91e169,{options:_0x1050d3,args:_0x5678fa,tdx:_0x452a3b}=_0x465a4c,_0x2c5803=_0x1050d3,_0xd499a1=await resolveWorkspaceName(_0x5678fa[0x0],_0x2c5803);if(!_0xd499a1)return console[_0x1b342e(0xa5)](a22_0x43aa0f[_0x1b342e(0xa3)]('Workspace\x20is\x20required.')),console['error'](_0x1b342e(0x91)),console[_0x1b342e(0xa5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>'),console[_0x1b342e(0xa5)](_0x1b342e(0xa6)),0x1;const _0x15fce7=await withProgressSpinner(_0x1b342e(0xa0)+_0xd499a1+_0x1b342e(0xab),_0x1c179e=>pullTemplates({'engage':_0x452a3b[_0x1b342e(0xb5)]},_0xd499a1,{'templateName':_0x2c5803[_0x1b342e(0x9b)],'progress':{'update':_0x5dfd43=>{const _0xee57fc=_0x1b342e;_0x1c179e[_0xee57fc(0x96)](_0x5dfd43);}}}),{'verbose':_0x2c5803['verbose']}),_0x2963af=_0x15fce7[_0x1b342e(0xac)];if(_0x2963af[_0x1b342e(0x7e)]['templates']===0x0)return console['error'](a22_0x43aa0f[_0x1b342e(0xa3)](_0x1b342e(0xb1)+_0x2963af['workspaceName']+'\x27')),0x0;const _0x32d9d9=_0x2963af[_0x1b342e(0x8e)][_0x1b342e(0x81)](_0x1b718f=>_0x1b718f[_0x1b342e(0xad)]),_0x36616e=_0x2963af['files']['filter'](_0x87adf0=>!_0x87adf0[_0x1b342e(0xad)]&&_0x87adf0[_0x1b342e(0xa4)]),_0x527bf3=_0x2963af[_0x1b342e(0x8e)][_0x1b342e(0x81)](_0x55503e=>!_0x55503e[_0x1b342e(0xad)]&&!_0x55503e[_0x1b342e(0xa4)]);console[_0x1b342e(0xa5)](_0x1b342e(0x99)+_0x2963af[_0x1b342e(0xa8)]+'\x27:'),console[_0x1b342e(0xa5)]('\x20\x20'+a22_0x43aa0f[_0x1b342e(0x98)](_0x2963af[_0x1b342e(0x7e)][_0x1b342e(0xaf)]+_0x1b342e(0xa7))),console[_0x1b342e(0xa5)]('\x20\x20'+a22_0x43aa0f[_0x1b342e(0xa1)]('+\x20'+_0x32d9d9['length']+_0x1b342e(0x94))),console['error']('\x20\x20'+a22_0x43aa0f[_0x1b342e(0xa3)]('~\x20'+_0x36616e['length']+'\x20changed\x20files')),console[_0x1b342e(0xa5)]('\x20\x20'+a22_0x43aa0f[_0x1b342e(0x97)]('=\x20'+_0x527bf3[_0x1b342e(0x9a)]+_0x1b342e(0x92))),console[_0x1b342e(0xa5)](_0x1b342e(0x9c)+a22_0x43aa0f[_0x1b342e(0x98)](_0x2963af[_0x1b342e(0xaa)])+'\x0a');if(_0x36616e['length']>0x0)for(const _0x274685 of _0x36616e){console[_0x1b342e(0xa5)](_0x1b342e(0x7b)+_0x274685[_0x1b342e(0x8a)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x1b342e(0xa5)](_0x274685[_0x1b342e(0x84)]),console[_0x1b342e(0xa5)]('─'['repeat'](0x3c));}if(_0x2c5803[_0x1b342e(0x7c)])return console['error'](a22_0x43aa0f[_0x1b342e(0xa3)](_0x1b342e(0xa9))),0x0;if(_0x32d9d9[_0x1b342e(0x9a)]===0x0&&_0x36616e[_0x1b342e(0x9a)]===0x0)return console[_0x1b342e(0xa5)](a22_0x43aa0f['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x2963af[_0x1b342e(0xa8)]},_0x2c5803['session']),0x0;if(!_0x2c5803['yes']){if(!isInteractive())return console[_0x1b342e(0xa5)](a22_0x43aa0f[_0x1b342e(0x75)](_0x1b342e(0xb6)),_0x1b342e(0x79)),console[_0x1b342e(0xa5)](a22_0x43aa0f['dim'](_0x1b342e(0x82))),0x1;const _0x577eb0=await confirmKey(_0x1b342e(0x7d)+(_0x32d9d9[_0x1b342e(0x9a)]+_0x36616e[_0x1b342e(0x9a)])+_0x1b342e(0x80));if(!_0x577eb0)return console[_0x1b342e(0xa5)](a22_0x43aa0f[_0x1b342e(0xa3)](_0x1b342e(0x8b)),'-\x20no\x20files\x20written'),0x1;}for(const _0xc8d297 of _0x2963af[_0x1b342e(0x8e)]){if(_0xc8d297[_0x1b342e(0xad)]||_0xc8d297[_0x1b342e(0xa4)]){const _0x21a583=a22_0x15da9f[_0x1b342e(0x78)](_0xc8d297['absolutePath']);!existsSync(_0x21a583)&&mkdirSync(_0x21a583,{'recursive':!![]}),writeFileSync(_0xc8d297[_0x1b342e(0x87)],_0xc8d297[_0x1b342e(0x77)],'utf-8');}}return console[_0x1b342e(0xa5)](a22_0x43aa0f[_0x1b342e(0xa1)](_0x1b342e(0x88)+(_0x32d9d9['length']+_0x36616e['length'])+'\x20files\x20to\x20'+_0x2963af['targetDir'])),saveSessionContext({'engage_workspace':_0x2963af[_0x1b342e(0xa8)]},_0x2c5803['session']),console['error'](a22_0x43aa0f[_0x1b342e(0xa1)](_0x1b342e(0x86)+a22_0x43aa0f[_0x1b342e(0x97)](_0x1b342e(0x7a))+_0x1b342e(0x95)+a22_0x43aa0f['cyan'](_0x2963af[_0x1b342e(0xa8)]))),0x0;}}async function resolveWorkspaceName(_0x37be4e,_0x4092bb){const _0x4443a0=a22_0x91e169;if(_0x37be4e)return _0x37be4e;if(_0x4092bb[_0x4443a0(0xb4)])return _0x4092bb[_0x4443a0(0xb4)];const _0x173e06=tryFindTdxConfig(process[_0x4443a0(0x85)]());if(_0x173e06?.[_0x4443a0(0x83)][_0x4443a0(0x7a)])return _0x173e06[_0x4443a0(0x83)]['engage_workspace'];const _0x4757bf=loadSessionContext(_0x4092bb[_0x4443a0(0x76)]);if(_0x4757bf?.[_0x4443a0(0x7a)])return _0x4757bf[_0x4443a0(0x7a)];return undefined;}
@@ -1 +1 @@
1
- const a23_0x523569=a23_0x503f;(function(_0x18ced6,_0x512ba4){const _0x92a5f7=a23_0x503f,_0x291a42=_0x18ced6();while(!![]){try{const _0x43de3f=parseInt(_0x92a5f7(0x1f2))/0x1+parseInt(_0x92a5f7(0x200))/0x2+-parseInt(_0x92a5f7(0x20b))/0x3+parseInt(_0x92a5f7(0x1d4))/0x4+-parseInt(_0x92a5f7(0x1fd))/0x5+parseInt(_0x92a5f7(0x1ce))/0x6+parseInt(_0x92a5f7(0x1ed))/0x7*(-parseInt(_0x92a5f7(0x1e2))/0x8);if(_0x43de3f===_0x512ba4)break;else _0x291a42['push'](_0x291a42['shift']());}catch(_0x385119){_0x291a42['push'](_0x291a42['shift']());}}}(a23_0x1440,0x66e75));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a23_0x1440(){const _0x281d18=['\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','✔\x20All\x20templates\x20are\x20up\x20to\x20date','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','dim','templateId','\x20\x20\x20\x20','valid','resolve','created','16FtZkkd','updated','engage','resolveWorkspaceId','error','\x20templates?','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','message','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','session','length','2790557MLOWTy','engage_workspace','Found\x20','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','engage:template:push','42866eGubwI','config','errors','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x20template\x20files','Aborted.','relativePath','\x20templates','Resolving\x20references...','\x20errors:','name','256495YJCKcI','dirname','results','163122BHmmcn','dryRun','path','\x20templates\x20to\x20update:','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','yellow','Push\x20','Workspace\x20is\x20required.','✔\x20Created\x20','verbose','def','90105atgHZH','description','filter','warnings','cyan','action','red','configDir','2640462zeGMJh','data','create','No\x20template\x20YAML\x20files\x20found\x20in\x20','yes','setPhase','2942500ZXKUTg','✔\x20Updated\x20'];a23_0x1440=function(){return _0x281d18;};return a23_0x1440();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a23_0x174b0d from'chalk';import a23_0x5ecad0 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';function a23_0x503f(_0x55afbc,_0x1e2897){_0x55afbc=_0x55afbc-0x1ce;const _0x144055=a23_0x1440();let _0x503f7a=_0x144055[_0x55afbc];return _0x503f7a;}import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a23_0x523569(0x1fc)]=a23_0x523569(0x1f1);[a23_0x523569(0x20c)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async['execute'](_0x587fc6){const _0x306345=a23_0x523569,{options:_0x1b3f58,args:_0x1d0472,tdx:_0xfb930f}=_0x587fc6,_0x8560c3=_0x1b3f58,_0x2975a8=_0x1d0472[0x0],_0x272315=_0x2975a8?a23_0x5ecad0[_0x306345(0x1e0)](_0x2975a8):undefined,_0x8f5167=_0x272315?isYamlFile(_0x272315):![];let _0x555ecf;if(_0x8f5167&&_0x272315)_0x555ecf=a23_0x5ecad0[_0x306345(0x1fe)](_0x272315);else _0x272315?_0x555ecf=_0x272315:_0x555ecf=process['cwd']();let _0x446de4;const _0x4a6d19=tryFindTdxConfig(_0x555ecf);_0x4a6d19?.[_0x306345(0x1f3)][_0x306345(0x1ee)]&&(_0x446de4=_0x4a6d19[_0x306345(0x1f3)][_0x306345(0x1ee)],!_0x8f5167&&(_0x555ecf=_0x4a6d19[_0x306345(0x212)]));_0x8560c3['workspace']&&(_0x446de4=_0x8560c3['workspace']);if(!_0x446de4){const _0x490747=loadSessionContext(_0x8560c3[_0x306345(0x1eb)]);_0x490747?.[_0x306345(0x1ee)]&&(_0x446de4=_0x490747[_0x306345(0x1ee)]);}if(!_0x446de4)return console['error'](a23_0x174b0d[_0x306345(0x205)](_0x306345(0x207))),console[_0x306345(0x1e6)](_0x306345(0x1ea)),console[_0x306345(0x1e6)](_0x306345(0x1db)),console['error'](_0x306345(0x204)),console[_0x306345(0x1e6)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x5ddefc;_0x8f5167&&_0x272315?_0x5ddefc=[parseTemplateFile(_0x272315,a23_0x5ecad0['dirname'](_0x272315))]:_0x5ddefc=discoverAndParseTemplateFiles(_0x555ecf);if(_0x5ddefc[_0x306345(0x1ec)]===0x0)return console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x205)](_0x306345(0x1d1)+_0x555ecf)),console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x1dc)](_0x306345(0x1e8))),0x1;const _0x5d5281=_0x5ddefc[_0x306345(0x1ec)]===0x1?'1\x20template\x20file:\x20'+_0x5ddefc[0x0]['def'][_0x306345(0x1fc)]:_0x5ddefc[_0x306345(0x1ec)]+_0x306345(0x1f6);console[_0x306345(0x1e6)](_0x306345(0x1ef)+a23_0x174b0d[_0x306345(0x20f)](_0x5d5281));let _0x234c51=![];for(const _0x4dd690 of _0x5ddefc){const _0x25ab8f=validateTemplateDef(_0x4dd690[_0x306345(0x20a)]);if(!_0x25ab8f[_0x306345(0x1df)]){_0x234c51=!![],console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x211)]('\x0aValidation\x20errors\x20in\x20'+_0x4dd690[_0x306345(0x1f8)]+':'));for(const _0x10c52b of _0x25ab8f[_0x306345(0x1f4)]){console[_0x306345(0x1e6)]('\x20\x20'+a23_0x174b0d[_0x306345(0x211)]('✗')+'\x20'+_0x10c52b[_0x306345(0x202)]+':\x20'+_0x10c52b[_0x306345(0x1e9)]);}}for(const _0x108c4f of _0x25ab8f[_0x306345(0x20e)]){console[_0x306345(0x1e6)]('\x20\x20'+a23_0x174b0d[_0x306345(0x205)]('⚠')+'\x20'+_0x108c4f['path']+':\x20'+_0x108c4f[_0x306345(0x1e9)]);}}if(_0x234c51)return console[_0x306345(0x1e6)](a23_0x174b0d['red'](_0x306345(0x1f0))),0x1;const _0x24e525=await _0xfb930f[_0x306345(0x1e4)][_0x306345(0x1e5)](_0x446de4),_0xb9c663=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x446de4+'\x27...',_0x3c4f65=>preparePush({'engage':_0xfb930f[_0x306345(0x1e4)]},_0x5ddefc,_0x24e525,{'progress':{'update':_0x390e28=>_0x3c4f65['setPhase'](_0x390e28)}}),{'verbose':_0x8560c3[_0x306345(0x209)]}),_0x358aa2=_0xb9c663[_0x306345(0x1cf)];await withProgressSpinner(_0x306345(0x1fa),_0x47e782=>resolveAndBuildInputs({'engage':_0xfb930f[_0x306345(0x1e4)]},_0x358aa2,_0x24e525,{'progress':{'update':_0x58ef63=>_0x47e782[_0x306345(0x1d3)](_0x58ef63)}}),{'verbose':_0x8560c3[_0x306345(0x209)]});const _0x374416=_0x358aa2[_0x306345(0x20d)](_0x503208=>_0x503208[_0x306345(0x210)]===_0x306345(0x1d0)),_0x2d7339=_0x358aa2[_0x306345(0x20d)](_0x2309d2=>_0x2309d2[_0x306345(0x210)]==='update');console[_0x306345(0x1e6)](_0x306345(0x1f5)+_0x446de4+'\x27:');if(_0x374416[_0x306345(0x1ec)]>0x0){console[_0x306345(0x1e6)]('\x20\x20'+a23_0x174b0d['green']('+\x20'+_0x374416[_0x306345(0x1ec)]+'\x20new\x20templates:'));for(const _0x48867d of _0x374416){console['error'](_0x306345(0x1de)+a23_0x174b0d[_0x306345(0x1d8)]('+')+'\x20'+_0x48867d[_0x306345(0x20a)][_0x306345(0x1fc)]);}}if(_0x2d7339[_0x306345(0x1ec)]>0x0){console[_0x306345(0x1e6)]('\x20\x20'+a23_0x174b0d['yellow']('~\x20'+_0x2d7339[_0x306345(0x1ec)]+_0x306345(0x203)));for(const _0x9d0723 of _0x2d7339){console['error'](_0x306345(0x1de)+a23_0x174b0d[_0x306345(0x205)]('~')+'\x20'+_0x9d0723['def'][_0x306345(0x1fc)]);}}if(_0x374416[_0x306345(0x1ec)]===0x0&&_0x2d7339[_0x306345(0x1ec)]===0x0)return console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x1d8)](_0x306345(0x1d9))),0x0;if(_0x8560c3[_0x306345(0x201)])return console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x205)](_0x306345(0x1d6))),0x0;if(!_0x8560c3[_0x306345(0x1d2)]){if(!isInteractive())return console[_0x306345(0x1e6)](a23_0x174b0d['red'](_0x306345(0x1da)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x1dc)](_0x306345(0x1d7))),0x1;const _0x519e90=await confirmKey(_0x306345(0x206)+(_0x374416[_0x306345(0x1ec)]+_0x2d7339[_0x306345(0x1ec)])+_0x306345(0x1e7));if(!_0x519e90)return console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x205)](_0x306345(0x1f7)),'-\x20no\x20changes\x20applied'),0x1;}const _0x4e93d1=await withProgressSpinner('Pushing\x20templates...',_0x35d246=>executePush({'engage':_0xfb930f['engage']},_0x358aa2,{'progress':{'update':_0x2ffd61=>_0x35d246[_0x306345(0x1d3)](_0x2ffd61)}}),{'verbose':_0x8560c3[_0x306345(0x209)]}),_0x57a9f6=_0x4e93d1['data'];for(const _0x1ad39f of _0x57a9f6[_0x306345(0x1ff)]){if(_0x1ad39f[_0x306345(0x1dd)]&&(_0x1ad39f[_0x306345(0x210)]===_0x306345(0x1e1)||_0x1ad39f[_0x306345(0x210)]===_0x306345(0x1e3))){const _0x4659b6=getTemplateUrl(_0x8560c3['site'],_0x24e525,_0x1ad39f[_0x306345(0x1dd)]),_0x4da8c1=_0x1ad39f[_0x306345(0x210)]===_0x306345(0x1e1)?'+':'~',_0x2e3528=_0x1ad39f[_0x306345(0x210)]===_0x306345(0x1e1)?a23_0x174b0d[_0x306345(0x1d8)](_0x4da8c1):a23_0x174b0d[_0x306345(0x205)](_0x4da8c1);console[_0x306345(0x1e6)]('\x20\x20'+_0x2e3528+'\x20'+hyperlink(_0x1ad39f['name'],_0x4659b6)+'\x20'+a23_0x174b0d[_0x306345(0x1dc)](_0x4659b6));}}_0x57a9f6[_0x306345(0x1e1)]>0x0&&console[_0x306345(0x1e6)](a23_0x174b0d['green'](_0x306345(0x208)+_0x57a9f6[_0x306345(0x1e1)]+_0x306345(0x1f9)));_0x57a9f6[_0x306345(0x1e3)]>0x0&&console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x1d8)](_0x306345(0x1d5)+_0x57a9f6[_0x306345(0x1e3)]+_0x306345(0x1f9)));if(_0x57a9f6[_0x306345(0x1f4)]['length']>0x0){console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x211)]('✘\x20'+_0x57a9f6[_0x306345(0x1f4)][_0x306345(0x1ec)]+_0x306345(0x1fb)));for(const _0x33b507 of _0x57a9f6['errors']){console['error']('\x20\x20'+a23_0x174b0d['red'](_0x33b507[_0x306345(0x1fc)])+':\x20'+_0x33b507[_0x306345(0x1e6)]);}}return saveSessionContext({'engage_workspace':_0x446de4},_0x8560c3[_0x306345(0x1eb)]),_0x57a9f6[_0x306345(0x1f4)][_0x306345(0x1ec)]>0x0?0x1:0x0;}}
1
+ const a23_0x111a0a=a23_0x32be;(function(_0x5c989d,_0x2f6fc3){const _0x239a39=a23_0x32be,_0x5c09c7=_0x5c989d();while(!![]){try{const _0x1a89de=-parseInt(_0x239a39(0x1f2))/0x1+-parseInt(_0x239a39(0x1f3))/0x2*(parseInt(_0x239a39(0x1ec))/0x3)+-parseInt(_0x239a39(0x211))/0x4*(-parseInt(_0x239a39(0x1f4))/0x5)+-parseInt(_0x239a39(0x1ef))/0x6*(parseInt(_0x239a39(0x200))/0x7)+-parseInt(_0x239a39(0x1ea))/0x8*(parseInt(_0x239a39(0x1df))/0x9)+-parseInt(_0x239a39(0x203))/0xa+-parseInt(_0x239a39(0x21e))/0xb*(-parseInt(_0x239a39(0x1fb))/0xc);if(_0x1a89de===_0x2f6fc3)break;else _0x5c09c7['push'](_0x5c09c7['shift']());}catch(_0x1ad491){_0x5c09c7['push'](_0x5c09c7['shift']());}}}(a23_0x165c,0x222c1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a23_0x165c(){const _0x389642=['verbose','yellow','red','\x27...','message','valid','\x0aValidation\x20errors\x20in\x20','cyan','engage','config','updated','11ewbPfN','✔\x20Updated\x20','Aborted.','dim','yes','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','def','✔\x20All\x20templates\x20are\x20up\x20to\x20date','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','Found\x20','cwd','green','9Xjknch','resolveWorkspaceId','name','✔\x20Created\x20','data','dirname','\x0aError:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','\x20template\x20files','filter','2153824PwhQnT','Pushing\x20templates...','329649rDplLz','update','created','6rdOUKh','session','configDir','221086UzxIJT','4AyWhzj','25XfXElt','Resolving\x20references...','Workspace\x20is\x20required.','\x20templates\x20to\x20update:','\x20new\x20templates:','site','engage:template:push','8951088MJjEik','Preparing\x20push\x20to\x20workspace\x20\x27','templateId','\x20templates','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','226268ynoljM','workspace','\x20\x20\x20\x20','48360wrDrnS','action','-\x20no\x20changes\x20applied','execute','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','engage_workspace','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','create','errors','Push\x20','warnings','error','path','setPhase','113028xlGYUj','relativePath'];a23_0x165c=function(){return _0x389642;};return a23_0x165c();}import{saveSessionContext,loadSessionContext}from'../core/session.js';function a23_0x32be(_0xaeb75f,_0x568cfd){_0xaeb75f=_0xaeb75f-0x1dc;const _0x165cc4=a23_0x165c();let _0x32be0a=_0x165cc4[_0xaeb75f];return _0x32be0a;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a23_0x2da49c from'chalk';import a23_0x6e66e2 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']=a23_0x111a0a(0x1fa);['description']='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a23_0x111a0a(0x206)](_0xa78d9e){const _0x43f8c4=a23_0x111a0a,{options:_0x3557fc,args:_0x26940e,tdx:_0x191446}=_0xa78d9e,_0x2c19e8=_0x3557fc,_0x200336=_0x26940e[0x0],_0x2445cc=_0x200336?a23_0x6e66e2['resolve'](_0x200336):undefined,_0x3e22dc=_0x2445cc?isYamlFile(_0x2445cc):![];let _0x3a5e10;if(_0x3e22dc&&_0x2445cc)_0x3a5e10=a23_0x6e66e2[_0x43f8c4(0x1e4)](_0x2445cc);else _0x2445cc?_0x3a5e10=_0x2445cc:_0x3a5e10=process[_0x43f8c4(0x1dd)]();let _0x5a3ef1;const _0x362af2=tryFindTdxConfig(_0x3a5e10);_0x362af2?.[_0x43f8c4(0x21c)][_0x43f8c4(0x208)]&&(_0x5a3ef1=_0x362af2[_0x43f8c4(0x21c)][_0x43f8c4(0x208)],!_0x3e22dc&&(_0x3a5e10=_0x362af2[_0x43f8c4(0x1f1)]));_0x2c19e8[_0x43f8c4(0x201)]&&(_0x5a3ef1=_0x2c19e8[_0x43f8c4(0x201)]);if(!_0x5a3ef1){const _0x54abcd=loadSessionContext(_0x2c19e8['session']);_0x54abcd?.[_0x43f8c4(0x208)]&&(_0x5a3ef1=_0x54abcd[_0x43f8c4(0x208)]);}if(!_0x5a3ef1)return console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x214)](_0x43f8c4(0x1f6))),console[_0x43f8c4(0x20e)]('\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console['error'](_0x43f8c4(0x224)),console[_0x43f8c4(0x20e)](_0x43f8c4(0x209)),console[_0x43f8c4(0x20e)](_0x43f8c4(0x1ff)),0x1;let _0x55b25d;_0x3e22dc&&_0x2445cc?_0x55b25d=[parseTemplateFile(_0x2445cc,a23_0x6e66e2[_0x43f8c4(0x1e4)](_0x2445cc))]:_0x55b25d=discoverAndParseTemplateFiles(_0x3a5e10);if(_0x55b25d['length']===0x0)return console[_0x43f8c4(0x20e)](a23_0x2da49c['yellow'](_0x43f8c4(0x223)+_0x3a5e10)),console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x221)](_0x43f8c4(0x227))),0x1;const _0x4ceaa8=_0x55b25d[_0x43f8c4(0x1e7)]===0x1?'1\x20template\x20file:\x20'+_0x55b25d[0x0][_0x43f8c4(0x225)]['name']:_0x55b25d[_0x43f8c4(0x1e7)]+_0x43f8c4(0x1e8);console['error'](_0x43f8c4(0x1dc)+a23_0x2da49c[_0x43f8c4(0x21a)](_0x4ceaa8));let _0x16f19e=![];for(const _0x16b204 of _0x55b25d){const _0x34a66c=validateTemplateDef(_0x16b204[_0x43f8c4(0x225)]);if(!_0x34a66c[_0x43f8c4(0x218)]){_0x16f19e=!![],console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x215)](_0x43f8c4(0x219)+_0x16b204[_0x43f8c4(0x212)]+':'));for(const _0x1e097d of _0x34a66c[_0x43f8c4(0x20b)]){console['error']('\x20\x20'+a23_0x2da49c[_0x43f8c4(0x215)]('✗')+'\x20'+_0x1e097d[_0x43f8c4(0x20f)]+':\x20'+_0x1e097d[_0x43f8c4(0x217)]);}}for(const _0x13b66d of _0x34a66c[_0x43f8c4(0x20d)]){console[_0x43f8c4(0x20e)]('\x20\x20'+a23_0x2da49c['yellow']('⚠')+'\x20'+_0x13b66d[_0x43f8c4(0x20f)]+':\x20'+_0x13b66d[_0x43f8c4(0x217)]);}}if(_0x16f19e)return console['error'](a23_0x2da49c[_0x43f8c4(0x215)](_0x43f8c4(0x207))),0x1;const _0xc73f88=await _0x191446['engage'][_0x43f8c4(0x1e0)](_0x5a3ef1),_0xd32f26=await withProgressSpinner(_0x43f8c4(0x1fc)+_0x5a3ef1+_0x43f8c4(0x216),_0x5a470b=>preparePush({'engage':_0x191446[_0x43f8c4(0x21b)]},_0x55b25d,_0xc73f88,{'progress':{'update':_0x3c3400=>_0x5a470b[_0x43f8c4(0x210)](_0x3c3400)}}),{'verbose':_0x2c19e8[_0x43f8c4(0x213)]}),_0x5aecc3=_0xd32f26[_0x43f8c4(0x1e3)];await withProgressSpinner(_0x43f8c4(0x1f5),_0x24614b=>resolveAndBuildInputs({'engage':_0x191446['engage']},_0x5aecc3,_0xc73f88,{'progress':{'update':_0x43216e=>_0x24614b[_0x43f8c4(0x210)](_0x43216e)}}),{'verbose':_0x2c19e8[_0x43f8c4(0x213)]});const _0x178aad=_0x5aecc3[_0x43f8c4(0x1e9)](_0x3a1494=>_0x3a1494['action']===_0x43f8c4(0x20a)),_0x17ad38=_0x5aecc3[_0x43f8c4(0x1e9)](_0x4b8d8f=>_0x4b8d8f[_0x43f8c4(0x204)]===_0x43f8c4(0x1ed));console['error']('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x5a3ef1+'\x27:');if(_0x178aad[_0x43f8c4(0x1e7)]>0x0){console[_0x43f8c4(0x20e)]('\x20\x20'+a23_0x2da49c[_0x43f8c4(0x1de)]('+\x20'+_0x178aad['length']+_0x43f8c4(0x1f8)));for(const _0x2d5d44 of _0x178aad){console[_0x43f8c4(0x20e)](_0x43f8c4(0x202)+a23_0x2da49c[_0x43f8c4(0x1de)]('+')+'\x20'+_0x2d5d44[_0x43f8c4(0x225)][_0x43f8c4(0x1e1)]);}}if(_0x17ad38[_0x43f8c4(0x1e7)]>0x0){console[_0x43f8c4(0x20e)]('\x20\x20'+a23_0x2da49c[_0x43f8c4(0x214)]('~\x20'+_0x17ad38[_0x43f8c4(0x1e7)]+_0x43f8c4(0x1f7)));for(const _0x4605dd of _0x17ad38){console[_0x43f8c4(0x20e)]('\x20\x20\x20\x20'+a23_0x2da49c['yellow']('~')+'\x20'+_0x4605dd[_0x43f8c4(0x225)][_0x43f8c4(0x1e1)]);}}if(_0x178aad[_0x43f8c4(0x1e7)]===0x0&&_0x17ad38[_0x43f8c4(0x1e7)]===0x0)return console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x1de)](_0x43f8c4(0x226))),0x0;if(_0x2c19e8['dryRun'])return console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x214)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x2c19e8[_0x43f8c4(0x222)]){if(!isInteractive())return console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x215)](_0x43f8c4(0x1e5)),_0x43f8c4(0x1e6)),console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x221)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x135d43=await confirmKey(_0x43f8c4(0x20c)+(_0x178aad[_0x43f8c4(0x1e7)]+_0x17ad38[_0x43f8c4(0x1e7)])+'\x20templates?');if(!_0x135d43)return console['error'](a23_0x2da49c[_0x43f8c4(0x214)](_0x43f8c4(0x220)),_0x43f8c4(0x205)),0x1;}const _0x393f41=await withProgressSpinner(_0x43f8c4(0x1eb),_0x2cb356=>executePush({'engage':_0x191446[_0x43f8c4(0x21b)]},_0x5aecc3,{'progress':{'update':_0x2f9bac=>_0x2cb356[_0x43f8c4(0x210)](_0x2f9bac)}}),{'verbose':_0x2c19e8['verbose']}),_0x4df783=_0x393f41[_0x43f8c4(0x1e3)];for(const _0x81aa16 of _0x4df783['results']){if(_0x81aa16[_0x43f8c4(0x1fd)]&&(_0x81aa16[_0x43f8c4(0x204)]===_0x43f8c4(0x1ee)||_0x81aa16[_0x43f8c4(0x204)]===_0x43f8c4(0x21d))){const _0x55b0cc=getTemplateUrl(_0x2c19e8[_0x43f8c4(0x1f9)],_0xc73f88,_0x81aa16[_0x43f8c4(0x1fd)]),_0x34dd8b=_0x81aa16[_0x43f8c4(0x204)]===_0x43f8c4(0x1ee)?'+':'~',_0x16cb3c=_0x81aa16[_0x43f8c4(0x204)]===_0x43f8c4(0x1ee)?a23_0x2da49c[_0x43f8c4(0x1de)](_0x34dd8b):a23_0x2da49c[_0x43f8c4(0x214)](_0x34dd8b);console[_0x43f8c4(0x20e)]('\x20\x20'+_0x16cb3c+'\x20'+hyperlink(_0x81aa16[_0x43f8c4(0x1e1)],_0x55b0cc)+'\x20'+a23_0x2da49c[_0x43f8c4(0x221)](_0x55b0cc));}}_0x4df783[_0x43f8c4(0x1ee)]>0x0&&console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x1de)](_0x43f8c4(0x1e2)+_0x4df783[_0x43f8c4(0x1ee)]+_0x43f8c4(0x1fe)));_0x4df783['updated']>0x0&&console[_0x43f8c4(0x20e)](a23_0x2da49c['green'](_0x43f8c4(0x21f)+_0x4df783['updated']+'\x20templates'));if(_0x4df783[_0x43f8c4(0x20b)][_0x43f8c4(0x1e7)]>0x0){console['error'](a23_0x2da49c['red']('✘\x20'+_0x4df783[_0x43f8c4(0x20b)]['length']+'\x20errors:'));for(const _0x224dce of _0x4df783['errors']){console[_0x43f8c4(0x20e)]('\x20\x20'+a23_0x2da49c[_0x43f8c4(0x215)](_0x224dce[_0x43f8c4(0x1e1)])+':\x20'+_0x224dce['error']);}}return saveSessionContext({'engage_workspace':_0x5a3ef1},_0x2c19e8[_0x43f8c4(0x1f0)]),_0x4df783[_0x43f8c4(0x20b)]['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a24_0x38362a=a24_0x37e7;(function(_0x4d0b65,_0x357a95){const _0x545533=a24_0x37e7,_0x2e86c1=_0x4d0b65();while(!![]){try{const _0x26512c=parseInt(_0x545533(0x1af))/0x1+parseInt(_0x545533(0x1cf))/0x2+-parseInt(_0x545533(0x1d2))/0x3*(-parseInt(_0x545533(0x1c9))/0x4)+parseInt(_0x545533(0x1ba))/0x5*(parseInt(_0x545533(0x1a6))/0x6)+-parseInt(_0x545533(0x1ce))/0x7*(-parseInt(_0x545533(0x1c5))/0x8)+-parseInt(_0x545533(0x1d4))/0x9+-parseInt(_0x545533(0x1a9))/0xa;if(_0x26512c===_0x357a95)break;else _0x2e86c1['push'](_0x2e86c1['shift']());}catch(_0x15d1d3){_0x2e86c1['push'](_0x2e86c1['shift']());}}}(a24_0x292e,0x6a1b4));import{BaseCommand}from'./command.js';function a24_0x37e7(_0x42b209,_0x410d08){_0x42b209=_0x42b209-0x1a5;const _0x292ef5=a24_0x292e();let _0x37e77f=_0x292ef5[_0x42b209];return _0x37e77f;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a24_0x27e262 from'chalk';import a24_0x56868c from'path';function a24_0x292e(){const _0x1ff758=['918916zKJLAp','red','length','717MkaNDC','Validate\x20template\x20YAML\x20files','4741137bioTYi','.yml','warningCount','invalidCount','35262ILWZYO','\x20template(s)\x20with\x20errors,\x20','\x20non-template\x20file(s)\x20skipped)','17644860pETUAU','reason','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','template','relativePath','769014vxlDTu','yellow','skippedCount','valid','✔\x20All\x20','\x20error(s)','\x20warning(s)','\x20template(s)\x20valid','cwd','.yaml','description','155ZxKmij','errors','\x20(skipped:\x20','validCount','filter','error','execute','hasErrors','warnings','engage:template:validate','\x20non-template\x20file(s)\x20skipped','64400LbadQo','log','endsWith','\x20valid','9752yVJcLd','Validation\x20failed:\x20','dim','green','dirname','637YeUGbB'];a24_0x292e=function(){return _0x1ff758;};return a24_0x292e();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a24_0x38362a(0x1c3);[a24_0x38362a(0x1b9)]=a24_0x38362a(0x1d3);async[a24_0x38362a(0x1c0)](_0x397491){const _0x514df2=a24_0x38362a,{options:_0x1fcf84,args:_0xf86167}=_0x397491,_0x4e91f8=_0x1fcf84,_0x25641b=_0xf86167[0x0],_0xc42ef=_0x25641b?a24_0x56868c['resolve'](_0x25641b):undefined,_0x4e9685=_0xc42ef?isYamlFile(_0xc42ef):![];let _0x4e5ba7,_0x43986b;if(_0x4e9685&&_0xc42ef)_0x4e5ba7=a24_0x56868c[_0x514df2(0x1cd)](_0xc42ef),_0x43986b=_0xc42ef;else _0xc42ef?_0x4e5ba7=_0xc42ef:_0x4e5ba7=process[_0x514df2(0x1b7)]();if(!_0x43986b&&!existsSync(_0x4e5ba7))return console[_0x514df2(0x1bf)](a24_0x27e262[_0x514df2(0x1d0)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4e5ba7+'\x0a')),0x1;let _0x5ac192;if(_0x43986b){if(!_0x43986b[_0x514df2(0x1c7)](_0x514df2(0x1d5))&&!_0x43986b[_0x514df2(0x1c7)](_0x514df2(0x1b8)))return console[_0x514df2(0x1bf)](a24_0x27e262['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x43986b+'\x0a')),0x1;_0x5ac192=[_0x43986b];}else _0x5ac192=findYamlFiles(_0x4e5ba7);if(_0x5ac192['length']===0x0)return console['error'](a24_0x27e262[_0x514df2(0x1d0)](_0x514df2(0x1ab)+_0x4e5ba7+'\x0a')),0x1;const _0x32d36e=validateYamlFiles(_0x5ac192,_0x4e5ba7,{'filterType':_0x514df2(0x1ad)}),_0x34e0c0=calculateSummary(_0x32d36e),_0x4fa69d=_0x32d36e[_0x514df2(0x1be)](isValidationResult);if(_0x4fa69d[_0x514df2(0x1d1)]===0x0)return console[_0x514df2(0x1bf)](a24_0x27e262[_0x514df2(0x1b0)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x4e5ba7+'\x0a')),_0x34e0c0['skippedCount']>0x0&&console[_0x514df2(0x1bf)](a24_0x27e262['dim']('('+_0x34e0c0[_0x514df2(0x1b1)]+_0x514df2(0x1a8))),0x0;for(const _0x218486 of _0x32d36e){if(!isValidationResult(_0x218486)){_0x4e91f8['verbose']&&console['log'](a24_0x27e262[_0x514df2(0x1cb)]('-\x20'+_0x218486[_0x514df2(0x1ae)]+_0x514df2(0x1bc)+_0x218486[_0x514df2(0x1aa)]+')'));continue;}const {relativePath:_0x1f1551,source:_0x5d4cd1,result:_0x35bf1e}=_0x218486;if(_0x35bf1e[_0x514df2(0x1b2)]&&_0x35bf1e['warnings'][_0x514df2(0x1d1)]===0x0)_0x4e91f8['verbose']&&console[_0x514df2(0x1c6)](a24_0x27e262['green']('✔\x20'+_0x1f1551));else _0x35bf1e[_0x514df2(0x1b2)]?(console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1b0)]('⚠\x20'+_0x1f1551+':\x20'+_0x35bf1e[_0x514df2(0x1c2)]['length']+_0x514df2(0x1b5))),console[_0x514df2(0x1c6)](formatValidationResult(_0x35bf1e,_0x5d4cd1,_0x1f1551))):(console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1d0)]('✖\x20'+_0x1f1551+':\x20'+_0x35bf1e[_0x514df2(0x1bb)][_0x514df2(0x1d1)]+_0x514df2(0x1b4))),console['log'](formatValidationResult(_0x35bf1e,_0x5d4cd1,_0x1f1551)));}return console[_0x514df2(0x1c6)](''),_0x34e0c0[_0x514df2(0x1c1)]?(console[_0x514df2(0x1c6)](a24_0x27e262['red'](_0x514df2(0x1ca)+_0x34e0c0[_0x514df2(0x1a5)]+_0x514df2(0x1a7)+_0x34e0c0[_0x514df2(0x1bd)]+_0x514df2(0x1c8))),_0x34e0c0['warningCount']>0x0&&console['log'](a24_0x27e262[_0x514df2(0x1b0)](_0x34e0c0[_0x514df2(0x1d6)]+_0x514df2(0x1ac))),_0x34e0c0[_0x514df2(0x1b1)]>0x0&&console[_0x514df2(0x1c6)](a24_0x27e262['dim'](_0x34e0c0[_0x514df2(0x1b1)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1cc)](_0x514df2(0x1b3)+_0x34e0c0[_0x514df2(0x1bd)]+_0x514df2(0x1b6))),_0x34e0c0[_0x514df2(0x1d6)]>0x0&&console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1b0)](_0x34e0c0[_0x514df2(0x1d6)]+_0x514df2(0x1ac))),_0x34e0c0[_0x514df2(0x1b1)]>0x0&&console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1cb)](_0x34e0c0['skippedCount']+_0x514df2(0x1c4))),0x0);}}
1
+ const a24_0x14cbc1=a24_0x21cb;(function(_0x2919af,_0x232d11){const _0x3dd613=a24_0x21cb,_0x2a626b=_0x2919af();while(!![]){try{const _0x2f3713=parseInt(_0x3dd613(0xd3))/0x1*(-parseInt(_0x3dd613(0xc6))/0x2)+parseInt(_0x3dd613(0xcc))/0x3*(parseInt(_0x3dd613(0xd1))/0x4)+parseInt(_0x3dd613(0xee))/0x5*(-parseInt(_0x3dd613(0xe7))/0x6)+-parseInt(_0x3dd613(0xe4))/0x7*(-parseInt(_0x3dd613(0xe9))/0x8)+-parseInt(_0x3dd613(0xe8))/0x9+-parseInt(_0x3dd613(0xd6))/0xa+-parseInt(_0x3dd613(0xe6))/0xb*(-parseInt(_0x3dd613(0xe2))/0xc);if(_0x2f3713===_0x232d11)break;else _0x2a626b['push'](_0x2a626b['shift']());}catch(_0x429cd6){_0x2a626b['push'](_0x2a626b['shift']());}}}(a24_0x2d7b,0xc2b8e));function a24_0x21cb(_0x55e331,_0x1568a){_0x55e331=_0x55e331-0xbc;const _0x2d7ba2=a24_0x2d7b();let _0x21cb0f=_0x2d7ba2[_0x55e331];return _0x21cb0f;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a24_0x401cfe from'chalk';import a24_0x3daf5d from'path';function a24_0x2d7b(){const _0x4fe582=['\x20warning(s)\x20found','60614BIpyHB','\x20valid','\x20non-template\x20file(s)\x20skipped','\x20template(s)\x20with\x20errors,\x20','filter','relativePath','598761Rhoauj','\x20error(s)','warnings','resolve','yellow','16nzoAOI','invalidCount','44BYQOZC','\x20warning(s)','No\x20template\x20YAML\x20files\x20found\x20in\x20','13461430OhkXdt','.yaml','length','Validation\x20failed:\x20','\x20(skipped:\x20','error','cwd','warningCount','reason','Error:\x20Directory\x20not\x20found:\x20','log','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','18804qLkZjG','skippedCount','2738911KvVKFT','endsWith','24893cicMdu','919716kWuAfW','9947007ecJnGf','8mraUFq','red','green','Validate\x20template\x20YAML\x20files','errors','5sCtebV','\x20non-template\x20file(s)\x20skipped)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','✔\x20All\x20','valid','name','validCount','hasErrors','\x20template(s)\x20valid','dim','verbose'];a24_0x2d7b=function(){return _0x4fe582;};return a24_0x2d7b();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a24_0x14cbc1(0xbf)]='engage:template:validate';['description']=a24_0x14cbc1(0xec);async['execute'](_0x29392a){const _0x2b05f1=a24_0x14cbc1,{options:_0x1ca442,args:_0x2611bc}=_0x29392a,_0x693300=_0x1ca442,_0x8babf1=_0x2611bc[0x0],_0x5d0aa4=_0x8babf1?a24_0x3daf5d[_0x2b05f1(0xcf)](_0x8babf1):undefined,_0x36bf3c=_0x5d0aa4?isYamlFile(_0x5d0aa4):![];let _0x57c38b,_0x594337;if(_0x36bf3c&&_0x5d0aa4)_0x57c38b=a24_0x3daf5d['dirname'](_0x5d0aa4),_0x594337=_0x5d0aa4;else _0x5d0aa4?_0x57c38b=_0x5d0aa4:_0x57c38b=process[_0x2b05f1(0xdc)]();if(!_0x594337&&!existsSync(_0x57c38b))return console[_0x2b05f1(0xdb)](a24_0x401cfe[_0x2b05f1(0xea)](_0x2b05f1(0xdf)+_0x57c38b+'\x0a')),0x1;let _0x4b6e6f;if(_0x594337){if(!_0x594337[_0x2b05f1(0xe5)]('.yml')&&!_0x594337[_0x2b05f1(0xe5)](_0x2b05f1(0xd7)))return console['error'](a24_0x401cfe[_0x2b05f1(0xea)](_0x2b05f1(0xe1)+_0x594337+'\x0a')),0x1;_0x4b6e6f=[_0x594337];}else _0x4b6e6f=findYamlFiles(_0x57c38b);if(_0x4b6e6f[_0x2b05f1(0xd8)]===0x0)return console[_0x2b05f1(0xdb)](a24_0x401cfe[_0x2b05f1(0xea)](_0x2b05f1(0xbc)+_0x57c38b+'\x0a')),0x1;const _0xf946b3=validateYamlFiles(_0x4b6e6f,_0x57c38b,{'filterType':'template'}),_0x17bdcd=calculateSummary(_0xf946b3),_0x3c3e8b=_0xf946b3[_0x2b05f1(0xca)](isValidationResult);if(_0x3c3e8b[_0x2b05f1(0xd8)]===0x0)return console[_0x2b05f1(0xdb)](a24_0x401cfe['yellow'](_0x2b05f1(0xd5)+_0x57c38b+'\x0a')),_0x17bdcd['skippedCount']>0x0&&console[_0x2b05f1(0xdb)](a24_0x401cfe[_0x2b05f1(0xc3)]('('+_0x17bdcd[_0x2b05f1(0xe3)]+_0x2b05f1(0xef))),0x0;for(const _0x303d8a of _0xf946b3){if(!isValidationResult(_0x303d8a)){_0x693300[_0x2b05f1(0xc4)]&&console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xc3)]('-\x20'+_0x303d8a[_0x2b05f1(0xcb)]+_0x2b05f1(0xda)+_0x303d8a[_0x2b05f1(0xde)]+')'));continue;}const {relativePath:_0x505cf4,source:_0x55af38,result:_0x5c6db5}=_0x303d8a;if(_0x5c6db5['valid']&&_0x5c6db5[_0x2b05f1(0xce)][_0x2b05f1(0xd8)]===0x0)_0x693300[_0x2b05f1(0xc4)]&&console['log'](a24_0x401cfe['green']('✔\x20'+_0x505cf4));else _0x5c6db5[_0x2b05f1(0xbe)]?(console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xd0)]('⚠\x20'+_0x505cf4+':\x20'+_0x5c6db5['warnings'][_0x2b05f1(0xd8)]+_0x2b05f1(0xd4))),console['log'](formatValidationResult(_0x5c6db5,_0x55af38,_0x505cf4))):(console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xea)]('✖\x20'+_0x505cf4+':\x20'+_0x5c6db5[_0x2b05f1(0xed)][_0x2b05f1(0xd8)]+_0x2b05f1(0xcd))),console[_0x2b05f1(0xe0)](formatValidationResult(_0x5c6db5,_0x55af38,_0x505cf4)));}return console[_0x2b05f1(0xe0)](''),_0x17bdcd[_0x2b05f1(0xc1)]?(console[_0x2b05f1(0xe0)](a24_0x401cfe['red'](_0x2b05f1(0xd9)+_0x17bdcd[_0x2b05f1(0xd2)]+_0x2b05f1(0xc9)+_0x17bdcd[_0x2b05f1(0xc0)]+_0x2b05f1(0xc7))),_0x17bdcd[_0x2b05f1(0xdd)]>0x0&&console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xd0)](_0x17bdcd[_0x2b05f1(0xdd)]+_0x2b05f1(0xc5))),_0x17bdcd[_0x2b05f1(0xe3)]>0x0&&console['log'](a24_0x401cfe['dim'](_0x17bdcd[_0x2b05f1(0xe3)]+_0x2b05f1(0xc8))),0x1):(console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xeb)](_0x2b05f1(0xbd)+_0x17bdcd['validCount']+_0x2b05f1(0xc2))),_0x17bdcd[_0x2b05f1(0xdd)]>0x0&&console[_0x2b05f1(0xe0)](a24_0x401cfe['yellow'](_0x17bdcd[_0x2b05f1(0xdd)]+_0x2b05f1(0xc5))),_0x17bdcd[_0x2b05f1(0xe3)]>0x0&&console['log'](a24_0x401cfe[_0x2b05f1(0xc3)](_0x17bdcd[_0x2b05f1(0xe3)]+_0x2b05f1(0xc8))),0x0);}}
@@ -1 +1 @@
1
- const a25_0x47f203=a25_0x18eb;(function(_0x2a5f81,_0x174a97){const _0x29507f=a25_0x18eb,_0x7f73f4=_0x2a5f81();while(!![]){try{const _0x57ca50=-parseInt(_0x29507f(0x106))/0x1+parseInt(_0x29507f(0x113))/0x2*(-parseInt(_0x29507f(0xf7))/0x3)+-parseInt(_0x29507f(0x101))/0x4*(parseInt(_0x29507f(0xe6))/0x5)+-parseInt(_0x29507f(0xe3))/0x6+-parseInt(_0x29507f(0xfd))/0x7*(parseInt(_0x29507f(0xff))/0x8)+-parseInt(_0x29507f(0xdc))/0x9*(parseInt(_0x29507f(0x10a))/0xa)+-parseInt(_0x29507f(0xcd))/0xb*(-parseInt(_0x29507f(0xcf))/0xc);if(_0x57ca50===_0x174a97)break;else _0x7f73f4['push'](_0x7f73f4['shift']());}catch(_0x37fba5){_0x7f73f4['push'](_0x7f73f4['shift']());}}}(a25_0xdac9,0x9eac5));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x2f657c from'chalk';function formatDuration(_0x3c1d30){const _0x5df883=a25_0x18eb;if(_0x3c1d30<0x3c)return _0x3c1d30+'s';if(_0x3c1d30<0xe10)return Math[_0x5df883(0xfa)](_0x3c1d30/0x3c)+'m\x20'+_0x3c1d30%0x3c+'s';const _0x3dff5d=Math[_0x5df883(0xfa)](_0x3c1d30/0xe10),_0x3ca0ee=Math[_0x5df883(0xfa)](_0x3c1d30%0xe10/0x3c);return _0x3ca0ee>0x0?_0x3dff5d+'h\x20'+_0x3ca0ee+'m':_0x3dff5d+'h';}function formatRelativeTime(_0x3f5d68){const _0x3b2dd2=a25_0x18eb,_0x1cbd0f=Date[_0x3b2dd2(0x102)]()-_0x3f5d68[_0x3b2dd2(0x109)](),_0xd6b207=Math[_0x3b2dd2(0xfa)](Math[_0x3b2dd2(0xe2)](_0x1cbd0f)/0x3e8);if(_0xd6b207<0x3c)return _0x3b2dd2(0xe0);const _0x14c096=Math[_0x3b2dd2(0xfa)](_0xd6b207/0x3c);if(_0x14c096<0x3c)return _0x14c096+_0x3b2dd2(0x110);const _0x4d39d4=Math['floor'](_0x14c096/0x3c);if(_0x4d39d4<0x18)return _0x4d39d4+_0x3b2dd2(0x11c);const _0x37b5df=Math[_0x3b2dd2(0xfa)](_0x4d39d4/0x18);if(_0x37b5df<0x1e)return _0x37b5df+_0x3b2dd2(0xe1);return Math['floor'](_0x37b5df/0x1e)+_0x3b2dd2(0xd6);}export class JobListCommand extends BaseCommand{['name']=a25_0x47f203(0x100);[a25_0x47f203(0xe4)]='List\x20jobs';async['execute'](_0x104c95){const _0x513bcb=a25_0x47f203,{options:_0x3c4db4,tdx:_0x1b2c17}=_0x104c95,_0x4078b8=resolveLimit(_0x3c4db4[_0x513bcb(0xf0)],DEFAULT_DISPLAY_LIMIT),_0x4f9db2=_0x3c4db4[_0x513bcb(0xfc)];_0x3c4db4['verbose']&&(console[_0x513bcb(0xee)](_0x513bcb(0x10d)+_0x4078b8+_0x513bcb(0xf3)),_0x4f9db2&&console[_0x513bcb(0xee)](_0x513bcb(0xf1)+_0x4f9db2));const _0x14cb0c=await withSpinner('Listing\x20jobs...',()=>_0x1b2c17[_0x513bcb(0x100)][_0x513bcb(0xc7)]({'from':0x0,'to':_0x4078b8-0x1,'status':_0x4f9db2}),{'verbose':_0x3c4db4[_0x513bcb(0xf2)]}),_0x4e5098=_0x14cb0c[_0x513bcb(0x107)];console['error']('✔\x20Found\x20'+_0x4e5098['length']+_0x513bcb(0xda)+(_0x4e5098[_0x513bcb(0xd7)]!==0x1?'s':''));const _0x53c0c2=_0x3c4db4[_0x513bcb(0x10c)];if(isStructuredFormat(_0x3c4db4)){const _0x3bd036=_0x4e5098['map'](_0x5328fa=>{const _0x3004d3=_0x513bcb;let _0x304ffe;if(_0x5328fa['start_at']&&_0x5328fa[_0x3004d3(0xc8)]){const _0x598018=new Date(_0x5328fa['start_at'])[_0x3004d3(0x109)](),_0x4feac7=new Date(_0x5328fa[_0x3004d3(0xc8)])['getTime']();_0x304ffe=Math[_0x3004d3(0xd5)]((_0x4feac7-_0x598018)/0x3e8);}return{'job_id':_0x5328fa['job_id'],'type':_0x5328fa['type']==='presto'?_0x3004d3(0xd0):_0x5328fa[_0x3004d3(0xe8)],'status':_0x5328fa[_0x3004d3(0xfc)],'user_name':_0x5328fa[_0x3004d3(0xf4)],'duration_sec':_0x304ffe,'created_at':_0x5328fa[_0x3004d3(0xcc)],'started_at':_0x5328fa[_0x3004d3(0xc4)],'end_at':_0x5328fa[_0x3004d3(0xc8)]};});await handleSDKOutput(_0x3bd036,_0x3c4db4);}else for(const _0x5bcb85 of _0x4e5098){const _0x24d3e8=_0x5bcb85['status']===_0x513bcb(0x10e)?a25_0x2f657c['green']:_0x5bcb85[_0x513bcb(0xfc)]==='error'?a25_0x2f657c[_0x513bcb(0xdd)]:a25_0x2f657c[_0x513bcb(0xf6)],_0x7a9dd3=_0x24d3e8(_0x5bcb85[_0x513bcb(0xfc)]),_0x5b7be0=getJobUrl(_0x53c0c2,_0x5bcb85['job_id']),_0xd5bae3=hyperlink(_0x5bcb85[_0x513bcb(0x105)],_0x5b7be0),_0x439c59=a25_0x2f657c[_0x513bcb(0xf6)](_0x5bcb85['type']===_0x513bcb(0xce)?_0x513bcb(0xd0):_0x5bcb85['type']),_0x2beed5=[];if(_0x5bcb85['start_at']&&_0x5bcb85[_0x513bcb(0xc8)]){const _0x4c9dff=Math['round']((new Date(_0x5bcb85[_0x513bcb(0xc8)])[_0x513bcb(0x109)]()-new Date(_0x5bcb85[_0x513bcb(0xc4)])[_0x513bcb(0x109)]())/0x3e8);_0x2beed5['push'](formatDuration(_0x4c9dff));}if(_0x5bcb85['end_at'])_0x2beed5['push'](formatRelativeTime(new Date(_0x5bcb85[_0x513bcb(0xc8)])));else _0x5bcb85[_0x513bcb(0xc4)]&&_0x2beed5[_0x513bcb(0x104)](formatRelativeTime(new Date(_0x5bcb85[_0x513bcb(0xc4)])));const _0x1f35b9=_0x2beed5['length']>0x0?a25_0x2f657c['dim']('\x20'+_0x2beed5[_0x513bcb(0xeb)](',\x20')):'';console['log']('⚡\x20'+_0xd5bae3+'\x20'+_0x439c59+'\x20'+_0x7a9dd3+_0x1f35b9);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x47f203(0xe7)]=a25_0x47f203(0xde);[a25_0x47f203(0xe4)]=a25_0x47f203(0xc3);['validate'](_0x50d042){const _0x26ceea=a25_0x47f203,_0x5bfa9c=_0x50d042['args'][0x0];if(!_0x5bfa9c)return _0x26ceea(0xd9);return undefined;}async[a25_0x47f203(0x11a)](_0x5ab5c0){const _0x520524=a25_0x47f203,{options:_0x192f1e,args:_0x2f09dd,tdx:_0x556389}=_0x5ab5c0,_0x3a047e=_0x2f09dd[0x0],_0x450a75=await withSpinner('Getting\x20job\x20details...',()=>_0x556389['jobs'][_0x520524(0x115)](_0x3a047e),{'verbose':_0x192f1e['verbose']}),_0x311e98=_0x450a75[_0x520524(0x107)];let _0x351361;if(_0x311e98[_0x520524(0xc4)]&&_0x311e98[_0x520524(0xc8)]){const _0x22f8b1=new Date(_0x311e98[_0x520524(0xc4)])[_0x520524(0x109)](),_0x355efe=new Date(_0x311e98[_0x520524(0xc8)])[_0x520524(0x109)]();_0x351361=Math[_0x520524(0xd5)]((_0x355efe-_0x22f8b1)/0x3e8);}const _0x276e6b={'job_id':_0x311e98['job_id'],'type':_0x311e98[_0x520524(0xe8)],'status':_0x311e98[_0x520524(0xfc)],..._0x311e98[_0x520524(0xf4)]&&{'user_name':_0x311e98[_0x520524(0xf4)]},..._0x351361!==undefined&&{'duration_sec':_0x351361},..._0x311e98['created_at']&&{'created_at':_0x311e98['created_at']},..._0x311e98[_0x520524(0xc4)]&&{'started_at':_0x311e98[_0x520524(0xc4)]},..._0x311e98[_0x520524(0xc8)]&&{'end_at':_0x311e98[_0x520524(0xc8)]},..._0x311e98[_0x520524(0xfb)]&&{'database':_0x311e98['database']},..._0x311e98[_0x520524(0x119)]!==undefined&&{'priority':_0x311e98[_0x520524(0x119)]},..._0x311e98[_0x520524(0xec)]&&{'url':_0x311e98[_0x520524(0xec)]},..._0x311e98[_0x520524(0xca)]&&{'query':_0x311e98[_0x520524(0xca)]},..._0x311e98[_0x520524(0x103)]&&{'debug':_0x311e98['debug']}};return await handleSingleObjectOutput(_0x276e6b,_0x192f1e),0x0;}}function a25_0x18eb(_0x16b7b1,_0x27c741){_0x16b7b1=_0x16b7b1-0xc2;const _0xdac915=a25_0xdac9();let _0x18ebd5=_0xdac915[_0x16b7b1];return _0x18ebd5;}export class JobKillCommand extends BaseCommand{[a25_0x47f203(0xe7)]=a25_0x47f203(0xd1);[a25_0x47f203(0xe4)]=a25_0x47f203(0xe5);[a25_0x47f203(0xf9)](_0x1c60d7){const _0x52b0b0=a25_0x47f203,_0x1ec7f6=_0x1c60d7[_0x52b0b0(0xd2)][0x0];if(!_0x1ec7f6)return _0x52b0b0(0xdb);return undefined;}async[a25_0x47f203(0x11a)](_0x36df9d){const _0x3d8d6d=a25_0x47f203,{options:_0x474edb,args:_0x3ca8ba,tdx:_0x32d2f9}=_0x36df9d,_0xe4f62b=_0x3ca8ba[0x0];if(!_0x474edb['yes']){const _0x9bcc99=await confirm(_0x3d8d6d(0x116)+_0xe4f62b+'?');if(!_0x9bcc99)return console[_0x3d8d6d(0xee)]('Cancelled'),0x0;}return await withSpinner(_0x3d8d6d(0x114),()=>_0x32d2f9[_0x3d8d6d(0x100)][_0x3d8d6d(0x118)](_0xe4f62b),{'verbose':_0x474edb[_0x3d8d6d(0xf2)]}),console['error'](_0x3d8d6d(0xed)+_0xe4f62b),console[_0x3d8d6d(0xee)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0xe4f62b+_0x3d8d6d(0x117)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a25_0x47f203(0xe7)]='job:submit';[a25_0x47f203(0xe4)]=a25_0x47f203(0xc5);async[a25_0x47f203(0x11a)](_0x15ac6c){const _0x29116f=a25_0x47f203,{options:_0x8c7c35,args:_0x6778d8,tdx:_0x12c66c}=_0x15ac6c,_0x1b36a8=_0x8c7c35[_0x29116f(0xd3)]||_0x29116f(0xd0),_0x2c4cb6=_0x8c7c35[_0x29116f(0xf8)],_0x33554f=_0x8c7c35['database']||'information_schema',_0x34cd0e=_0x8c7c35['result'];if(_0x1b36a8!==_0x29116f(0xd0)&&_0x1b36a8!==_0x29116f(0xdf))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x29116f(0xcb));let _0x18b0db;if(_0x2c4cb6){if(_0x6778d8[0x0])throw new SDKError(ErrorCode[_0x29116f(0x112)],_0x29116f(0xc2));const _0x265c35=readSqlStatementsFromFile(_0x2c4cb6);if(_0x265c35[_0x29116f(0xd7)]===0x0)throw new SDKError(ErrorCode[_0x29116f(0x112)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x265c35['length']>0x1)throw new SDKError(ErrorCode[_0x29116f(0x112)],_0x29116f(0x10b));_0x18b0db=_0x265c35[0x0];}else{if(!_0x6778d8[0x0])throw new SDKError(ErrorCode[_0x29116f(0x112)],_0x29116f(0xe9));_0x18b0db=_0x6778d8[0x0];}_0x8c7c35[_0x29116f(0xf2)]&&(console[_0x29116f(0xee)](_0x29116f(0xef)+_0x1b36a8),console[_0x29116f(0xee)]('Database:\x20'+_0x33554f),console[_0x29116f(0xee)](_0x29116f(0x108)+_0x18b0db[_0x29116f(0x11b)](0x0,0x64)+(_0x18b0db[_0x29116f(0xd7)]>0x64?'...':'')));const _0x5291c2=await withSpinner(_0x29116f(0xc9),()=>_0x12c66c[_0x29116f(0x100)][_0x29116f(0xea)](_0x33554f,_0x18b0db,_0x1b36a8,_0x34cd0e),{'verbose':_0x8c7c35[_0x29116f(0xf2)]}),_0x162886=_0x5291c2[_0x29116f(0x107)];return console[_0x29116f(0xee)](_0x29116f(0xf5)),console[_0x29116f(0xee)](_0x29116f(0x111)+_0x162886[_0x29116f(0x105)]),await handleSDKOutput([_0x162886],_0x8c7c35),0x0;}}function a25_0xdac9(){const _0x3e5003=['query','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','created_at','218185UOfDkG','presto','2388KpFWUv','trino','job:kill','args','jobType','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','round','mo\x20ago','length','\x20row','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','387TLIwnY','red','job:show','hive','just\x20now','d\x20ago','abs','2375904bBTayB','description','Kill\x20a\x20job','48565ExOerV','name','type','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','submit','join','url','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','error','Job\x20type:\x20','limit','Status\x20filter:\x20','verbose','\x20jobs','user_name','✔\x20Job\x20submitted','dim','3mQXfyC','file','validate','floor','database','status','21XoVXZD','Getting\x20job\x20results...','723248Hskyar','jobs','28UbqMAe','now','debug','push','job_id','961907NcpYvi','data','Query:\x20','getTime','74410ZmUGuG','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','site','Limit:\x20','success','✔\x20Retrieved\x20','m\x20ago','\x20\x20Job\x20ID:\x20','INVALID_ARGUMENT','2560354AAyHYk','Submitting\x20kill\x20request...','show','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','\x27\x20to\x20verify\x20the\x20job\x20status','kill','priority','execute','substring','h\x20ago','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Show\x20job\x20details','start_at','Submit\x20a\x20job','Get\x20job\x20results','list','end_at','Submitting\x20job...'];a25_0xdac9=function(){return _0x3e5003;};return a25_0xdac9();}export class JobResultCommand extends BaseCommand{[a25_0x47f203(0xe7)]='job:result';[a25_0x47f203(0xe4)]=a25_0x47f203(0xc6);[a25_0x47f203(0xf9)](_0x513e0c){const _0x4d974e=a25_0x47f203,_0x1641c0=_0x513e0c[_0x4d974e(0xd2)][0x0];if(!_0x1641c0)return _0x4d974e(0xd4);return undefined;}async['execute'](_0x167d56){const _0x218e9c=a25_0x47f203,{options:_0x218dd6,args:_0x125fd0,tdx:_0x4ef42b}=_0x167d56,_0x23fa59=_0x125fd0[0x0],_0xcd5ed2=await withSpinner(_0x218e9c(0xfe),()=>_0x4ef42b[_0x218e9c(0x100)]['result'](_0x23fa59),{'verbose':_0x218dd6['verbose']}),_0x3934fd=_0xcd5ed2[_0x218e9c(0x107)];return console[_0x218e9c(0xee)](_0x218e9c(0x10f)+_0x3934fd[_0x218e9c(0xd7)]+_0x218e9c(0xd8)+(_0x3934fd['length']!==0x1?'s':'')),await handleSDKOutput(_0x3934fd,_0x218dd6),0x0;}}
1
+ const a25_0x28aa71=a25_0x8f44;(function(_0x4c49e7,_0x16c0eb){const _0x5a390f=a25_0x8f44,_0x13bda9=_0x4c49e7();while(!![]){try{const _0x2332e3=-parseInt(_0x5a390f(0x1ab))/0x1+parseInt(_0x5a390f(0x17a))/0x2*(parseInt(_0x5a390f(0x17e))/0x3)+-parseInt(_0x5a390f(0x19d))/0x4*(-parseInt(_0x5a390f(0x19e))/0x5)+parseInt(_0x5a390f(0x1b4))/0x6+-parseInt(_0x5a390f(0x1a6))/0x7+parseInt(_0x5a390f(0x1a8))/0x8+-parseInt(_0x5a390f(0x1b2))/0x9;if(_0x2332e3===_0x16c0eb)break;else _0x13bda9['push'](_0x13bda9['shift']());}catch(_0xaa7b34){_0x13bda9['push'](_0x13bda9['shift']());}}}(a25_0x376e,0x66510));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a25_0x376e(){const _0x3d4d0c=['site','Kill\x20a\x20job','h\x20ago','execute','now','url','status','✔\x20Found\x20','Getting\x20job\x20results...','description','created_at','116108sfaWtO','85NItwuA','submit','d\x20ago','INVALID_ARGUMENT','\x20jobs','end_at','error','information_schema','4701340DhrNoW','floor','3794808BBYTPR','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job_id','178885OhXrBz','abs','start_at','Show\x20job\x20details','type','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','711486RHTAcC','job:result','1076190YKidEZ','push','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','name','Limit:\x20','trino','debug','Submitting\x20job...','...','✔\x20Retrieved\x20','Job\x20type:\x20','join','✔\x20Job\x20submitted','presto','priority','query','No\x20SQL\x20statements\x20found\x20in\x20file','List\x20jobs','jobs','dim','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','yes','job:show','getTime','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','list','user_name','25184SZjWIE','hive','m\x20ago','\x20\x20Job\x20ID:\x20','48cyJFJZ','Getting\x20job\x20details...','verbose','mo\x20ago','length','database','substring','validate','Submitting\x20kill\x20request...','red','job:kill','Cancelled','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','data','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Query:\x20','kill','round','args','result'];a25_0x376e=function(){return _0x3d4d0c;};return a25_0x376e();}import{hyperlink}from'../sdk/util/formatters.js';import a25_0x1a5aa4 from'chalk';function formatDuration(_0x25dd4c){const _0x4ac727=a25_0x8f44;if(_0x25dd4c<0x3c)return _0x25dd4c+'s';if(_0x25dd4c<0xe10)return Math[_0x4ac727(0x1a7)](_0x25dd4c/0x3c)+'m\x20'+_0x25dd4c%0x3c+'s';const _0x1eb23d=Math[_0x4ac727(0x1a7)](_0x25dd4c/0xe10),_0x32ab9b=Math[_0x4ac727(0x1a7)](_0x25dd4c%0xe10/0x3c);return _0x32ab9b>0x0?_0x1eb23d+'h\x20'+_0x32ab9b+'m':_0x1eb23d+'h';}function formatRelativeTime(_0x5ec09d){const _0x38ef5f=a25_0x8f44,_0x458e53=Date[_0x38ef5f(0x196)]()-_0x5ec09d['getTime'](),_0x49cf61=Math[_0x38ef5f(0x1a7)](Math[_0x38ef5f(0x1ac)](_0x458e53)/0x3e8);if(_0x49cf61<0x3c)return'just\x20now';const _0x2b9acd=Math[_0x38ef5f(0x1a7)](_0x49cf61/0x3c);if(_0x2b9acd<0x3c)return _0x2b9acd+_0x38ef5f(0x17c);const _0x1a9046=Math['floor'](_0x2b9acd/0x3c);if(_0x1a9046<0x18)return _0x1a9046+_0x38ef5f(0x194);const _0x3655ce=Math[_0x38ef5f(0x1a7)](_0x1a9046/0x18);if(_0x3655ce<0x1e)return _0x3655ce+_0x38ef5f(0x1a0);return Math['floor'](_0x3655ce/0x1e)+_0x38ef5f(0x181);}export class JobListCommand extends BaseCommand{['name']=a25_0x28aa71(0x1c6);[a25_0x28aa71(0x19b)]=a25_0x28aa71(0x1c5);async[a25_0x28aa71(0x195)](_0x4b2d77){const _0x94b95d=a25_0x28aa71,{options:_0x4e4e77,tdx:_0x4866ad}=_0x4b2d77,_0x5e2510=resolveLimit(_0x4e4e77['limit'],DEFAULT_DISPLAY_LIMIT),_0x157e58=_0x4e4e77[_0x94b95d(0x198)];_0x4e4e77[_0x94b95d(0x180)]&&(console[_0x94b95d(0x1a4)](_0x94b95d(0x1b8)+_0x5e2510+_0x94b95d(0x1a2)),_0x157e58&&console[_0x94b95d(0x1a4)]('Status\x20filter:\x20'+_0x157e58));const _0x4177a9=await withSpinner('Listing\x20jobs...',()=>_0x4866ad['jobs'][_0x94b95d(0x178)]({'from':0x0,'to':_0x5e2510-0x1,'status':_0x157e58}),{'verbose':_0x4e4e77[_0x94b95d(0x180)]}),_0x439c13=_0x4177a9[_0x94b95d(0x18b)];console['error'](_0x94b95d(0x199)+_0x439c13[_0x94b95d(0x182)]+'\x20job'+(_0x439c13[_0x94b95d(0x182)]!==0x1?'s':''));const _0x5eb700=_0x4e4e77[_0x94b95d(0x192)];if(isStructuredFormat(_0x4e4e77)){const _0x22388b=_0x439c13['map'](_0x50dcf5=>{const _0xd0aa25=_0x94b95d;let _0x344c07;if(_0x50dcf5[_0xd0aa25(0x1ad)]&&_0x50dcf5[_0xd0aa25(0x1a3)]){const _0x397bfd=new Date(_0x50dcf5[_0xd0aa25(0x1ad)])[_0xd0aa25(0x176)](),_0x45732c=new Date(_0x50dcf5[_0xd0aa25(0x1a3)])[_0xd0aa25(0x176)]();_0x344c07=Math[_0xd0aa25(0x18f)]((_0x45732c-_0x397bfd)/0x3e8);}return{'job_id':_0x50dcf5[_0xd0aa25(0x1aa)],'type':_0x50dcf5[_0xd0aa25(0x1af)]===_0xd0aa25(0x1c1)?_0xd0aa25(0x1b9):_0x50dcf5['type'],'status':_0x50dcf5[_0xd0aa25(0x198)],'user_name':_0x50dcf5['user_name'],'duration_sec':_0x344c07,'created_at':_0x50dcf5[_0xd0aa25(0x19c)],'started_at':_0x50dcf5[_0xd0aa25(0x1ad)],'end_at':_0x50dcf5['end_at']};});await handleSDKOutput(_0x22388b,_0x4e4e77);}else for(const _0xd052f8 of _0x439c13){const _0x172b0b=_0xd052f8[_0x94b95d(0x198)]==='success'?a25_0x1a5aa4['green']:_0xd052f8['status']===_0x94b95d(0x1a4)?a25_0x1a5aa4[_0x94b95d(0x187)]:a25_0x1a5aa4[_0x94b95d(0x1c7)],_0x1b3205=_0x172b0b(_0xd052f8[_0x94b95d(0x198)]),_0x5c0e40=getJobUrl(_0x5eb700,_0xd052f8[_0x94b95d(0x1aa)]),_0xe6c486=hyperlink(_0xd052f8[_0x94b95d(0x1aa)],_0x5c0e40),_0x370f2b=a25_0x1a5aa4[_0x94b95d(0x1c7)](_0xd052f8[_0x94b95d(0x1af)]===_0x94b95d(0x1c1)?_0x94b95d(0x1b9):_0xd052f8[_0x94b95d(0x1af)]),_0x49705e=[];if(_0xd052f8[_0x94b95d(0x1ad)]&&_0xd052f8[_0x94b95d(0x1a3)]){const _0x14d775=Math['round']((new Date(_0xd052f8['end_at'])['getTime']()-new Date(_0xd052f8[_0x94b95d(0x1ad)])[_0x94b95d(0x176)]())/0x3e8);_0x49705e[_0x94b95d(0x1b5)](formatDuration(_0x14d775));}if(_0xd052f8[_0x94b95d(0x1a3)])_0x49705e[_0x94b95d(0x1b5)](formatRelativeTime(new Date(_0xd052f8['end_at'])));else _0xd052f8[_0x94b95d(0x1ad)]&&_0x49705e[_0x94b95d(0x1b5)](formatRelativeTime(new Date(_0xd052f8['start_at'])));const _0x53aca8=_0x49705e['length']>0x0?a25_0x1a5aa4[_0x94b95d(0x1c7)]('\x20'+_0x49705e[_0x94b95d(0x1bf)](',\x20')):'';console['log']('⚡\x20'+_0xe6c486+'\x20'+_0x370f2b+'\x20'+_0x1b3205+_0x53aca8);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a25_0x28aa71(0x175);[a25_0x28aa71(0x19b)]=a25_0x28aa71(0x1ae);['validate'](_0x4b5019){const _0x1047d9=a25_0x28aa71,_0xf500f7=_0x4b5019['args'][0x0];if(!_0xf500f7)return _0x1047d9(0x1b6);return undefined;}async['execute'](_0x3ebdeb){const _0x390934=a25_0x28aa71,{options:_0x591ca6,args:_0x413570,tdx:_0x3ba6fd}=_0x3ebdeb,_0x4a3153=_0x413570[0x0],_0x5008ec=await withSpinner(_0x390934(0x17f),()=>_0x3ba6fd[_0x390934(0x1c6)]['show'](_0x4a3153),{'verbose':_0x591ca6[_0x390934(0x180)]}),_0x58372b=_0x5008ec[_0x390934(0x18b)];let _0x51d684;if(_0x58372b[_0x390934(0x1ad)]&&_0x58372b[_0x390934(0x1a3)]){const _0x48a0bf=new Date(_0x58372b['start_at'])['getTime'](),_0x562598=new Date(_0x58372b[_0x390934(0x1a3)])[_0x390934(0x176)]();_0x51d684=Math[_0x390934(0x18f)]((_0x562598-_0x48a0bf)/0x3e8);}const _0x3259f7={'job_id':_0x58372b[_0x390934(0x1aa)],'type':_0x58372b[_0x390934(0x1af)],'status':_0x58372b[_0x390934(0x198)],..._0x58372b[_0x390934(0x179)]&&{'user_name':_0x58372b['user_name']},..._0x51d684!==undefined&&{'duration_sec':_0x51d684},..._0x58372b[_0x390934(0x19c)]&&{'created_at':_0x58372b[_0x390934(0x19c)]},..._0x58372b[_0x390934(0x1ad)]&&{'started_at':_0x58372b[_0x390934(0x1ad)]},..._0x58372b[_0x390934(0x1a3)]&&{'end_at':_0x58372b[_0x390934(0x1a3)]},..._0x58372b['database']&&{'database':_0x58372b[_0x390934(0x183)]},..._0x58372b['priority']!==undefined&&{'priority':_0x58372b[_0x390934(0x1c2)]},..._0x58372b['url']&&{'url':_0x58372b[_0x390934(0x197)]},..._0x58372b[_0x390934(0x1c3)]&&{'query':_0x58372b[_0x390934(0x1c3)]},..._0x58372b[_0x390934(0x1ba)]&&{'debug':_0x58372b[_0x390934(0x1ba)]}};return await handleSingleObjectOutput(_0x3259f7,_0x591ca6),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x28aa71(0x1b7)]=a25_0x28aa71(0x188);[a25_0x28aa71(0x19b)]=a25_0x28aa71(0x193);['validate'](_0x23cb98){const _0x21fbdb=a25_0x28aa71,_0x1afc58=_0x23cb98[_0x21fbdb(0x190)][0x0];if(!_0x1afc58)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a25_0x28aa71(0x195)](_0x11a7f0){const _0x22903f=a25_0x28aa71,{options:_0x5327a9,args:_0x24e059,tdx:_0x341c9d}=_0x11a7f0,_0xb172a2=_0x24e059[0x0];if(!_0x5327a9[_0x22903f(0x174)]){const _0x4c00c3=await confirm(_0x22903f(0x173)+_0xb172a2+'?');if(!_0x4c00c3)return console[_0x22903f(0x1a4)](_0x22903f(0x189)),0x0;}return await withSpinner(_0x22903f(0x186),()=>_0x341c9d[_0x22903f(0x1c6)][_0x22903f(0x18e)](_0xb172a2),{'verbose':_0x5327a9[_0x22903f(0x180)]}),console[_0x22903f(0x1a4)](_0x22903f(0x1a9)+_0xb172a2),console[_0x22903f(0x1a4)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0xb172a2+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}function a25_0x8f44(_0x5d3f51,_0x1a9954){_0x5d3f51=_0x5d3f51-0x173;const _0x376eb4=a25_0x376e();let _0x8f44f0=_0x376eb4[_0x5d3f51];return _0x8f44f0;}export class JobSubmitCommand extends BaseCommand{[a25_0x28aa71(0x1b7)]='job:submit';[a25_0x28aa71(0x19b)]='Submit\x20a\x20job';async[a25_0x28aa71(0x195)](_0x5dff3a){const _0x410ada=a25_0x28aa71,{options:_0x4bde04,args:_0xb505b0,tdx:_0x28d128}=_0x5dff3a,_0xd83a3a=_0x4bde04['jobType']||'trino',_0x25d1e5=_0x4bde04['file'],_0x3821c2=_0x4bde04[_0x410ada(0x183)]||_0x410ada(0x1a5),_0x34ea0f=_0x4bde04['result'];if(_0xd83a3a!==_0x410ada(0x1b9)&&_0xd83a3a!==_0x410ada(0x17b))throw new SDKError(ErrorCode[_0x410ada(0x1a1)],_0x410ada(0x18c));let _0x5491b9;if(_0x25d1e5){if(_0xb505b0[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x410ada(0x177));const _0x1dd977=readSqlStatementsFromFile(_0x25d1e5);if(_0x1dd977[_0x410ada(0x182)]===0x0)throw new SDKError(ErrorCode[_0x410ada(0x1a1)],_0x410ada(0x1c4));if(_0x1dd977[_0x410ada(0x182)]>0x1)throw new SDKError(ErrorCode[_0x410ada(0x1a1)],_0x410ada(0x18a));_0x5491b9=_0x1dd977[0x0];}else{if(!_0xb505b0[0x0])throw new SDKError(ErrorCode[_0x410ada(0x1a1)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x5491b9=_0xb505b0[0x0];}_0x4bde04[_0x410ada(0x180)]&&(console[_0x410ada(0x1a4)](_0x410ada(0x1be)+_0xd83a3a),console[_0x410ada(0x1a4)](_0x410ada(0x1b0)+_0x3821c2),console[_0x410ada(0x1a4)](_0x410ada(0x18d)+_0x5491b9[_0x410ada(0x184)](0x0,0x64)+(_0x5491b9[_0x410ada(0x182)]>0x64?_0x410ada(0x1bc):'')));const _0x44d600=await withSpinner(_0x410ada(0x1bb),()=>_0x28d128[_0x410ada(0x1c6)][_0x410ada(0x19f)](_0x3821c2,_0x5491b9,_0xd83a3a,_0x34ea0f),{'verbose':_0x4bde04['verbose']}),_0x4718f2=_0x44d600[_0x410ada(0x18b)];return console[_0x410ada(0x1a4)](_0x410ada(0x1c0)),console[_0x410ada(0x1a4)](_0x410ada(0x17d)+_0x4718f2[_0x410ada(0x1aa)]),await handleSDKOutput([_0x4718f2],_0x4bde04),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x28aa71(0x1b7)]=a25_0x28aa71(0x1b3);[a25_0x28aa71(0x19b)]='Get\x20job\x20results';[a25_0x28aa71(0x185)](_0x31c2b4){const _0x343808=a25_0x28aa71,_0x57e971=_0x31c2b4[_0x343808(0x190)][0x0];if(!_0x57e971)return _0x343808(0x1b1);return undefined;}async[a25_0x28aa71(0x195)](_0x24dbf6){const _0x248e14=a25_0x28aa71,{options:_0x4fa10f,args:_0x114ebe,tdx:_0x1f7c43}=_0x24dbf6,_0x54ad67=_0x114ebe[0x0],_0x2d4f31=await withSpinner(_0x248e14(0x19a),()=>_0x1f7c43[_0x248e14(0x1c6)][_0x248e14(0x191)](_0x54ad67),{'verbose':_0x4fa10f['verbose']}),_0x2b1b49=_0x2d4f31[_0x248e14(0x18b)];return console[_0x248e14(0x1a4)](_0x248e14(0x1bd)+_0x2b1b49[_0x248e14(0x182)]+'\x20row'+(_0x2b1b49[_0x248e14(0x182)]!==0x1?'s':'')),await handleSDKOutput(_0x2b1b49,_0x4fa10f),0x0;}}