@treasuredata/tdx 2026.4.14 → 2026.4.16
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_0x366c7f=a25_0x5884;(function(_0x33eaed,_0x15a6de){const _0x54a13d=a25_0x5884,_0x3c9748=_0x33eaed();while(!![]){try{const _0x25c260=-parseInt(_0x54a13d(0x158))/0x1+-parseInt(_0x54a13d(0x145))/0x2*(parseInt(_0x54a13d(0x141))/0x3)+-parseInt(_0x54a13d(0x15f))/0x4+-parseInt(_0x54a13d(0x152))/0x5+-parseInt(_0x54a13d(0x147))/0x6*(parseInt(_0x54a13d(0x138))/0x7)+-parseInt(_0x54a13d(0x149))/0x8+-parseInt(_0x54a13d(0x153))/0x9*(-parseInt(_0x54a13d(0x13a))/0xa);if(_0x25c260===_0x15a6de)break;else _0x3c9748['push'](_0x3c9748['shift']());}catch(_0x444f9d){_0x3c9748['push'](_0x3c9748['shift']());}}}(a25_0xc8ce,0xc9a36));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x30ae82 from'chalk';import a25_0x5a815f from'path';function a25_0xc8ce(){const _0x1ff821=['7509360LixfRH','\x20warning(s)','✔\x20All\x20','\x20non-template\x20file(s)\x20skipped','relativePath','Validation\x20failed:\x20','dirname','warningCount','green','7185455GKfgFD','96453vTyTDG','valid','filter','skippedCount','validCount','1429331Nkokga','red','No\x20template\x20YAML\x20files\x20found\x20in\x20','.yml','endsWith','error','yellow','5152504TTdSRc','dim','Validate\x20template\x20YAML\x20files','name','665JYqtEd','length','5970WAjQJH','template','log','resolve','\x20template(s)\x20with\x20errors,\x20','warnings','engage:template:validate','416463yzMxCF','invalidCount','\x20warning(s)\x20found','cwd','2JENDNx','\x20template(s)\x20valid','21480PuUkeD','\x20non-template\x20file(s)\x20skipped)'];a25_0xc8ce=function(){return _0x1ff821;};return a25_0xc8ce();}function a25_0x5884(_0x5474cb,_0x58c1bf){_0x5474cb=_0x5474cb-0x138;const _0xc8cec1=a25_0xc8ce();let _0x58846b=_0xc8cec1[_0x5474cb];return _0x58846b;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x366c7f(0x162)]=a25_0x366c7f(0x140);['description']=a25_0x366c7f(0x161);async['execute'](_0x444106){const _0x421adb=a25_0x366c7f,{options:_0x350466,args:_0x8514c1}=_0x444106,_0x5d7026=_0x350466,_0x23134b=_0x8514c1[0x0],_0xfdfc6e=_0x23134b?a25_0x5a815f[_0x421adb(0x13d)](_0x23134b):undefined,_0x101b1f=_0xfdfc6e?isYamlFile(_0xfdfc6e):![];let _0x1297af,_0x4a83a1;if(_0x101b1f&&_0xfdfc6e)_0x1297af=a25_0x5a815f[_0x421adb(0x14f)](_0xfdfc6e),_0x4a83a1=_0xfdfc6e;else _0xfdfc6e?_0x1297af=_0xfdfc6e:_0x1297af=process[_0x421adb(0x144)]();if(!_0x4a83a1&&!existsSync(_0x1297af))return console[_0x421adb(0x15d)](a25_0x30ae82[_0x421adb(0x159)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1297af+'\x0a')),0x1;let _0xfc5ae;if(_0x4a83a1){if(!_0x4a83a1[_0x421adb(0x15c)](_0x421adb(0x15b))&&!_0x4a83a1[_0x421adb(0x15c)]('.yaml'))return console[_0x421adb(0x15d)](a25_0x30ae82[_0x421adb(0x159)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x4a83a1+'\x0a')),0x1;_0xfc5ae=[_0x4a83a1];}else _0xfc5ae=findYamlFiles(_0x1297af);if(_0xfc5ae[_0x421adb(0x139)]===0x0)return console[_0x421adb(0x15d)](a25_0x30ae82[_0x421adb(0x159)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x1297af+'\x0a')),0x1;const _0x2845e4=validateYamlFiles(_0xfc5ae,_0x1297af,{'filterType':_0x421adb(0x13b)}),_0x1ae722=calculateSummary(_0x2845e4),_0x197962=_0x2845e4[_0x421adb(0x155)](isValidationResult);if(_0x197962[_0x421adb(0x139)]===0x0)return console['error'](a25_0x30ae82['yellow'](_0x421adb(0x15a)+_0x1297af+'\x0a')),_0x1ae722[_0x421adb(0x156)]>0x0&&console[_0x421adb(0x15d)](a25_0x30ae82[_0x421adb(0x160)]('('+_0x1ae722[_0x421adb(0x156)]+_0x421adb(0x148))),0x0;for(const _0x4cb7a1 of _0x2845e4){if(!isValidationResult(_0x4cb7a1)){_0x5d7026['verbose']&&console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x160)]('-\x20'+_0x4cb7a1[_0x421adb(0x14d)]+'\x20(skipped:\x20'+_0x4cb7a1['reason']+')'));continue;}const {relativePath:_0x11e8d8,source:_0x4f0ff1,result:_0x6b3955}=_0x4cb7a1;if(_0x6b3955['valid']&&_0x6b3955[_0x421adb(0x13f)][_0x421adb(0x139)]===0x0)_0x5d7026['verbose']&&console['log'](a25_0x30ae82[_0x421adb(0x151)]('✔\x20'+_0x11e8d8));else _0x6b3955[_0x421adb(0x154)]?(console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x15e)]('⚠\x20'+_0x11e8d8+':\x20'+_0x6b3955['warnings'][_0x421adb(0x139)]+_0x421adb(0x14a))),console[_0x421adb(0x13c)](formatValidationResult(_0x6b3955,_0x4f0ff1,_0x11e8d8))):(console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x159)]('✖\x20'+_0x11e8d8+':\x20'+_0x6b3955['errors'][_0x421adb(0x139)]+'\x20error(s)')),console[_0x421adb(0x13c)](formatValidationResult(_0x6b3955,_0x4f0ff1,_0x11e8d8)));}return console['log'](''),_0x1ae722['hasErrors']?(console['log'](a25_0x30ae82[_0x421adb(0x159)](_0x421adb(0x14e)+_0x1ae722[_0x421adb(0x142)]+_0x421adb(0x13e)+_0x1ae722[_0x421adb(0x157)]+'\x20valid')),_0x1ae722[_0x421adb(0x150)]>0x0&&console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x15e)](_0x1ae722[_0x421adb(0x150)]+'\x20warning(s)\x20found')),_0x1ae722[_0x421adb(0x156)]>0x0&&console[_0x421adb(0x13c)](a25_0x30ae82['dim'](_0x1ae722['skippedCount']+_0x421adb(0x14c))),0x1):(console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x151)](_0x421adb(0x14b)+_0x1ae722[_0x421adb(0x157)]+_0x421adb(0x146))),_0x1ae722[_0x421adb(0x150)]>0x0&&console[_0x421adb(0x13c)](a25_0x30ae82['yellow'](_0x1ae722[_0x421adb(0x150)]+_0x421adb(0x143))),_0x1ae722[_0x421adb(0x156)]>0x0&&console[_0x421adb(0x13c)](a25_0x30ae82['dim'](_0x1ae722[_0x421adb(0x156)]+_0x421adb(0x14c))),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_0x3de47c=a26_0x231f;(function(_0x1f2a3e,_0xe387c5){const _0x3d452c=a26_0x231f,_0x109442=_0x1f2a3e();while(!![]){try{const _0x193872=parseInt(_0x3d452c(0x1db))/0x1+parseInt(_0x3d452c(0x20f))/0x2*(-parseInt(_0x3d452c(0x1f1))/0x3)+-parseInt(_0x3d452c(0x1f0))/0x4+parseInt(_0x3d452c(0x213))/0x5*(parseInt(_0x3d452c(0x1df))/0x6)+parseInt(_0x3d452c(0x1c2))/0x7*(-parseInt(_0x3d452c(0x1f7))/0x8)+parseInt(_0x3d452c(0x1ce))/0x9+parseInt(_0x3d452c(0x201))/0xa*(parseInt(_0x3d452c(0x209))/0xb);if(_0x193872===_0xe387c5)break;else _0x109442['push'](_0x109442['shift']());}catch(_0x1ebaaa){_0x109442['push'](_0x109442['shift']());}}}(a26_0x3205,0x536d4));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_0x26e862 from'chalk';function formatDuration(_0x571f59){const _0x34976b=a26_0x231f;if(_0x571f59<0x3c)return _0x571f59+'s';if(_0x571f59<0xe10)return Math[_0x34976b(0x1eb)](_0x571f59/0x3c)+'m\x20'+_0x571f59%0x3c+'s';const _0x276974=Math[_0x34976b(0x1eb)](_0x571f59/0xe10),_0x4502be=Math[_0x34976b(0x1eb)](_0x571f59%0xe10/0x3c);return _0x4502be>0x0?_0x276974+'h\x20'+_0x4502be+'m':_0x276974+'h';}function formatRelativeTime(_0x501ea2){const _0x572b23=a26_0x231f,_0x1d3792=Date[_0x572b23(0x1ff)]()-_0x501ea2[_0x572b23(0x1ca)](),_0x191d08=Math[_0x572b23(0x1eb)](Math[_0x572b23(0x1ed)](_0x1d3792)/0x3e8);if(_0x191d08<0x3c)return _0x572b23(0x21a);const _0x3564c9=Math[_0x572b23(0x1eb)](_0x191d08/0x3c);if(_0x3564c9<0x3c)return _0x3564c9+'m\x20ago';const _0x348012=Math['floor'](_0x3564c9/0x3c);if(_0x348012<0x18)return _0x348012+'h\x20ago';const _0x5d4da3=Math['floor'](_0x348012/0x18);if(_0x5d4da3<0x1e)return _0x5d4da3+_0x572b23(0x1d9);return Math[_0x572b23(0x1eb)](_0x5d4da3/0x1e)+_0x572b23(0x1fd);}function a26_0x3205(){const _0x25a0e7=['67780yFuCIK','limit','name','kill','hive','Submitting\x20job...','type','site','440hYtanc','\x20job','\x20\x20Job\x20ID:\x20','submit','result','start_at','106mzjqHf','end_at','priority','created_at','137915zATwTh','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','status','verbose','map','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','query','just\x20now','Limit:\x20','push','Cancelled','7nFIICA','dim','job:submit','Status\x20filter:\x20','trino','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','round','\x20row','getTime','log','success','✔\x20Retrieved\x20','2908251wXuBGm','Getting\x20job\x20details...','show','✔\x20Job\x20submitted','length','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job_id','Kill\x20a\x20job','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','args','d\x20ago','join','285849Dzoteu','description','execute','jobType','138jKIZNp','data','INVALID_ARGUMENT','Database:\x20','Show\x20job\x20details','substring','Getting\x20job\x20results...','debug','green','\x27\x20to\x20verify\x20the\x20job\x20status','jobs','url','floor','presto','abs','Query:\x20','validate','2529196OiGBiI','6333VdAzUY','Submit\x20a\x20job','error','\x20jobs','red','job:show','3428952XcHhJZ','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','List\x20jobs','Get\x20job\x20results','user_name','job:kill','mo\x20ago','✔\x20Found\x20','now','database'];a26_0x3205=function(){return _0x25a0e7;};return a26_0x3205();}export class JobListCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1e9);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1f9);async[a26_0x3de47c(0x1dd)](_0x479285){const _0x24449e=a26_0x3de47c,{options:_0x25b5be,tdx:_0x3904be}=_0x479285,_0x46b8a2=resolveLimit(_0x25b5be[_0x24449e(0x202)],DEFAULT_DISPLAY_LIMIT),_0x3eef2e=_0x25b5be['status'];_0x25b5be[_0x24449e(0x216)]&&(console['error'](_0x24449e(0x21b)+_0x46b8a2+_0x24449e(0x1f4)),_0x3eef2e&&console[_0x24449e(0x1f3)](_0x24449e(0x1c5)+_0x3eef2e));const _0xb1e60f=await withSpinner('Listing\x20jobs...',()=>_0x3904be[_0x24449e(0x1e9)]['list']({'from':0x0,'to':_0x46b8a2-0x1,'status':_0x3eef2e}),{'verbose':_0x25b5be[_0x24449e(0x216)]}),_0x1b4ccb=_0xb1e60f[_0x24449e(0x1e0)];console['error'](_0x24449e(0x1fe)+_0x1b4ccb['length']+_0x24449e(0x20a)+(_0x1b4ccb['length']!==0x1?'s':''));const _0x29a54c=_0x25b5be[_0x24449e(0x208)];if(isStructuredFormat(_0x25b5be)){const _0x248cd0=_0x1b4ccb[_0x24449e(0x217)](_0x3b99ad=>{const _0x5e62cd=_0x24449e;let _0xf8f0ae;if(_0x3b99ad[_0x5e62cd(0x20e)]&&_0x3b99ad[_0x5e62cd(0x210)]){const _0x321e0e=new Date(_0x3b99ad['start_at'])[_0x5e62cd(0x1ca)](),_0x3eb50e=new Date(_0x3b99ad[_0x5e62cd(0x210)])[_0x5e62cd(0x1ca)]();_0xf8f0ae=Math[_0x5e62cd(0x1c8)]((_0x3eb50e-_0x321e0e)/0x3e8);}return{'job_id':_0x3b99ad['job_id'],'type':_0x3b99ad[_0x5e62cd(0x207)]===_0x5e62cd(0x1ec)?_0x5e62cd(0x1c6):_0x3b99ad['type'],'status':_0x3b99ad[_0x5e62cd(0x215)],'user_name':_0x3b99ad[_0x5e62cd(0x1fb)],'duration_sec':_0xf8f0ae,'created_at':_0x3b99ad[_0x5e62cd(0x212)],'started_at':_0x3b99ad['start_at'],'end_at':_0x3b99ad[_0x5e62cd(0x210)]};});await handleSDKOutput(_0x248cd0,_0x25b5be);}else for(const _0x456bd3 of _0x1b4ccb){const _0x4be940=_0x456bd3[_0x24449e(0x215)]===_0x24449e(0x1cc)?a26_0x26e862[_0x24449e(0x1e7)]:_0x456bd3[_0x24449e(0x215)]===_0x24449e(0x1f3)?a26_0x26e862[_0x24449e(0x1f5)]:a26_0x26e862[_0x24449e(0x1c3)],_0x22438b=_0x4be940(_0x456bd3[_0x24449e(0x215)]),_0x45b4d4=getJobUrl(_0x29a54c,_0x456bd3[_0x24449e(0x1d5)]),_0x4ee26b=hyperlink(_0x456bd3[_0x24449e(0x1d5)],_0x45b4d4),_0x37d4f6=a26_0x26e862[_0x24449e(0x1c3)](_0x456bd3['type']==='presto'?_0x24449e(0x1c6):_0x456bd3[_0x24449e(0x207)]),_0x3120e7=[];if(_0x456bd3[_0x24449e(0x20e)]&&_0x456bd3['end_at']){const _0x4f1f08=Math[_0x24449e(0x1c8)]((new Date(_0x456bd3[_0x24449e(0x210)])[_0x24449e(0x1ca)]()-new Date(_0x456bd3[_0x24449e(0x20e)])[_0x24449e(0x1ca)]())/0x3e8);_0x3120e7[_0x24449e(0x1c0)](formatDuration(_0x4f1f08));}if(_0x456bd3[_0x24449e(0x210)])_0x3120e7[_0x24449e(0x1c0)](formatRelativeTime(new Date(_0x456bd3['end_at'])));else _0x456bd3[_0x24449e(0x20e)]&&_0x3120e7[_0x24449e(0x1c0)](formatRelativeTime(new Date(_0x456bd3['start_at'])));const _0x4b26e9=_0x3120e7[_0x24449e(0x1d2)]>0x0?a26_0x26e862['dim']('\x20'+_0x3120e7[_0x24449e(0x1da)](',\x20')):'';console[_0x24449e(0x1cb)]('⚡\x20'+_0x4ee26b+'\x20'+_0x37d4f6+'\x20'+_0x22438b+_0x4b26e9);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1f6);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1e3);[a26_0x3de47c(0x1ef)](_0x5de47f){const _0x2cd9d5=a26_0x3de47c,_0xd27d4f=_0x5de47f[_0x2cd9d5(0x1d8)][0x0];if(!_0xd27d4f)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x3de47c(0x1dd)](_0x3c5f6c){const _0x4dc8c2=a26_0x3de47c,{options:_0x5b8a55,args:_0x757920,tdx:_0x13ade6}=_0x3c5f6c,_0x31c018=_0x757920[0x0],_0x58298f=await withSpinner(_0x4dc8c2(0x1cf),()=>_0x13ade6[_0x4dc8c2(0x1e9)][_0x4dc8c2(0x1d0)](_0x31c018),{'verbose':_0x5b8a55[_0x4dc8c2(0x216)]}),_0x2d414f=_0x58298f[_0x4dc8c2(0x1e0)];let _0x383b8e;if(_0x2d414f[_0x4dc8c2(0x20e)]&&_0x2d414f[_0x4dc8c2(0x210)]){const _0x459774=new Date(_0x2d414f[_0x4dc8c2(0x20e)])[_0x4dc8c2(0x1ca)](),_0x112845=new Date(_0x2d414f[_0x4dc8c2(0x210)])['getTime']();_0x383b8e=Math[_0x4dc8c2(0x1c8)]((_0x112845-_0x459774)/0x3e8);}const _0x35590b={'job_id':_0x2d414f[_0x4dc8c2(0x1d5)],'type':_0x2d414f['type'],'status':_0x2d414f[_0x4dc8c2(0x215)],..._0x2d414f[_0x4dc8c2(0x1fb)]&&{'user_name':_0x2d414f[_0x4dc8c2(0x1fb)]},..._0x383b8e!==undefined&&{'duration_sec':_0x383b8e},..._0x2d414f[_0x4dc8c2(0x212)]&&{'created_at':_0x2d414f[_0x4dc8c2(0x212)]},..._0x2d414f[_0x4dc8c2(0x20e)]&&{'started_at':_0x2d414f[_0x4dc8c2(0x20e)]},..._0x2d414f[_0x4dc8c2(0x210)]&&{'end_at':_0x2d414f[_0x4dc8c2(0x210)]},..._0x2d414f[_0x4dc8c2(0x200)]&&{'database':_0x2d414f[_0x4dc8c2(0x200)]},..._0x2d414f[_0x4dc8c2(0x211)]!==undefined&&{'priority':_0x2d414f[_0x4dc8c2(0x211)]},..._0x2d414f[_0x4dc8c2(0x1ea)]&&{'url':_0x2d414f[_0x4dc8c2(0x1ea)]},..._0x2d414f[_0x4dc8c2(0x219)]&&{'query':_0x2d414f['query']},..._0x2d414f[_0x4dc8c2(0x1e6)]&&{'debug':_0x2d414f['debug']}};return await handleSingleObjectOutput(_0x35590b,_0x5b8a55),0x0;}}function a26_0x231f(_0x34c842,_0x41b837){_0x34c842=_0x34c842-0x1c0;const _0x32052c=a26_0x3205();let _0x231fa5=_0x32052c[_0x34c842];return _0x231fa5;}export class JobKillCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1fc);['description']=a26_0x3de47c(0x1d6);[a26_0x3de47c(0x1ef)](_0x28357b){const _0x4874ab=a26_0x3de47c,_0x3b1f29=_0x28357b['args'][0x0];if(!_0x3b1f29)return _0x4874ab(0x1f8);return undefined;}async['execute'](_0x5d2fc2){const _0x8068be=a26_0x3de47c,{options:_0x4f8939,args:_0x56165e,tdx:_0x2d9525}=_0x5d2fc2,_0x571bdb=_0x56165e[0x0];if(!_0x4f8939['yes']){const _0x2b2a5d=await confirm(_0x8068be(0x218)+_0x571bdb+'?');if(!_0x2b2a5d)return console[_0x8068be(0x1f3)](_0x8068be(0x1c1)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2d9525[_0x8068be(0x1e9)][_0x8068be(0x204)](_0x571bdb),{'verbose':_0x4f8939[_0x8068be(0x216)]}),console[_0x8068be(0x1f3)](_0x8068be(0x1d4)+_0x571bdb),console['error'](_0x8068be(0x1d7)+_0x571bdb+_0x8068be(0x1e8)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1c4);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1f2);async[a26_0x3de47c(0x1dd)](_0x73f376){const _0x53746b=a26_0x3de47c,{options:_0x560e7a,args:_0x3c565a,tdx:_0xb17db0}=_0x73f376,_0x4d9f2a=_0x560e7a[_0x53746b(0x1de)]||_0x53746b(0x1c6),_0x507bd9=_0x560e7a['file'],_0x416700=_0x560e7a[_0x53746b(0x200)]||'information_schema',_0x4a4e5f=_0x560e7a[_0x53746b(0x20d)];if(_0x4d9f2a!=='trino'&&_0x4d9f2a!==_0x53746b(0x205))throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x57f9f1;if(_0x507bd9){if(_0x3c565a[0x0])throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x59c4d8=readSqlStatementsFromFile(_0x507bd9);if(_0x59c4d8[_0x53746b(0x1d2)]===0x0)throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x59c4d8[_0x53746b(0x1d2)]>0x1)throw new SDKError(ErrorCode[_0x53746b(0x1e1)],_0x53746b(0x214));_0x57f9f1=_0x59c4d8[0x0];}else{if(!_0x3c565a[0x0])throw new SDKError(ErrorCode[_0x53746b(0x1e1)],_0x53746b(0x1d3));_0x57f9f1=_0x3c565a[0x0];}_0x560e7a[_0x53746b(0x216)]&&(console[_0x53746b(0x1f3)]('Job\x20type:\x20'+_0x4d9f2a),console[_0x53746b(0x1f3)](_0x53746b(0x1e2)+_0x416700),console[_0x53746b(0x1f3)](_0x53746b(0x1ee)+_0x57f9f1[_0x53746b(0x1e4)](0x0,0x64)+(_0x57f9f1[_0x53746b(0x1d2)]>0x64?'...':'')));const _0x300532=await withSpinner(_0x53746b(0x206),()=>_0xb17db0[_0x53746b(0x1e9)][_0x53746b(0x20c)](_0x416700,_0x57f9f1,_0x4d9f2a,_0x4a4e5f),{'verbose':_0x560e7a[_0x53746b(0x216)]}),_0x5e8795=_0x300532['data'];return console[_0x53746b(0x1f3)](_0x53746b(0x1d1)),console['error'](_0x53746b(0x20b)+_0x5e8795[_0x53746b(0x1d5)]),await handleSDKOutput([_0x5e8795],_0x560e7a),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1fa);[a26_0x3de47c(0x1ef)](_0x191c91){const _0x1def98=a26_0x3de47c,_0x274e66=_0x191c91[_0x1def98(0x1d8)][0x0];if(!_0x274e66)return _0x1def98(0x1c7);return undefined;}async[a26_0x3de47c(0x1dd)](_0x261870){const _0x114711=a26_0x3de47c,{options:_0x4c34a4,args:_0x358526,tdx:_0x2b3d7f}=_0x261870,_0x5694ab=_0x358526[0x0],_0x3b3fb1=await withSpinner(_0x114711(0x1e5),()=>_0x2b3d7f[_0x114711(0x1e9)][_0x114711(0x20d)](_0x5694ab),{'verbose':_0x4c34a4[_0x114711(0x216)]}),_0x411e49=_0x3b3fb1[_0x114711(0x1e0)];return console['error'](_0x114711(0x1cd)+_0x411e49[_0x114711(0x1d2)]+_0x114711(0x1c9)+(_0x411e49['length']!==0x1?'s':'')),await handleSDKOutput(_0x411e49,_0x4c34a4),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_0x23db74=a27_0x1431;(function(_0x55834d,_0x297a51){const _0x127b9d=a27_0x1431,_0x2b4b41=_0x55834d();while(!![]){try{const _0x1b53ca=-parseInt(_0x127b9d(0x1a4))/0x1+-parseInt(_0x127b9d(0x253))/0x2+-parseInt(_0x127b9d(0x21e))/0x3*(parseInt(_0x127b9d(0x24e))/0x4)+-parseInt(_0x127b9d(0x202))/0x5+parseInt(_0x127b9d(0x1c8))/0x6*(parseInt(_0x127b9d(0x252))/0x7)+parseInt(_0x127b9d(0x22e))/0x8+parseInt(_0x127b9d(0x174))/0x9*(parseInt(_0x127b9d(0x222))/0xa);if(_0x1b53ca===_0x297a51)break;else _0x2b4b41['push'](_0x2b4b41['shift']());}catch(_0x77c162){_0x2b4b41['push'](_0x2b4b41['shift']());}}}(a27_0x316d,0x688b9));import a27_0x43c880 from'chalk';import a27_0x16dbc4 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';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';function a27_0x316d(){const _0x51040b=['user','Getting\x20version\x20','description','has','\x20\x20Parent\x20segment:\x20','session','verbose','List\x20journeys\x20in\x20current\x20context','add','history','✔\x20Found\x20','journey:pause','939447Tavcpk','\x0aPull\x20summary:','from','completionRate','includeHistory','No\x20journeys\x20found','getSegment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20--version\x20option\x20is\x20required','versionNumber','Pattern:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','/j/da/je','/e/','List\x20activations\x20for\x20a\x20journey',',\x20version:\x20','reentryMode','segmentPushCommand','✔\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20new\x20files','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey:version:create','launched','Parent\x20segment:\x20','\x20\x20Folder\x20path:\x20','blue','filter','\x20\x20Journey\x20ID:\x20','state','Fetching\x20users\x20and\x20connections...','size','cwd','(draft)','sort','yes','\x20(rule\x20match)','Resolved\x20YAML\x20file:\x20','Getting\x20journey\x20details...','renderStats','getActivation','error','listActivationsFlat','archived','stage','connection','Error:\x20Invalid\x20--type\x20\x22','folderPath','23986TopJnb','execute','Error:\x20Version\x20','no_parent','Show\x20journey\x20statistics','Resolving\x20parent\x20segment...','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','base','attributes','resolveParentId','completed','cyan','relative','listJourneysFromParentSegment','all','INVALID_ARGUMENT','paused','\x20\x20Preserving\x20local\x20segment\x20name:\x20','get','\x20->\x20','journeyId','tdx.json','journeyStages','No\x20statistics\x20available\x20for\x20journey:\x20','.yml','journey:traffic','values','name','listJourneysWithFolders','resolveJourneyId','red','utf-8','site','file','goalSize','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','186jxlZdZ','Cancelled','targetDir','Getting\x20journey\x20statistics...','/j/da','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x0aError:','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20Target:\x20','stageNameMap','replace','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','🗺️\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','resolveSegment','Show\x20journey\x20details','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','isNew','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','message','Target\x20file:\x20','journeyBundleId','content','options','journeyName','Error:\x20','toLowerCase','set','Export\x20journey(s)\x20as\x20YAML\x20files','conversion','tsv','json','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','data','milestoneSize','helpText','updatedAt','parentSegment','log','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','Input:\x20','limit','\x22\x20resumed','Listing\x20journey\x20versions...','args','entries','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','links','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x22\x20paused','completeMilestoneRate','audienceId','Found\x20','Options:','stages','397885Ghczai','then','includeStats','Resume\x20a\x20paused\x20journey','\x20files?','Listing\x20journeys...','yellow','enteredSize','journey:view','segments','table','\x20(draft)\x20—\x20\x22','getJourney','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','format','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segment','getLatestJourneyId','push','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','buildIdToNameMap','join','\x27\x20not\x20found\x20in\x20','folderId','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','buildIdToEmailMap','green','687prrFuS','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)','Listing\x20journey\x20activations...','rule','20GiAKQP','journey','find','...','dim','exitOrJumpRate','connector_config','\x20details...','\x20=\x20','segmentName','journey:push','hasChanges','4546800ixdvOH','journey:pull','Database:\x20','Folder\x20path:\x20','\x20not\x20found.\x20Available:\x20','getTrafficData','(root)','parent_segment','getStatistics','kind','Error:\x20Journey\x20not\x20found:\x20','errorCode','map','Creating\x20new\x20version...','getColumnMapping','Getting\x20column\x20mapping...','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','/app/ps/','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','✔\x20Pulled\x20','Table:\x20','activationParams','Show\x20journey\x20table\x20column\x20mapping','\x20(ID:\x20','Pausing\x20journey...','createdAt','type','repeat','\x0aChanges\x20to\x20\x27','Pause\x20a\x20running\x20journey','journeyBundleName','(archived)','236zjWfUd','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','activation','rootFolderId','68348VUogxb','1069018OWRaTM','length','exitOrJumpSize','jsonl','\x20Opening\x20','hasPeriod','stringify','Fetching\x20parent\x20segment...','(paused)','createVersion','List\x20all\x20versions\x20of\x20a\x20journey','root\x20folder','Warning:\x20Could\x20not\x20resolve\x20activation\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','relativePath','dryRun','localeCompare','Error:\x20Stage\x20\x22','goal','setPhase','filePath'];a27_0x316d=function(){return _0x51040b;};return a27_0x316d();}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(_0x553001){return!_0x553001&&(console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error']('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x553001;}function withJsonFormat(_0x30201b){const _0x12a1f1=a27_0x1431;if(!_0x30201b[_0x12a1f1(0x210)]&&!_0x30201b[_0x12a1f1(0x1e8)]&&!_0x30201b[_0x12a1f1(0x256)]&&!_0x30201b[_0x12a1f1(0x1e7)])return{..._0x30201b,'format':_0x12a1f1(0x1e8),'json':!![]};return _0x30201b;}function formatJourneyState(_0x1ed60c){const _0x2d5435=a27_0x1431;switch(_0x1ed60c){case _0x2d5435(0x18b):return a27_0x43c880['green']('(running)');case'draft':return a27_0x43c880[_0x2d5435(0x226)](_0x2d5435(0x195));case _0x2d5435(0x1b4):return a27_0x43c880['yellow'](_0x2d5435(0x25b));case _0x2d5435(0x1ae):return a27_0x43c880[_0x2d5435(0x18e)]('(completed)');case _0x2d5435(0x19f):return a27_0x43c880['dim'](_0x2d5435(0x24d));default:return'('+_0x1ed60c+')';}}function formatJourneyItem(_0x3f857f,_0x151047='',_0x57bc84){const _0x1b1a87=a27_0x1431,_0x4a4669=formatJourneyState(_0x3f857f[_0x1b1a87(0x191)]),_0x340f53=_0x57bc84?hyperlink(_0x3f857f[_0x1b1a87(0x24c)],_0x57bc84):_0x3f857f[_0x1b1a87(0x24c)];return _0x151047+_0x1b1a87(0x1d4)+_0x340f53+'\x20'+_0x4a4669;}function a27_0x1431(_0x357591,_0x40b3e5){_0x357591=_0x357591-0x161;const _0x316d53=a27_0x316d();let _0x143191=_0x316d53[_0x357591];return _0x143191;}function escapeRegex(_0x568237){const _0x110f8f=a27_0x1431;return _0x568237[_0x110f8f(0x1d2)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x5e24b4){const _0x31213e=a27_0x1431,_0x399483=_0x5e24b4['split']('*')[_0x31213e(0x23a)](escapeRegex);return new RegExp(_0x399483['join']('.*'),'i');}function buildRuleToNameMapping(_0xb4f452){const _0x387075=a27_0x1431,_0x4816f2=new Map();if(_0xb4f452[_0x387075(0x20b)])for(const [_0x304929,_0x3cb077]of Object[_0x387075(0x1f7)](_0xb4f452[_0x387075(0x20b)])){if(_0x3cb077[_0x387075(0x221)]){const _0x4641e3=serializeRule(_0x3cb077['rule']),_0x4549b0=_0x4816f2[_0x387075(0x1b6)](_0x4641e3);_0x4549b0?_0x4549b0[_0x387075(0x215)](_0x304929):_0x4816f2['set'](_0x4641e3,[_0x304929]);}}return _0x4816f2;}async function resolveJourneyIdFromInput(_0x3a45e8,_0x1b692d,_0x2df3bb){const _0x190c56=a27_0x1431,_0x319d31=await resolveJourneyTarget(_0x3a45e8,_0x1b692d[_0x190c56(0x1ee)],_0x1b692d[_0x190c56(0x16e)]),_0x3e2088=_0x319d31['parentSegment'];if(!_0x3e2088)throw new SDKError(ErrorCode[_0x190c56(0x1b3)],_0x190c56(0x1fa));const _0x34f957=await withSpinner(_0x190c56(0x1a9),()=>_0x2df3bb['segment'][_0x190c56(0x1ad)](_0x3e2088),{'verbose':_0x1b692d['verbose']}),_0x55a9b5=_0x34f957['data'],_0x30b0c8=await withSpinner('Resolving\x20journey...',()=>_0x2df3bb[_0x190c56(0x223)][_0x190c56(0x1c1)](_0x55a9b5,_0x319d31[_0x190c56(0x1e1)]),{'verbose':_0x1b692d[_0x190c56(0x16e)]});return{'journeyId':_0x30b0c8[_0x190c56(0x1ea)],'journeyName':_0x319d31['journeyName'],'parentSegmentId':_0x55a9b5};}async function resolveJourneyTarget(_0x2dad51,_0x987053,_0x1be36f){const _0x303d85=a27_0x1431;if(isYamlFilePath(_0x2dad51))try{const _0x54dc74=await resolveYamlFilePath(_0x2dad51);return _0x1be36f&&(console[_0x303d85(0x19d)](_0x303d85(0x199)+_0x2dad51),console[_0x303d85(0x19d)](_0x303d85(0x16c)+_0x54dc74['parentSegment']),console[_0x303d85(0x19d)]('\x20\x20Name:\x20'+_0x54dc74[_0x303d85(0x22b)]),console[_0x303d85(0x19d)](_0x303d85(0x18d)+(_0x54dc74[_0x303d85(0x1a3)]||_0x303d85(0x234)))),{'journeyName':_0x54dc74[_0x303d85(0x22b)],'parentSegment':_0x54dc74[_0x303d85(0x1ee)],'resolved':_0x54dc74};}catch(_0x63dabe){throw new SDKError(ErrorCode[_0x303d85(0x1b3)],_0x303d85(0x1cf)+_0x63dabe['message']);}if(!_0x987053)throw new SDKError(ErrorCode[_0x303d85(0x1b3)],_0x303d85(0x1fb));return{'journeyName':_0x2dad51,'parentSegment':_0x987053};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x23db74(0x16a)]=a27_0x23db74(0x16f);async[a27_0x23db74(0x1a5)](_0xba717b){const _0x13e0b4=a27_0x23db74,{options:_0x52dba5,args:_0x5baf5a,tdx:_0x58a87c}=_0xba717b,_0x589710=_0x5baf5a[0x0],_0x121b7c=_0x52dba5[_0x13e0b4(0x1ee)];if(!_0x121b7c)return console[_0x13e0b4(0x19d)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x13e0b4(0x19d)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x4c18c0=await withSpinner(_0x13e0b4(0x1a9),()=>_0x58a87c[_0x13e0b4(0x213)]['resolveParentId'](_0x121b7c),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]}),_0x332c28=_0x4c18c0['data'];_0x52dba5['verbose']&&(console['error']('Parent\x20segment:\x20'+_0x121b7c+_0x13e0b4(0x245)+_0x332c28+')'),_0x589710&&console[_0x13e0b4(0x19d)](_0x13e0b4(0x17e)+_0x589710));const _0x50c44f=await withSpinner(_0x13e0b4(0x25a),()=>_0x58a87c[_0x13e0b4(0x213)]['getParentFull'](_0x332c28),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]}),_0x38f873=_0x50c44f[_0x13e0b4(0x1ea)],_0x2d8f1d=_0x38f873[_0x13e0b4(0x251)],_0x3129ce=await withSpinner(_0x13e0b4(0x207),()=>_0x58a87c['journey'][_0x13e0b4(0x1c0)](_0x332c28,_0x2d8f1d),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]});let _0x14031e=_0x3129ce[_0x13e0b4(0x1ea)]['journeys'];const _0x49d148=_0x3129ce[_0x13e0b4(0x1ea)]['folders'],_0x4a4a29=new Map();for(const _0x2b5faa of _0x49d148){_0x4a4a29[_0x13e0b4(0x1e4)](_0x2b5faa['id'],_0x2b5faa[_0x13e0b4(0x1bf)]);}if(_0x589710){const _0x4f5112=globToRegex(_0x589710);_0x14031e=_0x14031e[_0x13e0b4(0x18f)](_0xc19d31=>_0x4f5112['test'](_0xc19d31[_0x13e0b4(0x24c)]));}console[_0x13e0b4(0x19d)](_0x13e0b4(0x172)+_0x14031e['length']+'\x20journey'+(_0x14031e[_0x13e0b4(0x254)]!==0x1?'s':''));const _0x55628f=_0x39f057=>{const _0x81afbb=_0x13e0b4;return getConsoleNextUrl(_0x52dba5[_0x81afbb(0x1c4)],_0x81afbb(0x23f)+_0x332c28+_0x81afbb(0x181)+_0x39f057+_0x81afbb(0x1cc));};if(_0x52dba5[_0x13e0b4(0x210)]==='table')await handleSDKOutput(_0x14031e,_0x52dba5);else{if(_0x52dba5['format']===_0x13e0b4(0x1e8)){const _0x21dce2=_0x14031e['map'](_0x2b9d1a=>({..._0x2b9d1a,'url':_0x55628f(_0x2b9d1a['id'])}));await handleSDKOutput(_0x21dce2,_0x52dba5);}else{console[_0x13e0b4(0x1ef)]('['+_0x121b7c+']');const _0x32fd08=new Map(),_0xaff9e8=[];for(const _0x54b277 of _0x14031e){if(!_0x54b277[_0x13e0b4(0x21a)]||_0x54b277[_0x13e0b4(0x21a)]===_0x2d8f1d)_0xaff9e8[_0x13e0b4(0x215)](_0x54b277);else{const _0x468613=_0x32fd08['get'](_0x54b277[_0x13e0b4(0x21a)])||[];_0x468613[_0x13e0b4(0x215)](_0x54b277),_0x32fd08[_0x13e0b4(0x1e4)](_0x54b277[_0x13e0b4(0x21a)],_0x468613);}}const _0x5db9c7=(_0x5c615d,_0x3507c1)=>_0x5c615d[_0x13e0b4(0x24c)]['localeCompare'](_0x3507c1[_0x13e0b4(0x24c)],undefined,{'sensitivity':_0x13e0b4(0x1ab)});_0xaff9e8['sort'](_0x5db9c7);for(const _0x47a979 of _0xaff9e8){console['log'](formatJourneyItem(_0x47a979,'',_0x55628f(_0x47a979['id'])));}const _0x1d5d89=[..._0x32fd08[_0x13e0b4(0x1f7)]()][_0x13e0b4(0x196)]((_0x48204b,_0x564dcb)=>{const _0x157efb=_0x13e0b4,_0x4da3ce=_0x4a4a29[_0x157efb(0x1b6)](_0x48204b[0x0])||_0x48204b[0x0],_0x3a11f4=_0x4a4a29[_0x157efb(0x1b6)](_0x564dcb[0x0])||_0x564dcb[0x0];return _0x4da3ce[_0x157efb(0x163)](_0x3a11f4,undefined,{'sensitivity':_0x157efb(0x1ab)});});for(const [_0x363e57,_0x336955]of _0x1d5d89){const _0x4345e3=_0x4a4a29[_0x13e0b4(0x1b6)](_0x363e57)||_0x363e57;console[_0x13e0b4(0x1ef)]('📁\x20'+_0x4345e3),_0x336955[_0x13e0b4(0x196)](_0x5db9c7);for(const _0x36b0d8 of _0x336955){console[_0x13e0b4(0x1ef)](formatJourneyItem(_0x36b0d8,'\x20\x20',_0x55628f(_0x36b0d8['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x23db74(0x20a);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1d8);async[a27_0x23db74(0x1a5)](_0x469121){const _0x20cc61=a27_0x23db74,{options:_0x2f0d48,args:_0x2f081e,tdx:_0x16798b}=_0x469121,_0x51f94b=_0x2f081e[0x0];if(!_0x51f94b)return console[_0x20cc61(0x19d)](_0x20cc61(0x240)),console[_0x20cc61(0x19d)](_0x20cc61(0x1f8)),console[_0x20cc61(0x19d)](_0x20cc61(0x200)),console[_0x20cc61(0x19d)](_0x20cc61(0x1aa)),0x1;_0x2f0d48['verbose']&&console[_0x20cc61(0x19d)](_0x20cc61(0x1f2)+_0x51f94b);const {journeyId:_0x5efd4e,parentSegmentId:_0x58563e}=await resolveJourneyIdFromInput(_0x51f94b,_0x2f0d48,_0x16798b);if(_0x2f0d48['web']){const _0x38e7d3=getConsoleNextUrl(_0x2f0d48[_0x20cc61(0x1c4)],_0x20cc61(0x23f)+_0x58563e+'/e/'+_0x5efd4e+_0x20cc61(0x180));return console['error'](a27_0x43c880[_0x20cc61(0x21d)]('✔')+_0x20cc61(0x257)+a27_0x43c880[_0x20cc61(0x1af)](_0x38e7d3)),openBrowser(_0x38e7d3),0x0;}const _0x7c01af=await withSpinner(_0x20cc61(0x19a),()=>_0x16798b[_0x20cc61(0x223)]['getJourney'](_0x5efd4e),{'verbose':_0x2f0d48[_0x20cc61(0x16e)]}),_0x4895f6=_0x7c01af[_0x20cc61(0x1ea)],_0xea0285=_0x2f0d48[_0x20cc61(0x204)];let _0x53c6a2;if(_0xea0285)try{const _0x68da06=await withSpinner(_0x20cc61(0x1cb),()=>_0x16798b[_0x20cc61(0x223)][_0x20cc61(0x236)](_0x5efd4e),{'verbose':_0x2f0d48['verbose']});_0x53c6a2=_0x68da06[_0x20cc61(0x1ea)];}catch{_0x2f0d48[_0x20cc61(0x16e)]&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x47e684=getConsoleNextUrl(_0x2f0d48[_0x20cc61(0x1c4)],'/app/ps/'+_0x58563e+_0x20cc61(0x181)+_0x5efd4e+'/j/da/je'),_0x3c8ae3={'id':_0x4895f6['id'],'name':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1bf)],'description':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x16a)],'state':_0x4895f6['attributes']['state'],'paused':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1b4)],'reentry_mode':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x184)],'stages':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1ba)]?.[_0x20cc61(0x254)]||0x0,..._0x4895f6['attributes']['goal']&&{'goal':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x165)][_0x20cc61(0x1bf)]},..._0x53c6a2&&{'statistics':{'size':_0x53c6a2[_0x20cc61(0x193)],'entered':_0x53c6a2[_0x20cc61(0x209)],'goal_achieved':_0x53c6a2[_0x20cc61(0x1c6)],'completion_rate':_0x53c6a2[_0x20cc61(0x177)],'exit_or_jump':_0x53c6a2[_0x20cc61(0x255)],'exit_or_jump_rate':_0x53c6a2[_0x20cc61(0x227)],'stages':_0x53c6a2[_0x20cc61(0x201)]}},'url':_0x47e684};return await handleSingleObjectOutput(_0x3c8ae3,_0x2f0d48),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:stats';['description']=a27_0x23db74(0x1a8);async[a27_0x23db74(0x1a5)](_0x199a20){const _0xf3d8d2=a27_0x23db74,{options:_0x5c9984,args:_0x11ca65,tdx:_0x56f772}=_0x199a20,_0x23c2fb=_0x11ca65[0x0];if(!requireNameOrPath(_0x23c2fb))return 0x1;_0x5c9984[_0xf3d8d2(0x16e)]&&console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x1f2)+_0x23c2fb);const _0xd9f5b4=_0x5c9984,_0x4c39d5=_0xd9f5b4[_0xf3d8d2(0x176)],_0x488914=_0xd9f5b4['to'],_0x36cbc5=_0xd9f5b4['includeHistory'],_0x416787=_0xd9f5b4[_0xf3d8d2(0x1a0)];_0x36cbc5&&!_0x4c39d5&&!_0x488914&&console['error'](_0xf3d8d2(0x216));const _0x1de737=_0x36cbc5?withJsonFormat(_0x5c9984):_0x5c9984,{journeyId:_0x25f7d4,journeyName:_0x54cf3c}=await resolveJourneyIdFromInput(_0x23c2fb,_0x1de737,_0x56f772),_0x38816f=_0x4c39d5||_0x488914?{'from':_0x4c39d5,'to':_0x488914}:undefined,_0x5471fe=await withSpinner(_0xf3d8d2(0x1cb),()=>Promise[_0xf3d8d2(0x1b2)]([_0x56f772[_0xf3d8d2(0x223)][_0xf3d8d2(0x20e)](_0x25f7d4),_0x56f772[_0xf3d8d2(0x223)][_0xf3d8d2(0x236)](_0x25f7d4,_0x38816f)]),{'verbose':_0x1de737[_0xf3d8d2(0x16e)]}),[_0x21bf40,_0x2e34b9]=_0x5471fe[_0xf3d8d2(0x1ea)];if(!_0x2e34b9||_0x2e34b9[_0xf3d8d2(0x1b8)]===null)return console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x1bb)+_0x54cf3c),console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x21b)),0x0;const _0x1425bb=buildStageNameMap(_0x21bf40),_0x2f9456=!!(_0x38816f&&_0x2e34b9['history']?.[_0xf3d8d2(0x254)]),_0x1d82c5={'stageNameMap':_0x1425bb,'hasPeriod':_0x2f9456,'includeHistory':!!_0x36cbc5};if(_0x416787&&_0x2e34b9[_0xf3d8d2(0x201)]){const _0x414fca=_0x2e34b9['stages'][_0xf3d8d2(0x224)](_0x59d364=>{const _0x4d1b3d=_0xf3d8d2,_0x30236d=_0x1425bb[_0x4d1b3d(0x1b6)](_0x59d364['id'])??'';return _0x30236d[_0x4d1b3d(0x1e3)]()===_0x416787['toLowerCase']();});if(_0x414fca)return await handleSingleObjectOutput(formatStageStats(_0x414fca,_0x1d82c5),_0x1de737),0x0;const _0x3f464e=_0x2e34b9[_0xf3d8d2(0x201)][_0xf3d8d2(0x23a)](_0x54481f=>_0x1425bb[_0xf3d8d2(0x1b6)](_0x54481f['id'])??_0x54481f['id']);return console['error'](_0xf3d8d2(0x164)+_0x416787+'\x22\x20not\x20found'),console[_0xf3d8d2(0x19d)]('Available\x20stages:\x20'+_0x3f464e[_0xf3d8d2(0x218)](',\x20')),0x1;}const _0x3d80d6=_0x2e34b9[_0xf3d8d2(0x201)]?.[_0xf3d8d2(0x23a)](_0x5d4410=>formatStageStats(_0x5d4410,_0x1d82c5)),_0x492c6f=assembleJourneyStats(_0x2e34b9,{'from':_0x4c39d5,'to':_0x488914,'includeHistory':_0x36cbc5});return await this[_0xf3d8d2(0x19b)](_0x492c6f,_0x3d80d6??[],_0x1de737),0x0;}async[a27_0x23db74(0x19b)](_0xd899d7,_0x15e90b,_0x454be3){const _0x59383f=a27_0x23db74,_0x4ccd1e=_0x454be3[_0x59383f(0x210)]==='json'||_0x454be3['format']===_0x59383f(0x256)||_0x454be3['json']||_0x454be3['jsonl'];if(_0x4ccd1e){_0xd899d7[_0x59383f(0x201)]=_0x15e90b,await handleSingleObjectOutput(_0xd899d7,_0x454be3);return;}await handleSingleObjectOutput(_0xd899d7,_0x454be3);for(const _0xa03a4c of _0x15e90b){console[_0x59383f(0x1ef)](''),console[_0x59383f(0x1ef)](String(a27_0x43c880['cyan']['bold']('['+_0xa03a4c[_0x59383f(0x1bf)]+']'))+a27_0x43c880[_0x59383f(0x226)]('\x20'+_0xa03a4c['id']));const {id:_0x58ad5c,name:_0x5882df,..._0xfd74e2}=_0xa03a4c;await handleSingleObjectOutput(_0xfd74e2,_0x454be3);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a27_0x23db74(0x1bd);[a27_0x23db74(0x16a)]=a27_0x23db74(0x17f);async[a27_0x23db74(0x1a5)](_0x486190){const _0xdd1d45=a27_0x23db74,{options:_0x1e4c9c,args:_0x19aa67,tdx:_0x373f13}=_0x486190,_0x468d3f=_0x19aa67[0x0];if(!requireNameOrPath(_0x468d3f))return 0x1;_0x1e4c9c[_0xdd1d45(0x16e)]&&console['error'](_0xdd1d45(0x1f2)+_0x468d3f);const _0x36f545=_0x1e4c9c,_0x277285=_0x36f545[_0xdd1d45(0x248)],_0x3aed51=_0x36f545[_0xdd1d45(0x176)],_0x2a110f=_0x36f545['to'],_0x16f000=_0x36f545[_0xdd1d45(0x1f3)];if(_0x277285&&_0x277285!==_0xdd1d45(0x1e6)&&_0x277285!==_0xdd1d45(0x250))return console[_0xdd1d45(0x19d)](_0xdd1d45(0x1a2)+_0x277285+_0xdd1d45(0x24f)),0x1;const _0x1063ab=withJsonFormat(_0x1e4c9c),{journeyId:_0x18f9b6,journeyName:_0x118dee}=await resolveJourneyIdFromInput(_0x468d3f,_0x1063ab,_0x373f13),_0x5a1370={'type':_0x277285,'from':_0x3aed51,'to':_0x2a110f,'limit':_0x16f000},_0x433c46=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x373f13['journey'][_0xdd1d45(0x233)](_0x18f9b6,_0x5a1370),{'verbose':_0x1063ab[_0xdd1d45(0x16e)]}),_0x114793=_0x433c46[_0xdd1d45(0x1ea)],_0xb50d1a=_0x114793[_0xdd1d45(0x1e6)]&&(_0x114793[_0xdd1d45(0x1e6)]['nodes'][_0xdd1d45(0x254)]>0x0||_0x114793[_0xdd1d45(0x1e6)][_0xdd1d45(0x1f9)][_0xdd1d45(0x254)]>0x0),_0x2ea293=_0x114793['activation']&&_0x114793[_0xdd1d45(0x250)][_0xdd1d45(0x254)]>0x0;if(!_0xb50d1a&&!_0x2ea293)return console[_0xdd1d45(0x19d)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x118dee),console[_0xdd1d45(0x19d)](_0xdd1d45(0x23e)),_0x3aed51&&_0x2a110f&&console[_0xdd1d45(0x19d)](_0xdd1d45(0x211)),0x0;return await handleSingleObjectOutput(_0x114793,_0x1063ab),0x0;}}function formatStageStats(_0x19649f,_0x2f8748){const _0x353cc6=a27_0x23db74,_0x3282b1=_0x2f8748[_0x353cc6(0x258)]&&_0x19649f[_0x353cc6(0x171)]?.[_0x353cc6(0x254)]?aggregateStageHistory(_0x19649f[_0x353cc6(0x171)]):{'size':_0x19649f[_0x353cc6(0x193)],'entered':_0x19649f[_0x353cc6(0x209)],'milestone':_0x19649f[_0x353cc6(0x1eb)],'milestone_rate':_0x19649f[_0x353cc6(0x1fd)],'exit_or_jump':_0x19649f[_0x353cc6(0x255)],'exit_or_jump_rate':_0x19649f[_0x353cc6(0x227)]},_0x199f71={'id':_0x19649f['id'],'name':_0x2f8748[_0x353cc6(0x1d1)][_0x353cc6(0x1b6)](_0x19649f['id'])??_0x19649f['id'],..._0x3282b1};return _0x2f8748[_0x353cc6(0x258)]&&_0x2f8748[_0x353cc6(0x178)]&&_0x19649f[_0x353cc6(0x171)]&&(_0x199f71[_0x353cc6(0x171)]=_0x19649f[_0x353cc6(0x171)]),_0x199f71;}export class JourneyPauseCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x173);['description']=a27_0x23db74(0x24b);async['execute'](_0x470e4c){const _0x29c0a5=a27_0x23db74,{options:_0x5916e3,args:_0x45f06d,tdx:_0x40d409}=_0x470e4c,_0x122706=_0x45f06d[0x0];if(!requireNameOrPath(_0x122706))return 0x1;_0x5916e3['verbose']&&console[_0x29c0a5(0x19d)](_0x29c0a5(0x1f2)+_0x122706);const {journeyId:_0x365a0f,journeyName:_0x25037e}=await resolveJourneyIdFromInput(_0x122706,_0x5916e3,_0x40d409);if(!_0x5916e3['yes']){const _0x48cf1f=await confirm(_0x29c0a5(0x20f)+_0x25037e+'\x22?');if(!_0x48cf1f)return console[_0x29c0a5(0x19d)](_0x29c0a5(0x1c9)),0x0;}const _0x1a8bbb=await withSpinner(_0x29c0a5(0x246),()=>_0x40d409['journey']['pause'](_0x365a0f),{'verbose':_0x5916e3[_0x29c0a5(0x16e)]}),_0x3abe73=_0x1a8bbb['data'];return console['error']('✔\x20Journey\x20\x22'+_0x3abe73[_0x29c0a5(0x1ac)][_0x29c0a5(0x1bf)]+_0x29c0a5(0x1fc)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:resume';[a27_0x23db74(0x16a)]=a27_0x23db74(0x205);async[a27_0x23db74(0x1a5)](_0x2ecf91){const _0x569d9d=a27_0x23db74,{options:_0x32e5de,args:_0x3a68d0,tdx:_0x5117a0}=_0x2ecf91,_0x2573ed=_0x3a68d0[0x0];if(!requireNameOrPath(_0x2573ed))return 0x1;_0x32e5de['verbose']&&console[_0x569d9d(0x19d)](_0x569d9d(0x1f2)+_0x2573ed);const {journeyId:_0x3ba2f4,journeyName:_0xef9d5a}=await resolveJourneyIdFromInput(_0x2573ed,_0x32e5de,_0x5117a0);if(!_0x32e5de[_0x569d9d(0x197)]){const _0x3eabdc=await confirm(_0x569d9d(0x1db)+_0xef9d5a+'\x22?');if(!_0x3eabdc)return console[_0x569d9d(0x19d)]('Cancelled'),0x0;}const _0x41848d=await withSpinner('Resuming\x20journey...',()=>_0x5117a0['journey']['resume'](_0x3ba2f4),{'verbose':_0x32e5de[_0x569d9d(0x16e)]}),_0x246088=_0x41848d[_0x569d9d(0x1ea)];return console[_0x569d9d(0x19d)]('✔\x20Journey\x20\x22'+_0x246088[_0x569d9d(0x1ac)][_0x569d9d(0x1bf)]+_0x569d9d(0x1f4)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x22f);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1e5);async[a27_0x23db74(0x1a5)](_0x281bac){const _0x3a5323=a27_0x23db74,{options:_0x4dcf27,args:_0x26bbe6,tdx:_0x4ff4f7}=_0x281bac,_0x5c2a02=_0x4dcf27,_0x328ff2=_0x26bbe6[0x0],_0x437fe3=_0x328ff2&&isYamlFilePath(_0x328ff2),_0xb33ce=await resolveTarget({'arg':_0x437fe3?_0x328ff2:undefined,'contextParent':_0x4dcf27[_0x3a5323(0x1ee)],'cwd':process[_0x3a5323(0x194)]()});if(!isSuccessfulResolution(_0xb33ce))return _0xb33ce[_0x3a5323(0x239)]===_0x3a5323(0x1a7)?(console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x208)](_0x3a5323(0x1e9))),console[_0x3a5323(0x19d)](_0x3a5323(0x21f)),console[_0x3a5323(0x19d)](_0x3a5323(0x1d6)),console[_0x3a5323(0x19d)](_0x3a5323(0x187)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x1c2)](_0x3a5323(0x1e2)+_0xb33ce['message']+'\x0a')),_0xb33ce[_0x3a5323(0x1ec)]&&console[_0x3a5323(0x19d)](a27_0x43c880['cyan'](_0xb33ce[_0x3a5323(0x1ec)]))),0x1;let _0x18db3d=_0x437fe3?undefined:_0x328ff2,_0x30bfed,_0x3fc52d;_0xb33ce[_0x3a5323(0x248)]===_0x3a5323(0x1c5)&&(_0x18db3d=_0xb33ce['resourceName'],_0x30bfed=_0xb33ce[_0x3a5323(0x167)],_0x3fc52d=_0xb33ce[_0x3a5323(0x1a3)]);const _0x1e77f6=_0xb33ce[_0x3a5323(0x1f1)],_0x196322=_0xb33ce[_0x3a5323(0x1ca)];_0x5c2a02['verbose']&&(console[_0x3a5323(0x19d)](_0x3a5323(0x18c)+_0x1e77f6),console[_0x3a5323(0x19d)]('Target\x20directory:\x20'+_0x196322),_0x18db3d&&console[_0x3a5323(0x19d)]('Journey\x20name:\x20'+_0x18db3d),_0x30bfed&&console['error'](_0x3a5323(0x1dd)+_0x30bfed),_0x3fc52d&&console['error'](_0x3a5323(0x231)+_0x3fc52d));const _0x46da31=await withSpinner(_0x3a5323(0x1a9),()=>_0x4ff4f7[_0x3a5323(0x213)]['resolveParentId'](_0x1e77f6),{'verbose':_0x4dcf27[_0x3a5323(0x16e)]}),_0xad9546=_0x46da31['data'],{journeys:_0x22d1b3,folders:_0x7de3a8}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x9dceae=_0x3a5323,[_0x36cbc2,_0x47f359]=await Promise[_0x9dceae(0x1b2)]([_0x4ff4f7['journey'][_0x9dceae(0x1b1)](_0xad9546,undefined,{'includeAllVersions':!![]}),_0x4ff4f7[_0x9dceae(0x213)]['listFolders'](_0xad9546)]);return{'journeys':_0x36cbc2,'folders':_0x47f359};},{'verbose':_0x4dcf27[_0x3a5323(0x16e)]})[_0x3a5323(0x203)](_0x2c94d8=>_0x2c94d8[_0x3a5323(0x1ea)]);let _0x2f2ac1=_0x22d1b3;const _0x32e080=buildFolderIdToPathMap(_0x7de3a8);if(_0x18db3d){const _0x4da4d7=_0x2f2ac1[_0x3a5323(0x18f)](_0x54377b=>_0x54377b['journeyBundleName'][_0x3a5323(0x1e3)]()===_0x18db3d[_0x3a5323(0x1e3)]());if(_0x4da4d7[_0x3a5323(0x254)]===0x0)return console['error'](_0x3a5323(0x238)+_0x18db3d),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x2f2ac1=_0x4da4d7;}if(_0x3fc52d!==undefined){const _0x34f26c=_0x2f2ac1[_0x3a5323(0x18f)](_0x6ad6b2=>{const _0x5f1371=_0x3a5323,_0x517d3f=_0x6ad6b2['folderId']?_0x32e080[_0x5f1371(0x1b6)](_0x6ad6b2[_0x5f1371(0x21a)])||'':'';return _0x517d3f===_0x3fc52d;});if(_0x34f26c['length']===0x0&&_0x2f2ac1[_0x3a5323(0x254)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x18db3d+_0x3a5323(0x219)+(_0x3fc52d||_0x3a5323(0x25e))),console['error'](_0x3a5323(0x1c7));for(const _0x21bcf8 of _0x2f2ac1){const _0x4398ea=_0x21bcf8[_0x3a5323(0x21a)]?_0x32e080[_0x3a5323(0x1b6)](_0x21bcf8['folderId'])||'':'';console['error']('\x20\x20-\x20'+(_0x4398ea||_0x3a5323(0x234))+'/'+_0x21bcf8[_0x3a5323(0x24c)]);}return 0x1;}_0x2f2ac1=_0x34f26c;}if(_0x2f2ac1['length']===0x0)return console['error'](_0x3a5323(0x179)),0x0;const _0x4e20ab=new Map();for(const _0x12ca3b of _0x2f2ac1){const _0x4de515=_0x12ca3b[_0x3a5323(0x1de)];!_0x4e20ab[_0x3a5323(0x16b)](_0x4de515)&&_0x4e20ab[_0x3a5323(0x1e4)](_0x4de515,[]),_0x4e20ab['get'](_0x4de515)['push'](_0x12ca3b);}for(const _0x1123db of _0x4e20ab[_0x3a5323(0x1be)]()){_0x1123db[_0x3a5323(0x196)]((_0x4ce983,_0x14afc3)=>(_0x4ce983['versionNumber']||0x0)-(_0x14afc3[_0x3a5323(0x17d)]||0x0));}const _0x5ca0bc=[],{idToEmailMap:_0x4df5b1,connectionIdToNameMap:_0x53b0aa}=await withSpinner(_0x3a5323(0x192),async()=>{const _0x4d51d9=_0x3a5323,[_0x46eb83,_0xeb104c]=await Promise[_0x4d51d9(0x1b2)]([_0x4ff4f7[_0x4d51d9(0x168)][_0x4d51d9(0x21c)](),_0x4ff4f7['connection'][_0x4d51d9(0x217)]()]);return{'idToEmailMap':_0x46eb83,'connectionIdToNameMap':_0xeb104c};},{'verbose':_0x4dcf27[_0x3a5323(0x16e)]})['then'](_0x5c72a1=>_0x5c72a1[_0x3a5323(0x1ea)]);for(const _0x57bb37 of _0x4e20ab[_0x3a5323(0x1be)]()){const _0x11e483=_0x57bb37[0x0][_0x3a5323(0x24c)],_0x4c6057=_0x57bb37[0x0][_0x3a5323(0x21a)],_0x369672=_0x4c6057?_0x32e080[_0x3a5323(0x1b6)](_0x4c6057)||'':'',_0x3fbd23=_0x369672?a27_0x16dbc4[_0x3a5323(0x218)](_0x196322,_0x369672):_0x196322,_0x289a55=_0x30bfed||a27_0x16dbc4[_0x3a5323(0x218)](_0x3fbd23,sanitizeFileName(_0x11e483)+_0x3a5323(0x1bc));let _0x2910fa,_0x208a59;if(existsSync(_0x289a55))try{const _0x277012=readFileSync(_0x289a55,_0x3a5323(0x1c3)),_0x30cd79=parseYamlString(_0x277012);_0x208a59=_0x30cd79,_0x2910fa=buildRuleToNameMapping(_0x30cd79),_0x5c2a02[_0x3a5323(0x16e)]&&_0x2910fa[_0x3a5323(0x193)]>0x0&&console[_0x3a5323(0x19d)](_0x3a5323(0x1ff)+_0x2910fa[_0x3a5323(0x193)]+_0x3a5323(0x212)+_0x11e483);}catch(_0x33858d){_0x5c2a02[_0x3a5323(0x16e)]&&console[_0x3a5323(0x19d)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x33858d[_0x3a5323(0x1dc)]);}const _0x446184=[],_0x5656d7=new Set(),_0x3bbfdd=new Map(),_0x2f240d=new Map(),_0x1b82bb=new Set(),_0x32b6eb=new Map(),_0x45aefc=new Map(),_0x189b1a=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x11e483+_0x3a5323(0x225),async _0x274470=>{const _0x166a6e=_0x3a5323;for(const _0x43c608 of _0x57bb37){const _0x50f632=_0x57bb37[_0x166a6e(0x254)]>0x1?_0x43c608[_0x166a6e(0x24c)]+'\x20v'+(_0x43c608[_0x166a6e(0x17d)]||0x1):_0x43c608[_0x166a6e(0x24c)];_0x274470[_0x166a6e(0x166)]('Fetching\x20'+_0x50f632);const _0x3a6337=await _0x4ff4f7[_0x166a6e(0x223)][_0x166a6e(0x20e)](_0x43c608['id']),_0x1bdd66=_0x3a6337[_0x166a6e(0x1ac)]?.[_0x166a6e(0x1fe)],_0x3a87c4={'resolveSegment':async _0x485b61=>{const _0xa93aba=_0x166a6e;if(!_0x1bdd66)return{'name':_0x485b61,'isJourneyLocal':![]};const _0x1e0c7a=_0x3bbfdd[_0xa93aba(0x1b6)](_0x485b61);if(_0x1e0c7a)return _0x1e0c7a;try{const _0x33af2b=await _0x4ff4f7[_0xa93aba(0x213)][_0xa93aba(0x17a)](_0x1bdd66,_0x485b61),_0x43ca4f=_0x33af2b[_0xa93aba(0x237)]===SEGMENT_KIND_JOURNEY;let _0x2c0be6,_0x2e0984=_0x33af2b['name'];if(_0x43ca4f&&_0x33af2b[_0xa93aba(0x221)]){const _0x5c0b49=await segmentResponseToDef(_0x33af2b,{'resolveSegmentName':async _0x50748d=>{const _0x46c878=_0xa93aba,_0x41bedb=_0x3bbfdd[_0x46c878(0x1b6)](_0x50748d);if(_0x41bedb)return _0x41bedb['name'];const _0x413f75=await _0x3a87c4[_0x46c878(0x1d7)](_0x50748d);return _0x413f75[_0x46c878(0x1bf)];}}),_0x4da827=_0x5c0b49['rule'];_0x2c0be6={'description':_0x33af2b[_0xa93aba(0x16a)],'rule':_0x4da827};const _0xfe48c8=serializeRule(_0x4da827),_0x377cd5=_0x2f240d[_0xa93aba(0x1b6)](_0xfe48c8);if(_0x377cd5)_0x2e0984=_0x377cd5,_0x2c0be6=undefined,_0x5c2a02[_0xa93aba(0x16e)]&&console['error'](_0xa93aba(0x1d5)+_0x33af2b[_0xa93aba(0x1bf)]+_0xa93aba(0x1b7)+_0x377cd5);else{let _0x3f2fe1=![];if(_0x2910fa){const _0x5da588=_0x2910fa[_0xa93aba(0x1b6)](_0xfe48c8);if(_0x5da588){const _0x2bf68f=_0x5da588[_0xa93aba(0x224)](_0x152316=>!_0x5656d7['has'](_0x152316));_0x2bf68f&&(_0x2e0984=_0x2bf68f,_0x5656d7[_0xa93aba(0x170)](_0x2bf68f),_0x2f240d[_0xa93aba(0x1e4)](_0xfe48c8,_0x2bf68f),_0x3f2fe1=!![],_0x5c2a02['verbose']&&console[_0xa93aba(0x19d)](_0xa93aba(0x1b5)+_0x2bf68f+_0xa93aba(0x198)));}}if(!_0x3f2fe1){const _0x4df4d9=generateJourneyLocalName(_0x33af2b['name']);_0x4df4d9&&(_0x2e0984=_0x4df4d9);let _0x35c33c=_0x2e0984,_0x12f8a3=0x2;while(_0x5656d7[_0xa93aba(0x16b)](_0x35c33c)){_0x35c33c=_0x2e0984+'_'+_0x12f8a3,_0x12f8a3++;}_0x5656d7[_0xa93aba(0x170)](_0x35c33c),_0x2f240d[_0xa93aba(0x1e4)](_0xfe48c8,_0x35c33c),_0x2e0984=_0x35c33c;}}}const _0x59a8ee={'name':_0x2e0984,'isJourneyLocal':_0x43ca4f,'definition':_0x2c0be6};return _0x3bbfdd[_0xa93aba(0x1e4)](_0x485b61,_0x59a8ee),_0x59a8ee;}catch(_0x4cac1e){return _0x4dcf27['verbose']&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x485b61+':\x20'+_0x4cac1e[_0xa93aba(0x1dc)]),{'name':_0x485b61,'isJourneyLocal':![]};}},'resolveActivation':async _0x569c04=>{const _0xf7df7d=_0x166a6e,_0x29e1d7=_0x32b6eb[_0xf7df7d(0x1b6)](_0x569c04);if(_0x29e1d7)return _0x29e1d7;try{const _0x2adc13=await _0x4ff4f7[_0xf7df7d(0x223)][_0xf7df7d(0x19c)](_0x43c608['id'],_0x569c04),_0x157fd3=journeyActivationStepToYaml(_0x2adc13,_0x4df5b1,_0x53b0aa),_0xb10492=JSON[_0xf7df7d(0x259)]({'name':_0x157fd3[_0xf7df7d(0x1bf)],'connection':_0x157fd3[_0xf7df7d(0x1a1)],'connector_config':_0x157fd3[_0xf7df7d(0x228)]}),_0x48d3ae=_0x45aefc['get'](_0xb10492);if(_0x48d3ae){const _0xddabfe={'name':_0x48d3ae,'isJourneyLocal':!![],'definition':_0x157fd3};return _0x32b6eb[_0xf7df7d(0x1e4)](_0x569c04,_0xddabfe),_0xddabfe;}const _0x35c597=_0x2adc13[_0xf7df7d(0x1ac)][_0xf7df7d(0x243)]['name']||_0x569c04,_0x51afcb=sanitizeYamlKey(_0x35c597)||'activation_'+_0x569c04;let _0x1baf3a=_0x51afcb,_0x2ee62d=0x2;while(_0x1b82bb['has'](_0x1baf3a)){_0x1baf3a=_0x51afcb+'_'+_0x2ee62d,_0x2ee62d++;}_0x1b82bb[_0xf7df7d(0x170)](_0x1baf3a),_0x45aefc[_0xf7df7d(0x1e4)](_0xb10492,_0x1baf3a);const _0x188c65={'name':_0x1baf3a,'isJourneyLocal':!![],'definition':_0x157fd3};return _0x32b6eb[_0xf7df7d(0x1e4)](_0x569c04,_0x188c65),_0x188c65;}catch(_0x42f619){return _0x4dcf27['verbose']&&console[_0xf7df7d(0x19d)](_0xf7df7d(0x25f)+_0x569c04+':\x20'+_0x42f619[_0xf7df7d(0x1dc)]),{'name':_0x569c04,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x43a7c6,_0x60ed2e)=>{const _0x507e9e=_0x166a6e;return resolveJumpTarget(_0x43a7c6,_0x60ed2e,_0x189b1a,_0xc68938=>_0x4ff4f7[_0x507e9e(0x223)][_0x507e9e(0x20e)](_0xc68938));}},_0x22d390=await journeyResponseToDef(_0x3a6337,_0x3a87c4);_0x446184['push']({'item':_0x43c608,'yaml':_0x22d390});}},{'verbose':_0x4dcf27['verbose']});const _0x3699cb=await _0x4ff4f7['journey'][_0x3a5323(0x214)](_0x57bb37[0x0][_0x3a5323(0x1de)]),_0x1ad52c=buildMergedJourneyDef(_0x446184,_0x2910fa,_0x3699cb),_0x5456f7=normalizeJourneyDef(_0x1ad52c,_0x208a59),_0x59a7c0=toYamlString(_0x5456f7),_0x5b6f63=_0x30bfed||a27_0x16dbc4['join'](_0x3fbd23,sanitizeFileName(_0x11e483)+_0x3a5323(0x1bc));!_0x30bfed&&_0x369672&&!existsSync(_0x3fbd23)&&mkdirSync(_0x3fbd23,{'recursive':!![]});const _0x577e87=a27_0x16dbc4[_0x3a5323(0x1b0)](process[_0x3a5323(0x194)](),_0x5b6f63);if(existsSync(_0x5b6f63)){const _0x3ad3f5=readFileSync(_0x5b6f63,_0x3a5323(0x1c3)),_0x4028ca=generateDiff(_0x3ad3f5,_0x59a7c0),_0x23e785=hasChanges(_0x4028ca);_0x5ca0bc[_0x3a5323(0x215)]({'relativePath':_0x577e87,'absolutePath':_0x5b6f63,'content':_0x59a7c0,'isNew':![],'hasChanges':_0x23e785,'diff':_0x23e785?formatDiffWithColors(_0x4028ca):undefined});}else _0x5ca0bc['push']({'relativePath':_0x577e87,'absolutePath':_0x5b6f63,'content':_0x59a7c0,'isNew':!![],'hasChanges':![]});}const _0x1e8511=_0x5ca0bc['filter'](_0x2fa122=>_0x2fa122['isNew']),_0x9f5c4d=_0x5ca0bc['filter'](_0x12b478=>!_0x12b478['isNew']&&_0x12b478[_0x3a5323(0x22d)]),_0x181202=_0x5ca0bc['filter'](_0x5751a4=>!_0x5751a4['isNew']&&!_0x5751a4[_0x3a5323(0x22d)]),_0x1efe51=_0x2f2ac1[_0x3a5323(0x254)],_0x2cc7a7=_0x4e20ab['size'],_0x12f5b8=_0x1efe51>_0x2cc7a7?'\x20('+_0x1efe51+'\x20versions)':'';console['error'](_0x3a5323(0x175)),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880[_0x3a5323(0x1af)](_0x2cc7a7+'\x20journeys')+a27_0x43c880[_0x3a5323(0x226)](_0x12f5b8)),console['error']('\x20\x20'+a27_0x43c880[_0x3a5323(0x21d)]('+\x20'+_0x1e8511[_0x3a5323(0x254)]+_0x3a5323(0x188))),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880['yellow']('~\x20'+_0x9f5c4d[_0x3a5323(0x254)]+'\x20changed\x20files')),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880[_0x3a5323(0x226)]('=\x20'+_0x181202['length']+'\x20unchanged\x20files')),console[_0x3a5323(0x19d)](_0x3a5323(0x1d0)+a27_0x43c880['cyan'](_0x196322)+'\x0a');if(_0x9f5c4d[_0x3a5323(0x254)]>0x0)for(const _0x35c42b of _0x9f5c4d){console[_0x3a5323(0x19d)](_0x3a5323(0x24a)+_0x35c42b[_0x3a5323(0x161)]+'\x27:'),console[_0x3a5323(0x19d)]('─'[_0x3a5323(0x249)](0x3c)),console['error'](_0x35c42b['diff']),console['error']('─'[_0x3a5323(0x249)](0x3c));}if(_0x5c2a02[_0x3a5323(0x162)])return console['error'](a27_0x43c880[_0x3a5323(0x208)](_0x3a5323(0x1f0))),0x0;if(_0x1e8511[_0x3a5323(0x254)]===0x0&&_0x9f5c4d[_0x3a5323(0x254)]===0x0)return console['error'](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x260))),saveSessionContext({'parent_segment':_0x1e77f6},_0x5c2a02[_0x3a5323(0x16d)]),console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x186)+a27_0x43c880[_0x3a5323(0x226)]('parent_segment')+_0x3a5323(0x22a)+a27_0x43c880[_0x3a5323(0x1af)](_0x1e77f6))),0x0;if(!_0x5c2a02['yes']&&(_0x1e8511[_0x3a5323(0x254)]>0x0||_0x9f5c4d[_0x3a5323(0x254)]>0x0)){if(!isInteractive())return console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x1c2)](_0x3a5323(0x1ce)),_0x3a5323(0x1d9)),console['error'](a27_0x43c880['dim'](_0x3a5323(0x17b))),0x1;const _0x3f77a1=await confirmKey('Write\x20'+(_0x1e8511[_0x3a5323(0x254)]+_0x9f5c4d['length'])+_0x3a5323(0x206));if(!_0x3f77a1)return console['error'](a27_0x43c880[_0x3a5323(0x208)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x196322)&&mkdirSync(_0x196322,{'recursive':!![]});const _0x21dbd0=a27_0x16dbc4['join'](_0x196322,_0x3a5323(0x1b9));writeFileSync(_0x21dbd0,createTdxConfigContent(_0x1e77f6),_0x3a5323(0x1c3));for(const _0x3ece4b of _0x5ca0bc){(_0x3ece4b[_0x3a5323(0x1da)]||_0x3ece4b[_0x3a5323(0x22d)])&&writeFileSync(_0x3ece4b['absolutePath'],_0x3ece4b[_0x3a5323(0x1df)],_0x3a5323(0x1c3));}return console['error'](a27_0x43c880['green'](_0x3a5323(0x241)+(_0x1e8511[_0x3a5323(0x254)]+_0x9f5c4d[_0x3a5323(0x254)])+'\x20journey\x20files\x20to\x20'+_0x196322)),saveSessionContext({'parent_segment':_0x1e77f6},_0x5c2a02[_0x3a5323(0x16d)]),console['error'](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x186)+a27_0x43c880[_0x3a5323(0x226)](_0x3a5323(0x235))+_0x3a5323(0x22a)+a27_0x43c880['cyan'](_0x1e77f6))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:columns';[a27_0x23db74(0x16a)]=a27_0x23db74(0x244);async[a27_0x23db74(0x1a5)](_0x2ff58e){const _0x4d1119=a27_0x23db74,{options:_0x3f4a28,args:_0x565369,tdx:_0x479988}=_0x2ff58e,_0x33df66=_0x565369[0x0];if(!requireNameOrPath(_0x33df66))return 0x1;_0x3f4a28[_0x4d1119(0x16e)]&&console[_0x4d1119(0x19d)]('Input:\x20'+_0x33df66);const {journeyId:_0x422ee2}=await resolveJourneyIdFromInput(_0x33df66,_0x3f4a28,_0x479988),_0x4d8800=await withSpinner(_0x4d1119(0x23d),()=>_0x479988[_0x4d1119(0x223)][_0x4d1119(0x23c)](_0x422ee2),{'verbose':_0x3f4a28[_0x4d1119(0x16e)]}),_0x1b1157=_0x4d8800[_0x4d1119(0x1ea)];return console['log'](_0x4d1119(0x230)+_0x1b1157['database']),console[_0x4d1119(0x1ef)](_0x4d1119(0x242)+_0x1b1157[_0x4d1119(0x20c)]),await handleSDKOutput(_0x1b1157['columns'],_0x3f4a28),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:activations';[a27_0x23db74(0x16a)]=a27_0x23db74(0x182);async[a27_0x23db74(0x1a5)](_0x192c1b){const _0x39311f=a27_0x23db74,{options:_0x468a97,args:_0x572053,tdx:_0x3defe1}=_0x192c1b,_0x200c56=_0x572053[0x0];if(!requireNameOrPath(_0x200c56))return 0x1;_0x468a97[_0x39311f(0x16e)]&&console[_0x39311f(0x19d)](_0x39311f(0x1f2)+_0x200c56);const {journeyId:_0x411b07}=await resolveJourneyIdFromInput(_0x200c56,_0x468a97,_0x3defe1),_0x4f2f7d=await withSpinner(_0x39311f(0x220),()=>_0x3defe1['journey'][_0x39311f(0x19e)](_0x411b07),{'verbose':_0x468a97[_0x39311f(0x16e)]}),_0x39cef4=_0x4f2f7d[_0x39311f(0x1ea)];return console[_0x39311f(0x19d)]('Found\x20'+_0x39cef4[_0x39311f(0x254)]+'\x20activation'+(_0x39cef4['length']!==0x1?'s':'')),await handleSDKOutput(_0x39cef4,_0x468a97),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x22c);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1d3);[a27_0x23db74(0x185)]=new SegmentPushCommand();async[a27_0x23db74(0x1a5)](_0x1cfa0a){const _0xd9cef8=a27_0x23db74,_0x3022d3=_0x1cfa0a[_0xd9cef8(0x1f6)][0x0];let _0x12c09b;if(_0x3022d3){const _0x597c4d=await resolveTarget({'arg':_0x3022d3,'contextParent':_0x1cfa0a[_0xd9cef8(0x1e0)]['parentSegment'],'cwd':process[_0xd9cef8(0x194)]()});isSuccessfulResolution(_0x597c4d)&&_0x597c4d[_0xd9cef8(0x248)]===_0xd9cef8(0x1c5)&&(_0x12c09b=_0x597c4d[_0xd9cef8(0x167)]);}const _0x142913={..._0x1cfa0a,'options':{..._0x1cfa0a[_0xd9cef8(0x1e0)],'journeysOnly':!![],..._0x12c09b&&{'singleFilePath':_0x12c09b}}};return this[_0xd9cef8(0x185)][_0xd9cef8(0x1a5)](_0x142913);}}export class JourneyVersionsCommand extends BaseCommand{['name']='journey:versions';['description']=a27_0x23db74(0x25d);async['execute'](_0x412530){const _0x20a87c=a27_0x23db74,{options:_0x376f5f,args:_0x5d807e,tdx:_0x58e5f7}=_0x412530,_0x143b78=_0x5d807e[0x0];if(!requireNameOrPath(_0x143b78))return 0x1;if(_0x376f5f[_0x20a87c(0x16e)])console[_0x20a87c(0x19d)](_0x20a87c(0x1f2)+_0x143b78);const {journeyId:_0x30a23e}=await resolveJourneyIdFromInput(_0x143b78,_0x376f5f,_0x58e5f7),_0x2d9a6b=await withSpinner(_0x20a87c(0x1f5),()=>_0x58e5f7['journey']['listVersions'](_0x30a23e),{'verbose':_0x376f5f[_0x20a87c(0x16e)]}),{bundleName:_0x2534f4,versions:_0xbcbe2a,latestJourneyId:_0x458026}=_0x2d9a6b[_0x20a87c(0x1ea)];console['error'](_0x2534f4+':\x20'+_0xbcbe2a[_0x20a87c(0x254)]+'\x20version'+(_0xbcbe2a[_0x20a87c(0x254)]!==0x1?'s':''));const _0x24f38b=_0xbcbe2a[_0x20a87c(0x23a)](_0x4caffc=>({'version':_0x4caffc[_0x20a87c(0x17d)],'journey_id':_0x4caffc['journeyId'],'name':_0x4caffc[_0x20a87c(0x1bf)],'state':_0x4caffc[_0x20a87c(0x191)],'paused':_0x4caffc[_0x20a87c(0x1b4)],'latest':_0x4caffc[_0x20a87c(0x1b8)]===_0x458026,'created_at':_0x4caffc[_0x20a87c(0x247)]}));return await handleSDKOutput(_0x24f38b,_0x376f5f),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0x23db74(0x18a);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x23db74(0x1a5)](_0x5468ee){const _0x24e72e=a27_0x23db74,{options:_0x440af1,args:_0x3f2c77,tdx:_0x508fd7}=_0x5468ee,_0x44f8da=_0x3f2c77[0x0];if(!requireNameOrPath(_0x44f8da))return 0x1;if(_0x440af1[_0x24e72e(0x16e)])console[_0x24e72e(0x19d)]('Input:\x20'+_0x44f8da);const {journeyId:_0x2debe2,journeyName:_0x440a1e}=await resolveJourneyIdFromInput(_0x44f8da,_0x440af1,_0x508fd7);if(!_0x440af1[_0x24e72e(0x197)]){const _0xa24885=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x440a1e+'\x22?');if(!_0xa24885)return console['error']('Cancelled'),0x0;}const _0x17a648=await withSpinner(_0x24e72e(0x23b),()=>_0x508fd7[_0x24e72e(0x223)][_0x24e72e(0x25c)](_0x2debe2),{'verbose':_0x440af1[_0x24e72e(0x16e)]}),_0x39a8ec=_0x17a648[_0x24e72e(0x1ea)];return console[_0x24e72e(0x19d)](a27_0x43c880[_0x24e72e(0x21d)]('✔')+'\x20Created\x20v'+_0x39a8ec[_0x24e72e(0x1ac)][_0x24e72e(0x17d)]+_0x24e72e(0x20d)+_0x39a8ec['attributes'][_0x24e72e(0x1bf)]+'\x22'),console['error'](_0x24e72e(0x190)+_0x39a8ec['id']),await handleSingleObjectOutput({'id':_0x39a8ec['id'],'name':_0x39a8ec[_0x24e72e(0x1ac)]['name'],'version':_0x39a8ec['attributes'][_0x24e72e(0x17d)],'state':_0x39a8ec[_0x24e72e(0x1ac)][_0x24e72e(0x191)],'bundle_id':_0x39a8ec['attributes'][_0x24e72e(0x1de)],'created_at':_0x39a8ec['attributes']['createdAt']},_0x440af1),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:version:view';[a27_0x23db74(0x16a)]=a27_0x23db74(0x1cd);async[a27_0x23db74(0x1a5)](_0x32c75d){const _0x20e53c=a27_0x23db74,{options:_0xc7ae11,args:_0x304037,tdx:_0x716385}=_0x32c75d,_0x825901=_0x304037[0x0];if(!requireNameOrPath(_0x825901))return 0x1;const _0x5b8637=_0xc7ae11['version'];if(!_0x5b8637)return console[_0x20e53c(0x19d)](_0x20e53c(0x17c)),console[_0x20e53c(0x19d)](_0x20e53c(0x189)),0x1;const _0x2b9a12=parseInt(_0x5b8637,0xa);if(isNaN(_0x2b9a12)||_0x2b9a12<0x1)return console[_0x20e53c(0x19d)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x5b8637),0x1;if(_0xc7ae11[_0x20e53c(0x16e)])console['error'](_0x20e53c(0x1f2)+_0x825901+_0x20e53c(0x183)+_0x2b9a12);const {journeyId:_0x557608,parentSegmentId:_0x20552f}=await resolveJourneyIdFromInput(_0x825901,_0xc7ae11,_0x716385),_0x567ab8=await withSpinner('Resolving\x20version...',()=>_0x716385['journey']['listVersions'](_0x557608),{'verbose':_0xc7ae11[_0x20e53c(0x16e)]}),{versions:_0x12f6af,latestJourneyId:_0x266ca5}=_0x567ab8[_0x20e53c(0x1ea)],_0x5387da=_0x12f6af[_0x20e53c(0x224)](_0x170fdb=>_0x170fdb['versionNumber']===_0x2b9a12);if(!_0x5387da){const _0x214af7=_0x12f6af['map'](_0x4892db=>'v'+_0x4892db[_0x20e53c(0x17d)])['join'](',\x20');return console[_0x20e53c(0x19d)](_0x20e53c(0x1a6)+_0x2b9a12+_0x20e53c(0x232)+_0x214af7),0x1;}const _0x24dd3a=await withSpinner(_0x20e53c(0x169)+_0x2b9a12+_0x20e53c(0x229),()=>_0x716385['journey'][_0x20e53c(0x20e)](_0x5387da['journeyId']),{'verbose':_0xc7ae11['verbose']}),_0x4d938e=_0x24dd3a[_0x20e53c(0x1ea)],_0x16cd35=getConsoleNextUrl(_0xc7ae11[_0x20e53c(0x1c4)],_0x20e53c(0x23f)+_0x20552f+_0x20e53c(0x181)+_0x5387da[_0x20e53c(0x1b8)]+_0x20e53c(0x180));return await handleSingleObjectOutput({'id':_0x4d938e['id'],'name':_0x4d938e[_0x20e53c(0x1ac)]['name'],'version':_0x4d938e[_0x20e53c(0x1ac)]['versionNumber'],'description':_0x4d938e[_0x20e53c(0x1ac)]['description'],'state':_0x4d938e[_0x20e53c(0x1ac)]['state'],'paused':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x1b4)],'reentry_mode':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x184)],'stages':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x1ba)]?.['length']||0x0,..._0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x165)]&&{'goal':_0x4d938e[_0x20e53c(0x1ac)]['goal'][_0x20e53c(0x1bf)]},'latest':_0x5387da[_0x20e53c(0x1b8)]===_0x266ca5,'created_at':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x247)],'updated_at':_0x4d938e['attributes'][_0x20e53c(0x1ed)],'url':_0x16cd35},_0xc7ae11),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a28_0x3540(){const _0x5512eb=['\x20warning(s)','\x20error(s)','no_parent','dim','\x20journey(s)\x20with\x20errors,\x20','error','log','filePath','file','1139010RFqxQr','validCount','green','helpText','3374usZsRT','cyan','type','invalidCount','warningCount','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose','hasErrors','name','313461DFLJwV','.yaml','filter','\x20warning(s)\x20found','warnings','\x20segment\x20file(s)\x20skipped)','skippedCount','execute','journey:validate','Error:\x20Directory\x20not\x20found:\x20','\x20journey(s)\x20valid','Validate\x20journey\x20YAML\x20files','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','105752wFIdzI','journey','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','message','\x20valid','endsWith','3543368fmWIov','No\x20journey\x20YAML\x20files\x20found\x20in\x20','errorCode','reason','valid','length','Error:\x20','671608eWziXw','\x20segment\x20file(s)\x20skipped','red','yellow','2723185mCYGmU','relativePath','5664HLGRNy'];a28_0x3540=function(){return _0x5512eb;};return a28_0x3540();}const a28_0x29d873=a28_0x1e0b;(function(_0x2b7d6c,_0x2ca0d6){const _0x4bb7d7=a28_0x1e0b,_0x281009=_0x2b7d6c();while(!![]){try{const _0x35391e=parseInt(_0x4bb7d7(0xf5))/0x1+-parseInt(_0x4bb7d7(0xcb))/0x2+parseInt(_0x4bb7d7(0xe8))/0x3+-parseInt(_0x4bb7d7(0xd1))/0x4+parseInt(_0x4bb7d7(0xdc))/0x5+-parseInt(_0x4bb7d7(0xde))/0x6*(-parseInt(_0x4bb7d7(0xec))/0x7)+-parseInt(_0x4bb7d7(0xd8))/0x8;if(_0x35391e===_0x2ca0d6)break;else _0x281009['push'](_0x281009['shift']());}catch(_0x4fcf1e){_0x281009['push'](_0x281009['shift']());}}}(a28_0x3540,0xa399b));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1e0b(_0x40dd5f,_0x4149a5){_0x40dd5f=_0x40dd5f-0xc8;const _0x3540e7=a28_0x3540();let _0x1e0b30=_0x3540e7[_0x40dd5f];return _0x1e0b30;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x17218b 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_0x29d873(0xf4)]=a28_0x29d873(0xfd);['description']=a28_0x29d873(0xc9);async[a28_0x29d873(0xfc)](_0x5e2505){const _0x11b4ec=a28_0x29d873,{options:_0x4ebb84,args:_0x1047aa}=_0x5e2505,_0x2422c6=_0x4ebb84,_0x38b6dc=await resolveTarget({'arg':_0x1047aa[0x0],'contextParent':_0x4ebb84['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x38b6dc))return _0x38b6dc[_0x11b4ec(0xd3)]===_0x11b4ec(0xe1)?(console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xdb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x11b4ec(0xf1)),console[_0x11b4ec(0xe4)]('\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'),console[_0x11b4ec(0xe4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xda)](_0x11b4ec(0xd7)+_0x38b6dc[_0x11b4ec(0xce)]+'\x0a')),_0x38b6dc[_0x11b4ec(0xeb)]&&console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xed)](_0x38b6dc[_0x11b4ec(0xeb)]))),0x1;const _0x4b8aa6=_0x38b6dc['targetDir'],_0x56c193=_0x38b6dc[_0x11b4ec(0xee)]===_0x11b4ec(0xe7)?_0x38b6dc[_0x11b4ec(0xe6)]:undefined;if(!_0x56c193&&!existsSync(_0x4b8aa6))return console[_0x11b4ec(0xe4)](a28_0x17218b['red'](_0x11b4ec(0xfe)+_0x4b8aa6+'\x0a')),0x1;let _0x29269d;if(_0x56c193){if(!_0x56c193['endsWith']('.yml')&&!_0x56c193[_0x11b4ec(0xd0)](_0x11b4ec(0xf6)))return console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xda)](_0x11b4ec(0xcd)+_0x56c193+'\x0a')),0x1;_0x29269d=[_0x56c193];}else _0x29269d=findYamlFiles(_0x4b8aa6);if(_0x29269d['length']===0x0)return console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xda)](_0x11b4ec(0xca)+_0x4b8aa6+'\x0a')),0x1;const _0x56f962=validateYamlFiles(_0x29269d,_0x4b8aa6,{'filterType':_0x11b4ec(0xcc)}),_0x36c7ae=calculateSummary(_0x56f962),_0x3ed981=_0x56f962[_0x11b4ec(0xf7)](isValidationResult);if(_0x3ed981['length']===0x0)return console[_0x11b4ec(0xe4)](a28_0x17218b['yellow'](_0x11b4ec(0xd2)+_0x4b8aa6+'\x0a')),_0x36c7ae[_0x11b4ec(0xfb)]>0x0&&console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xe2)]('('+_0x36c7ae['skippedCount']+_0x11b4ec(0xfa))),0x0;for(const _0x16403f of _0x56f962){if(!isValidationResult(_0x16403f)){_0x2422c6[_0x11b4ec(0xf2)]&&console['log'](a28_0x17218b[_0x11b4ec(0xe2)]('-\x20'+_0x16403f[_0x11b4ec(0xdd)]+'\x20(skipped:\x20'+_0x16403f[_0x11b4ec(0xd4)]+')'));continue;}const {relativePath:_0x1b40e1,source:_0x75d508,result:_0x16934c}=_0x16403f;if(_0x16934c[_0x11b4ec(0xd5)]&&_0x16934c['warnings'][_0x11b4ec(0xd6)]===0x0)_0x2422c6[_0x11b4ec(0xf2)]&&console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xea)]('✔\x20'+_0x1b40e1));else _0x16934c['valid']?(console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xdb)]('⚠\x20'+_0x1b40e1+':\x20'+_0x16934c[_0x11b4ec(0xf9)][_0x11b4ec(0xd6)]+_0x11b4ec(0xdf))),console['log'](formatValidationResult(_0x16934c,_0x75d508,_0x1b40e1))):(console['log'](a28_0x17218b[_0x11b4ec(0xda)]('✖\x20'+_0x1b40e1+':\x20'+_0x16934c['errors']['length']+_0x11b4ec(0xe0))),console['log'](formatValidationResult(_0x16934c,_0x75d508,_0x1b40e1)));}return console[_0x11b4ec(0xe5)](''),_0x36c7ae[_0x11b4ec(0xf3)]?(console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xda)]('Validation\x20failed:\x20'+_0x36c7ae[_0x11b4ec(0xef)]+_0x11b4ec(0xe3)+_0x36c7ae[_0x11b4ec(0xe9)]+_0x11b4ec(0xcf))),_0x36c7ae[_0x11b4ec(0xf0)]>0x0&&console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xdb)](_0x36c7ae[_0x11b4ec(0xf0)]+_0x11b4ec(0xf8))),_0x36c7ae[_0x11b4ec(0xfb)]>0x0&&console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xe2)](_0x36c7ae[_0x11b4ec(0xfb)]+_0x11b4ec(0xd9))),0x1):(console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xea)]('✔\x20All\x20'+_0x36c7ae[_0x11b4ec(0xe9)]+_0x11b4ec(0xc8))),_0x36c7ae[_0x11b4ec(0xf0)]>0x0&&console[_0x11b4ec(0xe5)](a28_0x17218b['yellow'](_0x36c7ae['warningCount']+_0x11b4ec(0xf8))),_0x36c7ae[_0x11b4ec(0xfb)]>0x0&&console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xe2)](_0x36c7ae[_0x11b4ec(0xfb)]+_0x11b4ec(0xd9))),0x0);}}
|