@treasuredata/tdx 2026.4.10 → 2026.4.12
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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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.d.ts +2 -0
- package/dist/sdk/types/workspace.d.ts.map +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.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +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_0x1a5222=a25_0x33be;(function(_0x2c1290,_0x3fbb13){const _0x401566=a25_0x33be,_0x51ba5b=_0x2c1290();while(!![]){try{const _0x4e25d7=-parseInt(_0x401566(0x13b))/0x1*(parseInt(_0x401566(0x132))/0x2)+parseInt(_0x401566(0x147))/0x3+parseInt(_0x401566(0x153))/0x4*(parseInt(_0x401566(0x131))/0x5)+parseInt(_0x401566(0x139))/0x6+parseInt(_0x401566(0x138))/0x7*(parseInt(_0x401566(0x133))/0x8)+parseInt(_0x401566(0x134))/0x9+-parseInt(_0x401566(0x148))/0xa;if(_0x4e25d7===_0x3fbb13)break;else _0x51ba5b['push'](_0x51ba5b['shift']());}catch(_0x3e63b7){_0x51ba5b['push'](_0x51ba5b['shift']());}}}(a25_0x5ca5,0x41716));import{BaseCommand}from'./command.js';function a25_0x5ca5(){const _0x4fe902=['validCount','199437MLdGHs','1038306MtmQQF','errors','40785OvDFbT','red','description','\x20non-template\x20file(s)\x20skipped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','.yml','engage:template:validate','error','\x20template(s)\x20with\x20errors,\x20','hasErrors','relativePath','valid','910479JBkapp','10900000VaXBHB','\x20warning(s)\x20found','dirname','skippedCount','.yaml','template','invalidCount','endsWith','✔\x20All\x20','cwd','\x20(skipped:\x20','9304hCWxxe','warningCount','yellow','log','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','warnings','\x20template(s)\x20valid','\x20non-template\x20file(s)\x20skipped)','length','dim','\x20warning(s)','green','\x20valid','1005vgZmQO','2IPicPW','40wnoYJV','2810826WYHHgU','Validate\x20template\x20YAML\x20files','name'];a25_0x5ca5=function(){return _0x4fe902;};return a25_0x5ca5();}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x33be(_0x1d9437,_0x2d1608){_0x1d9437=_0x1d9437-0x127;const _0x5ca549=a25_0x5ca5();let _0x33be08=_0x5ca549[_0x1d9437];return _0x33be08;}import{existsSync}from'fs';import a25_0x506ad8 from'chalk';import a25_0x3b9e7d from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x1a5222(0x136)]=a25_0x1a5222(0x141);[a25_0x1a5222(0x13d)]=a25_0x1a5222(0x135);async['execute'](_0x437511){const _0x496021=a25_0x1a5222,{options:_0x5568ef,args:_0x4525f3}=_0x437511,_0x3571a7=_0x5568ef,_0x4e1bd0=_0x4525f3[0x0],_0xfbd574=_0x4e1bd0?a25_0x3b9e7d['resolve'](_0x4e1bd0):undefined,_0x5462f1=_0xfbd574?isYamlFile(_0xfbd574):![];let _0x1ff680,_0x585bc4;if(_0x5462f1&&_0xfbd574)_0x1ff680=a25_0x3b9e7d[_0x496021(0x14a)](_0xfbd574),_0x585bc4=_0xfbd574;else _0xfbd574?_0x1ff680=_0xfbd574:_0x1ff680=process[_0x496021(0x151)]();if(!_0x585bc4&&!existsSync(_0x1ff680))return console[_0x496021(0x142)](a25_0x506ad8['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x1ff680+'\x0a')),0x1;let _0x42a0a6;if(_0x585bc4){if(!_0x585bc4[_0x496021(0x14f)](_0x496021(0x140))&&!_0x585bc4[_0x496021(0x14f)](_0x496021(0x14c)))return console[_0x496021(0x142)](a25_0x506ad8['red'](_0x496021(0x13f)+_0x585bc4+'\x0a')),0x1;_0x42a0a6=[_0x585bc4];}else _0x42a0a6=findYamlFiles(_0x1ff680);if(_0x42a0a6[_0x496021(0x12c)]===0x0)return console[_0x496021(0x142)](a25_0x506ad8[_0x496021(0x13c)](_0x496021(0x128)+_0x1ff680+'\x0a')),0x1;const _0x4ec7f4=validateYamlFiles(_0x42a0a6,_0x1ff680,{'filterType':_0x496021(0x14d)}),_0x181cf5=calculateSummary(_0x4ec7f4),_0x39cb2c=_0x4ec7f4['filter'](isValidationResult);if(_0x39cb2c[_0x496021(0x12c)]===0x0)return console['error'](a25_0x506ad8[_0x496021(0x155)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x1ff680+'\x0a')),_0x181cf5['skippedCount']>0x0&&console[_0x496021(0x142)](a25_0x506ad8['dim']('('+_0x181cf5[_0x496021(0x14b)]+_0x496021(0x12b))),0x0;for(const _0x5aaa61 of _0x4ec7f4){if(!isValidationResult(_0x5aaa61)){_0x3571a7['verbose']&&console['log'](a25_0x506ad8[_0x496021(0x12d)]('-\x20'+_0x5aaa61[_0x496021(0x145)]+_0x496021(0x152)+_0x5aaa61['reason']+')'));continue;}const {relativePath:_0x186656,source:_0x58e49f,result:_0x468378}=_0x5aaa61;if(_0x468378[_0x496021(0x146)]&&_0x468378['warnings'][_0x496021(0x12c)]===0x0)_0x3571a7['verbose']&&console[_0x496021(0x127)](a25_0x506ad8['green']('✔\x20'+_0x186656));else _0x468378[_0x496021(0x146)]?(console[_0x496021(0x127)](a25_0x506ad8[_0x496021(0x155)]('⚠\x20'+_0x186656+':\x20'+_0x468378[_0x496021(0x129)]['length']+_0x496021(0x12e))),console['log'](formatValidationResult(_0x468378,_0x58e49f,_0x186656))):(console[_0x496021(0x127)](a25_0x506ad8['red']('✖\x20'+_0x186656+':\x20'+_0x468378[_0x496021(0x13a)][_0x496021(0x12c)]+'\x20error(s)')),console['log'](formatValidationResult(_0x468378,_0x58e49f,_0x186656)));}return console['log'](''),_0x181cf5[_0x496021(0x144)]?(console[_0x496021(0x127)](a25_0x506ad8[_0x496021(0x13c)]('Validation\x20failed:\x20'+_0x181cf5[_0x496021(0x14e)]+_0x496021(0x143)+_0x181cf5[_0x496021(0x137)]+_0x496021(0x130))),_0x181cf5[_0x496021(0x154)]>0x0&&console['log'](a25_0x506ad8[_0x496021(0x155)](_0x181cf5[_0x496021(0x154)]+_0x496021(0x149))),_0x181cf5['skippedCount']>0x0&&console[_0x496021(0x127)](a25_0x506ad8['dim'](_0x181cf5[_0x496021(0x14b)]+_0x496021(0x13e))),0x1):(console['log'](a25_0x506ad8[_0x496021(0x12f)](_0x496021(0x150)+_0x181cf5['validCount']+_0x496021(0x12a))),_0x181cf5[_0x496021(0x154)]>0x0&&console['log'](a25_0x506ad8[_0x496021(0x155)](_0x181cf5[_0x496021(0x154)]+_0x496021(0x149))),_0x181cf5[_0x496021(0x14b)]>0x0&&console['log'](a25_0x506ad8['dim'](_0x181cf5[_0x496021(0x14b)]+'\x20non-template\x20file(s)\x20skipped')),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_0x15ed47=a26_0x441f;(function(_0x2f939d,_0x259fca){const _0x1f30ed=a26_0x441f,_0x15b813=_0x2f939d();while(!![]){try{const _0x2780c0=-parseInt(_0x1f30ed(0x162))/0x1+parseInt(_0x1f30ed(0x17a))/0x2*(-parseInt(_0x1f30ed(0x161))/0x3)+parseInt(_0x1f30ed(0x175))/0x4*(-parseInt(_0x1f30ed(0x195))/0x5)+parseInt(_0x1f30ed(0x1ad))/0x6*(-parseInt(_0x1f30ed(0x19d))/0x7)+-parseInt(_0x1f30ed(0x196))/0x8+-parseInt(_0x1f30ed(0x17e))/0x9+parseInt(_0x1f30ed(0x18b))/0xa;if(_0x2780c0===_0x259fca)break;else _0x15b813['push'](_0x15b813['shift']());}catch(_0x20a637){_0x15b813['push'](_0x15b813['shift']());}}}(a26_0x3956,0xdd648));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';function a26_0x3956(){const _0xeea68=['Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job_id','url','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','created_at','substring','success','jobType','268572ieHaLP','debug','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','INVALID_ARGUMENT','now','2hNJvrS','information_schema','job:kill','file','10171683eFjJQR','validate','\x20row','yes','Query:\x20','data','user_name','red','error','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','getTime','Submitting\x20job...','log','80603530dcDCXY','length','✔\x20Retrieved\x20','trino','just\x20now','site','h\x20ago','Getting\x20job\x20results...','verbose','dim','30JtITxo','6344344laVAoW','result','kill','List\x20jobs','...','database','Limit:\x20','1570506MbAKBv','green','jobs','job:submit','submit','\x20\x20Job\x20ID:\x20','start_at','push','name','join','args','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','floor','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','48VYBFHf','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submitting\x20kill\x20request...','round','mo\x20ago','Listing\x20jobs...','query','✔\x20Job\x20submitted','description','Getting\x20job\x20details...','Status\x20filter:\x20','map','4678644JELemv','1473029QlNYCh','Job\x20type:\x20','Submit\x20a\x20job','execute','Get\x20job\x20results','job:show','status','✔\x20Found\x20','type','priority','abs'];a26_0x3956=function(){return _0xeea68;};return a26_0x3956();}import{getJobUrl}from'../sdk/client/endpoints.js';function a26_0x441f(_0x580599,_0x388d46){_0x580599=_0x580599-0x158;const _0x395694=a26_0x3956();let _0x441f4b=_0x395694[_0x580599];return _0x441f4b;}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x139651 from'chalk';function formatDuration(_0x41dffc){const _0xb3a063=a26_0x441f;if(_0x41dffc<0x3c)return _0x41dffc+'s';if(_0x41dffc<0xe10)return Math[_0xb3a063(0x1aa)](_0x41dffc/0x3c)+'m\x20'+_0x41dffc%0x3c+'s';const _0x3d04e4=Math[_0xb3a063(0x1aa)](_0x41dffc/0xe10),_0x3eb6ec=Math[_0xb3a063(0x1aa)](_0x41dffc%0xe10/0x3c);return _0x3eb6ec>0x0?_0x3d04e4+'h\x20'+_0x3eb6ec+'m':_0x3d04e4+'h';}function formatRelativeTime(_0x4598e1){const _0x112b33=a26_0x441f,_0x5f310e=Date[_0x112b33(0x179)]()-_0x4598e1[_0x112b33(0x188)](),_0x10a6ff=Math[_0x112b33(0x1aa)](Math[_0x112b33(0x16c)](_0x5f310e)/0x3e8);if(_0x10a6ff<0x3c)return _0x112b33(0x18f);const _0x36f629=Math[_0x112b33(0x1aa)](_0x10a6ff/0x3c);if(_0x36f629<0x3c)return _0x36f629+'m\x20ago';const _0x50a0cd=Math[_0x112b33(0x1aa)](_0x36f629/0x3c);if(_0x50a0cd<0x18)return _0x50a0cd+_0x112b33(0x191);const _0x2df986=Math[_0x112b33(0x1aa)](_0x50a0cd/0x18);if(_0x2df986<0x1e)return _0x2df986+'d\x20ago';return Math[_0x112b33(0x1aa)](_0x2df986/0x1e)+_0x112b33(0x159);}export class JobListCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x19f);['description']=a26_0x15ed47(0x199);async['execute'](_0xd5047d){const _0x4ba03e=a26_0x15ed47,{options:_0x3e78c3,tdx:_0x163a4f}=_0xd5047d,_0x39f0f8=resolveLimit(_0x3e78c3['limit'],DEFAULT_DISPLAY_LIMIT),_0x310cf3=_0x3e78c3[_0x4ba03e(0x168)];_0x3e78c3['verbose']&&(console[_0x4ba03e(0x186)](_0x4ba03e(0x19c)+_0x39f0f8+'\x20jobs'),_0x310cf3&&console['error'](_0x4ba03e(0x15f)+_0x310cf3));const _0x5615dd=await withSpinner(_0x4ba03e(0x15a),()=>_0x163a4f[_0x4ba03e(0x19f)]['list']({'from':0x0,'to':_0x39f0f8-0x1,'status':_0x310cf3}),{'verbose':_0x3e78c3[_0x4ba03e(0x193)]}),_0x2777fc=_0x5615dd[_0x4ba03e(0x183)];console[_0x4ba03e(0x186)](_0x4ba03e(0x169)+_0x2777fc[_0x4ba03e(0x18c)]+'\x20job'+(_0x2777fc[_0x4ba03e(0x18c)]!==0x1?'s':''));const _0x1f09d1=_0x3e78c3[_0x4ba03e(0x190)];if(isStructuredFormat(_0x3e78c3)){const _0x10a81b=_0x2777fc[_0x4ba03e(0x160)](_0x3fb419=>{const _0x93da33=_0x4ba03e;let _0x5dc4b4;if(_0x3fb419[_0x93da33(0x1a3)]&&_0x3fb419[_0x93da33(0x1ab)]){const _0x2a4b9a=new Date(_0x3fb419[_0x93da33(0x1a3)])['getTime'](),_0x12fbea=new Date(_0x3fb419[_0x93da33(0x1ab)])[_0x93da33(0x188)]();_0x5dc4b4=Math[_0x93da33(0x158)]((_0x12fbea-_0x2a4b9a)/0x3e8);}return{'job_id':_0x3fb419[_0x93da33(0x16e)],'type':_0x3fb419['type']==='presto'?_0x93da33(0x18e):_0x3fb419[_0x93da33(0x16a)],'status':_0x3fb419['status'],'user_name':_0x3fb419[_0x93da33(0x184)],'duration_sec':_0x5dc4b4,'created_at':_0x3fb419['created_at'],'started_at':_0x3fb419[_0x93da33(0x1a3)],'end_at':_0x3fb419[_0x93da33(0x1ab)]};});await handleSDKOutput(_0x10a81b,_0x3e78c3);}else for(const _0x2e438c of _0x2777fc){const _0x34eddc=_0x2e438c[_0x4ba03e(0x168)]===_0x4ba03e(0x173)?a26_0x139651[_0x4ba03e(0x19e)]:_0x2e438c[_0x4ba03e(0x168)]===_0x4ba03e(0x186)?a26_0x139651[_0x4ba03e(0x185)]:a26_0x139651[_0x4ba03e(0x194)],_0x48f6eb=_0x34eddc(_0x2e438c[_0x4ba03e(0x168)]),_0x4b8f3e=getJobUrl(_0x1f09d1,_0x2e438c['job_id']),_0x4fe026=hyperlink(_0x2e438c[_0x4ba03e(0x16e)],_0x4b8f3e),_0x3b1185=a26_0x139651[_0x4ba03e(0x194)](_0x2e438c[_0x4ba03e(0x16a)]==='presto'?_0x4ba03e(0x18e):_0x2e438c['type']),_0x402f89=[];if(_0x2e438c[_0x4ba03e(0x1a3)]&&_0x2e438c[_0x4ba03e(0x1ab)]){const _0x2dbe98=Math[_0x4ba03e(0x158)]((new Date(_0x2e438c[_0x4ba03e(0x1ab)])['getTime']()-new Date(_0x2e438c[_0x4ba03e(0x1a3)])['getTime']())/0x3e8);_0x402f89[_0x4ba03e(0x1a4)](formatDuration(_0x2dbe98));}if(_0x2e438c[_0x4ba03e(0x1ab)])_0x402f89[_0x4ba03e(0x1a4)](formatRelativeTime(new Date(_0x2e438c['end_at'])));else _0x2e438c[_0x4ba03e(0x1a3)]&&_0x402f89[_0x4ba03e(0x1a4)](formatRelativeTime(new Date(_0x2e438c[_0x4ba03e(0x1a3)])));const _0x5334bc=_0x402f89[_0x4ba03e(0x18c)]>0x0?a26_0x139651[_0x4ba03e(0x194)]('\x20'+_0x402f89[_0x4ba03e(0x1a6)](',\x20')):'';console[_0x4ba03e(0x18a)]('⚡\x20'+_0x4fe026+'\x20'+_0x3b1185+'\x20'+_0x48f6eb+_0x5334bc);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x167);[a26_0x15ed47(0x15d)]='Show\x20job\x20details';['validate'](_0x2d96b3){const _0x4846aa=a26_0x15ed47,_0x206755=_0x2d96b3[_0x4846aa(0x1a7)][0x0];if(!_0x206755)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x15ed47(0x165)](_0x35101b){const _0xd8d800=a26_0x15ed47,{options:_0x219d09,args:_0x3ca8c6,tdx:_0x2b6f05}=_0x35101b,_0x293252=_0x3ca8c6[0x0],_0x56be8b=await withSpinner(_0xd8d800(0x15e),()=>_0x2b6f05[_0xd8d800(0x19f)]['show'](_0x293252),{'verbose':_0x219d09[_0xd8d800(0x193)]}),_0xd02e01=_0x56be8b[_0xd8d800(0x183)];let _0x4a1dab;if(_0xd02e01[_0xd8d800(0x1a3)]&&_0xd02e01[_0xd8d800(0x1ab)]){const _0x1d7a8d=new Date(_0xd02e01['start_at'])['getTime'](),_0x3d35cf=new Date(_0xd02e01[_0xd8d800(0x1ab)])['getTime']();_0x4a1dab=Math[_0xd8d800(0x158)]((_0x3d35cf-_0x1d7a8d)/0x3e8);}const _0x1db267={'job_id':_0xd02e01['job_id'],'type':_0xd02e01[_0xd8d800(0x16a)],'status':_0xd02e01[_0xd8d800(0x168)],..._0xd02e01[_0xd8d800(0x184)]&&{'user_name':_0xd02e01[_0xd8d800(0x184)]},..._0x4a1dab!==undefined&&{'duration_sec':_0x4a1dab},..._0xd02e01[_0xd8d800(0x171)]&&{'created_at':_0xd02e01['created_at']},..._0xd02e01['start_at']&&{'started_at':_0xd02e01[_0xd8d800(0x1a3)]},..._0xd02e01[_0xd8d800(0x1ab)]&&{'end_at':_0xd02e01[_0xd8d800(0x1ab)]},..._0xd02e01[_0xd8d800(0x19b)]&&{'database':_0xd02e01[_0xd8d800(0x19b)]},..._0xd02e01[_0xd8d800(0x16b)]!==undefined&&{'priority':_0xd02e01[_0xd8d800(0x16b)]},..._0xd02e01[_0xd8d800(0x16f)]&&{'url':_0xd02e01[_0xd8d800(0x16f)]},..._0xd02e01[_0xd8d800(0x15b)]&&{'query':_0xd02e01['query']},..._0xd02e01[_0xd8d800(0x176)]&&{'debug':_0xd02e01['debug']}};return await handleSingleObjectOutput(_0x1db267,_0x219d09),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x15ed47(0x17c);['description']='Kill\x20a\x20job';['validate'](_0x5882cd){const _0x1fd88b=a26_0x15ed47,_0x33ae56=_0x5882cd[_0x1fd88b(0x1a7)][0x0];if(!_0x33ae56)return _0x1fd88b(0x170);return undefined;}async['execute'](_0xd781b){const _0x3b8dfb=a26_0x15ed47,{options:_0x227777,args:_0x4408f3,tdx:_0x41a841}=_0xd781b,_0x5790db=_0x4408f3[0x0];if(!_0x227777[_0x3b8dfb(0x181)]){const _0x2ed42c=await confirm(_0x3b8dfb(0x177)+_0x5790db+'?');if(!_0x2ed42c)return console[_0x3b8dfb(0x186)]('Cancelled'),0x0;}return await withSpinner(_0x3b8dfb(0x1af),()=>_0x41a841['jobs'][_0x3b8dfb(0x198)](_0x5790db),{'verbose':_0x227777['verbose']}),console[_0x3b8dfb(0x186)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x5790db),console[_0x3b8dfb(0x186)](_0x3b8dfb(0x1a8)+_0x5790db+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x1a0);[a26_0x15ed47(0x15d)]=a26_0x15ed47(0x164);async['execute'](_0x1ecccb){const _0x16e6f2=a26_0x15ed47,{options:_0x83cd82,args:_0x52bf41,tdx:_0x480fec}=_0x1ecccb,_0x3f5f9b=_0x83cd82[_0x16e6f2(0x174)]||_0x16e6f2(0x18e),_0x470d9d=_0x83cd82[_0x16e6f2(0x17d)],_0x225e2a=_0x83cd82[_0x16e6f2(0x19b)]||_0x16e6f2(0x17b),_0x21e05b=_0x83cd82[_0x16e6f2(0x197)];if(_0x3f5f9b!=='trino'&&_0x3f5f9b!=='hive')throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x187));let _0x7b0daa;if(_0x470d9d){if(_0x52bf41[0x0])throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x1ae));const _0x391f7b=readSqlStatementsFromFile(_0x470d9d);if(_0x391f7b[_0x16e6f2(0x18c)]===0x0)throw new SDKError(ErrorCode[_0x16e6f2(0x178)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x391f7b[_0x16e6f2(0x18c)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x16e6f2(0x1a9));_0x7b0daa=_0x391f7b[0x0];}else{if(!_0x52bf41[0x0])throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x16d));_0x7b0daa=_0x52bf41[0x0];}_0x83cd82[_0x16e6f2(0x193)]&&(console[_0x16e6f2(0x186)](_0x16e6f2(0x163)+_0x3f5f9b),console['error']('Database:\x20'+_0x225e2a),console[_0x16e6f2(0x186)](_0x16e6f2(0x182)+_0x7b0daa[_0x16e6f2(0x172)](0x0,0x64)+(_0x7b0daa[_0x16e6f2(0x18c)]>0x64?_0x16e6f2(0x19a):'')));const _0x26c54c=await withSpinner(_0x16e6f2(0x189),()=>_0x480fec[_0x16e6f2(0x19f)][_0x16e6f2(0x1a1)](_0x225e2a,_0x7b0daa,_0x3f5f9b,_0x21e05b),{'verbose':_0x83cd82[_0x16e6f2(0x193)]}),_0x44a5a4=_0x26c54c[_0x16e6f2(0x183)];return console[_0x16e6f2(0x186)](_0x16e6f2(0x15c)),console[_0x16e6f2(0x186)](_0x16e6f2(0x1a2)+_0x44a5a4[_0x16e6f2(0x16e)]),await handleSDKOutput([_0x44a5a4],_0x83cd82),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a26_0x15ed47(0x15d)]=a26_0x15ed47(0x166);[a26_0x15ed47(0x17f)](_0x1d1d97){const _0x287bcb=a26_0x15ed47,_0x2c65f8=_0x1d1d97[_0x287bcb(0x1a7)][0x0];if(!_0x2c65f8)return _0x287bcb(0x1ac);return undefined;}async[a26_0x15ed47(0x165)](_0x448982){const _0x185fd2=a26_0x15ed47,{options:_0x2d61b6,args:_0x5c3d98,tdx:_0x41a907}=_0x448982,_0x552ce2=_0x5c3d98[0x0],_0x1a9224=await withSpinner(_0x185fd2(0x192),()=>_0x41a907[_0x185fd2(0x19f)]['result'](_0x552ce2),{'verbose':_0x2d61b6[_0x185fd2(0x193)]}),_0x17702a=_0x1a9224[_0x185fd2(0x183)];return console[_0x185fd2(0x186)](_0x185fd2(0x18d)+_0x17702a[_0x185fd2(0x18c)]+_0x185fd2(0x180)+(_0x17702a[_0x185fd2(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x17702a,_0x2d61b6),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_0x19f833=a27_0x3cf7;(function(_0xf3ff5d,_0x333eed){const _0x54b230=a27_0x3cf7,_0x31ad23=_0xf3ff5d();while(!![]){try{const _0x45de78=parseInt(_0x54b230(0x209))/0x1*(-parseInt(_0x54b230(0x27e))/0x2)+parseInt(_0x54b230(0x22c))/0x3+parseInt(_0x54b230(0x1fd))/0x4*(parseInt(_0x54b230(0x24f))/0x5)+parseInt(_0x54b230(0x2a8))/0x6+parseInt(_0x54b230(0x1c8))/0x7*(-parseInt(_0x54b230(0x1f8))/0x8)+-parseInt(_0x54b230(0x205))/0x9*(-parseInt(_0x54b230(0x1f1))/0xa)+-parseInt(_0x54b230(0x2b0))/0xb*(parseInt(_0x54b230(0x247))/0xc);if(_0x45de78===_0x333eed)break;else _0x31ad23['push'](_0x31ad23['shift']());}catch(_0x22e268){_0x31ad23['push'](_0x31ad23['shift']());}}}(a27_0x1d5e,0x4eba4));import a27_0x50d849 from'chalk';import a27_0x3be399 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';function a27_0x3cf7(_0x961c97,_0x35ad6e){_0x961c97=_0x961c97-0x1aa;const _0x1d5ee1=a27_0x1d5e();let _0x3cf780=_0x1d5ee1[_0x961c97];return _0x3cf780;}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';function a27_0x1d5e(){const _0x3d6eae=['Options:','✔\x20Journey\x20\x22','tdx.json','enteredSize','sort','\x22\x20paused','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20details...','Error:\x20Journey\x20not\x20found:\x20','then','Resolving\x20journey...','journeyStages','archived','content','journey:stats','entries','parentSegment','isNew','.yml','paused','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journey:view','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','getActivation','message','push','utf-8','relativePath','\x27\x20not\x20found\x20in\x20','492834YFqTZZ','journey:activations','Error:\x20Invalid\x20version\x20number:\x20','history','no_parent','includeHistory','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pause','segment','journey:versions','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','/e/','user','journey','file','\x20Created\x20v','reentryMode','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleName','listJourneysWithFolders','cwd','\x20journeys','rootFolderId','Resolving\x20parent\x20segment...','args','json','136308HMbzGA','Getting\x20journey\x20statistics...','setPhase','has','Database:\x20','error','helpText','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','1616245WTpWHp','replace','conversion','table','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Listing\x20journeys...','limit','yes','\x20(draft)\x20—\x20\x22','versionNumber','absolutePath','toLowerCase','stringify','rule','size','Getting\x20journey\x20details...','\x20=\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','dryRun','journeyBundleId','Fetching\x20journeys\x20and\x20folders...','Write\x20','connection','Found\x20','resolveJourneyId','goal','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Warning:\x20Could\x20not\x20resolve\x20segment\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)','Folder\x20path:\x20','\x20Opening\x20','Table:\x20','Parent\x20segment:\x20','updatedAt','name','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','relative','\x20\x20Name:\x20','Resuming\x20journey...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','journeyId','\x20\x20Folder\x20path:\x20','targetDir','listFolders','type','1025578MWbLdv','state','site','\x20\x20Journey\x20ID:\x20','journey:version:view','\x20->\x20','\x20not\x20found.\x20Available:\x20','blue','dim','\x20changed\x20files','description','parent_segment','Cancelled','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','bold','log','getLatestJourneyId','-\x20no\x20files\x20written','List\x20activations\x20for\x20a\x20journey','execute','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Show\x20journey\x20details','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Fetching\x20','options','find','createVersion','folderId','yellow','jsonl','map','completionRate','No\x20journeys\x20found','Show\x20journey\x20statistics','from','Journey\x20name:\x20','\x20activation','journey:traffic','Target\x20directory:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','completed','Error:\x20Parent\x20segment\x20context\x20required','2044530GwBVSa','links','\x20version','/j/da/je','✔\x20Pulled\x20','getJourney','\x5c$&','\x20\x20Preserving\x20local\x20segment\x20name:\x20','253QRgTXp','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','base','journey:pause','kind','attributes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','listVersions','\x20versions)','stages','segments','getParentFull','(running)','filePath','List\x20all\x20versions\x20of\x20a\x20journey','parentName','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','getTrafficData','Getting\x20version\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','activation','split','Resolved\x20YAML\x20file:\x20','exitOrJumpRate','launched','root\x20folder','database','folderPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Getting\x20journey\x20traffic\x20data...','createdAt','(draft)','folders','renderStats','\x20(ID:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','filter','buildIdToNameMap','Fetching\x20users\x20and\x20connections...','\x0aChanges\x20to\x20\x27','join','413497sOZtFR','\x0aPull\x20summary:','session','getStatistics','Listing\x20journey\x20versions...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','resolveSegment','segmentPushCommand','resume','draft','values','\x20journey\x20files\x20to\x20','🗺️\x20','INVALID_ARGUMENT','journey:columns','getColumnMapping','\x20\x20Target:\x20','✔\x20Found\x20','(completed)','segmentName','cyan','Input:\x20','web','format','columns','Aborted.','Available\x20stages:\x20','stage',',\x20version:\x20','get','resolveParentId','List\x20journeys\x20in\x20current\x20context','tsv','Error:\x20--version\x20option\x20is\x20required','add','Error:\x20Version\x20','hasChanges','\x20(rule\x20match)','green','(root)','getSegment','110ZKAVxU','errorCode','journey:resume','set','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','stageNameMap','\x20journey','24zzUjWf','data','localeCompare','all','exitOrJumpSize','4jwteFP','\x22\x20resumed','milestoneSize','View\x20a\x20specific\x20version\x20of\x20a\x20journey','red','resourceName','\x20files?','verbose','364455kWyRvN','length','\x22\x20not\x20found','Export\x20journey(s)\x20as\x20YAML\x20files','1JvjhMh','journey:pull','/app/ps/','Pausing\x20journey...','Error:\x20Invalid\x20--type\x20\x22','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)'];a27_0x1d5e=function(){return _0x3d6eae;};return a27_0x1d5e();}import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x14612f){const _0x26dd17=a27_0x3cf7;return!_0x14612f&&(console[_0x26dd17(0x24c)](_0x26dd17(0x292)),console[_0x26dd17(0x24c)](_0x26dd17(0x1cd))),!!_0x14612f;}function withJsonFormat(_0x337a0d){const _0x1dacaa=a27_0x3cf7;if(!_0x337a0d['format']&&!_0x337a0d['json']&&!_0x337a0d[_0x1dacaa(0x29b)]&&!_0x337a0d[_0x1dacaa(0x1e8)])return{..._0x337a0d,'format':_0x1dacaa(0x246),'json':!![]};return _0x337a0d;}function formatJourneyState(_0x6119d0){const _0x4cb83b=a27_0x3cf7;switch(_0x6119d0){case _0x4cb83b(0x1b7):return a27_0x50d849['green'](_0x4cb83b(0x1ab));case _0x4cb83b(0x1d1):return a27_0x50d849[_0x4cb83b(0x286)](_0x4cb83b(0x1be));case _0x4cb83b(0x222):return a27_0x50d849['yellow']('(paused)');case _0x4cb83b(0x2a6):return a27_0x50d849[_0x4cb83b(0x285)](_0x4cb83b(0x1da));case _0x4cb83b(0x21b):return a27_0x50d849[_0x4cb83b(0x286)]('(archived)');default:return'('+_0x6119d0+')';}}function formatJourneyItem(_0x179471,_0x98ad4c='',_0x3befc0){const _0x326fb5=a27_0x3cf7,_0x4863a9=formatJourneyState(_0x179471[_0x326fb5(0x27f)]),_0x179589=_0x3befc0?hyperlink(_0x179471[_0x326fb5(0x23f)],_0x3befc0):_0x179471[_0x326fb5(0x23f)];return _0x98ad4c+_0x326fb5(0x1d4)+_0x179589+'\x20'+_0x4863a9;}function escapeRegex(_0x13be22){const _0xfc2e73=a27_0x3cf7;return _0x13be22[_0xfc2e73(0x250)](/[.*+?^${}()|[\]\\]/g,_0xfc2e73(0x2ae));}function globToRegex(_0x559bf7){const _0x3901b=a27_0x3cf7,_0x410265=_0x559bf7[_0x3901b(0x1b4)]('*')[_0x3901b(0x29c)](escapeRegex);return new RegExp(_0x410265[_0x3901b(0x1c7)]('.*'),'i');}function buildRuleToNameMapping(_0x7bc18){const _0x3411d5=a27_0x3cf7,_0x3cfca8=new Map();if(_0x7bc18['segments'])for(const [_0x18dde4,_0x18679a]of Object['entries'](_0x7bc18[_0x3411d5(0x2ba)])){if(_0x18679a[_0x3411d5(0x25c)]){const _0x422868=serializeRule(_0x18679a[_0x3411d5(0x25c)]),_0x124491=_0x3cfca8[_0x3411d5(0x1e5)](_0x422868);_0x124491?_0x124491[_0x3411d5(0x228)](_0x18dde4):_0x3cfca8[_0x3411d5(0x1f4)](_0x422868,[_0x18dde4]);}}return _0x3cfca8;}async function resolveJourneyIdFromInput(_0x2949c0,_0x1c308a,_0x194fa2){const _0x19a016=a27_0x3cf7,_0x1c307b=await resolveJourneyTarget(_0x2949c0,_0x1c308a['parentSegment'],_0x1c308a[_0x19a016(0x204)]),_0x43a3ef=_0x1c307b[_0x19a016(0x21f)];if(!_0x43a3ef)throw new SDKError(ErrorCode[_0x19a016(0x1d5)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x386498=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x194fa2['segment'][_0x19a016(0x1e6)](_0x43a3ef),{'verbose':_0x1c308a[_0x19a016(0x204)]}),_0x39e596=_0x386498[_0x19a016(0x1f9)],_0x3030b9=await withSpinner(_0x19a016(0x219),()=>_0x194fa2[_0x19a016(0x23a)][_0x19a016(0x267)](_0x39e596,_0x1c307b['journeyName']),{'verbose':_0x1c308a[_0x19a016(0x204)]});return{'journeyId':_0x3030b9['data'],'journeyName':_0x1c307b['journeyName'],'parentSegmentId':_0x39e596};}async function resolveJourneyTarget(_0x28f4ee,_0xfca37a,_0x11eff0){const _0x1f725d=a27_0x3cf7;if(isYamlFilePath(_0x28f4ee))try{const _0x1243d3=await resolveYamlFilePath(_0x28f4ee);return _0x11eff0&&(console[_0x1f725d(0x24c)](_0x1f725d(0x1b5)+_0x28f4ee),console[_0x1f725d(0x24c)]('\x20\x20Parent\x20segment:\x20'+_0x1243d3[_0x1f725d(0x21f)]),console[_0x1f725d(0x24c)](_0x1f725d(0x276)+_0x1243d3[_0x1f725d(0x1db)]),console[_0x1f725d(0x24c)](_0x1f725d(0x27a)+(_0x1243d3[_0x1f725d(0x1ba)]||_0x1f725d(0x1ef)))),{'journeyName':_0x1243d3[_0x1f725d(0x1db)],'parentSegment':_0x1243d3[_0x1f725d(0x21f)],'resolved':_0x1243d3};}catch(_0x1dfa69){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1dfa69['message']);}if(!_0xfca37a)throw new SDKError(ErrorCode[_0x1f725d(0x1d5)],_0x1f725d(0x232));return{'journeyName':_0x28f4ee,'parentSegment':_0xfca37a};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x19f833(0x288)]=a27_0x19f833(0x1e7);async[a27_0x19f833(0x291)](_0x1d90c3){const _0x237628=a27_0x19f833,{options:_0x11bfdf,args:_0x203c74,tdx:_0x22d633}=_0x1d90c3,_0xa1021a=_0x203c74[0x0],_0x2ff624=_0x11bfdf['parentSegment'];if(!_0x2ff624)return console[_0x237628(0x24c)](_0x237628(0x2a7)),console[_0x237628(0x24c)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x196aa6=await withSpinner(_0x237628(0x244),()=>_0x22d633[_0x237628(0x235)][_0x237628(0x1e6)](_0x2ff624),{'verbose':_0x11bfdf[_0x237628(0x204)]}),_0x5e132c=_0x196aa6[_0x237628(0x1f9)];_0x11bfdf[_0x237628(0x204)]&&(console['error'](_0x237628(0x271)+_0x2ff624+_0x237628(0x1c1)+_0x5e132c+')'),_0xa1021a&&console[_0x237628(0x24c)]('Pattern:\x20'+_0xa1021a));const _0xe4644f=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x22d633[_0x237628(0x235)][_0x237628(0x1aa)](_0x5e132c),{'verbose':_0x11bfdf[_0x237628(0x204)]}),_0xa54110=_0xe4644f[_0x237628(0x1f9)],_0x12ef51=_0xa54110[_0x237628(0x243)],_0x5017db=await withSpinner(_0x237628(0x254),()=>_0x22d633[_0x237628(0x23a)][_0x237628(0x240)](_0x5e132c,_0x12ef51),{'verbose':_0x11bfdf[_0x237628(0x204)]});let _0x559bc8=_0x5017db['data']['journeys'];const _0x9a4269=_0x5017db[_0x237628(0x1f9)][_0x237628(0x1bf)],_0xc58194=new Map();for(const _0x5bca8e of _0x9a4269){_0xc58194[_0x237628(0x1f4)](_0x5bca8e['id'],_0x5bca8e['name']);}if(_0xa1021a){const _0x7341a1=globToRegex(_0xa1021a);_0x559bc8=_0x559bc8[_0x237628(0x1c3)](_0x1c98f9=>_0x7341a1['test'](_0x1c98f9[_0x237628(0x23f)]));}console[_0x237628(0x24c)](_0x237628(0x1d9)+_0x559bc8['length']+_0x237628(0x1f7)+(_0x559bc8[_0x237628(0x206)]!==0x1?'s':''));const _0x168d05=_0x2f8451=>{const _0x5706ed=_0x237628;return getConsoleNextUrl(_0x11bfdf['site'],_0x5706ed(0x20b)+_0x5e132c+'/e/'+_0x2f8451+'/j/da');};if(_0x11bfdf[_0x237628(0x1df)]===_0x237628(0x252))await handleSDKOutput(_0x559bc8,_0x11bfdf);else{if(_0x11bfdf[_0x237628(0x1df)]===_0x237628(0x246)){const _0x2640a0=_0x559bc8[_0x237628(0x29c)](_0x543a3a=>({..._0x543a3a,'url':_0x168d05(_0x543a3a['id'])}));await handleSDKOutput(_0x2640a0,_0x11bfdf);}else{console[_0x237628(0x28d)]('['+_0x2ff624+']');const _0x4bd55b=new Map(),_0x39eb88=[];for(const _0x367352 of _0x559bc8){if(!_0x367352[_0x237628(0x299)]||_0x367352['folderId']===_0x12ef51)_0x39eb88[_0x237628(0x228)](_0x367352);else{const _0x158e2a=_0x4bd55b['get'](_0x367352[_0x237628(0x299)])||[];_0x158e2a[_0x237628(0x228)](_0x367352),_0x4bd55b[_0x237628(0x1f4)](_0x367352['folderId'],_0x158e2a);}}const _0x1f8ac3=(_0x60d0a7,_0x3cce2e)=>_0x60d0a7['journeyBundleName'][_0x237628(0x1fa)](_0x3cce2e[_0x237628(0x23f)],undefined,{'sensitivity':_0x237628(0x2b2)});_0x39eb88[_0x237628(0x213)](_0x1f8ac3);for(const _0x4fe321 of _0x39eb88){console[_0x237628(0x28d)](formatJourneyItem(_0x4fe321,'',_0x168d05(_0x4fe321['id'])));}const _0x3cda2e=[..._0x4bd55b[_0x237628(0x21e)]()][_0x237628(0x213)]((_0x491388,_0x308203)=>{const _0x409dbe=_0x237628,_0xbfbdd2=_0xc58194[_0x409dbe(0x1e5)](_0x491388[0x0])||_0x491388[0x0],_0x4ea57f=_0xc58194['get'](_0x308203[0x0])||_0x308203[0x0];return _0xbfbdd2[_0x409dbe(0x1fa)](_0x4ea57f,undefined,{'sensitivity':'base'});});for(const [_0x2051e3,_0x3d5dc1]of _0x3cda2e){const _0xebc31a=_0xc58194[_0x237628(0x1e5)](_0x2051e3)||_0x2051e3;console[_0x237628(0x28d)]('📁\x20'+_0xebc31a),_0x3d5dc1[_0x237628(0x213)](_0x1f8ac3);for(const _0x3f4a0e of _0x3d5dc1){console[_0x237628(0x28d)](formatJourneyItem(_0x3f4a0e,'\x20\x20',_0x168d05(_0x3f4a0e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x224);[a27_0x19f833(0x288)]=a27_0x19f833(0x293);async[a27_0x19f833(0x291)](_0x410666){const _0x9744c5=a27_0x19f833,{options:_0x267b32,args:_0x1d671c,tdx:_0x2759c8}=_0x410666,_0x2d93a3=_0x1d671c[0x0];if(!_0x2d93a3)return console[_0x9744c5(0x24c)](_0x9744c5(0x292)),console[_0x9744c5(0x24c)](_0x9744c5(0x26a)),console[_0x9744c5(0x24c)](_0x9744c5(0x20f)),console[_0x9744c5(0x24c)](_0x9744c5(0x1c2)),0x1;_0x267b32[_0x9744c5(0x204)]&&console[_0x9744c5(0x24c)](_0x9744c5(0x1dd)+_0x2d93a3);const {journeyId:_0x3ab156,parentSegmentId:_0x5cdf08}=await resolveJourneyIdFromInput(_0x2d93a3,_0x267b32,_0x2759c8);if(_0x267b32[_0x9744c5(0x1de)]){const _0x3955a2=getConsoleNextUrl(_0x267b32[_0x9744c5(0x280)],_0x9744c5(0x20b)+_0x5cdf08+'/e/'+_0x3ab156+_0x9744c5(0x2ab));return console[_0x9744c5(0x24c)](a27_0x50d849['green']('✔')+_0x9744c5(0x26f)+a27_0x50d849[_0x9744c5(0x1dc)](_0x3955a2)),openBrowser(_0x3955a2),0x0;}const _0x335685=await withSpinner(_0x9744c5(0x25e),()=>_0x2759c8[_0x9744c5(0x23a)][_0x9744c5(0x2ad)](_0x3ab156),{'verbose':_0x267b32[_0x9744c5(0x204)]}),_0x2c0d08=_0x335685['data'],_0x16c1ca=_0x267b32['includeStats'];let _0x1cd588;if(_0x16c1ca)try{const _0x29d0ae=await withSpinner(_0x9744c5(0x248),()=>_0x2759c8[_0x9744c5(0x23a)]['getStatistics'](_0x3ab156),{'verbose':_0x267b32[_0x9744c5(0x204)]});_0x1cd588=_0x29d0ae[_0x9744c5(0x1f9)];}catch{_0x267b32[_0x9744c5(0x204)]&&console[_0x9744c5(0x24c)]('\x20\x20Statistics\x20not\x20available');}const _0x3b32e6=getConsoleNextUrl(_0x267b32[_0x9744c5(0x280)],_0x9744c5(0x20b)+_0x5cdf08+_0x9744c5(0x238)+_0x3ab156+_0x9744c5(0x2ab)),_0x10f5c2={'id':_0x2c0d08['id'],'name':_0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x273)],'description':_0x2c0d08['attributes'][_0x9744c5(0x288)],'state':_0x2c0d08['attributes'][_0x9744c5(0x27f)],'paused':_0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x222)],'reentry_mode':_0x2c0d08['attributes'][_0x9744c5(0x23d)],'stages':_0x2c0d08[_0x9744c5(0x2b5)]['journeyStages']?.[_0x9744c5(0x206)]||0x0,..._0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x268)]&&{'goal':_0x2c0d08['attributes'][_0x9744c5(0x268)][_0x9744c5(0x273)]},..._0x1cd588&&{'statistics':{'size':_0x1cd588['size'],'entered':_0x1cd588['enteredSize'],'goal_achieved':_0x1cd588['goalSize'],'completion_rate':_0x1cd588[_0x9744c5(0x29d)],'exit_or_jump':_0x1cd588['exitOrJumpSize'],'exit_or_jump_rate':_0x1cd588[_0x9744c5(0x1b6)],'stages':_0x1cd588[_0x9744c5(0x2b9)]}},'url':_0x3b32e6};return await handleSingleObjectOutput(_0x10f5c2,_0x267b32),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x21d);['description']=a27_0x19f833(0x29f);async[a27_0x19f833(0x291)](_0x5d3240){const _0x503828=a27_0x19f833,{options:_0x3562fe,args:_0x442c80,tdx:_0x202e8f}=_0x5d3240,_0x3b38b6=_0x442c80[0x0];if(!requireNameOrPath(_0x3b38b6))return 0x1;_0x3562fe[_0x503828(0x204)]&&console[_0x503828(0x24c)](_0x503828(0x1dd)+_0x3b38b6);const _0x55fbcc=_0x3562fe,_0x52f25b=_0x55fbcc['from'],_0x12a920=_0x55fbcc['to'],_0x55621f=_0x55fbcc[_0x503828(0x231)],_0x105b99=_0x55fbcc[_0x503828(0x1e3)];_0x55621f&&!_0x52f25b&&!_0x12a920&&console[_0x503828(0x24c)](_0x503828(0x260));const _0x2a3f28=_0x55621f?withJsonFormat(_0x3562fe):_0x3562fe,{journeyId:_0xd19a76,journeyName:_0x2e8613}=await resolveJourneyIdFromInput(_0x3b38b6,_0x2a3f28,_0x202e8f),_0x49ede8=_0x52f25b||_0x12a920?{'from':_0x52f25b,'to':_0x12a920}:undefined,_0x2cb44c=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x503828(0x1fb)]([_0x202e8f[_0x503828(0x23a)][_0x503828(0x2ad)](_0xd19a76),_0x202e8f['journey'][_0x503828(0x1cb)](_0xd19a76,_0x49ede8)]),{'verbose':_0x2a3f28['verbose']}),[_0x3ff106,_0x5992d3]=_0x2cb44c['data'];if(!_0x5992d3||_0x5992d3[_0x503828(0x279)]===null)return console[_0x503828(0x24c)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x2e8613),console['error'](_0x503828(0x23e)),0x0;const _0x1f34ce=buildStageNameMap(_0x3ff106),_0x5ba849=!!(_0x49ede8&&_0x5992d3[_0x503828(0x22f)]?.['length']),_0x1f4cf5={'stageNameMap':_0x1f34ce,'hasPeriod':_0x5ba849,'includeHistory':!!_0x55621f};if(_0x105b99&&_0x5992d3[_0x503828(0x2b9)]){const _0x12cc48=_0x5992d3['stages'][_0x503828(0x297)](_0x29e75b=>{const _0x18be80=_0x503828,_0x3fdc07=_0x1f34ce['get'](_0x29e75b['id'])??'';return _0x3fdc07[_0x18be80(0x25a)]()===_0x105b99[_0x18be80(0x25a)]();});if(_0x12cc48)return await handleSingleObjectOutput(formatStageStats(_0x12cc48,_0x1f4cf5),_0x2a3f28),0x0;const _0x2acde0=_0x5992d3['stages'][_0x503828(0x29c)](_0x14485d=>_0x1f34ce[_0x503828(0x1e5)](_0x14485d['id'])??_0x14485d['id']);return console[_0x503828(0x24c)]('Error:\x20Stage\x20\x22'+_0x105b99+_0x503828(0x207)),console['error'](_0x503828(0x1e2)+_0x2acde0[_0x503828(0x1c7)](',\x20')),0x1;}const _0x269cdd=_0x5992d3[_0x503828(0x2b9)]?.['map'](_0x1f7b12=>formatStageStats(_0x1f7b12,_0x1f4cf5)),_0x2926b6=assembleJourneyStats(_0x5992d3,{'from':_0x52f25b,'to':_0x12a920,'includeHistory':_0x55621f});return await this[_0x503828(0x1c0)](_0x2926b6,_0x269cdd??[],_0x2a3f28),0x0;}async[a27_0x19f833(0x1c0)](_0x6e816a,_0x1d0604,_0x2e4a37){const _0x5ad736=a27_0x19f833,_0x3f12fc=_0x2e4a37[_0x5ad736(0x1df)]==='json'||_0x2e4a37[_0x5ad736(0x1df)]===_0x5ad736(0x29b)||_0x2e4a37[_0x5ad736(0x246)]||_0x2e4a37[_0x5ad736(0x29b)];if(_0x3f12fc){_0x6e816a[_0x5ad736(0x2b9)]=_0x1d0604,await handleSingleObjectOutput(_0x6e816a,_0x2e4a37);return;}await handleSingleObjectOutput(_0x6e816a,_0x2e4a37);for(const _0x1ca9da of _0x1d0604){console[_0x5ad736(0x28d)](''),console[_0x5ad736(0x28d)](String(a27_0x50d849[_0x5ad736(0x1dc)][_0x5ad736(0x28c)]('['+_0x1ca9da[_0x5ad736(0x273)]+']'))+a27_0x50d849[_0x5ad736(0x286)]('\x20'+_0x1ca9da['id']));const {id:_0x97b37c,name:_0x3ee12b,..._0x393063}=_0x1ca9da;await handleSingleObjectOutput(_0x393063,_0x2e4a37);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a27_0x19f833(0x2a3);[a27_0x19f833(0x288)]=a27_0x19f833(0x20e);async['execute'](_0x4c1b78){const _0x152bdf=a27_0x19f833,{options:_0x50dd14,args:_0x126d36,tdx:_0x14594c}=_0x4c1b78,_0xd26a57=_0x126d36[0x0];if(!requireNameOrPath(_0xd26a57))return 0x1;_0x50dd14[_0x152bdf(0x204)]&&console[_0x152bdf(0x24c)](_0x152bdf(0x1dd)+_0xd26a57);const _0x5e3da1=_0x50dd14,_0x408f8b=_0x5e3da1[_0x152bdf(0x27d)],_0x570c32=_0x5e3da1[_0x152bdf(0x2a0)],_0x1de7e5=_0x5e3da1['to'],_0x9d8d66=_0x5e3da1[_0x152bdf(0x255)];if(_0x408f8b&&_0x408f8b!=='conversion'&&_0x408f8b!=='activation')return console[_0x152bdf(0x24c)](_0x152bdf(0x20d)+_0x408f8b+_0x152bdf(0x223)),0x1;const _0x5d4a52=withJsonFormat(_0x50dd14),{journeyId:_0x35f3bc,journeyName:_0x5bbf21}=await resolveJourneyIdFromInput(_0xd26a57,_0x5d4a52,_0x14594c),_0x2968e1={'type':_0x408f8b,'from':_0x570c32,'to':_0x1de7e5,'limit':_0x9d8d66},_0xc9a37a=await withSpinner(_0x152bdf(0x1bc),()=>_0x14594c['journey'][_0x152bdf(0x1b0)](_0x35f3bc,_0x2968e1),{'verbose':_0x5d4a52['verbose']}),_0x151095=_0xc9a37a[_0x152bdf(0x1f9)],_0x3acf4d=_0x151095[_0x152bdf(0x251)]&&(_0x151095[_0x152bdf(0x251)]['nodes'][_0x152bdf(0x206)]>0x0||_0x151095[_0x152bdf(0x251)][_0x152bdf(0x2a9)][_0x152bdf(0x206)]>0x0),_0x2cb60b=_0x151095[_0x152bdf(0x1b3)]&&_0x151095['activation'][_0x152bdf(0x206)]>0x0;if(!_0x3acf4d&&!_0x2cb60b)return console[_0x152bdf(0x24c)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x5bbf21),console['error'](_0x152bdf(0x237)),_0x570c32&&_0x1de7e5&&console[_0x152bdf(0x24c)](_0x152bdf(0x1af)),0x0;return await handleSingleObjectOutput(_0x151095,_0x5d4a52),0x0;}}function formatStageStats(_0x541f28,_0x516dfb){const _0x35260c=a27_0x19f833,_0x523d6e=_0x516dfb['hasPeriod']&&_0x541f28['history']?.[_0x35260c(0x206)]?aggregateStageHistory(_0x541f28[_0x35260c(0x22f)]):{'size':_0x541f28['size'],'entered':_0x541f28[_0x35260c(0x212)],'milestone':_0x541f28[_0x35260c(0x1ff)],'milestone_rate':_0x541f28['completeMilestoneRate'],'exit_or_jump':_0x541f28[_0x35260c(0x1fc)],'exit_or_jump_rate':_0x541f28[_0x35260c(0x1b6)]},_0x45fb4e={'id':_0x541f28['id'],'name':_0x516dfb[_0x35260c(0x1f6)][_0x35260c(0x1e5)](_0x541f28['id'])??_0x541f28['id'],..._0x523d6e};return _0x516dfb['hasPeriod']&&_0x516dfb[_0x35260c(0x231)]&&_0x541f28['history']&&(_0x45fb4e[_0x35260c(0x22f)]=_0x541f28[_0x35260c(0x22f)]),_0x45fb4e;}export class JourneyPauseCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x2b3);[a27_0x19f833(0x288)]='Pause\x20a\x20running\x20journey';async['execute'](_0x34ee15){const _0x3bd639=a27_0x19f833,{options:_0x3a33eb,args:_0x2f9640,tdx:_0x2cb894}=_0x34ee15,_0x80ea91=_0x2f9640[0x0];if(!requireNameOrPath(_0x80ea91))return 0x1;_0x3a33eb[_0x3bd639(0x204)]&&console['error']('Input:\x20'+_0x80ea91);const {journeyId:_0x40d73d,journeyName:_0x1435ac}=await resolveJourneyIdFromInput(_0x80ea91,_0x3a33eb,_0x2cb894);if(!_0x3a33eb['yes']){const _0x50e644=await confirm(_0x3bd639(0x24e)+_0x1435ac+'\x22?');if(!_0x50e644)return console[_0x3bd639(0x24c)](_0x3bd639(0x28a)),0x0;}const _0x509214=await withSpinner(_0x3bd639(0x20c),()=>_0x2cb894[_0x3bd639(0x23a)][_0x3bd639(0x234)](_0x40d73d),{'verbose':_0x3a33eb[_0x3bd639(0x204)]}),_0x7a1279=_0x509214[_0x3bd639(0x1f9)];return console[_0x3bd639(0x24c)]('✔\x20Journey\x20\x22'+_0x7a1279[_0x3bd639(0x2b5)][_0x3bd639(0x273)]+_0x3bd639(0x214)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x1f3);[a27_0x19f833(0x288)]='Resume\x20a\x20paused\x20journey';async[a27_0x19f833(0x291)](_0x54121e){const _0x44e5ba=a27_0x19f833,{options:_0x1df14d,args:_0x3fb439,tdx:_0x1e96fa}=_0x54121e,_0x1dc42e=_0x3fb439[0x0];if(!requireNameOrPath(_0x1dc42e))return 0x1;_0x1df14d['verbose']&&console['error'](_0x44e5ba(0x1dd)+_0x1dc42e);const {journeyId:_0x177b9a,journeyName:_0x285788}=await resolveJourneyIdFromInput(_0x1dc42e,_0x1df14d,_0x1e96fa);if(!_0x1df14d[_0x44e5ba(0x256)]){const _0x2c60b9=await confirm(_0x44e5ba(0x274)+_0x285788+'\x22?');if(!_0x2c60b9)return console[_0x44e5ba(0x24c)](_0x44e5ba(0x28a)),0x0;}const _0x512405=await withSpinner(_0x44e5ba(0x277),()=>_0x1e96fa['journey'][_0x44e5ba(0x1d0)](_0x177b9a),{'verbose':_0x1df14d['verbose']}),_0x52b065=_0x512405[_0x44e5ba(0x1f9)];return console[_0x44e5ba(0x24c)](_0x44e5ba(0x210)+_0x52b065['attributes'][_0x44e5ba(0x273)]+_0x44e5ba(0x1fe)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x19f833(0x20a);[a27_0x19f833(0x288)]=a27_0x19f833(0x208);async[a27_0x19f833(0x291)](_0x128b9a){const _0x17f7c7=a27_0x19f833,{options:_0x1430f0,args:_0x2128fa,tdx:_0x52ade8}=_0x128b9a,_0x42603a=_0x1430f0,_0x4a94a0=_0x2128fa[0x0],_0x1b5f6f=_0x4a94a0&&isYamlFilePath(_0x4a94a0),_0x5c6970=await resolveTarget({'arg':_0x1b5f6f?_0x4a94a0:undefined,'contextParent':_0x1430f0[_0x17f7c7(0x21f)],'cwd':process[_0x17f7c7(0x241)]()});if(!isSuccessfulResolution(_0x5c6970))return _0x5c6970[_0x17f7c7(0x1f2)]===_0x17f7c7(0x230)?(console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x29a)](_0x17f7c7(0x2b6))),console[_0x17f7c7(0x24c)](_0x17f7c7(0x26d)),console['error'](_0x17f7c7(0x1bb)),console[_0x17f7c7(0x24c)](_0x17f7c7(0x278)),console['error'](_0x17f7c7(0x28b))):(console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x201)]('Error:\x20'+_0x5c6970[_0x17f7c7(0x227)]+'\x0a')),_0x5c6970[_0x17f7c7(0x24d)]&&console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1dc)](_0x5c6970['helpText']))),0x1;let _0x380e14=_0x1b5f6f?undefined:_0x4a94a0,_0x56710a,_0x3b320a;_0x5c6970[_0x17f7c7(0x27d)]===_0x17f7c7(0x23b)&&(_0x380e14=_0x5c6970[_0x17f7c7(0x202)],_0x56710a=_0x5c6970[_0x17f7c7(0x1ac)],_0x3b320a=_0x5c6970['folderPath']);const _0x4a2652=_0x5c6970[_0x17f7c7(0x1ae)],_0x27d0ee=_0x5c6970[_0x17f7c7(0x27b)];_0x42603a['verbose']&&(console[_0x17f7c7(0x24c)](_0x17f7c7(0x271)+_0x4a2652),console[_0x17f7c7(0x24c)](_0x17f7c7(0x2a4)+_0x27d0ee),_0x380e14&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x2a1)+_0x380e14),_0x56710a&&console[_0x17f7c7(0x24c)]('Target\x20file:\x20'+_0x56710a),_0x3b320a&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x26e)+_0x3b320a));const _0x1ecc95=await withSpinner(_0x17f7c7(0x244),()=>_0x52ade8[_0x17f7c7(0x235)][_0x17f7c7(0x1e6)](_0x4a2652),{'verbose':_0x1430f0[_0x17f7c7(0x204)]}),_0x592679=_0x1ecc95['data'],{journeys:_0x2ee82d,folders:_0x1b35a0}=await withSpinner(_0x17f7c7(0x263),async()=>{const _0x2ee45e=_0x17f7c7,[_0x57f0ba,_0x14f452]=await Promise[_0x2ee45e(0x1fb)]([_0x52ade8[_0x2ee45e(0x23a)]['listJourneysFromParentSegment'](_0x592679,undefined,{'includeAllVersions':!![]}),_0x52ade8['segment'][_0x2ee45e(0x27c)](_0x592679)]);return{'journeys':_0x57f0ba,'folders':_0x14f452};},{'verbose':_0x1430f0['verbose']})[_0x17f7c7(0x218)](_0x456718=>_0x456718[_0x17f7c7(0x1f9)]);let _0x44aae5=_0x2ee82d;const _0x2c010c=buildFolderIdToPathMap(_0x1b35a0);if(_0x380e14){const _0x36bacb=_0x44aae5[_0x17f7c7(0x1c3)](_0x4d6870=>_0x4d6870[_0x17f7c7(0x23f)]['toLowerCase']()===_0x380e14[_0x17f7c7(0x25a)]());if(_0x36bacb['length']===0x0)return console[_0x17f7c7(0x24c)](_0x17f7c7(0x217)+_0x380e14),console[_0x17f7c7(0x24c)](_0x17f7c7(0x1b2)),0x1;_0x44aae5=_0x36bacb;}if(_0x3b320a!==undefined){const _0xa282e=_0x44aae5[_0x17f7c7(0x1c3)](_0x2493dc=>{const _0x26994c=_0x17f7c7,_0x28aa48=_0x2493dc['folderId']?_0x2c010c[_0x26994c(0x1e5)](_0x2493dc[_0x26994c(0x299)])||'':'';return _0x28aa48===_0x3b320a;});if(_0xa282e[_0x17f7c7(0x206)]===0x0&&_0x44aae5[_0x17f7c7(0x206)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x380e14+_0x17f7c7(0x22b)+(_0x3b320a||_0x17f7c7(0x1b8))),console[_0x17f7c7(0x24c)](_0x17f7c7(0x225));for(const _0x3a30e7 of _0x44aae5){const _0x558429=_0x3a30e7[_0x17f7c7(0x299)]?_0x2c010c[_0x17f7c7(0x1e5)](_0x3a30e7[_0x17f7c7(0x299)])||'':'';console[_0x17f7c7(0x24c)]('\x20\x20-\x20'+(_0x558429||_0x17f7c7(0x1ef))+'/'+_0x3a30e7[_0x17f7c7(0x23f)]);}return 0x1;}_0x44aae5=_0xa282e;}if(_0x44aae5[_0x17f7c7(0x206)]===0x0)return console[_0x17f7c7(0x24c)](_0x17f7c7(0x29e)),0x0;const _0x48e3f8=new Map();for(const _0x3e2a66 of _0x44aae5){const _0x2873f4=_0x3e2a66[_0x17f7c7(0x262)];!_0x48e3f8[_0x17f7c7(0x24a)](_0x2873f4)&&_0x48e3f8[_0x17f7c7(0x1f4)](_0x2873f4,[]),_0x48e3f8[_0x17f7c7(0x1e5)](_0x2873f4)[_0x17f7c7(0x228)](_0x3e2a66);}for(const _0x772000 of _0x48e3f8[_0x17f7c7(0x1d2)]()){_0x772000['sort']((_0x3cfa54,_0x34cd1c)=>(_0x3cfa54['versionNumber']||0x0)-(_0x34cd1c[_0x17f7c7(0x258)]||0x0));}const _0x35991f=[],{idToEmailMap:_0x5098dc,connectionIdToNameMap:_0x9f6c1f}=await withSpinner(_0x17f7c7(0x1c5),async()=>{const _0x7e412f=_0x17f7c7,[_0x293e7f,_0x23c2d1]=await Promise['all']([_0x52ade8[_0x7e412f(0x239)]['buildIdToEmailMap'](),_0x52ade8[_0x7e412f(0x265)][_0x7e412f(0x1c4)]()]);return{'idToEmailMap':_0x293e7f,'connectionIdToNameMap':_0x23c2d1};},{'verbose':_0x1430f0[_0x17f7c7(0x204)]})[_0x17f7c7(0x218)](_0x1b8782=>_0x1b8782[_0x17f7c7(0x1f9)]);for(const _0x317e03 of _0x48e3f8['values']()){const _0x1abb6d=_0x317e03[0x0][_0x17f7c7(0x23f)],_0x684a5=_0x317e03[0x0][_0x17f7c7(0x299)],_0x586dd6=_0x684a5?_0x2c010c[_0x17f7c7(0x1e5)](_0x684a5)||'':'',_0x4b783e=_0x586dd6?a27_0x3be399[_0x17f7c7(0x1c7)](_0x27d0ee,_0x586dd6):_0x27d0ee,_0x439a0a=_0x56710a||a27_0x3be399[_0x17f7c7(0x1c7)](_0x4b783e,sanitizeFileName(_0x1abb6d)+_0x17f7c7(0x221));let _0x43dba8,_0x2bdee3;if(existsSync(_0x439a0a))try{const _0x2634ad=readFileSync(_0x439a0a,'utf-8'),_0x5131f8=parseYamlString(_0x2634ad);_0x2bdee3=_0x5131f8,_0x43dba8=buildRuleToNameMapping(_0x5131f8),_0x42603a[_0x17f7c7(0x204)]&&_0x43dba8[_0x17f7c7(0x25d)]>0x0&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x266)+_0x43dba8[_0x17f7c7(0x25d)]+_0x17f7c7(0x2b1)+_0x1abb6d);}catch(_0x2463cd){_0x42603a[_0x17f7c7(0x204)]&&console['error'](_0x17f7c7(0x294)+_0x2463cd[_0x17f7c7(0x227)]);}const _0x3911c9=[],_0x3d4a39=new Set(),_0x13b5c9=new Map(),_0x162602=new Map(),_0x132b0e=new Set(),_0x415e5f=new Map(),_0x5763f5=new Map(),_0x39ac59=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x1abb6d+'...',async _0x24c1a2=>{const _0x3c7ca5=_0x17f7c7;for(const _0x33ba3f of _0x317e03){const _0x5d5171=_0x317e03['length']>0x1?_0x33ba3f[_0x3c7ca5(0x23f)]+'\x20v'+(_0x33ba3f[_0x3c7ca5(0x258)]||0x1):_0x33ba3f[_0x3c7ca5(0x23f)];_0x24c1a2[_0x3c7ca5(0x249)](_0x3c7ca5(0x295)+_0x5d5171);const _0x21d4d0=await _0x52ade8['journey'][_0x3c7ca5(0x2ad)](_0x33ba3f['id']),_0x273797=_0x21d4d0['attributes']?.['audienceId'],_0x4352a0={'resolveSegment':async _0x3a9249=>{const _0x380baa=_0x3c7ca5;if(!_0x273797)return{'name':_0x3a9249,'isJourneyLocal':![]};const _0x1e06ba=_0x13b5c9['get'](_0x3a9249);if(_0x1e06ba)return _0x1e06ba;try{const _0x3b654d=await _0x52ade8[_0x380baa(0x235)][_0x380baa(0x1f0)](_0x273797,_0x3a9249),_0x3c720a=_0x3b654d[_0x380baa(0x2b4)]===SEGMENT_KIND_JOURNEY;let _0x5d9870,_0x5f3957=_0x3b654d[_0x380baa(0x273)];if(_0x3c720a&&_0x3b654d['rule']){const _0x40a868=await segmentResponseToDef(_0x3b654d,{'resolveSegmentName':async _0xb508f4=>{const _0x46aacd=_0x380baa,_0x14a74d=_0x13b5c9[_0x46aacd(0x1e5)](_0xb508f4);if(_0x14a74d)return _0x14a74d[_0x46aacd(0x273)];const _0x164119=await _0x4352a0[_0x46aacd(0x1ce)](_0xb508f4);return _0x164119[_0x46aacd(0x273)];}}),_0x528685=_0x40a868[_0x380baa(0x25c)];_0x5d9870={'description':_0x3b654d['description'],'rule':_0x528685};const _0x14f23f=serializeRule(_0x528685),_0x1e7270=_0x162602['get'](_0x14f23f);if(_0x1e7270)_0x5f3957=_0x1e7270,_0x5d9870=undefined,_0x42603a[_0x380baa(0x204)]&&console['error'](_0x380baa(0x253)+_0x3b654d[_0x380baa(0x273)]+_0x380baa(0x283)+_0x1e7270);else{let _0xacffb7=![];if(_0x43dba8){const _0x1a69fc=_0x43dba8[_0x380baa(0x1e5)](_0x14f23f);if(_0x1a69fc){const _0x3d6e5e=_0x1a69fc['find'](_0x3cc225=>!_0x3d4a39[_0x380baa(0x24a)](_0x3cc225));_0x3d6e5e&&(_0x5f3957=_0x3d6e5e,_0x3d4a39[_0x380baa(0x1ea)](_0x3d6e5e),_0x162602[_0x380baa(0x1f4)](_0x14f23f,_0x3d6e5e),_0xacffb7=!![],_0x42603a['verbose']&&console[_0x380baa(0x24c)](_0x380baa(0x2af)+_0x3d6e5e+_0x380baa(0x1ed)));}}if(!_0xacffb7){const _0x415f8d=generateJourneyLocalName(_0x3b654d[_0x380baa(0x273)]);_0x415f8d&&(_0x5f3957=_0x415f8d);let _0x54bf11=_0x5f3957,_0x37b71e=0x2;while(_0x3d4a39[_0x380baa(0x24a)](_0x54bf11)){_0x54bf11=_0x5f3957+'_'+_0x37b71e,_0x37b71e++;}_0x3d4a39[_0x380baa(0x1ea)](_0x54bf11),_0x162602[_0x380baa(0x1f4)](_0x14f23f,_0x54bf11),_0x5f3957=_0x54bf11;}}}const _0x551b13={'name':_0x5f3957,'isJourneyLocal':_0x3c720a,'definition':_0x5d9870};return _0x13b5c9['set'](_0x3a9249,_0x551b13),_0x551b13;}catch(_0x12a642){return _0x1430f0[_0x380baa(0x204)]&&console[_0x380baa(0x24c)](_0x380baa(0x26c)+_0x3a9249+':\x20'+_0x12a642[_0x380baa(0x227)]),{'name':_0x3a9249,'isJourneyLocal':![]};}},'resolveActivation':async _0x20556b=>{const _0xadb995=_0x3c7ca5,_0x3922c0=_0x415e5f[_0xadb995(0x1e5)](_0x20556b);if(_0x3922c0)return _0x3922c0;try{const _0x2c7611=await _0x52ade8[_0xadb995(0x23a)][_0xadb995(0x226)](_0x33ba3f['id'],_0x20556b),_0x4dfc1d=journeyActivationStepToYaml(_0x2c7611,_0x5098dc,_0x9f6c1f),_0x3a7d03=JSON[_0xadb995(0x25b)]({'name':_0x4dfc1d[_0xadb995(0x273)],'connection':_0x4dfc1d[_0xadb995(0x265)],'connector_config':_0x4dfc1d['connector_config']}),_0x604f7=_0x5763f5[_0xadb995(0x1e5)](_0x3a7d03);if(_0x604f7){const _0xcadbde={'name':_0x604f7,'isJourneyLocal':!![],'definition':_0x4dfc1d};return _0x415e5f[_0xadb995(0x1f4)](_0x20556b,_0xcadbde),_0xcadbde;}const _0x4cdf2d=_0x2c7611[_0xadb995(0x2b5)]['activationParams']['name']||_0x20556b,_0x44dbb0=sanitizeYamlKey(_0x4cdf2d)||'activation_'+_0x20556b;let _0x31ead7=_0x44dbb0,_0x5272ed=0x2;while(_0x132b0e[_0xadb995(0x24a)](_0x31ead7)){_0x31ead7=_0x44dbb0+'_'+_0x5272ed,_0x5272ed++;}_0x132b0e[_0xadb995(0x1ea)](_0x31ead7),_0x5763f5[_0xadb995(0x1f4)](_0x3a7d03,_0x31ead7);const _0x4069f5={'name':_0x31ead7,'isJourneyLocal':!![],'definition':_0x4dfc1d};return _0x415e5f[_0xadb995(0x1f4)](_0x20556b,_0x4069f5),_0x4069f5;}catch(_0x392e67){return _0x1430f0['verbose']&&console[_0xadb995(0x24c)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x20556b+':\x20'+_0x392e67['message']),{'name':_0x20556b,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x194b01,_0x223e7a)=>{const _0x51bb6e=_0x3c7ca5;return resolveJumpTarget(_0x194b01,_0x223e7a,_0x39ac59,_0x24855b=>_0x52ade8[_0x51bb6e(0x23a)]['getJourney'](_0x24855b));}},_0x3e7db7=await journeyResponseToDef(_0x21d4d0,_0x4352a0);_0x3911c9[_0x3c7ca5(0x228)]({'item':_0x33ba3f,'yaml':_0x3e7db7});}},{'verbose':_0x1430f0[_0x17f7c7(0x204)]});const _0x580f17=await _0x52ade8[_0x17f7c7(0x23a)][_0x17f7c7(0x28e)](_0x317e03[0x0][_0x17f7c7(0x262)]),_0x303afa=buildMergedJourneyDef(_0x3911c9,_0x43dba8,_0x580f17),_0x9eff4d=normalizeJourneyDef(_0x303afa,_0x2bdee3),_0x322544=toYamlString(_0x9eff4d),_0xe67ffb=_0x56710a||a27_0x3be399[_0x17f7c7(0x1c7)](_0x4b783e,sanitizeFileName(_0x1abb6d)+'.yml');!_0x56710a&&_0x586dd6&&!existsSync(_0x4b783e)&&mkdirSync(_0x4b783e,{'recursive':!![]});const _0x3762fc=a27_0x3be399[_0x17f7c7(0x275)](process['cwd'](),_0xe67ffb);if(existsSync(_0xe67ffb)){const _0x3d035b=readFileSync(_0xe67ffb,_0x17f7c7(0x229)),_0x42d9e8=generateDiff(_0x3d035b,_0x322544),_0x142a5a=hasChanges(_0x42d9e8);_0x35991f[_0x17f7c7(0x228)]({'relativePath':_0x3762fc,'absolutePath':_0xe67ffb,'content':_0x322544,'isNew':![],'hasChanges':_0x142a5a,'diff':_0x142a5a?formatDiffWithColors(_0x42d9e8):undefined});}else _0x35991f['push']({'relativePath':_0x3762fc,'absolutePath':_0xe67ffb,'content':_0x322544,'isNew':!![],'hasChanges':![]});}const _0x81c9f=_0x35991f[_0x17f7c7(0x1c3)](_0x537651=>_0x537651['isNew']),_0x5b6695=_0x35991f['filter'](_0x5461b8=>!_0x5461b8[_0x17f7c7(0x220)]&&_0x5461b8[_0x17f7c7(0x1ec)]),_0x5aa4a3=_0x35991f[_0x17f7c7(0x1c3)](_0x503666=>!_0x503666[_0x17f7c7(0x220)]&&!_0x503666[_0x17f7c7(0x1ec)]),_0x538fea=_0x44aae5[_0x17f7c7(0x206)],_0x369eb1=_0x48e3f8[_0x17f7c7(0x25d)],_0x12408c=_0x538fea>_0x369eb1?'\x20('+_0x538fea+_0x17f7c7(0x2b8):'';console[_0x17f7c7(0x24c)](_0x17f7c7(0x1c9)),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['cyan'](_0x369eb1+_0x17f7c7(0x242))+a27_0x50d849['dim'](_0x12408c)),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['green']('+\x20'+_0x81c9f['length']+'\x20new\x20files')),console['error']('\x20\x20'+a27_0x50d849[_0x17f7c7(0x29a)]('~\x20'+_0x5b6695[_0x17f7c7(0x206)]+_0x17f7c7(0x287))),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['dim']('=\x20'+_0x5aa4a3[_0x17f7c7(0x206)]+'\x20unchanged\x20files')),console[_0x17f7c7(0x24c)](_0x17f7c7(0x1d8)+a27_0x50d849[_0x17f7c7(0x1dc)](_0x27d0ee)+'\x0a');if(_0x5b6695[_0x17f7c7(0x206)]>0x0)for(const _0x1c5a96 of _0x5b6695){console[_0x17f7c7(0x24c)](_0x17f7c7(0x1c6)+_0x1c5a96[_0x17f7c7(0x22a)]+'\x27:'),console[_0x17f7c7(0x24c)]('─'['repeat'](0x3c)),console[_0x17f7c7(0x24c)](_0x1c5a96['diff']),console[_0x17f7c7(0x24c)]('─'['repeat'](0x3c));}if(_0x42603a[_0x17f7c7(0x261)])return console['error'](a27_0x50d849[_0x17f7c7(0x29a)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x81c9f[_0x17f7c7(0x206)]===0x0&&_0x5b6695[_0x17f7c7(0x206)]===0x0)return console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)](_0x17f7c7(0x2a5))),saveSessionContext({'parent_segment':_0x4a2652},_0x42603a[_0x17f7c7(0x1ca)]),console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)]('✔\x20Context\x20set:\x20'+a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x289))+_0x17f7c7(0x25f)+a27_0x50d849['cyan'](_0x4a2652))),0x0;if(!_0x42603a[_0x17f7c7(0x256)]&&(_0x81c9f[_0x17f7c7(0x206)]>0x0||_0x5b6695['length']>0x0)){if(!isInteractive())return console['error'](a27_0x50d849[_0x17f7c7(0x201)]('\x0aError:'),_0x17f7c7(0x26b)),console['error'](a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x233))),0x1;const _0x1133ab=await confirmKey(_0x17f7c7(0x264)+(_0x81c9f[_0x17f7c7(0x206)]+_0x5b6695['length'])+_0x17f7c7(0x203));if(!_0x1133ab)return console['error'](a27_0x50d849[_0x17f7c7(0x29a)](_0x17f7c7(0x1e1)),_0x17f7c7(0x28f)),0x1;}!existsSync(_0x27d0ee)&&mkdirSync(_0x27d0ee,{'recursive':!![]});const _0x291ce9=a27_0x3be399[_0x17f7c7(0x1c7)](_0x27d0ee,_0x17f7c7(0x211));writeFileSync(_0x291ce9,createTdxConfigContent(_0x4a2652),_0x17f7c7(0x229));for(const _0x4e69bb of _0x35991f){(_0x4e69bb[_0x17f7c7(0x220)]||_0x4e69bb['hasChanges'])&&writeFileSync(_0x4e69bb[_0x17f7c7(0x259)],_0x4e69bb[_0x17f7c7(0x21c)],'utf-8');}return console['error'](a27_0x50d849['green'](_0x17f7c7(0x2ac)+(_0x81c9f[_0x17f7c7(0x206)]+_0x5b6695[_0x17f7c7(0x206)])+_0x17f7c7(0x1d3)+_0x27d0ee)),saveSessionContext({'parent_segment':_0x4a2652},_0x42603a['session']),console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)]('✔\x20Context\x20set:\x20'+a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x289))+_0x17f7c7(0x25f)+a27_0x50d849[_0x17f7c7(0x1dc)](_0x4a2652))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x19f833(0x1d6);[a27_0x19f833(0x288)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x19f833(0x291)](_0x1e1e7e){const _0x49f550=a27_0x19f833,{options:_0x2781f2,args:_0x3a8d55,tdx:_0x27703d}=_0x1e1e7e,_0x28135e=_0x3a8d55[0x0];if(!requireNameOrPath(_0x28135e))return 0x1;_0x2781f2[_0x49f550(0x204)]&&console[_0x49f550(0x24c)]('Input:\x20'+_0x28135e);const {journeyId:_0x54add4}=await resolveJourneyIdFromInput(_0x28135e,_0x2781f2,_0x27703d),_0x542645=await withSpinner('Getting\x20column\x20mapping...',()=>_0x27703d[_0x49f550(0x23a)][_0x49f550(0x1d7)](_0x54add4),{'verbose':_0x2781f2[_0x49f550(0x204)]}),_0x2bf590=_0x542645[_0x49f550(0x1f9)];return console[_0x49f550(0x28d)](_0x49f550(0x24b)+_0x2bf590[_0x49f550(0x1b9)]),console[_0x49f550(0x28d)](_0x49f550(0x270)+_0x2bf590[_0x49f550(0x252)]),await handleSDKOutput(_0x2bf590[_0x49f550(0x1e0)],_0x2781f2),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x22d);[a27_0x19f833(0x288)]=a27_0x19f833(0x290);async[a27_0x19f833(0x291)](_0x554135){const _0x54eb29=a27_0x19f833,{options:_0x2a5c3c,args:_0x297d94,tdx:_0x2f8d45}=_0x554135,_0xd6b5b8=_0x297d94[0x0];if(!requireNameOrPath(_0xd6b5b8))return 0x1;_0x2a5c3c[_0x54eb29(0x204)]&&console[_0x54eb29(0x24c)](_0x54eb29(0x1dd)+_0xd6b5b8);const {journeyId:_0x33b700}=await resolveJourneyIdFromInput(_0xd6b5b8,_0x2a5c3c,_0x2f8d45),_0x1feebe=await withSpinner('Listing\x20journey\x20activations...',()=>_0x2f8d45[_0x54eb29(0x23a)]['listActivationsFlat'](_0x33b700),{'verbose':_0x2a5c3c[_0x54eb29(0x204)]}),_0x5a70fa=_0x1feebe['data'];return console[_0x54eb29(0x24c)](_0x54eb29(0x266)+_0x5a70fa[_0x54eb29(0x206)]+_0x54eb29(0x2a2)+(_0x5a70fa[_0x54eb29(0x206)]!==0x1?'s':'')),await handleSDKOutput(_0x5a70fa,_0x2a5c3c),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x19f833(0x273)]='journey:push';[a27_0x19f833(0x288)]=a27_0x19f833(0x269);[a27_0x19f833(0x1cf)]=new SegmentPushCommand();async['execute'](_0x23975d){const _0x321d76=a27_0x19f833,_0x20ab19=_0x23975d[_0x321d76(0x245)][0x0];let _0x529c83;if(_0x20ab19){const _0x202dd3=await resolveTarget({'arg':_0x20ab19,'contextParent':_0x23975d[_0x321d76(0x296)][_0x321d76(0x21f)],'cwd':process[_0x321d76(0x241)]()});isSuccessfulResolution(_0x202dd3)&&_0x202dd3[_0x321d76(0x27d)]==='file'&&(_0x529c83=_0x202dd3[_0x321d76(0x1ac)]);}const _0x32d0d0={..._0x23975d,'options':{..._0x23975d['options'],'journeysOnly':!![],..._0x529c83&&{'singleFilePath':_0x529c83}}};return this['segmentPushCommand'][_0x321d76(0x291)](_0x32d0d0);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x236);[a27_0x19f833(0x288)]=a27_0x19f833(0x1ad);async[a27_0x19f833(0x291)](_0x48c85a){const _0x3b3e0c=a27_0x19f833,{options:_0x193e06,args:_0x160f0d,tdx:_0x1f99bf}=_0x48c85a,_0xa8191d=_0x160f0d[0x0];if(!requireNameOrPath(_0xa8191d))return 0x1;if(_0x193e06[_0x3b3e0c(0x204)])console[_0x3b3e0c(0x24c)](_0x3b3e0c(0x1dd)+_0xa8191d);const {journeyId:_0x254a4d}=await resolveJourneyIdFromInput(_0xa8191d,_0x193e06,_0x1f99bf),_0x38695d=await withSpinner(_0x3b3e0c(0x1cc),()=>_0x1f99bf[_0x3b3e0c(0x23a)]['listVersions'](_0x254a4d),{'verbose':_0x193e06['verbose']}),{bundleName:_0x25e71a,versions:_0x1b1021,latestJourneyId:_0x5a19f3}=_0x38695d[_0x3b3e0c(0x1f9)];console['error'](_0x25e71a+':\x20'+_0x1b1021[_0x3b3e0c(0x206)]+_0x3b3e0c(0x2aa)+(_0x1b1021[_0x3b3e0c(0x206)]!==0x1?'s':''));const _0x3f7eb7=_0x1b1021[_0x3b3e0c(0x29c)](_0x2ee19c=>({'version':_0x2ee19c['versionNumber'],'journey_id':_0x2ee19c[_0x3b3e0c(0x279)],'name':_0x2ee19c[_0x3b3e0c(0x273)],'state':_0x2ee19c['state'],'paused':_0x2ee19c['paused'],'latest':_0x2ee19c[_0x3b3e0c(0x279)]===_0x5a19f3,'created_at':_0x2ee19c['createdAt']}));return await handleSDKOutput(_0x3f7eb7,_0x193e06),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';[a27_0x19f833(0x288)]=a27_0x19f833(0x1f5);async[a27_0x19f833(0x291)](_0x55209b){const _0x11fa03=a27_0x19f833,{options:_0x5ab5e2,args:_0x2b0b39,tdx:_0x16ba5a}=_0x55209b,_0x5b038e=_0x2b0b39[0x0];if(!requireNameOrPath(_0x5b038e))return 0x1;if(_0x5ab5e2[_0x11fa03(0x204)])console[_0x11fa03(0x24c)](_0x11fa03(0x1dd)+_0x5b038e);const {journeyId:_0x1c7205,journeyName:_0x54b24c}=await resolveJourneyIdFromInput(_0x5b038e,_0x5ab5e2,_0x16ba5a);if(!_0x5ab5e2[_0x11fa03(0x256)]){const _0x3a24ca=await confirm(_0x11fa03(0x215)+_0x54b24c+'\x22?');if(!_0x3a24ca)return console['error']('Cancelled'),0x0;}const _0x2b5817=await withSpinner('Creating\x20new\x20version...',()=>_0x16ba5a[_0x11fa03(0x23a)][_0x11fa03(0x298)](_0x1c7205),{'verbose':_0x5ab5e2[_0x11fa03(0x204)]}),_0x245e0e=_0x2b5817[_0x11fa03(0x1f9)];return console[_0x11fa03(0x24c)](a27_0x50d849['green']('✔')+_0x11fa03(0x23c)+_0x245e0e['attributes'][_0x11fa03(0x258)]+_0x11fa03(0x257)+_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x273)]+'\x22'),console[_0x11fa03(0x24c)](_0x11fa03(0x281)+_0x245e0e['id']),await handleSingleObjectOutput({'id':_0x245e0e['id'],'name':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x273)],'version':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x258)],'state':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x27f)],'bundle_id':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x262)],'created_at':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x1bd)]},_0x5ab5e2),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x282);[a27_0x19f833(0x288)]=a27_0x19f833(0x200);async['execute'](_0x24b66c){const _0x19dbf3=a27_0x19f833,{options:_0x1623ca,args:_0x52ba31,tdx:_0x23aa84}=_0x24b66c,_0x229b40=_0x52ba31[0x0];if(!requireNameOrPath(_0x229b40))return 0x1;const _0x1291f1=_0x1623ca['version'];if(!_0x1291f1)return console[_0x19dbf3(0x24c)](_0x19dbf3(0x1e9)),console[_0x19dbf3(0x24c)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x18b584=parseInt(_0x1291f1,0xa);if(isNaN(_0x18b584)||_0x18b584<0x1)return console[_0x19dbf3(0x24c)](_0x19dbf3(0x22e)+_0x1291f1),0x1;if(_0x1623ca[_0x19dbf3(0x204)])console['error'](_0x19dbf3(0x1dd)+_0x229b40+_0x19dbf3(0x1e4)+_0x18b584);const {journeyId:_0x2d4f02,parentSegmentId:_0x24f63c}=await resolveJourneyIdFromInput(_0x229b40,_0x1623ca,_0x23aa84),_0x45038b=await withSpinner('Resolving\x20version...',()=>_0x23aa84[_0x19dbf3(0x23a)][_0x19dbf3(0x2b7)](_0x2d4f02),{'verbose':_0x1623ca[_0x19dbf3(0x204)]}),{versions:_0x49773,latestJourneyId:_0x2c86ea}=_0x45038b[_0x19dbf3(0x1f9)],_0x1165e6=_0x49773[_0x19dbf3(0x297)](_0x4b5574=>_0x4b5574[_0x19dbf3(0x258)]===_0x18b584);if(!_0x1165e6){const _0x1e0874=_0x49773[_0x19dbf3(0x29c)](_0x8c653e=>'v'+_0x8c653e['versionNumber'])[_0x19dbf3(0x1c7)](',\x20');return console[_0x19dbf3(0x24c)](_0x19dbf3(0x1eb)+_0x18b584+_0x19dbf3(0x284)+_0x1e0874),0x1;}const _0x132947=await withSpinner(_0x19dbf3(0x1b1)+_0x18b584+_0x19dbf3(0x216),()=>_0x23aa84[_0x19dbf3(0x23a)][_0x19dbf3(0x2ad)](_0x1165e6[_0x19dbf3(0x279)]),{'verbose':_0x1623ca[_0x19dbf3(0x204)]}),_0x1b39bb=_0x132947[_0x19dbf3(0x1f9)],_0x5e6168=getConsoleNextUrl(_0x1623ca['site'],'/app/ps/'+_0x24f63c+_0x19dbf3(0x238)+_0x1165e6['journeyId']+_0x19dbf3(0x2ab));return await handleSingleObjectOutput({'id':_0x1b39bb['id'],'name':_0x1b39bb[_0x19dbf3(0x2b5)]['name'],'version':_0x1b39bb['attributes'][_0x19dbf3(0x258)],'description':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x288)],'state':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x27f)],'paused':_0x1b39bb[_0x19dbf3(0x2b5)]['paused'],'reentry_mode':_0x1b39bb[_0x19dbf3(0x2b5)]['reentryMode'],'stages':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x21a)]?.[_0x19dbf3(0x206)]||0x0,..._0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x268)]&&{'goal':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x268)][_0x19dbf3(0x273)]},'latest':_0x1165e6[_0x19dbf3(0x279)]===_0x2c86ea,'created_at':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x1bd)],'updated_at':_0x1b39bb['attributes'][_0x19dbf3(0x272)],'url':_0x5e6168},_0x1623ca),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0xa4d9a4=a28_0xac02;(function(_0x977a3f,_0x27171a){const _0x3b0ae0=a28_0xac02,_0x1272e2=_0x977a3f();while(!![]){try{const _0x5feded=parseInt(_0x3b0ae0(0xe8))/0x1*(-parseInt(_0x3b0ae0(0xc7))/0x2)+-parseInt(_0x3b0ae0(0xcb))/0x3*(-parseInt(_0x3b0ae0(0xcd))/0x4)+parseInt(_0x3b0ae0(0xd3))/0x5*(parseInt(_0x3b0ae0(0xf4))/0x6)+parseInt(_0x3b0ae0(0xe4))/0x7+parseInt(_0x3b0ae0(0xec))/0x8*(-parseInt(_0x3b0ae0(0xe3))/0x9)+parseInt(_0x3b0ae0(0xe1))/0xa*(parseInt(_0x3b0ae0(0xd5))/0xb)+-parseInt(_0x3b0ae0(0xe9))/0xc*(parseInt(_0x3b0ae0(0xfb))/0xd);if(_0x5feded===_0x27171a)break;else _0x1272e2['push'](_0x1272e2['shift']());}catch(_0x3cbf77){_0x1272e2['push'](_0x1272e2['shift']());}}}(a28_0x33cc,0x4f242));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x33cc(){const _0x214e75=['395DQhKgT','\x20warning(s)\x20found','1157739SGBgdY','validCount','length','reason','Error:\x20Directory\x20not\x20found:\x20','cyan','yellow','cwd','error','filter','warningCount','\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','10AVCqvs','.yml','3123fiwWge','3978030mdQTDK','journey:validate','errors','warnings','12433XturGk','170748VLOSzV','skippedCount','helpText','11576RzHFoY','verbose','name','log','\x20journey(s)\x20with\x20errors,\x20','Validate\x20journey\x20YAML\x20files','\x20(skipped:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','35466xRsNyZ','red','targetDir','\x20segment\x20file(s)\x20skipped','No\x20journey\x20YAML\x20files\x20found\x20in\x20','valid','file','52VWYHzO','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20valid','description','type','no_parent','46WteZQS','parentSegment','\x20segment\x20file(s)\x20skipped)','endsWith','9ZSbQYG','dim','38184PrPyaz','invalidCount','errorCode','✔\x20All\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a28_0x33cc=function(){return _0x214e75;};return a28_0x33cc();}import{existsSync}from'fs';import a28_0x511ef6 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0xac02(_0x5b493d,_0x3440a8){_0x5b493d=_0x5b493d-0xc6;const _0x33cce6=a28_0x33cc();let _0xac023d=_0x33cce6[_0x5b493d];return _0xac023d;}export class JourneyValidateCommand extends BaseCommand{[a28_0xa4d9a4(0xee)]=a28_0xa4d9a4(0xe5);[a28_0xa4d9a4(0xfe)]=a28_0xa4d9a4(0xf1);async['execute'](_0x3df3c8){const _0x523619=a28_0xa4d9a4,{options:_0x1383c6,args:_0x190dbf}=_0x3df3c8,_0x2acee3=_0x1383c6,_0x2f7448=await resolveTarget({'arg':_0x190dbf[0x0],'contextParent':_0x1383c6[_0x523619(0xc8)],'cwd':process[_0x523619(0xdc)]()});if(!isSuccessfulResolution(_0x2f7448))return _0x2f7448[_0x523619(0xcf)]===_0x523619(0xc6)?(console['error'](a28_0x511ef6[_0x523619(0xdb)](_0x523619(0xd2))),console[_0x523619(0xdd)](_0x523619(0xfc)),console[_0x523619(0xdd)](_0x523619(0xe0)),console[_0x523619(0xdd)](_0x523619(0xf3))):(console['error'](a28_0x511ef6[_0x523619(0xf5)]('Error:\x20'+_0x2f7448['message']+'\x0a')),_0x2f7448[_0x523619(0xeb)]&&console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xda)](_0x2f7448[_0x523619(0xeb)]))),0x1;const _0x4b3ea7=_0x2f7448[_0x523619(0xf6)],_0x42fc57=_0x2f7448[_0x523619(0xff)]===_0x523619(0xfa)?_0x2f7448['filePath']:undefined;if(!_0x42fc57&&!existsSync(_0x4b3ea7))return console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xf5)](_0x523619(0xd9)+_0x4b3ea7+'\x0a')),0x1;let _0x3017d8;if(_0x42fc57){if(!_0x42fc57[_0x523619(0xca)](_0x523619(0xe2))&&!_0x42fc57[_0x523619(0xca)]('.yaml'))return console[_0x523619(0xdd)](a28_0x511ef6['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x42fc57+'\x0a')),0x1;_0x3017d8=[_0x42fc57];}else _0x3017d8=findYamlFiles(_0x4b3ea7);if(_0x3017d8[_0x523619(0xd7)]===0x0)return console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xf5)](_0x523619(0xd1)+_0x4b3ea7+'\x0a')),0x1;const _0x585c68=validateYamlFiles(_0x3017d8,_0x4b3ea7,{'filterType':'journey'}),_0x2852c1=calculateSummary(_0x585c68),_0x8e9329=_0x585c68[_0x523619(0xde)](isValidationResult);if(_0x8e9329['length']===0x0)return console[_0x523619(0xdd)](a28_0x511ef6['yellow'](_0x523619(0xf8)+_0x4b3ea7+'\x0a')),_0x2852c1[_0x523619(0xea)]>0x0&&console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xcc)]('('+_0x2852c1[_0x523619(0xea)]+_0x523619(0xc9))),0x0;for(const _0x21e0e8 of _0x585c68){if(!isValidationResult(_0x21e0e8)){_0x2acee3['verbose']&&console['log'](a28_0x511ef6['dim']('-\x20'+_0x21e0e8['relativePath']+_0x523619(0xf2)+_0x21e0e8[_0x523619(0xd8)]+')'));continue;}const {relativePath:_0x3231fa,source:_0x561608,result:_0xcab201}=_0x21e0e8;if(_0xcab201['valid']&&_0xcab201['warnings'][_0x523619(0xd7)]===0x0)_0x2acee3[_0x523619(0xed)]&&console[_0x523619(0xef)](a28_0x511ef6['green']('✔\x20'+_0x3231fa));else _0xcab201[_0x523619(0xf9)]?(console['log'](a28_0x511ef6[_0x523619(0xdb)]('⚠\x20'+_0x3231fa+':\x20'+_0xcab201[_0x523619(0xe7)][_0x523619(0xd7)]+'\x20warning(s)')),console[_0x523619(0xef)](formatValidationResult(_0xcab201,_0x561608,_0x3231fa))):(console['log'](a28_0x511ef6[_0x523619(0xf5)]('✖\x20'+_0x3231fa+':\x20'+_0xcab201[_0x523619(0xe6)][_0x523619(0xd7)]+'\x20error(s)')),console['log'](formatValidationResult(_0xcab201,_0x561608,_0x3231fa)));}return console['log'](''),_0x2852c1['hasErrors']?(console[_0x523619(0xef)](a28_0x511ef6['red']('Validation\x20failed:\x20'+_0x2852c1[_0x523619(0xce)]+_0x523619(0xf0)+_0x2852c1[_0x523619(0xd6)]+_0x523619(0xfd))),_0x2852c1['warningCount']>0x0&&console['log'](a28_0x511ef6[_0x523619(0xdb)](_0x2852c1[_0x523619(0xdf)]+_0x523619(0xd4))),_0x2852c1[_0x523619(0xea)]>0x0&&console[_0x523619(0xef)](a28_0x511ef6['dim'](_0x2852c1[_0x523619(0xea)]+_0x523619(0xf7))),0x1):(console[_0x523619(0xef)](a28_0x511ef6['green'](_0x523619(0xd0)+_0x2852c1[_0x523619(0xd6)]+'\x20journey(s)\x20valid')),_0x2852c1['warningCount']>0x0&&console[_0x523619(0xef)](a28_0x511ef6[_0x523619(0xdb)](_0x2852c1['warningCount']+_0x523619(0xd4))),_0x2852c1['skippedCount']>0x0&&console[_0x523619(0xef)](a28_0x511ef6[_0x523619(0xcc)](_0x2852c1[_0x523619(0xea)]+_0x523619(0xf7))),0x0);}}
|