@treasuredata/tdx 2026.4.3 → 2026.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.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/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0xb52aec=a25_0x21fc;(function(_0x3ee922,_0x5b3224){const _0x3fe167=a25_0x21fc,_0x2ebddc=_0x3ee922();while(!![]){try{const _0x4a88dd=parseInt(_0x3fe167(0xe7))/0x1*(-parseInt(_0x3fe167(0xf7))/0x2)+parseInt(_0x3fe167(0xed))/0x3*(parseInt(_0x3fe167(0xef))/0x4)+parseInt(_0x3fe167(0xff))/0x5*(-parseInt(_0x3fe167(0xde))/0x6)+parseInt(_0x3fe167(0xe0))/0x7*(parseInt(_0x3fe167(0x100))/0x8)+parseInt(_0x3fe167(0xd8))/0x9*(parseInt(_0x3fe167(0xe3))/0xa)+-parseInt(_0x3fe167(0xe1))/0xb*(-parseInt(_0x3fe167(0xe9))/0xc)+parseInt(_0x3fe167(0xd7))/0xd*(-parseInt(_0x3fe167(0xfa))/0xe);if(_0x4a88dd===_0x5b3224)break;else _0x2ebddc['push'](_0x2ebddc['shift']());}catch(_0x19968e){_0x2ebddc['push'](_0x2ebddc['shift']());}}}(a25_0x4baa,0x70bc2));import{BaseCommand}from'./command.js';function a25_0x21fc(_0x48ddbe,_0x5dce16){_0x48ddbe=_0x48ddbe-0xd2;const _0x4baae8=a25_0x4baa();let _0x21fcc9=_0x4baae8[_0x48ddbe];return _0x21fcc9;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x6cf249 from'chalk';function a25_0x4baa(){const _0x3c68dd=['dim','invalidCount','\x20warning(s)','312xanndg','hasErrors','13364kSVrWb','valid','No\x20template\x20YAML\x20files\x20found\x20in\x20','verbose','resolve','\x20non-template\x20file(s)\x20skipped','length','name','4724OYezmy','execute','warningCount','508214qineEF','\x20non-template\x20file(s)\x20skipped)','reason','.yml','dirname','165HhWeCg','8gBjbAi','skippedCount','validCount','\x20error(s)','errors','\x20template(s)\x20with\x20errors,\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yellow','error','warnings','169QWdfWp','252HEDnEJ','description','\x20(skipped:\x20','✔\x20All\x20','cwd','engage:template:validate','70056pwNRsZ','.yaml','3289622wuTisq','68189pyPVhF','log','318860mdnOKx','relativePath','red','\x20warning(s)\x20found','226jUulSe','endsWith','276BvkKce'];a25_0x4baa=function(){return _0x3c68dd;};return a25_0x4baa();}import a25_0x42ccf5 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0xb52aec(0xf6)]=a25_0xb52aec(0xdd);[a25_0xb52aec(0xd9)]='Validate\x20template\x20YAML\x20files';async[a25_0xb52aec(0xf8)](_0x1ec15f){const _0x1a683d=a25_0xb52aec,{options:_0x573512,args:_0x3b3808}=_0x1ec15f,_0x12c76a=_0x573512,_0x4af776=_0x3b3808[0x0],_0x5b302f=_0x4af776?a25_0x42ccf5[_0x1a683d(0xf3)](_0x4af776):undefined,_0xe313e8=_0x5b302f?isYamlFile(_0x5b302f):![];let _0x317891,_0x2b5c5e;if(_0xe313e8&&_0x5b302f)_0x317891=a25_0x42ccf5[_0x1a683d(0xfe)](_0x5b302f),_0x2b5c5e=_0x5b302f;else _0x5b302f?_0x317891=_0x5b302f:_0x317891=process[_0x1a683d(0xdc)]();if(!_0x2b5c5e&&!existsSync(_0x317891))return console[_0x1a683d(0xd5)](a25_0x6cf249[_0x1a683d(0xe5)]('Error:\x20Directory\x20not\x20found:\x20'+_0x317891+'\x0a')),0x1;let _0x51a0f5;if(_0x2b5c5e){if(!_0x2b5c5e[_0x1a683d(0xe8)](_0x1a683d(0xfd))&&!_0x2b5c5e[_0x1a683d(0xe8)](_0x1a683d(0xdf)))return console[_0x1a683d(0xd5)](a25_0x6cf249[_0x1a683d(0xe5)](_0x1a683d(0xd3)+_0x2b5c5e+'\x0a')),0x1;_0x51a0f5=[_0x2b5c5e];}else _0x51a0f5=findYamlFiles(_0x317891);if(_0x51a0f5[_0x1a683d(0xf5)]===0x0)return console[_0x1a683d(0xd5)](a25_0x6cf249[_0x1a683d(0xe5)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x317891+'\x0a')),0x1;const _0x26bc65=validateYamlFiles(_0x51a0f5,_0x317891,{'filterType':'template'}),_0x1e5dbc=calculateSummary(_0x26bc65),_0x3b973e=_0x26bc65['filter'](isValidationResult);if(_0x3b973e[_0x1a683d(0xf5)]===0x0)return console[_0x1a683d(0xd5)](a25_0x6cf249[_0x1a683d(0xd4)](_0x1a683d(0xf1)+_0x317891+'\x0a')),_0x1e5dbc[_0x1a683d(0x101)]>0x0&&console['error'](a25_0x6cf249[_0x1a683d(0xea)]('('+_0x1e5dbc[_0x1a683d(0x101)]+_0x1a683d(0xfb))),0x0;for(const _0x4b44b1 of _0x26bc65){if(!isValidationResult(_0x4b44b1)){_0x12c76a[_0x1a683d(0xf2)]&&console['log'](a25_0x6cf249['dim']('-\x20'+_0x4b44b1[_0x1a683d(0xe4)]+_0x1a683d(0xda)+_0x4b44b1[_0x1a683d(0xfc)]+')'));continue;}const {relativePath:_0xccea5,source:_0x4b29b8,result:_0x5df7d9}=_0x4b44b1;if(_0x5df7d9[_0x1a683d(0xf0)]&&_0x5df7d9[_0x1a683d(0xd6)][_0x1a683d(0xf5)]===0x0)_0x12c76a[_0x1a683d(0xf2)]&&console[_0x1a683d(0xe2)](a25_0x6cf249['green']('✔\x20'+_0xccea5));else _0x5df7d9[_0x1a683d(0xf0)]?(console[_0x1a683d(0xe2)](a25_0x6cf249[_0x1a683d(0xd4)]('⚠\x20'+_0xccea5+':\x20'+_0x5df7d9[_0x1a683d(0xd6)][_0x1a683d(0xf5)]+_0x1a683d(0xec))),console[_0x1a683d(0xe2)](formatValidationResult(_0x5df7d9,_0x4b29b8,_0xccea5))):(console[_0x1a683d(0xe2)](a25_0x6cf249[_0x1a683d(0xe5)]('✖\x20'+_0xccea5+':\x20'+_0x5df7d9[_0x1a683d(0x104)][_0x1a683d(0xf5)]+_0x1a683d(0x103))),console[_0x1a683d(0xe2)](formatValidationResult(_0x5df7d9,_0x4b29b8,_0xccea5)));}return console[_0x1a683d(0xe2)](''),_0x1e5dbc[_0x1a683d(0xee)]?(console[_0x1a683d(0xe2)](a25_0x6cf249[_0x1a683d(0xe5)]('Validation\x20failed:\x20'+_0x1e5dbc[_0x1a683d(0xeb)]+_0x1a683d(0xd2)+_0x1e5dbc[_0x1a683d(0x102)]+'\x20valid')),_0x1e5dbc[_0x1a683d(0xf9)]>0x0&&console[_0x1a683d(0xe2)](a25_0x6cf249[_0x1a683d(0xd4)](_0x1e5dbc[_0x1a683d(0xf9)]+_0x1a683d(0xe6))),_0x1e5dbc[_0x1a683d(0x101)]>0x0&&console[_0x1a683d(0xe2)](a25_0x6cf249[_0x1a683d(0xea)](_0x1e5dbc[_0x1a683d(0x101)]+_0x1a683d(0xf4))),0x1):(console[_0x1a683d(0xe2)](a25_0x6cf249['green'](_0x1a683d(0xdb)+_0x1e5dbc[_0x1a683d(0x102)]+'\x20template(s)\x20valid')),_0x1e5dbc[_0x1a683d(0xf9)]>0x0&&console[_0x1a683d(0xe2)](a25_0x6cf249[_0x1a683d(0xd4)](_0x1e5dbc[_0x1a683d(0xf9)]+_0x1a683d(0xe6))),_0x1e5dbc[_0x1a683d(0x101)]>0x0&&console[_0x1a683d(0xe2)](a25_0x6cf249[_0x1a683d(0xea)](_0x1e5dbc[_0x1a683d(0x101)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x38c909=a26_0x4e71;(function(_0x4180c0,_0x4a5da3){const _0x3710e1=a26_0x4e71,_0x406c70=_0x4180c0();while(!![]){try{const _0x111360=parseInt(_0x3710e1(0x1aa))/0x1+-parseInt(_0x3710e1(0x1f7))/0x2+-parseInt(_0x3710e1(0x1eb))/0x3*(parseInt(_0x3710e1(0x1d4))/0x4)+parseInt(_0x3710e1(0x1a3))/0x5+-parseInt(_0x3710e1(0x1a4))/0x6+parseInt(_0x3710e1(0x1d9))/0x7*(-parseInt(_0x3710e1(0x1dc))/0x8)+-parseInt(_0x3710e1(0x1da))/0x9*(-parseInt(_0x3710e1(0x1e2))/0xa);if(_0x111360===_0x4a5da3)break;else _0x406c70['push'](_0x406c70['shift']());}catch(_0x27d044){_0x406c70['push'](_0x406c70['shift']());}}}(a26_0x4934,0x43573));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';function a26_0x4e71(_0x47215a,_0x4a9044){_0x47215a=_0x47215a-0x1a2;const _0x4934ed=a26_0x4934();let _0x4e7186=_0x4934ed[_0x47215a];return _0x4e7186;}function a26_0x4934(){const _0x5d9cb8=['join','site','Submitting\x20kill\x20request...','yes','job:result','1988105ZIfFdg','256158athyVu','red','Listing\x20jobs...','\x27\x20to\x20verify\x20the\x20job\x20status','abs','list','330093oSoRIc','✔\x20Found\x20','\x20job','user_name','log','m\x20ago','job:show','Database:\x20','presto','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Cancelled','dim','round','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','query','Job\x20type:\x20','description','Getting\x20job\x20results...','created_at','jobType','length','Status\x20filter:\x20','information_schema','\x20row','\x20jobs','job_id','d\x20ago','List\x20jobs','result','just\x20now','✔\x20Job\x20submitted','INVALID_ARGUMENT','execute','show','error','h\x20ago','Getting\x20job\x20details...','hive','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','start_at','now','job:kill','253976AADSIW','trino','status','Submitting\x20job...','push','7JEIYXF','2356245fZfqmp','end_at','2365368OqKuKW','success','type','No\x20SQL\x20statements\x20found\x20in\x20file','\x20\x20Job\x20ID:\x20','args','30ZNfvlR','Submit\x20a\x20job','map','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','...','name','Get\x20job\x20results','debug','21nfpIvs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','submit','jobs','floor','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','data','substring','mo\x20ago','database','priority','Show\x20job\x20details','908960gmBjpH','verbose','validate','url','file','getTime'];a26_0x4934=function(){return _0x5d9cb8;};return a26_0x4934();}import{hyperlink}from'../sdk/util/formatters.js';import a26_0xab4c0a from'chalk';function formatDuration(_0x5cb516){const _0x111300=a26_0x4e71;if(_0x5cb516<0x3c)return _0x5cb516+'s';if(_0x5cb516<0xe10)return Math[_0x111300(0x1ef)](_0x5cb516/0x3c)+'m\x20'+_0x5cb516%0x3c+'s';const _0x37734a=Math['floor'](_0x5cb516/0xe10),_0x2308b7=Math[_0x111300(0x1ef)](_0x5cb516%0xe10/0x3c);return _0x2308b7>0x0?_0x37734a+'h\x20'+_0x2308b7+'m':_0x37734a+'h';}function formatRelativeTime(_0x33cf7c){const _0x193642=a26_0x4e71,_0x1ddb6e=Date[_0x193642(0x1d2)]()-_0x33cf7c[_0x193642(0x1fc)](),_0x50f013=Math[_0x193642(0x1ef)](Math[_0x193642(0x1a8)](_0x1ddb6e)/0x3e8);if(_0x50f013<0x3c)return _0x193642(0x1c7);const _0x2e3b27=Math[_0x193642(0x1ef)](_0x50f013/0x3c);if(_0x2e3b27<0x3c)return _0x2e3b27+_0x193642(0x1af);const _0x44e970=Math['floor'](_0x2e3b27/0x3c);if(_0x44e970<0x18)return _0x44e970+_0x193642(0x1cd);const _0x5db8cb=Math[_0x193642(0x1ef)](_0x44e970/0x18);if(_0x5db8cb<0x1e)return _0x5db8cb+_0x193642(0x1c4);return Math[_0x193642(0x1ef)](_0x5db8cb/0x1e)+_0x193642(0x1f3);}export class JobListCommand extends BaseCommand{['name']='jobs';[a26_0x38c909(0x1ba)]=a26_0x38c909(0x1c5);async[a26_0x38c909(0x1ca)](_0x3e2cca){const _0xa7f19e=a26_0x38c909,{options:_0x20333a,tdx:_0x4f149a}=_0x3e2cca,_0x377391=resolveLimit(_0x20333a['limit'],DEFAULT_DISPLAY_LIMIT),_0x1340fe=_0x20333a[_0xa7f19e(0x1d6)];_0x20333a[_0xa7f19e(0x1f8)]&&(console['error']('Limit:\x20'+_0x377391+_0xa7f19e(0x1c2)),_0x1340fe&&console[_0xa7f19e(0x1cc)](_0xa7f19e(0x1bf)+_0x1340fe));const _0x18f1ba=await withSpinner(_0xa7f19e(0x1a6),()=>_0x4f149a[_0xa7f19e(0x1ee)][_0xa7f19e(0x1a9)]({'from':0x0,'to':_0x377391-0x1,'status':_0x1340fe}),{'verbose':_0x20333a[_0xa7f19e(0x1f8)]}),_0x4cab6e=_0x18f1ba[_0xa7f19e(0x1f1)];console[_0xa7f19e(0x1cc)](_0xa7f19e(0x1ab)+_0x4cab6e['length']+_0xa7f19e(0x1ac)+(_0x4cab6e['length']!==0x1?'s':''));const _0x2ba704=_0x20333a[_0xa7f19e(0x1fe)];if(isStructuredFormat(_0x20333a)){const _0x490b17=_0x4cab6e[_0xa7f19e(0x1e4)](_0x51cf23=>{const _0x2f7bcb=_0xa7f19e;let _0x3f1d7a;if(_0x51cf23[_0x2f7bcb(0x1d1)]&&_0x51cf23[_0x2f7bcb(0x1db)]){const _0x3cbe08=new Date(_0x51cf23[_0x2f7bcb(0x1d1)])[_0x2f7bcb(0x1fc)](),_0x42d61a=new Date(_0x51cf23[_0x2f7bcb(0x1db)])[_0x2f7bcb(0x1fc)]();_0x3f1d7a=Math[_0x2f7bcb(0x1b6)]((_0x42d61a-_0x3cbe08)/0x3e8);}return{'job_id':_0x51cf23[_0x2f7bcb(0x1c3)],'type':_0x51cf23[_0x2f7bcb(0x1de)]==='presto'?_0x2f7bcb(0x1d5):_0x51cf23[_0x2f7bcb(0x1de)],'status':_0x51cf23[_0x2f7bcb(0x1d6)],'user_name':_0x51cf23[_0x2f7bcb(0x1ad)],'duration_sec':_0x3f1d7a,'created_at':_0x51cf23[_0x2f7bcb(0x1bc)],'started_at':_0x51cf23[_0x2f7bcb(0x1d1)],'end_at':_0x51cf23['end_at']};});await handleSDKOutput(_0x490b17,_0x20333a);}else for(const _0x35a456 of _0x4cab6e){const _0xad4e0=_0x35a456[_0xa7f19e(0x1d6)]===_0xa7f19e(0x1dd)?a26_0xab4c0a['green']:_0x35a456['status']===_0xa7f19e(0x1cc)?a26_0xab4c0a[_0xa7f19e(0x1a5)]:a26_0xab4c0a[_0xa7f19e(0x1b5)],_0x35ebac=_0xad4e0(_0x35a456['status']),_0x4af445=getJobUrl(_0x2ba704,_0x35a456[_0xa7f19e(0x1c3)]),_0x171175=hyperlink(_0x35a456['job_id'],_0x4af445),_0x168850=a26_0xab4c0a[_0xa7f19e(0x1b5)](_0x35a456[_0xa7f19e(0x1de)]===_0xa7f19e(0x1b2)?_0xa7f19e(0x1d5):_0x35a456[_0xa7f19e(0x1de)]),_0x5dd723=[];if(_0x35a456[_0xa7f19e(0x1d1)]&&_0x35a456[_0xa7f19e(0x1db)]){const _0x33c694=Math[_0xa7f19e(0x1b6)]((new Date(_0x35a456['end_at'])[_0xa7f19e(0x1fc)]()-new Date(_0x35a456[_0xa7f19e(0x1d1)])['getTime']())/0x3e8);_0x5dd723[_0xa7f19e(0x1d8)](formatDuration(_0x33c694));}if(_0x35a456['end_at'])_0x5dd723[_0xa7f19e(0x1d8)](formatRelativeTime(new Date(_0x35a456['end_at'])));else _0x35a456['start_at']&&_0x5dd723['push'](formatRelativeTime(new Date(_0x35a456[_0xa7f19e(0x1d1)])));const _0x308f63=_0x5dd723[_0xa7f19e(0x1be)]>0x0?a26_0xab4c0a[_0xa7f19e(0x1b5)]('\x20'+_0x5dd723[_0xa7f19e(0x1fd)](',\x20')):'';console[_0xa7f19e(0x1ae)]('⚡\x20'+_0x171175+'\x20'+_0x168850+'\x20'+_0x35ebac+_0x308f63);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x38c909(0x1e8)]=a26_0x38c909(0x1b0);[a26_0x38c909(0x1ba)]=a26_0x38c909(0x1f6);[a26_0x38c909(0x1f9)](_0x25d4ba){const _0x5afe99=a26_0x38c909,_0x401ca8=_0x25d4ba[_0x5afe99(0x1e1)][0x0];if(!_0x401ca8)return _0x5afe99(0x1ec);return undefined;}async['execute'](_0x4728b5){const _0x36698a=a26_0x38c909,{options:_0x71b4ee,args:_0x2e5e5d,tdx:_0xed138f}=_0x4728b5,_0x419220=_0x2e5e5d[0x0],_0xa8badc=await withSpinner(_0x36698a(0x1ce),()=>_0xed138f[_0x36698a(0x1ee)][_0x36698a(0x1cb)](_0x419220),{'verbose':_0x71b4ee[_0x36698a(0x1f8)]}),_0x4dd196=_0xa8badc[_0x36698a(0x1f1)];let _0x1307f8;if(_0x4dd196[_0x36698a(0x1d1)]&&_0x4dd196[_0x36698a(0x1db)]){const _0x5453b1=new Date(_0x4dd196['start_at'])[_0x36698a(0x1fc)](),_0x4ae1d2=new Date(_0x4dd196[_0x36698a(0x1db)])['getTime']();_0x1307f8=Math[_0x36698a(0x1b6)]((_0x4ae1d2-_0x5453b1)/0x3e8);}const _0xa17903={'job_id':_0x4dd196['job_id'],'type':_0x4dd196['type'],'status':_0x4dd196[_0x36698a(0x1d6)],..._0x4dd196['user_name']&&{'user_name':_0x4dd196[_0x36698a(0x1ad)]},..._0x1307f8!==undefined&&{'duration_sec':_0x1307f8},..._0x4dd196[_0x36698a(0x1bc)]&&{'created_at':_0x4dd196[_0x36698a(0x1bc)]},..._0x4dd196[_0x36698a(0x1d1)]&&{'started_at':_0x4dd196['start_at']},..._0x4dd196[_0x36698a(0x1db)]&&{'end_at':_0x4dd196[_0x36698a(0x1db)]},..._0x4dd196['database']&&{'database':_0x4dd196['database']},..._0x4dd196[_0x36698a(0x1f5)]!==undefined&&{'priority':_0x4dd196['priority']},..._0x4dd196[_0x36698a(0x1fa)]&&{'url':_0x4dd196[_0x36698a(0x1fa)]},..._0x4dd196[_0x36698a(0x1b8)]&&{'query':_0x4dd196['query']},..._0x4dd196[_0x36698a(0x1ea)]&&{'debug':_0x4dd196['debug']}};return await handleSingleObjectOutput(_0xa17903,_0x71b4ee),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x38c909(0x1e8)]=a26_0x38c909(0x1d3);[a26_0x38c909(0x1ba)]='Kill\x20a\x20job';['validate'](_0x30e102){const _0x48aed3=a26_0x38c909,_0x3a7620=_0x30e102[_0x48aed3(0x1e1)][0x0];if(!_0x3a7620)return _0x48aed3(0x1e6);return undefined;}async['execute'](_0x59e393){const _0x14d525=a26_0x38c909,{options:_0x4b21d2,args:_0x227e33,tdx:_0x156966}=_0x59e393,_0x4a861b=_0x227e33[0x0];if(!_0x4b21d2[_0x14d525(0x200)]){const _0x2389c1=await confirm(_0x14d525(0x1b3)+_0x4a861b+'?');if(!_0x2389c1)return console['error'](_0x14d525(0x1b4)),0x0;}return await withSpinner(_0x14d525(0x1ff),()=>_0x156966[_0x14d525(0x1ee)]['kill'](_0x4a861b),{'verbose':_0x4b21d2['verbose']}),console[_0x14d525(0x1cc)](_0x14d525(0x1b7)+_0x4a861b),console[_0x14d525(0x1cc)](_0x14d525(0x1e5)+_0x4a861b+_0x14d525(0x1a7)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x38c909(0x1e8)]='job:submit';[a26_0x38c909(0x1ba)]=a26_0x38c909(0x1e3);async[a26_0x38c909(0x1ca)](_0x2cc22a){const _0x382561=a26_0x38c909,{options:_0x4985e5,args:_0x171853,tdx:_0x219c10}=_0x2cc22a,_0x4ba209=_0x4985e5[_0x382561(0x1bd)]||_0x382561(0x1d5),_0x5027a8=_0x4985e5[_0x382561(0x1fb)],_0x25efcb=_0x4985e5[_0x382561(0x1f4)]||_0x382561(0x1c0),_0x1c5b6d=_0x4985e5[_0x382561(0x1c6)];if(_0x4ba209!==_0x382561(0x1d5)&&_0x4ba209!==_0x382561(0x1cf))throw new SDKError(ErrorCode[_0x382561(0x1c9)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x1a28a6;if(_0x5027a8){if(_0x171853[0x0])throw new SDKError(ErrorCode[_0x382561(0x1c9)],_0x382561(0x1d0));const _0x4d5308=readSqlStatementsFromFile(_0x5027a8);if(_0x4d5308[_0x382561(0x1be)]===0x0)throw new SDKError(ErrorCode[_0x382561(0x1c9)],_0x382561(0x1df));if(_0x4d5308[_0x382561(0x1be)]>0x1)throw new SDKError(ErrorCode[_0x382561(0x1c9)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x1a28a6=_0x4d5308[0x0];}else{if(!_0x171853[0x0])throw new SDKError(ErrorCode[_0x382561(0x1c9)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x1a28a6=_0x171853[0x0];}_0x4985e5[_0x382561(0x1f8)]&&(console[_0x382561(0x1cc)](_0x382561(0x1b9)+_0x4ba209),console['error'](_0x382561(0x1b1)+_0x25efcb),console['error']('Query:\x20'+_0x1a28a6[_0x382561(0x1f2)](0x0,0x64)+(_0x1a28a6['length']>0x64?_0x382561(0x1e7):'')));const _0x4628ac=await withSpinner(_0x382561(0x1d7),()=>_0x219c10[_0x382561(0x1ee)][_0x382561(0x1ed)](_0x25efcb,_0x1a28a6,_0x4ba209,_0x1c5b6d),{'verbose':_0x4985e5[_0x382561(0x1f8)]}),_0x21a33b=_0x4628ac[_0x382561(0x1f1)];return console[_0x382561(0x1cc)](_0x382561(0x1c8)),console[_0x382561(0x1cc)](_0x382561(0x1e0)+_0x21a33b['job_id']),await handleSDKOutput([_0x21a33b],_0x4985e5),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a26_0x38c909(0x1a2);[a26_0x38c909(0x1ba)]=a26_0x38c909(0x1e9);[a26_0x38c909(0x1f9)](_0x420d6b){const _0x45f537=a26_0x38c909,_0x2d5df6=_0x420d6b['args'][0x0];if(!_0x2d5df6)return _0x45f537(0x1f0);return undefined;}async[a26_0x38c909(0x1ca)](_0x473cf6){const _0x38d60c=a26_0x38c909,{options:_0x4a92ba,args:_0x48102a,tdx:_0x1ea7eb}=_0x473cf6,_0x4df9be=_0x48102a[0x0],_0x52346b=await withSpinner(_0x38d60c(0x1bb),()=>_0x1ea7eb[_0x38d60c(0x1ee)][_0x38d60c(0x1c6)](_0x4df9be),{'verbose':_0x4a92ba['verbose']}),_0x4084da=_0x52346b[_0x38d60c(0x1f1)];return console[_0x38d60c(0x1cc)]('✔\x20Retrieved\x20'+_0x4084da[_0x38d60c(0x1be)]+_0x38d60c(0x1c1)+(_0x4084da[_0x38d60c(0x1be)]!==0x1?'s':'')),await handleSDKOutput(_0x4084da,_0x4a92ba),0x0;}}
|
|
1
|
+
const a26_0x5c9922=a26_0x2f23;(function(_0x1264f2,_0xb63455){const _0x1e6751=a26_0x2f23,_0x238d12=_0x1264f2();while(!![]){try{const _0x10a4c8=parseInt(_0x1e6751(0x1b5))/0x1+-parseInt(_0x1e6751(0x1cd))/0x2*(-parseInt(_0x1e6751(0x1ab))/0x3)+-parseInt(_0x1e6751(0x1a2))/0x4*(parseInt(_0x1e6751(0x198))/0x5)+parseInt(_0x1e6751(0x1cf))/0x6+parseInt(_0x1e6751(0x193))/0x7+parseInt(_0x1e6751(0x1d7))/0x8+parseInt(_0x1e6751(0x197))/0x9*(-parseInt(_0x1e6751(0x1e2))/0xa);if(_0x10a4c8===_0xb63455)break;else _0x238d12['push'](_0x238d12['shift']());}catch(_0x111654){_0x238d12['push'](_0x238d12['shift']());}}}(a26_0x5ec5,0x4091b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a26_0x2f23(_0x10e66e,_0x445820){_0x10e66e=_0x10e66e-0x18f;const _0x5ec58a=a26_0x5ec5();let _0x2f238c=_0x5ec58a[_0x10e66e];return _0x2f238c;}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 a26_0x131773 from'chalk';function formatDuration(_0x4d46b6){const _0x18e16b=a26_0x2f23;if(_0x4d46b6<0x3c)return _0x4d46b6+'s';if(_0x4d46b6<0xe10)return Math[_0x18e16b(0x19a)](_0x4d46b6/0x3c)+'m\x20'+_0x4d46b6%0x3c+'s';const _0x1d9484=Math[_0x18e16b(0x19a)](_0x4d46b6/0xe10),_0x36d7ee=Math[_0x18e16b(0x19a)](_0x4d46b6%0xe10/0x3c);return _0x36d7ee>0x0?_0x1d9484+'h\x20'+_0x36d7ee+'m':_0x1d9484+'h';}function formatRelativeTime(_0x55099f){const _0x1c7f06=a26_0x2f23,_0x11c065=Date['now']()-_0x55099f['getTime'](),_0x1f2aff=Math[_0x1c7f06(0x19a)](Math['abs'](_0x11c065)/0x3e8);if(_0x1f2aff<0x3c)return _0x1c7f06(0x1ac);const _0x5298da=Math[_0x1c7f06(0x19a)](_0x1f2aff/0x3c);if(_0x5298da<0x3c)return _0x5298da+_0x1c7f06(0x1bb);const _0x4e2c96=Math[_0x1c7f06(0x19a)](_0x5298da/0x3c);if(_0x4e2c96<0x18)return _0x4e2c96+_0x1c7f06(0x1ba);const _0x197cb2=Math['floor'](_0x4e2c96/0x18);if(_0x197cb2<0x1e)return _0x197cb2+_0x1c7f06(0x1d6);return Math[_0x1c7f06(0x19a)](_0x197cb2/0x1e)+_0x1c7f06(0x1ca);}export class JobListCommand extends BaseCommand{[a26_0x5c9922(0x195)]=a26_0x5c9922(0x1a1);[a26_0x5c9922(0x1dd)]='List\x20jobs';async[a26_0x5c9922(0x1b1)](_0x125bc2){const _0x314599=a26_0x5c9922,{options:_0x2aba1b,tdx:_0x40bd89}=_0x125bc2,_0x22a3c1=resolveLimit(_0x2aba1b['limit'],DEFAULT_DISPLAY_LIMIT),_0x3b2e9c=_0x2aba1b['status'];_0x2aba1b[_0x314599(0x1a5)]&&(console[_0x314599(0x1de)](_0x314599(0x1a8)+_0x22a3c1+_0x314599(0x1b3)),_0x3b2e9c&&console[_0x314599(0x1de)](_0x314599(0x1e0)+_0x3b2e9c));const _0x1ed39d=await withSpinner('Listing\x20jobs...',()=>_0x40bd89['jobs'][_0x314599(0x1b8)]({'from':0x0,'to':_0x22a3c1-0x1,'status':_0x3b2e9c}),{'verbose':_0x2aba1b[_0x314599(0x1a5)]}),_0x3d393d=_0x1ed39d[_0x314599(0x199)];console[_0x314599(0x1de)](_0x314599(0x1e5)+_0x3d393d[_0x314599(0x1a7)]+_0x314599(0x1c4)+(_0x3d393d[_0x314599(0x1a7)]!==0x1?'s':''));const _0x11ef22=_0x2aba1b[_0x314599(0x1bc)];if(isStructuredFormat(_0x2aba1b)){const _0xc147ff=_0x3d393d[_0x314599(0x1bd)](_0x482595=>{const _0x5cab73=_0x314599;let _0x2f12e3;if(_0x482595[_0x5cab73(0x1c3)]&&_0x482595['end_at']){const _0x46e76e=new Date(_0x482595['start_at'])[_0x5cab73(0x1e1)](),_0x294224=new Date(_0x482595['end_at'])[_0x5cab73(0x1e1)]();_0x2f12e3=Math[_0x5cab73(0x19b)]((_0x294224-_0x46e76e)/0x3e8);}return{'job_id':_0x482595[_0x5cab73(0x1b0)],'type':_0x482595[_0x5cab73(0x1dc)]===_0x5cab73(0x1df)?_0x5cab73(0x18f):_0x482595['type'],'status':_0x482595['status'],'user_name':_0x482595[_0x5cab73(0x1ce)],'duration_sec':_0x2f12e3,'created_at':_0x482595[_0x5cab73(0x1ad)],'started_at':_0x482595['start_at'],'end_at':_0x482595['end_at']};});await handleSDKOutput(_0xc147ff,_0x2aba1b);}else for(const _0x2b458b of _0x3d393d){const _0x204f71=_0x2b458b['status']===_0x314599(0x1af)?a26_0x131773[_0x314599(0x1c0)]:_0x2b458b[_0x314599(0x1bf)]===_0x314599(0x1de)?a26_0x131773[_0x314599(0x1e7)]:a26_0x131773['dim'],_0x59c745=_0x204f71(_0x2b458b[_0x314599(0x1bf)]),_0x20b417=getJobUrl(_0x11ef22,_0x2b458b[_0x314599(0x1b0)]),_0x32203f=hyperlink(_0x2b458b['job_id'],_0x20b417),_0x177153=a26_0x131773['dim'](_0x2b458b[_0x314599(0x1dc)]==='presto'?_0x314599(0x18f):_0x2b458b[_0x314599(0x1dc)]),_0x2779f5=[];if(_0x2b458b[_0x314599(0x1c3)]&&_0x2b458b[_0x314599(0x1e3)]){const _0xd27b7f=Math[_0x314599(0x19b)]((new Date(_0x2b458b[_0x314599(0x1e3)])[_0x314599(0x1e1)]()-new Date(_0x2b458b[_0x314599(0x1c3)])[_0x314599(0x1e1)]())/0x3e8);_0x2779f5[_0x314599(0x1a4)](formatDuration(_0xd27b7f));}if(_0x2b458b[_0x314599(0x1e3)])_0x2779f5[_0x314599(0x1a4)](formatRelativeTime(new Date(_0x2b458b[_0x314599(0x1e3)])));else _0x2b458b[_0x314599(0x1c3)]&&_0x2779f5['push'](formatRelativeTime(new Date(_0x2b458b[_0x314599(0x1c3)])));const _0x335b89=_0x2779f5['length']>0x0?a26_0x131773['dim']('\x20'+_0x2779f5[_0x314599(0x1d3)](',\x20')):'';console['log']('⚡\x20'+_0x32203f+'\x20'+_0x177153+'\x20'+_0x59c745+_0x335b89);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x5c9922(0x1d1);[a26_0x5c9922(0x1dd)]='Show\x20job\x20details';[a26_0x5c9922(0x1b7)](_0x53d953){const _0x813d48=a26_0x5c9922,_0x1aa5a9=_0x53d953[_0x813d48(0x1cb)][0x0];if(!_0x1aa5a9)return _0x813d48(0x1a0);return undefined;}async[a26_0x5c9922(0x1b1)](_0x4783bf){const _0x5045a8=a26_0x5c9922,{options:_0x220c20,args:_0x56b556,tdx:_0x31e226}=_0x4783bf,_0x46fb22=_0x56b556[0x0],_0x5c5614=await withSpinner(_0x5045a8(0x1ae),()=>_0x31e226['jobs'][_0x5045a8(0x1cc)](_0x46fb22),{'verbose':_0x220c20[_0x5045a8(0x1a5)]}),_0x53f8fc=_0x5c5614[_0x5045a8(0x199)];let _0x332e48;if(_0x53f8fc[_0x5045a8(0x1c3)]&&_0x53f8fc[_0x5045a8(0x1e3)]){const _0x389904=new Date(_0x53f8fc[_0x5045a8(0x1c3)])[_0x5045a8(0x1e1)](),_0x328b32=new Date(_0x53f8fc[_0x5045a8(0x1e3)])['getTime']();_0x332e48=Math[_0x5045a8(0x19b)]((_0x328b32-_0x389904)/0x3e8);}const _0xcf7c5b={'job_id':_0x53f8fc[_0x5045a8(0x1b0)],'type':_0x53f8fc[_0x5045a8(0x1dc)],'status':_0x53f8fc[_0x5045a8(0x1bf)],..._0x53f8fc[_0x5045a8(0x1ce)]&&{'user_name':_0x53f8fc[_0x5045a8(0x1ce)]},..._0x332e48!==undefined&&{'duration_sec':_0x332e48},..._0x53f8fc[_0x5045a8(0x1ad)]&&{'created_at':_0x53f8fc['created_at']},..._0x53f8fc[_0x5045a8(0x1c3)]&&{'started_at':_0x53f8fc['start_at']},..._0x53f8fc[_0x5045a8(0x1e3)]&&{'end_at':_0x53f8fc['end_at']},..._0x53f8fc[_0x5045a8(0x1c5)]&&{'database':_0x53f8fc['database']},..._0x53f8fc[_0x5045a8(0x1a6)]!==undefined&&{'priority':_0x53f8fc[_0x5045a8(0x1a6)]},..._0x53f8fc[_0x5045a8(0x1b6)]&&{'url':_0x53f8fc['url']},..._0x53f8fc['query']&&{'query':_0x53f8fc[_0x5045a8(0x1e4)]},..._0x53f8fc[_0x5045a8(0x1aa)]&&{'debug':_0x53f8fc[_0x5045a8(0x1aa)]}};return await handleSingleObjectOutput(_0xcf7c5b,_0x220c20),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x5c9922(0x195)]='job:kill';[a26_0x5c9922(0x1dd)]=a26_0x5c9922(0x1d0);[a26_0x5c9922(0x1b7)](_0x5d57e5){const _0x4d0ed9=a26_0x5c9922,_0x31b10d=_0x5d57e5[_0x4d0ed9(0x1cb)][0x0];if(!_0x31b10d)return _0x4d0ed9(0x1d9);return undefined;}async[a26_0x5c9922(0x1b1)](_0x4161a3){const _0x4577e1=a26_0x5c9922,{options:_0x3071f9,args:_0x13d911,tdx:_0x2b2b93}=_0x4161a3,_0x22cf43=_0x13d911[0x0];if(!_0x3071f9[_0x4577e1(0x1d8)]){const _0x162bf3=await confirm(_0x4577e1(0x1d4)+_0x22cf43+'?');if(!_0x162bf3)return console[_0x4577e1(0x1de)](_0x4577e1(0x19e)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2b2b93[_0x4577e1(0x1a1)]['kill'](_0x22cf43),{'verbose':_0x3071f9['verbose']}),console['error'](_0x4577e1(0x1c8)+_0x22cf43),console[_0x4577e1(0x1de)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x22cf43+_0x4577e1(0x19d)),0x0;}}function a26_0x5ec5(){const _0x836933=['map','jobType','status','green','hive','Submitting\x20job...','start_at','\x20job','database','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Getting\x20job\x20results...','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','\x20\x20Job\x20ID:\x20','mo\x20ago','args','show','2cbvJQR','user_name','890244QNdNFZ','Kill\x20a\x20job','job:show','\x20row','join','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','No\x20SQL\x20statements\x20found\x20in\x20file','d\x20ago','2243632cUxDlf','yes','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','INVALID_ARGUMENT','result','type','description','error','presto','Status\x20filter:\x20','getTime','990yiDvrc','end_at','query','✔\x20Found\x20','file','red','trino','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','...','Submit\x20a\x20job','391825FnKkYX','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','name','Query:\x20','55467SLTtIR','236335BmeJKv','data','floor','round','✔\x20Job\x20submitted','\x27\x20to\x20verify\x20the\x20job\x20status','Cancelled','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','jobs','20hTxOma','Get\x20job\x20results','push','verbose','priority','length','Limit:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','debug','340869bwvvhD','just\x20now','created_at','Getting\x20job\x20details...','success','job_id','execute','information_schema','\x20jobs','job:result','512521PcRmGT','url','validate','list','Database:\x20','h\x20ago','m\x20ago','site'];a26_0x5ec5=function(){return _0x836933;};return a26_0x5ec5();}export class JobSubmitCommand extends BaseCommand{[a26_0x5c9922(0x195)]='job:submit';[a26_0x5c9922(0x1dd)]=a26_0x5c9922(0x192);async[a26_0x5c9922(0x1b1)](_0x561316){const _0xe9d34d=a26_0x5c9922,{options:_0x4a402f,args:_0x25ecb0,tdx:_0x248ef6}=_0x561316,_0x23c0fe=_0x4a402f[_0xe9d34d(0x1be)]||_0xe9d34d(0x18f),_0x520714=_0x4a402f[_0xe9d34d(0x1e6)],_0x29c042=_0x4a402f[_0xe9d34d(0x1c5)]||_0xe9d34d(0x1b2),_0x3b8703=_0x4a402f[_0xe9d34d(0x1db)];if(_0x23c0fe!==_0xe9d34d(0x18f)&&_0x23c0fe!==_0xe9d34d(0x1c1))throw new SDKError(ErrorCode[_0xe9d34d(0x1da)],_0xe9d34d(0x1c6));let _0x424dca;if(_0x520714){if(_0x25ecb0[0x0])throw new SDKError(ErrorCode[_0xe9d34d(0x1da)],_0xe9d34d(0x1a9));const _0x3dac16=readSqlStatementsFromFile(_0x520714);if(_0x3dac16[_0xe9d34d(0x1a7)]===0x0)throw new SDKError(ErrorCode[_0xe9d34d(0x1da)],_0xe9d34d(0x1d5));if(_0x3dac16[_0xe9d34d(0x1a7)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe9d34d(0x190));_0x424dca=_0x3dac16[0x0];}else{if(!_0x25ecb0[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe9d34d(0x19f));_0x424dca=_0x25ecb0[0x0];}_0x4a402f['verbose']&&(console[_0xe9d34d(0x1de)]('Job\x20type:\x20'+_0x23c0fe),console[_0xe9d34d(0x1de)](_0xe9d34d(0x1b9)+_0x29c042),console['error'](_0xe9d34d(0x196)+_0x424dca['substring'](0x0,0x64)+(_0x424dca[_0xe9d34d(0x1a7)]>0x64?_0xe9d34d(0x191):'')));const _0x389da2=await withSpinner(_0xe9d34d(0x1c2),()=>_0x248ef6[_0xe9d34d(0x1a1)]['submit'](_0x29c042,_0x424dca,_0x23c0fe,_0x3b8703),{'verbose':_0x4a402f[_0xe9d34d(0x1a5)]}),_0x560d14=_0x389da2[_0xe9d34d(0x199)];return console[_0xe9d34d(0x1de)](_0xe9d34d(0x19c)),console[_0xe9d34d(0x1de)](_0xe9d34d(0x1c9)+_0x560d14[_0xe9d34d(0x1b0)]),await handleSDKOutput([_0x560d14],_0x4a402f),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a26_0x5c9922(0x1b4);[a26_0x5c9922(0x1dd)]=a26_0x5c9922(0x1a3);['validate'](_0x2fa86d){const _0xcb1972=a26_0x5c9922,_0x5ba43b=_0x2fa86d[_0xcb1972(0x1cb)][0x0];if(!_0x5ba43b)return _0xcb1972(0x194);return undefined;}async[a26_0x5c9922(0x1b1)](_0x1798b8){const _0x1c0674=a26_0x5c9922,{options:_0x4f1937,args:_0x54119c,tdx:_0x54fcc3}=_0x1798b8,_0x148517=_0x54119c[0x0],_0x30d324=await withSpinner(_0x1c0674(0x1c7),()=>_0x54fcc3[_0x1c0674(0x1a1)][_0x1c0674(0x1db)](_0x148517),{'verbose':_0x4f1937[_0x1c0674(0x1a5)]}),_0x595778=_0x30d324['data'];return console[_0x1c0674(0x1de)]('✔\x20Retrieved\x20'+_0x595778[_0x1c0674(0x1a7)]+_0x1c0674(0x1d2)+(_0x595778[_0x1c0674(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x595778,_0x4f1937),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a27_0x3491(){const _0x2d36ec=['2579373dwpYyP','user','\x20=\x20','resume','history','4857688cAOWVc','Listing\x20journey\x20activations...','Cancelled','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','/app/ps/','error','reentryMode','\x20\x20Statistics\x20not\x20available','...','args','journey:view','format','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','root\x20folder','base','segments','filePath','Getting\x20journey\x20statistics...','set','(paused)','connector_config','Pattern:\x20','Fetching\x20journeys\x20and\x20folders...','join','updatedAt','goalSize','(running)','\x20files?','\x20journeys','\x20journey','table','✔\x20Journey\x20\x22','map','stageNameMap','get','completed','Getting\x20column\x20mapping...','\x20Opening\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Resolving\x20journey...','Aborted.','\x27\x20not\x20found\x20in\x20','18616CqbrTc','Listing\x20journey\x20versions...','✔\x20Found\x20','file','\x20version','web','journeyStages','journey:stats','Resolving\x20parent\x20segment...','options','\x20(draft)\x20—\x20\x22','journeyBundleId','find','\x20new\x20files','journey:pull','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','370gUsFnw','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','buildIdToNameMap','utf-8','/e/','isNew','execute','enteredSize','replace','List\x20journeys\x20in\x20current\x20context','Available\x20stages:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','No\x20journeys\x20found','data','resourceName','\x5c$&','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','targetDir','stages','includeHistory','Getting\x20journey\x20details...','type','journeyBundleName','\x20(rule\x20match)','site','Parent\x20segment:\x20','paused','rule','parent_segment','Write\x20','completionRate','Error:\x20Stage\x20\x22','(root)','filter','then','Target\x20file:\x20','length','No\x20statistics\x20available\x20for\x20journey:\x20','createVersion','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','resolveParentId','Fetching\x20','journey:traffic','columns','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journey:list','Error:\x20Invalid\x20version\x20number:\x20',',\x20version:\x20','connection','9506IYOXyZ','Error:\x20Parent\x20segment\x20context\x20required','completeMilestoneRate','getParentFull','diff','getJourney','rootFolderId','sort','kind','Getting\x20journey\x20traffic\x20data...','Target\x20directory:\x20','Fetching\x20parent\x20segment...','List\x20activations\x20for\x20a\x20journey','dryRun','goal','renderStats','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','values','resolveJourneyId','40614kkvQUy','\x20changed\x20files','absolutePath','Table:\x20','17051030kmPARF','11CLkdPV','\x20\x20Consolidating\x20duplicate\x20segment:\x20','✔\x20Pulled\x20','yellow','jsonl','Resuming\x20journey...','message','toLowerCase','Folder\x20path:\x20','launched','listJourneysFromParentSegment','folders','📁\x20','journey:version:view','\x20unchanged\x20files','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','name','journey:activations','Error:\x20Journey\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','createdAt','description','listJourneysWithFolders','-\x20no\x20files\x20written','Warning:\x20Could\x20not\x20resolve\x20segment\x20','includeStats','journey:push','push','errorCode','exitOrJumpRate','tdx.json','\x20->\x20','\x20\x20Parent\x20segment:\x20','versionNumber','Error:\x20Version\x20','getSegment','dim','stage','journey:version:create','red','/j/da','parentName','journey:resume','Error:\x20--version\x20option\x20is\x20required','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','folderId','.yml','\x0aChanges\x20to\x20\x27','relative','repeat','add','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','journeyId','\x20journey\x20files\x20to\x20','🗺️\x20','from','log','activation_','(draft)','attributes','yes','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','relativePath','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','size','parentSegment','(completed)','links','Show\x20journey\x20statistics','\x20\x20Preserving\x20local\x20segment\x20name:\x20','948vKBfyf','cyan','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','journeyName','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','activationParams','\x20versions)','conversion','Resolving\x20version...','114sOTxYl','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','audienceId','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Error:\x20Journey\x20not\x20found:\x20','limit','blue','✔\x20Context\x20set:\x20','content','Input:\x20','split','journeys','/j/da/je','session','Show\x20journey\x20details','milestoneSize','has','\x20details...','folderPath','Resolved\x20YAML\x20file:\x20','journey','hasChanges','tsv','segment','getStatistics','Pausing\x20journey...','Found\x20','verbose','Getting\x20version\x20','activation','state','journey:versions','archived','Error:\x20Invalid\x20--type\x20\x22','entries','INVALID_ARGUMENT','hasPeriod','Error:\x20','\x0aPull\x20summary:','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','nodes','\x20\x20-\x20','database','segmentName','segmentPushCommand','json','localeCompare','version','\x20not\x20found.\x20Available:\x20','cwd','helpText','buildIdToEmailMap','\x22\x20resumed','\x22\x20not\x20found','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','test','List\x20all\x20versions\x20of\x20a\x20journey','39BvkaDa'];a27_0x3491=function(){return _0x2d36ec;};return a27_0x3491();}const a27_0x2a94fe=a27_0xedc1;(function(_0x2e5284,_0x41c4fe){const _0x54e741=a27_0xedc1,_0x52063f=_0x2e5284();while(!![]){try{const _0x14ee2a=-parseInt(_0x54e741(0x172))/0x1*(parseInt(_0x54e741(0xc5))/0x2)+parseInt(_0x54e741(0xfe))/0x3*(parseInt(_0x54e741(0x130))/0x4)+-parseInt(_0x54e741(0x140))/0x5*(parseInt(_0x54e741(0xbb))/0x6)+-parseInt(_0x54e741(0x185))/0x7+-parseInt(_0x54e741(0x104))/0x8+-parseInt(_0x54e741(0xff))/0x9+parseInt(_0x54e741(0x189))/0xa*(parseInt(_0x54e741(0x18a))/0xb);if(_0x14ee2a===_0x41c4fe)break;else _0x52063f['push'](_0x52063f['shift']());}catch(_0xd68447){_0x52063f['push'](_0x52063f['shift']());}}}(a27_0x3491,0x4c48d));import a27_0x4ccf69 from'chalk';import a27_0x32558d from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a27_0xedc1(_0x5e5b7a,_0xdf444d){_0x5e5b7a=_0x5e5b7a-0x99;const _0x349198=a27_0x3491();let _0xedc11f=_0x349198[_0x5e5b7a];return _0xedc11f;}import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x24b256){const _0x3cb522=a27_0xedc1;return!_0x24b256&&(console[_0x3cb522(0x10b)](_0x3cb522(0xb4)),console[_0x3cb522(0x10b)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x24b256;}function withJsonFormat(_0x5df7f0){const _0x40273c=a27_0xedc1;if(!_0x5df7f0[_0x40273c(0x111)]&&!_0x5df7f0[_0x40273c(0xf2)]&&!_0x5df7f0['jsonl']&&!_0x5df7f0[_0x40273c(0xdb)])return{..._0x5df7f0,'format':_0x40273c(0xf2),'json':!![]};return _0x5df7f0;}function formatJourneyState(_0x54c2da){const _0x3517fc=a27_0xedc1;switch(_0x54c2da){case _0x3517fc(0x193):return a27_0x4ccf69[_0x3517fc(0x108)](_0x3517fc(0x120));case'draft':return a27_0x4ccf69['dim'](_0x3517fc(0xaf));case'paused':return a27_0x4ccf69[_0x3517fc(0x18d)](_0x3517fc(0x119));case _0x3517fc(0x129):return a27_0x4ccf69[_0x3517fc(0xcb)](_0x3517fc(0xb7));case _0x3517fc(0xe5):return a27_0x4ccf69[_0x3517fc(0x99)]('(archived)');default:return'('+_0x54c2da+')';}}function formatJourneyItem(_0xb09cf9,_0x5a482b='',_0x59cd04){const _0x4552a1=a27_0xedc1,_0x4946c2=formatJourneyState(_0xb09cf9[_0x4552a1(0xe3)]),_0x3a1394=_0x59cd04?hyperlink(_0xb09cf9['journeyBundleName'],_0x59cd04):_0xb09cf9[_0x4552a1(0x157)];return _0x5a482b+_0x4552a1(0xab)+_0x3a1394+'\x20'+_0x4946c2;}function escapeRegex(_0x6e0130){const _0x50ef36=a27_0xedc1;return _0x6e0130[_0x50ef36(0x148)](/[.*+?^${}()|[\]\\]/g,_0x50ef36(0x150));}function globToRegex(_0x50f9a4){const _0x4276ce=a27_0xedc1,_0x64242b=_0x50f9a4[_0x4276ce(0xcf)]('*')[_0x4276ce(0x126)](escapeRegex);return new RegExp(_0x64242b[_0x4276ce(0x11d)]('.*'),'i');}function buildRuleToNameMapping(_0x121930){const _0x19f43c=a27_0xedc1,_0x232abb=new Map();if(_0x121930[_0x19f43c(0x115)])for(const [_0x423dc5,_0x4da9ee]of Object['entries'](_0x121930[_0x19f43c(0x115)])){if(_0x4da9ee[_0x19f43c(0x15c)]){const _0x4f5588=serializeRule(_0x4da9ee[_0x19f43c(0x15c)]),_0x3b720c=_0x232abb[_0x19f43c(0x128)](_0x4f5588);_0x3b720c?_0x3b720c[_0x19f43c(0x1a6)](_0x423dc5):_0x232abb['set'](_0x4f5588,[_0x423dc5]);}}return _0x232abb;}async function resolveJourneyIdFromInput(_0x2a4ff3,_0x2ac373,_0x57de03){const _0x2ead9b=a27_0xedc1,_0x4389e7=await resolveJourneyTarget(_0x2a4ff3,_0x2ac373[_0x2ead9b(0xb6)],_0x2ac373[_0x2ead9b(0xe0)]),_0x4f655c=_0x4389e7[_0x2ead9b(0xb6)];if(!_0x4f655c)throw new SDKError(ErrorCode[_0x2ead9b(0xe8)],_0x2ead9b(0x199));const _0x5f1497=await withSpinner(_0x2ead9b(0x138),()=>_0x57de03[_0x2ead9b(0xdc)]['resolveParentId'](_0x4f655c),{'verbose':_0x2ac373[_0x2ead9b(0xe0)]}),_0x3d8ec4=_0x5f1497[_0x2ead9b(0x14e)],_0x49d110=await withSpinner(_0x2ead9b(0x12d),()=>_0x57de03[_0x2ead9b(0xd9)][_0x2ead9b(0x184)](_0x3d8ec4,_0x4389e7[_0x2ead9b(0xbe)]),{'verbose':_0x2ac373[_0x2ead9b(0xe0)]});return{'journeyId':_0x49d110[_0x2ead9b(0x14e)],'journeyName':_0x4389e7[_0x2ead9b(0xbe)],'parentSegmentId':_0x3d8ec4};}async function resolveJourneyTarget(_0x3b981d,_0x4c92e2,_0xe2552b){const _0x3cfb0e=a27_0xedc1;if(isYamlFilePath(_0x3b981d))try{const _0x2a66eb=await resolveYamlFilePath(_0x3b981d);return _0xe2552b&&(console[_0x3cfb0e(0x10b)](_0x3cfb0e(0xd8)+_0x3b981d),console['error'](_0x3cfb0e(0x1ab)+_0x2a66eb[_0x3cfb0e(0xb6)]),console[_0x3cfb0e(0x10b)]('\x20\x20Name:\x20'+_0x2a66eb[_0x3cfb0e(0xf0)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x2a66eb[_0x3cfb0e(0xd7)]||_0x3cfb0e(0x161)))),{'journeyName':_0x2a66eb[_0x3cfb0e(0xf0)],'parentSegment':_0x2a66eb[_0x3cfb0e(0xb6)],'resolved':_0x2a66eb};}catch(_0x2a6491){throw new SDKError(ErrorCode[_0x3cfb0e(0xe8)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x2a6491[_0x3cfb0e(0x190)]);}if(!_0x4c92e2)throw new SDKError(ErrorCode[_0x3cfb0e(0xe8)],_0x3cfb0e(0xb2));return{'journeyName':_0x3b981d,'parentSegment':_0x4c92e2};}export class JourneyListCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x16e);[a27_0x2a94fe(0x1a0)]=a27_0x2a94fe(0x149);async[a27_0x2a94fe(0x146)](_0xe41c9){const _0x3f5665=a27_0x2a94fe,{options:_0xf69c90,args:_0x20e871,tdx:_0x16d732}=_0xe41c9,_0x471770=_0x20e871[0x0],_0x5d954a=_0xf69c90[_0x3f5665(0xb6)];if(!_0x5d954a)return console[_0x3f5665(0x10b)](_0x3f5665(0x173)),console[_0x3f5665(0x10b)](_0x3f5665(0x14c)),0x1;const _0x9449c8=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x16d732[_0x3f5665(0xdc)][_0x3f5665(0x169)](_0x5d954a),{'verbose':_0xf69c90['verbose']}),_0xcefe26=_0x9449c8[_0x3f5665(0x14e)];_0xf69c90['verbose']&&(console[_0x3f5665(0x10b)](_0x3f5665(0x15a)+_0x5d954a+'\x20(ID:\x20'+_0xcefe26+')'),_0x471770&&console[_0x3f5665(0x10b)](_0x3f5665(0x11b)+_0x471770));const _0x1e7ae7=await withSpinner(_0x3f5665(0x17d),()=>_0x16d732[_0x3f5665(0xdc)][_0x3f5665(0x175)](_0xcefe26),{'verbose':_0xf69c90['verbose']}),_0x5c4541=_0x1e7ae7[_0x3f5665(0x14e)],_0x440311=_0x5c4541[_0x3f5665(0x178)],_0x5e90c9=await withSpinner('Listing\x20journeys...',()=>_0x16d732[_0x3f5665(0xd9)][_0x3f5665(0x1a1)](_0xcefe26,_0x440311),{'verbose':_0xf69c90[_0x3f5665(0xe0)]});let _0x5d6a4f=_0x5e90c9[_0x3f5665(0x14e)][_0x3f5665(0xd0)];const _0x389ae6=_0x5e90c9[_0x3f5665(0x14e)][_0x3f5665(0x195)],_0x6f0319=new Map();for(const _0x2d860e of _0x389ae6){_0x6f0319[_0x3f5665(0x118)](_0x2d860e['id'],_0x2d860e['name']);}if(_0x471770){const _0xe8d546=globToRegex(_0x471770);_0x5d6a4f=_0x5d6a4f[_0x3f5665(0x162)](_0x3afac5=>_0xe8d546[_0x3f5665(0xfc)](_0x3afac5['journeyBundleName']));}console[_0x3f5665(0x10b)](_0x3f5665(0x132)+_0x5d6a4f[_0x3f5665(0x165)]+_0x3f5665(0x123)+(_0x5d6a4f['length']!==0x1?'s':''));const _0x558cf3=_0x119490=>{const _0x1fe31f=_0x3f5665;return getConsoleNextUrl(_0xf69c90['site'],_0x1fe31f(0x10a)+_0xcefe26+_0x1fe31f(0x144)+_0x119490+_0x1fe31f(0x9d));};if(_0xf69c90[_0x3f5665(0x111)]===_0x3f5665(0x124))await handleSDKOutput(_0x5d6a4f,_0xf69c90);else{if(_0xf69c90[_0x3f5665(0x111)]===_0x3f5665(0xf2)){const _0x389e86=_0x5d6a4f[_0x3f5665(0x126)](_0x32ec43=>({..._0x32ec43,'url':_0x558cf3(_0x32ec43['id'])}));await handleSDKOutput(_0x389e86,_0xf69c90);}else{console['log']('['+_0x5d954a+']');const _0x22b87c=new Map(),_0x5545af=[];for(const _0x41b283 of _0x5d6a4f){if(!_0x41b283[_0x3f5665(0xa2)]||_0x41b283['folderId']===_0x440311)_0x5545af[_0x3f5665(0x1a6)](_0x41b283);else{const _0x1f804e=_0x22b87c[_0x3f5665(0x128)](_0x41b283[_0x3f5665(0xa2)])||[];_0x1f804e['push'](_0x41b283),_0x22b87c[_0x3f5665(0x118)](_0x41b283['folderId'],_0x1f804e);}}const _0x254a8a=(_0x4ec6c2,_0x40e701)=>_0x4ec6c2[_0x3f5665(0x157)][_0x3f5665(0xf3)](_0x40e701['journeyBundleName'],undefined,{'sensitivity':'base'});_0x5545af[_0x3f5665(0x179)](_0x254a8a);for(const _0x70f6b3 of _0x5545af){console[_0x3f5665(0xad)](formatJourneyItem(_0x70f6b3,'',_0x558cf3(_0x70f6b3['id'])));}const _0x19d8c5=[..._0x22b87c[_0x3f5665(0xe7)]()][_0x3f5665(0x179)]((_0x399707,_0x3343da)=>{const _0x2671c3=_0x3f5665,_0x2b68b9=_0x6f0319[_0x2671c3(0x128)](_0x399707[0x0])||_0x399707[0x0],_0x2d588b=_0x6f0319[_0x2671c3(0x128)](_0x3343da[0x0])||_0x3343da[0x0];return _0x2b68b9[_0x2671c3(0xf3)](_0x2d588b,undefined,{'sensitivity':_0x2671c3(0x114)});});for(const [_0x397240,_0x6b3aa3]of _0x19d8c5){const _0x45b306=_0x6f0319[_0x3f5665(0x128)](_0x397240)||_0x397240;console['log'](_0x3f5665(0x196)+_0x45b306),_0x6b3aa3['sort'](_0x254a8a);for(const _0x372dfd of _0x6b3aa3){console['log'](formatJourneyItem(_0x372dfd,'\x20\x20',_0x558cf3(_0x372dfd['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x110);[a27_0x2a94fe(0x1a0)]=a27_0x2a94fe(0xd3);async[a27_0x2a94fe(0x146)](_0xf60934){const _0x24655b=a27_0x2a94fe,{options:_0x40f86c,args:_0x37514a,tdx:_0xfefc08}=_0xf60934,_0x3deefd=_0x37514a[0x0];if(!_0x3deefd)return console[_0x24655b(0x10b)](_0x24655b(0xb4)),console[_0x24655b(0x10b)](_0x24655b(0x12c)),console[_0x24655b(0x10b)]('Options:'),console[_0x24655b(0x10b)](_0x24655b(0xa8)),0x1;_0x40f86c[_0x24655b(0xe0)]&&console[_0x24655b(0x10b)](_0x24655b(0xce)+_0x3deefd);const {journeyId:_0x51fcc3,parentSegmentId:_0x1ab59c}=await resolveJourneyIdFromInput(_0x3deefd,_0x40f86c,_0xfefc08);if(_0x40f86c[_0x24655b(0x135)]){const _0x73c1c7=getConsoleNextUrl(_0x40f86c[_0x24655b(0x159)],_0x24655b(0x10a)+_0x1ab59c+'/e/'+_0x51fcc3+_0x24655b(0xd1));return console['error'](a27_0x4ccf69[_0x24655b(0x108)]('✔')+_0x24655b(0x12b)+a27_0x4ccf69[_0x24655b(0xbc)](_0x73c1c7)),openBrowser(_0x73c1c7),0x0;}const _0x1c87c9=await withSpinner(_0x24655b(0x155),()=>_0xfefc08[_0x24655b(0xd9)][_0x24655b(0x177)](_0x51fcc3),{'verbose':_0x40f86c['verbose']}),_0x208b24=_0x1c87c9[_0x24655b(0x14e)],_0x5e7ae3=_0x40f86c[_0x24655b(0x1a4)];let _0x17587b;if(_0x5e7ae3)try{const _0x100631=await withSpinner(_0x24655b(0x117),()=>_0xfefc08[_0x24655b(0xd9)][_0x24655b(0xdd)](_0x51fcc3),{'verbose':_0x40f86c[_0x24655b(0xe0)]});_0x17587b=_0x100631[_0x24655b(0x14e)];}catch{_0x40f86c['verbose']&&console[_0x24655b(0x10b)](_0x24655b(0x10d));}const _0x23d057=getConsoleNextUrl(_0x40f86c[_0x24655b(0x159)],_0x24655b(0x10a)+_0x1ab59c+'/e/'+_0x51fcc3+_0x24655b(0xd1)),_0x3e8b54={'id':_0x208b24['id'],'name':_0x208b24[_0x24655b(0xb0)][_0x24655b(0x19a)],'description':_0x208b24[_0x24655b(0xb0)][_0x24655b(0x1a0)],'state':_0x208b24[_0x24655b(0xb0)][_0x24655b(0xe3)],'paused':_0x208b24['attributes']['paused'],'reentry_mode':_0x208b24['attributes'][_0x24655b(0x10c)],'stages':_0x208b24['attributes']['journeyStages']?.[_0x24655b(0x165)]||0x0,..._0x208b24[_0x24655b(0xb0)][_0x24655b(0x180)]&&{'goal':_0x208b24[_0x24655b(0xb0)][_0x24655b(0x180)][_0x24655b(0x19a)]},..._0x17587b&&{'statistics':{'size':_0x17587b[_0x24655b(0xb5)],'entered':_0x17587b[_0x24655b(0x147)],'goal_achieved':_0x17587b[_0x24655b(0x11f)],'completion_rate':_0x17587b[_0x24655b(0x15f)],'exit_or_jump':_0x17587b['exitOrJumpSize'],'exit_or_jump_rate':_0x17587b[_0x24655b(0x1a8)],'stages':_0x17587b['stages']}},'url':_0x23d057};return await handleSingleObjectOutput(_0x3e8b54,_0x40f86c),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x137);['description']=a27_0x2a94fe(0xb9);async[a27_0x2a94fe(0x146)](_0x277694){const _0x1b197e=a27_0x2a94fe,{options:_0x365e45,args:_0x10717d,tdx:_0x10a5c8}=_0x277694,_0x37b4a1=_0x10717d[0x0];if(!requireNameOrPath(_0x37b4a1))return 0x1;_0x365e45[_0x1b197e(0xe0)]&&console[_0x1b197e(0x10b)](_0x1b197e(0xce)+_0x37b4a1);const _0x474c58=_0x365e45,_0x25ebfb=_0x474c58[_0x1b197e(0xac)],_0x1583c2=_0x474c58['to'],_0x1678a0=_0x474c58['includeHistory'],_0xdf08e=_0x474c58[_0x1b197e(0x9a)];_0x1678a0&&!_0x25ebfb&&!_0x1583c2&&console[_0x1b197e(0x10b)](_0x1b197e(0xc6));const _0x4dd23c=_0x1678a0?withJsonFormat(_0x365e45):_0x365e45,{journeyId:_0x47ebad,journeyName:_0x5a6ea5}=await resolveJourneyIdFromInput(_0x37b4a1,_0x4dd23c,_0x10a5c8),_0x583dfa=_0x25ebfb||_0x1583c2?{'from':_0x25ebfb,'to':_0x1583c2}:undefined,_0x54d867=await withSpinner(_0x1b197e(0x117),()=>Promise['all']([_0x10a5c8[_0x1b197e(0xd9)][_0x1b197e(0x177)](_0x47ebad),_0x10a5c8[_0x1b197e(0xd9)][_0x1b197e(0xdd)](_0x47ebad,_0x583dfa)]),{'verbose':_0x4dd23c['verbose']}),[_0x1d59f0,_0x5cd779]=_0x54d867[_0x1b197e(0x14e)];if(!_0x5cd779||_0x5cd779[_0x1b197e(0xa9)]===null)return console['error'](_0x1b197e(0x166)+_0x5a6ea5),console[_0x1b197e(0x10b)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x12a9e9=buildStageNameMap(_0x1d59f0),_0x2dd54e=!!(_0x583dfa&&_0x5cd779[_0x1b197e(0x103)]?.[_0x1b197e(0x165)]),_0x1b6375={'stageNameMap':_0x12a9e9,'hasPeriod':_0x2dd54e,'includeHistory':!!_0x1678a0};if(_0xdf08e&&_0x5cd779[_0x1b197e(0x153)]){const _0x363d97=_0x5cd779[_0x1b197e(0x153)][_0x1b197e(0x13c)](_0x2ab00b=>{const _0x369426=_0x1b197e,_0x4fdb5e=_0x12a9e9[_0x369426(0x128)](_0x2ab00b['id'])??'';return _0x4fdb5e[_0x369426(0x191)]()===_0xdf08e['toLowerCase']();});if(_0x363d97)return await handleSingleObjectOutput(formatStageStats(_0x363d97,_0x1b6375),_0x4dd23c),0x0;const _0x1be544=_0x5cd779[_0x1b197e(0x153)][_0x1b197e(0x126)](_0x2bf87c=>_0x12a9e9[_0x1b197e(0x128)](_0x2bf87c['id'])??_0x2bf87c['id']);return console[_0x1b197e(0x10b)](_0x1b197e(0x160)+_0xdf08e+_0x1b197e(0xfa)),console[_0x1b197e(0x10b)](_0x1b197e(0x14a)+_0x1be544['join'](',\x20')),0x1;}const _0x463125=_0x5cd779[_0x1b197e(0x153)]?.[_0x1b197e(0x126)](_0x43904d=>formatStageStats(_0x43904d,_0x1b6375)),_0xdc0715=assembleJourneyStats(_0x5cd779,{'from':_0x25ebfb,'to':_0x1583c2,'includeHistory':_0x1678a0});return await this['renderStats'](_0xdc0715,_0x463125??[],_0x4dd23c),0x0;}async[a27_0x2a94fe(0x181)](_0x39d467,_0x2d2f94,_0x422ecb){const _0x36fdfd=a27_0x2a94fe,_0x8526f5=_0x422ecb['format']===_0x36fdfd(0xf2)||_0x422ecb['format']===_0x36fdfd(0x18e)||_0x422ecb[_0x36fdfd(0xf2)]||_0x422ecb['jsonl'];if(_0x8526f5){_0x39d467[_0x36fdfd(0x153)]=_0x2d2f94,await handleSingleObjectOutput(_0x39d467,_0x422ecb);return;}await handleSingleObjectOutput(_0x39d467,_0x422ecb);for(const _0xf77c02 of _0x2d2f94){console['log'](''),console['log'](String(a27_0x4ccf69['cyan']['bold']('['+_0xf77c02[_0x36fdfd(0x19a)]+']'))+a27_0x4ccf69[_0x36fdfd(0x99)]('\x20'+_0xf77c02['id']));const {id:_0x1647a7,name:_0x605679,..._0x1af205}=_0xf77c02;await handleSingleObjectOutput(_0x1af205,_0x422ecb);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x16b);[a27_0x2a94fe(0x1a0)]=a27_0x2a94fe(0x14b);async[a27_0x2a94fe(0x146)](_0xc42d0f){const _0x305502=a27_0x2a94fe,{options:_0x552869,args:_0xfe513a,tdx:_0x61535f}=_0xc42d0f,_0x4643ea=_0xfe513a[0x0];if(!requireNameOrPath(_0x4643ea))return 0x1;_0x552869[_0x305502(0xe0)]&&console[_0x305502(0x10b)](_0x305502(0xce)+_0x4643ea);const _0x39df39=_0x552869,_0x2997af=_0x39df39[_0x305502(0x156)],_0x1bb139=_0x39df39[_0x305502(0xac)],_0x19c83d=_0x39df39['to'],_0x15482f=_0x39df39[_0x305502(0xca)];if(_0x2997af&&_0x2997af!==_0x305502(0xc3)&&_0x2997af!=='activation')return console['error'](_0x305502(0xe6)+_0x2997af+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x11a669=withJsonFormat(_0x552869),{journeyId:_0x2d4216,journeyName:_0x111421}=await resolveJourneyIdFromInput(_0x4643ea,_0x11a669,_0x61535f),_0x5cef41={'type':_0x2997af,'from':_0x1bb139,'to':_0x19c83d,'limit':_0x15482f},_0x5a7254=await withSpinner(_0x305502(0x17b),()=>_0x61535f[_0x305502(0xd9)]['getTrafficData'](_0x2d4216,_0x5cef41),{'verbose':_0x11a669[_0x305502(0xe0)]}),_0x54a23f=_0x5a7254[_0x305502(0x14e)],_0x4f3aaf=_0x54a23f[_0x305502(0xc3)]&&(_0x54a23f['conversion'][_0x305502(0xed)][_0x305502(0x165)]>0x0||_0x54a23f['conversion'][_0x305502(0xb8)][_0x305502(0x165)]>0x0),_0x4540b1=_0x54a23f[_0x305502(0xe2)]&&_0x54a23f['activation'][_0x305502(0x165)]>0x0;if(!_0x4f3aaf&&!_0x4540b1)return console[_0x305502(0x10b)](_0x305502(0xbf)+_0x111421),console['error'](_0x305502(0x182)),_0x1bb139&&_0x19c83d&&console[_0x305502(0x10b)](_0x305502(0xbd)),0x0;return await handleSingleObjectOutput(_0x54a23f,_0x11a669),0x0;}}function formatStageStats(_0x5d9904,_0x68938){const _0x44c21f=a27_0x2a94fe,_0x1b676a=_0x68938[_0x44c21f(0xe9)]&&_0x5d9904[_0x44c21f(0x103)]?.['length']?aggregateStageHistory(_0x5d9904[_0x44c21f(0x103)]):{'size':_0x5d9904[_0x44c21f(0xb5)],'entered':_0x5d9904[_0x44c21f(0x147)],'milestone':_0x5d9904[_0x44c21f(0xd4)],'milestone_rate':_0x5d9904[_0x44c21f(0x174)],'exit_or_jump':_0x5d9904['exitOrJumpSize'],'exit_or_jump_rate':_0x5d9904['exitOrJumpRate']},_0x4efe8a={'id':_0x5d9904['id'],'name':_0x68938[_0x44c21f(0x127)][_0x44c21f(0x128)](_0x5d9904['id'])??_0x5d9904['id'],..._0x1b676a};return _0x68938[_0x44c21f(0xe9)]&&_0x68938[_0x44c21f(0x154)]&&_0x5d9904[_0x44c21f(0x103)]&&(_0x4efe8a[_0x44c21f(0x103)]=_0x5d9904[_0x44c21f(0x103)]),_0x4efe8a;}export class JourneyPauseCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]='journey:pause';['description']='Pause\x20a\x20running\x20journey';async[a27_0x2a94fe(0x146)](_0x2b3c26){const _0x1acc0c=a27_0x2a94fe,{options:_0x2e4dfc,args:_0x575e78,tdx:_0x28bd99}=_0x2b3c26,_0x28eaef=_0x575e78[0x0];if(!requireNameOrPath(_0x28eaef))return 0x1;_0x2e4dfc['verbose']&&console['error'](_0x1acc0c(0xce)+_0x28eaef);const {journeyId:_0xf7da3a,journeyName:_0x132e64}=await resolveJourneyIdFromInput(_0x28eaef,_0x2e4dfc,_0x28bd99);if(!_0x2e4dfc[_0x1acc0c(0xb1)]){const _0x2ba42f=await confirm(_0x1acc0c(0x112)+_0x132e64+'\x22?');if(!_0x2ba42f)return console[_0x1acc0c(0x10b)](_0x1acc0c(0x106)),0x0;}const _0x22391c=await withSpinner(_0x1acc0c(0xde),()=>_0x28bd99['journey']['pause'](_0xf7da3a),{'verbose':_0x2e4dfc[_0x1acc0c(0xe0)]}),_0x4c924c=_0x22391c[_0x1acc0c(0x14e)];return console[_0x1acc0c(0x10b)](_0x1acc0c(0x125)+_0x4c924c[_0x1acc0c(0xb0)][_0x1acc0c(0x19a)]+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x9f);[a27_0x2a94fe(0x1a0)]='Resume\x20a\x20paused\x20journey';async['execute'](_0x49b8cc){const _0x5d0d8f=a27_0x2a94fe,{options:_0x2ed477,args:_0x26e41d,tdx:_0x103b3e}=_0x49b8cc,_0xe1e32c=_0x26e41d[0x0];if(!requireNameOrPath(_0xe1e32c))return 0x1;_0x2ed477['verbose']&&console['error'](_0x5d0d8f(0xce)+_0xe1e32c);const {journeyId:_0x5a4f89,journeyName:_0x591e38}=await resolveJourneyIdFromInput(_0xe1e32c,_0x2ed477,_0x103b3e);if(!_0x2ed477['yes']){const _0x1ab55e=await confirm(_0x5d0d8f(0x109)+_0x591e38+'\x22?');if(!_0x1ab55e)return console[_0x5d0d8f(0x10b)]('Cancelled'),0x0;}const _0x1c9bd5=await withSpinner(_0x5d0d8f(0x18f),()=>_0x103b3e[_0x5d0d8f(0xd9)][_0x5d0d8f(0x102)](_0x5a4f89),{'verbose':_0x2ed477[_0x5d0d8f(0xe0)]}),_0x396ef2=_0x1c9bd5[_0x5d0d8f(0x14e)];return console[_0x5d0d8f(0x10b)](_0x5d0d8f(0x125)+_0x396ef2[_0x5d0d8f(0xb0)]['name']+_0x5d0d8f(0xf9)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x13e);[a27_0x2a94fe(0x1a0)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x2a94fe(0x146)](_0x11bc35){const _0x1f0b02=a27_0x2a94fe,{options:_0x2d11d4,args:_0x40ea88,tdx:_0x4b6709}=_0x11bc35,_0x5d266c=_0x2d11d4,_0x581cd9=_0x40ea88[0x0],_0x47f301=_0x581cd9&&isYamlFilePath(_0x581cd9),_0xa34762=await resolveTarget({'arg':_0x47f301?_0x581cd9:undefined,'contextParent':_0x2d11d4[_0x1f0b02(0xb6)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xa34762))return _0xa34762[_0x1f0b02(0x1a7)]==='no_parent'?(console[_0x1f0b02(0x10b)](a27_0x4ccf69[_0x1f0b02(0x18d)](_0x1f0b02(0xfb))),console['error']('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console['error'](_0x1f0b02(0xc8)),console[_0x1f0b02(0x10b)](_0x1f0b02(0xc0)),console[_0x1f0b02(0x10b)](_0x1f0b02(0x16d))):(console[_0x1f0b02(0x10b)](a27_0x4ccf69[_0x1f0b02(0x9c)](_0x1f0b02(0xea)+_0xa34762[_0x1f0b02(0x190)]+'\x0a')),_0xa34762[_0x1f0b02(0xf7)]&&console[_0x1f0b02(0x10b)](a27_0x4ccf69[_0x1f0b02(0xbc)](_0xa34762[_0x1f0b02(0xf7)]))),0x1;let _0x351054=_0x47f301?undefined:_0x581cd9,_0x20ea24,_0x3fc9b2;_0xa34762['type']==='file'&&(_0x351054=_0xa34762[_0x1f0b02(0x14f)],_0x20ea24=_0xa34762[_0x1f0b02(0x116)],_0x3fc9b2=_0xa34762['folderPath']);const _0x3fa318=_0xa34762[_0x1f0b02(0x9e)],_0x4b02b4=_0xa34762[_0x1f0b02(0x152)];_0x5d266c[_0x1f0b02(0xe0)]&&(console[_0x1f0b02(0x10b)](_0x1f0b02(0x15a)+_0x3fa318),console[_0x1f0b02(0x10b)](_0x1f0b02(0x17c)+_0x4b02b4),_0x351054&&console['error']('Journey\x20name:\x20'+_0x351054),_0x20ea24&&console[_0x1f0b02(0x10b)](_0x1f0b02(0x164)+_0x20ea24),_0x3fc9b2&&console[_0x1f0b02(0x10b)](_0x1f0b02(0x192)+_0x3fc9b2));const _0x3b36f9=await withSpinner(_0x1f0b02(0x138),()=>_0x4b6709['segment'][_0x1f0b02(0x169)](_0x3fa318),{'verbose':_0x2d11d4[_0x1f0b02(0xe0)]}),_0x3b7264=_0x3b36f9['data'],{journeys:_0x3c12f3,folders:_0x136211}=await withSpinner(_0x1f0b02(0x11c),async()=>{const _0x19ce63=_0x1f0b02,[_0xa2f935,_0x25b2e8]=await Promise['all']([_0x4b6709[_0x19ce63(0xd9)][_0x19ce63(0x194)](_0x3b7264,undefined,{'includeAllVersions':!![]}),_0x4b6709['segment']['listFolders'](_0x3b7264)]);return{'journeys':_0xa2f935,'folders':_0x25b2e8};},{'verbose':_0x2d11d4['verbose']})['then'](_0x4b7e1c=>_0x4b7e1c[_0x1f0b02(0x14e)]);let _0x2633cb=_0x3c12f3;const _0x33c5c8=buildFolderIdToPathMap(_0x136211);if(_0x351054){const _0x56ce2a=_0x2633cb['filter'](_0x2d5f65=>_0x2d5f65[_0x1f0b02(0x157)][_0x1f0b02(0x191)]()===_0x351054[_0x1f0b02(0x191)]());if(_0x56ce2a[_0x1f0b02(0x165)]===0x0)return console[_0x1f0b02(0x10b)](_0x1f0b02(0xc9)+_0x351054),console[_0x1f0b02(0x10b)](_0x1f0b02(0x13f)),0x1;_0x2633cb=_0x56ce2a;}if(_0x3fc9b2!==undefined){const _0x5826e6=_0x2633cb['filter'](_0x4bedb3=>{const _0x48a3eb=_0x1f0b02,_0x546af5=_0x4bedb3[_0x48a3eb(0xa2)]?_0x33c5c8['get'](_0x4bedb3[_0x48a3eb(0xa2)])||'':'';return _0x546af5===_0x3fc9b2;});if(_0x5826e6['length']===0x0&&_0x2633cb['length']>0x0){console['error'](_0x1f0b02(0x19c)+_0x351054+_0x1f0b02(0x12f)+(_0x3fc9b2||_0x1f0b02(0x113))),console[_0x1f0b02(0x10b)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x1d753f of _0x2633cb){const _0x16b98a=_0x1d753f[_0x1f0b02(0xa2)]?_0x33c5c8['get'](_0x1d753f[_0x1f0b02(0xa2)])||'':'';console['error'](_0x1f0b02(0xee)+(_0x16b98a||'(root)')+'/'+_0x1d753f[_0x1f0b02(0x157)]);}return 0x1;}_0x2633cb=_0x5826e6;}if(_0x2633cb[_0x1f0b02(0x165)]===0x0)return console[_0x1f0b02(0x10b)](_0x1f0b02(0x14d)),0x0;const _0x19db9e=new Map();for(const _0x4ecda9 of _0x2633cb){const _0x7a5900=_0x4ecda9[_0x1f0b02(0x13b)];!_0x19db9e[_0x1f0b02(0xd5)](_0x7a5900)&&_0x19db9e['set'](_0x7a5900,[]),_0x19db9e[_0x1f0b02(0x128)](_0x7a5900)[_0x1f0b02(0x1a6)](_0x4ecda9);}for(const _0x1470ca of _0x19db9e[_0x1f0b02(0x183)]()){_0x1470ca['sort']((_0x8bc4e3,_0xc84338)=>(_0x8bc4e3[_0x1f0b02(0x1ac)]||0x0)-(_0xc84338[_0x1f0b02(0x1ac)]||0x0));}const _0x296782=[],{idToEmailMap:_0xab1ac3,connectionIdToNameMap:_0x4d62f1}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x2c88bb=_0x1f0b02,[_0xcd72,_0x4fbd66]=await Promise['all']([_0x4b6709[_0x2c88bb(0x100)][_0x2c88bb(0xf8)](),_0x4b6709[_0x2c88bb(0x171)][_0x2c88bb(0x142)]()]);return{'idToEmailMap':_0xcd72,'connectionIdToNameMap':_0x4fbd66};},{'verbose':_0x2d11d4[_0x1f0b02(0xe0)]})[_0x1f0b02(0x163)](_0x2b037e=>_0x2b037e[_0x1f0b02(0x14e)]);for(const _0x3fcbd8 of _0x19db9e[_0x1f0b02(0x183)]()){const _0xf87e92=_0x3fcbd8[0x0][_0x1f0b02(0x157)],_0x380ff2=_0x3fcbd8[0x0]['folderId'],_0x112e14=_0x380ff2?_0x33c5c8[_0x1f0b02(0x128)](_0x380ff2)||'':'',_0x315527=_0x112e14?a27_0x32558d[_0x1f0b02(0x11d)](_0x4b02b4,_0x112e14):_0x4b02b4,_0x1acbdf=_0x20ea24||a27_0x32558d['join'](_0x315527,sanitizeFileName(_0xf87e92)+_0x1f0b02(0xa3));let _0x208b13,_0x54eda8;if(existsSync(_0x1acbdf))try{const _0x581c99=readFileSync(_0x1acbdf,'utf-8'),_0x2dd0cf=parseYamlString(_0x581c99);_0x54eda8=_0x2dd0cf,_0x208b13=buildRuleToNameMapping(_0x2dd0cf),_0x5d266c[_0x1f0b02(0xe0)]&&_0x208b13[_0x1f0b02(0xb5)]>0x0&&console[_0x1f0b02(0x10b)](_0x1f0b02(0xdf)+_0x208b13[_0x1f0b02(0xb5)]+_0x1f0b02(0x19e)+_0xf87e92);}catch(_0x2c205b){_0x5d266c['verbose']&&console[_0x1f0b02(0x10b)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x2c205b[_0x1f0b02(0x190)]);}const _0x56d67c=[],_0xb509a1=new Set(),_0x52d99c=new Map(),_0x37373d=new Map(),_0x378d59=new Set(),_0x3d13ef=new Map(),_0x40a3e7=new Map(),_0x57cdb3=createJumpTargetCache();await withProgressSpinner(_0x1f0b02(0x16a)+_0xf87e92+_0x1f0b02(0x10e),async _0x463d2c=>{const _0x37407a=_0x1f0b02;for(const _0x4b9a04 of _0x3fcbd8){const _0x570e17=_0x3fcbd8[_0x37407a(0x165)]>0x1?_0x4b9a04[_0x37407a(0x157)]+'\x20v'+(_0x4b9a04[_0x37407a(0x1ac)]||0x1):_0x4b9a04['journeyBundleName'];_0x463d2c['setPhase'](_0x37407a(0x16a)+_0x570e17);const _0x5300f5=await _0x4b6709[_0x37407a(0xd9)]['getJourney'](_0x4b9a04['id']),_0xe0c13=_0x5300f5[_0x37407a(0xb0)]?.[_0x37407a(0xc7)],_0x157f7e={'resolveSegment':async _0x1d811e=>{const _0x32cc3d=_0x37407a;if(!_0xe0c13)return{'name':_0x1d811e,'isJourneyLocal':![]};const _0xa17747=_0x52d99c[_0x32cc3d(0x128)](_0x1d811e);if(_0xa17747)return _0xa17747;try{const _0xa157a2=await _0x4b6709[_0x32cc3d(0xdc)][_0x32cc3d(0x1ae)](_0xe0c13,_0x1d811e),_0x53ddca=_0xa157a2[_0x32cc3d(0x17a)]===SEGMENT_KIND_JOURNEY;let _0x3e162d,_0x2ec2fb=_0xa157a2['name'];if(_0x53ddca&&_0xa157a2[_0x32cc3d(0x15c)]){const _0x3548db=await segmentResponseToDef(_0xa157a2,{'resolveSegmentName':async _0x43e45c=>{const _0x3aa015=_0x32cc3d,_0x56a8f6=_0x52d99c['get'](_0x43e45c);if(_0x56a8f6)return _0x56a8f6['name'];const _0x2ad01e=await _0x157f7e['resolveSegment'](_0x43e45c);return _0x2ad01e[_0x3aa015(0x19a)];}}),_0x347950=_0x3548db['rule'];_0x3e162d={'description':_0xa157a2[_0x32cc3d(0x1a0)],'rule':_0x347950};const _0x284191=serializeRule(_0x347950),_0x450d9e=_0x37373d['get'](_0x284191);if(_0x450d9e)_0x2ec2fb=_0x450d9e,_0x3e162d=undefined,_0x5d266c[_0x32cc3d(0xe0)]&&console[_0x32cc3d(0x10b)](_0x32cc3d(0x18b)+_0xa157a2['name']+_0x32cc3d(0x1aa)+_0x450d9e);else{let _0x29b77b=![];if(_0x208b13){const _0x9f218e=_0x208b13[_0x32cc3d(0x128)](_0x284191);if(_0x9f218e){const _0xe525a4=_0x9f218e[_0x32cc3d(0x13c)](_0x512947=>!_0xb509a1[_0x32cc3d(0xd5)](_0x512947));_0xe525a4&&(_0x2ec2fb=_0xe525a4,_0xb509a1[_0x32cc3d(0xa7)](_0xe525a4),_0x37373d[_0x32cc3d(0x118)](_0x284191,_0xe525a4),_0x29b77b=!![],_0x5d266c[_0x32cc3d(0xe0)]&&console['error'](_0x32cc3d(0xba)+_0xe525a4+_0x32cc3d(0x158)));}}if(!_0x29b77b){const _0x4118bf=generateJourneyLocalName(_0xa157a2[_0x32cc3d(0x19a)]);_0x4118bf&&(_0x2ec2fb=_0x4118bf);let _0x1cc034=_0x2ec2fb,_0x4e8fb6=0x2;while(_0xb509a1[_0x32cc3d(0xd5)](_0x1cc034)){_0x1cc034=_0x2ec2fb+'_'+_0x4e8fb6,_0x4e8fb6++;}_0xb509a1[_0x32cc3d(0xa7)](_0x1cc034),_0x37373d[_0x32cc3d(0x118)](_0x284191,_0x1cc034),_0x2ec2fb=_0x1cc034;}}}const _0x1be85d={'name':_0x2ec2fb,'isJourneyLocal':_0x53ddca,'definition':_0x3e162d};return _0x52d99c[_0x32cc3d(0x118)](_0x1d811e,_0x1be85d),_0x1be85d;}catch(_0xa48117){return _0x2d11d4[_0x32cc3d(0xe0)]&&console[_0x32cc3d(0x10b)](_0x32cc3d(0x1a3)+_0x1d811e+':\x20'+_0xa48117[_0x32cc3d(0x190)]),{'name':_0x1d811e,'isJourneyLocal':![]};}},'resolveActivation':async _0x42a2f5=>{const _0x1fb530=_0x37407a,_0x2b3614=_0x3d13ef['get'](_0x42a2f5);if(_0x2b3614)return _0x2b3614;try{const _0x4c5a70=await _0x4b6709[_0x1fb530(0xd9)]['getActivation'](_0x4b9a04['id'],_0x42a2f5),_0x2d9a21=journeyActivationStepToYaml(_0x4c5a70,_0xab1ac3,_0x4d62f1),_0x2150b3=JSON['stringify']({'name':_0x2d9a21[_0x1fb530(0x19a)],'connection':_0x2d9a21['connection'],'connector_config':_0x2d9a21[_0x1fb530(0x11a)]}),_0x21d7f9=_0x40a3e7[_0x1fb530(0x128)](_0x2150b3);if(_0x21d7f9){const _0x41ab96={'name':_0x21d7f9,'isJourneyLocal':!![],'definition':_0x2d9a21};return _0x3d13ef[_0x1fb530(0x118)](_0x42a2f5,_0x41ab96),_0x41ab96;}const _0x4130b6=_0x4c5a70[_0x1fb530(0xb0)][_0x1fb530(0xc1)][_0x1fb530(0x19a)]||_0x42a2f5,_0x2279c2=sanitizeYamlKey(_0x4130b6)||_0x1fb530(0xae)+_0x42a2f5;let _0x49dab2=_0x2279c2,_0x2976b6=0x2;while(_0x378d59[_0x1fb530(0xd5)](_0x49dab2)){_0x49dab2=_0x2279c2+'_'+_0x2976b6,_0x2976b6++;}_0x378d59[_0x1fb530(0xa7)](_0x49dab2),_0x40a3e7[_0x1fb530(0x118)](_0x2150b3,_0x49dab2);const _0x47f529={'name':_0x49dab2,'isJourneyLocal':!![],'definition':_0x2d9a21};return _0x3d13ef[_0x1fb530(0x118)](_0x42a2f5,_0x47f529),_0x47f529;}catch(_0xdfc05){return _0x2d11d4['verbose']&&console[_0x1fb530(0x10b)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x42a2f5+':\x20'+_0xdfc05['message']),{'name':_0x42a2f5,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x14b727,_0x2f883c)=>{return resolveJumpTarget(_0x14b727,_0x2f883c,_0x57cdb3,_0x504010=>_0x4b6709['journey']['getJourney'](_0x504010));}},_0x24d90a=await journeyResponseToDef(_0x5300f5,_0x157f7e);_0x56d67c[_0x37407a(0x1a6)]({'item':_0x4b9a04,'yaml':_0x24d90a});}},{'verbose':_0x2d11d4[_0x1f0b02(0xe0)]});const _0x4f40ae=await _0x4b6709[_0x1f0b02(0xd9)]['getLatestJourneyId'](_0x3fcbd8[0x0][_0x1f0b02(0x13b)]),_0x2705cc=buildMergedJourneyDef(_0x56d67c,_0x208b13,_0x4f40ae),_0x2df1a0=normalizeJourneyDef(_0x2705cc,_0x54eda8),_0x3a9ff8=toYamlString(_0x2df1a0),_0x2bc69f=_0x20ea24||a27_0x32558d['join'](_0x315527,sanitizeFileName(_0xf87e92)+_0x1f0b02(0xa3));!_0x20ea24&&_0x112e14&&!existsSync(_0x315527)&&mkdirSync(_0x315527,{'recursive':!![]});const _0x2ad5ee=a27_0x32558d[_0x1f0b02(0xa5)](process[_0x1f0b02(0xf6)](),_0x2bc69f);if(existsSync(_0x2bc69f)){const _0x9400b2=readFileSync(_0x2bc69f,_0x1f0b02(0x143)),_0x38c510=generateDiff(_0x9400b2,_0x3a9ff8),_0x4cc066=hasChanges(_0x38c510);_0x296782[_0x1f0b02(0x1a6)]({'relativePath':_0x2ad5ee,'absolutePath':_0x2bc69f,'content':_0x3a9ff8,'isNew':![],'hasChanges':_0x4cc066,'diff':_0x4cc066?formatDiffWithColors(_0x38c510):undefined});}else _0x296782['push']({'relativePath':_0x2ad5ee,'absolutePath':_0x2bc69f,'content':_0x3a9ff8,'isNew':!![],'hasChanges':![]});}const _0x58fc48=_0x296782[_0x1f0b02(0x162)](_0x7f0430=>_0x7f0430[_0x1f0b02(0x145)]),_0x34d0e7=_0x296782[_0x1f0b02(0x162)](_0x184b22=>!_0x184b22['isNew']&&_0x184b22[_0x1f0b02(0xda)]),_0x200ed8=_0x296782[_0x1f0b02(0x162)](_0x4d032a=>!_0x4d032a[_0x1f0b02(0x145)]&&!_0x4d032a[_0x1f0b02(0xda)]),_0x358239=_0x2633cb[_0x1f0b02(0x165)],_0x581ae3=_0x19db9e[_0x1f0b02(0xb5)],_0xcc1809=_0x358239>_0x581ae3?'\x20('+_0x358239+_0x1f0b02(0xc2):'';console[_0x1f0b02(0x10b)](_0x1f0b02(0xeb)),console[_0x1f0b02(0x10b)]('\x20\x20'+a27_0x4ccf69['cyan'](_0x581ae3+_0x1f0b02(0x122))+a27_0x4ccf69[_0x1f0b02(0x99)](_0xcc1809)),console['error']('\x20\x20'+a27_0x4ccf69['green']('+\x20'+_0x58fc48['length']+_0x1f0b02(0x13d))),console[_0x1f0b02(0x10b)]('\x20\x20'+a27_0x4ccf69[_0x1f0b02(0x18d)]('~\x20'+_0x34d0e7['length']+_0x1f0b02(0x186))),console[_0x1f0b02(0x10b)]('\x20\x20'+a27_0x4ccf69[_0x1f0b02(0x99)]('=\x20'+_0x200ed8['length']+_0x1f0b02(0x198))),console[_0x1f0b02(0x10b)]('\x20\x20Target:\x20'+a27_0x4ccf69[_0x1f0b02(0xbc)](_0x4b02b4)+'\x0a');if(_0x34d0e7[_0x1f0b02(0x165)]>0x0)for(const _0x56f7ab of _0x34d0e7){console[_0x1f0b02(0x10b)](_0x1f0b02(0xa4)+_0x56f7ab[_0x1f0b02(0xb3)]+'\x27:'),console[_0x1f0b02(0x10b)]('─'[_0x1f0b02(0xa6)](0x3c)),console[_0x1f0b02(0x10b)](_0x56f7ab[_0x1f0b02(0x176)]),console[_0x1f0b02(0x10b)]('─'[_0x1f0b02(0xa6)](0x3c));}if(_0x5d266c[_0x1f0b02(0x17f)])return console[_0x1f0b02(0x10b)](a27_0x4ccf69[_0x1f0b02(0x18d)](_0x1f0b02(0x107))),0x0;if(_0x58fc48[_0x1f0b02(0x165)]===0x0&&_0x34d0e7['length']===0x0)return console['error'](a27_0x4ccf69[_0x1f0b02(0x108)](_0x1f0b02(0x19d))),saveSessionContext({'parent_segment':_0x3fa318},_0x5d266c[_0x1f0b02(0xd2)]),console['error'](a27_0x4ccf69[_0x1f0b02(0x108)](_0x1f0b02(0xcc)+a27_0x4ccf69[_0x1f0b02(0x99)]('parent_segment')+_0x1f0b02(0x101)+a27_0x4ccf69['cyan'](_0x3fa318))),0x0;if(!_0x5d266c[_0x1f0b02(0xb1)]&&(_0x58fc48[_0x1f0b02(0x165)]>0x0||_0x34d0e7[_0x1f0b02(0x165)]>0x0)){if(!isInteractive())return console[_0x1f0b02(0x10b)](a27_0x4ccf69[_0x1f0b02(0x9c)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1f0b02(0x10b)](a27_0x4ccf69[_0x1f0b02(0x99)](_0x1f0b02(0x151))),0x1;const _0x2b1281=await confirmKey(_0x1f0b02(0x15e)+(_0x58fc48[_0x1f0b02(0x165)]+_0x34d0e7[_0x1f0b02(0x165)])+_0x1f0b02(0x121));if(!_0x2b1281)return console['error'](a27_0x4ccf69[_0x1f0b02(0x18d)](_0x1f0b02(0x12e)),_0x1f0b02(0x1a2)),0x1;}!existsSync(_0x4b02b4)&&mkdirSync(_0x4b02b4,{'recursive':!![]});const _0x26c012=a27_0x32558d[_0x1f0b02(0x11d)](_0x4b02b4,_0x1f0b02(0x1a9));writeFileSync(_0x26c012,createTdxConfigContent(_0x3fa318),_0x1f0b02(0x143));for(const _0x5c121f of _0x296782){(_0x5c121f['isNew']||_0x5c121f[_0x1f0b02(0xda)])&&writeFileSync(_0x5c121f[_0x1f0b02(0x187)],_0x5c121f[_0x1f0b02(0xcd)],_0x1f0b02(0x143));}return console[_0x1f0b02(0x10b)](a27_0x4ccf69[_0x1f0b02(0x108)](_0x1f0b02(0x18c)+(_0x58fc48[_0x1f0b02(0x165)]+_0x34d0e7[_0x1f0b02(0x165)])+_0x1f0b02(0xaa)+_0x4b02b4)),saveSessionContext({'parent_segment':_0x3fa318},_0x5d266c['session']),console[_0x1f0b02(0x10b)](a27_0x4ccf69[_0x1f0b02(0x108)](_0x1f0b02(0xcc)+a27_0x4ccf69[_0x1f0b02(0x99)](_0x1f0b02(0x15d))+'\x20=\x20'+a27_0x4ccf69[_0x1f0b02(0xbc)](_0x3fa318))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]='journey:columns';[a27_0x2a94fe(0x1a0)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x2a94fe(0x146)](_0x177fcf){const _0x21ed1a=a27_0x2a94fe,{options:_0x555202,args:_0x581a88,tdx:_0xbb5f4a}=_0x177fcf,_0x2dbbc3=_0x581a88[0x0];if(!requireNameOrPath(_0x2dbbc3))return 0x1;_0x555202[_0x21ed1a(0xe0)]&&console['error'](_0x21ed1a(0xce)+_0x2dbbc3);const {journeyId:_0x41def7}=await resolveJourneyIdFromInput(_0x2dbbc3,_0x555202,_0xbb5f4a),_0x3bbb5a=await withSpinner(_0x21ed1a(0x12a),()=>_0xbb5f4a[_0x21ed1a(0xd9)]['getColumnMapping'](_0x41def7),{'verbose':_0x555202[_0x21ed1a(0xe0)]}),_0x92e786=_0x3bbb5a['data'];return console[_0x21ed1a(0xad)]('Database:\x20'+_0x92e786[_0x21ed1a(0xef)]),console[_0x21ed1a(0xad)](_0x21ed1a(0x188)+_0x92e786[_0x21ed1a(0x124)]),await handleSDKOutput(_0x92e786[_0x21ed1a(0x16c)],_0x555202),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x19b);[a27_0x2a94fe(0x1a0)]=a27_0x2a94fe(0x17e);async[a27_0x2a94fe(0x146)](_0x5f2b16){const _0x2566ba=a27_0x2a94fe,{options:_0x590dd9,args:_0xfba34a,tdx:_0x468ad9}=_0x5f2b16,_0x4f0830=_0xfba34a[0x0];if(!requireNameOrPath(_0x4f0830))return 0x1;_0x590dd9[_0x2566ba(0xe0)]&&console[_0x2566ba(0x10b)]('Input:\x20'+_0x4f0830);const {journeyId:_0xb200bd}=await resolveJourneyIdFromInput(_0x4f0830,_0x590dd9,_0x468ad9),_0x4eb049=await withSpinner(_0x2566ba(0x105),()=>_0x468ad9[_0x2566ba(0xd9)]['listActivationsFlat'](_0xb200bd),{'verbose':_0x590dd9[_0x2566ba(0xe0)]}),_0x227329=_0x4eb049[_0x2566ba(0x14e)];return console[_0x2566ba(0x10b)]('Found\x20'+_0x227329['length']+'\x20activation'+(_0x227329[_0x2566ba(0x165)]!==0x1?'s':'')),await handleSDKOutput(_0x227329,_0x590dd9),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x1a5);[a27_0x2a94fe(0x1a0)]=a27_0x2a94fe(0xa1);[a27_0x2a94fe(0xf1)]=new SegmentPushCommand();async[a27_0x2a94fe(0x146)](_0x5aa25f){const _0x5d5a3c=a27_0x2a94fe,_0x29b6a9=_0x5aa25f[_0x5d5a3c(0x10f)][0x0];let _0x2e1274;if(_0x29b6a9){const _0x2cf649=await resolveTarget({'arg':_0x29b6a9,'contextParent':_0x5aa25f[_0x5d5a3c(0x139)][_0x5d5a3c(0xb6)],'cwd':process['cwd']()});isSuccessfulResolution(_0x2cf649)&&_0x2cf649['type']===_0x5d5a3c(0x133)&&(_0x2e1274=_0x2cf649['filePath']);}const _0x19ff18={..._0x5aa25f,'options':{..._0x5aa25f[_0x5d5a3c(0x139)],'journeysOnly':!![],..._0x2e1274&&{'singleFilePath':_0x2e1274}}};return this[_0x5d5a3c(0xf1)]['execute'](_0x19ff18);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0xe4);[a27_0x2a94fe(0x1a0)]=a27_0x2a94fe(0xfd);async[a27_0x2a94fe(0x146)](_0x458b09){const _0xafd23c=a27_0x2a94fe,{options:_0x1284cd,args:_0x2aa02f,tdx:_0x301a71}=_0x458b09,_0x1128f2=_0x2aa02f[0x0];if(!requireNameOrPath(_0x1128f2))return 0x1;if(_0x1284cd[_0xafd23c(0xe0)])console[_0xafd23c(0x10b)]('Input:\x20'+_0x1128f2);const {journeyId:_0x180309}=await resolveJourneyIdFromInput(_0x1128f2,_0x1284cd,_0x301a71),_0x10ab24=await withSpinner(_0xafd23c(0x131),()=>_0x301a71['journey']['listVersions'](_0x180309),{'verbose':_0x1284cd['verbose']}),{bundleName:_0x362562,versions:_0x4a369a,latestJourneyId:_0x1b0ecf}=_0x10ab24[_0xafd23c(0x14e)];console['error'](_0x362562+':\x20'+_0x4a369a[_0xafd23c(0x165)]+_0xafd23c(0x134)+(_0x4a369a['length']!==0x1?'s':''));const _0x523e5c=_0x4a369a[_0xafd23c(0x126)](_0x12ea40=>({'version':_0x12ea40['versionNumber'],'journey_id':_0x12ea40[_0xafd23c(0xa9)],'name':_0x12ea40[_0xafd23c(0x19a)],'state':_0x12ea40[_0xafd23c(0xe3)],'paused':_0x12ea40[_0xafd23c(0x15b)],'latest':_0x12ea40[_0xafd23c(0xa9)]===_0x1b0ecf,'created_at':_0x12ea40['createdAt']}));return await handleSDKOutput(_0x523e5c,_0x1284cd),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x2a94fe(0x19a)]=a27_0x2a94fe(0x9b);[a27_0x2a94fe(0x1a0)]=a27_0x2a94fe(0x168);async[a27_0x2a94fe(0x146)](_0x4564af){const _0x171a72=a27_0x2a94fe,{options:_0x23d12e,args:_0x49c363,tdx:_0x11ba95}=_0x4564af,_0x2797e4=_0x49c363[0x0];if(!requireNameOrPath(_0x2797e4))return 0x1;if(_0x23d12e[_0x171a72(0xe0)])console[_0x171a72(0x10b)](_0x171a72(0xce)+_0x2797e4);const {journeyId:_0x5e0dd3,journeyName:_0x3ae7d3}=await resolveJourneyIdFromInput(_0x2797e4,_0x23d12e,_0x11ba95);if(!_0x23d12e[_0x171a72(0xb1)]){const _0xaaf2d1=await confirm(_0x171a72(0xec)+_0x3ae7d3+'\x22?');if(!_0xaaf2d1)return console[_0x171a72(0x10b)](_0x171a72(0x106)),0x0;}const _0x517cb6=await withSpinner('Creating\x20new\x20version...',()=>_0x11ba95[_0x171a72(0xd9)][_0x171a72(0x167)](_0x5e0dd3),{'verbose':_0x23d12e['verbose']}),_0x175f2c=_0x517cb6['data'];return console['error'](a27_0x4ccf69[_0x171a72(0x108)]('✔')+'\x20Created\x20v'+_0x175f2c[_0x171a72(0xb0)][_0x171a72(0x1ac)]+_0x171a72(0x13a)+_0x175f2c[_0x171a72(0xb0)][_0x171a72(0x19a)]+'\x22'),console[_0x171a72(0x10b)]('\x20\x20Journey\x20ID:\x20'+_0x175f2c['id']),await handleSingleObjectOutput({'id':_0x175f2c['id'],'name':_0x175f2c[_0x171a72(0xb0)]['name'],'version':_0x175f2c[_0x171a72(0xb0)]['versionNumber'],'state':_0x175f2c['attributes'][_0x171a72(0xe3)],'bundle_id':_0x175f2c[_0x171a72(0xb0)][_0x171a72(0x13b)],'created_at':_0x175f2c['attributes'][_0x171a72(0x19f)]},_0x23d12e),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a27_0x2a94fe(0x197);[a27_0x2a94fe(0x1a0)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x2a94fe(0x146)](_0x24c314){const _0x3e6b82=a27_0x2a94fe,{options:_0x458ec6,args:_0x14fa8c,tdx:_0x5c64f1}=_0x24c314,_0x4d6986=_0x14fa8c[0x0];if(!requireNameOrPath(_0x4d6986))return 0x1;const _0x213be0=_0x458ec6[_0x3e6b82(0xf4)];if(!_0x213be0)return console['error'](_0x3e6b82(0xa0)),console['error'](_0x3e6b82(0x141)),0x1;const _0x38373c=parseInt(_0x213be0,0xa);if(isNaN(_0x38373c)||_0x38373c<0x1)return console['error'](_0x3e6b82(0x16f)+_0x213be0),0x1;if(_0x458ec6[_0x3e6b82(0xe0)])console[_0x3e6b82(0x10b)](_0x3e6b82(0xce)+_0x4d6986+_0x3e6b82(0x170)+_0x38373c);const {journeyId:_0x217db7,parentSegmentId:_0x301e73}=await resolveJourneyIdFromInput(_0x4d6986,_0x458ec6,_0x5c64f1),_0x476917=await withSpinner(_0x3e6b82(0xc4),()=>_0x5c64f1[_0x3e6b82(0xd9)]['listVersions'](_0x217db7),{'verbose':_0x458ec6[_0x3e6b82(0xe0)]}),{versions:_0x26ce25,latestJourneyId:_0x4c18fc}=_0x476917[_0x3e6b82(0x14e)],_0x221855=_0x26ce25[_0x3e6b82(0x13c)](_0x29718e=>_0x29718e[_0x3e6b82(0x1ac)]===_0x38373c);if(!_0x221855){const _0x498502=_0x26ce25[_0x3e6b82(0x126)](_0x4ebc99=>'v'+_0x4ebc99[_0x3e6b82(0x1ac)])['join'](',\x20');return console[_0x3e6b82(0x10b)](_0x3e6b82(0x1ad)+_0x38373c+_0x3e6b82(0xf5)+_0x498502),0x1;}const _0x4a6583=await withSpinner(_0x3e6b82(0xe1)+_0x38373c+_0x3e6b82(0xd6),()=>_0x5c64f1[_0x3e6b82(0xd9)]['getJourney'](_0x221855[_0x3e6b82(0xa9)]),{'verbose':_0x458ec6[_0x3e6b82(0xe0)]}),_0x2fbda4=_0x4a6583['data'],_0x5ba866=getConsoleNextUrl(_0x458ec6['site'],'/app/ps/'+_0x301e73+_0x3e6b82(0x144)+_0x221855['journeyId']+_0x3e6b82(0xd1));return await handleSingleObjectOutput({'id':_0x2fbda4['id'],'name':_0x2fbda4[_0x3e6b82(0xb0)][_0x3e6b82(0x19a)],'version':_0x2fbda4['attributes']['versionNumber'],'description':_0x2fbda4[_0x3e6b82(0xb0)][_0x3e6b82(0x1a0)],'state':_0x2fbda4['attributes'][_0x3e6b82(0xe3)],'paused':_0x2fbda4[_0x3e6b82(0xb0)][_0x3e6b82(0x15b)],'reentry_mode':_0x2fbda4['attributes'][_0x3e6b82(0x10c)],'stages':_0x2fbda4[_0x3e6b82(0xb0)][_0x3e6b82(0x136)]?.['length']||0x0,..._0x2fbda4[_0x3e6b82(0xb0)]['goal']&&{'goal':_0x2fbda4[_0x3e6b82(0xb0)][_0x3e6b82(0x180)][_0x3e6b82(0x19a)]},'latest':_0x221855[_0x3e6b82(0xa9)]===_0x4c18fc,'created_at':_0x2fbda4[_0x3e6b82(0xb0)][_0x3e6b82(0x19f)],'updated_at':_0x2fbda4[_0x3e6b82(0xb0)][_0x3e6b82(0x11e)],'url':_0x5ba866},_0x458ec6),0x0;}}
|
|
1
|
+
const a27_0x41cf6b=a27_0x1264;(function(_0x488d3a,_0x1451ed){const _0x60428c=a27_0x1264,_0x1bb2c1=_0x488d3a();while(!![]){try{const _0xfc797e=-parseInt(_0x60428c(0x1f7))/0x1+parseInt(_0x60428c(0x209))/0x2*(parseInt(_0x60428c(0x202))/0x3)+parseInt(_0x60428c(0x1ac))/0x4+parseInt(_0x60428c(0x182))/0x5*(parseInt(_0x60428c(0x1e5))/0x6)+-parseInt(_0x60428c(0x228))/0x7+-parseInt(_0x60428c(0x1c3))/0x8+-parseInt(_0x60428c(0x1cb))/0x9*(parseInt(_0x60428c(0x1a9))/0xa);if(_0xfc797e===_0x1451ed)break;else _0x1bb2c1['push'](_0x1bb2c1['shift']());}catch(_0x53e8d4){_0x1bb2c1['push'](_0x1bb2c1['shift']());}}}(a27_0x5c92,0x720da));function a27_0x5c92(){const _0x1a36e0=['Usage:\x20journey\x20<subcommand>\x20<name-or-path>','segmentPushCommand','journey:activations','json','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','set','cyan','/j/da/je','targetDir','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','log','renderStats','then','540lmdamB','listJourneysWithFolders','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','2344804wyUPMH','isNew','getJourney','state','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Resume\x20a\x20paused\x20journey','folderPath','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','content','Fetching\x20parent\x20segment...','List\x20all\x20versions\x20of\x20a\x20journey','(root)','completeMilestoneRate','resume','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20\x20Statistics\x20not\x20available','conversion','yes','Resuming\x20journey...','Fetching\x20','Resolving\x20journey...','INVALID_ARGUMENT','(running)','3009032VdzWyQ','kind','\x20(rule\x20match)','.yml','goal','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','localeCompare','values','10773rOXcqq','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','entries','length','reentryMode','session','getActivation','Pattern:\x20','\x20version','parentName','data','cwd','activation_','segment','\x20not\x20found.\x20Available:\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','journeyBundleId','toLowerCase','stringify','Write\x20','✔\x20Context\x20set:\x20','repeat','file','\x20new\x20files','✔\x20All\x20files\x20are\x20up\x20to\x20date','486bRgEGz','folderId','push','journey:push','sort','journey:columns','database','parentSegment','\x20\x20Name:\x20','\x5c$&','utf-8','execute','Available\x20stages:\x20','Getting\x20journey\x20traffic\x20data...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','web','type','\x20\x20Target:\x20','263370GNzPEP','Input:\x20','rule','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','resourceName','\x0aChanges\x20to\x20\x27','journey:versions','options','Parent\x20segment:\x20','Creating\x20new\x20version...','relativePath','54hUsPrX','\x22\x20paused','resolveJourneyId','journey:traffic','Resolving\x20parent\x20segment...','\x22\x20resumed','jsonl','17716VEfRmy','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','listVersions','createdAt','helpText','activation','resolveSegment','Show\x20journey\x20statistics','\x20\x20Journey\x20ID:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','getLatestJourneyId','\x20=\x20','updatedAt','getColumnMapping','Error:\x20Parent\x20segment\x20context\x20required','setPhase','Show\x20journey\x20table\x20column\x20mapping','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','listJourneysFromParentSegment','\x20changed\x20files','\x20(draft)\x20—\x20\x22','Database:\x20','find','message','journeyName','errorCode','map','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','history','Error:\x20Journey\x20\x27','3530149aiYNsU','journey:pull','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','buildIdToEmailMap','(completed)','✔\x20Journey\x20\x22','paused','buildIdToNameMap','segments','hasPeriod','journey','Journey\x20name:\x20','No\x20journeys\x20found','\x20journey','Error:\x20','table','pause','\x20Opening\x20','\x20Created\x20v','journey:list','draft','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','dim','Cancelled','links','Fetching\x20journeys\x20and\x20folders...','attributes','columns','segmentName','\x20\x20Parent\x20segment:\x20','List\x20journeys\x20in\x20current\x20context','📁\x20','journey:resume','description','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','archived','tsv','audienceId','getParentFull','✔\x20Pulled\x20','format','exitOrJumpSize','get','resolveParentId','/e/','Table:\x20','hasChanges','getTrafficData','add','all','includeStats','stages','...','\x20journey\x20files\x20to\x20','✔\x20Found\x20','milestoneSize','Resolved\x20YAML\x20file:\x20','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Getting\x20journey\x20statistics...','Found\x20','test','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','size','yellow','connection','\x20->\x20','site','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','has','\x20details...',',\x20version:\x20','\x20activation','journey:version:view','base','user','Getting\x20column\x20mapping...','journeyId','\x0aError:','journeys','createVersion','journeyBundleName','nodes','/app/ps/','getStatistics','verbose','enteredSize','57405EHhbNK','journey:pause','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Options:','Target\x20file:\x20','filePath','filter','completionRate','join','\x20versions)','\x22\x20not\x20found','activationParams','includeHistory','Listing\x20journeys...','from','name','journeyStages','versionNumber','green','args','No\x20statistics\x20available\x20for\x20journey:\x20','replace','connector_config','Getting\x20journey\x20details...','error','red'];a27_0x5c92=function(){return _0x1a36e0;};return a27_0x5c92();}import a27_0x5b6061 from'chalk';import a27_0x135f2f from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x848c95){const _0x51f0eb=a27_0x1264;return!_0x848c95&&(console[_0x51f0eb(0x19a)](_0x51f0eb(0x184)),console[_0x51f0eb(0x19a)](_0x51f0eb(0x19c))),!!_0x848c95;}function withJsonFormat(_0x106592){const _0xe095be=a27_0x1264;if(!_0x106592[_0xe095be(0x250)]&&!_0x106592[_0xe095be(0x19f)]&&!_0x106592[_0xe095be(0x208)]&&!_0x106592[_0xe095be(0x24c)])return{..._0x106592,'format':_0xe095be(0x19f),'json':!![]};return _0x106592;}function formatJourneyState(_0x4d280f){const _0x20c9bd=a27_0x1264;switch(_0x4d280f){case'launched':return a27_0x5b6061[_0x20c9bd(0x194)](_0x20c9bd(0x1c2));case _0x20c9bd(0x23c):return a27_0x5b6061[_0x20c9bd(0x23e)]('(draft)');case'paused':return a27_0x5b6061[_0x20c9bd(0x267)]('(paused)');case'completed':return a27_0x5b6061['blue'](_0x20c9bd(0x22c));case _0x20c9bd(0x24b):return a27_0x5b6061[_0x20c9bd(0x23e)]('(archived)');default:return'('+_0x4d280f+')';}}function formatJourneyItem(_0x5dd2eb,_0x56a573='',_0xc0c6fa){const _0x485ab0=a27_0x1264,_0x5ebff9=formatJourneyState(_0x5dd2eb[_0x485ab0(0x1af)]),_0x1dabcb=_0xc0c6fa?hyperlink(_0x5dd2eb['journeyBundleName'],_0xc0c6fa):_0x5dd2eb[_0x485ab0(0x17c)];return _0x56a573+'🗺️\x20'+_0x1dabcb+'\x20'+_0x5ebff9;}function escapeRegex(_0x33b69f){const _0x3915a9=a27_0x1264;return _0x33b69f[_0x3915a9(0x197)](/[.*+?^${}()|[\]\\]/g,_0x3915a9(0x1ee));}function globToRegex(_0x12f93a){const _0x165667=_0x12f93a['split']('*')['map'](escapeRegex);return new RegExp(_0x165667['join']('.*'),'i');}function buildRuleToNameMapping(_0xdb0144){const _0x3664cd=a27_0x1264,_0x41971b=new Map();if(_0xdb0144['segments'])for(const [_0x199206,_0x279120]of Object[_0x3664cd(0x1cd)](_0xdb0144[_0x3664cd(0x230)])){if(_0x279120[_0x3664cd(0x1f9)]){const _0x4f5596=serializeRule(_0x279120[_0x3664cd(0x1f9)]),_0x57ec65=_0x41971b[_0x3664cd(0x252)](_0x4f5596);_0x57ec65?_0x57ec65[_0x3664cd(0x1e7)](_0x199206):_0x41971b['set'](_0x4f5596,[_0x199206]);}}return _0x41971b;}async function resolveJourneyIdFromInput(_0x55fcff,_0x1b1781,_0xbb8531){const _0x587f51=a27_0x1264,_0x3a5353=await resolveJourneyTarget(_0x55fcff,_0x1b1781[_0x587f51(0x1ec)],_0x1b1781[_0x587f51(0x180)]),_0x22b00d=_0x3a5353[_0x587f51(0x1ec)];if(!_0x22b00d)throw new SDKError(ErrorCode[_0x587f51(0x1c1)],_0x587f51(0x23d));const _0x70e81b=await withSpinner(_0x587f51(0x206),()=>_0xbb8531['segment'][_0x587f51(0x253)](_0x22b00d),{'verbose':_0x1b1781[_0x587f51(0x180)]}),_0x4f2c06=_0x70e81b[_0x587f51(0x1d5)],_0x5f0c1b=await withSpinner(_0x587f51(0x1c0),()=>_0xbb8531[_0x587f51(0x232)][_0x587f51(0x204)](_0x4f2c06,_0x3a5353[_0x587f51(0x222)]),{'verbose':_0x1b1781['verbose']});return{'journeyId':_0x5f0c1b[_0x587f51(0x1d5)],'journeyName':_0x3a5353[_0x587f51(0x222)],'parentSegmentId':_0x4f2c06};}async function resolveJourneyTarget(_0x316cdd,_0x1d6b84,_0x5b7126){const _0xf15455=a27_0x1264;if(isYamlFilePath(_0x316cdd))try{const _0x19f400=await resolveYamlFilePath(_0x316cdd);return _0x5b7126&&(console[_0xf15455(0x19a)](_0xf15455(0x260)+_0x316cdd),console[_0xf15455(0x19a)](_0xf15455(0x245)+_0x19f400[_0xf15455(0x1ec)]),console['error'](_0xf15455(0x1ed)+_0x19f400[_0xf15455(0x244)]),console[_0xf15455(0x19a)]('\x20\x20Folder\x20path:\x20'+(_0x19f400[_0xf15455(0x1b2)]||_0xf15455(0x1b7)))),{'journeyName':_0x19f400[_0xf15455(0x244)],'parentSegment':_0x19f400[_0xf15455(0x1ec)],'resolved':_0x19f400};}catch(_0x4e1884){throw new SDKError(ErrorCode[_0xf15455(0x1c1)],_0xf15455(0x213)+_0x4e1884[_0xf15455(0x221)]);}if(!_0x1d6b84)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x316cdd,'parentSegment':_0x1d6b84};}export class JourneyListCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x23b);['description']=a27_0x41cf6b(0x246);async[a27_0x41cf6b(0x1f0)](_0x9d66f2){const _0x3964a6=a27_0x41cf6b,{options:_0x54801f,args:_0x43fd99,tdx:_0x5c89fb}=_0x9d66f2,_0x65655e=_0x43fd99[0x0],_0x6eeddb=_0x54801f['parentSegment'];if(!_0x6eeddb)return console[_0x3964a6(0x19a)](_0x3964a6(0x218)),console['error'](_0x3964a6(0x1a0)),0x1;const _0x698411=await withSpinner(_0x3964a6(0x206),()=>_0x5c89fb[_0x3964a6(0x1d8)]['resolveParentId'](_0x6eeddb),{'verbose':_0x54801f[_0x3964a6(0x180)]}),_0x33e9c2=_0x698411[_0x3964a6(0x1d5)];_0x54801f['verbose']&&(console['error'](_0x3964a6(0x1ff)+_0x6eeddb+'\x20(ID:\x20'+_0x33e9c2+')'),_0x65655e&&console[_0x3964a6(0x19a)](_0x3964a6(0x1d2)+_0x65655e));const _0xec8686=await withSpinner(_0x3964a6(0x1b5),()=>_0x5c89fb[_0x3964a6(0x1d8)][_0x3964a6(0x24e)](_0x33e9c2),{'verbose':_0x54801f[_0x3964a6(0x180)]}),_0x2131c7=_0xec8686[_0x3964a6(0x1d5)],_0x71bd65=_0x2131c7['rootFolderId'],_0x2116b0=await withSpinner(_0x3964a6(0x18f),()=>_0x5c89fb['journey'][_0x3964a6(0x1aa)](_0x33e9c2,_0x71bd65),{'verbose':_0x54801f[_0x3964a6(0x180)]});let _0x23d066=_0x2116b0[_0x3964a6(0x1d5)][_0x3964a6(0x17a)];const _0x749f10=_0x2116b0[_0x3964a6(0x1d5)]['folders'],_0x38ecab=new Map();for(const _0x5a0a1d of _0x749f10){_0x38ecab[_0x3964a6(0x1a1)](_0x5a0a1d['id'],_0x5a0a1d[_0x3964a6(0x191)]);}if(_0x65655e){const _0x25ae59=globToRegex(_0x65655e);_0x23d066=_0x23d066['filter'](_0x1d74f6=>_0x25ae59[_0x3964a6(0x264)](_0x1d74f6[_0x3964a6(0x17c)]));}console[_0x3964a6(0x19a)](_0x3964a6(0x25e)+_0x23d066[_0x3964a6(0x1ce)]+_0x3964a6(0x235)+(_0x23d066[_0x3964a6(0x1ce)]!==0x1?'s':''));const _0x414bc1=_0x2a5d0f=>{const _0x56823d=_0x3964a6;return getConsoleNextUrl(_0x54801f[_0x56823d(0x16e)],_0x56823d(0x17e)+_0x33e9c2+_0x56823d(0x254)+_0x2a5d0f+'/j/da');};if(_0x54801f['format']===_0x3964a6(0x237))await handleSDKOutput(_0x23d066,_0x54801f);else{if(_0x54801f[_0x3964a6(0x250)]==='json'){const _0x19635f=_0x23d066[_0x3964a6(0x224)](_0x40b931=>({..._0x40b931,'url':_0x414bc1(_0x40b931['id'])}));await handleSDKOutput(_0x19635f,_0x54801f);}else{console[_0x3964a6(0x1a6)]('['+_0x6eeddb+']');const _0x29f681=new Map(),_0x4576b8=[];for(const _0x3bce12 of _0x23d066){if(!_0x3bce12[_0x3964a6(0x1e6)]||_0x3bce12['folderId']===_0x71bd65)_0x4576b8[_0x3964a6(0x1e7)](_0x3bce12);else{const _0xc5803b=_0x29f681[_0x3964a6(0x252)](_0x3bce12[_0x3964a6(0x1e6)])||[];_0xc5803b[_0x3964a6(0x1e7)](_0x3bce12),_0x29f681[_0x3964a6(0x1a1)](_0x3bce12[_0x3964a6(0x1e6)],_0xc5803b);}}const _0x163f90=(_0x5d4166,_0x29167f)=>_0x5d4166[_0x3964a6(0x17c)][_0x3964a6(0x1c9)](_0x29167f[_0x3964a6(0x17c)],undefined,{'sensitivity':_0x3964a6(0x175)});_0x4576b8['sort'](_0x163f90);for(const _0x2e7252 of _0x4576b8){console[_0x3964a6(0x1a6)](formatJourneyItem(_0x2e7252,'',_0x414bc1(_0x2e7252['id'])));}const _0x5db422=[..._0x29f681[_0x3964a6(0x1cd)]()]['sort']((_0x2a07fc,_0x1a47a9)=>{const _0x2c086a=_0x3964a6,_0x1c8712=_0x38ecab[_0x2c086a(0x252)](_0x2a07fc[0x0])||_0x2a07fc[0x0],_0xd28101=_0x38ecab['get'](_0x1a47a9[0x0])||_0x1a47a9[0x0];return _0x1c8712[_0x2c086a(0x1c9)](_0xd28101,undefined,{'sensitivity':_0x2c086a(0x175)});});for(const [_0x154cd1,_0x4ec1f6]of _0x5db422){const _0x5b0941=_0x38ecab[_0x3964a6(0x252)](_0x154cd1)||_0x154cd1;console[_0x3964a6(0x1a6)](_0x3964a6(0x247)+_0x5b0941),_0x4ec1f6[_0x3964a6(0x1e9)](_0x163f90);for(const _0x2a343d of _0x4ec1f6){console['log'](formatJourneyItem(_0x2a343d,'\x20\x20',_0x414bc1(_0x2a343d['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x41cf6b(0x191)]='journey:view';[a27_0x41cf6b(0x249)]='Show\x20journey\x20details';async['execute'](_0x450f70){const _0x2376d6=a27_0x41cf6b,{options:_0x598412,args:_0x4a78a0,tdx:_0x35868f}=_0x450f70,_0x509a74=_0x4a78a0[0x0];if(!_0x509a74)return console[_0x2376d6(0x19a)](_0x2376d6(0x184)),console[_0x2376d6(0x19a)](_0x2376d6(0x1ab)),console[_0x2376d6(0x19a)](_0x2376d6(0x185)),console[_0x2376d6(0x19a)](_0x2376d6(0x1b0)),0x1;_0x598412[_0x2376d6(0x180)]&&console['error'](_0x2376d6(0x1f8)+_0x509a74);const {journeyId:_0x25d816,parentSegmentId:_0x3df2d6}=await resolveJourneyIdFromInput(_0x509a74,_0x598412,_0x35868f);if(_0x598412[_0x2376d6(0x1f4)]){const _0x30aea1=getConsoleNextUrl(_0x598412[_0x2376d6(0x16e)],'/app/ps/'+_0x3df2d6+'/e/'+_0x25d816+'/j/da/je');return console[_0x2376d6(0x19a)](a27_0x5b6061['green']('✔')+_0x2376d6(0x239)+a27_0x5b6061['cyan'](_0x30aea1)),openBrowser(_0x30aea1),0x0;}const _0x222890=await withSpinner(_0x2376d6(0x199),()=>_0x35868f['journey'][_0x2376d6(0x1ae)](_0x25d816),{'verbose':_0x598412[_0x2376d6(0x180)]}),_0x62f5f3=_0x222890[_0x2376d6(0x1d5)],_0x331582=_0x598412[_0x2376d6(0x25a)];let _0x41ee46;if(_0x331582)try{const _0x173369=await withSpinner(_0x2376d6(0x262),()=>_0x35868f['journey']['getStatistics'](_0x25d816),{'verbose':_0x598412[_0x2376d6(0x180)]});_0x41ee46=_0x173369[_0x2376d6(0x1d5)];}catch{_0x598412[_0x2376d6(0x180)]&&console['error'](_0x2376d6(0x1bb));}const _0x4d9e91=getConsoleNextUrl(_0x598412['site'],_0x2376d6(0x17e)+_0x3df2d6+_0x2376d6(0x254)+_0x25d816+_0x2376d6(0x1a3)),_0x31786a={'id':_0x62f5f3['id'],'name':_0x62f5f3[_0x2376d6(0x242)][_0x2376d6(0x191)],'description':_0x62f5f3['attributes'][_0x2376d6(0x249)],'state':_0x62f5f3[_0x2376d6(0x242)][_0x2376d6(0x1af)],'paused':_0x62f5f3['attributes'][_0x2376d6(0x22e)],'reentry_mode':_0x62f5f3[_0x2376d6(0x242)][_0x2376d6(0x1cf)],'stages':_0x62f5f3[_0x2376d6(0x242)]['journeyStages']?.[_0x2376d6(0x1ce)]||0x0,..._0x62f5f3['attributes'][_0x2376d6(0x1c7)]&&{'goal':_0x62f5f3[_0x2376d6(0x242)]['goal']['name']},..._0x41ee46&&{'statistics':{'size':_0x41ee46[_0x2376d6(0x266)],'entered':_0x41ee46[_0x2376d6(0x181)],'goal_achieved':_0x41ee46['goalSize'],'completion_rate':_0x41ee46[_0x2376d6(0x189)],'exit_or_jump':_0x41ee46[_0x2376d6(0x251)],'exit_or_jump_rate':_0x41ee46['exitOrJumpRate'],'stages':_0x41ee46['stages']}},'url':_0x4d9e91};return await handleSingleObjectOutput(_0x31786a,_0x598412),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x41cf6b(0x191)]='journey:stats';[a27_0x41cf6b(0x249)]=a27_0x41cf6b(0x210);async[a27_0x41cf6b(0x1f0)](_0x235f77){const _0x73adb=a27_0x41cf6b,{options:_0x768f06,args:_0x27511f,tdx:_0x655341}=_0x235f77,_0x258417=_0x27511f[0x0];if(!requireNameOrPath(_0x258417))return 0x1;_0x768f06[_0x73adb(0x180)]&&console[_0x73adb(0x19a)]('Input:\x20'+_0x258417);const _0x103e0c=_0x768f06,_0x327fa3=_0x103e0c[_0x73adb(0x190)],_0x2bdd6f=_0x103e0c['to'],_0x1211bd=_0x103e0c[_0x73adb(0x18e)],_0x4664db=_0x103e0c['stage'];_0x1211bd&&!_0x327fa3&&!_0x2bdd6f&&console[_0x73adb(0x19a)](_0x73adb(0x1ba));const _0x45dac8=_0x1211bd?withJsonFormat(_0x768f06):_0x768f06,{journeyId:_0x55bdd1,journeyName:_0x351c05}=await resolveJourneyIdFromInput(_0x258417,_0x45dac8,_0x655341),_0xf890e5=_0x327fa3||_0x2bdd6f?{'from':_0x327fa3,'to':_0x2bdd6f}:undefined,_0x530961=await withSpinner(_0x73adb(0x262),()=>Promise[_0x73adb(0x259)]([_0x655341[_0x73adb(0x232)]['getJourney'](_0x55bdd1),_0x655341[_0x73adb(0x232)][_0x73adb(0x17f)](_0x55bdd1,_0xf890e5)]),{'verbose':_0x45dac8['verbose']}),[_0x40fa8c,_0x4f60ab]=_0x530961[_0x73adb(0x1d5)];if(!_0x4f60ab||_0x4f60ab[_0x73adb(0x178)]===null)return console['error'](_0x73adb(0x196)+_0x351c05),console[_0x73adb(0x19a)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x11fe5a=buildStageNameMap(_0x40fa8c),_0x283b5c=!!(_0xf890e5&&_0x4f60ab[_0x73adb(0x226)]?.[_0x73adb(0x1ce)]),_0x4642c7={'stageNameMap':_0x11fe5a,'hasPeriod':_0x283b5c,'includeHistory':!!_0x1211bd};if(_0x4664db&&_0x4f60ab[_0x73adb(0x25b)]){const _0x1b7897=_0x4f60ab[_0x73adb(0x25b)][_0x73adb(0x220)](_0x272f86=>{const _0x192a54=_0x73adb,_0x5e41cf=_0x11fe5a[_0x192a54(0x252)](_0x272f86['id'])??'';return _0x5e41cf['toLowerCase']()===_0x4664db[_0x192a54(0x1dd)]();});if(_0x1b7897)return await handleSingleObjectOutput(formatStageStats(_0x1b7897,_0x4642c7),_0x45dac8),0x0;const _0x1b6629=_0x4f60ab[_0x73adb(0x25b)][_0x73adb(0x224)](_0x5edcc8=>_0x11fe5a['get'](_0x5edcc8['id'])??_0x5edcc8['id']);return console[_0x73adb(0x19a)]('Error:\x20Stage\x20\x22'+_0x4664db+_0x73adb(0x18c)),console[_0x73adb(0x19a)](_0x73adb(0x1f1)+_0x1b6629['join'](',\x20')),0x1;}const _0x2b25c7=_0x4f60ab[_0x73adb(0x25b)]?.['map'](_0x14db4e=>formatStageStats(_0x14db4e,_0x4642c7)),_0x2ad004=assembleJourneyStats(_0x4f60ab,{'from':_0x327fa3,'to':_0x2bdd6f,'includeHistory':_0x1211bd});return await this[_0x73adb(0x1a7)](_0x2ad004,_0x2b25c7??[],_0x45dac8),0x0;}async[a27_0x41cf6b(0x1a7)](_0x10f920,_0xbbbde4,_0x5cb1bd){const _0x162746=a27_0x41cf6b,_0x59d4d1=_0x5cb1bd[_0x162746(0x250)]===_0x162746(0x19f)||_0x5cb1bd[_0x162746(0x250)]===_0x162746(0x208)||_0x5cb1bd[_0x162746(0x19f)]||_0x5cb1bd[_0x162746(0x208)];if(_0x59d4d1){_0x10f920[_0x162746(0x25b)]=_0xbbbde4,await handleSingleObjectOutput(_0x10f920,_0x5cb1bd);return;}await handleSingleObjectOutput(_0x10f920,_0x5cb1bd);for(const _0x2050c6 of _0xbbbde4){console['log'](''),console[_0x162746(0x1a6)](String(a27_0x5b6061['cyan']['bold']('['+_0x2050c6[_0x162746(0x191)]+']'))+a27_0x5b6061[_0x162746(0x23e)]('\x20'+_0x2050c6['id']));const {id:_0x29b61c,name:_0x2e74a8,..._0x4224c5}=_0x2050c6;await handleSingleObjectOutput(_0x4224c5,_0x5cb1bd);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x205);[a27_0x41cf6b(0x249)]=a27_0x41cf6b(0x212);async[a27_0x41cf6b(0x1f0)](_0x4e38f6){const _0x4e0658=a27_0x41cf6b,{options:_0x33f8f9,args:_0x40a061,tdx:_0x420e00}=_0x4e38f6,_0x175ed1=_0x40a061[0x0];if(!requireNameOrPath(_0x175ed1))return 0x1;_0x33f8f9['verbose']&&console[_0x4e0658(0x19a)](_0x4e0658(0x1f8)+_0x175ed1);const _0x5120d1=_0x33f8f9,_0x17bafe=_0x5120d1['type'],_0x54e831=_0x5120d1[_0x4e0658(0x190)],_0x430bb7=_0x5120d1['to'],_0x4651c7=_0x5120d1['limit'];if(_0x17bafe&&_0x17bafe!==_0x4e0658(0x1bc)&&_0x17bafe!==_0x4e0658(0x20e))return console[_0x4e0658(0x19a)]('Error:\x20Invalid\x20--type\x20\x22'+_0x17bafe+_0x4e0658(0x1b3)),0x1;const _0xc907d7=withJsonFormat(_0x33f8f9),{journeyId:_0x294c12,journeyName:_0x39adfb}=await resolveJourneyIdFromInput(_0x175ed1,_0xc907d7,_0x420e00),_0x2b047e={'type':_0x17bafe,'from':_0x54e831,'to':_0x430bb7,'limit':_0x4651c7},_0x4f48d8=await withSpinner(_0x4e0658(0x1f2),()=>_0x420e00['journey'][_0x4e0658(0x257)](_0x294c12,_0x2b047e),{'verbose':_0xc907d7[_0x4e0658(0x180)]}),_0x59b7ad=_0x4f48d8[_0x4e0658(0x1d5)],_0x432b45=_0x59b7ad[_0x4e0658(0x1bc)]&&(_0x59b7ad[_0x4e0658(0x1bc)][_0x4e0658(0x17d)][_0x4e0658(0x1ce)]>0x0||_0x59b7ad[_0x4e0658(0x1bc)][_0x4e0658(0x240)][_0x4e0658(0x1ce)]>0x0),_0x20ef8e=_0x59b7ad[_0x4e0658(0x20e)]&&_0x59b7ad[_0x4e0658(0x20e)][_0x4e0658(0x1ce)]>0x0;if(!_0x432b45&&!_0x20ef8e)return console[_0x4e0658(0x19a)](_0x4e0658(0x21b)+_0x39adfb),console['error'](_0x4e0658(0x24a)),_0x54e831&&_0x430bb7&&console[_0x4e0658(0x19a)]('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(_0x59b7ad,_0xc907d7),0x0;}}function formatStageStats(_0x2a4786,_0x4f6f1b){const _0x2b4299=a27_0x41cf6b,_0x2742c1=_0x4f6f1b[_0x2b4299(0x231)]&&_0x2a4786['history']?.[_0x2b4299(0x1ce)]?aggregateStageHistory(_0x2a4786[_0x2b4299(0x226)]):{'size':_0x2a4786['size'],'entered':_0x2a4786[_0x2b4299(0x181)],'milestone':_0x2a4786[_0x2b4299(0x25f)],'milestone_rate':_0x2a4786[_0x2b4299(0x1b8)],'exit_or_jump':_0x2a4786[_0x2b4299(0x251)],'exit_or_jump_rate':_0x2a4786['exitOrJumpRate']},_0x367ac8={'id':_0x2a4786['id'],'name':_0x4f6f1b['stageNameMap']['get'](_0x2a4786['id'])??_0x2a4786['id'],..._0x2742c1};return _0x4f6f1b[_0x2b4299(0x231)]&&_0x4f6f1b['includeHistory']&&_0x2a4786[_0x2b4299(0x226)]&&(_0x367ac8[_0x2b4299(0x226)]=_0x2a4786['history']),_0x367ac8;}export class JourneyPauseCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x183);[a27_0x41cf6b(0x249)]='Pause\x20a\x20running\x20journey';async[a27_0x41cf6b(0x1f0)](_0x5a0da6){const _0x105a9d=a27_0x41cf6b,{options:_0x51c853,args:_0x17896a,tdx:_0xe0eb2c}=_0x5a0da6,_0x151269=_0x17896a[0x0];if(!requireNameOrPath(_0x151269))return 0x1;_0x51c853['verbose']&&console[_0x105a9d(0x19a)](_0x105a9d(0x1f8)+_0x151269);const {journeyId:_0x2729a7,journeyName:_0x37f621}=await resolveJourneyIdFromInput(_0x151269,_0x51c853,_0xe0eb2c);if(!_0x51c853['yes']){const _0x4178e1=await confirm(_0x105a9d(0x225)+_0x37f621+'\x22?');if(!_0x4178e1)return console['error'](_0x105a9d(0x23f)),0x0;}const _0x6f5bac=await withSpinner('Pausing\x20journey...',()=>_0xe0eb2c['journey'][_0x105a9d(0x238)](_0x2729a7),{'verbose':_0x51c853['verbose']}),_0x53b40d=_0x6f5bac[_0x105a9d(0x1d5)];return console[_0x105a9d(0x19a)](_0x105a9d(0x22d)+_0x53b40d[_0x105a9d(0x242)][_0x105a9d(0x191)]+_0x105a9d(0x203)),0x0;}}function a27_0x1264(_0x54b6d7,_0x5816c6){_0x54b6d7=_0x54b6d7-0x16c;const _0x5c929b=a27_0x5c92();let _0x1264ce=_0x5c929b[_0x54b6d7];return _0x1264ce;}export class JourneyResumeCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x248);[a27_0x41cf6b(0x249)]=a27_0x41cf6b(0x1b1);async[a27_0x41cf6b(0x1f0)](_0xff5b11){const _0x34dda0=a27_0x41cf6b,{options:_0x1ef05c,args:_0xd22f6a,tdx:_0x355bd5}=_0xff5b11,_0x2b160b=_0xd22f6a[0x0];if(!requireNameOrPath(_0x2b160b))return 0x1;_0x1ef05c[_0x34dda0(0x180)]&&console[_0x34dda0(0x19a)](_0x34dda0(0x1f8)+_0x2b160b);const {journeyId:_0x2a4e41,journeyName:_0xf07824}=await resolveJourneyIdFromInput(_0x2b160b,_0x1ef05c,_0x355bd5);if(!_0x1ef05c['yes']){const _0x34fd86=await confirm(_0x34dda0(0x1cc)+_0xf07824+'\x22?');if(!_0x34fd86)return console[_0x34dda0(0x19a)](_0x34dda0(0x23f)),0x0;}const _0x181905=await withSpinner(_0x34dda0(0x1be),()=>_0x355bd5['journey'][_0x34dda0(0x1b9)](_0x2a4e41),{'verbose':_0x1ef05c['verbose']}),_0x3dd0ed=_0x181905['data'];return console['error'](_0x34dda0(0x22d)+_0x3dd0ed[_0x34dda0(0x242)][_0x34dda0(0x191)]+_0x34dda0(0x207)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x229);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x44d581){const _0x1e8783=a27_0x41cf6b,{options:_0x929113,args:_0x3f6dc8,tdx:_0xe074e1}=_0x44d581,_0x398805=_0x929113,_0x4fa29b=_0x3f6dc8[0x0],_0x3875c5=_0x4fa29b&&isYamlFilePath(_0x4fa29b),_0x2edbd9=await resolveTarget({'arg':_0x3875c5?_0x4fa29b:undefined,'contextParent':_0x929113['parentSegment'],'cwd':process[_0x1e8783(0x1d6)]()});if(!isSuccessfulResolution(_0x2edbd9))return _0x2edbd9[_0x1e8783(0x223)]==='no_parent'?(console[_0x1e8783(0x19a)](a27_0x5b6061['yellow'](_0x1e8783(0x1c8))),console[_0x1e8783(0x19a)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x1e8783(0x19a)](_0x1e8783(0x1db)),console['error'](_0x1e8783(0x1fa)),console[_0x1e8783(0x19a)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x1e8783(0x19a)](a27_0x5b6061[_0x1e8783(0x19b)](_0x1e8783(0x236)+_0x2edbd9[_0x1e8783(0x221)]+'\x0a')),_0x2edbd9[_0x1e8783(0x20d)]&&console['error'](a27_0x5b6061['cyan'](_0x2edbd9[_0x1e8783(0x20d)]))),0x1;let _0x440e7f=_0x3875c5?undefined:_0x4fa29b,_0x24d075,_0x65112b;_0x2edbd9['type']===_0x1e8783(0x1e2)&&(_0x440e7f=_0x2edbd9[_0x1e8783(0x1fb)],_0x24d075=_0x2edbd9[_0x1e8783(0x187)],_0x65112b=_0x2edbd9[_0x1e8783(0x1b2)]);const _0x2ecb00=_0x2edbd9[_0x1e8783(0x1d4)],_0x2c3f4b=_0x2edbd9[_0x1e8783(0x1a4)];_0x398805[_0x1e8783(0x180)]&&(console['error']('Parent\x20segment:\x20'+_0x2ecb00),console[_0x1e8783(0x19a)]('Target\x20directory:\x20'+_0x2c3f4b),_0x440e7f&&console[_0x1e8783(0x19a)](_0x1e8783(0x233)+_0x440e7f),_0x24d075&&console[_0x1e8783(0x19a)](_0x1e8783(0x186)+_0x24d075),_0x65112b&&console[_0x1e8783(0x19a)]('Folder\x20path:\x20'+_0x65112b));const _0x55bef4=await withSpinner(_0x1e8783(0x206),()=>_0xe074e1[_0x1e8783(0x1d8)][_0x1e8783(0x253)](_0x2ecb00),{'verbose':_0x929113[_0x1e8783(0x180)]}),_0x3e527b=_0x55bef4[_0x1e8783(0x1d5)],{journeys:_0x534d6e,folders:_0x128515}=await withSpinner(_0x1e8783(0x241),async()=>{const _0x412b25=_0x1e8783,[_0x22c2d8,_0x2d5822]=await Promise[_0x412b25(0x259)]([_0xe074e1['journey'][_0x412b25(0x21c)](_0x3e527b,undefined,{'includeAllVersions':!![]}),_0xe074e1[_0x412b25(0x1d8)]['listFolders'](_0x3e527b)]);return{'journeys':_0x22c2d8,'folders':_0x2d5822};},{'verbose':_0x929113[_0x1e8783(0x180)]})[_0x1e8783(0x1a8)](_0x5423d3=>_0x5423d3[_0x1e8783(0x1d5)]);let _0x3b70bb=_0x534d6e;const _0x794efb=buildFolderIdToPathMap(_0x128515);if(_0x440e7f){const _0x23faa8=_0x3b70bb[_0x1e8783(0x188)](_0x1e7e2c=>_0x1e7e2c[_0x1e8783(0x17c)]['toLowerCase']()===_0x440e7f[_0x1e8783(0x1dd)]());if(_0x23faa8[_0x1e8783(0x1ce)]===0x0)return console[_0x1e8783(0x19a)]('Error:\x20Journey\x20not\x20found:\x20'+_0x440e7f),console[_0x1e8783(0x19a)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x3b70bb=_0x23faa8;}if(_0x65112b!==undefined){const _0x1ead37=_0x3b70bb[_0x1e8783(0x188)](_0x153791=>{const _0x4e4c9d=_0x1e8783,_0x4d6151=_0x153791[_0x4e4c9d(0x1e6)]?_0x794efb[_0x4e4c9d(0x252)](_0x153791['folderId'])||'':'';return _0x4d6151===_0x65112b;});if(_0x1ead37[_0x1e8783(0x1ce)]===0x0&&_0x3b70bb[_0x1e8783(0x1ce)]>0x0){console[_0x1e8783(0x19a)](_0x1e8783(0x227)+_0x440e7f+'\x27\x20not\x20found\x20in\x20'+(_0x65112b||'root\x20folder')),console['error'](_0x1e8783(0x1a5));for(const _0x5690a9 of _0x3b70bb){const _0x25d36d=_0x5690a9['folderId']?_0x794efb['get'](_0x5690a9[_0x1e8783(0x1e6)])||'':'';console[_0x1e8783(0x19a)]('\x20\x20-\x20'+(_0x25d36d||_0x1e8783(0x1b7))+'/'+_0x5690a9[_0x1e8783(0x17c)]);}return 0x1;}_0x3b70bb=_0x1ead37;}if(_0x3b70bb[_0x1e8783(0x1ce)]===0x0)return console['error'](_0x1e8783(0x234)),0x0;const _0x3c3ab0=new Map();for(const _0xaea431 of _0x3b70bb){const _0x3f0194=_0xaea431[_0x1e8783(0x1dc)];!_0x3c3ab0[_0x1e8783(0x170)](_0x3f0194)&&_0x3c3ab0[_0x1e8783(0x1a1)](_0x3f0194,[]),_0x3c3ab0['get'](_0x3f0194)[_0x1e8783(0x1e7)](_0xaea431);}for(const _0xd83773 of _0x3c3ab0[_0x1e8783(0x1ca)]()){_0xd83773['sort']((_0x4e6530,_0x4b4bf2)=>(_0x4e6530[_0x1e8783(0x193)]||0x0)-(_0x4b4bf2[_0x1e8783(0x193)]||0x0));}const _0x32bcc4=[],{idToEmailMap:_0x477663,connectionIdToNameMap:_0x1b3bf6}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x5ad531=_0x1e8783,[_0x24d10e,_0x1e6cc1]=await Promise[_0x5ad531(0x259)]([_0xe074e1[_0x5ad531(0x176)][_0x5ad531(0x22b)](),_0xe074e1[_0x5ad531(0x16c)][_0x5ad531(0x22f)]()]);return{'idToEmailMap':_0x24d10e,'connectionIdToNameMap':_0x1e6cc1};},{'verbose':_0x929113['verbose']})[_0x1e8783(0x1a8)](_0x58e378=>_0x58e378[_0x1e8783(0x1d5)]);for(const _0x2b912d of _0x3c3ab0[_0x1e8783(0x1ca)]()){const _0x1b672b=_0x2b912d[0x0]['journeyBundleName'],_0x42ff57=_0x2b912d[0x0][_0x1e8783(0x1e6)],_0x5ac2e3=_0x42ff57?_0x794efb['get'](_0x42ff57)||'':'',_0x30dd2e=_0x5ac2e3?a27_0x135f2f[_0x1e8783(0x18a)](_0x2c3f4b,_0x5ac2e3):_0x2c3f4b,_0x2c9245=_0x24d075||a27_0x135f2f[_0x1e8783(0x18a)](_0x30dd2e,sanitizeFileName(_0x1b672b)+_0x1e8783(0x1c6));let _0xee2273,_0x1b4917;if(existsSync(_0x2c9245))try{const _0x428a51=readFileSync(_0x2c9245,'utf-8'),_0x10b2e6=parseYamlString(_0x428a51);_0x1b4917=_0x10b2e6,_0xee2273=buildRuleToNameMapping(_0x10b2e6),_0x398805[_0x1e8783(0x180)]&&_0xee2273['size']>0x0&&console['error'](_0x1e8783(0x263)+_0xee2273[_0x1e8783(0x266)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x1b672b);}catch(_0x5462ac){_0x398805[_0x1e8783(0x180)]&&console[_0x1e8783(0x19a)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x5462ac[_0x1e8783(0x221)]);}const _0x22a63a=[],_0x8e168e=new Set(),_0x2f2c96=new Map(),_0x5d8a4d=new Map(),_0x37243c=new Set(),_0xf896a6=new Map(),_0x1300b7=new Map(),_0xcceb6a=createJumpTargetCache();await withProgressSpinner(_0x1e8783(0x1bf)+_0x1b672b+_0x1e8783(0x25c),async _0x55a9e5=>{const _0x217545=_0x1e8783;for(const _0x344572 of _0x2b912d){const _0x32f15e=_0x2b912d['length']>0x1?_0x344572[_0x217545(0x17c)]+'\x20v'+(_0x344572['versionNumber']||0x1):_0x344572[_0x217545(0x17c)];_0x55a9e5[_0x217545(0x219)](_0x217545(0x1bf)+_0x32f15e);const _0x226a20=await _0xe074e1['journey'][_0x217545(0x1ae)](_0x344572['id']),_0x44d61d=_0x226a20[_0x217545(0x242)]?.[_0x217545(0x24d)],_0x27dc01={'resolveSegment':async _0x569c98=>{const _0x451f9f=_0x217545;if(!_0x44d61d)return{'name':_0x569c98,'isJourneyLocal':![]};const _0x123369=_0x2f2c96[_0x451f9f(0x252)](_0x569c98);if(_0x123369)return _0x123369;try{const _0x5ae2fb=await _0xe074e1[_0x451f9f(0x1d8)]['getSegment'](_0x44d61d,_0x569c98),_0x578131=_0x5ae2fb[_0x451f9f(0x1c4)]===SEGMENT_KIND_JOURNEY;let _0x5417dd,_0x247d59=_0x5ae2fb[_0x451f9f(0x191)];if(_0x578131&&_0x5ae2fb[_0x451f9f(0x1f9)]){const _0x2315f1=await segmentResponseToDef(_0x5ae2fb,{'resolveSegmentName':async _0x25f251=>{const _0x88f44=_0x451f9f,_0x823fae=_0x2f2c96[_0x88f44(0x252)](_0x25f251);if(_0x823fae)return _0x823fae[_0x88f44(0x191)];const _0x5e00a9=await _0x27dc01[_0x88f44(0x20f)](_0x25f251);return _0x5e00a9[_0x88f44(0x191)];}}),_0x4d6b97=_0x2315f1[_0x451f9f(0x1f9)];_0x5417dd={'description':_0x5ae2fb[_0x451f9f(0x249)],'rule':_0x4d6b97};const _0x4d62ca=serializeRule(_0x4d6b97),_0x5357c5=_0x5d8a4d[_0x451f9f(0x252)](_0x4d62ca);if(_0x5357c5)_0x247d59=_0x5357c5,_0x5417dd=undefined,_0x398805[_0x451f9f(0x180)]&&console[_0x451f9f(0x19a)](_0x451f9f(0x1da)+_0x5ae2fb[_0x451f9f(0x191)]+_0x451f9f(0x16d)+_0x5357c5);else{let _0x1758f6=![];if(_0xee2273){const _0x4cf339=_0xee2273[_0x451f9f(0x252)](_0x4d62ca);if(_0x4cf339){const _0x55f2a9=_0x4cf339['find'](_0x46d05b=>!_0x8e168e[_0x451f9f(0x170)](_0x46d05b));_0x55f2a9&&(_0x247d59=_0x55f2a9,_0x8e168e[_0x451f9f(0x258)](_0x55f2a9),_0x5d8a4d[_0x451f9f(0x1a1)](_0x4d62ca,_0x55f2a9),_0x1758f6=!![],_0x398805['verbose']&&console[_0x451f9f(0x19a)](_0x451f9f(0x261)+_0x55f2a9+_0x451f9f(0x1c5)));}}if(!_0x1758f6){const _0x407d72=generateJourneyLocalName(_0x5ae2fb['name']);_0x407d72&&(_0x247d59=_0x407d72);let _0x266cd8=_0x247d59,_0x3058dc=0x2;while(_0x8e168e[_0x451f9f(0x170)](_0x266cd8)){_0x266cd8=_0x247d59+'_'+_0x3058dc,_0x3058dc++;}_0x8e168e[_0x451f9f(0x258)](_0x266cd8),_0x5d8a4d[_0x451f9f(0x1a1)](_0x4d62ca,_0x266cd8),_0x247d59=_0x266cd8;}}}const _0x9b4b09={'name':_0x247d59,'isJourneyLocal':_0x578131,'definition':_0x5417dd};return _0x2f2c96[_0x451f9f(0x1a1)](_0x569c98,_0x9b4b09),_0x9b4b09;}catch(_0x1b9a35){return _0x929113[_0x451f9f(0x180)]&&console[_0x451f9f(0x19a)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x569c98+':\x20'+_0x1b9a35['message']),{'name':_0x569c98,'isJourneyLocal':![]};}},'resolveActivation':async _0x38bd6f=>{const _0x59ee30=_0x217545,_0x110424=_0xf896a6[_0x59ee30(0x252)](_0x38bd6f);if(_0x110424)return _0x110424;try{const _0x53ba46=await _0xe074e1['journey'][_0x59ee30(0x1d1)](_0x344572['id'],_0x38bd6f),_0x15852d=journeyActivationStepToYaml(_0x53ba46,_0x477663,_0x1b3bf6),_0x5c61a7=JSON[_0x59ee30(0x1de)]({'name':_0x15852d[_0x59ee30(0x191)],'connection':_0x15852d[_0x59ee30(0x16c)],'connector_config':_0x15852d[_0x59ee30(0x198)]}),_0x1203e8=_0x1300b7[_0x59ee30(0x252)](_0x5c61a7);if(_0x1203e8){const _0x3b9de3={'name':_0x1203e8,'isJourneyLocal':!![],'definition':_0x15852d};return _0xf896a6[_0x59ee30(0x1a1)](_0x38bd6f,_0x3b9de3),_0x3b9de3;}const _0x4b385d=_0x53ba46[_0x59ee30(0x242)][_0x59ee30(0x18d)][_0x59ee30(0x191)]||_0x38bd6f,_0x1a2311=sanitizeYamlKey(_0x4b385d)||_0x59ee30(0x1d7)+_0x38bd6f;let _0x2c1a57=_0x1a2311,_0x24f993=0x2;while(_0x37243c[_0x59ee30(0x170)](_0x2c1a57)){_0x2c1a57=_0x1a2311+'_'+_0x24f993,_0x24f993++;}_0x37243c[_0x59ee30(0x258)](_0x2c1a57),_0x1300b7[_0x59ee30(0x1a1)](_0x5c61a7,_0x2c1a57);const _0x50ff0e={'name':_0x2c1a57,'isJourneyLocal':!![],'definition':_0x15852d};return _0xf896a6[_0x59ee30(0x1a1)](_0x38bd6f,_0x50ff0e),_0x50ff0e;}catch(_0x22aa59){return _0x929113['verbose']&&console[_0x59ee30(0x19a)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x38bd6f+':\x20'+_0x22aa59[_0x59ee30(0x221)]),{'name':_0x38bd6f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x348f0a,_0x373d67)=>{const _0x39aa8c=_0x217545;return resolveJumpTarget(_0x348f0a,_0x373d67,_0xcceb6a,_0x22e985=>_0xe074e1[_0x39aa8c(0x232)]['getJourney'](_0x22e985));}},_0x36cab2=await journeyResponseToDef(_0x226a20,_0x27dc01);_0x22a63a[_0x217545(0x1e7)]({'item':_0x344572,'yaml':_0x36cab2});}},{'verbose':_0x929113[_0x1e8783(0x180)]});const _0x579f1b=await _0xe074e1[_0x1e8783(0x232)][_0x1e8783(0x214)](_0x2b912d[0x0][_0x1e8783(0x1dc)]),_0x1b0146=buildMergedJourneyDef(_0x22a63a,_0xee2273,_0x579f1b),_0x39dff6=normalizeJourneyDef(_0x1b0146,_0x1b4917),_0x18b7cd=toYamlString(_0x39dff6),_0x3e2dcc=_0x24d075||a27_0x135f2f[_0x1e8783(0x18a)](_0x30dd2e,sanitizeFileName(_0x1b672b)+_0x1e8783(0x1c6));!_0x24d075&&_0x5ac2e3&&!existsSync(_0x30dd2e)&&mkdirSync(_0x30dd2e,{'recursive':!![]});const _0x53155c=a27_0x135f2f['relative'](process[_0x1e8783(0x1d6)](),_0x3e2dcc);if(existsSync(_0x3e2dcc)){const _0x4a0c7d=readFileSync(_0x3e2dcc,_0x1e8783(0x1ef)),_0x349b47=generateDiff(_0x4a0c7d,_0x18b7cd),_0x5164b1=hasChanges(_0x349b47);_0x32bcc4['push']({'relativePath':_0x53155c,'absolutePath':_0x3e2dcc,'content':_0x18b7cd,'isNew':![],'hasChanges':_0x5164b1,'diff':_0x5164b1?formatDiffWithColors(_0x349b47):undefined});}else _0x32bcc4[_0x1e8783(0x1e7)]({'relativePath':_0x53155c,'absolutePath':_0x3e2dcc,'content':_0x18b7cd,'isNew':!![],'hasChanges':![]});}const _0x2a7de3=_0x32bcc4[_0x1e8783(0x188)](_0x1e7de2=>_0x1e7de2[_0x1e8783(0x1ad)]),_0x5e5bcc=_0x32bcc4[_0x1e8783(0x188)](_0xb24c1d=>!_0xb24c1d[_0x1e8783(0x1ad)]&&_0xb24c1d[_0x1e8783(0x256)]),_0x48f128=_0x32bcc4[_0x1e8783(0x188)](_0x1f9435=>!_0x1f9435[_0x1e8783(0x1ad)]&&!_0x1f9435[_0x1e8783(0x256)]),_0x392201=_0x3b70bb[_0x1e8783(0x1ce)],_0x2ffd55=_0x3c3ab0['size'],_0x10dd3e=_0x392201>_0x2ffd55?'\x20('+_0x392201+_0x1e8783(0x18b):'';console[_0x1e8783(0x19a)]('\x0aPull\x20summary:'),console[_0x1e8783(0x19a)]('\x20\x20'+a27_0x5b6061['cyan'](_0x2ffd55+'\x20journeys')+a27_0x5b6061[_0x1e8783(0x23e)](_0x10dd3e)),console['error']('\x20\x20'+a27_0x5b6061[_0x1e8783(0x194)]('+\x20'+_0x2a7de3[_0x1e8783(0x1ce)]+_0x1e8783(0x1e3))),console['error']('\x20\x20'+a27_0x5b6061[_0x1e8783(0x267)]('~\x20'+_0x5e5bcc[_0x1e8783(0x1ce)]+_0x1e8783(0x21d))),console[_0x1e8783(0x19a)]('\x20\x20'+a27_0x5b6061[_0x1e8783(0x23e)]('=\x20'+_0x48f128[_0x1e8783(0x1ce)]+'\x20unchanged\x20files')),console[_0x1e8783(0x19a)](_0x1e8783(0x1f6)+a27_0x5b6061[_0x1e8783(0x1a2)](_0x2c3f4b)+'\x0a');if(_0x5e5bcc[_0x1e8783(0x1ce)]>0x0)for(const _0x39438c of _0x5e5bcc){console['error'](_0x1e8783(0x1fc)+_0x39438c[_0x1e8783(0x201)]+'\x27:'),console[_0x1e8783(0x19a)]('─'[_0x1e8783(0x1e1)](0x3c)),console[_0x1e8783(0x19a)](_0x39438c['diff']),console[_0x1e8783(0x19a)]('─'['repeat'](0x3c));}if(_0x398805['dryRun'])return console[_0x1e8783(0x19a)](a27_0x5b6061[_0x1e8783(0x267)](_0x1e8783(0x22a))),0x0;if(_0x2a7de3[_0x1e8783(0x1ce)]===0x0&&_0x5e5bcc['length']===0x0)return console[_0x1e8783(0x19a)](a27_0x5b6061[_0x1e8783(0x194)](_0x1e8783(0x1e4))),saveSessionContext({'parent_segment':_0x2ecb00},_0x398805['session']),console[_0x1e8783(0x19a)](a27_0x5b6061['green'](_0x1e8783(0x1e0)+a27_0x5b6061['dim']('parent_segment')+_0x1e8783(0x215)+a27_0x5b6061['cyan'](_0x2ecb00))),0x0;if(!_0x398805[_0x1e8783(0x1bd)]&&(_0x2a7de3['length']>0x0||_0x5e5bcc[_0x1e8783(0x1ce)]>0x0)){if(!isInteractive())return console['error'](a27_0x5b6061['red'](_0x1e8783(0x179)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1e8783(0x19a)](a27_0x5b6061[_0x1e8783(0x23e)](_0x1e8783(0x20a))),0x1;const _0x49d410=await confirmKey(_0x1e8783(0x1df)+(_0x2a7de3[_0x1e8783(0x1ce)]+_0x5e5bcc[_0x1e8783(0x1ce)])+'\x20files?');if(!_0x49d410)return console[_0x1e8783(0x19a)](a27_0x5b6061[_0x1e8783(0x267)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x2c3f4b)&&mkdirSync(_0x2c3f4b,{'recursive':!![]});const _0x32d284=a27_0x135f2f[_0x1e8783(0x18a)](_0x2c3f4b,'tdx.json');writeFileSync(_0x32d284,createTdxConfigContent(_0x2ecb00),_0x1e8783(0x1ef));for(const _0x8b9fd1 of _0x32bcc4){(_0x8b9fd1['isNew']||_0x8b9fd1[_0x1e8783(0x256)])&&writeFileSync(_0x8b9fd1['absolutePath'],_0x8b9fd1[_0x1e8783(0x1b4)],_0x1e8783(0x1ef));}return console[_0x1e8783(0x19a)](a27_0x5b6061[_0x1e8783(0x194)](_0x1e8783(0x24f)+(_0x2a7de3[_0x1e8783(0x1ce)]+_0x5e5bcc[_0x1e8783(0x1ce)])+_0x1e8783(0x25d)+_0x2c3f4b)),saveSessionContext({'parent_segment':_0x2ecb00},_0x398805[_0x1e8783(0x1d0)]),console[_0x1e8783(0x19a)](a27_0x5b6061[_0x1e8783(0x194)](_0x1e8783(0x1e0)+a27_0x5b6061[_0x1e8783(0x23e)]('parent_segment')+_0x1e8783(0x215)+a27_0x5b6061[_0x1e8783(0x1a2)](_0x2ecb00))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x1ea);[a27_0x41cf6b(0x249)]=a27_0x41cf6b(0x21a);async[a27_0x41cf6b(0x1f0)](_0x16e4b8){const _0x1b43c4=a27_0x41cf6b,{options:_0xa4842c,args:_0x20e03e,tdx:_0x4de10a}=_0x16e4b8,_0x1201b9=_0x20e03e[0x0];if(!requireNameOrPath(_0x1201b9))return 0x1;_0xa4842c[_0x1b43c4(0x180)]&&console[_0x1b43c4(0x19a)](_0x1b43c4(0x1f8)+_0x1201b9);const {journeyId:_0x4b9444}=await resolveJourneyIdFromInput(_0x1201b9,_0xa4842c,_0x4de10a),_0x2718f3=await withSpinner(_0x1b43c4(0x177),()=>_0x4de10a[_0x1b43c4(0x232)][_0x1b43c4(0x217)](_0x4b9444),{'verbose':_0xa4842c[_0x1b43c4(0x180)]}),_0x1b5e7d=_0x2718f3[_0x1b43c4(0x1d5)];return console[_0x1b43c4(0x1a6)](_0x1b43c4(0x21f)+_0x1b5e7d[_0x1b43c4(0x1eb)]),console['log'](_0x1b43c4(0x255)+_0x1b5e7d[_0x1b43c4(0x237)]),await handleSDKOutput(_0x1b5e7d[_0x1b43c4(0x243)],_0xa4842c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x41cf6b(0x19e);[a27_0x41cf6b(0x249)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x41cf6b(0x1f0)](_0x59bf34){const _0x3438a1=a27_0x41cf6b,{options:_0x5d098f,args:_0x4ab56e,tdx:_0x1c9a42}=_0x59bf34,_0x436045=_0x4ab56e[0x0];if(!requireNameOrPath(_0x436045))return 0x1;_0x5d098f[_0x3438a1(0x180)]&&console[_0x3438a1(0x19a)](_0x3438a1(0x1f8)+_0x436045);const {journeyId:_0x29fbeb}=await resolveJourneyIdFromInput(_0x436045,_0x5d098f,_0x1c9a42),_0x363095=await withSpinner('Listing\x20journey\x20activations...',()=>_0x1c9a42[_0x3438a1(0x232)]['listActivationsFlat'](_0x29fbeb),{'verbose':_0x5d098f['verbose']}),_0x4238a9=_0x363095['data'];return console['error']('Found\x20'+_0x4238a9['length']+_0x3438a1(0x173)+(_0x4238a9[_0x3438a1(0x1ce)]!==0x1?'s':'')),await handleSDKOutput(_0x4238a9,_0x5d098f),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x1e8);[a27_0x41cf6b(0x249)]=a27_0x41cf6b(0x265);[a27_0x41cf6b(0x19d)]=new SegmentPushCommand();async[a27_0x41cf6b(0x1f0)](_0x4e427b){const _0xe9500e=a27_0x41cf6b,_0x5d061d=_0x4e427b[_0xe9500e(0x195)][0x0];let _0x2788b4;if(_0x5d061d){const _0x331ce7=await resolveTarget({'arg':_0x5d061d,'contextParent':_0x4e427b[_0xe9500e(0x1fe)][_0xe9500e(0x1ec)],'cwd':process[_0xe9500e(0x1d6)]()});isSuccessfulResolution(_0x331ce7)&&_0x331ce7[_0xe9500e(0x1f5)]===_0xe9500e(0x1e2)&&(_0x2788b4=_0x331ce7['filePath']);}const _0x5be8b4={..._0x4e427b,'options':{..._0x4e427b['options'],'journeysOnly':!![],..._0x2788b4&&{'singleFilePath':_0x2788b4}}};return this['segmentPushCommand'][_0xe9500e(0x1f0)](_0x5be8b4);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x1fd);[a27_0x41cf6b(0x249)]=a27_0x41cf6b(0x1b6);async['execute'](_0x1d3a9e){const _0x1c19a3=a27_0x41cf6b,{options:_0x142e65,args:_0x21e764,tdx:_0x30fc8c}=_0x1d3a9e,_0x243743=_0x21e764[0x0];if(!requireNameOrPath(_0x243743))return 0x1;if(_0x142e65[_0x1c19a3(0x180)])console[_0x1c19a3(0x19a)](_0x1c19a3(0x1f8)+_0x243743);const {journeyId:_0x464e46}=await resolveJourneyIdFromInput(_0x243743,_0x142e65,_0x30fc8c),_0x3c4900=await withSpinner('Listing\x20journey\x20versions...',()=>_0x30fc8c[_0x1c19a3(0x232)]['listVersions'](_0x464e46),{'verbose':_0x142e65[_0x1c19a3(0x180)]}),{bundleName:_0x5e23f2,versions:_0x5196e5,latestJourneyId:_0x192d59}=_0x3c4900[_0x1c19a3(0x1d5)];console[_0x1c19a3(0x19a)](_0x5e23f2+':\x20'+_0x5196e5[_0x1c19a3(0x1ce)]+_0x1c19a3(0x1d3)+(_0x5196e5[_0x1c19a3(0x1ce)]!==0x1?'s':''));const _0x4e4a80=_0x5196e5[_0x1c19a3(0x224)](_0x28f8f7=>({'version':_0x28f8f7[_0x1c19a3(0x193)],'journey_id':_0x28f8f7[_0x1c19a3(0x178)],'name':_0x28f8f7[_0x1c19a3(0x191)],'state':_0x28f8f7[_0x1c19a3(0x1af)],'paused':_0x28f8f7[_0x1c19a3(0x22e)],'latest':_0x28f8f7[_0x1c19a3(0x178)]===_0x192d59,'created_at':_0x28f8f7['createdAt']}));return await handleSDKOutput(_0x4e4a80,_0x142e65),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x41cf6b(0x191)]='journey:version:create';['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x41cf6b(0x1f0)](_0x191646){const _0x1f335a=a27_0x41cf6b,{options:_0x5a7df8,args:_0x3ee3ef,tdx:_0x35381f}=_0x191646,_0x4103ee=_0x3ee3ef[0x0];if(!requireNameOrPath(_0x4103ee))return 0x1;if(_0x5a7df8[_0x1f335a(0x180)])console[_0x1f335a(0x19a)](_0x1f335a(0x1f8)+_0x4103ee);const {journeyId:_0x180693,journeyName:_0x429e4f}=await resolveJourneyIdFromInput(_0x4103ee,_0x5a7df8,_0x35381f);if(!_0x5a7df8[_0x1f335a(0x1bd)]){const _0x4e764f=await confirm(_0x1f335a(0x16f)+_0x429e4f+'\x22?');if(!_0x4e764f)return console[_0x1f335a(0x19a)]('Cancelled'),0x0;}const _0x27f3a5=await withSpinner(_0x1f335a(0x200),()=>_0x35381f[_0x1f335a(0x232)][_0x1f335a(0x17b)](_0x180693),{'verbose':_0x5a7df8[_0x1f335a(0x180)]}),_0x4348a5=_0x27f3a5[_0x1f335a(0x1d5)];return console[_0x1f335a(0x19a)](a27_0x5b6061[_0x1f335a(0x194)]('✔')+_0x1f335a(0x23a)+_0x4348a5[_0x1f335a(0x242)][_0x1f335a(0x193)]+_0x1f335a(0x21e)+_0x4348a5[_0x1f335a(0x242)][_0x1f335a(0x191)]+'\x22'),console[_0x1f335a(0x19a)](_0x1f335a(0x211)+_0x4348a5['id']),await handleSingleObjectOutput({'id':_0x4348a5['id'],'name':_0x4348a5[_0x1f335a(0x242)][_0x1f335a(0x191)],'version':_0x4348a5['attributes'][_0x1f335a(0x193)],'state':_0x4348a5[_0x1f335a(0x242)][_0x1f335a(0x1af)],'bundle_id':_0x4348a5[_0x1f335a(0x242)]['journeyBundleId'],'created_at':_0x4348a5[_0x1f335a(0x242)][_0x1f335a(0x20c)]},_0x5a7df8),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x41cf6b(0x191)]=a27_0x41cf6b(0x174);['description']=a27_0x41cf6b(0x1f3);async[a27_0x41cf6b(0x1f0)](_0x102c14){const _0x29d43e=a27_0x41cf6b,{options:_0x19c567,args:_0x24046f,tdx:_0x4a10b6}=_0x102c14,_0x37d148=_0x24046f[0x0];if(!requireNameOrPath(_0x37d148))return 0x1;const _0x46df1d=_0x19c567['version'];if(!_0x46df1d)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x29d43e(0x19a)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x5d9753=parseInt(_0x46df1d,0xa);if(isNaN(_0x5d9753)||_0x5d9753<0x1)return console[_0x29d43e(0x19a)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x46df1d),0x1;if(_0x19c567[_0x29d43e(0x180)])console['error']('Input:\x20'+_0x37d148+_0x29d43e(0x172)+_0x5d9753);const {journeyId:_0x14945b,parentSegmentId:_0x4dbfb8}=await resolveJourneyIdFromInput(_0x37d148,_0x19c567,_0x4a10b6),_0x808681=await withSpinner('Resolving\x20version...',()=>_0x4a10b6[_0x29d43e(0x232)][_0x29d43e(0x20b)](_0x14945b),{'verbose':_0x19c567[_0x29d43e(0x180)]}),{versions:_0x208d17,latestJourneyId:_0x3c1163}=_0x808681['data'],_0x57ee4d=_0x208d17[_0x29d43e(0x220)](_0x3e78e3=>_0x3e78e3[_0x29d43e(0x193)]===_0x5d9753);if(!_0x57ee4d){const _0x1e574d=_0x208d17[_0x29d43e(0x224)](_0x3003bf=>'v'+_0x3003bf['versionNumber'])[_0x29d43e(0x18a)](',\x20');return console[_0x29d43e(0x19a)]('Error:\x20Version\x20'+_0x5d9753+_0x29d43e(0x1d9)+_0x1e574d),0x1;}const _0x423ed0=await withSpinner('Getting\x20version\x20'+_0x5d9753+_0x29d43e(0x171),()=>_0x4a10b6[_0x29d43e(0x232)]['getJourney'](_0x57ee4d[_0x29d43e(0x178)]),{'verbose':_0x19c567['verbose']}),_0x226808=_0x423ed0['data'],_0x511594=getConsoleNextUrl(_0x19c567[_0x29d43e(0x16e)],'/app/ps/'+_0x4dbfb8+'/e/'+_0x57ee4d[_0x29d43e(0x178)]+_0x29d43e(0x1a3));return await handleSingleObjectOutput({'id':_0x226808['id'],'name':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x191)],'version':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x193)],'description':_0x226808[_0x29d43e(0x242)]['description'],'state':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x1af)],'paused':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x22e)],'reentry_mode':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x1cf)],'stages':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x192)]?.['length']||0x0,..._0x226808[_0x29d43e(0x242)][_0x29d43e(0x1c7)]&&{'goal':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x1c7)][_0x29d43e(0x191)]},'latest':_0x57ee4d[_0x29d43e(0x178)]===_0x3c1163,'created_at':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x20c)],'updated_at':_0x226808[_0x29d43e(0x242)][_0x29d43e(0x216)],'url':_0x511594},_0x19c567),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x1192c6=a28_0x3897;(function(_0x3295f9,_0x358720){const _0x2056bb=a28_0x3897,_0x4694d1=_0x3295f9();while(!![]){try{const _0xa88a40=parseInt(_0x2056bb(0xd1))/0x1*(parseInt(_0x2056bb(0xa2))/0x2)+parseInt(_0x2056bb(0xd3))/0x3+parseInt(_0x2056bb(0xbc))/0x4*(parseInt(_0x2056bb(0xa7))/0x5)+parseInt(_0x2056bb(0xb2))/0x6+-parseInt(_0x2056bb(0x9c))/0x7*(parseInt(_0x2056bb(0xa6))/0x8)+parseInt(_0x2056bb(0xc6))/0x9+-parseInt(_0x2056bb(0xba))/0xa;if(_0xa88a40===_0x358720)break;else _0x4694d1['push'](_0x4694d1['shift']());}catch(_0x1592ef){_0x4694d1['push'](_0x4694d1['shift']());}}}(a28_0x32d5,0xd2af9));import{BaseCommand}from'./command.js';function a28_0x3897(_0x11fddd,_0x2693a7){_0x11fddd=_0x11fddd-0x9a;const _0x32d539=a28_0x32d5();let _0x38974d=_0x32d539[_0x11fddd];return _0x38974d;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0xb0f6cc from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0x32d5(){const _0x30f225=['file','error','\x20warning(s)\x20found','log','8067726OksGKa','\x20journey(s)\x20valid','yellow','Validate\x20journey\x20YAML\x20files','\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','Validation\x20failed:\x20','skippedCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','verbose','dim','1046HPdbSy','\x20valid','1648518aQxGBu','validCount','type','Error:\x20','1461551pRuRaZ','\x20warning(s)','journey:validate','hasErrors','errors','invalidCount','926DNFdJo','warnings','valid','reason','56yjWApP','48885NgTjua','✔\x20All\x20','description','message','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filePath','No\x20journey\x20YAML\x20files\x20found\x20in\x20','relativePath','\x20(skipped:\x20','targetDir','green','8418570QzqMfG','\x20segment\x20file(s)\x20skipped)','helpText','no_parent','warningCount','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','.yaml','parentSegment','23482420aVudVE','Error:\x20Directory\x20not\x20found:\x20','548ursGDg','endsWith','\x20segment\x20file(s)\x20skipped','red','length','execute'];a28_0x32d5=function(){return _0x30f225;};return a28_0x32d5();}export class JourneyValidateCommand extends BaseCommand{[a28_0x1192c6(0xce)]=a28_0x1192c6(0x9e);[a28_0x1192c6(0xa9)]=a28_0x1192c6(0xc9);async[a28_0x1192c6(0xc1)](_0x113e43){const _0x76fc3b=a28_0x1192c6,{options:_0x3af81d,args:_0x4a3920}=_0x113e43,_0x975a8=_0x3af81d,_0x25c99c=await resolveTarget({'arg':_0x4a3920[0x0],'contextParent':_0x3af81d[_0x76fc3b(0xb9)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x25c99c))return _0x25c99c['errorCode']===_0x76fc3b(0xb5)?(console[_0x76fc3b(0xc3)](a28_0xb0f6cc['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x76fc3b(0xc3)](_0x76fc3b(0xb7)),console[_0x76fc3b(0xc3)](_0x76fc3b(0xca)),console[_0x76fc3b(0xc3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a28_0xb0f6cc[_0x76fc3b(0xbf)](_0x76fc3b(0x9b)+_0x25c99c[_0x76fc3b(0xaa)]+'\x0a')),_0x25c99c['helpText']&&console['error'](a28_0xb0f6cc['cyan'](_0x25c99c[_0x76fc3b(0xb4)]))),0x1;const _0x5a833c=_0x25c99c[_0x76fc3b(0xb0)],_0x2c4f65=_0x25c99c[_0x76fc3b(0x9a)]===_0x76fc3b(0xc2)?_0x25c99c[_0x76fc3b(0xac)]:undefined;if(!_0x2c4f65&&!existsSync(_0x5a833c))return console[_0x76fc3b(0xc3)](a28_0xb0f6cc[_0x76fc3b(0xbf)](_0x76fc3b(0xbb)+_0x5a833c+'\x0a')),0x1;let _0x49b0d6;if(_0x2c4f65){if(!_0x2c4f65[_0x76fc3b(0xbd)]('.yml')&&!_0x2c4f65['endsWith'](_0x76fc3b(0xb8)))return console[_0x76fc3b(0xc3)](a28_0xb0f6cc[_0x76fc3b(0xbf)](_0x76fc3b(0xcd)+_0x2c4f65+'\x0a')),0x1;_0x49b0d6=[_0x2c4f65];}else _0x49b0d6=findYamlFiles(_0x5a833c);if(_0x49b0d6[_0x76fc3b(0xc0)]===0x0)return console['error'](a28_0xb0f6cc[_0x76fc3b(0xbf)](_0x76fc3b(0xab)+_0x5a833c+'\x0a')),0x1;const _0xfcd060=validateYamlFiles(_0x49b0d6,_0x5a833c,{'filterType':'journey'}),_0x1718bf=calculateSummary(_0xfcd060),_0x4888d4=_0xfcd060['filter'](isValidationResult);if(_0x4888d4[_0x76fc3b(0xc0)]===0x0)return console['error'](a28_0xb0f6cc[_0x76fc3b(0xc8)](_0x76fc3b(0xad)+_0x5a833c+'\x0a')),_0x1718bf[_0x76fc3b(0xcc)]>0x0&&console['error'](a28_0xb0f6cc[_0x76fc3b(0xd0)]('('+_0x1718bf[_0x76fc3b(0xcc)]+_0x76fc3b(0xb3))),0x0;for(const _0x3d4417 of _0xfcd060){if(!isValidationResult(_0x3d4417)){_0x975a8['verbose']&&console['log'](a28_0xb0f6cc[_0x76fc3b(0xd0)]('-\x20'+_0x3d4417[_0x76fc3b(0xae)]+_0x76fc3b(0xaf)+_0x3d4417[_0x76fc3b(0xa5)]+')'));continue;}const {relativePath:_0x1d7bf3,source:_0xb72d63,result:_0x38d168}=_0x3d4417;if(_0x38d168['valid']&&_0x38d168['warnings'][_0x76fc3b(0xc0)]===0x0)_0x975a8[_0x76fc3b(0xcf)]&&console['log'](a28_0xb0f6cc[_0x76fc3b(0xb1)]('✔\x20'+_0x1d7bf3));else _0x38d168[_0x76fc3b(0xa4)]?(console[_0x76fc3b(0xc5)](a28_0xb0f6cc[_0x76fc3b(0xc8)]('⚠\x20'+_0x1d7bf3+':\x20'+_0x38d168[_0x76fc3b(0xa3)]['length']+_0x76fc3b(0x9d))),console[_0x76fc3b(0xc5)](formatValidationResult(_0x38d168,_0xb72d63,_0x1d7bf3))):(console[_0x76fc3b(0xc5)](a28_0xb0f6cc[_0x76fc3b(0xbf)]('✖\x20'+_0x1d7bf3+':\x20'+_0x38d168[_0x76fc3b(0xa0)][_0x76fc3b(0xc0)]+'\x20error(s)')),console[_0x76fc3b(0xc5)](formatValidationResult(_0x38d168,_0xb72d63,_0x1d7bf3)));}return console[_0x76fc3b(0xc5)](''),_0x1718bf[_0x76fc3b(0x9f)]?(console[_0x76fc3b(0xc5)](a28_0xb0f6cc[_0x76fc3b(0xbf)](_0x76fc3b(0xcb)+_0x1718bf[_0x76fc3b(0xa1)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x1718bf[_0x76fc3b(0xd4)]+_0x76fc3b(0xd2))),_0x1718bf[_0x76fc3b(0xb6)]>0x0&&console[_0x76fc3b(0xc5)](a28_0xb0f6cc[_0x76fc3b(0xc8)](_0x1718bf[_0x76fc3b(0xb6)]+_0x76fc3b(0xc4))),_0x1718bf['skippedCount']>0x0&&console[_0x76fc3b(0xc5)](a28_0xb0f6cc['dim'](_0x1718bf['skippedCount']+_0x76fc3b(0xbe))),0x1):(console['log'](a28_0xb0f6cc[_0x76fc3b(0xb1)](_0x76fc3b(0xa8)+_0x1718bf[_0x76fc3b(0xd4)]+_0x76fc3b(0xc7))),_0x1718bf[_0x76fc3b(0xb6)]>0x0&&console[_0x76fc3b(0xc5)](a28_0xb0f6cc[_0x76fc3b(0xc8)](_0x1718bf['warningCount']+_0x76fc3b(0xc4))),_0x1718bf[_0x76fc3b(0xcc)]>0x0&&console[_0x76fc3b(0xc5)](a28_0xb0f6cc['dim'](_0x1718bf[_0x76fc3b(0xcc)]+_0x76fc3b(0xbe))),0x0);}}
|