@treasuredata/tdx 2026.4.10 → 2026.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -1
@@ -1 +1 @@
1
- const a17_0x387069=a17_0x4608;(function(_0x3510e7,_0x56184c){const _0x1ebb91=a17_0x4608,_0x5665df=_0x3510e7();while(!![]){try{const _0x684f2f=parseInt(_0x1ebb91(0x163))/0x1*(-parseInt(_0x1ebb91(0x168))/0x2)+parseInt(_0x1ebb91(0x15f))/0x3*(parseInt(_0x1ebb91(0x16c))/0x4)+-parseInt(_0x1ebb91(0x16d))/0x5*(-parseInt(_0x1ebb91(0x165))/0x6)+parseInt(_0x1ebb91(0x16a))/0x7+parseInt(_0x1ebb91(0x169))/0x8+parseInt(_0x1ebb91(0x16e))/0x9*(parseInt(_0x1ebb91(0x16b))/0xa)+-parseInt(_0x1ebb91(0x167))/0xb;if(_0x684f2f===_0x56184c)break;else _0x5665df['push'](_0x5665df['shift']());}catch(_0x3d4a03){_0x5665df['push'](_0x5665df['shift']());}}}(a17_0x35ed,0xc2a65));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';function a17_0x4608(_0x5c2ce6,_0x5072c3){_0x5c2ce6=_0x5c2ce6-0x15f;const _0x35edea=a17_0x35ed();let _0x460841=_0x35edea[_0x5c2ce6];return _0x460841;}function a17_0x35ed(){const _0x4f250a=['verbose','data','221951skhjmB','Fetching\x20email\x20senders...','114fXsHWS','description','16191318SbeFxi','8QZsqVl','2173256GeUjph','1210440jqiMsG','30lYNqvU','2982292YFHXfk','307805KttuZg','154935vOPujm','limit','execute','List\x20email\x20senders','filter','listEmailSenders','delivery:senders','6GrFtkb','name'];a17_0x35ed=function(){return _0x4f250a;};return a17_0x35ed();}import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{[a17_0x387069(0x160)]=a17_0x387069(0x174);[a17_0x387069(0x166)]=a17_0x387069(0x171);async[a17_0x387069(0x170)](_0x35ed9b){const _0x136cfe=a17_0x387069,{options:_0x426164,args:_0x19f858,tdx:_0x170dee}=_0x35ed9b,_0x29a312=_0x19f858[0x0],_0x4de376=resolveLimit(_0x426164[_0x136cfe(0x16f)],DEFAULT_LLM_LIMIT),_0x29b956=_0x426164,_0x5d1827=await resolveWorkspaceIdFromOptions(_0x29b956,_0x170dee),_0x58f5ad=await withSpinner(_0x136cfe(0x164),()=>_0x170dee['delivery'][_0x136cfe(0x173)]({'workspaceId':_0x5d1827,'limit':_0x4de376}),{'verbose':_0x426164[_0x136cfe(0x161)]});let _0x5b7e8a=_0x58f5ad['data'];return _0x29a312&&(_0x5b7e8a=_0x58f5ad[_0x136cfe(0x162)][_0x136cfe(0x172)](_0x291968=>matchGlobPattern(_0x291968[_0x136cfe(0x160)],_0x29a312))),await handleSDKOutput(_0x5b7e8a,_0x426164),0x0;}}
1
+ function a17_0x5156(){const _0x197793=['39525bDraWE','data','name','List\x20email\x20senders','execute','description','1660104xWEzxM','delivery','Fetching\x20email\x20senders...','636158pWHueP','limit','19892DxczNO','803925bmRWoE','295hGePYR','543970nNJuke','8JTRrnK','delivery:senders','filter','3974625LQReCs'];a17_0x5156=function(){return _0x197793;};return a17_0x5156();}const a17_0xae68f4=a17_0x408d;(function(_0x2d7c86,_0x1c536b){const _0x54f560=a17_0x408d,_0x3eec85=_0x2d7c86();while(!![]){try{const _0x328ccf=parseInt(_0x54f560(0x13b))/0x1+parseInt(_0x54f560(0x131))/0x2+parseInt(_0x54f560(0x134))/0x3+-parseInt(_0x54f560(0x133))/0x4*(parseInt(_0x54f560(0x135))/0x5)+parseInt(_0x54f560(0x141))/0x6+parseInt(_0x54f560(0x136))/0x7+-parseInt(_0x54f560(0x137))/0x8*(parseInt(_0x54f560(0x13a))/0x9);if(_0x328ccf===_0x1c536b)break;else _0x3eec85['push'](_0x3eec85['shift']());}catch(_0xb6f66){_0x3eec85['push'](_0x3eec85['shift']());}}}(a17_0x5156,0x3bccd));function a17_0x408d(_0x3fd133,_0x419dd3){_0x3fd133=_0x3fd133-0x131;const _0x515639=a17_0x5156();let _0x408dfc=_0x515639[_0x3fd133];return _0x408dfc;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{[a17_0xae68f4(0x13d)]=a17_0xae68f4(0x138);[a17_0xae68f4(0x140)]=a17_0xae68f4(0x13e);async[a17_0xae68f4(0x13f)](_0x108faa){const _0x4158d6=a17_0xae68f4,{options:_0x282d61,args:_0x2c1796,tdx:_0x3a736f}=_0x108faa,_0x603bd0=_0x2c1796[0x0],_0x4c5df5=resolveLimit(_0x282d61[_0x4158d6(0x132)],DEFAULT_LLM_LIMIT),_0x176326=_0x282d61,_0x22bba2=await resolveWorkspaceIdFromOptions(_0x176326,_0x3a736f),_0x1cd9e7=await withSpinner(_0x4158d6(0x143),()=>_0x3a736f[_0x4158d6(0x142)]['listEmailSenders']({'workspaceId':_0x22bba2,'limit':_0x4c5df5}),{'verbose':_0x282d61['verbose']});let _0x3d9f76=_0x1cd9e7[_0x4158d6(0x13c)];return _0x603bd0&&(_0x3d9f76=_0x1cd9e7['data'][_0x4158d6(0x139)](_0x249395=>matchGlobPattern(_0x249395[_0x4158d6(0x13d)],_0x603bd0))),await handleSDKOutput(_0x3d9f76,_0x282d61),0x0;}}
@@ -1 +1 @@
1
- function a18_0xdc04(){const _0x13bbbb=['error','\x20column','5yAsYDY','2MbLoHH','message','Table\x20\x27','length','Table:\x20','4277021pFdBmt','data','8lmqRlX','name','\x20\x20Cause:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','2737899uVGpYW','✔\x20Found\x20','\x20in\x20','3029502GQhLmG','Database:\x20','description','576772ofaFJW','623556jUsgQw','3097630jYPJZK','validate','44RzmKbQ','Describe\x20table\x20schema','Error:\x20','describe','cause','execute','database','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','verbose','describeTable','2198331uORNWg','✖\x20Table\x20not\x20found','args','\x27\x20does\x20not\x20exist'];a18_0xdc04=function(){return _0x13bbbb;};return a18_0xdc04();}const a18_0x5b216b=a18_0x5585;(function(_0x31c508,_0x56e6be){const _0x123280=a18_0x5585,_0xd1d8c1=_0x31c508();while(!![]){try{const _0x10b8ca=-parseInt(_0x123280(0x182))/0x1*(parseInt(_0x123280(0x196))/0x2)+parseInt(_0x123280(0x18f))/0x3+-parseInt(_0x123280(0x181))/0x4*(parseInt(_0x123280(0x195))/0x5)+-parseInt(_0x123280(0x17e))/0x6+-parseInt(_0x123280(0x19b))/0x7+parseInt(_0x123280(0x19d))/0x8*(parseInt(_0x123280(0x17b))/0x9)+parseInt(_0x123280(0x183))/0xa*(parseInt(_0x123280(0x185))/0xb);if(_0x10b8ca===_0x56e6be)break;else _0xd1d8c1['push'](_0xd1d8c1['shift']());}catch(_0x44efba){_0xd1d8c1['push'](_0xd1d8c1['shift']());}}}(a18_0xdc04,0x5fcb3));import{BaseCommand}from'./command.js';function a18_0x5585(_0x1153d7,_0x41dcad){_0x1153d7=_0x1153d7-0x17a;const _0xdc0436=a18_0xdc04();let _0x558502=_0xdc0436[_0x1153d7];return _0x558502;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a18_0x5b216b(0x19e)]=a18_0x5b216b(0x188);[a18_0x5b216b(0x180)]=a18_0x5b216b(0x186);async[a18_0x5b216b(0x18a)](_0x42915e){const _0x3da0bf=a18_0x5b216b;return this[_0x3da0bf(0x18e)](_0x42915e);}async[a18_0x5b216b(0x18e)](_0x17d117){const _0x301283=a18_0x5b216b,{options:_0x58a443,args:_0x44599b,tdx:_0x318442}=_0x17d117;let _0x447926;try{_0x447926=parseTableReference(_0x44599b[0x0]);const _0x1b3b85=_0x58a443[_0x301283(0x18b)];!_0x447926['database']&&_0x1b3b85&&(_0x447926['database']=_0x1b3b85);const _0x1c8193=validateTableDescribeReference(_0x447926);if(_0x1c8193)return console[_0x301283(0x193)](_0x301283(0x187)+_0x1c8193),0x1;}catch(_0x184c9c){return console[_0x301283(0x193)](_0x301283(0x187)+_0x184c9c[_0x301283(0x197)]),0x1;}const _0x260899=_0x447926['database'],_0x1b19c8=_0x447926['table'];try{_0x58a443['verbose']&&(console['error']('Site:\x20'+_0x58a443['site']),console[_0x301283(0x193)](_0x301283(0x17f)+_0x260899),console[_0x301283(0x193)](_0x301283(0x19a)+_0x1b19c8));const _0x14041d=await withSpinner('Describing\x20table\x20'+_0x260899+'.'+_0x1b19c8+'...',()=>_0x318442['query']['describeTable'](_0x260899,_0x1b19c8),{'verbose':_0x58a443[_0x301283(0x18d)]}),_0x5734e1=_0x14041d[_0x301283(0x19c)];if(_0x5734e1[_0x301283(0x199)]===0x0)return console['error'](_0x301283(0x190)),console[_0x301283(0x193)](_0x301283(0x198)+_0x260899+'.'+_0x1b19c8+_0x301283(0x192)),0x1;return console['error'](_0x301283(0x17c)+_0x5734e1[_0x301283(0x199)]+_0x301283(0x194)+(_0x5734e1[_0x301283(0x199)]!==0x1?'s':'')+_0x301283(0x17d)+_0x260899+'.'+_0x1b19c8),await handleSDKOutput(_0x5734e1,_0x58a443),0x0;}catch(_0x313956){if(_0x313956 instanceof SDKError)return console[_0x301283(0x193)](_0x301283(0x187)+_0x313956[_0x301283(0x197)]),_0x313956['cause']&&console['error'](_0x301283(0x19f)+_0x313956[_0x301283(0x189)]),0x1;throw _0x313956;}}[a18_0x5b216b(0x184)](_0x38b858){const _0x137e01=a18_0x5b216b;if(_0x38b858[_0x137e01(0x191)]['length']===0x0)return _0x137e01(0x18c);if(_0x38b858[_0x137e01(0x191)][_0x137e01(0x199)]>0x1)return _0x137e01(0x17a);return undefined;}}
1
+ const a18_0xc6aef7=a18_0xccca;(function(_0xa9614c,_0xe93268){const _0x3be0bc=a18_0xccca,_0x1fc389=_0xa9614c();while(!![]){try{const _0x147578=parseInt(_0x3be0bc(0x104))/0x1+-parseInt(_0x3be0bc(0x110))/0x2+parseInt(_0x3be0bc(0x102))/0x3+parseInt(_0x3be0bc(0x10a))/0x4*(-parseInt(_0x3be0bc(0x10b))/0x5)+parseInt(_0x3be0bc(0xf8))/0x6+-parseInt(_0x3be0bc(0x10f))/0x7+parseInt(_0x3be0bc(0x10d))/0x8*(parseInt(_0x3be0bc(0x101))/0x9);if(_0x147578===_0xe93268)break;else _0x1fc389['push'](_0x1fc389['shift']());}catch(_0x35284b){_0x1fc389['push'](_0x1fc389['shift']());}}}(a18_0x40f6,0xa4089));import{BaseCommand}from'./command.js';function a18_0xccca(_0x2579c7,_0x4b5042){_0x2579c7=_0x2579c7-0xf8;const _0x40f615=a18_0x40f6();let _0xccca6a=_0x40f615[_0x2579c7];return _0xccca6a;}import{SDKError}from'../sdk/index.js';function a18_0x40f6(){const _0x3b111a=['table','error','describe','message','4Hkvjtv','6027785aOpDDC','\x20column','8owQptq','database','1745912YCTyke','2600418NcvCVW','cause','describeTable','Database:\x20','\x27\x20does\x20not\x20exist','args','data','site','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','description','\x20\x20Cause:\x20','6283374fVfSfr','Error:\x20','execute','verbose','validate','✖\x20Table\x20not\x20found','Describing\x20table\x20','length','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','13796253CNWOTZ','2455131iCVzWy','✔\x20Found\x20','28540XxsvBP','Site:\x20'];a18_0x40f6=function(){return _0x3b111a;};return a18_0x40f6();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{['name']=a18_0xc6aef7(0x108);[a18_0xc6aef7(0x119)]='Describe\x20table\x20schema';async[a18_0xc6aef7(0xfa)](_0x3b2781){const _0x40fd8d=a18_0xc6aef7;return this[_0x40fd8d(0x112)](_0x3b2781);}async[a18_0xc6aef7(0x112)](_0x59e2bd){const _0x4b0833=a18_0xc6aef7,{options:_0x1aff3d,args:_0x357948,tdx:_0x34cd7f}=_0x59e2bd;let _0x313191;try{_0x313191=parseTableReference(_0x357948[0x0]);const _0x247dfd=_0x1aff3d[_0x4b0833(0x10e)];!_0x313191[_0x4b0833(0x10e)]&&_0x247dfd&&(_0x313191[_0x4b0833(0x10e)]=_0x247dfd);const _0x2eebdc=validateTableDescribeReference(_0x313191);if(_0x2eebdc)return console[_0x4b0833(0x107)](_0x4b0833(0xf9)+_0x2eebdc),0x1;}catch(_0x1d2496){return console[_0x4b0833(0x107)](_0x4b0833(0xf9)+_0x1d2496[_0x4b0833(0x109)]),0x1;}const _0x5e856e=_0x313191[_0x4b0833(0x10e)],_0x478b68=_0x313191[_0x4b0833(0x106)];try{_0x1aff3d['verbose']&&(console[_0x4b0833(0x107)](_0x4b0833(0x105)+_0x1aff3d[_0x4b0833(0x117)]),console[_0x4b0833(0x107)](_0x4b0833(0x113)+_0x5e856e),console[_0x4b0833(0x107)]('Table:\x20'+_0x478b68));const _0xb81ecf=await withSpinner(_0x4b0833(0xfe)+_0x5e856e+'.'+_0x478b68+'...',()=>_0x34cd7f['query'][_0x4b0833(0x112)](_0x5e856e,_0x478b68),{'verbose':_0x1aff3d[_0x4b0833(0xfb)]}),_0x5785f2=_0xb81ecf[_0x4b0833(0x116)];if(_0x5785f2[_0x4b0833(0xff)]===0x0)return console[_0x4b0833(0x107)](_0x4b0833(0xfd)),console[_0x4b0833(0x107)]('Table\x20\x27'+_0x5e856e+'.'+_0x478b68+_0x4b0833(0x114)),0x1;return console[_0x4b0833(0x107)](_0x4b0833(0x103)+_0x5785f2['length']+_0x4b0833(0x10c)+(_0x5785f2[_0x4b0833(0xff)]!==0x1?'s':'')+'\x20in\x20'+_0x5e856e+'.'+_0x478b68),await handleSDKOutput(_0x5785f2,_0x1aff3d),0x0;}catch(_0x5488cb){if(_0x5488cb instanceof SDKError)return console[_0x4b0833(0x107)](_0x4b0833(0xf9)+_0x5488cb['message']),_0x5488cb['cause']&&console[_0x4b0833(0x107)](_0x4b0833(0x11a)+_0x5488cb[_0x4b0833(0x111)]),0x1;throw _0x5488cb;}}[a18_0xc6aef7(0xfc)](_0x168ea8){const _0x1b91c5=a18_0xc6aef7;if(_0x168ea8[_0x1b91c5(0x115)][_0x1b91c5(0xff)]===0x0)return _0x1b91c5(0x100);if(_0x168ea8[_0x1b91c5(0x115)][_0x1b91c5(0xff)]>0x1)return _0x1b91c5(0x118);return undefined;}}
@@ -1 +1 @@
1
- function a19_0x2a38(){const _0x4cdab7=['\x20unchanged\x20files','\x27...','2854716LQOVOs','✔\x20All\x20files\x20are\x20up\x20to\x20date','length','2130gKypFS','workspaceName','\x0aChanges\x20to\x20\x27','✔\x20Context\x20set:\x20','22hVlSEe','repeat','utf-8','verbose','6gUIZVF','225058rXDMVE','\x20changed\x20files','setPhase','execute','engage_workspace','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','description','1156032VMVyPA','workspace','red','targetDir','diff','\x20campaigns','Aborted.','absolutePath','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','Pulling\x20campaigns\x20from\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','3keYoGG','yellow','19935VSByNv','yes','\x0aPull\x20summary\x20for\x20workspace\x20\x27','campaigns','-\x20no\x20files\x20written','241186iecYYg','filter','relativePath','cyan','Workspace\x20is\x20required.','✔\x20Pulled\x20','green','Pull\x20campaigns\x20to\x20YAML\x20files','files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','error','isNew','engage','cwd','counts','1983023moPUmz','session','name','dim','engage:campaign:pull','config','hasChanges','2297545lCtiHk','dirname','8swzwDp','data','\x0aError:'];a19_0x2a38=function(){return _0x4cdab7;};return a19_0x2a38();}const a19_0xfa4b9=a19_0x1676;(function(_0x4401eb,_0x33e04b){const _0x5365a7=a19_0x1676,_0x412683=_0x4401eb();while(!![]){try{const _0x2787d7=parseInt(_0x5365a7(0x210))/0x1+-parseInt(_0x5365a7(0x1f6))/0x2*(-parseInt(_0x5365a7(0x209))/0x3)+-parseInt(_0x5365a7(0x1fe))/0x4+-parseInt(_0x5365a7(0x226))/0x5*(-parseInt(_0x5365a7(0x1f5))/0x6)+parseInt(_0x5365a7(0x21f))/0x7*(-parseInt(_0x5365a7(0x228))/0x8)+parseInt(_0x5365a7(0x20b))/0x9*(-parseInt(_0x5365a7(0x230))/0xa)+parseInt(_0x5365a7(0x1f1))/0xb*(parseInt(_0x5365a7(0x22d))/0xc);if(_0x2787d7===_0x33e04b)break;else _0x412683['push'](_0x412683['shift']());}catch(_0x46d0b2){_0x412683['push'](_0x412683['shift']());}}}(a19_0x2a38,0x3bcb6));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 a19_0x4847b8 from'chalk';function a19_0x1676(_0x57fac1,_0x84a06e){_0x57fac1=_0x57fac1-0x1f0;const _0x2a38be=a19_0x2a38();let _0x1676e4=_0x2a38be[_0x57fac1];return _0x1676e4;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a19_0x2f0a47 from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{[a19_0xfa4b9(0x221)]=a19_0xfa4b9(0x223);[a19_0xfa4b9(0x1fd)]=a19_0xfa4b9(0x217);async[a19_0xfa4b9(0x1f9)](_0x363aa6){const _0x594aa3=a19_0xfa4b9,{options:_0x56d3f2,args:_0x3700d9,tdx:_0x4214b2}=_0x363aa6,_0x49b210=_0x56d3f2,_0x45eeff=await resolveWorkspaceName(_0x3700d9[0x0],_0x49b210);if(!_0x45eeff)return console[_0x594aa3(0x21a)](a19_0x4847b8[_0x594aa3(0x20a)](_0x594aa3(0x214))),console[_0x594aa3(0x21a)](_0x594aa3(0x1fb)),console['error'](_0x594aa3(0x208)),console['error'](_0x594aa3(0x206)),0x1;const _0x1dafa6=await withProgressSpinner(_0x594aa3(0x207)+_0x45eeff+_0x594aa3(0x22c),_0x5c81f8=>pullCampaigns({'engage':_0x4214b2[_0x594aa3(0x21c)],'segment':_0x4214b2['segment']},_0x45eeff,{'campaignName':_0x49b210[_0x594aa3(0x221)],'campaignType':_0x49b210['type'],'progress':{'update':_0x564be6=>{const _0xe2aa79=_0x594aa3;_0x5c81f8[_0xe2aa79(0x1f8)](_0x564be6);}}}),{'verbose':_0x49b210[_0x594aa3(0x1f4)]}),_0x439306=_0x1dafa6[_0x594aa3(0x229)];if(_0x439306['counts'][_0x594aa3(0x20e)]===0x0)return console[_0x594aa3(0x21a)](a19_0x4847b8[_0x594aa3(0x20a)](_0x594aa3(0x1fc)+_0x439306[_0x594aa3(0x231)]+'\x27')),0x0;const _0xf09888=_0x439306[_0x594aa3(0x218)][_0x594aa3(0x211)](_0x55b948=>_0x55b948[_0x594aa3(0x21b)]),_0x3d47a0=_0x439306['files'][_0x594aa3(0x211)](_0x4a16c9=>!_0x4a16c9[_0x594aa3(0x21b)]&&_0x4a16c9[_0x594aa3(0x225)]),_0x103cc0=_0x439306[_0x594aa3(0x218)][_0x594aa3(0x211)](_0x2cd69e=>!_0x2cd69e[_0x594aa3(0x21b)]&&!_0x2cd69e[_0x594aa3(0x225)]);console[_0x594aa3(0x21a)](_0x594aa3(0x20d)+_0x439306[_0x594aa3(0x231)]+'\x27:'),console[_0x594aa3(0x21a)]('\x20\x20'+a19_0x4847b8[_0x594aa3(0x213)](_0x439306[_0x594aa3(0x21e)]['campaigns']+_0x594aa3(0x203))),console['error']('\x20\x20'+a19_0x4847b8[_0x594aa3(0x216)]('+\x20'+_0xf09888[_0x594aa3(0x22f)]+'\x20new\x20files')),console[_0x594aa3(0x21a)]('\x20\x20'+a19_0x4847b8['yellow']('~\x20'+_0x3d47a0[_0x594aa3(0x22f)]+_0x594aa3(0x1f7))),console[_0x594aa3(0x21a)]('\x20\x20'+a19_0x4847b8[_0x594aa3(0x222)]('=\x20'+_0x103cc0[_0x594aa3(0x22f)]+_0x594aa3(0x22b))),console[_0x594aa3(0x21a)]('\x20\x20Target:\x20'+a19_0x4847b8[_0x594aa3(0x213)](_0x439306[_0x594aa3(0x201)])+'\x0a');if(_0x3d47a0[_0x594aa3(0x22f)]>0x0)for(const _0x2497fc of _0x3d47a0){console[_0x594aa3(0x21a)](_0x594aa3(0x232)+_0x2497fc[_0x594aa3(0x212)]+'\x27:'),console[_0x594aa3(0x21a)]('─'[_0x594aa3(0x1f2)](0x3c)),console[_0x594aa3(0x21a)](_0x2497fc[_0x594aa3(0x202)]),console[_0x594aa3(0x21a)]('─'['repeat'](0x3c));}if(_0x49b210['dryRun'])return console[_0x594aa3(0x21a)](a19_0x4847b8['yellow'](_0x594aa3(0x219))),0x0;if(_0xf09888[_0x594aa3(0x22f)]===0x0&&_0x3d47a0[_0x594aa3(0x22f)]===0x0)return console[_0x594aa3(0x21a)](a19_0x4847b8[_0x594aa3(0x216)](_0x594aa3(0x22e))),saveSessionContext({'engage_workspace':_0x439306[_0x594aa3(0x231)]},_0x49b210[_0x594aa3(0x220)]),0x0;if(!_0x49b210[_0x594aa3(0x20c)]){if(!isInteractive())return console[_0x594aa3(0x21a)](a19_0x4847b8[_0x594aa3(0x200)](_0x594aa3(0x22a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a19_0x4847b8[_0x594aa3(0x222)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x185254=await confirmKey('Write\x20'+(_0xf09888[_0x594aa3(0x22f)]+_0x3d47a0[_0x594aa3(0x22f)])+'\x20files?');if(!_0x185254)return console[_0x594aa3(0x21a)](a19_0x4847b8[_0x594aa3(0x20a)](_0x594aa3(0x204)),_0x594aa3(0x20f)),0x1;}for(const _0x43b6b0 of _0x439306[_0x594aa3(0x218)]){if(_0x43b6b0['isNew']||_0x43b6b0[_0x594aa3(0x225)]){const _0x552a3c=a19_0x2f0a47[_0x594aa3(0x227)](_0x43b6b0[_0x594aa3(0x205)]);!existsSync(_0x552a3c)&&mkdirSync(_0x552a3c,{'recursive':!![]}),writeFileSync(_0x43b6b0[_0x594aa3(0x205)],_0x43b6b0['content'],_0x594aa3(0x1f3));}}return console['error'](a19_0x4847b8[_0x594aa3(0x216)](_0x594aa3(0x215)+(_0xf09888[_0x594aa3(0x22f)]+_0x3d47a0[_0x594aa3(0x22f)])+'\x20files\x20to\x20'+_0x439306['targetDir'])),saveSessionContext({'engage_workspace':_0x439306['workspaceName']},_0x49b210[_0x594aa3(0x220)]),console[_0x594aa3(0x21a)](a19_0x4847b8[_0x594aa3(0x216)](_0x594aa3(0x1f0)+a19_0x4847b8[_0x594aa3(0x222)](_0x594aa3(0x1fa))+'\x20=\x20'+a19_0x4847b8['cyan'](_0x439306['workspaceName']))),0x0;}}async function resolveWorkspaceName(_0x419cee,_0x1f04ef){const _0xb924e4=a19_0xfa4b9;if(_0x419cee)return _0x419cee;if(_0x1f04ef[_0xb924e4(0x1ff)])return _0x1f04ef[_0xb924e4(0x1ff)];const _0x37a634=tryFindTdxConfig(process[_0xb924e4(0x21d)]());if(_0x37a634?.[_0xb924e4(0x224)]['engage_workspace'])return _0x37a634[_0xb924e4(0x224)][_0xb924e4(0x1fa)];const _0x225084=loadSessionContext(_0x1f04ef[_0xb924e4(0x220)]);if(_0x225084?.[_0xb924e4(0x1fa)])return _0x225084[_0xb924e4(0x1fa)];return undefined;}
1
+ const a19_0x1c0f25=a19_0x499a;(function(_0x5db2f5,_0x4bdc77){const _0x35bf44=a19_0x499a,_0xe9854a=_0x5db2f5();while(!![]){try{const _0x13e977=parseInt(_0x35bf44(0x20b))/0x1*(-parseInt(_0x35bf44(0x21c))/0x2)+-parseInt(_0x35bf44(0x1fc))/0x3*(-parseInt(_0x35bf44(0x219))/0x4)+-parseInt(_0x35bf44(0x1f5))/0x5*(-parseInt(_0x35bf44(0x217))/0x6)+-parseInt(_0x35bf44(0x1e0))/0x7*(-parseInt(_0x35bf44(0x1fd))/0x8)+parseInt(_0x35bf44(0x21b))/0x9*(parseInt(_0x35bf44(0x1df))/0xa)+-parseInt(_0x35bf44(0x1e7))/0xb+parseInt(_0x35bf44(0x205))/0xc;if(_0x13e977===_0x4bdc77)break;else _0xe9854a['push'](_0xe9854a['shift']());}catch(_0x3edffe){_0xe9854a['push'](_0xe9854a['shift']());}}}(a19_0x2fab,0x37154));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a19_0x499a(_0x10cc14,_0x515259){_0x10cc14=_0x10cc14-0x1df;const _0x2fab73=a19_0x2fab();let _0x499a95=_0x2fab73[_0x10cc14];return _0x499a95;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a19_0x3d0302 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a19_0x2fab(){const _0x1c5401=['518495UbJFzR','\x0aError:','cyan','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','hasChanges','error','1461laZUwo','1976328AISghd','\x20unchanged\x20files','repeat','setPhase','green','workspace','workspaceName','Workspace\x20is\x20required.','781320nbAEuN','session','engage','files','\x20campaigns','diff','1hzwPGg','execute','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','engage_workspace','length','content','\x20files\x20to\x20','filter','\x20changed\x20files','Pull\x20campaigns\x20to\x20YAML\x20files','yellow','segment','6QRSfcZ','name','3116BHXkLC','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','9tKqblg','860638oNylok','config','2714470KJUsCX','7Elpjnj','yes','✔\x20Context\x20set:\x20','verbose','dim','\x20files?','\x20new\x20files','4518041DyMZaH','data','utf-8','counts','Pulling\x20campaigns\x20from\x20\x27','targetDir','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','cwd','red','campaigns','absolutePath','relativePath','dirname','isNew'];a19_0x2fab=function(){return _0x1c5401;};return a19_0x2fab();}import a19_0x47e91c from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{[a19_0x1c0f25(0x218)]='engage:campaign:pull';['description']=a19_0x1c0f25(0x214);async[a19_0x1c0f25(0x20c)](_0x4a863d){const _0x44272c=a19_0x1c0f25,{options:_0x303b36,args:_0x41e946,tdx:_0x27bd4b}=_0x4a863d,_0x4edeb2=_0x303b36,_0x132491=await resolveWorkspaceName(_0x41e946[0x0],_0x4edeb2);if(!_0x132491)return console['error'](a19_0x3d0302['yellow'](_0x44272c(0x204))),console[_0x44272c(0x1fb)]('\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>'),console[_0x44272c(0x1fb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>'),console['error'](_0x44272c(0x1f8)),0x1;const _0x1195a2=await withProgressSpinner(_0x44272c(0x1eb)+_0x132491+'\x27...',_0x5af264=>pullCampaigns({'engage':_0x27bd4b[_0x44272c(0x207)],'segment':_0x27bd4b[_0x44272c(0x216)]},_0x132491,{'campaignName':_0x4edeb2[_0x44272c(0x218)],'campaignType':_0x4edeb2['type'],'progress':{'update':_0x2dfb4d=>{const _0x4ab41a=_0x44272c;_0x5af264[_0x4ab41a(0x200)](_0x2dfb4d);}}}),{'verbose':_0x4edeb2[_0x44272c(0x1e3)]}),_0x3f33d9=_0x1195a2[_0x44272c(0x1e8)];if(_0x3f33d9['counts']['campaigns']===0x0)return console['error'](a19_0x3d0302[_0x44272c(0x215)](_0x44272c(0x1f9)+_0x3f33d9[_0x44272c(0x203)]+'\x27')),0x0;const _0x32827b=_0x3f33d9[_0x44272c(0x208)][_0x44272c(0x212)](_0x47fc20=>_0x47fc20[_0x44272c(0x1f4)]),_0x6cdf86=_0x3f33d9[_0x44272c(0x208)]['filter'](_0x50d623=>!_0x50d623[_0x44272c(0x1f4)]&&_0x50d623[_0x44272c(0x1fa)]),_0x1a6e94=_0x3f33d9[_0x44272c(0x208)][_0x44272c(0x212)](_0x23b63a=>!_0x23b63a[_0x44272c(0x1f4)]&&!_0x23b63a[_0x44272c(0x1fa)]);console[_0x44272c(0x1fb)]('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x3f33d9[_0x44272c(0x203)]+'\x27:'),console[_0x44272c(0x1fb)]('\x20\x20'+a19_0x3d0302[_0x44272c(0x1f7)](_0x3f33d9[_0x44272c(0x1ea)][_0x44272c(0x1f0)]+_0x44272c(0x209))),console[_0x44272c(0x1fb)]('\x20\x20'+a19_0x3d0302[_0x44272c(0x201)]('+\x20'+_0x32827b[_0x44272c(0x20f)]+_0x44272c(0x1e6))),console[_0x44272c(0x1fb)]('\x20\x20'+a19_0x3d0302[_0x44272c(0x215)]('~\x20'+_0x6cdf86[_0x44272c(0x20f)]+_0x44272c(0x213))),console[_0x44272c(0x1fb)]('\x20\x20'+a19_0x3d0302[_0x44272c(0x1e4)]('=\x20'+_0x1a6e94[_0x44272c(0x20f)]+_0x44272c(0x1fe))),console[_0x44272c(0x1fb)]('\x20\x20Target:\x20'+a19_0x3d0302[_0x44272c(0x1f7)](_0x3f33d9['targetDir'])+'\x0a');if(_0x6cdf86[_0x44272c(0x20f)]>0x0)for(const _0x3b3304 of _0x6cdf86){console[_0x44272c(0x1fb)]('\x0aChanges\x20to\x20\x27'+_0x3b3304[_0x44272c(0x1f2)]+'\x27:'),console[_0x44272c(0x1fb)]('─'[_0x44272c(0x1ff)](0x3c)),console['error'](_0x3b3304[_0x44272c(0x20a)]),console[_0x44272c(0x1fb)]('─'['repeat'](0x3c));}if(_0x4edeb2['dryRun'])return console['error'](a19_0x3d0302[_0x44272c(0x215)](_0x44272c(0x21a))),0x0;if(_0x32827b[_0x44272c(0x20f)]===0x0&&_0x6cdf86[_0x44272c(0x20f)]===0x0)return console[_0x44272c(0x1fb)](a19_0x3d0302[_0x44272c(0x201)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x3f33d9[_0x44272c(0x203)]},_0x4edeb2[_0x44272c(0x206)]),0x0;if(!_0x4edeb2[_0x44272c(0x1e1)]){if(!isInteractive())return console[_0x44272c(0x1fb)](a19_0x3d0302[_0x44272c(0x1ef)](_0x44272c(0x1f6)),_0x44272c(0x1ed)),console['error'](a19_0x3d0302['dim'](_0x44272c(0x20d))),0x1;const _0x582b19=await confirmKey('Write\x20'+(_0x32827b[_0x44272c(0x20f)]+_0x6cdf86[_0x44272c(0x20f)])+_0x44272c(0x1e5));if(!_0x582b19)return console['error'](a19_0x3d0302['yellow']('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x453f24 of _0x3f33d9[_0x44272c(0x208)]){if(_0x453f24['isNew']||_0x453f24[_0x44272c(0x1fa)]){const _0x45b014=a19_0x47e91c[_0x44272c(0x1f3)](_0x453f24[_0x44272c(0x1f1)]);!existsSync(_0x45b014)&&mkdirSync(_0x45b014,{'recursive':!![]}),writeFileSync(_0x453f24[_0x44272c(0x1f1)],_0x453f24[_0x44272c(0x210)],_0x44272c(0x1e9));}}return console['error'](a19_0x3d0302[_0x44272c(0x201)]('✔\x20Pulled\x20'+(_0x32827b[_0x44272c(0x20f)]+_0x6cdf86[_0x44272c(0x20f)])+_0x44272c(0x211)+_0x3f33d9[_0x44272c(0x1ec)])),saveSessionContext({'engage_workspace':_0x3f33d9['workspaceName']},_0x4edeb2['session']),console[_0x44272c(0x1fb)](a19_0x3d0302[_0x44272c(0x201)](_0x44272c(0x1e2)+a19_0x3d0302[_0x44272c(0x1e4)]('engage_workspace')+'\x20=\x20'+a19_0x3d0302[_0x44272c(0x1f7)](_0x3f33d9[_0x44272c(0x203)]))),0x0;}}async function resolveWorkspaceName(_0x399d3b,_0x142408){const _0x2cbaea=a19_0x1c0f25;if(_0x399d3b)return _0x399d3b;if(_0x142408[_0x2cbaea(0x202)])return _0x142408['workspace'];const _0x46e49d=tryFindTdxConfig(process[_0x2cbaea(0x1ee)]());if(_0x46e49d?.[_0x2cbaea(0x21d)][_0x2cbaea(0x20e)])return _0x46e49d[_0x2cbaea(0x21d)][_0x2cbaea(0x20e)];const _0x322b91=loadSessionContext(_0x142408['session']);if(_0x322b91?.[_0x2cbaea(0x20e)])return _0x322b91['engage_workspace'];return undefined;}
@@ -1 +1 @@
1
- const a20_0x1388c0=a20_0x3738;(function(_0x10116a,_0x34ee52){const _0x17b59f=a20_0x3738,_0xa7aee7=_0x10116a();while(!![]){try{const _0x5e7d6e=-parseInt(_0x17b59f(0xb7))/0x1+parseInt(_0x17b59f(0xbe))/0x2*(parseInt(_0x17b59f(0xb5))/0x3)+parseInt(_0x17b59f(0xaf))/0x4+-parseInt(_0x17b59f(0xae))/0x5+-parseInt(_0x17b59f(0xb4))/0x6+parseInt(_0x17b59f(0x97))/0x7+parseInt(_0x17b59f(0xb0))/0x8;if(_0x5e7d6e===_0x34ee52)break;else _0xa7aee7['push'](_0xa7aee7['shift']());}catch(_0x7df4e5){_0xa7aee7['push'](_0xa7aee7['shift']());}}}(a20_0x3b23,0xe1139));function a20_0x3738(_0x18ddf0,_0x29a7d9){_0x18ddf0=_0x18ddf0-0x85;const _0x3b23e2=a20_0x3b23();let _0x3738f7=_0x3b23e2[_0x18ddf0];return _0x3738f7;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a20_0x3b23(){const _0x2422b1=['yes','configDir','red','error','\x20campaigns\x20to\x20update:','-\x20no\x20changes\x20applied','errors','filter','\x20campaign\x20files','execute','dryRun','Resolving\x20references...','\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','data','dirname','\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','4021395LdGkrf','verbose','message','update','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x20new\x20campaigns:','path','name','resolve','1\x20campaign\x20file:\x20','engage_workspace','session','length','engage','\x0aValidation\x20errors\x20in\x20','warnings','\x27...','\x0aError:','Pushing\x20campaigns...','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','campaignId','campaign_type','9110020vlAsBH','6366968VrTnAJ','13960288ASMEUL','\x20errors:','segment','✔\x20Created\x20','7208628mianfn','120hArMoB','relativePath','55708fIenRn','\x20\x20\x20\x20','created','Found\x20','\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)','yellow','setPhase','4490SFqHYm','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','action','resolveWorkspaceId','green','\x20campaigns','Aborted.','\x0aPush\x20summary\x20for\x20workspace\x20\x27','description','cwd','updated','workspace','create','def','dim','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date'];a20_0x3b23=function(){return _0x2422b1;};return a20_0x3b23();}import{isYamlFile}from'../sdk/segment/file-discovery.js';import a20_0x9339b8 from'chalk';import a20_0x2609b1 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{[a20_0x1388c0(0x9e)]='engage:campaign:push';[a20_0x1388c0(0xc6)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns';async[a20_0x1388c0(0x90)](_0x1b1ae7){const _0x54dbcc=a20_0x1388c0,{options:_0x3d10b6,args:_0x6f0def,tdx:_0x3c7be9}=_0x1b1ae7,_0x41310c=_0x3d10b6,_0x36252c=_0x6f0def[0x0],_0x213d66=_0x36252c?a20_0x2609b1[_0x54dbcc(0x9f)](_0x36252c):undefined,_0x4c8679=_0x213d66?isYamlFile(_0x213d66):![];let _0x4e523c;if(_0x4c8679&&_0x213d66)_0x4e523c=a20_0x2609b1[_0x54dbcc(0x95)](_0x213d66);else _0x213d66?_0x4e523c=_0x213d66:_0x4e523c=process[_0x54dbcc(0xc7)]();let _0x2e2e87;const _0x200519=tryFindTdxConfig(_0x4e523c);_0x200519?.['config'][_0x54dbcc(0xa1)]&&(_0x2e2e87=_0x200519['config'][_0x54dbcc(0xa1)],!_0x4c8679&&(_0x4e523c=_0x200519[_0x54dbcc(0x88)]));_0x41310c[_0x54dbcc(0xc9)]&&(_0x2e2e87=_0x41310c[_0x54dbcc(0xc9)]);if(!_0x2e2e87){const _0x5d7302=loadSessionContext(_0x41310c[_0x54dbcc(0xa2)]);_0x5d7302?.[_0x54dbcc(0xa1)]&&(_0x2e2e87=_0x5d7302['engage_workspace']);}if(!_0x2e2e87)return console['error'](a20_0x9339b8['yellow']('Workspace\x20is\x20required.')),console[_0x54dbcc(0x8a)](_0x54dbcc(0x96)),console[_0x54dbcc(0x8a)](_0x54dbcc(0xbb)),console[_0x54dbcc(0x8a)](_0x54dbcc(0x93)),console[_0x54dbcc(0x8a)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x2c679f;_0x4c8679&&_0x213d66?_0x2c679f=[_0x213d66]:_0x2c679f=discoverCampaignFiles(_0x4e523c);if(_0x2c679f[_0x54dbcc(0xa3)]===0x0)return console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0xbc)](_0x54dbcc(0xbf)+_0x4e523c)),console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0x85)](_0x54dbcc(0xaa))),0x1;const _0x3c916f=_0x2c679f['map'](_0x41cafb=>parseCampaignFile(_0x41cafb,a20_0x2609b1['dirname'](_0x41cafb))),_0x4e9882=_0x3c916f[_0x54dbcc(0xa3)]===0x1?_0x54dbcc(0xa0)+_0x3c916f[0x0][_0x54dbcc(0xcb)]['name']:_0x3c916f['length']+_0x54dbcc(0x8f);console[_0x54dbcc(0x8a)](_0x54dbcc(0xba)+a20_0x9339b8['cyan'](_0x4e9882));let _0xe26b91=![];for(const _0x37903b of _0x3c916f){const _0xeb97da=validateCampaignDef(_0x37903b['def']);if(!_0xeb97da['valid']){_0xe26b91=!![],console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0x89)](_0x54dbcc(0xa5)+_0x37903b[_0x54dbcc(0xb6)]+':'));for(const _0x8be373 of _0xeb97da[_0x54dbcc(0x8d)]){console[_0x54dbcc(0x8a)]('\x20\x20'+a20_0x9339b8[_0x54dbcc(0x89)]('✗')+'\x20'+_0x8be373[_0x54dbcc(0x9d)]+':\x20'+_0x8be373[_0x54dbcc(0x99)]);}}for(const _0x1d72c6 of _0xeb97da[_0x54dbcc(0xa6)]){console[_0x54dbcc(0x8a)]('\x20\x20'+a20_0x9339b8[_0x54dbcc(0xbc)]('⚠')+'\x20'+_0x1d72c6[_0x54dbcc(0x9d)]+':\x20'+_0x1d72c6['message']);}}if(_0xe26b91)return console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0x89)](_0x54dbcc(0x9b))),0x1;const _0x40dba4=await _0x3c7be9[_0x54dbcc(0xa4)][_0x54dbcc(0xc1)](_0x2e2e87),_0x18aaaf=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x2e2e87+_0x54dbcc(0xa7),_0x2f4789=>preparePush({'engage':_0x3c7be9[_0x54dbcc(0xa4)],'segment':_0x3c7be9['segment']},_0x3c916f,_0x40dba4,{'progress':{'update':_0x3d94bc=>_0x2f4789[_0x54dbcc(0xbd)](_0x3d94bc)}}),{'verbose':_0x41310c[_0x54dbcc(0x98)]}),_0x50bd69=_0x18aaaf['data'];await withProgressSpinner(_0x54dbcc(0x92),_0x405a5a=>resolveAndBuildInputs({'engage':_0x3c7be9[_0x54dbcc(0xa4)],'segment':_0x3c7be9[_0x54dbcc(0xb2)]},_0x50bd69,_0x40dba4,{'progress':{'update':_0x16d53a=>_0x405a5a[_0x54dbcc(0xbd)](_0x16d53a)}}),{'verbose':_0x41310c[_0x54dbcc(0x98)]});const _0x4a6e2a=_0x50bd69[_0x54dbcc(0x8e)](_0x31c5ff=>_0x31c5ff[_0x54dbcc(0xc0)]===_0x54dbcc(0xca)),_0x35a289=_0x50bd69[_0x54dbcc(0x8e)](_0xafffc8=>_0xafffc8['action']===_0x54dbcc(0x9a));console[_0x54dbcc(0x8a)](_0x54dbcc(0xc5)+_0x2e2e87+'\x27:');if(_0x4a6e2a['length']>0x0){console[_0x54dbcc(0x8a)]('\x20\x20'+a20_0x9339b8[_0x54dbcc(0xc2)]('+\x20'+_0x4a6e2a[_0x54dbcc(0xa3)]+_0x54dbcc(0x9c)));for(const _0xf961a8 of _0x4a6e2a){console[_0x54dbcc(0x8a)](_0x54dbcc(0xb8)+a20_0x9339b8[_0x54dbcc(0xc2)]('+')+'\x20'+_0xf961a8[_0x54dbcc(0xcb)]['name']+'\x20('+_0xf961a8['def'][_0x54dbcc(0xad)]+')');}}if(_0x35a289[_0x54dbcc(0xa3)]>0x0){console[_0x54dbcc(0x8a)]('\x20\x20'+a20_0x9339b8[_0x54dbcc(0xbc)]('~\x20'+_0x35a289[_0x54dbcc(0xa3)]+_0x54dbcc(0x8b)));for(const _0x4c50c2 of _0x35a289){console[_0x54dbcc(0x8a)]('\x20\x20\x20\x20'+a20_0x9339b8[_0x54dbcc(0xbc)]('~')+'\x20'+_0x4c50c2['def'][_0x54dbcc(0x9e)]+'\x20('+_0x4c50c2[_0x54dbcc(0xcb)][_0x54dbcc(0xad)]+')');}}if(_0x4a6e2a[_0x54dbcc(0xa3)]===0x0&&_0x35a289[_0x54dbcc(0xa3)]===0x0)return console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0xc2)](_0x54dbcc(0x86))),0x0;if(_0x41310c[_0x54dbcc(0x91)])return console['error'](a20_0x9339b8[_0x54dbcc(0xbc)](_0x54dbcc(0xab))),0x0;if(!_0x41310c[_0x54dbcc(0x87)]){if(!isInteractive())return console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0x89)](_0x54dbcc(0xa8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a20_0x9339b8[_0x54dbcc(0x85)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2c910b=await confirmKey('Push\x20'+(_0x4a6e2a[_0x54dbcc(0xa3)]+_0x35a289[_0x54dbcc(0xa3)])+'\x20campaigns?');if(!_0x2c910b)return console['error'](a20_0x9339b8[_0x54dbcc(0xbc)](_0x54dbcc(0xc4)),_0x54dbcc(0x8c)),0x1;}const _0x59c6fc=await withProgressSpinner(_0x54dbcc(0xa9),_0x1e4293=>executePush({'engage':_0x3c7be9[_0x54dbcc(0xa4)],'segment':_0x3c7be9[_0x54dbcc(0xb2)]},_0x50bd69,{'progress':{'update':_0xc241a3=>_0x1e4293['setPhase'](_0xc241a3)}}),{'verbose':_0x41310c[_0x54dbcc(0x98)]}),_0x227260=_0x59c6fc[_0x54dbcc(0x94)];for(const _0x4d123c of _0x227260['results']){if(_0x4d123c[_0x54dbcc(0xac)]&&(_0x4d123c[_0x54dbcc(0xc0)]===_0x54dbcc(0xb9)||_0x4d123c[_0x54dbcc(0xc0)]===_0x54dbcc(0xc8))){const _0x55655c=getCampaignUrl(_0x41310c['site'],_0x40dba4,_0x4d123c[_0x54dbcc(0xac)]),_0x2cf122=_0x4d123c[_0x54dbcc(0xc0)]===_0x54dbcc(0xb9)?'+':'~',_0x2abd6e=_0x4d123c[_0x54dbcc(0xc0)]===_0x54dbcc(0xb9)?a20_0x9339b8['green'](_0x2cf122):a20_0x9339b8['yellow'](_0x2cf122);console['error']('\x20\x20'+_0x2abd6e+'\x20'+hyperlink(_0x4d123c[_0x54dbcc(0x9e)],_0x55655c)+'\x20'+a20_0x9339b8[_0x54dbcc(0x85)](_0x55655c));}}_0x227260[_0x54dbcc(0xb9)]>0x0&&console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0xc2)](_0x54dbcc(0xb3)+_0x227260[_0x54dbcc(0xb9)]+_0x54dbcc(0xc3)));_0x227260['updated']>0x0&&console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0xc2)]('✔\x20Updated\x20'+_0x227260[_0x54dbcc(0xc8)]+'\x20campaigns'));if(_0x227260[_0x54dbcc(0x8d)][_0x54dbcc(0xa3)]>0x0){console[_0x54dbcc(0x8a)](a20_0x9339b8[_0x54dbcc(0x89)]('✘\x20'+_0x227260['errors'][_0x54dbcc(0xa3)]+_0x54dbcc(0xb1)));for(const _0x1d853b of _0x227260[_0x54dbcc(0x8d)]){console['error']('\x20\x20'+a20_0x9339b8[_0x54dbcc(0x89)](_0x1d853b[_0x54dbcc(0x9e)])+':\x20'+_0x1d853b['error']);}}return saveSessionContext({'engage_workspace':_0x2e2e87},_0x41310c[_0x54dbcc(0xa2)]),_0x227260[_0x54dbcc(0x8d)]['length']>0x0?0x1:0x0;}}
1
+ const a20_0x295c7b=a20_0x45d9;(function(_0x107956,_0x56d479){const _0x17785a=a20_0x45d9,_0x443d15=_0x107956();while(!![]){try{const _0x4ded5c=-parseInt(_0x17785a(0xcc))/0x1+-parseInt(_0x17785a(0xd7))/0x2*(parseInt(_0x17785a(0x105))/0x3)+parseInt(_0x17785a(0x103))/0x4*(parseInt(_0x17785a(0x101))/0x5)+parseInt(_0x17785a(0xf3))/0x6+parseInt(_0x17785a(0xf7))/0x7+-parseInt(_0x17785a(0xd9))/0x8+parseInt(_0x17785a(0xfe))/0x9;if(_0x4ded5c===_0x56d479)break;else _0x443d15['push'](_0x443d15['shift']());}catch(_0x438cd6){_0x443d15['push'](_0x443d15['shift']());}}}(a20_0x1192,0xb2eb3));function a20_0x1192(){const _0x455af0=['created','update','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','filter','5542458MPKNyG','1\x20campaign\x20file:\x20','dirname','campaignId','5484521QfebnY','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','Found\x20','config','\x20campaigns','results','setPhase','8831781smusZP','Push\x20','updated','335FlKrNa','cwd','7748HmSbQl','message','102327SSdFNl','-\x20no\x20changes\x20applied','errors','configDir','red','dim','segment','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aPush\x20summary\x20for\x20workspace\x20\x27','Aborted.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','649803bcXxKV','\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)','yellow','description','relativePath','length','\x27...','✔\x20Updated\x20','error','def','Resolving\x20references...','24gcLzYm','engage_workspace','8210976ShmWow','\x20\x20\x20\x20','execute','data','create','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x0aError:','\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','resolveWorkspaceId','yes','map','path','engage','Workspace\x20is\x20required.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\x20campaign\x20files','\x20errors:','verbose','session','action','name','campaign_type'];a20_0x1192=function(){return _0x455af0;};return a20_0x1192();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a20_0x45d9(_0x5ee901,_0x33587b){_0x5ee901=_0x5ee901-0xc8;const _0x1192a2=a20_0x1192();let _0x45d9e6=_0x1192a2[_0x5ee901];return _0x45d9e6;}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 a20_0x4db7e6 from'chalk';import a20_0x2caede 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{['name']='engage:campaign:push';[a20_0x295c7b(0xcf)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns';async[a20_0x295c7b(0xdb)](_0x11467e){const _0x57fa3a=a20_0x295c7b,{options:_0x3b49bd,args:_0x29abb4,tdx:_0x549f31}=_0x11467e,_0x239364=_0x3b49bd,_0x1b3705=_0x29abb4[0x0],_0x4c62dc=_0x1b3705?a20_0x2caede['resolve'](_0x1b3705):undefined,_0x51df5e=_0x4c62dc?isYamlFile(_0x4c62dc):![];let _0x3b8362;if(_0x51df5e&&_0x4c62dc)_0x3b8362=a20_0x2caede[_0x57fa3a(0xf5)](_0x4c62dc);else _0x4c62dc?_0x3b8362=_0x4c62dc:_0x3b8362=process[_0x57fa3a(0x102)]();let _0x25ab7f;const _0x3ed17d=tryFindTdxConfig(_0x3b8362);_0x3ed17d?.['config']['engage_workspace']&&(_0x25ab7f=_0x3ed17d[_0x57fa3a(0xfa)][_0x57fa3a(0xd8)],!_0x51df5e&&(_0x3b8362=_0x3ed17d[_0x57fa3a(0x108)]));_0x239364['workspace']&&(_0x25ab7f=_0x239364['workspace']);if(!_0x25ab7f){const _0x207428=loadSessionContext(_0x239364[_0x57fa3a(0xeb)]);_0x207428?.[_0x57fa3a(0xd8)]&&(_0x25ab7f=_0x207428[_0x57fa3a(0xd8)]);}if(!_0x25ab7f)return console[_0x57fa3a(0xd4)](a20_0x4db7e6['yellow'](_0x57fa3a(0xe6))),console[_0x57fa3a(0xd4)](_0x57fa3a(0xe0)),console[_0x57fa3a(0xd4)](_0x57fa3a(0xcd)),console[_0x57fa3a(0xd4)]('\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['error'](_0x57fa3a(0x10c)),0x1;let _0x41797b;_0x51df5e&&_0x4c62dc?_0x41797b=[_0x4c62dc]:_0x41797b=discoverCampaignFiles(_0x3b8362);if(_0x41797b[_0x57fa3a(0xd1)]===0x0)return console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0xce)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x3b8362)),console[_0x57fa3a(0xd4)](a20_0x4db7e6['dim']('Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.')),0x1;const _0xd5b43f=_0x41797b[_0x57fa3a(0xe3)](_0xa7f4de=>parseCampaignFile(_0xa7f4de,a20_0x2caede[_0x57fa3a(0xf5)](_0xa7f4de))),_0x5d231a=_0xd5b43f[_0x57fa3a(0xd1)]===0x1?_0x57fa3a(0xf4)+_0xd5b43f[0x0]['def']['name']:_0xd5b43f[_0x57fa3a(0xd1)]+_0x57fa3a(0xe8);console[_0x57fa3a(0xd4)](_0x57fa3a(0xf9)+a20_0x4db7e6['cyan'](_0x5d231a));let _0x39bb75=![];for(const _0x183696 of _0xd5b43f){const _0x1bb8ad=validateCampaignDef(_0x183696['def']);if(!_0x1bb8ad['valid']){_0x39bb75=!![],console['error'](a20_0x4db7e6[_0x57fa3a(0x109)]('\x0aValidation\x20errors\x20in\x20'+_0x183696[_0x57fa3a(0xd0)]+':'));for(const _0x2214db of _0x1bb8ad[_0x57fa3a(0x107)]){console[_0x57fa3a(0xd4)]('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0x109)]('✗')+'\x20'+_0x2214db[_0x57fa3a(0xe4)]+':\x20'+_0x2214db[_0x57fa3a(0x104)]);}}for(const _0x180e9c of _0x1bb8ad['warnings']){console['error']('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0xce)]('⚠')+'\x20'+_0x180e9c[_0x57fa3a(0xe4)]+':\x20'+_0x180e9c[_0x57fa3a(0x104)]);}}if(_0x39bb75)return console['error'](a20_0x4db7e6[_0x57fa3a(0x109)](_0x57fa3a(0xde))),0x1;const _0x593e48=await _0x549f31[_0x57fa3a(0xe5)][_0x57fa3a(0xe1)](_0x25ab7f),_0x136653=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x25ab7f+_0x57fa3a(0xd2),_0x12e778=>preparePush({'engage':_0x549f31['engage'],'segment':_0x549f31[_0x57fa3a(0x10b)]},_0xd5b43f,_0x593e48,{'progress':{'update':_0xe16924=>_0x12e778[_0x57fa3a(0xfd)](_0xe16924)}}),{'verbose':_0x239364[_0x57fa3a(0xea)]}),_0x456074=_0x136653[_0x57fa3a(0xdc)];await withProgressSpinner(_0x57fa3a(0xd6),_0x548f4b=>resolveAndBuildInputs({'engage':_0x549f31['engage'],'segment':_0x549f31[_0x57fa3a(0x10b)]},_0x456074,_0x593e48,{'progress':{'update':_0x4b1c5c=>_0x548f4b['setPhase'](_0x4b1c5c)}}),{'verbose':_0x239364[_0x57fa3a(0xea)]});const _0x2afee2=_0x456074[_0x57fa3a(0xf2)](_0x1e620a=>_0x1e620a[_0x57fa3a(0xec)]===_0x57fa3a(0xdd)),_0x2b0341=_0x456074[_0x57fa3a(0xf2)](_0x4bd61d=>_0x4bd61d[_0x57fa3a(0xec)]===_0x57fa3a(0xf0));console['error'](_0x57fa3a(0xc8)+_0x25ab7f+'\x27:');if(_0x2afee2[_0x57fa3a(0xd1)]>0x0){console[_0x57fa3a(0xd4)]('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0xcb)]('+\x20'+_0x2afee2[_0x57fa3a(0xd1)]+'\x20new\x20campaigns:'));for(const _0x2b58a2 of _0x2afee2){console[_0x57fa3a(0xd4)](_0x57fa3a(0xda)+a20_0x4db7e6[_0x57fa3a(0xcb)]('+')+'\x20'+_0x2b58a2[_0x57fa3a(0xd5)][_0x57fa3a(0xed)]+'\x20('+_0x2b58a2['def'][_0x57fa3a(0xee)]+')');}}if(_0x2b0341[_0x57fa3a(0xd1)]>0x0){console[_0x57fa3a(0xd4)]('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0xce)]('~\x20'+_0x2b0341['length']+'\x20campaigns\x20to\x20update:'));for(const _0x5e85a9 of _0x2b0341){console[_0x57fa3a(0xd4)](_0x57fa3a(0xda)+a20_0x4db7e6[_0x57fa3a(0xce)]('~')+'\x20'+_0x5e85a9[_0x57fa3a(0xd5)][_0x57fa3a(0xed)]+'\x20('+_0x5e85a9['def'][_0x57fa3a(0xee)]+')');}}if(_0x2afee2[_0x57fa3a(0xd1)]===0x0&&_0x2b0341[_0x57fa3a(0xd1)]===0x0)return console['error'](a20_0x4db7e6[_0x57fa3a(0xcb)](_0x57fa3a(0xf8))),0x0;if(_0x239364['dryRun'])return console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0xce)](_0x57fa3a(0xe7))),0x0;if(!_0x239364[_0x57fa3a(0xe2)]){if(!isInteractive())return console[_0x57fa3a(0xd4)](a20_0x4db7e6['red'](_0x57fa3a(0xdf)),_0x57fa3a(0xf1)),console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0x10a)](_0x57fa3a(0xca))),0x1;const _0x550238=await confirmKey(_0x57fa3a(0xff)+(_0x2afee2[_0x57fa3a(0xd1)]+_0x2b0341[_0x57fa3a(0xd1)])+'\x20campaigns?');if(!_0x550238)return console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0xce)](_0x57fa3a(0xc9)),_0x57fa3a(0x106)),0x1;}const _0x37d60e=await withProgressSpinner('Pushing\x20campaigns...',_0x429ddf=>executePush({'engage':_0x549f31[_0x57fa3a(0xe5)],'segment':_0x549f31[_0x57fa3a(0x10b)]},_0x456074,{'progress':{'update':_0x3ff3db=>_0x429ddf['setPhase'](_0x3ff3db)}}),{'verbose':_0x239364[_0x57fa3a(0xea)]}),_0x372c83=_0x37d60e[_0x57fa3a(0xdc)];for(const _0x2f469f of _0x372c83[_0x57fa3a(0xfc)]){if(_0x2f469f[_0x57fa3a(0xf6)]&&(_0x2f469f['action']==='created'||_0x2f469f[_0x57fa3a(0xec)]===_0x57fa3a(0x100))){const _0x59375b=getCampaignUrl(_0x239364['site'],_0x593e48,_0x2f469f[_0x57fa3a(0xf6)]),_0x1c8f06=_0x2f469f[_0x57fa3a(0xec)]===_0x57fa3a(0xef)?'+':'~',_0x3e0ac5=_0x2f469f[_0x57fa3a(0xec)]==='created'?a20_0x4db7e6[_0x57fa3a(0xcb)](_0x1c8f06):a20_0x4db7e6[_0x57fa3a(0xce)](_0x1c8f06);console['error']('\x20\x20'+_0x3e0ac5+'\x20'+hyperlink(_0x2f469f[_0x57fa3a(0xed)],_0x59375b)+'\x20'+a20_0x4db7e6[_0x57fa3a(0x10a)](_0x59375b));}}_0x372c83[_0x57fa3a(0xef)]>0x0&&console[_0x57fa3a(0xd4)](a20_0x4db7e6['green']('✔\x20Created\x20'+_0x372c83[_0x57fa3a(0xef)]+_0x57fa3a(0xfb)));_0x372c83[_0x57fa3a(0x100)]>0x0&&console['error'](a20_0x4db7e6[_0x57fa3a(0xcb)](_0x57fa3a(0xd3)+_0x372c83[_0x57fa3a(0x100)]+'\x20campaigns'));if(_0x372c83[_0x57fa3a(0x107)]['length']>0x0){console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0x109)]('✘\x20'+_0x372c83[_0x57fa3a(0x107)]['length']+_0x57fa3a(0xe9)));for(const _0x1ab288 of _0x372c83[_0x57fa3a(0x107)]){console[_0x57fa3a(0xd4)]('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0x109)](_0x1ab288['name'])+':\x20'+_0x1ab288['error']);}}return saveSessionContext({'engage_workspace':_0x25ab7f},_0x239364[_0x57fa3a(0xeb)]),_0x372c83[_0x57fa3a(0x107)]['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a21_0x488469=a21_0x39e6;(function(_0x1f4d30,_0x242a94){const _0x3c8a95=a21_0x39e6,_0x12439d=_0x1f4d30();while(!![]){try{const _0x1f4724=-parseInt(_0x3c8a95(0xc9))/0x1+-parseInt(_0x3c8a95(0xa5))/0x2*(-parseInt(_0x3c8a95(0xb9))/0x3)+-parseInt(_0x3c8a95(0xca))/0x4*(-parseInt(_0x3c8a95(0xc8))/0x5)+-parseInt(_0x3c8a95(0xb7))/0x6*(parseInt(_0x3c8a95(0xb8))/0x7)+parseInt(_0x3c8a95(0xaf))/0x8*(parseInt(_0x3c8a95(0xc2))/0x9)+-parseInt(_0x3c8a95(0xd2))/0xa+parseInt(_0x3c8a95(0xa7))/0xb*(parseInt(_0x3c8a95(0xcd))/0xc);if(_0x1f4724===_0x242a94)break;else _0x12439d['push'](_0x12439d['shift']());}catch(_0x3bf5fd){_0x12439d['push'](_0x12439d['shift']());}}}(a21_0x4bd9,0x41191));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a21_0x39e6(_0x3771e2,_0x14e55b){_0x3771e2=_0x3771e2-0xa5;const _0x4bd9d9=a21_0x4bd9();let _0x39e6ed=_0x4bd9d9[_0x3771e2];return _0x39e6ed;}import a21_0x2a30f6 from'chalk';import a21_0x1a60f0 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a21_0x4bd9(){const _0x1ddf4c=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','name','green','verbose','reason','472470GMYzfN','35alnkPM','66687ocroDS','✔\x20All\x20','Validate\x20campaign\x20YAML\x20files','\x20valid','\x20error(s)','Error:\x20Directory\x20not\x20found:\x20','warningCount','\x20(skipped:\x20','\x20campaign(s)\x20with\x20errors,\x20','1358757wIshOk','description','\x20non-campaign\x20file(s)\x20skipped','invalidCount','length','yellow','120ZvVdEO','186099MIqjGW','73816SExwGw','filter','endsWith','12dcSgrK','validCount','relativePath','log','engage:campaign:validate','3695570RwgaiV','red','\x20warning(s)\x20found','12HDjYkY','skippedCount','5376569fRrcQQ','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','warnings','.yml','valid','Validation\x20failed:\x20','error','dim','8wMdhSV','hasErrors'];a21_0x4bd9=function(){return _0x1ddf4c;};return a21_0x4bd9();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a21_0x488469(0xb3)]=a21_0x488469(0xd1);[a21_0x488469(0xc3)]=a21_0x488469(0xbb);async['execute'](_0x349c66){const _0x536cf0=a21_0x488469,{options:_0x31413a,args:_0xd8c6d3}=_0x349c66,_0x2791ad=_0x31413a,_0x16effe=_0xd8c6d3[0x0],_0x530942=_0x16effe?a21_0x1a60f0['resolve'](_0x16effe):undefined,_0x34cf95=_0x530942?isYamlFile(_0x530942):![];let _0x29e3b5,_0x99269b;if(_0x34cf95&&_0x530942)_0x29e3b5=a21_0x1a60f0['dirname'](_0x530942),_0x99269b=_0x530942;else _0x530942?_0x29e3b5=_0x530942:_0x29e3b5=process['cwd']();if(!_0x99269b&&!existsSync(_0x29e3b5))return console[_0x536cf0(0xad)](a21_0x2a30f6[_0x536cf0(0xd3)](_0x536cf0(0xbe)+_0x29e3b5+'\x0a')),0x1;let _0x1732c1;if(_0x99269b){if(!_0x99269b[_0x536cf0(0xcc)](_0x536cf0(0xaa))&&!_0x99269b[_0x536cf0(0xcc)]('.yaml'))return console['error'](a21_0x2a30f6['red'](_0x536cf0(0xb1)+_0x99269b+'\x0a')),0x1;_0x1732c1=[_0x99269b];}else _0x1732c1=findYamlFiles(_0x29e3b5);if(_0x1732c1[_0x536cf0(0xc6)]===0x0)return console[_0x536cf0(0xad)](a21_0x2a30f6[_0x536cf0(0xd3)](_0x536cf0(0xb2)+_0x29e3b5+'\x0a')),0x1;const _0xfa425a=validateYamlFiles(_0x1732c1,_0x29e3b5,{'filterType':'campaign'}),_0x3c9cfe=calculateSummary(_0xfa425a),_0x51de0a=_0xfa425a[_0x536cf0(0xcb)](isValidationResult);if(_0x51de0a[_0x536cf0(0xc6)]===0x0)return console[_0x536cf0(0xad)](a21_0x2a30f6[_0x536cf0(0xc7)](_0x536cf0(0xa8)+_0x29e3b5+'\x0a')),_0x3c9cfe['skippedCount']>0x0&&console['error'](a21_0x2a30f6[_0x536cf0(0xae)]('('+_0x3c9cfe[_0x536cf0(0xa6)]+'\x20non-campaign\x20file(s)\x20skipped)')),0x0;for(const _0x19f303 of _0xfa425a){if(!isValidationResult(_0x19f303)){_0x2791ad[_0x536cf0(0xb5)]&&console['log'](a21_0x2a30f6[_0x536cf0(0xae)]('-\x20'+_0x19f303[_0x536cf0(0xcf)]+_0x536cf0(0xc0)+_0x19f303[_0x536cf0(0xb6)]+')'));continue;}const {relativePath:_0x13475d,source:_0x5f0617,result:_0x4ef551}=_0x19f303;if(_0x4ef551[_0x536cf0(0xab)]&&_0x4ef551[_0x536cf0(0xa9)]['length']===0x0)_0x2791ad[_0x536cf0(0xb5)]&&console[_0x536cf0(0xd0)](a21_0x2a30f6[_0x536cf0(0xb4)]('✔\x20'+_0x13475d));else _0x4ef551[_0x536cf0(0xab)]?(console[_0x536cf0(0xd0)](a21_0x2a30f6[_0x536cf0(0xc7)]('⚠\x20'+_0x13475d+':\x20'+_0x4ef551['warnings'][_0x536cf0(0xc6)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x4ef551,_0x5f0617,_0x13475d))):(console[_0x536cf0(0xd0)](a21_0x2a30f6[_0x536cf0(0xd3)]('✖\x20'+_0x13475d+':\x20'+_0x4ef551['errors']['length']+_0x536cf0(0xbd))),console['log'](formatValidationResult(_0x4ef551,_0x5f0617,_0x13475d)));}return console['log'](''),_0x3c9cfe[_0x536cf0(0xb0)]?(console[_0x536cf0(0xd0)](a21_0x2a30f6['red'](_0x536cf0(0xac)+_0x3c9cfe[_0x536cf0(0xc5)]+_0x536cf0(0xc1)+_0x3c9cfe['validCount']+_0x536cf0(0xbc))),_0x3c9cfe['warningCount']>0x0&&console['log'](a21_0x2a30f6[_0x536cf0(0xc7)](_0x3c9cfe['warningCount']+_0x536cf0(0xd4))),_0x3c9cfe['skippedCount']>0x0&&console[_0x536cf0(0xd0)](a21_0x2a30f6[_0x536cf0(0xae)](_0x3c9cfe[_0x536cf0(0xa6)]+_0x536cf0(0xc4))),0x1):(console[_0x536cf0(0xd0)](a21_0x2a30f6[_0x536cf0(0xb4)](_0x536cf0(0xba)+_0x3c9cfe[_0x536cf0(0xce)]+'\x20campaign(s)\x20valid')),_0x3c9cfe[_0x536cf0(0xbf)]>0x0&&console[_0x536cf0(0xd0)](a21_0x2a30f6[_0x536cf0(0xc7)](_0x3c9cfe[_0x536cf0(0xbf)]+_0x536cf0(0xd4))),_0x3c9cfe[_0x536cf0(0xa6)]>0x0&&console['log'](a21_0x2a30f6['dim'](_0x3c9cfe[_0x536cf0(0xa6)]+'\x20non-campaign\x20file(s)\x20skipped')),0x0);}}
1
+ const a21_0x41f9f4=a21_0x1850;(function(_0x594d93,_0x4e08a7){const _0x3c14c9=a21_0x1850,_0x26a326=_0x594d93();while(!![]){try{const _0x5e85fb=parseInt(_0x3c14c9(0x184))/0x1*(-parseInt(_0x3c14c9(0x19e))/0x2)+-parseInt(_0x3c14c9(0x191))/0x3*(-parseInt(_0x3c14c9(0x19d))/0x4)+-parseInt(_0x3c14c9(0x1a7))/0x5+parseInt(_0x3c14c9(0x18b))/0x6+-parseInt(_0x3c14c9(0x18f))/0x7+parseInt(_0x3c14c9(0x193))/0x8+-parseInt(_0x3c14c9(0x197))/0x9;if(_0x5e85fb===_0x4e08a7)break;else _0x26a326['push'](_0x26a326['shift']());}catch(_0x54b262){_0x26a326['push'](_0x26a326['shift']());}}}(a21_0x1d93,0xaf18b));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a21_0x1d93(){const _0x4fc62e=['1388216ziknRA','4lZBDGT','endsWith','error','red','\x20(skipped:\x20','\x20campaign(s)\x20valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20non-campaign\x20file(s)\x20skipped','\x20warning(s)\x20found','3829715UDmPtR','campaign','warnings','yellow','name','green','✔\x20All\x20','Validate\x20campaign\x20YAML\x20files','engage:campaign:validate','cwd','423117eElSoV','resolve','length','\x20warning(s)','validCount','\x20error(s)','dim','7560594EYkzOd','skippedCount','warningCount','Validation\x20failed:\x20','1089480jbGnea','invalidCount','6ovGHdB','errors','4646704zYfTFd','description','dirname','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','450297LbQcdY','verbose','filter','log','relativePath','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'];a21_0x1d93=function(){return _0x4fc62e;};return a21_0x1d93();}import a21_0x2eb357 from'chalk';import a21_0xd744cf from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a21_0x1850(_0xf07d3e,_0x3881e8){_0xf07d3e=_0xf07d3e-0x181;const _0x1d93be=a21_0x1d93();let _0x18508e=_0x1d93be[_0xf07d3e];return _0x18508e;}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a21_0x41f9f4(0x1ab)]=a21_0x41f9f4(0x182);[a21_0x41f9f4(0x194)]=a21_0x41f9f4(0x181);async['execute'](_0x10f5b3){const _0x4ca5f1=a21_0x41f9f4,{options:_0xd0ba68,args:_0x10a1f0}=_0x10f5b3,_0x3dd828=_0xd0ba68,_0x467039=_0x10a1f0[0x0],_0x1c501c=_0x467039?a21_0xd744cf[_0x4ca5f1(0x185)](_0x467039):undefined,_0x1abe65=_0x1c501c?isYamlFile(_0x1c501c):![];let _0x507abc,_0x3d7938;if(_0x1abe65&&_0x1c501c)_0x507abc=a21_0xd744cf[_0x4ca5f1(0x195)](_0x1c501c),_0x3d7938=_0x1c501c;else _0x1c501c?_0x507abc=_0x1c501c:_0x507abc=process[_0x4ca5f1(0x183)]();if(!_0x3d7938&&!existsSync(_0x507abc))return console['error'](a21_0x2eb357[_0x4ca5f1(0x1a1)]('Error:\x20Directory\x20not\x20found:\x20'+_0x507abc+'\x0a')),0x1;let _0x23911c;if(_0x3d7938){if(!_0x3d7938[_0x4ca5f1(0x19f)]('.yml')&&!_0x3d7938[_0x4ca5f1(0x19f)]('.yaml'))return console[_0x4ca5f1(0x1a0)](a21_0x2eb357['red'](_0x4ca5f1(0x19c)+_0x3d7938+'\x0a')),0x1;_0x23911c=[_0x3d7938];}else _0x23911c=findYamlFiles(_0x507abc);if(_0x23911c[_0x4ca5f1(0x186)]===0x0)return console[_0x4ca5f1(0x1a0)](a21_0x2eb357[_0x4ca5f1(0x1a1)](_0x4ca5f1(0x1a4)+_0x507abc+'\x0a')),0x1;const _0x4606c1=validateYamlFiles(_0x23911c,_0x507abc,{'filterType':_0x4ca5f1(0x1a8)}),_0x196127=calculateSummary(_0x4606c1),_0x53a412=_0x4606c1[_0x4ca5f1(0x199)](isValidationResult);if(_0x53a412[_0x4ca5f1(0x186)]===0x0)return console[_0x4ca5f1(0x1a0)](a21_0x2eb357[_0x4ca5f1(0x1aa)](_0x4ca5f1(0x196)+_0x507abc+'\x0a')),_0x196127[_0x4ca5f1(0x18c)]>0x0&&console[_0x4ca5f1(0x1a0)](a21_0x2eb357[_0x4ca5f1(0x18a)]('('+_0x196127[_0x4ca5f1(0x18c)]+'\x20non-campaign\x20file(s)\x20skipped)')),0x0;for(const _0xbba14a of _0x4606c1){if(!isValidationResult(_0xbba14a)){_0x3dd828['verbose']&&console['log'](a21_0x2eb357[_0x4ca5f1(0x18a)]('-\x20'+_0xbba14a[_0x4ca5f1(0x19b)]+_0x4ca5f1(0x1a2)+_0xbba14a['reason']+')'));continue;}const {relativePath:_0x358e0d,source:_0x36144f,result:_0x5d201f}=_0xbba14a;if(_0x5d201f['valid']&&_0x5d201f['warnings'][_0x4ca5f1(0x186)]===0x0)_0x3dd828[_0x4ca5f1(0x198)]&&console[_0x4ca5f1(0x19a)](a21_0x2eb357[_0x4ca5f1(0x1ac)]('✔\x20'+_0x358e0d));else _0x5d201f['valid']?(console[_0x4ca5f1(0x19a)](a21_0x2eb357[_0x4ca5f1(0x1aa)]('⚠\x20'+_0x358e0d+':\x20'+_0x5d201f[_0x4ca5f1(0x1a9)][_0x4ca5f1(0x186)]+_0x4ca5f1(0x187))),console[_0x4ca5f1(0x19a)](formatValidationResult(_0x5d201f,_0x36144f,_0x358e0d))):(console['log'](a21_0x2eb357[_0x4ca5f1(0x1a1)]('✖\x20'+_0x358e0d+':\x20'+_0x5d201f[_0x4ca5f1(0x192)][_0x4ca5f1(0x186)]+_0x4ca5f1(0x189))),console[_0x4ca5f1(0x19a)](formatValidationResult(_0x5d201f,_0x36144f,_0x358e0d)));}return console[_0x4ca5f1(0x19a)](''),_0x196127['hasErrors']?(console['log'](a21_0x2eb357[_0x4ca5f1(0x1a1)](_0x4ca5f1(0x18e)+_0x196127[_0x4ca5f1(0x190)]+'\x20campaign(s)\x20with\x20errors,\x20'+_0x196127[_0x4ca5f1(0x188)]+'\x20valid')),_0x196127['warningCount']>0x0&&console[_0x4ca5f1(0x19a)](a21_0x2eb357[_0x4ca5f1(0x1aa)](_0x196127['warningCount']+'\x20warning(s)\x20found')),_0x196127[_0x4ca5f1(0x18c)]>0x0&&console[_0x4ca5f1(0x19a)](a21_0x2eb357[_0x4ca5f1(0x18a)](_0x196127['skippedCount']+_0x4ca5f1(0x1a5))),0x1):(console[_0x4ca5f1(0x19a)](a21_0x2eb357[_0x4ca5f1(0x1ac)](_0x4ca5f1(0x1ad)+_0x196127['validCount']+_0x4ca5f1(0x1a3))),_0x196127[_0x4ca5f1(0x18d)]>0x0&&console['log'](a21_0x2eb357[_0x4ca5f1(0x1aa)](_0x196127[_0x4ca5f1(0x18d)]+_0x4ca5f1(0x1a6))),_0x196127['skippedCount']>0x0&&console[_0x4ca5f1(0x19a)](a21_0x2eb357[_0x4ca5f1(0x18a)](_0x196127[_0x4ca5f1(0x18c)]+_0x4ca5f1(0x1a5))),0x0);}}
@@ -1 +1 @@
1
- const a22_0x592bbd=a22_0x4138;(function(_0x17ea29,_0x521584){const _0x4ef5d1=a22_0x4138,_0x591ba5=_0x17ea29();while(!![]){try{const _0x13978b=parseInt(_0x4ef5d1(0x1f1))/0x1*(-parseInt(_0x4ef5d1(0x1a3))/0x2)+parseInt(_0x4ef5d1(0x1e3))/0x3*(parseInt(_0x4ef5d1(0x208))/0x4)+-parseInt(_0x4ef5d1(0x1b3))/0x5+parseInt(_0x4ef5d1(0x191))/0x6+parseInt(_0x4ef5d1(0x1ba))/0x7+parseInt(_0x4ef5d1(0x15f))/0x8*(-parseInt(_0x4ef5d1(0x162))/0x9)+-parseInt(_0x4ef5d1(0x156))/0xa*(-parseInt(_0x4ef5d1(0x1ee))/0xb);if(_0x13978b===_0x521584)break;else _0x591ba5['push'](_0x591ba5['shift']());}catch(_0x22a74a){_0x591ba5['push'](_0x591ba5['shift']());}}}(a22_0x348d,0x8b6ec));function a22_0x4138(_0x1a69bf,_0x70241f){_0x1a69bf=_0x1a69bf-0x138;const _0x348d82=a22_0x348d();let _0x413895=_0x348d82[_0x1a69bf];return _0x413895;}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';function a22_0x348d(){const _0x365bce=['Campaign\x20\x27','Create\x20an\x20email\x20template','Launch\x20an\x20always-on\x20campaign','listTemplates','engage:campaign:pause','engage:always-on-campaign:show','engage:workspaces','engage:always-on-campaign:update','getCampaign','getCampaignFull','Duplicate\x20an\x20always-on\x20campaign','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','duplicateAlwaysOnCampaign','parentName','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','session','Error:\x20Workspace\x20name\x20is\x20required','ACTIVE','limit','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Show\x20always-on\x20campaign\x20details','engage:campaign:resume','Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>','pauseAlwaysOnCampaign','timezone','listCampaigns','Create\x20a\x20new\x20always-on\x20campaign','\x22.\x20Valid\x20values:\x20','LIVE','createAlwaysOnCampaign','Fetching\x20workspace\x20\x27','listAlwaysOnCampaigns','Pausing\x20campaign\x20\x27','data','Workspace\x20\x27','Show\x20email\x20template\x20details','Show\x20workspace\x20details','htmlFile','\x27\x20resumed\x20successfully','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','jsonColumns','Engage\x20workspace\x20set\x20to:\x20','getTemplate','resolveWorkspaceId','1169616qTbMCl','engage:always-on-campaigns','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','engage:always-on-campaign:create','Update\x20an\x20email\x20template','createWorkspace','Deleting\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','updateTemplate','Update\x20a\x20workspace','Create\x20a\x20new\x20campaign','Creating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Fetching\x20templates...','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>','engage:workspace:update','130cVaQLs','getTemplateFull','toUpperCase','Error:\x20--name\x20is\x20required','PAUSED','Fetching\x20campaigns...','parentId','Set\x20workspace\x20context\x20for\x20Engage\x20commands','audienceName','engage:template:delete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','log','Always-on\x20campaign\x20\x27','dim','audienceId','Verifying\x20workspace\x20\x27','5459730yGrZJf','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>','workspaceId','name','Delete\x20a\x20campaign','28483JTPoHu','\x27\x20deleted\x20successfully','yes','plaintext','Update\x20an\x20always-on\x20campaign','List\x20workspaces','FINISHED','Delete\x20an\x20email\x20template','📝\x20','engage:workspace:use','List\x20campaigns','duplicateCampaign','Deleting\x20template\x20\x27','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Deleting\x20workspace\x20\x27','editorType','length','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','engage:campaigns','COMPLETED','Show\x20campaign\x20details','workspace','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','filter','Duplicate\x20a\x20campaign','map','engage:always-on-campaign:resume','segmentName','launchCampaign','Launch\x20a\x20campaign','Operation\x20cancelled','updateCampaign','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Workspace\x20is\x20required\x20for\x20this\x20operation','entries','engage:campaign:update','join','Resuming\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','Update\x20a\x20campaign','Resuming\x20campaign\x20\x27','73812ZjpGPs','Fetching\x20workspaces...','Fetching\x20template\x20\x27','startAt','Updating\x20template\x20\x27','engage:always-on-campaign:pause','Fetching\x20campaign\x20\x27','engage','📧\x20','engage_workspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','11SyaLNS','Updating\x20campaign\x20\x27','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','6942lsyKet','resolvePathToResource','site','error','toLowerCase','Delete\x20an\x20always-on\x20campaign','listWorkspaces','execute','emailSenderId','engage:always-on-campaign:finish','engage:template:show','engage:campaign:create','Error:\x20--subject\x20is\x20required','Creating\x20workspace\x20\x27','Duplicating\x20always-on\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27','description','Creating\x20always-on\x20campaign\x20\x27','attributes','Updating\x20workspace\x20\x27','Finish\x20an\x20always-on\x20campaign','Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27','subject','80jRVyHS','createCampaign','launchAlwaysOnCampaign','Pause\x20an\x20always-on\x20campaign','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','status','DRAFT','verbose','Finishing\x20always-on\x20campaign\x20\x27','Launching\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','pauseCampaign','\x27\x20launched\x20successfully','engage:campaign:launch','enableUtmTracking','Fetching\x20always-on\x20campaign\x20\x27','List\x20email\x20templates','finishAlwaysOnCampaign','engage:workspace:create','keys','Creating\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','deleteWorkspace','List\x20always-on\x20campaigns','fromEntries','\x27\x20paused\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','full','Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>','Delete\x20a\x20workspace','getAlwaysOnCampaign','\x27...','engage:templates','engage:campaign:duplicate','includes','engage:workspace:delete','Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>','grapesjs','Pause\x20a\x20campaign','22800970zpMPGo','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Updating\x20always-on\x20campaign\x20\x27','deleteTemplate','engage:always-on-campaign:delete','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','\x27?\x20This\x20cannot\x20be\x20undone.','Pausing\x20always-on\x20campaign\x20\x27','html','120LtrVQt','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','type','514134lTYtST','engage:template:create','segment'];a22_0x348d=function(){return _0x365bce;};return a22_0x348d();}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 a22_0x193d84 from'chalk';export async function resolveWorkspaceIdFromOptions(_0x276674,_0x6d3005,_0x5d4b25=![]){const _0x3642b4=a22_0x4138;if(_0x276674['workspace'])return await _0x6d3005[_0x3642b4(0x1ea)][_0x3642b4(0x190)](_0x276674[_0x3642b4(0x1cf)]);const _0x1dd80e=loadSessionContext(_0x276674['session']);if(_0x1dd80e?.[_0x3642b4(0x1ec)])return await _0x6d3005[_0x3642b4(0x1ea)][_0x3642b4(0x190)](_0x1dd80e[_0x3642b4(0x1ec)]);if(_0x5d4b25)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x3642b4(0x1db),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x555652,_0x4e96ea){const _0x712b1=a22_0x4138;if(!_0x555652[_0x712b1(0x164)])return{};const _0x191752=_0x555652['segment'],_0x384006=await _0x4e96ea[_0x712b1(0x164)][_0x712b1(0x1f2)](_0x191752);return{'audienceId':_0x384006[_0x712b1(0x1a9)],'audienceName':_0x384006[_0x712b1(0x172)],..._0x384006['segmentId']&&{'segmentId':_0x384006['segmentId'],'segmentName':_0x384006[_0x712b1(0x1d5)]}};}function buildConnectorConfig(_0x4c9b6e){const _0xd6b8c3=a22_0x4138,_0x419615=_0x4c9b6e[_0xd6b8c3(0x1f9)],_0x41d8c9=_0x4c9b6e[_0xd6b8c3(0x18d)];if(!_0x419615&&!_0x41d8c9)return undefined;return{..._0x419615&&{'emailSenderId':_0x419615},..._0x41d8c9&&{'jsonColumns':_0x41d8c9}};}export class EngageCampaignsCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x1cc);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x1c4);async['execute'](_0x4aa187){const _0x5eb524=a22_0x592bbd,{options:_0xa96fcc,args:_0x3d1851,tdx:_0x3a436b}=_0x4aa187,_0x2b2d43=_0x3d1851[0x0],_0x178a0d=resolveLimit(_0xa96fcc[_0x5eb524(0x177)],DEFAULT_LLM_LIMIT),_0x22c0dd=_0xa96fcc,_0x4ad325=_0x22c0dd[_0x5eb524(0x161)],_0x36f626=[_0x5eb524(0x20e),_0x5eb524(0x176),_0x5eb524(0x1a7),_0x5eb524(0x1cd)],_0x3846c2=_0x22c0dd[_0x5eb524(0x20d)],_0x5ca190=_0x3846c2?.[_0x5eb524(0x1a5)]();if(_0x5ca190&&!_0x36f626[_0x5eb524(0x151)](_0x5ca190))return console[_0x5eb524(0x1f4)]('Error:\x20Invalid\x20status\x20\x22'+_0x3846c2+_0x5eb524(0x180)+_0x36f626[_0x5eb524(0x1de)](',\x20')),0x1;const _0xadc38=await resolveWorkspaceIdFromOptions(_0x22c0dd,_0x3a436b),_0x2f085a=await withSpinner(_0x5eb524(0x1a8),()=>_0x3a436b[_0x5eb524(0x1ea)][_0x5eb524(0x17e)]({'type':_0x4ad325,'status':_0x5ca190,'workspaceId':_0xadc38,'limit':_0x178a0d}),{'verbose':_0xa96fcc['verbose']});let _0x2fc941=_0x2f085a['data'];_0x5ca190&&(_0x2fc941=_0x2fc941[_0x5eb524(0x1d1)](_0x39f021=>_0x39f021[_0x5eb524(0x20d)][_0x5eb524(0x1a5)]()===_0x5ca190));_0x2b2d43&&(_0x2fc941=_0x2fc941['filter'](_0x50dcb8=>matchGlobPattern(_0x50dcb8[_0x5eb524(0x1b8)],_0x2b2d43)));const _0x284c55=_0xa96fcc[_0x5eb524(0x1f3)];if(isStructuredFormat(_0xa96fcc)){const _0x13a2a1=_0x2fc941[_0x5eb524(0x1d3)](_0x2c840e=>({..._0x2c840e,'url':_0x2c840e[_0x5eb524(0x1b7)]?getCampaignUrl(_0x284c55,_0x2c840e[_0x5eb524(0x1b7)],_0x2c840e['id']):undefined}));await handleSDKOutput(_0x13a2a1,_0xa96fcc);}else for(const _0x5ae877 of _0x2fc941){const _0x3c130e=a22_0x193d84[_0x5eb524(0x1b0)]('\x20('+_0x5ae877[_0x5eb524(0x20d)][_0x5eb524(0x1f5)]()+')'),_0x4670da=_0x5ae877[_0x5eb524(0x1b7)]?getCampaignUrl(_0x284c55,_0x5ae877['workspaceId'],_0x5ae877['id']):undefined,_0x5cd724=_0x4670da?hyperlink(_0x5ae877[_0x5eb524(0x1b8)],_0x4670da):_0x5ae877['name'];console[_0x5eb524(0x1ae)](_0x5eb524(0x1eb)+_0x5cd724+_0x3c130e);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]='engage:campaign:show';['description']=a22_0x592bbd(0x1ce);async[a22_0x592bbd(0x1f8)](_0x199477){const _0x104d71=a22_0x592bbd,{options:_0x7dad11,args:_0x50345e,tdx:_0x14867a}=_0x199477;if(_0x50345e[_0x104d71(0x1ca)]===0x0)return console[_0x104d71(0x1f4)](_0x104d71(0x178)),console['error'](_0x104d71(0x198)),0x1;const _0x46b1fc=_0x50345e[0x0],_0x36dbc9=_0x7dad11,_0x44543f=await resolveWorkspaceIdFromOptions(_0x36dbc9,_0x14867a),_0xc7a1fd=_0x36dbc9[_0x104d71(0x14a)],_0x14f6e8=_0x7dad11[_0x104d71(0x1f3)];if(_0xc7a1fd){const _0xfbac96=await withSpinner(_0x104d71(0x1e9)+_0x46b1fc+_0x104d71(0x14e),()=>_0x14867a[_0x104d71(0x1ea)][_0x104d71(0x16e)](_0x46b1fc,_0x44543f),{'verbose':_0x7dad11[_0x104d71(0x20f)]}),_0x174c13=_0xfbac96[_0x104d71(0x186)],_0x1cf62f=_0x174c13[_0x104d71(0x203)][_0x104d71(0x1b7)]?getCampaignUrl(_0x14f6e8,_0x174c13['attributes'][_0x104d71(0x1b7)],_0x174c13['id']):undefined;await handleSDKOutput([{..._0x174c13,..._0x1cf62f&&{'url':_0x1cf62f}}],_0x7dad11);}else{const _0xfdebb6=await withSpinner(_0x104d71(0x1e9)+_0x46b1fc+_0x104d71(0x14e),()=>_0x14867a[_0x104d71(0x1ea)][_0x104d71(0x16d)](_0x46b1fc,_0x44543f),{'verbose':_0x7dad11[_0x104d71(0x20f)]}),_0xd7c9ad=_0xfdebb6[_0x104d71(0x186)],_0x2427ac=_0xd7c9ad[_0x104d71(0x1b7)]?getCampaignUrl(_0x14f6e8,_0xd7c9ad[_0x104d71(0x1b7)],_0xd7c9ad['id']):undefined;await handleSingleObjectOutput({..._0xd7c9ad,..._0x2427ac&&{'url':_0x2427ac}},_0x7dad11);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x1fc);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x19b);async[a22_0x592bbd(0x1f8)](_0x8c1e28){const _0x349af9=a22_0x592bbd,{options:_0x492b44,tdx:_0x55b4ac}=_0x8c1e28,_0x1994a9=_0x492b44,_0x319862=_0x1994a9['name'],_0x5d48b2=_0x1994a9[_0x349af9(0x161)];if(!_0x319862)return console['error']('Error:\x20--name\x20is\x20required'),console[_0x349af9(0x1f4)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x5d48b2)return console['error'](_0x349af9(0x1c7)),console[_0x349af9(0x1f4)](_0x349af9(0x157)),0x1;const _0x367de6=await resolveWorkspaceIdFromOptions(_0x1994a9,_0x55b4ac,!![]),_0x1fb383=await resolveSegmentFromOptions(_0x1994a9,_0x55b4ac),_0x59d5ff=buildConnectorConfig(_0x1994a9),_0x5e965c={'name':_0x319862,'campaignType':_0x5d48b2,'workspaceId':_0x367de6,'description':_0x1994a9[_0x349af9(0x201)],..._0x1fb383,'connectorConfig':_0x59d5ff,'startAt':_0x1994a9[_0x349af9(0x1e6)],'timezone':_0x1994a9[_0x349af9(0x17d)]},_0x4fd833=await withSpinner(_0x349af9(0x143)+_0x319862+_0x349af9(0x14e),()=>_0x55b4ac[_0x349af9(0x1ea)][_0x349af9(0x209)](_0x5e965c));return await handleSDKOutput([_0x4fd833[_0x349af9(0x186)]],_0x492b44),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a22_0x592bbd(0x1dd);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x1e1);async[a22_0x592bbd(0x1f8)](_0x52df6e){const _0x5494bb=a22_0x592bbd,{options:_0x53c350,args:_0x122a9d,tdx:_0x2a4352}=_0x52df6e;if(_0x122a9d['length']===0x0)return console[_0x5494bb(0x1f4)](_0x5494bb(0x178)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x122d13=_0x122a9d[0x0],_0x5695a1=_0x53c350,_0x17b032=await resolveWorkspaceIdFromOptions(_0x5695a1,_0x2a4352),_0x5c896b=await resolveSegmentFromOptions(_0x5695a1,_0x2a4352),_0x42c0a3=buildConnectorConfig(_0x5695a1),_0x3bacc7={'name':_0x5695a1[_0x5494bb(0x1b8)],'description':_0x5695a1[_0x5494bb(0x201)],..._0x5c896b,'connectorConfig':_0x42c0a3,'startAt':_0x5695a1[_0x5494bb(0x1e6)],'timezone':_0x5695a1[_0x5494bb(0x17d)]},_0xa41e9f=Object[_0x5494bb(0x147)](Object[_0x5494bb(0x1dc)](_0x3bacc7)['filter'](([,_0x3bfce7])=>_0x3bfce7!==undefined));if(Object['keys'](_0xa41e9f)[_0x5494bb(0x1ca)]===0x0)return console[_0x5494bb(0x1f4)](_0x5494bb(0x1f0)),console[_0x5494bb(0x1f4)](_0x5494bb(0x1da)),0x1;const _0xa56bd2=await withSpinner(_0x5494bb(0x1ef)+_0x122d13+'\x27...',()=>_0x2a4352[_0x5494bb(0x1ea)][_0x5494bb(0x1d9)](_0x122d13,_0xa41e9f,_0x17b032),{'verbose':_0x53c350[_0x5494bb(0x20f)]});return await handleSDKOutput([_0xa56bd2['data']],_0x53c350),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]='engage:campaign:delete';[a22_0x592bbd(0x201)]=a22_0x592bbd(0x1b9);async[a22_0x592bbd(0x1f8)](_0x15ece6){const _0x5c80eb=a22_0x592bbd,{options:_0x1b0c1c,args:_0x506aaa,tdx:_0x3e0ab8}=_0x15ece6;if(_0x506aaa[_0x5c80eb(0x1ca)]===0x0)return console[_0x5c80eb(0x1f4)](_0x5c80eb(0x178)),console[_0x5c80eb(0x1f4)](_0x5c80eb(0x149)),0x1;const _0x106caf=_0x506aaa[0x0],_0x413c60=_0x1b0c1c,_0x1ff42d=await resolveWorkspaceIdFromOptions(_0x413c60,_0x3e0ab8);if(!_0x1b0c1c['yes']){const _0x1e3c7f=await confirm(_0x5c80eb(0x1ad)+_0x106caf+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x1e3c7f)return console[_0x5c80eb(0x1ae)](_0x5c80eb(0x1d8)),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x106caf+_0x5c80eb(0x14e),()=>_0x3e0ab8[_0x5c80eb(0x1ea)]['deleteCampaign'](_0x106caf,_0x1ff42d),{'verbose':_0x1b0c1c[_0x5c80eb(0x20f)]}),console['log'](_0x5c80eb(0x165)+_0x106caf+_0x5c80eb(0x1bb)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x13c);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x1d7);async['execute'](_0x37ea04){const _0x2ec9d2=a22_0x592bbd,{options:_0x3efa0b,args:_0x2d211b,tdx:_0x203878}=_0x37ea04;if(_0x2d211b[_0x2ec9d2(0x1ca)]===0x0)return console[_0x2ec9d2(0x1f4)](_0x2ec9d2(0x178)),console[_0x2ec9d2(0x1f4)](_0x2ec9d2(0x138)),0x1;const _0x47a200=_0x2d211b[0x0],_0x5281d6=_0x3efa0b,_0x43c5fc=await resolveWorkspaceIdFromOptions(_0x5281d6,_0x203878);return await withSpinner(_0x2ec9d2(0x211)+_0x47a200+_0x2ec9d2(0x14e),()=>_0x203878[_0x2ec9d2(0x1ea)][_0x2ec9d2(0x1d6)](_0x47a200,_0x43c5fc),{'verbose':_0x3efa0b['verbose']}),console[_0x2ec9d2(0x1ae)](_0x2ec9d2(0x165)+_0x47a200+_0x2ec9d2(0x13b)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x169);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x155);async[a22_0x592bbd(0x1f8)](_0x28a695){const _0x276868=a22_0x592bbd,{options:_0x27d145,args:_0x239703,tdx:_0x8376ff}=_0x28a695;if(_0x239703[_0x276868(0x1ca)]===0x0)return console[_0x276868(0x1f4)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x276868(0x1f4)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x27e871=_0x239703[0x0],_0x4ab9d2=_0x27d145,_0xbc2632=await resolveWorkspaceIdFromOptions(_0x4ab9d2,_0x8376ff);return await withSpinner(_0x276868(0x185)+_0x27e871+_0x276868(0x14e),()=>_0x8376ff['engage'][_0x276868(0x13a)](_0x27e871,_0xbc2632),{'verbose':_0x27d145[_0x276868(0x20f)]}),console[_0x276868(0x1ae)](_0x276868(0x165)+_0x27e871+_0x276868(0x148)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a22_0x592bbd(0x17a);[a22_0x592bbd(0x201)]='Resume\x20a\x20paused\x20campaign';async[a22_0x592bbd(0x1f8)](_0x3357a4){const _0x4e4c65=a22_0x592bbd,{options:_0x39463c,args:_0x4584f7,tdx:_0x4f2094}=_0x3357a4;if(_0x4584f7['length']===0x0)return console['error'](_0x4e4c65(0x178)),console[_0x4e4c65(0x1f4)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x4b4933=_0x4584f7[0x0],_0x48bfe7=_0x39463c,_0x50b4bb=await resolveWorkspaceIdFromOptions(_0x48bfe7,_0x4f2094);return await withSpinner(_0x4e4c65(0x1e2)+_0x4b4933+_0x4e4c65(0x14e),()=>_0x4f2094[_0x4e4c65(0x1ea)]['resumeCampaign'](_0x4b4933,_0x50b4bb),{'verbose':_0x39463c[_0x4e4c65(0x20f)]}),console[_0x4e4c65(0x1ae)](_0x4e4c65(0x165)+_0x4b4933+_0x4e4c65(0x18b)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a22_0x592bbd(0x150);['description']=a22_0x592bbd(0x1d2);async[a22_0x592bbd(0x1f8)](_0x2839c9){const _0x311e08=a22_0x592bbd,{options:_0x2b3519,args:_0x415a6e,tdx:_0x2185e6}=_0x2839c9;if(_0x415a6e[_0x311e08(0x1ca)]===0x0)return console[_0x311e08(0x1f4)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x311e08(0x19d)),0x1;const _0x1d9794=_0x415a6e[0x0],_0x168a5b=_0x2b3519,_0x2ede9a=await resolveWorkspaceIdFromOptions(_0x168a5b,_0x2185e6),_0x3ff123=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x1d9794+_0x311e08(0x14e),()=>_0x2185e6[_0x311e08(0x1ea)][_0x311e08(0x1c5)](_0x1d9794,_0x2ede9a),{'verbose':_0x2b3519[_0x311e08(0x20f)]});return await handleSDKOutput([_0x3ff123[_0x311e08(0x186)]],_0x2b3519),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x14f);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x13f);async[a22_0x592bbd(0x1f8)](_0x19df22){const _0x8d7c5e=a22_0x592bbd,{options:_0xae1db8,args:_0x71d95d,tdx:_0x5ea06f}=_0x19df22,_0x42ac07=_0x71d95d[0x0],_0x4747ce=resolveLimit(_0xae1db8[_0x8d7c5e(0x177)],DEFAULT_LLM_LIMIT),_0x19a797=_0xae1db8,_0x5b9748=await resolveWorkspaceIdFromOptions(_0x19a797,_0x5ea06f),_0x34a81c=await withSpinner(_0x8d7c5e(0x19e),()=>_0x5ea06f[_0x8d7c5e(0x1ea)][_0x8d7c5e(0x168)]({'workspaceId':_0x5b9748,'limit':_0x4747ce}),{'verbose':_0xae1db8[_0x8d7c5e(0x20f)]});let _0x37b4e9=_0x34a81c[_0x8d7c5e(0x186)];_0x42ac07&&(_0x37b4e9=_0x34a81c['data'][_0x8d7c5e(0x1d1)](_0xd68076=>matchGlobPattern(_0xd68076[_0x8d7c5e(0x1b8)],_0x42ac07)));const _0x40a370=_0xae1db8[_0x8d7c5e(0x1f3)];if(isStructuredFormat(_0xae1db8))await handleSDKOutput(_0x37b4e9,_0xae1db8);else for(const _0x40a803 of _0x37b4e9){const _0x222e60=_0x40a803[_0x8d7c5e(0x1b7)]?getTemplateUrl(_0x40a370,_0x40a803['workspaceId'],_0x40a803['id']):undefined,_0x6356b=_0x222e60?hyperlink(_0x40a803[_0x8d7c5e(0x1b8)],_0x222e60):_0x40a803[_0x8d7c5e(0x1b8)];console[_0x8d7c5e(0x1ae)](_0x8d7c5e(0x1c2)+_0x6356b);}return 0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a22_0x592bbd(0x1fb);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x188);async[a22_0x592bbd(0x1f8)](_0x22c6ef){const _0x1a5c28=a22_0x592bbd,{options:_0x224032,args:_0x2089be,tdx:_0x5559d5}=_0x22c6ef;if(_0x2089be[_0x1a5c28(0x1ca)]===0x0)return console[_0x1a5c28(0x1f4)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x1a5c28(0x1f4)](_0x1a5c28(0x20c)),0x1;const _0x2a1d69=_0x2089be[0x0],_0x22b5c3=_0x224032,_0x275a95=await resolveWorkspaceIdFromOptions(_0x22b5c3,_0x5559d5),_0x5a5485=_0x22b5c3['full'];if(_0x5a5485){const _0x2ffee6=await withSpinner('Fetching\x20template\x20\x27'+_0x2a1d69+_0x1a5c28(0x14e),()=>_0x5559d5[_0x1a5c28(0x1ea)][_0x1a5c28(0x1a4)](_0x2a1d69,_0x275a95),{'verbose':_0x224032[_0x1a5c28(0x20f)]});await handleSDKOutput([_0x2ffee6],_0x224032);}else{const _0x14885a=await withSpinner(_0x1a5c28(0x1e5)+_0x2a1d69+_0x1a5c28(0x14e),()=>_0x5559d5['engage'][_0x1a5c28(0x18f)](_0x2a1d69,_0x275a95),{'verbose':_0x224032[_0x1a5c28(0x20f)]});await handleSDKOutput([_0x14885a],_0x224032);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']=a22_0x592bbd(0x163);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x166);async[a22_0x592bbd(0x1f8)](_0x48e96d){const _0x256fbc=a22_0x592bbd,{options:_0x3e9301,tdx:_0x1207fd}=_0x48e96d,_0x6196d5=_0x3e9301,_0x5f1a4f=_0x6196d5['name'],_0x42a907=_0x6196d5[_0x256fbc(0x207)],_0x4e1cae=_0x6196d5[_0x256fbc(0x15e)],_0x185d8d=_0x6196d5[_0x256fbc(0x18a)];if(!_0x5f1a4f)return console[_0x256fbc(0x1f4)]('Error:\x20--name\x20is\x20required'),console[_0x256fbc(0x1f4)](_0x256fbc(0x1b4)),0x1;if(!_0x42a907)return console[_0x256fbc(0x1f4)](_0x256fbc(0x1fd)),0x1;if(_0x4e1cae&&_0x185d8d)return console[_0x256fbc(0x1f4)](_0x256fbc(0x15b)),0x1;const _0xfd19f=_0x185d8d?readFileContent(_0x185d8d):_0x4e1cae;if(!_0xfd19f)return console['error']('Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required'),0x1;const _0x3f733d=await resolveWorkspaceIdFromOptions(_0x6196d5,_0x1207fd,!![]),_0x6ced3d={'name':_0x5f1a4f,'subjectTemplate':_0x42a907,'htmlTemplate':_0xfd19f,'workspaceId':_0x3f733d,'plaintextTemplate':_0x6196d5[_0x256fbc(0x1bd)],'editorType':_0x6196d5[_0x256fbc(0x1c9)]??_0x256fbc(0x154)},_0x5e282a=await withSpinner(_0x256fbc(0x19c)+_0x5f1a4f+_0x256fbc(0x14e),()=>_0x1207fd[_0x256fbc(0x1ea)]['createTemplate'](_0x6ced3d));return await handleSDKOutput([_0x5e282a[_0x256fbc(0x186)]],_0x3e9301),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]='engage:template:update';[a22_0x592bbd(0x201)]=a22_0x592bbd(0x195);async[a22_0x592bbd(0x1f8)](_0x10ece6){const _0x5111d4=a22_0x592bbd,{options:_0x2f3b5b,args:_0x379ca1,tdx:_0x1956e8}=_0x10ece6;if(_0x379ca1[_0x5111d4(0x1ca)]===0x0)return console[_0x5111d4(0x1f4)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x7ea2d6=_0x379ca1[0x0],_0x292cbb=_0x2f3b5b,_0x5ed03e=_0x292cbb[_0x5111d4(0x15e)],_0x239085=_0x292cbb['htmlFile'];if(_0x5ed03e&&_0x239085)return console[_0x5111d4(0x1f4)](_0x5111d4(0x15b)),0x1;const _0x59ebb7=_0x239085?readFileContent(_0x239085):_0x5ed03e,_0x58892e=await resolveWorkspaceIdFromOptions(_0x292cbb,_0x1956e8),_0xe34a22={'name':_0x292cbb[_0x5111d4(0x1b8)],'subjectTemplate':_0x292cbb[_0x5111d4(0x207)],'htmlTemplate':_0x59ebb7,'plaintextTemplate':_0x292cbb['plaintext']},_0x37f0cb=Object[_0x5111d4(0x147)](Object[_0x5111d4(0x1dc)](_0xe34a22)[_0x5111d4(0x1d1)](([,_0x580ea5])=>_0x580ea5!==undefined));if(Object['keys'](_0x37f0cb)[_0x5111d4(0x1ca)]===0x0)return console[_0x5111d4(0x1f4)](_0x5111d4(0x1f0)),console[_0x5111d4(0x1f4)](_0x5111d4(0x1cb)),0x1;const _0x2e4e1e=await withSpinner(_0x5111d4(0x1e7)+_0x7ea2d6+_0x5111d4(0x14e),()=>_0x1956e8[_0x5111d4(0x1ea)][_0x5111d4(0x199)](_0x7ea2d6,_0x37f0cb,_0x58892e),{'verbose':_0x2f3b5b[_0x5111d4(0x20f)]});return await handleSDKOutput([_0x2e4e1e[_0x5111d4(0x186)]],_0x2f3b5b),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x1ac);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x1c1);async[a22_0x592bbd(0x1f8)](_0x4f5b88){const _0x579752=a22_0x592bbd,{options:_0x3c476a,args:_0x264af1,tdx:_0x3ba348}=_0x4f5b88;if(_0x264af1[_0x579752(0x1ca)]===0x0)return console[_0x579752(0x1f4)](_0x579752(0x173)),console[_0x579752(0x1f4)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0xb897a9=_0x264af1[0x0],_0x28a632=_0x3c476a,_0x36fbfa=await resolveWorkspaceIdFromOptions(_0x28a632,_0x3ba348);if(!_0x3c476a[_0x579752(0x1bc)]){const _0x5c4886=await confirm(_0x579752(0x1ed)+_0xb897a9+_0x579752(0x15c));if(!_0x5c4886)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner(_0x579752(0x1c6)+_0xb897a9+_0x579752(0x14e),()=>_0x3ba348['engage'][_0x579752(0x159)](_0xb897a9,_0x36fbfa),{'verbose':_0x3c476a['verbose']}),console[_0x579752(0x1ae)]('Template\x20\x27'+_0xb897a9+_0x579752(0x1bb)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x16b);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x1bf);async[a22_0x592bbd(0x1f8)](_0x14e553){const _0x1481a0=a22_0x592bbd,{options:_0x15482a,args:_0x368a71,tdx:_0x4ac49c}=_0x14e553,_0x3e4701=_0x368a71[0x0],_0x1fa5df=resolveLimit(_0x15482a['limit'],DEFAULT_LLM_LIMIT),_0x37c8d7=await withSpinner(_0x1481a0(0x1e4),()=>_0x4ac49c['engage'][_0x1481a0(0x1f7)]({'limit':_0x1fa5df}),{'verbose':_0x15482a[_0x1481a0(0x20f)]});let _0x3f4318=_0x37c8d7[_0x1481a0(0x186)];_0x3e4701&&(_0x3f4318=_0x37c8d7[_0x1481a0(0x186)]['filter'](_0x2fd956=>matchGlobPattern(_0x2fd956[_0x1481a0(0x1b8)],_0x3e4701)));const _0x40299f=_0x15482a['site'];if(isStructuredFormat(_0x15482a))await handleSDKOutput(_0x3f4318,_0x15482a);else for(const _0x2ed241 of _0x3f4318){const _0x3cdf2d=getWorkspaceUrl(_0x40299f,_0x2ed241['id']),_0x18fb54=hyperlink(_0x2ed241[_0x1481a0(0x1b8)],_0x3cdf2d);console[_0x1481a0(0x1ae)]('🏢\x20'+_0x18fb54);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]='engage:workspace:show';[a22_0x592bbd(0x201)]=a22_0x592bbd(0x189);async[a22_0x592bbd(0x1f8)](_0x1af4ee){const _0x1f5682=a22_0x592bbd,{options:_0x511c21,args:_0xe61b4d,tdx:_0x5c6da2}=_0x1af4ee;if(_0xe61b4d[_0x1f5682(0x1ca)]===0x0)return console[_0x1f5682(0x1f4)](_0x1f5682(0x170)),console[_0x1f5682(0x1f4)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x49df82=_0xe61b4d[0x0],_0x334a07=_0x511c21,_0x58715b=_0x334a07[_0x1f5682(0x14a)];if(_0x58715b){const _0x29fbed=await withSpinner('Fetching\x20workspace\x20\x27'+_0x49df82+'\x27...',()=>_0x5c6da2[_0x1f5682(0x1ea)]['getWorkspaceFull'](_0x49df82),{'verbose':_0x511c21[_0x1f5682(0x20f)]});await handleSDKOutput([_0x29fbed],_0x511c21);}else{const _0xed92f7=await withSpinner(_0x1f5682(0x183)+_0x49df82+_0x1f5682(0x14e),()=>_0x5c6da2[_0x1f5682(0x1ea)]['getWorkspace'](_0x49df82),{'verbose':_0x511c21[_0x1f5682(0x20f)]});await handleSDKOutput([_0xed92f7],_0x511c21);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a22_0x592bbd(0x141);[a22_0x592bbd(0x201)]='Create\x20a\x20workspace';async['execute'](_0x46427a){const _0x4d7fa7=a22_0x592bbd,{options:_0x2cc04a,tdx:_0x2948d9}=_0x46427a,_0x459bde=_0x2cc04a,_0x43ea56=_0x459bde[_0x4d7fa7(0x1b8)];if(!_0x43ea56)return console[_0x4d7fa7(0x1f4)]('Error:\x20--name\x20is\x20required'),console[_0x4d7fa7(0x1f4)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x42132a={'name':_0x43ea56,'description':_0x459bde[_0x4d7fa7(0x201)]},_0xedadb7=await withSpinner(_0x4d7fa7(0x1fe)+_0x43ea56+_0x4d7fa7(0x14e),()=>_0x2948d9[_0x4d7fa7(0x1ea)][_0x4d7fa7(0x196)](_0x42132a));return await handleSDKOutput([_0xedadb7[_0x4d7fa7(0x186)]],_0x2cc04a),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x1a2);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x19a);async[a22_0x592bbd(0x1f8)](_0x461350){const _0x479231=a22_0x592bbd,{options:_0x37b064,args:_0x28d9b0,tdx:_0x7889eb}=_0x461350;if(_0x28d9b0[_0x479231(0x1ca)]===0x0)return console[_0x479231(0x1f4)](_0x479231(0x170)),console[_0x479231(0x1f4)](_0x479231(0x1d0)),0x1;const _0x87981c=_0x28d9b0[0x0],_0x440e28=_0x37b064,_0x2eef4c={'name':_0x440e28['name'],'description':_0x440e28['description']},_0x3d0224=Object['fromEntries'](Object[_0x479231(0x1dc)](_0x2eef4c)['filter'](([,_0x4f296e])=>_0x4f296e!==undefined));if(Object[_0x479231(0x142)](_0x3d0224)[_0x479231(0x1ca)]===0x0)return console[_0x479231(0x1f4)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error']('Options:\x20--name,\x20--description'),0x1;const _0x276a80=await withSpinner(_0x479231(0x204)+_0x87981c+_0x479231(0x14e),()=>_0x7889eb[_0x479231(0x1ea)]['updateWorkspace'](_0x87981c,_0x3d0224),{'verbose':_0x37b064[_0x479231(0x20f)]});return await handleSDKOutput([_0x276a80[_0x479231(0x186)]],_0x37b064),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a22_0x592bbd(0x152);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x14c);async['execute'](_0x22958b){const _0x5c76bb=a22_0x592bbd,{options:_0x452d21,args:_0x54ac58,tdx:_0x3f2961}=_0x22958b;if(_0x54ac58[_0x5c76bb(0x1ca)]===0x0)return console[_0x5c76bb(0x1f4)](_0x5c76bb(0x170)),console[_0x5c76bb(0x1f4)](_0x5c76bb(0x144)),0x1;const _0xdb269=_0x54ac58[0x0];if(!_0x452d21[_0x5c76bb(0x1bc)]){const _0x299729=await confirm(_0x5c76bb(0x139)+_0xdb269+_0x5c76bb(0x15c));if(!_0x299729)return console[_0x5c76bb(0x1ae)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x5c76bb(0x1c8)+_0xdb269+_0x5c76bb(0x14e),()=>_0x3f2961[_0x5c76bb(0x1ea)][_0x5c76bb(0x145)](_0xdb269),{'verbose':_0x452d21[_0x5c76bb(0x20f)]}),console[_0x5c76bb(0x1ae)](_0x5c76bb(0x187)+_0xdb269+_0x5c76bb(0x1bb)),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x192);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x146);async[a22_0x592bbd(0x1f8)](_0x22b6bb){const _0x46446c=a22_0x592bbd,{options:_0x2b5623,args:_0xc66240,tdx:_0x479359}=_0x22b6bb,_0x450277=_0xc66240[0x0],_0x3b9c03=resolveLimit(_0x2b5623[_0x46446c(0x177)],DEFAULT_LLM_LIMIT),_0x3ec8f9=_0x2b5623,_0x55e5f5=_0x3ec8f9[_0x46446c(0x161)],_0x116419=[_0x46446c(0x20e),_0x46446c(0x181),_0x46446c(0x1a7),_0x46446c(0x1c0)],_0x1359fe=_0x3ec8f9[_0x46446c(0x20d)],_0x549d12=_0x1359fe?.[_0x46446c(0x1a5)]();if(_0x549d12&&!_0x116419[_0x46446c(0x151)](_0x549d12))return console[_0x46446c(0x1f4)]('Error:\x20Invalid\x20status\x20\x22'+_0x1359fe+_0x46446c(0x180)+_0x116419[_0x46446c(0x1de)](',\x20')),0x1;const _0x573b98=await resolveWorkspaceIdFromOptions(_0x3ec8f9,_0x479359,!![]),_0x5647d6=await withSpinner('Fetching\x20always-on\x20campaigns...',()=>_0x479359[_0x46446c(0x1ea)][_0x46446c(0x184)]({'workspaceId':_0x573b98,'type':_0x55e5f5,'status':_0x549d12,'limit':_0x3b9c03}),{'verbose':_0x2b5623[_0x46446c(0x20f)]});let _0x5c20c2=_0x5647d6[_0x46446c(0x186)];_0x549d12&&(_0x5c20c2=_0x5c20c2['filter'](_0x18256e=>_0x18256e[_0x46446c(0x20d)][_0x46446c(0x1a5)]()===_0x549d12));_0x450277&&(_0x5c20c2=_0x5c20c2[_0x46446c(0x1d1)](_0x267584=>matchGlobPattern(_0x267584[_0x46446c(0x1b8)],_0x450277)));const _0x57c264=_0x2b5623[_0x46446c(0x1f3)];if(isStructuredFormat(_0x2b5623)){const _0x17eefd=_0x5c20c2[_0x46446c(0x1d3)](_0xf7b916=>({..._0xf7b916,'url':getCampaignUrl(_0x57c264,_0xf7b916[_0x46446c(0x1b7)],_0xf7b916['id'])}));await handleSDKOutput(_0x17eefd,_0x2b5623);}else for(const _0x3d04a5 of _0x5c20c2){const _0x5c22a3=a22_0x193d84[_0x46446c(0x1b0)]('\x20('+_0x3d04a5[_0x46446c(0x20d)][_0x46446c(0x1f5)]()+')'),_0x2f72ec=getCampaignUrl(_0x57c264,_0x3d04a5['workspaceId'],_0x3d04a5['id']),_0x396908=hyperlink(_0x3d04a5[_0x46446c(0x1b8)],_0x2f72ec);console[_0x46446c(0x1ae)](_0x46446c(0x1eb)+_0x396908+_0x5c22a3);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x16a);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x179);async['execute'](_0x2df84b){const _0x1bd59e=a22_0x592bbd,{options:_0x2779d7,args:_0x32ffb7,tdx:_0x221259}=_0x2df84b;if(_0x32ffb7[_0x1bd59e(0x1ca)]===0x0)return console['error'](_0x1bd59e(0x178)),console['error'](_0x1bd59e(0x1a1)),0x1;const _0x2c4de8=_0x32ffb7[0x0],_0x8efe8f=_0x2779d7,_0x10b67f=await resolveWorkspaceIdFromOptions(_0x8efe8f,_0x221259,!![]),_0x4bdc6a=_0x8efe8f[_0x1bd59e(0x14a)],_0x146000=_0x2779d7[_0x1bd59e(0x1f3)];if(_0x4bdc6a){const _0x1854d8=await withSpinner(_0x1bd59e(0x13e)+_0x2c4de8+_0x1bd59e(0x14e),()=>_0x221259[_0x1bd59e(0x1ea)]['getAlwaysOnCampaignFull'](_0x10b67f,_0x2c4de8),{'verbose':_0x2779d7[_0x1bd59e(0x20f)]}),_0x4106b5=_0x1854d8['data'],_0x4b969e=getCampaignUrl(_0x146000,_0x4106b5[_0x1bd59e(0x203)][_0x1bd59e(0x1b7)],_0x4106b5['id']);await handleSDKOutput([{..._0x4106b5,'url':_0x4b969e}],_0x2779d7);}else{const _0x2ebdc1=await withSpinner('Fetching\x20always-on\x20campaign\x20\x27'+_0x2c4de8+'\x27...',()=>_0x221259[_0x1bd59e(0x1ea)][_0x1bd59e(0x14d)](_0x10b67f,_0x2c4de8),{'verbose':_0x2779d7[_0x1bd59e(0x20f)]}),_0x1385b6=_0x2ebdc1['data'],_0x1859e7=getCampaignUrl(_0x146000,_0x1385b6['workspaceId'],_0x1385b6['id']);await handleSingleObjectOutput({..._0x1385b6,'url':_0x1859e7},_0x2779d7);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{['name']=a22_0x592bbd(0x194);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x17f);async['execute'](_0x19ceaf){const _0x2dc709=a22_0x592bbd,{options:_0x27ed9f,tdx:_0x221073}=_0x19ceaf,_0xf8314d=_0x27ed9f,_0x198a15=_0xf8314d[_0x2dc709(0x1b8)],_0x116ae2=_0xf8314d[_0x2dc709(0x161)];if(!_0x198a15)return console[_0x2dc709(0x1f4)](_0x2dc709(0x1a6)),console[_0x2dc709(0x1f4)](_0x2dc709(0x18c)),0x1;if(!_0x116ae2)return console[_0x2dc709(0x1f4)](_0x2dc709(0x1c7)),console[_0x2dc709(0x1f4)](_0x2dc709(0x18c)),0x1;const _0x5644d7=await resolveWorkspaceIdFromOptions(_0xf8314d,_0x221073,!![]),_0x2232cb=await resolveSegmentFromOptions(_0xf8314d,_0x221073),_0x1aa6e2={'name':_0x198a15,'campaignType':_0x116ae2,'workspaceId':_0x5644d7,'description':_0xf8314d[_0x2dc709(0x201)],'audienceId':_0x2232cb[_0x2dc709(0x1b1)],'audienceName':_0x2232cb[_0x2dc709(0x1ab)],'enableUtmTracking':_0xf8314d[_0x2dc709(0x13d)]},_0x4f37a0=await withSpinner(_0x2dc709(0x202)+_0x198a15+_0x2dc709(0x14e),()=>_0x221073[_0x2dc709(0x1ea)][_0x2dc709(0x182)](_0x5644d7,_0x1aa6e2));return await handleSDKOutput([_0x4f37a0[_0x2dc709(0x186)]],_0x27ed9f),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x16c);['description']=a22_0x592bbd(0x1be);async[a22_0x592bbd(0x1f8)](_0x958635){const _0x4e1935=a22_0x592bbd,{options:_0x269c13,args:_0x5bf6d0,tdx:_0x4034b4}=_0x958635;if(_0x5bf6d0['length']===0x0)return console[_0x4e1935(0x1f4)](_0x4e1935(0x178)),console['error'](_0x4e1935(0x1a0)),0x1;const _0x312ef4=_0x5bf6d0[0x0],_0x2736b4=_0x269c13,_0x18227b=await resolveWorkspaceIdFromOptions(_0x2736b4,_0x4034b4,!![]),_0x35ffff=await resolveSegmentFromOptions(_0x2736b4,_0x4034b4),_0x3b3a74={'name':_0x2736b4[_0x4e1935(0x1b8)],'description':_0x2736b4['description'],'audienceId':_0x35ffff[_0x4e1935(0x1b1)],'audienceName':_0x35ffff[_0x4e1935(0x1ab)],'enableUtmTracking':_0x2736b4[_0x4e1935(0x13d)]},_0x4956d8=Object[_0x4e1935(0x147)](Object[_0x4e1935(0x1dc)](_0x3b3a74)['filter'](([,_0x479bad])=>_0x479bad!==undefined));if(Object[_0x4e1935(0x142)](_0x4956d8)['length']===0x0)return console[_0x4e1935(0x1f4)](_0x4e1935(0x1f0)),console[_0x4e1935(0x1f4)](_0x4e1935(0x160)),0x1;const _0x2c9f71=await withSpinner(_0x4e1935(0x158)+_0x312ef4+'\x27...',()=>_0x4034b4[_0x4e1935(0x1ea)]['updateAlwaysOnCampaign'](_0x18227b,_0x312ef4,_0x4956d8),{'verbose':_0x269c13['verbose']});return await handleSDKOutput([_0x2c9f71['data']],_0x269c13),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x15a);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x1f6);async[a22_0x592bbd(0x1f8)](_0x18f189){const _0x2a2463=a22_0x592bbd,{options:_0x3d77cb,args:_0x111992,tdx:_0x2a46a1}=_0x18f189;if(_0x111992[_0x2a2463(0x1ca)]===0x0)return console[_0x2a2463(0x1f4)](_0x2a2463(0x178)),console['error'](_0x2a2463(0x17b)),0x1;const _0x5e9c6f=_0x111992[0x0],_0x499787=_0x3d77cb,_0x278427=await resolveWorkspaceIdFromOptions(_0x499787,_0x2a46a1,!![]);if(!_0x3d77cb[_0x2a2463(0x1bc)]){const _0x181667=await confirm(_0x2a2463(0x200)+_0x5e9c6f+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x181667)return console[_0x2a2463(0x1ae)](_0x2a2463(0x1d8)),0x0;}return await withSpinner(_0x2a2463(0x197)+_0x5e9c6f+_0x2a2463(0x14e),()=>_0x2a46a1[_0x2a2463(0x1ea)]['deleteAlwaysOnCampaign'](_0x278427,_0x5e9c6f),{'verbose':_0x3d77cb[_0x2a2463(0x20f)]}),console['log']('Always-on\x20campaign\x20\x27'+_0x5e9c6f+_0x2a2463(0x1bb)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{['name']='engage:always-on-campaign:launch';[a22_0x592bbd(0x201)]=a22_0x592bbd(0x167);async[a22_0x592bbd(0x1f8)](_0x3b332d){const _0x13108c=a22_0x592bbd,{options:_0x58ec81,args:_0x39499c,tdx:_0x59488a}=_0x3b332d;if(_0x39499c[_0x13108c(0x1ca)]===0x0)return console[_0x13108c(0x1f4)](_0x13108c(0x178)),console['error'](_0x13108c(0x1b6)),0x1;const _0x580cf2=_0x39499c[0x0],_0x5c6e46=_0x58ec81,_0x2467fc=await resolveWorkspaceIdFromOptions(_0x5c6e46,_0x59488a,!![]);return await withSpinner('Launching\x20always-on\x20campaign\x20\x27'+_0x580cf2+_0x13108c(0x14e),()=>_0x59488a[_0x13108c(0x1ea)][_0x13108c(0x20a)](_0x2467fc,_0x580cf2),{'verbose':_0x58ec81[_0x13108c(0x20f)]}),console[_0x13108c(0x1ae)](_0x13108c(0x1af)+_0x580cf2+_0x13108c(0x13b)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x1e8);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x20b);async['execute'](_0x1ba6d3){const _0x56edf8=a22_0x592bbd,{options:_0x86b866,args:_0x31ade5,tdx:_0x14b73b}=_0x1ba6d3;if(_0x31ade5[_0x56edf8(0x1ca)]===0x0)return console[_0x56edf8(0x1f4)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x56edf8(0x14b)),0x1;const _0x95561d=_0x31ade5[0x0],_0x31f921=_0x86b866,_0x1811bd=await resolveWorkspaceIdFromOptions(_0x31f921,_0x14b73b,!![]);return await withSpinner(_0x56edf8(0x15d)+_0x95561d+_0x56edf8(0x14e),()=>_0x14b73b[_0x56edf8(0x1ea)][_0x56edf8(0x17c)](_0x1811bd,_0x95561d),{'verbose':_0x86b866[_0x56edf8(0x20f)]}),console['log']('Always-on\x20campaign\x20\x27'+_0x95561d+_0x56edf8(0x148)),0x0;}}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{['name']=a22_0x592bbd(0x1d4);['description']='Resume\x20a\x20paused\x20always-on\x20campaign';async[a22_0x592bbd(0x1f8)](_0x5e0990){const _0x27c5d4=a22_0x592bbd,{options:_0x2bffbf,args:_0x218379,tdx:_0x25d039}=_0x5e0990;if(_0x218379[_0x27c5d4(0x1ca)]===0x0)return console[_0x27c5d4(0x1f4)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x27c5d4(0x1e0)),0x1;const _0x3759d4=_0x218379[0x0],_0x454c54=_0x2bffbf,_0x177317=await resolveWorkspaceIdFromOptions(_0x454c54,_0x25d039,!![]);return await withSpinner(_0x27c5d4(0x1df)+_0x3759d4+_0x27c5d4(0x14e),()=>_0x25d039[_0x27c5d4(0x1ea)]['resumeAlwaysOnCampaign'](_0x177317,_0x3759d4),{'verbose':_0x2bffbf[_0x27c5d4(0x20f)]}),console[_0x27c5d4(0x1ae)](_0x27c5d4(0x1af)+_0x3759d4+_0x27c5d4(0x18b)),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x1fa);['description']=a22_0x592bbd(0x205);async[a22_0x592bbd(0x1f8)](_0x5414c2){const _0x4fd7e9=a22_0x592bbd,{options:_0x5822f6,args:_0x58c0fd,tdx:_0x43cbf9}=_0x5414c2;if(_0x58c0fd[_0x4fd7e9(0x1ca)]===0x0)return console[_0x4fd7e9(0x1f4)](_0x4fd7e9(0x178)),console[_0x4fd7e9(0x1f4)](_0x4fd7e9(0x153)),0x1;const _0x2c1ed7=_0x58c0fd[0x0],_0x1d03a3=_0x5822f6,_0x16e053=await resolveWorkspaceIdFromOptions(_0x1d03a3,_0x43cbf9,!![]);if(!_0x5822f6[_0x4fd7e9(0x1bc)]){const _0x13cc4f=await confirm(_0x4fd7e9(0x206)+_0x2c1ed7+_0x4fd7e9(0x15c));if(!_0x13cc4f)return console[_0x4fd7e9(0x1ae)](_0x4fd7e9(0x1d8)),0x0;}return await withSpinner(_0x4fd7e9(0x210)+_0x2c1ed7+_0x4fd7e9(0x14e),()=>_0x43cbf9[_0x4fd7e9(0x1ea)][_0x4fd7e9(0x140)](_0x16e053,_0x2c1ed7),{'verbose':_0x5822f6[_0x4fd7e9(0x20f)]}),console[_0x4fd7e9(0x1ae)]('Always-on\x20campaign\x20\x27'+_0x2c1ed7+'\x27\x20finished\x20successfully'),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]='engage:always-on-campaign:duplicate';[a22_0x592bbd(0x201)]=a22_0x592bbd(0x16f);async[a22_0x592bbd(0x1f8)](_0x32563c){const _0x236315=a22_0x592bbd,{options:_0x33e885,args:_0x502d01,tdx:_0x130bf3}=_0x32563c;if(_0x502d01[_0x236315(0x1ca)]===0x0)return console[_0x236315(0x1f4)](_0x236315(0x178)),console[_0x236315(0x1f4)](_0x236315(0x1b5)),0x1;const _0x12d473=_0x502d01[0x0],_0x465c20=_0x33e885,_0x4b7e49=await resolveWorkspaceIdFromOptions(_0x465c20,_0x130bf3,!![]),_0x1431de=_0x465c20[_0x236315(0x1b8)],_0x14ec7a=await withSpinner(_0x236315(0x1ff)+_0x12d473+_0x236315(0x14e),()=>_0x130bf3[_0x236315(0x1ea)][_0x236315(0x171)](_0x4b7e49,_0x12d473,_0x1431de),{'verbose':_0x33e885['verbose']});return await handleSDKOutput([_0x14ec7a[_0x236315(0x186)]],_0x33e885),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a22_0x592bbd(0x1b8)]=a22_0x592bbd(0x1c3);[a22_0x592bbd(0x201)]=a22_0x592bbd(0x1aa);async[a22_0x592bbd(0x1f8)](_0x210257){const _0x48c3ab=a22_0x592bbd,{options:_0x3301c7,args:_0x30ab6e,tdx:_0xff12f9}=_0x210257;if(_0x30ab6e['length']===0x0)return console['error'](_0x48c3ab(0x175)),console[_0x48c3ab(0x1f4)](_0x48c3ab(0x19f)),0x1;const _0x2bb409=_0x30ab6e[0x0];await withSpinner(_0x48c3ab(0x1b2)+_0x2bb409+_0x48c3ab(0x14e),()=>_0xff12f9[_0x48c3ab(0x1ea)]['resolveWorkspaceId'](_0x2bb409));const _0x105a13=_0x3301c7[_0x48c3ab(0x174)]||undefined;return saveSessionContext({'engage_workspace':_0x2bb409},_0x105a13),console['log'](_0x48c3ab(0x18e)+_0x2bb409),console[_0x48c3ab(0x1ae)](_0x48c3ab(0x193)),0x0;}}
1
+ const a22_0x15ef4a=a22_0x38de;(function(_0xa20871,_0x85f386){const _0x518971=a22_0x38de,_0x2a37ef=_0xa20871();while(!![]){try{const _0x222675=parseInt(_0x518971(0x9d))/0x1+parseInt(_0x518971(0x12b))/0x2*(-parseInt(_0x518971(0x15d))/0x3)+parseInt(_0x518971(0xaa))/0x4+-parseInt(_0x518971(0xc0))/0x5*(-parseInt(_0x518971(0x156))/0x6)+parseInt(_0x518971(0xa4))/0x7+parseInt(_0x518971(0xa7))/0x8+-parseInt(_0x518971(0x127))/0x9;if(_0x222675===_0x85f386)break;else _0x2a37ef['push'](_0x2a37ef['shift']());}catch(_0x371736){_0x2a37ef['push'](_0x2a37ef['shift']());}}}(a22_0x3e19,0x7b2fc));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';function a22_0x3e19(){const _0x1ac5e9=['engage:always-on-campaign:launch','startAt','78SNvIaF','engage:always-on-campaign:delete','toLowerCase','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','Campaign\x20\x27','type','Fetching\x20always-on\x20campaigns...','24OYhBUS','Updating\x20template\x20\x27','Launch\x20a\x20campaign','Create\x20a\x20new\x20always-on\x20campaign','engage:template:update','Fetching\x20workspaces...','getAlwaysOnCampaign','Pausing\x20campaign\x20\x27','\x27?\x20This\x20cannot\x20be\x20undone.','Duplicate\x20an\x20always-on\x20campaign','PAUSED','Create\x20a\x20workspace','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','809956GVtOwe','entries','List\x20campaigns','engage:workspace:update','engage:campaign:create','updateWorkspace','session','4525402knciTO','log','emailSenderId','2176816OcMHBd','engage:campaign:delete','MISSING_ARGUMENT','2936636eOhTjU','Pause\x20a\x20campaign','Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','engage:always-on-campaign:show','📝\x20','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','resumeAlwaysOnCampaign','Deleting\x20always-on\x20campaign\x20\x27','Fetching\x20workspace\x20\x27','execute','\x27...','engage:always-on-campaign:update','deleteAlwaysOnCampaign','status','engage:campaign:show','Delete\x20an\x20always-on\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','workspaceId','launchCampaign','name','listTemplates','277655EAtoaX','subject','engage:always-on-campaign:pause','engage:campaigns','updateTemplate','📧\x20','join','getTemplateFull','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','\x27\x20finished\x20successfully','map','Show\x20email\x20template\x20details','site','engage:campaign:resume','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Update\x20an\x20always-on\x20campaign','engage','getWorkspaceFull','parentId','Create\x20an\x20email\x20template','segment','Verifying\x20workspace\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','engage:campaign:duplicate','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','\x22.\x20Valid\x20values:\x20','Error:\x20--name\x20is\x20required','Delete\x20a\x20campaign','getWorkspace','Show\x20campaign\x20details','Delete\x20a\x20workspace','workspace','listCampaigns','description','jsonColumns','getCampaign','getAlwaysOnCampaignFull','Error:\x20--subject\x20is\x20required','dim','data','🏢\x20','error','engage_workspace','fromEntries','updateCampaign','Update\x20a\x20workspace','Error:\x20Invalid\x20status\x20\x22','resolvePathToResource','\x27\x20deleted\x20successfully','List\x20always-on\x20campaigns','Pause\x20an\x20always-on\x20campaign','Error:\x20Workspace\x20name\x20is\x20required','verbose','pauseCampaign','Resuming\x20campaign\x20\x27','includes','duplicateCampaign','\x27\x20paused\x20successfully','engage:workspaces','Creating\x20always-on\x20campaign\x20\x27','Deleting\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','pauseAlwaysOnCampaign','engage:always-on-campaign:create','DRAFT','Finishing\x20always-on\x20campaign\x20\x27','filter','Always-on\x20campaign\x20\x27','FINISHED','parentName','Launching\x20always-on\x20campaign\x20\x27','toUpperCase','plaintext','html','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>','Template\x20\x27','htmlFile','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','keys','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Fetching\x20campaign\x20\x27','enableUtmTracking','Create\x20a\x20new\x20campaign','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','full','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','createAlwaysOnCampaign','Fetching\x20always-on\x20campaign\x20\x27','segmentId','engage:workspace:use','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Show\x20workspace\x20details','resolveWorkspaceId','List\x20email\x20templates','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Launch\x20an\x20always-on\x20campaign','getCampaignFull','engage:campaign:launch','22899546hgsonp','Duplicating\x20always-on\x20campaign\x20\x27','Operation\x20cancelled','Workspace\x20\x27','33910FfNTXW','length','Fetching\x20template\x20\x27','engage:workspace:create','Update\x20an\x20email\x20template','\x27\x20launched\x20successfully','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','attributes','audienceName','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:always-on-campaigns','createCampaign','engage:templates','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:campaign:pause','Engage\x20workspace\x20set\x20to:\x20','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','createTemplate','timezone','duplicateAlwaysOnCampaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','editorType','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Updating\x20campaign\x20\x27','limit','Deleting\x20campaign\x20\x27','audienceId','updateAlwaysOnCampaign','Creating\x20workspace\x20\x27','deleteCampaign','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','yes','\x27\x20resumed\x20successfully','engage:campaign:update','segmentName','Workspace\x20is\x20required\x20for\x20this\x20operation','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','COMPLETED'];a22_0x3e19=function(){return _0x1ac5e9;};return a22_0x3e19();}import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a22_0x464f89 from'chalk';export async function resolveWorkspaceIdFromOptions(_0xc7e30d,_0x1b1379,_0x174f80=![]){const _0x38b6f4=a22_0x38de;if(_0xc7e30d['workspace'])return await _0x1b1379[_0x38b6f4(0xd1)][_0x38b6f4(0x120)](_0xc7e30d[_0x38b6f4(0xe0)]);const _0x732b20=loadSessionContext(_0xc7e30d['session']);if(_0x732b20?.[_0x38b6f4(0xeb)])return await _0x1b1379[_0x38b6f4(0xd1)][_0x38b6f4(0x120)](_0x732b20[_0x38b6f4(0xeb)]);if(_0x174f80)throw new SDKError(ErrorCode[_0x38b6f4(0xa9)],_0x38b6f4(0x151),undefined,{'helpText':_0x38b6f4(0xd9)});return undefined;}async function resolveSegmentFromOptions(_0x53987d,_0x44a125){const _0x5061ca=a22_0x38de;if(!_0x53987d['segment'])return{};const _0x38a451=_0x53987d['segment'],_0x5cea19=await _0x44a125[_0x5061ca(0xd5)][_0x5061ca(0xf0)](_0x38a451);return{'audienceId':_0x5cea19[_0x5061ca(0xd3)],'audienceName':_0x5cea19[_0x5061ca(0x106)],..._0x5cea19[_0x5061ca(0x11c)]&&{'segmentId':_0x5cea19[_0x5061ca(0x11c)],'segmentName':_0x5cea19[_0x5061ca(0x150)]}};}function buildConnectorConfig(_0x2ddb65){const _0x6bc42=a22_0x38de,_0x53247d=_0x2ddb65[_0x6bc42(0xa6)],_0x581395=_0x2ddb65[_0x6bc42(0xe3)];if(!_0x53247d&&!_0x581395)return undefined;return{..._0x53247d&&{'emailSenderId':_0x53247d},..._0x581395&&{'jsonColumns':_0x581395}};}export class EngageCampaignsCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xc3);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x9f);async[a22_0x15ef4a(0xb4)](_0xa556a){const _0x55c498=a22_0x15ef4a,{options:_0x56d347,args:_0x43702e,tdx:_0x38b82f}=_0xa556a,_0x313a11=_0x43702e[0x0],_0x28ebfc=resolveLimit(_0x56d347['limit'],DEFAULT_LLM_LIMIT),_0xedd2b8=_0x56d347,_0x5a1e4c=_0xedd2b8[_0x55c498(0x15b)],_0x5656a7=[_0x55c498(0x101),'ACTIVE',_0x55c498(0x98),_0x55c498(0x153)],_0x3d8c8c=_0xedd2b8[_0x55c498(0xb8)],_0x52348f=_0x3d8c8c?.[_0x55c498(0x108)]();if(_0x52348f&&!_0x5656a7[_0x55c498(0xf8)](_0x52348f))return console[_0x55c498(0xea)](_0x55c498(0xef)+_0x3d8c8c+_0x55c498(0xda)+_0x5656a7[_0x55c498(0xc6)](',\x20')),0x1;const _0x4bebea=await resolveWorkspaceIdFromOptions(_0xedd2b8,_0x38b82f),_0x517293=await withSpinner('Fetching\x20campaigns...',()=>_0x38b82f[_0x55c498(0xd1)][_0x55c498(0xe1)]({'type':_0x5a1e4c,'status':_0x52348f,'workspaceId':_0x4bebea,'limit':_0x28ebfc}),{'verbose':_0x56d347[_0x55c498(0xf5)]});let _0x5dea31=_0x517293[_0x55c498(0xe8)];_0x52348f&&(_0x5dea31=_0x5dea31[_0x55c498(0x103)](_0x5b2316=>_0x5b2316['status'][_0x55c498(0x108)]()===_0x52348f));_0x313a11&&(_0x5dea31=_0x5dea31[_0x55c498(0x103)](_0x234b98=>matchGlobPattern(_0x234b98[_0x55c498(0xbe)],_0x313a11)));const _0x2d28ed=_0x56d347[_0x55c498(0xcc)];if(isStructuredFormat(_0x56d347)){const _0x2f9631=_0x5dea31[_0x55c498(0xca)](_0x2ca30e=>({..._0x2ca30e,'url':_0x2ca30e[_0x55c498(0xbc)]?getCampaignUrl(_0x2d28ed,_0x2ca30e['workspaceId'],_0x2ca30e['id']):undefined}));await handleSDKOutput(_0x2f9631,_0x56d347);}else for(const _0x2d00db of _0x5dea31){const _0x3cce7d=a22_0x464f89['dim']('\x20('+_0x2d00db['status'][_0x55c498(0x158)]()+')'),_0x436e4c=_0x2d00db[_0x55c498(0xbc)]?getCampaignUrl(_0x2d28ed,_0x2d00db[_0x55c498(0xbc)],_0x2d00db['id']):undefined,_0x3125b0=_0x436e4c?hyperlink(_0x2d00db['name'],_0x436e4c):_0x2d00db['name'];console['log'](_0x55c498(0xc5)+_0x3125b0+_0x3cce7d);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xb9);['description']=a22_0x15ef4a(0xde);async[a22_0x15ef4a(0xb4)](_0x3012f7){const _0x43e7c7=a22_0x15ef4a,{options:_0x30d6e5,args:_0xc57f08,tdx:_0x4f9754}=_0x3012f7;if(_0xc57f08[_0x43e7c7(0x12c)]===0x0)return console[_0x43e7c7(0xea)](_0x43e7c7(0x139)),console['error'](_0x43e7c7(0xfe)),0x1;const _0x63faf4=_0xc57f08[0x0],_0x45644d=_0x30d6e5,_0xf496e7=await resolveWorkspaceIdFromOptions(_0x45644d,_0x4f9754),_0x1cb46d=_0x45644d[_0x43e7c7(0x118)],_0x3398aa=_0x30d6e5['site'];if(_0x1cb46d){const _0x4be568=await withSpinner(_0x43e7c7(0x114)+_0x63faf4+_0x43e7c7(0xb5),()=>_0x4f9754[_0x43e7c7(0xd1)][_0x43e7c7(0x125)](_0x63faf4,_0xf496e7),{'verbose':_0x30d6e5[_0x43e7c7(0xf5)]}),_0x474353=_0x4be568[_0x43e7c7(0xe8)],_0x461827=_0x474353['attributes']['workspaceId']?getCampaignUrl(_0x3398aa,_0x474353[_0x43e7c7(0x133)][_0x43e7c7(0xbc)],_0x474353['id']):undefined;await handleSDKOutput([{..._0x474353,..._0x461827&&{'url':_0x461827}}],_0x30d6e5);}else{const _0x1989c9=await withSpinner(_0x43e7c7(0x114)+_0x63faf4+'\x27...',()=>_0x4f9754['engage'][_0x43e7c7(0xe4)](_0x63faf4,_0xf496e7),{'verbose':_0x30d6e5[_0x43e7c7(0xf5)]}),_0x43485f=_0x1989c9[_0x43e7c7(0xe8)],_0x1dc2a6=_0x43485f[_0x43e7c7(0xbc)]?getCampaignUrl(_0x3398aa,_0x43485f[_0x43e7c7(0xbc)],_0x43485f['id']):undefined;await handleSingleObjectOutput({..._0x43485f,..._0x1dc2a6&&{'url':_0x1dc2a6}},_0x30d6e5);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xa1);['description']=a22_0x15ef4a(0x116);async[a22_0x15ef4a(0xb4)](_0x2baaa5){const _0x1f2c87=a22_0x15ef4a,{options:_0x5a5ecf,tdx:_0x2bc1b3}=_0x2baaa5,_0x20f0f2=_0x5a5ecf,_0x3f7765=_0x20f0f2[_0x1f2c87(0xbe)],_0x4289ce=_0x20f0f2['type'];if(!_0x3f7765)return console[_0x1f2c87(0xea)](_0x1f2c87(0xdb)),console['error'](_0x1f2c87(0x123)),0x1;if(!_0x4289ce)return console['error'](_0x1f2c87(0x141)),console[_0x1f2c87(0xea)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x4ea876=await resolveWorkspaceIdFromOptions(_0x20f0f2,_0x2bc1b3,!![]),_0x336f4f=await resolveSegmentFromOptions(_0x20f0f2,_0x2bc1b3),_0x45d7d5=buildConnectorConfig(_0x20f0f2),_0xb053fe={'name':_0x3f7765,'campaignType':_0x4289ce,'workspaceId':_0x4ea876,'description':_0x20f0f2['description'],..._0x336f4f,'connectorConfig':_0x45d7d5,'startAt':_0x20f0f2[_0x1f2c87(0x155)],'timezone':_0x20f0f2[_0x1f2c87(0x13e)]},_0x2445fe=await withSpinner('Creating\x20campaign\x20\x27'+_0x3f7765+'\x27...',()=>_0x2bc1b3['engage'][_0x1f2c87(0x137)](_0xb053fe));return await handleSDKOutput([_0x2445fe[_0x1f2c87(0xe8)]],_0x5a5ecf),0x0;}}function a22_0x38de(_0x313b6e,_0x461be7){_0x313b6e=_0x313b6e-0x8f;const _0x3e19ad=a22_0x3e19();let _0x38de68=_0x3e19ad[_0x313b6e];return _0x38de68;}export class EngageCampaignUpdateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x14f);['description']='Update\x20a\x20campaign';async[a22_0x15ef4a(0xb4)](_0x5513ec){const _0x5d2787=a22_0x15ef4a,{options:_0x2c147d,args:_0x1e5e97,tdx:_0x1b797b}=_0x5513ec;if(_0x1e5e97[_0x5d2787(0x12c)]===0x0)return console[_0x5d2787(0xea)](_0x5d2787(0x139)),console[_0x5d2787(0xea)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x5eeae6=_0x1e5e97[0x0],_0x3e2782=_0x2c147d,_0x5cd780=await resolveWorkspaceIdFromOptions(_0x3e2782,_0x1b797b),_0x3899c1=await resolveSegmentFromOptions(_0x3e2782,_0x1b797b),_0x37352e=buildConnectorConfig(_0x3e2782),_0x1c5091={'name':_0x3e2782['name'],'description':_0x3e2782[_0x5d2787(0xe2)],..._0x3899c1,'connectorConfig':_0x37352e,'startAt':_0x3e2782[_0x5d2787(0x155)],'timezone':_0x3e2782[_0x5d2787(0x13e)]},_0x15b8bf=Object[_0x5d2787(0xec)](Object[_0x5d2787(0x9e)](_0x1c5091)[_0x5d2787(0x103)](([,_0x278e91])=>_0x278e91!==undefined));if(Object[_0x5d2787(0x112)](_0x15b8bf)[_0x5d2787(0x12c)]===0x0)return console[_0x5d2787(0xea)](_0x5d2787(0x140)),console[_0x5d2787(0xea)](_0x5d2787(0x142)),0x1;const _0x3d1600=await withSpinner(_0x5d2787(0x145)+_0x5eeae6+'\x27...',()=>_0x1b797b[_0x5d2787(0xd1)][_0x5d2787(0xed)](_0x5eeae6,_0x15b8bf,_0x5cd780),{'verbose':_0x2c147d[_0x5d2787(0xf5)]});return await handleSDKOutput([_0x3d1600['data']],_0x2c147d),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xa8);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xdc);async[a22_0x15ef4a(0xb4)](_0x5bf77c){const _0xcfe7f4=a22_0x15ef4a,{options:_0x34928a,args:_0x9e5607,tdx:_0x23d643}=_0x5bf77c;if(_0x9e5607[_0xcfe7f4(0x12c)]===0x0)return console[_0xcfe7f4(0xea)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0xcfe7f4(0xea)](_0xcfe7f4(0x10c)),0x1;const _0x1b07de=_0x9e5607[0x0],_0x3554ce=_0x34928a,_0x2589d2=await resolveWorkspaceIdFromOptions(_0x3554ce,_0x23d643);if(!_0x34928a[_0xcfe7f4(0x14d)]){const _0x50c34e=await confirm(_0xcfe7f4(0x9b)+_0x1b07de+_0xcfe7f4(0x96));if(!_0x50c34e)return console[_0xcfe7f4(0xa5)](_0xcfe7f4(0x129)),0x0;}return await withSpinner(_0xcfe7f4(0x147)+_0x1b07de+_0xcfe7f4(0xb5),()=>_0x23d643[_0xcfe7f4(0xd1)][_0xcfe7f4(0x14b)](_0x1b07de,_0x2589d2),{'verbose':_0x34928a[_0xcfe7f4(0xf5)]}),console[_0xcfe7f4(0xa5)](_0xcfe7f4(0x15a)+_0x1b07de+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']=a22_0x15ef4a(0x126);['description']=a22_0x15ef4a(0x90);async['execute'](_0xd9268e){const _0xa5693c=a22_0x15ef4a,{options:_0x290704,args:_0x2f63d2,tdx:_0x3b5cc7}=_0xd9268e;if(_0x2f63d2['length']===0x0)return console[_0xa5693c(0xea)](_0xa5693c(0x139)),console[_0xa5693c(0xea)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x3c30be=_0x2f63d2[0x0],_0x2964b3=_0x290704,_0x295b33=await resolveWorkspaceIdFromOptions(_0x2964b3,_0x3b5cc7);return await withSpinner('Launching\x20campaign\x20\x27'+_0x3c30be+_0xa5693c(0xb5),()=>_0x3b5cc7[_0xa5693c(0xd1)][_0xa5693c(0xbd)](_0x3c30be,_0x295b33),{'verbose':_0x290704[_0xa5693c(0xf5)]}),console[_0xa5693c(0xa5)](_0xa5693c(0x15a)+_0x3c30be+_0xa5693c(0x130)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x13a);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xab);async['execute'](_0x1424ba){const _0x305b69=a22_0x15ef4a,{options:_0x5b7419,args:_0x1430bf,tdx:_0x28a776}=_0x1424ba;if(_0x1430bf[_0x305b69(0x12c)]===0x0)return console[_0x305b69(0xea)](_0x305b69(0x139)),console[_0x305b69(0xea)](_0x305b69(0x113)),0x1;const _0x4bbcc0=_0x1430bf[0x0],_0x23f4a8=_0x5b7419,_0x367de4=await resolveWorkspaceIdFromOptions(_0x23f4a8,_0x28a776);return await withSpinner(_0x305b69(0x95)+_0x4bbcc0+_0x305b69(0xb5),()=>_0x28a776['engage'][_0x305b69(0xf6)](_0x4bbcc0,_0x367de4),{'verbose':_0x5b7419[_0x305b69(0xf5)]}),console[_0x305b69(0xa5)](_0x305b69(0x15a)+_0x4bbcc0+_0x305b69(0xfa)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xcd);[a22_0x15ef4a(0xe2)]='Resume\x20a\x20paused\x20campaign';async[a22_0x15ef4a(0xb4)](_0x2c7299){const _0x44aa8a=a22_0x15ef4a,{options:_0x35ff3f,args:_0x55f6ac,tdx:_0x36cbee}=_0x2c7299;if(_0x55f6ac['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x44aa8a(0xea)](_0x44aa8a(0x119)),0x1;const _0x19fc15=_0x55f6ac[0x0],_0x458aed=_0x35ff3f,_0x559ffb=await resolveWorkspaceIdFromOptions(_0x458aed,_0x36cbee);return await withSpinner(_0x44aa8a(0xf7)+_0x19fc15+_0x44aa8a(0xb5),()=>_0x36cbee[_0x44aa8a(0xd1)]['resumeCampaign'](_0x19fc15,_0x559ffb),{'verbose':_0x35ff3f[_0x44aa8a(0xf5)]}),console[_0x44aa8a(0xa5)]('Campaign\x20\x27'+_0x19fc15+_0x44aa8a(0x14e)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xd8);[a22_0x15ef4a(0xe2)]='Duplicate\x20a\x20campaign';async[a22_0x15ef4a(0xb4)](_0x3dc0f1){const _0x46d143=a22_0x15ef4a,{options:_0x24696d,args:_0x2a3ca6,tdx:_0x155e71}=_0x3dc0f1;if(_0x2a3ca6[_0x46d143(0x12c)]===0x0)return console['error'](_0x46d143(0x139)),console[_0x46d143(0xea)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x5d3e51=_0x2a3ca6[0x0],_0x3737de=_0x24696d,_0x5b3bc8=await resolveWorkspaceIdFromOptions(_0x3737de,_0x155e71),_0x481da7=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x5d3e51+'\x27...',()=>_0x155e71[_0x46d143(0xd1)][_0x46d143(0xf9)](_0x5d3e51,_0x5b3bc8),{'verbose':_0x24696d[_0x46d143(0xf5)]});return await handleSDKOutput([_0x481da7[_0x46d143(0xe8)]],_0x24696d),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x138);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x121);async['execute'](_0x43bd42){const _0x5e2eea=a22_0x15ef4a,{options:_0x514c36,args:_0x2ffdc9,tdx:_0x4c1acf}=_0x43bd42,_0x5511af=_0x2ffdc9[0x0],_0x357b11=resolveLimit(_0x514c36['limit'],DEFAULT_LLM_LIMIT),_0xe38ea0=_0x514c36,_0x952edc=await resolveWorkspaceIdFromOptions(_0xe38ea0,_0x4c1acf),_0x1615d7=await withSpinner('Fetching\x20templates...',()=>_0x4c1acf['engage'][_0x5e2eea(0xbf)]({'workspaceId':_0x952edc,'limit':_0x357b11}),{'verbose':_0x514c36[_0x5e2eea(0xf5)]});let _0x42a886=_0x1615d7[_0x5e2eea(0xe8)];_0x5511af&&(_0x42a886=_0x1615d7[_0x5e2eea(0xe8)][_0x5e2eea(0x103)](_0x18f777=>matchGlobPattern(_0x18f777['name'],_0x5511af)));const _0x76f585=_0x514c36['site'];if(isStructuredFormat(_0x514c36))await handleSDKOutput(_0x42a886,_0x514c36);else for(const _0x523eb9 of _0x42a886){const _0x15f42e=_0x523eb9[_0x5e2eea(0xbc)]?getTemplateUrl(_0x76f585,_0x523eb9[_0x5e2eea(0xbc)],_0x523eb9['id']):undefined,_0x4ab3b3=_0x15f42e?hyperlink(_0x523eb9['name'],_0x15f42e):_0x523eb9[_0x5e2eea(0xbe)];console[_0x5e2eea(0xa5)](_0x5e2eea(0xaf)+_0x4ab3b3);}return 0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']='engage:template:show';['description']=a22_0x15ef4a(0xcb);async[a22_0x15ef4a(0xb4)](_0x4e4499){const _0x3faa38=a22_0x15ef4a,{options:_0x228872,args:_0x559ace,tdx:_0x8d7c3b}=_0x4e4499;if(_0x559ace[_0x3faa38(0x12c)]===0x0)return console['error'](_0x3faa38(0x144)),console[_0x3faa38(0xea)](_0x3faa38(0x11e)),0x1;const _0x3c5e63=_0x559ace[0x0],_0x26c8db=_0x228872,_0x59db35=await resolveWorkspaceIdFromOptions(_0x26c8db,_0x8d7c3b),_0x5ad72a=_0x26c8db[_0x3faa38(0x118)];if(_0x5ad72a){const _0x1927ff=await withSpinner(_0x3faa38(0x12d)+_0x3c5e63+_0x3faa38(0xb5),()=>_0x8d7c3b['engage'][_0x3faa38(0xc7)](_0x3c5e63,_0x59db35),{'verbose':_0x228872['verbose']});await handleSDKOutput([_0x1927ff],_0x228872);}else{const _0x588804=await withSpinner(_0x3faa38(0x12d)+_0x3c5e63+_0x3faa38(0xb5),()=>_0x8d7c3b[_0x3faa38(0xd1)]['getTemplate'](_0x3c5e63,_0x59db35),{'verbose':_0x228872[_0x3faa38(0xf5)]});await handleSDKOutput([_0x588804],_0x228872);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']='engage:template:create';[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xd4);async[a22_0x15ef4a(0xb4)](_0x4c63ff){const _0x46a782=a22_0x15ef4a,{options:_0x653994,tdx:_0x547f5a}=_0x4c63ff,_0x489f36=_0x653994,_0x3b0cbb=_0x489f36[_0x46a782(0xbe)],_0x3a3160=_0x489f36[_0x46a782(0xc1)],_0x3cc209=_0x489f36[_0x46a782(0x10a)],_0x571c80=_0x489f36[_0x46a782(0x110)];if(!_0x3b0cbb)return console[_0x46a782(0xea)](_0x46a782(0xdb)),console[_0x46a782(0xea)](_0x46a782(0xc8)),0x1;if(!_0x3a3160)return console[_0x46a782(0xea)](_0x46a782(0xe6)),0x1;if(_0x3cc209&&_0x571c80)return console[_0x46a782(0xea)](_0x46a782(0x117)),0x1;const _0x86192e=_0x571c80?readFileContent(_0x571c80):_0x3cc209;if(!_0x86192e)return console['error']('Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required'),0x1;const _0x4edfeb=await resolveWorkspaceIdFromOptions(_0x489f36,_0x547f5a,!![]),_0x52a3d={'name':_0x3b0cbb,'subjectTemplate':_0x3a3160,'htmlTemplate':_0x86192e,'workspaceId':_0x4edfeb,'plaintextTemplate':_0x489f36[_0x46a782(0x109)],'editorType':_0x489f36[_0x46a782(0x143)]??'grapesjs'},_0x337890=await withSpinner('Creating\x20template\x20\x27'+_0x3b0cbb+_0x46a782(0xb5),()=>_0x547f5a[_0x46a782(0xd1)][_0x46a782(0x13d)](_0x52a3d));return await handleSDKOutput([_0x337890[_0x46a782(0xe8)]],_0x653994),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a22_0x15ef4a(0x92);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x12f);async[a22_0x15ef4a(0xb4)](_0x4487cd){const _0x55dc10=a22_0x15ef4a,{options:_0x20a915,args:_0x1b2186,tdx:_0xce3505}=_0x4487cd;if(_0x1b2186[_0x55dc10(0x12c)]===0x0)return console[_0x55dc10(0xea)](_0x55dc10(0x144)),console[_0x55dc10(0xea)](_0x55dc10(0x152)),0x1;const _0x55d3d1=_0x1b2186[0x0],_0x5835f6=_0x20a915,_0x228850=_0x5835f6[_0x55dc10(0x10a)],_0x852f59=_0x5835f6[_0x55dc10(0x110)];if(_0x228850&&_0x852f59)return console[_0x55dc10(0xea)]('Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file'),0x1;const _0x297061=_0x852f59?readFileContent(_0x852f59):_0x228850,_0x3eeeb7=await resolveWorkspaceIdFromOptions(_0x5835f6,_0xce3505),_0x1fb678={'name':_0x5835f6['name'],'subjectTemplate':_0x5835f6['subject'],'htmlTemplate':_0x297061,'plaintextTemplate':_0x5835f6[_0x55dc10(0x109)]},_0x1dddac=Object[_0x55dc10(0xec)](Object[_0x55dc10(0x9e)](_0x1fb678)['filter'](([,_0x3793ad])=>_0x3793ad!==undefined));if(Object[_0x55dc10(0x112)](_0x1dddac)[_0x55dc10(0x12c)]===0x0)return console[_0x55dc10(0xea)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x55dc10(0x9c)),0x1;const _0x1b31fb=await withSpinner(_0x55dc10(0x8f)+_0x55d3d1+_0x55dc10(0xb5),()=>_0xce3505[_0x55dc10(0xd1)][_0x55dc10(0xc4)](_0x55d3d1,_0x1dddac,_0x3eeeb7),{'verbose':_0x20a915['verbose']});return await handleSDKOutput([_0x1b31fb[_0x55dc10(0xe8)]],_0x20a915),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']='engage:template:delete';['description']='Delete\x20an\x20email\x20template';async[a22_0x15ef4a(0xb4)](_0x45ca6a){const _0x4c6fb9=a22_0x15ef4a,{options:_0x1c51e0,args:_0x29f3ca,tdx:_0x134fdc}=_0x45ca6a;if(_0x29f3ca['length']===0x0)return console['error'](_0x4c6fb9(0x144)),console['error'](_0x4c6fb9(0xce)),0x1;const _0x102c1a=_0x29f3ca[0x0],_0x166c07=_0x1c51e0,_0xf4604f=await resolveWorkspaceIdFromOptions(_0x166c07,_0x134fdc);if(!_0x1c51e0[_0x4c6fb9(0x14d)]){const _0xc38ccf=await confirm(_0x4c6fb9(0xd7)+_0x102c1a+_0x4c6fb9(0x96));if(!_0xc38ccf)return console['log'](_0x4c6fb9(0x129)),0x0;}return await withSpinner(_0x4c6fb9(0xfd)+_0x102c1a+'\x27...',()=>_0x134fdc[_0x4c6fb9(0xd1)]['deleteTemplate'](_0x102c1a,_0xf4604f),{'verbose':_0x1c51e0['verbose']}),console[_0x4c6fb9(0xa5)](_0x4c6fb9(0x10f)+_0x102c1a+_0x4c6fb9(0xf1)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xfb);['description']='List\x20workspaces';async[a22_0x15ef4a(0xb4)](_0x35427f){const _0xde0864=a22_0x15ef4a,{options:_0xa4b132,args:_0x1709a1,tdx:_0x4f3506}=_0x35427f,_0x5789be=_0x1709a1[0x0],_0xcfb97b=resolveLimit(_0xa4b132[_0xde0864(0x146)],DEFAULT_LLM_LIMIT),_0x98692b=await withSpinner(_0xde0864(0x93),()=>_0x4f3506[_0xde0864(0xd1)]['listWorkspaces']({'limit':_0xcfb97b}),{'verbose':_0xa4b132[_0xde0864(0xf5)]});let _0x5eac8a=_0x98692b[_0xde0864(0xe8)];_0x5789be&&(_0x5eac8a=_0x98692b[_0xde0864(0xe8)][_0xde0864(0x103)](_0x4cb5da=>matchGlobPattern(_0x4cb5da['name'],_0x5789be)));const _0x121c36=_0xa4b132[_0xde0864(0xcc)];if(isStructuredFormat(_0xa4b132))await handleSDKOutput(_0x5eac8a,_0xa4b132);else for(const _0x11f451 of _0x5eac8a){const _0x5c7617=getWorkspaceUrl(_0x121c36,_0x11f451['id']),_0x516f98=hyperlink(_0x11f451[_0xde0864(0xbe)],_0x5c7617);console[_0xde0864(0xa5)](_0xde0864(0xe9)+_0x516f98);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]='engage:workspace:show';[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x11f);async[a22_0x15ef4a(0xb4)](_0x225a08){const _0x4e13d1=a22_0x15ef4a,{options:_0x44ea4c,args:_0x3300d1,tdx:_0x35da85}=_0x225a08;if(_0x3300d1[_0x4e13d1(0x12c)]===0x0)return console[_0x4e13d1(0xea)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x4e13d1(0xea)](_0x4e13d1(0xb0)),0x1;const _0x1b9028=_0x3300d1[0x0],_0x2f25d0=_0x44ea4c,_0x122218=_0x2f25d0[_0x4e13d1(0x118)];if(_0x122218){const _0x1d99da=await withSpinner('Fetching\x20workspace\x20\x27'+_0x1b9028+_0x4e13d1(0xb5),()=>_0x35da85[_0x4e13d1(0xd1)][_0x4e13d1(0xd2)](_0x1b9028),{'verbose':_0x44ea4c[_0x4e13d1(0xf5)]});await handleSDKOutput([_0x1d99da],_0x44ea4c);}else{const _0x3d1b19=await withSpinner(_0x4e13d1(0xb3)+_0x1b9028+_0x4e13d1(0xb5),()=>_0x35da85[_0x4e13d1(0xd1)][_0x4e13d1(0xdd)](_0x1b9028),{'verbose':_0x44ea4c['verbose']});await handleSDKOutput([_0x3d1b19],_0x44ea4c);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a22_0x15ef4a(0x12e);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x99);async[a22_0x15ef4a(0xb4)](_0x34106b){const _0x2b11bc=a22_0x15ef4a,{options:_0x54bc1a,tdx:_0x3752b7}=_0x34106b,_0x2cb48d=_0x54bc1a,_0x6e3107=_0x2cb48d[_0x2b11bc(0xbe)];if(!_0x6e3107)return console['error'](_0x2b11bc(0xdb)),console[_0x2b11bc(0xea)](_0x2b11bc(0xbb)),0x1;const _0x260471={'name':_0x6e3107,'description':_0x2cb48d[_0x2b11bc(0xe2)]},_0x5dca73=await withSpinner(_0x2b11bc(0x14a)+_0x6e3107+_0x2b11bc(0xb5),()=>_0x3752b7['engage']['createWorkspace'](_0x260471));return await handleSDKOutput([_0x5dca73['data']],_0x54bc1a),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xa0);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xee);async[a22_0x15ef4a(0xb4)](_0x5dc959){const _0x38ca2b=a22_0x15ef4a,{options:_0x5cc600,args:_0x15c64c,tdx:_0x19486a}=_0x5dc959;if(_0x15c64c[_0x38ca2b(0x12c)]===0x0)return console[_0x38ca2b(0xea)](_0x38ca2b(0x14c)),console[_0x38ca2b(0xea)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x107051=_0x15c64c[0x0],_0x21d9d8=_0x5cc600,_0x5b459e={'name':_0x21d9d8[_0x38ca2b(0xbe)],'description':_0x21d9d8[_0x38ca2b(0xe2)]},_0x134505=Object[_0x38ca2b(0xec)](Object['entries'](_0x5b459e)[_0x38ca2b(0x103)](([,_0x471b08])=>_0x471b08!==undefined));if(Object[_0x38ca2b(0x112)](_0x134505)[_0x38ca2b(0x12c)]===0x0)return console['error'](_0x38ca2b(0x140)),console[_0x38ca2b(0xea)]('Options:\x20--name,\x20--description'),0x1;const _0x54009c=await withSpinner('Updating\x20workspace\x20\x27'+_0x107051+_0x38ca2b(0xb5),()=>_0x19486a['engage'][_0x38ca2b(0xa2)](_0x107051,_0x134505),{'verbose':_0x5cc600[_0x38ca2b(0xf5)]});return await handleSDKOutput([_0x54009c['data']],_0x5cc600),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]='engage:workspace:delete';[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xdf);async[a22_0x15ef4a(0xb4)](_0xb71af9){const _0x275300=a22_0x15ef4a,{options:_0xab8203,args:_0x360e4b,tdx:_0x7c19b6}=_0xb71af9;if(_0x360e4b['length']===0x0)return console[_0x275300(0xea)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x275300(0x9a)),0x1;const _0x17e8cc=_0x360e4b[0x0];if(!_0xab8203[_0x275300(0x14d)]){const _0x27ca62=await confirm(_0x275300(0x135)+_0x17e8cc+_0x275300(0x96));if(!_0x27ca62)return console[_0x275300(0xa5)](_0x275300(0x129)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x17e8cc+_0x275300(0xb5),()=>_0x7c19b6[_0x275300(0xd1)]['deleteWorkspace'](_0x17e8cc),{'verbose':_0xab8203['verbose']}),console[_0x275300(0xa5)](_0x275300(0x12a)+_0x17e8cc+_0x275300(0xf1)),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x136);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xf2);async[a22_0x15ef4a(0xb4)](_0x384f45){const _0x24579f=a22_0x15ef4a,{options:_0xf6a73f,args:_0x2f60c2,tdx:_0x59bec2}=_0x384f45,_0x51bdb5=_0x2f60c2[0x0],_0x397dc0=resolveLimit(_0xf6a73f['limit'],DEFAULT_LLM_LIMIT),_0x516da9=_0xf6a73f,_0x1bbb8a=_0x516da9[_0x24579f(0x15b)],_0x236025=[_0x24579f(0x101),'LIVE',_0x24579f(0x98),_0x24579f(0x105)],_0x500c9c=_0x516da9[_0x24579f(0xb8)],_0x4755fc=_0x500c9c?.['toUpperCase']();if(_0x4755fc&&!_0x236025[_0x24579f(0xf8)](_0x4755fc))return console[_0x24579f(0xea)](_0x24579f(0xef)+_0x500c9c+_0x24579f(0xda)+_0x236025[_0x24579f(0xc6)](',\x20')),0x1;const _0x1b3490=await resolveWorkspaceIdFromOptions(_0x516da9,_0x59bec2,!![]),_0x4621b8=await withSpinner(_0x24579f(0x15c),()=>_0x59bec2[_0x24579f(0xd1)]['listAlwaysOnCampaigns']({'workspaceId':_0x1b3490,'type':_0x1bbb8a,'status':_0x4755fc,'limit':_0x397dc0}),{'verbose':_0xf6a73f[_0x24579f(0xf5)]});let _0x337b89=_0x4621b8[_0x24579f(0xe8)];_0x4755fc&&(_0x337b89=_0x337b89[_0x24579f(0x103)](_0x26cb97=>_0x26cb97[_0x24579f(0xb8)][_0x24579f(0x108)]()===_0x4755fc));_0x51bdb5&&(_0x337b89=_0x337b89[_0x24579f(0x103)](_0x11ab35=>matchGlobPattern(_0x11ab35[_0x24579f(0xbe)],_0x51bdb5)));const _0x343c35=_0xf6a73f['site'];if(isStructuredFormat(_0xf6a73f)){const _0x334b9c=_0x337b89[_0x24579f(0xca)](_0x252d28=>({..._0x252d28,'url':getCampaignUrl(_0x343c35,_0x252d28[_0x24579f(0xbc)],_0x252d28['id'])}));await handleSDKOutput(_0x334b9c,_0xf6a73f);}else for(const _0x4112cf of _0x337b89){const _0x36791f=a22_0x464f89[_0x24579f(0xe7)]('\x20('+_0x4112cf[_0x24579f(0xb8)][_0x24579f(0x158)]()+')'),_0x21213d=getCampaignUrl(_0x343c35,_0x4112cf[_0x24579f(0xbc)],_0x4112cf['id']),_0x2138d8=hyperlink(_0x4112cf['name'],_0x21213d);console[_0x24579f(0xa5)](_0x24579f(0xc5)+_0x2138d8+_0x36791f);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xae);[a22_0x15ef4a(0xe2)]='Show\x20always-on\x20campaign\x20details';async[a22_0x15ef4a(0xb4)](_0x2b0c1e){const _0xc488e6=a22_0x15ef4a,{options:_0x4b94dd,args:_0x598da7,tdx:_0x41adde}=_0x2b0c1e;if(_0x598da7[_0xc488e6(0x12c)]===0x0)return console[_0xc488e6(0xea)](_0xc488e6(0x139)),console[_0xc488e6(0xea)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>'),0x1;const _0x5728e1=_0x598da7[0x0],_0x2ec56e=_0x4b94dd,_0x1d11d2=await resolveWorkspaceIdFromOptions(_0x2ec56e,_0x41adde,!![]),_0x3d2925=_0x2ec56e[_0xc488e6(0x118)],_0x44e12e=_0x4b94dd[_0xc488e6(0xcc)];if(_0x3d2925){const _0x1b201c=await withSpinner(_0xc488e6(0x11b)+_0x5728e1+_0xc488e6(0xb5),()=>_0x41adde[_0xc488e6(0xd1)][_0xc488e6(0xe5)](_0x1d11d2,_0x5728e1),{'verbose':_0x4b94dd[_0xc488e6(0xf5)]}),_0xb1ee55=_0x1b201c[_0xc488e6(0xe8)],_0x5e2d72=getCampaignUrl(_0x44e12e,_0xb1ee55[_0xc488e6(0x133)][_0xc488e6(0xbc)],_0xb1ee55['id']);await handleSDKOutput([{..._0xb1ee55,'url':_0x5e2d72}],_0x4b94dd);}else{const _0x36354f=await withSpinner(_0xc488e6(0x11b)+_0x5728e1+'\x27...',()=>_0x41adde[_0xc488e6(0xd1)][_0xc488e6(0x94)](_0x1d11d2,_0x5728e1),{'verbose':_0x4b94dd['verbose']}),_0x18ded5=_0x36354f[_0xc488e6(0xe8)],_0x4ee02b=getCampaignUrl(_0x44e12e,_0x18ded5[_0xc488e6(0xbc)],_0x18ded5['id']);await handleSingleObjectOutput({..._0x18ded5,'url':_0x4ee02b},_0x4b94dd);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x100);['description']=a22_0x15ef4a(0x91);async[a22_0x15ef4a(0xb4)](_0x23f8aa){const _0x2a06b6=a22_0x15ef4a,{options:_0x1ab345,tdx:_0xf6f02a}=_0x23f8aa,_0x5ad94d=_0x1ab345,_0x639abc=_0x5ad94d[_0x2a06b6(0xbe)],_0x508366=_0x5ad94d[_0x2a06b6(0x15b)];if(!_0x639abc)return console['error'](_0x2a06b6(0xdb)),console[_0x2a06b6(0xea)](_0x2a06b6(0x111)),0x1;if(!_0x508366)return console['error'](_0x2a06b6(0x141)),console[_0x2a06b6(0xea)](_0x2a06b6(0x111)),0x1;const _0x5146b5=await resolveWorkspaceIdFromOptions(_0x5ad94d,_0xf6f02a,!![]),_0x393a3b=await resolveSegmentFromOptions(_0x5ad94d,_0xf6f02a),_0x5174f6={'name':_0x639abc,'campaignType':_0x508366,'workspaceId':_0x5146b5,'description':_0x5ad94d['description'],'audienceId':_0x393a3b['audienceId'],'audienceName':_0x393a3b['audienceName'],'enableUtmTracking':_0x5ad94d[_0x2a06b6(0x115)]},_0x422673=await withSpinner(_0x2a06b6(0xfc)+_0x639abc+_0x2a06b6(0xb5),()=>_0xf6f02a[_0x2a06b6(0xd1)][_0x2a06b6(0x11a)](_0x5146b5,_0x5174f6));return await handleSDKOutput([_0x422673[_0x2a06b6(0xe8)]],_0x1ab345),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{['name']=a22_0x15ef4a(0xb6);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xd0);async['execute'](_0xc3e622){const _0x2a4318=a22_0x15ef4a,{options:_0x47dbcd,args:_0x5cd1d4,tdx:_0x49a63c}=_0xc3e622;if(_0x5cd1d4['length']===0x0)return console[_0x2a4318(0xea)](_0x2a4318(0x139)),console[_0x2a4318(0xea)](_0x2a4318(0x132)),0x1;const _0x286970=_0x5cd1d4[0x0],_0x292496=_0x47dbcd,_0x2d846f=await resolveWorkspaceIdFromOptions(_0x292496,_0x49a63c,!![]),_0x3cfb36=await resolveSegmentFromOptions(_0x292496,_0x49a63c),_0x535620={'name':_0x292496['name'],'description':_0x292496[_0x2a4318(0xe2)],'audienceId':_0x3cfb36[_0x2a4318(0x148)],'audienceName':_0x3cfb36[_0x2a4318(0x134)],'enableUtmTracking':_0x292496[_0x2a4318(0x115)]},_0x4de48b=Object[_0x2a4318(0xec)](Object[_0x2a4318(0x9e)](_0x535620)['filter'](([,_0x4afea3])=>_0x4afea3!==undefined));if(Object['keys'](_0x4de48b)['length']===0x0)return console[_0x2a4318(0xea)](_0x2a4318(0x140)),console[_0x2a4318(0xea)](_0x2a4318(0xad)),0x1;const _0x5e0210=await withSpinner('Updating\x20always-on\x20campaign\x20\x27'+_0x286970+_0x2a4318(0xb5),()=>_0x49a63c[_0x2a4318(0xd1)][_0x2a4318(0x149)](_0x2d846f,_0x286970,_0x4de48b),{'verbose':_0x47dbcd['verbose']});return await handleSDKOutput([_0x5e0210[_0x2a4318(0xe8)]],_0x47dbcd),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x157);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xba);async[a22_0x15ef4a(0xb4)](_0x385fdd){const _0x1f25f7=a22_0x15ef4a,{options:_0x36fad0,args:_0x33d83c,tdx:_0x325acb}=_0x385fdd;if(_0x33d83c[_0x1f25f7(0x12c)]===0x0)return console[_0x1f25f7(0xea)](_0x1f25f7(0x139)),console[_0x1f25f7(0xea)](_0x1f25f7(0x10e)),0x1;const _0xd0f621=_0x33d83c[0x0],_0x41b7cc=_0x36fad0,_0x26088e=await resolveWorkspaceIdFromOptions(_0x41b7cc,_0x325acb,!![]);if(!_0x36fad0['yes']){const _0x4c1cde=await confirm(_0x1f25f7(0x131)+_0xd0f621+_0x1f25f7(0x96));if(!_0x4c1cde)return console[_0x1f25f7(0xa5)](_0x1f25f7(0x129)),0x0;}return await withSpinner(_0x1f25f7(0xb2)+_0xd0f621+'\x27...',()=>_0x325acb[_0x1f25f7(0xd1)][_0x1f25f7(0xb7)](_0x26088e,_0xd0f621),{'verbose':_0x36fad0[_0x1f25f7(0xf5)]}),console[_0x1f25f7(0xa5)](_0x1f25f7(0x104)+_0xd0f621+_0x1f25f7(0xf1)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x154);['description']=a22_0x15ef4a(0x124);async[a22_0x15ef4a(0xb4)](_0x5a3306){const _0x188646=a22_0x15ef4a,{options:_0xf9c224,args:_0x4c628e,tdx:_0x17f8db}=_0x5a3306;if(_0x4c628e['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x188646(0x10d)),0x1;const _0xa67c78=_0x4c628e[0x0],_0x30555d=_0xf9c224,_0x2fe9bd=await resolveWorkspaceIdFromOptions(_0x30555d,_0x17f8db,!![]);return await withSpinner(_0x188646(0x107)+_0xa67c78+_0x188646(0xb5),()=>_0x17f8db[_0x188646(0xd1)]['launchAlwaysOnCampaign'](_0x2fe9bd,_0xa67c78),{'verbose':_0xf9c224[_0x188646(0xf5)]}),console[_0x188646(0xa5)](_0x188646(0x104)+_0xa67c78+_0x188646(0x130)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{['name']=a22_0x15ef4a(0xc2);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xf3);async[a22_0x15ef4a(0xb4)](_0x225ead){const _0x4105f0=a22_0x15ef4a,{options:_0x47a58b,args:_0x52e07c,tdx:_0x9f9760}=_0x225ead;if(_0x52e07c['length']===0x0)return console[_0x4105f0(0xea)](_0x4105f0(0x139)),console[_0x4105f0(0xea)](_0x4105f0(0xac)),0x1;const _0x2dd909=_0x52e07c[0x0],_0xe29dd4=_0x47a58b,_0x20b6c2=await resolveWorkspaceIdFromOptions(_0xe29dd4,_0x9f9760,!![]);return await withSpinner('Pausing\x20always-on\x20campaign\x20\x27'+_0x2dd909+_0x4105f0(0xb5),()=>_0x9f9760[_0x4105f0(0xd1)][_0x4105f0(0xff)](_0x20b6c2,_0x2dd909),{'verbose':_0x47a58b['verbose']}),console[_0x4105f0(0xa5)](_0x4105f0(0x104)+_0x2dd909+_0x4105f0(0xfa)),0x0;}}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]='engage:always-on-campaign:resume';[a22_0x15ef4a(0xe2)]='Resume\x20a\x20paused\x20always-on\x20campaign';async[a22_0x15ef4a(0xb4)](_0x56cd12){const _0x5611e1=a22_0x15ef4a,{options:_0x5579b1,args:_0x44098c,tdx:_0x3c8d7f}=_0x56cd12;if(_0x44098c[_0x5611e1(0x12c)]===0x0)return console['error'](_0x5611e1(0x139)),console['error'](_0x5611e1(0x159)),0x1;const _0x581b11=_0x44098c[0x0],_0xab6b95=_0x5579b1,_0x94d5f7=await resolveWorkspaceIdFromOptions(_0xab6b95,_0x3c8d7f,!![]);return await withSpinner('Resuming\x20always-on\x20campaign\x20\x27'+_0x581b11+'\x27...',()=>_0x3c8d7f[_0x5611e1(0xd1)][_0x5611e1(0xb1)](_0x94d5f7,_0x581b11),{'verbose':_0x5579b1['verbose']}),console[_0x5611e1(0xa5)](_0x5611e1(0x104)+_0x581b11+_0x5611e1(0x14e)),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{['name']='engage:always-on-campaign:finish';[a22_0x15ef4a(0xe2)]='Finish\x20an\x20always-on\x20campaign';async[a22_0x15ef4a(0xb4)](_0x2462b3){const _0x4fca5a=a22_0x15ef4a,{options:_0x32fdaa,args:_0x30a846,tdx:_0x20bb10}=_0x2462b3;if(_0x30a846['length']===0x0)return console[_0x4fca5a(0xea)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>'),0x1;const _0x33df49=_0x30a846[0x0],_0x1b4ac2=_0x32fdaa,_0x4d622b=await resolveWorkspaceIdFromOptions(_0x1b4ac2,_0x20bb10,!![]);if(!_0x32fdaa['yes']){const _0x1993db=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27'+_0x33df49+_0x4fca5a(0x96));if(!_0x1993db)return console['log'](_0x4fca5a(0x129)),0x0;}return await withSpinner(_0x4fca5a(0x102)+_0x33df49+_0x4fca5a(0xb5),()=>_0x20bb10['engage']['finishAlwaysOnCampaign'](_0x4d622b,_0x33df49),{'verbose':_0x32fdaa[_0x4fca5a(0xf5)]}),console[_0x4fca5a(0xa5)]('Always-on\x20campaign\x20\x27'+_0x33df49+_0x4fca5a(0xc9)),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]='engage:always-on-campaign:duplicate';[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x97);async[a22_0x15ef4a(0xb4)](_0x26c6f7){const _0x31f645=a22_0x15ef4a,{options:_0x5dab04,args:_0x99d50e,tdx:_0x3a9f45}=_0x26c6f7;if(_0x99d50e[_0x31f645(0x12c)]===0x0)return console[_0x31f645(0xea)](_0x31f645(0x139)),console[_0x31f645(0xea)](_0x31f645(0x10b)),0x1;const _0x3ca3ed=_0x99d50e[0x0],_0x492172=_0x5dab04,_0x10037c=await resolveWorkspaceIdFromOptions(_0x492172,_0x3a9f45,!![]),_0x50dd70=_0x492172[_0x31f645(0xbe)],_0x474aa4=await withSpinner(_0x31f645(0x128)+_0x3ca3ed+_0x31f645(0xb5),()=>_0x3a9f45['engage'][_0x31f645(0x13f)](_0x10037c,_0x3ca3ed,_0x50dd70),{'verbose':_0x5dab04['verbose']});return await handleSDKOutput([_0x474aa4[_0x31f645(0xe8)]],_0x5dab04),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x11d);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x122);async[a22_0x15ef4a(0xb4)](_0x44c646){const _0x532dc4=a22_0x15ef4a,{options:_0x4a0763,args:_0x41c04e,tdx:_0x442211}=_0x44c646;if(_0x41c04e[_0x532dc4(0x12c)]===0x0)return console[_0x532dc4(0xea)](_0x532dc4(0xf4)),console[_0x532dc4(0xea)](_0x532dc4(0x13c)),0x1;const _0x25629c=_0x41c04e[0x0];await withSpinner(_0x532dc4(0xd6)+_0x25629c+_0x532dc4(0xb5),()=>_0x442211[_0x532dc4(0xd1)][_0x532dc4(0x120)](_0x25629c));const _0x5b212d=_0x4a0763[_0x532dc4(0xa3)]||undefined;return saveSessionContext({'engage_workspace':_0x25629c},_0x5b212d),console[_0x532dc4(0xa5)](_0x532dc4(0x13b)+_0x25629c),console[_0x532dc4(0xa5)](_0x532dc4(0xcf)),0x0;}}
@@ -1 +1 @@
1
- const a23_0x3f5677=a23_0x3089;(function(_0x10beae,_0x1cd684){const _0x212976=a23_0x3089,_0x44733e=_0x10beae();while(!![]){try{const _0x5b179f=-parseInt(_0x212976(0x110))/0x1*(-parseInt(_0x212976(0xea))/0x2)+parseInt(_0x212976(0xf0))/0x3*(parseInt(_0x212976(0x10a))/0x4)+parseInt(_0x212976(0x10e))/0x5+parseInt(_0x212976(0xfb))/0x6*(parseInt(_0x212976(0x100))/0x7)+-parseInt(_0x212976(0xfd))/0x8+-parseInt(_0x212976(0xf3))/0x9+parseInt(_0x212976(0x11e))/0xa;if(_0x5b179f===_0x1cd684)break;else _0x44733e['push'](_0x44733e['shift']());}catch(_0x4909af){_0x44733e['push'](_0x44733e['shift']());}}}(a23_0x52b8,0x2ffc8));function a23_0x52b8(){const _0x3bfd8c=['2871828STwbNc','absolutePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20unchanged\x20files','verbose','Pulling\x20templates\x20from\x20\x27','filter','diff','6eVxIMj','✔\x20All\x20files\x20are\x20up\x20to\x20date','2343952SuKwDX','\x0aError:','✔\x20Pulled\x20','1204119lekHLv','yellow','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','config','yes','content','cyan','dim','-\x20no\x20files\x20written','\x20new\x20files','8wtWwhE','repeat','\x20=\x20','\x20templates','874710aPnzzc','engage_workspace','181585fKNuWS','name','\x0aChanges\x20to\x20\x27','isNew','✔\x20Context\x20set:\x20','session','workspace','Workspace\x20is\x20required.','relativePath','workspaceName','execute','engage:template:pull','dryRun','description','956730Tgxdaw','\x20\x20Target:\x20','length','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','green','templates','\x0aPull\x20summary\x20for\x20workspace\x20\x27','counts','data','4jTtWPQ','No\x20templates\x20found\x20in\x20workspace\x20\x27','hasChanges','red','error','Aborted.','4254zlDksr','files','\x20files\x20to\x20'];a23_0x52b8=function(){return _0x3bfd8c;};return a23_0x52b8();}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';function a23_0x3089(_0x45f1f7,_0x10bf14){_0x45f1f7=_0x45f1f7-0xe9;const _0x52b872=a23_0x52b8();let _0x308953=_0x52b872[_0x45f1f7];return _0x308953;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a23_0xe52875 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x56c751 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x3f5677(0x111)]=a23_0x3f5677(0x11b);[a23_0x3f5677(0x11d)]='Pull\x20templates\x20to\x20YAML\x20files';async[a23_0x3f5677(0x11a)](_0x2c437b){const _0x2554b1=a23_0x3f5677,{options:_0x53104d,args:_0x555aa4,tdx:_0xdabfc6}=_0x2c437b,_0x3e072a=_0x53104d,_0xa8cb07=await resolveWorkspaceName(_0x555aa4[0x0],_0x3e072a);if(!_0xa8cb07)return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x101)](_0x2554b1(0x117))),console[_0x2554b1(0xee)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console['error'](_0x2554b1(0x122)),console[_0x2554b1(0xee)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x19ee35=await withProgressSpinner(_0x2554b1(0xf8)+_0xa8cb07+'\x27...',_0x653b64=>pullTemplates({'engage':_0xdabfc6['engage']},_0xa8cb07,{'templateName':_0x3e072a['name'],'progress':{'update':_0x3f7b0f=>{_0x653b64['setPhase'](_0x3f7b0f);}}}),{'verbose':_0x3e072a[_0x2554b1(0xf7)]}),_0x5ba044=_0x19ee35[_0x2554b1(0xe9)];if(_0x5ba044['counts'][_0x2554b1(0x125)]===0x0)return console['error'](a23_0xe52875[_0x2554b1(0x101)](_0x2554b1(0xeb)+_0x5ba044[_0x2554b1(0x119)]+'\x27')),0x0;const _0x55ee36=_0x5ba044[_0x2554b1(0xf1)]['filter'](_0x463036=>_0x463036[_0x2554b1(0x113)]),_0x566846=_0x5ba044[_0x2554b1(0xf1)][_0x2554b1(0xf9)](_0x73a65=>!_0x73a65[_0x2554b1(0x113)]&&_0x73a65['hasChanges']),_0x92382a=_0x5ba044[_0x2554b1(0xf1)][_0x2554b1(0xf9)](_0x898a31=>!_0x898a31[_0x2554b1(0x113)]&&!_0x898a31['hasChanges']);console[_0x2554b1(0xee)](_0x2554b1(0x126)+_0x5ba044[_0x2554b1(0x119)]+'\x27:'),console[_0x2554b1(0xee)]('\x20\x20'+a23_0xe52875[_0x2554b1(0x106)](_0x5ba044[_0x2554b1(0x127)][_0x2554b1(0x125)]+_0x2554b1(0x10d))),console[_0x2554b1(0xee)]('\x20\x20'+a23_0xe52875[_0x2554b1(0x124)]('+\x20'+_0x55ee36[_0x2554b1(0x120)]+_0x2554b1(0x109))),console[_0x2554b1(0xee)]('\x20\x20'+a23_0xe52875['yellow']('~\x20'+_0x566846[_0x2554b1(0x120)]+'\x20changed\x20files')),console[_0x2554b1(0xee)]('\x20\x20'+a23_0xe52875[_0x2554b1(0x107)]('=\x20'+_0x92382a[_0x2554b1(0x120)]+_0x2554b1(0xf6))),console[_0x2554b1(0xee)](_0x2554b1(0x11f)+a23_0xe52875[_0x2554b1(0x106)](_0x5ba044['targetDir'])+'\x0a');if(_0x566846['length']>0x0)for(const _0x5c2fa7 of _0x566846){console[_0x2554b1(0xee)](_0x2554b1(0x112)+_0x5c2fa7[_0x2554b1(0x118)]+'\x27:'),console[_0x2554b1(0xee)]('─'[_0x2554b1(0x10b)](0x3c)),console['error'](_0x5c2fa7[_0x2554b1(0xfa)]),console['error']('─'[_0x2554b1(0x10b)](0x3c));}if(_0x3e072a[_0x2554b1(0x11c)])return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x101)](_0x2554b1(0xf5))),0x0;if(_0x55ee36['length']===0x0&&_0x566846['length']===0x0)return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x124)](_0x2554b1(0xfc))),saveSessionContext({'engage_workspace':_0x5ba044[_0x2554b1(0x119)]},_0x3e072a['session']),0x0;if(!_0x3e072a[_0x2554b1(0x104)]){if(!isInteractive())return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0xed)](_0x2554b1(0xfe)),_0x2554b1(0x123)),console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x107)](_0x2554b1(0x102))),0x1;const _0x416f91=await confirmKey('Write\x20'+(_0x55ee36[_0x2554b1(0x120)]+_0x566846[_0x2554b1(0x120)])+_0x2554b1(0x121));if(!_0x416f91)return console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x101)](_0x2554b1(0xef)),_0x2554b1(0x108)),0x1;}for(const _0x14b4d4 of _0x5ba044[_0x2554b1(0xf1)]){if(_0x14b4d4[_0x2554b1(0x113)]||_0x14b4d4[_0x2554b1(0xec)]){const _0x53fae0=a23_0x56c751['dirname'](_0x14b4d4['absolutePath']);!existsSync(_0x53fae0)&&mkdirSync(_0x53fae0,{'recursive':!![]}),writeFileSync(_0x14b4d4[_0x2554b1(0xf4)],_0x14b4d4[_0x2554b1(0x105)],'utf-8');}}return console['error'](a23_0xe52875[_0x2554b1(0x124)](_0x2554b1(0xff)+(_0x55ee36[_0x2554b1(0x120)]+_0x566846[_0x2554b1(0x120)])+_0x2554b1(0xf2)+_0x5ba044['targetDir'])),saveSessionContext({'engage_workspace':_0x5ba044[_0x2554b1(0x119)]},_0x3e072a['session']),console[_0x2554b1(0xee)](a23_0xe52875[_0x2554b1(0x124)](_0x2554b1(0x114)+a23_0xe52875[_0x2554b1(0x107)](_0x2554b1(0x10f))+_0x2554b1(0x10c)+a23_0xe52875[_0x2554b1(0x106)](_0x5ba044[_0x2554b1(0x119)]))),0x0;}}async function resolveWorkspaceName(_0x200793,_0x33e45e){const _0x2bea50=a23_0x3f5677;if(_0x200793)return _0x200793;if(_0x33e45e[_0x2bea50(0x116)])return _0x33e45e[_0x2bea50(0x116)];const _0xe6af16=tryFindTdxConfig(process['cwd']());if(_0xe6af16?.[_0x2bea50(0x103)][_0x2bea50(0x10f)])return _0xe6af16['config'][_0x2bea50(0x10f)];const _0x39a89f=loadSessionContext(_0x33e45e[_0x2bea50(0x115)]);if(_0x39a89f?.[_0x2bea50(0x10f)])return _0x39a89f[_0x2bea50(0x10f)];return undefined;}
1
+ const a23_0x1aa8ac=a23_0x5332;function a23_0x5332(_0x4c0736,_0x438aec){_0x4c0736=_0x4c0736-0x7f;const _0x7cfa82=a23_0x7cfa();let _0x533277=_0x7cfa82[_0x4c0736];return _0x533277;}(function(_0x2ef960,_0x5a8175){const _0x4ae61e=a23_0x5332,_0x2796ca=_0x2ef960();while(!![]){try{const _0x572e27=-parseInt(_0x4ae61e(0x90))/0x1*(parseInt(_0x4ae61e(0x8a))/0x2)+parseInt(_0x4ae61e(0x92))/0x3*(parseInt(_0x4ae61e(0x98))/0x4)+parseInt(_0x4ae61e(0x9d))/0x5*(-parseInt(_0x4ae61e(0xaf))/0x6)+parseInt(_0x4ae61e(0x91))/0x7+-parseInt(_0x4ae61e(0xbd))/0x8+parseInt(_0x4ae61e(0xbf))/0x9*(parseInt(_0x4ae61e(0xb9))/0xa)+-parseInt(_0x4ae61e(0xa9))/0xb;if(_0x572e27===_0x5a8175)break;else _0x2796ca['push'](_0x2796ca['shift']());}catch(_0x28a6c5){_0x2796ca['push'](_0x2796ca['shift']());}}}(a23_0x7cfa,0x6557e));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 a23_0x545f4d from'chalk';function a23_0x7cfa(){const _0x30a39e=['dryRun','config','absolutePath','✔\x20All\x20files\x20are\x20up\x20to\x20date','232yxlQgk','cwd','description','\x20=\x20','\x20changed\x20files','405aCSdVQ','yes','diff','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','workspace','relativePath','isNew','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','-\x20no\x20files\x20written','error','targetDir','content','3839605kbtAmf','session','cyan','yellow','length','execute','33168aUBKMF','\x20files?','\x0aPull\x20summary\x20for\x20workspace\x20\x27','filter','hasChanges','templates','\x27...','repeat','Aborted.','\x20\x20Target:\x20','8294570ethIFK','engage_workspace','workspaceName','dirname','2405520eWCWCj','\x20templates','9TgZDbK','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','red','\x0aChanges\x20to\x20\x27','data','green','name','files','Pull\x20templates\x20to\x20YAML\x20files','✔\x20Pulled\x20','\x20unchanged\x20files','Pulling\x20templates\x20from\x20\x27','dim','33786mxGCZb','engage','\x20files\x20to\x20','Write\x20','counts','\x20new\x20files','33GPWphi','4589067saBete','30261buwkVr','✔\x20Context\x20set:\x20'];a23_0x7cfa=function(){return _0x30a39e;};return a23_0x7cfa();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x4a118b from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x1aa8ac(0x83)]='engage:template:pull';[a23_0x1aa8ac(0x9a)]=a23_0x1aa8ac(0x85);async[a23_0x1aa8ac(0xae)](_0x154909){const _0x18971e=a23_0x1aa8ac,{options:_0x4af943,args:_0x16f817,tdx:_0x2c230f}=_0x154909,_0x5ce33a=_0x4af943,_0xcd0b0a=await resolveWorkspaceName(_0x16f817[0x0],_0x5ce33a);if(!_0xcd0b0a)return console['error'](a23_0x545f4d[_0x18971e(0xac)]('Workspace\x20is\x20required.')),console[_0x18971e(0xa6)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console['error'](_0x18971e(0xc0)),console[_0x18971e(0xa6)](_0x18971e(0xa0)),0x1;const _0x1095ef=await withProgressSpinner(_0x18971e(0x88)+_0xcd0b0a+_0x18971e(0xb5),_0x329fd0=>pullTemplates({'engage':_0x2c230f[_0x18971e(0x8b)]},_0xcd0b0a,{'templateName':_0x5ce33a[_0x18971e(0x83)],'progress':{'update':_0x1afdab=>{_0x329fd0['setPhase'](_0x1afdab);}}}),{'verbose':_0x5ce33a['verbose']}),_0x27f422=_0x1095ef[_0x18971e(0x81)];if(_0x27f422[_0x18971e(0x8e)]['templates']===0x0)return console['error'](a23_0x545f4d[_0x18971e(0xac)]('No\x20templates\x20found\x20in\x20workspace\x20\x27'+_0x27f422[_0x18971e(0xbb)]+'\x27')),0x0;const _0x55e394=_0x27f422[_0x18971e(0x84)][_0x18971e(0xb2)](_0x2b8744=>_0x2b8744[_0x18971e(0xa3)]),_0x56568f=_0x27f422['files']['filter'](_0x4c3e60=>!_0x4c3e60[_0x18971e(0xa3)]&&_0x4c3e60[_0x18971e(0xb3)]),_0x2aa071=_0x27f422[_0x18971e(0x84)][_0x18971e(0xb2)](_0x1929d6=>!_0x1929d6[_0x18971e(0xa3)]&&!_0x1929d6[_0x18971e(0xb3)]);console['error'](_0x18971e(0xb1)+_0x27f422['workspaceName']+'\x27:'),console[_0x18971e(0xa6)]('\x20\x20'+a23_0x545f4d['cyan'](_0x27f422[_0x18971e(0x8e)][_0x18971e(0xb4)]+_0x18971e(0xbe))),console[_0x18971e(0xa6)]('\x20\x20'+a23_0x545f4d[_0x18971e(0x82)]('+\x20'+_0x55e394[_0x18971e(0xad)]+_0x18971e(0x8f))),console['error']('\x20\x20'+a23_0x545f4d[_0x18971e(0xac)]('~\x20'+_0x56568f[_0x18971e(0xad)]+_0x18971e(0x9c))),console[_0x18971e(0xa6)]('\x20\x20'+a23_0x545f4d[_0x18971e(0x89)]('=\x20'+_0x2aa071[_0x18971e(0xad)]+_0x18971e(0x87))),console[_0x18971e(0xa6)](_0x18971e(0xb8)+a23_0x545f4d[_0x18971e(0xab)](_0x27f422[_0x18971e(0xa7)])+'\x0a');if(_0x56568f[_0x18971e(0xad)]>0x0)for(const _0x126cd5 of _0x56568f){console[_0x18971e(0xa6)](_0x18971e(0x80)+_0x126cd5[_0x18971e(0xa2)]+'\x27:'),console[_0x18971e(0xa6)]('─'[_0x18971e(0xb6)](0x3c)),console[_0x18971e(0xa6)](_0x126cd5[_0x18971e(0x9f)]),console[_0x18971e(0xa6)]('─'['repeat'](0x3c));}if(_0x5ce33a[_0x18971e(0x94)])return console[_0x18971e(0xa6)](a23_0x545f4d[_0x18971e(0xac)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x55e394[_0x18971e(0xad)]===0x0&&_0x56568f['length']===0x0)return console[_0x18971e(0xa6)](a23_0x545f4d[_0x18971e(0x82)](_0x18971e(0x97))),saveSessionContext({'engage_workspace':_0x27f422[_0x18971e(0xbb)]},_0x5ce33a[_0x18971e(0xaa)]),0x0;if(!_0x5ce33a[_0x18971e(0x9e)]){if(!isInteractive())return console[_0x18971e(0xa6)](a23_0x545f4d[_0x18971e(0x7f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x18971e(0xa6)](a23_0x545f4d['dim'](_0x18971e(0xa4))),0x1;const _0x506e47=await confirmKey(_0x18971e(0x8d)+(_0x55e394[_0x18971e(0xad)]+_0x56568f[_0x18971e(0xad)])+_0x18971e(0xb0));if(!_0x506e47)return console[_0x18971e(0xa6)](a23_0x545f4d[_0x18971e(0xac)](_0x18971e(0xb7)),_0x18971e(0xa5)),0x1;}for(const _0x1b555b of _0x27f422['files']){if(_0x1b555b[_0x18971e(0xa3)]||_0x1b555b[_0x18971e(0xb3)]){const _0x36cd0a=a23_0x4a118b[_0x18971e(0xbc)](_0x1b555b[_0x18971e(0x96)]);!existsSync(_0x36cd0a)&&mkdirSync(_0x36cd0a,{'recursive':!![]}),writeFileSync(_0x1b555b[_0x18971e(0x96)],_0x1b555b[_0x18971e(0xa8)],'utf-8');}}return console['error'](a23_0x545f4d[_0x18971e(0x82)](_0x18971e(0x86)+(_0x55e394[_0x18971e(0xad)]+_0x56568f[_0x18971e(0xad)])+_0x18971e(0x8c)+_0x27f422[_0x18971e(0xa7)])),saveSessionContext({'engage_workspace':_0x27f422['workspaceName']},_0x5ce33a[_0x18971e(0xaa)]),console['error'](a23_0x545f4d[_0x18971e(0x82)](_0x18971e(0x93)+a23_0x545f4d[_0x18971e(0x89)](_0x18971e(0xba))+_0x18971e(0x9b)+a23_0x545f4d[_0x18971e(0xab)](_0x27f422[_0x18971e(0xbb)]))),0x0;}}async function resolveWorkspaceName(_0x221722,_0x13d605){const _0x12119e=a23_0x1aa8ac;if(_0x221722)return _0x221722;if(_0x13d605[_0x12119e(0xa1)])return _0x13d605[_0x12119e(0xa1)];const _0x5e1b2d=tryFindTdxConfig(process[_0x12119e(0x99)]());if(_0x5e1b2d?.[_0x12119e(0x95)][_0x12119e(0xba)])return _0x5e1b2d[_0x12119e(0x95)][_0x12119e(0xba)];const _0x423129=loadSessionContext(_0x13d605[_0x12119e(0xaa)]);if(_0x423129?.[_0x12119e(0xba)])return _0x423129[_0x12119e(0xba)];return undefined;}
@@ -1 +1 @@
1
- const a24_0x54df44=a24_0x2f19;(function(_0x112fab,_0x1c7dfa){const _0xd66ee5=a24_0x2f19,_0x591355=_0x112fab();while(!![]){try{const _0x332326=parseInt(_0xd66ee5(0x162))/0x1+parseInt(_0xd66ee5(0x14d))/0x2+-parseInt(_0xd66ee5(0x15b))/0x3+-parseInt(_0xd66ee5(0x130))/0x4*(parseInt(_0xd66ee5(0x13c))/0x5)+parseInt(_0xd66ee5(0x12d))/0x6+-parseInt(_0xd66ee5(0x134))/0x7*(parseInt(_0xd66ee5(0x12b))/0x8)+parseInt(_0xd66ee5(0x156))/0x9*(parseInt(_0xd66ee5(0x150))/0xa);if(_0x332326===_0x1c7dfa)break;else _0x591355['push'](_0x591355['shift']());}catch(_0x4c5b41){_0x591355['push'](_0x591355['shift']());}}}(a24_0x7090,0x55d66));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a24_0x2f19(_0x42ae06,_0x429a19){_0x42ae06=_0x42ae06-0x11d;const _0x709012=a24_0x7090();let _0x2f1906=_0x709012[_0x42ae06];return _0x2f1906;}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a24_0x7090(){const _0x4300b8=['engage:template:push','results','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\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','\x20templates','filter','No\x20template\x20YAML\x20files\x20found\x20in\x20','Aborted.','\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','templateId','def','1\x20template\x20file:\x20','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x20template\x20files','yes','length','verbose','updated','56gzZdDW','resolve','1950672WKTnQP','action','engage_workspace','1144KMgfIT','description','errors','engage','220339pPjKOm','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Updated\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)','dirname','Pushing\x20templates...','execute','name','355QUBKST','red','create','\x20new\x20templates:','dim','✔\x20All\x20templates\x20are\x20up\x20to\x20date','config','dryRun','warnings','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aValidation\x20errors\x20in\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','Found\x20','error','path','Resolving\x20references...','Preparing\x20push\x20to\x20workspace\x20\x27','80974rtUpiV','\x20templates?','session','2785190OsrkRJ','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','workspace','\x20\x20\x20\x20','Workspace\x20is\x20required.','\x27...','9RxCDsw','created','\x20errors:','green','yellow','1993788UTKQDp','cwd','✔\x20Created\x20','site','setPhase','configDir','\x0aPush\x20summary\x20for\x20workspace\x20\x27','612713wCPtSN','data','\x0aError:'];a24_0x7090=function(){return _0x4300b8;};return a24_0x7090();}import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x55c4ca from'chalk';import a24_0x2cd2a9 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x54df44(0x13b)]=a24_0x54df44(0x165);[a24_0x54df44(0x131)]=a24_0x54df44(0x147);async[a24_0x54df44(0x13a)](_0x1fa666){const _0x8cfd28=a24_0x54df44,{options:_0x62dff0,args:_0x14380b,tdx:_0x4890fc}=_0x1fa666,_0x26f912=_0x62dff0,_0x2381f6=_0x14380b[0x0],_0xef54a6=_0x2381f6?a24_0x2cd2a9[_0x8cfd28(0x12c)](_0x2381f6):undefined,_0x4b6115=_0xef54a6?isYamlFile(_0xef54a6):![];let _0x451d0d;if(_0x4b6115&&_0xef54a6)_0x451d0d=a24_0x2cd2a9[_0x8cfd28(0x138)](_0xef54a6);else _0xef54a6?_0x451d0d=_0xef54a6:_0x451d0d=process[_0x8cfd28(0x15c)]();let _0x4176a6;const _0x2f6343=tryFindTdxConfig(_0x451d0d);_0x2f6343?.['config'][_0x8cfd28(0x12f)]&&(_0x4176a6=_0x2f6343[_0x8cfd28(0x142)][_0x8cfd28(0x12f)],!_0x4b6115&&(_0x451d0d=_0x2f6343[_0x8cfd28(0x160)]));_0x26f912['workspace']&&(_0x4176a6=_0x26f912[_0x8cfd28(0x152)]);if(!_0x4176a6){const _0x22cc55=loadSessionContext(_0x26f912['session']);_0x22cc55?.[_0x8cfd28(0x12f)]&&(_0x4176a6=_0x22cc55[_0x8cfd28(0x12f)]);}if(!_0x4176a6)return console['error'](a24_0x55c4ca[_0x8cfd28(0x15a)](_0x8cfd28(0x154))),console[_0x8cfd28(0x149)](_0x8cfd28(0x168)),console[_0x8cfd28(0x149)](_0x8cfd28(0x137)),console[_0x8cfd28(0x149)](_0x8cfd28(0x121)),console['error'](_0x8cfd28(0x145)),0x1;let _0x4efc91;_0x4b6115&&_0xef54a6?_0x4efc91=[parseTemplateFile(_0xef54a6,a24_0x2cd2a9[_0x8cfd28(0x138)](_0xef54a6))]:_0x4efc91=discoverAndParseTemplateFiles(_0x451d0d);if(_0x4efc91[_0x8cfd28(0x128)]===0x0)return console['error'](a24_0x55c4ca[_0x8cfd28(0x15a)](_0x8cfd28(0x11f)+_0x451d0d)),console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x140)](_0x8cfd28(0x125))),0x1;const _0x2cc601=_0x4efc91[_0x8cfd28(0x128)]===0x1?_0x8cfd28(0x124)+_0x4efc91[0x0][_0x8cfd28(0x123)]['name']:_0x4efc91[_0x8cfd28(0x128)]+_0x8cfd28(0x126);console[_0x8cfd28(0x149)](_0x8cfd28(0x148)+a24_0x55c4ca['cyan'](_0x2cc601));let _0x3b5957=![];for(const _0x2d1ed7 of _0x4efc91){const _0x597072=validateTemplateDef(_0x2d1ed7['def']);if(!_0x597072['valid']){_0x3b5957=!![],console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x13d)](_0x8cfd28(0x146)+_0x2d1ed7['relativePath']+':'));for(const _0x317e77 of _0x597072[_0x8cfd28(0x132)]){console['error']('\x20\x20'+a24_0x55c4ca[_0x8cfd28(0x13d)]('✗')+'\x20'+_0x317e77['path']+':\x20'+_0x317e77['message']);}}for(const _0x290644 of _0x597072[_0x8cfd28(0x144)]){console[_0x8cfd28(0x149)]('\x20\x20'+a24_0x55c4ca['yellow']('⚠')+'\x20'+_0x290644[_0x8cfd28(0x14a)]+':\x20'+_0x290644['message']);}}if(_0x3b5957)return console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x13d)](_0x8cfd28(0x151))),0x1;const _0x43c522=await _0x4890fc['engage']['resolveWorkspaceId'](_0x4176a6),_0x3bf7b3=await withProgressSpinner(_0x8cfd28(0x14c)+_0x4176a6+_0x8cfd28(0x155),_0x37d852=>preparePush({'engage':_0x4890fc['engage']},_0x4efc91,_0x43c522,{'progress':{'update':_0x46566b=>_0x37d852[_0x8cfd28(0x15f)](_0x46566b)}}),{'verbose':_0x26f912[_0x8cfd28(0x129)]}),_0x35d660=_0x3bf7b3[_0x8cfd28(0x163)];await withProgressSpinner(_0x8cfd28(0x14b),_0x11437e=>resolveAndBuildInputs({'engage':_0x4890fc[_0x8cfd28(0x133)]},_0x35d660,_0x43c522,{'progress':{'update':_0x426558=>_0x11437e['setPhase'](_0x426558)}}),{'verbose':_0x26f912[_0x8cfd28(0x129)]});const _0x183072=_0x35d660[_0x8cfd28(0x11e)](_0x25813b=>_0x25813b['action']===_0x8cfd28(0x13e)),_0x30766e=_0x35d660[_0x8cfd28(0x11e)](_0x42da86=>_0x42da86['action']==='update');console['error'](_0x8cfd28(0x161)+_0x4176a6+'\x27:');if(_0x183072['length']>0x0){console[_0x8cfd28(0x149)]('\x20\x20'+a24_0x55c4ca['green']('+\x20'+_0x183072[_0x8cfd28(0x128)]+_0x8cfd28(0x13f)));for(const _0x5e4e8b of _0x183072){console[_0x8cfd28(0x149)](_0x8cfd28(0x153)+a24_0x55c4ca[_0x8cfd28(0x159)]('+')+'\x20'+_0x5e4e8b['def'][_0x8cfd28(0x13b)]);}}if(_0x30766e[_0x8cfd28(0x128)]>0x0){console['error']('\x20\x20'+a24_0x55c4ca[_0x8cfd28(0x15a)]('~\x20'+_0x30766e[_0x8cfd28(0x128)]+'\x20templates\x20to\x20update:'));for(const _0x85d86c of _0x30766e){console[_0x8cfd28(0x149)](_0x8cfd28(0x153)+a24_0x55c4ca[_0x8cfd28(0x15a)]('~')+'\x20'+_0x85d86c[_0x8cfd28(0x123)][_0x8cfd28(0x13b)]);}}if(_0x183072[_0x8cfd28(0x128)]===0x0&&_0x30766e[_0x8cfd28(0x128)]===0x0)return console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x159)](_0x8cfd28(0x141))),0x0;if(_0x26f912[_0x8cfd28(0x143)])return console['error'](a24_0x55c4ca[_0x8cfd28(0x15a)](_0x8cfd28(0x167))),0x0;if(!_0x26f912[_0x8cfd28(0x127)]){if(!isInteractive())return console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x13d)](_0x8cfd28(0x164)),_0x8cfd28(0x135)),console['error'](a24_0x55c4ca[_0x8cfd28(0x140)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3fc99a=await confirmKey('Push\x20'+(_0x183072[_0x8cfd28(0x128)]+_0x30766e[_0x8cfd28(0x128)])+_0x8cfd28(0x14e));if(!_0x3fc99a)return console[_0x8cfd28(0x149)](a24_0x55c4ca['yellow'](_0x8cfd28(0x120)),'-\x20no\x20changes\x20applied'),0x1;}const _0x25f0a3=await withProgressSpinner(_0x8cfd28(0x139),_0x3ef8e4=>executePush({'engage':_0x4890fc[_0x8cfd28(0x133)]},_0x35d660,{'progress':{'update':_0x41712e=>_0x3ef8e4[_0x8cfd28(0x15f)](_0x41712e)}}),{'verbose':_0x26f912['verbose']}),_0x344cf8=_0x25f0a3[_0x8cfd28(0x163)];for(const _0xc17d19 of _0x344cf8[_0x8cfd28(0x166)]){if(_0xc17d19[_0x8cfd28(0x122)]&&(_0xc17d19[_0x8cfd28(0x12e)]==='created'||_0xc17d19[_0x8cfd28(0x12e)]===_0x8cfd28(0x12a))){const _0x1f5fb2=getTemplateUrl(_0x26f912[_0x8cfd28(0x15e)],_0x43c522,_0xc17d19[_0x8cfd28(0x122)]),_0x23e239=_0xc17d19[_0x8cfd28(0x12e)]===_0x8cfd28(0x157)?'+':'~',_0x270e24=_0xc17d19['action']===_0x8cfd28(0x157)?a24_0x55c4ca['green'](_0x23e239):a24_0x55c4ca[_0x8cfd28(0x15a)](_0x23e239);console[_0x8cfd28(0x149)]('\x20\x20'+_0x270e24+'\x20'+hyperlink(_0xc17d19['name'],_0x1f5fb2)+'\x20'+a24_0x55c4ca[_0x8cfd28(0x140)](_0x1f5fb2));}}_0x344cf8[_0x8cfd28(0x157)]>0x0&&console[_0x8cfd28(0x149)](a24_0x55c4ca['green'](_0x8cfd28(0x15d)+_0x344cf8['created']+_0x8cfd28(0x11d)));_0x344cf8[_0x8cfd28(0x12a)]>0x0&&console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x159)](_0x8cfd28(0x136)+_0x344cf8[_0x8cfd28(0x12a)]+_0x8cfd28(0x11d)));if(_0x344cf8[_0x8cfd28(0x132)]['length']>0x0){console[_0x8cfd28(0x149)](a24_0x55c4ca[_0x8cfd28(0x13d)]('✘\x20'+_0x344cf8[_0x8cfd28(0x132)][_0x8cfd28(0x128)]+_0x8cfd28(0x158)));for(const _0xc8380c of _0x344cf8[_0x8cfd28(0x132)]){console['error']('\x20\x20'+a24_0x55c4ca[_0x8cfd28(0x13d)](_0xc8380c[_0x8cfd28(0x13b)])+':\x20'+_0xc8380c['error']);}}return saveSessionContext({'engage_workspace':_0x4176a6},_0x26f912[_0x8cfd28(0x14f)]),_0x344cf8[_0x8cfd28(0x132)][_0x8cfd28(0x128)]>0x0?0x1:0x0;}}
1
+ const a24_0x5f50c7=a24_0x56a2;function a24_0x4793(){const _0x2a1989=['red','configDir','path','Workspace\x20is\x20required.','33512940JZzead','7109176QeoHyO','error','458072OfyhRj','\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','Pushing\x20templates...','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','resolveWorkspaceId','action','filter','message','length','\x0aPush\x20summary\x20for\x20workspace\x20\x27','create','session','workspace','yellow','dirname','\x20\x20\x20\x20','✔\x20All\x20templates\x20are\x20up\x20to\x20date','50508skimgd','\x0aError:','engage_workspace','-\x20no\x20changes\x20applied','green','def','Preparing\x20push\x20to\x20workspace\x20\x27','setPhase','\x27...','No\x20template\x20YAML\x20files\x20found\x20in\x20','warnings','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','7998192mhSwMk','config','\x20templates?','1752530YtwNzu','name','\x20template\x20files','14LzumeT','description','created','7smoYls','errors','engage','resolve','dryRun','updated','dim','\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','4600206BjvJjc','cyan','data','Found\x20','1\x20template\x20file:\x20','Resolving\x20references...','\x20templates\x20to\x20update:','\x20templates','engage:template:push','64GgNXez','valid','execute','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aValidation\x20errors\x20in\x20','\x20new\x20templates:'];a24_0x4793=function(){return _0x2a1989;};return a24_0x4793();}(function(_0x9286ee,_0x1f4616){const _0xec2e85=a24_0x56a2,_0x97d95=_0x9286ee();while(!![]){try{const _0x4ff3ba=-parseInt(_0xec2e85(0x1ad))/0x1*(parseInt(_0xec2e85(0x1cb))/0x2)+parseInt(_0xec2e85(0x1dc))/0x3*(-parseInt(_0xec2e85(0x1be))/0x4)+-parseInt(_0xec2e85(0x1eb))/0x5+-parseInt(_0xec2e85(0x1b5))/0x6*(-parseInt(_0xec2e85(0x1ee))/0x7)+-parseInt(_0xec2e85(0x1c9))/0x8+-parseInt(_0xec2e85(0x1e8))/0x9+parseInt(_0xec2e85(0x1c8))/0xa;if(_0x4ff3ba===_0x1f4616)break;else _0x97d95['push'](_0x97d95['shift']());}catch(_0x165089){_0x97d95['push'](_0x97d95['shift']());}}}(a24_0x4793,0xd7e03));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';function a24_0x56a2(_0x527d0c,_0x329499){_0x527d0c=_0x527d0c-0x1ad;const _0x479360=a24_0x4793();let _0x56a228=_0x479360[_0x527d0c];return _0x56a228;}import a24_0x2a6e19 from'chalk';import a24_0x58ffae from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x5f50c7(0x1ec)]=a24_0x5f50c7(0x1bd);[a24_0x5f50c7(0x1ef)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x5f50c7(0x1c0)](_0x3de497){const _0x5d9b7b=a24_0x5f50c7,{options:_0x53dc1f,args:_0x4abd1a,tdx:_0x21eaf2}=_0x3de497,_0x4cb843=_0x53dc1f,_0x1a8b9f=_0x4abd1a[0x0],_0x56a1ec=_0x1a8b9f?a24_0x58ffae[_0x5d9b7b(0x1b0)](_0x1a8b9f):undefined,_0x4fbadf=_0x56a1ec?isYamlFile(_0x56a1ec):![];let _0xb13313;if(_0x4fbadf&&_0x56a1ec)_0xb13313=a24_0x58ffae[_0x5d9b7b(0x1d9)](_0x56a1ec);else _0x56a1ec?_0xb13313=_0x56a1ec:_0xb13313=process['cwd']();let _0x3fde1e;const _0x20e82b=tryFindTdxConfig(_0xb13313);_0x20e82b?.[_0x5d9b7b(0x1e9)]['engage_workspace']&&(_0x3fde1e=_0x20e82b['config'][_0x5d9b7b(0x1de)],!_0x4fbadf&&(_0xb13313=_0x20e82b[_0x5d9b7b(0x1c5)]));_0x4cb843[_0x5d9b7b(0x1d7)]&&(_0x3fde1e=_0x4cb843[_0x5d9b7b(0x1d7)]);if(!_0x3fde1e){const _0x1e8a04=loadSessionContext(_0x4cb843[_0x5d9b7b(0x1d6)]);_0x1e8a04?.[_0x5d9b7b(0x1de)]&&(_0x3fde1e=_0x1e8a04['engage_workspace']);}if(!_0x3fde1e)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1c7))),console['error'](_0x5d9b7b(0x1cc)),console[_0x5d9b7b(0x1ca)]('\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)'),console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1b4)),console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1c1)),0x1;let _0x4bad18;_0x4fbadf&&_0x56a1ec?_0x4bad18=[parseTemplateFile(_0x56a1ec,a24_0x58ffae[_0x5d9b7b(0x1d9)](_0x56a1ec))]:_0x4bad18=discoverAndParseTemplateFiles(_0xb13313);if(_0x4bad18[_0x5d9b7b(0x1d3)]===0x0)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1e5)+_0xb13313)),console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1b3)](_0x5d9b7b(0x1ce))),0x1;const _0x470f16=_0x4bad18[_0x5d9b7b(0x1d3)]===0x1?_0x5d9b7b(0x1b9)+_0x4bad18[0x0][_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]:_0x4bad18[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1ed);console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1b8)+a24_0x2a6e19[_0x5d9b7b(0x1b6)](_0x470f16));let _0x48cf57=![];for(const _0xc1a588 of _0x4bad18){const _0x25b032=validateTemplateDef(_0xc1a588['def']);if(!_0x25b032[_0x5d9b7b(0x1bf)]){_0x48cf57=!![],console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)](_0x5d9b7b(0x1c2)+_0xc1a588['relativePath']+':'));for(const _0x5035f0 of _0x25b032[_0x5d9b7b(0x1ae)]){console['error']('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1c4)]('✗')+'\x20'+_0x5035f0['path']+':\x20'+_0x5035f0[_0x5d9b7b(0x1d2)]);}}for(const _0x1ef662 of _0x25b032[_0x5d9b7b(0x1e6)]){console['error']('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('⚠')+'\x20'+_0x1ef662[_0x5d9b7b(0x1c6)]+':\x20'+_0x1ef662[_0x5d9b7b(0x1d2)]);}}if(_0x48cf57)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x435a61=await _0x21eaf2['engage'][_0x5d9b7b(0x1cf)](_0x3fde1e),_0x5e9ce5=await withProgressSpinner(_0x5d9b7b(0x1e2)+_0x3fde1e+_0x5d9b7b(0x1e4),_0x2f8fd1=>preparePush({'engage':_0x21eaf2[_0x5d9b7b(0x1af)]},_0x4bad18,_0x435a61,{'progress':{'update':_0x4786ed=>_0x2f8fd1[_0x5d9b7b(0x1e3)](_0x4786ed)}}),{'verbose':_0x4cb843['verbose']}),_0x1ac2c7=_0x5e9ce5[_0x5d9b7b(0x1b7)];await withProgressSpinner(_0x5d9b7b(0x1ba),_0x1a9e9e=>resolveAndBuildInputs({'engage':_0x21eaf2['engage']},_0x1ac2c7,_0x435a61,{'progress':{'update':_0x27461e=>_0x1a9e9e[_0x5d9b7b(0x1e3)](_0x27461e)}}),{'verbose':_0x4cb843['verbose']});const _0x4b6a86=_0x1ac2c7[_0x5d9b7b(0x1d1)](_0x405efb=>_0x405efb['action']===_0x5d9b7b(0x1d5)),_0x476dc5=_0x1ac2c7[_0x5d9b7b(0x1d1)](_0x2c85cb=>_0x2c85cb[_0x5d9b7b(0x1d0)]==='update');console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1d4)+_0x3fde1e+'\x27:');if(_0x4b6a86[_0x5d9b7b(0x1d3)]>0x0){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1e0)]('+\x20'+_0x4b6a86[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1c3)));for(const _0x10af7d of _0x4b6a86){console['error']('\x20\x20\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1e0)]('+')+'\x20'+_0x10af7d[_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]);}}if(_0x476dc5['length']>0x0){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('~\x20'+_0x476dc5[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1bb)));for(const _0x55e41a of _0x476dc5){console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1da)+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('~')+'\x20'+_0x55e41a[_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]);}}if(_0x4b6a86[_0x5d9b7b(0x1d3)]===0x0&&_0x476dc5[_0x5d9b7b(0x1d3)]===0x0)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1e0)](_0x5d9b7b(0x1db))),0x0;if(_0x4cb843[_0x5d9b7b(0x1b1)])return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1e7))),0x0;if(!_0x4cb843['yes']){if(!isInteractive())return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)](_0x5d9b7b(0x1dd)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a24_0x2a6e19[_0x5d9b7b(0x1b3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5387a7=await confirmKey('Push\x20'+(_0x4b6a86['length']+_0x476dc5['length'])+_0x5d9b7b(0x1ea));if(!_0x5387a7)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow']('Aborted.'),_0x5d9b7b(0x1df)),0x1;}const _0x1f2326=await withProgressSpinner(_0x5d9b7b(0x1cd),_0x194485=>executePush({'engage':_0x21eaf2[_0x5d9b7b(0x1af)]},_0x1ac2c7,{'progress':{'update':_0x49296f=>_0x194485['setPhase'](_0x49296f)}}),{'verbose':_0x4cb843['verbose']}),_0x170359=_0x1f2326[_0x5d9b7b(0x1b7)];for(const _0x4a9bcf of _0x170359['results']){if(_0x4a9bcf['templateId']&&(_0x4a9bcf['action']===_0x5d9b7b(0x1f0)||_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1b2))){const _0x1d1f9=getTemplateUrl(_0x4cb843['site'],_0x435a61,_0x4a9bcf['templateId']),_0x5cbbbb=_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1f0)?'+':'~',_0x4552ff=_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1f0)?a24_0x2a6e19[_0x5d9b7b(0x1e0)](_0x5cbbbb):a24_0x2a6e19[_0x5d9b7b(0x1d8)](_0x5cbbbb);console[_0x5d9b7b(0x1ca)]('\x20\x20'+_0x4552ff+'\x20'+hyperlink(_0x4a9bcf[_0x5d9b7b(0x1ec)],_0x1d1f9)+'\x20'+a24_0x2a6e19[_0x5d9b7b(0x1b3)](_0x1d1f9));}}_0x170359[_0x5d9b7b(0x1f0)]>0x0&&console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1e0)]('✔\x20Created\x20'+_0x170359[_0x5d9b7b(0x1f0)]+_0x5d9b7b(0x1bc)));_0x170359[_0x5d9b7b(0x1b2)]>0x0&&console['error'](a24_0x2a6e19[_0x5d9b7b(0x1e0)]('✔\x20Updated\x20'+_0x170359['updated']+_0x5d9b7b(0x1bc)));if(_0x170359[_0x5d9b7b(0x1ae)][_0x5d9b7b(0x1d3)]>0x0){console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)]('✘\x20'+_0x170359[_0x5d9b7b(0x1ae)]['length']+'\x20errors:'));for(const _0x541832 of _0x170359[_0x5d9b7b(0x1ae)]){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19['red'](_0x541832['name'])+':\x20'+_0x541832['error']);}}return saveSessionContext({'engage_workspace':_0x3fde1e},_0x4cb843[_0x5d9b7b(0x1d6)]),_0x170359[_0x5d9b7b(0x1ae)][_0x5d9b7b(0x1d3)]>0x0?0x1:0x0;}}