@treasuredata/tdx 2026.4.8 → 2026.4.9
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/access-tracker.d.ts +2 -0
- package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/access-tracker.js.map +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +2 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts +3 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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.d.ts +10 -2
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0xf34920=a25_0x149e;(function(_0xebdd28,_0x375e07){const _0x4ee1ca=a25_0x149e,_0x3e480f=_0xebdd28();while(!![]){try{const _0x10b2c6=-parseInt(_0x4ee1ca(0x11a))/0x1*(parseInt(_0x4ee1ca(0xec))/0x2)+parseInt(_0x4ee1ca(0x11b))/0x3+-parseInt(_0x4ee1ca(0x100))/0x4+parseInt(_0x4ee1ca(0x10a))/0x5*(-parseInt(_0x4ee1ca(0x101))/0x6)+parseInt(_0x4ee1ca(0x102))/0x7*(parseInt(_0x4ee1ca(0xf6))/0x8)+-parseInt(_0x4ee1ca(0x105))/0x9*(-parseInt(_0x4ee1ca(0x11d))/0xa)+parseInt(_0x4ee1ca(0xfa))/0xb;if(_0x10b2c6===_0x375e07)break;else _0x3e480f['push'](_0x3e480f['shift']());}catch(_0x5d14a1){_0x3e480f['push'](_0x3e480f['shift']());}}}(a25_0x5c6b,0x5bac6));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a25_0x149e(_0x39f731,_0x4454d7){_0x39f731=_0x39f731-0xec;const _0x5c6bdc=a25_0x5c6b();let _0x149ec5=_0x5c6bdc[_0x39f731];return _0x149ec5;}import a25_0x5421ca from'chalk';import a25_0xb5ee2c 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_0xf34920(0x103)]=a25_0xf34920(0xf8);[a25_0xf34920(0xed)]=a25_0xf34920(0xf4);async[a25_0xf34920(0x106)](_0x1ac0e3){const _0x4606f2=a25_0xf34920,{options:_0x4bfe23,args:_0x3276e5}=_0x1ac0e3,_0x30b552=_0x4bfe23,_0x2d8e69=_0x3276e5[0x0],_0x2cb6fd=_0x2d8e69?a25_0xb5ee2c[_0x4606f2(0xf1)](_0x2d8e69):undefined,_0x546730=_0x2cb6fd?isYamlFile(_0x2cb6fd):![];let _0x43879d,_0x19e17a;if(_0x546730&&_0x2cb6fd)_0x43879d=a25_0xb5ee2c[_0x4606f2(0x10f)](_0x2cb6fd),_0x19e17a=_0x2cb6fd;else _0x2cb6fd?_0x43879d=_0x2cb6fd:_0x43879d=process[_0x4606f2(0x111)]();if(!_0x19e17a&&!existsSync(_0x43879d))return console['error'](a25_0x5421ca[_0x4606f2(0xfb)](_0x4606f2(0x112)+_0x43879d+'\x0a')),0x1;let _0x2e2a40;if(_0x19e17a){if(!_0x19e17a[_0x4606f2(0xfc)](_0x4606f2(0x10c))&&!_0x19e17a[_0x4606f2(0xfc)](_0x4606f2(0xfd)))return console[_0x4606f2(0x107)](a25_0x5421ca[_0x4606f2(0xfb)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x19e17a+'\x0a')),0x1;_0x2e2a40=[_0x19e17a];}else _0x2e2a40=findYamlFiles(_0x43879d);if(_0x2e2a40[_0x4606f2(0x115)]===0x0)return console['error'](a25_0x5421ca[_0x4606f2(0xfb)](_0x4606f2(0x109)+_0x43879d+'\x0a')),0x1;const _0x344445=validateYamlFiles(_0x2e2a40,_0x43879d,{'filterType':_0x4606f2(0xfe)}),_0x4645bf=calculateSummary(_0x344445),_0x428989=_0x344445['filter'](isValidationResult);if(_0x428989['length']===0x0)return console[_0x4606f2(0x107)](a25_0x5421ca[_0x4606f2(0x11e)](_0x4606f2(0x113)+_0x43879d+'\x0a')),_0x4645bf[_0x4606f2(0x104)]>0x0&&console['error'](a25_0x5421ca['dim']('('+_0x4645bf[_0x4606f2(0x104)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x3054a8 of _0x344445){if(!isValidationResult(_0x3054a8)){_0x30b552[_0x4606f2(0x119)]&&console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0xf3)]('-\x20'+_0x3054a8[_0x4606f2(0xf5)]+_0x4606f2(0x118)+_0x3054a8[_0x4606f2(0xf0)]+')'));continue;}const {relativePath:_0x8209c0,source:_0x1fad0f,result:_0x56621b}=_0x3054a8;if(_0x56621b[_0x4606f2(0x10b)]&&_0x56621b['warnings']['length']===0x0)_0x30b552['verbose']&&console[_0x4606f2(0x117)](a25_0x5421ca['green']('✔\x20'+_0x8209c0));else _0x56621b[_0x4606f2(0x10b)]?(console['log'](a25_0x5421ca[_0x4606f2(0x11e)]('⚠\x20'+_0x8209c0+':\x20'+_0x56621b[_0x4606f2(0x11c)][_0x4606f2(0x115)]+'\x20warning(s)')),console[_0x4606f2(0x117)](formatValidationResult(_0x56621b,_0x1fad0f,_0x8209c0))):(console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0xfb)]('✖\x20'+_0x8209c0+':\x20'+_0x56621b[_0x4606f2(0x10d)][_0x4606f2(0x115)]+_0x4606f2(0x116))),console[_0x4606f2(0x117)](formatValidationResult(_0x56621b,_0x1fad0f,_0x8209c0)));}return console['log'](''),_0x4645bf[_0x4606f2(0xf9)]?(console[_0x4606f2(0x117)](a25_0x5421ca['red'](_0x4606f2(0x11f)+_0x4645bf[_0x4606f2(0x114)]+_0x4606f2(0x108)+_0x4645bf[_0x4606f2(0x10e)]+_0x4606f2(0xef))),_0x4645bf[_0x4606f2(0xee)]>0x0&&console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0x11e)](_0x4645bf[_0x4606f2(0xee)]+_0x4606f2(0xff))),_0x4645bf['skippedCount']>0x0&&console[_0x4606f2(0x117)](a25_0x5421ca['dim'](_0x4645bf[_0x4606f2(0x104)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0xf7)](_0x4606f2(0xf2)+_0x4645bf[_0x4606f2(0x10e)]+'\x20template(s)\x20valid')),_0x4645bf[_0x4606f2(0xee)]>0x0&&console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0x11e)](_0x4645bf[_0x4606f2(0xee)]+'\x20warning(s)\x20found')),_0x4645bf[_0x4606f2(0x104)]>0x0&&console[_0x4606f2(0x117)](a25_0x5421ca[_0x4606f2(0xf3)](_0x4645bf[_0x4606f2(0x104)]+_0x4606f2(0x110))),0x0);}}function a25_0x5c6b(){const _0x208666=['.yml','errors','validCount','dirname','\x20non-template\x20file(s)\x20skipped','cwd','Error:\x20Directory\x20not\x20found:\x20','No\x20template\x20YAML\x20files\x20found\x20in\x20','invalidCount','length','\x20error(s)','log','\x20(skipped:\x20','verbose','413QqaXzF','1116846ffJfun','warnings','10iOdBiP','yellow','Validation\x20failed:\x20','278IakXvp','description','warningCount','\x20valid','reason','resolve','✔\x20All\x20','dim','Validate\x20template\x20YAML\x20files','relativePath','8nEoZYh','green','engage:template:validate','hasErrors','4185929QJQeJp','red','endsWith','.yaml','template','\x20warning(s)\x20found','1053456EAhwhl','135870dXCJJW','1010583ZpIHhe','name','skippedCount','433530BWCWjR','execute','error','\x20template(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','55oOTAZj','valid'];a25_0x5c6b=function(){return _0x208666;};return a25_0x5c6b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x2ae59e=a26_0x47ea;(function(_0x1aafdb,_0x1be2b5){const _0x562c04=a26_0x47ea,_0x3eb363=_0x1aafdb();while(!![]){try{const _0x497308=parseInt(_0x562c04(0xc8))/0x1+parseInt(_0x562c04(0xf4))/0x2+parseInt(_0x562c04(0xce))/0x3+-parseInt(_0x562c04(0xd6))/0x4+parseInt(_0x562c04(0xe4))/0x5+parseInt(_0x562c04(0xca))/0x6+-parseInt(_0x562c04(0xe6))/0x7;if(_0x497308===_0x1be2b5)break;else _0x3eb363['push'](_0x3eb363['shift']());}catch(_0x4ddf4c){_0x3eb363['push'](_0x3eb363['shift']());}}}(a26_0x4460,0x32b15));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_0x4460(){const _0x1d1c9b=['391531TSNMZt','site','938190XtIjAN','created_at','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','INVALID_ARGUMENT','796251MjdmuZ','floor','\x27\x20to\x20verify\x20the\x20job\x20status','\x20row','file','\x20job','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','34160IUugGJ','Show\x20job\x20details','round','jobs','length','job:result','Submitting\x20job...','join','show','job:kill','Listing\x20jobs...','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','map','26980wmBNgG','yes','6032530iBsiXZ','✔\x20Found\x20','error','name','...','trino','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','green','getTime','hive','execute','query','push','debug','518516rjatAO','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','h\x20ago','user_name','presto','url','Kill\x20a\x20job','✔\x20Retrieved\x20','Query:\x20','dim','just\x20now','priority','Submit\x20a\x20job','job:submit','job_id','verbose','status','job:show','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','mo\x20ago','data','start_at','result','Status\x20filter:\x20','log','Cancelled','\x20jobs','description','success','List\x20jobs','✔\x20Job\x20submitted','No\x20SQL\x20statements\x20found\x20in\x20file','information_schema','Getting\x20job\x20details...','validate','jobType','Job\x20type:\x20','submit','substring','list','database','abs','args','type','limit'];a26_0x4460=function(){return _0x1d1c9b;};return a26_0x4460();}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3bb8c2 from'chalk';function formatDuration(_0x45be33){const _0x5ff4ed=a26_0x47ea;if(_0x45be33<0x3c)return _0x45be33+'s';if(_0x45be33<0xe10)return Math[_0x5ff4ed(0xcf)](_0x45be33/0x3c)+'m\x20'+_0x45be33%0x3c+'s';const _0x5b38b4=Math[_0x5ff4ed(0xcf)](_0x45be33/0xe10),_0x13196c=Math[_0x5ff4ed(0xcf)](_0x45be33%0xe10/0x3c);return _0x13196c>0x0?_0x5b38b4+'h\x20'+_0x13196c+'m':_0x5b38b4+'h';}function formatRelativeTime(_0x337e72){const _0x22a19f=a26_0x47ea,_0x3736d2=Date['now']()-_0x337e72[_0x22a19f(0xee)](),_0x32dba6=Math[_0x22a19f(0xcf)](Math[_0x22a19f(0x11e)](_0x3736d2)/0x3e8);if(_0x32dba6<0x3c)return _0x22a19f(0xff);const _0x54e148=Math[_0x22a19f(0xcf)](_0x32dba6/0x3c);if(_0x54e148<0x3c)return _0x54e148+'m\x20ago';const _0x46198a=Math['floor'](_0x54e148/0x3c);if(_0x46198a<0x18)return _0x46198a+_0x22a19f(0xf7);const _0x4da0d7=Math[_0x22a19f(0xcf)](_0x46198a/0x18);if(_0x4da0d7<0x1e)return _0x4da0d7+'d\x20ago';return Math[_0x22a19f(0xcf)](_0x4da0d7/0x1e)+_0x22a19f(0x108);}export class JobListCommand extends BaseCommand{[a26_0x2ae59e(0xe9)]=a26_0x2ae59e(0xd9);['description']=a26_0x2ae59e(0x112);async[a26_0x2ae59e(0xf0)](_0xa9a186){const _0x29a637=a26_0x2ae59e,{options:_0xbf080e,tdx:_0x29633d}=_0xa9a186,_0x379ce5=resolveLimit(_0xbf080e[_0x29a637(0xc7)],DEFAULT_DISPLAY_LIMIT),_0x9eee6d=_0xbf080e[_0x29a637(0x105)];_0xbf080e[_0x29a637(0x104)]&&(console[_0x29a637(0xe8)]('Limit:\x20'+_0x379ce5+_0x29a637(0x10f)),_0x9eee6d&&console[_0x29a637(0xe8)](_0x29a637(0x10c)+_0x9eee6d));const _0x16e402=await withSpinner(_0x29a637(0xe0),()=>_0x29633d[_0x29a637(0xd9)][_0x29a637(0x11c)]({'from':0x0,'to':_0x379ce5-0x1,'status':_0x9eee6d}),{'verbose':_0xbf080e[_0x29a637(0x104)]}),_0x36d636=_0x16e402[_0x29a637(0x109)];console[_0x29a637(0xe8)](_0x29a637(0xe7)+_0x36d636['length']+_0x29a637(0xd3)+(_0x36d636['length']!==0x1?'s':''));const _0xcace02=_0xbf080e[_0x29a637(0xc9)];if(isStructuredFormat(_0xbf080e)){const _0x19103a=_0x36d636[_0x29a637(0xe3)](_0x28490c=>{const _0x346e7b=_0x29a637;let _0x1a3410;if(_0x28490c[_0x346e7b(0x10a)]&&_0x28490c[_0x346e7b(0xd4)]){const _0x5ab848=new Date(_0x28490c['start_at'])['getTime'](),_0x330b95=new Date(_0x28490c[_0x346e7b(0xd4)])['getTime']();_0x1a3410=Math[_0x346e7b(0xd8)]((_0x330b95-_0x5ab848)/0x3e8);}return{'job_id':_0x28490c[_0x346e7b(0x103)],'type':_0x28490c[_0x346e7b(0xc6)]===_0x346e7b(0xf9)?'trino':_0x28490c[_0x346e7b(0xc6)],'status':_0x28490c['status'],'user_name':_0x28490c[_0x346e7b(0xf8)],'duration_sec':_0x1a3410,'created_at':_0x28490c[_0x346e7b(0xcb)],'started_at':_0x28490c[_0x346e7b(0x10a)],'end_at':_0x28490c[_0x346e7b(0xd4)]};});await handleSDKOutput(_0x19103a,_0xbf080e);}else for(const _0x4221f9 of _0x36d636){const _0x5ddcd2=_0x4221f9[_0x29a637(0x105)]===_0x29a637(0x111)?a26_0x3bb8c2[_0x29a637(0xed)]:_0x4221f9['status']==='error'?a26_0x3bb8c2['red']:a26_0x3bb8c2['dim'],_0x3e3905=_0x5ddcd2(_0x4221f9['status']),_0xad5182=getJobUrl(_0xcace02,_0x4221f9[_0x29a637(0x103)]),_0x28c3e9=hyperlink(_0x4221f9[_0x29a637(0x103)],_0xad5182),_0x194335=a26_0x3bb8c2['dim'](_0x4221f9[_0x29a637(0xc6)]===_0x29a637(0xf9)?_0x29a637(0xeb):_0x4221f9[_0x29a637(0xc6)]),_0x966115=[];if(_0x4221f9[_0x29a637(0x10a)]&&_0x4221f9[_0x29a637(0xd4)]){const _0x379479=Math['round']((new Date(_0x4221f9[_0x29a637(0xd4)])[_0x29a637(0xee)]()-new Date(_0x4221f9[_0x29a637(0x10a)])[_0x29a637(0xee)]())/0x3e8);_0x966115['push'](formatDuration(_0x379479));}if(_0x4221f9[_0x29a637(0xd4)])_0x966115[_0x29a637(0xf2)](formatRelativeTime(new Date(_0x4221f9[_0x29a637(0xd4)])));else _0x4221f9[_0x29a637(0x10a)]&&_0x966115[_0x29a637(0xf2)](formatRelativeTime(new Date(_0x4221f9[_0x29a637(0x10a)])));const _0x253fc6=_0x966115['length']>0x0?a26_0x3bb8c2[_0x29a637(0xfe)]('\x20'+_0x966115[_0x29a637(0xdd)](',\x20')):'';console[_0x29a637(0x10d)]('⚡\x20'+_0x28c3e9+'\x20'+_0x194335+'\x20'+_0x3e3905+_0x253fc6);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x2ae59e(0xe9)]=a26_0x2ae59e(0x106);['description']=a26_0x2ae59e(0xd7);[a26_0x2ae59e(0x117)](_0x4c61e4){const _0x247d13=a26_0x2ae59e,_0x1ce283=_0x4c61e4[_0x247d13(0xc5)][0x0];if(!_0x1ce283)return _0x247d13(0xd5);return undefined;}async[a26_0x2ae59e(0xf0)](_0x26a5fd){const _0x23a65f=a26_0x2ae59e,{options:_0x179b38,args:_0x14b3f1,tdx:_0x2ddbc7}=_0x26a5fd,_0xe9ff0b=_0x14b3f1[0x0],_0x1745c8=await withSpinner(_0x23a65f(0x116),()=>_0x2ddbc7[_0x23a65f(0xd9)][_0x23a65f(0xde)](_0xe9ff0b),{'verbose':_0x179b38[_0x23a65f(0x104)]}),_0x1fb608=_0x1745c8['data'];let _0xf84aec;if(_0x1fb608['start_at']&&_0x1fb608[_0x23a65f(0xd4)]){const _0x44077e=new Date(_0x1fb608[_0x23a65f(0x10a)])[_0x23a65f(0xee)](),_0x26a1fd=new Date(_0x1fb608['end_at'])[_0x23a65f(0xee)]();_0xf84aec=Math[_0x23a65f(0xd8)]((_0x26a1fd-_0x44077e)/0x3e8);}const _0x2a836c={'job_id':_0x1fb608['job_id'],'type':_0x1fb608['type'],'status':_0x1fb608['status'],..._0x1fb608['user_name']&&{'user_name':_0x1fb608[_0x23a65f(0xf8)]},..._0xf84aec!==undefined&&{'duration_sec':_0xf84aec},..._0x1fb608[_0x23a65f(0xcb)]&&{'created_at':_0x1fb608[_0x23a65f(0xcb)]},..._0x1fb608[_0x23a65f(0x10a)]&&{'started_at':_0x1fb608[_0x23a65f(0x10a)]},..._0x1fb608[_0x23a65f(0xd4)]&&{'end_at':_0x1fb608[_0x23a65f(0xd4)]},..._0x1fb608[_0x23a65f(0x11d)]&&{'database':_0x1fb608[_0x23a65f(0x11d)]},..._0x1fb608[_0x23a65f(0x100)]!==undefined&&{'priority':_0x1fb608['priority']},..._0x1fb608[_0x23a65f(0xfa)]&&{'url':_0x1fb608[_0x23a65f(0xfa)]},..._0x1fb608[_0x23a65f(0xf1)]&&{'query':_0x1fb608[_0x23a65f(0xf1)]},..._0x1fb608[_0x23a65f(0xf3)]&&{'debug':_0x1fb608[_0x23a65f(0xf3)]}};return await handleSingleObjectOutput(_0x2a836c,_0x179b38),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x2ae59e(0xe9)]=a26_0x2ae59e(0xdf);[a26_0x2ae59e(0x110)]=a26_0x2ae59e(0xfb);[a26_0x2ae59e(0x117)](_0x1e260f){const _0x175d27=a26_0x2ae59e,_0x3f321f=_0x1e260f[_0x175d27(0xc5)][0x0];if(!_0x3f321f)return _0x175d27(0xf6);return undefined;}async[a26_0x2ae59e(0xf0)](_0x26354c){const _0x15a7c5=a26_0x2ae59e,{options:_0x24184f,args:_0x4b8a5a,tdx:_0x3a6df5}=_0x26354c,_0x5d78fd=_0x4b8a5a[0x0];if(!_0x24184f[_0x15a7c5(0xe5)]){const _0x4fbd35=await confirm(_0x15a7c5(0xf5)+_0x5d78fd+'?');if(!_0x4fbd35)return console['error'](_0x15a7c5(0x10e)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x3a6df5[_0x15a7c5(0xd9)]['kill'](_0x5d78fd),{'verbose':_0x24184f[_0x15a7c5(0x104)]}),console['error'](_0x15a7c5(0xe1)+_0x5d78fd),console[_0x15a7c5(0xe8)](_0x15a7c5(0xcc)+_0x5d78fd+_0x15a7c5(0xd0)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x2ae59e(0x102);[a26_0x2ae59e(0x110)]=a26_0x2ae59e(0x101);async[a26_0x2ae59e(0xf0)](_0x5530ea){const _0x860999=a26_0x2ae59e,{options:_0x39473d,args:_0x3d8a17,tdx:_0x10121b}=_0x5530ea,_0x4d8fb7=_0x39473d[_0x860999(0x118)]||_0x860999(0xeb),_0x3fcb3e=_0x39473d[_0x860999(0xd2)],_0x3a033c=_0x39473d[_0x860999(0x11d)]||_0x860999(0x115),_0x82f3b3=_0x39473d[_0x860999(0x10b)];if(_0x4d8fb7!=='trino'&&_0x4d8fb7!==_0x860999(0xef))throw new SDKError(ErrorCode[_0x860999(0xcd)],_0x860999(0xec));let _0x628a59;if(_0x3fcb3e){if(_0x3d8a17[0x0])throw new SDKError(ErrorCode[_0x860999(0xcd)],_0x860999(0x107));const _0x310e66=readSqlStatementsFromFile(_0x3fcb3e);if(_0x310e66[_0x860999(0xda)]===0x0)throw new SDKError(ErrorCode[_0x860999(0xcd)],_0x860999(0x114));if(_0x310e66[_0x860999(0xda)]>0x1)throw new SDKError(ErrorCode[_0x860999(0xcd)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x628a59=_0x310e66[0x0];}else{if(!_0x3d8a17[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x628a59=_0x3d8a17[0x0];}_0x39473d[_0x860999(0x104)]&&(console[_0x860999(0xe8)](_0x860999(0x119)+_0x4d8fb7),console[_0x860999(0xe8)]('Database:\x20'+_0x3a033c),console[_0x860999(0xe8)](_0x860999(0xfd)+_0x628a59[_0x860999(0x11b)](0x0,0x64)+(_0x628a59[_0x860999(0xda)]>0x64?_0x860999(0xea):'')));const _0x2a67d6=await withSpinner(_0x860999(0xdc),()=>_0x10121b[_0x860999(0xd9)][_0x860999(0x11a)](_0x3a033c,_0x628a59,_0x4d8fb7,_0x82f3b3),{'verbose':_0x39473d[_0x860999(0x104)]}),_0x18b010=_0x2a67d6['data'];return console[_0x860999(0xe8)](_0x860999(0x113)),console['error']('\x20\x20Job\x20ID:\x20'+_0x18b010[_0x860999(0x103)]),await handleSDKOutput([_0x18b010],_0x39473d),0x0;}}function a26_0x47ea(_0x40f4bd,_0x2872fd){_0x40f4bd=_0x40f4bd-0xc5;const _0x44602e=a26_0x4460();let _0x47ea7b=_0x44602e[_0x40f4bd];return _0x47ea7b;}export class JobResultCommand extends BaseCommand{[a26_0x2ae59e(0xe9)]=a26_0x2ae59e(0xdb);[a26_0x2ae59e(0x110)]='Get\x20job\x20results';[a26_0x2ae59e(0x117)](_0x4261f5){const _0x1ff60b=a26_0x2ae59e,_0x1bcbf6=_0x4261f5[_0x1ff60b(0xc5)][0x0];if(!_0x1bcbf6)return _0x1ff60b(0xe2);return undefined;}async[a26_0x2ae59e(0xf0)](_0x2c66fb){const _0xe8f4f=a26_0x2ae59e,{options:_0x52caa2,args:_0x446ef7,tdx:_0x2a8de3}=_0x2c66fb,_0x5514ee=_0x446ef7[0x0],_0x3f81e3=await withSpinner('Getting\x20job\x20results...',()=>_0x2a8de3[_0xe8f4f(0xd9)][_0xe8f4f(0x10b)](_0x5514ee),{'verbose':_0x52caa2[_0xe8f4f(0x104)]}),_0x4f7bb5=_0x3f81e3[_0xe8f4f(0x109)];return console[_0xe8f4f(0xe8)](_0xe8f4f(0xfc)+_0x4f7bb5[_0xe8f4f(0xda)]+_0xe8f4f(0xd1)+(_0x4f7bb5['length']!==0x1?'s':'')),await handleSDKOutput(_0x4f7bb5,_0x52caa2),0x0;}}
|
|
1
|
+
const a26_0x3d3515=a26_0x387a;(function(_0x466435,_0x51f6ca){const _0x5f4c00=a26_0x387a,_0x4b4eec=_0x466435();while(!![]){try{const _0x5edf42=parseInt(_0x5f4c00(0x1b7))/0x1*(-parseInt(_0x5f4c00(0x19d))/0x2)+parseInt(_0x5f4c00(0x199))/0x3*(-parseInt(_0x5f4c00(0x1c6))/0x4)+parseInt(_0x5f4c00(0x198))/0x5+parseInt(_0x5f4c00(0x1a6))/0x6*(-parseInt(_0x5f4c00(0x1a8))/0x7)+-parseInt(_0x5f4c00(0x18b))/0x8+-parseInt(_0x5f4c00(0x1d2))/0x9+-parseInt(_0x5f4c00(0x17e))/0xa*(-parseInt(_0x5f4c00(0x1c9))/0xb);if(_0x5edf42===_0x51f6ca)break;else _0x4b4eec['push'](_0x4b4eec['shift']());}catch(_0x5108e4){_0x4b4eec['push'](_0x4b4eec['shift']());}}}(a26_0x3ad3,0xa224d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x51996c from'chalk';function formatDuration(_0x4fe282){const _0x3e9750=a26_0x387a;if(_0x4fe282<0x3c)return _0x4fe282+'s';if(_0x4fe282<0xe10)return Math[_0x3e9750(0x184)](_0x4fe282/0x3c)+'m\x20'+_0x4fe282%0x3c+'s';const _0x46977b=Math[_0x3e9750(0x184)](_0x4fe282/0xe10),_0x4dfaf1=Math[_0x3e9750(0x184)](_0x4fe282%0xe10/0x3c);return _0x4dfaf1>0x0?_0x46977b+'h\x20'+_0x4dfaf1+'m':_0x46977b+'h';}function formatRelativeTime(_0x2e3ea7){const _0x14526b=a26_0x387a,_0x329cb1=Date[_0x14526b(0x195)]()-_0x2e3ea7[_0x14526b(0x188)](),_0x385ac7=Math['floor'](Math['abs'](_0x329cb1)/0x3e8);if(_0x385ac7<0x3c)return _0x14526b(0x1b1);const _0x300f5f=Math[_0x14526b(0x184)](_0x385ac7/0x3c);if(_0x300f5f<0x3c)return _0x300f5f+'m\x20ago';const _0x5051f4=Math[_0x14526b(0x184)](_0x300f5f/0x3c);if(_0x5051f4<0x18)return _0x5051f4+_0x14526b(0x19a);const _0x1c6b86=Math[_0x14526b(0x184)](_0x5051f4/0x18);if(_0x1c6b86<0x1e)return _0x1c6b86+_0x14526b(0x196);return Math['floor'](_0x1c6b86/0x1e)+_0x14526b(0x190);}export class JobListCommand extends BaseCommand{[a26_0x3d3515(0x1b8)]=a26_0x3d3515(0x1d3);[a26_0x3d3515(0x1d0)]=a26_0x3d3515(0x1ba);async[a26_0x3d3515(0x1c5)](_0x44b705){const _0x3ecdf6=a26_0x3d3515,{options:_0x44bd37,tdx:_0xc1aec2}=_0x44b705,_0x2caa0e=resolveLimit(_0x44bd37[_0x3ecdf6(0x1c7)],DEFAULT_DISPLAY_LIMIT),_0x49f201=_0x44bd37[_0x3ecdf6(0x1cf)];_0x44bd37[_0x3ecdf6(0x1ce)]&&(console[_0x3ecdf6(0x197)]('Limit:\x20'+_0x2caa0e+'\x20jobs'),_0x49f201&&console[_0x3ecdf6(0x197)](_0x3ecdf6(0x19f)+_0x49f201));const _0x117e53=await withSpinner('Listing\x20jobs...',()=>_0xc1aec2[_0x3ecdf6(0x1d3)][_0x3ecdf6(0x1a7)]({'from':0x0,'to':_0x2caa0e-0x1,'status':_0x49f201}),{'verbose':_0x44bd37[_0x3ecdf6(0x1ce)]}),_0x1a0e61=_0x117e53[_0x3ecdf6(0x182)];console[_0x3ecdf6(0x197)]('✔\x20Found\x20'+_0x1a0e61[_0x3ecdf6(0x18f)]+'\x20job'+(_0x1a0e61[_0x3ecdf6(0x18f)]!==0x1?'s':''));const _0x1de5e2=_0x44bd37[_0x3ecdf6(0x17f)];if(isStructuredFormat(_0x44bd37)){const _0x559cd6=_0x1a0e61[_0x3ecdf6(0x1b9)](_0x1daf9d=>{const _0x49dce3=_0x3ecdf6;let _0x738406;if(_0x1daf9d[_0x49dce3(0x1d5)]&&_0x1daf9d[_0x49dce3(0x1ae)]){const _0x4a56ff=new Date(_0x1daf9d['start_at'])[_0x49dce3(0x188)](),_0x3478d5=new Date(_0x1daf9d[_0x49dce3(0x1ae)])[_0x49dce3(0x188)]();_0x738406=Math[_0x49dce3(0x1ac)]((_0x3478d5-_0x4a56ff)/0x3e8);}return{'job_id':_0x1daf9d[_0x49dce3(0x1c3)],'type':_0x1daf9d[_0x49dce3(0x1a0)]===_0x49dce3(0x19b)?_0x49dce3(0x183):_0x1daf9d[_0x49dce3(0x1a0)],'status':_0x1daf9d[_0x49dce3(0x1cf)],'user_name':_0x1daf9d['user_name'],'duration_sec':_0x738406,'created_at':_0x1daf9d[_0x49dce3(0x1b3)],'started_at':_0x1daf9d['start_at'],'end_at':_0x1daf9d[_0x49dce3(0x1ae)]};});await handleSDKOutput(_0x559cd6,_0x44bd37);}else for(const _0x2c035e of _0x1a0e61){const _0x5a47f4=_0x2c035e[_0x3ecdf6(0x1cf)]===_0x3ecdf6(0x1b6)?a26_0x51996c[_0x3ecdf6(0x1bd)]:_0x2c035e['status']==='error'?a26_0x51996c[_0x3ecdf6(0x1bc)]:a26_0x51996c[_0x3ecdf6(0x1b4)],_0x3a7d38=_0x5a47f4(_0x2c035e[_0x3ecdf6(0x1cf)]),_0x264faf=getJobUrl(_0x1de5e2,_0x2c035e['job_id']),_0x38c528=hyperlink(_0x2c035e[_0x3ecdf6(0x1c3)],_0x264faf),_0x33ee5b=a26_0x51996c[_0x3ecdf6(0x1b4)](_0x2c035e[_0x3ecdf6(0x1a0)]==='presto'?_0x3ecdf6(0x183):_0x2c035e[_0x3ecdf6(0x1a0)]),_0xaf9d80=[];if(_0x2c035e[_0x3ecdf6(0x1d5)]&&_0x2c035e[_0x3ecdf6(0x1ae)]){const _0x372c72=Math[_0x3ecdf6(0x1ac)]((new Date(_0x2c035e[_0x3ecdf6(0x1ae)])[_0x3ecdf6(0x188)]()-new Date(_0x2c035e['start_at'])[_0x3ecdf6(0x188)]())/0x3e8);_0xaf9d80[_0x3ecdf6(0x19c)](formatDuration(_0x372c72));}if(_0x2c035e[_0x3ecdf6(0x1ae)])_0xaf9d80[_0x3ecdf6(0x19c)](formatRelativeTime(new Date(_0x2c035e[_0x3ecdf6(0x1ae)])));else _0x2c035e[_0x3ecdf6(0x1d5)]&&_0xaf9d80['push'](formatRelativeTime(new Date(_0x2c035e['start_at'])));const _0x7c78c8=_0xaf9d80['length']>0x0?a26_0x51996c[_0x3ecdf6(0x1b4)]('\x20'+_0xaf9d80[_0x3ecdf6(0x1ab)](',\x20')):'';console[_0x3ecdf6(0x180)]('⚡\x20'+_0x38c528+'\x20'+_0x33ee5b+'\x20'+_0x3a7d38+_0x7c78c8);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x3d3515(0x1b8)]=a26_0x3d3515(0x1ad);[a26_0x3d3515(0x1d0)]=a26_0x3d3515(0x18a);['validate'](_0x33cbad){const _0x2a0b85=a26_0x3d3515,_0x443fc6=_0x33cbad[_0x2a0b85(0x18d)][0x0];if(!_0x443fc6)return _0x2a0b85(0x1bb);return undefined;}async[a26_0x3d3515(0x1c5)](_0x4e6ab6){const _0x5cc0fb=a26_0x3d3515,{options:_0x4cce63,args:_0x49ca62,tdx:_0x336344}=_0x4e6ab6,_0x54ebd3=_0x49ca62[0x0],_0x3bde6d=await withSpinner(_0x5cc0fb(0x1be),()=>_0x336344['jobs']['show'](_0x54ebd3),{'verbose':_0x4cce63[_0x5cc0fb(0x1ce)]}),_0x596002=_0x3bde6d[_0x5cc0fb(0x182)];let _0x578801;if(_0x596002[_0x5cc0fb(0x1d5)]&&_0x596002[_0x5cc0fb(0x1ae)]){const _0x5e9b89=new Date(_0x596002[_0x5cc0fb(0x1d5)])[_0x5cc0fb(0x188)](),_0x13b9e3=new Date(_0x596002['end_at'])['getTime']();_0x578801=Math[_0x5cc0fb(0x1ac)]((_0x13b9e3-_0x5e9b89)/0x3e8);}const _0x5abaf0={'job_id':_0x596002[_0x5cc0fb(0x1c3)],'type':_0x596002[_0x5cc0fb(0x1a0)],'status':_0x596002['status'],..._0x596002['user_name']&&{'user_name':_0x596002['user_name']},..._0x578801!==undefined&&{'duration_sec':_0x578801},..._0x596002[_0x5cc0fb(0x1b3)]&&{'created_at':_0x596002[_0x5cc0fb(0x1b3)]},..._0x596002[_0x5cc0fb(0x1d5)]&&{'started_at':_0x596002[_0x5cc0fb(0x1d5)]},..._0x596002[_0x5cc0fb(0x1ae)]&&{'end_at':_0x596002[_0x5cc0fb(0x1ae)]},..._0x596002[_0x5cc0fb(0x191)]&&{'database':_0x596002['database']},..._0x596002[_0x5cc0fb(0x1a4)]!==undefined&&{'priority':_0x596002['priority']},..._0x596002[_0x5cc0fb(0x19e)]&&{'url':_0x596002[_0x5cc0fb(0x19e)]},..._0x596002[_0x5cc0fb(0x192)]&&{'query':_0x596002[_0x5cc0fb(0x192)]},..._0x596002[_0x5cc0fb(0x1b2)]&&{'debug':_0x596002[_0x5cc0fb(0x1b2)]}};return await handleSingleObjectOutput(_0x5abaf0,_0x4cce63),0x0;}}function a26_0x387a(_0xd7b53,_0x3c55db){_0xd7b53=_0xd7b53-0x17d;const _0x3ad35b=a26_0x3ad3();let _0x387abd=_0x3ad35b[_0xd7b53];return _0x387abd;}export class JobKillCommand extends BaseCommand{['name']='job:kill';[a26_0x3d3515(0x1d0)]=a26_0x3d3515(0x194);[a26_0x3d3515(0x1ca)](_0x467346){const _0x4eb3e0=a26_0x3d3515,_0x2ed477=_0x467346['args'][0x0];if(!_0x2ed477)return _0x4eb3e0(0x1bf);return undefined;}async[a26_0x3d3515(0x1c5)](_0x48e06e){const _0x4c8cc4=a26_0x3d3515,{options:_0x219222,args:_0x188b19,tdx:_0x50a884}=_0x48e06e,_0x5b2bfc=_0x188b19[0x0];if(!_0x219222[_0x4c8cc4(0x1a1)]){const _0x4cda4f=await confirm(_0x4c8cc4(0x1a2)+_0x5b2bfc+'?');if(!_0x4cda4f)return console[_0x4c8cc4(0x197)]('Cancelled'),0x0;}return await withSpinner(_0x4c8cc4(0x1d4),()=>_0x50a884[_0x4c8cc4(0x1d3)][_0x4c8cc4(0x181)](_0x5b2bfc),{'verbose':_0x219222[_0x4c8cc4(0x1ce)]}),console['error'](_0x4c8cc4(0x1a3)+_0x5b2bfc),console[_0x4c8cc4(0x197)](_0x4c8cc4(0x18c)+_0x5b2bfc+_0x4c8cc4(0x18e)),0x0;}}function a26_0x3ad3(){const _0x1b39df=['name','map','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','red','green','Getting\x20job\x20details...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Get\x20job\x20results','hive','✔\x20Job\x20submitted','job_id','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','execute','4YTIFTu','limit','Submit\x20a\x20job','33337139lJUpyb','validate','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','...','substring','verbose','status','description','submit','10276992kEiXoR','jobs','Submitting\x20kill\x20request...','start_at','job:result','Job\x20type:\x20','10iWHrLJ','site','log','kill','data','trino','floor','Query:\x20','No\x20SQL\x20statements\x20found\x20in\x20file','INVALID_ARGUMENT','getTime','Submitting\x20job...','Show\x20job\x20details','4206176mekzBV','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','args','\x27\x20to\x20verify\x20the\x20job\x20status','length','mo\x20ago','database','query','\x20\x20Job\x20ID:\x20','Kill\x20a\x20job','now','d\x20ago','error','6554050djZhYZ','2049378SqgedT','h\x20ago','presto','push','1125034MCBRti','url','Status\x20filter:\x20','type','yes','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','priority','✔\x20Retrieved\x20','516kreOBK','list','16401LNJMtI','Database:\x20','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','join','round','job:show','end_at','result','\x20row','just\x20now','debug','created_at','dim','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','success','2mNvkXu'];a26_0x3ad3=function(){return _0x1b39df;};return a26_0x3ad3();}export class JobSubmitCommand extends BaseCommand{[a26_0x3d3515(0x1b8)]='job:submit';['description']=a26_0x3d3515(0x1c8);async[a26_0x3d3515(0x1c5)](_0x3c12b2){const _0xe32a42=a26_0x3d3515,{options:_0x4a1269,args:_0xc66b47,tdx:_0xa6534f}=_0x3c12b2,_0x4926f5=_0x4a1269['jobType']||_0xe32a42(0x183),_0x37960b=_0x4a1269['file'],_0x5b7c6f=_0x4a1269[_0xe32a42(0x191)]||'information_schema',_0x55a7be=_0x4a1269[_0xe32a42(0x1af)];if(_0x4926f5!=='trino'&&_0x4926f5!==_0xe32a42(0x1c1))throw new SDKError(ErrorCode[_0xe32a42(0x187)],_0xe32a42(0x1aa));let _0x44eca0;if(_0x37960b){if(_0xc66b47[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x5e7957=readSqlStatementsFromFile(_0x37960b);if(_0x5e7957[_0xe32a42(0x18f)]===0x0)throw new SDKError(ErrorCode[_0xe32a42(0x187)],_0xe32a42(0x186));if(_0x5e7957[_0xe32a42(0x18f)]>0x1)throw new SDKError(ErrorCode[_0xe32a42(0x187)],_0xe32a42(0x1c4));_0x44eca0=_0x5e7957[0x0];}else{if(!_0xc66b47[0x0])throw new SDKError(ErrorCode[_0xe32a42(0x187)],_0xe32a42(0x1b5));_0x44eca0=_0xc66b47[0x0];}_0x4a1269[_0xe32a42(0x1ce)]&&(console[_0xe32a42(0x197)](_0xe32a42(0x17d)+_0x4926f5),console['error'](_0xe32a42(0x1a9)+_0x5b7c6f),console[_0xe32a42(0x197)](_0xe32a42(0x185)+_0x44eca0[_0xe32a42(0x1cd)](0x0,0x64)+(_0x44eca0[_0xe32a42(0x18f)]>0x64?_0xe32a42(0x1cc):'')));const _0xcf72e3=await withSpinner(_0xe32a42(0x189),()=>_0xa6534f[_0xe32a42(0x1d3)][_0xe32a42(0x1d1)](_0x5b7c6f,_0x44eca0,_0x4926f5,_0x55a7be),{'verbose':_0x4a1269[_0xe32a42(0x1ce)]}),_0x46f84d=_0xcf72e3[_0xe32a42(0x182)];return console[_0xe32a42(0x197)](_0xe32a42(0x1c2)),console['error'](_0xe32a42(0x193)+_0x46f84d['job_id']),await handleSDKOutput([_0x46f84d],_0x4a1269),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x3d3515(0x1b8)]=a26_0x3d3515(0x1d6);[a26_0x3d3515(0x1d0)]=a26_0x3d3515(0x1c0);[a26_0x3d3515(0x1ca)](_0x5b778d){const _0x5631c7=a26_0x3d3515,_0x3acf8a=_0x5b778d[_0x5631c7(0x18d)][0x0];if(!_0x3acf8a)return _0x5631c7(0x1cb);return undefined;}async[a26_0x3d3515(0x1c5)](_0x9de80){const _0x5be423=a26_0x3d3515,{options:_0x21c0d3,args:_0x2c59fc,tdx:_0x2f11fd}=_0x9de80,_0x2338f4=_0x2c59fc[0x0],_0x5c221b=await withSpinner('Getting\x20job\x20results...',()=>_0x2f11fd[_0x5be423(0x1d3)][_0x5be423(0x1af)](_0x2338f4),{'verbose':_0x21c0d3[_0x5be423(0x1ce)]}),_0x218eaa=_0x5c221b[_0x5be423(0x182)];return console['error'](_0x5be423(0x1a5)+_0x218eaa[_0x5be423(0x18f)]+_0x5be423(0x1b0)+(_0x218eaa[_0x5be423(0x18f)]!==0x1?'s':'')),await handleSDKOutput(_0x218eaa,_0x21c0d3),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x354a54=a27_0x47c0;(function(_0x2b4a99,_0x32ca84){const _0x5273de=a27_0x47c0,_0x153d4f=_0x2b4a99();while(!![]){try{const _0x27031f=parseInt(_0x5273de(0x1c0))/0x1+parseInt(_0x5273de(0x146))/0x2*(parseInt(_0x5273de(0x1f6))/0x3)+-parseInt(_0x5273de(0x10a))/0x4*(-parseInt(_0x5273de(0x17a))/0x5)+-parseInt(_0x5273de(0x1ee))/0x6*(-parseInt(_0x5273de(0x1aa))/0x7)+-parseInt(_0x5273de(0x12b))/0x8+parseInt(_0x5273de(0x1b1))/0x9*(parseInt(_0x5273de(0x1e7))/0xa)+-parseInt(_0x5273de(0x1a9))/0xb*(-parseInt(_0x5273de(0x1cf))/0xc);if(_0x27031f===_0x32ca84)break;else _0x153d4f['push'](_0x153d4f['shift']());}catch(_0x4babe8){_0x153d4f['push'](_0x153d4f['shift']());}}}(a27_0x4c19,0xdcd5b));import a27_0x5dfa1a from'chalk';import a27_0x40bb69 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(_0x4fba64){const _0x381b7d=a27_0x47c0;return!_0x4fba64&&(console[_0x381b7d(0x115)](_0x381b7d(0x1dc)),console[_0x381b7d(0x115)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x4fba64;}function a27_0x4c19(){const _0x825f25=['Aborted.','createVersion','createdAt','Listing\x20journeys...','links','770512MGVNBc','Resume\x20a\x20paused\x20journey','folders','tsv','localeCompare','message','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journey','resolveParentId','✔\x20Pulled\x20','versionNumber','join','limit','journey:stats','session','📁\x20','journey:versions','segments','Pattern:\x20','split','Fetching\x20','List\x20journeys\x20in\x20current\x20context','parent_segment','jsonl','draft','resolveJourneyId','exitOrJumpRate','all','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','journeys','user','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','size','journey:pull','journey:pause','stageNameMap','Pausing\x20journey...','activation','\x20\x20Name:\x20','content','/e/','journey:version:create','stage','getTrafficData','errorCode','\x20files?','listVersions','journeyBundleName','options','\x20\x20Folder\x20path:\x20','from','yellow','5715feMbnG','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','kind','\x20\x20Target:\x20','attributes','map','filePath','completeMilestoneRate','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journey:version:view','Error:\x20Invalid\x20--type\x20\x22','toLowerCase','Error:\x20Journey\x20not\x20found:\x20','has','\x5c$&','parentSegment','archived','absolutePath','Error:\x20Version\x20','base','\x20changed\x20files','Getting\x20journey\x20traffic\x20data...','completionRate','(draft)','rootFolderId','file','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20-\x20','find','Fetching\x20journeys\x20and\x20folders...','folderPath','Error:\x20Invalid\x20version\x20number:\x20','Error:\x20Journey\x20\x27','Error:\x20Parent\x20segment\x20context\x20required','\x20journeys','List\x20all\x20versions\x20of\x20a\x20journey','reentryMode','dim','state','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','no_parent','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x22\x20not\x20found','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20=\x20','journey:push','2514523ZhRrCW','75593ueaMbJ','Getting\x20version\x20','Show\x20journey\x20statistics','set','\x20versions)','getStatistics','nodes','9YjCzRh','✔\x20Journey\x20\x22','No\x20statistics\x20available\x20for\x20journey:\x20','✔\x20Found\x20','Creating\x20new\x20version...','\x22\x20resumed','Error:\x20--version\x20option\x20is\x20required','getSegment','activationParams','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','List\x20activations\x20for\x20a\x20journey','conversion','(archived)','Getting\x20journey\x20statistics...','description','262042EUljDx','audienceId','isNew','data','Export\x20journey(s)\x20as\x20YAML\x20files','journey:columns','INVALID_ARGUMENT','get','folderId','cwd','Pause\x20a\x20running\x20journey','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Fetching\x20users\x20and\x20connections...','json','segmentPushCommand','12josBJO','Resuming\x20journey...','relativePath','helpText','resourceName','journey:resume','\x20journey','sort','Getting\x20journey\x20details...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','...','milestoneSize','\x20->\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','/app/ps/','journeyStages','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x0aChanges\x20to\x20\x27','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','args','/j/da/je','goal','buildIdToEmailMap','3751830dEBXUV','\x20version','exitOrJumpSize','pause','Target\x20file:\x20','Resolving\x20parent\x20segment...','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','348JEmqmx','then','stringify','site','resume','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey:list','Resolved\x20YAML\x20file:\x20','3uHCtVJ','segment','hasPeriod','Database:\x20','listJourneysWithFolders','format','listJourneysFromParentSegment','getParentFull','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','connection','\x22\x20paused','\x20journey\x20files\x20to\x20','segmentName','columns','Parent\x20segment:\x20','parentName','getLatestJourneyId','utf-8','activation_','\x20\x20Parent\x20segment:\x20','🗺️\x20','cyan','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','getJourney','getColumnMapping','includeHistory','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','\x20unchanged\x20files','log','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20new\x20files','Resolving\x20journey...','targetDir','enteredSize','filter','relative','journeyId','journeyName','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','tdx.json','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Journey\x20ID:\x20','table','Target\x20directory:\x20','add','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','2572fslBRO','journeyBundleId','connector_config','.yml','\x20\x20Statistics\x20not\x20available','values','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','buildIdToNameMap','\x20activation','Input:\x20','renderStats','error','\x20Created\x20v','database','launched','(paused)','(root)','\x0aError:','blue','root\x20folder','history','push','red','repeat','Found\x20','Journey\x20name:\x20','completed','verbose','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser',',\x20version:\x20','\x20Opening\x20','dryRun','type','13662608oXxHfg','✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Context\x20set:\x20','listActivationsFlat','name','listFolders','paused','stages','\x20\x20Consolidating\x20duplicate\x20segment:\x20','rule','Error:\x20','hasChanges','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','execute','yes','/j/da','test','\x20details...','length','setPhase','Cancelled','(completed)'];a27_0x4c19=function(){return _0x825f25;};return a27_0x4c19();}function withJsonFormat(_0x59e82c){const _0x40a665=a27_0x47c0;if(!_0x59e82c[_0x40a665(0x1fb)]&&!_0x59e82c[_0x40a665(0x1cd)]&&!_0x59e82c[_0x40a665(0x15d)]&&!_0x59e82c[_0x40a665(0x149)])return{..._0x59e82c,'format':_0x40a665(0x1cd),'json':!![]};return _0x59e82c;}function formatJourneyState(_0x32db29){const _0x3cc87e=a27_0x47c0;switch(_0x32db29){case _0x3cc87e(0x118):return a27_0x5dfa1a[_0x3cc87e(0x1a3)]('(running)');case _0x3cc87e(0x15e):return a27_0x5dfa1a[_0x3cc87e(0x19f)](_0x3cc87e(0x191));case'paused':return a27_0x5dfa1a[_0x3cc87e(0x179)](_0x3cc87e(0x119));case _0x3cc87e(0x124):return a27_0x5dfa1a[_0x3cc87e(0x11c)](_0x3cc87e(0x140));case _0x3cc87e(0x18a):return a27_0x5dfa1a[_0x3cc87e(0x19f)](_0x3cc87e(0x1bd));default:return'('+_0x32db29+')';}}function formatJourneyItem(_0x4c2f93,_0x14719d='',_0x564056){const _0x3412f2=a27_0x47c0,_0x314a04=formatJourneyState(_0x4c2f93[_0x3412f2(0x1a0)]),_0x14ae60=_0x564056?hyperlink(_0x4c2f93['journeyBundleName'],_0x564056):_0x4c2f93[_0x3412f2(0x175)];return _0x14719d+_0x3412f2(0x20a)+_0x14ae60+'\x20'+_0x314a04;}function escapeRegex(_0xb66043){const _0x533173=a27_0x47c0;return _0xb66043['replace'](/[.*+?^${}()|[\]\\]/g,_0x533173(0x188));}function globToRegex(_0x4f5632){const _0x3f0801=a27_0x47c0,_0x22b4ab=_0x4f5632[_0x3f0801(0x159)]('*')[_0x3f0801(0x17f)](escapeRegex);return new RegExp(_0x22b4ab[_0x3f0801(0x151)]('.*'),'i');}function buildRuleToNameMapping(_0x4f1b04){const _0x1e9a7b=a27_0x47c0,_0x219d29=new Map();if(_0x4f1b04[_0x1e9a7b(0x157)])for(const [_0x31c736,_0x541199]of Object['entries'](_0x4f1b04[_0x1e9a7b(0x157)])){if(_0x541199[_0x1e9a7b(0x134)]){const _0x17e8cd=serializeRule(_0x541199[_0x1e9a7b(0x134)]),_0x5c7875=_0x219d29[_0x1e9a7b(0x1c7)](_0x17e8cd);_0x5c7875?_0x5c7875['push'](_0x31c736):_0x219d29[_0x1e9a7b(0x1ad)](_0x17e8cd,[_0x31c736]);}}return _0x219d29;}async function resolveJourneyIdFromInput(_0x14852c,_0x2b0aec,_0x28b3c5){const _0x61795d=a27_0x47c0,_0x1adb83=await resolveJourneyTarget(_0x14852c,_0x2b0aec[_0x61795d(0x189)],_0x2b0aec[_0x61795d(0x125)]),_0x275d78=_0x1adb83['parentSegment'];if(!_0x275d78)throw new SDKError(ErrorCode[_0x61795d(0x1c6)],_0x61795d(0x104));const _0x2ffe37=await withSpinner(_0x61795d(0x1ec),()=>_0x28b3c5[_0x61795d(0x1f7)]['resolveParentId'](_0x275d78),{'verbose':_0x2b0aec[_0x61795d(0x125)]}),_0x111c2c=_0x2ffe37[_0x61795d(0x1c3)],_0xdf67c4=await withSpinner(_0x61795d(0xfb),()=>_0x28b3c5[_0x61795d(0x14d)][_0x61795d(0x15f)](_0x111c2c,_0x1adb83[_0x61795d(0x101)]),{'verbose':_0x2b0aec['verbose']});return{'journeyId':_0xdf67c4[_0x61795d(0x1c3)],'journeyName':_0x1adb83[_0x61795d(0x101)],'parentSegmentId':_0x111c2c};}async function resolveJourneyTarget(_0x509b1f,_0x265694,_0x46e27b){const _0x965aa0=a27_0x47c0;if(isYamlFilePath(_0x509b1f))try{const _0x2128dd=await resolveYamlFilePath(_0x509b1f);return _0x46e27b&&(console['error'](_0x965aa0(0x1f5)+_0x509b1f),console[_0x965aa0(0x115)](_0x965aa0(0x209)+_0x2128dd[_0x965aa0(0x189)]),console[_0x965aa0(0x115)](_0x965aa0(0x16c)+_0x2128dd[_0x965aa0(0x202)]),console['error'](_0x965aa0(0x177)+(_0x2128dd[_0x965aa0(0x198)]||_0x965aa0(0x11a)))),{'journeyName':_0x2128dd[_0x965aa0(0x202)],'parentSegment':_0x2128dd[_0x965aa0(0x189)],'resolved':_0x2128dd};}catch(_0x192440){throw new SDKError(ErrorCode[_0x965aa0(0x1c6)],_0x965aa0(0x1d8)+_0x192440[_0x965aa0(0x14b)]);}if(!_0x265694)throw new SDKError(ErrorCode[_0x965aa0(0x1c6)],_0x965aa0(0x194));return{'journeyName':_0x509b1f,'parentSegment':_0x265694};}export class JourneyListCommand extends BaseCommand{['name']=a27_0x354a54(0x1f4);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x15b);async[a27_0x354a54(0x138)](_0x2660e4){const _0x49e471=a27_0x354a54,{options:_0x56d291,args:_0x176235,tdx:_0x332324}=_0x2660e4,_0x46a0a0=_0x176235[0x0],_0x39c5f3=_0x56d291[_0x49e471(0x189)];if(!_0x39c5f3)return console[_0x49e471(0x115)](_0x49e471(0x19b)),console[_0x49e471(0x115)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x2ee023=await withSpinner(_0x49e471(0x1ec),()=>_0x332324[_0x49e471(0x1f7)][_0x49e471(0x14e)](_0x39c5f3),{'verbose':_0x56d291[_0x49e471(0x125)]}),_0x1df356=_0x2ee023[_0x49e471(0x1c3)];_0x56d291[_0x49e471(0x125)]&&(console[_0x49e471(0x115)](_0x49e471(0x204)+_0x39c5f3+'\x20(ID:\x20'+_0x1df356+')'),_0x46a0a0&&console['error'](_0x49e471(0x158)+_0x46a0a0));const _0x5eb581=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x332324[_0x49e471(0x1f7)][_0x49e471(0x1fd)](_0x1df356),{'verbose':_0x56d291[_0x49e471(0x125)]}),_0x44ff6c=_0x5eb581['data'],_0x146411=_0x44ff6c[_0x49e471(0x192)],_0x301696=await withSpinner(_0x49e471(0x144),()=>_0x332324['journey'][_0x49e471(0x1fa)](_0x1df356,_0x146411),{'verbose':_0x56d291[_0x49e471(0x125)]});let _0x17883e=_0x301696[_0x49e471(0x1c3)][_0x49e471(0x163)];const _0x4a3dad=_0x301696['data'][_0x49e471(0x148)],_0x5905e7=new Map();for(const _0x27ea4c of _0x4a3dad){_0x5905e7[_0x49e471(0x1ad)](_0x27ea4c['id'],_0x27ea4c[_0x49e471(0x12f)]);}if(_0x46a0a0){const _0x54a579=globToRegex(_0x46a0a0);_0x17883e=_0x17883e[_0x49e471(0xfe)](_0x5b84ba=>_0x54a579[_0x49e471(0x13b)](_0x5b84ba['journeyBundleName']));}console[_0x49e471(0x115)](_0x49e471(0x1b4)+_0x17883e[_0x49e471(0x13d)]+_0x49e471(0x1d5)+(_0x17883e[_0x49e471(0x13d)]!==0x1?'s':''));const _0xc4f6d5=_0x24b114=>{const _0x107fa9=_0x49e471;return getConsoleNextUrl(_0x56d291[_0x107fa9(0x1f1)],'/app/ps/'+_0x1df356+_0x107fa9(0x16e)+_0x24b114+_0x107fa9(0x13a));};if(_0x56d291['format']===_0x49e471(0x106))await handleSDKOutput(_0x17883e,_0x56d291);else{if(_0x56d291[_0x49e471(0x1fb)]===_0x49e471(0x1cd)){const _0x512bd7=_0x17883e[_0x49e471(0x17f)](_0x2dc17f=>({..._0x2dc17f,'url':_0xc4f6d5(_0x2dc17f['id'])}));await handleSDKOutput(_0x512bd7,_0x56d291);}else{console[_0x49e471(0xf8)]('['+_0x39c5f3+']');const _0x2b63bf=new Map(),_0x364b71=[];for(const _0x253493 of _0x17883e){if(!_0x253493[_0x49e471(0x1c8)]||_0x253493['folderId']===_0x146411)_0x364b71['push'](_0x253493);else{const _0x1a76e0=_0x2b63bf[_0x49e471(0x1c7)](_0x253493[_0x49e471(0x1c8)])||[];_0x1a76e0[_0x49e471(0x11f)](_0x253493),_0x2b63bf[_0x49e471(0x1ad)](_0x253493[_0x49e471(0x1c8)],_0x1a76e0);}}const _0x151c1e=(_0x554818,_0x29f155)=>_0x554818[_0x49e471(0x175)][_0x49e471(0x14a)](_0x29f155[_0x49e471(0x175)],undefined,{'sensitivity':'base'});_0x364b71[_0x49e471(0x1d6)](_0x151c1e);for(const _0x12b7fa of _0x364b71){console[_0x49e471(0xf8)](formatJourneyItem(_0x12b7fa,'',_0xc4f6d5(_0x12b7fa['id'])));}const _0x1fb007=[..._0x2b63bf['entries']()][_0x49e471(0x1d6)]((_0x4aec54,_0x37077a)=>{const _0x43a820=_0x49e471,_0xea0cd6=_0x5905e7[_0x43a820(0x1c7)](_0x4aec54[0x0])||_0x4aec54[0x0],_0x6e39f1=_0x5905e7['get'](_0x37077a[0x0])||_0x37077a[0x0];return _0xea0cd6[_0x43a820(0x14a)](_0x6e39f1,undefined,{'sensitivity':_0x43a820(0x18d)});});for(const [_0x301b71,_0x4dd6fe]of _0x1fb007){const _0x13c0b1=_0x5905e7['get'](_0x301b71)||_0x301b71;console[_0x49e471(0xf8)](_0x49e471(0x155)+_0x13c0b1),_0x4dd6fe[_0x49e471(0x1d6)](_0x151c1e);for(const _0x51f08b of _0x4dd6fe){console[_0x49e471(0xf8)](formatJourneyItem(_0x51f08b,'\x20\x20',_0xc4f6d5(_0x51f08b['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x354a54(0x12f)]='journey:view';[a27_0x354a54(0x1bf)]='Show\x20journey\x20details';async[a27_0x354a54(0x138)](_0x4a58c3){const _0x6010cd=a27_0x354a54,{options:_0x473cf7,args:_0xbe58b5,tdx:_0x2a34d7}=_0x4a58c3,_0x2b507d=_0xbe58b5[0x0];if(!_0x2b507d)return console[_0x6010cd(0x115)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x6010cd(0x115)](_0x6010cd(0x109)),console[_0x6010cd(0x115)]('Options:'),console['error'](_0x6010cd(0x126)),0x1;_0x473cf7[_0x6010cd(0x125)]&&console[_0x6010cd(0x115)](_0x6010cd(0x113)+_0x2b507d);const {journeyId:_0x32b1c1,parentSegmentId:_0x67bb2a}=await resolveJourneyIdFromInput(_0x2b507d,_0x473cf7,_0x2a34d7);if(_0x473cf7['web']){const _0xb9c58b=getConsoleNextUrl(_0x473cf7[_0x6010cd(0x1f1)],_0x6010cd(0x1dd)+_0x67bb2a+_0x6010cd(0x16e)+_0x32b1c1+_0x6010cd(0x1e4));return console['error'](a27_0x5dfa1a[_0x6010cd(0x1a3)]('✔')+_0x6010cd(0x128)+a27_0x5dfa1a[_0x6010cd(0x20b)](_0xb9c58b)),openBrowser(_0xb9c58b),0x0;}const _0x267f9c=await withSpinner(_0x6010cd(0x1d7),()=>_0x2a34d7['journey']['getJourney'](_0x32b1c1),{'verbose':_0x473cf7['verbose']}),_0x1d84d5=_0x267f9c[_0x6010cd(0x1c3)],_0x9cd8e0=_0x473cf7['includeStats'];let _0x501dde;if(_0x9cd8e0)try{const _0x5315b4=await withSpinner(_0x6010cd(0x1be),()=>_0x2a34d7[_0x6010cd(0x14d)][_0x6010cd(0x1af)](_0x32b1c1),{'verbose':_0x473cf7[_0x6010cd(0x125)]});_0x501dde=_0x5315b4['data'];}catch{_0x473cf7['verbose']&&console[_0x6010cd(0x115)](_0x6010cd(0x10e));}const _0x1db36a=getConsoleNextUrl(_0x473cf7[_0x6010cd(0x1f1)],'/app/ps/'+_0x67bb2a+_0x6010cd(0x16e)+_0x32b1c1+_0x6010cd(0x1e4)),_0x23c7a6={'id':_0x1d84d5['id'],'name':_0x1d84d5['attributes']['name'],'description':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x1bf)],'state':_0x1d84d5['attributes'][_0x6010cd(0x1a0)],'paused':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x131)],'reentry_mode':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x19e)],'stages':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x1de)]?.['length']||0x0,..._0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x1e5)]&&{'goal':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x1e5)][_0x6010cd(0x12f)]},..._0x501dde&&{'statistics':{'size':_0x501dde[_0x6010cd(0x166)],'entered':_0x501dde['enteredSize'],'goal_achieved':_0x501dde['goalSize'],'completion_rate':_0x501dde[_0x6010cd(0x190)],'exit_or_jump':_0x501dde[_0x6010cd(0x1e9)],'exit_or_jump_rate':_0x501dde['exitOrJumpRate'],'stages':_0x501dde[_0x6010cd(0x132)]}},'url':_0x1db36a};return await handleSingleObjectOutput(_0x23c7a6,_0x473cf7),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x153);['description']=a27_0x354a54(0x1ac);async[a27_0x354a54(0x138)](_0x1e3c43){const _0x25e132=a27_0x354a54,{options:_0x3bbc0f,args:_0x2a76e8,tdx:_0xcbec4a}=_0x1e3c43,_0x300219=_0x2a76e8[0x0];if(!requireNameOrPath(_0x300219))return 0x1;_0x3bbc0f['verbose']&&console[_0x25e132(0x115)](_0x25e132(0x113)+_0x300219);const _0x1aad18=_0x3bbc0f,_0x5f4011=_0x1aad18['from'],_0x155b60=_0x1aad18['to'],_0x296e9b=_0x1aad18[_0x25e132(0xf5)],_0x4168a2=_0x1aad18[_0x25e132(0x170)];_0x296e9b&&!_0x5f4011&&!_0x155b60&&console[_0x25e132(0x115)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x187a02=_0x296e9b?withJsonFormat(_0x3bbc0f):_0x3bbc0f,{journeyId:_0x233b75,journeyName:_0x392f64}=await resolveJourneyIdFromInput(_0x300219,_0x187a02,_0xcbec4a),_0x20f077=_0x5f4011||_0x155b60?{'from':_0x5f4011,'to':_0x155b60}:undefined,_0x1d576f=await withSpinner(_0x25e132(0x1be),()=>Promise[_0x25e132(0x161)]([_0xcbec4a[_0x25e132(0x14d)]['getJourney'](_0x233b75),_0xcbec4a[_0x25e132(0x14d)][_0x25e132(0x1af)](_0x233b75,_0x20f077)]),{'verbose':_0x187a02[_0x25e132(0x125)]}),[_0x3a9701,_0x334f7d]=_0x1d576f[_0x25e132(0x1c3)];if(!_0x334f7d||_0x334f7d['journeyId']===null)return console[_0x25e132(0x115)](_0x25e132(0x1b3)+_0x392f64),console[_0x25e132(0x115)](_0x25e132(0x165)),0x0;const _0x34a585=buildStageNameMap(_0x3a9701),_0x3890b2=!!(_0x20f077&&_0x334f7d[_0x25e132(0x11e)]?.['length']),_0x21f155={'stageNameMap':_0x34a585,'hasPeriod':_0x3890b2,'includeHistory':!!_0x296e9b};if(_0x4168a2&&_0x334f7d['stages']){const _0x44299e=_0x334f7d[_0x25e132(0x132)][_0x25e132(0x196)](_0x57c692=>{const _0x5b5f41=_0x25e132,_0x5effea=_0x34a585[_0x5b5f41(0x1c7)](_0x57c692['id'])??'';return _0x5effea['toLowerCase']()===_0x4168a2['toLowerCase']();});if(_0x44299e)return await handleSingleObjectOutput(formatStageStats(_0x44299e,_0x21f155),_0x187a02),0x0;const _0x2a7247=_0x334f7d['stages'][_0x25e132(0x17f)](_0x317663=>_0x34a585[_0x25e132(0x1c7)](_0x317663['id'])??_0x317663['id']);return console[_0x25e132(0x115)]('Error:\x20Stage\x20\x22'+_0x4168a2+_0x25e132(0x1a5)),console[_0x25e132(0x115)]('Available\x20stages:\x20'+_0x2a7247[_0x25e132(0x151)](',\x20')),0x1;}const _0x309c12=_0x334f7d[_0x25e132(0x132)]?.[_0x25e132(0x17f)](_0x421490=>formatStageStats(_0x421490,_0x21f155)),_0x5e8c28=assembleJourneyStats(_0x334f7d,{'from':_0x5f4011,'to':_0x155b60,'includeHistory':_0x296e9b});return await this[_0x25e132(0x114)](_0x5e8c28,_0x309c12??[],_0x187a02),0x0;}async[a27_0x354a54(0x114)](_0x377ec0,_0x4a5513,_0x5eeaa5){const _0x7f4419=a27_0x354a54,_0x1b1518=_0x5eeaa5[_0x7f4419(0x1fb)]===_0x7f4419(0x1cd)||_0x5eeaa5['format']===_0x7f4419(0x15d)||_0x5eeaa5[_0x7f4419(0x1cd)]||_0x5eeaa5['jsonl'];if(_0x1b1518){_0x377ec0[_0x7f4419(0x132)]=_0x4a5513,await handleSingleObjectOutput(_0x377ec0,_0x5eeaa5);return;}await handleSingleObjectOutput(_0x377ec0,_0x5eeaa5);for(const _0x1d5995 of _0x4a5513){console['log'](''),console[_0x7f4419(0xf8)](String(a27_0x5dfa1a[_0x7f4419(0x20b)]['bold']('['+_0x1d5995[_0x7f4419(0x12f)]+']'))+a27_0x5dfa1a[_0x7f4419(0x19f)]('\x20'+_0x1d5995['id']));const {id:_0x27c611,name:_0x20b728,..._0x20460d}=_0x1d5995;await handleSingleObjectOutput(_0x20460d,_0x5eeaa5);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x354a54(0x12f)]='journey:traffic';[a27_0x354a54(0x1bf)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async['execute'](_0x305ae4){const _0x291390=a27_0x354a54,{options:_0x343620,args:_0x5d4a28,tdx:_0x55b1cd}=_0x305ae4,_0x13daa0=_0x5d4a28[0x0];if(!requireNameOrPath(_0x13daa0))return 0x1;_0x343620['verbose']&&console[_0x291390(0x115)](_0x291390(0x113)+_0x13daa0);const _0x50ca9d=_0x343620,_0x16be75=_0x50ca9d[_0x291390(0x12a)],_0x67589d=_0x50ca9d[_0x291390(0x178)],_0x1d7ba6=_0x50ca9d['to'],_0x1e8e96=_0x50ca9d[_0x291390(0x152)];if(_0x16be75&&_0x16be75!==_0x291390(0x1bc)&&_0x16be75!==_0x291390(0x16b))return console[_0x291390(0x115)](_0x291390(0x184)+_0x16be75+_0x291390(0x110)),0x1;const _0x14a053=withJsonFormat(_0x343620),{journeyId:_0xee832,journeyName:_0x249fba}=await resolveJourneyIdFromInput(_0x13daa0,_0x14a053,_0x55b1cd),_0x489801={'type':_0x16be75,'from':_0x67589d,'to':_0x1d7ba6,'limit':_0x1e8e96},_0x302f75=await withSpinner(_0x291390(0x18f),()=>_0x55b1cd[_0x291390(0x14d)][_0x291390(0x171)](_0xee832,_0x489801),{'verbose':_0x14a053['verbose']}),_0x3d949c=_0x302f75[_0x291390(0x1c3)],_0x1418da=_0x3d949c[_0x291390(0x1bc)]&&(_0x3d949c[_0x291390(0x1bc)][_0x291390(0x1b0)][_0x291390(0x13d)]>0x0||_0x3d949c['conversion'][_0x291390(0x145)][_0x291390(0x13d)]>0x0),_0x21a1a3=_0x3d949c[_0x291390(0x16b)]&&_0x3d949c['activation'][_0x291390(0x13d)]>0x0;if(!_0x1418da&&!_0x21a1a3)return console[_0x291390(0x115)](_0x291390(0x1df)+_0x249fba),console[_0x291390(0x115)](_0x291390(0x1e2)),_0x67589d&&_0x1d7ba6&&console[_0x291390(0x115)]('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(_0x3d949c,_0x14a053),0x0;}}function formatStageStats(_0x2bb10e,_0x11ddf8){const _0x28e549=a27_0x354a54,_0x15503f=_0x11ddf8[_0x28e549(0x1f8)]&&_0x2bb10e[_0x28e549(0x11e)]?.['length']?aggregateStageHistory(_0x2bb10e[_0x28e549(0x11e)]):{'size':_0x2bb10e[_0x28e549(0x166)],'entered':_0x2bb10e[_0x28e549(0xfd)],'milestone':_0x2bb10e[_0x28e549(0x1da)],'milestone_rate':_0x2bb10e[_0x28e549(0x181)],'exit_or_jump':_0x2bb10e[_0x28e549(0x1e9)],'exit_or_jump_rate':_0x2bb10e[_0x28e549(0x160)]},_0x491613={'id':_0x2bb10e['id'],'name':_0x11ddf8[_0x28e549(0x169)][_0x28e549(0x1c7)](_0x2bb10e['id'])??_0x2bb10e['id'],..._0x15503f};return _0x11ddf8[_0x28e549(0x1f8)]&&_0x11ddf8[_0x28e549(0xf5)]&&_0x2bb10e['history']&&(_0x491613['history']=_0x2bb10e['history']),_0x491613;}export class JourneyPauseCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x168);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x1ca);async['execute'](_0x5bd0a0){const _0x16d7d3=a27_0x354a54,{options:_0x17cb0d,args:_0x44eec5,tdx:_0x5df25a}=_0x5bd0a0,_0x14f68e=_0x44eec5[0x0];if(!requireNameOrPath(_0x14f68e))return 0x1;_0x17cb0d['verbose']&&console[_0x16d7d3(0x115)]('Input:\x20'+_0x14f68e);const {journeyId:_0xfdc679,journeyName:_0x49a566}=await resolveJourneyIdFromInput(_0x14f68e,_0x17cb0d,_0x5df25a);if(!_0x17cb0d[_0x16d7d3(0x139)]){const _0x1f3a6c=await confirm(_0x16d7d3(0x1ba)+_0x49a566+'\x22?');if(!_0x1f3a6c)return console[_0x16d7d3(0x115)](_0x16d7d3(0x13f)),0x0;}const _0x32f37f=await withSpinner(_0x16d7d3(0x16a),()=>_0x5df25a[_0x16d7d3(0x14d)][_0x16d7d3(0x1ea)](_0xfdc679),{'verbose':_0x17cb0d[_0x16d7d3(0x125)]}),_0x38d185=_0x32f37f[_0x16d7d3(0x1c3)];return console[_0x16d7d3(0x115)](_0x16d7d3(0x1b2)+_0x38d185[_0x16d7d3(0x17e)]['name']+_0x16d7d3(0x200)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x1d4);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x147);async['execute'](_0x205fcc){const _0x4e66ca=a27_0x354a54,{options:_0x3c7a67,args:_0x55d1bf,tdx:_0x152494}=_0x205fcc,_0x22cc35=_0x55d1bf[0x0];if(!requireNameOrPath(_0x22cc35))return 0x1;_0x3c7a67[_0x4e66ca(0x125)]&&console['error'](_0x4e66ca(0x113)+_0x22cc35);const {journeyId:_0x432766,journeyName:_0x2ffb0e}=await resolveJourneyIdFromInput(_0x22cc35,_0x3c7a67,_0x152494);if(!_0x3c7a67[_0x4e66ca(0x139)]){const _0x3c9e70=await confirm(_0x4e66ca(0x162)+_0x2ffb0e+'\x22?');if(!_0x3c9e70)return console[_0x4e66ca(0x115)](_0x4e66ca(0x13f)),0x0;}const _0x53b588=await withSpinner(_0x4e66ca(0x1d0),()=>_0x152494['journey'][_0x4e66ca(0x1f2)](_0x432766),{'verbose':_0x3c7a67[_0x4e66ca(0x125)]}),_0x2cca73=_0x53b588['data'];return console['error'](_0x4e66ca(0x1b2)+_0x2cca73[_0x4e66ca(0x17e)]['name']+_0x4e66ca(0x1b6)),0x0;}}function a27_0x47c0(_0x2a0655,_0x26462c){_0x2a0655=_0x2a0655-0xf2;const _0x4c19bd=a27_0x4c19();let _0x47c0cf=_0x4c19bd[_0x2a0655];return _0x47c0cf;}export class JourneyPullCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x167);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x1c4);async[a27_0x354a54(0x138)](_0x2855fd){const _0x313c01=a27_0x354a54,{options:_0x236083,args:_0x176493,tdx:_0x4f34de}=_0x2855fd,_0x456ab9=_0x236083,_0x24ef79=_0x176493[0x0],_0x356c5a=_0x24ef79&&isYamlFilePath(_0x24ef79),_0x15262b=await resolveTarget({'arg':_0x356c5a?_0x24ef79:undefined,'contextParent':_0x236083[_0x313c01(0x189)],'cwd':process[_0x313c01(0x1c9)]()});if(!isSuccessfulResolution(_0x15262b))return _0x15262b[_0x313c01(0x172)]===_0x313c01(0x1a2)?(console['error'](a27_0x5dfa1a[_0x313c01(0x179)](_0x313c01(0xf2))),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[_0x313c01(0x115)](_0x313c01(0x102)),console['error'](_0x313c01(0x1a4)),console[_0x313c01(0x115)](_0x313c01(0x1a1))):(console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x120)](_0x313c01(0x135)+_0x15262b[_0x313c01(0x14b)]+'\x0a')),_0x15262b[_0x313c01(0x1d2)]&&console[_0x313c01(0x115)](a27_0x5dfa1a['cyan'](_0x15262b[_0x313c01(0x1d2)]))),0x1;let _0x4649a8=_0x356c5a?undefined:_0x24ef79,_0x3c66e6,_0x44ca81;_0x15262b[_0x313c01(0x12a)]===_0x313c01(0x193)&&(_0x4649a8=_0x15262b[_0x313c01(0x1d3)],_0x3c66e6=_0x15262b['filePath'],_0x44ca81=_0x15262b[_0x313c01(0x198)]);const _0x1a337d=_0x15262b[_0x313c01(0x205)],_0x126c33=_0x15262b[_0x313c01(0xfc)];_0x456ab9[_0x313c01(0x125)]&&(console['error'](_0x313c01(0x204)+_0x1a337d),console[_0x313c01(0x115)](_0x313c01(0x107)+_0x126c33),_0x4649a8&&console[_0x313c01(0x115)](_0x313c01(0x123)+_0x4649a8),_0x3c66e6&&console[_0x313c01(0x115)](_0x313c01(0x1eb)+_0x3c66e6),_0x44ca81&&console['error']('Folder\x20path:\x20'+_0x44ca81));const _0x5e9d59=await withSpinner(_0x313c01(0x1ec),()=>_0x4f34de[_0x313c01(0x1f7)][_0x313c01(0x14e)](_0x1a337d),{'verbose':_0x236083[_0x313c01(0x125)]}),_0x358205=_0x5e9d59['data'],{journeys:_0x25392d,folders:_0x26bcba}=await withSpinner(_0x313c01(0x197),async()=>{const _0x4b7ff2=_0x313c01,[_0xdf7aea,_0x183818]=await Promise['all']([_0x4f34de['journey'][_0x4b7ff2(0x1fc)](_0x358205,undefined,{'includeAllVersions':!![]}),_0x4f34de[_0x4b7ff2(0x1f7)][_0x4b7ff2(0x130)](_0x358205)]);return{'journeys':_0xdf7aea,'folders':_0x183818};},{'verbose':_0x236083[_0x313c01(0x125)]})['then'](_0x53bb2d=>_0x53bb2d[_0x313c01(0x1c3)]);let _0x2a8698=_0x25392d;const _0x387d13=buildFolderIdToPathMap(_0x26bcba);if(_0x4649a8){const _0x40bf26=_0x2a8698[_0x313c01(0xfe)](_0x32fa39=>_0x32fa39['journeyBundleName']['toLowerCase']()===_0x4649a8[_0x313c01(0x185)]());if(_0x40bf26[_0x313c01(0x13d)]===0x0)return console['error'](_0x313c01(0x186)+_0x4649a8),console[_0x313c01(0x115)](_0x313c01(0x1cb)),0x1;_0x2a8698=_0x40bf26;}if(_0x44ca81!==undefined){const _0x3e39c8=_0x2a8698[_0x313c01(0xfe)](_0x553c59=>{const _0x22eaaf=_0x313c01,_0x3e278b=_0x553c59[_0x22eaaf(0x1c8)]?_0x387d13[_0x22eaaf(0x1c7)](_0x553c59[_0x22eaaf(0x1c8)])||'':'';return _0x3e278b===_0x44ca81;});if(_0x3e39c8[_0x313c01(0x13d)]===0x0&&_0x2a8698['length']>0x0){console[_0x313c01(0x115)](_0x313c01(0x19a)+_0x4649a8+'\x27\x20not\x20found\x20in\x20'+(_0x44ca81||_0x313c01(0x11d))),console[_0x313c01(0x115)](_0x313c01(0xf6));for(const _0x590b47 of _0x2a8698){const _0x51ef42=_0x590b47[_0x313c01(0x1c8)]?_0x387d13[_0x313c01(0x1c7)](_0x590b47[_0x313c01(0x1c8)])||'':'';console[_0x313c01(0x115)](_0x313c01(0x195)+(_0x51ef42||_0x313c01(0x11a))+'/'+_0x590b47[_0x313c01(0x175)]);}return 0x1;}_0x2a8698=_0x3e39c8;}if(_0x2a8698['length']===0x0)return console[_0x313c01(0x115)]('No\x20journeys\x20found'),0x0;const _0x56ec78=new Map();for(const _0x2cd1c2 of _0x2a8698){const _0x346984=_0x2cd1c2[_0x313c01(0x10b)];!_0x56ec78[_0x313c01(0x187)](_0x346984)&&_0x56ec78[_0x313c01(0x1ad)](_0x346984,[]),_0x56ec78['get'](_0x346984)[_0x313c01(0x11f)](_0x2cd1c2);}for(const _0x276325 of _0x56ec78[_0x313c01(0x10f)]()){_0x276325['sort']((_0x527be4,_0x368667)=>(_0x527be4[_0x313c01(0x150)]||0x0)-(_0x368667['versionNumber']||0x0));}const _0x50c544=[],{idToEmailMap:_0x4d1f41,connectionIdToNameMap:_0x49fb36}=await withSpinner(_0x313c01(0x1cc),async()=>{const _0x283a35=_0x313c01,[_0x895a7f,_0x7ea5ef]=await Promise[_0x283a35(0x161)]([_0x4f34de[_0x283a35(0x164)][_0x283a35(0x1e6)](),_0x4f34de[_0x283a35(0x1ff)][_0x283a35(0x111)]()]);return{'idToEmailMap':_0x895a7f,'connectionIdToNameMap':_0x7ea5ef};},{'verbose':_0x236083[_0x313c01(0x125)]})[_0x313c01(0x1ef)](_0x11cb56=>_0x11cb56['data']);for(const _0x1f9231 of _0x56ec78[_0x313c01(0x10f)]()){const _0xd27d2b=_0x1f9231[0x0][_0x313c01(0x175)],_0x540aa6=_0x1f9231[0x0][_0x313c01(0x1c8)],_0x2b4742=_0x540aa6?_0x387d13[_0x313c01(0x1c7)](_0x540aa6)||'':'',_0x2ccdad=_0x2b4742?a27_0x40bb69['join'](_0x126c33,_0x2b4742):_0x126c33,_0x16d04c=_0x3c66e6||a27_0x40bb69[_0x313c01(0x151)](_0x2ccdad,sanitizeFileName(_0xd27d2b)+_0x313c01(0x10d));let _0x1d572d,_0x1ef7e9;if(existsSync(_0x16d04c))try{const _0x18f90b=readFileSync(_0x16d04c,'utf-8'),_0x41ce0a=parseYamlString(_0x18f90b);_0x1ef7e9=_0x41ce0a,_0x1d572d=buildRuleToNameMapping(_0x41ce0a),_0x456ab9['verbose']&&_0x1d572d[_0x313c01(0x166)]>0x0&&console[_0x313c01(0x115)](_0x313c01(0x122)+_0x1d572d[_0x313c01(0x166)]+_0x313c01(0x1fe)+_0xd27d2b);}catch(_0x3bd945){_0x456ab9[_0x313c01(0x125)]&&console[_0x313c01(0x115)](_0x313c01(0x1ed)+_0x3bd945[_0x313c01(0x14b)]);}const _0x4c4266=[],_0x4e196f=new Set(),_0x41734e=new Map(),_0x277a8e=new Map(),_0x357391=new Set(),_0x426bc5=new Map(),_0x2920aa=new Map(),_0x16b35e=createJumpTargetCache();await withProgressSpinner(_0x313c01(0x15a)+_0xd27d2b+_0x313c01(0x1d9),async _0x3f6107=>{const _0x3ea60b=_0x313c01;for(const _0x296501 of _0x1f9231){const _0x5c96b7=_0x1f9231[_0x3ea60b(0x13d)]>0x1?_0x296501[_0x3ea60b(0x175)]+'\x20v'+(_0x296501['versionNumber']||0x1):_0x296501[_0x3ea60b(0x175)];_0x3f6107[_0x3ea60b(0x13e)](_0x3ea60b(0x15a)+_0x5c96b7);const _0x12dc13=await _0x4f34de[_0x3ea60b(0x14d)]['getJourney'](_0x296501['id']),_0x2485de=_0x12dc13[_0x3ea60b(0x17e)]?.[_0x3ea60b(0x1c1)],_0x3593a4={'resolveSegment':async _0x44b4e9=>{const _0x1c727d=_0x3ea60b;if(!_0x2485de)return{'name':_0x44b4e9,'isJourneyLocal':![]};const _0x39401b=_0x41734e[_0x1c727d(0x1c7)](_0x44b4e9);if(_0x39401b)return _0x39401b;try{const _0x1a691a=await _0x4f34de[_0x1c727d(0x1f7)][_0x1c727d(0x1b8)](_0x2485de,_0x44b4e9),_0x2e57b1=_0x1a691a[_0x1c727d(0x17c)]===SEGMENT_KIND_JOURNEY;let _0x557216,_0x737902=_0x1a691a[_0x1c727d(0x12f)];if(_0x2e57b1&&_0x1a691a['rule']){const _0x33871b=await segmentResponseToDef(_0x1a691a,{'resolveSegmentName':async _0x250c50=>{const _0x17b3c2=_0x1c727d,_0x1e5eab=_0x41734e[_0x17b3c2(0x1c7)](_0x250c50);if(_0x1e5eab)return _0x1e5eab['name'];const _0x204618=await _0x3593a4['resolveSegment'](_0x250c50);return _0x204618['name'];}}),_0x8ce530=_0x33871b['rule'];_0x557216={'description':_0x1a691a['description'],'rule':_0x8ce530};const _0x540f5c=serializeRule(_0x8ce530),_0x4b4360=_0x277a8e[_0x1c727d(0x1c7)](_0x540f5c);if(_0x4b4360)_0x737902=_0x4b4360,_0x557216=undefined,_0x456ab9[_0x1c727d(0x125)]&&console[_0x1c727d(0x115)](_0x1c727d(0x133)+_0x1a691a[_0x1c727d(0x12f)]+_0x1c727d(0x1db)+_0x4b4360);else{let _0x8a7a1d=![];if(_0x1d572d){const _0x529bcf=_0x1d572d['get'](_0x540f5c);if(_0x529bcf){const _0x259726=_0x529bcf[_0x1c727d(0x196)](_0x5159fb=>!_0x4e196f[_0x1c727d(0x187)](_0x5159fb));_0x259726&&(_0x737902=_0x259726,_0x4e196f[_0x1c727d(0x108)](_0x259726),_0x277a8e[_0x1c727d(0x1ad)](_0x540f5c,_0x259726),_0x8a7a1d=!![],_0x456ab9[_0x1c727d(0x125)]&&console[_0x1c727d(0x115)](_0x1c727d(0xf9)+_0x259726+'\x20(rule\x20match)'));}}if(!_0x8a7a1d){const _0x174e2e=generateJourneyLocalName(_0x1a691a[_0x1c727d(0x12f)]);_0x174e2e&&(_0x737902=_0x174e2e);let _0x4f75b9=_0x737902,_0x406c56=0x2;while(_0x4e196f[_0x1c727d(0x187)](_0x4f75b9)){_0x4f75b9=_0x737902+'_'+_0x406c56,_0x406c56++;}_0x4e196f[_0x1c727d(0x108)](_0x4f75b9),_0x277a8e[_0x1c727d(0x1ad)](_0x540f5c,_0x4f75b9),_0x737902=_0x4f75b9;}}}const _0x4c94b4={'name':_0x737902,'isJourneyLocal':_0x2e57b1,'definition':_0x557216};return _0x41734e[_0x1c727d(0x1ad)](_0x44b4e9,_0x4c94b4),_0x4c94b4;}catch(_0x9945a1){return _0x236083['verbose']&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x44b4e9+':\x20'+_0x9945a1[_0x1c727d(0x14b)]),{'name':_0x44b4e9,'isJourneyLocal':![]};}},'resolveActivation':async _0x7611b8=>{const _0x1c6c76=_0x3ea60b,_0x41f0d6=_0x426bc5[_0x1c6c76(0x1c7)](_0x7611b8);if(_0x41f0d6)return _0x41f0d6;try{const _0xf1f7e0=await _0x4f34de[_0x1c6c76(0x14d)]['getActivation'](_0x296501['id'],_0x7611b8),_0xb50135=journeyActivationStepToYaml(_0xf1f7e0,_0x4d1f41,_0x49fb36),_0x1f4f03=JSON[_0x1c6c76(0x1f0)]({'name':_0xb50135[_0x1c6c76(0x12f)],'connection':_0xb50135['connection'],'connector_config':_0xb50135[_0x1c6c76(0x10c)]}),_0x50c9e5=_0x2920aa[_0x1c6c76(0x1c7)](_0x1f4f03);if(_0x50c9e5){const _0x81da69={'name':_0x50c9e5,'isJourneyLocal':!![],'definition':_0xb50135};return _0x426bc5[_0x1c6c76(0x1ad)](_0x7611b8,_0x81da69),_0x81da69;}const _0x58a7a6=_0xf1f7e0[_0x1c6c76(0x17e)][_0x1c6c76(0x1b9)][_0x1c6c76(0x12f)]||_0x7611b8,_0x3aaf64=sanitizeYamlKey(_0x58a7a6)||_0x1c6c76(0x208)+_0x7611b8;let _0x39c01f=_0x3aaf64,_0x810dd0=0x2;while(_0x357391[_0x1c6c76(0x187)](_0x39c01f)){_0x39c01f=_0x3aaf64+'_'+_0x810dd0,_0x810dd0++;}_0x357391[_0x1c6c76(0x108)](_0x39c01f),_0x2920aa[_0x1c6c76(0x1ad)](_0x1f4f03,_0x39c01f);const _0x3e4cf9={'name':_0x39c01f,'isJourneyLocal':!![],'definition':_0xb50135};return _0x426bc5[_0x1c6c76(0x1ad)](_0x7611b8,_0x3e4cf9),_0x3e4cf9;}catch(_0x6c8d42){return _0x236083[_0x1c6c76(0x125)]&&console['error'](_0x1c6c76(0x1e0)+_0x7611b8+':\x20'+_0x6c8d42[_0x1c6c76(0x14b)]),{'name':_0x7611b8,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x45cdcb,_0x53b8b8)=>{const _0xc4fcb3=_0x3ea60b;return resolveJumpTarget(_0x45cdcb,_0x53b8b8,_0x16b35e,_0x3ac0e4=>_0x4f34de['journey'][_0xc4fcb3(0xf3)](_0x3ac0e4));}},_0x3bd6aa=await journeyResponseToDef(_0x12dc13,_0x3593a4);_0x4c4266['push']({'item':_0x296501,'yaml':_0x3bd6aa});}},{'verbose':_0x236083[_0x313c01(0x125)]});const _0x5cd75b=await _0x4f34de[_0x313c01(0x14d)][_0x313c01(0x206)](_0x1f9231[0x0][_0x313c01(0x10b)]),_0x168cea=buildMergedJourneyDef(_0x4c4266,_0x1d572d,_0x5cd75b),_0x53549c=normalizeJourneyDef(_0x168cea,_0x1ef7e9),_0x16c69c=toYamlString(_0x53549c),_0x58a580=_0x3c66e6||a27_0x40bb69[_0x313c01(0x151)](_0x2ccdad,sanitizeFileName(_0xd27d2b)+'.yml');!_0x3c66e6&&_0x2b4742&&!existsSync(_0x2ccdad)&&mkdirSync(_0x2ccdad,{'recursive':!![]});const _0x50bac9=a27_0x40bb69[_0x313c01(0xff)](process[_0x313c01(0x1c9)](),_0x58a580);if(existsSync(_0x58a580)){const _0x2d6d34=readFileSync(_0x58a580,_0x313c01(0x207)),_0x13b5ca=generateDiff(_0x2d6d34,_0x16c69c),_0x62de6c=hasChanges(_0x13b5ca);_0x50c544[_0x313c01(0x11f)]({'relativePath':_0x50bac9,'absolutePath':_0x58a580,'content':_0x16c69c,'isNew':![],'hasChanges':_0x62de6c,'diff':_0x62de6c?formatDiffWithColors(_0x13b5ca):undefined});}else _0x50c544[_0x313c01(0x11f)]({'relativePath':_0x50bac9,'absolutePath':_0x58a580,'content':_0x16c69c,'isNew':!![],'hasChanges':![]});}const _0x14eb00=_0x50c544['filter'](_0x3bd531=>_0x3bd531[_0x313c01(0x1c2)]),_0xd01a2d=_0x50c544[_0x313c01(0xfe)](_0xb54b70=>!_0xb54b70[_0x313c01(0x1c2)]&&_0xb54b70[_0x313c01(0x136)]),_0x4b8a42=_0x50c544['filter'](_0x1e856b=>!_0x1e856b[_0x313c01(0x1c2)]&&!_0x1e856b[_0x313c01(0x136)]),_0x215da2=_0x2a8698[_0x313c01(0x13d)],_0x314225=_0x56ec78[_0x313c01(0x166)],_0x14f2ad=_0x215da2>_0x314225?'\x20('+_0x215da2+_0x313c01(0x1ae):'';console[_0x313c01(0x115)]('\x0aPull\x20summary:'),console[_0x313c01(0x115)]('\x20\x20'+a27_0x5dfa1a[_0x313c01(0x20b)](_0x314225+_0x313c01(0x19c))+a27_0x5dfa1a['dim'](_0x14f2ad)),console['error']('\x20\x20'+a27_0x5dfa1a['green']('+\x20'+_0x14eb00[_0x313c01(0x13d)]+_0x313c01(0xfa))),console[_0x313c01(0x115)]('\x20\x20'+a27_0x5dfa1a['yellow']('~\x20'+_0xd01a2d[_0x313c01(0x13d)]+_0x313c01(0x18e))),console[_0x313c01(0x115)]('\x20\x20'+a27_0x5dfa1a[_0x313c01(0x19f)]('=\x20'+_0x4b8a42[_0x313c01(0x13d)]+_0x313c01(0xf7))),console[_0x313c01(0x115)](_0x313c01(0x17d)+a27_0x5dfa1a['cyan'](_0x126c33)+'\x0a');if(_0xd01a2d['length']>0x0)for(const _0x22dc23 of _0xd01a2d){console['error'](_0x313c01(0x1e1)+_0x22dc23[_0x313c01(0x1d1)]+'\x27:'),console[_0x313c01(0x115)]('─'[_0x313c01(0x121)](0x3c)),console[_0x313c01(0x115)](_0x22dc23['diff']),console[_0x313c01(0x115)]('─'[_0x313c01(0x121)](0x3c));}if(_0x456ab9[_0x313c01(0x129)])return console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x179)](_0x313c01(0x17b))),0x0;if(_0x14eb00['length']===0x0&&_0xd01a2d[_0x313c01(0x13d)]===0x0)return console['error'](a27_0x5dfa1a['green'](_0x313c01(0x12c))),saveSessionContext({'parent_segment':_0x1a337d},_0x456ab9[_0x313c01(0x154)]),console['error'](a27_0x5dfa1a[_0x313c01(0x1a3)](_0x313c01(0x12d)+a27_0x5dfa1a[_0x313c01(0x19f)](_0x313c01(0x15c))+_0x313c01(0x1a7)+a27_0x5dfa1a['cyan'](_0x1a337d))),0x0;if(!_0x456ab9['yes']&&(_0x14eb00[_0x313c01(0x13d)]>0x0||_0xd01a2d[_0x313c01(0x13d)]>0x0)){if(!isInteractive())return console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x120)](_0x313c01(0x11b)),_0x313c01(0x14c)),console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x19f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x24fe8f=await confirmKey('Write\x20'+(_0x14eb00[_0x313c01(0x13d)]+_0xd01a2d[_0x313c01(0x13d)])+_0x313c01(0x173));if(!_0x24fe8f)return console['error'](a27_0x5dfa1a[_0x313c01(0x179)](_0x313c01(0x141)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x126c33)&&mkdirSync(_0x126c33,{'recursive':!![]});const _0x361fe1=a27_0x40bb69[_0x313c01(0x151)](_0x126c33,_0x313c01(0x103));writeFileSync(_0x361fe1,createTdxConfigContent(_0x1a337d),_0x313c01(0x207));for(const _0x4eeeb7 of _0x50c544){(_0x4eeeb7['isNew']||_0x4eeeb7['hasChanges'])&&writeFileSync(_0x4eeeb7[_0x313c01(0x18b)],_0x4eeeb7[_0x313c01(0x16d)],_0x313c01(0x207));}return console[_0x313c01(0x115)](a27_0x5dfa1a['green'](_0x313c01(0x14f)+(_0x14eb00[_0x313c01(0x13d)]+_0xd01a2d[_0x313c01(0x13d)])+_0x313c01(0x201)+_0x126c33)),saveSessionContext({'parent_segment':_0x1a337d},_0x456ab9[_0x313c01(0x154)]),console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x1a3)]('✔\x20Context\x20set:\x20'+a27_0x5dfa1a['dim'](_0x313c01(0x15c))+_0x313c01(0x1a7)+a27_0x5dfa1a[_0x313c01(0x20b)](_0x1a337d))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x1c5);[a27_0x354a54(0x1bf)]='Show\x20journey\x20table\x20column\x20mapping';async['execute'](_0x3b4f75){const _0x57591e=a27_0x354a54,{options:_0x515d4c,args:_0x5d9e4d,tdx:_0x1958c6}=_0x3b4f75,_0x5aa7f4=_0x5d9e4d[0x0];if(!requireNameOrPath(_0x5aa7f4))return 0x1;_0x515d4c[_0x57591e(0x125)]&&console['error'](_0x57591e(0x113)+_0x5aa7f4);const {journeyId:_0x532e6b}=await resolveJourneyIdFromInput(_0x5aa7f4,_0x515d4c,_0x1958c6),_0x2cd468=await withSpinner('Getting\x20column\x20mapping...',()=>_0x1958c6[_0x57591e(0x14d)][_0x57591e(0xf4)](_0x532e6b),{'verbose':_0x515d4c['verbose']}),_0x59f3e1=_0x2cd468[_0x57591e(0x1c3)];return console[_0x57591e(0xf8)](_0x57591e(0x1f9)+_0x59f3e1[_0x57591e(0x117)]),console[_0x57591e(0xf8)]('Table:\x20'+_0x59f3e1['table']),await handleSDKOutput(_0x59f3e1[_0x57591e(0x203)],_0x515d4c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a27_0x354a54(0x1bf)]=a27_0x354a54(0x1bb);async['execute'](_0x54f361){const _0x1c366e=a27_0x354a54,{options:_0x33c2a3,args:_0x227139,tdx:_0x524aab}=_0x54f361,_0x58420a=_0x227139[0x0];if(!requireNameOrPath(_0x58420a))return 0x1;_0x33c2a3[_0x1c366e(0x125)]&&console[_0x1c366e(0x115)](_0x1c366e(0x113)+_0x58420a);const {journeyId:_0x471936}=await resolveJourneyIdFromInput(_0x58420a,_0x33c2a3,_0x524aab),_0x5119ac=await withSpinner('Listing\x20journey\x20activations...',()=>_0x524aab[_0x1c366e(0x14d)][_0x1c366e(0x12e)](_0x471936),{'verbose':_0x33c2a3[_0x1c366e(0x125)]}),_0x546a90=_0x5119ac['data'];return console['error'](_0x1c366e(0x122)+_0x546a90['length']+_0x1c366e(0x112)+(_0x546a90['length']!==0x1?'s':'')),await handleSDKOutput(_0x546a90,_0x33c2a3),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x1a8);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x137);[a27_0x354a54(0x1ce)]=new SegmentPushCommand();async[a27_0x354a54(0x138)](_0x2f05a9){const _0x262029=a27_0x354a54,_0x3c8607=_0x2f05a9[_0x262029(0x1e3)][0x0];let _0x2d4c07;if(_0x3c8607){const _0x4611ec=await resolveTarget({'arg':_0x3c8607,'contextParent':_0x2f05a9[_0x262029(0x176)]['parentSegment'],'cwd':process['cwd']()});isSuccessfulResolution(_0x4611ec)&&_0x4611ec[_0x262029(0x12a)]==='file'&&(_0x2d4c07=_0x4611ec[_0x262029(0x180)]);}const _0x1b5ae3={..._0x2f05a9,'options':{..._0x2f05a9[_0x262029(0x176)],'journeysOnly':!![],..._0x2d4c07&&{'singleFilePath':_0x2d4c07}}};return this[_0x262029(0x1ce)][_0x262029(0x138)](_0x1b5ae3);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x156);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x19d);async[a27_0x354a54(0x138)](_0x13f668){const _0x5edd0c=a27_0x354a54,{options:_0x4bd55c,args:_0x17d131,tdx:_0x236b50}=_0x13f668,_0x518219=_0x17d131[0x0];if(!requireNameOrPath(_0x518219))return 0x1;if(_0x4bd55c['verbose'])console[_0x5edd0c(0x115)]('Input:\x20'+_0x518219);const {journeyId:_0x2df839}=await resolveJourneyIdFromInput(_0x518219,_0x4bd55c,_0x236b50),_0x118cc2=await withSpinner('Listing\x20journey\x20versions...',()=>_0x236b50[_0x5edd0c(0x14d)]['listVersions'](_0x2df839),{'verbose':_0x4bd55c[_0x5edd0c(0x125)]}),{bundleName:_0x308029,versions:_0x57bec1,latestJourneyId:_0x2ef940}=_0x118cc2[_0x5edd0c(0x1c3)];console[_0x5edd0c(0x115)](_0x308029+':\x20'+_0x57bec1[_0x5edd0c(0x13d)]+_0x5edd0c(0x1e8)+(_0x57bec1[_0x5edd0c(0x13d)]!==0x1?'s':''));const _0x487edc=_0x57bec1['map'](_0x1ba13d=>({'version':_0x1ba13d['versionNumber'],'journey_id':_0x1ba13d['journeyId'],'name':_0x1ba13d[_0x5edd0c(0x12f)],'state':_0x1ba13d[_0x5edd0c(0x1a0)],'paused':_0x1ba13d[_0x5edd0c(0x131)],'latest':_0x1ba13d[_0x5edd0c(0x100)]===_0x2ef940,'created_at':_0x1ba13d[_0x5edd0c(0x143)]}));return await handleSDKOutput(_0x487edc,_0x4bd55c),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x16f);[a27_0x354a54(0x1bf)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x354a54(0x138)](_0x20ea5d){const _0xa8bc66=a27_0x354a54,{options:_0x56c2c5,args:_0x576525,tdx:_0x18d6f7}=_0x20ea5d,_0x492d68=_0x576525[0x0];if(!requireNameOrPath(_0x492d68))return 0x1;if(_0x56c2c5[_0xa8bc66(0x125)])console[_0xa8bc66(0x115)](_0xa8bc66(0x113)+_0x492d68);const {journeyId:_0x266f96,journeyName:_0x58f18d}=await resolveJourneyIdFromInput(_0x492d68,_0x56c2c5,_0x18d6f7);if(!_0x56c2c5[_0xa8bc66(0x139)]){const _0xf094a4=await confirm(_0xa8bc66(0x1a6)+_0x58f18d+'\x22?');if(!_0xf094a4)return console[_0xa8bc66(0x115)](_0xa8bc66(0x13f)),0x0;}const _0x5a620f=await withSpinner(_0xa8bc66(0x1b5),()=>_0x18d6f7['journey'][_0xa8bc66(0x142)](_0x266f96),{'verbose':_0x56c2c5['verbose']}),_0x457d0f=_0x5a620f[_0xa8bc66(0x1c3)];return console[_0xa8bc66(0x115)](a27_0x5dfa1a[_0xa8bc66(0x1a3)]('✔')+_0xa8bc66(0x116)+_0x457d0f['attributes'][_0xa8bc66(0x150)]+'\x20(draft)\x20—\x20\x22'+_0x457d0f['attributes'][_0xa8bc66(0x12f)]+'\x22'),console[_0xa8bc66(0x115)](_0xa8bc66(0x105)+_0x457d0f['id']),await handleSingleObjectOutput({'id':_0x457d0f['id'],'name':_0x457d0f[_0xa8bc66(0x17e)][_0xa8bc66(0x12f)],'version':_0x457d0f[_0xa8bc66(0x17e)][_0xa8bc66(0x150)],'state':_0x457d0f[_0xa8bc66(0x17e)]['state'],'bundle_id':_0x457d0f[_0xa8bc66(0x17e)][_0xa8bc66(0x10b)],'created_at':_0x457d0f[_0xa8bc66(0x17e)][_0xa8bc66(0x143)]},_0x56c2c5),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x183);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x182);async[a27_0x354a54(0x138)](_0x332ed9){const _0x384c08=a27_0x354a54,{options:_0x27ec7b,args:_0x20b8fd,tdx:_0x39b05b}=_0x332ed9,_0x492741=_0x20b8fd[0x0];if(!requireNameOrPath(_0x492741))return 0x1;const _0x553112=_0x27ec7b['version'];if(!_0x553112)return console[_0x384c08(0x115)](_0x384c08(0x1b7)),console[_0x384c08(0x115)](_0x384c08(0x1f3)),0x1;const _0x28a03=parseInt(_0x553112,0xa);if(isNaN(_0x28a03)||_0x28a03<0x1)return console[_0x384c08(0x115)](_0x384c08(0x199)+_0x553112),0x1;if(_0x27ec7b[_0x384c08(0x125)])console['error'](_0x384c08(0x113)+_0x492741+_0x384c08(0x127)+_0x28a03);const {journeyId:_0x1818e1,parentSegmentId:_0xb188be}=await resolveJourneyIdFromInput(_0x492741,_0x27ec7b,_0x39b05b),_0x5a87f6=await withSpinner('Resolving\x20version...',()=>_0x39b05b[_0x384c08(0x14d)][_0x384c08(0x174)](_0x1818e1),{'verbose':_0x27ec7b[_0x384c08(0x125)]}),{versions:_0xf4350f,latestJourneyId:_0x40b481}=_0x5a87f6[_0x384c08(0x1c3)],_0x3f1520=_0xf4350f[_0x384c08(0x196)](_0xcb055=>_0xcb055[_0x384c08(0x150)]===_0x28a03);if(!_0x3f1520){const _0x58e10d=_0xf4350f[_0x384c08(0x17f)](_0x4d7ea0=>'v'+_0x4d7ea0[_0x384c08(0x150)])[_0x384c08(0x151)](',\x20');return console[_0x384c08(0x115)](_0x384c08(0x18c)+_0x28a03+'\x20not\x20found.\x20Available:\x20'+_0x58e10d),0x1;}const _0x2c733e=await withSpinner(_0x384c08(0x1ab)+_0x28a03+_0x384c08(0x13c),()=>_0x39b05b[_0x384c08(0x14d)][_0x384c08(0xf3)](_0x3f1520[_0x384c08(0x100)]),{'verbose':_0x27ec7b[_0x384c08(0x125)]}),_0x50ef77=_0x2c733e[_0x384c08(0x1c3)],_0x4256c7=getConsoleNextUrl(_0x27ec7b[_0x384c08(0x1f1)],_0x384c08(0x1dd)+_0xb188be+_0x384c08(0x16e)+_0x3f1520['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x50ef77['id'],'name':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x12f)],'version':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x150)],'description':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1bf)],'state':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1a0)],'paused':_0x50ef77['attributes'][_0x384c08(0x131)],'reentry_mode':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x19e)],'stages':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1de)]?.[_0x384c08(0x13d)]||0x0,..._0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1e5)]&&{'goal':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1e5)][_0x384c08(0x12f)]},'latest':_0x3f1520[_0x384c08(0x100)]===_0x40b481,'created_at':_0x50ef77['attributes'][_0x384c08(0x143)],'updated_at':_0x50ef77[_0x384c08(0x17e)]['updatedAt'],'url':_0x4256c7},_0x27ec7b),0x0;}}
|
|
1
|
+
const a27_0x256e1e=a27_0x4aef;(function(_0x4c68a7,_0x1723ea){const _0x2f6a13=a27_0x4aef,_0x1ff3dd=_0x4c68a7();while(!![]){try{const _0x324cce=parseInt(_0x2f6a13(0xef))/0x1+parseInt(_0x2f6a13(0x1b1))/0x2*(-parseInt(_0x2f6a13(0xf1))/0x3)+-parseInt(_0x2f6a13(0x1d7))/0x4*(parseInt(_0x2f6a13(0x152))/0x5)+-parseInt(_0x2f6a13(0x176))/0x6+-parseInt(_0x2f6a13(0xf3))/0x7*(parseInt(_0x2f6a13(0x10d))/0x8)+-parseInt(_0x2f6a13(0x198))/0x9*(parseInt(_0x2f6a13(0x19c))/0xa)+-parseInt(_0x2f6a13(0x1e0))/0xb*(-parseInt(_0x2f6a13(0x11b))/0xc);if(_0x324cce===_0x1723ea)break;else _0x1ff3dd['push'](_0x1ff3dd['shift']());}catch(_0x45e9b4){_0x1ff3dd['push'](_0x1ff3dd['shift']());}}}(a27_0x589b,0x878d1));import a27_0x13d74a from'chalk';import a27_0x555498 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a27_0x4aef(_0x482725,_0xeb1396){_0x482725=_0x482725-0xea;const _0x589bb9=a27_0x589b();let _0x4aef5a=_0x589bb9[_0x482725];return _0x4aef5a;}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(_0x465c3c){const _0x1c9d60=a27_0x4aef;return!_0x465c3c&&(console[_0x1c9d60(0x1b3)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x1c9d60(0x1b3)](_0x1c9d60(0x138))),!!_0x465c3c;}function withJsonFormat(_0x581bc9){const _0xaaa127=a27_0x4aef;if(!_0x581bc9[_0xaaa127(0x1c7)]&&!_0x581bc9[_0xaaa127(0x1cc)]&&!_0x581bc9[_0xaaa127(0xf8)]&&!_0x581bc9[_0xaaa127(0x16d)])return{..._0x581bc9,'format':_0xaaa127(0x1cc),'json':!![]};return _0x581bc9;}function formatJourneyState(_0x54f275){const _0x63893b=a27_0x4aef;switch(_0x54f275){case _0x63893b(0x1ae):return a27_0x13d74a[_0x63893b(0x11a)](_0x63893b(0x1a7));case _0x63893b(0x146):return a27_0x13d74a['dim'](_0x63893b(0x1e6));case _0x63893b(0x1c0):return a27_0x13d74a['yellow'](_0x63893b(0x1ee));case'completed':return a27_0x13d74a['blue'](_0x63893b(0x1d3));case _0x63893b(0x10e):return a27_0x13d74a['dim']('(archived)');default:return'('+_0x54f275+')';}}function formatJourneyItem(_0x21304b,_0x316530='',_0x572268){const _0x3e1132=a27_0x4aef,_0x1bf68e=formatJourneyState(_0x21304b[_0x3e1132(0x188)]),_0x2c53aa=_0x572268?hyperlink(_0x21304b[_0x3e1132(0x183)],_0x572268):_0x21304b[_0x3e1132(0x183)];return _0x316530+'🗺️\x20'+_0x2c53aa+'\x20'+_0x1bf68e;}function a27_0x589b(){const _0x1961dd=['Error:\x20--version\x20option\x20is\x20required','tdx.json','enteredSize','hasPeriod','8tqhrpA','archived','\x20Opening\x20','goal','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20Invalid\x20--type\x20\x22','Show\x20journey\x20statistics',',\x20version:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','limit','journey:version:view','yellow','green','12JjeBoY','isNew','cyan','journey:traffic','/e/','Database:\x20','\x22\x20paused','join','journeyId','history','journey:pull','parent_segment','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','type','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','nodes','\x20journey','stages','cwd','verbose','yes','Error:\x20Journey\x20\x27','diff','Pattern:\x20','getSegment','Fetching\x20users\x20and\x20connections...','listFolders','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Fetching\x20','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','resume','getStatistics','journey','/j/da','getColumnMapping','Show\x20journey\x20table\x20column\x20mapping','...','segmentPushCommand','listJourneysFromParentSegment','journey:version:create','activation','audienceId','dim','draft','replace','folderId','getTrafficData','Cancelled','\x20\x20Parent\x20segment:\x20','absolutePath','journey:versions','connection','List\x20all\x20versions\x20of\x20a\x20journey','parentSegment','Creating\x20new\x20version...','5XMuDfm','all','INVALID_ARGUMENT','dryRun','activationParams','log','data','Error:\x20Parent\x20segment\x20context\x20required','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','/app/ps/','journeyBundleId','exitOrJumpSize','renderStats','push','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Resume\x20a\x20paused\x20journey','from','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','getJourney','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Warning:\x20Could\x20not\x20resolve\x20segment\x20','no_parent','Found\x20','goalSize','createdAt','folderPath','Error:\x20','tsv','map','\x20\x20-\x20','filter','\x20(rule\x20match)','\x20=\x20','\x20\x20Statistics\x20not\x20available','\x0aChanges\x20to\x20\x27','\x5c$&','6488130cbDWBD','milestoneSize','parentName','updatedAt','database','add','relativePath','folders','Options:','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','segments','Parent\x20segment:\x20','\x20\x20Target:\x20','journeyBundleName','journey:resume','entries','includeStats','/j/da/je','state','utf-8','Show\x20journey\x20details','pause','execute','options','\x27\x20not\x20found\x20in\x20','connector_config','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Pause\x20a\x20running\x20journey','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','values','hasChanges','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','resolveParentId','Error:\x20Invalid\x20version\x20number:\x20','270xuGYQy','Table:\x20','(root)','📁\x20','258220OiFkMB','Getting\x20journey\x20details...','journey:stats','rule','localeCompare','resolveSegment','\x0aError:','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Folder\x20path:\x20','\x20Created\x20v','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','(running)','\x20not\x20found.\x20Available:\x20','\x20unchanged\x20files','includeHistory','journeyStages','Input:\x20','sort','launched','✔\x20Journey\x20\x22','relative','886gOghwM','Resolving\x20journey...','error','listVersions','Getting\x20column\x20mapping...','\x20\x20Name:\x20','resolveJourneyId','segment','\x20version','Error:\x20Stage\x20\x22','filePath','✔\x20All\x20files\x20are\x20up\x20to\x20date','stageNameMap','\x20new\x20files','Getting\x20journey\x20traffic\x20data...','paused','split','site','\x20->\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','table','Aborted.','format','✔\x20Context\x20set:\x20','List\x20journeys\x20in\x20current\x20context','Resolved\x20YAML\x20file:\x20','buildIdToEmailMap','json','Resolving\x20parent\x20segment...','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)','journeyName','getLatestJourneyId','Listing\x20journey\x20activations...','red','(completed)','exitOrJumpRate','segmentName','repeat','2354180mpGWfq','getParentFull','base','helpText','args','No\x20statistics\x20available\x20for\x20journey:\x20','Resuming\x20journey...','session','test','39984604JWxriD','\x20\x20Folder\x20path:\x20','name','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','-\x20no\x20files\x20written','journey:list','(draft)','columns','.yml','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','journey:push','Resolving\x20version...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','completionRate','(paused)','Getting\x20version\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','file','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','description','length','errorCode','get','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Write\x20','reentryMode','285838dTjtPp','size','2229NFUOhV','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','4143132jytfTC','\x20changed\x20files','then','find','\x20\x20Journey\x20ID:\x20','jsonl','web','versionNumber','attributes','toLowerCase','listJourneysWithFolders','activation_','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','rootFolderId','user','has','targetDir','set','\x0aPull\x20summary:','listActivationsFlat','conversion'];a27_0x589b=function(){return _0x1961dd;};return a27_0x589b();}function escapeRegex(_0x4d55b4){const _0x37ed31=a27_0x4aef;return _0x4d55b4[_0x37ed31(0x147)](/[.*+?^${}()|[\]\\]/g,_0x37ed31(0x175));}function globToRegex(_0x1f1e73){const _0x5b41d3=a27_0x4aef,_0x13f1a7=_0x1f1e73[_0x5b41d3(0x1c1)]('*')[_0x5b41d3(0x16e)](escapeRegex);return new RegExp(_0x13f1a7['join']('.*'),'i');}function buildRuleToNameMapping(_0x7bab84){const _0x202842=a27_0x4aef,_0x110bd8=new Map();if(_0x7bab84[_0x202842(0x180)])for(const [_0xdca981,_0x50b50a]of Object[_0x202842(0x185)](_0x7bab84['segments'])){if(_0x50b50a['rule']){const _0x49a46d=serializeRule(_0x50b50a[_0x202842(0x19f)]),_0x2b2e7d=_0x110bd8[_0x202842(0x1f8)](_0x49a46d);_0x2b2e7d?_0x2b2e7d[_0x202842(0x15f)](_0xdca981):_0x110bd8[_0x202842(0x105)](_0x49a46d,[_0xdca981]);}}return _0x110bd8;}async function resolveJourneyIdFromInput(_0x1dc860,_0x2f366b,_0x50dd28){const _0x9bf588=a27_0x4aef,_0xc1cbd=await resolveJourneyTarget(_0x1dc860,_0x2f366b[_0x9bf588(0x150)],_0x2f366b[_0x9bf588(0x12e)]),_0x37800e=_0xc1cbd[_0x9bf588(0x150)];if(!_0x37800e)throw new SDKError(ErrorCode[_0x9bf588(0x154)],_0x9bf588(0x1f0));const _0x2b286a=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x50dd28[_0x9bf588(0x1b8)][_0x9bf588(0x196)](_0x37800e),{'verbose':_0x2f366b[_0x9bf588(0x12e)]}),_0x5e2158=_0x2b286a[_0x9bf588(0x158)],_0x38298a=await withSpinner(_0x9bf588(0x1b2),()=>_0x50dd28[_0x9bf588(0x13b)][_0x9bf588(0x1b7)](_0x5e2158,_0xc1cbd[_0x9bf588(0x1cf)]),{'verbose':_0x2f366b[_0x9bf588(0x12e)]});return{'journeyId':_0x38298a['data'],'journeyName':_0xc1cbd[_0x9bf588(0x1cf)],'parentSegmentId':_0x5e2158};}async function resolveJourneyTarget(_0x3004ca,_0x488471,_0x39af02){const _0x5d06f0=a27_0x4aef;if(isYamlFilePath(_0x3004ca))try{const _0x54be56=await resolveYamlFilePath(_0x3004ca);return _0x39af02&&(console[_0x5d06f0(0x1b3)](_0x5d06f0(0x1ca)+_0x3004ca),console[_0x5d06f0(0x1b3)](_0x5d06f0(0x14b)+_0x54be56[_0x5d06f0(0x150)]),console[_0x5d06f0(0x1b3)](_0x5d06f0(0x1b6)+_0x54be56[_0x5d06f0(0x1d5)]),console[_0x5d06f0(0x1b3)](_0x5d06f0(0x1e1)+(_0x54be56[_0x5d06f0(0x16b)]||'(root)'))),{'journeyName':_0x54be56[_0x5d06f0(0x1d5)],'parentSegment':_0x54be56['parentSegment'],'resolved':_0x54be56};}catch(_0x478570){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5d06f0(0x195)+_0x478570[_0x5d06f0(0xff)]);}if(!_0x488471)throw new SDKError(ErrorCode[_0x5d06f0(0x154)],_0x5d06f0(0x1e9));return{'journeyName':_0x3004ca,'parentSegment':_0x488471};}export class JourneyListCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x1e5);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x1c9);async['execute'](_0x2337c0){const _0x397283=a27_0x256e1e,{options:_0x23ac4d,args:_0x2d7135,tdx:_0x43b953}=_0x2337c0,_0x2156a7=_0x2d7135[0x0],_0x4b9af2=_0x23ac4d[_0x397283(0x150)];if(!_0x4b9af2)return console['error'](_0x397283(0x159)),console[_0x397283(0x1b3)](_0x397283(0x160)),0x1;const _0x38abbd=await withSpinner(_0x397283(0x1cd),()=>_0x43b953[_0x397283(0x1b8)][_0x397283(0x196)](_0x4b9af2),{'verbose':_0x23ac4d[_0x397283(0x12e)]}),_0x160804=_0x38abbd['data'];_0x23ac4d['verbose']&&(console[_0x397283(0x1b3)](_0x397283(0x181)+_0x4b9af2+'\x20(ID:\x20'+_0x160804+')'),_0x2156a7&&console[_0x397283(0x1b3)](_0x397283(0x132)+_0x2156a7));const _0x36cbd7=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x43b953[_0x397283(0x1b8)][_0x397283(0x1d8)](_0x160804),{'verbose':_0x23ac4d[_0x397283(0x12e)]}),_0x423686=_0x36cbd7['data'],_0x4512a6=_0x423686[_0x397283(0x101)],_0x44e809=await withSpinner('Listing\x20journeys...',()=>_0x43b953[_0x397283(0x13b)][_0x397283(0xfd)](_0x160804,_0x4512a6),{'verbose':_0x23ac4d[_0x397283(0x12e)]});let _0x3adb02=_0x44e809[_0x397283(0x158)]['journeys'];const _0x46e591=_0x44e809['data'][_0x397283(0x17d)],_0xad5fdb=new Map();for(const _0x43908d of _0x46e591){_0xad5fdb[_0x397283(0x105)](_0x43908d['id'],_0x43908d['name']);}if(_0x2156a7){const _0x1667f2=globToRegex(_0x2156a7);_0x3adb02=_0x3adb02[_0x397283(0x170)](_0x1668ea=>_0x1667f2[_0x397283(0x1df)](_0x1668ea[_0x397283(0x183)]));}console['error']('✔\x20Found\x20'+_0x3adb02[_0x397283(0x1f6)]+_0x397283(0x12b)+(_0x3adb02['length']!==0x1?'s':''));const _0x90035d=_0x22069a=>{const _0x36a37d=_0x397283;return getConsoleNextUrl(_0x23ac4d[_0x36a37d(0x1c2)],_0x36a37d(0x15b)+_0x160804+_0x36a37d(0x11f)+_0x22069a+_0x36a37d(0x13c));};if(_0x23ac4d[_0x397283(0x1c7)]===_0x397283(0x1c5))await handleSDKOutput(_0x3adb02,_0x23ac4d);else{if(_0x23ac4d[_0x397283(0x1c7)]===_0x397283(0x1cc)){const _0x23909a=_0x3adb02[_0x397283(0x16e)](_0x568711=>({..._0x568711,'url':_0x90035d(_0x568711['id'])}));await handleSDKOutput(_0x23909a,_0x23ac4d);}else{console[_0x397283(0x157)]('['+_0x4b9af2+']');const _0x24bb89=new Map(),_0x5aa7a1=[];for(const _0x2505fc of _0x3adb02){if(!_0x2505fc[_0x397283(0x148)]||_0x2505fc[_0x397283(0x148)]===_0x4512a6)_0x5aa7a1[_0x397283(0x15f)](_0x2505fc);else{const _0x4496b1=_0x24bb89[_0x397283(0x1f8)](_0x2505fc[_0x397283(0x148)])||[];_0x4496b1[_0x397283(0x15f)](_0x2505fc),_0x24bb89[_0x397283(0x105)](_0x2505fc['folderId'],_0x4496b1);}}const _0x2faaf1=(_0xcbe65b,_0xea9eab)=>_0xcbe65b[_0x397283(0x183)]['localeCompare'](_0xea9eab['journeyBundleName'],undefined,{'sensitivity':_0x397283(0x1d9)});_0x5aa7a1[_0x397283(0x1ad)](_0x2faaf1);for(const _0x15b3d4 of _0x5aa7a1){console[_0x397283(0x157)](formatJourneyItem(_0x15b3d4,'',_0x90035d(_0x15b3d4['id'])));}const _0x39415a=[..._0x24bb89[_0x397283(0x185)]()]['sort']((_0xe8610d,_0x5c7167)=>{const _0x1cc74c=_0x397283,_0x8aec7b=_0xad5fdb[_0x1cc74c(0x1f8)](_0xe8610d[0x0])||_0xe8610d[0x0],_0x460a23=_0xad5fdb[_0x1cc74c(0x1f8)](_0x5c7167[0x0])||_0x5c7167[0x0];return _0x8aec7b[_0x1cc74c(0x1a0)](_0x460a23,undefined,{'sensitivity':_0x1cc74c(0x1d9)});});for(const [_0x4490e4,_0x564bee]of _0x39415a){const _0x4bc10f=_0xad5fdb[_0x397283(0x1f8)](_0x4490e4)||_0x4490e4;console[_0x397283(0x157)](_0x397283(0x19b)+_0x4bc10f),_0x564bee['sort'](_0x2faaf1);for(const _0xd0cc87 of _0x564bee){console[_0x397283(0x157)](formatJourneyItem(_0xd0cc87,'\x20\x20',_0x90035d(_0xd0cc87['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]='journey:view';[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x18a);async[a27_0x256e1e(0x18c)](_0x5bf5f0){const _0x4a22c1=a27_0x256e1e,{options:_0x424f84,args:_0x4b98c3,tdx:_0x5f0124}=_0x5bf5f0,_0x2ea55d=_0x4b98c3[0x0];if(!_0x2ea55d)return console[_0x4a22c1(0x1b3)](_0x4a22c1(0xf2)),console[_0x4a22c1(0x1b3)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x4a22c1(0x1b3)](_0x4a22c1(0x17e)),console[_0x4a22c1(0x1b3)](_0x4a22c1(0x165)),0x1;_0x424f84[_0x4a22c1(0x12e)]&&console[_0x4a22c1(0x1b3)](_0x4a22c1(0x1ac)+_0x2ea55d);const {journeyId:_0x1b55dd,parentSegmentId:_0x32bdc3}=await resolveJourneyIdFromInput(_0x2ea55d,_0x424f84,_0x5f0124);if(_0x424f84[_0x4a22c1(0xf9)]){const _0x596db9=getConsoleNextUrl(_0x424f84[_0x4a22c1(0x1c2)],'/app/ps/'+_0x32bdc3+_0x4a22c1(0x11f)+_0x1b55dd+_0x4a22c1(0x187));return console[_0x4a22c1(0x1b3)](a27_0x13d74a[_0x4a22c1(0x11a)]('✔')+_0x4a22c1(0x10f)+a27_0x13d74a['cyan'](_0x596db9)),openBrowser(_0x596db9),0x0;}const _0x4fed1b=await withSpinner(_0x4a22c1(0x19d),()=>_0x5f0124['journey']['getJourney'](_0x1b55dd),{'verbose':_0x424f84['verbose']}),_0x2fce78=_0x4fed1b[_0x4a22c1(0x158)],_0x13d047=_0x424f84[_0x4a22c1(0x186)];let _0x6b77d0;if(_0x13d047)try{const _0x2ae02a=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x5f0124['journey'][_0x4a22c1(0x13a)](_0x1b55dd),{'verbose':_0x424f84['verbose']});_0x6b77d0=_0x2ae02a[_0x4a22c1(0x158)];}catch{_0x424f84[_0x4a22c1(0x12e)]&&console['error'](_0x4a22c1(0x173));}const _0x437ae=getConsoleNextUrl(_0x424f84[_0x4a22c1(0x1c2)],_0x4a22c1(0x15b)+_0x32bdc3+_0x4a22c1(0x11f)+_0x1b55dd+_0x4a22c1(0x187)),_0x390654={'id':_0x2fce78['id'],'name':_0x2fce78['attributes'][_0x4a22c1(0x1e2)],'description':_0x2fce78[_0x4a22c1(0xfb)][_0x4a22c1(0x1f5)],'state':_0x2fce78[_0x4a22c1(0xfb)][_0x4a22c1(0x188)],'paused':_0x2fce78[_0x4a22c1(0xfb)][_0x4a22c1(0x1c0)],'reentry_mode':_0x2fce78['attributes'][_0x4a22c1(0xee)],'stages':_0x2fce78['attributes'][_0x4a22c1(0x1ab)]?.[_0x4a22c1(0x1f6)]||0x0,..._0x2fce78['attributes'][_0x4a22c1(0x110)]&&{'goal':_0x2fce78['attributes'][_0x4a22c1(0x110)][_0x4a22c1(0x1e2)]},..._0x6b77d0&&{'statistics':{'size':_0x6b77d0[_0x4a22c1(0xf0)],'entered':_0x6b77d0[_0x4a22c1(0x10b)],'goal_achieved':_0x6b77d0[_0x4a22c1(0x169)],'completion_rate':_0x6b77d0[_0x4a22c1(0x1ed)],'exit_or_jump':_0x6b77d0[_0x4a22c1(0x15d)],'exit_or_jump_rate':_0x6b77d0[_0x4a22c1(0x1d4)],'stages':_0x6b77d0[_0x4a22c1(0x12c)]}},'url':_0x437ae};return await handleSingleObjectOutput(_0x390654,_0x424f84),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x19e);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x114);async['execute'](_0x2e423a){const _0x5ddf02=a27_0x256e1e,{options:_0x2cc0fb,args:_0x1c2af8,tdx:_0x4286e2}=_0x2e423a,_0x3eeff7=_0x1c2af8[0x0];if(!requireNameOrPath(_0x3eeff7))return 0x1;_0x2cc0fb[_0x5ddf02(0x12e)]&&console[_0x5ddf02(0x1b3)](_0x5ddf02(0x1ac)+_0x3eeff7);const _0x1a95d4=_0x2cc0fb,_0x403eb2=_0x1a95d4[_0x5ddf02(0x162)],_0x404d53=_0x1a95d4['to'],_0x15014d=_0x1a95d4['includeHistory'],_0x8cc70e=_0x1a95d4['stage'];_0x15014d&&!_0x403eb2&&!_0x404d53&&console[_0x5ddf02(0x1b3)](_0x5ddf02(0x136));const _0x411056=_0x15014d?withJsonFormat(_0x2cc0fb):_0x2cc0fb,{journeyId:_0x7d460e,journeyName:_0x58bda5}=await resolveJourneyIdFromInput(_0x3eeff7,_0x411056,_0x4286e2),_0x50bc11=_0x403eb2||_0x404d53?{'from':_0x403eb2,'to':_0x404d53}:undefined,_0x153f1e=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x5ddf02(0x153)]([_0x4286e2['journey'][_0x5ddf02(0x164)](_0x7d460e),_0x4286e2[_0x5ddf02(0x13b)]['getStatistics'](_0x7d460e,_0x50bc11)]),{'verbose':_0x411056['verbose']}),[_0x2abbc7,_0x16dd8f]=_0x153f1e[_0x5ddf02(0x158)];if(!_0x16dd8f||_0x16dd8f[_0x5ddf02(0x123)]===null)return console[_0x5ddf02(0x1b3)](_0x5ddf02(0x1dc)+_0x58bda5),console[_0x5ddf02(0x1b3)](_0x5ddf02(0x1a6)),0x0;const _0x31ff62=buildStageNameMap(_0x2abbc7),_0xfc5286=!!(_0x50bc11&&_0x16dd8f[_0x5ddf02(0x124)]?.[_0x5ddf02(0x1f6)]),_0x3f3e3f={'stageNameMap':_0x31ff62,'hasPeriod':_0xfc5286,'includeHistory':!!_0x15014d};if(_0x8cc70e&&_0x16dd8f[_0x5ddf02(0x12c)]){const _0x47b85e=_0x16dd8f[_0x5ddf02(0x12c)][_0x5ddf02(0xf6)](_0x93fa01=>{const _0x32bbbb=_0x5ddf02,_0x1be7ab=_0x31ff62[_0x32bbbb(0x1f8)](_0x93fa01['id'])??'';return _0x1be7ab['toLowerCase']()===_0x8cc70e[_0x32bbbb(0xfc)]();});if(_0x47b85e)return await handleSingleObjectOutput(formatStageStats(_0x47b85e,_0x3f3e3f),_0x411056),0x0;const _0x312bc0=_0x16dd8f[_0x5ddf02(0x12c)][_0x5ddf02(0x16e)](_0x307fbe=>_0x31ff62[_0x5ddf02(0x1f8)](_0x307fbe['id'])??_0x307fbe['id']);return console[_0x5ddf02(0x1b3)](_0x5ddf02(0x1ba)+_0x8cc70e+'\x22\x20not\x20found'),console[_0x5ddf02(0x1b3)]('Available\x20stages:\x20'+_0x312bc0[_0x5ddf02(0x122)](',\x20')),0x1;}const _0x41e3ef=_0x16dd8f[_0x5ddf02(0x12c)]?.['map'](_0x50393a=>formatStageStats(_0x50393a,_0x3f3e3f)),_0x3651c4=assembleJourneyStats(_0x16dd8f,{'from':_0x403eb2,'to':_0x404d53,'includeHistory':_0x15014d});return await this['renderStats'](_0x3651c4,_0x41e3ef??[],_0x411056),0x0;}async[a27_0x256e1e(0x15e)](_0x333cb7,_0x2f3cdc,_0x22a9ad){const _0x2ef83f=a27_0x256e1e,_0x247e39=_0x22a9ad[_0x2ef83f(0x1c7)]===_0x2ef83f(0x1cc)||_0x22a9ad[_0x2ef83f(0x1c7)]==='jsonl'||_0x22a9ad['json']||_0x22a9ad['jsonl'];if(_0x247e39){_0x333cb7[_0x2ef83f(0x12c)]=_0x2f3cdc,await handleSingleObjectOutput(_0x333cb7,_0x22a9ad);return;}await handleSingleObjectOutput(_0x333cb7,_0x22a9ad);for(const _0x4a20cd of _0x2f3cdc){console[_0x2ef83f(0x157)](''),console['log'](String(a27_0x13d74a[_0x2ef83f(0x11d)]['bold']('['+_0x4a20cd['name']+']'))+a27_0x13d74a[_0x2ef83f(0x145)]('\x20'+_0x4a20cd['id']));const {id:_0x442135,name:_0x49b80c,..._0x1ad3ba}=_0x4a20cd;await handleSingleObjectOutput(_0x1ad3ba,_0x22a9ad);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x11e);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x192);async[a27_0x256e1e(0x18c)](_0x185918){const _0x4d1fc8=a27_0x256e1e,{options:_0x551a03,args:_0x275af4,tdx:_0x403b33}=_0x185918,_0x4ce32e=_0x275af4[0x0];if(!requireNameOrPath(_0x4ce32e))return 0x1;_0x551a03['verbose']&&console[_0x4d1fc8(0x1b3)]('Input:\x20'+_0x4ce32e);const _0x260ba7=_0x551a03,_0x50bb4d=_0x260ba7[_0x4d1fc8(0x128)],_0x2abc0f=_0x260ba7[_0x4d1fc8(0x162)],_0x362e87=_0x260ba7['to'],_0x2b5ded=_0x260ba7[_0x4d1fc8(0x117)];if(_0x50bb4d&&_0x50bb4d!==_0x4d1fc8(0x108)&&_0x50bb4d!==_0x4d1fc8(0x143))return console[_0x4d1fc8(0x1b3)](_0x4d1fc8(0x113)+_0x50bb4d+_0x4d1fc8(0x1c4)),0x1;const _0x5e5ff4=withJsonFormat(_0x551a03),{journeyId:_0x356fbb,journeyName:_0x8edc3e}=await resolveJourneyIdFromInput(_0x4ce32e,_0x5e5ff4,_0x403b33),_0x4a5c88={'type':_0x50bb4d,'from':_0x2abc0f,'to':_0x362e87,'limit':_0x2b5ded},_0x498b71=await withSpinner(_0x4d1fc8(0x1bf),()=>_0x403b33[_0x4d1fc8(0x13b)][_0x4d1fc8(0x149)](_0x356fbb,_0x4a5c88),{'verbose':_0x5e5ff4[_0x4d1fc8(0x12e)]}),_0x4bcb38=_0x498b71['data'],_0x19edb7=_0x4bcb38[_0x4d1fc8(0x108)]&&(_0x4bcb38[_0x4d1fc8(0x108)][_0x4d1fc8(0x12a)][_0x4d1fc8(0x1f6)]>0x0||_0x4bcb38[_0x4d1fc8(0x108)]['links'][_0x4d1fc8(0x1f6)]>0x0),_0x2418bf=_0x4bcb38[_0x4d1fc8(0x143)]&&_0x4bcb38[_0x4d1fc8(0x143)][_0x4d1fc8(0x1f6)]>0x0;if(!_0x19edb7&&!_0x2418bf)return console[_0x4d1fc8(0x1b3)](_0x4d1fc8(0x1e3)+_0x8edc3e),console[_0x4d1fc8(0x1b3)](_0x4d1fc8(0x17f)),_0x2abc0f&&_0x362e87&&console['error'](_0x4d1fc8(0x15a)),0x0;return await handleSingleObjectOutput(_0x4bcb38,_0x5e5ff4),0x0;}}function formatStageStats(_0x501a80,_0x58a9e2){const _0x1b5fad=a27_0x256e1e,_0x55ecbf=_0x58a9e2[_0x1b5fad(0x10c)]&&_0x501a80[_0x1b5fad(0x124)]?.[_0x1b5fad(0x1f6)]?aggregateStageHistory(_0x501a80[_0x1b5fad(0x124)]):{'size':_0x501a80[_0x1b5fad(0xf0)],'entered':_0x501a80[_0x1b5fad(0x10b)],'milestone':_0x501a80[_0x1b5fad(0x177)],'milestone_rate':_0x501a80['completeMilestoneRate'],'exit_or_jump':_0x501a80[_0x1b5fad(0x15d)],'exit_or_jump_rate':_0x501a80[_0x1b5fad(0x1d4)]},_0x436ba9={'id':_0x501a80['id'],'name':_0x58a9e2[_0x1b5fad(0x1bd)][_0x1b5fad(0x1f8)](_0x501a80['id'])??_0x501a80['id'],..._0x55ecbf};return _0x58a9e2[_0x1b5fad(0x10c)]&&_0x58a9e2[_0x1b5fad(0x1aa)]&&_0x501a80['history']&&(_0x436ba9[_0x1b5fad(0x124)]=_0x501a80[_0x1b5fad(0x124)]),_0x436ba9;}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x191);async['execute'](_0x553b8e){const _0x11f950=a27_0x256e1e,{options:_0x46734a,args:_0x46b72d,tdx:_0x18aa95}=_0x553b8e,_0x3f2230=_0x46b72d[0x0];if(!requireNameOrPath(_0x3f2230))return 0x1;_0x46734a[_0x11f950(0x12e)]&&console['error']('Input:\x20'+_0x3f2230);const {journeyId:_0x2f422a,journeyName:_0x41d638}=await resolveJourneyIdFromInput(_0x3f2230,_0x46734a,_0x18aa95);if(!_0x46734a[_0x11f950(0x12f)]){const _0x16baf5=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x41d638+'\x22?');if(!_0x16baf5)return console[_0x11f950(0x1b3)](_0x11f950(0x14a)),0x0;}const _0x4ac89a=await withSpinner('Pausing\x20journey...',()=>_0x18aa95[_0x11f950(0x13b)][_0x11f950(0x18b)](_0x2f422a),{'verbose':_0x46734a[_0x11f950(0x12e)]}),_0x1d05c7=_0x4ac89a[_0x11f950(0x158)];return console[_0x11f950(0x1b3)]('✔\x20Journey\x20\x22'+_0x1d05c7['attributes'][_0x11f950(0x1e2)]+_0x11f950(0x121)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x184);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x161);async[a27_0x256e1e(0x18c)](_0x506a86){const _0x1c3bb1=a27_0x256e1e,{options:_0x1127d8,args:_0x586297,tdx:_0x201ebc}=_0x506a86,_0x9886f4=_0x586297[0x0];if(!requireNameOrPath(_0x9886f4))return 0x1;_0x1127d8[_0x1c3bb1(0x12e)]&&console[_0x1c3bb1(0x1b3)]('Input:\x20'+_0x9886f4);const {journeyId:_0x34c7ff,journeyName:_0x3de335}=await resolveJourneyIdFromInput(_0x9886f4,_0x1127d8,_0x201ebc);if(!_0x1127d8[_0x1c3bb1(0x12f)]){const _0x182ab8=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x3de335+'\x22?');if(!_0x182ab8)return console['error'](_0x1c3bb1(0x14a)),0x0;}const _0x1631f8=await withSpinner(_0x1c3bb1(0x1dd),()=>_0x201ebc[_0x1c3bb1(0x13b)][_0x1c3bb1(0x139)](_0x34c7ff),{'verbose':_0x1127d8[_0x1c3bb1(0x12e)]}),_0x3ec6be=_0x1631f8['data'];return console[_0x1c3bb1(0x1b3)](_0x1c3bb1(0x1af)+_0x3ec6be['attributes'][_0x1c3bb1(0x1e2)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x256e1e(0x125);[a27_0x256e1e(0x1f5)]='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x2f0b85){const _0x29baf6=a27_0x256e1e,{options:_0xcbff53,args:_0x9a9aa0,tdx:_0x24f114}=_0x2f0b85,_0x4313c3=_0xcbff53,_0xc06bf5=_0x9a9aa0[0x0],_0x5a025a=_0xc06bf5&&isYamlFilePath(_0xc06bf5),_0x25b650=await resolveTarget({'arg':_0x5a025a?_0xc06bf5:undefined,'contextParent':_0xcbff53[_0x29baf6(0x150)],'cwd':process[_0x29baf6(0x12d)]()});if(!isSuccessfulResolution(_0x25b650))return _0x25b650[_0x29baf6(0x1f7)]===_0x29baf6(0x167)?(console['error'](a27_0x13d74a[_0x29baf6(0x119)](_0x29baf6(0x116))),console[_0x29baf6(0x1b3)](_0x29baf6(0x1ce)),console[_0x29baf6(0x1b3)](_0x29baf6(0x111)),console[_0x29baf6(0x1b3)](_0x29baf6(0x100)),console[_0x29baf6(0x1b3)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a27_0x13d74a[_0x29baf6(0x1d2)](_0x29baf6(0x16c)+_0x25b650[_0x29baf6(0xff)]+'\x0a')),_0x25b650[_0x29baf6(0x1da)]&&console[_0x29baf6(0x1b3)](a27_0x13d74a['cyan'](_0x25b650[_0x29baf6(0x1da)]))),0x1;let _0x4f59b5=_0x5a025a?undefined:_0xc06bf5,_0x14c3db,_0x1ab195;_0x25b650[_0x29baf6(0x128)]===_0x29baf6(0x1f3)&&(_0x4f59b5=_0x25b650['resourceName'],_0x14c3db=_0x25b650[_0x29baf6(0x1bb)],_0x1ab195=_0x25b650['folderPath']);const _0x38017a=_0x25b650[_0x29baf6(0x178)],_0x3bff0f=_0x25b650[_0x29baf6(0x104)];_0x4313c3[_0x29baf6(0x12e)]&&(console['error'](_0x29baf6(0x181)+_0x38017a),console[_0x29baf6(0x1b3)]('Target\x20directory:\x20'+_0x3bff0f),_0x4f59b5&&console['error']('Journey\x20name:\x20'+_0x4f59b5),_0x14c3db&&console[_0x29baf6(0x1b3)]('Target\x20file:\x20'+_0x14c3db),_0x1ab195&&console[_0x29baf6(0x1b3)](_0x29baf6(0x1a4)+_0x1ab195));const _0xe005a4=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x24f114[_0x29baf6(0x1b8)][_0x29baf6(0x196)](_0x38017a),{'verbose':_0xcbff53['verbose']}),_0x1d1ffb=_0xe005a4[_0x29baf6(0x158)],{journeys:_0x450cfc,folders:_0x7394fa}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x12555c=_0x29baf6,[_0x19c308,_0x4f71e0]=await Promise[_0x12555c(0x153)]([_0x24f114[_0x12555c(0x13b)][_0x12555c(0x141)](_0x1d1ffb,undefined,{'includeAllVersions':!![]}),_0x24f114['segment'][_0x12555c(0x135)](_0x1d1ffb)]);return{'journeys':_0x19c308,'folders':_0x4f71e0};},{'verbose':_0xcbff53['verbose']})['then'](_0x4a66a7=>_0x4a66a7['data']);let _0x1a8aae=_0x450cfc;const _0x15756c=buildFolderIdToPathMap(_0x7394fa);if(_0x4f59b5){const _0xe13e6c=_0x1a8aae['filter'](_0x185284=>_0x185284[_0x29baf6(0x183)][_0x29baf6(0xfc)]()===_0x4f59b5['toLowerCase']());if(_0xe13e6c[_0x29baf6(0x1f6)]===0x0)return console[_0x29baf6(0x1b3)]('Error:\x20Journey\x20not\x20found:\x20'+_0x4f59b5),console[_0x29baf6(0x1b3)](_0x29baf6(0x163)),0x1;_0x1a8aae=_0xe13e6c;}if(_0x1ab195!==undefined){const _0x42e675=_0x1a8aae[_0x29baf6(0x170)](_0x3f0651=>{const _0x42d955=_0x29baf6,_0x421769=_0x3f0651[_0x42d955(0x148)]?_0x15756c[_0x42d955(0x1f8)](_0x3f0651['folderId'])||'':'';return _0x421769===_0x1ab195;});if(_0x42e675[_0x29baf6(0x1f6)]===0x0&&_0x1a8aae['length']>0x0){console[_0x29baf6(0x1b3)](_0x29baf6(0x130)+_0x4f59b5+_0x29baf6(0x18e)+(_0x1ab195||'root\x20folder')),console[_0x29baf6(0x1b3)](_0x29baf6(0x112));for(const _0x2696c9 of _0x1a8aae){const _0x100788=_0x2696c9[_0x29baf6(0x148)]?_0x15756c['get'](_0x2696c9[_0x29baf6(0x148)])||'':'';console[_0x29baf6(0x1b3)](_0x29baf6(0x16f)+(_0x100788||_0x29baf6(0x19a))+'/'+_0x2696c9[_0x29baf6(0x183)]);}return 0x1;}_0x1a8aae=_0x42e675;}if(_0x1a8aae[_0x29baf6(0x1f6)]===0x0)return console[_0x29baf6(0x1b3)]('No\x20journeys\x20found'),0x0;const _0x2e82a1=new Map();for(const _0x2ab94f of _0x1a8aae){const _0x30f358=_0x2ab94f[_0x29baf6(0x15c)];!_0x2e82a1['has'](_0x30f358)&&_0x2e82a1[_0x29baf6(0x105)](_0x30f358,[]),_0x2e82a1[_0x29baf6(0x1f8)](_0x30f358)[_0x29baf6(0x15f)](_0x2ab94f);}for(const _0x30402d of _0x2e82a1[_0x29baf6(0x193)]()){_0x30402d[_0x29baf6(0x1ad)]((_0x30fba1,_0x2026d1)=>(_0x30fba1['versionNumber']||0x0)-(_0x2026d1[_0x29baf6(0xfa)]||0x0));}const _0x285d05=[],{idToEmailMap:_0x21ee33,connectionIdToNameMap:_0x3adf3a}=await withSpinner(_0x29baf6(0x134),async()=>{const _0x159a54=_0x29baf6,[_0xf45ad7,_0x1dec96]=await Promise['all']([_0x24f114[_0x159a54(0x102)][_0x159a54(0x1cb)](),_0x24f114[_0x159a54(0x14e)]['buildIdToNameMap']()]);return{'idToEmailMap':_0xf45ad7,'connectionIdToNameMap':_0x1dec96};},{'verbose':_0xcbff53[_0x29baf6(0x12e)]})[_0x29baf6(0xf5)](_0x191eca=>_0x191eca[_0x29baf6(0x158)]);for(const _0x1b0827 of _0x2e82a1['values']()){const _0x1bb655=_0x1b0827[0x0][_0x29baf6(0x183)],_0x4ac73d=_0x1b0827[0x0][_0x29baf6(0x148)],_0x2dc094=_0x4ac73d?_0x15756c[_0x29baf6(0x1f8)](_0x4ac73d)||'':'',_0x2e71d7=_0x2dc094?a27_0x555498[_0x29baf6(0x122)](_0x3bff0f,_0x2dc094):_0x3bff0f,_0x554bec=_0x14c3db||a27_0x555498[_0x29baf6(0x122)](_0x2e71d7,sanitizeFileName(_0x1bb655)+_0x29baf6(0x1e8));let _0x63ce0b,_0x58439c;if(existsSync(_0x554bec))try{const _0x230781=readFileSync(_0x554bec,_0x29baf6(0x189)),_0x27f27e=parseYamlString(_0x230781);_0x58439c=_0x27f27e,_0x63ce0b=buildRuleToNameMapping(_0x27f27e),_0x4313c3[_0x29baf6(0x12e)]&&_0x63ce0b[_0x29baf6(0xf0)]>0x0&&console[_0x29baf6(0x1b3)](_0x29baf6(0x168)+_0x63ce0b[_0x29baf6(0xf0)]+_0x29baf6(0x1a3)+_0x1bb655);}catch(_0x4af506){_0x4313c3[_0x29baf6(0x12e)]&&console[_0x29baf6(0x1b3)](_0x29baf6(0x127)+_0x4af506[_0x29baf6(0xff)]);}const _0xedc798=[],_0x3b22e5=new Set(),_0xb7bffb=new Map(),_0x1e4641=new Map(),_0x3775f4=new Set(),_0x59d3e8=new Map(),_0x3baaa6=new Map(),_0x1b19b5=createJumpTargetCache();await withProgressSpinner(_0x29baf6(0x137)+_0x1bb655+_0x29baf6(0x13f),async _0x335406=>{const _0x15abfb=_0x29baf6;for(const _0x3655c5 of _0x1b0827){const _0x1a169b=_0x1b0827[_0x15abfb(0x1f6)]>0x1?_0x3655c5['journeyBundleName']+'\x20v'+(_0x3655c5['versionNumber']||0x1):_0x3655c5[_0x15abfb(0x183)];_0x335406['setPhase'](_0x15abfb(0x137)+_0x1a169b);const _0x22c29f=await _0x24f114[_0x15abfb(0x13b)][_0x15abfb(0x164)](_0x3655c5['id']),_0x58bda1=_0x22c29f[_0x15abfb(0xfb)]?.[_0x15abfb(0x144)],_0x4d78b1={'resolveSegment':async _0x190f6f=>{const _0x359aca=_0x15abfb;if(!_0x58bda1)return{'name':_0x190f6f,'isJourneyLocal':![]};const _0x5113ee=_0xb7bffb[_0x359aca(0x1f8)](_0x190f6f);if(_0x5113ee)return _0x5113ee;try{const _0x57e269=await _0x24f114['segment'][_0x359aca(0x133)](_0x58bda1,_0x190f6f),_0x15b291=_0x57e269['kind']===SEGMENT_KIND_JOURNEY;let _0x513987,_0x504f90=_0x57e269[_0x359aca(0x1e2)];if(_0x15b291&&_0x57e269[_0x359aca(0x19f)]){const _0x4c6f68=await segmentResponseToDef(_0x57e269,{'resolveSegmentName':async _0x3a6ab0=>{const _0x2a2315=_0x359aca,_0x1b045d=_0xb7bffb['get'](_0x3a6ab0);if(_0x1b045d)return _0x1b045d[_0x2a2315(0x1e2)];const _0x20e8d1=await _0x4d78b1[_0x2a2315(0x1a1)](_0x3a6ab0);return _0x20e8d1['name'];}}),_0x4c9791=_0x4c6f68[_0x359aca(0x19f)];_0x513987={'description':_0x57e269[_0x359aca(0x1f5)],'rule':_0x4c9791};const _0x890c3c=serializeRule(_0x4c9791),_0x1dcfd4=_0x1e4641[_0x359aca(0x1f8)](_0x890c3c);if(_0x1dcfd4)_0x504f90=_0x1dcfd4,_0x513987=undefined,_0x4313c3['verbose']&&console[_0x359aca(0x1b3)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x57e269[_0x359aca(0x1e2)]+_0x359aca(0x1c3)+_0x1dcfd4);else{let _0x189c34=![];if(_0x63ce0b){const _0x5341bc=_0x63ce0b[_0x359aca(0x1f8)](_0x890c3c);if(_0x5341bc){const _0x4b816c=_0x5341bc[_0x359aca(0xf6)](_0x1e5556=>!_0x3b22e5[_0x359aca(0x103)](_0x1e5556));_0x4b816c&&(_0x504f90=_0x4b816c,_0x3b22e5[_0x359aca(0x17b)](_0x4b816c),_0x1e4641[_0x359aca(0x105)](_0x890c3c,_0x4b816c),_0x189c34=!![],_0x4313c3[_0x359aca(0x12e)]&&console[_0x359aca(0x1b3)](_0x359aca(0x1f1)+_0x4b816c+_0x359aca(0x171)));}}if(!_0x189c34){const _0xf4661f=generateJourneyLocalName(_0x57e269[_0x359aca(0x1e2)]);_0xf4661f&&(_0x504f90=_0xf4661f);let _0x26f22f=_0x504f90,_0x24000c=0x2;while(_0x3b22e5[_0x359aca(0x103)](_0x26f22f)){_0x26f22f=_0x504f90+'_'+_0x24000c,_0x24000c++;}_0x3b22e5[_0x359aca(0x17b)](_0x26f22f),_0x1e4641[_0x359aca(0x105)](_0x890c3c,_0x26f22f),_0x504f90=_0x26f22f;}}}const _0x571dac={'name':_0x504f90,'isJourneyLocal':_0x15b291,'definition':_0x513987};return _0xb7bffb[_0x359aca(0x105)](_0x190f6f,_0x571dac),_0x571dac;}catch(_0x343346){return _0xcbff53[_0x359aca(0x12e)]&&console['error'](_0x359aca(0x166)+_0x190f6f+':\x20'+_0x343346['message']),{'name':_0x190f6f,'isJourneyLocal':![]};}},'resolveActivation':async _0x31cbbe=>{const _0xcfbe24=_0x15abfb,_0x2ec4b2=_0x59d3e8[_0xcfbe24(0x1f8)](_0x31cbbe);if(_0x2ec4b2)return _0x2ec4b2;try{const _0x4c5668=await _0x24f114[_0xcfbe24(0x13b)]['getActivation'](_0x3655c5['id'],_0x31cbbe),_0x3d9c25=journeyActivationStepToYaml(_0x4c5668,_0x21ee33,_0x3adf3a),_0x3744f7=JSON['stringify']({'name':_0x3d9c25[_0xcfbe24(0x1e2)],'connection':_0x3d9c25['connection'],'connector_config':_0x3d9c25[_0xcfbe24(0x18f)]}),_0xb01039=_0x3baaa6[_0xcfbe24(0x1f8)](_0x3744f7);if(_0xb01039){const _0x3b6ae1={'name':_0xb01039,'isJourneyLocal':!![],'definition':_0x3d9c25};return _0x59d3e8['set'](_0x31cbbe,_0x3b6ae1),_0x3b6ae1;}const _0x4a4b26=_0x4c5668[_0xcfbe24(0xfb)][_0xcfbe24(0x156)]['name']||_0x31cbbe,_0x1f46e1=sanitizeYamlKey(_0x4a4b26)||_0xcfbe24(0xfe)+_0x31cbbe;let _0x2e69fc=_0x1f46e1,_0x84187b=0x2;while(_0x3775f4[_0xcfbe24(0x103)](_0x2e69fc)){_0x2e69fc=_0x1f46e1+'_'+_0x84187b,_0x84187b++;}_0x3775f4[_0xcfbe24(0x17b)](_0x2e69fc),_0x3baaa6[_0xcfbe24(0x105)](_0x3744f7,_0x2e69fc);const _0x42fe9d={'name':_0x2e69fc,'isJourneyLocal':!![],'definition':_0x3d9c25};return _0x59d3e8[_0xcfbe24(0x105)](_0x31cbbe,_0x42fe9d),_0x42fe9d;}catch(_0x228e36){return _0xcbff53['verbose']&&console[_0xcfbe24(0x1b3)](_0xcfbe24(0xeb)+_0x31cbbe+':\x20'+_0x228e36[_0xcfbe24(0xff)]),{'name':_0x31cbbe,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x43119b,_0x415598)=>{const _0x101b07=_0x15abfb;return resolveJumpTarget(_0x43119b,_0x415598,_0x1b19b5,_0x3ec689=>_0x24f114[_0x101b07(0x13b)][_0x101b07(0x164)](_0x3ec689));}},_0x3a1526=await journeyResponseToDef(_0x22c29f,_0x4d78b1);_0xedc798[_0x15abfb(0x15f)]({'item':_0x3655c5,'yaml':_0x3a1526});}},{'verbose':_0xcbff53[_0x29baf6(0x12e)]});const _0x15eeea=await _0x24f114[_0x29baf6(0x13b)][_0x29baf6(0x1d0)](_0x1b0827[0x0][_0x29baf6(0x15c)]),_0x1ef79c=buildMergedJourneyDef(_0xedc798,_0x63ce0b,_0x15eeea),_0x5aed30=normalizeJourneyDef(_0x1ef79c,_0x58439c),_0x437d89=toYamlString(_0x5aed30),_0xbe085f=_0x14c3db||a27_0x555498[_0x29baf6(0x122)](_0x2e71d7,sanitizeFileName(_0x1bb655)+_0x29baf6(0x1e8));!_0x14c3db&&_0x2dc094&&!existsSync(_0x2e71d7)&&mkdirSync(_0x2e71d7,{'recursive':!![]});const _0xb40f9f=a27_0x555498[_0x29baf6(0x1b0)](process[_0x29baf6(0x12d)](),_0xbe085f);if(existsSync(_0xbe085f)){const _0x25cb51=readFileSync(_0xbe085f,_0x29baf6(0x189)),_0x1ace50=generateDiff(_0x25cb51,_0x437d89),_0x3a6e69=hasChanges(_0x1ace50);_0x285d05[_0x29baf6(0x15f)]({'relativePath':_0xb40f9f,'absolutePath':_0xbe085f,'content':_0x437d89,'isNew':![],'hasChanges':_0x3a6e69,'diff':_0x3a6e69?formatDiffWithColors(_0x1ace50):undefined});}else _0x285d05[_0x29baf6(0x15f)]({'relativePath':_0xb40f9f,'absolutePath':_0xbe085f,'content':_0x437d89,'isNew':!![],'hasChanges':![]});}const _0xaa376d=_0x285d05[_0x29baf6(0x170)](_0x14c51b=>_0x14c51b[_0x29baf6(0x11c)]),_0x18a951=_0x285d05[_0x29baf6(0x170)](_0x36a8ec=>!_0x36a8ec['isNew']&&_0x36a8ec[_0x29baf6(0x194)]),_0x221175=_0x285d05[_0x29baf6(0x170)](_0x1cf6e4=>!_0x1cf6e4[_0x29baf6(0x11c)]&&!_0x1cf6e4[_0x29baf6(0x194)]),_0x5b9115=_0x1a8aae['length'],_0x140068=_0x2e82a1['size'],_0x2d1737=_0x5b9115>_0x140068?'\x20('+_0x5b9115+'\x20versions)':'';console[_0x29baf6(0x1b3)](_0x29baf6(0x106)),console['error']('\x20\x20'+a27_0x13d74a[_0x29baf6(0x11d)](_0x140068+'\x20journeys')+a27_0x13d74a[_0x29baf6(0x145)](_0x2d1737)),console['error']('\x20\x20'+a27_0x13d74a[_0x29baf6(0x11a)]('+\x20'+_0xaa376d[_0x29baf6(0x1f6)]+_0x29baf6(0x1be))),console['error']('\x20\x20'+a27_0x13d74a[_0x29baf6(0x119)]('~\x20'+_0x18a951[_0x29baf6(0x1f6)]+_0x29baf6(0xf4))),console[_0x29baf6(0x1b3)]('\x20\x20'+a27_0x13d74a[_0x29baf6(0x145)]('=\x20'+_0x221175[_0x29baf6(0x1f6)]+_0x29baf6(0x1a9))),console[_0x29baf6(0x1b3)](_0x29baf6(0x182)+a27_0x13d74a['cyan'](_0x3bff0f)+'\x0a');if(_0x18a951['length']>0x0)for(const _0x5333ad of _0x18a951){console['error'](_0x29baf6(0x174)+_0x5333ad[_0x29baf6(0x17c)]+'\x27:'),console[_0x29baf6(0x1b3)]('─'['repeat'](0x3c)),console['error'](_0x5333ad[_0x29baf6(0x131)]),console[_0x29baf6(0x1b3)]('─'[_0x29baf6(0x1d6)](0x3c));}if(_0x4313c3[_0x29baf6(0x155)])return console[_0x29baf6(0x1b3)](a27_0x13d74a['yellow'](_0x29baf6(0xea))),0x0;if(_0xaa376d[_0x29baf6(0x1f6)]===0x0&&_0x18a951[_0x29baf6(0x1f6)]===0x0)return console[_0x29baf6(0x1b3)](a27_0x13d74a['green'](_0x29baf6(0x1bc))),saveSessionContext({'parent_segment':_0x38017a},_0x4313c3[_0x29baf6(0x1de)]),console[_0x29baf6(0x1b3)](a27_0x13d74a[_0x29baf6(0x11a)](_0x29baf6(0x1c8)+a27_0x13d74a[_0x29baf6(0x145)](_0x29baf6(0x126))+_0x29baf6(0x172)+a27_0x13d74a[_0x29baf6(0x11d)](_0x38017a))),0x0;if(!_0x4313c3[_0x29baf6(0x12f)]&&(_0xaa376d[_0x29baf6(0x1f6)]>0x0||_0x18a951['length']>0x0)){if(!isInteractive())return console[_0x29baf6(0x1b3)](a27_0x13d74a['red'](_0x29baf6(0x1a2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x29baf6(0x1b3)](a27_0x13d74a['dim'](_0x29baf6(0x1f2))),0x1;const _0x358d6a=await confirmKey(_0x29baf6(0xed)+(_0xaa376d['length']+_0x18a951[_0x29baf6(0x1f6)])+'\x20files?');if(!_0x358d6a)return console['error'](a27_0x13d74a[_0x29baf6(0x119)](_0x29baf6(0x1c6)),_0x29baf6(0x1e4)),0x1;}!existsSync(_0x3bff0f)&&mkdirSync(_0x3bff0f,{'recursive':!![]});const _0x92a08d=a27_0x555498[_0x29baf6(0x122)](_0x3bff0f,_0x29baf6(0x10a));writeFileSync(_0x92a08d,createTdxConfigContent(_0x38017a),_0x29baf6(0x189));for(const _0x4cadea of _0x285d05){(_0x4cadea['isNew']||_0x4cadea[_0x29baf6(0x194)])&&writeFileSync(_0x4cadea[_0x29baf6(0x14c)],_0x4cadea['content'],_0x29baf6(0x189));}return console[_0x29baf6(0x1b3)](a27_0x13d74a[_0x29baf6(0x11a)]('✔\x20Pulled\x20'+(_0xaa376d[_0x29baf6(0x1f6)]+_0x18a951[_0x29baf6(0x1f6)])+'\x20journey\x20files\x20to\x20'+_0x3bff0f)),saveSessionContext({'parent_segment':_0x38017a},_0x4313c3[_0x29baf6(0x1de)]),console[_0x29baf6(0x1b3)](a27_0x13d74a[_0x29baf6(0x11a)](_0x29baf6(0x1c8)+a27_0x13d74a['dim'](_0x29baf6(0x126))+_0x29baf6(0x172)+a27_0x13d74a[_0x29baf6(0x11d)](_0x38017a))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x13e);async['execute'](_0x277d85){const _0x67f6d5=a27_0x256e1e,{options:_0x58580c,args:_0x2fe3cf,tdx:_0x4efcba}=_0x277d85,_0x37a9c3=_0x2fe3cf[0x0];if(!requireNameOrPath(_0x37a9c3))return 0x1;_0x58580c[_0x67f6d5(0x12e)]&&console['error'](_0x67f6d5(0x1ac)+_0x37a9c3);const {journeyId:_0x2f7d1f}=await resolveJourneyIdFromInput(_0x37a9c3,_0x58580c,_0x4efcba),_0x34669d=await withSpinner(_0x67f6d5(0x1b5),()=>_0x4efcba['journey'][_0x67f6d5(0x13d)](_0x2f7d1f),{'verbose':_0x58580c[_0x67f6d5(0x12e)]}),_0x3bcfc0=_0x34669d[_0x67f6d5(0x158)];return console[_0x67f6d5(0x157)](_0x67f6d5(0x120)+_0x3bcfc0[_0x67f6d5(0x17a)]),console[_0x67f6d5(0x157)](_0x67f6d5(0x199)+_0x3bcfc0[_0x67f6d5(0x1c5)]),await handleSDKOutput(_0x3bcfc0[_0x67f6d5(0x1e7)],_0x58580c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]='journey:activations';[a27_0x256e1e(0x1f5)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x256e1e(0x18c)](_0x479a6f){const _0x400b2c=a27_0x256e1e,{options:_0x17a890,args:_0x216298,tdx:_0x580abb}=_0x479a6f,_0x79ef2b=_0x216298[0x0];if(!requireNameOrPath(_0x79ef2b))return 0x1;_0x17a890['verbose']&&console[_0x400b2c(0x1b3)](_0x400b2c(0x1ac)+_0x79ef2b);const {journeyId:_0x2fe89f}=await resolveJourneyIdFromInput(_0x79ef2b,_0x17a890,_0x580abb),_0x4266f5=await withSpinner(_0x400b2c(0x1d1),()=>_0x580abb[_0x400b2c(0x13b)][_0x400b2c(0x107)](_0x2fe89f),{'verbose':_0x17a890[_0x400b2c(0x12e)]}),_0xeaed83=_0x4266f5[_0x400b2c(0x158)];return console[_0x400b2c(0x1b3)](_0x400b2c(0x168)+_0xeaed83['length']+'\x20activation'+(_0xeaed83['length']!==0x1?'s':'')),await handleSDKOutput(_0xeaed83,_0x17a890),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x1ea);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x129);[a27_0x256e1e(0x140)]=new SegmentPushCommand();async[a27_0x256e1e(0x18c)](_0x1da25c){const _0x4dc741=a27_0x256e1e,_0x157b40=_0x1da25c[_0x4dc741(0x1db)][0x0];let _0x38d498;if(_0x157b40){const _0xa79de9=await resolveTarget({'arg':_0x157b40,'contextParent':_0x1da25c['options']['parentSegment'],'cwd':process[_0x4dc741(0x12d)]()});isSuccessfulResolution(_0xa79de9)&&_0xa79de9['type']===_0x4dc741(0x1f3)&&(_0x38d498=_0xa79de9[_0x4dc741(0x1bb)]);}const _0x3f2878={..._0x1da25c,'options':{..._0x1da25c[_0x4dc741(0x18d)],'journeysOnly':!![],..._0x38d498&&{'singleFilePath':_0x38d498}}};return this[_0x4dc741(0x140)][_0x4dc741(0x18c)](_0x3f2878);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x14d);['description']=a27_0x256e1e(0x14f);async[a27_0x256e1e(0x18c)](_0x580ea2){const _0x5418b0=a27_0x256e1e,{options:_0x4b3a8b,args:_0x53ef8c,tdx:_0x2730dc}=_0x580ea2,_0x171eb8=_0x53ef8c[0x0];if(!requireNameOrPath(_0x171eb8))return 0x1;if(_0x4b3a8b[_0x5418b0(0x12e)])console[_0x5418b0(0x1b3)](_0x5418b0(0x1ac)+_0x171eb8);const {journeyId:_0xf97d11}=await resolveJourneyIdFromInput(_0x171eb8,_0x4b3a8b,_0x2730dc),_0x49418c=await withSpinner('Listing\x20journey\x20versions...',()=>_0x2730dc[_0x5418b0(0x13b)][_0x5418b0(0x1b4)](_0xf97d11),{'verbose':_0x4b3a8b['verbose']}),{bundleName:_0x18af15,versions:_0x288581,latestJourneyId:_0x51b8c8}=_0x49418c['data'];console[_0x5418b0(0x1b3)](_0x18af15+':\x20'+_0x288581[_0x5418b0(0x1f6)]+_0x5418b0(0x1b9)+(_0x288581['length']!==0x1?'s':''));const _0x4a3cdc=_0x288581[_0x5418b0(0x16e)](_0x4201be=>({'version':_0x4201be['versionNumber'],'journey_id':_0x4201be[_0x5418b0(0x123)],'name':_0x4201be[_0x5418b0(0x1e2)],'state':_0x4201be[_0x5418b0(0x188)],'paused':_0x4201be[_0x5418b0(0x1c0)],'latest':_0x4201be[_0x5418b0(0x123)]===_0x51b8c8,'created_at':_0x4201be[_0x5418b0(0x16a)]}));return await handleSDKOutput(_0x4a3cdc,_0x4b3a8b),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x142);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x1ec);async['execute'](_0x31a132){const _0x9334f0=a27_0x256e1e,{options:_0x3cfd96,args:_0x53d543,tdx:_0x57243}=_0x31a132,_0x1345e6=_0x53d543[0x0];if(!requireNameOrPath(_0x1345e6))return 0x1;if(_0x3cfd96[_0x9334f0(0x12e)])console[_0x9334f0(0x1b3)](_0x9334f0(0x1ac)+_0x1345e6);const {journeyId:_0x205371,journeyName:_0xe4263a}=await resolveJourneyIdFromInput(_0x1345e6,_0x3cfd96,_0x57243);if(!_0x3cfd96['yes']){const _0x319c1f=await confirm(_0x9334f0(0x1f4)+_0xe4263a+'\x22?');if(!_0x319c1f)return console[_0x9334f0(0x1b3)](_0x9334f0(0x14a)),0x0;}const _0x5e0422=await withSpinner(_0x9334f0(0x151),()=>_0x57243[_0x9334f0(0x13b)]['createVersion'](_0x205371),{'verbose':_0x3cfd96['verbose']}),_0x597216=_0x5e0422[_0x9334f0(0x158)];return console['error'](a27_0x13d74a[_0x9334f0(0x11a)]('✔')+_0x9334f0(0x1a5)+_0x597216[_0x9334f0(0xfb)][_0x9334f0(0xfa)]+'\x20(draft)\x20—\x20\x22'+_0x597216['attributes'][_0x9334f0(0x1e2)]+'\x22'),console[_0x9334f0(0x1b3)](_0x9334f0(0xf7)+_0x597216['id']),await handleSingleObjectOutput({'id':_0x597216['id'],'name':_0x597216[_0x9334f0(0xfb)][_0x9334f0(0x1e2)],'version':_0x597216['attributes'][_0x9334f0(0xfa)],'state':_0x597216[_0x9334f0(0xfb)][_0x9334f0(0x188)],'bundle_id':_0x597216['attributes'][_0x9334f0(0x15c)],'created_at':_0x597216[_0x9334f0(0xfb)]['createdAt']},_0x3cfd96),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x256e1e(0x1e2)]=a27_0x256e1e(0x118);[a27_0x256e1e(0x1f5)]=a27_0x256e1e(0x190);async[a27_0x256e1e(0x18c)](_0x330730){const _0x5b31a0=a27_0x256e1e,{options:_0x1f1c10,args:_0x589cea,tdx:_0x56b6b6}=_0x330730,_0x4d6200=_0x589cea[0x0];if(!requireNameOrPath(_0x4d6200))return 0x1;const _0x520a32=_0x1f1c10['version'];if(!_0x520a32)return console['error'](_0x5b31a0(0x109)),console['error'](_0x5b31a0(0xec)),0x1;const _0x31d75c=parseInt(_0x520a32,0xa);if(isNaN(_0x31d75c)||_0x31d75c<0x1)return console[_0x5b31a0(0x1b3)](_0x5b31a0(0x197)+_0x520a32),0x1;if(_0x1f1c10[_0x5b31a0(0x12e)])console['error'](_0x5b31a0(0x1ac)+_0x4d6200+_0x5b31a0(0x115)+_0x31d75c);const {journeyId:_0xb63c72,parentSegmentId:_0x5c846f}=await resolveJourneyIdFromInput(_0x4d6200,_0x1f1c10,_0x56b6b6),_0x2eac85=await withSpinner(_0x5b31a0(0x1eb),()=>_0x56b6b6[_0x5b31a0(0x13b)][_0x5b31a0(0x1b4)](_0xb63c72),{'verbose':_0x1f1c10['verbose']}),{versions:_0x4d6cf0,latestJourneyId:_0x3d4f7a}=_0x2eac85['data'],_0x574667=_0x4d6cf0[_0x5b31a0(0xf6)](_0x3adbe5=>_0x3adbe5[_0x5b31a0(0xfa)]===_0x31d75c);if(!_0x574667){const _0x56cd13=_0x4d6cf0[_0x5b31a0(0x16e)](_0x3edd90=>'v'+_0x3edd90['versionNumber'])[_0x5b31a0(0x122)](',\x20');return console['error']('Error:\x20Version\x20'+_0x31d75c+_0x5b31a0(0x1a8)+_0x56cd13),0x1;}const _0x17b0e6=await withSpinner(_0x5b31a0(0x1ef)+_0x31d75c+'\x20details...',()=>_0x56b6b6['journey'][_0x5b31a0(0x164)](_0x574667[_0x5b31a0(0x123)]),{'verbose':_0x1f1c10['verbose']}),_0x28c22f=_0x17b0e6[_0x5b31a0(0x158)],_0x3d85dd=getConsoleNextUrl(_0x1f1c10[_0x5b31a0(0x1c2)],_0x5b31a0(0x15b)+_0x5c846f+'/e/'+_0x574667[_0x5b31a0(0x123)]+_0x5b31a0(0x187));return await handleSingleObjectOutput({'id':_0x28c22f['id'],'name':_0x28c22f[_0x5b31a0(0xfb)]['name'],'version':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0xfa)],'description':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x1f5)],'state':_0x28c22f['attributes'][_0x5b31a0(0x188)],'paused':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x1c0)],'reentry_mode':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0xee)],'stages':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x1ab)]?.['length']||0x0,..._0x28c22f['attributes'][_0x5b31a0(0x110)]&&{'goal':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x110)][_0x5b31a0(0x1e2)]},'latest':_0x574667[_0x5b31a0(0x123)]===_0x3d4f7a,'created_at':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x16a)],'updated_at':_0x28c22f[_0x5b31a0(0xfb)][_0x5b31a0(0x179)],'url':_0x3d85dd},_0x1f1c10),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x572800=a28_0x14c7;(function(_0x94ea37,_0x3105e9){const _0x5690cd=a28_0x14c7,_0x41ec2=_0x94ea37();while(!![]){try{const _0x16927e=-parseInt(_0x5690cd(0x172))/0x1*(-parseInt(_0x5690cd(0x168))/0x2)+parseInt(_0x5690cd(0x142))/0x3+parseInt(_0x5690cd(0x15c))/0x4+parseInt(_0x5690cd(0x169))/0x5*(parseInt(_0x5690cd(0x14e))/0x6)+-parseInt(_0x5690cd(0x141))/0x7+-parseInt(_0x5690cd(0x173))/0x8*(parseInt(_0x5690cd(0x14b))/0x9)+-parseInt(_0x5690cd(0x156))/0xa*(parseInt(_0x5690cd(0x14f))/0xb);if(_0x16927e===_0x3105e9)break;else _0x41ec2['push'](_0x41ec2['shift']());}catch(_0x3f0dea){_0x41ec2['push'](_0x41ec2['shift']());}}}(a28_0x3db0,0xecb13));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x3db0(){const _0x32afdd=['reason','errorCode','5920530cyIYeR','1497618wsxIZV','validCount','Error:\x20','parentSegment','\x20journey(s)\x20with\x20errors,\x20','verbose','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20segment\x20file(s)\x20skipped','yellow','5985cKkJiK','helpText','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','57234btnLUB','393635UVERhk','.yaml','no_parent','errors','\x20valid','invalidCount','execute','380BEPpSM','valid','dim','cyan','description','\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','3778140UXgeNT','Validation\x20failed:\x20','skippedCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','endsWith','.yml','name','length','log','warningCount','relativePath','message','194162PCkPkk','70YeUiOu','\x20segment\x20file(s)\x20skipped)','journey:validate','green','\x20warning(s)\x20found','red','\x20warning(s)','\x20(skipped:\x20','\x20journey(s)\x20valid','19RoGGHZ','2968BRAOAx','Validate\x20journey\x20YAML\x20files','error','hasErrors'];a28_0x3db0=function(){return _0x32afdd;};return a28_0x3db0();}function a28_0x14c7(_0x4552d4,_0x224f25){_0x4552d4=_0x4552d4-0x140;const _0x3db0aa=a28_0x3db0();let _0x14c70c=_0x3db0aa[_0x4552d4];return _0x14c70c;}import a28_0x5d46ac from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x572800(0x162)]=a28_0x572800(0x16b);[a28_0x572800(0x15a)]=a28_0x572800(0x174);async[a28_0x572800(0x155)](_0x281705){const _0x42d217=a28_0x572800,{options:_0x38488d,args:_0x17d7ad}=_0x281705,_0x2fe754=_0x38488d,_0x57041f=await resolveTarget({'arg':_0x17d7ad[0x0],'contextParent':_0x38488d[_0x42d217(0x145)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x57041f))return _0x57041f[_0x42d217(0x140)]===_0x42d217(0x151)?(console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x14a)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x42d217(0x175)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console['error'](_0x42d217(0x15b)),console[_0x42d217(0x175)](_0x42d217(0x148))):(console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x16e)](_0x42d217(0x144)+_0x57041f[_0x42d217(0x167)]+'\x0a')),_0x57041f[_0x42d217(0x14c)]&&console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x159)](_0x57041f[_0x42d217(0x14c)]))),0x1;const _0x1af4a8=_0x57041f['targetDir'],_0xf12747=_0x57041f['type']==='file'?_0x57041f['filePath']:undefined;if(!_0xf12747&&!existsSync(_0x1af4a8))return console['error'](a28_0x5d46ac[_0x42d217(0x16e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1af4a8+'\x0a')),0x1;let _0x5d8f85;if(_0xf12747){if(!_0xf12747[_0x42d217(0x160)](_0x42d217(0x161))&&!_0xf12747[_0x42d217(0x160)](_0x42d217(0x150)))return console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x16e)](_0x42d217(0x15f)+_0xf12747+'\x0a')),0x1;_0x5d8f85=[_0xf12747];}else _0x5d8f85=findYamlFiles(_0x1af4a8);if(_0x5d8f85[_0x42d217(0x163)]===0x0)return console[_0x42d217(0x175)](a28_0x5d46ac['red'](_0x42d217(0x14d)+_0x1af4a8+'\x0a')),0x1;const _0x43475d=validateYamlFiles(_0x5d8f85,_0x1af4a8,{'filterType':'journey'}),_0x1ced2b=calculateSummary(_0x43475d),_0x3b603f=_0x43475d['filter'](isValidationResult);if(_0x3b603f[_0x42d217(0x163)]===0x0)return console['error'](a28_0x5d46ac['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x1af4a8+'\x0a')),_0x1ced2b[_0x42d217(0x15e)]>0x0&&console[_0x42d217(0x175)](a28_0x5d46ac[_0x42d217(0x158)]('('+_0x1ced2b[_0x42d217(0x15e)]+_0x42d217(0x16a))),0x0;for(const _0x3b78e3 of _0x43475d){if(!isValidationResult(_0x3b78e3)){_0x2fe754['verbose']&&console[_0x42d217(0x164)](a28_0x5d46ac['dim']('-\x20'+_0x3b78e3[_0x42d217(0x166)]+_0x42d217(0x170)+_0x3b78e3[_0x42d217(0x177)]+')'));continue;}const {relativePath:_0x589e05,source:_0xf3ca9a,result:_0x4da0ac}=_0x3b78e3;if(_0x4da0ac[_0x42d217(0x157)]&&_0x4da0ac['warnings'][_0x42d217(0x163)]===0x0)_0x2fe754[_0x42d217(0x147)]&&console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x16c)]('✔\x20'+_0x589e05));else _0x4da0ac['valid']?(console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x14a)]('⚠\x20'+_0x589e05+':\x20'+_0x4da0ac['warnings'][_0x42d217(0x163)]+_0x42d217(0x16f))),console[_0x42d217(0x164)](formatValidationResult(_0x4da0ac,_0xf3ca9a,_0x589e05))):(console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x16e)]('✖\x20'+_0x589e05+':\x20'+_0x4da0ac[_0x42d217(0x152)][_0x42d217(0x163)]+'\x20error(s)')),console['log'](formatValidationResult(_0x4da0ac,_0xf3ca9a,_0x589e05)));}return console['log'](''),_0x1ced2b[_0x42d217(0x176)]?(console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x16e)](_0x42d217(0x15d)+_0x1ced2b[_0x42d217(0x154)]+_0x42d217(0x146)+_0x1ced2b[_0x42d217(0x143)]+_0x42d217(0x153))),_0x1ced2b[_0x42d217(0x165)]>0x0&&console['log'](a28_0x5d46ac[_0x42d217(0x14a)](_0x1ced2b[_0x42d217(0x165)]+_0x42d217(0x16d))),_0x1ced2b[_0x42d217(0x15e)]>0x0&&console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x158)](_0x1ced2b['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x1):(console['log'](a28_0x5d46ac[_0x42d217(0x16c)]('✔\x20All\x20'+_0x1ced2b['validCount']+_0x42d217(0x171))),_0x1ced2b[_0x42d217(0x165)]>0x0&&console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x14a)](_0x1ced2b[_0x42d217(0x165)]+_0x42d217(0x16d))),_0x1ced2b[_0x42d217(0x15e)]>0x0&&console[_0x42d217(0x164)](a28_0x5d46ac[_0x42d217(0x158)](_0x1ced2b[_0x42d217(0x15e)]+_0x42d217(0x149))),0x0);}}
|