@treasuredata/tdx 2026.3.12 → 2026.3.13
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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a19_0x595fe6=a19_0x5301;(function(_0x196303,_0x2d378d){const _0x247454=a19_0x5301,_0x16f3f4=_0x196303();while(!![]){try{const _0x12f47b=parseInt(_0x247454(0x18d))/0x1*(parseInt(_0x247454(0x16d))/0x2)+parseInt(_0x247454(0x165))/0x3+parseInt(_0x247454(0x19d))/0x4+-parseInt(_0x247454(0x195))/0x5+-parseInt(_0x247454(0x16e))/0x6+parseInt(_0x247454(0x188))/0x7+-parseInt(_0x247454(0x174))/0x8*(parseInt(_0x247454(0x16a))/0x9);if(_0x12f47b===_0x2d378d)break;else _0x16f3f4['push'](_0x16f3f4['shift']());}catch(_0xd2fa60){_0x16f3f4['push'](_0x16f3f4['shift']());}}}(a19_0x38a3,0x65606));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a19_0x2033c5 from'chalk';import a19_0x161823 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';function a19_0x5301(_0x4724d3,_0x59f8e0){_0x4724d3=_0x4724d3-0x15a;const _0x38a3cf=a19_0x38a3();let _0x5301ff=_0x38a3cf[_0x4724d3];return _0x5301ff;}import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a19_0x38a3(){const _0x335c21=['\x20campaigns','relativePath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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)','name','create','95836szMBmN','workspace','\x20\x20\x20\x20','cyan','\x20campaign\x20files','resolveWorkspaceId','warnings','campaignId','dirname','1\x20campaign\x20file:\x20','execute','Preparing\x20push\x20to\x20workspace\x20\x27','def','Workspace\x20is\x20required.','436497bfszCD','\x0aPush\x20summary\x20for\x20workspace\x20\x27','Push\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','campaign_type','3832659vhJFTX','config','verbose','2sCVTNO','717918wymDnL','red','yellow','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','engage_workspace','created','16oQYeMz','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','Found\x20','results','segment','\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','error','session','\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','data','filter','message','\x20campaigns\x20to\x20update:','engage','length','setPhase','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','green','action','3929681KPlFly','errors','\x0aError:','yes','cwd','669143KvDLWs','✔\x20Updated\x20','-\x20no\x20changes\x20applied','dim','map','resolve','updated','Aborted.','66955VZosKM','engage:campaign:push'];a19_0x38a3=function(){return _0x335c21;};return a19_0x38a3();}export class EngageCampaignPushCommand extends BaseCommand{[a19_0x595fe6(0x19b)]=a19_0x595fe6(0x196);['description']='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns';async[a19_0x595fe6(0x161)](_0x3f0061){const _0x584dfb=a19_0x595fe6,{options:_0x49de8c,args:_0x5cb9ee,tdx:_0x2ed5}=_0x3f0061,_0x176901=_0x49de8c,_0x4f1c51=_0x5cb9ee[0x0],_0x49d368=_0x4f1c51?a19_0x161823[_0x584dfb(0x192)](_0x4f1c51):undefined,_0xe56735=_0x49d368?isYamlFile(_0x49d368):![];let _0x49403f;if(_0xe56735&&_0x49d368)_0x49403f=a19_0x161823[_0x584dfb(0x15f)](_0x49d368);else _0x49d368?_0x49403f=_0x49d368:_0x49403f=process[_0x584dfb(0x18c)]();let _0x2f43ba;const _0x2f1c65=tryFindTdxConfig(_0x49403f);_0x2f1c65?.[_0x584dfb(0x16b)][_0x584dfb(0x172)]&&(_0x2f43ba=_0x2f1c65[_0x584dfb(0x16b)][_0x584dfb(0x172)],!_0xe56735&&(_0x49403f=_0x2f1c65['configDir']));_0x176901[_0x584dfb(0x19e)]&&(_0x2f43ba=_0x176901[_0x584dfb(0x19e)]);if(!_0x2f43ba){const _0x57e851=loadSessionContext(_0x176901[_0x584dfb(0x17b)]);_0x57e851?.[_0x584dfb(0x172)]&&(_0x2f43ba=_0x57e851[_0x584dfb(0x172)]);}if(!_0x2f43ba)return console['error'](a19_0x2033c5['yellow'](_0x584dfb(0x164))),console['error'](_0x584dfb(0x17c)),console[_0x584dfb(0x17a)](_0x584dfb(0x19a)),console[_0x584dfb(0x17a)](_0x584dfb(0x179)),console['error'](_0x584dfb(0x185)),0x1;let _0x1603c6;_0xe56735&&_0x49d368?_0x1603c6=[_0x49d368]:_0x1603c6=discoverCampaignFiles(_0x49403f);if(_0x1603c6[_0x584dfb(0x182)]===0x0)return console[_0x584dfb(0x17a)](a19_0x2033c5['yellow'](_0x584dfb(0x184)+_0x49403f)),console['error'](a19_0x2033c5[_0x584dfb(0x190)](_0x584dfb(0x175))),0x1;const _0x2aee70=_0x1603c6[_0x584dfb(0x191)](_0x304605=>parseCampaignFile(_0x304605,a19_0x161823[_0x584dfb(0x15f)](_0x304605))),_0x42a683=_0x2aee70[_0x584dfb(0x182)]===0x1?_0x584dfb(0x160)+_0x2aee70[0x0][_0x584dfb(0x163)][_0x584dfb(0x19b)]:_0x2aee70[_0x584dfb(0x182)]+_0x584dfb(0x15b);console['error'](_0x584dfb(0x176)+a19_0x2033c5[_0x584dfb(0x15a)](_0x42a683));let _0xd7a027=![];for(const _0x57c008 of _0x2aee70){const _0x5274d1=validateCampaignDef(_0x57c008['def']);if(!_0x5274d1['valid']){_0xd7a027=!![],console[_0x584dfb(0x17a)](a19_0x2033c5['red']('\x0aValidation\x20errors\x20in\x20'+_0x57c008[_0x584dfb(0x198)]+':'));for(const _0x38d7c0 of _0x5274d1[_0x584dfb(0x189)]){console['error']('\x20\x20'+a19_0x2033c5['red']('✗')+'\x20'+_0x38d7c0['path']+':\x20'+_0x38d7c0[_0x584dfb(0x17f)]);}}for(const _0x489a40 of _0x5274d1[_0x584dfb(0x15d)]){console[_0x584dfb(0x17a)]('\x20\x20'+a19_0x2033c5[_0x584dfb(0x170)]('⚠')+'\x20'+_0x489a40['path']+':\x20'+_0x489a40[_0x584dfb(0x17f)]);}}if(_0xd7a027)return console['error'](a19_0x2033c5[_0x584dfb(0x16f)](_0x584dfb(0x171))),0x1;const _0x26ae78=await _0x2ed5['engage'][_0x584dfb(0x15c)](_0x2f43ba),_0x5bb39f=await withProgressSpinner(_0x584dfb(0x162)+_0x2f43ba+'\x27...',_0x11c4ed=>preparePush({'engage':_0x2ed5[_0x584dfb(0x181)],'segment':_0x2ed5[_0x584dfb(0x178)]},_0x2aee70,_0x26ae78,{'progress':{'update':_0x563e4d=>_0x11c4ed[_0x584dfb(0x183)](_0x563e4d)}}),{'verbose':_0x176901['verbose']}),_0xb14d20=_0x5bb39f[_0x584dfb(0x17d)];await withProgressSpinner('Resolving\x20references...',_0x5c58c9=>resolveAndBuildInputs({'engage':_0x2ed5[_0x584dfb(0x181)],'segment':_0x2ed5[_0x584dfb(0x178)]},_0xb14d20,_0x26ae78,{'progress':{'update':_0x3223f5=>_0x5c58c9[_0x584dfb(0x183)](_0x3223f5)}}),{'verbose':_0x176901[_0x584dfb(0x16c)]});const _0x583d23=_0xb14d20[_0x584dfb(0x17e)](_0x537016=>_0x537016['action']===_0x584dfb(0x19c)),_0x3fbfe0=_0xb14d20[_0x584dfb(0x17e)](_0x508d0b=>_0x508d0b[_0x584dfb(0x187)]==='update');console[_0x584dfb(0x17a)](_0x584dfb(0x166)+_0x2f43ba+'\x27:');if(_0x583d23[_0x584dfb(0x182)]>0x0){console[_0x584dfb(0x17a)]('\x20\x20'+a19_0x2033c5['green']('+\x20'+_0x583d23[_0x584dfb(0x182)]+'\x20new\x20campaigns:'));for(const _0x33d8c1 of _0x583d23){console['error'](_0x584dfb(0x19f)+a19_0x2033c5['green']('+')+'\x20'+_0x33d8c1[_0x584dfb(0x163)][_0x584dfb(0x19b)]+'\x20('+_0x33d8c1[_0x584dfb(0x163)][_0x584dfb(0x169)]+')');}}if(_0x3fbfe0[_0x584dfb(0x182)]>0x0){console[_0x584dfb(0x17a)]('\x20\x20'+a19_0x2033c5[_0x584dfb(0x170)]('~\x20'+_0x3fbfe0['length']+_0x584dfb(0x180)));for(const _0x401e45 of _0x3fbfe0){console[_0x584dfb(0x17a)](_0x584dfb(0x19f)+a19_0x2033c5[_0x584dfb(0x170)]('~')+'\x20'+_0x401e45['def'][_0x584dfb(0x19b)]+'\x20('+_0x401e45[_0x584dfb(0x163)][_0x584dfb(0x169)]+')');}}if(_0x583d23['length']===0x0&&_0x3fbfe0[_0x584dfb(0x182)]===0x0)return console[_0x584dfb(0x17a)](a19_0x2033c5[_0x584dfb(0x186)]('✔\x20All\x20campaigns\x20are\x20up\x20to\x20date')),0x0;if(_0x176901['dryRun'])return console[_0x584dfb(0x17a)](a19_0x2033c5[_0x584dfb(0x170)](_0x584dfb(0x168))),0x0;if(!_0x176901[_0x584dfb(0x18b)]){if(!isInteractive())return console[_0x584dfb(0x17a)](a19_0x2033c5[_0x584dfb(0x16f)](_0x584dfb(0x18a)),_0x584dfb(0x199)),console[_0x584dfb(0x17a)](a19_0x2033c5['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2a2afe=await confirmKey(_0x584dfb(0x167)+(_0x583d23[_0x584dfb(0x182)]+_0x3fbfe0[_0x584dfb(0x182)])+'\x20campaigns?');if(!_0x2a2afe)return console[_0x584dfb(0x17a)](a19_0x2033c5[_0x584dfb(0x170)](_0x584dfb(0x194)),_0x584dfb(0x18f)),0x1;}const _0x3ad456=await withProgressSpinner('Pushing\x20campaigns...',_0x5e4f8c=>executePush({'engage':_0x2ed5[_0x584dfb(0x181)],'segment':_0x2ed5['segment']},_0xb14d20,{'progress':{'update':_0x1c08ba=>_0x5e4f8c[_0x584dfb(0x183)](_0x1c08ba)}}),{'verbose':_0x176901[_0x584dfb(0x16c)]}),_0x30b5d0=_0x3ad456[_0x584dfb(0x17d)];for(const _0x44b874 of _0x30b5d0[_0x584dfb(0x177)]){if(_0x44b874[_0x584dfb(0x15e)]&&(_0x44b874[_0x584dfb(0x187)]===_0x584dfb(0x173)||_0x44b874[_0x584dfb(0x187)]===_0x584dfb(0x193))){const _0x4b4b57=getCampaignUrl(_0x176901['site'],_0x26ae78,_0x44b874[_0x584dfb(0x15e)]),_0x9aa87d=_0x44b874['action']==='created'?'+':'~',_0x8e42fb=_0x44b874[_0x584dfb(0x187)]==='created'?a19_0x2033c5[_0x584dfb(0x186)](_0x9aa87d):a19_0x2033c5[_0x584dfb(0x170)](_0x9aa87d);console['error']('\x20\x20'+_0x8e42fb+'\x20'+hyperlink(_0x44b874[_0x584dfb(0x19b)],_0x4b4b57)+'\x20'+a19_0x2033c5[_0x584dfb(0x190)](_0x4b4b57));}}_0x30b5d0['created']>0x0&&console[_0x584dfb(0x17a)](a19_0x2033c5[_0x584dfb(0x186)]('✔\x20Created\x20'+_0x30b5d0[_0x584dfb(0x173)]+_0x584dfb(0x197)));_0x30b5d0[_0x584dfb(0x193)]>0x0&&console[_0x584dfb(0x17a)](a19_0x2033c5[_0x584dfb(0x186)](_0x584dfb(0x18e)+_0x30b5d0[_0x584dfb(0x193)]+'\x20campaigns'));if(_0x30b5d0[_0x584dfb(0x189)]['length']>0x0){console[_0x584dfb(0x17a)](a19_0x2033c5[_0x584dfb(0x16f)]('✘\x20'+_0x30b5d0[_0x584dfb(0x189)]['length']+'\x20errors:'));for(const _0xfaccef of _0x30b5d0['errors']){console[_0x584dfb(0x17a)]('\x20\x20'+a19_0x2033c5[_0x584dfb(0x16f)](_0xfaccef[_0x584dfb(0x19b)])+':\x20'+_0xfaccef[_0x584dfb(0x17a)]);}}return saveSessionContext({'engage_workspace':_0x2f43ba},_0x176901[_0x584dfb(0x17b)]),_0x30b5d0[_0x584dfb(0x189)][_0x584dfb(0x182)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a19_0x29d27a=a19_0x26dd;(function(_0x541251,_0x57fe4d){const _0x277c8b=a19_0x26dd,_0x458b14=_0x541251();while(!![]){try{const _0x5a666d=parseInt(_0x277c8b(0x126))/0x1+-parseInt(_0x277c8b(0x124))/0x2*(-parseInt(_0x277c8b(0x11d))/0x3)+parseInt(_0x277c8b(0x109))/0x4*(-parseInt(_0x277c8b(0xf1))/0x5)+-parseInt(_0x277c8b(0xef))/0x6*(parseInt(_0x277c8b(0xe8))/0x7)+parseInt(_0x277c8b(0x10e))/0x8+-parseInt(_0x277c8b(0x123))/0x9+parseInt(_0x277c8b(0x100))/0xa;if(_0x5a666d===_0x57fe4d)break;else _0x458b14['push'](_0x458b14['shift']());}catch(_0x1b0731){_0x458b14['push'](_0x458b14['shift']());}}}(a19_0x39c6,0x677e7));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a19_0x26dd(_0x1cfaa2,_0x76c060){_0x1cfaa2=_0x1cfaa2-0xe2;const _0x39c62c=a19_0x39c6();let _0x26ddb2=_0x39c62c[_0x1cfaa2];return _0x26ddb2;}function a19_0x39c6(){const _0x4aee56=['3RCrLqO','message','yes','cwd','relativePath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','5624334RioRBu','834826LlGRmk','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','690140VyUbTQ','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','setPhase','map','\x20errors:','red','-\x20no\x20changes\x20applied','description','verbose','\x20campaigns\x20to\x20update:','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','engage','Workspace\x20is\x20required.','7ynZClt','results','def','engage_workspace','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','\x20\x20\x20\x20','site','3056340ulCLQJ','valid','23810idXnic','engage:campaign:push','dryRun','dirname','configDir','\x0aError:','Found\x20','error','config','dim','campaign_type','Aborted.','warnings','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','filter','5247060ZAxsKy','campaignId','Push\x20','name','path','segment','yellow','update','✔\x20Updated\x20','164OtIkXA','data','updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','create','969680VMNTQk','execute','Resolving\x20references...','action','\x20campaigns?','1\x20campaign\x20file:\x20','✔\x20Created\x20','workspace','errors','length','green','\x20campaigns','session','\x20new\x20campaigns:','created'];a19_0x39c6=function(){return _0x4aee56;};return a19_0x39c6();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a19_0x541383 from'chalk';import a19_0x16c9dc from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a19_0x29d27a(0x103)]=a19_0x29d27a(0xf2);[a19_0x29d27a(0xe2)]=a19_0x29d27a(0xfe);async[a19_0x29d27a(0x10f)](_0x598762){const _0x33e4d5=a19_0x29d27a,{options:_0x1d0ef9,args:_0x37a6c0,tdx:_0x2b321c}=_0x598762,_0x2bca96=_0x1d0ef9,_0x511a3c=_0x37a6c0[0x0],_0x520a9a=_0x511a3c?a19_0x16c9dc['resolve'](_0x511a3c):undefined,_0x3ac5a8=_0x520a9a?isYamlFile(_0x520a9a):![];let _0x3980ad;if(_0x3ac5a8&&_0x520a9a)_0x3980ad=a19_0x16c9dc[_0x33e4d5(0xf4)](_0x520a9a);else _0x520a9a?_0x3980ad=_0x520a9a:_0x3980ad=process[_0x33e4d5(0x120)]();let _0x54e487;const _0x330656=tryFindTdxConfig(_0x3980ad);_0x330656?.[_0x33e4d5(0xf9)][_0x33e4d5(0xeb)]&&(_0x54e487=_0x330656[_0x33e4d5(0xf9)]['engage_workspace'],!_0x3ac5a8&&(_0x3980ad=_0x330656[_0x33e4d5(0xf5)]));_0x2bca96['workspace']&&(_0x54e487=_0x2bca96[_0x33e4d5(0x115)]);if(!_0x54e487){const _0xfc57cf=loadSessionContext(_0x2bca96[_0x33e4d5(0x11a)]);_0xfc57cf?.[_0x33e4d5(0xeb)]&&(_0x54e487=_0xfc57cf[_0x33e4d5(0xeb)]);}if(!_0x54e487)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x106)](_0x33e4d5(0xe7))),console[_0x33e4d5(0xf8)]('\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console[_0x33e4d5(0xf8)](_0x33e4d5(0x10c)),console[_0x33e4d5(0xf8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console[_0x33e4d5(0xf8)](_0x33e4d5(0x125)),0x1;let _0x2df3bf;_0x3ac5a8&&_0x520a9a?_0x2df3bf=[_0x520a9a]:_0x2df3bf=discoverCampaignFiles(_0x3980ad);if(_0x2df3bf[_0x33e4d5(0x117)]===0x0)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x106)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x3980ad)),console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0xfa)](_0x33e4d5(0xec))),0x1;const _0xf15d44=_0x2df3bf[_0x33e4d5(0x129)](_0x51f6f9=>parseCampaignFile(_0x51f6f9,a19_0x16c9dc[_0x33e4d5(0xf4)](_0x51f6f9))),_0x1da844=_0xf15d44[_0x33e4d5(0x117)]===0x1?_0x33e4d5(0x113)+_0xf15d44[0x0][_0x33e4d5(0xea)][_0x33e4d5(0x103)]:_0xf15d44[_0x33e4d5(0x117)]+'\x20campaign\x20files';console[_0x33e4d5(0xf8)](_0x33e4d5(0xf7)+a19_0x541383['cyan'](_0x1da844));let _0x2fc044=![];for(const _0x322e4c of _0xf15d44){const _0xfced9a=validateCampaignDef(_0x322e4c[_0x33e4d5(0xea)]);if(!_0xfced9a[_0x33e4d5(0xf0)]){_0x2fc044=!![],console['error'](a19_0x541383[_0x33e4d5(0x12b)]('\x0aValidation\x20errors\x20in\x20'+_0x322e4c[_0x33e4d5(0x121)]+':'));for(const _0x51df36 of _0xfced9a[_0x33e4d5(0x116)]){console[_0x33e4d5(0xf8)]('\x20\x20'+a19_0x541383[_0x33e4d5(0x12b)]('✗')+'\x20'+_0x51df36[_0x33e4d5(0x104)]+':\x20'+_0x51df36[_0x33e4d5(0x11e)]);}}for(const _0x4c9d87 of _0xfced9a[_0x33e4d5(0xfd)]){console[_0x33e4d5(0xf8)]('\x20\x20'+a19_0x541383[_0x33e4d5(0x106)]('⚠')+'\x20'+_0x4c9d87['path']+':\x20'+_0x4c9d87[_0x33e4d5(0x11e)]);}}if(_0x2fc044)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x12b)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x280039=await _0x2b321c[_0x33e4d5(0xe6)]['resolveWorkspaceId'](_0x54e487),_0x380e87=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x54e487+'\x27...',_0x58ad33=>preparePush({'engage':_0x2b321c[_0x33e4d5(0xe6)],'segment':_0x2b321c[_0x33e4d5(0x105)]},_0xf15d44,_0x280039,{'progress':{'update':_0x11628d=>_0x58ad33[_0x33e4d5(0x128)](_0x11628d)}}),{'verbose':_0x2bca96[_0x33e4d5(0xe3)]}),_0x2564cf=_0x380e87[_0x33e4d5(0x10a)];await withProgressSpinner(_0x33e4d5(0x110),_0x431753=>resolveAndBuildInputs({'engage':_0x2b321c[_0x33e4d5(0xe6)],'segment':_0x2b321c[_0x33e4d5(0x105)]},_0x2564cf,_0x280039,{'progress':{'update':_0x348676=>_0x431753[_0x33e4d5(0x128)](_0x348676)}}),{'verbose':_0x2bca96[_0x33e4d5(0xe3)]});const _0x5f02b1=_0x2564cf['filter'](_0x3e3772=>_0x3e3772[_0x33e4d5(0x111)]===_0x33e4d5(0x10d)),_0x56ad5e=_0x2564cf[_0x33e4d5(0xff)](_0x2b789a=>_0x2b789a[_0x33e4d5(0x111)]===_0x33e4d5(0x107));console[_0x33e4d5(0xf8)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x54e487+'\x27:');if(_0x5f02b1['length']>0x0){console['error']('\x20\x20'+a19_0x541383[_0x33e4d5(0x118)]('+\x20'+_0x5f02b1[_0x33e4d5(0x117)]+_0x33e4d5(0x11b)));for(const _0x28a6b2 of _0x5f02b1){console[_0x33e4d5(0xf8)](_0x33e4d5(0xed)+a19_0x541383[_0x33e4d5(0x118)]('+')+'\x20'+_0x28a6b2[_0x33e4d5(0xea)][_0x33e4d5(0x103)]+'\x20('+_0x28a6b2[_0x33e4d5(0xea)][_0x33e4d5(0xfb)]+')');}}if(_0x56ad5e[_0x33e4d5(0x117)]>0x0){console[_0x33e4d5(0xf8)]('\x20\x20'+a19_0x541383[_0x33e4d5(0x106)]('~\x20'+_0x56ad5e['length']+_0x33e4d5(0xe4)));for(const _0x28ae5e of _0x56ad5e){console['error'](_0x33e4d5(0xed)+a19_0x541383[_0x33e4d5(0x106)]('~')+'\x20'+_0x28ae5e[_0x33e4d5(0xea)][_0x33e4d5(0x103)]+'\x20('+_0x28ae5e['def']['campaign_type']+')');}}if(_0x5f02b1[_0x33e4d5(0x117)]===0x0&&_0x56ad5e[_0x33e4d5(0x117)]===0x0)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x118)](_0x33e4d5(0xe5))),0x0;if(_0x2bca96[_0x33e4d5(0xf3)])return console[_0x33e4d5(0xf8)](a19_0x541383['yellow'](_0x33e4d5(0x127))),0x0;if(!_0x2bca96[_0x33e4d5(0x11f)]){if(!isInteractive())return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x12b)](_0x33e4d5(0xf6)),_0x33e4d5(0x122)),console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0xfa)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5f4dfb=await confirmKey(_0x33e4d5(0x102)+(_0x5f02b1[_0x33e4d5(0x117)]+_0x56ad5e[_0x33e4d5(0x117)])+_0x33e4d5(0x112));if(!_0x5f4dfb)return console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x106)](_0x33e4d5(0xfc)),_0x33e4d5(0x12c)),0x1;}const _0x3bb6ce=await withProgressSpinner('Pushing\x20campaigns...',_0x306aed=>executePush({'engage':_0x2b321c[_0x33e4d5(0xe6)],'segment':_0x2b321c[_0x33e4d5(0x105)]},_0x2564cf,{'progress':{'update':_0x4bb0a4=>_0x306aed[_0x33e4d5(0x128)](_0x4bb0a4)}}),{'verbose':_0x2bca96['verbose']}),_0x1ac1df=_0x3bb6ce['data'];for(const _0x31e704 of _0x1ac1df[_0x33e4d5(0xe9)]){if(_0x31e704[_0x33e4d5(0x101)]&&(_0x31e704[_0x33e4d5(0x111)]==='created'||_0x31e704[_0x33e4d5(0x111)]===_0x33e4d5(0x10b))){const _0x4b2f98=getCampaignUrl(_0x2bca96[_0x33e4d5(0xee)],_0x280039,_0x31e704[_0x33e4d5(0x101)]),_0x39977e=_0x31e704[_0x33e4d5(0x111)]===_0x33e4d5(0x11c)?'+':'~',_0x1b3117=_0x31e704[_0x33e4d5(0x111)]===_0x33e4d5(0x11c)?a19_0x541383[_0x33e4d5(0x118)](_0x39977e):a19_0x541383['yellow'](_0x39977e);console[_0x33e4d5(0xf8)]('\x20\x20'+_0x1b3117+'\x20'+hyperlink(_0x31e704['name'],_0x4b2f98)+'\x20'+a19_0x541383[_0x33e4d5(0xfa)](_0x4b2f98));}}_0x1ac1df[_0x33e4d5(0x11c)]>0x0&&console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x118)](_0x33e4d5(0x114)+_0x1ac1df[_0x33e4d5(0x11c)]+_0x33e4d5(0x119)));_0x1ac1df[_0x33e4d5(0x10b)]>0x0&&console[_0x33e4d5(0xf8)](a19_0x541383[_0x33e4d5(0x118)](_0x33e4d5(0x108)+_0x1ac1df[_0x33e4d5(0x10b)]+_0x33e4d5(0x119)));if(_0x1ac1df[_0x33e4d5(0x116)][_0x33e4d5(0x117)]>0x0){console['error'](a19_0x541383[_0x33e4d5(0x12b)]('✘\x20'+_0x1ac1df[_0x33e4d5(0x116)]['length']+_0x33e4d5(0x12a)));for(const _0x588807 of _0x1ac1df[_0x33e4d5(0x116)]){console[_0x33e4d5(0xf8)]('\x20\x20'+a19_0x541383[_0x33e4d5(0x12b)](_0x588807['name'])+':\x20'+_0x588807['error']);}}return saveSessionContext({'engage_workspace':_0x54e487},_0x2bca96[_0x33e4d5(0x11a)]),_0x1ac1df[_0x33e4d5(0x116)][_0x33e4d5(0x117)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x215e69=a20_0x3669;(function(_0x18e635,_0x5bc6f2){const _0x3077fe=a20_0x3669,_0x423156=_0x18e635();while(!![]){try{const _0x53e068=-parseInt(_0x3077fe(0x1d2))/0x1*(-parseInt(_0x3077fe(0x1d7))/0x2)+parseInt(_0x3077fe(0x1dc))/0x3+-parseInt(_0x3077fe(0x1d0))/0x4+-parseInt(_0x3077fe(0x1f2))/0x5*(parseInt(_0x3077fe(0x1f4))/0x6)+parseInt(_0x3077fe(0x1e4))/0x7+-parseInt(_0x3077fe(0x1db))/0x8+parseInt(_0x3077fe(0x1fa))/0x9;if(_0x53e068===_0x5bc6f2)break;else _0x423156['push'](_0x423156['shift']());}catch(_0x4d0e36){_0x423156['push'](_0x423156['shift']());}}}(a20_0x1e29,0x91402));import{BaseCommand}from'./command.js';function a20_0x3669(_0x2167aa,_0x2bcbe8){_0x2167aa=_0x2167aa-0x1cb;const _0x1e297f=a20_0x1e29();let _0x366924=_0x1e297f[_0x2167aa];return _0x366924;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a20_0x1e29(){const _0x3dca21=['.yaml','1594341ZxcwXj','\x20non-campaign\x20file(s)\x20skipped)','verbose','length','\x20(skipped:\x20','\x20non-campaign\x20file(s)\x20skipped','✔\x20All\x20','1300060zvMwvH','\x20warning(s)','121jEQEfz','dirname','warningCount','log','red','18152bIgOlP','endsWith','Error:\x20Directory\x20not\x20found:\x20','\x20campaign(s)\x20with\x20errors,\x20','173232ngBeTt','1234557mDesfL','invalidCount','engage:campaign:validate','errors','hasErrors','\x20warning(s)\x20found','\x20campaign(s)\x20valid','campaign','459865HjZKep','reason','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cwd','dim','Validate\x20campaign\x20YAML\x20files','warnings','relativePath','valid','error','validCount','skippedCount','.yml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','320smmcZw','name','76026BNWucy','filter','green','\x20error(s)','yellow'];a20_0x1e29=function(){return _0x3dca21;};return a20_0x1e29();}import a20_0x2af9bb from'chalk';import a20_0x571a25 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a20_0x215e69(0x1f3)]=a20_0x215e69(0x1de);['description']=a20_0x215e69(0x1e9);async['execute'](_0x5568c6){const _0x418035=a20_0x215e69,{options:_0x5ad493,args:_0x5e81cb}=_0x5568c6,_0x57c175=_0x5ad493,_0x5a7154=_0x5e81cb[0x0],_0x449cf4=_0x5a7154?a20_0x571a25['resolve'](_0x5a7154):undefined,_0x41a3b3=_0x449cf4?isYamlFile(_0x449cf4):![];let _0x13da8c,_0x443c13;if(_0x41a3b3&&_0x449cf4)_0x13da8c=a20_0x571a25[_0x418035(0x1d3)](_0x449cf4),_0x443c13=_0x449cf4;else _0x449cf4?_0x13da8c=_0x449cf4:_0x13da8c=process[_0x418035(0x1e7)]();if(!_0x443c13&&!existsSync(_0x13da8c))return console[_0x418035(0x1ed)](a20_0x2af9bb[_0x418035(0x1d6)](_0x418035(0x1d9)+_0x13da8c+'\x0a')),0x1;let _0x5e8715;if(_0x443c13){if(!_0x443c13[_0x418035(0x1d8)](_0x418035(0x1f0))&&!_0x443c13[_0x418035(0x1d8)](_0x418035(0x1f9)))return console['error'](a20_0x2af9bb[_0x418035(0x1d6)](_0x418035(0x1f1)+_0x443c13+'\x0a')),0x1;_0x5e8715=[_0x443c13];}else _0x5e8715=findYamlFiles(_0x13da8c);if(_0x5e8715[_0x418035(0x1cc)]===0x0)return console[_0x418035(0x1ed)](a20_0x2af9bb['red'](_0x418035(0x1e6)+_0x13da8c+'\x0a')),0x1;const _0x296a4d=validateYamlFiles(_0x5e8715,_0x13da8c,{'filterType':_0x418035(0x1e3)}),_0x31e8c8=calculateSummary(_0x296a4d),_0x22d983=_0x296a4d[_0x418035(0x1f5)](isValidationResult);if(_0x22d983[_0x418035(0x1cc)]===0x0)return console['error'](a20_0x2af9bb[_0x418035(0x1f8)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x13da8c+'\x0a')),_0x31e8c8[_0x418035(0x1ef)]>0x0&&console[_0x418035(0x1ed)](a20_0x2af9bb[_0x418035(0x1e8)]('('+_0x31e8c8[_0x418035(0x1ef)]+_0x418035(0x1fb))),0x0;for(const _0x2d9105 of _0x296a4d){if(!isValidationResult(_0x2d9105)){_0x57c175[_0x418035(0x1cb)]&&console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1e8)]('-\x20'+_0x2d9105[_0x418035(0x1eb)]+_0x418035(0x1cd)+_0x2d9105[_0x418035(0x1e5)]+')'));continue;}const {relativePath:_0xe511ea,source:_0x1078aa,result:_0x3f35cf}=_0x2d9105;if(_0x3f35cf[_0x418035(0x1ec)]&&_0x3f35cf['warnings'][_0x418035(0x1cc)]===0x0)_0x57c175[_0x418035(0x1cb)]&&console[_0x418035(0x1d5)](a20_0x2af9bb['green']('✔\x20'+_0xe511ea));else _0x3f35cf[_0x418035(0x1ec)]?(console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1f8)]('⚠\x20'+_0xe511ea+':\x20'+_0x3f35cf[_0x418035(0x1ea)][_0x418035(0x1cc)]+_0x418035(0x1d1))),console[_0x418035(0x1d5)](formatValidationResult(_0x3f35cf,_0x1078aa,_0xe511ea))):(console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1d6)]('✖\x20'+_0xe511ea+':\x20'+_0x3f35cf[_0x418035(0x1df)][_0x418035(0x1cc)]+_0x418035(0x1f7))),console[_0x418035(0x1d5)](formatValidationResult(_0x3f35cf,_0x1078aa,_0xe511ea)));}return console[_0x418035(0x1d5)](''),_0x31e8c8[_0x418035(0x1e0)]?(console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1d6)]('Validation\x20failed:\x20'+_0x31e8c8[_0x418035(0x1dd)]+_0x418035(0x1da)+_0x31e8c8['validCount']+'\x20valid')),_0x31e8c8[_0x418035(0x1d4)]>0x0&&console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1f8)](_0x31e8c8[_0x418035(0x1d4)]+'\x20warning(s)\x20found')),_0x31e8c8[_0x418035(0x1ef)]>0x0&&console['log'](a20_0x2af9bb[_0x418035(0x1e8)](_0x31e8c8['skippedCount']+_0x418035(0x1ce))),0x1):(console['log'](a20_0x2af9bb[_0x418035(0x1f6)](_0x418035(0x1cf)+_0x31e8c8[_0x418035(0x1ee)]+_0x418035(0x1e2))),_0x31e8c8[_0x418035(0x1d4)]>0x0&&console[_0x418035(0x1d5)](a20_0x2af9bb[_0x418035(0x1f8)](_0x31e8c8[_0x418035(0x1d4)]+_0x418035(0x1e1))),_0x31e8c8[_0x418035(0x1ef)]>0x0&&console[_0x418035(0x1d5)](a20_0x2af9bb['dim'](_0x31e8c8[_0x418035(0x1ef)]+_0x418035(0x1ce))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x14e766=a21_0x38b3;(function(_0x40811f,_0x54b4a3){const _0x481540=a21_0x38b3,_0x480ff7=_0x40811f();while(!![]){try{const _0x48b818=parseInt(_0x481540(0x1eb))/0x1*(parseInt(_0x481540(0x16e))/0x2)+parseInt(_0x481540(0x176))/0x3+-parseInt(_0x481540(0x1a6))/0x4+parseInt(_0x481540(0x1d0))/0x5*(-parseInt(_0x481540(0x1fb))/0x6)+-parseInt(_0x481540(0x1b6))/0x7*(parseInt(_0x481540(0x1f9))/0x8)+parseInt(_0x481540(0x1bf))/0x9*(-parseInt(_0x481540(0x20a))/0xa)+parseInt(_0x481540(0x160))/0xb;if(_0x48b818===_0x54b4a3)break;else _0x480ff7['push'](_0x480ff7['shift']());}catch(_0x152fb8){_0x480ff7['push'](_0x480ff7['shift']());}}}(a21_0x3b34,0xf06c2));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';function a21_0x38b3(_0x2ae099,_0x38f59b){_0x2ae099=_0x2ae099-0x14d;const _0x3b3408=a21_0x3b34();let _0x38b3f2=_0x3b3408[_0x2ae099];return _0x38b3f2;}import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl,getTemplateUrl,getWorkspaceUrl}from'../sdk/client/endpoints.js';import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a21_0x2edb79 from'chalk';export async function resolveWorkspaceIdFromOptions(_0x38d6ec,_0x8df95c,_0x4920e4=![]){const _0x19d3e6=a21_0x38b3;if(_0x38d6ec[_0x19d3e6(0x195)])return await _0x8df95c['engage']['resolveWorkspaceId'](_0x38d6ec[_0x19d3e6(0x195)]);const _0x33e8d8=loadSessionContext(_0x38d6ec[_0x19d3e6(0x193)]);if(_0x33e8d8?.[_0x19d3e6(0x188)])return await _0x8df95c['engage']['resolveWorkspaceId'](_0x33e8d8[_0x19d3e6(0x188)]);if(_0x4920e4)throw new SDKError(ErrorCode[_0x19d3e6(0x1f8)],_0x19d3e6(0x18f),undefined,{'helpText':_0x19d3e6(0x16f)});return undefined;}async function resolveSegmentFromOptions(_0x973242,_0x19d28d){const _0x43caed=a21_0x38b3;if(!_0x973242[_0x43caed(0x15b)])return{};const _0x186a29=_0x973242[_0x43caed(0x15b)],_0x541c8d=await _0x19d28d['segment'][_0x43caed(0x1f6)](_0x186a29);return{'audienceId':_0x541c8d[_0x43caed(0x174)],'audienceName':_0x541c8d[_0x43caed(0x19c)],..._0x541c8d[_0x43caed(0x16b)]&&{'segmentId':_0x541c8d[_0x43caed(0x16b)],'segmentName':_0x541c8d[_0x43caed(0x1f7)]}};}function buildConnectorConfig(_0xc7b6c6){const _0x555855=a21_0x38b3,_0x25f721=_0xc7b6c6['emailSenderId'],_0x2bbdf5=_0xc7b6c6[_0x555855(0x15a)];if(!_0x25f721&&!_0x2bbdf5)return undefined;return{..._0x25f721&&{'emailSenderId':_0x25f721},..._0x2bbdf5&&{'jsonColumns':_0x2bbdf5}};}export class EngageCampaignsCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x175);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x17e);async[a21_0x14e766(0x1a7)](_0x5adbbe){const _0x3c54fd=a21_0x14e766,{options:_0x62c1f3,args:_0x4e50ee,tdx:_0x5b05de}=_0x5adbbe,_0x127d5b=_0x4e50ee[0x0],_0x576c17=resolveLimit(_0x62c1f3['limit'],DEFAULT_LLM_LIMIT),_0x43c1b5=_0x62c1f3,_0x4947d3=_0x43c1b5[_0x3c54fd(0x19b)],_0x3c6f7e=[_0x3c54fd(0x18c),'ACTIVE','PAUSED',_0x3c54fd(0x1b0)],_0x41972b=_0x43c1b5[_0x3c54fd(0x1dd)],_0x1da3dd=_0x41972b?.[_0x3c54fd(0x210)]();if(_0x1da3dd&&!_0x3c6f7e[_0x3c54fd(0x153)](_0x1da3dd))return console['error'](_0x3c54fd(0x1f5)+_0x41972b+_0x3c54fd(0x1d5)+_0x3c6f7e['join'](',\x20')),0x1;const _0xd2f86f=await resolveWorkspaceIdFromOptions(_0x43c1b5,_0x5b05de),_0x604248=await withSpinner(_0x3c54fd(0x1ed),()=>_0x5b05de['engage']['listCampaigns']({'type':_0x4947d3,'status':_0x1da3dd,'workspaceId':_0xd2f86f,'limit':_0x576c17}),{'verbose':_0x62c1f3[_0x3c54fd(0x1fd)]});let _0x2e52e2=_0x604248[_0x3c54fd(0x17c)];_0x1da3dd&&(_0x2e52e2=_0x2e52e2[_0x3c54fd(0x161)](_0xd5bc4d=>_0xd5bc4d[_0x3c54fd(0x1dd)][_0x3c54fd(0x210)]()===_0x1da3dd));_0x127d5b&&(_0x2e52e2=_0x2e52e2[_0x3c54fd(0x161)](_0x107c58=>matchGlobPattern(_0x107c58['name'],_0x127d5b)));const _0x512988=_0x62c1f3[_0x3c54fd(0x1ca)];if(isStructuredFormat(_0x62c1f3)){const _0x4f3eb2=_0x2e52e2[_0x3c54fd(0x15c)](_0x37b7f0=>({..._0x37b7f0,'url':_0x37b7f0['workspaceId']?getCampaignUrl(_0x512988,_0x37b7f0[_0x3c54fd(0x1c2)],_0x37b7f0['id']):undefined}));await handleSDKOutput(_0x4f3eb2,_0x62c1f3);}else for(const _0x3a9de8 of _0x2e52e2){const _0x8d45a5=a21_0x2edb79[_0x3c54fd(0x194)]('\x20('+_0x3a9de8['status'][_0x3c54fd(0x1cd)]()+')'),_0x1f3002=_0x3a9de8[_0x3c54fd(0x1c2)]?getCampaignUrl(_0x512988,_0x3a9de8[_0x3c54fd(0x1c2)],_0x3a9de8['id']):undefined,_0x4cd574=_0x1f3002?hyperlink(_0x3a9de8[_0x3c54fd(0x213)],_0x1f3002):_0x3a9de8[_0x3c54fd(0x213)];console['log'](_0x3c54fd(0x1b4)+_0x4cd574+_0x8d45a5);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']=a21_0x14e766(0x217);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x16c);async[a21_0x14e766(0x1a7)](_0x8b6c26){const _0x4c4e67=a21_0x14e766,{options:_0x397a9e,args:_0x509413,tdx:_0x50e73e}=_0x8b6c26;if(_0x509413[_0x4c4e67(0x215)]===0x0)return console[_0x4c4e67(0x15e)](_0x4c4e67(0x1ef)),console[_0x4c4e67(0x15e)](_0x4c4e67(0x205)),0x1;const _0x4fcf41=_0x509413[0x0],_0x2bc341=_0x397a9e,_0xa5f9fb=await resolveWorkspaceIdFromOptions(_0x2bc341,_0x50e73e),_0x2c71f5=_0x2bc341[_0x4c4e67(0x204)],_0x1f818e=_0x397a9e[_0x4c4e67(0x1ca)];if(_0x2c71f5){const _0x4e3a85=await withSpinner(_0x4c4e67(0x1ba)+_0x4fcf41+_0x4c4e67(0x1b2),()=>_0x50e73e[_0x4c4e67(0x1f2)]['getCampaignFull'](_0x4fcf41,_0xa5f9fb),{'verbose':_0x397a9e[_0x4c4e67(0x1fd)]}),_0x4f0ada=_0x4e3a85['data'],_0xa2cc0a=_0x4f0ada[_0x4c4e67(0x1e5)][_0x4c4e67(0x1c2)]?getCampaignUrl(_0x1f818e,_0x4f0ada[_0x4c4e67(0x1e5)][_0x4c4e67(0x1c2)],_0x4f0ada['id']):undefined;await handleSDKOutput([{..._0x4f0ada,..._0xa2cc0a&&{'url':_0xa2cc0a}}],_0x397a9e);}else{const _0x352640=await withSpinner(_0x4c4e67(0x1ba)+_0x4fcf41+_0x4c4e67(0x1b2),()=>_0x50e73e[_0x4c4e67(0x1f2)][_0x4c4e67(0x1b1)](_0x4fcf41,_0xa5f9fb),{'verbose':_0x397a9e[_0x4c4e67(0x1fd)]}),_0x4f2710=_0x352640[_0x4c4e67(0x17c)],_0x5416aa=_0x4f2710[_0x4c4e67(0x1c2)]?getCampaignUrl(_0x1f818e,_0x4f2710[_0x4c4e67(0x1c2)],_0x4f2710['id']):undefined;await handleSingleObjectOutput({..._0x4f2710,..._0x5416aa&&{'url':_0x5416aa}},_0x397a9e);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x178);['description']=a21_0x14e766(0x21a);async[a21_0x14e766(0x1a7)](_0x3560cf){const _0x1bf41b=a21_0x14e766,{options:_0x5f22b8,tdx:_0x14bc6e}=_0x3560cf,_0x4f062b=_0x5f22b8,_0x4755a0=_0x4f062b['name'],_0xa4b3f1=_0x4f062b[_0x1bf41b(0x19b)];if(!_0x4755a0)return console[_0x1bf41b(0x15e)](_0x1bf41b(0x203)),console['error'](_0x1bf41b(0x19a)),0x1;if(!_0xa4b3f1)return console['error'](_0x1bf41b(0x152)),console[_0x1bf41b(0x15e)](_0x1bf41b(0x19a)),0x1;const _0x3fecb6=await resolveWorkspaceIdFromOptions(_0x4f062b,_0x14bc6e,!![]),_0x577424=await resolveSegmentFromOptions(_0x4f062b,_0x14bc6e),_0x248545=buildConnectorConfig(_0x4f062b),_0x25b0b3={'name':_0x4755a0,'campaignType':_0xa4b3f1,'workspaceId':_0x3fecb6,'description':_0x4f062b['description'],..._0x577424,'connectorConfig':_0x248545,'startAt':_0x4f062b[_0x1bf41b(0x1c1)],'timezone':_0x4f062b[_0x1bf41b(0x1a9)]},_0x41f098=await withSpinner(_0x1bf41b(0x170)+_0x4755a0+_0x1bf41b(0x1b2),()=>_0x14bc6e['engage'][_0x1bf41b(0x166)](_0x25b0b3));return await handleSDKOutput([_0x41f098[_0x1bf41b(0x17c)]],_0x5f22b8),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']='engage:campaign:update';['description']='Update\x20a\x20campaign';async[a21_0x14e766(0x1a7)](_0x5c51d7){const _0x4e5da9=a21_0x14e766,{options:_0x1abf3e,args:_0x5408d4,tdx:_0x1689fb}=_0x5c51d7;if(_0x5408d4['length']===0x0)return console[_0x4e5da9(0x15e)](_0x4e5da9(0x1ef)),console[_0x4e5da9(0x15e)](_0x4e5da9(0x179)),0x1;const _0x515374=_0x5408d4[0x0],_0x4e29d1=_0x1abf3e,_0x58f1cb=await resolveWorkspaceIdFromOptions(_0x4e29d1,_0x1689fb),_0x558061=await resolveSegmentFromOptions(_0x4e29d1,_0x1689fb),_0x50a14f=buildConnectorConfig(_0x4e29d1),_0x36e159={'name':_0x4e29d1['name'],'description':_0x4e29d1['description'],..._0x558061,'connectorConfig':_0x50a14f,'startAt':_0x4e29d1[_0x4e5da9(0x1c1)],'timezone':_0x4e29d1['timezone']},_0xb4006a=Object['fromEntries'](Object[_0x4e5da9(0x1c9)](_0x36e159)['filter'](([,_0x10df39])=>_0x10df39!==undefined));if(Object['keys'](_0xb4006a)['length']===0x0)return console[_0x4e5da9(0x15e)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x4e5da9(0x15e)](_0x4e5da9(0x20e)),0x1;const _0x3e124a=await withSpinner(_0x4e5da9(0x1cc)+_0x515374+_0x4e5da9(0x1b2),()=>_0x1689fb[_0x4e5da9(0x1f2)][_0x4e5da9(0x1b9)](_0x515374,_0xb4006a,_0x58f1cb),{'verbose':_0x1abf3e[_0x4e5da9(0x1fd)]});return await handleSDKOutput([_0x3e124a[_0x4e5da9(0x17c)]],_0x1abf3e),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x192);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x15d);async[a21_0x14e766(0x1a7)](_0x3fd6e9){const _0x3d2566=a21_0x14e766,{options:_0x4cac07,args:_0x1f7fdd,tdx:_0x5c28bd}=_0x3fd6e9;if(_0x1f7fdd[_0x3d2566(0x215)]===0x0)return console[_0x3d2566(0x15e)](_0x3d2566(0x1ef)),console[_0x3d2566(0x15e)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x11c176=_0x1f7fdd[0x0],_0x354103=_0x4cac07,_0x4f154e=await resolveWorkspaceIdFromOptions(_0x354103,_0x5c28bd);if(!_0x4cac07[_0x3d2566(0x212)]){const _0x474ac9=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x11c176+_0x3d2566(0x1a4));if(!_0x474ac9)return console[_0x3d2566(0x1fc)](_0x3d2566(0x18e)),0x0;}return await withSpinner(_0x3d2566(0x1fa)+_0x11c176+_0x3d2566(0x1b2),()=>_0x5c28bd[_0x3d2566(0x1f2)][_0x3d2566(0x1bb)](_0x11c176,_0x4f154e),{'verbose':_0x4cac07[_0x3d2566(0x1fd)]}),console[_0x3d2566(0x1fc)](_0x3d2566(0x151)+_0x11c176+_0x3d2566(0x1a2)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x185);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x1c5);async[a21_0x14e766(0x1a7)](_0x16eb14){const _0x10147a=a21_0x14e766,{options:_0x167a52,args:_0x1638b9,tdx:_0x4c14a7}=_0x16eb14;if(_0x1638b9[_0x10147a(0x215)]===0x0)return console[_0x10147a(0x15e)](_0x10147a(0x1ef)),console['error'](_0x10147a(0x17a)),0x1;const _0x252f9a=_0x1638b9[0x0],_0x57e91a=_0x167a52,_0x35bda6=await resolveWorkspaceIdFromOptions(_0x57e91a,_0x4c14a7);return await withSpinner(_0x10147a(0x158)+_0x252f9a+_0x10147a(0x1b2),()=>_0x4c14a7[_0x10147a(0x1f2)]['launchCampaign'](_0x252f9a,_0x35bda6),{'verbose':_0x167a52[_0x10147a(0x1fd)]}),console[_0x10147a(0x1fc)](_0x10147a(0x151)+_0x252f9a+_0x10147a(0x214)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a21_0x14e766(0x1c8);[a21_0x14e766(0x1d8)]='Pause\x20a\x20campaign';async[a21_0x14e766(0x1a7)](_0x5b12e1){const _0x452796=a21_0x14e766,{options:_0x3a2f37,args:_0x2d7cd0,tdx:_0x3c382e}=_0x5b12e1;if(_0x2d7cd0[_0x452796(0x215)]===0x0)return console['error'](_0x452796(0x1ef)),console[_0x452796(0x15e)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x254823=_0x2d7cd0[0x0],_0x7d6191=_0x3a2f37,_0x3f9612=await resolveWorkspaceIdFromOptions(_0x7d6191,_0x3c382e);return await withSpinner(_0x452796(0x21f)+_0x254823+'\x27...',()=>_0x3c382e['engage'][_0x452796(0x1d4)](_0x254823,_0x3f9612),{'verbose':_0x3a2f37[_0x452796(0x1fd)]}),console[_0x452796(0x1fc)](_0x452796(0x151)+_0x254823+_0x452796(0x1c0)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a21_0x14e766(0x213)]='engage:campaign:resume';['description']='Resume\x20a\x20paused\x20campaign';async[a21_0x14e766(0x1a7)](_0x41b563){const _0x109178=a21_0x14e766,{options:_0x3bce87,args:_0x3417b4,tdx:_0x46e7ff}=_0x41b563;if(_0x3417b4['length']===0x0)return console[_0x109178(0x15e)](_0x109178(0x1ef)),console[_0x109178(0x15e)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x13975f=_0x3417b4[0x0],_0x3e3a54=_0x3bce87,_0x38d1df=await resolveWorkspaceIdFromOptions(_0x3e3a54,_0x46e7ff);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x13975f+_0x109178(0x1b2),()=>_0x46e7ff['engage']['resumeCampaign'](_0x13975f,_0x38d1df),{'verbose':_0x3bce87['verbose']}),console['log'](_0x109178(0x151)+_0x13975f+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a21_0x14e766(0x17f);['description']=a21_0x14e766(0x1c3);async[a21_0x14e766(0x1a7)](_0x4e648c){const _0x15f0b9=a21_0x14e766,{options:_0x11278a,args:_0x44d560,tdx:_0x4258d1}=_0x4e648c;if(_0x44d560['length']===0x0)return console['error'](_0x15f0b9(0x1ef)),console[_0x15f0b9(0x15e)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x229a87=_0x44d560[0x0],_0x538328=_0x11278a,_0x2e045a=await resolveWorkspaceIdFromOptions(_0x538328,_0x4258d1),_0x309e65=await withSpinner(_0x15f0b9(0x169)+_0x229a87+_0x15f0b9(0x1b2),()=>_0x4258d1[_0x15f0b9(0x1f2)]['duplicateCampaign'](_0x229a87,_0x2e045a),{'verbose':_0x11278a[_0x15f0b9(0x1fd)]});return await handleSDKOutput([_0x309e65['data']],_0x11278a),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x1ec);[a21_0x14e766(0x1d8)]='List\x20email\x20templates';async[a21_0x14e766(0x1a7)](_0x60d6ef){const _0xccdc2d=a21_0x14e766,{options:_0x224841,args:_0x28b6fa,tdx:_0x69ab1d}=_0x60d6ef,_0x5b0d39=_0x28b6fa[0x0],_0x5c54da=resolveLimit(_0x224841[_0xccdc2d(0x1ee)],DEFAULT_LLM_LIMIT),_0xdd3da2=_0x224841,_0x234571=await resolveWorkspaceIdFromOptions(_0xdd3da2,_0x69ab1d),_0x208e44=await withSpinner(_0xccdc2d(0x1d1),()=>_0x69ab1d[_0xccdc2d(0x1f2)]['listTemplates']({'workspaceId':_0x234571,'limit':_0x5c54da}),{'verbose':_0x224841[_0xccdc2d(0x1fd)]});let _0x2a3d32=_0x208e44[_0xccdc2d(0x17c)];_0x5b0d39&&(_0x2a3d32=_0x208e44[_0xccdc2d(0x17c)][_0xccdc2d(0x161)](_0x499169=>matchGlobPattern(_0x499169['name'],_0x5b0d39)));const _0x5c3939=_0x224841[_0xccdc2d(0x1ca)];if(isStructuredFormat(_0x224841))await handleSDKOutput(_0x2a3d32,_0x224841);else for(const _0x40871a of _0x2a3d32){const _0x466421=_0x40871a[_0xccdc2d(0x1c2)]?getTemplateUrl(_0x5c3939,_0x40871a[_0xccdc2d(0x1c2)],_0x40871a['id']):undefined,_0x4eabd3=_0x466421?hyperlink(_0x40871a[_0xccdc2d(0x213)],_0x466421):_0x40871a[_0xccdc2d(0x213)];console[_0xccdc2d(0x1fc)]('📝\x20'+_0x4eabd3);}return 0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x1d7);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x1ff);async['execute'](_0x158b04){const _0xf33c0f=a21_0x14e766,{options:_0x78185f,args:_0xd868de,tdx:_0xaf32d9}=_0x158b04;if(_0xd868de[_0xf33c0f(0x215)]===0x0)return console[_0xf33c0f(0x15e)](_0xf33c0f(0x1e9)),console[_0xf33c0f(0x15e)](_0xf33c0f(0x1aa)),0x1;const _0x3414d3=_0xd868de[0x0],_0x409f66=_0x78185f,_0x38572d=await resolveWorkspaceIdFromOptions(_0x409f66,_0xaf32d9),_0x306c34=_0x409f66['full'];if(_0x306c34){const _0x3684e9=await withSpinner('Fetching\x20template\x20\x27'+_0x3414d3+'\x27...',()=>_0xaf32d9[_0xf33c0f(0x1f2)][_0xf33c0f(0x180)](_0x3414d3,_0x38572d),{'verbose':_0x78185f[_0xf33c0f(0x1fd)]});await handleSDKOutput([_0x3684e9],_0x78185f);}else{const _0x5e27ca=await withSpinner(_0xf33c0f(0x1dc)+_0x3414d3+_0xf33c0f(0x1b2),()=>_0xaf32d9[_0xf33c0f(0x1f2)][_0xf33c0f(0x201)](_0x3414d3,_0x38572d),{'verbose':_0x78185f[_0xf33c0f(0x1fd)]});await handleSDKOutput([_0x5e27ca],_0x78185f);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']=a21_0x14e766(0x20d);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x218);async['execute'](_0x37c292){const _0xaff5a7=a21_0x14e766,{options:_0x18f6fe,tdx:_0x1bba19}=_0x37c292,_0x2a02aa=_0x18f6fe,_0x3a02be=_0x2a02aa[_0xaff5a7(0x213)],_0x4ca2a0=_0x2a02aa[_0xaff5a7(0x21d)],_0x26eebc=_0x2a02aa['html'],_0x3a8389=_0x2a02aa['htmlFile'];if(!_0x3a02be)return console[_0xaff5a7(0x15e)](_0xaff5a7(0x203)),console[_0xaff5a7(0x15e)](_0xaff5a7(0x16a)),0x1;if(!_0x4ca2a0)return console[_0xaff5a7(0x15e)](_0xaff5a7(0x199)),0x1;if(_0x26eebc&&_0x3a8389)return console[_0xaff5a7(0x15e)](_0xaff5a7(0x177)),0x1;const _0x3153b6=_0x3a8389?readFileContent(_0x3a8389):_0x26eebc;if(!_0x3153b6)return console[_0xaff5a7(0x15e)]('Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required'),0x1;const _0x5979b7=await resolveWorkspaceIdFromOptions(_0x2a02aa,_0x1bba19,!![]),_0x4b0e11={'name':_0x3a02be,'subjectTemplate':_0x4ca2a0,'htmlTemplate':_0x3153b6,'workspaceId':_0x5979b7,'plaintextTemplate':_0x2a02aa[_0xaff5a7(0x1a3)],'editorType':_0x2a02aa[_0xaff5a7(0x1e2)]??'grapesjs'},_0x146309=await withSpinner('Creating\x20template\x20\x27'+_0x3a02be+_0xaff5a7(0x1b2),()=>_0x1bba19[_0xaff5a7(0x1f2)]['createTemplate'](_0x4b0e11));return await handleSDKOutput([_0x146309[_0xaff5a7(0x17c)]],_0x18f6fe),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x1e8);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x202);async['execute'](_0x55ddcd){const _0x4fec03=a21_0x14e766,{options:_0x3a3606,args:_0x554a5b,tdx:_0x1afcfd}=_0x55ddcd;if(_0x554a5b[_0x4fec03(0x215)]===0x0)return console[_0x4fec03(0x15e)](_0x4fec03(0x1e9)),console[_0x4fec03(0x15e)](_0x4fec03(0x206)),0x1;const _0x27bd2d=_0x554a5b[0x0],_0x46040f=_0x3a3606,_0x5dfa8b=_0x46040f[_0x4fec03(0x168)],_0x3942dd=_0x46040f[_0x4fec03(0x1f1)];if(_0x5dfa8b&&_0x3942dd)return console[_0x4fec03(0x15e)](_0x4fec03(0x177)),0x1;const _0x44db73=_0x3942dd?readFileContent(_0x3942dd):_0x5dfa8b,_0x4ee961=await resolveWorkspaceIdFromOptions(_0x46040f,_0x1afcfd),_0x2d551a={'name':_0x46040f['name'],'subjectTemplate':_0x46040f['subject'],'htmlTemplate':_0x44db73,'plaintextTemplate':_0x46040f[_0x4fec03(0x1a3)]},_0x17d276=Object[_0x4fec03(0x15f)](Object[_0x4fec03(0x1c9)](_0x2d551a)[_0x4fec03(0x161)](([,_0x1c7cf7])=>_0x1c7cf7!==undefined));if(Object[_0x4fec03(0x19e)](_0x17d276)[_0x4fec03(0x215)]===0x0)return console[_0x4fec03(0x15e)](_0x4fec03(0x1da)),console[_0x4fec03(0x15e)](_0x4fec03(0x1f4)),0x1;const _0x486942=await withSpinner(_0x4fec03(0x159)+_0x27bd2d+_0x4fec03(0x1b2),()=>_0x1afcfd[_0x4fec03(0x1f2)][_0x4fec03(0x182)](_0x27bd2d,_0x17d276,_0x4ee961),{'verbose':_0x3a3606['verbose']});return await handleSDKOutput([_0x486942['data']],_0x3a3606),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a21_0x14e766(0x213)]='engage:template:delete';[a21_0x14e766(0x1d8)]=a21_0x14e766(0x20b);async[a21_0x14e766(0x1a7)](_0xa7e38){const _0xb2ed5f=a21_0x14e766,{options:_0x446acf,args:_0x2dd2c8,tdx:_0x348408}=_0xa7e38;if(_0x2dd2c8[_0xb2ed5f(0x215)]===0x0)return console[_0xb2ed5f(0x15e)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0xb2ed5f(0x15e)](_0xb2ed5f(0x184)),0x1;const _0x4f25a2=_0x2dd2c8[0x0],_0x1e8670=_0x446acf,_0x1e277b=await resolveWorkspaceIdFromOptions(_0x1e8670,_0x348408);if(!_0x446acf['yes']){const _0x3bf400=await confirm(_0xb2ed5f(0x1ae)+_0x4f25a2+_0xb2ed5f(0x1a4));if(!_0x3bf400)return console['log'](_0xb2ed5f(0x18e)),0x0;}return await withSpinner(_0xb2ed5f(0x1e7)+_0x4f25a2+_0xb2ed5f(0x1b2),()=>_0x348408[_0xb2ed5f(0x1f2)][_0xb2ed5f(0x189)](_0x4f25a2,_0x1e277b),{'verbose':_0x446acf[_0xb2ed5f(0x1fd)]}),console['log']('Template\x20\x27'+_0x4f25a2+_0xb2ed5f(0x1a2)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a21_0x14e766(0x213)]='engage:workspaces';[a21_0x14e766(0x1d8)]=a21_0x14e766(0x1a1);async[a21_0x14e766(0x1a7)](_0x53b678){const _0x2b2f59=a21_0x14e766,{options:_0x59cb88,args:_0x9ce84b,tdx:_0x4edd44}=_0x53b678,_0x14b213=_0x9ce84b[0x0],_0x3f18ec=resolveLimit(_0x59cb88[_0x2b2f59(0x1ee)],DEFAULT_LLM_LIMIT),_0x2d0d20=await withSpinner(_0x2b2f59(0x1a5),()=>_0x4edd44[_0x2b2f59(0x1f2)][_0x2b2f59(0x1df)]({'limit':_0x3f18ec}),{'verbose':_0x59cb88[_0x2b2f59(0x1fd)]});let _0x46586f=_0x2d0d20[_0x2b2f59(0x17c)];_0x14b213&&(_0x46586f=_0x2d0d20['data'][_0x2b2f59(0x161)](_0x465623=>matchGlobPattern(_0x465623[_0x2b2f59(0x213)],_0x14b213)));const _0x39d4c6=_0x59cb88[_0x2b2f59(0x1ca)];if(isStructuredFormat(_0x59cb88))await handleSDKOutput(_0x46586f,_0x59cb88);else for(const _0x45850b of _0x46586f){const _0x3a0134=getWorkspaceUrl(_0x39d4c6,_0x45850b['id']),_0xd1e8f4=hyperlink(_0x45850b[_0x2b2f59(0x213)],_0x3a0134);console[_0x2b2f59(0x1fc)](_0x2b2f59(0x18b)+_0xd1e8f4);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x1cf);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x20c);async[a21_0x14e766(0x1a7)](_0x3c4b6d){const _0x115701=a21_0x14e766,{options:_0x1d626b,args:_0x212d2f,tdx:_0x5a06d1}=_0x3c4b6d;if(_0x212d2f[_0x115701(0x215)]===0x0)return console[_0x115701(0x15e)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x115701(0x15e)](_0x115701(0x156)),0x1;const _0x35fecf=_0x212d2f[0x0],_0x21df0a=_0x1d626b,_0x4e4c9f=_0x21df0a[_0x115701(0x204)];if(_0x4e4c9f){const _0x3b6f9f=await withSpinner('Fetching\x20workspace\x20\x27'+_0x35fecf+_0x115701(0x1b2),()=>_0x5a06d1['engage'][_0x115701(0x1ab)](_0x35fecf),{'verbose':_0x1d626b[_0x115701(0x1fd)]});await handleSDKOutput([_0x3b6f9f],_0x1d626b);}else{const _0x564d62=await withSpinner(_0x115701(0x1b7)+_0x35fecf+_0x115701(0x1b2),()=>_0x5a06d1['engage'][_0x115701(0x17b)](_0x35fecf),{'verbose':_0x1d626b[_0x115701(0x1fd)]});await handleSDKOutput([_0x564d62],_0x1d626b);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x1d2);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x163);async[a21_0x14e766(0x1a7)](_0x4791cf){const _0x93706b=a21_0x14e766,{options:_0x26bacc,tdx:_0x46a322}=_0x4791cf,_0x262278=_0x26bacc,_0x2be463=_0x262278['name'];if(!_0x2be463)return console[_0x93706b(0x15e)](_0x93706b(0x203)),console[_0x93706b(0x15e)](_0x93706b(0x207)),0x1;const _0x3aca95={'name':_0x2be463,'description':_0x262278['description']},_0x2c0e61=await withSpinner(_0x93706b(0x14d)+_0x2be463+_0x93706b(0x1b2),()=>_0x46a322[_0x93706b(0x1f2)]['createWorkspace'](_0x3aca95));return await handleSDKOutput([_0x2c0e61[_0x93706b(0x17c)]],_0x26bacc),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a21_0x14e766(0x213)]='engage:workspace:update';[a21_0x14e766(0x1d8)]='Update\x20a\x20workspace';async['execute'](_0x111a28){const _0x2ac1ab=a21_0x14e766,{options:_0xdf8d22,args:_0x31f5ef,tdx:_0x2e8c9e}=_0x111a28;if(_0x31f5ef[_0x2ac1ab(0x215)]===0x0)return console['error'](_0x2ac1ab(0x173)),console[_0x2ac1ab(0x15e)](_0x2ac1ab(0x19f)),0x1;const _0x1e860a=_0x31f5ef[0x0],_0x2b19a7=_0xdf8d22,_0x484875={'name':_0x2b19a7['name'],'description':_0x2b19a7['description']},_0x361cc5=Object[_0x2ac1ab(0x15f)](Object[_0x2ac1ab(0x1c9)](_0x484875)[_0x2ac1ab(0x161)](([,_0x298321])=>_0x298321!==undefined));if(Object[_0x2ac1ab(0x19e)](_0x361cc5)[_0x2ac1ab(0x215)]===0x0)return console[_0x2ac1ab(0x15e)](_0x2ac1ab(0x1da)),console[_0x2ac1ab(0x15e)](_0x2ac1ab(0x1e1)),0x1;const _0x157978=await withSpinner(_0x2ac1ab(0x183)+_0x1e860a+_0x2ac1ab(0x1b2),()=>_0x2e8c9e[_0x2ac1ab(0x1f2)][_0x2ac1ab(0x1b8)](_0x1e860a,_0x361cc5),{'verbose':_0xdf8d22[_0x2ac1ab(0x1fd)]});return await handleSDKOutput([_0x157978['data']],_0xdf8d22),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x1fe);[a21_0x14e766(0x1d8)]='Delete\x20a\x20workspace';async['execute'](_0xa3311){const _0x4784d7=a21_0x14e766,{options:_0x648a4b,args:_0x976858,tdx:_0x413737}=_0xa3311;if(_0x976858[_0x4784d7(0x215)]===0x0)return console[_0x4784d7(0x15e)](_0x4784d7(0x173)),console[_0x4784d7(0x15e)](_0x4784d7(0x1bc)),0x1;const _0x37c582=_0x976858[0x0];if(!_0x648a4b[_0x4784d7(0x212)]){const _0x3c5298=await confirm(_0x4784d7(0x196)+_0x37c582+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x3c5298)return console['log'](_0x4784d7(0x18e)),0x0;}return await withSpinner(_0x4784d7(0x17d)+_0x37c582+_0x4784d7(0x1b2),()=>_0x413737['engage']['deleteWorkspace'](_0x37c582),{'verbose':_0x648a4b['verbose']}),console[_0x4784d7(0x1fc)](_0x4784d7(0x1b3)+_0x37c582+_0x4784d7(0x1a2)),0x0;}}function a21_0x3b34(){const _0x279f00=['Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>','engage:always-on-campaign:finish','108RwNPum','\x27\x20paused\x20successfully','startAt','workspaceId','Duplicate\x20a\x20campaign','Always-on\x20campaign\x20\x27','Launch\x20a\x20campaign','LIVE','\x27\x20resumed\x20successfully','engage:campaign:pause','entries','site','createAlwaysOnCampaign','Updating\x20campaign\x20\x27','toLowerCase','Finishing\x20always-on\x20campaign\x20\x27','engage:workspace:show','23015IDFjoU','Fetching\x20templates...','engage:workspace:create','Launching\x20always-on\x20campaign\x20\x27','pauseCampaign','\x22.\x20Valid\x20values:\x20','FINISHED','engage:template:show','description','Finish\x20an\x20always-on\x20campaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','enableUtmTracking','Fetching\x20template\x20\x27','status','duplicateAlwaysOnCampaign','listWorkspaces','Launch\x20an\x20always-on\x20campaign','Options:\x20--name,\x20--description','editorType','Pause\x20an\x20always-on\x20campaign','Deleting\x20always-on\x20campaign\x20\x27','attributes','Resuming\x20always-on\x20campaign\x20\x27','Deleting\x20template\x20\x27','engage:template:update','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','engage:always-on-campaign:create','37616dMKTgR','engage:templates','Fetching\x20campaigns...','limit','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Creating\x20always-on\x20campaign\x20\x27','htmlFile','engage','deleteAlwaysOnCampaign','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','Error:\x20Invalid\x20status\x20\x22','resolvePathToResource','segmentName','MISSING_ARGUMENT','12545888BXCRgr','Deleting\x20campaign\x20\x27','1410GjxKew','log','verbose','engage:workspace:delete','Show\x20email\x20template\x20details','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','getTemplate','Update\x20an\x20email\x20template','Error:\x20--name\x20is\x20required','full','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Resume\x20a\x20paused\x20always-on\x20campaign','List\x20always-on\x20campaigns','743110fCdGvR','Delete\x20an\x20email\x20template','Show\x20workspace\x20details','engage:template:create','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','getAlwaysOnCampaignFull','toUpperCase','Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','yes','name','\x27\x20launched\x20successfully','length','engage:always-on-campaign:show','engage:campaign:show','Create\x20an\x20email\x20template','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Create\x20a\x20new\x20campaign','Verifying\x20workspace\x20\x27','Create\x20a\x20new\x20always-on\x20campaign','subject','getAlwaysOnCampaign','Pausing\x20campaign\x20\x27','Update\x20an\x20always-on\x20campaign','Creating\x20workspace\x20\x27','Fetching\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','engage:always-on-campaign:duplicate','Campaign\x20\x27','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','includes','Pausing\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','\x27\x20finished\x20successfully','Launching\x20campaign\x20\x27','Updating\x20template\x20\x27','jsonColumns','segment','map','Delete\x20a\x20campaign','error','fromEntries','33486618TEVqJi','filter','finishAlwaysOnCampaign','Create\x20a\x20workspace','updateAlwaysOnCampaign','Set\x20workspace\x20context\x20for\x20Engage\x20commands','createCampaign','Duplicating\x20always-on\x20campaign\x20\x27','html','Duplicating\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','segmentId','Show\x20campaign\x20details','Fetching\x20always-on\x20campaigns...','82piLQYm','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Creating\x20campaign\x20\x27','audienceId','join','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','parentId','engage:campaigns','1079475UGyolD','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','engage:campaign:create','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','getWorkspace','data','Deleting\x20workspace\x20\x27','List\x20campaigns','engage:campaign:duplicate','getTemplateFull','engage:always-on-campaign:delete','updateTemplate','Updating\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','engage:campaign:launch','engage:always-on-campaign:resume','Show\x20always-on\x20campaign\x20details','engage_workspace','deleteTemplate','engage:always-on-campaign:pause','🏢\x20','DRAFT','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27','Operation\x20cancelled','Workspace\x20is\x20required\x20for\x20this\x20operation','resumeAlwaysOnCampaign','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','engage:campaign:delete','session','dim','workspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Engage\x20workspace\x20set\x20to:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27','Error:\x20--subject\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','type','parentName','engage:always-on-campaign:update','keys','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','resolveWorkspaceId','List\x20workspaces','\x27\x20deleted\x20successfully','plaintext','\x27?\x20This\x20cannot\x20be\x20undone.','Fetching\x20workspaces...','1679504dVWvht','execute','Duplicate\x20an\x20always-on\x20campaign','timezone','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','getWorkspaceFull','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','audienceName','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','launchAlwaysOnCampaign','COMPLETED','getCampaign','\x27...','Workspace\x20\x27','📧\x20','engage:workspace:use','7OmRDcH','Fetching\x20workspace\x20\x27','updateWorkspace','updateCampaign','Fetching\x20campaign\x20\x27','deleteCampaign','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'];a21_0x3b34=function(){return _0x279f00;};return a21_0x3b34();}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{['name']='engage:always-on-campaigns';['description']=a21_0x14e766(0x209);async[a21_0x14e766(0x1a7)](_0x5352f1){const _0x18ece0=a21_0x14e766,{options:_0x8d060d,args:_0x1ed0d9,tdx:_0x5e52c8}=_0x5352f1,_0x1a6b9e=_0x1ed0d9[0x0],_0x3d423b=resolveLimit(_0x8d060d[_0x18ece0(0x1ee)],DEFAULT_LLM_LIMIT),_0x3736f8=_0x8d060d,_0x53b29f=_0x3736f8[_0x18ece0(0x19b)],_0x5ed564=[_0x18ece0(0x18c),_0x18ece0(0x1c6),'PAUSED',_0x18ece0(0x1d6)],_0x2658a3=_0x3736f8['status'],_0x61811=_0x2658a3?.[_0x18ece0(0x210)]();if(_0x61811&&!_0x5ed564[_0x18ece0(0x153)](_0x61811))return console[_0x18ece0(0x15e)](_0x18ece0(0x1f5)+_0x2658a3+_0x18ece0(0x1d5)+_0x5ed564[_0x18ece0(0x172)](',\x20')),0x1;const _0x27b79e=await resolveWorkspaceIdFromOptions(_0x3736f8,_0x5e52c8,!![]),_0x1184fb=await withSpinner(_0x18ece0(0x16d),()=>_0x5e52c8[_0x18ece0(0x1f2)]['listAlwaysOnCampaigns']({'workspaceId':_0x27b79e,'type':_0x53b29f,'status':_0x61811,'limit':_0x3d423b}),{'verbose':_0x8d060d[_0x18ece0(0x1fd)]});let _0x103d5e=_0x1184fb['data'];_0x61811&&(_0x103d5e=_0x103d5e['filter'](_0x19c785=>_0x19c785[_0x18ece0(0x1dd)][_0x18ece0(0x210)]()===_0x61811));_0x1a6b9e&&(_0x103d5e=_0x103d5e[_0x18ece0(0x161)](_0x5a6177=>matchGlobPattern(_0x5a6177[_0x18ece0(0x213)],_0x1a6b9e)));const _0x3627ab=_0x8d060d[_0x18ece0(0x1ca)];if(isStructuredFormat(_0x8d060d)){const _0x17bb88=_0x103d5e[_0x18ece0(0x15c)](_0x217eb8=>({..._0x217eb8,'url':getCampaignUrl(_0x3627ab,_0x217eb8[_0x18ece0(0x1c2)],_0x217eb8['id'])}));await handleSDKOutput(_0x17bb88,_0x8d060d);}else for(const _0x5f58d1 of _0x103d5e){const _0x2ef4eb=a21_0x2edb79[_0x18ece0(0x194)]('\x20('+_0x5f58d1[_0x18ece0(0x1dd)][_0x18ece0(0x1cd)]()+')'),_0x492207=getCampaignUrl(_0x3627ab,_0x5f58d1[_0x18ece0(0x1c2)],_0x5f58d1['id']),_0x428be0=hyperlink(_0x5f58d1[_0x18ece0(0x213)],_0x492207);console[_0x18ece0(0x1fc)](_0x18ece0(0x1b4)+_0x428be0+_0x2ef4eb);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x216);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x187);async['execute'](_0x3aad82){const _0x1c1601=a21_0x14e766,{options:_0x2db9b4,args:_0x17a02c,tdx:_0x3972a5}=_0x3aad82;if(_0x17a02c[_0x1c1601(0x215)]===0x0)return console[_0x1c1601(0x15e)](_0x1c1601(0x1ef)),console[_0x1c1601(0x15e)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>'),0x1;const _0x49e255=_0x17a02c[0x0],_0x8ad0e6=_0x2db9b4,_0x57394a=await resolveWorkspaceIdFromOptions(_0x8ad0e6,_0x3972a5,!![]),_0x1eec58=_0x8ad0e6[_0x1c1601(0x204)],_0x41ea92=_0x2db9b4['site'];if(_0x1eec58){const _0x5c170f=await withSpinner('Fetching\x20always-on\x20campaign\x20\x27'+_0x49e255+_0x1c1601(0x1b2),()=>_0x3972a5['engage'][_0x1c1601(0x20f)](_0x57394a,_0x49e255),{'verbose':_0x2db9b4['verbose']}),_0x1ff75c=_0x5c170f['data'],_0x346540=getCampaignUrl(_0x41ea92,_0x1ff75c[_0x1c1601(0x1e5)][_0x1c1601(0x1c2)],_0x1ff75c['id']);await handleSDKOutput([{..._0x1ff75c,'url':_0x346540}],_0x2db9b4);}else{const _0x141b1d=await withSpinner(_0x1c1601(0x14e)+_0x49e255+_0x1c1601(0x1b2),()=>_0x3972a5[_0x1c1601(0x1f2)][_0x1c1601(0x21e)](_0x57394a,_0x49e255),{'verbose':_0x2db9b4['verbose']}),_0x5cc740=_0x141b1d['data'],_0x8e610e=getCampaignUrl(_0x41ea92,_0x5cc740[_0x1c1601(0x1c2)],_0x5cc740['id']);await handleSingleObjectOutput({..._0x5cc740,'url':_0x8e610e},_0x2db9b4);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{['name']=a21_0x14e766(0x1ea);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x21c);async['execute'](_0x388931){const _0x5d266e=a21_0x14e766,{options:_0x58ebe3,tdx:_0x1f0375}=_0x388931,_0x4615ea=_0x58ebe3,_0x12e8a8=_0x4615ea[_0x5d266e(0x213)],_0x50a6f3=_0x4615ea[_0x5d266e(0x19b)];if(!_0x12e8a8)return console[_0x5d266e(0x15e)](_0x5d266e(0x203)),console[_0x5d266e(0x15e)](_0x5d266e(0x1ac)),0x1;if(!_0x50a6f3)return console[_0x5d266e(0x15e)](_0x5d266e(0x152)),console[_0x5d266e(0x15e)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x515060=await resolveWorkspaceIdFromOptions(_0x4615ea,_0x1f0375,!![]),_0x2c5c84=await resolveSegmentFromOptions(_0x4615ea,_0x1f0375),_0x2109af={'name':_0x12e8a8,'campaignType':_0x50a6f3,'workspaceId':_0x515060,'description':_0x4615ea['description'],'audienceId':_0x2c5c84[_0x5d266e(0x171)],'audienceName':_0x2c5c84[_0x5d266e(0x1ad)],'enableUtmTracking':_0x4615ea[_0x5d266e(0x1db)]},_0x4f0e3a=await withSpinner(_0x5d266e(0x1f0)+_0x12e8a8+'\x27...',()=>_0x1f0375[_0x5d266e(0x1f2)][_0x5d266e(0x1cb)](_0x515060,_0x2109af));return await handleSDKOutput([_0x4f0e3a[_0x5d266e(0x17c)]],_0x58ebe3),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x19d);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x220);async[a21_0x14e766(0x1a7)](_0x6ea602){const _0x515e05=a21_0x14e766,{options:_0x3905a4,args:_0x15697b,tdx:_0x313d73}=_0x6ea602;if(_0x15697b[_0x515e05(0x215)]===0x0)return console[_0x515e05(0x15e)](_0x515e05(0x1ef)),console['error'](_0x515e05(0x211)),0x1;const _0x5ee800=_0x15697b[0x0],_0x2f66c6=_0x3905a4,_0x37c967=await resolveWorkspaceIdFromOptions(_0x2f66c6,_0x313d73,!![]),_0x344ff4=await resolveSegmentFromOptions(_0x2f66c6,_0x313d73),_0x205005={'name':_0x2f66c6[_0x515e05(0x213)],'description':_0x2f66c6[_0x515e05(0x1d8)],'audienceId':_0x344ff4[_0x515e05(0x171)],'audienceName':_0x344ff4[_0x515e05(0x1ad)],'enableUtmTracking':_0x2f66c6[_0x515e05(0x1db)]},_0x1525a9=Object['fromEntries'](Object[_0x515e05(0x1c9)](_0x205005)[_0x515e05(0x161)](([,_0x5e0899])=>_0x5e0899!==undefined));if(Object[_0x515e05(0x19e)](_0x1525a9)[_0x515e05(0x215)]===0x0)return console[_0x515e05(0x15e)](_0x515e05(0x1da)),console[_0x515e05(0x15e)](_0x515e05(0x191)),0x1;const _0x24f870=await withSpinner('Updating\x20always-on\x20campaign\x20\x27'+_0x5ee800+_0x515e05(0x1b2),()=>_0x313d73['engage'][_0x515e05(0x164)](_0x37c967,_0x5ee800,_0x1525a9),{'verbose':_0x3905a4['verbose']});return await handleSDKOutput([_0x24f870[_0x515e05(0x17c)]],_0x3905a4),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x181);[a21_0x14e766(0x1d8)]='Delete\x20an\x20always-on\x20campaign';async[a21_0x14e766(0x1a7)](_0x1be6a8){const _0xc5030c=a21_0x14e766,{options:_0x3005da,args:_0xe3a334,tdx:_0xa28d11}=_0x1be6a8;if(_0xe3a334['length']===0x0)return console[_0xc5030c(0x15e)](_0xc5030c(0x1ef)),console[_0xc5030c(0x15e)](_0xc5030c(0x1bd)),0x1;const _0x1afee3=_0xe3a334[0x0],_0x5336fd=_0x3005da,_0x207199=await resolveWorkspaceIdFromOptions(_0x5336fd,_0xa28d11,!![]);if(!_0x3005da['yes']){const _0x497e43=await confirm(_0xc5030c(0x18d)+_0x1afee3+_0xc5030c(0x1a4));if(!_0x497e43)return console['log'](_0xc5030c(0x18e)),0x0;}return await withSpinner(_0xc5030c(0x1e4)+_0x1afee3+_0xc5030c(0x1b2),()=>_0xa28d11[_0xc5030c(0x1f2)][_0xc5030c(0x1f3)](_0x207199,_0x1afee3),{'verbose':_0x3005da[_0xc5030c(0x1fd)]}),console[_0xc5030c(0x1fc)](_0xc5030c(0x1c4)+_0x1afee3+_0xc5030c(0x1a2)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{['name']='engage:always-on-campaign:launch';['description']=a21_0x14e766(0x1e0);async['execute'](_0x2a92e9){const _0x1ca75e=a21_0x14e766,{options:_0x59f811,args:_0x466677,tdx:_0x12f691}=_0x2a92e9;if(_0x466677[_0x1ca75e(0x215)]===0x0)return console[_0x1ca75e(0x15e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x1ca75e(0x15e)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>'),0x1;const _0x25b94f=_0x466677[0x0],_0x2eb0af=_0x59f811,_0x3fe896=await resolveWorkspaceIdFromOptions(_0x2eb0af,_0x12f691,!![]);return await withSpinner(_0x1ca75e(0x1d3)+_0x25b94f+_0x1ca75e(0x1b2),()=>_0x12f691[_0x1ca75e(0x1f2)][_0x1ca75e(0x1af)](_0x3fe896,_0x25b94f),{'verbose':_0x59f811['verbose']}),console[_0x1ca75e(0x1fc)]('Always-on\x20campaign\x20\x27'+_0x25b94f+_0x1ca75e(0x214)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x18a);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x1e3);async[a21_0x14e766(0x1a7)](_0x5478f9){const _0x44afa6=a21_0x14e766,{options:_0xe9383,args:_0x5a0a21,tdx:_0x54fd29}=_0x5478f9;if(_0x5a0a21[_0x44afa6(0x215)]===0x0)return console[_0x44afa6(0x15e)](_0x44afa6(0x1ef)),console[_0x44afa6(0x15e)](_0x44afa6(0x155)),0x1;const _0x140a27=_0x5a0a21[0x0],_0x4df22f=_0xe9383,_0x116b16=await resolveWorkspaceIdFromOptions(_0x4df22f,_0x54fd29,!![]);return await withSpinner(_0x44afa6(0x154)+_0x140a27+'\x27...',()=>_0x54fd29[_0x44afa6(0x1f2)]['pauseAlwaysOnCampaign'](_0x116b16,_0x140a27),{'verbose':_0xe9383[_0x44afa6(0x1fd)]}),console[_0x44afa6(0x1fc)](_0x44afa6(0x1c4)+_0x140a27+_0x44afa6(0x1c0)),0x0;}}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x186);['description']=a21_0x14e766(0x208);async[a21_0x14e766(0x1a7)](_0x15c46a){const _0x2c7135=a21_0x14e766,{options:_0x1c3071,args:_0xe1f3f6,tdx:_0x4a37c2}=_0x15c46a;if(_0xe1f3f6['length']===0x0)return console[_0x2c7135(0x15e)](_0x2c7135(0x1ef)),console[_0x2c7135(0x15e)](_0x2c7135(0x14f)),0x1;const _0x1d43b5=_0xe1f3f6[0x0],_0x100b32=_0x1c3071,_0x5f3512=await resolveWorkspaceIdFromOptions(_0x100b32,_0x4a37c2,!![]);return await withSpinner(_0x2c7135(0x1e6)+_0x1d43b5+_0x2c7135(0x1b2),()=>_0x4a37c2['engage'][_0x2c7135(0x190)](_0x5f3512,_0x1d43b5),{'verbose':_0x1c3071['verbose']}),console[_0x2c7135(0x1fc)]('Always-on\x20campaign\x20\x27'+_0x1d43b5+_0x2c7135(0x1c7)),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{['name']=a21_0x14e766(0x1be);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x1d9);async[a21_0x14e766(0x1a7)](_0x4ecbce){const _0x529935=a21_0x14e766,{options:_0x4215f9,args:_0x359309,tdx:_0x49fff1}=_0x4ecbce;if(_0x359309[_0x529935(0x215)]===0x0)return console[_0x529935(0x15e)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>'),0x1;const _0x552725=_0x359309[0x0],_0x121875=_0x4215f9,_0x4700f1=await resolveWorkspaceIdFromOptions(_0x121875,_0x49fff1,!![]);if(!_0x4215f9[_0x529935(0x212)]){const _0x28762d=await confirm(_0x529935(0x198)+_0x552725+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x28762d)return console[_0x529935(0x1fc)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x529935(0x1ce)+_0x552725+_0x529935(0x1b2),()=>_0x49fff1['engage'][_0x529935(0x162)](_0x4700f1,_0x552725),{'verbose':_0x4215f9[_0x529935(0x1fd)]}),console[_0x529935(0x1fc)](_0x529935(0x1c4)+_0x552725+_0x529935(0x157)),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a21_0x14e766(0x213)]=a21_0x14e766(0x150);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x1a8);async[a21_0x14e766(0x1a7)](_0x433cd5){const _0x2eff60=a21_0x14e766,{options:_0x1e574c,args:_0xe5701b,tdx:_0x3b134a}=_0x433cd5;if(_0xe5701b['length']===0x0)return console['error'](_0x2eff60(0x1ef)),console[_0x2eff60(0x15e)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]'),0x1;const _0xf4a9df=_0xe5701b[0x0],_0x1a0139=_0x1e574c,_0x1cde0a=await resolveWorkspaceIdFromOptions(_0x1a0139,_0x3b134a,!![]),_0x5f4964=_0x1a0139['name'],_0x4ae0a5=await withSpinner(_0x2eff60(0x167)+_0xf4a9df+'\x27...',()=>_0x3b134a[_0x2eff60(0x1f2)][_0x2eff60(0x1de)](_0x1cde0a,_0xf4a9df,_0x5f4964),{'verbose':_0x1e574c[_0x2eff60(0x1fd)]});return await handleSDKOutput([_0x4ae0a5[_0x2eff60(0x17c)]],_0x1e574c),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a21_0x14e766(0x1b5);[a21_0x14e766(0x1d8)]=a21_0x14e766(0x165);async[a21_0x14e766(0x1a7)](_0x47de2f){const _0x1cc629=a21_0x14e766,{options:_0xce5539,args:_0x3d595a,tdx:_0x2bd573}=_0x47de2f;if(_0x3d595a[_0x1cc629(0x215)]===0x0)return console[_0x1cc629(0x15e)]('Error:\x20Workspace\x20name\x20is\x20required'),console[_0x1cc629(0x15e)](_0x1cc629(0x200)),0x1;const _0x216845=_0x3d595a[0x0];await withSpinner(_0x1cc629(0x21b)+_0x216845+_0x1cc629(0x1b2),()=>_0x2bd573[_0x1cc629(0x1f2)][_0x1cc629(0x1a0)](_0x216845));const _0x2ec2d9=_0xce5539[_0x1cc629(0x193)]||undefined;return saveSessionContext({'engage_workspace':_0x216845},_0x2ec2d9),console[_0x1cc629(0x1fc)](_0x1cc629(0x197)+_0x216845),console['log'](_0x1cc629(0x219)),0x0;}}
|
|
1
|
+
const a21_0x1786d2=a21_0x472b;(function(_0x47b02b,_0x59dd03){const _0x287a2f=a21_0x472b,_0x4a2c25=_0x47b02b();while(!![]){try{const _0x639e1e=parseInt(_0x287a2f(0x152))/0x1+-parseInt(_0x287a2f(0xc1))/0x2*(parseInt(_0x287a2f(0xf0))/0x3)+parseInt(_0x287a2f(0x12a))/0x4+parseInt(_0x287a2f(0x91))/0x5*(parseInt(_0x287a2f(0xc9))/0x6)+-parseInt(_0x287a2f(0x9f))/0x7+-parseInt(_0x287a2f(0x129))/0x8+-parseInt(_0x287a2f(0xed))/0x9*(parseInt(_0x287a2f(0xef))/0xa);if(_0x639e1e===_0x59dd03)break;else _0x4a2c25['push'](_0x4a2c25['shift']());}catch(_0x5e0bf7){_0x4a2c25['push'](_0x4a2c25['shift']());}}}(a21_0x242b,0x2b03d));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl,getTemplateUrl,getWorkspaceUrl}from'../sdk/client/endpoints.js';import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a21_0x46c0be from'chalk';export async function resolveWorkspaceIdFromOptions(_0x3ee583,_0x49edaa,_0x57ff13=![]){const _0x5f3013=a21_0x472b;if(_0x3ee583[_0x5f3013(0xd7)])return await _0x49edaa[_0x5f3013(0x14e)][_0x5f3013(0xb3)](_0x3ee583['workspace']);const _0x17c66d=loadSessionContext(_0x3ee583[_0x5f3013(0x157)]);if(_0x17c66d?.['engage_workspace'])return await _0x49edaa[_0x5f3013(0x14e)][_0x5f3013(0xb3)](_0x17c66d[_0x5f3013(0xb0)]);if(_0x57ff13)throw new SDKError(ErrorCode[_0x5f3013(0x109)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':_0x5f3013(0xec)});return undefined;}async function resolveSegmentFromOptions(_0x1fdac9,_0x3c3f4f){const _0x141888=a21_0x472b;if(!_0x1fdac9[_0x141888(0x10c)])return{};const _0x3e6ff2=_0x1fdac9[_0x141888(0x10c)],_0x514323=await _0x3c3f4f['segment']['resolvePathToResource'](_0x3e6ff2);return{'audienceId':_0x514323[_0x141888(0x10d)],'audienceName':_0x514323[_0x141888(0x14c)],..._0x514323[_0x141888(0xa0)]&&{'segmentId':_0x514323[_0x141888(0xa0)],'segmentName':_0x514323[_0x141888(0xa7)]}};}function buildConnectorConfig(_0x547029){const _0x3c6021=a21_0x472b,_0x35a660=_0x547029[_0x3c6021(0xeb)],_0x49e2a8=_0x547029[_0x3c6021(0xe4)];if(!_0x35a660&&!_0x49e2a8)return undefined;return{..._0x35a660&&{'emailSenderId':_0x35a660},..._0x49e2a8&&{'jsonColumns':_0x49e2a8}};}export class EngageCampaignsCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x98);['description']=a21_0x1786d2(0x123);async['execute'](_0x3d33a2){const _0x27ff42=a21_0x1786d2,{options:_0x5c99eb,args:_0x3d6d84,tdx:_0x4639c8}=_0x3d33a2,_0x212d2b=_0x3d6d84[0x0],_0x355f80=resolveLimit(_0x5c99eb[_0x27ff42(0x137)],DEFAULT_LLM_LIMIT),_0x102f91=_0x5c99eb,_0x30f4da=_0x102f91['type'],_0x44f998=[_0x27ff42(0xc7),_0x27ff42(0xe3),_0x27ff42(0x124),_0x27ff42(0x108)],_0x3cb138=_0x102f91[_0x27ff42(0x118)],_0x21ad7e=_0x3cb138?.['toUpperCase']();if(_0x21ad7e&&!_0x44f998[_0x27ff42(0x12f)](_0x21ad7e))return console[_0x27ff42(0xb5)](_0x27ff42(0x13f)+_0x3cb138+_0x27ff42(0x9d)+_0x44f998[_0x27ff42(0xe6)](',\x20')),0x1;const _0x295239=await resolveWorkspaceIdFromOptions(_0x102f91,_0x4639c8),_0xa45a78=await withSpinner(_0x27ff42(0xbf),()=>_0x4639c8['engage'][_0x27ff42(0x114)]({'type':_0x30f4da,'status':_0x21ad7e,'workspaceId':_0x295239,'limit':_0x355f80}),{'verbose':_0x5c99eb[_0x27ff42(0x142)]});let _0x226036=_0xa45a78[_0x27ff42(0x147)];_0x21ad7e&&(_0x226036=_0x226036[_0x27ff42(0x105)](_0x13c9b2=>_0x13c9b2['status'][_0x27ff42(0x101)]()===_0x21ad7e));_0x212d2b&&(_0x226036=_0x226036[_0x27ff42(0x105)](_0x12d531=>matchGlobPattern(_0x12d531[_0x27ff42(0xcb)],_0x212d2b)));const _0x575585=_0x5c99eb[_0x27ff42(0xf4)];if(isStructuredFormat(_0x5c99eb)){const _0x386256=_0x226036[_0x27ff42(0xff)](_0x4a8833=>({..._0x4a8833,'url':_0x4a8833[_0x27ff42(0x94)]?getCampaignUrl(_0x575585,_0x4a8833[_0x27ff42(0x94)],_0x4a8833['id']):undefined}));await handleSDKOutput(_0x386256,_0x5c99eb);}else for(const _0x1eeb85 of _0x226036){const _0x56a574=a21_0x46c0be['dim']('\x20('+_0x1eeb85[_0x27ff42(0x118)]['toLowerCase']()+')'),_0x518b9c=_0x1eeb85['workspaceId']?getCampaignUrl(_0x575585,_0x1eeb85[_0x27ff42(0x94)],_0x1eeb85['id']):undefined,_0x1ce700=_0x518b9c?hyperlink(_0x1eeb85[_0x27ff42(0xcb)],_0x518b9c):_0x1eeb85[_0x27ff42(0xcb)];console['log']('📧\x20'+_0x1ce700+_0x56a574);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']=a21_0x1786d2(0xf3);['description']='Show\x20campaign\x20details';async[a21_0x1786d2(0xfb)](_0x16f2b0){const _0x400121=a21_0x1786d2,{options:_0x58b15f,args:_0x4b8969,tdx:_0x314aad}=_0x16f2b0;if(_0x4b8969[_0x400121(0x141)]===0x0)return console[_0x400121(0xb5)](_0x400121(0xe9)),console['error'](_0x400121(0x12c)),0x1;const _0x334996=_0x4b8969[0x0],_0x268103=_0x58b15f,_0x223e42=await resolveWorkspaceIdFromOptions(_0x268103,_0x314aad),_0x3d32f0=_0x268103['full'],_0x5d26ce=_0x58b15f[_0x400121(0xf4)];if(_0x3d32f0){const _0x5103b8=await withSpinner(_0x400121(0x13e)+_0x334996+_0x400121(0x133),()=>_0x314aad[_0x400121(0x14e)][_0x400121(0x136)](_0x334996,_0x223e42),{'verbose':_0x58b15f[_0x400121(0x142)]}),_0x5e2721=_0x5103b8[_0x400121(0x147)],_0x567d68=_0x5e2721[_0x400121(0x8e)][_0x400121(0x94)]?getCampaignUrl(_0x5d26ce,_0x5e2721[_0x400121(0x8e)][_0x400121(0x94)],_0x5e2721['id']):undefined;await handleSDKOutput([{..._0x5e2721,..._0x567d68&&{'url':_0x567d68}}],_0x58b15f);}else{const _0x16c1e5=await withSpinner(_0x400121(0x13e)+_0x334996+_0x400121(0x133),()=>_0x314aad[_0x400121(0x14e)][_0x400121(0xa4)](_0x334996,_0x223e42),{'verbose':_0x58b15f[_0x400121(0x142)]}),_0x25429b=_0x16c1e5[_0x400121(0x147)],_0x5664d1=_0x25429b[_0x400121(0x94)]?getCampaignUrl(_0x5d26ce,_0x25429b[_0x400121(0x94)],_0x25429b['id']):undefined;await handleSingleObjectOutput({..._0x25429b,..._0x5664d1&&{'url':_0x5664d1}},_0x58b15f);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x144);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x146);async['execute'](_0x32b99a){const _0x2ada0e=a21_0x1786d2,{options:_0x4c5092,tdx:_0x473289}=_0x32b99a,_0x3bf0ef=_0x4c5092,_0x1ee7f=_0x3bf0ef['name'],_0x1d396c=_0x3bf0ef['type'];if(!_0x1ee7f)return console[_0x2ada0e(0xb5)](_0x2ada0e(0xf5)),console[_0x2ada0e(0xb5)](_0x2ada0e(0x103)),0x1;if(!_0x1d396c)return console[_0x2ada0e(0xb5)](_0x2ada0e(0x111)),console[_0x2ada0e(0xb5)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x5be6a0=await resolveWorkspaceIdFromOptions(_0x3bf0ef,_0x473289,!![]),_0x289613=await resolveSegmentFromOptions(_0x3bf0ef,_0x473289),_0x2173b9=buildConnectorConfig(_0x3bf0ef),_0x163102={'name':_0x1ee7f,'campaignType':_0x1d396c,'workspaceId':_0x5be6a0,'description':_0x3bf0ef[_0x2ada0e(0xbb)],..._0x289613,'connectorConfig':_0x2173b9,'startAt':_0x3bf0ef[_0x2ada0e(0x89)],'timezone':_0x3bf0ef[_0x2ada0e(0x14a)]},_0x272050=await withSpinner(_0x2ada0e(0xd1)+_0x1ee7f+_0x2ada0e(0x133),()=>_0x473289[_0x2ada0e(0x14e)]['createCampaign'](_0x163102));return await handleSDKOutput([_0x272050['data']],_0x4c5092),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xf1);['description']=a21_0x1786d2(0xa1);async['execute'](_0x75da1d){const _0x384ecf=a21_0x1786d2,{options:_0x119e02,args:_0x4ef86f,tdx:_0x5110ee}=_0x75da1d;if(_0x4ef86f[_0x384ecf(0x141)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x384ecf(0x113)),0x1;const _0x90074e=_0x4ef86f[0x0],_0x3f7bb0=_0x119e02,_0x1f1353=await resolveWorkspaceIdFromOptions(_0x3f7bb0,_0x5110ee),_0x1d520f=await resolveSegmentFromOptions(_0x3f7bb0,_0x5110ee),_0x241b87=buildConnectorConfig(_0x3f7bb0),_0x1ffce3={'name':_0x3f7bb0[_0x384ecf(0xcb)],'description':_0x3f7bb0['description'],..._0x1d520f,'connectorConfig':_0x241b87,'startAt':_0x3f7bb0[_0x384ecf(0x89)],'timezone':_0x3f7bb0[_0x384ecf(0x14a)]},_0x496fbd=Object[_0x384ecf(0xf7)](Object['entries'](_0x1ffce3)[_0x384ecf(0x105)](([,_0x5e76a2])=>_0x5e76a2!==undefined));if(Object[_0x384ecf(0xc5)](_0x496fbd)[_0x384ecf(0x141)]===0x0)return console[_0x384ecf(0xb5)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x384ecf(0xb5)](_0x384ecf(0x8c)),0x1;const _0x1f84cb=await withSpinner(_0x384ecf(0x11d)+_0x90074e+_0x384ecf(0x133),()=>_0x5110ee[_0x384ecf(0x14e)]['updateCampaign'](_0x90074e,_0x496fbd,_0x1f1353),{'verbose':_0x119e02['verbose']});return await handleSDKOutput([_0x1f84cb[_0x384ecf(0x147)]],_0x119e02),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xbc);['description']=a21_0x1786d2(0x86);async[a21_0x1786d2(0xfb)](_0x3f0738){const _0x1193e1=a21_0x1786d2,{options:_0x312984,args:_0x4c92f0,tdx:_0x490c6a}=_0x3f0738;if(_0x4c92f0['length']===0x0)return console[_0x1193e1(0xb5)](_0x1193e1(0xe9)),console[_0x1193e1(0xb5)](_0x1193e1(0x119)),0x1;const _0x149457=_0x4c92f0[0x0],_0x44cd9b=_0x312984,_0x38b8e9=await resolveWorkspaceIdFromOptions(_0x44cd9b,_0x490c6a);if(!_0x312984[_0x1193e1(0x90)]){const _0x23f66c=await confirm(_0x1193e1(0xa6)+_0x149457+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x23f66c)return console[_0x1193e1(0x117)](_0x1193e1(0x15a)),0x0;}return await withSpinner(_0x1193e1(0x158)+_0x149457+'\x27...',()=>_0x490c6a['engage'][_0x1193e1(0xaa)](_0x149457,_0x38b8e9),{'verbose':_0x312984[_0x1193e1(0x142)]}),console[_0x1193e1(0x117)](_0x1193e1(0xbd)+_0x149457+_0x1193e1(0x126)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']=a21_0x1786d2(0xcd);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xd9);async['execute'](_0x3bd68d){const _0x259b22=a21_0x1786d2,{options:_0xdc3a18,args:_0x119033,tdx:_0x57ae01}=_0x3bd68d;if(_0x119033[_0x259b22(0x141)]===0x0)return console[_0x259b22(0xb5)](_0x259b22(0xe9)),console[_0x259b22(0xb5)](_0x259b22(0xaf)),0x1;const _0x3d5b58=_0x119033[0x0],_0x5bbaba=_0xdc3a18,_0x4c2046=await resolveWorkspaceIdFromOptions(_0x5bbaba,_0x57ae01);return await withSpinner(_0x259b22(0xb6)+_0x3d5b58+_0x259b22(0x133),()=>_0x57ae01['engage'][_0x259b22(0xad)](_0x3d5b58,_0x4c2046),{'verbose':_0xdc3a18[_0x259b22(0x142)]}),console[_0x259b22(0x117)](_0x259b22(0xbd)+_0x3d5b58+_0x259b22(0xdb)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x14f);['description']=a21_0x1786d2(0x11f);async['execute'](_0x46386f){const _0x582681=a21_0x1786d2,{options:_0x281316,args:_0x1c045b,tdx:_0x2952ee}=_0x46386f;if(_0x1c045b[_0x582681(0x141)]===0x0)return console[_0x582681(0xb5)](_0x582681(0xe9)),console['error'](_0x582681(0x130)),0x1;const _0x3b8a33=_0x1c045b[0x0],_0x3f7d70=_0x281316,_0x2ad01d=await resolveWorkspaceIdFromOptions(_0x3f7d70,_0x2952ee);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x3b8a33+_0x582681(0x133),()=>_0x2952ee[_0x582681(0x14e)]['pauseCampaign'](_0x3b8a33,_0x2ad01d),{'verbose':_0x281316['verbose']}),console[_0x582681(0x117)]('Campaign\x20\x27'+_0x3b8a33+_0x582681(0xc4)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x13a);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x128);async[a21_0x1786d2(0xfb)](_0x333e51){const _0x52c33e=a21_0x1786d2,{options:_0x4550e4,args:_0x11c712,tdx:_0x263bcc}=_0x333e51;if(_0x11c712[_0x52c33e(0x141)]===0x0)return console[_0x52c33e(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x52c33e(0xb5)](_0x52c33e(0xa9)),0x1;const _0x103285=_0x11c712[0x0],_0xb6b891=_0x4550e4,_0x4ab5d6=await resolveWorkspaceIdFromOptions(_0xb6b891,_0x263bcc);return await withSpinner(_0x52c33e(0xd0)+_0x103285+_0x52c33e(0x133),()=>_0x263bcc[_0x52c33e(0x14e)]['resumeCampaign'](_0x103285,_0x4ab5d6),{'verbose':_0x4550e4[_0x52c33e(0x142)]}),console[_0x52c33e(0x117)](_0x52c33e(0xbd)+_0x103285+_0x52c33e(0x127)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a21_0x1786d2(0xc8);['description']=a21_0x1786d2(0xfc);async['execute'](_0x423e98){const _0x1e4dba=a21_0x1786d2,{options:_0x438873,args:_0x16d155,tdx:_0x4167c5}=_0x423e98;if(_0x16d155[_0x1e4dba(0x141)]===0x0)return console[_0x1e4dba(0xb5)](_0x1e4dba(0xe9)),console[_0x1e4dba(0xb5)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x4bf9a5=_0x16d155[0x0],_0x4956ec=_0x438873,_0x482a74=await resolveWorkspaceIdFromOptions(_0x4956ec,_0x4167c5),_0x349e5e=await withSpinner(_0x1e4dba(0xd3)+_0x4bf9a5+'\x27...',()=>_0x4167c5[_0x1e4dba(0x14e)][_0x1e4dba(0xce)](_0x4bf9a5,_0x482a74),{'verbose':_0x438873[_0x1e4dba(0x142)]});return await handleSDKOutput([_0x349e5e[_0x1e4dba(0x147)]],_0x438873),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a21_0x1786d2(0xcc);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xdf);async[a21_0x1786d2(0xfb)](_0x28e134){const _0x328084=a21_0x1786d2,{options:_0x138906,args:_0xc7cbfc,tdx:_0x2111da}=_0x28e134,_0x1fdc73=_0xc7cbfc[0x0],_0x4f11c2=resolveLimit(_0x138906['limit'],DEFAULT_LLM_LIMIT),_0x198a85=_0x138906,_0xe9778d=await resolveWorkspaceIdFromOptions(_0x198a85,_0x2111da),_0x59b137=await withSpinner('Fetching\x20templates...',()=>_0x2111da[_0x328084(0x14e)][_0x328084(0xd5)]({'workspaceId':_0xe9778d,'limit':_0x4f11c2}),{'verbose':_0x138906['verbose']});let _0x16d8f9=_0x59b137[_0x328084(0x147)];_0x1fdc73&&(_0x16d8f9=_0x59b137[_0x328084(0x147)][_0x328084(0x105)](_0x275b85=>matchGlobPattern(_0x275b85[_0x328084(0xcb)],_0x1fdc73)));const _0x1e3ade=_0x138906['site'];if(isStructuredFormat(_0x138906))await handleSDKOutput(_0x16d8f9,_0x138906);else for(const _0x4ad3f6 of _0x16d8f9){const _0x2bb228=_0x4ad3f6['workspaceId']?getTemplateUrl(_0x1e3ade,_0x4ad3f6['workspaceId'],_0x4ad3f6['id']):undefined,_0x260b15=_0x2bb228?hyperlink(_0x4ad3f6[_0x328084(0xcb)],_0x2bb228):_0x4ad3f6[_0x328084(0xcb)];console[_0x328084(0x117)](_0x328084(0xc3)+_0x260b15);}return 0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xa3);[a21_0x1786d2(0xbb)]='Show\x20email\x20template\x20details';async[a21_0x1786d2(0xfb)](_0xb180ff){const _0x239bbd=a21_0x1786d2,{options:_0x2a7334,args:_0x30b689,tdx:_0x17b8b1}=_0xb180ff;if(_0x30b689[_0x239bbd(0x141)]===0x0)return console['error'](_0x239bbd(0x120)),console[_0x239bbd(0xb5)](_0x239bbd(0x9a)),0x1;const _0x5ca5bb=_0x30b689[0x0],_0x1d8e8a=_0x2a7334,_0x23ab84=await resolveWorkspaceIdFromOptions(_0x1d8e8a,_0x17b8b1),_0x4a848a=_0x1d8e8a['full'];if(_0x4a848a){const _0x1379fe=await withSpinner(_0x239bbd(0xe8)+_0x5ca5bb+_0x239bbd(0x133),()=>_0x17b8b1['engage'][_0x239bbd(0xa2)](_0x5ca5bb,_0x23ab84),{'verbose':_0x2a7334[_0x239bbd(0x142)]});await handleSDKOutput([_0x1379fe],_0x2a7334);}else{const _0x371e64=await withSpinner(_0x239bbd(0xe8)+_0x5ca5bb+_0x239bbd(0x133),()=>_0x17b8b1[_0x239bbd(0x14e)][_0x239bbd(0x154)](_0x5ca5bb,_0x23ab84),{'verbose':_0x2a7334[_0x239bbd(0x142)]});await handleSDKOutput([_0x371e64],_0x2a7334);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xe2);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x97);async[a21_0x1786d2(0xfb)](_0x470fb0){const _0x26850e=a21_0x1786d2,{options:_0x4d1e25,tdx:_0x4aa360}=_0x470fb0,_0x11b05a=_0x4d1e25,_0xd2ecb6=_0x11b05a[_0x26850e(0xcb)],_0x4c8de3=_0x11b05a[_0x26850e(0x8b)],_0x2f1bdb=_0x11b05a[_0x26850e(0xfa)],_0x440f65=_0x11b05a[_0x26850e(0x102)];if(!_0xd2ecb6)return console[_0x26850e(0xb5)]('Error:\x20--name\x20is\x20required'),console[_0x26850e(0xb5)](_0x26850e(0x153)),0x1;if(!_0x4c8de3)return console['error'](_0x26850e(0xd6)),0x1;if(_0x2f1bdb&&_0x440f65)return console['error'](_0x26850e(0x116)),0x1;const _0x4fcb3c=_0x440f65?readFileContent(_0x440f65):_0x2f1bdb;if(!_0x4fcb3c)return console[_0x26850e(0xb5)](_0x26850e(0x156)),0x1;const _0x769dff=await resolveWorkspaceIdFromOptions(_0x11b05a,_0x4aa360,!![]),_0x15bfdc={'name':_0xd2ecb6,'subjectTemplate':_0x4c8de3,'htmlTemplate':_0x4fcb3c,'workspaceId':_0x769dff,'plaintextTemplate':_0x11b05a[_0x26850e(0xcf)],'editorType':_0x11b05a[_0x26850e(0xfd)]??_0x26850e(0xf2)},_0xc702b9=await withSpinner('Creating\x20template\x20\x27'+_0xd2ecb6+'\x27...',()=>_0x4aa360['engage'][_0x26850e(0xc6)](_0x15bfdc));return await handleSDKOutput([_0xc702b9[_0x26850e(0x147)]],_0x4d1e25),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xb8);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x13c);async[a21_0x1786d2(0xfb)](_0x2df3bb){const _0xcff02f=a21_0x1786d2,{options:_0x21de69,args:_0x29747d,tdx:_0x1032d3}=_0x2df3bb;if(_0x29747d[_0xcff02f(0x141)]===0x0)return console['error'](_0xcff02f(0x120)),console[_0xcff02f(0xb5)](_0xcff02f(0xe0)),0x1;const _0x13a530=_0x29747d[0x0],_0x463f43=_0x21de69,_0x3f04a5=_0x463f43[_0xcff02f(0xfa)],_0x14d31f=_0x463f43['htmlFile'];if(_0x3f04a5&&_0x14d31f)return console[_0xcff02f(0xb5)](_0xcff02f(0x116)),0x1;const _0x420623=_0x14d31f?readFileContent(_0x14d31f):_0x3f04a5,_0x17e0f2=await resolveWorkspaceIdFromOptions(_0x463f43,_0x1032d3),_0x542796={'name':_0x463f43[_0xcff02f(0xcb)],'subjectTemplate':_0x463f43['subject'],'htmlTemplate':_0x420623,'plaintextTemplate':_0x463f43[_0xcff02f(0xcf)]},_0x3b77b0=Object[_0xcff02f(0xf7)](Object[_0xcff02f(0x104)](_0x542796)[_0xcff02f(0x105)](([,_0x10d2ca])=>_0x10d2ca!==undefined));if(Object['keys'](_0x3b77b0)[_0xcff02f(0x141)]===0x0)return console[_0xcff02f(0xb5)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error']('Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext'),0x1;const _0x1c76d1=await withSpinner(_0xcff02f(0x12b)+_0x13a530+_0xcff02f(0x133),()=>_0x1032d3['engage'][_0xcff02f(0x11c)](_0x13a530,_0x3b77b0,_0x17e0f2),{'verbose':_0x21de69[_0xcff02f(0x142)]});return await handleSDKOutput([_0x1c76d1['data']],_0x21de69),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xee);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x13b);async[a21_0x1786d2(0xfb)](_0x1c9938){const _0x1fc459=a21_0x1786d2,{options:_0x45b199,args:_0x14630c,tdx:_0x990f9f}=_0x1c9938;if(_0x14630c[_0x1fc459(0x141)]===0x0)return console[_0x1fc459(0xb5)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x1fc459(0xb5)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x2c421a=_0x14630c[0x0],_0xb9652d=_0x45b199,_0x2933df=await resolveWorkspaceIdFromOptions(_0xb9652d,_0x990f9f);if(!_0x45b199[_0x1fc459(0x90)]){const _0x472561=await confirm(_0x1fc459(0x11b)+_0x2c421a+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x472561)return console[_0x1fc459(0x117)](_0x1fc459(0x15a)),0x0;}return await withSpinner(_0x1fc459(0xfe)+_0x2c421a+'\x27...',()=>_0x990f9f[_0x1fc459(0x14e)][_0x1fc459(0xe7)](_0x2c421a,_0x2933df),{'verbose':_0x45b199[_0x1fc459(0x142)]}),console[_0x1fc459(0x117)]('Template\x20\x27'+_0x2c421a+'\x27\x20deleted\x20successfully'),0x0;}}function a21_0x242b(){const _0x41ed14=['Updating\x20campaign\x20\x27','engage:always-on-campaign:finish','Pause\x20a\x20campaign','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','🏢\x20','Resuming\x20always-on\x20campaign\x20\x27','List\x20campaigns','PAUSED','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','\x27\x20deleted\x20successfully','\x27\x20resumed\x20successfully','Resume\x20a\x20paused\x20campaign','882024zYFsQf','387828vHRMHi','Updating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','engage:workspace:show','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','includes','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','full','\x27...','engage:workspaces','engage:always-on-campaigns','getCampaignFull','limit','audienceName','Pausing\x20always-on\x20campaign\x20\x27','engage:campaign:resume','Delete\x20an\x20email\x20template','Update\x20an\x20email\x20template','pauseAlwaysOnCampaign','Fetching\x20campaign\x20\x27','Error:\x20Invalid\x20status\x20\x22','FINISHED','length','verbose','Finish\x20an\x20always-on\x20campaign','engage:campaign:create','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','Create\x20a\x20new\x20campaign','data','getWorkspace','listWorkspaces','timezone','engage:always-on-campaign:pause','parentName','dim','engage','engage:campaign:pause','engage:always-on-campaign:duplicate','Verifying\x20workspace\x20\x27','308371CvShYl','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','getTemplate','Error:\x20Workspace\x20name\x20is\x20required','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','session','Deleting\x20campaign\x20\x27','toLowerCase','Operation\x20cancelled','\x27?\x20This\x20cannot\x20be\x20undone.','Delete\x20a\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>','startAt','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','subject','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Update\x20an\x20always-on\x20campaign','attributes','Set\x20workspace\x20context\x20for\x20Engage\x20commands','yes','130yamxSe','Updating\x20workspace\x20\x27','audienceId','workspaceId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>','Create\x20an\x20email\x20template','engage:campaigns','Creating\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Fetching\x20always-on\x20campaign\x20\x27','\x22.\x20Valid\x20values:\x20','Duplicate\x20an\x20always-on\x20campaign','734132TTkUHn','segmentId','Update\x20a\x20campaign','getTemplateFull','engage:template:show','getCampaign','\x27\x20finished\x20successfully','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','segmentName','Fetching\x20workspaces...','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','deleteCampaign','Launching\x20always-on\x20campaign\x20\x27','Always-on\x20campaign\x20\x27','launchCampaign','listAlwaysOnCampaigns','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','engage_workspace','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:always-on-campaign:update','resolveWorkspaceId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','error','Launching\x20campaign\x20\x27','resumeAlwaysOnCampaign','engage:template:update','Duplicating\x20always-on\x20campaign\x20\x27','createWorkspace','description','engage:campaign:delete','Campaign\x20\x27','List\x20workspaces','Fetching\x20campaigns...','engage:always-on-campaign:create','154764iKsUUx','updateWorkspace','📝\x20','\x27\x20paused\x20successfully','keys','createTemplate','DRAFT','engage:campaign:duplicate','72294zfVfZs','Launch\x20an\x20always-on\x20campaign','name','engage:templates','engage:campaign:launch','duplicateCampaign','plaintext','Resuming\x20campaign\x20\x27','Creating\x20campaign\x20\x27','Workspace\x20\x27','Duplicating\x20campaign\x20\x27','createAlwaysOnCampaign','listTemplates','Error:\x20--subject\x20is\x20required','workspace','Create\x20a\x20workspace','Launch\x20a\x20campaign','LIVE','\x27\x20launched\x20successfully','type','Fetching\x20workspace\x20\x27','launchAlwaysOnCampaign','List\x20email\x20templates','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Update\x20a\x20workspace','engage:template:create','ACTIVE','jsonColumns','Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>','join','deleteTemplate','Fetching\x20template\x20\x27','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:workspace:delete','emailSenderId','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','428121jFENiX','engage:template:delete','20ZIFVpS','9UfcLpv','engage:campaign:update','grapesjs','engage:campaign:show','site','Error:\x20--name\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27','fromEntries','Finishing\x20always-on\x20campaign\x20\x27','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','html','execute','Duplicate\x20a\x20campaign','editorType','Deleting\x20template\x20\x27','map','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','toUpperCase','htmlFile','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','entries','filter','engage:always-on-campaign:delete','📧\x20','COMPLETED','MISSING_ARGUMENT','getAlwaysOnCampaignFull','enableUtmTracking','segment','parentId','Deleting\x20workspace\x20\x27','Delete\x20a\x20workspace','Resume\x20a\x20paused\x20always-on\x20campaign','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:always-on-campaign:launch','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','listCampaigns','Deleting\x20always-on\x20campaign\x20\x27','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','log','status','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','updateTemplate'];a21_0x242b=function(){return _0x41ed14;};return a21_0x242b();}export class EngageWorkspacesCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x134);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xbe);async['execute'](_0x4538bb){const _0x49d9f7=a21_0x1786d2,{options:_0x6000fb,args:_0x48408b,tdx:_0x4a4e22}=_0x4538bb,_0x50da44=_0x48408b[0x0],_0x223c2b=resolveLimit(_0x6000fb['limit'],DEFAULT_LLM_LIMIT),_0x24f3a8=await withSpinner(_0x49d9f7(0xa8),()=>_0x4a4e22[_0x49d9f7(0x14e)][_0x49d9f7(0x149)]({'limit':_0x223c2b}),{'verbose':_0x6000fb['verbose']});let _0x694e17=_0x24f3a8[_0x49d9f7(0x147)];_0x50da44&&(_0x694e17=_0x24f3a8[_0x49d9f7(0x147)][_0x49d9f7(0x105)](_0x5f5855=>matchGlobPattern(_0x5f5855[_0x49d9f7(0xcb)],_0x50da44)));const _0x22ac30=_0x6000fb[_0x49d9f7(0xf4)];if(isStructuredFormat(_0x6000fb))await handleSDKOutput(_0x694e17,_0x6000fb);else for(const _0x60fb17 of _0x694e17){const _0x59b563=getWorkspaceUrl(_0x22ac30,_0x60fb17['id']),_0x5ca740=hyperlink(_0x60fb17[_0x49d9f7(0xcb)],_0x59b563);console[_0x49d9f7(0x117)](_0x49d9f7(0x121)+_0x5ca740);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a21_0x1786d2(0x12d);[a21_0x1786d2(0xbb)]='Show\x20workspace\x20details';async['execute'](_0x1333c4){const _0x5ce4a6=a21_0x1786d2,{options:_0x421ec9,args:_0x52d8b0,tdx:_0x555ced}=_0x1333c4;if(_0x52d8b0[_0x5ce4a6(0x141)]===0x0)return console[_0x5ce4a6(0xb5)](_0x5ce4a6(0x8a)),console[_0x5ce4a6(0xb5)](_0x5ce4a6(0x87)),0x1;const _0x5d6663=_0x52d8b0[0x0],_0xa34c52=_0x421ec9,_0x159c29=_0xa34c52[_0x5ce4a6(0x132)];if(_0x159c29){const _0x1908ee=await withSpinner(_0x5ce4a6(0xdd)+_0x5d6663+_0x5ce4a6(0x133),()=>_0x555ced[_0x5ce4a6(0x14e)]['getWorkspaceFull'](_0x5d6663),{'verbose':_0x421ec9[_0x5ce4a6(0x142)]});await handleSDKOutput([_0x1908ee],_0x421ec9);}else{const _0x257a24=await withSpinner(_0x5ce4a6(0xdd)+_0x5d6663+_0x5ce4a6(0x133),()=>_0x555ced[_0x5ce4a6(0x14e)][_0x5ce4a6(0x148)](_0x5d6663),{'verbose':_0x421ec9[_0x5ce4a6(0x142)]});await handleSDKOutput([_0x257a24],_0x421ec9);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']='engage:workspace:create';['description']=a21_0x1786d2(0xd8);async[a21_0x1786d2(0xfb)](_0x5e7fd9){const _0x3aa72a=a21_0x1786d2,{options:_0x1be572,tdx:_0x341c29}=_0x5e7fd9,_0x18cdaa=_0x1be572,_0xa6d9cb=_0x18cdaa['name'];if(!_0xa6d9cb)return console[_0x3aa72a(0xb5)](_0x3aa72a(0xf5)),console[_0x3aa72a(0xb5)](_0x3aa72a(0x100)),0x1;const _0x18f4ef={'name':_0xa6d9cb,'description':_0x18cdaa['description']},_0x30db64=await withSpinner('Creating\x20workspace\x20\x27'+_0xa6d9cb+'\x27...',()=>_0x341c29[_0x3aa72a(0x14e)][_0x3aa72a(0xba)](_0x18f4ef));return await handleSDKOutput([_0x30db64[_0x3aa72a(0x147)]],_0x1be572),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]='engage:workspace:update';[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xe1);async[a21_0x1786d2(0xfb)](_0x318003){const _0x9917a6=a21_0x1786d2,{options:_0x204267,args:_0xb2fa35,tdx:_0x3f66fd}=_0x318003;if(_0xb2fa35[_0x9917a6(0x141)]===0x0)return console[_0x9917a6(0xb5)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x9917a6(0xb5)](_0x9917a6(0x9b)),0x1;const _0x31999c=_0xb2fa35[0x0],_0x3978ec=_0x204267,_0x3edd31={'name':_0x3978ec[_0x9917a6(0xcb)],'description':_0x3978ec[_0x9917a6(0xbb)]},_0x4f54b8=Object[_0x9917a6(0xf7)](Object[_0x9917a6(0x104)](_0x3edd31)['filter'](([,_0x3f2a4b])=>_0x3f2a4b!==undefined));if(Object[_0x9917a6(0xc5)](_0x4f54b8)[_0x9917a6(0x141)]===0x0)return console['error'](_0x9917a6(0xf9)),console['error']('Options:\x20--name,\x20--description'),0x1;const _0x120ce5=await withSpinner(_0x9917a6(0x92)+_0x31999c+_0x9917a6(0x133),()=>_0x3f66fd[_0x9917a6(0x14e)][_0x9917a6(0xc2)](_0x31999c,_0x4f54b8),{'verbose':_0x204267[_0x9917a6(0x142)]});return await handleSDKOutput([_0x120ce5['data']],_0x204267),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xea);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x10f);async['execute'](_0x15a708){const _0x2e50d0=a21_0x1786d2,{options:_0x5b5129,args:_0x369876,tdx:_0x45dd19}=_0x15a708;if(_0x369876[_0x2e50d0(0x141)]===0x0)return console['error'](_0x2e50d0(0x8a)),console['error'](_0x2e50d0(0x12e)),0x1;const _0x11fcb8=_0x369876[0x0];if(!_0x5b5129[_0x2e50d0(0x90)]){const _0x1e2aa5=await confirm(_0x2e50d0(0xb1)+_0x11fcb8+_0x2e50d0(0x15b));if(!_0x1e2aa5)return console['log'](_0x2e50d0(0x15a)),0x0;}return await withSpinner(_0x2e50d0(0x10e)+_0x11fcb8+_0x2e50d0(0x133),()=>_0x45dd19['engage']['deleteWorkspace'](_0x11fcb8),{'verbose':_0x5b5129[_0x2e50d0(0x142)]}),console['log'](_0x2e50d0(0xd2)+_0x11fcb8+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x135);[a21_0x1786d2(0xbb)]='List\x20always-on\x20campaigns';async[a21_0x1786d2(0xfb)](_0x26cb97){const _0x55d3f7=a21_0x1786d2,{options:_0x11bace,args:_0x15481f,tdx:_0x39dd70}=_0x26cb97,_0x516863=_0x15481f[0x0],_0x197e2a=resolveLimit(_0x11bace[_0x55d3f7(0x137)],DEFAULT_LLM_LIMIT),_0x25d476=_0x11bace,_0x10aaec=_0x25d476[_0x55d3f7(0xdc)],_0x4e6ee7=[_0x55d3f7(0xc7),_0x55d3f7(0xda),_0x55d3f7(0x124),_0x55d3f7(0x140)],_0x268265=_0x25d476[_0x55d3f7(0x118)],_0x335536=_0x268265?.[_0x55d3f7(0x101)]();if(_0x335536&&!_0x4e6ee7[_0x55d3f7(0x12f)](_0x335536))return console['error'](_0x55d3f7(0x13f)+_0x268265+_0x55d3f7(0x9d)+_0x4e6ee7[_0x55d3f7(0xe6)](',\x20')),0x1;const _0x13d945=await resolveWorkspaceIdFromOptions(_0x25d476,_0x39dd70,!![]),_0x263d9b=await withSpinner('Fetching\x20always-on\x20campaigns...',()=>_0x39dd70[_0x55d3f7(0x14e)][_0x55d3f7(0xae)]({'workspaceId':_0x13d945,'type':_0x10aaec,'status':_0x335536,'limit':_0x197e2a}),{'verbose':_0x11bace['verbose']});let _0x646663=_0x263d9b[_0x55d3f7(0x147)];_0x335536&&(_0x646663=_0x646663['filter'](_0xa9a177=>_0xa9a177[_0x55d3f7(0x118)][_0x55d3f7(0x101)]()===_0x335536));_0x516863&&(_0x646663=_0x646663[_0x55d3f7(0x105)](_0x2e510b=>matchGlobPattern(_0x2e510b[_0x55d3f7(0xcb)],_0x516863)));const _0x461932=_0x11bace[_0x55d3f7(0xf4)];if(isStructuredFormat(_0x11bace)){const _0x462df8=_0x646663[_0x55d3f7(0xff)](_0x314c0f=>({..._0x314c0f,'url':getCampaignUrl(_0x461932,_0x314c0f[_0x55d3f7(0x94)],_0x314c0f['id'])}));await handleSDKOutput(_0x462df8,_0x11bace);}else for(const _0x251823 of _0x646663){const _0x55c380=a21_0x46c0be[_0x55d3f7(0x14d)]('\x20('+_0x251823['status'][_0x55d3f7(0x159)]()+')'),_0x101fa0=getCampaignUrl(_0x461932,_0x251823[_0x55d3f7(0x94)],_0x251823['id']),_0x2c5ed7=hyperlink(_0x251823[_0x55d3f7(0xcb)],_0x101fa0);console[_0x55d3f7(0x117)](_0x55d3f7(0x107)+_0x2c5ed7+_0x55c380);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{[a21_0x1786d2(0xcb)]='engage:always-on-campaign:show';[a21_0x1786d2(0xbb)]='Show\x20always-on\x20campaign\x20details';async[a21_0x1786d2(0xfb)](_0x1ee112){const _0x270864=a21_0x1786d2,{options:_0x245c20,args:_0x458df4,tdx:_0x383bd5}=_0x1ee112;if(_0x458df4['length']===0x0)return console[_0x270864(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x270864(0xe5)),0x1;const _0x246c51=_0x458df4[0x0],_0xd67c9f=_0x245c20,_0x2b0b4c=await resolveWorkspaceIdFromOptions(_0xd67c9f,_0x383bd5,!![]),_0xf7917c=_0xd67c9f[_0x270864(0x132)],_0x3728e8=_0x245c20[_0x270864(0xf4)];if(_0xf7917c){const _0x4584c4=await withSpinner('Fetching\x20always-on\x20campaign\x20\x27'+_0x246c51+_0x270864(0x133),()=>_0x383bd5[_0x270864(0x14e)][_0x270864(0x10a)](_0x2b0b4c,_0x246c51),{'verbose':_0x245c20[_0x270864(0x142)]}),_0x1fa90f=_0x4584c4[_0x270864(0x147)],_0x5e4233=getCampaignUrl(_0x3728e8,_0x1fa90f[_0x270864(0x8e)]['workspaceId'],_0x1fa90f['id']);await handleSDKOutput([{..._0x1fa90f,'url':_0x5e4233}],_0x245c20);}else{const _0x301991=await withSpinner(_0x270864(0x9c)+_0x246c51+_0x270864(0x133),()=>_0x383bd5[_0x270864(0x14e)]['getAlwaysOnCampaign'](_0x2b0b4c,_0x246c51),{'verbose':_0x245c20[_0x270864(0x142)]}),_0x44154e=_0x301991[_0x270864(0x147)],_0x44a84c=getCampaignUrl(_0x3728e8,_0x44154e[_0x270864(0x94)],_0x44154e['id']);await handleSingleObjectOutput({..._0x44154e,'url':_0x44a84c},_0x245c20);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xc0);[a21_0x1786d2(0xbb)]='Create\x20a\x20new\x20always-on\x20campaign';async[a21_0x1786d2(0xfb)](_0x396a06){const _0x32d191=a21_0x1786d2,{options:_0x304f48,tdx:_0x268b5b}=_0x396a06,_0x22dabf=_0x304f48,_0x13695f=_0x22dabf[_0x32d191(0xcb)],_0x3c6c5d=_0x22dabf[_0x32d191(0xdc)];if(!_0x13695f)return console[_0x32d191(0xb5)](_0x32d191(0xf5)),console[_0x32d191(0xb5)](_0x32d191(0xb4)),0x1;if(!_0x3c6c5d)return console[_0x32d191(0xb5)](_0x32d191(0x111)),console[_0x32d191(0xb5)](_0x32d191(0xb4)),0x1;const _0x3297f7=await resolveWorkspaceIdFromOptions(_0x22dabf,_0x268b5b,!![]),_0x553f9c=await resolveSegmentFromOptions(_0x22dabf,_0x268b5b),_0x4de3f5={'name':_0x13695f,'campaignType':_0x3c6c5d,'workspaceId':_0x3297f7,'description':_0x22dabf[_0x32d191(0xbb)],'audienceId':_0x553f9c[_0x32d191(0x93)],'audienceName':_0x553f9c[_0x32d191(0x138)],'enableUtmTracking':_0x22dabf[_0x32d191(0x10b)]},_0x1fa9e6=await withSpinner(_0x32d191(0x99)+_0x13695f+_0x32d191(0x133),()=>_0x268b5b[_0x32d191(0x14e)][_0x32d191(0xd4)](_0x3297f7,_0x4de3f5));return await handleSDKOutput([_0x1fa9e6[_0x32d191(0x147)]],_0x304f48),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0xb2);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x8d);async[a21_0x1786d2(0xfb)](_0x1432ef){const _0x8732a7=a21_0x1786d2,{options:_0x2d2293,args:_0x1e0621,tdx:_0x1b1829}=_0x1432ef;if(_0x1e0621[_0x8732a7(0x141)]===0x0)return console['error'](_0x8732a7(0xe9)),console['error']('Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x11508e=_0x1e0621[0x0],_0x2cd980=_0x2d2293,_0x38889c=await resolveWorkspaceIdFromOptions(_0x2cd980,_0x1b1829,!![]),_0x2bf3fb=await resolveSegmentFromOptions(_0x2cd980,_0x1b1829),_0x35caaf={'name':_0x2cd980[_0x8732a7(0xcb)],'description':_0x2cd980['description'],'audienceId':_0x2bf3fb['audienceId'],'audienceName':_0x2bf3fb[_0x8732a7(0x138)],'enableUtmTracking':_0x2cd980[_0x8732a7(0x10b)]},_0x3bd153=Object[_0x8732a7(0xf7)](Object[_0x8732a7(0x104)](_0x35caaf)['filter'](([,_0x8741fb])=>_0x8741fb!==undefined));if(Object[_0x8732a7(0xc5)](_0x3bd153)['length']===0x0)return console['error'](_0x8732a7(0xf9)),console[_0x8732a7(0xb5)](_0x8732a7(0x145)),0x1;const _0xfdb818=await withSpinner('Updating\x20always-on\x20campaign\x20\x27'+_0x11508e+_0x8732a7(0x133),()=>_0x1b1829[_0x8732a7(0x14e)]['updateAlwaysOnCampaign'](_0x38889c,_0x11508e,_0x3bd153),{'verbose':_0x2d2293[_0x8732a7(0x142)]});return await handleSDKOutput([_0xfdb818[_0x8732a7(0x147)]],_0x2d2293),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x106);[a21_0x1786d2(0xbb)]='Delete\x20an\x20always-on\x20campaign';async[a21_0x1786d2(0xfb)](_0x4daa6d){const _0xd5e7bf=a21_0x1786d2,{options:_0x5171b0,args:_0x2a28d9,tdx:_0xc11a64}=_0x4daa6d;if(_0x2a28d9[_0xd5e7bf(0x141)]===0x0)return console[_0xd5e7bf(0xb5)](_0xd5e7bf(0xe9)),console[_0xd5e7bf(0xb5)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>'),0x1;const _0x237425=_0x2a28d9[0x0],_0x76201d=_0x5171b0,_0x5de449=await resolveWorkspaceIdFromOptions(_0x76201d,_0xc11a64,!![]);if(!_0x5171b0[_0xd5e7bf(0x90)]){const _0x16674b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27'+_0x237425+_0xd5e7bf(0x15b));if(!_0x16674b)return console['log'](_0xd5e7bf(0x15a)),0x0;}return await withSpinner(_0xd5e7bf(0x115)+_0x237425+_0xd5e7bf(0x133),()=>_0xc11a64['engage']['deleteAlwaysOnCampaign'](_0x5de449,_0x237425),{'verbose':_0x5171b0[_0xd5e7bf(0x142)]}),console['log']('Always-on\x20campaign\x20\x27'+_0x237425+_0xd5e7bf(0x126)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x112);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0xca);async[a21_0x1786d2(0xfb)](_0x411536){const _0x463fac=a21_0x1786d2,{options:_0x2963e0,args:_0xfe770e,tdx:_0x5d0d3b}=_0x411536;if(_0xfe770e[_0x463fac(0x141)]===0x0)return console[_0x463fac(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x463fac(0x88)),0x1;const _0x1a91d5=_0xfe770e[0x0],_0x1eafea=_0x2963e0,_0x5724cc=await resolveWorkspaceIdFromOptions(_0x1eafea,_0x5d0d3b,!![]);return await withSpinner(_0x463fac(0xab)+_0x1a91d5+'\x27...',()=>_0x5d0d3b[_0x463fac(0x14e)][_0x463fac(0xde)](_0x5724cc,_0x1a91d5),{'verbose':_0x2963e0[_0x463fac(0x142)]}),console['log'](_0x463fac(0xac)+_0x1a91d5+_0x463fac(0xdb)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{['name']=a21_0x1786d2(0x14b);[a21_0x1786d2(0xbb)]='Pause\x20an\x20always-on\x20campaign';async[a21_0x1786d2(0xfb)](_0x5f3b25){const _0xa2ece6=a21_0x1786d2,{options:_0x5688bb,args:_0x2fce25,tdx:_0x5599cb}=_0x5f3b25;if(_0x2fce25[_0xa2ece6(0x141)]===0x0)return console[_0xa2ece6(0xb5)](_0xa2ece6(0xe9)),console[_0xa2ece6(0xb5)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>'),0x1;const _0x1d74dc=_0x2fce25[0x0],_0x2a7bbb=_0x5688bb,_0x3934d2=await resolveWorkspaceIdFromOptions(_0x2a7bbb,_0x5599cb,!![]);return await withSpinner(_0xa2ece6(0x139)+_0x1d74dc+'\x27...',()=>_0x5599cb[_0xa2ece6(0x14e)][_0xa2ece6(0x13d)](_0x3934d2,_0x1d74dc),{'verbose':_0x5688bb[_0xa2ece6(0x142)]}),console[_0xa2ece6(0x117)]('Always-on\x20campaign\x20\x27'+_0x1d74dc+'\x27\x20paused\x20successfully'),0x0;}}function a21_0x472b(_0x5eba59,_0x36795d){_0x5eba59=_0x5eba59-0x86;const _0x242bb7=a21_0x242b();let _0x472b27=_0x242bb7[_0x5eba59];return _0x472b27;}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a21_0x1786d2(0xcb)]='engage:always-on-campaign:resume';[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x110);async[a21_0x1786d2(0xfb)](_0x244748){const _0x5a4f13=a21_0x1786d2,{options:_0x466b76,args:_0x2aaafa,tdx:_0x24272b}=_0x244748;if(_0x2aaafa[_0x5a4f13(0x141)]===0x0)return console[_0x5a4f13(0xb5)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x5a4f13(0xb5)](_0x5a4f13(0x125)),0x1;const _0x486707=_0x2aaafa[0x0],_0x3b82dc=_0x466b76,_0x251c4f=await resolveWorkspaceIdFromOptions(_0x3b82dc,_0x24272b,!![]);return await withSpinner(_0x5a4f13(0x122)+_0x486707+_0x5a4f13(0x133),()=>_0x24272b[_0x5a4f13(0x14e)][_0x5a4f13(0xb7)](_0x251c4f,_0x486707),{'verbose':_0x466b76[_0x5a4f13(0x142)]}),console[_0x5a4f13(0x117)]('Always-on\x20campaign\x20\x27'+_0x486707+_0x5a4f13(0x127)),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x11e);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x143);async[a21_0x1786d2(0xfb)](_0x1f0aa2){const _0xa8dc5c=a21_0x1786d2,{options:_0x50ac2c,args:_0x3d2e44,tdx:_0xffc213}=_0x1f0aa2;if(_0x3d2e44[_0xa8dc5c(0x141)]===0x0)return console[_0xa8dc5c(0xb5)](_0xa8dc5c(0xe9)),console['error'](_0xa8dc5c(0x96)),0x1;const _0x93dfe0=_0x3d2e44[0x0],_0x4ed630=_0x50ac2c,_0x48c9fc=await resolveWorkspaceIdFromOptions(_0x4ed630,_0xffc213,!![]);if(!_0x50ac2c[_0xa8dc5c(0x90)]){const _0x467d9e=await confirm(_0xa8dc5c(0xf6)+_0x93dfe0+_0xa8dc5c(0x15b));if(!_0x467d9e)return console[_0xa8dc5c(0x117)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0xa8dc5c(0xf8)+_0x93dfe0+_0xa8dc5c(0x133),()=>_0xffc213[_0xa8dc5c(0x14e)]['finishAlwaysOnCampaign'](_0x48c9fc,_0x93dfe0),{'verbose':_0x50ac2c[_0xa8dc5c(0x142)]}),console['log'](_0xa8dc5c(0xac)+_0x93dfe0+_0xa8dc5c(0xa5)),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a21_0x1786d2(0xcb)]=a21_0x1786d2(0x150);[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x9e);async[a21_0x1786d2(0xfb)](_0x40838d){const _0x549ff2=a21_0x1786d2,{options:_0x3a644f,args:_0x5ec207,tdx:_0x477d3b}=_0x40838d;if(_0x5ec207[_0x549ff2(0x141)]===0x0)return console[_0x549ff2(0xb5)](_0x549ff2(0xe9)),console[_0x549ff2(0xb5)](_0x549ff2(0x95)),0x1;const _0x287936=_0x5ec207[0x0],_0x6dfa68=_0x3a644f,_0x28b01b=await resolveWorkspaceIdFromOptions(_0x6dfa68,_0x477d3b,!![]),_0x2c0e3a=_0x6dfa68[_0x549ff2(0xcb)],_0x57bae3=await withSpinner(_0x549ff2(0xb9)+_0x287936+_0x549ff2(0x133),()=>_0x477d3b[_0x549ff2(0x14e)]['duplicateAlwaysOnCampaign'](_0x28b01b,_0x287936,_0x2c0e3a),{'verbose':_0x3a644f[_0x549ff2(0x142)]});return await handleSDKOutput([_0x57bae3[_0x549ff2(0x147)]],_0x3a644f),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a21_0x1786d2(0xcb)]='engage:workspace:use';[a21_0x1786d2(0xbb)]=a21_0x1786d2(0x8f);async['execute'](_0xd0223b){const _0x5168eb=a21_0x1786d2,{options:_0x4cb82c,args:_0x3afff9,tdx:_0x3bdee7}=_0xd0223b;if(_0x3afff9[_0x5168eb(0x141)]===0x0)return console[_0x5168eb(0xb5)](_0x5168eb(0x155)),console[_0x5168eb(0xb5)](_0x5168eb(0x131)),0x1;const _0x448da7=_0x3afff9[0x0];await withSpinner(_0x5168eb(0x151)+_0x448da7+_0x5168eb(0x133),()=>_0x3bdee7[_0x5168eb(0x14e)][_0x5168eb(0xb3)](_0x448da7));const _0x21896c=_0x4cb82c[_0x5168eb(0x157)]||undefined;return saveSessionContext({'engage_workspace':_0x448da7},_0x21896c),console[_0x5168eb(0x117)]('Engage\x20workspace\x20set\x20to:\x20'+_0x448da7),console[_0x5168eb(0x117)](_0x5168eb(0x11a)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x22b3e0=a22_0x3cf4;(function(_0x271199,_0x2291fd){const _0x4b2bbe=a22_0x3cf4,_0x2f6ded=_0x271199();while(!![]){try{const _0x53f3f6=parseInt(_0x4b2bbe(0xc9))/0x1+parseInt(_0x4b2bbe(0xb8))/0x2*(-parseInt(_0x4b2bbe(0xd3))/0x3)+-parseInt(_0x4b2bbe(0xd9))/0x4*(parseInt(_0x4b2bbe(0xd7))/0x5)+-parseInt(_0x4b2bbe(0xce))/0x6+parseInt(_0x4b2bbe(0xef))/0x7+-parseInt(_0x4b2bbe(0xcf))/0x8+parseInt(_0x4b2bbe(0xd2))/0x9;if(_0x53f3f6===_0x2291fd)break;else _0x2f6ded['push'](_0x2f6ded['shift']());}catch(_0x3de14f){_0x2f6ded['push'](_0x2f6ded['shift']());}}}(a22_0x2f1d,0x4ab6d));function a22_0x3cf4(_0x1e8f6c,_0x58bd0c){_0x1e8f6c=_0x1e8f6c-0xb8;const _0x2f1d0e=a22_0x2f1d();let _0x3cf416=_0x2f1d0e[_0x1e8f6c];return _0x3cf416;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a22_0x2d5bfa from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a22_0x194a3 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';function a22_0x2f1d(){const _0x131c5d=['\x20unchanged\x20files','workspaceName','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','dim','repeat','285890wTBqti','absolutePath','utf-8','engage:template:pull','files','1381008ksCkzx','1818712agVTnA','Aborted.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','4709673PZiuwP','3CAcJJP','Workspace\x20is\x20required.','\x0aError:','session','85QeYdYD','yellow','44584oERbIR','\x0aPull\x20summary\x20for\x20workspace\x20\x27','engage_workspace','length','\x20files\x20to\x20','setPhase','\x20new\x20files','dryRun','-\x20no\x20files\x20written','config','name','yes','red','\x0aChanges\x20to\x20\x27','error','counts','\x20templates','execute','data','filter','workspace','\x20changed\x20files','3733478apBGbY','hasChanges','green','779046WZjBnn','templates','diff','content','✔\x20Pulled\x20','✔\x20Context\x20set:\x20','\x20=\x20','targetDir','\x20files?','isNew','No\x20templates\x20found\x20in\x20workspace\x20\x27','cyan'];a22_0x2f1d=function(){return _0x131c5d;};return a22_0x2f1d();}export class EngageTemplatePullCommand extends BaseCommand{[a22_0x22b3e0(0xe3)]=a22_0x22b3e0(0xcc);['description']='Pull\x20templates\x20to\x20YAML\x20files';async[a22_0x22b3e0(0xea)](_0x2dbf75){const _0x357e09=a22_0x22b3e0,{options:_0x336161,args:_0x4eeecd,tdx:_0x8c771}=_0x2dbf75,_0x533b7b=_0x336161,_0x21a7b4=await resolveWorkspaceName(_0x4eeecd[0x0],_0x533b7b);if(!_0x21a7b4)return console[_0x357e09(0xe7)](a22_0x2d5bfa['yellow'](_0x357e09(0xd4))),console[_0x357e09(0xe7)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console[_0x357e09(0xe7)](_0x357e09(0xc6)),console['error']('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x74db30=await withProgressSpinner('Pulling\x20templates\x20from\x20\x27'+_0x21a7b4+'\x27...',_0x21dc40=>pullTemplates({'engage':_0x8c771['engage']},_0x21a7b4,{'templateName':_0x533b7b['name'],'progress':{'update':_0x420903=>{const _0x5a20b9=_0x357e09;_0x21dc40[_0x5a20b9(0xde)](_0x420903);}}}),{'verbose':_0x533b7b['verbose']}),_0x35c886=_0x74db30[_0x357e09(0xeb)];if(_0x35c886[_0x357e09(0xe8)][_0x357e09(0xb9)]===0x0)return console['error'](a22_0x2d5bfa[_0x357e09(0xd8)](_0x357e09(0xc2)+_0x35c886['workspaceName']+'\x27')),0x0;const _0x4f3328=_0x35c886['files'][_0x357e09(0xec)](_0x127f1d=>_0x127f1d[_0x357e09(0xc1)]),_0x2d62de=_0x35c886[_0x357e09(0xcd)][_0x357e09(0xec)](_0x44bf3f=>!_0x44bf3f[_0x357e09(0xc1)]&&_0x44bf3f[_0x357e09(0xf0)]),_0x5f167=_0x35c886['files'][_0x357e09(0xec)](_0xd81b95=>!_0xd81b95[_0x357e09(0xc1)]&&!_0xd81b95[_0x357e09(0xf0)]);console[_0x357e09(0xe7)](_0x357e09(0xda)+_0x35c886['workspaceName']+'\x27:'),console['error']('\x20\x20'+a22_0x2d5bfa[_0x357e09(0xc3)](_0x35c886['counts'][_0x357e09(0xb9)]+_0x357e09(0xe9))),console[_0x357e09(0xe7)]('\x20\x20'+a22_0x2d5bfa[_0x357e09(0xf1)]('+\x20'+_0x4f3328['length']+_0x357e09(0xdf))),console[_0x357e09(0xe7)]('\x20\x20'+a22_0x2d5bfa[_0x357e09(0xd8)]('~\x20'+_0x2d62de[_0x357e09(0xdc)]+_0x357e09(0xee))),console[_0x357e09(0xe7)]('\x20\x20'+a22_0x2d5bfa[_0x357e09(0xc7)]('=\x20'+_0x5f167[_0x357e09(0xdc)]+_0x357e09(0xc4))),console[_0x357e09(0xe7)]('\x20\x20Target:\x20'+a22_0x2d5bfa[_0x357e09(0xc3)](_0x35c886[_0x357e09(0xbf)])+'\x0a');if(_0x2d62de[_0x357e09(0xdc)]>0x0)for(const _0x1b8a04 of _0x2d62de){console[_0x357e09(0xe7)](_0x357e09(0xe6)+_0x1b8a04['relativePath']+'\x27:'),console[_0x357e09(0xe7)]('─'[_0x357e09(0xc8)](0x3c)),console['error'](_0x1b8a04[_0x357e09(0xba)]),console[_0x357e09(0xe7)]('─'[_0x357e09(0xc8)](0x3c));}if(_0x533b7b[_0x357e09(0xe0)])return console[_0x357e09(0xe7)](a22_0x2d5bfa[_0x357e09(0xd8)](_0x357e09(0xd1))),0x0;if(_0x4f3328[_0x357e09(0xdc)]===0x0&&_0x2d62de[_0x357e09(0xdc)]===0x0)return console[_0x357e09(0xe7)](a22_0x2d5bfa[_0x357e09(0xf1)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x35c886[_0x357e09(0xc5)]},_0x533b7b[_0x357e09(0xd6)]),0x0;if(!_0x533b7b[_0x357e09(0xe4)]){if(!isInteractive())return console[_0x357e09(0xe7)](a22_0x2d5bfa[_0x357e09(0xe5)](_0x357e09(0xd5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x357e09(0xe7)](a22_0x2d5bfa['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x15098c=await confirmKey('Write\x20'+(_0x4f3328[_0x357e09(0xdc)]+_0x2d62de[_0x357e09(0xdc)])+_0x357e09(0xc0));if(!_0x15098c)return console[_0x357e09(0xe7)](a22_0x2d5bfa[_0x357e09(0xd8)](_0x357e09(0xd0)),_0x357e09(0xe1)),0x1;}for(const _0x3100f3 of _0x35c886[_0x357e09(0xcd)]){if(_0x3100f3[_0x357e09(0xc1)]||_0x3100f3['hasChanges']){const _0x5bd713=a22_0x194a3['dirname'](_0x3100f3[_0x357e09(0xca)]);!existsSync(_0x5bd713)&&mkdirSync(_0x5bd713,{'recursive':!![]}),writeFileSync(_0x3100f3['absolutePath'],_0x3100f3[_0x357e09(0xbb)],_0x357e09(0xcb));}}return console['error'](a22_0x2d5bfa['green'](_0x357e09(0xbc)+(_0x4f3328[_0x357e09(0xdc)]+_0x2d62de['length'])+_0x357e09(0xdd)+_0x35c886['targetDir'])),saveSessionContext({'engage_workspace':_0x35c886[_0x357e09(0xc5)]},_0x533b7b[_0x357e09(0xd6)]),console['error'](a22_0x2d5bfa['green'](_0x357e09(0xbd)+a22_0x2d5bfa[_0x357e09(0xc7)](_0x357e09(0xdb))+_0x357e09(0xbe)+a22_0x2d5bfa['cyan'](_0x35c886[_0x357e09(0xc5)]))),0x0;}}async function resolveWorkspaceName(_0x378d9a,_0x28bdf8){const _0x17adef=a22_0x22b3e0;if(_0x378d9a)return _0x378d9a;if(_0x28bdf8['workspace'])return _0x28bdf8[_0x17adef(0xed)];const _0x5f33de=tryFindTdxConfig(process['cwd']());if(_0x5f33de?.[_0x17adef(0xe2)][_0x17adef(0xdb)])return _0x5f33de[_0x17adef(0xe2)][_0x17adef(0xdb)];const _0x1b746f=loadSessionContext(_0x28bdf8[_0x17adef(0xd6)]);if(_0x1b746f?.[_0x17adef(0xdb)])return _0x1b746f['engage_workspace'];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x80971=a23_0x5dbd;function a23_0x5dbd(_0x143d12,_0x18350b){_0x143d12=_0x143d12-0xe1;const _0x38dddb=a23_0x38dd();let _0x5dbda3=_0x38dddb[_0x143d12];return _0x5dbda3;}(function(_0x1e89ad,_0x191ac7){const _0x491433=a23_0x5dbd,_0x995438=_0x1e89ad();while(!![]){try{const _0x4a4ee2=-parseInt(_0x491433(0x128))/0x1+parseInt(_0x491433(0x10b))/0x2*(-parseInt(_0x491433(0xfd))/0x3)+-parseInt(_0x491433(0x106))/0x4*(parseInt(_0x491433(0xfb))/0x5)+parseInt(_0x491433(0xfc))/0x6+-parseInt(_0x491433(0xed))/0x7*(parseInt(_0x491433(0xe7))/0x8)+-parseInt(_0x491433(0xe5))/0x9*(-parseInt(_0x491433(0xe1))/0xa)+parseInt(_0x491433(0x119))/0xb*(parseInt(_0x491433(0x109))/0xc);if(_0x4a4ee2===_0x191ac7)break;else _0x995438['push'](_0x995438['shift']());}catch(_0x129110){_0x995438['push'](_0x995438['shift']());}}}(a23_0x38dd,0xf1828));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a23_0x5cede8 from'chalk';function a23_0x38dd(){const _0x575477=['valid','session','workspace','resolve','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','Resolving\x20references...','templateId','cyan','100yOYaWI','9217290bRuYXS','1622769pCTzei','✔\x20Updated\x20','dim','\x20\x20\x20\x20','config','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','error','engage_workspace','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','141340WUFetC','\x20templates\x20to\x20update:','engage','521484JlGbtV','results','2lnsrJd','execute','\x0aPush\x20summary\x20for\x20workspace\x20\x27','errors','green','Pushing\x20templates...','site','-\x20no\x20changes\x20applied','\x0aValidation\x20errors\x20in\x20','update','✔\x20Created\x20','✔\x20All\x20templates\x20are\x20up\x20to\x20date','dirname','engage:template:push','561WtbXYx','relativePath','action','updated','length','red','warnings','filter','No\x20template\x20YAML\x20files\x20found\x20in\x20','verbose','resolveWorkspaceId','def','setPhase','description','message','1024106rCdZWL','10HqFgta','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','data','Found\x20','1142226IoXUhX','\x20new\x20templates:','170616PWkwSS','Aborted.','\x20templates','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','yellow','path','203dutXgT','created','\x20errors:','1\x20template\x20file:\x20','\x27...'];a23_0x38dd=function(){return _0x575477;};return a23_0x38dd();}import a23_0x138b6b from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']=a23_0x80971(0x118);[a23_0x80971(0x126)]=a23_0x80971(0x102);async[a23_0x80971(0x10c)](_0x497c94){const _0x408bb1=a23_0x80971,{options:_0x1773d5,args:_0xd6763,tdx:_0x5e31c3}=_0x497c94,_0x28f034=_0x1773d5,_0x54c156=_0xd6763[0x0],_0x1d9b6f=_0x54c156?a23_0x138b6b[_0x408bb1(0xf5)](_0x54c156):undefined,_0xea1df3=_0x1d9b6f?isYamlFile(_0x1d9b6f):![];let _0x54051f;if(_0xea1df3&&_0x1d9b6f)_0x54051f=a23_0x138b6b[_0x408bb1(0x117)](_0x1d9b6f);else _0x1d9b6f?_0x54051f=_0x1d9b6f:_0x54051f=process['cwd']();let _0x327cae;const _0x4d6f61=tryFindTdxConfig(_0x54051f);_0x4d6f61?.['config'][_0x408bb1(0x104)]&&(_0x327cae=_0x4d6f61[_0x408bb1(0x101)][_0x408bb1(0x104)],!_0xea1df3&&(_0x54051f=_0x4d6f61['configDir']));_0x28f034[_0x408bb1(0xf4)]&&(_0x327cae=_0x28f034[_0x408bb1(0xf4)]);if(!_0x327cae){const _0x363b91=loadSessionContext(_0x28f034['session']);_0x363b91?.['engage_workspace']&&(_0x327cae=_0x363b91[_0x408bb1(0x104)]);}if(!_0x327cae)return console[_0x408bb1(0x103)](a23_0x5cede8[_0x408bb1(0xeb)]('Workspace\x20is\x20required.')),console[_0x408bb1(0x103)]('\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console[_0x408bb1(0x103)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console[_0x408bb1(0x103)](_0x408bb1(0x105)),console[_0x408bb1(0x103)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x585b99;_0xea1df3&&_0x1d9b6f?_0x585b99=[parseTemplateFile(_0x1d9b6f,a23_0x138b6b['dirname'](_0x1d9b6f))]:_0x585b99=discoverAndParseTemplateFiles(_0x54051f);if(_0x585b99['length']===0x0)return console[_0x408bb1(0x103)](a23_0x5cede8[_0x408bb1(0xeb)](_0x408bb1(0x121)+_0x54051f)),console['error'](a23_0x5cede8[_0x408bb1(0xff)]('Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.')),0x1;const _0x56f7f0=_0x585b99[_0x408bb1(0x11d)]===0x1?_0x408bb1(0xf0)+_0x585b99[0x0][_0x408bb1(0x124)]['name']:_0x585b99[_0x408bb1(0x11d)]+'\x20template\x20files';console[_0x408bb1(0x103)](_0x408bb1(0xe4)+a23_0x5cede8[_0x408bb1(0xfa)](_0x56f7f0));let _0x35b0e9=![];for(const _0x5723dd of _0x585b99){const _0x476894=validateTemplateDef(_0x5723dd[_0x408bb1(0x124)]);if(!_0x476894[_0x408bb1(0xf2)]){_0x35b0e9=!![],console[_0x408bb1(0x103)](a23_0x5cede8[_0x408bb1(0x11e)](_0x408bb1(0x113)+_0x5723dd[_0x408bb1(0x11a)]+':'));for(const _0x2910be of _0x476894[_0x408bb1(0x10e)]){console[_0x408bb1(0x103)]('\x20\x20'+a23_0x5cede8[_0x408bb1(0x11e)]('✗')+'\x20'+_0x2910be[_0x408bb1(0xec)]+':\x20'+_0x2910be[_0x408bb1(0x127)]);}}for(const _0x5144dc of _0x476894[_0x408bb1(0x11f)]){console[_0x408bb1(0x103)]('\x20\x20'+a23_0x5cede8[_0x408bb1(0xeb)]('⚠')+'\x20'+_0x5144dc[_0x408bb1(0xec)]+':\x20'+_0x5144dc['message']);}}if(_0x35b0e9)return console[_0x408bb1(0x103)](a23_0x5cede8[_0x408bb1(0x11e)](_0x408bb1(0xea))),0x1;const _0x1fa79c=await _0x5e31c3[_0x408bb1(0x108)][_0x408bb1(0x123)](_0x327cae),_0x4cf7c5=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x327cae+_0x408bb1(0xf1),_0x15f408=>preparePush({'engage':_0x5e31c3[_0x408bb1(0x108)]},_0x585b99,_0x1fa79c,{'progress':{'update':_0x1b3b3e=>_0x15f408[_0x408bb1(0x125)](_0x1b3b3e)}}),{'verbose':_0x28f034[_0x408bb1(0x122)]}),_0x1a9ffc=_0x4cf7c5['data'];await withProgressSpinner(_0x408bb1(0xf8),_0x89e491=>resolveAndBuildInputs({'engage':_0x5e31c3[_0x408bb1(0x108)]},_0x1a9ffc,_0x1fa79c,{'progress':{'update':_0x49144c=>_0x89e491[_0x408bb1(0x125)](_0x49144c)}}),{'verbose':_0x28f034[_0x408bb1(0x122)]});const _0x247bbd=_0x1a9ffc[_0x408bb1(0x120)](_0x428aec=>_0x428aec[_0x408bb1(0x11b)]==='create'),_0x48ea43=_0x1a9ffc[_0x408bb1(0x120)](_0x2a73e6=>_0x2a73e6[_0x408bb1(0x11b)]===_0x408bb1(0x114));console[_0x408bb1(0x103)](_0x408bb1(0x10d)+_0x327cae+'\x27:');if(_0x247bbd[_0x408bb1(0x11d)]>0x0){console[_0x408bb1(0x103)]('\x20\x20'+a23_0x5cede8[_0x408bb1(0x10f)]('+\x20'+_0x247bbd[_0x408bb1(0x11d)]+_0x408bb1(0xe6)));for(const _0x35fcde of _0x247bbd){console[_0x408bb1(0x103)](_0x408bb1(0x100)+a23_0x5cede8['green']('+')+'\x20'+_0x35fcde[_0x408bb1(0x124)][_0x408bb1(0xf7)]);}}if(_0x48ea43[_0x408bb1(0x11d)]>0x0){console[_0x408bb1(0x103)]('\x20\x20'+a23_0x5cede8[_0x408bb1(0xeb)]('~\x20'+_0x48ea43[_0x408bb1(0x11d)]+_0x408bb1(0x107)));for(const _0x342d13 of _0x48ea43){console[_0x408bb1(0x103)](_0x408bb1(0x100)+a23_0x5cede8[_0x408bb1(0xeb)]('~')+'\x20'+_0x342d13[_0x408bb1(0x124)][_0x408bb1(0xf7)]);}}if(_0x247bbd[_0x408bb1(0x11d)]===0x0&&_0x48ea43['length']===0x0)return console[_0x408bb1(0x103)](a23_0x5cede8[_0x408bb1(0x10f)](_0x408bb1(0x116))),0x0;if(_0x28f034['dryRun'])return console['error'](a23_0x5cede8[_0x408bb1(0xeb)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x28f034['yes']){if(!isInteractive())return console[_0x408bb1(0x103)](a23_0x5cede8['red']('\x0aError:'),_0x408bb1(0xe2)),console[_0x408bb1(0x103)](a23_0x5cede8[_0x408bb1(0xff)](_0x408bb1(0xf6))),0x1;const _0x1fb12d=await confirmKey('Push\x20'+(_0x247bbd[_0x408bb1(0x11d)]+_0x48ea43[_0x408bb1(0x11d)])+'\x20templates?');if(!_0x1fb12d)return console[_0x408bb1(0x103)](a23_0x5cede8[_0x408bb1(0xeb)](_0x408bb1(0xe8)),_0x408bb1(0x112)),0x1;}const _0x2f2a3d=await withProgressSpinner(_0x408bb1(0x110),_0x3f88bd=>executePush({'engage':_0x5e31c3[_0x408bb1(0x108)]},_0x1a9ffc,{'progress':{'update':_0x34f6da=>_0x3f88bd[_0x408bb1(0x125)](_0x34f6da)}}),{'verbose':_0x28f034['verbose']}),_0x5713e1=_0x2f2a3d[_0x408bb1(0xe3)];for(const _0x5504c4 of _0x5713e1[_0x408bb1(0x10a)]){if(_0x5504c4[_0x408bb1(0xf9)]&&(_0x5504c4[_0x408bb1(0x11b)]===_0x408bb1(0xee)||_0x5504c4[_0x408bb1(0x11b)]==='updated')){const _0x55e3de=getTemplateUrl(_0x28f034[_0x408bb1(0x111)],_0x1fa79c,_0x5504c4[_0x408bb1(0xf9)]),_0x18e909=_0x5504c4[_0x408bb1(0x11b)]===_0x408bb1(0xee)?'+':'~',_0x3e1b38=_0x5504c4['action']==='created'?a23_0x5cede8[_0x408bb1(0x10f)](_0x18e909):a23_0x5cede8[_0x408bb1(0xeb)](_0x18e909);console['error']('\x20\x20'+_0x3e1b38+'\x20'+hyperlink(_0x5504c4['name'],_0x55e3de)+'\x20'+a23_0x5cede8['dim'](_0x55e3de));}}_0x5713e1[_0x408bb1(0xee)]>0x0&&console['error'](a23_0x5cede8[_0x408bb1(0x10f)](_0x408bb1(0x115)+_0x5713e1[_0x408bb1(0xee)]+_0x408bb1(0xe9)));_0x5713e1[_0x408bb1(0x11c)]>0x0&&console[_0x408bb1(0x103)](a23_0x5cede8[_0x408bb1(0x10f)](_0x408bb1(0xfe)+_0x5713e1[_0x408bb1(0x11c)]+_0x408bb1(0xe9)));if(_0x5713e1['errors'][_0x408bb1(0x11d)]>0x0){console['error'](a23_0x5cede8['red']('✘\x20'+_0x5713e1[_0x408bb1(0x10e)][_0x408bb1(0x11d)]+_0x408bb1(0xef)));for(const _0x58c943 of _0x5713e1['errors']){console[_0x408bb1(0x103)]('\x20\x20'+a23_0x5cede8[_0x408bb1(0x11e)](_0x58c943['name'])+':\x20'+_0x58c943[_0x408bb1(0x103)]);}}return saveSessionContext({'engage_workspace':_0x327cae},_0x28f034[_0x408bb1(0xf3)]),_0x5713e1[_0x408bb1(0x10e)]['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a23_0x523569=a23_0x503f;(function(_0x18ced6,_0x512ba4){const _0x92a5f7=a23_0x503f,_0x291a42=_0x18ced6();while(!![]){try{const _0x43de3f=parseInt(_0x92a5f7(0x1f2))/0x1+parseInt(_0x92a5f7(0x200))/0x2+-parseInt(_0x92a5f7(0x20b))/0x3+parseInt(_0x92a5f7(0x1d4))/0x4+-parseInt(_0x92a5f7(0x1fd))/0x5+parseInt(_0x92a5f7(0x1ce))/0x6+parseInt(_0x92a5f7(0x1ed))/0x7*(-parseInt(_0x92a5f7(0x1e2))/0x8);if(_0x43de3f===_0x512ba4)break;else _0x291a42['push'](_0x291a42['shift']());}catch(_0x385119){_0x291a42['push'](_0x291a42['shift']());}}}(a23_0x1440,0x66e75));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a23_0x1440(){const _0x281d18=['\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','✔\x20All\x20templates\x20are\x20up\x20to\x20date','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','dim','templateId','\x20\x20\x20\x20','valid','resolve','created','16FtZkkd','updated','engage','resolveWorkspaceId','error','\x20templates?','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','message','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','session','length','2790557MLOWTy','engage_workspace','Found\x20','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','engage:template:push','42866eGubwI','config','errors','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x20template\x20files','Aborted.','relativePath','\x20templates','Resolving\x20references...','\x20errors:','name','256495YJCKcI','dirname','results','163122BHmmcn','dryRun','path','\x20templates\x20to\x20update:','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','yellow','Push\x20','Workspace\x20is\x20required.','✔\x20Created\x20','verbose','def','90105atgHZH','description','filter','warnings','cyan','action','red','configDir','2640462zeGMJh','data','create','No\x20template\x20YAML\x20files\x20found\x20in\x20','yes','setPhase','2942500ZXKUTg','✔\x20Updated\x20'];a23_0x1440=function(){return _0x281d18;};return a23_0x1440();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a23_0x174b0d from'chalk';import a23_0x5ecad0 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';function a23_0x503f(_0x55afbc,_0x1e2897){_0x55afbc=_0x55afbc-0x1ce;const _0x144055=a23_0x1440();let _0x503f7a=_0x144055[_0x55afbc];return _0x503f7a;}import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a23_0x523569(0x1fc)]=a23_0x523569(0x1f1);[a23_0x523569(0x20c)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async['execute'](_0x587fc6){const _0x306345=a23_0x523569,{options:_0x1b3f58,args:_0x1d0472,tdx:_0xfb930f}=_0x587fc6,_0x8560c3=_0x1b3f58,_0x2975a8=_0x1d0472[0x0],_0x272315=_0x2975a8?a23_0x5ecad0[_0x306345(0x1e0)](_0x2975a8):undefined,_0x8f5167=_0x272315?isYamlFile(_0x272315):![];let _0x555ecf;if(_0x8f5167&&_0x272315)_0x555ecf=a23_0x5ecad0[_0x306345(0x1fe)](_0x272315);else _0x272315?_0x555ecf=_0x272315:_0x555ecf=process['cwd']();let _0x446de4;const _0x4a6d19=tryFindTdxConfig(_0x555ecf);_0x4a6d19?.[_0x306345(0x1f3)][_0x306345(0x1ee)]&&(_0x446de4=_0x4a6d19[_0x306345(0x1f3)][_0x306345(0x1ee)],!_0x8f5167&&(_0x555ecf=_0x4a6d19[_0x306345(0x212)]));_0x8560c3['workspace']&&(_0x446de4=_0x8560c3['workspace']);if(!_0x446de4){const _0x490747=loadSessionContext(_0x8560c3[_0x306345(0x1eb)]);_0x490747?.[_0x306345(0x1ee)]&&(_0x446de4=_0x490747[_0x306345(0x1ee)]);}if(!_0x446de4)return console['error'](a23_0x174b0d[_0x306345(0x205)](_0x306345(0x207))),console[_0x306345(0x1e6)](_0x306345(0x1ea)),console[_0x306345(0x1e6)](_0x306345(0x1db)),console['error'](_0x306345(0x204)),console[_0x306345(0x1e6)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x5ddefc;_0x8f5167&&_0x272315?_0x5ddefc=[parseTemplateFile(_0x272315,a23_0x5ecad0['dirname'](_0x272315))]:_0x5ddefc=discoverAndParseTemplateFiles(_0x555ecf);if(_0x5ddefc[_0x306345(0x1ec)]===0x0)return console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x205)](_0x306345(0x1d1)+_0x555ecf)),console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x1dc)](_0x306345(0x1e8))),0x1;const _0x5d5281=_0x5ddefc[_0x306345(0x1ec)]===0x1?'1\x20template\x20file:\x20'+_0x5ddefc[0x0]['def'][_0x306345(0x1fc)]:_0x5ddefc[_0x306345(0x1ec)]+_0x306345(0x1f6);console[_0x306345(0x1e6)](_0x306345(0x1ef)+a23_0x174b0d[_0x306345(0x20f)](_0x5d5281));let _0x234c51=![];for(const _0x4dd690 of _0x5ddefc){const _0x25ab8f=validateTemplateDef(_0x4dd690[_0x306345(0x20a)]);if(!_0x25ab8f[_0x306345(0x1df)]){_0x234c51=!![],console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x211)]('\x0aValidation\x20errors\x20in\x20'+_0x4dd690[_0x306345(0x1f8)]+':'));for(const _0x10c52b of _0x25ab8f[_0x306345(0x1f4)]){console[_0x306345(0x1e6)]('\x20\x20'+a23_0x174b0d[_0x306345(0x211)]('✗')+'\x20'+_0x10c52b[_0x306345(0x202)]+':\x20'+_0x10c52b[_0x306345(0x1e9)]);}}for(const _0x108c4f of _0x25ab8f[_0x306345(0x20e)]){console[_0x306345(0x1e6)]('\x20\x20'+a23_0x174b0d[_0x306345(0x205)]('⚠')+'\x20'+_0x108c4f['path']+':\x20'+_0x108c4f[_0x306345(0x1e9)]);}}if(_0x234c51)return console[_0x306345(0x1e6)](a23_0x174b0d['red'](_0x306345(0x1f0))),0x1;const _0x24e525=await _0xfb930f[_0x306345(0x1e4)][_0x306345(0x1e5)](_0x446de4),_0xb9c663=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x446de4+'\x27...',_0x3c4f65=>preparePush({'engage':_0xfb930f[_0x306345(0x1e4)]},_0x5ddefc,_0x24e525,{'progress':{'update':_0x390e28=>_0x3c4f65['setPhase'](_0x390e28)}}),{'verbose':_0x8560c3[_0x306345(0x209)]}),_0x358aa2=_0xb9c663[_0x306345(0x1cf)];await withProgressSpinner(_0x306345(0x1fa),_0x47e782=>resolveAndBuildInputs({'engage':_0xfb930f[_0x306345(0x1e4)]},_0x358aa2,_0x24e525,{'progress':{'update':_0x58ef63=>_0x47e782[_0x306345(0x1d3)](_0x58ef63)}}),{'verbose':_0x8560c3[_0x306345(0x209)]});const _0x374416=_0x358aa2[_0x306345(0x20d)](_0x503208=>_0x503208[_0x306345(0x210)]===_0x306345(0x1d0)),_0x2d7339=_0x358aa2[_0x306345(0x20d)](_0x2309d2=>_0x2309d2[_0x306345(0x210)]==='update');console[_0x306345(0x1e6)](_0x306345(0x1f5)+_0x446de4+'\x27:');if(_0x374416[_0x306345(0x1ec)]>0x0){console[_0x306345(0x1e6)]('\x20\x20'+a23_0x174b0d['green']('+\x20'+_0x374416[_0x306345(0x1ec)]+'\x20new\x20templates:'));for(const _0x48867d of _0x374416){console['error'](_0x306345(0x1de)+a23_0x174b0d[_0x306345(0x1d8)]('+')+'\x20'+_0x48867d[_0x306345(0x20a)][_0x306345(0x1fc)]);}}if(_0x2d7339[_0x306345(0x1ec)]>0x0){console[_0x306345(0x1e6)]('\x20\x20'+a23_0x174b0d['yellow']('~\x20'+_0x2d7339[_0x306345(0x1ec)]+_0x306345(0x203)));for(const _0x9d0723 of _0x2d7339){console['error'](_0x306345(0x1de)+a23_0x174b0d[_0x306345(0x205)]('~')+'\x20'+_0x9d0723['def'][_0x306345(0x1fc)]);}}if(_0x374416[_0x306345(0x1ec)]===0x0&&_0x2d7339[_0x306345(0x1ec)]===0x0)return console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x1d8)](_0x306345(0x1d9))),0x0;if(_0x8560c3[_0x306345(0x201)])return console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x205)](_0x306345(0x1d6))),0x0;if(!_0x8560c3[_0x306345(0x1d2)]){if(!isInteractive())return console[_0x306345(0x1e6)](a23_0x174b0d['red'](_0x306345(0x1da)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x1dc)](_0x306345(0x1d7))),0x1;const _0x519e90=await confirmKey(_0x306345(0x206)+(_0x374416[_0x306345(0x1ec)]+_0x2d7339[_0x306345(0x1ec)])+_0x306345(0x1e7));if(!_0x519e90)return console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x205)](_0x306345(0x1f7)),'-\x20no\x20changes\x20applied'),0x1;}const _0x4e93d1=await withProgressSpinner('Pushing\x20templates...',_0x35d246=>executePush({'engage':_0xfb930f['engage']},_0x358aa2,{'progress':{'update':_0x2ffd61=>_0x35d246[_0x306345(0x1d3)](_0x2ffd61)}}),{'verbose':_0x8560c3[_0x306345(0x209)]}),_0x57a9f6=_0x4e93d1['data'];for(const _0x1ad39f of _0x57a9f6[_0x306345(0x1ff)]){if(_0x1ad39f[_0x306345(0x1dd)]&&(_0x1ad39f[_0x306345(0x210)]===_0x306345(0x1e1)||_0x1ad39f[_0x306345(0x210)]===_0x306345(0x1e3))){const _0x4659b6=getTemplateUrl(_0x8560c3['site'],_0x24e525,_0x1ad39f[_0x306345(0x1dd)]),_0x4da8c1=_0x1ad39f[_0x306345(0x210)]===_0x306345(0x1e1)?'+':'~',_0x2e3528=_0x1ad39f[_0x306345(0x210)]===_0x306345(0x1e1)?a23_0x174b0d[_0x306345(0x1d8)](_0x4da8c1):a23_0x174b0d[_0x306345(0x205)](_0x4da8c1);console[_0x306345(0x1e6)]('\x20\x20'+_0x2e3528+'\x20'+hyperlink(_0x1ad39f['name'],_0x4659b6)+'\x20'+a23_0x174b0d[_0x306345(0x1dc)](_0x4659b6));}}_0x57a9f6[_0x306345(0x1e1)]>0x0&&console[_0x306345(0x1e6)](a23_0x174b0d['green'](_0x306345(0x208)+_0x57a9f6[_0x306345(0x1e1)]+_0x306345(0x1f9)));_0x57a9f6[_0x306345(0x1e3)]>0x0&&console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x1d8)](_0x306345(0x1d5)+_0x57a9f6[_0x306345(0x1e3)]+_0x306345(0x1f9)));if(_0x57a9f6[_0x306345(0x1f4)]['length']>0x0){console[_0x306345(0x1e6)](a23_0x174b0d[_0x306345(0x211)]('✘\x20'+_0x57a9f6[_0x306345(0x1f4)][_0x306345(0x1ec)]+_0x306345(0x1fb)));for(const _0x33b507 of _0x57a9f6['errors']){console['error']('\x20\x20'+a23_0x174b0d['red'](_0x33b507[_0x306345(0x1fc)])+':\x20'+_0x33b507[_0x306345(0x1e6)]);}}return saveSessionContext({'engage_workspace':_0x446de4},_0x8560c3[_0x306345(0x1eb)]),_0x57a9f6[_0x306345(0x1f4)][_0x306345(0x1ec)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x38362a=a24_0x37e7;(function(_0x4d0b65,_0x357a95){const _0x545533=a24_0x37e7,_0x2e86c1=_0x4d0b65();while(!![]){try{const _0x26512c=parseInt(_0x545533(0x1af))/0x1+parseInt(_0x545533(0x1cf))/0x2+-parseInt(_0x545533(0x1d2))/0x3*(-parseInt(_0x545533(0x1c9))/0x4)+parseInt(_0x545533(0x1ba))/0x5*(parseInt(_0x545533(0x1a6))/0x6)+-parseInt(_0x545533(0x1ce))/0x7*(-parseInt(_0x545533(0x1c5))/0x8)+-parseInt(_0x545533(0x1d4))/0x9+-parseInt(_0x545533(0x1a9))/0xa;if(_0x26512c===_0x357a95)break;else _0x2e86c1['push'](_0x2e86c1['shift']());}catch(_0x15d1d3){_0x2e86c1['push'](_0x2e86c1['shift']());}}}(a24_0x292e,0x6a1b4));import{BaseCommand}from'./command.js';function a24_0x37e7(_0x42b209,_0x410d08){_0x42b209=_0x42b209-0x1a5;const _0x292ef5=a24_0x292e();let _0x37e77f=_0x292ef5[_0x42b209];return _0x37e77f;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a24_0x27e262 from'chalk';import a24_0x56868c from'path';function a24_0x292e(){const _0x1ff758=['918916zKJLAp','red','length','717MkaNDC','Validate\x20template\x20YAML\x20files','4741137bioTYi','.yml','warningCount','invalidCount','35262ILWZYO','\x20template(s)\x20with\x20errors,\x20','\x20non-template\x20file(s)\x20skipped)','17644860pETUAU','reason','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','template','relativePath','769014vxlDTu','yellow','skippedCount','valid','✔\x20All\x20','\x20error(s)','\x20warning(s)','\x20template(s)\x20valid','cwd','.yaml','description','155ZxKmij','errors','\x20(skipped:\x20','validCount','filter','error','execute','hasErrors','warnings','engage:template:validate','\x20non-template\x20file(s)\x20skipped','64400LbadQo','log','endsWith','\x20valid','9752yVJcLd','Validation\x20failed:\x20','dim','green','dirname','637YeUGbB'];a24_0x292e=function(){return _0x1ff758;};return a24_0x292e();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a24_0x38362a(0x1c3);[a24_0x38362a(0x1b9)]=a24_0x38362a(0x1d3);async[a24_0x38362a(0x1c0)](_0x397491){const _0x514df2=a24_0x38362a,{options:_0x1fcf84,args:_0xf86167}=_0x397491,_0x4e91f8=_0x1fcf84,_0x25641b=_0xf86167[0x0],_0xc42ef=_0x25641b?a24_0x56868c['resolve'](_0x25641b):undefined,_0x4e9685=_0xc42ef?isYamlFile(_0xc42ef):![];let _0x4e5ba7,_0x43986b;if(_0x4e9685&&_0xc42ef)_0x4e5ba7=a24_0x56868c[_0x514df2(0x1cd)](_0xc42ef),_0x43986b=_0xc42ef;else _0xc42ef?_0x4e5ba7=_0xc42ef:_0x4e5ba7=process[_0x514df2(0x1b7)]();if(!_0x43986b&&!existsSync(_0x4e5ba7))return console[_0x514df2(0x1bf)](a24_0x27e262[_0x514df2(0x1d0)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4e5ba7+'\x0a')),0x1;let _0x5ac192;if(_0x43986b){if(!_0x43986b[_0x514df2(0x1c7)](_0x514df2(0x1d5))&&!_0x43986b[_0x514df2(0x1c7)](_0x514df2(0x1b8)))return console[_0x514df2(0x1bf)](a24_0x27e262['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x43986b+'\x0a')),0x1;_0x5ac192=[_0x43986b];}else _0x5ac192=findYamlFiles(_0x4e5ba7);if(_0x5ac192['length']===0x0)return console['error'](a24_0x27e262[_0x514df2(0x1d0)](_0x514df2(0x1ab)+_0x4e5ba7+'\x0a')),0x1;const _0x32d36e=validateYamlFiles(_0x5ac192,_0x4e5ba7,{'filterType':_0x514df2(0x1ad)}),_0x34e0c0=calculateSummary(_0x32d36e),_0x4fa69d=_0x32d36e[_0x514df2(0x1be)](isValidationResult);if(_0x4fa69d[_0x514df2(0x1d1)]===0x0)return console[_0x514df2(0x1bf)](a24_0x27e262[_0x514df2(0x1b0)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x4e5ba7+'\x0a')),_0x34e0c0['skippedCount']>0x0&&console[_0x514df2(0x1bf)](a24_0x27e262['dim']('('+_0x34e0c0[_0x514df2(0x1b1)]+_0x514df2(0x1a8))),0x0;for(const _0x218486 of _0x32d36e){if(!isValidationResult(_0x218486)){_0x4e91f8['verbose']&&console['log'](a24_0x27e262[_0x514df2(0x1cb)]('-\x20'+_0x218486[_0x514df2(0x1ae)]+_0x514df2(0x1bc)+_0x218486[_0x514df2(0x1aa)]+')'));continue;}const {relativePath:_0x1f1551,source:_0x5d4cd1,result:_0x35bf1e}=_0x218486;if(_0x35bf1e[_0x514df2(0x1b2)]&&_0x35bf1e['warnings'][_0x514df2(0x1d1)]===0x0)_0x4e91f8['verbose']&&console[_0x514df2(0x1c6)](a24_0x27e262['green']('✔\x20'+_0x1f1551));else _0x35bf1e[_0x514df2(0x1b2)]?(console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1b0)]('⚠\x20'+_0x1f1551+':\x20'+_0x35bf1e[_0x514df2(0x1c2)]['length']+_0x514df2(0x1b5))),console[_0x514df2(0x1c6)](formatValidationResult(_0x35bf1e,_0x5d4cd1,_0x1f1551))):(console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1d0)]('✖\x20'+_0x1f1551+':\x20'+_0x35bf1e[_0x514df2(0x1bb)][_0x514df2(0x1d1)]+_0x514df2(0x1b4))),console['log'](formatValidationResult(_0x35bf1e,_0x5d4cd1,_0x1f1551)));}return console[_0x514df2(0x1c6)](''),_0x34e0c0[_0x514df2(0x1c1)]?(console[_0x514df2(0x1c6)](a24_0x27e262['red'](_0x514df2(0x1ca)+_0x34e0c0[_0x514df2(0x1a5)]+_0x514df2(0x1a7)+_0x34e0c0[_0x514df2(0x1bd)]+_0x514df2(0x1c8))),_0x34e0c0['warningCount']>0x0&&console['log'](a24_0x27e262[_0x514df2(0x1b0)](_0x34e0c0[_0x514df2(0x1d6)]+_0x514df2(0x1ac))),_0x34e0c0[_0x514df2(0x1b1)]>0x0&&console[_0x514df2(0x1c6)](a24_0x27e262['dim'](_0x34e0c0[_0x514df2(0x1b1)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1cc)](_0x514df2(0x1b3)+_0x34e0c0[_0x514df2(0x1bd)]+_0x514df2(0x1b6))),_0x34e0c0[_0x514df2(0x1d6)]>0x0&&console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1b0)](_0x34e0c0[_0x514df2(0x1d6)]+_0x514df2(0x1ac))),_0x34e0c0[_0x514df2(0x1b1)]>0x0&&console[_0x514df2(0x1c6)](a24_0x27e262[_0x514df2(0x1cb)](_0x34e0c0['skippedCount']+_0x514df2(0x1c4))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x1cf8f2=a25_0x4daf;(function(_0x498f5c,_0x5300fd){const _0x43d364=a25_0x4daf,_0x5ea309=_0x498f5c();while(!![]){try{const _0x376e60=-parseInt(_0x43d364(0x166))/0x1+parseInt(_0x43d364(0x1aa))/0x2+parseInt(_0x43d364(0x1b7))/0x3*(parseInt(_0x43d364(0x16e))/0x4)+parseInt(_0x43d364(0x190))/0x5*(parseInt(_0x43d364(0x180))/0x6)+-parseInt(_0x43d364(0x191))/0x7*(parseInt(_0x43d364(0x1a5))/0x8)+-parseInt(_0x43d364(0x1a8))/0x9*(-parseInt(_0x43d364(0x182))/0xa)+-parseInt(_0x43d364(0x17d))/0xb;if(_0x376e60===_0x5300fd)break;else _0x5ea309['push'](_0x5ea309['shift']());}catch(_0x1acc68){_0x5ea309['push'](_0x5ea309['shift']());}}}(a25_0x5d1f,0x9cc49));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a25_0x5d1f(){const _0xf937b8=['jobType','List\x20jobs','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','job_id','Submit\x20a\x20job','Job\x20type:\x20','abs','No\x20SQL\x20statements\x20found\x20in\x20file','Show\x20job\x20details','user_name','\x27\x20to\x20verify\x20the\x20job\x20status','kill','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','2702722jaaHWI','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','3569454cWqNSE','dim','6430NEMrPv','log','red','Get\x20job\x20results','verbose','debug','substring','Submitting\x20job...','database','priority','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job:result','round','just\x20now','5sscUaS','7xvKuzj','yes','trino','Query:\x20','\x20job','limit','push','created_at','error','✔\x20Retrieved\x20','information_schema','job:submit','map','job:show','name','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','args','submit','show','url','7617464XYTrWT','Database:\x20','Limit:\x20','16749eHiMRE','m\x20ago','388184HMvSpA','file','data','mo\x20ago','length','green','status','start_at','site','INVALID_ARGUMENT','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','validate','floor','238575HAggTn','h\x20ago','Status\x20filter:\x20','success','jobs','presto','304668pzqmhS','✔\x20Job\x20submitted','execute','end_at','query','getTime','type','d\x20ago','8yDijbB','description'];a25_0x5d1f=function(){return _0xf937b8;};return a25_0x5d1f();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x138f9b from'chalk';function formatDuration(_0x3e176c){const _0x4e1a7d=a25_0x4daf;if(_0x3e176c<0x3c)return _0x3e176c+'s';if(_0x3e176c<0xe10)return Math[_0x4e1a7d(0x1b6)](_0x3e176c/0x3c)+'m\x20'+_0x3e176c%0x3c+'s';const _0x4e07d6=Math[_0x4e1a7d(0x1b6)](_0x3e176c/0xe10),_0x2e0421=Math[_0x4e1a7d(0x1b6)](_0x3e176c%0xe10/0x3c);return _0x2e0421>0x0?_0x4e07d6+'h\x20'+_0x2e0421+'m':_0x4e07d6+'h';}function formatRelativeTime(_0x59f8c1){const _0x32802d=a25_0x4daf,_0x7d6270=Date['now']()-_0x59f8c1[_0x32802d(0x16b)](),_0x97d440=Math[_0x32802d(0x1b6)](Math[_0x32802d(0x176)](_0x7d6270)/0x3e8);if(_0x97d440<0x3c)return _0x32802d(0x18f);const _0x3c8bba=Math[_0x32802d(0x1b6)](_0x97d440/0x3c);if(_0x3c8bba<0x3c)return _0x3c8bba+_0x32802d(0x1a9);const _0x50db44=Math[_0x32802d(0x1b6)](_0x3c8bba/0x3c);if(_0x50db44<0x18)return _0x50db44+_0x32802d(0x161);const _0x5364f0=Math[_0x32802d(0x1b6)](_0x50db44/0x18);if(_0x5364f0<0x1e)return _0x5364f0+_0x32802d(0x16d);return Math[_0x32802d(0x1b6)](_0x5364f0/0x1e)+_0x32802d(0x1ad);}function a25_0x4daf(_0x35dff7,_0x2e7752){_0x35dff7=_0x35dff7-0x161;const _0x5d1f2c=a25_0x5d1f();let _0x4daf52=_0x5d1f2c[_0x35dff7];return _0x4daf52;}export class JobListCommand extends BaseCommand{['name']=a25_0x1cf8f2(0x164);[a25_0x1cf8f2(0x16f)]=a25_0x1cf8f2(0x171);async['execute'](_0x30f906){const _0x4634f2=a25_0x1cf8f2,{options:_0x206250,tdx:_0x157b28}=_0x30f906,_0x44d1e1=resolveLimit(_0x206250[_0x4634f2(0x196)],DEFAULT_DISPLAY_LIMIT),_0x5e2aaa=_0x206250[_0x4634f2(0x1b0)];_0x206250[_0x4634f2(0x186)]&&(console[_0x4634f2(0x199)](_0x4634f2(0x1a7)+_0x44d1e1+'\x20jobs'),_0x5e2aaa&&console[_0x4634f2(0x199)](_0x4634f2(0x162)+_0x5e2aaa));const _0x927bc3=await withSpinner('Listing\x20jobs...',()=>_0x157b28[_0x4634f2(0x164)]['list']({'from':0x0,'to':_0x44d1e1-0x1,'status':_0x5e2aaa}),{'verbose':_0x206250['verbose']}),_0x154340=_0x927bc3[_0x4634f2(0x1ac)];console['error']('✔\x20Found\x20'+_0x154340['length']+_0x4634f2(0x195)+(_0x154340[_0x4634f2(0x1ae)]!==0x1?'s':''));const _0x30de5a=_0x206250[_0x4634f2(0x1b2)];if(isStructuredFormat(_0x206250)){const _0x16d231=_0x154340[_0x4634f2(0x19d)](_0x236ede=>{const _0x2cf47b=_0x4634f2;let _0x406e0a;if(_0x236ede['start_at']&&_0x236ede['end_at']){const _0x388551=new Date(_0x236ede[_0x2cf47b(0x1b1)])[_0x2cf47b(0x16b)](),_0x28c35a=new Date(_0x236ede['end_at'])[_0x2cf47b(0x16b)]();_0x406e0a=Math[_0x2cf47b(0x18e)]((_0x28c35a-_0x388551)/0x3e8);}return{'job_id':_0x236ede[_0x2cf47b(0x173)],'type':_0x236ede[_0x2cf47b(0x16c)]===_0x2cf47b(0x165)?_0x2cf47b(0x193):_0x236ede[_0x2cf47b(0x16c)],'status':_0x236ede[_0x2cf47b(0x1b0)],'user_name':_0x236ede[_0x2cf47b(0x179)],'duration_sec':_0x406e0a,'created_at':_0x236ede[_0x2cf47b(0x198)],'started_at':_0x236ede[_0x2cf47b(0x1b1)],'end_at':_0x236ede[_0x2cf47b(0x169)]};});await handleSDKOutput(_0x16d231,_0x206250);}else for(const _0x2c1c14 of _0x154340){const _0x217d91=_0x2c1c14[_0x4634f2(0x1b0)]===_0x4634f2(0x163)?a25_0x138f9b[_0x4634f2(0x1af)]:_0x2c1c14[_0x4634f2(0x1b0)]===_0x4634f2(0x199)?a25_0x138f9b[_0x4634f2(0x184)]:a25_0x138f9b[_0x4634f2(0x181)],_0x2dd1d0=_0x217d91(_0x2c1c14[_0x4634f2(0x1b0)]),_0x1e3cf4=getJobUrl(_0x30de5a,_0x2c1c14[_0x4634f2(0x173)]),_0xf5ef2a=hyperlink(_0x2c1c14[_0x4634f2(0x173)],_0x1e3cf4),_0x1a9f0a=a25_0x138f9b[_0x4634f2(0x181)](_0x2c1c14[_0x4634f2(0x16c)]===_0x4634f2(0x165)?_0x4634f2(0x193):_0x2c1c14['type']),_0x1bd4ed=[];if(_0x2c1c14[_0x4634f2(0x1b1)]&&_0x2c1c14[_0x4634f2(0x169)]){const _0x41eac7=Math[_0x4634f2(0x18e)]((new Date(_0x2c1c14[_0x4634f2(0x169)])['getTime']()-new Date(_0x2c1c14[_0x4634f2(0x1b1)])[_0x4634f2(0x16b)]())/0x3e8);_0x1bd4ed[_0x4634f2(0x197)](formatDuration(_0x41eac7));}if(_0x2c1c14[_0x4634f2(0x169)])_0x1bd4ed[_0x4634f2(0x197)](formatRelativeTime(new Date(_0x2c1c14[_0x4634f2(0x169)])));else _0x2c1c14[_0x4634f2(0x1b1)]&&_0x1bd4ed['push'](formatRelativeTime(new Date(_0x2c1c14[_0x4634f2(0x1b1)])));const _0x12a3a7=_0x1bd4ed['length']>0x0?a25_0x138f9b[_0x4634f2(0x181)]('\x20'+_0x1bd4ed['join'](',\x20')):'';console[_0x4634f2(0x183)]('⚡\x20'+_0xf5ef2a+'\x20'+_0x1a9f0a+'\x20'+_0x2dd1d0+_0x12a3a7);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a25_0x1cf8f2(0x19e);['description']=a25_0x1cf8f2(0x178);[a25_0x1cf8f2(0x1b5)](_0x153922){const _0x29a6f8=a25_0x1cf8f2,_0x1f193b=_0x153922[_0x29a6f8(0x1a1)][0x0];if(!_0x1f193b)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a25_0x1cf8f2(0x168)](_0x3c8d17){const _0x145281=a25_0x1cf8f2,{options:_0x5c7469,args:_0x30bfaa,tdx:_0x5749fe}=_0x3c8d17,_0x29a097=_0x30bfaa[0x0],_0x49823f=await withSpinner('Getting\x20job\x20details...',()=>_0x5749fe[_0x145281(0x164)][_0x145281(0x1a3)](_0x29a097),{'verbose':_0x5c7469[_0x145281(0x186)]}),_0x4a4441=_0x49823f[_0x145281(0x1ac)];let _0x436fb0;if(_0x4a4441[_0x145281(0x1b1)]&&_0x4a4441['end_at']){const _0x440da8=new Date(_0x4a4441['start_at'])[_0x145281(0x16b)](),_0x5b6334=new Date(_0x4a4441['end_at'])['getTime']();_0x436fb0=Math[_0x145281(0x18e)]((_0x5b6334-_0x440da8)/0x3e8);}const _0x3a7825={'job_id':_0x4a4441[_0x145281(0x173)],'type':_0x4a4441[_0x145281(0x16c)],'status':_0x4a4441[_0x145281(0x1b0)],..._0x4a4441[_0x145281(0x179)]&&{'user_name':_0x4a4441[_0x145281(0x179)]},..._0x436fb0!==undefined&&{'duration_sec':_0x436fb0},..._0x4a4441[_0x145281(0x198)]&&{'created_at':_0x4a4441[_0x145281(0x198)]},..._0x4a4441['start_at']&&{'started_at':_0x4a4441[_0x145281(0x1b1)]},..._0x4a4441[_0x145281(0x169)]&&{'end_at':_0x4a4441[_0x145281(0x169)]},..._0x4a4441[_0x145281(0x18a)]&&{'database':_0x4a4441[_0x145281(0x18a)]},..._0x4a4441[_0x145281(0x18b)]!==undefined&&{'priority':_0x4a4441['priority']},..._0x4a4441[_0x145281(0x1a4)]&&{'url':_0x4a4441[_0x145281(0x1a4)]},..._0x4a4441[_0x145281(0x16a)]&&{'query':_0x4a4441['query']},..._0x4a4441[_0x145281(0x187)]&&{'debug':_0x4a4441['debug']}};return await handleSingleObjectOutput(_0x3a7825,_0x5c7469),0x0;}}export class JobKillCommand extends BaseCommand{['name']='job:kill';[a25_0x1cf8f2(0x16f)]='Kill\x20a\x20job';[a25_0x1cf8f2(0x1b5)](_0x2365d6){const _0x170c63=a25_0x1cf8f2,_0xe1624b=_0x2365d6['args'][0x0];if(!_0xe1624b)return _0x170c63(0x1a0);return undefined;}async['execute'](_0xb09d6d){const _0x3e6d12=a25_0x1cf8f2,{options:_0xbc1bd0,args:_0x1b4a1e,tdx:_0x123486}=_0xb09d6d,_0x265dcc=_0x1b4a1e[0x0];if(!_0xbc1bd0[_0x3e6d12(0x192)]){const _0x5832fb=await confirm(_0x3e6d12(0x18c)+_0x265dcc+'?');if(!_0x5832fb)return console[_0x3e6d12(0x199)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x123486[_0x3e6d12(0x164)][_0x3e6d12(0x17b)](_0x265dcc),{'verbose':_0xbc1bd0['verbose']}),console['error'](_0x3e6d12(0x17e)+_0x265dcc),console['error'](_0x3e6d12(0x172)+_0x265dcc+_0x3e6d12(0x17a)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a25_0x1cf8f2(0x19c);[a25_0x1cf8f2(0x16f)]=a25_0x1cf8f2(0x174);async[a25_0x1cf8f2(0x168)](_0x4100b7){const _0x4c8c95=a25_0x1cf8f2,{options:_0x174c45,args:_0x34f7ec,tdx:_0x510b5b}=_0x4100b7,_0x1f772b=_0x174c45[_0x4c8c95(0x170)]||_0x4c8c95(0x193),_0x2f6b02=_0x174c45[_0x4c8c95(0x1ab)],_0x2d0dea=_0x174c45[_0x4c8c95(0x18a)]||_0x4c8c95(0x19b),_0x5ceba0=_0x174c45['result'];if(_0x1f772b!==_0x4c8c95(0x193)&&_0x1f772b!=='hive')throw new SDKError(ErrorCode[_0x4c8c95(0x1b3)],_0x4c8c95(0x1b4));let _0x104173;if(_0x2f6b02){if(_0x34f7ec[0x0])throw new SDKError(ErrorCode[_0x4c8c95(0x1b3)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x1674c9=readSqlStatementsFromFile(_0x2f6b02);if(_0x1674c9[_0x4c8c95(0x1ae)]===0x0)throw new SDKError(ErrorCode[_0x4c8c95(0x1b3)],_0x4c8c95(0x177));if(_0x1674c9[_0x4c8c95(0x1ae)]>0x1)throw new SDKError(ErrorCode[_0x4c8c95(0x1b3)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x104173=_0x1674c9[0x0];}else{if(!_0x34f7ec[0x0])throw new SDKError(ErrorCode[_0x4c8c95(0x1b3)],_0x4c8c95(0x17c));_0x104173=_0x34f7ec[0x0];}_0x174c45[_0x4c8c95(0x186)]&&(console[_0x4c8c95(0x199)](_0x4c8c95(0x175)+_0x1f772b),console[_0x4c8c95(0x199)](_0x4c8c95(0x1a6)+_0x2d0dea),console['error'](_0x4c8c95(0x194)+_0x104173[_0x4c8c95(0x188)](0x0,0x64)+(_0x104173['length']>0x64?'...':'')));const _0x196bd2=await withSpinner(_0x4c8c95(0x189),()=>_0x510b5b[_0x4c8c95(0x164)][_0x4c8c95(0x1a2)](_0x2d0dea,_0x104173,_0x1f772b,_0x5ceba0),{'verbose':_0x174c45[_0x4c8c95(0x186)]}),_0x25a362=_0x196bd2[_0x4c8c95(0x1ac)];return console[_0x4c8c95(0x199)](_0x4c8c95(0x167)),console[_0x4c8c95(0x199)]('\x20\x20Job\x20ID:\x20'+_0x25a362[_0x4c8c95(0x173)]),await handleSDKOutput([_0x25a362],_0x174c45),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x1cf8f2(0x19f)]=a25_0x1cf8f2(0x18d);['description']=a25_0x1cf8f2(0x185);[a25_0x1cf8f2(0x1b5)](_0x1bb09e){const _0x2b8c28=a25_0x1cf8f2,_0x48b5d0=_0x1bb09e[_0x2b8c28(0x1a1)][0x0];if(!_0x48b5d0)return _0x2b8c28(0x17f);return undefined;}async[a25_0x1cf8f2(0x168)](_0x257d83){const _0x375527=a25_0x1cf8f2,{options:_0x40e8e3,args:_0x582447,tdx:_0x398072}=_0x257d83,_0x15f714=_0x582447[0x0],_0x49bda7=await withSpinner('Getting\x20job\x20results...',()=>_0x398072[_0x375527(0x164)]['result'](_0x15f714),{'verbose':_0x40e8e3[_0x375527(0x186)]}),_0x3ece6e=_0x49bda7[_0x375527(0x1ac)];return console[_0x375527(0x199)](_0x375527(0x19a)+_0x3ece6e[_0x375527(0x1ae)]+'\x20row'+(_0x3ece6e[_0x375527(0x1ae)]!==0x1?'s':'')),await handleSDKOutput(_0x3ece6e,_0x40e8e3),0x0;}}
|
|
1
|
+
const a25_0x47f203=a25_0x18eb;(function(_0x2a5f81,_0x174a97){const _0x29507f=a25_0x18eb,_0x7f73f4=_0x2a5f81();while(!![]){try{const _0x57ca50=-parseInt(_0x29507f(0x106))/0x1+parseInt(_0x29507f(0x113))/0x2*(-parseInt(_0x29507f(0xf7))/0x3)+-parseInt(_0x29507f(0x101))/0x4*(parseInt(_0x29507f(0xe6))/0x5)+-parseInt(_0x29507f(0xe3))/0x6+-parseInt(_0x29507f(0xfd))/0x7*(parseInt(_0x29507f(0xff))/0x8)+-parseInt(_0x29507f(0xdc))/0x9*(parseInt(_0x29507f(0x10a))/0xa)+-parseInt(_0x29507f(0xcd))/0xb*(-parseInt(_0x29507f(0xcf))/0xc);if(_0x57ca50===_0x174a97)break;else _0x7f73f4['push'](_0x7f73f4['shift']());}catch(_0x37fba5){_0x7f73f4['push'](_0x7f73f4['shift']());}}}(a25_0xdac9,0x9eac5));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x2f657c from'chalk';function formatDuration(_0x3c1d30){const _0x5df883=a25_0x18eb;if(_0x3c1d30<0x3c)return _0x3c1d30+'s';if(_0x3c1d30<0xe10)return Math[_0x5df883(0xfa)](_0x3c1d30/0x3c)+'m\x20'+_0x3c1d30%0x3c+'s';const _0x3dff5d=Math[_0x5df883(0xfa)](_0x3c1d30/0xe10),_0x3ca0ee=Math[_0x5df883(0xfa)](_0x3c1d30%0xe10/0x3c);return _0x3ca0ee>0x0?_0x3dff5d+'h\x20'+_0x3ca0ee+'m':_0x3dff5d+'h';}function formatRelativeTime(_0x3f5d68){const _0x3b2dd2=a25_0x18eb,_0x1cbd0f=Date[_0x3b2dd2(0x102)]()-_0x3f5d68[_0x3b2dd2(0x109)](),_0xd6b207=Math[_0x3b2dd2(0xfa)](Math[_0x3b2dd2(0xe2)](_0x1cbd0f)/0x3e8);if(_0xd6b207<0x3c)return _0x3b2dd2(0xe0);const _0x14c096=Math[_0x3b2dd2(0xfa)](_0xd6b207/0x3c);if(_0x14c096<0x3c)return _0x14c096+_0x3b2dd2(0x110);const _0x4d39d4=Math['floor'](_0x14c096/0x3c);if(_0x4d39d4<0x18)return _0x4d39d4+_0x3b2dd2(0x11c);const _0x37b5df=Math[_0x3b2dd2(0xfa)](_0x4d39d4/0x18);if(_0x37b5df<0x1e)return _0x37b5df+_0x3b2dd2(0xe1);return Math['floor'](_0x37b5df/0x1e)+_0x3b2dd2(0xd6);}export class JobListCommand extends BaseCommand{['name']=a25_0x47f203(0x100);[a25_0x47f203(0xe4)]='List\x20jobs';async['execute'](_0x104c95){const _0x513bcb=a25_0x47f203,{options:_0x3c4db4,tdx:_0x1b2c17}=_0x104c95,_0x4078b8=resolveLimit(_0x3c4db4[_0x513bcb(0xf0)],DEFAULT_DISPLAY_LIMIT),_0x4f9db2=_0x3c4db4[_0x513bcb(0xfc)];_0x3c4db4['verbose']&&(console[_0x513bcb(0xee)](_0x513bcb(0x10d)+_0x4078b8+_0x513bcb(0xf3)),_0x4f9db2&&console[_0x513bcb(0xee)](_0x513bcb(0xf1)+_0x4f9db2));const _0x14cb0c=await withSpinner('Listing\x20jobs...',()=>_0x1b2c17[_0x513bcb(0x100)][_0x513bcb(0xc7)]({'from':0x0,'to':_0x4078b8-0x1,'status':_0x4f9db2}),{'verbose':_0x3c4db4[_0x513bcb(0xf2)]}),_0x4e5098=_0x14cb0c[_0x513bcb(0x107)];console['error']('✔\x20Found\x20'+_0x4e5098['length']+_0x513bcb(0xda)+(_0x4e5098[_0x513bcb(0xd7)]!==0x1?'s':''));const _0x53c0c2=_0x3c4db4[_0x513bcb(0x10c)];if(isStructuredFormat(_0x3c4db4)){const _0x3bd036=_0x4e5098['map'](_0x5328fa=>{const _0x3004d3=_0x513bcb;let _0x304ffe;if(_0x5328fa['start_at']&&_0x5328fa[_0x3004d3(0xc8)]){const _0x598018=new Date(_0x5328fa['start_at'])[_0x3004d3(0x109)](),_0x4feac7=new Date(_0x5328fa[_0x3004d3(0xc8)])['getTime']();_0x304ffe=Math[_0x3004d3(0xd5)]((_0x4feac7-_0x598018)/0x3e8);}return{'job_id':_0x5328fa['job_id'],'type':_0x5328fa['type']==='presto'?_0x3004d3(0xd0):_0x5328fa[_0x3004d3(0xe8)],'status':_0x5328fa[_0x3004d3(0xfc)],'user_name':_0x5328fa[_0x3004d3(0xf4)],'duration_sec':_0x304ffe,'created_at':_0x5328fa[_0x3004d3(0xcc)],'started_at':_0x5328fa[_0x3004d3(0xc4)],'end_at':_0x5328fa[_0x3004d3(0xc8)]};});await handleSDKOutput(_0x3bd036,_0x3c4db4);}else for(const _0x5bcb85 of _0x4e5098){const _0x24d3e8=_0x5bcb85['status']===_0x513bcb(0x10e)?a25_0x2f657c['green']:_0x5bcb85[_0x513bcb(0xfc)]==='error'?a25_0x2f657c[_0x513bcb(0xdd)]:a25_0x2f657c[_0x513bcb(0xf6)],_0x7a9dd3=_0x24d3e8(_0x5bcb85[_0x513bcb(0xfc)]),_0x5b7be0=getJobUrl(_0x53c0c2,_0x5bcb85['job_id']),_0xd5bae3=hyperlink(_0x5bcb85[_0x513bcb(0x105)],_0x5b7be0),_0x439c59=a25_0x2f657c[_0x513bcb(0xf6)](_0x5bcb85['type']===_0x513bcb(0xce)?_0x513bcb(0xd0):_0x5bcb85['type']),_0x2beed5=[];if(_0x5bcb85['start_at']&&_0x5bcb85[_0x513bcb(0xc8)]){const _0x4c9dff=Math['round']((new Date(_0x5bcb85[_0x513bcb(0xc8)])[_0x513bcb(0x109)]()-new Date(_0x5bcb85[_0x513bcb(0xc4)])[_0x513bcb(0x109)]())/0x3e8);_0x2beed5['push'](formatDuration(_0x4c9dff));}if(_0x5bcb85['end_at'])_0x2beed5['push'](formatRelativeTime(new Date(_0x5bcb85[_0x513bcb(0xc8)])));else _0x5bcb85[_0x513bcb(0xc4)]&&_0x2beed5[_0x513bcb(0x104)](formatRelativeTime(new Date(_0x5bcb85[_0x513bcb(0xc4)])));const _0x1f35b9=_0x2beed5['length']>0x0?a25_0x2f657c['dim']('\x20'+_0x2beed5[_0x513bcb(0xeb)](',\x20')):'';console['log']('⚡\x20'+_0xd5bae3+'\x20'+_0x439c59+'\x20'+_0x7a9dd3+_0x1f35b9);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x47f203(0xe7)]=a25_0x47f203(0xde);[a25_0x47f203(0xe4)]=a25_0x47f203(0xc3);['validate'](_0x50d042){const _0x26ceea=a25_0x47f203,_0x5bfa9c=_0x50d042['args'][0x0];if(!_0x5bfa9c)return _0x26ceea(0xd9);return undefined;}async[a25_0x47f203(0x11a)](_0x5ab5c0){const _0x520524=a25_0x47f203,{options:_0x192f1e,args:_0x2f09dd,tdx:_0x556389}=_0x5ab5c0,_0x3a047e=_0x2f09dd[0x0],_0x450a75=await withSpinner('Getting\x20job\x20details...',()=>_0x556389['jobs'][_0x520524(0x115)](_0x3a047e),{'verbose':_0x192f1e['verbose']}),_0x311e98=_0x450a75[_0x520524(0x107)];let _0x351361;if(_0x311e98[_0x520524(0xc4)]&&_0x311e98[_0x520524(0xc8)]){const _0x22f8b1=new Date(_0x311e98[_0x520524(0xc4)])[_0x520524(0x109)](),_0x355efe=new Date(_0x311e98[_0x520524(0xc8)])[_0x520524(0x109)]();_0x351361=Math[_0x520524(0xd5)]((_0x355efe-_0x22f8b1)/0x3e8);}const _0x276e6b={'job_id':_0x311e98['job_id'],'type':_0x311e98[_0x520524(0xe8)],'status':_0x311e98[_0x520524(0xfc)],..._0x311e98[_0x520524(0xf4)]&&{'user_name':_0x311e98[_0x520524(0xf4)]},..._0x351361!==undefined&&{'duration_sec':_0x351361},..._0x311e98['created_at']&&{'created_at':_0x311e98['created_at']},..._0x311e98[_0x520524(0xc4)]&&{'started_at':_0x311e98[_0x520524(0xc4)]},..._0x311e98[_0x520524(0xc8)]&&{'end_at':_0x311e98[_0x520524(0xc8)]},..._0x311e98[_0x520524(0xfb)]&&{'database':_0x311e98['database']},..._0x311e98[_0x520524(0x119)]!==undefined&&{'priority':_0x311e98[_0x520524(0x119)]},..._0x311e98[_0x520524(0xec)]&&{'url':_0x311e98[_0x520524(0xec)]},..._0x311e98[_0x520524(0xca)]&&{'query':_0x311e98[_0x520524(0xca)]},..._0x311e98[_0x520524(0x103)]&&{'debug':_0x311e98['debug']}};return await handleSingleObjectOutput(_0x276e6b,_0x192f1e),0x0;}}function a25_0x18eb(_0x16b7b1,_0x27c741){_0x16b7b1=_0x16b7b1-0xc2;const _0xdac915=a25_0xdac9();let _0x18ebd5=_0xdac915[_0x16b7b1];return _0x18ebd5;}export class JobKillCommand extends BaseCommand{[a25_0x47f203(0xe7)]=a25_0x47f203(0xd1);[a25_0x47f203(0xe4)]=a25_0x47f203(0xe5);[a25_0x47f203(0xf9)](_0x1c60d7){const _0x52b0b0=a25_0x47f203,_0x1ec7f6=_0x1c60d7[_0x52b0b0(0xd2)][0x0];if(!_0x1ec7f6)return _0x52b0b0(0xdb);return undefined;}async[a25_0x47f203(0x11a)](_0x36df9d){const _0x3d8d6d=a25_0x47f203,{options:_0x474edb,args:_0x3ca8ba,tdx:_0x32d2f9}=_0x36df9d,_0xe4f62b=_0x3ca8ba[0x0];if(!_0x474edb['yes']){const _0x9bcc99=await confirm(_0x3d8d6d(0x116)+_0xe4f62b+'?');if(!_0x9bcc99)return console[_0x3d8d6d(0xee)]('Cancelled'),0x0;}return await withSpinner(_0x3d8d6d(0x114),()=>_0x32d2f9[_0x3d8d6d(0x100)][_0x3d8d6d(0x118)](_0xe4f62b),{'verbose':_0x474edb[_0x3d8d6d(0xf2)]}),console['error'](_0x3d8d6d(0xed)+_0xe4f62b),console[_0x3d8d6d(0xee)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0xe4f62b+_0x3d8d6d(0x117)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a25_0x47f203(0xe7)]='job:submit';[a25_0x47f203(0xe4)]=a25_0x47f203(0xc5);async[a25_0x47f203(0x11a)](_0x15ac6c){const _0x29116f=a25_0x47f203,{options:_0x8c7c35,args:_0x6778d8,tdx:_0x12c66c}=_0x15ac6c,_0x1b36a8=_0x8c7c35[_0x29116f(0xd3)]||_0x29116f(0xd0),_0x2c4cb6=_0x8c7c35[_0x29116f(0xf8)],_0x33554f=_0x8c7c35['database']||'information_schema',_0x34cd0e=_0x8c7c35['result'];if(_0x1b36a8!==_0x29116f(0xd0)&&_0x1b36a8!==_0x29116f(0xdf))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x29116f(0xcb));let _0x18b0db;if(_0x2c4cb6){if(_0x6778d8[0x0])throw new SDKError(ErrorCode[_0x29116f(0x112)],_0x29116f(0xc2));const _0x265c35=readSqlStatementsFromFile(_0x2c4cb6);if(_0x265c35[_0x29116f(0xd7)]===0x0)throw new SDKError(ErrorCode[_0x29116f(0x112)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x265c35['length']>0x1)throw new SDKError(ErrorCode[_0x29116f(0x112)],_0x29116f(0x10b));_0x18b0db=_0x265c35[0x0];}else{if(!_0x6778d8[0x0])throw new SDKError(ErrorCode[_0x29116f(0x112)],_0x29116f(0xe9));_0x18b0db=_0x6778d8[0x0];}_0x8c7c35[_0x29116f(0xf2)]&&(console[_0x29116f(0xee)](_0x29116f(0xef)+_0x1b36a8),console[_0x29116f(0xee)]('Database:\x20'+_0x33554f),console[_0x29116f(0xee)](_0x29116f(0x108)+_0x18b0db[_0x29116f(0x11b)](0x0,0x64)+(_0x18b0db[_0x29116f(0xd7)]>0x64?'...':'')));const _0x5291c2=await withSpinner(_0x29116f(0xc9),()=>_0x12c66c[_0x29116f(0x100)][_0x29116f(0xea)](_0x33554f,_0x18b0db,_0x1b36a8,_0x34cd0e),{'verbose':_0x8c7c35[_0x29116f(0xf2)]}),_0x162886=_0x5291c2[_0x29116f(0x107)];return console[_0x29116f(0xee)](_0x29116f(0xf5)),console[_0x29116f(0xee)](_0x29116f(0x111)+_0x162886[_0x29116f(0x105)]),await handleSDKOutput([_0x162886],_0x8c7c35),0x0;}}function a25_0xdac9(){const _0x3e5003=['query','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','created_at','218185UOfDkG','presto','2388KpFWUv','trino','job:kill','args','jobType','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','round','mo\x20ago','length','\x20row','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','387TLIwnY','red','job:show','hive','just\x20now','d\x20ago','abs','2375904bBTayB','description','Kill\x20a\x20job','48565ExOerV','name','type','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','submit','join','url','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','error','Job\x20type:\x20','limit','Status\x20filter:\x20','verbose','\x20jobs','user_name','✔\x20Job\x20submitted','dim','3mQXfyC','file','validate','floor','database','status','21XoVXZD','Getting\x20job\x20results...','723248Hskyar','jobs','28UbqMAe','now','debug','push','job_id','961907NcpYvi','data','Query:\x20','getTime','74410ZmUGuG','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','site','Limit:\x20','success','✔\x20Retrieved\x20','m\x20ago','\x20\x20Job\x20ID:\x20','INVALID_ARGUMENT','2560354AAyHYk','Submitting\x20kill\x20request...','show','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','\x27\x20to\x20verify\x20the\x20job\x20status','kill','priority','execute','substring','h\x20ago','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Show\x20job\x20details','start_at','Submit\x20a\x20job','Get\x20job\x20results','list','end_at','Submitting\x20job...'];a25_0xdac9=function(){return _0x3e5003;};return a25_0xdac9();}export class JobResultCommand extends BaseCommand{[a25_0x47f203(0xe7)]='job:result';[a25_0x47f203(0xe4)]=a25_0x47f203(0xc6);[a25_0x47f203(0xf9)](_0x513e0c){const _0x4d974e=a25_0x47f203,_0x1641c0=_0x513e0c[_0x4d974e(0xd2)][0x0];if(!_0x1641c0)return _0x4d974e(0xd4);return undefined;}async['execute'](_0x167d56){const _0x218e9c=a25_0x47f203,{options:_0x218dd6,args:_0x125fd0,tdx:_0x4ef42b}=_0x167d56,_0x23fa59=_0x125fd0[0x0],_0xcd5ed2=await withSpinner(_0x218e9c(0xfe),()=>_0x4ef42b[_0x218e9c(0x100)]['result'](_0x23fa59),{'verbose':_0x218dd6['verbose']}),_0x3934fd=_0xcd5ed2[_0x218e9c(0x107)];return console[_0x218e9c(0xee)](_0x218e9c(0x10f)+_0x3934fd[_0x218e9c(0xd7)]+_0x218e9c(0xd8)+(_0x3934fd['length']!==0x1?'s':'')),await handleSDKOutput(_0x3934fd,_0x218dd6),0x0;}}
|