@treasuredata/tdx 2026.4.10 → 2026.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x4ee4a0=a25_0x11b5;(function(_0x17dd36,_0x25202c){const _0x35b7e8=a25_0x11b5,_0x37516f=_0x17dd36();while(!![]){try{const _0x429fb8=-parseInt(_0x35b7e8(0xd2))/0x1+parseInt(_0x35b7e8(0xda))/0x2+parseInt(_0x35b7e8(0xe2))/0x3+parseInt(_0x35b7e8(0xd5))/0x4*(parseInt(_0x35b7e8(0xc0))/0x5)+parseInt(_0x35b7e8(0xc3))/0x6*(-parseInt(_0x35b7e8(0xd9))/0x7)+-parseInt(_0x35b7e8(0xbd))/0x8*(-parseInt(_0x35b7e8(0xdf))/0x9)+-parseInt(_0x35b7e8(0xe0))/0xa;if(_0x429fb8===_0x25202c)break;else _0x37516f['push'](_0x37516f['shift']());}catch(_0x149fb4){_0x37516f['push'](_0x37516f['shift']());}}}(a25_0x4447,0xcb9b3));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x11b5(_0x354aa7,_0x2e5f51){_0x354aa7=_0x354aa7-0xbb;const _0x4447b5=a25_0x4447();let _0x11b529=_0x4447b5[_0x354aa7];return _0x11b529;}import{existsSync}from'fs';import a25_0x38b626 from'chalk';import a25_0x5ba1a7 from'path';function a25_0x4447(){const _0x3601aa=['error','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20template(s)\x20with\x20errors,\x20','resolve','\x20error(s)','689413xrKcTz','log','length','2251484WGnHzN','endsWith','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filter','1576687shDfIp','1968662HBNxKe','\x20non-template\x20file(s)\x20skipped','warningCount','\x20non-template\x20file(s)\x20skipped)','verbose','167130utmgri','5875840HSfRGt','valid','2255601iiPHqS','.yaml','template','red','execute','reason','errors','Validation\x20failed:\x20','\x20warning(s)','warnings','green','16yAdzUT','yellow','No\x20template\x20YAML\x20files\x20found\x20in\x20','5cqsGlU','skippedCount','engage:template:validate','6YWTPWR','validCount','description','Validate\x20template\x20YAML\x20files','\x20template(s)\x20valid','\x20warning(s)\x20found','\x20valid','dim','hasErrors','Error:\x20Directory\x20not\x20found:\x20'];a25_0x4447=function(){return _0x3601aa;};return a25_0x4447();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a25_0x4ee4a0(0xc2);[a25_0x4ee4a0(0xc5)]=a25_0x4ee4a0(0xc6);async[a25_0x4ee4a0(0xe6)](_0x37013a){const _0x6a67f=a25_0x4ee4a0,{options:_0x690c4f,args:_0x595c87}=_0x37013a,_0x4a0d66=_0x690c4f,_0x516c26=_0x595c87[0x0],_0x448252=_0x516c26?a25_0x5ba1a7[_0x6a67f(0xd0)](_0x516c26):undefined,_0x226146=_0x448252?isYamlFile(_0x448252):![];let _0x528684,_0x339b7d;if(_0x226146&&_0x448252)_0x528684=a25_0x5ba1a7['dirname'](_0x448252),_0x339b7d=_0x448252;else _0x448252?_0x528684=_0x448252:_0x528684=process['cwd']();if(!_0x339b7d&&!existsSync(_0x528684))return console['error'](a25_0x38b626['red'](_0x6a67f(0xcc)+_0x528684+'\x0a')),0x1;let _0x49c055;if(_0x339b7d){if(!_0x339b7d[_0x6a67f(0xd6)]('.yml')&&!_0x339b7d['endsWith'](_0x6a67f(0xe3)))return console[_0x6a67f(0xcd)](a25_0x38b626['red'](_0x6a67f(0xce)+_0x339b7d+'\x0a')),0x1;_0x49c055=[_0x339b7d];}else _0x49c055=findYamlFiles(_0x528684);if(_0x49c055[_0x6a67f(0xd4)]===0x0)return console['error'](a25_0x38b626[_0x6a67f(0xe5)](_0x6a67f(0xd7)+_0x528684+'\x0a')),0x1;const _0x197ea8=validateYamlFiles(_0x49c055,_0x528684,{'filterType':_0x6a67f(0xe4)}),_0x281e15=calculateSummary(_0x197ea8),_0x30bae1=_0x197ea8[_0x6a67f(0xd8)](isValidationResult);if(_0x30bae1[_0x6a67f(0xd4)]===0x0)return console[_0x6a67f(0xcd)](a25_0x38b626['yellow'](_0x6a67f(0xbf)+_0x528684+'\x0a')),_0x281e15[_0x6a67f(0xc1)]>0x0&&console[_0x6a67f(0xcd)](a25_0x38b626['dim']('('+_0x281e15[_0x6a67f(0xc1)]+_0x6a67f(0xdd))),0x0;for(const _0x1c1cd7 of _0x197ea8){if(!isValidationResult(_0x1c1cd7)){_0x4a0d66[_0x6a67f(0xde)]&&console[_0x6a67f(0xd3)](a25_0x38b626['dim']('-\x20'+_0x1c1cd7['relativePath']+'\x20(skipped:\x20'+_0x1c1cd7[_0x6a67f(0xe7)]+')'));continue;}const {relativePath:_0x11614b,source:_0x25b0ef,result:_0x513eba}=_0x1c1cd7;if(_0x513eba[_0x6a67f(0xe1)]&&_0x513eba[_0x6a67f(0xbb)][_0x6a67f(0xd4)]===0x0)_0x4a0d66[_0x6a67f(0xde)]&&console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xbc)]('✔\x20'+_0x11614b));else _0x513eba[_0x6a67f(0xe1)]?(console['log'](a25_0x38b626[_0x6a67f(0xbe)]('⚠\x20'+_0x11614b+':\x20'+_0x513eba['warnings']['length']+_0x6a67f(0xea))),console['log'](formatValidationResult(_0x513eba,_0x25b0ef,_0x11614b))):(console[_0x6a67f(0xd3)](a25_0x38b626['red']('✖\x20'+_0x11614b+':\x20'+_0x513eba[_0x6a67f(0xe8)][_0x6a67f(0xd4)]+_0x6a67f(0xd1))),console['log'](formatValidationResult(_0x513eba,_0x25b0ef,_0x11614b)));}return console[_0x6a67f(0xd3)](''),_0x281e15[_0x6a67f(0xcb)]?(console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xe5)](_0x6a67f(0xe9)+_0x281e15['invalidCount']+_0x6a67f(0xcf)+_0x281e15[_0x6a67f(0xc4)]+_0x6a67f(0xc9))),_0x281e15['warningCount']>0x0&&console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xbe)](_0x281e15[_0x6a67f(0xdc)]+'\x20warning(s)\x20found')),_0x281e15[_0x6a67f(0xc1)]>0x0&&console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xca)](_0x281e15[_0x6a67f(0xc1)]+_0x6a67f(0xdb))),0x1):(console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xbc)]('✔\x20All\x20'+_0x281e15['validCount']+_0x6a67f(0xc7))),_0x281e15[_0x6a67f(0xdc)]>0x0&&console[_0x6a67f(0xd3)](a25_0x38b626[_0x6a67f(0xbe)](_0x281e15['warningCount']+_0x6a67f(0xc8))),_0x281e15[_0x6a67f(0xc1)]>0x0&&console['log'](a25_0x38b626[_0x6a67f(0xca)](_0x281e15[_0x6a67f(0xc1)]+_0x6a67f(0xdb))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0xf159c3=a26_0x19a9;function a26_0x437c(){const _0x4311b7=['job:submit','jobs','type','...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','map','url','query','error','execute','12jCUnkk','dim','join','job:show','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','verbose','1161tRtHev','floor','status','log','just\x20now','file','1404192VKIQNL','Limit:\x20','data','948388JSqoOa','kill','Get\x20job\x20results','Database:\x20','Submitting\x20kill\x20request...','job_id','validate','\x27\x20to\x20verify\x20the\x20job\x20status','yes','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','trino','getTime','2216954AYwrfu','push','3600624RRQYEw','user_name','show','Query:\x20','args','substring','Submitting\x20job...','m\x20ago','Submit\x20a\x20job','d\x20ago','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','length','Getting\x20job\x20details...','Show\x20job\x20details','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','submit','Status\x20filter:\x20','Cancelled','created_at','2900625bUAxAY','debug','h\x20ago','description','success','end_at','round','abs','✔\x20Retrieved\x20','start_at','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','\x20job','name','INVALID_ARGUMENT','Job\x20type:\x20','result','database','1329690yJzRPt','\x20row','red','presto','26328htkzYd','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','\x20jobs','limit','No\x20SQL\x20statements\x20found\x20in\x20file','Listing\x20jobs...','\x20\x20Job\x20ID:\x20','job:kill'];a26_0x437c=function(){return _0x4311b7;};return a26_0x437c();}(function(_0x31fb39,_0x23b195){const _0xd3a93e=a26_0x19a9,_0x4f7cfd=_0x31fb39();while(!![]){try{const _0x41e85c=parseInt(_0xd3a93e(0x1b5))/0x1+-parseInt(_0xd3a93e(0x16d))/0x2+-parseInt(_0xd3a93e(0x1a9))/0x3*(-parseInt(_0xd3a93e(0x1b8))/0x4)+parseInt(_0xd3a93e(0x193))/0x5+-parseInt(_0xd3a93e(0x16f))/0x6+parseInt(_0xd3a93e(0x182))/0x7+-parseInt(_0xd3a93e(0x197))/0x8*(parseInt(_0xd3a93e(0x1af))/0x9);if(_0x41e85c===_0x23b195)break;else _0x4f7cfd['push'](_0x4f7cfd['shift']());}catch(_0x46c833){_0x4f7cfd['push'](_0x4f7cfd['shift']());}}}(a26_0x437c,0xdbabd));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';function a26_0x19a9(_0xf3d7c8,_0x3634bb){_0xf3d7c8=_0xf3d7c8-0x164;const _0x437c32=a26_0x437c();let _0x19a902=_0x437c32[_0xf3d7c8];return _0x19a902;}import a26_0x3a86ae from'chalk';function formatDuration(_0x58bc4d){const _0x12420d=a26_0x19a9;if(_0x58bc4d<0x3c)return _0x58bc4d+'s';if(_0x58bc4d<0xe10)return Math[_0x12420d(0x1b0)](_0x58bc4d/0x3c)+'m\x20'+_0x58bc4d%0x3c+'s';const _0x3bada1=Math[_0x12420d(0x1b0)](_0x58bc4d/0xe10),_0x5599c2=Math[_0x12420d(0x1b0)](_0x58bc4d%0xe10/0x3c);return _0x5599c2>0x0?_0x3bada1+'h\x20'+_0x5599c2+'m':_0x3bada1+'h';}function formatRelativeTime(_0x54aa2e){const _0x508469=a26_0x19a9,_0x3ddfdd=Date['now']()-_0x54aa2e['getTime'](),_0x2a836c=Math[_0x508469(0x1b0)](Math[_0x508469(0x189)](_0x3ddfdd)/0x3e8);if(_0x2a836c<0x3c)return _0x508469(0x1b3);const _0x54013b=Math[_0x508469(0x1b0)](_0x2a836c/0x3c);if(_0x54013b<0x3c)return _0x54013b+_0x508469(0x176);const _0x32a1ed=Math[_0x508469(0x1b0)](_0x54013b/0x3c);if(_0x32a1ed<0x18)return _0x32a1ed+_0x508469(0x184);const _0x1768d2=Math[_0x508469(0x1b0)](_0x32a1ed/0x18);if(_0x1768d2<0x1e)return _0x1768d2+_0x508469(0x178);return Math[_0x508469(0x1b0)](_0x1768d2/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0xf159c3(0x18e)]=a26_0xf159c3(0x1a0);['description']='List\x20jobs';async['execute'](_0x2814c2){const _0xcd9093=a26_0xf159c3,{options:_0x908c48,tdx:_0x55c2ca}=_0x2814c2,_0x4a9cac=resolveLimit(_0x908c48[_0xcd9093(0x19a)],DEFAULT_DISPLAY_LIMIT),_0x32bad5=_0x908c48[_0xcd9093(0x1b1)];_0x908c48[_0xcd9093(0x1ae)]&&(console['error'](_0xcd9093(0x1b6)+_0x4a9cac+_0xcd9093(0x199)),_0x32bad5&&console[_0xcd9093(0x1a7)](_0xcd9093(0x17f)+_0x32bad5));const _0x18289b=await withSpinner(_0xcd9093(0x19c),()=>_0x55c2ca[_0xcd9093(0x1a0)]['list']({'from':0x0,'to':_0x4a9cac-0x1,'status':_0x32bad5}),{'verbose':_0x908c48[_0xcd9093(0x1ae)]}),_0x32f9b2=_0x18289b[_0xcd9093(0x1b7)];console[_0xcd9093(0x1a7)]('✔\x20Found\x20'+_0x32f9b2[_0xcd9093(0x17a)]+_0xcd9093(0x18d)+(_0x32f9b2[_0xcd9093(0x17a)]!==0x1?'s':''));const _0x184611=_0x908c48['site'];if(isStructuredFormat(_0x908c48)){const _0x411f48=_0x32f9b2[_0xcd9093(0x1a4)](_0x39a6ec=>{const _0x4c3feb=_0xcd9093;let _0x412c19;if(_0x39a6ec[_0x4c3feb(0x18b)]&&_0x39a6ec[_0x4c3feb(0x187)]){const _0x29cba6=new Date(_0x39a6ec['start_at'])[_0x4c3feb(0x16c)](),_0x19c4fd=new Date(_0x39a6ec['end_at'])[_0x4c3feb(0x16c)]();_0x412c19=Math[_0x4c3feb(0x188)]((_0x19c4fd-_0x29cba6)/0x3e8);}return{'job_id':_0x39a6ec[_0x4c3feb(0x166)],'type':_0x39a6ec[_0x4c3feb(0x1a1)]===_0x4c3feb(0x196)?'trino':_0x39a6ec['type'],'status':_0x39a6ec[_0x4c3feb(0x1b1)],'user_name':_0x39a6ec[_0x4c3feb(0x170)],'duration_sec':_0x412c19,'created_at':_0x39a6ec[_0x4c3feb(0x181)],'started_at':_0x39a6ec[_0x4c3feb(0x18b)],'end_at':_0x39a6ec[_0x4c3feb(0x187)]};});await handleSDKOutput(_0x411f48,_0x908c48);}else for(const _0x57915e of _0x32f9b2){const _0x45062a=_0x57915e[_0xcd9093(0x1b1)]===_0xcd9093(0x186)?a26_0x3a86ae['green']:_0x57915e[_0xcd9093(0x1b1)]===_0xcd9093(0x1a7)?a26_0x3a86ae[_0xcd9093(0x195)]:a26_0x3a86ae[_0xcd9093(0x1aa)],_0x1e03fd=_0x45062a(_0x57915e['status']),_0x166ec9=getJobUrl(_0x184611,_0x57915e[_0xcd9093(0x166)]),_0x20ad2d=hyperlink(_0x57915e[_0xcd9093(0x166)],_0x166ec9),_0x1066f1=a26_0x3a86ae[_0xcd9093(0x1aa)](_0x57915e[_0xcd9093(0x1a1)]==='presto'?_0xcd9093(0x16b):_0x57915e[_0xcd9093(0x1a1)]),_0x1958b1=[];if(_0x57915e[_0xcd9093(0x18b)]&&_0x57915e['end_at']){const _0x4d7367=Math['round']((new Date(_0x57915e['end_at'])[_0xcd9093(0x16c)]()-new Date(_0x57915e['start_at'])['getTime']())/0x3e8);_0x1958b1['push'](formatDuration(_0x4d7367));}if(_0x57915e[_0xcd9093(0x187)])_0x1958b1[_0xcd9093(0x16e)](formatRelativeTime(new Date(_0x57915e['end_at'])));else _0x57915e[_0xcd9093(0x18b)]&&_0x1958b1['push'](formatRelativeTime(new Date(_0x57915e[_0xcd9093(0x18b)])));const _0x1fc1ff=_0x1958b1[_0xcd9093(0x17a)]>0x0?a26_0x3a86ae[_0xcd9093(0x1aa)]('\x20'+_0x1958b1[_0xcd9093(0x1ab)](',\x20')):'';console[_0xcd9093(0x1b2)]('⚡\x20'+_0x20ad2d+'\x20'+_0x1066f1+'\x20'+_0x1e03fd+_0x1fc1ff);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0xf159c3(0x1ac);[a26_0xf159c3(0x185)]=a26_0xf159c3(0x17c);[a26_0xf159c3(0x167)](_0x57cc5c){const _0x482346=a26_0xf159c3,_0x495aa4=_0x57cc5c[_0x482346(0x173)][0x0];if(!_0x495aa4)return _0x482346(0x17d);return undefined;}async[a26_0xf159c3(0x1a8)](_0x4ced2c){const _0x5a4e2a=a26_0xf159c3,{options:_0x1bcbc9,args:_0x4e774f,tdx:_0x466e3a}=_0x4ced2c,_0x3318f7=_0x4e774f[0x0],_0x59e1df=await withSpinner(_0x5a4e2a(0x17b),()=>_0x466e3a[_0x5a4e2a(0x1a0)][_0x5a4e2a(0x171)](_0x3318f7),{'verbose':_0x1bcbc9[_0x5a4e2a(0x1ae)]}),_0x4856a5=_0x59e1df[_0x5a4e2a(0x1b7)];let _0x1f1010;if(_0x4856a5[_0x5a4e2a(0x18b)]&&_0x4856a5['end_at']){const _0x46cbe4=new Date(_0x4856a5[_0x5a4e2a(0x18b)])[_0x5a4e2a(0x16c)](),_0x23c74c=new Date(_0x4856a5['end_at'])[_0x5a4e2a(0x16c)]();_0x1f1010=Math[_0x5a4e2a(0x188)]((_0x23c74c-_0x46cbe4)/0x3e8);}const _0xbd129a={'job_id':_0x4856a5[_0x5a4e2a(0x166)],'type':_0x4856a5[_0x5a4e2a(0x1a1)],'status':_0x4856a5[_0x5a4e2a(0x1b1)],..._0x4856a5[_0x5a4e2a(0x170)]&&{'user_name':_0x4856a5[_0x5a4e2a(0x170)]},..._0x1f1010!==undefined&&{'duration_sec':_0x1f1010},..._0x4856a5['created_at']&&{'created_at':_0x4856a5[_0x5a4e2a(0x181)]},..._0x4856a5[_0x5a4e2a(0x18b)]&&{'started_at':_0x4856a5[_0x5a4e2a(0x18b)]},..._0x4856a5[_0x5a4e2a(0x187)]&&{'end_at':_0x4856a5[_0x5a4e2a(0x187)]},..._0x4856a5[_0x5a4e2a(0x192)]&&{'database':_0x4856a5[_0x5a4e2a(0x192)]},..._0x4856a5['priority']!==undefined&&{'priority':_0x4856a5['priority']},..._0x4856a5[_0x5a4e2a(0x1a5)]&&{'url':_0x4856a5['url']},..._0x4856a5[_0x5a4e2a(0x1a6)]&&{'query':_0x4856a5[_0x5a4e2a(0x1a6)]},..._0x4856a5[_0x5a4e2a(0x183)]&&{'debug':_0x4856a5[_0x5a4e2a(0x183)]}};return await handleSingleObjectOutput(_0xbd129a,_0x1bcbc9),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0xf159c3(0x18e)]=a26_0xf159c3(0x19e);[a26_0xf159c3(0x185)]='Kill\x20a\x20job';['validate'](_0xab8441){const _0x513a4c=a26_0xf159c3,_0x4e9248=_0xab8441[_0x513a4c(0x173)][0x0];if(!_0x4e9248)return _0x513a4c(0x16a);return undefined;}async[a26_0xf159c3(0x1a8)](_0x25fced){const _0x2a7069=a26_0xf159c3,{options:_0x57962a,args:_0x2ce2a4,tdx:_0x5f5655}=_0x25fced,_0x5c411a=_0x2ce2a4[0x0];if(!_0x57962a[_0x2a7069(0x169)]){const _0x521ac8=await confirm(_0x2a7069(0x1ad)+_0x5c411a+'?');if(!_0x521ac8)return console['error'](_0x2a7069(0x180)),0x0;}return await withSpinner(_0x2a7069(0x165),()=>_0x5f5655[_0x2a7069(0x1a0)][_0x2a7069(0x1b9)](_0x5c411a),{'verbose':_0x57962a[_0x2a7069(0x1ae)]}),console[_0x2a7069(0x1a7)](_0x2a7069(0x179)+_0x5c411a),console[_0x2a7069(0x1a7)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x5c411a+_0x2a7069(0x168)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0xf159c3(0x18e)]=a26_0xf159c3(0x19f);['description']=a26_0xf159c3(0x177);async[a26_0xf159c3(0x1a8)](_0x18c875){const _0x4bbf48=a26_0xf159c3,{options:_0x3ae2a7,args:_0x2e1e6f,tdx:_0x1302b1}=_0x18c875,_0x59bb30=_0x3ae2a7['jobType']||_0x4bbf48(0x16b),_0x4dc98e=_0x3ae2a7[_0x4bbf48(0x1b4)],_0x3b19c0=_0x3ae2a7['database']||'information_schema',_0x155bcc=_0x3ae2a7[_0x4bbf48(0x191)];if(_0x59bb30!==_0x4bbf48(0x16b)&&_0x59bb30!=='hive')throw new SDKError(ErrorCode[_0x4bbf48(0x18f)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0xf50586;if(_0x4dc98e){if(_0x2e1e6f[0x0])throw new SDKError(ErrorCode[_0x4bbf48(0x18f)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x27a00b=readSqlStatementsFromFile(_0x4dc98e);if(_0x27a00b[_0x4bbf48(0x17a)]===0x0)throw new SDKError(ErrorCode[_0x4bbf48(0x18f)],_0x4bbf48(0x19b));if(_0x27a00b[_0x4bbf48(0x17a)]>0x1)throw new SDKError(ErrorCode[_0x4bbf48(0x18f)],_0x4bbf48(0x18c));_0xf50586=_0x27a00b[0x0];}else{if(!_0x2e1e6f[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4bbf48(0x198));_0xf50586=_0x2e1e6f[0x0];}_0x3ae2a7[_0x4bbf48(0x1ae)]&&(console['error'](_0x4bbf48(0x190)+_0x59bb30),console[_0x4bbf48(0x1a7)](_0x4bbf48(0x164)+_0x3b19c0),console[_0x4bbf48(0x1a7)](_0x4bbf48(0x172)+_0xf50586[_0x4bbf48(0x174)](0x0,0x64)+(_0xf50586['length']>0x64?_0x4bbf48(0x1a2):'')));const _0x52d369=await withSpinner(_0x4bbf48(0x175),()=>_0x1302b1[_0x4bbf48(0x1a0)][_0x4bbf48(0x17e)](_0x3b19c0,_0xf50586,_0x59bb30,_0x155bcc),{'verbose':_0x3ae2a7['verbose']}),_0x211aa6=_0x52d369[_0x4bbf48(0x1b7)];return console[_0x4bbf48(0x1a7)]('✔\x20Job\x20submitted'),console['error'](_0x4bbf48(0x19d)+_0x211aa6[_0x4bbf48(0x166)]),await handleSDKOutput([_0x211aa6],_0x3ae2a7),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a26_0xf159c3(0x185)]=a26_0xf159c3(0x1ba);[a26_0xf159c3(0x167)](_0x6a7648){const _0xb7bc07=a26_0xf159c3,_0x2edc2c=_0x6a7648[_0xb7bc07(0x173)][0x0];if(!_0x2edc2c)return _0xb7bc07(0x1a3);return undefined;}async[a26_0xf159c3(0x1a8)](_0x3951c3){const _0x69b21b=a26_0xf159c3,{options:_0x401e05,args:_0x357995,tdx:_0x41c60b}=_0x3951c3,_0x2e83f1=_0x357995[0x0],_0x1025b1=await withSpinner('Getting\x20job\x20results...',()=>_0x41c60b[_0x69b21b(0x1a0)][_0x69b21b(0x191)](_0x2e83f1),{'verbose':_0x401e05[_0x69b21b(0x1ae)]}),_0x4a50c6=_0x1025b1['data'];return console[_0x69b21b(0x1a7)](_0x69b21b(0x18a)+_0x4a50c6['length']+_0x69b21b(0x194)+(_0x4a50c6[_0x69b21b(0x17a)]!==0x1?'s':'')),await handleSDKOutput(_0x4a50c6,_0x401e05),0x0;}}
|
|
1
|
+
const a26_0x5c5c6f=a26_0x1c2e;(function(_0x12b101,_0x2327f4){const _0x123cc7=a26_0x1c2e,_0x826453=_0x12b101();while(!![]){try{const _0x8b78b0=-parseInt(_0x123cc7(0x1ed))/0x1+-parseInt(_0x123cc7(0x1d9))/0x2+-parseInt(_0x123cc7(0x1d0))/0x3+-parseInt(_0x123cc7(0x1ef))/0x4*(-parseInt(_0x123cc7(0x1e2))/0x5)+parseInt(_0x123cc7(0x20a))/0x6*(-parseInt(_0x123cc7(0x21f))/0x7)+parseInt(_0x123cc7(0x20f))/0x8+parseInt(_0x123cc7(0x1e7))/0x9;if(_0x8b78b0===_0x2327f4)break;else _0x826453['push'](_0x826453['shift']());}catch(_0x260e2b){_0x826453['push'](_0x826453['shift']());}}}(a26_0x264d,0xecbaa));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';function a26_0x264d(){const _0x31d83f=['created_at','Getting\x20job\x20details...','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Getting\x20job\x20results...','show','11374452slkBLY','\x20row','abs','jobs','job:submit','5187560ATGeWD','Submitting\x20job...','limit','args','job:show','Show\x20job\x20details','verbose','end_at','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','red','h\x20ago','type','Cancelled','dim','list','validate','7yPwWTO','Database:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','success','error','✔\x20Job\x20submitted','url','5198496BzNMmQ','job_id','file','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','now','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','just\x20now','Query:\x20','status','3530642aVuPVC','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','map','Submit\x20a\x20job','query','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','✔\x20Retrieved\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','391385rijDND','substring','floor','result','No\x20SQL\x20statements\x20found\x20in\x20file','40386933SOTYJl','\x20job','Status\x20filter:\x20','database','m\x20ago','trino','572716nQCuiZ','priority','92Jwkzgu','presto','data','log','\x20jobs','\x20\x20Job\x20ID:\x20','push','Kill\x20a\x20job','mo\x20ago','Listing\x20jobs...','name','start_at','Submitting\x20kill\x20request...','user_name','round','INVALID_ARGUMENT','description','execute','length','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','List\x20jobs','getTime'];a26_0x264d=function(){return _0x31d83f;};return a26_0x264d();}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';function a26_0x1c2e(_0x2270e8,_0x7a350c){_0x2270e8=_0x2270e8-0x1cb;const _0x264d47=a26_0x264d();let _0x1c2e81=_0x264d47[_0x2270e8];return _0x1c2e81;}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_0x38e5f7 from'chalk';function formatDuration(_0x17a112){const _0x327667=a26_0x1c2e;if(_0x17a112<0x3c)return _0x17a112+'s';if(_0x17a112<0xe10)return Math['floor'](_0x17a112/0x3c)+'m\x20'+_0x17a112%0x3c+'s';const _0x4287bb=Math[_0x327667(0x1e4)](_0x17a112/0xe10),_0x4af459=Math[_0x327667(0x1e4)](_0x17a112%0xe10/0x3c);return _0x4af459>0x0?_0x4287bb+'h\x20'+_0x4af459+'m':_0x4287bb+'h';}function formatRelativeTime(_0xdebd9d){const _0x5262df=a26_0x1c2e,_0x48d8b4=Date[_0x5262df(0x1d4)]()-_0xdebd9d[_0x5262df(0x204)](),_0x407afb=Math[_0x5262df(0x1e4)](Math[_0x5262df(0x20c)](_0x48d8b4)/0x3e8);if(_0x407afb<0x3c)return _0x5262df(0x1d6);const _0x311d06=Math[_0x5262df(0x1e4)](_0x407afb/0x3c);if(_0x311d06<0x3c)return _0x311d06+_0x5262df(0x1eb);const _0x599e51=Math[_0x5262df(0x1e4)](_0x311d06/0x3c);if(_0x599e51<0x18)return _0x599e51+_0x5262df(0x219);const _0x23f66f=Math[_0x5262df(0x1e4)](_0x599e51/0x18);if(_0x23f66f<0x1e)return _0x23f66f+_0x5262df(0x1df);return Math[_0x5262df(0x1e4)](_0x23f66f/0x1e)+_0x5262df(0x1f7);}export class JobListCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='jobs';[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x203);async['execute'](_0x200190){const _0x495ac7=a26_0x5c5c6f,{options:_0x459fdd,tdx:_0x31129f}=_0x200190,_0x1425a8=resolveLimit(_0x459fdd[_0x495ac7(0x211)],DEFAULT_DISPLAY_LIMIT),_0x41b436=_0x459fdd['status'];_0x459fdd[_0x495ac7(0x215)]&&(console[_0x495ac7(0x1cd)]('Limit:\x20'+_0x1425a8+_0x495ac7(0x1f3)),_0x41b436&&console[_0x495ac7(0x1cd)](_0x495ac7(0x1e9)+_0x41b436));const _0x5c8f2b=await withSpinner(_0x495ac7(0x1f8),()=>_0x31129f[_0x495ac7(0x20d)][_0x495ac7(0x21d)]({'from':0x0,'to':_0x1425a8-0x1,'status':_0x41b436}),{'verbose':_0x459fdd[_0x495ac7(0x215)]}),_0x5a7d79=_0x5c8f2b['data'];console[_0x495ac7(0x1cd)]('✔\x20Found\x20'+_0x5a7d79[_0x495ac7(0x201)]+_0x495ac7(0x1e8)+(_0x5a7d79[_0x495ac7(0x201)]!==0x1?'s':''));const _0x15003b=_0x459fdd['site'];if(isStructuredFormat(_0x459fdd)){const _0x5cd8ca=_0x5a7d79[_0x495ac7(0x1db)](_0xa54de=>{const _0x21f158=_0x495ac7;let _0x3084b7;if(_0xa54de[_0x21f158(0x1fa)]&&_0xa54de[_0x21f158(0x216)]){const _0x36f586=new Date(_0xa54de['start_at'])[_0x21f158(0x204)](),_0xdb139d=new Date(_0xa54de[_0x21f158(0x216)])[_0x21f158(0x204)]();_0x3084b7=Math[_0x21f158(0x1fd)]((_0xdb139d-_0x36f586)/0x3e8);}return{'job_id':_0xa54de[_0x21f158(0x1d1)],'type':_0xa54de[_0x21f158(0x21a)]===_0x21f158(0x1f0)?_0x21f158(0x1ec):_0xa54de[_0x21f158(0x21a)],'status':_0xa54de['status'],'user_name':_0xa54de[_0x21f158(0x1fc)],'duration_sec':_0x3084b7,'created_at':_0xa54de[_0x21f158(0x205)],'started_at':_0xa54de[_0x21f158(0x1fa)],'end_at':_0xa54de[_0x21f158(0x216)]};});await handleSDKOutput(_0x5cd8ca,_0x459fdd);}else for(const _0xe78b0e of _0x5a7d79){const _0x1dd4b7=_0xe78b0e['status']===_0x495ac7(0x1cc)?a26_0x38e5f7['green']:_0xe78b0e[_0x495ac7(0x1d8)]==='error'?a26_0x38e5f7[_0x495ac7(0x218)]:a26_0x38e5f7['dim'],_0x17ee94=_0x1dd4b7(_0xe78b0e[_0x495ac7(0x1d8)]),_0x130b09=getJobUrl(_0x15003b,_0xe78b0e['job_id']),_0x14cb6f=hyperlink(_0xe78b0e[_0x495ac7(0x1d1)],_0x130b09),_0x278c7d=a26_0x38e5f7['dim'](_0xe78b0e[_0x495ac7(0x21a)]==='presto'?_0x495ac7(0x1ec):_0xe78b0e['type']),_0x23fedd=[];if(_0xe78b0e['start_at']&&_0xe78b0e[_0x495ac7(0x216)]){const _0x2b98f1=Math[_0x495ac7(0x1fd)]((new Date(_0xe78b0e['end_at'])[_0x495ac7(0x204)]()-new Date(_0xe78b0e[_0x495ac7(0x1fa)])[_0x495ac7(0x204)]())/0x3e8);_0x23fedd['push'](formatDuration(_0x2b98f1));}if(_0xe78b0e[_0x495ac7(0x216)])_0x23fedd[_0x495ac7(0x1f5)](formatRelativeTime(new Date(_0xe78b0e[_0x495ac7(0x216)])));else _0xe78b0e[_0x495ac7(0x1fa)]&&_0x23fedd[_0x495ac7(0x1f5)](formatRelativeTime(new Date(_0xe78b0e[_0x495ac7(0x1fa)])));const _0x60223e=_0x23fedd[_0x495ac7(0x201)]>0x0?a26_0x38e5f7[_0x495ac7(0x21c)]('\x20'+_0x23fedd['join'](',\x20')):'';console[_0x495ac7(0x1f2)]('⚡\x20'+_0x14cb6f+'\x20'+_0x278c7d+'\x20'+_0x17ee94+_0x60223e);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]=a26_0x5c5c6f(0x213);['description']=a26_0x5c5c6f(0x214);[a26_0x5c5c6f(0x21e)](_0x4d71f8){const _0x5b38c7=a26_0x5c5c6f,_0x21e143=_0x4d71f8[_0x5b38c7(0x212)][0x0];if(!_0x21e143)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x5c5c6f(0x200)](_0x11dcb3){const _0x5cef74=a26_0x5c5c6f,{options:_0x4f88e6,args:_0x1aee4e,tdx:_0x495996}=_0x11dcb3,_0x421290=_0x1aee4e[0x0],_0x3d8ed7=await withSpinner(_0x5cef74(0x206),()=>_0x495996['jobs'][_0x5cef74(0x209)](_0x421290),{'verbose':_0x4f88e6[_0x5cef74(0x215)]}),_0x2b105f=_0x3d8ed7[_0x5cef74(0x1f1)];let _0x5bda2d;if(_0x2b105f[_0x5cef74(0x1fa)]&&_0x2b105f[_0x5cef74(0x216)]){const _0x114b3a=new Date(_0x2b105f[_0x5cef74(0x1fa)])['getTime'](),_0x41a770=new Date(_0x2b105f[_0x5cef74(0x216)])[_0x5cef74(0x204)]();_0x5bda2d=Math[_0x5cef74(0x1fd)]((_0x41a770-_0x114b3a)/0x3e8);}const _0x533f2b={'job_id':_0x2b105f[_0x5cef74(0x1d1)],'type':_0x2b105f['type'],'status':_0x2b105f[_0x5cef74(0x1d8)],..._0x2b105f['user_name']&&{'user_name':_0x2b105f[_0x5cef74(0x1fc)]},..._0x5bda2d!==undefined&&{'duration_sec':_0x5bda2d},..._0x2b105f['created_at']&&{'created_at':_0x2b105f['created_at']},..._0x2b105f[_0x5cef74(0x1fa)]&&{'started_at':_0x2b105f[_0x5cef74(0x1fa)]},..._0x2b105f[_0x5cef74(0x216)]&&{'end_at':_0x2b105f[_0x5cef74(0x216)]},..._0x2b105f[_0x5cef74(0x1ea)]&&{'database':_0x2b105f['database']},..._0x2b105f['priority']!==undefined&&{'priority':_0x2b105f[_0x5cef74(0x1ee)]},..._0x2b105f[_0x5cef74(0x1cf)]&&{'url':_0x2b105f[_0x5cef74(0x1cf)]},..._0x2b105f[_0x5cef74(0x1dd)]&&{'query':_0x2b105f[_0x5cef74(0x1dd)]},..._0x2b105f['debug']&&{'debug':_0x2b105f['debug']}};return await handleSingleObjectOutput(_0x533f2b,_0x4f88e6),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='job:kill';[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x1f6);[a26_0x5c5c6f(0x21e)](_0x252081){const _0x39d2ef=a26_0x5c5c6f,_0x1b2375=_0x252081[_0x39d2ef(0x212)][0x0];if(!_0x1b2375)return _0x39d2ef(0x1e1);return undefined;}async['execute'](_0x53371b){const _0x439f56=a26_0x5c5c6f,{options:_0x44d1e1,args:_0x333a20,tdx:_0x43d060}=_0x53371b,_0x30486f=_0x333a20[0x0];if(!_0x44d1e1['yes']){const _0x2ce7cf=await confirm(_0x439f56(0x1d5)+_0x30486f+'?');if(!_0x2ce7cf)return console[_0x439f56(0x1cd)](_0x439f56(0x21b)),0x0;}return await withSpinner(_0x439f56(0x1fb),()=>_0x43d060['jobs']['kill'](_0x30486f),{'verbose':_0x44d1e1[_0x439f56(0x215)]}),console[_0x439f56(0x1cd)](_0x439f56(0x202)+_0x30486f),console[_0x439f56(0x1cd)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x30486f+_0x439f56(0x1cb)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]=a26_0x5c5c6f(0x20e);[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x1dc);async[a26_0x5c5c6f(0x200)](_0x1a447a){const _0xa89e1a=a26_0x5c5c6f,{options:_0x5ba98f,args:_0x106407,tdx:_0x5b94aa}=_0x1a447a,_0x24c89b=_0x5ba98f['jobType']||'trino',_0x48c130=_0x5ba98f[_0xa89e1a(0x1d2)],_0x5a4d4b=_0x5ba98f[_0xa89e1a(0x1ea)]||'information_schema',_0x59b144=_0x5ba98f[_0xa89e1a(0x1e5)];if(_0x24c89b!==_0xa89e1a(0x1ec)&&_0x24c89b!=='hive')throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x217));let _0xb5e2;if(_0x48c130){if(_0x106407[0x0])throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x1de));const _0x58a707=readSqlStatementsFromFile(_0x48c130);if(_0x58a707[_0xa89e1a(0x201)]===0x0)throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x1e6));if(_0x58a707[_0xa89e1a(0x201)]>0x1)throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x207));_0xb5e2=_0x58a707[0x0];}else{if(!_0x106407[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xa89e1a(0x1da));_0xb5e2=_0x106407[0x0];}_0x5ba98f[_0xa89e1a(0x215)]&&(console[_0xa89e1a(0x1cd)]('Job\x20type:\x20'+_0x24c89b),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x220)+_0x5a4d4b),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x1d7)+_0xb5e2[_0xa89e1a(0x1e3)](0x0,0x64)+(_0xb5e2[_0xa89e1a(0x201)]>0x64?'...':'')));const _0x2ebcc8=await withSpinner(_0xa89e1a(0x210),()=>_0x5b94aa[_0xa89e1a(0x20d)]['submit'](_0x5a4d4b,_0xb5e2,_0x24c89b,_0x59b144),{'verbose':_0x5ba98f[_0xa89e1a(0x215)]}),_0x2def73=_0x2ebcc8[_0xa89e1a(0x1f1)];return console['error'](_0xa89e1a(0x1ce)),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x1f4)+_0x2def73[_0xa89e1a(0x1d1)]),await handleSDKOutput([_0x2def73],_0x5ba98f),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='job:result';['description']='Get\x20job\x20results';[a26_0x5c5c6f(0x21e)](_0x19c577){const _0x46bd59=a26_0x5c5c6f,_0x34f444=_0x19c577[_0x46bd59(0x212)][0x0];if(!_0x34f444)return _0x46bd59(0x1d3);return undefined;}async['execute'](_0x1ced31){const _0x1fab5b=a26_0x5c5c6f,{options:_0xce332,args:_0x4f04f7,tdx:_0x44a963}=_0x1ced31,_0x542ce3=_0x4f04f7[0x0],_0xe76915=await withSpinner(_0x1fab5b(0x208),()=>_0x44a963[_0x1fab5b(0x20d)]['result'](_0x542ce3),{'verbose':_0xce332[_0x1fab5b(0x215)]}),_0x822eeb=_0xe76915[_0x1fab5b(0x1f1)];return console['error'](_0x1fab5b(0x1e0)+_0x822eeb['length']+_0x1fab5b(0x20b)+(_0x822eeb[_0x1fab5b(0x201)]!==0x1?'s':'')),await handleSDKOutput(_0x822eeb,_0xce332),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x27b7a2=a27_0x57ec;(function(_0x50a3c1,_0x5ef8e5){const _0x525ae2=a27_0x57ec,_0x448ea2=_0x50a3c1();while(!![]){try{const _0x490ca4=-parseInt(_0x525ae2(0x2d2))/0x1*(parseInt(_0x525ae2(0x2ba))/0x2)+-parseInt(_0x525ae2(0x2a1))/0x3*(-parseInt(_0x525ae2(0x21a))/0x4)+-parseInt(_0x525ae2(0x25f))/0x5+-parseInt(_0x525ae2(0x2b1))/0x6+parseInt(_0x525ae2(0x234))/0x7+-parseInt(_0x525ae2(0x291))/0x8+parseInt(_0x525ae2(0x1e8))/0x9;if(_0x490ca4===_0x5ef8e5)break;else _0x448ea2['push'](_0x448ea2['shift']());}catch(_0x5e2685){_0x448ea2['push'](_0x448ea2['shift']());}}}(a27_0x2afb,0xf0dbd));import a27_0xc564bb from'chalk';import a27_0x22d4ef 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';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a27_0x2afb(){const _0x482613=['\x27\x20not\x20found\x20in\x20','\x20details...','stringify','has','attributes','\x0aPull\x20summary:','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','audienceId','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','red','folderId','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Write\x20','List\x20journeys\x20in\x20current\x20context','hasPeriod','user','sort','Input:\x20','createVersion','Cancelled','root\x20folder','Listing\x20journeys...','journey','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Error:\x20--version\x20option\x20is\x20required','green','Show\x20journey\x20table\x20column\x20mapping','goalSize','Getting\x20journey\x20details...','enteredSize','\x20files?','-\x20no\x20files\x20written','Listing\x20journey\x20versions...','Fetching\x20parent\x20segment...','journey:version:create','conversion','Creating\x20new\x20version...','\x20new\x20files','9060304ArBuMy','test','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','folders','repeat','List\x20activations\x20for\x20a\x20journey','completionRate','utf-8','renderStats','\x20Created\x20v','✔\x20All\x20files\x20are\x20up\x20to\x20date','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','completeMilestoneRate','/app/ps/','message','13758qlTFtm','from','bold','add','Parent\x20segment:\x20','Resolving\x20version...','listJourneysWithFolders','\x20->\x20','journey:pull','execute','state','content','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x20Opening\x20','values','3466476gfjWVJ','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','INVALID_ARGUMENT','\x20(ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x20not\x20found.\x20Available:\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','getJourney','Resolving\x20parent\x20segment...','129586CJMXRy','Journey\x20name:\x20','dryRun','\x22\x20resumed','/j/da','journeys','columns','errorCode','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','getStatistics','\x20journey','segmentName','args','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x22\x20not\x20found','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','options','Getting\x20journey\x20statistics...','journeyBundleId','stages','stage','/j/da/je','7ooPdQh','history','parent_segment','find','data','then','relativePath','connector_config','limit','Getting\x20column\x20mapping...','/e/','hasChanges','base','journeyId','site','listJourneysFromParentSegment','\x20changed\x20files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','size','all','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','4624902kKXZda','Error:\x20Parent\x20segment\x20context\x20required','segmentPushCommand','parentName','Fetching\x20journeys\x20and\x20folders...','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','milestoneSize','\x20journey\x20files\x20to\x20','\x20activation','includeStats','\x20(rule\x20match)','verbose','paused','set','parentSegment','📁\x20','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)','Error:\x20Invalid\x20version\x20number:\x20','Available\x20stages:\x20','\x20=\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','toLowerCase','push','nodes','createdAt','isNew','(paused)','pause','absolutePath','error','join','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','\x20journeys','🗺️\x20','\x20versions)','links','(root)','cyan','cwd','segment','Show\x20journey\x20details','List\x20all\x20versions\x20of\x20a\x20journey','Fetching\x20','filePath','\x22\x20paused','activation','json','Warning:\x20Could\x20not\x20resolve\x20activation\x20','activationParams','1220Ohycrq','resolveSegment','web','exitOrJumpSize','filter','Error:\x20Journey\x20not\x20found:\x20','resume','✔\x20Journey\x20\x22','\x20\x20Parent\x20segment:\x20','Resolving\x20journey...','Database:\x20','journeyBundleName','getColumnMapping','journey:push','resolveParentId','localeCompare','yes','goal','name','format','journey:resume','yellow','Found\x20','session','table','\x0aChanges\x20to\x20\x27','10787413rDYndH','resourceName','(running)','map','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','versionNumber','jsonl','kind','\x20\x20Journey\x20ID:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','getSegment','relative','...','replace','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','journey:stats','targetDir','database','buildIdToEmailMap','journey:activations','journey:view','segments','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Getting\x20journey\x20traffic\x20data...','type','includeHistory','no_parent','diff','exitOrJumpRate','Aborted.','journey:version:view','\x20\x20Folder\x20path:\x20','.yml','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Resume\x20a\x20paused\x20journey','\x20version','\x5c$&','journeyName','journey:list','folderPath','(archived)','log','1516375yCiEBl','get','Target\x20file:\x20','getLatestJourneyId','version','journeyStages','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','length','rule','No\x20journeys\x20found','helpText','journey:columns'];a27_0x2afb=function(){return _0x482613;};return a27_0x2afb();}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(_0x44f8a4){const _0x3de65a=a27_0x57ec;return!_0x44f8a4&&(console['error'](_0x3de65a(0x293)),console[_0x3de65a(0x205)](_0x3de65a(0x29c))),!!_0x44f8a4;}function withJsonFormat(_0x3e430c){const _0x57fe9a=a27_0x57ec;if(!_0x3e430c[_0x57fe9a(0x22d)]&&!_0x3e430c[_0x57fe9a(0x217)]&&!_0x3e430c[_0x57fe9a(0x23a)]&&!_0x3e430c['tsv'])return{..._0x3e430c,'format':_0x57fe9a(0x217),'json':!![]};return _0x3e430c;}function formatJourneyState(_0x279cc2){const _0x442d7a=a27_0x57ec;switch(_0x279cc2){case'launched':return a27_0xc564bb['green'](_0x442d7a(0x236));case'draft':return a27_0xc564bb['dim']('(draft)');case _0x442d7a(0x1f4):return a27_0xc564bb[_0x442d7a(0x22f)](_0x442d7a(0x202));case'completed':return a27_0xc564bb['blue']('(completed)');case'archived':return a27_0xc564bb[_0x442d7a(0x1e4)](_0x442d7a(0x25d));default:return'('+_0x279cc2+')';}}function formatJourneyItem(_0x1cc8c5,_0x4a88e7='',_0x5df2c2){const _0x1ef2e6=a27_0x57ec,_0x3547ca=formatJourneyState(_0x1cc8c5[_0x1ef2e6(0x2ab)]),_0x4096fb=_0x5df2c2?hyperlink(_0x1cc8c5[_0x1ef2e6(0x225)],_0x5df2c2):_0x1cc8c5['journeyBundleName'];return _0x4a88e7+_0x1ef2e6(0x20a)+_0x4096fb+'\x20'+_0x3547ca;}function escapeRegex(_0x5e19f2){const _0x410794=a27_0x57ec;return _0x5e19f2[_0x410794(0x241)](/[.*+?^${}()|[\]\\]/g,_0x410794(0x259));}function globToRegex(_0x11907b){const _0x59ac82=a27_0x57ec,_0xfb4b41=_0x11907b['split']('*')['map'](escapeRegex);return new RegExp(_0xfb4b41[_0x59ac82(0x206)]('.*'),'i');}function buildRuleToNameMapping(_0x1a6373){const _0x44bde1=a27_0x57ec,_0x29a9d7=new Map();if(_0x1a6373[_0x44bde1(0x24a)])for(const [_0x5c2a76,_0x315ecb]of Object['entries'](_0x1a6373[_0x44bde1(0x24a)])){if(_0x315ecb['rule']){const _0x5a9587=serializeRule(_0x315ecb[_0x44bde1(0x267)]),_0x32810b=_0x29a9d7[_0x44bde1(0x260)](_0x5a9587);_0x32810b?_0x32810b[_0x44bde1(0x1fe)](_0x5c2a76):_0x29a9d7['set'](_0x5a9587,[_0x5c2a76]);}}return _0x29a9d7;}async function resolveJourneyIdFromInput(_0x23099a,_0x5c84d1,_0x357094){const _0x5ef775=a27_0x57ec,_0x40c0c2=await resolveJourneyTarget(_0x23099a,_0x5c84d1['parentSegment'],_0x5c84d1[_0x5ef775(0x1f3)]),_0x34ba85=_0x40c0c2[_0x5ef775(0x1f6)];if(!_0x34ba85)throw new SDKError(ErrorCode[_0x5ef775(0x2b3)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x58d716=await withSpinner(_0x5ef775(0x2b9),()=>_0x357094[_0x5ef775(0x210)][_0x5ef775(0x228)](_0x34ba85),{'verbose':_0x5c84d1[_0x5ef775(0x1f3)]}),_0x3e7fb8=_0x58d716[_0x5ef775(0x2d6)],_0x593459=await withSpinner(_0x5ef775(0x223),()=>_0x357094[_0x5ef775(0x281)]['resolveJourneyId'](_0x3e7fb8,_0x40c0c2[_0x5ef775(0x25a)]),{'verbose':_0x5c84d1[_0x5ef775(0x1f3)]});return{'journeyId':_0x593459['data'],'journeyName':_0x40c0c2[_0x5ef775(0x25a)],'parentSegmentId':_0x3e7fb8};}async function resolveJourneyTarget(_0x1e9226,_0x211ad4,_0x5bf01d){const _0x209a8c=a27_0x57ec;if(isYamlFilePath(_0x1e9226))try{const _0x34c518=await resolveYamlFilePath(_0x1e9226);return _0x5bf01d&&(console[_0x209a8c(0x205)]('Resolved\x20YAML\x20file:\x20'+_0x1e9226),console[_0x209a8c(0x205)](_0x209a8c(0x222)+_0x34c518[_0x209a8c(0x1f6)]),console[_0x209a8c(0x205)]('\x20\x20Name:\x20'+_0x34c518[_0x209a8c(0x2c5)]),console[_0x209a8c(0x205)](_0x209a8c(0x254)+(_0x34c518['folderPath']||_0x209a8c(0x20d)))),{'journeyName':_0x34c518[_0x209a8c(0x2c5)],'parentSegment':_0x34c518[_0x209a8c(0x1f6)],'resolved':_0x34c518};}catch(_0x5d0f31){throw new SDKError(ErrorCode[_0x209a8c(0x2b3)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x5d0f31[_0x209a8c(0x2a0)]);}if(!_0x211ad4)throw new SDKError(ErrorCode[_0x209a8c(0x2b3)],_0x209a8c(0x1ed));return{'journeyName':_0x1e9226,'parentSegment':_0x211ad4};}function a27_0x57ec(_0x408a3a,_0x574286){_0x408a3a=_0x408a3a-0x1dc;const _0x2afbc8=a27_0x2afb();let _0x57ec6c=_0x2afbc8[_0x408a3a];return _0x57ec6c;}export class JourneyListCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x25b);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x278);async['execute'](_0x50bbdc){const _0xcc930b=a27_0x27b7a2,{options:_0x3dd532,args:_0x562fc8,tdx:_0xcbc541}=_0x50bbdc,_0x1dcafd=_0x562fc8[0x0],_0x25a1f0=_0x3dd532[_0xcc930b(0x1f6)];if(!_0x25a1f0)return console['error'](_0xcc930b(0x1e9)),console['error'](_0xcc930b(0x265)),0x1;const _0x420d0f=await withSpinner(_0xcc930b(0x2b9),()=>_0xcbc541['segment'][_0xcc930b(0x228)](_0x25a1f0),{'verbose':_0x3dd532[_0xcc930b(0x1f3)]}),_0x57dd80=_0x420d0f[_0xcc930b(0x2d6)];_0x3dd532[_0xcc930b(0x1f3)]&&(console[_0xcc930b(0x205)](_0xcc930b(0x2a5)+_0x25a1f0+_0xcc930b(0x2b4)+_0x57dd80+')'),_0x1dcafd&&console['error']('Pattern:\x20'+_0x1dcafd));const _0x2a9bb5=await withSpinner(_0xcc930b(0x28c),()=>_0xcbc541[_0xcc930b(0x210)]['getParentFull'](_0x57dd80),{'verbose':_0x3dd532['verbose']}),_0x4a5169=_0x2a9bb5['data'],_0xb111b8=_0x4a5169['rootFolderId'],_0x301d0c=await withSpinner(_0xcc930b(0x280),()=>_0xcbc541[_0xcc930b(0x281)][_0xcc930b(0x2a7)](_0x57dd80,_0xb111b8),{'verbose':_0x3dd532[_0xcc930b(0x1f3)]});let _0x1e9472=_0x301d0c[_0xcc930b(0x2d6)][_0xcc930b(0x2bf)];const _0x331d33=_0x301d0c['data'][_0xcc930b(0x294)],_0x21d50b=new Map();for(const _0xd163c3 of _0x331d33){_0x21d50b[_0xcc930b(0x1f5)](_0xd163c3['id'],_0xd163c3[_0xcc930b(0x22c)]);}if(_0x1dcafd){const _0xcd62bb=globToRegex(_0x1dcafd);_0x1e9472=_0x1e9472['filter'](_0xa82034=>_0xcd62bb[_0xcc930b(0x292)](_0xa82034['journeyBundleName']));}console['error']('✔\x20Found\x20'+_0x1e9472[_0xcc930b(0x266)]+_0xcc930b(0x2c4)+(_0x1e9472['length']!==0x1?'s':''));const _0x31da0a=_0x506b71=>{const _0xbe7639=_0xcc930b;return getConsoleNextUrl(_0x3dd532['site'],_0xbe7639(0x29f)+_0x57dd80+_0xbe7639(0x1dc)+_0x506b71+_0xbe7639(0x2be));};if(_0x3dd532[_0xcc930b(0x22d)]===_0xcc930b(0x232))await handleSDKOutput(_0x1e9472,_0x3dd532);else{if(_0x3dd532[_0xcc930b(0x22d)]===_0xcc930b(0x217)){const _0x2a668c=_0x1e9472[_0xcc930b(0x237)](_0x53b06d=>({..._0x53b06d,'url':_0x31da0a(_0x53b06d['id'])}));await handleSDKOutput(_0x2a668c,_0x3dd532);}else{console[_0xcc930b(0x25e)]('['+_0x25a1f0+']');const _0x5498b5=new Map(),_0x1b1d2a=[];for(const _0x114f83 of _0x1e9472){if(!_0x114f83[_0xcc930b(0x275)]||_0x114f83[_0xcc930b(0x275)]===_0xb111b8)_0x1b1d2a[_0xcc930b(0x1fe)](_0x114f83);else{const _0x4f4994=_0x5498b5['get'](_0x114f83[_0xcc930b(0x275)])||[];_0x4f4994[_0xcc930b(0x1fe)](_0x114f83),_0x5498b5[_0xcc930b(0x1f5)](_0x114f83[_0xcc930b(0x275)],_0x4f4994);}}const _0x1465b8=(_0x422eb7,_0x5a577f)=>_0x422eb7[_0xcc930b(0x225)][_0xcc930b(0x229)](_0x5a577f['journeyBundleName'],undefined,{'sensitivity':_0xcc930b(0x1de)});_0x1b1d2a[_0xcc930b(0x27b)](_0x1465b8);for(const _0x538544 of _0x1b1d2a){console[_0xcc930b(0x25e)](formatJourneyItem(_0x538544,'',_0x31da0a(_0x538544['id'])));}const _0x490dbd=[..._0x5498b5['entries']()]['sort']((_0x15b5d8,_0x49924d)=>{const _0x1053d8=_0xcc930b,_0x1e0646=_0x21d50b['get'](_0x15b5d8[0x0])||_0x15b5d8[0x0],_0x4dcb8f=_0x21d50b['get'](_0x49924d[0x0])||_0x49924d[0x0];return _0x1e0646[_0x1053d8(0x229)](_0x4dcb8f,undefined,{'sensitivity':'base'});});for(const [_0x1a2712,_0x5987de]of _0x490dbd){const _0x1d8fa5=_0x21d50b[_0xcc930b(0x260)](_0x1a2712)||_0x1a2712;console['log'](_0xcc930b(0x1f7)+_0x1d8fa5),_0x5987de[_0xcc930b(0x27b)](_0x1465b8);for(const _0x5b52f6 of _0x5987de){console[_0xcc930b(0x25e)](formatJourneyItem(_0x5b52f6,'\x20\x20',_0x31da0a(_0x5b52f6['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x27b7a2(0x249);['description']=a27_0x27b7a2(0x211);async[a27_0x27b7a2(0x2aa)](_0x3d1333){const _0x3ea5df=a27_0x27b7a2,{options:_0x476ac7,args:_0x4e8c88,tdx:_0x768483}=_0x3d1333,_0x5bca7e=_0x4e8c88[0x0];if(!_0x5bca7e)return console[_0x3ea5df(0x205)](_0x3ea5df(0x293)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console['error']('Options:'),console[_0x3ea5df(0x205)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x476ac7[_0x3ea5df(0x1f3)]&&console[_0x3ea5df(0x205)](_0x3ea5df(0x27c)+_0x5bca7e);const {journeyId:_0x2cc1b5,parentSegmentId:_0x1ea8a7}=await resolveJourneyIdFromInput(_0x5bca7e,_0x476ac7,_0x768483);if(_0x476ac7[_0x3ea5df(0x21c)]){const _0x272573=getConsoleNextUrl(_0x476ac7[_0x3ea5df(0x1e0)],_0x3ea5df(0x29f)+_0x1ea8a7+'/e/'+_0x2cc1b5+_0x3ea5df(0x2d1));return console[_0x3ea5df(0x205)](a27_0xc564bb[_0x3ea5df(0x284)]('✔')+_0x3ea5df(0x2af)+a27_0xc564bb[_0x3ea5df(0x20e)](_0x272573)),openBrowser(_0x272573),0x0;}const _0x237791=await withSpinner(_0x3ea5df(0x287),()=>_0x768483[_0x3ea5df(0x281)]['getJourney'](_0x2cc1b5),{'verbose':_0x476ac7[_0x3ea5df(0x1f3)]}),_0x1c1b3f=_0x237791[_0x3ea5df(0x2d6)],_0x26385f=_0x476ac7[_0x3ea5df(0x1f1)];let _0x2e7a4f;if(_0x26385f)try{const _0xb21528=await withSpinner(_0x3ea5df(0x2cd),()=>_0x768483[_0x3ea5df(0x281)][_0x3ea5df(0x2c3)](_0x2cc1b5),{'verbose':_0x476ac7['verbose']});_0x2e7a4f=_0xb21528[_0x3ea5df(0x2d6)];}catch{_0x476ac7[_0x3ea5df(0x1f3)]&&console[_0x3ea5df(0x205)]('\x20\x20Statistics\x20not\x20available');}const _0xff38c7=getConsoleNextUrl(_0x476ac7[_0x3ea5df(0x1e0)],_0x3ea5df(0x29f)+_0x1ea8a7+_0x3ea5df(0x1dc)+_0x2cc1b5+_0x3ea5df(0x2d1)),_0x29bf05={'id':_0x1c1b3f['id'],'name':_0x1c1b3f[_0x3ea5df(0x26f)][_0x3ea5df(0x22c)],'description':_0x1c1b3f[_0x3ea5df(0x26f)]['description'],'state':_0x1c1b3f[_0x3ea5df(0x26f)]['state'],'paused':_0x1c1b3f['attributes'][_0x3ea5df(0x1f4)],'reentry_mode':_0x1c1b3f[_0x3ea5df(0x26f)]['reentryMode'],'stages':_0x1c1b3f[_0x3ea5df(0x26f)][_0x3ea5df(0x264)]?.['length']||0x0,..._0x1c1b3f[_0x3ea5df(0x26f)][_0x3ea5df(0x22b)]&&{'goal':_0x1c1b3f[_0x3ea5df(0x26f)][_0x3ea5df(0x22b)][_0x3ea5df(0x22c)]},..._0x2e7a4f&&{'statistics':{'size':_0x2e7a4f[_0x3ea5df(0x1e5)],'entered':_0x2e7a4f[_0x3ea5df(0x288)],'goal_achieved':_0x2e7a4f[_0x3ea5df(0x286)],'completion_rate':_0x2e7a4f[_0x3ea5df(0x297)],'exit_or_jump':_0x2e7a4f[_0x3ea5df(0x21d)],'exit_or_jump_rate':_0x2e7a4f[_0x3ea5df(0x251)],'stages':_0x2e7a4f['stages']}},'url':_0xff38c7};return await handleSingleObjectOutput(_0x29bf05,_0x476ac7),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x244);[a27_0x27b7a2(0x2ca)]='Show\x20journey\x20statistics';async['execute'](_0x3db119){const _0x27a82f=a27_0x27b7a2,{options:_0x3ba1ff,args:_0x59b61d,tdx:_0x154918}=_0x3db119,_0x5aad53=_0x59b61d[0x0];if(!requireNameOrPath(_0x5aad53))return 0x1;_0x3ba1ff[_0x27a82f(0x1f3)]&&console['error'](_0x27a82f(0x27c)+_0x5aad53);const _0x56d282=_0x3ba1ff,_0x1871c3=_0x56d282[_0x27a82f(0x2a2)],_0xc04a96=_0x56d282['to'],_0x150f36=_0x56d282[_0x27a82f(0x24e)],_0x548983=_0x56d282[_0x27a82f(0x2d0)];_0x150f36&&!_0x1871c3&&!_0xc04a96&&console['error'](_0x27a82f(0x207));const _0x2d1491=_0x150f36?withJsonFormat(_0x3ba1ff):_0x3ba1ff,{journeyId:_0x2caf08,journeyName:_0x3e5a90}=await resolveJourneyIdFromInput(_0x5aad53,_0x2d1491,_0x154918),_0x23e1e1=_0x1871c3||_0xc04a96?{'from':_0x1871c3,'to':_0xc04a96}:undefined,_0x3a9af8=await withSpinner(_0x27a82f(0x2cd),()=>Promise[_0x27a82f(0x1e6)]([_0x154918[_0x27a82f(0x281)]['getJourney'](_0x2caf08),_0x154918[_0x27a82f(0x281)]['getStatistics'](_0x2caf08,_0x23e1e1)]),{'verbose':_0x2d1491[_0x27a82f(0x1f3)]}),[_0x323051,_0x5b57ea]=_0x3a9af8[_0x27a82f(0x2d6)];if(!_0x5b57ea||_0x5b57ea[_0x27a82f(0x1df)]===null)return console[_0x27a82f(0x205)](_0x27a82f(0x242)+_0x3e5a90),console['error'](_0x27a82f(0x2ad)),0x0;const _0x3a50f6=buildStageNameMap(_0x323051),_0x3a0160=!!(_0x23e1e1&&_0x5b57ea['history']?.[_0x27a82f(0x266)]),_0x2e3903={'stageNameMap':_0x3a50f6,'hasPeriod':_0x3a0160,'includeHistory':!!_0x150f36};if(_0x548983&&_0x5b57ea[_0x27a82f(0x2cf)]){const _0x50e3b4=_0x5b57ea['stages'][_0x27a82f(0x2d5)](_0x1f1d01=>{const _0x3e420d=_0x27a82f,_0x232250=_0x3a50f6['get'](_0x1f1d01['id'])??'';return _0x232250[_0x3e420d(0x1fd)]()===_0x548983[_0x3e420d(0x1fd)]();});if(_0x50e3b4)return await handleSingleObjectOutput(formatStageStats(_0x50e3b4,_0x2e3903),_0x2d1491),0x0;const _0x2e3a05=_0x5b57ea[_0x27a82f(0x2cf)][_0x27a82f(0x237)](_0x5a8e5d=>_0x3a50f6['get'](_0x5a8e5d['id'])??_0x5a8e5d['id']);return console[_0x27a82f(0x205)]('Error:\x20Stage\x20\x22'+_0x548983+_0x27a82f(0x2c8)),console[_0x27a82f(0x205)](_0x27a82f(0x1fa)+_0x2e3a05[_0x27a82f(0x206)](',\x20')),0x1;}const _0x1be26d=_0x5b57ea['stages']?.[_0x27a82f(0x237)](_0x1e33cd=>formatStageStats(_0x1e33cd,_0x2e3903)),_0x384358=assembleJourneyStats(_0x5b57ea,{'from':_0x1871c3,'to':_0xc04a96,'includeHistory':_0x150f36});return await this[_0x27a82f(0x299)](_0x384358,_0x1be26d??[],_0x2d1491),0x0;}async[a27_0x27b7a2(0x299)](_0x39e297,_0x1e0cd4,_0x3082f0){const _0x462257=a27_0x27b7a2,_0x6ac363=_0x3082f0[_0x462257(0x22d)]==='json'||_0x3082f0[_0x462257(0x22d)]===_0x462257(0x23a)||_0x3082f0['json']||_0x3082f0[_0x462257(0x23a)];if(_0x6ac363){_0x39e297['stages']=_0x1e0cd4,await handleSingleObjectOutput(_0x39e297,_0x3082f0);return;}await handleSingleObjectOutput(_0x39e297,_0x3082f0);for(const _0x3fff4f of _0x1e0cd4){console[_0x462257(0x25e)](''),console[_0x462257(0x25e)](String(a27_0xc564bb[_0x462257(0x20e)][_0x462257(0x2a3)]('['+_0x3fff4f['name']+']'))+a27_0xc564bb['dim']('\x20'+_0x3fff4f['id']));const {id:_0x359fe8,name:_0x2cbc36,..._0x4fb7e8}=_0x3fff4f;await handleSingleObjectOutput(_0x4fb7e8,_0x3082f0);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]='journey:traffic';[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x2c2);async[a27_0x27b7a2(0x2aa)](_0x220cd3){const _0x4aa39b=a27_0x27b7a2,{options:_0x36f6a0,args:_0x29f379,tdx:_0x4439b8}=_0x220cd3,_0xfd1c52=_0x29f379[0x0];if(!requireNameOrPath(_0xfd1c52))return 0x1;_0x36f6a0[_0x4aa39b(0x1f3)]&&console[_0x4aa39b(0x205)]('Input:\x20'+_0xfd1c52);const _0x26e02a=_0x36f6a0,_0x2356b2=_0x26e02a[_0x4aa39b(0x24d)],_0x404b2d=_0x26e02a[_0x4aa39b(0x2a2)],_0x1f981f=_0x26e02a['to'],_0x561979=_0x26e02a[_0x4aa39b(0x2da)];if(_0x2356b2&&_0x2356b2!==_0x4aa39b(0x28e)&&_0x2356b2!==_0x4aa39b(0x216))return console[_0x4aa39b(0x205)]('Error:\x20Invalid\x20--type\x20\x22'+_0x2356b2+_0x4aa39b(0x24b)),0x1;const _0x215a7b=withJsonFormat(_0x36f6a0),{journeyId:_0x531074,journeyName:_0x2ff9f9}=await resolveJourneyIdFromInput(_0xfd1c52,_0x215a7b,_0x4439b8),_0x206858={'type':_0x2356b2,'from':_0x404b2d,'to':_0x1f981f,'limit':_0x561979},_0x461cc6=await withSpinner(_0x4aa39b(0x24c),()=>_0x4439b8[_0x4aa39b(0x281)]['getTrafficData'](_0x531074,_0x206858),{'verbose':_0x215a7b['verbose']}),_0x1f8896=_0x461cc6[_0x4aa39b(0x2d6)],_0x153239=_0x1f8896['conversion']&&(_0x1f8896[_0x4aa39b(0x28e)][_0x4aa39b(0x1ff)][_0x4aa39b(0x266)]>0x0||_0x1f8896[_0x4aa39b(0x28e)][_0x4aa39b(0x20c)][_0x4aa39b(0x266)]>0x0),_0x546abf=_0x1f8896[_0x4aa39b(0x216)]&&_0x1f8896[_0x4aa39b(0x216)][_0x4aa39b(0x266)]>0x0;if(!_0x153239&&!_0x546abf)return console[_0x4aa39b(0x205)](_0x4aa39b(0x276)+_0x2ff9f9),console['error'](_0x4aa39b(0x271)),_0x404b2d&&_0x1f981f&&console[_0x4aa39b(0x205)](_0x4aa39b(0x208)),0x0;return await handleSingleObjectOutput(_0x1f8896,_0x215a7b),0x0;}}function formatStageStats(_0x3bc0ca,_0x499678){const _0x1298c7=a27_0x27b7a2,_0x1a2956=_0x499678[_0x1298c7(0x279)]&&_0x3bc0ca[_0x1298c7(0x2d3)]?.[_0x1298c7(0x266)]?aggregateStageHistory(_0x3bc0ca[_0x1298c7(0x2d3)]):{'size':_0x3bc0ca[_0x1298c7(0x1e5)],'entered':_0x3bc0ca[_0x1298c7(0x288)],'milestone':_0x3bc0ca[_0x1298c7(0x1ee)],'milestone_rate':_0x3bc0ca[_0x1298c7(0x29e)],'exit_or_jump':_0x3bc0ca[_0x1298c7(0x21d)],'exit_or_jump_rate':_0x3bc0ca[_0x1298c7(0x251)]},_0x1231ee={'id':_0x3bc0ca['id'],'name':_0x499678['stageNameMap'][_0x1298c7(0x260)](_0x3bc0ca['id'])??_0x3bc0ca['id'],..._0x1a2956};return _0x499678[_0x1298c7(0x279)]&&_0x499678[_0x1298c7(0x24e)]&&_0x3bc0ca[_0x1298c7(0x2d3)]&&(_0x1231ee['history']=_0x3bc0ca[_0x1298c7(0x2d3)]),_0x1231ee;}export class JourneyPauseCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]='journey:pause';[a27_0x27b7a2(0x2ca)]='Pause\x20a\x20running\x20journey';async[a27_0x27b7a2(0x2aa)](_0x2fdee6){const _0x11138f=a27_0x27b7a2,{options:_0x71ccba,args:_0x42fff8,tdx:_0x29a0fa}=_0x2fdee6,_0x28fef8=_0x42fff8[0x0];if(!requireNameOrPath(_0x28fef8))return 0x1;_0x71ccba[_0x11138f(0x1f3)]&&console[_0x11138f(0x205)](_0x11138f(0x27c)+_0x28fef8);const {journeyId:_0x880507,journeyName:_0xc1bc09}=await resolveJourneyIdFromInput(_0x28fef8,_0x71ccba,_0x29a0fa);if(!_0x71ccba['yes']){const _0x377f40=await confirm(_0x11138f(0x2b2)+_0xc1bc09+'\x22?');if(!_0x377f40)return console[_0x11138f(0x205)](_0x11138f(0x27e)),0x0;}const _0x2df18c=await withSpinner('Pausing\x20journey...',()=>_0x29a0fa[_0x11138f(0x281)][_0x11138f(0x203)](_0x880507),{'verbose':_0x71ccba[_0x11138f(0x1f3)]}),_0x1bcd30=_0x2df18c[_0x11138f(0x2d6)];return console[_0x11138f(0x205)](_0x11138f(0x221)+_0x1bcd30['attributes'][_0x11138f(0x22c)]+_0x11138f(0x215)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x27b7a2(0x22e);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x257);async[a27_0x27b7a2(0x2aa)](_0x4dc32c){const _0x17e0fc=a27_0x27b7a2,{options:_0x1f8dbb,args:_0xef29ae,tdx:_0x51bc0c}=_0x4dc32c,_0xd6399b=_0xef29ae[0x0];if(!requireNameOrPath(_0xd6399b))return 0x1;_0x1f8dbb[_0x17e0fc(0x1f3)]&&console['error']('Input:\x20'+_0xd6399b);const {journeyId:_0xfae3d9,journeyName:_0x38b9b7}=await resolveJourneyIdFromInput(_0xd6399b,_0x1f8dbb,_0x51bc0c);if(!_0x1f8dbb[_0x17e0fc(0x22a)]){const _0x2deb33=await confirm(_0x17e0fc(0x2b5)+_0x38b9b7+'\x22?');if(!_0x2deb33)return console[_0x17e0fc(0x205)](_0x17e0fc(0x27e)),0x0;}const _0x3d0bd9=await withSpinner('Resuming\x20journey...',()=>_0x51bc0c[_0x17e0fc(0x281)][_0x17e0fc(0x220)](_0xfae3d9),{'verbose':_0x1f8dbb['verbose']}),_0x505e27=_0x3d0bd9['data'];return console[_0x17e0fc(0x205)](_0x17e0fc(0x221)+_0x505e27[_0x17e0fc(0x26f)][_0x17e0fc(0x22c)]+_0x17e0fc(0x2bd)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x2a9);[a27_0x27b7a2(0x2ca)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x27b7a2(0x2aa)](_0x419a76){const _0x5d6374=a27_0x27b7a2,{options:_0x1f0292,args:_0x243672,tdx:_0x4fff45}=_0x419a76,_0x3801fa=_0x1f0292,_0x31a669=_0x243672[0x0],_0x5714a2=_0x31a669&&isYamlFilePath(_0x31a669),_0x453861=await resolveTarget({'arg':_0x5714a2?_0x31a669:undefined,'contextParent':_0x1f0292[_0x5d6374(0x1f6)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x453861))return _0x453861[_0x5d6374(0x2c1)]===_0x5d6374(0x24f)?(console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x22f)](_0x5d6374(0x1fc))),console['error'](_0x5d6374(0x1f8)),console[_0x5d6374(0x205)](_0x5d6374(0x243)),console['error'](_0x5d6374(0x2cb)),console[_0x5d6374(0x205)](_0x5d6374(0x273))):(console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x274)]('Error:\x20'+_0x453861[_0x5d6374(0x2a0)]+'\x0a')),_0x453861[_0x5d6374(0x269)]&&console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x20e)](_0x453861[_0x5d6374(0x269)]))),0x1;let _0x1d14d3=_0x5714a2?undefined:_0x31a669,_0x33b7b2,_0x3ac2cf;_0x453861[_0x5d6374(0x24d)]==='file'&&(_0x1d14d3=_0x453861[_0x5d6374(0x235)],_0x33b7b2=_0x453861[_0x5d6374(0x214)],_0x3ac2cf=_0x453861[_0x5d6374(0x25c)]);const _0x1615f0=_0x453861[_0x5d6374(0x1eb)],_0x59f9d0=_0x453861[_0x5d6374(0x245)];_0x3801fa[_0x5d6374(0x1f3)]&&(console[_0x5d6374(0x205)](_0x5d6374(0x2a5)+_0x1615f0),console[_0x5d6374(0x205)]('Target\x20directory:\x20'+_0x59f9d0),_0x1d14d3&&console[_0x5d6374(0x205)](_0x5d6374(0x2bb)+_0x1d14d3),_0x33b7b2&&console[_0x5d6374(0x205)](_0x5d6374(0x261)+_0x33b7b2),_0x3ac2cf&&console[_0x5d6374(0x205)]('Folder\x20path:\x20'+_0x3ac2cf));const _0x741ef9=await withSpinner(_0x5d6374(0x2b9),()=>_0x4fff45[_0x5d6374(0x210)][_0x5d6374(0x228)](_0x1615f0),{'verbose':_0x1f0292['verbose']}),_0x17b95d=_0x741ef9['data'],{journeys:_0x4ef13c,folders:_0x1f4ec9}=await withSpinner(_0x5d6374(0x1ec),async()=>{const _0x898a20=_0x5d6374,[_0x54290e,_0x3e4bbd]=await Promise[_0x898a20(0x1e6)]([_0x4fff45[_0x898a20(0x281)][_0x898a20(0x1e1)](_0x17b95d,undefined,{'includeAllVersions':!![]}),_0x4fff45[_0x898a20(0x210)]['listFolders'](_0x17b95d)]);return{'journeys':_0x54290e,'folders':_0x3e4bbd};},{'verbose':_0x1f0292[_0x5d6374(0x1f3)]})[_0x5d6374(0x2d7)](_0x13e547=>_0x13e547[_0x5d6374(0x2d6)]);let _0x21283d=_0x4ef13c;const _0x53febc=buildFolderIdToPathMap(_0x1f4ec9);if(_0x1d14d3){const _0x47fbc2=_0x21283d[_0x5d6374(0x21e)](_0x1e8d08=>_0x1e8d08[_0x5d6374(0x225)][_0x5d6374(0x1fd)]()===_0x1d14d3['toLowerCase']());if(_0x47fbc2[_0x5d6374(0x266)]===0x0)return console['error'](_0x5d6374(0x21f)+_0x1d14d3),console[_0x5d6374(0x205)](_0x5d6374(0x2ae)),0x1;_0x21283d=_0x47fbc2;}if(_0x3ac2cf!==undefined){const _0x3d332e=_0x21283d['filter'](_0x24f6cb=>{const _0xc2099a=_0x5d6374,_0x43b0fb=_0x24f6cb['folderId']?_0x53febc[_0xc2099a(0x260)](_0x24f6cb[_0xc2099a(0x275)])||'':'';return _0x43b0fb===_0x3ac2cf;});if(_0x3d332e[_0x5d6374(0x266)]===0x0&&_0x21283d[_0x5d6374(0x266)]>0x0){console[_0x5d6374(0x205)]('Error:\x20Journey\x20\x27'+_0x1d14d3+_0x5d6374(0x26b)+(_0x3ac2cf||_0x5d6374(0x27f))),console[_0x5d6374(0x205)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x53f826 of _0x21283d){const _0x4182d3=_0x53f826[_0x5d6374(0x275)]?_0x53febc[_0x5d6374(0x260)](_0x53f826['folderId'])||'':'';console[_0x5d6374(0x205)]('\x20\x20-\x20'+(_0x4182d3||_0x5d6374(0x20d))+'/'+_0x53f826['journeyBundleName']);}return 0x1;}_0x21283d=_0x3d332e;}if(_0x21283d[_0x5d6374(0x266)]===0x0)return console[_0x5d6374(0x205)](_0x5d6374(0x268)),0x0;const _0x14e68f=new Map();for(const _0x4764f7 of _0x21283d){const _0x4e4bfa=_0x4764f7[_0x5d6374(0x2ce)];!_0x14e68f[_0x5d6374(0x26e)](_0x4e4bfa)&&_0x14e68f[_0x5d6374(0x1f5)](_0x4e4bfa,[]),_0x14e68f[_0x5d6374(0x260)](_0x4e4bfa)[_0x5d6374(0x1fe)](_0x4764f7);}for(const _0x4736bb of _0x14e68f['values']()){_0x4736bb[_0x5d6374(0x27b)]((_0x27630f,_0x2f9136)=>(_0x27630f[_0x5d6374(0x239)]||0x0)-(_0x2f9136['versionNumber']||0x0));}const _0x52a7e7=[],{idToEmailMap:_0x4b7e51,connectionIdToNameMap:_0x400a29}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x144e62=_0x5d6374,[_0x498077,_0x3ea0b4]=await Promise['all']([_0x4fff45[_0x144e62(0x27a)][_0x144e62(0x247)](),_0x4fff45['connection']['buildIdToNameMap']()]);return{'idToEmailMap':_0x498077,'connectionIdToNameMap':_0x3ea0b4};},{'verbose':_0x1f0292[_0x5d6374(0x1f3)]})[_0x5d6374(0x2d7)](_0x2d33c4=>_0x2d33c4[_0x5d6374(0x2d6)]);for(const _0x3fcf18 of _0x14e68f[_0x5d6374(0x2b0)]()){const _0xabefad=_0x3fcf18[0x0]['journeyBundleName'],_0x347af7=_0x3fcf18[0x0][_0x5d6374(0x275)],_0x2ac4cc=_0x347af7?_0x53febc['get'](_0x347af7)||'':'',_0x115fe1=_0x2ac4cc?a27_0x22d4ef[_0x5d6374(0x206)](_0x59f9d0,_0x2ac4cc):_0x59f9d0,_0x4b8901=_0x33b7b2||a27_0x22d4ef['join'](_0x115fe1,sanitizeFileName(_0xabefad)+'.yml');let _0x480281,_0x63617f;if(existsSync(_0x4b8901))try{const _0x713363=readFileSync(_0x4b8901,_0x5d6374(0x298)),_0x101873=parseYamlString(_0x713363);_0x63617f=_0x101873,_0x480281=buildRuleToNameMapping(_0x101873),_0x3801fa[_0x5d6374(0x1f3)]&&_0x480281['size']>0x0&&console[_0x5d6374(0x205)](_0x5d6374(0x230)+_0x480281[_0x5d6374(0x1e5)]+_0x5d6374(0x2c9)+_0xabefad);}catch(_0xa51295){_0x3801fa[_0x5d6374(0x1f3)]&&console[_0x5d6374(0x205)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0xa51295[_0x5d6374(0x2a0)]);}const _0x5855f2=[],_0x3973bf=new Set(),_0x3ef724=new Map(),_0x2d595b=new Map(),_0x4d605a=new Set(),_0x3e462f=new Map(),_0x216435=new Map(),_0xb8aec4=createJumpTargetCache();await withProgressSpinner(_0x5d6374(0x213)+_0xabefad+_0x5d6374(0x240),async _0x129ca4=>{const _0x672b73=_0x5d6374;for(const _0x5d83c8 of _0x3fcf18){const _0x55ece8=_0x3fcf18['length']>0x1?_0x5d83c8[_0x672b73(0x225)]+'\x20v'+(_0x5d83c8['versionNumber']||0x1):_0x5d83c8[_0x672b73(0x225)];_0x129ca4['setPhase'](_0x672b73(0x213)+_0x55ece8);const _0xfa57ab=await _0x4fff45['journey'][_0x672b73(0x2b8)](_0x5d83c8['id']),_0x38e014=_0xfa57ab[_0x672b73(0x26f)]?.[_0x672b73(0x272)],_0x48498b={'resolveSegment':async _0x25aa71=>{const _0x3e1c72=_0x672b73;if(!_0x38e014)return{'name':_0x25aa71,'isJourneyLocal':![]};const _0xd68c30=_0x3ef724['get'](_0x25aa71);if(_0xd68c30)return _0xd68c30;try{const _0x51ed61=await _0x4fff45['segment'][_0x3e1c72(0x23e)](_0x38e014,_0x25aa71),_0x3f2d40=_0x51ed61[_0x3e1c72(0x23b)]===SEGMENT_KIND_JOURNEY;let _0x3d0b95,_0x54b484=_0x51ed61[_0x3e1c72(0x22c)];if(_0x3f2d40&&_0x51ed61[_0x3e1c72(0x267)]){const _0x223091=await segmentResponseToDef(_0x51ed61,{'resolveSegmentName':async _0x1f3f4c=>{const _0x11ad4c=_0x3e1c72,_0x459daf=_0x3ef724['get'](_0x1f3f4c);if(_0x459daf)return _0x459daf[_0x11ad4c(0x22c)];const _0xbb38e6=await _0x48498b[_0x11ad4c(0x21b)](_0x1f3f4c);return _0xbb38e6[_0x11ad4c(0x22c)];}}),_0x52d42b=_0x223091[_0x3e1c72(0x267)];_0x3d0b95={'description':_0x51ed61[_0x3e1c72(0x2ca)],'rule':_0x52d42b};const _0x546536=serializeRule(_0x52d42b),_0x408331=_0x2d595b[_0x3e1c72(0x260)](_0x546536);if(_0x408331)_0x54b484=_0x408331,_0x3d0b95=undefined,_0x3801fa[_0x3e1c72(0x1f3)]&&console['error'](_0x3e1c72(0x2c7)+_0x51ed61[_0x3e1c72(0x22c)]+_0x3e1c72(0x2a8)+_0x408331);else{let _0x407a0a=![];if(_0x480281){const _0x37baea=_0x480281['get'](_0x546536);if(_0x37baea){const _0x37cd8f=_0x37baea[_0x3e1c72(0x2d5)](_0x2ed012=>!_0x3973bf[_0x3e1c72(0x26e)](_0x2ed012));_0x37cd8f&&(_0x54b484=_0x37cd8f,_0x3973bf['add'](_0x37cd8f),_0x2d595b['set'](_0x546536,_0x37cd8f),_0x407a0a=!![],_0x3801fa['verbose']&&console['error'](_0x3e1c72(0x256)+_0x37cd8f+_0x3e1c72(0x1f2)));}}if(!_0x407a0a){const _0x1b90ce=generateJourneyLocalName(_0x51ed61['name']);_0x1b90ce&&(_0x54b484=_0x1b90ce);let _0x293ccc=_0x54b484,_0x1a8235=0x2;while(_0x3973bf[_0x3e1c72(0x26e)](_0x293ccc)){_0x293ccc=_0x54b484+'_'+_0x1a8235,_0x1a8235++;}_0x3973bf[_0x3e1c72(0x2a4)](_0x293ccc),_0x2d595b['set'](_0x546536,_0x293ccc),_0x54b484=_0x293ccc;}}}const _0x32023f={'name':_0x54b484,'isJourneyLocal':_0x3f2d40,'definition':_0x3d0b95};return _0x3ef724[_0x3e1c72(0x1f5)](_0x25aa71,_0x32023f),_0x32023f;}catch(_0x5d1f18){return _0x1f0292[_0x3e1c72(0x1f3)]&&console[_0x3e1c72(0x205)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x25aa71+':\x20'+_0x5d1f18[_0x3e1c72(0x2a0)]),{'name':_0x25aa71,'isJourneyLocal':![]};}},'resolveActivation':async _0xb2655c=>{const _0x3360ad=_0x672b73,_0x3fc0b3=_0x3e462f[_0x3360ad(0x260)](_0xb2655c);if(_0x3fc0b3)return _0x3fc0b3;try{const _0x471208=await _0x4fff45['journey']['getActivation'](_0x5d83c8['id'],_0xb2655c),_0x1a88e2=journeyActivationStepToYaml(_0x471208,_0x4b7e51,_0x400a29),_0x453573=JSON[_0x3360ad(0x26d)]({'name':_0x1a88e2['name'],'connection':_0x1a88e2['connection'],'connector_config':_0x1a88e2[_0x3360ad(0x2d9)]}),_0x1041aa=_0x216435[_0x3360ad(0x260)](_0x453573);if(_0x1041aa){const _0x1d568f={'name':_0x1041aa,'isJourneyLocal':!![],'definition':_0x1a88e2};return _0x3e462f[_0x3360ad(0x1f5)](_0xb2655c,_0x1d568f),_0x1d568f;}const _0x504660=_0x471208['attributes'][_0x3360ad(0x219)][_0x3360ad(0x22c)]||_0xb2655c,_0xdcfac8=sanitizeYamlKey(_0x504660)||'activation_'+_0xb2655c;let _0x3bdcdc=_0xdcfac8,_0x1aec4c=0x2;while(_0x4d605a[_0x3360ad(0x26e)](_0x3bdcdc)){_0x3bdcdc=_0xdcfac8+'_'+_0x1aec4c,_0x1aec4c++;}_0x4d605a[_0x3360ad(0x2a4)](_0x3bdcdc),_0x216435['set'](_0x453573,_0x3bdcdc);const _0x41123e={'name':_0x3bdcdc,'isJourneyLocal':!![],'definition':_0x1a88e2};return _0x3e462f[_0x3360ad(0x1f5)](_0xb2655c,_0x41123e),_0x41123e;}catch(_0x1b4021){return _0x1f0292[_0x3360ad(0x1f3)]&&console['error'](_0x3360ad(0x218)+_0xb2655c+':\x20'+_0x1b4021[_0x3360ad(0x2a0)]),{'name':_0xb2655c,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1d3b47,_0x39b56a)=>{return resolveJumpTarget(_0x1d3b47,_0x39b56a,_0xb8aec4,_0x529797=>_0x4fff45['journey']['getJourney'](_0x529797));}},_0x33e019=await journeyResponseToDef(_0xfa57ab,_0x48498b);_0x5855f2[_0x672b73(0x1fe)]({'item':_0x5d83c8,'yaml':_0x33e019});}},{'verbose':_0x1f0292['verbose']});const _0x56a86e=await _0x4fff45[_0x5d6374(0x281)][_0x5d6374(0x262)](_0x3fcf18[0x0][_0x5d6374(0x2ce)]),_0x19d6f8=buildMergedJourneyDef(_0x5855f2,_0x480281,_0x56a86e),_0x3d521a=normalizeJourneyDef(_0x19d6f8,_0x63617f),_0x19f68f=toYamlString(_0x3d521a),_0x574a7e=_0x33b7b2||a27_0x22d4ef['join'](_0x115fe1,sanitizeFileName(_0xabefad)+_0x5d6374(0x255));!_0x33b7b2&&_0x2ac4cc&&!existsSync(_0x115fe1)&&mkdirSync(_0x115fe1,{'recursive':!![]});const _0x129bb5=a27_0x22d4ef[_0x5d6374(0x23f)](process['cwd'](),_0x574a7e);if(existsSync(_0x574a7e)){const _0x31ddf1=readFileSync(_0x574a7e,_0x5d6374(0x298)),_0x156dcc=generateDiff(_0x31ddf1,_0x19f68f),_0x3c56c8=hasChanges(_0x156dcc);_0x52a7e7['push']({'relativePath':_0x129bb5,'absolutePath':_0x574a7e,'content':_0x19f68f,'isNew':![],'hasChanges':_0x3c56c8,'diff':_0x3c56c8?formatDiffWithColors(_0x156dcc):undefined});}else _0x52a7e7[_0x5d6374(0x1fe)]({'relativePath':_0x129bb5,'absolutePath':_0x574a7e,'content':_0x19f68f,'isNew':!![],'hasChanges':![]});}const _0x534b7c=_0x52a7e7['filter'](_0x19c649=>_0x19c649[_0x5d6374(0x201)]),_0x2e836c=_0x52a7e7['filter'](_0x293546=>!_0x293546[_0x5d6374(0x201)]&&_0x293546[_0x5d6374(0x1dd)]),_0x5bac79=_0x52a7e7[_0x5d6374(0x21e)](_0x2eb91f=>!_0x2eb91f['isNew']&&!_0x2eb91f['hasChanges']),_0x727672=_0x21283d[_0x5d6374(0x266)],_0x45afc9=_0x14e68f[_0x5d6374(0x1e5)],_0x1c22db=_0x727672>_0x45afc9?'\x20('+_0x727672+_0x5d6374(0x20b):'';console[_0x5d6374(0x205)](_0x5d6374(0x270)),console[_0x5d6374(0x205)]('\x20\x20'+a27_0xc564bb[_0x5d6374(0x20e)](_0x45afc9+_0x5d6374(0x209))+a27_0xc564bb[_0x5d6374(0x1e4)](_0x1c22db)),console[_0x5d6374(0x205)]('\x20\x20'+a27_0xc564bb['green']('+\x20'+_0x534b7c[_0x5d6374(0x266)]+_0x5d6374(0x290))),console[_0x5d6374(0x205)]('\x20\x20'+a27_0xc564bb['yellow']('~\x20'+_0x2e836c[_0x5d6374(0x266)]+_0x5d6374(0x1e2))),console[_0x5d6374(0x205)]('\x20\x20'+a27_0xc564bb[_0x5d6374(0x1e4)]('=\x20'+_0x5bac79['length']+'\x20unchanged\x20files')),console[_0x5d6374(0x205)]('\x20\x20Target:\x20'+a27_0xc564bb[_0x5d6374(0x20e)](_0x59f9d0)+'\x0a');if(_0x2e836c[_0x5d6374(0x266)]>0x0)for(const _0x43194b of _0x2e836c){console[_0x5d6374(0x205)](_0x5d6374(0x233)+_0x43194b[_0x5d6374(0x2d8)]+'\x27:'),console[_0x5d6374(0x205)]('─'[_0x5d6374(0x295)](0x3c)),console[_0x5d6374(0x205)](_0x43194b[_0x5d6374(0x250)]),console[_0x5d6374(0x205)]('─'[_0x5d6374(0x295)](0x3c));}if(_0x3801fa[_0x5d6374(0x2bc)])return console['error'](a27_0xc564bb['yellow'](_0x5d6374(0x1e3))),0x0;if(_0x534b7c[_0x5d6374(0x266)]===0x0&&_0x2e836c[_0x5d6374(0x266)]===0x0)return console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x284)](_0x5d6374(0x29b))),saveSessionContext({'parent_segment':_0x1615f0},_0x3801fa[_0x5d6374(0x231)]),console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x284)]('✔\x20Context\x20set:\x20'+a27_0xc564bb[_0x5d6374(0x1e4)](_0x5d6374(0x2d4))+_0x5d6374(0x1fb)+a27_0xc564bb['cyan'](_0x1615f0))),0x0;if(!_0x3801fa[_0x5d6374(0x22a)]&&(_0x534b7c[_0x5d6374(0x266)]>0x0||_0x2e836c[_0x5d6374(0x266)]>0x0)){if(!isInteractive())return console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x274)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5d6374(0x205)](a27_0xc564bb['dim'](_0x5d6374(0x29d))),0x1;const _0xd5a58c=await confirmKey(_0x5d6374(0x277)+(_0x534b7c[_0x5d6374(0x266)]+_0x2e836c[_0x5d6374(0x266)])+_0x5d6374(0x289));if(!_0xd5a58c)return console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x22f)](_0x5d6374(0x252)),_0x5d6374(0x28a)),0x1;}!existsSync(_0x59f9d0)&&mkdirSync(_0x59f9d0,{'recursive':!![]});const _0x4678a6=a27_0x22d4ef[_0x5d6374(0x206)](_0x59f9d0,'tdx.json');writeFileSync(_0x4678a6,createTdxConfigContent(_0x1615f0),_0x5d6374(0x298));for(const _0x3a621d of _0x52a7e7){(_0x3a621d[_0x5d6374(0x201)]||_0x3a621d[_0x5d6374(0x1dd)])&&writeFileSync(_0x3a621d[_0x5d6374(0x204)],_0x3a621d[_0x5d6374(0x2ac)],_0x5d6374(0x298));}return console[_0x5d6374(0x205)](a27_0xc564bb['green']('✔\x20Pulled\x20'+(_0x534b7c[_0x5d6374(0x266)]+_0x2e836c[_0x5d6374(0x266)])+_0x5d6374(0x1ef)+_0x59f9d0)),saveSessionContext({'parent_segment':_0x1615f0},_0x3801fa[_0x5d6374(0x231)]),console[_0x5d6374(0x205)](a27_0xc564bb[_0x5d6374(0x284)]('✔\x20Context\x20set:\x20'+a27_0xc564bb[_0x5d6374(0x1e4)]('parent_segment')+'\x20=\x20'+a27_0xc564bb[_0x5d6374(0x20e)](_0x1615f0))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x26a);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x285);async[a27_0x27b7a2(0x2aa)](_0x349dd3){const _0x720293=a27_0x27b7a2,{options:_0x82f2ef,args:_0x1c8fd2,tdx:_0x3f6ea9}=_0x349dd3,_0xbb5a2e=_0x1c8fd2[0x0];if(!requireNameOrPath(_0xbb5a2e))return 0x1;_0x82f2ef[_0x720293(0x1f3)]&&console[_0x720293(0x205)](_0x720293(0x27c)+_0xbb5a2e);const {journeyId:_0x5e5b5c}=await resolveJourneyIdFromInput(_0xbb5a2e,_0x82f2ef,_0x3f6ea9),_0x249225=await withSpinner(_0x720293(0x2db),()=>_0x3f6ea9[_0x720293(0x281)][_0x720293(0x226)](_0x5e5b5c),{'verbose':_0x82f2ef[_0x720293(0x1f3)]}),_0x2217e2=_0x249225[_0x720293(0x2d6)];return console[_0x720293(0x25e)](_0x720293(0x224)+_0x2217e2[_0x720293(0x246)]),console[_0x720293(0x25e)]('Table:\x20'+_0x2217e2[_0x720293(0x232)]),await handleSDKOutput(_0x2217e2[_0x720293(0x2c0)],_0x82f2ef),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x27b7a2(0x248);['description']=a27_0x27b7a2(0x296);async['execute'](_0x2847b){const _0x4d6afa=a27_0x27b7a2,{options:_0x4c9059,args:_0x1e89e7,tdx:_0x368dc2}=_0x2847b,_0x25c463=_0x1e89e7[0x0];if(!requireNameOrPath(_0x25c463))return 0x1;_0x4c9059['verbose']&&console['error']('Input:\x20'+_0x25c463);const {journeyId:_0x11bf33}=await resolveJourneyIdFromInput(_0x25c463,_0x4c9059,_0x368dc2),_0x3cc06b=await withSpinner('Listing\x20journey\x20activations...',()=>_0x368dc2[_0x4d6afa(0x281)]['listActivationsFlat'](_0x11bf33),{'verbose':_0x4c9059[_0x4d6afa(0x1f3)]}),_0x155908=_0x3cc06b[_0x4d6afa(0x2d6)];return console[_0x4d6afa(0x205)](_0x4d6afa(0x230)+_0x155908[_0x4d6afa(0x266)]+_0x4d6afa(0x1f0)+(_0x155908[_0x4d6afa(0x266)]!==0x1?'s':'')),await handleSDKOutput(_0x155908,_0x4c9059),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x227);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x238);[a27_0x27b7a2(0x1ea)]=new SegmentPushCommand();async[a27_0x27b7a2(0x2aa)](_0x245d14){const _0x4ffea0=a27_0x27b7a2,_0xb01bf5=_0x245d14[_0x4ffea0(0x2c6)][0x0];let _0x359c40;if(_0xb01bf5){const _0x4918e2=await resolveTarget({'arg':_0xb01bf5,'contextParent':_0x245d14[_0x4ffea0(0x2cc)][_0x4ffea0(0x1f6)],'cwd':process[_0x4ffea0(0x20f)]()});isSuccessfulResolution(_0x4918e2)&&_0x4918e2[_0x4ffea0(0x24d)]==='file'&&(_0x359c40=_0x4918e2[_0x4ffea0(0x214)]);}const _0x54d00e={..._0x245d14,'options':{..._0x245d14[_0x4ffea0(0x2cc)],'journeysOnly':!![],..._0x359c40&&{'singleFilePath':_0x359c40}}};return this[_0x4ffea0(0x1ea)][_0x4ffea0(0x2aa)](_0x54d00e);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]='journey:versions';['description']=a27_0x27b7a2(0x212);async[a27_0x27b7a2(0x2aa)](_0x43de71){const _0x1857ac=a27_0x27b7a2,{options:_0x3fb245,args:_0x4cc24f,tdx:_0x10b2ec}=_0x43de71,_0x41c763=_0x4cc24f[0x0];if(!requireNameOrPath(_0x41c763))return 0x1;if(_0x3fb245['verbose'])console['error']('Input:\x20'+_0x41c763);const {journeyId:_0x53a85b}=await resolveJourneyIdFromInput(_0x41c763,_0x3fb245,_0x10b2ec),_0x595be3=await withSpinner(_0x1857ac(0x28b),()=>_0x10b2ec[_0x1857ac(0x281)]['listVersions'](_0x53a85b),{'verbose':_0x3fb245[_0x1857ac(0x1f3)]}),{bundleName:_0x279e4b,versions:_0x2184ec,latestJourneyId:_0xfdb536}=_0x595be3[_0x1857ac(0x2d6)];console[_0x1857ac(0x205)](_0x279e4b+':\x20'+_0x2184ec[_0x1857ac(0x266)]+_0x1857ac(0x258)+(_0x2184ec[_0x1857ac(0x266)]!==0x1?'s':''));const _0x4e5ee2=_0x2184ec[_0x1857ac(0x237)](_0x18dd02=>({'version':_0x18dd02[_0x1857ac(0x239)],'journey_id':_0x18dd02['journeyId'],'name':_0x18dd02['name'],'state':_0x18dd02[_0x1857ac(0x2ab)],'paused':_0x18dd02[_0x1857ac(0x1f4)],'latest':_0x18dd02[_0x1857ac(0x1df)]===_0xfdb536,'created_at':_0x18dd02[_0x1857ac(0x200)]}));return await handleSDKOutput(_0x4e5ee2,_0x3fb245),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x28d);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x1e7);async['execute'](_0x7e243e){const _0xbc6ab4=a27_0x27b7a2,{options:_0x480571,args:_0x9cf0,tdx:_0x37f9ac}=_0x7e243e,_0x46ed3f=_0x9cf0[0x0];if(!requireNameOrPath(_0x46ed3f))return 0x1;if(_0x480571[_0xbc6ab4(0x1f3)])console[_0xbc6ab4(0x205)](_0xbc6ab4(0x27c)+_0x46ed3f);const {journeyId:_0x5492bf,journeyName:_0x1b24d5}=await resolveJourneyIdFromInput(_0x46ed3f,_0x480571,_0x37f9ac);if(!_0x480571['yes']){const _0x4faf1c=await confirm(_0xbc6ab4(0x23d)+_0x1b24d5+'\x22?');if(!_0x4faf1c)return console[_0xbc6ab4(0x205)](_0xbc6ab4(0x27e)),0x0;}const _0x440445=await withSpinner(_0xbc6ab4(0x28f),()=>_0x37f9ac[_0xbc6ab4(0x281)][_0xbc6ab4(0x27d)](_0x5492bf),{'verbose':_0x480571[_0xbc6ab4(0x1f3)]}),_0x125083=_0x440445['data'];return console['error'](a27_0xc564bb['green']('✔')+_0xbc6ab4(0x29a)+_0x125083['attributes']['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0x125083[_0xbc6ab4(0x26f)]['name']+'\x22'),console[_0xbc6ab4(0x205)](_0xbc6ab4(0x23c)+_0x125083['id']),await handleSingleObjectOutput({'id':_0x125083['id'],'name':_0x125083[_0xbc6ab4(0x26f)][_0xbc6ab4(0x22c)],'version':_0x125083[_0xbc6ab4(0x26f)][_0xbc6ab4(0x239)],'state':_0x125083[_0xbc6ab4(0x26f)]['state'],'bundle_id':_0x125083['attributes'][_0xbc6ab4(0x2ce)],'created_at':_0x125083['attributes'][_0xbc6ab4(0x200)]},_0x480571),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x27b7a2(0x22c)]=a27_0x27b7a2(0x253);[a27_0x27b7a2(0x2ca)]=a27_0x27b7a2(0x282);async[a27_0x27b7a2(0x2aa)](_0x11a847){const _0x207256=a27_0x27b7a2,{options:_0x2b8b08,args:_0x1bd400,tdx:_0x3da997}=_0x11a847,_0x535c4b=_0x1bd400[0x0];if(!requireNameOrPath(_0x535c4b))return 0x1;const _0x37a555=_0x2b8b08[_0x207256(0x263)];if(!_0x37a555)return console[_0x207256(0x205)](_0x207256(0x283)),console['error'](_0x207256(0x2b7)),0x1;const _0x1acf71=parseInt(_0x37a555,0xa);if(isNaN(_0x1acf71)||_0x1acf71<0x1)return console[_0x207256(0x205)](_0x207256(0x1f9)+_0x37a555),0x1;if(_0x2b8b08[_0x207256(0x1f3)])console[_0x207256(0x205)](_0x207256(0x27c)+_0x535c4b+',\x20version:\x20'+_0x1acf71);const {journeyId:_0x58122a,parentSegmentId:_0x5821a4}=await resolveJourneyIdFromInput(_0x535c4b,_0x2b8b08,_0x3da997),_0x189056=await withSpinner(_0x207256(0x2a6),()=>_0x3da997[_0x207256(0x281)]['listVersions'](_0x58122a),{'verbose':_0x2b8b08[_0x207256(0x1f3)]}),{versions:_0x342d9c,latestJourneyId:_0x46f2d9}=_0x189056[_0x207256(0x2d6)],_0x553dfe=_0x342d9c[_0x207256(0x2d5)](_0x1d1225=>_0x1d1225[_0x207256(0x239)]===_0x1acf71);if(!_0x553dfe){const _0xf41aca=_0x342d9c[_0x207256(0x237)](_0x3c3fa1=>'v'+_0x3c3fa1[_0x207256(0x239)])[_0x207256(0x206)](',\x20');return console[_0x207256(0x205)]('Error:\x20Version\x20'+_0x1acf71+_0x207256(0x2b6)+_0xf41aca),0x1;}const _0x1ef712=await withSpinner('Getting\x20version\x20'+_0x1acf71+_0x207256(0x26c),()=>_0x3da997[_0x207256(0x281)]['getJourney'](_0x553dfe[_0x207256(0x1df)]),{'verbose':_0x2b8b08[_0x207256(0x1f3)]}),_0x1cd3d8=_0x1ef712['data'],_0x14a649=getConsoleNextUrl(_0x2b8b08[_0x207256(0x1e0)],_0x207256(0x29f)+_0x5821a4+_0x207256(0x1dc)+_0x553dfe[_0x207256(0x1df)]+_0x207256(0x2d1));return await handleSingleObjectOutput({'id':_0x1cd3d8['id'],'name':_0x1cd3d8[_0x207256(0x26f)][_0x207256(0x22c)],'version':_0x1cd3d8[_0x207256(0x26f)]['versionNumber'],'description':_0x1cd3d8[_0x207256(0x26f)][_0x207256(0x2ca)],'state':_0x1cd3d8['attributes'][_0x207256(0x2ab)],'paused':_0x1cd3d8[_0x207256(0x26f)]['paused'],'reentry_mode':_0x1cd3d8[_0x207256(0x26f)]['reentryMode'],'stages':_0x1cd3d8[_0x207256(0x26f)]['journeyStages']?.['length']||0x0,..._0x1cd3d8[_0x207256(0x26f)]['goal']&&{'goal':_0x1cd3d8[_0x207256(0x26f)][_0x207256(0x22b)][_0x207256(0x22c)]},'latest':_0x553dfe['journeyId']===_0x46f2d9,'created_at':_0x1cd3d8[_0x207256(0x26f)][_0x207256(0x200)],'updated_at':_0x1cd3d8[_0x207256(0x26f)]['updatedAt'],'url':_0x14a649},_0x2b8b08),0x0;}}
|
|
1
|
+
const a27_0x5627fc=a27_0x43a0;(function(_0x52149c,_0x1b2ebc){const _0x3f357a=a27_0x43a0,_0x127300=_0x52149c();while(!![]){try{const _0x54f7e2=-parseInt(_0x3f357a(0xcd))/0x1*(parseInt(_0x3f357a(0x106))/0x2)+-parseInt(_0x3f357a(0x145))/0x3*(-parseInt(_0x3f357a(0x162))/0x4)+parseInt(_0x3f357a(0xd2))/0x5+parseInt(_0x3f357a(0x17b))/0x6+-parseInt(_0x3f357a(0x197))/0x7+-parseInt(_0x3f357a(0x13e))/0x8*(-parseInt(_0x3f357a(0x125))/0x9)+-parseInt(_0x3f357a(0xab))/0xa;if(_0x54f7e2===_0x1b2ebc)break;else _0x127300['push'](_0x127300['shift']());}catch(_0x567bbd){_0x127300['push'](_0x127300['shift']());}}}(a27_0xdeb3,0x9dab4));import a27_0x442aed from'chalk';import a27_0x26af62 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';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';function a27_0x43a0(_0x7338de,_0xae8de8){_0x7338de=_0x7338de-0x94;const _0xdeb320=a27_0xdeb3();let _0x43a0e1=_0xdeb320[_0x7338de];return _0x43a0e1;}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x5d51a9){const _0x2992e8=a27_0x43a0;return!_0x5d51a9&&(console[_0x2992e8(0x14e)](_0x2992e8(0x9a)),console[_0x2992e8(0x14e)](_0x2992e8(0xae))),!!_0x5d51a9;}function withJsonFormat(_0x1d2726){const _0x3cfe25=a27_0x43a0;if(!_0x1d2726[_0x3cfe25(0xc3)]&&!_0x1d2726['json']&&!_0x1d2726[_0x3cfe25(0x140)]&&!_0x1d2726[_0x3cfe25(0x151)])return{..._0x1d2726,'format':_0x3cfe25(0x164),'json':!![]};return _0x1d2726;}function formatJourneyState(_0x2bd2c6){const _0x2a7b24=a27_0x43a0;switch(_0x2bd2c6){case _0x2a7b24(0xf1):return a27_0x442aed[_0x2a7b24(0x175)](_0x2a7b24(0x160));case _0x2a7b24(0x154):return a27_0x442aed[_0x2a7b24(0xbd)]('(draft)');case _0x2a7b24(0x156):return a27_0x442aed[_0x2a7b24(0x144)](_0x2a7b24(0x174));case _0x2a7b24(0xb8):return a27_0x442aed[_0x2a7b24(0x19e)](_0x2a7b24(0xcf));case _0x2a7b24(0xd4):return a27_0x442aed[_0x2a7b24(0xbd)]('(archived)');default:return'('+_0x2bd2c6+')';}}function a27_0xdeb3(){const _0x529f93=['exitOrJumpSize','format','state','Show\x20journey\x20statistics','Error:\x20--version\x20option\x20is\x20required','journey:version:view','nodes','\x0aError:','get','push','file','9XBsPRV',',\x20version:\x20','(completed)','📁\x20','description','4420315QBudAh','milestoneSize','archived','has','links','Cancelled','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','createdAt','Listing\x20journeys...','values','Parent\x20segment:\x20','Options:','base','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','getLatestJourneyId','journeys','Fetching\x20','🗺️\x20','/j/da','rule','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','/app/ps/','filePath','listActivationsFlat','setPhase','session','Resolving\x20parent\x20segment...','segment','red','audienceId','enteredSize','launched','cyan','Getting\x20journey\x20details...','helpText','Folder\x20path:\x20','test','journey','Show\x20journey\x20details','find','Available\x20stages:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','user','✔\x20All\x20files\x20are\x20up\x20to\x20date','reentryMode','journeyBundleName','journeyBundleId','limit','listJourneysWithFolders','absolutePath','Resolved\x20YAML\x20file:\x20','Resolving\x20version...','91106aRucGl','targetDir','Show\x20journey\x20table\x20column\x20mapping','no_parent','journeyName','data','activation','\x20journey','/j/da/je','\x20(draft)\x20—\x20\x22','relative','journey:list','Table:\x20','\x5c$&','getSegment','length','log','Error:\x20Parent\x20segment\x20context\x20required','sort','\x20journeys','execute','getTrafficData','localeCompare','\x20files?','Error:\x20Invalid\x20--type\x20\x22','getStatistics','Fetching\x20journeys\x20and\x20folders...','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Listing\x20journey\x20activations...','Export\x20journey(s)\x20as\x20YAML\x20files','3852KKSQZn','stage','parentName','version','journey:stats','segmentName','Journey\x20name:\x20','List\x20activations\x20for\x20a\x20journey','\x20versions)','\x20\x20-\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','\x22\x20not\x20found','journey:pause','then','List\x20all\x20versions\x20of\x20a\x20journey','verbose','parent_segment','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','List\x20journeys\x20in\x20current\x20context','table','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)','relativePath','content','journeyId','hasChanges','20168zyDjtW','getColumnMapping','jsonl','...','type','root\x20folder','yellow','3qgjNqk','toLowerCase','Pattern:\x20','includeStats','map','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','entries','Found\x20','listVersions','error','bold','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','tsv','\x20\x20Consolidating\x20duplicate\x20segment:\x20','all','draft','resume','paused','errorCode','Pause\x20a\x20running\x20journey','\x20changed\x20files','attributes','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','utf-8','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','folderId','resolveParentId','(running)','journey:traffic','3557188QlyPMu','completionRate','json','Error:\x20Invalid\x20version\x20number:\x20','stringify','rootFolderId','Target\x20directory:\x20','journey:pull','listFolders','.yml','\x0aPull\x20summary:','\x20Opening\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','message','diff','\x20\x20Parent\x20segment:\x20','getParentFull','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','(paused)','green','✔\x20Context\x20set:\x20','buildIdToNameMap','yes','goal','name','2301792nVStaY','segments','Aborted.','\x22\x20paused','split','journey:push','Listing\x20journey\x20versions...','\x20not\x20found.\x20Available:\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:version:create','\x20version','\x20\x20Name:\x20','exitOrJumpRate','goalSize','View\x20a\x20specific\x20version\x20of\x20a\x20journey','/e/','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','replace','history','stages','join','\x20Created\x20v','Error:\x20Journey\x20not\x20found:\x20','isNew','activationParams','from','Fetching\x20users\x20and\x20connections...','201677Nrtlcu','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Creating\x20new\x20version...','resolveJourneyId','size','site','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','blue','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Input:\x20','connector_config','parentSegment','add','Target\x20file:\x20','set','getJourney','✔\x20Found\x20','updatedAt','listJourneysFromParentSegment','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20','filter','Getting\x20column\x20mapping...','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','journey:columns','resolveSegment','journeyStages','includeHistory','\x20new\x20files','Resolving\x20journey...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Write\x20','\x20details...','\x20\x20Target:\x20','versionNumber','folderPath','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20\x20Statistics\x20not\x20available','21513800XhjlsL','conversion','cwd','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','journey:resume','-\x20no\x20files\x20written','connection','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20=\x20','\x20\x20Journey\x20ID:\x20','hasPeriod','Getting\x20journey\x20statistics...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','completed','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','repeat','stageNameMap','resourceName','dim','✔\x20Journey\x20\x22','INVALID_ARGUMENT','tdx.json','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'];a27_0xdeb3=function(){return _0x529f93;};return a27_0xdeb3();}function formatJourneyItem(_0x32173e,_0x24500f='',_0x442257){const _0xe964d8=a27_0x43a0,_0x4895a1=formatJourneyState(_0x32173e[_0xe964d8(0xc4)]),_0x15121d=_0x442257?hyperlink(_0x32173e[_0xe964d8(0xff)],_0x442257):_0x32173e[_0xe964d8(0xff)];return _0x24500f+_0xe964d8(0xe3)+_0x15121d+'\x20'+_0x4895a1;}function escapeRegex(_0x27871c){const _0x2fc561=a27_0x43a0;return _0x27871c[_0x2fc561(0x18d)](/[.*+?^${}()|[\]\\]/g,_0x2fc561(0x113));}function globToRegex(_0x46924d){const _0x3935cd=a27_0x43a0,_0x2af9b5=_0x46924d[_0x3935cd(0x17f)]('*')[_0x3935cd(0x149)](escapeRegex);return new RegExp(_0x2af9b5[_0x3935cd(0x190)]('.*'),'i');}function buildRuleToNameMapping(_0x2d8f97){const _0x5c4dde=a27_0x43a0,_0x352b23=new Map();if(_0x2d8f97[_0x5c4dde(0x17c)])for(const [_0x3eccf3,_0x875692]of Object[_0x5c4dde(0x14b)](_0x2d8f97[_0x5c4dde(0x17c)])){if(_0x875692['rule']){const _0x481e15=serializeRule(_0x875692[_0x5c4dde(0xe5)]),_0x41e7c7=_0x352b23['get'](_0x481e15);_0x41e7c7?_0x41e7c7[_0x5c4dde(0xcb)](_0x3eccf3):_0x352b23[_0x5c4dde(0x1a5)](_0x481e15,[_0x3eccf3]);}}return _0x352b23;}async function resolveJourneyIdFromInput(_0x3f7f83,_0x3d738c,_0xdfd4fc){const _0x1bb6c5=a27_0x43a0,_0x3fde9f=await resolveJourneyTarget(_0x3f7f83,_0x3d738c['parentSegment'],_0x3d738c[_0x1bb6c5(0x134)]),_0x3aba88=_0x3fde9f[_0x1bb6c5(0x1a2)];if(!_0x3aba88)throw new SDKError(ErrorCode[_0x1bb6c5(0xbf)],_0x1bb6c5(0xa2));const _0x1fa23f=await withSpinner(_0x1bb6c5(0xec),()=>_0xdfd4fc['segment'][_0x1bb6c5(0x15f)](_0x3aba88),{'verbose':_0x3d738c[_0x1bb6c5(0x134)]}),_0x31da95=_0x1fa23f[_0x1bb6c5(0x10b)],_0xb05354=await withSpinner(_0x1bb6c5(0xa1),()=>_0xdfd4fc[_0x1bb6c5(0xf7)][_0x1bb6c5(0x19a)](_0x31da95,_0x3fde9f[_0x1bb6c5(0x10a)]),{'verbose':_0x3d738c[_0x1bb6c5(0x134)]});return{'journeyId':_0xb05354[_0x1bb6c5(0x10b)],'journeyName':_0x3fde9f[_0x1bb6c5(0x10a)],'parentSegmentId':_0x31da95};}async function resolveJourneyTarget(_0xed1084,_0x2d63b9,_0x37cffc){const _0x519f16=a27_0x43a0;if(isYamlFilePath(_0xed1084))try{const _0x2e68b4=await resolveYamlFilePath(_0xed1084);return _0x37cffc&&(console[_0x519f16(0x14e)](_0x519f16(0x104)+_0xed1084),console['error'](_0x519f16(0x171)+_0x2e68b4[_0x519f16(0x1a2)]),console['error'](_0x519f16(0x186)+_0x2e68b4[_0x519f16(0x12a)]),console[_0x519f16(0x14e)]('\x20\x20Folder\x20path:\x20'+(_0x2e68b4[_0x519f16(0xa8)]||'(root)'))),{'journeyName':_0x2e68b4[_0x519f16(0x12a)],'parentSegment':_0x2e68b4[_0x519f16(0x1a2)],'resolved':_0x2e68b4};}catch(_0x2e10ca){throw new SDKError(ErrorCode[_0x519f16(0xbf)],_0x519f16(0xc1)+_0x2e10ca[_0x519f16(0x16f)]);}if(!_0x2d63b9)throw new SDKError(ErrorCode[_0x519f16(0xbf)],_0x519f16(0x96));return{'journeyName':_0xed1084,'parentSegment':_0x2d63b9};}export class JourneyListCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x111);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x137);async['execute'](_0x1a87cd){const _0x23e7f9=a27_0x5627fc,{options:_0x23c1be,args:_0x4228a4,tdx:_0x27e7a5}=_0x1a87cd,_0x4a764c=_0x4228a4[0x0],_0x284307=_0x23c1be['parentSegment'];if(!_0x284307)return console[_0x23e7f9(0x14e)](_0x23e7f9(0x117)),console[_0x23e7f9(0x14e)](_0x23e7f9(0xb7)),0x1;const _0x2f63cd=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x27e7a5[_0x23e7f9(0xed)][_0x23e7f9(0x15f)](_0x284307),{'verbose':_0x23c1be[_0x23e7f9(0x134)]}),_0x9db5ca=_0x2f63cd[_0x23e7f9(0x10b)];_0x23c1be[_0x23e7f9(0x134)]&&(console[_0x23e7f9(0x14e)](_0x23e7f9(0xdc)+_0x284307+'\x20(ID:\x20'+_0x9db5ca+')'),_0x4a764c&&console[_0x23e7f9(0x14e)](_0x23e7f9(0x147)+_0x4a764c));const _0x366b46=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x27e7a5[_0x23e7f9(0xed)][_0x23e7f9(0x172)](_0x9db5ca),{'verbose':_0x23c1be[_0x23e7f9(0x134)]}),_0x4e2dc3=_0x366b46['data'],_0x1ce778=_0x4e2dc3[_0x23e7f9(0x167)],_0x3eb3d3=await withSpinner(_0x23e7f9(0xda),()=>_0x27e7a5[_0x23e7f9(0xf7)][_0x23e7f9(0x102)](_0x9db5ca,_0x1ce778),{'verbose':_0x23c1be[_0x23e7f9(0x134)]});let _0x375a99=_0x3eb3d3['data'][_0x23e7f9(0xe1)];const _0x4e12be=_0x3eb3d3['data']['folders'],_0x4b755c=new Map();for(const _0x1c0365 of _0x4e12be){_0x4b755c[_0x23e7f9(0x1a5)](_0x1c0365['id'],_0x1c0365[_0x23e7f9(0x17a)]);}if(_0x4a764c){const _0x29f5c7=globToRegex(_0x4a764c);_0x375a99=_0x375a99[_0x23e7f9(0x98)](_0x269606=>_0x29f5c7[_0x23e7f9(0xf6)](_0x269606[_0x23e7f9(0xff)]));}console['error'](_0x23e7f9(0x1a7)+_0x375a99['length']+_0x23e7f9(0x10d)+(_0x375a99[_0x23e7f9(0x115)]!==0x1?'s':''));const _0x383aa7=_0x37b9e7=>{const _0x3339ac=_0x23e7f9;return getConsoleNextUrl(_0x23c1be[_0x3339ac(0x19c)],_0x3339ac(0xe7)+_0x9db5ca+_0x3339ac(0x18a)+_0x37b9e7+_0x3339ac(0xe4));};if(_0x23c1be['format']===_0x23e7f9(0x138))await handleSDKOutput(_0x375a99,_0x23c1be);else{if(_0x23c1be['format']===_0x23e7f9(0x164)){const _0x553334=_0x375a99[_0x23e7f9(0x149)](_0x3ec652=>({..._0x3ec652,'url':_0x383aa7(_0x3ec652['id'])}));await handleSDKOutput(_0x553334,_0x23c1be);}else{console[_0x23e7f9(0x116)]('['+_0x284307+']');const _0x5f5afa=new Map(),_0x2b47b0=[];for(const _0x5ad893 of _0x375a99){if(!_0x5ad893[_0x23e7f9(0x15e)]||_0x5ad893[_0x23e7f9(0x15e)]===_0x1ce778)_0x2b47b0[_0x23e7f9(0xcb)](_0x5ad893);else{const _0x535a54=_0x5f5afa[_0x23e7f9(0xca)](_0x5ad893[_0x23e7f9(0x15e)])||[];_0x535a54[_0x23e7f9(0xcb)](_0x5ad893),_0x5f5afa['set'](_0x5ad893['folderId'],_0x535a54);}}const _0x293c11=(_0x2335de,_0x481b2a)=>_0x2335de[_0x23e7f9(0xff)][_0x23e7f9(0x11c)](_0x481b2a[_0x23e7f9(0xff)],undefined,{'sensitivity':_0x23e7f9(0xde)});_0x2b47b0['sort'](_0x293c11);for(const _0x5224d2 of _0x2b47b0){console[_0x23e7f9(0x116)](formatJourneyItem(_0x5224d2,'',_0x383aa7(_0x5224d2['id'])));}const _0x362a4d=[..._0x5f5afa['entries']()]['sort']((_0x5a6135,_0xd8b3f7)=>{const _0x7f2f73=_0x23e7f9,_0x344519=_0x4b755c[_0x7f2f73(0xca)](_0x5a6135[0x0])||_0x5a6135[0x0],_0x47df8c=_0x4b755c['get'](_0xd8b3f7[0x0])||_0xd8b3f7[0x0];return _0x344519[_0x7f2f73(0x11c)](_0x47df8c,undefined,{'sensitivity':'base'});});for(const [_0x7e27f6,_0x58907d]of _0x362a4d){const _0x15e535=_0x4b755c[_0x23e7f9(0xca)](_0x7e27f6)||_0x7e27f6;console['log'](_0x23e7f9(0xd0)+_0x15e535),_0x58907d[_0x23e7f9(0x118)](_0x293c11);for(const _0x2cb356 of _0x58907d){console[_0x23e7f9(0x116)](formatJourneyItem(_0x2cb356,'\x20\x20',_0x383aa7(_0x2cb356['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:view';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xf8);async[a27_0x5627fc(0x11a)](_0x40362a){const _0x5b5ba0=a27_0x5627fc,{options:_0x54a855,args:_0x57388d,tdx:_0x5c14d4}=_0x40362a,_0x5b6dc2=_0x57388d[0x0];if(!_0x5b6dc2)return console[_0x5b5ba0(0x14e)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5b5ba0(0x14e)](_0x5b5ba0(0x136)),console['error'](_0x5b5ba0(0xdd)),console[_0x5b5ba0(0x14e)](_0x5b5ba0(0x173)),0x1;_0x54a855[_0x5b5ba0(0x134)]&&console['error'](_0x5b5ba0(0x1a0)+_0x5b6dc2);const {journeyId:_0x153d8f,parentSegmentId:_0x1dd807}=await resolveJourneyIdFromInput(_0x5b6dc2,_0x54a855,_0x5c14d4);if(_0x54a855['web']){const _0x3ad213=getConsoleNextUrl(_0x54a855[_0x5b5ba0(0x19c)],_0x5b5ba0(0xe7)+_0x1dd807+_0x5b5ba0(0x18a)+_0x153d8f+'/j/da/je');return console[_0x5b5ba0(0x14e)](a27_0x442aed[_0x5b5ba0(0x175)]('✔')+_0x5b5ba0(0x16d)+a27_0x442aed[_0x5b5ba0(0xf2)](_0x3ad213)),openBrowser(_0x3ad213),0x0;}const _0x39362a=await withSpinner(_0x5b5ba0(0xf3),()=>_0x5c14d4['journey']['getJourney'](_0x153d8f),{'verbose':_0x54a855[_0x5b5ba0(0x134)]}),_0x16a52c=_0x39362a[_0x5b5ba0(0x10b)],_0x2d2937=_0x54a855[_0x5b5ba0(0x148)];let _0x164bef;if(_0x2d2937)try{const _0x294313=await withSpinner(_0x5b5ba0(0xb6),()=>_0x5c14d4['journey'][_0x5b5ba0(0x11f)](_0x153d8f),{'verbose':_0x54a855[_0x5b5ba0(0x134)]});_0x164bef=_0x294313[_0x5b5ba0(0x10b)];}catch{_0x54a855[_0x5b5ba0(0x134)]&&console[_0x5b5ba0(0x14e)](_0x5b5ba0(0xaa));}const _0x57d3d7=getConsoleNextUrl(_0x54a855[_0x5b5ba0(0x19c)],'/app/ps/'+_0x1dd807+_0x5b5ba0(0x18a)+_0x153d8f+_0x5b5ba0(0x10e)),_0x41ebb8={'id':_0x16a52c['id'],'name':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x17a)],'description':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xd1)],'state':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xc4)],'paused':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x156)],'reentry_mode':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xfe)],'stages':_0x16a52c[_0x5b5ba0(0x15a)]['journeyStages']?.[_0x5b5ba0(0x115)]||0x0,..._0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x179)]&&{'goal':_0x16a52c[_0x5b5ba0(0x15a)]['goal']['name']},..._0x164bef&&{'statistics':{'size':_0x164bef[_0x5b5ba0(0x19b)],'entered':_0x164bef[_0x5b5ba0(0xf0)],'goal_achieved':_0x164bef[_0x5b5ba0(0x188)],'completion_rate':_0x164bef[_0x5b5ba0(0x163)],'exit_or_jump':_0x164bef[_0x5b5ba0(0xc2)],'exit_or_jump_rate':_0x164bef[_0x5b5ba0(0x187)],'stages':_0x164bef['stages']}},'url':_0x57d3d7};return await handleSingleObjectOutput(_0x41ebb8,_0x54a855),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x129);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xc5);async['execute'](_0x4a4159){const _0x373a1c=a27_0x5627fc,{options:_0x389b2a,args:_0x4df103,tdx:_0x5da45b}=_0x4a4159,_0x17cb7f=_0x4df103[0x0];if(!requireNameOrPath(_0x17cb7f))return 0x1;_0x389b2a[_0x373a1c(0x134)]&&console[_0x373a1c(0x14e)](_0x373a1c(0x1a0)+_0x17cb7f);const _0x2b44f6=_0x389b2a,_0x2a10d7=_0x2b44f6[_0x373a1c(0x195)],_0x18e93c=_0x2b44f6['to'],_0x4b7b52=_0x2b44f6[_0x373a1c(0x9f)],_0x498b41=_0x2b44f6[_0x373a1c(0x126)];_0x4b7b52&&!_0x2a10d7&&!_0x18e93c&&console['error'](_0x373a1c(0x121));const _0x4baa8f=_0x4b7b52?withJsonFormat(_0x389b2a):_0x389b2a,{journeyId:_0x3d9782,journeyName:_0x121c20}=await resolveJourneyIdFromInput(_0x17cb7f,_0x4baa8f,_0x5da45b),_0x5ca777=_0x2a10d7||_0x18e93c?{'from':_0x2a10d7,'to':_0x18e93c}:undefined,_0x48ee78=await withSpinner(_0x373a1c(0xb6),()=>Promise[_0x373a1c(0x153)]([_0x5da45b[_0x373a1c(0xf7)][_0x373a1c(0x1a6)](_0x3d9782),_0x5da45b[_0x373a1c(0xf7)][_0x373a1c(0x11f)](_0x3d9782,_0x5ca777)]),{'verbose':_0x4baa8f['verbose']}),[_0x130b78,_0x1da74b]=_0x48ee78[_0x373a1c(0x10b)];if(!_0x1da74b||_0x1da74b[_0x373a1c(0x13c)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x121c20),console[_0x373a1c(0x14e)](_0x373a1c(0xdf)),0x0;const _0x18b72b=buildStageNameMap(_0x130b78),_0x5a1094=!!(_0x5ca777&&_0x1da74b[_0x373a1c(0x18e)]?.['length']),_0x37dbaa={'stageNameMap':_0x18b72b,'hasPeriod':_0x5a1094,'includeHistory':!!_0x4b7b52};if(_0x498b41&&_0x1da74b[_0x373a1c(0x18f)]){const _0x10044f=_0x1da74b[_0x373a1c(0x18f)][_0x373a1c(0xf9)](_0x19276e=>{const _0x2ecdc3=_0x373a1c,_0x23bfab=_0x18b72b['get'](_0x19276e['id'])??'';return _0x23bfab[_0x2ecdc3(0x146)]()===_0x498b41[_0x2ecdc3(0x146)]();});if(_0x10044f)return await handleSingleObjectOutput(formatStageStats(_0x10044f,_0x37dbaa),_0x4baa8f),0x0;const _0x146734=_0x1da74b['stages']['map'](_0x4011ca=>_0x18b72b[_0x373a1c(0xca)](_0x4011ca['id'])??_0x4011ca['id']);return console[_0x373a1c(0x14e)]('Error:\x20Stage\x20\x22'+_0x498b41+_0x373a1c(0x130)),console[_0x373a1c(0x14e)](_0x373a1c(0xfa)+_0x146734[_0x373a1c(0x190)](',\x20')),0x1;}const _0x3f2761=_0x1da74b['stages']?.[_0x373a1c(0x149)](_0x2339da=>formatStageStats(_0x2339da,_0x37dbaa)),_0x5ee15e=assembleJourneyStats(_0x1da74b,{'from':_0x2a10d7,'to':_0x18e93c,'includeHistory':_0x4b7b52});return await this['renderStats'](_0x5ee15e,_0x3f2761??[],_0x4baa8f),0x0;}async['renderStats'](_0x310413,_0x391da5,_0x474066){const _0x354225=a27_0x5627fc,_0x1c92ea=_0x474066[_0x354225(0xc3)]==='json'||_0x474066[_0x354225(0xc3)]==='jsonl'||_0x474066['json']||_0x474066[_0x354225(0x140)];if(_0x1c92ea){_0x310413[_0x354225(0x18f)]=_0x391da5,await handleSingleObjectOutput(_0x310413,_0x474066);return;}await handleSingleObjectOutput(_0x310413,_0x474066);for(const _0x15727b of _0x391da5){console[_0x354225(0x116)](''),console[_0x354225(0x116)](String(a27_0x442aed[_0x354225(0xf2)][_0x354225(0x14f)]('['+_0x15727b[_0x354225(0x17a)]+']'))+a27_0x442aed[_0x354225(0xbd)]('\x20'+_0x15727b['id']));const {id:_0xd8f077,name:_0x51d5b4,..._0x441d13}=_0x15727b;await handleSingleObjectOutput(_0x441d13,_0x474066);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x161);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x15b);async['execute'](_0x30b6fe){const _0x38e2fe=a27_0x5627fc,{options:_0x14bed1,args:_0x54a264,tdx:_0x466e23}=_0x30b6fe,_0x3d2d7a=_0x54a264[0x0];if(!requireNameOrPath(_0x3d2d7a))return 0x1;_0x14bed1[_0x38e2fe(0x134)]&&console['error'](_0x38e2fe(0x1a0)+_0x3d2d7a);const _0x1ff9b7=_0x14bed1,_0x12df21=_0x1ff9b7[_0x38e2fe(0x142)],_0x416196=_0x1ff9b7['from'],_0x5cd6c7=_0x1ff9b7['to'],_0x184b96=_0x1ff9b7[_0x38e2fe(0x101)];if(_0x12df21&&_0x12df21!==_0x38e2fe(0xac)&&_0x12df21!==_0x38e2fe(0x10c))return console[_0x38e2fe(0x14e)](_0x38e2fe(0x11e)+_0x12df21+_0x38e2fe(0x18b)),0x1;const _0x243032=withJsonFormat(_0x14bed1),{journeyId:_0x18843b,journeyName:_0x1c37ad}=await resolveJourneyIdFromInput(_0x3d2d7a,_0x243032,_0x466e23),_0x35f9b3={'type':_0x12df21,'from':_0x416196,'to':_0x5cd6c7,'limit':_0x184b96},_0x3e31f9=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x466e23[_0x38e2fe(0xf7)][_0x38e2fe(0x11b)](_0x18843b,_0x35f9b3),{'verbose':_0x243032['verbose']}),_0x14ba06=_0x3e31f9[_0x38e2fe(0x10b)],_0x163598=_0x14ba06[_0x38e2fe(0xac)]&&(_0x14ba06[_0x38e2fe(0xac)][_0x38e2fe(0xc8)]['length']>0x0||_0x14ba06[_0x38e2fe(0xac)][_0x38e2fe(0xd6)][_0x38e2fe(0x115)]>0x0),_0x48e3d4=_0x14ba06[_0x38e2fe(0x10c)]&&_0x14ba06[_0x38e2fe(0x10c)][_0x38e2fe(0x115)]>0x0;if(!_0x163598&&!_0x48e3d4)return console[_0x38e2fe(0x14e)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x1c37ad),console[_0x38e2fe(0x14e)](_0x38e2fe(0x19f)),_0x416196&&_0x5cd6c7&&console['error'](_0x38e2fe(0xe6)),0x0;return await handleSingleObjectOutput(_0x14ba06,_0x243032),0x0;}}function formatStageStats(_0x4b0ae7,_0xfc60b){const _0x30f579=a27_0x5627fc,_0x277dbd=_0xfc60b['hasPeriod']&&_0x4b0ae7[_0x30f579(0x18e)]?.[_0x30f579(0x115)]?aggregateStageHistory(_0x4b0ae7[_0x30f579(0x18e)]):{'size':_0x4b0ae7[_0x30f579(0x19b)],'entered':_0x4b0ae7['enteredSize'],'milestone':_0x4b0ae7[_0x30f579(0xd3)],'milestone_rate':_0x4b0ae7['completeMilestoneRate'],'exit_or_jump':_0x4b0ae7['exitOrJumpSize'],'exit_or_jump_rate':_0x4b0ae7['exitOrJumpRate']},_0xd007df={'id':_0x4b0ae7['id'],'name':_0xfc60b[_0x30f579(0xbb)][_0x30f579(0xca)](_0x4b0ae7['id'])??_0x4b0ae7['id'],..._0x277dbd};return _0xfc60b[_0x30f579(0xb5)]&&_0xfc60b[_0x30f579(0x9f)]&&_0x4b0ae7['history']&&(_0xd007df[_0x30f579(0x18e)]=_0x4b0ae7['history']),_0xd007df;}export class JourneyPauseCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x131);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x158);async[a27_0x5627fc(0x11a)](_0x47c3da){const _0x186e38=a27_0x5627fc,{options:_0x3822e1,args:_0x1733d8,tdx:_0x18e35c}=_0x47c3da,_0x29a9f2=_0x1733d8[0x0];if(!requireNameOrPath(_0x29a9f2))return 0x1;_0x3822e1['verbose']&&console['error']('Input:\x20'+_0x29a9f2);const {journeyId:_0x4ce76b,journeyName:_0x147357}=await resolveJourneyIdFromInput(_0x29a9f2,_0x3822e1,_0x18e35c);if(!_0x3822e1[_0x186e38(0x178)]){const _0x52e4b4=await confirm(_0x186e38(0x18c)+_0x147357+'\x22?');if(!_0x52e4b4)return console[_0x186e38(0x14e)](_0x186e38(0xd7)),0x0;}const _0x8ba66b=await withSpinner('Pausing\x20journey...',()=>_0x18e35c[_0x186e38(0xf7)]['pause'](_0x4ce76b),{'verbose':_0x3822e1[_0x186e38(0x134)]}),_0x215b66=_0x8ba66b[_0x186e38(0x10b)];return console[_0x186e38(0x14e)]('✔\x20Journey\x20\x22'+_0x215b66[_0x186e38(0x15a)][_0x186e38(0x17a)]+_0x186e38(0x17e)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x5627fc(0xaf);[a27_0x5627fc(0xd1)]='Resume\x20a\x20paused\x20journey';async[a27_0x5627fc(0x11a)](_0x1f5f73){const _0x8fa0e1=a27_0x5627fc,{options:_0x4c7daf,args:_0x736758,tdx:_0x33ccc0}=_0x1f5f73,_0x36923d=_0x736758[0x0];if(!requireNameOrPath(_0x36923d))return 0x1;_0x4c7daf[_0x8fa0e1(0x134)]&&console[_0x8fa0e1(0x14e)](_0x8fa0e1(0x1a0)+_0x36923d);const {journeyId:_0x85affd,journeyName:_0x1bbead}=await resolveJourneyIdFromInput(_0x36923d,_0x4c7daf,_0x33ccc0);if(!_0x4c7daf[_0x8fa0e1(0x178)]){const _0x410041=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x1bbead+'\x22?');if(!_0x410041)return console[_0x8fa0e1(0x14e)](_0x8fa0e1(0xd7)),0x0;}const _0xf12157=await withSpinner('Resuming\x20journey...',()=>_0x33ccc0[_0x8fa0e1(0xf7)][_0x8fa0e1(0x155)](_0x85affd),{'verbose':_0x4c7daf[_0x8fa0e1(0x134)]}),_0x23d535=_0xf12157[_0x8fa0e1(0x10b)];return console[_0x8fa0e1(0x14e)](_0x8fa0e1(0xbe)+_0x23d535['attributes'][_0x8fa0e1(0x17a)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x169);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x124);async[a27_0x5627fc(0x11a)](_0x1f3898){const _0x2b134d=a27_0x5627fc,{options:_0x2474ea,args:_0x5add57,tdx:_0xd533ec}=_0x1f3898,_0x22c7fd=_0x2474ea,_0x3efbb7=_0x5add57[0x0],_0x41d986=_0x3efbb7&&isYamlFilePath(_0x3efbb7),_0x1109b7=await resolveTarget({'arg':_0x41d986?_0x3efbb7:undefined,'contextParent':_0x2474ea[_0x2b134d(0x1a2)],'cwd':process[_0x2b134d(0xad)]()});if(!isSuccessfulResolution(_0x1109b7))return _0x1109b7[_0x2b134d(0x157)]===_0x2b134d(0x109)?(console['error'](a27_0x442aed[_0x2b134d(0x144)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x2b134d(0x139)),console[_0x2b134d(0x14e)](_0x2b134d(0x12f)),console[_0x2b134d(0x14e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console['error'](_0x2b134d(0x19d))):(console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0xee)](_0x2b134d(0x97)+_0x1109b7[_0x2b134d(0x16f)]+'\x0a')),_0x1109b7[_0x2b134d(0xf4)]&&console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0xf2)](_0x1109b7['helpText']))),0x1;let _0x5a5dd0=_0x41d986?undefined:_0x3efbb7,_0x577286,_0x1effdf;_0x1109b7['type']===_0x2b134d(0xcc)&&(_0x5a5dd0=_0x1109b7[_0x2b134d(0xbc)],_0x577286=_0x1109b7[_0x2b134d(0xe8)],_0x1effdf=_0x1109b7['folderPath']);const _0x36585b=_0x1109b7[_0x2b134d(0x127)],_0x36dc93=_0x1109b7[_0x2b134d(0x107)];_0x22c7fd[_0x2b134d(0x134)]&&(console[_0x2b134d(0x14e)]('Parent\x20segment:\x20'+_0x36585b),console[_0x2b134d(0x14e)](_0x2b134d(0x168)+_0x36dc93),_0x5a5dd0&&console[_0x2b134d(0x14e)](_0x2b134d(0x12b)+_0x5a5dd0),_0x577286&&console[_0x2b134d(0x14e)](_0x2b134d(0x1a4)+_0x577286),_0x1effdf&&console['error'](_0x2b134d(0xf5)+_0x1effdf));const _0xcb396d=await withSpinner(_0x2b134d(0xec),()=>_0xd533ec['segment'][_0x2b134d(0x15f)](_0x36585b),{'verbose':_0x2474ea[_0x2b134d(0x134)]}),_0x30fdcb=_0xcb396d[_0x2b134d(0x10b)],{journeys:_0x443f92,folders:_0x5ebf1d}=await withSpinner(_0x2b134d(0x120),async()=>{const _0x273e79=_0x2b134d,[_0x4d8d15,_0x1b675f]=await Promise[_0x273e79(0x153)]([_0xd533ec[_0x273e79(0xf7)][_0x273e79(0x95)](_0x30fdcb,undefined,{'includeAllVersions':!![]}),_0xd533ec[_0x273e79(0xed)][_0x273e79(0x16a)](_0x30fdcb)]);return{'journeys':_0x4d8d15,'folders':_0x1b675f};},{'verbose':_0x2474ea['verbose']})[_0x2b134d(0x132)](_0x3134cd=>_0x3134cd['data']);let _0x2ac801=_0x443f92;const _0x5671ac=buildFolderIdToPathMap(_0x5ebf1d);if(_0x5a5dd0){const _0x22cdc0=_0x2ac801[_0x2b134d(0x98)](_0x1ae8fc=>_0x1ae8fc['journeyBundleName'][_0x2b134d(0x146)]()===_0x5a5dd0[_0x2b134d(0x146)]());if(_0x22cdc0[_0x2b134d(0x115)]===0x0)return console[_0x2b134d(0x14e)](_0x2b134d(0x192)+_0x5a5dd0),console['error'](_0x2b134d(0x9b)),0x1;_0x2ac801=_0x22cdc0;}if(_0x1effdf!==undefined){const _0x41bd14=_0x2ac801[_0x2b134d(0x98)](_0x2f4976=>{const _0x56543e=_0x2b134d,_0x2c6c76=_0x2f4976[_0x56543e(0x15e)]?_0x5671ac['get'](_0x2f4976[_0x56543e(0x15e)])||'':'';return _0x2c6c76===_0x1effdf;});if(_0x41bd14[_0x2b134d(0x115)]===0x0&&_0x2ac801['length']>0x0){console[_0x2b134d(0x14e)]('Error:\x20Journey\x20\x27'+_0x5a5dd0+'\x27\x20not\x20found\x20in\x20'+(_0x1effdf||_0x2b134d(0x143))),console[_0x2b134d(0x14e)](_0x2b134d(0x16e));for(const _0x514c72 of _0x2ac801){const _0xeaac40=_0x514c72[_0x2b134d(0x15e)]?_0x5671ac[_0x2b134d(0xca)](_0x514c72[_0x2b134d(0x15e)])||'':'';console[_0x2b134d(0x14e)](_0x2b134d(0x12e)+(_0xeaac40||'(root)')+'/'+_0x514c72[_0x2b134d(0xff)]);}return 0x1;}_0x2ac801=_0x41bd14;}if(_0x2ac801[_0x2b134d(0x115)]===0x0)return console[_0x2b134d(0x14e)]('No\x20journeys\x20found'),0x0;const _0x57f78a=new Map();for(const _0x1db39d of _0x2ac801){const _0x11b13f=_0x1db39d[_0x2b134d(0x100)];!_0x57f78a[_0x2b134d(0xd5)](_0x11b13f)&&_0x57f78a[_0x2b134d(0x1a5)](_0x11b13f,[]),_0x57f78a[_0x2b134d(0xca)](_0x11b13f)[_0x2b134d(0xcb)](_0x1db39d);}for(const _0x1cd84c of _0x57f78a[_0x2b134d(0xdb)]()){_0x1cd84c[_0x2b134d(0x118)]((_0x19c54b,_0x2888c0)=>(_0x19c54b[_0x2b134d(0xa7)]||0x0)-(_0x2888c0['versionNumber']||0x0));}const _0x21a371=[],{idToEmailMap:_0x219abe,connectionIdToNameMap:_0x53b4f5}=await withSpinner(_0x2b134d(0x196),async()=>{const _0x369aa0=_0x2b134d,[_0x28138b,_0x44184a]=await Promise[_0x369aa0(0x153)]([_0xd533ec[_0x369aa0(0xfc)]['buildIdToEmailMap'](),_0xd533ec[_0x369aa0(0xb1)][_0x369aa0(0x177)]()]);return{'idToEmailMap':_0x28138b,'connectionIdToNameMap':_0x44184a};},{'verbose':_0x2474ea[_0x2b134d(0x134)]})[_0x2b134d(0x132)](_0x48fb75=>_0x48fb75[_0x2b134d(0x10b)]);for(const _0x4a2125 of _0x57f78a['values']()){const _0x47cdc8=_0x4a2125[0x0][_0x2b134d(0xff)],_0x1c5998=_0x4a2125[0x0][_0x2b134d(0x15e)],_0x22fb95=_0x1c5998?_0x5671ac[_0x2b134d(0xca)](_0x1c5998)||'':'',_0x286516=_0x22fb95?a27_0x26af62[_0x2b134d(0x190)](_0x36dc93,_0x22fb95):_0x36dc93,_0x3a9ebd=_0x577286||a27_0x26af62[_0x2b134d(0x190)](_0x286516,sanitizeFileName(_0x47cdc8)+'.yml');let _0x390385,_0xfecf52;if(existsSync(_0x3a9ebd))try{const _0x1eff73=readFileSync(_0x3a9ebd,'utf-8'),_0x455955=parseYamlString(_0x1eff73);_0xfecf52=_0x455955,_0x390385=buildRuleToNameMapping(_0x455955),_0x22c7fd[_0x2b134d(0x134)]&&_0x390385[_0x2b134d(0x19b)]>0x0&&console[_0x2b134d(0x14e)](_0x2b134d(0x14c)+_0x390385['size']+_0x2b134d(0xb2)+_0x47cdc8);}catch(_0x5cb9ac){_0x22c7fd[_0x2b134d(0x134)]&&console[_0x2b134d(0x14e)](_0x2b134d(0x183)+_0x5cb9ac['message']);}const _0x161709=[],_0xc3cb9e=new Set(),_0x2e5279=new Map(),_0x280405=new Map(),_0xb09e83=new Set(),_0x539f9d=new Map(),_0x30e872=new Map(),_0x581ded=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x47cdc8+_0x2b134d(0x141),async _0x163581=>{const _0x56e6ef=_0x2b134d;for(const _0x26203b of _0x4a2125){const _0x41bd7b=_0x4a2125[_0x56e6ef(0x115)]>0x1?_0x26203b[_0x56e6ef(0xff)]+'\x20v'+(_0x26203b[_0x56e6ef(0xa7)]||0x1):_0x26203b[_0x56e6ef(0xff)];_0x163581[_0x56e6ef(0xea)](_0x56e6ef(0xe2)+_0x41bd7b);const _0x1a6152=await _0xd533ec[_0x56e6ef(0xf7)][_0x56e6ef(0x1a6)](_0x26203b['id']),_0x150119=_0x1a6152[_0x56e6ef(0x15a)]?.[_0x56e6ef(0xef)],_0x443345={'resolveSegment':async _0x58497a=>{const _0x10372a=_0x56e6ef;if(!_0x150119)return{'name':_0x58497a,'isJourneyLocal':![]};const _0x24774c=_0x2e5279['get'](_0x58497a);if(_0x24774c)return _0x24774c;try{const _0xa7e7b6=await _0xd533ec['segment'][_0x10372a(0x114)](_0x150119,_0x58497a),_0x48b813=_0xa7e7b6['kind']===SEGMENT_KIND_JOURNEY;let _0x15efdf,_0x4d5adc=_0xa7e7b6[_0x10372a(0x17a)];if(_0x48b813&&_0xa7e7b6['rule']){const _0xa2b11e=await segmentResponseToDef(_0xa7e7b6,{'resolveSegmentName':async _0x13e0e9=>{const _0x36d292=_0x10372a,_0xa88c8c=_0x2e5279[_0x36d292(0xca)](_0x13e0e9);if(_0xa88c8c)return _0xa88c8c[_0x36d292(0x17a)];const _0x5d9079=await _0x443345[_0x36d292(0x9d)](_0x13e0e9);return _0x5d9079['name'];}}),_0x16e49b=_0xa2b11e[_0x10372a(0xe5)];_0x15efdf={'description':_0xa7e7b6['description'],'rule':_0x16e49b};const _0x5b7cd1=serializeRule(_0x16e49b),_0xe61848=_0x280405[_0x10372a(0xca)](_0x5b7cd1);if(_0xe61848)_0x4d5adc=_0xe61848,_0x15efdf=undefined,_0x22c7fd[_0x10372a(0x134)]&&console['error'](_0x10372a(0x152)+_0xa7e7b6[_0x10372a(0x17a)]+'\x20->\x20'+_0xe61848);else{let _0x4af7a0=![];if(_0x390385){const _0x15f7f3=_0x390385['get'](_0x5b7cd1);if(_0x15f7f3){const _0x1e245f=_0x15f7f3[_0x10372a(0xf9)](_0xf127bf=>!_0xc3cb9e[_0x10372a(0xd5)](_0xf127bf));_0x1e245f&&(_0x4d5adc=_0x1e245f,_0xc3cb9e[_0x10372a(0x1a3)](_0x1e245f),_0x280405['set'](_0x5b7cd1,_0x1e245f),_0x4af7a0=!![],_0x22c7fd[_0x10372a(0x134)]&&console[_0x10372a(0x14e)](_0x10372a(0x122)+_0x1e245f+'\x20(rule\x20match)'));}}if(!_0x4af7a0){const _0x2d2bc2=generateJourneyLocalName(_0xa7e7b6['name']);_0x2d2bc2&&(_0x4d5adc=_0x2d2bc2);let _0x22d2c3=_0x4d5adc,_0x5d0a73=0x2;while(_0xc3cb9e[_0x10372a(0xd5)](_0x22d2c3)){_0x22d2c3=_0x4d5adc+'_'+_0x5d0a73,_0x5d0a73++;}_0xc3cb9e['add'](_0x22d2c3),_0x280405['set'](_0x5b7cd1,_0x22d2c3),_0x4d5adc=_0x22d2c3;}}}const _0x56df4a={'name':_0x4d5adc,'isJourneyLocal':_0x48b813,'definition':_0x15efdf};return _0x2e5279[_0x10372a(0x1a5)](_0x58497a,_0x56df4a),_0x56df4a;}catch(_0x4ff56c){return _0x2474ea[_0x10372a(0x134)]&&console[_0x10372a(0x14e)](_0x10372a(0x198)+_0x58497a+':\x20'+_0x4ff56c[_0x10372a(0x16f)]),{'name':_0x58497a,'isJourneyLocal':![]};}},'resolveActivation':async _0x414a01=>{const _0x1861ce=_0x56e6ef,_0x2b54ea=_0x539f9d[_0x1861ce(0xca)](_0x414a01);if(_0x2b54ea)return _0x2b54ea;try{const _0x49df00=await _0xd533ec[_0x1861ce(0xf7)]['getActivation'](_0x26203b['id'],_0x414a01),_0x1d7839=journeyActivationStepToYaml(_0x49df00,_0x219abe,_0x53b4f5),_0x2c8a34=JSON[_0x1861ce(0x166)]({'name':_0x1d7839['name'],'connection':_0x1d7839[_0x1861ce(0xb1)],'connector_config':_0x1d7839[_0x1861ce(0x1a1)]}),_0x269117=_0x30e872['get'](_0x2c8a34);if(_0x269117){const _0x487b83={'name':_0x269117,'isJourneyLocal':!![],'definition':_0x1d7839};return _0x539f9d[_0x1861ce(0x1a5)](_0x414a01,_0x487b83),_0x487b83;}const _0x2f7b79=_0x49df00['attributes'][_0x1861ce(0x194)][_0x1861ce(0x17a)]||_0x414a01,_0x5ef22b=sanitizeYamlKey(_0x2f7b79)||'activation_'+_0x414a01;let _0x5741f5=_0x5ef22b,_0x5882a6=0x2;while(_0xb09e83['has'](_0x5741f5)){_0x5741f5=_0x5ef22b+'_'+_0x5882a6,_0x5882a6++;}_0xb09e83[_0x1861ce(0x1a3)](_0x5741f5),_0x30e872[_0x1861ce(0x1a5)](_0x2c8a34,_0x5741f5);const _0x46c10f={'name':_0x5741f5,'isJourneyLocal':!![],'definition':_0x1d7839};return _0x539f9d[_0x1861ce(0x1a5)](_0x414a01,_0x46c10f),_0x46c10f;}catch(_0x27ff0e){return _0x2474ea[_0x1861ce(0x134)]&&console[_0x1861ce(0x14e)](_0x1861ce(0xfb)+_0x414a01+':\x20'+_0x27ff0e['message']),{'name':_0x414a01,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x57c0c7,_0x52df0)=>{const _0x3ad821=_0x56e6ef;return resolveJumpTarget(_0x57c0c7,_0x52df0,_0x581ded,_0x2f2ac2=>_0xd533ec[_0x3ad821(0xf7)][_0x3ad821(0x1a6)](_0x2f2ac2));}},_0x4375f6=await journeyResponseToDef(_0x1a6152,_0x443345);_0x161709['push']({'item':_0x26203b,'yaml':_0x4375f6});}},{'verbose':_0x2474ea[_0x2b134d(0x134)]});const _0xbc94e9=await _0xd533ec[_0x2b134d(0xf7)][_0x2b134d(0xe0)](_0x4a2125[0x0]['journeyBundleId']),_0x1d3775=buildMergedJourneyDef(_0x161709,_0x390385,_0xbc94e9),_0x40091b=normalizeJourneyDef(_0x1d3775,_0xfecf52),_0x32c317=toYamlString(_0x40091b),_0x44fe90=_0x577286||a27_0x26af62[_0x2b134d(0x190)](_0x286516,sanitizeFileName(_0x47cdc8)+_0x2b134d(0x16b));!_0x577286&&_0x22fb95&&!existsSync(_0x286516)&&mkdirSync(_0x286516,{'recursive':!![]});const _0x10786d=a27_0x26af62[_0x2b134d(0x110)](process[_0x2b134d(0xad)](),_0x44fe90);if(existsSync(_0x44fe90)){const _0x194518=readFileSync(_0x44fe90,_0x2b134d(0x15c)),_0x4f15a6=generateDiff(_0x194518,_0x32c317),_0x5f8094=hasChanges(_0x4f15a6);_0x21a371['push']({'relativePath':_0x10786d,'absolutePath':_0x44fe90,'content':_0x32c317,'isNew':![],'hasChanges':_0x5f8094,'diff':_0x5f8094?formatDiffWithColors(_0x4f15a6):undefined});}else _0x21a371[_0x2b134d(0xcb)]({'relativePath':_0x10786d,'absolutePath':_0x44fe90,'content':_0x32c317,'isNew':!![],'hasChanges':![]});}const _0xaa075c=_0x21a371[_0x2b134d(0x98)](_0xb9af36=>_0xb9af36[_0x2b134d(0x193)]),_0x45c9ca=_0x21a371['filter'](_0x36eaba=>!_0x36eaba[_0x2b134d(0x193)]&&_0x36eaba[_0x2b134d(0x13d)]),_0x10c78f=_0x21a371[_0x2b134d(0x98)](_0xc461a5=>!_0xc461a5[_0x2b134d(0x193)]&&!_0xc461a5[_0x2b134d(0x13d)]),_0x3a655c=_0x2ac801[_0x2b134d(0x115)],_0x313f58=_0x57f78a[_0x2b134d(0x19b)],_0x458f24=_0x3a655c>_0x313f58?'\x20('+_0x3a655c+_0x2b134d(0x12d):'';console[_0x2b134d(0x14e)](_0x2b134d(0x16c)),console['error']('\x20\x20'+a27_0x442aed[_0x2b134d(0xf2)](_0x313f58+_0x2b134d(0x119))+a27_0x442aed[_0x2b134d(0xbd)](_0x458f24)),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0x175)]('+\x20'+_0xaa075c['length']+_0x2b134d(0xa0))),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0x144)]('~\x20'+_0x45c9ca[_0x2b134d(0x115)]+_0x2b134d(0x159))),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0xbd)]('=\x20'+_0x10c78f[_0x2b134d(0x115)]+'\x20unchanged\x20files')),console[_0x2b134d(0x14e)](_0x2b134d(0xa6)+a27_0x442aed[_0x2b134d(0xf2)](_0x36dc93)+'\x0a');if(_0x45c9ca[_0x2b134d(0x115)]>0x0)for(const _0x4b4ef9 of _0x45c9ca){console['error']('\x0aChanges\x20to\x20\x27'+_0x4b4ef9[_0x2b134d(0x13a)]+'\x27:'),console['error']('─'[_0x2b134d(0xba)](0x3c)),console['error'](_0x4b4ef9[_0x2b134d(0x170)]),console[_0x2b134d(0x14e)]('─'[_0x2b134d(0xba)](0x3c));}if(_0x22c7fd['dryRun'])return console[_0x2b134d(0x14e)](a27_0x442aed['yellow'](_0x2b134d(0xa3))),0x0;if(_0xaa075c[_0x2b134d(0x115)]===0x0&&_0x45c9ca[_0x2b134d(0x115)]===0x0)return console['error'](a27_0x442aed['green'](_0x2b134d(0xfd))),saveSessionContext({'parent_segment':_0x36585b},_0x22c7fd[_0x2b134d(0xeb)]),console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x175)](_0x2b134d(0x176)+a27_0x442aed[_0x2b134d(0xbd)](_0x2b134d(0x135))+_0x2b134d(0xb3)+a27_0x442aed[_0x2b134d(0xf2)](_0x36585b))),0x0;if(!_0x22c7fd['yes']&&(_0xaa075c[_0x2b134d(0x115)]>0x0||_0x45c9ca[_0x2b134d(0x115)]>0x0)){if(!isInteractive())return console['error'](a27_0x442aed['red'](_0x2b134d(0xc9)),_0x2b134d(0x14a)),console['error'](a27_0x442aed['dim'](_0x2b134d(0x150))),0x1;const _0x1a574e=await confirmKey(_0x2b134d(0xa4)+(_0xaa075c[_0x2b134d(0x115)]+_0x45c9ca[_0x2b134d(0x115)])+_0x2b134d(0x11d));if(!_0x1a574e)return console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x144)](_0x2b134d(0x17d)),_0x2b134d(0xb0)),0x1;}!existsSync(_0x36dc93)&&mkdirSync(_0x36dc93,{'recursive':!![]});const _0x936b84=a27_0x26af62['join'](_0x36dc93,_0x2b134d(0xc0));writeFileSync(_0x936b84,createTdxConfigContent(_0x36585b),_0x2b134d(0x15c));for(const _0x22b2f5 of _0x21a371){(_0x22b2f5[_0x2b134d(0x193)]||_0x22b2f5['hasChanges'])&&writeFileSync(_0x22b2f5[_0x2b134d(0x103)],_0x22b2f5[_0x2b134d(0x13b)],'utf-8');}return console['error'](a27_0x442aed[_0x2b134d(0x175)]('✔\x20Pulled\x20'+(_0xaa075c[_0x2b134d(0x115)]+_0x45c9ca[_0x2b134d(0x115)])+'\x20journey\x20files\x20to\x20'+_0x36dc93)),saveSessionContext({'parent_segment':_0x36585b},_0x22c7fd['session']),console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x175)](_0x2b134d(0x176)+a27_0x442aed[_0x2b134d(0xbd)]('parent_segment')+_0x2b134d(0xb3)+a27_0x442aed[_0x2b134d(0xf2)](_0x36585b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x5627fc(0x9c);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x108);async[a27_0x5627fc(0x11a)](_0x30e19c){const _0x160019=a27_0x5627fc,{options:_0x103588,args:_0x351841,tdx:_0x2aefbe}=_0x30e19c,_0x4bab86=_0x351841[0x0];if(!requireNameOrPath(_0x4bab86))return 0x1;_0x103588[_0x160019(0x134)]&&console[_0x160019(0x14e)](_0x160019(0x1a0)+_0x4bab86);const {journeyId:_0xad9751}=await resolveJourneyIdFromInput(_0x4bab86,_0x103588,_0x2aefbe),_0x5f4717=await withSpinner(_0x160019(0x99),()=>_0x2aefbe[_0x160019(0xf7)][_0x160019(0x13f)](_0xad9751),{'verbose':_0x103588['verbose']}),_0x2c3cff=_0x5f4717[_0x160019(0x10b)];return console[_0x160019(0x116)]('Database:\x20'+_0x2c3cff['database']),console[_0x160019(0x116)](_0x160019(0x112)+_0x2c3cff[_0x160019(0x138)]),await handleSDKOutput(_0x2c3cff['columns'],_0x103588),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:activations';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x12c);async[a27_0x5627fc(0x11a)](_0x2b10c4){const _0x4061bd=a27_0x5627fc,{options:_0x11e13b,args:_0x1b2fe4,tdx:_0x546946}=_0x2b10c4,_0x4f2950=_0x1b2fe4[0x0];if(!requireNameOrPath(_0x4f2950))return 0x1;_0x11e13b[_0x4061bd(0x134)]&&console['error']('Input:\x20'+_0x4f2950);const {journeyId:_0x16eef5}=await resolveJourneyIdFromInput(_0x4f2950,_0x11e13b,_0x546946),_0x217856=await withSpinner(_0x4061bd(0x123),()=>_0x546946[_0x4061bd(0xf7)][_0x4061bd(0xe9)](_0x16eef5),{'verbose':_0x11e13b[_0x4061bd(0x134)]}),_0x6ca65f=_0x217856[_0x4061bd(0x10b)];return console['error'](_0x4061bd(0x14c)+_0x6ca65f[_0x4061bd(0x115)]+'\x20activation'+(_0x6ca65f[_0x4061bd(0x115)]!==0x1?'s':'')),await handleSDKOutput(_0x6ca65f,_0x11e13b),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x5627fc(0x180);['description']=a27_0x5627fc(0xd8);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x5d16a5){const _0x2a095e=a27_0x5627fc,_0x37dae8=_0x5d16a5['args'][0x0];let _0x1a082c;if(_0x37dae8){const _0x4cd9b1=await resolveTarget({'arg':_0x37dae8,'contextParent':_0x5d16a5['options']['parentSegment'],'cwd':process[_0x2a095e(0xad)]()});isSuccessfulResolution(_0x4cd9b1)&&_0x4cd9b1[_0x2a095e(0x142)]===_0x2a095e(0xcc)&&(_0x1a082c=_0x4cd9b1[_0x2a095e(0xe8)]);}const _0x397a39={..._0x5d16a5,'options':{..._0x5d16a5['options'],'journeysOnly':!![],..._0x1a082c&&{'singleFilePath':_0x1a082c}}};return this['segmentPushCommand']['execute'](_0x397a39);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:versions';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x133);async[a27_0x5627fc(0x11a)](_0x37d826){const _0x40575e=a27_0x5627fc,{options:_0x44d72d,args:_0x4bd4c9,tdx:_0x2be5b1}=_0x37d826,_0x59d23b=_0x4bd4c9[0x0];if(!requireNameOrPath(_0x59d23b))return 0x1;if(_0x44d72d['verbose'])console[_0x40575e(0x14e)](_0x40575e(0x1a0)+_0x59d23b);const {journeyId:_0x18da28}=await resolveJourneyIdFromInput(_0x59d23b,_0x44d72d,_0x2be5b1),_0x332806=await withSpinner(_0x40575e(0x181),()=>_0x2be5b1['journey'][_0x40575e(0x14d)](_0x18da28),{'verbose':_0x44d72d['verbose']}),{bundleName:_0x5db35d,versions:_0x2bf11b,latestJourneyId:_0x29caa2}=_0x332806[_0x40575e(0x10b)];console[_0x40575e(0x14e)](_0x5db35d+':\x20'+_0x2bf11b[_0x40575e(0x115)]+_0x40575e(0x185)+(_0x2bf11b[_0x40575e(0x115)]!==0x1?'s':''));const _0x20a023=_0x2bf11b['map'](_0x250b88=>({'version':_0x250b88[_0x40575e(0xa7)],'journey_id':_0x250b88[_0x40575e(0x13c)],'name':_0x250b88['name'],'state':_0x250b88[_0x40575e(0xc4)],'paused':_0x250b88[_0x40575e(0x156)],'latest':_0x250b88[_0x40575e(0x13c)]===_0x29caa2,'created_at':_0x250b88[_0x40575e(0xd9)]}));return await handleSDKOutput(_0x20a023,_0x44d72d),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x184);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xa9);async[a27_0x5627fc(0x11a)](_0x5dbb2a){const _0x457ecf=a27_0x5627fc,{options:_0x24d9d9,args:_0x510991,tdx:_0x57b45f}=_0x5dbb2a,_0x2787cb=_0x510991[0x0];if(!requireNameOrPath(_0x2787cb))return 0x1;if(_0x24d9d9[_0x457ecf(0x134)])console['error'](_0x457ecf(0x1a0)+_0x2787cb);const {journeyId:_0x1db675,journeyName:_0x2fb6b5}=await resolveJourneyIdFromInput(_0x2787cb,_0x24d9d9,_0x57b45f);if(!_0x24d9d9[_0x457ecf(0x178)]){const _0x4e266b=await confirm(_0x457ecf(0x15d)+_0x2fb6b5+'\x22?');if(!_0x4e266b)return console[_0x457ecf(0x14e)]('Cancelled'),0x0;}const _0x12bef6=await withSpinner(_0x457ecf(0x199),()=>_0x57b45f[_0x457ecf(0xf7)]['createVersion'](_0x1db675),{'verbose':_0x24d9d9[_0x457ecf(0x134)]}),_0x31ca14=_0x12bef6[_0x457ecf(0x10b)];return console[_0x457ecf(0x14e)](a27_0x442aed['green']('✔')+_0x457ecf(0x191)+_0x31ca14['attributes'][_0x457ecf(0xa7)]+_0x457ecf(0x10f)+_0x31ca14['attributes'][_0x457ecf(0x17a)]+'\x22'),console[_0x457ecf(0x14e)](_0x457ecf(0xb4)+_0x31ca14['id']),await handleSingleObjectOutput({'id':_0x31ca14['id'],'name':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0x17a)],'version':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0xa7)],'state':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0xc4)],'bundle_id':_0x31ca14['attributes'][_0x457ecf(0x100)],'created_at':_0x31ca14['attributes'][_0x457ecf(0xd9)]},_0x24d9d9),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a27_0x5627fc(0xc7);['description']=a27_0x5627fc(0x189);async[a27_0x5627fc(0x11a)](_0x29ec97){const _0x234c7a=a27_0x5627fc,{options:_0x3498d2,args:_0x325ed6,tdx:_0x159f19}=_0x29ec97,_0x591a78=_0x325ed6[0x0];if(!requireNameOrPath(_0x591a78))return 0x1;const _0x54ee1f=_0x3498d2[_0x234c7a(0x128)];if(!_0x54ee1f)return console[_0x234c7a(0x14e)](_0x234c7a(0xc6)),console[_0x234c7a(0x14e)](_0x234c7a(0xb9)),0x1;const _0x113d09=parseInt(_0x54ee1f,0xa);if(isNaN(_0x113d09)||_0x113d09<0x1)return console[_0x234c7a(0x14e)](_0x234c7a(0x165)+_0x54ee1f),0x1;if(_0x3498d2[_0x234c7a(0x134)])console[_0x234c7a(0x14e)](_0x234c7a(0x1a0)+_0x591a78+_0x234c7a(0xce)+_0x113d09);const {journeyId:_0xb0ddcc,parentSegmentId:_0x3247b4}=await resolveJourneyIdFromInput(_0x591a78,_0x3498d2,_0x159f19),_0x3c6de9=await withSpinner(_0x234c7a(0x105),()=>_0x159f19[_0x234c7a(0xf7)][_0x234c7a(0x14d)](_0xb0ddcc),{'verbose':_0x3498d2['verbose']}),{versions:_0x299d97,latestJourneyId:_0x1880ae}=_0x3c6de9[_0x234c7a(0x10b)],_0x539b20=_0x299d97[_0x234c7a(0xf9)](_0x4437d0=>_0x4437d0[_0x234c7a(0xa7)]===_0x113d09);if(!_0x539b20){const _0x26de53=_0x299d97['map'](_0x439334=>'v'+_0x439334[_0x234c7a(0xa7)])['join'](',\x20');return console[_0x234c7a(0x14e)]('Error:\x20Version\x20'+_0x113d09+_0x234c7a(0x182)+_0x26de53),0x1;}const _0x5ca6a7=await withSpinner('Getting\x20version\x20'+_0x113d09+_0x234c7a(0xa5),()=>_0x159f19[_0x234c7a(0xf7)][_0x234c7a(0x1a6)](_0x539b20[_0x234c7a(0x13c)]),{'verbose':_0x3498d2[_0x234c7a(0x134)]}),_0x456e5f=_0x5ca6a7[_0x234c7a(0x10b)],_0x59bb8d=getConsoleNextUrl(_0x3498d2[_0x234c7a(0x19c)],'/app/ps/'+_0x3247b4+'/e/'+_0x539b20['journeyId']+_0x234c7a(0x10e));return await handleSingleObjectOutput({'id':_0x456e5f['id'],'name':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x17a)],'version':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xa7)],'description':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xd1)],'state':_0x456e5f[_0x234c7a(0x15a)]['state'],'paused':_0x456e5f[_0x234c7a(0x15a)]['paused'],'reentry_mode':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xfe)],'stages':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x9e)]?.[_0x234c7a(0x115)]||0x0,..._0x456e5f['attributes'][_0x234c7a(0x179)]&&{'goal':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x179)][_0x234c7a(0x17a)]},'latest':_0x539b20['journeyId']===_0x1880ae,'created_at':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xd9)],'updated_at':_0x456e5f['attributes'][_0x234c7a(0x94)],'url':_0x59bb8d},_0x3498d2),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x4363f7=a28_0x1de3;(function(_0x17cd84,_0x483b7a){const _0x242186=a28_0x1de3,_0x2455d1=_0x17cd84();while(!![]){try{const _0x209431=parseInt(_0x242186(0xb9))/0x1*(-parseInt(_0x242186(0xbe))/0x2)+-parseInt(_0x242186(0xb0))/0x3+parseInt(_0x242186(0xc0))/0x4+-parseInt(_0x242186(0xd1))/0x5*(-parseInt(_0x242186(0xea))/0x6)+-parseInt(_0x242186(0xce))/0x7*(parseInt(_0x242186(0xc7))/0x8)+parseInt(_0x242186(0xde))/0x9*(-parseInt(_0x242186(0xe0))/0xa)+parseInt(_0x242186(0xd4))/0xb;if(_0x209431===_0x483b7a)break;else _0x2455d1['push'](_0x2455d1['shift']());}catch(_0x2e735b){_0x2455d1['push'](_0x2455d1['shift']());}}}(a28_0x4fe7,0xd5902));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1de3(_0x279564,_0x1f16c7){_0x279564=_0x279564-0xaf;const _0x4fe7cf=a28_0x4fe7();let _0x1de3d1=_0x4fe7cf[_0x279564];return _0x1de3d1;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x119a36 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a28_0x4fe7(){const _0x1c81d5=['\x20warning(s)\x20found','4EhJLZY','description','2014828ptCCcs','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20Directory\x20not\x20found:\x20','skippedCount','name','no_parent','672wwqpAT','\x20valid','warningCount','cwd','green','.yml','length','70609IksGYE','endsWith','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','3625uGbCgw','No\x20journey\x20YAML\x20files\x20found\x20in\x20','yellow','44510246tISPLm','relativePath','message','errorCode','✔\x20All\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','reason','\x20(skipped:\x20','validCount','.yaml','9HpnQxq','execute','13871870Hcvdvi','log','journey:validate','helpText','Error:\x20','filter','dim','\x20error(s)','\x20journey(s)\x20valid','journey','2400jnQjjn','errors','filePath','valid','49830dXEcvh','error','verbose','hasErrors','\x20warning(s)','type','invalidCount','warnings','targetDir','857117jfmrSL','\x20segment\x20file(s)\x20skipped','red','parentSegment'];a28_0x4fe7=function(){return _0x1c81d5;};return a28_0x4fe7();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x4363f7(0xc5)]=a28_0x4363f7(0xe2);[a28_0x4363f7(0xbf)]='Validate\x20journey\x20YAML\x20files';async[a28_0x4363f7(0xdf)](_0x5f202f){const _0x3b148c=a28_0x4363f7,{options:_0x1880f8,args:_0x35ab01}=_0x5f202f,_0x3e8d74=_0x1880f8,_0x20dafd=await resolveTarget({'arg':_0x35ab01[0x0],'contextParent':_0x1880f8[_0x3b148c(0xbc)],'cwd':process[_0x3b148c(0xca)]()});if(!isSuccessfulResolution(_0x20dafd))return _0x20dafd[_0x3b148c(0xd7)]===_0x3b148c(0xc6)?(console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xd3)](_0x3b148c(0xd9))),console[_0x3b148c(0xb1)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x3b148c(0xb1)]('\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['error'](_0x3b148c(0xc1))):(console['error'](a28_0x119a36[_0x3b148c(0xbb)](_0x3b148c(0xe4)+_0x20dafd[_0x3b148c(0xd6)]+'\x0a')),_0x20dafd[_0x3b148c(0xe3)]&&console['error'](a28_0x119a36['cyan'](_0x20dafd[_0x3b148c(0xe3)]))),0x1;const _0x4542ef=_0x20dafd[_0x3b148c(0xb8)],_0xfdddac=_0x20dafd[_0x3b148c(0xb5)]==='file'?_0x20dafd[_0x3b148c(0xec)]:undefined;if(!_0xfdddac&&!existsSync(_0x4542ef))return console['error'](a28_0x119a36['red'](_0x3b148c(0xc3)+_0x4542ef+'\x0a')),0x1;let _0x30baf3;if(_0xfdddac){if(!_0xfdddac['endsWith'](_0x3b148c(0xcc))&&!_0xfdddac[_0x3b148c(0xcf)](_0x3b148c(0xdd)))return console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xbb)](_0x3b148c(0xd0)+_0xfdddac+'\x0a')),0x1;_0x30baf3=[_0xfdddac];}else _0x30baf3=findYamlFiles(_0x4542ef);if(_0x30baf3['length']===0x0)return console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xbb)](_0x3b148c(0xc2)+_0x4542ef+'\x0a')),0x1;const _0xa854ab=validateYamlFiles(_0x30baf3,_0x4542ef,{'filterType':_0x3b148c(0xe9)}),_0x11220f=calculateSummary(_0xa854ab),_0x277dbb=_0xa854ab[_0x3b148c(0xe5)](isValidationResult);if(_0x277dbb['length']===0x0)return console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xd3)](_0x3b148c(0xd2)+_0x4542ef+'\x0a')),_0x11220f['skippedCount']>0x0&&console[_0x3b148c(0xb1)](a28_0x119a36[_0x3b148c(0xe6)]('('+_0x11220f['skippedCount']+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x44c375 of _0xa854ab){if(!isValidationResult(_0x44c375)){_0x3e8d74['verbose']&&console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xe6)]('-\x20'+_0x44c375[_0x3b148c(0xd5)]+_0x3b148c(0xdb)+_0x44c375[_0x3b148c(0xda)]+')'));continue;}const {relativePath:_0x26d72c,source:_0x20bb8d,result:_0x599c14}=_0x44c375;if(_0x599c14[_0x3b148c(0xaf)]&&_0x599c14[_0x3b148c(0xb7)][_0x3b148c(0xcd)]===0x0)_0x3e8d74[_0x3b148c(0xb2)]&&console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xcb)]('✔\x20'+_0x26d72c));else _0x599c14[_0x3b148c(0xaf)]?(console[_0x3b148c(0xe1)](a28_0x119a36['yellow']('⚠\x20'+_0x26d72c+':\x20'+_0x599c14[_0x3b148c(0xb7)]['length']+_0x3b148c(0xb4))),console[_0x3b148c(0xe1)](formatValidationResult(_0x599c14,_0x20bb8d,_0x26d72c))):(console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xbb)]('✖\x20'+_0x26d72c+':\x20'+_0x599c14[_0x3b148c(0xeb)][_0x3b148c(0xcd)]+_0x3b148c(0xe7))),console[_0x3b148c(0xe1)](formatValidationResult(_0x599c14,_0x20bb8d,_0x26d72c)));}return console[_0x3b148c(0xe1)](''),_0x11220f[_0x3b148c(0xb3)]?(console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xbb)]('Validation\x20failed:\x20'+_0x11220f[_0x3b148c(0xb6)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x11220f[_0x3b148c(0xdc)]+_0x3b148c(0xc8))),_0x11220f['warningCount']>0x0&&console['log'](a28_0x119a36[_0x3b148c(0xd3)](_0x11220f[_0x3b148c(0xc9)]+_0x3b148c(0xbd))),_0x11220f['skippedCount']>0x0&&console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xe6)](_0x11220f[_0x3b148c(0xc4)]+_0x3b148c(0xba))),0x1):(console['log'](a28_0x119a36[_0x3b148c(0xcb)](_0x3b148c(0xd8)+_0x11220f['validCount']+_0x3b148c(0xe8))),_0x11220f['warningCount']>0x0&&console['log'](a28_0x119a36['yellow'](_0x11220f[_0x3b148c(0xc9)]+_0x3b148c(0xbd))),_0x11220f[_0x3b148c(0xc4)]>0x0&&console[_0x3b148c(0xe1)](a28_0x119a36[_0x3b148c(0xe6)](_0x11220f[_0x3b148c(0xc4)]+_0x3b148c(0xba))),0x0);}}
|