@treasuredata/tdx 2026.4.15 → 2026.4.16
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.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x366c7f=a25_0x5884;(function(_0x33eaed,_0x15a6de){const _0x54a13d=a25_0x5884,_0x3c9748=_0x33eaed();while(!![]){try{const _0x25c260=-parseInt(_0x54a13d(0x158))/0x1+-parseInt(_0x54a13d(0x145))/0x2*(parseInt(_0x54a13d(0x141))/0x3)+-parseInt(_0x54a13d(0x15f))/0x4+-parseInt(_0x54a13d(0x152))/0x5+-parseInt(_0x54a13d(0x147))/0x6*(parseInt(_0x54a13d(0x138))/0x7)+-parseInt(_0x54a13d(0x149))/0x8+-parseInt(_0x54a13d(0x153))/0x9*(-parseInt(_0x54a13d(0x13a))/0xa);if(_0x25c260===_0x15a6de)break;else _0x3c9748['push'](_0x3c9748['shift']());}catch(_0x444f9d){_0x3c9748['push'](_0x3c9748['shift']());}}}(a25_0xc8ce,0xc9a36));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x30ae82 from'chalk';import a25_0x5a815f from'path';function a25_0xc8ce(){const _0x1ff821=['7509360LixfRH','\x20warning(s)','✔\x20All\x20','\x20non-template\x20file(s)\x20skipped','relativePath','Validation\x20failed:\x20','dirname','warningCount','green','7185455GKfgFD','96453vTyTDG','valid','filter','skippedCount','validCount','1429331Nkokga','red','No\x20template\x20YAML\x20files\x20found\x20in\x20','.yml','endsWith','error','yellow','5152504TTdSRc','dim','Validate\x20template\x20YAML\x20files','name','665JYqtEd','length','5970WAjQJH','template','log','resolve','\x20template(s)\x20with\x20errors,\x20','warnings','engage:template:validate','416463yzMxCF','invalidCount','\x20warning(s)\x20found','cwd','2JENDNx','\x20template(s)\x20valid','21480PuUkeD','\x20non-template\x20file(s)\x20skipped)'];a25_0xc8ce=function(){return _0x1ff821;};return a25_0xc8ce();}function a25_0x5884(_0x5474cb,_0x58c1bf){_0x5474cb=_0x5474cb-0x138;const _0xc8cec1=a25_0xc8ce();let _0x58846b=_0xc8cec1[_0x5474cb];return _0x58846b;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x366c7f(0x162)]=a25_0x366c7f(0x140);['description']=a25_0x366c7f(0x161);async['execute'](_0x444106){const _0x421adb=a25_0x366c7f,{options:_0x350466,args:_0x8514c1}=_0x444106,_0x5d7026=_0x350466,_0x23134b=_0x8514c1[0x0],_0xfdfc6e=_0x23134b?a25_0x5a815f[_0x421adb(0x13d)](_0x23134b):undefined,_0x101b1f=_0xfdfc6e?isYamlFile(_0xfdfc6e):![];let _0x1297af,_0x4a83a1;if(_0x101b1f&&_0xfdfc6e)_0x1297af=a25_0x5a815f[_0x421adb(0x14f)](_0xfdfc6e),_0x4a83a1=_0xfdfc6e;else _0xfdfc6e?_0x1297af=_0xfdfc6e:_0x1297af=process[_0x421adb(0x144)]();if(!_0x4a83a1&&!existsSync(_0x1297af))return console[_0x421adb(0x15d)](a25_0x30ae82[_0x421adb(0x159)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1297af+'\x0a')),0x1;let _0xfc5ae;if(_0x4a83a1){if(!_0x4a83a1[_0x421adb(0x15c)](_0x421adb(0x15b))&&!_0x4a83a1[_0x421adb(0x15c)]('.yaml'))return console[_0x421adb(0x15d)](a25_0x30ae82[_0x421adb(0x159)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x4a83a1+'\x0a')),0x1;_0xfc5ae=[_0x4a83a1];}else _0xfc5ae=findYamlFiles(_0x1297af);if(_0xfc5ae[_0x421adb(0x139)]===0x0)return console[_0x421adb(0x15d)](a25_0x30ae82[_0x421adb(0x159)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x1297af+'\x0a')),0x1;const _0x2845e4=validateYamlFiles(_0xfc5ae,_0x1297af,{'filterType':_0x421adb(0x13b)}),_0x1ae722=calculateSummary(_0x2845e4),_0x197962=_0x2845e4[_0x421adb(0x155)](isValidationResult);if(_0x197962[_0x421adb(0x139)]===0x0)return console['error'](a25_0x30ae82['yellow'](_0x421adb(0x15a)+_0x1297af+'\x0a')),_0x1ae722[_0x421adb(0x156)]>0x0&&console[_0x421adb(0x15d)](a25_0x30ae82[_0x421adb(0x160)]('('+_0x1ae722[_0x421adb(0x156)]+_0x421adb(0x148))),0x0;for(const _0x4cb7a1 of _0x2845e4){if(!isValidationResult(_0x4cb7a1)){_0x5d7026['verbose']&&console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x160)]('-\x20'+_0x4cb7a1[_0x421adb(0x14d)]+'\x20(skipped:\x20'+_0x4cb7a1['reason']+')'));continue;}const {relativePath:_0x11e8d8,source:_0x4f0ff1,result:_0x6b3955}=_0x4cb7a1;if(_0x6b3955['valid']&&_0x6b3955[_0x421adb(0x13f)][_0x421adb(0x139)]===0x0)_0x5d7026['verbose']&&console['log'](a25_0x30ae82[_0x421adb(0x151)]('✔\x20'+_0x11e8d8));else _0x6b3955[_0x421adb(0x154)]?(console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x15e)]('⚠\x20'+_0x11e8d8+':\x20'+_0x6b3955['warnings'][_0x421adb(0x139)]+_0x421adb(0x14a))),console[_0x421adb(0x13c)](formatValidationResult(_0x6b3955,_0x4f0ff1,_0x11e8d8))):(console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x159)]('✖\x20'+_0x11e8d8+':\x20'+_0x6b3955['errors'][_0x421adb(0x139)]+'\x20error(s)')),console[_0x421adb(0x13c)](formatValidationResult(_0x6b3955,_0x4f0ff1,_0x11e8d8)));}return console['log'](''),_0x1ae722['hasErrors']?(console['log'](a25_0x30ae82[_0x421adb(0x159)](_0x421adb(0x14e)+_0x1ae722[_0x421adb(0x142)]+_0x421adb(0x13e)+_0x1ae722[_0x421adb(0x157)]+'\x20valid')),_0x1ae722[_0x421adb(0x150)]>0x0&&console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x15e)](_0x1ae722[_0x421adb(0x150)]+'\x20warning(s)\x20found')),_0x1ae722[_0x421adb(0x156)]>0x0&&console[_0x421adb(0x13c)](a25_0x30ae82['dim'](_0x1ae722['skippedCount']+_0x421adb(0x14c))),0x1):(console[_0x421adb(0x13c)](a25_0x30ae82[_0x421adb(0x151)](_0x421adb(0x14b)+_0x1ae722[_0x421adb(0x157)]+_0x421adb(0x146))),_0x1ae722[_0x421adb(0x150)]>0x0&&console[_0x421adb(0x13c)](a25_0x30ae82['yellow'](_0x1ae722[_0x421adb(0x150)]+_0x421adb(0x143))),_0x1ae722[_0x421adb(0x156)]>0x0&&console[_0x421adb(0x13c)](a25_0x30ae82['dim'](_0x1ae722[_0x421adb(0x156)]+_0x421adb(0x14c))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x1c5d7a=a26_0x15ca;(function(_0x4b9d22,_0xe53b88){const _0xdef022=a26_0x15ca,_0x20a7f5=_0x4b9d22();while(!![]){try{const _0x3a95ee=parseInt(_0xdef022(0x171))/0x1*(parseInt(_0xdef022(0x172))/0x2)+-parseInt(_0xdef022(0x1c4))/0x3*(parseInt(_0xdef022(0x196))/0x4)+parseInt(_0xdef022(0x199))/0x5+-parseInt(_0xdef022(0x181))/0x6+-parseInt(_0xdef022(0x17e))/0x7*(parseInt(_0xdef022(0x17c))/0x8)+-parseInt(_0xdef022(0x184))/0x9+parseInt(_0xdef022(0x18f))/0xa*(parseInt(_0xdef022(0x179))/0xb);if(_0x3a95ee===_0xe53b88)break;else _0x20a7f5['push'](_0x20a7f5['shift']());}catch(_0x439865){_0x20a7f5['push'](_0x20a7f5['shift']());}}}(a26_0x1667,0x2a82b));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_0x86c6b7 from'chalk';function formatDuration(_0x17c590){const _0x102f58=a26_0x15ca;if(_0x17c590<0x3c)return _0x17c590+'s';if(_0x17c590<0xe10)return Math[_0x102f58(0x1b7)](_0x17c590/0x3c)+'m\x20'+_0x17c590%0x3c+'s';const _0x195227=Math['floor'](_0x17c590/0xe10),_0x28392a=Math['floor'](_0x17c590%0xe10/0x3c);return _0x28392a>0x0?_0x195227+'h\x20'+_0x28392a+'m':_0x195227+'h';}function formatRelativeTime(_0x41f3d1){const _0x483ff7=a26_0x15ca,_0x219781=Date[_0x483ff7(0x1ac)]()-_0x41f3d1['getTime'](),_0x5ba276=Math['floor'](Math[_0x483ff7(0x17f)](_0x219781)/0x3e8);if(_0x5ba276<0x3c)return _0x483ff7(0x198);const _0x591592=Math[_0x483ff7(0x1b7)](_0x5ba276/0x3c);if(_0x591592<0x3c)return _0x591592+_0x483ff7(0x1a2);const _0x1d8f5c=Math[_0x483ff7(0x1b7)](_0x591592/0x3c);if(_0x1d8f5c<0x18)return _0x1d8f5c+_0x483ff7(0x1be);const _0xd92733=Math['floor'](_0x1d8f5c/0x18);if(_0xd92733<0x1e)return _0xd92733+_0x483ff7(0x1a9);return Math['floor'](_0xd92733/0x1e)+'mo\x20ago';}function a26_0x15ca(_0x50e865,_0x13cfc3){_0x50e865=_0x50e865-0x16a;const _0x166737=a26_0x1667();let _0x15caf6=_0x166737[_0x50e865];return _0x15caf6;}export class JobListCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x18e);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x197);async[a26_0x1c5d7a(0x1a1)](_0x4374b5){const _0x31cd4c=a26_0x1c5d7a,{options:_0x505ddd,tdx:_0x341ca3}=_0x4374b5,_0x8d9cf=resolveLimit(_0x505ddd['limit'],DEFAULT_DISPLAY_LIMIT),_0x45ebff=_0x505ddd['status'];_0x505ddd[_0x31cd4c(0x1c0)]&&(console['error'](_0x31cd4c(0x176)+_0x8d9cf+_0x31cd4c(0x17b)),_0x45ebff&&console[_0x31cd4c(0x1ad)](_0x31cd4c(0x1b5)+_0x45ebff));const _0x4aca3a=await withSpinner(_0x31cd4c(0x1b4),()=>_0x341ca3[_0x31cd4c(0x18e)][_0x31cd4c(0x1b9)]({'from':0x0,'to':_0x8d9cf-0x1,'status':_0x45ebff}),{'verbose':_0x505ddd[_0x31cd4c(0x1c0)]}),_0x5a0054=_0x4aca3a[_0x31cd4c(0x16b)];console[_0x31cd4c(0x1ad)](_0x31cd4c(0x1c5)+_0x5a0054['length']+'\x20job'+(_0x5a0054[_0x31cd4c(0x18c)]!==0x1?'s':''));const _0x285ced=_0x505ddd[_0x31cd4c(0x187)];if(isStructuredFormat(_0x505ddd)){const _0x28ecda=_0x5a0054[_0x31cd4c(0x16e)](_0x3406cc=>{const _0x24c9ec=_0x31cd4c;let _0x3bf25b;if(_0x3406cc[_0x24c9ec(0x194)]&&_0x3406cc['end_at']){const _0x49551a=new Date(_0x3406cc[_0x24c9ec(0x194)])['getTime'](),_0x130666=new Date(_0x3406cc[_0x24c9ec(0x1a4)])[_0x24c9ec(0x1bc)]();_0x3bf25b=Math['round']((_0x130666-_0x49551a)/0x3e8);}return{'job_id':_0x3406cc[_0x24c9ec(0x1b2)],'type':_0x3406cc[_0x24c9ec(0x189)]===_0x24c9ec(0x1b3)?'trino':_0x3406cc[_0x24c9ec(0x189)],'status':_0x3406cc['status'],'user_name':_0x3406cc[_0x24c9ec(0x1aa)],'duration_sec':_0x3bf25b,'created_at':_0x3406cc[_0x24c9ec(0x1ba)],'started_at':_0x3406cc[_0x24c9ec(0x194)],'end_at':_0x3406cc[_0x24c9ec(0x1a4)]};});await handleSDKOutput(_0x28ecda,_0x505ddd);}else for(const _0x8e7357 of _0x5a0054){const _0x374810=_0x8e7357['status']==='success'?a26_0x86c6b7['green']:_0x8e7357[_0x31cd4c(0x1b6)]===_0x31cd4c(0x1ad)?a26_0x86c6b7['red']:a26_0x86c6b7['dim'],_0x430736=_0x374810(_0x8e7357[_0x31cd4c(0x1b6)]),_0x38f720=getJobUrl(_0x285ced,_0x8e7357['job_id']),_0x432556=hyperlink(_0x8e7357[_0x31cd4c(0x1b2)],_0x38f720),_0x4fcc1c=a26_0x86c6b7[_0x31cd4c(0x195)](_0x8e7357[_0x31cd4c(0x189)]===_0x31cd4c(0x1b3)?_0x31cd4c(0x1b8):_0x8e7357[_0x31cd4c(0x189)]),_0x2d42cc=[];if(_0x8e7357['start_at']&&_0x8e7357[_0x31cd4c(0x1a4)]){const _0x411254=Math[_0x31cd4c(0x170)]((new Date(_0x8e7357['end_at'])['getTime']()-new Date(_0x8e7357[_0x31cd4c(0x194)])[_0x31cd4c(0x1bc)]())/0x3e8);_0x2d42cc[_0x31cd4c(0x1c2)](formatDuration(_0x411254));}if(_0x8e7357[_0x31cd4c(0x1a4)])_0x2d42cc[_0x31cd4c(0x1c2)](formatRelativeTime(new Date(_0x8e7357[_0x31cd4c(0x1a4)])));else _0x8e7357[_0x31cd4c(0x194)]&&_0x2d42cc[_0x31cd4c(0x1c2)](formatRelativeTime(new Date(_0x8e7357[_0x31cd4c(0x194)])));const _0x3e9146=_0x2d42cc[_0x31cd4c(0x18c)]>0x0?a26_0x86c6b7[_0x31cd4c(0x195)]('\x20'+_0x2d42cc['join'](',\x20')):'';console[_0x31cd4c(0x186)]('⚡\x20'+_0x432556+'\x20'+_0x4fcc1c+'\x20'+_0x430736+_0x3e9146);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x1c5d7a(0x19a);[a26_0x1c5d7a(0x1b1)]='Show\x20job\x20details';['validate'](_0x3c7def){const _0x2ee969=a26_0x1c5d7a,_0x471a26=_0x3c7def['args'][0x0];if(!_0x471a26)return _0x2ee969(0x1a0);return undefined;}async[a26_0x1c5d7a(0x1a1)](_0x48ab9a){const _0x5dd5bb=a26_0x1c5d7a,{options:_0x555ef6,args:_0x4fa100,tdx:_0x4dae61}=_0x48ab9a,_0xffc6d8=_0x4fa100[0x0],_0x3ca7cb=await withSpinner(_0x5dd5bb(0x190),()=>_0x4dae61[_0x5dd5bb(0x18e)]['show'](_0xffc6d8),{'verbose':_0x555ef6[_0x5dd5bb(0x1c0)]}),_0x57b5d7=_0x3ca7cb[_0x5dd5bb(0x16b)];let _0x347123;if(_0x57b5d7[_0x5dd5bb(0x194)]&&_0x57b5d7[_0x5dd5bb(0x1a4)]){const _0x1f050a=new Date(_0x57b5d7[_0x5dd5bb(0x194)])[_0x5dd5bb(0x1bc)](),_0x495cb1=new Date(_0x57b5d7[_0x5dd5bb(0x1a4)])[_0x5dd5bb(0x1bc)]();_0x347123=Math['round']((_0x495cb1-_0x1f050a)/0x3e8);}const _0x5ce454={'job_id':_0x57b5d7[_0x5dd5bb(0x1b2)],'type':_0x57b5d7[_0x5dd5bb(0x189)],'status':_0x57b5d7[_0x5dd5bb(0x1b6)],..._0x57b5d7[_0x5dd5bb(0x1aa)]&&{'user_name':_0x57b5d7[_0x5dd5bb(0x1aa)]},..._0x347123!==undefined&&{'duration_sec':_0x347123},..._0x57b5d7[_0x5dd5bb(0x1ba)]&&{'created_at':_0x57b5d7[_0x5dd5bb(0x1ba)]},..._0x57b5d7['start_at']&&{'started_at':_0x57b5d7['start_at']},..._0x57b5d7[_0x5dd5bb(0x1a4)]&&{'end_at':_0x57b5d7[_0x5dd5bb(0x1a4)]},..._0x57b5d7[_0x5dd5bb(0x174)]&&{'database':_0x57b5d7[_0x5dd5bb(0x174)]},..._0x57b5d7['priority']!==undefined&&{'priority':_0x57b5d7[_0x5dd5bb(0x1bb)]},..._0x57b5d7['url']&&{'url':_0x57b5d7[_0x5dd5bb(0x16a)]},..._0x57b5d7[_0x5dd5bb(0x1a6)]&&{'query':_0x57b5d7[_0x5dd5bb(0x1a6)]},..._0x57b5d7[_0x5dd5bb(0x17a)]&&{'debug':_0x57b5d7[_0x5dd5bb(0x17a)]}};return await handleSingleObjectOutput(_0x5ce454,_0x555ef6),0x0;}}function a26_0x1667(){const _0x5d999e=['2071926VhMxIe','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','log','site','job:result','type','INVALID_ARGUMENT','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','length','Query:\x20','jobs','23990AnSgLo','Getting\x20job\x20details...','jobType','job:submit','job:kill','start_at','dim','1492nvDYUf','List\x20jobs','just\x20now','740265wCQcfa','job:show','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Kill\x20a\x20job','args','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','execute','m\x20ago','Submitting\x20job...','end_at','validate','query','hive','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','user_name','Getting\x20job\x20results...','now','error','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Get\x20job\x20results','\x27\x20to\x20verify\x20the\x20job\x20status','description','job_id','presto','Listing\x20jobs...','Status\x20filter:\x20','status','floor','trino','list','created_at','priority','getTime','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','h\x20ago','...','verbose','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','push','✔\x20Retrieved\x20','141NsHbLT','✔\x20Found\x20','url','data','result','information_schema','map','kill','round','2UMRkqO','291580kunYVm','submit','database','name','Limit:\x20','Cancelled','No\x20SQL\x20statements\x20found\x20in\x20file','1650dgwIiB','debug','\x20jobs','8vuIgfl','\x20\x20Job\x20ID:\x20','1574181mLPkec','abs','file','916392xeNsMz','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Submitting\x20kill\x20request...'];a26_0x1667=function(){return _0x5d999e;};return a26_0x1667();}export class JobKillCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x193);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x19d);['validate'](_0x330b17){const _0x3b30ec=a26_0x1c5d7a,_0x57a19d=_0x330b17[_0x3b30ec(0x19e)][0x0];if(!_0x57a19d)return _0x3b30ec(0x19c);return undefined;}async['execute'](_0x53cb06){const _0x20404c=a26_0x1c5d7a,{options:_0x55b151,args:_0x59f173,tdx:_0x1492b3}=_0x53cb06,_0x2a5334=_0x59f173[0x0];if(!_0x55b151['yes']){const _0x375bcc=await confirm(_0x20404c(0x18b)+_0x2a5334+'?');if(!_0x375bcc)return console['error'](_0x20404c(0x177)),0x0;}return await withSpinner(_0x20404c(0x183),()=>_0x1492b3[_0x20404c(0x18e)][_0x20404c(0x16f)](_0x2a5334),{'verbose':_0x55b151[_0x20404c(0x1c0)]}),console[_0x20404c(0x1ad)](_0x20404c(0x1ae)+_0x2a5334),console[_0x20404c(0x1ad)](_0x20404c(0x1bd)+_0x2a5334+_0x20404c(0x1b0)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x192);[a26_0x1c5d7a(0x1b1)]='Submit\x20a\x20job';async['execute'](_0x38efcc){const _0x3d2b5a=a26_0x1c5d7a,{options:_0x3b2f82,args:_0x5a506b,tdx:_0x21f0fb}=_0x38efcc,_0x343a9b=_0x3b2f82[_0x3d2b5a(0x191)]||_0x3d2b5a(0x1b8),_0x4a776f=_0x3b2f82[_0x3d2b5a(0x180)],_0x2b068f=_0x3b2f82['database']||_0x3d2b5a(0x16d),_0xd0d2e1=_0x3b2f82[_0x3d2b5a(0x16c)];if(_0x343a9b!==_0x3d2b5a(0x1b8)&&_0x343a9b!==_0x3d2b5a(0x1a7))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3d2b5a(0x185));let _0x52f74e;if(_0x4a776f){if(_0x5a506b[0x0])throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],_0x3d2b5a(0x1a8));const _0x251f40=readSqlStatementsFromFile(_0x4a776f);if(_0x251f40[_0x3d2b5a(0x18c)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3d2b5a(0x178));if(_0x251f40[_0x3d2b5a(0x18c)]>0x1)throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x52f74e=_0x251f40[0x0];}else{if(!_0x5a506b[0x0])throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],_0x3d2b5a(0x1c1));_0x52f74e=_0x5a506b[0x0];}_0x3b2f82[_0x3d2b5a(0x1c0)]&&(console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x19f)+_0x343a9b),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x19b)+_0x2b068f),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x18d)+_0x52f74e['substring'](0x0,0x64)+(_0x52f74e[_0x3d2b5a(0x18c)]>0x64?_0x3d2b5a(0x1bf):'')));const _0x3db1ab=await withSpinner(_0x3d2b5a(0x1a3),()=>_0x21f0fb[_0x3d2b5a(0x18e)][_0x3d2b5a(0x173)](_0x2b068f,_0x52f74e,_0x343a9b,_0xd0d2e1),{'verbose':_0x3b2f82[_0x3d2b5a(0x1c0)]}),_0x1430c3=_0x3db1ab[_0x3d2b5a(0x16b)];return console['error']('✔\x20Job\x20submitted'),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x17d)+_0x1430c3[_0x3d2b5a(0x1b2)]),await handleSDKOutput([_0x1430c3],_0x3b2f82),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x188);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x1af);[a26_0x1c5d7a(0x1a5)](_0x276926){const _0x22fea4=a26_0x1c5d7a,_0x376db2=_0x276926['args'][0x0];if(!_0x376db2)return _0x22fea4(0x182);return undefined;}async[a26_0x1c5d7a(0x1a1)](_0x483c04){const _0x46901e=a26_0x1c5d7a,{options:_0x201d6c,args:_0x492825,tdx:_0x3d0436}=_0x483c04,_0x3e4ca7=_0x492825[0x0],_0x1a80c8=await withSpinner(_0x46901e(0x1ab),()=>_0x3d0436['jobs'][_0x46901e(0x16c)](_0x3e4ca7),{'verbose':_0x201d6c[_0x46901e(0x1c0)]}),_0xd15f19=_0x1a80c8['data'];return console['error'](_0x46901e(0x1c3)+_0xd15f19['length']+'\x20row'+(_0xd15f19[_0x46901e(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0xd15f19,_0x201d6c),0x0;}}
|
|
1
|
+
const a26_0x3de47c=a26_0x231f;(function(_0x1f2a3e,_0xe387c5){const _0x3d452c=a26_0x231f,_0x109442=_0x1f2a3e();while(!![]){try{const _0x193872=parseInt(_0x3d452c(0x1db))/0x1+parseInt(_0x3d452c(0x20f))/0x2*(-parseInt(_0x3d452c(0x1f1))/0x3)+-parseInt(_0x3d452c(0x1f0))/0x4+parseInt(_0x3d452c(0x213))/0x5*(parseInt(_0x3d452c(0x1df))/0x6)+parseInt(_0x3d452c(0x1c2))/0x7*(-parseInt(_0x3d452c(0x1f7))/0x8)+parseInt(_0x3d452c(0x1ce))/0x9+parseInt(_0x3d452c(0x201))/0xa*(parseInt(_0x3d452c(0x209))/0xb);if(_0x193872===_0xe387c5)break;else _0x109442['push'](_0x109442['shift']());}catch(_0x1ebaaa){_0x109442['push'](_0x109442['shift']());}}}(a26_0x3205,0x536d4));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_0x26e862 from'chalk';function formatDuration(_0x571f59){const _0x34976b=a26_0x231f;if(_0x571f59<0x3c)return _0x571f59+'s';if(_0x571f59<0xe10)return Math[_0x34976b(0x1eb)](_0x571f59/0x3c)+'m\x20'+_0x571f59%0x3c+'s';const _0x276974=Math[_0x34976b(0x1eb)](_0x571f59/0xe10),_0x4502be=Math[_0x34976b(0x1eb)](_0x571f59%0xe10/0x3c);return _0x4502be>0x0?_0x276974+'h\x20'+_0x4502be+'m':_0x276974+'h';}function formatRelativeTime(_0x501ea2){const _0x572b23=a26_0x231f,_0x1d3792=Date[_0x572b23(0x1ff)]()-_0x501ea2[_0x572b23(0x1ca)](),_0x191d08=Math[_0x572b23(0x1eb)](Math[_0x572b23(0x1ed)](_0x1d3792)/0x3e8);if(_0x191d08<0x3c)return _0x572b23(0x21a);const _0x3564c9=Math[_0x572b23(0x1eb)](_0x191d08/0x3c);if(_0x3564c9<0x3c)return _0x3564c9+'m\x20ago';const _0x348012=Math['floor'](_0x3564c9/0x3c);if(_0x348012<0x18)return _0x348012+'h\x20ago';const _0x5d4da3=Math['floor'](_0x348012/0x18);if(_0x5d4da3<0x1e)return _0x5d4da3+_0x572b23(0x1d9);return Math[_0x572b23(0x1eb)](_0x5d4da3/0x1e)+_0x572b23(0x1fd);}function a26_0x3205(){const _0x25a0e7=['67780yFuCIK','limit','name','kill','hive','Submitting\x20job...','type','site','440hYtanc','\x20job','\x20\x20Job\x20ID:\x20','submit','result','start_at','106mzjqHf','end_at','priority','created_at','137915zATwTh','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','status','verbose','map','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','query','just\x20now','Limit:\x20','push','Cancelled','7nFIICA','dim','job:submit','Status\x20filter:\x20','trino','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','round','\x20row','getTime','log','success','✔\x20Retrieved\x20','2908251wXuBGm','Getting\x20job\x20details...','show','✔\x20Job\x20submitted','length','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job_id','Kill\x20a\x20job','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','args','d\x20ago','join','285849Dzoteu','description','execute','jobType','138jKIZNp','data','INVALID_ARGUMENT','Database:\x20','Show\x20job\x20details','substring','Getting\x20job\x20results...','debug','green','\x27\x20to\x20verify\x20the\x20job\x20status','jobs','url','floor','presto','abs','Query:\x20','validate','2529196OiGBiI','6333VdAzUY','Submit\x20a\x20job','error','\x20jobs','red','job:show','3428952XcHhJZ','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','List\x20jobs','Get\x20job\x20results','user_name','job:kill','mo\x20ago','✔\x20Found\x20','now','database'];a26_0x3205=function(){return _0x25a0e7;};return a26_0x3205();}export class JobListCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1e9);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1f9);async[a26_0x3de47c(0x1dd)](_0x479285){const _0x24449e=a26_0x3de47c,{options:_0x25b5be,tdx:_0x3904be}=_0x479285,_0x46b8a2=resolveLimit(_0x25b5be[_0x24449e(0x202)],DEFAULT_DISPLAY_LIMIT),_0x3eef2e=_0x25b5be['status'];_0x25b5be[_0x24449e(0x216)]&&(console['error'](_0x24449e(0x21b)+_0x46b8a2+_0x24449e(0x1f4)),_0x3eef2e&&console[_0x24449e(0x1f3)](_0x24449e(0x1c5)+_0x3eef2e));const _0xb1e60f=await withSpinner('Listing\x20jobs...',()=>_0x3904be[_0x24449e(0x1e9)]['list']({'from':0x0,'to':_0x46b8a2-0x1,'status':_0x3eef2e}),{'verbose':_0x25b5be[_0x24449e(0x216)]}),_0x1b4ccb=_0xb1e60f[_0x24449e(0x1e0)];console['error'](_0x24449e(0x1fe)+_0x1b4ccb['length']+_0x24449e(0x20a)+(_0x1b4ccb['length']!==0x1?'s':''));const _0x29a54c=_0x25b5be[_0x24449e(0x208)];if(isStructuredFormat(_0x25b5be)){const _0x248cd0=_0x1b4ccb[_0x24449e(0x217)](_0x3b99ad=>{const _0x5e62cd=_0x24449e;let _0xf8f0ae;if(_0x3b99ad[_0x5e62cd(0x20e)]&&_0x3b99ad[_0x5e62cd(0x210)]){const _0x321e0e=new Date(_0x3b99ad['start_at'])[_0x5e62cd(0x1ca)](),_0x3eb50e=new Date(_0x3b99ad[_0x5e62cd(0x210)])[_0x5e62cd(0x1ca)]();_0xf8f0ae=Math[_0x5e62cd(0x1c8)]((_0x3eb50e-_0x321e0e)/0x3e8);}return{'job_id':_0x3b99ad['job_id'],'type':_0x3b99ad[_0x5e62cd(0x207)]===_0x5e62cd(0x1ec)?_0x5e62cd(0x1c6):_0x3b99ad['type'],'status':_0x3b99ad[_0x5e62cd(0x215)],'user_name':_0x3b99ad[_0x5e62cd(0x1fb)],'duration_sec':_0xf8f0ae,'created_at':_0x3b99ad[_0x5e62cd(0x212)],'started_at':_0x3b99ad['start_at'],'end_at':_0x3b99ad[_0x5e62cd(0x210)]};});await handleSDKOutput(_0x248cd0,_0x25b5be);}else for(const _0x456bd3 of _0x1b4ccb){const _0x4be940=_0x456bd3[_0x24449e(0x215)]===_0x24449e(0x1cc)?a26_0x26e862[_0x24449e(0x1e7)]:_0x456bd3[_0x24449e(0x215)]===_0x24449e(0x1f3)?a26_0x26e862[_0x24449e(0x1f5)]:a26_0x26e862[_0x24449e(0x1c3)],_0x22438b=_0x4be940(_0x456bd3[_0x24449e(0x215)]),_0x45b4d4=getJobUrl(_0x29a54c,_0x456bd3[_0x24449e(0x1d5)]),_0x4ee26b=hyperlink(_0x456bd3[_0x24449e(0x1d5)],_0x45b4d4),_0x37d4f6=a26_0x26e862[_0x24449e(0x1c3)](_0x456bd3['type']==='presto'?_0x24449e(0x1c6):_0x456bd3[_0x24449e(0x207)]),_0x3120e7=[];if(_0x456bd3[_0x24449e(0x20e)]&&_0x456bd3['end_at']){const _0x4f1f08=Math[_0x24449e(0x1c8)]((new Date(_0x456bd3[_0x24449e(0x210)])[_0x24449e(0x1ca)]()-new Date(_0x456bd3[_0x24449e(0x20e)])[_0x24449e(0x1ca)]())/0x3e8);_0x3120e7[_0x24449e(0x1c0)](formatDuration(_0x4f1f08));}if(_0x456bd3[_0x24449e(0x210)])_0x3120e7[_0x24449e(0x1c0)](formatRelativeTime(new Date(_0x456bd3['end_at'])));else _0x456bd3[_0x24449e(0x20e)]&&_0x3120e7[_0x24449e(0x1c0)](formatRelativeTime(new Date(_0x456bd3['start_at'])));const _0x4b26e9=_0x3120e7[_0x24449e(0x1d2)]>0x0?a26_0x26e862['dim']('\x20'+_0x3120e7[_0x24449e(0x1da)](',\x20')):'';console[_0x24449e(0x1cb)]('⚡\x20'+_0x4ee26b+'\x20'+_0x37d4f6+'\x20'+_0x22438b+_0x4b26e9);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1f6);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1e3);[a26_0x3de47c(0x1ef)](_0x5de47f){const _0x2cd9d5=a26_0x3de47c,_0xd27d4f=_0x5de47f[_0x2cd9d5(0x1d8)][0x0];if(!_0xd27d4f)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x3de47c(0x1dd)](_0x3c5f6c){const _0x4dc8c2=a26_0x3de47c,{options:_0x5b8a55,args:_0x757920,tdx:_0x13ade6}=_0x3c5f6c,_0x31c018=_0x757920[0x0],_0x58298f=await withSpinner(_0x4dc8c2(0x1cf),()=>_0x13ade6[_0x4dc8c2(0x1e9)][_0x4dc8c2(0x1d0)](_0x31c018),{'verbose':_0x5b8a55[_0x4dc8c2(0x216)]}),_0x2d414f=_0x58298f[_0x4dc8c2(0x1e0)];let _0x383b8e;if(_0x2d414f[_0x4dc8c2(0x20e)]&&_0x2d414f[_0x4dc8c2(0x210)]){const _0x459774=new Date(_0x2d414f[_0x4dc8c2(0x20e)])[_0x4dc8c2(0x1ca)](),_0x112845=new Date(_0x2d414f[_0x4dc8c2(0x210)])['getTime']();_0x383b8e=Math[_0x4dc8c2(0x1c8)]((_0x112845-_0x459774)/0x3e8);}const _0x35590b={'job_id':_0x2d414f[_0x4dc8c2(0x1d5)],'type':_0x2d414f['type'],'status':_0x2d414f[_0x4dc8c2(0x215)],..._0x2d414f[_0x4dc8c2(0x1fb)]&&{'user_name':_0x2d414f[_0x4dc8c2(0x1fb)]},..._0x383b8e!==undefined&&{'duration_sec':_0x383b8e},..._0x2d414f[_0x4dc8c2(0x212)]&&{'created_at':_0x2d414f[_0x4dc8c2(0x212)]},..._0x2d414f[_0x4dc8c2(0x20e)]&&{'started_at':_0x2d414f[_0x4dc8c2(0x20e)]},..._0x2d414f[_0x4dc8c2(0x210)]&&{'end_at':_0x2d414f[_0x4dc8c2(0x210)]},..._0x2d414f[_0x4dc8c2(0x200)]&&{'database':_0x2d414f[_0x4dc8c2(0x200)]},..._0x2d414f[_0x4dc8c2(0x211)]!==undefined&&{'priority':_0x2d414f[_0x4dc8c2(0x211)]},..._0x2d414f[_0x4dc8c2(0x1ea)]&&{'url':_0x2d414f[_0x4dc8c2(0x1ea)]},..._0x2d414f[_0x4dc8c2(0x219)]&&{'query':_0x2d414f['query']},..._0x2d414f[_0x4dc8c2(0x1e6)]&&{'debug':_0x2d414f['debug']}};return await handleSingleObjectOutput(_0x35590b,_0x5b8a55),0x0;}}function a26_0x231f(_0x34c842,_0x41b837){_0x34c842=_0x34c842-0x1c0;const _0x32052c=a26_0x3205();let _0x231fa5=_0x32052c[_0x34c842];return _0x231fa5;}export class JobKillCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1fc);['description']=a26_0x3de47c(0x1d6);[a26_0x3de47c(0x1ef)](_0x28357b){const _0x4874ab=a26_0x3de47c,_0x3b1f29=_0x28357b['args'][0x0];if(!_0x3b1f29)return _0x4874ab(0x1f8);return undefined;}async['execute'](_0x5d2fc2){const _0x8068be=a26_0x3de47c,{options:_0x4f8939,args:_0x56165e,tdx:_0x2d9525}=_0x5d2fc2,_0x571bdb=_0x56165e[0x0];if(!_0x4f8939['yes']){const _0x2b2a5d=await confirm(_0x8068be(0x218)+_0x571bdb+'?');if(!_0x2b2a5d)return console[_0x8068be(0x1f3)](_0x8068be(0x1c1)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2d9525[_0x8068be(0x1e9)][_0x8068be(0x204)](_0x571bdb),{'verbose':_0x4f8939[_0x8068be(0x216)]}),console[_0x8068be(0x1f3)](_0x8068be(0x1d4)+_0x571bdb),console['error'](_0x8068be(0x1d7)+_0x571bdb+_0x8068be(0x1e8)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1c4);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1f2);async[a26_0x3de47c(0x1dd)](_0x73f376){const _0x53746b=a26_0x3de47c,{options:_0x560e7a,args:_0x3c565a,tdx:_0xb17db0}=_0x73f376,_0x4d9f2a=_0x560e7a[_0x53746b(0x1de)]||_0x53746b(0x1c6),_0x507bd9=_0x560e7a['file'],_0x416700=_0x560e7a[_0x53746b(0x200)]||'information_schema',_0x4a4e5f=_0x560e7a[_0x53746b(0x20d)];if(_0x4d9f2a!=='trino'&&_0x4d9f2a!==_0x53746b(0x205))throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x57f9f1;if(_0x507bd9){if(_0x3c565a[0x0])throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x59c4d8=readSqlStatementsFromFile(_0x507bd9);if(_0x59c4d8[_0x53746b(0x1d2)]===0x0)throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x59c4d8[_0x53746b(0x1d2)]>0x1)throw new SDKError(ErrorCode[_0x53746b(0x1e1)],_0x53746b(0x214));_0x57f9f1=_0x59c4d8[0x0];}else{if(!_0x3c565a[0x0])throw new SDKError(ErrorCode[_0x53746b(0x1e1)],_0x53746b(0x1d3));_0x57f9f1=_0x3c565a[0x0];}_0x560e7a[_0x53746b(0x216)]&&(console[_0x53746b(0x1f3)]('Job\x20type:\x20'+_0x4d9f2a),console[_0x53746b(0x1f3)](_0x53746b(0x1e2)+_0x416700),console[_0x53746b(0x1f3)](_0x53746b(0x1ee)+_0x57f9f1[_0x53746b(0x1e4)](0x0,0x64)+(_0x57f9f1[_0x53746b(0x1d2)]>0x64?'...':'')));const _0x300532=await withSpinner(_0x53746b(0x206),()=>_0xb17db0[_0x53746b(0x1e9)][_0x53746b(0x20c)](_0x416700,_0x57f9f1,_0x4d9f2a,_0x4a4e5f),{'verbose':_0x560e7a[_0x53746b(0x216)]}),_0x5e8795=_0x300532['data'];return console[_0x53746b(0x1f3)](_0x53746b(0x1d1)),console['error'](_0x53746b(0x20b)+_0x5e8795[_0x53746b(0x1d5)]),await handleSDKOutput([_0x5e8795],_0x560e7a),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1fa);[a26_0x3de47c(0x1ef)](_0x191c91){const _0x1def98=a26_0x3de47c,_0x274e66=_0x191c91[_0x1def98(0x1d8)][0x0];if(!_0x274e66)return _0x1def98(0x1c7);return undefined;}async[a26_0x3de47c(0x1dd)](_0x261870){const _0x114711=a26_0x3de47c,{options:_0x4c34a4,args:_0x358526,tdx:_0x2b3d7f}=_0x261870,_0x5694ab=_0x358526[0x0],_0x3b3fb1=await withSpinner(_0x114711(0x1e5),()=>_0x2b3d7f[_0x114711(0x1e9)][_0x114711(0x20d)](_0x5694ab),{'verbose':_0x4c34a4[_0x114711(0x216)]}),_0x411e49=_0x3b3fb1[_0x114711(0x1e0)];return console['error'](_0x114711(0x1cd)+_0x411e49[_0x114711(0x1d2)]+_0x114711(0x1c9)+(_0x411e49['length']!==0x1?'s':'')),await handleSDKOutput(_0x411e49,_0x4c34a4),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x57c5c2=a27_0x3061;(function(_0x353b19,_0x2ea4d8){const _0x4226bc=a27_0x3061,_0x35b484=_0x353b19();while(!![]){try{const _0x409cec=-parseInt(_0x4226bc(0x161))/0x1+parseInt(_0x4226bc(0x1a4))/0x2+parseInt(_0x4226bc(0x1e4))/0x3*(parseInt(_0x4226bc(0x1b6))/0x4)+-parseInt(_0x4226bc(0x1de))/0x5+-parseInt(_0x4226bc(0x1b0))/0x6*(parseInt(_0x4226bc(0x155))/0x7)+-parseInt(_0x4226bc(0x190))/0x8*(-parseInt(_0x4226bc(0x189))/0x9)+-parseInt(_0x4226bc(0x1a0))/0xa*(parseInt(_0x4226bc(0x208))/0xb);if(_0x409cec===_0x2ea4d8)break;else _0x35b484['push'](_0x35b484['shift']());}catch(_0x2d0412){_0x35b484['push'](_0x35b484['shift']());}}}(a27_0x4d3e,0x830d9));import a27_0x53b983 from'chalk';import a27_0xbd78d4 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a27_0x3061(_0x2aa08c,_0x212af5){_0x2aa08c=_0x2aa08c-0x10e;const _0x4d3e7b=a27_0x4d3e();let _0x306117=_0x4d3e7b[_0x2aa08c];return _0x306117;}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(_0x400980){const _0x1a4da3=a27_0x3061;return!_0x400980&&(console['error'](_0x1a4da3(0x225)),console[_0x1a4da3(0x12a)](_0x1a4da3(0x135))),!!_0x400980;}function withJsonFormat(_0x1aabda){const _0x466548=a27_0x3061;if(!_0x1aabda[_0x466548(0x13a)]&&!_0x1aabda['json']&&!_0x1aabda[_0x466548(0x15a)]&&!_0x1aabda[_0x466548(0x146)])return{..._0x1aabda,'format':_0x466548(0x1ab),'json':!![]};return _0x1aabda;}function formatJourneyState(_0x2cfc7a){const _0x4b02b8=a27_0x3061;switch(_0x2cfc7a){case _0x4b02b8(0x1c9):return a27_0x53b983['green'](_0x4b02b8(0x140));case _0x4b02b8(0x16e):return a27_0x53b983[_0x4b02b8(0x1ef)](_0x4b02b8(0x19f));case _0x4b02b8(0x117):return a27_0x53b983['yellow'](_0x4b02b8(0x151));case _0x4b02b8(0x1c4):return a27_0x53b983[_0x4b02b8(0x1f6)]('(completed)');case _0x4b02b8(0x205):return a27_0x53b983[_0x4b02b8(0x1ef)](_0x4b02b8(0x1d1));default:return'('+_0x2cfc7a+')';}}function formatJourneyItem(_0x15257d,_0x2039a1='',_0x25b05e){const _0x154bae=a27_0x3061,_0x52845d=formatJourneyState(_0x15257d[_0x154bae(0x181)]),_0x2ab5c3=_0x25b05e?hyperlink(_0x15257d[_0x154bae(0x1bc)],_0x25b05e):_0x15257d['journeyBundleName'];return _0x2039a1+_0x154bae(0x129)+_0x2ab5c3+'\x20'+_0x52845d;}function escapeRegex(_0xea1849){const _0x1b2929=a27_0x3061;return _0xea1849[_0x1b2929(0x19b)](/[.*+?^${}()|[\]\\]/g,_0x1b2929(0x1d4));}function globToRegex(_0x3beb16){const _0x24c94c=a27_0x3061,_0x2c2e4c=_0x3beb16['split']('*')[_0x24c94c(0x197)](escapeRegex);return new RegExp(_0x2c2e4c[_0x24c94c(0x18a)]('.*'),'i');}function buildRuleToNameMapping(_0x36b52b){const _0x5a7fee=a27_0x3061,_0x518afd=new Map();if(_0x36b52b[_0x5a7fee(0x152)])for(const [_0x66af5,_0x35c156]of Object[_0x5a7fee(0x1cf)](_0x36b52b[_0x5a7fee(0x152)])){if(_0x35c156[_0x5a7fee(0x1aa)]){const _0x358ca3=serializeRule(_0x35c156[_0x5a7fee(0x1aa)]),_0x1dc69d=_0x518afd[_0x5a7fee(0x1f3)](_0x358ca3);_0x1dc69d?_0x1dc69d[_0x5a7fee(0x222)](_0x66af5):_0x518afd[_0x5a7fee(0x20c)](_0x358ca3,[_0x66af5]);}}return _0x518afd;}async function resolveJourneyIdFromInput(_0x8061d3,_0x10d10d,_0x5e376c){const _0x5ca70f=a27_0x3061,_0x2f3e49=await resolveJourneyTarget(_0x8061d3,_0x10d10d[_0x5ca70f(0x1e8)],_0x10d10d[_0x5ca70f(0x128)]),_0x17cac3=_0x2f3e49[_0x5ca70f(0x1e8)];if(!_0x17cac3)throw new SDKError(ErrorCode[_0x5ca70f(0x165)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x291369=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x5e376c[_0x5ca70f(0x17c)][_0x5ca70f(0x142)](_0x17cac3),{'verbose':_0x10d10d[_0x5ca70f(0x128)]}),_0x3c6500=_0x291369[_0x5ca70f(0x125)],_0x12ecc9=await withSpinner(_0x5ca70f(0x1bf),()=>_0x5e376c[_0x5ca70f(0x17b)][_0x5ca70f(0x1d0)](_0x3c6500,_0x2f3e49['journeyName']),{'verbose':_0x10d10d[_0x5ca70f(0x128)]});return{'journeyId':_0x12ecc9[_0x5ca70f(0x125)],'journeyName':_0x2f3e49['journeyName'],'parentSegmentId':_0x3c6500};}async function resolveJourneyTarget(_0x3dd537,_0x52b46f,_0x4ca208){const _0x433aec=a27_0x3061;if(isYamlFilePath(_0x3dd537))try{const _0x1a1374=await resolveYamlFilePath(_0x3dd537);return _0x4ca208&&(console[_0x433aec(0x12a)](_0x433aec(0x176)+_0x3dd537),console[_0x433aec(0x12a)](_0x433aec(0x1e1)+_0x1a1374[_0x433aec(0x1e8)]),console[_0x433aec(0x12a)](_0x433aec(0x1ad)+_0x1a1374['segmentName']),console[_0x433aec(0x12a)](_0x433aec(0x1f0)+(_0x1a1374[_0x433aec(0x124)]||_0x433aec(0x206)))),{'journeyName':_0x1a1374[_0x433aec(0x182)],'parentSegment':_0x1a1374[_0x433aec(0x1e8)],'resolved':_0x1a1374};}catch(_0x2f446d){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x433aec(0x11b)+_0x2f446d[_0x433aec(0x1ae)]);}if(!_0x52b46f)throw new SDKError(ErrorCode[_0x433aec(0x165)],_0x433aec(0x224));return{'journeyName':_0x3dd537,'parentSegment':_0x52b46f};}export class JourneyListCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1ed);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x1ac);async['execute'](_0x56fb3d){const _0x2b4266=a27_0x57c5c2,{options:_0x395e8b,args:_0x48ea4b,tdx:_0x438dd4}=_0x56fb3d,_0x5a55b6=_0x48ea4b[0x0],_0x4e7c30=_0x395e8b['parentSegment'];if(!_0x4e7c30)return console['error'](_0x2b4266(0x112)),console[_0x2b4266(0x12a)](_0x2b4266(0x1f5)),0x1;const _0x420108=await withSpinner(_0x2b4266(0x170),()=>_0x438dd4[_0x2b4266(0x17c)]['resolveParentId'](_0x4e7c30),{'verbose':_0x395e8b[_0x2b4266(0x128)]}),_0x84c4eb=_0x420108['data'];_0x395e8b[_0x2b4266(0x128)]&&(console[_0x2b4266(0x12a)](_0x2b4266(0x15f)+_0x4e7c30+_0x2b4266(0x1c3)+_0x84c4eb+')'),_0x5a55b6&&console[_0x2b4266(0x12a)]('Pattern:\x20'+_0x5a55b6));const _0x9f633=await withSpinner(_0x2b4266(0x114),()=>_0x438dd4[_0x2b4266(0x17c)][_0x2b4266(0x10e)](_0x84c4eb),{'verbose':_0x395e8b['verbose']}),_0x30fc09=_0x9f633[_0x2b4266(0x125)],_0x4d71af=_0x30fc09[_0x2b4266(0x175)],_0x45f84a=await withSpinner(_0x2b4266(0x186),()=>_0x438dd4[_0x2b4266(0x17b)][_0x2b4266(0x1ca)](_0x84c4eb,_0x4d71af),{'verbose':_0x395e8b[_0x2b4266(0x128)]});let _0x558964=_0x45f84a[_0x2b4266(0x125)][_0x2b4266(0x13e)];const _0x39c1ca=_0x45f84a['data'][_0x2b4266(0x15d)],_0x238a97=new Map();for(const _0x43d8d3 of _0x39c1ca){_0x238a97[_0x2b4266(0x20c)](_0x43d8d3['id'],_0x43d8d3[_0x2b4266(0x1c8)]);}if(_0x5a55b6){const _0x5bdb70=globToRegex(_0x5a55b6);_0x558964=_0x558964[_0x2b4266(0x1f4)](_0x255f90=>_0x5bdb70[_0x2b4266(0x171)](_0x255f90[_0x2b4266(0x1bc)]));}console[_0x2b4266(0x12a)](_0x2b4266(0x144)+_0x558964[_0x2b4266(0x157)]+_0x2b4266(0x19c)+(_0x558964[_0x2b4266(0x157)]!==0x1?'s':''));const _0x4280c1=_0x37f7ef=>{const _0x14c185=_0x2b4266;return getConsoleNextUrl(_0x395e8b['site'],_0x14c185(0x1ff)+_0x84c4eb+_0x14c185(0x18f)+_0x37f7ef+'/j/da');};if(_0x395e8b[_0x2b4266(0x13a)]===_0x2b4266(0x118))await handleSDKOutput(_0x558964,_0x395e8b);else{if(_0x395e8b[_0x2b4266(0x13a)]===_0x2b4266(0x1ab)){const _0x74a83e=_0x558964['map'](_0x51442c=>({..._0x51442c,'url':_0x4280c1(_0x51442c['id'])}));await handleSDKOutput(_0x74a83e,_0x395e8b);}else{console['log']('['+_0x4e7c30+']');const _0x179d3a=new Map(),_0x811f14=[];for(const _0x3e3ead of _0x558964){if(!_0x3e3ead[_0x2b4266(0x17a)]||_0x3e3ead[_0x2b4266(0x17a)]===_0x4d71af)_0x811f14[_0x2b4266(0x222)](_0x3e3ead);else{const _0x55c6f3=_0x179d3a['get'](_0x3e3ead[_0x2b4266(0x17a)])||[];_0x55c6f3['push'](_0x3e3ead),_0x179d3a[_0x2b4266(0x20c)](_0x3e3ead['folderId'],_0x55c6f3);}}const _0x336f5a=(_0xb7ad42,_0x361a09)=>_0xb7ad42[_0x2b4266(0x1bc)][_0x2b4266(0x134)](_0x361a09[_0x2b4266(0x1bc)],undefined,{'sensitivity':_0x2b4266(0x14c)});_0x811f14[_0x2b4266(0x1cd)](_0x336f5a);for(const _0x56b7be of _0x811f14){console[_0x2b4266(0x200)](formatJourneyItem(_0x56b7be,'',_0x4280c1(_0x56b7be['id'])));}const _0x4e5507=[..._0x179d3a[_0x2b4266(0x1cf)]()]['sort']((_0x40f155,_0x5df531)=>{const _0x33a12d=_0x2b4266,_0x254a3b=_0x238a97[_0x33a12d(0x1f3)](_0x40f155[0x0])||_0x40f155[0x0],_0x4ae699=_0x238a97['get'](_0x5df531[0x0])||_0x5df531[0x0];return _0x254a3b[_0x33a12d(0x134)](_0x4ae699,undefined,{'sensitivity':_0x33a12d(0x14c)});});for(const [_0x1ca67e,_0x54dc15]of _0x4e5507){const _0x294263=_0x238a97[_0x2b4266(0x1f3)](_0x1ca67e)||_0x1ca67e;console[_0x2b4266(0x200)](_0x2b4266(0x1bd)+_0x294263),_0x54dc15[_0x2b4266(0x1cd)](_0x336f5a);for(const _0x309c93 of _0x54dc15){console[_0x2b4266(0x200)](formatJourneyItem(_0x309c93,'\x20\x20',_0x4280c1(_0x309c93['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x164);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x20e);async['execute'](_0x128f51){const _0x352174=a27_0x57c5c2,{options:_0x3f3670,args:_0x5d6f91,tdx:_0x4cf457}=_0x128f51,_0x456c6e=_0x5d6f91[0x0];if(!_0x456c6e)return console[_0x352174(0x12a)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x352174(0x12a)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x352174(0x12a)]('Options:'),console[_0x352174(0x12a)](_0x352174(0x207)),0x1;_0x3f3670[_0x352174(0x128)]&&console['error'](_0x352174(0x1be)+_0x456c6e);const {journeyId:_0x428c9c,parentSegmentId:_0x54f639}=await resolveJourneyIdFromInput(_0x456c6e,_0x3f3670,_0x4cf457);if(_0x3f3670[_0x352174(0x1f9)]){const _0x34eab7=getConsoleNextUrl(_0x3f3670[_0x352174(0x1f8)],_0x352174(0x1ff)+_0x54f639+_0x352174(0x18f)+_0x428c9c+_0x352174(0x209));return console['error'](a27_0x53b983[_0x352174(0x1f2)]('✔')+'\x20Opening\x20'+a27_0x53b983[_0x352174(0x153)](_0x34eab7)),openBrowser(_0x34eab7),0x0;}const _0x4d8771=await withSpinner(_0x352174(0x11e),()=>_0x4cf457[_0x352174(0x17b)][_0x352174(0x14e)](_0x428c9c),{'verbose':_0x3f3670['verbose']}),_0x1fede7=_0x4d8771['data'],_0x162ac6=_0x3f3670['includeStats'];let _0x13c21b;if(_0x162ac6)try{const _0x1d80f6=await withSpinner(_0x352174(0x136),()=>_0x4cf457[_0x352174(0x17b)][_0x352174(0x184)](_0x428c9c),{'verbose':_0x3f3670[_0x352174(0x128)]});_0x13c21b=_0x1d80f6['data'];}catch{_0x3f3670['verbose']&&console[_0x352174(0x12a)](_0x352174(0x1d6));}const _0x211634=getConsoleNextUrl(_0x3f3670['site'],_0x352174(0x1ff)+_0x54f639+'/e/'+_0x428c9c+_0x352174(0x209)),_0x23ac06={'id':_0x1fede7['id'],'name':_0x1fede7[_0x352174(0x216)][_0x352174(0x1c8)],'description':_0x1fede7['attributes'][_0x352174(0x20b)],'state':_0x1fede7[_0x352174(0x216)][_0x352174(0x181)],'paused':_0x1fede7['attributes']['paused'],'reentry_mode':_0x1fede7[_0x352174(0x216)]['reentryMode'],'stages':_0x1fede7[_0x352174(0x216)]['journeyStages']?.[_0x352174(0x157)]||0x0,..._0x1fede7[_0x352174(0x216)]['goal']&&{'goal':_0x1fede7[_0x352174(0x216)][_0x352174(0x143)][_0x352174(0x1c8)]},..._0x13c21b&&{'statistics':{'size':_0x13c21b[_0x352174(0x16b)],'entered':_0x13c21b[_0x352174(0x1da)],'goal_achieved':_0x13c21b[_0x352174(0x1df)],'completion_rate':_0x13c21b[_0x352174(0x14d)],'exit_or_jump':_0x13c21b['exitOrJumpSize'],'exit_or_jump_rate':_0x13c21b[_0x352174(0x13c)],'stages':_0x13c21b[_0x352174(0x21b)]}},'url':_0x211634};return await handleSingleObjectOutput(_0x23ac06,_0x3f3670),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1fe);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x138);async[a27_0x57c5c2(0x120)](_0x38cb1c){const _0x105238=a27_0x57c5c2,{options:_0x14c0d3,args:_0xe237f0,tdx:_0x29421d}=_0x38cb1c,_0x26d9aa=_0xe237f0[0x0];if(!requireNameOrPath(_0x26d9aa))return 0x1;_0x14c0d3[_0x105238(0x128)]&&console[_0x105238(0x12a)](_0x105238(0x1be)+_0x26d9aa);const _0x539ba3=_0x14c0d3,_0x52ac78=_0x539ba3[_0x105238(0x179)],_0xc4707f=_0x539ba3['to'],_0x2e0ffb=_0x539ba3[_0x105238(0x14a)],_0xc650eb=_0x539ba3[_0x105238(0x132)];_0x2e0ffb&&!_0x52ac78&&!_0xc4707f&&console[_0x105238(0x12a)](_0x105238(0x1b3));const _0x57c155=_0x2e0ffb?withJsonFormat(_0x14c0d3):_0x14c0d3,{journeyId:_0x583a55,journeyName:_0x3556e2}=await resolveJourneyIdFromInput(_0x26d9aa,_0x57c155,_0x29421d),_0x120028=_0x52ac78||_0xc4707f?{'from':_0x52ac78,'to':_0xc4707f}:undefined,_0x527182=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise['all']([_0x29421d['journey'][_0x105238(0x14e)](_0x583a55),_0x29421d[_0x105238(0x17b)][_0x105238(0x184)](_0x583a55,_0x120028)]),{'verbose':_0x57c155['verbose']}),[_0xc175c9,_0x53ebe3]=_0x527182['data'];if(!_0x53ebe3||_0x53ebe3[_0x105238(0x1a5)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x3556e2),console[_0x105238(0x12a)](_0x105238(0x21d)),0x0;const _0x2f3e64=buildStageNameMap(_0xc175c9),_0x4c0fc4=!!(_0x120028&&_0x53ebe3[_0x105238(0x12e)]?.[_0x105238(0x157)]),_0x435d9d={'stageNameMap':_0x2f3e64,'hasPeriod':_0x4c0fc4,'includeHistory':!!_0x2e0ffb};if(_0xc650eb&&_0x53ebe3[_0x105238(0x21b)]){const _0x1205c2=_0x53ebe3['stages'][_0x105238(0x19d)](_0xb9c23=>{const _0x58d0d2=_0x105238,_0x45ec4a=_0x2f3e64['get'](_0xb9c23['id'])??'';return _0x45ec4a[_0x58d0d2(0x198)]()===_0xc650eb['toLowerCase']();});if(_0x1205c2)return await handleSingleObjectOutput(formatStageStats(_0x1205c2,_0x435d9d),_0x57c155),0x0;const _0x58bd8e=_0x53ebe3[_0x105238(0x21b)][_0x105238(0x197)](_0x3a4d4c=>_0x2f3e64[_0x105238(0x1f3)](_0x3a4d4c['id'])??_0x3a4d4c['id']);return console[_0x105238(0x12a)](_0x105238(0x1e2)+_0xc650eb+'\x22\x20not\x20found'),console[_0x105238(0x12a)](_0x105238(0x123)+_0x58bd8e['join'](',\x20')),0x1;}const _0x22a5ca=_0x53ebe3['stages']?.[_0x105238(0x197)](_0x188e3d=>formatStageStats(_0x188e3d,_0x435d9d)),_0x5b9e57=assembleJourneyStats(_0x53ebe3,{'from':_0x52ac78,'to':_0xc4707f,'includeHistory':_0x2e0ffb});return await this[_0x105238(0x17f)](_0x5b9e57,_0x22a5ca??[],_0x57c155),0x0;}async[a27_0x57c5c2(0x17f)](_0x40183b,_0x4a4a4b,_0x49f96c){const _0x3c5d72=a27_0x57c5c2,_0x103180=_0x49f96c[_0x3c5d72(0x13a)]==='json'||_0x49f96c[_0x3c5d72(0x13a)]==='jsonl'||_0x49f96c['json']||_0x49f96c[_0x3c5d72(0x15a)];if(_0x103180){_0x40183b[_0x3c5d72(0x21b)]=_0x4a4a4b,await handleSingleObjectOutput(_0x40183b,_0x49f96c);return;}await handleSingleObjectOutput(_0x40183b,_0x49f96c);for(const _0x251897 of _0x4a4a4b){console[_0x3c5d72(0x200)](''),console[_0x3c5d72(0x200)](String(a27_0x53b983[_0x3c5d72(0x153)][_0x3c5d72(0x16a)]('['+_0x251897[_0x3c5d72(0x1c8)]+']'))+a27_0x53b983['dim']('\x20'+_0x251897['id']));const {id:_0x63d054,name:_0xc38462,..._0x5ddc3b}=_0x251897;await handleSingleObjectOutput(_0x5ddc3b,_0x49f96c);}}}function a27_0x4d3e(){const _0x35b440=['session','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','rule','json','List\x20journeys\x20in\x20current\x20context','\x20\x20Name:\x20','message','\x20\x20-\x20','2441502XCxOky','Pausing\x20journey...','resume','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20(rule\x20match)','getSegment','554348nGqZnS','listFolders','...','hasPeriod','\x22\x20paused','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journeyBundleName','📁\x20','Input:\x20','Resolving\x20journey...','Resuming\x20journey...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','connection','\x20(ID:\x20','completed','cwd','journey:version:create','\x20journeys','name','launched','listJourneysWithFolders','Creating\x20new\x20version...','journey:pull','sort','tdx.json','entries','resolveJourneyId','(archived)','no_parent','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)','\x5c$&','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','\x20\x20Statistics\x20not\x20available','activation','listActivationsFlat','\x20journey\x20files\x20to\x20','enteredSize','file','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','options','1423040Hvyhnp','goalSize','diff','\x20\x20Parent\x20segment:\x20','Error:\x20Stage\x20\x22','nodes','21xNLRhe','Write\x20','.yml','Listing\x20journey\x20versions...','parentSegment','filePath','\x20\x20Target:\x20','\x20->\x20','args','journey:list','isNew','dim','\x20\x20Folder\x20path:\x20','exitOrJumpSize','green','get','filter','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','blue','repeat','site','web','createVersion','has','stageNameMap','Fetching\x20users\x20and\x20connections...','journey:stats','/app/ps/','log','\x20\x20Journey\x20ID:\x20','values','pause','journey:resume','archived','(root)','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','77QEsIzc','/j/da/je','links','description','set','completeMilestoneRate','Show\x20journey\x20details','\x20version','journey:columns','Target\x20directory:\x20','getLatestJourneyId','\x20\x20Preserving\x20local\x20segment\x20name:\x20','relative','parent_segment','attributes','database','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','absolutePath','red','stages','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','all','Aborted.','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','versionNumber','push','columns','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','then','getParentFull','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','-\x20no\x20files\x20written','version','Error:\x20Parent\x20segment\x20context\x20required','milestoneSize','Fetching\x20parent\x20segment...','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','getColumnMapping','paused','table','type','getActivation','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','List\x20activations\x20for\x20a\x20journey','Journey\x20name:\x20','Getting\x20journey\x20details...','journey:versions','execute','\x20versions)','journeyBundleId','Available\x20stages:\x20','folderPath','data','Error:\x20','updatedAt','verbose','🗺️\x20','error','helpText','Listing\x20journey\x20activations...','Table:\x20','history','Pause\x20a\x20running\x20journey','Resolving\x20version...','getTrafficData','stage',',\x20version:\x20','localeCompare','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Getting\x20journey\x20statistics...','\x0aError:','Show\x20journey\x20statistics','parentName','format','journey:activations','exitOrJumpRate','✔\x20Journey\x20\x22','journeys','Fetching\x20','(running)','\x20(draft)\x20—\x20\x22','resolveParentId','goal','✔\x20Found\x20','relativePath','tsv','Database:\x20','setPhase','utf-8','includeHistory','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','base','completionRate','getJourney','listJourneysFromParentSegment','\x20changed\x20files','(paused)','segments','cyan','\x20activation','7TUAiMc','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','length','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','createdAt','jsonl','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','yes','folders','No\x20journeys\x20found','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','536472qUwrsd','Getting\x20journey\x20traffic\x20data...','Fetching\x20journeys\x20and\x20folders...','journey:view','INVALID_ARGUMENT','errorCode','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Target\x20file:\x20','Cancelled','bold','size','Error:\x20--version\x20option\x20is\x20required','kind','draft','\x0aChanges\x20to\x20\x27','Resolving\x20parent\x20segment...','test','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Resume\x20a\x20paused\x20journey','resolveSegment','rootFolderId','Resolved\x20YAML\x20file:\x20','Error:\x20Version\x20','\x0aPull\x20summary:','from','folderId','journey','segment','dryRun','\x20Created\x20v','renderStats','journeyStages','state','segmentName','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','getStatistics','activation_','Listing\x20journeys...','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20new\x20files','8181TAYoYl','join','✔\x20Pulled\x20','activationParams','Found\x20','Show\x20journey\x20table\x20column\x20mapping','/e/','3272xfCZBH','✔\x20Context\x20set:\x20','yellow','stringify','content','root\x20folder','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','map','toLowerCase','journey:pause','conversion','replace','\x20journey','find','buildIdToNameMap','(draft)','55050tkVUJx','add','\x20files?','user','922870eRiLzy','journeyId','targetDir','buildIdToEmailMap'];a27_0x4d3e=function(){return _0x35b440;};return a27_0x4d3e();}export class JourneyTrafficCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:traffic';['description']=a27_0x57c5c2(0x172);async['execute'](_0x251b94){const _0x5324e4=a27_0x57c5c2,{options:_0x5a568d,args:_0x38182c,tdx:_0x62a035}=_0x251b94,_0x30f536=_0x38182c[0x0];if(!requireNameOrPath(_0x30f536))return 0x1;_0x5a568d['verbose']&&console[_0x5324e4(0x12a)](_0x5324e4(0x1be)+_0x30f536);const _0x5aa87c=_0x5a568d,_0x46b153=_0x5aa87c[_0x5324e4(0x119)],_0x2b7383=_0x5aa87c['from'],_0x40b5ef=_0x5aa87c['to'],_0x88b85f=_0x5aa87c['limit'];if(_0x46b153&&_0x46b153!==_0x5324e4(0x19a)&&_0x46b153!==_0x5324e4(0x1d7))return console[_0x5324e4(0x12a)]('Error:\x20Invalid\x20--type\x20\x22'+_0x46b153+_0x5324e4(0x196)),0x1;const _0x11ee36=withJsonFormat(_0x5a568d),{journeyId:_0x57f564,journeyName:_0x5048c5}=await resolveJourneyIdFromInput(_0x30f536,_0x11ee36,_0x62a035),_0x3aa1b2={'type':_0x46b153,'from':_0x2b7383,'to':_0x40b5ef,'limit':_0x88b85f},_0x2dc1f8=await withSpinner(_0x5324e4(0x162),()=>_0x62a035[_0x5324e4(0x17b)][_0x5324e4(0x131)](_0x57f564,_0x3aa1b2),{'verbose':_0x11ee36['verbose']}),_0x39483d=_0x2dc1f8[_0x5324e4(0x125)],_0x1080cd=_0x39483d[_0x5324e4(0x19a)]&&(_0x39483d[_0x5324e4(0x19a)][_0x5324e4(0x1e3)][_0x5324e4(0x157)]>0x0||_0x39483d['conversion'][_0x5324e4(0x20a)][_0x5324e4(0x157)]>0x0),_0x10ca10=_0x39483d[_0x5324e4(0x1d7)]&&_0x39483d['activation'][_0x5324e4(0x157)]>0x0;if(!_0x1080cd&&!_0x10ca10)return console['error'](_0x5324e4(0x183)+_0x5048c5),console[_0x5324e4(0x12a)](_0x5324e4(0x187)),_0x2b7383&&_0x40b5ef&&console[_0x5324e4(0x12a)](_0x5324e4(0x167)),0x0;return await handleSingleObjectOutput(_0x39483d,_0x11ee36),0x0;}}function formatStageStats(_0xebd35d,_0x3e5af6){const _0x40aba3=a27_0x57c5c2,_0x11a748=_0x3e5af6[_0x40aba3(0x1b9)]&&_0xebd35d[_0x40aba3(0x12e)]?.[_0x40aba3(0x157)]?aggregateStageHistory(_0xebd35d['history']):{'size':_0xebd35d[_0x40aba3(0x16b)],'entered':_0xebd35d[_0x40aba3(0x1da)],'milestone':_0xebd35d[_0x40aba3(0x113)],'milestone_rate':_0xebd35d[_0x40aba3(0x20d)],'exit_or_jump':_0xebd35d[_0x40aba3(0x1f1)],'exit_or_jump_rate':_0xebd35d['exitOrJumpRate']},_0x2d3198={'id':_0xebd35d['id'],'name':_0x3e5af6[_0x40aba3(0x1fc)]['get'](_0xebd35d['id'])??_0xebd35d['id'],..._0x11a748};return _0x3e5af6[_0x40aba3(0x1b9)]&&_0x3e5af6[_0x40aba3(0x14a)]&&_0xebd35d[_0x40aba3(0x12e)]&&(_0x2d3198[_0x40aba3(0x12e)]=_0xebd35d['history']),_0x2d3198;}export class JourneyPauseCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x199);['description']=a27_0x57c5c2(0x12f);async[a27_0x57c5c2(0x120)](_0x2bb190){const _0x4b296b=a27_0x57c5c2,{options:_0x14aa42,args:_0x479be9,tdx:_0x4c6133}=_0x2bb190,_0x2f4184=_0x479be9[0x0];if(!requireNameOrPath(_0x2f4184))return 0x1;_0x14aa42[_0x4b296b(0x128)]&&console[_0x4b296b(0x12a)]('Input:\x20'+_0x2f4184);const {journeyId:_0x463ac6,journeyName:_0x11c5ba}=await resolveJourneyIdFromInput(_0x2f4184,_0x14aa42,_0x4c6133);if(!_0x14aa42[_0x4b296b(0x15c)]){const _0x421c2c=await confirm(_0x4b296b(0x1a9)+_0x11c5ba+'\x22?');if(!_0x421c2c)return console[_0x4b296b(0x12a)]('Cancelled'),0x0;}const _0x1d792c=await withSpinner(_0x4b296b(0x1b1),()=>_0x4c6133['journey'][_0x4b296b(0x203)](_0x463ac6),{'verbose':_0x14aa42['verbose']}),_0x5857b6=_0x1d792c[_0x4b296b(0x125)];return console[_0x4b296b(0x12a)](_0x4b296b(0x13d)+_0x5857b6[_0x4b296b(0x216)]['name']+_0x4b296b(0x1ba)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x57c5c2(0x204);['description']=a27_0x57c5c2(0x173);async[a27_0x57c5c2(0x120)](_0x3c7967){const _0x3e2a62=a27_0x57c5c2,{options:_0x46be7f,args:_0x308278,tdx:_0x3b3813}=_0x3c7967,_0x12965f=_0x308278[0x0];if(!requireNameOrPath(_0x12965f))return 0x1;_0x46be7f[_0x3e2a62(0x128)]&&console[_0x3e2a62(0x12a)](_0x3e2a62(0x1be)+_0x12965f);const {journeyId:_0xe0625c,journeyName:_0x39ba22}=await resolveJourneyIdFromInput(_0x12965f,_0x46be7f,_0x3b3813);if(!_0x46be7f['yes']){const _0x4ea588=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x39ba22+'\x22?');if(!_0x4ea588)return console[_0x3e2a62(0x12a)](_0x3e2a62(0x169)),0x0;}const _0x4455dc=await withSpinner(_0x3e2a62(0x1c0),()=>_0x3b3813[_0x3e2a62(0x17b)][_0x3e2a62(0x1b2)](_0xe0625c),{'verbose':_0x46be7f[_0x3e2a62(0x128)]}),_0x2a3bc7=_0x4455dc[_0x3e2a62(0x125)];return console['error'](_0x3e2a62(0x13d)+_0x2a3bc7['attributes'][_0x3e2a62(0x1c8)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x57c5c2(0x1cc);[a27_0x57c5c2(0x20b)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x57c5c2(0x120)](_0x3f64ba){const _0x43c685=a27_0x57c5c2,{options:_0x1d1cbb,args:_0x38289c,tdx:_0x4f806a}=_0x3f64ba,_0x7735c3=_0x1d1cbb,_0x5d5078=_0x38289c[0x0],_0x47978e=_0x5d5078&&isYamlFilePath(_0x5d5078),_0x1eef57=await resolveTarget({'arg':_0x47978e?_0x5d5078:undefined,'contextParent':_0x1d1cbb[_0x43c685(0x1e8)],'cwd':process[_0x43c685(0x1c5)]()});if(!isSuccessfulResolution(_0x1eef57))return _0x1eef57[_0x43c685(0x166)]===_0x43c685(0x1d2)?(console[_0x43c685(0x12a)](a27_0x53b983['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x43c685(0x1d3)),console[_0x43c685(0x12a)](_0x43c685(0x1d5)),console[_0x43c685(0x12a)](_0x43c685(0x160)),console[_0x43c685(0x12a)](_0x43c685(0x14b))):(console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x21a)](_0x43c685(0x126)+_0x1eef57[_0x43c685(0x1ae)]+'\x0a')),_0x1eef57[_0x43c685(0x12b)]&&console['error'](a27_0x53b983[_0x43c685(0x153)](_0x1eef57['helpText']))),0x1;let _0x1d9c93=_0x47978e?undefined:_0x5d5078,_0x4e2ee3,_0x38ce18;_0x1eef57[_0x43c685(0x119)]===_0x43c685(0x1db)&&(_0x1d9c93=_0x1eef57['resourceName'],_0x4e2ee3=_0x1eef57[_0x43c685(0x1e9)],_0x38ce18=_0x1eef57[_0x43c685(0x124)]);const _0x4a676a=_0x1eef57[_0x43c685(0x139)],_0x144e89=_0x1eef57[_0x43c685(0x1a6)];_0x7735c3['verbose']&&(console[_0x43c685(0x12a)]('Parent\x20segment:\x20'+_0x4a676a),console[_0x43c685(0x12a)](_0x43c685(0x211)+_0x144e89),_0x1d9c93&&console[_0x43c685(0x12a)](_0x43c685(0x11d)+_0x1d9c93),_0x4e2ee3&&console[_0x43c685(0x12a)](_0x43c685(0x168)+_0x4e2ee3),_0x38ce18&&console[_0x43c685(0x12a)]('Folder\x20path:\x20'+_0x38ce18));const _0x433c61=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x4f806a[_0x43c685(0x17c)]['resolveParentId'](_0x4a676a),{'verbose':_0x1d1cbb[_0x43c685(0x128)]}),_0x2699cc=_0x433c61[_0x43c685(0x125)],{journeys:_0x1557a2,folders:_0x3a79cd}=await withSpinner(_0x43c685(0x163),async()=>{const _0x97da88=_0x43c685,[_0x240ca7,_0x884532]=await Promise[_0x97da88(0x21e)]([_0x4f806a[_0x97da88(0x17b)][_0x97da88(0x14f)](_0x2699cc,undefined,{'includeAllVersions':!![]}),_0x4f806a['segment'][_0x97da88(0x1b7)](_0x2699cc)]);return{'journeys':_0x240ca7,'folders':_0x884532};},{'verbose':_0x1d1cbb['verbose']})[_0x43c685(0x226)](_0x4ebebc=>_0x4ebebc[_0x43c685(0x125)]);let _0x228c1c=_0x1557a2;const _0x5abe63=buildFolderIdToPathMap(_0x3a79cd);if(_0x1d9c93){const _0x180487=_0x228c1c[_0x43c685(0x1f4)](_0x45b397=>_0x45b397[_0x43c685(0x1bc)][_0x43c685(0x198)]()===_0x1d9c93[_0x43c685(0x198)]());if(_0x180487[_0x43c685(0x157)]===0x0)return console[_0x43c685(0x12a)]('Error:\x20Journey\x20not\x20found:\x20'+_0x1d9c93),console[_0x43c685(0x12a)](_0x43c685(0x218)),0x1;_0x228c1c=_0x180487;}if(_0x38ce18!==undefined){const _0x17dbf0=_0x228c1c[_0x43c685(0x1f4)](_0x1d7dcb=>{const _0x544471=_0x43c685,_0x58316b=_0x1d7dcb['folderId']?_0x5abe63[_0x544471(0x1f3)](_0x1d7dcb[_0x544471(0x17a)])||'':'';return _0x58316b===_0x38ce18;});if(_0x17dbf0[_0x43c685(0x157)]===0x0&&_0x228c1c[_0x43c685(0x157)]>0x0){console[_0x43c685(0x12a)]('Error:\x20Journey\x20\x27'+_0x1d9c93+'\x27\x20not\x20found\x20in\x20'+(_0x38ce18||_0x43c685(0x195))),console[_0x43c685(0x12a)](_0x43c685(0x158));for(const _0xcf2412 of _0x228c1c){const _0x18a20d=_0xcf2412['folderId']?_0x5abe63['get'](_0xcf2412['folderId'])||'':'';console['error'](_0x43c685(0x1af)+(_0x18a20d||_0x43c685(0x206))+'/'+_0xcf2412['journeyBundleName']);}return 0x1;}_0x228c1c=_0x17dbf0;}if(_0x228c1c[_0x43c685(0x157)]===0x0)return console[_0x43c685(0x12a)](_0x43c685(0x15e)),0x0;const _0x850035=new Map();for(const _0x5d8050 of _0x228c1c){const _0x396b6b=_0x5d8050[_0x43c685(0x122)];!_0x850035[_0x43c685(0x1fb)](_0x396b6b)&&_0x850035[_0x43c685(0x20c)](_0x396b6b,[]),_0x850035[_0x43c685(0x1f3)](_0x396b6b)[_0x43c685(0x222)](_0x5d8050);}for(const _0x37e0a7 of _0x850035[_0x43c685(0x202)]()){_0x37e0a7[_0x43c685(0x1cd)]((_0x111ced,_0x2f0a2e)=>(_0x111ced[_0x43c685(0x221)]||0x0)-(_0x2f0a2e['versionNumber']||0x0));}const _0x447a7a=[],{idToEmailMap:_0x3a7fc2,connectionIdToNameMap:_0x4cf942}=await withSpinner(_0x43c685(0x1fd),async()=>{const _0x1380e2=_0x43c685,[_0x1ed021,_0x427915]=await Promise[_0x1380e2(0x21e)]([_0x4f806a[_0x1380e2(0x1a3)][_0x1380e2(0x1a7)](),_0x4f806a[_0x1380e2(0x1c2)][_0x1380e2(0x19e)]()]);return{'idToEmailMap':_0x1ed021,'connectionIdToNameMap':_0x427915};},{'verbose':_0x1d1cbb[_0x43c685(0x128)]})[_0x43c685(0x226)](_0x439323=>_0x439323[_0x43c685(0x125)]);for(const _0x4372b2 of _0x850035[_0x43c685(0x202)]()){const _0x3c184c=_0x4372b2[0x0][_0x43c685(0x1bc)],_0x408f28=_0x4372b2[0x0]['folderId'],_0x21d23c=_0x408f28?_0x5abe63['get'](_0x408f28)||'':'',_0x528492=_0x21d23c?a27_0xbd78d4[_0x43c685(0x18a)](_0x144e89,_0x21d23c):_0x144e89,_0x35b420=_0x4e2ee3||a27_0xbd78d4[_0x43c685(0x18a)](_0x528492,sanitizeFileName(_0x3c184c)+_0x43c685(0x1e6));let _0x50fa21,_0x2dd9f1;if(existsSync(_0x35b420))try{const _0x36181b=readFileSync(_0x35b420,'utf-8'),_0x4cf465=parseYamlString(_0x36181b);_0x2dd9f1=_0x4cf465,_0x50fa21=buildRuleToNameMapping(_0x4cf465),_0x7735c3[_0x43c685(0x128)]&&_0x50fa21[_0x43c685(0x16b)]>0x0&&console['error'](_0x43c685(0x18d)+_0x50fa21[_0x43c685(0x16b)]+_0x43c685(0x15b)+_0x3c184c);}catch(_0x2128f4){_0x7735c3['verbose']&&console[_0x43c685(0x12a)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x2128f4[_0x43c685(0x1ae)]);}const _0x3529a1=[],_0x119c6c=new Set(),_0x509cd8=new Map(),_0x208c38=new Map(),_0xadb3d5=new Set(),_0x186385=new Map(),_0x53ad7d=new Map(),_0x2e3c02=createJumpTargetCache();await withProgressSpinner(_0x43c685(0x13f)+_0x3c184c+_0x43c685(0x1b8),async _0x320fe9=>{const _0x4c7bd0=_0x43c685;for(const _0x2a46bf of _0x4372b2){const _0x16d353=_0x4372b2['length']>0x1?_0x2a46bf[_0x4c7bd0(0x1bc)]+'\x20v'+(_0x2a46bf[_0x4c7bd0(0x221)]||0x1):_0x2a46bf[_0x4c7bd0(0x1bc)];_0x320fe9[_0x4c7bd0(0x148)]('Fetching\x20'+_0x16d353);const _0xd4c80=await _0x4f806a['journey'][_0x4c7bd0(0x14e)](_0x2a46bf['id']),_0x114b61=_0xd4c80[_0x4c7bd0(0x216)]?.['audienceId'],_0x593ea4={'resolveSegment':async _0x5a1b8c=>{const _0xa0f063=_0x4c7bd0;if(!_0x114b61)return{'name':_0x5a1b8c,'isJourneyLocal':![]};const _0x4b5111=_0x509cd8[_0xa0f063(0x1f3)](_0x5a1b8c);if(_0x4b5111)return _0x4b5111;try{const _0x143270=await _0x4f806a[_0xa0f063(0x17c)][_0xa0f063(0x1b5)](_0x114b61,_0x5a1b8c),_0x4c809f=_0x143270[_0xa0f063(0x16d)]===SEGMENT_KIND_JOURNEY;let _0x5d3451,_0x48ecee=_0x143270[_0xa0f063(0x1c8)];if(_0x4c809f&&_0x143270[_0xa0f063(0x1aa)]){const _0x251571=await segmentResponseToDef(_0x143270,{'resolveSegmentName':async _0xa203e7=>{const _0x4d359e=_0xa0f063,_0x3ccda3=_0x509cd8['get'](_0xa203e7);if(_0x3ccda3)return _0x3ccda3[_0x4d359e(0x1c8)];const _0x1ef3a6=await _0x593ea4[_0x4d359e(0x174)](_0xa203e7);return _0x1ef3a6['name'];}}),_0x4c33ed=_0x251571['rule'];_0x5d3451={'description':_0x143270[_0xa0f063(0x20b)],'rule':_0x4c33ed};const _0x2b4eee=serializeRule(_0x4c33ed),_0x218152=_0x208c38[_0xa0f063(0x1f3)](_0x2b4eee);if(_0x218152)_0x48ecee=_0x218152,_0x5d3451=undefined,_0x7735c3[_0xa0f063(0x128)]&&console[_0xa0f063(0x12a)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x143270[_0xa0f063(0x1c8)]+_0xa0f063(0x1eb)+_0x218152);else{let _0x305dd7=![];if(_0x50fa21){const _0x39528e=_0x50fa21[_0xa0f063(0x1f3)](_0x2b4eee);if(_0x39528e){const _0x1ba63d=_0x39528e[_0xa0f063(0x19d)](_0x49e278=>!_0x119c6c[_0xa0f063(0x1fb)](_0x49e278));_0x1ba63d&&(_0x48ecee=_0x1ba63d,_0x119c6c[_0xa0f063(0x1a1)](_0x1ba63d),_0x208c38[_0xa0f063(0x20c)](_0x2b4eee,_0x1ba63d),_0x305dd7=!![],_0x7735c3['verbose']&&console[_0xa0f063(0x12a)](_0xa0f063(0x213)+_0x1ba63d+_0xa0f063(0x1b4)));}}if(!_0x305dd7){const _0x5db57a=generateJourneyLocalName(_0x143270['name']);_0x5db57a&&(_0x48ecee=_0x5db57a);let _0x58cc90=_0x48ecee,_0x495447=0x2;while(_0x119c6c[_0xa0f063(0x1fb)](_0x58cc90)){_0x58cc90=_0x48ecee+'_'+_0x495447,_0x495447++;}_0x119c6c[_0xa0f063(0x1a1)](_0x58cc90),_0x208c38['set'](_0x2b4eee,_0x58cc90),_0x48ecee=_0x58cc90;}}}const _0x2aee61={'name':_0x48ecee,'isJourneyLocal':_0x4c809f,'definition':_0x5d3451};return _0x509cd8['set'](_0x5a1b8c,_0x2aee61),_0x2aee61;}catch(_0x10a6ec){return _0x1d1cbb['verbose']&&console[_0xa0f063(0x12a)](_0xa0f063(0x1bb)+_0x5a1b8c+':\x20'+_0x10a6ec['message']),{'name':_0x5a1b8c,'isJourneyLocal':![]};}},'resolveActivation':async _0x53b083=>{const _0x5ec8ee=_0x4c7bd0,_0x56dcd8=_0x186385[_0x5ec8ee(0x1f3)](_0x53b083);if(_0x56dcd8)return _0x56dcd8;try{const _0x568c44=await _0x4f806a[_0x5ec8ee(0x17b)][_0x5ec8ee(0x11a)](_0x2a46bf['id'],_0x53b083),_0x48c58c=journeyActivationStepToYaml(_0x568c44,_0x3a7fc2,_0x4cf942),_0x8de2ef=JSON[_0x5ec8ee(0x193)]({'name':_0x48c58c[_0x5ec8ee(0x1c8)],'connection':_0x48c58c[_0x5ec8ee(0x1c2)],'connector_config':_0x48c58c['connector_config']}),_0x20381c=_0x53ad7d['get'](_0x8de2ef);if(_0x20381c){const _0x3cf44a={'name':_0x20381c,'isJourneyLocal':!![],'definition':_0x48c58c};return _0x186385[_0x5ec8ee(0x20c)](_0x53b083,_0x3cf44a),_0x3cf44a;}const _0xd75130=_0x568c44['attributes'][_0x5ec8ee(0x18c)][_0x5ec8ee(0x1c8)]||_0x53b083,_0xf4a1f3=sanitizeYamlKey(_0xd75130)||_0x5ec8ee(0x185)+_0x53b083;let _0x595fd5=_0xf4a1f3,_0x248a85=0x2;while(_0xadb3d5[_0x5ec8ee(0x1fb)](_0x595fd5)){_0x595fd5=_0xf4a1f3+'_'+_0x248a85,_0x248a85++;}_0xadb3d5[_0x5ec8ee(0x1a1)](_0x595fd5),_0x53ad7d['set'](_0x8de2ef,_0x595fd5);const _0x349114={'name':_0x595fd5,'isJourneyLocal':!![],'definition':_0x48c58c};return _0x186385['set'](_0x53b083,_0x349114),_0x349114;}catch(_0x366a99){return _0x1d1cbb[_0x5ec8ee(0x128)]&&console['error'](_0x5ec8ee(0x21c)+_0x53b083+':\x20'+_0x366a99[_0x5ec8ee(0x1ae)]),{'name':_0x53b083,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x29e055,_0x5b8d5f)=>{const _0x1e23aa=_0x4c7bd0;return resolveJumpTarget(_0x29e055,_0x5b8d5f,_0x2e3c02,_0x58ab1d=>_0x4f806a[_0x1e23aa(0x17b)][_0x1e23aa(0x14e)](_0x58ab1d));}},_0xdd16c7=await journeyResponseToDef(_0xd4c80,_0x593ea4);_0x3529a1[_0x4c7bd0(0x222)]({'item':_0x2a46bf,'yaml':_0xdd16c7});}},{'verbose':_0x1d1cbb[_0x43c685(0x128)]});const _0x1bd69c=await _0x4f806a[_0x43c685(0x17b)][_0x43c685(0x212)](_0x4372b2[0x0][_0x43c685(0x122)]),_0x5b016a=buildMergedJourneyDef(_0x3529a1,_0x50fa21,_0x1bd69c),_0x2765a0=normalizeJourneyDef(_0x5b016a,_0x2dd9f1),_0x5a7d2f=toYamlString(_0x2765a0),_0x5a7a0c=_0x4e2ee3||a27_0xbd78d4[_0x43c685(0x18a)](_0x528492,sanitizeFileName(_0x3c184c)+_0x43c685(0x1e6));!_0x4e2ee3&&_0x21d23c&&!existsSync(_0x528492)&&mkdirSync(_0x528492,{'recursive':!![]});const _0x32c888=a27_0xbd78d4[_0x43c685(0x214)](process[_0x43c685(0x1c5)](),_0x5a7a0c);if(existsSync(_0x5a7a0c)){const _0x3fcd9f=readFileSync(_0x5a7a0c,_0x43c685(0x149)),_0xdd4e38=generateDiff(_0x3fcd9f,_0x5a7d2f),_0x538ced=hasChanges(_0xdd4e38);_0x447a7a['push']({'relativePath':_0x32c888,'absolutePath':_0x5a7a0c,'content':_0x5a7d2f,'isNew':![],'hasChanges':_0x538ced,'diff':_0x538ced?formatDiffWithColors(_0xdd4e38):undefined});}else _0x447a7a[_0x43c685(0x222)]({'relativePath':_0x32c888,'absolutePath':_0x5a7a0c,'content':_0x5a7d2f,'isNew':!![],'hasChanges':![]});}const _0xbb5e2=_0x447a7a['filter'](_0x40de10=>_0x40de10[_0x43c685(0x1ee)]),_0x30df77=_0x447a7a[_0x43c685(0x1f4)](_0x5693ce=>!_0x5693ce['isNew']&&_0x5693ce['hasChanges']),_0x4c7130=_0x447a7a[_0x43c685(0x1f4)](_0x3d67c0=>!_0x3d67c0['isNew']&&!_0x3d67c0['hasChanges']),_0x596e86=_0x228c1c['length'],_0x40419a=_0x850035[_0x43c685(0x16b)],_0x232480=_0x596e86>_0x40419a?'\x20('+_0x596e86+_0x43c685(0x121):'';console[_0x43c685(0x12a)](_0x43c685(0x178)),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983['cyan'](_0x40419a+_0x43c685(0x1c7))+a27_0x53b983['dim'](_0x232480)),console['error']('\x20\x20'+a27_0x53b983['green']('+\x20'+_0xbb5e2[_0x43c685(0x157)]+_0x43c685(0x188))),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983[_0x43c685(0x192)]('~\x20'+_0x30df77[_0x43c685(0x157)]+_0x43c685(0x150))),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983['dim']('=\x20'+_0x4c7130[_0x43c685(0x157)]+'\x20unchanged\x20files')),console['error'](_0x43c685(0x1ea)+a27_0x53b983['cyan'](_0x144e89)+'\x0a');if(_0x30df77[_0x43c685(0x157)]>0x0)for(const _0x1a49a5 of _0x30df77){console[_0x43c685(0x12a)](_0x43c685(0x16f)+_0x1a49a5[_0x43c685(0x145)]+'\x27:'),console[_0x43c685(0x12a)]('─'[_0x43c685(0x1f7)](0x3c)),console['error'](_0x1a49a5[_0x43c685(0x1e0)]),console[_0x43c685(0x12a)]('─'[_0x43c685(0x1f7)](0x3c));}if(_0x7735c3[_0x43c685(0x17d)])return console['error'](a27_0x53b983[_0x43c685(0x192)](_0x43c685(0x1dc))),0x0;if(_0xbb5e2[_0x43c685(0x157)]===0x0&&_0x30df77['length']===0x0)return console['error'](a27_0x53b983[_0x43c685(0x1f2)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x4a676a},_0x7735c3['session']),console['error'](a27_0x53b983[_0x43c685(0x1f2)]('✔\x20Context\x20set:\x20'+a27_0x53b983[_0x43c685(0x1ef)]('parent_segment')+'\x20=\x20'+a27_0x53b983[_0x43c685(0x153)](_0x4a676a))),0x0;if(!_0x7735c3['yes']&&(_0xbb5e2[_0x43c685(0x157)]>0x0||_0x30df77[_0x43c685(0x157)]>0x0)){if(!isInteractive())return console['error'](a27_0x53b983[_0x43c685(0x21a)](_0x43c685(0x137)),_0x43c685(0x1c1)),console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x1ef)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x18f170=await confirmKey(_0x43c685(0x1e5)+(_0xbb5e2[_0x43c685(0x157)]+_0x30df77[_0x43c685(0x157)])+_0x43c685(0x1a2));if(!_0x18f170)return console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x192)](_0x43c685(0x21f)),_0x43c685(0x110)),0x1;}!existsSync(_0x144e89)&&mkdirSync(_0x144e89,{'recursive':!![]});const _0xa50277=a27_0xbd78d4['join'](_0x144e89,_0x43c685(0x1ce));writeFileSync(_0xa50277,createTdxConfigContent(_0x4a676a),_0x43c685(0x149));for(const _0x3e7caf of _0x447a7a){(_0x3e7caf[_0x43c685(0x1ee)]||_0x3e7caf['hasChanges'])&&writeFileSync(_0x3e7caf[_0x43c685(0x219)],_0x3e7caf[_0x43c685(0x194)],'utf-8');}return console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x1f2)](_0x43c685(0x18b)+(_0xbb5e2[_0x43c685(0x157)]+_0x30df77[_0x43c685(0x157)])+_0x43c685(0x1d9)+_0x144e89)),saveSessionContext({'parent_segment':_0x4a676a},_0x7735c3[_0x43c685(0x1a8)]),console[_0x43c685(0x12a)](a27_0x53b983['green'](_0x43c685(0x191)+a27_0x53b983[_0x43c685(0x1ef)](_0x43c685(0x215))+'\x20=\x20'+a27_0x53b983[_0x43c685(0x153)](_0x4a676a))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x210);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x18e);async['execute'](_0xdd65dc){const _0x374faf=a27_0x57c5c2,{options:_0xe3cf5f,args:_0x2f96a9,tdx:_0x81922e}=_0xdd65dc,_0x32cdd2=_0x2f96a9[0x0];if(!requireNameOrPath(_0x32cdd2))return 0x1;_0xe3cf5f['verbose']&&console[_0x374faf(0x12a)](_0x374faf(0x1be)+_0x32cdd2);const {journeyId:_0x38ed5d}=await resolveJourneyIdFromInput(_0x32cdd2,_0xe3cf5f,_0x81922e),_0x3522a6=await withSpinner('Getting\x20column\x20mapping...',()=>_0x81922e[_0x374faf(0x17b)][_0x374faf(0x116)](_0x38ed5d),{'verbose':_0xe3cf5f[_0x374faf(0x128)]}),_0x4fddf1=_0x3522a6[_0x374faf(0x125)];return console['log'](_0x374faf(0x147)+_0x4fddf1[_0x374faf(0x217)]),console[_0x374faf(0x200)](_0x374faf(0x12d)+_0x4fddf1[_0x374faf(0x118)]),await handleSDKOutput(_0x4fddf1[_0x374faf(0x223)],_0xe3cf5f),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x13b);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x11c);async['execute'](_0xde75ad){const _0x282a1d=a27_0x57c5c2,{options:_0x2ada02,args:_0x46d326,tdx:_0xe86e85}=_0xde75ad,_0x3b2b22=_0x46d326[0x0];if(!requireNameOrPath(_0x3b2b22))return 0x1;_0x2ada02[_0x282a1d(0x128)]&&console['error'](_0x282a1d(0x1be)+_0x3b2b22);const {journeyId:_0x1d30d7}=await resolveJourneyIdFromInput(_0x3b2b22,_0x2ada02,_0xe86e85),_0x13285d=await withSpinner(_0x282a1d(0x12c),()=>_0xe86e85['journey'][_0x282a1d(0x1d8)](_0x1d30d7),{'verbose':_0x2ada02[_0x282a1d(0x128)]}),_0x15e180=_0x13285d[_0x282a1d(0x125)];return console[_0x282a1d(0x12a)](_0x282a1d(0x18d)+_0x15e180[_0x282a1d(0x157)]+_0x282a1d(0x154)+(_0x15e180[_0x282a1d(0x157)]!==0x1?'s':'')),await handleSDKOutput(_0x15e180,_0x2ada02),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:push';[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x10f);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x57c5c2(0x120)](_0x3e99b3){const _0x1fcd9f=a27_0x57c5c2,_0xf6b0cc=_0x3e99b3[_0x1fcd9f(0x1ec)][0x0];let _0x5ea492;if(_0xf6b0cc){const _0x495407=await resolveTarget({'arg':_0xf6b0cc,'contextParent':_0x3e99b3[_0x1fcd9f(0x1dd)][_0x1fcd9f(0x1e8)],'cwd':process[_0x1fcd9f(0x1c5)]()});isSuccessfulResolution(_0x495407)&&_0x495407['type']==='file'&&(_0x5ea492=_0x495407[_0x1fcd9f(0x1e9)]);}const _0x1dc9e3={..._0x3e99b3,'options':{..._0x3e99b3[_0x1fcd9f(0x1dd)],'journeysOnly':!![],..._0x5ea492&&{'singleFilePath':_0x5ea492}}};return this['segmentPushCommand'][_0x1fcd9f(0x120)](_0x1dc9e3);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x11f);['description']='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x57c5c2(0x120)](_0x25bed8){const _0x1879a5=a27_0x57c5c2,{options:_0x8a5422,args:_0x54cfbf,tdx:_0xacfc48}=_0x25bed8,_0x54d11f=_0x54cfbf[0x0];if(!requireNameOrPath(_0x54d11f))return 0x1;if(_0x8a5422[_0x1879a5(0x128)])console[_0x1879a5(0x12a)]('Input:\x20'+_0x54d11f);const {journeyId:_0x5eb2a5}=await resolveJourneyIdFromInput(_0x54d11f,_0x8a5422,_0xacfc48),_0x162b7f=await withSpinner(_0x1879a5(0x1e7),()=>_0xacfc48['journey']['listVersions'](_0x5eb2a5),{'verbose':_0x8a5422[_0x1879a5(0x128)]}),{bundleName:_0x3f6e4b,versions:_0x51b54f,latestJourneyId:_0xeedd47}=_0x162b7f[_0x1879a5(0x125)];console[_0x1879a5(0x12a)](_0x3f6e4b+':\x20'+_0x51b54f[_0x1879a5(0x157)]+_0x1879a5(0x20f)+(_0x51b54f[_0x1879a5(0x157)]!==0x1?'s':''));const _0x4ee272=_0x51b54f['map'](_0x566818=>({'version':_0x566818['versionNumber'],'journey_id':_0x566818[_0x1879a5(0x1a5)],'name':_0x566818[_0x1879a5(0x1c8)],'state':_0x566818['state'],'paused':_0x566818['paused'],'latest':_0x566818[_0x1879a5(0x1a5)]===_0xeedd47,'created_at':_0x566818[_0x1879a5(0x159)]}));return await handleSDKOutput(_0x4ee272,_0x8a5422),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1c6);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x156);async['execute'](_0x4cc67f){const _0xfdbf62=a27_0x57c5c2,{options:_0x3be08d,args:_0x597f01,tdx:_0x31eb85}=_0x4cc67f,_0x42eb95=_0x597f01[0x0];if(!requireNameOrPath(_0x42eb95))return 0x1;if(_0x3be08d[_0xfdbf62(0x128)])console[_0xfdbf62(0x12a)](_0xfdbf62(0x1be)+_0x42eb95);const {journeyId:_0x373b7b,journeyName:_0x1e2d53}=await resolveJourneyIdFromInput(_0x42eb95,_0x3be08d,_0x31eb85);if(!_0x3be08d[_0xfdbf62(0x15c)]){const _0x1d1e20=await confirm(_0xfdbf62(0x115)+_0x1e2d53+'\x22?');if(!_0x1d1e20)return console[_0xfdbf62(0x12a)](_0xfdbf62(0x169)),0x0;}const _0x42f851=await withSpinner(_0xfdbf62(0x1cb),()=>_0x31eb85[_0xfdbf62(0x17b)][_0xfdbf62(0x1fa)](_0x373b7b),{'verbose':_0x3be08d[_0xfdbf62(0x128)]}),_0x251cbb=_0x42f851['data'];return console[_0xfdbf62(0x12a)](a27_0x53b983[_0xfdbf62(0x1f2)]('✔')+_0xfdbf62(0x17e)+_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x221)]+_0xfdbf62(0x141)+_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x1c8)]+'\x22'),console['error'](_0xfdbf62(0x201)+_0x251cbb['id']),await handleSingleObjectOutput({'id':_0x251cbb['id'],'name':_0x251cbb['attributes']['name'],'version':_0x251cbb[_0xfdbf62(0x216)]['versionNumber'],'state':_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x181)],'bundle_id':_0x251cbb['attributes'][_0xfdbf62(0x122)],'created_at':_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x159)]},_0x3be08d),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:version:view';[a27_0x57c5c2(0x20b)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async['execute'](_0x201343){const _0x2247e6=a27_0x57c5c2,{options:_0x2c9c17,args:_0x5111aa,tdx:_0x3479cf}=_0x201343,_0x193265=_0x5111aa[0x0];if(!requireNameOrPath(_0x193265))return 0x1;const _0x51063f=_0x2c9c17[_0x2247e6(0x111)];if(!_0x51063f)return console[_0x2247e6(0x12a)](_0x2247e6(0x16c)),console['error'](_0x2247e6(0x220)),0x1;const _0x1839be=parseInt(_0x51063f,0xa);if(isNaN(_0x1839be)||_0x1839be<0x1)return console[_0x2247e6(0x12a)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x51063f),0x1;if(_0x2c9c17[_0x2247e6(0x128)])console[_0x2247e6(0x12a)](_0x2247e6(0x1be)+_0x193265+_0x2247e6(0x133)+_0x1839be);const {journeyId:_0xcd2abe,parentSegmentId:_0x2ee560}=await resolveJourneyIdFromInput(_0x193265,_0x2c9c17,_0x3479cf),_0x36717e=await withSpinner(_0x2247e6(0x130),()=>_0x3479cf[_0x2247e6(0x17b)]['listVersions'](_0xcd2abe),{'verbose':_0x2c9c17['verbose']}),{versions:_0xdfe536,latestJourneyId:_0x4a1312}=_0x36717e[_0x2247e6(0x125)],_0xe37df0=_0xdfe536[_0x2247e6(0x19d)](_0x5a1a2d=>_0x5a1a2d[_0x2247e6(0x221)]===_0x1839be);if(!_0xe37df0){const _0xcba30d=_0xdfe536[_0x2247e6(0x197)](_0xbb6adf=>'v'+_0xbb6adf['versionNumber'])[_0x2247e6(0x18a)](',\x20');return console[_0x2247e6(0x12a)](_0x2247e6(0x177)+_0x1839be+'\x20not\x20found.\x20Available:\x20'+_0xcba30d),0x1;}const _0x403165=await withSpinner('Getting\x20version\x20'+_0x1839be+'\x20details...',()=>_0x3479cf[_0x2247e6(0x17b)][_0x2247e6(0x14e)](_0xe37df0[_0x2247e6(0x1a5)]),{'verbose':_0x2c9c17[_0x2247e6(0x128)]}),_0x936a9=_0x403165[_0x2247e6(0x125)],_0x1c6c65=getConsoleNextUrl(_0x2c9c17[_0x2247e6(0x1f8)],_0x2247e6(0x1ff)+_0x2ee560+'/e/'+_0xe37df0['journeyId']+_0x2247e6(0x209));return await handleSingleObjectOutput({'id':_0x936a9['id'],'name':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x1c8)],'version':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x221)],'description':_0x936a9[_0x2247e6(0x216)]['description'],'state':_0x936a9[_0x2247e6(0x216)]['state'],'paused':_0x936a9['attributes']['paused'],'reentry_mode':_0x936a9['attributes']['reentryMode'],'stages':_0x936a9['attributes'][_0x2247e6(0x180)]?.[_0x2247e6(0x157)]||0x0,..._0x936a9[_0x2247e6(0x216)][_0x2247e6(0x143)]&&{'goal':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x143)]['name']},'latest':_0xe37df0['journeyId']===_0x4a1312,'created_at':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x159)],'updated_at':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x127)],'url':_0x1c6c65},_0x2c9c17),0x0;}}
|
|
1
|
+
const a27_0x23db74=a27_0x1431;(function(_0x55834d,_0x297a51){const _0x127b9d=a27_0x1431,_0x2b4b41=_0x55834d();while(!![]){try{const _0x1b53ca=-parseInt(_0x127b9d(0x1a4))/0x1+-parseInt(_0x127b9d(0x253))/0x2+-parseInt(_0x127b9d(0x21e))/0x3*(parseInt(_0x127b9d(0x24e))/0x4)+-parseInt(_0x127b9d(0x202))/0x5+parseInt(_0x127b9d(0x1c8))/0x6*(parseInt(_0x127b9d(0x252))/0x7)+parseInt(_0x127b9d(0x22e))/0x8+parseInt(_0x127b9d(0x174))/0x9*(parseInt(_0x127b9d(0x222))/0xa);if(_0x1b53ca===_0x297a51)break;else _0x2b4b41['push'](_0x2b4b41['shift']());}catch(_0x77c162){_0x2b4b41['push'](_0x2b4b41['shift']());}}}(a27_0x316d,0x688b9));import a27_0x43c880 from'chalk';import a27_0x16dbc4 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';function a27_0x316d(){const _0x51040b=['user','Getting\x20version\x20','description','has','\x20\x20Parent\x20segment:\x20','session','verbose','List\x20journeys\x20in\x20current\x20context','add','history','✔\x20Found\x20','journey:pause','939447Tavcpk','\x0aPull\x20summary:','from','completionRate','includeHistory','No\x20journeys\x20found','getSegment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20--version\x20option\x20is\x20required','versionNumber','Pattern:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','/j/da/je','/e/','List\x20activations\x20for\x20a\x20journey',',\x20version:\x20','reentryMode','segmentPushCommand','✔\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20new\x20files','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey:version:create','launched','Parent\x20segment:\x20','\x20\x20Folder\x20path:\x20','blue','filter','\x20\x20Journey\x20ID:\x20','state','Fetching\x20users\x20and\x20connections...','size','cwd','(draft)','sort','yes','\x20(rule\x20match)','Resolved\x20YAML\x20file:\x20','Getting\x20journey\x20details...','renderStats','getActivation','error','listActivationsFlat','archived','stage','connection','Error:\x20Invalid\x20--type\x20\x22','folderPath','23986TopJnb','execute','Error:\x20Version\x20','no_parent','Show\x20journey\x20statistics','Resolving\x20parent\x20segment...','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','base','attributes','resolveParentId','completed','cyan','relative','listJourneysFromParentSegment','all','INVALID_ARGUMENT','paused','\x20\x20Preserving\x20local\x20segment\x20name:\x20','get','\x20->\x20','journeyId','tdx.json','journeyStages','No\x20statistics\x20available\x20for\x20journey:\x20','.yml','journey:traffic','values','name','listJourneysWithFolders','resolveJourneyId','red','utf-8','site','file','goalSize','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','186jxlZdZ','Cancelled','targetDir','Getting\x20journey\x20statistics...','/j/da','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x0aError:','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20Target:\x20','stageNameMap','replace','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','🗺️\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','resolveSegment','Show\x20journey\x20details','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','isNew','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','message','Target\x20file:\x20','journeyBundleId','content','options','journeyName','Error:\x20','toLowerCase','set','Export\x20journey(s)\x20as\x20YAML\x20files','conversion','tsv','json','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','data','milestoneSize','helpText','updatedAt','parentSegment','log','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','Input:\x20','limit','\x22\x20resumed','Listing\x20journey\x20versions...','args','entries','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','links','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x22\x20paused','completeMilestoneRate','audienceId','Found\x20','Options:','stages','397885Ghczai','then','includeStats','Resume\x20a\x20paused\x20journey','\x20files?','Listing\x20journeys...','yellow','enteredSize','journey:view','segments','table','\x20(draft)\x20—\x20\x22','getJourney','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','format','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segment','getLatestJourneyId','push','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','buildIdToNameMap','join','\x27\x20not\x20found\x20in\x20','folderId','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','buildIdToEmailMap','green','687prrFuS','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)','Listing\x20journey\x20activations...','rule','20GiAKQP','journey','find','...','dim','exitOrJumpRate','connector_config','\x20details...','\x20=\x20','segmentName','journey:push','hasChanges','4546800ixdvOH','journey:pull','Database:\x20','Folder\x20path:\x20','\x20not\x20found.\x20Available:\x20','getTrafficData','(root)','parent_segment','getStatistics','kind','Error:\x20Journey\x20not\x20found:\x20','errorCode','map','Creating\x20new\x20version...','getColumnMapping','Getting\x20column\x20mapping...','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','/app/ps/','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','✔\x20Pulled\x20','Table:\x20','activationParams','Show\x20journey\x20table\x20column\x20mapping','\x20(ID:\x20','Pausing\x20journey...','createdAt','type','repeat','\x0aChanges\x20to\x20\x27','Pause\x20a\x20running\x20journey','journeyBundleName','(archived)','236zjWfUd','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','activation','rootFolderId','68348VUogxb','1069018OWRaTM','length','exitOrJumpSize','jsonl','\x20Opening\x20','hasPeriod','stringify','Fetching\x20parent\x20segment...','(paused)','createVersion','List\x20all\x20versions\x20of\x20a\x20journey','root\x20folder','Warning:\x20Could\x20not\x20resolve\x20activation\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','relativePath','dryRun','localeCompare','Error:\x20Stage\x20\x22','goal','setPhase','filePath'];a27_0x316d=function(){return _0x51040b;};return a27_0x316d();}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(_0x553001){return!_0x553001&&(console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error']('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x553001;}function withJsonFormat(_0x30201b){const _0x12a1f1=a27_0x1431;if(!_0x30201b[_0x12a1f1(0x210)]&&!_0x30201b[_0x12a1f1(0x1e8)]&&!_0x30201b[_0x12a1f1(0x256)]&&!_0x30201b[_0x12a1f1(0x1e7)])return{..._0x30201b,'format':_0x12a1f1(0x1e8),'json':!![]};return _0x30201b;}function formatJourneyState(_0x1ed60c){const _0x2d5435=a27_0x1431;switch(_0x1ed60c){case _0x2d5435(0x18b):return a27_0x43c880['green']('(running)');case'draft':return a27_0x43c880[_0x2d5435(0x226)](_0x2d5435(0x195));case _0x2d5435(0x1b4):return a27_0x43c880['yellow'](_0x2d5435(0x25b));case _0x2d5435(0x1ae):return a27_0x43c880[_0x2d5435(0x18e)]('(completed)');case _0x2d5435(0x19f):return a27_0x43c880['dim'](_0x2d5435(0x24d));default:return'('+_0x1ed60c+')';}}function formatJourneyItem(_0x3f857f,_0x151047='',_0x57bc84){const _0x1b1a87=a27_0x1431,_0x4a4669=formatJourneyState(_0x3f857f[_0x1b1a87(0x191)]),_0x340f53=_0x57bc84?hyperlink(_0x3f857f[_0x1b1a87(0x24c)],_0x57bc84):_0x3f857f[_0x1b1a87(0x24c)];return _0x151047+_0x1b1a87(0x1d4)+_0x340f53+'\x20'+_0x4a4669;}function a27_0x1431(_0x357591,_0x40b3e5){_0x357591=_0x357591-0x161;const _0x316d53=a27_0x316d();let _0x143191=_0x316d53[_0x357591];return _0x143191;}function escapeRegex(_0x568237){const _0x110f8f=a27_0x1431;return _0x568237[_0x110f8f(0x1d2)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x5e24b4){const _0x31213e=a27_0x1431,_0x399483=_0x5e24b4['split']('*')[_0x31213e(0x23a)](escapeRegex);return new RegExp(_0x399483['join']('.*'),'i');}function buildRuleToNameMapping(_0xb4f452){const _0x387075=a27_0x1431,_0x4816f2=new Map();if(_0xb4f452[_0x387075(0x20b)])for(const [_0x304929,_0x3cb077]of Object[_0x387075(0x1f7)](_0xb4f452[_0x387075(0x20b)])){if(_0x3cb077[_0x387075(0x221)]){const _0x4641e3=serializeRule(_0x3cb077['rule']),_0x4549b0=_0x4816f2[_0x387075(0x1b6)](_0x4641e3);_0x4549b0?_0x4549b0[_0x387075(0x215)](_0x304929):_0x4816f2['set'](_0x4641e3,[_0x304929]);}}return _0x4816f2;}async function resolveJourneyIdFromInput(_0x3a45e8,_0x1b692d,_0x2df3bb){const _0x190c56=a27_0x1431,_0x319d31=await resolveJourneyTarget(_0x3a45e8,_0x1b692d[_0x190c56(0x1ee)],_0x1b692d[_0x190c56(0x16e)]),_0x3e2088=_0x319d31['parentSegment'];if(!_0x3e2088)throw new SDKError(ErrorCode[_0x190c56(0x1b3)],_0x190c56(0x1fa));const _0x34f957=await withSpinner(_0x190c56(0x1a9),()=>_0x2df3bb['segment'][_0x190c56(0x1ad)](_0x3e2088),{'verbose':_0x1b692d['verbose']}),_0x55a9b5=_0x34f957['data'],_0x30b0c8=await withSpinner('Resolving\x20journey...',()=>_0x2df3bb[_0x190c56(0x223)][_0x190c56(0x1c1)](_0x55a9b5,_0x319d31[_0x190c56(0x1e1)]),{'verbose':_0x1b692d[_0x190c56(0x16e)]});return{'journeyId':_0x30b0c8[_0x190c56(0x1ea)],'journeyName':_0x319d31['journeyName'],'parentSegmentId':_0x55a9b5};}async function resolveJourneyTarget(_0x2dad51,_0x987053,_0x1be36f){const _0x303d85=a27_0x1431;if(isYamlFilePath(_0x2dad51))try{const _0x54dc74=await resolveYamlFilePath(_0x2dad51);return _0x1be36f&&(console[_0x303d85(0x19d)](_0x303d85(0x199)+_0x2dad51),console[_0x303d85(0x19d)](_0x303d85(0x16c)+_0x54dc74['parentSegment']),console[_0x303d85(0x19d)]('\x20\x20Name:\x20'+_0x54dc74[_0x303d85(0x22b)]),console[_0x303d85(0x19d)](_0x303d85(0x18d)+(_0x54dc74[_0x303d85(0x1a3)]||_0x303d85(0x234)))),{'journeyName':_0x54dc74[_0x303d85(0x22b)],'parentSegment':_0x54dc74[_0x303d85(0x1ee)],'resolved':_0x54dc74};}catch(_0x63dabe){throw new SDKError(ErrorCode[_0x303d85(0x1b3)],_0x303d85(0x1cf)+_0x63dabe['message']);}if(!_0x987053)throw new SDKError(ErrorCode[_0x303d85(0x1b3)],_0x303d85(0x1fb));return{'journeyName':_0x2dad51,'parentSegment':_0x987053};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x23db74(0x16a)]=a27_0x23db74(0x16f);async[a27_0x23db74(0x1a5)](_0xba717b){const _0x13e0b4=a27_0x23db74,{options:_0x52dba5,args:_0x5baf5a,tdx:_0x58a87c}=_0xba717b,_0x589710=_0x5baf5a[0x0],_0x121b7c=_0x52dba5[_0x13e0b4(0x1ee)];if(!_0x121b7c)return console[_0x13e0b4(0x19d)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x13e0b4(0x19d)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x4c18c0=await withSpinner(_0x13e0b4(0x1a9),()=>_0x58a87c[_0x13e0b4(0x213)]['resolveParentId'](_0x121b7c),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]}),_0x332c28=_0x4c18c0['data'];_0x52dba5['verbose']&&(console['error']('Parent\x20segment:\x20'+_0x121b7c+_0x13e0b4(0x245)+_0x332c28+')'),_0x589710&&console[_0x13e0b4(0x19d)](_0x13e0b4(0x17e)+_0x589710));const _0x50c44f=await withSpinner(_0x13e0b4(0x25a),()=>_0x58a87c[_0x13e0b4(0x213)]['getParentFull'](_0x332c28),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]}),_0x38f873=_0x50c44f[_0x13e0b4(0x1ea)],_0x2d8f1d=_0x38f873[_0x13e0b4(0x251)],_0x3129ce=await withSpinner(_0x13e0b4(0x207),()=>_0x58a87c['journey'][_0x13e0b4(0x1c0)](_0x332c28,_0x2d8f1d),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]});let _0x14031e=_0x3129ce[_0x13e0b4(0x1ea)]['journeys'];const _0x49d148=_0x3129ce[_0x13e0b4(0x1ea)]['folders'],_0x4a4a29=new Map();for(const _0x2b5faa of _0x49d148){_0x4a4a29[_0x13e0b4(0x1e4)](_0x2b5faa['id'],_0x2b5faa[_0x13e0b4(0x1bf)]);}if(_0x589710){const _0x4f5112=globToRegex(_0x589710);_0x14031e=_0x14031e[_0x13e0b4(0x18f)](_0xc19d31=>_0x4f5112['test'](_0xc19d31[_0x13e0b4(0x24c)]));}console[_0x13e0b4(0x19d)](_0x13e0b4(0x172)+_0x14031e['length']+'\x20journey'+(_0x14031e[_0x13e0b4(0x254)]!==0x1?'s':''));const _0x55628f=_0x39f057=>{const _0x81afbb=_0x13e0b4;return getConsoleNextUrl(_0x52dba5[_0x81afbb(0x1c4)],_0x81afbb(0x23f)+_0x332c28+_0x81afbb(0x181)+_0x39f057+_0x81afbb(0x1cc));};if(_0x52dba5[_0x13e0b4(0x210)]==='table')await handleSDKOutput(_0x14031e,_0x52dba5);else{if(_0x52dba5['format']===_0x13e0b4(0x1e8)){const _0x21dce2=_0x14031e['map'](_0x2b9d1a=>({..._0x2b9d1a,'url':_0x55628f(_0x2b9d1a['id'])}));await handleSDKOutput(_0x21dce2,_0x52dba5);}else{console[_0x13e0b4(0x1ef)]('['+_0x121b7c+']');const _0x32fd08=new Map(),_0xaff9e8=[];for(const _0x54b277 of _0x14031e){if(!_0x54b277[_0x13e0b4(0x21a)]||_0x54b277[_0x13e0b4(0x21a)]===_0x2d8f1d)_0xaff9e8[_0x13e0b4(0x215)](_0x54b277);else{const _0x468613=_0x32fd08['get'](_0x54b277[_0x13e0b4(0x21a)])||[];_0x468613[_0x13e0b4(0x215)](_0x54b277),_0x32fd08[_0x13e0b4(0x1e4)](_0x54b277[_0x13e0b4(0x21a)],_0x468613);}}const _0x5db9c7=(_0x5c615d,_0x3507c1)=>_0x5c615d[_0x13e0b4(0x24c)]['localeCompare'](_0x3507c1[_0x13e0b4(0x24c)],undefined,{'sensitivity':_0x13e0b4(0x1ab)});_0xaff9e8['sort'](_0x5db9c7);for(const _0x47a979 of _0xaff9e8){console['log'](formatJourneyItem(_0x47a979,'',_0x55628f(_0x47a979['id'])));}const _0x1d5d89=[..._0x32fd08[_0x13e0b4(0x1f7)]()][_0x13e0b4(0x196)]((_0x48204b,_0x564dcb)=>{const _0x157efb=_0x13e0b4,_0x4da3ce=_0x4a4a29[_0x157efb(0x1b6)](_0x48204b[0x0])||_0x48204b[0x0],_0x3a11f4=_0x4a4a29[_0x157efb(0x1b6)](_0x564dcb[0x0])||_0x564dcb[0x0];return _0x4da3ce[_0x157efb(0x163)](_0x3a11f4,undefined,{'sensitivity':_0x157efb(0x1ab)});});for(const [_0x363e57,_0x336955]of _0x1d5d89){const _0x4345e3=_0x4a4a29[_0x13e0b4(0x1b6)](_0x363e57)||_0x363e57;console[_0x13e0b4(0x1ef)]('📁\x20'+_0x4345e3),_0x336955[_0x13e0b4(0x196)](_0x5db9c7);for(const _0x36b0d8 of _0x336955){console[_0x13e0b4(0x1ef)](formatJourneyItem(_0x36b0d8,'\x20\x20',_0x55628f(_0x36b0d8['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x23db74(0x20a);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1d8);async[a27_0x23db74(0x1a5)](_0x469121){const _0x20cc61=a27_0x23db74,{options:_0x2f0d48,args:_0x2f081e,tdx:_0x16798b}=_0x469121,_0x51f94b=_0x2f081e[0x0];if(!_0x51f94b)return console[_0x20cc61(0x19d)](_0x20cc61(0x240)),console[_0x20cc61(0x19d)](_0x20cc61(0x1f8)),console[_0x20cc61(0x19d)](_0x20cc61(0x200)),console[_0x20cc61(0x19d)](_0x20cc61(0x1aa)),0x1;_0x2f0d48['verbose']&&console[_0x20cc61(0x19d)](_0x20cc61(0x1f2)+_0x51f94b);const {journeyId:_0x5efd4e,parentSegmentId:_0x58563e}=await resolveJourneyIdFromInput(_0x51f94b,_0x2f0d48,_0x16798b);if(_0x2f0d48['web']){const _0x38e7d3=getConsoleNextUrl(_0x2f0d48[_0x20cc61(0x1c4)],_0x20cc61(0x23f)+_0x58563e+'/e/'+_0x5efd4e+_0x20cc61(0x180));return console['error'](a27_0x43c880[_0x20cc61(0x21d)]('✔')+_0x20cc61(0x257)+a27_0x43c880[_0x20cc61(0x1af)](_0x38e7d3)),openBrowser(_0x38e7d3),0x0;}const _0x7c01af=await withSpinner(_0x20cc61(0x19a),()=>_0x16798b[_0x20cc61(0x223)]['getJourney'](_0x5efd4e),{'verbose':_0x2f0d48[_0x20cc61(0x16e)]}),_0x4895f6=_0x7c01af[_0x20cc61(0x1ea)],_0xea0285=_0x2f0d48[_0x20cc61(0x204)];let _0x53c6a2;if(_0xea0285)try{const _0x68da06=await withSpinner(_0x20cc61(0x1cb),()=>_0x16798b[_0x20cc61(0x223)][_0x20cc61(0x236)](_0x5efd4e),{'verbose':_0x2f0d48['verbose']});_0x53c6a2=_0x68da06[_0x20cc61(0x1ea)];}catch{_0x2f0d48[_0x20cc61(0x16e)]&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x47e684=getConsoleNextUrl(_0x2f0d48[_0x20cc61(0x1c4)],'/app/ps/'+_0x58563e+_0x20cc61(0x181)+_0x5efd4e+'/j/da/je'),_0x3c8ae3={'id':_0x4895f6['id'],'name':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1bf)],'description':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x16a)],'state':_0x4895f6['attributes']['state'],'paused':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1b4)],'reentry_mode':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x184)],'stages':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1ba)]?.[_0x20cc61(0x254)]||0x0,..._0x4895f6['attributes']['goal']&&{'goal':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x165)][_0x20cc61(0x1bf)]},..._0x53c6a2&&{'statistics':{'size':_0x53c6a2[_0x20cc61(0x193)],'entered':_0x53c6a2[_0x20cc61(0x209)],'goal_achieved':_0x53c6a2[_0x20cc61(0x1c6)],'completion_rate':_0x53c6a2[_0x20cc61(0x177)],'exit_or_jump':_0x53c6a2[_0x20cc61(0x255)],'exit_or_jump_rate':_0x53c6a2[_0x20cc61(0x227)],'stages':_0x53c6a2[_0x20cc61(0x201)]}},'url':_0x47e684};return await handleSingleObjectOutput(_0x3c8ae3,_0x2f0d48),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:stats';['description']=a27_0x23db74(0x1a8);async[a27_0x23db74(0x1a5)](_0x199a20){const _0xf3d8d2=a27_0x23db74,{options:_0x5c9984,args:_0x11ca65,tdx:_0x56f772}=_0x199a20,_0x23c2fb=_0x11ca65[0x0];if(!requireNameOrPath(_0x23c2fb))return 0x1;_0x5c9984[_0xf3d8d2(0x16e)]&&console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x1f2)+_0x23c2fb);const _0xd9f5b4=_0x5c9984,_0x4c39d5=_0xd9f5b4[_0xf3d8d2(0x176)],_0x488914=_0xd9f5b4['to'],_0x36cbc5=_0xd9f5b4['includeHistory'],_0x416787=_0xd9f5b4[_0xf3d8d2(0x1a0)];_0x36cbc5&&!_0x4c39d5&&!_0x488914&&console['error'](_0xf3d8d2(0x216));const _0x1de737=_0x36cbc5?withJsonFormat(_0x5c9984):_0x5c9984,{journeyId:_0x25f7d4,journeyName:_0x54cf3c}=await resolveJourneyIdFromInput(_0x23c2fb,_0x1de737,_0x56f772),_0x38816f=_0x4c39d5||_0x488914?{'from':_0x4c39d5,'to':_0x488914}:undefined,_0x5471fe=await withSpinner(_0xf3d8d2(0x1cb),()=>Promise[_0xf3d8d2(0x1b2)]([_0x56f772[_0xf3d8d2(0x223)][_0xf3d8d2(0x20e)](_0x25f7d4),_0x56f772[_0xf3d8d2(0x223)][_0xf3d8d2(0x236)](_0x25f7d4,_0x38816f)]),{'verbose':_0x1de737[_0xf3d8d2(0x16e)]}),[_0x21bf40,_0x2e34b9]=_0x5471fe[_0xf3d8d2(0x1ea)];if(!_0x2e34b9||_0x2e34b9[_0xf3d8d2(0x1b8)]===null)return console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x1bb)+_0x54cf3c),console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x21b)),0x0;const _0x1425bb=buildStageNameMap(_0x21bf40),_0x2f9456=!!(_0x38816f&&_0x2e34b9['history']?.[_0xf3d8d2(0x254)]),_0x1d82c5={'stageNameMap':_0x1425bb,'hasPeriod':_0x2f9456,'includeHistory':!!_0x36cbc5};if(_0x416787&&_0x2e34b9[_0xf3d8d2(0x201)]){const _0x414fca=_0x2e34b9['stages'][_0xf3d8d2(0x224)](_0x59d364=>{const _0x4d1b3d=_0xf3d8d2,_0x30236d=_0x1425bb[_0x4d1b3d(0x1b6)](_0x59d364['id'])??'';return _0x30236d[_0x4d1b3d(0x1e3)]()===_0x416787['toLowerCase']();});if(_0x414fca)return await handleSingleObjectOutput(formatStageStats(_0x414fca,_0x1d82c5),_0x1de737),0x0;const _0x3f464e=_0x2e34b9[_0xf3d8d2(0x201)][_0xf3d8d2(0x23a)](_0x54481f=>_0x1425bb[_0xf3d8d2(0x1b6)](_0x54481f['id'])??_0x54481f['id']);return console['error'](_0xf3d8d2(0x164)+_0x416787+'\x22\x20not\x20found'),console[_0xf3d8d2(0x19d)]('Available\x20stages:\x20'+_0x3f464e[_0xf3d8d2(0x218)](',\x20')),0x1;}const _0x3d80d6=_0x2e34b9[_0xf3d8d2(0x201)]?.[_0xf3d8d2(0x23a)](_0x5d4410=>formatStageStats(_0x5d4410,_0x1d82c5)),_0x492c6f=assembleJourneyStats(_0x2e34b9,{'from':_0x4c39d5,'to':_0x488914,'includeHistory':_0x36cbc5});return await this[_0xf3d8d2(0x19b)](_0x492c6f,_0x3d80d6??[],_0x1de737),0x0;}async[a27_0x23db74(0x19b)](_0xd899d7,_0x15e90b,_0x454be3){const _0x59383f=a27_0x23db74,_0x4ccd1e=_0x454be3[_0x59383f(0x210)]==='json'||_0x454be3['format']===_0x59383f(0x256)||_0x454be3['json']||_0x454be3['jsonl'];if(_0x4ccd1e){_0xd899d7[_0x59383f(0x201)]=_0x15e90b,await handleSingleObjectOutput(_0xd899d7,_0x454be3);return;}await handleSingleObjectOutput(_0xd899d7,_0x454be3);for(const _0xa03a4c of _0x15e90b){console[_0x59383f(0x1ef)](''),console[_0x59383f(0x1ef)](String(a27_0x43c880['cyan']['bold']('['+_0xa03a4c[_0x59383f(0x1bf)]+']'))+a27_0x43c880[_0x59383f(0x226)]('\x20'+_0xa03a4c['id']));const {id:_0x58ad5c,name:_0x5882df,..._0xfd74e2}=_0xa03a4c;await handleSingleObjectOutput(_0xfd74e2,_0x454be3);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a27_0x23db74(0x1bd);[a27_0x23db74(0x16a)]=a27_0x23db74(0x17f);async[a27_0x23db74(0x1a5)](_0x486190){const _0xdd1d45=a27_0x23db74,{options:_0x1e4c9c,args:_0x19aa67,tdx:_0x373f13}=_0x486190,_0x468d3f=_0x19aa67[0x0];if(!requireNameOrPath(_0x468d3f))return 0x1;_0x1e4c9c[_0xdd1d45(0x16e)]&&console['error'](_0xdd1d45(0x1f2)+_0x468d3f);const _0x36f545=_0x1e4c9c,_0x277285=_0x36f545[_0xdd1d45(0x248)],_0x3aed51=_0x36f545[_0xdd1d45(0x176)],_0x2a110f=_0x36f545['to'],_0x16f000=_0x36f545[_0xdd1d45(0x1f3)];if(_0x277285&&_0x277285!==_0xdd1d45(0x1e6)&&_0x277285!==_0xdd1d45(0x250))return console[_0xdd1d45(0x19d)](_0xdd1d45(0x1a2)+_0x277285+_0xdd1d45(0x24f)),0x1;const _0x1063ab=withJsonFormat(_0x1e4c9c),{journeyId:_0x18f9b6,journeyName:_0x118dee}=await resolveJourneyIdFromInput(_0x468d3f,_0x1063ab,_0x373f13),_0x5a1370={'type':_0x277285,'from':_0x3aed51,'to':_0x2a110f,'limit':_0x16f000},_0x433c46=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x373f13['journey'][_0xdd1d45(0x233)](_0x18f9b6,_0x5a1370),{'verbose':_0x1063ab[_0xdd1d45(0x16e)]}),_0x114793=_0x433c46[_0xdd1d45(0x1ea)],_0xb50d1a=_0x114793[_0xdd1d45(0x1e6)]&&(_0x114793[_0xdd1d45(0x1e6)]['nodes'][_0xdd1d45(0x254)]>0x0||_0x114793[_0xdd1d45(0x1e6)][_0xdd1d45(0x1f9)][_0xdd1d45(0x254)]>0x0),_0x2ea293=_0x114793['activation']&&_0x114793[_0xdd1d45(0x250)][_0xdd1d45(0x254)]>0x0;if(!_0xb50d1a&&!_0x2ea293)return console[_0xdd1d45(0x19d)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x118dee),console[_0xdd1d45(0x19d)](_0xdd1d45(0x23e)),_0x3aed51&&_0x2a110f&&console[_0xdd1d45(0x19d)](_0xdd1d45(0x211)),0x0;return await handleSingleObjectOutput(_0x114793,_0x1063ab),0x0;}}function formatStageStats(_0x19649f,_0x2f8748){const _0x353cc6=a27_0x23db74,_0x3282b1=_0x2f8748[_0x353cc6(0x258)]&&_0x19649f[_0x353cc6(0x171)]?.[_0x353cc6(0x254)]?aggregateStageHistory(_0x19649f[_0x353cc6(0x171)]):{'size':_0x19649f[_0x353cc6(0x193)],'entered':_0x19649f[_0x353cc6(0x209)],'milestone':_0x19649f[_0x353cc6(0x1eb)],'milestone_rate':_0x19649f[_0x353cc6(0x1fd)],'exit_or_jump':_0x19649f[_0x353cc6(0x255)],'exit_or_jump_rate':_0x19649f[_0x353cc6(0x227)]},_0x199f71={'id':_0x19649f['id'],'name':_0x2f8748[_0x353cc6(0x1d1)][_0x353cc6(0x1b6)](_0x19649f['id'])??_0x19649f['id'],..._0x3282b1};return _0x2f8748[_0x353cc6(0x258)]&&_0x2f8748[_0x353cc6(0x178)]&&_0x19649f[_0x353cc6(0x171)]&&(_0x199f71[_0x353cc6(0x171)]=_0x19649f[_0x353cc6(0x171)]),_0x199f71;}export class JourneyPauseCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x173);['description']=a27_0x23db74(0x24b);async['execute'](_0x470e4c){const _0x29c0a5=a27_0x23db74,{options:_0x5916e3,args:_0x45f06d,tdx:_0x40d409}=_0x470e4c,_0x122706=_0x45f06d[0x0];if(!requireNameOrPath(_0x122706))return 0x1;_0x5916e3['verbose']&&console[_0x29c0a5(0x19d)](_0x29c0a5(0x1f2)+_0x122706);const {journeyId:_0x365a0f,journeyName:_0x25037e}=await resolveJourneyIdFromInput(_0x122706,_0x5916e3,_0x40d409);if(!_0x5916e3['yes']){const _0x48cf1f=await confirm(_0x29c0a5(0x20f)+_0x25037e+'\x22?');if(!_0x48cf1f)return console[_0x29c0a5(0x19d)](_0x29c0a5(0x1c9)),0x0;}const _0x1a8bbb=await withSpinner(_0x29c0a5(0x246),()=>_0x40d409['journey']['pause'](_0x365a0f),{'verbose':_0x5916e3[_0x29c0a5(0x16e)]}),_0x3abe73=_0x1a8bbb['data'];return console['error']('✔\x20Journey\x20\x22'+_0x3abe73[_0x29c0a5(0x1ac)][_0x29c0a5(0x1bf)]+_0x29c0a5(0x1fc)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:resume';[a27_0x23db74(0x16a)]=a27_0x23db74(0x205);async[a27_0x23db74(0x1a5)](_0x2ecf91){const _0x569d9d=a27_0x23db74,{options:_0x32e5de,args:_0x3a68d0,tdx:_0x5117a0}=_0x2ecf91,_0x2573ed=_0x3a68d0[0x0];if(!requireNameOrPath(_0x2573ed))return 0x1;_0x32e5de['verbose']&&console[_0x569d9d(0x19d)](_0x569d9d(0x1f2)+_0x2573ed);const {journeyId:_0x3ba2f4,journeyName:_0xef9d5a}=await resolveJourneyIdFromInput(_0x2573ed,_0x32e5de,_0x5117a0);if(!_0x32e5de[_0x569d9d(0x197)]){const _0x3eabdc=await confirm(_0x569d9d(0x1db)+_0xef9d5a+'\x22?');if(!_0x3eabdc)return console[_0x569d9d(0x19d)]('Cancelled'),0x0;}const _0x41848d=await withSpinner('Resuming\x20journey...',()=>_0x5117a0['journey']['resume'](_0x3ba2f4),{'verbose':_0x32e5de[_0x569d9d(0x16e)]}),_0x246088=_0x41848d[_0x569d9d(0x1ea)];return console[_0x569d9d(0x19d)]('✔\x20Journey\x20\x22'+_0x246088[_0x569d9d(0x1ac)][_0x569d9d(0x1bf)]+_0x569d9d(0x1f4)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x22f);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1e5);async[a27_0x23db74(0x1a5)](_0x281bac){const _0x3a5323=a27_0x23db74,{options:_0x4dcf27,args:_0x26bbe6,tdx:_0x4ff4f7}=_0x281bac,_0x5c2a02=_0x4dcf27,_0x328ff2=_0x26bbe6[0x0],_0x437fe3=_0x328ff2&&isYamlFilePath(_0x328ff2),_0xb33ce=await resolveTarget({'arg':_0x437fe3?_0x328ff2:undefined,'contextParent':_0x4dcf27[_0x3a5323(0x1ee)],'cwd':process[_0x3a5323(0x194)]()});if(!isSuccessfulResolution(_0xb33ce))return _0xb33ce[_0x3a5323(0x239)]===_0x3a5323(0x1a7)?(console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x208)](_0x3a5323(0x1e9))),console[_0x3a5323(0x19d)](_0x3a5323(0x21f)),console[_0x3a5323(0x19d)](_0x3a5323(0x1d6)),console[_0x3a5323(0x19d)](_0x3a5323(0x187)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x1c2)](_0x3a5323(0x1e2)+_0xb33ce['message']+'\x0a')),_0xb33ce[_0x3a5323(0x1ec)]&&console[_0x3a5323(0x19d)](a27_0x43c880['cyan'](_0xb33ce[_0x3a5323(0x1ec)]))),0x1;let _0x18db3d=_0x437fe3?undefined:_0x328ff2,_0x30bfed,_0x3fc52d;_0xb33ce[_0x3a5323(0x248)]===_0x3a5323(0x1c5)&&(_0x18db3d=_0xb33ce['resourceName'],_0x30bfed=_0xb33ce[_0x3a5323(0x167)],_0x3fc52d=_0xb33ce[_0x3a5323(0x1a3)]);const _0x1e77f6=_0xb33ce[_0x3a5323(0x1f1)],_0x196322=_0xb33ce[_0x3a5323(0x1ca)];_0x5c2a02['verbose']&&(console[_0x3a5323(0x19d)](_0x3a5323(0x18c)+_0x1e77f6),console[_0x3a5323(0x19d)]('Target\x20directory:\x20'+_0x196322),_0x18db3d&&console[_0x3a5323(0x19d)]('Journey\x20name:\x20'+_0x18db3d),_0x30bfed&&console['error'](_0x3a5323(0x1dd)+_0x30bfed),_0x3fc52d&&console['error'](_0x3a5323(0x231)+_0x3fc52d));const _0x46da31=await withSpinner(_0x3a5323(0x1a9),()=>_0x4ff4f7[_0x3a5323(0x213)]['resolveParentId'](_0x1e77f6),{'verbose':_0x4dcf27[_0x3a5323(0x16e)]}),_0xad9546=_0x46da31['data'],{journeys:_0x22d1b3,folders:_0x7de3a8}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x9dceae=_0x3a5323,[_0x36cbc2,_0x47f359]=await Promise[_0x9dceae(0x1b2)]([_0x4ff4f7['journey'][_0x9dceae(0x1b1)](_0xad9546,undefined,{'includeAllVersions':!![]}),_0x4ff4f7[_0x9dceae(0x213)]['listFolders'](_0xad9546)]);return{'journeys':_0x36cbc2,'folders':_0x47f359};},{'verbose':_0x4dcf27[_0x3a5323(0x16e)]})[_0x3a5323(0x203)](_0x2c94d8=>_0x2c94d8[_0x3a5323(0x1ea)]);let _0x2f2ac1=_0x22d1b3;const _0x32e080=buildFolderIdToPathMap(_0x7de3a8);if(_0x18db3d){const _0x4da4d7=_0x2f2ac1[_0x3a5323(0x18f)](_0x54377b=>_0x54377b['journeyBundleName'][_0x3a5323(0x1e3)]()===_0x18db3d[_0x3a5323(0x1e3)]());if(_0x4da4d7[_0x3a5323(0x254)]===0x0)return console['error'](_0x3a5323(0x238)+_0x18db3d),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x2f2ac1=_0x4da4d7;}if(_0x3fc52d!==undefined){const _0x34f26c=_0x2f2ac1[_0x3a5323(0x18f)](_0x6ad6b2=>{const _0x5f1371=_0x3a5323,_0x517d3f=_0x6ad6b2['folderId']?_0x32e080[_0x5f1371(0x1b6)](_0x6ad6b2[_0x5f1371(0x21a)])||'':'';return _0x517d3f===_0x3fc52d;});if(_0x34f26c['length']===0x0&&_0x2f2ac1[_0x3a5323(0x254)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x18db3d+_0x3a5323(0x219)+(_0x3fc52d||_0x3a5323(0x25e))),console['error'](_0x3a5323(0x1c7));for(const _0x21bcf8 of _0x2f2ac1){const _0x4398ea=_0x21bcf8[_0x3a5323(0x21a)]?_0x32e080[_0x3a5323(0x1b6)](_0x21bcf8['folderId'])||'':'';console['error']('\x20\x20-\x20'+(_0x4398ea||_0x3a5323(0x234))+'/'+_0x21bcf8[_0x3a5323(0x24c)]);}return 0x1;}_0x2f2ac1=_0x34f26c;}if(_0x2f2ac1['length']===0x0)return console['error'](_0x3a5323(0x179)),0x0;const _0x4e20ab=new Map();for(const _0x12ca3b of _0x2f2ac1){const _0x4de515=_0x12ca3b[_0x3a5323(0x1de)];!_0x4e20ab[_0x3a5323(0x16b)](_0x4de515)&&_0x4e20ab[_0x3a5323(0x1e4)](_0x4de515,[]),_0x4e20ab['get'](_0x4de515)['push'](_0x12ca3b);}for(const _0x1123db of _0x4e20ab[_0x3a5323(0x1be)]()){_0x1123db[_0x3a5323(0x196)]((_0x4ce983,_0x14afc3)=>(_0x4ce983['versionNumber']||0x0)-(_0x14afc3[_0x3a5323(0x17d)]||0x0));}const _0x5ca0bc=[],{idToEmailMap:_0x4df5b1,connectionIdToNameMap:_0x53b0aa}=await withSpinner(_0x3a5323(0x192),async()=>{const _0x4d51d9=_0x3a5323,[_0x46eb83,_0xeb104c]=await Promise[_0x4d51d9(0x1b2)]([_0x4ff4f7[_0x4d51d9(0x168)][_0x4d51d9(0x21c)](),_0x4ff4f7['connection'][_0x4d51d9(0x217)]()]);return{'idToEmailMap':_0x46eb83,'connectionIdToNameMap':_0xeb104c};},{'verbose':_0x4dcf27[_0x3a5323(0x16e)]})['then'](_0x5c72a1=>_0x5c72a1[_0x3a5323(0x1ea)]);for(const _0x57bb37 of _0x4e20ab[_0x3a5323(0x1be)]()){const _0x11e483=_0x57bb37[0x0][_0x3a5323(0x24c)],_0x4c6057=_0x57bb37[0x0][_0x3a5323(0x21a)],_0x369672=_0x4c6057?_0x32e080[_0x3a5323(0x1b6)](_0x4c6057)||'':'',_0x3fbd23=_0x369672?a27_0x16dbc4[_0x3a5323(0x218)](_0x196322,_0x369672):_0x196322,_0x289a55=_0x30bfed||a27_0x16dbc4[_0x3a5323(0x218)](_0x3fbd23,sanitizeFileName(_0x11e483)+_0x3a5323(0x1bc));let _0x2910fa,_0x208a59;if(existsSync(_0x289a55))try{const _0x277012=readFileSync(_0x289a55,_0x3a5323(0x1c3)),_0x30cd79=parseYamlString(_0x277012);_0x208a59=_0x30cd79,_0x2910fa=buildRuleToNameMapping(_0x30cd79),_0x5c2a02[_0x3a5323(0x16e)]&&_0x2910fa[_0x3a5323(0x193)]>0x0&&console[_0x3a5323(0x19d)](_0x3a5323(0x1ff)+_0x2910fa[_0x3a5323(0x193)]+_0x3a5323(0x212)+_0x11e483);}catch(_0x33858d){_0x5c2a02[_0x3a5323(0x16e)]&&console[_0x3a5323(0x19d)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x33858d[_0x3a5323(0x1dc)]);}const _0x446184=[],_0x5656d7=new Set(),_0x3bbfdd=new Map(),_0x2f240d=new Map(),_0x1b82bb=new Set(),_0x32b6eb=new Map(),_0x45aefc=new Map(),_0x189b1a=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x11e483+_0x3a5323(0x225),async _0x274470=>{const _0x166a6e=_0x3a5323;for(const _0x43c608 of _0x57bb37){const _0x50f632=_0x57bb37[_0x166a6e(0x254)]>0x1?_0x43c608[_0x166a6e(0x24c)]+'\x20v'+(_0x43c608[_0x166a6e(0x17d)]||0x1):_0x43c608[_0x166a6e(0x24c)];_0x274470[_0x166a6e(0x166)]('Fetching\x20'+_0x50f632);const _0x3a6337=await _0x4ff4f7[_0x166a6e(0x223)][_0x166a6e(0x20e)](_0x43c608['id']),_0x1bdd66=_0x3a6337[_0x166a6e(0x1ac)]?.[_0x166a6e(0x1fe)],_0x3a87c4={'resolveSegment':async _0x485b61=>{const _0xa93aba=_0x166a6e;if(!_0x1bdd66)return{'name':_0x485b61,'isJourneyLocal':![]};const _0x1e0c7a=_0x3bbfdd[_0xa93aba(0x1b6)](_0x485b61);if(_0x1e0c7a)return _0x1e0c7a;try{const _0x33af2b=await _0x4ff4f7[_0xa93aba(0x213)][_0xa93aba(0x17a)](_0x1bdd66,_0x485b61),_0x43ca4f=_0x33af2b[_0xa93aba(0x237)]===SEGMENT_KIND_JOURNEY;let _0x2c0be6,_0x2e0984=_0x33af2b['name'];if(_0x43ca4f&&_0x33af2b[_0xa93aba(0x221)]){const _0x5c0b49=await segmentResponseToDef(_0x33af2b,{'resolveSegmentName':async _0x50748d=>{const _0x46c878=_0xa93aba,_0x41bedb=_0x3bbfdd[_0x46c878(0x1b6)](_0x50748d);if(_0x41bedb)return _0x41bedb['name'];const _0x413f75=await _0x3a87c4[_0x46c878(0x1d7)](_0x50748d);return _0x413f75[_0x46c878(0x1bf)];}}),_0x4da827=_0x5c0b49['rule'];_0x2c0be6={'description':_0x33af2b[_0xa93aba(0x16a)],'rule':_0x4da827};const _0xfe48c8=serializeRule(_0x4da827),_0x377cd5=_0x2f240d[_0xa93aba(0x1b6)](_0xfe48c8);if(_0x377cd5)_0x2e0984=_0x377cd5,_0x2c0be6=undefined,_0x5c2a02[_0xa93aba(0x16e)]&&console['error'](_0xa93aba(0x1d5)+_0x33af2b[_0xa93aba(0x1bf)]+_0xa93aba(0x1b7)+_0x377cd5);else{let _0x3f2fe1=![];if(_0x2910fa){const _0x5da588=_0x2910fa[_0xa93aba(0x1b6)](_0xfe48c8);if(_0x5da588){const _0x2bf68f=_0x5da588[_0xa93aba(0x224)](_0x152316=>!_0x5656d7['has'](_0x152316));_0x2bf68f&&(_0x2e0984=_0x2bf68f,_0x5656d7[_0xa93aba(0x170)](_0x2bf68f),_0x2f240d[_0xa93aba(0x1e4)](_0xfe48c8,_0x2bf68f),_0x3f2fe1=!![],_0x5c2a02['verbose']&&console[_0xa93aba(0x19d)](_0xa93aba(0x1b5)+_0x2bf68f+_0xa93aba(0x198)));}}if(!_0x3f2fe1){const _0x4df4d9=generateJourneyLocalName(_0x33af2b['name']);_0x4df4d9&&(_0x2e0984=_0x4df4d9);let _0x35c33c=_0x2e0984,_0x12f8a3=0x2;while(_0x5656d7[_0xa93aba(0x16b)](_0x35c33c)){_0x35c33c=_0x2e0984+'_'+_0x12f8a3,_0x12f8a3++;}_0x5656d7[_0xa93aba(0x170)](_0x35c33c),_0x2f240d[_0xa93aba(0x1e4)](_0xfe48c8,_0x35c33c),_0x2e0984=_0x35c33c;}}}const _0x59a8ee={'name':_0x2e0984,'isJourneyLocal':_0x43ca4f,'definition':_0x2c0be6};return _0x3bbfdd[_0xa93aba(0x1e4)](_0x485b61,_0x59a8ee),_0x59a8ee;}catch(_0x4cac1e){return _0x4dcf27['verbose']&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x485b61+':\x20'+_0x4cac1e[_0xa93aba(0x1dc)]),{'name':_0x485b61,'isJourneyLocal':![]};}},'resolveActivation':async _0x569c04=>{const _0xf7df7d=_0x166a6e,_0x29e1d7=_0x32b6eb[_0xf7df7d(0x1b6)](_0x569c04);if(_0x29e1d7)return _0x29e1d7;try{const _0x2adc13=await _0x4ff4f7[_0xf7df7d(0x223)][_0xf7df7d(0x19c)](_0x43c608['id'],_0x569c04),_0x157fd3=journeyActivationStepToYaml(_0x2adc13,_0x4df5b1,_0x53b0aa),_0xb10492=JSON[_0xf7df7d(0x259)]({'name':_0x157fd3[_0xf7df7d(0x1bf)],'connection':_0x157fd3[_0xf7df7d(0x1a1)],'connector_config':_0x157fd3[_0xf7df7d(0x228)]}),_0x48d3ae=_0x45aefc['get'](_0xb10492);if(_0x48d3ae){const _0xddabfe={'name':_0x48d3ae,'isJourneyLocal':!![],'definition':_0x157fd3};return _0x32b6eb[_0xf7df7d(0x1e4)](_0x569c04,_0xddabfe),_0xddabfe;}const _0x35c597=_0x2adc13[_0xf7df7d(0x1ac)][_0xf7df7d(0x243)]['name']||_0x569c04,_0x51afcb=sanitizeYamlKey(_0x35c597)||'activation_'+_0x569c04;let _0x1baf3a=_0x51afcb,_0x2ee62d=0x2;while(_0x1b82bb['has'](_0x1baf3a)){_0x1baf3a=_0x51afcb+'_'+_0x2ee62d,_0x2ee62d++;}_0x1b82bb[_0xf7df7d(0x170)](_0x1baf3a),_0x45aefc[_0xf7df7d(0x1e4)](_0xb10492,_0x1baf3a);const _0x188c65={'name':_0x1baf3a,'isJourneyLocal':!![],'definition':_0x157fd3};return _0x32b6eb[_0xf7df7d(0x1e4)](_0x569c04,_0x188c65),_0x188c65;}catch(_0x42f619){return _0x4dcf27['verbose']&&console[_0xf7df7d(0x19d)](_0xf7df7d(0x25f)+_0x569c04+':\x20'+_0x42f619[_0xf7df7d(0x1dc)]),{'name':_0x569c04,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x43a7c6,_0x60ed2e)=>{const _0x507e9e=_0x166a6e;return resolveJumpTarget(_0x43a7c6,_0x60ed2e,_0x189b1a,_0xc68938=>_0x4ff4f7[_0x507e9e(0x223)][_0x507e9e(0x20e)](_0xc68938));}},_0x22d390=await journeyResponseToDef(_0x3a6337,_0x3a87c4);_0x446184['push']({'item':_0x43c608,'yaml':_0x22d390});}},{'verbose':_0x4dcf27['verbose']});const _0x3699cb=await _0x4ff4f7['journey'][_0x3a5323(0x214)](_0x57bb37[0x0][_0x3a5323(0x1de)]),_0x1ad52c=buildMergedJourneyDef(_0x446184,_0x2910fa,_0x3699cb),_0x5456f7=normalizeJourneyDef(_0x1ad52c,_0x208a59),_0x59a7c0=toYamlString(_0x5456f7),_0x5b6f63=_0x30bfed||a27_0x16dbc4['join'](_0x3fbd23,sanitizeFileName(_0x11e483)+_0x3a5323(0x1bc));!_0x30bfed&&_0x369672&&!existsSync(_0x3fbd23)&&mkdirSync(_0x3fbd23,{'recursive':!![]});const _0x577e87=a27_0x16dbc4[_0x3a5323(0x1b0)](process[_0x3a5323(0x194)](),_0x5b6f63);if(existsSync(_0x5b6f63)){const _0x3ad3f5=readFileSync(_0x5b6f63,_0x3a5323(0x1c3)),_0x4028ca=generateDiff(_0x3ad3f5,_0x59a7c0),_0x23e785=hasChanges(_0x4028ca);_0x5ca0bc[_0x3a5323(0x215)]({'relativePath':_0x577e87,'absolutePath':_0x5b6f63,'content':_0x59a7c0,'isNew':![],'hasChanges':_0x23e785,'diff':_0x23e785?formatDiffWithColors(_0x4028ca):undefined});}else _0x5ca0bc['push']({'relativePath':_0x577e87,'absolutePath':_0x5b6f63,'content':_0x59a7c0,'isNew':!![],'hasChanges':![]});}const _0x1e8511=_0x5ca0bc['filter'](_0x2fa122=>_0x2fa122['isNew']),_0x9f5c4d=_0x5ca0bc['filter'](_0x12b478=>!_0x12b478['isNew']&&_0x12b478[_0x3a5323(0x22d)]),_0x181202=_0x5ca0bc['filter'](_0x5751a4=>!_0x5751a4['isNew']&&!_0x5751a4[_0x3a5323(0x22d)]),_0x1efe51=_0x2f2ac1[_0x3a5323(0x254)],_0x2cc7a7=_0x4e20ab['size'],_0x12f5b8=_0x1efe51>_0x2cc7a7?'\x20('+_0x1efe51+'\x20versions)':'';console['error'](_0x3a5323(0x175)),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880[_0x3a5323(0x1af)](_0x2cc7a7+'\x20journeys')+a27_0x43c880[_0x3a5323(0x226)](_0x12f5b8)),console['error']('\x20\x20'+a27_0x43c880[_0x3a5323(0x21d)]('+\x20'+_0x1e8511[_0x3a5323(0x254)]+_0x3a5323(0x188))),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880['yellow']('~\x20'+_0x9f5c4d[_0x3a5323(0x254)]+'\x20changed\x20files')),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880[_0x3a5323(0x226)]('=\x20'+_0x181202['length']+'\x20unchanged\x20files')),console[_0x3a5323(0x19d)](_0x3a5323(0x1d0)+a27_0x43c880['cyan'](_0x196322)+'\x0a');if(_0x9f5c4d[_0x3a5323(0x254)]>0x0)for(const _0x35c42b of _0x9f5c4d){console[_0x3a5323(0x19d)](_0x3a5323(0x24a)+_0x35c42b[_0x3a5323(0x161)]+'\x27:'),console[_0x3a5323(0x19d)]('─'[_0x3a5323(0x249)](0x3c)),console['error'](_0x35c42b['diff']),console['error']('─'[_0x3a5323(0x249)](0x3c));}if(_0x5c2a02[_0x3a5323(0x162)])return console['error'](a27_0x43c880[_0x3a5323(0x208)](_0x3a5323(0x1f0))),0x0;if(_0x1e8511[_0x3a5323(0x254)]===0x0&&_0x9f5c4d[_0x3a5323(0x254)]===0x0)return console['error'](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x260))),saveSessionContext({'parent_segment':_0x1e77f6},_0x5c2a02[_0x3a5323(0x16d)]),console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x186)+a27_0x43c880[_0x3a5323(0x226)]('parent_segment')+_0x3a5323(0x22a)+a27_0x43c880[_0x3a5323(0x1af)](_0x1e77f6))),0x0;if(!_0x5c2a02['yes']&&(_0x1e8511[_0x3a5323(0x254)]>0x0||_0x9f5c4d[_0x3a5323(0x254)]>0x0)){if(!isInteractive())return console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x1c2)](_0x3a5323(0x1ce)),_0x3a5323(0x1d9)),console['error'](a27_0x43c880['dim'](_0x3a5323(0x17b))),0x1;const _0x3f77a1=await confirmKey('Write\x20'+(_0x1e8511[_0x3a5323(0x254)]+_0x9f5c4d['length'])+_0x3a5323(0x206));if(!_0x3f77a1)return console['error'](a27_0x43c880[_0x3a5323(0x208)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x196322)&&mkdirSync(_0x196322,{'recursive':!![]});const _0x21dbd0=a27_0x16dbc4['join'](_0x196322,_0x3a5323(0x1b9));writeFileSync(_0x21dbd0,createTdxConfigContent(_0x1e77f6),_0x3a5323(0x1c3));for(const _0x3ece4b of _0x5ca0bc){(_0x3ece4b[_0x3a5323(0x1da)]||_0x3ece4b[_0x3a5323(0x22d)])&&writeFileSync(_0x3ece4b['absolutePath'],_0x3ece4b[_0x3a5323(0x1df)],_0x3a5323(0x1c3));}return console['error'](a27_0x43c880['green'](_0x3a5323(0x241)+(_0x1e8511[_0x3a5323(0x254)]+_0x9f5c4d[_0x3a5323(0x254)])+'\x20journey\x20files\x20to\x20'+_0x196322)),saveSessionContext({'parent_segment':_0x1e77f6},_0x5c2a02[_0x3a5323(0x16d)]),console['error'](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x186)+a27_0x43c880[_0x3a5323(0x226)](_0x3a5323(0x235))+_0x3a5323(0x22a)+a27_0x43c880['cyan'](_0x1e77f6))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:columns';[a27_0x23db74(0x16a)]=a27_0x23db74(0x244);async[a27_0x23db74(0x1a5)](_0x2ff58e){const _0x4d1119=a27_0x23db74,{options:_0x3f4a28,args:_0x565369,tdx:_0x479988}=_0x2ff58e,_0x33df66=_0x565369[0x0];if(!requireNameOrPath(_0x33df66))return 0x1;_0x3f4a28[_0x4d1119(0x16e)]&&console[_0x4d1119(0x19d)]('Input:\x20'+_0x33df66);const {journeyId:_0x422ee2}=await resolveJourneyIdFromInput(_0x33df66,_0x3f4a28,_0x479988),_0x4d8800=await withSpinner(_0x4d1119(0x23d),()=>_0x479988[_0x4d1119(0x223)][_0x4d1119(0x23c)](_0x422ee2),{'verbose':_0x3f4a28[_0x4d1119(0x16e)]}),_0x1b1157=_0x4d8800[_0x4d1119(0x1ea)];return console['log'](_0x4d1119(0x230)+_0x1b1157['database']),console[_0x4d1119(0x1ef)](_0x4d1119(0x242)+_0x1b1157[_0x4d1119(0x20c)]),await handleSDKOutput(_0x1b1157['columns'],_0x3f4a28),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:activations';[a27_0x23db74(0x16a)]=a27_0x23db74(0x182);async[a27_0x23db74(0x1a5)](_0x192c1b){const _0x39311f=a27_0x23db74,{options:_0x468a97,args:_0x572053,tdx:_0x3defe1}=_0x192c1b,_0x200c56=_0x572053[0x0];if(!requireNameOrPath(_0x200c56))return 0x1;_0x468a97[_0x39311f(0x16e)]&&console[_0x39311f(0x19d)](_0x39311f(0x1f2)+_0x200c56);const {journeyId:_0x411b07}=await resolveJourneyIdFromInput(_0x200c56,_0x468a97,_0x3defe1),_0x4f2f7d=await withSpinner(_0x39311f(0x220),()=>_0x3defe1['journey'][_0x39311f(0x19e)](_0x411b07),{'verbose':_0x468a97[_0x39311f(0x16e)]}),_0x39cef4=_0x4f2f7d[_0x39311f(0x1ea)];return console[_0x39311f(0x19d)]('Found\x20'+_0x39cef4[_0x39311f(0x254)]+'\x20activation'+(_0x39cef4['length']!==0x1?'s':'')),await handleSDKOutput(_0x39cef4,_0x468a97),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x22c);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1d3);[a27_0x23db74(0x185)]=new SegmentPushCommand();async[a27_0x23db74(0x1a5)](_0x1cfa0a){const _0xd9cef8=a27_0x23db74,_0x3022d3=_0x1cfa0a[_0xd9cef8(0x1f6)][0x0];let _0x12c09b;if(_0x3022d3){const _0x597c4d=await resolveTarget({'arg':_0x3022d3,'contextParent':_0x1cfa0a[_0xd9cef8(0x1e0)]['parentSegment'],'cwd':process[_0xd9cef8(0x194)]()});isSuccessfulResolution(_0x597c4d)&&_0x597c4d[_0xd9cef8(0x248)]===_0xd9cef8(0x1c5)&&(_0x12c09b=_0x597c4d[_0xd9cef8(0x167)]);}const _0x142913={..._0x1cfa0a,'options':{..._0x1cfa0a[_0xd9cef8(0x1e0)],'journeysOnly':!![],..._0x12c09b&&{'singleFilePath':_0x12c09b}}};return this[_0xd9cef8(0x185)][_0xd9cef8(0x1a5)](_0x142913);}}export class JourneyVersionsCommand extends BaseCommand{['name']='journey:versions';['description']=a27_0x23db74(0x25d);async['execute'](_0x412530){const _0x20a87c=a27_0x23db74,{options:_0x376f5f,args:_0x5d807e,tdx:_0x58e5f7}=_0x412530,_0x143b78=_0x5d807e[0x0];if(!requireNameOrPath(_0x143b78))return 0x1;if(_0x376f5f[_0x20a87c(0x16e)])console[_0x20a87c(0x19d)](_0x20a87c(0x1f2)+_0x143b78);const {journeyId:_0x30a23e}=await resolveJourneyIdFromInput(_0x143b78,_0x376f5f,_0x58e5f7),_0x2d9a6b=await withSpinner(_0x20a87c(0x1f5),()=>_0x58e5f7['journey']['listVersions'](_0x30a23e),{'verbose':_0x376f5f[_0x20a87c(0x16e)]}),{bundleName:_0x2534f4,versions:_0xbcbe2a,latestJourneyId:_0x458026}=_0x2d9a6b[_0x20a87c(0x1ea)];console['error'](_0x2534f4+':\x20'+_0xbcbe2a[_0x20a87c(0x254)]+'\x20version'+(_0xbcbe2a[_0x20a87c(0x254)]!==0x1?'s':''));const _0x24f38b=_0xbcbe2a[_0x20a87c(0x23a)](_0x4caffc=>({'version':_0x4caffc[_0x20a87c(0x17d)],'journey_id':_0x4caffc['journeyId'],'name':_0x4caffc[_0x20a87c(0x1bf)],'state':_0x4caffc[_0x20a87c(0x191)],'paused':_0x4caffc[_0x20a87c(0x1b4)],'latest':_0x4caffc[_0x20a87c(0x1b8)]===_0x458026,'created_at':_0x4caffc[_0x20a87c(0x247)]}));return await handleSDKOutput(_0x24f38b,_0x376f5f),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0x23db74(0x18a);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x23db74(0x1a5)](_0x5468ee){const _0x24e72e=a27_0x23db74,{options:_0x440af1,args:_0x3f2c77,tdx:_0x508fd7}=_0x5468ee,_0x44f8da=_0x3f2c77[0x0];if(!requireNameOrPath(_0x44f8da))return 0x1;if(_0x440af1[_0x24e72e(0x16e)])console[_0x24e72e(0x19d)]('Input:\x20'+_0x44f8da);const {journeyId:_0x2debe2,journeyName:_0x440a1e}=await resolveJourneyIdFromInput(_0x44f8da,_0x440af1,_0x508fd7);if(!_0x440af1[_0x24e72e(0x197)]){const _0xa24885=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x440a1e+'\x22?');if(!_0xa24885)return console['error']('Cancelled'),0x0;}const _0x17a648=await withSpinner(_0x24e72e(0x23b),()=>_0x508fd7[_0x24e72e(0x223)][_0x24e72e(0x25c)](_0x2debe2),{'verbose':_0x440af1[_0x24e72e(0x16e)]}),_0x39a8ec=_0x17a648[_0x24e72e(0x1ea)];return console[_0x24e72e(0x19d)](a27_0x43c880[_0x24e72e(0x21d)]('✔')+'\x20Created\x20v'+_0x39a8ec[_0x24e72e(0x1ac)][_0x24e72e(0x17d)]+_0x24e72e(0x20d)+_0x39a8ec['attributes'][_0x24e72e(0x1bf)]+'\x22'),console['error'](_0x24e72e(0x190)+_0x39a8ec['id']),await handleSingleObjectOutput({'id':_0x39a8ec['id'],'name':_0x39a8ec[_0x24e72e(0x1ac)]['name'],'version':_0x39a8ec['attributes'][_0x24e72e(0x17d)],'state':_0x39a8ec[_0x24e72e(0x1ac)][_0x24e72e(0x191)],'bundle_id':_0x39a8ec['attributes'][_0x24e72e(0x1de)],'created_at':_0x39a8ec['attributes']['createdAt']},_0x440af1),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:version:view';[a27_0x23db74(0x16a)]=a27_0x23db74(0x1cd);async[a27_0x23db74(0x1a5)](_0x32c75d){const _0x20e53c=a27_0x23db74,{options:_0xc7ae11,args:_0x304037,tdx:_0x716385}=_0x32c75d,_0x825901=_0x304037[0x0];if(!requireNameOrPath(_0x825901))return 0x1;const _0x5b8637=_0xc7ae11['version'];if(!_0x5b8637)return console[_0x20e53c(0x19d)](_0x20e53c(0x17c)),console[_0x20e53c(0x19d)](_0x20e53c(0x189)),0x1;const _0x2b9a12=parseInt(_0x5b8637,0xa);if(isNaN(_0x2b9a12)||_0x2b9a12<0x1)return console[_0x20e53c(0x19d)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x5b8637),0x1;if(_0xc7ae11[_0x20e53c(0x16e)])console['error'](_0x20e53c(0x1f2)+_0x825901+_0x20e53c(0x183)+_0x2b9a12);const {journeyId:_0x557608,parentSegmentId:_0x20552f}=await resolveJourneyIdFromInput(_0x825901,_0xc7ae11,_0x716385),_0x567ab8=await withSpinner('Resolving\x20version...',()=>_0x716385['journey']['listVersions'](_0x557608),{'verbose':_0xc7ae11[_0x20e53c(0x16e)]}),{versions:_0x12f6af,latestJourneyId:_0x266ca5}=_0x567ab8[_0x20e53c(0x1ea)],_0x5387da=_0x12f6af[_0x20e53c(0x224)](_0x170fdb=>_0x170fdb['versionNumber']===_0x2b9a12);if(!_0x5387da){const _0x214af7=_0x12f6af['map'](_0x4892db=>'v'+_0x4892db[_0x20e53c(0x17d)])['join'](',\x20');return console[_0x20e53c(0x19d)](_0x20e53c(0x1a6)+_0x2b9a12+_0x20e53c(0x232)+_0x214af7),0x1;}const _0x24dd3a=await withSpinner(_0x20e53c(0x169)+_0x2b9a12+_0x20e53c(0x229),()=>_0x716385['journey'][_0x20e53c(0x20e)](_0x5387da['journeyId']),{'verbose':_0xc7ae11['verbose']}),_0x4d938e=_0x24dd3a[_0x20e53c(0x1ea)],_0x16cd35=getConsoleNextUrl(_0xc7ae11[_0x20e53c(0x1c4)],_0x20e53c(0x23f)+_0x20552f+_0x20e53c(0x181)+_0x5387da[_0x20e53c(0x1b8)]+_0x20e53c(0x180));return await handleSingleObjectOutput({'id':_0x4d938e['id'],'name':_0x4d938e[_0x20e53c(0x1ac)]['name'],'version':_0x4d938e[_0x20e53c(0x1ac)]['versionNumber'],'description':_0x4d938e[_0x20e53c(0x1ac)]['description'],'state':_0x4d938e[_0x20e53c(0x1ac)]['state'],'paused':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x1b4)],'reentry_mode':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x184)],'stages':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x1ba)]?.['length']||0x0,..._0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x165)]&&{'goal':_0x4d938e[_0x20e53c(0x1ac)]['goal'][_0x20e53c(0x1bf)]},'latest':_0x5387da[_0x20e53c(0x1b8)]===_0x266ca5,'created_at':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x247)],'updated_at':_0x4d938e['attributes'][_0x20e53c(0x1ed)],'url':_0x16cd35},_0xc7ae11),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a28_0x3540(){const _0x5512eb=['\x20warning(s)','\x20error(s)','no_parent','dim','\x20journey(s)\x20with\x20errors,\x20','error','log','filePath','file','1139010RFqxQr','validCount','green','helpText','3374usZsRT','cyan','type','invalidCount','warningCount','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose','hasErrors','name','313461DFLJwV','.yaml','filter','\x20warning(s)\x20found','warnings','\x20segment\x20file(s)\x20skipped)','skippedCount','execute','journey:validate','Error:\x20Directory\x20not\x20found:\x20','\x20journey(s)\x20valid','Validate\x20journey\x20YAML\x20files','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','105752wFIdzI','journey','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','message','\x20valid','endsWith','3543368fmWIov','No\x20journey\x20YAML\x20files\x20found\x20in\x20','errorCode','reason','valid','length','Error:\x20','671608eWziXw','\x20segment\x20file(s)\x20skipped','red','yellow','2723185mCYGmU','relativePath','5664HLGRNy'];a28_0x3540=function(){return _0x5512eb;};return a28_0x3540();}const a28_0x29d873=a28_0x1e0b;(function(_0x2b7d6c,_0x2ca0d6){const _0x4bb7d7=a28_0x1e0b,_0x281009=_0x2b7d6c();while(!![]){try{const _0x35391e=parseInt(_0x4bb7d7(0xf5))/0x1+-parseInt(_0x4bb7d7(0xcb))/0x2+parseInt(_0x4bb7d7(0xe8))/0x3+-parseInt(_0x4bb7d7(0xd1))/0x4+parseInt(_0x4bb7d7(0xdc))/0x5+-parseInt(_0x4bb7d7(0xde))/0x6*(-parseInt(_0x4bb7d7(0xec))/0x7)+-parseInt(_0x4bb7d7(0xd8))/0x8;if(_0x35391e===_0x2ca0d6)break;else _0x281009['push'](_0x281009['shift']());}catch(_0x4fcf1e){_0x281009['push'](_0x281009['shift']());}}}(a28_0x3540,0xa399b));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1e0b(_0x40dd5f,_0x4149a5){_0x40dd5f=_0x40dd5f-0xc8;const _0x3540e7=a28_0x3540();let _0x1e0b30=_0x3540e7[_0x40dd5f];return _0x1e0b30;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x17218b 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_0x29d873(0xf4)]=a28_0x29d873(0xfd);['description']=a28_0x29d873(0xc9);async[a28_0x29d873(0xfc)](_0x5e2505){const _0x11b4ec=a28_0x29d873,{options:_0x4ebb84,args:_0x1047aa}=_0x5e2505,_0x2422c6=_0x4ebb84,_0x38b6dc=await resolveTarget({'arg':_0x1047aa[0x0],'contextParent':_0x4ebb84['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x38b6dc))return _0x38b6dc[_0x11b4ec(0xd3)]===_0x11b4ec(0xe1)?(console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xdb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x11b4ec(0xf1)),console[_0x11b4ec(0xe4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x11b4ec(0xe4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xda)](_0x11b4ec(0xd7)+_0x38b6dc[_0x11b4ec(0xce)]+'\x0a')),_0x38b6dc[_0x11b4ec(0xeb)]&&console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xed)](_0x38b6dc[_0x11b4ec(0xeb)]))),0x1;const _0x4b8aa6=_0x38b6dc['targetDir'],_0x56c193=_0x38b6dc[_0x11b4ec(0xee)]===_0x11b4ec(0xe7)?_0x38b6dc[_0x11b4ec(0xe6)]:undefined;if(!_0x56c193&&!existsSync(_0x4b8aa6))return console[_0x11b4ec(0xe4)](a28_0x17218b['red'](_0x11b4ec(0xfe)+_0x4b8aa6+'\x0a')),0x1;let _0x29269d;if(_0x56c193){if(!_0x56c193['endsWith']('.yml')&&!_0x56c193[_0x11b4ec(0xd0)](_0x11b4ec(0xf6)))return console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xda)](_0x11b4ec(0xcd)+_0x56c193+'\x0a')),0x1;_0x29269d=[_0x56c193];}else _0x29269d=findYamlFiles(_0x4b8aa6);if(_0x29269d['length']===0x0)return console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xda)](_0x11b4ec(0xca)+_0x4b8aa6+'\x0a')),0x1;const _0x56f962=validateYamlFiles(_0x29269d,_0x4b8aa6,{'filterType':_0x11b4ec(0xcc)}),_0x36c7ae=calculateSummary(_0x56f962),_0x3ed981=_0x56f962[_0x11b4ec(0xf7)](isValidationResult);if(_0x3ed981['length']===0x0)return console[_0x11b4ec(0xe4)](a28_0x17218b['yellow'](_0x11b4ec(0xd2)+_0x4b8aa6+'\x0a')),_0x36c7ae[_0x11b4ec(0xfb)]>0x0&&console[_0x11b4ec(0xe4)](a28_0x17218b[_0x11b4ec(0xe2)]('('+_0x36c7ae['skippedCount']+_0x11b4ec(0xfa))),0x0;for(const _0x16403f of _0x56f962){if(!isValidationResult(_0x16403f)){_0x2422c6[_0x11b4ec(0xf2)]&&console['log'](a28_0x17218b[_0x11b4ec(0xe2)]('-\x20'+_0x16403f[_0x11b4ec(0xdd)]+'\x20(skipped:\x20'+_0x16403f[_0x11b4ec(0xd4)]+')'));continue;}const {relativePath:_0x1b40e1,source:_0x75d508,result:_0x16934c}=_0x16403f;if(_0x16934c[_0x11b4ec(0xd5)]&&_0x16934c['warnings'][_0x11b4ec(0xd6)]===0x0)_0x2422c6[_0x11b4ec(0xf2)]&&console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xea)]('✔\x20'+_0x1b40e1));else _0x16934c['valid']?(console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xdb)]('⚠\x20'+_0x1b40e1+':\x20'+_0x16934c[_0x11b4ec(0xf9)][_0x11b4ec(0xd6)]+_0x11b4ec(0xdf))),console['log'](formatValidationResult(_0x16934c,_0x75d508,_0x1b40e1))):(console['log'](a28_0x17218b[_0x11b4ec(0xda)]('✖\x20'+_0x1b40e1+':\x20'+_0x16934c['errors']['length']+_0x11b4ec(0xe0))),console['log'](formatValidationResult(_0x16934c,_0x75d508,_0x1b40e1)));}return console[_0x11b4ec(0xe5)](''),_0x36c7ae[_0x11b4ec(0xf3)]?(console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xda)]('Validation\x20failed:\x20'+_0x36c7ae[_0x11b4ec(0xef)]+_0x11b4ec(0xe3)+_0x36c7ae[_0x11b4ec(0xe9)]+_0x11b4ec(0xcf))),_0x36c7ae[_0x11b4ec(0xf0)]>0x0&&console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xdb)](_0x36c7ae[_0x11b4ec(0xf0)]+_0x11b4ec(0xf8))),_0x36c7ae[_0x11b4ec(0xfb)]>0x0&&console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xe2)](_0x36c7ae[_0x11b4ec(0xfb)]+_0x11b4ec(0xd9))),0x1):(console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xea)]('✔\x20All\x20'+_0x36c7ae[_0x11b4ec(0xe9)]+_0x11b4ec(0xc8))),_0x36c7ae[_0x11b4ec(0xf0)]>0x0&&console[_0x11b4ec(0xe5)](a28_0x17218b['yellow'](_0x36c7ae['warningCount']+_0x11b4ec(0xf8))),_0x36c7ae[_0x11b4ec(0xfb)]>0x0&&console[_0x11b4ec(0xe5)](a28_0x17218b[_0x11b4ec(0xe2)](_0x36c7ae[_0x11b4ec(0xfb)]+_0x11b4ec(0xd9))),0x0);}}
|