@treasuredata/tdx 2026.4.9 → 2026.4.10

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 (228) 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.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.js +1 -1
  141. package/dist/sdk/schedule.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.js +1 -1
  184. package/dist/sdk/workspace/frontmatter.js +1 -1
  185. package/dist/sdk/workspace/git.d.ts +52 -0
  186. package/dist/sdk/workspace/git.d.ts.map +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/git.js.map +1 -1
  189. package/dist/sdk/workspace/index.d.ts +14 -0
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +2 -1
@@ -1 +1 @@
1
- const a15_0x3d1762=a15_0x4e21;(function(_0x3ff155,_0x11ec6c){const _0x11cc1b=a15_0x4e21,_0x32af71=_0x3ff155();while(!![]){try{const _0x1b747a=-parseInt(_0x11cc1b(0xf3))/0x1*(-parseInt(_0x11cc1b(0xe8))/0x2)+-parseInt(_0x11cc1b(0xf7))/0x3+parseInt(_0x11cc1b(0xaf))/0x4+parseInt(_0x11cc1b(0xb2))/0x5+parseInt(_0x11cc1b(0xc9))/0x6+parseInt(_0x11cc1b(0x101))/0x7+parseInt(_0x11cc1b(0x105))/0x8*(-parseInt(_0x11cc1b(0x114))/0x9);if(_0x1b747a===_0x11ec6c)break;else _0x32af71['push'](_0x32af71['shift']());}catch(_0x30f11f){_0x32af71['push'](_0x32af71['shift']());}}}(a15_0x2f7e,0x8151c));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a15_0x4e21(_0x144632,_0x2ea539){_0x144632=_0x144632-0xaa;const _0x2f7e21=a15_0x2f7e();let _0x4e21b9=_0x2f7e21[_0x144632];return _0x4e21b9;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a15_0x287584 from'chalk';function normalizeSchemaForDisplay(_0x3cd7b5){const _0x2e455f=a15_0x4e21,_0x3a1296=_0x3cd7b5[_0x2e455f(0xc3)]||[],_0x59ec2c=_0x3a1296[_0x2e455f(0xdb)](_0x4384a7=>_0x4384a7[_0x2e455f(0xb6)]==='legacy_settings'&&_0x4384a7['type']===_0x2e455f(0xad)&&_0x4384a7['properties']);if(_0x59ec2c?.[_0x2e455f(0xc3)]){const _0x4f92a4=_0x3a1296[_0x2e455f(0x10c)](_0x482c89=>_0x482c89[_0x2e455f(0xb6)]!==_0x2e455f(0xd8)&&_0x482c89[_0x2e455f(0xb6)]!=='legacy_settings');return[..._0x4f92a4,..._0x59ec2c['properties']];}return _0x3a1296[_0x2e455f(0x10c)](_0x4e217d=>_0x4e217d[_0x2e455f(0xb6)]!==_0x2e455f(0xd8));}function printSchemaFields(_0x1e2b2a,_0x44e184){const _0x26995a=a15_0x4e21,_0x50cc4b='\x20\x20'[_0x26995a(0xce)](_0x44e184+0x1),_0x160314='\x20\x20'[_0x26995a(0xce)](_0x44e184+0x2);for(const _0x31a1e4 of _0x1e2b2a){if(!_0x31a1e4[_0x26995a(0xb6)])continue;const _0x884341=_0x31a1e4[_0x26995a(0xb4)]===_0x26995a(0xad)&&_0x31a1e4[_0x26995a(0xc3)]&&_0x31a1e4[_0x26995a(0xc3)][_0x26995a(0xcb)]>0x0&&_0x31a1e4[_0x26995a(0xb6)]!=='legacy_settings';let _0x4d1dc9=''+_0x50cc4b+a15_0x287584[_0x26995a(0xd9)](_0x31a1e4[_0x26995a(0xb6)]);_0x31a1e4[_0x26995a(0xaa)]&&(_0x4d1dc9+=':\x20'+_0x31a1e4[_0x26995a(0xaa)]);if(_0x31a1e4[_0x26995a(0xe1)])_0x4d1dc9+=a15_0x287584[_0x26995a(0xcc)]('\x20['+_0x31a1e4[_0x26995a(0xe1)]+']');else _0x884341&&(_0x4d1dc9+=a15_0x287584[_0x26995a(0xcc)](_0x26995a(0xe7)));console[_0x26995a(0xed)](_0x4d1dc9);_0x31a1e4[_0x26995a(0x104)]&&console[_0x26995a(0xed)](''+_0x160314+a15_0x287584[_0x26995a(0xcc)](_0x31a1e4[_0x26995a(0x104)]));if(_0x31a1e4[_0x26995a(0xb3)]){const _0x44c35e=_0x31a1e4[_0x26995a(0xb3)][_0x26995a(0xc0)](_0x2b8aa9=>typeof _0x2b8aa9===_0x26995a(0xac)&&_0x26995a(0xae)in _0x2b8aa9?_0x2b8aa9[_0x26995a(0xae)]:_0x2b8aa9)[_0x26995a(0x10a)](',\x20');console[_0x26995a(0xed)](_0x160314+'Options:\x20'+a15_0x287584[_0x26995a(0xf5)](_0x44c35e));}_0x31a1e4[_0x26995a(0xe3)]!==undefined&&console[_0x26995a(0xed)](_0x160314+_0x26995a(0xb0)+a15_0x287584[_0x26995a(0xd1)](String(_0x31a1e4[_0x26995a(0xe3)])));if(_0x31a1e4['minimum']!==undefined||_0x31a1e4[_0x26995a(0xf4)]!==undefined){const _0x87f294=_0x31a1e4[_0x26995a(0x103)]!==undefined&&_0x31a1e4['maximum']!==undefined?_0x31a1e4['minimum']+_0x26995a(0xef)+_0x31a1e4[_0x26995a(0xf4)]:_0x31a1e4['minimum']!==undefined?_0x26995a(0x106)+_0x31a1e4[_0x26995a(0x103)]:_0x26995a(0xc1)+_0x31a1e4['maximum'];console['log'](_0x160314+_0x26995a(0xe9)+a15_0x287584[_0x26995a(0xd1)](_0x87f294));}if(_0x31a1e4[_0x26995a(0xd0)]){const _0x56ce74=Object['entries'](_0x31a1e4['criteria'])[_0x26995a(0xc0)](([_0x7b7ba8,_0x3f585b])=>_0x7b7ba8+'='+JSON[_0x26995a(0xe4)](_0x3f585b))[_0x26995a(0x10a)](',\x20');console[_0x26995a(0xed)](''+_0x160314+a15_0x287584[_0x26995a(0xcc)](_0x26995a(0xbf)+_0x56ce74));}_0x884341&&_0x31a1e4[_0x26995a(0xc3)]&&printSchemaFields(_0x31a1e4[_0x26995a(0xc3)],_0x44e184+0x1);}}export class ConnectionListCommand extends BaseCommand{[a15_0x3d1762(0xb6)]=a15_0x3d1762(0xf2);[a15_0x3d1762(0x104)]=a15_0x3d1762(0xb8);async[a15_0x3d1762(0xe0)](_0x39db90){const _0x40a349=a15_0x3d1762,{options:_0x19eff1,tdx:_0x182484}=_0x39db90;_0x19eff1['verbose']&&console[_0x40a349(0xee)]('Site:\x20'+_0x19eff1[_0x40a349(0xf9)]);const _0x3af7e7=resolveLimit(_0x19eff1['limit'],DEFAULT_LISTING_LIMIT),_0x48d584=await withSpinner(_0x40a349(0xf1),()=>_0x182484['connection'][_0x40a349(0xd6)](),{'verbose':_0x19eff1[_0x40a349(0xb1)]}),_0x5a30b7=_0x48d584[_0x40a349(0x113)];console['error']('✔\x20Found\x20'+_0x5a30b7[_0x40a349(0xcb)]+'\x20connection'+(_0x5a30b7[_0x40a349(0xcb)]!==0x1?'s':''));if(isStructuredFormat(_0x19eff1)){const _0x2cc0ce=_0x5a30b7['slice'](0x0,_0x3af7e7);await handleSDKOutput(_0x2cc0ce,{..._0x19eff1,'limit':_0x3af7e7});}else{const _0x1cb5c4=_0x5a30b7[_0x40a349(0xcb)]>0x0?Math['max'](..._0x5a30b7[_0x40a349(0xc0)](_0x1cff18=>_0x1cff18['type'][_0x40a349(0xcb)])):0x0,_0x3abcc2=[];for(const _0x1f188a of _0x5a30b7){const _0x26c690=a15_0x287584[_0x40a349(0xdf)](_0x1f188a[_0x40a349(0xb4)]['padStart'](_0x1cb5c4)),_0xc85aa1=_0x1f188a[_0x40a349(0xdc)]?.[_0x40a349(0xb6)]?_0x40a349(0xef)+a15_0x287584['dim'](_0x1f188a[_0x40a349(0xdc)][_0x40a349(0xb6)]):'';_0x3abcc2[_0x40a349(0xd4)](_0x26c690+'\x20\x20'+_0x1f188a['name']+_0xc85aa1);}await writeOutput(_0x3abcc2[_0x40a349(0x10a)]('\x0a'),_0x19eff1['output'],'table');}return 0x0;}}function a15_0x2f7e(){const _0x2da9ab=['bold','2079147SImaHo','\x20\x20\x20\x20Options:\x20','minimum','description','222792GpkoXk','>=\x20','table','padStart','localeCompare','join','max','filter','Type:\x20','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','sort','✔\x20Found\x20','settings','\x27\x20as\x20connector\x20type','data','369hxBxDS','title','Fetching\x20settings\x20for\x20connector\x20type:\x20','object','record','value','964384lyIvyD','Default:\x20','verbose','111780YDUPWY','enumeration','type','validate','name','connection','List\x20all\x20result\x20output\x20connections','listTypes','Fetching\x20schema\x20for\x20\x27','options','hidden','Listing\x20connector\x20types...','\x0aAvailable\x20fields:','Show\x20when:\x20','map','<=\x20','\x27\x20(type:\x20','properties','Treating\x20\x27','✔\x20Found\x20connection:\x20','List\x20available\x20connector\x20types','\x0aNo\x20fields\x20defined\x20in\x20schema','\x0aNo\x20credential\x20settings\x20defined','5951424MerfQJ','✔\x20Found\x20schema\x20for\x20connection\x20\x27','length','dim','\x0aConnector:\x20','repeat','\x20\x20\x20\x20','criteria','blue','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','findByName','push','label','list','connection:types','legacy','green','Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.','find','owner','Name:\x20','Site:\x20','cyan','execute','input','Resolving\x20connector\x20type\x20or\x20name:\x20','default_value','stringify','\x27...','Show\x20connection\x20details','\x20[record]','1289094WhnChm','Range:\x20','getOutputSchema','resolve','entries','log','error','\x20-\x20','connection:show','Listing\x20connections...','connection:list','1IfoAyq','maximum','yellow','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','1576269ZXyXZx','hint','site','\x0aCredential\x20settings:','getMetadata','connection:schema','\x0aConnection:\x20','Fetching\x20connection\x20\x27','\x20connector\x20type'];a15_0x2f7e=function(){return _0x2da9ab;};return a15_0x2f7e();}export class ConnectionShowCommand extends BaseCommand{[a15_0x3d1762(0xb6)]=a15_0x3d1762(0xf0);[a15_0x3d1762(0x104)]=a15_0x3d1762(0xe6);[a15_0x3d1762(0xb5)](_0x1a8213){const _0x342cc3=a15_0x3d1762,{args:_0x4f6b2e}=_0x1a8213;if(!_0x4f6b2e[0x0])return _0x342cc3(0xf6);return undefined;}async['execute'](_0x1cf248){const _0x3ee386=a15_0x3d1762,{options:_0x1ffc85,args:_0x4c75a5,tdx:_0x1fef57}=_0x1cf248,_0x2067bc=_0x4c75a5[0x0];_0x1ffc85[_0x3ee386(0xb1)]&&(console[_0x3ee386(0xee)](_0x3ee386(0xde)+_0x1ffc85[_0x3ee386(0xf9)]),console[_0x3ee386(0xee)]('Looking\x20up\x20connection:\x20'+_0x2067bc));const _0x5aeca6=await withSpinner(_0x3ee386(0xfe)+_0x2067bc+'\x27...',()=>_0x1fef57['connection'][_0x3ee386(0xeb)](_0x2067bc),{'verbose':_0x1ffc85[_0x3ee386(0xb1)]}),_0x579a55=_0x5aeca6[_0x3ee386(0x113)];return console[_0x3ee386(0xee)](_0x3ee386(0xc5)+_0x579a55[_0x3ee386(0xb6)]),await handleSingleObjectOutput(_0x579a55,_0x1ffc85),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a15_0x3d1762(0xfc);[a15_0x3d1762(0x104)]=a15_0x3d1762(0x10e);['validate'](_0x1a2af6){const {args:_0x4d83cd}=_0x1a2af6;if(!_0x4d83cd[0x0])return'Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.';return undefined;}async[a15_0x3d1762(0xe0)](_0x29d478){const _0x19c4a2=a15_0x3d1762,{options:_0x35f500,args:_0x5b090b,tdx:_0x125340}=_0x29d478,_0x2300bd=_0x5b090b[0x0];_0x35f500['verbose']&&(console[_0x19c4a2(0xee)](_0x19c4a2(0xde)+_0x35f500[_0x19c4a2(0xf9)]),console['error'](_0x19c4a2(0xe2)+_0x2300bd));let _0x48ae46=_0x2300bd,_0x1bc98b;try{const _0x2bd54b=await _0x125340['connection'][_0x19c4a2(0xd3)](_0x2300bd);_0x2bd54b&&(_0x48ae46=_0x2bd54b[_0x19c4a2(0xb4)],_0x1bc98b=_0x2bd54b['name'],_0x35f500[_0x19c4a2(0xb1)]&&console['error']('✔\x20Resolved\x20\x27'+_0x2300bd+'\x27\x20as\x20connection\x20name\x20→\x20type:\x20'+_0x48ae46));}catch{_0x35f500[_0x19c4a2(0xb1)]&&console[_0x19c4a2(0xee)](_0x19c4a2(0xc4)+_0x2300bd+_0x19c4a2(0x112));}const _0x3fd260=await withSpinner(_0x19c4a2(0xba)+_0x48ae46+'\x27...',()=>_0x125340[_0x19c4a2(0xb7)][_0x19c4a2(0xea)](_0x48ae46),{'verbose':_0x35f500['verbose']}),_0x5e3ced=_0x3fd260['data'];_0x1bc98b?console['error'](_0x19c4a2(0xca)+_0x1bc98b+_0x19c4a2(0xc2)+_0x48ae46+')'):console[_0x19c4a2(0xee)](_0x19c4a2(0xd2)+_0x48ae46);if(isStructuredFormat(_0x35f500))await handleSingleObjectOutput(_0x5e3ced,_0x35f500);else{const _0x3d51fa=normalizeSchemaForDisplay(_0x5e3ced);_0x1bc98b?(console[_0x19c4a2(0xed)](_0x19c4a2(0xfd)+a15_0x287584['cyan'](_0x1bc98b)),console[_0x19c4a2(0xed)](_0x19c4a2(0x10d)+a15_0x287584[_0x19c4a2(0xcc)](_0x48ae46))):console['log'](_0x19c4a2(0xcd)+a15_0x287584[_0x19c4a2(0xdf)](_0x48ae46)),_0x3d51fa[_0x19c4a2(0xcb)]>0x0?(console[_0x19c4a2(0xed)](a15_0x287584[_0x19c4a2(0x100)](_0x19c4a2(0xbe))),printSchemaFields(_0x3d51fa,0x0)):console[_0x19c4a2(0xed)](a15_0x287584[_0x19c4a2(0xcc)](_0x19c4a2(0xc7)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{['name']=a15_0x3d1762(0xd7);[a15_0x3d1762(0x104)]=a15_0x3d1762(0xc6);async[a15_0x3d1762(0xe0)](_0x2222b3){const _0x4c1cb7=a15_0x3d1762,{options:_0x360f4f,tdx:_0x236a87}=_0x2222b3;_0x360f4f[_0x4c1cb7(0xb1)]&&console[_0x4c1cb7(0xee)](_0x4c1cb7(0xde)+_0x360f4f['site']);const _0x190e1b=await withSpinner(_0x4c1cb7(0xbd),()=>_0x236a87[_0x4c1cb7(0xb7)][_0x4c1cb7(0xb9)](),{'verbose':_0x360f4f[_0x4c1cb7(0xb1)]}),_0x319c00=_0x190e1b[_0x4c1cb7(0x113)][_0x4c1cb7(0x10f)]((_0x40b9b2,_0x4b4b32)=>_0x40b9b2[_0x4c1cb7(0xb4)][_0x4c1cb7(0x109)](_0x4b4b32[_0x4c1cb7(0xb4)]));console[_0x4c1cb7(0xee)](_0x4c1cb7(0x110)+_0x319c00[_0x4c1cb7(0xcb)]+_0x4c1cb7(0xff)+(_0x319c00['length']!==0x1?'s':''));if(isStructuredFormat(_0x360f4f))await handleSDKOutput(_0x319c00,_0x360f4f);else{const _0x131bae=_0x319c00['length']>0x0?Math[_0x4c1cb7(0x10b)](..._0x319c00[_0x4c1cb7(0xc0)](_0x152825=>_0x152825[_0x4c1cb7(0xb4)][_0x4c1cb7(0xcb)])):0x0,_0x1b56be=[];for(const _0x26336d of _0x319c00){const _0x3eba62=a15_0x287584[_0x4c1cb7(0xdf)](_0x26336d[_0x4c1cb7(0xb4)][_0x4c1cb7(0x108)](_0x131bae));_0x1b56be[_0x4c1cb7(0xd4)](_0x3eba62+'\x20\x20'+_0x26336d[_0x4c1cb7(0xb6)]);}await writeOutput(_0x1b56be[_0x4c1cb7(0x10a)]('\x0a'),_0x360f4f['output'],_0x4c1cb7(0x107));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x3d1762(0xb6)]='connection:settings';[a15_0x3d1762(0x104)]='Show\x20connection-level\x20settings\x20(credentials,\x20authentication)';[a15_0x3d1762(0xb5)](_0x3b5464){const _0x23e47a=a15_0x3d1762,{args:_0x5a29c0}=_0x3b5464;if(!_0x5a29c0[0x0])return _0x23e47a(0xda);return undefined;}async[a15_0x3d1762(0xe0)](_0x4b44e8){const _0x2b58c6=a15_0x3d1762,{options:_0xe349ac,args:_0x364da5,tdx:_0x3fed4d}=_0x4b44e8,_0x35c2d4=_0x364da5[0x0];_0xe349ac[_0x2b58c6(0xb1)]&&(console[_0x2b58c6(0xee)](_0x2b58c6(0xde)+_0xe349ac[_0x2b58c6(0xf9)]),console[_0x2b58c6(0xee)](_0x2b58c6(0xab)+_0x35c2d4));const _0x518a13=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x35c2d4+_0x2b58c6(0xe5),()=>_0x3fed4d['connection'][_0x2b58c6(0xfb)](_0x35c2d4),{'verbose':_0xe349ac['verbose']}),_0x5b2e83=_0x518a13[_0x2b58c6(0x113)];console[_0x2b58c6(0xee)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x35c2d4);if(isStructuredFormat(_0xe349ac))await handleSingleObjectOutput(_0x5b2e83,_0xe349ac);else{console[_0x2b58c6(0xed)](_0x2b58c6(0xcd)+a15_0x287584[_0x2b58c6(0xdf)](_0x35c2d4)),console['log'](_0x2b58c6(0xdd)+_0x5b2e83['name']);const _0x46a622=_0x5b2e83[_0x2b58c6(0x111)]||[],_0x85d09a=_0x46a622['filter'](_0x4d3834=>_0x4d3834['credential']);_0x85d09a[_0x2b58c6(0xcb)]>0x0&&(console[_0x2b58c6(0xed)](a15_0x287584[_0x2b58c6(0x100)](_0x2b58c6(0xfa))),printMetadataSettings(_0x85d09a));let _0x95448=![];try{const _0x3fc862=await _0x3fed4d[_0x2b58c6(0xb7)][_0x2b58c6(0xea)](_0x35c2d4),_0x4881da=normalizeSchemaForDisplay(_0x3fc862);_0x4881da['length']>0x0&&(console[_0x2b58c6(0xed)](a15_0x287584[_0x2b58c6(0x100)](_0x2b58c6(0xbe))),printSchemaFields(_0x4881da,0x0),_0x95448=!![]);}catch{const _0x368d8c=_0x46a622[_0x2b58c6(0x10c)](_0x342f85=>!_0x342f85['credential']);_0x368d8c[_0x2b58c6(0xcb)]>0x0&&(console[_0x2b58c6(0xed)](a15_0x287584[_0x2b58c6(0x100)](_0x2b58c6(0xbe))),printMetadataSettings(_0x368d8c),_0x95448=!![]);}!_0x95448&&_0xe349ac[_0x2b58c6(0xb1)]&&console['error'](a15_0x287584[_0x2b58c6(0xcc)]('No\x20available\x20fields\x20for\x20this\x20connector')),_0x85d09a['length']===0x0&&console[_0x2b58c6(0xed)](a15_0x287584[_0x2b58c6(0xcc)](_0x2b58c6(0xc8)));}return 0x0;}}function printMetadataSettings(_0x3b4a95){const _0x5da6b5=a15_0x3d1762;for(const _0xb32393 of _0x3b4a95){if(!_0xb32393[_0x5da6b5(0xb6)])continue;if(_0xb32393[_0x5da6b5(0xbc)])continue;let _0x548ab7='\x20\x20'+a15_0x287584[_0x5da6b5(0xd9)](_0xb32393[_0x5da6b5(0xb6)]);_0xb32393[_0x5da6b5(0xd5)]&&(_0x548ab7+=':\x20'+_0xb32393[_0x5da6b5(0xd5)]);_0xb32393[_0x5da6b5(0xb4)]&&(_0x548ab7+=a15_0x287584[_0x5da6b5(0xcc)]('\x20['+_0xb32393[_0x5da6b5(0xb4)]+']'));console[_0x5da6b5(0xed)](_0x548ab7);_0xb32393[_0x5da6b5(0xf8)]&&console[_0x5da6b5(0xed)](_0x5da6b5(0xcf)+a15_0x287584[_0x5da6b5(0xcc)](_0xb32393[_0x5da6b5(0xf8)]));if(_0xb32393['options']){const _0x4d789e=_0xb32393[_0x5da6b5(0xbb)][_0x5da6b5(0xc0)](_0x1717f8=>_0x1717f8['value'])[_0x5da6b5(0x10a)](',\x20');console['log'](_0x5da6b5(0x102)+a15_0x287584['yellow'](_0x4d789e));}_0xb32393[_0x5da6b5(0xe3)]!==undefined&&_0xb32393[_0x5da6b5(0xe3)]!==null&&console[_0x5da6b5(0xed)]('\x20\x20\x20\x20Default:\x20'+a15_0x287584[_0x5da6b5(0xd1)](String(_0xb32393[_0x5da6b5(0xe3)])));if(_0xb32393['criteria']){const _0xff5130=Object[_0x5da6b5(0xec)](_0xb32393[_0x5da6b5(0xd0)])[_0x5da6b5(0xc0)](([_0xf938ba,_0x26c438])=>_0xf938ba+'='+JSON[_0x5da6b5(0xe4)](_0x26c438))[_0x5da6b5(0x10a)](',\x20');console[_0x5da6b5(0xed)](_0x5da6b5(0xcf)+a15_0x287584['dim'](_0x5da6b5(0xbf)+_0xff5130));}}}
1
+ const a15_0x95afb1=a15_0x92e2;(function(_0x469ffb,_0x391d64){const _0x2d6458=a15_0x92e2,_0x1ecb4a=_0x469ffb();while(!![]){try{const _0x41efd5=parseInt(_0x2d6458(0xe9))/0x1*(parseInt(_0x2d6458(0x128))/0x2)+parseInt(_0x2d6458(0x11f))/0x3+-parseInt(_0x2d6458(0xd5))/0x4*(-parseInt(_0x2d6458(0x123))/0x5)+parseInt(_0x2d6458(0xd4))/0x6+-parseInt(_0x2d6458(0x108))/0x7*(-parseInt(_0x2d6458(0xf1))/0x8)+parseInt(_0x2d6458(0xe1))/0x9*(parseInt(_0x2d6458(0x10a))/0xa)+-parseInt(_0x2d6458(0x129))/0xb*(parseInt(_0x2d6458(0x11c))/0xc);if(_0x41efd5===_0x391d64)break;else _0x1ecb4a['push'](_0x1ecb4a['shift']());}catch(_0x38d2b8){_0x1ecb4a['push'](_0x1ecb4a['shift']());}}}(a15_0x3591,0x99c4e));function a15_0x92e2(_0x5eae82,_0x3f4e13){_0x5eae82=_0x5eae82-0xca;const _0x35919d=a15_0x3591();let _0x92e29f=_0x35919d[_0x5eae82];return _0x92e29f;}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a15_0x3591(){const _0x2f0c0d=['execute','properties','\x20-\x20','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','label','\x27\x20as\x20connector\x20type','Name:\x20','cyan','padStart','repeat','Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.','options','join','>=\x20','Show\x20connection\x20details','green','527892kiZVdk','64OnAbZh','✔\x20Resolved\x20\x27','connection:types','List\x20all\x20result\x20output\x20connections','length','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','enumeration','Fetching\x20connection\x20\x27','Range:\x20','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','owner','slice','198gnaAlb','resolve','error','validate','Listing\x20connector\x20types...','push','bold','legacy_settings','18465raLWvU','object','localeCompare','Fetching\x20settings\x20for\x20\x27','<=\x20','limit','\x0aAvailable\x20fields:','description','2231408ibkbbH','verbose','name','credential','table','map','✔\x20Found\x20connection:\x20','Show\x20when:\x20','input','yellow','Listing\x20connections...','getOutputSchema','stringify','\x0aConnector:\x20','\x0aNo\x20fields\x20defined\x20in\x20schema','\x20\x20\x20\x20Options:\x20','Site:\x20','\x20\x20\x20\x20','minimum','No\x20available\x20fields\x20for\x20this\x20connector','site','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','output','28DCDrXc','Resolving\x20connector\x20type\x20or\x20name:\x20','121690ZcrNgw','Treating\x20\x27','connection:settings','Looking\x20up\x20connection:\x20','data','\x20[record]','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','record','value','legacy','type','hidden','connection','title','maximum','hint','\x27\x20(type:\x20','dim','1804884EYfqMp','connection:schema','sort','2750883OGhyii','log','Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.','criteria','203335sZNrNq','settings','listTypes','\x0aNo\x20credential\x20settings\x20defined','findByName','16WPoQKU','187whLGCa','filter','default_value','entries','\x0aConnection:\x20','\x20connector\x20type','max','\x0aCredential\x20settings:','blue'];a15_0x3591=function(){return _0x2f0c0d;};return a15_0x3591();}import a15_0x48322f from'chalk';function normalizeSchemaForDisplay(_0x456cf7){const _0x5bca76=a15_0x92e2,_0x1d1180=_0x456cf7[_0x5bca76(0x133)]||[],_0x5393ba=_0x1d1180['find'](_0x34bd6a=>_0x34bd6a[_0x5bca76(0xf3)]===_0x5bca76(0xe8)&&_0x34bd6a['type']==='record'&&_0x34bd6a[_0x5bca76(0x133)]);if(_0x5393ba?.[_0x5bca76(0x133)]){const _0x4a5191=_0x1d1180[_0x5bca76(0x12a)](_0x12d626=>_0x12d626[_0x5bca76(0xf3)]!==_0x5bca76(0x113)&&_0x12d626['name']!==_0x5bca76(0xe8));return[..._0x4a5191,..._0x5393ba[_0x5bca76(0x133)]];}return _0x1d1180['filter'](_0x59ff85=>_0x59ff85[_0x5bca76(0xf3)]!==_0x5bca76(0x113));}function printSchemaFields(_0x3a3747,_0x3a4cd1){const _0xf53391=a15_0x92e2,_0x211df8='\x20\x20'[_0xf53391(0xcd)](_0x3a4cd1+0x1),_0x457088='\x20\x20'[_0xf53391(0xcd)](_0x3a4cd1+0x2);for(const _0x194e1d of _0x3a3747){if(!_0x194e1d[_0xf53391(0xf3)])continue;const _0xe944c7=_0x194e1d[_0xf53391(0x114)]===_0xf53391(0x111)&&_0x194e1d[_0xf53391(0x133)]&&_0x194e1d[_0xf53391(0x133)][_0xf53391(0xd9)]>0x0&&_0x194e1d[_0xf53391(0xf3)]!==_0xf53391(0xe8);let _0x3d7738=''+_0x211df8+a15_0x48322f[_0xf53391(0xd3)](_0x194e1d[_0xf53391(0xf3)]);_0x194e1d[_0xf53391(0x117)]&&(_0x3d7738+=':\x20'+_0x194e1d[_0xf53391(0x117)]);if(_0x194e1d[_0xf53391(0xf9)])_0x3d7738+=a15_0x48322f[_0xf53391(0x11b)]('\x20['+_0x194e1d['input']+']');else _0xe944c7&&(_0x3d7738+=a15_0x48322f[_0xf53391(0x11b)](_0xf53391(0x10f)));console['log'](_0x3d7738);_0x194e1d['description']&&console[_0xf53391(0x120)](''+_0x457088+a15_0x48322f['dim'](_0x194e1d[_0xf53391(0xf0)]));if(_0x194e1d[_0xf53391(0xdb)]){const _0x36315c=_0x194e1d[_0xf53391(0xdb)][_0xf53391(0xf6)](_0x4d8374=>typeof _0x4d8374===_0xf53391(0xea)&&_0xf53391(0x112)in _0x4d8374?_0x4d8374[_0xf53391(0x112)]:_0x4d8374)[_0xf53391(0xd0)](',\x20');console[_0xf53391(0x120)](_0x457088+'Options:\x20'+a15_0x48322f[_0xf53391(0xfa)](_0x36315c));}_0x194e1d[_0xf53391(0x12b)]!==undefined&&console[_0xf53391(0x120)](_0x457088+'Default:\x20'+a15_0x48322f[_0xf53391(0x131)](String(_0x194e1d[_0xf53391(0x12b)])));if(_0x194e1d['minimum']!==undefined||_0x194e1d[_0xf53391(0x118)]!==undefined){const _0x5d3782=_0x194e1d[_0xf53391(0x103)]!==undefined&&_0x194e1d[_0xf53391(0x118)]!==undefined?_0x194e1d[_0xf53391(0x103)]+_0xf53391(0x134)+_0x194e1d['maximum']:_0x194e1d[_0xf53391(0x103)]!==undefined?_0xf53391(0xd1)+_0x194e1d['minimum']:_0xf53391(0xed)+_0x194e1d['maximum'];console[_0xf53391(0x120)](_0x457088+_0xf53391(0xdd)+a15_0x48322f['blue'](_0x5d3782));}if(_0x194e1d[_0xf53391(0x122)]){const _0xb45e0a=Object[_0xf53391(0x12c)](_0x194e1d[_0xf53391(0x122)])[_0xf53391(0xf6)](([_0x35a8b2,_0x311e27])=>_0x35a8b2+'='+JSON[_0xf53391(0xfd)](_0x311e27))[_0xf53391(0xd0)](',\x20');console[_0xf53391(0x120)](''+_0x457088+a15_0x48322f['dim']('Show\x20when:\x20'+_0xb45e0a));}_0xe944c7&&_0x194e1d[_0xf53391(0x133)]&&printSchemaFields(_0x194e1d[_0xf53391(0x133)],_0x3a4cd1+0x1);}}export class ConnectionListCommand extends BaseCommand{[a15_0x95afb1(0xf3)]='connection:list';[a15_0x95afb1(0xf0)]=a15_0x95afb1(0xd8);async['execute'](_0x3b13f2){const _0xea59e4=a15_0x95afb1,{options:_0x57fa7f,tdx:_0x53e1d8}=_0x3b13f2;_0x57fa7f[_0xea59e4(0xf2)]&&console[_0xea59e4(0xe3)](_0xea59e4(0x101)+_0x57fa7f[_0xea59e4(0x105)]);const _0x41f0b7=resolveLimit(_0x57fa7f[_0xea59e4(0xee)],DEFAULT_LISTING_LIMIT),_0x56495f=await withSpinner(_0xea59e4(0xfb),()=>_0x53e1d8['connection']['list'](),{'verbose':_0x57fa7f['verbose']}),_0x54bf9d=_0x56495f['data'];console[_0xea59e4(0xe3)]('✔\x20Found\x20'+_0x54bf9d[_0xea59e4(0xd9)]+'\x20connection'+(_0x54bf9d[_0xea59e4(0xd9)]!==0x1?'s':''));if(isStructuredFormat(_0x57fa7f)){const _0x1212a7=_0x54bf9d[_0xea59e4(0xe0)](0x0,_0x41f0b7);await handleSDKOutput(_0x1212a7,{..._0x57fa7f,'limit':_0x41f0b7});}else{const _0x594704=_0x54bf9d[_0xea59e4(0xd9)]>0x0?Math['max'](..._0x54bf9d[_0xea59e4(0xf6)](_0x28d06c=>_0x28d06c[_0xea59e4(0x114)]['length'])):0x0,_0x838e8d=[];for(const _0x33942b of _0x54bf9d){const _0x224a2d=a15_0x48322f[_0xea59e4(0xcb)](_0x33942b[_0xea59e4(0x114)][_0xea59e4(0xcc)](_0x594704)),_0x3247ff=_0x33942b[_0xea59e4(0xdf)]?.['name']?_0xea59e4(0x134)+a15_0x48322f[_0xea59e4(0x11b)](_0x33942b['owner']['name']):'';_0x838e8d[_0xea59e4(0xe6)](_0x224a2d+'\x20\x20'+_0x33942b[_0xea59e4(0xf3)]+_0x3247ff);}await writeOutput(_0x838e8d[_0xea59e4(0xd0)]('\x0a'),_0x57fa7f[_0xea59e4(0x107)],_0xea59e4(0xf5));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']='connection:show';[a15_0x95afb1(0xf0)]=a15_0x95afb1(0xd2);[a15_0x95afb1(0xe4)](_0x1abec7){const _0x2563c9=a15_0x95afb1,{args:_0x92ec78}=_0x1abec7;if(!_0x92ec78[0x0])return _0x2563c9(0x135);return undefined;}async[a15_0x95afb1(0x132)](_0x193156){const _0x4899a4=a15_0x95afb1,{options:_0x206640,args:_0x321b11,tdx:_0x4643c4}=_0x193156,_0x56f40e=_0x321b11[0x0];_0x206640[_0x4899a4(0xf2)]&&(console['error'](_0x4899a4(0x101)+_0x206640[_0x4899a4(0x105)]),console[_0x4899a4(0xe3)](_0x4899a4(0x10d)+_0x56f40e));const _0x3c3e62=await withSpinner(_0x4899a4(0xdc)+_0x56f40e+'\x27...',()=>_0x4643c4[_0x4899a4(0x116)][_0x4899a4(0xe2)](_0x56f40e),{'verbose':_0x206640[_0x4899a4(0xf2)]}),_0x2cdcd7=_0x3c3e62['data'];return console[_0x4899a4(0xe3)](_0x4899a4(0xf7)+_0x2cdcd7[_0x4899a4(0xf3)]),await handleSingleObjectOutput(_0x2cdcd7,_0x206640),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a15_0x95afb1(0xf3)]=a15_0x95afb1(0x11d);[a15_0x95afb1(0xf0)]=a15_0x95afb1(0x110);[a15_0x95afb1(0xe4)](_0x5773ff){const _0x222ea2=a15_0x95afb1,{args:_0x5c228d}=_0x5773ff;if(!_0x5c228d[0x0])return _0x222ea2(0xce);return undefined;}async[a15_0x95afb1(0x132)](_0x46c948){const _0x4e26aa=a15_0x95afb1,{options:_0x2201c8,args:_0x2a120d,tdx:_0x431127}=_0x46c948,_0x4b42e7=_0x2a120d[0x0];_0x2201c8['verbose']&&(console[_0x4e26aa(0xe3)](_0x4e26aa(0x101)+_0x2201c8[_0x4e26aa(0x105)]),console[_0x4e26aa(0xe3)](_0x4e26aa(0x109)+_0x4b42e7));let _0x1c217c=_0x4b42e7,_0x576743;try{const _0x57f974=await _0x431127['connection'][_0x4e26aa(0x127)](_0x4b42e7);_0x57f974&&(_0x1c217c=_0x57f974[_0x4e26aa(0x114)],_0x576743=_0x57f974[_0x4e26aa(0xf3)],_0x2201c8[_0x4e26aa(0xf2)]&&console['error'](_0x4e26aa(0xd6)+_0x4b42e7+_0x4e26aa(0xda)+_0x1c217c));}catch{_0x2201c8[_0x4e26aa(0xf2)]&&console[_0x4e26aa(0xe3)](_0x4e26aa(0x10b)+_0x4b42e7+_0x4e26aa(0x137));}const _0x4f7aca=await withSpinner('Fetching\x20schema\x20for\x20\x27'+_0x1c217c+'\x27...',()=>_0x431127['connection'][_0x4e26aa(0xfc)](_0x1c217c),{'verbose':_0x2201c8[_0x4e26aa(0xf2)]}),_0xe33125=_0x4f7aca['data'];_0x576743?console[_0x4e26aa(0xe3)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x576743+_0x4e26aa(0x11a)+_0x1c217c+')'):console[_0x4e26aa(0xe3)](_0x4e26aa(0x106)+_0x1c217c);if(isStructuredFormat(_0x2201c8))await handleSingleObjectOutput(_0xe33125,_0x2201c8);else{const _0x3d6647=normalizeSchemaForDisplay(_0xe33125);_0x576743?(console[_0x4e26aa(0x120)](_0x4e26aa(0x12d)+a15_0x48322f[_0x4e26aa(0xcb)](_0x576743)),console['log']('Type:\x20'+a15_0x48322f[_0x4e26aa(0x11b)](_0x1c217c))):console['log'](_0x4e26aa(0xfe)+a15_0x48322f[_0x4e26aa(0xcb)](_0x1c217c)),_0x3d6647[_0x4e26aa(0xd9)]>0x0?(console['log'](a15_0x48322f[_0x4e26aa(0xe7)]('\x0aAvailable\x20fields:')),printSchemaFields(_0x3d6647,0x0)):console[_0x4e26aa(0x120)](a15_0x48322f[_0x4e26aa(0x11b)](_0x4e26aa(0xff)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a15_0x95afb1(0xf3)]=a15_0x95afb1(0xd7);[a15_0x95afb1(0xf0)]='List\x20available\x20connector\x20types';async['execute'](_0x5a21b2){const _0x51e526=a15_0x95afb1,{options:_0x2c514b,tdx:_0x428ff9}=_0x5a21b2;_0x2c514b[_0x51e526(0xf2)]&&console['error'](_0x51e526(0x101)+_0x2c514b[_0x51e526(0x105)]);const _0x4fba3e=await withSpinner(_0x51e526(0xe5),()=>_0x428ff9[_0x51e526(0x116)][_0x51e526(0x125)](),{'verbose':_0x2c514b[_0x51e526(0xf2)]}),_0x2e64ca=_0x4fba3e[_0x51e526(0x10e)][_0x51e526(0x11e)]((_0x442228,_0x5de8aa)=>_0x442228[_0x51e526(0x114)][_0x51e526(0xeb)](_0x5de8aa[_0x51e526(0x114)]));console[_0x51e526(0xe3)]('✔\x20Found\x20'+_0x2e64ca['length']+_0x51e526(0x12e)+(_0x2e64ca['length']!==0x1?'s':''));if(isStructuredFormat(_0x2c514b))await handleSDKOutput(_0x2e64ca,_0x2c514b);else{const _0x4b2f16=_0x2e64ca[_0x51e526(0xd9)]>0x0?Math[_0x51e526(0x12f)](..._0x2e64ca['map'](_0x2bdb7f=>_0x2bdb7f[_0x51e526(0x114)][_0x51e526(0xd9)])):0x0,_0x584d37=[];for(const _0x454cbf of _0x2e64ca){const _0x350e43=a15_0x48322f[_0x51e526(0xcb)](_0x454cbf[_0x51e526(0x114)]['padStart'](_0x4b2f16));_0x584d37['push'](_0x350e43+'\x20\x20'+_0x454cbf[_0x51e526(0xf3)]);}await writeOutput(_0x584d37[_0x51e526(0xd0)]('\x0a'),_0x2c514b['output'],_0x51e526(0xf5));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x95afb1(0xf3)]=a15_0x95afb1(0x10c);[a15_0x95afb1(0xf0)]=a15_0x95afb1(0xde);[a15_0x95afb1(0xe4)](_0x595c10){const _0x25a7b1=a15_0x95afb1,{args:_0x3511a5}=_0x595c10;if(!_0x3511a5[0x0])return _0x25a7b1(0x121);return undefined;}async['execute'](_0x5dc93b){const _0x293595=a15_0x95afb1,{options:_0x4f7308,args:_0x5d1009,tdx:_0x323f96}=_0x5dc93b,_0x32e583=_0x5d1009[0x0];_0x4f7308[_0x293595(0xf2)]&&(console[_0x293595(0xe3)](_0x293595(0x101)+_0x4f7308[_0x293595(0x105)]),console[_0x293595(0xe3)]('Fetching\x20settings\x20for\x20connector\x20type:\x20'+_0x32e583));const _0x5b97c2=await withSpinner(_0x293595(0xec)+_0x32e583+'\x27...',()=>_0x323f96['connection']['getMetadata'](_0x32e583),{'verbose':_0x4f7308[_0x293595(0xf2)]}),_0x1f7a1d=_0x5b97c2['data'];console[_0x293595(0xe3)]('✔\x20Found\x20settings\x20for\x20connector\x20type:\x20'+_0x32e583);if(isStructuredFormat(_0x4f7308))await handleSingleObjectOutput(_0x1f7a1d,_0x4f7308);else{console[_0x293595(0x120)](_0x293595(0xfe)+a15_0x48322f[_0x293595(0xcb)](_0x32e583)),console[_0x293595(0x120)](_0x293595(0xca)+_0x1f7a1d[_0x293595(0xf3)]);const _0xfa4ca=_0x1f7a1d[_0x293595(0x124)]||[],_0x5cf8e7=_0xfa4ca[_0x293595(0x12a)](_0x3d512e=>_0x3d512e[_0x293595(0xf4)]);_0x5cf8e7[_0x293595(0xd9)]>0x0&&(console[_0x293595(0x120)](a15_0x48322f[_0x293595(0xe7)](_0x293595(0x130))),printMetadataSettings(_0x5cf8e7));let _0x25cfeb=![];try{const _0x2880c1=await _0x323f96[_0x293595(0x116)][_0x293595(0xfc)](_0x32e583),_0x25a71a=normalizeSchemaForDisplay(_0x2880c1);_0x25a71a[_0x293595(0xd9)]>0x0&&(console[_0x293595(0x120)](a15_0x48322f[_0x293595(0xe7)](_0x293595(0xef))),printSchemaFields(_0x25a71a,0x0),_0x25cfeb=!![]);}catch{const _0xe60876=_0xfa4ca[_0x293595(0x12a)](_0x175e3b=>!_0x175e3b[_0x293595(0xf4)]);_0xe60876[_0x293595(0xd9)]>0x0&&(console[_0x293595(0x120)](a15_0x48322f['bold']('\x0aAvailable\x20fields:')),printMetadataSettings(_0xe60876),_0x25cfeb=!![]);}!_0x25cfeb&&_0x4f7308[_0x293595(0xf2)]&&console['error'](a15_0x48322f[_0x293595(0x11b)](_0x293595(0x104))),_0x5cf8e7[_0x293595(0xd9)]===0x0&&console['log'](a15_0x48322f[_0x293595(0x11b)](_0x293595(0x126)));}return 0x0;}}function printMetadataSettings(_0x2ca360){const _0x3cf071=a15_0x95afb1;for(const _0x58a358 of _0x2ca360){if(!_0x58a358['name'])continue;if(_0x58a358[_0x3cf071(0x115)])continue;let _0x1a2cb4='\x20\x20'+a15_0x48322f[_0x3cf071(0xd3)](_0x58a358['name']);_0x58a358[_0x3cf071(0x136)]&&(_0x1a2cb4+=':\x20'+_0x58a358[_0x3cf071(0x136)]);_0x58a358[_0x3cf071(0x114)]&&(_0x1a2cb4+=a15_0x48322f[_0x3cf071(0x11b)]('\x20['+_0x58a358['type']+']'));console[_0x3cf071(0x120)](_0x1a2cb4);_0x58a358['hint']&&console[_0x3cf071(0x120)](_0x3cf071(0x102)+a15_0x48322f[_0x3cf071(0x11b)](_0x58a358[_0x3cf071(0x119)]));if(_0x58a358[_0x3cf071(0xcf)]){const _0x2574e1=_0x58a358[_0x3cf071(0xcf)]['map'](_0x39b03c=>_0x39b03c['value'])[_0x3cf071(0xd0)](',\x20');console['log'](_0x3cf071(0x100)+a15_0x48322f[_0x3cf071(0xfa)](_0x2574e1));}_0x58a358[_0x3cf071(0x12b)]!==undefined&&_0x58a358[_0x3cf071(0x12b)]!==null&&console['log']('\x20\x20\x20\x20Default:\x20'+a15_0x48322f[_0x3cf071(0x131)](String(_0x58a358[_0x3cf071(0x12b)])));if(_0x58a358['criteria']){const _0x1be269=Object[_0x3cf071(0x12c)](_0x58a358[_0x3cf071(0x122)])[_0x3cf071(0xf6)](([_0x49292b,_0x3f5caf])=>_0x49292b+'='+JSON[_0x3cf071(0xfd)](_0x3f5caf))[_0x3cf071(0xd0)](',\x20');console[_0x3cf071(0x120)](_0x3cf071(0x102)+a15_0x48322f[_0x3cf071(0x11b)](_0x3cf071(0xf8)+_0x1be269));}}}
@@ -1 +1 @@
1
- const a16_0x3f339b=a16_0x3288;function a16_0x3288(_0x98d44d,_0x5eb4c9){_0x98d44d=_0x98d44d-0xfa;const _0x362fe3=a16_0x362f();let _0x328834=_0x362fe3[_0x98d44d];return _0x328834;}function a16_0x362f(){const _0x3a20b1=['15875ndcKzX','site','✔\x20Found\x20','verbose','cause','execute','8340900awofiG','databases','2222574zCZBtK','48qXCQwp','message','4143024zkFLGj','8qTnnQF','Pattern:\x20','name','length','log','database_name','Listing\x20databases...','2123160wGjHXr','📦\x20','List\x20all\x20databases','Error:\x20','30408NSfIlz','limit','7syTUzx','data','listDatabases','Site:\x20','\x20database','description','177602nqsXYx','error'];a16_0x362f=function(){return _0x3a20b1;};return a16_0x362f();}(function(_0x20c28e,_0x573102){const _0x3a623d=a16_0x3288,_0x47b231=_0x20c28e();while(!![]){try{const _0x470473=-parseInt(_0x3a623d(0x111))/0x1+-parseInt(_0x3a623d(0x109))/0x2*(parseInt(_0x3a623d(0xfb))/0x3)+-parseInt(_0x3a623d(0xfe))/0x4*(parseInt(_0x3a623d(0x113))/0x5)+parseInt(_0x3a623d(0xfa))/0x6*(-parseInt(_0x3a623d(0x10b))/0x7)+-parseInt(_0x3a623d(0x105))/0x8+parseInt(_0x3a623d(0xfd))/0x9+parseInt(_0x3a623d(0x119))/0xa;if(_0x470473===_0x573102)break;else _0x47b231['push'](_0x47b231['shift']());}catch(_0x42f73d){_0x47b231['push'](_0x47b231['shift']());}}}(a16_0x362f,0x387da));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a16_0x3f339b(0x100)]=a16_0x3f339b(0x11a);[a16_0x3f339b(0x110)]=a16_0x3f339b(0x107);async[a16_0x3f339b(0x118)](_0x148aaa){const _0x5e02b6=a16_0x3f339b,{options:_0x21a0ee,args:_0x390475,tdx:_0xc9c78d}=_0x148aaa,_0x5087df=_0x390475[0x0];try{_0x21a0ee['verbose']&&(console[_0x5e02b6(0x112)](_0x5e02b6(0x10e)+_0x21a0ee[_0x5e02b6(0x114)]),_0x5087df&&console[_0x5e02b6(0x112)](_0x5e02b6(0xff)+_0x5087df));const _0x4df9f5=resolveLimit(_0x21a0ee[_0x5e02b6(0x10a)],DEFAULT_LISTING_LIMIT),_0x58cb07=await withSpinner(_0x5e02b6(0x104),()=>_0xc9c78d['query'][_0x5e02b6(0x10d)](_0x5087df,_0x4df9f5),{'verbose':_0x21a0ee[_0x5e02b6(0x116)]}),_0x3417bb=_0x58cb07[_0x5e02b6(0x10c)];console['error'](_0x5e02b6(0x115)+_0x3417bb[_0x5e02b6(0x101)]+_0x5e02b6(0x10f)+(_0x3417bb[_0x5e02b6(0x101)]!==0x1?'s':''));if(isStructuredFormat(_0x21a0ee))await handleSDKOutput(_0x3417bb,{..._0x21a0ee,'limit':_0x4df9f5});else for(const _0x1d04da of _0x3417bb){console[_0x5e02b6(0x102)](_0x5e02b6(0x106)+_0x1d04da[_0x5e02b6(0x103)]);}return 0x0;}catch(_0x8fcd5c){if(_0x8fcd5c instanceof SDKError)return console['error'](_0x5e02b6(0x108)+_0x8fcd5c[_0x5e02b6(0xfc)]),_0x8fcd5c[_0x5e02b6(0x117)]&&console[_0x5e02b6(0x112)]('\x20\x20Cause:\x20'+_0x8fcd5c[_0x5e02b6(0x117)]),0x1;throw _0x8fcd5c;}}}
1
+ function a16_0x1126(){const _0x22fb1d=['query','database_name','execute','databases','80JwiJio','name','limit','Error:\x20','length','📦\x20','verbose','16IFRbKL','5328666xBhSJm','\x20database','5579690vwKmcI','2205875vBlHwL','error','141171RZmihn','message','\x20\x20Cause:\x20','description','site','11lGaKEh','Pattern:\x20','5fhSexb','596672DCzGSc','cause','✔\x20Found\x20','6962DDQBPY','57228ppuhwZ'];a16_0x1126=function(){return _0x22fb1d;};return a16_0x1126();}function a16_0x372b(_0x32fff1,_0x3653fc){_0x32fff1=_0x32fff1-0x1e3;const _0x1126b1=a16_0x1126();let _0x372bf1=_0x1126b1[_0x32fff1];return _0x372bf1;}const a16_0x1ed18a=a16_0x372b;(function(_0x5e6073,_0x692906){const _0x3f95f7=a16_0x372b,_0x1fc848=_0x5e6073();while(!![]){try{const _0x4313a6=-parseInt(_0x3f95f7(0x1ed))/0x1*(-parseInt(_0x3f95f7(0x1f1))/0x2)+parseInt(_0x3f95f7(0x1e6))/0x3+-parseInt(_0x3f95f7(0x1ee))/0x4+parseInt(_0x3f95f7(0x1f7))/0x5*(-parseInt(_0x3f95f7(0x1f2))/0x6)+parseInt(_0x3f95f7(0x1e4))/0x7*(parseInt(_0x3f95f7(0x1fe))/0x8)+-parseInt(_0x3f95f7(0x1ff))/0x9+-parseInt(_0x3f95f7(0x1e3))/0xa*(-parseInt(_0x3f95f7(0x1eb))/0xb);if(_0x4313a6===_0x692906)break;else _0x1fc848['push'](_0x1fc848['shift']());}catch(_0x3b46fb){_0x1fc848['push'](_0x1fc848['shift']());}}}(a16_0x1126,0x579af));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';export class DatabasesCommand extends BaseCommand{[a16_0x1ed18a(0x1f8)]=a16_0x1ed18a(0x1f6);[a16_0x1ed18a(0x1e9)]='List\x20all\x20databases';async[a16_0x1ed18a(0x1f5)](_0x34458d){const _0x463b2b=a16_0x1ed18a,{options:_0x4f9ec4,args:_0x3a5aac,tdx:_0x474610}=_0x34458d,_0x5a3a9c=_0x3a5aac[0x0];try{_0x4f9ec4[_0x463b2b(0x1fd)]&&(console[_0x463b2b(0x1e5)]('Site:\x20'+_0x4f9ec4[_0x463b2b(0x1ea)]),_0x5a3a9c&&console[_0x463b2b(0x1e5)](_0x463b2b(0x1ec)+_0x5a3a9c));const _0x2295c9=resolveLimit(_0x4f9ec4[_0x463b2b(0x1f9)],DEFAULT_LISTING_LIMIT),_0x1f45aa=await withSpinner('Listing\x20databases...',()=>_0x474610[_0x463b2b(0x1f3)]['listDatabases'](_0x5a3a9c,_0x2295c9),{'verbose':_0x4f9ec4[_0x463b2b(0x1fd)]}),_0x405489=_0x1f45aa['data'];console[_0x463b2b(0x1e5)](_0x463b2b(0x1f0)+_0x405489['length']+_0x463b2b(0x200)+(_0x405489[_0x463b2b(0x1fb)]!==0x1?'s':''));if(isStructuredFormat(_0x4f9ec4))await handleSDKOutput(_0x405489,{..._0x4f9ec4,'limit':_0x2295c9});else for(const _0x4102aa of _0x405489){console['log'](_0x463b2b(0x1fc)+_0x4102aa[_0x463b2b(0x1f4)]);}return 0x0;}catch(_0x4f2d30){if(_0x4f2d30 instanceof SDKError)return console[_0x463b2b(0x1e5)](_0x463b2b(0x1fa)+_0x4f2d30[_0x463b2b(0x1e7)]),_0x4f2d30[_0x463b2b(0x1ef)]&&console[_0x463b2b(0x1e5)](_0x463b2b(0x1e8)+_0x4f2d30[_0x463b2b(0x1ef)]),0x1;throw _0x4f2d30;}}}
@@ -1 +1 @@
1
- const a17_0x116c67=a17_0x7495;(function(_0x549af4,_0x2ae40b){const _0x46108d=a17_0x7495,_0x34a488=_0x549af4();while(!![]){try{const _0x300d87=-parseInt(_0x46108d(0x160))/0x1+parseInt(_0x46108d(0x15e))/0x2+parseInt(_0x46108d(0x15d))/0x3*(-parseInt(_0x46108d(0x15a))/0x4)+-parseInt(_0x46108d(0x166))/0x5+-parseInt(_0x46108d(0x15c))/0x6+parseInt(_0x46108d(0x15b))/0x7*(-parseInt(_0x46108d(0x164))/0x8)+parseInt(_0x46108d(0x159))/0x9;if(_0x300d87===_0x2ae40b)break;else _0x34a488['push'](_0x34a488['shift']());}catch(_0x2ccd0d){_0x34a488['push'](_0x34a488['shift']());}}}(a17_0x53f0,0x251e1));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_0x53f0(){const _0x1dc90a=['name','4296XtOcRk','listEmailSenders','233220abFhEO','delivery:senders','data','limit','filter','4179087xaHbHr','876gZylwI','3472jjjpei','75846KeEpjM','1899lymuYu','521732CSDvJc','execute','108912wjYLYQ','verbose','List\x20email\x20senders'];a17_0x53f0=function(){return _0x1dc90a;};return a17_0x53f0();}function a17_0x7495(_0xe3fdf7,_0x22fb13){_0xe3fdf7=_0xe3fdf7-0x159;const _0x53f076=a17_0x53f0();let _0x74958f=_0x53f076[_0xe3fdf7];return _0x74958f;}import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{['name']=a17_0x116c67(0x167);['description']=a17_0x116c67(0x162);async[a17_0x116c67(0x15f)](_0x5e5003){const _0x3ab22d=a17_0x116c67,{options:_0x53d9d5,args:_0x166edf,tdx:_0x622ba}=_0x5e5003,_0x5c7d79=_0x166edf[0x0],_0x367bd4=resolveLimit(_0x53d9d5[_0x3ab22d(0x169)],DEFAULT_LLM_LIMIT),_0x592ca2=_0x53d9d5,_0x515174=await resolveWorkspaceIdFromOptions(_0x592ca2,_0x622ba),_0x1aad6a=await withSpinner('Fetching\x20email\x20senders...',()=>_0x622ba['delivery'][_0x3ab22d(0x165)]({'workspaceId':_0x515174,'limit':_0x367bd4}),{'verbose':_0x53d9d5[_0x3ab22d(0x161)]});let _0x4d5c1b=_0x1aad6a[_0x3ab22d(0x168)];return _0x5c7d79&&(_0x4d5c1b=_0x1aad6a[_0x3ab22d(0x168)][_0x3ab22d(0x16a)](_0x30a2ea=>matchGlobPattern(_0x30a2ea[_0x3ab22d(0x163)],_0x5c7d79))),await handleSDKOutput(_0x4d5c1b,_0x53d9d5),0x0;}}
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 +1 @@
1
- const a18_0x3b92c5=a18_0xd1b1;(function(_0x5486ae,_0x4d63ee){const _0x3f27dc=a18_0xd1b1,_0x1717a8=_0x5486ae();while(!![]){try{const _0x579153=parseInt(_0x3f27dc(0x151))/0x1+parseInt(_0x3f27dc(0x138))/0x2+parseInt(_0x3f27dc(0x143))/0x3+-parseInt(_0x3f27dc(0x139))/0x4*(parseInt(_0x3f27dc(0x13c))/0x5)+parseInt(_0x3f27dc(0x153))/0x6+-parseInt(_0x3f27dc(0x13d))/0x7+-parseInt(_0x3f27dc(0x13e))/0x8;if(_0x579153===_0x4d63ee)break;else _0x1717a8['push'](_0x1717a8['shift']());}catch(_0x3c2467){_0x1717a8['push'](_0x1717a8['shift']());}}}(a18_0x8714,0xcc002));function a18_0xd1b1(_0x57ab94,_0x2bc038){_0x57ab94=_0x57ab94-0x137;const _0x87146a=a18_0x8714();let _0xd1b13a=_0x87146a[_0x57ab94];return _0xd1b13a;}import{BaseCommand}from'./command.js';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';function a18_0x8714(){const _0x3b6ffb=['length','cause','Database:\x20','message','3176244UNwdfp','validate','data','Table:\x20','\x27\x20does\x20not\x20exist','error','Error:\x20','database','Table\x20\x27','args','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','\x20column','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','describeTable','1285192zIjNJb','description','8646270yFmMIH','\x20\x20Cause:\x20','verbose','site','Site:\x20','998856dDQcZr','252ZDlMtp','describe','✖\x20Table\x20not\x20found','5430oviMiG','6764653lQeFRr','19312240OjDiEZ'];a18_0x8714=function(){return _0x3b6ffb;};return a18_0x8714();}export class DescribeCommand extends BaseCommand{['name']=a18_0x3b92c5(0x13a);[a18_0x3b92c5(0x152)]='Describe\x20table\x20schema';async['execute'](_0x227c28){return this['describeTable'](_0x227c28);}async['describeTable'](_0x5c2bc6){const _0x26d827=a18_0x3b92c5,{options:_0x4cb6fc,args:_0x27753f,tdx:_0x4a891d}=_0x5c2bc6;let _0x54d8cc;try{_0x54d8cc=parseTableReference(_0x27753f[0x0]);const _0x2e84ea=_0x4cb6fc[_0x26d827(0x14a)];!_0x54d8cc[_0x26d827(0x14a)]&&_0x2e84ea&&(_0x54d8cc['database']=_0x2e84ea);const _0x27385b=validateTableDescribeReference(_0x54d8cc);if(_0x27385b)return console[_0x26d827(0x148)]('Error:\x20'+_0x27385b),0x1;}catch(_0x19de8e){return console[_0x26d827(0x148)](_0x26d827(0x149)+_0x19de8e[_0x26d827(0x142)]),0x1;}const _0x555451=_0x54d8cc[_0x26d827(0x14a)],_0x4bb5ea=_0x54d8cc['table'];try{_0x4cb6fc[_0x26d827(0x155)]&&(console[_0x26d827(0x148)](_0x26d827(0x137)+_0x4cb6fc[_0x26d827(0x156)]),console[_0x26d827(0x148)](_0x26d827(0x141)+_0x555451),console['error'](_0x26d827(0x146)+_0x4bb5ea));const _0x50949e=await withSpinner('Describing\x20table\x20'+_0x555451+'.'+_0x4bb5ea+'...',()=>_0x4a891d['query'][_0x26d827(0x150)](_0x555451,_0x4bb5ea),{'verbose':_0x4cb6fc[_0x26d827(0x155)]}),_0x550fb8=_0x50949e[_0x26d827(0x145)];if(_0x550fb8['length']===0x0)return console['error'](_0x26d827(0x13b)),console[_0x26d827(0x148)](_0x26d827(0x14b)+_0x555451+'.'+_0x4bb5ea+_0x26d827(0x147)),0x1;return console[_0x26d827(0x148)]('✔\x20Found\x20'+_0x550fb8[_0x26d827(0x13f)]+_0x26d827(0x14e)+(_0x550fb8[_0x26d827(0x13f)]!==0x1?'s':'')+'\x20in\x20'+_0x555451+'.'+_0x4bb5ea),await handleSDKOutput(_0x550fb8,_0x4cb6fc),0x0;}catch(_0x55efc3){if(_0x55efc3 instanceof SDKError)return console['error'](_0x26d827(0x149)+_0x55efc3[_0x26d827(0x142)]),_0x55efc3[_0x26d827(0x140)]&&console[_0x26d827(0x148)](_0x26d827(0x154)+_0x55efc3[_0x26d827(0x140)]),0x1;throw _0x55efc3;}}[a18_0x3b92c5(0x144)](_0x3216c5){const _0x535bb1=a18_0x3b92c5;if(_0x3216c5[_0x535bb1(0x14c)][_0x535bb1(0x13f)]===0x0)return _0x535bb1(0x14f);if(_0x3216c5[_0x535bb1(0x14c)][_0x535bb1(0x13f)]>0x1)return _0x535bb1(0x14d);return undefined;}}
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 +1 @@
1
- const a19_0x4aa096=a19_0x41f4;(function(_0x1b532a,_0x422384){const _0x5655aa=a19_0x41f4,_0x398b9d=_0x1b532a();while(!![]){try{const _0x410a60=parseInt(_0x5655aa(0x16d))/0x1+parseInt(_0x5655aa(0x13b))/0x2+-parseInt(_0x5655aa(0x14c))/0x3*(parseInt(_0x5655aa(0x177))/0x4)+-parseInt(_0x5655aa(0x150))/0x5+parseInt(_0x5655aa(0x142))/0x6+parseInt(_0x5655aa(0x13e))/0x7+parseInt(_0x5655aa(0x168))/0x8*(-parseInt(_0x5655aa(0x15f))/0x9);if(_0x410a60===_0x422384)break;else _0x398b9d['push'](_0x398b9d['shift']());}catch(_0x4544bc){_0x398b9d['push'](_0x398b9d['shift']());}}}(a19_0x3e76,0x689f6));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a19_0x41f4(_0x44a933,_0x5818ab){_0x44a933=_0x44a933-0x137;const _0x3e766a=a19_0x3e76();let _0x41f407=_0x3e766a[_0x44a933];return _0x41f407;}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a19_0x3e76(){const _0x47b13c=['filter','847805KnjwMJ','name','dryRun','data','-\x20no\x20files\x20written','session','\x20new\x20files','verbose','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','repeat','4goDtRq','\x27...','Write\x20','files','utf-8','195628WZDIQh','dim','cwd','5212725kjjdNa','red','config','execute','3967350xOwMmu','\x20campaigns','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','hasChanges','\x20unchanged\x20files','cyan','\x20files\x20to\x20','\x0aError:','\x0aChanges\x20to\x20\x27','2561022VxspuG','relativePath','Pull\x20campaigns\x20to\x20YAML\x20files','Workspace\x20is\x20required.','2220555VUsKlc','type','campaigns','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','engage_workspace','yes','isNew','setPhase','yellow','\x0aPull\x20summary\x20for\x20workspace\x20\x27','error','diff','absolutePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','description','27esYhpO','counts','length','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','green','✔\x20Context\x20set:\x20','workspaceName','\x20=\x20','workspace','1667200aruKCK','\x20\x20Target:\x20','engage','No\x20campaigns\x20found\x20in\x20workspace\x20\x27'];a19_0x3e76=function(){return _0x47b13c;};return a19_0x3e76();}import a19_0x3111d0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a19_0x10f3cc from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{[a19_0x4aa096(0x16e)]='engage:campaign:pull';[a19_0x4aa096(0x15e)]=a19_0x4aa096(0x14e);async[a19_0x4aa096(0x141)](_0x19c849){const _0x33168a=a19_0x4aa096,{options:_0xe0daf9,args:_0x27cf38,tdx:_0x420292}=_0x19c849,_0xd3b609=_0xe0daf9,_0x33dd0a=await resolveWorkspaceName(_0x27cf38[0x0],_0xd3b609);if(!_0x33dd0a)return console[_0x33168a(0x15a)](a19_0x3111d0[_0x33168a(0x158)](_0x33168a(0x14f))),console[_0x33168a(0x15a)](_0x33168a(0x162)),console[_0x33168a(0x15a)](_0x33168a(0x15d)),console[_0x33168a(0x15a)](_0x33168a(0x153)),0x1;const _0xffb7c4=await withProgressSpinner('Pulling\x20campaigns\x20from\x20\x27'+_0x33dd0a+_0x33168a(0x137),_0x2d477a=>pullCampaigns({'engage':_0x420292[_0x33168a(0x16a)],'segment':_0x420292['segment']},_0x33dd0a,{'campaignName':_0xd3b609[_0x33168a(0x16e)],'campaignType':_0xd3b609[_0x33168a(0x151)],'progress':{'update':_0xefd669=>{const _0x95fc67=_0x33168a;_0x2d477a[_0x95fc67(0x157)](_0xefd669);}}}),{'verbose':_0xd3b609[_0x33168a(0x174)]}),_0x206b7b=_0xffb7c4[_0x33168a(0x170)];if(_0x206b7b[_0x33168a(0x160)][_0x33168a(0x152)]===0x0)return console[_0x33168a(0x15a)](a19_0x3111d0[_0x33168a(0x158)](_0x33168a(0x16b)+_0x206b7b[_0x33168a(0x165)]+'\x27')),0x0;const _0x5b6bcb=_0x206b7b['files'][_0x33168a(0x16c)](_0x873ce0=>_0x873ce0[_0x33168a(0x156)]),_0x1a9896=_0x206b7b[_0x33168a(0x139)]['filter'](_0x5b23f0=>!_0x5b23f0[_0x33168a(0x156)]&&_0x5b23f0[_0x33168a(0x146)]),_0x249016=_0x206b7b[_0x33168a(0x139)][_0x33168a(0x16c)](_0x1155f3=>!_0x1155f3['isNew']&&!_0x1155f3[_0x33168a(0x146)]);console[_0x33168a(0x15a)](_0x33168a(0x159)+_0x206b7b[_0x33168a(0x165)]+'\x27:'),console[_0x33168a(0x15a)]('\x20\x20'+a19_0x3111d0[_0x33168a(0x148)](_0x206b7b[_0x33168a(0x160)][_0x33168a(0x152)]+_0x33168a(0x143))),console['error']('\x20\x20'+a19_0x3111d0[_0x33168a(0x163)]('+\x20'+_0x5b6bcb[_0x33168a(0x161)]+_0x33168a(0x173))),console[_0x33168a(0x15a)]('\x20\x20'+a19_0x3111d0[_0x33168a(0x158)]('~\x20'+_0x1a9896['length']+'\x20changed\x20files')),console['error']('\x20\x20'+a19_0x3111d0['dim']('=\x20'+_0x249016[_0x33168a(0x161)]+_0x33168a(0x147))),console[_0x33168a(0x15a)](_0x33168a(0x169)+a19_0x3111d0[_0x33168a(0x148)](_0x206b7b['targetDir'])+'\x0a');if(_0x1a9896[_0x33168a(0x161)]>0x0)for(const _0x27757a of _0x1a9896){console[_0x33168a(0x15a)](_0x33168a(0x14b)+_0x27757a[_0x33168a(0x14d)]+'\x27:'),console[_0x33168a(0x15a)]('─'['repeat'](0x3c)),console[_0x33168a(0x15a)](_0x27757a[_0x33168a(0x15b)]),console[_0x33168a(0x15a)]('─'[_0x33168a(0x176)](0x3c));}if(_0xd3b609[_0x33168a(0x16f)])return console[_0x33168a(0x15a)](a19_0x3111d0[_0x33168a(0x158)](_0x33168a(0x145))),0x0;if(_0x5b6bcb[_0x33168a(0x161)]===0x0&&_0x1a9896[_0x33168a(0x161)]===0x0)return console['error'](a19_0x3111d0[_0x33168a(0x163)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x206b7b[_0x33168a(0x165)]},_0xd3b609[_0x33168a(0x172)]),0x0;if(!_0xd3b609[_0x33168a(0x155)]){if(!isInteractive())return console[_0x33168a(0x15a)](a19_0x3111d0[_0x33168a(0x13f)](_0x33168a(0x14a)),_0x33168a(0x175)),console['error'](a19_0x3111d0['dim'](_0x33168a(0x144))),0x1;const _0x11ed3c=await confirmKey(_0x33168a(0x138)+(_0x5b6bcb[_0x33168a(0x161)]+_0x1a9896[_0x33168a(0x161)])+'\x20files?');if(!_0x11ed3c)return console[_0x33168a(0x15a)](a19_0x3111d0[_0x33168a(0x158)]('Aborted.'),_0x33168a(0x171)),0x1;}for(const _0x357434 of _0x206b7b[_0x33168a(0x139)]){if(_0x357434[_0x33168a(0x156)]||_0x357434['hasChanges']){const _0x45261c=a19_0x10f3cc['dirname'](_0x357434[_0x33168a(0x15c)]);!existsSync(_0x45261c)&&mkdirSync(_0x45261c,{'recursive':!![]}),writeFileSync(_0x357434['absolutePath'],_0x357434['content'],_0x33168a(0x13a));}}return console[_0x33168a(0x15a)](a19_0x3111d0[_0x33168a(0x163)]('✔\x20Pulled\x20'+(_0x5b6bcb[_0x33168a(0x161)]+_0x1a9896['length'])+_0x33168a(0x149)+_0x206b7b['targetDir'])),saveSessionContext({'engage_workspace':_0x206b7b[_0x33168a(0x165)]},_0xd3b609[_0x33168a(0x172)]),console[_0x33168a(0x15a)](a19_0x3111d0[_0x33168a(0x163)](_0x33168a(0x164)+a19_0x3111d0[_0x33168a(0x13c)](_0x33168a(0x154))+_0x33168a(0x166)+a19_0x3111d0[_0x33168a(0x148)](_0x206b7b[_0x33168a(0x165)]))),0x0;}}async function resolveWorkspaceName(_0x4f8178,_0x164aab){const _0x55cf20=a19_0x4aa096;if(_0x4f8178)return _0x4f8178;if(_0x164aab['workspace'])return _0x164aab[_0x55cf20(0x167)];const _0x4606ca=tryFindTdxConfig(process[_0x55cf20(0x13d)]());if(_0x4606ca?.[_0x55cf20(0x140)][_0x55cf20(0x154)])return _0x4606ca['config'][_0x55cf20(0x154)];const _0x11eb0e=loadSessionContext(_0x164aab['session']);if(_0x11eb0e?.[_0x55cf20(0x154)])return _0x11eb0e['engage_workspace'];return undefined;}
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 +1 @@
1
- const a20_0x27f55c=a20_0x130f;(function(_0x5e37e3,_0x45cdca){const _0x4ee790=a20_0x130f,_0xa3d0ee=_0x5e37e3();while(!![]){try{const _0x47bcf7=-parseInt(_0x4ee790(0x9f))/0x1*(-parseInt(_0x4ee790(0x75))/0x2)+parseInt(_0x4ee790(0xa8))/0x3+-parseInt(_0x4ee790(0xaa))/0x4*(-parseInt(_0x4ee790(0x6c))/0x5)+-parseInt(_0x4ee790(0x8a))/0x6+parseInt(_0x4ee790(0x76))/0x7*(-parseInt(_0x4ee790(0x6e))/0x8)+parseInt(_0x4ee790(0x9a))/0x9+-parseInt(_0x4ee790(0x80))/0xa;if(_0x47bcf7===_0x45cdca)break;else _0xa3d0ee['push'](_0xa3d0ee['shift']());}catch(_0x560eaf){_0xa3d0ee['push'](_0xa3d0ee['shift']());}}}(a20_0x5255,0x2e9be));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a20_0x5255(){const _0x5904bf=['resolve','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','green','engage_workspace','configDir','1626654efsFOb','created','cyan','Aborted.','name','site','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','setPhase','Workspace\x20is\x20required.','red','error','\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','workspace','map','1\x20campaign\x20file:\x20','\x0aValidation\x20errors\x20in\x20','1934550iOgUKx','relativePath','\x20campaign\x20files','errors','config','201qIymgT','yellow','session','verbose','\x0aError:','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','dim','Pushing\x20campaigns...','warnings','571482ZrcMAY','updated','4YuvHUX','✔\x20Updated\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','campaign_type','message','segment','\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)','Found\x20','def','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','\x20campaigns','Preparing\x20push\x20to\x20workspace\x20\x27','length','campaignId','\x20campaigns?','893770OymcFd','valid','189264rvzpmO','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','engage','create','description','\x0aPush\x20summary\x20for\x20workspace\x20\x27','dryRun','2114PvjPFu','7LDFuhk','cwd','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','\x20errors:','\x20\x20\x20\x20','\x20campaigns\x20to\x20update:','path','\x27...','action','data','3109780UOyOPV','filter','Push\x20','resolveWorkspaceId','dirname'];a20_0x5255=function(){return _0x5904bf;};return a20_0x5255();}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_0x555848 from'chalk';function a20_0x130f(_0x389991,_0x1b0aa8){_0x389991=_0x389991-0x65;const _0x525551=a20_0x5255();let _0x130f7f=_0x525551[_0x389991];return _0x130f7f;}import a20_0x6dfccd 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_0x27f55c(0x72)]=a20_0x27f55c(0x90);async['execute'](_0x4f63de){const _0x4e2f5c=a20_0x27f55c,{options:_0x5c8b61,args:_0x49ab3f,tdx:_0x45abd6}=_0x4f63de,_0x2f4238=_0x5c8b61,_0x27a86e=_0x49ab3f[0x0],_0x4498a9=_0x27a86e?a20_0x6dfccd[_0x4e2f5c(0x85)](_0x27a86e):undefined,_0x3fbc8b=_0x4498a9?isYamlFile(_0x4498a9):![];let _0x38978b;if(_0x3fbc8b&&_0x4498a9)_0x38978b=a20_0x6dfccd[_0x4e2f5c(0x84)](_0x4498a9);else _0x4498a9?_0x38978b=_0x4498a9:_0x38978b=process[_0x4e2f5c(0x77)]();let _0x3bedbf;const _0x148285=tryFindTdxConfig(_0x38978b);_0x148285?.[_0x4e2f5c(0x9e)][_0x4e2f5c(0x88)]&&(_0x3bedbf=_0x148285[_0x4e2f5c(0x9e)]['engage_workspace'],!_0x3fbc8b&&(_0x38978b=_0x148285[_0x4e2f5c(0x89)]));_0x2f4238[_0x4e2f5c(0x96)]&&(_0x3bedbf=_0x2f4238[_0x4e2f5c(0x96)]);if(!_0x3bedbf){const _0x4dfb78=loadSessionContext(_0x2f4238['session']);_0x4dfb78?.[_0x4e2f5c(0x88)]&&(_0x3bedbf=_0x4dfb78[_0x4e2f5c(0x88)]);}if(!_0x3bedbf)return console[_0x4e2f5c(0x94)](a20_0x555848['yellow'](_0x4e2f5c(0x92))),console[_0x4e2f5c(0x94)](_0x4e2f5c(0x95)),console['error'](_0x4e2f5c(0xb0)),console['error']('\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[_0x4e2f5c(0x94)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x394dc1;_0x3fbc8b&&_0x4498a9?_0x394dc1=[_0x4498a9]:_0x394dc1=discoverCampaignFiles(_0x38978b);if(_0x394dc1['length']===0x0)return console['error'](a20_0x555848[_0x4e2f5c(0xa0)](_0x4e2f5c(0x66)+_0x38978b)),console[_0x4e2f5c(0x94)](a20_0x555848[_0x4e2f5c(0xa5)](_0x4e2f5c(0x78))),0x1;const _0x142cbe=_0x394dc1[_0x4e2f5c(0x97)](_0x45a558=>parseCampaignFile(_0x45a558,a20_0x6dfccd['dirname'](_0x45a558))),_0x2cb5fd=_0x142cbe[_0x4e2f5c(0x69)]===0x1?_0x4e2f5c(0x98)+_0x142cbe[0x0][_0x4e2f5c(0x65)][_0x4e2f5c(0x8e)]:_0x142cbe[_0x4e2f5c(0x69)]+_0x4e2f5c(0x9c);console[_0x4e2f5c(0x94)](_0x4e2f5c(0xb1)+a20_0x555848[_0x4e2f5c(0x8c)](_0x2cb5fd));let _0xd21c0f=![];for(const _0x17b86d of _0x142cbe){const _0x3ff644=validateCampaignDef(_0x17b86d['def']);if(!_0x3ff644[_0x4e2f5c(0x6d)]){_0xd21c0f=!![],console['error'](a20_0x555848[_0x4e2f5c(0x93)](_0x4e2f5c(0x99)+_0x17b86d[_0x4e2f5c(0x9b)]+':'));for(const _0x48eb2d of _0x3ff644['errors']){console[_0x4e2f5c(0x94)]('\x20\x20'+a20_0x555848[_0x4e2f5c(0x93)]('✗')+'\x20'+_0x48eb2d[_0x4e2f5c(0x7c)]+':\x20'+_0x48eb2d[_0x4e2f5c(0xae)]);}}for(const _0x2c113d of _0x3ff644[_0x4e2f5c(0xa7)]){console[_0x4e2f5c(0x94)]('\x20\x20'+a20_0x555848[_0x4e2f5c(0xa0)]('⚠')+'\x20'+_0x2c113d[_0x4e2f5c(0x7c)]+':\x20'+_0x2c113d[_0x4e2f5c(0xae)]);}}if(_0xd21c0f)return console[_0x4e2f5c(0x94)](a20_0x555848[_0x4e2f5c(0x93)](_0x4e2f5c(0x86))),0x1;const _0x3c666c=await _0x45abd6[_0x4e2f5c(0x70)][_0x4e2f5c(0x83)](_0x3bedbf),_0x32b7dc=await withProgressSpinner(_0x4e2f5c(0x68)+_0x3bedbf+_0x4e2f5c(0x7d),_0x5d582d=>preparePush({'engage':_0x45abd6[_0x4e2f5c(0x70)],'segment':_0x45abd6[_0x4e2f5c(0xaf)]},_0x142cbe,_0x3c666c,{'progress':{'update':_0x267647=>_0x5d582d[_0x4e2f5c(0x91)](_0x267647)}}),{'verbose':_0x2f4238['verbose']}),_0x45b70a=_0x32b7dc['data'];await withProgressSpinner('Resolving\x20references...',_0x4b4785=>resolveAndBuildInputs({'engage':_0x45abd6[_0x4e2f5c(0x70)],'segment':_0x45abd6['segment']},_0x45b70a,_0x3c666c,{'progress':{'update':_0x108a36=>_0x4b4785[_0x4e2f5c(0x91)](_0x108a36)}}),{'verbose':_0x2f4238['verbose']});const _0x40f6a4=_0x45b70a[_0x4e2f5c(0x81)](_0x472b77=>_0x472b77[_0x4e2f5c(0x7e)]===_0x4e2f5c(0x71)),_0x3c1343=_0x45b70a[_0x4e2f5c(0x81)](_0x4f19ac=>_0x4f19ac['action']==='update');console[_0x4e2f5c(0x94)](_0x4e2f5c(0x73)+_0x3bedbf+'\x27:');if(_0x40f6a4['length']>0x0){console[_0x4e2f5c(0x94)]('\x20\x20'+a20_0x555848[_0x4e2f5c(0x87)]('+\x20'+_0x40f6a4[_0x4e2f5c(0x69)]+'\x20new\x20campaigns:'));for(const _0x5b755c of _0x40f6a4){console[_0x4e2f5c(0x94)]('\x20\x20\x20\x20'+a20_0x555848['green']('+')+'\x20'+_0x5b755c[_0x4e2f5c(0x65)][_0x4e2f5c(0x8e)]+'\x20('+_0x5b755c[_0x4e2f5c(0x65)]['campaign_type']+')');}}if(_0x3c1343[_0x4e2f5c(0x69)]>0x0){console['error']('\x20\x20'+a20_0x555848[_0x4e2f5c(0xa0)]('~\x20'+_0x3c1343[_0x4e2f5c(0x69)]+_0x4e2f5c(0x7b)));for(const _0xbab645 of _0x3c1343){console[_0x4e2f5c(0x94)](_0x4e2f5c(0x7a)+a20_0x555848['yellow']('~')+'\x20'+_0xbab645[_0x4e2f5c(0x65)][_0x4e2f5c(0x8e)]+'\x20('+_0xbab645[_0x4e2f5c(0x65)][_0x4e2f5c(0xad)]+')');}}if(_0x40f6a4[_0x4e2f5c(0x69)]===0x0&&_0x3c1343[_0x4e2f5c(0x69)]===0x0)return console['error'](a20_0x555848[_0x4e2f5c(0x87)](_0x4e2f5c(0xa4))),0x0;if(_0x2f4238[_0x4e2f5c(0x74)])return console[_0x4e2f5c(0x94)](a20_0x555848[_0x4e2f5c(0xa0)](_0x4e2f5c(0xac))),0x0;if(!_0x2f4238['yes']){if(!isInteractive())return console[_0x4e2f5c(0x94)](a20_0x555848[_0x4e2f5c(0x93)](_0x4e2f5c(0xa3)),_0x4e2f5c(0x6f)),console[_0x4e2f5c(0x94)](a20_0x555848[_0x4e2f5c(0xa5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5c5370=await confirmKey(_0x4e2f5c(0x82)+(_0x40f6a4[_0x4e2f5c(0x69)]+_0x3c1343[_0x4e2f5c(0x69)])+_0x4e2f5c(0x6b));if(!_0x5c5370)return console['error'](a20_0x555848[_0x4e2f5c(0xa0)](_0x4e2f5c(0x8d)),'-\x20no\x20changes\x20applied'),0x1;}const _0x13b786=await withProgressSpinner(_0x4e2f5c(0xa6),_0x5ac608=>executePush({'engage':_0x45abd6[_0x4e2f5c(0x70)],'segment':_0x45abd6[_0x4e2f5c(0xaf)]},_0x45b70a,{'progress':{'update':_0x88d64a=>_0x5ac608['setPhase'](_0x88d64a)}}),{'verbose':_0x2f4238[_0x4e2f5c(0xa2)]}),_0x23c53d=_0x13b786[_0x4e2f5c(0x7f)];for(const _0x5098e3 of _0x23c53d['results']){if(_0x5098e3['campaignId']&&(_0x5098e3[_0x4e2f5c(0x7e)]===_0x4e2f5c(0x8b)||_0x5098e3['action']===_0x4e2f5c(0xa9))){const _0x4a6329=getCampaignUrl(_0x2f4238[_0x4e2f5c(0x8f)],_0x3c666c,_0x5098e3[_0x4e2f5c(0x6a)]),_0x369f4e=_0x5098e3['action']===_0x4e2f5c(0x8b)?'+':'~',_0x288213=_0x5098e3[_0x4e2f5c(0x7e)]===_0x4e2f5c(0x8b)?a20_0x555848['green'](_0x369f4e):a20_0x555848['yellow'](_0x369f4e);console['error']('\x20\x20'+_0x288213+'\x20'+hyperlink(_0x5098e3[_0x4e2f5c(0x8e)],_0x4a6329)+'\x20'+a20_0x555848[_0x4e2f5c(0xa5)](_0x4a6329));}}_0x23c53d[_0x4e2f5c(0x8b)]>0x0&&console['error'](a20_0x555848[_0x4e2f5c(0x87)]('✔\x20Created\x20'+_0x23c53d[_0x4e2f5c(0x8b)]+_0x4e2f5c(0x67)));_0x23c53d[_0x4e2f5c(0xa9)]>0x0&&console['error'](a20_0x555848[_0x4e2f5c(0x87)](_0x4e2f5c(0xab)+_0x23c53d['updated']+_0x4e2f5c(0x67)));if(_0x23c53d['errors']['length']>0x0){console[_0x4e2f5c(0x94)](a20_0x555848[_0x4e2f5c(0x93)]('✘\x20'+_0x23c53d[_0x4e2f5c(0x9d)]['length']+_0x4e2f5c(0x79)));for(const _0x5e78f0 of _0x23c53d[_0x4e2f5c(0x9d)]){console[_0x4e2f5c(0x94)]('\x20\x20'+a20_0x555848['red'](_0x5e78f0[_0x4e2f5c(0x8e)])+':\x20'+_0x5e78f0[_0x4e2f5c(0x94)]);}}return saveSessionContext({'engage_workspace':_0x3bedbf},_0x2f4238[_0x4e2f5c(0xa1)]),_0x23c53d['errors'][_0x4e2f5c(0x69)]>0x0?0x1:0x0;}}
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 +1 @@
1
- const a21_0x5551b3=a21_0x4e9f;function a21_0x53bc(){const _0x5e1630=['17584476zUhNDC','campaign','.yml','163600pjIuDg','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','243aiXRwK','\x20warning(s)','\x20warning(s)\x20found','green','validCount','1225688WfoRki','22vhHdZc','execute','3510iBMpDr','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yellow','dirname','38316eLsokL','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','46757rVuqYa','engage:campaign:validate','hasErrors','209lRzqme','endsWith','resolve','reason','error','✔\x20All\x20','Validation\x20failed:\x20','skippedCount','length','verbose','relativePath','valid','filter','27RxjKsT','1036fYrtSQ','cwd','warnings','\x20campaign(s)\x20with\x20errors,\x20','warningCount','errors','dim','Error:\x20Directory\x20not\x20found:\x20','red','2983835ZzUfES','\x20(skipped:\x20','Validate\x20campaign\x20YAML\x20files','.yaml','\x20campaign(s)\x20valid','log'];a21_0x53bc=function(){return _0x5e1630;};return a21_0x53bc();}(function(_0x21fcc3,_0x40a8c0){const _0x49acd8=a21_0x4e9f,_0x578db0=_0x21fcc3();while(!![]){try{const _0x5acb57=parseInt(_0x49acd8(0x138))/0x1*(-parseInt(_0x49acd8(0x12f))/0x2)+-parseInt(_0x49acd8(0x129))/0x3*(-parseInt(_0x49acd8(0x135))/0x4)+-parseInt(_0x49acd8(0x152))/0x5+parseInt(_0x49acd8(0x131))/0x6*(parseInt(_0x49acd8(0x149))/0x7)+parseInt(_0x49acd8(0x12e))/0x8*(-parseInt(_0x49acd8(0x148))/0x9)+-parseInt(_0x49acd8(0x127))/0xa*(parseInt(_0x49acd8(0x13b))/0xb)+parseInt(_0x49acd8(0x124))/0xc;if(_0x5acb57===_0x40a8c0)break;else _0x578db0['push'](_0x578db0['shift']());}catch(_0x4cc5c7){_0x578db0['push'](_0x578db0['shift']());}}}(a21_0x53bc,0x6cf4d));import{BaseCommand}from'./command.js';function a21_0x4e9f(_0x7deac7,_0x5b039b){_0x7deac7=_0x7deac7-0x120;const _0x53bc3a=a21_0x53bc();let _0x4e9f6c=_0x53bc3a[_0x7deac7];return _0x4e9f6c;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a21_0x3c92bb from'chalk';import a21_0x18626f from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{['name']=a21_0x5551b3(0x139);[a21_0x5551b3(0x136)]=a21_0x5551b3(0x120);async[a21_0x5551b3(0x130)](_0xe8f2f0){const _0x28eace=a21_0x5551b3,{options:_0x5121f3,args:_0x22411a}=_0xe8f2f0,_0x302097=_0x5121f3,_0x2c6bac=_0x22411a[0x0],_0x2eea4c=_0x2c6bac?a21_0x18626f[_0x28eace(0x13d)](_0x2c6bac):undefined,_0x533652=_0x2eea4c?isYamlFile(_0x2eea4c):![];let _0x35402f,_0x5ba92f;if(_0x533652&&_0x2eea4c)_0x35402f=a21_0x18626f[_0x28eace(0x134)](_0x2eea4c),_0x5ba92f=_0x2eea4c;else _0x2eea4c?_0x35402f=_0x2eea4c:_0x35402f=process[_0x28eace(0x14a)]();if(!_0x5ba92f&&!existsSync(_0x35402f))return console[_0x28eace(0x13f)](a21_0x3c92bb[_0x28eace(0x151)](_0x28eace(0x150)+_0x35402f+'\x0a')),0x1;let _0x5406dc;if(_0x5ba92f){if(!_0x5ba92f[_0x28eace(0x13c)](_0x28eace(0x126))&&!_0x5ba92f[_0x28eace(0x13c)](_0x28eace(0x121)))return console[_0x28eace(0x13f)](a21_0x3c92bb[_0x28eace(0x151)](_0x28eace(0x132)+_0x5ba92f+'\x0a')),0x1;_0x5406dc=[_0x5ba92f];}else _0x5406dc=findYamlFiles(_0x35402f);if(_0x5406dc[_0x28eace(0x143)]===0x0)return console['error'](a21_0x3c92bb['red'](_0x28eace(0x137)+_0x35402f+'\x0a')),0x1;const _0x3c8ada=validateYamlFiles(_0x5406dc,_0x35402f,{'filterType':_0x28eace(0x125)}),_0x2acd8e=calculateSummary(_0x3c8ada),_0x42e6ab=_0x3c8ada[_0x28eace(0x147)](isValidationResult);if(_0x42e6ab[_0x28eace(0x143)]===0x0)return console[_0x28eace(0x13f)](a21_0x3c92bb['yellow'](_0x28eace(0x128)+_0x35402f+'\x0a')),_0x2acd8e['skippedCount']>0x0&&console[_0x28eace(0x13f)](a21_0x3c92bb[_0x28eace(0x14f)]('('+_0x2acd8e[_0x28eace(0x142)]+'\x20non-campaign\x20file(s)\x20skipped)')),0x0;for(const _0x548c31 of _0x3c8ada){if(!isValidationResult(_0x548c31)){_0x302097[_0x28eace(0x144)]&&console[_0x28eace(0x123)](a21_0x3c92bb[_0x28eace(0x14f)]('-\x20'+_0x548c31[_0x28eace(0x145)]+_0x28eace(0x153)+_0x548c31[_0x28eace(0x13e)]+')'));continue;}const {relativePath:_0xa255cb,source:_0x40fb5e,result:_0x5cb3ed}=_0x548c31;if(_0x5cb3ed[_0x28eace(0x146)]&&_0x5cb3ed[_0x28eace(0x14b)][_0x28eace(0x143)]===0x0)_0x302097['verbose']&&console['log'](a21_0x3c92bb[_0x28eace(0x12c)]('✔\x20'+_0xa255cb));else _0x5cb3ed['valid']?(console[_0x28eace(0x123)](a21_0x3c92bb[_0x28eace(0x133)]('⚠\x20'+_0xa255cb+':\x20'+_0x5cb3ed[_0x28eace(0x14b)][_0x28eace(0x143)]+_0x28eace(0x12a))),console[_0x28eace(0x123)](formatValidationResult(_0x5cb3ed,_0x40fb5e,_0xa255cb))):(console[_0x28eace(0x123)](a21_0x3c92bb[_0x28eace(0x151)]('✖\x20'+_0xa255cb+':\x20'+_0x5cb3ed[_0x28eace(0x14e)]['length']+'\x20error(s)')),console['log'](formatValidationResult(_0x5cb3ed,_0x40fb5e,_0xa255cb)));}return console[_0x28eace(0x123)](''),_0x2acd8e[_0x28eace(0x13a)]?(console['log'](a21_0x3c92bb['red'](_0x28eace(0x141)+_0x2acd8e['invalidCount']+_0x28eace(0x14c)+_0x2acd8e[_0x28eace(0x12d)]+'\x20valid')),_0x2acd8e[_0x28eace(0x14d)]>0x0&&console['log'](a21_0x3c92bb['yellow'](_0x2acd8e['warningCount']+_0x28eace(0x12b))),_0x2acd8e[_0x28eace(0x142)]>0x0&&console['log'](a21_0x3c92bb[_0x28eace(0x14f)](_0x2acd8e[_0x28eace(0x142)]+'\x20non-campaign\x20file(s)\x20skipped')),0x1):(console[_0x28eace(0x123)](a21_0x3c92bb[_0x28eace(0x12c)](_0x28eace(0x140)+_0x2acd8e[_0x28eace(0x12d)]+_0x28eace(0x122))),_0x2acd8e[_0x28eace(0x14d)]>0x0&&console[_0x28eace(0x123)](a21_0x3c92bb[_0x28eace(0x133)](_0x2acd8e[_0x28eace(0x14d)]+'\x20warning(s)\x20found')),_0x2acd8e['skippedCount']>0x0&&console[_0x28eace(0x123)](a21_0x3c92bb['dim'](_0x2acd8e[_0x28eace(0x142)]+'\x20non-campaign\x20file(s)\x20skipped')),0x0);}}
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 +1 @@
1
- const a22_0x2dd65e=a22_0x3751;function a22_0x4c5a(){const _0x432d46=['editorType','\x27...','\x27\x20paused\x20successfully','getCampaignFull','Fetching\x20campaigns...','jsonColumns','Launching\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','execute','data','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','createCampaign','Create\x20a\x20workspace','engage:always-on-campaign:launch','Creating\x20campaign\x20\x27','Resume\x20a\x20paused\x20always-on\x20campaign','grapesjs','attributes','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','List\x20always-on\x20campaigns','Create\x20an\x20email\x20template','engage:always-on-campaign:create','workspaceId','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Show\x20always-on\x20campaign\x20details','updateCampaign','duplicateCampaign','\x27\x20finished\x20successfully','yes','Duplicating\x20always-on\x20campaign\x20\x27','getWorkspaceFull','Fetching\x20workspaces...','Error:\x20Invalid\x20status\x20\x22','Deleting\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','engage:campaign:create','23974600kZweNh','finishAlwaysOnCampaign','engage:always-on-campaign:resume','engage:always-on-campaign:update','Template\x20\x27','length','Pause\x20an\x20always-on\x20campaign','listTemplates','subject','DRAFT','\x27\x20deleted\x20successfully','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','listWorkspaces','\x27?\x20This\x20cannot\x20be\x20undone.','engage:always-on-campaign:show','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','getTemplate','Creating\x20template\x20\x27','engage:template:update','includes','Delete\x20an\x20always-on\x20campaign','Operation\x20cancelled','Resuming\x20always-on\x20campaign\x20\x27','engage:always-on-campaign:duplicate','List\x20workspaces','deleteTemplate','Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>','3960636azHfiB','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','engage:campaign:delete','engage:campaign:pause','verbose','Engage\x20workspace\x20set\x20to:\x20','resumeAlwaysOnCampaign','Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>','startAt','Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','📝\x20','Duplicating\x20campaign\x20\x27','engage:workspaces','getCampaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','entries','3813531NtZyvi','segmentId','Update\x20a\x20campaign','Create\x20a\x20new\x20campaign','Verifying\x20workspace\x20\x27','join','Updating\x20always-on\x20campaign\x20\x27','engage:workspace:delete','segment','map','htmlFile','📧\x20','audienceName','Fetching\x20always-on\x20campaign\x20\x27','\x27\x20launched\x20successfully','Duplicate\x20a\x20campaign','Fetching\x20campaign\x20\x27','Pausing\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaigns','toUpperCase','toLowerCase','Resuming\x20campaign\x20\x27','🏢\x20','List\x20email\x20templates','plaintext','listCampaigns','emailSenderId','enableUtmTracking','type','Pausing\x20campaign\x20\x27','9804303fHUXyi','timezone','engage_workspace','filter','engage:always-on-campaigns','Show\x20campaign\x20details','Update\x20a\x20workspace','engage:campaign:launch','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Resume\x20a\x20paused\x20campaign','log','status','Finish\x20an\x20always-on\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','deleteWorkspace','html','error','Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>','Fetching\x20always-on\x20campaigns...','1029XPqkbH','name','launchAlwaysOnCampaign','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','2474rfTOWJ','getAlwaysOnCampaignFull','updateTemplate','full','\x22.\x20Valid\x20values:\x20','resumeCampaign','Always-on\x20campaign\x20\x27','limit','engage:template:delete','Deleting\x20template\x20\x27','resolveWorkspaceId','engage:campaign:resume','parentId','Campaign\x20\x27','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','dim','5CrwgIp','Show\x20email\x20template\x20details','104gZaFqS','Delete\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','Update\x20an\x20email\x20template','engage:campaign:duplicate','engage:template:show','engage:templates','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','resolvePathToResource','Launch\x20a\x20campaign','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','engage:campaign:update','LIVE','Error:\x20--name\x20is\x20required','MISSING_ARGUMENT','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:template:create','session','Delete\x20a\x20workspace','workspace','deleteCampaign','728861VdfrxN','Create\x20a\x20new\x20always-on\x20campaign','277248eKRfsi','createTemplate','PAUSED','Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27','createAlwaysOnCampaign','Fetching\x20template\x20\x27','\x27\x20resumed\x20successfully','Launching\x20campaign\x20\x27','Fetching\x20templates...','Updating\x20campaign\x20\x27','Delete\x20a\x20campaign','Finishing\x20always-on\x20campaign\x20\x27','keys','Deleting\x20campaign\x20\x27','description','pauseAlwaysOnCampaign','engage:always-on-campaign:delete','fromEntries','Updating\x20workspace\x20\x27','engage:workspace:show','engage','Updating\x20template\x20\x27','engage:always-on-campaign:finish','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Fetching\x20workspace\x20\x27','site','audienceId'];a22_0x4c5a=function(){return _0x432d46;};return a22_0x4c5a();}(function(_0x27e11e,_0xdb8747){const _0x56b6bc=a22_0x3751,_0x5d232b=_0x27e11e();while(!![]){try{const _0x454694=parseInt(_0x56b6bc(0x18b))/0x1*(-parseInt(_0x56b6bc(0x190))/0x2)+-parseInt(_0x56b6bc(0x159))/0x3+-parseInt(_0x56b6bc(0x1bd))/0x4*(parseInt(_0x56b6bc(0x1a4))/0x5)+parseInt(_0x56b6bc(0x148))/0x6+-parseInt(_0x56b6bc(0x1bb))/0x7*(-parseInt(_0x56b6bc(0x1a6))/0x8)+-parseInt(_0x56b6bc(0x178))/0x9+parseInt(_0x56b6bc(0x12d))/0xa;if(_0x454694===_0xdb8747)break;else _0x5d232b['push'](_0x5d232b['shift']());}catch(_0x3974bc){_0x5d232b['push'](_0x5d232b['shift']());}}}(a22_0x4c5a,0xacf54));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl,getTemplateUrl,getWorkspaceUrl}from'../sdk/client/endpoints.js';import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a22_0x2644c9 from'chalk';export async function resolveWorkspaceIdFromOptions(_0x3a5ad5,_0x48802b,_0x3ceb3b=![]){const _0x410206=a22_0x3751;if(_0x3a5ad5[_0x410206(0x1b9)])return await _0x48802b[_0x410206(0x1d1)]['resolveWorkspaceId'](_0x3a5ad5['workspace']);const _0x46d758=loadSessionContext(_0x3a5ad5[_0x410206(0x1b7)]);if(_0x46d758?.['engage_workspace'])return await _0x48802b['engage'][_0x410206(0x19a)](_0x46d758[_0x410206(0x17a)]);if(_0x3ceb3b)throw new SDKError(ErrorCode[_0x410206(0x1b4)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x82907,_0x2b106f){const _0x18772f=a22_0x3751;if(!_0x82907[_0x18772f(0x161)])return{};const _0x5e0700=_0x82907[_0x18772f(0x161)],_0x2bb469=await _0x2b106f['segment'][_0x18772f(0x1ae)](_0x5e0700);return{'audienceId':_0x2bb469[_0x18772f(0x19c)],'audienceName':_0x2bb469['parentName'],..._0x2bb469[_0x18772f(0x15a)]&&{'segmentId':_0x2bb469[_0x18772f(0x15a)],'segmentName':_0x2bb469['segmentName']}};}function buildConnectorConfig(_0x40f1de){const _0x104d64=a22_0x3751,_0x4d90d6=_0x40f1de[_0x104d64(0x174)],_0x4bfc6b=_0x40f1de[_0x104d64(0x10c)];if(!_0x4d90d6&&!_0x4bfc6b)return undefined;return{..._0x4d90d6&&{'emailSenderId':_0x4d90d6},..._0x4bfc6b&&{'jsonColumns':_0x4bfc6b}};}export class EngageCampaignsCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x16c);[a22_0x2dd65e(0x1cb)]='List\x20campaigns';async['execute'](_0x5900df){const _0xeff0e7=a22_0x2dd65e,{options:_0x1fabe9,args:_0x2dd3a9,tdx:_0x217554}=_0x5900df,_0x5f25fb=_0x2dd3a9[0x0],_0x1e1ee2=resolveLimit(_0x1fabe9[_0xeff0e7(0x197)],DEFAULT_LLM_LIMIT),_0x5e4830=_0x1fabe9,_0x4baf05=_0x5e4830[_0xeff0e7(0x176)],_0x47c8d8=[_0xeff0e7(0x136),'ACTIVE',_0xeff0e7(0x1bf),'COMPLETED'],_0x369364=_0x5e4830[_0xeff0e7(0x183)],_0x106f0f=_0x369364?.[_0xeff0e7(0x16d)]();if(_0x106f0f&&!_0x47c8d8[_0xeff0e7(0x140)](_0x106f0f))return console[_0xeff0e7(0x188)](_0xeff0e7(0x129)+_0x369364+'\x22.\x20Valid\x20values:\x20'+_0x47c8d8[_0xeff0e7(0x15e)](',\x20')),0x1;const _0x3d5837=await resolveWorkspaceIdFromOptions(_0x5e4830,_0x217554),_0x124ea3=await withSpinner(_0xeff0e7(0x10b),()=>_0x217554['engage'][_0xeff0e7(0x173)]({'type':_0x4baf05,'status':_0x106f0f,'workspaceId':_0x3d5837,'limit':_0x1e1ee2}),{'verbose':_0x1fabe9[_0xeff0e7(0x14c)]});let _0x5ccc42=_0x124ea3[_0xeff0e7(0x111)];_0x106f0f&&(_0x5ccc42=_0x5ccc42['filter'](_0x15c1e8=>_0x15c1e8['status'][_0xeff0e7(0x16d)]()===_0x106f0f));_0x5f25fb&&(_0x5ccc42=_0x5ccc42[_0xeff0e7(0x17b)](_0x239001=>matchGlobPattern(_0x239001[_0xeff0e7(0x18c)],_0x5f25fb)));const _0x11ff28=_0x1fabe9[_0xeff0e7(0x1d6)];if(isStructuredFormat(_0x1fabe9)){const _0x2310cd=_0x5ccc42[_0xeff0e7(0x162)](_0x10e52c=>({..._0x10e52c,'url':_0x10e52c[_0xeff0e7(0x11e)]?getCampaignUrl(_0x11ff28,_0x10e52c[_0xeff0e7(0x11e)],_0x10e52c['id']):undefined}));await handleSDKOutput(_0x2310cd,_0x1fabe9);}else for(const _0x2e9ed9 of _0x5ccc42){const _0x308afe=a22_0x2644c9[_0xeff0e7(0x1a3)]('\x20('+_0x2e9ed9[_0xeff0e7(0x183)][_0xeff0e7(0x16e)]()+')'),_0x5c0bde=_0x2e9ed9['workspaceId']?getCampaignUrl(_0x11ff28,_0x2e9ed9['workspaceId'],_0x2e9ed9['id']):undefined,_0x4333b6=_0x5c0bde?hyperlink(_0x2e9ed9['name'],_0x5c0bde):_0x2e9ed9[_0xeff0e7(0x18c)];console[_0xeff0e7(0x182)](_0xeff0e7(0x164)+_0x4333b6+_0x308afe);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']='engage:campaign:show';[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x17d);async['execute'](_0xdf32cb){const _0xe9ce5b=a22_0x2dd65e,{options:_0x4c8d95,args:_0x3afd6a,tdx:_0x585ca7}=_0xdf32cb;if(_0x3afd6a[_0xe9ce5b(0x132)]===0x0)return console[_0xe9ce5b(0x188)](_0xe9ce5b(0x157)),console[_0xe9ce5b(0x188)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x1f3516=_0x3afd6a[0x0],_0x3aaa61=_0x4c8d95,_0x4aab67=await resolveWorkspaceIdFromOptions(_0x3aaa61,_0x585ca7),_0x23a456=_0x3aaa61[_0xe9ce5b(0x193)],_0x32af04=_0x4c8d95['site'];if(_0x23a456){const _0x1b3a5c=await withSpinner(_0xe9ce5b(0x169)+_0x1f3516+'\x27...',()=>_0x585ca7[_0xe9ce5b(0x1d1)][_0xe9ce5b(0x10a)](_0x1f3516,_0x4aab67),{'verbose':_0x4c8d95[_0xe9ce5b(0x14c)]}),_0x5ae9e5=_0x1b3a5c[_0xe9ce5b(0x111)],_0x32727f=_0x5ae9e5['attributes']['workspaceId']?getCampaignUrl(_0x32af04,_0x5ae9e5[_0xe9ce5b(0x119)][_0xe9ce5b(0x11e)],_0x5ae9e5['id']):undefined;await handleSDKOutput([{..._0x5ae9e5,..._0x32727f&&{'url':_0x32727f}}],_0x4c8d95);}else{const _0x39238d=await withSpinner(_0xe9ce5b(0x169)+_0x1f3516+'\x27...',()=>_0x585ca7[_0xe9ce5b(0x1d1)][_0xe9ce5b(0x156)](_0x1f3516,_0x4aab67),{'verbose':_0x4c8d95[_0xe9ce5b(0x14c)]}),_0x396995=_0x39238d[_0xe9ce5b(0x111)],_0x5ad2a4=_0x396995[_0xe9ce5b(0x11e)]?getCampaignUrl(_0x32af04,_0x396995['workspaceId'],_0x396995['id']):undefined;await handleSingleObjectOutput({..._0x396995,..._0x5ad2a4&&{'url':_0x5ad2a4}},_0x4c8d95);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a22_0x2dd65e(0x12c);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x15c);async['execute'](_0x189364){const _0x3e7f99=a22_0x2dd65e,{options:_0x742a55,tdx:_0x80f6b1}=_0x189364,_0x41d24d=_0x742a55,_0x45aec6=_0x41d24d[_0x3e7f99(0x18c)],_0x2c475f=_0x41d24d[_0x3e7f99(0x176)];if(!_0x45aec6)return console[_0x3e7f99(0x188)](_0x3e7f99(0x1b3)),console[_0x3e7f99(0x188)](_0x3e7f99(0x10e)),0x1;if(!_0x2c475f)return console[_0x3e7f99(0x188)](_0x3e7f99(0x1b5)),console[_0x3e7f99(0x188)](_0x3e7f99(0x10e)),0x1;const _0x117141=await resolveWorkspaceIdFromOptions(_0x41d24d,_0x80f6b1,!![]),_0x1f9dc2=await resolveSegmentFromOptions(_0x41d24d,_0x80f6b1),_0x451d48=buildConnectorConfig(_0x41d24d),_0x2d00a0={'name':_0x45aec6,'campaignType':_0x2c475f,'workspaceId':_0x117141,'description':_0x41d24d[_0x3e7f99(0x1cb)],..._0x1f9dc2,'connectorConfig':_0x451d48,'startAt':_0x41d24d[_0x3e7f99(0x150)],'timezone':_0x41d24d['timezone']},_0x434d4b=await withSpinner(_0x3e7f99(0x116)+_0x45aec6+_0x3e7f99(0x1d9),()=>_0x80f6b1[_0x3e7f99(0x1d1)][_0x3e7f99(0x113)](_0x2d00a0));return await handleSDKOutput([_0x434d4b['data']],_0x742a55),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x1b1);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x15b);async['execute'](_0x978424){const _0x275def=a22_0x2dd65e,{options:_0x16c0f2,args:_0x1ba5fd,tdx:_0x1f528e}=_0x978424;if(_0x1ba5fd[_0x275def(0x132)]===0x0)return console[_0x275def(0x188)](_0x275def(0x157)),console[_0x275def(0x188)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0xd73328=_0x1ba5fd[0x0],_0x2f9d93=_0x16c0f2,_0x9a006c=await resolveWorkspaceIdFromOptions(_0x2f9d93,_0x1f528e),_0x1e63f6=await resolveSegmentFromOptions(_0x2f9d93,_0x1f528e),_0x1a8d1a=buildConnectorConfig(_0x2f9d93),_0xba79f={'name':_0x2f9d93[_0x275def(0x18c)],'description':_0x2f9d93['description'],..._0x1e63f6,'connectorConfig':_0x1a8d1a,'startAt':_0x2f9d93[_0x275def(0x150)],'timezone':_0x2f9d93[_0x275def(0x179)]},_0x3e2344=Object[_0x275def(0x1ce)](Object['entries'](_0xba79f)[_0x275def(0x17b)](([,_0x5ef2eb])=>_0x5ef2eb!==undefined));if(Object['keys'](_0x3e2344)[_0x275def(0x132)]===0x0)return console['error'](_0x275def(0x10f)),console['error'](_0x275def(0x1b0)),0x1;const _0x2d2a2d=await withSpinner(_0x275def(0x1c6)+_0xd73328+_0x275def(0x1d9),()=>_0x1f528e['engage'][_0x275def(0x122)](_0xd73328,_0x3e2344,_0x9a006c),{'verbose':_0x16c0f2[_0x275def(0x14c)]});return await handleSDKOutput([_0x2d2a2d['data']],_0x16c0f2),0x0;}}function a22_0x3751(_0x5d9f2a,_0xc6d029){_0x5d9f2a=_0x5d9f2a-0x10a;const _0x4c5af3=a22_0x4c5a();let _0x37510b=_0x4c5af3[_0x5d9f2a];return _0x37510b;}export class EngageCampaignDeleteCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x14a);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x1c7);async[a22_0x2dd65e(0x110)](_0x580c93){const _0x4d9ed4=a22_0x2dd65e,{options:_0x3f23f5,args:_0x58907a,tdx:_0x55acec}=_0x580c93;if(_0x58907a[_0x4d9ed4(0x132)]===0x0)return console[_0x4d9ed4(0x188)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4d9ed4(0x188)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x568a51=_0x58907a[0x0],_0x5d80fe=_0x3f23f5,_0x3579e7=await resolveWorkspaceIdFromOptions(_0x5d80fe,_0x55acec);if(!_0x3f23f5[_0x4d9ed4(0x125)]){const _0x5c1b36=await confirm(_0x4d9ed4(0x112)+_0x568a51+_0x4d9ed4(0x13a));if(!_0x5c1b36)return console[_0x4d9ed4(0x182)](_0x4d9ed4(0x142)),0x0;}return await withSpinner(_0x4d9ed4(0x1ca)+_0x568a51+'\x27...',()=>_0x55acec[_0x4d9ed4(0x1d1)][_0x4d9ed4(0x1ba)](_0x568a51,_0x3579e7),{'verbose':_0x3f23f5[_0x4d9ed4(0x14c)]}),console[_0x4d9ed4(0x182)](_0x4d9ed4(0x19d)+_0x568a51+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x17f);['description']=a22_0x2dd65e(0x1af);async[a22_0x2dd65e(0x110)](_0x544ffb){const _0x4f0faa=a22_0x2dd65e,{options:_0x18bc22,args:_0x1a0926,tdx:_0x36188e}=_0x544ffb;if(_0x1a0926[_0x4f0faa(0x132)]===0x0)return console[_0x4f0faa(0x188)](_0x4f0faa(0x157)),console[_0x4f0faa(0x188)](_0x4f0faa(0x152)),0x1;const _0x1c3882=_0x1a0926[0x0],_0x19964b=_0x18bc22,_0x497f30=await resolveWorkspaceIdFromOptions(_0x19964b,_0x36188e);return await withSpinner(_0x4f0faa(0x1c4)+_0x1c3882+_0x4f0faa(0x1d9),()=>_0x36188e[_0x4f0faa(0x1d1)]['launchCampaign'](_0x1c3882,_0x497f30),{'verbose':_0x18bc22[_0x4f0faa(0x14c)]}),console[_0x4f0faa(0x182)](_0x4f0faa(0x19d)+_0x1c3882+_0x4f0faa(0x167)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a22_0x2dd65e(0x14b);[a22_0x2dd65e(0x1cb)]='Pause\x20a\x20campaign';async[a22_0x2dd65e(0x110)](_0xcac5c0){const _0x95220e=a22_0x2dd65e,{options:_0x57d94c,args:_0xf62ee5,tdx:_0x1a5219}=_0xcac5c0;if(_0xf62ee5[_0x95220e(0x132)]===0x0)return console[_0x95220e(0x188)](_0x95220e(0x157)),console[_0x95220e(0x188)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x55f2f3=_0xf62ee5[0x0],_0x202db4=_0x57d94c,_0x37f0bd=await resolveWorkspaceIdFromOptions(_0x202db4,_0x1a5219);return await withSpinner(_0x95220e(0x177)+_0x55f2f3+_0x95220e(0x1d9),()=>_0x1a5219['engage']['pauseCampaign'](_0x55f2f3,_0x37f0bd),{'verbose':_0x57d94c[_0x95220e(0x14c)]}),console[_0x95220e(0x182)](_0x95220e(0x19d)+_0x55f2f3+_0x95220e(0x1da)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x19b);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x181);async[a22_0x2dd65e(0x110)](_0x1ebb89){const _0x9ac491=a22_0x2dd65e,{options:_0x1441bf,args:_0x3c3358,tdx:_0x4d0318}=_0x1ebb89;if(_0x3c3358['length']===0x0)return console[_0x9ac491(0x188)](_0x9ac491(0x157)),console[_0x9ac491(0x188)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x557096=_0x3c3358[0x0],_0xad1697=_0x1441bf,_0x3930ba=await resolveWorkspaceIdFromOptions(_0xad1697,_0x4d0318);return await withSpinner(_0x9ac491(0x16f)+_0x557096+'\x27...',()=>_0x4d0318['engage'][_0x9ac491(0x195)](_0x557096,_0x3930ba),{'verbose':_0x1441bf[_0x9ac491(0x14c)]}),console['log'](_0x9ac491(0x19d)+_0x557096+_0x9ac491(0x1c3)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x1aa);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x168);async[a22_0x2dd65e(0x110)](_0x3609a7){const _0xa17dbc=a22_0x2dd65e,{options:_0x3a2323,args:_0x3bb5ce,tdx:_0x4bb4b3}=_0x3609a7;if(_0x3bb5ce[_0xa17dbc(0x132)]===0x0)return console[_0xa17dbc(0x188)](_0xa17dbc(0x157)),console[_0xa17dbc(0x188)](_0xa17dbc(0x180)),0x1;const _0x3bc0b1=_0x3bb5ce[0x0],_0x47a2a6=_0x3a2323,_0x2a74a5=await resolveWorkspaceIdFromOptions(_0x47a2a6,_0x4bb4b3),_0x2d6f4a=await withSpinner(_0xa17dbc(0x154)+_0x3bc0b1+_0xa17dbc(0x1d9),()=>_0x4bb4b3['engage'][_0xa17dbc(0x123)](_0x3bc0b1,_0x2a74a5),{'verbose':_0x3a2323[_0xa17dbc(0x14c)]});return await handleSDKOutput([_0x2d6f4a[_0xa17dbc(0x111)]],_0x3a2323),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x1ac);['description']=a22_0x2dd65e(0x171);async[a22_0x2dd65e(0x110)](_0x53bd49){const _0xce6cdc=a22_0x2dd65e,{options:_0x44486c,args:_0x533c1a,tdx:_0x3d5902}=_0x53bd49,_0x534596=_0x533c1a[0x0],_0x54ce65=resolveLimit(_0x44486c[_0xce6cdc(0x197)],DEFAULT_LLM_LIMIT),_0x1ebe67=_0x44486c,_0xbd4fb7=await resolveWorkspaceIdFromOptions(_0x1ebe67,_0x3d5902),_0x4eafa3=await withSpinner(_0xce6cdc(0x1c5),()=>_0x3d5902[_0xce6cdc(0x1d1)][_0xce6cdc(0x134)]({'workspaceId':_0xbd4fb7,'limit':_0x54ce65}),{'verbose':_0x44486c[_0xce6cdc(0x14c)]});let _0xecfa7b=_0x4eafa3['data'];_0x534596&&(_0xecfa7b=_0x4eafa3[_0xce6cdc(0x111)]['filter'](_0x5e9a82=>matchGlobPattern(_0x5e9a82['name'],_0x534596)));const _0xb14ffb=_0x44486c[_0xce6cdc(0x1d6)];if(isStructuredFormat(_0x44486c))await handleSDKOutput(_0xecfa7b,_0x44486c);else for(const _0x1881f5 of _0xecfa7b){const _0x4eaed5=_0x1881f5[_0xce6cdc(0x11e)]?getTemplateUrl(_0xb14ffb,_0x1881f5[_0xce6cdc(0x11e)],_0x1881f5['id']):undefined,_0x5e5a64=_0x4eaed5?hyperlink(_0x1881f5[_0xce6cdc(0x18c)],_0x4eaed5):_0x1881f5[_0xce6cdc(0x18c)];console[_0xce6cdc(0x182)](_0xce6cdc(0x153)+_0x5e5a64);}return 0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x1ab);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x1a5);async[a22_0x2dd65e(0x110)](_0x4e61e5){const _0x7d6b17=a22_0x2dd65e,{options:_0x1b8a64,args:_0x5bf54a,tdx:_0x5e55f8}=_0x4e61e5;if(_0x5bf54a[_0x7d6b17(0x132)]===0x0)return console[_0x7d6b17(0x188)](_0x7d6b17(0x11f)),console[_0x7d6b17(0x188)](_0x7d6b17(0x149)),0x1;const _0x34cc49=_0x5bf54a[0x0],_0x404bef=_0x1b8a64,_0x3da44e=await resolveWorkspaceIdFromOptions(_0x404bef,_0x5e55f8),_0x3b8f8d=_0x404bef['full'];if(_0x3b8f8d){const _0x43ea3d=await withSpinner(_0x7d6b17(0x1c2)+_0x34cc49+_0x7d6b17(0x1d9),()=>_0x5e55f8[_0x7d6b17(0x1d1)]['getTemplateFull'](_0x34cc49,_0x3da44e),{'verbose':_0x1b8a64[_0x7d6b17(0x14c)]});await handleSDKOutput([_0x43ea3d],_0x1b8a64);}else{const _0x4e0030=await withSpinner(_0x7d6b17(0x1c2)+_0x34cc49+_0x7d6b17(0x1d9),()=>_0x5e55f8['engage'][_0x7d6b17(0x13d)](_0x34cc49,_0x3da44e),{'verbose':_0x1b8a64[_0x7d6b17(0x14c)]});await handleSDKOutput([_0x4e0030],_0x1b8a64);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x1b6);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x11c);async[a22_0x2dd65e(0x110)](_0x1cffe9){const _0x231f01=a22_0x2dd65e,{options:_0x1034bf,tdx:_0x20dfc1}=_0x1cffe9,_0x21b10d=_0x1034bf,_0x43b396=_0x21b10d[_0x231f01(0x18c)],_0xfd1d58=_0x21b10d[_0x231f01(0x135)],_0x287ffe=_0x21b10d[_0x231f01(0x187)],_0x1958f6=_0x21b10d[_0x231f01(0x163)];if(!_0x43b396)return console[_0x231f01(0x188)]('Error:\x20--name\x20is\x20required'),console[_0x231f01(0x188)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0xfd1d58)return console['error']('Error:\x20--subject\x20is\x20required'),0x1;if(_0x287ffe&&_0x1958f6)return console[_0x231f01(0x188)](_0x231f01(0x1ad)),0x1;const _0x43c2f7=_0x1958f6?readFileContent(_0x1958f6):_0x287ffe;if(!_0x43c2f7)return console[_0x231f01(0x188)](_0x231f01(0x19f)),0x1;const _0x34adcf=await resolveWorkspaceIdFromOptions(_0x21b10d,_0x20dfc1,!![]),_0xbc8a55={'name':_0x43b396,'subjectTemplate':_0xfd1d58,'htmlTemplate':_0x43c2f7,'workspaceId':_0x34adcf,'plaintextTemplate':_0x21b10d[_0x231f01(0x172)],'editorType':_0x21b10d[_0x231f01(0x1d8)]??_0x231f01(0x118)},_0x9f084a=await withSpinner(_0x231f01(0x13e)+_0x43b396+'\x27...',()=>_0x20dfc1[_0x231f01(0x1d1)][_0x231f01(0x1be)](_0xbc8a55));return await handleSDKOutput([_0x9f084a['data']],_0x1034bf),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x13f);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x1a9);async[a22_0x2dd65e(0x110)](_0x4af94e){const _0x5701a8=a22_0x2dd65e,{options:_0x18f6a3,args:_0x397695,tdx:_0x2ce32a}=_0x4af94e;if(_0x397695[_0x5701a8(0x132)]===0x0)return console[_0x5701a8(0x188)](_0x5701a8(0x11f)),console[_0x5701a8(0x188)](_0x5701a8(0x16b)),0x1;const _0x58153b=_0x397695[0x0],_0x5d948d=_0x18f6a3,_0x5b2098=_0x5d948d[_0x5701a8(0x187)],_0x41f9d2=_0x5d948d['htmlFile'];if(_0x5b2098&&_0x41f9d2)return console[_0x5701a8(0x188)](_0x5701a8(0x1ad)),0x1;const _0x275529=_0x41f9d2?readFileContent(_0x41f9d2):_0x5b2098,_0x2f1079=await resolveWorkspaceIdFromOptions(_0x5d948d,_0x2ce32a),_0x1da8f3={'name':_0x5d948d[_0x5701a8(0x18c)],'subjectTemplate':_0x5d948d[_0x5701a8(0x135)],'htmlTemplate':_0x275529,'plaintextTemplate':_0x5d948d[_0x5701a8(0x172)]},_0x116467=Object[_0x5701a8(0x1ce)](Object[_0x5701a8(0x158)](_0x1da8f3)[_0x5701a8(0x17b)](([,_0x2d9d4c])=>_0x2d9d4c!==undefined));if(Object[_0x5701a8(0x1c9)](_0x116467)[_0x5701a8(0x132)]===0x0)return console[_0x5701a8(0x188)](_0x5701a8(0x10f)),console[_0x5701a8(0x188)](_0x5701a8(0x13c)),0x1;const _0x2d09b7=await withSpinner(_0x5701a8(0x1d2)+_0x58153b+'\x27...',()=>_0x2ce32a[_0x5701a8(0x1d1)][_0x5701a8(0x192)](_0x58153b,_0x116467,_0x2f1079),{'verbose':_0x18f6a3['verbose']});return await handleSDKOutput([_0x2d09b7['data']],_0x18f6a3),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x198);['description']=a22_0x2dd65e(0x1a7);async[a22_0x2dd65e(0x110)](_0x2baba6){const _0x411bce=a22_0x2dd65e,{options:_0x17c02d,args:_0x551f83,tdx:_0x557b21}=_0x2baba6;if(_0x551f83[_0x411bce(0x132)]===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x411bce(0x188)](_0x411bce(0x1d4)),0x1;const _0x5308c4=_0x551f83[0x0],_0x18f70c=_0x17c02d,_0x2e9c30=await resolveWorkspaceIdFromOptions(_0x18f70c,_0x557b21);if(!_0x17c02d[_0x411bce(0x125)]){const _0x34601e=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x5308c4+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x34601e)return console[_0x411bce(0x182)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x411bce(0x199)+_0x5308c4+_0x411bce(0x1d9),()=>_0x557b21[_0x411bce(0x1d1)][_0x411bce(0x146)](_0x5308c4,_0x2e9c30),{'verbose':_0x17c02d['verbose']}),console['log'](_0x411bce(0x131)+_0x5308c4+_0x411bce(0x137)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x155);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x145);async['execute'](_0x523d98){const _0x38ee92=a22_0x2dd65e,{options:_0x5ad176,args:_0x3c1300,tdx:_0x541613}=_0x523d98,_0x25390b=_0x3c1300[0x0],_0x44b062=resolveLimit(_0x5ad176[_0x38ee92(0x197)],DEFAULT_LLM_LIMIT),_0x5234e1=await withSpinner(_0x38ee92(0x128),()=>_0x541613[_0x38ee92(0x1d1)][_0x38ee92(0x139)]({'limit':_0x44b062}),{'verbose':_0x5ad176[_0x38ee92(0x14c)]});let _0x4efbf3=_0x5234e1['data'];_0x25390b&&(_0x4efbf3=_0x5234e1[_0x38ee92(0x111)]['filter'](_0xe38b35=>matchGlobPattern(_0xe38b35[_0x38ee92(0x18c)],_0x25390b)));const _0x43e0d8=_0x5ad176[_0x38ee92(0x1d6)];if(isStructuredFormat(_0x5ad176))await handleSDKOutput(_0x4efbf3,_0x5ad176);else for(const _0x438d98 of _0x4efbf3){const _0x556d6c=getWorkspaceUrl(_0x43e0d8,_0x438d98['id']),_0x54836c=hyperlink(_0x438d98[_0x38ee92(0x18c)],_0x556d6c);console[_0x38ee92(0x182)](_0x38ee92(0x170)+_0x54836c);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a22_0x2dd65e(0x1d0);[a22_0x2dd65e(0x1cb)]='Show\x20workspace\x20details';async[a22_0x2dd65e(0x110)](_0x251311){const _0x57bf06=a22_0x2dd65e,{options:_0x8b897e,args:_0x3a2a30,tdx:_0x30dca0}=_0x251311;if(_0x3a2a30[_0x57bf06(0x132)]===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x57bf06(0x188)](_0x57bf06(0x11a)),0x1;const _0x225211=_0x3a2a30[0x0],_0x58aba7=_0x8b897e,_0x2bc835=_0x58aba7[_0x57bf06(0x193)];if(_0x2bc835){const _0x216dc0=await withSpinner(_0x57bf06(0x1d5)+_0x225211+_0x57bf06(0x1d9),()=>_0x30dca0[_0x57bf06(0x1d1)][_0x57bf06(0x127)](_0x225211),{'verbose':_0x8b897e[_0x57bf06(0x14c)]});await handleSDKOutput([_0x216dc0],_0x8b897e);}else{const _0x31650f=await withSpinner(_0x57bf06(0x1d5)+_0x225211+_0x57bf06(0x1d9),()=>_0x30dca0[_0x57bf06(0x1d1)]['getWorkspace'](_0x225211),{'verbose':_0x8b897e[_0x57bf06(0x14c)]});await handleSDKOutput([_0x31650f],_0x8b897e);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]='engage:workspace:create';[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x114);async[a22_0x2dd65e(0x110)](_0x444efd){const _0x393a36=a22_0x2dd65e,{options:_0x505818,tdx:_0x587485}=_0x444efd,_0x2f769c=_0x505818,_0x2534b0=_0x2f769c[_0x393a36(0x18c)];if(!_0x2534b0)return console[_0x393a36(0x188)](_0x393a36(0x1b3)),console[_0x393a36(0x188)](_0x393a36(0x185)),0x1;const _0x3d8f5c={'name':_0x2534b0,'description':_0x2f769c[_0x393a36(0x1cb)]},_0x529f2a=await withSpinner('Creating\x20workspace\x20\x27'+_0x2534b0+'\x27...',()=>_0x587485[_0x393a36(0x1d1)]['createWorkspace'](_0x3d8f5c));return await handleSDKOutput([_0x529f2a['data']],_0x505818),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]='engage:workspace:update';[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x17e);async[a22_0x2dd65e(0x110)](_0x3618f8){const _0x57eae5=a22_0x2dd65e,{options:_0x7f7a6a,args:_0x566665,tdx:_0x17aadf}=_0x3618f8;if(_0x566665[_0x57eae5(0x132)]===0x0)return console[_0x57eae5(0x188)](_0x57eae5(0x18e)),console[_0x57eae5(0x188)](_0x57eae5(0x120)),0x1;const _0x27c75f=_0x566665[0x0],_0x337138=_0x7f7a6a,_0x1a57a5={'name':_0x337138[_0x57eae5(0x18c)],'description':_0x337138['description']},_0x3192a4=Object[_0x57eae5(0x1ce)](Object[_0x57eae5(0x158)](_0x1a57a5)['filter'](([,_0x103ca5])=>_0x103ca5!==undefined));if(Object['keys'](_0x3192a4)[_0x57eae5(0x132)]===0x0)return console[_0x57eae5(0x188)](_0x57eae5(0x10f)),console[_0x57eae5(0x188)]('Options:\x20--name,\x20--description'),0x1;const _0x5d7f11=await withSpinner(_0x57eae5(0x1cf)+_0x27c75f+_0x57eae5(0x1d9),()=>_0x17aadf[_0x57eae5(0x1d1)]['updateWorkspace'](_0x27c75f,_0x3192a4),{'verbose':_0x7f7a6a[_0x57eae5(0x14c)]});return await handleSDKOutput([_0x5d7f11[_0x57eae5(0x111)]],_0x7f7a6a),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x160);['description']=a22_0x2dd65e(0x1b8);async[a22_0x2dd65e(0x110)](_0x1326cd){const _0x2f7671=a22_0x2dd65e,{options:_0x106e3,args:_0x318cff,tdx:_0x2c76be}=_0x1326cd;if(_0x318cff[_0x2f7671(0x132)]===0x0)return console[_0x2f7671(0x188)](_0x2f7671(0x18e)),console[_0x2f7671(0x188)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0xea94f5=_0x318cff[0x0];if(!_0x106e3[_0x2f7671(0x125)]){const _0x19c578=await confirm(_0x2f7671(0x1a1)+_0xea94f5+_0x2f7671(0x13a));if(!_0x19c578)return console[_0x2f7671(0x182)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x2f7671(0x12a)+_0xea94f5+_0x2f7671(0x1d9),()=>_0x2c76be[_0x2f7671(0x1d1)][_0x2f7671(0x186)](_0xea94f5),{'verbose':_0x106e3[_0x2f7671(0x14c)]}),console[_0x2f7671(0x182)]('Workspace\x20\x27'+_0xea94f5+_0x2f7671(0x137)),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x17c);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x11b);async[a22_0x2dd65e(0x110)](_0x375058){const _0x48d025=a22_0x2dd65e,{options:_0xd6aff3,args:_0x4eba69,tdx:_0x70b089}=_0x375058,_0xa97591=_0x4eba69[0x0],_0x27d648=resolveLimit(_0xd6aff3['limit'],DEFAULT_LLM_LIMIT),_0x25e18f=_0xd6aff3,_0x582543=_0x25e18f[_0x48d025(0x176)],_0xc4db9d=[_0x48d025(0x136),_0x48d025(0x1b2),_0x48d025(0x1bf),'FINISHED'],_0x2c8e9a=_0x25e18f[_0x48d025(0x183)],_0x26f982=_0x2c8e9a?.['toUpperCase']();if(_0x26f982&&!_0xc4db9d[_0x48d025(0x140)](_0x26f982))return console['error'](_0x48d025(0x129)+_0x2c8e9a+_0x48d025(0x194)+_0xc4db9d[_0x48d025(0x15e)](',\x20')),0x1;const _0x473636=await resolveWorkspaceIdFromOptions(_0x25e18f,_0x70b089,!![]),_0x38d7b3=await withSpinner(_0x48d025(0x18a),()=>_0x70b089[_0x48d025(0x1d1)]['listAlwaysOnCampaigns']({'workspaceId':_0x473636,'type':_0x582543,'status':_0x26f982,'limit':_0x27d648}),{'verbose':_0xd6aff3[_0x48d025(0x14c)]});let _0x5c93a3=_0x38d7b3['data'];_0x26f982&&(_0x5c93a3=_0x5c93a3[_0x48d025(0x17b)](_0x4977fe=>_0x4977fe[_0x48d025(0x183)][_0x48d025(0x16d)]()===_0x26f982));_0xa97591&&(_0x5c93a3=_0x5c93a3['filter'](_0x43dcc2=>matchGlobPattern(_0x43dcc2['name'],_0xa97591)));const _0x11df6d=_0xd6aff3[_0x48d025(0x1d6)];if(isStructuredFormat(_0xd6aff3)){const _0x3548aa=_0x5c93a3[_0x48d025(0x162)](_0x506693=>({..._0x506693,'url':getCampaignUrl(_0x11df6d,_0x506693[_0x48d025(0x11e)],_0x506693['id'])}));await handleSDKOutput(_0x3548aa,_0xd6aff3);}else for(const _0x519b96 of _0x5c93a3){const _0x5d628d=a22_0x2644c9[_0x48d025(0x1a3)]('\x20('+_0x519b96['status'][_0x48d025(0x16e)]()+')'),_0x139d38=getCampaignUrl(_0x11df6d,_0x519b96[_0x48d025(0x11e)],_0x519b96['id']),_0x3ded9b=hyperlink(_0x519b96[_0x48d025(0x18c)],_0x139d38);console[_0x48d025(0x182)](_0x48d025(0x164)+_0x3ded9b+_0x5d628d);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x13b);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x121);async[a22_0x2dd65e(0x110)](_0x1ee604){const _0x317a4b=a22_0x2dd65e,{options:_0x5dc949,args:_0x54c1f2,tdx:_0x133c6d}=_0x1ee604;if(_0x54c1f2[_0x317a4b(0x132)]===0x0)return console[_0x317a4b(0x188)](_0x317a4b(0x157)),console['error'](_0x317a4b(0x147)),0x1;const _0x320f28=_0x54c1f2[0x0],_0x47e00a=_0x5dc949,_0x3fb2c5=await resolveWorkspaceIdFromOptions(_0x47e00a,_0x133c6d,!![]),_0x2dc75a=_0x47e00a[_0x317a4b(0x193)],_0x4ffde0=_0x5dc949[_0x317a4b(0x1d6)];if(_0x2dc75a){const _0x391870=await withSpinner(_0x317a4b(0x166)+_0x320f28+'\x27...',()=>_0x133c6d[_0x317a4b(0x1d1)][_0x317a4b(0x191)](_0x3fb2c5,_0x320f28),{'verbose':_0x5dc949[_0x317a4b(0x14c)]}),_0x27b61f=_0x391870['data'],_0x437622=getCampaignUrl(_0x4ffde0,_0x27b61f[_0x317a4b(0x119)][_0x317a4b(0x11e)],_0x27b61f['id']);await handleSDKOutput([{..._0x27b61f,'url':_0x437622}],_0x5dc949);}else{const _0x403843=await withSpinner(_0x317a4b(0x166)+_0x320f28+_0x317a4b(0x1d9),()=>_0x133c6d[_0x317a4b(0x1d1)]['getAlwaysOnCampaign'](_0x3fb2c5,_0x320f28),{'verbose':_0x5dc949['verbose']}),_0x2f4da3=_0x403843[_0x317a4b(0x111)],_0x4b291a=getCampaignUrl(_0x4ffde0,_0x2f4da3[_0x317a4b(0x11e)],_0x2f4da3['id']);await handleSingleObjectOutput({..._0x2f4da3,'url':_0x4b291a},_0x5dc949);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x11d);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x1bc);async[a22_0x2dd65e(0x110)](_0x53c16e){const _0x678a5a=a22_0x2dd65e,{options:_0x1f271,tdx:_0xa162a4}=_0x53c16e,_0x5d6d1c=_0x1f271,_0x4415c8=_0x5d6d1c['name'],_0x447a02=_0x5d6d1c['type'];if(!_0x4415c8)return console[_0x678a5a(0x188)](_0x678a5a(0x1b3)),console[_0x678a5a(0x188)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x447a02)return console[_0x678a5a(0x188)]('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console[_0x678a5a(0x188)](_0x678a5a(0x18f)),0x1;const _0x47f8bd=await resolveWorkspaceIdFromOptions(_0x5d6d1c,_0xa162a4,!![]),_0x2bea4a=await resolveSegmentFromOptions(_0x5d6d1c,_0xa162a4),_0x21fdf7={'name':_0x4415c8,'campaignType':_0x447a02,'workspaceId':_0x47f8bd,'description':_0x5d6d1c[_0x678a5a(0x1cb)],'audienceId':_0x2bea4a[_0x678a5a(0x1d7)],'audienceName':_0x2bea4a[_0x678a5a(0x165)],'enableUtmTracking':_0x5d6d1c[_0x678a5a(0x175)]},_0x78eecf=await withSpinner('Creating\x20always-on\x20campaign\x20\x27'+_0x4415c8+_0x678a5a(0x1d9),()=>_0xa162a4[_0x678a5a(0x1d1)][_0x678a5a(0x1c1)](_0x47f8bd,_0x21fdf7));return await handleSDKOutput([_0x78eecf[_0x678a5a(0x111)]],_0x1f271),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x130);[a22_0x2dd65e(0x1cb)]='Update\x20an\x20always-on\x20campaign';async[a22_0x2dd65e(0x110)](_0x29a9d1){const _0x2fb844=a22_0x2dd65e,{options:_0x4ca82c,args:_0x2d8866,tdx:_0x164350}=_0x29a9d1;if(_0x2d8866[_0x2fb844(0x132)]===0x0)return console[_0x2fb844(0x188)](_0x2fb844(0x157)),console[_0x2fb844(0x188)](_0x2fb844(0x151)),0x1;const _0x1ceb05=_0x2d8866[0x0],_0xa8156=_0x4ca82c,_0xea1587=await resolveWorkspaceIdFromOptions(_0xa8156,_0x164350,!![]),_0x119997=await resolveSegmentFromOptions(_0xa8156,_0x164350),_0x1876f2={'name':_0xa8156['name'],'description':_0xa8156['description'],'audienceId':_0x119997[_0x2fb844(0x1d7)],'audienceName':_0x119997[_0x2fb844(0x165)],'enableUtmTracking':_0xa8156[_0x2fb844(0x175)]},_0x22961c=Object[_0x2fb844(0x1ce)](Object[_0x2fb844(0x158)](_0x1876f2)[_0x2fb844(0x17b)](([,_0x2b4fd2])=>_0x2b4fd2!==undefined));if(Object[_0x2fb844(0x1c9)](_0x22961c)['length']===0x0)return console[_0x2fb844(0x188)](_0x2fb844(0x10f)),console['error'](_0x2fb844(0x138)),0x1;const _0x16bd24=await withSpinner(_0x2fb844(0x15f)+_0x1ceb05+'\x27...',()=>_0x164350['engage']['updateAlwaysOnCampaign'](_0xea1587,_0x1ceb05,_0x22961c),{'verbose':_0x4ca82c[_0x2fb844(0x14c)]});return await handleSDKOutput([_0x16bd24[_0x2fb844(0x111)]],_0x4ca82c),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{['name']=a22_0x2dd65e(0x1cd);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x141);async[a22_0x2dd65e(0x110)](_0x1b1027){const _0x1e5830=a22_0x2dd65e,{options:_0x5a1719,args:_0x20d97e,tdx:_0x1b1bcb}=_0x1b1027;if(_0x20d97e['length']===0x0)return console['error'](_0x1e5830(0x157)),console[_0x1e5830(0x188)](_0x1e5830(0x189)),0x1;const _0x344e42=_0x20d97e[0x0],_0x355370=_0x5a1719,_0x518fbd=await resolveWorkspaceIdFromOptions(_0x355370,_0x1b1bcb,!![]);if(!_0x5a1719[_0x1e5830(0x125)]){const _0x53282b=await confirm(_0x1e5830(0x1a0)+_0x344e42+_0x1e5830(0x13a));if(!_0x53282b)return console[_0x1e5830(0x182)](_0x1e5830(0x142)),0x0;}return await withSpinner('Deleting\x20always-on\x20campaign\x20\x27'+_0x344e42+'\x27...',()=>_0x1b1bcb[_0x1e5830(0x1d1)]['deleteAlwaysOnCampaign'](_0x518fbd,_0x344e42),{'verbose':_0x5a1719[_0x1e5830(0x14c)]}),console['log'](_0x1e5830(0x196)+_0x344e42+_0x1e5830(0x137)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x115);[a22_0x2dd65e(0x1cb)]='Launch\x20an\x20always-on\x20campaign';async[a22_0x2dd65e(0x110)](_0xd1ee38){const _0x209eb3=a22_0x2dd65e,{options:_0x267aa2,args:_0x724578,tdx:_0x328403}=_0xd1ee38;if(_0x724578['length']===0x0)return console[_0x209eb3(0x188)](_0x209eb3(0x157)),console[_0x209eb3(0x188)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>'),0x1;const _0x4ff2ec=_0x724578[0x0],_0x27e25f=_0x267aa2,_0x5e0384=await resolveWorkspaceIdFromOptions(_0x27e25f,_0x328403,!![]);return await withSpinner(_0x209eb3(0x10d)+_0x4ff2ec+_0x209eb3(0x1d9),()=>_0x328403[_0x209eb3(0x1d1)][_0x209eb3(0x18d)](_0x5e0384,_0x4ff2ec),{'verbose':_0x267aa2[_0x209eb3(0x14c)]}),console[_0x209eb3(0x182)]('Always-on\x20campaign\x20\x27'+_0x4ff2ec+'\x27\x20launched\x20successfully'),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{['name']='engage:always-on-campaign:pause';[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x133);async['execute'](_0x5ef1a8){const _0x3050d1=a22_0x2dd65e,{options:_0x4820b7,args:_0xbdcb31,tdx:_0x1fa5a5}=_0x5ef1a8;if(_0xbdcb31[_0x3050d1(0x132)]===0x0)return console[_0x3050d1(0x188)](_0x3050d1(0x157)),console[_0x3050d1(0x188)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>'),0x1;const _0x4a8b83=_0xbdcb31[0x0],_0x2e8284=_0x4820b7,_0x1ec317=await resolveWorkspaceIdFromOptions(_0x2e8284,_0x1fa5a5,!![]);return await withSpinner(_0x3050d1(0x16a)+_0x4a8b83+'\x27...',()=>_0x1fa5a5['engage'][_0x3050d1(0x1cc)](_0x1ec317,_0x4a8b83),{'verbose':_0x4820b7[_0x3050d1(0x14c)]}),console[_0x3050d1(0x182)](_0x3050d1(0x196)+_0x4a8b83+_0x3050d1(0x1da)),0x0;}}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x12f);[a22_0x2dd65e(0x1cb)]=a22_0x2dd65e(0x117);async[a22_0x2dd65e(0x110)](_0x4a5678){const _0x4f3645=a22_0x2dd65e,{options:_0x5564b0,args:_0x1e0108,tdx:_0x13a458}=_0x4a5678;if(_0x1e0108[_0x4f3645(0x132)]===0x0)return console[_0x4f3645(0x188)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4f3645(0x188)](_0x4f3645(0x1a8)),0x1;const _0x41aa19=_0x1e0108[0x0],_0x35b714=_0x5564b0,_0x4626af=await resolveWorkspaceIdFromOptions(_0x35b714,_0x13a458,!![]);return await withSpinner(_0x4f3645(0x143)+_0x41aa19+_0x4f3645(0x1d9),()=>_0x13a458[_0x4f3645(0x1d1)][_0x4f3645(0x14e)](_0x4626af,_0x41aa19),{'verbose':_0x5564b0[_0x4f3645(0x14c)]}),console[_0x4f3645(0x182)](_0x4f3645(0x196)+_0x41aa19+_0x4f3645(0x1c3)),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x1d3);['description']=a22_0x2dd65e(0x184);async[a22_0x2dd65e(0x110)](_0x3658d7){const _0x2a2537=a22_0x2dd65e,{options:_0x4b4e35,args:_0x41b3da,tdx:_0x223e88}=_0x3658d7;if(_0x41b3da[_0x2a2537(0x132)]===0x0)return console[_0x2a2537(0x188)](_0x2a2537(0x157)),console[_0x2a2537(0x188)](_0x2a2537(0x14f)),0x1;const _0x58890a=_0x41b3da[0x0],_0x31983e=_0x4b4e35,_0x1fd0ad=await resolveWorkspaceIdFromOptions(_0x31983e,_0x223e88,!![]);if(!_0x4b4e35['yes']){const _0x4a34e9=await confirm(_0x2a2537(0x1c0)+_0x58890a+_0x2a2537(0x13a));if(!_0x4a34e9)return console[_0x2a2537(0x182)](_0x2a2537(0x142)),0x0;}return await withSpinner(_0x2a2537(0x1c8)+_0x58890a+'\x27...',()=>_0x223e88[_0x2a2537(0x1d1)][_0x2a2537(0x12e)](_0x1fd0ad,_0x58890a),{'verbose':_0x4b4e35[_0x2a2537(0x14c)]}),console['log'](_0x2a2537(0x196)+_0x58890a+_0x2a2537(0x124)),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]=a22_0x2dd65e(0x144);[a22_0x2dd65e(0x1cb)]='Duplicate\x20an\x20always-on\x20campaign';async[a22_0x2dd65e(0x110)](_0x1e92fa){const _0x2cfab7=a22_0x2dd65e,{options:_0x29f8a1,args:_0x31fc1f,tdx:_0x3f3102}=_0x1e92fa;if(_0x31fc1f['length']===0x0)return console[_0x2cfab7(0x188)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x2cfab7(0x12b)),0x1;const _0xcde75a=_0x31fc1f[0x0],_0x3892b4=_0x29f8a1,_0x2e438d=await resolveWorkspaceIdFromOptions(_0x3892b4,_0x3f3102,!![]),_0x864a63=_0x3892b4['name'],_0x572783=await withSpinner(_0x2cfab7(0x126)+_0xcde75a+_0x2cfab7(0x1d9),()=>_0x3f3102[_0x2cfab7(0x1d1)]['duplicateAlwaysOnCampaign'](_0x2e438d,_0xcde75a,_0x864a63),{'verbose':_0x29f8a1['verbose']});return await handleSDKOutput([_0x572783[_0x2cfab7(0x111)]],_0x29f8a1),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a22_0x2dd65e(0x18c)]='engage:workspace:use';['description']=a22_0x2dd65e(0x19e);async[a22_0x2dd65e(0x110)](_0x110fad){const _0x5bcc10=a22_0x2dd65e,{options:_0x15c87e,args:_0x3cd086,tdx:_0x286f5b}=_0x110fad;if(_0x3cd086[_0x5bcc10(0x132)]===0x0)return console[_0x5bcc10(0x188)]('Error:\x20Workspace\x20name\x20is\x20required'),console[_0x5bcc10(0x188)](_0x5bcc10(0x1a2)),0x1;const _0x1a3709=_0x3cd086[0x0];await withSpinner(_0x5bcc10(0x15d)+_0x1a3709+_0x5bcc10(0x1d9),()=>_0x286f5b['engage'][_0x5bcc10(0x19a)](_0x1a3709));const _0x5bcc1b=_0x15c87e[_0x5bcc10(0x1b7)]||undefined;return saveSessionContext({'engage_workspace':_0x1a3709},_0x5bcc1b),console[_0x5bcc10(0x182)](_0x5bcc10(0x14d)+_0x1a3709),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
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;}}