@treasuredata/tdx 2026.3.12 → 2026.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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_0xb804de=a19_0x3795;function a19_0x3795(_0x50324a,_0x627efc){_0x50324a=_0x50324a-0x1b9;const _0x40d5c0=a19_0x40d5();let _0x379505=_0x40d5c0[_0x50324a];return _0x379505;}(function(_0x17b23d,_0x635bb6){const _0x168392=a19_0x3795,_0x57d4aa=_0x17b23d();while(!![]){try{const _0x17ce8d=-parseInt(_0x168392(0x1ca))/0x1+parseInt(_0x168392(0x1c8))/0x2*(-parseInt(_0x168392(0x1fa))/0x3)+-parseInt(_0x168392(0x1d3))/0x4*(-parseInt(_0x168392(0x1cf))/0x5)+parseInt(_0x168392(0x1f2))/0x6*(parseInt(_0x168392(0x1fb))/0x7)+-parseInt(_0x168392(0x1e6))/0x8*(parseInt(_0x168392(0x1dc))/0x9)+-parseInt(_0x168392(0x201))/0xa*(-parseInt(_0x168392(0x1ef))/0xb)+-parseInt(_0x168392(0x1e4))/0xc*(-parseInt(_0x168392(0x1ea))/0xd);if(_0x17ce8d===_0x635bb6)break;else _0x57d4aa['push'](_0x57d4aa['shift']());}catch(_0x31acdf){_0x57d4aa['push'](_0x57d4aa['shift']());}}}(a19_0x40d5,0x4e7a1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a19_0x528359 from'chalk';import a19_0x516b73 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';function a19_0x40d5(){const _0x1a8f63=['Workspace\x20is\x20required.','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','setPhase','\x20campaigns?','34EBeLnr','yes','198037WuKuPn','Push\x20','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','name','\x20campaigns\x20to\x20update:','10JbXXsZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','site','update','397892pJMsqU','map','updated','green','Resolving\x20references...','engage','Aborted.','red','\x0aPush\x20summary\x20for\x20workspace\x20\x27','8667TchySd','data','workspace','error','✔\x20Updated\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','relativePath','yellow','48wTUZXi','length','4432tTHZeg','configDir','✔\x20Created\x20','path','327548fvRIsn','campaign_type','segment','engage:campaign:push','dirname','4595569wACOjc','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','create','6uyTzpL','def','campaignId','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','errors','warnings','session','cwd','36081ZXSpBa','3779510RTiTvb','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','\x20campaign\x20files','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','1\x20campaign\x20file:\x20','action','10wPDZYq','valid','Pushing\x20campaigns...','engage_workspace','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dim','verbose','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','resolve','\x20campaigns','message','execute','Preparing\x20push\x20to\x20workspace\x20\x27','filter','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\x27...','created'];a19_0x40d5=function(){return _0x1a8f63;};return a19_0x40d5();}import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a19_0xb804de(0x1cd)]=a19_0xb804de(0x1ed);['description']=a19_0xb804de(0x1fc);async[a19_0xb804de(0x1be)](_0x54a330){const _0x174f5f=a19_0xb804de,{options:_0x5438c4,args:_0x530e9a,tdx:_0x59c715}=_0x54a330,_0x42b8b4=_0x5438c4,_0x1217e4=_0x530e9a[0x0],_0x129ff5=_0x1217e4?a19_0x516b73[_0x174f5f(0x1bb)](_0x1217e4):undefined,_0x11d079=_0x129ff5?isYamlFile(_0x129ff5):![];let _0x1ad533;if(_0x11d079&&_0x129ff5)_0x1ad533=a19_0x516b73[_0x174f5f(0x1ee)](_0x129ff5);else _0x129ff5?_0x1ad533=_0x129ff5:_0x1ad533=process[_0x174f5f(0x1f9)]();let _0x2ee460;const _0x48e39a=tryFindTdxConfig(_0x1ad533);_0x48e39a?.['config'][_0x174f5f(0x204)]&&(_0x2ee460=_0x48e39a['config']['engage_workspace'],!_0x11d079&&(_0x1ad533=_0x48e39a[_0x174f5f(0x1e7)]));_0x42b8b4[_0x174f5f(0x1de)]&&(_0x2ee460=_0x42b8b4['workspace']);if(!_0x2ee460){const _0x137aab=loadSessionContext(_0x42b8b4['session']);_0x137aab?.['engage_workspace']&&(_0x2ee460=_0x137aab['engage_workspace']);}if(!_0x2ee460)return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1e3)](_0x174f5f(0x1c4))),console['error'](_0x174f5f(0x1ba)),console[_0x174f5f(0x1df)](_0x174f5f(0x1d0)),console[_0x174f5f(0x1df)](_0x174f5f(0x1e1)),console[_0x174f5f(0x1df)](_0x174f5f(0x1cc)),0x1;let _0x4b149;_0x11d079&&_0x129ff5?_0x4b149=[_0x129ff5]:_0x4b149=discoverCampaignFiles(_0x1ad533);if(_0x4b149[_0x174f5f(0x1e5)]===0x0)return console['error'](a19_0x528359[_0x174f5f(0x1e3)](_0x174f5f(0x1f0)+_0x1ad533)),console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x206)](_0x174f5f(0x1f5))),0x1;const _0x31d655=_0x4b149[_0x174f5f(0x1d4)](_0x306f15=>parseCampaignFile(_0x306f15,a19_0x516b73[_0x174f5f(0x1ee)](_0x306f15))),_0x759185=_0x31d655[_0x174f5f(0x1e5)]===0x1?_0x174f5f(0x1ff)+_0x31d655[0x0]['def']['name']:_0x31d655[_0x174f5f(0x1e5)]+_0x174f5f(0x1fd);console[_0x174f5f(0x1df)]('Found\x20'+a19_0x528359['cyan'](_0x759185));let _0x41688a=![];for(const _0x35c8dd of _0x31d655){const _0x36ac53=validateCampaignDef(_0x35c8dd[_0x174f5f(0x1f3)]);if(!_0x36ac53[_0x174f5f(0x202)]){_0x41688a=!![],console['error'](a19_0x528359[_0x174f5f(0x1da)]('\x0aValidation\x20errors\x20in\x20'+_0x35c8dd[_0x174f5f(0x1e2)]+':'));for(const _0x187770 of _0x36ac53[_0x174f5f(0x1f6)]){console['error']('\x20\x20'+a19_0x528359[_0x174f5f(0x1da)]('✗')+'\x20'+_0x187770['path']+':\x20'+_0x187770[_0x174f5f(0x1bd)]);}}for(const _0x40434c of _0x36ac53[_0x174f5f(0x1f7)]){console[_0x174f5f(0x1df)]('\x20\x20'+a19_0x528359[_0x174f5f(0x1e3)]('⚠')+'\x20'+_0x40434c[_0x174f5f(0x1e9)]+':\x20'+_0x40434c[_0x174f5f(0x1bd)]);}}if(_0x41688a)return console[_0x174f5f(0x1df)](a19_0x528359['red'](_0x174f5f(0x1fe))),0x1;const _0x45edb6=await _0x59c715[_0x174f5f(0x1d8)]['resolveWorkspaceId'](_0x2ee460),_0x533614=await withProgressSpinner(_0x174f5f(0x1bf)+_0x2ee460+_0x174f5f(0x1c2),_0x2d23d2=>preparePush({'engage':_0x59c715[_0x174f5f(0x1d8)],'segment':_0x59c715[_0x174f5f(0x1ec)]},_0x31d655,_0x45edb6,{'progress':{'update':_0x5f15da=>_0x2d23d2[_0x174f5f(0x1c6)](_0x5f15da)}}),{'verbose':_0x42b8b4[_0x174f5f(0x1b9)]}),_0x257bf8=_0x533614[_0x174f5f(0x1dd)];await withProgressSpinner(_0x174f5f(0x1d7),_0x8df3b7=>resolveAndBuildInputs({'engage':_0x59c715['engage'],'segment':_0x59c715['segment']},_0x257bf8,_0x45edb6,{'progress':{'update':_0x8bc2ad=>_0x8df3b7['setPhase'](_0x8bc2ad)}}),{'verbose':_0x42b8b4[_0x174f5f(0x1b9)]});const _0x682b7d=_0x257bf8[_0x174f5f(0x1c0)](_0x3cb729=>_0x3cb729[_0x174f5f(0x200)]===_0x174f5f(0x1f1)),_0x166c76=_0x257bf8[_0x174f5f(0x1c0)](_0x19871e=>_0x19871e[_0x174f5f(0x200)]===_0x174f5f(0x1d2));console[_0x174f5f(0x1df)](_0x174f5f(0x1db)+_0x2ee460+'\x27:');if(_0x682b7d[_0x174f5f(0x1e5)]>0x0){console['error']('\x20\x20'+a19_0x528359[_0x174f5f(0x1d6)]('+\x20'+_0x682b7d[_0x174f5f(0x1e5)]+'\x20new\x20campaigns:'));for(const _0x47f695 of _0x682b7d){console[_0x174f5f(0x1df)]('\x20\x20\x20\x20'+a19_0x528359['green']('+')+'\x20'+_0x47f695['def'][_0x174f5f(0x1cd)]+'\x20('+_0x47f695[_0x174f5f(0x1f3)][_0x174f5f(0x1eb)]+')');}}if(_0x166c76['length']>0x0){console[_0x174f5f(0x1df)]('\x20\x20'+a19_0x528359[_0x174f5f(0x1e3)]('~\x20'+_0x166c76[_0x174f5f(0x1e5)]+_0x174f5f(0x1ce)));for(const _0x317ebb of _0x166c76){console['error']('\x20\x20\x20\x20'+a19_0x528359[_0x174f5f(0x1e3)]('~')+'\x20'+_0x317ebb[_0x174f5f(0x1f3)][_0x174f5f(0x1cd)]+'\x20('+_0x317ebb[_0x174f5f(0x1f3)][_0x174f5f(0x1eb)]+')');}}if(_0x682b7d[_0x174f5f(0x1e5)]===0x0&&_0x166c76[_0x174f5f(0x1e5)]===0x0)return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1d6)]('✔\x20All\x20campaigns\x20are\x20up\x20to\x20date')),0x0;if(_0x42b8b4['dryRun'])return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1e3)](_0x174f5f(0x1c1))),0x0;if(!_0x42b8b4[_0x174f5f(0x1c9)]){if(!isInteractive())return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1da)]('\x0aError:'),_0x174f5f(0x1c5)),console[_0x174f5f(0x1df)](a19_0x528359['dim'](_0x174f5f(0x205))),0x1;const _0x4c94ae=await confirmKey(_0x174f5f(0x1cb)+(_0x682b7d[_0x174f5f(0x1e5)]+_0x166c76[_0x174f5f(0x1e5)])+_0x174f5f(0x1c7));if(!_0x4c94ae)return console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1e3)](_0x174f5f(0x1d9)),'-\x20no\x20changes\x20applied'),0x1;}const _0x463eba=await withProgressSpinner(_0x174f5f(0x203),_0x823878=>executePush({'engage':_0x59c715[_0x174f5f(0x1d8)],'segment':_0x59c715[_0x174f5f(0x1ec)]},_0x257bf8,{'progress':{'update':_0x3c7f13=>_0x823878[_0x174f5f(0x1c6)](_0x3c7f13)}}),{'verbose':_0x42b8b4[_0x174f5f(0x1b9)]}),_0x5edb28=_0x463eba[_0x174f5f(0x1dd)];for(const _0xd0f557 of _0x5edb28['results']){if(_0xd0f557[_0x174f5f(0x1f4)]&&(_0xd0f557['action']===_0x174f5f(0x1c3)||_0xd0f557[_0x174f5f(0x200)]===_0x174f5f(0x1d5))){const _0x58a16c=getCampaignUrl(_0x42b8b4[_0x174f5f(0x1d1)],_0x45edb6,_0xd0f557['campaignId']),_0x5e7ce1=_0xd0f557[_0x174f5f(0x200)]===_0x174f5f(0x1c3)?'+':'~',_0x25ebd3=_0xd0f557['action']===_0x174f5f(0x1c3)?a19_0x528359[_0x174f5f(0x1d6)](_0x5e7ce1):a19_0x528359['yellow'](_0x5e7ce1);console[_0x174f5f(0x1df)]('\x20\x20'+_0x25ebd3+'\x20'+hyperlink(_0xd0f557[_0x174f5f(0x1cd)],_0x58a16c)+'\x20'+a19_0x528359['dim'](_0x58a16c));}}_0x5edb28[_0x174f5f(0x1c3)]>0x0&&console[_0x174f5f(0x1df)](a19_0x528359[_0x174f5f(0x1d6)](_0x174f5f(0x1e8)+_0x5edb28[_0x174f5f(0x1c3)]+'\x20campaigns'));_0x5edb28[_0x174f5f(0x1d5)]>0x0&&console['error'](a19_0x528359['green'](_0x174f5f(0x1e0)+_0x5edb28['updated']+_0x174f5f(0x1bc)));if(_0x5edb28[_0x174f5f(0x1f6)][_0x174f5f(0x1e5)]>0x0){console['error'](a19_0x528359[_0x174f5f(0x1da)]('✘\x20'+_0x5edb28[_0x174f5f(0x1f6)]['length']+'\x20errors:'));for(const _0x38e209 of _0x5edb28[_0x174f5f(0x1f6)]){console[_0x174f5f(0x1df)]('\x20\x20'+a19_0x528359['red'](_0x38e209[_0x174f5f(0x1cd)])+':\x20'+_0x38e209[_0x174f5f(0x1df)]);}}return saveSessionContext({'engage_workspace':_0x2ee460},_0x42b8b4[_0x174f5f(0x1f8)]),_0x5edb28[_0x174f5f(0x1f6)]['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x1d4d71=a20_0xaf7d;(function(_0xbdd3d4,_0x1f427a){const _0x147964=a20_0xaf7d,_0x78d5de=_0xbdd3d4();while(!![]){try{const _0x10f406=-parseInt(_0x147964(0x1b3))/0x1+-parseInt(_0x147964(0x1aa))/0x2*(parseInt(_0x147964(0x1a1))/0x3)+parseInt(_0x147964(0x195))/0x4+parseInt(_0x147964(0x1ab))/0x5*(-parseInt(_0x147964(0x1b1))/0x6)+-parseInt(_0x147964(0x19c))/0x7+-parseInt(_0x147964(0x1af))/0x8+-parseInt(_0x147964(0x185))/0x9*(-parseInt(_0x147964(0x193))/0xa);if(_0x10f406===_0x1f427a)break;else _0x78d5de['push'](_0x78d5de['shift']());}catch(_0x8f12c8){_0x78d5de['push'](_0x78d5de['shift']());}}}(a20_0x5088,0x6599b));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a20_0x5088(){const _0x2dfb0f=['name','resolve','Validation\x20failed:\x20','9zGMQES','cwd','filter','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)','log','\x20warning(s)\x20found','warnings','valid','\x20error(s)','warningCount','skippedCount','✔\x20All\x20','yellow','15658730JIICuW','length','2970608SCvxav','dirname','reason','dim','verbose','Validate\x20campaign\x20YAML\x20files','\x20campaign(s)\x20valid','5787173EkPFjz','campaign','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','relativePath','error','69tMdAKL','green','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','description','\x20valid','errors','\x20(skipped:\x20','endsWith','\x20non-campaign\x20file(s)\x20skipped','15554GNafrd','115jaVEwM','Error:\x20Directory\x20not\x20found:\x20','\x20campaign(s)\x20with\x20errors,\x20','red','4875368UXomhi','.yml','15642OaKqae','validCount','217378GQSiYJ'];a20_0x5088=function(){return _0x2dfb0f;};return a20_0x5088();}function a20_0xaf7d(_0x400bb2,_0x234bf6){_0x400bb2=_0x400bb2-0x184;const _0x5088dc=a20_0x5088();let _0xaf7de7=_0x5088dc[_0x400bb2];return _0xaf7de7;}import a20_0x268542 from'chalk';import a20_0xa10da8 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a20_0x1d4d71(0x1b4)]='engage:campaign:validate';[a20_0x1d4d71(0x1a4)]=a20_0x1d4d71(0x19a);async['execute'](_0x1c3055){const _0x138de3=a20_0x1d4d71,{options:_0x5617f9,args:_0x11d862}=_0x1c3055,_0x1664f1=_0x5617f9,_0x460ea4=_0x11d862[0x0],_0x870760=_0x460ea4?a20_0xa10da8[_0x138de3(0x1b5)](_0x460ea4):undefined,_0x530776=_0x870760?isYamlFile(_0x870760):![];let _0x3112b0,_0x12d6d2;if(_0x530776&&_0x870760)_0x3112b0=a20_0xa10da8[_0x138de3(0x196)](_0x870760),_0x12d6d2=_0x870760;else _0x870760?_0x3112b0=_0x870760:_0x3112b0=process[_0x138de3(0x186)]();if(!_0x12d6d2&&!existsSync(_0x3112b0))return console['error'](a20_0x268542['red'](_0x138de3(0x1ac)+_0x3112b0+'\x0a')),0x1;let _0x7d8580;if(_0x12d6d2){if(!_0x12d6d2[_0x138de3(0x1a8)](_0x138de3(0x1b0))&&!_0x12d6d2[_0x138de3(0x1a8)]('.yaml'))return console[_0x138de3(0x1a0)](a20_0x268542[_0x138de3(0x1ae)](_0x138de3(0x1a3)+_0x12d6d2+'\x0a')),0x1;_0x7d8580=[_0x12d6d2];}else _0x7d8580=findYamlFiles(_0x3112b0);if(_0x7d8580['length']===0x0)return console[_0x138de3(0x1a0)](a20_0x268542[_0x138de3(0x1ae)](_0x138de3(0x19e)+_0x3112b0+'\x0a')),0x1;const _0x3ee7c2=validateYamlFiles(_0x7d8580,_0x3112b0,{'filterType':_0x138de3(0x19d)}),_0x48649e=calculateSummary(_0x3ee7c2),_0x168ca5=_0x3ee7c2[_0x138de3(0x187)](isValidationResult);if(_0x168ca5[_0x138de3(0x194)]===0x0)return console[_0x138de3(0x1a0)](a20_0x268542[_0x138de3(0x192)](_0x138de3(0x188)+_0x3112b0+'\x0a')),_0x48649e[_0x138de3(0x190)]>0x0&&console[_0x138de3(0x1a0)](a20_0x268542[_0x138de3(0x198)]('('+_0x48649e[_0x138de3(0x190)]+'\x20non-campaign\x20file(s)\x20skipped)')),0x0;for(const _0x52b246 of _0x3ee7c2){if(!isValidationResult(_0x52b246)){_0x1664f1[_0x138de3(0x199)]&&console[_0x138de3(0x18a)](a20_0x268542['dim']('-\x20'+_0x52b246[_0x138de3(0x19f)]+_0x138de3(0x1a7)+_0x52b246[_0x138de3(0x197)]+')'));continue;}const {relativePath:_0x4921d7,source:_0x1fe526,result:_0x542376}=_0x52b246;if(_0x542376['valid']&&_0x542376[_0x138de3(0x18c)][_0x138de3(0x194)]===0x0)_0x1664f1[_0x138de3(0x199)]&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x1a2)]('✔\x20'+_0x4921d7));else _0x542376[_0x138de3(0x18d)]?(console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x192)]('⚠\x20'+_0x4921d7+':\x20'+_0x542376['warnings'][_0x138de3(0x194)]+_0x138de3(0x189))),console[_0x138de3(0x18a)](formatValidationResult(_0x542376,_0x1fe526,_0x4921d7))):(console['log'](a20_0x268542[_0x138de3(0x1ae)]('✖\x20'+_0x4921d7+':\x20'+_0x542376[_0x138de3(0x1a6)][_0x138de3(0x194)]+_0x138de3(0x18e))),console[_0x138de3(0x18a)](formatValidationResult(_0x542376,_0x1fe526,_0x4921d7)));}return console[_0x138de3(0x18a)](''),_0x48649e['hasErrors']?(console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x1ae)](_0x138de3(0x184)+_0x48649e['invalidCount']+_0x138de3(0x1ad)+_0x48649e[_0x138de3(0x1b2)]+_0x138de3(0x1a5))),_0x48649e[_0x138de3(0x18f)]>0x0&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x192)](_0x48649e['warningCount']+_0x138de3(0x18b))),_0x48649e['skippedCount']>0x0&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x198)](_0x48649e[_0x138de3(0x190)]+_0x138de3(0x1a9))),0x1):(console['log'](a20_0x268542[_0x138de3(0x1a2)](_0x138de3(0x191)+_0x48649e[_0x138de3(0x1b2)]+_0x138de3(0x19b))),_0x48649e[_0x138de3(0x18f)]>0x0&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x192)](_0x48649e[_0x138de3(0x18f)]+_0x138de3(0x18b))),_0x48649e[_0x138de3(0x190)]>0x0&&console[_0x138de3(0x18a)](a20_0x268542[_0x138de3(0x198)](_0x48649e[_0x138de3(0x190)]+_0x138de3(0x1a9))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_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_0x37d13a=a21_0x1caa;(function(_0x1f5747,_0x4143bc){const _0x21c9a7=a21_0x1caa,_0x220373=_0x1f5747();while(!![]){try{const _0x3b684e=-parseInt(_0x21c9a7(0xf0))/0x1*(-parseInt(_0x21c9a7(0x15c))/0x2)+parseInt(_0x21c9a7(0x1b3))/0x3+-parseInt(_0x21c9a7(0x187))/0x4*(-parseInt(_0x21c9a7(0x1a8))/0x5)+parseInt(_0x21c9a7(0x127))/0x6*(parseInt(_0x21c9a7(0x132))/0x7)+parseInt(_0x21c9a7(0x12e))/0x8+parseInt(_0x21c9a7(0xf1))/0x9*(parseInt(_0x21c9a7(0x1ba))/0xa)+-parseInt(_0x21c9a7(0x10a))/0xb*(parseInt(_0x21c9a7(0x170))/0xc);if(_0x3b684e===_0x4143bc)break;else _0x220373['push'](_0x220373['shift']());}catch(_0x11d79f){_0x220373['push'](_0x220373['shift']());}}}(a21_0x9435,0xccf28));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';function a21_0x1caa(_0x1a025f,_0x49f3f8){_0x1a025f=_0x1a025f-0xe6;const _0x9435a6=a21_0x9435();let _0x1caad2=_0x9435a6[_0x1a025f];return _0x1caad2;}import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl,getTemplateUrl,getWorkspaceUrl}from'../sdk/client/endpoints.js';import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a21_0x1a6dad from'chalk';export async function resolveWorkspaceIdFromOptions(_0x2057f7,_0x565046,_0xde1a9=![]){const _0x348796=a21_0x1caa;if(_0x2057f7[_0x348796(0x19b)])return await _0x565046[_0x348796(0x164)][_0x348796(0x11a)](_0x2057f7[_0x348796(0x19b)]);const _0x25c36c=loadSessionContext(_0x2057f7[_0x348796(0xf5)]);if(_0x25c36c?.['engage_workspace'])return await _0x565046[_0x348796(0x164)]['resolveWorkspaceId'](_0x25c36c[_0x348796(0x1ab)]);if(_0xde1a9)throw new SDKError(ErrorCode[_0x348796(0x140)],_0x348796(0x1ac),undefined,{'helpText':_0x348796(0x193)});return undefined;}async function resolveSegmentFromOptions(_0x17d336,_0x932c73){const _0x412b59=a21_0x1caa;if(!_0x17d336[_0x412b59(0x144)])return{};const _0x2ec8b6=_0x17d336['segment'],_0x5ad1aa=await _0x932c73[_0x412b59(0x144)]['resolvePathToResource'](_0x2ec8b6);return{'audienceId':_0x5ad1aa[_0x412b59(0x14e)],'audienceName':_0x5ad1aa[_0x412b59(0x17c)],..._0x5ad1aa[_0x412b59(0x1bf)]&&{'segmentId':_0x5ad1aa['segmentId'],'segmentName':_0x5ad1aa['segmentName']}};}function buildConnectorConfig(_0x2f7215){const _0x5b46c8=a21_0x1caa,_0x310d05=_0x2f7215[_0x5b46c8(0xfc)],_0x3ecfd1=_0x2f7215[_0x5b46c8(0x14b)];if(!_0x310d05&&!_0x3ecfd1)return undefined;return{..._0x310d05&&{'emailSenderId':_0x310d05},..._0x3ecfd1&&{'jsonColumns':_0x3ecfd1}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a21_0x37d13a(0x1b0);['description']=a21_0x37d13a(0x160);async[a21_0x37d13a(0x11f)](_0x262b89){const _0x4c9023=a21_0x37d13a,{options:_0x377f8c,args:_0x1713a1,tdx:_0x1b28fd}=_0x262b89,_0x36ea2d=_0x1713a1[0x0],_0x457c84=resolveLimit(_0x377f8c[_0x4c9023(0x169)],DEFAULT_LLM_LIMIT),_0x3cb0e5=_0x377f8c,_0x28ec1f=_0x3cb0e5[_0x4c9023(0xea)],_0x13b9e8=[_0x4c9023(0x1af),_0x4c9023(0x147),_0x4c9023(0x149),_0x4c9023(0x178)],_0x506a05=_0x3cb0e5['status'],_0xb8aee3=_0x506a05?.[_0x4c9023(0x19e)]();if(_0xb8aee3&&!_0x13b9e8[_0x4c9023(0x13e)](_0xb8aee3))return console[_0x4c9023(0xf7)](_0x4c9023(0x15e)+_0x506a05+'\x22.\x20Valid\x20values:\x20'+_0x13b9e8[_0x4c9023(0x17e)](',\x20')),0x1;const _0xdd0af3=await resolveWorkspaceIdFromOptions(_0x3cb0e5,_0x1b28fd),_0x23253f=await withSpinner(_0x4c9023(0x186),()=>_0x1b28fd['engage']['listCampaigns']({'type':_0x28ec1f,'status':_0xb8aee3,'workspaceId':_0xdd0af3,'limit':_0x457c84}),{'verbose':_0x377f8c[_0x4c9023(0xe6)]});let _0x1accdf=_0x23253f[_0x4c9023(0x166)];_0xb8aee3&&(_0x1accdf=_0x1accdf['filter'](_0x3a48c7=>_0x3a48c7[_0x4c9023(0x102)]['toUpperCase']()===_0xb8aee3));_0x36ea2d&&(_0x1accdf=_0x1accdf['filter'](_0x102c7f=>matchGlobPattern(_0x102c7f[_0x4c9023(0x105)],_0x36ea2d)));const _0x45bda7=_0x377f8c[_0x4c9023(0x10e)];if(isStructuredFormat(_0x377f8c)){const _0x2e7c0d=_0x1accdf[_0x4c9023(0x101)](_0x4ff877=>({..._0x4ff877,'url':_0x4ff877['workspaceId']?getCampaignUrl(_0x45bda7,_0x4ff877[_0x4c9023(0x198)],_0x4ff877['id']):undefined}));await handleSDKOutput(_0x2e7c0d,_0x377f8c);}else for(const _0x446681 of _0x1accdf){const _0x42e922=a21_0x1a6dad[_0x4c9023(0x195)]('\x20('+_0x446681[_0x4c9023(0x102)][_0x4c9023(0x133)]()+')'),_0x309de8=_0x446681[_0x4c9023(0x198)]?getCampaignUrl(_0x45bda7,_0x446681[_0x4c9023(0x198)],_0x446681['id']):undefined,_0x1669ba=_0x309de8?hyperlink(_0x446681[_0x4c9023(0x105)],_0x309de8):_0x446681[_0x4c9023(0x105)];console[_0x4c9023(0x19c)](_0x4c9023(0x18a)+_0x1669ba+_0x42e922);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0xfa);[a21_0x37d13a(0x1a0)]='Show\x20campaign\x20details';async[a21_0x37d13a(0x11f)](_0x213b1e){const _0x48ef1f=a21_0x37d13a,{options:_0x4ebb23,args:_0x159438,tdx:_0x5d2bcf}=_0x213b1e;if(_0x159438[_0x48ef1f(0x134)]===0x0)return console['error'](_0x48ef1f(0x114)),console[_0x48ef1f(0xf7)](_0x48ef1f(0x116)),0x1;const _0x44a4a9=_0x159438[0x0],_0x300acc=_0x4ebb23,_0x2c381a=await resolveWorkspaceIdFromOptions(_0x300acc,_0x5d2bcf),_0x8812c7=_0x300acc[_0x48ef1f(0x16d)],_0x343840=_0x4ebb23[_0x48ef1f(0x10e)];if(_0x8812c7){const _0x5ebdce=await withSpinner(_0x48ef1f(0x15d)+_0x44a4a9+_0x48ef1f(0x192),()=>_0x5d2bcf['engage'][_0x48ef1f(0x182)](_0x44a4a9,_0x2c381a),{'verbose':_0x4ebb23[_0x48ef1f(0xe6)]}),_0x59a023=_0x5ebdce['data'],_0x3cc0d8=_0x59a023['attributes'][_0x48ef1f(0x198)]?getCampaignUrl(_0x343840,_0x59a023['attributes'][_0x48ef1f(0x198)],_0x59a023['id']):undefined;await handleSDKOutput([{..._0x59a023,..._0x3cc0d8&&{'url':_0x3cc0d8}}],_0x4ebb23);}else{const _0x212f71=await withSpinner(_0x48ef1f(0x15d)+_0x44a4a9+_0x48ef1f(0x192),()=>_0x5d2bcf[_0x48ef1f(0x164)][_0x48ef1f(0x130)](_0x44a4a9,_0x2c381a),{'verbose':_0x4ebb23[_0x48ef1f(0xe6)]}),_0x2d64a4=_0x212f71[_0x48ef1f(0x166)],_0x23c585=_0x2d64a4[_0x48ef1f(0x198)]?getCampaignUrl(_0x343840,_0x2d64a4['workspaceId'],_0x2d64a4['id']):undefined;await handleSingleObjectOutput({..._0x2d64a4,..._0x23c585&&{'url':_0x23c585}},_0x4ebb23);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a21_0x37d13a(0x129);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x17a);async[a21_0x37d13a(0x11f)](_0x4694ca){const _0x5748f5=a21_0x37d13a,{options:_0xbdd397,tdx:_0x5073f3}=_0x4694ca,_0x10d112=_0xbdd397,_0x494986=_0x10d112[_0x5748f5(0x105)],_0x20a7b0=_0x10d112[_0x5748f5(0xea)];if(!_0x494986)return console['error'](_0x5748f5(0x14c)),console[_0x5748f5(0xf7)](_0x5748f5(0x17b)),0x1;if(!_0x20a7b0)return console[_0x5748f5(0xf7)](_0x5748f5(0x123)),console[_0x5748f5(0xf7)](_0x5748f5(0x17b)),0x1;const _0x3719e3=await resolveWorkspaceIdFromOptions(_0x10d112,_0x5073f3,!![]),_0x2d1d40=await resolveSegmentFromOptions(_0x10d112,_0x5073f3),_0x15ea15=buildConnectorConfig(_0x10d112),_0xde13e3={'name':_0x494986,'campaignType':_0x20a7b0,'workspaceId':_0x3719e3,'description':_0x10d112[_0x5748f5(0x1a0)],..._0x2d1d40,'connectorConfig':_0x15ea15,'startAt':_0x10d112[_0x5748f5(0x103)],'timezone':_0x10d112[_0x5748f5(0x18b)]},_0x4b3ae7=await withSpinner(_0x5748f5(0x163)+_0x494986+_0x5748f5(0x192),()=>_0x5073f3[_0x5748f5(0x164)]['createCampaign'](_0xde13e3));return await handleSDKOutput([_0x4b3ae7[_0x5748f5(0x166)]],_0xbdd397),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a21_0x37d13a(0xe8);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x1b4);async[a21_0x37d13a(0x11f)](_0x4ed295){const _0xeb7ec=a21_0x37d13a,{options:_0x5353a6,args:_0x14d623,tdx:_0x20242c}=_0x4ed295;if(_0x14d623[_0xeb7ec(0x134)]===0x0)return console[_0xeb7ec(0xf7)](_0xeb7ec(0x114)),console[_0xeb7ec(0xf7)](_0xeb7ec(0x197)),0x1;const _0xfa05e4=_0x14d623[0x0],_0x3ee0d5=_0x5353a6,_0xdd5f5c=await resolveWorkspaceIdFromOptions(_0x3ee0d5,_0x20242c),_0x2bfa20=await resolveSegmentFromOptions(_0x3ee0d5,_0x20242c),_0x6327ac=buildConnectorConfig(_0x3ee0d5),_0x1c646a={'name':_0x3ee0d5[_0xeb7ec(0x105)],'description':_0x3ee0d5[_0xeb7ec(0x1a0)],..._0x2bfa20,'connectorConfig':_0x6327ac,'startAt':_0x3ee0d5[_0xeb7ec(0x103)],'timezone':_0x3ee0d5['timezone']},_0x4b522b=Object[_0xeb7ec(0xeb)](Object[_0xeb7ec(0xf2)](_0x1c646a)[_0xeb7ec(0x1a1)](([,_0x3e0d11])=>_0x3e0d11!==undefined));if(Object[_0xeb7ec(0x119)](_0x4b522b)[_0xeb7ec(0x134)]===0x0)return console[_0xeb7ec(0xf7)](_0xeb7ec(0x15f)),console['error'](_0xeb7ec(0x15a)),0x1;const _0x59e6e6=await withSpinner(_0xeb7ec(0x12a)+_0xfa05e4+_0xeb7ec(0x192),()=>_0x20242c[_0xeb7ec(0x164)]['updateCampaign'](_0xfa05e4,_0x4b522b,_0xdd5f5c),{'verbose':_0x5353a6[_0xeb7ec(0xe6)]});return await handleSDKOutput([_0x59e6e6[_0xeb7ec(0x166)]],_0x5353a6),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x120);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x14d);async[a21_0x37d13a(0x11f)](_0x599813){const _0x4d0e02=a21_0x37d13a,{options:_0x242e32,args:_0x1e1445,tdx:_0x3b8ee5}=_0x599813;if(_0x1e1445[_0x4d0e02(0x134)]===0x0)return console[_0x4d0e02(0xf7)](_0x4d0e02(0x114)),console[_0x4d0e02(0xf7)](_0x4d0e02(0x183)),0x1;const _0x2f783c=_0x1e1445[0x0],_0x41f090=_0x242e32,_0x4b06a3=await resolveWorkspaceIdFromOptions(_0x41f090,_0x3b8ee5);if(!_0x242e32[_0x4d0e02(0x1a9)]){const _0x21486b=await confirm(_0x4d0e02(0x13b)+_0x2f783c+_0x4d0e02(0x107));if(!_0x21486b)return console[_0x4d0e02(0x19c)](_0x4d0e02(0x173)),0x0;}return await withSpinner('Deleting\x20campaign\x20\x27'+_0x2f783c+_0x4d0e02(0x192),()=>_0x3b8ee5[_0x4d0e02(0x164)][_0x4d0e02(0x113)](_0x2f783c,_0x4b06a3),{'verbose':_0x242e32[_0x4d0e02(0xe6)]}),console[_0x4d0e02(0x19c)]('Campaign\x20\x27'+_0x2f783c+_0x4d0e02(0x1ae)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x1a3);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x1bd);async[a21_0x37d13a(0x11f)](_0x4ed7cc){const _0x46e082=a21_0x37d13a,{options:_0x1966ca,args:_0xae352f,tdx:_0x2c1a93}=_0x4ed7cc;if(_0xae352f[_0x46e082(0x134)]===0x0)return console['error'](_0x46e082(0x114)),console['error'](_0x46e082(0x12d)),0x1;const _0x36c669=_0xae352f[0x0],_0x43cca5=_0x1966ca,_0x3ef2c3=await resolveWorkspaceIdFromOptions(_0x43cca5,_0x2c1a93);return await withSpinner(_0x46e082(0x179)+_0x36c669+_0x46e082(0x192),()=>_0x2c1a93['engage'][_0x46e082(0x13c)](_0x36c669,_0x3ef2c3),{'verbose':_0x1966ca['verbose']}),console[_0x46e082(0x19c)](_0x46e082(0x1b6)+_0x36c669+_0x46e082(0x1be)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a21_0x37d13a(0x105)]='engage:campaign:pause';['description']=a21_0x37d13a(0x1c0);async['execute'](_0x70ea9b){const _0xafad5a=a21_0x37d13a,{options:_0x2741ad,args:_0x55724c,tdx:_0x55361e}=_0x70ea9b;if(_0x55724c[_0xafad5a(0x134)]===0x0)return console['error'](_0xafad5a(0x114)),console[_0xafad5a(0xf7)](_0xafad5a(0x188)),0x1;const _0x4257bb=_0x55724c[0x0],_0x4bf2cf=_0x2741ad,_0x15860b=await resolveWorkspaceIdFromOptions(_0x4bf2cf,_0x55361e);return await withSpinner(_0xafad5a(0x152)+_0x4257bb+_0xafad5a(0x192),()=>_0x55361e['engage'][_0xafad5a(0x1bc)](_0x4257bb,_0x15860b),{'verbose':_0x2741ad[_0xafad5a(0xe6)]}),console[_0xafad5a(0x19c)]('Campaign\x20\x27'+_0x4257bb+_0xafad5a(0x1a7)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x177);['description']=a21_0x37d13a(0x190);async[a21_0x37d13a(0x11f)](_0x5deee8){const _0x23880e=a21_0x37d13a,{options:_0xcce1f,args:_0x11f503,tdx:_0x5c99cd}=_0x5deee8;if(_0x11f503['length']===0x0)return console[_0x23880e(0xf7)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x23880e(0xf7)](_0x23880e(0x16e)),0x1;const _0x1eb85f=_0x11f503[0x0],_0x32febe=_0xcce1f,_0x5c2627=await resolveWorkspaceIdFromOptions(_0x32febe,_0x5c99cd);return await withSpinner(_0x23880e(0x10d)+_0x1eb85f+'\x27...',()=>_0x5c99cd[_0x23880e(0x164)][_0x23880e(0x13f)](_0x1eb85f,_0x5c2627),{'verbose':_0xcce1f['verbose']}),console[_0x23880e(0x19c)](_0x23880e(0x1b6)+_0x1eb85f+_0x23880e(0x125)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a21_0x37d13a(0x105)]='engage:campaign:duplicate';[a21_0x37d13a(0x1a0)]='Duplicate\x20a\x20campaign';async[a21_0x37d13a(0x11f)](_0x598186){const _0x4c6882=a21_0x37d13a,{options:_0x53c009,args:_0xffd883,tdx:_0x3d367b}=_0x598186;if(_0xffd883[_0x4c6882(0x134)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4c6882(0xf7)](_0x4c6882(0xe9)),0x1;const _0x2fb48f=_0xffd883[0x0],_0x3f0b89=_0x53c009,_0x303d3f=await resolveWorkspaceIdFromOptions(_0x3f0b89,_0x3d367b),_0x7b8787=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x2fb48f+'\x27...',()=>_0x3d367b[_0x4c6882(0x164)][_0x4c6882(0x1a4)](_0x2fb48f,_0x303d3f),{'verbose':_0x53c009[_0x4c6882(0xe6)]});return await handleSDKOutput([_0x7b8787[_0x4c6882(0x166)]],_0x53c009),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x139);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x10f);async[a21_0x37d13a(0x11f)](_0x4950ed){const _0x21ba11=a21_0x37d13a,{options:_0x39cdb7,args:_0x422295,tdx:_0x424743}=_0x4950ed,_0x470927=_0x422295[0x0],_0x347922=resolveLimit(_0x39cdb7[_0x21ba11(0x169)],DEFAULT_LLM_LIMIT),_0x4586fa=_0x39cdb7,_0x5d0d02=await resolveWorkspaceIdFromOptions(_0x4586fa,_0x424743),_0x4f22f3=await withSpinner(_0x21ba11(0x1b5),()=>_0x424743[_0x21ba11(0x164)]['listTemplates']({'workspaceId':_0x5d0d02,'limit':_0x347922}),{'verbose':_0x39cdb7[_0x21ba11(0xe6)]});let _0x53a51c=_0x4f22f3['data'];_0x470927&&(_0x53a51c=_0x4f22f3[_0x21ba11(0x166)][_0x21ba11(0x1a1)](_0xc0f89b=>matchGlobPattern(_0xc0f89b[_0x21ba11(0x105)],_0x470927)));const _0x20db1d=_0x39cdb7[_0x21ba11(0x10e)];if(isStructuredFormat(_0x39cdb7))await handleSDKOutput(_0x53a51c,_0x39cdb7);else for(const _0x382e73 of _0x53a51c){const _0x52cd0a=_0x382e73[_0x21ba11(0x198)]?getTemplateUrl(_0x20db1d,_0x382e73[_0x21ba11(0x198)],_0x382e73['id']):undefined,_0x29bb38=_0x52cd0a?hyperlink(_0x382e73[_0x21ba11(0x105)],_0x52cd0a):_0x382e73[_0x21ba11(0x105)];console[_0x21ba11(0x19c)]('📝\x20'+_0x29bb38);}return 0x0;}}function a21_0x9435(){const _0xcc19d7=['Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','workspaceId','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Show\x20email\x20template\x20details','workspace','log','Update\x20an\x20email\x20template','toUpperCase','deleteWorkspace','description','filter','Deleting\x20always-on\x20campaign\x20\x27','engage:campaign:launch','duplicateCampaign','Error:\x20Workspace\x20name\x20is\x20required','resumeAlwaysOnCampaign','\x27\x20paused\x20successfully','20GbyYjP','yes','Delete\x20an\x20email\x20template','engage_workspace','Workspace\x20is\x20required\x20for\x20this\x20operation','\x27\x20finished\x20successfully','\x27\x20deleted\x20successfully','DRAFT','engage:campaigns','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Launch\x20an\x20always-on\x20campaign','278604yCELpe','Update\x20a\x20campaign','Fetching\x20templates...','Campaign\x20\x27','engage:workspaces','Updating\x20template\x20\x27','engage:workspace:update','11477490giYGfV','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','pauseCampaign','Launch\x20a\x20campaign','\x27\x20launched\x20successfully','segmentId','Pause\x20a\x20campaign','verbose','subject','engage:campaign:update','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','type','fromEntries','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27','Create\x20a\x20workspace','listAlwaysOnCampaigns','getTemplate','363277JGyWkd','9Bysumb','entries','plaintext','Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>','session','duplicateAlwaysOnCampaign','error','createTemplate','engage:always-on-campaign:resume','engage:campaign:show','Update\x20a\x20workspace','emailSenderId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Resuming\x20always-on\x20campaign\x20\x27','Duplicate\x20an\x20always-on\x20campaign','map','status','startAt','updateAlwaysOnCampaign','name','Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27?\x20This\x20cannot\x20be\x20undone.','Delete\x20an\x20always-on\x20campaign','pauseAlwaysOnCampaign','11JCEUCt','LIVE','Create\x20an\x20email\x20template','Resuming\x20campaign\x20\x27','site','List\x20email\x20templates','createWorkspace','finishAlwaysOnCampaign','Always-on\x20campaign\x20\x27','deleteCampaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','grapesjs','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','engage:always-on-campaign:delete','engage:template:create','keys','resolveWorkspaceId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>','engage:always-on-campaigns','Creating\x20always-on\x20campaign\x20\x27','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','execute','engage:campaign:delete','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','\x22.\x20Valid\x20values:\x20','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','\x27\x20resumed\x20successfully','Update\x20an\x20always-on\x20campaign','12HPZpoU','Updating\x20workspace\x20\x27','engage:campaign:create','Updating\x20campaign\x20\x27','Finish\x20an\x20always-on\x20campaign','Verifying\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','1954448MPfixG','attributes','getCampaign','Template\x20\x27','1526910CAMsrL','toLowerCase','length','Error:\x20--subject\x20is\x20required','Set\x20workspace\x20context\x20for\x20Engage\x20commands','getAlwaysOnCampaign','Duplicating\x20always-on\x20campaign\x20\x27','engage:templates','getAlwaysOnCampaignFull','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','launchCampaign','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','includes','resumeCampaign','MISSING_ARGUMENT','Updating\x20always-on\x20campaign\x20\x27','engage:always-on-campaign:create','Launching\x20always-on\x20campaign\x20\x27','segment','html','getWorkspaceFull','ACTIVE','engage:workspace:create','PAUSED','Pause\x20an\x20always-on\x20campaign','jsonColumns','Error:\x20--name\x20is\x20required','Delete\x20a\x20campaign','parentId','Fetching\x20workspaces...','🏢\x20','deleteAlwaysOnCampaign','Pausing\x20campaign\x20\x27','Finishing\x20always-on\x20campaign\x20\x27','Workspace\x20\x27','Options:\x20--name,\x20--description','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:always-on-campaign:launch','engage:always-on-campaign:duplicate','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','launchAlwaysOnCampaign','2rUXCwe','Fetching\x20campaign\x20\x27','Error:\x20Invalid\x20status\x20\x22','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','List\x20campaigns','updateWorkspace','enableUtmTracking','Creating\x20campaign\x20\x27','engage','audienceName','data','engage:workspace:delete','engage:always-on-campaign:pause','limit','Fetching\x20always-on\x20campaign\x20\x27','deleteTemplate','htmlFile','full','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Fetching\x20always-on\x20campaigns...','23857248ZijTHI','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','FINISHED','Operation\x20cancelled','listWorkspaces','Fetching\x20template\x20\x27','engage:template:show','engage:campaign:resume','COMPLETED','Launching\x20campaign\x20\x27','Create\x20a\x20new\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','parentName','engage:always-on-campaign:update','join','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>','Show\x20workspace\x20details','getCampaignFull','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','engage:always-on-campaign:finish','engage:template:delete','Fetching\x20campaigns...','543108YcisTH','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Delete\x20a\x20workspace','📧\x20','timezone','editorType','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','List\x20always-on\x20campaigns','Resume\x20a\x20paused\x20campaign','Creating\x20workspace\x20\x27','\x27...','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','dim','Creating\x20template\x20\x27'];a21_0x9435=function(){return _0xcc19d7;};return a21_0x9435();}export class EngageTemplateShowCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x176);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x19a);async['execute'](_0x5eecc7){const _0x1d9fc2=a21_0x37d13a,{options:_0x55b590,args:_0x37b836,tdx:_0x3bcc6e}=_0x5eecc7;if(_0x37b836[_0x1d9fc2(0x134)]===0x0)return console[_0x1d9fc2(0xf7)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0xba5d5c=_0x37b836[0x0],_0x18f196=_0x55b590,_0x193a43=await resolveWorkspaceIdFromOptions(_0x18f196,_0x3bcc6e),_0x339a2a=_0x18f196[_0x1d9fc2(0x16d)];if(_0x339a2a){const _0x3a587d=await withSpinner('Fetching\x20template\x20\x27'+_0xba5d5c+_0x1d9fc2(0x192),()=>_0x3bcc6e['engage']['getTemplateFull'](_0xba5d5c,_0x193a43),{'verbose':_0x55b590[_0x1d9fc2(0xe6)]});await handleSDKOutput([_0x3a587d],_0x55b590);}else{const _0x1d2922=await withSpinner(_0x1d9fc2(0x175)+_0xba5d5c+_0x1d9fc2(0x192),()=>_0x3bcc6e[_0x1d9fc2(0x164)][_0x1d9fc2(0xef)](_0xba5d5c,_0x193a43),{'verbose':_0x55b590[_0x1d9fc2(0xe6)]});await handleSDKOutput([_0x1d2922],_0x55b590);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x118);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x10c);async[a21_0x37d13a(0x11f)](_0x442e8d){const _0x454ff4=a21_0x37d13a,{options:_0x43d6cd,tdx:_0x125807}=_0x442e8d,_0x41b90c=_0x43d6cd,_0x21c1bd=_0x41b90c[_0x454ff4(0x105)],_0x10314e=_0x41b90c[_0x454ff4(0xe7)],_0x137e95=_0x41b90c[_0x454ff4(0x145)],_0x4d2ad0=_0x41b90c['htmlFile'];if(!_0x21c1bd)return console[_0x454ff4(0xf7)](_0x454ff4(0x14c)),console[_0x454ff4(0xf7)](_0x454ff4(0x199)),0x1;if(!_0x10314e)return console[_0x454ff4(0xf7)](_0x454ff4(0x135)),0x1;if(_0x137e95&&_0x4d2ad0)return console[_0x454ff4(0xf7)](_0x454ff4(0x17f)),0x1;const _0x2d3663=_0x4d2ad0?readFileContent(_0x4d2ad0):_0x137e95;if(!_0x2d3663)return console[_0x454ff4(0xf7)](_0x454ff4(0x11e)),0x1;const _0x30d109=await resolveWorkspaceIdFromOptions(_0x41b90c,_0x125807,!![]),_0xdbe75d={'name':_0x21c1bd,'subjectTemplate':_0x10314e,'htmlTemplate':_0x2d3663,'workspaceId':_0x30d109,'plaintextTemplate':_0x41b90c['plaintext'],'editorType':_0x41b90c[_0x454ff4(0x18c)]??_0x454ff4(0x115)},_0x5de063=await withSpinner(_0x454ff4(0x196)+_0x21c1bd+_0x454ff4(0x192),()=>_0x125807[_0x454ff4(0x164)][_0x454ff4(0xf8)](_0xdbe75d));return await handleSDKOutput([_0x5de063[_0x454ff4(0x166)]],_0x43d6cd),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a21_0x37d13a(0x105)]='engage:template:update';[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x19d);async[a21_0x37d13a(0x11f)](_0x310a27){const _0x3a95ed=a21_0x37d13a,{options:_0x3b421e,args:_0x341aac,tdx:_0x2c0d06}=_0x310a27;if(_0x341aac[_0x3a95ed(0x134)]===0x0)return console['error'](_0x3a95ed(0x1b1)),console['error']('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x4dd959=_0x341aac[0x0],_0xea615c=_0x3b421e,_0x154f23=_0xea615c[_0x3a95ed(0x145)],_0x25a580=_0xea615c[_0x3a95ed(0x16c)];if(_0x154f23&&_0x25a580)return console[_0x3a95ed(0xf7)]('Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file'),0x1;const _0x33a77a=_0x25a580?readFileContent(_0x25a580):_0x154f23,_0x505c06=await resolveWorkspaceIdFromOptions(_0xea615c,_0x2c0d06),_0x3f292b={'name':_0xea615c[_0x3a95ed(0x105)],'subjectTemplate':_0xea615c[_0x3a95ed(0xe7)],'htmlTemplate':_0x33a77a,'plaintextTemplate':_0xea615c[_0x3a95ed(0xf3)]},_0x269676=Object[_0x3a95ed(0xeb)](Object[_0x3a95ed(0xf2)](_0x3f292b)[_0x3a95ed(0x1a1)](([,_0x4e0956])=>_0x4e0956!==undefined));if(Object['keys'](_0x269676)[_0x3a95ed(0x134)]===0x0)return console[_0x3a95ed(0xf7)](_0x3a95ed(0x15f)),console[_0x3a95ed(0xf7)](_0x3a95ed(0x13d)),0x1;const _0x3defcd=await withSpinner(_0x3a95ed(0x1b8)+_0x4dd959+_0x3a95ed(0x192),()=>_0x2c0d06[_0x3a95ed(0x164)]['updateTemplate'](_0x4dd959,_0x269676,_0x505c06),{'verbose':_0x3b421e[_0x3a95ed(0xe6)]});return await handleSDKOutput([_0x3defcd[_0x3a95ed(0x166)]],_0x3b421e),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x185);['description']=a21_0x37d13a(0x1aa);async[a21_0x37d13a(0x11f)](_0x6c266f){const _0x248609=a21_0x37d13a,{options:_0x52608d,args:_0x551515,tdx:_0x337a93}=_0x6c266f;if(_0x551515[_0x248609(0x134)]===0x0)return console[_0x248609(0xf7)](_0x248609(0x1b1)),console[_0x248609(0xf7)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x3407e3=_0x551515[0x0],_0x521e97=_0x52608d,_0x107290=await resolveWorkspaceIdFromOptions(_0x521e97,_0x337a93);if(!_0x52608d[_0x248609(0x1a9)]){const _0x51a49f=await confirm(_0x248609(0xfe)+_0x3407e3+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x51a49f)return console[_0x248609(0x19c)](_0x248609(0x173)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x3407e3+_0x248609(0x192),()=>_0x337a93[_0x248609(0x164)][_0x248609(0x16b)](_0x3407e3,_0x107290),{'verbose':_0x52608d[_0x248609(0xe6)]}),console[_0x248609(0x19c)](_0x248609(0x131)+_0x3407e3+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x1b7);[a21_0x37d13a(0x1a0)]='List\x20workspaces';async[a21_0x37d13a(0x11f)](_0x368277){const _0x32f81b=a21_0x37d13a,{options:_0x32ef8c,args:_0x3e7fb7,tdx:_0x728979}=_0x368277,_0x2756a8=_0x3e7fb7[0x0],_0x5e9d6f=resolveLimit(_0x32ef8c['limit'],DEFAULT_LLM_LIMIT),_0x595120=await withSpinner(_0x32f81b(0x14f),()=>_0x728979[_0x32f81b(0x164)][_0x32f81b(0x174)]({'limit':_0x5e9d6f}),{'verbose':_0x32ef8c[_0x32f81b(0xe6)]});let _0x843440=_0x595120[_0x32f81b(0x166)];_0x2756a8&&(_0x843440=_0x595120['data'][_0x32f81b(0x1a1)](_0x1d82ff=>matchGlobPattern(_0x1d82ff[_0x32f81b(0x105)],_0x2756a8)));const _0x39ff1b=_0x32ef8c['site'];if(isStructuredFormat(_0x32ef8c))await handleSDKOutput(_0x843440,_0x32ef8c);else for(const _0x1cec1d of _0x843440){const _0x334d01=getWorkspaceUrl(_0x39ff1b,_0x1cec1d['id']),_0x5d5fae=hyperlink(_0x1cec1d[_0x32f81b(0x105)],_0x334d01);console['log'](_0x32f81b(0x150)+_0x5d5fae);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']='engage:workspace:show';[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x181);async[a21_0x37d13a(0x11f)](_0xc49ad1){const _0x4b4cbc=a21_0x37d13a,{options:_0x3892da,args:_0x5773ba,tdx:_0x1aeafb}=_0xc49ad1;if(_0x5773ba[_0x4b4cbc(0x134)]===0x0)return console[_0x4b4cbc(0xf7)](_0x4b4cbc(0x18d)),console[_0x4b4cbc(0xf7)](_0x4b4cbc(0x121)),0x1;const _0x40b05d=_0x5773ba[0x0],_0x2e3fb0=_0x3892da,_0x2163e2=_0x2e3fb0[_0x4b4cbc(0x16d)];if(_0x2163e2){const _0x944707=await withSpinner('Fetching\x20workspace\x20\x27'+_0x40b05d+_0x4b4cbc(0x192),()=>_0x1aeafb[_0x4b4cbc(0x164)][_0x4b4cbc(0x146)](_0x40b05d),{'verbose':_0x3892da[_0x4b4cbc(0xe6)]});await handleSDKOutput([_0x944707],_0x3892da);}else{const _0x18cae7=await withSpinner('Fetching\x20workspace\x20\x27'+_0x40b05d+_0x4b4cbc(0x192),()=>_0x1aeafb[_0x4b4cbc(0x164)]['getWorkspace'](_0x40b05d),{'verbose':_0x3892da[_0x4b4cbc(0xe6)]});await handleSDKOutput([_0x18cae7],_0x3892da);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a21_0x37d13a(0x148);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0xed);async[a21_0x37d13a(0x11f)](_0x337355){const _0x1b326c=a21_0x37d13a,{options:_0x127e4e,tdx:_0x3b65ea}=_0x337355,_0xd48459=_0x127e4e,_0x6246a=_0xd48459['name'];if(!_0x6246a)return console[_0x1b326c(0xf7)]('Error:\x20--name\x20is\x20required'),console['error'](_0x1b326c(0x18e)),0x1;const _0x53ae03={'name':_0x6246a,'description':_0xd48459[_0x1b326c(0x1a0)]},_0x187890=await withSpinner(_0x1b326c(0x191)+_0x6246a+_0x1b326c(0x192),()=>_0x3b65ea[_0x1b326c(0x164)][_0x1b326c(0x110)](_0x53ae03));return await handleSDKOutput([_0x187890[_0x1b326c(0x166)]],_0x127e4e),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x1b9);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0xfb);async[a21_0x37d13a(0x11f)](_0x3910a4){const _0x171f6b=a21_0x37d13a,{options:_0x308002,args:_0x1683c3,tdx:_0xa0639e}=_0x3910a4;if(_0x1683c3[_0x171f6b(0x134)]===0x0)return console['error'](_0x171f6b(0x18d)),console[_0x171f6b(0xf7)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x2f52bb=_0x1683c3[0x0],_0x5d660b=_0x308002,_0x4c1a65={'name':_0x5d660b['name'],'description':_0x5d660b[_0x171f6b(0x1a0)]},_0xe49f20=Object[_0x171f6b(0xeb)](Object[_0x171f6b(0xf2)](_0x4c1a65)[_0x171f6b(0x1a1)](([,_0x2459f4])=>_0x2459f4!==undefined));if(Object[_0x171f6b(0x119)](_0xe49f20)['length']===0x0)return console[_0x171f6b(0xf7)](_0x171f6b(0x15f)),console[_0x171f6b(0xf7)](_0x171f6b(0x155)),0x1;const _0x4c5773=await withSpinner(_0x171f6b(0x128)+_0x2f52bb+_0x171f6b(0x192),()=>_0xa0639e[_0x171f6b(0x164)][_0x171f6b(0x161)](_0x2f52bb,_0xe49f20),{'verbose':_0x308002['verbose']});return await handleSDKOutput([_0x4c5773['data']],_0x308002),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a21_0x37d13a(0x167);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x189);async[a21_0x37d13a(0x11f)](_0x1aa079){const _0x1aa867=a21_0x37d13a,{options:_0x5b76e6,args:_0x391ed5,tdx:_0x40a6ad}=_0x1aa079;if(_0x391ed5[_0x1aa867(0x134)]===0x0)return console['error'](_0x1aa867(0x18d)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x183cec=_0x391ed5[0x0];if(!_0x5b76e6[_0x1aa867(0x1a9)]){const _0x5180e8=await confirm(_0x1aa867(0x157)+_0x183cec+_0x1aa867(0x107));if(!_0x5180e8)return console[_0x1aa867(0x19c)](_0x1aa867(0x173)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x183cec+'\x27...',()=>_0x40a6ad[_0x1aa867(0x164)][_0x1aa867(0x19f)](_0x183cec),{'verbose':_0x5b76e6['verbose']}),console[_0x1aa867(0x19c)](_0x1aa867(0x154)+_0x183cec+_0x1aa867(0x1ae)),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x11c);['description']=a21_0x37d13a(0x18f);async['execute'](_0xa0e6fd){const _0x4b332f=a21_0x37d13a,{options:_0x452660,args:_0x3487ef,tdx:_0x50411f}=_0xa0e6fd,_0x29a86c=_0x3487ef[0x0],_0x52684c=resolveLimit(_0x452660[_0x4b332f(0x169)],DEFAULT_LLM_LIMIT),_0x3f6134=_0x452660,_0x535e38=_0x3f6134['type'],_0x2c118c=['DRAFT',_0x4b332f(0x10b),_0x4b332f(0x149),_0x4b332f(0x172)],_0x5cd4c7=_0x3f6134['status'],_0xacc4b5=_0x5cd4c7?.['toUpperCase']();if(_0xacc4b5&&!_0x2c118c[_0x4b332f(0x13e)](_0xacc4b5))return console[_0x4b332f(0xf7)](_0x4b332f(0x15e)+_0x5cd4c7+_0x4b332f(0x122)+_0x2c118c['join'](',\x20')),0x1;const _0x370585=await resolveWorkspaceIdFromOptions(_0x3f6134,_0x50411f,!![]),_0x2d73a3=await withSpinner(_0x4b332f(0x16f),()=>_0x50411f[_0x4b332f(0x164)][_0x4b332f(0xee)]({'workspaceId':_0x370585,'type':_0x535e38,'status':_0xacc4b5,'limit':_0x52684c}),{'verbose':_0x452660[_0x4b332f(0xe6)]});let _0x8232d3=_0x2d73a3['data'];_0xacc4b5&&(_0x8232d3=_0x8232d3[_0x4b332f(0x1a1)](_0x1d981b=>_0x1d981b[_0x4b332f(0x102)][_0x4b332f(0x19e)]()===_0xacc4b5));_0x29a86c&&(_0x8232d3=_0x8232d3[_0x4b332f(0x1a1)](_0x56d65d=>matchGlobPattern(_0x56d65d[_0x4b332f(0x105)],_0x29a86c)));const _0x555d5f=_0x452660['site'];if(isStructuredFormat(_0x452660)){const _0x1f26ac=_0x8232d3[_0x4b332f(0x101)](_0x197561=>({..._0x197561,'url':getCampaignUrl(_0x555d5f,_0x197561[_0x4b332f(0x198)],_0x197561['id'])}));await handleSDKOutput(_0x1f26ac,_0x452660);}else for(const _0x1e2acb of _0x8232d3){const _0x15038e=a21_0x1a6dad['dim']('\x20('+_0x1e2acb['status'][_0x4b332f(0x133)]()+')'),_0x19fa9d=getCampaignUrl(_0x555d5f,_0x1e2acb[_0x4b332f(0x198)],_0x1e2acb['id']),_0x2e3da2=hyperlink(_0x1e2acb[_0x4b332f(0x105)],_0x19fa9d);console[_0x4b332f(0x19c)](_0x4b332f(0x18a)+_0x2e3da2+_0x15038e);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{['name']='engage:always-on-campaign:show';[a21_0x37d13a(0x1a0)]='Show\x20always-on\x20campaign\x20details';async[a21_0x37d13a(0x11f)](_0x25a227){const _0x5498ac=a21_0x37d13a,{options:_0x17811e,args:_0x14b448,tdx:_0x5a3a48}=_0x25a227;if(_0x14b448['length']===0x0)return console[_0x5498ac(0xf7)](_0x5498ac(0x114)),console[_0x5498ac(0xf7)](_0x5498ac(0xf4)),0x1;const _0xc2ab59=_0x14b448[0x0],_0x191d3d=_0x17811e,_0x2fb618=await resolveWorkspaceIdFromOptions(_0x191d3d,_0x5a3a48,!![]),_0x3188e3=_0x191d3d['full'],_0x48790f=_0x17811e[_0x5498ac(0x10e)];if(_0x3188e3){const _0x3d4d18=await withSpinner(_0x5498ac(0x16a)+_0xc2ab59+'\x27...',()=>_0x5a3a48[_0x5498ac(0x164)][_0x5498ac(0x13a)](_0x2fb618,_0xc2ab59),{'verbose':_0x17811e['verbose']}),_0xb8880=_0x3d4d18[_0x5498ac(0x166)],_0x447fa3=getCampaignUrl(_0x48790f,_0xb8880[_0x5498ac(0x12f)]['workspaceId'],_0xb8880['id']);await handleSDKOutput([{..._0xb8880,'url':_0x447fa3}],_0x17811e);}else{const _0x1ada9a=await withSpinner(_0x5498ac(0x16a)+_0xc2ab59+_0x5498ac(0x192),()=>_0x5a3a48[_0x5498ac(0x164)][_0x5498ac(0x137)](_0x2fb618,_0xc2ab59),{'verbose':_0x17811e[_0x5498ac(0xe6)]}),_0x3bf9b5=_0x1ada9a[_0x5498ac(0x166)],_0x517ef6=getCampaignUrl(_0x48790f,_0x3bf9b5[_0x5498ac(0x198)],_0x3bf9b5['id']);await handleSingleObjectOutput({..._0x3bf9b5,'url':_0x517ef6},_0x17811e);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x142);[a21_0x37d13a(0x1a0)]='Create\x20a\x20new\x20always-on\x20campaign';async[a21_0x37d13a(0x11f)](_0x47dd38){const _0x2e96bd=a21_0x37d13a,{options:_0x4c2544,tdx:_0x2e20c9}=_0x47dd38,_0x3fd68d=_0x4c2544,_0x298ce2=_0x3fd68d[_0x2e96bd(0x105)],_0x4674ab=_0x3fd68d[_0x2e96bd(0xea)];if(!_0x298ce2)return console[_0x2e96bd(0xf7)](_0x2e96bd(0x14c)),console[_0x2e96bd(0xf7)](_0x2e96bd(0x171)),0x1;if(!_0x4674ab)return console[_0x2e96bd(0xf7)](_0x2e96bd(0x123)),console['error'](_0x2e96bd(0x171)),0x1;const _0x830629=await resolveWorkspaceIdFromOptions(_0x3fd68d,_0x2e20c9,!![]),_0x2bbd21=await resolveSegmentFromOptions(_0x3fd68d,_0x2e20c9),_0x21e4f8={'name':_0x298ce2,'campaignType':_0x4674ab,'workspaceId':_0x830629,'description':_0x3fd68d['description'],'audienceId':_0x2bbd21['audienceId'],'audienceName':_0x2bbd21[_0x2e96bd(0x165)],'enableUtmTracking':_0x3fd68d[_0x2e96bd(0x162)]},_0x1a6596=await withSpinner(_0x2e96bd(0x11d)+_0x298ce2+_0x2e96bd(0x192),()=>_0x2e20c9[_0x2e96bd(0x164)]['createAlwaysOnCampaign'](_0x830629,_0x21e4f8));return await handleSDKOutput([_0x1a6596[_0x2e96bd(0x166)]],_0x4c2544),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{['name']=a21_0x37d13a(0x17d);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x126);async[a21_0x37d13a(0x11f)](_0x593b8c){const _0x344e4b=a21_0x37d13a,{options:_0x40d10a,args:_0x17d794,tdx:_0x14fe63}=_0x593b8c;if(_0x17d794[_0x344e4b(0x134)]===0x0)return console[_0x344e4b(0xf7)](_0x344e4b(0x114)),console[_0x344e4b(0xf7)](_0x344e4b(0x106)),0x1;const _0x2a7016=_0x17d794[0x0],_0x375933=_0x40d10a,_0x24e0b8=await resolveWorkspaceIdFromOptions(_0x375933,_0x14fe63,!![]),_0x3288fe=await resolveSegmentFromOptions(_0x375933,_0x14fe63),_0x2aa69f={'name':_0x375933[_0x344e4b(0x105)],'description':_0x375933[_0x344e4b(0x1a0)],'audienceId':_0x3288fe['audienceId'],'audienceName':_0x3288fe['audienceName'],'enableUtmTracking':_0x375933[_0x344e4b(0x162)]},_0x398397=Object[_0x344e4b(0xeb)](Object['entries'](_0x2aa69f)[_0x344e4b(0x1a1)](([,_0x56f6fe])=>_0x56f6fe!==undefined));if(Object[_0x344e4b(0x119)](_0x398397)['length']===0x0)return console[_0x344e4b(0xf7)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x344e4b(0xf7)](_0x344e4b(0x156)),0x1;const _0x4ef443=await withSpinner(_0x344e4b(0x141)+_0x2a7016+_0x344e4b(0x192),()=>_0x14fe63[_0x344e4b(0x164)][_0x344e4b(0x104)](_0x24e0b8,_0x2a7016,_0x398397),{'verbose':_0x40d10a[_0x344e4b(0xe6)]});return await handleSDKOutput([_0x4ef443[_0x344e4b(0x166)]],_0x40d10a),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{['name']=a21_0x37d13a(0x117);['description']=a21_0x37d13a(0x108);async[a21_0x37d13a(0x11f)](_0x265ff6){const _0x10b135=a21_0x37d13a,{options:_0x42ecad,args:_0x1fb549,tdx:_0x130b8e}=_0x265ff6;if(_0x1fb549['length']===0x0)return console[_0x10b135(0xf7)](_0x10b135(0x114)),console[_0x10b135(0xf7)](_0x10b135(0xfd)),0x1;const _0xaa37bc=_0x1fb549[0x0],_0x438f38=_0x42ecad,_0x238592=await resolveWorkspaceIdFromOptions(_0x438f38,_0x130b8e,!![]);if(!_0x42ecad[_0x10b135(0x1a9)]){const _0x455811=await confirm(_0x10b135(0xec)+_0xaa37bc+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x455811)return console[_0x10b135(0x19c)](_0x10b135(0x173)),0x0;}return await withSpinner(_0x10b135(0x1a2)+_0xaa37bc+'\x27...',()=>_0x130b8e['engage'][_0x10b135(0x151)](_0x238592,_0xaa37bc),{'verbose':_0x42ecad[_0x10b135(0xe6)]}),console[_0x10b135(0x19c)](_0x10b135(0x112)+_0xaa37bc+_0x10b135(0x1ae)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x158);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x1b2);async[a21_0x37d13a(0x11f)](_0x180781){const _0x291a09=a21_0x37d13a,{options:_0x4e5498,args:_0x8e195d,tdx:_0xd29ae8}=_0x180781;if(_0x8e195d[_0x291a09(0x134)]===0x0)return console[_0x291a09(0xf7)](_0x291a09(0x114)),console[_0x291a09(0xf7)](_0x291a09(0x11b)),0x1;const _0x4ddc7a=_0x8e195d[0x0],_0x5e639a=_0x4e5498,_0x42f655=await resolveWorkspaceIdFromOptions(_0x5e639a,_0xd29ae8,!![]);return await withSpinner(_0x291a09(0x143)+_0x4ddc7a+_0x291a09(0x192),()=>_0xd29ae8['engage'][_0x291a09(0x15b)](_0x42f655,_0x4ddc7a),{'verbose':_0x4e5498[_0x291a09(0xe6)]}),console[_0x291a09(0x19c)]('Always-on\x20campaign\x20\x27'+_0x4ddc7a+_0x291a09(0x1be)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{['name']=a21_0x37d13a(0x168);['description']=a21_0x37d13a(0x14a);async['execute'](_0x43c8bc){const _0x14bde2=a21_0x37d13a,{options:_0x296c9d,args:_0x395361,tdx:_0x35b1ca}=_0x43c8bc;if(_0x395361[_0x14bde2(0x134)]===0x0)return console[_0x14bde2(0xf7)](_0x14bde2(0x114)),console[_0x14bde2(0xf7)](_0x14bde2(0x180)),0x1;const _0x677d0c=_0x395361[0x0],_0x32d0f3=_0x296c9d,_0x523963=await resolveWorkspaceIdFromOptions(_0x32d0f3,_0x35b1ca,!![]);return await withSpinner('Pausing\x20always-on\x20campaign\x20\x27'+_0x677d0c+_0x14bde2(0x192),()=>_0x35b1ca[_0x14bde2(0x164)][_0x14bde2(0x109)](_0x523963,_0x677d0c),{'verbose':_0x296c9d[_0x14bde2(0xe6)]}),console[_0x14bde2(0x19c)](_0x14bde2(0x112)+_0x677d0c+_0x14bde2(0x1a7)),0x0;}}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0xf9);[a21_0x37d13a(0x1a0)]='Resume\x20a\x20paused\x20always-on\x20campaign';async['execute'](_0x3034d5){const _0x2382a1=a21_0x37d13a,{options:_0x45d016,args:_0x5e6819,tdx:_0x30909e}=_0x3034d5;if(_0x5e6819[_0x2382a1(0x134)]===0x0)return console[_0x2382a1(0xf7)](_0x2382a1(0x114)),console['error'](_0x2382a1(0x194)),0x1;const _0xea394a=_0x5e6819[0x0],_0x1b8b4b=_0x45d016,_0x1edbd0=await resolveWorkspaceIdFromOptions(_0x1b8b4b,_0x30909e,!![]);return await withSpinner(_0x2382a1(0xff)+_0xea394a+_0x2382a1(0x192),()=>_0x30909e['engage'][_0x2382a1(0x1a6)](_0x1edbd0,_0xea394a),{'verbose':_0x45d016[_0x2382a1(0xe6)]}),console[_0x2382a1(0x19c)](_0x2382a1(0x112)+_0xea394a+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x184);[a21_0x37d13a(0x1a0)]=a21_0x37d13a(0x12b);async[a21_0x37d13a(0x11f)](_0x47ceea){const _0xd1a660=a21_0x37d13a,{options:_0xd4714,args:_0xfa8996,tdx:_0x2dcc0a}=_0x47ceea;if(_0xfa8996[_0xd1a660(0x134)]===0x0)return console[_0xd1a660(0xf7)](_0xd1a660(0x114)),console[_0xd1a660(0xf7)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>'),0x1;const _0x5e62ac=_0xfa8996[0x0],_0x24923a=_0xd4714,_0x46cb2e=await resolveWorkspaceIdFromOptions(_0x24923a,_0x2dcc0a,!![]);if(!_0xd4714[_0xd1a660(0x1a9)]){const _0x439f8f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27'+_0x5e62ac+_0xd1a660(0x107));if(!_0x439f8f)return console[_0xd1a660(0x19c)](_0xd1a660(0x173)),0x0;}return await withSpinner(_0xd1a660(0x153)+_0x5e62ac+_0xd1a660(0x192),()=>_0x2dcc0a[_0xd1a660(0x164)][_0xd1a660(0x111)](_0x46cb2e,_0x5e62ac),{'verbose':_0xd4714[_0xd1a660(0xe6)]}),console['log'](_0xd1a660(0x112)+_0x5e62ac+_0xd1a660(0x1ad)),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a21_0x37d13a(0x105)]=a21_0x37d13a(0x159);['description']=a21_0x37d13a(0x100);async[a21_0x37d13a(0x11f)](_0x5f082b){const _0x30f739=a21_0x37d13a,{options:_0x5854bb,args:_0x169c36,tdx:_0x449f95}=_0x5f082b;if(_0x169c36[_0x30f739(0x134)]===0x0)return console[_0x30f739(0xf7)](_0x30f739(0x114)),console[_0x30f739(0xf7)](_0x30f739(0x124)),0x1;const _0x4f884b=_0x169c36[0x0],_0x5ab393=_0x5854bb,_0x389c82=await resolveWorkspaceIdFromOptions(_0x5ab393,_0x449f95,!![]),_0x5c1447=_0x5ab393[_0x30f739(0x105)],_0x24045e=await withSpinner(_0x30f739(0x138)+_0x4f884b+'\x27...',()=>_0x449f95['engage'][_0x30f739(0xf6)](_0x389c82,_0x4f884b,_0x5c1447),{'verbose':_0x5854bb[_0x30f739(0xe6)]});return await handleSDKOutput([_0x24045e[_0x30f739(0x166)]],_0x5854bb),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a21_0x37d13a(0x105)]='engage:workspace:use';['description']=a21_0x37d13a(0x136);async['execute'](_0x4e2b34){const _0x2ed009=a21_0x37d13a,{options:_0x35ecc7,args:_0x2391ae,tdx:_0x155775}=_0x4e2b34;if(_0x2391ae[_0x2ed009(0x134)]===0x0)return console[_0x2ed009(0xf7)](_0x2ed009(0x1a5)),console[_0x2ed009(0xf7)](_0x2ed009(0x1bb)),0x1;const _0x26a2f8=_0x2391ae[0x0];await withSpinner(_0x2ed009(0x12c)+_0x26a2f8+'\x27...',()=>_0x155775[_0x2ed009(0x164)][_0x2ed009(0x11a)](_0x26a2f8));const _0xe7585=_0x35ecc7[_0x2ed009(0xf5)]||undefined;return saveSessionContext({'engage_workspace':_0x26a2f8},_0xe7585),console[_0x2ed009(0x19c)]('Engage\x20workspace\x20set\x20to:\x20'+_0x26a2f8),console[_0x2ed009(0x19c)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x91e169=a22_0x53b0;(function(_0x22cebd,_0x807e8d){const _0x4dc6c1=a22_0x53b0,_0x14219a=_0x22cebd();while(!![]){try{const _0x5ac80a=parseInt(_0x4dc6c1(0xb3))/0x1+parseInt(_0x4dc6c1(0x9e))/0x2*(parseInt(_0x4dc6c1(0xb2))/0x3)+-parseInt(_0x4dc6c1(0x9f))/0x4*(parseInt(_0x4dc6c1(0x8d))/0x5)+-parseInt(_0x4dc6c1(0x7f))/0x6*(parseInt(_0x4dc6c1(0x90))/0x7)+parseInt(_0x4dc6c1(0x89))/0x8+parseInt(_0x4dc6c1(0xa2))/0x9*(parseInt(_0x4dc6c1(0x9d))/0xa)+-parseInt(_0x4dc6c1(0x93))/0xb*(parseInt(_0x4dc6c1(0xae))/0xc);if(_0x5ac80a===_0x807e8d)break;else _0x14219a['push'](_0x14219a['shift']());}catch(_0x169664){_0x14219a['push'](_0x14219a['shift']());}}}(a22_0x3856,0x69866));import{BaseCommand}from'./command.js';function a22_0x53b0(_0x9efa83,_0x486bde){_0x9efa83=_0x9efa83-0x75;const _0x38568b=a22_0x3856();let _0x53b0c5=_0x38568b[_0x9efa83];return _0x53b0c5;}function a22_0x3856(){const _0x21203d=['7611003lDBrwG','yellow','hasChanges','error','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x20templates','workspaceName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','targetDir','\x27...','data','isNew','636EflACs','templates','Pull\x20templates\x20to\x20YAML\x20files','No\x20templates\x20found\x20in\x20workspace\x20\x27','239310tMSbSP','253186Abflxf','workspace','engage','\x0aError:','red','session','content','dirname','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','engage_workspace','\x0aChanges\x20to\x20\x27','dryRun','Write\x20','counts','6CKkyph','\x20files?','filter','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','config','diff','cwd','✔\x20Context\x20set:\x20','absolutePath','✔\x20Pulled\x20','4475672UeaQFu','relativePath','Aborted.','description','1064340tivssQ','files','execute','2393657dZpLTV','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','\x20unchanged\x20files','255211iuQqRc','\x20new\x20files','\x20=\x20','setPhase','dim','cyan','\x0aPull\x20summary\x20for\x20workspace\x20\x27','length','name','\x20\x20Target:\x20','10QxtlqC','14vuYuTr','4qDBauv','Pulling\x20templates\x20from\x20\x27','green'];a22_0x3856=function(){return _0x21203d;};return a22_0x3856();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a22_0x43aa0f from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a22_0x15da9f from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a22_0x91e169(0x9b)]='engage:template:pull';[a22_0x91e169(0x8c)]=a22_0x91e169(0xb0);async[a22_0x91e169(0x8f)](_0x465a4c){const _0x1b342e=a22_0x91e169,{options:_0x1050d3,args:_0x5678fa,tdx:_0x452a3b}=_0x465a4c,_0x2c5803=_0x1050d3,_0xd499a1=await resolveWorkspaceName(_0x5678fa[0x0],_0x2c5803);if(!_0xd499a1)return console[_0x1b342e(0xa5)](a22_0x43aa0f[_0x1b342e(0xa3)]('Workspace\x20is\x20required.')),console['error'](_0x1b342e(0x91)),console[_0x1b342e(0xa5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>'),console[_0x1b342e(0xa5)](_0x1b342e(0xa6)),0x1;const _0x15fce7=await withProgressSpinner(_0x1b342e(0xa0)+_0xd499a1+_0x1b342e(0xab),_0x1c179e=>pullTemplates({'engage':_0x452a3b[_0x1b342e(0xb5)]},_0xd499a1,{'templateName':_0x2c5803[_0x1b342e(0x9b)],'progress':{'update':_0x5dfd43=>{const _0xee57fc=_0x1b342e;_0x1c179e[_0xee57fc(0x96)](_0x5dfd43);}}}),{'verbose':_0x2c5803['verbose']}),_0x2963af=_0x15fce7[_0x1b342e(0xac)];if(_0x2963af[_0x1b342e(0x7e)]['templates']===0x0)return console['error'](a22_0x43aa0f[_0x1b342e(0xa3)](_0x1b342e(0xb1)+_0x2963af['workspaceName']+'\x27')),0x0;const _0x32d9d9=_0x2963af[_0x1b342e(0x8e)][_0x1b342e(0x81)](_0x1b718f=>_0x1b718f[_0x1b342e(0xad)]),_0x36616e=_0x2963af['files']['filter'](_0x87adf0=>!_0x87adf0[_0x1b342e(0xad)]&&_0x87adf0[_0x1b342e(0xa4)]),_0x527bf3=_0x2963af[_0x1b342e(0x8e)][_0x1b342e(0x81)](_0x55503e=>!_0x55503e[_0x1b342e(0xad)]&&!_0x55503e[_0x1b342e(0xa4)]);console[_0x1b342e(0xa5)](_0x1b342e(0x99)+_0x2963af[_0x1b342e(0xa8)]+'\x27:'),console[_0x1b342e(0xa5)]('\x20\x20'+a22_0x43aa0f[_0x1b342e(0x98)](_0x2963af[_0x1b342e(0x7e)][_0x1b342e(0xaf)]+_0x1b342e(0xa7))),console[_0x1b342e(0xa5)]('\x20\x20'+a22_0x43aa0f[_0x1b342e(0xa1)]('+\x20'+_0x32d9d9['length']+_0x1b342e(0x94))),console['error']('\x20\x20'+a22_0x43aa0f[_0x1b342e(0xa3)]('~\x20'+_0x36616e['length']+'\x20changed\x20files')),console[_0x1b342e(0xa5)]('\x20\x20'+a22_0x43aa0f[_0x1b342e(0x97)]('=\x20'+_0x527bf3[_0x1b342e(0x9a)]+_0x1b342e(0x92))),console[_0x1b342e(0xa5)](_0x1b342e(0x9c)+a22_0x43aa0f[_0x1b342e(0x98)](_0x2963af[_0x1b342e(0xaa)])+'\x0a');if(_0x36616e['length']>0x0)for(const _0x274685 of _0x36616e){console[_0x1b342e(0xa5)](_0x1b342e(0x7b)+_0x274685[_0x1b342e(0x8a)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x1b342e(0xa5)](_0x274685[_0x1b342e(0x84)]),console[_0x1b342e(0xa5)]('─'['repeat'](0x3c));}if(_0x2c5803[_0x1b342e(0x7c)])return console['error'](a22_0x43aa0f[_0x1b342e(0xa3)](_0x1b342e(0xa9))),0x0;if(_0x32d9d9[_0x1b342e(0x9a)]===0x0&&_0x36616e[_0x1b342e(0x9a)]===0x0)return console[_0x1b342e(0xa5)](a22_0x43aa0f['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x2963af[_0x1b342e(0xa8)]},_0x2c5803['session']),0x0;if(!_0x2c5803['yes']){if(!isInteractive())return console[_0x1b342e(0xa5)](a22_0x43aa0f[_0x1b342e(0x75)](_0x1b342e(0xb6)),_0x1b342e(0x79)),console[_0x1b342e(0xa5)](a22_0x43aa0f['dim'](_0x1b342e(0x82))),0x1;const _0x577eb0=await confirmKey(_0x1b342e(0x7d)+(_0x32d9d9[_0x1b342e(0x9a)]+_0x36616e[_0x1b342e(0x9a)])+_0x1b342e(0x80));if(!_0x577eb0)return console[_0x1b342e(0xa5)](a22_0x43aa0f[_0x1b342e(0xa3)](_0x1b342e(0x8b)),'-\x20no\x20files\x20written'),0x1;}for(const _0xc8d297 of _0x2963af[_0x1b342e(0x8e)]){if(_0xc8d297[_0x1b342e(0xad)]||_0xc8d297[_0x1b342e(0xa4)]){const _0x21a583=a22_0x15da9f[_0x1b342e(0x78)](_0xc8d297['absolutePath']);!existsSync(_0x21a583)&&mkdirSync(_0x21a583,{'recursive':!![]}),writeFileSync(_0xc8d297[_0x1b342e(0x87)],_0xc8d297[_0x1b342e(0x77)],'utf-8');}}return console[_0x1b342e(0xa5)](a22_0x43aa0f[_0x1b342e(0xa1)](_0x1b342e(0x88)+(_0x32d9d9['length']+_0x36616e['length'])+'\x20files\x20to\x20'+_0x2963af['targetDir'])),saveSessionContext({'engage_workspace':_0x2963af[_0x1b342e(0xa8)]},_0x2c5803['session']),console['error'](a22_0x43aa0f[_0x1b342e(0xa1)](_0x1b342e(0x86)+a22_0x43aa0f[_0x1b342e(0x97)](_0x1b342e(0x7a))+_0x1b342e(0x95)+a22_0x43aa0f['cyan'](_0x2963af[_0x1b342e(0xa8)]))),0x0;}}async function resolveWorkspaceName(_0x37be4e,_0x4092bb){const _0x4443a0=a22_0x91e169;if(_0x37be4e)return _0x37be4e;if(_0x4092bb[_0x4443a0(0xb4)])return _0x4092bb[_0x4443a0(0xb4)];const _0x173e06=tryFindTdxConfig(process[_0x4443a0(0x85)]());if(_0x173e06?.[_0x4443a0(0x83)][_0x4443a0(0x7a)])return _0x173e06[_0x4443a0(0x83)]['engage_workspace'];const _0x4757bf=loadSessionContext(_0x4092bb[_0x4443a0(0x76)]);if(_0x4757bf?.[_0x4443a0(0x7a)])return _0x4757bf[_0x4443a0(0x7a)];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_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_0x111a0a=a23_0x32be;(function(_0x5c989d,_0x2f6fc3){const _0x239a39=a23_0x32be,_0x5c09c7=_0x5c989d();while(!![]){try{const _0x1a89de=-parseInt(_0x239a39(0x1f2))/0x1+-parseInt(_0x239a39(0x1f3))/0x2*(parseInt(_0x239a39(0x1ec))/0x3)+-parseInt(_0x239a39(0x211))/0x4*(-parseInt(_0x239a39(0x1f4))/0x5)+-parseInt(_0x239a39(0x1ef))/0x6*(parseInt(_0x239a39(0x200))/0x7)+-parseInt(_0x239a39(0x1ea))/0x8*(parseInt(_0x239a39(0x1df))/0x9)+-parseInt(_0x239a39(0x203))/0xa+-parseInt(_0x239a39(0x21e))/0xb*(-parseInt(_0x239a39(0x1fb))/0xc);if(_0x1a89de===_0x2f6fc3)break;else _0x5c09c7['push'](_0x5c09c7['shift']());}catch(_0x1ad491){_0x5c09c7['push'](_0x5c09c7['shift']());}}}(a23_0x165c,0x222c1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a23_0x165c(){const _0x389642=['verbose','yellow','red','\x27...','message','valid','\x0aValidation\x20errors\x20in\x20','cyan','engage','config','updated','11ewbPfN','✔\x20Updated\x20','Aborted.','dim','yes','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','def','✔\x20All\x20templates\x20are\x20up\x20to\x20date','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','Found\x20','cwd','green','9Xjknch','resolveWorkspaceId','name','✔\x20Created\x20','data','dirname','\x0aError:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','\x20template\x20files','filter','2153824PwhQnT','Pushing\x20templates...','329649rDplLz','update','created','6rdOUKh','session','configDir','221086UzxIJT','4AyWhzj','25XfXElt','Resolving\x20references...','Workspace\x20is\x20required.','\x20templates\x20to\x20update:','\x20new\x20templates:','site','engage:template:push','8951088MJjEik','Preparing\x20push\x20to\x20workspace\x20\x27','templateId','\x20templates','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','226268ynoljM','workspace','\x20\x20\x20\x20','48360wrDrnS','action','-\x20no\x20changes\x20applied','execute','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','engage_workspace','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','create','errors','Push\x20','warnings','error','path','setPhase','113028xlGYUj','relativePath'];a23_0x165c=function(){return _0x389642;};return a23_0x165c();}import{saveSessionContext,loadSessionContext}from'../core/session.js';function a23_0x32be(_0xaeb75f,_0x568cfd){_0xaeb75f=_0xaeb75f-0x1dc;const _0x165cc4=a23_0x165c();let _0x32be0a=_0x165cc4[_0xaeb75f];return _0x32be0a;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a23_0x2da49c from'chalk';import a23_0x6e66e2 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']=a23_0x111a0a(0x1fa);['description']='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a23_0x111a0a(0x206)](_0xa78d9e){const _0x43f8c4=a23_0x111a0a,{options:_0x3557fc,args:_0x26940e,tdx:_0x191446}=_0xa78d9e,_0x2c19e8=_0x3557fc,_0x200336=_0x26940e[0x0],_0x2445cc=_0x200336?a23_0x6e66e2['resolve'](_0x200336):undefined,_0x3e22dc=_0x2445cc?isYamlFile(_0x2445cc):![];let _0x3a5e10;if(_0x3e22dc&&_0x2445cc)_0x3a5e10=a23_0x6e66e2[_0x43f8c4(0x1e4)](_0x2445cc);else _0x2445cc?_0x3a5e10=_0x2445cc:_0x3a5e10=process[_0x43f8c4(0x1dd)]();let _0x5a3ef1;const _0x362af2=tryFindTdxConfig(_0x3a5e10);_0x362af2?.[_0x43f8c4(0x21c)][_0x43f8c4(0x208)]&&(_0x5a3ef1=_0x362af2[_0x43f8c4(0x21c)][_0x43f8c4(0x208)],!_0x3e22dc&&(_0x3a5e10=_0x362af2[_0x43f8c4(0x1f1)]));_0x2c19e8[_0x43f8c4(0x201)]&&(_0x5a3ef1=_0x2c19e8[_0x43f8c4(0x201)]);if(!_0x5a3ef1){const _0x54abcd=loadSessionContext(_0x2c19e8['session']);_0x54abcd?.[_0x43f8c4(0x208)]&&(_0x5a3ef1=_0x54abcd[_0x43f8c4(0x208)]);}if(!_0x5a3ef1)return console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x214)](_0x43f8c4(0x1f6))),console[_0x43f8c4(0x20e)]('\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console['error'](_0x43f8c4(0x224)),console[_0x43f8c4(0x20e)](_0x43f8c4(0x209)),console[_0x43f8c4(0x20e)](_0x43f8c4(0x1ff)),0x1;let _0x55b25d;_0x3e22dc&&_0x2445cc?_0x55b25d=[parseTemplateFile(_0x2445cc,a23_0x6e66e2[_0x43f8c4(0x1e4)](_0x2445cc))]:_0x55b25d=discoverAndParseTemplateFiles(_0x3a5e10);if(_0x55b25d['length']===0x0)return console[_0x43f8c4(0x20e)](a23_0x2da49c['yellow'](_0x43f8c4(0x223)+_0x3a5e10)),console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x221)](_0x43f8c4(0x227))),0x1;const _0x4ceaa8=_0x55b25d[_0x43f8c4(0x1e7)]===0x1?'1\x20template\x20file:\x20'+_0x55b25d[0x0][_0x43f8c4(0x225)]['name']:_0x55b25d[_0x43f8c4(0x1e7)]+_0x43f8c4(0x1e8);console['error'](_0x43f8c4(0x1dc)+a23_0x2da49c[_0x43f8c4(0x21a)](_0x4ceaa8));let _0x16f19e=![];for(const _0x16b204 of _0x55b25d){const _0x34a66c=validateTemplateDef(_0x16b204[_0x43f8c4(0x225)]);if(!_0x34a66c[_0x43f8c4(0x218)]){_0x16f19e=!![],console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x215)](_0x43f8c4(0x219)+_0x16b204[_0x43f8c4(0x212)]+':'));for(const _0x1e097d of _0x34a66c[_0x43f8c4(0x20b)]){console['error']('\x20\x20'+a23_0x2da49c[_0x43f8c4(0x215)]('✗')+'\x20'+_0x1e097d[_0x43f8c4(0x20f)]+':\x20'+_0x1e097d[_0x43f8c4(0x217)]);}}for(const _0x13b66d of _0x34a66c[_0x43f8c4(0x20d)]){console[_0x43f8c4(0x20e)]('\x20\x20'+a23_0x2da49c['yellow']('⚠')+'\x20'+_0x13b66d[_0x43f8c4(0x20f)]+':\x20'+_0x13b66d[_0x43f8c4(0x217)]);}}if(_0x16f19e)return console['error'](a23_0x2da49c[_0x43f8c4(0x215)](_0x43f8c4(0x207))),0x1;const _0xc73f88=await _0x191446['engage'][_0x43f8c4(0x1e0)](_0x5a3ef1),_0xd32f26=await withProgressSpinner(_0x43f8c4(0x1fc)+_0x5a3ef1+_0x43f8c4(0x216),_0x5a470b=>preparePush({'engage':_0x191446[_0x43f8c4(0x21b)]},_0x55b25d,_0xc73f88,{'progress':{'update':_0x3c3400=>_0x5a470b[_0x43f8c4(0x210)](_0x3c3400)}}),{'verbose':_0x2c19e8[_0x43f8c4(0x213)]}),_0x5aecc3=_0xd32f26[_0x43f8c4(0x1e3)];await withProgressSpinner(_0x43f8c4(0x1f5),_0x24614b=>resolveAndBuildInputs({'engage':_0x191446['engage']},_0x5aecc3,_0xc73f88,{'progress':{'update':_0x43216e=>_0x24614b[_0x43f8c4(0x210)](_0x43216e)}}),{'verbose':_0x2c19e8[_0x43f8c4(0x213)]});const _0x178aad=_0x5aecc3[_0x43f8c4(0x1e9)](_0x3a1494=>_0x3a1494['action']===_0x43f8c4(0x20a)),_0x17ad38=_0x5aecc3[_0x43f8c4(0x1e9)](_0x4b8d8f=>_0x4b8d8f[_0x43f8c4(0x204)]===_0x43f8c4(0x1ed));console['error']('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x5a3ef1+'\x27:');if(_0x178aad[_0x43f8c4(0x1e7)]>0x0){console[_0x43f8c4(0x20e)]('\x20\x20'+a23_0x2da49c[_0x43f8c4(0x1de)]('+\x20'+_0x178aad['length']+_0x43f8c4(0x1f8)));for(const _0x2d5d44 of _0x178aad){console[_0x43f8c4(0x20e)](_0x43f8c4(0x202)+a23_0x2da49c[_0x43f8c4(0x1de)]('+')+'\x20'+_0x2d5d44[_0x43f8c4(0x225)][_0x43f8c4(0x1e1)]);}}if(_0x17ad38[_0x43f8c4(0x1e7)]>0x0){console[_0x43f8c4(0x20e)]('\x20\x20'+a23_0x2da49c[_0x43f8c4(0x214)]('~\x20'+_0x17ad38[_0x43f8c4(0x1e7)]+_0x43f8c4(0x1f7)));for(const _0x4605dd of _0x17ad38){console[_0x43f8c4(0x20e)]('\x20\x20\x20\x20'+a23_0x2da49c['yellow']('~')+'\x20'+_0x4605dd[_0x43f8c4(0x225)][_0x43f8c4(0x1e1)]);}}if(_0x178aad[_0x43f8c4(0x1e7)]===0x0&&_0x17ad38[_0x43f8c4(0x1e7)]===0x0)return console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x1de)](_0x43f8c4(0x226))),0x0;if(_0x2c19e8['dryRun'])return console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x214)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x2c19e8[_0x43f8c4(0x222)]){if(!isInteractive())return console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x215)](_0x43f8c4(0x1e5)),_0x43f8c4(0x1e6)),console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x221)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x135d43=await confirmKey(_0x43f8c4(0x20c)+(_0x178aad[_0x43f8c4(0x1e7)]+_0x17ad38[_0x43f8c4(0x1e7)])+'\x20templates?');if(!_0x135d43)return console['error'](a23_0x2da49c[_0x43f8c4(0x214)](_0x43f8c4(0x220)),_0x43f8c4(0x205)),0x1;}const _0x393f41=await withProgressSpinner(_0x43f8c4(0x1eb),_0x2cb356=>executePush({'engage':_0x191446[_0x43f8c4(0x21b)]},_0x5aecc3,{'progress':{'update':_0x2f9bac=>_0x2cb356[_0x43f8c4(0x210)](_0x2f9bac)}}),{'verbose':_0x2c19e8['verbose']}),_0x4df783=_0x393f41[_0x43f8c4(0x1e3)];for(const _0x81aa16 of _0x4df783['results']){if(_0x81aa16[_0x43f8c4(0x1fd)]&&(_0x81aa16[_0x43f8c4(0x204)]===_0x43f8c4(0x1ee)||_0x81aa16[_0x43f8c4(0x204)]===_0x43f8c4(0x21d))){const _0x55b0cc=getTemplateUrl(_0x2c19e8[_0x43f8c4(0x1f9)],_0xc73f88,_0x81aa16[_0x43f8c4(0x1fd)]),_0x34dd8b=_0x81aa16[_0x43f8c4(0x204)]===_0x43f8c4(0x1ee)?'+':'~',_0x16cb3c=_0x81aa16[_0x43f8c4(0x204)]===_0x43f8c4(0x1ee)?a23_0x2da49c[_0x43f8c4(0x1de)](_0x34dd8b):a23_0x2da49c[_0x43f8c4(0x214)](_0x34dd8b);console[_0x43f8c4(0x20e)]('\x20\x20'+_0x16cb3c+'\x20'+hyperlink(_0x81aa16[_0x43f8c4(0x1e1)],_0x55b0cc)+'\x20'+a23_0x2da49c[_0x43f8c4(0x221)](_0x55b0cc));}}_0x4df783[_0x43f8c4(0x1ee)]>0x0&&console[_0x43f8c4(0x20e)](a23_0x2da49c[_0x43f8c4(0x1de)](_0x43f8c4(0x1e2)+_0x4df783[_0x43f8c4(0x1ee)]+_0x43f8c4(0x1fe)));_0x4df783['updated']>0x0&&console[_0x43f8c4(0x20e)](a23_0x2da49c['green'](_0x43f8c4(0x21f)+_0x4df783['updated']+'\x20templates'));if(_0x4df783[_0x43f8c4(0x20b)][_0x43f8c4(0x1e7)]>0x0){console['error'](a23_0x2da49c['red']('✘\x20'+_0x4df783[_0x43f8c4(0x20b)]['length']+'\x20errors:'));for(const _0x224dce of _0x4df783['errors']){console[_0x43f8c4(0x20e)]('\x20\x20'+a23_0x2da49c[_0x43f8c4(0x215)](_0x224dce[_0x43f8c4(0x1e1)])+':\x20'+_0x224dce['error']);}}return saveSessionContext({'engage_workspace':_0x5a3ef1},_0x2c19e8[_0x43f8c4(0x1f0)]),_0x4df783[_0x43f8c4(0x20b)]['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x14cbc1=a24_0x21cb;(function(_0x2919af,_0x232d11){const _0x3dd613=a24_0x21cb,_0x2a626b=_0x2919af();while(!![]){try{const _0x2f3713=parseInt(_0x3dd613(0xd3))/0x1*(-parseInt(_0x3dd613(0xc6))/0x2)+parseInt(_0x3dd613(0xcc))/0x3*(parseInt(_0x3dd613(0xd1))/0x4)+parseInt(_0x3dd613(0xee))/0x5*(-parseInt(_0x3dd613(0xe7))/0x6)+-parseInt(_0x3dd613(0xe4))/0x7*(-parseInt(_0x3dd613(0xe9))/0x8)+-parseInt(_0x3dd613(0xe8))/0x9+-parseInt(_0x3dd613(0xd6))/0xa+-parseInt(_0x3dd613(0xe6))/0xb*(-parseInt(_0x3dd613(0xe2))/0xc);if(_0x2f3713===_0x232d11)break;else _0x2a626b['push'](_0x2a626b['shift']());}catch(_0x429cd6){_0x2a626b['push'](_0x2a626b['shift']());}}}(a24_0x2d7b,0xc2b8e));function a24_0x21cb(_0x55e331,_0x1568a){_0x55e331=_0x55e331-0xbc;const _0x2d7ba2=a24_0x2d7b();let _0x21cb0f=_0x2d7ba2[_0x55e331];return _0x21cb0f;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a24_0x401cfe from'chalk';import a24_0x3daf5d from'path';function a24_0x2d7b(){const _0x4fe582=['\x20warning(s)\x20found','60614BIpyHB','\x20valid','\x20non-template\x20file(s)\x20skipped','\x20template(s)\x20with\x20errors,\x20','filter','relativePath','598761Rhoauj','\x20error(s)','warnings','resolve','yellow','16nzoAOI','invalidCount','44BYQOZC','\x20warning(s)','No\x20template\x20YAML\x20files\x20found\x20in\x20','13461430OhkXdt','.yaml','length','Validation\x20failed:\x20','\x20(skipped:\x20','error','cwd','warningCount','reason','Error:\x20Directory\x20not\x20found:\x20','log','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','18804qLkZjG','skippedCount','2738911KvVKFT','endsWith','24893cicMdu','919716kWuAfW','9947007ecJnGf','8mraUFq','red','green','Validate\x20template\x20YAML\x20files','errors','5sCtebV','\x20non-template\x20file(s)\x20skipped)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','✔\x20All\x20','valid','name','validCount','hasErrors','\x20template(s)\x20valid','dim','verbose'];a24_0x2d7b=function(){return _0x4fe582;};return a24_0x2d7b();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a24_0x14cbc1(0xbf)]='engage:template:validate';['description']=a24_0x14cbc1(0xec);async['execute'](_0x29392a){const _0x2b05f1=a24_0x14cbc1,{options:_0x1ca442,args:_0x2611bc}=_0x29392a,_0x693300=_0x1ca442,_0x8babf1=_0x2611bc[0x0],_0x5d0aa4=_0x8babf1?a24_0x3daf5d[_0x2b05f1(0xcf)](_0x8babf1):undefined,_0x36bf3c=_0x5d0aa4?isYamlFile(_0x5d0aa4):![];let _0x57c38b,_0x594337;if(_0x36bf3c&&_0x5d0aa4)_0x57c38b=a24_0x3daf5d['dirname'](_0x5d0aa4),_0x594337=_0x5d0aa4;else _0x5d0aa4?_0x57c38b=_0x5d0aa4:_0x57c38b=process[_0x2b05f1(0xdc)]();if(!_0x594337&&!existsSync(_0x57c38b))return console[_0x2b05f1(0xdb)](a24_0x401cfe[_0x2b05f1(0xea)](_0x2b05f1(0xdf)+_0x57c38b+'\x0a')),0x1;let _0x4b6e6f;if(_0x594337){if(!_0x594337[_0x2b05f1(0xe5)]('.yml')&&!_0x594337[_0x2b05f1(0xe5)](_0x2b05f1(0xd7)))return console['error'](a24_0x401cfe[_0x2b05f1(0xea)](_0x2b05f1(0xe1)+_0x594337+'\x0a')),0x1;_0x4b6e6f=[_0x594337];}else _0x4b6e6f=findYamlFiles(_0x57c38b);if(_0x4b6e6f[_0x2b05f1(0xd8)]===0x0)return console[_0x2b05f1(0xdb)](a24_0x401cfe[_0x2b05f1(0xea)](_0x2b05f1(0xbc)+_0x57c38b+'\x0a')),0x1;const _0xf946b3=validateYamlFiles(_0x4b6e6f,_0x57c38b,{'filterType':'template'}),_0x17bdcd=calculateSummary(_0xf946b3),_0x3c3e8b=_0xf946b3[_0x2b05f1(0xca)](isValidationResult);if(_0x3c3e8b[_0x2b05f1(0xd8)]===0x0)return console[_0x2b05f1(0xdb)](a24_0x401cfe['yellow'](_0x2b05f1(0xd5)+_0x57c38b+'\x0a')),_0x17bdcd['skippedCount']>0x0&&console[_0x2b05f1(0xdb)](a24_0x401cfe[_0x2b05f1(0xc3)]('('+_0x17bdcd[_0x2b05f1(0xe3)]+_0x2b05f1(0xef))),0x0;for(const _0x303d8a of _0xf946b3){if(!isValidationResult(_0x303d8a)){_0x693300[_0x2b05f1(0xc4)]&&console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xc3)]('-\x20'+_0x303d8a[_0x2b05f1(0xcb)]+_0x2b05f1(0xda)+_0x303d8a[_0x2b05f1(0xde)]+')'));continue;}const {relativePath:_0x505cf4,source:_0x55af38,result:_0x5c6db5}=_0x303d8a;if(_0x5c6db5['valid']&&_0x5c6db5[_0x2b05f1(0xce)][_0x2b05f1(0xd8)]===0x0)_0x693300[_0x2b05f1(0xc4)]&&console['log'](a24_0x401cfe['green']('✔\x20'+_0x505cf4));else _0x5c6db5[_0x2b05f1(0xbe)]?(console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xd0)]('⚠\x20'+_0x505cf4+':\x20'+_0x5c6db5['warnings'][_0x2b05f1(0xd8)]+_0x2b05f1(0xd4))),console['log'](formatValidationResult(_0x5c6db5,_0x55af38,_0x505cf4))):(console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xea)]('✖\x20'+_0x505cf4+':\x20'+_0x5c6db5[_0x2b05f1(0xed)][_0x2b05f1(0xd8)]+_0x2b05f1(0xcd))),console[_0x2b05f1(0xe0)](formatValidationResult(_0x5c6db5,_0x55af38,_0x505cf4)));}return console[_0x2b05f1(0xe0)](''),_0x17bdcd[_0x2b05f1(0xc1)]?(console[_0x2b05f1(0xe0)](a24_0x401cfe['red'](_0x2b05f1(0xd9)+_0x17bdcd[_0x2b05f1(0xd2)]+_0x2b05f1(0xc9)+_0x17bdcd[_0x2b05f1(0xc0)]+_0x2b05f1(0xc7))),_0x17bdcd[_0x2b05f1(0xdd)]>0x0&&console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xd0)](_0x17bdcd[_0x2b05f1(0xdd)]+_0x2b05f1(0xc5))),_0x17bdcd[_0x2b05f1(0xe3)]>0x0&&console['log'](a24_0x401cfe['dim'](_0x17bdcd[_0x2b05f1(0xe3)]+_0x2b05f1(0xc8))),0x1):(console[_0x2b05f1(0xe0)](a24_0x401cfe[_0x2b05f1(0xeb)](_0x2b05f1(0xbd)+_0x17bdcd['validCount']+_0x2b05f1(0xc2))),_0x17bdcd[_0x2b05f1(0xdd)]>0x0&&console[_0x2b05f1(0xe0)](a24_0x401cfe['yellow'](_0x17bdcd[_0x2b05f1(0xdd)]+_0x2b05f1(0xc5))),_0x17bdcd[_0x2b05f1(0xe3)]>0x0&&console['log'](a24_0x401cfe[_0x2b05f1(0xc3)](_0x17bdcd[_0x2b05f1(0xe3)]+_0x2b05f1(0xc8))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_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_0x28aa71=a25_0x8f44;(function(_0x4c49e7,_0x16c0eb){const _0x5a390f=a25_0x8f44,_0x13bda9=_0x4c49e7();while(!![]){try{const _0x2332e3=-parseInt(_0x5a390f(0x1ab))/0x1+parseInt(_0x5a390f(0x17a))/0x2*(parseInt(_0x5a390f(0x17e))/0x3)+-parseInt(_0x5a390f(0x19d))/0x4*(-parseInt(_0x5a390f(0x19e))/0x5)+parseInt(_0x5a390f(0x1b4))/0x6+-parseInt(_0x5a390f(0x1a6))/0x7+parseInt(_0x5a390f(0x1a8))/0x8+-parseInt(_0x5a390f(0x1b2))/0x9;if(_0x2332e3===_0x16c0eb)break;else _0x13bda9['push'](_0x13bda9['shift']());}catch(_0xaa7b34){_0x13bda9['push'](_0x13bda9['shift']());}}}(a25_0x376e,0x66510));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a25_0x376e(){const _0x3d4d0c=['site','Kill\x20a\x20job','h\x20ago','execute','now','url','status','✔\x20Found\x20','Getting\x20job\x20results...','description','created_at','116108sfaWtO','85NItwuA','submit','d\x20ago','INVALID_ARGUMENT','\x20jobs','end_at','error','information_schema','4701340DhrNoW','floor','3794808BBYTPR','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job_id','178885OhXrBz','abs','start_at','Show\x20job\x20details','type','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','711486RHTAcC','job:result','1076190YKidEZ','push','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','name','Limit:\x20','trino','debug','Submitting\x20job...','...','✔\x20Retrieved\x20','Job\x20type:\x20','join','✔\x20Job\x20submitted','presto','priority','query','No\x20SQL\x20statements\x20found\x20in\x20file','List\x20jobs','jobs','dim','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','yes','job:show','getTime','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','list','user_name','25184SZjWIE','hive','m\x20ago','\x20\x20Job\x20ID:\x20','48cyJFJZ','Getting\x20job\x20details...','verbose','mo\x20ago','length','database','substring','validate','Submitting\x20kill\x20request...','red','job:kill','Cancelled','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','data','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Query:\x20','kill','round','args','result'];a25_0x376e=function(){return _0x3d4d0c;};return a25_0x376e();}import{hyperlink}from'../sdk/util/formatters.js';import a25_0x1a5aa4 from'chalk';function formatDuration(_0x25dd4c){const _0x4ac727=a25_0x8f44;if(_0x25dd4c<0x3c)return _0x25dd4c+'s';if(_0x25dd4c<0xe10)return Math[_0x4ac727(0x1a7)](_0x25dd4c/0x3c)+'m\x20'+_0x25dd4c%0x3c+'s';const _0x1eb23d=Math[_0x4ac727(0x1a7)](_0x25dd4c/0xe10),_0x32ab9b=Math[_0x4ac727(0x1a7)](_0x25dd4c%0xe10/0x3c);return _0x32ab9b>0x0?_0x1eb23d+'h\x20'+_0x32ab9b+'m':_0x1eb23d+'h';}function formatRelativeTime(_0x5ec09d){const _0x38ef5f=a25_0x8f44,_0x458e53=Date[_0x38ef5f(0x196)]()-_0x5ec09d['getTime'](),_0x49cf61=Math[_0x38ef5f(0x1a7)](Math[_0x38ef5f(0x1ac)](_0x458e53)/0x3e8);if(_0x49cf61<0x3c)return'just\x20now';const _0x2b9acd=Math[_0x38ef5f(0x1a7)](_0x49cf61/0x3c);if(_0x2b9acd<0x3c)return _0x2b9acd+_0x38ef5f(0x17c);const _0x1a9046=Math['floor'](_0x2b9acd/0x3c);if(_0x1a9046<0x18)return _0x1a9046+_0x38ef5f(0x194);const _0x3655ce=Math[_0x38ef5f(0x1a7)](_0x1a9046/0x18);if(_0x3655ce<0x1e)return _0x3655ce+_0x38ef5f(0x1a0);return Math['floor'](_0x3655ce/0x1e)+_0x38ef5f(0x181);}export class JobListCommand extends BaseCommand{['name']=a25_0x28aa71(0x1c6);[a25_0x28aa71(0x19b)]=a25_0x28aa71(0x1c5);async[a25_0x28aa71(0x195)](_0x4b2d77){const _0x94b95d=a25_0x28aa71,{options:_0x4e4e77,tdx:_0x4866ad}=_0x4b2d77,_0x5e2510=resolveLimit(_0x4e4e77['limit'],DEFAULT_DISPLAY_LIMIT),_0x157e58=_0x4e4e77[_0x94b95d(0x198)];_0x4e4e77[_0x94b95d(0x180)]&&(console[_0x94b95d(0x1a4)](_0x94b95d(0x1b8)+_0x5e2510+_0x94b95d(0x1a2)),_0x157e58&&console[_0x94b95d(0x1a4)]('Status\x20filter:\x20'+_0x157e58));const _0x4177a9=await withSpinner('Listing\x20jobs...',()=>_0x4866ad['jobs'][_0x94b95d(0x178)]({'from':0x0,'to':_0x5e2510-0x1,'status':_0x157e58}),{'verbose':_0x4e4e77[_0x94b95d(0x180)]}),_0x439c13=_0x4177a9[_0x94b95d(0x18b)];console['error'](_0x94b95d(0x199)+_0x439c13[_0x94b95d(0x182)]+'\x20job'+(_0x439c13[_0x94b95d(0x182)]!==0x1?'s':''));const _0x5eb700=_0x4e4e77[_0x94b95d(0x192)];if(isStructuredFormat(_0x4e4e77)){const _0x22388b=_0x439c13['map'](_0x50dcf5=>{const _0xd0aa25=_0x94b95d;let _0x344c07;if(_0x50dcf5[_0xd0aa25(0x1ad)]&&_0x50dcf5[_0xd0aa25(0x1a3)]){const _0x397bfd=new Date(_0x50dcf5[_0xd0aa25(0x1ad)])[_0xd0aa25(0x176)](),_0x45732c=new Date(_0x50dcf5[_0xd0aa25(0x1a3)])[_0xd0aa25(0x176)]();_0x344c07=Math[_0xd0aa25(0x18f)]((_0x45732c-_0x397bfd)/0x3e8);}return{'job_id':_0x50dcf5[_0xd0aa25(0x1aa)],'type':_0x50dcf5[_0xd0aa25(0x1af)]===_0xd0aa25(0x1c1)?_0xd0aa25(0x1b9):_0x50dcf5['type'],'status':_0x50dcf5[_0xd0aa25(0x198)],'user_name':_0x50dcf5['user_name'],'duration_sec':_0x344c07,'created_at':_0x50dcf5[_0xd0aa25(0x19c)],'started_at':_0x50dcf5[_0xd0aa25(0x1ad)],'end_at':_0x50dcf5['end_at']};});await handleSDKOutput(_0x22388b,_0x4e4e77);}else for(const _0xd052f8 of _0x439c13){const _0x172b0b=_0xd052f8[_0x94b95d(0x198)]==='success'?a25_0x1a5aa4['green']:_0xd052f8['status']===_0x94b95d(0x1a4)?a25_0x1a5aa4[_0x94b95d(0x187)]:a25_0x1a5aa4[_0x94b95d(0x1c7)],_0x1b3205=_0x172b0b(_0xd052f8[_0x94b95d(0x198)]),_0x5c0e40=getJobUrl(_0x5eb700,_0xd052f8[_0x94b95d(0x1aa)]),_0xe6c486=hyperlink(_0xd052f8[_0x94b95d(0x1aa)],_0x5c0e40),_0x370f2b=a25_0x1a5aa4[_0x94b95d(0x1c7)](_0xd052f8[_0x94b95d(0x1af)]===_0x94b95d(0x1c1)?_0x94b95d(0x1b9):_0xd052f8[_0x94b95d(0x1af)]),_0x49705e=[];if(_0xd052f8[_0x94b95d(0x1ad)]&&_0xd052f8[_0x94b95d(0x1a3)]){const _0x14d775=Math['round']((new Date(_0xd052f8['end_at'])['getTime']()-new Date(_0xd052f8[_0x94b95d(0x1ad)])[_0x94b95d(0x176)]())/0x3e8);_0x49705e[_0x94b95d(0x1b5)](formatDuration(_0x14d775));}if(_0xd052f8[_0x94b95d(0x1a3)])_0x49705e[_0x94b95d(0x1b5)](formatRelativeTime(new Date(_0xd052f8['end_at'])));else _0xd052f8[_0x94b95d(0x1ad)]&&_0x49705e[_0x94b95d(0x1b5)](formatRelativeTime(new Date(_0xd052f8['start_at'])));const _0x53aca8=_0x49705e['length']>0x0?a25_0x1a5aa4[_0x94b95d(0x1c7)]('\x20'+_0x49705e[_0x94b95d(0x1bf)](',\x20')):'';console['log']('⚡\x20'+_0xe6c486+'\x20'+_0x370f2b+'\x20'+_0x1b3205+_0x53aca8);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a25_0x28aa71(0x175);[a25_0x28aa71(0x19b)]=a25_0x28aa71(0x1ae);['validate'](_0x4b5019){const _0x1047d9=a25_0x28aa71,_0xf500f7=_0x4b5019['args'][0x0];if(!_0xf500f7)return _0x1047d9(0x1b6);return undefined;}async['execute'](_0x3ebdeb){const _0x390934=a25_0x28aa71,{options:_0x591ca6,args:_0x413570,tdx:_0x3ba6fd}=_0x3ebdeb,_0x4a3153=_0x413570[0x0],_0x5008ec=await withSpinner(_0x390934(0x17f),()=>_0x3ba6fd[_0x390934(0x1c6)]['show'](_0x4a3153),{'verbose':_0x591ca6[_0x390934(0x180)]}),_0x58372b=_0x5008ec[_0x390934(0x18b)];let _0x51d684;if(_0x58372b[_0x390934(0x1ad)]&&_0x58372b[_0x390934(0x1a3)]){const _0x48a0bf=new Date(_0x58372b['start_at'])['getTime'](),_0x562598=new Date(_0x58372b[_0x390934(0x1a3)])[_0x390934(0x176)]();_0x51d684=Math[_0x390934(0x18f)]((_0x562598-_0x48a0bf)/0x3e8);}const _0x3259f7={'job_id':_0x58372b[_0x390934(0x1aa)],'type':_0x58372b[_0x390934(0x1af)],'status':_0x58372b[_0x390934(0x198)],..._0x58372b[_0x390934(0x179)]&&{'user_name':_0x58372b['user_name']},..._0x51d684!==undefined&&{'duration_sec':_0x51d684},..._0x58372b[_0x390934(0x19c)]&&{'created_at':_0x58372b[_0x390934(0x19c)]},..._0x58372b[_0x390934(0x1ad)]&&{'started_at':_0x58372b[_0x390934(0x1ad)]},..._0x58372b[_0x390934(0x1a3)]&&{'end_at':_0x58372b[_0x390934(0x1a3)]},..._0x58372b['database']&&{'database':_0x58372b[_0x390934(0x183)]},..._0x58372b['priority']!==undefined&&{'priority':_0x58372b[_0x390934(0x1c2)]},..._0x58372b['url']&&{'url':_0x58372b[_0x390934(0x197)]},..._0x58372b[_0x390934(0x1c3)]&&{'query':_0x58372b[_0x390934(0x1c3)]},..._0x58372b[_0x390934(0x1ba)]&&{'debug':_0x58372b[_0x390934(0x1ba)]}};return await handleSingleObjectOutput(_0x3259f7,_0x591ca6),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x28aa71(0x1b7)]=a25_0x28aa71(0x188);[a25_0x28aa71(0x19b)]=a25_0x28aa71(0x193);['validate'](_0x23cb98){const _0x21fbdb=a25_0x28aa71,_0x1afc58=_0x23cb98[_0x21fbdb(0x190)][0x0];if(!_0x1afc58)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a25_0x28aa71(0x195)](_0x11a7f0){const _0x22903f=a25_0x28aa71,{options:_0x5327a9,args:_0x24e059,tdx:_0x341c9d}=_0x11a7f0,_0xb172a2=_0x24e059[0x0];if(!_0x5327a9[_0x22903f(0x174)]){const _0x4c00c3=await confirm(_0x22903f(0x173)+_0xb172a2+'?');if(!_0x4c00c3)return console[_0x22903f(0x1a4)](_0x22903f(0x189)),0x0;}return await withSpinner(_0x22903f(0x186),()=>_0x341c9d[_0x22903f(0x1c6)][_0x22903f(0x18e)](_0xb172a2),{'verbose':_0x5327a9[_0x22903f(0x180)]}),console[_0x22903f(0x1a4)](_0x22903f(0x1a9)+_0xb172a2),console[_0x22903f(0x1a4)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0xb172a2+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}function a25_0x8f44(_0x5d3f51,_0x1a9954){_0x5d3f51=_0x5d3f51-0x173;const _0x376eb4=a25_0x376e();let _0x8f44f0=_0x376eb4[_0x5d3f51];return _0x8f44f0;}export class JobSubmitCommand extends BaseCommand{[a25_0x28aa71(0x1b7)]='job:submit';[a25_0x28aa71(0x19b)]='Submit\x20a\x20job';async[a25_0x28aa71(0x195)](_0x5dff3a){const _0x410ada=a25_0x28aa71,{options:_0x4bde04,args:_0xb505b0,tdx:_0x28d128}=_0x5dff3a,_0xd83a3a=_0x4bde04['jobType']||'trino',_0x25d1e5=_0x4bde04['file'],_0x3821c2=_0x4bde04[_0x410ada(0x183)]||_0x410ada(0x1a5),_0x34ea0f=_0x4bde04['result'];if(_0xd83a3a!==_0x410ada(0x1b9)&&_0xd83a3a!==_0x410ada(0x17b))throw new SDKError(ErrorCode[_0x410ada(0x1a1)],_0x410ada(0x18c));let _0x5491b9;if(_0x25d1e5){if(_0xb505b0[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x410ada(0x177));const _0x1dd977=readSqlStatementsFromFile(_0x25d1e5);if(_0x1dd977[_0x410ada(0x182)]===0x0)throw new SDKError(ErrorCode[_0x410ada(0x1a1)],_0x410ada(0x1c4));if(_0x1dd977[_0x410ada(0x182)]>0x1)throw new SDKError(ErrorCode[_0x410ada(0x1a1)],_0x410ada(0x18a));_0x5491b9=_0x1dd977[0x0];}else{if(!_0xb505b0[0x0])throw new SDKError(ErrorCode[_0x410ada(0x1a1)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x5491b9=_0xb505b0[0x0];}_0x4bde04[_0x410ada(0x180)]&&(console[_0x410ada(0x1a4)](_0x410ada(0x1be)+_0xd83a3a),console[_0x410ada(0x1a4)](_0x410ada(0x1b0)+_0x3821c2),console[_0x410ada(0x1a4)](_0x410ada(0x18d)+_0x5491b9[_0x410ada(0x184)](0x0,0x64)+(_0x5491b9[_0x410ada(0x182)]>0x64?_0x410ada(0x1bc):'')));const _0x44d600=await withSpinner(_0x410ada(0x1bb),()=>_0x28d128[_0x410ada(0x1c6)][_0x410ada(0x19f)](_0x3821c2,_0x5491b9,_0xd83a3a,_0x34ea0f),{'verbose':_0x4bde04['verbose']}),_0x4718f2=_0x44d600[_0x410ada(0x18b)];return console[_0x410ada(0x1a4)](_0x410ada(0x1c0)),console[_0x410ada(0x1a4)](_0x410ada(0x17d)+_0x4718f2[_0x410ada(0x1aa)]),await handleSDKOutput([_0x4718f2],_0x4bde04),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x28aa71(0x1b7)]=a25_0x28aa71(0x1b3);[a25_0x28aa71(0x19b)]='Get\x20job\x20results';[a25_0x28aa71(0x185)](_0x31c2b4){const _0x343808=a25_0x28aa71,_0x57e971=_0x31c2b4[_0x343808(0x190)][0x0];if(!_0x57e971)return _0x343808(0x1b1);return undefined;}async[a25_0x28aa71(0x195)](_0x24dbf6){const _0x248e14=a25_0x28aa71,{options:_0x4fa10f,args:_0x114ebe,tdx:_0x1f7c43}=_0x24dbf6,_0x54ad67=_0x114ebe[0x0],_0x2d4f31=await withSpinner(_0x248e14(0x19a),()=>_0x1f7c43[_0x248e14(0x1c6)][_0x248e14(0x191)](_0x54ad67),{'verbose':_0x4fa10f['verbose']}),_0x2b1b49=_0x2d4f31[_0x248e14(0x18b)];return console[_0x248e14(0x1a4)](_0x248e14(0x1bd)+_0x2b1b49[_0x248e14(0x182)]+'\x20row'+(_0x2b1b49[_0x248e14(0x182)]!==0x1?'s':'')),await handleSDKOutput(_0x2b1b49,_0x4fa10f),0x0;}}
|