@treasuredata/tdx 2026.3.34 → 2026.3.36
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/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x6493bb=a26_0x5503;(function(_0xfde547,_0x10392f){const _0x2aac39=a26_0x5503,_0x45120b=_0xfde547();while(!![]){try{const _0x18fec7=parseInt(_0x2aac39(0x212))/0x1+-parseInt(_0x2aac39(0x1ed))/0x2*(-parseInt(_0x2aac39(0x1fd))/0x3)+parseInt(_0x2aac39(0x1e5))/0x4*(-parseInt(_0x2aac39(0x20e))/0x5)+parseInt(_0x2aac39(0x1f2))/0x6*(-parseInt(_0x2aac39(0x1f9))/0x7)+parseInt(_0x2aac39(0x1ff))/0x8+-parseInt(_0x2aac39(0x206))/0x9+parseInt(_0x2aac39(0x20c))/0xa;if(_0x18fec7===_0x10392f)break;else _0x45120b['push'](_0x45120b['shift']());}catch(_0x31a41a){_0x45120b['push'](_0x45120b['shift']());}}}(a26_0x3c17,0x99e92));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x3cca94 from'chalk';function a26_0x5503(_0x279ab9,_0x355fb0){_0x279ab9=_0x279ab9-0x1e3;const _0x3c1792=a26_0x3c17();let _0x5503ba=_0x3c1792[_0x279ab9];return _0x5503ba;}import a26_0xcffe4f from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a26_0x3c17(){const _0x3fce76=['\x20valid','✔\x20All\x20','cwd','4iSSLMc','\x20non-template\x20file(s)\x20skipped)','.yml','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','skippedCount','green','invalidCount','4NxzILJ','\x20warning(s)\x20found','engage:template:validate','\x20(skipped:\x20','length','6DycnKf','description','red','dim','\x20template(s)\x20valid','resolve','yellow','1493282DmolJh','reason','relativePath','\x20non-template\x20file(s)\x20skipped','1061745wRcxKa','execute','1570304xhBzCN','error','dirname','\x20warning(s)','warnings','endsWith','\x20template(s)\x20with\x20errors,\x20','9143064mXbJsF','\x20error(s)','template','log','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','verbose','9204120QfTXVz','validCount','2690735udYrKy','errors','valid','.yaml','573257JZzBdG','filter'];a26_0x3c17=function(){return _0x3fce76;};return a26_0x3c17();}export class EngageTemplateValidateCommand extends BaseCommand{['name']=a26_0x6493bb(0x1ef);[a26_0x6493bb(0x1f3)]='Validate\x20template\x20YAML\x20files';async[a26_0x6493bb(0x1fe)](_0x4d3377){const _0xc056d5=a26_0x6493bb,{options:_0x57fa4d,args:_0x64518a}=_0x4d3377,_0x7f2e4d=_0x57fa4d,_0x58cf49=_0x64518a[0x0],_0xa71402=_0x58cf49?a26_0xcffe4f[_0xc056d5(0x1f7)](_0x58cf49):undefined,_0x1b71d4=_0xa71402?isYamlFile(_0xa71402):![];let _0xf82a37,_0x1eaecc;if(_0x1b71d4&&_0xa71402)_0xf82a37=a26_0xcffe4f[_0xc056d5(0x201)](_0xa71402),_0x1eaecc=_0xa71402;else _0xa71402?_0xf82a37=_0xa71402:_0xf82a37=process[_0xc056d5(0x1e4)]();if(!_0x1eaecc&&!existsSync(_0xf82a37))return console[_0xc056d5(0x200)](a26_0x3cca94[_0xc056d5(0x1f4)](_0xc056d5(0x1e8)+_0xf82a37+'\x0a')),0x1;let _0x324662;if(_0x1eaecc){if(!_0x1eaecc['endsWith'](_0xc056d5(0x1e7))&&!_0x1eaecc[_0xc056d5(0x204)](_0xc056d5(0x211)))return console[_0xc056d5(0x200)](a26_0x3cca94[_0xc056d5(0x1f4)](_0xc056d5(0x1e9)+_0x1eaecc+'\x0a')),0x1;_0x324662=[_0x1eaecc];}else _0x324662=findYamlFiles(_0xf82a37);if(_0x324662['length']===0x0)return console[_0xc056d5(0x200)](a26_0x3cca94['red'](_0xc056d5(0x20a)+_0xf82a37+'\x0a')),0x1;const _0x411ac2=validateYamlFiles(_0x324662,_0xf82a37,{'filterType':_0xc056d5(0x208)}),_0xda445f=calculateSummary(_0x411ac2),_0x3cda7f=_0x411ac2[_0xc056d5(0x213)](isValidationResult);if(_0x3cda7f['length']===0x0)return console[_0xc056d5(0x200)](a26_0x3cca94[_0xc056d5(0x1f8)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0xf82a37+'\x0a')),_0xda445f[_0xc056d5(0x1ea)]>0x0&&console[_0xc056d5(0x200)](a26_0x3cca94[_0xc056d5(0x1f5)]('('+_0xda445f[_0xc056d5(0x1ea)]+_0xc056d5(0x1e6))),0x0;for(const _0x3be4a4 of _0x411ac2){if(!isValidationResult(_0x3be4a4)){_0x7f2e4d[_0xc056d5(0x20b)]&&console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f5)]('-\x20'+_0x3be4a4[_0xc056d5(0x1fb)]+_0xc056d5(0x1f0)+_0x3be4a4[_0xc056d5(0x1fa)]+')'));continue;}const {relativePath:_0x4a6800,source:_0x3772af,result:_0x3faab3}=_0x3be4a4;if(_0x3faab3[_0xc056d5(0x210)]&&_0x3faab3[_0xc056d5(0x203)][_0xc056d5(0x1f1)]===0x0)_0x7f2e4d[_0xc056d5(0x20b)]&&console['log'](a26_0x3cca94['green']('✔\x20'+_0x4a6800));else _0x3faab3['valid']?(console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f8)]('⚠\x20'+_0x4a6800+':\x20'+_0x3faab3['warnings'][_0xc056d5(0x1f1)]+_0xc056d5(0x202))),console[_0xc056d5(0x209)](formatValidationResult(_0x3faab3,_0x3772af,_0x4a6800))):(console[_0xc056d5(0x209)](a26_0x3cca94['red']('✖\x20'+_0x4a6800+':\x20'+_0x3faab3[_0xc056d5(0x20f)][_0xc056d5(0x1f1)]+_0xc056d5(0x207))),console[_0xc056d5(0x209)](formatValidationResult(_0x3faab3,_0x3772af,_0x4a6800)));}return console[_0xc056d5(0x209)](''),_0xda445f['hasErrors']?(console[_0xc056d5(0x209)](a26_0x3cca94['red']('Validation\x20failed:\x20'+_0xda445f[_0xc056d5(0x1ec)]+_0xc056d5(0x205)+_0xda445f['validCount']+_0xc056d5(0x214))),_0xda445f['warningCount']>0x0&&console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f8)](_0xda445f['warningCount']+_0xc056d5(0x1ee))),_0xda445f['skippedCount']>0x0&&console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f5)](_0xda445f[_0xc056d5(0x1ea)]+_0xc056d5(0x1fc))),0x1):(console['log'](a26_0x3cca94[_0xc056d5(0x1eb)](_0xc056d5(0x1e3)+_0xda445f[_0xc056d5(0x20d)]+_0xc056d5(0x1f6))),_0xda445f['warningCount']>0x0&&console[_0xc056d5(0x209)](a26_0x3cca94[_0xc056d5(0x1f8)](_0xda445f['warningCount']+_0xc056d5(0x1ee))),_0xda445f['skippedCount']>0x0&&console['log'](a26_0x3cca94['dim'](_0xda445f[_0xc056d5(0x1ea)]+_0xc056d5(0x1fc))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x3a1f23=a27_0x47cc;function a27_0x47cc(_0x54a56b,_0x16441c){_0x54a56b=_0x54a56b-0xb9;const _0x117792=a27_0x1177();let _0x47cc7d=_0x117792[_0x54a56b];return _0x47cc7d;}(function(_0x164be6,_0x444db6){const _0x4a5092=a27_0x47cc,_0x2c6763=_0x164be6();while(!![]){try{const _0x52f3b8=-parseInt(_0x4a5092(0xcd))/0x1*(parseInt(_0x4a5092(0xdd))/0x2)+-parseInt(_0x4a5092(0x104))/0x3*(-parseInt(_0x4a5092(0xe3))/0x4)+-parseInt(_0x4a5092(0xdf))/0x5+-parseInt(_0x4a5092(0xef))/0x6+parseInt(_0x4a5092(0xda))/0x7+-parseInt(_0x4a5092(0x109))/0x8+-parseInt(_0x4a5092(0xbd))/0x9*(-parseInt(_0x4a5092(0x105))/0xa);if(_0x52f3b8===_0x444db6)break;else _0x2c6763['push'](_0x2c6763['shift']());}catch(_0x8630d7){_0x2c6763['push'](_0x2c6763['shift']());}}}(a27_0x1177,0xf3a69));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x5be4ff from'chalk';function formatDuration(_0x17af83){const _0x10ccac=a27_0x47cc;if(_0x17af83<0x3c)return _0x17af83+'s';if(_0x17af83<0xe10)return Math['floor'](_0x17af83/0x3c)+'m\x20'+_0x17af83%0x3c+'s';const _0x533331=Math[_0x10ccac(0xc2)](_0x17af83/0xe10),_0xcdfef0=Math['floor'](_0x17af83%0xe10/0x3c);return _0xcdfef0>0x0?_0x533331+'h\x20'+_0xcdfef0+'m':_0x533331+'h';}function a27_0x1177(){const _0x4d8c50=['verbose','length','jobs','trino','success','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','3846VZUEXA','10rDtVDS','Query:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','end_at','12246928DOBMaQ','\x20job','file','\x20row','name','getTime','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Kill\x20a\x20job','information_schema','log','Getting\x20job\x20details...','Submitting\x20job...','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job:result','m\x20ago','Listing\x20jobs...','debug','41317407jogfRC','Limit:\x20','just\x20now','yes','abs','floor','Status\x20filter:\x20','round','✔\x20Job\x20submitted','job_id','args','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','site','\x20jobs','push','presto','3pQrEdL','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','user_name','list','priority','result','start_at','No\x20SQL\x20statements\x20found\x20in\x20file','Submit\x20a\x20job','show','status','validate','job:show','384776pTGquc','d\x20ago','green','87732IrnxIC','\x20\x20Job\x20ID:\x20','9795545BLCPif','kill','submit','database','1228WudlJa','query','error','Get\x20job\x20results','✔\x20Retrieved\x20','job:kill','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','description','now','Show\x20job\x20details','join','2518794FIeFJR','red','data','substring','execute','\x27\x20to\x20verify\x20the\x20job\x20status','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Cancelled','dim','type','created_at','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','...','url'];a27_0x1177=function(){return _0x4d8c50;};return a27_0x1177();}function formatRelativeTime(_0x435c6f){const _0x35cd88=a27_0x47cc,_0x8ab0de=Date[_0x35cd88(0xec)]()-_0x435c6f['getTime'](),_0x12721c=Math['floor'](Math[_0x35cd88(0xc1)](_0x8ab0de)/0x3e8);if(_0x12721c<0x3c)return _0x35cd88(0xbf);const _0x1be853=Math['floor'](_0x12721c/0x3c);if(_0x1be853<0x3c)return _0x1be853+_0x35cd88(0xba);const _0x2acdcb=Math[_0x35cd88(0xc2)](_0x1be853/0x3c);if(_0x2acdcb<0x18)return _0x2acdcb+'h\x20ago';const _0x4c5901=Math[_0x35cd88(0xc2)](_0x2acdcb/0x18);if(_0x4c5901<0x1e)return _0x4c5901+_0x35cd88(0xdb);return Math['floor'](_0x4c5901/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0x100);['description']=a27_0x3a1f23(0xf5);async['execute'](_0x484fca){const _0x579016=a27_0x3a1f23,{options:_0x559115,tdx:_0x5982cf}=_0x484fca,_0x118958=resolveLimit(_0x559115['limit'],DEFAULT_DISPLAY_LIMIT),_0x57b4bc=_0x559115[_0x579016(0xd7)];_0x559115['verbose']&&(console['error'](_0x579016(0xbe)+_0x118958+_0x579016(0xca)),_0x57b4bc&&console['error'](_0x579016(0xc3)+_0x57b4bc));const _0x21ad68=await withSpinner(_0x579016(0xbb),()=>_0x5982cf[_0x579016(0x100)][_0x579016(0xd0)]({'from':0x0,'to':_0x118958-0x1,'status':_0x57b4bc}),{'verbose':_0x559115[_0x579016(0xfe)]}),_0x29f6b2=_0x21ad68['data'];console[_0x579016(0xe5)]('✔\x20Found\x20'+_0x29f6b2[_0x579016(0xff)]+_0x579016(0x10a)+(_0x29f6b2['length']!==0x1?'s':''));const _0x266017=_0x559115[_0x579016(0xc9)];if(isStructuredFormat(_0x559115)){const _0x3f2be9=_0x29f6b2['map'](_0x443ba2=>{const _0x236ead=_0x579016;let _0x56aa51;if(_0x443ba2[_0x236ead(0xd3)]&&_0x443ba2[_0x236ead(0x108)]){const _0x3673c9=new Date(_0x443ba2[_0x236ead(0xd3)])[_0x236ead(0x10e)](),_0x45d5e9=new Date(_0x443ba2[_0x236ead(0x108)])[_0x236ead(0x10e)]();_0x56aa51=Math[_0x236ead(0xc4)]((_0x45d5e9-_0x3673c9)/0x3e8);}return{'job_id':_0x443ba2[_0x236ead(0xc6)],'type':_0x443ba2['type']==='presto'?_0x236ead(0x101):_0x443ba2[_0x236ead(0xf9)],'status':_0x443ba2['status'],'user_name':_0x443ba2[_0x236ead(0xcf)],'duration_sec':_0x56aa51,'created_at':_0x443ba2[_0x236ead(0xfa)],'started_at':_0x443ba2[_0x236ead(0xd3)],'end_at':_0x443ba2[_0x236ead(0x108)]};});await handleSDKOutput(_0x3f2be9,_0x559115);}else for(const _0x49f548 of _0x29f6b2){const _0x33a558=_0x49f548[_0x579016(0xd7)]===_0x579016(0x102)?a27_0x5be4ff[_0x579016(0xdc)]:_0x49f548[_0x579016(0xd7)]===_0x579016(0xe5)?a27_0x5be4ff[_0x579016(0xf0)]:a27_0x5be4ff['dim'],_0x3d32c3=_0x33a558(_0x49f548[_0x579016(0xd7)]),_0x104837=getJobUrl(_0x266017,_0x49f548['job_id']),_0x14afbf=hyperlink(_0x49f548[_0x579016(0xc6)],_0x104837),_0x1c43ac=a27_0x5be4ff[_0x579016(0xf8)](_0x49f548[_0x579016(0xf9)]===_0x579016(0xcc)?_0x579016(0x101):_0x49f548[_0x579016(0xf9)]),_0x4cb8b4=[];if(_0x49f548['start_at']&&_0x49f548[_0x579016(0x108)]){const _0x2015a3=Math[_0x579016(0xc4)]((new Date(_0x49f548['end_at'])[_0x579016(0x10e)]()-new Date(_0x49f548[_0x579016(0xd3)])[_0x579016(0x10e)]())/0x3e8);_0x4cb8b4[_0x579016(0xcb)](formatDuration(_0x2015a3));}if(_0x49f548[_0x579016(0x108)])_0x4cb8b4['push'](formatRelativeTime(new Date(_0x49f548[_0x579016(0x108)])));else _0x49f548['start_at']&&_0x4cb8b4['push'](formatRelativeTime(new Date(_0x49f548[_0x579016(0xd3)])));const _0x261911=_0x4cb8b4[_0x579016(0xff)]>0x0?a27_0x5be4ff['dim']('\x20'+_0x4cb8b4[_0x579016(0xee)](',\x20')):'';console[_0x579016(0x112)]('⚡\x20'+_0x14afbf+'\x20'+_0x1c43ac+'\x20'+_0x3d32c3+_0x261911);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xd9);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0xed);[a27_0x3a1f23(0xd8)](_0x52417){const _0x34c942=a27_0x3a1f23,_0x47ecaf=_0x52417[_0x34c942(0xc7)][0x0];if(!_0x47ecaf)return _0x34c942(0xea);return undefined;}async[a27_0x3a1f23(0xf3)](_0x2f7027){const _0x4eda61=a27_0x3a1f23,{options:_0x26818e,args:_0x5ec631,tdx:_0x17b7c2}=_0x2f7027,_0x51d9c2=_0x5ec631[0x0],_0x35fb0a=await withSpinner(_0x4eda61(0x113),()=>_0x17b7c2[_0x4eda61(0x100)][_0x4eda61(0xd6)](_0x51d9c2),{'verbose':_0x26818e[_0x4eda61(0xfe)]}),_0x17f393=_0x35fb0a['data'];let _0x4308a0;if(_0x17f393[_0x4eda61(0xd3)]&&_0x17f393[_0x4eda61(0x108)]){const _0x5079bf=new Date(_0x17f393[_0x4eda61(0xd3)])['getTime'](),_0x2104e3=new Date(_0x17f393[_0x4eda61(0x108)])[_0x4eda61(0x10e)]();_0x4308a0=Math[_0x4eda61(0xc4)]((_0x2104e3-_0x5079bf)/0x3e8);}const _0x3bf383={'job_id':_0x17f393[_0x4eda61(0xc6)],'type':_0x17f393['type'],'status':_0x17f393[_0x4eda61(0xd7)],..._0x17f393[_0x4eda61(0xcf)]&&{'user_name':_0x17f393[_0x4eda61(0xcf)]},..._0x4308a0!==undefined&&{'duration_sec':_0x4308a0},..._0x17f393[_0x4eda61(0xfa)]&&{'created_at':_0x17f393['created_at']},..._0x17f393['start_at']&&{'started_at':_0x17f393['start_at']},..._0x17f393[_0x4eda61(0x108)]&&{'end_at':_0x17f393['end_at']},..._0x17f393['database']&&{'database':_0x17f393[_0x4eda61(0xe2)]},..._0x17f393[_0x4eda61(0xd1)]!==undefined&&{'priority':_0x17f393[_0x4eda61(0xd1)]},..._0x17f393[_0x4eda61(0xfd)]&&{'url':_0x17f393[_0x4eda61(0xfd)]},..._0x17f393[_0x4eda61(0xe4)]&&{'query':_0x17f393[_0x4eda61(0xe4)]},..._0x17f393[_0x4eda61(0xbc)]&&{'debug':_0x17f393[_0x4eda61(0xbc)]}};return await handleSingleObjectOutput(_0x3bf383,_0x26818e),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xe8);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0x110);[a27_0x3a1f23(0xd8)](_0x36ab59){const _0x2cc145=a27_0x3a1f23,_0x4721e=_0x36ab59['args'][0x0];if(!_0x4721e)return _0x2cc145(0xf6);return undefined;}async[a27_0x3a1f23(0xf3)](_0xe3d9b7){const _0x2f0589=a27_0x3a1f23,{options:_0x2c906b,args:_0xd63c38,tdx:_0x2b1bad}=_0xe3d9b7,_0x455889=_0xd63c38[0x0];if(!_0x2c906b[_0x2f0589(0xc0)]){const _0x3b4bd7=await confirm(_0x2f0589(0xfb)+_0x455889+'?');if(!_0x3b4bd7)return console['error'](_0x2f0589(0xf7)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2b1bad[_0x2f0589(0x100)][_0x2f0589(0xe0)](_0x455889),{'verbose':_0x2c906b[_0x2f0589(0xfe)]}),console[_0x2f0589(0xe5)](_0x2f0589(0xc8)+_0x455889),console['error'](_0x2f0589(0x103)+_0x455889+_0x2f0589(0xf4)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]='job:submit';['description']=a27_0x3a1f23(0xd5);async[a27_0x3a1f23(0xf3)](_0x31d990){const _0x3a231f=a27_0x3a1f23,{options:_0x36b158,args:_0x2a5ee2,tdx:_0x5ce0fb}=_0x31d990,_0x6616cc=_0x36b158['jobType']||_0x3a231f(0x101),_0x215163=_0x36b158[_0x3a231f(0x10b)],_0x9930e5=_0x36b158[_0x3a231f(0xe2)]||_0x3a231f(0x111),_0x40e440=_0x36b158[_0x3a231f(0xd2)];if(_0x6616cc!=='trino'&&_0x6616cc!=='hive')throw new SDKError(ErrorCode[_0x3a231f(0xe9)],_0x3a231f(0x10f));let _0x89b8a;if(_0x215163){if(_0x2a5ee2[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3a231f(0xce));const _0x38c7fa=readSqlStatementsFromFile(_0x215163);if(_0x38c7fa[_0x3a231f(0xff)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3a231f(0xd4));if(_0x38c7fa['length']>0x1)throw new SDKError(ErrorCode[_0x3a231f(0xe9)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x89b8a=_0x38c7fa[0x0];}else{if(!_0x2a5ee2[0x0])throw new SDKError(ErrorCode[_0x3a231f(0xe9)],_0x3a231f(0x115));_0x89b8a=_0x2a5ee2[0x0];}_0x36b158[_0x3a231f(0xfe)]&&(console[_0x3a231f(0xe5)]('Job\x20type:\x20'+_0x6616cc),console[_0x3a231f(0xe5)]('Database:\x20'+_0x9930e5),console['error'](_0x3a231f(0x106)+_0x89b8a[_0x3a231f(0xf2)](0x0,0x64)+(_0x89b8a['length']>0x64?_0x3a231f(0xfc):'')));const _0x2ad675=await withSpinner(_0x3a231f(0x114),()=>_0x5ce0fb[_0x3a231f(0x100)][_0x3a231f(0xe1)](_0x9930e5,_0x89b8a,_0x6616cc,_0x40e440),{'verbose':_0x36b158['verbose']}),_0x3bd794=_0x2ad675[_0x3a231f(0xf1)];return console[_0x3a231f(0xe5)](_0x3a231f(0xc5)),console[_0x3a231f(0xe5)](_0x3a231f(0xde)+_0x3bd794[_0x3a231f(0xc6)]),await handleSDKOutput([_0x3bd794],_0x36b158),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xb9);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0xe6);['validate'](_0x35095d){const _0x12e5db=a27_0x3a1f23,_0x1b94de=_0x35095d[_0x12e5db(0xc7)][0x0];if(!_0x1b94de)return _0x12e5db(0x107);return undefined;}async[a27_0x3a1f23(0xf3)](_0x248bb2){const _0x556be8=a27_0x3a1f23,{options:_0x2b6b38,args:_0x1eb123,tdx:_0x563ae7}=_0x248bb2,_0xa7cfe3=_0x1eb123[0x0],_0x464dfa=await withSpinner('Getting\x20job\x20results...',()=>_0x563ae7[_0x556be8(0x100)][_0x556be8(0xd2)](_0xa7cfe3),{'verbose':_0x2b6b38[_0x556be8(0xfe)]}),_0x48981d=_0x464dfa[_0x556be8(0xf1)];return console[_0x556be8(0xe5)](_0x556be8(0xe7)+_0x48981d[_0x556be8(0xff)]+_0x556be8(0x10c)+(_0x48981d[_0x556be8(0xff)]!==0x1?'s':'')),await handleSDKOutput(_0x48981d,_0x2b6b38),0x0;}}
|
|
1
|
+
const a27_0x151d54=a27_0x968c;(function(_0xb29082,_0x27ddff){const _0x56a1b2=a27_0x968c,_0x4e372f=_0xb29082();while(!![]){try{const _0xf3b694=parseInt(_0x56a1b2(0x1b6))/0x1+-parseInt(_0x56a1b2(0x19f))/0x2+parseInt(_0x56a1b2(0x1ae))/0x3+-parseInt(_0x56a1b2(0x1b3))/0x4*(-parseInt(_0x56a1b2(0x1ac))/0x5)+parseInt(_0x56a1b2(0x19d))/0x6*(-parseInt(_0x56a1b2(0x180))/0x7)+parseInt(_0x56a1b2(0x196))/0x8+parseInt(_0x56a1b2(0x1aa))/0x9;if(_0xf3b694===_0x27ddff)break;else _0x4e372f['push'](_0x4e372f['shift']());}catch(_0x26c310){_0x4e372f['push'](_0x4e372f['shift']());}}}(a27_0x2299,0x3cdeb));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x968c(_0x21c7d4,_0x1abe3b){_0x21c7d4=_0x21c7d4-0x17d;const _0x229982=a27_0x2299();let _0x968cde=_0x229982[_0x21c7d4];return _0x968cde;}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x3f4e30 from'chalk';function formatDuration(_0x35d470){const _0x41b39a=a27_0x968c;if(_0x35d470<0x3c)return _0x35d470+'s';if(_0x35d470<0xe10)return Math[_0x41b39a(0x1c1)](_0x35d470/0x3c)+'m\x20'+_0x35d470%0x3c+'s';const _0x220423=Math[_0x41b39a(0x1c1)](_0x35d470/0xe10),_0x4e5be0=Math['floor'](_0x35d470%0xe10/0x3c);return _0x4e5be0>0x0?_0x220423+'h\x20'+_0x4e5be0+'m':_0x220423+'h';}function a27_0x2299(){const _0x4c6323=['kill','yes','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','h\x20ago','green','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','1793673zBSHRL','dim','35hnYzMM','d\x20ago','902985Eyxqag','\x20jobs','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobs','\x20\x20Job\x20ID:\x20','41020NGwIcN','join','query','201543zCghMb','job:submit','Get\x20job\x20results','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','presto','success','status','Job\x20type:\x20','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','jobType','floor','verbose','execute','Limit:\x20','database','✔\x20Job\x20submitted','Database:\x20','error','Cancelled','List\x20jobs','\x20row','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','job:kill','list','job_id','job:result','log','Show\x20job\x20details','validate','Query:\x20','file','283269aODBrg','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','map','hive','Getting\x20job\x20details...','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','end_at','red','name','round','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','start_at','push','url','Submit\x20a\x20job','Kill\x20a\x20job','information_schema','length','user_name','data','type','Listing\x20jobs...','1221064tnTrSk','\x20job','just\x20now','result','getTime','args','trino','42gTnxQW','limit','787322psXSZV','abs','created_at','...','description'];a27_0x2299=function(){return _0x4c6323;};return a27_0x2299();}function formatRelativeTime(_0x10c6e3){const _0x34abce=a27_0x968c,_0x56646d=Date['now']()-_0x10c6e3[_0x34abce(0x19a)](),_0x2194a6=Math['floor'](Math[_0x34abce(0x1a0)](_0x56646d)/0x3e8);if(_0x2194a6<0x3c)return _0x34abce(0x198);const _0xea6458=Math[_0x34abce(0x1c1)](_0x2194a6/0x3c);if(_0xea6458<0x3c)return _0xea6458+'m\x20ago';const _0x3ce51a=Math['floor'](_0xea6458/0x3c);if(_0x3ce51a<0x18)return _0x3ce51a+_0x34abce(0x1a7);const _0xab07d7=Math[_0x34abce(0x1c1)](_0x3ce51a/0x18);if(_0xab07d7<0x1e)return _0xab07d7+_0x34abce(0x1ad);return Math[_0x34abce(0x1c1)](_0xab07d7/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']='jobs';[a27_0x151d54(0x1a3)]=a27_0x151d54(0x1ca);async[a27_0x151d54(0x1c3)](_0x3b2f37){const _0x58f2a5=a27_0x151d54,{options:_0x2d103d,tdx:_0x3426b7}=_0x3b2f37,_0x383f17=resolveLimit(_0x2d103d[_0x58f2a5(0x19e)],DEFAULT_DISPLAY_LIMIT),_0x2677a5=_0x2d103d[_0x58f2a5(0x1bd)];_0x2d103d[_0x58f2a5(0x1c2)]&&(console['error'](_0x58f2a5(0x1c4)+_0x383f17+_0x58f2a5(0x1af)),_0x2677a5&&console[_0x58f2a5(0x1c8)]('Status\x20filter:\x20'+_0x2677a5));const _0x13013b=await withSpinner(_0x58f2a5(0x195),()=>_0x3426b7[_0x58f2a5(0x1b1)][_0x58f2a5(0x1ce)]({'from':0x0,'to':_0x383f17-0x1,'status':_0x2677a5}),{'verbose':_0x2d103d[_0x58f2a5(0x1c2)]}),_0x1caf72=_0x13013b[_0x58f2a5(0x193)];console[_0x58f2a5(0x1c8)]('✔\x20Found\x20'+_0x1caf72[_0x58f2a5(0x191)]+_0x58f2a5(0x197)+(_0x1caf72['length']!==0x1?'s':''));const _0x30840b=_0x2d103d['site'];if(isStructuredFormat(_0x2d103d)){const _0x421bd2=_0x1caf72[_0x58f2a5(0x182)](_0x341134=>{const _0x42f6d3=_0x58f2a5;let _0x5d6818;if(_0x341134[_0x42f6d3(0x18b)]&&_0x341134['end_at']){const _0x5a2c9c=new Date(_0x341134['start_at'])[_0x42f6d3(0x19a)](),_0x2ac9e2=new Date(_0x341134[_0x42f6d3(0x186)])['getTime']();_0x5d6818=Math['round']((_0x2ac9e2-_0x5a2c9c)/0x3e8);}return{'job_id':_0x341134[_0x42f6d3(0x1cf)],'type':_0x341134[_0x42f6d3(0x194)]===_0x42f6d3(0x1bb)?_0x42f6d3(0x19c):_0x341134[_0x42f6d3(0x194)],'status':_0x341134[_0x42f6d3(0x1bd)],'user_name':_0x341134[_0x42f6d3(0x192)],'duration_sec':_0x5d6818,'created_at':_0x341134[_0x42f6d3(0x1a1)],'started_at':_0x341134[_0x42f6d3(0x18b)],'end_at':_0x341134[_0x42f6d3(0x186)]};});await handleSDKOutput(_0x421bd2,_0x2d103d);}else for(const _0x4066b3 of _0x1caf72){const _0x21972a=_0x4066b3['status']===_0x58f2a5(0x1bc)?a27_0x3f4e30[_0x58f2a5(0x1a8)]:_0x4066b3[_0x58f2a5(0x1bd)]===_0x58f2a5(0x1c8)?a27_0x3f4e30[_0x58f2a5(0x187)]:a27_0x3f4e30[_0x58f2a5(0x1ab)],_0x3d25ed=_0x21972a(_0x4066b3['status']),_0x3a5f4f=getJobUrl(_0x30840b,_0x4066b3['job_id']),_0x2ad8a5=hyperlink(_0x4066b3['job_id'],_0x3a5f4f),_0x5de49d=a27_0x3f4e30['dim'](_0x4066b3[_0x58f2a5(0x194)]===_0x58f2a5(0x1bb)?_0x58f2a5(0x19c):_0x4066b3['type']),_0x1d4e00=[];if(_0x4066b3[_0x58f2a5(0x18b)]&&_0x4066b3[_0x58f2a5(0x186)]){const _0x2bc2ac=Math[_0x58f2a5(0x189)]((new Date(_0x4066b3[_0x58f2a5(0x186)])[_0x58f2a5(0x19a)]()-new Date(_0x4066b3[_0x58f2a5(0x18b)])[_0x58f2a5(0x19a)]())/0x3e8);_0x1d4e00[_0x58f2a5(0x18c)](formatDuration(_0x2bc2ac));}if(_0x4066b3['end_at'])_0x1d4e00[_0x58f2a5(0x18c)](formatRelativeTime(new Date(_0x4066b3['end_at'])));else _0x4066b3[_0x58f2a5(0x18b)]&&_0x1d4e00[_0x58f2a5(0x18c)](formatRelativeTime(new Date(_0x4066b3[_0x58f2a5(0x18b)])));const _0x196919=_0x1d4e00['length']>0x0?a27_0x3f4e30[_0x58f2a5(0x1ab)]('\x20'+_0x1d4e00[_0x58f2a5(0x1b4)](',\x20')):'';console[_0x58f2a5(0x1d1)]('⚡\x20'+_0x2ad8a5+'\x20'+_0x5de49d+'\x20'+_0x3d25ed+_0x196919);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';[a27_0x151d54(0x1a3)]=a27_0x151d54(0x1d2);[a27_0x151d54(0x17d)](_0x2b4909){const _0x31f319=a27_0x151d54,_0x2af354=_0x2b4909[_0x31f319(0x19b)][0x0];if(!_0x2af354)return _0x31f319(0x18a);return undefined;}async[a27_0x151d54(0x1c3)](_0x54b842){const _0x1bd36=a27_0x151d54,{options:_0x10b968,args:_0x37d8ee,tdx:_0x38a42f}=_0x54b842,_0x385fcb=_0x37d8ee[0x0],_0x3994a8=await withSpinner(_0x1bd36(0x184),()=>_0x38a42f['jobs']['show'](_0x385fcb),{'verbose':_0x10b968[_0x1bd36(0x1c2)]}),_0x326408=_0x3994a8[_0x1bd36(0x193)];let _0x416107;if(_0x326408[_0x1bd36(0x18b)]&&_0x326408[_0x1bd36(0x186)]){const _0xadece9=new Date(_0x326408['start_at'])[_0x1bd36(0x19a)](),_0x3e6b86=new Date(_0x326408[_0x1bd36(0x186)])[_0x1bd36(0x19a)]();_0x416107=Math['round']((_0x3e6b86-_0xadece9)/0x3e8);}const _0x5c6d45={'job_id':_0x326408[_0x1bd36(0x1cf)],'type':_0x326408[_0x1bd36(0x194)],'status':_0x326408[_0x1bd36(0x1bd)],..._0x326408['user_name']&&{'user_name':_0x326408[_0x1bd36(0x192)]},..._0x416107!==undefined&&{'duration_sec':_0x416107},..._0x326408[_0x1bd36(0x1a1)]&&{'created_at':_0x326408[_0x1bd36(0x1a1)]},..._0x326408['start_at']&&{'started_at':_0x326408[_0x1bd36(0x18b)]},..._0x326408[_0x1bd36(0x186)]&&{'end_at':_0x326408[_0x1bd36(0x186)]},..._0x326408[_0x1bd36(0x1c5)]&&{'database':_0x326408[_0x1bd36(0x1c5)]},..._0x326408['priority']!==undefined&&{'priority':_0x326408['priority']},..._0x326408[_0x1bd36(0x18d)]&&{'url':_0x326408[_0x1bd36(0x18d)]},..._0x326408[_0x1bd36(0x1b5)]&&{'query':_0x326408['query']},..._0x326408['debug']&&{'debug':_0x326408['debug']}};return await handleSingleObjectOutput(_0x5c6d45,_0x10b968),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x151d54(0x188)]=a27_0x151d54(0x1cd);[a27_0x151d54(0x1a3)]=a27_0x151d54(0x18f);[a27_0x151d54(0x17d)](_0xa102b0){const _0x4cee40=a27_0x151d54,_0xc87970=_0xa102b0[_0x4cee40(0x19b)][0x0];if(!_0xc87970)return _0x4cee40(0x1ba);return undefined;}async[a27_0x151d54(0x1c3)](_0x574f45){const _0x377000=a27_0x151d54,{options:_0x2183aa,args:_0xcc20f0,tdx:_0x50c0e7}=_0x574f45,_0x4aebc4=_0xcc20f0[0x0];if(!_0x2183aa[_0x377000(0x1a5)]){const _0x528702=await confirm(_0x377000(0x181)+_0x4aebc4+'?');if(!_0x528702)return console[_0x377000(0x1c8)](_0x377000(0x1c9)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x50c0e7[_0x377000(0x1b1)][_0x377000(0x1a4)](_0x4aebc4),{'verbose':_0x2183aa['verbose']}),console[_0x377000(0x1c8)](_0x377000(0x1bf)+_0x4aebc4),console[_0x377000(0x1c8)](_0x377000(0x1cc)+_0x4aebc4+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a27_0x151d54(0x1b7);[a27_0x151d54(0x1a3)]=a27_0x151d54(0x18e);async[a27_0x151d54(0x1c3)](_0x9b460){const _0x418757=a27_0x151d54,{options:_0x3f25dc,args:_0x3da80a,tdx:_0x4c6054}=_0x9b460,_0x542b33=_0x3f25dc[_0x418757(0x1c0)]||_0x418757(0x19c),_0x2d5c6f=_0x3f25dc[_0x418757(0x17f)],_0x3ddac9=_0x3f25dc['database']||_0x418757(0x190),_0x462183=_0x3f25dc[_0x418757(0x199)];if(_0x542b33!==_0x418757(0x19c)&&_0x542b33!==_0x418757(0x183))throw new SDKError(ErrorCode[_0x418757(0x1b9)],_0x418757(0x1b0));let _0x38f5;if(_0x2d5c6f){if(_0x3da80a[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x418757(0x1a6));const _0x46e904=readSqlStatementsFromFile(_0x2d5c6f);if(_0x46e904[_0x418757(0x191)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x46e904[_0x418757(0x191)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x38f5=_0x46e904[0x0];}else{if(!_0x3da80a[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x418757(0x185));_0x38f5=_0x3da80a[0x0];}_0x3f25dc[_0x418757(0x1c2)]&&(console[_0x418757(0x1c8)](_0x418757(0x1be)+_0x542b33),console[_0x418757(0x1c8)](_0x418757(0x1c7)+_0x3ddac9),console[_0x418757(0x1c8)](_0x418757(0x17e)+_0x38f5['substring'](0x0,0x64)+(_0x38f5[_0x418757(0x191)]>0x64?_0x418757(0x1a2):'')));const _0x7f9a07=await withSpinner('Submitting\x20job...',()=>_0x4c6054['jobs']['submit'](_0x3ddac9,_0x38f5,_0x542b33,_0x462183),{'verbose':_0x3f25dc[_0x418757(0x1c2)]}),_0x3f3353=_0x7f9a07['data'];return console[_0x418757(0x1c8)](_0x418757(0x1c6)),console['error'](_0x418757(0x1b2)+_0x3f3353['job_id']),await handleSDKOutput([_0x3f3353],_0x3f25dc),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a27_0x151d54(0x1d0);['description']=a27_0x151d54(0x1b8);['validate'](_0x47b536){const _0x4e2ad8=a27_0x151d54,_0x1b328d=_0x47b536[_0x4e2ad8(0x19b)][0x0];if(!_0x1b328d)return _0x4e2ad8(0x1a9);return undefined;}async[a27_0x151d54(0x1c3)](_0x5a8511){const _0xbbc1d2=a27_0x151d54,{options:_0x5c147c,args:_0x5bf70c,tdx:_0x31e85d}=_0x5a8511,_0x361460=_0x5bf70c[0x0],_0x24ae9d=await withSpinner('Getting\x20job\x20results...',()=>_0x31e85d[_0xbbc1d2(0x1b1)][_0xbbc1d2(0x199)](_0x361460),{'verbose':_0x5c147c['verbose']}),_0x10efe3=_0x24ae9d[_0xbbc1d2(0x193)];return console[_0xbbc1d2(0x1c8)]('✔\x20Retrieved\x20'+_0x10efe3[_0xbbc1d2(0x191)]+_0xbbc1d2(0x1cb)+(_0x10efe3[_0xbbc1d2(0x191)]!==0x1?'s':'')),await handleSDKOutput(_0x10efe3,_0x5c147c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a28_0xdd66dd=a28_0x187d;(function(_0x4ebe83,_0x1b7e20){const _0x38def2=a28_0x187d,_0x16b38c=_0x4ebe83();while(!![]){try{const _0x3f9d8c=parseInt(_0x38def2(0x1cb))/0x1+parseInt(_0x38def2(0x145))/0x2*(parseInt(_0x38def2(0x18e))/0x3)+-parseInt(_0x38def2(0x19f))/0x4*(parseInt(_0x38def2(0x1a3))/0x5)+parseInt(_0x38def2(0x1e1))/0x6*(-parseInt(_0x38def2(0x135))/0x7)+-parseInt(_0x38def2(0x119))/0x8*(-parseInt(_0x38def2(0x18a))/0x9)+parseInt(_0x38def2(0x1e9))/0xa+-parseInt(_0x38def2(0x101))/0xb*(parseInt(_0x38def2(0x140))/0xc);if(_0x3f9d8c===_0x1b7e20)break;else _0x16b38c['push'](_0x16b38c['shift']());}catch(_0x166a19){_0x16b38c['push'](_0x16b38c['shift']());}}}(a28_0x4df2,0x68fc2));import a28_0x1f0e80 from'chalk';import a28_0x16999a 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';function a28_0x187d(_0xe54cbd,_0xb8a120){_0xe54cbd=_0xe54cbd-0xe7;const _0x4df25e=a28_0x4df2();let _0x187dfb=_0x4df25e[_0xe54cbd];return _0x187dfb;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x306fb4){const _0x3fe459=a28_0x187d;return!_0x306fb4&&(console[_0x3fe459(0x139)](_0x3fe459(0x120)),console[_0x3fe459(0x139)](_0x3fe459(0x162))),!!_0x306fb4;}function withJsonFormat(_0x57f9a5){const _0x51a475=a28_0x187d;if(!_0x57f9a5[_0x51a475(0x16d)]&&!_0x57f9a5[_0x51a475(0x197)]&&!_0x57f9a5['jsonl']&&!_0x57f9a5[_0x51a475(0x11c)])return{..._0x57f9a5,'format':'json','json':!![]};return _0x57f9a5;}function formatJourneyState(_0x3f612d){const _0x148058=a28_0x187d;switch(_0x3f612d){case _0x148058(0x111):return a28_0x1f0e80['green'](_0x148058(0xf6));case _0x148058(0x1a0):return a28_0x1f0e80['dim'](_0x148058(0x17e));case _0x148058(0x127):return a28_0x1f0e80['yellow'](_0x148058(0x128));case _0x148058(0x1c7):return a28_0x1f0e80[_0x148058(0xe7)]('(completed)');case _0x148058(0x156):return a28_0x1f0e80[_0x148058(0xff)](_0x148058(0x15a));default:return'('+_0x3f612d+')';}}function formatJourneyItem(_0x8e9060,_0x311861='',_0x1fd5d5){const _0x5c6692=a28_0x187d,_0x23a1d3=formatJourneyState(_0x8e9060['state']),_0x4a7bc3=_0x1fd5d5?hyperlink(_0x8e9060[_0x5c6692(0x131)],_0x1fd5d5):_0x8e9060[_0x5c6692(0x131)];return _0x311861+'🗺️\x20'+_0x4a7bc3+'\x20'+_0x23a1d3;}function escapeRegex(_0x2c8b16){const _0x4a84cb=a28_0x187d;return _0x2c8b16[_0x4a84cb(0xea)](/[.*+?^${}()|[\]\\]/g,_0x4a84cb(0x14c));}function globToRegex(_0x36ceb8){const _0x5cefd9=a28_0x187d,_0x482664=_0x36ceb8[_0x5cefd9(0x14f)]('*')[_0x5cefd9(0x19a)](escapeRegex);return new RegExp(_0x482664[_0x5cefd9(0x1c6)]('.*'),'i');}function buildRuleToNameMapping(_0x5e3f0e){const _0xb78c7b=a28_0x187d,_0x1dba9d=new Map();if(_0x5e3f0e['segments'])for(const [_0x295749,_0x46b0af]of Object[_0xb78c7b(0x16a)](_0x5e3f0e[_0xb78c7b(0xeb)])){if(_0x46b0af[_0xb78c7b(0x147)]){const _0x47beb8=serializeRule(_0x46b0af['rule']),_0x56e2f6=_0x1dba9d[_0xb78c7b(0x122)](_0x47beb8);_0x56e2f6?_0x56e2f6[_0xb78c7b(0x163)](_0x295749):_0x1dba9d[_0xb78c7b(0x13f)](_0x47beb8,[_0x295749]);}}return _0x1dba9d;}async function resolveJourneyIdFromInput(_0x4480e1,_0x3fca8c,_0xf7e1e7){const _0x429bb9=a28_0x187d,_0x4d093f=await resolveJourneyTarget(_0x4480e1,_0x3fca8c[_0x429bb9(0xfe)],_0x3fca8c['verbose']),_0x25d5a6=_0x4d093f['parentSegment'];if(!_0x25d5a6)throw new SDKError(ErrorCode[_0x429bb9(0x123)],_0x429bb9(0x138));const _0x343207=await withSpinner(_0x429bb9(0x1e2),()=>_0xf7e1e7[_0x429bb9(0x105)][_0x429bb9(0x142)](_0x25d5a6),{'verbose':_0x3fca8c['verbose']}),_0x2b0ec1=_0x343207[_0x429bb9(0x14d)],_0x2c3a0a=await withSpinner(_0x429bb9(0x1a8),()=>_0xf7e1e7[_0x429bb9(0x1bf)][_0x429bb9(0x1e6)](_0x2b0ec1,_0x4d093f['journeyName']),{'verbose':_0x3fca8c[_0x429bb9(0x1bc)]});return{'journeyId':_0x2c3a0a[_0x429bb9(0x14d)],'journeyName':_0x4d093f[_0x429bb9(0x155)],'parentSegmentId':_0x2b0ec1};}async function resolveJourneyTarget(_0x1178d8,_0x235cc3,_0x1a5c57){const _0x1b0ba9=a28_0x187d;if(isYamlFilePath(_0x1178d8))try{const _0xd009f=await resolveYamlFilePath(_0x1178d8);return _0x1a5c57&&(console[_0x1b0ba9(0x139)](_0x1b0ba9(0x1b2)+_0x1178d8),console[_0x1b0ba9(0x139)](_0x1b0ba9(0x164)+_0xd009f['parentSegment']),console[_0x1b0ba9(0x139)]('\x20\x20Name:\x20'+_0xd009f[_0x1b0ba9(0x1f5)]),console[_0x1b0ba9(0x139)]('\x20\x20Folder\x20path:\x20'+(_0xd009f[_0x1b0ba9(0x14b)]||_0x1b0ba9(0x12d)))),{'journeyName':_0xd009f[_0x1b0ba9(0x1f5)],'parentSegment':_0xd009f[_0x1b0ba9(0xfe)],'resolved':_0xd009f};}catch(_0x12d6fd){throw new SDKError(ErrorCode[_0x1b0ba9(0x123)],_0x1b0ba9(0x1da)+_0x12d6fd[_0x1b0ba9(0x110)]);}if(!_0x235cc3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b0ba9(0xf1));return{'journeyName':_0x1178d8,'parentSegment':_0x235cc3};}export class JourneyListCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x18f);[a28_0xdd66dd(0x1a4)]='List\x20journeys\x20in\x20current\x20context';async[a28_0xdd66dd(0x1b1)](_0x2a053d){const _0x141376=a28_0xdd66dd,{options:_0xd61c91,args:_0x6b2ddb,tdx:_0x242f62}=_0x2a053d,_0x313fc0=_0x6b2ddb[0x0],_0x4376da=_0xd61c91[_0x141376(0xfe)];if(!_0x4376da)return console[_0x141376(0x139)](_0x141376(0x15e)),console['error'](_0x141376(0x134)),0x1;const _0x5a65d0=await withSpinner(_0x141376(0x1e2),()=>_0x242f62[_0x141376(0x105)]['resolveParentId'](_0x4376da),{'verbose':_0xd61c91[_0x141376(0x1bc)]}),_0x4a1dce=_0x5a65d0['data'];_0xd61c91[_0x141376(0x1bc)]&&(console[_0x141376(0x139)](_0x141376(0x149)+_0x4376da+'\x20(ID:\x20'+_0x4a1dce+')'),_0x313fc0&&console[_0x141376(0x139)](_0x141376(0x182)+_0x313fc0));const _0x73ea9=await withSpinner(_0x141376(0x1ee),()=>_0x242f62['segment'][_0x141376(0x12a)](_0x4a1dce),{'verbose':_0xd61c91[_0x141376(0x1bc)]}),_0x1bc91f=_0x73ea9[_0x141376(0x14d)],_0xfe038f=_0x1bc91f['rootFolderId'],_0x1e506e=await withSpinner('Listing\x20journeys...',()=>_0x242f62[_0x141376(0x1bf)]['listJourneysWithFolders'](_0x4a1dce,_0xfe038f),{'verbose':_0xd61c91[_0x141376(0x1bc)]});let _0x4b9399=_0x1e506e[_0x141376(0x14d)][_0x141376(0x1c5)];const _0x5e9555=_0x1e506e[_0x141376(0x14d)][_0x141376(0x17b)],_0x4bb7fd=new Map();for(const _0x2a1441 of _0x5e9555){_0x4bb7fd[_0x141376(0x13f)](_0x2a1441['id'],_0x2a1441[_0x141376(0x10b)]);}if(_0x313fc0){const _0xeccb60=globToRegex(_0x313fc0);_0x4b9399=_0x4b9399[_0x141376(0x10e)](_0x5410a6=>_0xeccb60['test'](_0x5410a6[_0x141376(0x131)]));}console[_0x141376(0x139)](_0x141376(0x195)+_0x4b9399[_0x141376(0x1b6)]+_0x141376(0x1d3)+(_0x4b9399['length']!==0x1?'s':''));const _0x7ee818=_0x42bec3=>{const _0xcb3a3a=_0x141376;return getConsoleNextUrl(_0xd61c91['site'],_0xcb3a3a(0x104)+_0x4a1dce+_0xcb3a3a(0x1c3)+_0x42bec3+_0xcb3a3a(0x161));};if(_0xd61c91[_0x141376(0x16d)]===_0x141376(0x1c4))await handleSDKOutput(_0x4b9399,_0xd61c91);else{if(_0xd61c91[_0x141376(0x16d)]==='json'){const _0x16c4fc=_0x4b9399[_0x141376(0x19a)](_0x2fae5e=>({..._0x2fae5e,'url':_0x7ee818(_0x2fae5e['id'])}));await handleSDKOutput(_0x16c4fc,_0xd61c91);}else{console['log']('['+_0x4376da+']');const _0x4e8d4f=new Map(),_0x2aae63=[];for(const _0x2a1018 of _0x4b9399){if(!_0x2a1018[_0x141376(0x191)]||_0x2a1018[_0x141376(0x191)]===_0xfe038f)_0x2aae63[_0x141376(0x163)](_0x2a1018);else{const _0x5f32f4=_0x4e8d4f[_0x141376(0x122)](_0x2a1018[_0x141376(0x191)])||[];_0x5f32f4[_0x141376(0x163)](_0x2a1018),_0x4e8d4f[_0x141376(0x13f)](_0x2a1018['folderId'],_0x5f32f4);}}const _0x2343c1=(_0x55aeec,_0x395a29)=>_0x55aeec[_0x141376(0x131)]['localeCompare'](_0x395a29[_0x141376(0x131)],undefined,{'sensitivity':_0x141376(0x190)});_0x2aae63[_0x141376(0x148)](_0x2343c1);for(const _0x2ff21b of _0x2aae63){console[_0x141376(0x169)](formatJourneyItem(_0x2ff21b,'',_0x7ee818(_0x2ff21b['id'])));}const _0x313ac9=[..._0x4e8d4f[_0x141376(0x16a)]()][_0x141376(0x148)]((_0x27eac9,_0x48614c)=>{const _0x2313bf=_0x141376,_0x1334d4=_0x4bb7fd['get'](_0x27eac9[0x0])||_0x27eac9[0x0],_0x4f8f7b=_0x4bb7fd[_0x2313bf(0x122)](_0x48614c[0x0])||_0x48614c[0x0];return _0x1334d4[_0x2313bf(0x1a6)](_0x4f8f7b,undefined,{'sensitivity':_0x2313bf(0x190)});});for(const [_0x52ba94,_0x2f71f1]of _0x313ac9){const _0x354e9d=_0x4bb7fd['get'](_0x52ba94)||_0x52ba94;console[_0x141376(0x169)](_0x141376(0x13e)+_0x354e9d),_0x2f71f1[_0x141376(0x148)](_0x2343c1);for(const _0x354699 of _0x2f71f1){console['log'](formatJourneyItem(_0x354699,'\x20\x20',_0x7ee818(_0x354699['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1f4);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x1f6);async[a28_0xdd66dd(0x1b1)](_0x1e9556){const _0x61943a=a28_0xdd66dd,{options:_0xda01dd,args:_0x4538d4,tdx:_0x534d91}=_0x1e9556,_0x1b44b0=_0x4538d4[0x0];if(!_0x1b44b0)return console['error'](_0x61943a(0x120)),console['error'](_0x61943a(0x196)),console[_0x61943a(0x139)](_0x61943a(0x154)),console['error'](_0x61943a(0x150)),0x1;_0xda01dd[_0x61943a(0x1bc)]&&console['error'](_0x61943a(0x1ce)+_0x1b44b0);const {journeyId:_0x3af257,parentSegmentId:_0x46a301}=await resolveJourneyIdFromInput(_0x1b44b0,_0xda01dd,_0x534d91);if(_0xda01dd[_0x61943a(0x1ec)]){const _0x26413c=getConsoleNextUrl(_0xda01dd[_0x61943a(0x1db)],'/app/ps/'+_0x46a301+_0x61943a(0x1c3)+_0x3af257+'/j/da/je');return console[_0x61943a(0x139)](a28_0x1f0e80['green']('✔')+_0x61943a(0x17a)+a28_0x1f0e80[_0x61943a(0x1f1)](_0x26413c)),openBrowser(_0x26413c),0x0;}const _0xdcb42c=await withSpinner(_0x61943a(0x170),()=>_0x534d91[_0x61943a(0x1bf)]['getJourney'](_0x3af257),{'verbose':_0xda01dd[_0x61943a(0x1bc)]}),_0x2ddadc=_0xdcb42c[_0x61943a(0x14d)],_0x40794a=_0xda01dd[_0x61943a(0x1dd)];let _0x5ccd86;if(_0x40794a)try{const _0x55ea28=await withSpinner(_0x61943a(0x1d1),()=>_0x534d91[_0x61943a(0x1bf)][_0x61943a(0x1f0)](_0x3af257),{'verbose':_0xda01dd[_0x61943a(0x1bc)]});_0x5ccd86=_0x55ea28['data'];}catch{_0xda01dd[_0x61943a(0x1bc)]&&console['error'](_0x61943a(0xec));}const _0x511450=getConsoleNextUrl(_0xda01dd[_0x61943a(0x1db)],_0x61943a(0x104)+_0x46a301+_0x61943a(0x1c3)+_0x3af257+'/j/da/je'),_0x1fac0d={'id':_0x2ddadc['id'],'name':_0x2ddadc[_0x61943a(0x158)][_0x61943a(0x10b)],'description':_0x2ddadc['attributes']['description'],'state':_0x2ddadc[_0x61943a(0x158)][_0x61943a(0x1d6)],'paused':_0x2ddadc[_0x61943a(0x158)]['paused'],'reentry_mode':_0x2ddadc[_0x61943a(0x158)]['reentryMode'],'stages':_0x2ddadc['attributes']['journeyStages']?.[_0x61943a(0x1b6)]||0x0,..._0x2ddadc[_0x61943a(0x158)][_0x61943a(0x179)]&&{'goal':_0x2ddadc[_0x61943a(0x158)]['goal']['name']},..._0x5ccd86&&{'statistics':{'size':_0x5ccd86[_0x61943a(0x146)],'entered':_0x5ccd86[_0x61943a(0x1c1)],'goal_achieved':_0x5ccd86[_0x61943a(0x19d)],'completion_rate':_0x5ccd86[_0x61943a(0x130)],'exit_or_jump':_0x5ccd86[_0x61943a(0xfd)],'exit_or_jump_rate':_0x5ccd86[_0x61943a(0x10a)],'stages':_0x5ccd86['stages']}},'url':_0x511450};return await handleSingleObjectOutput(_0x1fac0d,_0xda01dd),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a28_0xdd66dd(0x1f8);[a28_0xdd66dd(0x1a4)]='Show\x20journey\x20statistics';async[a28_0xdd66dd(0x1b1)](_0x4f70b0){const _0x39d189=a28_0xdd66dd,{options:_0x44ffa8,args:_0x3a287e,tdx:_0x318c32}=_0x4f70b0,_0x4cee97=_0x3a287e[0x0];if(!requireNameOrPath(_0x4cee97))return 0x1;_0x44ffa8[_0x39d189(0x1bc)]&&console[_0x39d189(0x139)]('Input:\x20'+_0x4cee97);const _0x32d7ae=_0x44ffa8,_0x393410=_0x32d7ae['from'],_0x598ebd=_0x32d7ae['to'],_0x229e01=_0x32d7ae[_0x39d189(0x157)],_0x5dd969=_0x32d7ae[_0x39d189(0x125)];_0x229e01&&!_0x393410&&!_0x598ebd&&console['error'](_0x39d189(0x11b));const _0x36757d=_0x229e01?withJsonFormat(_0x44ffa8):_0x44ffa8,{journeyId:_0x10f04c,journeyName:_0x5067b5}=await resolveJourneyIdFromInput(_0x4cee97,_0x36757d,_0x318c32),_0x44a140=_0x393410||_0x598ebd?{'from':_0x393410,'to':_0x598ebd}:undefined,_0x50de06=await withSpinner(_0x39d189(0x1d1),()=>Promise[_0x39d189(0x12b)]([_0x318c32['journey'][_0x39d189(0x11d)](_0x10f04c),_0x318c32[_0x39d189(0x1bf)][_0x39d189(0x1f0)](_0x10f04c,_0x44a140)]),{'verbose':_0x36757d[_0x39d189(0x1bc)]}),[_0xf29cae,_0x863319]=_0x50de06[_0x39d189(0x14d)];if(!_0x863319||_0x863319[_0x39d189(0x103)]===null)return console[_0x39d189(0x139)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x5067b5),console[_0x39d189(0x139)](_0x39d189(0xee)),0x0;const _0x1a5161=buildStageNameMap(_0xf29cae),_0x4662fe=!!(_0x44a140&&_0x863319['history']?.['length']),_0x176976={'stageNameMap':_0x1a5161,'hasPeriod':_0x4662fe,'includeHistory':!!_0x229e01};if(_0x5dd969&&_0x863319[_0x39d189(0x1ed)]){const _0xb15ea0=_0x863319[_0x39d189(0x1ed)][_0x39d189(0x16b)](_0x46529c=>{const _0x45395e=_0x39d189,_0x24abbb=_0x1a5161['get'](_0x46529c['id'])??'';return _0x24abbb['toLowerCase']()===_0x5dd969[_0x45395e(0x1ab)]();});if(_0xb15ea0)return await handleSingleObjectOutput(formatStageStats(_0xb15ea0,_0x176976),_0x36757d),0x0;const _0x36061a=_0x863319[_0x39d189(0x1ed)][_0x39d189(0x19a)](_0x47ac22=>_0x1a5161[_0x39d189(0x122)](_0x47ac22['id'])??_0x47ac22['id']);return console['error'](_0x39d189(0x1e8)+_0x5dd969+_0x39d189(0x1d0)),console[_0x39d189(0x139)](_0x39d189(0xfc)+_0x36061a[_0x39d189(0x1c6)](',\x20')),0x1;}const _0x50e127=_0x863319[_0x39d189(0x1ed)]?.['map'](_0x2695b0=>formatStageStats(_0x2695b0,_0x176976)),_0x4fbd51=assembleJourneyStats(_0x863319,{'from':_0x393410,'to':_0x598ebd,'includeHistory':_0x229e01});return await this[_0x39d189(0x114)](_0x4fbd51,_0x50e127??[],_0x36757d),0x0;}async[a28_0xdd66dd(0x114)](_0x316c87,_0xa2bbf1,_0x142d42){const _0x251c4f=a28_0xdd66dd,_0x3b0509=_0x142d42[_0x251c4f(0x16d)]===_0x251c4f(0x197)||_0x142d42[_0x251c4f(0x16d)]===_0x251c4f(0x1cd)||_0x142d42['json']||_0x142d42[_0x251c4f(0x1cd)];if(_0x3b0509){_0x316c87['stages']=_0xa2bbf1,await handleSingleObjectOutput(_0x316c87,_0x142d42);return;}await handleSingleObjectOutput(_0x316c87,_0x142d42);for(const _0x18f447 of _0xa2bbf1){console[_0x251c4f(0x169)](''),console[_0x251c4f(0x169)](String(a28_0x1f0e80['cyan'][_0x251c4f(0x1c2)]('['+_0x18f447[_0x251c4f(0x10b)]+']'))+a28_0x1f0e80['dim']('\x20'+_0x18f447['id']));const {id:_0x27c55e,name:_0x1cde37,..._0x48757a}=_0x18f447;await handleSingleObjectOutput(_0x48757a,_0x142d42);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x121);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x16c);async[a28_0xdd66dd(0x1b1)](_0x1ea6f5){const _0x104606=a28_0xdd66dd,{options:_0x3f0599,args:_0x11d040,tdx:_0x10b23a}=_0x1ea6f5,_0x3a16ce=_0x11d040[0x0];if(!requireNameOrPath(_0x3a16ce))return 0x1;_0x3f0599['verbose']&&console[_0x104606(0x139)](_0x104606(0x1ce)+_0x3a16ce);const _0x2bb78d=_0x3f0599,_0x553f22=_0x2bb78d[_0x104606(0xf4)],_0x5c5af1=_0x2bb78d[_0x104606(0x13d)],_0x2aadb5=_0x2bb78d['to'],_0x45956f=_0x2bb78d['limit'];if(_0x553f22&&_0x553f22!==_0x104606(0x1ae)&&_0x553f22!==_0x104606(0x1a7))return console[_0x104606(0x139)](_0x104606(0x1c8)+_0x553f22+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x36d386=withJsonFormat(_0x3f0599),{journeyId:_0xdd462f,journeyName:_0x2727d4}=await resolveJourneyIdFromInput(_0x3a16ce,_0x36d386,_0x10b23a),_0x5ac7e9={'type':_0x553f22,'from':_0x5c5af1,'to':_0x2aadb5,'limit':_0x45956f},_0x4a82b0=await withSpinner(_0x104606(0x1cf),()=>_0x10b23a[_0x104606(0x1bf)][_0x104606(0x143)](_0xdd462f,_0x5ac7e9),{'verbose':_0x36d386[_0x104606(0x1bc)]}),_0x1511a1=_0x4a82b0[_0x104606(0x14d)],_0x20c387=_0x1511a1[_0x104606(0x1ae)]&&(_0x1511a1[_0x104606(0x1ae)][_0x104606(0x177)][_0x104606(0x1b6)]>0x0||_0x1511a1['conversion'][_0x104606(0x11e)][_0x104606(0x1b6)]>0x0),_0x3a8cba=_0x1511a1[_0x104606(0x1a7)]&&_0x1511a1['activation'][_0x104606(0x1b6)]>0x0;if(!_0x20c387&&!_0x3a8cba)return console[_0x104606(0x139)](_0x104606(0x1e4)+_0x2727d4),console['error'](_0x104606(0xe9)),_0x5c5af1&&_0x2aadb5&&console[_0x104606(0x139)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x1511a1,_0x36d386),0x0;}}function formatStageStats(_0x31cdd1,_0x49e7a0){const _0x159a56=a28_0xdd66dd,_0x56cebe=_0x49e7a0[_0x159a56(0x189)]&&_0x31cdd1[_0x159a56(0x1dc)]?.['length']?aggregateStageHistory(_0x31cdd1[_0x159a56(0x1dc)]):{'size':_0x31cdd1[_0x159a56(0x146)],'entered':_0x31cdd1[_0x159a56(0x1c1)],'milestone':_0x31cdd1[_0x159a56(0x167)],'milestone_rate':_0x31cdd1[_0x159a56(0x1a9)],'exit_or_jump':_0x31cdd1[_0x159a56(0xfd)],'exit_or_jump_rate':_0x31cdd1['exitOrJumpRate']},_0x407655={'id':_0x31cdd1['id'],'name':_0x49e7a0['stageNameMap'][_0x159a56(0x122)](_0x31cdd1['id'])??_0x31cdd1['id'],..._0x56cebe};return _0x49e7a0['hasPeriod']&&_0x49e7a0[_0x159a56(0x157)]&&_0x31cdd1[_0x159a56(0x1dc)]&&(_0x407655['history']=_0x31cdd1[_0x159a56(0x1dc)]),_0x407655;}function a28_0x4df2(){const _0x5f2be7=['sort','Parent\x20segment:\x20','segmentPushCommand','folderPath','\x5c$&','data','utf-8','split','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','relativePath','\x20(rule\x20match)','Journey\x20name:\x20','Options:','journeyName','archived','includeHistory','attributes','args','(archived)','journeyStages','Error:\x20--version\x20option\x20is\x20required','Fetching\x20users\x20and\x20connections...','Error:\x20Parent\x20segment\x20context\x20required','resourceName','No\x20journeys\x20found','/j/da','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','push','\x20\x20Parent\x20segment:\x20','setPhase','activation_','milestoneSize','List\x20activations\x20for\x20a\x20journey','log','entries','find','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','format','journey:pull','then','Getting\x20journey\x20details...','Found\x20','Getting\x20column\x20mapping...','journeyBundleId','database','yellow','isNew','nodes','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','goal','\x20Opening\x20','folders','repeat','Listing\x20journey\x20activations...','(draft)','List\x20all\x20versions\x20of\x20a\x20journey','reentryMode','file','Pattern:\x20','\x20->\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Folder\x20path:\x20','listJourneysFromParentSegment','Cancelled','Table:\x20','hasPeriod','62388TWgYeW','\x20(draft)\x20—\x20\x22','\x20journey\x20files\x20to\x20','createdAt','52755KXdjpd','journey:list','base','folderId','buildIdToNameMap','\x20versions)','✔\x20Context\x20set:\x20','✔\x20Found\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','json','Pause\x20a\x20running\x20journey','filePath','map','user',',\x20version:\x20','goalSize','tdx.json','32QJhacU','draft','yes','Warning:\x20Could\x20not\x20resolve\x20activation\x20','121015GlDSWh','description','targetDir','localeCompare','activation','Resolving\x20journey...','completeMilestoneRate','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','toLowerCase','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20resumed','conversion','journey:version:view','connection','execute','Resolved\x20YAML\x20file:\x20','\x20Created\x20v','/j/da/je','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','length','Error:\x20Invalid\x20version\x20number:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','getLatestJourneyId','audienceId','\x20version','verbose','✔\x20Journey\x20\x22','red','journey','green','enteredSize','bold','/e/','table','journeys','join','completed','Error:\x20Invalid\x20--type\x20\x22','journey:resume','\x20not\x20found.\x20Available:\x20','463084NpmEza','no_parent','jsonl','Input:\x20','Getting\x20journey\x20traffic\x20data...','\x22\x20not\x20found','Getting\x20journey\x20statistics...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20journey','parent_segment','\x20\x20Journey\x20ID:\x20','state','journey:versions','Show\x20journey\x20table\x20column\x20mapping','Fetching\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','site','history','includeStats','root\x20folder','.yml','\x20=\x20','14754BrPQUt','Resolving\x20parent\x20segment...','\x20details...','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','diff','resolveJourneyId','\x20\x20-\x20','Error:\x20Stage\x20\x22','5402020hwWCjs','\x0aPull\x20summary:','Resume\x20a\x20paused\x20journey','web','stages','Fetching\x20parent\x20segment...','has','getStatistics','cyan','✔\x20Pulled\x20','\x0aChanges\x20to\x20\x27','journey:view','segmentName','Show\x20journey\x20details','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journey:stats','journey:columns','blue','relative','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','replace','segments','\x20\x20Statistics\x20not\x20available','hasChanges','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20activation','listFolders','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Journey\x20\x27','buildIdToEmailMap','type','Getting\x20version\x20','(running)','\x20files?','values','Creating\x20new\x20version...','listVersions','session','Available\x20stages:\x20','exitOrJumpSize','parentSegment','dim','Aborted.','22zKzJUK','helpText','journeyId','/app/ps/','segment','\x20journeys','...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x22\x20paused','exitOrJumpRate','name','getColumnMapping','\x20\x20Target:\x20','filter','versionNumber','message','launched','content','\x20unchanged\x20files','renderStats','version','parentName','errorCode','stringify','16YjsWEd','journey:push','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','tsv','getJourney','links','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','journey:traffic','get','INVALID_ARGUMENT','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','stage','\x20new\x20files','paused','(paused)','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','getParentFull','all','connector_config','(root)','options','Error:\x20','completionRate','journeyBundleName','cwd','Pausing\x20journey...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','651RWidUw','journey:activations','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','error','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','kind','add','from','📁\x20','set','1094436ZdjVwZ','\x27\x20not\x20found\x20in\x20','resolveParentId','getTrafficData','activationParams','2bIUOQU','size','rule'];a28_0x4df2=function(){return _0x5f2be7;};return a28_0x4df2();}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x198);async[a28_0xdd66dd(0x1b1)](_0x38ddbe){const _0x34de6c=a28_0xdd66dd,{options:_0x1c9e0a,args:_0x32e70b,tdx:_0x289a93}=_0x38ddbe,_0x5745b8=_0x32e70b[0x0];if(!requireNameOrPath(_0x5745b8))return 0x1;_0x1c9e0a['verbose']&&console[_0x34de6c(0x139)]('Input:\x20'+_0x5745b8);const {journeyId:_0x597d0c,journeyName:_0x4181a9}=await resolveJourneyIdFromInput(_0x5745b8,_0x1c9e0a,_0x289a93);if(!_0x1c9e0a[_0x34de6c(0x1a1)]){const _0x2167b5=await confirm(_0x34de6c(0x108)+_0x4181a9+'\x22?');if(!_0x2167b5)return console[_0x34de6c(0x139)]('Cancelled'),0x0;}const _0x53b052=await withSpinner(_0x34de6c(0x133),()=>_0x289a93[_0x34de6c(0x1bf)]['pause'](_0x597d0c),{'verbose':_0x1c9e0a[_0x34de6c(0x1bc)]}),_0xdd4c91=_0x53b052[_0x34de6c(0x14d)];return console[_0x34de6c(0x139)](_0x34de6c(0x1bd)+_0xdd4c91[_0x34de6c(0x158)][_0x34de6c(0x10b)]+_0x34de6c(0x109)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1c9);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x1eb);async[a28_0xdd66dd(0x1b1)](_0x68c3ca){const _0x3e79bb=a28_0xdd66dd,{options:_0x25ff15,args:_0x28a1e0,tdx:_0x430897}=_0x68c3ca,_0x268df0=_0x28a1e0[0x0];if(!requireNameOrPath(_0x268df0))return 0x1;_0x25ff15[_0x3e79bb(0x1bc)]&&console[_0x3e79bb(0x139)](_0x3e79bb(0x1ce)+_0x268df0);const {journeyId:_0xaf5754,journeyName:_0x4eda48}=await resolveJourneyIdFromInput(_0x268df0,_0x25ff15,_0x430897);if(!_0x25ff15['yes']){const _0x3fd60c=await confirm(_0x3e79bb(0x178)+_0x4eda48+'\x22?');if(!_0x3fd60c)return console['error'](_0x3e79bb(0x187)),0x0;}const _0x45a715=await withSpinner('Resuming\x20journey...',()=>_0x430897['journey']['resume'](_0xaf5754),{'verbose':_0x25ff15[_0x3e79bb(0x1bc)]}),_0x357086=_0x45a715['data'];return console['error'](_0x3e79bb(0x1bd)+_0x357086[_0x3e79bb(0x158)]['name']+_0x3e79bb(0x1ad)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x16e);[a28_0xdd66dd(0x1a4)]='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x6ef1ca){const _0x319a88=a28_0xdd66dd,{options:_0x295521,args:_0x1e2f85,tdx:_0x36638e}=_0x6ef1ca,_0x5097b6=_0x295521,_0x5a9afe=_0x1e2f85[0x0],_0x217d59=_0x5a9afe&&isYamlFilePath(_0x5a9afe),_0x410d9d=await resolveTarget({'arg':_0x217d59?_0x5a9afe:undefined,'contextParent':_0x295521[_0x319a88(0xfe)],'cwd':process[_0x319a88(0x132)]()});if(!isSuccessfulResolution(_0x410d9d))return _0x410d9d[_0x319a88(0x117)]===_0x319a88(0x1cc)?(console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x175)](_0x319a88(0x1f7))),console[_0x319a88(0x139)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x319a88(0x139)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x319a88(0x139)](_0x319a88(0x1d2)),console[_0x319a88(0x139)](_0x319a88(0x11f))):(console[_0x319a88(0x139)](a28_0x1f0e80['red'](_0x319a88(0x12f)+_0x410d9d[_0x319a88(0x110)]+'\x0a')),_0x410d9d[_0x319a88(0x102)]&&console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1f1)](_0x410d9d['helpText']))),0x1;let _0x2de97b=_0x217d59?undefined:_0x5a9afe,_0x503319,_0x202464;_0x410d9d[_0x319a88(0xf4)]===_0x319a88(0x181)&&(_0x2de97b=_0x410d9d[_0x319a88(0x15f)],_0x503319=_0x410d9d[_0x319a88(0x199)],_0x202464=_0x410d9d['folderPath']);const _0x304681=_0x410d9d[_0x319a88(0x116)],_0x4bee6=_0x410d9d[_0x319a88(0x1a5)];_0x5097b6['verbose']&&(console[_0x319a88(0x139)](_0x319a88(0x149)+_0x304681),console['error']('Target\x20directory:\x20'+_0x4bee6),_0x2de97b&&console[_0x319a88(0x139)](_0x319a88(0x153)+_0x2de97b),_0x503319&&console[_0x319a88(0x139)]('Target\x20file:\x20'+_0x503319),_0x202464&&console[_0x319a88(0x139)](_0x319a88(0x185)+_0x202464));const _0x14086a=await withSpinner(_0x319a88(0x1e2),()=>_0x36638e[_0x319a88(0x105)]['resolveParentId'](_0x304681),{'verbose':_0x295521[_0x319a88(0x1bc)]}),_0x27cdcb=_0x14086a[_0x319a88(0x14d)],{journeys:_0x3bbd3e,folders:_0x5a8bf3}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x8f8ade=_0x319a88,[_0x11cefe,_0x3ecd65]=await Promise[_0x8f8ade(0x12b)]([_0x36638e[_0x8f8ade(0x1bf)][_0x8f8ade(0x186)](_0x27cdcb,undefined,{'includeAllVersions':!![]}),_0x36638e[_0x8f8ade(0x105)][_0x8f8ade(0xf0)](_0x27cdcb)]);return{'journeys':_0x11cefe,'folders':_0x3ecd65};},{'verbose':_0x295521[_0x319a88(0x1bc)]})[_0x319a88(0x16f)](_0x14fa00=>_0x14fa00[_0x319a88(0x14d)]);let _0x358d23=_0x3bbd3e;const _0x43b3b1=buildFolderIdToPathMap(_0x5a8bf3);if(_0x2de97b){const _0x1765cd=_0x358d23['filter'](_0x5d15f9=>_0x5d15f9['journeyBundleName']['toLowerCase']()===_0x2de97b['toLowerCase']());if(_0x1765cd['length']===0x0)return console[_0x319a88(0x139)]('Error:\x20Journey\x20not\x20found:\x20'+_0x2de97b),console[_0x319a88(0x139)](_0x319a88(0x124)),0x1;_0x358d23=_0x1765cd;}if(_0x202464!==undefined){const _0xe82a90=_0x358d23[_0x319a88(0x10e)](_0xbb65bb=>{const _0x4f1a03=_0x319a88,_0x50341d=_0xbb65bb[_0x4f1a03(0x191)]?_0x43b3b1[_0x4f1a03(0x122)](_0xbb65bb['folderId'])||'':'';return _0x50341d===_0x202464;});if(_0xe82a90[_0x319a88(0x1b6)]===0x0&&_0x358d23['length']>0x0){console[_0x319a88(0x139)](_0x319a88(0xf2)+_0x2de97b+_0x319a88(0x141)+(_0x202464||_0x319a88(0x1de))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x8532d0 of _0x358d23){const _0xc3f517=_0x8532d0['folderId']?_0x43b3b1[_0x319a88(0x122)](_0x8532d0[_0x319a88(0x191)])||'':'';console[_0x319a88(0x139)](_0x319a88(0x1e7)+(_0xc3f517||_0x319a88(0x12d))+'/'+_0x8532d0[_0x319a88(0x131)]);}return 0x1;}_0x358d23=_0xe82a90;}if(_0x358d23['length']===0x0)return console[_0x319a88(0x139)](_0x319a88(0x160)),0x0;const _0xab4efa=new Map();for(const _0x575029 of _0x358d23){const _0x3f4f3b=_0x575029[_0x319a88(0x173)];!_0xab4efa[_0x319a88(0x1ef)](_0x3f4f3b)&&_0xab4efa['set'](_0x3f4f3b,[]),_0xab4efa['get'](_0x3f4f3b)[_0x319a88(0x163)](_0x575029);}for(const _0xc64383 of _0xab4efa[_0x319a88(0xf8)]()){_0xc64383['sort']((_0x237e1a,_0x129659)=>(_0x237e1a[_0x319a88(0x10f)]||0x0)-(_0x129659[_0x319a88(0x10f)]||0x0));}const _0x28c9f8=[],{idToEmailMap:_0x5b94a1,connectionIdToNameMap:_0x3ef929}=await withSpinner(_0x319a88(0x15d),async()=>{const _0x2b16a0=_0x319a88,[_0x2a4daf,_0x178ce7]=await Promise[_0x2b16a0(0x12b)]([_0x36638e[_0x2b16a0(0x19b)][_0x2b16a0(0xf3)](),_0x36638e[_0x2b16a0(0x1b0)][_0x2b16a0(0x192)]()]);return{'idToEmailMap':_0x2a4daf,'connectionIdToNameMap':_0x178ce7};},{'verbose':_0x295521[_0x319a88(0x1bc)]})['then'](_0x46dcf1=>_0x46dcf1['data']);for(const _0x8aada3 of _0xab4efa[_0x319a88(0xf8)]()){const _0x1fdb3e=_0x8aada3[0x0][_0x319a88(0x131)],_0x36f412=_0x8aada3[0x0][_0x319a88(0x191)],_0x15b6f3=_0x36f412?_0x43b3b1[_0x319a88(0x122)](_0x36f412)||'':'',_0x4feb5c=_0x15b6f3?a28_0x16999a['join'](_0x4bee6,_0x15b6f3):_0x4bee6,_0x599b33=_0x503319||a28_0x16999a[_0x319a88(0x1c6)](_0x4feb5c,sanitizeFileName(_0x1fdb3e)+_0x319a88(0x1df));let _0x2fb054,_0x57c690;if(existsSync(_0x599b33))try{const _0x44c4da=readFileSync(_0x599b33,_0x319a88(0x14e)),_0x540aee=parseYamlString(_0x44c4da);_0x57c690=_0x540aee,_0x2fb054=buildRuleToNameMapping(_0x540aee),_0x5097b6['verbose']&&_0x2fb054['size']>0x0&&console['error'](_0x319a88(0x171)+_0x2fb054[_0x319a88(0x146)]+_0x319a88(0x1aa)+_0x1fdb3e);}catch(_0x3476f7){_0x5097b6[_0x319a88(0x1bc)]&&console[_0x319a88(0x139)](_0x319a88(0x184)+_0x3476f7[_0x319a88(0x110)]);}const _0x191575=[],_0x10a970=new Set(),_0x545933=new Map(),_0x1965cf=new Map(),_0xc15d9f=new Set(),_0x1dd76a=new Map(),_0x1580d6=new Map(),_0x2da72e=createJumpTargetCache();await withProgressSpinner(_0x319a88(0x1d9)+_0x1fdb3e+_0x319a88(0x107),async _0x3acf67=>{const _0x31bf95=_0x319a88;for(const _0x564650 of _0x8aada3){const _0x539dff=_0x8aada3['length']>0x1?_0x564650[_0x31bf95(0x131)]+'\x20v'+(_0x564650['versionNumber']||0x1):_0x564650[_0x31bf95(0x131)];_0x3acf67[_0x31bf95(0x165)](_0x31bf95(0x1d9)+_0x539dff);const _0x2e6980=await _0x36638e[_0x31bf95(0x1bf)][_0x31bf95(0x11d)](_0x564650['id']),_0x5b03dd=_0x2e6980[_0x31bf95(0x158)]?.[_0x31bf95(0x1ba)],_0x323dde={'resolveSegment':async _0x2bf6f6=>{const _0x528466=_0x31bf95;if(!_0x5b03dd)return{'name':_0x2bf6f6,'isJourneyLocal':![]};const _0x2e105d=_0x545933[_0x528466(0x122)](_0x2bf6f6);if(_0x2e105d)return _0x2e105d;try{const _0x1a78c1=await _0x36638e[_0x528466(0x105)]['getSegment'](_0x5b03dd,_0x2bf6f6),_0x5cdd28=_0x1a78c1[_0x528466(0x13b)]===SEGMENT_KIND_JOURNEY;let _0x273ce1,_0x472d25=_0x1a78c1[_0x528466(0x10b)];if(_0x5cdd28&&_0x1a78c1[_0x528466(0x147)]){const _0x4a2d2d=await segmentResponseToDef(_0x1a78c1,{'resolveSegmentName':async _0x50fc27=>{const _0x88930d=_0x528466,_0x27afc9=_0x545933[_0x88930d(0x122)](_0x50fc27);if(_0x27afc9)return _0x27afc9[_0x88930d(0x10b)];const _0x18c429=await _0x323dde['resolveSegment'](_0x50fc27);return _0x18c429['name'];}}),_0x4cb2f9=_0x4a2d2d[_0x528466(0x147)];_0x273ce1={'description':_0x1a78c1[_0x528466(0x1a4)],'rule':_0x4cb2f9};const _0x445c6a=serializeRule(_0x4cb2f9),_0x3f4245=_0x1965cf[_0x528466(0x122)](_0x445c6a);if(_0x3f4245)_0x472d25=_0x3f4245,_0x273ce1=undefined,_0x5097b6[_0x528466(0x1bc)]&&console[_0x528466(0x139)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x1a78c1['name']+_0x528466(0x183)+_0x3f4245);else{let _0x50c728=![];if(_0x2fb054){const _0x110a2f=_0x2fb054['get'](_0x445c6a);if(_0x110a2f){const _0x22be6c=_0x110a2f[_0x528466(0x16b)](_0x49aea8=>!_0x10a970[_0x528466(0x1ef)](_0x49aea8));_0x22be6c&&(_0x472d25=_0x22be6c,_0x10a970['add'](_0x22be6c),_0x1965cf[_0x528466(0x13f)](_0x445c6a,_0x22be6c),_0x50c728=!![],_0x5097b6[_0x528466(0x1bc)]&&console[_0x528466(0x139)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x22be6c+_0x528466(0x152)));}}if(!_0x50c728){const _0x2989d2=generateJourneyLocalName(_0x1a78c1[_0x528466(0x10b)]);_0x2989d2&&(_0x472d25=_0x2989d2);let _0x4deee4=_0x472d25,_0xcb741=0x2;while(_0x10a970[_0x528466(0x1ef)](_0x4deee4)){_0x4deee4=_0x472d25+'_'+_0xcb741,_0xcb741++;}_0x10a970[_0x528466(0x13c)](_0x4deee4),_0x1965cf[_0x528466(0x13f)](_0x445c6a,_0x4deee4),_0x472d25=_0x4deee4;}}}const _0x59e86b={'name':_0x472d25,'isJourneyLocal':_0x5cdd28,'definition':_0x273ce1};return _0x545933[_0x528466(0x13f)](_0x2bf6f6,_0x59e86b),_0x59e86b;}catch(_0x108fa9){return _0x295521[_0x528466(0x1bc)]&&console[_0x528466(0x139)](_0x528466(0x137)+_0x2bf6f6+':\x20'+_0x108fa9['message']),{'name':_0x2bf6f6,'isJourneyLocal':![]};}},'resolveActivation':async _0x4985de=>{const _0x4ecfe1=_0x31bf95,_0x214780=_0x1dd76a['get'](_0x4985de);if(_0x214780)return _0x214780;try{const _0x2aa56d=await _0x36638e[_0x4ecfe1(0x1bf)]['getActivation'](_0x564650['id'],_0x4985de),_0x376d67=journeyActivationStepToYaml(_0x2aa56d,_0x5b94a1,_0x3ef929),_0x203284=JSON[_0x4ecfe1(0x118)]({'name':_0x376d67['name'],'connection':_0x376d67[_0x4ecfe1(0x1b0)],'connector_config':_0x376d67[_0x4ecfe1(0x12c)]}),_0x260410=_0x1580d6[_0x4ecfe1(0x122)](_0x203284);if(_0x260410){const _0x5d2159={'name':_0x260410,'isJourneyLocal':!![],'definition':_0x376d67};return _0x1dd76a['set'](_0x4985de,_0x5d2159),_0x5d2159;}const _0x383324=_0x2aa56d['attributes'][_0x4ecfe1(0x144)]['name']||_0x4985de,_0x294faa=sanitizeYamlKey(_0x383324)||_0x4ecfe1(0x166)+_0x4985de;let _0x557153=_0x294faa,_0x5ee1a4=0x2;while(_0xc15d9f['has'](_0x557153)){_0x557153=_0x294faa+'_'+_0x5ee1a4,_0x5ee1a4++;}_0xc15d9f[_0x4ecfe1(0x13c)](_0x557153),_0x1580d6[_0x4ecfe1(0x13f)](_0x203284,_0x557153);const _0x1262c3={'name':_0x557153,'isJourneyLocal':!![],'definition':_0x376d67};return _0x1dd76a['set'](_0x4985de,_0x1262c3),_0x1262c3;}catch(_0x2e1ae2){return _0x295521[_0x4ecfe1(0x1bc)]&&console[_0x4ecfe1(0x139)](_0x4ecfe1(0x1a2)+_0x4985de+':\x20'+_0x2e1ae2[_0x4ecfe1(0x110)]),{'name':_0x4985de,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x2d3c1e,_0x31bca7)=>{const _0x24d35b=_0x31bf95;return resolveJumpTarget(_0x2d3c1e,_0x31bca7,_0x2da72e,_0x492c10=>_0x36638e[_0x24d35b(0x1bf)][_0x24d35b(0x11d)](_0x492c10));}},_0x3175f8=await journeyResponseToDef(_0x2e6980,_0x323dde);_0x191575['push']({'item':_0x564650,'yaml':_0x3175f8});}},{'verbose':_0x295521['verbose']});const _0x195433=await _0x36638e[_0x319a88(0x1bf)][_0x319a88(0x1b9)](_0x8aada3[0x0][_0x319a88(0x173)]),_0x42b796=buildMergedJourneyDef(_0x191575,_0x2fb054,_0x195433),_0x13c9ed=normalizeJourneyDef(_0x42b796,_0x57c690),_0x287738=toYamlString(_0x13c9ed),_0x145492=_0x503319||a28_0x16999a['join'](_0x4feb5c,sanitizeFileName(_0x1fdb3e)+'.yml');!_0x503319&&_0x15b6f3&&!existsSync(_0x4feb5c)&&mkdirSync(_0x4feb5c,{'recursive':!![]});const _0x1f844d=a28_0x16999a[_0x319a88(0xe8)](process['cwd'](),_0x145492);if(existsSync(_0x145492)){const _0x3e346e=readFileSync(_0x145492,_0x319a88(0x14e)),_0x5661ef=generateDiff(_0x3e346e,_0x287738),_0x16dda1=hasChanges(_0x5661ef);_0x28c9f8[_0x319a88(0x163)]({'relativePath':_0x1f844d,'absolutePath':_0x145492,'content':_0x287738,'isNew':![],'hasChanges':_0x16dda1,'diff':_0x16dda1?formatDiffWithColors(_0x5661ef):undefined});}else _0x28c9f8[_0x319a88(0x163)]({'relativePath':_0x1f844d,'absolutePath':_0x145492,'content':_0x287738,'isNew':!![],'hasChanges':![]});}const _0x55d5f5=_0x28c9f8[_0x319a88(0x10e)](_0x415c6c=>_0x415c6c[_0x319a88(0x176)]),_0x1f6cc4=_0x28c9f8['filter'](_0x8c231c=>!_0x8c231c[_0x319a88(0x176)]&&_0x8c231c[_0x319a88(0xed)]),_0x237154=_0x28c9f8['filter'](_0x52b35f=>!_0x52b35f[_0x319a88(0x176)]&&!_0x52b35f[_0x319a88(0xed)]),_0x5043b0=_0x358d23[_0x319a88(0x1b6)],_0x3d4f48=_0xab4efa[_0x319a88(0x146)],_0x346af8=_0x5043b0>_0x3d4f48?'\x20('+_0x5043b0+_0x319a88(0x193):'';console[_0x319a88(0x139)](_0x319a88(0x1ea)),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80[_0x319a88(0x1f1)](_0x3d4f48+_0x319a88(0x106))+a28_0x1f0e80[_0x319a88(0xff)](_0x346af8)),console['error']('\x20\x20'+a28_0x1f0e80[_0x319a88(0x1c0)]('+\x20'+_0x55d5f5['length']+_0x319a88(0x126))),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80[_0x319a88(0x175)]('~\x20'+_0x1f6cc4[_0x319a88(0x1b6)]+'\x20changed\x20files')),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80['dim']('=\x20'+_0x237154[_0x319a88(0x1b6)]+_0x319a88(0x113))),console[_0x319a88(0x139)](_0x319a88(0x10d)+a28_0x1f0e80['cyan'](_0x4bee6)+'\x0a');if(_0x1f6cc4[_0x319a88(0x1b6)]>0x0)for(const _0x31c8b7 of _0x1f6cc4){console['error'](_0x319a88(0x1f3)+_0x31c8b7[_0x319a88(0x151)]+'\x27:'),console['error']('─'[_0x319a88(0x17c)](0x3c)),console['error'](_0x31c8b7[_0x319a88(0x1e5)]),console['error']('─'[_0x319a88(0x17c)](0x3c));}if(_0x5097b6['dryRun'])return console['error'](a28_0x1f0e80[_0x319a88(0x175)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x55d5f5[_0x319a88(0x1b6)]===0x0&&_0x1f6cc4[_0x319a88(0x1b6)]===0x0)return console['error'](a28_0x1f0e80['green'](_0x319a88(0x1b8))),saveSessionContext({'parent_segment':_0x304681},_0x5097b6['session']),console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1c0)](_0x319a88(0x194)+a28_0x1f0e80['dim'](_0x319a88(0x1d4))+'\x20=\x20'+a28_0x1f0e80[_0x319a88(0x1f1)](_0x304681))),0x0;if(!_0x5097b6[_0x319a88(0x1a1)]&&(_0x55d5f5[_0x319a88(0x1b6)]>0x0||_0x1f6cc4['length']>0x0)){if(!isInteractive())return console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1be)]('\x0aError:'),_0x319a88(0x1ac)),console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0xff)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2d2313=await confirmKey('Write\x20'+(_0x55d5f5['length']+_0x1f6cc4[_0x319a88(0x1b6)])+_0x319a88(0xf7));if(!_0x2d2313)return console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x175)](_0x319a88(0x100)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x4bee6)&&mkdirSync(_0x4bee6,{'recursive':!![]});const _0x28251d=a28_0x16999a[_0x319a88(0x1c6)](_0x4bee6,_0x319a88(0x19e));writeFileSync(_0x28251d,createTdxConfigContent(_0x304681),_0x319a88(0x14e));for(const _0x40de64 of _0x28c9f8){(_0x40de64['isNew']||_0x40de64['hasChanges'])&&writeFileSync(_0x40de64['absolutePath'],_0x40de64[_0x319a88(0x112)],_0x319a88(0x14e));}return console['error'](a28_0x1f0e80[_0x319a88(0x1c0)](_0x319a88(0x1f2)+(_0x55d5f5[_0x319a88(0x1b6)]+_0x1f6cc4['length'])+_0x319a88(0x18c)+_0x4bee6)),saveSessionContext({'parent_segment':_0x304681},_0x5097b6[_0x319a88(0xfb)]),console[_0x319a88(0x139)](a28_0x1f0e80['green'](_0x319a88(0x194)+a28_0x1f0e80[_0x319a88(0xff)](_0x319a88(0x1d4))+_0x319a88(0x1e0)+a28_0x1f0e80['cyan'](_0x304681))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1f9);['description']=a28_0xdd66dd(0x1d8);async[a28_0xdd66dd(0x1b1)](_0x5433ea){const _0x3c3e0d=a28_0xdd66dd,{options:_0x1a08c0,args:_0x423937,tdx:_0x2ef318}=_0x5433ea,_0x3fde14=_0x423937[0x0];if(!requireNameOrPath(_0x3fde14))return 0x1;_0x1a08c0['verbose']&&console['error'](_0x3c3e0d(0x1ce)+_0x3fde14);const {journeyId:_0x48f845}=await resolveJourneyIdFromInput(_0x3fde14,_0x1a08c0,_0x2ef318),_0x4b6419=await withSpinner(_0x3c3e0d(0x172),()=>_0x2ef318[_0x3c3e0d(0x1bf)][_0x3c3e0d(0x10c)](_0x48f845),{'verbose':_0x1a08c0[_0x3c3e0d(0x1bc)]}),_0x2e3f44=_0x4b6419[_0x3c3e0d(0x14d)];return console['log']('Database:\x20'+_0x2e3f44[_0x3c3e0d(0x174)]),console['log'](_0x3c3e0d(0x188)+_0x2e3f44[_0x3c3e0d(0x1c4)]),await handleSDKOutput(_0x2e3f44['columns'],_0x1a08c0),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x136);['description']=a28_0xdd66dd(0x168);async[a28_0xdd66dd(0x1b1)](_0xbb5d8){const _0x584050=a28_0xdd66dd,{options:_0x28e11b,args:_0x2ca170,tdx:_0x13e801}=_0xbb5d8,_0x4c0865=_0x2ca170[0x0];if(!requireNameOrPath(_0x4c0865))return 0x1;_0x28e11b[_0x584050(0x1bc)]&&console[_0x584050(0x139)]('Input:\x20'+_0x4c0865);const {journeyId:_0x4e33f0}=await resolveJourneyIdFromInput(_0x4c0865,_0x28e11b,_0x13e801),_0x28a6b9=await withSpinner(_0x584050(0x17d),()=>_0x13e801[_0x584050(0x1bf)]['listActivationsFlat'](_0x4e33f0),{'verbose':_0x28e11b[_0x584050(0x1bc)]}),_0x390b32=_0x28a6b9[_0x584050(0x14d)];return console[_0x584050(0x139)](_0x584050(0x171)+_0x390b32[_0x584050(0x1b6)]+_0x584050(0xef)+(_0x390b32[_0x584050(0x1b6)]!==0x1?'s':'')),await handleSDKOutput(_0x390b32,_0x28e11b),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x11a);[a28_0xdd66dd(0x1a4)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a28_0xdd66dd(0x14a)]=new SegmentPushCommand();async[a28_0xdd66dd(0x1b1)](_0x207916){const _0x386057=a28_0xdd66dd,_0x457e6d=_0x207916[_0x386057(0x159)][0x0];let _0x5691bb;if(_0x457e6d){const _0x885b92=await resolveTarget({'arg':_0x457e6d,'contextParent':_0x207916[_0x386057(0x12e)][_0x386057(0xfe)],'cwd':process[_0x386057(0x132)]()});isSuccessfulResolution(_0x885b92)&&_0x885b92[_0x386057(0xf4)]===_0x386057(0x181)&&(_0x5691bb=_0x885b92['filePath']);}const _0x46e8aa={..._0x207916,'options':{..._0x207916[_0x386057(0x12e)],'journeysOnly':!![],..._0x5691bb&&{'singleFilePath':_0x5691bb}}};return this[_0x386057(0x14a)]['execute'](_0x46e8aa);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1d7);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x17f);async[a28_0xdd66dd(0x1b1)](_0x3585ec){const _0x105aee=a28_0xdd66dd,{options:_0x3a287a,args:_0x3d92d1,tdx:_0xc0a5cc}=_0x3585ec,_0x13b5fe=_0x3d92d1[0x0];if(!requireNameOrPath(_0x13b5fe))return 0x1;if(_0x3a287a['verbose'])console['error'](_0x105aee(0x1ce)+_0x13b5fe);const {journeyId:_0x3c4bc4}=await resolveJourneyIdFromInput(_0x13b5fe,_0x3a287a,_0xc0a5cc),_0x661352=await withSpinner('Listing\x20journey\x20versions...',()=>_0xc0a5cc[_0x105aee(0x1bf)][_0x105aee(0xfa)](_0x3c4bc4),{'verbose':_0x3a287a[_0x105aee(0x1bc)]}),{bundleName:_0x441a31,versions:_0xab4e93,latestJourneyId:_0x55bde9}=_0x661352['data'];console[_0x105aee(0x139)](_0x441a31+':\x20'+_0xab4e93[_0x105aee(0x1b6)]+_0x105aee(0x1bb)+(_0xab4e93['length']!==0x1?'s':''));const _0x1d5dee=_0xab4e93[_0x105aee(0x19a)](_0x36ddef=>({'version':_0x36ddef[_0x105aee(0x10f)],'journey_id':_0x36ddef[_0x105aee(0x103)],'name':_0x36ddef[_0x105aee(0x10b)],'state':_0x36ddef[_0x105aee(0x1d6)],'paused':_0x36ddef[_0x105aee(0x127)],'latest':_0x36ddef[_0x105aee(0x103)]===_0x55bde9,'created_at':_0x36ddef['createdAt']}));return await handleSDKOutput(_0x1d5dee,_0x3a287a),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]='journey:version:create';['description']=a28_0xdd66dd(0x1b5);async['execute'](_0x57024a){const _0x815f1e=a28_0xdd66dd,{options:_0x35d942,args:_0x585782,tdx:_0x4ce160}=_0x57024a,_0x39fa07=_0x585782[0x0];if(!requireNameOrPath(_0x39fa07))return 0x1;if(_0x35d942[_0x815f1e(0x1bc)])console[_0x815f1e(0x139)](_0x815f1e(0x1ce)+_0x39fa07);const {journeyId:_0x1d36a2,journeyName:_0x2da028}=await resolveJourneyIdFromInput(_0x39fa07,_0x35d942,_0x4ce160);if(!_0x35d942[_0x815f1e(0x1a1)]){const _0x1d9e36=await confirm(_0x815f1e(0x13a)+_0x2da028+'\x22?');if(!_0x1d9e36)return console[_0x815f1e(0x139)](_0x815f1e(0x187)),0x0;}const _0x2ff36d=await withSpinner(_0x815f1e(0xf9),()=>_0x4ce160[_0x815f1e(0x1bf)]['createVersion'](_0x1d36a2),{'verbose':_0x35d942[_0x815f1e(0x1bc)]}),_0x3f8221=_0x2ff36d[_0x815f1e(0x14d)];return console[_0x815f1e(0x139)](a28_0x1f0e80[_0x815f1e(0x1c0)]('✔')+_0x815f1e(0x1b3)+_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10f)]+_0x815f1e(0x18b)+_0x3f8221[_0x815f1e(0x158)]['name']+'\x22'),console[_0x815f1e(0x139)](_0x815f1e(0x1d5)+_0x3f8221['id']),await handleSingleObjectOutput({'id':_0x3f8221['id'],'name':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10b)],'version':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10f)],'state':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x1d6)],'bundle_id':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x173)],'created_at':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x18d)]},_0x35d942),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1af);['description']='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0xdd66dd(0x1b1)](_0x5cf458){const _0x4dd3f9=a28_0xdd66dd,{options:_0x5d65fb,args:_0x3026fd,tdx:_0x172a97}=_0x5cf458,_0x5dabca=_0x3026fd[0x0];if(!requireNameOrPath(_0x5dabca))return 0x1;const _0x121c19=_0x5d65fb[_0x4dd3f9(0x115)];if(!_0x121c19)return console[_0x4dd3f9(0x139)](_0x4dd3f9(0x15c)),console[_0x4dd3f9(0x139)](_0x4dd3f9(0x129)),0x1;const _0x4727df=parseInt(_0x121c19,0xa);if(isNaN(_0x4727df)||_0x4727df<0x1)return console[_0x4dd3f9(0x139)](_0x4dd3f9(0x1b7)+_0x121c19),0x1;if(_0x5d65fb[_0x4dd3f9(0x1bc)])console['error']('Input:\x20'+_0x5dabca+_0x4dd3f9(0x19c)+_0x4727df);const {journeyId:_0x500aab,parentSegmentId:_0x36ed6c}=await resolveJourneyIdFromInput(_0x5dabca,_0x5d65fb,_0x172a97),_0xbac605=await withSpinner('Resolving\x20version...',()=>_0x172a97[_0x4dd3f9(0x1bf)][_0x4dd3f9(0xfa)](_0x500aab),{'verbose':_0x5d65fb['verbose']}),{versions:_0x3190e0,latestJourneyId:_0x246e32}=_0xbac605['data'],_0x3359ea=_0x3190e0[_0x4dd3f9(0x16b)](_0x21f906=>_0x21f906['versionNumber']===_0x4727df);if(!_0x3359ea){const _0x10bf8b=_0x3190e0['map'](_0x477733=>'v'+_0x477733[_0x4dd3f9(0x10f)])['join'](',\x20');return console['error']('Error:\x20Version\x20'+_0x4727df+_0x4dd3f9(0x1ca)+_0x10bf8b),0x1;}const _0x22ad67=await withSpinner(_0x4dd3f9(0xf5)+_0x4727df+_0x4dd3f9(0x1e3),()=>_0x172a97[_0x4dd3f9(0x1bf)][_0x4dd3f9(0x11d)](_0x3359ea[_0x4dd3f9(0x103)]),{'verbose':_0x5d65fb[_0x4dd3f9(0x1bc)]}),_0x4b85b5=_0x22ad67[_0x4dd3f9(0x14d)],_0x4f3a79=getConsoleNextUrl(_0x5d65fb[_0x4dd3f9(0x1db)],_0x4dd3f9(0x104)+_0x36ed6c+_0x4dd3f9(0x1c3)+_0x3359ea[_0x4dd3f9(0x103)]+_0x4dd3f9(0x1b4));return await handleSingleObjectOutput({'id':_0x4b85b5['id'],'name':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x10b)],'version':_0x4b85b5['attributes'][_0x4dd3f9(0x10f)],'description':_0x4b85b5[_0x4dd3f9(0x158)]['description'],'state':_0x4b85b5['attributes']['state'],'paused':_0x4b85b5['attributes']['paused'],'reentry_mode':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x180)],'stages':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x15b)]?.[_0x4dd3f9(0x1b6)]||0x0,..._0x4b85b5[_0x4dd3f9(0x158)]['goal']&&{'goal':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x179)][_0x4dd3f9(0x10b)]},'latest':_0x3359ea['journeyId']===_0x246e32,'created_at':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x18d)],'updated_at':_0x4b85b5[_0x4dd3f9(0x158)]['updatedAt'],'url':_0x4f3a79},_0x5d65fb),0x0;}}
|
|
1
|
+
const a28_0x28f764=a28_0x1082;(function(_0x5f5d3b,_0x484126){const _0x4b81ef=a28_0x1082,_0x29f6fc=_0x5f5d3b();while(!![]){try{const _0x5c9fd7=parseInt(_0x4b81ef(0x299))/0x1*(-parseInt(_0x4b81ef(0x244))/0x2)+parseInt(_0x4b81ef(0x227))/0x3+-parseInt(_0x4b81ef(0x289))/0x4*(parseInt(_0x4b81ef(0x261))/0x5)+parseInt(_0x4b81ef(0x237))/0x6+parseInt(_0x4b81ef(0x24b))/0x7+-parseInt(_0x4b81ef(0x224))/0x8*(parseInt(_0x4b81ef(0x2b4))/0x9)+-parseInt(_0x4b81ef(0x253))/0xa*(-parseInt(_0x4b81ef(0x26c))/0xb);if(_0x5c9fd7===_0x484126)break;else _0x29f6fc['push'](_0x29f6fc['shift']());}catch(_0x2c76a6){_0x29f6fc['push'](_0x29f6fc['shift']());}}}(a28_0x1bed,0x95669));import a28_0x49ddf2 from'chalk';import a28_0x40243d from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1f33cb){const _0x1c8bc3=a28_0x1082;return!_0x1f33cb&&(console['error'](_0x1c8bc3(0x223)),console[_0x1c8bc3(0x290)](_0x1c8bc3(0x1e8))),!!_0x1f33cb;}function withJsonFormat(_0x4deec6){const _0x45bbd=a28_0x1082;if(!_0x4deec6[_0x45bbd(0x23a)]&&!_0x4deec6[_0x45bbd(0x243)]&&!_0x4deec6[_0x45bbd(0x2a8)]&&!_0x4deec6[_0x45bbd(0x2ac)])return{..._0x4deec6,'format':_0x45bbd(0x243),'json':!![]};return _0x4deec6;}function formatJourneyState(_0x5aaf55){const _0x370e07=a28_0x1082;switch(_0x5aaf55){case _0x370e07(0x2ce):return a28_0x49ddf2[_0x370e07(0x2bd)](_0x370e07(0x2df));case _0x370e07(0x29a):return a28_0x49ddf2[_0x370e07(0x228)](_0x370e07(0x28e));case _0x370e07(0x240):return a28_0x49ddf2['yellow'](_0x370e07(0x2cf));case _0x370e07(0x2c1):return a28_0x49ddf2[_0x370e07(0x1f2)](_0x370e07(0x200));case _0x370e07(0x217):return a28_0x49ddf2[_0x370e07(0x228)](_0x370e07(0x24f));default:return'('+_0x5aaf55+')';}}function formatJourneyItem(_0x408599,_0x817500='',_0x74cf5f){const _0x4639a9=a28_0x1082,_0x2f0adc=formatJourneyState(_0x408599[_0x4639a9(0x2de)]),_0x302b4a=_0x74cf5f?hyperlink(_0x408599[_0x4639a9(0x2b1)],_0x74cf5f):_0x408599['journeyBundleName'];return _0x817500+_0x4639a9(0x230)+_0x302b4a+'\x20'+_0x2f0adc;}function escapeRegex(_0x4bced7){const _0x2a8277=a28_0x1082;return _0x4bced7[_0x2a8277(0x213)](/[.*+?^${}()|[\]\\]/g,_0x2a8277(0x2d8));}function globToRegex(_0x454b4e){const _0x520a32=a28_0x1082,_0x5376fa=_0x454b4e[_0x520a32(0x2a0)]('*')[_0x520a32(0x202)](escapeRegex);return new RegExp(_0x5376fa[_0x520a32(0x2c9)]('.*'),'i');}function buildRuleToNameMapping(_0xde6dee){const _0x3848c5=a28_0x1082,_0x27b31a=new Map();if(_0xde6dee[_0x3848c5(0x1ec)])for(const [_0x265b13,_0x47f732]of Object[_0x3848c5(0x2ab)](_0xde6dee[_0x3848c5(0x1ec)])){if(_0x47f732[_0x3848c5(0x24d)]){const _0x2f4402=serializeRule(_0x47f732[_0x3848c5(0x24d)]),_0xa429c=_0x27b31a['get'](_0x2f4402);_0xa429c?_0xa429c[_0x3848c5(0x20e)](_0x265b13):_0x27b31a[_0x3848c5(0x272)](_0x2f4402,[_0x265b13]);}}return _0x27b31a;}async function resolveJourneyIdFromInput(_0x286823,_0x251586,_0x3139bf){const _0x5ae3c0=a28_0x1082,_0x566dbf=await resolveJourneyTarget(_0x286823,_0x251586[_0x5ae3c0(0x205)],_0x251586[_0x5ae3c0(0x23e)]),_0x24b269=_0x566dbf['parentSegment'];if(!_0x24b269)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x161881=await withSpinner(_0x5ae3c0(0x220),()=>_0x3139bf[_0x5ae3c0(0x28f)][_0x5ae3c0(0x26d)](_0x24b269),{'verbose':_0x251586['verbose']}),_0x18c338=_0x161881[_0x5ae3c0(0x268)],_0x3b8821=await withSpinner('Resolving\x20journey...',()=>_0x3139bf['journey'][_0x5ae3c0(0x288)](_0x18c338,_0x566dbf[_0x5ae3c0(0x298)]),{'verbose':_0x251586[_0x5ae3c0(0x23e)]});return{'journeyId':_0x3b8821[_0x5ae3c0(0x268)],'journeyName':_0x566dbf[_0x5ae3c0(0x298)],'parentSegmentId':_0x18c338};}async function resolveJourneyTarget(_0x4fdecc,_0xf89739,_0x3fb386){const _0x1d298b=a28_0x1082;if(isYamlFilePath(_0x4fdecc))try{const _0x42ad90=await resolveYamlFilePath(_0x4fdecc);return _0x3fb386&&(console['error'](_0x1d298b(0x2c7)+_0x4fdecc),console[_0x1d298b(0x290)]('\x20\x20Parent\x20segment:\x20'+_0x42ad90[_0x1d298b(0x205)]),console[_0x1d298b(0x290)](_0x1d298b(0x2ba)+_0x42ad90[_0x1d298b(0x22a)]),console[_0x1d298b(0x290)]('\x20\x20Folder\x20path:\x20'+(_0x42ad90['folderPath']||_0x1d298b(0x2a5)))),{'journeyName':_0x42ad90[_0x1d298b(0x22a)],'parentSegment':_0x42ad90[_0x1d298b(0x205)],'resolved':_0x42ad90};}catch(_0x71c8d7){throw new SDKError(ErrorCode[_0x1d298b(0x233)],_0x1d298b(0x249)+_0x71c8d7[_0x1d298b(0x291)]);}if(!_0xf89739)throw new SDKError(ErrorCode[_0x1d298b(0x233)],_0x1d298b(0x24a));return{'journeyName':_0x4fdecc,'parentSegment':_0xf89739};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a28_0x28f764(0x2e1)]=a28_0x28f764(0x225);async[a28_0x28f764(0x231)](_0x57c420){const _0x5edccc=a28_0x28f764,{options:_0x5ef3fa,args:_0x5528aa,tdx:_0x2153b8}=_0x57c420,_0x235efa=_0x5528aa[0x0],_0x1000b4=_0x5ef3fa[_0x5edccc(0x205)];if(!_0x1000b4)return console[_0x5edccc(0x290)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x5edccc(0x290)](_0x5edccc(0x25d)),0x1;const _0x5cc985=await withSpinner(_0x5edccc(0x220),()=>_0x2153b8[_0x5edccc(0x28f)][_0x5edccc(0x26d)](_0x1000b4),{'verbose':_0x5ef3fa[_0x5edccc(0x23e)]}),_0x58dc7d=_0x5cc985['data'];_0x5ef3fa[_0x5edccc(0x23e)]&&(console['error']('Parent\x20segment:\x20'+_0x1000b4+_0x5edccc(0x27d)+_0x58dc7d+')'),_0x235efa&&console[_0x5edccc(0x290)](_0x5edccc(0x2dc)+_0x235efa));const _0x1d8649=await withSpinner(_0x5edccc(0x2b6),()=>_0x2153b8[_0x5edccc(0x28f)]['getParentFull'](_0x58dc7d),{'verbose':_0x5ef3fa[_0x5edccc(0x23e)]}),_0x3dad3f=_0x1d8649[_0x5edccc(0x268)],_0x917af7=_0x3dad3f['rootFolderId'],_0x269ba7=await withSpinner(_0x5edccc(0x219),()=>_0x2153b8[_0x5edccc(0x259)][_0x5edccc(0x1fb)](_0x58dc7d,_0x917af7),{'verbose':_0x5ef3fa['verbose']});let _0x13e933=_0x269ba7['data'][_0x5edccc(0x276)];const _0x1fcaba=_0x269ba7['data'][_0x5edccc(0x283)],_0x2f5475=new Map();for(const _0x118bca of _0x1fcaba){_0x2f5475[_0x5edccc(0x272)](_0x118bca['id'],_0x118bca[_0x5edccc(0x2b0)]);}if(_0x235efa){const _0x102263=globToRegex(_0x235efa);_0x13e933=_0x13e933['filter'](_0x60293c=>_0x102263[_0x5edccc(0x25e)](_0x60293c[_0x5edccc(0x2b1)]));}console[_0x5edccc(0x290)](_0x5edccc(0x22b)+_0x13e933[_0x5edccc(0x26f)]+_0x5edccc(0x23d)+(_0x13e933[_0x5edccc(0x26f)]!==0x1?'s':''));const _0x1cc9bd=_0x3b0355=>{const _0x18f061=_0x5edccc;return getConsoleNextUrl(_0x5ef3fa[_0x18f061(0x215)],_0x18f061(0x246)+_0x58dc7d+_0x18f061(0x209)+_0x3b0355+'/j/da');};if(_0x5ef3fa[_0x5edccc(0x23a)]===_0x5edccc(0x1e9))await handleSDKOutput(_0x13e933,_0x5ef3fa);else{if(_0x5ef3fa[_0x5edccc(0x23a)]==='json'){const _0xed3bd9=_0x13e933[_0x5edccc(0x202)](_0x289afd=>({..._0x289afd,'url':_0x1cc9bd(_0x289afd['id'])}));await handleSDKOutput(_0xed3bd9,_0x5ef3fa);}else{console[_0x5edccc(0x1e7)]('['+_0x1000b4+']');const _0x508da7=new Map(),_0xcb186c=[];for(const _0x5bb8e5 of _0x13e933){if(!_0x5bb8e5[_0x5edccc(0x22d)]||_0x5bb8e5[_0x5edccc(0x22d)]===_0x917af7)_0xcb186c[_0x5edccc(0x20e)](_0x5bb8e5);else{const _0x3801ab=_0x508da7[_0x5edccc(0x269)](_0x5bb8e5[_0x5edccc(0x22d)])||[];_0x3801ab[_0x5edccc(0x20e)](_0x5bb8e5),_0x508da7[_0x5edccc(0x272)](_0x5bb8e5[_0x5edccc(0x22d)],_0x3801ab);}}const _0x317802=(_0x26d224,_0x2515a6)=>_0x26d224['journeyBundleName'][_0x5edccc(0x1e4)](_0x2515a6[_0x5edccc(0x2b1)],undefined,{'sensitivity':'base'});_0xcb186c['sort'](_0x317802);for(const _0x30a206 of _0xcb186c){console[_0x5edccc(0x1e7)](formatJourneyItem(_0x30a206,'',_0x1cc9bd(_0x30a206['id'])));}const _0x57325e=[..._0x508da7[_0x5edccc(0x2ab)]()][_0x5edccc(0x1f8)]((_0x5b4cd9,_0x2eec38)=>{const _0x119b5f=_0x5edccc,_0xc8bb4f=_0x2f5475[_0x119b5f(0x269)](_0x5b4cd9[0x0])||_0x5b4cd9[0x0],_0x5c5ccf=_0x2f5475[_0x119b5f(0x269)](_0x2eec38[0x0])||_0x2eec38[0x0];return _0xc8bb4f[_0x119b5f(0x1e4)](_0x5c5ccf,undefined,{'sensitivity':_0x119b5f(0x26e)});});for(const [_0x267a0f,_0x2ce7a7]of _0x57325e){const _0x26d77f=_0x2f5475[_0x5edccc(0x269)](_0x267a0f)||_0x267a0f;console[_0x5edccc(0x1e7)](_0x5edccc(0x229)+_0x26d77f),_0x2ce7a7['sort'](_0x317802);for(const _0xbf6d60 of _0x2ce7a7){console[_0x5edccc(0x1e7)](formatJourneyItem(_0xbf6d60,'\x20\x20',_0x1cc9bd(_0xbf6d60['id'])));}}}}return 0x0;}}function a28_0x1bed(){const _0x44c1a8=['\x20versions)','versionNumber','🗺️\x20','execute','dryRun','INVALID_ARGUMENT','Target\x20directory:\x20','renderStats','listVersions','1934868EGzbua','Input:\x20','Error:\x20--version\x20option\x20is\x20required','format','Available\x20stages:\x20','Write\x20','\x20journey','verbose','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','paused','getLatestJourneyId','journeyBundleId','json','2JAiRjl','\x22\x20not\x20found','/app/ps/','List\x20activations\x20for\x20a\x20journey','then','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','6229678OwDIzx','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','rule','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','(archived)','\x20=\x20','buildIdToEmailMap','\x20->\x20','750plLZjc','red','resume','\x20new\x20files','List\x20all\x20versions\x20of\x20a\x20journey','Creating\x20new\x20version...','journey','journey:versions','cyan','filter','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','test','Getting\x20column\x20mapping...','Getting\x20journey\x20traffic\x20data...','5OMqwSu','file','listFolders','\x20not\x20found.\x20Available:\x20','add','exitOrJumpRate','createVersion','data','get','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)','utf-8','107998bFmmHt','resolveParentId','base','length','user','Resolving\x20version...','set','Listing\x20journey\x20activations...','bold','getStatistics','journeys','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','No\x20journeys\x20found','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','connector_config','\x20\x20-\x20','content','\x20(ID:\x20','hasPeriod','\x20Created\x20v','Error:\x20Version\x20','options','\x20changed\x20files','folders','database','parent_segment','Getting\x20version\x20','find','resolveJourneyId','2055644qHSTQz','no_parent','No\x20statistics\x20available\x20for\x20journey:\x20','goal','from','(draft)','segment','error','message','stage','createdAt','type','...','Error:\x20','errorCode','journeyName','940553iBGsuy','draft','stageNameMap','Found\x20','enteredSize','version','\x20Opening\x20','split','attributes','getJourney','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Database:\x20','(root)','getColumnMapping','Fetching\x20users\x20and\x20connections...','jsonl','journey:version:view','links','entries','tsv','journey:activations','Target\x20file:\x20',',\x20version:\x20','name','journeyBundleName','Resume\x20a\x20paused\x20journey','hasChanges','134982dqTjPE','Folder\x20path:\x20','Fetching\x20parent\x20segment...','journey:pull','tdx.json','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20\x20Name:\x20','journey:push','\x27\x20not\x20found\x20in\x20','green','✔\x20All\x20files\x20are\x20up\x20to\x20date','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','completed','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','history','repeat','goalSize','folderPath','Resolved\x20YAML\x20file:\x20','Error:\x20Stage\x20\x22','join','yellow','✔\x20Context\x20set:\x20','\x20files?','Options:','launched','(paused)','Listing\x20journey\x20versions...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','root\x20folder','exitOrJumpSize','journeyStages','journey:resume','updatedAt','limit','\x5c$&','web','Getting\x20journey\x20details...','isNew','Pattern:\x20','includeHistory','state','(running)','getSegment','description','size','buildIdToNameMap','setPhase','toLowerCase','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Parent\x20segment:\x20','journeyId','targetDir','localeCompare','absolutePath','segmentPushCommand','log','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','table','cwd','helpText','segments','journey:stats','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Error:\x20Journey\x20\x27','Show\x20journey\x20statistics','/j/da/je','blue','journey:version:create','Show\x20journey\x20details','stringify','\x0aError:','reentryMode','sort','\x22\x20paused','Pause\x20a\x20running\x20journey','listJourneysWithFolders','\x22\x20resumed','Fetching\x20','relative','\x20unchanged\x20files','(completed)','relativePath','map','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parentName','parentSegment','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','/e/','values','journey:columns','conversion','\x20\x20Statistics\x20not\x20available','push','includeStats','all','milestoneSize','\x20version','replace','\x20(rule\x20match)','site','\x20\x20Target:\x20','archived','activation','Listing\x20journeys...','Error:\x20Invalid\x20version\x20number:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','stages','connection','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Cancelled','Resolving\x20parent\x20segment...','yes','has','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','8UPbNHR','List\x20journeys\x20in\x20current\x20context','session','397875uYNuTP','dim','📁\x20','segmentName','✔\x20Found\x20','Getting\x20journey\x20statistics...','folderId'];a28_0x1bed=function(){return _0x44c1a8;};return a28_0x1bed();}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a28_0x28f764(0x2e1)]=a28_0x28f764(0x1f4);async['execute'](_0x4e967a){const _0x48db43=a28_0x28f764,{options:_0x373cdf,args:_0x208e85,tdx:_0x40dec5}=_0x4e967a,_0x42aa40=_0x208e85[0x0];if(!_0x42aa40)return console[_0x48db43(0x290)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x48db43(0x290)](_0x48db43(0x1ee)),console[_0x48db43(0x290)](_0x48db43(0x2cd)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x373cdf[_0x48db43(0x23e)]&&console[_0x48db43(0x290)]('Input:\x20'+_0x42aa40);const {journeyId:_0x5ddbff,parentSegmentId:_0x4b27a9}=await resolveJourneyIdFromInput(_0x42aa40,_0x373cdf,_0x40dec5);if(_0x373cdf[_0x48db43(0x2d9)]){const _0x1ec6b2=getConsoleNextUrl(_0x373cdf[_0x48db43(0x215)],'/app/ps/'+_0x4b27a9+'/e/'+_0x5ddbff+_0x48db43(0x1f1));return console[_0x48db43(0x290)](a28_0x49ddf2[_0x48db43(0x2bd)]('✔')+_0x48db43(0x29f)+a28_0x49ddf2[_0x48db43(0x25b)](_0x1ec6b2)),openBrowser(_0x1ec6b2),0x0;}const _0x14a9fe=await withSpinner(_0x48db43(0x2da),()=>_0x40dec5[_0x48db43(0x259)][_0x48db43(0x2a2)](_0x5ddbff),{'verbose':_0x373cdf[_0x48db43(0x23e)]}),_0x5e3b03=_0x14a9fe[_0x48db43(0x268)],_0x588c17=_0x373cdf[_0x48db43(0x20f)];let _0x45c145;if(_0x588c17)try{const _0x39069d=await withSpinner(_0x48db43(0x22c),()=>_0x40dec5[_0x48db43(0x259)][_0x48db43(0x275)](_0x5ddbff),{'verbose':_0x373cdf[_0x48db43(0x23e)]});_0x45c145=_0x39069d['data'];}catch{_0x373cdf['verbose']&&console[_0x48db43(0x290)](_0x48db43(0x20d));}const _0x15cb9a=getConsoleNextUrl(_0x373cdf['site'],_0x48db43(0x246)+_0x4b27a9+_0x48db43(0x209)+_0x5ddbff+_0x48db43(0x1f1)),_0x8fa32b={'id':_0x5e3b03['id'],'name':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x2b0)],'description':_0x5e3b03['attributes'][_0x48db43(0x2e1)],'state':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x2de)],'paused':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x240)],'reentry_mode':_0x5e3b03['attributes']['reentryMode'],'stages':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x2d4)]?.[_0x48db43(0x26f)]||0x0,..._0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x28c)]&&{'goal':_0x5e3b03[_0x48db43(0x2a1)][_0x48db43(0x28c)][_0x48db43(0x2b0)]},..._0x45c145&&{'statistics':{'size':_0x45c145['size'],'entered':_0x45c145['enteredSize'],'goal_achieved':_0x45c145[_0x48db43(0x2c5)],'completion_rate':_0x45c145['completionRate'],'exit_or_jump':_0x45c145[_0x48db43(0x2d3)],'exit_or_jump_rate':_0x45c145['exitOrJumpRate'],'stages':_0x45c145['stages']}},'url':_0x15cb9a};return await handleSingleObjectOutput(_0x8fa32b,_0x373cdf),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x1ed);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x1f0);async[a28_0x28f764(0x231)](_0x5316ff){const _0xa81da=a28_0x28f764,{options:_0x190d48,args:_0x3e7bcd,tdx:_0x576aec}=_0x5316ff,_0x68192c=_0x3e7bcd[0x0];if(!requireNameOrPath(_0x68192c))return 0x1;_0x190d48['verbose']&&console[_0xa81da(0x290)](_0xa81da(0x238)+_0x68192c);const _0x4ab815=_0x190d48,_0x49ab11=_0x4ab815['from'],_0x529af7=_0x4ab815['to'],_0x282787=_0x4ab815['includeHistory'],_0x5594c9=_0x4ab815[_0xa81da(0x292)];_0x282787&&!_0x49ab11&&!_0x529af7&&console['error'](_0xa81da(0x2bf));const _0x25f0f9=_0x282787?withJsonFormat(_0x190d48):_0x190d48,{journeyId:_0x51ed13,journeyName:_0x137d0c}=await resolveJourneyIdFromInput(_0x68192c,_0x25f0f9,_0x576aec),_0xdc15e9=_0x49ab11||_0x529af7?{'from':_0x49ab11,'to':_0x529af7}:undefined,_0x70ffb3=await withSpinner(_0xa81da(0x22c),()=>Promise['all']([_0x576aec[_0xa81da(0x259)][_0xa81da(0x2a2)](_0x51ed13),_0x576aec[_0xa81da(0x259)][_0xa81da(0x275)](_0x51ed13,_0xdc15e9)]),{'verbose':_0x25f0f9[_0xa81da(0x23e)]}),[_0x2e1947,_0x42dc4e]=_0x70ffb3[_0xa81da(0x268)];if(!_0x42dc4e||_0x42dc4e[_0xa81da(0x2e8)]===null)return console[_0xa81da(0x290)](_0xa81da(0x28b)+_0x137d0c),console[_0xa81da(0x290)](_0xa81da(0x2b9)),0x0;const _0x48a405=buildStageNameMap(_0x2e1947),_0x8caca8=!!(_0xdc15e9&&_0x42dc4e[_0xa81da(0x2c3)]?.[_0xa81da(0x26f)]),_0xe2d6e3={'stageNameMap':_0x48a405,'hasPeriod':_0x8caca8,'includeHistory':!!_0x282787};if(_0x5594c9&&_0x42dc4e[_0xa81da(0x21c)]){const _0x4850c1=_0x42dc4e[_0xa81da(0x21c)][_0xa81da(0x287)](_0x5f1306=>{const _0x3c78ce=_0xa81da,_0x482242=_0x48a405[_0x3c78ce(0x269)](_0x5f1306['id'])??'';return _0x482242['toLowerCase']()===_0x5594c9[_0x3c78ce(0x2e5)]();});if(_0x4850c1)return await handleSingleObjectOutput(formatStageStats(_0x4850c1,_0xe2d6e3),_0x25f0f9),0x0;const _0x470b03=_0x42dc4e[_0xa81da(0x21c)]['map'](_0x97df54=>_0x48a405[_0xa81da(0x269)](_0x97df54['id'])??_0x97df54['id']);return console[_0xa81da(0x290)](_0xa81da(0x2c8)+_0x5594c9+_0xa81da(0x245)),console[_0xa81da(0x290)](_0xa81da(0x23b)+_0x470b03[_0xa81da(0x2c9)](',\x20')),0x1;}const _0x2e7857=_0x42dc4e[_0xa81da(0x21c)]?.['map'](_0x4146ec=>formatStageStats(_0x4146ec,_0xe2d6e3)),_0x2f3ffa=assembleJourneyStats(_0x42dc4e,{'from':_0x49ab11,'to':_0x529af7,'includeHistory':_0x282787});return await this[_0xa81da(0x235)](_0x2f3ffa,_0x2e7857??[],_0x25f0f9),0x0;}async[a28_0x28f764(0x235)](_0x474400,_0x1d3172,_0x8fac79){const _0x17e296=a28_0x28f764,_0x24d793=_0x8fac79[_0x17e296(0x23a)]===_0x17e296(0x243)||_0x8fac79[_0x17e296(0x23a)]===_0x17e296(0x2a8)||_0x8fac79[_0x17e296(0x243)]||_0x8fac79[_0x17e296(0x2a8)];if(_0x24d793){_0x474400[_0x17e296(0x21c)]=_0x1d3172,await handleSingleObjectOutput(_0x474400,_0x8fac79);return;}await handleSingleObjectOutput(_0x474400,_0x8fac79);for(const _0x4ddaaa of _0x1d3172){console[_0x17e296(0x1e7)](''),console[_0x17e296(0x1e7)](String(a28_0x49ddf2['cyan'][_0x17e296(0x274)]('['+_0x4ddaaa['name']+']'))+a28_0x49ddf2['dim']('\x20'+_0x4ddaaa['id']));const {id:_0x5ab506,name:_0x3cfc67,..._0x559f17}=_0x4ddaaa;await handleSingleObjectOutput(_0x559f17,_0x8fac79);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x28f764(0x2b0)]='journey:traffic';['description']='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x28f764(0x231)](_0x416e7e){const _0x4b039d=a28_0x28f764,{options:_0x46ec95,args:_0x3e1517,tdx:_0x502a55}=_0x416e7e,_0x335bc2=_0x3e1517[0x0];if(!requireNameOrPath(_0x335bc2))return 0x1;_0x46ec95['verbose']&&console['error']('Input:\x20'+_0x335bc2);const _0x59e4cd=_0x46ec95,_0x7a855a=_0x59e4cd[_0x4b039d(0x294)],_0x7bcf1d=_0x59e4cd[_0x4b039d(0x28d)],_0x50e0f6=_0x59e4cd['to'],_0x381c0b=_0x59e4cd[_0x4b039d(0x2d7)];if(_0x7a855a&&_0x7a855a!==_0x4b039d(0x20c)&&_0x7a855a!=='activation')return console[_0x4b039d(0x290)]('Error:\x20Invalid\x20--type\x20\x22'+_0x7a855a+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5d46b9=withJsonFormat(_0x46ec95),{journeyId:_0x3c3fee,journeyName:_0x48b1a1}=await resolveJourneyIdFromInput(_0x335bc2,_0x5d46b9,_0x502a55),_0x220256={'type':_0x7a855a,'from':_0x7bcf1d,'to':_0x50e0f6,'limit':_0x381c0b},_0x1dac48=await withSpinner(_0x4b039d(0x260),()=>_0x502a55[_0x4b039d(0x259)]['getTrafficData'](_0x3c3fee,_0x220256),{'verbose':_0x5d46b9[_0x4b039d(0x23e)]}),_0x26e8f9=_0x1dac48[_0x4b039d(0x268)],_0x4b635c=_0x26e8f9['conversion']&&(_0x26e8f9[_0x4b039d(0x20c)]['nodes'][_0x4b039d(0x26f)]>0x0||_0x26e8f9['conversion'][_0x4b039d(0x2aa)][_0x4b039d(0x26f)]>0x0),_0x2d0ce3=_0x26e8f9['activation']&&_0x26e8f9[_0x4b039d(0x218)][_0x4b039d(0x26f)]>0x0;if(!_0x4b635c&&!_0x2d0ce3)return console[_0x4b039d(0x290)](_0x4b039d(0x24e)+_0x48b1a1),console[_0x4b039d(0x290)](_0x4b039d(0x277)),_0x7bcf1d&&_0x50e0f6&&console[_0x4b039d(0x290)](_0x4b039d(0x2d1)),0x0;return await handleSingleObjectOutput(_0x26e8f9,_0x5d46b9),0x0;}}function a28_0x1082(_0x1dbea2,_0xc25df8){_0x1dbea2=_0x1dbea2-0x1e3;const _0x1bed24=a28_0x1bed();let _0x108233=_0x1bed24[_0x1dbea2];return _0x108233;}function formatStageStats(_0x323465,_0x43666e){const _0x280ff9=a28_0x28f764,_0x29d8f0=_0x43666e[_0x280ff9(0x27e)]&&_0x323465['history']?.[_0x280ff9(0x26f)]?aggregateStageHistory(_0x323465['history']):{'size':_0x323465[_0x280ff9(0x2e2)],'entered':_0x323465[_0x280ff9(0x29d)],'milestone':_0x323465[_0x280ff9(0x211)],'milestone_rate':_0x323465['completeMilestoneRate'],'exit_or_jump':_0x323465[_0x280ff9(0x2d3)],'exit_or_jump_rate':_0x323465[_0x280ff9(0x266)]},_0x2ccaf4={'id':_0x323465['id'],'name':_0x43666e[_0x280ff9(0x29b)][_0x280ff9(0x269)](_0x323465['id'])??_0x323465['id'],..._0x29d8f0};return _0x43666e[_0x280ff9(0x27e)]&&_0x43666e[_0x280ff9(0x2dd)]&&_0x323465[_0x280ff9(0x2c3)]&&(_0x2ccaf4[_0x280ff9(0x2c3)]=_0x323465[_0x280ff9(0x2c3)]),_0x2ccaf4;}export class JourneyPauseCommand extends BaseCommand{[a28_0x28f764(0x2b0)]='journey:pause';[a28_0x28f764(0x2e1)]=a28_0x28f764(0x1fa);async[a28_0x28f764(0x231)](_0x36b4a5){const _0x4038a4=a28_0x28f764,{options:_0x318f49,args:_0x530c8c,tdx:_0x45a3ad}=_0x36b4a5,_0x59634d=_0x530c8c[0x0];if(!requireNameOrPath(_0x59634d))return 0x1;_0x318f49['verbose']&&console[_0x4038a4(0x290)](_0x4038a4(0x238)+_0x59634d);const {journeyId:_0xaebde2,journeyName:_0x31cb84}=await resolveJourneyIdFromInput(_0x59634d,_0x318f49,_0x45a3ad);if(!_0x318f49[_0x4038a4(0x221)]){const _0x4b56cd=await confirm(_0x4038a4(0x207)+_0x31cb84+'\x22?');if(!_0x4b56cd)return console[_0x4038a4(0x290)](_0x4038a4(0x21f)),0x0;}const _0xfe97e8=await withSpinner('Pausing\x20journey...',()=>_0x45a3ad[_0x4038a4(0x259)]['pause'](_0xaebde2),{'verbose':_0x318f49[_0x4038a4(0x23e)]}),_0x4a5ff9=_0xfe97e8['data'];return console[_0x4038a4(0x290)]('✔\x20Journey\x20\x22'+_0x4a5ff9[_0x4038a4(0x2a1)][_0x4038a4(0x2b0)]+_0x4038a4(0x1f9)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2d5);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x2b2);async[a28_0x28f764(0x231)](_0x23dee5){const _0x51eda4=a28_0x28f764,{options:_0x4f8078,args:_0x24e826,tdx:_0xbd618d}=_0x23dee5,_0x57c946=_0x24e826[0x0];if(!requireNameOrPath(_0x57c946))return 0x1;_0x4f8078[_0x51eda4(0x23e)]&&console['error']('Input:\x20'+_0x57c946);const {journeyId:_0x567715,journeyName:_0x42a500}=await resolveJourneyIdFromInput(_0x57c946,_0x4f8078,_0xbd618d);if(!_0x4f8078[_0x51eda4(0x221)]){const _0x307e38=await confirm(_0x51eda4(0x21b)+_0x42a500+'\x22?');if(!_0x307e38)return console[_0x51eda4(0x290)](_0x51eda4(0x21f)),0x0;}const _0x2ef2e1=await withSpinner('Resuming\x20journey...',()=>_0xbd618d[_0x51eda4(0x259)][_0x51eda4(0x255)](_0x567715),{'verbose':_0x4f8078[_0x51eda4(0x23e)]}),_0x12c0db=_0x2ef2e1[_0x51eda4(0x268)];return console['error']('✔\x20Journey\x20\x22'+_0x12c0db[_0x51eda4(0x2a1)]['name']+_0x51eda4(0x1fc)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2b7);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a28_0x28f764(0x231)](_0x870f00){const _0x2b4585=a28_0x28f764,{options:_0x4f3d60,args:_0x9ac7d6,tdx:_0x3ddd0e}=_0x870f00,_0x4d2464=_0x4f3d60,_0x2c85e9=_0x9ac7d6[0x0],_0x369ef4=_0x2c85e9&&isYamlFilePath(_0x2c85e9),_0x5d11b4=await resolveTarget({'arg':_0x369ef4?_0x2c85e9:undefined,'contextParent':_0x4f3d60[_0x2b4585(0x205)],'cwd':process[_0x2b4585(0x1ea)]()});if(!isSuccessfulResolution(_0x5d11b4))return _0x5d11b4[_0x2b4585(0x297)]===_0x2b4585(0x28a)?(console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2ca)](_0x2b4585(0x2a3))),console[_0x2b4585(0x290)](_0x2b4585(0x26a)),console[_0x2b4585(0x290)](_0x2b4585(0x21e)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x2b4585(0x290)](_0x2b4585(0x279))):(console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x254)](_0x2b4585(0x296)+_0x5d11b4[_0x2b4585(0x291)]+'\x0a')),_0x5d11b4[_0x2b4585(0x1eb)]&&console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x25b)](_0x5d11b4[_0x2b4585(0x1eb)]))),0x1;let _0xd0b8b0=_0x369ef4?undefined:_0x2c85e9,_0x5f2170,_0x1d906d;_0x5d11b4[_0x2b4585(0x294)]===_0x2b4585(0x262)&&(_0xd0b8b0=_0x5d11b4['resourceName'],_0x5f2170=_0x5d11b4['filePath'],_0x1d906d=_0x5d11b4[_0x2b4585(0x2c6)]);const _0x40ef46=_0x5d11b4[_0x2b4585(0x204)],_0x43b3cc=_0x5d11b4[_0x2b4585(0x1e3)];_0x4d2464[_0x2b4585(0x23e)]&&(console['error'](_0x2b4585(0x2e7)+_0x40ef46),console[_0x2b4585(0x290)](_0x2b4585(0x234)+_0x43b3cc),_0xd0b8b0&&console['error']('Journey\x20name:\x20'+_0xd0b8b0),_0x5f2170&&console[_0x2b4585(0x290)](_0x2b4585(0x2ae)+_0x5f2170),_0x1d906d&&console['error'](_0x2b4585(0x2b5)+_0x1d906d));const _0x4070c9=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3ddd0e[_0x2b4585(0x28f)][_0x2b4585(0x26d)](_0x40ef46),{'verbose':_0x4f3d60[_0x2b4585(0x23e)]}),_0x195bc7=_0x4070c9[_0x2b4585(0x268)],{journeys:_0x33bf08,folders:_0x139d0b}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x3ba13f=_0x2b4585,[_0x13bbb2,_0x1b40db]=await Promise['all']([_0x3ddd0e['journey']['listJourneysFromParentSegment'](_0x195bc7,undefined,{'includeAllVersions':!![]}),_0x3ddd0e[_0x3ba13f(0x28f)][_0x3ba13f(0x263)](_0x195bc7)]);return{'journeys':_0x13bbb2,'folders':_0x1b40db};},{'verbose':_0x4f3d60[_0x2b4585(0x23e)]})[_0x2b4585(0x248)](_0x58a825=>_0x58a825[_0x2b4585(0x268)]);let _0x38dd7e=_0x33bf08;const _0x323fec=buildFolderIdToPathMap(_0x139d0b);if(_0xd0b8b0){const _0x136c7d=_0x38dd7e[_0x2b4585(0x25c)](_0x567c0e=>_0x567c0e[_0x2b4585(0x2b1)]['toLowerCase']()===_0xd0b8b0[_0x2b4585(0x2e5)]());if(_0x136c7d[_0x2b4585(0x26f)]===0x0)return console[_0x2b4585(0x290)]('Error:\x20Journey\x20not\x20found:\x20'+_0xd0b8b0),console[_0x2b4585(0x290)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x38dd7e=_0x136c7d;}if(_0x1d906d!==undefined){const _0x482e04=_0x38dd7e[_0x2b4585(0x25c)](_0x4095e0=>{const _0x4fc679=_0x2b4585,_0x3324b7=_0x4095e0[_0x4fc679(0x22d)]?_0x323fec[_0x4fc679(0x269)](_0x4095e0[_0x4fc679(0x22d)])||'':'';return _0x3324b7===_0x1d906d;});if(_0x482e04['length']===0x0&&_0x38dd7e[_0x2b4585(0x26f)]>0x0){console['error'](_0x2b4585(0x1ef)+_0xd0b8b0+_0x2b4585(0x2bc)+(_0x1d906d||_0x2b4585(0x2d2))),console['error'](_0x2b4585(0x23f));for(const _0x32ec49 of _0x38dd7e){const _0x4db3a9=_0x32ec49[_0x2b4585(0x22d)]?_0x323fec[_0x2b4585(0x269)](_0x32ec49[_0x2b4585(0x22d)])||'':'';console[_0x2b4585(0x290)](_0x2b4585(0x27b)+(_0x4db3a9||_0x2b4585(0x2a5))+'/'+_0x32ec49[_0x2b4585(0x2b1)]);}return 0x1;}_0x38dd7e=_0x482e04;}if(_0x38dd7e[_0x2b4585(0x26f)]===0x0)return console[_0x2b4585(0x290)](_0x2b4585(0x278)),0x0;const _0xde5772=new Map();for(const _0x519747 of _0x38dd7e){const _0x1c0eb6=_0x519747[_0x2b4585(0x242)];!_0xde5772['has'](_0x1c0eb6)&&_0xde5772[_0x2b4585(0x272)](_0x1c0eb6,[]),_0xde5772['get'](_0x1c0eb6)['push'](_0x519747);}for(const _0x3c98d0 of _0xde5772[_0x2b4585(0x20a)]()){_0x3c98d0[_0x2b4585(0x1f8)]((_0x324335,_0x52acaf)=>(_0x324335[_0x2b4585(0x22f)]||0x0)-(_0x52acaf[_0x2b4585(0x22f)]||0x0));}const _0x4cd1cf=[],{idToEmailMap:_0x532bf9,connectionIdToNameMap:_0x22e066}=await withSpinner(_0x2b4585(0x2a7),async()=>{const _0x52967b=_0x2b4585,[_0x3ccc04,_0x56d3c9]=await Promise[_0x52967b(0x210)]([_0x3ddd0e[_0x52967b(0x270)][_0x52967b(0x251)](),_0x3ddd0e['connection'][_0x52967b(0x2e3)]()]);return{'idToEmailMap':_0x3ccc04,'connectionIdToNameMap':_0x56d3c9};},{'verbose':_0x4f3d60['verbose']})[_0x2b4585(0x248)](_0x73a7fa=>_0x73a7fa[_0x2b4585(0x268)]);for(const _0x7bc0e9 of _0xde5772[_0x2b4585(0x20a)]()){const _0x171802=_0x7bc0e9[0x0][_0x2b4585(0x2b1)],_0x4244dc=_0x7bc0e9[0x0][_0x2b4585(0x22d)],_0xa22d1=_0x4244dc?_0x323fec[_0x2b4585(0x269)](_0x4244dc)||'':'',_0x6d7ef3=_0xa22d1?a28_0x40243d[_0x2b4585(0x2c9)](_0x43b3cc,_0xa22d1):_0x43b3cc,_0x48ed3f=_0x5f2170||a28_0x40243d[_0x2b4585(0x2c9)](_0x6d7ef3,sanitizeFileName(_0x171802)+'.yml');let _0x433062,_0x37dd05;if(existsSync(_0x48ed3f))try{const _0x8898c5=readFileSync(_0x48ed3f,_0x2b4585(0x26b)),_0x1a9d2f=parseYamlString(_0x8898c5);_0x37dd05=_0x1a9d2f,_0x433062=buildRuleToNameMapping(_0x1a9d2f),_0x4d2464[_0x2b4585(0x23e)]&&_0x433062['size']>0x0&&console[_0x2b4585(0x290)](_0x2b4585(0x29c)+_0x433062[_0x2b4585(0x2e2)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x171802);}catch(_0xae8c27){_0x4d2464[_0x2b4585(0x23e)]&&console[_0x2b4585(0x290)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0xae8c27[_0x2b4585(0x291)]);}const _0x13f3ab=[],_0x2697a5=new Set(),_0x5efb8f=new Map(),_0x5c7143=new Map(),_0x3c9e07=new Set(),_0x4c077a=new Map(),_0x5a3878=new Map(),_0x398cdd=createJumpTargetCache();await withProgressSpinner(_0x2b4585(0x1fd)+_0x171802+_0x2b4585(0x295),async _0x41315c=>{const _0x5033b4=_0x2b4585;for(const _0x5e8f8d of _0x7bc0e9){const _0xe4aa22=_0x7bc0e9['length']>0x1?_0x5e8f8d[_0x5033b4(0x2b1)]+'\x20v'+(_0x5e8f8d[_0x5033b4(0x22f)]||0x1):_0x5e8f8d[_0x5033b4(0x2b1)];_0x41315c[_0x5033b4(0x2e4)](_0x5033b4(0x1fd)+_0xe4aa22);const _0x3b8cfa=await _0x3ddd0e['journey'][_0x5033b4(0x2a2)](_0x5e8f8d['id']),_0x272003=_0x3b8cfa['attributes']?.['audienceId'],_0x62285={'resolveSegment':async _0xec029f=>{const _0xe455e7=_0x5033b4;if(!_0x272003)return{'name':_0xec029f,'isJourneyLocal':![]};const _0x246fa9=_0x5efb8f[_0xe455e7(0x269)](_0xec029f);if(_0x246fa9)return _0x246fa9;try{const _0x2986b=await _0x3ddd0e[_0xe455e7(0x28f)][_0xe455e7(0x2e0)](_0x272003,_0xec029f),_0x26de81=_0x2986b['kind']===SEGMENT_KIND_JOURNEY;let _0x217eca,_0x1288c8=_0x2986b[_0xe455e7(0x2b0)];if(_0x26de81&&_0x2986b[_0xe455e7(0x24d)]){const _0x1c6ec5=await segmentResponseToDef(_0x2986b,{'resolveSegmentName':async _0x54294a=>{const _0x486fac=_0xe455e7,_0x3f71a4=_0x5efb8f[_0x486fac(0x269)](_0x54294a);if(_0x3f71a4)return _0x3f71a4[_0x486fac(0x2b0)];const _0x4d9da9=await _0x62285['resolveSegment'](_0x54294a);return _0x4d9da9[_0x486fac(0x2b0)];}}),_0x3ec7a9=_0x1c6ec5[_0xe455e7(0x24d)];_0x217eca={'description':_0x2986b[_0xe455e7(0x2e1)],'rule':_0x3ec7a9};const _0x3dc1c8=serializeRule(_0x3ec7a9),_0x5b3e3a=_0x5c7143[_0xe455e7(0x269)](_0x3dc1c8);if(_0x5b3e3a)_0x1288c8=_0x5b3e3a,_0x217eca=undefined,_0x4d2464[_0xe455e7(0x23e)]&&console[_0xe455e7(0x290)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x2986b[_0xe455e7(0x2b0)]+_0xe455e7(0x252)+_0x5b3e3a);else{let _0x3b97c7=![];if(_0x433062){const _0x1a16c8=_0x433062['get'](_0x3dc1c8);if(_0x1a16c8){const _0x3d0911=_0x1a16c8[_0xe455e7(0x287)](_0x385d86=>!_0x2697a5[_0xe455e7(0x222)](_0x385d86));_0x3d0911&&(_0x1288c8=_0x3d0911,_0x2697a5[_0xe455e7(0x265)](_0x3d0911),_0x5c7143[_0xe455e7(0x272)](_0x3dc1c8,_0x3d0911),_0x3b97c7=!![],_0x4d2464[_0xe455e7(0x23e)]&&console['error'](_0xe455e7(0x208)+_0x3d0911+_0xe455e7(0x214)));}}if(!_0x3b97c7){const _0x3b748d=generateJourneyLocalName(_0x2986b[_0xe455e7(0x2b0)]);_0x3b748d&&(_0x1288c8=_0x3b748d);let _0x465e9a=_0x1288c8,_0x1ae6ed=0x2;while(_0x2697a5['has'](_0x465e9a)){_0x465e9a=_0x1288c8+'_'+_0x1ae6ed,_0x1ae6ed++;}_0x2697a5[_0xe455e7(0x265)](_0x465e9a),_0x5c7143[_0xe455e7(0x272)](_0x3dc1c8,_0x465e9a),_0x1288c8=_0x465e9a;}}}const _0x450b78={'name':_0x1288c8,'isJourneyLocal':_0x26de81,'definition':_0x217eca};return _0x5efb8f[_0xe455e7(0x272)](_0xec029f,_0x450b78),_0x450b78;}catch(_0x5212fb){return _0x4f3d60[_0xe455e7(0x23e)]&&console[_0xe455e7(0x290)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0xec029f+':\x20'+_0x5212fb[_0xe455e7(0x291)]),{'name':_0xec029f,'isJourneyLocal':![]};}},'resolveActivation':async _0x5d70cd=>{const _0x25c324=_0x5033b4,_0x302a66=_0x4c077a[_0x25c324(0x269)](_0x5d70cd);if(_0x302a66)return _0x302a66;try{const _0x4edcb9=await _0x3ddd0e['journey']['getActivation'](_0x5e8f8d['id'],_0x5d70cd),_0x317aab=journeyActivationStepToYaml(_0x4edcb9,_0x532bf9,_0x22e066),_0x2e95ba=JSON[_0x25c324(0x1f5)]({'name':_0x317aab['name'],'connection':_0x317aab[_0x25c324(0x21d)],'connector_config':_0x317aab[_0x25c324(0x27a)]}),_0x242186=_0x5a3878[_0x25c324(0x269)](_0x2e95ba);if(_0x242186){const _0x4d7169={'name':_0x242186,'isJourneyLocal':!![],'definition':_0x317aab};return _0x4c077a['set'](_0x5d70cd,_0x4d7169),_0x4d7169;}const _0x57a167=_0x4edcb9[_0x25c324(0x2a1)]['activationParams'][_0x25c324(0x2b0)]||_0x5d70cd,_0x5718d1=sanitizeYamlKey(_0x57a167)||'activation_'+_0x5d70cd;let _0xfa0eca=_0x5718d1,_0x470fb9=0x2;while(_0x3c9e07['has'](_0xfa0eca)){_0xfa0eca=_0x5718d1+'_'+_0x470fb9,_0x470fb9++;}_0x3c9e07['add'](_0xfa0eca),_0x5a3878[_0x25c324(0x272)](_0x2e95ba,_0xfa0eca);const _0x371eaa={'name':_0xfa0eca,'isJourneyLocal':!![],'definition':_0x317aab};return _0x4c077a[_0x25c324(0x272)](_0x5d70cd,_0x371eaa),_0x371eaa;}catch(_0x55d718){return _0x4f3d60[_0x25c324(0x23e)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x5d70cd+':\x20'+_0x55d718[_0x25c324(0x291)]),{'name':_0x5d70cd,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x225a72,_0x3357a9)=>{const _0x1012b8=_0x5033b4;return resolveJumpTarget(_0x225a72,_0x3357a9,_0x398cdd,_0x406ad0=>_0x3ddd0e['journey'][_0x1012b8(0x2a2)](_0x406ad0));}},_0x1a390f=await journeyResponseToDef(_0x3b8cfa,_0x62285);_0x13f3ab['push']({'item':_0x5e8f8d,'yaml':_0x1a390f});}},{'verbose':_0x4f3d60[_0x2b4585(0x23e)]});const _0x3f0ea3=await _0x3ddd0e[_0x2b4585(0x259)][_0x2b4585(0x241)](_0x7bc0e9[0x0][_0x2b4585(0x242)]),_0x56cfcb=buildMergedJourneyDef(_0x13f3ab,_0x433062,_0x3f0ea3),_0x562706=normalizeJourneyDef(_0x56cfcb,_0x37dd05),_0x2d10c8=toYamlString(_0x562706),_0x17520e=_0x5f2170||a28_0x40243d[_0x2b4585(0x2c9)](_0x6d7ef3,sanitizeFileName(_0x171802)+'.yml');!_0x5f2170&&_0xa22d1&&!existsSync(_0x6d7ef3)&&mkdirSync(_0x6d7ef3,{'recursive':!![]});const _0x27de6d=a28_0x40243d[_0x2b4585(0x1fe)](process[_0x2b4585(0x1ea)](),_0x17520e);if(existsSync(_0x17520e)){const _0x11c483=readFileSync(_0x17520e,_0x2b4585(0x26b)),_0x145e0d=generateDiff(_0x11c483,_0x2d10c8),_0x16c5ef=hasChanges(_0x145e0d);_0x4cd1cf[_0x2b4585(0x20e)]({'relativePath':_0x27de6d,'absolutePath':_0x17520e,'content':_0x2d10c8,'isNew':![],'hasChanges':_0x16c5ef,'diff':_0x16c5ef?formatDiffWithColors(_0x145e0d):undefined});}else _0x4cd1cf[_0x2b4585(0x20e)]({'relativePath':_0x27de6d,'absolutePath':_0x17520e,'content':_0x2d10c8,'isNew':!![],'hasChanges':![]});}const _0x5df0a8=_0x4cd1cf[_0x2b4585(0x25c)](_0x589b89=>_0x589b89[_0x2b4585(0x2db)]),_0x2fa6b1=_0x4cd1cf['filter'](_0x546020=>!_0x546020[_0x2b4585(0x2db)]&&_0x546020[_0x2b4585(0x2b3)]),_0x265bf5=_0x4cd1cf['filter'](_0x37976f=>!_0x37976f[_0x2b4585(0x2db)]&&!_0x37976f[_0x2b4585(0x2b3)]),_0xf623c5=_0x38dd7e[_0x2b4585(0x26f)],_0xab81d5=_0xde5772[_0x2b4585(0x2e2)],_0x435b75=_0xf623c5>_0xab81d5?'\x20('+_0xf623c5+_0x2b4585(0x22e):'';console[_0x2b4585(0x290)]('\x0aPull\x20summary:'),console[_0x2b4585(0x290)]('\x20\x20'+a28_0x49ddf2[_0x2b4585(0x25b)](_0xab81d5+'\x20journeys')+a28_0x49ddf2[_0x2b4585(0x228)](_0x435b75)),console['error']('\x20\x20'+a28_0x49ddf2['green']('+\x20'+_0x5df0a8['length']+_0x2b4585(0x256))),console[_0x2b4585(0x290)]('\x20\x20'+a28_0x49ddf2[_0x2b4585(0x2ca)]('~\x20'+_0x2fa6b1[_0x2b4585(0x26f)]+_0x2b4585(0x282))),console[_0x2b4585(0x290)]('\x20\x20'+a28_0x49ddf2[_0x2b4585(0x228)]('=\x20'+_0x265bf5[_0x2b4585(0x26f)]+_0x2b4585(0x1ff))),console[_0x2b4585(0x290)](_0x2b4585(0x216)+a28_0x49ddf2['cyan'](_0x43b3cc)+'\x0a');if(_0x2fa6b1[_0x2b4585(0x26f)]>0x0)for(const _0x389bb6 of _0x2fa6b1){console[_0x2b4585(0x290)]('\x0aChanges\x20to\x20\x27'+_0x389bb6[_0x2b4585(0x201)]+'\x27:'),console[_0x2b4585(0x290)]('─'[_0x2b4585(0x2c4)](0x3c)),console[_0x2b4585(0x290)](_0x389bb6['diff']),console['error']('─'[_0x2b4585(0x2c4)](0x3c));}if(_0x4d2464[_0x2b4585(0x232)])return console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2ca)](_0x2b4585(0x2c0))),0x0;if(_0x5df0a8[_0x2b4585(0x26f)]===0x0&&_0x2fa6b1[_0x2b4585(0x26f)]===0x0)return console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2bd)](_0x2b4585(0x2be))),saveSessionContext({'parent_segment':_0x40ef46},_0x4d2464[_0x2b4585(0x226)]),console[_0x2b4585(0x290)](a28_0x49ddf2['green'](_0x2b4585(0x2cb)+a28_0x49ddf2['dim'](_0x2b4585(0x285))+_0x2b4585(0x250)+a28_0x49ddf2[_0x2b4585(0x25b)](_0x40ef46))),0x0;if(!_0x4d2464[_0x2b4585(0x221)]&&(_0x5df0a8[_0x2b4585(0x26f)]>0x0||_0x2fa6b1['length']>0x0)){if(!isInteractive())return console['error'](a28_0x49ddf2[_0x2b4585(0x254)](_0x2b4585(0x1f6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a28_0x49ddf2['dim'](_0x2b4585(0x203))),0x1;const _0x187aa8=await confirmKey(_0x2b4585(0x23c)+(_0x5df0a8[_0x2b4585(0x26f)]+_0x2fa6b1[_0x2b4585(0x26f)])+_0x2b4585(0x2cc));if(!_0x187aa8)return console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2ca)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x43b3cc)&&mkdirSync(_0x43b3cc,{'recursive':!![]});const _0x4fbf58=a28_0x40243d[_0x2b4585(0x2c9)](_0x43b3cc,_0x2b4585(0x2b8));writeFileSync(_0x4fbf58,createTdxConfigContent(_0x40ef46),'utf-8');for(const _0x1d21ef of _0x4cd1cf){(_0x1d21ef[_0x2b4585(0x2db)]||_0x1d21ef[_0x2b4585(0x2b3)])&&writeFileSync(_0x1d21ef[_0x2b4585(0x1e5)],_0x1d21ef[_0x2b4585(0x27c)],'utf-8');}return console[_0x2b4585(0x290)](a28_0x49ddf2[_0x2b4585(0x2bd)]('✔\x20Pulled\x20'+(_0x5df0a8['length']+_0x2fa6b1[_0x2b4585(0x26f)])+'\x20journey\x20files\x20to\x20'+_0x43b3cc)),saveSessionContext({'parent_segment':_0x40ef46},_0x4d2464[_0x2b4585(0x226)]),console['error'](a28_0x49ddf2['green']('✔\x20Context\x20set:\x20'+a28_0x49ddf2[_0x2b4585(0x228)](_0x2b4585(0x285))+_0x2b4585(0x250)+a28_0x49ddf2[_0x2b4585(0x25b)](_0x40ef46))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x20b);['description']='Show\x20journey\x20table\x20column\x20mapping';async[a28_0x28f764(0x231)](_0x1f2e69){const _0x42444a=a28_0x28f764,{options:_0xe43e5f,args:_0x4ed14a,tdx:_0x2d124f}=_0x1f2e69,_0xa15e45=_0x4ed14a[0x0];if(!requireNameOrPath(_0xa15e45))return 0x1;_0xe43e5f[_0x42444a(0x23e)]&&console[_0x42444a(0x290)]('Input:\x20'+_0xa15e45);const {journeyId:_0x5e63e8}=await resolveJourneyIdFromInput(_0xa15e45,_0xe43e5f,_0x2d124f),_0x353128=await withSpinner(_0x42444a(0x25f),()=>_0x2d124f['journey'][_0x42444a(0x2a6)](_0x5e63e8),{'verbose':_0xe43e5f['verbose']}),_0x37a7cb=_0x353128[_0x42444a(0x268)];return console[_0x42444a(0x1e7)](_0x42444a(0x2a4)+_0x37a7cb[_0x42444a(0x284)]),console[_0x42444a(0x1e7)]('Table:\x20'+_0x37a7cb[_0x42444a(0x1e9)]),await handleSDKOutput(_0x37a7cb['columns'],_0xe43e5f),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2ad);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x247);async[a28_0x28f764(0x231)](_0x1eb08f){const _0x36a4c0=a28_0x28f764,{options:_0x1a6e1f,args:_0x56328d,tdx:_0x19872b}=_0x1eb08f,_0x3e160e=_0x56328d[0x0];if(!requireNameOrPath(_0x3e160e))return 0x1;_0x1a6e1f[_0x36a4c0(0x23e)]&&console[_0x36a4c0(0x290)](_0x36a4c0(0x238)+_0x3e160e);const {journeyId:_0x3cf968}=await resolveJourneyIdFromInput(_0x3e160e,_0x1a6e1f,_0x19872b),_0x50952d=await withSpinner(_0x36a4c0(0x273),()=>_0x19872b[_0x36a4c0(0x259)]['listActivationsFlat'](_0x3cf968),{'verbose':_0x1a6e1f[_0x36a4c0(0x23e)]}),_0x29dec1=_0x50952d[_0x36a4c0(0x268)];return console[_0x36a4c0(0x290)](_0x36a4c0(0x29c)+_0x29dec1['length']+'\x20activation'+(_0x29dec1['length']!==0x1?'s':'')),await handleSDKOutput(_0x29dec1,_0x1a6e1f),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2bb);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x24c);[a28_0x28f764(0x1e6)]=new SegmentPushCommand();async[a28_0x28f764(0x231)](_0x5d71fd){const _0x41d868=a28_0x28f764,_0x2636d0=_0x5d71fd['args'][0x0];let _0x9da228;if(_0x2636d0){const _0x1ab1ec=await resolveTarget({'arg':_0x2636d0,'contextParent':_0x5d71fd[_0x41d868(0x281)][_0x41d868(0x205)],'cwd':process[_0x41d868(0x1ea)]()});isSuccessfulResolution(_0x1ab1ec)&&_0x1ab1ec[_0x41d868(0x294)]===_0x41d868(0x262)&&(_0x9da228=_0x1ab1ec['filePath']);}const _0x452a42={..._0x5d71fd,'options':{..._0x5d71fd[_0x41d868(0x281)],'journeysOnly':!![],..._0x9da228&&{'singleFilePath':_0x9da228}}};return this[_0x41d868(0x1e6)]['execute'](_0x452a42);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x25a);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x257);async[a28_0x28f764(0x231)](_0x348814){const _0x123ec1=a28_0x28f764,{options:_0x4eb815,args:_0x2af5bf,tdx:_0x3ef98d}=_0x348814,_0xc166fe=_0x2af5bf[0x0];if(!requireNameOrPath(_0xc166fe))return 0x1;if(_0x4eb815[_0x123ec1(0x23e)])console[_0x123ec1(0x290)]('Input:\x20'+_0xc166fe);const {journeyId:_0x1b9536}=await resolveJourneyIdFromInput(_0xc166fe,_0x4eb815,_0x3ef98d),_0x584dba=await withSpinner(_0x123ec1(0x2d0),()=>_0x3ef98d[_0x123ec1(0x259)][_0x123ec1(0x236)](_0x1b9536),{'verbose':_0x4eb815[_0x123ec1(0x23e)]}),{bundleName:_0x23241e,versions:_0x5e9846,latestJourneyId:_0x386c90}=_0x584dba[_0x123ec1(0x268)];console[_0x123ec1(0x290)](_0x23241e+':\x20'+_0x5e9846[_0x123ec1(0x26f)]+_0x123ec1(0x212)+(_0x5e9846[_0x123ec1(0x26f)]!==0x1?'s':''));const _0x2a198c=_0x5e9846[_0x123ec1(0x202)](_0x353849=>({'version':_0x353849[_0x123ec1(0x22f)],'journey_id':_0x353849['journeyId'],'name':_0x353849['name'],'state':_0x353849[_0x123ec1(0x2de)],'paused':_0x353849[_0x123ec1(0x240)],'latest':_0x353849[_0x123ec1(0x2e8)]===_0x386c90,'created_at':_0x353849[_0x123ec1(0x293)]}));return await handleSDKOutput(_0x2a198c,_0x4eb815),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x1f3);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a28_0x28f764(0x231)](_0x8b71d4){const _0x5c506c=a28_0x28f764,{options:_0x58a4e2,args:_0x2c1bb1,tdx:_0x41d212}=_0x8b71d4,_0xcc1928=_0x2c1bb1[0x0];if(!requireNameOrPath(_0xcc1928))return 0x1;if(_0x58a4e2['verbose'])console[_0x5c506c(0x290)](_0x5c506c(0x238)+_0xcc1928);const {journeyId:_0x47210b,journeyName:_0x1a824d}=await resolveJourneyIdFromInput(_0xcc1928,_0x58a4e2,_0x41d212);if(!_0x58a4e2[_0x5c506c(0x221)]){const _0x52dcef=await confirm(_0x5c506c(0x2c2)+_0x1a824d+'\x22?');if(!_0x52dcef)return console[_0x5c506c(0x290)](_0x5c506c(0x21f)),0x0;}const _0xd579e2=await withSpinner(_0x5c506c(0x258),()=>_0x41d212[_0x5c506c(0x259)][_0x5c506c(0x267)](_0x47210b),{'verbose':_0x58a4e2[_0x5c506c(0x23e)]}),_0xd220ff=_0xd579e2[_0x5c506c(0x268)];return console[_0x5c506c(0x290)](a28_0x49ddf2['green']('✔')+_0x5c506c(0x27f)+_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x22f)]+'\x20(draft)\x20—\x20\x22'+_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x2b0)]+'\x22'),console[_0x5c506c(0x290)]('\x20\x20Journey\x20ID:\x20'+_0xd220ff['id']),await handleSingleObjectOutput({'id':_0xd220ff['id'],'name':_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x2b0)],'version':_0xd220ff['attributes'][_0x5c506c(0x22f)],'state':_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x2de)],'bundle_id':_0xd220ff['attributes'][_0x5c506c(0x242)],'created_at':_0xd220ff[_0x5c506c(0x2a1)][_0x5c506c(0x293)]},_0x58a4e2),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x28f764(0x2b0)]=a28_0x28f764(0x2a9);[a28_0x28f764(0x2e1)]=a28_0x28f764(0x2e6);async[a28_0x28f764(0x231)](_0x22f8b7){const _0x4f96a2=a28_0x28f764,{options:_0x30c248,args:_0x534406,tdx:_0x14e525}=_0x22f8b7,_0x54066c=_0x534406[0x0];if(!requireNameOrPath(_0x54066c))return 0x1;const _0x13e059=_0x30c248[_0x4f96a2(0x29e)];if(!_0x13e059)return console[_0x4f96a2(0x290)](_0x4f96a2(0x239)),console['error'](_0x4f96a2(0x206)),0x1;const _0x44c93d=parseInt(_0x13e059,0xa);if(isNaN(_0x44c93d)||_0x44c93d<0x1)return console[_0x4f96a2(0x290)](_0x4f96a2(0x21a)+_0x13e059),0x1;if(_0x30c248[_0x4f96a2(0x23e)])console[_0x4f96a2(0x290)](_0x4f96a2(0x238)+_0x54066c+_0x4f96a2(0x2af)+_0x44c93d);const {journeyId:_0x42886d,parentSegmentId:_0x123dbb}=await resolveJourneyIdFromInput(_0x54066c,_0x30c248,_0x14e525),_0x1cc7a6=await withSpinner(_0x4f96a2(0x271),()=>_0x14e525[_0x4f96a2(0x259)][_0x4f96a2(0x236)](_0x42886d),{'verbose':_0x30c248[_0x4f96a2(0x23e)]}),{versions:_0x360303,latestJourneyId:_0xab52ee}=_0x1cc7a6[_0x4f96a2(0x268)],_0x1c983b=_0x360303[_0x4f96a2(0x287)](_0x125e92=>_0x125e92[_0x4f96a2(0x22f)]===_0x44c93d);if(!_0x1c983b){const _0x7340fa=_0x360303[_0x4f96a2(0x202)](_0x371810=>'v'+_0x371810[_0x4f96a2(0x22f)])['join'](',\x20');return console[_0x4f96a2(0x290)](_0x4f96a2(0x280)+_0x44c93d+_0x4f96a2(0x264)+_0x7340fa),0x1;}const _0x38b8d0=await withSpinner(_0x4f96a2(0x286)+_0x44c93d+'\x20details...',()=>_0x14e525['journey'][_0x4f96a2(0x2a2)](_0x1c983b[_0x4f96a2(0x2e8)]),{'verbose':_0x30c248[_0x4f96a2(0x23e)]}),_0x5010f4=_0x38b8d0['data'],_0x5e1956=getConsoleNextUrl(_0x30c248['site'],_0x4f96a2(0x246)+_0x123dbb+'/e/'+_0x1c983b[_0x4f96a2(0x2e8)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x5010f4['id'],'name':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x2b0)],'version':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x22f)],'description':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x2e1)],'state':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x2de)],'paused':_0x5010f4[_0x4f96a2(0x2a1)]['paused'],'reentry_mode':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x1f7)],'stages':_0x5010f4[_0x4f96a2(0x2a1)]['journeyStages']?.[_0x4f96a2(0x26f)]||0x0,..._0x5010f4['attributes']['goal']&&{'goal':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x28c)][_0x4f96a2(0x2b0)]},'latest':_0x1c983b['journeyId']===_0xab52ee,'created_at':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x293)],'updated_at':_0x5010f4[_0x4f96a2(0x2a1)][_0x4f96a2(0x2d6)],'url':_0x5e1956},_0x30c248),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x4e7fc1=a29_0x2419;(function(_0x5c0b5d,_0x3366d9){const _0x12bdeb=a29_0x2419,_0x2b93bf=_0x5c0b5d();while(!![]){try{const _0x5314c9=parseInt(_0x12bdeb(0x183))/0x1*(-parseInt(_0x12bdeb(0x199))/0x2)+parseInt(_0x12bdeb(0x1a6))/0x3+-parseInt(_0x12bdeb(0x18e))/0x4*(parseInt(_0x12bdeb(0x193))/0x5)+-parseInt(_0x12bdeb(0x197))/0x6+parseInt(_0x12bdeb(0x1a0))/0x7*(parseInt(_0x12bdeb(0x196))/0x8)+parseInt(_0x12bdeb(0x1a8))/0x9+-parseInt(_0x12bdeb(0x182))/0xa*(-parseInt(_0x12bdeb(0x19c))/0xb);if(_0x5314c9===_0x3366d9)break;else _0x2b93bf['push'](_0x2b93bf['shift']());}catch(_0x53ff47){_0x2b93bf['push'](_0x2b93bf['shift']());}}}(a29_0x14ee,0x5f17c));function a29_0x2419(_0x2e8896,_0x1dba12){_0x2e8896=_0x2e8896-0x177;const _0x14eea7=a29_0x14ee();let _0x24191f=_0x14eea7[_0x2e8896];return _0x24191f;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x14ee(){const _0x5d3c17=['parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','log','green','10096gHhypj','\x20segment\x20file(s)\x20skipped)','parentSegment','name','verbose','205JDVfob','yellow','errorCode','117192zhwIGb','3267654jXCUQV','\x20segment\x20file(s)\x20skipped','44UcHhDn','endsWith','message','209NuOLOB','.yaml','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','dim','161EbjGtF','errors','\x20journey(s)\x20valid','\x20(skipped:\x20','helpText','journey','154281QJhByW','reason','4887216rsOPBk','length','validCount','error','\x20journey(s)\x20with\x20errors,\x20','cyan','warnings','skippedCount','\x20warning(s)\x20found','type','invalidCount','filePath','red','valid','journey:validate','targetDir','Validate\x20journey\x20YAML\x20files','Validation\x20failed:\x20','59770YHxjGR','334NolonO','no_parent','warningCount','\x20error(s)','✔\x20All\x20','execute','filter','file'];a29_0x14ee=function(){return _0x5d3c17;};return a29_0x14ee();}import{existsSync}from'fs';import a29_0x2ff5ff from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a29_0x4e7fc1(0x191)]=a29_0x4e7fc1(0x17e);['description']=a29_0x4e7fc1(0x180);async[a29_0x4e7fc1(0x188)](_0x50ee12){const _0x16216e=a29_0x4e7fc1,{options:_0x43b41b,args:_0xef5461}=_0x50ee12,_0x2c4dad=_0x43b41b,_0x21b9e2=await resolveTarget({'arg':_0xef5461[0x0],'contextParent':_0x43b41b[_0x16216e(0x190)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x21b9e2))return _0x21b9e2[_0x16216e(0x195)]===_0x16216e(0x184)?(console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x194)](_0x16216e(0x18b))),console[_0x16216e(0x1ab)](_0x16216e(0x19e)),console[_0x16216e(0x1ab)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x16216e(0x1ab)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x17c)]('Error:\x20'+_0x21b9e2[_0x16216e(0x19b)]+'\x0a')),_0x21b9e2['helpText']&&console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x1ad)](_0x21b9e2[_0x16216e(0x1a4)]))),0x1;const _0x55bf1b=_0x21b9e2[_0x16216e(0x17f)],_0x42fb48=_0x21b9e2[_0x16216e(0x179)]===_0x16216e(0x18a)?_0x21b9e2[_0x16216e(0x17b)]:undefined;if(!_0x42fb48&&!existsSync(_0x55bf1b))return console['error'](a29_0x2ff5ff['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x55bf1b+'\x0a')),0x1;let _0x4ad84c;if(_0x42fb48){if(!_0x42fb48[_0x16216e(0x19a)]('.yml')&&!_0x42fb48[_0x16216e(0x19a)](_0x16216e(0x19d)))return console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x17c)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x42fb48+'\x0a')),0x1;_0x4ad84c=[_0x42fb48];}else _0x4ad84c=findYamlFiles(_0x55bf1b);if(_0x4ad84c[_0x16216e(0x1a9)]===0x0)return console[_0x16216e(0x1ab)](a29_0x2ff5ff['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x55bf1b+'\x0a')),0x1;const _0x23d204=validateYamlFiles(_0x4ad84c,_0x55bf1b,{'filterType':_0x16216e(0x1a5)}),_0x2f77e0=calculateSummary(_0x23d204),_0x3eec97=_0x23d204[_0x16216e(0x189)](isValidationResult);if(_0x3eec97[_0x16216e(0x1a9)]===0x0)return console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x194)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x55bf1b+'\x0a')),_0x2f77e0[_0x16216e(0x177)]>0x0&&console[_0x16216e(0x1ab)](a29_0x2ff5ff[_0x16216e(0x19f)]('('+_0x2f77e0[_0x16216e(0x177)]+_0x16216e(0x18f))),0x0;for(const _0x5967d4 of _0x23d204){if(!isValidationResult(_0x5967d4)){_0x2c4dad[_0x16216e(0x192)]&&console['log'](a29_0x2ff5ff[_0x16216e(0x19f)]('-\x20'+_0x5967d4['relativePath']+_0x16216e(0x1a3)+_0x5967d4[_0x16216e(0x1a7)]+')'));continue;}const {relativePath:_0x4bdbfb,source:_0x3cb5cd,result:_0x2ca99d}=_0x5967d4;if(_0x2ca99d[_0x16216e(0x17d)]&&_0x2ca99d[_0x16216e(0x1ae)]['length']===0x0)_0x2c4dad[_0x16216e(0x192)]&&console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x18d)]('✔\x20'+_0x4bdbfb));else _0x2ca99d['valid']?(console[_0x16216e(0x18c)](a29_0x2ff5ff['yellow']('⚠\x20'+_0x4bdbfb+':\x20'+_0x2ca99d['warnings'][_0x16216e(0x1a9)]+'\x20warning(s)')),console[_0x16216e(0x18c)](formatValidationResult(_0x2ca99d,_0x3cb5cd,_0x4bdbfb))):(console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x17c)]('✖\x20'+_0x4bdbfb+':\x20'+_0x2ca99d[_0x16216e(0x1a1)][_0x16216e(0x1a9)]+_0x16216e(0x186))),console['log'](formatValidationResult(_0x2ca99d,_0x3cb5cd,_0x4bdbfb)));}return console['log'](''),_0x2f77e0['hasErrors']?(console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x17c)](_0x16216e(0x181)+_0x2f77e0[_0x16216e(0x17a)]+_0x16216e(0x1ac)+_0x2f77e0[_0x16216e(0x1aa)]+'\x20valid')),_0x2f77e0[_0x16216e(0x185)]>0x0&&console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x194)](_0x2f77e0[_0x16216e(0x185)]+_0x16216e(0x178))),_0x2f77e0['skippedCount']>0x0&&console['log'](a29_0x2ff5ff[_0x16216e(0x19f)](_0x2f77e0['skippedCount']+_0x16216e(0x198))),0x1):(console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x18d)](_0x16216e(0x187)+_0x2f77e0[_0x16216e(0x1aa)]+_0x16216e(0x1a2))),_0x2f77e0[_0x16216e(0x185)]>0x0&&console[_0x16216e(0x18c)](a29_0x2ff5ff[_0x16216e(0x194)](_0x2f77e0['warningCount']+_0x16216e(0x178))),_0x2f77e0['skippedCount']>0x0&&console['log'](a29_0x2ff5ff[_0x16216e(0x19f)](_0x2f77e0[_0x16216e(0x177)]+_0x16216e(0x198))),0x0);}}
|