@treasuredata/tdx 2026.3.37 → 2026.3.38
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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.d.ts +8 -2
- package/dist/commands/work-command.d.ts.map +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/work-command.js.map +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.d.ts.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js.map +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.d.ts +9 -7
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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/push-workflow.js.map +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.d.ts +3 -0
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js.map +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/cas.d.ts +2 -1
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/cdp.d.ts +16 -1
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +19 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +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.d.ts +12 -4
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.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_0x55f847=a26_0x581b;function a26_0x581b(_0x2f4dfe,_0x4e5add){_0x2f4dfe=_0x2f4dfe-0x170;const _0x12b697=a26_0x12b6();let _0x581b4c=_0x12b697[_0x2f4dfe];return _0x581b4c;}(function(_0x48a4d0,_0x54fd5a){const _0x5453ae=a26_0x581b,_0x36fb12=_0x48a4d0();while(!![]){try{const _0x4918a8=-parseInt(_0x5453ae(0x18b))/0x1+parseInt(_0x5453ae(0x19a))/0x2*(parseInt(_0x5453ae(0x173))/0x3)+-parseInt(_0x5453ae(0x17e))/0x4+-parseInt(_0x5453ae(0x17b))/0x5*(parseInt(_0x5453ae(0x18f))/0x6)+parseInt(_0x5453ae(0x174))/0x7*(-parseInt(_0x5453ae(0x185))/0x8)+-parseInt(_0x5453ae(0x170))/0x9*(parseInt(_0x5453ae(0x193))/0xa)+parseInt(_0x5453ae(0x17f))/0xb;if(_0x4918a8===_0x54fd5a)break;else _0x36fb12['push'](_0x36fb12['shift']());}catch(_0x32554f){_0x36fb12['push'](_0x36fb12['shift']());}}}(a26_0x12b6,0xd0c80));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x3aa58a from'chalk';import a26_0x25c49b from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']='engage:template:validate';[a26_0x55f847(0x198)]=a26_0x55f847(0x194);async['execute'](_0x375697){const _0x3b7185=a26_0x55f847,{options:_0x1b36a1,args:_0x2790e7}=_0x375697,_0x4b3064=_0x1b36a1,_0x242327=_0x2790e7[0x0],_0x339990=_0x242327?a26_0x25c49b[_0x3b7185(0x18c)](_0x242327):undefined,_0x3d88ae=_0x339990?isYamlFile(_0x339990):![];let _0x2d1d68,_0x242fb4;if(_0x3d88ae&&_0x339990)_0x2d1d68=a26_0x25c49b[_0x3b7185(0x17a)](_0x339990),_0x242fb4=_0x339990;else _0x339990?_0x2d1d68=_0x339990:_0x2d1d68=process[_0x3b7185(0x191)]();if(!_0x242fb4&&!existsSync(_0x2d1d68))return console[_0x3b7185(0x17c)](a26_0x3aa58a[_0x3b7185(0x179)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2d1d68+'\x0a')),0x1;let _0x353902;if(_0x242fb4){if(!_0x242fb4[_0x3b7185(0x177)]('.yml')&&!_0x242fb4['endsWith']('.yaml'))return console[_0x3b7185(0x17c)](a26_0x3aa58a['red'](_0x3b7185(0x184)+_0x242fb4+'\x0a')),0x1;_0x353902=[_0x242fb4];}else _0x353902=findYamlFiles(_0x2d1d68);if(_0x353902[_0x3b7185(0x175)]===0x0)return console['error'](a26_0x3aa58a['red'](_0x3b7185(0x17d)+_0x2d1d68+'\x0a')),0x1;const _0x25749=validateYamlFiles(_0x353902,_0x2d1d68,{'filterType':_0x3b7185(0x195)}),_0x3ee1ba=calculateSummary(_0x25749),_0x44c30c=_0x25749[_0x3b7185(0x188)](isValidationResult);if(_0x44c30c[_0x3b7185(0x175)]===0x0)return console[_0x3b7185(0x17c)](a26_0x3aa58a[_0x3b7185(0x190)](_0x3b7185(0x178)+_0x2d1d68+'\x0a')),_0x3ee1ba[_0x3b7185(0x180)]>0x0&&console[_0x3b7185(0x17c)](a26_0x3aa58a[_0x3b7185(0x171)]('('+_0x3ee1ba[_0x3b7185(0x180)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x1b95f8 of _0x25749){if(!isValidationResult(_0x1b95f8)){_0x4b3064['verbose']&&console[_0x3b7185(0x196)](a26_0x3aa58a[_0x3b7185(0x171)]('-\x20'+_0x1b95f8['relativePath']+_0x3b7185(0x186)+_0x1b95f8['reason']+')'));continue;}const {relativePath:_0x175bb9,source:_0x39174b,result:_0x2fcfcc}=_0x1b95f8;if(_0x2fcfcc['valid']&&_0x2fcfcc[_0x3b7185(0x176)][_0x3b7185(0x175)]===0x0)_0x4b3064['verbose']&&console['log'](a26_0x3aa58a[_0x3b7185(0x192)]('✔\x20'+_0x175bb9));else _0x2fcfcc['valid']?(console['log'](a26_0x3aa58a['yellow']('⚠\x20'+_0x175bb9+':\x20'+_0x2fcfcc['warnings'][_0x3b7185(0x175)]+_0x3b7185(0x18d))),console[_0x3b7185(0x196)](formatValidationResult(_0x2fcfcc,_0x39174b,_0x175bb9))):(console[_0x3b7185(0x196)](a26_0x3aa58a[_0x3b7185(0x179)]('✖\x20'+_0x175bb9+':\x20'+_0x2fcfcc['errors']['length']+_0x3b7185(0x18a))),console[_0x3b7185(0x196)](formatValidationResult(_0x2fcfcc,_0x39174b,_0x175bb9)));}return console[_0x3b7185(0x196)](''),_0x3ee1ba[_0x3b7185(0x187)]?(console[_0x3b7185(0x196)](a26_0x3aa58a[_0x3b7185(0x179)](_0x3b7185(0x182)+_0x3ee1ba[_0x3b7185(0x18e)]+'\x20template(s)\x20with\x20errors,\x20'+_0x3ee1ba['validCount']+_0x3b7185(0x189))),_0x3ee1ba['warningCount']>0x0&&console['log'](a26_0x3aa58a[_0x3b7185(0x190)](_0x3ee1ba['warningCount']+_0x3b7185(0x197))),_0x3ee1ba[_0x3b7185(0x180)]>0x0&&console['log'](a26_0x3aa58a[_0x3b7185(0x171)](_0x3ee1ba['skippedCount']+_0x3b7185(0x183))),0x1):(console[_0x3b7185(0x196)](a26_0x3aa58a[_0x3b7185(0x192)](_0x3b7185(0x172)+_0x3ee1ba[_0x3b7185(0x199)]+_0x3b7185(0x181))),_0x3ee1ba['warningCount']>0x0&&console[_0x3b7185(0x196)](a26_0x3aa58a[_0x3b7185(0x190)](_0x3ee1ba['warningCount']+_0x3b7185(0x197))),_0x3ee1ba[_0x3b7185(0x180)]>0x0&&console[_0x3b7185(0x196)](a26_0x3aa58a[_0x3b7185(0x171)](_0x3ee1ba[_0x3b7185(0x180)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}function a26_0x12b6(){const _0x1f9edc=['warnings','endsWith','No\x20template\x20YAML\x20files\x20found\x20in\x20','red','dirname','4345fQDKMZ','error','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','5101704swvlbQ','48652549mykTqV','skippedCount','\x20template(s)\x20valid','Validation\x20failed:\x20','\x20non-template\x20file(s)\x20skipped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','72wJmkPl','\x20(skipped:\x20','hasErrors','filter','\x20valid','\x20error(s)','793940MvnJEy','resolve','\x20warning(s)','invalidCount','1098NEWMyT','yellow','cwd','green','1244070anvzqt','Validate\x20template\x20YAML\x20files','template','log','\x20warning(s)\x20found','description','validCount','322lnvVnq','90qdzDvf','dim','✔\x20All\x20','8721bmNIfh','438165XjdroF','length'];a26_0x12b6=function(){return _0x1f9edc;};return a26_0x12b6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x39ba4c=a27_0x497c;(function(_0x42c8f3,_0x577c84){const _0x2635f1=a27_0x497c,_0x54adf4=_0x42c8f3();while(!![]){try{const _0x12a23d=-parseInt(_0x2635f1(0x13c))/0x1+parseInt(_0x2635f1(0x11b))/0x2+-parseInt(_0x2635f1(0x130))/0x3+-parseInt(_0x2635f1(0xec))/0x4+-parseInt(_0x2635f1(0xf9))/0x5+parseInt(_0x2635f1(0x13d))/0x6+-parseInt(_0x2635f1(0xf7))/0x7*(-parseInt(_0x2635f1(0xf4))/0x8);if(_0x12a23d===_0x577c84)break;else _0x54adf4['push'](_0x54adf4['shift']());}catch(_0x15fcd1){_0x54adf4['push'](_0x54adf4['shift']());}}}(a27_0x49e7,0x9217b));function a27_0x497c(_0x144fff,_0x4f18b4){_0x144fff=_0x144fff-0xe6;const _0x49e794=a27_0x49e7();let _0x497c59=_0x49e794[_0x144fff];return _0x497c59;}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_0xe4d50b from'chalk';function formatDuration(_0x456331){const _0x46f810=a27_0x497c;if(_0x456331<0x3c)return _0x456331+'s';if(_0x456331<0xe10)return Math['floor'](_0x456331/0x3c)+'m\x20'+_0x456331%0x3c+'s';const _0x50a4cc=Math['floor'](_0x456331/0xe10),_0x4997b8=Math[_0x46f810(0xed)](_0x456331%0xe10/0x3c);return _0x4997b8>0x0?_0x50a4cc+'h\x20'+_0x4997b8+'m':_0x50a4cc+'h';}function formatRelativeTime(_0xbb6fce){const _0x965938=a27_0x497c,_0x5a7301=Date['now']()-_0xbb6fce[_0x965938(0x116)](),_0x25584d=Math[_0x965938(0xed)](Math[_0x965938(0x12d)](_0x5a7301)/0x3e8);if(_0x25584d<0x3c)return _0x965938(0x10d);const _0x43b062=Math[_0x965938(0xed)](_0x25584d/0x3c);if(_0x43b062<0x3c)return _0x43b062+_0x965938(0x119);const _0x2ffa30=Math[_0x965938(0xed)](_0x43b062/0x3c);if(_0x2ffa30<0x18)return _0x2ffa30+_0x965938(0x115);const _0x5516e7=Math[_0x965938(0xed)](_0x2ffa30/0x18);if(_0x5516e7<0x1e)return _0x5516e7+_0x965938(0x137);return Math[_0x965938(0xed)](_0x5516e7/0x1e)+_0x965938(0x10a);}export class JobListCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]='jobs';['description']=a27_0x39ba4c(0xfa);async[a27_0x39ba4c(0xe6)](_0x3ad46c){const _0x2c00e6=a27_0x39ba4c,{options:_0x197c04,tdx:_0x44195a}=_0x3ad46c,_0x52636b=resolveLimit(_0x197c04[_0x2c00e6(0xfe)],DEFAULT_DISPLAY_LIMIT),_0x3e6921=_0x197c04[_0x2c00e6(0x122)];_0x197c04[_0x2c00e6(0x108)]&&(console[_0x2c00e6(0x141)](_0x2c00e6(0x110)+_0x52636b+_0x2c00e6(0x11d)),_0x3e6921&&console[_0x2c00e6(0x141)](_0x2c00e6(0x12c)+_0x3e6921));const _0x28d0b2=await withSpinner(_0x2c00e6(0x128),()=>_0x44195a['jobs']['list']({'from':0x0,'to':_0x52636b-0x1,'status':_0x3e6921}),{'verbose':_0x197c04[_0x2c00e6(0x108)]}),_0x412da3=_0x28d0b2[_0x2c00e6(0xf8)];console[_0x2c00e6(0x141)](_0x2c00e6(0x129)+_0x412da3[_0x2c00e6(0x135)]+_0x2c00e6(0x138)+(_0x412da3[_0x2c00e6(0x135)]!==0x1?'s':''));const _0x295a87=_0x197c04[_0x2c00e6(0x101)];if(isStructuredFormat(_0x197c04)){const _0x285446=_0x412da3[_0x2c00e6(0x134)](_0x11c526=>{const _0x14a343=_0x2c00e6;let _0xd60726;if(_0x11c526[_0x14a343(0x123)]&&_0x11c526[_0x14a343(0xe9)]){const _0x32779e=new Date(_0x11c526['start_at'])[_0x14a343(0x116)](),_0x2f48e7=new Date(_0x11c526['end_at'])[_0x14a343(0x116)]();_0xd60726=Math['round']((_0x2f48e7-_0x32779e)/0x3e8);}return{'job_id':_0x11c526[_0x14a343(0x12e)],'type':_0x11c526[_0x14a343(0xeb)]===_0x14a343(0x121)?_0x14a343(0x104):_0x11c526[_0x14a343(0xeb)],'status':_0x11c526[_0x14a343(0x122)],'user_name':_0x11c526[_0x14a343(0x113)],'duration_sec':_0xd60726,'created_at':_0x11c526[_0x14a343(0x125)],'started_at':_0x11c526[_0x14a343(0x123)],'end_at':_0x11c526['end_at']};});await handleSDKOutput(_0x285446,_0x197c04);}else for(const _0x338f05 of _0x412da3){const _0x515058=_0x338f05['status']===_0x2c00e6(0xf2)?a27_0xe4d50b[_0x2c00e6(0x11e)]:_0x338f05[_0x2c00e6(0x122)]===_0x2c00e6(0x141)?a27_0xe4d50b[_0x2c00e6(0x11a)]:a27_0xe4d50b[_0x2c00e6(0xef)],_0x414c78=_0x515058(_0x338f05[_0x2c00e6(0x122)]),_0x1ecd4b=getJobUrl(_0x295a87,_0x338f05['job_id']),_0x466a91=hyperlink(_0x338f05['job_id'],_0x1ecd4b),_0x5d5d51=a27_0xe4d50b['dim'](_0x338f05['type']===_0x2c00e6(0x121)?'trino':_0x338f05[_0x2c00e6(0xeb)]),_0x164323=[];if(_0x338f05[_0x2c00e6(0x123)]&&_0x338f05[_0x2c00e6(0xe9)]){const _0x3a55f5=Math['round']((new Date(_0x338f05['end_at'])['getTime']()-new Date(_0x338f05[_0x2c00e6(0x123)])[_0x2c00e6(0x116)]())/0x3e8);_0x164323[_0x2c00e6(0x112)](formatDuration(_0x3a55f5));}if(_0x338f05[_0x2c00e6(0xe9)])_0x164323[_0x2c00e6(0x112)](formatRelativeTime(new Date(_0x338f05[_0x2c00e6(0xe9)])));else _0x338f05['start_at']&&_0x164323[_0x2c00e6(0x112)](formatRelativeTime(new Date(_0x338f05[_0x2c00e6(0x123)])));const _0xc4b985=_0x164323[_0x2c00e6(0x135)]>0x0?a27_0xe4d50b[_0x2c00e6(0xef)]('\x20'+_0x164323[_0x2c00e6(0x10c)](',\x20')):'';console[_0x2c00e6(0x11c)]('⚡\x20'+_0x466a91+'\x20'+_0x5d5d51+'\x20'+_0x414c78+_0xc4b985);}return 0x0;}}function a27_0x49e7(){const _0x4426da=['job:kill','site','submit','args','trino','\x27\x20to\x20verify\x20the\x20job\x20status','job:result','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','verbose','Show\x20job\x20details','mo\x20ago','✔\x20Job\x20submitted','join','just\x20now','Job\x20type:\x20','Kill\x20a\x20job','Limit:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','push','user_name','Submitting\x20kill\x20request...','h\x20ago','getTime','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','debug','m\x20ago','red','2268842IyeVrm','log','\x20jobs','green','result','job:show','presto','status','start_at','jobType','created_at','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Query:\x20','Listing\x20jobs...','✔\x20Found\x20','INVALID_ARGUMENT','\x20row','Status\x20filter:\x20','abs','job_id','Cancelled','601965xzCuKe','database','yes','Submit\x20a\x20job','map','length','✔\x20Retrieved\x20','d\x20ago','\x20job','...','description','priority','924066vxrMJe','742518kVBLfY','kill','validate','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','error','execute','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','No\x20SQL\x20statements\x20found\x20in\x20file','end_at','Getting\x20job\x20results...','type','4756472EvwWpk','floor','Getting\x20job\x20details...','dim','Get\x20job\x20results','Database:\x20','success','jobs','163928QDjwpW','hive','file','959IXnWyt','data','5766035zCEsNN','List\x20jobs','name','query','information_schema','limit','Submitting\x20job...'];a27_0x49e7=function(){return _0x4426da;};return a27_0x49e7();}export class JobShowCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]=a27_0x39ba4c(0x120);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0x109);[a27_0x39ba4c(0x13f)](_0xf4184a){const _0x2e4828=a27_0x39ba4c,_0x4cf2ff=_0xf4184a[_0x2e4828(0x103)][0x0];if(!_0x4cf2ff)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a27_0x39ba4c(0xe6)](_0x34094d){const _0x2c0f41=a27_0x39ba4c,{options:_0x421db4,args:_0x10ac9e,tdx:_0x3735ad}=_0x34094d,_0x598bd3=_0x10ac9e[0x0],_0x4a7044=await withSpinner(_0x2c0f41(0xee),()=>_0x3735ad[_0x2c0f41(0xf3)]['show'](_0x598bd3),{'verbose':_0x421db4[_0x2c0f41(0x108)]}),_0x3d49e5=_0x4a7044[_0x2c0f41(0xf8)];let _0x55df22;if(_0x3d49e5['start_at']&&_0x3d49e5[_0x2c0f41(0xe9)]){const _0x336101=new Date(_0x3d49e5[_0x2c0f41(0x123)])[_0x2c0f41(0x116)](),_0x349b1c=new Date(_0x3d49e5[_0x2c0f41(0xe9)])[_0x2c0f41(0x116)]();_0x55df22=Math['round']((_0x349b1c-_0x336101)/0x3e8);}const _0x2c1cc8={'job_id':_0x3d49e5[_0x2c0f41(0x12e)],'type':_0x3d49e5[_0x2c0f41(0xeb)],'status':_0x3d49e5['status'],..._0x3d49e5['user_name']&&{'user_name':_0x3d49e5[_0x2c0f41(0x113)]},..._0x55df22!==undefined&&{'duration_sec':_0x55df22},..._0x3d49e5[_0x2c0f41(0x125)]&&{'created_at':_0x3d49e5['created_at']},..._0x3d49e5[_0x2c0f41(0x123)]&&{'started_at':_0x3d49e5[_0x2c0f41(0x123)]},..._0x3d49e5[_0x2c0f41(0xe9)]&&{'end_at':_0x3d49e5[_0x2c0f41(0xe9)]},..._0x3d49e5[_0x2c0f41(0x131)]&&{'database':_0x3d49e5[_0x2c0f41(0x131)]},..._0x3d49e5[_0x2c0f41(0x13b)]!==undefined&&{'priority':_0x3d49e5['priority']},..._0x3d49e5['url']&&{'url':_0x3d49e5['url']},..._0x3d49e5[_0x2c0f41(0xfc)]&&{'query':_0x3d49e5[_0x2c0f41(0xfc)]},..._0x3d49e5[_0x2c0f41(0x118)]&&{'debug':_0x3d49e5['debug']}};return await handleSingleObjectOutput(_0x2c1cc8,_0x421db4),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]=a27_0x39ba4c(0x100);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0x10f);[a27_0x39ba4c(0x13f)](_0x6cd483){const _0x35e359=a27_0x39ba4c,_0x2293d2=_0x6cd483[_0x35e359(0x103)][0x0];if(!_0x2293d2)return _0x35e359(0x140);return undefined;}async[a27_0x39ba4c(0xe6)](_0x11e8c6){const _0x23aee3=a27_0x39ba4c,{options:_0x533f5f,args:_0x242dd7,tdx:_0x178d9d}=_0x11e8c6,_0x3717f6=_0x242dd7[0x0];if(!_0x533f5f[_0x23aee3(0x132)]){const _0x5980a0=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x3717f6+'?');if(!_0x5980a0)return console[_0x23aee3(0x141)](_0x23aee3(0x12f)),0x0;}return await withSpinner(_0x23aee3(0x114),()=>_0x178d9d[_0x23aee3(0xf3)][_0x23aee3(0x13e)](_0x3717f6),{'verbose':_0x533f5f[_0x23aee3(0x108)]}),console[_0x23aee3(0x141)](_0x23aee3(0x107)+_0x3717f6),console['error'](_0x23aee3(0xe7)+_0x3717f6+_0x23aee3(0x105)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]='job:submit';['description']=a27_0x39ba4c(0x133);async[a27_0x39ba4c(0xe6)](_0x3688df){const _0xbb8281=a27_0x39ba4c,{options:_0x5307e8,args:_0x19705e,tdx:_0x60befc}=_0x3688df,_0x3c0824=_0x5307e8[_0xbb8281(0x124)]||_0xbb8281(0x104),_0x190bed=_0x5307e8[_0xbb8281(0xf6)],_0x46195b=_0x5307e8[_0xbb8281(0x131)]||_0xbb8281(0xfd),_0x4126c2=_0x5307e8[_0xbb8281(0x11f)];if(_0x3c0824!==_0xbb8281(0x104)&&_0x3c0824!==_0xbb8281(0xf5))throw new SDKError(ErrorCode[_0xbb8281(0x12a)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x155916;if(_0x190bed){if(_0x19705e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xbb8281(0x111));const _0x491365=readSqlStatementsFromFile(_0x190bed);if(_0x491365[_0xbb8281(0x135)]===0x0)throw new SDKError(ErrorCode[_0xbb8281(0x12a)],_0xbb8281(0xe8));if(_0x491365[_0xbb8281(0x135)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x155916=_0x491365[0x0];}else{if(!_0x19705e[0x0])throw new SDKError(ErrorCode[_0xbb8281(0x12a)],_0xbb8281(0x126));_0x155916=_0x19705e[0x0];}_0x5307e8[_0xbb8281(0x108)]&&(console['error'](_0xbb8281(0x10e)+_0x3c0824),console[_0xbb8281(0x141)](_0xbb8281(0xf1)+_0x46195b),console[_0xbb8281(0x141)](_0xbb8281(0x127)+_0x155916['substring'](0x0,0x64)+(_0x155916[_0xbb8281(0x135)]>0x64?_0xbb8281(0x139):'')));const _0x18019d=await withSpinner(_0xbb8281(0xff),()=>_0x60befc['jobs'][_0xbb8281(0x102)](_0x46195b,_0x155916,_0x3c0824,_0x4126c2),{'verbose':_0x5307e8[_0xbb8281(0x108)]}),_0x17416b=_0x18019d['data'];return console['error'](_0xbb8281(0x10b)),console[_0xbb8281(0x141)]('\x20\x20Job\x20ID:\x20'+_0x17416b['job_id']),await handleSDKOutput([_0x17416b],_0x5307e8),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a27_0x39ba4c(0x106);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0xf0);[a27_0x39ba4c(0x13f)](_0x51065e){const _0x3cb235=a27_0x39ba4c,_0x373a60=_0x51065e[_0x3cb235(0x103)][0x0];if(!_0x373a60)return _0x3cb235(0x117);return undefined;}async[a27_0x39ba4c(0xe6)](_0xbb925c){const _0x3f4665=a27_0x39ba4c,{options:_0x1528a5,args:_0x16ad5d,tdx:_0x1ef085}=_0xbb925c,_0x5f3022=_0x16ad5d[0x0],_0x1dd3eb=await withSpinner(_0x3f4665(0xea),()=>_0x1ef085[_0x3f4665(0xf3)][_0x3f4665(0x11f)](_0x5f3022),{'verbose':_0x1528a5[_0x3f4665(0x108)]}),_0x3300df=_0x1dd3eb['data'];return console[_0x3f4665(0x141)](_0x3f4665(0x136)+_0x3300df[_0x3f4665(0x135)]+_0x3f4665(0x12b)+(_0x3300df[_0x3f4665(0x135)]!==0x1?'s':'')),await handleSDKOutput(_0x3300df,_0x1528a5),0x0;}}
|
|
1
|
+
const a27_0x5b5175=a27_0x291c;(function(_0x389bcc,_0xfcedff){const _0x478976=a27_0x291c,_0x3d113f=_0x389bcc();while(!![]){try{const _0x208fb3=-parseInt(_0x478976(0x1c8))/0x1*(parseInt(_0x478976(0x1e1))/0x2)+-parseInt(_0x478976(0x1b7))/0x3+-parseInt(_0x478976(0x1ed))/0x4*(parseInt(_0x478976(0x1d5))/0x5)+-parseInt(_0x478976(0x1b2))/0x6+-parseInt(_0x478976(0x1c3))/0x7*(parseInt(_0x478976(0x1c2))/0x8)+-parseInt(_0x478976(0x1db))/0x9*(-parseInt(_0x478976(0x1e6))/0xa)+parseInt(_0x478976(0x1bc))/0xb*(parseInt(_0x478976(0x1b5))/0xc);if(_0x208fb3===_0xfcedff)break;else _0x3d113f['push'](_0x3d113f['shift']());}catch(_0x419138){_0x3d113f['push'](_0x3d113f['shift']());}}}(a27_0x6d96,0x5ddcc));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a27_0x291c(_0x40c7ab,_0x42e684){_0x40c7ab=_0x40c7ab-0x1b2;const _0x6d967=a27_0x6d96();let _0x291cec=_0x6d967[_0x40c7ab];return _0x291cec;}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_0x4c1dc3 from'chalk';function formatDuration(_0xab9881){const _0x58fca3=a27_0x291c;if(_0xab9881<0x3c)return _0xab9881+'s';if(_0xab9881<0xe10)return Math[_0x58fca3(0x1ba)](_0xab9881/0x3c)+'m\x20'+_0xab9881%0x3c+'s';const _0x44503f=Math['floor'](_0xab9881/0xe10),_0x27fdd4=Math[_0x58fca3(0x1ba)](_0xab9881%0xe10/0x3c);return _0x27fdd4>0x0?_0x44503f+'h\x20'+_0x27fdd4+'m':_0x44503f+'h';}function formatRelativeTime(_0x5f19e0){const _0xfb2205=a27_0x291c,_0x19e5a9=Date[_0xfb2205(0x1f2)]()-_0x5f19e0['getTime'](),_0x36a178=Math[_0xfb2205(0x1ba)](Math[_0xfb2205(0x1d9)](_0x19e5a9)/0x3e8);if(_0x36a178<0x3c)return _0xfb2205(0x1c9);const _0x15b524=Math['floor'](_0x36a178/0x3c);if(_0x15b524<0x3c)return _0x15b524+'m\x20ago';const _0x23a3d1=Math[_0xfb2205(0x1ba)](_0x15b524/0x3c);if(_0x23a3d1<0x18)return _0x23a3d1+'h\x20ago';const _0x26fe6e=Math[_0xfb2205(0x1ba)](_0x23a3d1/0x18);if(_0x26fe6e<0x1e)return _0x26fe6e+_0xfb2205(0x1cf);return Math[_0xfb2205(0x1ba)](_0x26fe6e/0x1e)+_0xfb2205(0x1d8);}export class JobListCommand extends BaseCommand{[a27_0x5b5175(0x1f7)]=a27_0x5b5175(0x1bd);[a27_0x5b5175(0x1f5)]='List\x20jobs';async[a27_0x5b5175(0x1df)](_0x73a5dc){const _0x9fdb34=a27_0x5b5175,{options:_0x2fd719,tdx:_0x255c7f}=_0x73a5dc,_0x225c9d=resolveLimit(_0x2fd719['limit'],DEFAULT_DISPLAY_LIMIT),_0x44d842=_0x2fd719['status'];_0x2fd719[_0x9fdb34(0x1c7)]&&(console['error'](_0x9fdb34(0x1c4)+_0x225c9d+_0x9fdb34(0x1c0)),_0x44d842&&console['error'](_0x9fdb34(0x1fb)+_0x44d842));const _0x2d826f=await withSpinner('Listing\x20jobs...',()=>_0x255c7f[_0x9fdb34(0x1bd)]['list']({'from':0x0,'to':_0x225c9d-0x1,'status':_0x44d842}),{'verbose':_0x2fd719[_0x9fdb34(0x1c7)]}),_0x37998c=_0x2d826f[_0x9fdb34(0x20a)];console[_0x9fdb34(0x1b6)](_0x9fdb34(0x1d0)+_0x37998c[_0x9fdb34(0x1fa)]+'\x20job'+(_0x37998c[_0x9fdb34(0x1fa)]!==0x1?'s':''));const _0x4e59d0=_0x2fd719[_0x9fdb34(0x1bf)];if(isStructuredFormat(_0x2fd719)){const _0x47d84c=_0x37998c[_0x9fdb34(0x1da)](_0x572f53=>{const _0x1613be=_0x9fdb34;let _0x27dd24;if(_0x572f53['start_at']&&_0x572f53[_0x1613be(0x1fc)]){const _0xf73ca7=new Date(_0x572f53['start_at'])[_0x1613be(0x201)](),_0x4fe617=new Date(_0x572f53[_0x1613be(0x1fc)])[_0x1613be(0x201)]();_0x27dd24=Math[_0x1613be(0x1ea)]((_0x4fe617-_0xf73ca7)/0x3e8);}return{'job_id':_0x572f53['job_id'],'type':_0x572f53['type']===_0x1613be(0x205)?_0x1613be(0x1fe):_0x572f53['type'],'status':_0x572f53[_0x1613be(0x1d3)],'user_name':_0x572f53[_0x1613be(0x1b4)],'duration_sec':_0x27dd24,'created_at':_0x572f53['created_at'],'started_at':_0x572f53['start_at'],'end_at':_0x572f53['end_at']};});await handleSDKOutput(_0x47d84c,_0x2fd719);}else for(const _0x462a79 of _0x37998c){const _0x2d7dae=_0x462a79['status']===_0x9fdb34(0x1be)?a27_0x4c1dc3['green']:_0x462a79[_0x9fdb34(0x1d3)]===_0x9fdb34(0x1b6)?a27_0x4c1dc3['red']:a27_0x4c1dc3['dim'],_0x41618d=_0x2d7dae(_0x462a79['status']),_0x56a80f=getJobUrl(_0x4e59d0,_0x462a79[_0x9fdb34(0x202)]),_0x3eb10e=hyperlink(_0x462a79[_0x9fdb34(0x202)],_0x56a80f),_0xbecc84=a27_0x4c1dc3[_0x9fdb34(0x1b9)](_0x462a79[_0x9fdb34(0x1e5)]==='presto'?_0x9fdb34(0x1fe):_0x462a79[_0x9fdb34(0x1e5)]),_0x4a9347=[];if(_0x462a79[_0x9fdb34(0x1dc)]&&_0x462a79['end_at']){const _0x47a886=Math[_0x9fdb34(0x1ea)]((new Date(_0x462a79[_0x9fdb34(0x1fc)])['getTime']()-new Date(_0x462a79[_0x9fdb34(0x1dc)])['getTime']())/0x3e8);_0x4a9347[_0x9fdb34(0x1f3)](formatDuration(_0x47a886));}if(_0x462a79[_0x9fdb34(0x1fc)])_0x4a9347[_0x9fdb34(0x1f3)](formatRelativeTime(new Date(_0x462a79[_0x9fdb34(0x1fc)])));else _0x462a79[_0x9fdb34(0x1dc)]&&_0x4a9347[_0x9fdb34(0x1f3)](formatRelativeTime(new Date(_0x462a79[_0x9fdb34(0x1dc)])));const _0x2ac8f5=_0x4a9347['length']>0x0?a27_0x4c1dc3['dim']('\x20'+_0x4a9347[_0x9fdb34(0x1f9)](',\x20')):'';console[_0x9fdb34(0x1b8)]('⚡\x20'+_0x3eb10e+'\x20'+_0xbecc84+'\x20'+_0x41618d+_0x2ac8f5);}return 0x0;}}function a27_0x6d96(){const _0x537968=['124zyhgvL','kill','No\x20SQL\x20statements\x20found\x20in\x20file','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','file','now','push','information_schema','description','jobType','name','\x20\x20Job\x20ID:\x20','join','length','Status\x20filter:\x20','end_at','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','trino','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','hive','getTime','job_id','Query:\x20','priority','presto','Get\x20job\x20results','submit','Kill\x20a\x20job','Submitting\x20job...','data','job:show','2032668kLsvZL','\x27\x20to\x20verify\x20the\x20job\x20status','user_name','327408rCkpRI','error','155634OjVuMg','log','dim','floor','Cancelled','1067KGGBzx','jobs','success','site','\x20jobs','Submitting\x20kill\x20request...','16DQkIKO','2632889CSTIqW','Limit:\x20','job:submit','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','verbose','6824tJPsyG','just\x20now','created_at','yes','args','debug','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','d\x20ago','✔\x20Found\x20','database','Getting\x20job\x20details...','status','INVALID_ARGUMENT','91585YKUZwe','validate','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','mo\x20ago','abs','map','9AUgZpX','start_at','Database:\x20','query','execute','✔\x20Job\x20submitted','174aEDwOl','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','type','423370LBbckk','job:result','substring','url','round','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Job\x20type:\x20'];a27_0x6d96=function(){return _0x537968;};return a27_0x6d96();}export class JobShowCommand extends BaseCommand{[a27_0x5b5175(0x1f7)]=a27_0x5b5175(0x20b);[a27_0x5b5175(0x1f5)]='Show\x20job\x20details';[a27_0x5b5175(0x1d6)](_0x254955){const _0x32a171=a27_0x5b5175,_0x143a3f=_0x254955[_0x32a171(0x1cc)][0x0];if(!_0x143a3f)return _0x32a171(0x1e4);return undefined;}async[a27_0x5b5175(0x1df)](_0x43f1bb){const _0x3b8d69=a27_0x5b5175,{options:_0x3bc224,args:_0x2e5926,tdx:_0x14d5c8}=_0x43f1bb,_0xf0d47a=_0x2e5926[0x0],_0x16f077=await withSpinner(_0x3b8d69(0x1d2),()=>_0x14d5c8[_0x3b8d69(0x1bd)]['show'](_0xf0d47a),{'verbose':_0x3bc224[_0x3b8d69(0x1c7)]}),_0x333034=_0x16f077[_0x3b8d69(0x20a)];let _0x3678f0;if(_0x333034[_0x3b8d69(0x1dc)]&&_0x333034['end_at']){const _0x170808=new Date(_0x333034['start_at'])[_0x3b8d69(0x201)](),_0x3e6564=new Date(_0x333034[_0x3b8d69(0x1fc)])[_0x3b8d69(0x201)]();_0x3678f0=Math['round']((_0x3e6564-_0x170808)/0x3e8);}const _0x283245={'job_id':_0x333034[_0x3b8d69(0x202)],'type':_0x333034[_0x3b8d69(0x1e5)],'status':_0x333034[_0x3b8d69(0x1d3)],..._0x333034[_0x3b8d69(0x1b4)]&&{'user_name':_0x333034[_0x3b8d69(0x1b4)]},..._0x3678f0!==undefined&&{'duration_sec':_0x3678f0},..._0x333034[_0x3b8d69(0x1ca)]&&{'created_at':_0x333034['created_at']},..._0x333034[_0x3b8d69(0x1dc)]&&{'started_at':_0x333034[_0x3b8d69(0x1dc)]},..._0x333034[_0x3b8d69(0x1fc)]&&{'end_at':_0x333034[_0x3b8d69(0x1fc)]},..._0x333034[_0x3b8d69(0x1d1)]&&{'database':_0x333034[_0x3b8d69(0x1d1)]},..._0x333034[_0x3b8d69(0x204)]!==undefined&&{'priority':_0x333034['priority']},..._0x333034[_0x3b8d69(0x1e9)]&&{'url':_0x333034[_0x3b8d69(0x1e9)]},..._0x333034[_0x3b8d69(0x1de)]&&{'query':_0x333034[_0x3b8d69(0x1de)]},..._0x333034[_0x3b8d69(0x1cd)]&&{'debug':_0x333034[_0x3b8d69(0x1cd)]}};return await handleSingleObjectOutput(_0x283245,_0x3bc224),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x5b5175(0x1f7)]='job:kill';['description']=a27_0x5b5175(0x208);[a27_0x5b5175(0x1d6)](_0x5243bd){const _0x560cab=a27_0x5b5175,_0x5b78e1=_0x5243bd[_0x560cab(0x1cc)][0x0];if(!_0x5b78e1)return _0x560cab(0x1d7);return undefined;}async['execute'](_0x114137){const _0x44214e=a27_0x5b5175,{options:_0x18fb56,args:_0x1fe7b4,tdx:_0x1cbc1c}=_0x114137,_0x2056a5=_0x1fe7b4[0x0];if(!_0x18fb56[_0x44214e(0x1cb)]){const _0x428b24=await confirm(_0x44214e(0x1c6)+_0x2056a5+'?');if(!_0x428b24)return console['error'](_0x44214e(0x1bb)),0x0;}return await withSpinner(_0x44214e(0x1c1),()=>_0x1cbc1c[_0x44214e(0x1bd)][_0x44214e(0x1ee)](_0x2056a5),{'verbose':_0x18fb56[_0x44214e(0x1c7)]}),console[_0x44214e(0x1b6)](_0x44214e(0x1ff)+_0x2056a5),console[_0x44214e(0x1b6)](_0x44214e(0x1e3)+_0x2056a5+_0x44214e(0x1b3)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x5b5175(0x1f7)]=a27_0x5b5175(0x1c5);[a27_0x5b5175(0x1f5)]='Submit\x20a\x20job';async[a27_0x5b5175(0x1df)](_0x3a8d67){const _0x426c75=a27_0x5b5175,{options:_0x184b9e,args:_0x3fde02,tdx:_0x8137c8}=_0x3a8d67,_0x4f5423=_0x184b9e[_0x426c75(0x1f6)]||_0x426c75(0x1fe),_0x248901=_0x184b9e[_0x426c75(0x1f1)],_0x5d6bc9=_0x184b9e[_0x426c75(0x1d1)]||_0x426c75(0x1f4),_0xc1e950=_0x184b9e['result'];if(_0x4f5423!==_0x426c75(0x1fe)&&_0x4f5423!==_0x426c75(0x200))throw new SDKError(ErrorCode[_0x426c75(0x1d4)],_0x426c75(0x1e2));let _0x4f8c7d;if(_0x248901){if(_0x3fde02[0x0])throw new SDKError(ErrorCode[_0x426c75(0x1d4)],_0x426c75(0x1eb));const _0xac44a6=readSqlStatementsFromFile(_0x248901);if(_0xac44a6[_0x426c75(0x1fa)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x426c75(0x1ef));if(_0xac44a6[_0x426c75(0x1fa)]>0x1)throw new SDKError(ErrorCode[_0x426c75(0x1d4)],_0x426c75(0x1fd));_0x4f8c7d=_0xac44a6[0x0];}else{if(!_0x3fde02[0x0])throw new SDKError(ErrorCode[_0x426c75(0x1d4)],_0x426c75(0x1f0));_0x4f8c7d=_0x3fde02[0x0];}_0x184b9e[_0x426c75(0x1c7)]&&(console[_0x426c75(0x1b6)](_0x426c75(0x1ec)+_0x4f5423),console[_0x426c75(0x1b6)](_0x426c75(0x1dd)+_0x5d6bc9),console[_0x426c75(0x1b6)](_0x426c75(0x203)+_0x4f8c7d[_0x426c75(0x1e8)](0x0,0x64)+(_0x4f8c7d[_0x426c75(0x1fa)]>0x64?'...':'')));const _0x16c69e=await withSpinner(_0x426c75(0x209),()=>_0x8137c8[_0x426c75(0x1bd)][_0x426c75(0x207)](_0x5d6bc9,_0x4f8c7d,_0x4f5423,_0xc1e950),{'verbose':_0x184b9e['verbose']}),_0x50bab1=_0x16c69e['data'];return console[_0x426c75(0x1b6)](_0x426c75(0x1e0)),console[_0x426c75(0x1b6)](_0x426c75(0x1f8)+_0x50bab1[_0x426c75(0x202)]),await handleSDKOutput([_0x50bab1],_0x184b9e),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x5b5175(0x1f7)]=a27_0x5b5175(0x1e7);[a27_0x5b5175(0x1f5)]=a27_0x5b5175(0x206);['validate'](_0x226195){const _0x1ebad0=a27_0x5b5175,_0x1cbe03=_0x226195[_0x1ebad0(0x1cc)][0x0];if(!_0x1cbe03)return _0x1ebad0(0x1ce);return undefined;}async[a27_0x5b5175(0x1df)](_0x455f9e){const _0x1cf477=a27_0x5b5175,{options:_0x339631,args:_0x210743,tdx:_0x31d88a}=_0x455f9e,_0x1b96f8=_0x210743[0x0],_0x1ec196=await withSpinner('Getting\x20job\x20results...',()=>_0x31d88a[_0x1cf477(0x1bd)]['result'](_0x1b96f8),{'verbose':_0x339631[_0x1cf477(0x1c7)]}),_0x3e54a8=_0x1ec196[_0x1cf477(0x20a)];return console[_0x1cf477(0x1b6)]('✔\x20Retrieved\x20'+_0x3e54a8[_0x1cf477(0x1fa)]+'\x20row'+(_0x3e54a8[_0x1cf477(0x1fa)]!==0x1?'s':'')),await handleSDKOutput(_0x3e54a8,_0x339631),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a28_0x41d493=a28_0x3602;(function(_0x530381,_0x49cf0d){const _0x3abcb2=a28_0x3602,_0x3f15e9=_0x530381();while(!![]){try{const _0x30b307=-parseInt(_0x3abcb2(0x13f))/0x1+parseInt(_0x3abcb2(0x15d))/0x2+-parseInt(_0x3abcb2(0x175))/0x3+parseInt(_0x3abcb2(0x170))/0x4*(parseInt(_0x3abcb2(0x152))/0x5)+parseInt(_0x3abcb2(0x147))/0x6+parseInt(_0x3abcb2(0x125))/0x7*(parseInt(_0x3abcb2(0x185))/0x8)+-parseInt(_0x3abcb2(0x14d))/0x9;if(_0x30b307===_0x49cf0d)break;else _0x3f15e9['push'](_0x3f15e9['shift']());}catch(_0x21b21c){_0x3f15e9['push'](_0x3f15e9['shift']());}}}(a28_0x19be,0x4a984));import a28_0x458e20 from'chalk';import a28_0x3d093a 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';function a28_0x3602(_0x4daaac,_0x591cf7){_0x4daaac=_0x4daaac-0xbd;const _0x19be5c=a28_0x19be();let _0x36024a=_0x19be5c[_0x4daaac];return _0x36024a;}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(_0x2bbd45){const _0x5afb22=a28_0x3602;return!_0x2bbd45&&(console[_0x5afb22(0x16c)](_0x5afb22(0x1c3)),console[_0x5afb22(0x16c)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x2bbd45;}function withJsonFormat(_0x2e0631){const _0x4e5317=a28_0x3602;if(!_0x2e0631[_0x4e5317(0x10f)]&&!_0x2e0631['json']&&!_0x2e0631[_0x4e5317(0x1c6)]&&!_0x2e0631[_0x4e5317(0x14c)])return{..._0x2e0631,'format':'json','json':!![]};return _0x2e0631;}function formatJourneyState(_0x45ab39){const _0x506019=a28_0x3602;switch(_0x45ab39){case _0x506019(0xe6):return a28_0x458e20[_0x506019(0x1ac)]('(running)');case'draft':return a28_0x458e20[_0x506019(0x1c4)](_0x506019(0xeb));case _0x506019(0xe2):return a28_0x458e20[_0x506019(0xf0)](_0x506019(0x186));case _0x506019(0x1c2):return a28_0x458e20[_0x506019(0x119)]('(completed)');case _0x506019(0x153):return a28_0x458e20[_0x506019(0x1c4)](_0x506019(0x183));default:return'('+_0x45ab39+')';}}function formatJourneyItem(_0x3f3567,_0x4d6756='',_0xa054){const _0x35edb5=a28_0x3602,_0x13c8ca=formatJourneyState(_0x3f3567[_0x35edb5(0x133)]),_0x4a0c8e=_0xa054?hyperlink(_0x3f3567[_0x35edb5(0x197)],_0xa054):_0x3f3567[_0x35edb5(0x197)];return _0x4d6756+_0x35edb5(0x13d)+_0x4a0c8e+'\x20'+_0x13c8ca;}function escapeRegex(_0x20f17d){const _0x5687de=a28_0x3602;return _0x20f17d[_0x5687de(0xda)](/[.*+?^${}()|[\]\\]/g,_0x5687de(0x17b));}function globToRegex(_0x2c6a54){const _0x4ace8f=a28_0x3602,_0x59c00a=_0x2c6a54[_0x4ace8f(0x10a)]('*')[_0x4ace8f(0x143)](escapeRegex);return new RegExp(_0x59c00a[_0x4ace8f(0x1a8)]('.*'),'i');}function buildRuleToNameMapping(_0x5c40b3){const _0x82ede=a28_0x3602,_0x1dd2f9=new Map();if(_0x5c40b3[_0x82ede(0x150)])for(const [_0x396902,_0x3dbc26]of Object['entries'](_0x5c40b3[_0x82ede(0x150)])){if(_0x3dbc26[_0x82ede(0x1ba)]){const _0x1e6b74=serializeRule(_0x3dbc26[_0x82ede(0x1ba)]),_0x1a868e=_0x1dd2f9[_0x82ede(0x174)](_0x1e6b74);_0x1a868e?_0x1a868e[_0x82ede(0xde)](_0x396902):_0x1dd2f9['set'](_0x1e6b74,[_0x396902]);}}return _0x1dd2f9;}async function resolveJourneyIdFromInput(_0x2c36e5,_0x5e6367,_0x368fc4){const _0x40614e=a28_0x3602,_0x3b9ddc=await resolveJourneyTarget(_0x2c36e5,_0x5e6367[_0x40614e(0x182)],_0x5e6367[_0x40614e(0x181)]),_0x5db834=_0x3b9ddc[_0x40614e(0x182)];if(!_0x5db834)throw new SDKError(ErrorCode[_0x40614e(0x16f)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x1d45ef=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x368fc4[_0x40614e(0x18d)][_0x40614e(0x178)](_0x5db834),{'verbose':_0x5e6367[_0x40614e(0x181)]}),_0x162313=_0x1d45ef[_0x40614e(0x11f)],_0x1d29c8=await withSpinner('Resolving\x20journey...',()=>_0x368fc4[_0x40614e(0x14b)]['resolveJourneyId'](_0x162313,_0x3b9ddc[_0x40614e(0x140)]),{'verbose':_0x5e6367['verbose']});return{'journeyId':_0x1d29c8[_0x40614e(0x11f)],'journeyName':_0x3b9ddc[_0x40614e(0x140)],'parentSegmentId':_0x162313};}function a28_0x19be(){const _0x75cf5a=['journey:push','split','options','entries','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Parent\x20segment:\x20','format','args','folderPath','Fetching\x20','cwd','conversion','Getting\x20journey\x20traffic\x20data...','parentName','Database:\x20','\x22\x20paused','blue','\x20not\x20found.\x20Available:\x20','Show\x20journey\x20table\x20column\x20mapping','folderId','Resolved\x20YAML\x20file:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','data','✔\x20Found\x20','Export\x20journey(s)\x20as\x20YAML\x20files','\x20(rule\x20match)','log','helpText','1061767BLdfbK','repeat','yes','dryRun','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','getParentFull','Error:\x20Stage\x20\x22','createdAt','✔\x20Pulled\x20','Error:\x20Journey\x20not\x20found:\x20','Getting\x20journey\x20statistics...','-\x20no\x20files\x20written','pause','state','listJourneysWithFolders','Write\x20','Listing\x20journey\x20versions...','hasChanges','\x20unchanged\x20files','journeyId','Resume\x20a\x20paused\x20journey','\x20->\x20','stage','🗺️\x20','attributes','528918YVArOa','journeyName','name','content','map','test','renderStats','exitOrJumpSize','3066762cVqRXg','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Getting\x20journey\x20details...','\x20(draft)\x20—\x20\x22','journey','tsv','6213033nRFSgw','\x20details...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','segments','no_parent','499145hsaPsZ','archived','/e/','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Folder\x20path:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','getJourney','\x20=\x20','toLowerCase','connector_config','Pause\x20a\x20running\x20journey','454806nhgJXR','add','exitOrJumpRate','journey:traffic','/j/da/je','\x20journeys','segmentName','cyan','columns','\x22\x20resumed','goalSize','getLatestJourneyId','getStatistics','Getting\x20version\x20','database','error','diff','journey:resume','INVALID_ARGUMENT','20DlFEXa','Options:','activation','Error:\x20Invalid\x20--type\x20\x22','get','958812eJiQLh','set','relative','resolveParentId','journeyBundleId','\x0aChanges\x20to\x20\x27','\x5c$&','Fetching\x20users\x20and\x20connections...','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','folders','audienceId','✔\x20Context\x20set:\x20','verbose','parentSegment','(archived)','web','32KPhvLx','(paused)','\x20Opening\x20','Folder\x20path:\x20','\x20\x20-\x20','user','journey:list','connection','segment','includeHistory','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','red','List\x20journeys\x20in\x20current\x20context','json','has','errorCode','Show\x20journey\x20details','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleName','/app/ps/','getTrafficData','history','filter','journeys','isNew','\x20versions)','parent_segment','from','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','.yml','Table:\x20','journeyStages','targetDir','List\x20all\x20versions\x20of\x20a\x20journey','Error:\x20Version\x20','join','journey:activations','table','resolveSegment','green','segmentPushCommand','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Cancelled','sort','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Pattern:\x20','rootFolderId','stages','milestoneSize','buildIdToEmailMap','rule','Journey\x20name:\x20','Input:\x20','✔\x20Journey\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','List\x20activations\x20for\x20a\x20journey','find','getActivation','completed','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','dim','Resolving\x20version...','jsonl','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','versionNumber','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','site','reentryMode','\x0aPull\x20summary:','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','file','utf-8','getSegment','journey:pause','Fetching\x20journeys\x20and\x20folders...','Parent\x20segment:\x20','\x20\x20Journey\x20ID:\x20','activationParams','all','\x20activation','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','session','/j/da','Aborted.','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','completeMilestoneRate','description','completionRate','\x20journey\x20files\x20to\x20','stringify','size','replace','Listing\x20journey\x20activations...','buildIdToNameMap','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','push','listVersions','Resolving\x20parent\x20segment...','\x27\x20not\x20found\x20in\x20','paused','Resuming\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','localeCompare','launched','(root)','stageNameMap','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20\x20Name:\x20','(draft)','Target\x20directory:\x20','message','Show\x20journey\x20statistics','Found\x20','yellow','\x20\x20Statistics\x20not\x20available','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journey:pull','length','execute','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Creating\x20new\x20version...','then','updatedAt','\x20files?','filePath','Getting\x20column\x20mapping...','limit','\x20(ID:\x20','journey:view','listFolders','base','type','goal','resourceName','journey:versions','resume',',\x20version:\x20','Available\x20stages:\x20'];a28_0x19be=function(){return _0x75cf5a;};return a28_0x19be();}async function resolveJourneyTarget(_0x4722c1,_0x4370e1,_0x13efef){const _0x38392e=a28_0x3602;if(isYamlFilePath(_0x4722c1))try{const _0x2beea0=await resolveYamlFilePath(_0x4722c1);return _0x13efef&&(console[_0x38392e(0x16c)](_0x38392e(0x11d)+_0x4722c1),console[_0x38392e(0x16c)](_0x38392e(0x10e)+_0x2beea0[_0x38392e(0x182)]),console[_0x38392e(0x16c)](_0x38392e(0xea)+_0x2beea0['segmentName']),console[_0x38392e(0x16c)](_0x38392e(0x156)+(_0x2beea0[_0x38392e(0x111)]||_0x38392e(0xe7)))),{'journeyName':_0x2beea0[_0x38392e(0x163)],'parentSegment':_0x2beea0[_0x38392e(0x182)],'resolved':_0x2beea0};}catch(_0x299707){throw new SDKError(ErrorCode[_0x38392e(0x16f)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x299707[_0x38392e(0xed)]);}if(!_0x4370e1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x38392e(0x10d));return{'journeyName':_0x4722c1,'parentSegment':_0x4370e1};}export class JourneyListCommand extends BaseCommand{['name']=a28_0x41d493(0x18b);[a28_0x41d493(0xd5)]=a28_0x41d493(0x191);async[a28_0x41d493(0xf5)](_0x379983){const _0xaa3a2c=a28_0x41d493,{options:_0x5e92e1,args:_0x1afd77,tdx:_0x955a12}=_0x379983,_0x2ecf99=_0x1afd77[0x0],_0x16e87a=_0x5e92e1[_0xaa3a2c(0x182)];if(!_0x16e87a)return console[_0xaa3a2c(0x16c)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0xaa3a2c(0x1b0)),0x1;const _0xab2517=await withSpinner(_0xaa3a2c(0xe0),()=>_0x955a12['segment']['resolveParentId'](_0x16e87a),{'verbose':_0x5e92e1['verbose']}),_0x38508b=_0xab2517['data'];_0x5e92e1[_0xaa3a2c(0x181)]&&(console[_0xaa3a2c(0x16c)](_0xaa3a2c(0xca)+_0x16e87a+_0xaa3a2c(0xfe)+_0x38508b+')'),_0x2ecf99&&console[_0xaa3a2c(0x16c)](_0xaa3a2c(0x1b5)+_0x2ecf99));const _0x25cdff=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x955a12['segment'][_0xaa3a2c(0x12b)](_0x38508b),{'verbose':_0x5e92e1[_0xaa3a2c(0x181)]}),_0x2b460c=_0x25cdff[_0xaa3a2c(0x11f)],_0x28b4ae=_0x2b460c[_0xaa3a2c(0x1b6)],_0x1172bc=await withSpinner('Listing\x20journeys...',()=>_0x955a12[_0xaa3a2c(0x14b)][_0xaa3a2c(0x134)](_0x38508b,_0x28b4ae),{'verbose':_0x5e92e1['verbose']});let _0x1eb2eb=_0x1172bc['data'][_0xaa3a2c(0x19c)];const _0x4e8b8b=_0x1172bc[_0xaa3a2c(0x11f)][_0xaa3a2c(0x17e)],_0x464544=new Map();for(const _0x5b765c of _0x4e8b8b){_0x464544[_0xaa3a2c(0x176)](_0x5b765c['id'],_0x5b765c[_0xaa3a2c(0x141)]);}if(_0x2ecf99){const _0xc42e09=globToRegex(_0x2ecf99);_0x1eb2eb=_0x1eb2eb[_0xaa3a2c(0x19b)](_0x51a549=>_0xc42e09[_0xaa3a2c(0x144)](_0x51a549['journeyBundleName']));}console[_0xaa3a2c(0x16c)](_0xaa3a2c(0x120)+_0x1eb2eb[_0xaa3a2c(0xf4)]+'\x20journey'+(_0x1eb2eb['length']!==0x1?'s':''));const _0x2df40a=_0x51cb24=>{const _0x574dc6=_0xaa3a2c;return getConsoleNextUrl(_0x5e92e1[_0x574dc6(0xc0)],_0x574dc6(0x198)+_0x38508b+_0x574dc6(0x154)+_0x51cb24+_0x574dc6(0xd1));};if(_0x5e92e1[_0xaa3a2c(0x10f)]===_0xaa3a2c(0x1aa))await handleSDKOutput(_0x1eb2eb,_0x5e92e1);else{if(_0x5e92e1[_0xaa3a2c(0x10f)]===_0xaa3a2c(0x192)){const _0x438c2b=_0x1eb2eb[_0xaa3a2c(0x143)](_0xb59d45=>({..._0xb59d45,'url':_0x2df40a(_0xb59d45['id'])}));await handleSDKOutput(_0x438c2b,_0x5e92e1);}else{console['log']('['+_0x16e87a+']');const _0x4060e8=new Map(),_0x57c603=[];for(const _0x5546e6 of _0x1eb2eb){if(!_0x5546e6[_0xaa3a2c(0x11c)]||_0x5546e6[_0xaa3a2c(0x11c)]===_0x28b4ae)_0x57c603['push'](_0x5546e6);else{const _0x5f15db=_0x4060e8[_0xaa3a2c(0x174)](_0x5546e6[_0xaa3a2c(0x11c)])||[];_0x5f15db[_0xaa3a2c(0xde)](_0x5546e6),_0x4060e8[_0xaa3a2c(0x176)](_0x5546e6[_0xaa3a2c(0x11c)],_0x5f15db);}}const _0x56d13a=(_0x34e55f,_0x3aa8a1)=>_0x34e55f['journeyBundleName'][_0xaa3a2c(0xe5)](_0x3aa8a1['journeyBundleName'],undefined,{'sensitivity':'base'});_0x57c603[_0xaa3a2c(0x1b2)](_0x56d13a);for(const _0x14e93f of _0x57c603){console['log'](formatJourneyItem(_0x14e93f,'',_0x2df40a(_0x14e93f['id'])));}const _0x168816=[..._0x4060e8[_0xaa3a2c(0x10c)]()][_0xaa3a2c(0x1b2)]((_0x5e046f,_0x45643c)=>{const _0x4374f6=_0xaa3a2c,_0x24f13e=_0x464544[_0x4374f6(0x174)](_0x5e046f[0x0])||_0x5e046f[0x0],_0x258ee3=_0x464544[_0x4374f6(0x174)](_0x45643c[0x0])||_0x45643c[0x0];return _0x24f13e[_0x4374f6(0xe5)](_0x258ee3,undefined,{'sensitivity':_0x4374f6(0x101)});});for(const [_0x102acd,_0x1b78b4]of _0x168816){const _0x53127c=_0x464544[_0xaa3a2c(0x174)](_0x102acd)||_0x102acd;console[_0xaa3a2c(0x123)]('📁\x20'+_0x53127c),_0x1b78b4[_0xaa3a2c(0x1b2)](_0x56d13a);for(const _0x4ae567 of _0x1b78b4){console[_0xaa3a2c(0x123)](formatJourneyItem(_0x4ae567,'\x20\x20',_0x2df40a(_0x4ae567['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a28_0x41d493(0xff);[a28_0x41d493(0xd5)]=a28_0x41d493(0x195);async[a28_0x41d493(0xf5)](_0x154cd5){const _0x58f0a6=a28_0x41d493,{options:_0x4802ef,args:_0x397af4,tdx:_0x4cc4ca}=_0x154cd5,_0x34533a=_0x397af4[0x0];if(!_0x34533a)return console[_0x58f0a6(0x16c)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x58f0a6(0x16c)](_0x58f0a6(0x17d)),console[_0x58f0a6(0x16c)](_0x58f0a6(0x171)),console[_0x58f0a6(0x16c)](_0x58f0a6(0xc4)),0x1;_0x4802ef[_0x58f0a6(0x181)]&&console['error'](_0x58f0a6(0x1bc)+_0x34533a);const {journeyId:_0x506ad2,parentSegmentId:_0x391b55}=await resolveJourneyIdFromInput(_0x34533a,_0x4802ef,_0x4cc4ca);if(_0x4802ef[_0x58f0a6(0x184)]){const _0x4fdc7d=getConsoleNextUrl(_0x4802ef[_0x58f0a6(0xc0)],_0x58f0a6(0x198)+_0x391b55+'/e/'+_0x506ad2+'/j/da/je');return console[_0x58f0a6(0x16c)](a28_0x458e20[_0x58f0a6(0x1ac)]('✔')+_0x58f0a6(0x187)+a28_0x458e20[_0x58f0a6(0x164)](_0x4fdc7d)),openBrowser(_0x4fdc7d),0x0;}const _0x1094ed=await withSpinner(_0x58f0a6(0x149),()=>_0x4cc4ca[_0x58f0a6(0x14b)]['getJourney'](_0x506ad2),{'verbose':_0x4802ef['verbose']}),_0x1869ca=_0x1094ed['data'],_0x50cfd1=_0x4802ef[_0x58f0a6(0x12a)];let _0x59b6fb;if(_0x50cfd1)try{const _0x2bad7a=await withSpinner(_0x58f0a6(0x130),()=>_0x4cc4ca[_0x58f0a6(0x14b)][_0x58f0a6(0x169)](_0x506ad2),{'verbose':_0x4802ef['verbose']});_0x59b6fb=_0x2bad7a[_0x58f0a6(0x11f)];}catch{_0x4802ef[_0x58f0a6(0x181)]&&console[_0x58f0a6(0x16c)](_0x58f0a6(0xf1));}const _0x38f678=getConsoleNextUrl(_0x4802ef[_0x58f0a6(0xc0)],_0x58f0a6(0x198)+_0x391b55+_0x58f0a6(0x154)+_0x506ad2+'/j/da/je'),_0x462193={'id':_0x1869ca['id'],'name':_0x1869ca['attributes'][_0x58f0a6(0x141)],'description':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0xd5)],'state':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x133)],'paused':_0x1869ca[_0x58f0a6(0x13e)]['paused'],'reentry_mode':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0xc1)],'stages':_0x1869ca[_0x58f0a6(0x13e)]['journeyStages']?.[_0x58f0a6(0xf4)]||0x0,..._0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x103)]&&{'goal':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x103)]['name']},..._0x59b6fb&&{'statistics':{'size':_0x59b6fb[_0x58f0a6(0xd9)],'entered':_0x59b6fb['enteredSize'],'goal_achieved':_0x59b6fb[_0x58f0a6(0x167)],'completion_rate':_0x59b6fb[_0x58f0a6(0xd6)],'exit_or_jump':_0x59b6fb[_0x58f0a6(0x146)],'exit_or_jump_rate':_0x59b6fb[_0x58f0a6(0x15f)],'stages':_0x59b6fb[_0x58f0a6(0x1b7)]}},'url':_0x38f678};return await handleSingleObjectOutput(_0x462193,_0x4802ef),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:stats';['description']=a28_0x41d493(0xee);async['execute'](_0x2bcad1){const _0x24fcee=a28_0x41d493,{options:_0x141ae2,args:_0x39dc09,tdx:_0x445b74}=_0x2bcad1,_0x20d026=_0x39dc09[0x0];if(!requireNameOrPath(_0x20d026))return 0x1;_0x141ae2[_0x24fcee(0x181)]&&console[_0x24fcee(0x16c)](_0x24fcee(0x1bc)+_0x20d026);const _0x46ccff=_0x141ae2,_0x2df45b=_0x46ccff[_0x24fcee(0x1a0)],_0x22dd50=_0x46ccff['to'],_0x31b735=_0x46ccff[_0x24fcee(0x18e)],_0x140ffb=_0x46ccff[_0x24fcee(0x13c)];_0x31b735&&!_0x2df45b&&!_0x22dd50&&console['error'](_0x24fcee(0x1b4));const _0x5a9f30=_0x31b735?withJsonFormat(_0x141ae2):_0x141ae2,{journeyId:_0x3153eb,journeyName:_0x17bcf9}=await resolveJourneyIdFromInput(_0x20d026,_0x5a9f30,_0x445b74),_0x4d208d=_0x2df45b||_0x22dd50?{'from':_0x2df45b,'to':_0x22dd50}:undefined,_0x57b9e3=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x24fcee(0xcd)]([_0x445b74[_0x24fcee(0x14b)][_0x24fcee(0x158)](_0x3153eb),_0x445b74['journey']['getStatistics'](_0x3153eb,_0x4d208d)]),{'verbose':_0x5a9f30[_0x24fcee(0x181)]}),[_0x1d7bb2,_0x58541a]=_0x57b9e3[_0x24fcee(0x11f)];if(!_0x58541a||_0x58541a[_0x24fcee(0x139)]===null)return console[_0x24fcee(0x16c)](_0x24fcee(0xc3)+_0x17bcf9),console[_0x24fcee(0x16c)](_0x24fcee(0x196)),0x0;const _0x543472=buildStageNameMap(_0x1d7bb2),_0x5041e1=!!(_0x4d208d&&_0x58541a[_0x24fcee(0x19a)]?.[_0x24fcee(0xf4)]),_0x2ebc47={'stageNameMap':_0x543472,'hasPeriod':_0x5041e1,'includeHistory':!!_0x31b735};if(_0x140ffb&&_0x58541a[_0x24fcee(0x1b7)]){const _0x167cb6=_0x58541a[_0x24fcee(0x1b7)][_0x24fcee(0x1c0)](_0xbc47e1=>{const _0x5b9ba1=_0x24fcee,_0x44ed7f=_0x543472[_0x5b9ba1(0x174)](_0xbc47e1['id'])??'';return _0x44ed7f['toLowerCase']()===_0x140ffb[_0x5b9ba1(0x15a)]();});if(_0x167cb6)return await handleSingleObjectOutput(formatStageStats(_0x167cb6,_0x2ebc47),_0x5a9f30),0x0;const _0x2c3d9c=_0x58541a[_0x24fcee(0x1b7)][_0x24fcee(0x143)](_0x542783=>_0x543472['get'](_0x542783['id'])??_0x542783['id']);return console[_0x24fcee(0x16c)](_0x24fcee(0x12c)+_0x140ffb+'\x22\x20not\x20found'),console[_0x24fcee(0x16c)](_0x24fcee(0x108)+_0x2c3d9c[_0x24fcee(0x1a8)](',\x20')),0x1;}const _0x40056a=_0x58541a[_0x24fcee(0x1b7)]?.[_0x24fcee(0x143)](_0x2fdb67=>formatStageStats(_0x2fdb67,_0x2ebc47)),_0x2b4d2e=assembleJourneyStats(_0x58541a,{'from':_0x2df45b,'to':_0x22dd50,'includeHistory':_0x31b735});return await this[_0x24fcee(0x145)](_0x2b4d2e,_0x40056a??[],_0x5a9f30),0x0;}async[a28_0x41d493(0x145)](_0x2562e2,_0xa3b678,_0x125940){const _0x49f757=a28_0x41d493,_0x1eec51=_0x125940[_0x49f757(0x10f)]===_0x49f757(0x192)||_0x125940['format']===_0x49f757(0x1c6)||_0x125940[_0x49f757(0x192)]||_0x125940[_0x49f757(0x1c6)];if(_0x1eec51){_0x2562e2[_0x49f757(0x1b7)]=_0xa3b678,await handleSingleObjectOutput(_0x2562e2,_0x125940);return;}await handleSingleObjectOutput(_0x2562e2,_0x125940);for(const _0x497f91 of _0xa3b678){console[_0x49f757(0x123)](''),console[_0x49f757(0x123)](String(a28_0x458e20['cyan']['bold']('['+_0x497f91[_0x49f757(0x141)]+']'))+a28_0x458e20[_0x49f757(0x1c4)]('\x20'+_0x497f91['id']));const {id:_0x47b584,name:_0x443909,..._0xeb5be}=_0x497f91;await handleSingleObjectOutput(_0xeb5be,_0x125940);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a28_0x41d493(0x160);[a28_0x41d493(0xd5)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x41d493(0xf5)](_0x377338){const _0x45756b=a28_0x41d493,{options:_0x47a022,args:_0x2c146b,tdx:_0x568e42}=_0x377338,_0x56059e=_0x2c146b[0x0];if(!requireNameOrPath(_0x56059e))return 0x1;_0x47a022['verbose']&&console['error'](_0x45756b(0x1bc)+_0x56059e);const _0x4e6791=_0x47a022,_0x168939=_0x4e6791[_0x45756b(0x102)],_0x941469=_0x4e6791['from'],_0x450cab=_0x4e6791['to'],_0x407027=_0x4e6791[_0x45756b(0xfd)];if(_0x168939&&_0x168939!==_0x45756b(0x114)&&_0x168939!==_0x45756b(0x172))return console[_0x45756b(0x16c)](_0x45756b(0x173)+_0x168939+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x4c5410=withJsonFormat(_0x47a022),{journeyId:_0x456010,journeyName:_0x1a0ed7}=await resolveJourneyIdFromInput(_0x56059e,_0x4c5410,_0x568e42),_0x35b9e1={'type':_0x168939,'from':_0x941469,'to':_0x450cab,'limit':_0x407027},_0x4bd97a=await withSpinner(_0x45756b(0x115),()=>_0x568e42['journey'][_0x45756b(0x199)](_0x456010,_0x35b9e1),{'verbose':_0x4c5410[_0x45756b(0x181)]}),_0x58458d=_0x4bd97a[_0x45756b(0x11f)],_0x1265ce=_0x58458d['conversion']&&(_0x58458d['conversion']['nodes'][_0x45756b(0xf4)]>0x0||_0x58458d[_0x45756b(0x114)]['links'][_0x45756b(0xf4)]>0x0),_0x3160ab=_0x58458d['activation']&&_0x58458d[_0x45756b(0x172)]['length']>0x0;if(!_0x1265ce&&!_0x3160ab)return console[_0x45756b(0x16c)](_0x45756b(0x1a1)+_0x1a0ed7),console[_0x45756b(0x16c)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x941469&&_0x450cab&&console[_0x45756b(0x16c)](_0x45756b(0x14f)),0x0;return await handleSingleObjectOutput(_0x58458d,_0x4c5410),0x0;}}function formatStageStats(_0x5854f8,_0x278e40){const _0x14819c=a28_0x41d493,_0x5c8ecb=_0x278e40['hasPeriod']&&_0x5854f8[_0x14819c(0x19a)]?.[_0x14819c(0xf4)]?aggregateStageHistory(_0x5854f8[_0x14819c(0x19a)]):{'size':_0x5854f8[_0x14819c(0xd9)],'entered':_0x5854f8['enteredSize'],'milestone':_0x5854f8[_0x14819c(0x1b8)],'milestone_rate':_0x5854f8[_0x14819c(0xd4)],'exit_or_jump':_0x5854f8[_0x14819c(0x146)],'exit_or_jump_rate':_0x5854f8[_0x14819c(0x15f)]},_0x5f48c1={'id':_0x5854f8['id'],'name':_0x278e40[_0x14819c(0xe8)]['get'](_0x5854f8['id'])??_0x5854f8['id'],..._0x5c8ecb};return _0x278e40['hasPeriod']&&_0x278e40[_0x14819c(0x18e)]&&_0x5854f8[_0x14819c(0x19a)]&&(_0x5f48c1[_0x14819c(0x19a)]=_0x5854f8['history']),_0x5f48c1;}export class JourneyPauseCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0xc8);[a28_0x41d493(0xd5)]=a28_0x41d493(0x15c);async[a28_0x41d493(0xf5)](_0x237674){const _0x251c4b=a28_0x41d493,{options:_0x3269e6,args:_0x422701,tdx:_0x336185}=_0x237674,_0x4c0c2c=_0x422701[0x0];if(!requireNameOrPath(_0x4c0c2c))return 0x1;_0x3269e6[_0x251c4b(0x181)]&&console[_0x251c4b(0x16c)](_0x251c4b(0x1bc)+_0x4c0c2c);const {journeyId:_0x1fc28e,journeyName:_0x3ef8f9}=await resolveJourneyIdFromInput(_0x4c0c2c,_0x3269e6,_0x336185);if(!_0x3269e6[_0x251c4b(0x127)]){const _0x1fe633=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x3ef8f9+'\x22?');if(!_0x1fe633)return console[_0x251c4b(0x16c)](_0x251c4b(0x1b1)),0x0;}const _0x36d544=await withSpinner('Pausing\x20journey...',()=>_0x336185[_0x251c4b(0x14b)][_0x251c4b(0x132)](_0x1fc28e),{'verbose':_0x3269e6[_0x251c4b(0x181)]}),_0x171e44=_0x36d544[_0x251c4b(0x11f)];return console[_0x251c4b(0x16c)](_0x251c4b(0x1bd)+_0x171e44[_0x251c4b(0x13e)][_0x251c4b(0x141)]+_0x251c4b(0x118)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0x16e);[a28_0x41d493(0xd5)]=a28_0x41d493(0x13a);async[a28_0x41d493(0xf5)](_0x3fed8f){const _0x2c3670=a28_0x41d493,{options:_0x3011bb,args:_0x2c27d1,tdx:_0x1f6242}=_0x3fed8f,_0x2ecbea=_0x2c27d1[0x0];if(!requireNameOrPath(_0x2ecbea))return 0x1;_0x3011bb[_0x2c3670(0x181)]&&console[_0x2c3670(0x16c)](_0x2c3670(0x1bc)+_0x2ecbea);const {journeyId:_0x2761ee,journeyName:_0x2f42de}=await resolveJourneyIdFromInput(_0x2ecbea,_0x3011bb,_0x1f6242);if(!_0x3011bb[_0x2c3670(0x127)]){const _0x7c8a98=await confirm(_0x2c3670(0xd3)+_0x2f42de+'\x22?');if(!_0x7c8a98)return console[_0x2c3670(0x16c)](_0x2c3670(0x1b1)),0x0;}const _0x16515b=await withSpinner(_0x2c3670(0xe3),()=>_0x1f6242[_0x2c3670(0x14b)][_0x2c3670(0x106)](_0x2761ee),{'verbose':_0x3011bb[_0x2c3670(0x181)]}),_0x44fb6e=_0x16515b[_0x2c3670(0x11f)];return console['error']('✔\x20Journey\x20\x22'+_0x44fb6e[_0x2c3670(0x13e)][_0x2c3670(0x141)]+_0x2c3670(0x166)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0xf3);[a28_0x41d493(0xd5)]=a28_0x41d493(0x121);async['execute'](_0x3e7f50){const _0x52778c=a28_0x41d493,{options:_0x48dbf6,args:_0x273310,tdx:_0x504e82}=_0x3e7f50,_0x16b26e=_0x48dbf6,_0x40c7ce=_0x273310[0x0],_0xc68356=_0x40c7ce&&isYamlFilePath(_0x40c7ce),_0x2fc671=await resolveTarget({'arg':_0xc68356?_0x40c7ce:undefined,'contextParent':_0x48dbf6['parentSegment'],'cwd':process[_0x52778c(0x113)]()});if(!isSuccessfulResolution(_0x2fc671))return _0x2fc671[_0x52778c(0x194)]===_0x52778c(0x151)?(console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0x157))),console[_0x52778c(0x16c)]('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[_0x52778c(0x16c)](_0x52778c(0xcf)),console[_0x52778c(0x16c)](_0x52778c(0xdd)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a28_0x458e20[_0x52778c(0x190)](_0x52778c(0x1af)+_0x2fc671[_0x52778c(0xed)]+'\x0a')),_0x2fc671[_0x52778c(0x124)]&&console['error'](a28_0x458e20['cyan'](_0x2fc671[_0x52778c(0x124)]))),0x1;let _0x3292c8=_0xc68356?undefined:_0x40c7ce,_0x50f6f1,_0x10c46b;_0x2fc671[_0x52778c(0x102)]==='file'&&(_0x3292c8=_0x2fc671[_0x52778c(0x104)],_0x50f6f1=_0x2fc671['filePath'],_0x10c46b=_0x2fc671[_0x52778c(0x111)]);const _0xe3459=_0x2fc671[_0x52778c(0x116)],_0x58db88=_0x2fc671[_0x52778c(0x1a5)];_0x16b26e[_0x52778c(0x181)]&&(console[_0x52778c(0x16c)](_0x52778c(0xca)+_0xe3459),console[_0x52778c(0x16c)](_0x52778c(0xec)+_0x58db88),_0x3292c8&&console['error'](_0x52778c(0x1bb)+_0x3292c8),_0x50f6f1&&console[_0x52778c(0x16c)]('Target\x20file:\x20'+_0x50f6f1),_0x10c46b&&console[_0x52778c(0x16c)](_0x52778c(0x188)+_0x10c46b));const _0x522d95=await withSpinner(_0x52778c(0xe0),()=>_0x504e82['segment'][_0x52778c(0x178)](_0xe3459),{'verbose':_0x48dbf6[_0x52778c(0x181)]}),_0x593326=_0x522d95[_0x52778c(0x11f)],{journeys:_0x92004f,folders:_0x29a180}=await withSpinner(_0x52778c(0xc9),async()=>{const _0x2389bf=_0x52778c,[_0x59db14,_0x4df834]=await Promise[_0x2389bf(0xcd)]([_0x504e82[_0x2389bf(0x14b)]['listJourneysFromParentSegment'](_0x593326,undefined,{'includeAllVersions':!![]}),_0x504e82[_0x2389bf(0x18d)][_0x2389bf(0x100)](_0x593326)]);return{'journeys':_0x59db14,'folders':_0x4df834};},{'verbose':_0x48dbf6[_0x52778c(0x181)]})[_0x52778c(0xf8)](_0x4250c7=>_0x4250c7[_0x52778c(0x11f)]);let _0x24282c=_0x92004f;const _0x1fadc0=buildFolderIdToPathMap(_0x29a180);if(_0x3292c8){const _0x3be666=_0x24282c[_0x52778c(0x19b)](_0x488aa1=>_0x488aa1['journeyBundleName'][_0x52778c(0x15a)]()===_0x3292c8[_0x52778c(0x15a)]());if(_0x3be666['length']===0x0)return console[_0x52778c(0x16c)](_0x52778c(0x12f)+_0x3292c8),console[_0x52778c(0x16c)](_0x52778c(0x129)),0x1;_0x24282c=_0x3be666;}if(_0x10c46b!==undefined){const _0x2a1d53=_0x24282c['filter'](_0xd38921=>{const _0x378105=_0x52778c,_0x499b41=_0xd38921[_0x378105(0x11c)]?_0x1fadc0[_0x378105(0x174)](_0xd38921[_0x378105(0x11c)])||'':'';return _0x499b41===_0x10c46b;});if(_0x2a1d53[_0x52778c(0xf4)]===0x0&&_0x24282c[_0x52778c(0xf4)]>0x0){console[_0x52778c(0x16c)]('Error:\x20Journey\x20\x27'+_0x3292c8+_0x52778c(0xe1)+(_0x10c46b||'root\x20folder')),console[_0x52778c(0x16c)](_0x52778c(0x1ae));for(const _0x396739 of _0x24282c){const _0x3de52b=_0x396739['folderId']?_0x1fadc0['get'](_0x396739['folderId'])||'':'';console['error'](_0x52778c(0x189)+(_0x3de52b||_0x52778c(0xe7))+'/'+_0x396739['journeyBundleName']);}return 0x1;}_0x24282c=_0x2a1d53;}if(_0x24282c[_0x52778c(0xf4)]===0x0)return console[_0x52778c(0x16c)]('No\x20journeys\x20found'),0x0;const _0x5c3fd7=new Map();for(const _0x988115 of _0x24282c){const _0x202d28=_0x988115['journeyBundleId'];!_0x5c3fd7[_0x52778c(0x193)](_0x202d28)&&_0x5c3fd7[_0x52778c(0x176)](_0x202d28,[]),_0x5c3fd7[_0x52778c(0x174)](_0x202d28)[_0x52778c(0xde)](_0x988115);}for(const _0x455dba of _0x5c3fd7['values']()){_0x455dba[_0x52778c(0x1b2)]((_0x3fb0bb,_0x377307)=>(_0x3fb0bb['versionNumber']||0x0)-(_0x377307[_0x52778c(0xbe)]||0x0));}const _0xe5b61a=[],{idToEmailMap:_0x46b132,connectionIdToNameMap:_0x51092e}=await withSpinner(_0x52778c(0x17c),async()=>{const _0x4b4a56=_0x52778c,[_0xa02adc,_0x53e905]=await Promise['all']([_0x504e82[_0x4b4a56(0x18a)][_0x4b4a56(0x1b9)](),_0x504e82[_0x4b4a56(0x18c)][_0x4b4a56(0xdc)]()]);return{'idToEmailMap':_0xa02adc,'connectionIdToNameMap':_0x53e905};},{'verbose':_0x48dbf6['verbose']})[_0x52778c(0xf8)](_0x45c0b2=>_0x45c0b2[_0x52778c(0x11f)]);for(const _0x293828 of _0x5c3fd7['values']()){const _0x400de8=_0x293828[0x0][_0x52778c(0x197)],_0x5a039a=_0x293828[0x0][_0x52778c(0x11c)],_0x45fcc=_0x5a039a?_0x1fadc0[_0x52778c(0x174)](_0x5a039a)||'':'',_0x55c832=_0x45fcc?a28_0x3d093a[_0x52778c(0x1a8)](_0x58db88,_0x45fcc):_0x58db88,_0x5cde52=_0x50f6f1||a28_0x3d093a['join'](_0x55c832,sanitizeFileName(_0x400de8)+_0x52778c(0x1a2));let _0x3bd894,_0x279e63;if(existsSync(_0x5cde52))try{const _0x14196d=readFileSync(_0x5cde52,_0x52778c(0xc6)),_0x1ca8de=parseYamlString(_0x14196d);_0x279e63=_0x1ca8de,_0x3bd894=buildRuleToNameMapping(_0x1ca8de),_0x16b26e[_0x52778c(0x181)]&&_0x3bd894['size']>0x0&&console[_0x52778c(0x16c)](_0x52778c(0xef)+_0x3bd894[_0x52778c(0xd9)]+_0x52778c(0x11e)+_0x400de8);}catch(_0xbf48e5){_0x16b26e[_0x52778c(0x181)]&&console[_0x52778c(0x16c)](_0x52778c(0xbd)+_0xbf48e5[_0x52778c(0xed)]);}const _0x3b0266=[],_0x4c4637=new Set(),_0x1275b2=new Map(),_0x24f78a=new Map(),_0x29d5e5=new Set(),_0x1495c7=new Map(),_0xd9df35=new Map(),_0x4fdadd=createJumpTargetCache();await withProgressSpinner(_0x52778c(0x112)+_0x400de8+'...',async _0xd5356f=>{const _0x5043c6=_0x52778c;for(const _0x300048 of _0x293828){const _0x3b0ca1=_0x293828[_0x5043c6(0xf4)]>0x1?_0x300048[_0x5043c6(0x197)]+'\x20v'+(_0x300048[_0x5043c6(0xbe)]||0x1):_0x300048[_0x5043c6(0x197)];_0xd5356f['setPhase'](_0x5043c6(0x112)+_0x3b0ca1);const _0x59448a=await _0x504e82[_0x5043c6(0x14b)][_0x5043c6(0x158)](_0x300048['id']),_0x5a047b=_0x59448a[_0x5043c6(0x13e)]?.[_0x5043c6(0x17f)],_0x5efb33={'resolveSegment':async _0x4e7c06=>{const _0x263c40=_0x5043c6;if(!_0x5a047b)return{'name':_0x4e7c06,'isJourneyLocal':![]};const _0x316b65=_0x1275b2[_0x263c40(0x174)](_0x4e7c06);if(_0x316b65)return _0x316b65;try{const _0xcc9389=await _0x504e82[_0x263c40(0x18d)][_0x263c40(0xc7)](_0x5a047b,_0x4e7c06),_0x31977e=_0xcc9389['kind']===SEGMENT_KIND_JOURNEY;let _0x2c08ba,_0x56704b=_0xcc9389[_0x263c40(0x141)];if(_0x31977e&&_0xcc9389['rule']){const _0x6fb1ed=await segmentResponseToDef(_0xcc9389,{'resolveSegmentName':async _0x2b4f81=>{const _0xf5aebc=_0x263c40,_0x39097b=_0x1275b2[_0xf5aebc(0x174)](_0x2b4f81);if(_0x39097b)return _0x39097b[_0xf5aebc(0x141)];const _0x2c4235=await _0x5efb33[_0xf5aebc(0x1ab)](_0x2b4f81);return _0x2c4235[_0xf5aebc(0x141)];}}),_0x1c2f25=_0x6fb1ed[_0x263c40(0x1ba)];_0x2c08ba={'description':_0xcc9389[_0x263c40(0xd5)],'rule':_0x1c2f25};const _0x231bfc=serializeRule(_0x1c2f25),_0x5b1700=_0x24f78a[_0x263c40(0x174)](_0x231bfc);if(_0x5b1700)_0x56704b=_0x5b1700,_0x2c08ba=undefined,_0x16b26e[_0x263c40(0x181)]&&console['error'](_0x263c40(0x1b3)+_0xcc9389[_0x263c40(0x141)]+_0x263c40(0x13b)+_0x5b1700);else{let _0x37c401=![];if(_0x3bd894){const _0x2a9971=_0x3bd894['get'](_0x231bfc);if(_0x2a9971){const _0x45d3e8=_0x2a9971[_0x263c40(0x1c0)](_0x26731c=>!_0x4c4637['has'](_0x26731c));_0x45d3e8&&(_0x56704b=_0x45d3e8,_0x4c4637['add'](_0x45d3e8),_0x24f78a[_0x263c40(0x176)](_0x231bfc,_0x45d3e8),_0x37c401=!![],_0x16b26e[_0x263c40(0x181)]&&console[_0x263c40(0x16c)](_0x263c40(0x1be)+_0x45d3e8+_0x263c40(0x122)));}}if(!_0x37c401){const _0x59dee6=generateJourneyLocalName(_0xcc9389[_0x263c40(0x141)]);_0x59dee6&&(_0x56704b=_0x59dee6);let _0x4c0f2b=_0x56704b,_0x48ff59=0x2;while(_0x4c4637['has'](_0x4c0f2b)){_0x4c0f2b=_0x56704b+'_'+_0x48ff59,_0x48ff59++;}_0x4c4637[_0x263c40(0x15e)](_0x4c0f2b),_0x24f78a[_0x263c40(0x176)](_0x231bfc,_0x4c0f2b),_0x56704b=_0x4c0f2b;}}}const _0x379638={'name':_0x56704b,'isJourneyLocal':_0x31977e,'definition':_0x2c08ba};return _0x1275b2[_0x263c40(0x176)](_0x4e7c06,_0x379638),_0x379638;}catch(_0x1f8885){return _0x48dbf6['verbose']&&console[_0x263c40(0x16c)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x4e7c06+':\x20'+_0x1f8885[_0x263c40(0xed)]),{'name':_0x4e7c06,'isJourneyLocal':![]};}},'resolveActivation':async _0x4516d3=>{const _0x3ec3ba=_0x5043c6,_0x510ae5=_0x1495c7[_0x3ec3ba(0x174)](_0x4516d3);if(_0x510ae5)return _0x510ae5;try{const _0xfef99d=await _0x504e82['journey'][_0x3ec3ba(0x1c1)](_0x300048['id'],_0x4516d3),_0x5e3b81=journeyActivationStepToYaml(_0xfef99d,_0x46b132,_0x51092e),_0x15bd95=JSON[_0x3ec3ba(0xd8)]({'name':_0x5e3b81[_0x3ec3ba(0x141)],'connection':_0x5e3b81[_0x3ec3ba(0x18c)],'connector_config':_0x5e3b81[_0x3ec3ba(0x15b)]}),_0x4795c9=_0xd9df35['get'](_0x15bd95);if(_0x4795c9){const _0xc7d6ad={'name':_0x4795c9,'isJourneyLocal':!![],'definition':_0x5e3b81};return _0x1495c7[_0x3ec3ba(0x176)](_0x4516d3,_0xc7d6ad),_0xc7d6ad;}const _0x40e835=_0xfef99d['attributes'][_0x3ec3ba(0xcc)][_0x3ec3ba(0x141)]||_0x4516d3,_0x46dd77=sanitizeYamlKey(_0x40e835)||'activation_'+_0x4516d3;let _0x2f09ab=_0x46dd77,_0x4dbc3d=0x2;while(_0x29d5e5[_0x3ec3ba(0x193)](_0x2f09ab)){_0x2f09ab=_0x46dd77+'_'+_0x4dbc3d,_0x4dbc3d++;}_0x29d5e5[_0x3ec3ba(0x15e)](_0x2f09ab),_0xd9df35[_0x3ec3ba(0x176)](_0x15bd95,_0x2f09ab);const _0x580757={'name':_0x2f09ab,'isJourneyLocal':!![],'definition':_0x5e3b81};return _0x1495c7[_0x3ec3ba(0x176)](_0x4516d3,_0x580757),_0x580757;}catch(_0x494b3b){return _0x48dbf6[_0x3ec3ba(0x181)]&&console['error'](_0x3ec3ba(0xf6)+_0x4516d3+':\x20'+_0x494b3b['message']),{'name':_0x4516d3,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x41c9c2,_0x214edb)=>{const _0x492e8f=_0x5043c6;return resolveJumpTarget(_0x41c9c2,_0x214edb,_0x4fdadd,_0x1efcc1=>_0x504e82[_0x492e8f(0x14b)]['getJourney'](_0x1efcc1));}},_0x8245f1=await journeyResponseToDef(_0x59448a,_0x5efb33);_0x3b0266[_0x5043c6(0xde)]({'item':_0x300048,'yaml':_0x8245f1});}},{'verbose':_0x48dbf6[_0x52778c(0x181)]});const _0x24a70a=await _0x504e82[_0x52778c(0x14b)][_0x52778c(0x168)](_0x293828[0x0][_0x52778c(0x179)]),_0x3867e8=buildMergedJourneyDef(_0x3b0266,_0x3bd894,_0x24a70a),_0x447c21=normalizeJourneyDef(_0x3867e8,_0x279e63),_0x4f2605=toYamlString(_0x447c21),_0x33c23e=_0x50f6f1||a28_0x3d093a['join'](_0x55c832,sanitizeFileName(_0x400de8)+_0x52778c(0x1a2));!_0x50f6f1&&_0x45fcc&&!existsSync(_0x55c832)&&mkdirSync(_0x55c832,{'recursive':!![]});const _0x170c44=a28_0x3d093a[_0x52778c(0x177)](process[_0x52778c(0x113)](),_0x33c23e);if(existsSync(_0x33c23e)){const _0x55472f=readFileSync(_0x33c23e,_0x52778c(0xc6)),_0x32b1e0=generateDiff(_0x55472f,_0x4f2605),_0x5e5831=hasChanges(_0x32b1e0);_0xe5b61a[_0x52778c(0xde)]({'relativePath':_0x170c44,'absolutePath':_0x33c23e,'content':_0x4f2605,'isNew':![],'hasChanges':_0x5e5831,'diff':_0x5e5831?formatDiffWithColors(_0x32b1e0):undefined});}else _0xe5b61a[_0x52778c(0xde)]({'relativePath':_0x170c44,'absolutePath':_0x33c23e,'content':_0x4f2605,'isNew':!![],'hasChanges':![]});}const _0x417711=_0xe5b61a[_0x52778c(0x19b)](_0x1456ac=>_0x1456ac[_0x52778c(0x19d)]),_0x2eed22=_0xe5b61a['filter'](_0xb0c560=>!_0xb0c560['isNew']&&_0xb0c560[_0x52778c(0x137)]),_0x917acc=_0xe5b61a['filter'](_0x1b0adf=>!_0x1b0adf[_0x52778c(0x19d)]&&!_0x1b0adf[_0x52778c(0x137)]),_0x33f2f2=_0x24282c['length'],_0x572a3d=_0x5c3fd7['size'],_0x5b1aa8=_0x33f2f2>_0x572a3d?'\x20('+_0x33f2f2+_0x52778c(0x19e):'';console[_0x52778c(0x16c)](_0x52778c(0xc2)),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0x164)](_0x572a3d+_0x52778c(0x162))+a28_0x458e20['dim'](_0x5b1aa8)),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20['green']('+\x20'+_0x417711['length']+'\x20new\x20files')),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0xf0)]('~\x20'+_0x2eed22[_0x52778c(0xf4)]+'\x20changed\x20files')),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0x1c4)]('=\x20'+_0x917acc[_0x52778c(0xf4)]+_0x52778c(0x138))),console['error']('\x20\x20Target:\x20'+a28_0x458e20['cyan'](_0x58db88)+'\x0a');if(_0x2eed22[_0x52778c(0xf4)]>0x0)for(const _0x358736 of _0x2eed22){console[_0x52778c(0x16c)](_0x52778c(0x17a)+_0x358736['relativePath']+'\x27:'),console[_0x52778c(0x16c)]('─'[_0x52778c(0x126)](0x3c)),console['error'](_0x358736[_0x52778c(0x16d)]),console[_0x52778c(0x16c)]('─'[_0x52778c(0x126)](0x3c));}if(_0x16b26e[_0x52778c(0x128)])return console['error'](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0x18f))),0x0;if(_0x417711[_0x52778c(0xf4)]===0x0&&_0x2eed22[_0x52778c(0xf4)]===0x0)return console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0x1ac)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0xe3459},_0x16b26e[_0x52778c(0xd0)]),console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0x1ac)](_0x52778c(0x180)+a28_0x458e20['dim']('parent_segment')+'\x20=\x20'+a28_0x458e20[_0x52778c(0x164)](_0xe3459))),0x0;if(!_0x16b26e['yes']&&(_0x417711[_0x52778c(0xf4)]>0x0||_0x2eed22[_0x52778c(0xf4)]>0x0)){if(!isInteractive())return console['error'](a28_0x458e20[_0x52778c(0x190)]('\x0aError:'),_0x52778c(0x155)),console['error'](a28_0x458e20[_0x52778c(0x1c4)](_0x52778c(0xf2))),0x1;const _0x44c7ff=await confirmKey(_0x52778c(0x135)+(_0x417711[_0x52778c(0xf4)]+_0x2eed22['length'])+_0x52778c(0xfa));if(!_0x44c7ff)return console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0xd2)),_0x52778c(0x131)),0x1;}!existsSync(_0x58db88)&&mkdirSync(_0x58db88,{'recursive':!![]});const _0x168ba7=a28_0x3d093a[_0x52778c(0x1a8)](_0x58db88,'tdx.json');writeFileSync(_0x168ba7,createTdxConfigContent(_0xe3459),'utf-8');for(const _0x2c78b1 of _0xe5b61a){(_0x2c78b1[_0x52778c(0x19d)]||_0x2c78b1[_0x52778c(0x137)])&&writeFileSync(_0x2c78b1['absolutePath'],_0x2c78b1[_0x52778c(0x142)],_0x52778c(0xc6));}return console[_0x52778c(0x16c)](a28_0x458e20['green'](_0x52778c(0x12e)+(_0x417711['length']+_0x2eed22[_0x52778c(0xf4)])+_0x52778c(0xd7)+_0x58db88)),saveSessionContext({'parent_segment':_0xe3459},_0x16b26e[_0x52778c(0xd0)]),console[_0x52778c(0x16c)](a28_0x458e20['green']('✔\x20Context\x20set:\x20'+a28_0x458e20[_0x52778c(0x1c4)](_0x52778c(0x19f))+_0x52778c(0x159)+a28_0x458e20['cyan'](_0xe3459))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:columns';['description']=a28_0x41d493(0x11b);async['execute'](_0x51e475){const _0x3a2591=a28_0x41d493,{options:_0x39632c,args:_0x2e7850,tdx:_0x229da6}=_0x51e475,_0x1676b1=_0x2e7850[0x0];if(!requireNameOrPath(_0x1676b1))return 0x1;_0x39632c['verbose']&&console[_0x3a2591(0x16c)](_0x3a2591(0x1bc)+_0x1676b1);const {journeyId:_0xe00a54}=await resolveJourneyIdFromInput(_0x1676b1,_0x39632c,_0x229da6),_0x49ca95=await withSpinner(_0x3a2591(0xfc),()=>_0x229da6[_0x3a2591(0x14b)]['getColumnMapping'](_0xe00a54),{'verbose':_0x39632c[_0x3a2591(0x181)]}),_0x1ca1e0=_0x49ca95['data'];return console[_0x3a2591(0x123)](_0x3a2591(0x117)+_0x1ca1e0[_0x3a2591(0x16b)]),console['log'](_0x3a2591(0x1a3)+_0x1ca1e0['table']),await handleSDKOutput(_0x1ca1e0[_0x3a2591(0x165)],_0x39632c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a28_0x41d493(0x1a9);[a28_0x41d493(0xd5)]=a28_0x41d493(0x1bf);async['execute'](_0x2a64f2){const _0x2e8031=a28_0x41d493,{options:_0x13ef87,args:_0x26aaf7,tdx:_0x41609f}=_0x2a64f2,_0x2b05af=_0x26aaf7[0x0];if(!requireNameOrPath(_0x2b05af))return 0x1;_0x13ef87[_0x2e8031(0x181)]&&console['error']('Input:\x20'+_0x2b05af);const {journeyId:_0xecb324}=await resolveJourneyIdFromInput(_0x2b05af,_0x13ef87,_0x41609f),_0x430b7e=await withSpinner(_0x2e8031(0xdb),()=>_0x41609f[_0x2e8031(0x14b)]['listActivationsFlat'](_0xecb324),{'verbose':_0x13ef87[_0x2e8031(0x181)]}),_0x15c723=_0x430b7e[_0x2e8031(0x11f)];return console[_0x2e8031(0x16c)]('Found\x20'+_0x15c723[_0x2e8031(0xf4)]+_0x2e8031(0xce)+(_0x15c723[_0x2e8031(0xf4)]!==0x1?'s':'')),await handleSDKOutput(_0x15c723,_0x13ef87),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0x109);[a28_0x41d493(0xd5)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a28_0x41d493(0x1ad)]=new SegmentPushCommand();async[a28_0x41d493(0xf5)](_0x1870d7){const _0x527bc5=a28_0x41d493,_0x4d1ab1=_0x1870d7[_0x527bc5(0x110)][0x0];let _0x13111d;if(_0x4d1ab1){const _0x413500=await resolveTarget({'arg':_0x4d1ab1,'contextParent':_0x1870d7[_0x527bc5(0x10b)][_0x527bc5(0x182)],'cwd':process[_0x527bc5(0x113)]()});isSuccessfulResolution(_0x413500)&&_0x413500[_0x527bc5(0x102)]===_0x527bc5(0xc5)&&(_0x13111d=_0x413500[_0x527bc5(0xfb)]);}const _0x2984b7={..._0x1870d7,'options':{..._0x1870d7['options'],'journeysOnly':!![],..._0x13111d&&{'singleFilePath':_0x13111d}}};return this[_0x527bc5(0x1ad)][_0x527bc5(0xf5)](_0x2984b7);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a28_0x41d493(0x105);['description']=a28_0x41d493(0x1a6);async[a28_0x41d493(0xf5)](_0x2be745){const _0x111bd5=a28_0x41d493,{options:_0xc9f447,args:_0x172eba,tdx:_0x3ff23f}=_0x2be745,_0x51ca20=_0x172eba[0x0];if(!requireNameOrPath(_0x51ca20))return 0x1;if(_0xc9f447[_0x111bd5(0x181)])console[_0x111bd5(0x16c)](_0x111bd5(0x1bc)+_0x51ca20);const {journeyId:_0x2e8242}=await resolveJourneyIdFromInput(_0x51ca20,_0xc9f447,_0x3ff23f),_0x5b4ae1=await withSpinner(_0x111bd5(0x136),()=>_0x3ff23f['journey'][_0x111bd5(0xdf)](_0x2e8242),{'verbose':_0xc9f447[_0x111bd5(0x181)]}),{bundleName:_0x427d8a,versions:_0x54743a,latestJourneyId:_0x14aa21}=_0x5b4ae1[_0x111bd5(0x11f)];console['error'](_0x427d8a+':\x20'+_0x54743a[_0x111bd5(0xf4)]+'\x20version'+(_0x54743a[_0x111bd5(0xf4)]!==0x1?'s':''));const _0x45ec7f=_0x54743a[_0x111bd5(0x143)](_0x5b5aff=>({'version':_0x5b5aff[_0x111bd5(0xbe)],'journey_id':_0x5b5aff[_0x111bd5(0x139)],'name':_0x5b5aff[_0x111bd5(0x141)],'state':_0x5b5aff[_0x111bd5(0x133)],'paused':_0x5b5aff[_0x111bd5(0xe2)],'latest':_0x5b5aff[_0x111bd5(0x139)]===_0x14aa21,'created_at':_0x5b5aff[_0x111bd5(0x12d)]}));return await handleSDKOutput(_0x45ec7f,_0xc9f447),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:version:create';[a28_0x41d493(0xd5)]=a28_0x41d493(0xe4);async[a28_0x41d493(0xf5)](_0x570e68){const _0xfce973=a28_0x41d493,{options:_0x307704,args:_0xdb26e2,tdx:_0x3ad5b9}=_0x570e68,_0x2e3160=_0xdb26e2[0x0];if(!requireNameOrPath(_0x2e3160))return 0x1;if(_0x307704[_0xfce973(0x181)])console['error'](_0xfce973(0x1bc)+_0x2e3160);const {journeyId:_0x3ba0ff,journeyName:_0x3479f7}=await resolveJourneyIdFromInput(_0x2e3160,_0x307704,_0x3ad5b9);if(!_0x307704['yes']){const _0xab9335=await confirm(_0xfce973(0x148)+_0x3479f7+'\x22?');if(!_0xab9335)return console['error'](_0xfce973(0x1b1)),0x0;}const _0x53d6a9=await withSpinner(_0xfce973(0xf7),()=>_0x3ad5b9[_0xfce973(0x14b)]['createVersion'](_0x3ba0ff),{'verbose':_0x307704[_0xfce973(0x181)]}),_0x186af1=_0x53d6a9[_0xfce973(0x11f)];return console[_0xfce973(0x16c)](a28_0x458e20[_0xfce973(0x1ac)]('✔')+'\x20Created\x20v'+_0x186af1[_0xfce973(0x13e)][_0xfce973(0xbe)]+_0xfce973(0x14a)+_0x186af1['attributes'][_0xfce973(0x141)]+'\x22'),console[_0xfce973(0x16c)](_0xfce973(0xcb)+_0x186af1['id']),await handleSingleObjectOutput({'id':_0x186af1['id'],'name':_0x186af1['attributes'][_0xfce973(0x141)],'version':_0x186af1[_0xfce973(0x13e)][_0xfce973(0xbe)],'state':_0x186af1['attributes'][_0xfce973(0x133)],'bundle_id':_0x186af1[_0xfce973(0x13e)][_0xfce973(0x179)],'created_at':_0x186af1[_0xfce973(0x13e)][_0xfce973(0x12d)]},_0x307704),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a28_0x41d493(0xd5)]=a28_0x41d493(0xe9);async[a28_0x41d493(0xf5)](_0x2b4a18){const _0x5b0b7d=a28_0x41d493,{options:_0x4b771f,args:_0x3347fd,tdx:_0x467429}=_0x2b4a18,_0x12bfeb=_0x3347fd[0x0];if(!requireNameOrPath(_0x12bfeb))return 0x1;const _0x270fe9=_0x4b771f['version'];if(!_0x270fe9)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x5b0b7d(0x16c)](_0x5b0b7d(0xbf)),0x1;const _0x3979d8=parseInt(_0x270fe9,0xa);if(isNaN(_0x3979d8)||_0x3979d8<0x1)return console[_0x5b0b7d(0x16c)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x270fe9),0x1;if(_0x4b771f['verbose'])console[_0x5b0b7d(0x16c)]('Input:\x20'+_0x12bfeb+_0x5b0b7d(0x107)+_0x3979d8);const {journeyId:_0x3e4fba,parentSegmentId:_0x554c48}=await resolveJourneyIdFromInput(_0x12bfeb,_0x4b771f,_0x467429),_0xd4ecee=await withSpinner(_0x5b0b7d(0x1c5),()=>_0x467429['journey'][_0x5b0b7d(0xdf)](_0x3e4fba),{'verbose':_0x4b771f['verbose']}),{versions:_0x48bdd6,latestJourneyId:_0xa94afd}=_0xd4ecee['data'],_0xed5654=_0x48bdd6[_0x5b0b7d(0x1c0)](_0x4c39cb=>_0x4c39cb[_0x5b0b7d(0xbe)]===_0x3979d8);if(!_0xed5654){const _0x2038c0=_0x48bdd6['map'](_0x5b2e6e=>'v'+_0x5b2e6e[_0x5b0b7d(0xbe)])[_0x5b0b7d(0x1a8)](',\x20');return console[_0x5b0b7d(0x16c)](_0x5b0b7d(0x1a7)+_0x3979d8+_0x5b0b7d(0x11a)+_0x2038c0),0x1;}const _0x14ed28=await withSpinner(_0x5b0b7d(0x16a)+_0x3979d8+_0x5b0b7d(0x14e),()=>_0x467429[_0x5b0b7d(0x14b)][_0x5b0b7d(0x158)](_0xed5654[_0x5b0b7d(0x139)]),{'verbose':_0x4b771f[_0x5b0b7d(0x181)]}),_0x3eba42=_0x14ed28[_0x5b0b7d(0x11f)],_0x3b2e3e=getConsoleNextUrl(_0x4b771f['site'],_0x5b0b7d(0x198)+_0x554c48+_0x5b0b7d(0x154)+_0xed5654['journeyId']+_0x5b0b7d(0x161));return await handleSingleObjectOutput({'id':_0x3eba42['id'],'name':_0x3eba42[_0x5b0b7d(0x13e)]['name'],'version':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xbe)],'description':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xd5)],'state':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x133)],'paused':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xe2)],'reentry_mode':_0x3eba42['attributes'][_0x5b0b7d(0xc1)],'stages':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x1a4)]?.[_0x5b0b7d(0xf4)]||0x0,..._0x3eba42['attributes'][_0x5b0b7d(0x103)]&&{'goal':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x103)][_0x5b0b7d(0x141)]},'latest':_0xed5654[_0x5b0b7d(0x139)]===_0xa94afd,'created_at':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x12d)],'updated_at':_0x3eba42['attributes'][_0x5b0b7d(0xf9)],'url':_0x3b2e3e},_0x4b771f),0x0;}}
|
|
1
|
+
const a28_0x20e6c4=a28_0x4189;(function(_0x10996a,_0x435ba5){const _0x7e3f7f=a28_0x4189,_0x15237a=_0x10996a();while(!![]){try{const _0xe79eaa=parseInt(_0x7e3f7f(0x16a))/0x1+parseInt(_0x7e3f7f(0x172))/0x2*(parseInt(_0x7e3f7f(0x256))/0x3)+-parseInt(_0x7e3f7f(0x17b))/0x4*(parseInt(_0x7e3f7f(0x19f))/0x5)+-parseInt(_0x7e3f7f(0x1f6))/0x6+-parseInt(_0x7e3f7f(0x1a6))/0x7+parseInt(_0x7e3f7f(0x1d0))/0x8*(parseInt(_0x7e3f7f(0x210))/0x9)+-parseInt(_0x7e3f7f(0x250))/0xa;if(_0xe79eaa===_0x435ba5)break;else _0x15237a['push'](_0x15237a['shift']());}catch(_0x1bbc7c){_0x15237a['push'](_0x15237a['shift']());}}}(a28_0x21fb,0x58cb7));import a28_0x1d92ca from'chalk';import a28_0x3968aa from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x21fb(){const _0x335af7=['No\x20traffic\x20data\x20available\x20for\x20journey:\x20','args','rootFolderId','getSegment','includeHistory','updatedAt','cwd','entries','journey:pause','replace','🗺️\x20','verbose','Resolved\x20YAML\x20file:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x20version','data','getStatistics','Error:\x20Invalid\x20--type\x20\x22','links','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','options','activation','Listing\x20journey\x20versions...','relativePath','1160262ghfNdh','\x20Created\x20v','resolveParentId','\x20\x20Journey\x20ID:\x20','jsonl','journey:activations','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','site','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Fetching\x20journeys\x20and\x20folders...','createVersion','\x5c$&','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','find','completed','\x20\x20Target:\x20','Resolving\x20parent\x20segment...','Show\x20journey\x20table\x20column\x20mapping','Getting\x20journey\x20statistics...','Resume\x20a\x20paused\x20journey','segmentPushCommand','user','folderId','/j/da','\x22\x20paused','resourceName','folderPath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','absolutePath','listJourneysWithFolders','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x22\x20not\x20found','description','\x20->\x20','filePath','test','map','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','journey:version:create','📁\x20','getTrafficData','Available\x20stages:\x20','activation_','connector_config','get','\x20changed\x20files','setPhase','format','pause','\x20not\x20found.\x20Available:\x20','folders','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','parent_segment','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','version','Listing\x20journeys...','from','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Pause\x20a\x20running\x20journey','Write\x20','✔\x20Context\x20set:\x20','Options:','hasChanges','7786230yxXmCC','(completed)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Found\x20','draft','✔\x20Journey\x20\x22','3HXwbhH','listVersions','journey:version:view','database','getColumnMapping','size','/e/','Fetching\x20users\x20and\x20connections...','green','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','archived','Journey\x20name:\x20','Error:\x20Stage\x20\x22','\x0aPull\x20summary:','journeyId','stages','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journey','createdAt','\x20details...','Error:\x20Invalid\x20version\x20number:\x20','Error:\x20Parent\x20segment\x20context\x20required','dim','repeat','exitOrJumpRate','then','nodes','helpText','getActivation','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','No\x20journeys\x20found','dryRun','journey:list','toLowerCase','log','segmentName','No\x20statistics\x20available\x20for\x20journey:\x20','723215KFWHmc','.yml','stringify','Fetching\x20parent\x20segment...','sort','(paused)','\x20new\x20files','isNew','1219852QKUvMa','Getting\x20journey\x20traffic\x20data...','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Fetching\x20','Error:\x20Journey\x20not\x20found:\x20','audienceId','journeyBundleId','listActivationsFlat','Error:\x20','4ygMhYz','\x22\x20resumed','Show\x20journey\x20statistics','table','limit','\x20activation','journey:columns','length','List\x20all\x20versions\x20of\x20a\x20journey','\x0aError:','getLatestJourneyId','tsv','✔\x20All\x20files\x20are\x20up\x20to\x20date','join','split','Parent\x20segment:\x20','stage','web','includeStats','List\x20activations\x20for\x20a\x20journey','\x20\x20Statistics\x20not\x20available','...','attributes','/app/ps/','Resolving\x20version...','push','targetDir','has','Error:\x20Journey\x20\x27','conversion','\x20=\x20','enteredSize','\x20files?','execute','tdx.json','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','956290KzygtV','journeyBundleName','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Getting\x20column\x20mapping...','name','connection','1672055opbLAB','rule','/j/da/je','localeCompare','reentryMode','filter','journey:resume','yes','activationParams','error','Pausing\x20journey...','file','✔\x20Found\x20','history','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','(archived)','parentName','set','versionNumber','journeyName','(root)','buildIdToNameMap','\x20(ID:\x20','\x20(draft)\x20—\x20\x22','content','session','milestoneSize','red','add','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Export\x20journey(s)\x20as\x20YAML\x20files','segment','segments','Resolving\x20journey...','paused','values','Getting\x20journey\x20details...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','errorCode','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','journey:traffic','json','16jVmtVA','\x20(rule\x20match)','\x27\x20not\x20found\x20in\x20','Target\x20file:\x20','\x20journey\x20files\x20to\x20','Error:\x20--version\x20option\x20is\x20required',',\x20version:\x20','utf-8','Listing\x20journey\x20activations...','blue','(running)','\x20Opening\x20','completeMilestoneRate','resolveSegment','getJourney','\x0aChanges\x20to\x20\x27','all','INVALID_ARGUMENT','base','parentSegment','goal','exitOrJumpSize','Cancelled','Folder\x20path:\x20','state','buildIdToEmailMap','diff','root\x20folder','cyan','Input:\x20','Table:\x20','\x20unchanged\x20files','renderStats','journeyStages','Getting\x20version\x20','journey:push','type','message','111168gQyMMB'];a28_0x21fb=function(){return _0x335af7;};return a28_0x21fb();}import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a28_0x4189(_0x3f3861,_0x235b41){_0x3f3861=_0x3f3861-0x150;const _0x21fbdc=a28_0x21fb();let _0x41895d=_0x21fbdc[_0x3f3861];return _0x41895d;}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(_0x229e29){const _0x51895b=a28_0x4189;return!_0x229e29&&(console[_0x51895b(0x1af)](_0x51895b(0x216)),console['error'](_0x51895b(0x162))),!!_0x229e29;}function withJsonFormat(_0x33d66e){const _0x5013a9=a28_0x4189;if(!_0x33d66e[_0x5013a9(0x23f)]&&!_0x33d66e[_0x5013a9(0x1cf)]&&!_0x33d66e['jsonl']&&!_0x33d66e[_0x5013a9(0x186)])return{..._0x33d66e,'format':_0x5013a9(0x1cf),'json':!![]};return _0x33d66e;}function formatJourneyState(_0x52b679){const _0x3a7c27=a28_0x4189;switch(_0x52b679){case'launched':return a28_0x1d92ca[_0x3a7c27(0x25e)](_0x3a7c27(0x1da));case _0x3a7c27(0x254):return a28_0x1d92ca[_0x3a7c27(0x15b)]('(draft)');case _0x3a7c27(0x1c8):return a28_0x1d92ca[_0x3a7c27(0x243)](_0x3a7c27(0x16f));case _0x3a7c27(0x21e):return a28_0x1d92ca[_0x3a7c27(0x1d9)](_0x3a7c27(0x251));case _0x3a7c27(0x260):return a28_0x1d92ca['dim'](_0x3a7c27(0x1b5));default:return'('+_0x52b679+')';}}function formatJourneyItem(_0x4cc1a3,_0x46b4dd='',_0x4d5f88){const _0x1be623=a28_0x4189,_0x515454=formatJourneyState(_0x4cc1a3['state']),_0x2703d5=_0x4d5f88?hyperlink(_0x4cc1a3['journeyBundleName'],_0x4d5f88):_0x4cc1a3[_0x1be623(0x1a0)];return _0x46b4dd+_0x1be623(0x201)+_0x2703d5+'\x20'+_0x515454;}function escapeRegex(_0x499632){const _0x3c66d5=a28_0x4189;return _0x499632[_0x3c66d5(0x200)](/[.*+?^${}()|[\]\\]/g,_0x3c66d5(0x21b));}function globToRegex(_0x5d0a47){const _0x46b22b=a28_0x4189,_0x7c59b5=_0x5d0a47[_0x46b22b(0x189)]('*')['map'](escapeRegex);return new RegExp(_0x7c59b5[_0x46b22b(0x188)]('.*'),'i');}function buildRuleToNameMapping(_0x201f54){const _0x3a4031=a28_0x4189,_0x4cf941=new Map();if(_0x201f54[_0x3a4031(0x1c6)])for(const [_0x208546,_0x51542a]of Object['entries'](_0x201f54['segments'])){if(_0x51542a[_0x3a4031(0x1a7)]){const _0x16b138=serializeRule(_0x51542a['rule']),_0x448d11=_0x4cf941[_0x3a4031(0x23c)](_0x16b138);_0x448d11?_0x448d11['push'](_0x208546):_0x4cf941[_0x3a4031(0x1b7)](_0x16b138,[_0x208546]);}}return _0x4cf941;}async function resolveJourneyIdFromInput(_0x1bdcc1,_0x3dd917,_0x4b14f8){const _0x298a5b=a28_0x4189,_0x5e8619=await resolveJourneyTarget(_0x1bdcc1,_0x3dd917['parentSegment'],_0x3dd917[_0x298a5b(0x202)]),_0x48c8fe=_0x5e8619['parentSegment'];if(!_0x48c8fe)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x298a5b(0x1a1));const _0x47d92a=await withSpinner(_0x298a5b(0x220),()=>_0x4b14f8[_0x298a5b(0x1c5)][_0x298a5b(0x212)](_0x48c8fe),{'verbose':_0x3dd917['verbose']}),_0x2eda5b=_0x47d92a['data'],_0x2f32f3=await withSpinner(_0x298a5b(0x1c7),()=>_0x4b14f8[_0x298a5b(0x156)]['resolveJourneyId'](_0x2eda5b,_0x5e8619[_0x298a5b(0x1b9)]),{'verbose':_0x3dd917[_0x298a5b(0x202)]});return{'journeyId':_0x2f32f3['data'],'journeyName':_0x5e8619['journeyName'],'parentSegmentId':_0x2eda5b};}async function resolveJourneyTarget(_0x3a4c54,_0x3ffff2,_0x8d316c){const _0x4f6b46=a28_0x4189;if(isYamlFilePath(_0x3a4c54))try{const _0x4f19ec=await resolveYamlFilePath(_0x3a4c54);return _0x8d316c&&(console[_0x4f6b46(0x1af)](_0x4f6b46(0x203)+_0x3a4c54),console[_0x4f6b46(0x1af)]('\x20\x20Parent\x20segment:\x20'+_0x4f19ec['parentSegment']),console[_0x4f6b46(0x1af)]('\x20\x20Name:\x20'+_0x4f19ec[_0x4f6b46(0x168)]),console[_0x4f6b46(0x1af)]('\x20\x20Folder\x20path:\x20'+(_0x4f19ec[_0x4f6b46(0x22a)]||_0x4f6b46(0x1ba)))),{'journeyName':_0x4f19ec['segmentName'],'parentSegment':_0x4f19ec['parentSegment'],'resolved':_0x4f19ec};}catch(_0x5b53bb){throw new SDKError(ErrorCode[_0x4f6b46(0x1e1)],_0x4f6b46(0x22e)+_0x5b53bb[_0x4f6b46(0x1f5)]);}if(!_0x3ffff2)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4f6b46(0x19e));return{'journeyName':_0x3a4c54,'parentSegment':_0x3ffff2};}export class JourneyListCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]=a28_0x20e6c4(0x165);[a28_0x20e6c4(0x230)]='List\x20journeys\x20in\x20current\x20context';async[a28_0x20e6c4(0x19c)](_0x12c930){const _0x4178d4=a28_0x20e6c4,{options:_0x38b526,args:_0x9fba8b,tdx:_0x117d1e}=_0x12c930,_0x4f724b=_0x9fba8b[0x0],_0x1011dc=_0x38b526[_0x4178d4(0x1e3)];if(!_0x1011dc)return console[_0x4178d4(0x1af)](_0x4178d4(0x15a)),console[_0x4178d4(0x1af)](_0x4178d4(0x1cb)),0x1;const _0x125fba=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x117d1e[_0x4178d4(0x1c5)][_0x4178d4(0x212)](_0x1011dc),{'verbose':_0x38b526[_0x4178d4(0x202)]}),_0x53f20b=_0x125fba[_0x4178d4(0x206)];_0x38b526[_0x4178d4(0x202)]&&(console[_0x4178d4(0x1af)](_0x4178d4(0x18a)+_0x1011dc+_0x4178d4(0x1bc)+_0x53f20b+')'),_0x4f724b&&console['error']('Pattern:\x20'+_0x4f724b));const _0xffeb43=await withSpinner(_0x4178d4(0x16d),()=>_0x117d1e[_0x4178d4(0x1c5)]['getParentFull'](_0x53f20b),{'verbose':_0x38b526['verbose']}),_0x1d9e6e=_0xffeb43['data'],_0x4a572e=_0x1d9e6e[_0x4178d4(0x1f9)],_0x59cfa5=await withSpinner(_0x4178d4(0x248),()=>_0x117d1e[_0x4178d4(0x156)][_0x4178d4(0x22d)](_0x53f20b,_0x4a572e),{'verbose':_0x38b526[_0x4178d4(0x202)]});let _0x3d6335=_0x59cfa5[_0x4178d4(0x206)]['journeys'];const _0x855075=_0x59cfa5['data'][_0x4178d4(0x242)],_0xd44804=new Map();for(const _0x135d34 of _0x855075){_0xd44804[_0x4178d4(0x1b7)](_0x135d34['id'],_0x135d34['name']);}if(_0x4f724b){const _0x5ec618=globToRegex(_0x4f724b);_0x3d6335=_0x3d6335[_0x4178d4(0x1ab)](_0x342efb=>_0x5ec618[_0x4178d4(0x233)](_0x342efb[_0x4178d4(0x1a0)]));}console[_0x4178d4(0x1af)](_0x4178d4(0x1b2)+_0x3d6335[_0x4178d4(0x182)]+'\x20journey'+(_0x3d6335[_0x4178d4(0x182)]!==0x1?'s':''));const _0x440015=_0x55cf21=>{const _0x1bb1ca=_0x4178d4;return getConsoleNextUrl(_0x38b526[_0x1bb1ca(0x217)],_0x1bb1ca(0x192)+_0x53f20b+_0x1bb1ca(0x25c)+_0x55cf21+_0x1bb1ca(0x227));};if(_0x38b526['format']===_0x4178d4(0x17e))await handleSDKOutput(_0x3d6335,_0x38b526);else{if(_0x38b526[_0x4178d4(0x23f)]===_0x4178d4(0x1cf)){const _0x2dd27e=_0x3d6335['map'](_0x59d504=>({..._0x59d504,'url':_0x440015(_0x59d504['id'])}));await handleSDKOutput(_0x2dd27e,_0x38b526);}else{console[_0x4178d4(0x167)]('['+_0x1011dc+']');const _0x2d6656=new Map(),_0x27084f=[];for(const _0x189ded of _0x3d6335){if(!_0x189ded[_0x4178d4(0x226)]||_0x189ded['folderId']===_0x4a572e)_0x27084f[_0x4178d4(0x194)](_0x189ded);else{const _0x1b76d8=_0x2d6656[_0x4178d4(0x23c)](_0x189ded[_0x4178d4(0x226)])||[];_0x1b76d8[_0x4178d4(0x194)](_0x189ded),_0x2d6656[_0x4178d4(0x1b7)](_0x189ded['folderId'],_0x1b76d8);}}const _0x57aa90=(_0xa52b5a,_0x77c676)=>_0xa52b5a[_0x4178d4(0x1a0)]['localeCompare'](_0x77c676['journeyBundleName'],undefined,{'sensitivity':'base'});_0x27084f['sort'](_0x57aa90);for(const _0x424e31 of _0x27084f){console['log'](formatJourneyItem(_0x424e31,'',_0x440015(_0x424e31['id'])));}const _0x40df65=[..._0x2d6656[_0x4178d4(0x1fe)]()][_0x4178d4(0x16e)]((_0x55787b,_0x575fab)=>{const _0x369bfd=_0x4178d4,_0x41a783=_0xd44804[_0x369bfd(0x23c)](_0x55787b[0x0])||_0x55787b[0x0],_0x457787=_0xd44804['get'](_0x575fab[0x0])||_0x575fab[0x0];return _0x41a783[_0x369bfd(0x1a9)](_0x457787,undefined,{'sensitivity':_0x369bfd(0x1e2)});});for(const [_0x352391,_0x4b5038]of _0x40df65){const _0x37ec14=_0xd44804[_0x4178d4(0x23c)](_0x352391)||_0x352391;console[_0x4178d4(0x167)](_0x4178d4(0x237)+_0x37ec14),_0x4b5038[_0x4178d4(0x16e)](_0x57aa90);for(const _0x3b964f of _0x4b5038){console[_0x4178d4(0x167)](formatJourneyItem(_0x3b964f,'\x20\x20',_0x440015(_0x3b964f['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]='journey:view';[a28_0x20e6c4(0x230)]='Show\x20journey\x20details';async['execute'](_0x421dd4){const _0x282141=a28_0x20e6c4,{options:_0x2c9df1,args:_0xeb6bd8,tdx:_0x47e236}=_0x421dd4,_0x16fde2=_0xeb6bd8[0x0];if(!_0x16fde2)return console[_0x282141(0x1af)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x282141(0x1af)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x282141(0x1af)](_0x282141(0x24e)),console[_0x282141(0x1af)](_0x282141(0x218)),0x1;_0x2c9df1[_0x282141(0x202)]&&console[_0x282141(0x1af)]('Input:\x20'+_0x16fde2);const {journeyId:_0x1d87e7,parentSegmentId:_0x575e4c}=await resolveJourneyIdFromInput(_0x16fde2,_0x2c9df1,_0x47e236);if(_0x2c9df1[_0x282141(0x18c)]){const _0x18f3fa=getConsoleNextUrl(_0x2c9df1['site'],_0x282141(0x192)+_0x575e4c+_0x282141(0x25c)+_0x1d87e7+'/j/da/je');return console[_0x282141(0x1af)](a28_0x1d92ca[_0x282141(0x25e)]('✔')+_0x282141(0x1db)+a28_0x1d92ca[_0x282141(0x1ec)](_0x18f3fa)),openBrowser(_0x18f3fa),0x0;}const _0xbf6d61=await withSpinner(_0x282141(0x1ca),()=>_0x47e236[_0x282141(0x156)][_0x282141(0x1de)](_0x1d87e7),{'verbose':_0x2c9df1[_0x282141(0x202)]}),_0x532672=_0xbf6d61[_0x282141(0x206)],_0x223cb4=_0x2c9df1[_0x282141(0x18d)];let _0x2a8cd8;if(_0x223cb4)try{const _0x58e6b6=await withSpinner(_0x282141(0x222),()=>_0x47e236[_0x282141(0x156)][_0x282141(0x207)](_0x1d87e7),{'verbose':_0x2c9df1[_0x282141(0x202)]});_0x2a8cd8=_0x58e6b6[_0x282141(0x206)];}catch{_0x2c9df1[_0x282141(0x202)]&&console[_0x282141(0x1af)](_0x282141(0x18f));}const _0x33c36a=getConsoleNextUrl(_0x2c9df1[_0x282141(0x217)],'/app/ps/'+_0x575e4c+'/e/'+_0x1d87e7+_0x282141(0x1a8)),_0x217cb6={'id':_0x532672['id'],'name':_0x532672[_0x282141(0x191)][_0x282141(0x1a4)],'description':_0x532672[_0x282141(0x191)][_0x282141(0x230)],'state':_0x532672[_0x282141(0x191)][_0x282141(0x1e8)],'paused':_0x532672[_0x282141(0x191)][_0x282141(0x1c8)],'reentry_mode':_0x532672['attributes'][_0x282141(0x1aa)],'stages':_0x532672[_0x282141(0x191)][_0x282141(0x1f1)]?.[_0x282141(0x182)]||0x0,..._0x532672[_0x282141(0x191)]['goal']&&{'goal':_0x532672[_0x282141(0x191)][_0x282141(0x1e4)][_0x282141(0x1a4)]},..._0x2a8cd8&&{'statistics':{'size':_0x2a8cd8[_0x282141(0x25b)],'entered':_0x2a8cd8[_0x282141(0x19a)],'goal_achieved':_0x2a8cd8['goalSize'],'completion_rate':_0x2a8cd8['completionRate'],'exit_or_jump':_0x2a8cd8['exitOrJumpSize'],'exit_or_jump_rate':_0x2a8cd8[_0x282141(0x15d)],'stages':_0x2a8cd8['stages']}},'url':_0x33c36a};return await handleSingleObjectOutput(_0x217cb6,_0x2c9df1),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]='journey:stats';[a28_0x20e6c4(0x230)]=a28_0x20e6c4(0x17d);async[a28_0x20e6c4(0x19c)](_0x5a77d3){const _0x690a0e=a28_0x20e6c4,{options:_0xb3040b,args:_0x306096,tdx:_0x265470}=_0x5a77d3,_0x45432b=_0x306096[0x0];if(!requireNameOrPath(_0x45432b))return 0x1;_0xb3040b[_0x690a0e(0x202)]&&console[_0x690a0e(0x1af)](_0x690a0e(0x1ed)+_0x45432b);const _0x28cc7e=_0xb3040b,_0x185c48=_0x28cc7e[_0x690a0e(0x249)],_0x3cba6c=_0x28cc7e['to'],_0x21e405=_0x28cc7e[_0x690a0e(0x1fb)],_0x2d7416=_0x28cc7e[_0x690a0e(0x18b)];_0x21e405&&!_0x185c48&&!_0x3cba6c&&console[_0x690a0e(0x1af)](_0x690a0e(0x24a));const _0x4c1765=_0x21e405?withJsonFormat(_0xb3040b):_0xb3040b,{journeyId:_0x13c867,journeyName:_0x52588d}=await resolveJourneyIdFromInput(_0x45432b,_0x4c1765,_0x265470),_0x1dcd00=_0x185c48||_0x3cba6c?{'from':_0x185c48,'to':_0x3cba6c}:undefined,_0x2b6144=await withSpinner(_0x690a0e(0x222),()=>Promise['all']([_0x265470[_0x690a0e(0x156)][_0x690a0e(0x1de)](_0x13c867),_0x265470[_0x690a0e(0x156)]['getStatistics'](_0x13c867,_0x1dcd00)]),{'verbose':_0x4c1765[_0x690a0e(0x202)]}),[_0xb66051,_0x29eabe]=_0x2b6144[_0x690a0e(0x206)];if(!_0x29eabe||_0x29eabe['journeyId']===null)return console[_0x690a0e(0x1af)](_0x690a0e(0x169)+_0x52588d),console[_0x690a0e(0x1af)](_0x690a0e(0x20b)),0x0;const _0x469152=buildStageNameMap(_0xb66051),_0x3e3def=!!(_0x1dcd00&&_0x29eabe['history']?.[_0x690a0e(0x182)]),_0x32472d={'stageNameMap':_0x469152,'hasPeriod':_0x3e3def,'includeHistory':!!_0x21e405};if(_0x2d7416&&_0x29eabe[_0x690a0e(0x154)]){const _0x3e2425=_0x29eabe[_0x690a0e(0x154)]['find'](_0x3c8c86=>{const _0xb5b028=_0x690a0e,_0x2e9d75=_0x469152[_0xb5b028(0x23c)](_0x3c8c86['id'])??'';return _0x2e9d75['toLowerCase']()===_0x2d7416['toLowerCase']();});if(_0x3e2425)return await handleSingleObjectOutput(formatStageStats(_0x3e2425,_0x32472d),_0x4c1765),0x0;const _0x454d9b=_0x29eabe[_0x690a0e(0x154)][_0x690a0e(0x234)](_0x29a6ca=>_0x469152[_0x690a0e(0x23c)](_0x29a6ca['id'])??_0x29a6ca['id']);return console['error'](_0x690a0e(0x151)+_0x2d7416+_0x690a0e(0x22f)),console[_0x690a0e(0x1af)](_0x690a0e(0x239)+_0x454d9b[_0x690a0e(0x188)](',\x20')),0x1;}const _0x18b444=_0x29eabe[_0x690a0e(0x154)]?.[_0x690a0e(0x234)](_0x1edbb3=>formatStageStats(_0x1edbb3,_0x32472d)),_0x3ff40c=assembleJourneyStats(_0x29eabe,{'from':_0x185c48,'to':_0x3cba6c,'includeHistory':_0x21e405});return await this[_0x690a0e(0x1f0)](_0x3ff40c,_0x18b444??[],_0x4c1765),0x0;}async[a28_0x20e6c4(0x1f0)](_0x519d8e,_0x49e94d,_0x53424a){const _0x49a578=a28_0x20e6c4,_0xe954a1=_0x53424a[_0x49a578(0x23f)]===_0x49a578(0x1cf)||_0x53424a['format']==='jsonl'||_0x53424a['json']||_0x53424a[_0x49a578(0x214)];if(_0xe954a1){_0x519d8e[_0x49a578(0x154)]=_0x49e94d,await handleSingleObjectOutput(_0x519d8e,_0x53424a);return;}await handleSingleObjectOutput(_0x519d8e,_0x53424a);for(const _0x1aca60 of _0x49e94d){console[_0x49a578(0x167)](''),console[_0x49a578(0x167)](String(a28_0x1d92ca[_0x49a578(0x1ec)]['bold']('['+_0x1aca60['name']+']'))+a28_0x1d92ca[_0x49a578(0x15b)]('\x20'+_0x1aca60['id']));const {id:_0x56e109,name:_0x2e3821,..._0x4fc88a}=_0x1aca60;await handleSingleObjectOutput(_0x4fc88a,_0x53424a);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]=a28_0x20e6c4(0x1ce);[a28_0x20e6c4(0x230)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x20e6c4(0x19c)](_0x3b8ed8){const _0x51b6b5=a28_0x20e6c4,{options:_0x4d7979,args:_0x4606c6,tdx:_0x41f5e0}=_0x3b8ed8,_0x5b2990=_0x4606c6[0x0];if(!requireNameOrPath(_0x5b2990))return 0x1;_0x4d7979[_0x51b6b5(0x202)]&&console[_0x51b6b5(0x1af)](_0x51b6b5(0x1ed)+_0x5b2990);const _0x481acc=_0x4d7979,_0x3a2e98=_0x481acc[_0x51b6b5(0x1f4)],_0x13f9ca=_0x481acc['from'],_0x22d12b=_0x481acc['to'],_0x42e3ff=_0x481acc[_0x51b6b5(0x17f)];if(_0x3a2e98&&_0x3a2e98!==_0x51b6b5(0x198)&&_0x3a2e98!==_0x51b6b5(0x20d))return console[_0x51b6b5(0x1af)](_0x51b6b5(0x208)+_0x3a2e98+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x378036=withJsonFormat(_0x4d7979),{journeyId:_0x30a3ff,journeyName:_0x5482e4}=await resolveJourneyIdFromInput(_0x5b2990,_0x378036,_0x41f5e0),_0x3fb92d={'type':_0x3a2e98,'from':_0x13f9ca,'to':_0x22d12b,'limit':_0x42e3ff},_0x4afb05=await withSpinner(_0x51b6b5(0x173),()=>_0x41f5e0[_0x51b6b5(0x156)][_0x51b6b5(0x238)](_0x30a3ff,_0x3fb92d),{'verbose':_0x378036[_0x51b6b5(0x202)]}),_0x434c91=_0x4afb05[_0x51b6b5(0x206)],_0x5cc1b2=_0x434c91[_0x51b6b5(0x198)]&&(_0x434c91[_0x51b6b5(0x198)][_0x51b6b5(0x15f)][_0x51b6b5(0x182)]>0x0||_0x434c91[_0x51b6b5(0x198)][_0x51b6b5(0x209)][_0x51b6b5(0x182)]>0x0),_0x11129a=_0x434c91[_0x51b6b5(0x20d)]&&_0x434c91['activation'][_0x51b6b5(0x182)]>0x0;if(!_0x5cc1b2&&!_0x11129a)return console[_0x51b6b5(0x1af)](_0x51b6b5(0x1f7)+_0x5482e4),console[_0x51b6b5(0x1af)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x13f9ca&&_0x22d12b&&console[_0x51b6b5(0x1af)]('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(_0x434c91,_0x378036),0x0;}}function formatStageStats(_0x1c4d3e,_0x22ea72){const _0x5e2069=a28_0x20e6c4,_0x4d4dbd=_0x22ea72['hasPeriod']&&_0x1c4d3e[_0x5e2069(0x1b3)]?.[_0x5e2069(0x182)]?aggregateStageHistory(_0x1c4d3e['history']):{'size':_0x1c4d3e['size'],'entered':_0x1c4d3e['enteredSize'],'milestone':_0x1c4d3e[_0x5e2069(0x1c0)],'milestone_rate':_0x1c4d3e[_0x5e2069(0x1dc)],'exit_or_jump':_0x1c4d3e[_0x5e2069(0x1e5)],'exit_or_jump_rate':_0x1c4d3e['exitOrJumpRate']},_0x3b67f8={'id':_0x1c4d3e['id'],'name':_0x22ea72['stageNameMap']['get'](_0x1c4d3e['id'])??_0x1c4d3e['id'],..._0x4d4dbd};return _0x22ea72['hasPeriod']&&_0x22ea72[_0x5e2069(0x1fb)]&&_0x1c4d3e[_0x5e2069(0x1b3)]&&(_0x3b67f8[_0x5e2069(0x1b3)]=_0x1c4d3e[_0x5e2069(0x1b3)]),_0x3b67f8;}export class JourneyPauseCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]=a28_0x20e6c4(0x1ff);[a28_0x20e6c4(0x230)]=a28_0x20e6c4(0x24b);async[a28_0x20e6c4(0x19c)](_0x5148d2){const _0x1bd72a=a28_0x20e6c4,{options:_0x14ad33,args:_0x1a5f31,tdx:_0x35cedc}=_0x5148d2,_0x2190ce=_0x1a5f31[0x0];if(!requireNameOrPath(_0x2190ce))return 0x1;_0x14ad33['verbose']&&console[_0x1bd72a(0x1af)]('Input:\x20'+_0x2190ce);const {journeyId:_0x5a0473,journeyName:_0x21c11d}=await resolveJourneyIdFromInput(_0x2190ce,_0x14ad33,_0x35cedc);if(!_0x14ad33['yes']){const _0x49e181=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x21c11d+'\x22?');if(!_0x49e181)return console[_0x1bd72a(0x1af)](_0x1bd72a(0x1e6)),0x0;}const _0x20e961=await withSpinner(_0x1bd72a(0x1b0),()=>_0x35cedc[_0x1bd72a(0x156)][_0x1bd72a(0x240)](_0x5a0473),{'verbose':_0x14ad33[_0x1bd72a(0x202)]}),_0x59c57e=_0x20e961[_0x1bd72a(0x206)];return console[_0x1bd72a(0x1af)](_0x1bd72a(0x255)+_0x59c57e[_0x1bd72a(0x191)]['name']+_0x1bd72a(0x228)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a28_0x20e6c4(0x1ac);['description']=a28_0x20e6c4(0x223);async[a28_0x20e6c4(0x19c)](_0x51dbed){const _0x858ea=a28_0x20e6c4,{options:_0x5df883,args:_0x13529e,tdx:_0xa2f086}=_0x51dbed,_0x7fa688=_0x13529e[0x0];if(!requireNameOrPath(_0x7fa688))return 0x1;_0x5df883[_0x858ea(0x202)]&&console[_0x858ea(0x1af)](_0x858ea(0x1ed)+_0x7fa688);const {journeyId:_0x4226c1,journeyName:_0x2c6fb9}=await resolveJourneyIdFromInput(_0x7fa688,_0x5df883,_0xa2f086);if(!_0x5df883[_0x858ea(0x1ad)]){const _0xc082f1=await confirm(_0x858ea(0x235)+_0x2c6fb9+'\x22?');if(!_0xc082f1)return console[_0x858ea(0x1af)](_0x858ea(0x1e6)),0x0;}const _0x5b7c08=await withSpinner('Resuming\x20journey...',()=>_0xa2f086[_0x858ea(0x156)]['resume'](_0x4226c1),{'verbose':_0x5df883[_0x858ea(0x202)]}),_0x36ccbe=_0x5b7c08['data'];return console[_0x858ea(0x1af)](_0x858ea(0x255)+_0x36ccbe[_0x858ea(0x191)]['name']+_0x858ea(0x17c)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']='journey:pull';[a28_0x20e6c4(0x230)]=a28_0x20e6c4(0x1c4);async[a28_0x20e6c4(0x19c)](_0x3a5ff8){const _0x2d9785=a28_0x20e6c4,{options:_0x4c3eaf,args:_0x2a3848,tdx:_0x57f4f6}=_0x3a5ff8,_0x5cc62c=_0x4c3eaf,_0x2d493a=_0x2a3848[0x0],_0x174066=_0x2d493a&&isYamlFilePath(_0x2d493a),_0x59dea2=await resolveTarget({'arg':_0x174066?_0x2d493a:undefined,'contextParent':_0x4c3eaf[_0x2d9785(0x1e3)],'cwd':process[_0x2d9785(0x1fd)]()});if(!isSuccessfulResolution(_0x59dea2))return _0x59dea2[_0x2d9785(0x1cc)]==='no_parent'?(console['error'](a28_0x1d92ca['yellow'](_0x2d9785(0x22b))),console[_0x2d9785(0x1af)]('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[_0x2d9785(0x1af)](_0x2d9785(0x21c)),console['error'](_0x2d9785(0x244)),console[_0x2d9785(0x1af)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x2d9785(0x1af)](a28_0x1d92ca[_0x2d9785(0x1c1)](_0x2d9785(0x17a)+_0x59dea2[_0x2d9785(0x1f5)]+'\x0a')),_0x59dea2[_0x2d9785(0x160)]&&console[_0x2d9785(0x1af)](a28_0x1d92ca['cyan'](_0x59dea2[_0x2d9785(0x160)]))),0x1;let _0xc29a69=_0x174066?undefined:_0x2d493a,_0x5e22b4,_0x3f4d72;_0x59dea2[_0x2d9785(0x1f4)]==='file'&&(_0xc29a69=_0x59dea2[_0x2d9785(0x229)],_0x5e22b4=_0x59dea2[_0x2d9785(0x232)],_0x3f4d72=_0x59dea2[_0x2d9785(0x22a)]);const _0x4a73ce=_0x59dea2[_0x2d9785(0x1b6)],_0x422b40=_0x59dea2[_0x2d9785(0x195)];_0x5cc62c['verbose']&&(console[_0x2d9785(0x1af)](_0x2d9785(0x18a)+_0x4a73ce),console['error']('Target\x20directory:\x20'+_0x422b40),_0xc29a69&&console[_0x2d9785(0x1af)](_0x2d9785(0x150)+_0xc29a69),_0x5e22b4&&console[_0x2d9785(0x1af)](_0x2d9785(0x1d3)+_0x5e22b4),_0x3f4d72&&console['error'](_0x2d9785(0x1e7)+_0x3f4d72));const _0x2f241e=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x57f4f6[_0x2d9785(0x1c5)][_0x2d9785(0x212)](_0x4a73ce),{'verbose':_0x4c3eaf[_0x2d9785(0x202)]}),_0x58bcf9=_0x2f241e['data'],{journeys:_0x102cee,folders:_0xf50180}=await withSpinner(_0x2d9785(0x219),async()=>{const _0x571368=_0x2d9785,[_0x9a3524,_0x435650]=await Promise['all']([_0x57f4f6[_0x571368(0x156)]['listJourneysFromParentSegment'](_0x58bcf9,undefined,{'includeAllVersions':!![]}),_0x57f4f6[_0x571368(0x1c5)]['listFolders'](_0x58bcf9)]);return{'journeys':_0x9a3524,'folders':_0x435650};},{'verbose':_0x4c3eaf['verbose']})[_0x2d9785(0x15e)](_0x5a526b=>_0x5a526b[_0x2d9785(0x206)]);let _0x3610ed=_0x102cee;const _0x2035ea=buildFolderIdToPathMap(_0xf50180);if(_0xc29a69){const _0x2a86d8=_0x3610ed[_0x2d9785(0x1ab)](_0x2061d6=>_0x2061d6['journeyBundleName'][_0x2d9785(0x166)]()===_0xc29a69[_0x2d9785(0x166)]());if(_0x2a86d8[_0x2d9785(0x182)]===0x0)return console[_0x2d9785(0x1af)](_0x2d9785(0x176)+_0xc29a69),console[_0x2d9785(0x1af)](_0x2d9785(0x1cd)),0x1;_0x3610ed=_0x2a86d8;}if(_0x3f4d72!==undefined){const _0x1cc2ee=_0x3610ed[_0x2d9785(0x1ab)](_0x14079=>{const _0x3aa702=_0x2d9785,_0x463199=_0x14079[_0x3aa702(0x226)]?_0x2035ea['get'](_0x14079[_0x3aa702(0x226)])||'':'';return _0x463199===_0x3f4d72;});if(_0x1cc2ee[_0x2d9785(0x182)]===0x0&&_0x3610ed['length']>0x0){console[_0x2d9785(0x1af)](_0x2d9785(0x197)+_0xc29a69+_0x2d9785(0x1d2)+(_0x3f4d72||_0x2d9785(0x1eb))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x245ba6 of _0x3610ed){const _0x453258=_0x245ba6[_0x2d9785(0x226)]?_0x2035ea[_0x2d9785(0x23c)](_0x245ba6['folderId'])||'':'';console[_0x2d9785(0x1af)]('\x20\x20-\x20'+(_0x453258||_0x2d9785(0x1ba))+'/'+_0x245ba6[_0x2d9785(0x1a0)]);}return 0x1;}_0x3610ed=_0x1cc2ee;}if(_0x3610ed['length']===0x0)return console[_0x2d9785(0x1af)](_0x2d9785(0x163)),0x0;const _0x5e1bee=new Map();for(const _0x187df5 of _0x3610ed){const _0x2a7c69=_0x187df5['journeyBundleId'];!_0x5e1bee[_0x2d9785(0x196)](_0x2a7c69)&&_0x5e1bee[_0x2d9785(0x1b7)](_0x2a7c69,[]),_0x5e1bee[_0x2d9785(0x23c)](_0x2a7c69)[_0x2d9785(0x194)](_0x187df5);}for(const _0x4e1efd of _0x5e1bee[_0x2d9785(0x1c9)]()){_0x4e1efd[_0x2d9785(0x16e)]((_0x3dd662,_0x5b7ab4)=>(_0x3dd662[_0x2d9785(0x1b8)]||0x0)-(_0x5b7ab4[_0x2d9785(0x1b8)]||0x0));}const _0x23dc78=[],{idToEmailMap:_0x423e27,connectionIdToNameMap:_0x284f65}=await withSpinner(_0x2d9785(0x25d),async()=>{const _0x2215ba=_0x2d9785,[_0x359fed,_0x2f2026]=await Promise[_0x2215ba(0x1e0)]([_0x57f4f6[_0x2215ba(0x225)][_0x2215ba(0x1e9)](),_0x57f4f6[_0x2215ba(0x1a5)][_0x2215ba(0x1bb)]()]);return{'idToEmailMap':_0x359fed,'connectionIdToNameMap':_0x2f2026};},{'verbose':_0x4c3eaf[_0x2d9785(0x202)]})[_0x2d9785(0x15e)](_0x3f84c2=>_0x3f84c2[_0x2d9785(0x206)]);for(const _0x21a20d of _0x5e1bee[_0x2d9785(0x1c9)]()){const _0x103a44=_0x21a20d[0x0][_0x2d9785(0x1a0)],_0x17526d=_0x21a20d[0x0][_0x2d9785(0x226)],_0x59959f=_0x17526d?_0x2035ea[_0x2d9785(0x23c)](_0x17526d)||'':'',_0x5361e1=_0x59959f?a28_0x3968aa['join'](_0x422b40,_0x59959f):_0x422b40,_0x27efe2=_0x5e22b4||a28_0x3968aa[_0x2d9785(0x188)](_0x5361e1,sanitizeFileName(_0x103a44)+_0x2d9785(0x16b));let _0x24617c,_0x3c4fda;if(existsSync(_0x27efe2))try{const _0x3b193c=readFileSync(_0x27efe2,_0x2d9785(0x1d7)),_0x4d9143=parseYamlString(_0x3b193c);_0x3c4fda=_0x4d9143,_0x24617c=buildRuleToNameMapping(_0x4d9143),_0x5cc62c[_0x2d9785(0x202)]&&_0x24617c[_0x2d9785(0x25b)]>0x0&&console[_0x2d9785(0x1af)]('Found\x20'+_0x24617c[_0x2d9785(0x25b)]+_0x2d9785(0x1c3)+_0x103a44);}catch(_0x5e7bb4){_0x5cc62c[_0x2d9785(0x202)]&&console[_0x2d9785(0x1af)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x5e7bb4[_0x2d9785(0x1f5)]);}const _0x49e8f6=[],_0x4d1937=new Set(),_0xb712b1=new Map(),_0x50aeb4=new Map(),_0x5bdd2b=new Set(),_0x2abed1=new Map(),_0xe480bf=new Map(),_0x5cd1ac=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x103a44+_0x2d9785(0x190),async _0x5d38e3=>{const _0x580116=_0x2d9785;for(const _0x39884b of _0x21a20d){const _0x1f2a56=_0x21a20d['length']>0x1?_0x39884b[_0x580116(0x1a0)]+'\x20v'+(_0x39884b[_0x580116(0x1b8)]||0x1):_0x39884b[_0x580116(0x1a0)];_0x5d38e3[_0x580116(0x23e)](_0x580116(0x175)+_0x1f2a56);const _0x4b0255=await _0x57f4f6[_0x580116(0x156)][_0x580116(0x1de)](_0x39884b['id']),_0x369e6a=_0x4b0255[_0x580116(0x191)]?.[_0x580116(0x177)],_0x32f02c={'resolveSegment':async _0x1ba9fd=>{const _0x20a4fe=_0x580116;if(!_0x369e6a)return{'name':_0x1ba9fd,'isJourneyLocal':![]};const _0x41068a=_0xb712b1['get'](_0x1ba9fd);if(_0x41068a)return _0x41068a;try{const _0x5ce33f=await _0x57f4f6[_0x20a4fe(0x1c5)][_0x20a4fe(0x1fa)](_0x369e6a,_0x1ba9fd),_0x13f2e4=_0x5ce33f['kind']===SEGMENT_KIND_JOURNEY;let _0x568272,_0x5d134b=_0x5ce33f[_0x20a4fe(0x1a4)];if(_0x13f2e4&&_0x5ce33f[_0x20a4fe(0x1a7)]){const _0x1ddb54=await segmentResponseToDef(_0x5ce33f,{'resolveSegmentName':async _0x4e1bf7=>{const _0x489e6e=_0x20a4fe,_0x499f43=_0xb712b1[_0x489e6e(0x23c)](_0x4e1bf7);if(_0x499f43)return _0x499f43[_0x489e6e(0x1a4)];const _0x5b2228=await _0x32f02c[_0x489e6e(0x1dd)](_0x4e1bf7);return _0x5b2228[_0x489e6e(0x1a4)];}}),_0x3ba217=_0x1ddb54[_0x20a4fe(0x1a7)];_0x568272={'description':_0x5ce33f[_0x20a4fe(0x230)],'rule':_0x3ba217};const _0x10cb96=serializeRule(_0x3ba217),_0x2f1940=_0x50aeb4['get'](_0x10cb96);if(_0x2f1940)_0x5d134b=_0x2f1940,_0x568272=undefined,_0x5cc62c['verbose']&&console[_0x20a4fe(0x1af)](_0x20a4fe(0x174)+_0x5ce33f[_0x20a4fe(0x1a4)]+_0x20a4fe(0x231)+_0x2f1940);else{let _0x20d3a7=![];if(_0x24617c){const _0x5e003d=_0x24617c[_0x20a4fe(0x23c)](_0x10cb96);if(_0x5e003d){const _0x5cbb3c=_0x5e003d[_0x20a4fe(0x21d)](_0x1abde4=>!_0x4d1937[_0x20a4fe(0x196)](_0x1abde4));_0x5cbb3c&&(_0x5d134b=_0x5cbb3c,_0x4d1937[_0x20a4fe(0x1c2)](_0x5cbb3c),_0x50aeb4['set'](_0x10cb96,_0x5cbb3c),_0x20d3a7=!![],_0x5cc62c[_0x20a4fe(0x202)]&&console['error']('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x5cbb3c+_0x20a4fe(0x1d1)));}}if(!_0x20d3a7){const _0x4b40ba=generateJourneyLocalName(_0x5ce33f['name']);_0x4b40ba&&(_0x5d134b=_0x4b40ba);let _0x5421b1=_0x5d134b,_0x1d4497=0x2;while(_0x4d1937[_0x20a4fe(0x196)](_0x5421b1)){_0x5421b1=_0x5d134b+'_'+_0x1d4497,_0x1d4497++;}_0x4d1937[_0x20a4fe(0x1c2)](_0x5421b1),_0x50aeb4['set'](_0x10cb96,_0x5421b1),_0x5d134b=_0x5421b1;}}}const _0x1c8563={'name':_0x5d134b,'isJourneyLocal':_0x13f2e4,'definition':_0x568272};return _0xb712b1[_0x20a4fe(0x1b7)](_0x1ba9fd,_0x1c8563),_0x1c8563;}catch(_0x37da6b){return _0x4c3eaf[_0x20a4fe(0x202)]&&console[_0x20a4fe(0x1af)](_0x20a4fe(0x155)+_0x1ba9fd+':\x20'+_0x37da6b[_0x20a4fe(0x1f5)]),{'name':_0x1ba9fd,'isJourneyLocal':![]};}},'resolveActivation':async _0x206716=>{const _0x14bee6=_0x580116,_0xf1d580=_0x2abed1['get'](_0x206716);if(_0xf1d580)return _0xf1d580;try{const _0x4a1a8a=await _0x57f4f6[_0x14bee6(0x156)][_0x14bee6(0x161)](_0x39884b['id'],_0x206716),_0x34bc69=journeyActivationStepToYaml(_0x4a1a8a,_0x423e27,_0x284f65),_0x10f56d=JSON[_0x14bee6(0x16c)]({'name':_0x34bc69[_0x14bee6(0x1a4)],'connection':_0x34bc69[_0x14bee6(0x1a5)],'connector_config':_0x34bc69[_0x14bee6(0x23b)]}),_0x2f10f4=_0xe480bf['get'](_0x10f56d);if(_0x2f10f4){const _0x51f351={'name':_0x2f10f4,'isJourneyLocal':!![],'definition':_0x34bc69};return _0x2abed1[_0x14bee6(0x1b7)](_0x206716,_0x51f351),_0x51f351;}const _0x360555=_0x4a1a8a[_0x14bee6(0x191)][_0x14bee6(0x1ae)][_0x14bee6(0x1a4)]||_0x206716,_0x332466=sanitizeYamlKey(_0x360555)||_0x14bee6(0x23a)+_0x206716;let _0x15de7d=_0x332466,_0x160e30=0x2;while(_0x5bdd2b[_0x14bee6(0x196)](_0x15de7d)){_0x15de7d=_0x332466+'_'+_0x160e30,_0x160e30++;}_0x5bdd2b[_0x14bee6(0x1c2)](_0x15de7d),_0xe480bf[_0x14bee6(0x1b7)](_0x10f56d,_0x15de7d);const _0x36530b={'name':_0x15de7d,'isJourneyLocal':!![],'definition':_0x34bc69};return _0x2abed1[_0x14bee6(0x1b7)](_0x206716,_0x36530b),_0x36530b;}catch(_0x4f74b1){return _0x4c3eaf[_0x14bee6(0x202)]&&console['error'](_0x14bee6(0x204)+_0x206716+':\x20'+_0x4f74b1[_0x14bee6(0x1f5)]),{'name':_0x206716,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5dc349,_0x1cd724)=>{const _0x13f6ce=_0x580116;return resolveJumpTarget(_0x5dc349,_0x1cd724,_0x5cd1ac,_0x4fb666=>_0x57f4f6[_0x13f6ce(0x156)][_0x13f6ce(0x1de)](_0x4fb666));}},_0x4e338e=await journeyResponseToDef(_0x4b0255,_0x32f02c);_0x49e8f6[_0x580116(0x194)]({'item':_0x39884b,'yaml':_0x4e338e});}},{'verbose':_0x4c3eaf[_0x2d9785(0x202)]});const _0x15eecc=await _0x57f4f6[_0x2d9785(0x156)][_0x2d9785(0x185)](_0x21a20d[0x0][_0x2d9785(0x178)]),_0x4feb65=buildMergedJourneyDef(_0x49e8f6,_0x24617c,_0x15eecc),_0x1aff20=normalizeJourneyDef(_0x4feb65,_0x3c4fda),_0x22a023=toYamlString(_0x1aff20),_0x5db99f=_0x5e22b4||a28_0x3968aa[_0x2d9785(0x188)](_0x5361e1,sanitizeFileName(_0x103a44)+_0x2d9785(0x16b));!_0x5e22b4&&_0x59959f&&!existsSync(_0x5361e1)&&mkdirSync(_0x5361e1,{'recursive':!![]});const _0x1d1ca3=a28_0x3968aa['relative'](process['cwd'](),_0x5db99f);if(existsSync(_0x5db99f)){const _0x107628=readFileSync(_0x5db99f,_0x2d9785(0x1d7)),_0x2a1cb4=generateDiff(_0x107628,_0x22a023),_0x5b9ba2=hasChanges(_0x2a1cb4);_0x23dc78[_0x2d9785(0x194)]({'relativePath':_0x1d1ca3,'absolutePath':_0x5db99f,'content':_0x22a023,'isNew':![],'hasChanges':_0x5b9ba2,'diff':_0x5b9ba2?formatDiffWithColors(_0x2a1cb4):undefined});}else _0x23dc78[_0x2d9785(0x194)]({'relativePath':_0x1d1ca3,'absolutePath':_0x5db99f,'content':_0x22a023,'isNew':!![],'hasChanges':![]});}const _0x25424f=_0x23dc78[_0x2d9785(0x1ab)](_0x36e355=>_0x36e355[_0x2d9785(0x171)]),_0x56237b=_0x23dc78[_0x2d9785(0x1ab)](_0x2cd301=>!_0x2cd301[_0x2d9785(0x171)]&&_0x2cd301[_0x2d9785(0x24f)]),_0x5f321d=_0x23dc78[_0x2d9785(0x1ab)](_0x2948e3=>!_0x2948e3[_0x2d9785(0x171)]&&!_0x2948e3[_0x2d9785(0x24f)]),_0x317e16=_0x3610ed[_0x2d9785(0x182)],_0x222d4c=_0x5e1bee['size'],_0x3ca206=_0x317e16>_0x222d4c?'\x20('+_0x317e16+'\x20versions)':'';console[_0x2d9785(0x1af)](_0x2d9785(0x152)),console[_0x2d9785(0x1af)]('\x20\x20'+a28_0x1d92ca[_0x2d9785(0x1ec)](_0x222d4c+'\x20journeys')+a28_0x1d92ca[_0x2d9785(0x15b)](_0x3ca206)),console[_0x2d9785(0x1af)]('\x20\x20'+a28_0x1d92ca[_0x2d9785(0x25e)]('+\x20'+_0x25424f['length']+_0x2d9785(0x170))),console[_0x2d9785(0x1af)]('\x20\x20'+a28_0x1d92ca[_0x2d9785(0x243)]('~\x20'+_0x56237b[_0x2d9785(0x182)]+_0x2d9785(0x23d))),console[_0x2d9785(0x1af)]('\x20\x20'+a28_0x1d92ca[_0x2d9785(0x15b)]('=\x20'+_0x5f321d['length']+_0x2d9785(0x1ef))),console['error'](_0x2d9785(0x21f)+a28_0x1d92ca[_0x2d9785(0x1ec)](_0x422b40)+'\x0a');if(_0x56237b[_0x2d9785(0x182)]>0x0)for(const _0x1a8688 of _0x56237b){console[_0x2d9785(0x1af)](_0x2d9785(0x1df)+_0x1a8688[_0x2d9785(0x20f)]+'\x27:'),console['error']('─'[_0x2d9785(0x15c)](0x3c)),console[_0x2d9785(0x1af)](_0x1a8688[_0x2d9785(0x1ea)]),console[_0x2d9785(0x1af)]('─'[_0x2d9785(0x15c)](0x3c));}if(_0x5cc62c[_0x2d9785(0x164)])return console['error'](a28_0x1d92ca[_0x2d9785(0x243)](_0x2d9785(0x25f))),0x0;if(_0x25424f[_0x2d9785(0x182)]===0x0&&_0x56237b[_0x2d9785(0x182)]===0x0)return console['error'](a28_0x1d92ca['green'](_0x2d9785(0x187))),saveSessionContext({'parent_segment':_0x4a73ce},_0x5cc62c[_0x2d9785(0x1bf)]),console[_0x2d9785(0x1af)](a28_0x1d92ca[_0x2d9785(0x25e)](_0x2d9785(0x24d)+a28_0x1d92ca['dim'](_0x2d9785(0x245))+_0x2d9785(0x199)+a28_0x1d92ca[_0x2d9785(0x1ec)](_0x4a73ce))),0x0;if(!_0x5cc62c[_0x2d9785(0x1ad)]&&(_0x25424f['length']>0x0||_0x56237b[_0x2d9785(0x182)]>0x0)){if(!isInteractive())return console['error'](a28_0x1d92ca[_0x2d9785(0x1c1)](_0x2d9785(0x184)),_0x2d9785(0x252)),console['error'](a28_0x1d92ca['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3b903a=await confirmKey(_0x2d9785(0x24c)+(_0x25424f[_0x2d9785(0x182)]+_0x56237b[_0x2d9785(0x182)])+_0x2d9785(0x19b));if(!_0x3b903a)return console[_0x2d9785(0x1af)](a28_0x1d92ca['yellow']('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x422b40)&&mkdirSync(_0x422b40,{'recursive':!![]});const _0x10d453=a28_0x3968aa[_0x2d9785(0x188)](_0x422b40,_0x2d9785(0x19d));writeFileSync(_0x10d453,createTdxConfigContent(_0x4a73ce),'utf-8');for(const _0x3aa1f5 of _0x23dc78){(_0x3aa1f5['isNew']||_0x3aa1f5[_0x2d9785(0x24f)])&&writeFileSync(_0x3aa1f5[_0x2d9785(0x22c)],_0x3aa1f5[_0x2d9785(0x1be)],_0x2d9785(0x1d7));}return console[_0x2d9785(0x1af)](a28_0x1d92ca[_0x2d9785(0x25e)]('✔\x20Pulled\x20'+(_0x25424f['length']+_0x56237b['length'])+_0x2d9785(0x1d4)+_0x422b40)),saveSessionContext({'parent_segment':_0x4a73ce},_0x5cc62c[_0x2d9785(0x1bf)]),console[_0x2d9785(0x1af)](a28_0x1d92ca[_0x2d9785(0x25e)](_0x2d9785(0x24d)+a28_0x1d92ca['dim'](_0x2d9785(0x245))+_0x2d9785(0x199)+a28_0x1d92ca['cyan'](_0x4a73ce))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a28_0x20e6c4(0x181);['description']=a28_0x20e6c4(0x221);async['execute'](_0xce7eb0){const _0x46296d=a28_0x20e6c4,{options:_0xe99b52,args:_0x21372d,tdx:_0x591b11}=_0xce7eb0,_0x51a2bb=_0x21372d[0x0];if(!requireNameOrPath(_0x51a2bb))return 0x1;_0xe99b52[_0x46296d(0x202)]&&console[_0x46296d(0x1af)](_0x46296d(0x1ed)+_0x51a2bb);const {journeyId:_0x518b16}=await resolveJourneyIdFromInput(_0x51a2bb,_0xe99b52,_0x591b11),_0x300535=await withSpinner(_0x46296d(0x1a3),()=>_0x591b11[_0x46296d(0x156)][_0x46296d(0x25a)](_0x518b16),{'verbose':_0xe99b52[_0x46296d(0x202)]}),_0x304c7e=_0x300535[_0x46296d(0x206)];return console[_0x46296d(0x167)]('Database:\x20'+_0x304c7e[_0x46296d(0x259)]),console[_0x46296d(0x167)](_0x46296d(0x1ee)+_0x304c7e[_0x46296d(0x17e)]),await handleSDKOutput(_0x304c7e['columns'],_0xe99b52),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]=a28_0x20e6c4(0x215);[a28_0x20e6c4(0x230)]=a28_0x20e6c4(0x18e);async['execute'](_0x17af82){const _0x23b13e=a28_0x20e6c4,{options:_0x137686,args:_0x449d12,tdx:_0x467bb7}=_0x17af82,_0x34b666=_0x449d12[0x0];if(!requireNameOrPath(_0x34b666))return 0x1;_0x137686[_0x23b13e(0x202)]&&console['error'](_0x23b13e(0x1ed)+_0x34b666);const {journeyId:_0x118137}=await resolveJourneyIdFromInput(_0x34b666,_0x137686,_0x467bb7),_0x6feb82=await withSpinner(_0x23b13e(0x1d8),()=>_0x467bb7['journey'][_0x23b13e(0x179)](_0x118137),{'verbose':_0x137686[_0x23b13e(0x202)]}),_0x41672d=_0x6feb82[_0x23b13e(0x206)];return console[_0x23b13e(0x1af)](_0x23b13e(0x253)+_0x41672d[_0x23b13e(0x182)]+_0x23b13e(0x180)+(_0x41672d[_0x23b13e(0x182)]!==0x1?'s':'')),await handleSDKOutput(_0x41672d,_0x137686),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]=a28_0x20e6c4(0x1f3);[a28_0x20e6c4(0x230)]=a28_0x20e6c4(0x1a2);[a28_0x20e6c4(0x224)]=new SegmentPushCommand();async[a28_0x20e6c4(0x19c)](_0x1b02ef){const _0x10eb0b=a28_0x20e6c4,_0x492dc2=_0x1b02ef[_0x10eb0b(0x1f8)][0x0];let _0x18d4da;if(_0x492dc2){const _0x2e2c1b=await resolveTarget({'arg':_0x492dc2,'contextParent':_0x1b02ef['options']['parentSegment'],'cwd':process[_0x10eb0b(0x1fd)]()});isSuccessfulResolution(_0x2e2c1b)&&_0x2e2c1b[_0x10eb0b(0x1f4)]===_0x10eb0b(0x1b1)&&(_0x18d4da=_0x2e2c1b[_0x10eb0b(0x232)]);}const _0x4e8b0d={..._0x1b02ef,'options':{..._0x1b02ef[_0x10eb0b(0x20c)],'journeysOnly':!![],..._0x18d4da&&{'singleFilePath':_0x18d4da}}};return this[_0x10eb0b(0x224)]['execute'](_0x4e8b0d);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]='journey:versions';[a28_0x20e6c4(0x230)]=a28_0x20e6c4(0x183);async[a28_0x20e6c4(0x19c)](_0x19450e){const _0x461ecf=a28_0x20e6c4,{options:_0x4a6c45,args:_0x5a78f9,tdx:_0x39ade3}=_0x19450e,_0xfc9c98=_0x5a78f9[0x0];if(!requireNameOrPath(_0xfc9c98))return 0x1;if(_0x4a6c45[_0x461ecf(0x202)])console[_0x461ecf(0x1af)]('Input:\x20'+_0xfc9c98);const {journeyId:_0x561c55}=await resolveJourneyIdFromInput(_0xfc9c98,_0x4a6c45,_0x39ade3),_0x3b825e=await withSpinner(_0x461ecf(0x20e),()=>_0x39ade3[_0x461ecf(0x156)]['listVersions'](_0x561c55),{'verbose':_0x4a6c45[_0x461ecf(0x202)]}),{bundleName:_0x27bd24,versions:_0x895085,latestJourneyId:_0x7fc066}=_0x3b825e['data'];console['error'](_0x27bd24+':\x20'+_0x895085[_0x461ecf(0x182)]+_0x461ecf(0x205)+(_0x895085['length']!==0x1?'s':''));const _0x147fb2=_0x895085[_0x461ecf(0x234)](_0x203924=>({'version':_0x203924[_0x461ecf(0x1b8)],'journey_id':_0x203924[_0x461ecf(0x153)],'name':_0x203924[_0x461ecf(0x1a4)],'state':_0x203924['state'],'paused':_0x203924[_0x461ecf(0x1c8)],'latest':_0x203924[_0x461ecf(0x153)]===_0x7fc066,'created_at':_0x203924[_0x461ecf(0x157)]}));return await handleSDKOutput(_0x147fb2,_0x4a6c45),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a28_0x20e6c4(0x236);[a28_0x20e6c4(0x230)]=a28_0x20e6c4(0x1b4);async[a28_0x20e6c4(0x19c)](_0x249e63){const _0x484834=a28_0x20e6c4,{options:_0x4e562a,args:_0x2ee0d5,tdx:_0xd74a0e}=_0x249e63,_0x3f463a=_0x2ee0d5[0x0];if(!requireNameOrPath(_0x3f463a))return 0x1;if(_0x4e562a['verbose'])console[_0x484834(0x1af)]('Input:\x20'+_0x3f463a);const {journeyId:_0x50f9db,journeyName:_0xe45130}=await resolveJourneyIdFromInput(_0x3f463a,_0x4e562a,_0xd74a0e);if(!_0x4e562a[_0x484834(0x1ad)]){const _0x5cfe7d=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0xe45130+'\x22?');if(!_0x5cfe7d)return console[_0x484834(0x1af)](_0x484834(0x1e6)),0x0;}const _0x5aa772=await withSpinner('Creating\x20new\x20version...',()=>_0xd74a0e[_0x484834(0x156)][_0x484834(0x21a)](_0x50f9db),{'verbose':_0x4e562a[_0x484834(0x202)]}),_0x469934=_0x5aa772['data'];return console[_0x484834(0x1af)](a28_0x1d92ca[_0x484834(0x25e)]('✔')+_0x484834(0x211)+_0x469934[_0x484834(0x191)][_0x484834(0x1b8)]+_0x484834(0x1bd)+_0x469934[_0x484834(0x191)]['name']+'\x22'),console[_0x484834(0x1af)](_0x484834(0x213)+_0x469934['id']),await handleSingleObjectOutput({'id':_0x469934['id'],'name':_0x469934[_0x484834(0x191)][_0x484834(0x1a4)],'version':_0x469934[_0x484834(0x191)]['versionNumber'],'state':_0x469934[_0x484834(0x191)][_0x484834(0x1e8)],'bundle_id':_0x469934['attributes'][_0x484834(0x178)],'created_at':_0x469934[_0x484834(0x191)][_0x484834(0x157)]},_0x4e562a),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x20e6c4(0x1a4)]=a28_0x20e6c4(0x258);[a28_0x20e6c4(0x230)]=a28_0x20e6c4(0x20a);async[a28_0x20e6c4(0x19c)](_0x291090){const _0xebdbf6=a28_0x20e6c4,{options:_0x1d7bc1,args:_0x3a76a3,tdx:_0x170dd1}=_0x291090,_0x5eb2b5=_0x3a76a3[0x0];if(!requireNameOrPath(_0x5eb2b5))return 0x1;const _0xed84fa=_0x1d7bc1[_0xebdbf6(0x247)];if(!_0xed84fa)return console[_0xebdbf6(0x1af)](_0xebdbf6(0x1d5)),console[_0xebdbf6(0x1af)](_0xebdbf6(0x246)),0x1;const _0x9612c8=parseInt(_0xed84fa,0xa);if(isNaN(_0x9612c8)||_0x9612c8<0x1)return console[_0xebdbf6(0x1af)](_0xebdbf6(0x159)+_0xed84fa),0x1;if(_0x1d7bc1['verbose'])console['error'](_0xebdbf6(0x1ed)+_0x5eb2b5+_0xebdbf6(0x1d6)+_0x9612c8);const {journeyId:_0x1d67d2,parentSegmentId:_0x284792}=await resolveJourneyIdFromInput(_0x5eb2b5,_0x1d7bc1,_0x170dd1),_0x34c6eb=await withSpinner(_0xebdbf6(0x193),()=>_0x170dd1['journey'][_0xebdbf6(0x257)](_0x1d67d2),{'verbose':_0x1d7bc1['verbose']}),{versions:_0x4ee960,latestJourneyId:_0x50eec8}=_0x34c6eb[_0xebdbf6(0x206)],_0xe894cc=_0x4ee960[_0xebdbf6(0x21d)](_0x5a94d1=>_0x5a94d1[_0xebdbf6(0x1b8)]===_0x9612c8);if(!_0xe894cc){const _0xe6efc4=_0x4ee960[_0xebdbf6(0x234)](_0x193dc0=>'v'+_0x193dc0['versionNumber'])['join'](',\x20');return console[_0xebdbf6(0x1af)]('Error:\x20Version\x20'+_0x9612c8+_0xebdbf6(0x241)+_0xe6efc4),0x1;}const _0x3ca71b=await withSpinner(_0xebdbf6(0x1f2)+_0x9612c8+_0xebdbf6(0x158),()=>_0x170dd1[_0xebdbf6(0x156)][_0xebdbf6(0x1de)](_0xe894cc[_0xebdbf6(0x153)]),{'verbose':_0x1d7bc1[_0xebdbf6(0x202)]}),_0x4fd99c=_0x3ca71b[_0xebdbf6(0x206)],_0x403fb8=getConsoleNextUrl(_0x1d7bc1[_0xebdbf6(0x217)],_0xebdbf6(0x192)+_0x284792+_0xebdbf6(0x25c)+_0xe894cc['journeyId']+_0xebdbf6(0x1a8));return await handleSingleObjectOutput({'id':_0x4fd99c['id'],'name':_0x4fd99c['attributes'][_0xebdbf6(0x1a4)],'version':_0x4fd99c[_0xebdbf6(0x191)]['versionNumber'],'description':_0x4fd99c[_0xebdbf6(0x191)]['description'],'state':_0x4fd99c[_0xebdbf6(0x191)]['state'],'paused':_0x4fd99c[_0xebdbf6(0x191)][_0xebdbf6(0x1c8)],'reentry_mode':_0x4fd99c[_0xebdbf6(0x191)][_0xebdbf6(0x1aa)],'stages':_0x4fd99c[_0xebdbf6(0x191)][_0xebdbf6(0x1f1)]?.['length']||0x0,..._0x4fd99c[_0xebdbf6(0x191)][_0xebdbf6(0x1e4)]&&{'goal':_0x4fd99c[_0xebdbf6(0x191)]['goal'][_0xebdbf6(0x1a4)]},'latest':_0xe894cc[_0xebdbf6(0x153)]===_0x50eec8,'created_at':_0x4fd99c[_0xebdbf6(0x191)][_0xebdbf6(0x157)],'updated_at':_0x4fd99c['attributes'][_0xebdbf6(0x1fc)],'url':_0x403fb8},_0x1d7bc1),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x310ff8=a29_0x4a66;(function(_0x1df562,_0x260f34){const _0x58a531=a29_0x4a66,_0x622b10=_0x1df562();while(!![]){try{const _0x16db62=-parseInt(_0x58a531(0x97))/0x1*(-parseInt(_0x58a531(0x76))/0x2)+-parseInt(_0x58a531(0x7e))/0x3+-parseInt(_0x58a531(0x9d))/0x4+-parseInt(_0x58a531(0x88))/0x5+parseInt(_0x58a531(0x89))/0x6+-parseInt(_0x58a531(0x8f))/0x7+parseInt(_0x58a531(0x77))/0x8;if(_0x16db62===_0x260f34)break;else _0x622b10['push'](_0x622b10['shift']());}catch(_0x2fb14c){_0x622b10['push'](_0x622b10['shift']());}}}(a29_0x3db4,0x32bff));function a29_0x4a66(_0x5d1b92,_0x5cd959){_0x5d1b92=_0x5d1b92-0x74;const _0x3db449=a29_0x3db4();let _0x4a667f=_0x3db449[_0x5d1b92];return _0x4a667f;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x3db4(){const _0x41d257=['journey','filter','journey:validate','no_parent','Validation\x20failed:\x20','\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','execute','1887HetZoG','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','targetDir','red','errorCode','Error:\x20Directory\x20not\x20found:\x20','179832wvdMbg','✔\x20All\x20','length','name','Validate\x20journey\x20YAML\x20files','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','warnings','cyan','.yaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','description','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','green','dim','\x20segment\x20file(s)\x20skipped','error','helpText','426gBIzal','2908488pdQrPC','skippedCount','\x20journey(s)\x20valid','yellow','\x20journey(s)\x20with\x20errors,\x20','log','hasErrors','818730BAlBFm','\x20valid','valid','warningCount','parentSegment','validCount','invalidCount','relativePath','cwd','type','822010NGtVlw','1924098oypunF','.yml','\x20warning(s)\x20found','\x20error(s)','endsWith','verbose','2772238VQGxGH'];a29_0x3db4=function(){return _0x41d257;};return a29_0x3db4();}import{existsSync}from'fs';import a29_0x57eae5 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_0x310ff8(0xa0)]=a29_0x310ff8(0x92);[a29_0x310ff8(0xa7)]=a29_0x310ff8(0xa1);async[a29_0x310ff8(0x96)](_0x1eddf7){const _0x54f247=a29_0x310ff8,{options:_0x26a25a,args:_0x278a24}=_0x1eddf7,_0x5545ef=_0x26a25a,_0x4a654d=await resolveTarget({'arg':_0x278a24[0x0],'contextParent':_0x26a25a[_0x54f247(0x82)],'cwd':process[_0x54f247(0x86)]()});if(!isSuccessfulResolution(_0x4a654d))return _0x4a654d[_0x54f247(0x9b)]===_0x54f247(0x93)?(console[_0x54f247(0x74)](a29_0x57eae5[_0x54f247(0x7a)](_0x54f247(0x98))),console[_0x54f247(0x74)](_0x54f247(0xa9)),console[_0x54f247(0x74)](_0x54f247(0x95)),console[_0x54f247(0x74)](_0x54f247(0xa6))):(console[_0x54f247(0x74)](a29_0x57eae5[_0x54f247(0x9a)]('Error:\x20'+_0x4a654d['message']+'\x0a')),_0x4a654d[_0x54f247(0x75)]&&console[_0x54f247(0x74)](a29_0x57eae5[_0x54f247(0xa4)](_0x4a654d[_0x54f247(0x75)]))),0x1;const _0x475042=_0x4a654d[_0x54f247(0x99)],_0x29b62f=_0x4a654d[_0x54f247(0x87)]==='file'?_0x4a654d['filePath']:undefined;if(!_0x29b62f&&!existsSync(_0x475042))return console['error'](a29_0x57eae5[_0x54f247(0x9a)](_0x54f247(0x9c)+_0x475042+'\x0a')),0x1;let _0x32f4a7;if(_0x29b62f){if(!_0x29b62f['endsWith'](_0x54f247(0x8a))&&!_0x29b62f[_0x54f247(0x8d)](_0x54f247(0xa5)))return console['error'](a29_0x57eae5[_0x54f247(0x9a)](_0x54f247(0xa8)+_0x29b62f+'\x0a')),0x1;_0x32f4a7=[_0x29b62f];}else _0x32f4a7=findYamlFiles(_0x475042);if(_0x32f4a7[_0x54f247(0x9f)]===0x0)return console[_0x54f247(0x74)](a29_0x57eae5[_0x54f247(0x9a)](_0x54f247(0xa2)+_0x475042+'\x0a')),0x1;const _0x4d435e=validateYamlFiles(_0x32f4a7,_0x475042,{'filterType':_0x54f247(0x90)}),_0x1b6774=calculateSummary(_0x4d435e),_0x33cbc8=_0x4d435e[_0x54f247(0x91)](isValidationResult);if(_0x33cbc8[_0x54f247(0x9f)]===0x0)return console['error'](a29_0x57eae5[_0x54f247(0x7a)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x475042+'\x0a')),_0x1b6774[_0x54f247(0x78)]>0x0&&console['error'](a29_0x57eae5[_0x54f247(0xab)]('('+_0x1b6774[_0x54f247(0x78)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x4fc320 of _0x4d435e){if(!isValidationResult(_0x4fc320)){_0x5545ef['verbose']&&console[_0x54f247(0x7c)](a29_0x57eae5['dim']('-\x20'+_0x4fc320[_0x54f247(0x85)]+'\x20(skipped:\x20'+_0x4fc320['reason']+')'));continue;}const {relativePath:_0x522bf5,source:_0xafc3b2,result:_0x3c141e}=_0x4fc320;if(_0x3c141e[_0x54f247(0x80)]&&_0x3c141e[_0x54f247(0xa3)][_0x54f247(0x9f)]===0x0)_0x5545ef[_0x54f247(0x8e)]&&console[_0x54f247(0x7c)](a29_0x57eae5[_0x54f247(0xaa)]('✔\x20'+_0x522bf5));else _0x3c141e[_0x54f247(0x80)]?(console[_0x54f247(0x7c)](a29_0x57eae5[_0x54f247(0x7a)]('⚠\x20'+_0x522bf5+':\x20'+_0x3c141e[_0x54f247(0xa3)]['length']+'\x20warning(s)')),console['log'](formatValidationResult(_0x3c141e,_0xafc3b2,_0x522bf5))):(console['log'](a29_0x57eae5[_0x54f247(0x9a)]('✖\x20'+_0x522bf5+':\x20'+_0x3c141e['errors'][_0x54f247(0x9f)]+_0x54f247(0x8c))),console['log'](formatValidationResult(_0x3c141e,_0xafc3b2,_0x522bf5)));}return console[_0x54f247(0x7c)](''),_0x1b6774[_0x54f247(0x7d)]?(console['log'](a29_0x57eae5['red'](_0x54f247(0x94)+_0x1b6774[_0x54f247(0x84)]+_0x54f247(0x7b)+_0x1b6774[_0x54f247(0x83)]+_0x54f247(0x7f))),_0x1b6774[_0x54f247(0x81)]>0x0&&console[_0x54f247(0x7c)](a29_0x57eae5[_0x54f247(0x7a)](_0x1b6774[_0x54f247(0x81)]+_0x54f247(0x8b))),_0x1b6774[_0x54f247(0x78)]>0x0&&console[_0x54f247(0x7c)](a29_0x57eae5[_0x54f247(0xab)](_0x1b6774['skippedCount']+_0x54f247(0xac))),0x1):(console[_0x54f247(0x7c)](a29_0x57eae5[_0x54f247(0xaa)](_0x54f247(0x9e)+_0x1b6774[_0x54f247(0x83)]+_0x54f247(0x79))),_0x1b6774[_0x54f247(0x81)]>0x0&&console[_0x54f247(0x7c)](a29_0x57eae5['yellow'](_0x1b6774[_0x54f247(0x81)]+_0x54f247(0x8b))),_0x1b6774[_0x54f247(0x78)]>0x0&&console[_0x54f247(0x7c)](a29_0x57eae5[_0x54f247(0xab)](_0x1b6774['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x0);}}
|