@treasuredata/tdx 0.16.9 → 0.16.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- 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/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.d.ts.map +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/claude-usage-command.js.map +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/describe.js +1 -1
- package/dist/commands/engage-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/llm-proxy.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/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/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/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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +31 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-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/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/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +0 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/tree-formatter.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/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/port.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
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +0 -73
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +0 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +0 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +0 -1
- package/dist/sdk/claude-agent/environment.d.ts +0 -59
- package/dist/sdk/claude-agent/environment.d.ts.map +0 -1
- package/dist/sdk/claude-agent/environment.js +0 -1
- package/dist/sdk/claude-agent/environment.js.map +0 -1
- package/dist/sdk/claude-agent/index.d.ts +0 -15
- package/dist/sdk/claude-agent/index.d.ts.map +0 -1
- package/dist/sdk/claude-agent/index.js +0 -1
- package/dist/sdk/claude-agent/index.js.map +0 -1
- package/dist/sdk/claude-agent/system-prompts.d.ts +0 -22
- package/dist/sdk/claude-agent/system-prompts.d.ts.map +0 -1
- package/dist/sdk/claude-agent/system-prompts.js +0 -1
- package/dist/sdk/claude-agent/system-prompts.js.map +0 -1
- package/dist/sdk/claude-agent/types.d.ts +0 -107
- package/dist/sdk/claude-agent/types.d.ts.map +0 -1
- package/dist/sdk/claude-agent/types.js +0 -1
- package/dist/sdk/claude-agent/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x55b084=a16_0xbb9d;(function(_0x52f41a,_0x471509){const _0x59a6ce=a16_0xbb9d,_0x146a96=_0x52f41a();while(!![]){try{const _0x53ab3f=parseInt(_0x59a6ce(0x1ae))/0x1*(-parseInt(_0x59a6ce(0x152))/0x2)+parseInt(_0x59a6ce(0x164))/0x3+-parseInt(_0x59a6ce(0x167))/0x4+-parseInt(_0x59a6ce(0x1a5))/0x5+parseInt(_0x59a6ce(0x1a4))/0x6*(parseInt(_0x59a6ce(0x197))/0x7)+-parseInt(_0x59a6ce(0x16b))/0x8*(parseInt(_0x59a6ce(0x1a2))/0x9)+parseInt(_0x59a6ce(0x18f))/0xa;if(_0x53ab3f===_0x471509)break;else _0x146a96['push'](_0x146a96['shift']());}catch(_0x1271ec){_0x146a96['push'](_0x146a96['shift']());}}}(a16_0xeb92,0xbb7b4));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x1720d5,_0x31b481,_0x122fb4=![]){const _0x44bd22=a16_0xbb9d;if(_0x1720d5[_0x44bd22(0x16f)])return await _0x31b481[_0x44bd22(0x154)]['resolveWorkspaceId'](_0x1720d5[_0x44bd22(0x16f)]);const _0x219ac5=loadSessionContext(_0x1720d5['session']);if(_0x219ac5?.['engage_workspace'])return await _0x31b481['engage']['resolveWorkspaceId'](_0x219ac5[_0x44bd22(0x174)]);if(_0x122fb4)throw new SDKError(ErrorCode[_0x44bd22(0x18a)],_0x44bd22(0x155),undefined,{'helpText':_0x44bd22(0x18d)});return undefined;}async function resolveSegmentFromOptions(_0x579eea,_0x1f5244){const _0x5216a6=a16_0xbb9d;if(!_0x579eea[_0x5216a6(0x173)])return{};const _0x28ba94=_0x579eea[_0x5216a6(0x173)],_0x524104=await _0x1f5244[_0x5216a6(0x173)]['resolvePathToResource'](_0x28ba94);return{'audienceId':_0x524104[_0x5216a6(0x14e)],'audienceName':_0x524104[_0x5216a6(0x1a9)],..._0x524104[_0x5216a6(0x17f)]&&{'segmentId':_0x524104['segmentId'],'segmentName':_0x524104[_0x5216a6(0x1c0)]}};}function buildConnectorConfig(_0x13374d){const _0x4ff437=a16_0xbb9d,_0x3fc5c3=_0x13374d[_0x4ff437(0x18b)],_0x573b7d=_0x13374d['jsonColumns'];if(!_0x3fc5c3&&!_0x573b7d)return undefined;return{..._0x3fc5c3&&{'emailSenderId':_0x3fc5c3},..._0x573b7d&&{'jsonColumns':_0x573b7d}};}function a16_0xbb9d(_0x1af5ab,_0x510075){_0x1af5ab=_0x1af5ab-0x13c;const _0xeb9293=a16_0xeb92();let _0xbb9d41=_0xeb9293[_0x1af5ab];return _0xbb9d41;}export class EngageCampaignsCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x14d);[a16_0x55b084(0x1ac)]='List\x20campaigns';async['execute'](_0x237c03){const _0x44dffa=a16_0x55b084,{options:_0x96f8ce,args:_0xc184be,tdx:_0x1a9c90}=_0x237c03,_0x509fb6=_0xc184be[0x0],_0x17d5d5=resolveLimit(_0x96f8ce[_0x44dffa(0x142)],DEFAULT_LLM_LIMIT),_0x330108=_0x96f8ce,_0x2bc9e1=_0x330108[_0x44dffa(0x195)],_0x2c85a9=_0x330108[_0x44dffa(0x147)],_0x47b48b=await resolveWorkspaceIdFromOptions(_0x330108,_0x1a9c90),_0xcb4895=await withSpinner(_0x44dffa(0x1af),()=>_0x1a9c90['engage'][_0x44dffa(0x162)]({'type':_0x2bc9e1,'status':_0x2c85a9,'workspaceId':_0x47b48b,'limit':_0x17d5d5}),{'verbose':_0x96f8ce['verbose']});let _0x41fd2d=_0xcb4895[_0x44dffa(0x1bd)];return _0x509fb6&&(_0x41fd2d=_0xcb4895['data']['filter'](_0x413b7d=>matchGlobPattern(_0x413b7d[_0x44dffa(0x189)],_0x509fb6))),await handleSDKOutput(_0x41fd2d,_0x96f8ce),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x14c);['description']=a16_0x55b084(0x1a0);async[a16_0x55b084(0x184)](_0x41254a){const _0x5065b8=a16_0x55b084,{options:_0xde8fd9,args:_0x12acdd,tdx:_0x3b3407}=_0x41254a;if(_0x12acdd[_0x5065b8(0x179)]===0x0)return console[_0x5065b8(0x17d)](_0x5065b8(0x1b0)),console[_0x5065b8(0x17d)](_0x5065b8(0x1bb)),0x1;const _0x599a4c=_0x12acdd[0x0],_0x471989=_0xde8fd9,_0x5570cb=await resolveWorkspaceIdFromOptions(_0x471989,_0x3b3407),_0x4c99ea=_0x471989[_0x5065b8(0x141)];if(_0x4c99ea){const _0x4370bd=await withSpinner(_0x5065b8(0x17a)+_0x599a4c+_0x5065b8(0x19d),()=>_0x3b3407[_0x5065b8(0x154)]['getCampaignFull'](_0x599a4c,_0x5570cb),{'verbose':_0xde8fd9[_0x5065b8(0x1b2)]});await handleSDKOutput([_0x4370bd],_0xde8fd9);}else{const _0xaab352=await withSpinner(_0x5065b8(0x17a)+_0x599a4c+_0x5065b8(0x19d),()=>_0x3b3407[_0x5065b8(0x154)]['getCampaign'](_0x599a4c,_0x5570cb),{'verbose':_0xde8fd9[_0x5065b8(0x1b2)]});await handleSDKOutput([_0xaab352],_0xde8fd9);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x16e);[a16_0x55b084(0x1ac)]='Create\x20a\x20new\x20campaign';async[a16_0x55b084(0x184)](_0x5ad43b){const _0x1a018e=a16_0x55b084,{options:_0x1a3ba0,tdx:_0x3b1fda}=_0x5ad43b,_0x21d7c2=_0x1a3ba0,_0x34c5f6=_0x21d7c2[_0x1a018e(0x189)],_0x4f0ec5=_0x21d7c2[_0x1a018e(0x195)];if(!_0x34c5f6)return console['error'](_0x1a018e(0x143)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x4f0ec5)return console['error'](_0x1a018e(0x1c3)),console[_0x1a018e(0x17d)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x13739c=await resolveWorkspaceIdFromOptions(_0x21d7c2,_0x3b1fda,!![]),_0x1cb412=await resolveSegmentFromOptions(_0x21d7c2,_0x3b1fda),_0x20c47f=buildConnectorConfig(_0x21d7c2),_0x459f66={'name':_0x34c5f6,'campaignType':_0x4f0ec5,'workspaceId':_0x13739c,'description':_0x21d7c2[_0x1a018e(0x1ac)],..._0x1cb412,'connectorConfig':_0x20c47f,'startAt':_0x21d7c2[_0x1a018e(0x15a)],'timezone':_0x21d7c2[_0x1a018e(0x1a7)]},_0x4fb474=await withSpinner('Creating\x20campaign\x20\x27'+_0x34c5f6+_0x1a018e(0x19d),()=>_0x3b1fda[_0x1a018e(0x154)][_0x1a018e(0x1c1)](_0x459f66));return await handleSDKOutput([_0x4fb474[_0x1a018e(0x1bd)]],_0x1a3ba0),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x55b084(0x189)]='engage:campaign:update';['description']=a16_0x55b084(0x16a);async[a16_0x55b084(0x184)](_0x1c0aeb){const _0x39aafd=a16_0x55b084,{options:_0x8431f0,args:_0x3f3bb0,tdx:_0xcfd97b}=_0x1c0aeb;if(_0x3f3bb0['length']===0x0)return console[_0x39aafd(0x17d)](_0x39aafd(0x1b0)),console['error'](_0x39aafd(0x13f)),0x1;const _0x3bdcc7=_0x3f3bb0[0x0],_0x4f8188=_0x8431f0,_0x4da989=await resolveWorkspaceIdFromOptions(_0x4f8188,_0xcfd97b),_0x2b97f4=await resolveSegmentFromOptions(_0x4f8188,_0xcfd97b),_0xe5f9=buildConnectorConfig(_0x4f8188),_0x535371={'name':_0x4f8188[_0x39aafd(0x189)],'description':_0x4f8188[_0x39aafd(0x1ac)],..._0x2b97f4,'connectorConfig':_0xe5f9,'startAt':_0x4f8188[_0x39aafd(0x15a)],'timezone':_0x4f8188[_0x39aafd(0x1a7)]},_0x476200=Object['fromEntries'](Object['entries'](_0x535371)['filter'](([,_0xb4550e])=>_0xb4550e!==undefined));if(Object[_0x39aafd(0x1be)](_0x476200)[_0x39aafd(0x179)]===0x0)return console['error'](_0x39aafd(0x177)),console[_0x39aafd(0x17d)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x22c79f=await withSpinner(_0x39aafd(0x15e)+_0x3bdcc7+_0x39aafd(0x19d),()=>_0xcfd97b['engage'][_0x39aafd(0x146)](_0x3bdcc7,_0x476200,_0x4da989),{'verbose':_0x8431f0[_0x39aafd(0x1b2)]});return await handleSDKOutput([_0x22c79f['data']],_0x8431f0),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a16_0x55b084(0x14f);['description']=a16_0x55b084(0x1b5);async[a16_0x55b084(0x184)](_0x3bcd41){const _0x22f1f6=a16_0x55b084,{options:_0x3377e9,args:_0x15cf5c,tdx:_0x4aa775}=_0x3bcd41;if(_0x15cf5c[_0x22f1f6(0x179)]===0x0)return console['error'](_0x22f1f6(0x1b0)),console[_0x22f1f6(0x17d)](_0x22f1f6(0x1ad)),0x1;const _0xcfc158=_0x15cf5c[0x0],_0x214f47=_0x3377e9,_0x4de214=await resolveWorkspaceIdFromOptions(_0x214f47,_0x4aa775);if(!_0x3377e9[_0x22f1f6(0x193)]){const _0x5f057=await confirm(_0x22f1f6(0x17b)+_0xcfc158+_0x22f1f6(0x196));if(!_0x5f057)return console[_0x22f1f6(0x1b3)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x22f1f6(0x19b)+_0xcfc158+'\x27...',()=>_0x4aa775['engage'][_0x22f1f6(0x1ab)](_0xcfc158,_0x4de214),{'verbose':_0x3377e9[_0x22f1f6(0x1b2)]}),console[_0x22f1f6(0x1b3)]('Campaign\x20\x27'+_0xcfc158+_0x22f1f6(0x181)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x151);[a16_0x55b084(0x1ac)]=a16_0x55b084(0x163);async[a16_0x55b084(0x184)](_0x283596){const _0x177354=a16_0x55b084,{options:_0x574e87,args:_0x5877e3,tdx:_0x510f9e}=_0x283596;if(_0x5877e3[_0x177354(0x179)]===0x0)return console[_0x177354(0x17d)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x177354(0x17d)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x219b51=_0x5877e3[0x0],_0x4d53c1=_0x574e87,_0x273bb9=await resolveWorkspaceIdFromOptions(_0x4d53c1,_0x510f9e);return await withSpinner(_0x177354(0x168)+_0x219b51+_0x177354(0x19d),()=>_0x510f9e['engage'][_0x177354(0x172)](_0x219b51,_0x273bb9),{'verbose':_0x574e87['verbose']}),console[_0x177354(0x1b3)]('Campaign\x20\x27'+_0x219b51+_0x177354(0x16d)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x165);[a16_0x55b084(0x1ac)]='Pause\x20a\x20campaign';async[a16_0x55b084(0x184)](_0x453f81){const _0x6ef052=a16_0x55b084,{options:_0x10f55e,args:_0x145444,tdx:_0x15d527}=_0x453f81;if(_0x145444['length']===0x0)return console[_0x6ef052(0x17d)](_0x6ef052(0x1b0)),console[_0x6ef052(0x17d)](_0x6ef052(0x183)),0x1;const _0x33e56a=_0x145444[0x0],_0x458b75=_0x10f55e,_0x432cda=await resolveWorkspaceIdFromOptions(_0x458b75,_0x15d527);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x33e56a+_0x6ef052(0x19d),()=>_0x15d527['engage'][_0x6ef052(0x19e)](_0x33e56a,_0x432cda),{'verbose':_0x10f55e['verbose']}),console['log'](_0x6ef052(0x149)+_0x33e56a+_0x6ef052(0x169)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x18c);[a16_0x55b084(0x1ac)]='Resume\x20a\x20paused\x20campaign';async[a16_0x55b084(0x184)](_0x466fae){const _0xa1a541=a16_0x55b084,{options:_0x42e138,args:_0x79dabd,tdx:_0xfc3ace}=_0x466fae;if(_0x79dabd[_0xa1a541(0x179)]===0x0)return console['error'](_0xa1a541(0x1b0)),console[_0xa1a541(0x17d)](_0xa1a541(0x1a3)),0x1;const _0xef71f0=_0x79dabd[0x0],_0x10fb39=_0x42e138,_0x2914f5=await resolveWorkspaceIdFromOptions(_0x10fb39,_0xfc3ace);return await withSpinner(_0xa1a541(0x19c)+_0xef71f0+_0xa1a541(0x19d),()=>_0xfc3ace[_0xa1a541(0x154)][_0xa1a541(0x199)](_0xef71f0,_0x2914f5),{'verbose':_0x42e138[_0xa1a541(0x1b2)]}),console[_0xa1a541(0x1b3)](_0xa1a541(0x149)+_0xef71f0+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']='engage:campaign:duplicate';[a16_0x55b084(0x1ac)]='Duplicate\x20a\x20campaign';async[a16_0x55b084(0x184)](_0x4af660){const _0x520b39=a16_0x55b084,{options:_0x5d5b27,args:_0x405942,tdx:_0x1f5c2b}=_0x4af660;if(_0x405942[_0x520b39(0x179)]===0x0)return console[_0x520b39(0x17d)](_0x520b39(0x1b0)),console[_0x520b39(0x17d)](_0x520b39(0x14b)),0x1;const _0x535856=_0x405942[0x0],_0x3aade3=_0x5d5b27,_0x20e224=await resolveWorkspaceIdFromOptions(_0x3aade3,_0x1f5c2b),_0x82b936=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x535856+_0x520b39(0x19d),()=>_0x1f5c2b[_0x520b39(0x154)]['duplicateCampaign'](_0x535856,_0x20e224),{'verbose':_0x5d5b27[_0x520b39(0x1b2)]});return await handleSDKOutput([_0x82b936[_0x520b39(0x1bd)]],_0x5d5b27),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']='engage:templates';['description']=a16_0x55b084(0x16c);async['execute'](_0x18b15b){const _0x4722cd=a16_0x55b084,{options:_0x597c14,args:_0x231ab6,tdx:_0x121380}=_0x18b15b,_0x52168f=_0x231ab6[0x0],_0x4b0436=resolveLimit(_0x597c14[_0x4722cd(0x142)],DEFAULT_LLM_LIMIT),_0xcbf030=_0x597c14,_0x4235d3=await resolveWorkspaceIdFromOptions(_0xcbf030,_0x121380),_0x64f5cb=await withSpinner(_0x4722cd(0x185),()=>_0x121380[_0x4722cd(0x154)][_0x4722cd(0x176)]({'workspaceId':_0x4235d3,'limit':_0x4b0436}),{'verbose':_0x597c14[_0x4722cd(0x1b2)]});let _0x26669a=_0x64f5cb[_0x4722cd(0x1bd)];return _0x52168f&&(_0x26669a=_0x64f5cb[_0x4722cd(0x1bd)]['filter'](_0x24a852=>matchGlobPattern(_0x24a852['name'],_0x52168f))),await handleSDKOutput(_0x26669a,_0x597c14),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x1ba);[a16_0x55b084(0x1ac)]=a16_0x55b084(0x157);async[a16_0x55b084(0x184)](_0x42d38a){const _0x704c5a=a16_0x55b084,{options:_0x2b18cf,args:_0x121715,tdx:_0x35ae98}=_0x42d38a;if(_0x121715[_0x704c5a(0x179)]===0x0)return console[_0x704c5a(0x17d)](_0x704c5a(0x1b7)),console[_0x704c5a(0x17d)](_0x704c5a(0x186)),0x1;const _0xc5d7d0=_0x121715[0x0],_0x10091d=_0x2b18cf,_0x972964=await resolveWorkspaceIdFromOptions(_0x10091d,_0x35ae98),_0x492084=_0x10091d['full'];if(_0x492084){const _0x379af7=await withSpinner(_0x704c5a(0x156)+_0xc5d7d0+_0x704c5a(0x19d),()=>_0x35ae98[_0x704c5a(0x154)][_0x704c5a(0x13c)](_0xc5d7d0,_0x972964),{'verbose':_0x2b18cf[_0x704c5a(0x1b2)]});await handleSDKOutput([_0x379af7],_0x2b18cf);}else{const _0x59852c=await withSpinner(_0x704c5a(0x156)+_0xc5d7d0+_0x704c5a(0x19d),()=>_0x35ae98[_0x704c5a(0x154)][_0x704c5a(0x14a)](_0xc5d7d0,_0x972964),{'verbose':_0x2b18cf[_0x704c5a(0x1b2)]});await handleSDKOutput([_0x59852c],_0x2b18cf);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x178);[a16_0x55b084(0x1ac)]=a16_0x55b084(0x1a6);async[a16_0x55b084(0x184)](_0x55906f){const _0x47beb4=a16_0x55b084,{options:_0x5d1ff4,tdx:_0x340b6e}=_0x55906f,_0x4ef547=_0x5d1ff4,_0x2b152c=_0x4ef547[_0x47beb4(0x189)],_0x36608d=_0x4ef547[_0x47beb4(0x187)],_0x43ff0a=_0x4ef547[_0x47beb4(0x18e)];if(!_0x2b152c)return console[_0x47beb4(0x17d)](_0x47beb4(0x143)),console[_0x47beb4(0x17d)](_0x47beb4(0x158)),0x1;if(!_0x36608d)return console['error'](_0x47beb4(0x1a1)),0x1;if(!_0x43ff0a)return console[_0x47beb4(0x17d)]('Error:\x20--html\x20is\x20required'),0x1;const _0xd06cef=await resolveWorkspaceIdFromOptions(_0x4ef547,_0x340b6e,!![]),_0x535df4={'name':_0x2b152c,'subjectTemplate':_0x36608d,'htmlTemplate':_0x43ff0a,'workspaceId':_0xd06cef,'plaintextTemplate':_0x4ef547['plaintext'],'editorType':_0x4ef547['editorType']},_0x318d47=await withSpinner(_0x47beb4(0x182)+_0x2b152c+_0x47beb4(0x19d),()=>_0x340b6e[_0x47beb4(0x154)]['createTemplate'](_0x535df4));return await handleSDKOutput([_0x318d47[_0x47beb4(0x1bd)]],_0x5d1ff4),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x17e);[a16_0x55b084(0x1ac)]=a16_0x55b084(0x15b);async[a16_0x55b084(0x184)](_0x128971){const _0x226450=a16_0x55b084,{options:_0x16365c,args:_0x55935e,tdx:_0x474c79}=_0x128971;if(_0x55935e['length']===0x0)return console['error']('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x226450(0x17d)](_0x226450(0x1bc)),0x1;const _0x22576f=_0x55935e[0x0],_0x3ed074=_0x16365c,_0x569a52=await resolveWorkspaceIdFromOptions(_0x3ed074,_0x474c79),_0x5c9aff={'name':_0x3ed074[_0x226450(0x189)],'subjectTemplate':_0x3ed074[_0x226450(0x187)],'htmlTemplate':_0x3ed074[_0x226450(0x18e)],'plaintextTemplate':_0x3ed074[_0x226450(0x13e)]},_0x50c8c3=Object[_0x226450(0x188)](Object[_0x226450(0x13d)](_0x5c9aff)[_0x226450(0x170)](([,_0x29b19a])=>_0x29b19a!==undefined));if(Object[_0x226450(0x1be)](_0x50c8c3)[_0x226450(0x179)]===0x0)return console['error'](_0x226450(0x177)),console['error'](_0x226450(0x19f)),0x1;const _0x13d31a=await withSpinner(_0x226450(0x191)+_0x22576f+_0x226450(0x19d),()=>_0x474c79[_0x226450(0x154)][_0x226450(0x1a8)](_0x22576f,_0x50c8c3,_0x569a52),{'verbose':_0x16365c[_0x226450(0x1b2)]});return await handleSDKOutput([_0x13d31a['data']],_0x16365c),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x55b084(0x189)]='engage:template:delete';[a16_0x55b084(0x1ac)]='Delete\x20an\x20email\x20template';async[a16_0x55b084(0x184)](_0x4c606a){const _0x2c356c=a16_0x55b084,{options:_0x2beaea,args:_0x1885fc,tdx:_0x1477d9}=_0x4c606a;if(_0x1885fc[_0x2c356c(0x179)]===0x0)return console[_0x2c356c(0x17d)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x30f42f=_0x1885fc[0x0],_0x48c223=_0x2beaea,_0xd7a884=await resolveWorkspaceIdFromOptions(_0x48c223,_0x1477d9);if(!_0x2beaea[_0x2c356c(0x193)]){const _0x266eec=await confirm(_0x2c356c(0x1b6)+_0x30f42f+_0x2c356c(0x196));if(!_0x266eec)return console[_0x2c356c(0x1b3)](_0x2c356c(0x140)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x30f42f+'\x27...',()=>_0x1477d9[_0x2c356c(0x154)][_0x2c356c(0x194)](_0x30f42f,_0xd7a884),{'verbose':_0x2beaea['verbose']}),console['log']('Template\x20\x27'+_0x30f42f+_0x2c356c(0x181)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']=a16_0x55b084(0x1b8);[a16_0x55b084(0x1ac)]=a16_0x55b084(0x190);async[a16_0x55b084(0x184)](_0x1b8eac){const _0x271894=a16_0x55b084,{options:_0x227ce9,args:_0x3684b9,tdx:_0x3750a4}=_0x1b8eac,_0x164a65=_0x3684b9[0x0],_0x17116c=resolveLimit(_0x227ce9[_0x271894(0x142)],DEFAULT_LLM_LIMIT),_0x4da316=await withSpinner('Fetching\x20workspaces...',()=>_0x3750a4[_0x271894(0x154)][_0x271894(0x175)]({'limit':_0x17116c}),{'verbose':_0x227ce9[_0x271894(0x1b2)]});let _0x237e79=_0x4da316[_0x271894(0x1bd)];return _0x164a65&&(_0x237e79=_0x4da316[_0x271894(0x1bd)][_0x271894(0x170)](_0x23a564=>matchGlobPattern(_0x23a564[_0x271894(0x189)],_0x164a65))),await handleSDKOutput(_0x237e79,_0x227ce9),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x55b084(0x189)]=a16_0x55b084(0x15d);[a16_0x55b084(0x1ac)]=a16_0x55b084(0x150);async[a16_0x55b084(0x184)](_0x5ae510){const _0x6d7111=a16_0x55b084,{options:_0x28bc02,args:_0x4836fe,tdx:_0x179deb}=_0x5ae510;if(_0x4836fe[_0x6d7111(0x179)]===0x0)return console['error'](_0x6d7111(0x15c)),console[_0x6d7111(0x17d)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x3a6b46=_0x4836fe[0x0],_0x2be150=_0x28bc02,_0x27e070=_0x2be150[_0x6d7111(0x141)];if(_0x27e070){const _0x5ba728=await withSpinner(_0x6d7111(0x148)+_0x3a6b46+_0x6d7111(0x19d),()=>_0x179deb[_0x6d7111(0x154)]['getWorkspaceFull'](_0x3a6b46),{'verbose':_0x28bc02[_0x6d7111(0x1b2)]});await handleSDKOutput([_0x5ba728],_0x28bc02);}else{const _0x1f5607=await withSpinner('Fetching\x20workspace\x20\x27'+_0x3a6b46+_0x6d7111(0x19d),()=>_0x179deb[_0x6d7111(0x154)][_0x6d7111(0x166)](_0x3a6b46),{'verbose':_0x28bc02[_0x6d7111(0x1b2)]});await handleSDKOutput([_0x1f5607],_0x28bc02);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a16_0x55b084(0x180);[a16_0x55b084(0x1ac)]=a16_0x55b084(0x171);async[a16_0x55b084(0x184)](_0x3d3cb1){const _0x353afd=a16_0x55b084,{options:_0x16101c,tdx:_0x13463b}=_0x3d3cb1,_0x22e84f=_0x16101c,_0x10518c=_0x22e84f[_0x353afd(0x189)];if(!_0x10518c)return console[_0x353afd(0x17d)]('Error:\x20--name\x20is\x20required'),console[_0x353afd(0x17d)](_0x353afd(0x1b9)),0x1;const _0x35b089={'name':_0x10518c,'description':_0x22e84f[_0x353afd(0x1ac)]},_0x4668f2=await withSpinner(_0x353afd(0x19a)+_0x10518c+_0x353afd(0x19d),()=>_0x13463b['engage']['createWorkspace'](_0x35b089));return await handleSDKOutput([_0x4668f2[_0x353afd(0x1bd)]],_0x16101c),0x0;}}function a16_0xeb92(){const _0x8b7089=['Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','subject','fromEntries','name','MISSING_ARGUMENT','emailSenderId','engage:campaign:resume','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','html','13763220DUxPDC','List\x20workspaces','Updating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','yes','deleteTemplate','type','\x27?\x20This\x20cannot\x20be\x20undone.','65688weZMJF','Updating\x20workspace\x20\x27','resumeCampaign','Creating\x20workspace\x20\x27','Deleting\x20campaign\x20\x27','Resuming\x20campaign\x20\x27','\x27...','pauseCampaign','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Show\x20campaign\x20details','Error:\x20--subject\x20is\x20required','2295BaULjy','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','468XorsWn','6214435OhUjJt','Create\x20an\x20email\x20template','timezone','updateTemplate','parentName','engage:workspace:update','deleteCampaign','description','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','39389aEdTbQ','Fetching\x20campaigns...','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:workspace:delete','verbose','log','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Delete\x20a\x20campaign','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','engage:workspaces','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','engage:template:show','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','data','keys','Deleting\x20workspace\x20\x27','segmentName','createCampaign','Options:\x20--name,\x20--description','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','getTemplateFull','entries','plaintext','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Operation\x20cancelled','full','limit','Error:\x20--name\x20is\x20required','Engage\x20workspace\x20set\x20to:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','updateCampaign','status','Fetching\x20workspace\x20\x27','Campaign\x20\x27','getTemplate','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','engage:campaign:show','engage:campaigns','parentId','engage:campaign:delete','Show\x20workspace\x20details','engage:campaign:launch','32yLVtIf','updateWorkspace','engage','Workspace\x20is\x20required\x20for\x20this\x20operation','Fetching\x20template\x20\x27','Show\x20email\x20template\x20details','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','startAt','Update\x20an\x20email\x20template','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','engage:workspace:show','Updating\x20campaign\x20\x27','resolveWorkspaceId','Error:\x20Workspace\x20name\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','listCampaigns','Launch\x20a\x20campaign','4058052zSYrVB','engage:campaign:pause','getWorkspace','1777232dbvzsB','Launching\x20campaign\x20\x27','\x27\x20paused\x20successfully','Update\x20a\x20campaign','11784amSIQc','List\x20email\x20templates','\x27\x20launched\x20successfully','engage:campaign:create','workspace','filter','Create\x20a\x20workspace','launchCampaign','segment','engage_workspace','listWorkspaces','listTemplates','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','engage:template:create','length','Fetching\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','session','error','engage:template:update','segmentId','engage:workspace:create','\x27\x20deleted\x20successfully','Creating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','execute','Fetching\x20templates...'];a16_0xeb92=function(){return _0x8b7089;};return a16_0xeb92();}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']=a16_0x55b084(0x1aa);['description']='Update\x20a\x20workspace';async[a16_0x55b084(0x184)](_0x3533cc){const _0x2efcf5=a16_0x55b084,{options:_0x2c037e,args:_0x2ed45a,tdx:_0xb07c99}=_0x3533cc;if(_0x2ed45a[_0x2efcf5(0x179)]===0x0)return console['error'](_0x2efcf5(0x15c)),console['error'](_0x2efcf5(0x1b4)),0x1;const _0x275780=_0x2ed45a[0x0],_0x58e828=_0x2c037e,_0x32417e={'name':_0x58e828[_0x2efcf5(0x189)],'description':_0x58e828[_0x2efcf5(0x1ac)]},_0x1b56c6=Object[_0x2efcf5(0x188)](Object[_0x2efcf5(0x13d)](_0x32417e)['filter'](([,_0x450de7])=>_0x450de7!==undefined));if(Object[_0x2efcf5(0x1be)](_0x1b56c6)['length']===0x0)return console[_0x2efcf5(0x17d)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x2efcf5(0x1c2)),0x1;const _0x5a76a1=await withSpinner(_0x2efcf5(0x198)+_0x275780+_0x2efcf5(0x19d),()=>_0xb07c99['engage'][_0x2efcf5(0x153)](_0x275780,_0x1b56c6),{'verbose':_0x2c037e[_0x2efcf5(0x1b2)]});return await handleSDKOutput([_0x5a76a1[_0x2efcf5(0x1bd)]],_0x2c037e),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a16_0x55b084(0x1b1);[a16_0x55b084(0x1ac)]='Delete\x20a\x20workspace';async['execute'](_0x56b9c1){const _0x25afdb=a16_0x55b084,{options:_0x21b285,args:_0x2daea9,tdx:_0x5b88fc}=_0x56b9c1;if(_0x2daea9[_0x25afdb(0x179)]===0x0)return console[_0x25afdb(0x17d)](_0x25afdb(0x15c)),console[_0x25afdb(0x17d)](_0x25afdb(0x192)),0x1;const _0x396939=_0x2daea9[0x0];if(!_0x21b285[_0x25afdb(0x193)]){const _0x5576f7=await confirm(_0x25afdb(0x145)+_0x396939+_0x25afdb(0x196));if(!_0x5576f7)return console[_0x25afdb(0x1b3)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x25afdb(0x1bf)+_0x396939+_0x25afdb(0x19d),()=>_0x5b88fc[_0x25afdb(0x154)]['deleteWorkspace'](_0x396939),{'verbose':_0x21b285['verbose']}),console[_0x25afdb(0x1b3)]('Workspace\x20\x27'+_0x396939+_0x25afdb(0x181)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x55b084(0x189)]='engage:workspace:use';[a16_0x55b084(0x1ac)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a16_0x55b084(0x184)](_0x3ac312){const _0x25ebeb=a16_0x55b084,{options:_0x2babde,args:_0x38249f,tdx:_0x4424fe}=_0x3ac312;if(_0x38249f['length']===0x0)return console[_0x25ebeb(0x17d)](_0x25ebeb(0x160)),console[_0x25ebeb(0x17d)](_0x25ebeb(0x161)),0x1;const _0x3f4403=_0x38249f[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x3f4403+_0x25ebeb(0x19d),()=>_0x4424fe[_0x25ebeb(0x154)][_0x25ebeb(0x15f)](_0x3f4403));const _0x1a960b=_0x2babde[_0x25ebeb(0x17c)]||undefined;return saveSessionContext({'engage_workspace':_0x3f4403},_0x1a960b),console[_0x25ebeb(0x1b3)](_0x25ebeb(0x144)+_0x3f4403),console[_0x25ebeb(0x1b3)](_0x25ebeb(0x159)),0x0;}}
|
|
1
|
+
const a16_0x4e69bf=a16_0x300e;(function(_0x408502,_0x2b6904){const _0x23f4a1=a16_0x300e,_0x64f725=_0x408502();while(!![]){try{const _0x321cc8=parseInt(_0x23f4a1(0x1ea))/0x1+-parseInt(_0x23f4a1(0x1c4))/0x2*(parseInt(_0x23f4a1(0x1ec))/0x3)+parseInt(_0x23f4a1(0x20e))/0x4+-parseInt(_0x23f4a1(0x223))/0x5+-parseInt(_0x23f4a1(0x1fd))/0x6*(parseInt(_0x23f4a1(0x1e8))/0x7)+parseInt(_0x23f4a1(0x196))/0x8+-parseInt(_0x23f4a1(0x220))/0x9*(-parseInt(_0x23f4a1(0x1aa))/0xa);if(_0x321cc8===_0x2b6904)break;else _0x64f725['push'](_0x64f725['shift']());}catch(_0x4e0bdd){_0x64f725['push'](_0x64f725['shift']());}}}(a16_0x175c,0x697a2));function a16_0x175c(){const _0x1607d8=['40789dZcnNV','MISSING_ARGUMENT','121024htQaHA','Deleting\x20template\x20\x27','219KVSPCC','verbose','engage:campaign:show','getCampaignFull','timezone','engage_workspace','Verifying\x20workspace\x20\x27','Updating\x20workspace\x20\x27','getCampaign','launchCampaign','filter','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','engage:template:show','Fetching\x20campaign\x20\x27','Error:\x20Workspace\x20name\x20is\x20required','engage:templates','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','348RwQOaS','Pausing\x20campaign\x20\x27','Creating\x20workspace\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','session','engage:workspace:delete','entries','duplicateCampaign','Delete\x20a\x20workspace','\x27?\x20This\x20cannot\x20be\x20undone.','fromEntries','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Update\x20an\x20email\x20template','log','engage:workspaces','engage:campaign:delete','Updating\x20campaign\x20\x27','2662312igVHHU','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Duplicating\x20campaign\x20\x27','description','updateTemplate','engage','engage:campaign:update','engage:campaign:resume','updateWorkspace','data','resumeCampaign','Campaign\x20\x27','createWorkspace','editorType','segmentName','execute','createTemplate','length','9NqtUdv','startAt','emailSenderId','2843930bgmcHr','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','getWorkspaceFull','Deleting\x20campaign\x20\x27','full','html','Create\x20a\x20workspace','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Launch\x20a\x20campaign','Workspace\x20\x27','engage:workspace:create','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','5300464CajHDC','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','engage:campaign:duplicate','Engage\x20workspace\x20set\x20to:\x20','Workspace\x20is\x20required\x20for\x20this\x20operation','Resume\x20a\x20paused\x20campaign','Operation\x20cancelled','jsonColumns','subject','segmentId','status','getTemplateFull','Create\x20an\x20email\x20template','Error:\x20--name\x20is\x20required','resolveWorkspaceId','listTemplates','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Duplicate\x20a\x20campaign','Options:\x20--name,\x20--description','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','5307850gakxzJ','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Fetching\x20campaigns...','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Updating\x20template\x20\x27','Show\x20campaign\x20details','Pause\x20a\x20campaign','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Fetching\x20workspaces...','\x27\x20launched\x20successfully','Error:\x20--subject\x20is\x20required','Fetching\x20workspace\x20\x27','Template\x20\x27','keys','\x27...','List\x20workspaces','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','List\x20campaigns','List\x20email\x20templates','deleteWorkspace','Deleting\x20workspace\x20\x27','Creating\x20template\x20\x27','pauseCampaign','deleteCampaign','Launching\x20campaign\x20\x27','17566mnGJzR','\x27\x20deleted\x20successfully','type','yes','Error:\x20--html\x20is\x20required','Show\x20email\x20template\x20details','engage:campaigns','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','engage:campaign:pause','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Delete\x20a\x20campaign','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:template:delete','updateCampaign','\x27\x20resumed\x20successfully','error','Show\x20workspace\x20details','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Update\x20a\x20workspace','Delete\x20an\x20email\x20template','workspace','createCampaign','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','segment','deleteTemplate','listWorkspaces','limit','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','engage:template:update','name','listCampaigns','Fetching\x20template\x20\x27','parentName','resolvePathToResource','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'];a16_0x175c=function(){return _0x1607d8;};return a16_0x175c();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a16_0x300e(_0x315607,_0x2a3d87){_0x315607=_0x315607-0x18c;const _0x175c21=a16_0x175c();let _0x300ec5=_0x175c21[_0x315607];return _0x300ec5;}import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x2aca86,_0x3d921c,_0x2c41c4=![]){const _0x446e04=a16_0x300e;if(_0x2aca86[_0x446e04(0x1d8)])return await _0x3d921c[_0x446e04(0x213)]['resolveWorkspaceId'](_0x2aca86[_0x446e04(0x1d8)]);const _0x20736e=loadSessionContext(_0x2aca86[_0x446e04(0x201)]);if(_0x20736e?.[_0x446e04(0x1f1)])return await _0x3d921c[_0x446e04(0x213)][_0x446e04(0x1a4)](_0x20736e[_0x446e04(0x1f1)]);if(_0x2c41c4)throw new SDKError(ErrorCode[_0x446e04(0x1e9)],_0x446e04(0x19a),undefined,{'helpText':_0x446e04(0x1f7)});return undefined;}async function resolveSegmentFromOptions(_0x10d1bf,_0x6c0c2f){const _0x559b5c=a16_0x300e;if(!_0x10d1bf[_0x559b5c(0x1db)])return{};const _0x131aa3=_0x10d1bf['segment'],_0xe0b22d=await _0x6c0c2f[_0x559b5c(0x1db)][_0x559b5c(0x1e5)](_0x131aa3);return{'audienceId':_0xe0b22d['parentId'],'audienceName':_0xe0b22d[_0x559b5c(0x1e4)],..._0xe0b22d['segmentId']&&{'segmentId':_0xe0b22d[_0x559b5c(0x19f)],'segmentName':_0xe0b22d[_0x559b5c(0x21c)]}};}function buildConnectorConfig(_0x530507){const _0x30621d=a16_0x300e,_0x195e10=_0x530507[_0x30621d(0x222)],_0x3f8c49=_0x530507[_0x30621d(0x19d)];if(!_0x195e10&&!_0x3f8c49)return undefined;return{..._0x195e10&&{'emailSenderId':_0x195e10},..._0x3f8c49&&{'jsonColumns':_0x3f8c49}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]=a16_0x4e69bf(0x1ca);['description']=a16_0x4e69bf(0x1bc);async[a16_0x4e69bf(0x21d)](_0x41b575){const _0x2c23e4=a16_0x4e69bf,{options:_0x3c7646,args:_0x3a1fc7,tdx:_0x273fb1}=_0x41b575,_0x4c76e5=_0x3a1fc7[0x0],_0x43885b=resolveLimit(_0x3c7646[_0x2c23e4(0x1de)],DEFAULT_LLM_LIMIT),_0x3adeb2=_0x3c7646,_0x252e3e=_0x3adeb2[_0x2c23e4(0x1c6)],_0x480a61=_0x3adeb2[_0x2c23e4(0x1a0)],_0x15b1f2=await resolveWorkspaceIdFromOptions(_0x3adeb2,_0x273fb1),_0x513427=await withSpinner(_0x2c23e4(0x1ac),()=>_0x273fb1[_0x2c23e4(0x213)][_0x2c23e4(0x1e2)]({'type':_0x252e3e,'status':_0x480a61,'workspaceId':_0x15b1f2,'limit':_0x43885b}),{'verbose':_0x3c7646['verbose']});let _0x3b0889=_0x513427[_0x2c23e4(0x217)];return _0x4c76e5&&(_0x3b0889=_0x513427[_0x2c23e4(0x217)][_0x2c23e4(0x1f6)](_0x20462d=>matchGlobPattern(_0x20462d[_0x2c23e4(0x1e1)],_0x4c76e5))),await handleSDKOutput(_0x3b0889,_0x3c7646),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]=a16_0x4e69bf(0x1ee);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1af);async[a16_0x4e69bf(0x21d)](_0x34c709){const _0x2f6955=a16_0x4e69bf,{options:_0x486497,args:_0x675d0c,tdx:_0xc20e0c}=_0x34c709;if(_0x675d0c[_0x2f6955(0x21f)]===0x0)return console[_0x2f6955(0x1d3)](_0x2f6955(0x1cf)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x5e5213=_0x675d0c[0x0],_0x5d8ccd=_0x486497,_0x1127f5=await resolveWorkspaceIdFromOptions(_0x5d8ccd,_0xc20e0c),_0x55a477=_0x5d8ccd['full'];if(_0x55a477){const _0x2f7261=await withSpinner(_0x2f6955(0x1f9)+_0x5e5213+'\x27...',()=>_0xc20e0c['engage'][_0x2f6955(0x1ef)](_0x5e5213,_0x1127f5),{'verbose':_0x486497['verbose']});await handleSDKOutput([_0x2f7261],_0x486497);}else{const _0x3297a6=await withSpinner(_0x2f6955(0x1f9)+_0x5e5213+_0x2f6955(0x1b9),()=>_0xc20e0c['engage'][_0x2f6955(0x1f4)](_0x5e5213,_0x1127f5),{'verbose':_0x486497['verbose']});await handleSDKOutput([_0x3297a6],_0x486497);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]='engage:campaign:create';['description']='Create\x20a\x20new\x20campaign';async[a16_0x4e69bf(0x21d)](_0x282ba9){const _0x4e02fc=a16_0x4e69bf,{options:_0x154350,tdx:_0xd8598a}=_0x282ba9,_0xda8798=_0x154350,_0x5c8e7b=_0xda8798[_0x4e02fc(0x1e1)],_0x7d4426=_0xda8798['type'];if(!_0x5c8e7b)return console[_0x4e02fc(0x1d3)](_0x4e02fc(0x1a3)),console[_0x4e02fc(0x1d3)](_0x4e02fc(0x1b2)),0x1;if(!_0x7d4426)return console[_0x4e02fc(0x1d3)](_0x4e02fc(0x1cd)),console['error'](_0x4e02fc(0x1b2)),0x1;const _0x1e519a=await resolveWorkspaceIdFromOptions(_0xda8798,_0xd8598a,!![]),_0x4cd2cf=await resolveSegmentFromOptions(_0xda8798,_0xd8598a),_0xcc6b79=buildConnectorConfig(_0xda8798),_0x406e31={'name':_0x5c8e7b,'campaignType':_0x7d4426,'workspaceId':_0x1e519a,'description':_0xda8798[_0x4e02fc(0x211)],..._0x4cd2cf,'connectorConfig':_0xcc6b79,'startAt':_0xda8798[_0x4e02fc(0x221)],'timezone':_0xda8798[_0x4e02fc(0x1f0)]},_0x1216c0=await withSpinner('Creating\x20campaign\x20\x27'+_0x5c8e7b+_0x4e02fc(0x1b9),()=>_0xd8598a[_0x4e02fc(0x213)][_0x4e02fc(0x1d9)](_0x406e31));return await handleSDKOutput([_0x1216c0[_0x4e02fc(0x217)]],_0x154350),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a16_0x4e69bf(0x214);['description']='Update\x20a\x20campaign';async[a16_0x4e69bf(0x21d)](_0x5ee759){const _0x203d5c=a16_0x4e69bf,{options:_0x121c4d,args:_0x5eb849,tdx:_0x4484fd}=_0x5ee759;if(_0x5eb849[_0x203d5c(0x21f)]===0x0)return console[_0x203d5c(0x1d3)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x203d5c(0x1d3)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x1ec6a5=_0x5eb849[0x0],_0x2947a6=_0x121c4d,_0x4ae8de=await resolveWorkspaceIdFromOptions(_0x2947a6,_0x4484fd),_0x3b84b5=await resolveSegmentFromOptions(_0x2947a6,_0x4484fd),_0x1944b8=buildConnectorConfig(_0x2947a6),_0x55184b={'name':_0x2947a6['name'],'description':_0x2947a6[_0x203d5c(0x211)],..._0x3b84b5,'connectorConfig':_0x1944b8,'startAt':_0x2947a6[_0x203d5c(0x221)],'timezone':_0x2947a6[_0x203d5c(0x1f0)]},_0x254b1a=Object[_0x203d5c(0x207)](Object[_0x203d5c(0x203)](_0x55184b)[_0x203d5c(0x1f6)](([,_0x1fd9f1])=>_0x1fd9f1!==undefined));if(Object[_0x203d5c(0x1b8)](_0x254b1a)['length']===0x0)return console[_0x203d5c(0x1d3)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x203d5c(0x1fc)),0x1;const _0x3619b2=await withSpinner(_0x203d5c(0x20d)+_0x1ec6a5+'\x27...',()=>_0x4484fd[_0x203d5c(0x213)][_0x203d5c(0x1d1)](_0x1ec6a5,_0x254b1a,_0x4ae8de),{'verbose':_0x121c4d[_0x203d5c(0x1ed)]});return await handleSDKOutput([_0x3619b2[_0x203d5c(0x217)]],_0x121c4d),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]=a16_0x4e69bf(0x20c);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1ce);async['execute'](_0x202ad0){const _0x3f6917=a16_0x4e69bf,{options:_0x101a8d,args:_0x4a1264,tdx:_0x485223}=_0x202ad0;if(_0x4a1264['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x3f6917(0x1d3)](_0x3f6917(0x1a9)),0x1;const _0x1dde40=_0x4a1264[0x0],_0x5483f1=_0x101a8d,_0x1b4bd0=await resolveWorkspaceIdFromOptions(_0x5483f1,_0x485223);if(!_0x101a8d[_0x3f6917(0x1c7)]){const _0x375bd0=await confirm(_0x3f6917(0x224)+_0x1dde40+_0x3f6917(0x206));if(!_0x375bd0)return console['log'](_0x3f6917(0x19c)),0x0;}return await withSpinner(_0x3f6917(0x18d)+_0x1dde40+_0x3f6917(0x1b9),()=>_0x485223[_0x3f6917(0x213)][_0x3f6917(0x1c2)](_0x1dde40,_0x1b4bd0),{'verbose':_0x101a8d['verbose']}),console[_0x3f6917(0x20a)](_0x3f6917(0x219)+_0x1dde40+_0x3f6917(0x1c5)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]='engage:campaign:launch';[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x192);async['execute'](_0x4208c0){const _0x25b86f=a16_0x4e69bf,{options:_0x1887bc,args:_0x450f1e,tdx:_0x34243f}=_0x4208c0;if(_0x450f1e['length']===0x0)return console['error'](_0x25b86f(0x1cf)),console[_0x25b86f(0x1d3)](_0x25b86f(0x1e6)),0x1;const _0xb07fe0=_0x450f1e[0x0],_0x351384=_0x1887bc,_0x4acf03=await resolveWorkspaceIdFromOptions(_0x351384,_0x34243f);return await withSpinner(_0x25b86f(0x1c3)+_0xb07fe0+_0x25b86f(0x1b9),()=>_0x34243f[_0x25b86f(0x213)][_0x25b86f(0x1f5)](_0xb07fe0,_0x4acf03),{'verbose':_0x1887bc[_0x25b86f(0x1ed)]}),console[_0x25b86f(0x20a)](_0x25b86f(0x219)+_0xb07fe0+_0x25b86f(0x1b4)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a16_0x4e69bf(0x1cc);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1b0);async[a16_0x4e69bf(0x21d)](_0x3ae504){const _0x5327ba=a16_0x4e69bf,{options:_0x354566,args:_0x3fa257,tdx:_0x2569da}=_0x3ae504;if(_0x3fa257[_0x5327ba(0x21f)]===0x0)return console[_0x5327ba(0x1d3)](_0x5327ba(0x1cf)),console['error'](_0x5327ba(0x208)),0x1;const _0x5d30d7=_0x3fa257[0x0],_0x304f11=_0x354566,_0x517b75=await resolveWorkspaceIdFromOptions(_0x304f11,_0x2569da);return await withSpinner(_0x5327ba(0x1fe)+_0x5d30d7+_0x5327ba(0x1b9),()=>_0x2569da[_0x5327ba(0x213)][_0x5327ba(0x1c1)](_0x5d30d7,_0x517b75),{'verbose':_0x354566[_0x5327ba(0x1ed)]}),console[_0x5327ba(0x20a)](_0x5327ba(0x219)+_0x5d30d7+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]=a16_0x4e69bf(0x215);['description']=a16_0x4e69bf(0x19b);async[a16_0x4e69bf(0x21d)](_0x2082cd){const _0x38ef63=a16_0x4e69bf,{options:_0x247e68,args:_0x27df29,tdx:_0x1a33a6}=_0x2082cd;if(_0x27df29['length']===0x0)return console[_0x38ef63(0x1d3)](_0x38ef63(0x1cf)),console['error'](_0x38ef63(0x1cb)),0x1;const _0x174be7=_0x27df29[0x0],_0x23b790=_0x247e68,_0x15dcfc=await resolveWorkspaceIdFromOptions(_0x23b790,_0x1a33a6);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x174be7+_0x38ef63(0x1b9),()=>_0x1a33a6[_0x38ef63(0x213)][_0x38ef63(0x218)](_0x174be7,_0x15dcfc),{'verbose':_0x247e68[_0x38ef63(0x1ed)]}),console[_0x38ef63(0x20a)](_0x38ef63(0x219)+_0x174be7+_0x38ef63(0x1d2)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]=a16_0x4e69bf(0x198);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1a7);async[a16_0x4e69bf(0x21d)](_0x5f1b51){const _0x33662c=a16_0x4e69bf,{options:_0x4337a5,args:_0x269bb8,tdx:_0x5259dc}=_0x5f1b51;if(_0x269bb8[_0x33662c(0x21f)]===0x0)return console['error'](_0x33662c(0x1cf)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x4659ff=_0x269bb8[0x0],_0x1de2a9=_0x4337a5,_0x54382b=await resolveWorkspaceIdFromOptions(_0x1de2a9,_0x5259dc),_0xd147b3=await withSpinner(_0x33662c(0x210)+_0x4659ff+_0x33662c(0x1b9),()=>_0x5259dc[_0x33662c(0x213)][_0x33662c(0x204)](_0x4659ff,_0x54382b),{'verbose':_0x4337a5[_0x33662c(0x1ed)]});return await handleSDKOutput([_0xd147b3[_0x33662c(0x217)]],_0x4337a5),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]=a16_0x4e69bf(0x1fb);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1bd);async[a16_0x4e69bf(0x21d)](_0x4a07c1){const _0x26c627=a16_0x4e69bf,{options:_0x538538,args:_0x2b84dd,tdx:_0x401b60}=_0x4a07c1,_0x3f63f1=_0x2b84dd[0x0],_0x3e23e4=resolveLimit(_0x538538[_0x26c627(0x1de)],DEFAULT_LLM_LIMIT),_0x4af18c=_0x538538,_0x1669f7=await resolveWorkspaceIdFromOptions(_0x4af18c,_0x401b60),_0x2a8149=await withSpinner('Fetching\x20templates...',()=>_0x401b60[_0x26c627(0x213)][_0x26c627(0x1a5)]({'workspaceId':_0x1669f7,'limit':_0x3e23e4}),{'verbose':_0x538538[_0x26c627(0x1ed)]});let _0xe7d34d=_0x2a8149[_0x26c627(0x217)];return _0x3f63f1&&(_0xe7d34d=_0x2a8149[_0x26c627(0x217)][_0x26c627(0x1f6)](_0x3710ac=>matchGlobPattern(_0x3710ac[_0x26c627(0x1e1)],_0x3f63f1))),await handleSDKOutput(_0xe7d34d,_0x538538),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a16_0x4e69bf(0x1f8);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1c9);async[a16_0x4e69bf(0x21d)](_0x47516a){const _0xd7b25e=a16_0x4e69bf,{options:_0x274992,args:_0x4eb2ff,tdx:_0x5cd5d2}=_0x47516a;if(_0x4eb2ff[_0xd7b25e(0x21f)]===0x0)return console[_0xd7b25e(0x1d3)](_0xd7b25e(0x20f)),console[_0xd7b25e(0x1d3)](_0xd7b25e(0x1b1)),0x1;const _0x3087d7=_0x4eb2ff[0x0],_0x58dac0=_0x274992,_0x4006ea=await resolveWorkspaceIdFromOptions(_0x58dac0,_0x5cd5d2),_0x14cd26=_0x58dac0[_0xd7b25e(0x18e)];if(_0x14cd26){const _0x254316=await withSpinner(_0xd7b25e(0x1e3)+_0x3087d7+_0xd7b25e(0x1b9),()=>_0x5cd5d2['engage'][_0xd7b25e(0x1a1)](_0x3087d7,_0x4006ea),{'verbose':_0x274992['verbose']});await handleSDKOutput([_0x254316],_0x274992);}else{const _0x222e9c=await withSpinner('Fetching\x20template\x20\x27'+_0x3087d7+'\x27...',()=>_0x5cd5d2[_0xd7b25e(0x213)]['getTemplate'](_0x3087d7,_0x4006ea),{'verbose':_0x274992[_0xd7b25e(0x1ed)]});await handleSDKOutput([_0x222e9c],_0x274992);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]='engage:template:create';[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1a2);async[a16_0x4e69bf(0x21d)](_0x2e193e){const _0x2c41cf=a16_0x4e69bf,{options:_0x4de108,tdx:_0xfd74ba}=_0x2e193e,_0x4fcb7d=_0x4de108,_0x37f6f7=_0x4fcb7d['name'],_0x50fb2e=_0x4fcb7d[_0x2c41cf(0x19e)],_0x482ea5=_0x4fcb7d['html'];if(!_0x37f6f7)return console[_0x2c41cf(0x1d3)](_0x2c41cf(0x1a3)),console[_0x2c41cf(0x1d3)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x50fb2e)return console[_0x2c41cf(0x1d3)](_0x2c41cf(0x1b5)),0x1;if(!_0x482ea5)return console[_0x2c41cf(0x1d3)](_0x2c41cf(0x1c8)),0x1;const _0x167b3a=await resolveWorkspaceIdFromOptions(_0x4fcb7d,_0xfd74ba,!![]),_0x531e34={'name':_0x37f6f7,'subjectTemplate':_0x50fb2e,'htmlTemplate':_0x482ea5,'workspaceId':_0x167b3a,'plaintextTemplate':_0x4fcb7d['plaintext'],'editorType':_0x4fcb7d[_0x2c41cf(0x21b)]},_0x130cc6=await withSpinner(_0x2c41cf(0x1c0)+_0x37f6f7+'\x27...',()=>_0xfd74ba[_0x2c41cf(0x213)][_0x2c41cf(0x21e)](_0x531e34));return await handleSDKOutput([_0x130cc6[_0x2c41cf(0x217)]],_0x4de108),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]=a16_0x4e69bf(0x1e0);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x209);async[a16_0x4e69bf(0x21d)](_0x365f29){const _0x3af954=a16_0x4e69bf,{options:_0x2512fe,args:_0x152453,tdx:_0x198fd0}=_0x365f29;if(_0x152453[_0x3af954(0x21f)]===0x0)return console[_0x3af954(0x1d3)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x3af954(0x1d3)](_0x3af954(0x1bb)),0x1;const _0x4f2ff7=_0x152453[0x0],_0xf0c38d=_0x2512fe,_0x4ff0a5=await resolveWorkspaceIdFromOptions(_0xf0c38d,_0x198fd0),_0x4a773b={'name':_0xf0c38d['name'],'subjectTemplate':_0xf0c38d['subject'],'htmlTemplate':_0xf0c38d[_0x3af954(0x18f)],'plaintextTemplate':_0xf0c38d['plaintext']},_0x264193=Object['fromEntries'](Object[_0x3af954(0x203)](_0x4a773b)[_0x3af954(0x1f6)](([,_0x3337f4])=>_0x3337f4!==undefined));if(Object[_0x3af954(0x1b8)](_0x264193)['length']===0x0)return console[_0x3af954(0x1d3)](_0x3af954(0x1df)),console[_0x3af954(0x1d3)](_0x3af954(0x1ad)),0x1;const _0x107bb1=await withSpinner(_0x3af954(0x1ae)+_0x4f2ff7+_0x3af954(0x1b9),()=>_0x198fd0[_0x3af954(0x213)][_0x3af954(0x212)](_0x4f2ff7,_0x264193,_0x4ff0a5),{'verbose':_0x2512fe['verbose']});return await handleSDKOutput([_0x107bb1[_0x3af954(0x217)]],_0x2512fe),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a16_0x4e69bf(0x1d0);['description']=a16_0x4e69bf(0x1d7);async['execute'](_0x34f614){const _0x36b162=a16_0x4e69bf,{options:_0x5904cb,args:_0x55d54a,tdx:_0x56dbfb}=_0x34f614;if(_0x55d54a[_0x36b162(0x21f)]===0x0)return console[_0x36b162(0x1d3)](_0x36b162(0x20f)),console[_0x36b162(0x1d3)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x168240=_0x55d54a[0x0],_0x2cde3e=_0x5904cb,_0x5b4208=await resolveWorkspaceIdFromOptions(_0x2cde3e,_0x56dbfb);if(!_0x5904cb[_0x36b162(0x1c7)]){const _0xac5db8=await confirm(_0x36b162(0x200)+_0x168240+_0x36b162(0x206));if(!_0xac5db8)return console[_0x36b162(0x20a)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x36b162(0x1eb)+_0x168240+_0x36b162(0x1b9),()=>_0x56dbfb[_0x36b162(0x213)][_0x36b162(0x1dc)](_0x168240,_0x5b4208),{'verbose':_0x5904cb[_0x36b162(0x1ed)]}),console['log'](_0x36b162(0x1b7)+_0x168240+_0x36b162(0x1c5)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{['name']=a16_0x4e69bf(0x20b);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1ba);async[a16_0x4e69bf(0x21d)](_0xf6a370){const _0x4176a4=a16_0x4e69bf,{options:_0x375c5a,args:_0x5ba296,tdx:_0x598cf2}=_0xf6a370,_0xfe2ed=_0x5ba296[0x0],_0x544d16=resolveLimit(_0x375c5a[_0x4176a4(0x1de)],DEFAULT_LLM_LIMIT),_0x2e2d59=await withSpinner(_0x4176a4(0x1b3),()=>_0x598cf2['engage'][_0x4176a4(0x1dd)]({'limit':_0x544d16}),{'verbose':_0x375c5a[_0x4176a4(0x1ed)]});let _0x14f280=_0x2e2d59['data'];return _0xfe2ed&&(_0x14f280=_0x2e2d59[_0x4176a4(0x217)]['filter'](_0x1fc290=>matchGlobPattern(_0x1fc290['name'],_0xfe2ed))),await handleSDKOutput(_0x14f280,_0x375c5a),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]='engage:workspace:show';[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1d4);async[a16_0x4e69bf(0x21d)](_0x2d3d57){const _0x415772=a16_0x4e69bf,{options:_0x4b9959,args:_0x5635cd,tdx:_0x5e10c7}=_0x2d3d57;if(_0x5635cd[_0x415772(0x21f)]===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x415772(0x1d3)](_0x415772(0x1e7)),0x1;const _0x104bda=_0x5635cd[0x0],_0x1abea3=_0x4b9959,_0x3c934a=_0x1abea3[_0x415772(0x18e)];if(_0x3c934a){const _0x689b2c=await withSpinner(_0x415772(0x1b6)+_0x104bda+_0x415772(0x1b9),()=>_0x5e10c7[_0x415772(0x213)][_0x415772(0x18c)](_0x104bda),{'verbose':_0x4b9959[_0x415772(0x1ed)]});await handleSDKOutput([_0x689b2c],_0x4b9959);}else{const _0xea6369=await withSpinner(_0x415772(0x1b6)+_0x104bda+_0x415772(0x1b9),()=>_0x5e10c7['engage']['getWorkspace'](_0x104bda),{'verbose':_0x4b9959[_0x415772(0x1ed)]});await handleSDKOutput([_0xea6369],_0x4b9959);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a16_0x4e69bf(0x194);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x190);async[a16_0x4e69bf(0x21d)](_0x1bbb99){const _0x4064e2=a16_0x4e69bf,{options:_0x1f925e,tdx:_0x42e921}=_0x1bbb99,_0x24cfb7=_0x1f925e,_0x4c7ad2=_0x24cfb7['name'];if(!_0x4c7ad2)return console[_0x4064e2(0x1d3)](_0x4064e2(0x1a3)),console['error'](_0x4064e2(0x1da)),0x1;const _0x2e062a={'name':_0x4c7ad2,'description':_0x24cfb7[_0x4064e2(0x211)]},_0x4b8a2f=await withSpinner(_0x4064e2(0x1ff)+_0x4c7ad2+_0x4064e2(0x1b9),()=>_0x42e921[_0x4064e2(0x213)][_0x4064e2(0x21a)](_0x2e062a));return await handleSDKOutput([_0x4b8a2f['data']],_0x1f925e),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]='engage:workspace:update';[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x1d6);async[a16_0x4e69bf(0x21d)](_0x5d6f1d){const _0x35c68a=a16_0x4e69bf,{options:_0x54c576,args:_0x757dac,tdx:_0x4d5e44}=_0x5d6f1d;if(_0x757dac[_0x35c68a(0x21f)]===0x0)return console[_0x35c68a(0x1d3)](_0x35c68a(0x195)),console['error'](_0x35c68a(0x1a6)),0x1;const _0x2597c1=_0x757dac[0x0],_0x174de0=_0x54c576,_0x19d6e9={'name':_0x174de0[_0x35c68a(0x1e1)],'description':_0x174de0['description']},_0x1c260c=Object[_0x35c68a(0x207)](Object[_0x35c68a(0x203)](_0x19d6e9)[_0x35c68a(0x1f6)](([,_0x490496])=>_0x490496!==undefined));if(Object['keys'](_0x1c260c)[_0x35c68a(0x21f)]===0x0)return console[_0x35c68a(0x1d3)](_0x35c68a(0x1df)),console[_0x35c68a(0x1d3)](_0x35c68a(0x1a8)),0x1;const _0x359546=await withSpinner(_0x35c68a(0x1f3)+_0x2597c1+'\x27...',()=>_0x4d5e44[_0x35c68a(0x213)][_0x35c68a(0x216)](_0x2597c1,_0x1c260c),{'verbose':_0x54c576[_0x35c68a(0x1ed)]});return await handleSDKOutput([_0x359546['data']],_0x54c576),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x4e69bf(0x1e1)]=a16_0x4e69bf(0x202);[a16_0x4e69bf(0x211)]=a16_0x4e69bf(0x205);async['execute'](_0x49df7e){const _0x359a74=a16_0x4e69bf,{options:_0x24b269,args:_0x8a3347,tdx:_0x32161c}=_0x49df7e;if(_0x8a3347[_0x359a74(0x21f)]===0x0)return console[_0x359a74(0x1d3)](_0x359a74(0x195)),console[_0x359a74(0x1d3)](_0x359a74(0x1ab)),0x1;const _0x3fd3c9=_0x8a3347[0x0];if(!_0x24b269[_0x359a74(0x1c7)]){const _0x4e0f6b=await confirm(_0x359a74(0x1d5)+_0x3fd3c9+_0x359a74(0x206));if(!_0x4e0f6b)return console[_0x359a74(0x20a)](_0x359a74(0x19c)),0x0;}return await withSpinner(_0x359a74(0x1bf)+_0x3fd3c9+'\x27...',()=>_0x32161c[_0x359a74(0x213)][_0x359a74(0x1be)](_0x3fd3c9),{'verbose':_0x24b269[_0x359a74(0x1ed)]}),console[_0x359a74(0x20a)](_0x359a74(0x193)+_0x3fd3c9+_0x359a74(0x1c5)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']='engage:workspace:use';['description']=a16_0x4e69bf(0x191);async['execute'](_0x4ea5f1){const _0x14ee41=a16_0x4e69bf,{options:_0x1f4d27,args:_0xbfd04a,tdx:_0x401374}=_0x4ea5f1;if(_0xbfd04a[_0x14ee41(0x21f)]===0x0)return console[_0x14ee41(0x1d3)](_0x14ee41(0x1fa)),console[_0x14ee41(0x1d3)](_0x14ee41(0x197)),0x1;const _0x53c594=_0xbfd04a[0x0];await withSpinner(_0x14ee41(0x1f2)+_0x53c594+_0x14ee41(0x1b9),()=>_0x401374[_0x14ee41(0x213)]['resolveWorkspaceId'](_0x53c594));const _0xaae04e=_0x1f4d27['session']||undefined;return saveSessionContext({'engage_workspace':_0x53c594},_0xaae04e),console['log'](_0x14ee41(0x199)+_0x53c594),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a17_0x30ad65=a17_0x55cc;(function(_0x1fc521,_0x217a9e){const _0x3a1ad5=a17_0x55cc,_0x2f0117=_0x1fc521();while(!![]){try{const _0x5a6ba2=parseInt(_0x3a1ad5(0x17c))/0x1*(parseInt(_0x3a1ad5(0x162))/0x2)+-parseInt(_0x3a1ad5(0x186))/0x3+parseInt(_0x3a1ad5(0x183))/0x4*(parseInt(_0x3a1ad5(0x174))/0x5)+parseInt(_0x3a1ad5(0x18e))/0x6*(parseInt(_0x3a1ad5(0x18b))/0x7)+parseInt(_0x3a1ad5(0x18a))/0x8*(parseInt(_0x3a1ad5(0x176))/0x9)+-parseInt(_0x3a1ad5(0x166))/0xa*(-parseInt(_0x3a1ad5(0x175))/0xb)+-parseInt(_0x3a1ad5(0x19c))/0xc*(parseInt(_0x3a1ad5(0x165))/0xd);if(_0x5a6ba2===_0x217a9e)break;else _0x2f0117['push'](_0x2f0117['shift']());}catch(_0xb6510){_0x2f0117['push'](_0x2f0117['shift']());}}}(a17_0x4686,0x28de1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}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';export class JobListCommand extends BaseCommand{[a17_0x30ad65(0x17e)]=a17_0x30ad65(0x1a6);[a17_0x30ad65(0x1a0)]=a17_0x30ad65(0x19b);async['execute'](_0x4198a0){const _0x49e921=a17_0x30ad65,{options:_0x2d1cf8,tdx:_0x37f228}=_0x4198a0;try{const _0x45fde6=resolveLimit(_0x2d1cf8[_0x49e921(0x196)],DEFAULT_DISPLAY_LIMIT),_0x67e489=_0x2d1cf8[_0x49e921(0x16d)];_0x2d1cf8[_0x49e921(0x1a2)]&&(console[_0x49e921(0x1a8)](_0x49e921(0x1a4)+_0x45fde6+'\x20jobs'),_0x67e489&&console['error'](_0x49e921(0x19a)+_0x67e489));const _0x1f8413=await withSpinner('Listing\x20jobs...',()=>_0x37f228[_0x49e921(0x1a6)][_0x49e921(0x195)]({'from':0x0,'to':_0x45fde6-0x1,'status':_0x67e489}),{'verbose':_0x2d1cf8['verbose']}),_0x317cb1=_0x1f8413[_0x49e921(0x173)];console['error']('✔\x20Found\x20'+_0x317cb1['length']+_0x49e921(0x17f)+(_0x317cb1['length']!==0x1?'s':''));const _0x471ebe=_0x317cb1['map'](_0x889890=>{const _0x34324a=_0x49e921;let _0x38d5af;if(_0x889890[_0x34324a(0x16f)]&&_0x889890[_0x34324a(0x193)]){const _0x4aa8be=new Date(_0x889890['start_at'])[_0x34324a(0x191)](),_0x3c10bf=new Date(_0x889890[_0x34324a(0x193)])[_0x34324a(0x191)]();_0x38d5af=Math[_0x34324a(0x19d)]((_0x3c10bf-_0x4aa8be)/0x3e8);}return{'job_id':_0x889890[_0x34324a(0x190)],'type':_0x889890['type'],'status':_0x889890['status'],'user_name':_0x889890['user_name'],'duration_sec':_0x38d5af,'created_at':_0x889890[_0x34324a(0x17d)],'started_at':_0x889890['start_at'],'end_at':_0x889890[_0x34324a(0x193)]};});return await handleSDKOutput(_0x471ebe,_0x2d1cf8),0x0;}catch(_0x1c7d46){if(_0x1c7d46 instanceof SDKError)return console[_0x49e921(0x1a8)](_0x49e921(0x169)+_0x1c7d46[_0x49e921(0x180)]),_0x1c7d46[_0x49e921(0x188)]&&console[_0x49e921(0x1a8)](_0x49e921(0x1ab)+_0x1c7d46[_0x49e921(0x188)]),0x1;throw _0x1c7d46;}}}export class JobShowCommand extends BaseCommand{[a17_0x30ad65(0x17e)]=a17_0x30ad65(0x164);[a17_0x30ad65(0x1a0)]=a17_0x30ad65(0x160);async['execute'](_0x113e1e){const _0x3af46d=a17_0x30ad65,{options:_0x3687ea,args:_0x5733c3,tdx:_0x47bf51}=_0x113e1e,_0x31af8a=_0x5733c3[0x0];if(!_0x31af8a)return console[_0x3af46d(0x1a8)](_0x3af46d(0x170)),console[_0x3af46d(0x1a8)](_0x3af46d(0x178)),0x1;try{const _0x5a770c=await withSpinner(_0x3af46d(0x1aa),()=>_0x47bf51[_0x3af46d(0x1a6)]['show'](_0x31af8a),{'verbose':_0x3687ea[_0x3af46d(0x1a2)]}),_0x4907b2=_0x5a770c['data'];let _0x371280;if(_0x4907b2[_0x3af46d(0x16f)]&&_0x4907b2[_0x3af46d(0x193)]){const _0x5a76f4=new Date(_0x4907b2[_0x3af46d(0x16f)])[_0x3af46d(0x191)](),_0x15c158=new Date(_0x4907b2[_0x3af46d(0x193)])[_0x3af46d(0x191)]();_0x371280=Math['round']((_0x15c158-_0x5a76f4)/0x3e8);}const _0x24bee3={'job_id':_0x4907b2[_0x3af46d(0x190)],'type':_0x4907b2[_0x3af46d(0x181)],'status':_0x4907b2[_0x3af46d(0x16d)],..._0x4907b2[_0x3af46d(0x18c)]&&{'user_name':_0x4907b2['user_name']},..._0x371280!==undefined&&{'duration_sec':_0x371280},..._0x4907b2[_0x3af46d(0x17d)]&&{'created_at':_0x4907b2[_0x3af46d(0x17d)]},..._0x4907b2[_0x3af46d(0x16f)]&&{'started_at':_0x4907b2[_0x3af46d(0x16f)]},..._0x4907b2[_0x3af46d(0x193)]&&{'end_at':_0x4907b2['end_at']},..._0x4907b2[_0x3af46d(0x1a7)]&&{'database':_0x4907b2[_0x3af46d(0x1a7)]},..._0x4907b2['priority']!==undefined&&{'priority':_0x4907b2['priority']},..._0x4907b2[_0x3af46d(0x15f)]&&{'url':_0x4907b2[_0x3af46d(0x15f)]},..._0x4907b2[_0x3af46d(0x19e)]&&{'query':_0x4907b2[_0x3af46d(0x19e)]},..._0x4907b2[_0x3af46d(0x189)]&&{'debug':_0x4907b2[_0x3af46d(0x189)]}};return await handleSingleObjectOutput(_0x24bee3,_0x3687ea),0x0;}catch(_0x7f90ca){if(_0x7f90ca instanceof SDKError)return console[_0x3af46d(0x1a8)]('Error:\x20'+_0x7f90ca[_0x3af46d(0x180)]),_0x7f90ca['cause']&&console[_0x3af46d(0x1a8)](_0x3af46d(0x1ab)+_0x7f90ca[_0x3af46d(0x188)]),0x1;throw _0x7f90ca;}}}function a17_0x55cc(_0xbdf828,_0x5f2b65){_0xbdf828=_0xbdf828-0x15f;const _0x46869b=a17_0x4686();let _0x55cc70=_0x46869b[_0xbdf828];return _0x55cc70;}export class JobKillCommand extends BaseCommand{['name']='job:kill';[a17_0x30ad65(0x1a0)]=a17_0x30ad65(0x1a1);async[a17_0x30ad65(0x187)](_0x9ffcf2){const _0xa81c0e=a17_0x30ad65,{options:_0x347b41,args:_0x47ed20,tdx:_0x1e6d7c}=_0x9ffcf2,_0x1b1f24=_0x47ed20[0x0];if(!_0x1b1f24)return console[_0xa81c0e(0x1a8)](_0xa81c0e(0x170)),console[_0xa81c0e(0x1a8)](_0xa81c0e(0x167)),0x1;try{if(!_0x347b41['yes']){const _0xbe6371=await confirm(_0xa81c0e(0x1a5)+_0x1b1f24+'?');if(!_0xbe6371)return console[_0xa81c0e(0x1a8)](_0xa81c0e(0x1a3)),0x0;}return await withSpinner(_0xa81c0e(0x1a9),()=>_0x1e6d7c[_0xa81c0e(0x1a6)][_0xa81c0e(0x16c)](_0x1b1f24),{'verbose':_0x347b41[_0xa81c0e(0x1a2)]}),console[_0xa81c0e(0x1a8)](_0xa81c0e(0x185)+_0x1b1f24),console[_0xa81c0e(0x1a8)](_0xa81c0e(0x179)+_0x1b1f24+_0xa81c0e(0x163)),0x0;}catch(_0xf000f3){if(_0xf000f3 instanceof SDKError)return console[_0xa81c0e(0x1a8)]('Error:\x20'+_0xf000f3[_0xa81c0e(0x180)]),_0xf000f3[_0xa81c0e(0x188)]&&console[_0xa81c0e(0x1a8)](_0xa81c0e(0x1ab)+_0xf000f3['cause']),0x1;throw _0xf000f3;}}}function a17_0x4686(){const _0x46f550=['data','205umTspI','908171POSymi','33543PBsewu','result','Usage:\x20job\x20show\x20<job-id>','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','length','115799RdRrOi','created_at','name','\x20job','message','type','Database:\x20','23292wCkqii','Get\x20job\x20results','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','57525vPrlWx','execute','cause','debug','256qLForS','3227lensVs','user_name','substring','1746VPopaD','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','job_id','getTime','✔\x20Retrieved\x20','end_at','trino','list','limit','Getting\x20job\x20results...','file','hive','Status\x20filter:\x20','List\x20jobs','604740CXQYhG','round','query','Submit\x20a\x20job','description','Kill\x20a\x20job','verbose','Cancelled','Limit:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','jobs','database','error','Submitting\x20kill\x20request...','Getting\x20job\x20details...','\x20\x20Cause:\x20','url','Show\x20job\x20details','\x20\x20Job\x20ID:\x20','2btGzRf','\x27\x20to\x20verify\x20the\x20job\x20status','job:show','130wEipPg','10czmErQ','Usage:\x20job\x20kill\x20<job-id>','job:submit','Error:\x20','Submitting\x20job...','Job\x20type:\x20','kill','status','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','start_at','Error:\x20Job\x20ID\x20is\x20required','information_schema','Error:\x20Query\x20is\x20required'];a17_0x4686=function(){return _0x46f550;};return a17_0x4686();}export class JobSubmitCommand extends BaseCommand{['name']=a17_0x30ad65(0x168);['description']=a17_0x30ad65(0x19f);async[a17_0x30ad65(0x187)](_0x599d86){const _0x264bdd=a17_0x30ad65,{options:_0x44d622,args:_0x5f419d,tdx:_0xb1e527}=_0x599d86;try{const _0x1464d4=_0x44d622['jobType']||_0x264bdd(0x194),_0x242085=_0x44d622[_0x264bdd(0x198)],_0x27f9c2=_0x44d622[_0x264bdd(0x1a7)]||_0x264bdd(0x171);if(_0x1464d4!==_0x264bdd(0x194)&&_0x1464d4!==_0x264bdd(0x199))return console['error']('Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'),0x1;let _0x554625;if(_0x242085){if(_0x5f419d[0x0])return console['error']('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x470fd7=readSqlStatementsFromFile(_0x242085);if(_0x470fd7[_0x264bdd(0x17b)]===0x0)return console[_0x264bdd(0x1a8)](_0x264bdd(0x18f)),0x1;if(_0x470fd7['length']>0x1)return console[_0x264bdd(0x1a8)](_0x264bdd(0x16e)),0x1;_0x554625=_0x470fd7[0x0];}else{if(!_0x5f419d[0x0])return console[_0x264bdd(0x1a8)](_0x264bdd(0x172)),console['error'](_0x264bdd(0x17a)),0x1;_0x554625=_0x5f419d[0x0];}_0x44d622[_0x264bdd(0x1a2)]&&(console[_0x264bdd(0x1a8)](_0x264bdd(0x16b)+_0x1464d4),console[_0x264bdd(0x1a8)](_0x264bdd(0x182)+_0x27f9c2),console[_0x264bdd(0x1a8)]('Query:\x20'+_0x554625[_0x264bdd(0x18d)](0x0,0x64)+(_0x554625[_0x264bdd(0x17b)]>0x64?'...':'')));const _0x52e6aa=await withSpinner(_0x264bdd(0x16a),()=>_0xb1e527[_0x264bdd(0x1a6)]['submit'](_0x27f9c2,_0x554625,_0x1464d4),{'verbose':_0x44d622[_0x264bdd(0x1a2)]}),_0x5bd68e=_0x52e6aa[_0x264bdd(0x173)];return console[_0x264bdd(0x1a8)]('✔\x20Job\x20submitted'),console[_0x264bdd(0x1a8)](_0x264bdd(0x161)+_0x5bd68e[_0x264bdd(0x190)]),await handleSDKOutput([_0x5bd68e],_0x44d622),0x0;}catch(_0x6e3567){if(_0x6e3567 instanceof SDKError)return console['error'](_0x264bdd(0x169)+_0x6e3567[_0x264bdd(0x180)]),_0x6e3567[_0x264bdd(0x188)]&&console[_0x264bdd(0x1a8)](_0x264bdd(0x1ab)+_0x6e3567['cause']),0x1;throw _0x6e3567;}}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a17_0x30ad65(0x1a0)]=a17_0x30ad65(0x184);async['execute'](_0x366092){const _0xb09ccd=a17_0x30ad65,{options:_0x467269,args:_0x5bfa82,tdx:_0x90a496}=_0x366092,_0x3c959b=_0x5bfa82[0x0];if(!_0x3c959b)return console['error']('Error:\x20Job\x20ID\x20is\x20required'),console[_0xb09ccd(0x1a8)]('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0x3aaea3=await withSpinner(_0xb09ccd(0x197),()=>_0x90a496['jobs'][_0xb09ccd(0x177)](_0x3c959b),{'verbose':_0x467269[_0xb09ccd(0x1a2)]}),_0x215712=_0x3aaea3[_0xb09ccd(0x173)];return console['error'](_0xb09ccd(0x192)+_0x215712[_0xb09ccd(0x17b)]+'\x20row'+(_0x215712[_0xb09ccd(0x17b)]!==0x1?'s':'')),await handleSDKOutput(_0x215712,_0x467269),0x0;}catch(_0x31a142){if(_0x31a142 instanceof SDKError)return console[_0xb09ccd(0x1a8)](_0xb09ccd(0x169)+_0x31a142['message']),_0x31a142[_0xb09ccd(0x188)]&&console[_0xb09ccd(0x1a8)]('\x20\x20Cause:\x20'+_0x31a142[_0xb09ccd(0x188)]),0x1;throw _0x31a142;}}}
|
|
1
|
+
const a17_0x315370=a17_0x4985;(function(_0x4b9295,_0x25351e){const _0x5cc195=a17_0x4985,_0x25c9ef=_0x4b9295();while(!![]){try{const _0x17433e=-parseInt(_0x5cc195(0x10c))/0x1+parseInt(_0x5cc195(0xf9))/0x2+-parseInt(_0x5cc195(0xd9))/0x3+parseInt(_0x5cc195(0xe1))/0x4+parseInt(_0x5cc195(0xc0))/0x5*(parseInt(_0x5cc195(0xf1))/0x6)+-parseInt(_0x5cc195(0xee))/0x7*(-parseInt(_0x5cc195(0xd5))/0x8)+-parseInt(_0x5cc195(0xe2))/0x9*(parseInt(_0x5cc195(0xf8))/0xa);if(_0x17433e===_0x25351e)break;else _0x25c9ef['push'](_0x25c9ef['shift']());}catch(_0x5d866c){_0x25c9ef['push'](_0x25c9ef['shift']());}}}(a17_0x3918,0x33a36));import{BaseCommand}from'./command.js';function a17_0x4985(_0x2380cd,_0x324db6){_0x2380cd=_0x2380cd-0xbf;const _0x39187d=a17_0x3918();let _0x4985ae=_0x39187d[_0x2380cd];return _0x4985ae;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a17_0x3918(){const _0x4def8f=['\x27\x20to\x20verify\x20the\x20job\x20status','substring','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','name','275064YiZGtJ','✔\x20Retrieved\x20','\x20\x20Cause:\x20','1057530Posyuk','priority','kill','Listing\x20jobs...','execute','Limit:\x20','Submit\x20a\x20job','data','description','✔\x20Found\x20','debug','query','round','url','database','Submitting\x20job...','Usage:\x20job\x20result\x20<job-id>','List\x20jobs','end_at','job:submit','start_at','83672ZJHnJt','message','\x20\x20Job\x20ID:\x20','verbose','1788XTZeTy','cause','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','yes','Show\x20job\x20details','type','Kill\x20a\x20job','Error:\x20','216916sivouC','9OpNWtz','job_id','result','Usage:\x20job\x20show\x20<job-id>','Job\x20type:\x20','error','limit','jobs','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Getting\x20job\x20results...','status','Database:\x20','133GmFSkA','map','Cancelled','12CctNiB','getTime','Error:\x20Query\x20is\x20required','✔\x20Job\x20submitted','trino','list','\x20job','5703550cSgwOS','763126uVzfNa','created_at','submit','Submitting\x20kill\x20request...','Get\x20job\x20results','length','Error:\x20Job\x20ID\x20is\x20required','Query:\x20','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','show','Status\x20filter:\x20','user_name','file','job:show'];a17_0x3918=function(){return _0x4def8f;};return a17_0x3918();}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{[a17_0x315370(0x10b)]=a17_0x315370(0xe9);['description']=a17_0x315370(0xd1);async[a17_0x315370(0xc4)](_0x73f275){const _0x10fa7e=a17_0x315370,{options:_0x4091f6,tdx:_0xd9b0d3}=_0x73f275;try{const _0xf916be=resolveLimit(_0x4091f6[_0x10fa7e(0xe8)],DEFAULT_DISPLAY_LIMIT),_0x723dcf=_0x4091f6[_0x10fa7e(0xec)];_0x4091f6[_0x10fa7e(0xd8)]&&(console[_0x10fa7e(0xe7)](_0x10fa7e(0xc5)+_0xf916be+'\x20jobs'),_0x723dcf&&console[_0x10fa7e(0xe7)](_0x10fa7e(0x104)+_0x723dcf));const _0x4b2ab5=await withSpinner(_0x10fa7e(0xc3),()=>_0xd9b0d3[_0x10fa7e(0xe9)][_0x10fa7e(0xf6)]({'from':0x0,'to':_0xf916be-0x1,'status':_0x723dcf}),{'verbose':_0x4091f6['verbose']}),_0x522137=_0x4b2ab5['data'];console[_0x10fa7e(0xe7)](_0x10fa7e(0xc9)+_0x522137[_0x10fa7e(0xfe)]+_0x10fa7e(0xf7)+(_0x522137['length']!==0x1?'s':''));const _0x3b8d85=_0x522137[_0x10fa7e(0xef)](_0x5d4375=>{const _0x12f0a7=_0x10fa7e;let _0x1be222;if(_0x5d4375[_0x12f0a7(0xd4)]&&_0x5d4375[_0x12f0a7(0xd2)]){const _0x58e42e=new Date(_0x5d4375[_0x12f0a7(0xd4)])['getTime'](),_0x532533=new Date(_0x5d4375[_0x12f0a7(0xd2)])[_0x12f0a7(0xf2)]();_0x1be222=Math[_0x12f0a7(0xcc)]((_0x532533-_0x58e42e)/0x3e8);}return{'job_id':_0x5d4375[_0x12f0a7(0xe3)],'type':_0x5d4375[_0x12f0a7(0xde)],'status':_0x5d4375['status'],'user_name':_0x5d4375[_0x12f0a7(0x105)],'duration_sec':_0x1be222,'created_at':_0x5d4375[_0x12f0a7(0xfa)],'started_at':_0x5d4375[_0x12f0a7(0xd4)],'end_at':_0x5d4375['end_at']};});return await handleSDKOutput(_0x3b8d85,_0x4091f6),0x0;}catch(_0x17d73f){if(_0x17d73f instanceof SDKError)return console[_0x10fa7e(0xe7)](_0x10fa7e(0xe0)+_0x17d73f[_0x10fa7e(0xd6)]),_0x17d73f[_0x10fa7e(0xda)]&&console[_0x10fa7e(0xe7)]('\x20\x20Cause:\x20'+_0x17d73f[_0x10fa7e(0xda)]),0x1;throw _0x17d73f;}}}export class JobShowCommand extends BaseCommand{[a17_0x315370(0x10b)]=a17_0x315370(0x107);[a17_0x315370(0xc8)]=a17_0x315370(0xdd);async['execute'](_0x52bec7){const _0x249254=a17_0x315370,{options:_0x796782,args:_0x53c1a0,tdx:_0x3961e1}=_0x52bec7,_0xee578d=_0x53c1a0[0x0];if(!_0xee578d)return console[_0x249254(0xe7)](_0x249254(0xff)),console['error'](_0x249254(0xe5)),0x1;try{const _0x3562be=await withSpinner('Getting\x20job\x20details...',()=>_0x3961e1['jobs'][_0x249254(0x103)](_0xee578d),{'verbose':_0x796782[_0x249254(0xd8)]}),_0x65c427=_0x3562be[_0x249254(0xc7)];let _0x5dde53;if(_0x65c427[_0x249254(0xd4)]&&_0x65c427[_0x249254(0xd2)]){const _0x56b118=new Date(_0x65c427[_0x249254(0xd4)])['getTime'](),_0x59d5d8=new Date(_0x65c427['end_at'])[_0x249254(0xf2)]();_0x5dde53=Math[_0x249254(0xcc)]((_0x59d5d8-_0x56b118)/0x3e8);}const _0x430597={'job_id':_0x65c427[_0x249254(0xe3)],'type':_0x65c427[_0x249254(0xde)],'status':_0x65c427[_0x249254(0xec)],..._0x65c427[_0x249254(0x105)]&&{'user_name':_0x65c427[_0x249254(0x105)]},..._0x5dde53!==undefined&&{'duration_sec':_0x5dde53},..._0x65c427[_0x249254(0xfa)]&&{'created_at':_0x65c427[_0x249254(0xfa)]},..._0x65c427[_0x249254(0xd4)]&&{'started_at':_0x65c427[_0x249254(0xd4)]},..._0x65c427[_0x249254(0xd2)]&&{'end_at':_0x65c427[_0x249254(0xd2)]},..._0x65c427[_0x249254(0xce)]&&{'database':_0x65c427[_0x249254(0xce)]},..._0x65c427[_0x249254(0xc1)]!==undefined&&{'priority':_0x65c427[_0x249254(0xc1)]},..._0x65c427[_0x249254(0xcd)]&&{'url':_0x65c427[_0x249254(0xcd)]},..._0x65c427[_0x249254(0xcb)]&&{'query':_0x65c427[_0x249254(0xcb)]},..._0x65c427['debug']&&{'debug':_0x65c427[_0x249254(0xca)]}};return await handleSingleObjectOutput(_0x430597,_0x796782),0x0;}catch(_0x23a95a){if(_0x23a95a instanceof SDKError)return console[_0x249254(0xe7)](_0x249254(0xe0)+_0x23a95a['message']),_0x23a95a['cause']&&console['error'](_0x249254(0xbf)+_0x23a95a['cause']),0x1;throw _0x23a95a;}}}export class JobKillCommand extends BaseCommand{['name']='job:kill';[a17_0x315370(0xc8)]=a17_0x315370(0xdf);async[a17_0x315370(0xc4)](_0x137b85){const _0x227f09=a17_0x315370,{options:_0x3f187b,args:_0x3350bb,tdx:_0x2cc1f3}=_0x137b85,_0x4fed85=_0x3350bb[0x0];if(!_0x4fed85)return console[_0x227f09(0xe7)]('Error:\x20Job\x20ID\x20is\x20required'),console['error']('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x3f187b[_0x227f09(0xdc)]){const _0x9296b5=await confirm(_0x227f09(0xdb)+_0x4fed85+'?');if(!_0x9296b5)return console['error'](_0x227f09(0xf0)),0x0;}return await withSpinner(_0x227f09(0xfc),()=>_0x2cc1f3[_0x227f09(0xe9)][_0x227f09(0xc2)](_0x4fed85),{'verbose':_0x3f187b[_0x227f09(0xd8)]}),console[_0x227f09(0xe7)](_0x227f09(0xea)+_0x4fed85),console[_0x227f09(0xe7)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x4fed85+_0x227f09(0x108)),0x0;}catch(_0x2a139e){if(_0x2a139e instanceof SDKError)return console['error'](_0x227f09(0xe0)+_0x2a139e['message']),_0x2a139e[_0x227f09(0xda)]&&console[_0x227f09(0xe7)](_0x227f09(0xbf)+_0x2a139e[_0x227f09(0xda)]),0x1;throw _0x2a139e;}}}export class JobSubmitCommand extends BaseCommand{[a17_0x315370(0x10b)]=a17_0x315370(0xd3);[a17_0x315370(0xc8)]=a17_0x315370(0xc6);async['execute'](_0x59b752){const _0x591514=a17_0x315370,{options:_0x5d4871,args:_0x36ac0a,tdx:_0x165a27}=_0x59b752;try{const _0x58826f=_0x5d4871['jobType']||_0x591514(0xf5),_0x2f5157=_0x5d4871[_0x591514(0x106)],_0x4dacc4=_0x5d4871[_0x591514(0xce)]||'information_schema';if(_0x58826f!==_0x591514(0xf5)&&_0x58826f!=='hive')return console[_0x591514(0xe7)](_0x591514(0x10a)),0x1;let _0x398188;if(_0x2f5157){if(_0x36ac0a[0x0])return console['error']('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x2faaea=readSqlStatementsFromFile(_0x2f5157);if(_0x2faaea[_0x591514(0xfe)]===0x0)return console['error']('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x2faaea['length']>0x1)return console['error'](_0x591514(0x101)),0x1;_0x398188=_0x2faaea[0x0];}else{if(!_0x36ac0a[0x0])return console[_0x591514(0xe7)](_0x591514(0xf3)),console['error'](_0x591514(0x102)),0x1;_0x398188=_0x36ac0a[0x0];}_0x5d4871[_0x591514(0xd8)]&&(console[_0x591514(0xe7)](_0x591514(0xe6)+_0x58826f),console[_0x591514(0xe7)](_0x591514(0xed)+_0x4dacc4),console['error'](_0x591514(0x100)+_0x398188[_0x591514(0x109)](0x0,0x64)+(_0x398188[_0x591514(0xfe)]>0x64?'...':'')));const _0x205686=await withSpinner(_0x591514(0xcf),()=>_0x165a27[_0x591514(0xe9)][_0x591514(0xfb)](_0x4dacc4,_0x398188,_0x58826f),{'verbose':_0x5d4871[_0x591514(0xd8)]}),_0x4ef53c=_0x205686[_0x591514(0xc7)];return console['error'](_0x591514(0xf4)),console[_0x591514(0xe7)](_0x591514(0xd7)+_0x4ef53c[_0x591514(0xe3)]),await handleSDKOutput([_0x4ef53c],_0x5d4871),0x0;}catch(_0x397897){if(_0x397897 instanceof SDKError)return console[_0x591514(0xe7)]('Error:\x20'+_0x397897['message']),_0x397897[_0x591514(0xda)]&&console[_0x591514(0xe7)]('\x20\x20Cause:\x20'+_0x397897[_0x591514(0xda)]),0x1;throw _0x397897;}}}export class JobResultCommand extends BaseCommand{[a17_0x315370(0x10b)]='job:result';[a17_0x315370(0xc8)]=a17_0x315370(0xfd);async['execute'](_0x3ca103){const _0x53aa58=a17_0x315370,{options:_0x3d18f6,args:_0x3e286f,tdx:_0x369468}=_0x3ca103,_0x349bda=_0x3e286f[0x0];if(!_0x349bda)return console[_0x53aa58(0xe7)](_0x53aa58(0xff)),console[_0x53aa58(0xe7)](_0x53aa58(0xd0)),0x1;try{const _0x49361c=await withSpinner(_0x53aa58(0xeb),()=>_0x369468[_0x53aa58(0xe9)][_0x53aa58(0xe4)](_0x349bda),{'verbose':_0x3d18f6['verbose']}),_0x5b7b4b=_0x49361c[_0x53aa58(0xc7)];return console[_0x53aa58(0xe7)](_0x53aa58(0x10d)+_0x5b7b4b[_0x53aa58(0xfe)]+'\x20row'+(_0x5b7b4b[_0x53aa58(0xfe)]!==0x1?'s':'')),await handleSDKOutput(_0x5b7b4b,_0x3d18f6),0x0;}catch(_0x4de871){if(_0x4de871 instanceof SDKError)return console[_0x53aa58(0xe7)](_0x53aa58(0xe0)+_0x4de871['message']),_0x4de871[_0x53aa58(0xda)]&&console[_0x53aa58(0xe7)]('\x20\x20Cause:\x20'+_0x4de871[_0x53aa58(0xda)]),0x1;throw _0x4de871;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x52fc43=a18_0x3558;(function(_0x598a92,_0xdfee9f){const _0x5768f2=a18_0x3558,_0x23c343=_0x598a92();while(!![]){try{const _0x33e701=parseInt(_0x5768f2(0x126))/0x1*(parseInt(_0x5768f2(0x186))/0x2)+-parseInt(_0x5768f2(0x160))/0x3+-parseInt(_0x5768f2(0x1a5))/0x4+parseInt(_0x5768f2(0x1b2))/0x5*(parseInt(_0x5768f2(0x1be))/0x6)+parseInt(_0x5768f2(0x1f0))/0x7*(-parseInt(_0x5768f2(0x1ec))/0x8)+parseInt(_0x5768f2(0x121))/0x9*(parseInt(_0x5768f2(0x19b))/0xa)+parseInt(_0x5768f2(0x130))/0xb*(parseInt(_0x5768f2(0x183))/0xc);if(_0x33e701===_0xdfee9f)break;else _0x23c343['push'](_0x23c343['shift']());}catch(_0x19065e){_0x23c343['push'](_0x23c343['shift']());}}}(a18_0x55e3,0xac2d3));function a18_0x55e3(){const _0x42f86d=['listJourneysFromParentSegment','find','2486kjYTkY','parentSegment','/app/ps/','segment','totalGoalAchieved','stageName','Parent\x20segment:\x20','journeyStages','\x20(ID:\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','sort','activation_','...','log','targetDir','error','content','resolveParentId','Write\x20','population','Resolving\x20journey...','json','blue','session','\x20journey\x20files\x20to\x20','length','Warning:\x20Could\x20not\x20resolve\x20segment\x20','hasChanges','root\x20folder','getActivation','Error:\x20Journey\x20not\x20found:\x20','state','\x20changed\x20files','split','red','journey:view','size','segmentName','absolutePath','entered','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x22\x20not\x20found','connector_config','\x22\x20resumed','conversionRate','journey:pull','\x20\x20Target:\x20','\x20\x20Parent\x20segment:\x20','3742074cElCpJ','🗺️\x20','toLowerCase','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','yellow','diff','getJourney','Fetching\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','✔\x20Pulled\x20','Resolving\x20parent\x20segment...','Usage:\x20journey\x20pause\x20<name-or-path>','set','\x20unchanged\x20files','folderPath','test','(running)','yes','push','Listing\x20journeys...','\x0aPull\x20summary:','name','audienceId','Usage:\x20journey\x20stats\x20<name-or-path>','reentryMode','segmentPushCommand','resume','filter','verbose','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','then','message','pause','Export\x20journey(s)\x20as\x20YAML\x20files','attributes','36948BKAtYm','completed','includeStats','2534986yUFOFx','description','relativePath','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','(archived)','Show\x20journey\x20statistics','has','Listing\x20folders...','Warning:\x20Stage\x20\x22','type','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','stages','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20journey','setPhase','journey:resume','stage','buildIdToEmailMap','format','isNew','90LMzCMX','execute','stringify','green','versionNumber','\x20versions)','✔\x20Found\x20','/j/da/je','draft','filePath','2520176AEJdPS','Pattern:\x20','Options:','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','kind','helpText','\x20\x20Statistics\x20not\x20available','cwd','\x20files?','Usage:\x20journey\x20resume\x20<name-or-path>','\x27\x20not\x20found\x20in\x20','Fetching\x20connections\x20for\x20name\x20resolution...','getSegment','12895CAWmjP','Error:\x20','Resuming\x20journey...','\x20\x20Folder\x20path:\x20','folderId','(paused)','Aborted.','\x0aChanges\x20to\x20\x27','Cancelled','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','resolveJourneyId','462epTxZP','entries','goal','(completed)','segments','/e/','\x20\x20-\x20','Target\x20file:\x20','✔\x20Journey\x20\x22','values','journey','journeys','get','✔\x20Context\x20set:\x20','localeCompare','Fetching\x20parent\x20segment...','\x20=\x20','base','List\x20journeys\x20in\x20current\x20context','join','journeyName','getStatistics','errorCode','\x20(rule\x20match)','journeyId','No\x20statistics\x20available\x20for\x20journey:\x20','relative','Input:\x20','rule','\x20->\x20','listJourneysWithFolders','parentName','Show\x20journey\x20details','Getting\x20journey\x20details...','parent_segment','goalRate','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','exited','repeat','map','Target\x20directory:\x20','buildIdToNameMap','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x22\x20paused','utf-8','resourceName','8ZgAFkV','.yml','all','data','2601634qUcEDO','Journey\x20name:\x20','cyan','Resume\x20a\x20paused\x20journey','file','add','args','Pause\x20a\x20running\x20journey','journey:stats','INVALID_ARGUMENT','paused','792369bKnuRF','dryRun','connection','site','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','1tJytVI','journeyBundleName','listFolders','options','dim','user','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','folders'];a18_0x55e3=function(){return _0x42f86d;};return a18_0x55e3();}import a18_0x4d810b from'chalk';import a18_0x513e0b from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function formatJourneyState(_0x5a3a70){const _0x552a67=a18_0x3558;switch(_0x5a3a70){case'launched':return a18_0x4d810b[_0x552a67(0x19e)](_0x552a67(0x170));case _0x552a67(0x1a3):return a18_0x4d810b['dim']('(draft)');case _0x552a67(0x120):return a18_0x4d810b[_0x552a67(0x164)](_0x552a67(0x1b7));case _0x552a67(0x184):return a18_0x4d810b[_0x552a67(0x146)](_0x552a67(0x1c1));case'archived':return a18_0x4d810b['dim'](_0x552a67(0x18a));default:return'('+_0x5a3a70+')';}}function formatJourneyItem(_0x203ae9,_0xdc0e29='',_0x188ccc){const _0x2000f4=a18_0x3558,_0x24992b=formatJourneyState(_0x203ae9[_0x2000f4(0x14f)]),_0x4a742a=_0x188ccc?hyperlink(_0x203ae9[_0x2000f4(0x127)],_0x188ccc):_0x203ae9[_0x2000f4(0x127)];return _0xdc0e29+_0x2000f4(0x161)+_0x4a742a+'\x20'+_0x24992b;}function escapeRegex(_0x39a231){return _0x39a231['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x306bb8){const _0x6bfc20=a18_0x3558,_0x31d380=_0x306bb8[_0x6bfc20(0x151)]('*')['map'](escapeRegex);return new RegExp(_0x31d380[_0x6bfc20(0x1d1)]('.*'),'i');}function buildRuleToNameMapping(_0x5d3d43){const _0xfa3624=a18_0x3558,_0x3ba33a=new Map();if(_0x5d3d43[_0xfa3624(0x1c2)])for(const [_0xe31753,_0x49787f]of Object[_0xfa3624(0x1bf)](_0x5d3d43[_0xfa3624(0x1c2)])){if(_0x49787f[_0xfa3624(0x1da)]){const _0x3c1714=serializeRule(_0x49787f[_0xfa3624(0x1da)]),_0x3d0970=_0x3ba33a['get'](_0x3c1714);_0x3d0970?_0x3d0970[_0xfa3624(0x172)](_0xe31753):_0x3ba33a['set'](_0x3c1714,[_0xe31753]);}}return _0x3ba33a;}async function resolveJourneyTarget(_0x1d8d7c,_0x1b9a21,_0x2012ce){const _0x31ac4e=a18_0x3558;if(isYamlFilePath(_0x1d8d7c))try{const _0x296cc7=await resolveYamlFilePath(_0x1d8d7c);return _0x2012ce&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x1d8d7c),console[_0x31ac4e(0x13f)](_0x31ac4e(0x15f)+_0x296cc7[_0x31ac4e(0x131)]),console[_0x31ac4e(0x13f)]('\x20\x20Name:\x20'+_0x296cc7[_0x31ac4e(0x155)]),console['error'](_0x31ac4e(0x1b5)+(_0x296cc7[_0x31ac4e(0x16e)]||'(root)'))),{'journeyName':_0x296cc7[_0x31ac4e(0x155)],'parentSegment':_0x296cc7[_0x31ac4e(0x131)],'resolved':_0x296cc7};}catch(_0x4385a5){throw new SDKError(ErrorCode[_0x31ac4e(0x11f)],_0x31ac4e(0x125)+_0x4385a5[_0x31ac4e(0x17f)]);}if(!_0x1b9a21)throw new SDKError(ErrorCode[_0x31ac4e(0x11f)],_0x31ac4e(0x1e8));return{'journeyName':_0x1d8d7c,'parentSegment':_0x1b9a21};}export class JourneyListCommand extends BaseCommand{[a18_0x52fc43(0x175)]='journey:list';['description']=a18_0x52fc43(0x1d0);async['execute'](_0x2d9d2c){const _0x48c2a0=a18_0x52fc43,{options:_0x13fae7,args:_0x11c498,tdx:_0x130c10}=_0x2d9d2c,_0x15f9a7=_0x11c498[0x0],_0x38e0db=_0x13fae7[_0x48c2a0(0x131)];if(!_0x38e0db)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x48c2a0(0x13f)](_0x48c2a0(0x193)),0x1;const _0x2e80b9=await withSpinner(_0x48c2a0(0x16a),()=>_0x130c10[_0x48c2a0(0x133)]['resolveParentId'](_0x38e0db),{'verbose':_0x13fae7[_0x48c2a0(0x17c)]}),_0x4925a7=_0x2e80b9['data'];_0x13fae7['verbose']&&(console[_0x48c2a0(0x13f)](_0x48c2a0(0x136)+_0x38e0db+_0x48c2a0(0x138)+_0x4925a7+')'),_0x15f9a7&&console['error'](_0x48c2a0(0x1a6)+_0x15f9a7));const _0xdfb3d4=await withSpinner(_0x48c2a0(0x1cd),()=>_0x130c10['segment']['getParentFull'](_0x4925a7),{'verbose':_0x13fae7[_0x48c2a0(0x17c)]}),_0x160742=_0xdfb3d4['data'],_0x47c991=_0x160742['rootFolderId'],_0x59db27=await withSpinner(_0x48c2a0(0x173),()=>_0x130c10[_0x48c2a0(0x1c8)][_0x48c2a0(0x1dc)](_0x4925a7,_0x47c991),{'verbose':_0x13fae7[_0x48c2a0(0x17c)]});let _0x4656da=_0x59db27[_0x48c2a0(0x1ef)][_0x48c2a0(0x1c9)];const _0x371122=_0x59db27[_0x48c2a0(0x1ef)][_0x48c2a0(0x12d)],_0x40572f=new Map();for(const _0x118461 of _0x371122){_0x40572f[_0x48c2a0(0x16c)](_0x118461['id'],_0x118461[_0x48c2a0(0x175)]);}if(_0x15f9a7){const _0x9ba087=globToRegex(_0x15f9a7);_0x4656da=_0x4656da[_0x48c2a0(0x17b)](_0x5950f4=>_0x9ba087[_0x48c2a0(0x16f)](_0x5950f4[_0x48c2a0(0x127)]));}console[_0x48c2a0(0x13f)](_0x48c2a0(0x1a1)+_0x4656da['length']+_0x48c2a0(0x194)+(_0x4656da['length']!==0x1?'s':''));const _0x25b051=_0x2baf08=>{const _0x5aef2c=_0x48c2a0;return getConsoleNextUrl(_0x13fae7['site'],_0x5aef2c(0x132)+_0x4925a7+_0x5aef2c(0x1c3)+_0x2baf08+'/j/da');};if(_0x13fae7[_0x48c2a0(0x199)]==='table')await handleSDKOutput(_0x4656da,_0x13fae7);else{if(_0x13fae7[_0x48c2a0(0x199)]===_0x48c2a0(0x145)){const _0x30ced0=_0x4656da['map'](_0x203450=>({..._0x203450,'url':_0x25b051(_0x203450['id'])}));await handleSDKOutput(_0x30ced0,_0x13fae7);}else{console[_0x48c2a0(0x13d)]('['+_0x38e0db+']');const _0x3d67ef=new Map(),_0x4f7a1a=[];for(const _0x308dcf of _0x4656da){if(!_0x308dcf[_0x48c2a0(0x1b6)]||_0x308dcf[_0x48c2a0(0x1b6)]===_0x47c991)_0x4f7a1a['push'](_0x308dcf);else{const _0x366f1f=_0x3d67ef[_0x48c2a0(0x1ca)](_0x308dcf[_0x48c2a0(0x1b6)])||[];_0x366f1f[_0x48c2a0(0x172)](_0x308dcf),_0x3d67ef[_0x48c2a0(0x16c)](_0x308dcf[_0x48c2a0(0x1b6)],_0x366f1f);}}const _0x5d684f=(_0x292a27,_0x2f3740)=>_0x292a27[_0x48c2a0(0x127)]['localeCompare'](_0x2f3740[_0x48c2a0(0x127)],undefined,{'sensitivity':_0x48c2a0(0x1cf)});_0x4f7a1a[_0x48c2a0(0x13a)](_0x5d684f);for(const _0x197d2d of _0x4f7a1a){console['log'](formatJourneyItem(_0x197d2d,'',_0x25b051(_0x197d2d['id'])));}const _0x1aea84=[..._0x3d67ef[_0x48c2a0(0x1bf)]()][_0x48c2a0(0x13a)]((_0x2d76a4,_0x16f11a)=>{const _0x34e62c=_0x48c2a0,_0x444cf9=_0x40572f[_0x34e62c(0x1ca)](_0x2d76a4[0x0])||_0x2d76a4[0x0],_0x247a46=_0x40572f['get'](_0x16f11a[0x0])||_0x16f11a[0x0];return _0x444cf9[_0x34e62c(0x1cc)](_0x247a46,undefined,{'sensitivity':'base'});});for(const [_0x167783,_0x5a4e35]of _0x1aea84){const _0xb8b3c2=_0x40572f[_0x48c2a0(0x1ca)](_0x167783)||_0x167783;console[_0x48c2a0(0x13d)]('📁\x20'+_0xb8b3c2),_0x5a4e35[_0x48c2a0(0x13a)](_0x5d684f);for(const _0x84a961 of _0x5a4e35){console[_0x48c2a0(0x13d)](formatJourneyItem(_0x84a961,'\x20\x20',_0x25b051(_0x84a961['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a18_0x52fc43(0x175)]=a18_0x52fc43(0x153);[a18_0x52fc43(0x187)]=a18_0x52fc43(0x1de);async[a18_0x52fc43(0x19c)](_0x909ae){const _0x12ab82=a18_0x52fc43,{options:_0x1d0e1f,args:_0x466fc3,tdx:_0x4e7993}=_0x909ae,_0x1c2f36=_0x466fc3[0x0];if(!_0x1c2f36)return console[_0x12ab82(0x13f)](_0x12ab82(0x163)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x12ab82(0x13f)](_0x12ab82(0x1a7)),console[_0x12ab82(0x13f)](_0x12ab82(0x1bc)),0x1;_0x1d0e1f['verbose']&&console['error'](_0x12ab82(0x1d9)+_0x1c2f36);const _0x37c2f2=await resolveJourneyTarget(_0x1c2f36,_0x1d0e1f[_0x12ab82(0x131)],_0x1d0e1f[_0x12ab82(0x17c)]),_0x3e0e69=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x4e7993[_0x12ab82(0x133)][_0x12ab82(0x141)](_0x37c2f2[_0x12ab82(0x131)]),{'verbose':_0x1d0e1f[_0x12ab82(0x17c)]}),_0x5ca62a=_0x3e0e69[_0x12ab82(0x1ef)],_0x468a9c=await withSpinner(_0x12ab82(0x144),()=>_0x4e7993[_0x12ab82(0x1c8)]['resolveJourneyId'](_0x5ca62a,_0x37c2f2[_0x12ab82(0x1d2)]),{'verbose':_0x1d0e1f[_0x12ab82(0x17c)]}),_0x539e3e=_0x468a9c[_0x12ab82(0x1ef)];if(_0x1d0e1f['web']){const _0x3e7a56=getConsoleNextUrl(_0x1d0e1f[_0x12ab82(0x124)],_0x12ab82(0x132)+_0x5ca62a+_0x12ab82(0x1c3)+_0x539e3e+'/j/da/je');return console[_0x12ab82(0x13f)](a18_0x4d810b[_0x12ab82(0x19e)]('✔')+'\x20Opening\x20'+a18_0x4d810b[_0x12ab82(0x118)](_0x3e7a56)),openBrowser(_0x3e7a56),0x0;}const _0x4b02bb=await withSpinner(_0x12ab82(0x1df),()=>_0x4e7993[_0x12ab82(0x1c8)][_0x12ab82(0x166)](_0x539e3e),{'verbose':_0x1d0e1f[_0x12ab82(0x17c)]}),_0x3c454d=_0x4b02bb[_0x12ab82(0x1ef)],_0x566a86=_0x1d0e1f[_0x12ab82(0x185)];let _0x19e767;if(_0x566a86)try{const _0x4752d9=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x4e7993[_0x12ab82(0x1c8)]['getStatistics'](_0x539e3e),{'verbose':_0x1d0e1f[_0x12ab82(0x17c)]});_0x19e767=_0x4752d9['data'];}catch{_0x1d0e1f['verbose']&&console[_0x12ab82(0x13f)](_0x12ab82(0x1ab));}const _0x201027=getConsoleNextUrl(_0x1d0e1f[_0x12ab82(0x124)],_0x12ab82(0x132)+_0x5ca62a+_0x12ab82(0x1c3)+_0x539e3e+_0x12ab82(0x1a2)),_0x43fb79={'id':_0x3c454d['id'],'name':_0x3c454d['attributes']['name'],'description':_0x3c454d['attributes'][_0x12ab82(0x187)],'state':_0x3c454d[_0x12ab82(0x182)][_0x12ab82(0x14f)],'paused':_0x3c454d[_0x12ab82(0x182)][_0x12ab82(0x120)],'reentry_mode':_0x3c454d[_0x12ab82(0x182)][_0x12ab82(0x178)],'stages':_0x3c454d[_0x12ab82(0x182)][_0x12ab82(0x137)]?.[_0x12ab82(0x149)]||0x0,..._0x3c454d['attributes'][_0x12ab82(0x1c0)]&&{'goal':_0x3c454d[_0x12ab82(0x182)]['goal'][_0x12ab82(0x175)]},..._0x19e767&&{'statistics':{'total_entered':_0x19e767['totalEntered'],'goal_achieved':_0x19e767[_0x12ab82(0x134)],'goal_rate':_0x19e767[_0x12ab82(0x1e1)],'stages':_0x19e767[_0x12ab82(0x191)]}},'url':_0x201027};return await handleSingleObjectOutput(_0x43fb79,_0x1d0e1f),0x0;}}function a18_0x3558(_0x149b1c,_0x46f3d9){_0x149b1c=_0x149b1c-0x117;const _0x55e3dd=a18_0x55e3();let _0x3558b8=_0x55e3dd[_0x149b1c];return _0x3558b8;}export class JourneyStatsCommand extends BaseCommand{['name']=a18_0x52fc43(0x11e);[a18_0x52fc43(0x187)]=a18_0x52fc43(0x18b);async[a18_0x52fc43(0x19c)](_0x2e1467){const _0x11e700=a18_0x52fc43,{options:_0x2ea142,args:_0x1ce7d8,tdx:_0x52e335}=_0x2e1467,_0x14a9b0=_0x1ce7d8[0x0];if(!_0x14a9b0)return console[_0x11e700(0x13f)](_0x11e700(0x163)),console[_0x11e700(0x13f)](_0x11e700(0x177)),0x1;_0x2ea142['verbose']&&console[_0x11e700(0x13f)](_0x11e700(0x1d9)+_0x14a9b0);const _0x456a5d=await resolveJourneyTarget(_0x14a9b0,_0x2ea142[_0x11e700(0x131)],_0x2ea142[_0x11e700(0x17c)]),_0x2c27d1=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x52e335[_0x11e700(0x133)][_0x11e700(0x141)](_0x456a5d[_0x11e700(0x131)]),{'verbose':_0x2ea142[_0x11e700(0x17c)]}),_0x362fef=_0x2c27d1[_0x11e700(0x1ef)],_0x2c65a7=await withSpinner(_0x11e700(0x144),()=>_0x52e335[_0x11e700(0x1c8)]['resolveJourneyId'](_0x362fef,_0x456a5d['journeyName']),{'verbose':_0x2ea142['verbose']}),_0x1eaa81=_0x2c65a7[_0x11e700(0x1ef)],_0x2a4e1c=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x52e335[_0x11e700(0x1c8)][_0x11e700(0x1d3)](_0x1eaa81),{'verbose':_0x2ea142[_0x11e700(0x17c)]}),_0x59598d=_0x2a4e1c[_0x11e700(0x1ef)];if(!_0x59598d||_0x59598d[_0x11e700(0x1d6)]===null)return console[_0x11e700(0x13f)](_0x11e700(0x1d7)+_0x456a5d['journeyName']),console[_0x11e700(0x13f)](_0x11e700(0x158)),0x0;const _0x2aba85={'journey_id':_0x59598d[_0x11e700(0x1d6)],'total_entered':_0x59598d['totalEntered'],'goal_achieved':_0x59598d[_0x11e700(0x134)],'goal_rate':_0x59598d[_0x11e700(0x1e1)],'stages':_0x59598d['stages']?.[_0x11e700(0x1e5)](_0x30eaae=>({'name':_0x30eaae[_0x11e700(0x135)],'population':_0x30eaae[_0x11e700(0x143)],'entered':_0x30eaae[_0x11e700(0x157)],'exited':_0x30eaae[_0x11e700(0x1e3)],'conversion_rate':_0x30eaae['conversionRate']}))},_0x4a4961=_0x2ea142[_0x11e700(0x197)];if(_0x4a4961&&_0x59598d[_0x11e700(0x191)]){const _0x2ba178=_0x59598d[_0x11e700(0x191)][_0x11e700(0x12f)](_0x489089=>_0x489089[_0x11e700(0x135)][_0x11e700(0x162)]()===_0x4a4961[_0x11e700(0x162)]());if(_0x2ba178)return await handleSingleObjectOutput({'stage_name':_0x2ba178[_0x11e700(0x135)],'population':_0x2ba178['population'],'entered':_0x2ba178[_0x11e700(0x157)],'exited':_0x2ba178[_0x11e700(0x1e3)],'conversion_rate':_0x2ba178[_0x11e700(0x15c)]},_0x2ea142),0x0;console[_0x11e700(0x13f)](_0x11e700(0x18e)+_0x4a4961+_0x11e700(0x159));}return await handleSingleObjectOutput(_0x2aba85,_0x2ea142),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a18_0x52fc43(0x175)]='journey:pause';[a18_0x52fc43(0x187)]=a18_0x52fc43(0x11d);async[a18_0x52fc43(0x19c)](_0x520e2d){const _0x33251b=a18_0x52fc43,{options:_0x7d549c,args:_0x411499,tdx:_0x79e1da}=_0x520e2d,_0x2924d9=_0x411499[0x0];if(!_0x2924d9)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x33251b(0x16b)),0x1;_0x7d549c[_0x33251b(0x17c)]&&console[_0x33251b(0x13f)](_0x33251b(0x1d9)+_0x2924d9);const _0x3559ef=await resolveJourneyTarget(_0x2924d9,_0x7d549c[_0x33251b(0x131)],_0x7d549c['verbose']),_0x46a44a=await withSpinner(_0x33251b(0x16a),()=>_0x79e1da[_0x33251b(0x133)][_0x33251b(0x141)](_0x3559ef[_0x33251b(0x131)]),{'verbose':_0x7d549c[_0x33251b(0x17c)]}),_0x3a4728=_0x46a44a[_0x33251b(0x1ef)],_0x6cd80c=await withSpinner(_0x33251b(0x144),()=>_0x79e1da[_0x33251b(0x1c8)]['resolveJourneyId'](_0x3a4728,_0x3559ef[_0x33251b(0x1d2)]),{'verbose':_0x7d549c['verbose']}),_0x15d61f=_0x6cd80c['data'];if(!_0x7d549c[_0x33251b(0x171)]){const _0x9e6523=await confirm(_0x33251b(0x168)+_0x3559ef[_0x33251b(0x1d2)]+'\x22?');if(!_0x9e6523)return console['error'](_0x33251b(0x1ba)),0x0;}const _0x261866=await withSpinner('Pausing\x20journey...',()=>_0x79e1da['journey'][_0x33251b(0x180)](_0x15d61f),{'verbose':_0x7d549c['verbose']}),_0x111ac2=_0x261866[_0x33251b(0x1ef)];return console[_0x33251b(0x13f)](_0x33251b(0x1c6)+_0x111ac2[_0x33251b(0x182)][_0x33251b(0x175)]+_0x33251b(0x1e9)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a18_0x52fc43(0x196);['description']=a18_0x52fc43(0x119);async['execute'](_0x52fa3b){const _0xcd2127=a18_0x52fc43,{options:_0x1f1ebb,args:_0x51def2,tdx:_0x276b8b}=_0x52fa3b,_0x3c9441=_0x51def2[0x0];if(!_0x3c9441)return console['error'](_0xcd2127(0x163)),console['error'](_0xcd2127(0x1ae)),0x1;_0x1f1ebb[_0xcd2127(0x17c)]&&console[_0xcd2127(0x13f)]('Input:\x20'+_0x3c9441);const _0xafe756=await resolveJourneyTarget(_0x3c9441,_0x1f1ebb['parentSegment'],_0x1f1ebb[_0xcd2127(0x17c)]),_0x2b818e=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x276b8b[_0xcd2127(0x133)]['resolveParentId'](_0xafe756[_0xcd2127(0x131)]),{'verbose':_0x1f1ebb[_0xcd2127(0x17c)]}),_0x35ff56=_0x2b818e['data'],_0x1b90e2=await withSpinner(_0xcd2127(0x144),()=>_0x276b8b[_0xcd2127(0x1c8)][_0xcd2127(0x1bd)](_0x35ff56,_0xafe756['journeyName']),{'verbose':_0x1f1ebb[_0xcd2127(0x17c)]}),_0x300f2e=_0x1b90e2[_0xcd2127(0x1ef)];if(!_0x1f1ebb[_0xcd2127(0x171)]){const _0x3d5bce=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0xafe756[_0xcd2127(0x1d2)]+'\x22?');if(!_0x3d5bce)return console['error'](_0xcd2127(0x1ba)),0x0;}const _0x51b42f=await withSpinner(_0xcd2127(0x1b4),()=>_0x276b8b[_0xcd2127(0x1c8)][_0xcd2127(0x17a)](_0x300f2e),{'verbose':_0x1f1ebb[_0xcd2127(0x17c)]}),_0x2f7009=_0x51b42f[_0xcd2127(0x1ef)];return console[_0xcd2127(0x13f)](_0xcd2127(0x1c6)+_0x2f7009['attributes'][_0xcd2127(0x175)]+_0xcd2127(0x15b)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a18_0x52fc43(0x175)]=a18_0x52fc43(0x15d);[a18_0x52fc43(0x187)]=a18_0x52fc43(0x181);async[a18_0x52fc43(0x19c)](_0x4db9f7){const _0x57f223=a18_0x52fc43,{options:_0x5cfbea,args:_0x3a3659,tdx:_0x58c854}=_0x4db9f7,_0x3882f4=_0x5cfbea,_0xec9d16=_0x3a3659[0x0],_0x5bb767=_0xec9d16&&isYamlFilePath(_0xec9d16),_0x24c224=await resolveTarget({'arg':_0x5bb767?_0xec9d16:undefined,'contextParent':_0x5cfbea[_0x57f223(0x131)],'cwd':process[_0x57f223(0x1ac)]()});if(!isSuccessfulResolution(_0x24c224))return _0x24c224[_0x57f223(0x1d4)]==='no_parent'?(console[_0x57f223(0x13f)](a18_0x4d810b['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x57f223(0x13f)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x57f223(0x13f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x57f223(0x13f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x57f223(0x13f)](_0x57f223(0x1a8))):(console['error'](a18_0x4d810b[_0x57f223(0x152)](_0x57f223(0x1b3)+_0x24c224[_0x57f223(0x17f)]+'\x0a')),_0x24c224[_0x57f223(0x1aa)]&&console[_0x57f223(0x13f)](a18_0x4d810b[_0x57f223(0x118)](_0x24c224[_0x57f223(0x1aa)]))),0x1;let _0x594f5b=_0x5bb767?undefined:_0xec9d16,_0x455a43,_0xeeec2a;_0x24c224[_0x57f223(0x18f)]===_0x57f223(0x11a)&&(_0x594f5b=_0x24c224[_0x57f223(0x1eb)],_0x455a43=_0x24c224[_0x57f223(0x1a4)],_0xeeec2a=_0x24c224[_0x57f223(0x16e)]);const _0xb6a685=_0x24c224[_0x57f223(0x1dd)],_0x46276a=_0x24c224[_0x57f223(0x13e)];_0x3882f4[_0x57f223(0x17c)]&&(console[_0x57f223(0x13f)](_0x57f223(0x136)+_0xb6a685),console['error'](_0x57f223(0x1e6)+_0x46276a),_0x594f5b&&console[_0x57f223(0x13f)](_0x57f223(0x117)+_0x594f5b),_0x455a43&&console['error'](_0x57f223(0x1c5)+_0x455a43),_0xeeec2a&&console[_0x57f223(0x13f)]('Folder\x20path:\x20'+_0xeeec2a));const _0x70fc8f=await withSpinner(_0x57f223(0x16a),()=>_0x58c854['segment']['resolveParentId'](_0xb6a685),{'verbose':_0x5cfbea[_0x57f223(0x17c)]}),_0x277937=_0x70fc8f[_0x57f223(0x1ef)],[_0x4ac24b,_0x31a98d]=await Promise[_0x57f223(0x1ee)]([withSpinner(_0x57f223(0x173),()=>_0x58c854[_0x57f223(0x1c8)][_0x57f223(0x12e)](_0x277937,undefined,{'includeAllVersions':!![]}),{'verbose':_0x5cfbea[_0x57f223(0x17c)]}),withSpinner(_0x57f223(0x18d),()=>_0x58c854[_0x57f223(0x133)][_0x57f223(0x128)](_0x277937),{'verbose':_0x5cfbea[_0x57f223(0x17c)]})]);let _0x42003d=_0x4ac24b[_0x57f223(0x1ef)];const _0x203ac3=_0x31a98d[_0x57f223(0x1ef)],_0x2df10b=buildFolderIdToPathMap(_0x203ac3);if(_0x594f5b){const _0x3aa010=_0x42003d['filter'](_0x1e7449=>_0x1e7449[_0x57f223(0x127)][_0x57f223(0x162)]()===_0x594f5b['toLowerCase']());if(_0x3aa010[_0x57f223(0x149)]===0x0)return console['error'](_0x57f223(0x14e)+_0x594f5b),console[_0x57f223(0x13f)](_0x57f223(0x12c)),0x1;_0x42003d=_0x3aa010;}if(_0xeeec2a!==undefined){const _0x341104=_0x42003d['filter'](_0xa44271=>{const _0x158572=_0x57f223,_0x3af167=_0xa44271[_0x158572(0x1b6)]?_0x2df10b[_0x158572(0x1ca)](_0xa44271[_0x158572(0x1b6)])||'':'';return _0x3af167===_0xeeec2a;});if(_0x341104[_0x57f223(0x149)]===0x0&&_0x42003d[_0x57f223(0x149)]>0x0){console[_0x57f223(0x13f)]('Error:\x20Journey\x20\x27'+_0x594f5b+_0x57f223(0x1af)+(_0xeeec2a||_0x57f223(0x14c))),console[_0x57f223(0x13f)](_0x57f223(0x139));for(const _0x152c97 of _0x42003d){const _0x1faa97=_0x152c97['folderId']?_0x2df10b['get'](_0x152c97[_0x57f223(0x1b6)])||'':'';console['error'](_0x57f223(0x1c4)+(_0x1faa97||'(root)')+'/'+_0x152c97[_0x57f223(0x127)]);}return 0x1;}_0x42003d=_0x341104;}if(_0x42003d[_0x57f223(0x149)]===0x0)return console[_0x57f223(0x13f)]('No\x20journeys\x20found'),0x0;const _0x6528e6=new Map();for(const _0x45e858 of _0x42003d){const _0x460eda=_0x45e858['journeyBundleId'];!_0x6528e6['has'](_0x460eda)&&_0x6528e6[_0x57f223(0x16c)](_0x460eda,[]),_0x6528e6[_0x57f223(0x1ca)](_0x460eda)[_0x57f223(0x172)](_0x45e858);}for(const _0x10aa6b of _0x6528e6[_0x57f223(0x1c7)]()){_0x10aa6b[_0x57f223(0x13a)]((_0x4296ca,_0x5029ef)=>(_0x4296ca[_0x57f223(0x19f)]||0x0)-(_0x5029ef[_0x57f223(0x19f)]||0x0));}const _0x4f5ad6=[],[_0x49cc87,_0xe00dfe]=await Promise['all']([withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x58c854[_0x57f223(0x12b)][_0x57f223(0x198)](),{'verbose':_0x5cfbea[_0x57f223(0x17c)]})[_0x57f223(0x17e)](_0x141e7a=>_0x141e7a[_0x57f223(0x1ef)]),withSpinner(_0x57f223(0x1b0),()=>_0x58c854[_0x57f223(0x123)][_0x57f223(0x1e7)](),{'verbose':_0x5cfbea[_0x57f223(0x17c)]})[_0x57f223(0x17e)](_0x39f07a=>_0x39f07a[_0x57f223(0x1ef)])]);for(const _0x5d788f of _0x6528e6[_0x57f223(0x1c7)]()){const _0x27883a=_0x5d788f[0x0][_0x57f223(0x127)],_0x1dc5fb=_0x5d788f[0x0][_0x57f223(0x1b6)],_0xbbdcd6=_0x1dc5fb?_0x2df10b[_0x57f223(0x1ca)](_0x1dc5fb)||'':'',_0x54826b=_0xbbdcd6?a18_0x513e0b[_0x57f223(0x1d1)](_0x46276a,_0xbbdcd6):_0x46276a,_0x5921c3=_0x455a43||a18_0x513e0b[_0x57f223(0x1d1)](_0x54826b,sanitizeFileName(_0x27883a)+_0x57f223(0x1ed));let _0x4a08d2,_0xfd3e81;if(existsSync(_0x5921c3))try{const _0x1825fd=readFileSync(_0x5921c3,_0x57f223(0x1ea)),_0xdd5dba=parseYamlString(_0x1825fd);_0xfd3e81=_0xdd5dba,_0x4a08d2=buildRuleToNameMapping(_0xdd5dba),_0x3882f4[_0x57f223(0x17c)]&&_0x4a08d2[_0x57f223(0x154)]>0x0&&console[_0x57f223(0x13f)]('Found\x20'+_0x4a08d2[_0x57f223(0x154)]+_0x57f223(0x1e2)+_0x27883a);}catch(_0x4e3b09){_0x3882f4[_0x57f223(0x17c)]&&console['error'](_0x57f223(0x190)+_0x4e3b09[_0x57f223(0x17f)]);}const _0x5e52dd=[],_0x23a656=new Set(),_0x19a566=new Map(),_0x258b23=new Map(),_0x4447bc=new Set(),_0x3ea46e=new Map(),_0x1ff311=new Map(),_0x413a86=createJumpTargetCache();await withProgressSpinner(_0x57f223(0x167)+_0x27883a+_0x57f223(0x13c),async _0x10c34b=>{const _0xd0f0e2=_0x57f223;for(const _0x30e851 of _0x5d788f){const _0x4b4aa5=_0x5d788f['length']>0x1?_0x30e851[_0xd0f0e2(0x127)]+'\x20v'+(_0x30e851['versionNumber']||0x1):_0x30e851['journeyBundleName'];_0x10c34b[_0xd0f0e2(0x195)](_0xd0f0e2(0x167)+_0x4b4aa5);const _0x487ca3=await _0x58c854[_0xd0f0e2(0x1c8)][_0xd0f0e2(0x166)](_0x30e851['id']),_0x2440d4=_0x487ca3[_0xd0f0e2(0x182)]?.[_0xd0f0e2(0x176)],_0x18482d={'resolveSegment':async _0x2e7c22=>{const _0x4c4f56=_0xd0f0e2;if(!_0x2440d4)return{'name':_0x2e7c22,'isJourneyLocal':![]};const _0x50bc94=_0x19a566['get'](_0x2e7c22);if(_0x50bc94)return _0x50bc94;try{const _0x5acae7=await _0x58c854[_0x4c4f56(0x133)][_0x4c4f56(0x1b1)](_0x2440d4,_0x2e7c22),_0x48d97b=_0x5acae7[_0x4c4f56(0x1a9)]===SEGMENT_KIND_JOURNEY;let _0x35fe09,_0x5f4218=_0x5acae7[_0x4c4f56(0x175)];if(_0x48d97b&&_0x5acae7[_0x4c4f56(0x1da)]){const _0x2698be=await segmentResponseToDef(_0x5acae7,{'resolveSegmentName':async _0x255a0d=>{const _0x21d28b=_0x4c4f56,_0x1ec271=_0x19a566['get'](_0x255a0d);if(_0x1ec271)return _0x1ec271[_0x21d28b(0x175)];const _0x3983e6=await _0x18482d['resolveSegment'](_0x255a0d);return _0x3983e6[_0x21d28b(0x175)];}}),_0x4ec548=_0x2698be[_0x4c4f56(0x1da)];_0x35fe09={'description':_0x5acae7[_0x4c4f56(0x187)],'rule':_0x4ec548};const _0x490f34=serializeRule(_0x4ec548),_0x459a78=_0x258b23[_0x4c4f56(0x1ca)](_0x490f34);if(_0x459a78)_0x5f4218=_0x459a78,_0x35fe09=undefined,_0x3882f4['verbose']&&console['error']('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x5acae7[_0x4c4f56(0x175)]+_0x4c4f56(0x1db)+_0x459a78);else{let _0x55ca79=![];if(_0x4a08d2){const _0xdc7cb=_0x4a08d2[_0x4c4f56(0x1ca)](_0x490f34);if(_0xdc7cb){const _0x45fe06=_0xdc7cb[_0x4c4f56(0x12f)](_0xcbe15f=>!_0x23a656['has'](_0xcbe15f));_0x45fe06&&(_0x5f4218=_0x45fe06,_0x23a656[_0x4c4f56(0x11b)](_0x45fe06),_0x258b23[_0x4c4f56(0x16c)](_0x490f34,_0x45fe06),_0x55ca79=!![],_0x3882f4[_0x4c4f56(0x17c)]&&console[_0x4c4f56(0x13f)](_0x4c4f56(0x192)+_0x45fe06+_0x4c4f56(0x1d5)));}}if(!_0x55ca79){const _0x1d34ba=generateJourneyLocalName(_0x5acae7[_0x4c4f56(0x175)]);_0x1d34ba&&(_0x5f4218=_0x1d34ba);let _0x10b2fc=_0x5f4218,_0x2425c1=0x2;while(_0x23a656[_0x4c4f56(0x18c)](_0x10b2fc)){_0x10b2fc=_0x5f4218+'_'+_0x2425c1,_0x2425c1++;}_0x23a656[_0x4c4f56(0x11b)](_0x10b2fc),_0x258b23[_0x4c4f56(0x16c)](_0x490f34,_0x10b2fc),_0x5f4218=_0x10b2fc;}}}const _0x50246f={'name':_0x5f4218,'isJourneyLocal':_0x48d97b,'definition':_0x35fe09};return _0x19a566['set'](_0x2e7c22,_0x50246f),_0x50246f;}catch(_0x1304ef){return _0x5cfbea[_0x4c4f56(0x17c)]&&console[_0x4c4f56(0x13f)](_0x4c4f56(0x14a)+_0x2e7c22+':\x20'+_0x1304ef[_0x4c4f56(0x17f)]),{'name':_0x2e7c22,'isJourneyLocal':![]};}},'resolveActivation':async _0x51d37a=>{const _0x349baa=_0xd0f0e2,_0x3488b4=_0x3ea46e[_0x349baa(0x1ca)](_0x51d37a);if(_0x3488b4)return _0x3488b4;try{const _0x3bc4df=await _0x58c854[_0x349baa(0x1c8)][_0x349baa(0x14d)](_0x30e851['id'],_0x51d37a),_0x5348e3=journeyActivationStepToYaml(_0x3bc4df,_0x49cc87,_0xe00dfe),_0x368523=JSON[_0x349baa(0x19d)]({'name':_0x5348e3[_0x349baa(0x175)],'connection':_0x5348e3[_0x349baa(0x123)],'connector_config':_0x5348e3[_0x349baa(0x15a)]}),_0x4e00c1=_0x1ff311[_0x349baa(0x1ca)](_0x368523);if(_0x4e00c1){const _0x15d532={'name':_0x4e00c1,'isJourneyLocal':!![],'definition':_0x5348e3};return _0x3ea46e[_0x349baa(0x16c)](_0x51d37a,_0x15d532),_0x15d532;}const _0x241eaa=_0x3bc4df[_0x349baa(0x182)]['activationParams'][_0x349baa(0x175)]||_0x51d37a,_0x3082a8=sanitizeYamlKey(_0x241eaa)||_0x349baa(0x13b)+_0x51d37a;let _0x29d933=_0x3082a8,_0x19e186=0x2;while(_0x4447bc[_0x349baa(0x18c)](_0x29d933)){_0x29d933=_0x3082a8+'_'+_0x19e186,_0x19e186++;}_0x4447bc[_0x349baa(0x11b)](_0x29d933),_0x1ff311['set'](_0x368523,_0x29d933);const _0x31e2b0={'name':_0x29d933,'isJourneyLocal':!![],'definition':_0x5348e3};return _0x3ea46e[_0x349baa(0x16c)](_0x51d37a,_0x31e2b0),_0x31e2b0;}catch(_0x20e9db){return _0x5cfbea[_0x349baa(0x17c)]&&console['error'](_0x349baa(0x1bb)+_0x51d37a+':\x20'+_0x20e9db[_0x349baa(0x17f)]),{'name':_0x51d37a,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x351215,_0x40b2c9)=>{return resolveJumpTarget(_0x351215,_0x40b2c9,_0x413a86,_0x599208=>_0x58c854['journey']['getJourney'](_0x599208));}},_0x30d071=await journeyResponseToDef(_0x487ca3,_0x18482d);_0x5e52dd[_0xd0f0e2(0x172)]({'item':_0x30e851,'yaml':_0x30d071});}},{'verbose':_0x5cfbea[_0x57f223(0x17c)]});const _0x513d3c=buildMergedJourneyDef(_0x5e52dd,_0x4a08d2),_0x761d3c=normalizeJourneyDef(_0x513d3c,_0xfd3e81),_0x1c9028=toYamlString(_0x761d3c),_0x5d0930=_0x455a43||a18_0x513e0b[_0x57f223(0x1d1)](_0x54826b,sanitizeFileName(_0x27883a)+_0x57f223(0x1ed));!_0x455a43&&_0xbbdcd6&&!existsSync(_0x54826b)&&mkdirSync(_0x54826b,{'recursive':!![]});const _0x2da048=a18_0x513e0b[_0x57f223(0x1d8)](process[_0x57f223(0x1ac)](),_0x5d0930);if(existsSync(_0x5d0930)){const _0x4dcfcf=readFileSync(_0x5d0930,_0x57f223(0x1ea)),_0x466eea=generateDiff(_0x4dcfcf,_0x1c9028),_0x239a06=hasChanges(_0x466eea);_0x4f5ad6[_0x57f223(0x172)]({'relativePath':_0x2da048,'absolutePath':_0x5d0930,'content':_0x1c9028,'isNew':![],'hasChanges':_0x239a06,'diff':_0x239a06?formatDiffWithColors(_0x466eea):undefined});}else _0x4f5ad6[_0x57f223(0x172)]({'relativePath':_0x2da048,'absolutePath':_0x5d0930,'content':_0x1c9028,'isNew':!![],'hasChanges':![]});}const _0x2d15c0=_0x4f5ad6['filter'](_0xe0ef5a=>_0xe0ef5a[_0x57f223(0x19a)]),_0x51d5e1=_0x4f5ad6['filter'](_0x5008ac=>!_0x5008ac[_0x57f223(0x19a)]&&_0x5008ac['hasChanges']),_0x3ece72=_0x4f5ad6[_0x57f223(0x17b)](_0xbba7aa=>!_0xbba7aa['isNew']&&!_0xbba7aa[_0x57f223(0x14b)]),_0x2a48a1=_0x42003d['length'],_0x13fd99=_0x6528e6[_0x57f223(0x154)],_0x2e6527=_0x2a48a1>_0x13fd99?'\x20('+_0x2a48a1+_0x57f223(0x1a0):'';console[_0x57f223(0x13f)](_0x57f223(0x174)),console[_0x57f223(0x13f)]('\x20\x20'+a18_0x4d810b['cyan'](_0x13fd99+'\x20journeys')+a18_0x4d810b[_0x57f223(0x12a)](_0x2e6527)),console[_0x57f223(0x13f)]('\x20\x20'+a18_0x4d810b[_0x57f223(0x19e)]('+\x20'+_0x2d15c0[_0x57f223(0x149)]+'\x20new\x20files')),console[_0x57f223(0x13f)]('\x20\x20'+a18_0x4d810b[_0x57f223(0x164)]('~\x20'+_0x51d5e1[_0x57f223(0x149)]+_0x57f223(0x150))),console[_0x57f223(0x13f)]('\x20\x20'+a18_0x4d810b[_0x57f223(0x12a)]('=\x20'+_0x3ece72[_0x57f223(0x149)]+_0x57f223(0x16d))),console[_0x57f223(0x13f)](_0x57f223(0x15e)+a18_0x4d810b[_0x57f223(0x118)](_0x46276a)+'\x0a');if(_0x51d5e1[_0x57f223(0x149)]>0x0)for(const _0x182f80 of _0x51d5e1){console[_0x57f223(0x13f)](_0x57f223(0x1b9)+_0x182f80[_0x57f223(0x188)]+'\x27:'),console[_0x57f223(0x13f)]('─'[_0x57f223(0x1e4)](0x3c)),console[_0x57f223(0x13f)](_0x182f80[_0x57f223(0x165)]),console[_0x57f223(0x13f)]('─'['repeat'](0x3c));}if(_0x3882f4[_0x57f223(0x122)])return console[_0x57f223(0x13f)](a18_0x4d810b[_0x57f223(0x164)](_0x57f223(0x17d))),0x0;if(_0x2d15c0[_0x57f223(0x149)]===0x0&&_0x51d5e1[_0x57f223(0x149)]===0x0)return console[_0x57f223(0x13f)](a18_0x4d810b[_0x57f223(0x19e)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0xb6a685},_0x3882f4[_0x57f223(0x147)]),console[_0x57f223(0x13f)](a18_0x4d810b[_0x57f223(0x19e)](_0x57f223(0x1cb)+a18_0x4d810b[_0x57f223(0x12a)](_0x57f223(0x1e0))+_0x57f223(0x1ce)+a18_0x4d810b['cyan'](_0xb6a685))),0x0;if(!_0x3882f4[_0x57f223(0x171)]&&(_0x2d15c0[_0x57f223(0x149)]>0x0||_0x51d5e1['length']>0x0)){const _0x21f114=await confirmKey(_0x57f223(0x142)+(_0x2d15c0[_0x57f223(0x149)]+_0x51d5e1[_0x57f223(0x149)])+_0x57f223(0x1ad));if(!_0x21f114)return console[_0x57f223(0x13f)](_0x57f223(0x1b8)),0x1;}!existsSync(_0x46276a)&&mkdirSync(_0x46276a,{'recursive':!![]});for(const _0x4c7cd7 of _0x4f5ad6){(_0x4c7cd7[_0x57f223(0x19a)]||_0x4c7cd7[_0x57f223(0x14b)])&&writeFileSync(_0x4c7cd7[_0x57f223(0x156)],_0x4c7cd7[_0x57f223(0x140)],_0x57f223(0x1ea));}return console[_0x57f223(0x13f)](a18_0x4d810b[_0x57f223(0x19e)](_0x57f223(0x169)+(_0x2d15c0[_0x57f223(0x149)]+_0x51d5e1['length'])+_0x57f223(0x148)+_0x46276a)),saveSessionContext({'parent_segment':_0xb6a685},_0x3882f4['session']),console[_0x57f223(0x13f)](a18_0x4d810b[_0x57f223(0x19e)](_0x57f223(0x1cb)+a18_0x4d810b[_0x57f223(0x12a)](_0x57f223(0x1e0))+_0x57f223(0x1ce)+a18_0x4d810b[_0x57f223(0x118)](_0xb6a685))),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']='journey:push';[a18_0x52fc43(0x187)]=a18_0x52fc43(0x189);[a18_0x52fc43(0x179)]=new SegmentPushCommand();async[a18_0x52fc43(0x19c)](_0x3ebd8e){const _0x330d89=a18_0x52fc43,_0x31821b=_0x3ebd8e[_0x330d89(0x11c)][0x0];let _0x5e666a;if(_0x31821b){const _0x5a4b95=await resolveTarget({'arg':_0x31821b,'contextParent':_0x3ebd8e[_0x330d89(0x129)][_0x330d89(0x131)],'cwd':process[_0x330d89(0x1ac)]()});isSuccessfulResolution(_0x5a4b95)&&_0x5a4b95[_0x330d89(0x18f)]==='file'&&(_0x5e666a=_0x5a4b95[_0x330d89(0x1a4)]);}const _0x45d580={..._0x3ebd8e,'options':{..._0x3ebd8e[_0x330d89(0x129)],'journeysOnly':!![],..._0x5e666a&&{'singleFilePath':_0x5e666a}}};return this[_0x330d89(0x179)]['execute'](_0x45d580);}}
|
|
1
|
+
const a18_0x394df7=a18_0x4271;(function(_0x67c397,_0x1d5ef4){const _0x2fa3f4=a18_0x4271,_0x4a6ac6=_0x67c397();while(!![]){try{const _0x29c663=parseInt(_0x2fa3f4(0x246))/0x1+parseInt(_0x2fa3f4(0x1ca))/0x2*(-parseInt(_0x2fa3f4(0x1a8))/0x3)+parseInt(_0x2fa3f4(0x19e))/0x4+-parseInt(_0x2fa3f4(0x1fe))/0x5*(parseInt(_0x2fa3f4(0x23b))/0x6)+parseInt(_0x2fa3f4(0x1d7))/0x7+parseInt(_0x2fa3f4(0x1ad))/0x8+-parseInt(_0x2fa3f4(0x1cf))/0x9;if(_0x29c663===_0x1d5ef4)break;else _0x4a6ac6['push'](_0x4a6ac6['shift']());}catch(_0x28097d){_0x4a6ac6['push'](_0x4a6ac6['shift']());}}}(a18_0x3476,0x9b76d));function a18_0x4271(_0x252579,_0x33dbf7){_0x252579=_0x252579-0x186;const _0x3476cc=a18_0x3476();let _0x427173=_0x3476cc[_0x252579];return _0x427173;}import a18_0x3cde22 from'chalk';import a18_0x1e1181 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function formatJourneyState(_0x594605){const _0x2d094b=a18_0x4271;switch(_0x594605){case _0x2d094b(0x1b4):return a18_0x3cde22[_0x2d094b(0x1a6)]('(running)');case _0x2d094b(0x1bc):return a18_0x3cde22[_0x2d094b(0x228)](_0x2d094b(0x233));case _0x2d094b(0x20f):return a18_0x3cde22[_0x2d094b(0x1d9)](_0x2d094b(0x1ea));case _0x2d094b(0x204):return a18_0x3cde22[_0x2d094b(0x1ba)](_0x2d094b(0x1eb));case _0x2d094b(0x24c):return a18_0x3cde22[_0x2d094b(0x228)](_0x2d094b(0x1a4));default:return'('+_0x594605+')';}}function a18_0x3476(){const _0x4dc9ed=['No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Target\x20file:\x20','user','(paused)','(completed)','folders','listJourneysWithFolders','test','hasChanges','resolveJourneyId','parentSegment','type','getStatistics','file','isNew','diff','length','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','state','goalRate','sort','setPhase','values','4407655rgsmQq','journey:push','cwd','utf-8','toLowerCase','relativePath','completed','Listing\x20journeys...','folderPath','✔\x20Pulled\x20','site','Parent\x20segment:\x20','exited','\x20\x20Preserving\x20local\x20segment\x20name:\x20','has','\x20Opening\x20','folderId','paused','args','Cancelled','buildIdToEmailMap','log','filter','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','replace','verbose','journeys','resume','Show\x20journey\x20details','Fetching\x20connections\x20for\x20name\x20resolution...','Resolving\x20journey...','\x20journey\x20files\x20to\x20','Resolved\x20YAML\x20file:\x20','versionNumber','No\x20journeys\x20found','filePath','yes','listFolders','\x22\x20resumed','population','entries','message','dim','Error:\x20Journey\x20not\x20found:\x20','🗺️\x20','getParentFull','totalGoalAchieved','goal','web','\x5c$&','\x20\x20Name:\x20','connector_config','absolutePath','(draft)','session','Write\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20journey','get','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','segmentPushCommand','6skQRzp','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','journey:pull','Found\x20','journeyId','segment','stageName','getJourney','kind','Getting\x20journey\x20statistics...','\x0aPull\x20summary:','614884YlTKAn','repeat','Warning:\x20Stage\x20\x22','split','all','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','archived','✔\x20Context\x20set:\x20','attributes','\x27\x20not\x20found\x20in\x20','List\x20journeys\x20in\x20current\x20context','Options:','segments','format','\x20\x20Statistics\x20not\x20available','Pattern:\x20','description','\x20\x20Folder\x20path:\x20','journeyBundleName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Consolidating\x20duplicate\x20segment:\x20','stage','Folder\x20path:\x20','cyan','Usage:\x20journey\x20resume\x20<name-or-path>','journeyName','...','/app/ps/','parentName','Resolving\x20parent\x20segment...','table','\x20unchanged\x20files','add','No\x20statistics\x20available\x20for\x20journey:\x20','INVALID_ARGUMENT','resourceName','/j/da/je','map','\x0aChanges\x20to\x20\x27','Error:\x20Parent\x20segment\x20context\x20required','entered','journey','/j/da','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','1948212lZEDzd','\x20versions)','✔\x20Found\x20','join','Input:\x20','\x20\x20-\x20','(archived)','size','green','resolveParentId','3GBNNff','Usage:\x20journey\x20stats\x20<name-or-path>','conversionRate','find','totalEntered','4075024syKNCK','content','localeCompare','connection','Error:\x20','rootFolderId','dryRun','launched','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','pause','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Export\x20journey(s)\x20as\x20YAML\x20files','buildIdToNameMap','blue','Pause\x20a\x20running\x20journey','draft','parent_segment','Fetching\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','execute','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','root\x20folder','\x20=\x20','set','Warning:\x20Could\x20not\x20resolve\x20segment\x20','📁\x20','data','\x20files?','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','638314lJYcNO','error','resolveSegment','push','(root)','8781372LbdWXn','\x20->\x20','json','/e/','Usage:\x20journey\x20pause\x20<name-or-path>','targetDir','base','then','8413034KSQsTV','stages','yellow','helpText','.yml','\x20(ID:\x20','getSegment','options','rule','red','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','listJourneysFromParentSegment','✔\x20Journey\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','name'];a18_0x3476=function(){return _0x4dc9ed;};return a18_0x3476();}function formatJourneyItem(_0x21ee10,_0x5c93f9='',_0x5b977e){const _0xc2a9bf=a18_0x4271,_0x211aa9=formatJourneyState(_0x21ee10[_0xc2a9bf(0x1f9)]),_0x102319=_0x5b977e?hyperlink(_0x21ee10[_0xc2a9bf(0x258)],_0x5b977e):_0x21ee10['journeyBundleName'];return _0x5c93f9+_0xc2a9bf(0x22a)+_0x102319+'\x20'+_0x211aa9;}function escapeRegex(_0x4b1a7c){const _0x3885ab=a18_0x4271;return _0x4b1a7c[_0x3885ab(0x216)](/[.*+?^${}()|[\]\\]/g,_0x3885ab(0x22f));}function globToRegex(_0x5bfe84){const _0x2089a6=a18_0x4271,_0x140d8a=_0x5bfe84[_0x2089a6(0x249)]('*')[_0x2089a6(0x197)](escapeRegex);return new RegExp(_0x140d8a[_0x2089a6(0x1a1)]('.*'),'i');}function buildRuleToNameMapping(_0x53e027){const _0x313b80=a18_0x4271,_0x1848f1=new Map();if(_0x53e027['segments'])for(const [_0x5d8d03,_0x10938f]of Object['entries'](_0x53e027[_0x313b80(0x252)])){if(_0x10938f[_0x313b80(0x1df)]){const _0x3cbfe4=serializeRule(_0x10938f['rule']),_0x3f2551=_0x1848f1['get'](_0x3cbfe4);_0x3f2551?_0x3f2551[_0x313b80(0x1cd)](_0x5d8d03):_0x1848f1[_0x313b80(0x1c4)](_0x3cbfe4,[_0x5d8d03]);}}return _0x1848f1;}async function resolveJourneyTarget(_0x35a3ce,_0xe784c5,_0x271987){const _0x53a0e7=a18_0x4271;if(isYamlFilePath(_0x35a3ce))try{const _0x4ccbc6=await resolveYamlFilePath(_0x35a3ce);return _0x271987&&(console[_0x53a0e7(0x1cb)](_0x53a0e7(0x21e)+_0x35a3ce),console[_0x53a0e7(0x1cb)]('\x20\x20Parent\x20segment:\x20'+_0x4ccbc6[_0x53a0e7(0x1f1)]),console[_0x53a0e7(0x1cb)](_0x53a0e7(0x230)+_0x4ccbc6['segmentName']),console['error'](_0x53a0e7(0x257)+(_0x4ccbc6[_0x53a0e7(0x206)]||_0x53a0e7(0x1ce)))),{'journeyName':_0x4ccbc6['segmentName'],'parentSegment':_0x4ccbc6[_0x53a0e7(0x1f1)],'resolved':_0x4ccbc6};}catch(_0x1a3843){throw new SDKError(ErrorCode[_0x53a0e7(0x194)],_0x53a0e7(0x1b5)+_0x1a3843['message']);}if(!_0xe784c5)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x53a0e7(0x1e7));return{'journeyName':_0x35a3ce,'parentSegment':_0xe784c5};}export class JourneyListCommand extends BaseCommand{[a18_0x394df7(0x1e6)]='journey:list';[a18_0x394df7(0x256)]=a18_0x394df7(0x250);async[a18_0x394df7(0x1c0)](_0x503ea0){const _0x362237=a18_0x394df7,{options:_0x26933a,args:_0x325152,tdx:_0x4f8d32}=_0x503ea0,_0x1b0957=_0x325152[0x0],_0x581d29=_0x26933a[_0x362237(0x1f1)];if(!_0x581d29)return console[_0x362237(0x1cb)](_0x362237(0x199)),console[_0x362237(0x1cb)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x3764ad=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x4f8d32[_0x362237(0x240)][_0x362237(0x1a7)](_0x581d29),{'verbose':_0x26933a['verbose']}),_0x5660fe=_0x3764ad['data'];_0x26933a[_0x362237(0x217)]&&(console[_0x362237(0x1cb)](_0x362237(0x209)+_0x581d29+_0x362237(0x1dc)+_0x5660fe+')'),_0x1b0957&&console[_0x362237(0x1cb)](_0x362237(0x255)+_0x1b0957));const _0x16f90e=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x4f8d32[_0x362237(0x240)][_0x362237(0x22b)](_0x5660fe),{'verbose':_0x26933a[_0x362237(0x217)]}),_0x488f49=_0x16f90e[_0x362237(0x1c7)],_0x346bf5=_0x488f49[_0x362237(0x1b2)],_0x544b93=await withSpinner(_0x362237(0x205),()=>_0x4f8d32['journey'][_0x362237(0x1ed)](_0x5660fe,_0x346bf5),{'verbose':_0x26933a[_0x362237(0x217)]});let _0x54bdd9=_0x544b93[_0x362237(0x1c7)][_0x362237(0x218)];const _0x3e32ab=_0x544b93[_0x362237(0x1c7)][_0x362237(0x1ec)],_0x23010f=new Map();for(const _0x2249ac of _0x3e32ab){_0x23010f[_0x362237(0x1c4)](_0x2249ac['id'],_0x2249ac[_0x362237(0x1e6)]);}if(_0x1b0957){const _0x32d978=globToRegex(_0x1b0957);_0x54bdd9=_0x54bdd9[_0x362237(0x214)](_0x331576=>_0x32d978[_0x362237(0x1ee)](_0x331576[_0x362237(0x258)]));}console[_0x362237(0x1cb)](_0x362237(0x1a0)+_0x54bdd9[_0x362237(0x1f7)]+_0x362237(0x237)+(_0x54bdd9[_0x362237(0x1f7)]!==0x1?'s':''));const _0x2af4a4=_0x56cab9=>{const _0x2a8f4e=_0x362237;return getConsoleNextUrl(_0x26933a['site'],_0x2a8f4e(0x18d)+_0x5660fe+_0x2a8f4e(0x1d2)+_0x56cab9+_0x2a8f4e(0x19c));};if(_0x26933a[_0x362237(0x253)]===_0x362237(0x190))await handleSDKOutput(_0x54bdd9,_0x26933a);else{if(_0x26933a[_0x362237(0x253)]===_0x362237(0x1d1)){const _0x5c8e46=_0x54bdd9['map'](_0x7eb383=>({..._0x7eb383,'url':_0x2af4a4(_0x7eb383['id'])}));await handleSDKOutput(_0x5c8e46,_0x26933a);}else{console[_0x362237(0x213)]('['+_0x581d29+']');const _0x388838=new Map(),_0x435378=[];for(const _0x4f8a42 of _0x54bdd9){if(!_0x4f8a42[_0x362237(0x20e)]||_0x4f8a42[_0x362237(0x20e)]===_0x346bf5)_0x435378[_0x362237(0x1cd)](_0x4f8a42);else{const _0x249d0d=_0x388838['get'](_0x4f8a42[_0x362237(0x20e)])||[];_0x249d0d[_0x362237(0x1cd)](_0x4f8a42),_0x388838[_0x362237(0x1c4)](_0x4f8a42[_0x362237(0x20e)],_0x249d0d);}}const _0x27c41e=(_0x3816a9,_0x5075bf)=>_0x3816a9[_0x362237(0x258)][_0x362237(0x1af)](_0x5075bf[_0x362237(0x258)],undefined,{'sensitivity':_0x362237(0x1d5)});_0x435378['sort'](_0x27c41e);for(const _0x3b9938 of _0x435378){console[_0x362237(0x213)](formatJourneyItem(_0x3b9938,'',_0x2af4a4(_0x3b9938['id'])));}const _0x2b7835=[..._0x388838[_0x362237(0x226)]()][_0x362237(0x1fb)]((_0x30571f,_0x103a46)=>{const _0x3d3f91=_0x362237,_0xaceecc=_0x23010f[_0x3d3f91(0x238)](_0x30571f[0x0])||_0x30571f[0x0],_0x3edcb7=_0x23010f[_0x3d3f91(0x238)](_0x103a46[0x0])||_0x103a46[0x0];return _0xaceecc[_0x3d3f91(0x1af)](_0x3edcb7,undefined,{'sensitivity':_0x3d3f91(0x1d5)});});for(const [_0x46577d,_0x4f7601]of _0x2b7835){const _0x182464=_0x23010f[_0x362237(0x238)](_0x46577d)||_0x46577d;console[_0x362237(0x213)](_0x362237(0x1c6)+_0x182464),_0x4f7601['sort'](_0x27c41e);for(const _0x38782a of _0x4f7601){console[_0x362237(0x213)](formatJourneyItem(_0x38782a,'\x20\x20',_0x2af4a4(_0x38782a['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a18_0x394df7(0x1e6)]='journey:view';[a18_0x394df7(0x256)]=a18_0x394df7(0x21a);async['execute'](_0x2589b8){const _0x5a07f8=a18_0x394df7,{options:_0x593d74,args:_0x31ee26,tdx:_0x2129b3}=_0x2589b8,_0x29addd=_0x31ee26[0x0];if(!_0x29addd)return console[_0x5a07f8(0x1cb)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x5a07f8(0x1e1)),console['error'](_0x5a07f8(0x251)),console[_0x5a07f8(0x1cb)](_0x5a07f8(0x1e5)),0x1;_0x593d74['verbose']&&console[_0x5a07f8(0x1cb)](_0x5a07f8(0x1a2)+_0x29addd);const _0x549857=await resolveJourneyTarget(_0x29addd,_0x593d74[_0x5a07f8(0x1f1)],_0x593d74[_0x5a07f8(0x217)]),_0x18df64=await withSpinner(_0x5a07f8(0x18f),()=>_0x2129b3[_0x5a07f8(0x240)]['resolveParentId'](_0x549857[_0x5a07f8(0x1f1)]),{'verbose':_0x593d74[_0x5a07f8(0x217)]}),_0x365ca4=_0x18df64['data'],_0x2a01d5=await withSpinner(_0x5a07f8(0x21c),()=>_0x2129b3['journey']['resolveJourneyId'](_0x365ca4,_0x549857[_0x5a07f8(0x18b)]),{'verbose':_0x593d74['verbose']}),_0x206503=_0x2a01d5[_0x5a07f8(0x1c7)];if(_0x593d74[_0x5a07f8(0x22e)]){const _0x5dafcf=getConsoleNextUrl(_0x593d74[_0x5a07f8(0x208)],'/app/ps/'+_0x365ca4+'/e/'+_0x206503+_0x5a07f8(0x196));return console[_0x5a07f8(0x1cb)](a18_0x3cde22[_0x5a07f8(0x1a6)]('✔')+_0x5a07f8(0x20d)+a18_0x3cde22[_0x5a07f8(0x189)](_0x5dafcf)),openBrowser(_0x5dafcf),0x0;}const _0x1e7aa9=await withSpinner('Getting\x20journey\x20details...',()=>_0x2129b3[_0x5a07f8(0x19b)][_0x5a07f8(0x242)](_0x206503),{'verbose':_0x593d74['verbose']}),_0x87f99=_0x1e7aa9[_0x5a07f8(0x1c7)],_0x12ee23=_0x593d74['includeStats'];let _0x4d5865;if(_0x12ee23)try{const _0x2c8c47=await withSpinner(_0x5a07f8(0x244),()=>_0x2129b3[_0x5a07f8(0x19b)][_0x5a07f8(0x1f3)](_0x206503),{'verbose':_0x593d74[_0x5a07f8(0x217)]});_0x4d5865=_0x2c8c47[_0x5a07f8(0x1c7)];}catch{_0x593d74[_0x5a07f8(0x217)]&&console[_0x5a07f8(0x1cb)](_0x5a07f8(0x254));}const _0x139cbf=getConsoleNextUrl(_0x593d74[_0x5a07f8(0x208)],_0x5a07f8(0x18d)+_0x365ca4+_0x5a07f8(0x1d2)+_0x206503+_0x5a07f8(0x196)),_0x2f9748={'id':_0x87f99['id'],'name':_0x87f99[_0x5a07f8(0x24e)][_0x5a07f8(0x1e6)],'description':_0x87f99['attributes'][_0x5a07f8(0x256)],'state':_0x87f99[_0x5a07f8(0x24e)]['state'],'paused':_0x87f99[_0x5a07f8(0x24e)]['paused'],'reentry_mode':_0x87f99[_0x5a07f8(0x24e)]['reentryMode'],'stages':_0x87f99[_0x5a07f8(0x24e)]['journeyStages']?.['length']||0x0,..._0x87f99[_0x5a07f8(0x24e)]['goal']&&{'goal':_0x87f99['attributes'][_0x5a07f8(0x22d)][_0x5a07f8(0x1e6)]},..._0x4d5865&&{'statistics':{'total_entered':_0x4d5865[_0x5a07f8(0x1ac)],'goal_achieved':_0x4d5865[_0x5a07f8(0x22c)],'goal_rate':_0x4d5865[_0x5a07f8(0x1fa)],'stages':_0x4d5865[_0x5a07f8(0x1d8)]}},'url':_0x139cbf};return await handleSingleObjectOutput(_0x2f9748,_0x593d74),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x394df7(0x1e6)]='journey:stats';[a18_0x394df7(0x256)]='Show\x20journey\x20statistics';async[a18_0x394df7(0x1c0)](_0x14e057){const _0x59bca3=a18_0x394df7,{options:_0x575d3c,args:_0x19e2a9,tdx:_0x255a6e}=_0x14e057,_0x514708=_0x19e2a9[0x0];if(!_0x514708)return console['error'](_0x59bca3(0x215)),console[_0x59bca3(0x1cb)](_0x59bca3(0x1a9)),0x1;_0x575d3c['verbose']&&console['error'](_0x59bca3(0x1a2)+_0x514708);const _0x2b6573=await resolveJourneyTarget(_0x514708,_0x575d3c[_0x59bca3(0x1f1)],_0x575d3c['verbose']),_0x5ec8a5=await withSpinner(_0x59bca3(0x18f),()=>_0x255a6e['segment'][_0x59bca3(0x1a7)](_0x2b6573['parentSegment']),{'verbose':_0x575d3c['verbose']}),_0x4e709c=_0x5ec8a5['data'],_0x42396f=await withSpinner(_0x59bca3(0x21c),()=>_0x255a6e['journey'][_0x59bca3(0x1f0)](_0x4e709c,_0x2b6573[_0x59bca3(0x18b)]),{'verbose':_0x575d3c[_0x59bca3(0x217)]}),_0x1d8950=_0x42396f[_0x59bca3(0x1c7)],_0x2c7b8d=await withSpinner(_0x59bca3(0x244),()=>_0x255a6e['journey'][_0x59bca3(0x1f3)](_0x1d8950),{'verbose':_0x575d3c[_0x59bca3(0x217)]}),_0x293897=_0x2c7b8d[_0x59bca3(0x1c7)];if(!_0x293897||_0x293897['journeyId']===null)return console['error'](_0x59bca3(0x193)+_0x2b6573['journeyName']),console[_0x59bca3(0x1cb)](_0x59bca3(0x1c1)),0x0;const _0x3ae329={'journey_id':_0x293897[_0x59bca3(0x23f)],'total_entered':_0x293897[_0x59bca3(0x1ac)],'goal_achieved':_0x293897[_0x59bca3(0x22c)],'goal_rate':_0x293897[_0x59bca3(0x1fa)],'stages':_0x293897[_0x59bca3(0x1d8)]?.[_0x59bca3(0x197)](_0x3c92c4=>({'name':_0x3c92c4[_0x59bca3(0x241)],'population':_0x3c92c4[_0x59bca3(0x225)],'entered':_0x3c92c4['entered'],'exited':_0x3c92c4[_0x59bca3(0x20a)],'conversion_rate':_0x3c92c4['conversionRate']}))},_0x4eb5ae=_0x575d3c[_0x59bca3(0x187)];if(_0x4eb5ae&&_0x293897[_0x59bca3(0x1d8)]){const _0x2d842f=_0x293897[_0x59bca3(0x1d8)]['find'](_0x479589=>_0x479589[_0x59bca3(0x241)][_0x59bca3(0x202)]()===_0x4eb5ae[_0x59bca3(0x202)]());if(_0x2d842f)return await handleSingleObjectOutput({'stage_name':_0x2d842f[_0x59bca3(0x241)],'population':_0x2d842f[_0x59bca3(0x225)],'entered':_0x2d842f[_0x59bca3(0x19a)],'exited':_0x2d842f[_0x59bca3(0x20a)],'conversion_rate':_0x2d842f[_0x59bca3(0x1aa)]},_0x575d3c),0x0;console[_0x59bca3(0x1cb)](_0x59bca3(0x248)+_0x4eb5ae+'\x22\x20not\x20found');}return await handleSingleObjectOutput(_0x3ae329,_0x575d3c),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a18_0x394df7(0x1e6)]='journey:pause';['description']=a18_0x394df7(0x1bb);async[a18_0x394df7(0x1c0)](_0x22d0e8){const _0x3c54f2=a18_0x394df7,{options:_0x169b8c,args:_0x2ddb9c,tdx:_0x1193b6}=_0x22d0e8,_0x56e9a3=_0x2ddb9c[0x0];if(!_0x56e9a3)return console[_0x3c54f2(0x1cb)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x3c54f2(0x1d3)),0x1;_0x169b8c[_0x3c54f2(0x217)]&&console[_0x3c54f2(0x1cb)](_0x3c54f2(0x1a2)+_0x56e9a3);const _0x423f9a=await resolveJourneyTarget(_0x56e9a3,_0x169b8c[_0x3c54f2(0x1f1)],_0x169b8c[_0x3c54f2(0x217)]),_0x399438=await withSpinner(_0x3c54f2(0x18f),()=>_0x1193b6[_0x3c54f2(0x240)][_0x3c54f2(0x1a7)](_0x423f9a[_0x3c54f2(0x1f1)]),{'verbose':_0x169b8c[_0x3c54f2(0x217)]}),_0x58e41a=_0x399438[_0x3c54f2(0x1c7)],_0xc4622e=await withSpinner(_0x3c54f2(0x21c),()=>_0x1193b6[_0x3c54f2(0x19b)][_0x3c54f2(0x1f0)](_0x58e41a,_0x423f9a[_0x3c54f2(0x18b)]),{'verbose':_0x169b8c['verbose']}),_0xb2714=_0xc4622e[_0x3c54f2(0x1c7)];if(!_0x169b8c['yes']){const _0x1008f5=await confirm(_0x3c54f2(0x19d)+_0x423f9a['journeyName']+'\x22?');if(!_0x1008f5)return console[_0x3c54f2(0x1cb)](_0x3c54f2(0x211)),0x0;}const _0x2d2935=await withSpinner('Pausing\x20journey...',()=>_0x1193b6[_0x3c54f2(0x19b)][_0x3c54f2(0x1b6)](_0xb2714),{'verbose':_0x169b8c['verbose']}),_0x28c0d7=_0x2d2935['data'];return console['error'](_0x3c54f2(0x1e3)+_0x28c0d7['attributes'][_0x3c54f2(0x1e6)]+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x394df7(0x1e6)]='journey:resume';[a18_0x394df7(0x256)]='Resume\x20a\x20paused\x20journey';async[a18_0x394df7(0x1c0)](_0xfc610d){const _0x5408e8=a18_0x394df7,{options:_0x4bfbc1,args:_0x798609,tdx:_0x5b697b}=_0xfc610d,_0x2fa5a4=_0x798609[0x0];if(!_0x2fa5a4)return console[_0x5408e8(0x1cb)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5408e8(0x1cb)](_0x5408e8(0x18a)),0x1;_0x4bfbc1[_0x5408e8(0x217)]&&console[_0x5408e8(0x1cb)]('Input:\x20'+_0x2fa5a4);const _0x1ccad3=await resolveJourneyTarget(_0x2fa5a4,_0x4bfbc1['parentSegment'],_0x4bfbc1['verbose']),_0x407c21=await withSpinner(_0x5408e8(0x18f),()=>_0x5b697b['segment'][_0x5408e8(0x1a7)](_0x1ccad3[_0x5408e8(0x1f1)]),{'verbose':_0x4bfbc1[_0x5408e8(0x217)]}),_0x249e6e=_0x407c21[_0x5408e8(0x1c7)],_0x3de459=await withSpinner('Resolving\x20journey...',()=>_0x5b697b[_0x5408e8(0x19b)][_0x5408e8(0x1f0)](_0x249e6e,_0x1ccad3[_0x5408e8(0x18b)]),{'verbose':_0x4bfbc1[_0x5408e8(0x217)]}),_0x5a5694=_0x3de459[_0x5408e8(0x1c7)];if(!_0x4bfbc1[_0x5408e8(0x222)]){const _0x5f52f5=await confirm(_0x5408e8(0x239)+_0x1ccad3[_0x5408e8(0x18b)]+'\x22?');if(!_0x5f52f5)return console[_0x5408e8(0x1cb)]('Cancelled'),0x0;}const _0x39225a=await withSpinner('Resuming\x20journey...',()=>_0x5b697b['journey'][_0x5408e8(0x219)](_0x5a5694),{'verbose':_0x4bfbc1[_0x5408e8(0x217)]}),_0x416862=_0x39225a[_0x5408e8(0x1c7)];return console[_0x5408e8(0x1cb)](_0x5408e8(0x1e3)+_0x416862[_0x5408e8(0x24e)][_0x5408e8(0x1e6)]+_0x5408e8(0x224)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a18_0x394df7(0x1e6)]=a18_0x394df7(0x23d);[a18_0x394df7(0x256)]=a18_0x394df7(0x1b8);async[a18_0x394df7(0x1c0)](_0x1ad479){const _0x1580c5=a18_0x394df7,{options:_0x12042a,args:_0x598856,tdx:_0x1e5249}=_0x1ad479,_0x4ba782=_0x12042a,_0x5d40b3=_0x598856[0x0],_0x3bd767=_0x5d40b3&&isYamlFilePath(_0x5d40b3),_0x4bf526=await resolveTarget({'arg':_0x3bd767?_0x5d40b3:undefined,'contextParent':_0x12042a['parentSegment'],'cwd':process[_0x1580c5(0x200)]()});if(!isSuccessfulResolution(_0x4bf526))return _0x4bf526['errorCode']==='no_parent'?(console[_0x1580c5(0x1cb)](a18_0x3cde22['yellow'](_0x1580c5(0x259))),console[_0x1580c5(0x1cb)](_0x1580c5(0x23c)),console[_0x1580c5(0x1cb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x1580c5(0x1cb)](_0x1580c5(0x24b)),console[_0x1580c5(0x1cb)](_0x1580c5(0x1bf))):(console[_0x1580c5(0x1cb)](a18_0x3cde22[_0x1580c5(0x1e0)](_0x1580c5(0x1b1)+_0x4bf526[_0x1580c5(0x227)]+'\x0a')),_0x4bf526[_0x1580c5(0x1da)]&&console[_0x1580c5(0x1cb)](a18_0x3cde22[_0x1580c5(0x189)](_0x4bf526[_0x1580c5(0x1da)]))),0x1;let _0x5200e0=_0x3bd767?undefined:_0x5d40b3,_0x5c00e6,_0x19f9db;_0x4bf526[_0x1580c5(0x1f2)]===_0x1580c5(0x1f4)&&(_0x5200e0=_0x4bf526[_0x1580c5(0x195)],_0x5c00e6=_0x4bf526[_0x1580c5(0x221)],_0x19f9db=_0x4bf526[_0x1580c5(0x206)]);const _0x2c4b86=_0x4bf526[_0x1580c5(0x18e)],_0x2e3c4e=_0x4bf526[_0x1580c5(0x1d4)];_0x4ba782['verbose']&&(console['error'](_0x1580c5(0x209)+_0x2c4b86),console[_0x1580c5(0x1cb)]('Target\x20directory:\x20'+_0x2e3c4e),_0x5200e0&&console[_0x1580c5(0x1cb)]('Journey\x20name:\x20'+_0x5200e0),_0x5c00e6&&console['error'](_0x1580c5(0x1e8)+_0x5c00e6),_0x19f9db&&console['error'](_0x1580c5(0x188)+_0x19f9db));const _0x3814df=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x1e5249[_0x1580c5(0x240)][_0x1580c5(0x1a7)](_0x2c4b86),{'verbose':_0x12042a['verbose']}),_0x44f2f1=_0x3814df[_0x1580c5(0x1c7)],[_0x10dc2c,_0x10af04]=await Promise[_0x1580c5(0x24a)]([withSpinner('Listing\x20journeys...',()=>_0x1e5249['journey'][_0x1580c5(0x1e2)](_0x44f2f1,undefined,{'includeAllVersions':!![]}),{'verbose':_0x12042a[_0x1580c5(0x217)]}),withSpinner('Listing\x20folders...',()=>_0x1e5249[_0x1580c5(0x240)][_0x1580c5(0x223)](_0x44f2f1),{'verbose':_0x12042a[_0x1580c5(0x217)]})]);let _0x551fed=_0x10dc2c[_0x1580c5(0x1c7)];const _0x3b4e73=_0x10af04['data'],_0x435032=buildFolderIdToPathMap(_0x3b4e73);if(_0x5200e0){const _0x45373b=_0x551fed[_0x1580c5(0x214)](_0x25b6cf=>_0x25b6cf[_0x1580c5(0x258)]['toLowerCase']()===_0x5200e0[_0x1580c5(0x202)]());if(_0x45373b['length']===0x0)return console[_0x1580c5(0x1cb)](_0x1580c5(0x229)+_0x5200e0),console['error'](_0x1580c5(0x1f8)),0x1;_0x551fed=_0x45373b;}if(_0x19f9db!==undefined){const _0x5d9207=_0x551fed['filter'](_0x14a582=>{const _0x3fbf37=_0x1580c5,_0x4a8103=_0x14a582[_0x3fbf37(0x20e)]?_0x435032['get'](_0x14a582['folderId'])||'':'';return _0x4a8103===_0x19f9db;});if(_0x5d9207[_0x1580c5(0x1f7)]===0x0&&_0x551fed[_0x1580c5(0x1f7)]>0x0){console[_0x1580c5(0x1cb)]('Error:\x20Journey\x20\x27'+_0x5200e0+_0x1580c5(0x24f)+(_0x19f9db||_0x1580c5(0x1c2))),console[_0x1580c5(0x1cb)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x1c2b75 of _0x551fed){const _0x598410=_0x1c2b75[_0x1580c5(0x20e)]?_0x435032[_0x1580c5(0x238)](_0x1c2b75[_0x1580c5(0x20e)])||'':'';console[_0x1580c5(0x1cb)](_0x1580c5(0x1a3)+(_0x598410||_0x1580c5(0x1ce))+'/'+_0x1c2b75[_0x1580c5(0x258)]);}return 0x1;}_0x551fed=_0x5d9207;}if(_0x551fed[_0x1580c5(0x1f7)]===0x0)return console[_0x1580c5(0x1cb)](_0x1580c5(0x220)),0x0;const _0x54099c=new Map();for(const _0x459a15 of _0x551fed){const _0x353ed3=_0x459a15['journeyBundleId'];!_0x54099c[_0x1580c5(0x20c)](_0x353ed3)&&_0x54099c[_0x1580c5(0x1c4)](_0x353ed3,[]),_0x54099c['get'](_0x353ed3)[_0x1580c5(0x1cd)](_0x459a15);}for(const _0x199730 of _0x54099c[_0x1580c5(0x1fd)]()){_0x199730[_0x1580c5(0x1fb)]((_0x4aba2f,_0x57028f)=>(_0x4aba2f['versionNumber']||0x0)-(_0x57028f[_0x1580c5(0x21f)]||0x0));}const _0x4bd31c=[],[_0x11fd8f,_0x517be3]=await Promise['all']([withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x1e5249[_0x1580c5(0x1e9)][_0x1580c5(0x212)](),{'verbose':_0x12042a['verbose']})[_0x1580c5(0x1d6)](_0x5957e1=>_0x5957e1[_0x1580c5(0x1c7)]),withSpinner(_0x1580c5(0x21b),()=>_0x1e5249[_0x1580c5(0x1b0)][_0x1580c5(0x1b9)](),{'verbose':_0x12042a[_0x1580c5(0x217)]})[_0x1580c5(0x1d6)](_0x2db076=>_0x2db076[_0x1580c5(0x1c7)])]);for(const _0x5cb9e1 of _0x54099c[_0x1580c5(0x1fd)]()){const _0x20ff0d=_0x5cb9e1[0x0][_0x1580c5(0x258)],_0xed11d3=_0x5cb9e1[0x0]['folderId'],_0x1c55c3=_0xed11d3?_0x435032['get'](_0xed11d3)||'':'',_0x3ae74e=_0x1c55c3?a18_0x1e1181[_0x1580c5(0x1a1)](_0x2e3c4e,_0x1c55c3):_0x2e3c4e,_0x3e56f7=_0x5c00e6||a18_0x1e1181[_0x1580c5(0x1a1)](_0x3ae74e,sanitizeFileName(_0x20ff0d)+_0x1580c5(0x1db));let _0x445e42,_0x1fd079;if(existsSync(_0x3e56f7))try{const _0x5e2988=readFileSync(_0x3e56f7,_0x1580c5(0x201)),_0x488f88=parseYamlString(_0x5e2988);_0x1fd079=_0x488f88,_0x445e42=buildRuleToNameMapping(_0x488f88),_0x4ba782[_0x1580c5(0x217)]&&_0x445e42[_0x1580c5(0x1a5)]>0x0&&console['error'](_0x1580c5(0x23e)+_0x445e42[_0x1580c5(0x1a5)]+_0x1580c5(0x1c9)+_0x20ff0d);}catch(_0x2cfe1b){_0x4ba782[_0x1580c5(0x217)]&&console[_0x1580c5(0x1cb)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x2cfe1b[_0x1580c5(0x227)]);}const _0x16bc51=[],_0x46ae83=new Set(),_0x5804f6=new Map(),_0x464f33=new Map(),_0x31a46c=new Set(),_0x4e017c=new Map(),_0x414a3b=new Map(),_0x3af81e=createJumpTargetCache();await withProgressSpinner(_0x1580c5(0x1be)+_0x20ff0d+_0x1580c5(0x18c),async _0x41fa86=>{const _0x1e483d=_0x1580c5;for(const _0xed64fa of _0x5cb9e1){const _0x28dadd=_0x5cb9e1[_0x1e483d(0x1f7)]>0x1?_0xed64fa[_0x1e483d(0x258)]+'\x20v'+(_0xed64fa[_0x1e483d(0x21f)]||0x1):_0xed64fa[_0x1e483d(0x258)];_0x41fa86[_0x1e483d(0x1fc)]('Fetching\x20'+_0x28dadd);const _0x169620=await _0x1e5249[_0x1e483d(0x19b)][_0x1e483d(0x242)](_0xed64fa['id']),_0x31a51c=_0x169620[_0x1e483d(0x24e)]?.['audienceId'],_0x293505={'resolveSegment':async _0x574f2e=>{const _0x33763e=_0x1e483d;if(!_0x31a51c)return{'name':_0x574f2e,'isJourneyLocal':![]};const _0x44de46=_0x5804f6[_0x33763e(0x238)](_0x574f2e);if(_0x44de46)return _0x44de46;try{const _0x3a8bb9=await _0x1e5249['segment'][_0x33763e(0x1dd)](_0x31a51c,_0x574f2e),_0x31e2f0=_0x3a8bb9[_0x33763e(0x243)]===SEGMENT_KIND_JOURNEY;let _0x3388a3,_0x4181cb=_0x3a8bb9[_0x33763e(0x1e6)];if(_0x31e2f0&&_0x3a8bb9[_0x33763e(0x1df)]){const _0x1088ee=await segmentResponseToDef(_0x3a8bb9,{'resolveSegmentName':async _0x3fcd35=>{const _0x5aca06=_0x33763e,_0x119f4c=_0x5804f6[_0x5aca06(0x238)](_0x3fcd35);if(_0x119f4c)return _0x119f4c[_0x5aca06(0x1e6)];const _0x305513=await _0x293505[_0x5aca06(0x1cc)](_0x3fcd35);return _0x305513[_0x5aca06(0x1e6)];}}),_0x2b7c67=_0x1088ee[_0x33763e(0x1df)];_0x3388a3={'description':_0x3a8bb9[_0x33763e(0x256)],'rule':_0x2b7c67};const _0x3a4162=serializeRule(_0x2b7c67),_0x5381ab=_0x464f33['get'](_0x3a4162);if(_0x5381ab)_0x4181cb=_0x5381ab,_0x3388a3=undefined,_0x4ba782[_0x33763e(0x217)]&&console[_0x33763e(0x1cb)](_0x33763e(0x186)+_0x3a8bb9['name']+_0x33763e(0x1d0)+_0x5381ab);else{let _0xd0f76c=![];if(_0x445e42){const _0x2802af=_0x445e42[_0x33763e(0x238)](_0x3a4162);if(_0x2802af){const _0x278f3c=_0x2802af[_0x33763e(0x1ab)](_0x311901=>!_0x46ae83[_0x33763e(0x20c)](_0x311901));_0x278f3c&&(_0x4181cb=_0x278f3c,_0x46ae83[_0x33763e(0x192)](_0x278f3c),_0x464f33[_0x33763e(0x1c4)](_0x3a4162,_0x278f3c),_0xd0f76c=!![],_0x4ba782[_0x33763e(0x217)]&&console[_0x33763e(0x1cb)](_0x33763e(0x20b)+_0x278f3c+'\x20(rule\x20match)'));}}if(!_0xd0f76c){const _0x4333b5=generateJourneyLocalName(_0x3a8bb9['name']);_0x4333b5&&(_0x4181cb=_0x4333b5);let _0x402112=_0x4181cb,_0x5eaeca=0x2;while(_0x46ae83[_0x33763e(0x20c)](_0x402112)){_0x402112=_0x4181cb+'_'+_0x5eaeca,_0x5eaeca++;}_0x46ae83[_0x33763e(0x192)](_0x402112),_0x464f33[_0x33763e(0x1c4)](_0x3a4162,_0x402112),_0x4181cb=_0x402112;}}}const _0x5afa5b={'name':_0x4181cb,'isJourneyLocal':_0x31e2f0,'definition':_0x3388a3};return _0x5804f6[_0x33763e(0x1c4)](_0x574f2e,_0x5afa5b),_0x5afa5b;}catch(_0xf5f67e){return _0x12042a[_0x33763e(0x217)]&&console[_0x33763e(0x1cb)](_0x33763e(0x1c5)+_0x574f2e+':\x20'+_0xf5f67e[_0x33763e(0x227)]),{'name':_0x574f2e,'isJourneyLocal':![]};}},'resolveActivation':async _0x57bef8=>{const _0x320031=_0x1e483d,_0xca4e7d=_0x4e017c[_0x320031(0x238)](_0x57bef8);if(_0xca4e7d)return _0xca4e7d;try{const _0x59d1c1=await _0x1e5249[_0x320031(0x19b)]['getActivation'](_0xed64fa['id'],_0x57bef8),_0x53c68e=journeyActivationStepToYaml(_0x59d1c1,_0x11fd8f,_0x517be3),_0x14cae7=JSON['stringify']({'name':_0x53c68e[_0x320031(0x1e6)],'connection':_0x53c68e[_0x320031(0x1b0)],'connector_config':_0x53c68e[_0x320031(0x231)]}),_0x341c13=_0x414a3b[_0x320031(0x238)](_0x14cae7);if(_0x341c13){const _0x22131d={'name':_0x341c13,'isJourneyLocal':!![],'definition':_0x53c68e};return _0x4e017c[_0x320031(0x1c4)](_0x57bef8,_0x22131d),_0x22131d;}const _0x2cfcf9=_0x59d1c1[_0x320031(0x24e)]['activationParams'][_0x320031(0x1e6)]||_0x57bef8,_0x42b485=sanitizeYamlKey(_0x2cfcf9)||'activation_'+_0x57bef8;let _0x1613d8=_0x42b485,_0x16f720=0x2;while(_0x31a46c[_0x320031(0x20c)](_0x1613d8)){_0x1613d8=_0x42b485+'_'+_0x16f720,_0x16f720++;}_0x31a46c[_0x320031(0x192)](_0x1613d8),_0x414a3b[_0x320031(0x1c4)](_0x14cae7,_0x1613d8);const _0x3f8292={'name':_0x1613d8,'isJourneyLocal':!![],'definition':_0x53c68e};return _0x4e017c['set'](_0x57bef8,_0x3f8292),_0x3f8292;}catch(_0x581d2d){return _0x12042a[_0x320031(0x217)]&&console[_0x320031(0x1cb)](_0x320031(0x1b7)+_0x57bef8+':\x20'+_0x581d2d[_0x320031(0x227)]),{'name':_0x57bef8,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x55c774,_0x2eb81d)=>{const _0x5a121b=_0x1e483d;return resolveJumpTarget(_0x55c774,_0x2eb81d,_0x3af81e,_0x39a2b3=>_0x1e5249[_0x5a121b(0x19b)]['getJourney'](_0x39a2b3));}},_0x888883=await journeyResponseToDef(_0x169620,_0x293505);_0x16bc51['push']({'item':_0xed64fa,'yaml':_0x888883});}},{'verbose':_0x12042a[_0x1580c5(0x217)]});const _0x1c5ec9=buildMergedJourneyDef(_0x16bc51,_0x445e42),_0x539d3e=normalizeJourneyDef(_0x1c5ec9,_0x1fd079),_0x27c6fd=toYamlString(_0x539d3e),_0x2385fd=_0x5c00e6||a18_0x1e1181[_0x1580c5(0x1a1)](_0x3ae74e,sanitizeFileName(_0x20ff0d)+'.yml');!_0x5c00e6&&_0x1c55c3&&!existsSync(_0x3ae74e)&&mkdirSync(_0x3ae74e,{'recursive':!![]});const _0x58684a=a18_0x1e1181['relative'](process[_0x1580c5(0x200)](),_0x2385fd);if(existsSync(_0x2385fd)){const _0xe7b404=readFileSync(_0x2385fd,_0x1580c5(0x201)),_0x123a59=generateDiff(_0xe7b404,_0x27c6fd),_0x8b7704=hasChanges(_0x123a59);_0x4bd31c[_0x1580c5(0x1cd)]({'relativePath':_0x58684a,'absolutePath':_0x2385fd,'content':_0x27c6fd,'isNew':![],'hasChanges':_0x8b7704,'diff':_0x8b7704?formatDiffWithColors(_0x123a59):undefined});}else _0x4bd31c[_0x1580c5(0x1cd)]({'relativePath':_0x58684a,'absolutePath':_0x2385fd,'content':_0x27c6fd,'isNew':!![],'hasChanges':![]});}const _0x119b95=_0x4bd31c['filter'](_0x4bd095=>_0x4bd095[_0x1580c5(0x1f5)]),_0x3e5cc8=_0x4bd31c[_0x1580c5(0x214)](_0x5ef76f=>!_0x5ef76f[_0x1580c5(0x1f5)]&&_0x5ef76f[_0x1580c5(0x1ef)]),_0x4c2823=_0x4bd31c['filter'](_0x5497dd=>!_0x5497dd[_0x1580c5(0x1f5)]&&!_0x5497dd[_0x1580c5(0x1ef)]),_0x8241af=_0x551fed[_0x1580c5(0x1f7)],_0x13bcc7=_0x54099c['size'],_0x28db62=_0x8241af>_0x13bcc7?'\x20('+_0x8241af+_0x1580c5(0x19f):'';console[_0x1580c5(0x1cb)](_0x1580c5(0x245)),console[_0x1580c5(0x1cb)]('\x20\x20'+a18_0x3cde22[_0x1580c5(0x189)](_0x13bcc7+'\x20journeys')+a18_0x3cde22[_0x1580c5(0x228)](_0x28db62)),console[_0x1580c5(0x1cb)]('\x20\x20'+a18_0x3cde22[_0x1580c5(0x1a6)]('+\x20'+_0x119b95['length']+'\x20new\x20files')),console[_0x1580c5(0x1cb)]('\x20\x20'+a18_0x3cde22[_0x1580c5(0x1d9)]('~\x20'+_0x3e5cc8[_0x1580c5(0x1f7)]+'\x20changed\x20files')),console[_0x1580c5(0x1cb)]('\x20\x20'+a18_0x3cde22[_0x1580c5(0x228)]('=\x20'+_0x4c2823[_0x1580c5(0x1f7)]+_0x1580c5(0x191))),console[_0x1580c5(0x1cb)]('\x20\x20Target:\x20'+a18_0x3cde22[_0x1580c5(0x189)](_0x2e3c4e)+'\x0a');if(_0x3e5cc8[_0x1580c5(0x1f7)]>0x0)for(const _0x1ea387 of _0x3e5cc8){console[_0x1580c5(0x1cb)](_0x1580c5(0x198)+_0x1ea387[_0x1580c5(0x203)]+'\x27:'),console['error']('─'[_0x1580c5(0x247)](0x3c)),console['error'](_0x1ea387[_0x1580c5(0x1f6)]),console[_0x1580c5(0x1cb)]('─'[_0x1580c5(0x247)](0x3c));}if(_0x4ba782[_0x1580c5(0x1b3)])return console['error'](a18_0x3cde22['yellow'](_0x1580c5(0x1e4))),0x0;if(_0x119b95[_0x1580c5(0x1f7)]===0x0&&_0x3e5cc8[_0x1580c5(0x1f7)]===0x0)return console[_0x1580c5(0x1cb)](a18_0x3cde22[_0x1580c5(0x1a6)](_0x1580c5(0x236))),saveSessionContext({'parent_segment':_0x2c4b86},_0x4ba782['session']),console[_0x1580c5(0x1cb)](a18_0x3cde22['green'](_0x1580c5(0x24d)+a18_0x3cde22['dim'](_0x1580c5(0x1bd))+'\x20=\x20'+a18_0x3cde22[_0x1580c5(0x189)](_0x2c4b86))),0x0;if(!_0x4ba782[_0x1580c5(0x222)]&&(_0x119b95['length']>0x0||_0x3e5cc8[_0x1580c5(0x1f7)]>0x0)){const _0x425b9d=await confirmKey(_0x1580c5(0x235)+(_0x119b95[_0x1580c5(0x1f7)]+_0x3e5cc8[_0x1580c5(0x1f7)])+_0x1580c5(0x1c8));if(!_0x425b9d)return console[_0x1580c5(0x1cb)]('Aborted.'),0x1;}!existsSync(_0x2e3c4e)&&mkdirSync(_0x2e3c4e,{'recursive':!![]});for(const _0x4179bc of _0x4bd31c){(_0x4179bc['isNew']||_0x4179bc[_0x1580c5(0x1ef)])&&writeFileSync(_0x4179bc[_0x1580c5(0x232)],_0x4179bc[_0x1580c5(0x1ae)],'utf-8');}return console['error'](a18_0x3cde22[_0x1580c5(0x1a6)](_0x1580c5(0x207)+(_0x119b95['length']+_0x3e5cc8[_0x1580c5(0x1f7)])+_0x1580c5(0x21d)+_0x2e3c4e)),saveSessionContext({'parent_segment':_0x2c4b86},_0x4ba782[_0x1580c5(0x234)]),console[_0x1580c5(0x1cb)](a18_0x3cde22['green'](_0x1580c5(0x24d)+a18_0x3cde22[_0x1580c5(0x228)]('parent_segment')+_0x1580c5(0x1c3)+a18_0x3cde22[_0x1580c5(0x189)](_0x2c4b86))),0x0;}}export class JourneyPushCommand extends BaseCommand{[a18_0x394df7(0x1e6)]=a18_0x394df7(0x1ff);[a18_0x394df7(0x256)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a18_0x394df7(0x23a)]=new SegmentPushCommand();async[a18_0x394df7(0x1c0)](_0x1733f8){const _0x2c482f=a18_0x394df7,_0x31050d=_0x1733f8[_0x2c482f(0x210)][0x0];let _0x1adf62;if(_0x31050d){const _0x3294f1=await resolveTarget({'arg':_0x31050d,'contextParent':_0x1733f8[_0x2c482f(0x1de)]['parentSegment'],'cwd':process[_0x2c482f(0x200)]()});isSuccessfulResolution(_0x3294f1)&&_0x3294f1[_0x2c482f(0x1f2)]===_0x2c482f(0x1f4)&&(_0x1adf62=_0x3294f1[_0x2c482f(0x221)]);}const _0x6b68b8={..._0x1733f8,'options':{..._0x1733f8['options'],'journeysOnly':!![],..._0x1adf62&&{'singleFilePath':_0x1adf62}}};return this[_0x2c482f(0x23a)][_0x2c482f(0x1c0)](_0x6b68b8);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x5e1069=a19_0x1ab1;function a19_0x1ab1(_0x1fc9d8,_0x1d0b21){_0x1fc9d8=_0x1fc9d8-0x77;const _0x419cfd=a19_0x419c();let _0x1ab171=_0x419cfd[_0x1fc9d8];return _0x1ab171;}(function(_0x92b911,_0x516fdb){const _0x1395d7=a19_0x1ab1,_0x444440=_0x92b911();while(!![]){try{const _0x58acf7=-parseInt(_0x1395d7(0x80))/0x1+-parseInt(_0x1395d7(0xb0))/0x2+parseInt(_0x1395d7(0xa5))/0x3*(-parseInt(_0x1395d7(0xaf))/0x4)+-parseInt(_0x1395d7(0xa3))/0x5+-parseInt(_0x1395d7(0xa8))/0x6+parseInt(_0x1395d7(0x95))/0x7+-parseInt(_0x1395d7(0x83))/0x8*(-parseInt(_0x1395d7(0x99))/0x9);if(_0x58acf7===_0x516fdb)break;else _0x444440['push'](_0x444440['shift']());}catch(_0xb44019){_0x444440['push'](_0x444440['shift']());}}}(a19_0x419c,0x3e7e2));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a19_0x419c(){const _0xfbde50=['cyan','\x20warning(s)\x20found','2584Piuyle','743084GbRYtZ','.yaml','journey','invalidCount','warnings','execute','reason','Validate\x20journey\x20YAML\x20files','error','validCount','filter','448514syJGrJ','No\x20journey\x20YAML\x20files\x20found\x20in\x20','log','44504fIXsWq','description','type','\x20warning(s)','dim','parentSegment','endsWith','warningCount','verbose','file','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','hasErrors','errors','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','length','Validation\x20failed:\x20','name','errorCode','1176238FbziXM','\x20(skipped:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','skippedCount','3051wsRQwT','message','yellow','valid','relativePath','\x20segment\x20file(s)\x20skipped','\x20journey(s)\x20with\x20errors,\x20','\x20segment\x20file(s)\x20skipped)','green','cwd','1012540vGZVYh','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','1941lOwDuI','\x20valid','\x20journey(s)\x20valid','2144370wxqnUp','journey:validate','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20','red'];a19_0x419c=function(){return _0xfbde50;};return a19_0x419c();}import a19_0x404101 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a19_0x5e1069(0x93)]=a19_0x5e1069(0xa9);[a19_0x5e1069(0x84)]=a19_0x5e1069(0x7c);async[a19_0x5e1069(0x7a)](_0x2bb162){const _0x1be772=a19_0x5e1069,{options:_0x520265,args:_0x1ec3ca}=_0x2bb162,_0x33b11a=_0x520265,_0xd8c5fe=await resolveTarget({'arg':_0x1ec3ca[0x0],'contextParent':_0x520265[_0x1be772(0x88)],'cwd':process[_0x1be772(0xa2)]()});if(!isSuccessfulResolution(_0xd8c5fe))return _0xd8c5fe[_0x1be772(0x94)]==='no_parent'?(console['error'](a19_0x404101['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x1be772(0x90)),console[_0x1be772(0x7d)](_0x1be772(0x8d)),console[_0x1be772(0x7d)](_0x1be772(0x97))):(console[_0x1be772(0x7d)](a19_0x404101['red'](_0x1be772(0xab)+_0xd8c5fe[_0x1be772(0x9a)]+'\x0a')),_0xd8c5fe['helpText']&&console[_0x1be772(0x7d)](a19_0x404101[_0x1be772(0xad)](_0xd8c5fe['helpText']))),0x1;const _0x4525ca=_0xd8c5fe['targetDir'],_0x22c61a=_0xd8c5fe[_0x1be772(0x85)]===_0x1be772(0x8c)?_0xd8c5fe['filePath']:undefined;if(!_0x22c61a&&!existsSync(_0x4525ca))return console['error'](a19_0x404101['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x4525ca+'\x0a')),0x1;let _0x4050f2;if(_0x22c61a){if(!_0x22c61a[_0x1be772(0x89)]('.yml')&&!_0x22c61a[_0x1be772(0x89)](_0x1be772(0xb1)))return console[_0x1be772(0x7d)](a19_0x404101[_0x1be772(0xac)](_0x1be772(0xaa)+_0x22c61a+'\x0a')),0x1;_0x4050f2=[_0x22c61a];}else _0x4050f2=findYamlFiles(_0x4525ca);if(_0x4050f2['length']===0x0)return console[_0x1be772(0x7d)](a19_0x404101[_0x1be772(0xac)](_0x1be772(0xa4)+_0x4525ca+'\x0a')),0x1;const _0x23e7fa=validateYamlFiles(_0x4050f2,_0x4525ca,{'filterType':_0x1be772(0x77)}),_0x216830=calculateSummary(_0x23e7fa),_0x416493=_0x23e7fa[_0x1be772(0x7f)](isValidationResult);if(_0x416493[_0x1be772(0x91)]===0x0)return console[_0x1be772(0x7d)](a19_0x404101[_0x1be772(0x9b)](_0x1be772(0x81)+_0x4525ca+'\x0a')),_0x216830['skippedCount']>0x0&&console[_0x1be772(0x7d)](a19_0x404101[_0x1be772(0x87)]('('+_0x216830[_0x1be772(0x98)]+_0x1be772(0xa0))),0x0;for(const _0x55781f of _0x23e7fa){if(!isValidationResult(_0x55781f)){_0x33b11a['verbose']&&console['log'](a19_0x404101[_0x1be772(0x87)]('-\x20'+_0x55781f[_0x1be772(0x9d)]+_0x1be772(0x96)+_0x55781f[_0x1be772(0x7b)]+')'));continue;}const {relativePath:_0x224d6b,source:_0x1d18fd,result:_0x920880}=_0x55781f;if(_0x920880['valid']&&_0x920880[_0x1be772(0x79)]['length']===0x0)_0x33b11a[_0x1be772(0x8b)]&&console[_0x1be772(0x82)](a19_0x404101[_0x1be772(0xa1)]('✔\x20'+_0x224d6b));else _0x920880[_0x1be772(0x9c)]?(console[_0x1be772(0x82)](a19_0x404101[_0x1be772(0x9b)]('⚠\x20'+_0x224d6b+':\x20'+_0x920880[_0x1be772(0x79)][_0x1be772(0x91)]+_0x1be772(0x86))),console[_0x1be772(0x82)](formatValidationResult(_0x920880,_0x1d18fd,_0x224d6b))):(console[_0x1be772(0x82)](a19_0x404101[_0x1be772(0xac)]('✖\x20'+_0x224d6b+':\x20'+_0x920880[_0x1be772(0x8f)]['length']+'\x20error(s)')),console[_0x1be772(0x82)](formatValidationResult(_0x920880,_0x1d18fd,_0x224d6b)));}return console[_0x1be772(0x82)](''),_0x216830[_0x1be772(0x8e)]?(console['log'](a19_0x404101[_0x1be772(0xac)](_0x1be772(0x92)+_0x216830[_0x1be772(0x78)]+_0x1be772(0x9f)+_0x216830[_0x1be772(0x7e)]+_0x1be772(0xa6))),_0x216830['warningCount']>0x0&&console[_0x1be772(0x82)](a19_0x404101['yellow'](_0x216830[_0x1be772(0x8a)]+_0x1be772(0xae))),_0x216830['skippedCount']>0x0&&console[_0x1be772(0x82)](a19_0x404101['dim'](_0x216830[_0x1be772(0x98)]+_0x1be772(0x9e))),0x1):(console[_0x1be772(0x82)](a19_0x404101[_0x1be772(0xa1)]('✔\x20All\x20'+_0x216830[_0x1be772(0x7e)]+_0x1be772(0xa7))),_0x216830[_0x1be772(0x8a)]>0x0&&console[_0x1be772(0x82)](a19_0x404101['yellow'](_0x216830[_0x1be772(0x8a)]+_0x1be772(0xae))),_0x216830[_0x1be772(0x98)]>0x0&&console[_0x1be772(0x82)](a19_0x404101[_0x1be772(0x87)](_0x216830[_0x1be772(0x98)]+_0x1be772(0x9e))),0x0);}}
|