@treasuredata/tdx 2026.3.40 → 2026.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/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/segment-validator.js.map +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/cdp.d.ts +3 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x2d7754=a26_0x5914;(function(_0x5cbce2,_0x5d81e8){const _0x23d442=a26_0x5914,_0x343bb2=_0x5cbce2();while(!![]){try{const _0x29e8df=-parseInt(_0x23d442(0xd0))/0x1+-parseInt(_0x23d442(0xa9))/0x2*(parseInt(_0x23d442(0xbb))/0x3)+-parseInt(_0x23d442(0xc5))/0x4*(-parseInt(_0x23d442(0xdb))/0x5)+-parseInt(_0x23d442(0xc6))/0x6+-parseInt(_0x23d442(0xac))/0x7*(-parseInt(_0x23d442(0xb1))/0x8)+-parseInt(_0x23d442(0xc2))/0x9+parseInt(_0x23d442(0xcb))/0xa*(parseInt(_0x23d442(0xae))/0xb);if(_0x29e8df===_0x5d81e8)break;else _0x343bb2['push'](_0x343bb2['shift']());}catch(_0x3f7d4d){_0x343bb2['push'](_0x343bb2['shift']());}}}(a26_0x2f4f,0xcf9a0));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a26_0x2f4f(){const _0x45f3b5=['hasErrors','error','cwd','execute','filter','2328vwCGct','length','\x20warning(s)\x20found','verbose','template','No\x20template\x20YAML\x20files\x20found\x20in\x20','description','7347006kYjIYy','log','Validation\x20failed:\x20','16JkzbUi','4234830hUccaE','Error:\x20Directory\x20not\x20found:\x20','valid','name','engage:template:validate','160ESsWRY','\x20error(s)','.yml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20valid','1349473DkHjAy','dim','\x20template(s)\x20with\x20errors,\x20','skippedCount','errors','validCount','✔\x20All\x20','resolve','endsWith','red','\x20non-template\x20file(s)\x20skipped','1319510mKXotC','warnings','green','342epLjWL','.yaml','invalidCount','346801qBnULU','yellow','1243121CNrAFN','\x20template(s)\x20valid','\x20non-template\x20file(s)\x20skipped)','160eNLIqn','dirname','warningCount','Validate\x20template\x20YAML\x20files','reason'];a26_0x2f4f=function(){return _0x45f3b5;};return a26_0x2f4f();}import a26_0xe6cef2 from'chalk';import a26_0x503501 from'path';function a26_0x5914(_0xb82cc7,_0x5751d6){_0xb82cc7=_0xb82cc7-0xa9;const _0x2f4f87=a26_0x2f4f();let _0x59148e=_0x2f4f87[_0xb82cc7];return _0x59148e;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a26_0x2d7754(0xc9)]=a26_0x2d7754(0xca);[a26_0x2d7754(0xc1)]=a26_0x2d7754(0xb4);async[a26_0x2d7754(0xb9)](_0xc15817){const _0x3f6621=a26_0x2d7754,{options:_0x59df3c,args:_0xae0a51}=_0xc15817,_0x42ac19=_0x59df3c,_0x323b93=_0xae0a51[0x0],_0x1c904c=_0x323b93?a26_0x503501[_0x3f6621(0xd7)](_0x323b93):undefined,_0x28ecae=_0x1c904c?isYamlFile(_0x1c904c):![];let _0x5854da,_0x4d195b;if(_0x28ecae&&_0x1c904c)_0x5854da=a26_0x503501[_0x3f6621(0xb2)](_0x1c904c),_0x4d195b=_0x1c904c;else _0x1c904c?_0x5854da=_0x1c904c:_0x5854da=process[_0x3f6621(0xb8)]();if(!_0x4d195b&&!existsSync(_0x5854da))return console['error'](a26_0xe6cef2[_0x3f6621(0xd9)](_0x3f6621(0xc7)+_0x5854da+'\x0a')),0x1;let _0x241e9d;if(_0x4d195b){if(!_0x4d195b[_0x3f6621(0xd8)](_0x3f6621(0xcd))&&!_0x4d195b[_0x3f6621(0xd8)](_0x3f6621(0xaa)))return console[_0x3f6621(0xb7)](a26_0xe6cef2[_0x3f6621(0xd9)](_0x3f6621(0xce)+_0x4d195b+'\x0a')),0x1;_0x241e9d=[_0x4d195b];}else _0x241e9d=findYamlFiles(_0x5854da);if(_0x241e9d['length']===0x0)return console[_0x3f6621(0xb7)](a26_0xe6cef2[_0x3f6621(0xd9)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5854da+'\x0a')),0x1;const _0x36f965=validateYamlFiles(_0x241e9d,_0x5854da,{'filterType':_0x3f6621(0xbf)}),_0x284d8f=calculateSummary(_0x36f965),_0x4d6932=_0x36f965[_0x3f6621(0xba)](isValidationResult);if(_0x4d6932[_0x3f6621(0xbc)]===0x0)return console[_0x3f6621(0xb7)](a26_0xe6cef2[_0x3f6621(0xad)](_0x3f6621(0xc0)+_0x5854da+'\x0a')),_0x284d8f['skippedCount']>0x0&&console[_0x3f6621(0xb7)](a26_0xe6cef2['dim']('('+_0x284d8f[_0x3f6621(0xd3)]+_0x3f6621(0xb0))),0x0;for(const _0x47f058 of _0x36f965){if(!isValidationResult(_0x47f058)){_0x42ac19[_0x3f6621(0xbe)]&&console['log'](a26_0xe6cef2[_0x3f6621(0xd1)]('-\x20'+_0x47f058['relativePath']+'\x20(skipped:\x20'+_0x47f058[_0x3f6621(0xb5)]+')'));continue;}const {relativePath:_0x588840,source:_0x3d7b71,result:_0x51dc70}=_0x47f058;if(_0x51dc70[_0x3f6621(0xc8)]&&_0x51dc70[_0x3f6621(0xdc)]['length']===0x0)_0x42ac19[_0x3f6621(0xbe)]&&console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xdd)]('✔\x20'+_0x588840));else _0x51dc70[_0x3f6621(0xc8)]?(console[_0x3f6621(0xc3)](a26_0xe6cef2['yellow']('⚠\x20'+_0x588840+':\x20'+_0x51dc70['warnings']['length']+'\x20warning(s)')),console[_0x3f6621(0xc3)](formatValidationResult(_0x51dc70,_0x3d7b71,_0x588840))):(console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xd9)]('✖\x20'+_0x588840+':\x20'+_0x51dc70[_0x3f6621(0xd4)][_0x3f6621(0xbc)]+_0x3f6621(0xcc))),console[_0x3f6621(0xc3)](formatValidationResult(_0x51dc70,_0x3d7b71,_0x588840)));}return console['log'](''),_0x284d8f[_0x3f6621(0xb6)]?(console[_0x3f6621(0xc3)](a26_0xe6cef2['red'](_0x3f6621(0xc4)+_0x284d8f[_0x3f6621(0xab)]+_0x3f6621(0xd2)+_0x284d8f['validCount']+_0x3f6621(0xcf))),_0x284d8f[_0x3f6621(0xb3)]>0x0&&console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xad)](_0x284d8f[_0x3f6621(0xb3)]+_0x3f6621(0xbd))),_0x284d8f[_0x3f6621(0xd3)]>0x0&&console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xd1)](_0x284d8f[_0x3f6621(0xd3)]+_0x3f6621(0xda))),0x1):(console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xdd)](_0x3f6621(0xd6)+_0x284d8f[_0x3f6621(0xd5)]+_0x3f6621(0xaf))),_0x284d8f[_0x3f6621(0xb3)]>0x0&&console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xad)](_0x284d8f[_0x3f6621(0xb3)]+_0x3f6621(0xbd))),_0x284d8f['skippedCount']>0x0&&console['log'](a26_0xe6cef2[_0x3f6621(0xd1)](_0x284d8f[_0x3f6621(0xd3)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x538e62=a27_0xe710;(function(_0x461ac7,_0xb038ce){const _0x30c184=a27_0xe710,_0x4fdaa0=_0x461ac7();while(!![]){try{const _0x54fdd7=parseInt(_0x30c184(0x179))/0x1+-parseInt(_0x30c184(0x18b))/0x2+parseInt(_0x30c184(0x199))/0x3+parseInt(_0x30c184(0x1b5))/0x4*(parseInt(_0x30c184(0x189))/0x5)+parseInt(_0x30c184(0x1b2))/0x6+parseInt(_0x30c184(0x194))/0x7+parseInt(_0x30c184(0x191))/0x8*(-parseInt(_0x30c184(0x195))/0x9);if(_0x54fdd7===_0xb038ce)break;else _0x4fdaa0['push'](_0x4fdaa0['shift']());}catch(_0x2fdb47){_0x4fdaa0['push'](_0x4fdaa0['shift']());}}}(a27_0x4e06,0x4c8ea));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a27_0xe710(_0x3dfb92,_0x59cef5){_0x3dfb92=_0x3dfb92-0x176;const _0x4e062e=a27_0x4e06();let _0xe71070=_0x4e062e[_0x3dfb92];return _0xe71070;}import a27_0x58b147 from'chalk';function formatDuration(_0x3dc270){const _0x50ceac=a27_0xe710;if(_0x3dc270<0x3c)return _0x3dc270+'s';if(_0x3dc270<0xe10)return Math['floor'](_0x3dc270/0x3c)+'m\x20'+_0x3dc270%0x3c+'s';const _0x4ee74d=Math[_0x50ceac(0x178)](_0x3dc270/0xe10),_0x141481=Math['floor'](_0x3dc270%0xe10/0x3c);return _0x141481>0x0?_0x4ee74d+'h\x20'+_0x141481+'m':_0x4ee74d+'h';}function formatRelativeTime(_0x3c3668){const _0x2c93a5=a27_0xe710,_0x4dc19e=Date['now']()-_0x3c3668[_0x2c93a5(0x1c3)](),_0x34135a=Math[_0x2c93a5(0x178)](Math[_0x2c93a5(0x1ca)](_0x4dc19e)/0x3e8);if(_0x34135a<0x3c)return _0x2c93a5(0x197);const _0xdafaba=Math[_0x2c93a5(0x178)](_0x34135a/0x3c);if(_0xdafaba<0x3c)return _0xdafaba+'m\x20ago';const _0x13fb37=Math[_0x2c93a5(0x178)](_0xdafaba/0x3c);if(_0x13fb37<0x18)return _0x13fb37+'h\x20ago';const _0x502f71=Math['floor'](_0x13fb37/0x18);if(_0x502f71<0x1e)return _0x502f71+_0x2c93a5(0x1bd);return Math[_0x2c93a5(0x178)](_0x502f71/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']='jobs';[a27_0x538e62(0x1cb)]='List\x20jobs';async['execute'](_0xd8bfb7){const _0x5cd7e0=a27_0x538e62,{options:_0x1c75df,tdx:_0x138951}=_0xd8bfb7,_0x45267b=resolveLimit(_0x1c75df[_0x5cd7e0(0x190)],DEFAULT_DISPLAY_LIMIT),_0x507932=_0x1c75df[_0x5cd7e0(0x19e)];_0x1c75df[_0x5cd7e0(0x1af)]&&(console[_0x5cd7e0(0x188)](_0x5cd7e0(0x1c8)+_0x45267b+'\x20jobs'),_0x507932&&console['error'](_0x5cd7e0(0x1c0)+_0x507932));const _0x27c00b=await withSpinner('Listing\x20jobs...',()=>_0x138951[_0x5cd7e0(0x1ae)][_0x5cd7e0(0x1b7)]({'from':0x0,'to':_0x45267b-0x1,'status':_0x507932}),{'verbose':_0x1c75df['verbose']}),_0x41f5b2=_0x27c00b[_0x5cd7e0(0x182)];console[_0x5cd7e0(0x188)]('✔\x20Found\x20'+_0x41f5b2['length']+_0x5cd7e0(0x1c5)+(_0x41f5b2[_0x5cd7e0(0x19a)]!==0x1?'s':''));const _0x11552a=_0x1c75df[_0x5cd7e0(0x181)];if(isStructuredFormat(_0x1c75df)){const _0x1fa00b=_0x41f5b2['map'](_0x3fa851=>{const _0x2f0e4d=_0x5cd7e0;let _0x4f8f15;if(_0x3fa851[_0x2f0e4d(0x1b8)]&&_0x3fa851['end_at']){const _0x584b9c=new Date(_0x3fa851[_0x2f0e4d(0x1b8)])['getTime'](),_0xa476fb=new Date(_0x3fa851[_0x2f0e4d(0x1ba)])[_0x2f0e4d(0x1c3)]();_0x4f8f15=Math[_0x2f0e4d(0x1b6)]((_0xa476fb-_0x584b9c)/0x3e8);}return{'job_id':_0x3fa851[_0x2f0e4d(0x1ac)],'type':_0x3fa851[_0x2f0e4d(0x19b)]===_0x2f0e4d(0x1ab)?'trino':_0x3fa851['type'],'status':_0x3fa851[_0x2f0e4d(0x19e)],'user_name':_0x3fa851[_0x2f0e4d(0x19c)],'duration_sec':_0x4f8f15,'created_at':_0x3fa851[_0x2f0e4d(0x17f)],'started_at':_0x3fa851['start_at'],'end_at':_0x3fa851[_0x2f0e4d(0x1ba)]};});await handleSDKOutput(_0x1fa00b,_0x1c75df);}else for(const _0x110ca0 of _0x41f5b2){const _0x34cee1=_0x110ca0[_0x5cd7e0(0x19e)]===_0x5cd7e0(0x183)?a27_0x58b147[_0x5cd7e0(0x1c1)]:_0x110ca0['status']===_0x5cd7e0(0x188)?a27_0x58b147[_0x5cd7e0(0x17a)]:a27_0x58b147[_0x5cd7e0(0x17b)],_0x9d48ff=_0x34cee1(_0x110ca0['status']),_0x54150c=getJobUrl(_0x11552a,_0x110ca0[_0x5cd7e0(0x1ac)]),_0x2788de=hyperlink(_0x110ca0[_0x5cd7e0(0x1ac)],_0x54150c),_0x45ff8f=a27_0x58b147[_0x5cd7e0(0x17b)](_0x110ca0[_0x5cd7e0(0x19b)]===_0x5cd7e0(0x1ab)?_0x5cd7e0(0x1be):_0x110ca0[_0x5cd7e0(0x19b)]),_0x297563=[];if(_0x110ca0[_0x5cd7e0(0x1b8)]&&_0x110ca0[_0x5cd7e0(0x1ba)]){const _0x308d69=Math[_0x5cd7e0(0x1b6)]((new Date(_0x110ca0[_0x5cd7e0(0x1ba)])['getTime']()-new Date(_0x110ca0[_0x5cd7e0(0x1b8)])[_0x5cd7e0(0x1c3)]())/0x3e8);_0x297563[_0x5cd7e0(0x19d)](formatDuration(_0x308d69));}if(_0x110ca0[_0x5cd7e0(0x1ba)])_0x297563[_0x5cd7e0(0x19d)](formatRelativeTime(new Date(_0x110ca0[_0x5cd7e0(0x1ba)])));else _0x110ca0[_0x5cd7e0(0x1b8)]&&_0x297563[_0x5cd7e0(0x19d)](formatRelativeTime(new Date(_0x110ca0['start_at'])));const _0x156d13=_0x297563[_0x5cd7e0(0x19a)]>0x0?a27_0x58b147[_0x5cd7e0(0x17b)]('\x20'+_0x297563['join'](',\x20')):'';console[_0x5cd7e0(0x1c7)]('⚡\x20'+_0x2788de+'\x20'+_0x45ff8f+'\x20'+_0x9d48ff+_0x156d13);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x538e62(0x17c)]=a27_0x538e62(0x17e);[a27_0x538e62(0x1cb)]=a27_0x538e62(0x180);[a27_0x538e62(0x177)](_0x2a41fe){const _0x2d452f=a27_0x538e62,_0x4f3c51=_0x2a41fe[_0x2d452f(0x1aa)][0x0];if(!_0x4f3c51)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a27_0x538e62(0x1c6)](_0x57d3ff){const _0x5beba5=a27_0x538e62,{options:_0x27e222,args:_0x5197ea,tdx:_0x3579a1}=_0x57d3ff,_0x48cde7=_0x5197ea[0x0],_0x24335c=await withSpinner(_0x5beba5(0x1a9),()=>_0x3579a1['jobs'][_0x5beba5(0x1ad)](_0x48cde7),{'verbose':_0x27e222[_0x5beba5(0x1af)]}),_0x52a59a=_0x24335c[_0x5beba5(0x182)];let _0x58ddb5;if(_0x52a59a[_0x5beba5(0x1b8)]&&_0x52a59a['end_at']){const _0x5a6c0d=new Date(_0x52a59a[_0x5beba5(0x1b8)])['getTime'](),_0x4eecae=new Date(_0x52a59a[_0x5beba5(0x1ba)])[_0x5beba5(0x1c3)]();_0x58ddb5=Math[_0x5beba5(0x1b6)]((_0x4eecae-_0x5a6c0d)/0x3e8);}const _0x500de6={'job_id':_0x52a59a[_0x5beba5(0x1ac)],'type':_0x52a59a[_0x5beba5(0x19b)],'status':_0x52a59a['status'],..._0x52a59a[_0x5beba5(0x19c)]&&{'user_name':_0x52a59a[_0x5beba5(0x19c)]},..._0x58ddb5!==undefined&&{'duration_sec':_0x58ddb5},..._0x52a59a['created_at']&&{'created_at':_0x52a59a[_0x5beba5(0x17f)]},..._0x52a59a[_0x5beba5(0x1b8)]&&{'started_at':_0x52a59a[_0x5beba5(0x1b8)]},..._0x52a59a[_0x5beba5(0x1ba)]&&{'end_at':_0x52a59a['end_at']},..._0x52a59a[_0x5beba5(0x1b1)]&&{'database':_0x52a59a['database']},..._0x52a59a['priority']!==undefined&&{'priority':_0x52a59a[_0x5beba5(0x1a4)]},..._0x52a59a[_0x5beba5(0x17d)]&&{'url':_0x52a59a['url']},..._0x52a59a[_0x5beba5(0x18d)]&&{'query':_0x52a59a[_0x5beba5(0x18d)]},..._0x52a59a[_0x5beba5(0x1a3)]&&{'debug':_0x52a59a[_0x5beba5(0x1a3)]}};return await handleSingleObjectOutput(_0x500de6,_0x27e222),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x538e62(0x17c)]=a27_0x538e62(0x18f);[a27_0x538e62(0x1cb)]='Kill\x20a\x20job';[a27_0x538e62(0x177)](_0x25cdba){const _0x447d49=a27_0x538e62,_0x25dc24=_0x25cdba[_0x447d49(0x1aa)][0x0];if(!_0x25dc24)return _0x447d49(0x1a2);return undefined;}async[a27_0x538e62(0x1c6)](_0xeb8e2c){const _0x3475ef=a27_0x538e62,{options:_0x1c4950,args:_0x278876,tdx:_0x3abf13}=_0xeb8e2c,_0x47de79=_0x278876[0x0];if(!_0x1c4950[_0x3475ef(0x1c9)]){const _0x5be6cd=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x47de79+'?');if(!_0x5be6cd)return console[_0x3475ef(0x188)](_0x3475ef(0x1b3)),0x0;}return await withSpinner(_0x3475ef(0x1bb),()=>_0x3abf13['jobs'][_0x3475ef(0x18e)](_0x47de79),{'verbose':_0x1c4950[_0x3475ef(0x1af)]}),console[_0x3475ef(0x188)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x47de79),console['error'](_0x3475ef(0x1b9)+_0x47de79+_0x3475ef(0x184)),0x0;}}function a27_0x4e06(){const _0x318120=['Database:\x20','error','575ZBzJyn','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','284216cmDMga','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','query','kill','job:kill','limit','93488BjXyhR','Query:\x20','\x20row','2158163IaUTMH','1332IoXIht','INVALID_ARGUMENT','just\x20now','✔\x20Retrieved\x20','348597UqhAYx','length','type','user_name','push','status','submit','result','job:submit','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','debug','priority','✔\x20Job\x20submitted','Job\x20type:\x20','No\x20SQL\x20statements\x20found\x20in\x20file','Submitting\x20job...','Getting\x20job\x20details...','args','presto','job_id','show','jobs','verbose','substring','database','3597966sdyEiB','Cancelled','job:result','20608OChVSM','round','list','start_at','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','end_at','Submitting\x20kill\x20request...','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','d\x20ago','trino','information_schema','Status\x20filter:\x20','green','hive','getTime','Submit\x20a\x20job','\x20job','execute','log','Limit:\x20','yes','abs','description','Get\x20job\x20results','validate','floor','568565vdKUvP','red','dim','name','url','job:show','created_at','Show\x20job\x20details','site','data','success','\x27\x20to\x20verify\x20the\x20job\x20status','...','\x20\x20Job\x20ID:\x20'];a27_0x4e06=function(){return _0x318120;};return a27_0x4e06();}export class JobSubmitCommand extends BaseCommand{[a27_0x538e62(0x17c)]=a27_0x538e62(0x1a1);[a27_0x538e62(0x1cb)]=a27_0x538e62(0x1c4);async['execute'](_0x239bc6){const _0x297e92=a27_0x538e62,{options:_0x468082,args:_0x4fec58,tdx:_0x39a1b5}=_0x239bc6,_0x657bab=_0x468082['jobType']||_0x297e92(0x1be),_0x3f9247=_0x468082['file'],_0x27ec31=_0x468082[_0x297e92(0x1b1)]||_0x297e92(0x1bf),_0x562de2=_0x468082[_0x297e92(0x1a0)];if(_0x657bab!==_0x297e92(0x1be)&&_0x657bab!==_0x297e92(0x1c2))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x297e92(0x1bc));let _0x15b83d;if(_0x3f9247){if(_0x4fec58[0x0])throw new SDKError(ErrorCode[_0x297e92(0x196)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x1f2dbd=readSqlStatementsFromFile(_0x3f9247);if(_0x1f2dbd[_0x297e92(0x19a)]===0x0)throw new SDKError(ErrorCode[_0x297e92(0x196)],_0x297e92(0x1a7));if(_0x1f2dbd[_0x297e92(0x19a)]>0x1)throw new SDKError(ErrorCode[_0x297e92(0x196)],_0x297e92(0x18a));_0x15b83d=_0x1f2dbd[0x0];}else{if(!_0x4fec58[0x0])throw new SDKError(ErrorCode[_0x297e92(0x196)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x15b83d=_0x4fec58[0x0];}_0x468082[_0x297e92(0x1af)]&&(console['error'](_0x297e92(0x1a6)+_0x657bab),console[_0x297e92(0x188)](_0x297e92(0x187)+_0x27ec31),console[_0x297e92(0x188)](_0x297e92(0x192)+_0x15b83d[_0x297e92(0x1b0)](0x0,0x64)+(_0x15b83d[_0x297e92(0x19a)]>0x64?_0x297e92(0x185):'')));const _0x3d336a=await withSpinner(_0x297e92(0x1a8),()=>_0x39a1b5[_0x297e92(0x1ae)][_0x297e92(0x19f)](_0x27ec31,_0x15b83d,_0x657bab,_0x562de2),{'verbose':_0x468082['verbose']}),_0x394890=_0x3d336a[_0x297e92(0x182)];return console['error'](_0x297e92(0x1a5)),console['error'](_0x297e92(0x186)+_0x394890['job_id']),await handleSDKOutput([_0x394890],_0x468082),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a27_0x538e62(0x1b4);[a27_0x538e62(0x1cb)]=a27_0x538e62(0x176);[a27_0x538e62(0x177)](_0x2b685c){const _0x4c38ec=a27_0x538e62,_0x1c15c3=_0x2b685c[_0x4c38ec(0x1aa)][0x0];if(!_0x1c15c3)return _0x4c38ec(0x18c);return undefined;}async[a27_0x538e62(0x1c6)](_0x37ea76){const _0x3a2f0f=a27_0x538e62,{options:_0x17e0a0,args:_0x21acdc,tdx:_0x577f75}=_0x37ea76,_0x41fec5=_0x21acdc[0x0],_0x297042=await withSpinner('Getting\x20job\x20results...',()=>_0x577f75[_0x3a2f0f(0x1ae)]['result'](_0x41fec5),{'verbose':_0x17e0a0[_0x3a2f0f(0x1af)]}),_0x1ddcee=_0x297042['data'];return console[_0x3a2f0f(0x188)](_0x3a2f0f(0x198)+_0x1ddcee[_0x3a2f0f(0x19a)]+_0x3a2f0f(0x193)+(_0x1ddcee[_0x3a2f0f(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x1ddcee,_0x17e0a0),0x0;}}
|
|
1
|
+
const a27_0x3dfdcc=a27_0x2ad4;(function(_0x413557,_0x269def){const _0x4e0813=a27_0x2ad4,_0x114594=_0x413557();while(!![]){try{const _0x30c528=-parseInt(_0x4e0813(0x191))/0x1+parseInt(_0x4e0813(0x1ad))/0x2*(parseInt(_0x4e0813(0x1b8))/0x3)+parseInt(_0x4e0813(0x188))/0x4*(parseInt(_0x4e0813(0x1b5))/0x5)+parseInt(_0x4e0813(0x184))/0x6*(parseInt(_0x4e0813(0x19e))/0x7)+-parseInt(_0x4e0813(0x187))/0x8*(-parseInt(_0x4e0813(0x19c))/0x9)+-parseInt(_0x4e0813(0x1a9))/0xa+-parseInt(_0x4e0813(0x1c4))/0xb;if(_0x30c528===_0x269def)break;else _0x114594['push'](_0x114594['shift']());}catch(_0x299b28){_0x114594['push'](_0x114594['shift']());}}}(a27_0x217e,0x51f26));import{BaseCommand}from'./command.js';function a27_0x2ad4(_0x436b10,_0x4d0ff7){_0x436b10=_0x436b10-0x170;const _0x217e72=a27_0x217e();let _0x2ad4a6=_0x217e72[_0x436b10];return _0x2ad4a6;}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_0x3467e6 from'chalk';function formatDuration(_0x2414c4){const _0x3564d7=a27_0x2ad4;if(_0x2414c4<0x3c)return _0x2414c4+'s';if(_0x2414c4<0xe10)return Math[_0x3564d7(0x1b1)](_0x2414c4/0x3c)+'m\x20'+_0x2414c4%0x3c+'s';const _0x3b2faa=Math['floor'](_0x2414c4/0xe10),_0x350d0f=Math[_0x3564d7(0x1b1)](_0x2414c4%0xe10/0x3c);return _0x350d0f>0x0?_0x3b2faa+'h\x20'+_0x350d0f+'m':_0x3b2faa+'h';}function formatRelativeTime(_0x358d5e){const _0x2c0980=a27_0x2ad4,_0x25b220=Date[_0x2c0980(0x17a)]()-_0x358d5e[_0x2c0980(0x1a4)](),_0x49fe0d=Math[_0x2c0980(0x1b1)](Math[_0x2c0980(0x174)](_0x25b220)/0x3e8);if(_0x49fe0d<0x3c)return _0x2c0980(0x170);const _0x232c47=Math['floor'](_0x49fe0d/0x3c);if(_0x232c47<0x3c)return _0x232c47+'m\x20ago';const _0x3479c0=Math[_0x2c0980(0x1b1)](_0x232c47/0x3c);if(_0x3479c0<0x18)return _0x3479c0+_0x2c0980(0x17c);const _0xfd808b=Math[_0x2c0980(0x1b1)](_0x3479c0/0x18);if(_0xfd808b<0x1e)return _0xfd808b+'d\x20ago';return Math[_0x2c0980(0x1b1)](_0xfd808b/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]=a27_0x3dfdcc(0x193);['description']=a27_0x3dfdcc(0x192);async[a27_0x3dfdcc(0x1b6)](_0x3e214f){const _0x1c7619=a27_0x3dfdcc,{options:_0x37ec34,tdx:_0xd7f9fb}=_0x3e214f,_0x1cdc94=resolveLimit(_0x37ec34[_0x1c7619(0x1aa)],DEFAULT_DISPLAY_LIMIT),_0x45d1e9=_0x37ec34[_0x1c7619(0x171)];_0x37ec34[_0x1c7619(0x199)]&&(console[_0x1c7619(0x1a1)]('Limit:\x20'+_0x1cdc94+'\x20jobs'),_0x45d1e9&&console[_0x1c7619(0x1a1)](_0x1c7619(0x1bc)+_0x45d1e9));const _0x10f783=await withSpinner(_0x1c7619(0x18d),()=>_0xd7f9fb[_0x1c7619(0x193)][_0x1c7619(0x176)]({'from':0x0,'to':_0x1cdc94-0x1,'status':_0x45d1e9}),{'verbose':_0x37ec34[_0x1c7619(0x199)]}),_0x2f7965=_0x10f783[_0x1c7619(0x1a2)];console[_0x1c7619(0x1a1)]('✔\x20Found\x20'+_0x2f7965['length']+'\x20job'+(_0x2f7965[_0x1c7619(0x1b2)]!==0x1?'s':''));const _0x29bd6d=_0x37ec34[_0x1c7619(0x189)];if(isStructuredFormat(_0x37ec34)){const _0x5e9084=_0x2f7965[_0x1c7619(0x1c0)](_0xed9585=>{const _0x4a0850=_0x1c7619;let _0x47066c;if(_0xed9585[_0x4a0850(0x186)]&&_0xed9585['end_at']){const _0x3d7b1e=new Date(_0xed9585[_0x4a0850(0x186)])[_0x4a0850(0x1a4)](),_0xf672b5=new Date(_0xed9585['end_at'])[_0x4a0850(0x1a4)]();_0x47066c=Math[_0x4a0850(0x18b)]((_0xf672b5-_0x3d7b1e)/0x3e8);}return{'job_id':_0xed9585[_0x4a0850(0x1a6)],'type':_0xed9585[_0x4a0850(0x1be)]===_0x4a0850(0x172)?_0x4a0850(0x1bb):_0xed9585[_0x4a0850(0x1be)],'status':_0xed9585[_0x4a0850(0x171)],'user_name':_0xed9585[_0x4a0850(0x1ba)],'duration_sec':_0x47066c,'created_at':_0xed9585['created_at'],'started_at':_0xed9585[_0x4a0850(0x186)],'end_at':_0xed9585[_0x4a0850(0x179)]};});await handleSDKOutput(_0x5e9084,_0x37ec34);}else for(const _0x1839dc of _0x2f7965){const _0xd27cc6=_0x1839dc[_0x1c7619(0x171)]===_0x1c7619(0x175)?a27_0x3467e6[_0x1c7619(0x198)]:_0x1839dc[_0x1c7619(0x171)]===_0x1c7619(0x1a1)?a27_0x3467e6[_0x1c7619(0x1af)]:a27_0x3467e6[_0x1c7619(0x1bf)],_0x18bb5b=_0xd27cc6(_0x1839dc[_0x1c7619(0x171)]),_0x1eaf84=getJobUrl(_0x29bd6d,_0x1839dc[_0x1c7619(0x1a6)]),_0x401fba=hyperlink(_0x1839dc[_0x1c7619(0x1a6)],_0x1eaf84),_0x44236e=a27_0x3467e6[_0x1c7619(0x1bf)](_0x1839dc[_0x1c7619(0x1be)]===_0x1c7619(0x172)?_0x1c7619(0x1bb):_0x1839dc[_0x1c7619(0x1be)]),_0x4aa0a7=[];if(_0x1839dc[_0x1c7619(0x186)]&&_0x1839dc[_0x1c7619(0x179)]){const _0x1ff89c=Math[_0x1c7619(0x18b)]((new Date(_0x1839dc[_0x1c7619(0x179)])[_0x1c7619(0x1a4)]()-new Date(_0x1839dc[_0x1c7619(0x186)])[_0x1c7619(0x1a4)]())/0x3e8);_0x4aa0a7[_0x1c7619(0x1ae)](formatDuration(_0x1ff89c));}if(_0x1839dc[_0x1c7619(0x179)])_0x4aa0a7[_0x1c7619(0x1ae)](formatRelativeTime(new Date(_0x1839dc[_0x1c7619(0x179)])));else _0x1839dc['start_at']&&_0x4aa0a7[_0x1c7619(0x1ae)](formatRelativeTime(new Date(_0x1839dc[_0x1c7619(0x186)])));const _0x2b752e=_0x4aa0a7[_0x1c7619(0x1b2)]>0x0?a27_0x3467e6['dim']('\x20'+_0x4aa0a7[_0x1c7619(0x1b9)](',\x20')):'';console[_0x1c7619(0x1a7)]('⚡\x20'+_0x401fba+'\x20'+_0x44236e+'\x20'+_0x18bb5b+_0x2b752e);}return 0x0;}}function a27_0x217e(){const _0x33f514=['just\x20now','status','presto','database','abs','success','list','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Getting\x20job\x20details...','end_at','now','Database:\x20','h\x20ago','jobType','Show\x20job\x20details','\x20\x20Job\x20ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Submitting\x20kill\x20request...','description','show','722754Gjebgo','job:kill','start_at','152rNVctn','1099108DJtCIT','site','hive','round','Submit\x20a\x20job','Listing\x20jobs...','Kill\x20a\x20job','query','\x27\x20to\x20verify\x20the\x20job\x20status','172920lyXjeI','List\x20jobs','jobs','Job\x20type:\x20','priority','Get\x20job\x20results','yes','green','verbose','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','debug','163341nAAudm','url','7ZllXvl','args','information_schema','error','data','Submitting\x20job...','getTime','validate','job_id','log','result','1892160MqymwM','limit','INVALID_ARGUMENT','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','2ROelUM','push','red','name','floor','length','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','...','10zsCBjT','execute','job:result','1859961uZobeX','join','user_name','trino','Status\x20filter:\x20','kill','type','dim','map','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','file','job:show','10307451IOcBXi'];a27_0x217e=function(){return _0x33f514;};return a27_0x217e();}export class JobShowCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]=a27_0x3dfdcc(0x1c3);[a27_0x3dfdcc(0x182)]=a27_0x3dfdcc(0x17e);[a27_0x3dfdcc(0x1a5)](_0x37b583){const _0x390241=a27_0x3dfdcc,_0x2d5a1b=_0x37b583[_0x390241(0x19f)][0x0];if(!_0x2d5a1b)return _0x390241(0x1b3);return undefined;}async['execute'](_0x5b85a8){const _0x32ad6a=a27_0x3dfdcc,{options:_0x5bbf7a,args:_0x1bc6f8,tdx:_0x30f26c}=_0x5b85a8,_0x3cc446=_0x1bc6f8[0x0],_0x436454=await withSpinner(_0x32ad6a(0x178),()=>_0x30f26c[_0x32ad6a(0x193)][_0x32ad6a(0x183)](_0x3cc446),{'verbose':_0x5bbf7a[_0x32ad6a(0x199)]}),_0x396116=_0x436454[_0x32ad6a(0x1a2)];let _0x4bdb51;if(_0x396116['start_at']&&_0x396116[_0x32ad6a(0x179)]){const _0x29f301=new Date(_0x396116[_0x32ad6a(0x186)])[_0x32ad6a(0x1a4)](),_0x4e0492=new Date(_0x396116[_0x32ad6a(0x179)])[_0x32ad6a(0x1a4)]();_0x4bdb51=Math[_0x32ad6a(0x18b)]((_0x4e0492-_0x29f301)/0x3e8);}const _0xc4db9e={'job_id':_0x396116[_0x32ad6a(0x1a6)],'type':_0x396116['type'],'status':_0x396116[_0x32ad6a(0x171)],..._0x396116[_0x32ad6a(0x1ba)]&&{'user_name':_0x396116[_0x32ad6a(0x1ba)]},..._0x4bdb51!==undefined&&{'duration_sec':_0x4bdb51},..._0x396116['created_at']&&{'created_at':_0x396116['created_at']},..._0x396116[_0x32ad6a(0x186)]&&{'started_at':_0x396116['start_at']},..._0x396116['end_at']&&{'end_at':_0x396116[_0x32ad6a(0x179)]},..._0x396116[_0x32ad6a(0x173)]&&{'database':_0x396116[_0x32ad6a(0x173)]},..._0x396116[_0x32ad6a(0x195)]!==undefined&&{'priority':_0x396116[_0x32ad6a(0x195)]},..._0x396116[_0x32ad6a(0x19d)]&&{'url':_0x396116[_0x32ad6a(0x19d)]},..._0x396116[_0x32ad6a(0x18f)]&&{'query':_0x396116[_0x32ad6a(0x18f)]},..._0x396116[_0x32ad6a(0x19b)]&&{'debug':_0x396116['debug']}};return await handleSingleObjectOutput(_0xc4db9e,_0x5bbf7a),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]=a27_0x3dfdcc(0x185);['description']=a27_0x3dfdcc(0x18e);[a27_0x3dfdcc(0x1a5)](_0x3b1c5f){const _0x2e3a4f=a27_0x3dfdcc,_0x50d8fb=_0x3b1c5f[_0x2e3a4f(0x19f)][0x0];if(!_0x50d8fb)return _0x2e3a4f(0x1c1);return undefined;}async[a27_0x3dfdcc(0x1b6)](_0x2b4134){const _0x34967b=a27_0x3dfdcc,{options:_0x435d4f,args:_0x16588d,tdx:_0x531c1b}=_0x2b4134,_0x4e725c=_0x16588d[0x0];if(!_0x435d4f[_0x34967b(0x197)]){const _0x317c40=await confirm(_0x34967b(0x180)+_0x4e725c+'?');if(!_0x317c40)return console[_0x34967b(0x1a1)]('Cancelled'),0x0;}return await withSpinner(_0x34967b(0x181),()=>_0x531c1b[_0x34967b(0x193)][_0x34967b(0x1bd)](_0x4e725c),{'verbose':_0x435d4f[_0x34967b(0x199)]}),console[_0x34967b(0x1a1)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x4e725c),console[_0x34967b(0x1a1)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x4e725c+_0x34967b(0x190)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]='job:submit';['description']=a27_0x3dfdcc(0x18c);async[a27_0x3dfdcc(0x1b6)](_0x530d06){const _0x3e6930=a27_0x3dfdcc,{options:_0x28cc18,args:_0x824e23,tdx:_0x1e6683}=_0x530d06,_0x14c90e=_0x28cc18[_0x3e6930(0x17d)]||'trino',_0xda0bae=_0x28cc18[_0x3e6930(0x1c2)],_0x13a74f=_0x28cc18[_0x3e6930(0x173)]||_0x3e6930(0x1a0),_0x27f17c=_0x28cc18[_0x3e6930(0x1a8)];if(_0x14c90e!==_0x3e6930(0x1bb)&&_0x14c90e!==_0x3e6930(0x18a))throw new SDKError(ErrorCode[_0x3e6930(0x1ab)],_0x3e6930(0x1ac));let _0x586cf5;if(_0xda0bae){if(_0x824e23[0x0])throw new SDKError(ErrorCode[_0x3e6930(0x1ab)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x160507=readSqlStatementsFromFile(_0xda0bae);if(_0x160507[_0x3e6930(0x1b2)]===0x0)throw new SDKError(ErrorCode[_0x3e6930(0x1ab)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x160507['length']>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3e6930(0x177));_0x586cf5=_0x160507[0x0];}else{if(!_0x824e23[0x0])throw new SDKError(ErrorCode[_0x3e6930(0x1ab)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x586cf5=_0x824e23[0x0];}_0x28cc18[_0x3e6930(0x199)]&&(console[_0x3e6930(0x1a1)](_0x3e6930(0x194)+_0x14c90e),console[_0x3e6930(0x1a1)](_0x3e6930(0x17b)+_0x13a74f),console[_0x3e6930(0x1a1)]('Query:\x20'+_0x586cf5['substring'](0x0,0x64)+(_0x586cf5['length']>0x64?_0x3e6930(0x1b4):'')));const _0xb46ef9=await withSpinner(_0x3e6930(0x1a3),()=>_0x1e6683['jobs']['submit'](_0x13a74f,_0x586cf5,_0x14c90e,_0x27f17c),{'verbose':_0x28cc18[_0x3e6930(0x199)]}),_0x11c838=_0xb46ef9[_0x3e6930(0x1a2)];return console[_0x3e6930(0x1a1)]('✔\x20Job\x20submitted'),console[_0x3e6930(0x1a1)](_0x3e6930(0x17f)+_0x11c838['job_id']),await handleSDKOutput([_0x11c838],_0x28cc18),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]=a27_0x3dfdcc(0x1b7);[a27_0x3dfdcc(0x182)]=a27_0x3dfdcc(0x196);[a27_0x3dfdcc(0x1a5)](_0x2fb187){const _0x258016=a27_0x3dfdcc,_0x56351b=_0x2fb187[_0x258016(0x19f)][0x0];if(!_0x56351b)return _0x258016(0x19a);return undefined;}async[a27_0x3dfdcc(0x1b6)](_0x2f7b2d){const _0x157bee=a27_0x3dfdcc,{options:_0x3c533c,args:_0x4917dc,tdx:_0x4b2428}=_0x2f7b2d,_0x57c96a=_0x4917dc[0x0],_0x171f15=await withSpinner('Getting\x20job\x20results...',()=>_0x4b2428['jobs'][_0x157bee(0x1a8)](_0x57c96a),{'verbose':_0x3c533c['verbose']}),_0x3a7f9f=_0x171f15[_0x157bee(0x1a2)];return console[_0x157bee(0x1a1)]('✔\x20Retrieved\x20'+_0x3a7f9f[_0x157bee(0x1b2)]+'\x20row'+(_0x3a7f9f[_0x157bee(0x1b2)]!==0x1?'s':'')),await handleSDKOutput(_0x3a7f9f,_0x3c533c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a28_0x31317c=a28_0x25a9;(function(_0x32a864,_0x45a355){const _0x57d2df=a28_0x25a9,_0x39085f=_0x32a864();while(!![]){try{const _0x13f430=-parseInt(_0x57d2df(0x236))/0x1*(-parseInt(_0x57d2df(0x1ab))/0x2)+parseInt(_0x57d2df(0x1e1))/0x3*(-parseInt(_0x57d2df(0x1df))/0x4)+-parseInt(_0x57d2df(0x198))/0x5+parseInt(_0x57d2df(0x20b))/0x6+-parseInt(_0x57d2df(0x24a))/0x7+-parseInt(_0x57d2df(0x1f6))/0x8+parseInt(_0x57d2df(0x254))/0x9*(parseInt(_0x57d2df(0x25c))/0xa);if(_0x13f430===_0x45a355)break;else _0x39085f['push'](_0x39085f['shift']());}catch(_0x43aeb5){_0x39085f['push'](_0x39085f['shift']());}}}(a28_0x5210,0xb615e));import a28_0x1f6c69 from'chalk';import a28_0x1d6b5c from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x25a9(_0x325915,_0x2892f1){_0x325915=_0x325915-0x17a;const _0x521058=a28_0x5210();let _0x25a9e4=_0x521058[_0x325915];return _0x25a9e4;}import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x55f7e2){const _0x593bfb=a28_0x25a9;return!_0x55f7e2&&(console[_0x593bfb(0x204)](_0x593bfb(0x269)),console[_0x593bfb(0x204)](_0x593bfb(0x266))),!!_0x55f7e2;}function withJsonFormat(_0x374c3c){const _0x1cde84=a28_0x25a9;if(!_0x374c3c[_0x1cde84(0x250)]&&!_0x374c3c[_0x1cde84(0x223)]&&!_0x374c3c[_0x1cde84(0x1ed)]&&!_0x374c3c[_0x1cde84(0x226)])return{..._0x374c3c,'format':_0x1cde84(0x223),'json':!![]};return _0x374c3c;}function formatJourneyState(_0x1870d6){const _0x417bd1=a28_0x25a9;switch(_0x1870d6){case _0x417bd1(0x1dc):return a28_0x1f6c69['green'](_0x417bd1(0x1ff));case _0x417bd1(0x233):return a28_0x1f6c69[_0x417bd1(0x218)](_0x417bd1(0x1f7));case _0x417bd1(0x26d):return a28_0x1f6c69[_0x417bd1(0x271)](_0x417bd1(0x255));case _0x417bd1(0x17c):return a28_0x1f6c69[_0x417bd1(0x279)](_0x417bd1(0x1af));case _0x417bd1(0x265):return a28_0x1f6c69[_0x417bd1(0x218)]('(archived)');default:return'('+_0x1870d6+')';}}function formatJourneyItem(_0x12160a,_0x3d1407='',_0x481e91){const _0x377956=a28_0x25a9,_0x48b69a=formatJourneyState(_0x12160a['state']),_0x9d9126=_0x481e91?hyperlink(_0x12160a[_0x377956(0x1e7)],_0x481e91):_0x12160a['journeyBundleName'];return _0x3d1407+_0x377956(0x26f)+_0x9d9126+'\x20'+_0x48b69a;}function escapeRegex(_0x3e7638){const _0x1aac4a=a28_0x25a9;return _0x3e7638[_0x1aac4a(0x287)](/[.*+?^${}()|[\]\\]/g,_0x1aac4a(0x207));}function globToRegex(_0x36b243){const _0x2e5333=a28_0x25a9,_0x157597=_0x36b243[_0x2e5333(0x231)]('*')[_0x2e5333(0x185)](escapeRegex);return new RegExp(_0x157597[_0x2e5333(0x1c7)]('.*'),'i');}function buildRuleToNameMapping(_0x1b6bbd){const _0x6fb065=a28_0x25a9,_0x2c73de=new Map();if(_0x1b6bbd[_0x6fb065(0x1be)])for(const [_0x237cab,_0x37e4f0]of Object[_0x6fb065(0x208)](_0x1b6bbd['segments'])){if(_0x37e4f0[_0x6fb065(0x1f8)]){const _0x111b7e=serializeRule(_0x37e4f0[_0x6fb065(0x1f8)]),_0x3a955b=_0x2c73de[_0x6fb065(0x242)](_0x111b7e);_0x3a955b?_0x3a955b[_0x6fb065(0x1ce)](_0x237cab):_0x2c73de['set'](_0x111b7e,[_0x237cab]);}}return _0x2c73de;}async function resolveJourneyIdFromInput(_0x248f7a,_0x475729,_0x525555){const _0x3ed0bc=a28_0x25a9,_0x5ca387=await resolveJourneyTarget(_0x248f7a,_0x475729[_0x3ed0bc(0x280)],_0x475729[_0x3ed0bc(0x26c)]),_0xfa1992=_0x5ca387[_0x3ed0bc(0x280)];if(!_0xfa1992)throw new SDKError(ErrorCode[_0x3ed0bc(0x17d)],_0x3ed0bc(0x1a8));const _0x45151a=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x525555[_0x3ed0bc(0x275)][_0x3ed0bc(0x22e)](_0xfa1992),{'verbose':_0x475729[_0x3ed0bc(0x26c)]}),_0x204611=_0x45151a[_0x3ed0bc(0x21d)],_0x2c397a=await withSpinner(_0x3ed0bc(0x1a3),()=>_0x525555[_0x3ed0bc(0x18d)][_0x3ed0bc(0x18b)](_0x204611,_0x5ca387[_0x3ed0bc(0x1bc)]),{'verbose':_0x475729[_0x3ed0bc(0x26c)]});return{'journeyId':_0x2c397a[_0x3ed0bc(0x21d)],'journeyName':_0x5ca387[_0x3ed0bc(0x1bc)],'parentSegmentId':_0x204611};}async function resolveJourneyTarget(_0x33dd70,_0x597d38,_0x239fb9){const _0x4218a3=a28_0x25a9;if(isYamlFilePath(_0x33dd70))try{const _0x2c7509=await resolveYamlFilePath(_0x33dd70);return _0x239fb9&&(console[_0x4218a3(0x204)](_0x4218a3(0x22c)+_0x33dd70),console[_0x4218a3(0x204)]('\x20\x20Parent\x20segment:\x20'+_0x2c7509['parentSegment']),console[_0x4218a3(0x204)](_0x4218a3(0x245)+_0x2c7509[_0x4218a3(0x237)]),console[_0x4218a3(0x204)](_0x4218a3(0x1c5)+(_0x2c7509[_0x4218a3(0x1ae)]||_0x4218a3(0x1d5)))),{'journeyName':_0x2c7509[_0x4218a3(0x237)],'parentSegment':_0x2c7509[_0x4218a3(0x280)],'resolved':_0x2c7509};}catch(_0x4a8091){throw new SDKError(ErrorCode[_0x4218a3(0x17d)],_0x4218a3(0x20c)+_0x4a8091['message']);}if(!_0x597d38)throw new SDKError(ErrorCode[_0x4218a3(0x17d)],_0x4218a3(0x212));return{'journeyName':_0x33dd70,'parentSegment':_0x597d38};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a28_0x31317c(0x1d3)]=a28_0x31317c(0x184);async['execute'](_0x266eb6){const _0x20c8c6=a28_0x31317c,{options:_0x221168,args:_0x39fd86,tdx:_0x3093d4}=_0x266eb6,_0x206102=_0x39fd86[0x0],_0x4d6a03=_0x221168[_0x20c8c6(0x280)];if(!_0x4d6a03)return console['error'](_0x20c8c6(0x1c1)),console[_0x20c8c6(0x204)](_0x20c8c6(0x202)),0x1;const _0x5e8358=await withSpinner(_0x20c8c6(0x276),()=>_0x3093d4[_0x20c8c6(0x275)][_0x20c8c6(0x22e)](_0x4d6a03),{'verbose':_0x221168[_0x20c8c6(0x26c)]}),_0x38ee79=_0x5e8358[_0x20c8c6(0x21d)];_0x221168[_0x20c8c6(0x26c)]&&(console[_0x20c8c6(0x204)]('Parent\x20segment:\x20'+_0x4d6a03+_0x20c8c6(0x205)+_0x38ee79+')'),_0x206102&&console[_0x20c8c6(0x204)](_0x20c8c6(0x1a4)+_0x206102));const _0x1fe600=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x3093d4[_0x20c8c6(0x275)][_0x20c8c6(0x1bd)](_0x38ee79),{'verbose':_0x221168[_0x20c8c6(0x26c)]}),_0x74e391=_0x1fe600[_0x20c8c6(0x21d)],_0x40b6ca=_0x74e391['rootFolderId'],_0x25389e=await withSpinner('Listing\x20journeys...',()=>_0x3093d4[_0x20c8c6(0x18d)][_0x20c8c6(0x211)](_0x38ee79,_0x40b6ca),{'verbose':_0x221168[_0x20c8c6(0x26c)]});let _0xf7d6d=_0x25389e[_0x20c8c6(0x21d)][_0x20c8c6(0x209)];const _0x322447=_0x25389e[_0x20c8c6(0x21d)][_0x20c8c6(0x1bb)],_0x9d2869=new Map();for(const _0x2eeeb9 of _0x322447){_0x9d2869[_0x20c8c6(0x199)](_0x2eeeb9['id'],_0x2eeeb9[_0x20c8c6(0x19e)]);}if(_0x206102){const _0x44a113=globToRegex(_0x206102);_0xf7d6d=_0xf7d6d['filter'](_0x2e3e5f=>_0x44a113[_0x20c8c6(0x1db)](_0x2e3e5f['journeyBundleName']));}console['error']('✔\x20Found\x20'+_0xf7d6d['length']+_0x20c8c6(0x22a)+(_0xf7d6d['length']!==0x1?'s':''));const _0x2fc76d=_0x399886=>{const _0x2d1c9e=_0x20c8c6;return getConsoleNextUrl(_0x221168[_0x2d1c9e(0x1cc)],_0x2d1c9e(0x22b)+_0x38ee79+'/e/'+_0x399886+_0x2d1c9e(0x1e9));};if(_0x221168['format']===_0x20c8c6(0x19d))await handleSDKOutput(_0xf7d6d,_0x221168);else{if(_0x221168[_0x20c8c6(0x250)]===_0x20c8c6(0x223)){const _0x2bc948=_0xf7d6d[_0x20c8c6(0x185)](_0x243726=>({..._0x243726,'url':_0x2fc76d(_0x243726['id'])}));await handleSDKOutput(_0x2bc948,_0x221168);}else{console['log']('['+_0x4d6a03+']');const _0x1f2935=new Map(),_0x151b14=[];for(const _0x285d9e of _0xf7d6d){if(!_0x285d9e['folderId']||_0x285d9e[_0x20c8c6(0x1f1)]===_0x40b6ca)_0x151b14[_0x20c8c6(0x1ce)](_0x285d9e);else{const _0x3175b4=_0x1f2935[_0x20c8c6(0x242)](_0x285d9e[_0x20c8c6(0x1f1)])||[];_0x3175b4['push'](_0x285d9e),_0x1f2935[_0x20c8c6(0x199)](_0x285d9e[_0x20c8c6(0x1f1)],_0x3175b4);}}const _0x4ef6fc=(_0x3a2d04,_0x5c1c06)=>_0x3a2d04[_0x20c8c6(0x1e7)][_0x20c8c6(0x1de)](_0x5c1c06[_0x20c8c6(0x1e7)],undefined,{'sensitivity':_0x20c8c6(0x230)});_0x151b14['sort'](_0x4ef6fc);for(const _0xe3bbf7 of _0x151b14){console[_0x20c8c6(0x229)](formatJourneyItem(_0xe3bbf7,'',_0x2fc76d(_0xe3bbf7['id'])));}const _0x5c3535=[..._0x1f2935[_0x20c8c6(0x208)]()][_0x20c8c6(0x238)]((_0x14aa44,_0x94c09f)=>{const _0x3358ef=_0x20c8c6,_0x4b5dab=_0x9d2869[_0x3358ef(0x242)](_0x14aa44[0x0])||_0x14aa44[0x0],_0x558012=_0x9d2869[_0x3358ef(0x242)](_0x94c09f[0x0])||_0x94c09f[0x0];return _0x4b5dab[_0x3358ef(0x1de)](_0x558012,undefined,{'sensitivity':_0x3358ef(0x230)});});for(const [_0x1b6e2e,_0x22b3db]of _0x5c3535){const _0x1bf15b=_0x9d2869[_0x20c8c6(0x242)](_0x1b6e2e)||_0x1b6e2e;console[_0x20c8c6(0x229)]('📁\x20'+_0x1bf15b),_0x22b3db['sort'](_0x4ef6fc);for(const _0x20a9a1 of _0x22b3db){console[_0x20c8c6(0x229)](formatJourneyItem(_0x20a9a1,'\x20\x20',_0x2fc76d(_0x20a9a1['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x31317c(0x19e)]=a28_0x31317c(0x1e3);[a28_0x31317c(0x1d3)]=a28_0x31317c(0x277);async[a28_0x31317c(0x1d6)](_0x1009f2){const _0x52b9ff=a28_0x31317c,{options:_0x1fcfde,args:_0x4ef1cc,tdx:_0x89c6c3}=_0x1009f2,_0x510e7c=_0x4ef1cc[0x0];if(!_0x510e7c)return console[_0x52b9ff(0x204)](_0x52b9ff(0x269)),console[_0x52b9ff(0x204)](_0x52b9ff(0x19b)),console[_0x52b9ff(0x204)](_0x52b9ff(0x1b7)),console[_0x52b9ff(0x204)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x1fcfde[_0x52b9ff(0x26c)]&&console[_0x52b9ff(0x204)](_0x52b9ff(0x1c0)+_0x510e7c);const {journeyId:_0x1b4fb9,parentSegmentId:_0x1d22bb}=await resolveJourneyIdFromInput(_0x510e7c,_0x1fcfde,_0x89c6c3);if(_0x1fcfde[_0x52b9ff(0x26b)]){const _0x58db73=getConsoleNextUrl(_0x1fcfde[_0x52b9ff(0x1cc)],'/app/ps/'+_0x1d22bb+_0x52b9ff(0x27d)+_0x1b4fb9+_0x52b9ff(0x21a));return console[_0x52b9ff(0x204)](a28_0x1f6c69[_0x52b9ff(0x214)]('✔')+'\x20Opening\x20'+a28_0x1f6c69[_0x52b9ff(0x240)](_0x58db73)),openBrowser(_0x58db73),0x0;}const _0x2e421c=await withSpinner(_0x52b9ff(0x1e0),()=>_0x89c6c3[_0x52b9ff(0x18d)][_0x52b9ff(0x252)](_0x1b4fb9),{'verbose':_0x1fcfde[_0x52b9ff(0x26c)]}),_0x184649=_0x2e421c[_0x52b9ff(0x21d)],_0x43efbc=_0x1fcfde[_0x52b9ff(0x243)];let _0x67f65e;if(_0x43efbc)try{const _0x58fe5b=await withSpinner(_0x52b9ff(0x1cb),()=>_0x89c6c3[_0x52b9ff(0x18d)]['getStatistics'](_0x1b4fb9),{'verbose':_0x1fcfde[_0x52b9ff(0x26c)]});_0x67f65e=_0x58fe5b[_0x52b9ff(0x21d)];}catch{_0x1fcfde['verbose']&&console['error'](_0x52b9ff(0x24b));}const _0x209485=getConsoleNextUrl(_0x1fcfde[_0x52b9ff(0x1cc)],_0x52b9ff(0x22b)+_0x1d22bb+_0x52b9ff(0x27d)+_0x1b4fb9+_0x52b9ff(0x21a)),_0x360ac8={'id':_0x184649['id'],'name':_0x184649[_0x52b9ff(0x235)]['name'],'description':_0x184649[_0x52b9ff(0x235)][_0x52b9ff(0x1d3)],'state':_0x184649['attributes'][_0x52b9ff(0x220)],'paused':_0x184649[_0x52b9ff(0x235)]['paused'],'reentry_mode':_0x184649[_0x52b9ff(0x235)][_0x52b9ff(0x18f)],'stages':_0x184649[_0x52b9ff(0x235)]['journeyStages']?.[_0x52b9ff(0x26e)]||0x0,..._0x184649[_0x52b9ff(0x235)]['goal']&&{'goal':_0x184649[_0x52b9ff(0x235)][_0x52b9ff(0x270)]['name']},..._0x67f65e&&{'statistics':{'size':_0x67f65e[_0x52b9ff(0x25d)],'entered':_0x67f65e[_0x52b9ff(0x249)],'goal_achieved':_0x67f65e['goalSize'],'completion_rate':_0x67f65e['completionRate'],'exit_or_jump':_0x67f65e['exitOrJumpSize'],'exit_or_jump_rate':_0x67f65e[_0x52b9ff(0x182)],'stages':_0x67f65e[_0x52b9ff(0x1ad)]}},'url':_0x209485};return await handleSingleObjectOutput(_0x360ac8,_0x1fcfde),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x31317c(0x19e)]=a28_0x31317c(0x23b);[a28_0x31317c(0x1d3)]=a28_0x31317c(0x17f);async[a28_0x31317c(0x1d6)](_0x3a958f){const _0x316b76=a28_0x31317c,{options:_0x183a05,args:_0x45fdc4,tdx:_0x4685cc}=_0x3a958f,_0x501df3=_0x45fdc4[0x0];if(!requireNameOrPath(_0x501df3))return 0x1;_0x183a05[_0x316b76(0x26c)]&&console[_0x316b76(0x204)](_0x316b76(0x1c0)+_0x501df3);const _0x2b391a=_0x183a05,_0x490905=_0x2b391a[_0x316b76(0x21f)],_0x15bdc6=_0x2b391a['to'],_0x5e44fe=_0x2b391a[_0x316b76(0x1a1)],_0x2cc559=_0x2b391a[_0x316b76(0x24c)];_0x5e44fe&&!_0x490905&&!_0x15bdc6&&console[_0x316b76(0x204)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x211d14=_0x5e44fe?withJsonFormat(_0x183a05):_0x183a05,{journeyId:_0x38c7c6,journeyName:_0x1942fb}=await resolveJourneyIdFromInput(_0x501df3,_0x211d14,_0x4685cc),_0x39fa5d=_0x490905||_0x15bdc6?{'from':_0x490905,'to':_0x15bdc6}:undefined,_0x5beba0=await withSpinner(_0x316b76(0x1cb),()=>Promise[_0x316b76(0x1a9)]([_0x4685cc[_0x316b76(0x18d)]['getJourney'](_0x38c7c6),_0x4685cc[_0x316b76(0x18d)][_0x316b76(0x1b3)](_0x38c7c6,_0x39fa5d)]),{'verbose':_0x211d14['verbose']}),[_0x118dd1,_0x52b3fc]=_0x5beba0[_0x316b76(0x21d)];if(!_0x52b3fc||_0x52b3fc[_0x316b76(0x1cd)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x1942fb),console[_0x316b76(0x204)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x15e138=buildStageNameMap(_0x118dd1),_0x1a1fac=!!(_0x39fa5d&&_0x52b3fc[_0x316b76(0x244)]?.[_0x316b76(0x26e)]),_0x4ac173={'stageNameMap':_0x15e138,'hasPeriod':_0x1a1fac,'includeHistory':!!_0x5e44fe};if(_0x2cc559&&_0x52b3fc[_0x316b76(0x1ad)]){const _0x424a6f=_0x52b3fc[_0x316b76(0x1ad)][_0x316b76(0x27e)](_0x357be9=>{const _0x466a53=_0x316b76,_0x498dd3=_0x15e138[_0x466a53(0x242)](_0x357be9['id'])??'';return _0x498dd3[_0x466a53(0x1b6)]()===_0x2cc559[_0x466a53(0x1b6)]();});if(_0x424a6f)return await handleSingleObjectOutput(formatStageStats(_0x424a6f,_0x4ac173),_0x211d14),0x0;const _0x580c5f=_0x52b3fc['stages']['map'](_0x4d5017=>_0x15e138[_0x316b76(0x242)](_0x4d5017['id'])??_0x4d5017['id']);return console[_0x316b76(0x204)](_0x316b76(0x217)+_0x2cc559+_0x316b76(0x1f4)),console['error'](_0x316b76(0x1fb)+_0x580c5f[_0x316b76(0x1c7)](',\x20')),0x1;}const _0x1d8a51=_0x52b3fc['stages']?.['map'](_0x2e5672=>formatStageStats(_0x2e5672,_0x4ac173)),_0x107d78=assembleJourneyStats(_0x52b3fc,{'from':_0x490905,'to':_0x15bdc6,'includeHistory':_0x5e44fe});return await this[_0x316b76(0x224)](_0x107d78,_0x1d8a51??[],_0x211d14),0x0;}async[a28_0x31317c(0x224)](_0x3327a9,_0x5acb86,_0x832fea){const _0x76d60=a28_0x31317c,_0x45e210=_0x832fea[_0x76d60(0x250)]===_0x76d60(0x223)||_0x832fea['format']===_0x76d60(0x1ed)||_0x832fea[_0x76d60(0x223)]||_0x832fea[_0x76d60(0x1ed)];if(_0x45e210){_0x3327a9[_0x76d60(0x1ad)]=_0x5acb86,await handleSingleObjectOutput(_0x3327a9,_0x832fea);return;}await handleSingleObjectOutput(_0x3327a9,_0x832fea);for(const _0x3723f9 of _0x5acb86){console[_0x76d60(0x229)](''),console[_0x76d60(0x229)](String(a28_0x1f6c69[_0x76d60(0x240)][_0x76d60(0x206)]('['+_0x3723f9[_0x76d60(0x19e)]+']'))+a28_0x1f6c69[_0x76d60(0x218)]('\x20'+_0x3723f9['id']));const {id:_0x59b0e0,name:_0x26b5ec,..._0x22fd73}=_0x3723f9;await handleSingleObjectOutput(_0x22fd73,_0x832fea);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x31317c(0x19e)]='journey:traffic';['description']=a28_0x31317c(0x1a6);async['execute'](_0x50b050){const _0x42b15e=a28_0x31317c,{options:_0x265f45,args:_0x1d2923,tdx:_0x3bd5cc}=_0x50b050,_0x4bcd3e=_0x1d2923[0x0];if(!requireNameOrPath(_0x4bcd3e))return 0x1;_0x265f45[_0x42b15e(0x26c)]&&console[_0x42b15e(0x204)](_0x42b15e(0x1c0)+_0x4bcd3e);const _0x4a6048=_0x265f45,_0x1b9bb1=_0x4a6048[_0x42b15e(0x1c6)],_0x477e19=_0x4a6048[_0x42b15e(0x21f)],_0x174627=_0x4a6048['to'],_0x121ff4=_0x4a6048[_0x42b15e(0x23a)];if(_0x1b9bb1&&_0x1b9bb1!==_0x42b15e(0x241)&&_0x1b9bb1!==_0x42b15e(0x203))return console[_0x42b15e(0x204)](_0x42b15e(0x27a)+_0x1b9bb1+_0x42b15e(0x1b9)),0x1;const _0xa6d2e1=withJsonFormat(_0x265f45),{journeyId:_0x3a2841,journeyName:_0x1311d1}=await resolveJourneyIdFromInput(_0x4bcd3e,_0xa6d2e1,_0x3bd5cc),_0x1eda9b={'type':_0x1b9bb1,'from':_0x477e19,'to':_0x174627,'limit':_0x121ff4},_0x51a944=await withSpinner(_0x42b15e(0x285),()=>_0x3bd5cc[_0x42b15e(0x18d)]['getTrafficData'](_0x3a2841,_0x1eda9b),{'verbose':_0xa6d2e1[_0x42b15e(0x26c)]}),_0x191cf7=_0x51a944[_0x42b15e(0x21d)],_0xd2dbff=_0x191cf7[_0x42b15e(0x241)]&&(_0x191cf7[_0x42b15e(0x241)][_0x42b15e(0x1ba)][_0x42b15e(0x26e)]>0x0||_0x191cf7[_0x42b15e(0x241)][_0x42b15e(0x1b5)][_0x42b15e(0x26e)]>0x0),_0x44174c=_0x191cf7[_0x42b15e(0x203)]&&_0x191cf7[_0x42b15e(0x203)][_0x42b15e(0x26e)]>0x0;if(!_0xd2dbff&&!_0x44174c)return console[_0x42b15e(0x204)](_0x42b15e(0x1d0)+_0x1311d1),console['error'](_0x42b15e(0x1ef)),_0x477e19&&_0x174627&&console[_0x42b15e(0x204)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x191cf7,_0xa6d2e1),0x0;}}function a28_0x5210(){const _0x516a69=['\x20=\x20','journeyBundleId','Available\x20stages:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','exitOrJumpSize','args','(running)','journey:activations','\x20(rule\x20match)','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','activation','error','\x20(ID:\x20','bold','\x5c$&','entries','journeys','listJourneysFromParentSegment','1600104XCguZm','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20not\x20found.\x20Available:\x20','\x20versions)','Cancelled','segmentPushCommand','listJourneysWithFolders','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','parentName','Folder\x20path:\x20','Error:\x20Stage\x20\x22','dim','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','/j/da/je','Resolving\x20version...','\x20\x20Preserving\x20local\x20segment\x20name:\x20','data','Database:\x20','from','state','Warning:\x20Could\x20not\x20resolve\x20segment\x20','tdx.json','json','renderStats','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','tsv','then','has','log','\x20journey','/app/ps/','Resolved\x20YAML\x20file:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','resolveParentId','✔\x20Context\x20set:\x20','base','split','\x20new\x20files','draft','\x22\x20paused','attributes','17UpNKWl','segmentName','sort','utf-8','limit','journey:stats','✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Journey\x20\x22','content','Parent\x20segment:\x20','cyan','conversion','get','includeStats','history','\x20\x20Name:\x20','\x20version','Aborted.','createVersion','enteredSize','7182154OgqDXo','\x20\x20Statistics\x20not\x20available','stage','\x0aError:','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','format','values','getJourney','setPhase','14695677aYKFpA','(paused)','.yml','journey:columns','\x20(draft)\x20—\x20\x22','relativePath','\x20journey\x20files\x20to\x20','Getting\x20column\x20mapping...','20icUSYa','size','file','Error:\x20--version\x20option\x20is\x20required','Found\x20','...','journey:pull','Fetching\x20users\x20and\x20connections...','connector_config','archived','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','updatedAt','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Fetching\x20','web','verbose','paused','length','🗺️\x20','goal','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','dryRun','listActivationsFlat','segment','Resolving\x20parent\x20segment...','Show\x20journey\x20details','\x20details...','blue','Error:\x20Invalid\x20--type\x20\x22','repeat','getLatestJourneyId','/e/','find','buildIdToNameMap','parentSegment','filePath','Show\x20journey\x20table\x20column\x20mapping','\x20\x20Journey\x20ID:\x20','\x20->\x20','Getting\x20journey\x20traffic\x20data...','versionNumber','replace','message','Creating\x20new\x20version...','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)','completed','INVALID_ARGUMENT','stageNameMap','Show\x20journey\x20statistics','parent_segment','✔\x20Pulled\x20','exitOrJumpRate','Pause\x20a\x20running\x20journey','List\x20journeys\x20in\x20current\x20context','map','getColumnMapping','-\x20no\x20files\x20written','createdAt','Journey\x20name:\x20','Error:\x20Invalid\x20version\x20number:\x20','resolveJourneyId','absolutePath','journey','activationParams','reentryMode','\x27\x20not\x20found\x20in\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Listing\x20journey\x20versions...','stringify','List\x20all\x20versions\x20of\x20a\x20journey','\x20activation','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x20files?','5730540jdUpIx','set','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','milestoneSize','table','name','helpText','Error:\x20Journey\x20\x27','includeHistory','options','Resolving\x20journey...','Pattern:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','journey:version:view','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','all','activation_','99640yXuhPd','resourceName','stages','folderPath','(completed)','\x20changed\x20files','getActivation','add','getStatistics','Fetching\x20journeys\x20and\x20folders...','links','toLowerCase','Options:','version','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','nodes','folders','journeyName','getParentFull','segments','audienceId','Input:\x20','Error:\x20Parent\x20segment\x20context\x20required','Resume\x20a\x20paused\x20journey','Error:\x20','\x20\x20Target:\x20','\x20\x20Folder\x20path:\x20','type','join','hasPeriod','hasChanges',',\x20version:\x20','Getting\x20journey\x20statistics...','site','journeyId','push','targetDir','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Listing\x20journey\x20activations...','Target\x20directory:\x20','description','cwd','(root)','execute','isNew','session','Table:\x20','No\x20journeys\x20found','test','launched','kind','localeCompare','11400BclNbk','Getting\x20journey\x20details...','771GGulEE','journey:versions','journey:view','Pausing\x20journey...','yes','no_parent','journeyBundleName','columns','/j/da','completeMilestoneRate','\x22\x20resumed','red','jsonl','filter','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','connection','folderId','diff','journey:version:create','\x22\x20not\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','5831424hESQzM','(draft)','rule'];a28_0x5210=function(){return _0x516a69;};return a28_0x5210();}function formatStageStats(_0x15b4c0,_0x393ea2){const _0x28365f=a28_0x31317c,_0x5a9f13=_0x393ea2[_0x28365f(0x1c8)]&&_0x15b4c0[_0x28365f(0x244)]?.[_0x28365f(0x26e)]?aggregateStageHistory(_0x15b4c0['history']):{'size':_0x15b4c0[_0x28365f(0x25d)],'entered':_0x15b4c0[_0x28365f(0x249)],'milestone':_0x15b4c0[_0x28365f(0x19c)],'milestone_rate':_0x15b4c0[_0x28365f(0x1ea)],'exit_or_jump':_0x15b4c0[_0x28365f(0x1fd)],'exit_or_jump_rate':_0x15b4c0[_0x28365f(0x182)]},_0x14b67b={'id':_0x15b4c0['id'],'name':_0x393ea2[_0x28365f(0x17e)][_0x28365f(0x242)](_0x15b4c0['id'])??_0x15b4c0['id'],..._0x5a9f13};return _0x393ea2[_0x28365f(0x1c8)]&&_0x393ea2[_0x28365f(0x1a1)]&&_0x15b4c0[_0x28365f(0x244)]&&(_0x14b67b[_0x28365f(0x244)]=_0x15b4c0['history']),_0x14b67b;}export class JourneyPauseCommand extends BaseCommand{[a28_0x31317c(0x19e)]='journey:pause';[a28_0x31317c(0x1d3)]=a28_0x31317c(0x183);async['execute'](_0x731cb7){const _0xb3456c=a28_0x31317c,{options:_0x5a515d,args:_0x37d29b,tdx:_0x1fec0d}=_0x731cb7,_0x492f0b=_0x37d29b[0x0];if(!requireNameOrPath(_0x492f0b))return 0x1;_0x5a515d[_0xb3456c(0x26c)]&&console[_0xb3456c(0x204)]('Input:\x20'+_0x492f0b);const {journeyId:_0x1a4709,journeyName:_0x53e6f9}=await resolveJourneyIdFromInput(_0x492f0b,_0x5a515d,_0x1fec0d);if(!_0x5a515d['yes']){const _0x3321c6=await confirm(_0xb3456c(0x1f5)+_0x53e6f9+'\x22?');if(!_0x3321c6)return console['error'](_0xb3456c(0x20f)),0x0;}const _0x159d9c=await withSpinner(_0xb3456c(0x1e4),()=>_0x1fec0d[_0xb3456c(0x18d)]['pause'](_0x1a4709),{'verbose':_0x5a515d[_0xb3456c(0x26c)]}),_0x2b3c1a=_0x159d9c['data'];return console['error'](_0xb3456c(0x23d)+_0x2b3c1a[_0xb3456c(0x235)]['name']+_0xb3456c(0x234)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x31317c(0x19e)]='journey:resume';[a28_0x31317c(0x1d3)]=a28_0x31317c(0x1c2);async[a28_0x31317c(0x1d6)](_0x4bc584){const _0x30a10d=a28_0x31317c,{options:_0x5674d0,args:_0x146dd0,tdx:_0x5a8134}=_0x4bc584,_0x1aa2e8=_0x146dd0[0x0];if(!requireNameOrPath(_0x1aa2e8))return 0x1;_0x5674d0['verbose']&&console['error'](_0x30a10d(0x1c0)+_0x1aa2e8);const {journeyId:_0x219812,journeyName:_0x6db37b}=await resolveJourneyIdFromInput(_0x1aa2e8,_0x5674d0,_0x5a8134);if(!_0x5674d0['yes']){const _0x29229e=await confirm(_0x30a10d(0x19a)+_0x6db37b+'\x22?');if(!_0x29229e)return console[_0x30a10d(0x204)]('Cancelled'),0x0;}const _0x5f1900=await withSpinner('Resuming\x20journey...',()=>_0x5a8134[_0x30a10d(0x18d)]['resume'](_0x219812),{'verbose':_0x5674d0[_0x30a10d(0x26c)]}),_0x4ff5bf=_0x5f1900[_0x30a10d(0x21d)];return console[_0x30a10d(0x204)]('✔\x20Journey\x20\x22'+_0x4ff5bf[_0x30a10d(0x235)][_0x30a10d(0x19e)]+_0x30a10d(0x1eb)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x31317c(0x19e)]=a28_0x31317c(0x262);[a28_0x31317c(0x1d3)]=a28_0x31317c(0x22d);async['execute'](_0x17fd5a){const _0x270358=a28_0x31317c,{options:_0x55db35,args:_0x3b9b2a,tdx:_0x324ec7}=_0x17fd5a,_0x54cde0=_0x55db35,_0x5e45d5=_0x3b9b2a[0x0],_0xf9851e=_0x5e45d5&&isYamlFilePath(_0x5e45d5),_0x9685a4=await resolveTarget({'arg':_0xf9851e?_0x5e45d5:undefined,'contextParent':_0x55db35[_0x270358(0x280)],'cwd':process[_0x270358(0x1d4)]()});if(!isSuccessfulResolution(_0x9685a4))return _0x9685a4['errorCode']===_0x270358(0x1e6)?(console[_0x270358(0x204)](a28_0x1f6c69['yellow'](_0x270358(0x219))),console['error'](_0x270358(0x17b)),console[_0x270358(0x204)](_0x270358(0x272)),console[_0x270358(0x204)](_0x270358(0x225)),console['error'](_0x270358(0x1a5))):(console[_0x270358(0x204)](a28_0x1f6c69[_0x270358(0x1ec)](_0x270358(0x1c3)+_0x9685a4[_0x270358(0x288)]+'\x0a')),_0x9685a4[_0x270358(0x19f)]&&console['error'](a28_0x1f6c69[_0x270358(0x240)](_0x9685a4[_0x270358(0x19f)]))),0x1;let _0x4f603b=_0xf9851e?undefined:_0x5e45d5,_0x21b8eb,_0x2d1452;_0x9685a4[_0x270358(0x1c6)]===_0x270358(0x25e)&&(_0x4f603b=_0x9685a4[_0x270358(0x1ac)],_0x21b8eb=_0x9685a4[_0x270358(0x281)],_0x2d1452=_0x9685a4[_0x270358(0x1ae)]);const _0x378833=_0x9685a4[_0x270358(0x215)],_0x217808=_0x9685a4[_0x270358(0x1cf)];_0x54cde0[_0x270358(0x26c)]&&(console[_0x270358(0x204)](_0x270358(0x23f)+_0x378833),console[_0x270358(0x204)](_0x270358(0x1d2)+_0x217808),_0x4f603b&&console[_0x270358(0x204)](_0x270358(0x189)+_0x4f603b),_0x21b8eb&&console[_0x270358(0x204)]('Target\x20file:\x20'+_0x21b8eb),_0x2d1452&&console[_0x270358(0x204)](_0x270358(0x216)+_0x2d1452));const _0x18eef8=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x324ec7[_0x270358(0x275)][_0x270358(0x22e)](_0x378833),{'verbose':_0x55db35[_0x270358(0x26c)]}),_0x4bfc2d=_0x18eef8[_0x270358(0x21d)],{journeys:_0x5291e0,folders:_0x3de3b3}=await withSpinner(_0x270358(0x1b4),async()=>{const _0x3bbd8b=_0x270358,[_0x118dc8,_0x45b549]=await Promise['all']([_0x324ec7[_0x3bbd8b(0x18d)][_0x3bbd8b(0x20a)](_0x4bfc2d,undefined,{'includeAllVersions':!![]}),_0x324ec7[_0x3bbd8b(0x275)]['listFolders'](_0x4bfc2d)]);return{'journeys':_0x118dc8,'folders':_0x45b549};},{'verbose':_0x55db35[_0x270358(0x26c)]})[_0x270358(0x227)](_0x97af6c=>_0x97af6c[_0x270358(0x21d)]);let _0x44700c=_0x5291e0;const _0x7f2617=buildFolderIdToPathMap(_0x3de3b3);if(_0x4f603b){const _0x4aab16=_0x44700c['filter'](_0x5e20e6=>_0x5e20e6[_0x270358(0x1e7)][_0x270358(0x1b6)]()===_0x4f603b[_0x270358(0x1b6)]());if(_0x4aab16[_0x270358(0x26e)]===0x0)return console[_0x270358(0x204)]('Error:\x20Journey\x20not\x20found:\x20'+_0x4f603b),console['error'](_0x270358(0x196)),0x1;_0x44700c=_0x4aab16;}if(_0x2d1452!==undefined){const _0x36c130=_0x44700c[_0x270358(0x1ee)](_0x5f03a6=>{const _0x2f7dc5=_0x270358,_0x4c08d3=_0x5f03a6[_0x2f7dc5(0x1f1)]?_0x7f2617[_0x2f7dc5(0x242)](_0x5f03a6[_0x2f7dc5(0x1f1)])||'':'';return _0x4c08d3===_0x2d1452;});if(_0x36c130[_0x270358(0x26e)]===0x0&&_0x44700c[_0x270358(0x26e)]>0x0){console[_0x270358(0x204)](_0x270358(0x1a0)+_0x4f603b+_0x270358(0x190)+(_0x2d1452||'root\x20folder')),console[_0x270358(0x204)](_0x270358(0x191));for(const _0xe7a5b5 of _0x44700c){const _0x1a7320=_0xe7a5b5[_0x270358(0x1f1)]?_0x7f2617['get'](_0xe7a5b5[_0x270358(0x1f1)])||'':'';console[_0x270358(0x204)]('\x20\x20-\x20'+(_0x1a7320||'(root)')+'/'+_0xe7a5b5[_0x270358(0x1e7)]);}return 0x1;}_0x44700c=_0x36c130;}if(_0x44700c[_0x270358(0x26e)]===0x0)return console[_0x270358(0x204)](_0x270358(0x1da)),0x0;const _0x51c1a9=new Map();for(const _0x2e17c1 of _0x44700c){const _0x40db34=_0x2e17c1[_0x270358(0x1fa)];!_0x51c1a9[_0x270358(0x228)](_0x40db34)&&_0x51c1a9['set'](_0x40db34,[]),_0x51c1a9[_0x270358(0x242)](_0x40db34)[_0x270358(0x1ce)](_0x2e17c1);}for(const _0x2d35f0 of _0x51c1a9[_0x270358(0x251)]()){_0x2d35f0[_0x270358(0x238)]((_0x127455,_0x32295e)=>(_0x127455[_0x270358(0x286)]||0x0)-(_0x32295e[_0x270358(0x286)]||0x0));}const _0x53e3d9=[],{idToEmailMap:_0x53e24b,connectionIdToNameMap:_0x18b33a}=await withSpinner(_0x270358(0x263),async()=>{const _0x3489fb=_0x270358,[_0x3af8da,_0x446df6]=await Promise['all']([_0x324ec7['user']['buildIdToEmailMap'](),_0x324ec7['connection'][_0x3489fb(0x27f)]()]);return{'idToEmailMap':_0x3af8da,'connectionIdToNameMap':_0x446df6};},{'verbose':_0x55db35[_0x270358(0x26c)]})[_0x270358(0x227)](_0x316a85=>_0x316a85[_0x270358(0x21d)]);for(const _0x31a6a3 of _0x51c1a9['values']()){const _0x2deb5b=_0x31a6a3[0x0][_0x270358(0x1e7)],_0x5af32c=_0x31a6a3[0x0]['folderId'],_0x185058=_0x5af32c?_0x7f2617[_0x270358(0x242)](_0x5af32c)||'':'',_0x50fcf8=_0x185058?a28_0x1d6b5c[_0x270358(0x1c7)](_0x217808,_0x185058):_0x217808,_0x5404f2=_0x21b8eb||a28_0x1d6b5c[_0x270358(0x1c7)](_0x50fcf8,sanitizeFileName(_0x2deb5b)+_0x270358(0x256));let _0x447cb4,_0x48cb03;if(existsSync(_0x5404f2))try{const _0x957f35=readFileSync(_0x5404f2,_0x270358(0x239)),_0x497e99=parseYamlString(_0x957f35);_0x48cb03=_0x497e99,_0x447cb4=buildRuleToNameMapping(_0x497e99),_0x54cde0['verbose']&&_0x447cb4[_0x270358(0x25d)]>0x0&&console['error']('Found\x20'+_0x447cb4['size']+_0x270358(0x24e)+_0x2deb5b);}catch(_0x2e64c2){_0x54cde0[_0x270358(0x26c)]&&console[_0x270358(0x204)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x2e64c2[_0x270358(0x288)]);}const _0x3d02f1=[],_0x3efd68=new Set(),_0x54330e=new Map(),_0xed26af=new Map(),_0x4e3dab=new Set(),_0x501800=new Map(),_0x4a441d=new Map(),_0x42c4e1=createJumpTargetCache();await withProgressSpinner(_0x270358(0x26a)+_0x2deb5b+_0x270358(0x261),async _0x31ef6c=>{const _0x124afa=_0x270358;for(const _0x4f8101 of _0x31a6a3){const _0x3c2256=_0x31a6a3['length']>0x1?_0x4f8101[_0x124afa(0x1e7)]+'\x20v'+(_0x4f8101[_0x124afa(0x286)]||0x1):_0x4f8101[_0x124afa(0x1e7)];_0x31ef6c[_0x124afa(0x253)](_0x124afa(0x26a)+_0x3c2256);const _0x3dde6c=await _0x324ec7[_0x124afa(0x18d)][_0x124afa(0x252)](_0x4f8101['id']),_0x5627fa=_0x3dde6c[_0x124afa(0x235)]?.[_0x124afa(0x1bf)],_0x52ff3b={'resolveSegment':async _0x414e2c=>{const _0x1903c9=_0x124afa;if(!_0x5627fa)return{'name':_0x414e2c,'isJourneyLocal':![]};const _0x4fd169=_0x54330e[_0x1903c9(0x242)](_0x414e2c);if(_0x4fd169)return _0x4fd169;try{const _0x378746=await _0x324ec7['segment']['getSegment'](_0x5627fa,_0x414e2c),_0x1fa777=_0x378746[_0x1903c9(0x1dd)]===SEGMENT_KIND_JOURNEY;let _0x6e90cc,_0x486315=_0x378746[_0x1903c9(0x19e)];if(_0x1fa777&&_0x378746['rule']){const _0x10d371=await segmentResponseToDef(_0x378746,{'resolveSegmentName':async _0x28e48b=>{const _0x48439e=_0x1903c9,_0x5c6e79=_0x54330e[_0x48439e(0x242)](_0x28e48b);if(_0x5c6e79)return _0x5c6e79[_0x48439e(0x19e)];const _0x484d71=await _0x52ff3b['resolveSegment'](_0x28e48b);return _0x484d71[_0x48439e(0x19e)];}}),_0x1fbc3a=_0x10d371['rule'];_0x6e90cc={'description':_0x378746[_0x1903c9(0x1d3)],'rule':_0x1fbc3a};const _0x152222=serializeRule(_0x1fbc3a),_0x23401d=_0xed26af[_0x1903c9(0x242)](_0x152222);if(_0x23401d)_0x486315=_0x23401d,_0x6e90cc=undefined,_0x54cde0[_0x1903c9(0x26c)]&&console[_0x1903c9(0x204)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x378746[_0x1903c9(0x19e)]+_0x1903c9(0x284)+_0x23401d);else{let _0x30ca27=![];if(_0x447cb4){const _0x19157e=_0x447cb4[_0x1903c9(0x242)](_0x152222);if(_0x19157e){const _0x232724=_0x19157e['find'](_0x5bee53=>!_0x3efd68['has'](_0x5bee53));_0x232724&&(_0x486315=_0x232724,_0x3efd68[_0x1903c9(0x1b2)](_0x232724),_0xed26af['set'](_0x152222,_0x232724),_0x30ca27=!![],_0x54cde0['verbose']&&console[_0x1903c9(0x204)](_0x1903c9(0x21c)+_0x232724+_0x1903c9(0x201)));}}if(!_0x30ca27){const _0x55b945=generateJourneyLocalName(_0x378746[_0x1903c9(0x19e)]);_0x55b945&&(_0x486315=_0x55b945);let _0x4a94f4=_0x486315,_0x5a7607=0x2;while(_0x3efd68['has'](_0x4a94f4)){_0x4a94f4=_0x486315+'_'+_0x5a7607,_0x5a7607++;}_0x3efd68[_0x1903c9(0x1b2)](_0x4a94f4),_0xed26af[_0x1903c9(0x199)](_0x152222,_0x4a94f4),_0x486315=_0x4a94f4;}}}const _0x36988c={'name':_0x486315,'isJourneyLocal':_0x1fa777,'definition':_0x6e90cc};return _0x54330e[_0x1903c9(0x199)](_0x414e2c,_0x36988c),_0x36988c;}catch(_0x2b6441){return _0x55db35[_0x1903c9(0x26c)]&&console['error'](_0x1903c9(0x221)+_0x414e2c+':\x20'+_0x2b6441[_0x1903c9(0x288)]),{'name':_0x414e2c,'isJourneyLocal':![]};}},'resolveActivation':async _0x28e0fe=>{const _0x2d9d40=_0x124afa,_0x482ae5=_0x501800[_0x2d9d40(0x242)](_0x28e0fe);if(_0x482ae5)return _0x482ae5;try{const _0xb1950e=await _0x324ec7[_0x2d9d40(0x18d)][_0x2d9d40(0x1b1)](_0x4f8101['id'],_0x28e0fe),_0x18e6b1=journeyActivationStepToYaml(_0xb1950e,_0x53e24b,_0x18b33a),_0x50de8c=JSON[_0x2d9d40(0x193)]({'name':_0x18e6b1[_0x2d9d40(0x19e)],'connection':_0x18e6b1[_0x2d9d40(0x1f0)],'connector_config':_0x18e6b1[_0x2d9d40(0x264)]}),_0x3a5677=_0x4a441d[_0x2d9d40(0x242)](_0x50de8c);if(_0x3a5677){const _0x1a386c={'name':_0x3a5677,'isJourneyLocal':!![],'definition':_0x18e6b1};return _0x501800['set'](_0x28e0fe,_0x1a386c),_0x1a386c;}const _0x7ca7d9=_0xb1950e[_0x2d9d40(0x235)][_0x2d9d40(0x18e)][_0x2d9d40(0x19e)]||_0x28e0fe,_0x46b72e=sanitizeYamlKey(_0x7ca7d9)||_0x2d9d40(0x1aa)+_0x28e0fe;let _0x5ec712=_0x46b72e,_0x4e9dcb=0x2;while(_0x4e3dab[_0x2d9d40(0x228)](_0x5ec712)){_0x5ec712=_0x46b72e+'_'+_0x4e9dcb,_0x4e9dcb++;}_0x4e3dab[_0x2d9d40(0x1b2)](_0x5ec712),_0x4a441d[_0x2d9d40(0x199)](_0x50de8c,_0x5ec712);const _0xe86262={'name':_0x5ec712,'isJourneyLocal':!![],'definition':_0x18e6b1};return _0x501800[_0x2d9d40(0x199)](_0x28e0fe,_0xe86262),_0xe86262;}catch(_0x454d04){return _0x55db35[_0x2d9d40(0x26c)]&&console[_0x2d9d40(0x204)](_0x2d9d40(0x1fc)+_0x28e0fe+':\x20'+_0x454d04[_0x2d9d40(0x288)]),{'name':_0x28e0fe,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x3e9300,_0x25859f)=>{const _0x2ae782=_0x124afa;return resolveJumpTarget(_0x3e9300,_0x25859f,_0x42c4e1,_0x55bbee=>_0x324ec7[_0x2ae782(0x18d)][_0x2ae782(0x252)](_0x55bbee));}},_0x5ece90=await journeyResponseToDef(_0x3dde6c,_0x52ff3b);_0x3d02f1['push']({'item':_0x4f8101,'yaml':_0x5ece90});}},{'verbose':_0x55db35[_0x270358(0x26c)]});const _0x468a5a=await _0x324ec7[_0x270358(0x18d)][_0x270358(0x27c)](_0x31a6a3[0x0][_0x270358(0x1fa)]),_0x5487ca=buildMergedJourneyDef(_0x3d02f1,_0x447cb4,_0x468a5a),_0x286dd6=normalizeJourneyDef(_0x5487ca,_0x48cb03),_0x228d35=toYamlString(_0x286dd6),_0x30ff12=_0x21b8eb||a28_0x1d6b5c['join'](_0x50fcf8,sanitizeFileName(_0x2deb5b)+_0x270358(0x256));!_0x21b8eb&&_0x185058&&!existsSync(_0x50fcf8)&&mkdirSync(_0x50fcf8,{'recursive':!![]});const _0x582f4b=a28_0x1d6b5c['relative'](process[_0x270358(0x1d4)](),_0x30ff12);if(existsSync(_0x30ff12)){const _0x199be3=readFileSync(_0x30ff12,_0x270358(0x239)),_0x17c01a=generateDiff(_0x199be3,_0x228d35),_0x3fee1b=hasChanges(_0x17c01a);_0x53e3d9[_0x270358(0x1ce)]({'relativePath':_0x582f4b,'absolutePath':_0x30ff12,'content':_0x228d35,'isNew':![],'hasChanges':_0x3fee1b,'diff':_0x3fee1b?formatDiffWithColors(_0x17c01a):undefined});}else _0x53e3d9['push']({'relativePath':_0x582f4b,'absolutePath':_0x30ff12,'content':_0x228d35,'isNew':!![],'hasChanges':![]});}const _0x224081=_0x53e3d9[_0x270358(0x1ee)](_0x1aaeaa=>_0x1aaeaa[_0x270358(0x1d7)]),_0x156167=_0x53e3d9[_0x270358(0x1ee)](_0x210efc=>!_0x210efc[_0x270358(0x1d7)]&&_0x210efc[_0x270358(0x1c9)]),_0x1fae1f=_0x53e3d9[_0x270358(0x1ee)](_0x31f0a1=>!_0x31f0a1[_0x270358(0x1d7)]&&!_0x31f0a1[_0x270358(0x1c9)]),_0x1f181b=_0x44700c[_0x270358(0x26e)],_0xf68b45=_0x51c1a9[_0x270358(0x25d)],_0x113d8f=_0x1f181b>_0xf68b45?'\x20('+_0x1f181b+_0x270358(0x20e):'';console['error']('\x0aPull\x20summary:'),console['error']('\x20\x20'+a28_0x1f6c69['cyan'](_0xf68b45+'\x20journeys')+a28_0x1f6c69[_0x270358(0x218)](_0x113d8f)),console[_0x270358(0x204)]('\x20\x20'+a28_0x1f6c69[_0x270358(0x214)]('+\x20'+_0x224081[_0x270358(0x26e)]+_0x270358(0x232))),console[_0x270358(0x204)]('\x20\x20'+a28_0x1f6c69[_0x270358(0x271)]('~\x20'+_0x156167[_0x270358(0x26e)]+_0x270358(0x1b0))),console[_0x270358(0x204)]('\x20\x20'+a28_0x1f6c69[_0x270358(0x218)]('=\x20'+_0x1fae1f[_0x270358(0x26e)]+'\x20unchanged\x20files')),console[_0x270358(0x204)](_0x270358(0x1c4)+a28_0x1f6c69[_0x270358(0x240)](_0x217808)+'\x0a');if(_0x156167[_0x270358(0x26e)]>0x0)for(const _0x343db4 of _0x156167){console[_0x270358(0x204)]('\x0aChanges\x20to\x20\x27'+_0x343db4[_0x270358(0x259)]+'\x27:'),console[_0x270358(0x204)]('─'[_0x270358(0x27b)](0x3c)),console['error'](_0x343db4[_0x270358(0x1f2)]),console[_0x270358(0x204)]('─'['repeat'](0x3c));}if(_0x54cde0[_0x270358(0x273)])return console[_0x270358(0x204)](a28_0x1f6c69[_0x270358(0x271)](_0x270358(0x213))),0x0;if(_0x224081[_0x270358(0x26e)]===0x0&&_0x156167[_0x270358(0x26e)]===0x0)return console[_0x270358(0x204)](a28_0x1f6c69[_0x270358(0x214)](_0x270358(0x23c))),saveSessionContext({'parent_segment':_0x378833},_0x54cde0[_0x270358(0x1d8)]),console[_0x270358(0x204)](a28_0x1f6c69['green'](_0x270358(0x22f)+a28_0x1f6c69['dim'](_0x270358(0x180))+'\x20=\x20'+a28_0x1f6c69[_0x270358(0x240)](_0x378833))),0x0;if(!_0x54cde0[_0x270358(0x1e5)]&&(_0x224081[_0x270358(0x26e)]>0x0||_0x156167[_0x270358(0x26e)]>0x0)){if(!isInteractive())return console[_0x270358(0x204)](a28_0x1f6c69[_0x270358(0x1ec)](_0x270358(0x24d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x270358(0x204)](a28_0x1f6c69[_0x270358(0x218)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x37920f=await confirmKey('Write\x20'+(_0x224081[_0x270358(0x26e)]+_0x156167[_0x270358(0x26e)])+_0x270358(0x197));if(!_0x37920f)return console[_0x270358(0x204)](a28_0x1f6c69[_0x270358(0x271)](_0x270358(0x247)),_0x270358(0x187)),0x1;}!existsSync(_0x217808)&&mkdirSync(_0x217808,{'recursive':!![]});const _0x1a0b14=a28_0x1d6b5c[_0x270358(0x1c7)](_0x217808,_0x270358(0x222));writeFileSync(_0x1a0b14,createTdxConfigContent(_0x378833),_0x270358(0x239));for(const _0x438481 of _0x53e3d9){(_0x438481[_0x270358(0x1d7)]||_0x438481[_0x270358(0x1c9)])&&writeFileSync(_0x438481[_0x270358(0x18c)],_0x438481[_0x270358(0x23e)],_0x270358(0x239));}return console[_0x270358(0x204)](a28_0x1f6c69['green'](_0x270358(0x181)+(_0x224081[_0x270358(0x26e)]+_0x156167[_0x270358(0x26e)])+_0x270358(0x25a)+_0x217808)),saveSessionContext({'parent_segment':_0x378833},_0x54cde0[_0x270358(0x1d8)]),console['error'](a28_0x1f6c69[_0x270358(0x214)](_0x270358(0x22f)+a28_0x1f6c69['dim'](_0x270358(0x180))+_0x270358(0x1f9)+a28_0x1f6c69[_0x270358(0x240)](_0x378833))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a28_0x31317c(0x257);[a28_0x31317c(0x1d3)]=a28_0x31317c(0x282);async[a28_0x31317c(0x1d6)](_0x2d35bf){const _0x20fe58=a28_0x31317c,{options:_0x89dec1,args:_0x12694d,tdx:_0x13814e}=_0x2d35bf,_0x1ead25=_0x12694d[0x0];if(!requireNameOrPath(_0x1ead25))return 0x1;_0x89dec1[_0x20fe58(0x26c)]&&console[_0x20fe58(0x204)](_0x20fe58(0x1c0)+_0x1ead25);const {journeyId:_0xbc738}=await resolveJourneyIdFromInput(_0x1ead25,_0x89dec1,_0x13814e),_0x4ef639=await withSpinner(_0x20fe58(0x25b),()=>_0x13814e['journey'][_0x20fe58(0x186)](_0xbc738),{'verbose':_0x89dec1[_0x20fe58(0x26c)]}),_0x1262bb=_0x4ef639[_0x20fe58(0x21d)];return console[_0x20fe58(0x229)](_0x20fe58(0x21e)+_0x1262bb['database']),console[_0x20fe58(0x229)](_0x20fe58(0x1d9)+_0x1262bb[_0x20fe58(0x19d)]),await handleSDKOutput(_0x1262bb[_0x20fe58(0x1e8)],_0x89dec1),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x31317c(0x19e)]=a28_0x31317c(0x200);['description']='List\x20activations\x20for\x20a\x20journey';async['execute'](_0x165b39){const _0x213fb2=a28_0x31317c,{options:_0x348340,args:_0x9af6a8,tdx:_0x1f332d}=_0x165b39,_0x1e523e=_0x9af6a8[0x0];if(!requireNameOrPath(_0x1e523e))return 0x1;_0x348340[_0x213fb2(0x26c)]&&console[_0x213fb2(0x204)](_0x213fb2(0x1c0)+_0x1e523e);const {journeyId:_0x43d32f}=await resolveJourneyIdFromInput(_0x1e523e,_0x348340,_0x1f332d),_0x1a88af=await withSpinner(_0x213fb2(0x1d1),()=>_0x1f332d[_0x213fb2(0x18d)][_0x213fb2(0x274)](_0x43d32f),{'verbose':_0x348340[_0x213fb2(0x26c)]}),_0x5e1c78=_0x1a88af[_0x213fb2(0x21d)];return console[_0x213fb2(0x204)](_0x213fb2(0x260)+_0x5e1c78[_0x213fb2(0x26e)]+_0x213fb2(0x195)+(_0x5e1c78[_0x213fb2(0x26e)]!==0x1?'s':'')),await handleSDKOutput(_0x5e1c78,_0x348340),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x31317c(0x19e)]='journey:push';[a28_0x31317c(0x1d3)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a28_0x31317c(0x210)]=new SegmentPushCommand();async[a28_0x31317c(0x1d6)](_0x353d1d){const _0x466b14=a28_0x31317c,_0x1c0283=_0x353d1d[_0x466b14(0x1fe)][0x0];let _0x36e923;if(_0x1c0283){const _0x1d2692=await resolveTarget({'arg':_0x1c0283,'contextParent':_0x353d1d[_0x466b14(0x1a2)]['parentSegment'],'cwd':process[_0x466b14(0x1d4)]()});isSuccessfulResolution(_0x1d2692)&&_0x1d2692['type']===_0x466b14(0x25e)&&(_0x36e923=_0x1d2692['filePath']);}const _0x45e3cc={..._0x353d1d,'options':{..._0x353d1d[_0x466b14(0x1a2)],'journeysOnly':!![],..._0x36e923&&{'singleFilePath':_0x36e923}}};return this[_0x466b14(0x210)][_0x466b14(0x1d6)](_0x45e3cc);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x31317c(0x19e)]=a28_0x31317c(0x1e2);[a28_0x31317c(0x1d3)]=a28_0x31317c(0x194);async['execute'](_0x53e71a){const _0x56122d=a28_0x31317c,{options:_0x4a0ea3,args:_0x371a70,tdx:_0x411653}=_0x53e71a,_0x18fcc8=_0x371a70[0x0];if(!requireNameOrPath(_0x18fcc8))return 0x1;if(_0x4a0ea3[_0x56122d(0x26c)])console['error'](_0x56122d(0x1c0)+_0x18fcc8);const {journeyId:_0x529985}=await resolveJourneyIdFromInput(_0x18fcc8,_0x4a0ea3,_0x411653),_0x428b02=await withSpinner(_0x56122d(0x192),()=>_0x411653[_0x56122d(0x18d)]['listVersions'](_0x529985),{'verbose':_0x4a0ea3[_0x56122d(0x26c)]}),{bundleName:_0x2ebc46,versions:_0x1c08bd,latestJourneyId:_0x3d9541}=_0x428b02[_0x56122d(0x21d)];console[_0x56122d(0x204)](_0x2ebc46+':\x20'+_0x1c08bd[_0x56122d(0x26e)]+_0x56122d(0x246)+(_0x1c08bd[_0x56122d(0x26e)]!==0x1?'s':''));const _0x3a7874=_0x1c08bd['map'](_0x5db0a4=>({'version':_0x5db0a4['versionNumber'],'journey_id':_0x5db0a4['journeyId'],'name':_0x5db0a4[_0x56122d(0x19e)],'state':_0x5db0a4[_0x56122d(0x220)],'paused':_0x5db0a4[_0x56122d(0x26d)],'latest':_0x5db0a4[_0x56122d(0x1cd)]===_0x3d9541,'created_at':_0x5db0a4[_0x56122d(0x188)]}));return await handleSDKOutput(_0x3a7874,_0x4a0ea3),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x31317c(0x19e)]=a28_0x31317c(0x1f3);[a28_0x31317c(0x1d3)]=a28_0x31317c(0x268);async[a28_0x31317c(0x1d6)](_0x193d65){const _0x58e4ab=a28_0x31317c,{options:_0x23cd40,args:_0x29683e,tdx:_0x1aad75}=_0x193d65,_0x3494e3=_0x29683e[0x0];if(!requireNameOrPath(_0x3494e3))return 0x1;if(_0x23cd40['verbose'])console[_0x58e4ab(0x204)]('Input:\x20'+_0x3494e3);const {journeyId:_0x369b54,journeyName:_0x3b1928}=await resolveJourneyIdFromInput(_0x3494e3,_0x23cd40,_0x1aad75);if(!_0x23cd40['yes']){const _0x5e665=await confirm(_0x58e4ab(0x24f)+_0x3b1928+'\x22?');if(!_0x5e665)return console[_0x58e4ab(0x204)](_0x58e4ab(0x20f)),0x0;}const _0x379ade=await withSpinner(_0x58e4ab(0x17a),()=>_0x1aad75[_0x58e4ab(0x18d)][_0x58e4ab(0x248)](_0x369b54),{'verbose':_0x23cd40[_0x58e4ab(0x26c)]}),_0x18780f=_0x379ade[_0x58e4ab(0x21d)];return console[_0x58e4ab(0x204)](a28_0x1f6c69[_0x58e4ab(0x214)]('✔')+'\x20Created\x20v'+_0x18780f[_0x58e4ab(0x235)][_0x58e4ab(0x286)]+_0x58e4ab(0x258)+_0x18780f[_0x58e4ab(0x235)][_0x58e4ab(0x19e)]+'\x22'),console['error'](_0x58e4ab(0x283)+_0x18780f['id']),await handleSingleObjectOutput({'id':_0x18780f['id'],'name':_0x18780f[_0x58e4ab(0x235)][_0x58e4ab(0x19e)],'version':_0x18780f[_0x58e4ab(0x235)][_0x58e4ab(0x286)],'state':_0x18780f[_0x58e4ab(0x235)][_0x58e4ab(0x220)],'bundle_id':_0x18780f[_0x58e4ab(0x235)][_0x58e4ab(0x1fa)],'created_at':_0x18780f[_0x58e4ab(0x235)][_0x58e4ab(0x188)]},_0x23cd40),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x31317c(0x19e)]=a28_0x31317c(0x1a7);[a28_0x31317c(0x1d3)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0x31317c(0x1d6)](_0xd984c0){const _0x4ad5ec=a28_0x31317c,{options:_0x367c59,args:_0x567c50,tdx:_0xcbb542}=_0xd984c0,_0x2b952b=_0x567c50[0x0];if(!requireNameOrPath(_0x2b952b))return 0x1;const _0x5fe732=_0x367c59[_0x4ad5ec(0x1b8)];if(!_0x5fe732)return console[_0x4ad5ec(0x204)](_0x4ad5ec(0x25f)),console[_0x4ad5ec(0x204)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x4ba3bf=parseInt(_0x5fe732,0xa);if(isNaN(_0x4ba3bf)||_0x4ba3bf<0x1)return console['error'](_0x4ad5ec(0x18a)+_0x5fe732),0x1;if(_0x367c59[_0x4ad5ec(0x26c)])console[_0x4ad5ec(0x204)](_0x4ad5ec(0x1c0)+_0x2b952b+_0x4ad5ec(0x1ca)+_0x4ba3bf);const {journeyId:_0x23d6c8,parentSegmentId:_0x1f833a}=await resolveJourneyIdFromInput(_0x2b952b,_0x367c59,_0xcbb542),_0x53d795=await withSpinner(_0x4ad5ec(0x21b),()=>_0xcbb542[_0x4ad5ec(0x18d)]['listVersions'](_0x23d6c8),{'verbose':_0x367c59[_0x4ad5ec(0x26c)]}),{versions:_0x5f2b39,latestJourneyId:_0x45595d}=_0x53d795['data'],_0x57d6c0=_0x5f2b39['find'](_0x110710=>_0x110710[_0x4ad5ec(0x286)]===_0x4ba3bf);if(!_0x57d6c0){const _0xad6564=_0x5f2b39[_0x4ad5ec(0x185)](_0xb1bfc0=>'v'+_0xb1bfc0[_0x4ad5ec(0x286)])[_0x4ad5ec(0x1c7)](',\x20');return console[_0x4ad5ec(0x204)]('Error:\x20Version\x20'+_0x4ba3bf+_0x4ad5ec(0x20d)+_0xad6564),0x1;}const _0x4b8935=await withSpinner('Getting\x20version\x20'+_0x4ba3bf+_0x4ad5ec(0x278),()=>_0xcbb542[_0x4ad5ec(0x18d)][_0x4ad5ec(0x252)](_0x57d6c0[_0x4ad5ec(0x1cd)]),{'verbose':_0x367c59[_0x4ad5ec(0x26c)]}),_0x5bb0c2=_0x4b8935[_0x4ad5ec(0x21d)],_0x462861=getConsoleNextUrl(_0x367c59[_0x4ad5ec(0x1cc)],'/app/ps/'+_0x1f833a+'/e/'+_0x57d6c0[_0x4ad5ec(0x1cd)]+_0x4ad5ec(0x21a));return await handleSingleObjectOutput({'id':_0x5bb0c2['id'],'name':_0x5bb0c2[_0x4ad5ec(0x235)][_0x4ad5ec(0x19e)],'version':_0x5bb0c2[_0x4ad5ec(0x235)][_0x4ad5ec(0x286)],'description':_0x5bb0c2[_0x4ad5ec(0x235)][_0x4ad5ec(0x1d3)],'state':_0x5bb0c2['attributes'][_0x4ad5ec(0x220)],'paused':_0x5bb0c2['attributes'][_0x4ad5ec(0x26d)],'reentry_mode':_0x5bb0c2[_0x4ad5ec(0x235)][_0x4ad5ec(0x18f)],'stages':_0x5bb0c2[_0x4ad5ec(0x235)]['journeyStages']?.[_0x4ad5ec(0x26e)]||0x0,..._0x5bb0c2[_0x4ad5ec(0x235)][_0x4ad5ec(0x270)]&&{'goal':_0x5bb0c2['attributes'][_0x4ad5ec(0x270)][_0x4ad5ec(0x19e)]},'latest':_0x57d6c0['journeyId']===_0x45595d,'created_at':_0x5bb0c2[_0x4ad5ec(0x235)][_0x4ad5ec(0x188)],'updated_at':_0x5bb0c2[_0x4ad5ec(0x235)][_0x4ad5ec(0x267)],'url':_0x462861},_0x367c59),0x0;}}
|
|
1
|
+
const a28_0x30f7ad=a28_0x47d7;(function(_0x46583d,_0x2faaf4){const _0x39961d=a28_0x47d7,_0x2f36f0=_0x46583d();while(!![]){try{const _0x4cd5a9=-parseInt(_0x39961d(0x241))/0x1*(-parseInt(_0x39961d(0x191))/0x2)+-parseInt(_0x39961d(0x1ef))/0x3*(parseInt(_0x39961d(0x19d))/0x4)+parseInt(_0x39961d(0x27a))/0x5*(parseInt(_0x39961d(0x25d))/0x6)+parseInt(_0x39961d(0x1cd))/0x7*(parseInt(_0x39961d(0x20e))/0x8)+parseInt(_0x39961d(0x1b3))/0x9+-parseInt(_0x39961d(0x254))/0xa+parseInt(_0x39961d(0x1de))/0xb*(-parseInt(_0x39961d(0x18e))/0xc);if(_0x4cd5a9===_0x2faaf4)break;else _0x2f36f0['push'](_0x2f36f0['shift']());}catch(_0x5e8df9){_0x2f36f0['push'](_0x2f36f0['shift']());}}}(a28_0xa595,0x3c0f5));import a28_0x263096 from'chalk';import a28_0x242512 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a28_0x47d7(_0x159b63,_0x19f04f){_0x159b63=_0x159b63-0x17e;const _0xa59599=a28_0xa595();let _0x47d7ae=_0xa59599[_0x159b63];return _0x47d7ae;}import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a28_0xa595(){const _0x5221b6=['split','No\x20statistics\x20available\x20for\x20journey:\x20','Getting\x20journey\x20traffic\x20data...','Write\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Target\x20directory:\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x0aError:','milestoneSize','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x22\x20paused','segmentPushCommand','hasChanges','📁\x20','user','nodes','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','stringify','\x20(rule\x20match)','Input:\x20','resourceName','resolveParentId','folders','listVersions','renderStats','424648McFOQT','journeyBundleName','Creating\x20new\x20version...','entries','data','journey:version:create','Fetching\x20users\x20and\x20connections...','push','conversion','filePath','\x20changed\x20files','(completed)','createVersion','(archived)','jsonl','dim','no_parent','bold','options','Table:\x20','targetDir','buildIdToEmailMap','\x20\x20Name:\x20','Getting\x20version\x20','\x20\x20Statistics\x20not\x20available','journey:columns','buildIdToNameMap','Aborted.','description','folderId','relativePath','absolutePath','Error:\x20Parent\x20segment\x20context\x20required','repeat','journey:resume','stage','\x20version','reentryMode','args','\x20journey','journey:pause','activation_','journey:push','\x20\x20-\x20','blue','session','state','cwd','Target\x20file:\x20','Error:\x20','Fetching\x20','12Dnupuv','completed','✔\x20Context\x20set:\x20','all','diff','...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','goal','journey:traffic','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','join','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','verbose','Options:','cyan','Getting\x20journey\x20details...','\x20\x20Journey\x20ID:\x20','type','2442010qwDBmZ','listFolders','add','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journeys','sort','Listing\x20journeys...','Folder\x20path:\x20','json','897054cCEoFo','journeyId','includeStats','set','Resuming\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','setPhase','(paused)','execute','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','journey','\x20\x20Parent\x20segment:\x20','✔\x20Found\x20','Error:\x20--version\x20option\x20is\x20required','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journeyBundleId','test','isNew','segmentName','hasPeriod','root\x20folder','getStatistics','journey:list','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','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)','parentSegment','red','10kJtpvZ','\x20Opening\x20','listJourneysWithFolders','has','helpText','INVALID_ARGUMENT','folderPath','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Pattern:\x20','site','Fetching\x20parent\x20segment...','.yml','journeyStages','format','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','updatedAt','getSegment','Pausing\x20journey...','table','versionNumber','\x20activation','Cancelled','Database:\x20','log','utf-8','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','file','\x20versions)','listActivationsFlat','2836680QznzWy','filter','map','46228nHHMdR','yellow','errorCode','version','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Fetching\x20journeys\x20and\x20folders...','(root)','/j/da','history','\x20journey\x20files\x20to\x20','completionRate','error','200nxhCri','🗺️\x20','\x20journeys','yes','exitOrJumpRate','\x22\x20not\x20found','getJourney','Export\x20journey(s)\x20as\x20YAML\x20files','draft','Resolving\x20version...','getActivation','kind','/e/','createdAt','attributes','/app/ps/','audienceId','journeyName','includeHistory','toLowerCase','dryRun','\x20=\x20','3690936ZuGRkc','launched','green','Parent\x20segment:\x20','then','Getting\x20journey\x20statistics...','name','\x20(ID:\x20','connector_config','(draft)','Resolving\x20parent\x20segment...','List\x20journeys\x20in\x20current\x20context','stages','Journey\x20name:\x20','journey:version:view','getColumnMapping','-\x20no\x20files\x20written','journey:stats','Error:\x20Invalid\x20--type\x20\x22','web','journey:pull','connection','/j/da/je','Available\x20stages:\x20','Found\x20','\x27\x20not\x20found\x20in\x20','42ZtsDng','rule','rootFolderId','values','exitOrJumpSize','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','paused','\x20\x20Target:\x20','No\x20journeys\x20found','Resume\x20a\x20paused\x20journey','segment','enteredSize','Error:\x20Version\x20','Error:\x20Stage\x20\x22','resume','length','listJourneysFromParentSegment','33iKdGBs','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','size','relative','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','✔\x20Journey\x20\x22','\x20details...','\x20\x20Folder\x20path:\x20','\x22\x20resumed','from','\x20Created\x20v','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','get','base','List\x20activations\x20for\x20a\x20journey',',\x20version:\x20','message','6336OzIQWQ','localeCompare','pause','activation','find','database'];a28_0xa595=function(){return _0x5221b6;};return a28_0xa595();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x17a46f){const _0x1e9bd9=a28_0x47d7;return!_0x17a46f&&(console[_0x1e9bd9(0x19c)](_0x1e9bd9(0x276)),console[_0x1e9bd9(0x19c)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x17a46f;}function withJsonFormat(_0xe2b12a){const _0x3dead6=a28_0x47d7;if(!_0xe2b12a[_0x3dead6(0x17e)]&&!_0xe2b12a[_0x3dead6(0x25c)]&&!_0xe2b12a['jsonl']&&!_0xe2b12a['tsv'])return{..._0xe2b12a,'format':_0x3dead6(0x25c),'json':!![]};return _0xe2b12a;}function formatJourneyState(_0x2a2dc5){const _0x272d3c=a28_0x47d7;switch(_0x2a2dc5){case _0x272d3c(0x1b4):return a28_0x263096[_0x272d3c(0x1b5)]('(running)');case _0x272d3c(0x1a5):return a28_0x263096[_0x272d3c(0x21d)](_0x272d3c(0x1bc));case _0x272d3c(0x1d3):return a28_0x263096['yellow'](_0x272d3c(0x264));case _0x272d3c(0x242):return a28_0x263096[_0x272d3c(0x23a)](_0x272d3c(0x219));case'archived':return a28_0x263096[_0x272d3c(0x21d)](_0x272d3c(0x21b));default:return'('+_0x2a2dc5+')';}}function formatJourneyItem(_0x455002,_0x42d38f='',_0xfa5403){const _0x4ca639=a28_0x47d7,_0x3d1a43=formatJourneyState(_0x455002[_0x4ca639(0x23c)]),_0x491a1f=_0xfa5403?hyperlink(_0x455002['journeyBundleName'],_0xfa5403):_0x455002[_0x4ca639(0x20f)];return _0x42d38f+_0x4ca639(0x19e)+_0x491a1f+'\x20'+_0x3d1a43;}function escapeRegex(_0x429fc1){return _0x429fc1['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x40ec65){const _0x3f7097=a28_0x47d7,_0x472028=_0x40ec65[_0x3f7097(0x1f5)]('*')[_0x3f7097(0x190)](escapeRegex);return new RegExp(_0x472028[_0x3f7097(0x24b)]('.*'),'i');}function buildRuleToNameMapping(_0x5f2eb0){const _0x22751a=a28_0x47d7,_0x5d6aa9=new Map();if(_0x5f2eb0['segments'])for(const [_0x21ac63,_0x20c90f]of Object[_0x22751a(0x211)](_0x5f2eb0['segments'])){if(_0x20c90f[_0x22751a(0x1ce)]){const _0x36ca79=serializeRule(_0x20c90f['rule']),_0x798707=_0x5d6aa9['get'](_0x36ca79);_0x798707?_0x798707[_0x22751a(0x215)](_0x21ac63):_0x5d6aa9[_0x22751a(0x260)](_0x36ca79,[_0x21ac63]);}}return _0x5d6aa9;}async function resolveJourneyIdFromInput(_0x54f1b8,_0x4d9cad,_0x305af0){const _0x1ac315=a28_0x47d7,_0x21150c=await resolveJourneyTarget(_0x54f1b8,_0x4d9cad['parentSegment'],_0x4d9cad[_0x1ac315(0x24e)]),_0x43a98a=_0x21150c[_0x1ac315(0x278)];if(!_0x43a98a)throw new SDKError(ErrorCode[_0x1ac315(0x27f)],_0x1ac315(0x247));const _0x584215=await withSpinner(_0x1ac315(0x1bd),()=>_0x305af0[_0x1ac315(0x1d7)][_0x1ac315(0x20a)](_0x43a98a),{'verbose':_0x4d9cad[_0x1ac315(0x24e)]}),_0x1608bf=_0x584215[_0x1ac315(0x212)],_0x348d8d=await withSpinner('Resolving\x20journey...',()=>_0x305af0[_0x1ac315(0x269)]['resolveJourneyId'](_0x1608bf,_0x21150c[_0x1ac315(0x1ae)]),{'verbose':_0x4d9cad['verbose']});return{'journeyId':_0x348d8d[_0x1ac315(0x212)],'journeyName':_0x21150c[_0x1ac315(0x1ae)],'parentSegmentId':_0x1608bf};}async function resolveJourneyTarget(_0x30a087,_0x15bdfb,_0x563006){const _0x1a0ff8=a28_0x47d7;if(isYamlFilePath(_0x30a087))try{const _0x257985=await resolveYamlFilePath(_0x30a087);return _0x563006&&(console[_0x1a0ff8(0x19c)]('Resolved\x20YAML\x20file:\x20'+_0x30a087),console[_0x1a0ff8(0x19c)](_0x1a0ff8(0x26a)+_0x257985['parentSegment']),console['error'](_0x1a0ff8(0x224)+_0x257985['segmentName']),console[_0x1a0ff8(0x19c)](_0x1a0ff8(0x1e5)+(_0x257985['folderPath']||'(root)'))),{'journeyName':_0x257985[_0x1a0ff8(0x271)],'parentSegment':_0x257985[_0x1a0ff8(0x278)],'resolved':_0x257985};}catch(_0x3decd1){throw new SDKError(ErrorCode[_0x1a0ff8(0x27f)],_0x1a0ff8(0x268)+_0x3decd1[_0x1a0ff8(0x1ee)]);}if(!_0x15bdfb)throw new SDKError(ErrorCode[_0x1a0ff8(0x27f)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x30a087,'parentSegment':_0x15bdfb};}export class JourneyListCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x275);[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x1be);async[a28_0x30f7ad(0x265)](_0x514662){const _0x4366da=a28_0x30f7ad,{options:_0x512d67,args:_0x29c2d0,tdx:_0x196ed3}=_0x514662,_0xb75c18=_0x29c2d0[0x0],_0x7325f0=_0x512d67[_0x4366da(0x278)];if(!_0x7325f0)return console[_0x4366da(0x19c)](_0x4366da(0x22e)),console[_0x4366da(0x19c)](_0x4366da(0x1e9)),0x1;const _0x2845a4=await withSpinner(_0x4366da(0x1bd),()=>_0x196ed3[_0x4366da(0x1d7)][_0x4366da(0x20a)](_0x7325f0),{'verbose':_0x512d67[_0x4366da(0x24e)]}),_0x32e6e2=_0x2845a4[_0x4366da(0x212)];_0x512d67[_0x4366da(0x24e)]&&(console[_0x4366da(0x19c)](_0x4366da(0x1b6)+_0x7325f0+_0x4366da(0x1ba)+_0x32e6e2+')'),_0xb75c18&&console[_0x4366da(0x19c)](_0x4366da(0x282)+_0xb75c18));const _0x2a1a74=await withSpinner(_0x4366da(0x284),()=>_0x196ed3['segment']['getParentFull'](_0x32e6e2),{'verbose':_0x512d67[_0x4366da(0x24e)]}),_0x236b3b=_0x2a1a74[_0x4366da(0x212)],_0x3a5a42=_0x236b3b[_0x4366da(0x1cf)],_0x5e48e9=await withSpinner(_0x4366da(0x25a),()=>_0x196ed3[_0x4366da(0x269)][_0x4366da(0x27c)](_0x32e6e2,_0x3a5a42),{'verbose':_0x512d67[_0x4366da(0x24e)]});let _0x37d8a8=_0x5e48e9['data'][_0x4366da(0x258)];const _0x26c4ee=_0x5e48e9[_0x4366da(0x212)][_0x4366da(0x20b)],_0x4fd587=new Map();for(const _0x1def7b of _0x26c4ee){_0x4fd587[_0x4366da(0x260)](_0x1def7b['id'],_0x1def7b[_0x4366da(0x1b9)]);}if(_0xb75c18){const _0x3b81e6=globToRegex(_0xb75c18);_0x37d8a8=_0x37d8a8[_0x4366da(0x18f)](_0x16d2a2=>_0x3b81e6[_0x4366da(0x26f)](_0x16d2a2[_0x4366da(0x20f)]));}console['error'](_0x4366da(0x26b)+_0x37d8a8['length']+_0x4366da(0x235)+(_0x37d8a8[_0x4366da(0x1dc)]!==0x1?'s':''));const _0x4a6c25=_0x4bbe55=>{const _0x1caf5f=_0x4366da;return getConsoleNextUrl(_0x512d67[_0x1caf5f(0x283)],'/app/ps/'+_0x32e6e2+_0x1caf5f(0x1a9)+_0x4bbe55+_0x1caf5f(0x198));};if(_0x512d67[_0x4366da(0x17e)]===_0x4366da(0x183))await handleSDKOutput(_0x37d8a8,_0x512d67);else{if(_0x512d67[_0x4366da(0x17e)]===_0x4366da(0x25c)){const _0x1d3a7b=_0x37d8a8[_0x4366da(0x190)](_0x9f0ae7=>({..._0x9f0ae7,'url':_0x4a6c25(_0x9f0ae7['id'])}));await handleSDKOutput(_0x1d3a7b,_0x512d67);}else{console[_0x4366da(0x188)]('['+_0x7325f0+']');const _0x4e3498=new Map(),_0x267c95=[];for(const _0x55a0cf of _0x37d8a8){if(!_0x55a0cf['folderId']||_0x55a0cf['folderId']===_0x3a5a42)_0x267c95[_0x4366da(0x215)](_0x55a0cf);else{const _0x4c98bf=_0x4e3498[_0x4366da(0x1ea)](_0x55a0cf[_0x4366da(0x22b)])||[];_0x4c98bf[_0x4366da(0x215)](_0x55a0cf),_0x4e3498[_0x4366da(0x260)](_0x55a0cf['folderId'],_0x4c98bf);}}const _0x456f15=(_0x1f93b6,_0x56154c)=>_0x1f93b6['journeyBundleName'][_0x4366da(0x1f0)](_0x56154c[_0x4366da(0x20f)],undefined,{'sensitivity':_0x4366da(0x1eb)});_0x267c95['sort'](_0x456f15);for(const _0x4fd493 of _0x267c95){console[_0x4366da(0x188)](formatJourneyItem(_0x4fd493,'',_0x4a6c25(_0x4fd493['id'])));}const _0x3ca3f3=[..._0x4e3498[_0x4366da(0x211)]()][_0x4366da(0x259)]((_0x4a9054,_0x1218b2)=>{const _0x48f5a0=_0x4366da,_0x477e5d=_0x4fd587[_0x48f5a0(0x1ea)](_0x4a9054[0x0])||_0x4a9054[0x0],_0x7d36f0=_0x4fd587[_0x48f5a0(0x1ea)](_0x1218b2[0x0])||_0x1218b2[0x0];return _0x477e5d[_0x48f5a0(0x1f0)](_0x7d36f0,undefined,{'sensitivity':'base'});});for(const [_0x55239a,_0x1db925]of _0x3ca3f3){const _0x163d5b=_0x4fd587[_0x4366da(0x1ea)](_0x55239a)||_0x55239a;console[_0x4366da(0x188)](_0x4366da(0x202)+_0x163d5b),_0x1db925[_0x4366da(0x259)](_0x456f15);for(const _0x5d0cb3 of _0x1db925){console['log'](formatJourneyItem(_0x5d0cb3,'\x20\x20',_0x4a6c25(_0x5d0cb3['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]='journey:view';[a28_0x30f7ad(0x22a)]='Show\x20journey\x20details';async[a28_0x30f7ad(0x265)](_0xbc2c7){const _0x1f43ea=a28_0x30f7ad,{options:_0xb8e89f,args:_0x5120b7,tdx:_0x5e3e65}=_0xbc2c7,_0x5dfae6=_0x5120b7[0x0];if(!_0x5dfae6)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x1f43ea(0x1fe)),console['error'](_0x1f43ea(0x24f)),console[_0x1f43ea(0x19c)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0xb8e89f['verbose']&&console[_0x1f43ea(0x19c)](_0x1f43ea(0x208)+_0x5dfae6);const {journeyId:_0x107c85,parentSegmentId:_0x1c50d8}=await resolveJourneyIdFromInput(_0x5dfae6,_0xb8e89f,_0x5e3e65);if(_0xb8e89f[_0x1f43ea(0x1c6)]){const _0x18cca2=getConsoleNextUrl(_0xb8e89f['site'],_0x1f43ea(0x1ac)+_0x1c50d8+_0x1f43ea(0x1a9)+_0x107c85+_0x1f43ea(0x1c9));return console[_0x1f43ea(0x19c)](a28_0x263096[_0x1f43ea(0x1b5)]('✔')+_0x1f43ea(0x27b)+a28_0x263096[_0x1f43ea(0x250)](_0x18cca2)),openBrowser(_0x18cca2),0x0;}const _0x4cd3e5=await withSpinner(_0x1f43ea(0x251),()=>_0x5e3e65[_0x1f43ea(0x269)][_0x1f43ea(0x1a3)](_0x107c85),{'verbose':_0xb8e89f[_0x1f43ea(0x24e)]}),_0x35418a=_0x4cd3e5['data'],_0x3477af=_0xb8e89f[_0x1f43ea(0x25f)];let _0x26be94;if(_0x3477af)try{const _0x51b721=await withSpinner(_0x1f43ea(0x1b8),()=>_0x5e3e65['journey'][_0x1f43ea(0x274)](_0x107c85),{'verbose':_0xb8e89f[_0x1f43ea(0x24e)]});_0x26be94=_0x51b721[_0x1f43ea(0x212)];}catch{_0xb8e89f['verbose']&&console['error'](_0x1f43ea(0x226));}const _0x3218c2=getConsoleNextUrl(_0xb8e89f[_0x1f43ea(0x283)],_0x1f43ea(0x1ac)+_0x1c50d8+_0x1f43ea(0x1a9)+_0x107c85+_0x1f43ea(0x1c9)),_0x26b257={'id':_0x35418a['id'],'name':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x1b9)],'description':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x22a)],'state':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x23c)],'paused':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x1d3)],'reentry_mode':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x233)],'stages':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x286)]?.[_0x1f43ea(0x1dc)]||0x0,..._0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x248)]&&{'goal':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x248)]['name']},..._0x26be94&&{'statistics':{'size':_0x26be94[_0x1f43ea(0x1e0)],'entered':_0x26be94[_0x1f43ea(0x1d8)],'goal_achieved':_0x26be94['goalSize'],'completion_rate':_0x26be94[_0x1f43ea(0x19b)],'exit_or_jump':_0x26be94[_0x1f43ea(0x1d1)],'exit_or_jump_rate':_0x26be94[_0x1f43ea(0x1a1)],'stages':_0x26be94[_0x1f43ea(0x1bf)]}},'url':_0x3218c2};return await handleSingleObjectOutput(_0x26b257,_0xb8e89f),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a28_0x30f7ad(0x1c4);[a28_0x30f7ad(0x22a)]='Show\x20journey\x20statistics';async['execute'](_0x5beb96){const _0xed3a2d=a28_0x30f7ad,{options:_0x33fe27,args:_0x22baa0,tdx:_0x2b8682}=_0x5beb96,_0x21771b=_0x22baa0[0x0];if(!requireNameOrPath(_0x21771b))return 0x1;_0x33fe27['verbose']&&console['error']('Input:\x20'+_0x21771b);const _0x34d39c=_0x33fe27,_0x3583a3=_0x34d39c['from'],_0x5779fc=_0x34d39c['to'],_0x140584=_0x34d39c['includeHistory'],_0x5709ee=_0x34d39c[_0xed3a2d(0x231)];_0x140584&&!_0x3583a3&&!_0x5779fc&&console[_0xed3a2d(0x19c)](_0xed3a2d(0x1f9));const _0x532d3a=_0x140584?withJsonFormat(_0x33fe27):_0x33fe27,{journeyId:_0x54a9c5,journeyName:_0x230114}=await resolveJourneyIdFromInput(_0x21771b,_0x532d3a,_0x2b8682),_0x20cb1a=_0x3583a3||_0x5779fc?{'from':_0x3583a3,'to':_0x5779fc}:undefined,_0x4c5fef=await withSpinner(_0xed3a2d(0x1b8),()=>Promise[_0xed3a2d(0x244)]([_0x2b8682['journey']['getJourney'](_0x54a9c5),_0x2b8682[_0xed3a2d(0x269)][_0xed3a2d(0x274)](_0x54a9c5,_0x20cb1a)]),{'verbose':_0x532d3a[_0xed3a2d(0x24e)]}),[_0x4ec4e2,_0x3de72e]=_0x4c5fef[_0xed3a2d(0x212)];if(!_0x3de72e||_0x3de72e[_0xed3a2d(0x25e)]===null)return console[_0xed3a2d(0x19c)](_0xed3a2d(0x1f6)+_0x230114),console['error'](_0xed3a2d(0x24d)),0x0;const _0x102634=buildStageNameMap(_0x4ec4e2),_0xfa1bd6=!!(_0x20cb1a&&_0x3de72e['history']?.[_0xed3a2d(0x1dc)]),_0x31d625={'stageNameMap':_0x102634,'hasPeriod':_0xfa1bd6,'includeHistory':!!_0x140584};if(_0x5709ee&&_0x3de72e[_0xed3a2d(0x1bf)]){const _0x1b4b8c=_0x3de72e[_0xed3a2d(0x1bf)][_0xed3a2d(0x1f3)](_0x1a67c5=>{const _0x23894d=_0xed3a2d,_0x3582bf=_0x102634[_0x23894d(0x1ea)](_0x1a67c5['id'])??'';return _0x3582bf[_0x23894d(0x1b0)]()===_0x5709ee[_0x23894d(0x1b0)]();});if(_0x1b4b8c)return await handleSingleObjectOutput(formatStageStats(_0x1b4b8c,_0x31d625),_0x532d3a),0x0;const _0x3b2aca=_0x3de72e[_0xed3a2d(0x1bf)]['map'](_0x168d13=>_0x102634[_0xed3a2d(0x1ea)](_0x168d13['id'])??_0x168d13['id']);return console[_0xed3a2d(0x19c)](_0xed3a2d(0x1da)+_0x5709ee+_0xed3a2d(0x1a2)),console[_0xed3a2d(0x19c)](_0xed3a2d(0x1ca)+_0x3b2aca[_0xed3a2d(0x24b)](',\x20')),0x1;}const _0x1aab43=_0x3de72e[_0xed3a2d(0x1bf)]?.[_0xed3a2d(0x190)](_0x452245=>formatStageStats(_0x452245,_0x31d625)),_0x506ee0=assembleJourneyStats(_0x3de72e,{'from':_0x3583a3,'to':_0x5779fc,'includeHistory':_0x140584});return await this['renderStats'](_0x506ee0,_0x1aab43??[],_0x532d3a),0x0;}async[a28_0x30f7ad(0x20d)](_0xa551b8,_0x4082e9,_0x1a5a7e){const _0x2f2d20=a28_0x30f7ad,_0x3d75fd=_0x1a5a7e[_0x2f2d20(0x17e)]==='json'||_0x1a5a7e[_0x2f2d20(0x17e)]==='jsonl'||_0x1a5a7e['json']||_0x1a5a7e[_0x2f2d20(0x21c)];if(_0x3d75fd){_0xa551b8[_0x2f2d20(0x1bf)]=_0x4082e9,await handleSingleObjectOutput(_0xa551b8,_0x1a5a7e);return;}await handleSingleObjectOutput(_0xa551b8,_0x1a5a7e);for(const _0x2e0ece of _0x4082e9){console[_0x2f2d20(0x188)](''),console[_0x2f2d20(0x188)](String(a28_0x263096[_0x2f2d20(0x250)][_0x2f2d20(0x21f)]('['+_0x2e0ece[_0x2f2d20(0x1b9)]+']'))+a28_0x263096[_0x2f2d20(0x21d)]('\x20'+_0x2e0ece['id']));const {id:_0x2ca55e,name:_0x24ae7f,..._0x41678f}=_0x2e0ece;await handleSingleObjectOutput(_0x41678f,_0x1a5a7e);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x249);[a28_0x30f7ad(0x22a)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x30f7ad(0x265)](_0x3e0a82){const _0x40cb25=a28_0x30f7ad,{options:_0x408d38,args:_0x4ad784,tdx:_0xa70942}=_0x3e0a82,_0x24e6e0=_0x4ad784[0x0];if(!requireNameOrPath(_0x24e6e0))return 0x1;_0x408d38[_0x40cb25(0x24e)]&&console[_0x40cb25(0x19c)]('Input:\x20'+_0x24e6e0);const _0x1bc0c1=_0x408d38,_0x2bdec0=_0x1bc0c1['type'],_0x5d015d=_0x1bc0c1[_0x40cb25(0x1e7)],_0x425a23=_0x1bc0c1['to'],_0x3cf0fa=_0x1bc0c1['limit'];if(_0x2bdec0&&_0x2bdec0!==_0x40cb25(0x216)&&_0x2bdec0!==_0x40cb25(0x1f2))return console['error'](_0x40cb25(0x1c5)+_0x2bdec0+_0x40cb25(0x266)),0x1;const _0x37f098=withJsonFormat(_0x408d38),{journeyId:_0x4d6e56,journeyName:_0x34fad6}=await resolveJourneyIdFromInput(_0x24e6e0,_0x37f098,_0xa70942),_0x20b091={'type':_0x2bdec0,'from':_0x5d015d,'to':_0x425a23,'limit':_0x3cf0fa},_0x47d43c=await withSpinner(_0x40cb25(0x1f7),()=>_0xa70942[_0x40cb25(0x269)]['getTrafficData'](_0x4d6e56,_0x20b091),{'verbose':_0x37f098[_0x40cb25(0x24e)]}),_0x2e7691=_0x47d43c[_0x40cb25(0x212)],_0x5ac6c9=_0x2e7691[_0x40cb25(0x216)]&&(_0x2e7691['conversion'][_0x40cb25(0x204)][_0x40cb25(0x1dc)]>0x0||_0x2e7691[_0x40cb25(0x216)]['links'][_0x40cb25(0x1dc)]>0x0),_0x438bd0=_0x2e7691['activation']&&_0x2e7691[_0x40cb25(0x1f2)]['length']>0x0;if(!_0x5ac6c9&&!_0x438bd0)return console[_0x40cb25(0x19c)](_0x40cb25(0x1e2)+_0x34fad6),console[_0x40cb25(0x19c)](_0x40cb25(0x18a)),_0x5d015d&&_0x425a23&&console[_0x40cb25(0x19c)](_0x40cb25(0x1d2)),0x0;return await handleSingleObjectOutput(_0x2e7691,_0x37f098),0x0;}}function formatStageStats(_0x5e7c41,_0x572026){const _0x144de5=a28_0x30f7ad,_0xde30b6=_0x572026[_0x144de5(0x272)]&&_0x5e7c41[_0x144de5(0x199)]?.[_0x144de5(0x1dc)]?aggregateStageHistory(_0x5e7c41[_0x144de5(0x199)]):{'size':_0x5e7c41[_0x144de5(0x1e0)],'entered':_0x5e7c41[_0x144de5(0x1d8)],'milestone':_0x5e7c41[_0x144de5(0x1fd)],'milestone_rate':_0x5e7c41['completeMilestoneRate'],'exit_or_jump':_0x5e7c41[_0x144de5(0x1d1)],'exit_or_jump_rate':_0x5e7c41[_0x144de5(0x1a1)]},_0x161f85={'id':_0x5e7c41['id'],'name':_0x572026['stageNameMap']['get'](_0x5e7c41['id'])??_0x5e7c41['id'],..._0xde30b6};return _0x572026[_0x144de5(0x272)]&&_0x572026[_0x144de5(0x1af)]&&_0x5e7c41[_0x144de5(0x199)]&&(_0x161f85['history']=_0x5e7c41[_0x144de5(0x199)]),_0x161f85;}export class JourneyPauseCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x236);[a28_0x30f7ad(0x22a)]='Pause\x20a\x20running\x20journey';async[a28_0x30f7ad(0x265)](_0x55f8fb){const _0x39c279=a28_0x30f7ad,{options:_0x2d3852,args:_0x300d17,tdx:_0x21439b}=_0x55f8fb,_0x2cf2e6=_0x300d17[0x0];if(!requireNameOrPath(_0x2cf2e6))return 0x1;_0x2d3852[_0x39c279(0x24e)]&&console[_0x39c279(0x19c)]('Input:\x20'+_0x2cf2e6);const {journeyId:_0xf216e9,journeyName:_0x454af4}=await resolveJourneyIdFromInput(_0x2cf2e6,_0x2d3852,_0x21439b);if(!_0x2d3852[_0x39c279(0x1a0)]){const _0x4b633f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x454af4+'\x22?');if(!_0x4b633f)return console[_0x39c279(0x19c)](_0x39c279(0x186)),0x0;}const _0x1704ba=await withSpinner(_0x39c279(0x182),()=>_0x21439b[_0x39c279(0x269)][_0x39c279(0x1f1)](_0xf216e9),{'verbose':_0x2d3852['verbose']}),_0x2e699a=_0x1704ba[_0x39c279(0x212)];return console[_0x39c279(0x19c)](_0x39c279(0x1e3)+_0x2e699a[_0x39c279(0x1ab)][_0x39c279(0x1b9)]+_0x39c279(0x1ff)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x230);[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x1d6);async[a28_0x30f7ad(0x265)](_0x57a723){const _0x31b967=a28_0x30f7ad,{options:_0x2a5055,args:_0x351a69,tdx:_0x264f0e}=_0x57a723,_0x257f98=_0x351a69[0x0];if(!requireNameOrPath(_0x257f98))return 0x1;_0x2a5055[_0x31b967(0x24e)]&&console['error'](_0x31b967(0x208)+_0x257f98);const {journeyId:_0x12fb50,journeyName:_0x411aa1}=await resolveJourneyIdFromInput(_0x257f98,_0x2a5055,_0x264f0e);if(!_0x2a5055[_0x31b967(0x1a0)]){const _0x43ee04=await confirm(_0x31b967(0x17f)+_0x411aa1+'\x22?');if(!_0x43ee04)return console[_0x31b967(0x19c)](_0x31b967(0x186)),0x0;}const _0x59d471=await withSpinner(_0x31b967(0x261),()=>_0x264f0e[_0x31b967(0x269)][_0x31b967(0x1db)](_0x12fb50),{'verbose':_0x2a5055['verbose']}),_0x37fcbe=_0x59d471[_0x31b967(0x212)];return console[_0x31b967(0x19c)]('✔\x20Journey\x20\x22'+_0x37fcbe[_0x31b967(0x1ab)][_0x31b967(0x1b9)]+_0x31b967(0x1e6)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x1c7);[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x1a4);async[a28_0x30f7ad(0x265)](_0x313cd3){const _0x5cd730=a28_0x30f7ad,{options:_0x4981b9,args:_0x2fda37,tdx:_0x4e8ff2}=_0x313cd3,_0x4fbd85=_0x4981b9,_0x19811a=_0x2fda37[0x0],_0xc6eb4b=_0x19811a&&isYamlFilePath(_0x19811a),_0x144aff=await resolveTarget({'arg':_0xc6eb4b?_0x19811a:undefined,'contextParent':_0x4981b9[_0x5cd730(0x278)],'cwd':process[_0x5cd730(0x23d)]()});if(!isSuccessfulResolution(_0x144aff))return _0x144aff[_0x5cd730(0x193)]===_0x5cd730(0x21e)?(console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x192)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5cd730(0x19c)](_0x5cd730(0x277)),console[_0x5cd730(0x19c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x5cd730(0x19c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x5cd730(0x19c)](_0x5cd730(0x26d))):(console['error'](a28_0x263096[_0x5cd730(0x279)](_0x5cd730(0x23f)+_0x144aff[_0x5cd730(0x1ee)]+'\x0a')),_0x144aff[_0x5cd730(0x27e)]&&console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x250)](_0x144aff[_0x5cd730(0x27e)]))),0x1;let _0x2ba1b0=_0xc6eb4b?undefined:_0x19811a,_0x459521,_0x3b0009;_0x144aff[_0x5cd730(0x253)]===_0x5cd730(0x18b)&&(_0x2ba1b0=_0x144aff[_0x5cd730(0x209)],_0x459521=_0x144aff[_0x5cd730(0x217)],_0x3b0009=_0x144aff[_0x5cd730(0x280)]);const _0x52cecc=_0x144aff['parentName'],_0xf85eb7=_0x144aff[_0x5cd730(0x222)];_0x4fbd85[_0x5cd730(0x24e)]&&(console[_0x5cd730(0x19c)]('Parent\x20segment:\x20'+_0x52cecc),console['error'](_0x5cd730(0x1fa)+_0xf85eb7),_0x2ba1b0&&console[_0x5cd730(0x19c)](_0x5cd730(0x1c0)+_0x2ba1b0),_0x459521&&console[_0x5cd730(0x19c)](_0x5cd730(0x23e)+_0x459521),_0x3b0009&&console[_0x5cd730(0x19c)](_0x5cd730(0x25b)+_0x3b0009));const _0x9887d5=await withSpinner(_0x5cd730(0x1bd),()=>_0x4e8ff2[_0x5cd730(0x1d7)]['resolveParentId'](_0x52cecc),{'verbose':_0x4981b9[_0x5cd730(0x24e)]}),_0x38ae1c=_0x9887d5['data'],{journeys:_0x36ebbf,folders:_0x2027d9}=await withSpinner(_0x5cd730(0x196),async()=>{const _0x3cf2b7=_0x5cd730,[_0x26c9ad,_0x4940a3]=await Promise[_0x3cf2b7(0x244)]([_0x4e8ff2[_0x3cf2b7(0x269)][_0x3cf2b7(0x1dd)](_0x38ae1c,undefined,{'includeAllVersions':!![]}),_0x4e8ff2[_0x3cf2b7(0x1d7)][_0x3cf2b7(0x255)](_0x38ae1c)]);return{'journeys':_0x26c9ad,'folders':_0x4940a3};},{'verbose':_0x4981b9[_0x5cd730(0x24e)]})[_0x5cd730(0x1b7)](_0x3b2618=>_0x3b2618['data']);let _0x9e4cb8=_0x36ebbf;const _0x5a50e0=buildFolderIdToPathMap(_0x2027d9);if(_0x2ba1b0){const _0x457c7e=_0x9e4cb8[_0x5cd730(0x18f)](_0x2b61f0=>_0x2b61f0['journeyBundleName']['toLowerCase']()===_0x2ba1b0[_0x5cd730(0x1b0)]());if(_0x457c7e[_0x5cd730(0x1dc)]===0x0)return console[_0x5cd730(0x19c)]('Error:\x20Journey\x20not\x20found:\x20'+_0x2ba1b0),console[_0x5cd730(0x19c)](_0x5cd730(0x281)),0x1;_0x9e4cb8=_0x457c7e;}if(_0x3b0009!==undefined){const _0x2de957=_0x9e4cb8['filter'](_0x3a9be4=>{const _0x2f525f=_0x5cd730,_0x18f720=_0x3a9be4[_0x2f525f(0x22b)]?_0x5a50e0[_0x2f525f(0x1ea)](_0x3a9be4[_0x2f525f(0x22b)])||'':'';return _0x18f720===_0x3b0009;});if(_0x2de957[_0x5cd730(0x1dc)]===0x0&&_0x9e4cb8[_0x5cd730(0x1dc)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x2ba1b0+_0x5cd730(0x1cc)+(_0x3b0009||_0x5cd730(0x273))),console[_0x5cd730(0x19c)](_0x5cd730(0x1df));for(const _0x5c73a8 of _0x9e4cb8){const _0x355f4d=_0x5c73a8['folderId']?_0x5a50e0[_0x5cd730(0x1ea)](_0x5c73a8[_0x5cd730(0x22b)])||'':'';console[_0x5cd730(0x19c)](_0x5cd730(0x239)+(_0x355f4d||_0x5cd730(0x197))+'/'+_0x5c73a8['journeyBundleName']);}return 0x1;}_0x9e4cb8=_0x2de957;}if(_0x9e4cb8[_0x5cd730(0x1dc)]===0x0)return console[_0x5cd730(0x19c)](_0x5cd730(0x1d5)),0x0;const _0x3fb129=new Map();for(const _0x49d081 of _0x9e4cb8){const _0x44cf92=_0x49d081[_0x5cd730(0x26e)];!_0x3fb129[_0x5cd730(0x27d)](_0x44cf92)&&_0x3fb129[_0x5cd730(0x260)](_0x44cf92,[]),_0x3fb129[_0x5cd730(0x1ea)](_0x44cf92)[_0x5cd730(0x215)](_0x49d081);}for(const _0x5726f2 of _0x3fb129[_0x5cd730(0x1d0)]()){_0x5726f2[_0x5cd730(0x259)]((_0x143a5d,_0x5333f0)=>(_0x143a5d[_0x5cd730(0x184)]||0x0)-(_0x5333f0[_0x5cd730(0x184)]||0x0));}const _0x4bfb73=[],{idToEmailMap:_0x4c7449,connectionIdToNameMap:_0x28951e}=await withSpinner(_0x5cd730(0x214),async()=>{const _0x448940=_0x5cd730,[_0x5076b,_0x1aea86]=await Promise[_0x448940(0x244)]([_0x4e8ff2[_0x448940(0x203)][_0x448940(0x223)](),_0x4e8ff2[_0x448940(0x1c8)][_0x448940(0x228)]()]);return{'idToEmailMap':_0x5076b,'connectionIdToNameMap':_0x1aea86};},{'verbose':_0x4981b9[_0x5cd730(0x24e)]})[_0x5cd730(0x1b7)](_0xd4ba85=>_0xd4ba85['data']);for(const _0x1a994f of _0x3fb129[_0x5cd730(0x1d0)]()){const _0x4b9b8e=_0x1a994f[0x0][_0x5cd730(0x20f)],_0x4100d1=_0x1a994f[0x0][_0x5cd730(0x22b)],_0x411bc6=_0x4100d1?_0x5a50e0[_0x5cd730(0x1ea)](_0x4100d1)||'':'',_0x44ad68=_0x411bc6?a28_0x242512['join'](_0xf85eb7,_0x411bc6):_0xf85eb7,_0x4d1f8f=_0x459521||a28_0x242512[_0x5cd730(0x24b)](_0x44ad68,sanitizeFileName(_0x4b9b8e)+'.yml');let _0x1e4211,_0x5e6b7a;if(existsSync(_0x4d1f8f))try{const _0x57b099=readFileSync(_0x4d1f8f,'utf-8'),_0x3a0182=parseYamlString(_0x57b099);_0x5e6b7a=_0x3a0182,_0x1e4211=buildRuleToNameMapping(_0x3a0182),_0x4fbd85['verbose']&&_0x1e4211[_0x5cd730(0x1e0)]>0x0&&console[_0x5cd730(0x19c)](_0x5cd730(0x1cb)+_0x1e4211[_0x5cd730(0x1e0)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x4b9b8e);}catch(_0x10a0d5){_0x4fbd85['verbose']&&console[_0x5cd730(0x19c)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x10a0d5[_0x5cd730(0x1ee)]);}const _0x493513=[],_0x596bd2=new Set(),_0x23cf38=new Map(),_0x43c461=new Map(),_0x1da0a9=new Set(),_0x10d8a6=new Map(),_0x356179=new Map(),_0x36a50d=createJumpTargetCache();await withProgressSpinner(_0x5cd730(0x240)+_0x4b9b8e+_0x5cd730(0x246),async _0xd5f687=>{const _0x2f5314=_0x5cd730;for(const _0x335b30 of _0x1a994f){const _0xafc51d=_0x1a994f['length']>0x1?_0x335b30[_0x2f5314(0x20f)]+'\x20v'+(_0x335b30[_0x2f5314(0x184)]||0x1):_0x335b30['journeyBundleName'];_0xd5f687[_0x2f5314(0x263)](_0x2f5314(0x240)+_0xafc51d);const _0x320eba=await _0x4e8ff2['journey'][_0x2f5314(0x1a3)](_0x335b30['id']),_0x333c96=_0x320eba['attributes']?.[_0x2f5314(0x1ad)],_0x12e611={'resolveSegment':async _0x388f59=>{const _0x2d516f=_0x2f5314;if(!_0x333c96)return{'name':_0x388f59,'isJourneyLocal':![]};const _0x370f5e=_0x23cf38[_0x2d516f(0x1ea)](_0x388f59);if(_0x370f5e)return _0x370f5e;try{const _0x5499ae=await _0x4e8ff2[_0x2d516f(0x1d7)][_0x2d516f(0x181)](_0x333c96,_0x388f59),_0x5b7665=_0x5499ae[_0x2d516f(0x1a8)]===SEGMENT_KIND_JOURNEY;let _0x5c6c77,_0x5f14a2=_0x5499ae[_0x2d516f(0x1b9)];if(_0x5b7665&&_0x5499ae[_0x2d516f(0x1ce)]){const _0x548fa1=await segmentResponseToDef(_0x5499ae,{'resolveSegmentName':async _0x1e03cc=>{const _0x2c1263=_0x2d516f,_0x9c4fd3=_0x23cf38['get'](_0x1e03cc);if(_0x9c4fd3)return _0x9c4fd3[_0x2c1263(0x1b9)];const _0x50697b=await _0x12e611['resolveSegment'](_0x1e03cc);return _0x50697b['name'];}}),_0x4b6e18=_0x548fa1[_0x2d516f(0x1ce)];_0x5c6c77={'description':_0x5499ae[_0x2d516f(0x22a)],'rule':_0x4b6e18};const _0x2f364b=serializeRule(_0x4b6e18),_0x565fb3=_0x43c461[_0x2d516f(0x1ea)](_0x2f364b);if(_0x565fb3)_0x5f14a2=_0x565fb3,_0x5c6c77=undefined,_0x4fbd85[_0x2d516f(0x24e)]&&console[_0x2d516f(0x19c)](_0x2d516f(0x1fb)+_0x5499ae['name']+'\x20->\x20'+_0x565fb3);else{let _0x333009=![];if(_0x1e4211){const _0xe906c0=_0x1e4211[_0x2d516f(0x1ea)](_0x2f364b);if(_0xe906c0){const _0x21bc54=_0xe906c0['find'](_0x3ff59a=>!_0x596bd2[_0x2d516f(0x27d)](_0x3ff59a));_0x21bc54&&(_0x5f14a2=_0x21bc54,_0x596bd2[_0x2d516f(0x256)](_0x21bc54),_0x43c461[_0x2d516f(0x260)](_0x2f364b,_0x21bc54),_0x333009=!![],_0x4fbd85[_0x2d516f(0x24e)]&&console[_0x2d516f(0x19c)](_0x2d516f(0x24c)+_0x21bc54+_0x2d516f(0x207)));}}if(!_0x333009){const _0x26ffcd=generateJourneyLocalName(_0x5499ae['name']);_0x26ffcd&&(_0x5f14a2=_0x26ffcd);let _0x9b8bc=_0x5f14a2,_0x13c04e=0x2;while(_0x596bd2[_0x2d516f(0x27d)](_0x9b8bc)){_0x9b8bc=_0x5f14a2+'_'+_0x13c04e,_0x13c04e++;}_0x596bd2['add'](_0x9b8bc),_0x43c461[_0x2d516f(0x260)](_0x2f364b,_0x9b8bc),_0x5f14a2=_0x9b8bc;}}}const _0x4aa2f8={'name':_0x5f14a2,'isJourneyLocal':_0x5b7665,'definition':_0x5c6c77};return _0x23cf38[_0x2d516f(0x260)](_0x388f59,_0x4aa2f8),_0x4aa2f8;}catch(_0x3612f1){return _0x4981b9[_0x2d516f(0x24e)]&&console[_0x2d516f(0x19c)](_0x2d516f(0x257)+_0x388f59+':\x20'+_0x3612f1[_0x2d516f(0x1ee)]),{'name':_0x388f59,'isJourneyLocal':![]};}},'resolveActivation':async _0x2d737f=>{const _0x30e4e2=_0x2f5314,_0x1907fa=_0x10d8a6[_0x30e4e2(0x1ea)](_0x2d737f);if(_0x1907fa)return _0x1907fa;try{const _0x48f1ae=await _0x4e8ff2[_0x30e4e2(0x269)][_0x30e4e2(0x1a7)](_0x335b30['id'],_0x2d737f),_0x1042d5=journeyActivationStepToYaml(_0x48f1ae,_0x4c7449,_0x28951e),_0x52f5ac=JSON[_0x30e4e2(0x206)]({'name':_0x1042d5[_0x30e4e2(0x1b9)],'connection':_0x1042d5[_0x30e4e2(0x1c8)],'connector_config':_0x1042d5[_0x30e4e2(0x1bb)]}),_0x403b77=_0x356179[_0x30e4e2(0x1ea)](_0x52f5ac);if(_0x403b77){const _0x301aac={'name':_0x403b77,'isJourneyLocal':!![],'definition':_0x1042d5};return _0x10d8a6[_0x30e4e2(0x260)](_0x2d737f,_0x301aac),_0x301aac;}const _0x1dcbe1=_0x48f1ae[_0x30e4e2(0x1ab)]['activationParams'][_0x30e4e2(0x1b9)]||_0x2d737f,_0x1408e5=sanitizeYamlKey(_0x1dcbe1)||_0x30e4e2(0x237)+_0x2d737f;let _0x3a02b5=_0x1408e5,_0x2f6236=0x2;while(_0x1da0a9['has'](_0x3a02b5)){_0x3a02b5=_0x1408e5+'_'+_0x2f6236,_0x2f6236++;}_0x1da0a9['add'](_0x3a02b5),_0x356179[_0x30e4e2(0x260)](_0x52f5ac,_0x3a02b5);const _0x33ac3b={'name':_0x3a02b5,'isJourneyLocal':!![],'definition':_0x1042d5};return _0x10d8a6[_0x30e4e2(0x260)](_0x2d737f,_0x33ac3b),_0x33ac3b;}catch(_0x8f79e){return _0x4981b9[_0x30e4e2(0x24e)]&&console[_0x30e4e2(0x19c)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x2d737f+':\x20'+_0x8f79e[_0x30e4e2(0x1ee)]),{'name':_0x2d737f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x28b8fd,_0x4b8c1c)=>{const _0x5c065b=_0x2f5314;return resolveJumpTarget(_0x28b8fd,_0x4b8c1c,_0x36a50d,_0x2c0dc1=>_0x4e8ff2[_0x5c065b(0x269)][_0x5c065b(0x1a3)](_0x2c0dc1));}},_0x1292f0=await journeyResponseToDef(_0x320eba,_0x12e611);_0x493513['push']({'item':_0x335b30,'yaml':_0x1292f0});}},{'verbose':_0x4981b9[_0x5cd730(0x24e)]});const _0x19b179=await _0x4e8ff2[_0x5cd730(0x269)]['getLatestJourneyId'](_0x1a994f[0x0][_0x5cd730(0x26e)]),_0x5e5d5a=buildMergedJourneyDef(_0x493513,_0x1e4211,_0x19b179),_0x4a117b=normalizeJourneyDef(_0x5e5d5a,_0x5e6b7a),_0x3f548d=toYamlString(_0x4a117b),_0x4766bd=_0x459521||a28_0x242512['join'](_0x44ad68,sanitizeFileName(_0x4b9b8e)+_0x5cd730(0x285));!_0x459521&&_0x411bc6&&!existsSync(_0x44ad68)&&mkdirSync(_0x44ad68,{'recursive':!![]});const _0x30c874=a28_0x242512[_0x5cd730(0x1e1)](process[_0x5cd730(0x23d)](),_0x4766bd);if(existsSync(_0x4766bd)){const _0x5221b5=readFileSync(_0x4766bd,_0x5cd730(0x189)),_0x388761=generateDiff(_0x5221b5,_0x3f548d),_0xb83a1a=hasChanges(_0x388761);_0x4bfb73['push']({'relativePath':_0x30c874,'absolutePath':_0x4766bd,'content':_0x3f548d,'isNew':![],'hasChanges':_0xb83a1a,'diff':_0xb83a1a?formatDiffWithColors(_0x388761):undefined});}else _0x4bfb73[_0x5cd730(0x215)]({'relativePath':_0x30c874,'absolutePath':_0x4766bd,'content':_0x3f548d,'isNew':!![],'hasChanges':![]});}const _0x51f61b=_0x4bfb73[_0x5cd730(0x18f)](_0x5330e2=>_0x5330e2[_0x5cd730(0x270)]),_0x5b0311=_0x4bfb73[_0x5cd730(0x18f)](_0x24af8a=>!_0x24af8a[_0x5cd730(0x270)]&&_0x24af8a[_0x5cd730(0x201)]),_0x3411d6=_0x4bfb73['filter'](_0xf107f8=>!_0xf107f8['isNew']&&!_0xf107f8[_0x5cd730(0x201)]),_0x57d597=_0x9e4cb8[_0x5cd730(0x1dc)],_0x373524=_0x3fb129[_0x5cd730(0x1e0)],_0x1880f5=_0x57d597>_0x373524?'\x20('+_0x57d597+_0x5cd730(0x18c):'';console[_0x5cd730(0x19c)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a28_0x263096[_0x5cd730(0x250)](_0x373524+_0x5cd730(0x19f))+a28_0x263096['dim'](_0x1880f5)),console[_0x5cd730(0x19c)]('\x20\x20'+a28_0x263096[_0x5cd730(0x1b5)]('+\x20'+_0x51f61b[_0x5cd730(0x1dc)]+'\x20new\x20files')),console[_0x5cd730(0x19c)]('\x20\x20'+a28_0x263096[_0x5cd730(0x192)]('~\x20'+_0x5b0311['length']+_0x5cd730(0x218))),console[_0x5cd730(0x19c)]('\x20\x20'+a28_0x263096[_0x5cd730(0x21d)]('=\x20'+_0x3411d6['length']+'\x20unchanged\x20files')),console[_0x5cd730(0x19c)](_0x5cd730(0x1d4)+a28_0x263096[_0x5cd730(0x250)](_0xf85eb7)+'\x0a');if(_0x5b0311[_0x5cd730(0x1dc)]>0x0)for(const _0x8163ca of _0x5b0311){console['error']('\x0aChanges\x20to\x20\x27'+_0x8163ca[_0x5cd730(0x22c)]+'\x27:'),console[_0x5cd730(0x19c)]('─'[_0x5cd730(0x22f)](0x3c)),console[_0x5cd730(0x19c)](_0x8163ca[_0x5cd730(0x245)]),console['error']('─'[_0x5cd730(0x22f)](0x3c));}if(_0x4fbd85[_0x5cd730(0x1b1)])return console[_0x5cd730(0x19c)](a28_0x263096['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x51f61b[_0x5cd730(0x1dc)]===0x0&&_0x5b0311[_0x5cd730(0x1dc)]===0x0)return console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x1b5)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x52cecc},_0x4fbd85[_0x5cd730(0x23b)]),console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x1b5)](_0x5cd730(0x243)+a28_0x263096[_0x5cd730(0x21d)]('parent_segment')+_0x5cd730(0x1b2)+a28_0x263096[_0x5cd730(0x250)](_0x52cecc))),0x0;if(!_0x4fbd85[_0x5cd730(0x1a0)]&&(_0x51f61b[_0x5cd730(0x1dc)]>0x0||_0x5b0311[_0x5cd730(0x1dc)]>0x0)){if(!isInteractive())return console[_0x5cd730(0x19c)](a28_0x263096['red'](_0x5cd730(0x1fc)),_0x5cd730(0x195)),console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x21d)](_0x5cd730(0x267))),0x1;const _0xfca0a1=await confirmKey(_0x5cd730(0x1f8)+(_0x51f61b[_0x5cd730(0x1dc)]+_0x5b0311['length'])+'\x20files?');if(!_0xfca0a1)return console[_0x5cd730(0x19c)](a28_0x263096['yellow'](_0x5cd730(0x229)),_0x5cd730(0x1c3)),0x1;}!existsSync(_0xf85eb7)&&mkdirSync(_0xf85eb7,{'recursive':!![]});const _0x3d8f71=a28_0x242512[_0x5cd730(0x24b)](_0xf85eb7,'tdx.json');writeFileSync(_0x3d8f71,createTdxConfigContent(_0x52cecc),_0x5cd730(0x189));for(const _0x54714e of _0x4bfb73){(_0x54714e[_0x5cd730(0x270)]||_0x54714e[_0x5cd730(0x201)])&&writeFileSync(_0x54714e[_0x5cd730(0x22d)],_0x54714e['content'],_0x5cd730(0x189));}return console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x1b5)]('✔\x20Pulled\x20'+(_0x51f61b[_0x5cd730(0x1dc)]+_0x5b0311[_0x5cd730(0x1dc)])+_0x5cd730(0x19a)+_0xf85eb7)),saveSessionContext({'parent_segment':_0x52cecc},_0x4fbd85[_0x5cd730(0x23b)]),console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x1b5)]('✔\x20Context\x20set:\x20'+a28_0x263096[_0x5cd730(0x21d)]('parent_segment')+_0x5cd730(0x1b2)+a28_0x263096[_0x5cd730(0x250)](_0x52cecc))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x227);[a28_0x30f7ad(0x22a)]='Show\x20journey\x20table\x20column\x20mapping';async[a28_0x30f7ad(0x265)](_0x306fdb){const _0xdd196a=a28_0x30f7ad,{options:_0x328e97,args:_0x3f4ace,tdx:_0x275cfe}=_0x306fdb,_0x4d6170=_0x3f4ace[0x0];if(!requireNameOrPath(_0x4d6170))return 0x1;_0x328e97['verbose']&&console[_0xdd196a(0x19c)]('Input:\x20'+_0x4d6170);const {journeyId:_0x7fbe43}=await resolveJourneyIdFromInput(_0x4d6170,_0x328e97,_0x275cfe),_0x1a05df=await withSpinner('Getting\x20column\x20mapping...',()=>_0x275cfe[_0xdd196a(0x269)][_0xdd196a(0x1c2)](_0x7fbe43),{'verbose':_0x328e97['verbose']}),_0x25c92d=_0x1a05df[_0xdd196a(0x212)];return console[_0xdd196a(0x188)](_0xdd196a(0x187)+_0x25c92d[_0xdd196a(0x1f4)]),console[_0xdd196a(0x188)](_0xdd196a(0x221)+_0x25c92d['table']),await handleSDKOutput(_0x25c92d['columns'],_0x328e97),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x1ec);async[a28_0x30f7ad(0x265)](_0x3a435d){const _0x24b7d5=a28_0x30f7ad,{options:_0x255be3,args:_0x542c5e,tdx:_0x1e0421}=_0x3a435d,_0x3055b6=_0x542c5e[0x0];if(!requireNameOrPath(_0x3055b6))return 0x1;_0x255be3[_0x24b7d5(0x24e)]&&console[_0x24b7d5(0x19c)](_0x24b7d5(0x208)+_0x3055b6);const {journeyId:_0x91e75e}=await resolveJourneyIdFromInput(_0x3055b6,_0x255be3,_0x1e0421),_0x173d77=await withSpinner('Listing\x20journey\x20activations...',()=>_0x1e0421[_0x24b7d5(0x269)][_0x24b7d5(0x18d)](_0x91e75e),{'verbose':_0x255be3[_0x24b7d5(0x24e)]}),_0x47e6e0=_0x173d77[_0x24b7d5(0x212)];return console[_0x24b7d5(0x19c)](_0x24b7d5(0x1cb)+_0x47e6e0[_0x24b7d5(0x1dc)]+_0x24b7d5(0x185)+(_0x47e6e0['length']!==0x1?'s':'')),await handleSDKOutput(_0x47e6e0,_0x255be3),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a28_0x30f7ad(0x238);['description']=a28_0x30f7ad(0x24a);[a28_0x30f7ad(0x200)]=new SegmentPushCommand();async[a28_0x30f7ad(0x265)](_0x3862b2){const _0x2e781c=a28_0x30f7ad,_0x569f2b=_0x3862b2[_0x2e781c(0x234)][0x0];let _0x116a13;if(_0x569f2b){const _0x43b60f=await resolveTarget({'arg':_0x569f2b,'contextParent':_0x3862b2[_0x2e781c(0x220)]['parentSegment'],'cwd':process['cwd']()});isSuccessfulResolution(_0x43b60f)&&_0x43b60f[_0x2e781c(0x253)]===_0x2e781c(0x18b)&&(_0x116a13=_0x43b60f['filePath']);}const _0x1da5a2={..._0x3862b2,'options':{..._0x3862b2['options'],'journeysOnly':!![],..._0x116a13&&{'singleFilePath':_0x116a13}}};return this[_0x2e781c(0x200)]['execute'](_0x1da5a2);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]='journey:versions';[a28_0x30f7ad(0x22a)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a28_0x30f7ad(0x265)](_0x76b2f0){const _0x1a4881=a28_0x30f7ad,{options:_0x30a85b,args:_0xbb2382,tdx:_0x298d5b}=_0x76b2f0,_0x2834db=_0xbb2382[0x0];if(!requireNameOrPath(_0x2834db))return 0x1;if(_0x30a85b[_0x1a4881(0x24e)])console[_0x1a4881(0x19c)](_0x1a4881(0x208)+_0x2834db);const {journeyId:_0x3e71f5}=await resolveJourneyIdFromInput(_0x2834db,_0x30a85b,_0x298d5b),_0x58d648=await withSpinner('Listing\x20journey\x20versions...',()=>_0x298d5b['journey']['listVersions'](_0x3e71f5),{'verbose':_0x30a85b[_0x1a4881(0x24e)]}),{bundleName:_0x1b54ac,versions:_0x1d0f94,latestJourneyId:_0x1da01f}=_0x58d648['data'];console['error'](_0x1b54ac+':\x20'+_0x1d0f94[_0x1a4881(0x1dc)]+_0x1a4881(0x232)+(_0x1d0f94[_0x1a4881(0x1dc)]!==0x1?'s':''));const _0x41b982=_0x1d0f94[_0x1a4881(0x190)](_0x37a329=>({'version':_0x37a329['versionNumber'],'journey_id':_0x37a329[_0x1a4881(0x25e)],'name':_0x37a329[_0x1a4881(0x1b9)],'state':_0x37a329[_0x1a4881(0x23c)],'paused':_0x37a329[_0x1a4881(0x1d3)],'latest':_0x37a329['journeyId']===_0x1da01f,'created_at':_0x37a329[_0x1a4881(0x1aa)]}));return await handleSDKOutput(_0x41b982,_0x30a85b),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x213);[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x262);async['execute'](_0x22daab){const _0x3dab05=a28_0x30f7ad,{options:_0x2d7fbd,args:_0x4a9eb0,tdx:_0x4acd61}=_0x22daab,_0x2c5270=_0x4a9eb0[0x0];if(!requireNameOrPath(_0x2c5270))return 0x1;if(_0x2d7fbd[_0x3dab05(0x24e)])console[_0x3dab05(0x19c)]('Input:\x20'+_0x2c5270);const {journeyId:_0x4ddbe4,journeyName:_0x3bd9d5}=await resolveJourneyIdFromInput(_0x2c5270,_0x2d7fbd,_0x4acd61);if(!_0x2d7fbd['yes']){const _0x53e07e=await confirm(_0x3dab05(0x205)+_0x3bd9d5+'\x22?');if(!_0x53e07e)return console[_0x3dab05(0x19c)](_0x3dab05(0x186)),0x0;}const _0x235b58=await withSpinner(_0x3dab05(0x210),()=>_0x4acd61['journey'][_0x3dab05(0x21a)](_0x4ddbe4),{'verbose':_0x2d7fbd['verbose']}),_0x2a0ce6=_0x235b58[_0x3dab05(0x212)];return console['error'](a28_0x263096[_0x3dab05(0x1b5)]('✔')+_0x3dab05(0x1e8)+_0x2a0ce6['attributes']['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0x2a0ce6[_0x3dab05(0x1ab)][_0x3dab05(0x1b9)]+'\x22'),console[_0x3dab05(0x19c)](_0x3dab05(0x252)+_0x2a0ce6['id']),await handleSingleObjectOutput({'id':_0x2a0ce6['id'],'name':_0x2a0ce6[_0x3dab05(0x1ab)][_0x3dab05(0x1b9)],'version':_0x2a0ce6[_0x3dab05(0x1ab)][_0x3dab05(0x184)],'state':_0x2a0ce6['attributes'][_0x3dab05(0x23c)],'bundle_id':_0x2a0ce6['attributes'][_0x3dab05(0x26e)],'created_at':_0x2a0ce6['attributes'][_0x3dab05(0x1aa)]},_0x2d7fbd),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x1c1);[a28_0x30f7ad(0x22a)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0x30f7ad(0x265)](_0x57bbcc){const _0x212f2e=a28_0x30f7ad,{options:_0x9036ba,args:_0x1000c9,tdx:_0x3df9ab}=_0x57bbcc,_0x1c7a3f=_0x1000c9[0x0];if(!requireNameOrPath(_0x1c7a3f))return 0x1;const _0x51f86a=_0x9036ba[_0x212f2e(0x194)];if(!_0x51f86a)return console['error'](_0x212f2e(0x26c)),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x220c73=parseInt(_0x51f86a,0xa);if(isNaN(_0x220c73)||_0x220c73<0x1)return console[_0x212f2e(0x19c)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x51f86a),0x1;if(_0x9036ba[_0x212f2e(0x24e)])console[_0x212f2e(0x19c)](_0x212f2e(0x208)+_0x1c7a3f+_0x212f2e(0x1ed)+_0x220c73);const {journeyId:_0x9d2960,parentSegmentId:_0x2c72a6}=await resolveJourneyIdFromInput(_0x1c7a3f,_0x9036ba,_0x3df9ab),_0x274267=await withSpinner(_0x212f2e(0x1a6),()=>_0x3df9ab[_0x212f2e(0x269)][_0x212f2e(0x20c)](_0x9d2960),{'verbose':_0x9036ba['verbose']}),{versions:_0x4365ce,latestJourneyId:_0xc3a0b1}=_0x274267['data'],_0x3e979c=_0x4365ce['find'](_0x2e0279=>_0x2e0279[_0x212f2e(0x184)]===_0x220c73);if(!_0x3e979c){const _0x1bb153=_0x4365ce['map'](_0x55b50c=>'v'+_0x55b50c[_0x212f2e(0x184)])[_0x212f2e(0x24b)](',\x20');return console['error'](_0x212f2e(0x1d9)+_0x220c73+'\x20not\x20found.\x20Available:\x20'+_0x1bb153),0x1;}const _0x3f7351=await withSpinner(_0x212f2e(0x225)+_0x220c73+_0x212f2e(0x1e4),()=>_0x3df9ab[_0x212f2e(0x269)][_0x212f2e(0x1a3)](_0x3e979c['journeyId']),{'verbose':_0x9036ba['verbose']}),_0x425f3d=_0x3f7351[_0x212f2e(0x212)],_0x183410=getConsoleNextUrl(_0x9036ba['site'],'/app/ps/'+_0x2c72a6+'/e/'+_0x3e979c[_0x212f2e(0x25e)]+_0x212f2e(0x1c9));return await handleSingleObjectOutput({'id':_0x425f3d['id'],'name':_0x425f3d['attributes']['name'],'version':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x184)],'description':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x22a)],'state':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x23c)],'paused':_0x425f3d['attributes'][_0x212f2e(0x1d3)],'reentry_mode':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x233)],'stages':_0x425f3d['attributes'][_0x212f2e(0x286)]?.['length']||0x0,..._0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x248)]&&{'goal':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x248)]['name']},'latest':_0x3e979c['journeyId']===_0xc3a0b1,'created_at':_0x425f3d[_0x212f2e(0x1ab)]['createdAt'],'updated_at':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x180)],'url':_0x183410},_0x9036ba),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x50cfe4=a29_0x5971;(function(_0x9195e,_0x1eb3b3){const _0x427b04=a29_0x5971,_0x314a5d=_0x9195e();while(!![]){try{const _0x13a9bf=parseInt(_0x427b04(0x13a))/0x1*(-parseInt(_0x427b04(0x142))/0x2)+-parseInt(_0x427b04(0x16e))/0x3+-parseInt(_0x427b04(0x166))/0x4*(-parseInt(_0x427b04(0x144))/0x5)+-parseInt(_0x427b04(0x137))/0x6+parseInt(_0x427b04(0x157))/0x7+-parseInt(_0x427b04(0x156))/0x8*(parseInt(_0x427b04(0x15d))/0x9)+parseInt(_0x427b04(0x13d))/0xa*(parseInt(_0x427b04(0x141))/0xb);if(_0x13a9bf===_0x1eb3b3)break;else _0x314a5d['push'](_0x314a5d['shift']());}catch(_0xa83087){_0x314a5d['push'](_0x314a5d['shift']());}}}(a29_0x6a58,0x29bfe));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_0x8e9865 from'chalk';function a29_0x6a58(){const _0x40b282=['description','journey','.yaml','681939ImcadY','cwd','execute','395394tFaCYQ','error','No\x20journey\x20YAML\x20files\x20found\x20in\x20','2UxgURP','.yml','\x20warning(s)\x20found','4603160FHKbmn','warnings','verbose','filePath','11HlSNVI','87404AojtEM','targetDir','40uIbmpT','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','yellow','green','length','Error:\x20Directory\x20not\x20found:\x20','endsWith','valid','Error:\x20','helpText','invalidCount','\x20journey(s)\x20with\x20errors,\x20','\x20valid','\x20error(s)','\x20journey(s)\x20valid','Validate\x20journey\x20YAML\x20files','filter','red','104dHftRe','1318905GfJLkr','errorCode','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20segment\x20file(s)\x20skipped','log','71721QypOAv','\x20(skipped:\x20','✔\x20All\x20','\x20warning(s)','Validation\x20failed:\x20','warningCount','hasErrors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','errors','3244WXstDf','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','name','skippedCount','dim'];a29_0x6a58=function(){return _0x40b282;};return a29_0x6a58();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a29_0x5971(_0x212589,_0x37f6a3){_0x212589=_0x212589-0x137;const _0x6a5820=a29_0x6a58();let _0x597158=_0x6a5820[_0x212589];return _0x597158;}export class JourneyValidateCommand extends BaseCommand{[a29_0x50cfe4(0x168)]='journey:validate';[a29_0x50cfe4(0x16b)]=a29_0x50cfe4(0x153);async[a29_0x50cfe4(0x170)](_0x1737b4){const _0x52cdf5=a29_0x50cfe4,{options:_0x340458,args:_0x1e32da}=_0x1737b4,_0x687734=_0x340458,_0x148a67=await resolveTarget({'arg':_0x1e32da[0x0],'contextParent':_0x340458['parentSegment'],'cwd':process[_0x52cdf5(0x16f)]()});if(!isSuccessfulResolution(_0x148a67))return _0x148a67[_0x52cdf5(0x158)]==='no_parent'?(console[_0x52cdf5(0x138)](a29_0x8e9865['yellow'](_0x52cdf5(0x167))),console['error']('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x52cdf5(0x138)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x52cdf5(0x138)](_0x52cdf5(0x145))):(console[_0x52cdf5(0x138)](a29_0x8e9865[_0x52cdf5(0x155)](_0x52cdf5(0x14c)+_0x148a67['message']+'\x0a')),_0x148a67[_0x52cdf5(0x14d)]&&console[_0x52cdf5(0x138)](a29_0x8e9865[_0x52cdf5(0x159)](_0x148a67[_0x52cdf5(0x14d)]))),0x1;const _0x28fc7b=_0x148a67[_0x52cdf5(0x143)],_0x37c0f9=_0x148a67['type']==='file'?_0x148a67[_0x52cdf5(0x140)]:undefined;if(!_0x37c0f9&&!existsSync(_0x28fc7b))return console['error'](a29_0x8e9865[_0x52cdf5(0x155)](_0x52cdf5(0x149)+_0x28fc7b+'\x0a')),0x1;let _0x19d89c;if(_0x37c0f9){if(!_0x37c0f9['endsWith'](_0x52cdf5(0x13b))&&!_0x37c0f9[_0x52cdf5(0x14a)](_0x52cdf5(0x16d)))return console[_0x52cdf5(0x138)](a29_0x8e9865[_0x52cdf5(0x155)](_0x52cdf5(0x15a)+_0x37c0f9+'\x0a')),0x1;_0x19d89c=[_0x37c0f9];}else _0x19d89c=findYamlFiles(_0x28fc7b);if(_0x19d89c[_0x52cdf5(0x148)]===0x0)return console[_0x52cdf5(0x138)](a29_0x8e9865['red'](_0x52cdf5(0x164)+_0x28fc7b+'\x0a')),0x1;const _0x35bb03=validateYamlFiles(_0x19d89c,_0x28fc7b,{'filterType':_0x52cdf5(0x16c)}),_0xe9db6f=calculateSummary(_0x35bb03),_0x25cdf6=_0x35bb03[_0x52cdf5(0x154)](isValidationResult);if(_0x25cdf6['length']===0x0)return console['error'](a29_0x8e9865[_0x52cdf5(0x146)](_0x52cdf5(0x139)+_0x28fc7b+'\x0a')),_0xe9db6f[_0x52cdf5(0x169)]>0x0&&console['error'](a29_0x8e9865[_0x52cdf5(0x16a)]('('+_0xe9db6f[_0x52cdf5(0x169)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x1098d2 of _0x35bb03){if(!isValidationResult(_0x1098d2)){_0x687734[_0x52cdf5(0x13f)]&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x16a)]('-\x20'+_0x1098d2['relativePath']+_0x52cdf5(0x15e)+_0x1098d2['reason']+')'));continue;}const {relativePath:_0x360f8d,source:_0x3af450,result:_0x150633}=_0x1098d2;if(_0x150633[_0x52cdf5(0x14b)]&&_0x150633[_0x52cdf5(0x13e)][_0x52cdf5(0x148)]===0x0)_0x687734['verbose']&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x147)]('✔\x20'+_0x360f8d));else _0x150633[_0x52cdf5(0x14b)]?(console['log'](a29_0x8e9865['yellow']('⚠\x20'+_0x360f8d+':\x20'+_0x150633['warnings'][_0x52cdf5(0x148)]+_0x52cdf5(0x160))),console[_0x52cdf5(0x15c)](formatValidationResult(_0x150633,_0x3af450,_0x360f8d))):(console['log'](a29_0x8e9865[_0x52cdf5(0x155)]('✖\x20'+_0x360f8d+':\x20'+_0x150633[_0x52cdf5(0x165)][_0x52cdf5(0x148)]+_0x52cdf5(0x151))),console[_0x52cdf5(0x15c)](formatValidationResult(_0x150633,_0x3af450,_0x360f8d)));}return console[_0x52cdf5(0x15c)](''),_0xe9db6f[_0x52cdf5(0x163)]?(console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x155)](_0x52cdf5(0x161)+_0xe9db6f[_0x52cdf5(0x14e)]+_0x52cdf5(0x14f)+_0xe9db6f['validCount']+_0x52cdf5(0x150))),_0xe9db6f[_0x52cdf5(0x162)]>0x0&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x146)](_0xe9db6f[_0x52cdf5(0x162)]+_0x52cdf5(0x13c))),_0xe9db6f['skippedCount']>0x0&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x16a)](_0xe9db6f[_0x52cdf5(0x169)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x147)](_0x52cdf5(0x15f)+_0xe9db6f['validCount']+_0x52cdf5(0x152))),_0xe9db6f['warningCount']>0x0&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x146)](_0xe9db6f[_0x52cdf5(0x162)]+_0x52cdf5(0x13c))),_0xe9db6f[_0x52cdf5(0x169)]>0x0&&console['log'](a29_0x8e9865[_0x52cdf5(0x16a)](_0xe9db6f['skippedCount']+_0x52cdf5(0x15b))),0x0);}}
|