@treasuredata/tdx 2026.3.47 → 2026.3.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x54ee4d=a26_0x3f37;(function(_0x53a698,_0x2ee14f){const _0xc95ac=a26_0x3f37,_0x1c5e35=_0x53a698();while(!![]){try{const _0x5e70e8=parseInt(_0xc95ac(0x197))/0x1*(-parseInt(_0xc95ac(0x19d))/0x2)+-parseInt(_0xc95ac(0x191))/0x3+-parseInt(_0xc95ac(0x18f))/0x4*(-parseInt(_0xc95ac(0x196))/0x5)+parseInt(_0xc95ac(0x1a1))/0x6*(parseInt(_0xc95ac(0x1aa))/0x7)+-parseInt(_0xc95ac(0x1a0))/0x8+parseInt(_0xc95ac(0x199))/0x9+-parseInt(_0xc95ac(0x19b))/0xa*(parseInt(_0xc95ac(0x193))/0xb);if(_0x5e70e8===_0x2ee14f)break;else _0x1c5e35['push'](_0x1c5e35['shift']());}catch(_0x1ac6c9){_0x1c5e35['push'](_0x1c5e35['shift']());}}}(a26_0x3328,0xd0ac2));import{BaseCommand}from'./command.js';function a26_0x3f37(_0x4235e5,_0x5634e5){_0x4235e5=_0x4235e5-0x17e;const _0x332897=a26_0x3328();let _0x3f3730=_0x332897[_0x4235e5];return _0x3f3730;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x3ecec2 from'chalk';function a26_0x3328(){const _0x11895f=['skippedCount','green','6463440NdqrtW','161358qJPiIC','dirname','resolve','invalidCount','log','\x20warning(s)\x20found','\x20non-template\x20file(s)\x20skipped','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20error(s)','343sKdIdC','\x20template(s)\x20valid','\x20template(s)\x20with\x20errors,\x20','\x20valid','validCount','\x20warning(s)','name','.yaml','Validation\x20failed:\x20','warningCount','length','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yml','errors','template','verbose','dim','error','warnings','yellow','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','4tYSHPg','red','621069WwHZEK','valid','22oPBcdX','Error:\x20Directory\x20not\x20found:\x20','hasErrors','7575905GexDiG','23RRtDME','cwd','13765842UcEWfg','endsWith','4098790vjKqoE','\x20non-template\x20file(s)\x20skipped)','145482CcFBuF'];a26_0x3328=function(){return _0x11895f;};return a26_0x3328();}import a26_0x254869 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a26_0x54ee4d(0x180)]='engage:template:validate';['description']='Validate\x20template\x20YAML\x20files';async['execute'](_0x35a1b0){const _0x3086dc=a26_0x54ee4d,{options:_0x58299c,args:_0x4aa1f9}=_0x35a1b0,_0x333775=_0x58299c,_0x5baf51=_0x4aa1f9[0x0],_0x3a212c=_0x5baf51?a26_0x254869[_0x3086dc(0x1a3)](_0x5baf51):undefined,_0x179141=_0x3a212c?isYamlFile(_0x3a212c):![];let _0x3d056a,_0x15188a;if(_0x179141&&_0x3a212c)_0x3d056a=a26_0x254869[_0x3086dc(0x1a2)](_0x3a212c),_0x15188a=_0x3a212c;else _0x3a212c?_0x3d056a=_0x3a212c:_0x3d056a=process[_0x3086dc(0x198)]();if(!_0x15188a&&!existsSync(_0x3d056a))return console['error'](a26_0x3ecec2[_0x3086dc(0x190)](_0x3086dc(0x194)+_0x3d056a+'\x0a')),0x1;let _0x2eb5d6;if(_0x15188a){if(!_0x15188a[_0x3086dc(0x19a)](_0x3086dc(0x186))&&!_0x15188a[_0x3086dc(0x19a)](_0x3086dc(0x181)))return console['error'](a26_0x3ecec2[_0x3086dc(0x190)](_0x3086dc(0x18e)+_0x15188a+'\x0a')),0x1;_0x2eb5d6=[_0x15188a];}else _0x2eb5d6=findYamlFiles(_0x3d056a);if(_0x2eb5d6[_0x3086dc(0x184)]===0x0)return console[_0x3086dc(0x18b)](a26_0x3ecec2[_0x3086dc(0x190)](_0x3086dc(0x185)+_0x3d056a+'\x0a')),0x1;const _0x3563c5=validateYamlFiles(_0x2eb5d6,_0x3d056a,{'filterType':_0x3086dc(0x188)}),_0x6caf01=calculateSummary(_0x3563c5),_0x7bffda=_0x3563c5['filter'](isValidationResult);if(_0x7bffda[_0x3086dc(0x184)]===0x0)return console[_0x3086dc(0x18b)](a26_0x3ecec2[_0x3086dc(0x18d)](_0x3086dc(0x1a8)+_0x3d056a+'\x0a')),_0x6caf01[_0x3086dc(0x19e)]>0x0&&console[_0x3086dc(0x18b)](a26_0x3ecec2[_0x3086dc(0x18a)]('('+_0x6caf01[_0x3086dc(0x19e)]+_0x3086dc(0x19c))),0x0;for(const _0xd6c246 of _0x3563c5){if(!isValidationResult(_0xd6c246)){_0x333775[_0x3086dc(0x189)]&&console['log'](a26_0x3ecec2[_0x3086dc(0x18a)]('-\x20'+_0xd6c246['relativePath']+'\x20(skipped:\x20'+_0xd6c246['reason']+')'));continue;}const {relativePath:_0x8a4b37,source:_0x350e7a,result:_0x73214a}=_0xd6c246;if(_0x73214a[_0x3086dc(0x192)]&&_0x73214a[_0x3086dc(0x18c)][_0x3086dc(0x184)]===0x0)_0x333775[_0x3086dc(0x189)]&&console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x19f)]('✔\x20'+_0x8a4b37));else _0x73214a['valid']?(console['log'](a26_0x3ecec2['yellow']('⚠\x20'+_0x8a4b37+':\x20'+_0x73214a[_0x3086dc(0x18c)][_0x3086dc(0x184)]+_0x3086dc(0x17f))),console['log'](formatValidationResult(_0x73214a,_0x350e7a,_0x8a4b37))):(console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x190)]('✖\x20'+_0x8a4b37+':\x20'+_0x73214a[_0x3086dc(0x187)]['length']+_0x3086dc(0x1a9))),console[_0x3086dc(0x1a5)](formatValidationResult(_0x73214a,_0x350e7a,_0x8a4b37)));}return console[_0x3086dc(0x1a5)](''),_0x6caf01[_0x3086dc(0x195)]?(console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x190)](_0x3086dc(0x182)+_0x6caf01[_0x3086dc(0x1a4)]+_0x3086dc(0x1ac)+_0x6caf01[_0x3086dc(0x17e)]+_0x3086dc(0x1ad))),_0x6caf01[_0x3086dc(0x183)]>0x0&&console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x18d)](_0x6caf01[_0x3086dc(0x183)]+_0x3086dc(0x1a6))),_0x6caf01[_0x3086dc(0x19e)]>0x0&&console[_0x3086dc(0x1a5)](a26_0x3ecec2['dim'](_0x6caf01[_0x3086dc(0x19e)]+_0x3086dc(0x1a7))),0x1):(console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x19f)]('✔\x20All\x20'+_0x6caf01[_0x3086dc(0x17e)]+_0x3086dc(0x1ab))),_0x6caf01[_0x3086dc(0x183)]>0x0&&console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x18d)](_0x6caf01['warningCount']+'\x20warning(s)\x20found')),_0x6caf01[_0x3086dc(0x19e)]>0x0&&console[_0x3086dc(0x1a5)](a26_0x3ecec2[_0x3086dc(0x18a)](_0x6caf01[_0x3086dc(0x19e)]+_0x3086dc(0x1a7))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x28e51a=a27_0x41b2;(function(_0x238940,_0x34a160){const _0x247fdf=a27_0x41b2,_0x45f4ef=_0x238940();while(!![]){try{const _0x538ea2=-parseInt(_0x247fdf(0x218))/0x1+parseInt(_0x247fdf(0x1d6))/0x2*(parseInt(_0x247fdf(0x213))/0x3)+parseInt(_0x247fdf(0x1de))/0x4*(parseInt(_0x247fdf(0x217))/0x5)+parseInt(_0x247fdf(0x203))/0x6*(-parseInt(_0x247fdf(0x21a))/0x7)+-parseInt(_0x247fdf(0x1d5))/0x8+-parseInt(_0x247fdf(0x1cb))/0x9*(parseInt(_0x247fdf(0x1db))/0xa)+-parseInt(_0x247fdf(0x1e9))/0xb*(-parseInt(_0x247fdf(0x210))/0xc);if(_0x538ea2===_0x34a160)break;else _0x45f4ef['push'](_0x45f4ef['shift']());}catch(_0x54aa03){_0x45f4ef['push'](_0x45f4ef['shift']());}}}(a27_0x1583,0xbe90b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a27_0x1583(){const _0x276253=['error','just\x20now','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','floor','m\x20ago','job:submit','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Show\x20job\x20details','462306EirCth','end_at','user_name','No\x20SQL\x20statements\x20found\x20in\x20file','type','round','result','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','status','presto','substring','validate','length','1560sJRAJa','✔\x20Found\x20','args','11031Cajdjx','\x27\x20to\x20verify\x20the\x20job\x20status','\x20job','\x20jobs','32735QsDTZD','1382287iGBBks','submit','133FBcufz','name','url','...','\x20\x20Job\x20ID:\x20','list','dim','job_id','Database:\x20','description','yes','9414zYIexZ','kill','start_at','created_at','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Status\x20filter:\x20','Submit\x20a\x20job','Getting\x20job\x20details...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','5371040pajOal','44ehwzsc','data','success','verbose','Get\x20job\x20results','1060rLQOMQ','debug','trino','516bZdnxV','jobs','information_schema','getTime','join','map','Job\x20type:\x20','Getting\x20job\x20results...','Listing\x20jobs...','Limit:\x20','Cancelled','294767qLubYJ','show','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','push','priority','database','Query:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','List\x20jobs','green','INVALID_ARGUMENT','✔\x20Job\x20submitted','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','query','✔\x20Retrieved\x20','now','abs','execute'];a27_0x1583=function(){return _0x276253;};return a27_0x1583();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a27_0x41b2(_0xac060e,_0x46b057){_0xac060e=_0xac060e-0x1c7;const _0x158322=a27_0x1583();let _0x41b27a=_0x158322[_0xac060e];return _0x41b27a;}import{hyperlink}from'../sdk/util/formatters.js';import a27_0x733393 from'chalk';function formatDuration(_0x21f108){const _0x57306c=a27_0x41b2;if(_0x21f108<0x3c)return _0x21f108+'s';if(_0x21f108<0xe10)return Math[_0x57306c(0x1fe)](_0x21f108/0x3c)+'m\x20'+_0x21f108%0x3c+'s';const _0x2190a4=Math[_0x57306c(0x1fe)](_0x21f108/0xe10),_0x841919=Math['floor'](_0x21f108%0xe10/0x3c);return _0x841919>0x0?_0x2190a4+'h\x20'+_0x841919+'m':_0x2190a4+'h';}function formatRelativeTime(_0x4a229f){const _0x5bb9a4=a27_0x41b2,_0x4dcb40=Date[_0x5bb9a4(0x1f8)]()-_0x4a229f[_0x5bb9a4(0x1e1)](),_0x54f7db=Math['floor'](Math[_0x5bb9a4(0x1f9)](_0x4dcb40)/0x3e8);if(_0x54f7db<0x3c)return _0x5bb9a4(0x1fc);const _0x4e0878=Math[_0x5bb9a4(0x1fe)](_0x54f7db/0x3c);if(_0x4e0878<0x3c)return _0x4e0878+_0x5bb9a4(0x1ff);const _0x2c29ad=Math[_0x5bb9a4(0x1fe)](_0x4e0878/0x3c);if(_0x2c29ad<0x18)return _0x2c29ad+'h\x20ago';const _0x387b59=Math[_0x5bb9a4(0x1fe)](_0x2c29ad/0x18);if(_0x387b59<0x1e)return _0x387b59+'d\x20ago';return Math[_0x5bb9a4(0x1fe)](_0x387b59/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x28e51a(0x21b)]='jobs';[a27_0x28e51a(0x1c9)]=a27_0x28e51a(0x1f1);async[a27_0x28e51a(0x1fa)](_0x8493ce){const _0x1715ee=a27_0x28e51a,{options:_0x215060,tdx:_0x5ab5f7}=_0x8493ce,_0x4df480=resolveLimit(_0x215060['limit'],DEFAULT_DISPLAY_LIMIT),_0x32c98a=_0x215060[_0x1715ee(0x20b)];_0x215060[_0x1715ee(0x1d9)]&&(console[_0x1715ee(0x1fb)](_0x1715ee(0x1e7)+_0x4df480+_0x1715ee(0x216)),_0x32c98a&&console['error'](_0x1715ee(0x1d0)+_0x32c98a));const _0x5c5fb6=await withSpinner(_0x1715ee(0x1e6),()=>_0x5ab5f7[_0x1715ee(0x1df)][_0x1715ee(0x21f)]({'from':0x0,'to':_0x4df480-0x1,'status':_0x32c98a}),{'verbose':_0x215060[_0x1715ee(0x1d9)]}),_0x53634b=_0x5c5fb6[_0x1715ee(0x1d7)];console[_0x1715ee(0x1fb)](_0x1715ee(0x211)+_0x53634b[_0x1715ee(0x20f)]+_0x1715ee(0x215)+(_0x53634b[_0x1715ee(0x20f)]!==0x1?'s':''));const _0xc3b4d9=_0x215060['site'];if(isStructuredFormat(_0x215060)){const _0x38fdde=_0x53634b[_0x1715ee(0x1e3)](_0x5a5bd4=>{const _0x288d65=_0x1715ee;let _0x2d6c23;if(_0x5a5bd4[_0x288d65(0x1cd)]&&_0x5a5bd4['end_at']){const _0x2b9969=new Date(_0x5a5bd4['start_at'])[_0x288d65(0x1e1)](),_0x21278c=new Date(_0x5a5bd4[_0x288d65(0x204)])['getTime']();_0x2d6c23=Math[_0x288d65(0x208)]((_0x21278c-_0x2b9969)/0x3e8);}return{'job_id':_0x5a5bd4[_0x288d65(0x1c7)],'type':_0x5a5bd4['type']===_0x288d65(0x20c)?_0x288d65(0x1dd):_0x5a5bd4[_0x288d65(0x207)],'status':_0x5a5bd4[_0x288d65(0x20b)],'user_name':_0x5a5bd4[_0x288d65(0x205)],'duration_sec':_0x2d6c23,'created_at':_0x5a5bd4['created_at'],'started_at':_0x5a5bd4[_0x288d65(0x1cd)],'end_at':_0x5a5bd4['end_at']};});await handleSDKOutput(_0x38fdde,_0x215060);}else for(const _0x1385e7 of _0x53634b){const _0x5a920f=_0x1385e7[_0x1715ee(0x20b)]===_0x1715ee(0x1d8)?a27_0x733393[_0x1715ee(0x1f2)]:_0x1385e7[_0x1715ee(0x20b)]===_0x1715ee(0x1fb)?a27_0x733393['red']:a27_0x733393['dim'],_0x392b46=_0x5a920f(_0x1385e7['status']),_0x5b9f95=getJobUrl(_0xc3b4d9,_0x1385e7[_0x1715ee(0x1c7)]),_0x1c3876=hyperlink(_0x1385e7[_0x1715ee(0x1c7)],_0x5b9f95),_0x1e7ef1=a27_0x733393[_0x1715ee(0x220)](_0x1385e7['type']==='presto'?_0x1715ee(0x1dd):_0x1385e7[_0x1715ee(0x207)]),_0x2da381=[];if(_0x1385e7['start_at']&&_0x1385e7[_0x1715ee(0x204)]){const _0x251ebd=Math[_0x1715ee(0x208)]((new Date(_0x1385e7['end_at'])['getTime']()-new Date(_0x1385e7['start_at'])[_0x1715ee(0x1e1)]())/0x3e8);_0x2da381['push'](formatDuration(_0x251ebd));}if(_0x1385e7[_0x1715ee(0x204)])_0x2da381[_0x1715ee(0x1ec)](formatRelativeTime(new Date(_0x1385e7[_0x1715ee(0x204)])));else _0x1385e7['start_at']&&_0x2da381[_0x1715ee(0x1ec)](formatRelativeTime(new Date(_0x1385e7['start_at'])));const _0x2458dd=_0x2da381[_0x1715ee(0x20f)]>0x0?a27_0x733393[_0x1715ee(0x220)]('\x20'+_0x2da381[_0x1715ee(0x1e2)](',\x20')):'';console['log']('⚡\x20'+_0x1c3876+'\x20'+_0x1e7ef1+'\x20'+_0x392b46+_0x2458dd);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x28e51a(0x21b)]='job:show';['description']=a27_0x28e51a(0x202);['validate'](_0x4c467a){const _0x5286dc=a27_0x28e51a,_0x2cea07=_0x4c467a[_0x5286dc(0x212)][0x0];if(!_0x2cea07)return _0x5286dc(0x1f0);return undefined;}async[a27_0x28e51a(0x1fa)](_0x5584ed){const _0x1af46d=a27_0x28e51a,{options:_0x321882,args:_0x3c04ce,tdx:_0x5d6b55}=_0x5584ed,_0x126a8b=_0x3c04ce[0x0],_0x5f1197=await withSpinner(_0x1af46d(0x1d2),()=>_0x5d6b55[_0x1af46d(0x1df)][_0x1af46d(0x1ea)](_0x126a8b),{'verbose':_0x321882['verbose']}),_0x3c4aeb=_0x5f1197[_0x1af46d(0x1d7)];let _0x2002ca;if(_0x3c4aeb[_0x1af46d(0x1cd)]&&_0x3c4aeb[_0x1af46d(0x204)]){const _0x482815=new Date(_0x3c4aeb[_0x1af46d(0x1cd)])[_0x1af46d(0x1e1)](),_0x2d3772=new Date(_0x3c4aeb['end_at'])[_0x1af46d(0x1e1)]();_0x2002ca=Math[_0x1af46d(0x208)]((_0x2d3772-_0x482815)/0x3e8);}const _0x5cde63={'job_id':_0x3c4aeb['job_id'],'type':_0x3c4aeb[_0x1af46d(0x207)],'status':_0x3c4aeb[_0x1af46d(0x20b)],..._0x3c4aeb[_0x1af46d(0x205)]&&{'user_name':_0x3c4aeb[_0x1af46d(0x205)]},..._0x2002ca!==undefined&&{'duration_sec':_0x2002ca},..._0x3c4aeb[_0x1af46d(0x1ce)]&&{'created_at':_0x3c4aeb[_0x1af46d(0x1ce)]},..._0x3c4aeb[_0x1af46d(0x1cd)]&&{'started_at':_0x3c4aeb['start_at']},..._0x3c4aeb[_0x1af46d(0x204)]&&{'end_at':_0x3c4aeb[_0x1af46d(0x204)]},..._0x3c4aeb[_0x1af46d(0x1ee)]&&{'database':_0x3c4aeb[_0x1af46d(0x1ee)]},..._0x3c4aeb[_0x1af46d(0x1ed)]!==undefined&&{'priority':_0x3c4aeb[_0x1af46d(0x1ed)]},..._0x3c4aeb[_0x1af46d(0x21c)]&&{'url':_0x3c4aeb[_0x1af46d(0x21c)]},..._0x3c4aeb[_0x1af46d(0x1f6)]&&{'query':_0x3c4aeb[_0x1af46d(0x1f6)]},..._0x3c4aeb[_0x1af46d(0x1dc)]&&{'debug':_0x3c4aeb[_0x1af46d(0x1dc)]}};return await handleSingleObjectOutput(_0x5cde63,_0x321882),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x28e51a(0x21b)]='job:kill';[a27_0x28e51a(0x1c9)]='Kill\x20a\x20job';['validate'](_0x514dad){const _0x2e2499=a27_0x28e51a,_0x7692a=_0x514dad[_0x2e2499(0x212)][0x0];if(!_0x7692a)return _0x2e2499(0x1d3);return undefined;}async[a27_0x28e51a(0x1fa)](_0x366beb){const _0x301a04=a27_0x28e51a,{options:_0x2421de,args:_0x231c3f,tdx:_0x172a7c}=_0x366beb,_0x78be21=_0x231c3f[0x0];if(!_0x2421de[_0x301a04(0x1ca)]){const _0x26d102=await confirm(_0x301a04(0x1cf)+_0x78be21+'?');if(!_0x26d102)return console[_0x301a04(0x1fb)](_0x301a04(0x1e8)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x172a7c[_0x301a04(0x1df)][_0x301a04(0x1cc)](_0x78be21),{'verbose':_0x2421de['verbose']}),console[_0x301a04(0x1fb)](_0x301a04(0x1d4)+_0x78be21),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x78be21+_0x301a04(0x214)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x28e51a(0x21b)]=a27_0x28e51a(0x200);[a27_0x28e51a(0x1c9)]=a27_0x28e51a(0x1d1);async[a27_0x28e51a(0x1fa)](_0x2546c3){const _0x2b0ac7=a27_0x28e51a,{options:_0x4a5ff3,args:_0xd6cd14,tdx:_0x286b8d}=_0x2546c3,_0x51eb6f=_0x4a5ff3['jobType']||'trino',_0x21a532=_0x4a5ff3['file'],_0x5488bd=_0x4a5ff3[_0x2b0ac7(0x1ee)]||_0x2b0ac7(0x1e0),_0x22a2c8=_0x4a5ff3['result'];if(_0x51eb6f!=='trino'&&_0x51eb6f!=='hive')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2b0ac7(0x201));let _0x583448;if(_0x21a532){if(_0xd6cd14[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2b0ac7(0x1eb));const _0x1ad674=readSqlStatementsFromFile(_0x21a532);if(_0x1ad674[_0x2b0ac7(0x20f)]===0x0)throw new SDKError(ErrorCode[_0x2b0ac7(0x1f3)],_0x2b0ac7(0x206));if(_0x1ad674[_0x2b0ac7(0x20f)]>0x1)throw new SDKError(ErrorCode[_0x2b0ac7(0x1f3)],_0x2b0ac7(0x1fd));_0x583448=_0x1ad674[0x0];}else{if(!_0xd6cd14[0x0])throw new SDKError(ErrorCode[_0x2b0ac7(0x1f3)],_0x2b0ac7(0x1f5));_0x583448=_0xd6cd14[0x0];}_0x4a5ff3[_0x2b0ac7(0x1d9)]&&(console[_0x2b0ac7(0x1fb)](_0x2b0ac7(0x1e4)+_0x51eb6f),console[_0x2b0ac7(0x1fb)](_0x2b0ac7(0x1c8)+_0x5488bd),console[_0x2b0ac7(0x1fb)](_0x2b0ac7(0x1ef)+_0x583448[_0x2b0ac7(0x20d)](0x0,0x64)+(_0x583448[_0x2b0ac7(0x20f)]>0x64?_0x2b0ac7(0x21d):'')));const _0x24ca0d=await withSpinner('Submitting\x20job...',()=>_0x286b8d[_0x2b0ac7(0x1df)][_0x2b0ac7(0x219)](_0x5488bd,_0x583448,_0x51eb6f,_0x22a2c8),{'verbose':_0x4a5ff3[_0x2b0ac7(0x1d9)]}),_0x8a6ca1=_0x24ca0d[_0x2b0ac7(0x1d7)];return console['error'](_0x2b0ac7(0x1f4)),console[_0x2b0ac7(0x1fb)](_0x2b0ac7(0x21e)+_0x8a6ca1[_0x2b0ac7(0x1c7)]),await handleSDKOutput([_0x8a6ca1],_0x4a5ff3),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x28e51a(0x21b)]='job:result';[a27_0x28e51a(0x1c9)]=a27_0x28e51a(0x1da);[a27_0x28e51a(0x20e)](_0x59972c){const _0x288804=a27_0x28e51a,_0x4e7c95=_0x59972c['args'][0x0];if(!_0x4e7c95)return _0x288804(0x20a);return undefined;}async['execute'](_0x55988f){const _0x3d6bf7=a27_0x28e51a,{options:_0x964d0b,args:_0x211995,tdx:_0x44ebf5}=_0x55988f,_0x44daee=_0x211995[0x0],_0x141c40=await withSpinner(_0x3d6bf7(0x1e5),()=>_0x44ebf5[_0x3d6bf7(0x1df)][_0x3d6bf7(0x209)](_0x44daee),{'verbose':_0x964d0b[_0x3d6bf7(0x1d9)]}),_0x33e4f6=_0x141c40[_0x3d6bf7(0x1d7)];return console[_0x3d6bf7(0x1fb)](_0x3d6bf7(0x1f7)+_0x33e4f6['length']+'\x20row'+(_0x33e4f6[_0x3d6bf7(0x20f)]!==0x1?'s':'')),await handleSDKOutput(_0x33e4f6,_0x964d0b),0x0;}}
|
|
1
|
+
const a27_0x2b2d97=a27_0x2ffc;(function(_0x4f6cd8,_0x2c6c5f){const _0x522247=a27_0x2ffc,_0x5e131b=_0x4f6cd8();while(!![]){try{const _0x4c220b=-parseInt(_0x522247(0x194))/0x1*(parseInt(_0x522247(0x19a))/0x2)+-parseInt(_0x522247(0x15e))/0x3+parseInt(_0x522247(0x1a3))/0x4+-parseInt(_0x522247(0x18a))/0x5+parseInt(_0x522247(0x1ae))/0x6*(-parseInt(_0x522247(0x16f))/0x7)+parseInt(_0x522247(0x171))/0x8*(parseInt(_0x522247(0x162))/0x9)+parseInt(_0x522247(0x1ad))/0xa;if(_0x4c220b===_0x2c6c5f)break;else _0x5e131b['push'](_0x5e131b['shift']());}catch(_0x16a200){_0x5e131b['push'](_0x5e131b['shift']());}}}(a27_0x415d,0xdef4a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a27_0x415d(){const _0x544e7a=['✔\x20Found\x20','red','kill','✔\x20Job\x20submitted','floor','submit','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','yes','map','file','status','priority','just\x20now','Limit:\x20','dim','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','job:result','debug','Status\x20filter:\x20','url','join','4478030bhtNoe','Getting\x20job\x20results...','job_id','args','database','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submit\x20a\x20job','start_at','Submitting\x20job...','1qcxfcP','\x20job','type','h\x20ago','No\x20SQL\x20statements\x20found\x20in\x20file','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','3070842QZqsqb','length','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','round','result','jobs','\x20\x20Job\x20ID:\x20','log','✔\x20Retrieved\x20','486928jMNwgl','abs','execute','site','m\x20ago','user_name','Cancelled','data','Query:\x20','now','45607920FjIkDM','6ZgQmGR','verbose','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','hive','Listing\x20jobs...','list','job:kill','Get\x20job\x20results','green','List\x20jobs','4193484XvZdXv','Job\x20type:\x20','presto','created_at','879354APipTX','job:submit','error','name','query','getTime','end_at','Show\x20job\x20details','success','push','trino','validate','description','1634927oPvgJN','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','24SJLMyf','INVALID_ARGUMENT','job:show'];a27_0x415d=function(){return _0x544e7a;};return a27_0x415d();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a27_0x2ffc(_0x52c070,_0x4a0d0d){_0x52c070=_0x52c070-0x157;const _0x415df4=a27_0x415d();let _0x2ffcac=_0x415df4[_0x52c070];return _0x2ffcac;}import{hyperlink}from'../sdk/util/formatters.js';import a27_0x2870ad from'chalk';function formatDuration(_0x4f6f17){const _0x393bcb=a27_0x2ffc;if(_0x4f6f17<0x3c)return _0x4f6f17+'s';if(_0x4f6f17<0xe10)return Math[_0x393bcb(0x178)](_0x4f6f17/0x3c)+'m\x20'+_0x4f6f17%0x3c+'s';const _0x1c143b=Math['floor'](_0x4f6f17/0xe10),_0x1ff579=Math[_0x393bcb(0x178)](_0x4f6f17%0xe10/0x3c);return _0x1ff579>0x0?_0x1c143b+'h\x20'+_0x1ff579+'m':_0x1c143b+'h';}function formatRelativeTime(_0x227254){const _0x3db378=a27_0x2ffc,_0x1cd64d=Date[_0x3db378(0x1ac)]()-_0x227254[_0x3db378(0x167)](),_0x2602d3=Math['floor'](Math[_0x3db378(0x1a4)](_0x1cd64d)/0x3e8);if(_0x2602d3<0x3c)return _0x3db378(0x180);const _0x5f4cf7=Math['floor'](_0x2602d3/0x3c);if(_0x5f4cf7<0x3c)return _0x5f4cf7+_0x3db378(0x1a7);const _0x353d87=Math[_0x3db378(0x178)](_0x5f4cf7/0x3c);if(_0x353d87<0x18)return _0x353d87+_0x3db378(0x197);const _0x15f5f5=Math[_0x3db378(0x178)](_0x353d87/0x18);if(_0x15f5f5<0x1e)return _0x15f5f5+'d\x20ago';return Math[_0x3db378(0x178)](_0x15f5f5/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x2b2d97(0x165)]='jobs';[a27_0x2b2d97(0x16e)]=a27_0x2b2d97(0x15d);async[a27_0x2b2d97(0x1a5)](_0x1110f4){const _0xdcfc4f=a27_0x2b2d97,{options:_0x299088,tdx:_0x47dd02}=_0x1110f4,_0x32656f=resolveLimit(_0x299088['limit'],DEFAULT_DISPLAY_LIMIT),_0x350775=_0x299088['status'];_0x299088[_0xdcfc4f(0x1af)]&&(console['error'](_0xdcfc4f(0x181)+_0x32656f+'\x20jobs'),_0x350775&&console['error'](_0xdcfc4f(0x187)+_0x350775));const _0xc1415d=await withSpinner(_0xdcfc4f(0x158),()=>_0x47dd02[_0xdcfc4f(0x19f)][_0xdcfc4f(0x159)]({'from':0x0,'to':_0x32656f-0x1,'status':_0x350775}),{'verbose':_0x299088[_0xdcfc4f(0x1af)]}),_0x3fb333=_0xc1415d[_0xdcfc4f(0x1aa)];console[_0xdcfc4f(0x164)](_0xdcfc4f(0x174)+_0x3fb333[_0xdcfc4f(0x19b)]+_0xdcfc4f(0x195)+(_0x3fb333['length']!==0x1?'s':''));const _0x4fc5c=_0x299088[_0xdcfc4f(0x1a6)];if(isStructuredFormat(_0x299088)){const _0x11823e=_0x3fb333[_0xdcfc4f(0x17c)](_0x2f1f56=>{const _0x1b4a8f=_0xdcfc4f;let _0x14af9c;if(_0x2f1f56[_0x1b4a8f(0x192)]&&_0x2f1f56[_0x1b4a8f(0x168)]){const _0x97257c=new Date(_0x2f1f56[_0x1b4a8f(0x192)])[_0x1b4a8f(0x167)](),_0x4f79f2=new Date(_0x2f1f56[_0x1b4a8f(0x168)])['getTime']();_0x14af9c=Math[_0x1b4a8f(0x19d)]((_0x4f79f2-_0x97257c)/0x3e8);}return{'job_id':_0x2f1f56[_0x1b4a8f(0x18c)],'type':_0x2f1f56[_0x1b4a8f(0x196)]===_0x1b4a8f(0x160)?'trino':_0x2f1f56['type'],'status':_0x2f1f56[_0x1b4a8f(0x17e)],'user_name':_0x2f1f56[_0x1b4a8f(0x1a8)],'duration_sec':_0x14af9c,'created_at':_0x2f1f56[_0x1b4a8f(0x161)],'started_at':_0x2f1f56[_0x1b4a8f(0x192)],'end_at':_0x2f1f56[_0x1b4a8f(0x168)]};});await handleSDKOutput(_0x11823e,_0x299088);}else for(const _0x1f853e of _0x3fb333){const _0x52c267=_0x1f853e[_0xdcfc4f(0x17e)]===_0xdcfc4f(0x16a)?a27_0x2870ad[_0xdcfc4f(0x15c)]:_0x1f853e[_0xdcfc4f(0x17e)]==='error'?a27_0x2870ad[_0xdcfc4f(0x175)]:a27_0x2870ad[_0xdcfc4f(0x182)],_0x3aea76=_0x52c267(_0x1f853e['status']),_0x49b7e2=getJobUrl(_0x4fc5c,_0x1f853e[_0xdcfc4f(0x18c)]),_0x4b7ce0=hyperlink(_0x1f853e[_0xdcfc4f(0x18c)],_0x49b7e2),_0x5e6b64=a27_0x2870ad[_0xdcfc4f(0x182)](_0x1f853e['type']===_0xdcfc4f(0x160)?_0xdcfc4f(0x16c):_0x1f853e[_0xdcfc4f(0x196)]),_0x537d20=[];if(_0x1f853e[_0xdcfc4f(0x192)]&&_0x1f853e[_0xdcfc4f(0x168)]){const _0x30f0a6=Math[_0xdcfc4f(0x19d)]((new Date(_0x1f853e[_0xdcfc4f(0x168)])[_0xdcfc4f(0x167)]()-new Date(_0x1f853e[_0xdcfc4f(0x192)])[_0xdcfc4f(0x167)]())/0x3e8);_0x537d20[_0xdcfc4f(0x16b)](formatDuration(_0x30f0a6));}if(_0x1f853e[_0xdcfc4f(0x168)])_0x537d20[_0xdcfc4f(0x16b)](formatRelativeTime(new Date(_0x1f853e['end_at'])));else _0x1f853e[_0xdcfc4f(0x192)]&&_0x537d20[_0xdcfc4f(0x16b)](formatRelativeTime(new Date(_0x1f853e[_0xdcfc4f(0x192)])));const _0x49846a=_0x537d20[_0xdcfc4f(0x19b)]>0x0?a27_0x2870ad[_0xdcfc4f(0x182)]('\x20'+_0x537d20[_0xdcfc4f(0x189)](',\x20')):'';console[_0xdcfc4f(0x1a1)]('⚡\x20'+_0x4b7ce0+'\x20'+_0x5e6b64+'\x20'+_0x3aea76+_0x49846a);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x2b2d97(0x165)]=a27_0x2b2d97(0x173);[a27_0x2b2d97(0x16e)]=a27_0x2b2d97(0x169);[a27_0x2b2d97(0x16d)](_0x147a70){const _0x32c4c4=a27_0x2b2d97,_0x2fb64e=_0x147a70[_0x32c4c4(0x18d)][0x0];if(!_0x2fb64e)return _0x32c4c4(0x184);return undefined;}async['execute'](_0x4e8b92){const _0x47c2d4=a27_0x2b2d97,{options:_0x301039,args:_0x52850c,tdx:_0x35a772}=_0x4e8b92,_0x1e15bc=_0x52850c[0x0],_0x2fd992=await withSpinner('Getting\x20job\x20details...',()=>_0x35a772[_0x47c2d4(0x19f)]['show'](_0x1e15bc),{'verbose':_0x301039[_0x47c2d4(0x1af)]}),_0x38e7a2=_0x2fd992[_0x47c2d4(0x1aa)];let _0x540e5f;if(_0x38e7a2[_0x47c2d4(0x192)]&&_0x38e7a2[_0x47c2d4(0x168)]){const _0x50884a=new Date(_0x38e7a2[_0x47c2d4(0x192)])[_0x47c2d4(0x167)](),_0x4cb888=new Date(_0x38e7a2['end_at'])[_0x47c2d4(0x167)]();_0x540e5f=Math[_0x47c2d4(0x19d)]((_0x4cb888-_0x50884a)/0x3e8);}const _0xd4bcaa={'job_id':_0x38e7a2[_0x47c2d4(0x18c)],'type':_0x38e7a2[_0x47c2d4(0x196)],'status':_0x38e7a2[_0x47c2d4(0x17e)],..._0x38e7a2[_0x47c2d4(0x1a8)]&&{'user_name':_0x38e7a2[_0x47c2d4(0x1a8)]},..._0x540e5f!==undefined&&{'duration_sec':_0x540e5f},..._0x38e7a2[_0x47c2d4(0x161)]&&{'created_at':_0x38e7a2[_0x47c2d4(0x161)]},..._0x38e7a2[_0x47c2d4(0x192)]&&{'started_at':_0x38e7a2[_0x47c2d4(0x192)]},..._0x38e7a2['end_at']&&{'end_at':_0x38e7a2['end_at']},..._0x38e7a2[_0x47c2d4(0x18e)]&&{'database':_0x38e7a2[_0x47c2d4(0x18e)]},..._0x38e7a2['priority']!==undefined&&{'priority':_0x38e7a2[_0x47c2d4(0x17f)]},..._0x38e7a2[_0x47c2d4(0x188)]&&{'url':_0x38e7a2[_0x47c2d4(0x188)]},..._0x38e7a2[_0x47c2d4(0x166)]&&{'query':_0x38e7a2[_0x47c2d4(0x166)]},..._0x38e7a2[_0x47c2d4(0x186)]&&{'debug':_0x38e7a2['debug']}};return await handleSingleObjectOutput(_0xd4bcaa,_0x301039),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a27_0x2b2d97(0x15a);[a27_0x2b2d97(0x16e)]='Kill\x20a\x20job';[a27_0x2b2d97(0x16d)](_0x557de7){const _0x170219=a27_0x2b2d97,_0x3eb009=_0x557de7[_0x170219(0x18d)][0x0];if(!_0x3eb009)return _0x170219(0x170);return undefined;}async[a27_0x2b2d97(0x1a5)](_0x4aa92c){const _0x4a4ba3=a27_0x2b2d97,{options:_0x4a6689,args:_0x39fd25,tdx:_0x2c7d90}=_0x4aa92c,_0x4c9cb7=_0x39fd25[0x0];if(!_0x4a6689[_0x4a4ba3(0x17b)]){const _0x4dcb23=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x4c9cb7+'?');if(!_0x4dcb23)return console[_0x4a4ba3(0x164)](_0x4a4ba3(0x1a9)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2c7d90[_0x4a4ba3(0x19f)][_0x4a4ba3(0x176)](_0x4c9cb7),{'verbose':_0x4a6689[_0x4a4ba3(0x1af)]}),console['error'](_0x4a4ba3(0x1b0)+_0x4c9cb7),console['error'](_0x4a4ba3(0x199)+_0x4c9cb7+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x2b2d97(0x165)]=a27_0x2b2d97(0x163);[a27_0x2b2d97(0x16e)]=a27_0x2b2d97(0x191);async[a27_0x2b2d97(0x1a5)](_0x1b3f49){const _0x2e478a=a27_0x2b2d97,{options:_0x9980a,args:_0x5281d0,tdx:_0x3bcf7f}=_0x1b3f49,_0x5e533c=_0x9980a['jobType']||_0x2e478a(0x16c),_0x3ea830=_0x9980a[_0x2e478a(0x17d)],_0x139e19=_0x9980a['database']||'information_schema',_0x4dace7=_0x9980a[_0x2e478a(0x19e)];if(_0x5e533c!==_0x2e478a(0x16c)&&_0x5e533c!==_0x2e478a(0x157))throw new SDKError(ErrorCode[_0x2e478a(0x172)],_0x2e478a(0x18f));let _0x2c2f6a;if(_0x3ea830){if(_0x5281d0[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2e478a(0x190));const _0x31c576=readSqlStatementsFromFile(_0x3ea830);if(_0x31c576[_0x2e478a(0x19b)]===0x0)throw new SDKError(ErrorCode[_0x2e478a(0x172)],_0x2e478a(0x198));if(_0x31c576['length']>0x1)throw new SDKError(ErrorCode[_0x2e478a(0x172)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x2c2f6a=_0x31c576[0x0];}else{if(!_0x5281d0[0x0])throw new SDKError(ErrorCode[_0x2e478a(0x172)],_0x2e478a(0x19c));_0x2c2f6a=_0x5281d0[0x0];}_0x9980a[_0x2e478a(0x1af)]&&(console[_0x2e478a(0x164)](_0x2e478a(0x15f)+_0x5e533c),console[_0x2e478a(0x164)](_0x2e478a(0x183)+_0x139e19),console[_0x2e478a(0x164)](_0x2e478a(0x1ab)+_0x2c2f6a['substring'](0x0,0x64)+(_0x2c2f6a['length']>0x64?'...':'')));const _0x314033=await withSpinner(_0x2e478a(0x193),()=>_0x3bcf7f[_0x2e478a(0x19f)][_0x2e478a(0x179)](_0x139e19,_0x2c2f6a,_0x5e533c,_0x4dace7),{'verbose':_0x9980a['verbose']}),_0x5a29ee=_0x314033['data'];return console[_0x2e478a(0x164)](_0x2e478a(0x177)),console[_0x2e478a(0x164)](_0x2e478a(0x1a0)+_0x5a29ee[_0x2e478a(0x18c)]),await handleSDKOutput([_0x5a29ee],_0x9980a),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x2b2d97(0x165)]=a27_0x2b2d97(0x185);[a27_0x2b2d97(0x16e)]=a27_0x2b2d97(0x15b);[a27_0x2b2d97(0x16d)](_0x7dbe7b){const _0x4233bc=a27_0x2b2d97,_0x3f44ff=_0x7dbe7b[_0x4233bc(0x18d)][0x0];if(!_0x3f44ff)return _0x4233bc(0x17a);return undefined;}async[a27_0x2b2d97(0x1a5)](_0x563416){const _0x5b9a2d=a27_0x2b2d97,{options:_0x718fdd,args:_0x52dad6,tdx:_0x26ffaf}=_0x563416,_0x5734a0=_0x52dad6[0x0],_0x89791f=await withSpinner(_0x5b9a2d(0x18b),()=>_0x26ffaf['jobs']['result'](_0x5734a0),{'verbose':_0x718fdd[_0x5b9a2d(0x1af)]}),_0x20db71=_0x89791f['data'];return console[_0x5b9a2d(0x164)](_0x5b9a2d(0x1a2)+_0x20db71[_0x5b9a2d(0x19b)]+'\x20row'+(_0x20db71['length']!==0x1?'s':'')),await handleSDKOutput(_0x20db71,_0x718fdd),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a28_0x5a5f(_0xa6a75,_0x3929bb){_0xa6a75=_0xa6a75-0x8a;const _0x497284=a28_0x4972();let _0x5a5f02=_0x497284[_0xa6a75];return _0x5a5f02;}const a28_0x13f224=a28_0x5a5f;(function(_0x370102,_0x2e0ac7){const _0x53755c=a28_0x5a5f,_0x392eae=_0x370102();while(!![]){try{const _0x236d38=parseInt(_0x53755c(0x15c))/0x1*(-parseInt(_0x53755c(0x17d))/0x2)+parseInt(_0x53755c(0x134))/0x3+-parseInt(_0x53755c(0x177))/0x4+-parseInt(_0x53755c(0x191))/0x5+-parseInt(_0x53755c(0x180))/0x6+-parseInt(_0x53755c(0xb6))/0x7+parseInt(_0x53755c(0x8d))/0x8;if(_0x236d38===_0x2e0ac7)break;else _0x392eae['push'](_0x392eae['shift']());}catch(_0x4c9d60){_0x392eae['push'](_0x392eae['shift']());}}}(a28_0x4972,0xb72ac));import a28_0x428bd7 from'chalk';import a28_0x28a74c from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a28_0x4972(){const _0x5e0126=['/app/ps/','connection','buildIdToNameMap','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','1053747CBQqAI','segmentPushCommand','stages','parentSegment','getSegment','resolveJourneyId','getTrafficData','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Parent\x20segment:\x20','Options:','Error:\x20','toLowerCase','log','✔\x20Journey\x20\x22','📁\x20','\x20=\x20','Cancelled','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','journey:push','journey:view','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20\x20Statistics\x20not\x20available','\x20details...','listJourneysFromParentSegment','(running)','journey:pause','diff','format','journey','\x20unchanged\x20files','\x22\x20resumed','archived','hasChanges','Available\x20stages:\x20','error','journey:resume','(paused)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','listActivationsFlat','2jljOBk','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','attributes','createdAt','table','errorCode','\x20journey\x20files\x20to\x20','size','\x20new\x20files','completionRate','add','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','\x5c$&','listJourneysWithFolders','launched','from','folderPath','(draft)','journey:pull','\x20version','\x20\x20Journey\x20ID:\x20','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','exitOrJumpRate','\x20changed\x20files','sort','green','382696wlKllS','\x20journeys','join','\x20versions)','Resolving\x20journey...','Table:\x20','505094tEjuSw','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journey:stats','3888864VgWXNO','push','versionNumber','Found\x20','localeCompare','segments','INVALID_ARGUMENT','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)','test','Error:\x20Invalid\x20--type\x20\x22','Resolved\x20YAML\x20file:\x20','split','List\x20journeys\x20in\x20current\x20context','Resume\x20a\x20paused\x20journey','includeHistory','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','options','7382390KgLXpi','\x20->\x20','journey:versions','journey:version:view','dryRun','Error:\x20Journey\x20\x27','\x20(rule\x20match)','\x0aChanges\x20to\x20\x27','paused','goalSize','27435352ifnyoO','Write\x20','targetDir','isNew','yellow','version','Target\x20file:\x20','segmentName','\x27\x20not\x20found\x20in\x20','No\x20journeys\x20found','Fetching\x20users\x20and\x20connections...','journeys','Error:\x20Parent\x20segment\x20context\x20required','updatedAt','data','cwd','activation','\x20\x20Name:\x20','json','journey:list','relativePath','yes','cyan','args','stageNameMap','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','List\x20activations\x20for\x20a\x20journey','Fetching\x20journeys\x20and\x20folders...','buildIdToEmailMap','site','exitOrJumpSize','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','columns','message','stringify','\x20activation','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','type','listFolders','journeyName','2135182NOeLUP','journeyStages','\x0aError:','completeMilestoneRate','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','journeyBundleId','folderId','set','Getting\x20journey\x20details...','find','\x20Created\x20v','history','journeyId','Getting\x20column\x20mapping...','segment','pause','enteredSize','completed','\x20\x20-\x20','getColumnMapping','(completed)','utf-8','user','jsonl','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Journey\x20not\x20found:\x20','\x20not\x20found.\x20Available:\x20','.yml','Aborted.','listVersions','folders','activation_','-\x20no\x20files\x20written','file','filter','\x20\x20Target:\x20','Pause\x20a\x20running\x20journey','parent_segment','values','/e/','Pausing\x20journey...','\x20(ID:\x20','resolveSegment','audienceId','(root)','includeStats','goal','resolveParentId','\x20\x20Folder\x20path:\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','web','base','get','journey:activations','bold','description','has','🗺️\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','map','rule','Input:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','Pattern:\x20','stage','replace','state','\x22\x20paused','all','Listing\x20journeys...','/j/da/je','reentryMode','Fetching\x20','length','execute','Getting\x20journey\x20statistics...','✔\x20Context\x20set:\x20','tsv','session','renderStats','entries','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','conversion','getActivation','parentName','Getting\x20version\x20','dim','...','Resolving\x20version...','Folder\x20path:\x20','getJourney','draft','helpText','getStatistics','verbose','name','journeyBundleName','absolutePath','Error:\x20Stage\x20\x22','tdx.json','blue','connector_config','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Fetching\x20parent\x20segment...','Resolving\x20parent\x20segment...','milestoneSize','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey:traffic','nodes','rootFolderId','✔\x20Found\x20','\x20Opening\x20','limit','resourceName','kind','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','filePath','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Listing\x20journey\x20versions...','createVersion'];a28_0x4972=function(){return _0x5e0126;};return a28_0x4972();}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(_0x2177b3){const _0x260fd6=a28_0x5a5f;return!_0x2177b3&&(console['error'](_0x260fd6(0xa6)),console[_0x260fd6(0x156)](_0x260fd6(0x18f))),!!_0x2177b3;}function withJsonFormat(_0x4542a5){const _0x40477f=a28_0x5a5f;if(!_0x4542a5[_0x40477f(0x14f)]&&!_0x4542a5[_0x40477f(0x9f)]&&!_0x4542a5[_0x40477f(0xcd)]&&!_0x4542a5[_0x40477f(0x103)])return{..._0x4542a5,'format':'json','json':!![]};return _0x4542a5;}function formatJourneyState(_0x1a4ff6){const _0x3b0ef8=a28_0x5a5f;switch(_0x1a4ff6){case _0x3b0ef8(0x16a):return a28_0x428bd7['green'](_0x3b0ef8(0x14c));case _0x3b0ef8(0x111):return a28_0x428bd7[_0x3b0ef8(0x10c)](_0x3b0ef8(0x16d));case _0x3b0ef8(0x8b):return a28_0x428bd7[_0x3b0ef8(0x91)](_0x3b0ef8(0x158));case _0x3b0ef8(0xc7):return a28_0x428bd7[_0x3b0ef8(0x11a)](_0x3b0ef8(0xca));case _0x3b0ef8(0x153):return a28_0x428bd7[_0x3b0ef8(0x10c)]('(archived)');default:return'('+_0x1a4ff6+')';}}function formatJourneyItem(_0x38e719,_0x2ab88c='',_0x5a3219){const _0x417a83=a28_0x5a5f,_0x88c76e=formatJourneyState(_0x38e719[_0x417a83(0xf8)]),_0x26e013=_0x5a3219?hyperlink(_0x38e719['journeyBundleName'],_0x5a3219):_0x38e719[_0x417a83(0x116)];return _0x2ab88c+_0x417a83(0xef)+_0x26e013+'\x20'+_0x88c76e;}function escapeRegex(_0x5c388a){const _0x1d676d=a28_0x5a5f;return _0x5c388a[_0x1d676d(0xf7)](/[.*+?^${}()|[\]\\]/g,_0x1d676d(0x168));}function globToRegex(_0x13d694){const _0x391c80=a28_0x5a5f,_0x46a3ae=_0x13d694[_0x391c80(0x18b)]('*')[_0x391c80(0xf1)](escapeRegex);return new RegExp(_0x46a3ae[_0x391c80(0x179)]('.*'),'i');}function buildRuleToNameMapping(_0x5ce9a2){const _0x324387=a28_0x5a5f,_0x2dde7c=new Map();if(_0x5ce9a2[_0x324387(0x185)])for(const [_0x3bfb73,_0x48d690]of Object['entries'](_0x5ce9a2[_0x324387(0x185)])){if(_0x48d690[_0x324387(0xf2)]){const _0x3995bb=serializeRule(_0x48d690[_0x324387(0xf2)]),_0x36c869=_0x2dde7c[_0x324387(0xea)](_0x3995bb);_0x36c869?_0x36c869[_0x324387(0x181)](_0x3bfb73):_0x2dde7c[_0x324387(0xbd)](_0x3995bb,[_0x3bfb73]);}}return _0x2dde7c;}async function resolveJourneyIdFromInput(_0x29c8f2,_0x280069,_0x49c686){const _0x1800ba=a28_0x5a5f,_0x3eb712=await resolveJourneyTarget(_0x29c8f2,_0x280069['parentSegment'],_0x280069['verbose']),_0x4a63a4=_0x3eb712['parentSegment'];if(!_0x4a63a4)throw new SDKError(ErrorCode[_0x1800ba(0x186)],_0x1800ba(0x172));const _0x5a0a48=await withSpinner(_0x1800ba(0x11f),()=>_0x49c686[_0x1800ba(0xc4)][_0x1800ba(0xe5)](_0x4a63a4),{'verbose':_0x280069[_0x1800ba(0x114)]}),_0x3e5467=_0x5a0a48['data'],_0x41d82b=await withSpinner(_0x1800ba(0x17b),()=>_0x49c686[_0x1800ba(0x150)][_0x1800ba(0x139)](_0x3e5467,_0x3eb712[_0x1800ba(0xb5)]),{'verbose':_0x280069[_0x1800ba(0x114)]});return{'journeyId':_0x41d82b[_0x1800ba(0x9b)],'journeyName':_0x3eb712[_0x1800ba(0xb5)],'parentSegmentId':_0x3e5467};}async function resolveJourneyTarget(_0x5baf80,_0x2d84d1,_0x4d6803){const _0x2ca28a=a28_0x5a5f;if(isYamlFilePath(_0x5baf80))try{const _0x28850c=await resolveYamlFilePath(_0x5baf80);return _0x4d6803&&(console['error'](_0x2ca28a(0x18a)+_0x5baf80),console[_0x2ca28a(0x156)]('\x20\x20Parent\x20segment:\x20'+_0x28850c['parentSegment']),console[_0x2ca28a(0x156)](_0x2ca28a(0x9e)+_0x28850c[_0x2ca28a(0x94)]),console[_0x2ca28a(0x156)](_0x2ca28a(0xe6)+(_0x28850c[_0x2ca28a(0x16c)]||_0x2ca28a(0xe2)))),{'journeyName':_0x28850c[_0x2ca28a(0x94)],'parentSegment':_0x28850c[_0x2ca28a(0x137)],'resolved':_0x28850c};}catch(_0x4d7e99){throw new SDKError(ErrorCode[_0x2ca28a(0x186)],_0x2ca28a(0x12c)+_0x4d7e99[_0x2ca28a(0xae)]);}if(!_0x2d84d1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x5baf80,'parentSegment':_0x2d84d1};}export class JourneyListCommand extends BaseCommand{[a28_0x13f224(0x115)]=a28_0x13f224(0xa0);[a28_0x13f224(0xed)]=a28_0x13f224(0x18c);async['execute'](_0x18d4a1){const _0x2e519e=a28_0x13f224,{options:_0x321672,args:_0x88f137,tdx:_0x670b98}=_0x18d4a1,_0x3a9bb6=_0x88f137[0x0],_0x680b0d=_0x321672[_0x2e519e(0x137)];if(!_0x680b0d)return console[_0x2e519e(0x156)](_0x2e519e(0x99)),console['error']('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x33fa99=await withSpinner(_0x2e519e(0x11f),()=>_0x670b98[_0x2e519e(0xc4)]['resolveParentId'](_0x680b0d),{'verbose':_0x321672[_0x2e519e(0x114)]}),_0x31545f=_0x33fa99['data'];_0x321672[_0x2e519e(0x114)]&&(console['error'](_0x2e519e(0x13c)+_0x680b0d+_0x2e519e(0xdf)+_0x31545f+')'),_0x3a9bb6&&console[_0x2e519e(0x156)](_0x2e519e(0xf5)+_0x3a9bb6));const _0x10fc20=await withSpinner(_0x2e519e(0x11e),()=>_0x670b98[_0x2e519e(0xc4)]['getParentFull'](_0x31545f),{'verbose':_0x321672[_0x2e519e(0x114)]}),_0x227141=_0x10fc20['data'],_0x41955f=_0x227141[_0x2e519e(0x124)],_0x1f357e=await withSpinner(_0x2e519e(0xfb),()=>_0x670b98[_0x2e519e(0x150)][_0x2e519e(0x169)](_0x31545f,_0x41955f),{'verbose':_0x321672[_0x2e519e(0x114)]});let _0x5e9d3d=_0x1f357e[_0x2e519e(0x9b)][_0x2e519e(0x98)];const _0xa734c9=_0x1f357e[_0x2e519e(0x9b)][_0x2e519e(0xd4)],_0x42a781=new Map();for(const _0xbbde6f of _0xa734c9){_0x42a781[_0x2e519e(0xbd)](_0xbbde6f['id'],_0xbbde6f[_0x2e519e(0x115)]);}if(_0x3a9bb6){const _0xa30349=globToRegex(_0x3a9bb6);_0x5e9d3d=_0x5e9d3d['filter'](_0xcc21db=>_0xa30349[_0x2e519e(0x188)](_0xcc21db[_0x2e519e(0x116)]));}console[_0x2e519e(0x156)](_0x2e519e(0x125)+_0x5e9d3d[_0x2e519e(0xff)]+'\x20journey'+(_0x5e9d3d[_0x2e519e(0xff)]!==0x1?'s':''));const _0x1e8b9d=_0x5275da=>{const _0x4b9587=_0x2e519e;return getConsoleNextUrl(_0x321672[_0x4b9587(0xaa)],_0x4b9587(0x12f)+_0x31545f+'/e/'+_0x5275da+'/j/da');};if(_0x321672[_0x2e519e(0x14f)]===_0x2e519e(0x160))await handleSDKOutput(_0x5e9d3d,_0x321672);else{if(_0x321672[_0x2e519e(0x14f)]===_0x2e519e(0x9f)){const _0x3edb63=_0x5e9d3d[_0x2e519e(0xf1)](_0x301342=>({..._0x301342,'url':_0x1e8b9d(_0x301342['id'])}));await handleSDKOutput(_0x3edb63,_0x321672);}else{console['log']('['+_0x680b0d+']');const _0x2c8d9a=new Map(),_0x97705a=[];for(const _0x191093 of _0x5e9d3d){if(!_0x191093['folderId']||_0x191093[_0x2e519e(0xbc)]===_0x41955f)_0x97705a[_0x2e519e(0x181)](_0x191093);else{const _0xf97356=_0x2c8d9a[_0x2e519e(0xea)](_0x191093['folderId'])||[];_0xf97356[_0x2e519e(0x181)](_0x191093),_0x2c8d9a[_0x2e519e(0xbd)](_0x191093[_0x2e519e(0xbc)],_0xf97356);}}const _0x14595d=(_0x1b6b9c,_0x2b2414)=>_0x1b6b9c[_0x2e519e(0x116)]['localeCompare'](_0x2b2414[_0x2e519e(0x116)],undefined,{'sensitivity':_0x2e519e(0xe9)});_0x97705a[_0x2e519e(0x175)](_0x14595d);for(const _0x2058b4 of _0x97705a){console[_0x2e519e(0x140)](formatJourneyItem(_0x2058b4,'',_0x1e8b9d(_0x2058b4['id'])));}const _0x151b89=[..._0x2c8d9a[_0x2e519e(0x106)]()][_0x2e519e(0x175)]((_0x47075c,_0x38df0b)=>{const _0x4f4d1f=_0x2e519e,_0x1e859=_0x42a781[_0x4f4d1f(0xea)](_0x47075c[0x0])||_0x47075c[0x0],_0x49d8a4=_0x42a781[_0x4f4d1f(0xea)](_0x38df0b[0x0])||_0x38df0b[0x0];return _0x1e859[_0x4f4d1f(0x184)](_0x49d8a4,undefined,{'sensitivity':_0x4f4d1f(0xe9)});});for(const [_0x2c593e,_0x1b1940]of _0x151b89){const _0x561364=_0x42a781['get'](_0x2c593e)||_0x2c593e;console['log'](_0x2e519e(0x142)+_0x561364),_0x1b1940[_0x2e519e(0x175)](_0x14595d);for(const _0x19caea of _0x1b1940){console[_0x2e519e(0x140)](formatJourneyItem(_0x19caea,'\x20\x20',_0x1e8b9d(_0x19caea['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a28_0x13f224(0x147);[a28_0x13f224(0xed)]='Show\x20journey\x20details';async[a28_0x13f224(0x100)](_0x491db9){const _0x395c4c=a28_0x13f224,{options:_0x24fe92,args:_0x26da5d,tdx:_0x29329a}=_0x491db9,_0x3d3a23=_0x26da5d[0x0];if(!_0x3d3a23)return console[_0x395c4c(0x156)](_0x395c4c(0xa6)),console[_0x395c4c(0x156)](_0x395c4c(0xe7)),console[_0x395c4c(0x156)](_0x395c4c(0x13d)),console[_0x395c4c(0x156)](_0x395c4c(0x148)),0x1;_0x24fe92[_0x395c4c(0x114)]&&console[_0x395c4c(0x156)](_0x395c4c(0xf3)+_0x3d3a23);const {journeyId:_0x1d4651,parentSegmentId:_0x341d2e}=await resolveJourneyIdFromInput(_0x3d3a23,_0x24fe92,_0x29329a);if(_0x24fe92[_0x395c4c(0xe8)]){const _0x2fb1a7=getConsoleNextUrl(_0x24fe92[_0x395c4c(0xaa)],_0x395c4c(0x12f)+_0x341d2e+_0x395c4c(0xdd)+_0x1d4651+_0x395c4c(0xfc));return console[_0x395c4c(0x156)](a28_0x428bd7['green']('✔')+_0x395c4c(0x126)+a28_0x428bd7['cyan'](_0x2fb1a7)),openBrowser(_0x2fb1a7),0x0;}const _0x4d19f9=await withSpinner(_0x395c4c(0xbe),()=>_0x29329a[_0x395c4c(0x150)]['getJourney'](_0x1d4651),{'verbose':_0x24fe92[_0x395c4c(0x114)]}),_0x2e1d8f=_0x4d19f9[_0x395c4c(0x9b)],_0x566046=_0x24fe92[_0x395c4c(0xe3)];let _0x495342;if(_0x566046)try{const _0x308fc8=await withSpinner(_0x395c4c(0x101),()=>_0x29329a[_0x395c4c(0x150)][_0x395c4c(0x113)](_0x1d4651),{'verbose':_0x24fe92[_0x395c4c(0x114)]});_0x495342=_0x308fc8[_0x395c4c(0x9b)];}catch{_0x24fe92[_0x395c4c(0x114)]&&console[_0x395c4c(0x156)](_0x395c4c(0x149));}const _0x543778=getConsoleNextUrl(_0x24fe92[_0x395c4c(0xaa)],_0x395c4c(0x12f)+_0x341d2e+'/e/'+_0x1d4651+_0x395c4c(0xfc)),_0x4f8396={'id':_0x2e1d8f['id'],'name':_0x2e1d8f[_0x395c4c(0x15e)][_0x395c4c(0x115)],'description':_0x2e1d8f[_0x395c4c(0x15e)][_0x395c4c(0xed)],'state':_0x2e1d8f[_0x395c4c(0x15e)][_0x395c4c(0xf8)],'paused':_0x2e1d8f['attributes']['paused'],'reentry_mode':_0x2e1d8f[_0x395c4c(0x15e)][_0x395c4c(0xfd)],'stages':_0x2e1d8f[_0x395c4c(0x15e)][_0x395c4c(0xb7)]?.[_0x395c4c(0xff)]||0x0,..._0x2e1d8f[_0x395c4c(0x15e)][_0x395c4c(0xe4)]&&{'goal':_0x2e1d8f[_0x395c4c(0x15e)][_0x395c4c(0xe4)][_0x395c4c(0x115)]},..._0x495342&&{'statistics':{'size':_0x495342[_0x395c4c(0x163)],'entered':_0x495342[_0x395c4c(0xc6)],'goal_achieved':_0x495342[_0x395c4c(0x8c)],'completion_rate':_0x495342[_0x395c4c(0x165)],'exit_or_jump':_0x495342[_0x395c4c(0xab)],'exit_or_jump_rate':_0x495342['exitOrJumpRate'],'stages':_0x495342['stages']}},'url':_0x543778};return await handleSingleObjectOutput(_0x4f8396,_0x24fe92),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a28_0x13f224(0x17f);[a28_0x13f224(0xed)]='Show\x20journey\x20statistics';async[a28_0x13f224(0x100)](_0x131355){const _0x48362c=a28_0x13f224,{options:_0x337ad5,args:_0x33e562,tdx:_0x400233}=_0x131355,_0x20916c=_0x33e562[0x0];if(!requireNameOrPath(_0x20916c))return 0x1;_0x337ad5[_0x48362c(0x114)]&&console[_0x48362c(0x156)](_0x48362c(0xf3)+_0x20916c);const _0xcd662e=_0x337ad5,_0x47eefb=_0xcd662e[_0x48362c(0x16b)],_0x1e719f=_0xcd662e['to'],_0x2cec4a=_0xcd662e[_0x48362c(0x18e)],_0x1f3571=_0xcd662e[_0x48362c(0xf6)];_0x2cec4a&&!_0x47eefb&&!_0x1e719f&&console[_0x48362c(0x156)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x4f143d=_0x2cec4a?withJsonFormat(_0x337ad5):_0x337ad5,{journeyId:_0x1fbe72,journeyName:_0x7517a3}=await resolveJourneyIdFromInput(_0x20916c,_0x4f143d,_0x400233),_0x1a4b3d=_0x47eefb||_0x1e719f?{'from':_0x47eefb,'to':_0x1e719f}:undefined,_0x5d6f9b=await withSpinner(_0x48362c(0x101),()=>Promise[_0x48362c(0xfa)]([_0x400233['journey'][_0x48362c(0x110)](_0x1fbe72),_0x400233[_0x48362c(0x150)][_0x48362c(0x113)](_0x1fbe72,_0x1a4b3d)]),{'verbose':_0x4f143d[_0x48362c(0x114)]}),[_0x3d8459,_0x55bece]=_0x5d6f9b['data'];if(!_0x55bece||_0x55bece[_0x48362c(0xc2)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x7517a3),console[_0x48362c(0x156)](_0x48362c(0x17e)),0x0;const _0xaf7b9c=buildStageNameMap(_0x3d8459),_0x19eaac=!!(_0x1a4b3d&&_0x55bece[_0x48362c(0xc1)]?.[_0x48362c(0xff)]),_0x5c964f={'stageNameMap':_0xaf7b9c,'hasPeriod':_0x19eaac,'includeHistory':!!_0x2cec4a};if(_0x1f3571&&_0x55bece['stages']){const _0x1889c6=_0x55bece['stages']['find'](_0x47c3ca=>{const _0xb0abde=_0x48362c,_0x189cec=_0xaf7b9c[_0xb0abde(0xea)](_0x47c3ca['id'])??'';return _0x189cec[_0xb0abde(0x13f)]()===_0x1f3571['toLowerCase']();});if(_0x1889c6)return await handleSingleObjectOutput(formatStageStats(_0x1889c6,_0x5c964f),_0x4f143d),0x0;const _0x33cf69=_0x55bece[_0x48362c(0x136)][_0x48362c(0xf1)](_0x4e169b=>_0xaf7b9c[_0x48362c(0xea)](_0x4e169b['id'])??_0x4e169b['id']);return console[_0x48362c(0x156)](_0x48362c(0x118)+_0x1f3571+'\x22\x20not\x20found'),console[_0x48362c(0x156)](_0x48362c(0x155)+_0x33cf69['join'](',\x20')),0x1;}const _0x2a1d22=_0x55bece['stages']?.[_0x48362c(0xf1)](_0x4a035e=>formatStageStats(_0x4a035e,_0x5c964f)),_0x5d6590=assembleJourneyStats(_0x55bece,{'from':_0x47eefb,'to':_0x1e719f,'includeHistory':_0x2cec4a});return await this[_0x48362c(0x105)](_0x5d6590,_0x2a1d22??[],_0x4f143d),0x0;}async[a28_0x13f224(0x105)](_0x3ef4d3,_0x32f15b,_0xcd2613){const _0x2bb132=a28_0x13f224,_0xa6dd01=_0xcd2613[_0x2bb132(0x14f)]===_0x2bb132(0x9f)||_0xcd2613['format']===_0x2bb132(0xcd)||_0xcd2613[_0x2bb132(0x9f)]||_0xcd2613['jsonl'];if(_0xa6dd01){_0x3ef4d3[_0x2bb132(0x136)]=_0x32f15b,await handleSingleObjectOutput(_0x3ef4d3,_0xcd2613);return;}await handleSingleObjectOutput(_0x3ef4d3,_0xcd2613);for(const _0x368d58 of _0x32f15b){console['log'](''),console[_0x2bb132(0x140)](String(a28_0x428bd7[_0x2bb132(0xa3)][_0x2bb132(0xec)]('['+_0x368d58['name']+']'))+a28_0x428bd7[_0x2bb132(0x10c)]('\x20'+_0x368d58['id']));const {id:_0x165a00,name:_0x45e47c,..._0x57e81f}=_0x368d58;await handleSingleObjectOutput(_0x57e81f,_0xcd2613);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x13f224(0x115)]=a28_0x13f224(0x122);[a28_0x13f224(0xed)]=a28_0x13f224(0xac);async[a28_0x13f224(0x100)](_0x154ad0){const _0x4ffddd=a28_0x13f224,{options:_0x597eec,args:_0x3e5cb7,tdx:_0x1eb46c}=_0x154ad0,_0x49ab87=_0x3e5cb7[0x0];if(!requireNameOrPath(_0x49ab87))return 0x1;_0x597eec[_0x4ffddd(0x114)]&&console['error'](_0x4ffddd(0xf3)+_0x49ab87);const _0x3a827c=_0x597eec,_0x5a3aef=_0x3a827c[_0x4ffddd(0xb3)],_0x251063=_0x3a827c[_0x4ffddd(0x16b)],_0x2d57d2=_0x3a827c['to'],_0xfecde2=_0x3a827c[_0x4ffddd(0x127)];if(_0x5a3aef&&_0x5a3aef!==_0x4ffddd(0x108)&&_0x5a3aef!==_0x4ffddd(0x9d))return console[_0x4ffddd(0x156)](_0x4ffddd(0x189)+_0x5a3aef+_0x4ffddd(0x133)),0x1;const _0x43ee35=withJsonFormat(_0x597eec),{journeyId:_0x49de94,journeyName:_0x3a8a12}=await resolveJourneyIdFromInput(_0x49ab87,_0x43ee35,_0x1eb46c),_0x124715={'type':_0x5a3aef,'from':_0x251063,'to':_0x2d57d2,'limit':_0xfecde2},_0x4e55e1=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x1eb46c['journey'][_0x4ffddd(0x13a)](_0x49de94,_0x124715),{'verbose':_0x43ee35[_0x4ffddd(0x114)]}),_0x458f73=_0x4e55e1[_0x4ffddd(0x9b)],_0x47b84d=_0x458f73['conversion']&&(_0x458f73[_0x4ffddd(0x108)][_0x4ffddd(0x123)][_0x4ffddd(0xff)]>0x0||_0x458f73[_0x4ffddd(0x108)]['links'][_0x4ffddd(0xff)]>0x0),_0x3f1c32=_0x458f73[_0x4ffddd(0x9d)]&&_0x458f73[_0x4ffddd(0x9d)][_0x4ffddd(0xff)]>0x0;if(!_0x47b84d&&!_0x3f1c32)return console[_0x4ffddd(0x156)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x3a8a12),console[_0x4ffddd(0x156)](_0x4ffddd(0x107)),_0x251063&&_0x2d57d2&&console[_0x4ffddd(0x156)](_0x4ffddd(0x13b)),0x0;return await handleSingleObjectOutput(_0x458f73,_0x43ee35),0x0;}}function formatStageStats(_0x4719d4,_0x2cd13e){const _0x3b0f2c=a28_0x13f224,_0xb37b85=_0x2cd13e['hasPeriod']&&_0x4719d4[_0x3b0f2c(0xc1)]?.['length']?aggregateStageHistory(_0x4719d4['history']):{'size':_0x4719d4[_0x3b0f2c(0x163)],'entered':_0x4719d4[_0x3b0f2c(0xc6)],'milestone':_0x4719d4[_0x3b0f2c(0x120)],'milestone_rate':_0x4719d4[_0x3b0f2c(0xb9)],'exit_or_jump':_0x4719d4[_0x3b0f2c(0xab)],'exit_or_jump_rate':_0x4719d4[_0x3b0f2c(0x173)]},_0x2357e4={'id':_0x4719d4['id'],'name':_0x2cd13e[_0x3b0f2c(0xa5)][_0x3b0f2c(0xea)](_0x4719d4['id'])??_0x4719d4['id'],..._0xb37b85};return _0x2cd13e['hasPeriod']&&_0x2cd13e[_0x3b0f2c(0x18e)]&&_0x4719d4[_0x3b0f2c(0xc1)]&&(_0x2357e4[_0x3b0f2c(0xc1)]=_0x4719d4[_0x3b0f2c(0xc1)]),_0x2357e4;}export class JourneyPauseCommand extends BaseCommand{['name']=a28_0x13f224(0x14d);['description']=a28_0x13f224(0xda);async[a28_0x13f224(0x100)](_0x5dc61b){const _0x4f7126=a28_0x13f224,{options:_0x1b3b53,args:_0x3902a3,tdx:_0x4b69ab}=_0x5dc61b,_0x1715fa=_0x3902a3[0x0];if(!requireNameOrPath(_0x1715fa))return 0x1;_0x1b3b53[_0x4f7126(0x114)]&&console[_0x4f7126(0x156)](_0x4f7126(0xf3)+_0x1715fa);const {journeyId:_0x4d732c,journeyName:_0x31bd02}=await resolveJourneyIdFromInput(_0x1715fa,_0x1b3b53,_0x4b69ab);if(!_0x1b3b53[_0x4f7126(0xa2)]){const _0x2b32ad=await confirm(_0x4f7126(0xb2)+_0x31bd02+'\x22?');if(!_0x2b32ad)return console[_0x4f7126(0x156)](_0x4f7126(0x144)),0x0;}const _0x3c4297=await withSpinner(_0x4f7126(0xde),()=>_0x4b69ab['journey'][_0x4f7126(0xc5)](_0x4d732c),{'verbose':_0x1b3b53[_0x4f7126(0x114)]}),_0x362c01=_0x3c4297[_0x4f7126(0x9b)];return console[_0x4f7126(0x156)]('✔\x20Journey\x20\x22'+_0x362c01[_0x4f7126(0x15e)]['name']+_0x4f7126(0xf9)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x13f224(0x115)]=a28_0x13f224(0x157);[a28_0x13f224(0xed)]=a28_0x13f224(0x18d);async[a28_0x13f224(0x100)](_0x898cb6){const _0x37e143=a28_0x13f224,{options:_0x5653e7,args:_0x560c21,tdx:_0x1c0eb8}=_0x898cb6,_0x1d70f7=_0x560c21[0x0];if(!requireNameOrPath(_0x1d70f7))return 0x1;_0x5653e7[_0x37e143(0x114)]&&console[_0x37e143(0x156)](_0x37e143(0xf3)+_0x1d70f7);const {journeyId:_0x318055,journeyName:_0x188db5}=await resolveJourneyIdFromInput(_0x1d70f7,_0x5653e7,_0x1c0eb8);if(!_0x5653e7[_0x37e143(0xa2)]){const _0x34cac2=await confirm(_0x37e143(0x12a)+_0x188db5+'\x22?');if(!_0x34cac2)return console[_0x37e143(0x156)](_0x37e143(0x144)),0x0;}const _0x17bf26=await withSpinner('Resuming\x20journey...',()=>_0x1c0eb8[_0x37e143(0x150)]['resume'](_0x318055),{'verbose':_0x5653e7['verbose']}),_0x334e0a=_0x17bf26[_0x37e143(0x9b)];return console[_0x37e143(0x156)](_0x37e143(0x141)+_0x334e0a[_0x37e143(0x15e)][_0x37e143(0x115)]+_0x37e143(0x152)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x13f224(0x115)]=a28_0x13f224(0x16e);[a28_0x13f224(0xed)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a28_0x13f224(0x100)](_0xbd2de8){const _0xe050af=a28_0x13f224,{options:_0x562992,args:_0x1f3d49,tdx:_0x50a3d9}=_0xbd2de8,_0x299450=_0x562992,_0x5ec26f=_0x1f3d49[0x0],_0x21212d=_0x5ec26f&&isYamlFilePath(_0x5ec26f),_0x48c6f8=await resolveTarget({'arg':_0x21212d?_0x5ec26f:undefined,'contextParent':_0x562992[_0xe050af(0x137)],'cwd':process[_0xe050af(0x9c)]()});if(!isSuccessfulResolution(_0x48c6f8))return _0x48c6f8[_0xe050af(0x161)]==='no_parent'?(console['error'](a28_0x428bd7[_0xe050af(0x91)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0xe050af(0x156)](_0xe050af(0x187)),console[_0xe050af(0x156)](_0xe050af(0x15d)),console[_0xe050af(0x156)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0xe050af(0x156)](_0xe050af(0x159))):(console['error'](a28_0x428bd7['red'](_0xe050af(0x13e)+_0x48c6f8[_0xe050af(0xae)]+'\x0a')),_0x48c6f8[_0xe050af(0x112)]&&console[_0xe050af(0x156)](a28_0x428bd7[_0xe050af(0xa3)](_0x48c6f8[_0xe050af(0x112)]))),0x1;let _0x201ef5=_0x21212d?undefined:_0x5ec26f,_0x3605a2,_0x539dc6;_0x48c6f8['type']===_0xe050af(0xd7)&&(_0x201ef5=_0x48c6f8[_0xe050af(0x128)],_0x3605a2=_0x48c6f8[_0xe050af(0x12b)],_0x539dc6=_0x48c6f8[_0xe050af(0x16c)]);const _0x18a721=_0x48c6f8[_0xe050af(0x10a)],_0x2d5aa9=_0x48c6f8[_0xe050af(0x8f)];_0x299450[_0xe050af(0x114)]&&(console[_0xe050af(0x156)](_0xe050af(0x13c)+_0x18a721),console[_0xe050af(0x156)]('Target\x20directory:\x20'+_0x2d5aa9),_0x201ef5&&console['error']('Journey\x20name:\x20'+_0x201ef5),_0x3605a2&&console[_0xe050af(0x156)](_0xe050af(0x93)+_0x3605a2),_0x539dc6&&console[_0xe050af(0x156)](_0xe050af(0x10f)+_0x539dc6));const _0x2893cd=await withSpinner(_0xe050af(0x11f),()=>_0x50a3d9[_0xe050af(0xc4)]['resolveParentId'](_0x18a721),{'verbose':_0x562992['verbose']}),_0x36dc47=_0x2893cd[_0xe050af(0x9b)],{journeys:_0x3a1dc0,folders:_0x5cf0c7}=await withSpinner(_0xe050af(0xa8),async()=>{const _0x2996d3=_0xe050af,[_0x2c83df,_0x2fe4fa]=await Promise[_0x2996d3(0xfa)]([_0x50a3d9[_0x2996d3(0x150)][_0x2996d3(0x14b)](_0x36dc47,undefined,{'includeAllVersions':!![]}),_0x50a3d9[_0x2996d3(0xc4)][_0x2996d3(0xb4)](_0x36dc47)]);return{'journeys':_0x2c83df,'folders':_0x2fe4fa};},{'verbose':_0x562992[_0xe050af(0x114)]})['then'](_0x167b1a=>_0x167b1a[_0xe050af(0x9b)]);let _0x514e69=_0x3a1dc0;const _0x4ccb00=buildFolderIdToPathMap(_0x5cf0c7);if(_0x201ef5){const _0x297170=_0x514e69[_0xe050af(0xd8)](_0x44164b=>_0x44164b[_0xe050af(0x116)][_0xe050af(0x13f)]()===_0x201ef5[_0xe050af(0x13f)]());if(_0x297170['length']===0x0)return console[_0xe050af(0x156)](_0xe050af(0xcf)+_0x201ef5),console[_0xe050af(0x156)](_0xe050af(0x145)),0x1;_0x514e69=_0x297170;}if(_0x539dc6!==undefined){const _0x5177c5=_0x514e69[_0xe050af(0xd8)](_0x2c08a6=>{const _0x3e8bd2=_0xe050af,_0x186ab6=_0x2c08a6[_0x3e8bd2(0xbc)]?_0x4ccb00[_0x3e8bd2(0xea)](_0x2c08a6[_0x3e8bd2(0xbc)])||'':'';return _0x186ab6===_0x539dc6;});if(_0x5177c5[_0xe050af(0xff)]===0x0&&_0x514e69[_0xe050af(0xff)]>0x0){console['error'](_0xe050af(0x196)+_0x201ef5+_0xe050af(0x95)+(_0x539dc6||'root\x20folder')),console[_0xe050af(0x156)](_0xe050af(0x167));for(const _0x217216 of _0x514e69){const _0x1b7957=_0x217216[_0xe050af(0xbc)]?_0x4ccb00[_0xe050af(0xea)](_0x217216[_0xe050af(0xbc)])||'':'';console[_0xe050af(0x156)](_0xe050af(0xc8)+(_0x1b7957||_0xe050af(0xe2))+'/'+_0x217216[_0xe050af(0x116)]);}return 0x1;}_0x514e69=_0x5177c5;}if(_0x514e69[_0xe050af(0xff)]===0x0)return console[_0xe050af(0x156)](_0xe050af(0x96)),0x0;const _0x2eab81=new Map();for(const _0x438331 of _0x514e69){const _0x59d3cf=_0x438331[_0xe050af(0xbb)];!_0x2eab81[_0xe050af(0xee)](_0x59d3cf)&&_0x2eab81[_0xe050af(0xbd)](_0x59d3cf,[]),_0x2eab81[_0xe050af(0xea)](_0x59d3cf)['push'](_0x438331);}for(const _0xc11b8f of _0x2eab81[_0xe050af(0xdc)]()){_0xc11b8f['sort']((_0x4d6654,_0x390873)=>(_0x4d6654['versionNumber']||0x0)-(_0x390873['versionNumber']||0x0));}const _0xb7c73c=[],{idToEmailMap:_0x159eb5,connectionIdToNameMap:_0x3d4aed}=await withSpinner(_0xe050af(0x97),async()=>{const _0x16b97f=_0xe050af,[_0x22fef0,_0x14cdf6]=await Promise[_0x16b97f(0xfa)]([_0x50a3d9[_0x16b97f(0xcc)][_0x16b97f(0xa9)](),_0x50a3d9[_0x16b97f(0x130)][_0x16b97f(0x131)]()]);return{'idToEmailMap':_0x22fef0,'connectionIdToNameMap':_0x14cdf6};},{'verbose':_0x562992['verbose']})['then'](_0x21a718=>_0x21a718[_0xe050af(0x9b)]);for(const _0x42a3f1 of _0x2eab81[_0xe050af(0xdc)]()){const _0x3d322f=_0x42a3f1[0x0][_0xe050af(0x116)],_0x4de027=_0x42a3f1[0x0][_0xe050af(0xbc)],_0x40a775=_0x4de027?_0x4ccb00['get'](_0x4de027)||'':'',_0x446280=_0x40a775?a28_0x28a74c['join'](_0x2d5aa9,_0x40a775):_0x2d5aa9,_0x43fa10=_0x3605a2||a28_0x28a74c['join'](_0x446280,sanitizeFileName(_0x3d322f)+'.yml');let _0x11f82c,_0x9afe5;if(existsSync(_0x43fa10))try{const _0x4c88dd=readFileSync(_0x43fa10,_0xe050af(0xcb)),_0x327a63=parseYamlString(_0x4c88dd);_0x9afe5=_0x327a63,_0x11f82c=buildRuleToNameMapping(_0x327a63),_0x299450[_0xe050af(0x114)]&&_0x11f82c['size']>0x0&&console[_0xe050af(0x156)]('Found\x20'+_0x11f82c['size']+_0xe050af(0x11c)+_0x3d322f);}catch(_0x482cc0){_0x299450['verbose']&&console[_0xe050af(0x156)](_0xe050af(0x11d)+_0x482cc0[_0xe050af(0xae)]);}const _0xc2a07c=[],_0x1794dd=new Set(),_0x26924b=new Map(),_0x53d9d0=new Map(),_0x34b376=new Set(),_0x5125bb=new Map(),_0x247502=new Map(),_0x3c5988=createJumpTargetCache();await withProgressSpinner(_0xe050af(0xfe)+_0x3d322f+_0xe050af(0x10d),async _0x95f78c=>{const _0x48b2aa=_0xe050af;for(const _0x2fd4aa of _0x42a3f1){const _0x8e2c69=_0x42a3f1[_0x48b2aa(0xff)]>0x1?_0x2fd4aa[_0x48b2aa(0x116)]+'\x20v'+(_0x2fd4aa[_0x48b2aa(0x182)]||0x1):_0x2fd4aa['journeyBundleName'];_0x95f78c['setPhase'](_0x48b2aa(0xfe)+_0x8e2c69);const _0x463f24=await _0x50a3d9[_0x48b2aa(0x150)][_0x48b2aa(0x110)](_0x2fd4aa['id']),_0x4de013=_0x463f24['attributes']?.[_0x48b2aa(0xe1)],_0x38b56f={'resolveSegment':async _0x971b3f=>{const _0x7fdf2=_0x48b2aa;if(!_0x4de013)return{'name':_0x971b3f,'isJourneyLocal':![]};const _0x2389fc=_0x26924b[_0x7fdf2(0xea)](_0x971b3f);if(_0x2389fc)return _0x2389fc;try{const _0x58a1eb=await _0x50a3d9[_0x7fdf2(0xc4)][_0x7fdf2(0x138)](_0x4de013,_0x971b3f),_0x240bd8=_0x58a1eb[_0x7fdf2(0x129)]===SEGMENT_KIND_JOURNEY;let _0x1f99ce,_0x1f3532=_0x58a1eb[_0x7fdf2(0x115)];if(_0x240bd8&&_0x58a1eb[_0x7fdf2(0xf2)]){const _0x33073c=await segmentResponseToDef(_0x58a1eb,{'resolveSegmentName':async _0x163ea1=>{const _0x1d456b=_0x7fdf2,_0x2486e6=_0x26924b[_0x1d456b(0xea)](_0x163ea1);if(_0x2486e6)return _0x2486e6[_0x1d456b(0x115)];const _0x1ca6f1=await _0x38b56f[_0x1d456b(0xe0)](_0x163ea1);return _0x1ca6f1[_0x1d456b(0x115)];}}),_0x438d7a=_0x33073c[_0x7fdf2(0xf2)];_0x1f99ce={'description':_0x58a1eb[_0x7fdf2(0xed)],'rule':_0x438d7a};const _0x28d95d=serializeRule(_0x438d7a),_0x42146a=_0x53d9d0[_0x7fdf2(0xea)](_0x28d95d);if(_0x42146a)_0x1f3532=_0x42146a,_0x1f99ce=undefined,_0x299450['verbose']&&console[_0x7fdf2(0x156)](_0x7fdf2(0xb1)+_0x58a1eb[_0x7fdf2(0x115)]+_0x7fdf2(0x192)+_0x42146a);else{let _0x45aa1b=![];if(_0x11f82c){const _0x40647a=_0x11f82c[_0x7fdf2(0xea)](_0x28d95d);if(_0x40647a){const _0x3ef347=_0x40647a[_0x7fdf2(0xbf)](_0x7d88a7=>!_0x1794dd[_0x7fdf2(0xee)](_0x7d88a7));_0x3ef347&&(_0x1f3532=_0x3ef347,_0x1794dd[_0x7fdf2(0x166)](_0x3ef347),_0x53d9d0[_0x7fdf2(0xbd)](_0x28d95d,_0x3ef347),_0x45aa1b=!![],_0x299450[_0x7fdf2(0x114)]&&console[_0x7fdf2(0x156)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x3ef347+_0x7fdf2(0x197)));}}if(!_0x45aa1b){const _0x39f753=generateJourneyLocalName(_0x58a1eb[_0x7fdf2(0x115)]);_0x39f753&&(_0x1f3532=_0x39f753);let _0x444b4d=_0x1f3532,_0x4470dd=0x2;while(_0x1794dd[_0x7fdf2(0xee)](_0x444b4d)){_0x444b4d=_0x1f3532+'_'+_0x4470dd,_0x4470dd++;}_0x1794dd[_0x7fdf2(0x166)](_0x444b4d),_0x53d9d0[_0x7fdf2(0xbd)](_0x28d95d,_0x444b4d),_0x1f3532=_0x444b4d;}}}const _0x3bc205={'name':_0x1f3532,'isJourneyLocal':_0x240bd8,'definition':_0x1f99ce};return _0x26924b['set'](_0x971b3f,_0x3bc205),_0x3bc205;}catch(_0x4dc019){return _0x562992[_0x7fdf2(0x114)]&&console[_0x7fdf2(0x156)](_0x7fdf2(0x171)+_0x971b3f+':\x20'+_0x4dc019[_0x7fdf2(0xae)]),{'name':_0x971b3f,'isJourneyLocal':![]};}},'resolveActivation':async _0x14138a=>{const _0x294041=_0x48b2aa,_0x2c16a2=_0x5125bb[_0x294041(0xea)](_0x14138a);if(_0x2c16a2)return _0x2c16a2;try{const _0x120b34=await _0x50a3d9[_0x294041(0x150)][_0x294041(0x109)](_0x2fd4aa['id'],_0x14138a),_0x422d52=journeyActivationStepToYaml(_0x120b34,_0x159eb5,_0x3d4aed),_0x3bbbf9=JSON[_0x294041(0xaf)]({'name':_0x422d52[_0x294041(0x115)],'connection':_0x422d52[_0x294041(0x130)],'connector_config':_0x422d52[_0x294041(0x11b)]}),_0x227790=_0x247502['get'](_0x3bbbf9);if(_0x227790){const _0x43a995={'name':_0x227790,'isJourneyLocal':!![],'definition':_0x422d52};return _0x5125bb[_0x294041(0xbd)](_0x14138a,_0x43a995),_0x43a995;}const _0x551e99=_0x120b34[_0x294041(0x15e)]['activationParams'][_0x294041(0x115)]||_0x14138a,_0x3aefe0=sanitizeYamlKey(_0x551e99)||_0x294041(0xd5)+_0x14138a;let _0x13a80e=_0x3aefe0,_0x2a9007=0x2;while(_0x34b376['has'](_0x13a80e)){_0x13a80e=_0x3aefe0+'_'+_0x2a9007,_0x2a9007++;}_0x34b376[_0x294041(0x166)](_0x13a80e),_0x247502[_0x294041(0xbd)](_0x3bbbf9,_0x13a80e);const _0xeeb743={'name':_0x13a80e,'isJourneyLocal':!![],'definition':_0x422d52};return _0x5125bb[_0x294041(0xbd)](_0x14138a,_0xeeb743),_0xeeb743;}catch(_0xe280d1){return _0x562992[_0x294041(0x114)]&&console['error'](_0x294041(0x132)+_0x14138a+':\x20'+_0xe280d1[_0x294041(0xae)]),{'name':_0x14138a,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x257a5a,_0x540f87)=>{const _0x9996c3=_0x48b2aa;return resolveJumpTarget(_0x257a5a,_0x540f87,_0x3c5988,_0x350425=>_0x50a3d9['journey'][_0x9996c3(0x110)](_0x350425));}},_0x111166=await journeyResponseToDef(_0x463f24,_0x38b56f);_0xc2a07c['push']({'item':_0x2fd4aa,'yaml':_0x111166});}},{'verbose':_0x562992[_0xe050af(0x114)]});const _0x272fce=await _0x50a3d9[_0xe050af(0x150)]['getLatestJourneyId'](_0x42a3f1[0x0][_0xe050af(0xbb)]),_0x55a9f2=buildMergedJourneyDef(_0xc2a07c,_0x11f82c,_0x272fce),_0x218d2d=normalizeJourneyDef(_0x55a9f2,_0x9afe5),_0x2f89ce=toYamlString(_0x218d2d),_0x2b528c=_0x3605a2||a28_0x28a74c[_0xe050af(0x179)](_0x446280,sanitizeFileName(_0x3d322f)+_0xe050af(0xd1));!_0x3605a2&&_0x40a775&&!existsSync(_0x446280)&&mkdirSync(_0x446280,{'recursive':!![]});const _0x30e082=a28_0x28a74c['relative'](process[_0xe050af(0x9c)](),_0x2b528c);if(existsSync(_0x2b528c)){const _0x1a89d0=readFileSync(_0x2b528c,'utf-8'),_0x280fca=generateDiff(_0x1a89d0,_0x2f89ce),_0x1444fb=hasChanges(_0x280fca);_0xb7c73c[_0xe050af(0x181)]({'relativePath':_0x30e082,'absolutePath':_0x2b528c,'content':_0x2f89ce,'isNew':![],'hasChanges':_0x1444fb,'diff':_0x1444fb?formatDiffWithColors(_0x280fca):undefined});}else _0xb7c73c[_0xe050af(0x181)]({'relativePath':_0x30e082,'absolutePath':_0x2b528c,'content':_0x2f89ce,'isNew':!![],'hasChanges':![]});}const _0x47c013=_0xb7c73c[_0xe050af(0xd8)](_0x570422=>_0x570422[_0xe050af(0x90)]),_0xa91747=_0xb7c73c[_0xe050af(0xd8)](_0x28ba19=>!_0x28ba19[_0xe050af(0x90)]&&_0x28ba19[_0xe050af(0x154)]),_0x16e43d=_0xb7c73c[_0xe050af(0xd8)](_0x4e8043=>!_0x4e8043[_0xe050af(0x90)]&&!_0x4e8043[_0xe050af(0x154)]),_0x470200=_0x514e69[_0xe050af(0xff)],_0x1261a7=_0x2eab81['size'],_0x2d5aea=_0x470200>_0x1261a7?'\x20('+_0x470200+_0xe050af(0x17a):'';console[_0xe050af(0x156)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a28_0x428bd7[_0xe050af(0xa3)](_0x1261a7+_0xe050af(0x178))+a28_0x428bd7[_0xe050af(0x10c)](_0x2d5aea)),console['error']('\x20\x20'+a28_0x428bd7['green']('+\x20'+_0x47c013[_0xe050af(0xff)]+_0xe050af(0x164))),console[_0xe050af(0x156)]('\x20\x20'+a28_0x428bd7[_0xe050af(0x91)]('~\x20'+_0xa91747[_0xe050af(0xff)]+_0xe050af(0x174))),console[_0xe050af(0x156)]('\x20\x20'+a28_0x428bd7[_0xe050af(0x10c)]('=\x20'+_0x16e43d[_0xe050af(0xff)]+_0xe050af(0x151))),console[_0xe050af(0x156)](_0xe050af(0xd9)+a28_0x428bd7['cyan'](_0x2d5aa9)+'\x0a');if(_0xa91747[_0xe050af(0xff)]>0x0)for(const _0x28f69e of _0xa91747){console[_0xe050af(0x156)](_0xe050af(0x8a)+_0x28f69e[_0xe050af(0xa1)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x28f69e[_0xe050af(0x14e)]),console[_0xe050af(0x156)]('─'['repeat'](0x3c));}if(_0x299450[_0xe050af(0x195)])return console[_0xe050af(0x156)](a28_0x428bd7[_0xe050af(0x91)](_0xe050af(0x15a))),0x0;if(_0x47c013[_0xe050af(0xff)]===0x0&&_0xa91747['length']===0x0)return console[_0xe050af(0x156)](a28_0x428bd7['green'](_0xe050af(0xf4))),saveSessionContext({'parent_segment':_0x18a721},_0x299450['session']),console[_0xe050af(0x156)](a28_0x428bd7[_0xe050af(0x176)](_0xe050af(0x102)+a28_0x428bd7['dim'](_0xe050af(0xdb))+_0xe050af(0x143)+a28_0x428bd7[_0xe050af(0xa3)](_0x18a721))),0x0;if(!_0x299450['yes']&&(_0x47c013[_0xe050af(0xff)]>0x0||_0xa91747['length']>0x0)){if(!isInteractive())return console[_0xe050af(0x156)](a28_0x428bd7['red'](_0xe050af(0xb8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a28_0x428bd7['dim'](_0xe050af(0xce))),0x1;const _0x1602e9=await confirmKey(_0xe050af(0x8e)+(_0x47c013[_0xe050af(0xff)]+_0xa91747['length'])+'\x20files?');if(!_0x1602e9)return console[_0xe050af(0x156)](a28_0x428bd7['yellow'](_0xe050af(0xd2)),_0xe050af(0xd6)),0x1;}!existsSync(_0x2d5aa9)&&mkdirSync(_0x2d5aa9,{'recursive':!![]});const _0x2e71b4=a28_0x28a74c[_0xe050af(0x179)](_0x2d5aa9,_0xe050af(0x119));writeFileSync(_0x2e71b4,createTdxConfigContent(_0x18a721),'utf-8');for(const _0x14889f of _0xb7c73c){(_0x14889f[_0xe050af(0x90)]||_0x14889f[_0xe050af(0x154)])&&writeFileSync(_0x14889f[_0xe050af(0x117)],_0x14889f['content'],_0xe050af(0xcb));}return console[_0xe050af(0x156)](a28_0x428bd7[_0xe050af(0x176)]('✔\x20Pulled\x20'+(_0x47c013['length']+_0xa91747[_0xe050af(0xff)])+_0xe050af(0x162)+_0x2d5aa9)),saveSessionContext({'parent_segment':_0x18a721},_0x299450[_0xe050af(0x104)]),console[_0xe050af(0x156)](a28_0x428bd7[_0xe050af(0x176)](_0xe050af(0x102)+a28_0x428bd7[_0xe050af(0x10c)](_0xe050af(0xdb))+_0xe050af(0x143)+a28_0x428bd7['cyan'](_0x18a721))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x13f224(0x115)]='journey:columns';[a28_0x13f224(0xed)]='Show\x20journey\x20table\x20column\x20mapping';async[a28_0x13f224(0x100)](_0x56a563){const _0x22b449=a28_0x13f224,{options:_0x4f0ebe,args:_0x452641,tdx:_0x1c3d1f}=_0x56a563,_0x131210=_0x452641[0x0];if(!requireNameOrPath(_0x131210))return 0x1;_0x4f0ebe[_0x22b449(0x114)]&&console[_0x22b449(0x156)](_0x22b449(0xf3)+_0x131210);const {journeyId:_0x545764}=await resolveJourneyIdFromInput(_0x131210,_0x4f0ebe,_0x1c3d1f),_0x15571b=await withSpinner(_0x22b449(0xc3),()=>_0x1c3d1f['journey'][_0x22b449(0xc9)](_0x545764),{'verbose':_0x4f0ebe[_0x22b449(0x114)]}),_0x374d3b=_0x15571b[_0x22b449(0x9b)];return console[_0x22b449(0x140)]('Database:\x20'+_0x374d3b['database']),console[_0x22b449(0x140)](_0x22b449(0x17c)+_0x374d3b[_0x22b449(0x160)]),await handleSDKOutput(_0x374d3b[_0x22b449(0xad)],_0x4f0ebe),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x13f224(0x115)]=a28_0x13f224(0xeb);[a28_0x13f224(0xed)]=a28_0x13f224(0xa7);async['execute'](_0x2c0289){const _0x5215e1=a28_0x13f224,{options:_0x238f9d,args:_0x146740,tdx:_0x5c13fc}=_0x2c0289,_0x18f4d2=_0x146740[0x0];if(!requireNameOrPath(_0x18f4d2))return 0x1;_0x238f9d[_0x5215e1(0x114)]&&console[_0x5215e1(0x156)](_0x5215e1(0xf3)+_0x18f4d2);const {journeyId:_0x537673}=await resolveJourneyIdFromInput(_0x18f4d2,_0x238f9d,_0x5c13fc),_0x50b06b=await withSpinner('Listing\x20journey\x20activations...',()=>_0x5c13fc[_0x5215e1(0x150)][_0x5215e1(0x15b)](_0x537673),{'verbose':_0x238f9d[_0x5215e1(0x114)]}),_0x1b6fbf=_0x50b06b[_0x5215e1(0x9b)];return console[_0x5215e1(0x156)](_0x5215e1(0x183)+_0x1b6fbf[_0x5215e1(0xff)]+_0x5215e1(0xb0)+(_0x1b6fbf[_0x5215e1(0xff)]!==0x1?'s':'')),await handleSDKOutput(_0x1b6fbf,_0x238f9d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x13f224(0x115)]=a28_0x13f224(0x146);[a28_0x13f224(0xed)]=a28_0x13f224(0xba);[a28_0x13f224(0x135)]=new SegmentPushCommand();async['execute'](_0x1927cd){const _0x526c5f=a28_0x13f224,_0x3906ff=_0x1927cd[_0x526c5f(0xa4)][0x0];let _0x5ed9b6;if(_0x3906ff){const _0x49aeda=await resolveTarget({'arg':_0x3906ff,'contextParent':_0x1927cd[_0x526c5f(0x190)][_0x526c5f(0x137)],'cwd':process[_0x526c5f(0x9c)]()});isSuccessfulResolution(_0x49aeda)&&_0x49aeda[_0x526c5f(0xb3)]===_0x526c5f(0xd7)&&(_0x5ed9b6=_0x49aeda[_0x526c5f(0x12b)]);}const _0x31631e={..._0x1927cd,'options':{..._0x1927cd[_0x526c5f(0x190)],'journeysOnly':!![],..._0x5ed9b6&&{'singleFilePath':_0x5ed9b6}}};return this[_0x526c5f(0x135)]['execute'](_0x31631e);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x13f224(0x115)]=a28_0x13f224(0x193);[a28_0x13f224(0xed)]='List\x20all\x20versions\x20of\x20a\x20journey';async['execute'](_0x2c674f){const _0x5304fa=a28_0x13f224,{options:_0x24c4d3,args:_0x2abd79,tdx:_0x49576f}=_0x2c674f,_0x59d6f5=_0x2abd79[0x0];if(!requireNameOrPath(_0x59d6f5))return 0x1;if(_0x24c4d3[_0x5304fa(0x114)])console['error'](_0x5304fa(0xf3)+_0x59d6f5);const {journeyId:_0x520631}=await resolveJourneyIdFromInput(_0x59d6f5,_0x24c4d3,_0x49576f),_0x150cd3=await withSpinner(_0x5304fa(0x12d),()=>_0x49576f[_0x5304fa(0x150)][_0x5304fa(0xd3)](_0x520631),{'verbose':_0x24c4d3['verbose']}),{bundleName:_0x55bcee,versions:_0x5d092b,latestJourneyId:_0x3bf777}=_0x150cd3[_0x5304fa(0x9b)];console['error'](_0x55bcee+':\x20'+_0x5d092b[_0x5304fa(0xff)]+_0x5304fa(0x16f)+(_0x5d092b[_0x5304fa(0xff)]!==0x1?'s':''));const _0x1c687d=_0x5d092b[_0x5304fa(0xf1)](_0x3ff44e=>({'version':_0x3ff44e[_0x5304fa(0x182)],'journey_id':_0x3ff44e[_0x5304fa(0xc2)],'name':_0x3ff44e[_0x5304fa(0x115)],'state':_0x3ff44e[_0x5304fa(0xf8)],'paused':_0x3ff44e[_0x5304fa(0x8b)],'latest':_0x3ff44e['journeyId']===_0x3bf777,'created_at':_0x3ff44e[_0x5304fa(0x15f)]}));return await handleSDKOutput(_0x1c687d,_0x24c4d3),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';[a28_0x13f224(0xed)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a28_0x13f224(0x100)](_0xfe0523){const _0x98f1dd=a28_0x13f224,{options:_0x4a989b,args:_0x3447fa,tdx:_0x4a8686}=_0xfe0523,_0x223586=_0x3447fa[0x0];if(!requireNameOrPath(_0x223586))return 0x1;if(_0x4a989b[_0x98f1dd(0x114)])console[_0x98f1dd(0x156)]('Input:\x20'+_0x223586);const {journeyId:_0xae9ed,journeyName:_0x3a1ee6}=await resolveJourneyIdFromInput(_0x223586,_0x4a989b,_0x4a8686);if(!_0x4a989b[_0x98f1dd(0xa2)]){const _0x371698=await confirm(_0x98f1dd(0xf0)+_0x3a1ee6+'\x22?');if(!_0x371698)return console['error']('Cancelled'),0x0;}const _0x20b994=await withSpinner('Creating\x20new\x20version...',()=>_0x4a8686[_0x98f1dd(0x150)][_0x98f1dd(0x12e)](_0xae9ed),{'verbose':_0x4a989b['verbose']}),_0x3703b5=_0x20b994[_0x98f1dd(0x9b)];return console[_0x98f1dd(0x156)](a28_0x428bd7[_0x98f1dd(0x176)]('✔')+_0x98f1dd(0xc0)+_0x3703b5[_0x98f1dd(0x15e)][_0x98f1dd(0x182)]+'\x20(draft)\x20—\x20\x22'+_0x3703b5[_0x98f1dd(0x15e)][_0x98f1dd(0x115)]+'\x22'),console[_0x98f1dd(0x156)](_0x98f1dd(0x170)+_0x3703b5['id']),await handleSingleObjectOutput({'id':_0x3703b5['id'],'name':_0x3703b5[_0x98f1dd(0x15e)]['name'],'version':_0x3703b5[_0x98f1dd(0x15e)][_0x98f1dd(0x182)],'state':_0x3703b5[_0x98f1dd(0x15e)][_0x98f1dd(0xf8)],'bundle_id':_0x3703b5[_0x98f1dd(0x15e)][_0x98f1dd(0xbb)],'created_at':_0x3703b5[_0x98f1dd(0x15e)][_0x98f1dd(0x15f)]},_0x4a989b),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x13f224(0x115)]=a28_0x13f224(0x194);['description']='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0x13f224(0x100)](_0x5066e9){const _0x5e5a09=a28_0x13f224,{options:_0x54e55d,args:_0x46e25a,tdx:_0x2652c8}=_0x5066e9,_0x25b6e2=_0x46e25a[0x0];if(!requireNameOrPath(_0x25b6e2))return 0x1;const _0x515849=_0x54e55d[_0x5e5a09(0x92)];if(!_0x515849)return console[_0x5e5a09(0x156)]('Error:\x20--version\x20option\x20is\x20required'),console['error'](_0x5e5a09(0x121)),0x1;const _0x4534c7=parseInt(_0x515849,0xa);if(isNaN(_0x4534c7)||_0x4534c7<0x1)return console['error']('Error:\x20Invalid\x20version\x20number:\x20'+_0x515849),0x1;if(_0x54e55d[_0x5e5a09(0x114)])console[_0x5e5a09(0x156)](_0x5e5a09(0xf3)+_0x25b6e2+',\x20version:\x20'+_0x4534c7);const {journeyId:_0x3b5bbf,parentSegmentId:_0x56ab28}=await resolveJourneyIdFromInput(_0x25b6e2,_0x54e55d,_0x2652c8),_0x3f1d35=await withSpinner(_0x5e5a09(0x10e),()=>_0x2652c8[_0x5e5a09(0x150)]['listVersions'](_0x3b5bbf),{'verbose':_0x54e55d[_0x5e5a09(0x114)]}),{versions:_0x1b5829,latestJourneyId:_0x3a5b1e}=_0x3f1d35['data'],_0x552df1=_0x1b5829[_0x5e5a09(0xbf)](_0x396fc9=>_0x396fc9[_0x5e5a09(0x182)]===_0x4534c7);if(!_0x552df1){const _0x5b65a0=_0x1b5829[_0x5e5a09(0xf1)](_0x3f2a34=>'v'+_0x3f2a34[_0x5e5a09(0x182)])[_0x5e5a09(0x179)](',\x20');return console[_0x5e5a09(0x156)]('Error:\x20Version\x20'+_0x4534c7+_0x5e5a09(0xd0)+_0x5b65a0),0x1;}const _0x2f2096=await withSpinner(_0x5e5a09(0x10b)+_0x4534c7+_0x5e5a09(0x14a),()=>_0x2652c8['journey'][_0x5e5a09(0x110)](_0x552df1[_0x5e5a09(0xc2)]),{'verbose':_0x54e55d[_0x5e5a09(0x114)]}),_0x33e6da=_0x2f2096[_0x5e5a09(0x9b)],_0x5ca21f=getConsoleNextUrl(_0x54e55d[_0x5e5a09(0xaa)],_0x5e5a09(0x12f)+_0x56ab28+_0x5e5a09(0xdd)+_0x552df1[_0x5e5a09(0xc2)]+_0x5e5a09(0xfc));return await handleSingleObjectOutput({'id':_0x33e6da['id'],'name':_0x33e6da[_0x5e5a09(0x15e)][_0x5e5a09(0x115)],'version':_0x33e6da[_0x5e5a09(0x15e)]['versionNumber'],'description':_0x33e6da['attributes'][_0x5e5a09(0xed)],'state':_0x33e6da[_0x5e5a09(0x15e)][_0x5e5a09(0xf8)],'paused':_0x33e6da[_0x5e5a09(0x15e)][_0x5e5a09(0x8b)],'reentry_mode':_0x33e6da['attributes']['reentryMode'],'stages':_0x33e6da[_0x5e5a09(0x15e)][_0x5e5a09(0xb7)]?.[_0x5e5a09(0xff)]||0x0,..._0x33e6da['attributes']['goal']&&{'goal':_0x33e6da[_0x5e5a09(0x15e)][_0x5e5a09(0xe4)][_0x5e5a09(0x115)]},'latest':_0x552df1[_0x5e5a09(0xc2)]===_0x3a5b1e,'created_at':_0x33e6da[_0x5e5a09(0x15e)][_0x5e5a09(0x15f)],'updated_at':_0x33e6da['attributes'][_0x5e5a09(0x9a)],'url':_0x5ca21f},_0x54e55d),0x0;}}
|
|
1
|
+
const a28_0x4d4d86=a28_0x4fe4;(function(_0x57ef9c,_0x38d14d){const _0x3401ed=a28_0x4fe4,_0x22e9cf=_0x57ef9c();while(!![]){try{const _0x40928e=-parseInt(_0x3401ed(0x232))/0x1*(parseInt(_0x3401ed(0x27e))/0x2)+-parseInt(_0x3401ed(0x284))/0x3*(parseInt(_0x3401ed(0x23c))/0x4)+-parseInt(_0x3401ed(0x237))/0x5+parseInt(_0x3401ed(0x1ba))/0x6*(parseInt(_0x3401ed(0x1e4))/0x7)+parseInt(_0x3401ed(0x1ac))/0x8*(-parseInt(_0x3401ed(0x1c9))/0x9)+-parseInt(_0x3401ed(0x212))/0xa*(-parseInt(_0x3401ed(0x28d))/0xb)+parseInt(_0x3401ed(0x1d5))/0xc*(parseInt(_0x3401ed(0x1a6))/0xd);if(_0x40928e===_0x38d14d)break;else _0x22e9cf['push'](_0x22e9cf['shift']());}catch(_0xd00538){_0x22e9cf['push'](_0x22e9cf['shift']());}}}(a28_0x1a48,0xe0bba));import a28_0x4474e0 from'chalk';import a28_0x3aa0f7 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x354dc1){const _0xff3422=a28_0x4fe4;return!_0x354dc1&&(console[_0xff3422(0x1cd)](_0xff3422(0x26c)),console[_0xff3422(0x1cd)](_0xff3422(0x1c6))),!!_0x354dc1;}function withJsonFormat(_0x32c71f){const _0x48aabb=a28_0x4fe4;if(!_0x32c71f[_0x48aabb(0x259)]&&!_0x32c71f[_0x48aabb(0x1e3)]&&!_0x32c71f[_0x48aabb(0x21a)]&&!_0x32c71f['tsv'])return{..._0x32c71f,'format':_0x48aabb(0x1e3),'json':!![]};return _0x32c71f;}function formatJourneyState(_0x3d1b79){const _0x1c13be=a28_0x4fe4;switch(_0x3d1b79){case _0x1c13be(0x280):return a28_0x4474e0[_0x1c13be(0x1f0)]('(running)');case'draft':return a28_0x4474e0['dim']('(draft)');case'paused':return a28_0x4474e0[_0x1c13be(0x270)]('(paused)');case _0x1c13be(0x1fb):return a28_0x4474e0[_0x1c13be(0x266)]('(completed)');case _0x1c13be(0x209):return a28_0x4474e0['dim']('(archived)');default:return'('+_0x3d1b79+')';}}function a28_0x4fe4(_0x5be1bc,_0x4df57c){_0x5be1bc=_0x5be1bc-0x181;const _0x1a4851=a28_0x1a48();let _0x4fe489=_0x1a4851[_0x5be1bc];return _0x4fe489;}function formatJourneyItem(_0xdce187,_0x4838d2='',_0x3025c1){const _0x2366fb=a28_0x4fe4,_0x40e7a0=formatJourneyState(_0xdce187[_0x2366fb(0x25b)]),_0x4d8452=_0x3025c1?hyperlink(_0xdce187[_0x2366fb(0x213)],_0x3025c1):_0xdce187[_0x2366fb(0x213)];return _0x4838d2+'🗺️\x20'+_0x4d8452+'\x20'+_0x40e7a0;}function escapeRegex(_0x15e6f7){const _0xfd557c=a28_0x4fe4;return _0x15e6f7[_0xfd557c(0x1cf)](/[.*+?^${}()|[\]\\]/g,_0xfd557c(0x189));}function globToRegex(_0x2b0c37){const _0x129045=a28_0x4fe4,_0xc60f0d=_0x2b0c37[_0x129045(0x257)]('*')[_0x129045(0x203)](escapeRegex);return new RegExp(_0xc60f0d['join']('.*'),'i');}function buildRuleToNameMapping(_0x18e07e){const _0x54348b=a28_0x4fe4,_0x163b28=new Map();if(_0x18e07e['segments'])for(const [_0x459866,_0x427382]of Object[_0x54348b(0x260)](_0x18e07e['segments'])){if(_0x427382['rule']){const _0x191b09=serializeRule(_0x427382[_0x54348b(0x25f)]),_0x4838f6=_0x163b28[_0x54348b(0x1ec)](_0x191b09);_0x4838f6?_0x4838f6[_0x54348b(0x1bb)](_0x459866):_0x163b28[_0x54348b(0x24e)](_0x191b09,[_0x459866]);}}return _0x163b28;}async function resolveJourneyIdFromInput(_0x484802,_0x187424,_0x2242cb){const _0x35dc70=a28_0x4fe4,_0x10d202=await resolveJourneyTarget(_0x484802,_0x187424[_0x35dc70(0x271)],_0x187424[_0x35dc70(0x217)]),_0x4c1637=_0x10d202['parentSegment'];if(!_0x4c1637)throw new SDKError(ErrorCode[_0x35dc70(0x1f9)],_0x35dc70(0x1fe));const _0x2f4790=await withSpinner(_0x35dc70(0x250),()=>_0x2242cb[_0x35dc70(0x1ed)]['resolveParentId'](_0x4c1637),{'verbose':_0x187424[_0x35dc70(0x217)]}),_0x1bc984=_0x2f4790['data'],_0x49d996=await withSpinner(_0x35dc70(0x221),()=>_0x2242cb[_0x35dc70(0x276)][_0x35dc70(0x1df)](_0x1bc984,_0x10d202['journeyName']),{'verbose':_0x187424[_0x35dc70(0x217)]});return{'journeyId':_0x49d996['data'],'journeyName':_0x10d202[_0x35dc70(0x18b)],'parentSegmentId':_0x1bc984};}async function resolveJourneyTarget(_0x2f383a,_0x2e722c,_0x478c54){const _0x287ede=a28_0x4fe4;if(isYamlFilePath(_0x2f383a))try{const _0x3716d3=await resolveYamlFilePath(_0x2f383a);return _0x478c54&&(console[_0x287ede(0x1cd)](_0x287ede(0x26e)+_0x2f383a),console[_0x287ede(0x1cd)]('\x20\x20Parent\x20segment:\x20'+_0x3716d3['parentSegment']),console['error'](_0x287ede(0x214)+_0x3716d3[_0x287ede(0x256)]),console[_0x287ede(0x1cd)](_0x287ede(0x220)+(_0x3716d3['folderPath']||_0x287ede(0x27b)))),{'journeyName':_0x3716d3[_0x287ede(0x256)],'parentSegment':_0x3716d3[_0x287ede(0x271)],'resolved':_0x3716d3};}catch(_0x94d124){throw new SDKError(ErrorCode[_0x287ede(0x1f9)],_0x287ede(0x223)+_0x94d124[_0x287ede(0x23b)]);}if(!_0x2e722c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x287ede(0x1ce));return{'journeyName':_0x2f383a,'parentSegment':_0x2e722c};}export class JourneyListCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x191);['description']='List\x20journeys\x20in\x20current\x20context';async[a28_0x4d4d86(0x1b9)](_0x589bf2){const _0x421175=a28_0x4d4d86,{options:_0x37059b,args:_0x1f8edb,tdx:_0x5b2dcc}=_0x589bf2,_0x5c0a39=_0x1f8edb[0x0],_0x307c12=_0x37059b['parentSegment'];if(!_0x307c12)return console['error'](_0x421175(0x1db)),console[_0x421175(0x1cd)](_0x421175(0x27c)),0x1;const _0x7fbe6a=await withSpinner(_0x421175(0x250),()=>_0x5b2dcc[_0x421175(0x1ed)][_0x421175(0x278)](_0x307c12),{'verbose':_0x37059b[_0x421175(0x217)]}),_0x262f32=_0x7fbe6a[_0x421175(0x26d)];_0x37059b['verbose']&&(console['error'](_0x421175(0x1cb)+_0x307c12+'\x20(ID:\x20'+_0x262f32+')'),_0x5c0a39&&console['error'](_0x421175(0x264)+_0x5c0a39));const _0x44037b=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x5b2dcc[_0x421175(0x1ed)][_0x421175(0x28b)](_0x262f32),{'verbose':_0x37059b['verbose']}),_0x35c524=_0x44037b['data'],_0x3d0b56=_0x35c524[_0x421175(0x205)],_0xa0449b=await withSpinner(_0x421175(0x1af),()=>_0x5b2dcc['journey'][_0x421175(0x28f)](_0x262f32,_0x3d0b56),{'verbose':_0x37059b[_0x421175(0x217)]});let _0x2cb23d=_0xa0449b[_0x421175(0x26d)][_0x421175(0x282)];const _0x150ec9=_0xa0449b[_0x421175(0x26d)][_0x421175(0x1d4)],_0x47012e=new Map();for(const _0x5028d5 of _0x150ec9){_0x47012e[_0x421175(0x24e)](_0x5028d5['id'],_0x5028d5[_0x421175(0x233)]);}if(_0x5c0a39){const _0x19e562=globToRegex(_0x5c0a39);_0x2cb23d=_0x2cb23d[_0x421175(0x22b)](_0x27f618=>_0x19e562[_0x421175(0x1c2)](_0x27f618['journeyBundleName']));}console[_0x421175(0x1cd)](_0x421175(0x1ff)+_0x2cb23d[_0x421175(0x18c)]+_0x421175(0x19b)+(_0x2cb23d[_0x421175(0x18c)]!==0x1?'s':''));const _0xc295a2=_0x289e6b=>{const _0x51686d=_0x421175;return getConsoleNextUrl(_0x37059b[_0x51686d(0x21f)],'/app/ps/'+_0x262f32+_0x51686d(0x1c4)+_0x289e6b+'/j/da');};if(_0x37059b[_0x421175(0x259)]===_0x421175(0x1d1))await handleSDKOutput(_0x2cb23d,_0x37059b);else{if(_0x37059b[_0x421175(0x259)]===_0x421175(0x1e3)){const _0x5c7dcc=_0x2cb23d['map'](_0x5dcea9=>({..._0x5dcea9,'url':_0xc295a2(_0x5dcea9['id'])}));await handleSDKOutput(_0x5c7dcc,_0x37059b);}else{console[_0x421175(0x291)]('['+_0x307c12+']');const _0x42f34a=new Map(),_0x29aebc=[];for(const _0x48c71d of _0x2cb23d){if(!_0x48c71d[_0x421175(0x20e)]||_0x48c71d[_0x421175(0x20e)]===_0x3d0b56)_0x29aebc['push'](_0x48c71d);else{const _0x3e874c=_0x42f34a[_0x421175(0x1ec)](_0x48c71d['folderId'])||[];_0x3e874c['push'](_0x48c71d),_0x42f34a[_0x421175(0x24e)](_0x48c71d['folderId'],_0x3e874c);}}const _0x4cdeb7=(_0x453126,_0x372621)=>_0x453126[_0x421175(0x213)][_0x421175(0x1f5)](_0x372621[_0x421175(0x213)],undefined,{'sensitivity':_0x421175(0x1a2)});_0x29aebc['sort'](_0x4cdeb7);for(const _0x4add4c of _0x29aebc){console[_0x421175(0x291)](formatJourneyItem(_0x4add4c,'',_0xc295a2(_0x4add4c['id'])));}const _0x11b9a8=[..._0x42f34a[_0x421175(0x260)]()]['sort']((_0x30cb18,_0x40f44e)=>{const _0x528c5b=_0x421175,_0x28406a=_0x47012e['get'](_0x30cb18[0x0])||_0x30cb18[0x0],_0x485880=_0x47012e[_0x528c5b(0x1ec)](_0x40f44e[0x0])||_0x40f44e[0x0];return _0x28406a[_0x528c5b(0x1f5)](_0x485880,undefined,{'sensitivity':_0x528c5b(0x1a2)});});for(const [_0x3c2be4,_0x2747fd]of _0x11b9a8){const _0x1f85ff=_0x47012e[_0x421175(0x1ec)](_0x3c2be4)||_0x3c2be4;console[_0x421175(0x291)](_0x421175(0x263)+_0x1f85ff),_0x2747fd['sort'](_0x4cdeb7);for(const _0x4f10bc of _0x2747fd){console[_0x421175(0x291)](formatJourneyItem(_0x4f10bc,'\x20\x20',_0xc295a2(_0x4f10bc['id'])));}}}}return 0x0;}}function a28_0x1a48(){const _0xa7c4af=['enteredSize','site','\x20\x20Folder\x20path:\x20','Resolving\x20journey...','reentryMode','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','repeat','file','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Error:\x20Journey\x20not\x20found:\x20','\x20\x20Target:\x20','Show\x20journey\x20details','filter','\x0aError:','Getting\x20journey\x20statistics...','stages','then','\x20not\x20found.\x20Available:\x20','journey:pull','3TotHgF','name','Journey\x20name:\x20','all','goalSize','6385635pjysIS','Getting\x20column\x20mapping...','yes','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','message','4UugYhQ','Getting\x20journey\x20details...','folderPath','\x20files?','goal','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20Invalid\x20--type\x20\x22','resourceName','View\x20a\x20specific\x20version\x20of\x20a\x20journey','connector_config','/j/da/je','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','exitOrJumpSize','red','find','targetDir','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','set','listFolders','Resolving\x20parent\x20segment...','type','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','setPhase','Error:\x20Invalid\x20version\x20number:\x20','.yml','segmentName','split','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','format','conversion','state','\x20versions)','\x22\x20paused','Aborted.','rule','entries','Listing\x20journey\x20activations...','\x20Created\x20v','📁\x20','Pattern:\x20','stringify','blue','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','root\x20folder','has','paused','journeyStages','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','data','Resolved\x20YAML\x20file:\x20','\x20version','yellow','parentSegment','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journeyId','sort','audienceId','journey','buildIdToEmailMap','resolveParentId','user','helpText','(root)','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','utf-8','38186hCHpWV','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','launched','database','journeys','Pausing\x20journey...','2229801EDHiJb','parentName','\x20->\x20','Input:\x20','join','createdAt','activation_','getParentFull','Fetching\x20users\x20and\x20connections...','11gGLkZF','/app/ps/','listJourneysWithFolders','nodes','log','listJourneysFromParentSegment','activation','getLatestJourneyId','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toLowerCase','Resolving\x20version...','journey:activations','Listing\x20journey\x20versions...','List\x20all\x20versions\x20of\x20a\x20journey','\x5c$&','segmentPushCommand','journeyName','length','journeyBundleId','resume','filePath','\x20\x20Statistics\x20not\x20available','journey:list','isNew','cwd','✔\x20All\x20files\x20are\x20up\x20to\x20date','journey:resume','Fetching\x20journeys\x20and\x20folders...','pause','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Write\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20journey','\x20Opening\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','from','Options:','limit','renderStats','base','description','Database:\x20','links','281047uoOJbb','values','args','Getting\x20journey\x20traffic\x20data...','\x20details...','tdx.json','32rUUJMB','Resume\x20a\x20paused\x20journey','Error:\x20Stage\x20\x22','Listing\x20journeys...','stageNameMap','Creating\x20new\x20version...','getStatistics','journey:view','Error:\x20Version\x20','versionNumber','getColumnMapping','\x0aChanges\x20to\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','execute','1542858IxOxxr','push','activationParams','\x20\x20-\x20','parent_segment','version','bold','Table:\x20','test','cyan','/e/','listActivationsFlat','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','milestoneSize','diff','1884456RUFABG','createVersion','Parent\x20segment:\x20','\x20(rule\x20match)','error','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','replace','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)','table','Found\x20','\x20(draft)\x20—\x20\x22','folders','1644jBFFFI','journey:traffic','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Pulled\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','session','Error:\x20Parent\x20segment\x20context\x20required','\x22\x20resumed','updatedAt','Folder\x20path:\x20','resolveJourneyId','exitOrJumpRate','\x20\x20Preserving\x20local\x20segment\x20name:\x20','web','json','7xRavlc','journey:versions','buildIdToNameMap','includeHistory','Resuming\x20journey...','Fetching\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','relative','get','segment','\x22\x20not\x20found','dim','green','✔\x20Journey\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','hasPeriod','relativePath','localeCompare','\x20journey\x20files\x20to\x20','Available\x20stages:\x20','kind','INVALID_ARGUMENT','...','completed','\x20=\x20',',\x20version:\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','✔\x20Found\x20','getActivation','Warning:\x20Could\x20not\x20resolve\x20segment\x20','size','map','✔\x20Context\x20set:\x20','rootFolderId','listVersions','Cancelled','attributes','archived','journey:version:view','getTrafficData','getJourney','options','folderId','journey:stats','history','completeMilestoneRate','6167690ueWriP','journeyBundleName','\x20\x20Name:\x20','completionRate','add','verbose','dryRun','\x27\x20not\x20found\x20in\x20','jsonl','Getting\x20version\x20','hasChanges','\x20new\x20files'];a28_0x1a48=function(){return _0xa7c4af;};return a28_0x1a48();}export class JourneyViewCommand extends BaseCommand{['name']=a28_0x4d4d86(0x1b3);[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x22a);async[a28_0x4d4d86(0x1b9)](_0x48b8e9){const _0x4dec94=a28_0x4d4d86,{options:_0x26bdce,args:_0x730394,tdx:_0x2487e3}=_0x48b8e9,_0x14b4e6=_0x730394[0x0];if(!_0x14b4e6)return console[_0x4dec94(0x1cd)](_0x4dec94(0x26c)),console[_0x4dec94(0x1cd)](_0x4dec94(0x226)),console[_0x4dec94(0x1cd)](_0x4dec94(0x19f)),console[_0x4dec94(0x1cd)](_0x4dec94(0x1b8)),0x1;_0x26bdce[_0x4dec94(0x217)]&&console['error'](_0x4dec94(0x287)+_0x14b4e6);const {journeyId:_0x331a2a,parentSegmentId:_0x4769c6}=await resolveJourneyIdFromInput(_0x14b4e6,_0x26bdce,_0x2487e3);if(_0x26bdce[_0x4dec94(0x1e2)]){const _0x27349b=getConsoleNextUrl(_0x26bdce[_0x4dec94(0x21f)],_0x4dec94(0x28e)+_0x4769c6+_0x4dec94(0x1c4)+_0x331a2a+_0x4dec94(0x247));return console[_0x4dec94(0x1cd)](a28_0x4474e0['green']('✔')+_0x4dec94(0x19c)+a28_0x4474e0[_0x4dec94(0x1c3)](_0x27349b)),openBrowser(_0x27349b),0x0;}const _0x2d26c6=await withSpinner(_0x4dec94(0x23d),()=>_0x2487e3[_0x4dec94(0x276)][_0x4dec94(0x20c)](_0x331a2a),{'verbose':_0x26bdce[_0x4dec94(0x217)]}),_0x271798=_0x2d26c6[_0x4dec94(0x26d)],_0xdf07a5=_0x26bdce['includeStats'];let _0x1d5b6a;if(_0xdf07a5)try{const _0x290014=await withSpinner(_0x4dec94(0x22d),()=>_0x2487e3[_0x4dec94(0x276)][_0x4dec94(0x1b2)](_0x331a2a),{'verbose':_0x26bdce['verbose']});_0x1d5b6a=_0x290014['data'];}catch{_0x26bdce[_0x4dec94(0x217)]&&console[_0x4dec94(0x1cd)](_0x4dec94(0x190));}const _0x28acd9=getConsoleNextUrl(_0x26bdce[_0x4dec94(0x21f)],_0x4dec94(0x28e)+_0x4769c6+_0x4dec94(0x1c4)+_0x331a2a+'/j/da/je'),_0x59b845={'id':_0x271798['id'],'name':_0x271798['attributes'][_0x4dec94(0x233)],'description':_0x271798[_0x4dec94(0x208)]['description'],'state':_0x271798[_0x4dec94(0x208)][_0x4dec94(0x25b)],'paused':_0x271798[_0x4dec94(0x208)][_0x4dec94(0x26a)],'reentry_mode':_0x271798[_0x4dec94(0x208)][_0x4dec94(0x222)],'stages':_0x271798[_0x4dec94(0x208)]['journeyStages']?.['length']||0x0,..._0x271798[_0x4dec94(0x208)]['goal']&&{'goal':_0x271798[_0x4dec94(0x208)][_0x4dec94(0x240)][_0x4dec94(0x233)]},..._0x1d5b6a&&{'statistics':{'size':_0x1d5b6a[_0x4dec94(0x202)],'entered':_0x1d5b6a[_0x4dec94(0x21e)],'goal_achieved':_0x1d5b6a[_0x4dec94(0x236)],'completion_rate':_0x1d5b6a[_0x4dec94(0x215)],'exit_or_jump':_0x1d5b6a[_0x4dec94(0x249)],'exit_or_jump_rate':_0x1d5b6a['exitOrJumpRate'],'stages':_0x1d5b6a[_0x4dec94(0x22e)]}},'url':_0x28acd9};return await handleSingleObjectOutput(_0x59b845,_0x26bdce),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x20f);[a28_0x4d4d86(0x1a3)]='Show\x20journey\x20statistics';async[a28_0x4d4d86(0x1b9)](_0xcc1ccc){const _0x990ac9=a28_0x4d4d86,{options:_0x2b9fda,args:_0x563848,tdx:_0x1690fb}=_0xcc1ccc,_0x4e7f46=_0x563848[0x0];if(!requireNameOrPath(_0x4e7f46))return 0x1;_0x2b9fda[_0x990ac9(0x217)]&&console[_0x990ac9(0x1cd)]('Input:\x20'+_0x4e7f46);const _0x38b8d8=_0x2b9fda,_0x948fcb=_0x38b8d8[_0x990ac9(0x19e)],_0x50d088=_0x38b8d8['to'],_0x4eb07d=_0x38b8d8[_0x990ac9(0x1e7)],_0x287cea=_0x38b8d8['stage'];_0x4eb07d&&!_0x948fcb&&!_0x50d088&&console[_0x990ac9(0x1cd)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x4168b2=_0x4eb07d?withJsonFormat(_0x2b9fda):_0x2b9fda,{journeyId:_0x16ebd1,journeyName:_0x441841}=await resolveJourneyIdFromInput(_0x4e7f46,_0x4168b2,_0x1690fb),_0x328330=_0x948fcb||_0x50d088?{'from':_0x948fcb,'to':_0x50d088}:undefined,_0x3a21a5=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x990ac9(0x235)]([_0x1690fb[_0x990ac9(0x276)][_0x990ac9(0x20c)](_0x16ebd1),_0x1690fb['journey'][_0x990ac9(0x1b2)](_0x16ebd1,_0x328330)]),{'verbose':_0x4168b2[_0x990ac9(0x217)]}),[_0x1eb54f,_0x25dbef]=_0x3a21a5['data'];if(!_0x25dbef||_0x25dbef[_0x990ac9(0x273)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x441841),console[_0x990ac9(0x1cd)](_0x990ac9(0x198)),0x0;const _0x2e8521=buildStageNameMap(_0x1eb54f),_0x1d8ac6=!!(_0x328330&&_0x25dbef[_0x990ac9(0x210)]?.[_0x990ac9(0x18c)]),_0x3738bd={'stageNameMap':_0x2e8521,'hasPeriod':_0x1d8ac6,'includeHistory':!!_0x4eb07d};if(_0x287cea&&_0x25dbef[_0x990ac9(0x22e)]){const _0xafd151=_0x25dbef[_0x990ac9(0x22e)][_0x990ac9(0x24b)](_0x44c86e=>{const _0x21f85f=_0x990ac9,_0x387c57=_0x2e8521['get'](_0x44c86e['id'])??'';return _0x387c57[_0x21f85f(0x184)]()===_0x287cea[_0x21f85f(0x184)]();});if(_0xafd151)return await handleSingleObjectOutput(formatStageStats(_0xafd151,_0x3738bd),_0x4168b2),0x0;const _0x3cf312=_0x25dbef[_0x990ac9(0x22e)][_0x990ac9(0x203)](_0x455071=>_0x2e8521['get'](_0x455071['id'])??_0x455071['id']);return console['error'](_0x990ac9(0x1ae)+_0x287cea+_0x990ac9(0x1ee)),console[_0x990ac9(0x1cd)](_0x990ac9(0x1f7)+_0x3cf312['join'](',\x20')),0x1;}const _0x5e0642=_0x25dbef['stages']?.['map'](_0xd13d28=>formatStageStats(_0xd13d28,_0x3738bd)),_0x1a4d5d=assembleJourneyStats(_0x25dbef,{'from':_0x948fcb,'to':_0x50d088,'includeHistory':_0x4eb07d});return await this[_0x990ac9(0x1a1)](_0x1a4d5d,_0x5e0642??[],_0x4168b2),0x0;}async[a28_0x4d4d86(0x1a1)](_0x3c7ec0,_0x139498,_0x5b0242){const _0x2c7100=a28_0x4d4d86,_0x361f58=_0x5b0242[_0x2c7100(0x259)]===_0x2c7100(0x1e3)||_0x5b0242[_0x2c7100(0x259)]===_0x2c7100(0x21a)||_0x5b0242[_0x2c7100(0x1e3)]||_0x5b0242['jsonl'];if(_0x361f58){_0x3c7ec0[_0x2c7100(0x22e)]=_0x139498,await handleSingleObjectOutput(_0x3c7ec0,_0x5b0242);return;}await handleSingleObjectOutput(_0x3c7ec0,_0x5b0242);for(const _0x2e946c of _0x139498){console[_0x2c7100(0x291)](''),console['log'](String(a28_0x4474e0['cyan'][_0x2c7100(0x1c0)]('['+_0x2e946c[_0x2c7100(0x233)]+']'))+a28_0x4474e0[_0x2c7100(0x1ef)]('\x20'+_0x2e946c['id']));const {id:_0x42227e,name:_0x2094f9,..._0x1f1818}=_0x2e946c;await handleSingleObjectOutput(_0x1f1818,_0x5b0242);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x1d6);[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x227);async[a28_0x4d4d86(0x1b9)](_0x2ff006){const _0x805ea=a28_0x4d4d86,{options:_0x3d5764,args:_0x43512e,tdx:_0x42d455}=_0x2ff006,_0x332ae3=_0x43512e[0x0];if(!requireNameOrPath(_0x332ae3))return 0x1;_0x3d5764[_0x805ea(0x217)]&&console[_0x805ea(0x1cd)]('Input:\x20'+_0x332ae3);const _0x2d8a7b=_0x3d5764,_0x293852=_0x2d8a7b[_0x805ea(0x251)],_0x28ebec=_0x2d8a7b[_0x805ea(0x19e)],_0x1ac7bd=_0x2d8a7b['to'],_0x35491c=_0x2d8a7b[_0x805ea(0x1a0)];if(_0x293852&&_0x293852!==_0x805ea(0x25a)&&_0x293852!==_0x805ea(0x181))return console[_0x805ea(0x1cd)](_0x805ea(0x243)+_0x293852+_0x805ea(0x272)),0x1;const _0x473275=withJsonFormat(_0x3d5764),{journeyId:_0x51d6ad,journeyName:_0x35e732}=await resolveJourneyIdFromInput(_0x332ae3,_0x473275,_0x42d455),_0x168336={'type':_0x293852,'from':_0x28ebec,'to':_0x1ac7bd,'limit':_0x35491c},_0x359ba1=await withSpinner(_0x805ea(0x1a9),()=>_0x42d455[_0x805ea(0x276)][_0x805ea(0x20b)](_0x51d6ad,_0x168336),{'verbose':_0x473275[_0x805ea(0x217)]}),_0x30b130=_0x359ba1[_0x805ea(0x26d)],_0x19aef2=_0x30b130[_0x805ea(0x25a)]&&(_0x30b130[_0x805ea(0x25a)][_0x805ea(0x290)][_0x805ea(0x18c)]>0x0||_0x30b130[_0x805ea(0x25a)][_0x805ea(0x1a5)][_0x805ea(0x18c)]>0x0),_0x1ac608=_0x30b130[_0x805ea(0x181)]&&_0x30b130[_0x805ea(0x181)][_0x805ea(0x18c)]>0x0;if(!_0x19aef2&&!_0x1ac608)return console[_0x805ea(0x1cd)](_0x805ea(0x252)+_0x35e732),console[_0x805ea(0x1cd)](_0x805ea(0x241)),_0x28ebec&&_0x1ac7bd&&console[_0x805ea(0x1cd)](_0x805ea(0x27f)),0x0;return await handleSingleObjectOutput(_0x30b130,_0x473275),0x0;}}function formatStageStats(_0x123dbd,_0x1121b1){const _0x3fd692=a28_0x4d4d86,_0x535b48=_0x1121b1[_0x3fd692(0x1f3)]&&_0x123dbd[_0x3fd692(0x210)]?.[_0x3fd692(0x18c)]?aggregateStageHistory(_0x123dbd[_0x3fd692(0x210)]):{'size':_0x123dbd[_0x3fd692(0x202)],'entered':_0x123dbd[_0x3fd692(0x21e)],'milestone':_0x123dbd[_0x3fd692(0x1c7)],'milestone_rate':_0x123dbd[_0x3fd692(0x211)],'exit_or_jump':_0x123dbd[_0x3fd692(0x249)],'exit_or_jump_rate':_0x123dbd[_0x3fd692(0x1e0)]},_0x8fffe7={'id':_0x123dbd['id'],'name':_0x1121b1[_0x3fd692(0x1b0)]['get'](_0x123dbd['id'])??_0x123dbd['id'],..._0x535b48};return _0x1121b1[_0x3fd692(0x1f3)]&&_0x1121b1['includeHistory']&&_0x123dbd[_0x3fd692(0x210)]&&(_0x8fffe7['history']=_0x123dbd[_0x3fd692(0x210)]),_0x8fffe7;}export class JourneyPauseCommand extends BaseCommand{[a28_0x4d4d86(0x233)]='journey:pause';[a28_0x4d4d86(0x1a3)]='Pause\x20a\x20running\x20journey';async[a28_0x4d4d86(0x1b9)](_0x3fcacb){const _0x1e4cc6=a28_0x4d4d86,{options:_0x3c303b,args:_0xa752ba,tdx:_0x5efd13}=_0x3fcacb,_0x18d4a6=_0xa752ba[0x0];if(!requireNameOrPath(_0x18d4a6))return 0x1;_0x3c303b[_0x1e4cc6(0x217)]&&console[_0x1e4cc6(0x1cd)](_0x1e4cc6(0x287)+_0x18d4a6);const {journeyId:_0x2535df,journeyName:_0x2cb045}=await resolveJourneyIdFromInput(_0x18d4a6,_0x3c303b,_0x5efd13);if(!_0x3c303b[_0x1e4cc6(0x239)]){const _0x1e3e11=await confirm(_0x1e4cc6(0x1d9)+_0x2cb045+'\x22?');if(!_0x1e3e11)return console['error']('Cancelled'),0x0;}const _0x2df818=await withSpinner(_0x1e4cc6(0x283),()=>_0x5efd13['journey'][_0x1e4cc6(0x197)](_0x2535df),{'verbose':_0x3c303b['verbose']}),_0x12b3c7=_0x2df818[_0x1e4cc6(0x26d)];return console['error']('✔\x20Journey\x20\x22'+_0x12b3c7['attributes'][_0x1e4cc6(0x233)]+_0x1e4cc6(0x25d)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x195);['description']=a28_0x4d4d86(0x1ad);async[a28_0x4d4d86(0x1b9)](_0xf3de0f){const _0x447499=a28_0x4d4d86,{options:_0x1c73d9,args:_0xe0b46e,tdx:_0xe60e07}=_0xf3de0f,_0x4bf5e5=_0xe0b46e[0x0];if(!requireNameOrPath(_0x4bf5e5))return 0x1;_0x1c73d9[_0x447499(0x217)]&&console[_0x447499(0x1cd)](_0x447499(0x287)+_0x4bf5e5);const {journeyId:_0xf68519,journeyName:_0x5be6b3}=await resolveJourneyIdFromInput(_0x4bf5e5,_0x1c73d9,_0xe60e07);if(!_0x1c73d9[_0x447499(0x239)]){const _0x28e595=await confirm(_0x447499(0x19d)+_0x5be6b3+'\x22?');if(!_0x28e595)return console['error']('Cancelled'),0x0;}const _0x14c426=await withSpinner(_0x447499(0x1e8),()=>_0xe60e07[_0x447499(0x276)][_0x447499(0x18e)](_0xf68519),{'verbose':_0x1c73d9[_0x447499(0x217)]}),_0x590404=_0x14c426[_0x447499(0x26d)];return console[_0x447499(0x1cd)](_0x447499(0x1f1)+_0x590404[_0x447499(0x208)][_0x447499(0x233)]+_0x447499(0x1dc)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x231);[a28_0x4d4d86(0x1a3)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a28_0x4d4d86(0x1b9)](_0x54cae1){const _0x4299ad=a28_0x4d4d86,{options:_0x2977bc,args:_0x57dcda,tdx:_0x34db8e}=_0x54cae1,_0x101303=_0x2977bc,_0x5a6ab2=_0x57dcda[0x0],_0x373f6c=_0x5a6ab2&&isYamlFilePath(_0x5a6ab2),_0x41d9fe=await resolveTarget({'arg':_0x373f6c?_0x5a6ab2:undefined,'contextParent':_0x2977bc['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x41d9fe))return _0x41d9fe['errorCode']==='no_parent'?(console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x270)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4299ad(0x1cd)](_0x4299ad(0x1d0)),console['error'](_0x4299ad(0x258)),console[_0x4299ad(0x1cd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x4299ad(0x1cd)](_0x4299ad(0x183))):(console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x24a)]('Error:\x20'+_0x41d9fe[_0x4299ad(0x23b)]+'\x0a')),_0x41d9fe[_0x4299ad(0x27a)]&&console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x1c3)](_0x41d9fe[_0x4299ad(0x27a)]))),0x1;let _0x16e8c7=_0x373f6c?undefined:_0x5a6ab2,_0x3f8b97,_0x1c75bd;_0x41d9fe[_0x4299ad(0x251)]===_0x4299ad(0x225)&&(_0x16e8c7=_0x41d9fe[_0x4299ad(0x244)],_0x3f8b97=_0x41d9fe[_0x4299ad(0x18f)],_0x1c75bd=_0x41d9fe[_0x4299ad(0x23e)]);const _0x473227=_0x41d9fe[_0x4299ad(0x285)],_0x1072d4=_0x41d9fe[_0x4299ad(0x24c)];_0x101303[_0x4299ad(0x217)]&&(console[_0x4299ad(0x1cd)]('Parent\x20segment:\x20'+_0x473227),console[_0x4299ad(0x1cd)]('Target\x20directory:\x20'+_0x1072d4),_0x16e8c7&&console[_0x4299ad(0x1cd)](_0x4299ad(0x234)+_0x16e8c7),_0x3f8b97&&console[_0x4299ad(0x1cd)]('Target\x20file:\x20'+_0x3f8b97),_0x1c75bd&&console[_0x4299ad(0x1cd)](_0x4299ad(0x1de)+_0x1c75bd));const _0x5ebbb2=await withSpinner(_0x4299ad(0x250),()=>_0x34db8e[_0x4299ad(0x1ed)][_0x4299ad(0x278)](_0x473227),{'verbose':_0x2977bc[_0x4299ad(0x217)]}),_0x57defd=_0x5ebbb2[_0x4299ad(0x26d)],{journeys:_0x1ce01b,folders:_0xe2e803}=await withSpinner(_0x4299ad(0x196),async()=>{const _0x45acbb=_0x4299ad,[_0x15b355,_0xd8c10a]=await Promise[_0x45acbb(0x235)]([_0x34db8e[_0x45acbb(0x276)][_0x45acbb(0x292)](_0x57defd,undefined,{'includeAllVersions':!![]}),_0x34db8e[_0x45acbb(0x1ed)][_0x45acbb(0x24f)](_0x57defd)]);return{'journeys':_0x15b355,'folders':_0xd8c10a};},{'verbose':_0x2977bc['verbose']})[_0x4299ad(0x22f)](_0x132b75=>_0x132b75[_0x4299ad(0x26d)]);let _0x6c98b6=_0x1ce01b;const _0x2a972c=buildFolderIdToPathMap(_0xe2e803);if(_0x16e8c7){const _0x3d881c=_0x6c98b6[_0x4299ad(0x22b)](_0x141bfe=>_0x141bfe[_0x4299ad(0x213)][_0x4299ad(0x184)]()===_0x16e8c7['toLowerCase']());if(_0x3d881c[_0x4299ad(0x18c)]===0x0)return console['error'](_0x4299ad(0x228)+_0x16e8c7),console['error'](_0x4299ad(0x248)),0x1;_0x6c98b6=_0x3d881c;}if(_0x1c75bd!==undefined){const _0x46f9bf=_0x6c98b6['filter'](_0x2b1d4f=>{const _0x1341d0=_0x4299ad,_0x14849a=_0x2b1d4f['folderId']?_0x2a972c[_0x1341d0(0x1ec)](_0x2b1d4f[_0x1341d0(0x20e)])||'':'';return _0x14849a===_0x1c75bd;});if(_0x46f9bf['length']===0x0&&_0x6c98b6['length']>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x16e8c7+_0x4299ad(0x219)+(_0x1c75bd||_0x4299ad(0x268))),console[_0x4299ad(0x1cd)](_0x4299ad(0x242));for(const _0x2862bd of _0x6c98b6){const _0x4b31f1=_0x2862bd[_0x4299ad(0x20e)]?_0x2a972c['get'](_0x2862bd[_0x4299ad(0x20e)])||'':'';console[_0x4299ad(0x1cd)](_0x4299ad(0x1bd)+(_0x4b31f1||'(root)')+'/'+_0x2862bd[_0x4299ad(0x213)]);}return 0x1;}_0x6c98b6=_0x46f9bf;}if(_0x6c98b6[_0x4299ad(0x18c)]===0x0)return console['error']('No\x20journeys\x20found'),0x0;const _0x26a98c=new Map();for(const _0x4ed8ba of _0x6c98b6){const _0x548869=_0x4ed8ba[_0x4299ad(0x18d)];!_0x26a98c['has'](_0x548869)&&_0x26a98c['set'](_0x548869,[]),_0x26a98c[_0x4299ad(0x1ec)](_0x548869)['push'](_0x4ed8ba);}for(const _0x4546a8 of _0x26a98c[_0x4299ad(0x1a7)]()){_0x4546a8[_0x4299ad(0x274)]((_0x36d479,_0x10b46e)=>(_0x36d479[_0x4299ad(0x1b5)]||0x0)-(_0x10b46e['versionNumber']||0x0));}const _0x41e5ee=[],{idToEmailMap:_0x1746c2,connectionIdToNameMap:_0x5ca9dd}=await withSpinner(_0x4299ad(0x28c),async()=>{const _0x2dd53e=_0x4299ad,[_0x34072e,_0x2d9e25]=await Promise['all']([_0x34db8e[_0x2dd53e(0x279)][_0x2dd53e(0x277)](),_0x34db8e['connection'][_0x2dd53e(0x1e6)]()]);return{'idToEmailMap':_0x34072e,'connectionIdToNameMap':_0x2d9e25};},{'verbose':_0x2977bc[_0x4299ad(0x217)]})['then'](_0x35ad7e=>_0x35ad7e[_0x4299ad(0x26d)]);for(const _0x63e3f of _0x26a98c['values']()){const _0x3e0d3d=_0x63e3f[0x0][_0x4299ad(0x213)],_0x2255d7=_0x63e3f[0x0][_0x4299ad(0x20e)],_0x3a62d6=_0x2255d7?_0x2a972c[_0x4299ad(0x1ec)](_0x2255d7)||'':'',_0x4e8b50=_0x3a62d6?a28_0x3aa0f7[_0x4299ad(0x288)](_0x1072d4,_0x3a62d6):_0x1072d4,_0x15980e=_0x3f8b97||a28_0x3aa0f7[_0x4299ad(0x288)](_0x4e8b50,sanitizeFileName(_0x3e0d3d)+_0x4299ad(0x255));let _0x36f7fd,_0x59b9bf;if(existsSync(_0x15980e))try{const _0x23f6d0=readFileSync(_0x15980e,_0x4299ad(0x27d)),_0x2c1ac1=parseYamlString(_0x23f6d0);_0x59b9bf=_0x2c1ac1,_0x36f7fd=buildRuleToNameMapping(_0x2c1ac1),_0x101303[_0x4299ad(0x217)]&&_0x36f7fd[_0x4299ad(0x202)]>0x0&&console[_0x4299ad(0x1cd)](_0x4299ad(0x1d2)+_0x36f7fd[_0x4299ad(0x202)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x3e0d3d);}catch(_0x1df7cc){_0x101303[_0x4299ad(0x217)]&&console[_0x4299ad(0x1cd)](_0x4299ad(0x24d)+_0x1df7cc[_0x4299ad(0x23b)]);}const _0x32f382=[],_0x377588=new Set(),_0x293d1b=new Map(),_0x15fad0=new Map(),_0x4966dd=new Set(),_0x9f3e13=new Map(),_0x29d6bb=new Map(),_0x3b9eb2=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x3e0d3d+_0x4299ad(0x1fa),async _0x3abe3f=>{const _0x51cf4c=_0x4299ad;for(const _0x35d2d7 of _0x63e3f){const _0x24c5d5=_0x63e3f['length']>0x1?_0x35d2d7[_0x51cf4c(0x213)]+'\x20v'+(_0x35d2d7[_0x51cf4c(0x1b5)]||0x1):_0x35d2d7[_0x51cf4c(0x213)];_0x3abe3f[_0x51cf4c(0x253)](_0x51cf4c(0x1e9)+_0x24c5d5);const _0x2f9976=await _0x34db8e[_0x51cf4c(0x276)][_0x51cf4c(0x20c)](_0x35d2d7['id']),_0x2a36d3=_0x2f9976[_0x51cf4c(0x208)]?.[_0x51cf4c(0x275)],_0x5a92f={'resolveSegment':async _0x1bdf50=>{const _0x1cf2be=_0x51cf4c;if(!_0x2a36d3)return{'name':_0x1bdf50,'isJourneyLocal':![]};const _0x4d9ed6=_0x293d1b[_0x1cf2be(0x1ec)](_0x1bdf50);if(_0x4d9ed6)return _0x4d9ed6;try{const _0x1a8f6a=await _0x34db8e['segment']['getSegment'](_0x2a36d3,_0x1bdf50),_0x390a45=_0x1a8f6a[_0x1cf2be(0x1f8)]===SEGMENT_KIND_JOURNEY;let _0x16348f,_0x469abf=_0x1a8f6a[_0x1cf2be(0x233)];if(_0x390a45&&_0x1a8f6a[_0x1cf2be(0x25f)]){const _0x5920d6=await segmentResponseToDef(_0x1a8f6a,{'resolveSegmentName':async _0x2a6d2d=>{const _0x13781b=_0x1cf2be,_0x2f8099=_0x293d1b['get'](_0x2a6d2d);if(_0x2f8099)return _0x2f8099[_0x13781b(0x233)];const _0x41d4aa=await _0x5a92f['resolveSegment'](_0x2a6d2d);return _0x41d4aa[_0x13781b(0x233)];}}),_0x43ef0a=_0x5920d6[_0x1cf2be(0x25f)];_0x16348f={'description':_0x1a8f6a[_0x1cf2be(0x1a3)],'rule':_0x43ef0a};const _0x2da19c=serializeRule(_0x43ef0a),_0x352001=_0x15fad0[_0x1cf2be(0x1ec)](_0x2da19c);if(_0x352001)_0x469abf=_0x352001,_0x16348f=undefined,_0x101303[_0x1cf2be(0x217)]&&console[_0x1cf2be(0x1cd)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x1a8f6a[_0x1cf2be(0x233)]+_0x1cf2be(0x286)+_0x352001);else{let _0x1bd531=![];if(_0x36f7fd){const _0x168b6f=_0x36f7fd[_0x1cf2be(0x1ec)](_0x2da19c);if(_0x168b6f){const _0x5436cd=_0x168b6f['find'](_0x552ee0=>!_0x377588[_0x1cf2be(0x269)](_0x552ee0));_0x5436cd&&(_0x469abf=_0x5436cd,_0x377588[_0x1cf2be(0x216)](_0x5436cd),_0x15fad0[_0x1cf2be(0x24e)](_0x2da19c,_0x5436cd),_0x1bd531=!![],_0x101303['verbose']&&console[_0x1cf2be(0x1cd)](_0x1cf2be(0x1e1)+_0x5436cd+_0x1cf2be(0x1cc)));}}if(!_0x1bd531){const _0x5d30ad=generateJourneyLocalName(_0x1a8f6a[_0x1cf2be(0x233)]);_0x5d30ad&&(_0x469abf=_0x5d30ad);let _0x43de72=_0x469abf,_0x6e774a=0x2;while(_0x377588[_0x1cf2be(0x269)](_0x43de72)){_0x43de72=_0x469abf+'_'+_0x6e774a,_0x6e774a++;}_0x377588[_0x1cf2be(0x216)](_0x43de72),_0x15fad0[_0x1cf2be(0x24e)](_0x2da19c,_0x43de72),_0x469abf=_0x43de72;}}}const _0xd8121f={'name':_0x469abf,'isJourneyLocal':_0x390a45,'definition':_0x16348f};return _0x293d1b[_0x1cf2be(0x24e)](_0x1bdf50,_0xd8121f),_0xd8121f;}catch(_0x5821db){return _0x2977bc['verbose']&&console[_0x1cf2be(0x1cd)](_0x1cf2be(0x201)+_0x1bdf50+':\x20'+_0x5821db[_0x1cf2be(0x23b)]),{'name':_0x1bdf50,'isJourneyLocal':![]};}},'resolveActivation':async _0xd9aab=>{const _0x54e994=_0x51cf4c,_0x3c2d4f=_0x9f3e13[_0x54e994(0x1ec)](_0xd9aab);if(_0x3c2d4f)return _0x3c2d4f;try{const _0xcd95d1=await _0x34db8e['journey'][_0x54e994(0x200)](_0x35d2d7['id'],_0xd9aab),_0x562354=journeyActivationStepToYaml(_0xcd95d1,_0x1746c2,_0x5ca9dd),_0x108f64=JSON[_0x54e994(0x265)]({'name':_0x562354[_0x54e994(0x233)],'connection':_0x562354['connection'],'connector_config':_0x562354[_0x54e994(0x246)]}),_0x227406=_0x29d6bb[_0x54e994(0x1ec)](_0x108f64);if(_0x227406){const _0x181b9f={'name':_0x227406,'isJourneyLocal':!![],'definition':_0x562354};return _0x9f3e13['set'](_0xd9aab,_0x181b9f),_0x181b9f;}const _0x497518=_0xcd95d1[_0x54e994(0x208)][_0x54e994(0x1bc)][_0x54e994(0x233)]||_0xd9aab,_0x42816d=sanitizeYamlKey(_0x497518)||_0x54e994(0x28a)+_0xd9aab;let _0x96f1dc=_0x42816d,_0x4266ee=0x2;while(_0x4966dd[_0x54e994(0x269)](_0x96f1dc)){_0x96f1dc=_0x42816d+'_'+_0x4266ee,_0x4266ee++;}_0x4966dd[_0x54e994(0x216)](_0x96f1dc),_0x29d6bb[_0x54e994(0x24e)](_0x108f64,_0x96f1dc);const _0x3cc2b6={'name':_0x96f1dc,'isJourneyLocal':!![],'definition':_0x562354};return _0x9f3e13['set'](_0xd9aab,_0x3cc2b6),_0x3cc2b6;}catch(_0xfd680a){return _0x2977bc[_0x54e994(0x217)]&&console[_0x54e994(0x1cd)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0xd9aab+':\x20'+_0xfd680a[_0x54e994(0x23b)]),{'name':_0xd9aab,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x3674fb,_0x13a6fd)=>{const _0x5cb913=_0x51cf4c;return resolveJumpTarget(_0x3674fb,_0x13a6fd,_0x3b9eb2,_0x5c4a38=>_0x34db8e[_0x5cb913(0x276)][_0x5cb913(0x20c)](_0x5c4a38));}},_0x52cce7=await journeyResponseToDef(_0x2f9976,_0x5a92f);_0x32f382[_0x51cf4c(0x1bb)]({'item':_0x35d2d7,'yaml':_0x52cce7});}},{'verbose':_0x2977bc[_0x4299ad(0x217)]});const _0x118606=await _0x34db8e[_0x4299ad(0x276)][_0x4299ad(0x182)](_0x63e3f[0x0]['journeyBundleId']),_0x4ecd20=buildMergedJourneyDef(_0x32f382,_0x36f7fd,_0x118606),_0x197cdc=normalizeJourneyDef(_0x4ecd20,_0x59b9bf),_0x4ef554=toYamlString(_0x197cdc),_0x19c187=_0x3f8b97||a28_0x3aa0f7[_0x4299ad(0x288)](_0x4e8b50,sanitizeFileName(_0x3e0d3d)+'.yml');!_0x3f8b97&&_0x3a62d6&&!existsSync(_0x4e8b50)&&mkdirSync(_0x4e8b50,{'recursive':!![]});const _0x44fcba=a28_0x3aa0f7[_0x4299ad(0x1eb)](process['cwd'](),_0x19c187);if(existsSync(_0x19c187)){const _0x93af09=readFileSync(_0x19c187,_0x4299ad(0x27d)),_0x192e29=generateDiff(_0x93af09,_0x4ef554),_0x2bfa7a=hasChanges(_0x192e29);_0x41e5ee[_0x4299ad(0x1bb)]({'relativePath':_0x44fcba,'absolutePath':_0x19c187,'content':_0x4ef554,'isNew':![],'hasChanges':_0x2bfa7a,'diff':_0x2bfa7a?formatDiffWithColors(_0x192e29):undefined});}else _0x41e5ee[_0x4299ad(0x1bb)]({'relativePath':_0x44fcba,'absolutePath':_0x19c187,'content':_0x4ef554,'isNew':!![],'hasChanges':![]});}const _0x595816=_0x41e5ee[_0x4299ad(0x22b)](_0x3f7ef2=>_0x3f7ef2[_0x4299ad(0x192)]),_0x3e0a48=_0x41e5ee[_0x4299ad(0x22b)](_0x66b4a6=>!_0x66b4a6['isNew']&&_0x66b4a6[_0x4299ad(0x21c)]),_0x95f1db=_0x41e5ee[_0x4299ad(0x22b)](_0x5e196d=>!_0x5e196d[_0x4299ad(0x192)]&&!_0x5e196d[_0x4299ad(0x21c)]),_0xdc8dd4=_0x6c98b6['length'],_0x4b67a5=_0x26a98c[_0x4299ad(0x202)],_0x26b0eb=_0xdc8dd4>_0x4b67a5?'\x20('+_0xdc8dd4+_0x4299ad(0x25c):'';console[_0x4299ad(0x1cd)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a28_0x4474e0[_0x4299ad(0x1c3)](_0x4b67a5+'\x20journeys')+a28_0x4474e0['dim'](_0x26b0eb)),console[_0x4299ad(0x1cd)]('\x20\x20'+a28_0x4474e0['green']('+\x20'+_0x595816[_0x4299ad(0x18c)]+_0x4299ad(0x21d))),console[_0x4299ad(0x1cd)]('\x20\x20'+a28_0x4474e0[_0x4299ad(0x270)]('~\x20'+_0x3e0a48[_0x4299ad(0x18c)]+'\x20changed\x20files')),console['error']('\x20\x20'+a28_0x4474e0[_0x4299ad(0x1ef)]('=\x20'+_0x95f1db[_0x4299ad(0x18c)]+'\x20unchanged\x20files')),console['error'](_0x4299ad(0x229)+a28_0x4474e0[_0x4299ad(0x1c3)](_0x1072d4)+'\x0a');if(_0x3e0a48['length']>0x0)for(const _0x241026 of _0x3e0a48){console['error'](_0x4299ad(0x1b7)+_0x241026[_0x4299ad(0x1f4)]+'\x27:'),console[_0x4299ad(0x1cd)]('─'['repeat'](0x3c)),console[_0x4299ad(0x1cd)](_0x241026[_0x4299ad(0x1c8)]),console[_0x4299ad(0x1cd)]('─'[_0x4299ad(0x224)](0x3c));}if(_0x101303[_0x4299ad(0x218)])return console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x270)](_0x4299ad(0x1f2))),0x0;if(_0x595816[_0x4299ad(0x18c)]===0x0&&_0x3e0a48['length']===0x0)return console[_0x4299ad(0x1cd)](a28_0x4474e0['green'](_0x4299ad(0x194))),saveSessionContext({'parent_segment':_0x473227},_0x101303[_0x4299ad(0x1da)]),console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x1f0)](_0x4299ad(0x204)+a28_0x4474e0[_0x4299ad(0x1ef)](_0x4299ad(0x1be))+_0x4299ad(0x1fc)+a28_0x4474e0[_0x4299ad(0x1c3)](_0x473227))),0x0;if(!_0x101303[_0x4299ad(0x239)]&&(_0x595816[_0x4299ad(0x18c)]>0x0||_0x3e0a48[_0x4299ad(0x18c)]>0x0)){if(!isInteractive())return console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x24a)](_0x4299ad(0x22c)),_0x4299ad(0x1d7)),console[_0x4299ad(0x1cd)](a28_0x4474e0['dim'](_0x4299ad(0x1ea))),0x1;const _0x479512=await confirmKey(_0x4299ad(0x199)+(_0x595816[_0x4299ad(0x18c)]+_0x3e0a48[_0x4299ad(0x18c)])+_0x4299ad(0x23f));if(!_0x479512)return console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x270)](_0x4299ad(0x25e)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x1072d4)&&mkdirSync(_0x1072d4,{'recursive':!![]});const _0x31c1f1=a28_0x3aa0f7[_0x4299ad(0x288)](_0x1072d4,_0x4299ad(0x1ab));writeFileSync(_0x31c1f1,createTdxConfigContent(_0x473227),_0x4299ad(0x27d));for(const _0x1ca77f of _0x41e5ee){(_0x1ca77f[_0x4299ad(0x192)]||_0x1ca77f[_0x4299ad(0x21c)])&&writeFileSync(_0x1ca77f['absolutePath'],_0x1ca77f['content'],_0x4299ad(0x27d));}return console[_0x4299ad(0x1cd)](a28_0x4474e0[_0x4299ad(0x1f0)](_0x4299ad(0x1d8)+(_0x595816[_0x4299ad(0x18c)]+_0x3e0a48[_0x4299ad(0x18c)])+_0x4299ad(0x1f6)+_0x1072d4)),saveSessionContext({'parent_segment':_0x473227},_0x101303[_0x4299ad(0x1da)]),console['error'](a28_0x4474e0[_0x4299ad(0x1f0)](_0x4299ad(0x204)+a28_0x4474e0[_0x4299ad(0x1ef)](_0x4299ad(0x1be))+_0x4299ad(0x1fc)+a28_0x4474e0[_0x4299ad(0x1c3)](_0x473227))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a28_0x4d4d86(0x1a3)]='Show\x20journey\x20table\x20column\x20mapping';async['execute'](_0x2e20d5){const _0x4db939=a28_0x4d4d86,{options:_0x575d55,args:_0x2976ba,tdx:_0x2238bb}=_0x2e20d5,_0x427fed=_0x2976ba[0x0];if(!requireNameOrPath(_0x427fed))return 0x1;_0x575d55[_0x4db939(0x217)]&&console[_0x4db939(0x1cd)](_0x4db939(0x287)+_0x427fed);const {journeyId:_0x2f5b03}=await resolveJourneyIdFromInput(_0x427fed,_0x575d55,_0x2238bb),_0x1d31e1=await withSpinner(_0x4db939(0x238),()=>_0x2238bb[_0x4db939(0x276)][_0x4db939(0x1b6)](_0x2f5b03),{'verbose':_0x575d55[_0x4db939(0x217)]}),_0x1deb9e=_0x1d31e1[_0x4db939(0x26d)];return console[_0x4db939(0x291)](_0x4db939(0x1a4)+_0x1deb9e[_0x4db939(0x281)]),console['log'](_0x4db939(0x1c1)+_0x1deb9e[_0x4db939(0x1d1)]),await handleSDKOutput(_0x1deb9e['columns'],_0x575d55),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a28_0x4d4d86(0x186);[a28_0x4d4d86(0x1a3)]='List\x20activations\x20for\x20a\x20journey';async[a28_0x4d4d86(0x1b9)](_0x1f8f61){const _0x4c1b68=a28_0x4d4d86,{options:_0x4b7614,args:_0x28710c,tdx:_0x183cb1}=_0x1f8f61,_0x1ac3d7=_0x28710c[0x0];if(!requireNameOrPath(_0x1ac3d7))return 0x1;_0x4b7614['verbose']&&console['error'](_0x4c1b68(0x287)+_0x1ac3d7);const {journeyId:_0x228f84}=await resolveJourneyIdFromInput(_0x1ac3d7,_0x4b7614,_0x183cb1),_0x1401b2=await withSpinner(_0x4c1b68(0x261),()=>_0x183cb1['journey'][_0x4c1b68(0x1c5)](_0x228f84),{'verbose':_0x4b7614[_0x4c1b68(0x217)]}),_0x13611a=_0x1401b2[_0x4c1b68(0x26d)];return console[_0x4c1b68(0x1cd)](_0x4c1b68(0x1d2)+_0x13611a['length']+'\x20activation'+(_0x13611a[_0x4c1b68(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x13611a,_0x4b7614),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x4d4d86(0x233)]='journey:push';[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x267);[a28_0x4d4d86(0x18a)]=new SegmentPushCommand();async[a28_0x4d4d86(0x1b9)](_0x42759a){const _0x319ff4=a28_0x4d4d86,_0x5ea6bf=_0x42759a[_0x319ff4(0x1a8)][0x0];let _0x2dada9;if(_0x5ea6bf){const _0x254b37=await resolveTarget({'arg':_0x5ea6bf,'contextParent':_0x42759a[_0x319ff4(0x20d)][_0x319ff4(0x271)],'cwd':process[_0x319ff4(0x193)]()});isSuccessfulResolution(_0x254b37)&&_0x254b37[_0x319ff4(0x251)]==='file'&&(_0x2dada9=_0x254b37[_0x319ff4(0x18f)]);}const _0xbc230a={..._0x42759a,'options':{..._0x42759a['options'],'journeysOnly':!![],..._0x2dada9&&{'singleFilePath':_0x2dada9}}};return this[_0x319ff4(0x18a)]['execute'](_0xbc230a);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a28_0x4d4d86(0x1e5);[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x188);async[a28_0x4d4d86(0x1b9)](_0x3219ac){const _0x26c6c2=a28_0x4d4d86,{options:_0x2f7c58,args:_0x51c308,tdx:_0x255c96}=_0x3219ac,_0xb16bb7=_0x51c308[0x0];if(!requireNameOrPath(_0xb16bb7))return 0x1;if(_0x2f7c58[_0x26c6c2(0x217)])console['error'](_0x26c6c2(0x287)+_0xb16bb7);const {journeyId:_0x276a27}=await resolveJourneyIdFromInput(_0xb16bb7,_0x2f7c58,_0x255c96),_0x3c9986=await withSpinner(_0x26c6c2(0x187),()=>_0x255c96[_0x26c6c2(0x276)][_0x26c6c2(0x206)](_0x276a27),{'verbose':_0x2f7c58[_0x26c6c2(0x217)]}),{bundleName:_0x11f408,versions:_0x1a1308,latestJourneyId:_0x1313e3}=_0x3c9986['data'];console['error'](_0x11f408+':\x20'+_0x1a1308[_0x26c6c2(0x18c)]+_0x26c6c2(0x26f)+(_0x1a1308[_0x26c6c2(0x18c)]!==0x1?'s':''));const _0x194bf1=_0x1a1308[_0x26c6c2(0x203)](_0x289ff7=>({'version':_0x289ff7[_0x26c6c2(0x1b5)],'journey_id':_0x289ff7['journeyId'],'name':_0x289ff7['name'],'state':_0x289ff7[_0x26c6c2(0x25b)],'paused':_0x289ff7['paused'],'latest':_0x289ff7[_0x26c6c2(0x273)]===_0x1313e3,'created_at':_0x289ff7[_0x26c6c2(0x289)]}));return await handleSDKOutput(_0x194bf1,_0x2f7c58),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x4d4d86(0x233)]='journey:version:create';[a28_0x4d4d86(0x1a3)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a28_0x4d4d86(0x1b9)](_0x4b0d7c){const _0xe032e6=a28_0x4d4d86,{options:_0x139f2d,args:_0x545ded,tdx:_0x1b324e}=_0x4b0d7c,_0x4abf29=_0x545ded[0x0];if(!requireNameOrPath(_0x4abf29))return 0x1;if(_0x139f2d[_0xe032e6(0x217)])console['error'](_0xe032e6(0x287)+_0x4abf29);const {journeyId:_0x2fad12,journeyName:_0x34e627}=await resolveJourneyIdFromInput(_0x4abf29,_0x139f2d,_0x1b324e);if(!_0x139f2d[_0xe032e6(0x239)]){const _0x14527a=await confirm(_0xe032e6(0x23a)+_0x34e627+'\x22?');if(!_0x14527a)return console[_0xe032e6(0x1cd)](_0xe032e6(0x207)),0x0;}const _0x34c2c7=await withSpinner(_0xe032e6(0x1b1),()=>_0x1b324e[_0xe032e6(0x276)][_0xe032e6(0x1ca)](_0x2fad12),{'verbose':_0x139f2d[_0xe032e6(0x217)]}),_0x4b209e=_0x34c2c7[_0xe032e6(0x26d)];return console[_0xe032e6(0x1cd)](a28_0x4474e0['green']('✔')+_0xe032e6(0x262)+_0x4b209e[_0xe032e6(0x208)]['versionNumber']+_0xe032e6(0x1d3)+_0x4b209e[_0xe032e6(0x208)][_0xe032e6(0x233)]+'\x22'),console[_0xe032e6(0x1cd)]('\x20\x20Journey\x20ID:\x20'+_0x4b209e['id']),await handleSingleObjectOutput({'id':_0x4b209e['id'],'name':_0x4b209e[_0xe032e6(0x208)][_0xe032e6(0x233)],'version':_0x4b209e['attributes'][_0xe032e6(0x1b5)],'state':_0x4b209e['attributes'][_0xe032e6(0x25b)],'bundle_id':_0x4b209e[_0xe032e6(0x208)][_0xe032e6(0x18d)],'created_at':_0x4b209e[_0xe032e6(0x208)]['createdAt']},_0x139f2d),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x4d4d86(0x233)]=a28_0x4d4d86(0x20a);[a28_0x4d4d86(0x1a3)]=a28_0x4d4d86(0x245);async[a28_0x4d4d86(0x1b9)](_0x464b5b){const _0x31cf93=a28_0x4d4d86,{options:_0xf93f1,args:_0x376b5c,tdx:_0x2d68bb}=_0x464b5b,_0xa0aa46=_0x376b5c[0x0];if(!requireNameOrPath(_0xa0aa46))return 0x1;const _0x172251=_0xf93f1[_0x31cf93(0x1bf)];if(!_0x172251)return console[_0x31cf93(0x1cd)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x31cf93(0x1cd)](_0x31cf93(0x19a)),0x1;const _0x16ed33=parseInt(_0x172251,0xa);if(isNaN(_0x16ed33)||_0x16ed33<0x1)return console[_0x31cf93(0x1cd)](_0x31cf93(0x254)+_0x172251),0x1;if(_0xf93f1[_0x31cf93(0x217)])console[_0x31cf93(0x1cd)](_0x31cf93(0x287)+_0xa0aa46+_0x31cf93(0x1fd)+_0x16ed33);const {journeyId:_0xec543f,parentSegmentId:_0x3fb9b0}=await resolveJourneyIdFromInput(_0xa0aa46,_0xf93f1,_0x2d68bb),_0x249fd6=await withSpinner(_0x31cf93(0x185),()=>_0x2d68bb[_0x31cf93(0x276)]['listVersions'](_0xec543f),{'verbose':_0xf93f1[_0x31cf93(0x217)]}),{versions:_0x53b2d5,latestJourneyId:_0xaa9e7e}=_0x249fd6[_0x31cf93(0x26d)],_0xfc4345=_0x53b2d5[_0x31cf93(0x24b)](_0x21f9c1=>_0x21f9c1[_0x31cf93(0x1b5)]===_0x16ed33);if(!_0xfc4345){const _0x45d37b=_0x53b2d5[_0x31cf93(0x203)](_0x56d389=>'v'+_0x56d389[_0x31cf93(0x1b5)])[_0x31cf93(0x288)](',\x20');return console[_0x31cf93(0x1cd)](_0x31cf93(0x1b4)+_0x16ed33+_0x31cf93(0x230)+_0x45d37b),0x1;}const _0x3c0d2d=await withSpinner(_0x31cf93(0x21b)+_0x16ed33+_0x31cf93(0x1aa),()=>_0x2d68bb[_0x31cf93(0x276)][_0x31cf93(0x20c)](_0xfc4345['journeyId']),{'verbose':_0xf93f1['verbose']}),_0x231393=_0x3c0d2d['data'],_0x35bcd1=getConsoleNextUrl(_0xf93f1[_0x31cf93(0x21f)],_0x31cf93(0x28e)+_0x3fb9b0+'/e/'+_0xfc4345[_0x31cf93(0x273)]+_0x31cf93(0x247));return await handleSingleObjectOutput({'id':_0x231393['id'],'name':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x233)],'version':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x1b5)],'description':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x1a3)],'state':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x25b)],'paused':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x26a)],'reentry_mode':_0x231393['attributes']['reentryMode'],'stages':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x26b)]?.[_0x31cf93(0x18c)]||0x0,..._0x231393['attributes'][_0x31cf93(0x240)]&&{'goal':_0x231393[_0x31cf93(0x208)][_0x31cf93(0x240)][_0x31cf93(0x233)]},'latest':_0xfc4345['journeyId']===_0xaa9e7e,'created_at':_0x231393['attributes'][_0x31cf93(0x289)],'updated_at':_0x231393['attributes'][_0x31cf93(0x1dd)],'url':_0x35bcd1},_0xf93f1),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x328bdf=a29_0x49e1;(function(_0x3ec81e,_0x2557df){const _0x2aa990=a29_0x49e1,_0x274a1d=_0x3ec81e();while(!![]){try{const _0x245ba5=parseInt(_0x2aa990(0x1b0))/0x1*(parseInt(_0x2aa990(0x1b8))/0x2)+parseInt(_0x2aa990(0x1dc))/0x3*(parseInt(_0x2aa990(0x1e4))/0x4)+-parseInt(_0x2aa990(0x1bf))/0x5*(-parseInt(_0x2aa990(0x1cd))/0x6)+-parseInt(_0x2aa990(0x1df))/0x7+-parseInt(_0x2aa990(0x1d4))/0x8+-parseInt(_0x2aa990(0x1c9))/0x9+parseInt(_0x2aa990(0x1d8))/0xa*(parseInt(_0x2aa990(0x1c7))/0xb);if(_0x245ba5===_0x2557df)break;else _0x274a1d['push'](_0x274a1d['shift']());}catch(_0xc82cf7){_0x274a1d['push'](_0x274a1d['shift']());}}}(a29_0x2336,0x1cd59));function a29_0x2336(){const _0x5ccb9f=['\x20valid','Validation\x20failed:\x20','type','warningCount','134005yzzSNH','Error:\x20Directory\x20not\x20found:\x20','reason','\x20segment\x20file(s)\x20skipped','relativePath','red','targetDir','\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','1847747lzBYNy','Validate\x20journey\x20YAML\x20files','16164pOmRJR','filter','skippedCount','\x20error(s)','18UylLsh','log','No\x20journey\x20YAML\x20files\x20found\x20in\x20','hasErrors','\x20warning(s)\x20found','warnings','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','1386520oojvEP','name','journey:validate','\x20warning(s)','10AGAteW','.yaml','invalidCount','file','6nNJCgf','✔\x20All\x20','validCount','126112tPBSDy','valid','dim','verbose','\x20journey(s)\x20valid','3084POPjuI','cwd','errorCode','error','endsWith','6131tObQDC','length','helpText','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','errors','.yml','\x20journey(s)\x20with\x20errors,\x20','yellow','20RIynHQ','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','green'];a29_0x2336=function(){return _0x5ccb9f;};return a29_0x2336();}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x1fe165 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a29_0x49e1(_0x4cb966,_0x2b9ef2){_0x4cb966=_0x4cb966-0x1b0;const _0x233697=a29_0x2336();let _0x49e110=_0x233697[_0x4cb966];return _0x49e110;}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a29_0x328bdf(0x1d5)]=a29_0x328bdf(0x1d6);['description']=a29_0x328bdf(0x1c8);async['execute'](_0x53959e){const _0x40f5df=a29_0x328bdf,{options:_0x1a2db3,args:_0x3ccea4}=_0x53959e,_0x1cf06c=_0x1a2db3,_0x136ddc=await resolveTarget({'arg':_0x3ccea4[0x0],'contextParent':_0x1a2db3['parentSegment'],'cwd':process[_0x40f5df(0x1e5)]()});if(!isSuccessfulResolution(_0x136ddc))return _0x136ddc[_0x40f5df(0x1e6)]==='no_parent'?(console[_0x40f5df(0x1e7)](a29_0x1fe165[_0x40f5df(0x1b7)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x40f5df(0x1e7)](_0x40f5df(0x1b3)),console[_0x40f5df(0x1e7)](_0x40f5df(0x1c6)),console[_0x40f5df(0x1e7)](_0x40f5df(0x1b9))):(console['error'](a29_0x1fe165[_0x40f5df(0x1c4)]('Error:\x20'+_0x136ddc['message']+'\x0a')),_0x136ddc['helpText']&&console[_0x40f5df(0x1e7)](a29_0x1fe165['cyan'](_0x136ddc[_0x40f5df(0x1b2)]))),0x1;const _0x17a593=_0x136ddc[_0x40f5df(0x1c5)],_0x48eb35=_0x136ddc[_0x40f5df(0x1bd)]===_0x40f5df(0x1db)?_0x136ddc['filePath']:undefined;if(!_0x48eb35&&!existsSync(_0x17a593))return console['error'](a29_0x1fe165[_0x40f5df(0x1c4)](_0x40f5df(0x1c0)+_0x17a593+'\x0a')),0x1;let _0x39fca8;if(_0x48eb35){if(!_0x48eb35[_0x40f5df(0x1e8)](_0x40f5df(0x1b5))&&!_0x48eb35['endsWith'](_0x40f5df(0x1d9)))return console[_0x40f5df(0x1e7)](a29_0x1fe165[_0x40f5df(0x1c4)](_0x40f5df(0x1d3)+_0x48eb35+'\x0a')),0x1;_0x39fca8=[_0x48eb35];}else _0x39fca8=findYamlFiles(_0x17a593);if(_0x39fca8['length']===0x0)return console[_0x40f5df(0x1e7)](a29_0x1fe165[_0x40f5df(0x1c4)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x17a593+'\x0a')),0x1;const _0x133b1b=validateYamlFiles(_0x39fca8,_0x17a593,{'filterType':'journey'}),_0x315dee=calculateSummary(_0x133b1b),_0x490dc6=_0x133b1b[_0x40f5df(0x1ca)](isValidationResult);if(_0x490dc6[_0x40f5df(0x1b1)]===0x0)return console['error'](a29_0x1fe165[_0x40f5df(0x1b7)](_0x40f5df(0x1cf)+_0x17a593+'\x0a')),_0x315dee[_0x40f5df(0x1cb)]>0x0&&console[_0x40f5df(0x1e7)](a29_0x1fe165['dim']('('+_0x315dee['skippedCount']+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x2d7c1d of _0x133b1b){if(!isValidationResult(_0x2d7c1d)){_0x1cf06c[_0x40f5df(0x1e2)]&&console[_0x40f5df(0x1ce)](a29_0x1fe165[_0x40f5df(0x1e1)]('-\x20'+_0x2d7c1d[_0x40f5df(0x1c3)]+'\x20(skipped:\x20'+_0x2d7c1d[_0x40f5df(0x1c1)]+')'));continue;}const {relativePath:_0x39fe7d,source:_0x5b092c,result:_0x262a24}=_0x2d7c1d;if(_0x262a24[_0x40f5df(0x1e0)]&&_0x262a24[_0x40f5df(0x1d2)]['length']===0x0)_0x1cf06c[_0x40f5df(0x1e2)]&&console['log'](a29_0x1fe165[_0x40f5df(0x1ba)]('✔\x20'+_0x39fe7d));else _0x262a24[_0x40f5df(0x1e0)]?(console[_0x40f5df(0x1ce)](a29_0x1fe165['yellow']('⚠\x20'+_0x39fe7d+':\x20'+_0x262a24['warnings']['length']+_0x40f5df(0x1d7))),console['log'](formatValidationResult(_0x262a24,_0x5b092c,_0x39fe7d))):(console[_0x40f5df(0x1ce)](a29_0x1fe165[_0x40f5df(0x1c4)]('✖\x20'+_0x39fe7d+':\x20'+_0x262a24[_0x40f5df(0x1b4)][_0x40f5df(0x1b1)]+_0x40f5df(0x1cc))),console['log'](formatValidationResult(_0x262a24,_0x5b092c,_0x39fe7d)));}return console[_0x40f5df(0x1ce)](''),_0x315dee[_0x40f5df(0x1d0)]?(console[_0x40f5df(0x1ce)](a29_0x1fe165['red'](_0x40f5df(0x1bc)+_0x315dee[_0x40f5df(0x1da)]+_0x40f5df(0x1b6)+_0x315dee['validCount']+_0x40f5df(0x1bb))),_0x315dee[_0x40f5df(0x1be)]>0x0&&console[_0x40f5df(0x1ce)](a29_0x1fe165[_0x40f5df(0x1b7)](_0x315dee[_0x40f5df(0x1be)]+_0x40f5df(0x1d1))),_0x315dee[_0x40f5df(0x1cb)]>0x0&&console[_0x40f5df(0x1ce)](a29_0x1fe165['dim'](_0x315dee[_0x40f5df(0x1cb)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console['log'](a29_0x1fe165[_0x40f5df(0x1ba)](_0x40f5df(0x1dd)+_0x315dee[_0x40f5df(0x1de)]+_0x40f5df(0x1e3))),_0x315dee[_0x40f5df(0x1be)]>0x0&&console['log'](a29_0x1fe165['yellow'](_0x315dee['warningCount']+'\x20warning(s)\x20found')),_0x315dee[_0x40f5df(0x1cb)]>0x0&&console[_0x40f5df(0x1ce)](a29_0x1fe165[_0x40f5df(0x1e1)](_0x315dee[_0x40f5df(0x1cb)]+_0x40f5df(0x1c2))),0x0);}}
|