@treasuredata/tdx 2026.4.14 β 2026.4.15
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 +1 -1
- 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/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +30 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a25_0x6f718f=a25_0x4946;(function(_0x2e7f67,_0x41951b){const _0x5df441=a25_0x4946,_0x539564=_0x2e7f67();while(!![]){try{const _0x5343b5=-parseInt(_0x5df441(0x1cf))/0x1*(parseInt(_0x5df441(0x1cd))/0x2)+-parseInt(_0x5df441(0x1a1))/0x3*(parseInt(_0x5df441(0x1c6))/0x4)+parseInt(_0x5df441(0x1c8))/0x5*(parseInt(_0x5df441(0x1b7))/0x6)+parseInt(_0x5df441(0x1aa))/0x7*(parseInt(_0x5df441(0x1a6))/0x8)+parseInt(_0x5df441(0x1a5))/0x9*(parseInt(_0x5df441(0x1c7))/0xa)+parseInt(_0x5df441(0x1ad))/0xb*(parseInt(_0x5df441(0x1af))/0xc)+parseInt(_0x5df441(0x1bf))/0xd*(-parseInt(_0x5df441(0x1ac))/0xe);if(_0x5343b5===_0x41951b)break;else _0x539564['push'](_0x539564['shift']());}catch(_0x28e4a8){_0x539564['push'](_0x539564['shift']());}}}(a25_0x8fb6,0x2629e));function a25_0x8fb6(){const _0xf986e8=['execute','Validate\x20template\x20YAML\x20files','green','\x20template(s)\x20valid','19773lSUPfV','red','reason','engage:template:validate','resolve','dim','warnings','4hNGDKZ','1239220OPweFR','1420wAcnKz','\x20warning(s)\x20found','hasErrors','No\x20template\x20YAML\x20files\x20found\x20in\x20','Validation\x20failed:\x20','28AIMcxm','\x20template(s)\x20with\x20errors,\x20','20795kAXkeF','endsWith','skippedCount','546501ZJUhHU','\x20warning(s)','warningCount','name','9OXCDvr','41896HTTuJN','yellow','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','364DKEuoE','dirname','2506MJhozm','669614lTbwYh','error','48KeDDhj','validCount','verbose','relativePath','\x20non-template\x20file(s)\x20skipped','valid','\x20(skipped:\x20','log','5538qJxMMO','length','invalidCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a25_0x8fb6=function(){return _0xf986e8;};return a25_0x8fb6();}import{BaseCommand}from'./command.js';function a25_0x4946(_0x18e3d3,_0x30a9f3){_0x18e3d3=_0x18e3d3-0x19f;const _0x8fb61b=a25_0x8fb6();let _0x4946a4=_0x8fb61b[_0x18e3d3];return _0x4946a4;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x4bc9d6 from'chalk';import a25_0x455875 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x6f718f(0x1a4)]=a25_0x6f718f(0x1c2);['description']=a25_0x6f718f(0x1bc);async[a25_0x6f718f(0x1bb)](_0x14c3dd){const _0x224349=a25_0x6f718f,{options:_0x2fd546,args:_0x61415e}=_0x14c3dd,_0x50a963=_0x2fd546,_0x56c324=_0x61415e[0x0],_0x558285=_0x56c324?a25_0x455875[_0x224349(0x1c3)](_0x56c324):undefined,_0x5230bb=_0x558285?isYamlFile(_0x558285):![];let _0x19da5c,_0x566696;if(_0x5230bb&&_0x558285)_0x19da5c=a25_0x455875[_0x224349(0x1ab)](_0x558285),_0x566696=_0x558285;else _0x558285?_0x19da5c=_0x558285:_0x19da5c=process['cwd']();if(!_0x566696&&!existsSync(_0x19da5c))return console[_0x224349(0x1ae)](a25_0x4bc9d6['red'](_0x224349(0x1a8)+_0x19da5c+'\x0a')),0x1;let _0x37217a;if(_0x566696){if(!_0x566696[_0x224349(0x19f)]('.yml')&&!_0x566696['endsWith']('.yaml'))return console['error'](a25_0x4bc9d6[_0x224349(0x1c0)](_0x224349(0x1a9)+_0x566696+'\x0a')),0x1;_0x37217a=[_0x566696];}else _0x37217a=findYamlFiles(_0x19da5c);if(_0x37217a[_0x224349(0x1b8)]===0x0)return console[_0x224349(0x1ae)](a25_0x4bc9d6['red'](_0x224349(0x1ba)+_0x19da5c+'\x0a')),0x1;const _0x4cef6f=validateYamlFiles(_0x37217a,_0x19da5c,{'filterType':'template'}),_0xbb18ea=calculateSummary(_0x4cef6f),_0x18f5b3=_0x4cef6f['filter'](isValidationResult);if(_0x18f5b3[_0x224349(0x1b8)]===0x0)return console[_0x224349(0x1ae)](a25_0x4bc9d6[_0x224349(0x1a7)](_0x224349(0x1cb)+_0x19da5c+'\x0a')),_0xbb18ea[_0x224349(0x1a0)]>0x0&&console[_0x224349(0x1ae)](a25_0x4bc9d6[_0x224349(0x1c4)]('('+_0xbb18ea[_0x224349(0x1a0)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x22d8ad of _0x4cef6f){if(!isValidationResult(_0x22d8ad)){_0x50a963[_0x224349(0x1b1)]&&console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1c4)]('-\x20'+_0x22d8ad[_0x224349(0x1b2)]+_0x224349(0x1b5)+_0x22d8ad[_0x224349(0x1c1)]+')'));continue;}const {relativePath:_0xd81f05,source:_0xc6292f,result:_0x485288}=_0x22d8ad;if(_0x485288[_0x224349(0x1b4)]&&_0x485288['warnings'][_0x224349(0x1b8)]===0x0)_0x50a963['verbose']&&console[_0x224349(0x1b6)](a25_0x4bc9d6['green']('β\x20'+_0xd81f05));else _0x485288[_0x224349(0x1b4)]?(console[_0x224349(0x1b6)](a25_0x4bc9d6['yellow']('β \x20'+_0xd81f05+':\x20'+_0x485288[_0x224349(0x1c5)][_0x224349(0x1b8)]+_0x224349(0x1a2))),console[_0x224349(0x1b6)](formatValidationResult(_0x485288,_0xc6292f,_0xd81f05))):(console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1c0)]('β\x20'+_0xd81f05+':\x20'+_0x485288['errors']['length']+'\x20error(s)')),console[_0x224349(0x1b6)](formatValidationResult(_0x485288,_0xc6292f,_0xd81f05)));}return console['log'](''),_0xbb18ea[_0x224349(0x1ca)]?(console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1c0)](_0x224349(0x1cc)+_0xbb18ea[_0x224349(0x1b9)]+_0x224349(0x1ce)+_0xbb18ea[_0x224349(0x1b0)]+'\x20valid')),_0xbb18ea[_0x224349(0x1a3)]>0x0&&console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1a7)](_0xbb18ea[_0x224349(0x1a3)]+_0x224349(0x1c9))),_0xbb18ea[_0x224349(0x1a0)]>0x0&&console[_0x224349(0x1b6)](a25_0x4bc9d6['dim'](_0xbb18ea[_0x224349(0x1a0)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console['log'](a25_0x4bc9d6[_0x224349(0x1bd)]('β\x20All\x20'+_0xbb18ea[_0x224349(0x1b0)]+_0x224349(0x1be))),_0xbb18ea[_0x224349(0x1a3)]>0x0&&console[_0x224349(0x1b6)](a25_0x4bc9d6['yellow'](_0xbb18ea[_0x224349(0x1a3)]+_0x224349(0x1c9))),_0xbb18ea[_0x224349(0x1a0)]>0x0&&console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1c4)](_0xbb18ea['skippedCount']+_0x224349(0x1b3))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x3d6011=a26_0x451f;(function(_0x1e99e8,_0x337984){const _0x37b6e3=a26_0x451f,_0x1d5e6b=_0x1e99e8();while(!![]){try{const _0x996d4=-parseInt(_0x37b6e3(0x1d0))/0x1*(-parseInt(_0x37b6e3(0x1a2))/0x2)+-parseInt(_0x37b6e3(0x1dc))/0x3*(parseInt(_0x37b6e3(0x1d3))/0x4)+parseInt(_0x37b6e3(0x1bb))/0x5*(-parseInt(_0x37b6e3(0x199))/0x6)+parseInt(_0x37b6e3(0x1e1))/0x7*(parseInt(_0x37b6e3(0x19f))/0x8)+parseInt(_0x37b6e3(0x1d9))/0x9+parseInt(_0x37b6e3(0x18b))/0xa*(parseInt(_0x37b6e3(0x1b6))/0xb)+-parseInt(_0x37b6e3(0x1cf))/0xc;if(_0x996d4===_0x337984)break;else _0x1d5e6b['push'](_0x1d5e6b['shift']());}catch(_0x24b188){_0x1d5e6b['push'](_0x1d5e6b['shift']());}}}(a26_0x28d9,0xaf13d));function a26_0x28d9(){const _0x553ae8=['\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','12846987NnNsWE','job:submit','file','38715PmkDER','Submitting\x20job...','hive','result','description','6814094pylnEg','β\x20Job\x20submitted','Get\x20job\x20results','yes','Submitting\x20kill\x20request...','20eJLryq','database','red','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','dim','trino','error','presto','d\x20ago','Cancelled','round','execute','Status\x20filter:\x20','...','1558074LSZQJk','validate','Getting\x20job\x20results...','green','β\x20Retrieved\x20','join','8uMxvFR','floor','\x20jobs','1075034jpxDJN','limit','created_at','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','Database:\x20','length','status','push','log','Getting\x20job\x20details...','debug','Listing\x20jobs...','type','job:result','map','kill','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','user_name','verbose','success','3827351uiZtNw','No\x20SQL\x20statements\x20found\x20in\x20file','show','\x20job','now','15okEAHP','url','list','name','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','query','Job\x20type:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','INVALID_ARGUMENT','args','start_at','getTime','Submit\x20a\x20job','jobs','end_at','Limit:\x20','Kill\x20a\x20job','abs','data','8777820YvLfjH','1YCBFOx','job_id','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','436WjtibU','priority','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','submit','Query:\x20'];a26_0x28d9=function(){return _0x553ae8;};return a26_0x28d9();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3d985a from'chalk';function formatDuration(_0xe20bbd){const _0x3dcaa8=a26_0x451f;if(_0xe20bbd<0x3c)return _0xe20bbd+'s';if(_0xe20bbd<0xe10)return Math[_0x3dcaa8(0x1a0)](_0xe20bbd/0x3c)+'m\x20'+_0xe20bbd%0x3c+'s';const _0x4babde=Math[_0x3dcaa8(0x1a0)](_0xe20bbd/0xe10),_0x27d816=Math[_0x3dcaa8(0x1a0)](_0xe20bbd%0xe10/0x3c);return _0x27d816>0x0?_0x4babde+'h\x20'+_0x27d816+'m':_0x4babde+'h';}function formatRelativeTime(_0x482962){const _0x5e833a=a26_0x451f,_0x55de50=Date[_0x5e833a(0x1ba)]()-_0x482962[_0x5e833a(0x1c7)](),_0xc0d3d8=Math['floor'](Math[_0x5e833a(0x1cd)](_0x55de50)/0x3e8);if(_0xc0d3d8<0x3c)return'just\x20now';const _0x2087bc=Math[_0x5e833a(0x1a0)](_0xc0d3d8/0x3c);if(_0x2087bc<0x3c)return _0x2087bc+'m\x20ago';const _0x3e2cbe=Math['floor'](_0x2087bc/0x3c);if(_0x3e2cbe<0x18)return _0x3e2cbe+'h\x20ago';const _0x181116=Math[_0x5e833a(0x1a0)](_0x3e2cbe/0x18);if(_0x181116<0x1e)return _0x181116+_0x5e833a(0x193);return Math[_0x5e833a(0x1a0)](_0x181116/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x3d6011(0x1be)]=a26_0x3d6011(0x1c9);[a26_0x3d6011(0x1e0)]='List\x20jobs';async[a26_0x3d6011(0x196)](_0x352ea7){const _0x1c91b1=a26_0x3d6011,{options:_0xe51d0a,tdx:_0x147b48}=_0x352ea7,_0x1c8313=resolveLimit(_0xe51d0a[_0x1c91b1(0x1a3)],DEFAULT_DISPLAY_LIMIT),_0x2db7f3=_0xe51d0a[_0x1c91b1(0x1a8)];_0xe51d0a[_0x1c91b1(0x1b4)]&&(console[_0x1c91b1(0x191)](_0x1c91b1(0x1cb)+_0x1c8313+_0x1c91b1(0x1a1)),_0x2db7f3&&console['error'](_0x1c91b1(0x197)+_0x2db7f3));const _0x5aabf7=await withSpinner(_0x1c91b1(0x1ad),()=>_0x147b48['jobs'][_0x1c91b1(0x1bd)]({'from':0x0,'to':_0x1c8313-0x1,'status':_0x2db7f3}),{'verbose':_0xe51d0a[_0x1c91b1(0x1b4)]}),_0x40fe7e=_0x5aabf7[_0x1c91b1(0x1ce)];console[_0x1c91b1(0x191)]('β\x20Found\x20'+_0x40fe7e[_0x1c91b1(0x1a7)]+_0x1c91b1(0x1b9)+(_0x40fe7e[_0x1c91b1(0x1a7)]!==0x1?'s':''));const _0x384106=_0xe51d0a[_0x1c91b1(0x1bf)];if(isStructuredFormat(_0xe51d0a)){const _0x30c730=_0x40fe7e[_0x1c91b1(0x1b0)](_0x5d10b0=>{const _0x3fe2b1=_0x1c91b1;let _0x24c151;if(_0x5d10b0[_0x3fe2b1(0x1c6)]&&_0x5d10b0[_0x3fe2b1(0x1ca)]){const _0x2bf440=new Date(_0x5d10b0[_0x3fe2b1(0x1c6)])[_0x3fe2b1(0x1c7)](),_0x5603b0=new Date(_0x5d10b0[_0x3fe2b1(0x1ca)])['getTime']();_0x24c151=Math[_0x3fe2b1(0x195)]((_0x5603b0-_0x2bf440)/0x3e8);}return{'job_id':_0x5d10b0[_0x3fe2b1(0x1d1)],'type':_0x5d10b0[_0x3fe2b1(0x1ae)]===_0x3fe2b1(0x192)?_0x3fe2b1(0x190):_0x5d10b0[_0x3fe2b1(0x1ae)],'status':_0x5d10b0['status'],'user_name':_0x5d10b0[_0x3fe2b1(0x1b3)],'duration_sec':_0x24c151,'created_at':_0x5d10b0[_0x3fe2b1(0x1a4)],'started_at':_0x5d10b0['start_at'],'end_at':_0x5d10b0[_0x3fe2b1(0x1ca)]};});await handleSDKOutput(_0x30c730,_0xe51d0a);}else for(const _0x405045 of _0x40fe7e){const _0x5e5026=_0x405045[_0x1c91b1(0x1a8)]===_0x1c91b1(0x1b5)?a26_0x3d985a[_0x1c91b1(0x19c)]:_0x405045[_0x1c91b1(0x1a8)]===_0x1c91b1(0x191)?a26_0x3d985a[_0x1c91b1(0x18d)]:a26_0x3d985a[_0x1c91b1(0x18f)],_0x4cb222=_0x5e5026(_0x405045['status']),_0x14dd93=getJobUrl(_0x384106,_0x405045[_0x1c91b1(0x1d1)]),_0x48e0b6=hyperlink(_0x405045[_0x1c91b1(0x1d1)],_0x14dd93),_0x5d91b3=a26_0x3d985a[_0x1c91b1(0x18f)](_0x405045[_0x1c91b1(0x1ae)]===_0x1c91b1(0x192)?'trino':_0x405045[_0x1c91b1(0x1ae)]),_0x45d680=[];if(_0x405045[_0x1c91b1(0x1c6)]&&_0x405045[_0x1c91b1(0x1ca)]){const _0xee6f33=Math[_0x1c91b1(0x195)]((new Date(_0x405045[_0x1c91b1(0x1ca)])['getTime']()-new Date(_0x405045[_0x1c91b1(0x1c6)])['getTime']())/0x3e8);_0x45d680['push'](formatDuration(_0xee6f33));}if(_0x405045[_0x1c91b1(0x1ca)])_0x45d680['push'](formatRelativeTime(new Date(_0x405045[_0x1c91b1(0x1ca)])));else _0x405045[_0x1c91b1(0x1c6)]&&_0x45d680[_0x1c91b1(0x1a9)](formatRelativeTime(new Date(_0x405045[_0x1c91b1(0x1c6)])));const _0x9aa916=_0x45d680[_0x1c91b1(0x1a7)]>0x0?a26_0x3d985a[_0x1c91b1(0x18f)]('\x20'+_0x45d680[_0x1c91b1(0x19e)](',\x20')):'';console[_0x1c91b1(0x1aa)]('β‘\x20'+_0x48e0b6+'\x20'+_0x5d91b3+'\x20'+_0x4cb222+_0x9aa916);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x3d6011(0x1be)]='job:show';[a26_0x3d6011(0x1e0)]='Show\x20job\x20details';[a26_0x3d6011(0x19a)](_0x3e4a96){const _0x3b96e6=a26_0x3d6011,_0x423502=_0x3e4a96[_0x3b96e6(0x1c5)][0x0];if(!_0x423502)return _0x3b96e6(0x1b2);return undefined;}async[a26_0x3d6011(0x196)](_0x39bb43){const _0x58b661=a26_0x3d6011,{options:_0x5860a4,args:_0x3c77c8,tdx:_0x3bf2f3}=_0x39bb43,_0x376dc7=_0x3c77c8[0x0],_0xc8a9cf=await withSpinner(_0x58b661(0x1ab),()=>_0x3bf2f3[_0x58b661(0x1c9)][_0x58b661(0x1b8)](_0x376dc7),{'verbose':_0x5860a4[_0x58b661(0x1b4)]}),_0x581076=_0xc8a9cf['data'];let _0x29fc16;if(_0x581076[_0x58b661(0x1c6)]&&_0x581076['end_at']){const _0x4b190d=new Date(_0x581076[_0x58b661(0x1c6)])[_0x58b661(0x1c7)](),_0x4bd7c6=new Date(_0x581076[_0x58b661(0x1ca)])['getTime']();_0x29fc16=Math[_0x58b661(0x195)]((_0x4bd7c6-_0x4b190d)/0x3e8);}const _0x48bca0={'job_id':_0x581076['job_id'],'type':_0x581076['type'],'status':_0x581076[_0x58b661(0x1a8)],..._0x581076[_0x58b661(0x1b3)]&&{'user_name':_0x581076[_0x58b661(0x1b3)]},..._0x29fc16!==undefined&&{'duration_sec':_0x29fc16},..._0x581076[_0x58b661(0x1a4)]&&{'created_at':_0x581076['created_at']},..._0x581076[_0x58b661(0x1c6)]&&{'started_at':_0x581076['start_at']},..._0x581076['end_at']&&{'end_at':_0x581076[_0x58b661(0x1ca)]},..._0x581076[_0x58b661(0x18c)]&&{'database':_0x581076[_0x58b661(0x18c)]},..._0x581076[_0x58b661(0x1d4)]!==undefined&&{'priority':_0x581076[_0x58b661(0x1d4)]},..._0x581076[_0x58b661(0x1bc)]&&{'url':_0x581076[_0x58b661(0x1bc)]},..._0x581076['query']&&{'query':_0x581076[_0x58b661(0x1c1)]},..._0x581076[_0x58b661(0x1ac)]&&{'debug':_0x581076[_0x58b661(0x1ac)]}};return await handleSingleObjectOutput(_0x48bca0,_0x5860a4),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x3d6011(0x1be)]='job:kill';[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1cc);[a26_0x3d6011(0x19a)](_0x4ee3ba){const _0x17193c=a26_0x3d6011,_0x21fc8c=_0x4ee3ba[_0x17193c(0x1c5)][0x0];if(!_0x21fc8c)return _0x17193c(0x1c0);return undefined;}async[a26_0x3d6011(0x196)](_0x12ea32){const _0x421bb9=a26_0x3d6011,{options:_0x1dcf6d,args:_0x4e32da,tdx:_0x4bf95d}=_0x12ea32,_0x41aa50=_0x4e32da[0x0];if(!_0x1dcf6d[_0x421bb9(0x1e4)]){const _0x1acbd0=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x41aa50+'?');if(!_0x1acbd0)return console[_0x421bb9(0x191)](_0x421bb9(0x194)),0x0;}return await withSpinner(_0x421bb9(0x1e5),()=>_0x4bf95d[_0x421bb9(0x1c9)][_0x421bb9(0x1b1)](_0x41aa50),{'verbose':_0x1dcf6d['verbose']}),console[_0x421bb9(0x191)](_0x421bb9(0x1a5)+_0x41aa50),console[_0x421bb9(0x191)](_0x421bb9(0x1d8)+_0x41aa50+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}function a26_0x451f(_0x53e3a3,_0x39f9c1){_0x53e3a3=_0x53e3a3-0x18b;const _0x28d943=a26_0x28d9();let _0x451fae=_0x28d943[_0x53e3a3];return _0x451fae;}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x3d6011(0x1da);[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1c8);async[a26_0x3d6011(0x196)](_0x367e95){const _0x111a5e=a26_0x3d6011,{options:_0x5ce5f2,args:_0xe92ca6,tdx:_0x5296f6}=_0x367e95,_0x1ce1ec=_0x5ce5f2['jobType']||_0x111a5e(0x190),_0x289eee=_0x5ce5f2[_0x111a5e(0x1db)],_0x158bdb=_0x5ce5f2[_0x111a5e(0x18c)]||'information_schema',_0x1fd693=_0x5ce5f2[_0x111a5e(0x1df)];if(_0x1ce1ec!==_0x111a5e(0x190)&&_0x1ce1ec!==_0x111a5e(0x1de))throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x44744f;if(_0x289eee){if(_0xe92ca6[0x0])throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1c3));const _0xfcdbcc=readSqlStatementsFromFile(_0x289eee);if(_0xfcdbcc['length']===0x0)throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1b7));if(_0xfcdbcc[_0x111a5e(0x1a7)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x111a5e(0x1d5));_0x44744f=_0xfcdbcc[0x0];}else{if(!_0xe92ca6[0x0])throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1d2));_0x44744f=_0xe92ca6[0x0];}_0x5ce5f2[_0x111a5e(0x1b4)]&&(console[_0x111a5e(0x191)](_0x111a5e(0x1c2)+_0x1ce1ec),console['error'](_0x111a5e(0x1a6)+_0x158bdb),console[_0x111a5e(0x191)](_0x111a5e(0x1d7)+_0x44744f['substring'](0x0,0x64)+(_0x44744f[_0x111a5e(0x1a7)]>0x64?_0x111a5e(0x198):'')));const _0x576d6f=await withSpinner(_0x111a5e(0x1dd),()=>_0x5296f6[_0x111a5e(0x1c9)][_0x111a5e(0x1d6)](_0x158bdb,_0x44744f,_0x1ce1ec,_0x1fd693),{'verbose':_0x5ce5f2[_0x111a5e(0x1b4)]}),_0x43cfe5=_0x576d6f[_0x111a5e(0x1ce)];return console['error'](_0x111a5e(0x1e2)),console[_0x111a5e(0x191)]('\x20\x20Job\x20ID:\x20'+_0x43cfe5[_0x111a5e(0x1d1)]),await handleSDKOutput([_0x43cfe5],_0x5ce5f2),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x3d6011(0x1be)]=a26_0x3d6011(0x1af);[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1e3);[a26_0x3d6011(0x19a)](_0x29339e){const _0xe2b3be=a26_0x3d6011,_0x4dfb8d=_0x29339e[_0xe2b3be(0x1c5)][0x0];if(!_0x4dfb8d)return _0xe2b3be(0x18e);return undefined;}async[a26_0x3d6011(0x196)](_0x5c1c0a){const _0x20cdf7=a26_0x3d6011,{options:_0x5d2507,args:_0x3a6a84,tdx:_0x1ed9a2}=_0x5c1c0a,_0x74f128=_0x3a6a84[0x0],_0x4788db=await withSpinner(_0x20cdf7(0x19b),()=>_0x1ed9a2[_0x20cdf7(0x1c9)][_0x20cdf7(0x1df)](_0x74f128),{'verbose':_0x5d2507['verbose']}),_0x426167=_0x4788db['data'];return console[_0x20cdf7(0x191)](_0x20cdf7(0x19d)+_0x426167[_0x20cdf7(0x1a7)]+'\x20row'+(_0x426167[_0x20cdf7(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x426167,_0x5d2507),0x0;}}
|
|
1
|
+
const a26_0x1c5d7a=a26_0x15ca;(function(_0x4b9d22,_0xe53b88){const _0xdef022=a26_0x15ca,_0x20a7f5=_0x4b9d22();while(!![]){try{const _0x3a95ee=parseInt(_0xdef022(0x171))/0x1*(parseInt(_0xdef022(0x172))/0x2)+-parseInt(_0xdef022(0x1c4))/0x3*(parseInt(_0xdef022(0x196))/0x4)+parseInt(_0xdef022(0x199))/0x5+-parseInt(_0xdef022(0x181))/0x6+-parseInt(_0xdef022(0x17e))/0x7*(parseInt(_0xdef022(0x17c))/0x8)+-parseInt(_0xdef022(0x184))/0x9+parseInt(_0xdef022(0x18f))/0xa*(parseInt(_0xdef022(0x179))/0xb);if(_0x3a95ee===_0xe53b88)break;else _0x20a7f5['push'](_0x20a7f5['shift']());}catch(_0x439865){_0x20a7f5['push'](_0x20a7f5['shift']());}}}(a26_0x1667,0x2a82b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x86c6b7 from'chalk';function formatDuration(_0x17c590){const _0x102f58=a26_0x15ca;if(_0x17c590<0x3c)return _0x17c590+'s';if(_0x17c590<0xe10)return Math[_0x102f58(0x1b7)](_0x17c590/0x3c)+'m\x20'+_0x17c590%0x3c+'s';const _0x195227=Math['floor'](_0x17c590/0xe10),_0x28392a=Math['floor'](_0x17c590%0xe10/0x3c);return _0x28392a>0x0?_0x195227+'h\x20'+_0x28392a+'m':_0x195227+'h';}function formatRelativeTime(_0x41f3d1){const _0x483ff7=a26_0x15ca,_0x219781=Date[_0x483ff7(0x1ac)]()-_0x41f3d1['getTime'](),_0x5ba276=Math['floor'](Math[_0x483ff7(0x17f)](_0x219781)/0x3e8);if(_0x5ba276<0x3c)return _0x483ff7(0x198);const _0x591592=Math[_0x483ff7(0x1b7)](_0x5ba276/0x3c);if(_0x591592<0x3c)return _0x591592+_0x483ff7(0x1a2);const _0x1d8f5c=Math[_0x483ff7(0x1b7)](_0x591592/0x3c);if(_0x1d8f5c<0x18)return _0x1d8f5c+_0x483ff7(0x1be);const _0xd92733=Math['floor'](_0x1d8f5c/0x18);if(_0xd92733<0x1e)return _0xd92733+_0x483ff7(0x1a9);return Math['floor'](_0xd92733/0x1e)+'mo\x20ago';}function a26_0x15ca(_0x50e865,_0x13cfc3){_0x50e865=_0x50e865-0x16a;const _0x166737=a26_0x1667();let _0x15caf6=_0x166737[_0x50e865];return _0x15caf6;}export class JobListCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x18e);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x197);async[a26_0x1c5d7a(0x1a1)](_0x4374b5){const _0x31cd4c=a26_0x1c5d7a,{options:_0x505ddd,tdx:_0x341ca3}=_0x4374b5,_0x8d9cf=resolveLimit(_0x505ddd['limit'],DEFAULT_DISPLAY_LIMIT),_0x45ebff=_0x505ddd['status'];_0x505ddd[_0x31cd4c(0x1c0)]&&(console['error'](_0x31cd4c(0x176)+_0x8d9cf+_0x31cd4c(0x17b)),_0x45ebff&&console[_0x31cd4c(0x1ad)](_0x31cd4c(0x1b5)+_0x45ebff));const _0x4aca3a=await withSpinner(_0x31cd4c(0x1b4),()=>_0x341ca3[_0x31cd4c(0x18e)][_0x31cd4c(0x1b9)]({'from':0x0,'to':_0x8d9cf-0x1,'status':_0x45ebff}),{'verbose':_0x505ddd[_0x31cd4c(0x1c0)]}),_0x5a0054=_0x4aca3a[_0x31cd4c(0x16b)];console[_0x31cd4c(0x1ad)](_0x31cd4c(0x1c5)+_0x5a0054['length']+'\x20job'+(_0x5a0054[_0x31cd4c(0x18c)]!==0x1?'s':''));const _0x285ced=_0x505ddd[_0x31cd4c(0x187)];if(isStructuredFormat(_0x505ddd)){const _0x28ecda=_0x5a0054[_0x31cd4c(0x16e)](_0x3406cc=>{const _0x24c9ec=_0x31cd4c;let _0x3bf25b;if(_0x3406cc[_0x24c9ec(0x194)]&&_0x3406cc['end_at']){const _0x49551a=new Date(_0x3406cc[_0x24c9ec(0x194)])['getTime'](),_0x130666=new Date(_0x3406cc[_0x24c9ec(0x1a4)])[_0x24c9ec(0x1bc)]();_0x3bf25b=Math['round']((_0x130666-_0x49551a)/0x3e8);}return{'job_id':_0x3406cc[_0x24c9ec(0x1b2)],'type':_0x3406cc[_0x24c9ec(0x189)]===_0x24c9ec(0x1b3)?'trino':_0x3406cc[_0x24c9ec(0x189)],'status':_0x3406cc['status'],'user_name':_0x3406cc[_0x24c9ec(0x1aa)],'duration_sec':_0x3bf25b,'created_at':_0x3406cc[_0x24c9ec(0x1ba)],'started_at':_0x3406cc[_0x24c9ec(0x194)],'end_at':_0x3406cc[_0x24c9ec(0x1a4)]};});await handleSDKOutput(_0x28ecda,_0x505ddd);}else for(const _0x8e7357 of _0x5a0054){const _0x374810=_0x8e7357['status']==='success'?a26_0x86c6b7['green']:_0x8e7357[_0x31cd4c(0x1b6)]===_0x31cd4c(0x1ad)?a26_0x86c6b7['red']:a26_0x86c6b7['dim'],_0x430736=_0x374810(_0x8e7357[_0x31cd4c(0x1b6)]),_0x38f720=getJobUrl(_0x285ced,_0x8e7357['job_id']),_0x432556=hyperlink(_0x8e7357[_0x31cd4c(0x1b2)],_0x38f720),_0x4fcc1c=a26_0x86c6b7[_0x31cd4c(0x195)](_0x8e7357[_0x31cd4c(0x189)]===_0x31cd4c(0x1b3)?_0x31cd4c(0x1b8):_0x8e7357[_0x31cd4c(0x189)]),_0x2d42cc=[];if(_0x8e7357['start_at']&&_0x8e7357[_0x31cd4c(0x1a4)]){const _0x411254=Math[_0x31cd4c(0x170)]((new Date(_0x8e7357['end_at'])['getTime']()-new Date(_0x8e7357[_0x31cd4c(0x194)])[_0x31cd4c(0x1bc)]())/0x3e8);_0x2d42cc[_0x31cd4c(0x1c2)](formatDuration(_0x411254));}if(_0x8e7357[_0x31cd4c(0x1a4)])_0x2d42cc[_0x31cd4c(0x1c2)](formatRelativeTime(new Date(_0x8e7357[_0x31cd4c(0x1a4)])));else _0x8e7357[_0x31cd4c(0x194)]&&_0x2d42cc[_0x31cd4c(0x1c2)](formatRelativeTime(new Date(_0x8e7357[_0x31cd4c(0x194)])));const _0x3e9146=_0x2d42cc[_0x31cd4c(0x18c)]>0x0?a26_0x86c6b7[_0x31cd4c(0x195)]('\x20'+_0x2d42cc['join'](',\x20')):'';console[_0x31cd4c(0x186)]('β‘\x20'+_0x432556+'\x20'+_0x4fcc1c+'\x20'+_0x430736+_0x3e9146);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x1c5d7a(0x19a);[a26_0x1c5d7a(0x1b1)]='Show\x20job\x20details';['validate'](_0x3c7def){const _0x2ee969=a26_0x1c5d7a,_0x471a26=_0x3c7def['args'][0x0];if(!_0x471a26)return _0x2ee969(0x1a0);return undefined;}async[a26_0x1c5d7a(0x1a1)](_0x48ab9a){const _0x5dd5bb=a26_0x1c5d7a,{options:_0x555ef6,args:_0x4fa100,tdx:_0x4dae61}=_0x48ab9a,_0xffc6d8=_0x4fa100[0x0],_0x3ca7cb=await withSpinner(_0x5dd5bb(0x190),()=>_0x4dae61[_0x5dd5bb(0x18e)]['show'](_0xffc6d8),{'verbose':_0x555ef6[_0x5dd5bb(0x1c0)]}),_0x57b5d7=_0x3ca7cb[_0x5dd5bb(0x16b)];let _0x347123;if(_0x57b5d7[_0x5dd5bb(0x194)]&&_0x57b5d7[_0x5dd5bb(0x1a4)]){const _0x1f050a=new Date(_0x57b5d7[_0x5dd5bb(0x194)])[_0x5dd5bb(0x1bc)](),_0x495cb1=new Date(_0x57b5d7[_0x5dd5bb(0x1a4)])[_0x5dd5bb(0x1bc)]();_0x347123=Math['round']((_0x495cb1-_0x1f050a)/0x3e8);}const _0x5ce454={'job_id':_0x57b5d7[_0x5dd5bb(0x1b2)],'type':_0x57b5d7[_0x5dd5bb(0x189)],'status':_0x57b5d7[_0x5dd5bb(0x1b6)],..._0x57b5d7[_0x5dd5bb(0x1aa)]&&{'user_name':_0x57b5d7[_0x5dd5bb(0x1aa)]},..._0x347123!==undefined&&{'duration_sec':_0x347123},..._0x57b5d7[_0x5dd5bb(0x1ba)]&&{'created_at':_0x57b5d7[_0x5dd5bb(0x1ba)]},..._0x57b5d7['start_at']&&{'started_at':_0x57b5d7['start_at']},..._0x57b5d7[_0x5dd5bb(0x1a4)]&&{'end_at':_0x57b5d7[_0x5dd5bb(0x1a4)]},..._0x57b5d7[_0x5dd5bb(0x174)]&&{'database':_0x57b5d7[_0x5dd5bb(0x174)]},..._0x57b5d7['priority']!==undefined&&{'priority':_0x57b5d7[_0x5dd5bb(0x1bb)]},..._0x57b5d7['url']&&{'url':_0x57b5d7[_0x5dd5bb(0x16a)]},..._0x57b5d7[_0x5dd5bb(0x1a6)]&&{'query':_0x57b5d7[_0x5dd5bb(0x1a6)]},..._0x57b5d7[_0x5dd5bb(0x17a)]&&{'debug':_0x57b5d7[_0x5dd5bb(0x17a)]}};return await handleSingleObjectOutput(_0x5ce454,_0x555ef6),0x0;}}function a26_0x1667(){const _0x5d999e=['2071926VhMxIe','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','log','site','job:result','type','INVALID_ARGUMENT','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','length','Query:\x20','jobs','23990AnSgLo','Getting\x20job\x20details...','jobType','job:submit','job:kill','start_at','dim','1492nvDYUf','List\x20jobs','just\x20now','740265wCQcfa','job:show','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Kill\x20a\x20job','args','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','execute','m\x20ago','Submitting\x20job...','end_at','validate','query','hive','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','user_name','Getting\x20job\x20results...','now','error','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','Get\x20job\x20results','\x27\x20to\x20verify\x20the\x20job\x20status','description','job_id','presto','Listing\x20jobs...','Status\x20filter:\x20','status','floor','trino','list','created_at','priority','getTime','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','h\x20ago','...','verbose','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','push','β\x20Retrieved\x20','141NsHbLT','β\x20Found\x20','url','data','result','information_schema','map','kill','round','2UMRkqO','291580kunYVm','submit','database','name','Limit:\x20','Cancelled','No\x20SQL\x20statements\x20found\x20in\x20file','1650dgwIiB','debug','\x20jobs','8vuIgfl','\x20\x20Job\x20ID:\x20','1574181mLPkec','abs','file','916392xeNsMz','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Submitting\x20kill\x20request...'];a26_0x1667=function(){return _0x5d999e;};return a26_0x1667();}export class JobKillCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x193);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x19d);['validate'](_0x330b17){const _0x3b30ec=a26_0x1c5d7a,_0x57a19d=_0x330b17[_0x3b30ec(0x19e)][0x0];if(!_0x57a19d)return _0x3b30ec(0x19c);return undefined;}async['execute'](_0x53cb06){const _0x20404c=a26_0x1c5d7a,{options:_0x55b151,args:_0x59f173,tdx:_0x1492b3}=_0x53cb06,_0x2a5334=_0x59f173[0x0];if(!_0x55b151['yes']){const _0x375bcc=await confirm(_0x20404c(0x18b)+_0x2a5334+'?');if(!_0x375bcc)return console['error'](_0x20404c(0x177)),0x0;}return await withSpinner(_0x20404c(0x183),()=>_0x1492b3[_0x20404c(0x18e)][_0x20404c(0x16f)](_0x2a5334),{'verbose':_0x55b151[_0x20404c(0x1c0)]}),console[_0x20404c(0x1ad)](_0x20404c(0x1ae)+_0x2a5334),console[_0x20404c(0x1ad)](_0x20404c(0x1bd)+_0x2a5334+_0x20404c(0x1b0)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x192);[a26_0x1c5d7a(0x1b1)]='Submit\x20a\x20job';async['execute'](_0x38efcc){const _0x3d2b5a=a26_0x1c5d7a,{options:_0x3b2f82,args:_0x5a506b,tdx:_0x21f0fb}=_0x38efcc,_0x343a9b=_0x3b2f82[_0x3d2b5a(0x191)]||_0x3d2b5a(0x1b8),_0x4a776f=_0x3b2f82[_0x3d2b5a(0x180)],_0x2b068f=_0x3b2f82['database']||_0x3d2b5a(0x16d),_0xd0d2e1=_0x3b2f82[_0x3d2b5a(0x16c)];if(_0x343a9b!==_0x3d2b5a(0x1b8)&&_0x343a9b!==_0x3d2b5a(0x1a7))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3d2b5a(0x185));let _0x52f74e;if(_0x4a776f){if(_0x5a506b[0x0])throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],_0x3d2b5a(0x1a8));const _0x251f40=readSqlStatementsFromFile(_0x4a776f);if(_0x251f40[_0x3d2b5a(0x18c)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3d2b5a(0x178));if(_0x251f40[_0x3d2b5a(0x18c)]>0x1)throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x52f74e=_0x251f40[0x0];}else{if(!_0x5a506b[0x0])throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],_0x3d2b5a(0x1c1));_0x52f74e=_0x5a506b[0x0];}_0x3b2f82[_0x3d2b5a(0x1c0)]&&(console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x19f)+_0x343a9b),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x19b)+_0x2b068f),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x18d)+_0x52f74e['substring'](0x0,0x64)+(_0x52f74e[_0x3d2b5a(0x18c)]>0x64?_0x3d2b5a(0x1bf):'')));const _0x3db1ab=await withSpinner(_0x3d2b5a(0x1a3),()=>_0x21f0fb[_0x3d2b5a(0x18e)][_0x3d2b5a(0x173)](_0x2b068f,_0x52f74e,_0x343a9b,_0xd0d2e1),{'verbose':_0x3b2f82[_0x3d2b5a(0x1c0)]}),_0x1430c3=_0x3db1ab[_0x3d2b5a(0x16b)];return console['error']('β\x20Job\x20submitted'),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x17d)+_0x1430c3[_0x3d2b5a(0x1b2)]),await handleSDKOutput([_0x1430c3],_0x3b2f82),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x188);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x1af);[a26_0x1c5d7a(0x1a5)](_0x276926){const _0x22fea4=a26_0x1c5d7a,_0x376db2=_0x276926['args'][0x0];if(!_0x376db2)return _0x22fea4(0x182);return undefined;}async[a26_0x1c5d7a(0x1a1)](_0x483c04){const _0x46901e=a26_0x1c5d7a,{options:_0x201d6c,args:_0x492825,tdx:_0x3d0436}=_0x483c04,_0x3e4ca7=_0x492825[0x0],_0x1a80c8=await withSpinner(_0x46901e(0x1ab),()=>_0x3d0436['jobs'][_0x46901e(0x16c)](_0x3e4ca7),{'verbose':_0x201d6c[_0x46901e(0x1c0)]}),_0xd15f19=_0x1a80c8['data'];return console['error'](_0x46901e(0x1c3)+_0xd15f19['length']+'\x20row'+(_0xd15f19[_0x46901e(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0xd15f19,_0x201d6c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x2ff97d=a27_0x50cd;(function(_0x5a619b,_0xec379d){const _0x505315=a27_0x50cd,_0x230d70=_0x5a619b();while(!![]){try{const _0x5d92eb=-parseInt(_0x505315(0x17d))/0x1+-parseInt(_0x505315(0x1b7))/0x2+parseInt(_0x505315(0x1c6))/0x3+-parseInt(_0x505315(0x16b))/0x4*(parseInt(_0x505315(0x1dc))/0x5)+-parseInt(_0x505315(0x1c9))/0x6*(-parseInt(_0x505315(0x1ba))/0x7)+parseInt(_0x505315(0x204))/0x8*(-parseInt(_0x505315(0x267))/0x9)+-parseInt(_0x505315(0x255))/0xa*(-parseInt(_0x505315(0x1bf))/0xb);if(_0x5d92eb===_0xec379d)break;else _0x230d70['push'](_0x230d70['shift']());}catch(_0x531654){_0x230d70['push'](_0x230d70['shift']());}}}(a27_0x2f42,0x75089));import a27_0x128894 from'chalk';import a27_0x4955f1 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';function a27_0x50cd(_0x141541,_0x558fcf){_0x141541=_0x141541-0x165;const _0x2f4233=a27_0x2f42();let _0x50cdfd=_0x2f4233[_0x141541];return _0x50cdfd;}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{createTdxConfigContent}from'../sdk/segment/tdx-config.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 requireNameOrPath(_0x1555a3){const _0x5a439f=a27_0x50cd;return!_0x1555a3&&(console['error'](_0x5a439f(0x219)),console[_0x5a439f(0x23f)](_0x5a439f(0x262))),!!_0x1555a3;}function withJsonFormat(_0x25f22d){const _0x5c787b=a27_0x50cd;if(!_0x25f22d['format']&&!_0x25f22d[_0x5c787b(0x1e7)]&&!_0x25f22d[_0x5c787b(0x1d3)]&&!_0x25f22d[_0x5c787b(0x24a)])return{..._0x25f22d,'format':'json','json':!![]};return _0x25f22d;}function formatJourneyState(_0x5da3c8){const _0x163553=a27_0x50cd;switch(_0x5da3c8){case _0x163553(0x199):return a27_0x128894[_0x163553(0x233)]('(running)');case'draft':return a27_0x128894[_0x163553(0x173)](_0x163553(0x21f));case'paused':return a27_0x128894[_0x163553(0x1a3)](_0x163553(0x1ff));case'completed':return a27_0x128894[_0x163553(0x25b)]('(completed)');case'archived':return a27_0x128894[_0x163553(0x173)]('(archived)');default:return'('+_0x5da3c8+')';}}function formatJourneyItem(_0x2a8c73,_0x4001c3='',_0x36d383){const _0xb5d76f=a27_0x50cd,_0x34ca6b=formatJourneyState(_0x2a8c73['state']),_0x113adf=_0x36d383?hyperlink(_0x2a8c73[_0xb5d76f(0x1b8)],_0x36d383):_0x2a8c73['journeyBundleName'];return _0x4001c3+_0xb5d76f(0x180)+_0x113adf+'\x20'+_0x34ca6b;}function escapeRegex(_0x3ab8d6){const _0x134639=a27_0x50cd;return _0x3ab8d6['replace'](/[.*+?^${}()|[\]\\]/g,_0x134639(0x1ef));}function globToRegex(_0x3ed598){const _0x481b5d=a27_0x50cd,_0x17f402=_0x3ed598['split']('*')['map'](escapeRegex);return new RegExp(_0x17f402[_0x481b5d(0x19b)]('.*'),'i');}function buildRuleToNameMapping(_0x11fe1e){const _0x5ae3b2=a27_0x50cd,_0x1e1cb0=new Map();if(_0x11fe1e[_0x5ae3b2(0x18b)])for(const [_0x38bd63,_0x4fe00c]of Object[_0x5ae3b2(0x266)](_0x11fe1e[_0x5ae3b2(0x18b)])){if(_0x4fe00c[_0x5ae3b2(0x1f2)]){const _0x1217a1=serializeRule(_0x4fe00c[_0x5ae3b2(0x1f2)]),_0x5e2cc6=_0x1e1cb0[_0x5ae3b2(0x191)](_0x1217a1);_0x5e2cc6?_0x5e2cc6[_0x5ae3b2(0x16a)](_0x38bd63):_0x1e1cb0[_0x5ae3b2(0x222)](_0x1217a1,[_0x38bd63]);}}return _0x1e1cb0;}async function resolveJourneyIdFromInput(_0x1ba021,_0x5c64ca,_0x820038){const _0x3d8f20=a27_0x50cd,_0x458076=await resolveJourneyTarget(_0x1ba021,_0x5c64ca[_0x3d8f20(0x1f8)],_0x5c64ca[_0x3d8f20(0x237)]),_0x736fdb=_0x458076['parentSegment'];if(!_0x736fdb)throw new SDKError(ErrorCode[_0x3d8f20(0x21a)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x118b3c=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x820038['segment'][_0x3d8f20(0x1ca)](_0x736fdb),{'verbose':_0x5c64ca[_0x3d8f20(0x237)]}),_0x1a3292=_0x118b3c['data'],_0x26f067=await withSpinner('Resolving\x20journey...',()=>_0x820038[_0x3d8f20(0x1d7)]['resolveJourneyId'](_0x1a3292,_0x458076[_0x3d8f20(0x216)]),{'verbose':_0x5c64ca[_0x3d8f20(0x237)]});return{'journeyId':_0x26f067['data'],'journeyName':_0x458076[_0x3d8f20(0x216)],'parentSegmentId':_0x1a3292};}async function resolveJourneyTarget(_0x12a4dc,_0x920a78,_0x46ca57){const _0x4480e6=a27_0x50cd;if(isYamlFilePath(_0x12a4dc))try{const _0x2b30e9=await resolveYamlFilePath(_0x12a4dc);return _0x46ca57&&(console[_0x4480e6(0x23f)]('Resolved\x20YAML\x20file:\x20'+_0x12a4dc),console[_0x4480e6(0x23f)](_0x4480e6(0x195)+_0x2b30e9[_0x4480e6(0x1f8)]),console['error']('\x20\x20Name:\x20'+_0x2b30e9[_0x4480e6(0x24e)]),console[_0x4480e6(0x23f)](_0x4480e6(0x1f5)+(_0x2b30e9[_0x4480e6(0x1da)]||_0x4480e6(0x1fe)))),{'journeyName':_0x2b30e9['segmentName'],'parentSegment':_0x2b30e9['parentSegment'],'resolved':_0x2b30e9};}catch(_0xb74c47){throw new SDKError(ErrorCode[_0x4480e6(0x21a)],_0x4480e6(0x25f)+_0xb74c47[_0x4480e6(0x212)]);}if(!_0x920a78)throw new SDKError(ErrorCode[_0x4480e6(0x21a)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x12a4dc,'parentSegment':_0x920a78};}export class JourneyListCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x189);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x23d);async['execute'](_0x5115c6){const _0x285163=a27_0x2ff97d,{options:_0x10a208,args:_0x3bb6bc,tdx:_0x41552c}=_0x5115c6,_0x2b8fa4=_0x3bb6bc[0x0],_0x4de2b5=_0x10a208['parentSegment'];if(!_0x4de2b5)return console[_0x285163(0x23f)](_0x285163(0x170)),console[_0x285163(0x23f)](_0x285163(0x181)),0x1;const _0x40470d=await withSpinner(_0x285163(0x1c5),()=>_0x41552c['segment']['resolveParentId'](_0x4de2b5),{'verbose':_0x10a208['verbose']}),_0x1ead40=_0x40470d[_0x285163(0x1ed)];_0x10a208[_0x285163(0x237)]&&(console['error'](_0x285163(0x254)+_0x4de2b5+_0x285163(0x24d)+_0x1ead40+')'),_0x2b8fa4&&console[_0x285163(0x23f)](_0x285163(0x198)+_0x2b8fa4));const _0x1e3f53=await withSpinner(_0x285163(0x214),()=>_0x41552c[_0x285163(0x258)][_0x285163(0x25d)](_0x1ead40),{'verbose':_0x10a208[_0x285163(0x237)]}),_0x1550be=_0x1e3f53[_0x285163(0x1ed)],_0x20a11b=_0x1550be['rootFolderId'],_0x11d0ab=await withSpinner(_0x285163(0x1aa),()=>_0x41552c[_0x285163(0x1d7)][_0x285163(0x241)](_0x1ead40,_0x20a11b),{'verbose':_0x10a208[_0x285163(0x237)]});let _0xbe3165=_0x11d0ab[_0x285163(0x1ed)][_0x285163(0x22d)];const _0x1266eb=_0x11d0ab[_0x285163(0x1ed)]['folders'],_0x348b9c=new Map();for(const _0x31bdab of _0x1266eb){_0x348b9c[_0x285163(0x222)](_0x31bdab['id'],_0x31bdab[_0x285163(0x1e0)]);}if(_0x2b8fa4){const _0x2a72fd=globToRegex(_0x2b8fa4);_0xbe3165=_0xbe3165[_0x285163(0x168)](_0x181d23=>_0x2a72fd[_0x285163(0x1c3)](_0x181d23[_0x285163(0x1b8)]));}console[_0x285163(0x23f)](_0x285163(0x1fd)+_0xbe3165['length']+_0x285163(0x1e8)+(_0xbe3165[_0x285163(0x16c)]!==0x1?'s':''));const _0x352751=_0x29bbd9=>{const _0xec3182=_0x285163;return getConsoleNextUrl(_0x10a208[_0xec3182(0x16e)],_0xec3182(0x176)+_0x1ead40+'/e/'+_0x29bbd9+_0xec3182(0x1a5));};if(_0x10a208['format']===_0x285163(0x184))await handleSDKOutput(_0xbe3165,_0x10a208);else{if(_0x10a208[_0x285163(0x185)]===_0x285163(0x1e7)){const _0x24c126=_0xbe3165[_0x285163(0x256)](_0x983e3f=>({..._0x983e3f,'url':_0x352751(_0x983e3f['id'])}));await handleSDKOutput(_0x24c126,_0x10a208);}else{console['log']('['+_0x4de2b5+']');const _0x14d736=new Map(),_0x437566=[];for(const _0x3f228a of _0xbe3165){if(!_0x3f228a[_0x285163(0x1a6)]||_0x3f228a['folderId']===_0x20a11b)_0x437566['push'](_0x3f228a);else{const _0x141923=_0x14d736[_0x285163(0x191)](_0x3f228a[_0x285163(0x1a6)])||[];_0x141923[_0x285163(0x16a)](_0x3f228a),_0x14d736[_0x285163(0x222)](_0x3f228a[_0x285163(0x1a6)],_0x141923);}}const _0xf6d262=(_0x4bc3d7,_0x4109d3)=>_0x4bc3d7[_0x285163(0x1b8)][_0x285163(0x19f)](_0x4109d3['journeyBundleName'],undefined,{'sensitivity':_0x285163(0x172)});_0x437566[_0x285163(0x240)](_0xf6d262);for(const _0x31f9db of _0x437566){console['log'](formatJourneyItem(_0x31f9db,'',_0x352751(_0x31f9db['id'])));}const _0x1131de=[..._0x14d736['entries']()][_0x285163(0x240)]((_0x2b2de8,_0x5cee02)=>{const _0x1f5299=_0x285163,_0x1d9dd6=_0x348b9c['get'](_0x2b2de8[0x0])||_0x2b2de8[0x0],_0xa016b2=_0x348b9c['get'](_0x5cee02[0x0])||_0x5cee02[0x0];return _0x1d9dd6[_0x1f5299(0x19f)](_0xa016b2,undefined,{'sensitivity':_0x1f5299(0x172)});});for(const [_0xa501ae,_0x3999d8]of _0x1131de){const _0x56709d=_0x348b9c[_0x285163(0x191)](_0xa501ae)||_0xa501ae;console[_0x285163(0x223)](_0x285163(0x1d5)+_0x56709d),_0x3999d8[_0x285163(0x240)](_0xf6d262);for(const _0x1a9368 of _0x3999d8){console[_0x285163(0x223)](formatJourneyItem(_0x1a9368,'\x20\x20',_0x352751(_0x1a9368['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x251);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1c4);async['execute'](_0x2fc80d){const _0x2a5297=a27_0x2ff97d,{options:_0x520115,args:_0x13c196,tdx:_0x115633}=_0x2fc80d,_0x1bf9b3=_0x13c196[0x0];if(!_0x1bf9b3)return console[_0x2a5297(0x23f)](_0x2a5297(0x219)),console[_0x2a5297(0x23f)](_0x2a5297(0x220)),console[_0x2a5297(0x23f)](_0x2a5297(0x217)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x520115['verbose']&&console[_0x2a5297(0x23f)](_0x2a5297(0x23c)+_0x1bf9b3);const {journeyId:_0x4bcec6,parentSegmentId:_0x5beb21}=await resolveJourneyIdFromInput(_0x1bf9b3,_0x520115,_0x115633);if(_0x520115['web']){const _0x4d0d24=getConsoleNextUrl(_0x520115['site'],'/app/ps/'+_0x5beb21+_0x2a5297(0x23b)+_0x4bcec6+_0x2a5297(0x1b4));return console[_0x2a5297(0x23f)](a27_0x128894[_0x2a5297(0x233)]('β')+_0x2a5297(0x20a)+a27_0x128894['cyan'](_0x4d0d24)),openBrowser(_0x4d0d24),0x0;}const _0x2f8b5c=await withSpinner(_0x2a5297(0x179),()=>_0x115633[_0x2a5297(0x1d7)][_0x2a5297(0x186)](_0x4bcec6),{'verbose':_0x520115[_0x2a5297(0x237)]}),_0x4379ac=_0x2f8b5c[_0x2a5297(0x1ed)],_0x396643=_0x520115[_0x2a5297(0x201)];let _0x2e2b5f;if(_0x396643)try{const _0x36f81c=await withSpinner(_0x2a5297(0x1ea),()=>_0x115633[_0x2a5297(0x1d7)][_0x2a5297(0x245)](_0x4bcec6),{'verbose':_0x520115[_0x2a5297(0x237)]});_0x2e2b5f=_0x36f81c[_0x2a5297(0x1ed)];}catch{_0x520115['verbose']&&console[_0x2a5297(0x23f)]('\x20\x20Statistics\x20not\x20available');}const _0x41aa2a=getConsoleNextUrl(_0x520115[_0x2a5297(0x16e)],'/app/ps/'+_0x5beb21+_0x2a5297(0x23b)+_0x4bcec6+'/j/da/je'),_0x3838a0={'id':_0x4379ac['id'],'name':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x1e0)],'description':_0x4379ac['attributes'][_0x2a5297(0x1c7)],'state':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x22f)],'paused':_0x4379ac['attributes']['paused'],'reentry_mode':_0x4379ac[_0x2a5297(0x238)]['reentryMode'],'stages':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x213)]?.[_0x2a5297(0x16c)]||0x0,..._0x4379ac[_0x2a5297(0x238)]['goal']&&{'goal':_0x4379ac['attributes']['goal'][_0x2a5297(0x1e0)]},..._0x2e2b5f&&{'statistics':{'size':_0x2e2b5f[_0x2a5297(0x196)],'entered':_0x2e2b5f[_0x2a5297(0x177)],'goal_achieved':_0x2e2b5f[_0x2a5297(0x1a0)],'completion_rate':_0x2e2b5f[_0x2a5297(0x175)],'exit_or_jump':_0x2e2b5f[_0x2a5297(0x261)],'exit_or_jump_rate':_0x2e2b5f[_0x2a5297(0x187)],'stages':_0x2e2b5f['stages']}},'url':_0x41aa2a};return await handleSingleObjectOutput(_0x3838a0,_0x520115),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x2ff97d(0x1e4);['description']=a27_0x2ff97d(0x21b);async[a27_0x2ff97d(0x183)](_0x233997){const _0x3142ec=a27_0x2ff97d,{options:_0x41140f,args:_0x4d0818,tdx:_0x34acd6}=_0x233997,_0x43b907=_0x4d0818[0x0];if(!requireNameOrPath(_0x43b907))return 0x1;_0x41140f[_0x3142ec(0x237)]&&console[_0x3142ec(0x23f)](_0x3142ec(0x23c)+_0x43b907);const _0x7eae86=_0x41140f,_0x1398ac=_0x7eae86[_0x3142ec(0x24f)],_0xde4524=_0x7eae86['to'],_0x2ddf28=_0x7eae86[_0x3142ec(0x1d6)],_0x5f0a36=_0x7eae86[_0x3142ec(0x208)];_0x2ddf28&&!_0x1398ac&&!_0xde4524&&console[_0x3142ec(0x23f)](_0x3142ec(0x1ec));const _0x156de1=_0x2ddf28?withJsonFormat(_0x41140f):_0x41140f,{journeyId:_0xd9c77e,journeyName:_0x6f1d3c}=await resolveJourneyIdFromInput(_0x43b907,_0x156de1,_0x34acd6),_0x581ea0=_0x1398ac||_0xde4524?{'from':_0x1398ac,'to':_0xde4524}:undefined,_0x13a117=await withSpinner(_0x3142ec(0x1ea),()=>Promise[_0x3142ec(0x234)]([_0x34acd6[_0x3142ec(0x1d7)][_0x3142ec(0x186)](_0xd9c77e),_0x34acd6[_0x3142ec(0x1d7)]['getStatistics'](_0xd9c77e,_0x581ea0)]),{'verbose':_0x156de1[_0x3142ec(0x237)]}),[_0x3ddb60,_0x3bb7e6]=_0x13a117[_0x3142ec(0x1ed)];if(!_0x3bb7e6||_0x3bb7e6['journeyId']===null)return console[_0x3142ec(0x23f)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x6f1d3c),console[_0x3142ec(0x23f)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x3e7101=buildStageNameMap(_0x3ddb60),_0x504300=!!(_0x581ea0&&_0x3bb7e6[_0x3142ec(0x1f6)]?.[_0x3142ec(0x16c)]),_0x54b60c={'stageNameMap':_0x3e7101,'hasPeriod':_0x504300,'includeHistory':!!_0x2ddf28};if(_0x5f0a36&&_0x3bb7e6[_0x3142ec(0x1e5)]){const _0x3bac93=_0x3bb7e6[_0x3142ec(0x1e5)]['find'](_0x470630=>{const _0x161d2a=_0x3142ec,_0x486f91=_0x3e7101[_0x161d2a(0x191)](_0x470630['id'])??'';return _0x486f91[_0x161d2a(0x1be)]()===_0x5f0a36[_0x161d2a(0x1be)]();});if(_0x3bac93)return await handleSingleObjectOutput(formatStageStats(_0x3bac93,_0x54b60c),_0x156de1),0x0;const _0x19457d=_0x3bb7e6[_0x3142ec(0x1e5)][_0x3142ec(0x256)](_0x434764=>_0x3e7101[_0x3142ec(0x191)](_0x434764['id'])??_0x434764['id']);return console[_0x3142ec(0x23f)](_0x3142ec(0x1a9)+_0x5f0a36+_0x3142ec(0x227)),console[_0x3142ec(0x23f)]('Available\x20stages:\x20'+_0x19457d[_0x3142ec(0x19b)](',\x20')),0x1;}const _0xf1b966=_0x3bb7e6['stages']?.[_0x3142ec(0x256)](_0x5bdb5d=>formatStageStats(_0x5bdb5d,_0x54b60c)),_0x564563=assembleJourneyStats(_0x3bb7e6,{'from':_0x1398ac,'to':_0xde4524,'includeHistory':_0x2ddf28});return await this[_0x3142ec(0x19e)](_0x564563,_0xf1b966??[],_0x156de1),0x0;}async[a27_0x2ff97d(0x19e)](_0x30d327,_0x60bb06,_0x344366){const _0x55b144=a27_0x2ff97d,_0x1459e1=_0x344366[_0x55b144(0x185)]===_0x55b144(0x1e7)||_0x344366[_0x55b144(0x185)]===_0x55b144(0x1d3)||_0x344366[_0x55b144(0x1e7)]||_0x344366['jsonl'];if(_0x1459e1){_0x30d327[_0x55b144(0x1e5)]=_0x60bb06,await handleSingleObjectOutput(_0x30d327,_0x344366);return;}await handleSingleObjectOutput(_0x30d327,_0x344366);for(const _0x52418a of _0x60bb06){console[_0x55b144(0x223)](''),console[_0x55b144(0x223)](String(a27_0x128894[_0x55b144(0x226)][_0x55b144(0x174)]('['+_0x52418a[_0x55b144(0x1e0)]+']'))+a27_0x128894[_0x55b144(0x173)]('\x20'+_0x52418a['id']));const {id:_0x8b73bf,name:_0x1b7a9b,..._0x20a9ed}=_0x52418a;await handleSingleObjectOutput(_0x20a9ed,_0x344366);}}}export class JourneyTrafficCommand extends BaseCommand{['name']='journey:traffic';[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1d4);async[a27_0x2ff97d(0x183)](_0x329a5d){const _0x2ebc52=a27_0x2ff97d,{options:_0x4ff0fc,args:_0x2597e2,tdx:_0x52d7f8}=_0x329a5d,_0x1e4105=_0x2597e2[0x0];if(!requireNameOrPath(_0x1e4105))return 0x1;_0x4ff0fc[_0x2ebc52(0x237)]&&console[_0x2ebc52(0x23f)](_0x2ebc52(0x23c)+_0x1e4105);const _0x3237f8=_0x4ff0fc,_0xde32f3=_0x3237f8[_0x2ebc52(0x218)],_0x598283=_0x3237f8[_0x2ebc52(0x24f)],_0x19f7bc=_0x3237f8['to'],_0x5a029=_0x3237f8['limit'];if(_0xde32f3&&_0xde32f3!==_0x2ebc52(0x19c)&&_0xde32f3!==_0x2ebc52(0x20d))return console[_0x2ebc52(0x23f)](_0x2ebc52(0x25e)+_0xde32f3+_0x2ebc52(0x18a)),0x1;const _0x4a5269=withJsonFormat(_0x4ff0fc),{journeyId:_0x3687a1,journeyName:_0x1f51c6}=await resolveJourneyIdFromInput(_0x1e4105,_0x4a5269,_0x52d7f8),_0x1624fa={'type':_0xde32f3,'from':_0x598283,'to':_0x19f7bc,'limit':_0x5a029},_0xa93689=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x52d7f8[_0x2ebc52(0x1d7)][_0x2ebc52(0x263)](_0x3687a1,_0x1624fa),{'verbose':_0x4a5269[_0x2ebc52(0x237)]}),_0x2b4cbf=_0xa93689[_0x2ebc52(0x1ed)],_0x536a23=_0x2b4cbf[_0x2ebc52(0x19c)]&&(_0x2b4cbf['conversion'][_0x2ebc52(0x1b0)][_0x2ebc52(0x16c)]>0x0||_0x2b4cbf['conversion'][_0x2ebc52(0x19d)][_0x2ebc52(0x16c)]>0x0),_0x3af562=_0x2b4cbf[_0x2ebc52(0x20d)]&&_0x2b4cbf[_0x2ebc52(0x20d)]['length']>0x0;if(!_0x536a23&&!_0x3af562)return console[_0x2ebc52(0x23f)](_0x2ebc52(0x1ce)+_0x1f51c6),console[_0x2ebc52(0x23f)](_0x2ebc52(0x21d)),_0x598283&&_0x19f7bc&&console[_0x2ebc52(0x23f)](_0x2ebc52(0x207)),0x0;return await handleSingleObjectOutput(_0x2b4cbf,_0x4a5269),0x0;}}function formatStageStats(_0x331888,_0x17cf0e){const _0x4d51ac=a27_0x2ff97d,_0x651496=_0x17cf0e[_0x4d51ac(0x1b2)]&&_0x331888[_0x4d51ac(0x1f6)]?.['length']?aggregateStageHistory(_0x331888[_0x4d51ac(0x1f6)]):{'size':_0x331888[_0x4d51ac(0x196)],'entered':_0x331888[_0x4d51ac(0x177)],'milestone':_0x331888['milestoneSize'],'milestone_rate':_0x331888['completeMilestoneRate'],'exit_or_jump':_0x331888[_0x4d51ac(0x261)],'exit_or_jump_rate':_0x331888[_0x4d51ac(0x187)]},_0x5140c7={'id':_0x331888['id'],'name':_0x17cf0e[_0x4d51ac(0x1ee)][_0x4d51ac(0x191)](_0x331888['id'])??_0x331888['id'],..._0x651496};return _0x17cf0e['hasPeriod']&&_0x17cf0e[_0x4d51ac(0x1d6)]&&_0x331888[_0x4d51ac(0x1f6)]&&(_0x5140c7['history']=_0x331888['history']),_0x5140c7;}export class JourneyPauseCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x197);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1af);async[a27_0x2ff97d(0x183)](_0x3c6f86){const _0x162397=a27_0x2ff97d,{options:_0x993c91,args:_0x51272c,tdx:_0x366098}=_0x3c6f86,_0x37af60=_0x51272c[0x0];if(!requireNameOrPath(_0x37af60))return 0x1;_0x993c91[_0x162397(0x237)]&&console['error']('Input:\x20'+_0x37af60);const {journeyId:_0x4c0dc3,journeyName:_0x5694ac}=await resolveJourneyIdFromInput(_0x37af60,_0x993c91,_0x366098);if(!_0x993c91[_0x162397(0x1e2)]){const _0x34198c=await confirm(_0x162397(0x1db)+_0x5694ac+'\x22?');if(!_0x34198c)return console[_0x162397(0x23f)](_0x162397(0x236)),0x0;}const _0x553eba=await withSpinner(_0x162397(0x1e3),()=>_0x366098[_0x162397(0x1d7)][_0x162397(0x1f9)](_0x4c0dc3),{'verbose':_0x993c91[_0x162397(0x237)]}),_0x1fae85=_0x553eba[_0x162397(0x1ed)];return console[_0x162397(0x23f)](_0x162397(0x1cc)+_0x1fae85[_0x162397(0x238)][_0x162397(0x1e0)]+_0x162397(0x230)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x1bc);[a27_0x2ff97d(0x1c7)]='Resume\x20a\x20paused\x20journey';async[a27_0x2ff97d(0x183)](_0x5f51b8){const _0x228c89=a27_0x2ff97d,{options:_0x3fd457,args:_0x20417a,tdx:_0x31ff11}=_0x5f51b8,_0x3b0047=_0x20417a[0x0];if(!requireNameOrPath(_0x3b0047))return 0x1;_0x3fd457[_0x228c89(0x237)]&&console['error'](_0x228c89(0x23c)+_0x3b0047);const {journeyId:_0x3e21ed,journeyName:_0x33ac3b}=await resolveJourneyIdFromInput(_0x3b0047,_0x3fd457,_0x31ff11);if(!_0x3fd457[_0x228c89(0x1e2)]){const _0x2afd65=await confirm(_0x228c89(0x1e9)+_0x33ac3b+'\x22?');if(!_0x2afd65)return console[_0x228c89(0x23f)](_0x228c89(0x236)),0x0;}const _0x676d6a=await withSpinner(_0x228c89(0x1df),()=>_0x31ff11[_0x228c89(0x1d7)][_0x228c89(0x225)](_0x3e21ed),{'verbose':_0x3fd457[_0x228c89(0x237)]}),_0xc40a92=_0x676d6a[_0x228c89(0x1ed)];return console['error'](_0x228c89(0x1cc)+_0xc40a92[_0x228c89(0x238)][_0x228c89(0x1e0)]+_0x228c89(0x17e)),0x0;}}function a27_0x2f42(){const _0x51bfe5=['getActivation','\x20files?','\x20(ID:\x20','segmentName','from','Journey\x20name:\x20','journey:view','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journey:version:view','Parent\x20segment:\x20','1205690cHPTDR','map','Folder\x20path:\x20','segment','journeyBundleId','createdAt','blue','repeat','getParentFull','Error:\x20Invalid\x20--type\x20\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','exitOrJumpSize','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','getTrafficData','List\x20activations\x20for\x20a\x20journey','utf-8','entries','153vuWKnJ','listActivationsFlat','β\x20Pulled\x20','cwd','filter','Warning:\x20Could\x20not\x20resolve\x20segment\x20','push','324008lJOzqj','length','List\x20all\x20versions\x20of\x20a\x20journey','site','hasChanges','Error:\x20Parent\x20segment\x20context\x20required','stringify','base','dim','bold','completionRate','/app/ps/','enteredSize','-\x20no\x20files\x20written','Getting\x20journey\x20details...','activationParams','Getting\x20version\x20','\x20(draft)\x20β\x20\x22','842401wJlEjS','\x22\x20resumed','resourceName','πΊοΈ\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20journey\x20files\x20to\x20','execute','table','format','getJourney','exitOrJumpRate','Target\x20file:\x20','journey:list','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','segments','Write\x20','audienceId','Table:\x20','relativePath','buildIdToNameMap','get','Error:\x20Journey\x20\x27','segmentPushCommand','\x20\x20Target:\x20','\x20\x20Parent\x20segment:\x20','size','journey:pause','Pattern:\x20','launched','content','join','conversion','links','renderStats','localeCompare','goalSize','errorCode','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','yellow','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','/j/da','folderId','β\x20All\x20files\x20are\x20up\x20to\x20date','parent_segment','Error:\x20Stage\x20\x22','Listing\x20journeys...','\x0aChanges\x20to\x20\x27','β\x20Context\x20set:\x20','listVersions','\x20versions)','Pause\x20a\x20running\x20journey','nodes','find','hasPeriod','session','/j/da/je','relative','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','703802cfrGWr','journeyBundleName','options','3916143BgAEWv','\x20=\x20','journey:resume','versionNumber','toLowerCase','121oqNzzy','connection','Fetching\x20users\x20and\x20connections...','red','test','Show\x20journey\x20details','Resolving\x20parent\x20segment...','1747719KVJoTP','description','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','6HOxUAi','resolveParentId','listJourneysFromParentSegment','β\x20Journey\x20\x22','activation_','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','diff','\x20unchanged\x20files','reentryMode','user','jsonl','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','π\x20','includeHistory','journey','args','journeyId','folderPath','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','35deFqhb','filePath','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Resuming\x20journey...','name','file','yes','Pausing\x20journey...','journey:stats','stages','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','json','\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Getting\x20journey\x20statistics...','helpText','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','data','stageNameMap','\x5c$&','connector_config','listFolders','rule','then','Creating\x20new\x20version...','\x20\x20Folder\x20path:\x20','history','\x20\x20-\x20','parentSegment','pause','\x20journeys','isNew','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','β\x20Found\x20','(root)','(paused)','Fetching\x20','includeStats','\x20version','goal','107104KWuBGC','has','\x20->\x20','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','stage','columns','\x20Opening\x20','journey:versions','\x20\x20Journey\x20ID:\x20','activation','\x20changed\x20files','Fetching\x20journeys\x20and\x20folders...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','targetDir','message','journeyStages','Fetching\x20parent\x20segment...','\x20(rule\x20match)','journeyName','Options:','type','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','INVALID_ARGUMENT','Show\x20journey\x20statistics','journey:pull','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Error:\x20--version\x20option\x20is\x20required','(draft)','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Getting\x20column\x20mapping...','set','log','\x20\x20Consolidating\x20duplicate\x20segment:\x20','resume','cyan','\x22\x20not\x20found','No\x20journeys\x20found','Found\x20','dryRun','tdx.json','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journeys','resolveSegment','state','\x22\x20paused','.yml','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','all','journey:activations','Cancelled','verbose','attributes','Aborted.','Database:\x20','/e/','Input:\x20','List\x20journeys\x20in\x20current\x20context','journey:push','error','sort','listJourneysWithFolders','updatedAt','paused','database','getStatistics','kind','values','add','getSegment','tsv'];a27_0x2f42=function(){return _0x51bfe5;};return a27_0x2f42();}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x2ff97d(0x21c);['description']=a27_0x2ff97d(0x260);async[a27_0x2ff97d(0x183)](_0x1e61a8){const _0x3b574a=a27_0x2ff97d,{options:_0x103ab3,args:_0x7470fa,tdx:_0x39ea32}=_0x1e61a8,_0x201317=_0x103ab3,_0x167c11=_0x7470fa[0x0],_0x3a8b30=_0x167c11&&isYamlFilePath(_0x167c11),_0x148cd7=await resolveTarget({'arg':_0x3a8b30?_0x167c11:undefined,'contextParent':_0x103ab3[_0x3b574a(0x1f8)],'cwd':process[_0x3b574a(0x167)]()});if(!isSuccessfulResolution(_0x148cd7))return _0x148cd7[_0x3b574a(0x1a1)]==='no_parent'?(console['error'](a27_0x128894[_0x3b574a(0x1a3)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3b574a(0x23f)]('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['error'](_0x3b574a(0x210)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x3b574a(0x23f)](_0x3b574a(0x1b6))):(console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1c2)]('Error:\x20'+_0x148cd7['message']+'\x0a')),_0x148cd7[_0x3b574a(0x1eb)]&&console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x226)](_0x148cd7['helpText']))),0x1;let _0x158875=_0x3a8b30?undefined:_0x167c11,_0x4d4be0,_0x3b757b;_0x148cd7[_0x3b574a(0x218)]===_0x3b574a(0x1e1)&&(_0x158875=_0x148cd7[_0x3b574a(0x17f)],_0x4d4be0=_0x148cd7[_0x3b574a(0x1dd)],_0x3b757b=_0x148cd7[_0x3b574a(0x1da)]);const _0x2ea014=_0x148cd7['parentName'],_0x55b9fc=_0x148cd7[_0x3b574a(0x211)];_0x201317[_0x3b574a(0x237)]&&(console[_0x3b574a(0x23f)](_0x3b574a(0x254)+_0x2ea014),console[_0x3b574a(0x23f)]('Target\x20directory:\x20'+_0x55b9fc),_0x158875&&console[_0x3b574a(0x23f)](_0x3b574a(0x250)+_0x158875),_0x4d4be0&&console[_0x3b574a(0x23f)](_0x3b574a(0x188)+_0x4d4be0),_0x3b757b&&console[_0x3b574a(0x23f)](_0x3b574a(0x257)+_0x3b757b));const _0xba89a3=await withSpinner(_0x3b574a(0x1c5),()=>_0x39ea32['segment'][_0x3b574a(0x1ca)](_0x2ea014),{'verbose':_0x103ab3['verbose']}),_0x52ea67=_0xba89a3[_0x3b574a(0x1ed)],{journeys:_0x3c5e83,folders:_0x2cdafe}=await withSpinner(_0x3b574a(0x20f),async()=>{const _0xa34258=_0x3b574a,[_0x2d3d84,_0x7f2071]=await Promise['all']([_0x39ea32[_0xa34258(0x1d7)][_0xa34258(0x1cb)](_0x52ea67,undefined,{'includeAllVersions':!![]}),_0x39ea32[_0xa34258(0x258)][_0xa34258(0x1f1)](_0x52ea67)]);return{'journeys':_0x2d3d84,'folders':_0x7f2071};},{'verbose':_0x103ab3[_0x3b574a(0x237)]})[_0x3b574a(0x1f3)](_0x1fb0a0=>_0x1fb0a0[_0x3b574a(0x1ed)]);let _0x2a5d73=_0x3c5e83;const _0x2b1119=buildFolderIdToPathMap(_0x2cdafe);if(_0x158875){const _0x1e71d9=_0x2a5d73['filter'](_0x55babf=>_0x55babf[_0x3b574a(0x1b8)][_0x3b574a(0x1be)]()===_0x158875['toLowerCase']());if(_0x1e71d9[_0x3b574a(0x16c)]===0x0)return console[_0x3b574a(0x23f)]('Error:\x20Journey\x20not\x20found:\x20'+_0x158875),console['error'](_0x3b574a(0x1fc)),0x1;_0x2a5d73=_0x1e71d9;}if(_0x3b757b!==undefined){const _0x2e5a98=_0x2a5d73[_0x3b574a(0x168)](_0x2ec28a=>{const _0x3b2859=_0x3b574a,_0x3bd30e=_0x2ec28a[_0x3b2859(0x1a6)]?_0x2b1119['get'](_0x2ec28a['folderId'])||'':'';return _0x3bd30e===_0x3b757b;});if(_0x2e5a98['length']===0x0&&_0x2a5d73['length']>0x0){console['error'](_0x3b574a(0x192)+_0x158875+'\x27\x20not\x20found\x20in\x20'+(_0x3b757b||'root\x20folder')),console[_0x3b574a(0x23f)](_0x3b574a(0x1a2));for(const _0xdab3e1 of _0x2a5d73){const _0x42d75f=_0xdab3e1[_0x3b574a(0x1a6)]?_0x2b1119[_0x3b574a(0x191)](_0xdab3e1[_0x3b574a(0x1a6)])||'':'';console[_0x3b574a(0x23f)](_0x3b574a(0x1f7)+(_0x42d75f||_0x3b574a(0x1fe))+'/'+_0xdab3e1[_0x3b574a(0x1b8)]);}return 0x1;}_0x2a5d73=_0x2e5a98;}if(_0x2a5d73[_0x3b574a(0x16c)]===0x0)return console['error'](_0x3b574a(0x228)),0x0;const _0x425597=new Map();for(const _0x58a1e0 of _0x2a5d73){const _0x493aae=_0x58a1e0[_0x3b574a(0x259)];!_0x425597[_0x3b574a(0x205)](_0x493aae)&&_0x425597['set'](_0x493aae,[]),_0x425597[_0x3b574a(0x191)](_0x493aae)[_0x3b574a(0x16a)](_0x58a1e0);}for(const _0xa458fe of _0x425597[_0x3b574a(0x247)]()){_0xa458fe[_0x3b574a(0x240)]((_0x5a6163,_0x1b2e50)=>(_0x5a6163[_0x3b574a(0x1bd)]||0x0)-(_0x1b2e50[_0x3b574a(0x1bd)]||0x0));}const _0x35a0c2=[],{idToEmailMap:_0x31b14d,connectionIdToNameMap:_0x52bf46}=await withSpinner(_0x3b574a(0x1c1),async()=>{const _0x125656=_0x3b574a,[_0x493cc7,_0x477e39]=await Promise[_0x125656(0x234)]([_0x39ea32[_0x125656(0x1d2)]['buildIdToEmailMap'](),_0x39ea32[_0x125656(0x1c0)][_0x125656(0x190)]()]);return{'idToEmailMap':_0x493cc7,'connectionIdToNameMap':_0x477e39};},{'verbose':_0x103ab3[_0x3b574a(0x237)]})[_0x3b574a(0x1f3)](_0xa737ff=>_0xa737ff[_0x3b574a(0x1ed)]);for(const _0x20dd4e of _0x425597['values']()){const _0x3cac6e=_0x20dd4e[0x0][_0x3b574a(0x1b8)],_0x5cc789=_0x20dd4e[0x0][_0x3b574a(0x1a6)],_0xfadc2a=_0x5cc789?_0x2b1119['get'](_0x5cc789)||'':'',_0x5b382b=_0xfadc2a?a27_0x4955f1[_0x3b574a(0x19b)](_0x55b9fc,_0xfadc2a):_0x55b9fc,_0x5bafdd=_0x4d4be0||a27_0x4955f1['join'](_0x5b382b,sanitizeFileName(_0x3cac6e)+'.yml');let _0x336c05,_0x343ace;if(existsSync(_0x5bafdd))try{const _0x5429e1=readFileSync(_0x5bafdd,_0x3b574a(0x265)),_0x5bd12e=parseYamlString(_0x5429e1);_0x343ace=_0x5bd12e,_0x336c05=buildRuleToNameMapping(_0x5bd12e),_0x201317['verbose']&&_0x336c05[_0x3b574a(0x196)]>0x0&&console[_0x3b574a(0x23f)](_0x3b574a(0x229)+_0x336c05[_0x3b574a(0x196)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x3cac6e);}catch(_0x58da49){_0x201317['verbose']&&console[_0x3b574a(0x23f)](_0x3b574a(0x22c)+_0x58da49['message']);}const _0x1a1ef9=[],_0x3d8937=new Set(),_0x55d234=new Map(),_0x3a8eb0=new Map(),_0x15e001=new Set(),_0x1a61e6=new Map(),_0x33e0a5=new Map(),_0x597b6a=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x3cac6e+'...',async _0x3fb3f0=>{const _0x45e403=_0x3b574a;for(const _0xadcacc of _0x20dd4e){const _0x2db678=_0x20dd4e['length']>0x1?_0xadcacc[_0x45e403(0x1b8)]+'\x20v'+(_0xadcacc[_0x45e403(0x1bd)]||0x1):_0xadcacc[_0x45e403(0x1b8)];_0x3fb3f0['setPhase'](_0x45e403(0x200)+_0x2db678);const _0x36506d=await _0x39ea32[_0x45e403(0x1d7)][_0x45e403(0x186)](_0xadcacc['id']),_0x507782=_0x36506d['attributes']?.[_0x45e403(0x18d)],_0x1b39e0={'resolveSegment':async _0x1482b9=>{const _0x51456d=_0x45e403;if(!_0x507782)return{'name':_0x1482b9,'isJourneyLocal':![]};const _0x505244=_0x55d234[_0x51456d(0x191)](_0x1482b9);if(_0x505244)return _0x505244;try{const _0xaf4ef4=await _0x39ea32[_0x51456d(0x258)][_0x51456d(0x249)](_0x507782,_0x1482b9),_0x5b7821=_0xaf4ef4[_0x51456d(0x246)]===SEGMENT_KIND_JOURNEY;let _0x3148ce,_0x5e9160=_0xaf4ef4[_0x51456d(0x1e0)];if(_0x5b7821&&_0xaf4ef4[_0x51456d(0x1f2)]){const _0x524192=await segmentResponseToDef(_0xaf4ef4,{'resolveSegmentName':async _0x2c230a=>{const _0x227b1a=_0x51456d,_0x2c2542=_0x55d234[_0x227b1a(0x191)](_0x2c230a);if(_0x2c2542)return _0x2c2542['name'];const _0x292151=await _0x1b39e0[_0x227b1a(0x22e)](_0x2c230a);return _0x292151[_0x227b1a(0x1e0)];}}),_0xae106c=_0x524192['rule'];_0x3148ce={'description':_0xaf4ef4[_0x51456d(0x1c7)],'rule':_0xae106c};const _0x1b1b8a=serializeRule(_0xae106c),_0xdd6814=_0x3a8eb0[_0x51456d(0x191)](_0x1b1b8a);if(_0xdd6814)_0x5e9160=_0xdd6814,_0x3148ce=undefined,_0x201317['verbose']&&console[_0x51456d(0x23f)](_0x51456d(0x224)+_0xaf4ef4[_0x51456d(0x1e0)]+_0x51456d(0x206)+_0xdd6814);else{let _0x40f913=![];if(_0x336c05){const _0x3695f0=_0x336c05[_0x51456d(0x191)](_0x1b1b8a);if(_0x3695f0){const _0x257108=_0x3695f0[_0x51456d(0x1b1)](_0x38f6de=>!_0x3d8937[_0x51456d(0x205)](_0x38f6de));_0x257108&&(_0x5e9160=_0x257108,_0x3d8937[_0x51456d(0x248)](_0x257108),_0x3a8eb0['set'](_0x1b1b8a,_0x257108),_0x40f913=!![],_0x201317[_0x51456d(0x237)]&&console['error'](_0x51456d(0x1de)+_0x257108+_0x51456d(0x215)));}}if(!_0x40f913){const _0x5ac7b6=generateJourneyLocalName(_0xaf4ef4[_0x51456d(0x1e0)]);_0x5ac7b6&&(_0x5e9160=_0x5ac7b6);let _0x2f2457=_0x5e9160,_0x231012=0x2;while(_0x3d8937[_0x51456d(0x205)](_0x2f2457)){_0x2f2457=_0x5e9160+'_'+_0x231012,_0x231012++;}_0x3d8937[_0x51456d(0x248)](_0x2f2457),_0x3a8eb0[_0x51456d(0x222)](_0x1b1b8a,_0x2f2457),_0x5e9160=_0x2f2457;}}}const _0x403757={'name':_0x5e9160,'isJourneyLocal':_0x5b7821,'definition':_0x3148ce};return _0x55d234[_0x51456d(0x222)](_0x1482b9,_0x403757),_0x403757;}catch(_0x14dd09){return _0x103ab3['verbose']&&console[_0x51456d(0x23f)](_0x51456d(0x169)+_0x1482b9+':\x20'+_0x14dd09[_0x51456d(0x212)]),{'name':_0x1482b9,'isJourneyLocal':![]};}},'resolveActivation':async _0x214454=>{const _0x146ae2=_0x45e403,_0x4fb4f9=_0x1a61e6[_0x146ae2(0x191)](_0x214454);if(_0x4fb4f9)return _0x4fb4f9;try{const _0x4695d3=await _0x39ea32[_0x146ae2(0x1d7)][_0x146ae2(0x24b)](_0xadcacc['id'],_0x214454),_0x59594d=journeyActivationStepToYaml(_0x4695d3,_0x31b14d,_0x52bf46),_0x143257=JSON[_0x146ae2(0x171)]({'name':_0x59594d['name'],'connection':_0x59594d['connection'],'connector_config':_0x59594d[_0x146ae2(0x1f0)]}),_0x270f80=_0x33e0a5[_0x146ae2(0x191)](_0x143257);if(_0x270f80){const _0x5f59c9={'name':_0x270f80,'isJourneyLocal':!![],'definition':_0x59594d};return _0x1a61e6[_0x146ae2(0x222)](_0x214454,_0x5f59c9),_0x5f59c9;}const _0x23755b=_0x4695d3['attributes'][_0x146ae2(0x17a)][_0x146ae2(0x1e0)]||_0x214454,_0x1d5259=sanitizeYamlKey(_0x23755b)||_0x146ae2(0x1cd)+_0x214454;let _0x4da57a=_0x1d5259,_0x3c5a0d=0x2;while(_0x15e001[_0x146ae2(0x205)](_0x4da57a)){_0x4da57a=_0x1d5259+'_'+_0x3c5a0d,_0x3c5a0d++;}_0x15e001[_0x146ae2(0x248)](_0x4da57a),_0x33e0a5[_0x146ae2(0x222)](_0x143257,_0x4da57a);const _0x228c22={'name':_0x4da57a,'isJourneyLocal':!![],'definition':_0x59594d};return _0x1a61e6[_0x146ae2(0x222)](_0x214454,_0x228c22),_0x228c22;}catch(_0xd6be2d){return _0x103ab3[_0x146ae2(0x237)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x214454+':\x20'+_0xd6be2d['message']),{'name':_0x214454,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x4b404,_0x13ba94)=>{const _0x5896b5=_0x45e403;return resolveJumpTarget(_0x4b404,_0x13ba94,_0x597b6a,_0x10fa8a=>_0x39ea32[_0x5896b5(0x1d7)]['getJourney'](_0x10fa8a));}},_0x46efe0=await journeyResponseToDef(_0x36506d,_0x1b39e0);_0x1a1ef9[_0x45e403(0x16a)]({'item':_0xadcacc,'yaml':_0x46efe0});}},{'verbose':_0x103ab3[_0x3b574a(0x237)]});const _0x4b1ae5=await _0x39ea32['journey']['getLatestJourneyId'](_0x20dd4e[0x0][_0x3b574a(0x259)]),_0x2771d8=buildMergedJourneyDef(_0x1a1ef9,_0x336c05,_0x4b1ae5),_0x3d7ba2=normalizeJourneyDef(_0x2771d8,_0x343ace),_0x20e532=toYamlString(_0x3d7ba2),_0x24ad1b=_0x4d4be0||a27_0x4955f1[_0x3b574a(0x19b)](_0x5b382b,sanitizeFileName(_0x3cac6e)+_0x3b574a(0x231));!_0x4d4be0&&_0xfadc2a&&!existsSync(_0x5b382b)&&mkdirSync(_0x5b382b,{'recursive':!![]});const _0x1b653e=a27_0x4955f1[_0x3b574a(0x1b5)](process[_0x3b574a(0x167)](),_0x24ad1b);if(existsSync(_0x24ad1b)){const _0x552afe=readFileSync(_0x24ad1b,_0x3b574a(0x265)),_0x108cf8=generateDiff(_0x552afe,_0x20e532),_0x41d2b6=hasChanges(_0x108cf8);_0x35a0c2[_0x3b574a(0x16a)]({'relativePath':_0x1b653e,'absolutePath':_0x24ad1b,'content':_0x20e532,'isNew':![],'hasChanges':_0x41d2b6,'diff':_0x41d2b6?formatDiffWithColors(_0x108cf8):undefined});}else _0x35a0c2[_0x3b574a(0x16a)]({'relativePath':_0x1b653e,'absolutePath':_0x24ad1b,'content':_0x20e532,'isNew':!![],'hasChanges':![]});}const _0x548e3a=_0x35a0c2[_0x3b574a(0x168)](_0x218677=>_0x218677[_0x3b574a(0x1fb)]),_0x558dfd=_0x35a0c2['filter'](_0x4b5d3c=>!_0x4b5d3c[_0x3b574a(0x1fb)]&&_0x4b5d3c[_0x3b574a(0x16f)]),_0x504ce0=_0x35a0c2['filter'](_0x3e6975=>!_0x3e6975['isNew']&&!_0x3e6975[_0x3b574a(0x16f)]),_0x1c8efe=_0x2a5d73['length'],_0x4252b1=_0x425597[_0x3b574a(0x196)],_0x6d36e=_0x1c8efe>_0x4252b1?'\x20('+_0x1c8efe+_0x3b574a(0x1ae):'';console[_0x3b574a(0x23f)]('\x0aPull\x20summary:'),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894[_0x3b574a(0x226)](_0x4252b1+_0x3b574a(0x1fa))+a27_0x128894['dim'](_0x6d36e)),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894[_0x3b574a(0x233)]('+\x20'+_0x548e3a['length']+'\x20new\x20files')),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894['yellow']('~\x20'+_0x558dfd[_0x3b574a(0x16c)]+_0x3b574a(0x20e))),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894['dim']('=\x20'+_0x504ce0[_0x3b574a(0x16c)]+_0x3b574a(0x1d0))),console[_0x3b574a(0x23f)](_0x3b574a(0x194)+a27_0x128894[_0x3b574a(0x226)](_0x55b9fc)+'\x0a');if(_0x558dfd['length']>0x0)for(const _0x49bddd of _0x558dfd){console[_0x3b574a(0x23f)](_0x3b574a(0x1ab)+_0x49bddd[_0x3b574a(0x18f)]+'\x27:'),console[_0x3b574a(0x23f)]('β'['repeat'](0x3c)),console[_0x3b574a(0x23f)](_0x49bddd[_0x3b574a(0x1cf)]),console[_0x3b574a(0x23f)]('β'[_0x3b574a(0x25c)](0x3c));}if(_0x201317[_0x3b574a(0x22a)])return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1a3)](_0x3b574a(0x232))),0x0;if(_0x548e3a[_0x3b574a(0x16c)]===0x0&&_0x558dfd[_0x3b574a(0x16c)]===0x0)return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1a7))),saveSessionContext({'parent_segment':_0x2ea014},_0x201317[_0x3b574a(0x1b3)]),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1ac)+a27_0x128894['dim']('parent_segment')+'\x20=\x20'+a27_0x128894[_0x3b574a(0x226)](_0x2ea014))),0x0;if(!_0x201317['yes']&&(_0x548e3a[_0x3b574a(0x16c)]>0x0||_0x558dfd['length']>0x0)){if(!isInteractive())return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1c2)]('\x0aError:'),_0x3b574a(0x1e6)),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x173)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x90da7c=await confirmKey(_0x3b574a(0x18c)+(_0x548e3a[_0x3b574a(0x16c)]+_0x558dfd[_0x3b574a(0x16c)])+_0x3b574a(0x24c));if(!_0x90da7c)return console['error'](a27_0x128894[_0x3b574a(0x1a3)](_0x3b574a(0x239)),_0x3b574a(0x178)),0x1;}!existsSync(_0x55b9fc)&&mkdirSync(_0x55b9fc,{'recursive':!![]});const _0x2c82cd=a27_0x4955f1[_0x3b574a(0x19b)](_0x55b9fc,_0x3b574a(0x22b));writeFileSync(_0x2c82cd,createTdxConfigContent(_0x2ea014),_0x3b574a(0x265));for(const _0x34a731 of _0x35a0c2){(_0x34a731[_0x3b574a(0x1fb)]||_0x34a731['hasChanges'])&&writeFileSync(_0x34a731['absolutePath'],_0x34a731[_0x3b574a(0x19a)],_0x3b574a(0x265));}return console[_0x3b574a(0x23f)](a27_0x128894['green'](_0x3b574a(0x166)+(_0x548e3a[_0x3b574a(0x16c)]+_0x558dfd[_0x3b574a(0x16c)])+_0x3b574a(0x182)+_0x55b9fc)),saveSessionContext({'parent_segment':_0x2ea014},_0x201317[_0x3b574a(0x1b3)]),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1ac)+a27_0x128894['dim'](_0x3b574a(0x1a8))+_0x3b574a(0x1bb)+a27_0x128894['cyan'](_0x2ea014))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]='journey:columns';[a27_0x2ff97d(0x1c7)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x2ff97d(0x183)](_0x84862c){const _0x1b7fbb=a27_0x2ff97d,{options:_0x564d23,args:_0x41752d,tdx:_0x3849cb}=_0x84862c,_0x1a76d4=_0x41752d[0x0];if(!requireNameOrPath(_0x1a76d4))return 0x1;_0x564d23[_0x1b7fbb(0x237)]&&console[_0x1b7fbb(0x23f)](_0x1b7fbb(0x23c)+_0x1a76d4);const {journeyId:_0x5289db}=await resolveJourneyIdFromInput(_0x1a76d4,_0x564d23,_0x3849cb),_0x94218c=await withSpinner(_0x1b7fbb(0x221),()=>_0x3849cb[_0x1b7fbb(0x1d7)]['getColumnMapping'](_0x5289db),{'verbose':_0x564d23[_0x1b7fbb(0x237)]}),_0x4688aa=_0x94218c[_0x1b7fbb(0x1ed)];return console[_0x1b7fbb(0x223)](_0x1b7fbb(0x23a)+_0x4688aa[_0x1b7fbb(0x244)]),console[_0x1b7fbb(0x223)](_0x1b7fbb(0x18e)+_0x4688aa[_0x1b7fbb(0x184)]),await handleSDKOutput(_0x4688aa[_0x1b7fbb(0x209)],_0x564d23),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x235);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x264);async[a27_0x2ff97d(0x183)](_0x1b254f){const _0x3e67fe=a27_0x2ff97d,{options:_0x1ea7a8,args:_0x17c6d7,tdx:_0x6f959f}=_0x1b254f,_0xa8e0a=_0x17c6d7[0x0];if(!requireNameOrPath(_0xa8e0a))return 0x1;_0x1ea7a8[_0x3e67fe(0x237)]&&console['error']('Input:\x20'+_0xa8e0a);const {journeyId:_0x4be0db}=await resolveJourneyIdFromInput(_0xa8e0a,_0x1ea7a8,_0x6f959f),_0x4adc61=await withSpinner('Listing\x20journey\x20activations...',()=>_0x6f959f[_0x3e67fe(0x1d7)][_0x3e67fe(0x165)](_0x4be0db),{'verbose':_0x1ea7a8[_0x3e67fe(0x237)]}),_0x27cb70=_0x4adc61['data'];return console[_0x3e67fe(0x23f)]('Found\x20'+_0x27cb70[_0x3e67fe(0x16c)]+'\x20activation'+(_0x27cb70[_0x3e67fe(0x16c)]!==0x1?'s':'')),await handleSDKOutput(_0x27cb70,_0x1ea7a8),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x23e);['description']=a27_0x2ff97d(0x1a4);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0xea7217){const _0x17bbc9=a27_0x2ff97d,_0xf52eee=_0xea7217[_0x17bbc9(0x1d8)][0x0];let _0x212a9d;if(_0xf52eee){const _0x568684=await resolveTarget({'arg':_0xf52eee,'contextParent':_0xea7217[_0x17bbc9(0x1b9)][_0x17bbc9(0x1f8)],'cwd':process[_0x17bbc9(0x167)]()});isSuccessfulResolution(_0x568684)&&_0x568684[_0x17bbc9(0x218)]==='file'&&(_0x212a9d=_0x568684['filePath']);}const _0x239f7c={..._0xea7217,'options':{..._0xea7217['options'],'journeysOnly':!![],..._0x212a9d&&{'singleFilePath':_0x212a9d}}};return this[_0x17bbc9(0x193)][_0x17bbc9(0x183)](_0x239f7c);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x20b);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x16d);async[a27_0x2ff97d(0x183)](_0x34aaa2){const _0xbb1a3c=a27_0x2ff97d,{options:_0x1b1701,args:_0x66c221,tdx:_0x171819}=_0x34aaa2,_0x3d2095=_0x66c221[0x0];if(!requireNameOrPath(_0x3d2095))return 0x1;if(_0x1b1701[_0xbb1a3c(0x237)])console[_0xbb1a3c(0x23f)]('Input:\x20'+_0x3d2095);const {journeyId:_0x9348f9}=await resolveJourneyIdFromInput(_0x3d2095,_0x1b1701,_0x171819),_0x4deba2=await withSpinner('Listing\x20journey\x20versions...',()=>_0x171819[_0xbb1a3c(0x1d7)][_0xbb1a3c(0x1ad)](_0x9348f9),{'verbose':_0x1b1701[_0xbb1a3c(0x237)]}),{bundleName:_0xdb9179,versions:_0x44260f,latestJourneyId:_0x1b083b}=_0x4deba2[_0xbb1a3c(0x1ed)];console[_0xbb1a3c(0x23f)](_0xdb9179+':\x20'+_0x44260f[_0xbb1a3c(0x16c)]+_0xbb1a3c(0x202)+(_0x44260f[_0xbb1a3c(0x16c)]!==0x1?'s':''));const _0x25cf82=_0x44260f['map'](_0x4d8931=>({'version':_0x4d8931[_0xbb1a3c(0x1bd)],'journey_id':_0x4d8931[_0xbb1a3c(0x1d9)],'name':_0x4d8931[_0xbb1a3c(0x1e0)],'state':_0x4d8931[_0xbb1a3c(0x22f)],'paused':_0x4d8931[_0xbb1a3c(0x243)],'latest':_0x4d8931[_0xbb1a3c(0x1d9)]===_0x1b083b,'created_at':_0x4d8931[_0xbb1a3c(0x25a)]}));return await handleSDKOutput(_0x25cf82,_0x1b1701),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]='journey:version:create';['description']=a27_0x2ff97d(0x1c8);async[a27_0x2ff97d(0x183)](_0x102e59){const _0x11e246=a27_0x2ff97d,{options:_0x37da5a,args:_0x34b852,tdx:_0x2fbfd3}=_0x102e59,_0x62ae68=_0x34b852[0x0];if(!requireNameOrPath(_0x62ae68))return 0x1;if(_0x37da5a[_0x11e246(0x237)])console[_0x11e246(0x23f)](_0x11e246(0x23c)+_0x62ae68);const {journeyId:_0x80b503,journeyName:_0x1e2777}=await resolveJourneyIdFromInput(_0x62ae68,_0x37da5a,_0x2fbfd3);if(!_0x37da5a[_0x11e246(0x1e2)]){const _0x394bc7=await confirm(_0x11e246(0x252)+_0x1e2777+'\x22?');if(!_0x394bc7)return console[_0x11e246(0x23f)]('Cancelled'),0x0;}const _0x1dcf17=await withSpinner(_0x11e246(0x1f4),()=>_0x2fbfd3['journey']['createVersion'](_0x80b503),{'verbose':_0x37da5a['verbose']}),_0x3477e0=_0x1dcf17[_0x11e246(0x1ed)];return console[_0x11e246(0x23f)](a27_0x128894[_0x11e246(0x233)]('β')+'\x20Created\x20v'+_0x3477e0[_0x11e246(0x238)][_0x11e246(0x1bd)]+_0x11e246(0x17c)+_0x3477e0[_0x11e246(0x238)]['name']+'\x22'),console[_0x11e246(0x23f)](_0x11e246(0x20c)+_0x3477e0['id']),await handleSingleObjectOutput({'id':_0x3477e0['id'],'name':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x1e0)],'version':_0x3477e0['attributes'][_0x11e246(0x1bd)],'state':_0x3477e0['attributes'][_0x11e246(0x22f)],'bundle_id':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x259)],'created_at':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x25a)]},_0x37da5a),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x253);[a27_0x2ff97d(0x1c7)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x2ff97d(0x183)](_0x342d52){const _0x24d6cc=a27_0x2ff97d,{options:_0x2eef61,args:_0x52433b,tdx:_0x520cad}=_0x342d52,_0x1dbee7=_0x52433b[0x0];if(!requireNameOrPath(_0x1dbee7))return 0x1;const _0x1470f3=_0x2eef61['version'];if(!_0x1470f3)return console['error'](_0x24d6cc(0x21e)),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x5dbb0b=parseInt(_0x1470f3,0xa);if(isNaN(_0x5dbb0b)||_0x5dbb0b<0x1)return console[_0x24d6cc(0x23f)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x1470f3),0x1;if(_0x2eef61[_0x24d6cc(0x237)])console[_0x24d6cc(0x23f)](_0x24d6cc(0x23c)+_0x1dbee7+',\x20version:\x20'+_0x5dbb0b);const {journeyId:_0x4d8573,parentSegmentId:_0xfd7dea}=await resolveJourneyIdFromInput(_0x1dbee7,_0x2eef61,_0x520cad),_0x3b7aed=await withSpinner('Resolving\x20version...',()=>_0x520cad[_0x24d6cc(0x1d7)][_0x24d6cc(0x1ad)](_0x4d8573),{'verbose':_0x2eef61['verbose']}),{versions:_0x583b40,latestJourneyId:_0xead98f}=_0x3b7aed['data'],_0x39b22f=_0x583b40[_0x24d6cc(0x1b1)](_0x2e5099=>_0x2e5099[_0x24d6cc(0x1bd)]===_0x5dbb0b);if(!_0x39b22f){const _0x4e68f4=_0x583b40['map'](_0x204ef7=>'v'+_0x204ef7[_0x24d6cc(0x1bd)])[_0x24d6cc(0x19b)](',\x20');return console['error']('Error:\x20Version\x20'+_0x5dbb0b+'\x20not\x20found.\x20Available:\x20'+_0x4e68f4),0x1;}const _0x201960=await withSpinner(_0x24d6cc(0x17b)+_0x5dbb0b+'\x20details...',()=>_0x520cad[_0x24d6cc(0x1d7)][_0x24d6cc(0x186)](_0x39b22f['journeyId']),{'verbose':_0x2eef61['verbose']}),_0x570e50=_0x201960[_0x24d6cc(0x1ed)],_0x5caffe=getConsoleNextUrl(_0x2eef61[_0x24d6cc(0x16e)],_0x24d6cc(0x176)+_0xfd7dea+_0x24d6cc(0x23b)+_0x39b22f['journeyId']+_0x24d6cc(0x1b4));return await handleSingleObjectOutput({'id':_0x570e50['id'],'name':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1e0)],'version':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1bd)],'description':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1c7)],'state':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x22f)],'paused':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x243)],'reentry_mode':_0x570e50['attributes'][_0x24d6cc(0x1d1)],'stages':_0x570e50[_0x24d6cc(0x238)]['journeyStages']?.[_0x24d6cc(0x16c)]||0x0,..._0x570e50[_0x24d6cc(0x238)]['goal']&&{'goal':_0x570e50['attributes'][_0x24d6cc(0x203)]['name']},'latest':_0x39b22f[_0x24d6cc(0x1d9)]===_0xead98f,'created_at':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x25a)],'updated_at':_0x570e50['attributes'][_0x24d6cc(0x242)],'url':_0x5caffe},_0x2eef61),0x0;}}
|
|
1
|
+
const a27_0x57c5c2=a27_0x3061;(function(_0x353b19,_0x2ea4d8){const _0x4226bc=a27_0x3061,_0x35b484=_0x353b19();while(!![]){try{const _0x409cec=-parseInt(_0x4226bc(0x161))/0x1+parseInt(_0x4226bc(0x1a4))/0x2+parseInt(_0x4226bc(0x1e4))/0x3*(parseInt(_0x4226bc(0x1b6))/0x4)+-parseInt(_0x4226bc(0x1de))/0x5+-parseInt(_0x4226bc(0x1b0))/0x6*(parseInt(_0x4226bc(0x155))/0x7)+-parseInt(_0x4226bc(0x190))/0x8*(-parseInt(_0x4226bc(0x189))/0x9)+-parseInt(_0x4226bc(0x1a0))/0xa*(parseInt(_0x4226bc(0x208))/0xb);if(_0x409cec===_0x2ea4d8)break;else _0x35b484['push'](_0x35b484['shift']());}catch(_0x2d0412){_0x35b484['push'](_0x35b484['shift']());}}}(a27_0x4d3e,0x830d9));import a27_0x53b983 from'chalk';import a27_0xbd78d4 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}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';function a27_0x3061(_0x2aa08c,_0x212af5){_0x2aa08c=_0x2aa08c-0x10e;const _0x4d3e7b=a27_0x4d3e();let _0x306117=_0x4d3e7b[_0x2aa08c];return _0x306117;}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{createTdxConfigContent}from'../sdk/segment/tdx-config.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 requireNameOrPath(_0x400980){const _0x1a4da3=a27_0x3061;return!_0x400980&&(console['error'](_0x1a4da3(0x225)),console[_0x1a4da3(0x12a)](_0x1a4da3(0x135))),!!_0x400980;}function withJsonFormat(_0x1aabda){const _0x466548=a27_0x3061;if(!_0x1aabda[_0x466548(0x13a)]&&!_0x1aabda['json']&&!_0x1aabda[_0x466548(0x15a)]&&!_0x1aabda[_0x466548(0x146)])return{..._0x1aabda,'format':_0x466548(0x1ab),'json':!![]};return _0x1aabda;}function formatJourneyState(_0x2cfc7a){const _0x4b02b8=a27_0x3061;switch(_0x2cfc7a){case _0x4b02b8(0x1c9):return a27_0x53b983['green'](_0x4b02b8(0x140));case _0x4b02b8(0x16e):return a27_0x53b983[_0x4b02b8(0x1ef)](_0x4b02b8(0x19f));case _0x4b02b8(0x117):return a27_0x53b983['yellow'](_0x4b02b8(0x151));case _0x4b02b8(0x1c4):return a27_0x53b983[_0x4b02b8(0x1f6)]('(completed)');case _0x4b02b8(0x205):return a27_0x53b983[_0x4b02b8(0x1ef)](_0x4b02b8(0x1d1));default:return'('+_0x2cfc7a+')';}}function formatJourneyItem(_0x15257d,_0x2039a1='',_0x25b05e){const _0x154bae=a27_0x3061,_0x52845d=formatJourneyState(_0x15257d[_0x154bae(0x181)]),_0x2ab5c3=_0x25b05e?hyperlink(_0x15257d[_0x154bae(0x1bc)],_0x25b05e):_0x15257d['journeyBundleName'];return _0x2039a1+_0x154bae(0x129)+_0x2ab5c3+'\x20'+_0x52845d;}function escapeRegex(_0xea1849){const _0x1b2929=a27_0x3061;return _0xea1849[_0x1b2929(0x19b)](/[.*+?^${}()|[\]\\]/g,_0x1b2929(0x1d4));}function globToRegex(_0x3beb16){const _0x24c94c=a27_0x3061,_0x2c2e4c=_0x3beb16['split']('*')[_0x24c94c(0x197)](escapeRegex);return new RegExp(_0x2c2e4c[_0x24c94c(0x18a)]('.*'),'i');}function buildRuleToNameMapping(_0x36b52b){const _0x5a7fee=a27_0x3061,_0x518afd=new Map();if(_0x36b52b[_0x5a7fee(0x152)])for(const [_0x66af5,_0x35c156]of Object[_0x5a7fee(0x1cf)](_0x36b52b[_0x5a7fee(0x152)])){if(_0x35c156[_0x5a7fee(0x1aa)]){const _0x358ca3=serializeRule(_0x35c156[_0x5a7fee(0x1aa)]),_0x1dc69d=_0x518afd[_0x5a7fee(0x1f3)](_0x358ca3);_0x1dc69d?_0x1dc69d[_0x5a7fee(0x222)](_0x66af5):_0x518afd[_0x5a7fee(0x20c)](_0x358ca3,[_0x66af5]);}}return _0x518afd;}async function resolveJourneyIdFromInput(_0x8061d3,_0x10d10d,_0x5e376c){const _0x5ca70f=a27_0x3061,_0x2f3e49=await resolveJourneyTarget(_0x8061d3,_0x10d10d[_0x5ca70f(0x1e8)],_0x10d10d[_0x5ca70f(0x128)]),_0x17cac3=_0x2f3e49[_0x5ca70f(0x1e8)];if(!_0x17cac3)throw new SDKError(ErrorCode[_0x5ca70f(0x165)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x291369=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x5e376c[_0x5ca70f(0x17c)][_0x5ca70f(0x142)](_0x17cac3),{'verbose':_0x10d10d[_0x5ca70f(0x128)]}),_0x3c6500=_0x291369[_0x5ca70f(0x125)],_0x12ecc9=await withSpinner(_0x5ca70f(0x1bf),()=>_0x5e376c[_0x5ca70f(0x17b)][_0x5ca70f(0x1d0)](_0x3c6500,_0x2f3e49['journeyName']),{'verbose':_0x10d10d[_0x5ca70f(0x128)]});return{'journeyId':_0x12ecc9[_0x5ca70f(0x125)],'journeyName':_0x2f3e49['journeyName'],'parentSegmentId':_0x3c6500};}async function resolveJourneyTarget(_0x3dd537,_0x52b46f,_0x4ca208){const _0x433aec=a27_0x3061;if(isYamlFilePath(_0x3dd537))try{const _0x1a1374=await resolveYamlFilePath(_0x3dd537);return _0x4ca208&&(console[_0x433aec(0x12a)](_0x433aec(0x176)+_0x3dd537),console[_0x433aec(0x12a)](_0x433aec(0x1e1)+_0x1a1374[_0x433aec(0x1e8)]),console[_0x433aec(0x12a)](_0x433aec(0x1ad)+_0x1a1374['segmentName']),console[_0x433aec(0x12a)](_0x433aec(0x1f0)+(_0x1a1374[_0x433aec(0x124)]||_0x433aec(0x206)))),{'journeyName':_0x1a1374[_0x433aec(0x182)],'parentSegment':_0x1a1374[_0x433aec(0x1e8)],'resolved':_0x1a1374};}catch(_0x2f446d){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x433aec(0x11b)+_0x2f446d[_0x433aec(0x1ae)]);}if(!_0x52b46f)throw new SDKError(ErrorCode[_0x433aec(0x165)],_0x433aec(0x224));return{'journeyName':_0x3dd537,'parentSegment':_0x52b46f};}export class JourneyListCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1ed);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x1ac);async['execute'](_0x56fb3d){const _0x2b4266=a27_0x57c5c2,{options:_0x395e8b,args:_0x48ea4b,tdx:_0x438dd4}=_0x56fb3d,_0x5a55b6=_0x48ea4b[0x0],_0x4e7c30=_0x395e8b['parentSegment'];if(!_0x4e7c30)return console['error'](_0x2b4266(0x112)),console[_0x2b4266(0x12a)](_0x2b4266(0x1f5)),0x1;const _0x420108=await withSpinner(_0x2b4266(0x170),()=>_0x438dd4[_0x2b4266(0x17c)]['resolveParentId'](_0x4e7c30),{'verbose':_0x395e8b[_0x2b4266(0x128)]}),_0x84c4eb=_0x420108['data'];_0x395e8b[_0x2b4266(0x128)]&&(console[_0x2b4266(0x12a)](_0x2b4266(0x15f)+_0x4e7c30+_0x2b4266(0x1c3)+_0x84c4eb+')'),_0x5a55b6&&console[_0x2b4266(0x12a)]('Pattern:\x20'+_0x5a55b6));const _0x9f633=await withSpinner(_0x2b4266(0x114),()=>_0x438dd4[_0x2b4266(0x17c)][_0x2b4266(0x10e)](_0x84c4eb),{'verbose':_0x395e8b['verbose']}),_0x30fc09=_0x9f633[_0x2b4266(0x125)],_0x4d71af=_0x30fc09[_0x2b4266(0x175)],_0x45f84a=await withSpinner(_0x2b4266(0x186),()=>_0x438dd4[_0x2b4266(0x17b)][_0x2b4266(0x1ca)](_0x84c4eb,_0x4d71af),{'verbose':_0x395e8b[_0x2b4266(0x128)]});let _0x558964=_0x45f84a[_0x2b4266(0x125)][_0x2b4266(0x13e)];const _0x39c1ca=_0x45f84a['data'][_0x2b4266(0x15d)],_0x238a97=new Map();for(const _0x43d8d3 of _0x39c1ca){_0x238a97[_0x2b4266(0x20c)](_0x43d8d3['id'],_0x43d8d3[_0x2b4266(0x1c8)]);}if(_0x5a55b6){const _0x5bdb70=globToRegex(_0x5a55b6);_0x558964=_0x558964[_0x2b4266(0x1f4)](_0x255f90=>_0x5bdb70[_0x2b4266(0x171)](_0x255f90[_0x2b4266(0x1bc)]));}console[_0x2b4266(0x12a)](_0x2b4266(0x144)+_0x558964[_0x2b4266(0x157)]+_0x2b4266(0x19c)+(_0x558964[_0x2b4266(0x157)]!==0x1?'s':''));const _0x4280c1=_0x37f7ef=>{const _0x14c185=_0x2b4266;return getConsoleNextUrl(_0x395e8b['site'],_0x14c185(0x1ff)+_0x84c4eb+_0x14c185(0x18f)+_0x37f7ef+'/j/da');};if(_0x395e8b[_0x2b4266(0x13a)]===_0x2b4266(0x118))await handleSDKOutput(_0x558964,_0x395e8b);else{if(_0x395e8b[_0x2b4266(0x13a)]===_0x2b4266(0x1ab)){const _0x74a83e=_0x558964['map'](_0x51442c=>({..._0x51442c,'url':_0x4280c1(_0x51442c['id'])}));await handleSDKOutput(_0x74a83e,_0x395e8b);}else{console['log']('['+_0x4e7c30+']');const _0x179d3a=new Map(),_0x811f14=[];for(const _0x3e3ead of _0x558964){if(!_0x3e3ead[_0x2b4266(0x17a)]||_0x3e3ead[_0x2b4266(0x17a)]===_0x4d71af)_0x811f14[_0x2b4266(0x222)](_0x3e3ead);else{const _0x55c6f3=_0x179d3a['get'](_0x3e3ead[_0x2b4266(0x17a)])||[];_0x55c6f3['push'](_0x3e3ead),_0x179d3a[_0x2b4266(0x20c)](_0x3e3ead['folderId'],_0x55c6f3);}}const _0x336f5a=(_0xb7ad42,_0x361a09)=>_0xb7ad42[_0x2b4266(0x1bc)][_0x2b4266(0x134)](_0x361a09[_0x2b4266(0x1bc)],undefined,{'sensitivity':_0x2b4266(0x14c)});_0x811f14[_0x2b4266(0x1cd)](_0x336f5a);for(const _0x56b7be of _0x811f14){console[_0x2b4266(0x200)](formatJourneyItem(_0x56b7be,'',_0x4280c1(_0x56b7be['id'])));}const _0x4e5507=[..._0x179d3a[_0x2b4266(0x1cf)]()]['sort']((_0x40f155,_0x5df531)=>{const _0x33a12d=_0x2b4266,_0x254a3b=_0x238a97[_0x33a12d(0x1f3)](_0x40f155[0x0])||_0x40f155[0x0],_0x4ae699=_0x238a97['get'](_0x5df531[0x0])||_0x5df531[0x0];return _0x254a3b[_0x33a12d(0x134)](_0x4ae699,undefined,{'sensitivity':_0x33a12d(0x14c)});});for(const [_0x1ca67e,_0x54dc15]of _0x4e5507){const _0x294263=_0x238a97[_0x2b4266(0x1f3)](_0x1ca67e)||_0x1ca67e;console[_0x2b4266(0x200)](_0x2b4266(0x1bd)+_0x294263),_0x54dc15[_0x2b4266(0x1cd)](_0x336f5a);for(const _0x309c93 of _0x54dc15){console[_0x2b4266(0x200)](formatJourneyItem(_0x309c93,'\x20\x20',_0x4280c1(_0x309c93['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x164);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x20e);async['execute'](_0x128f51){const _0x352174=a27_0x57c5c2,{options:_0x3f3670,args:_0x5d6f91,tdx:_0x4cf457}=_0x128f51,_0x456c6e=_0x5d6f91[0x0];if(!_0x456c6e)return console[_0x352174(0x12a)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x352174(0x12a)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x352174(0x12a)]('Options:'),console[_0x352174(0x12a)](_0x352174(0x207)),0x1;_0x3f3670[_0x352174(0x128)]&&console['error'](_0x352174(0x1be)+_0x456c6e);const {journeyId:_0x428c9c,parentSegmentId:_0x54f639}=await resolveJourneyIdFromInput(_0x456c6e,_0x3f3670,_0x4cf457);if(_0x3f3670[_0x352174(0x1f9)]){const _0x34eab7=getConsoleNextUrl(_0x3f3670[_0x352174(0x1f8)],_0x352174(0x1ff)+_0x54f639+_0x352174(0x18f)+_0x428c9c+_0x352174(0x209));return console['error'](a27_0x53b983[_0x352174(0x1f2)]('β')+'\x20Opening\x20'+a27_0x53b983[_0x352174(0x153)](_0x34eab7)),openBrowser(_0x34eab7),0x0;}const _0x4d8771=await withSpinner(_0x352174(0x11e),()=>_0x4cf457[_0x352174(0x17b)][_0x352174(0x14e)](_0x428c9c),{'verbose':_0x3f3670['verbose']}),_0x1fede7=_0x4d8771['data'],_0x162ac6=_0x3f3670['includeStats'];let _0x13c21b;if(_0x162ac6)try{const _0x1d80f6=await withSpinner(_0x352174(0x136),()=>_0x4cf457[_0x352174(0x17b)][_0x352174(0x184)](_0x428c9c),{'verbose':_0x3f3670[_0x352174(0x128)]});_0x13c21b=_0x1d80f6['data'];}catch{_0x3f3670['verbose']&&console[_0x352174(0x12a)](_0x352174(0x1d6));}const _0x211634=getConsoleNextUrl(_0x3f3670['site'],_0x352174(0x1ff)+_0x54f639+'/e/'+_0x428c9c+_0x352174(0x209)),_0x23ac06={'id':_0x1fede7['id'],'name':_0x1fede7[_0x352174(0x216)][_0x352174(0x1c8)],'description':_0x1fede7['attributes'][_0x352174(0x20b)],'state':_0x1fede7[_0x352174(0x216)][_0x352174(0x181)],'paused':_0x1fede7['attributes']['paused'],'reentry_mode':_0x1fede7[_0x352174(0x216)]['reentryMode'],'stages':_0x1fede7[_0x352174(0x216)]['journeyStages']?.[_0x352174(0x157)]||0x0,..._0x1fede7[_0x352174(0x216)]['goal']&&{'goal':_0x1fede7[_0x352174(0x216)][_0x352174(0x143)][_0x352174(0x1c8)]},..._0x13c21b&&{'statistics':{'size':_0x13c21b[_0x352174(0x16b)],'entered':_0x13c21b[_0x352174(0x1da)],'goal_achieved':_0x13c21b[_0x352174(0x1df)],'completion_rate':_0x13c21b[_0x352174(0x14d)],'exit_or_jump':_0x13c21b['exitOrJumpSize'],'exit_or_jump_rate':_0x13c21b[_0x352174(0x13c)],'stages':_0x13c21b[_0x352174(0x21b)]}},'url':_0x211634};return await handleSingleObjectOutput(_0x23ac06,_0x3f3670),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1fe);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x138);async[a27_0x57c5c2(0x120)](_0x38cb1c){const _0x105238=a27_0x57c5c2,{options:_0x14c0d3,args:_0xe237f0,tdx:_0x29421d}=_0x38cb1c,_0x26d9aa=_0xe237f0[0x0];if(!requireNameOrPath(_0x26d9aa))return 0x1;_0x14c0d3[_0x105238(0x128)]&&console[_0x105238(0x12a)](_0x105238(0x1be)+_0x26d9aa);const _0x539ba3=_0x14c0d3,_0x52ac78=_0x539ba3[_0x105238(0x179)],_0xc4707f=_0x539ba3['to'],_0x2e0ffb=_0x539ba3[_0x105238(0x14a)],_0xc650eb=_0x539ba3[_0x105238(0x132)];_0x2e0ffb&&!_0x52ac78&&!_0xc4707f&&console[_0x105238(0x12a)](_0x105238(0x1b3));const _0x57c155=_0x2e0ffb?withJsonFormat(_0x14c0d3):_0x14c0d3,{journeyId:_0x583a55,journeyName:_0x3556e2}=await resolveJourneyIdFromInput(_0x26d9aa,_0x57c155,_0x29421d),_0x120028=_0x52ac78||_0xc4707f?{'from':_0x52ac78,'to':_0xc4707f}:undefined,_0x527182=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise['all']([_0x29421d['journey'][_0x105238(0x14e)](_0x583a55),_0x29421d[_0x105238(0x17b)][_0x105238(0x184)](_0x583a55,_0x120028)]),{'verbose':_0x57c155['verbose']}),[_0xc175c9,_0x53ebe3]=_0x527182['data'];if(!_0x53ebe3||_0x53ebe3[_0x105238(0x1a5)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x3556e2),console[_0x105238(0x12a)](_0x105238(0x21d)),0x0;const _0x2f3e64=buildStageNameMap(_0xc175c9),_0x4c0fc4=!!(_0x120028&&_0x53ebe3[_0x105238(0x12e)]?.[_0x105238(0x157)]),_0x435d9d={'stageNameMap':_0x2f3e64,'hasPeriod':_0x4c0fc4,'includeHistory':!!_0x2e0ffb};if(_0xc650eb&&_0x53ebe3[_0x105238(0x21b)]){const _0x1205c2=_0x53ebe3['stages'][_0x105238(0x19d)](_0xb9c23=>{const _0x58d0d2=_0x105238,_0x45ec4a=_0x2f3e64['get'](_0xb9c23['id'])??'';return _0x45ec4a[_0x58d0d2(0x198)]()===_0xc650eb['toLowerCase']();});if(_0x1205c2)return await handleSingleObjectOutput(formatStageStats(_0x1205c2,_0x435d9d),_0x57c155),0x0;const _0x58bd8e=_0x53ebe3[_0x105238(0x21b)][_0x105238(0x197)](_0x3a4d4c=>_0x2f3e64[_0x105238(0x1f3)](_0x3a4d4c['id'])??_0x3a4d4c['id']);return console[_0x105238(0x12a)](_0x105238(0x1e2)+_0xc650eb+'\x22\x20not\x20found'),console[_0x105238(0x12a)](_0x105238(0x123)+_0x58bd8e['join'](',\x20')),0x1;}const _0x22a5ca=_0x53ebe3['stages']?.[_0x105238(0x197)](_0x188e3d=>formatStageStats(_0x188e3d,_0x435d9d)),_0x5b9e57=assembleJourneyStats(_0x53ebe3,{'from':_0x52ac78,'to':_0xc4707f,'includeHistory':_0x2e0ffb});return await this[_0x105238(0x17f)](_0x5b9e57,_0x22a5ca??[],_0x57c155),0x0;}async[a27_0x57c5c2(0x17f)](_0x40183b,_0x4a4a4b,_0x49f96c){const _0x3c5d72=a27_0x57c5c2,_0x103180=_0x49f96c[_0x3c5d72(0x13a)]==='json'||_0x49f96c[_0x3c5d72(0x13a)]==='jsonl'||_0x49f96c['json']||_0x49f96c[_0x3c5d72(0x15a)];if(_0x103180){_0x40183b[_0x3c5d72(0x21b)]=_0x4a4a4b,await handleSingleObjectOutput(_0x40183b,_0x49f96c);return;}await handleSingleObjectOutput(_0x40183b,_0x49f96c);for(const _0x251897 of _0x4a4a4b){console[_0x3c5d72(0x200)](''),console[_0x3c5d72(0x200)](String(a27_0x53b983[_0x3c5d72(0x153)][_0x3c5d72(0x16a)]('['+_0x251897[_0x3c5d72(0x1c8)]+']'))+a27_0x53b983['dim']('\x20'+_0x251897['id']));const {id:_0x63d054,name:_0xc38462,..._0x5ddc3b}=_0x251897;await handleSingleObjectOutput(_0x5ddc3b,_0x49f96c);}}}function a27_0x4d3e(){const _0x35b440=['session','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','rule','json','List\x20journeys\x20in\x20current\x20context','\x20\x20Name:\x20','message','\x20\x20-\x20','2441502XCxOky','Pausing\x20journey...','resume','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20(rule\x20match)','getSegment','554348nGqZnS','listFolders','...','hasPeriod','\x22\x20paused','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journeyBundleName','π\x20','Input:\x20','Resolving\x20journey...','Resuming\x20journey...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','connection','\x20(ID:\x20','completed','cwd','journey:version:create','\x20journeys','name','launched','listJourneysWithFolders','Creating\x20new\x20version...','journey:pull','sort','tdx.json','entries','resolveJourneyId','(archived)','no_parent','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)','\x5c$&','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','\x20\x20Statistics\x20not\x20available','activation','listActivationsFlat','\x20journey\x20files\x20to\x20','enteredSize','file','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','options','1423040Hvyhnp','goalSize','diff','\x20\x20Parent\x20segment:\x20','Error:\x20Stage\x20\x22','nodes','21xNLRhe','Write\x20','.yml','Listing\x20journey\x20versions...','parentSegment','filePath','\x20\x20Target:\x20','\x20->\x20','args','journey:list','isNew','dim','\x20\x20Folder\x20path:\x20','exitOrJumpSize','green','get','filter','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','blue','repeat','site','web','createVersion','has','stageNameMap','Fetching\x20users\x20and\x20connections...','journey:stats','/app/ps/','log','\x20\x20Journey\x20ID:\x20','values','pause','journey:resume','archived','(root)','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','77QEsIzc','/j/da/je','links','description','set','completeMilestoneRate','Show\x20journey\x20details','\x20version','journey:columns','Target\x20directory:\x20','getLatestJourneyId','\x20\x20Preserving\x20local\x20segment\x20name:\x20','relative','parent_segment','attributes','database','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','absolutePath','red','stages','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','all','Aborted.','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','versionNumber','push','columns','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','then','getParentFull','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','-\x20no\x20files\x20written','version','Error:\x20Parent\x20segment\x20context\x20required','milestoneSize','Fetching\x20parent\x20segment...','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','getColumnMapping','paused','table','type','getActivation','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','List\x20activations\x20for\x20a\x20journey','Journey\x20name:\x20','Getting\x20journey\x20details...','journey:versions','execute','\x20versions)','journeyBundleId','Available\x20stages:\x20','folderPath','data','Error:\x20','updatedAt','verbose','πΊοΈ\x20','error','helpText','Listing\x20journey\x20activations...','Table:\x20','history','Pause\x20a\x20running\x20journey','Resolving\x20version...','getTrafficData','stage',',\x20version:\x20','localeCompare','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Getting\x20journey\x20statistics...','\x0aError:','Show\x20journey\x20statistics','parentName','format','journey:activations','exitOrJumpRate','β\x20Journey\x20\x22','journeys','Fetching\x20','(running)','\x20(draft)\x20β\x20\x22','resolveParentId','goal','β\x20Found\x20','relativePath','tsv','Database:\x20','setPhase','utf-8','includeHistory','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','base','completionRate','getJourney','listJourneysFromParentSegment','\x20changed\x20files','(paused)','segments','cyan','\x20activation','7TUAiMc','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','length','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','createdAt','jsonl','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','yes','folders','No\x20journeys\x20found','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','536472qUwrsd','Getting\x20journey\x20traffic\x20data...','Fetching\x20journeys\x20and\x20folders...','journey:view','INVALID_ARGUMENT','errorCode','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Target\x20file:\x20','Cancelled','bold','size','Error:\x20--version\x20option\x20is\x20required','kind','draft','\x0aChanges\x20to\x20\x27','Resolving\x20parent\x20segment...','test','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Resume\x20a\x20paused\x20journey','resolveSegment','rootFolderId','Resolved\x20YAML\x20file:\x20','Error:\x20Version\x20','\x0aPull\x20summary:','from','folderId','journey','segment','dryRun','\x20Created\x20v','renderStats','journeyStages','state','segmentName','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','getStatistics','activation_','Listing\x20journeys...','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20new\x20files','8181TAYoYl','join','β\x20Pulled\x20','activationParams','Found\x20','Show\x20journey\x20table\x20column\x20mapping','/e/','3272xfCZBH','β\x20Context\x20set:\x20','yellow','stringify','content','root\x20folder','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','map','toLowerCase','journey:pause','conversion','replace','\x20journey','find','buildIdToNameMap','(draft)','55050tkVUJx','add','\x20files?','user','922870eRiLzy','journeyId','targetDir','buildIdToEmailMap'];a27_0x4d3e=function(){return _0x35b440;};return a27_0x4d3e();}export class JourneyTrafficCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:traffic';['description']=a27_0x57c5c2(0x172);async['execute'](_0x251b94){const _0x5324e4=a27_0x57c5c2,{options:_0x5a568d,args:_0x38182c,tdx:_0x62a035}=_0x251b94,_0x30f536=_0x38182c[0x0];if(!requireNameOrPath(_0x30f536))return 0x1;_0x5a568d['verbose']&&console[_0x5324e4(0x12a)](_0x5324e4(0x1be)+_0x30f536);const _0x5aa87c=_0x5a568d,_0x46b153=_0x5aa87c[_0x5324e4(0x119)],_0x2b7383=_0x5aa87c['from'],_0x40b5ef=_0x5aa87c['to'],_0x88b85f=_0x5aa87c['limit'];if(_0x46b153&&_0x46b153!==_0x5324e4(0x19a)&&_0x46b153!==_0x5324e4(0x1d7))return console[_0x5324e4(0x12a)]('Error:\x20Invalid\x20--type\x20\x22'+_0x46b153+_0x5324e4(0x196)),0x1;const _0x11ee36=withJsonFormat(_0x5a568d),{journeyId:_0x57f564,journeyName:_0x5048c5}=await resolveJourneyIdFromInput(_0x30f536,_0x11ee36,_0x62a035),_0x3aa1b2={'type':_0x46b153,'from':_0x2b7383,'to':_0x40b5ef,'limit':_0x88b85f},_0x2dc1f8=await withSpinner(_0x5324e4(0x162),()=>_0x62a035[_0x5324e4(0x17b)][_0x5324e4(0x131)](_0x57f564,_0x3aa1b2),{'verbose':_0x11ee36['verbose']}),_0x39483d=_0x2dc1f8[_0x5324e4(0x125)],_0x1080cd=_0x39483d[_0x5324e4(0x19a)]&&(_0x39483d[_0x5324e4(0x19a)][_0x5324e4(0x1e3)][_0x5324e4(0x157)]>0x0||_0x39483d['conversion'][_0x5324e4(0x20a)][_0x5324e4(0x157)]>0x0),_0x10ca10=_0x39483d[_0x5324e4(0x1d7)]&&_0x39483d['activation'][_0x5324e4(0x157)]>0x0;if(!_0x1080cd&&!_0x10ca10)return console['error'](_0x5324e4(0x183)+_0x5048c5),console[_0x5324e4(0x12a)](_0x5324e4(0x187)),_0x2b7383&&_0x40b5ef&&console[_0x5324e4(0x12a)](_0x5324e4(0x167)),0x0;return await handleSingleObjectOutput(_0x39483d,_0x11ee36),0x0;}}function formatStageStats(_0xebd35d,_0x3e5af6){const _0x40aba3=a27_0x57c5c2,_0x11a748=_0x3e5af6[_0x40aba3(0x1b9)]&&_0xebd35d[_0x40aba3(0x12e)]?.[_0x40aba3(0x157)]?aggregateStageHistory(_0xebd35d['history']):{'size':_0xebd35d[_0x40aba3(0x16b)],'entered':_0xebd35d[_0x40aba3(0x1da)],'milestone':_0xebd35d[_0x40aba3(0x113)],'milestone_rate':_0xebd35d[_0x40aba3(0x20d)],'exit_or_jump':_0xebd35d[_0x40aba3(0x1f1)],'exit_or_jump_rate':_0xebd35d['exitOrJumpRate']},_0x2d3198={'id':_0xebd35d['id'],'name':_0x3e5af6[_0x40aba3(0x1fc)]['get'](_0xebd35d['id'])??_0xebd35d['id'],..._0x11a748};return _0x3e5af6[_0x40aba3(0x1b9)]&&_0x3e5af6[_0x40aba3(0x14a)]&&_0xebd35d[_0x40aba3(0x12e)]&&(_0x2d3198[_0x40aba3(0x12e)]=_0xebd35d['history']),_0x2d3198;}export class JourneyPauseCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x199);['description']=a27_0x57c5c2(0x12f);async[a27_0x57c5c2(0x120)](_0x2bb190){const _0x4b296b=a27_0x57c5c2,{options:_0x14aa42,args:_0x479be9,tdx:_0x4c6133}=_0x2bb190,_0x2f4184=_0x479be9[0x0];if(!requireNameOrPath(_0x2f4184))return 0x1;_0x14aa42[_0x4b296b(0x128)]&&console[_0x4b296b(0x12a)]('Input:\x20'+_0x2f4184);const {journeyId:_0x463ac6,journeyName:_0x11c5ba}=await resolveJourneyIdFromInput(_0x2f4184,_0x14aa42,_0x4c6133);if(!_0x14aa42[_0x4b296b(0x15c)]){const _0x421c2c=await confirm(_0x4b296b(0x1a9)+_0x11c5ba+'\x22?');if(!_0x421c2c)return console[_0x4b296b(0x12a)]('Cancelled'),0x0;}const _0x1d792c=await withSpinner(_0x4b296b(0x1b1),()=>_0x4c6133['journey'][_0x4b296b(0x203)](_0x463ac6),{'verbose':_0x14aa42['verbose']}),_0x5857b6=_0x1d792c[_0x4b296b(0x125)];return console[_0x4b296b(0x12a)](_0x4b296b(0x13d)+_0x5857b6[_0x4b296b(0x216)]['name']+_0x4b296b(0x1ba)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x57c5c2(0x204);['description']=a27_0x57c5c2(0x173);async[a27_0x57c5c2(0x120)](_0x3c7967){const _0x3e2a62=a27_0x57c5c2,{options:_0x46be7f,args:_0x308278,tdx:_0x3b3813}=_0x3c7967,_0x12965f=_0x308278[0x0];if(!requireNameOrPath(_0x12965f))return 0x1;_0x46be7f[_0x3e2a62(0x128)]&&console[_0x3e2a62(0x12a)](_0x3e2a62(0x1be)+_0x12965f);const {journeyId:_0xe0625c,journeyName:_0x39ba22}=await resolveJourneyIdFromInput(_0x12965f,_0x46be7f,_0x3b3813);if(!_0x46be7f['yes']){const _0x4ea588=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x39ba22+'\x22?');if(!_0x4ea588)return console[_0x3e2a62(0x12a)](_0x3e2a62(0x169)),0x0;}const _0x4455dc=await withSpinner(_0x3e2a62(0x1c0),()=>_0x3b3813[_0x3e2a62(0x17b)][_0x3e2a62(0x1b2)](_0xe0625c),{'verbose':_0x46be7f[_0x3e2a62(0x128)]}),_0x2a3bc7=_0x4455dc[_0x3e2a62(0x125)];return console['error'](_0x3e2a62(0x13d)+_0x2a3bc7['attributes'][_0x3e2a62(0x1c8)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x57c5c2(0x1cc);[a27_0x57c5c2(0x20b)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x57c5c2(0x120)](_0x3f64ba){const _0x43c685=a27_0x57c5c2,{options:_0x1d1cbb,args:_0x38289c,tdx:_0x4f806a}=_0x3f64ba,_0x7735c3=_0x1d1cbb,_0x5d5078=_0x38289c[0x0],_0x47978e=_0x5d5078&&isYamlFilePath(_0x5d5078),_0x1eef57=await resolveTarget({'arg':_0x47978e?_0x5d5078:undefined,'contextParent':_0x1d1cbb[_0x43c685(0x1e8)],'cwd':process[_0x43c685(0x1c5)]()});if(!isSuccessfulResolution(_0x1eef57))return _0x1eef57[_0x43c685(0x166)]===_0x43c685(0x1d2)?(console[_0x43c685(0x12a)](a27_0x53b983['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x43c685(0x1d3)),console[_0x43c685(0x12a)](_0x43c685(0x1d5)),console[_0x43c685(0x12a)](_0x43c685(0x160)),console[_0x43c685(0x12a)](_0x43c685(0x14b))):(console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x21a)](_0x43c685(0x126)+_0x1eef57[_0x43c685(0x1ae)]+'\x0a')),_0x1eef57[_0x43c685(0x12b)]&&console['error'](a27_0x53b983[_0x43c685(0x153)](_0x1eef57['helpText']))),0x1;let _0x1d9c93=_0x47978e?undefined:_0x5d5078,_0x4e2ee3,_0x38ce18;_0x1eef57[_0x43c685(0x119)]===_0x43c685(0x1db)&&(_0x1d9c93=_0x1eef57['resourceName'],_0x4e2ee3=_0x1eef57[_0x43c685(0x1e9)],_0x38ce18=_0x1eef57[_0x43c685(0x124)]);const _0x4a676a=_0x1eef57[_0x43c685(0x139)],_0x144e89=_0x1eef57[_0x43c685(0x1a6)];_0x7735c3['verbose']&&(console[_0x43c685(0x12a)]('Parent\x20segment:\x20'+_0x4a676a),console[_0x43c685(0x12a)](_0x43c685(0x211)+_0x144e89),_0x1d9c93&&console[_0x43c685(0x12a)](_0x43c685(0x11d)+_0x1d9c93),_0x4e2ee3&&console[_0x43c685(0x12a)](_0x43c685(0x168)+_0x4e2ee3),_0x38ce18&&console[_0x43c685(0x12a)]('Folder\x20path:\x20'+_0x38ce18));const _0x433c61=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x4f806a[_0x43c685(0x17c)]['resolveParentId'](_0x4a676a),{'verbose':_0x1d1cbb[_0x43c685(0x128)]}),_0x2699cc=_0x433c61[_0x43c685(0x125)],{journeys:_0x1557a2,folders:_0x3a79cd}=await withSpinner(_0x43c685(0x163),async()=>{const _0x97da88=_0x43c685,[_0x240ca7,_0x884532]=await Promise[_0x97da88(0x21e)]([_0x4f806a[_0x97da88(0x17b)][_0x97da88(0x14f)](_0x2699cc,undefined,{'includeAllVersions':!![]}),_0x4f806a['segment'][_0x97da88(0x1b7)](_0x2699cc)]);return{'journeys':_0x240ca7,'folders':_0x884532};},{'verbose':_0x1d1cbb['verbose']})[_0x43c685(0x226)](_0x4ebebc=>_0x4ebebc[_0x43c685(0x125)]);let _0x228c1c=_0x1557a2;const _0x5abe63=buildFolderIdToPathMap(_0x3a79cd);if(_0x1d9c93){const _0x180487=_0x228c1c[_0x43c685(0x1f4)](_0x45b397=>_0x45b397[_0x43c685(0x1bc)][_0x43c685(0x198)]()===_0x1d9c93[_0x43c685(0x198)]());if(_0x180487[_0x43c685(0x157)]===0x0)return console[_0x43c685(0x12a)]('Error:\x20Journey\x20not\x20found:\x20'+_0x1d9c93),console[_0x43c685(0x12a)](_0x43c685(0x218)),0x1;_0x228c1c=_0x180487;}if(_0x38ce18!==undefined){const _0x17dbf0=_0x228c1c[_0x43c685(0x1f4)](_0x1d7dcb=>{const _0x544471=_0x43c685,_0x58316b=_0x1d7dcb['folderId']?_0x5abe63[_0x544471(0x1f3)](_0x1d7dcb[_0x544471(0x17a)])||'':'';return _0x58316b===_0x38ce18;});if(_0x17dbf0[_0x43c685(0x157)]===0x0&&_0x228c1c[_0x43c685(0x157)]>0x0){console[_0x43c685(0x12a)]('Error:\x20Journey\x20\x27'+_0x1d9c93+'\x27\x20not\x20found\x20in\x20'+(_0x38ce18||_0x43c685(0x195))),console[_0x43c685(0x12a)](_0x43c685(0x158));for(const _0xcf2412 of _0x228c1c){const _0x18a20d=_0xcf2412['folderId']?_0x5abe63['get'](_0xcf2412['folderId'])||'':'';console['error'](_0x43c685(0x1af)+(_0x18a20d||_0x43c685(0x206))+'/'+_0xcf2412['journeyBundleName']);}return 0x1;}_0x228c1c=_0x17dbf0;}if(_0x228c1c[_0x43c685(0x157)]===0x0)return console[_0x43c685(0x12a)](_0x43c685(0x15e)),0x0;const _0x850035=new Map();for(const _0x5d8050 of _0x228c1c){const _0x396b6b=_0x5d8050[_0x43c685(0x122)];!_0x850035[_0x43c685(0x1fb)](_0x396b6b)&&_0x850035[_0x43c685(0x20c)](_0x396b6b,[]),_0x850035[_0x43c685(0x1f3)](_0x396b6b)[_0x43c685(0x222)](_0x5d8050);}for(const _0x37e0a7 of _0x850035[_0x43c685(0x202)]()){_0x37e0a7[_0x43c685(0x1cd)]((_0x111ced,_0x2f0a2e)=>(_0x111ced[_0x43c685(0x221)]||0x0)-(_0x2f0a2e['versionNumber']||0x0));}const _0x447a7a=[],{idToEmailMap:_0x3a7fc2,connectionIdToNameMap:_0x4cf942}=await withSpinner(_0x43c685(0x1fd),async()=>{const _0x1380e2=_0x43c685,[_0x1ed021,_0x427915]=await Promise[_0x1380e2(0x21e)]([_0x4f806a[_0x1380e2(0x1a3)][_0x1380e2(0x1a7)](),_0x4f806a[_0x1380e2(0x1c2)][_0x1380e2(0x19e)]()]);return{'idToEmailMap':_0x1ed021,'connectionIdToNameMap':_0x427915};},{'verbose':_0x1d1cbb[_0x43c685(0x128)]})[_0x43c685(0x226)](_0x439323=>_0x439323[_0x43c685(0x125)]);for(const _0x4372b2 of _0x850035[_0x43c685(0x202)]()){const _0x3c184c=_0x4372b2[0x0][_0x43c685(0x1bc)],_0x408f28=_0x4372b2[0x0]['folderId'],_0x21d23c=_0x408f28?_0x5abe63['get'](_0x408f28)||'':'',_0x528492=_0x21d23c?a27_0xbd78d4[_0x43c685(0x18a)](_0x144e89,_0x21d23c):_0x144e89,_0x35b420=_0x4e2ee3||a27_0xbd78d4[_0x43c685(0x18a)](_0x528492,sanitizeFileName(_0x3c184c)+_0x43c685(0x1e6));let _0x50fa21,_0x2dd9f1;if(existsSync(_0x35b420))try{const _0x36181b=readFileSync(_0x35b420,'utf-8'),_0x4cf465=parseYamlString(_0x36181b);_0x2dd9f1=_0x4cf465,_0x50fa21=buildRuleToNameMapping(_0x4cf465),_0x7735c3[_0x43c685(0x128)]&&_0x50fa21[_0x43c685(0x16b)]>0x0&&console['error'](_0x43c685(0x18d)+_0x50fa21[_0x43c685(0x16b)]+_0x43c685(0x15b)+_0x3c184c);}catch(_0x2128f4){_0x7735c3['verbose']&&console[_0x43c685(0x12a)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x2128f4[_0x43c685(0x1ae)]);}const _0x3529a1=[],_0x119c6c=new Set(),_0x509cd8=new Map(),_0x208c38=new Map(),_0xadb3d5=new Set(),_0x186385=new Map(),_0x53ad7d=new Map(),_0x2e3c02=createJumpTargetCache();await withProgressSpinner(_0x43c685(0x13f)+_0x3c184c+_0x43c685(0x1b8),async _0x320fe9=>{const _0x4c7bd0=_0x43c685;for(const _0x2a46bf of _0x4372b2){const _0x16d353=_0x4372b2['length']>0x1?_0x2a46bf[_0x4c7bd0(0x1bc)]+'\x20v'+(_0x2a46bf[_0x4c7bd0(0x221)]||0x1):_0x2a46bf[_0x4c7bd0(0x1bc)];_0x320fe9[_0x4c7bd0(0x148)]('Fetching\x20'+_0x16d353);const _0xd4c80=await _0x4f806a['journey'][_0x4c7bd0(0x14e)](_0x2a46bf['id']),_0x114b61=_0xd4c80[_0x4c7bd0(0x216)]?.['audienceId'],_0x593ea4={'resolveSegment':async _0x5a1b8c=>{const _0xa0f063=_0x4c7bd0;if(!_0x114b61)return{'name':_0x5a1b8c,'isJourneyLocal':![]};const _0x4b5111=_0x509cd8[_0xa0f063(0x1f3)](_0x5a1b8c);if(_0x4b5111)return _0x4b5111;try{const _0x143270=await _0x4f806a[_0xa0f063(0x17c)][_0xa0f063(0x1b5)](_0x114b61,_0x5a1b8c),_0x4c809f=_0x143270[_0xa0f063(0x16d)]===SEGMENT_KIND_JOURNEY;let _0x5d3451,_0x48ecee=_0x143270[_0xa0f063(0x1c8)];if(_0x4c809f&&_0x143270[_0xa0f063(0x1aa)]){const _0x251571=await segmentResponseToDef(_0x143270,{'resolveSegmentName':async _0xa203e7=>{const _0x4d359e=_0xa0f063,_0x3ccda3=_0x509cd8['get'](_0xa203e7);if(_0x3ccda3)return _0x3ccda3[_0x4d359e(0x1c8)];const _0x1ef3a6=await _0x593ea4[_0x4d359e(0x174)](_0xa203e7);return _0x1ef3a6['name'];}}),_0x4c33ed=_0x251571['rule'];_0x5d3451={'description':_0x143270[_0xa0f063(0x20b)],'rule':_0x4c33ed};const _0x2b4eee=serializeRule(_0x4c33ed),_0x218152=_0x208c38[_0xa0f063(0x1f3)](_0x2b4eee);if(_0x218152)_0x48ecee=_0x218152,_0x5d3451=undefined,_0x7735c3[_0xa0f063(0x128)]&&console[_0xa0f063(0x12a)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x143270[_0xa0f063(0x1c8)]+_0xa0f063(0x1eb)+_0x218152);else{let _0x305dd7=![];if(_0x50fa21){const _0x39528e=_0x50fa21[_0xa0f063(0x1f3)](_0x2b4eee);if(_0x39528e){const _0x1ba63d=_0x39528e[_0xa0f063(0x19d)](_0x49e278=>!_0x119c6c[_0xa0f063(0x1fb)](_0x49e278));_0x1ba63d&&(_0x48ecee=_0x1ba63d,_0x119c6c[_0xa0f063(0x1a1)](_0x1ba63d),_0x208c38[_0xa0f063(0x20c)](_0x2b4eee,_0x1ba63d),_0x305dd7=!![],_0x7735c3['verbose']&&console[_0xa0f063(0x12a)](_0xa0f063(0x213)+_0x1ba63d+_0xa0f063(0x1b4)));}}if(!_0x305dd7){const _0x5db57a=generateJourneyLocalName(_0x143270['name']);_0x5db57a&&(_0x48ecee=_0x5db57a);let _0x58cc90=_0x48ecee,_0x495447=0x2;while(_0x119c6c[_0xa0f063(0x1fb)](_0x58cc90)){_0x58cc90=_0x48ecee+'_'+_0x495447,_0x495447++;}_0x119c6c[_0xa0f063(0x1a1)](_0x58cc90),_0x208c38['set'](_0x2b4eee,_0x58cc90),_0x48ecee=_0x58cc90;}}}const _0x2aee61={'name':_0x48ecee,'isJourneyLocal':_0x4c809f,'definition':_0x5d3451};return _0x509cd8['set'](_0x5a1b8c,_0x2aee61),_0x2aee61;}catch(_0x10a6ec){return _0x1d1cbb['verbose']&&console[_0xa0f063(0x12a)](_0xa0f063(0x1bb)+_0x5a1b8c+':\x20'+_0x10a6ec['message']),{'name':_0x5a1b8c,'isJourneyLocal':![]};}},'resolveActivation':async _0x53b083=>{const _0x5ec8ee=_0x4c7bd0,_0x56dcd8=_0x186385[_0x5ec8ee(0x1f3)](_0x53b083);if(_0x56dcd8)return _0x56dcd8;try{const _0x568c44=await _0x4f806a[_0x5ec8ee(0x17b)][_0x5ec8ee(0x11a)](_0x2a46bf['id'],_0x53b083),_0x48c58c=journeyActivationStepToYaml(_0x568c44,_0x3a7fc2,_0x4cf942),_0x8de2ef=JSON[_0x5ec8ee(0x193)]({'name':_0x48c58c[_0x5ec8ee(0x1c8)],'connection':_0x48c58c[_0x5ec8ee(0x1c2)],'connector_config':_0x48c58c['connector_config']}),_0x20381c=_0x53ad7d['get'](_0x8de2ef);if(_0x20381c){const _0x3cf44a={'name':_0x20381c,'isJourneyLocal':!![],'definition':_0x48c58c};return _0x186385[_0x5ec8ee(0x20c)](_0x53b083,_0x3cf44a),_0x3cf44a;}const _0xd75130=_0x568c44['attributes'][_0x5ec8ee(0x18c)][_0x5ec8ee(0x1c8)]||_0x53b083,_0xf4a1f3=sanitizeYamlKey(_0xd75130)||_0x5ec8ee(0x185)+_0x53b083;let _0x595fd5=_0xf4a1f3,_0x248a85=0x2;while(_0xadb3d5[_0x5ec8ee(0x1fb)](_0x595fd5)){_0x595fd5=_0xf4a1f3+'_'+_0x248a85,_0x248a85++;}_0xadb3d5[_0x5ec8ee(0x1a1)](_0x595fd5),_0x53ad7d['set'](_0x8de2ef,_0x595fd5);const _0x349114={'name':_0x595fd5,'isJourneyLocal':!![],'definition':_0x48c58c};return _0x186385['set'](_0x53b083,_0x349114),_0x349114;}catch(_0x366a99){return _0x1d1cbb[_0x5ec8ee(0x128)]&&console['error'](_0x5ec8ee(0x21c)+_0x53b083+':\x20'+_0x366a99[_0x5ec8ee(0x1ae)]),{'name':_0x53b083,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x29e055,_0x5b8d5f)=>{const _0x1e23aa=_0x4c7bd0;return resolveJumpTarget(_0x29e055,_0x5b8d5f,_0x2e3c02,_0x58ab1d=>_0x4f806a[_0x1e23aa(0x17b)][_0x1e23aa(0x14e)](_0x58ab1d));}},_0xdd16c7=await journeyResponseToDef(_0xd4c80,_0x593ea4);_0x3529a1[_0x4c7bd0(0x222)]({'item':_0x2a46bf,'yaml':_0xdd16c7});}},{'verbose':_0x1d1cbb[_0x43c685(0x128)]});const _0x1bd69c=await _0x4f806a[_0x43c685(0x17b)][_0x43c685(0x212)](_0x4372b2[0x0][_0x43c685(0x122)]),_0x5b016a=buildMergedJourneyDef(_0x3529a1,_0x50fa21,_0x1bd69c),_0x2765a0=normalizeJourneyDef(_0x5b016a,_0x2dd9f1),_0x5a7d2f=toYamlString(_0x2765a0),_0x5a7a0c=_0x4e2ee3||a27_0xbd78d4[_0x43c685(0x18a)](_0x528492,sanitizeFileName(_0x3c184c)+_0x43c685(0x1e6));!_0x4e2ee3&&_0x21d23c&&!existsSync(_0x528492)&&mkdirSync(_0x528492,{'recursive':!![]});const _0x32c888=a27_0xbd78d4[_0x43c685(0x214)](process[_0x43c685(0x1c5)](),_0x5a7a0c);if(existsSync(_0x5a7a0c)){const _0x3fcd9f=readFileSync(_0x5a7a0c,_0x43c685(0x149)),_0xdd4e38=generateDiff(_0x3fcd9f,_0x5a7d2f),_0x538ced=hasChanges(_0xdd4e38);_0x447a7a['push']({'relativePath':_0x32c888,'absolutePath':_0x5a7a0c,'content':_0x5a7d2f,'isNew':![],'hasChanges':_0x538ced,'diff':_0x538ced?formatDiffWithColors(_0xdd4e38):undefined});}else _0x447a7a[_0x43c685(0x222)]({'relativePath':_0x32c888,'absolutePath':_0x5a7a0c,'content':_0x5a7d2f,'isNew':!![],'hasChanges':![]});}const _0xbb5e2=_0x447a7a['filter'](_0x40de10=>_0x40de10[_0x43c685(0x1ee)]),_0x30df77=_0x447a7a[_0x43c685(0x1f4)](_0x5693ce=>!_0x5693ce['isNew']&&_0x5693ce['hasChanges']),_0x4c7130=_0x447a7a[_0x43c685(0x1f4)](_0x3d67c0=>!_0x3d67c0['isNew']&&!_0x3d67c0['hasChanges']),_0x596e86=_0x228c1c['length'],_0x40419a=_0x850035[_0x43c685(0x16b)],_0x232480=_0x596e86>_0x40419a?'\x20('+_0x596e86+_0x43c685(0x121):'';console[_0x43c685(0x12a)](_0x43c685(0x178)),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983['cyan'](_0x40419a+_0x43c685(0x1c7))+a27_0x53b983['dim'](_0x232480)),console['error']('\x20\x20'+a27_0x53b983['green']('+\x20'+_0xbb5e2[_0x43c685(0x157)]+_0x43c685(0x188))),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983[_0x43c685(0x192)]('~\x20'+_0x30df77[_0x43c685(0x157)]+_0x43c685(0x150))),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983['dim']('=\x20'+_0x4c7130[_0x43c685(0x157)]+'\x20unchanged\x20files')),console['error'](_0x43c685(0x1ea)+a27_0x53b983['cyan'](_0x144e89)+'\x0a');if(_0x30df77[_0x43c685(0x157)]>0x0)for(const _0x1a49a5 of _0x30df77){console[_0x43c685(0x12a)](_0x43c685(0x16f)+_0x1a49a5[_0x43c685(0x145)]+'\x27:'),console[_0x43c685(0x12a)]('β'[_0x43c685(0x1f7)](0x3c)),console['error'](_0x1a49a5[_0x43c685(0x1e0)]),console[_0x43c685(0x12a)]('β'[_0x43c685(0x1f7)](0x3c));}if(_0x7735c3[_0x43c685(0x17d)])return console['error'](a27_0x53b983[_0x43c685(0x192)](_0x43c685(0x1dc))),0x0;if(_0xbb5e2[_0x43c685(0x157)]===0x0&&_0x30df77['length']===0x0)return console['error'](a27_0x53b983[_0x43c685(0x1f2)]('β\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x4a676a},_0x7735c3['session']),console['error'](a27_0x53b983[_0x43c685(0x1f2)]('β\x20Context\x20set:\x20'+a27_0x53b983[_0x43c685(0x1ef)]('parent_segment')+'\x20=\x20'+a27_0x53b983[_0x43c685(0x153)](_0x4a676a))),0x0;if(!_0x7735c3['yes']&&(_0xbb5e2[_0x43c685(0x157)]>0x0||_0x30df77[_0x43c685(0x157)]>0x0)){if(!isInteractive())return console['error'](a27_0x53b983[_0x43c685(0x21a)](_0x43c685(0x137)),_0x43c685(0x1c1)),console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x1ef)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x18f170=await confirmKey(_0x43c685(0x1e5)+(_0xbb5e2[_0x43c685(0x157)]+_0x30df77[_0x43c685(0x157)])+_0x43c685(0x1a2));if(!_0x18f170)return console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x192)](_0x43c685(0x21f)),_0x43c685(0x110)),0x1;}!existsSync(_0x144e89)&&mkdirSync(_0x144e89,{'recursive':!![]});const _0xa50277=a27_0xbd78d4['join'](_0x144e89,_0x43c685(0x1ce));writeFileSync(_0xa50277,createTdxConfigContent(_0x4a676a),_0x43c685(0x149));for(const _0x3e7caf of _0x447a7a){(_0x3e7caf[_0x43c685(0x1ee)]||_0x3e7caf['hasChanges'])&&writeFileSync(_0x3e7caf[_0x43c685(0x219)],_0x3e7caf[_0x43c685(0x194)],'utf-8');}return console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x1f2)](_0x43c685(0x18b)+(_0xbb5e2[_0x43c685(0x157)]+_0x30df77[_0x43c685(0x157)])+_0x43c685(0x1d9)+_0x144e89)),saveSessionContext({'parent_segment':_0x4a676a},_0x7735c3[_0x43c685(0x1a8)]),console[_0x43c685(0x12a)](a27_0x53b983['green'](_0x43c685(0x191)+a27_0x53b983[_0x43c685(0x1ef)](_0x43c685(0x215))+'\x20=\x20'+a27_0x53b983[_0x43c685(0x153)](_0x4a676a))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x210);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x18e);async['execute'](_0xdd65dc){const _0x374faf=a27_0x57c5c2,{options:_0xe3cf5f,args:_0x2f96a9,tdx:_0x81922e}=_0xdd65dc,_0x32cdd2=_0x2f96a9[0x0];if(!requireNameOrPath(_0x32cdd2))return 0x1;_0xe3cf5f['verbose']&&console[_0x374faf(0x12a)](_0x374faf(0x1be)+_0x32cdd2);const {journeyId:_0x38ed5d}=await resolveJourneyIdFromInput(_0x32cdd2,_0xe3cf5f,_0x81922e),_0x3522a6=await withSpinner('Getting\x20column\x20mapping...',()=>_0x81922e[_0x374faf(0x17b)][_0x374faf(0x116)](_0x38ed5d),{'verbose':_0xe3cf5f[_0x374faf(0x128)]}),_0x4fddf1=_0x3522a6[_0x374faf(0x125)];return console['log'](_0x374faf(0x147)+_0x4fddf1[_0x374faf(0x217)]),console[_0x374faf(0x200)](_0x374faf(0x12d)+_0x4fddf1[_0x374faf(0x118)]),await handleSDKOutput(_0x4fddf1[_0x374faf(0x223)],_0xe3cf5f),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x13b);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x11c);async['execute'](_0xde75ad){const _0x282a1d=a27_0x57c5c2,{options:_0x2ada02,args:_0x46d326,tdx:_0xe86e85}=_0xde75ad,_0x3b2b22=_0x46d326[0x0];if(!requireNameOrPath(_0x3b2b22))return 0x1;_0x2ada02[_0x282a1d(0x128)]&&console['error'](_0x282a1d(0x1be)+_0x3b2b22);const {journeyId:_0x1d30d7}=await resolveJourneyIdFromInput(_0x3b2b22,_0x2ada02,_0xe86e85),_0x13285d=await withSpinner(_0x282a1d(0x12c),()=>_0xe86e85['journey'][_0x282a1d(0x1d8)](_0x1d30d7),{'verbose':_0x2ada02[_0x282a1d(0x128)]}),_0x15e180=_0x13285d[_0x282a1d(0x125)];return console[_0x282a1d(0x12a)](_0x282a1d(0x18d)+_0x15e180[_0x282a1d(0x157)]+_0x282a1d(0x154)+(_0x15e180[_0x282a1d(0x157)]!==0x1?'s':'')),await handleSDKOutput(_0x15e180,_0x2ada02),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:push';[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x10f);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x57c5c2(0x120)](_0x3e99b3){const _0x1fcd9f=a27_0x57c5c2,_0xf6b0cc=_0x3e99b3[_0x1fcd9f(0x1ec)][0x0];let _0x5ea492;if(_0xf6b0cc){const _0x495407=await resolveTarget({'arg':_0xf6b0cc,'contextParent':_0x3e99b3[_0x1fcd9f(0x1dd)][_0x1fcd9f(0x1e8)],'cwd':process[_0x1fcd9f(0x1c5)]()});isSuccessfulResolution(_0x495407)&&_0x495407['type']==='file'&&(_0x5ea492=_0x495407[_0x1fcd9f(0x1e9)]);}const _0x1dc9e3={..._0x3e99b3,'options':{..._0x3e99b3[_0x1fcd9f(0x1dd)],'journeysOnly':!![],..._0x5ea492&&{'singleFilePath':_0x5ea492}}};return this['segmentPushCommand'][_0x1fcd9f(0x120)](_0x1dc9e3);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x11f);['description']='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x57c5c2(0x120)](_0x25bed8){const _0x1879a5=a27_0x57c5c2,{options:_0x8a5422,args:_0x54cfbf,tdx:_0xacfc48}=_0x25bed8,_0x54d11f=_0x54cfbf[0x0];if(!requireNameOrPath(_0x54d11f))return 0x1;if(_0x8a5422[_0x1879a5(0x128)])console[_0x1879a5(0x12a)]('Input:\x20'+_0x54d11f);const {journeyId:_0x5eb2a5}=await resolveJourneyIdFromInput(_0x54d11f,_0x8a5422,_0xacfc48),_0x162b7f=await withSpinner(_0x1879a5(0x1e7),()=>_0xacfc48['journey']['listVersions'](_0x5eb2a5),{'verbose':_0x8a5422[_0x1879a5(0x128)]}),{bundleName:_0x3f6e4b,versions:_0x51b54f,latestJourneyId:_0xeedd47}=_0x162b7f[_0x1879a5(0x125)];console[_0x1879a5(0x12a)](_0x3f6e4b+':\x20'+_0x51b54f[_0x1879a5(0x157)]+_0x1879a5(0x20f)+(_0x51b54f[_0x1879a5(0x157)]!==0x1?'s':''));const _0x4ee272=_0x51b54f['map'](_0x566818=>({'version':_0x566818['versionNumber'],'journey_id':_0x566818[_0x1879a5(0x1a5)],'name':_0x566818[_0x1879a5(0x1c8)],'state':_0x566818['state'],'paused':_0x566818['paused'],'latest':_0x566818[_0x1879a5(0x1a5)]===_0xeedd47,'created_at':_0x566818[_0x1879a5(0x159)]}));return await handleSDKOutput(_0x4ee272,_0x8a5422),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1c6);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x156);async['execute'](_0x4cc67f){const _0xfdbf62=a27_0x57c5c2,{options:_0x3be08d,args:_0x597f01,tdx:_0x31eb85}=_0x4cc67f,_0x42eb95=_0x597f01[0x0];if(!requireNameOrPath(_0x42eb95))return 0x1;if(_0x3be08d[_0xfdbf62(0x128)])console[_0xfdbf62(0x12a)](_0xfdbf62(0x1be)+_0x42eb95);const {journeyId:_0x373b7b,journeyName:_0x1e2d53}=await resolveJourneyIdFromInput(_0x42eb95,_0x3be08d,_0x31eb85);if(!_0x3be08d[_0xfdbf62(0x15c)]){const _0x1d1e20=await confirm(_0xfdbf62(0x115)+_0x1e2d53+'\x22?');if(!_0x1d1e20)return console[_0xfdbf62(0x12a)](_0xfdbf62(0x169)),0x0;}const _0x42f851=await withSpinner(_0xfdbf62(0x1cb),()=>_0x31eb85[_0xfdbf62(0x17b)][_0xfdbf62(0x1fa)](_0x373b7b),{'verbose':_0x3be08d[_0xfdbf62(0x128)]}),_0x251cbb=_0x42f851['data'];return console[_0xfdbf62(0x12a)](a27_0x53b983[_0xfdbf62(0x1f2)]('β')+_0xfdbf62(0x17e)+_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x221)]+_0xfdbf62(0x141)+_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x1c8)]+'\x22'),console['error'](_0xfdbf62(0x201)+_0x251cbb['id']),await handleSingleObjectOutput({'id':_0x251cbb['id'],'name':_0x251cbb['attributes']['name'],'version':_0x251cbb[_0xfdbf62(0x216)]['versionNumber'],'state':_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x181)],'bundle_id':_0x251cbb['attributes'][_0xfdbf62(0x122)],'created_at':_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x159)]},_0x3be08d),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:version:view';[a27_0x57c5c2(0x20b)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async['execute'](_0x201343){const _0x2247e6=a27_0x57c5c2,{options:_0x2c9c17,args:_0x5111aa,tdx:_0x3479cf}=_0x201343,_0x193265=_0x5111aa[0x0];if(!requireNameOrPath(_0x193265))return 0x1;const _0x51063f=_0x2c9c17[_0x2247e6(0x111)];if(!_0x51063f)return console[_0x2247e6(0x12a)](_0x2247e6(0x16c)),console['error'](_0x2247e6(0x220)),0x1;const _0x1839be=parseInt(_0x51063f,0xa);if(isNaN(_0x1839be)||_0x1839be<0x1)return console[_0x2247e6(0x12a)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x51063f),0x1;if(_0x2c9c17[_0x2247e6(0x128)])console[_0x2247e6(0x12a)](_0x2247e6(0x1be)+_0x193265+_0x2247e6(0x133)+_0x1839be);const {journeyId:_0xcd2abe,parentSegmentId:_0x2ee560}=await resolveJourneyIdFromInput(_0x193265,_0x2c9c17,_0x3479cf),_0x36717e=await withSpinner(_0x2247e6(0x130),()=>_0x3479cf[_0x2247e6(0x17b)]['listVersions'](_0xcd2abe),{'verbose':_0x2c9c17['verbose']}),{versions:_0xdfe536,latestJourneyId:_0x4a1312}=_0x36717e[_0x2247e6(0x125)],_0xe37df0=_0xdfe536[_0x2247e6(0x19d)](_0x5a1a2d=>_0x5a1a2d[_0x2247e6(0x221)]===_0x1839be);if(!_0xe37df0){const _0xcba30d=_0xdfe536[_0x2247e6(0x197)](_0xbb6adf=>'v'+_0xbb6adf['versionNumber'])[_0x2247e6(0x18a)](',\x20');return console[_0x2247e6(0x12a)](_0x2247e6(0x177)+_0x1839be+'\x20not\x20found.\x20Available:\x20'+_0xcba30d),0x1;}const _0x403165=await withSpinner('Getting\x20version\x20'+_0x1839be+'\x20details...',()=>_0x3479cf[_0x2247e6(0x17b)][_0x2247e6(0x14e)](_0xe37df0[_0x2247e6(0x1a5)]),{'verbose':_0x2c9c17[_0x2247e6(0x128)]}),_0x936a9=_0x403165[_0x2247e6(0x125)],_0x1c6c65=getConsoleNextUrl(_0x2c9c17[_0x2247e6(0x1f8)],_0x2247e6(0x1ff)+_0x2ee560+'/e/'+_0xe37df0['journeyId']+_0x2247e6(0x209));return await handleSingleObjectOutput({'id':_0x936a9['id'],'name':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x1c8)],'version':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x221)],'description':_0x936a9[_0x2247e6(0x216)]['description'],'state':_0x936a9[_0x2247e6(0x216)]['state'],'paused':_0x936a9['attributes']['paused'],'reentry_mode':_0x936a9['attributes']['reentryMode'],'stages':_0x936a9['attributes'][_0x2247e6(0x180)]?.[_0x2247e6(0x157)]||0x0,..._0x936a9[_0x2247e6(0x216)][_0x2247e6(0x143)]&&{'goal':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x143)]['name']},'latest':_0xe37df0['journeyId']===_0x4a1312,'created_at':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x159)],'updated_at':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x127)],'url':_0x1c6c65},_0x2c9c17),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x2d6957=a28_0xfe80;(function(_0x378ee3,_0x4069fe){const _0x486df3=a28_0xfe80,_0x2da594=_0x378ee3();while(!![]){try{const _0x179a9a=-parseInt(_0x486df3(0x202))/0x1+-parseInt(_0x486df3(0x1d9))/0x2*(-parseInt(_0x486df3(0x200))/0x3)+parseInt(_0x486df3(0x1dc))/0x4+-parseInt(_0x486df3(0x212))/0x5+parseInt(_0x486df3(0x1f3))/0x6*(-parseInt(_0x486df3(0x1e0))/0x7)+-parseInt(_0x486df3(0x1ee))/0x8*(-parseInt(_0x486df3(0x1ed))/0x9)+parseInt(_0x486df3(0x20c))/0xa;if(_0x179a9a===_0x4069fe)break;else _0x2da594['push'](_0x2da594['shift']());}catch(_0x573373){_0x2da594['push'](_0x2da594['shift']());}}}(a28_0x4e03,0xbe1c6));function a28_0xfe80(_0x4d299c,_0x1849e5){_0x4d299c=_0x4d299c-0x1d6;const _0x4e03e2=a28_0x4e03();let _0xfe80fd=_0x4e03e2[_0x4d299c];return _0xfe80fd;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x4e03(){const _0x3a565e=['cwd','No\x20journey\x20YAML\x20files\x20found\x20in\x20','6fthNeI','hasErrors','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','warnings','\x20warning(s)\x20found','helpText','\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','targetDir','Error:\x20','relativePath','journey','\x20journey(s)\x20with\x20errors,\x20','6hQbwDt','length','1515934yNvQoh','execute','message','.yaml','\x20segment\x20file(s)\x20skipped)','filter','filePath','reason','validCount','warningCount','14365570ztGJtg','\x20(skipped:\x20','errors','\x20error(s)','cyan','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','4273630LRwOUV','verbose','Error:\x20Directory\x20not\x20found:\x20','name','\x20journey(s)\x20valid','1171828EwghjU','\x20valid','error','318392yqkUMG','\x20segment\x20file(s)\x20skipped','dim','file','2536877PVlSkN','type','Validation\x20failed:\x20','green','invalidCount','β\x20All\x20','log','skippedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','endsWith','red','journey:validate','errorCode','4518Lniunr','13128ZBuJIl','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','yellow'];a28_0x4e03=function(){return _0x3a565e;};return a28_0x4e03();}import{existsSync}from'fs';import a28_0xab2b70 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{[a28_0x2d6957(0x1d7)]=a28_0x2d6957(0x1eb);['description']='Validate\x20journey\x20YAML\x20files';async[a28_0x2d6957(0x203)](_0x253d77){const _0x433e1f=a28_0x2d6957,{options:_0x17f37e,args:_0x27a52c}=_0x253d77,_0x27b823=_0x17f37e,_0x4d9e6b=await resolveTarget({'arg':_0x27a52c[0x0],'contextParent':_0x17f37e['parentSegment'],'cwd':process[_0x433e1f(0x1f1)]()});if(!isSuccessfulResolution(_0x4d9e6b))return _0x4d9e6b[_0x433e1f(0x1ec)]==='no_parent'?(console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1f0)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x433e1f(0x1ef)),console[_0x433e1f(0x1db)](_0x433e1f(0x1fa)),console[_0x433e1f(0x1db)](_0x433e1f(0x1e8))):(console['error'](a28_0xab2b70[_0x433e1f(0x1ea)](_0x433e1f(0x1fc)+_0x4d9e6b[_0x433e1f(0x204)]+'\x0a')),_0x4d9e6b[_0x433e1f(0x1f9)]&&console['error'](a28_0xab2b70[_0x433e1f(0x210)](_0x4d9e6b['helpText']))),0x1;const _0x53dec6=_0x4d9e6b[_0x433e1f(0x1fb)],_0x42ffb9=_0x4d9e6b[_0x433e1f(0x1e1)]===_0x433e1f(0x1df)?_0x4d9e6b[_0x433e1f(0x208)]:undefined;if(!_0x42ffb9&&!existsSync(_0x53dec6))return console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1ea)](_0x433e1f(0x1d6)+_0x53dec6+'\x0a')),0x1;let _0x328b2b;if(_0x42ffb9){if(!_0x42ffb9[_0x433e1f(0x1e9)]('.yml')&&!_0x42ffb9[_0x433e1f(0x1e9)](_0x433e1f(0x205)))return console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1ea)](_0x433e1f(0x1f5)+_0x42ffb9+'\x0a')),0x1;_0x328b2b=[_0x42ffb9];}else _0x328b2b=findYamlFiles(_0x53dec6);if(_0x328b2b[_0x433e1f(0x201)]===0x0)return console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1ea)](_0x433e1f(0x211)+_0x53dec6+'\x0a')),0x1;const _0x31a565=validateYamlFiles(_0x328b2b,_0x53dec6,{'filterType':_0x433e1f(0x1fe)}),_0x3cb17e=calculateSummary(_0x31a565),_0xfd86bd=_0x31a565[_0x433e1f(0x207)](isValidationResult);if(_0xfd86bd[_0x433e1f(0x201)]===0x0)return console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1f0)](_0x433e1f(0x1f2)+_0x53dec6+'\x0a')),_0x3cb17e['skippedCount']>0x0&&console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1de)]('('+_0x3cb17e[_0x433e1f(0x1e7)]+_0x433e1f(0x206))),0x0;for(const _0x4ebabf of _0x31a565){if(!isValidationResult(_0x4ebabf)){_0x27b823[_0x433e1f(0x213)]&&console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1de)]('-\x20'+_0x4ebabf[_0x433e1f(0x1fd)]+_0x433e1f(0x20d)+_0x4ebabf[_0x433e1f(0x209)]+')'));continue;}const {relativePath:_0x59594b,source:_0x1a4a6f,result:_0x48c6e1}=_0x4ebabf;if(_0x48c6e1['valid']&&_0x48c6e1['warnings'][_0x433e1f(0x201)]===0x0)_0x27b823['verbose']&&console[_0x433e1f(0x1e6)](a28_0xab2b70['green']('β\x20'+_0x59594b));else _0x48c6e1[_0x433e1f(0x1f6)]?(console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1f0)]('β \x20'+_0x59594b+':\x20'+_0x48c6e1[_0x433e1f(0x1f7)]['length']+'\x20warning(s)')),console[_0x433e1f(0x1e6)](formatValidationResult(_0x48c6e1,_0x1a4a6f,_0x59594b))):(console['log'](a28_0xab2b70[_0x433e1f(0x1ea)]('β\x20'+_0x59594b+':\x20'+_0x48c6e1[_0x433e1f(0x20e)]['length']+_0x433e1f(0x20f))),console[_0x433e1f(0x1e6)](formatValidationResult(_0x48c6e1,_0x1a4a6f,_0x59594b)));}return console[_0x433e1f(0x1e6)](''),_0x3cb17e[_0x433e1f(0x1f4)]?(console[_0x433e1f(0x1e6)](a28_0xab2b70['red'](_0x433e1f(0x1e2)+_0x3cb17e[_0x433e1f(0x1e4)]+_0x433e1f(0x1ff)+_0x3cb17e[_0x433e1f(0x20a)]+_0x433e1f(0x1da))),_0x3cb17e[_0x433e1f(0x20b)]>0x0&&console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1f0)](_0x3cb17e['warningCount']+_0x433e1f(0x1f8))),_0x3cb17e[_0x433e1f(0x1e7)]>0x0&&console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1de)](_0x3cb17e[_0x433e1f(0x1e7)]+_0x433e1f(0x1dd))),0x1):(console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1e3)](_0x433e1f(0x1e5)+_0x3cb17e[_0x433e1f(0x20a)]+_0x433e1f(0x1d8))),_0x3cb17e[_0x433e1f(0x20b)]>0x0&&console['log'](a28_0xab2b70[_0x433e1f(0x1f0)](_0x3cb17e[_0x433e1f(0x20b)]+'\x20warning(s)\x20found')),_0x3cb17e[_0x433e1f(0x1e7)]>0x0&&console['log'](a28_0xab2b70[_0x433e1f(0x1de)](_0x3cb17e[_0x433e1f(0x1e7)]+_0x433e1f(0x1dd))),0x0);}}
|