@treasuredata/tdx 2026.3.31 → 2026.3.33
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +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 +34 -0
- package/dist/commands/work-command.d.ts.map +1 -0
- package/dist/commands/work-command.js +1 -0
- package/dist/commands/work-command.js.map +1 -0
- 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.d.ts +2 -0
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +2 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +169 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -0
- package/dist/sdk/types/workspace.js +1 -0
- package/dist/sdk/types/workspace.js.map +1 -0
- 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.d.ts +28 -0
- package/dist/sdk/workspace/frontmatter.d.ts.map +1 -0
- package/dist/sdk/workspace/frontmatter.js +1 -0
- package/dist/sdk/workspace/frontmatter.js.map +1 -0
- package/dist/sdk/workspace/git.d.ts +70 -0
- package/dist/sdk/workspace/git.d.ts.map +1 -0
- package/dist/sdk/workspace/git.js +1 -0
- package/dist/sdk/workspace/git.js.map +1 -0
- package/dist/sdk/workspace/index.d.ts +166 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -0
- package/dist/sdk/workspace/index.js +1 -0
- package/dist/sdk/workspace/index.js.map +1 -0
- package/dist/sdk/workspace/templates.d.ts +17 -0
- package/dist/sdk/workspace/templates.d.ts.map +1 -0
- package/dist/sdk/workspace/templates.js +1 -0
- package/dist/sdk/workspace/templates.js.map +1 -0
- package/dist/sdk/workspace/weekly.d.ts +49 -0
- package/dist/sdk/workspace/weekly.d.ts.map +1 -0
- package/dist/sdk/workspace/weekly.js +1 -0
- package/dist/sdk/workspace/weekly.js.map +1 -0
- package/dist/sdk/workspace/wikilinks.d.ts +49 -0
- package/dist/sdk/workspace/wikilinks.d.ts.map +1 -0
- package/dist/sdk/workspace/wikilinks.js +1 -0
- package/dist/sdk/workspace/wikilinks.js.map +1 -0
- 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_0x1ff901=a26_0xd38e;(function(_0x50be23,_0x1dd34e){const _0x3d6aa5=a26_0xd38e,_0x26f491=_0x50be23();while(!![]){try{const _0x18cef3=parseInt(_0x3d6aa5(0x183))/0x1+parseInt(_0x3d6aa5(0x15a))/0x2*(-parseInt(_0x3d6aa5(0x16a))/0x3)+-parseInt(_0x3d6aa5(0x16f))/0x4+parseInt(_0x3d6aa5(0x176))/0x5*(parseInt(_0x3d6aa5(0x17b))/0x6)+parseInt(_0x3d6aa5(0x186))/0x7+parseInt(_0x3d6aa5(0x17f))/0x8+-parseInt(_0x3d6aa5(0x172))/0x9;if(_0x18cef3===_0x1dd34e)break;else _0x26f491['push'](_0x26f491['shift']());}catch(_0x4d6cee){_0x26f491['push'](_0x26f491['shift']());}}}(a26_0x571f,0x8c81d));function a26_0x571f(){const _0x109756=['26368VENVFA','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','template','log','validCount','endsWith','cwd','\x20non-template\x20file(s)\x20skipped)','\x20non-template\x20file(s)\x20skipped','Validation\x20failed:\x20','description','skippedCount','✔\x20All\x20','name','\x20(skipped:\x20','resolve','24dtwAhu','red','Error:\x20Directory\x20not\x20found:\x20','\x20error(s)','length','4576100eqZyNJ','Validate\x20template\x20YAML\x20files','execute','3706821IUAQzE','\x20warning(s)\x20found','reason','warnings','6470TknbCY','hasErrors','No\x20template\x20YAML\x20files\x20found\x20in\x20','invalidCount','yellow','5190xlMtbd','relativePath','warningCount','dim','1024368jOvPNr','engage:template:validate','green','\x20warning(s)','960136rOzpjN','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yaml','205737FtIvmW','valid','error'];a26_0x571f=function(){return _0x109756;};return a26_0x571f();}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x5f20d0 from'chalk';function a26_0xd38e(_0xc42a18,_0x307731){_0xc42a18=_0xc42a18-0x15a;const _0x571f1c=a26_0x571f();let _0xd38e18=_0x571f1c[_0xc42a18];return _0xd38e18;}import a26_0x32322c 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{[a26_0x1ff901(0x167)]=a26_0x1ff901(0x180);[a26_0x1ff901(0x164)]=a26_0x1ff901(0x170);async[a26_0x1ff901(0x171)](_0x7e0834){const _0xa29c5=a26_0x1ff901,{options:_0x16f017,args:_0x76d731}=_0x7e0834,_0xfa798b=_0x16f017,_0x4ce965=_0x76d731[0x0],_0x17f90a=_0x4ce965?a26_0x32322c[_0xa29c5(0x169)](_0x4ce965):undefined,_0x4451d6=_0x17f90a?isYamlFile(_0x17f90a):![];let _0x56ca4f,_0x435884;if(_0x4451d6&&_0x17f90a)_0x56ca4f=a26_0x32322c['dirname'](_0x17f90a),_0x435884=_0x17f90a;else _0x17f90a?_0x56ca4f=_0x17f90a:_0x56ca4f=process[_0xa29c5(0x160)]();if(!_0x435884&&!existsSync(_0x56ca4f))return console[_0xa29c5(0x188)](a26_0x5f20d0['red'](_0xa29c5(0x16c)+_0x56ca4f+'\x0a')),0x1;let _0x15242f;if(_0x435884){if(!_0x435884[_0xa29c5(0x15f)]('.yml')&&!_0x435884['endsWith'](_0xa29c5(0x185)))return console[_0xa29c5(0x188)](a26_0x5f20d0[_0xa29c5(0x16b)](_0xa29c5(0x15b)+_0x435884+'\x0a')),0x1;_0x15242f=[_0x435884];}else _0x15242f=findYamlFiles(_0x56ca4f);if(_0x15242f[_0xa29c5(0x16e)]===0x0)return console[_0xa29c5(0x188)](a26_0x5f20d0['red'](_0xa29c5(0x184)+_0x56ca4f+'\x0a')),0x1;const _0x418fa8=validateYamlFiles(_0x15242f,_0x56ca4f,{'filterType':_0xa29c5(0x15c)}),_0x13f3c3=calculateSummary(_0x418fa8),_0x4f5299=_0x418fa8['filter'](isValidationResult);if(_0x4f5299['length']===0x0)return console['error'](a26_0x5f20d0[_0xa29c5(0x17a)](_0xa29c5(0x178)+_0x56ca4f+'\x0a')),_0x13f3c3['skippedCount']>0x0&&console[_0xa29c5(0x188)](a26_0x5f20d0['dim']('('+_0x13f3c3[_0xa29c5(0x165)]+_0xa29c5(0x161))),0x0;for(const _0x3b49a7 of _0x418fa8){if(!isValidationResult(_0x3b49a7)){_0xfa798b['verbose']&&console[_0xa29c5(0x15d)](a26_0x5f20d0['dim']('-\x20'+_0x3b49a7[_0xa29c5(0x17c)]+_0xa29c5(0x168)+_0x3b49a7[_0xa29c5(0x174)]+')'));continue;}const {relativePath:_0x176c9e,source:_0x4eef01,result:_0x92690e}=_0x3b49a7;if(_0x92690e[_0xa29c5(0x187)]&&_0x92690e[_0xa29c5(0x175)][_0xa29c5(0x16e)]===0x0)_0xfa798b['verbose']&&console[_0xa29c5(0x15d)](a26_0x5f20d0['green']('✔\x20'+_0x176c9e));else _0x92690e['valid']?(console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17a)]('⚠\x20'+_0x176c9e+':\x20'+_0x92690e[_0xa29c5(0x175)]['length']+_0xa29c5(0x182))),console['log'](formatValidationResult(_0x92690e,_0x4eef01,_0x176c9e))):(console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x16b)]('✖\x20'+_0x176c9e+':\x20'+_0x92690e['errors'][_0xa29c5(0x16e)]+_0xa29c5(0x16d))),console[_0xa29c5(0x15d)](formatValidationResult(_0x92690e,_0x4eef01,_0x176c9e)));}return console[_0xa29c5(0x15d)](''),_0x13f3c3[_0xa29c5(0x177)]?(console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x16b)](_0xa29c5(0x163)+_0x13f3c3[_0xa29c5(0x179)]+'\x20template(s)\x20with\x20errors,\x20'+_0x13f3c3[_0xa29c5(0x15e)]+'\x20valid')),_0x13f3c3[_0xa29c5(0x17d)]>0x0&&console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17a)](_0x13f3c3[_0xa29c5(0x17d)]+'\x20warning(s)\x20found')),_0x13f3c3['skippedCount']>0x0&&console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17e)](_0x13f3c3['skippedCount']+_0xa29c5(0x162))),0x1):(console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x181)](_0xa29c5(0x166)+_0x13f3c3[_0xa29c5(0x15e)]+'\x20template(s)\x20valid')),_0x13f3c3[_0xa29c5(0x17d)]>0x0&&console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17a)](_0x13f3c3['warningCount']+_0xa29c5(0x173))),_0x13f3c3['skippedCount']>0x0&&console[_0xa29c5(0x15d)](a26_0x5f20d0[_0xa29c5(0x17e)](_0x13f3c3[_0xa29c5(0x165)]+_0xa29c5(0x162))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x442de4=a27_0x3a3c;(function(_0x3e1507,_0x428d72){const _0x398712=a27_0x3a3c,_0x336d94=_0x3e1507();while(!![]){try{const _0x28fd29=-parseInt(_0x398712(0xdc))/0x1+-parseInt(_0x398712(0xd9))/0x2+-parseInt(_0x398712(0xb8))/0x3+-parseInt(_0x398712(0xb1))/0x4+parseInt(_0x398712(0xaa))/0x5*(-parseInt(_0x398712(0xe0))/0x6)+parseInt(_0x398712(0xc6))/0x7+parseInt(_0x398712(0xa4))/0x8;if(_0x28fd29===_0x428d72)break;else _0x336d94['push'](_0x336d94['shift']());}catch(_0x4fa5ad){_0x336d94['push'](_0x336d94['shift']());}}}(a27_0x582c,0x77ff5));function a27_0x3a3c(_0x3eb5ab,_0x46e773){_0x3eb5ab=_0x3eb5ab-0x92;const _0x582cb3=a27_0x582c();let _0x3a3c96=_0x582cb3[_0x3eb5ab];return _0x3a3c96;}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_0x28b99f from'chalk';function formatDuration(_0x471b7){const _0x2b987f=a27_0x3a3c;if(_0x471b7<0x3c)return _0x471b7+'s';if(_0x471b7<0xe10)return Math['floor'](_0x471b7/0x3c)+'m\x20'+_0x471b7%0x3c+'s';const _0x42daf5=Math[_0x2b987f(0xa6)](_0x471b7/0xe10),_0x17be6e=Math[_0x2b987f(0xa6)](_0x471b7%0xe10/0x3c);return _0x17be6e>0x0?_0x42daf5+'h\x20'+_0x17be6e+'m':_0x42daf5+'h';}function formatRelativeTime(_0x4a1f6c){const _0x3a88ed=a27_0x3a3c,_0x6afe12=Date[_0x3a88ed(0xe1)]()-_0x4a1f6c['getTime'](),_0x398014=Math[_0x3a88ed(0xa6)](Math['abs'](_0x6afe12)/0x3e8);if(_0x398014<0x3c)return _0x3a88ed(0xae);const _0x4d7751=Math[_0x3a88ed(0xa6)](_0x398014/0x3c);if(_0x4d7751<0x3c)return _0x4d7751+_0x3a88ed(0xe4);const _0x8af203=Math[_0x3a88ed(0xa6)](_0x4d7751/0x3c);if(_0x8af203<0x18)return _0x8af203+'h\x20ago';const _0x527766=Math[_0x3a88ed(0xa6)](_0x8af203/0x18);if(_0x527766<0x1e)return _0x527766+'d\x20ago';return Math['floor'](_0x527766/0x1e)+_0x3a88ed(0xd3);}export class JobListCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xba);[a27_0x442de4(0xe7)]=a27_0x442de4(0xda);async[a27_0x442de4(0xcf)](_0xfbba7d){const _0xe32e18=a27_0x442de4,{options:_0x4f51c6,tdx:_0x5145b6}=_0xfbba7d,_0x40db22=resolveLimit(_0x4f51c6[_0xe32e18(0xc4)],DEFAULT_DISPLAY_LIMIT),_0x2a20ae=_0x4f51c6[_0xe32e18(0xd4)];_0x4f51c6[_0xe32e18(0xb7)]&&(console[_0xe32e18(0xbc)](_0xe32e18(0xa8)+_0x40db22+'\x20jobs'),_0x2a20ae&&console[_0xe32e18(0xbc)](_0xe32e18(0xa2)+_0x2a20ae));const _0x241006=await withSpinner(_0xe32e18(0xd2),()=>_0x5145b6[_0xe32e18(0xba)][_0xe32e18(0x9b)]({'from':0x0,'to':_0x40db22-0x1,'status':_0x2a20ae}),{'verbose':_0x4f51c6['verbose']}),_0x5d7b0a=_0x241006[_0xe32e18(0x9c)];console[_0xe32e18(0xbc)](_0xe32e18(0xe3)+_0x5d7b0a['length']+_0xe32e18(0xab)+(_0x5d7b0a[_0xe32e18(0x95)]!==0x1?'s':''));const _0x27e356=_0x4f51c6[_0xe32e18(0x9d)];if(isStructuredFormat(_0x4f51c6)){const _0x57a2be=_0x5d7b0a['map'](_0x1e5f66=>{const _0x49835a=_0xe32e18;let _0x3e9873;if(_0x1e5f66[_0x49835a(0x9e)]&&_0x1e5f66[_0x49835a(0xc2)]){const _0x30aa9a=new Date(_0x1e5f66[_0x49835a(0x9e)])[_0x49835a(0xb2)](),_0x1307ee=new Date(_0x1e5f66[_0x49835a(0xc2)])[_0x49835a(0xb2)]();_0x3e9873=Math[_0x49835a(0xac)]((_0x1307ee-_0x30aa9a)/0x3e8);}return{'job_id':_0x1e5f66[_0x49835a(0xad)],'type':_0x1e5f66[_0x49835a(0xd6)]===_0x49835a(0x99)?_0x49835a(0xaf):_0x1e5f66[_0x49835a(0xd6)],'status':_0x1e5f66[_0x49835a(0xd4)],'user_name':_0x1e5f66[_0x49835a(0xde)],'duration_sec':_0x3e9873,'created_at':_0x1e5f66[_0x49835a(0xbf)],'started_at':_0x1e5f66[_0x49835a(0x9e)],'end_at':_0x1e5f66[_0x49835a(0xc2)]};});await handleSDKOutput(_0x57a2be,_0x4f51c6);}else for(const _0x375217 of _0x5d7b0a){const _0x5ddf3f=_0x375217[_0xe32e18(0xd4)]===_0xe32e18(0xc8)?a27_0x28b99f[_0xe32e18(0xcb)]:_0x375217[_0xe32e18(0xd4)]===_0xe32e18(0xbc)?a27_0x28b99f[_0xe32e18(0x97)]:a27_0x28b99f[_0xe32e18(0xa7)],_0x137c2e=_0x5ddf3f(_0x375217['status']),_0x24dd12=getJobUrl(_0x27e356,_0x375217[_0xe32e18(0xad)]),_0xe1ddb5=hyperlink(_0x375217[_0xe32e18(0xad)],_0x24dd12),_0x569806=a27_0x28b99f['dim'](_0x375217['type']===_0xe32e18(0x99)?_0xe32e18(0xaf):_0x375217['type']),_0x2f12e6=[];if(_0x375217[_0xe32e18(0x9e)]&&_0x375217[_0xe32e18(0xc2)]){const _0x3ee344=Math[_0xe32e18(0xac)]((new Date(_0x375217[_0xe32e18(0xc2)])[_0xe32e18(0xb2)]()-new Date(_0x375217['start_at'])[_0xe32e18(0xb2)]())/0x3e8);_0x2f12e6['push'](formatDuration(_0x3ee344));}if(_0x375217['end_at'])_0x2f12e6[_0xe32e18(0xcd)](formatRelativeTime(new Date(_0x375217[_0xe32e18(0xc2)])));else _0x375217[_0xe32e18(0x9e)]&&_0x2f12e6['push'](formatRelativeTime(new Date(_0x375217[_0xe32e18(0x9e)])));const _0x28a9df=_0x2f12e6[_0xe32e18(0x95)]>0x0?a27_0x28b99f['dim']('\x20'+_0x2f12e6[_0xe32e18(0xbd)](',\x20')):'';console['log']('⚡\x20'+_0xe1ddb5+'\x20'+_0x569806+'\x20'+_0x137c2e+_0x28a9df);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x442de4(0xd1)]='job:show';[a27_0x442de4(0xe7)]=a27_0x442de4(0xe5);['validate'](_0x3f854c){const _0x4630a5=a27_0x442de4,_0x42a961=_0x3f854c[_0x4630a5(0xd7)][0x0];if(!_0x42a961)return _0x4630a5(0xdb);return undefined;}async['execute'](_0x426d90){const _0x5e4815=a27_0x442de4,{options:_0x5595ba,args:_0x26a0e2,tdx:_0x5a7928}=_0x426d90,_0xb728bc=_0x26a0e2[0x0],_0x69b054=await withSpinner(_0x5e4815(0xd0),()=>_0x5a7928[_0x5e4815(0xba)][_0x5e4815(0xdf)](_0xb728bc),{'verbose':_0x5595ba['verbose']}),_0x3cf9cb=_0x69b054[_0x5e4815(0x9c)];let _0x5ac279;if(_0x3cf9cb[_0x5e4815(0x9e)]&&_0x3cf9cb[_0x5e4815(0xc2)]){const _0x511426=new Date(_0x3cf9cb['start_at'])[_0x5e4815(0xb2)](),_0x2198e1=new Date(_0x3cf9cb['end_at'])[_0x5e4815(0xb2)]();_0x5ac279=Math[_0x5e4815(0xac)]((_0x2198e1-_0x511426)/0x3e8);}const _0x2ca293={'job_id':_0x3cf9cb[_0x5e4815(0xad)],'type':_0x3cf9cb[_0x5e4815(0xd6)],'status':_0x3cf9cb[_0x5e4815(0xd4)],..._0x3cf9cb[_0x5e4815(0xde)]&&{'user_name':_0x3cf9cb[_0x5e4815(0xde)]},..._0x5ac279!==undefined&&{'duration_sec':_0x5ac279},..._0x3cf9cb[_0x5e4815(0xbf)]&&{'created_at':_0x3cf9cb[_0x5e4815(0xbf)]},..._0x3cf9cb[_0x5e4815(0x9e)]&&{'started_at':_0x3cf9cb[_0x5e4815(0x9e)]},..._0x3cf9cb[_0x5e4815(0xc2)]&&{'end_at':_0x3cf9cb[_0x5e4815(0xc2)]},..._0x3cf9cb['database']&&{'database':_0x3cf9cb[_0x5e4815(0xb5)]},..._0x3cf9cb[_0x5e4815(0xa0)]!==undefined&&{'priority':_0x3cf9cb[_0x5e4815(0xa0)]},..._0x3cf9cb[_0x5e4815(0xc7)]&&{'url':_0x3cf9cb['url']},..._0x3cf9cb[_0x5e4815(0xce)]&&{'query':_0x3cf9cb['query']},..._0x3cf9cb[_0x5e4815(0x94)]&&{'debug':_0x3cf9cb[_0x5e4815(0x94)]}};return await handleSingleObjectOutput(_0x2ca293,_0x5595ba),0x0;}}function a27_0x582c(){const _0x2a2eda=['2508116Befely','getTime','information_schema','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','database','Submit\x20a\x20job','verbose','1051443sbgTkw','hive','jobs','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','error','join','...','created_at','job:submit','\x27\x20to\x20verify\x20the\x20job\x20status','end_at','validate','limit','Job\x20type:\x20','2390829pduXFt','url','success','Query:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','green','Cancelled','push','query','execute','Getting\x20job\x20details...','name','Listing\x20jobs...','mo\x20ago','status','\x20\x20Job\x20ID:\x20','type','args','✔\x20Retrieved\x20','1954548YKSsec','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','630627RCoRtL','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','user_name','show','6ZENkRH','now','Get\x20job\x20results','✔\x20Found\x20','m\x20ago','Show\x20job\x20details','job:result','description','jobType','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','file','debug','length','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','red','Kill\x20a\x20job','presto','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','list','data','site','start_at','Submitting\x20job...','priority','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Status\x20filter:\x20','INVALID_ARGUMENT','28193728iAbyvA','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','floor','dim','Limit:\x20','substring','3944215VaJLTS','\x20job','round','job_id','just\x20now','trino','result'];a27_0x582c=function(){return _0x2a2eda;};return a27_0x582c();}export class JobKillCommand extends BaseCommand{['name']='job:kill';['description']=a27_0x442de4(0x98);['validate'](_0x4c56cb){const _0x39811e=a27_0x442de4,_0x5dc34b=_0x4c56cb[_0x39811e(0xd7)][0x0];if(!_0x5dc34b)return _0x39811e(0x96);return undefined;}async[a27_0x442de4(0xcf)](_0x14bb32){const _0x447642=a27_0x442de4,{options:_0x1c1712,args:_0xed0273,tdx:_0x1b9e66}=_0x14bb32,_0x36099e=_0xed0273[0x0];if(!_0x1c1712['yes']){const _0x36b397=await confirm(_0x447642(0xb4)+_0x36099e+'?');if(!_0x36b397)return console[_0x447642(0xbc)](_0x447642(0xcc)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x1b9e66[_0x447642(0xba)]['kill'](_0x36099e),{'verbose':_0x1c1712[_0x447642(0xb7)]}),console[_0x447642(0xbc)](_0x447642(0x92)+_0x36099e),console[_0x447642(0xbc)](_0x447642(0xca)+_0x36099e+_0x447642(0xc1)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xc0);['description']=a27_0x442de4(0xb6);async[a27_0x442de4(0xcf)](_0x138a2c){const _0x9a24b4=a27_0x442de4,{options:_0x47f27a,args:_0x324092,tdx:_0xaeb696}=_0x138a2c,_0x58b160=_0x47f27a[_0x9a24b4(0xe8)]||_0x9a24b4(0xaf),_0x590aaa=_0x47f27a[_0x9a24b4(0x93)],_0x26191f=_0x47f27a['database']||_0x9a24b4(0xb3),_0x5230dc=_0x47f27a['result'];if(_0x58b160!==_0x9a24b4(0xaf)&&_0x58b160!==_0x9a24b4(0xb9))throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xa1));let _0x3d2474;if(_0x590aaa){if(_0x324092[0x0])throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xbb));const _0x310d6d=readSqlStatementsFromFile(_0x590aaa);if(_0x310d6d[_0x9a24b4(0x95)]===0x0)throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x310d6d[_0x9a24b4(0x95)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x9a24b4(0x9a));_0x3d2474=_0x310d6d[0x0];}else{if(!_0x324092[0x0])throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xa5));_0x3d2474=_0x324092[0x0];}_0x47f27a['verbose']&&(console[_0x9a24b4(0xbc)](_0x9a24b4(0xc5)+_0x58b160),console[_0x9a24b4(0xbc)]('Database:\x20'+_0x26191f),console[_0x9a24b4(0xbc)](_0x9a24b4(0xc9)+_0x3d2474[_0x9a24b4(0xa9)](0x0,0x64)+(_0x3d2474['length']>0x64?_0x9a24b4(0xbe):'')));const _0x2bf56f=await withSpinner(_0x9a24b4(0x9f),()=>_0xaeb696[_0x9a24b4(0xba)]['submit'](_0x26191f,_0x3d2474,_0x58b160,_0x5230dc),{'verbose':_0x47f27a['verbose']}),_0x59086f=_0x2bf56f[_0x9a24b4(0x9c)];return console[_0x9a24b4(0xbc)]('✔\x20Job\x20submitted'),console[_0x9a24b4(0xbc)](_0x9a24b4(0xd5)+_0x59086f['job_id']),await handleSDKOutput([_0x59086f],_0x47f27a),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xe6);[a27_0x442de4(0xe7)]=a27_0x442de4(0xe2);[a27_0x442de4(0xc3)](_0x31e154){const _0x5b7f49=a27_0x442de4,_0x7a33f5=_0x31e154[_0x5b7f49(0xd7)][0x0];if(!_0x7a33f5)return _0x5b7f49(0xdd);return undefined;}async[a27_0x442de4(0xcf)](_0x5bfa92){const _0xddf19b=a27_0x442de4,{options:_0x503bf2,args:_0x54cea7,tdx:_0x2c1078}=_0x5bfa92,_0x3cf430=_0x54cea7[0x0],_0x2a6d37=await withSpinner('Getting\x20job\x20results...',()=>_0x2c1078['jobs'][_0xddf19b(0xb0)](_0x3cf430),{'verbose':_0x503bf2[_0xddf19b(0xb7)]}),_0xa0abfe=_0x2a6d37['data'];return console[_0xddf19b(0xbc)](_0xddf19b(0xd8)+_0xa0abfe[_0xddf19b(0x95)]+'\x20row'+(_0xa0abfe[_0xddf19b(0x95)]!==0x1?'s':'')),await handleSDKOutput(_0xa0abfe,_0x503bf2),0x0;}}
|
|
1
|
+
const a27_0x43e345=a27_0x2d2c;(function(_0x2c854a,_0x33b3db){const _0x18c139=a27_0x2d2c,_0x3e8655=_0x2c854a();while(!![]){try{const _0x47457f=parseInt(_0x18c139(0x1a4))/0x1+-parseInt(_0x18c139(0x1be))/0x2+parseInt(_0x18c139(0x1a3))/0x3*(parseInt(_0x18c139(0x1db))/0x4)+-parseInt(_0x18c139(0x1bc))/0x5+parseInt(_0x18c139(0x1cb))/0x6*(-parseInt(_0x18c139(0x1ca))/0x7)+parseInt(_0x18c139(0x1c8))/0x8*(parseInt(_0x18c139(0x189))/0x9)+-parseInt(_0x18c139(0x1b0))/0xa*(-parseInt(_0x18c139(0x191))/0xb);if(_0x47457f===_0x33b3db)break;else _0x3e8655['push'](_0x3e8655['shift']());}catch(_0x1bfc1f){_0x3e8655['push'](_0x3e8655['shift']());}}}(a27_0x1e92,0x3069e));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';function a27_0x2d2c(_0x3c7d54,_0x160acb){_0x3c7d54=_0x3c7d54-0x184;const _0x1e9207=a27_0x1e92();let _0x2d2c55=_0x1e9207[_0x3c7d54];return _0x2d2c55;}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_0x4481ac from'chalk';function formatDuration(_0x20c435){const _0x10c64a=a27_0x2d2c;if(_0x20c435<0x3c)return _0x20c435+'s';if(_0x20c435<0xe10)return Math[_0x10c64a(0x186)](_0x20c435/0x3c)+'m\x20'+_0x20c435%0x3c+'s';const _0x239862=Math[_0x10c64a(0x186)](_0x20c435/0xe10),_0x5db3f3=Math[_0x10c64a(0x186)](_0x20c435%0xe10/0x3c);return _0x5db3f3>0x0?_0x239862+'h\x20'+_0x5db3f3+'m':_0x239862+'h';}function formatRelativeTime(_0xf97f53){const _0x15ecd8=a27_0x2d2c,_0x41389c=Date['now']()-_0xf97f53[_0x15ecd8(0x1a0)](),_0x467cdb=Math[_0x15ecd8(0x186)](Math['abs'](_0x41389c)/0x3e8);if(_0x467cdb<0x3c)return'just\x20now';const _0x170389=Math[_0x15ecd8(0x186)](_0x467cdb/0x3c);if(_0x170389<0x3c)return _0x170389+_0x15ecd8(0x19c);const _0x401d3b=Math[_0x15ecd8(0x186)](_0x170389/0x3c);if(_0x401d3b<0x18)return _0x401d3b+_0x15ecd8(0x1aa);const _0x59fc9d=Math[_0x15ecd8(0x186)](_0x401d3b/0x18);if(_0x59fc9d<0x1e)return _0x59fc9d+_0x15ecd8(0x1a5);return Math['floor'](_0x59fc9d/0x1e)+_0x15ecd8(0x19a);}export class JobListCommand extends BaseCommand{[a27_0x43e345(0x1c1)]=a27_0x43e345(0x1a2);[a27_0x43e345(0x1d6)]=a27_0x43e345(0x1a1);async['execute'](_0x46908f){const _0x37d205=a27_0x43e345,{options:_0x529b0a,tdx:_0x572901}=_0x46908f,_0x3e1dad=resolveLimit(_0x529b0a['limit'],DEFAULT_DISPLAY_LIMIT),_0x21dd4a=_0x529b0a[_0x37d205(0x1a7)];_0x529b0a['verbose']&&(console[_0x37d205(0x1b8)](_0x37d205(0x1a9)+_0x3e1dad+_0x37d205(0x1b5)),_0x21dd4a&&console[_0x37d205(0x1b8)](_0x37d205(0x199)+_0x21dd4a));const _0x2f9bf1=await withSpinner(_0x37d205(0x187),()=>_0x572901[_0x37d205(0x1a2)]['list']({'from':0x0,'to':_0x3e1dad-0x1,'status':_0x21dd4a}),{'verbose':_0x529b0a[_0x37d205(0x1c9)]}),_0x46109d=_0x2f9bf1[_0x37d205(0x1d1)];console[_0x37d205(0x1b8)](_0x37d205(0x1d3)+_0x46109d[_0x37d205(0x185)]+_0x37d205(0x1bb)+(_0x46109d[_0x37d205(0x185)]!==0x1?'s':''));const _0x4a9f34=_0x529b0a['site'];if(isStructuredFormat(_0x529b0a)){const _0x2a4781=_0x46109d['map'](_0x104e73=>{const _0x2995b7=_0x37d205;let _0x45e3ce;if(_0x104e73['start_at']&&_0x104e73[_0x2995b7(0x18f)]){const _0x1e2555=new Date(_0x104e73['start_at'])[_0x2995b7(0x1a0)](),_0x53441a=new Date(_0x104e73[_0x2995b7(0x18f)])[_0x2995b7(0x1a0)]();_0x45e3ce=Math['round']((_0x53441a-_0x1e2555)/0x3e8);}return{'job_id':_0x104e73[_0x2995b7(0x1ac)],'type':_0x104e73[_0x2995b7(0x1bd)]===_0x2995b7(0x1b1)?_0x2995b7(0x18e):_0x104e73[_0x2995b7(0x1bd)],'status':_0x104e73[_0x2995b7(0x1a7)],'user_name':_0x104e73[_0x2995b7(0x194)],'duration_sec':_0x45e3ce,'created_at':_0x104e73[_0x2995b7(0x1af)],'started_at':_0x104e73[_0x2995b7(0x18c)],'end_at':_0x104e73[_0x2995b7(0x18f)]};});await handleSDKOutput(_0x2a4781,_0x529b0a);}else for(const _0x56cda7 of _0x46109d){const _0x50f111=_0x56cda7['status']===_0x37d205(0x19d)?a27_0x4481ac['green']:_0x56cda7[_0x37d205(0x1a7)]===_0x37d205(0x1b8)?a27_0x4481ac[_0x37d205(0x1c5)]:a27_0x4481ac[_0x37d205(0x195)],_0x5a88d2=_0x50f111(_0x56cda7[_0x37d205(0x1a7)]),_0x3eb216=getJobUrl(_0x4a9f34,_0x56cda7[_0x37d205(0x1ac)]),_0x29b555=hyperlink(_0x56cda7[_0x37d205(0x1ac)],_0x3eb216),_0x13f602=a27_0x4481ac[_0x37d205(0x195)](_0x56cda7[_0x37d205(0x1bd)]==='presto'?'trino':_0x56cda7['type']),_0x2ee313=[];if(_0x56cda7['start_at']&&_0x56cda7[_0x37d205(0x18f)]){const _0x4cd6c4=Math[_0x37d205(0x1ae)]((new Date(_0x56cda7[_0x37d205(0x18f)])[_0x37d205(0x1a0)]()-new Date(_0x56cda7[_0x37d205(0x18c)])['getTime']())/0x3e8);_0x2ee313[_0x37d205(0x1b3)](formatDuration(_0x4cd6c4));}if(_0x56cda7[_0x37d205(0x18f)])_0x2ee313['push'](formatRelativeTime(new Date(_0x56cda7[_0x37d205(0x18f)])));else _0x56cda7[_0x37d205(0x18c)]&&_0x2ee313[_0x37d205(0x1b3)](formatRelativeTime(new Date(_0x56cda7[_0x37d205(0x18c)])));const _0x57de23=_0x2ee313[_0x37d205(0x185)]>0x0?a27_0x4481ac[_0x37d205(0x195)]('\x20'+_0x2ee313['join'](',\x20')):'';console[_0x37d205(0x1bf)]('⚡\x20'+_0x29b555+'\x20'+_0x13f602+'\x20'+_0x5a88d2+_0x57de23);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a27_0x43e345(0x19f);['description']=a27_0x43e345(0x1d4);[a27_0x43e345(0x1ce)](_0x24a212){const _0x4d813b=a27_0x43e345,_0x3bc3c8=_0x24a212[_0x4d813b(0x1a6)][0x0];if(!_0x3bc3c8)return _0x4d813b(0x1c4);return undefined;}async[a27_0x43e345(0x1d8)](_0x6b3431){const _0x249b34=a27_0x43e345,{options:_0x602122,args:_0x41a173,tdx:_0x1c3ca7}=_0x6b3431,_0x426fc6=_0x41a173[0x0],_0x269138=await withSpinner(_0x249b34(0x1b2),()=>_0x1c3ca7[_0x249b34(0x1a2)]['show'](_0x426fc6),{'verbose':_0x602122[_0x249b34(0x1c9)]}),_0x238047=_0x269138[_0x249b34(0x1d1)];let _0x4b6c43;if(_0x238047['start_at']&&_0x238047[_0x249b34(0x18f)]){const _0x34e6a7=new Date(_0x238047['start_at'])[_0x249b34(0x1a0)](),_0x4da16b=new Date(_0x238047[_0x249b34(0x18f)])[_0x249b34(0x1a0)]();_0x4b6c43=Math[_0x249b34(0x1ae)]((_0x4da16b-_0x34e6a7)/0x3e8);}const _0x5e10a1={'job_id':_0x238047['job_id'],'type':_0x238047[_0x249b34(0x1bd)],'status':_0x238047[_0x249b34(0x1a7)],..._0x238047['user_name']&&{'user_name':_0x238047[_0x249b34(0x194)]},..._0x4b6c43!==undefined&&{'duration_sec':_0x4b6c43},..._0x238047[_0x249b34(0x1af)]&&{'created_at':_0x238047[_0x249b34(0x1af)]},..._0x238047[_0x249b34(0x18c)]&&{'started_at':_0x238047['start_at']},..._0x238047[_0x249b34(0x18f)]&&{'end_at':_0x238047['end_at']},..._0x238047[_0x249b34(0x1c6)]&&{'database':_0x238047[_0x249b34(0x1c6)]},..._0x238047['priority']!==undefined&&{'priority':_0x238047[_0x249b34(0x18a)]},..._0x238047[_0x249b34(0x1d7)]&&{'url':_0x238047[_0x249b34(0x1d7)]},..._0x238047[_0x249b34(0x198)]&&{'query':_0x238047[_0x249b34(0x198)]},..._0x238047[_0x249b34(0x19b)]&&{'debug':_0x238047[_0x249b34(0x19b)]}};return await handleSingleObjectOutput(_0x5e10a1,_0x602122),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x43e345(0x1c1)]=a27_0x43e345(0x1cd);[a27_0x43e345(0x1d6)]=a27_0x43e345(0x1c0);['validate'](_0x265dd0){const _0x519636=a27_0x43e345,_0x3297cf=_0x265dd0[_0x519636(0x1a6)][0x0];if(!_0x3297cf)return _0x519636(0x184);return undefined;}async[a27_0x43e345(0x1d8)](_0x5986b1){const _0x12a19d=a27_0x43e345,{options:_0x2deb0f,args:_0x15cb2d,tdx:_0x489211}=_0x5986b1,_0x319541=_0x15cb2d[0x0];if(!_0x2deb0f[_0x12a19d(0x18d)]){const _0x584d79=await confirm(_0x12a19d(0x1c2)+_0x319541+'?');if(!_0x584d79)return console['error'](_0x12a19d(0x1cc)),0x0;}return await withSpinner(_0x12a19d(0x1d2),()=>_0x489211[_0x12a19d(0x1a2)]['kill'](_0x319541),{'verbose':_0x2deb0f[_0x12a19d(0x1c9)]}),console[_0x12a19d(0x1b8)](_0x12a19d(0x1d5)+_0x319541),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x319541+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x43e345(0x1c1)]=a27_0x43e345(0x188);['description']='Submit\x20a\x20job';async[a27_0x43e345(0x1d8)](_0x26f7a0){const _0x52b7b1=a27_0x43e345,{options:_0x3406c5,args:_0x2b6b3a,tdx:_0x2b212a}=_0x26f7a0,_0xfccd5e=_0x3406c5[_0x52b7b1(0x1c3)]||_0x52b7b1(0x18e),_0x4da754=_0x3406c5[_0x52b7b1(0x1cf)],_0x365da6=_0x3406c5[_0x52b7b1(0x1c6)]||'information_schema',_0x27bb94=_0x3406c5[_0x52b7b1(0x19e)];if(_0xfccd5e!=='trino'&&_0xfccd5e!==_0x52b7b1(0x1ad))throw new SDKError(ErrorCode[_0x52b7b1(0x192)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x534b7b;if(_0x4da754){if(_0x2b6b3a[0x0])throw new SDKError(ErrorCode[_0x52b7b1(0x192)],_0x52b7b1(0x1ab));const _0x22cc3f=readSqlStatementsFromFile(_0x4da754);if(_0x22cc3f['length']===0x0)throw new SDKError(ErrorCode[_0x52b7b1(0x192)],_0x52b7b1(0x1ba));if(_0x22cc3f[_0x52b7b1(0x185)]>0x1)throw new SDKError(ErrorCode[_0x52b7b1(0x192)],_0x52b7b1(0x197));_0x534b7b=_0x22cc3f[0x0];}else{if(!_0x2b6b3a[0x0])throw new SDKError(ErrorCode[_0x52b7b1(0x192)],_0x52b7b1(0x1b9));_0x534b7b=_0x2b6b3a[0x0];}_0x3406c5[_0x52b7b1(0x1c9)]&&(console['error'](_0x52b7b1(0x1b6)+_0xfccd5e),console['error'](_0x52b7b1(0x190)+_0x365da6),console['error'](_0x52b7b1(0x193)+_0x534b7b['substring'](0x0,0x64)+(_0x534b7b[_0x52b7b1(0x185)]>0x64?'...':'')));const _0x1e4762=await withSpinner(_0x52b7b1(0x196),()=>_0x2b212a['jobs'][_0x52b7b1(0x1b4)](_0x365da6,_0x534b7b,_0xfccd5e,_0x27bb94),{'verbose':_0x3406c5[_0x52b7b1(0x1c9)]}),_0x14726d=_0x1e4762['data'];return console['error'](_0x52b7b1(0x1d9)),console[_0x52b7b1(0x1b8)]('\x20\x20Job\x20ID:\x20'+_0x14726d[_0x52b7b1(0x1ac)]),await handleSDKOutput([_0x14726d],_0x3406c5),0x0;}}function a27_0x1e92(){const _0x37af8e=['job:result','error','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','No\x20SQL\x20statements\x20found\x20in\x20file','\x20job','1329705BfzJGj','type','556420tNcdGp','log','Kill\x20a\x20job','name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','jobType','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','red','database','Get\x20job\x20results','364808JqJtOW','verbose','4844NzTYSI','2172afVgUc','Cancelled','job:kill','validate','file','✔\x20Retrieved\x20','data','Submitting\x20kill\x20request...','✔\x20Found\x20','Show\x20job\x20details','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','description','url','execute','✔\x20Job\x20submitted','Getting\x20job\x20results...','11672fSaRFr','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','length','floor','Listing\x20jobs...','job:submit','9EAKrtH','priority','\x20row','start_at','yes','trino','end_at','Database:\x20','3047JUtrBz','INVALID_ARGUMENT','Query:\x20','user_name','dim','Submitting\x20job...','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','query','Status\x20filter:\x20','mo\x20ago','debug','m\x20ago','success','result','job:show','getTime','List\x20jobs','jobs','63FWpguf','109647KdHTgD','d\x20ago','args','status','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Limit:\x20','h\x20ago','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','job_id','hive','round','created_at','28030LQeibk','presto','Getting\x20job\x20details...','push','submit','\x20jobs','Job\x20type:\x20'];a27_0x1e92=function(){return _0x37af8e;};return a27_0x1e92();}export class JobResultCommand extends BaseCommand{['name']=a27_0x43e345(0x1b7);[a27_0x43e345(0x1d6)]=a27_0x43e345(0x1c7);[a27_0x43e345(0x1ce)](_0x6b857a){const _0x28350d=a27_0x43e345,_0x15eed1=_0x6b857a['args'][0x0];if(!_0x15eed1)return _0x28350d(0x1a8);return undefined;}async[a27_0x43e345(0x1d8)](_0x3df34b){const _0x3b54ac=a27_0x43e345,{options:_0x181fb6,args:_0x14bf6d,tdx:_0xa93758}=_0x3df34b,_0x1fdbbb=_0x14bf6d[0x0],_0x437bc6=await withSpinner(_0x3b54ac(0x1da),()=>_0xa93758['jobs'][_0x3b54ac(0x19e)](_0x1fdbbb),{'verbose':_0x181fb6[_0x3b54ac(0x1c9)]}),_0x541be9=_0x437bc6[_0x3b54ac(0x1d1)];return console[_0x3b54ac(0x1b8)](_0x3b54ac(0x1d0)+_0x541be9['length']+_0x3b54ac(0x18b)+(_0x541be9[_0x3b54ac(0x185)]!==0x1?'s':'')),await handleSDKOutput(_0x541be9,_0x181fb6),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a28_0x8121c3=a28_0x1d56;(function(_0x3e555c,_0xf479a7){const _0x38261c=a28_0x1d56,_0x5542d3=_0x3e555c();while(!![]){try{const _0x43e27d=parseInt(_0x38261c(0x28e))/0x1*(-parseInt(_0x38261c(0x230))/0x2)+parseInt(_0x38261c(0x20e))/0x3+parseInt(_0x38261c(0x276))/0x4*(-parseInt(_0x38261c(0x2b5))/0x5)+parseInt(_0x38261c(0x1e2))/0x6*(-parseInt(_0x38261c(0x289))/0x7)+-parseInt(_0x38261c(0x243))/0x8*(-parseInt(_0x38261c(0x1ea))/0x9)+parseInt(_0x38261c(0x2b4))/0xa*(-parseInt(_0x38261c(0x22b))/0xb)+parseInt(_0x38261c(0x268))/0xc;if(_0x43e27d===_0xf479a7)break;else _0x5542d3['push'](_0x5542d3['shift']());}catch(_0xc4852e){_0x5542d3['push'](_0x5542d3['shift']());}}}(a28_0x1230,0x6e371));import a28_0x302f34 from'chalk';import a28_0x1221b1 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a28_0x1d56(_0x4d69a8,_0xf440ff){_0x4d69a8=_0x4d69a8-0x1c9;const _0x1230f9=a28_0x1230();let _0x1d566b=_0x1230f9[_0x4d69a8];return _0x1d566b;}import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a28_0x1230(){const _0x2f5e54=['reentryMode','size','✔\x20Pulled\x20','\x22\x20resumed','buildIdToEmailMap','43373OwZJgs','No\x20statistics\x20available\x20for\x20journey:\x20','journey:versions','\x20\x20Consolidating\x20duplicate\x20segment:\x20','data','26tZtDag','folders','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','parentSegment','getColumnMapping','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','yellow','Listing\x20journey\x20versions...','stages','resume','renderStats','Parent\x20segment:\x20','journey:version:create','resolveSegment','Error:\x20Journey\x20\x27','table','options','stage','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','887064YjvOCK','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','web','rootFolderId','Resolved\x20YAML\x20file:\x20','goal','exitOrJumpSize','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Invalid\x20--type\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','errorCode','✔\x20Journey\x20\x22','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','bold','filePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','limit','connection','entries','test','createdAt','INVALID_ARGUMENT','journeyBundleId','Resolving\x20version...','cwd','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','relativePath','\x20\x20Parent\x20segment:\x20','journey:pull','version','has','connector_config','base','\x20journey','length','12753600QMVQaD','error','Show\x20journey\x20details','Getting\x20journey\x20details...','from','Error:\x20','dim','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Pausing\x20journey...','(running)','getSegment','completeMilestoneRate','(paused)','\x20=\x20','872uAIlxm','split','journeyStages','hasPeriod','then','\x20files?','replace','description','find','tsv','filter','nodes','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x5c$&','log','\x0aPull\x20summary:','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x20versions)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','14bZHnhk','type','no_parent','cyan','exitOrJumpRate','3061cyshfv','Target\x20directory:\x20','utf-8','\x20\x20Statistics\x20not\x20available','dryRun','pause','history','journey:push','set','journey:traffic','getTrafficData','/j/da/je','Error:\x20Journey\x20not\x20found:\x20','name','journey','(draft)','draft','Input:\x20','audienceId','\x27\x20not\x20found\x20in\x20','Cancelled','parentName','all','site','Error:\x20Stage\x20\x22','rule','updatedAt','toLowerCase','journeyId','\x20not\x20found.\x20Available:\x20','segment','\x20->\x20','journey:stats','List\x20journeys\x20in\x20current\x20context','targetDir','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Folder\x20path:\x20','goalSize','1490IHtXau','15685hwBCLr','\x0aError:','Fetching\x20parent\x20segment...','Database:\x20','blue','file','state','Resolving\x20journey...','Fetching\x20journeys\x20and\x20folders...','links','conversion',',\x20version:\x20','journeyName','join','Fetching\x20','content','\x20unchanged\x20files','format','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20new\x20files','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','message','segments','\x22\x20paused','helpText','completed','resolveJourneyId','segmentPushCommand','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','jsonl','activation','(root)','getJourney','\x20(ID:\x20','/app/ps/','\x0aChanges\x20to\x20\x27','tdx.json','-\x20no\x20files\x20written','🗺️\x20','archived','green','launched','folderPath','segmentName','red','\x20\x20Journey\x20ID:\x20','resourceName','470292YmgdVi','✔\x20Found\x20','args','user','yes','/e/','activation_','\x20version','9aKKRvb','attributes','versionNumber','Write\x20','Getting\x20journey\x20statistics...','Resolving\x20parent\x20segment...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','isNew','repeat','getLatestJourneyId','completionRate','journey:activations','paused','Options:','add','folderId','(archived)','resolveParentId','getStatistics','stageNameMap','get','createVersion','verbose','/j/da','Folder\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','hasChanges','push','milestoneSize','values','Show\x20journey\x20table\x20column\x20mapping','(completed)','map','enteredSize','Aborted.','✔\x20Context\x20set:\x20','2237064OrkMVW','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','json','includeStats','Getting\x20column\x20mapping...','Resume\x20a\x20paused\x20journey','✔\x20All\x20files\x20are\x20up\x20to\x20date','setPhase','execute','journeyBundleName','Error:\x20--version\x20option\x20is\x20required','sort','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','buildIdToNameMap','listVersions','\x20\x20-\x20','Error:\x20Invalid\x20version\x20number:\x20','listActivationsFlat','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Error:\x20Version\x20','localeCompare','journey:pause'];a28_0x1230=function(){return _0x2f5e54;};return a28_0x1230();}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x24f18c){const _0x2ff002=a28_0x1d56;return!_0x24f18c&&(console[_0x2ff002(0x269)](_0x2ff002(0x1cf)),console[_0x2ff002(0x269)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x24f18c;}function withJsonFormat(_0x3faab5){const _0x3628ad=a28_0x1d56;if(!_0x3faab5['format']&&!_0x3faab5[_0x3628ad(0x212)]&&!_0x3faab5[_0x3628ad(0x1d0)]&&!_0x3faab5[_0x3628ad(0x27f)])return{..._0x3faab5,'format':_0x3628ad(0x212),'json':!![]};return _0x3faab5;}function formatJourneyState(_0x5f390a){const _0x58ead8=a28_0x1d56;switch(_0x5f390a){case _0x58ead8(0x1dc):return a28_0x302f34['green'](_0x58ead8(0x271));case _0x58ead8(0x29e):return a28_0x302f34[_0x58ead8(0x26e)](_0x58ead8(0x29d));case'paused':return a28_0x302f34['yellow'](_0x58ead8(0x274));case _0x58ead8(0x1cc):return a28_0x302f34[_0x58ead8(0x2b9)](_0x58ead8(0x209));case _0x58ead8(0x1da):return a28_0x302f34[_0x58ead8(0x26e)](_0x58ead8(0x1fa));default:return'('+_0x5f390a+')';}}function formatJourneyItem(_0xcdb75f,_0x1cf908='',_0x6ddf3a){const _0x7c4e76=a28_0x1d56,_0x53d245=formatJourneyState(_0xcdb75f[_0x7c4e76(0x2bb)]),_0x29a1a2=_0x6ddf3a?hyperlink(_0xcdb75f[_0x7c4e76(0x219)],_0x6ddf3a):_0xcdb75f['journeyBundleName'];return _0x1cf908+_0x7c4e76(0x1d9)+_0x29a1a2+'\x20'+_0x53d245;}function escapeRegex(_0x556749){const _0x385d06=a28_0x1d56;return _0x556749[_0x385d06(0x27c)](/[.*+?^${}()|[\]\\]/g,_0x385d06(0x283));}function globToRegex(_0x2893f3){const _0x47d79b=a28_0x1d56,_0x4e4000=_0x2893f3[_0x47d79b(0x277)]('*')[_0x47d79b(0x20a)](escapeRegex);return new RegExp(_0x4e4000['join']('.*'),'i');}function buildRuleToNameMapping(_0x330fd7){const _0x290747=a28_0x1d56,_0x2aed75=new Map();if(_0x330fd7[_0x290747(0x1c9)])for(const [_0x4374a4,_0x4a66c3]of Object[_0x290747(0x256)](_0x330fd7[_0x290747(0x1c9)])){if(_0x4a66c3[_0x290747(0x2a7)]){const _0x458604=serializeRule(_0x4a66c3['rule']),_0x463ab6=_0x2aed75[_0x290747(0x1fe)](_0x458604);_0x463ab6?_0x463ab6[_0x290747(0x205)](_0x4374a4):_0x2aed75[_0x290747(0x296)](_0x458604,[_0x4374a4]);}}return _0x2aed75;}async function resolveJourneyIdFromInput(_0x435975,_0x275dbb,_0x5615d6){const _0x311703=a28_0x1d56,_0x53963c=await resolveJourneyTarget(_0x435975,_0x275dbb['parentSegment'],_0x275dbb['verbose']),_0x44f85c=_0x53963c[_0x311703(0x233)];if(!_0x44f85c)throw new SDKError(ErrorCode[_0x311703(0x259)],_0x311703(0x2b1));const _0x14436f=await withSpinner(_0x311703(0x1ef),()=>_0x5615d6[_0x311703(0x2ac)][_0x311703(0x1fb)](_0x44f85c),{'verbose':_0x275dbb[_0x311703(0x200)]}),_0x333e26=_0x14436f[_0x311703(0x22f)],_0x20359e=await withSpinner(_0x311703(0x2bc),()=>_0x5615d6[_0x311703(0x29c)][_0x311703(0x1cd)](_0x333e26,_0x53963c[_0x311703(0x2c1)]),{'verbose':_0x275dbb[_0x311703(0x200)]});return{'journeyId':_0x20359e['data'],'journeyName':_0x53963c['journeyName'],'parentSegmentId':_0x333e26};}async function resolveJourneyTarget(_0x3ccccb,_0x182c6d,_0x26ad24){const _0x4992ba=a28_0x1d56;if(isYamlFilePath(_0x3ccccb))try{const _0x4403c0=await resolveYamlFilePath(_0x3ccccb);return _0x26ad24&&(console['error'](_0x4992ba(0x248)+_0x3ccccb),console['error'](_0x4992ba(0x260)+_0x4403c0[_0x4992ba(0x233)]),console['error']('\x20\x20Name:\x20'+_0x4403c0[_0x4992ba(0x1de)]),console[_0x4992ba(0x269)](_0x4992ba(0x2b2)+(_0x4403c0[_0x4992ba(0x1dd)]||_0x4992ba(0x1d2)))),{'journeyName':_0x4403c0[_0x4992ba(0x1de)],'parentSegment':_0x4403c0[_0x4992ba(0x233)],'resolved':_0x4403c0};}catch(_0x15006f){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4992ba(0x235)+_0x15006f[_0x4992ba(0x2ca)]);}if(!_0x182c6d)throw new SDKError(ErrorCode[_0x4992ba(0x259)],_0x4992ba(0x24b));return{'journeyName':_0x3ccccb,'parentSegment':_0x182c6d};}export class JourneyListCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:list';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x2af);async[a28_0x8121c3(0x218)](_0x5745fb){const _0x4d29e0=a28_0x8121c3,{options:_0x1a731f,args:_0x536c7d,tdx:_0x283246}=_0x5745fb,_0x43483c=_0x536c7d[0x0],_0x56bc31=_0x1a731f[_0x4d29e0(0x233)];if(!_0x56bc31)return console[_0x4d29e0(0x269)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x4d29e0(0x269)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x35d1c1=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x283246[_0x4d29e0(0x2ac)][_0x4d29e0(0x1fb)](_0x56bc31),{'verbose':_0x1a731f[_0x4d29e0(0x200)]}),_0x237e52=_0x35d1c1[_0x4d29e0(0x22f)];_0x1a731f[_0x4d29e0(0x200)]&&(console[_0x4d29e0(0x269)](_0x4d29e0(0x23b)+_0x56bc31+_0x4d29e0(0x1d4)+_0x237e52+')'),_0x43483c&&console['error']('Pattern:\x20'+_0x43483c));const _0x4bf15e=await withSpinner(_0x4d29e0(0x2b7),()=>_0x283246[_0x4d29e0(0x2ac)]['getParentFull'](_0x237e52),{'verbose':_0x1a731f[_0x4d29e0(0x200)]}),_0x1a8710=_0x4bf15e[_0x4d29e0(0x22f)],_0x4089f1=_0x1a8710[_0x4d29e0(0x247)],_0x57fd40=await withSpinner('Listing\x20journeys...',()=>_0x283246['journey']['listJourneysWithFolders'](_0x237e52,_0x4089f1),{'verbose':_0x1a731f['verbose']});let _0x3e8814=_0x57fd40[_0x4d29e0(0x22f)]['journeys'];const _0x2f5c96=_0x57fd40[_0x4d29e0(0x22f)][_0x4d29e0(0x231)],_0x74409d=new Map();for(const _0x169549 of _0x2f5c96){_0x74409d[_0x4d29e0(0x296)](_0x169549['id'],_0x169549[_0x4d29e0(0x29b)]);}if(_0x43483c){const _0x326c1e=globToRegex(_0x43483c);_0x3e8814=_0x3e8814['filter'](_0x59fe89=>_0x326c1e[_0x4d29e0(0x257)](_0x59fe89['journeyBundleName']));}console[_0x4d29e0(0x269)](_0x4d29e0(0x1e3)+_0x3e8814[_0x4d29e0(0x267)]+_0x4d29e0(0x266)+(_0x3e8814[_0x4d29e0(0x267)]!==0x1?'s':''));const _0x2451a1=_0x2a942a=>{const _0x477550=_0x4d29e0;return getConsoleNextUrl(_0x1a731f[_0x477550(0x2a5)],'/app/ps/'+_0x237e52+'/e/'+_0x2a942a+_0x477550(0x201));};if(_0x1a731f['format']==='table')await handleSDKOutput(_0x3e8814,_0x1a731f);else{if(_0x1a731f[_0x4d29e0(0x2c6)]===_0x4d29e0(0x212)){const _0x11fda9=_0x3e8814['map'](_0x75fdac=>({..._0x75fdac,'url':_0x2451a1(_0x75fdac['id'])}));await handleSDKOutput(_0x11fda9,_0x1a731f);}else{console[_0x4d29e0(0x284)]('['+_0x56bc31+']');const _0x3c828b=new Map(),_0xfb0209=[];for(const _0x107b13 of _0x3e8814){if(!_0x107b13[_0x4d29e0(0x1f9)]||_0x107b13[_0x4d29e0(0x1f9)]===_0x4089f1)_0xfb0209[_0x4d29e0(0x205)](_0x107b13);else{const _0x328a04=_0x3c828b['get'](_0x107b13[_0x4d29e0(0x1f9)])||[];_0x328a04['push'](_0x107b13),_0x3c828b[_0x4d29e0(0x296)](_0x107b13[_0x4d29e0(0x1f9)],_0x328a04);}}const _0x2cd5e8=(_0x2d2edb,_0x3a8003)=>_0x2d2edb[_0x4d29e0(0x219)][_0x4d29e0(0x224)](_0x3a8003['journeyBundleName'],undefined,{'sensitivity':'base'});_0xfb0209[_0x4d29e0(0x21b)](_0x2cd5e8);for(const _0x1cb3d1 of _0xfb0209){console[_0x4d29e0(0x284)](formatJourneyItem(_0x1cb3d1,'',_0x2451a1(_0x1cb3d1['id'])));}const _0x49c706=[..._0x3c828b[_0x4d29e0(0x256)]()][_0x4d29e0(0x21b)]((_0x3fbd5e,_0x33812c)=>{const _0x9031d4=_0x4d29e0,_0x3ae4b7=_0x74409d[_0x9031d4(0x1fe)](_0x3fbd5e[0x0])||_0x3fbd5e[0x0],_0x350f72=_0x74409d[_0x9031d4(0x1fe)](_0x33812c[0x0])||_0x33812c[0x0];return _0x3ae4b7[_0x9031d4(0x224)](_0x350f72,undefined,{'sensitivity':_0x9031d4(0x265)});});for(const [_0x2fae6f,_0xbd71ad]of _0x49c706){const _0x4079bd=_0x74409d[_0x4d29e0(0x1fe)](_0x2fae6f)||_0x2fae6f;console[_0x4d29e0(0x284)]('📁\x20'+_0x4079bd),_0xbd71ad[_0x4d29e0(0x21b)](_0x2cd5e8);for(const _0x385624 of _0xbd71ad){console[_0x4d29e0(0x284)](formatJourneyItem(_0x385624,'\x20\x20',_0x2451a1(_0x385624['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:view';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x26a);async[a28_0x8121c3(0x218)](_0x468cff){const _0x50198b=a28_0x8121c3,{options:_0x34e725,args:_0x1e818f,tdx:_0x5cc3db}=_0x468cff,_0x42d810=_0x1e818f[0x0];if(!_0x42d810)return console[_0x50198b(0x269)](_0x50198b(0x1cf)),console[_0x50198b(0x269)](_0x50198b(0x26f)),console[_0x50198b(0x269)](_0x50198b(0x1f7)),console[_0x50198b(0x269)](_0x50198b(0x2c9)),0x1;_0x34e725[_0x50198b(0x200)]&&console[_0x50198b(0x269)]('Input:\x20'+_0x42d810);const {journeyId:_0x54a756,parentSegmentId:_0x392c04}=await resolveJourneyIdFromInput(_0x42d810,_0x34e725,_0x5cc3db);if(_0x34e725[_0x50198b(0x246)]){const _0x3f30b3=getConsoleNextUrl(_0x34e725[_0x50198b(0x2a5)],_0x50198b(0x1d5)+_0x392c04+'/e/'+_0x54a756+_0x50198b(0x299));return console['error'](a28_0x302f34['green']('✔')+'\x20Opening\x20'+a28_0x302f34[_0x50198b(0x28c)](_0x3f30b3)),openBrowser(_0x3f30b3),0x0;}const _0x407c76=await withSpinner(_0x50198b(0x26b),()=>_0x5cc3db['journey'][_0x50198b(0x1d3)](_0x54a756),{'verbose':_0x34e725[_0x50198b(0x200)]}),_0x5bcdf1=_0x407c76['data'],_0x456dc7=_0x34e725[_0x50198b(0x213)];let _0x4693e7;if(_0x456dc7)try{const _0x152670=await withSpinner(_0x50198b(0x1ee),()=>_0x5cc3db[_0x50198b(0x29c)]['getStatistics'](_0x54a756),{'verbose':_0x34e725[_0x50198b(0x200)]});_0x4693e7=_0x152670[_0x50198b(0x22f)];}catch{_0x34e725['verbose']&&console[_0x50198b(0x269)](_0x50198b(0x291));}const _0x1f7739=getConsoleNextUrl(_0x34e725[_0x50198b(0x2a5)],_0x50198b(0x1d5)+_0x392c04+_0x50198b(0x1e7)+_0x54a756+_0x50198b(0x299)),_0x47b1a1={'id':_0x5bcdf1['id'],'name':_0x5bcdf1[_0x50198b(0x1eb)]['name'],'description':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x27d)],'state':_0x5bcdf1[_0x50198b(0x1eb)]['state'],'paused':_0x5bcdf1['attributes'][_0x50198b(0x1f6)],'reentry_mode':_0x5bcdf1['attributes'][_0x50198b(0x226)],'stages':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x278)]?.[_0x50198b(0x267)]||0x0,..._0x5bcdf1['attributes'][_0x50198b(0x249)]&&{'goal':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x249)][_0x50198b(0x29b)]},..._0x4693e7&&{'statistics':{'size':_0x4693e7[_0x50198b(0x227)],'entered':_0x4693e7[_0x50198b(0x20b)],'goal_achieved':_0x4693e7[_0x50198b(0x2b3)],'completion_rate':_0x4693e7[_0x50198b(0x1f4)],'exit_or_jump':_0x4693e7[_0x50198b(0x24a)],'exit_or_jump_rate':_0x4693e7[_0x50198b(0x28d)],'stages':_0x4693e7['stages']}},'url':_0x1f7739};return await handleSingleObjectOutput(_0x47b1a1,_0x34e725),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x2ae);[a28_0x8121c3(0x27d)]='Show\x20journey\x20statistics';async[a28_0x8121c3(0x218)](_0x184ad0){const _0xf3c551=a28_0x8121c3,{options:_0x125f12,args:_0x34ba27,tdx:_0x1eb1b1}=_0x184ad0,_0x152015=_0x34ba27[0x0];if(!requireNameOrPath(_0x152015))return 0x1;_0x125f12[_0xf3c551(0x200)]&&console[_0xf3c551(0x269)](_0xf3c551(0x29f)+_0x152015);const _0x3001a0=_0x125f12,_0x3611f1=_0x3001a0[_0xf3c551(0x26c)],_0x4c225d=_0x3001a0['to'],_0x5e7d27=_0x3001a0['includeHistory'],_0x3e97cb=_0x3001a0[_0xf3c551(0x241)];_0x5e7d27&&!_0x3611f1&&!_0x4c225d&&console[_0xf3c551(0x269)](_0xf3c551(0x250));const _0x5ed05d=_0x5e7d27?withJsonFormat(_0x125f12):_0x125f12,{journeyId:_0x524f0f,journeyName:_0x502a10}=await resolveJourneyIdFromInput(_0x152015,_0x5ed05d,_0x1eb1b1),_0x1b489a=_0x3611f1||_0x4c225d?{'from':_0x3611f1,'to':_0x4c225d}:undefined,_0x3d1aba=await withSpinner(_0xf3c551(0x1ee),()=>Promise[_0xf3c551(0x2a4)]([_0x1eb1b1[_0xf3c551(0x29c)][_0xf3c551(0x1d3)](_0x524f0f),_0x1eb1b1[_0xf3c551(0x29c)][_0xf3c551(0x1fc)](_0x524f0f,_0x1b489a)]),{'verbose':_0x5ed05d['verbose']}),[_0x491e70,_0x2f042f]=_0x3d1aba[_0xf3c551(0x22f)];if(!_0x2f042f||_0x2f042f[_0xf3c551(0x2aa)]===null)return console[_0xf3c551(0x269)](_0xf3c551(0x22c)+_0x502a10),console[_0xf3c551(0x269)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x26c006=buildStageNameMap(_0x491e70),_0x45f132=!!(_0x1b489a&&_0x2f042f[_0xf3c551(0x294)]?.[_0xf3c551(0x267)]),_0x8c6b9a={'stageNameMap':_0x26c006,'hasPeriod':_0x45f132,'includeHistory':!!_0x5e7d27};if(_0x3e97cb&&_0x2f042f[_0xf3c551(0x238)]){const _0x1a9bd3=_0x2f042f[_0xf3c551(0x238)][_0xf3c551(0x27e)](_0x453b5d=>{const _0xc9bfe3=_0xf3c551,_0x528656=_0x26c006[_0xc9bfe3(0x1fe)](_0x453b5d['id'])??'';return _0x528656['toLowerCase']()===_0x3e97cb[_0xc9bfe3(0x2a9)]();});if(_0x1a9bd3)return await handleSingleObjectOutput(formatStageStats(_0x1a9bd3,_0x8c6b9a),_0x5ed05d),0x0;const _0x260739=_0x2f042f[_0xf3c551(0x238)][_0xf3c551(0x20a)](_0x2e50d4=>_0x26c006['get'](_0x2e50d4['id'])??_0x2e50d4['id']);return console[_0xf3c551(0x269)](_0xf3c551(0x2a6)+_0x3e97cb+'\x22\x20not\x20found'),console[_0xf3c551(0x269)]('Available\x20stages:\x20'+_0x260739[_0xf3c551(0x2c2)](',\x20')),0x1;}const _0x3aab88=_0x2f042f['stages']?.[_0xf3c551(0x20a)](_0x35ae59=>formatStageStats(_0x35ae59,_0x8c6b9a)),_0x38966c=assembleJourneyStats(_0x2f042f,{'from':_0x3611f1,'to':_0x4c225d,'includeHistory':_0x5e7d27});return await this[_0xf3c551(0x23a)](_0x38966c,_0x3aab88??[],_0x5ed05d),0x0;}async[a28_0x8121c3(0x23a)](_0x36348a,_0x59c1c5,_0x2050c8){const _0x1494a5=a28_0x8121c3,_0x4bd49c=_0x2050c8['format']==='json'||_0x2050c8[_0x1494a5(0x2c6)]===_0x1494a5(0x1d0)||_0x2050c8['json']||_0x2050c8[_0x1494a5(0x1d0)];if(_0x4bd49c){_0x36348a[_0x1494a5(0x238)]=_0x59c1c5,await handleSingleObjectOutput(_0x36348a,_0x2050c8);return;}await handleSingleObjectOutput(_0x36348a,_0x2050c8);for(const _0x5ef6d0 of _0x59c1c5){console[_0x1494a5(0x284)](''),console[_0x1494a5(0x284)](String(a28_0x302f34[_0x1494a5(0x28c)][_0x1494a5(0x251)]('['+_0x5ef6d0[_0x1494a5(0x29b)]+']'))+a28_0x302f34[_0x1494a5(0x26e)]('\x20'+_0x5ef6d0['id']));const {id:_0x5e3082,name:_0x191461,..._0x50f1da}=_0x5ef6d0;await handleSingleObjectOutput(_0x50f1da,_0x2050c8);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x297);[a28_0x8121c3(0x27d)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x8121c3(0x218)](_0x5129bd){const _0x55f6d9=a28_0x8121c3,{options:_0x5b48dc,args:_0x20db8e,tdx:_0x33dac8}=_0x5129bd,_0x3e8454=_0x20db8e[0x0];if(!requireNameOrPath(_0x3e8454))return 0x1;_0x5b48dc[_0x55f6d9(0x200)]&&console[_0x55f6d9(0x269)]('Input:\x20'+_0x3e8454);const _0x3973e9=_0x5b48dc,_0xc60782=_0x3973e9[_0x55f6d9(0x28a)],_0x4ce6d7=_0x3973e9[_0x55f6d9(0x26c)],_0xa711e6=_0x3973e9['to'],_0x20421f=_0x3973e9[_0x55f6d9(0x254)];if(_0xc60782&&_0xc60782!==_0x55f6d9(0x2bf)&&_0xc60782!=='activation')return console['error'](_0x55f6d9(0x24c)+_0xc60782+_0x55f6d9(0x222)),0x1;const _0xdf27a=withJsonFormat(_0x5b48dc),{journeyId:_0x49a1d5,journeyName:_0x4e1edd}=await resolveJourneyIdFromInput(_0x3e8454,_0xdf27a,_0x33dac8),_0x40e753={'type':_0xc60782,'from':_0x4ce6d7,'to':_0xa711e6,'limit':_0x20421f},_0x37ba18=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x33dac8[_0x55f6d9(0x29c)][_0x55f6d9(0x298)](_0x49a1d5,_0x40e753),{'verbose':_0xdf27a[_0x55f6d9(0x200)]}),_0x311cf4=_0x37ba18[_0x55f6d9(0x22f)],_0x2af6a7=_0x311cf4[_0x55f6d9(0x2bf)]&&(_0x311cf4[_0x55f6d9(0x2bf)][_0x55f6d9(0x281)][_0x55f6d9(0x267)]>0x0||_0x311cf4['conversion'][_0x55f6d9(0x2be)][_0x55f6d9(0x267)]>0x0),_0x53ebb2=_0x311cf4['activation']&&_0x311cf4[_0x55f6d9(0x1d1)][_0x55f6d9(0x267)]>0x0;if(!_0x2af6a7&&!_0x53ebb2)return console['error'](_0x55f6d9(0x244)+_0x4e1edd),console[_0x55f6d9(0x269)](_0x55f6d9(0x2c7)),_0x4ce6d7&&_0xa711e6&&console[_0x55f6d9(0x269)](_0x55f6d9(0x1f0)),0x0;return await handleSingleObjectOutput(_0x311cf4,_0xdf27a),0x0;}}function formatStageStats(_0x405f82,_0x3a6908){const _0x5a3919=a28_0x8121c3,_0x6befed=_0x3a6908[_0x5a3919(0x279)]&&_0x405f82[_0x5a3919(0x294)]?.[_0x5a3919(0x267)]?aggregateStageHistory(_0x405f82[_0x5a3919(0x294)]):{'size':_0x405f82[_0x5a3919(0x227)],'entered':_0x405f82[_0x5a3919(0x20b)],'milestone':_0x405f82[_0x5a3919(0x206)],'milestone_rate':_0x405f82[_0x5a3919(0x273)],'exit_or_jump':_0x405f82[_0x5a3919(0x24a)],'exit_or_jump_rate':_0x405f82[_0x5a3919(0x28d)]},_0xdcec5c={'id':_0x405f82['id'],'name':_0x3a6908[_0x5a3919(0x1fd)]['get'](_0x405f82['id'])??_0x405f82['id'],..._0x6befed};return _0x3a6908[_0x5a3919(0x279)]&&_0x3a6908['includeHistory']&&_0x405f82['history']&&(_0xdcec5c['history']=_0x405f82['history']),_0xdcec5c;}export class JourneyPauseCommand extends BaseCommand{['name']=a28_0x8121c3(0x225);[a28_0x8121c3(0x27d)]='Pause\x20a\x20running\x20journey';async['execute'](_0x464b39){const _0x143dbb=a28_0x8121c3,{options:_0x2f217e,args:_0x5df915,tdx:_0x591f85}=_0x464b39,_0x36342b=_0x5df915[0x0];if(!requireNameOrPath(_0x36342b))return 0x1;_0x2f217e[_0x143dbb(0x200)]&&console[_0x143dbb(0x269)](_0x143dbb(0x29f)+_0x36342b);const {journeyId:_0x2fb911,journeyName:_0x57438e}=await resolveJourneyIdFromInput(_0x36342b,_0x2f217e,_0x591f85);if(!_0x2f217e[_0x143dbb(0x1e6)]){const _0x3cadce=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x57438e+'\x22?');if(!_0x3cadce)return console['error']('Cancelled'),0x0;}const _0x2701ee=await withSpinner(_0x143dbb(0x270),()=>_0x591f85[_0x143dbb(0x29c)][_0x143dbb(0x293)](_0x2fb911),{'verbose':_0x2f217e[_0x143dbb(0x200)]}),_0x1a7872=_0x2701ee[_0x143dbb(0x22f)];return console['error'](_0x143dbb(0x24f)+_0x1a7872[_0x143dbb(0x1eb)][_0x143dbb(0x29b)]+_0x143dbb(0x1ca)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:resume';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x215);async[a28_0x8121c3(0x218)](_0x472298){const _0x7f3887=a28_0x8121c3,{options:_0x6328a6,args:_0x2f7abe,tdx:_0x1c836d}=_0x472298,_0x3085d4=_0x2f7abe[0x0];if(!requireNameOrPath(_0x3085d4))return 0x1;_0x6328a6[_0x7f3887(0x200)]&&console[_0x7f3887(0x269)](_0x7f3887(0x29f)+_0x3085d4);const {journeyId:_0x43f7db,journeyName:_0x18abe3}=await resolveJourneyIdFromInput(_0x3085d4,_0x6328a6,_0x1c836d);if(!_0x6328a6[_0x7f3887(0x1e6)]){const _0x817a37=await confirm(_0x7f3887(0x286)+_0x18abe3+'\x22?');if(!_0x817a37)return console[_0x7f3887(0x269)](_0x7f3887(0x2a2)),0x0;}const _0x375f2f=await withSpinner('Resuming\x20journey...',()=>_0x1c836d[_0x7f3887(0x29c)][_0x7f3887(0x239)](_0x43f7db),{'verbose':_0x6328a6[_0x7f3887(0x200)]}),_0x53e536=_0x375f2f[_0x7f3887(0x22f)];return console['error'](_0x7f3887(0x24f)+_0x53e536[_0x7f3887(0x1eb)]['name']+_0x7f3887(0x229)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x261);[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x203);async['execute'](_0x3aa9c2){const _0x16baf0=a28_0x8121c3,{options:_0x22f106,args:_0x4275eb,tdx:_0x1c6ff0}=_0x3aa9c2,_0x174d81=_0x22f106,_0x2cb844=_0x4275eb[0x0],_0x3c129e=_0x2cb844&&isYamlFilePath(_0x2cb844),_0xb69cb8=await resolveTarget({'arg':_0x3c129e?_0x2cb844:undefined,'contextParent':_0x22f106['parentSegment'],'cwd':process[_0x16baf0(0x25c)]()});if(!isSuccessfulResolution(_0xb69cb8))return _0xb69cb8[_0x16baf0(0x24e)]===_0x16baf0(0x28b)?(console['error'](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x20f))),console[_0x16baf0(0x269)]('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[_0x16baf0(0x269)](_0x16baf0(0x288)),console['error'](_0x16baf0(0x25e)),console[_0x16baf0(0x269)](_0x16baf0(0x210))):(console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1df)](_0x16baf0(0x26d)+_0xb69cb8[_0x16baf0(0x2ca)]+'\x0a')),_0xb69cb8['helpText']&&console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x28c)](_0xb69cb8[_0x16baf0(0x1cb)]))),0x1;let _0x102905=_0x3c129e?undefined:_0x2cb844,_0x42ab65,_0x4e88c4;_0xb69cb8[_0x16baf0(0x28a)]===_0x16baf0(0x2ba)&&(_0x102905=_0xb69cb8[_0x16baf0(0x1e1)],_0x42ab65=_0xb69cb8[_0x16baf0(0x252)],_0x4e88c4=_0xb69cb8[_0x16baf0(0x1dd)]);const _0x15c4ad=_0xb69cb8[_0x16baf0(0x2a3)],_0x5cad98=_0xb69cb8[_0x16baf0(0x2b0)];_0x174d81[_0x16baf0(0x200)]&&(console[_0x16baf0(0x269)]('Parent\x20segment:\x20'+_0x15c4ad),console['error'](_0x16baf0(0x28f)+_0x5cad98),_0x102905&&console[_0x16baf0(0x269)]('Journey\x20name:\x20'+_0x102905),_0x42ab65&&console['error']('Target\x20file:\x20'+_0x42ab65),_0x4e88c4&&console['error'](_0x16baf0(0x202)+_0x4e88c4));const _0x14a0d3=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x1c6ff0[_0x16baf0(0x2ac)][_0x16baf0(0x1fb)](_0x15c4ad),{'verbose':_0x22f106[_0x16baf0(0x200)]}),_0xd2addd=_0x14a0d3[_0x16baf0(0x22f)],{journeys:_0xe27630,folders:_0x48e964}=await withSpinner(_0x16baf0(0x2bd),async()=>{const _0x2c7608=_0x16baf0,[_0x3d62c5,_0x42f65f]=await Promise[_0x2c7608(0x2a4)]([_0x1c6ff0[_0x2c7608(0x29c)]['listJourneysFromParentSegment'](_0xd2addd,undefined,{'includeAllVersions':!![]}),_0x1c6ff0[_0x2c7608(0x2ac)]['listFolders'](_0xd2addd)]);return{'journeys':_0x3d62c5,'folders':_0x42f65f};},{'verbose':_0x22f106[_0x16baf0(0x200)]})[_0x16baf0(0x27a)](_0x491af3=>_0x491af3[_0x16baf0(0x22f)]);let _0x28a983=_0xe27630;const _0x5a6313=buildFolderIdToPathMap(_0x48e964);if(_0x102905){const _0x338960=_0x28a983[_0x16baf0(0x280)](_0x4b5012=>_0x4b5012[_0x16baf0(0x219)][_0x16baf0(0x2a9)]()===_0x102905[_0x16baf0(0x2a9)]());if(_0x338960['length']===0x0)return console[_0x16baf0(0x269)](_0x16baf0(0x29a)+_0x102905),console[_0x16baf0(0x269)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x28a983=_0x338960;}if(_0x4e88c4!==undefined){const _0x2d812a=_0x28a983[_0x16baf0(0x280)](_0x358145=>{const _0x2ed7b7=_0x16baf0,_0x4b6149=_0x358145[_0x2ed7b7(0x1f9)]?_0x5a6313[_0x2ed7b7(0x1fe)](_0x358145['folderId'])||'':'';return _0x4b6149===_0x4e88c4;});if(_0x2d812a[_0x16baf0(0x267)]===0x0&&_0x28a983[_0x16baf0(0x267)]>0x0){console[_0x16baf0(0x269)](_0x16baf0(0x23e)+_0x102905+_0x16baf0(0x2a1)+(_0x4e88c4||'root\x20folder')),console['error'](_0x16baf0(0x245));for(const _0x2fdf29 of _0x28a983){const _0x2ebe1b=_0x2fdf29[_0x16baf0(0x1f9)]?_0x5a6313[_0x16baf0(0x1fe)](_0x2fdf29['folderId'])||'':'';console['error'](_0x16baf0(0x21f)+(_0x2ebe1b||_0x16baf0(0x1d2))+'/'+_0x2fdf29[_0x16baf0(0x219)]);}return 0x1;}_0x28a983=_0x2d812a;}if(_0x28a983[_0x16baf0(0x267)]===0x0)return console[_0x16baf0(0x269)]('No\x20journeys\x20found'),0x0;const _0x2c2c15=new Map();for(const _0x409348 of _0x28a983){const _0x29c7a6=_0x409348[_0x16baf0(0x25a)];!_0x2c2c15[_0x16baf0(0x263)](_0x29c7a6)&&_0x2c2c15[_0x16baf0(0x296)](_0x29c7a6,[]),_0x2c2c15[_0x16baf0(0x1fe)](_0x29c7a6)[_0x16baf0(0x205)](_0x409348);}for(const _0x31f10a of _0x2c2c15[_0x16baf0(0x207)]()){_0x31f10a[_0x16baf0(0x21b)]((_0x3e7339,_0x304884)=>(_0x3e7339[_0x16baf0(0x1ec)]||0x0)-(_0x304884['versionNumber']||0x0));}const _0x4b89a9=[],{idToEmailMap:_0xedb31b,connectionIdToNameMap:_0x505950}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0xdc2be3=_0x16baf0,[_0x3f7368,_0x5477aa]=await Promise[_0xdc2be3(0x2a4)]([_0x1c6ff0[_0xdc2be3(0x1e5)][_0xdc2be3(0x22a)](),_0x1c6ff0[_0xdc2be3(0x255)][_0xdc2be3(0x21d)]()]);return{'idToEmailMap':_0x3f7368,'connectionIdToNameMap':_0x5477aa};},{'verbose':_0x22f106[_0x16baf0(0x200)]})[_0x16baf0(0x27a)](_0x3f5159=>_0x3f5159['data']);for(const _0x20ac2e of _0x2c2c15[_0x16baf0(0x207)]()){const _0x41b9ba=_0x20ac2e[0x0][_0x16baf0(0x219)],_0x53c17a=_0x20ac2e[0x0]['folderId'],_0x25524a=_0x53c17a?_0x5a6313[_0x16baf0(0x1fe)](_0x53c17a)||'':'',_0x260ce8=_0x25524a?a28_0x1221b1[_0x16baf0(0x2c2)](_0x5cad98,_0x25524a):_0x5cad98,_0x1a16f3=_0x42ab65||a28_0x1221b1[_0x16baf0(0x2c2)](_0x260ce8,sanitizeFileName(_0x41b9ba)+'.yml');let _0x42729c,_0x531252;if(existsSync(_0x1a16f3))try{const _0x39530b=readFileSync(_0x1a16f3,_0x16baf0(0x290)),_0x25d8a4=parseYamlString(_0x39530b);_0x531252=_0x25d8a4,_0x42729c=buildRuleToNameMapping(_0x25d8a4),_0x174d81['verbose']&&_0x42729c['size']>0x0&&console[_0x16baf0(0x269)]('Found\x20'+_0x42729c[_0x16baf0(0x227)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x41b9ba);}catch(_0x28feb1){_0x174d81[_0x16baf0(0x200)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x28feb1[_0x16baf0(0x2ca)]);}const _0x11e0ec=[],_0x5036b0=new Set(),_0x5d7089=new Map(),_0x2c0f2a=new Map(),_0x1f554a=new Set(),_0x4a91e6=new Map(),_0x1b484c=new Map(),_0x5be43f=createJumpTargetCache();await withProgressSpinner(_0x16baf0(0x2c3)+_0x41b9ba+'...',async _0x542e12=>{const _0x28f0c3=_0x16baf0;for(const _0x26dc6e of _0x20ac2e){const _0x42c7df=_0x20ac2e['length']>0x1?_0x26dc6e[_0x28f0c3(0x219)]+'\x20v'+(_0x26dc6e[_0x28f0c3(0x1ec)]||0x1):_0x26dc6e['journeyBundleName'];_0x542e12[_0x28f0c3(0x217)]('Fetching\x20'+_0x42c7df);const _0x50ff9a=await _0x1c6ff0[_0x28f0c3(0x29c)][_0x28f0c3(0x1d3)](_0x26dc6e['id']),_0x4f3f47=_0x50ff9a[_0x28f0c3(0x1eb)]?.[_0x28f0c3(0x2a0)],_0xce222a={'resolveSegment':async _0x19dfbd=>{const _0x44777a=_0x28f0c3;if(!_0x4f3f47)return{'name':_0x19dfbd,'isJourneyLocal':![]};const _0x4b932b=_0x5d7089['get'](_0x19dfbd);if(_0x4b932b)return _0x4b932b;try{const _0x38e7dc=await _0x1c6ff0['segment'][_0x44777a(0x272)](_0x4f3f47,_0x19dfbd),_0x4a9b55=_0x38e7dc['kind']===SEGMENT_KIND_JOURNEY;let _0x5606ab,_0x179655=_0x38e7dc[_0x44777a(0x29b)];if(_0x4a9b55&&_0x38e7dc['rule']){const _0x45ef98=await segmentResponseToDef(_0x38e7dc,{'resolveSegmentName':async _0x5643d0=>{const _0x5cf244=_0x44777a,_0xe3f62d=_0x5d7089[_0x5cf244(0x1fe)](_0x5643d0);if(_0xe3f62d)return _0xe3f62d[_0x5cf244(0x29b)];const _0x18be7b=await _0xce222a[_0x5cf244(0x23d)](_0x5643d0);return _0x18be7b[_0x5cf244(0x29b)];}}),_0x119b38=_0x45ef98['rule'];_0x5606ab={'description':_0x38e7dc['description'],'rule':_0x119b38};const _0x4c2e9=serializeRule(_0x119b38),_0x475dda=_0x2c0f2a['get'](_0x4c2e9);if(_0x475dda)_0x179655=_0x475dda,_0x5606ab=undefined,_0x174d81[_0x44777a(0x200)]&&console[_0x44777a(0x269)](_0x44777a(0x22e)+_0x38e7dc[_0x44777a(0x29b)]+_0x44777a(0x2ad)+_0x475dda);else{let _0x3f79b4=![];if(_0x42729c){const _0x1bef58=_0x42729c[_0x44777a(0x1fe)](_0x4c2e9);if(_0x1bef58){const _0x2422c3=_0x1bef58[_0x44777a(0x27e)](_0x5b5125=>!_0x5036b0[_0x44777a(0x263)](_0x5b5125));_0x2422c3&&(_0x179655=_0x2422c3,_0x5036b0[_0x44777a(0x1f8)](_0x2422c3),_0x2c0f2a[_0x44777a(0x296)](_0x4c2e9,_0x2422c3),_0x3f79b4=!![],_0x174d81[_0x44777a(0x200)]&&console[_0x44777a(0x269)](_0x44777a(0x24d)+_0x2422c3+'\x20(rule\x20match)'));}}if(!_0x3f79b4){const _0x309c87=generateJourneyLocalName(_0x38e7dc[_0x44777a(0x29b)]);_0x309c87&&(_0x179655=_0x309c87);let _0x1c7194=_0x179655,_0x4964e7=0x2;while(_0x5036b0[_0x44777a(0x263)](_0x1c7194)){_0x1c7194=_0x179655+'_'+_0x4964e7,_0x4964e7++;}_0x5036b0[_0x44777a(0x1f8)](_0x1c7194),_0x2c0f2a['set'](_0x4c2e9,_0x1c7194),_0x179655=_0x1c7194;}}}const _0x1da7e0={'name':_0x179655,'isJourneyLocal':_0x4a9b55,'definition':_0x5606ab};return _0x5d7089['set'](_0x19dfbd,_0x1da7e0),_0x1da7e0;}catch(_0x1985f9){return _0x22f106['verbose']&&console[_0x44777a(0x269)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x19dfbd+':\x20'+_0x1985f9[_0x44777a(0x2ca)]),{'name':_0x19dfbd,'isJourneyLocal':![]};}},'resolveActivation':async _0x1dd663=>{const _0x10941d=_0x28f0c3,_0x5996fb=_0x4a91e6[_0x10941d(0x1fe)](_0x1dd663);if(_0x5996fb)return _0x5996fb;try{const _0x31a54d=await _0x1c6ff0['journey']['getActivation'](_0x26dc6e['id'],_0x1dd663),_0x322cda=journeyActivationStepToYaml(_0x31a54d,_0xedb31b,_0x505950),_0x45c858=JSON['stringify']({'name':_0x322cda[_0x10941d(0x29b)],'connection':_0x322cda[_0x10941d(0x255)],'connector_config':_0x322cda[_0x10941d(0x264)]}),_0x59c80f=_0x1b484c['get'](_0x45c858);if(_0x59c80f){const _0x33bf96={'name':_0x59c80f,'isJourneyLocal':!![],'definition':_0x322cda};return _0x4a91e6[_0x10941d(0x296)](_0x1dd663,_0x33bf96),_0x33bf96;}const _0x2243be=_0x31a54d[_0x10941d(0x1eb)]['activationParams'][_0x10941d(0x29b)]||_0x1dd663,_0x5ec699=sanitizeYamlKey(_0x2243be)||_0x10941d(0x1e8)+_0x1dd663;let _0x53761c=_0x5ec699,_0x1da8fa=0x2;while(_0x1f554a[_0x10941d(0x263)](_0x53761c)){_0x53761c=_0x5ec699+'_'+_0x1da8fa,_0x1da8fa++;}_0x1f554a[_0x10941d(0x1f8)](_0x53761c),_0x1b484c[_0x10941d(0x296)](_0x45c858,_0x53761c);const _0x216877={'name':_0x53761c,'isJourneyLocal':!![],'definition':_0x322cda};return _0x4a91e6[_0x10941d(0x296)](_0x1dd663,_0x216877),_0x216877;}catch(_0x1d54db){return _0x22f106['verbose']&&console[_0x10941d(0x269)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x1dd663+':\x20'+_0x1d54db[_0x10941d(0x2ca)]),{'name':_0x1dd663,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5c9482,_0x2ac975)=>{const _0x58f23a=_0x28f0c3;return resolveJumpTarget(_0x5c9482,_0x2ac975,_0x5be43f,_0x5d6b6d=>_0x1c6ff0[_0x58f23a(0x29c)][_0x58f23a(0x1d3)](_0x5d6b6d));}},_0x429618=await journeyResponseToDef(_0x50ff9a,_0xce222a);_0x11e0ec[_0x28f0c3(0x205)]({'item':_0x26dc6e,'yaml':_0x429618});}},{'verbose':_0x22f106['verbose']});const _0x5f34e0=await _0x1c6ff0[_0x16baf0(0x29c)][_0x16baf0(0x1f3)](_0x20ac2e[0x0]['journeyBundleId']),_0x71bcf1=buildMergedJourneyDef(_0x11e0ec,_0x42729c,_0x5f34e0),_0x162efb=normalizeJourneyDef(_0x71bcf1,_0x531252),_0x5c4fe2=toYamlString(_0x162efb),_0x3a796d=_0x42ab65||a28_0x1221b1[_0x16baf0(0x2c2)](_0x260ce8,sanitizeFileName(_0x41b9ba)+'.yml');!_0x42ab65&&_0x25524a&&!existsSync(_0x260ce8)&&mkdirSync(_0x260ce8,{'recursive':!![]});const _0x4f7883=a28_0x1221b1['relative'](process[_0x16baf0(0x25c)](),_0x3a796d);if(existsSync(_0x3a796d)){const _0x2655fe=readFileSync(_0x3a796d,_0x16baf0(0x290)),_0x219c30=generateDiff(_0x2655fe,_0x5c4fe2),_0x2b3631=hasChanges(_0x219c30);_0x4b89a9['push']({'relativePath':_0x4f7883,'absolutePath':_0x3a796d,'content':_0x5c4fe2,'isNew':![],'hasChanges':_0x2b3631,'diff':_0x2b3631?formatDiffWithColors(_0x219c30):undefined});}else _0x4b89a9[_0x16baf0(0x205)]({'relativePath':_0x4f7883,'absolutePath':_0x3a796d,'content':_0x5c4fe2,'isNew':!![],'hasChanges':![]});}const _0xb57cf9=_0x4b89a9[_0x16baf0(0x280)](_0x147301=>_0x147301['isNew']),_0x5d4e70=_0x4b89a9[_0x16baf0(0x280)](_0x1fd168=>!_0x1fd168[_0x16baf0(0x1f1)]&&_0x1fd168['hasChanges']),_0x518b5f=_0x4b89a9[_0x16baf0(0x280)](_0x4b42cf=>!_0x4b42cf[_0x16baf0(0x1f1)]&&!_0x4b42cf[_0x16baf0(0x204)]),_0x578ffd=_0x28a983[_0x16baf0(0x267)],_0x3133b1=_0x2c2c15[_0x16baf0(0x227)],_0x1b2478=_0x578ffd>_0x3133b1?'\x20('+_0x578ffd+_0x16baf0(0x287):'';console[_0x16baf0(0x269)](_0x16baf0(0x285)),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34['cyan'](_0x3133b1+'\x20journeys')+a28_0x302f34[_0x16baf0(0x26e)](_0x1b2478)),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x1db)]('+\x20'+_0xb57cf9['length']+_0x16baf0(0x2c8))),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x236)]('~\x20'+_0x5d4e70[_0x16baf0(0x267)]+'\x20changed\x20files')),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x26e)]('=\x20'+_0x518b5f[_0x16baf0(0x267)]+_0x16baf0(0x2c5))),console[_0x16baf0(0x269)]('\x20\x20Target:\x20'+a28_0x302f34[_0x16baf0(0x28c)](_0x5cad98)+'\x0a');if(_0x5d4e70[_0x16baf0(0x267)]>0x0)for(const _0x27579a of _0x5d4e70){console['error'](_0x16baf0(0x1d6)+_0x27579a[_0x16baf0(0x25f)]+'\x27:'),console[_0x16baf0(0x269)]('─'[_0x16baf0(0x1f2)](0x3c)),console[_0x16baf0(0x269)](_0x27579a['diff']),console[_0x16baf0(0x269)]('─'[_0x16baf0(0x1f2)](0x3c));}if(_0x174d81[_0x16baf0(0x292)])return console['error'](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x253))),0x0;if(_0xb57cf9['length']===0x0&&_0x5d4e70['length']===0x0)return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x216))),saveSessionContext({'parent_segment':_0x15c4ad},_0x174d81['session']),console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x20d)+a28_0x302f34[_0x16baf0(0x26e)](_0x16baf0(0x25d))+_0x16baf0(0x275)+a28_0x302f34[_0x16baf0(0x28c)](_0x15c4ad))),0x0;if(!_0x174d81[_0x16baf0(0x1e6)]&&(_0xb57cf9['length']>0x0||_0x5d4e70[_0x16baf0(0x267)]>0x0)){if(!isInteractive())return console['error'](a28_0x302f34[_0x16baf0(0x1df)](_0x16baf0(0x2b6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a28_0x302f34[_0x16baf0(0x26e)](_0x16baf0(0x211))),0x1;const _0x430957=await confirmKey(_0x16baf0(0x1ed)+(_0xb57cf9[_0x16baf0(0x267)]+_0x5d4e70[_0x16baf0(0x267)])+_0x16baf0(0x27b));if(!_0x430957)return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x20c)),_0x16baf0(0x1d8)),0x1;}!existsSync(_0x5cad98)&&mkdirSync(_0x5cad98,{'recursive':!![]});const _0x10135d=a28_0x1221b1[_0x16baf0(0x2c2)](_0x5cad98,_0x16baf0(0x1d7));writeFileSync(_0x10135d,createTdxConfigContent(_0x15c4ad),_0x16baf0(0x290));for(const _0x24d906 of _0x4b89a9){(_0x24d906[_0x16baf0(0x1f1)]||_0x24d906[_0x16baf0(0x204)])&&writeFileSync(_0x24d906['absolutePath'],_0x24d906[_0x16baf0(0x2c4)],'utf-8');}return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x228)+(_0xb57cf9[_0x16baf0(0x267)]+_0x5d4e70[_0x16baf0(0x267)])+'\x20journey\x20files\x20to\x20'+_0x5cad98)),saveSessionContext({'parent_segment':_0x15c4ad},_0x174d81['session']),console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)]('✔\x20Context\x20set:\x20'+a28_0x302f34['dim'](_0x16baf0(0x25d))+_0x16baf0(0x275)+a28_0x302f34[_0x16baf0(0x28c)](_0x15c4ad))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:columns';['description']=a28_0x8121c3(0x208);async['execute'](_0x3a4598){const _0x2ea626=a28_0x8121c3,{options:_0x105fce,args:_0x8cd976,tdx:_0x17a7d5}=_0x3a4598,_0x18fbbc=_0x8cd976[0x0];if(!requireNameOrPath(_0x18fbbc))return 0x1;_0x105fce[_0x2ea626(0x200)]&&console['error'](_0x2ea626(0x29f)+_0x18fbbc);const {journeyId:_0x5b5ed0}=await resolveJourneyIdFromInput(_0x18fbbc,_0x105fce,_0x17a7d5),_0x2caf00=await withSpinner(_0x2ea626(0x214),()=>_0x17a7d5[_0x2ea626(0x29c)][_0x2ea626(0x234)](_0x5b5ed0),{'verbose':_0x105fce['verbose']}),_0xe1741d=_0x2caf00['data'];return console[_0x2ea626(0x284)](_0x2ea626(0x2b8)+_0xe1741d['database']),console[_0x2ea626(0x284)]('Table:\x20'+_0xe1741d[_0x2ea626(0x23f)]),await handleSDKOutput(_0xe1741d['columns'],_0x105fce),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x1f5);['description']='List\x20activations\x20for\x20a\x20journey';async['execute'](_0xc0b104){const _0xef6335=a28_0x8121c3,{options:_0x70b25a,args:_0x177bcd,tdx:_0x31e188}=_0xc0b104,_0x4c3455=_0x177bcd[0x0];if(!requireNameOrPath(_0x4c3455))return 0x1;_0x70b25a[_0xef6335(0x200)]&&console[_0xef6335(0x269)](_0xef6335(0x29f)+_0x4c3455);const {journeyId:_0x251ce2}=await resolveJourneyIdFromInput(_0x4c3455,_0x70b25a,_0x31e188),_0x5147fc=await withSpinner('Listing\x20journey\x20activations...',()=>_0x31e188[_0xef6335(0x29c)][_0xef6335(0x221)](_0x251ce2),{'verbose':_0x70b25a[_0xef6335(0x200)]}),_0x49b36d=_0x5147fc[_0xef6335(0x22f)];return console[_0xef6335(0x269)]('Found\x20'+_0x49b36d[_0xef6335(0x267)]+'\x20activation'+(_0x49b36d[_0xef6335(0x267)]!==0x1?'s':'')),await handleSDKOutput(_0x49b36d,_0x70b25a),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x295);['description']=a28_0x8121c3(0x21c);[a28_0x8121c3(0x1ce)]=new SegmentPushCommand();async[a28_0x8121c3(0x218)](_0x184fed){const _0x5970bb=a28_0x8121c3,_0x55ebee=_0x184fed[_0x5970bb(0x1e4)][0x0];let _0x16ddc6;if(_0x55ebee){const _0x4e2afb=await resolveTarget({'arg':_0x55ebee,'contextParent':_0x184fed[_0x5970bb(0x240)][_0x5970bb(0x233)],'cwd':process[_0x5970bb(0x25c)]()});isSuccessfulResolution(_0x4e2afb)&&_0x4e2afb['type']===_0x5970bb(0x2ba)&&(_0x16ddc6=_0x4e2afb[_0x5970bb(0x252)]);}const _0x5bc085={..._0x184fed,'options':{..._0x184fed[_0x5970bb(0x240)],'journeysOnly':!![],..._0x16ddc6&&{'singleFilePath':_0x16ddc6}}};return this['segmentPushCommand']['execute'](_0x5bc085);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x22d);[a28_0x8121c3(0x27d)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a28_0x8121c3(0x218)](_0x49f404){const _0x311013=a28_0x8121c3,{options:_0x2ce19d,args:_0x1cfd6e,tdx:_0x46f95c}=_0x49f404,_0xa4c23e=_0x1cfd6e[0x0];if(!requireNameOrPath(_0xa4c23e))return 0x1;if(_0x2ce19d['verbose'])console[_0x311013(0x269)](_0x311013(0x29f)+_0xa4c23e);const {journeyId:_0x5ded7c}=await resolveJourneyIdFromInput(_0xa4c23e,_0x2ce19d,_0x46f95c),_0x298bfe=await withSpinner(_0x311013(0x237),()=>_0x46f95c[_0x311013(0x29c)][_0x311013(0x21e)](_0x5ded7c),{'verbose':_0x2ce19d[_0x311013(0x200)]}),{bundleName:_0x1c8330,versions:_0x1a3852,latestJourneyId:_0x39fed4}=_0x298bfe[_0x311013(0x22f)];console['error'](_0x1c8330+':\x20'+_0x1a3852[_0x311013(0x267)]+_0x311013(0x1e9)+(_0x1a3852[_0x311013(0x267)]!==0x1?'s':''));const _0x3acdc0=_0x1a3852[_0x311013(0x20a)](_0x1434d3=>({'version':_0x1434d3[_0x311013(0x1ec)],'journey_id':_0x1434d3[_0x311013(0x2aa)],'name':_0x1434d3[_0x311013(0x29b)],'state':_0x1434d3[_0x311013(0x2bb)],'paused':_0x1434d3[_0x311013(0x1f6)],'latest':_0x1434d3[_0x311013(0x2aa)]===_0x39fed4,'created_at':_0x1434d3[_0x311013(0x258)]}));return await handleSDKOutput(_0x3acdc0,_0x2ce19d),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x23c);[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x242);async[a28_0x8121c3(0x218)](_0x1afee5){const _0x4d927b=a28_0x8121c3,{options:_0x3afe97,args:_0x40abc0,tdx:_0x26cb13}=_0x1afee5,_0x110008=_0x40abc0[0x0];if(!requireNameOrPath(_0x110008))return 0x1;if(_0x3afe97[_0x4d927b(0x200)])console[_0x4d927b(0x269)](_0x4d927b(0x29f)+_0x110008);const {journeyId:_0x193cf4,journeyName:_0x13405b}=await resolveJourneyIdFromInput(_0x110008,_0x3afe97,_0x26cb13);if(!_0x3afe97[_0x4d927b(0x1e6)]){const _0x392019=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x13405b+'\x22?');if(!_0x392019)return console['error'](_0x4d927b(0x2a2)),0x0;}const _0x507381=await withSpinner('Creating\x20new\x20version...',()=>_0x26cb13['journey'][_0x4d927b(0x1ff)](_0x193cf4),{'verbose':_0x3afe97[_0x4d927b(0x200)]}),_0x1787d7=_0x507381[_0x4d927b(0x22f)];return console[_0x4d927b(0x269)](a28_0x302f34[_0x4d927b(0x1db)]('✔')+'\x20Created\x20v'+_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x1ec)]+'\x20(draft)\x20—\x20\x22'+_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x29b)]+'\x22'),console['error'](_0x4d927b(0x1e0)+_0x1787d7['id']),await handleSingleObjectOutput({'id':_0x1787d7['id'],'name':_0x1787d7[_0x4d927b(0x1eb)]['name'],'version':_0x1787d7[_0x4d927b(0x1eb)]['versionNumber'],'state':_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x2bb)],'bundle_id':_0x1787d7[_0x4d927b(0x1eb)]['journeyBundleId'],'created_at':_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x258)]},_0x3afe97),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x282);async['execute'](_0x261c93){const _0x485edb=a28_0x8121c3,{options:_0x167bcb,args:_0x4649a5,tdx:_0x19001b}=_0x261c93,_0x587b0c=_0x4649a5[0x0];if(!requireNameOrPath(_0x587b0c))return 0x1;const _0x594ff4=_0x167bcb[_0x485edb(0x262)];if(!_0x594ff4)return console[_0x485edb(0x269)](_0x485edb(0x21a)),console['error'](_0x485edb(0x232)),0x1;const _0x57b134=parseInt(_0x594ff4,0xa);if(isNaN(_0x57b134)||_0x57b134<0x1)return console[_0x485edb(0x269)](_0x485edb(0x220)+_0x594ff4),0x1;if(_0x167bcb['verbose'])console[_0x485edb(0x269)](_0x485edb(0x29f)+_0x587b0c+_0x485edb(0x2c0)+_0x57b134);const {journeyId:_0x5d9ef8,parentSegmentId:_0x30d4e8}=await resolveJourneyIdFromInput(_0x587b0c,_0x167bcb,_0x19001b),_0x58d412=await withSpinner(_0x485edb(0x25b),()=>_0x19001b['journey']['listVersions'](_0x5d9ef8),{'verbose':_0x167bcb[_0x485edb(0x200)]}),{versions:_0x3372b8,latestJourneyId:_0xd51f57}=_0x58d412[_0x485edb(0x22f)],_0x10ea4a=_0x3372b8['find'](_0x36b257=>_0x36b257['versionNumber']===_0x57b134);if(!_0x10ea4a){const _0x5b50ba=_0x3372b8['map'](_0x25733e=>'v'+_0x25733e[_0x485edb(0x1ec)])[_0x485edb(0x2c2)](',\x20');return console[_0x485edb(0x269)](_0x485edb(0x223)+_0x57b134+_0x485edb(0x2ab)+_0x5b50ba),0x1;}const _0x4e754c=await withSpinner('Getting\x20version\x20'+_0x57b134+'\x20details...',()=>_0x19001b['journey'][_0x485edb(0x1d3)](_0x10ea4a[_0x485edb(0x2aa)]),{'verbose':_0x167bcb[_0x485edb(0x200)]}),_0x1778c4=_0x4e754c[_0x485edb(0x22f)],_0x1d09bf=getConsoleNextUrl(_0x167bcb[_0x485edb(0x2a5)],'/app/ps/'+_0x30d4e8+_0x485edb(0x1e7)+_0x10ea4a['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x1778c4['id'],'name':_0x1778c4['attributes'][_0x485edb(0x29b)],'version':_0x1778c4['attributes'][_0x485edb(0x1ec)],'description':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x27d)],'state':_0x1778c4['attributes'][_0x485edb(0x2bb)],'paused':_0x1778c4['attributes'][_0x485edb(0x1f6)],'reentry_mode':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x226)],'stages':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x278)]?.['length']||0x0,..._0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x249)]&&{'goal':_0x1778c4['attributes'][_0x485edb(0x249)]['name']},'latest':_0x10ea4a[_0x485edb(0x2aa)]===_0xd51f57,'created_at':_0x1778c4['attributes']['createdAt'],'updated_at':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x2a8)],'url':_0x1d09bf},_0x167bcb),0x0;}}
|
|
1
|
+
const a28_0x19c35c=a28_0x4a8b;function a28_0x4e20(){const _0x12ea31=['add','bold','Getting\x20version\x20','Getting\x20column\x20mapping...','repeat','1718130tyXvxs','Database:\x20','📁\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','test','pause','conversion','completeMilestoneRate','\x22\x20not\x20found','no_parent','Parent\x20segment:\x20','\x20journey','exitOrJumpRate','goalSize','folderPath','table','history','blue','hasPeriod','Error:\x20Parent\x20segment\x20context\x20required','Error:\x20Journey\x20\x27','881391ksztmS','format','Pausing\x20journey...','absolutePath','...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','(paused)','type','push','createdAt','Error:\x20Invalid\x20version\x20number:\x20','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20\x20Statistics\x20not\x20available','(draft)','yes','/j/da','activation_','Available\x20stages:\x20','stageNameMap','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','activation','\x20(rule\x20match)','\x20versions)','toLowerCase','all','includeHistory','🗺️\x20','\x5c$&','journey:push','listVersions','(running)','98396WSHfmf','map','user','stage','then','session','\x27\x20not\x20found\x20in\x20','kind','List\x20activations\x20for\x20a\x20journey','segmentPushCommand','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','/e/','rootFolderId','links','Resolving\x20journey...','size','root\x20folder','\x20\x20Folder\x20path:\x20','No\x20statistics\x20available\x20for\x20journey:\x20','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Listing\x20journey\x20activations...','5346xizisX','journeyBundleId','✔\x20Context\x20set:\x20','cyan','state','Fetching\x20users\x20and\x20connections...','\x20(ID:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','reentryMode','Fetching\x20parent\x20segment...','length','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','message','relativePath','hasChanges','localeCompare','getTrafficData','journey','Error:\x20Invalid\x20--type\x20\x22','tdx.json','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Target\x20file:\x20','Creating\x20new\x20version...','data','segments','✔\x20Journey\x20\x22','options','journeyBundleName','enteredSize','(root)','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Table:\x20','Options:','join','json','journeyStages','journeyName','575901bfeHQq','\x22\x20paused','Error:\x20Stage\x20\x22','\x20not\x20found.\x20Available:\x20','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','listJourneysWithFolders','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resolveJourneyId','Resolved\x20YAML\x20file:\x20','resolveSegment','Listing\x20journeys...','entries','Show\x20journey\x20table\x20column\x20mapping','description','execute','Resume\x20a\x20paused\x20journey','base','stringify','(archived)','jsonl','verbose','\x20activation','\x20changed\x20files','version','Write\x20','limit','Resolving\x20parent\x20segment...','buildIdToNameMap','\x20=\x20','\x20Opening\x20','Folder\x20path:\x20','15WbXfrC','file','journey:stats','-\x20no\x20files\x20written','set','from','journey:version:create','.yml','375FfSiIu','✔\x20Pulled\x20','cwd','folderId','Fetching\x20journeys\x20and\x20folders...','getJourney','List\x20all\x20versions\x20of\x20a\x20journey','stages','INVALID_ARGUMENT','Getting\x20journey\x20traffic\x20data...','journeyId','4497328wQbRJv','filter','dryRun','journey:pause','10ALrHGO','✔\x20Found\x20','\x20->\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey',',\x20version:\x20','Getting\x20journey\x20statistics...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','columns','replace','database','connection','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','completed','\x20Created\x20v','goal','listJourneysFromParentSegment','site','journey:version:view','segment','paused','parent_segment','targetDir','error','getActivation','completionRate','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Journey\x20ID:\x20','Input:\x20','No\x20journeys\x20found','find','\x20details...','Show\x20journey\x20statistics','parentSegment','getColumnMapping','green','Pause\x20a\x20running\x20journey','buildIdToEmailMap','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getStatistics','get','resourceName','attributes','Fetching\x20','\x20new\x20files','\x0aError:','content','\x20files?','draft','args','launched','\x20unchanged\x20files','8rMagdW','isNew','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','journey:activations','getParentFull','\x20\x20Parent\x20segment:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20version','exitOrJumpSize','journey:pull','\x20(draft)\x20—\x20\x22','dim','has','Resolving\x20version...','web','sort','updatedAt','values','\x20\x20-\x20','filePath','renderStats','listActivationsFlat','51199zfZhNY','nodes','Error:\x20Version\x20','tsv','/j/da/je','rule','Cancelled','name','yellow','utf-8','\x20\x20Target:\x20','connector_config','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','log','\x20\x20Name:\x20','split','versionNumber','journey:view','Found\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','journey:traffic'];a28_0x4e20=function(){return _0x12ea31;};return a28_0x4e20();}(function(_0x1fceae,_0x1726f8){const _0x26a7e1=a28_0x4a8b,_0xc50cd2=_0x1fceae();while(!![]){try{const _0x1b7810=-parseInt(_0x26a7e1(0x16c))/0x1*(-parseInt(_0x26a7e1(0x122))/0x2)+parseInt(_0x26a7e1(0x10b))/0x3*(parseInt(_0x26a7e1(0x1be))/0x4)+parseInt(_0x26a7e1(0x113))/0x5*(parseInt(_0x26a7e1(0x1d3))/0x6)+parseInt(_0x26a7e1(0x19c))/0x7*(-parseInt(_0x26a7e1(0x156))/0x8)+parseInt(_0x26a7e1(0xec))/0x9+parseInt(_0x26a7e1(0x186))/0xa+-parseInt(_0x26a7e1(0x11e))/0xb;if(_0x1b7810===_0x1726f8)break;else _0xc50cd2['push'](_0xc50cd2['shift']());}catch(_0x5e7477){_0xc50cd2['push'](_0xc50cd2['shift']());}}}(a28_0x4e20,0x23da8));import a28_0x420ea5 from'chalk';import a28_0x21de12 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';function a28_0x4a8b(_0x300638,_0x22d7d3){_0x300638=_0x300638-0xe5;const _0x4e20bc=a28_0x4e20();let _0x4a8b45=_0x4e20bc[_0x300638];return _0x4a8b45;}import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x13149f){const _0x245791=a28_0x4a8b;return!_0x13149f&&(console['error'](_0x245791(0x12d)),console[_0x245791(0x138)](_0x245791(0xf0))),!!_0x13149f;}function withJsonFormat(_0x15a6c0){const _0x414251=a28_0x4a8b;if(!_0x15a6c0[_0x414251(0x19d)]&&!_0x15a6c0[_0x414251(0xe9)]&&!_0x15a6c0[_0x414251(0xff)]&&!_0x15a6c0[_0x414251(0x16f)])return{..._0x15a6c0,'format':_0x414251(0xe9),'json':!![]};return _0x15a6c0;}function formatJourneyState(_0x512ff0){const _0xbb9e35=a28_0x4a8b;switch(_0x512ff0){case _0xbb9e35(0x154):return a28_0x420ea5[_0xbb9e35(0x145)](_0xbb9e35(0x1bd));case _0xbb9e35(0x152):return a28_0x420ea5['dim'](_0xbb9e35(0x1ac));case _0xbb9e35(0x135):return a28_0x420ea5[_0xbb9e35(0x174)](_0xbb9e35(0x1a4));case _0xbb9e35(0x12e):return a28_0x420ea5[_0xbb9e35(0x198)]('(completed)');case'archived':return a28_0x420ea5[_0xbb9e35(0x161)](_0xbb9e35(0xfe));default:return'('+_0x512ff0+')';}}function formatJourneyItem(_0x2053f4,_0x4bf770='',_0x54f862){const _0x40908d=a28_0x4a8b,_0x3a7477=formatJourneyState(_0x2053f4['state']),_0x2494f6=_0x54f862?hyperlink(_0x2053f4[_0x40908d(0x1ee)],_0x54f862):_0x2053f4[_0x40908d(0x1ee)];return _0x4bf770+_0x40908d(0x1b9)+_0x2494f6+'\x20'+_0x3a7477;}function escapeRegex(_0x4f2aaf){const _0x362907=a28_0x4a8b;return _0x4f2aaf[_0x362907(0x12a)](/[.*+?^${}()|[\]\\]/g,_0x362907(0x1ba));}function globToRegex(_0x14a46e){const _0x4ef8b2=a28_0x4a8b,_0x5ca649=_0x14a46e[_0x4ef8b2(0x17b)]('*')['map'](escapeRegex);return new RegExp(_0x5ca649[_0x4ef8b2(0xe8)]('.*'),'i');}function buildRuleToNameMapping(_0x9e2599){const _0x521e80=a28_0x4a8b,_0x3fe5d0=new Map();if(_0x9e2599[_0x521e80(0x1eb)])for(const [_0x1549da,_0x4320fc]of Object[_0x521e80(0xf7)](_0x9e2599['segments'])){if(_0x4320fc['rule']){const _0x32922e=serializeRule(_0x4320fc[_0x521e80(0x171)]),_0x2861a4=_0x3fe5d0[_0x521e80(0x14a)](_0x32922e);_0x2861a4?_0x2861a4[_0x521e80(0x1a6)](_0x1549da):_0x3fe5d0[_0x521e80(0x10f)](_0x32922e,[_0x1549da]);}}return _0x3fe5d0;}async function resolveJourneyIdFromInput(_0xf13106,_0x2b43d8,_0x3940a9){const _0x30fee9=a28_0x4a8b,_0xb9b066=await resolveJourneyTarget(_0xf13106,_0x2b43d8[_0x30fee9(0x143)],_0x2b43d8['verbose']),_0x4d27c2=_0xb9b066[_0x30fee9(0x143)];if(!_0x4d27c2)throw new SDKError(ErrorCode[_0x30fee9(0x11b)],_0x30fee9(0x1e7));const _0x2c52ef=await withSpinner(_0x30fee9(0x106),()=>_0x3940a9[_0x30fee9(0x134)][_0x30fee9(0x1a9)](_0x4d27c2),{'verbose':_0x2b43d8['verbose']}),_0x4cf691=_0x2c52ef['data'],_0x1405dd=await withSpinner(_0x30fee9(0x1cc),()=>_0x3940a9['journey'][_0x30fee9(0xf3)](_0x4cf691,_0xb9b066[_0x30fee9(0xeb)]),{'verbose':_0x2b43d8[_0x30fee9(0x100)]});return{'journeyId':_0x1405dd[_0x30fee9(0x1ea)],'journeyName':_0xb9b066['journeyName'],'parentSegmentId':_0x4cf691};}async function resolveJourneyTarget(_0x27aa80,_0x56f861,_0x246556){const _0x67c5fd=a28_0x4a8b;if(isYamlFilePath(_0x27aa80))try{const _0x3ee7d2=await resolveYamlFilePath(_0x27aa80);return _0x246556&&(console['error'](_0x67c5fd(0xf4)+_0x27aa80),console[_0x67c5fd(0x138)](_0x67c5fd(0x15b)+_0x3ee7d2[_0x67c5fd(0x143)]),console['error'](_0x67c5fd(0x17a)+_0x3ee7d2['segmentName']),console[_0x67c5fd(0x138)](_0x67c5fd(0x1cf)+(_0x3ee7d2[_0x67c5fd(0x195)]||_0x67c5fd(0x1f0)))),{'journeyName':_0x3ee7d2['segmentName'],'parentSegment':_0x3ee7d2['parentSegment'],'resolved':_0x3ee7d2};}catch(_0x17a69a){throw new SDKError(ErrorCode[_0x67c5fd(0x11b)],_0x67c5fd(0x178)+_0x17a69a[_0x67c5fd(0x1df)]);}if(!_0x56f861)throw new SDKError(ErrorCode[_0x67c5fd(0x11b)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x27aa80,'parentSegment':_0x56f861};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a28_0x19c35c(0xf9)]='List\x20journeys\x20in\x20current\x20context';async[a28_0x19c35c(0xfa)](_0xbddb77){const _0x334b71=a28_0x19c35c,{options:_0x33800e,args:_0x49ee04,tdx:_0x2afa0e}=_0xbddb77,_0x620c6a=_0x49ee04[0x0],_0x5d5685=_0x33800e[_0x334b71(0x143)];if(!_0x5d5685)return console['error'](_0x334b71(0x19a)),console[_0x334b71(0x138)](_0x334b71(0x128)),0x1;const _0x556456=await withSpinner(_0x334b71(0x106),()=>_0x2afa0e[_0x334b71(0x134)][_0x334b71(0x1a9)](_0x5d5685),{'verbose':_0x33800e[_0x334b71(0x100)]}),_0x3963b9=_0x556456[_0x334b71(0x1ea)];_0x33800e['verbose']&&(console[_0x334b71(0x138)]('Parent\x20segment:\x20'+_0x5d5685+_0x334b71(0x1d9)+_0x3963b9+')'),_0x620c6a&&console[_0x334b71(0x138)]('Pattern:\x20'+_0x620c6a));const _0x28b966=await withSpinner(_0x334b71(0x1dc),()=>_0x2afa0e['segment'][_0x334b71(0x15a)](_0x3963b9),{'verbose':_0x33800e['verbose']}),_0x11ccc8=_0x28b966['data'],_0x24fea2=_0x11ccc8[_0x334b71(0x1ca)],_0x1e4d83=await withSpinner(_0x334b71(0xf6),()=>_0x2afa0e[_0x334b71(0x1e4)][_0x334b71(0xf1)](_0x3963b9,_0x24fea2),{'verbose':_0x33800e[_0x334b71(0x100)]});let _0x52f726=_0x1e4d83[_0x334b71(0x1ea)]['journeys'];const _0x61f83=_0x1e4d83[_0x334b71(0x1ea)]['folders'],_0x591d42=new Map();for(const _0x128511 of _0x61f83){_0x591d42[_0x334b71(0x10f)](_0x128511['id'],_0x128511[_0x334b71(0x173)]);}if(_0x620c6a){const _0xbfdf4a=globToRegex(_0x620c6a);_0x52f726=_0x52f726['filter'](_0x35ce79=>_0xbfdf4a[_0x334b71(0x18b)](_0x35ce79[_0x334b71(0x1ee)]));}console['error'](_0x334b71(0x123)+_0x52f726[_0x334b71(0x1dd)]+_0x334b71(0x192)+(_0x52f726[_0x334b71(0x1dd)]!==0x1?'s':''));const _0x4c4172=_0x4ae2a6=>{const _0x4d8c87=_0x334b71;return getConsoleNextUrl(_0x33800e['site'],'/app/ps/'+_0x3963b9+_0x4d8c87(0x1c9)+_0x4ae2a6+_0x4d8c87(0x1ae));};if(_0x33800e['format']==='table')await handleSDKOutput(_0x52f726,_0x33800e);else{if(_0x33800e[_0x334b71(0x19d)]===_0x334b71(0xe9)){const _0x2db9b1=_0x52f726[_0x334b71(0x1bf)](_0x2bcca8=>({..._0x2bcca8,'url':_0x4c4172(_0x2bcca8['id'])}));await handleSDKOutput(_0x2db9b1,_0x33800e);}else{console['log']('['+_0x5d5685+']');const _0x1f60e4=new Map(),_0x6ffb8a=[];for(const _0x325e1d of _0x52f726){if(!_0x325e1d['folderId']||_0x325e1d[_0x334b71(0x116)]===_0x24fea2)_0x6ffb8a['push'](_0x325e1d);else{const _0x25f51d=_0x1f60e4['get'](_0x325e1d[_0x334b71(0x116)])||[];_0x25f51d[_0x334b71(0x1a6)](_0x325e1d),_0x1f60e4[_0x334b71(0x10f)](_0x325e1d[_0x334b71(0x116)],_0x25f51d);}}const _0x5a23b8=(_0x1d382c,_0x4b318f)=>_0x1d382c[_0x334b71(0x1ee)][_0x334b71(0x1e2)](_0x4b318f[_0x334b71(0x1ee)],undefined,{'sensitivity':_0x334b71(0xfc)});_0x6ffb8a['sort'](_0x5a23b8);for(const _0x5f5a40 of _0x6ffb8a){console[_0x334b71(0x179)](formatJourneyItem(_0x5f5a40,'',_0x4c4172(_0x5f5a40['id'])));}const _0x3c3546=[..._0x1f60e4[_0x334b71(0xf7)]()][_0x334b71(0x165)]((_0x1819c7,_0x1fecbe)=>{const _0xb83403=_0x334b71,_0x20f893=_0x591d42[_0xb83403(0x14a)](_0x1819c7[0x0])||_0x1819c7[0x0],_0x56cdf8=_0x591d42[_0xb83403(0x14a)](_0x1fecbe[0x0])||_0x1fecbe[0x0];return _0x20f893[_0xb83403(0x1e2)](_0x56cdf8,undefined,{'sensitivity':'base'});});for(const [_0x277726,_0x175725]of _0x3c3546){const _0x423152=_0x591d42[_0x334b71(0x14a)](_0x277726)||_0x277726;console[_0x334b71(0x179)](_0x334b71(0x188)+_0x423152),_0x175725[_0x334b71(0x165)](_0x5a23b8);for(const _0x331b2f of _0x175725){console[_0x334b71(0x179)](formatJourneyItem(_0x331b2f,'\x20\x20',_0x4c4172(_0x331b2f['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x17d);[a28_0x19c35c(0xf9)]='Show\x20journey\x20details';async[a28_0x19c35c(0xfa)](_0x5ee974){const _0x277dbb=a28_0x19c35c,{options:_0x260f16,args:_0x3ac48d,tdx:_0xed1e84}=_0x5ee974,_0x7b15a1=_0x3ac48d[0x0];if(!_0x7b15a1)return console[_0x277dbb(0x138)](_0x277dbb(0x12d)),console[_0x277dbb(0x138)](_0x277dbb(0x189)),console[_0x277dbb(0x138)](_0x277dbb(0xe7)),console['error'](_0x277dbb(0x1de)),0x1;_0x260f16[_0x277dbb(0x100)]&&console[_0x277dbb(0x138)]('Input:\x20'+_0x7b15a1);const {journeyId:_0x3abda9,parentSegmentId:_0x1e541c}=await resolveJourneyIdFromInput(_0x7b15a1,_0x260f16,_0xed1e84);if(_0x260f16[_0x277dbb(0x164)]){const _0x4dd083=getConsoleNextUrl(_0x260f16['site'],'/app/ps/'+_0x1e541c+'/e/'+_0x3abda9+'/j/da/je');return console[_0x277dbb(0x138)](a28_0x420ea5[_0x277dbb(0x145)]('✔')+_0x277dbb(0x109)+a28_0x420ea5[_0x277dbb(0x1d6)](_0x4dd083)),openBrowser(_0x4dd083),0x0;}const _0x1c750e=await withSpinner('Getting\x20journey\x20details...',()=>_0xed1e84[_0x277dbb(0x1e4)][_0x277dbb(0x118)](_0x3abda9),{'verbose':_0x260f16[_0x277dbb(0x100)]}),_0x5b0fef=_0x1c750e['data'],_0x1cac81=_0x260f16['includeStats'];let _0x43d018;if(_0x1cac81)try{const _0x332947=await withSpinner('Getting\x20journey\x20statistics...',()=>_0xed1e84[_0x277dbb(0x1e4)][_0x277dbb(0x149)](_0x3abda9),{'verbose':_0x260f16[_0x277dbb(0x100)]});_0x43d018=_0x332947[_0x277dbb(0x1ea)];}catch{_0x260f16[_0x277dbb(0x100)]&&console[_0x277dbb(0x138)](_0x277dbb(0x1ab));}const _0x56555d=getConsoleNextUrl(_0x260f16['site'],'/app/ps/'+_0x1e541c+_0x277dbb(0x1c9)+_0x3abda9+_0x277dbb(0x170)),_0x1d3581={'id':_0x5b0fef['id'],'name':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x173)],'description':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0xf9)],'state':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x1d7)],'paused':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x135)],'reentry_mode':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x1db)],'stages':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0xea)]?.[_0x277dbb(0x1dd)]||0x0,..._0x5b0fef['attributes']['goal']&&{'goal':_0x5b0fef[_0x277dbb(0x14c)][_0x277dbb(0x130)]['name']},..._0x43d018&&{'statistics':{'size':_0x43d018['size'],'entered':_0x43d018[_0x277dbb(0x1ef)],'goal_achieved':_0x43d018[_0x277dbb(0x194)],'completion_rate':_0x43d018[_0x277dbb(0x13a)],'exit_or_jump':_0x43d018['exitOrJumpSize'],'exit_or_jump_rate':_0x43d018['exitOrJumpRate'],'stages':_0x43d018['stages']}},'url':_0x56555d};return await handleSingleObjectOutput(_0x1d3581,_0x260f16),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x10d);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x142);async[a28_0x19c35c(0xfa)](_0x545d9c){const _0x327bd9=a28_0x19c35c,{options:_0x211815,args:_0x4897ee,tdx:_0x43d083}=_0x545d9c,_0x58ba95=_0x4897ee[0x0];if(!requireNameOrPath(_0x58ba95))return 0x1;_0x211815[_0x327bd9(0x100)]&&console[_0x327bd9(0x138)]('Input:\x20'+_0x58ba95);const _0x3edc91=_0x211815,_0x33cd64=_0x3edc91[_0x327bd9(0x110)],_0x261cdf=_0x3edc91['to'],_0x5c6c6c=_0x3edc91['includeHistory'],_0x28ea28=_0x3edc91[_0x327bd9(0x1c1)];_0x5c6c6c&&!_0x33cd64&&!_0x261cdf&&console[_0x327bd9(0x138)](_0x327bd9(0x1a3));const _0x5c4784=_0x5c6c6c?withJsonFormat(_0x211815):_0x211815,{journeyId:_0xea1ad7,journeyName:_0x2b40a8}=await resolveJourneyIdFromInput(_0x58ba95,_0x5c4784,_0x43d083),_0x4c7e40=_0x33cd64||_0x261cdf?{'from':_0x33cd64,'to':_0x261cdf}:undefined,_0x3831d5=await withSpinner(_0x327bd9(0x127),()=>Promise[_0x327bd9(0x1b7)]([_0x43d083['journey'][_0x327bd9(0x118)](_0xea1ad7),_0x43d083[_0x327bd9(0x1e4)]['getStatistics'](_0xea1ad7,_0x4c7e40)]),{'verbose':_0x5c4784[_0x327bd9(0x100)]}),[_0x43e3b4,_0x84e96c]=_0x3831d5[_0x327bd9(0x1ea)];if(!_0x84e96c||_0x84e96c['journeyId']===null)return console[_0x327bd9(0x138)](_0x327bd9(0x1d0)+_0x2b40a8),console[_0x327bd9(0x138)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x3354f0=buildStageNameMap(_0x43e3b4),_0x12fabf=!!(_0x4c7e40&&_0x84e96c[_0x327bd9(0x197)]?.['length']),_0x191b99={'stageNameMap':_0x3354f0,'hasPeriod':_0x12fabf,'includeHistory':!!_0x5c6c6c};if(_0x28ea28&&_0x84e96c[_0x327bd9(0x11a)]){const _0x5496f4=_0x84e96c['stages']['find'](_0x4ec259=>{const _0x1ac49c=_0x327bd9,_0x187e88=_0x3354f0['get'](_0x4ec259['id'])??'';return _0x187e88[_0x1ac49c(0x1b6)]()===_0x28ea28[_0x1ac49c(0x1b6)]();});if(_0x5496f4)return await handleSingleObjectOutput(formatStageStats(_0x5496f4,_0x191b99),_0x5c4784),0x0;const _0x1eecb2=_0x84e96c[_0x327bd9(0x11a)][_0x327bd9(0x1bf)](_0x676c80=>_0x3354f0[_0x327bd9(0x14a)](_0x676c80['id'])??_0x676c80['id']);return console[_0x327bd9(0x138)](_0x327bd9(0xee)+_0x28ea28+_0x327bd9(0x18f)),console[_0x327bd9(0x138)](_0x327bd9(0x1b0)+_0x1eecb2[_0x327bd9(0xe8)](',\x20')),0x1;}const _0x2749cf=_0x84e96c[_0x327bd9(0x11a)]?.['map'](_0x348f44=>formatStageStats(_0x348f44,_0x191b99)),_0x1defde=assembleJourneyStats(_0x84e96c,{'from':_0x33cd64,'to':_0x261cdf,'includeHistory':_0x5c6c6c});return await this[_0x327bd9(0x16a)](_0x1defde,_0x2749cf??[],_0x5c4784),0x0;}async[a28_0x19c35c(0x16a)](_0xe8553f,_0x12f900,_0x57980d){const _0x46181d=a28_0x19c35c,_0x4dbaac=_0x57980d[_0x46181d(0x19d)]===_0x46181d(0xe9)||_0x57980d[_0x46181d(0x19d)]===_0x46181d(0xff)||_0x57980d[_0x46181d(0xe9)]||_0x57980d[_0x46181d(0xff)];if(_0x4dbaac){_0xe8553f[_0x46181d(0x11a)]=_0x12f900,await handleSingleObjectOutput(_0xe8553f,_0x57980d);return;}await handleSingleObjectOutput(_0xe8553f,_0x57980d);for(const _0x446141 of _0x12f900){console[_0x46181d(0x179)](''),console['log'](String(a28_0x420ea5[_0x46181d(0x1d6)][_0x46181d(0x182)]('['+_0x446141[_0x46181d(0x173)]+']'))+a28_0x420ea5[_0x46181d(0x161)]('\x20'+_0x446141['id']));const {id:_0xec8181,name:_0x5ed70b,..._0xbe8a59}=_0x446141;await handleSingleObjectOutput(_0xbe8a59,_0x57980d);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x180);['description']=a28_0x19c35c(0x17f);async[a28_0x19c35c(0xfa)](_0x3bd377){const _0xff7b06=a28_0x19c35c,{options:_0x384b4b,args:_0x4e9370,tdx:_0x183cf0}=_0x3bd377,_0x27f40f=_0x4e9370[0x0];if(!requireNameOrPath(_0x27f40f))return 0x1;_0x384b4b[_0xff7b06(0x100)]&&console['error'](_0xff7b06(0x13e)+_0x27f40f);const _0x4c6784=_0x384b4b,_0xff5c93=_0x4c6784[_0xff7b06(0x1a5)],_0x23c646=_0x4c6784[_0xff7b06(0x110)],_0x58f0f6=_0x4c6784['to'],_0x52863d=_0x4c6784[_0xff7b06(0x105)];if(_0xff5c93&&_0xff5c93!==_0xff7b06(0x18d)&&_0xff5c93!==_0xff7b06(0x1b3))return console[_0xff7b06(0x138)](_0xff7b06(0x1e5)+_0xff5c93+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x38eb0e=withJsonFormat(_0x384b4b),{journeyId:_0x20ed81,journeyName:_0x549d89}=await resolveJourneyIdFromInput(_0x27f40f,_0x38eb0e,_0x183cf0),_0x358f09={'type':_0xff5c93,'from':_0x23c646,'to':_0x58f0f6,'limit':_0x52863d},_0x9a45a=await withSpinner(_0xff7b06(0x11c),()=>_0x183cf0[_0xff7b06(0x1e4)][_0xff7b06(0x1e3)](_0x20ed81,_0x358f09),{'verbose':_0x38eb0e[_0xff7b06(0x100)]}),_0x5d7095=_0x9a45a[_0xff7b06(0x1ea)],_0x36e5bc=_0x5d7095['conversion']&&(_0x5d7095[_0xff7b06(0x18d)][_0xff7b06(0x16d)]['length']>0x0||_0x5d7095[_0xff7b06(0x18d)][_0xff7b06(0x1cb)]['length']>0x0),_0x2735a6=_0x5d7095['activation']&&_0x5d7095[_0xff7b06(0x1b3)][_0xff7b06(0x1dd)]>0x0;if(!_0x36e5bc&&!_0x2735a6)return console[_0xff7b06(0x138)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x549d89),console[_0xff7b06(0x138)](_0xff7b06(0x15c)),_0x23c646&&_0x58f0f6&&console[_0xff7b06(0x138)](_0xff7b06(0x1a1)),0x0;return await handleSingleObjectOutput(_0x5d7095,_0x38eb0e),0x0;}}function formatStageStats(_0x5015e4,_0x542558){const _0x6c6e61=a28_0x19c35c,_0xd0d59b=_0x542558[_0x6c6e61(0x199)]&&_0x5015e4['history']?.[_0x6c6e61(0x1dd)]?aggregateStageHistory(_0x5015e4[_0x6c6e61(0x197)]):{'size':_0x5015e4[_0x6c6e61(0x1cd)],'entered':_0x5015e4['enteredSize'],'milestone':_0x5015e4['milestoneSize'],'milestone_rate':_0x5015e4[_0x6c6e61(0x18e)],'exit_or_jump':_0x5015e4[_0x6c6e61(0x15e)],'exit_or_jump_rate':_0x5015e4[_0x6c6e61(0x193)]},_0x6354e7={'id':_0x5015e4['id'],'name':_0x542558[_0x6c6e61(0x1b1)][_0x6c6e61(0x14a)](_0x5015e4['id'])??_0x5015e4['id'],..._0xd0d59b};return _0x542558['hasPeriod']&&_0x542558[_0x6c6e61(0x1b8)]&&_0x5015e4[_0x6c6e61(0x197)]&&(_0x6354e7[_0x6c6e61(0x197)]=_0x5015e4[_0x6c6e61(0x197)]),_0x6354e7;}export class JourneyPauseCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x121);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x146);async['execute'](_0x5c8e31){const _0x23e393=a28_0x19c35c,{options:_0x40cb58,args:_0x2798ca,tdx:_0x5bee65}=_0x5c8e31,_0x3d605d=_0x2798ca[0x0];if(!requireNameOrPath(_0x3d605d))return 0x1;_0x40cb58[_0x23e393(0x100)]&&console[_0x23e393(0x138)](_0x23e393(0x13e)+_0x3d605d);const {journeyId:_0x15c0c8,journeyName:_0x1b3fd2}=await resolveJourneyIdFromInput(_0x3d605d,_0x40cb58,_0x5bee65);if(!_0x40cb58[_0x23e393(0x1ad)]){const _0x5b3cb1=await confirm(_0x23e393(0x1c8)+_0x1b3fd2+'\x22?');if(!_0x5b3cb1)return console[_0x23e393(0x138)](_0x23e393(0x172)),0x0;}const _0x37facd=await withSpinner(_0x23e393(0x19e),()=>_0x5bee65[_0x23e393(0x1e4)][_0x23e393(0x18c)](_0x15c0c8),{'verbose':_0x40cb58[_0x23e393(0x100)]}),_0x1f2ca9=_0x37facd[_0x23e393(0x1ea)];return console[_0x23e393(0x138)](_0x23e393(0x1ec)+_0x1f2ca9[_0x23e393(0x14c)][_0x23e393(0x173)]+_0x23e393(0xed)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x19c35c(0x173)]='journey:resume';[a28_0x19c35c(0xf9)]=a28_0x19c35c(0xfb);async[a28_0x19c35c(0xfa)](_0x45793d){const _0x19d163=a28_0x19c35c,{options:_0xee6042,args:_0x512e27,tdx:_0x26568c}=_0x45793d,_0x1ca654=_0x512e27[0x0];if(!requireNameOrPath(_0x1ca654))return 0x1;_0xee6042[_0x19d163(0x100)]&&console[_0x19d163(0x138)]('Input:\x20'+_0x1ca654);const {journeyId:_0x387b23,journeyName:_0x4f7b95}=await resolveJourneyIdFromInput(_0x1ca654,_0xee6042,_0x26568c);if(!_0xee6042[_0x19d163(0x1ad)]){const _0xab4d3d=await confirm(_0x19d163(0x158)+_0x4f7b95+'\x22?');if(!_0xab4d3d)return console[_0x19d163(0x138)](_0x19d163(0x172)),0x0;}const _0x731844=await withSpinner('Resuming\x20journey...',()=>_0x26568c[_0x19d163(0x1e4)]['resume'](_0x387b23),{'verbose':_0xee6042[_0x19d163(0x100)]}),_0x1cc784=_0x731844['data'];return console[_0x19d163(0x138)]('✔\x20Journey\x20\x22'+_0x1cc784['attributes'][_0x19d163(0x173)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x15f);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x1da);async[a28_0x19c35c(0xfa)](_0x2d8b06){const _0x556839=a28_0x19c35c,{options:_0x235c4e,args:_0x26c7cd,tdx:_0x2fa5da}=_0x2d8b06,_0x4b1bfa=_0x235c4e,_0x1a5a43=_0x26c7cd[0x0],_0x1fee96=_0x1a5a43&&isYamlFilePath(_0x1a5a43),_0xcd82ee=await resolveTarget({'arg':_0x1fee96?_0x1a5a43:undefined,'contextParent':_0x235c4e[_0x556839(0x143)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xcd82ee))return _0xcd82ee['errorCode']===_0x556839(0x190)?(console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x174)](_0x556839(0x13c))),console[_0x556839(0x138)]('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[_0x556839(0x138)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x556839(0x1aa)),console[_0x556839(0x138)](_0x556839(0xf2))):(console[_0x556839(0x138)](a28_0x420ea5['red']('Error:\x20'+_0xcd82ee[_0x556839(0x1df)]+'\x0a')),_0xcd82ee['helpText']&&console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x1d6)](_0xcd82ee['helpText']))),0x1;let _0x4a7f5c=_0x1fee96?undefined:_0x1a5a43,_0x59dbfb,_0x3f66ac;_0xcd82ee[_0x556839(0x1a5)]==='file'&&(_0x4a7f5c=_0xcd82ee[_0x556839(0x14b)],_0x59dbfb=_0xcd82ee[_0x556839(0x169)],_0x3f66ac=_0xcd82ee[_0x556839(0x195)]);const _0x83de8b=_0xcd82ee['parentName'],_0x4d0585=_0xcd82ee[_0x556839(0x137)];_0x4b1bfa[_0x556839(0x100)]&&(console['error'](_0x556839(0x191)+_0x83de8b),console[_0x556839(0x138)]('Target\x20directory:\x20'+_0x4d0585),_0x4a7f5c&&console[_0x556839(0x138)]('Journey\x20name:\x20'+_0x4a7f5c),_0x59dbfb&&console['error'](_0x556839(0x1e8)+_0x59dbfb),_0x3f66ac&&console['error'](_0x556839(0x10a)+_0x3f66ac));const _0xa50a88=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2fa5da[_0x556839(0x134)][_0x556839(0x1a9)](_0x83de8b),{'verbose':_0x235c4e[_0x556839(0x100)]}),_0x1e2efe=_0xa50a88[_0x556839(0x1ea)],{journeys:_0xdd565b,folders:_0x413a10}=await withSpinner(_0x556839(0x117),async()=>{const _0x1d569d=_0x556839,[_0x4645e4,_0x5bca2a]=await Promise[_0x1d569d(0x1b7)]([_0x2fa5da[_0x1d569d(0x1e4)][_0x1d569d(0x131)](_0x1e2efe,undefined,{'includeAllVersions':!![]}),_0x2fa5da[_0x1d569d(0x134)]['listFolders'](_0x1e2efe)]);return{'journeys':_0x4645e4,'folders':_0x5bca2a};},{'verbose':_0x235c4e[_0x556839(0x100)]})[_0x556839(0x1c2)](_0x55d2c8=>_0x55d2c8[_0x556839(0x1ea)]);let _0x56f4e3=_0xdd565b;const _0xcdc3b8=buildFolderIdToPathMap(_0x413a10);if(_0x4a7f5c){const _0x2848f8=_0x56f4e3[_0x556839(0x11f)](_0xf2253d=>_0xf2253d[_0x556839(0x1ee)][_0x556839(0x1b6)]()===_0x4a7f5c[_0x556839(0x1b6)]());if(_0x2848f8['length']===0x0)return console[_0x556839(0x138)]('Error:\x20Journey\x20not\x20found:\x20'+_0x4a7f5c),console[_0x556839(0x138)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x56f4e3=_0x2848f8;}if(_0x3f66ac!==undefined){const _0x5cd35a=_0x56f4e3['filter'](_0x51dd07=>{const _0x35a63b=_0x556839,_0x5e0594=_0x51dd07['folderId']?_0xcdc3b8[_0x35a63b(0x14a)](_0x51dd07['folderId'])||'':'';return _0x5e0594===_0x3f66ac;});if(_0x5cd35a[_0x556839(0x1dd)]===0x0&&_0x56f4e3['length']>0x0){console['error'](_0x556839(0x19b)+_0x4a7f5c+_0x556839(0x1c4)+(_0x3f66ac||_0x556839(0x1ce))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x5df909 of _0x56f4e3){const _0x360b9c=_0x5df909[_0x556839(0x116)]?_0xcdc3b8['get'](_0x5df909[_0x556839(0x116)])||'':'';console['error'](_0x556839(0x168)+(_0x360b9c||_0x556839(0x1f0))+'/'+_0x5df909[_0x556839(0x1ee)]);}return 0x1;}_0x56f4e3=_0x5cd35a;}if(_0x56f4e3[_0x556839(0x1dd)]===0x0)return console[_0x556839(0x138)](_0x556839(0x13f)),0x0;const _0x27ab89=new Map();for(const _0x4b306e of _0x56f4e3){const _0x3940c1=_0x4b306e[_0x556839(0x1d4)];!_0x27ab89[_0x556839(0x162)](_0x3940c1)&&_0x27ab89[_0x556839(0x10f)](_0x3940c1,[]),_0x27ab89['get'](_0x3940c1)[_0x556839(0x1a6)](_0x4b306e);}for(const _0x4a8f32 of _0x27ab89[_0x556839(0x167)]()){_0x4a8f32['sort']((_0x3b3c05,_0x2729d1)=>(_0x3b3c05[_0x556839(0x17c)]||0x0)-(_0x2729d1[_0x556839(0x17c)]||0x0));}const _0x45127d=[],{idToEmailMap:_0xfd805a,connectionIdToNameMap:_0x3abbd1}=await withSpinner(_0x556839(0x1d8),async()=>{const _0x45523a=_0x556839,[_0x1a9bbc,_0x377597]=await Promise[_0x45523a(0x1b7)]([_0x2fa5da[_0x45523a(0x1c0)][_0x45523a(0x147)](),_0x2fa5da[_0x45523a(0x12c)][_0x45523a(0x107)]()]);return{'idToEmailMap':_0x1a9bbc,'connectionIdToNameMap':_0x377597};},{'verbose':_0x235c4e[_0x556839(0x100)]})[_0x556839(0x1c2)](_0xb72bff=>_0xb72bff[_0x556839(0x1ea)]);for(const _0x1790d1 of _0x27ab89[_0x556839(0x167)]()){const _0x53d061=_0x1790d1[0x0][_0x556839(0x1ee)],_0x489730=_0x1790d1[0x0]['folderId'],_0x5d1aec=_0x489730?_0xcdc3b8['get'](_0x489730)||'':'',_0x224dc8=_0x5d1aec?a28_0x21de12[_0x556839(0xe8)](_0x4d0585,_0x5d1aec):_0x4d0585,_0x3a8b17=_0x59dbfb||a28_0x21de12[_0x556839(0xe8)](_0x224dc8,sanitizeFileName(_0x53d061)+_0x556839(0x112));let _0xa66147,_0x2dbbdf;if(existsSync(_0x3a8b17))try{const _0x17a76e=readFileSync(_0x3a8b17,_0x556839(0x175)),_0x5efebc=parseYamlString(_0x17a76e);_0x2dbbdf=_0x5efebc,_0xa66147=buildRuleToNameMapping(_0x5efebc),_0x4b1bfa[_0x556839(0x100)]&&_0xa66147[_0x556839(0x1cd)]>0x0&&console['error'](_0x556839(0x17e)+_0xa66147[_0x556839(0x1cd)]+_0x556839(0x18a)+_0x53d061);}catch(_0x28ffe7){_0x4b1bfa[_0x556839(0x100)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x28ffe7[_0x556839(0x1df)]);}const _0x583f4f=[],_0x1216f0=new Set(),_0x566ea9=new Map(),_0x3d59ba=new Map(),_0x20074f=new Set(),_0x55033b=new Map(),_0x45f4fc=new Map(),_0x283081=createJumpTargetCache();await withProgressSpinner(_0x556839(0x14d)+_0x53d061+_0x556839(0x1a0),async _0x3f0c63=>{const _0x29d087=_0x556839;for(const _0x38ce39 of _0x1790d1){const _0x252ee4=_0x1790d1[_0x29d087(0x1dd)]>0x1?_0x38ce39['journeyBundleName']+'\x20v'+(_0x38ce39['versionNumber']||0x1):_0x38ce39[_0x29d087(0x1ee)];_0x3f0c63['setPhase'](_0x29d087(0x14d)+_0x252ee4);const _0x3d42be=await _0x2fa5da[_0x29d087(0x1e4)][_0x29d087(0x118)](_0x38ce39['id']),_0x307675=_0x3d42be[_0x29d087(0x14c)]?.['audienceId'],_0x1d6dcf={'resolveSegment':async _0x2aa555=>{const _0x4e4221=_0x29d087;if(!_0x307675)return{'name':_0x2aa555,'isJourneyLocal':![]};const _0x482279=_0x566ea9[_0x4e4221(0x14a)](_0x2aa555);if(_0x482279)return _0x482279;try{const _0x24ad7b=await _0x2fa5da[_0x4e4221(0x134)]['getSegment'](_0x307675,_0x2aa555),_0x2b1330=_0x24ad7b[_0x4e4221(0x1c5)]===SEGMENT_KIND_JOURNEY;let _0x274590,_0x2426a9=_0x24ad7b[_0x4e4221(0x173)];if(_0x2b1330&&_0x24ad7b[_0x4e4221(0x171)]){const _0x5825ca=await segmentResponseToDef(_0x24ad7b,{'resolveSegmentName':async _0xd2940c=>{const _0x45cbfc=_0x4e4221,_0x452770=_0x566ea9[_0x45cbfc(0x14a)](_0xd2940c);if(_0x452770)return _0x452770[_0x45cbfc(0x173)];const _0x1b9ef0=await _0x1d6dcf[_0x45cbfc(0xf5)](_0xd2940c);return _0x1b9ef0[_0x45cbfc(0x173)];}}),_0x3453f5=_0x5825ca['rule'];_0x274590={'description':_0x24ad7b['description'],'rule':_0x3453f5};const _0x8654=serializeRule(_0x3453f5),_0x324ab4=_0x3d59ba[_0x4e4221(0x14a)](_0x8654);if(_0x324ab4)_0x2426a9=_0x324ab4,_0x274590=undefined,_0x4b1bfa[_0x4e4221(0x100)]&&console[_0x4e4221(0x138)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x24ad7b[_0x4e4221(0x173)]+_0x4e4221(0x124)+_0x324ab4);else{let _0x21a955=![];if(_0xa66147){const _0x495c65=_0xa66147[_0x4e4221(0x14a)](_0x8654);if(_0x495c65){const _0x1939e2=_0x495c65[_0x4e4221(0x140)](_0xa82143=>!_0x1216f0[_0x4e4221(0x162)](_0xa82143));_0x1939e2&&(_0x2426a9=_0x1939e2,_0x1216f0[_0x4e4221(0x181)](_0x1939e2),_0x3d59ba[_0x4e4221(0x10f)](_0x8654,_0x1939e2),_0x21a955=!![],_0x4b1bfa[_0x4e4221(0x100)]&&console[_0x4e4221(0x138)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x1939e2+_0x4e4221(0x1b4)));}}if(!_0x21a955){const _0x1751f1=generateJourneyLocalName(_0x24ad7b[_0x4e4221(0x173)]);_0x1751f1&&(_0x2426a9=_0x1751f1);let _0x5279eb=_0x2426a9,_0x42c6db=0x2;while(_0x1216f0['has'](_0x5279eb)){_0x5279eb=_0x2426a9+'_'+_0x42c6db,_0x42c6db++;}_0x1216f0[_0x4e4221(0x181)](_0x5279eb),_0x3d59ba['set'](_0x8654,_0x5279eb),_0x2426a9=_0x5279eb;}}}const _0x3b8dda={'name':_0x2426a9,'isJourneyLocal':_0x2b1330,'definition':_0x274590};return _0x566ea9[_0x4e4221(0x10f)](_0x2aa555,_0x3b8dda),_0x3b8dda;}catch(_0x5672d2){return _0x235c4e[_0x4e4221(0x100)]&&console[_0x4e4221(0x138)](_0x4e4221(0x1d1)+_0x2aa555+':\x20'+_0x5672d2[_0x4e4221(0x1df)]),{'name':_0x2aa555,'isJourneyLocal':![]};}},'resolveActivation':async _0x5519c2=>{const _0x41b686=_0x29d087,_0x20e503=_0x55033b[_0x41b686(0x14a)](_0x5519c2);if(_0x20e503)return _0x20e503;try{const _0x512bdc=await _0x2fa5da['journey'][_0x41b686(0x139)](_0x38ce39['id'],_0x5519c2),_0x7bea0e=journeyActivationStepToYaml(_0x512bdc,_0xfd805a,_0x3abbd1),_0x2f8132=JSON[_0x41b686(0xfd)]({'name':_0x7bea0e['name'],'connection':_0x7bea0e[_0x41b686(0x12c)],'connector_config':_0x7bea0e[_0x41b686(0x177)]}),_0x456baa=_0x45f4fc[_0x41b686(0x14a)](_0x2f8132);if(_0x456baa){const _0x2c20b4={'name':_0x456baa,'isJourneyLocal':!![],'definition':_0x7bea0e};return _0x55033b['set'](_0x5519c2,_0x2c20b4),_0x2c20b4;}const _0x1dd971=_0x512bdc[_0x41b686(0x14c)]['activationParams'][_0x41b686(0x173)]||_0x5519c2,_0x592adb=sanitizeYamlKey(_0x1dd971)||_0x41b686(0x1af)+_0x5519c2;let _0x5057b7=_0x592adb,_0x74645a=0x2;while(_0x20074f[_0x41b686(0x162)](_0x5057b7)){_0x5057b7=_0x592adb+'_'+_0x74645a,_0x74645a++;}_0x20074f[_0x41b686(0x181)](_0x5057b7),_0x45f4fc[_0x41b686(0x10f)](_0x2f8132,_0x5057b7);const _0x50919f={'name':_0x5057b7,'isJourneyLocal':!![],'definition':_0x7bea0e};return _0x55033b['set'](_0x5519c2,_0x50919f),_0x50919f;}catch(_0x37a7da){return _0x235c4e['verbose']&&console[_0x41b686(0x138)](_0x41b686(0xe5)+_0x5519c2+':\x20'+_0x37a7da[_0x41b686(0x1df)]),{'name':_0x5519c2,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x17089b,_0x2e620a)=>{const _0x427b4f=_0x29d087;return resolveJumpTarget(_0x17089b,_0x2e620a,_0x283081,_0x5ca7a3=>_0x2fa5da[_0x427b4f(0x1e4)][_0x427b4f(0x118)](_0x5ca7a3));}},_0x58b208=await journeyResponseToDef(_0x3d42be,_0x1d6dcf);_0x583f4f['push']({'item':_0x38ce39,'yaml':_0x58b208});}},{'verbose':_0x235c4e['verbose']});const _0x300823=await _0x2fa5da[_0x556839(0x1e4)]['getLatestJourneyId'](_0x1790d1[0x0]['journeyBundleId']),_0x10b655=buildMergedJourneyDef(_0x583f4f,_0xa66147,_0x300823),_0x42d814=normalizeJourneyDef(_0x10b655,_0x2dbbdf),_0x28e26e=toYamlString(_0x42d814),_0x42edff=_0x59dbfb||a28_0x21de12[_0x556839(0xe8)](_0x224dc8,sanitizeFileName(_0x53d061)+_0x556839(0x112));!_0x59dbfb&&_0x5d1aec&&!existsSync(_0x224dc8)&&mkdirSync(_0x224dc8,{'recursive':!![]});const _0x377062=a28_0x21de12['relative'](process[_0x556839(0x115)](),_0x42edff);if(existsSync(_0x42edff)){const _0x12e71d=readFileSync(_0x42edff,'utf-8'),_0x445b79=generateDiff(_0x12e71d,_0x28e26e),_0x9307a=hasChanges(_0x445b79);_0x45127d[_0x556839(0x1a6)]({'relativePath':_0x377062,'absolutePath':_0x42edff,'content':_0x28e26e,'isNew':![],'hasChanges':_0x9307a,'diff':_0x9307a?formatDiffWithColors(_0x445b79):undefined});}else _0x45127d[_0x556839(0x1a6)]({'relativePath':_0x377062,'absolutePath':_0x42edff,'content':_0x28e26e,'isNew':!![],'hasChanges':![]});}const _0x29d443=_0x45127d[_0x556839(0x11f)](_0x1e001f=>_0x1e001f[_0x556839(0x157)]),_0x5b4223=_0x45127d[_0x556839(0x11f)](_0x2ed84b=>!_0x2ed84b[_0x556839(0x157)]&&_0x2ed84b['hasChanges']),_0x4b2420=_0x45127d[_0x556839(0x11f)](_0x9d31e7=>!_0x9d31e7[_0x556839(0x157)]&&!_0x9d31e7[_0x556839(0x1e1)]),_0x578dd7=_0x56f4e3[_0x556839(0x1dd)],_0x518788=_0x27ab89[_0x556839(0x1cd)],_0xd75b4e=_0x578dd7>_0x518788?'\x20('+_0x578dd7+_0x556839(0x1b5):'';console[_0x556839(0x138)]('\x0aPull\x20summary:'),console[_0x556839(0x138)]('\x20\x20'+a28_0x420ea5[_0x556839(0x1d6)](_0x518788+'\x20journeys')+a28_0x420ea5[_0x556839(0x161)](_0xd75b4e)),console[_0x556839(0x138)]('\x20\x20'+a28_0x420ea5[_0x556839(0x145)]('+\x20'+_0x29d443[_0x556839(0x1dd)]+_0x556839(0x14e))),console[_0x556839(0x138)]('\x20\x20'+a28_0x420ea5[_0x556839(0x174)]('~\x20'+_0x5b4223[_0x556839(0x1dd)]+_0x556839(0x102))),console['error']('\x20\x20'+a28_0x420ea5[_0x556839(0x161)]('=\x20'+_0x4b2420['length']+_0x556839(0x155))),console['error'](_0x556839(0x176)+a28_0x420ea5[_0x556839(0x1d6)](_0x4d0585)+'\x0a');if(_0x5b4223[_0x556839(0x1dd)]>0x0)for(const _0x41b3ee of _0x5b4223){console[_0x556839(0x138)]('\x0aChanges\x20to\x20\x27'+_0x41b3ee[_0x556839(0x1e0)]+'\x27:'),console[_0x556839(0x138)]('─'['repeat'](0x3c)),console['error'](_0x41b3ee['diff']),console[_0x556839(0x138)]('─'[_0x556839(0x185)](0x3c));}if(_0x4b1bfa[_0x556839(0x120)])return console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x174)](_0x556839(0x13b))),0x0;if(_0x29d443['length']===0x0&&_0x5b4223['length']===0x0)return console['error'](a28_0x420ea5[_0x556839(0x145)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x83de8b},_0x4b1bfa[_0x556839(0x1c3)]),console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x145)](_0x556839(0x1d5)+a28_0x420ea5[_0x556839(0x161)](_0x556839(0x136))+_0x556839(0x108)+a28_0x420ea5['cyan'](_0x83de8b))),0x0;if(!_0x4b1bfa[_0x556839(0x1ad)]&&(_0x29d443[_0x556839(0x1dd)]>0x0||_0x5b4223[_0x556839(0x1dd)]>0x0)){if(!isInteractive())return console[_0x556839(0x138)](a28_0x420ea5['red'](_0x556839(0x14f)),_0x556839(0x1b2)),console['error'](a28_0x420ea5[_0x556839(0x161)](_0x556839(0x148))),0x1;const _0x5a054f=await confirmKey(_0x556839(0x104)+(_0x29d443['length']+_0x5b4223[_0x556839(0x1dd)])+_0x556839(0x151));if(!_0x5a054f)return console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x174)]('Aborted.'),_0x556839(0x10e)),0x1;}!existsSync(_0x4d0585)&&mkdirSync(_0x4d0585,{'recursive':!![]});const _0x3c8ecc=a28_0x21de12[_0x556839(0xe8)](_0x4d0585,_0x556839(0x1e6));writeFileSync(_0x3c8ecc,createTdxConfigContent(_0x83de8b),'utf-8');for(const _0x148126 of _0x45127d){(_0x148126[_0x556839(0x157)]||_0x148126[_0x556839(0x1e1)])&&writeFileSync(_0x148126[_0x556839(0x19f)],_0x148126[_0x556839(0x150)],_0x556839(0x175));}return console[_0x556839(0x138)](a28_0x420ea5[_0x556839(0x145)](_0x556839(0x114)+(_0x29d443[_0x556839(0x1dd)]+_0x5b4223[_0x556839(0x1dd)])+'\x20journey\x20files\x20to\x20'+_0x4d0585)),saveSessionContext({'parent_segment':_0x83de8b},_0x4b1bfa[_0x556839(0x1c3)]),console['error'](a28_0x420ea5[_0x556839(0x145)]('✔\x20Context\x20set:\x20'+a28_0x420ea5[_0x556839(0x161)](_0x556839(0x136))+_0x556839(0x108)+a28_0x420ea5[_0x556839(0x1d6)](_0x83de8b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x19c35c(0x173)]='journey:columns';[a28_0x19c35c(0xf9)]=a28_0x19c35c(0xf8);async[a28_0x19c35c(0xfa)](_0x519d0a){const _0x514cb7=a28_0x19c35c,{options:_0x202d20,args:_0x298668,tdx:_0x4ff602}=_0x519d0a,_0x212004=_0x298668[0x0];if(!requireNameOrPath(_0x212004))return 0x1;_0x202d20[_0x514cb7(0x100)]&&console[_0x514cb7(0x138)](_0x514cb7(0x13e)+_0x212004);const {journeyId:_0x3dfb92}=await resolveJourneyIdFromInput(_0x212004,_0x202d20,_0x4ff602),_0x7d951f=await withSpinner(_0x514cb7(0x184),()=>_0x4ff602['journey'][_0x514cb7(0x144)](_0x3dfb92),{'verbose':_0x202d20[_0x514cb7(0x100)]}),_0x31577c=_0x7d951f[_0x514cb7(0x1ea)];return console[_0x514cb7(0x179)](_0x514cb7(0x187)+_0x31577c[_0x514cb7(0x12b)]),console[_0x514cb7(0x179)](_0x514cb7(0xe6)+_0x31577c[_0x514cb7(0x196)]),await handleSDKOutput(_0x31577c[_0x514cb7(0x129)],_0x202d20),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x159);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x1c6);async[a28_0x19c35c(0xfa)](_0x2c83f7){const _0x3ea682=a28_0x19c35c,{options:_0x254fa1,args:_0x12649d,tdx:_0x409f87}=_0x2c83f7,_0x43ef2a=_0x12649d[0x0];if(!requireNameOrPath(_0x43ef2a))return 0x1;_0x254fa1[_0x3ea682(0x100)]&&console['error'](_0x3ea682(0x13e)+_0x43ef2a);const {journeyId:_0x2bd887}=await resolveJourneyIdFromInput(_0x43ef2a,_0x254fa1,_0x409f87),_0x3aa4e3=await withSpinner(_0x3ea682(0x1d2),()=>_0x409f87['journey'][_0x3ea682(0x16b)](_0x2bd887),{'verbose':_0x254fa1[_0x3ea682(0x100)]}),_0xd968cb=_0x3aa4e3[_0x3ea682(0x1ea)];return console['error'](_0x3ea682(0x17e)+_0xd968cb[_0x3ea682(0x1dd)]+_0x3ea682(0x101)+(_0xd968cb[_0x3ea682(0x1dd)]!==0x1?'s':'')),await handleSDKOutput(_0xd968cb,_0x254fa1),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a28_0x19c35c(0x1bb);[a28_0x19c35c(0xf9)]=a28_0x19c35c(0x1a2);[a28_0x19c35c(0x1c7)]=new SegmentPushCommand();async[a28_0x19c35c(0xfa)](_0x51ab03){const _0x28fdd2=a28_0x19c35c,_0x37b624=_0x51ab03[_0x28fdd2(0x153)][0x0];let _0x1a7686;if(_0x37b624){const _0x445ae7=await resolveTarget({'arg':_0x37b624,'contextParent':_0x51ab03[_0x28fdd2(0x1ed)]['parentSegment'],'cwd':process[_0x28fdd2(0x115)]()});isSuccessfulResolution(_0x445ae7)&&_0x445ae7[_0x28fdd2(0x1a5)]===_0x28fdd2(0x10c)&&(_0x1a7686=_0x445ae7[_0x28fdd2(0x169)]);}const _0x493d37={..._0x51ab03,'options':{..._0x51ab03['options'],'journeysOnly':!![],..._0x1a7686&&{'singleFilePath':_0x1a7686}}};return this[_0x28fdd2(0x1c7)][_0x28fdd2(0xfa)](_0x493d37);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x19c35c(0x173)]='journey:versions';['description']=a28_0x19c35c(0x119);async[a28_0x19c35c(0xfa)](_0x1eac2f){const _0x352c15=a28_0x19c35c,{options:_0x6a7a84,args:_0xb3b8ff,tdx:_0x5d0737}=_0x1eac2f,_0x3dabe9=_0xb3b8ff[0x0];if(!requireNameOrPath(_0x3dabe9))return 0x1;if(_0x6a7a84[_0x352c15(0x100)])console['error'](_0x352c15(0x13e)+_0x3dabe9);const {journeyId:_0x247bd8}=await resolveJourneyIdFromInput(_0x3dabe9,_0x6a7a84,_0x5d0737),_0x50614f=await withSpinner('Listing\x20journey\x20versions...',()=>_0x5d0737[_0x352c15(0x1e4)][_0x352c15(0x1bc)](_0x247bd8),{'verbose':_0x6a7a84[_0x352c15(0x100)]}),{bundleName:_0x212481,versions:_0x32f834,latestJourneyId:_0x25e9ff}=_0x50614f['data'];console[_0x352c15(0x138)](_0x212481+':\x20'+_0x32f834[_0x352c15(0x1dd)]+_0x352c15(0x15d)+(_0x32f834[_0x352c15(0x1dd)]!==0x1?'s':''));const _0x9a672c=_0x32f834['map'](_0x6d0b5f=>({'version':_0x6d0b5f['versionNumber'],'journey_id':_0x6d0b5f[_0x352c15(0x11d)],'name':_0x6d0b5f[_0x352c15(0x173)],'state':_0x6d0b5f[_0x352c15(0x1d7)],'paused':_0x6d0b5f['paused'],'latest':_0x6d0b5f['journeyId']===_0x25e9ff,'created_at':_0x6d0b5f[_0x352c15(0x1a7)]}));return await handleSDKOutput(_0x9a672c,_0x6a7a84),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x111);['description']=a28_0x19c35c(0x125);async['execute'](_0x1a7b16){const _0x32b666=a28_0x19c35c,{options:_0x32131c,args:_0x4764a9,tdx:_0xa21b9e}=_0x1a7b16,_0x51e6e4=_0x4764a9[0x0];if(!requireNameOrPath(_0x51e6e4))return 0x1;if(_0x32131c[_0x32b666(0x100)])console[_0x32b666(0x138)](_0x32b666(0x13e)+_0x51e6e4);const {journeyId:_0x1c28ca,journeyName:_0x29a8b3}=await resolveJourneyIdFromInput(_0x51e6e4,_0x32131c,_0xa21b9e);if(!_0x32131c[_0x32b666(0x1ad)]){const _0x20081e=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x29a8b3+'\x22?');if(!_0x20081e)return console['error']('Cancelled'),0x0;}const _0xfa76d0=await withSpinner(_0x32b666(0x1e9),()=>_0xa21b9e[_0x32b666(0x1e4)]['createVersion'](_0x1c28ca),{'verbose':_0x32131c[_0x32b666(0x100)]}),_0x4666fb=_0xfa76d0[_0x32b666(0x1ea)];return console[_0x32b666(0x138)](a28_0x420ea5[_0x32b666(0x145)]('✔')+_0x32b666(0x12f)+_0x4666fb[_0x32b666(0x14c)][_0x32b666(0x17c)]+_0x32b666(0x160)+_0x4666fb[_0x32b666(0x14c)][_0x32b666(0x173)]+'\x22'),console[_0x32b666(0x138)](_0x32b666(0x13d)+_0x4666fb['id']),await handleSingleObjectOutput({'id':_0x4666fb['id'],'name':_0x4666fb[_0x32b666(0x14c)][_0x32b666(0x173)],'version':_0x4666fb[_0x32b666(0x14c)]['versionNumber'],'state':_0x4666fb[_0x32b666(0x14c)]['state'],'bundle_id':_0x4666fb[_0x32b666(0x14c)]['journeyBundleId'],'created_at':_0x4666fb[_0x32b666(0x14c)][_0x32b666(0x1a7)]},_0x32131c),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x19c35c(0x173)]=a28_0x19c35c(0x133);[a28_0x19c35c(0xf9)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0x19c35c(0xfa)](_0x76282a){const _0x5e4942=a28_0x19c35c,{options:_0x57278f,args:_0x2eb618,tdx:_0x549d38}=_0x76282a,_0xce4fe8=_0x2eb618[0x0];if(!requireNameOrPath(_0xce4fe8))return 0x1;const _0x490bec=_0x57278f[_0x5e4942(0x103)];if(!_0x490bec)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x2f51af=parseInt(_0x490bec,0xa);if(isNaN(_0x2f51af)||_0x2f51af<0x1)return console[_0x5e4942(0x138)](_0x5e4942(0x1a8)+_0x490bec),0x1;if(_0x57278f['verbose'])console[_0x5e4942(0x138)](_0x5e4942(0x13e)+_0xce4fe8+_0x5e4942(0x126)+_0x2f51af);const {journeyId:_0x149876,parentSegmentId:_0x23814f}=await resolveJourneyIdFromInput(_0xce4fe8,_0x57278f,_0x549d38),_0x476a7b=await withSpinner(_0x5e4942(0x163),()=>_0x549d38[_0x5e4942(0x1e4)][_0x5e4942(0x1bc)](_0x149876),{'verbose':_0x57278f[_0x5e4942(0x100)]}),{versions:_0xcd7958,latestJourneyId:_0x3c4a81}=_0x476a7b['data'],_0x3dcc93=_0xcd7958[_0x5e4942(0x140)](_0x401835=>_0x401835[_0x5e4942(0x17c)]===_0x2f51af);if(!_0x3dcc93){const _0x33250d=_0xcd7958[_0x5e4942(0x1bf)](_0x2a0b6b=>'v'+_0x2a0b6b[_0x5e4942(0x17c)])[_0x5e4942(0xe8)](',\x20');return console[_0x5e4942(0x138)](_0x5e4942(0x16e)+_0x2f51af+_0x5e4942(0xef)+_0x33250d),0x1;}const _0x59c416=await withSpinner(_0x5e4942(0x183)+_0x2f51af+_0x5e4942(0x141),()=>_0x549d38['journey'][_0x5e4942(0x118)](_0x3dcc93[_0x5e4942(0x11d)]),{'verbose':_0x57278f['verbose']}),_0x2f7a35=_0x59c416[_0x5e4942(0x1ea)],_0x17b14e=getConsoleNextUrl(_0x57278f[_0x5e4942(0x132)],'/app/ps/'+_0x23814f+_0x5e4942(0x1c9)+_0x3dcc93['journeyId']+_0x5e4942(0x170));return await handleSingleObjectOutput({'id':_0x2f7a35['id'],'name':_0x2f7a35['attributes'][_0x5e4942(0x173)],'version':_0x2f7a35[_0x5e4942(0x14c)]['versionNumber'],'description':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0xf9)],'state':_0x2f7a35['attributes'][_0x5e4942(0x1d7)],'paused':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x135)],'reentry_mode':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x1db)],'stages':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0xea)]?.[_0x5e4942(0x1dd)]||0x0,..._0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x130)]&&{'goal':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x130)][_0x5e4942(0x173)]},'latest':_0x3dcc93['journeyId']===_0x3c4a81,'created_at':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x1a7)],'updated_at':_0x2f7a35[_0x5e4942(0x14c)][_0x5e4942(0x166)],'url':_0x17b14e},_0x57278f),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x37ea1c=a29_0x195e;(function(_0x277f98,_0x34d6d7){const _0x5db31c=a29_0x195e,_0x193573=_0x277f98();while(!![]){try{const _0x1bb63b=parseInt(_0x5db31c(0x1ed))/0x1*(parseInt(_0x5db31c(0x1c3))/0x2)+parseInt(_0x5db31c(0x1b9))/0x3+parseInt(_0x5db31c(0x1bf))/0x4*(-parseInt(_0x5db31c(0x1d3))/0x5)+-parseInt(_0x5db31c(0x1bd))/0x6*(parseInt(_0x5db31c(0x1bb))/0x7)+parseInt(_0x5db31c(0x1d6))/0x8+-parseInt(_0x5db31c(0x1ef))/0x9+parseInt(_0x5db31c(0x1eb))/0xa;if(_0x1bb63b===_0x34d6d7)break;else _0x193573['push'](_0x193573['shift']());}catch(_0x1da946){_0x193573['push'](_0x193573['shift']());}}}(a29_0x4795,0x762e5));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x1bfdcd from'chalk';function a29_0x4795(){const _0x5c5ec4=['name','parentSegment','554355MvAfny','yellow','14AGczLA','validCount','1532298PBXTsa','dim','20gfAQWg','skippedCount','Error:\x20Directory\x20not\x20found:\x20','file','1392wJacTH','endsWith','\x20warning(s)\x20found','message','No\x20journey\x20YAML\x20files\x20found\x20in\x20','description','.yaml','execute','\x20valid','filter','no_parent','invalidCount','Validate\x20journey\x20YAML\x20files','\x20error(s)','verbose','green','650525mKenOi','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','cwd','4097728CqRcNH','log','warningCount','journey:validate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20segment\x20file(s)\x20skipped','errorCode','\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','cyan','Validation\x20failed:\x20','\x20(skipped:\x20','helpText','error','.yml','Error:\x20','errors','relativePath','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','targetDir','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','5119690YPoLQo','reason','864zBsDlz','\x20journey(s)\x20valid','1484586EXHwqY','warnings','type','filePath','red','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'];a29_0x4795=function(){return _0x5c5ec4;};return a29_0x4795();}function a29_0x195e(_0x5426b0,_0x29b3bf){_0x5426b0=_0x5426b0-0x1b4;const _0x47952c=a29_0x4795();let _0x195ef6=_0x47952c[_0x5426b0];return _0x195ef6;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a29_0x37ea1c(0x1b7)]=a29_0x37ea1c(0x1d9);[a29_0x37ea1c(0x1c8)]=a29_0x37ea1c(0x1cf);async[a29_0x37ea1c(0x1ca)](_0x703b4e){const _0x1a929a=a29_0x37ea1c,{options:_0x277c0e,args:_0x12c1f3}=_0x703b4e,_0x41d7aa=_0x277c0e,_0x471e64=await resolveTarget({'arg':_0x12c1f3[0x0],'contextParent':_0x277c0e[_0x1a929a(0x1b8)],'cwd':process[_0x1a929a(0x1d5)]()});if(!isSuccessfulResolution(_0x471e64))return _0x471e64[_0x1a929a(0x1dc)]===_0x1a929a(0x1cd)?(console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1ba)](_0x1a929a(0x1da))),console[_0x1a929a(0x1e2)](_0x1a929a(0x1ea)),console['error'](_0x1a929a(0x1dd)),console[_0x1a929a(0x1e2)](_0x1a929a(0x1d4))):(console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1b5)](_0x1a929a(0x1e4)+_0x471e64[_0x1a929a(0x1c6)]+'\x0a')),_0x471e64[_0x1a929a(0x1e1)]&&console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1de)](_0x471e64[_0x1a929a(0x1e1)]))),0x1;const _0xd29c7a=_0x471e64[_0x1a929a(0x1e9)],_0x4956d8=_0x471e64[_0x1a929a(0x1f1)]===_0x1a929a(0x1c2)?_0x471e64[_0x1a929a(0x1b4)]:undefined;if(!_0x4956d8&&!existsSync(_0xd29c7a))return console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1b5)](_0x1a929a(0x1c1)+_0xd29c7a+'\x0a')),0x1;let _0x4555b1;if(_0x4956d8){if(!_0x4956d8[_0x1a929a(0x1c4)](_0x1a929a(0x1e3))&&!_0x4956d8[_0x1a929a(0x1c4)](_0x1a929a(0x1c9)))return console['error'](a29_0x1bfdcd[_0x1a929a(0x1b5)](_0x1a929a(0x1b6)+_0x4956d8+'\x0a')),0x1;_0x4555b1=[_0x4956d8];}else _0x4555b1=findYamlFiles(_0xd29c7a);if(_0x4555b1[_0x1a929a(0x1e8)]===0x0)return console['error'](a29_0x1bfdcd['red'](_0x1a929a(0x1e7)+_0xd29c7a+'\x0a')),0x1;const _0x4a6053=validateYamlFiles(_0x4555b1,_0xd29c7a,{'filterType':'journey'}),_0x3a23ae=calculateSummary(_0x4a6053),_0x5e4df9=_0x4a6053[_0x1a929a(0x1cc)](isValidationResult);if(_0x5e4df9[_0x1a929a(0x1e8)]===0x0)return console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1ba)](_0x1a929a(0x1c7)+_0xd29c7a+'\x0a')),_0x3a23ae['skippedCount']>0x0&&console[_0x1a929a(0x1e2)](a29_0x1bfdcd[_0x1a929a(0x1be)]('('+_0x3a23ae[_0x1a929a(0x1c0)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x158487 of _0x4a6053){if(!isValidationResult(_0x158487)){_0x41d7aa[_0x1a929a(0x1d1)]&&console['log'](a29_0x1bfdcd[_0x1a929a(0x1be)]('-\x20'+_0x158487[_0x1a929a(0x1e6)]+_0x1a929a(0x1e0)+_0x158487[_0x1a929a(0x1ec)]+')'));continue;}const {relativePath:_0x5e643a,source:_0x4f6e73,result:_0x5ea7a5}=_0x158487;if(_0x5ea7a5['valid']&&_0x5ea7a5[_0x1a929a(0x1f0)][_0x1a929a(0x1e8)]===0x0)_0x41d7aa[_0x1a929a(0x1d1)]&&console[_0x1a929a(0x1d7)](a29_0x1bfdcd[_0x1a929a(0x1d2)]('✔\x20'+_0x5e643a));else _0x5ea7a5['valid']?(console['log'](a29_0x1bfdcd['yellow']('⚠\x20'+_0x5e643a+':\x20'+_0x5ea7a5['warnings'][_0x1a929a(0x1e8)]+'\x20warning(s)')),console[_0x1a929a(0x1d7)](formatValidationResult(_0x5ea7a5,_0x4f6e73,_0x5e643a))):(console['log'](a29_0x1bfdcd['red']('✖\x20'+_0x5e643a+':\x20'+_0x5ea7a5[_0x1a929a(0x1e5)][_0x1a929a(0x1e8)]+_0x1a929a(0x1d0))),console[_0x1a929a(0x1d7)](formatValidationResult(_0x5ea7a5,_0x4f6e73,_0x5e643a)));}return console['log'](''),_0x3a23ae['hasErrors']?(console[_0x1a929a(0x1d7)](a29_0x1bfdcd[_0x1a929a(0x1b5)](_0x1a929a(0x1df)+_0x3a23ae[_0x1a929a(0x1ce)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x3a23ae[_0x1a929a(0x1bc)]+_0x1a929a(0x1cb))),_0x3a23ae[_0x1a929a(0x1d8)]>0x0&&console[_0x1a929a(0x1d7)](a29_0x1bfdcd[_0x1a929a(0x1ba)](_0x3a23ae[_0x1a929a(0x1d8)]+'\x20warning(s)\x20found')),_0x3a23ae[_0x1a929a(0x1c0)]>0x0&&console[_0x1a929a(0x1d7)](a29_0x1bfdcd['dim'](_0x3a23ae['skippedCount']+_0x1a929a(0x1db))),0x1):(console[_0x1a929a(0x1d7)](a29_0x1bfdcd[_0x1a929a(0x1d2)]('✔\x20All\x20'+_0x3a23ae[_0x1a929a(0x1bc)]+_0x1a929a(0x1ee))),_0x3a23ae[_0x1a929a(0x1d8)]>0x0&&console[_0x1a929a(0x1d7)](a29_0x1bfdcd['yellow'](_0x3a23ae['warningCount']+_0x1a929a(0x1c5))),_0x3a23ae[_0x1a929a(0x1c0)]>0x0&&console['log'](a29_0x1bfdcd[_0x1a929a(0x1be)](_0x3a23ae[_0x1a929a(0x1c0)]+_0x1a929a(0x1db))),0x0);}}
|