@treasuredata/tdx 2026.4.11 → 2026.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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.d.ts +2 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x1a5222=a25_0x33be;(function(_0x2c1290,_0x3fbb13){const _0x401566=a25_0x33be,_0x51ba5b=_0x2c1290();while(!![]){try{const _0x4e25d7=-parseInt(_0x401566(0x13b))/0x1*(parseInt(_0x401566(0x132))/0x2)+parseInt(_0x401566(0x147))/0x3+parseInt(_0x401566(0x153))/0x4*(parseInt(_0x401566(0x131))/0x5)+parseInt(_0x401566(0x139))/0x6+parseInt(_0x401566(0x138))/0x7*(parseInt(_0x401566(0x133))/0x8)+parseInt(_0x401566(0x134))/0x9+-parseInt(_0x401566(0x148))/0xa;if(_0x4e25d7===_0x3fbb13)break;else _0x51ba5b['push'](_0x51ba5b['shift']());}catch(_0x3e63b7){_0x51ba5b['push'](_0x51ba5b['shift']());}}}(a25_0x5ca5,0x41716));import{BaseCommand}from'./command.js';function a25_0x5ca5(){const _0x4fe902=['validCount','199437MLdGHs','1038306MtmQQF','errors','40785OvDFbT','red','description','\x20non-template\x20file(s)\x20skipped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','.yml','engage:template:validate','error','\x20template(s)\x20with\x20errors,\x20','hasErrors','relativePath','valid','910479JBkapp','10900000VaXBHB','\x20warning(s)\x20found','dirname','skippedCount','.yaml','template','invalidCount','endsWith','✔\x20All\x20','cwd','\x20(skipped:\x20','9304hCWxxe','warningCount','yellow','log','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','warnings','\x20template(s)\x20valid','\x20non-template\x20file(s)\x20skipped)','length','dim','\x20warning(s)','green','\x20valid','1005vgZmQO','2IPicPW','40wnoYJV','2810826WYHHgU','Validate\x20template\x20YAML\x20files','name'];a25_0x5ca5=function(){return _0x4fe902;};return a25_0x5ca5();}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x33be(_0x1d9437,_0x2d1608){_0x1d9437=_0x1d9437-0x127;const _0x5ca549=a25_0x5ca5();let _0x33be08=_0x5ca549[_0x1d9437];return _0x33be08;}import{existsSync}from'fs';import a25_0x506ad8 from'chalk';import a25_0x3b9e7d from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x1a5222(0x136)]=a25_0x1a5222(0x141);[a25_0x1a5222(0x13d)]=a25_0x1a5222(0x135);async['execute'](_0x437511){const _0x496021=a25_0x1a5222,{options:_0x5568ef,args:_0x4525f3}=_0x437511,_0x3571a7=_0x5568ef,_0x4e1bd0=_0x4525f3[0x0],_0xfbd574=_0x4e1bd0?a25_0x3b9e7d['resolve'](_0x4e1bd0):undefined,_0x5462f1=_0xfbd574?isYamlFile(_0xfbd574):![];let _0x1ff680,_0x585bc4;if(_0x5462f1&&_0xfbd574)_0x1ff680=a25_0x3b9e7d[_0x496021(0x14a)](_0xfbd574),_0x585bc4=_0xfbd574;else _0xfbd574?_0x1ff680=_0xfbd574:_0x1ff680=process[_0x496021(0x151)]();if(!_0x585bc4&&!existsSync(_0x1ff680))return console[_0x496021(0x142)](a25_0x506ad8['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x1ff680+'\x0a')),0x1;let _0x42a0a6;if(_0x585bc4){if(!_0x585bc4[_0x496021(0x14f)](_0x496021(0x140))&&!_0x585bc4[_0x496021(0x14f)](_0x496021(0x14c)))return console[_0x496021(0x142)](a25_0x506ad8['red'](_0x496021(0x13f)+_0x585bc4+'\x0a')),0x1;_0x42a0a6=[_0x585bc4];}else _0x42a0a6=findYamlFiles(_0x1ff680);if(_0x42a0a6[_0x496021(0x12c)]===0x0)return console[_0x496021(0x142)](a25_0x506ad8[_0x496021(0x13c)](_0x496021(0x128)+_0x1ff680+'\x0a')),0x1;const _0x4ec7f4=validateYamlFiles(_0x42a0a6,_0x1ff680,{'filterType':_0x496021(0x14d)}),_0x181cf5=calculateSummary(_0x4ec7f4),_0x39cb2c=_0x4ec7f4['filter'](isValidationResult);if(_0x39cb2c[_0x496021(0x12c)]===0x0)return console['error'](a25_0x506ad8[_0x496021(0x155)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x1ff680+'\x0a')),_0x181cf5['skippedCount']>0x0&&console[_0x496021(0x142)](a25_0x506ad8['dim']('('+_0x181cf5[_0x496021(0x14b)]+_0x496021(0x12b))),0x0;for(const _0x5aaa61 of _0x4ec7f4){if(!isValidationResult(_0x5aaa61)){_0x3571a7['verbose']&&console['log'](a25_0x506ad8[_0x496021(0x12d)]('-\x20'+_0x5aaa61[_0x496021(0x145)]+_0x496021(0x152)+_0x5aaa61['reason']+')'));continue;}const {relativePath:_0x186656,source:_0x58e49f,result:_0x468378}=_0x5aaa61;if(_0x468378[_0x496021(0x146)]&&_0x468378['warnings'][_0x496021(0x12c)]===0x0)_0x3571a7['verbose']&&console[_0x496021(0x127)](a25_0x506ad8['green']('✔\x20'+_0x186656));else _0x468378[_0x496021(0x146)]?(console[_0x496021(0x127)](a25_0x506ad8[_0x496021(0x155)]('⚠\x20'+_0x186656+':\x20'+_0x468378[_0x496021(0x129)]['length']+_0x496021(0x12e))),console['log'](formatValidationResult(_0x468378,_0x58e49f,_0x186656))):(console[_0x496021(0x127)](a25_0x506ad8['red']('✖\x20'+_0x186656+':\x20'+_0x468378[_0x496021(0x13a)][_0x496021(0x12c)]+'\x20error(s)')),console['log'](formatValidationResult(_0x468378,_0x58e49f,_0x186656)));}return console['log'](''),_0x181cf5[_0x496021(0x144)]?(console[_0x496021(0x127)](a25_0x506ad8[_0x496021(0x13c)]('Validation\x20failed:\x20'+_0x181cf5[_0x496021(0x14e)]+_0x496021(0x143)+_0x181cf5[_0x496021(0x137)]+_0x496021(0x130))),_0x181cf5[_0x496021(0x154)]>0x0&&console['log'](a25_0x506ad8[_0x496021(0x155)](_0x181cf5[_0x496021(0x154)]+_0x496021(0x149))),_0x181cf5['skippedCount']>0x0&&console[_0x496021(0x127)](a25_0x506ad8['dim'](_0x181cf5[_0x496021(0x14b)]+_0x496021(0x13e))),0x1):(console['log'](a25_0x506ad8[_0x496021(0x12f)](_0x496021(0x150)+_0x181cf5['validCount']+_0x496021(0x12a))),_0x181cf5[_0x496021(0x154)]>0x0&&console['log'](a25_0x506ad8[_0x496021(0x155)](_0x181cf5[_0x496021(0x154)]+_0x496021(0x149))),_0x181cf5[_0x496021(0x14b)]>0x0&&console['log'](a25_0x506ad8['dim'](_0x181cf5[_0x496021(0x14b)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x5c5c6f=a26_0x1c2e;(function(_0x12b101,_0x2327f4){const _0x123cc7=a26_0x1c2e,_0x826453=_0x12b101();while(!![]){try{const _0x8b78b0=-parseInt(_0x123cc7(0x1ed))/0x1+-parseInt(_0x123cc7(0x1d9))/0x2+-parseInt(_0x123cc7(0x1d0))/0x3+-parseInt(_0x123cc7(0x1ef))/0x4*(-parseInt(_0x123cc7(0x1e2))/0x5)+parseInt(_0x123cc7(0x20a))/0x6*(-parseInt(_0x123cc7(0x21f))/0x7)+parseInt(_0x123cc7(0x20f))/0x8+parseInt(_0x123cc7(0x1e7))/0x9;if(_0x8b78b0===_0x2327f4)break;else _0x826453['push'](_0x826453['shift']());}catch(_0x260e2b){_0x826453['push'](_0x826453['shift']());}}}(a26_0x264d,0xecbaa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a26_0x264d(){const _0x31d83f=['created_at','Getting\x20job\x20details...','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Getting\x20job\x20results...','show','11374452slkBLY','\x20row','abs','jobs','job:submit','5187560ATGeWD','Submitting\x20job...','limit','args','job:show','Show\x20job\x20details','verbose','end_at','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','red','h\x20ago','type','Cancelled','dim','list','validate','7yPwWTO','Database:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','success','error','✔\x20Job\x20submitted','url','5198496BzNMmQ','job_id','file','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','now','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','just\x20now','Query:\x20','status','3530642aVuPVC','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','map','Submit\x20a\x20job','query','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','✔\x20Retrieved\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','391385rijDND','substring','floor','result','No\x20SQL\x20statements\x20found\x20in\x20file','40386933SOTYJl','\x20job','Status\x20filter:\x20','database','m\x20ago','trino','572716nQCuiZ','priority','92Jwkzgu','presto','data','log','\x20jobs','\x20\x20Job\x20ID:\x20','push','Kill\x20a\x20job','mo\x20ago','Listing\x20jobs...','name','start_at','Submitting\x20kill\x20request...','user_name','round','INVALID_ARGUMENT','description','execute','length','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','List\x20jobs','getTime'];a26_0x264d=function(){return _0x31d83f;};return a26_0x264d();}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';function a26_0x1c2e(_0x2270e8,_0x7a350c){_0x2270e8=_0x2270e8-0x1cb;const _0x264d47=a26_0x264d();let _0x1c2e81=_0x264d47[_0x2270e8];return _0x1c2e81;}import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x38e5f7 from'chalk';function formatDuration(_0x17a112){const _0x327667=a26_0x1c2e;if(_0x17a112<0x3c)return _0x17a112+'s';if(_0x17a112<0xe10)return Math['floor'](_0x17a112/0x3c)+'m\x20'+_0x17a112%0x3c+'s';const _0x4287bb=Math[_0x327667(0x1e4)](_0x17a112/0xe10),_0x4af459=Math[_0x327667(0x1e4)](_0x17a112%0xe10/0x3c);return _0x4af459>0x0?_0x4287bb+'h\x20'+_0x4af459+'m':_0x4287bb+'h';}function formatRelativeTime(_0xdebd9d){const _0x5262df=a26_0x1c2e,_0x48d8b4=Date[_0x5262df(0x1d4)]()-_0xdebd9d[_0x5262df(0x204)](),_0x407afb=Math[_0x5262df(0x1e4)](Math[_0x5262df(0x20c)](_0x48d8b4)/0x3e8);if(_0x407afb<0x3c)return _0x5262df(0x1d6);const _0x311d06=Math[_0x5262df(0x1e4)](_0x407afb/0x3c);if(_0x311d06<0x3c)return _0x311d06+_0x5262df(0x1eb);const _0x599e51=Math[_0x5262df(0x1e4)](_0x311d06/0x3c);if(_0x599e51<0x18)return _0x599e51+_0x5262df(0x219);const _0x23f66f=Math[_0x5262df(0x1e4)](_0x599e51/0x18);if(_0x23f66f<0x1e)return _0x23f66f+_0x5262df(0x1df);return Math[_0x5262df(0x1e4)](_0x23f66f/0x1e)+_0x5262df(0x1f7);}export class JobListCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='jobs';[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x203);async['execute'](_0x200190){const _0x495ac7=a26_0x5c5c6f,{options:_0x459fdd,tdx:_0x31129f}=_0x200190,_0x1425a8=resolveLimit(_0x459fdd[_0x495ac7(0x211)],DEFAULT_DISPLAY_LIMIT),_0x41b436=_0x459fdd['status'];_0x459fdd[_0x495ac7(0x215)]&&(console[_0x495ac7(0x1cd)]('Limit:\x20'+_0x1425a8+_0x495ac7(0x1f3)),_0x41b436&&console[_0x495ac7(0x1cd)](_0x495ac7(0x1e9)+_0x41b436));const _0x5c8f2b=await withSpinner(_0x495ac7(0x1f8),()=>_0x31129f[_0x495ac7(0x20d)][_0x495ac7(0x21d)]({'from':0x0,'to':_0x1425a8-0x1,'status':_0x41b436}),{'verbose':_0x459fdd[_0x495ac7(0x215)]}),_0x5a7d79=_0x5c8f2b['data'];console[_0x495ac7(0x1cd)]('✔\x20Found\x20'+_0x5a7d79[_0x495ac7(0x201)]+_0x495ac7(0x1e8)+(_0x5a7d79[_0x495ac7(0x201)]!==0x1?'s':''));const _0x15003b=_0x459fdd['site'];if(isStructuredFormat(_0x459fdd)){const _0x5cd8ca=_0x5a7d79[_0x495ac7(0x1db)](_0xa54de=>{const _0x21f158=_0x495ac7;let _0x3084b7;if(_0xa54de[_0x21f158(0x1fa)]&&_0xa54de[_0x21f158(0x216)]){const _0x36f586=new Date(_0xa54de['start_at'])[_0x21f158(0x204)](),_0xdb139d=new Date(_0xa54de[_0x21f158(0x216)])[_0x21f158(0x204)]();_0x3084b7=Math[_0x21f158(0x1fd)]((_0xdb139d-_0x36f586)/0x3e8);}return{'job_id':_0xa54de[_0x21f158(0x1d1)],'type':_0xa54de[_0x21f158(0x21a)]===_0x21f158(0x1f0)?_0x21f158(0x1ec):_0xa54de[_0x21f158(0x21a)],'status':_0xa54de['status'],'user_name':_0xa54de[_0x21f158(0x1fc)],'duration_sec':_0x3084b7,'created_at':_0xa54de[_0x21f158(0x205)],'started_at':_0xa54de[_0x21f158(0x1fa)],'end_at':_0xa54de[_0x21f158(0x216)]};});await handleSDKOutput(_0x5cd8ca,_0x459fdd);}else for(const _0xe78b0e of _0x5a7d79){const _0x1dd4b7=_0xe78b0e['status']===_0x495ac7(0x1cc)?a26_0x38e5f7['green']:_0xe78b0e[_0x495ac7(0x1d8)]==='error'?a26_0x38e5f7[_0x495ac7(0x218)]:a26_0x38e5f7['dim'],_0x17ee94=_0x1dd4b7(_0xe78b0e[_0x495ac7(0x1d8)]),_0x130b09=getJobUrl(_0x15003b,_0xe78b0e['job_id']),_0x14cb6f=hyperlink(_0xe78b0e[_0x495ac7(0x1d1)],_0x130b09),_0x278c7d=a26_0x38e5f7['dim'](_0xe78b0e[_0x495ac7(0x21a)]==='presto'?_0x495ac7(0x1ec):_0xe78b0e['type']),_0x23fedd=[];if(_0xe78b0e['start_at']&&_0xe78b0e[_0x495ac7(0x216)]){const _0x2b98f1=Math[_0x495ac7(0x1fd)]((new Date(_0xe78b0e['end_at'])[_0x495ac7(0x204)]()-new Date(_0xe78b0e[_0x495ac7(0x1fa)])[_0x495ac7(0x204)]())/0x3e8);_0x23fedd['push'](formatDuration(_0x2b98f1));}if(_0xe78b0e[_0x495ac7(0x216)])_0x23fedd[_0x495ac7(0x1f5)](formatRelativeTime(new Date(_0xe78b0e[_0x495ac7(0x216)])));else _0xe78b0e[_0x495ac7(0x1fa)]&&_0x23fedd[_0x495ac7(0x1f5)](formatRelativeTime(new Date(_0xe78b0e[_0x495ac7(0x1fa)])));const _0x60223e=_0x23fedd[_0x495ac7(0x201)]>0x0?a26_0x38e5f7[_0x495ac7(0x21c)]('\x20'+_0x23fedd['join'](',\x20')):'';console[_0x495ac7(0x1f2)]('⚡\x20'+_0x14cb6f+'\x20'+_0x278c7d+'\x20'+_0x17ee94+_0x60223e);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]=a26_0x5c5c6f(0x213);['description']=a26_0x5c5c6f(0x214);[a26_0x5c5c6f(0x21e)](_0x4d71f8){const _0x5b38c7=a26_0x5c5c6f,_0x21e143=_0x4d71f8[_0x5b38c7(0x212)][0x0];if(!_0x21e143)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x5c5c6f(0x200)](_0x11dcb3){const _0x5cef74=a26_0x5c5c6f,{options:_0x4f88e6,args:_0x1aee4e,tdx:_0x495996}=_0x11dcb3,_0x421290=_0x1aee4e[0x0],_0x3d8ed7=await withSpinner(_0x5cef74(0x206),()=>_0x495996['jobs'][_0x5cef74(0x209)](_0x421290),{'verbose':_0x4f88e6[_0x5cef74(0x215)]}),_0x2b105f=_0x3d8ed7[_0x5cef74(0x1f1)];let _0x5bda2d;if(_0x2b105f[_0x5cef74(0x1fa)]&&_0x2b105f[_0x5cef74(0x216)]){const _0x114b3a=new Date(_0x2b105f[_0x5cef74(0x1fa)])['getTime'](),_0x41a770=new Date(_0x2b105f[_0x5cef74(0x216)])[_0x5cef74(0x204)]();_0x5bda2d=Math[_0x5cef74(0x1fd)]((_0x41a770-_0x114b3a)/0x3e8);}const _0x533f2b={'job_id':_0x2b105f[_0x5cef74(0x1d1)],'type':_0x2b105f['type'],'status':_0x2b105f[_0x5cef74(0x1d8)],..._0x2b105f['user_name']&&{'user_name':_0x2b105f[_0x5cef74(0x1fc)]},..._0x5bda2d!==undefined&&{'duration_sec':_0x5bda2d},..._0x2b105f['created_at']&&{'created_at':_0x2b105f['created_at']},..._0x2b105f[_0x5cef74(0x1fa)]&&{'started_at':_0x2b105f[_0x5cef74(0x1fa)]},..._0x2b105f[_0x5cef74(0x216)]&&{'end_at':_0x2b105f[_0x5cef74(0x216)]},..._0x2b105f[_0x5cef74(0x1ea)]&&{'database':_0x2b105f['database']},..._0x2b105f['priority']!==undefined&&{'priority':_0x2b105f[_0x5cef74(0x1ee)]},..._0x2b105f[_0x5cef74(0x1cf)]&&{'url':_0x2b105f[_0x5cef74(0x1cf)]},..._0x2b105f[_0x5cef74(0x1dd)]&&{'query':_0x2b105f[_0x5cef74(0x1dd)]},..._0x2b105f['debug']&&{'debug':_0x2b105f['debug']}};return await handleSingleObjectOutput(_0x533f2b,_0x4f88e6),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='job:kill';[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x1f6);[a26_0x5c5c6f(0x21e)](_0x252081){const _0x39d2ef=a26_0x5c5c6f,_0x1b2375=_0x252081[_0x39d2ef(0x212)][0x0];if(!_0x1b2375)return _0x39d2ef(0x1e1);return undefined;}async['execute'](_0x53371b){const _0x439f56=a26_0x5c5c6f,{options:_0x44d1e1,args:_0x333a20,tdx:_0x43d060}=_0x53371b,_0x30486f=_0x333a20[0x0];if(!_0x44d1e1['yes']){const _0x2ce7cf=await confirm(_0x439f56(0x1d5)+_0x30486f+'?');if(!_0x2ce7cf)return console[_0x439f56(0x1cd)](_0x439f56(0x21b)),0x0;}return await withSpinner(_0x439f56(0x1fb),()=>_0x43d060['jobs']['kill'](_0x30486f),{'verbose':_0x44d1e1[_0x439f56(0x215)]}),console[_0x439f56(0x1cd)](_0x439f56(0x202)+_0x30486f),console[_0x439f56(0x1cd)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x30486f+_0x439f56(0x1cb)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]=a26_0x5c5c6f(0x20e);[a26_0x5c5c6f(0x1ff)]=a26_0x5c5c6f(0x1dc);async[a26_0x5c5c6f(0x200)](_0x1a447a){const _0xa89e1a=a26_0x5c5c6f,{options:_0x5ba98f,args:_0x106407,tdx:_0x5b94aa}=_0x1a447a,_0x24c89b=_0x5ba98f['jobType']||'trino',_0x48c130=_0x5ba98f[_0xa89e1a(0x1d2)],_0x5a4d4b=_0x5ba98f[_0xa89e1a(0x1ea)]||'information_schema',_0x59b144=_0x5ba98f[_0xa89e1a(0x1e5)];if(_0x24c89b!==_0xa89e1a(0x1ec)&&_0x24c89b!=='hive')throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x217));let _0xb5e2;if(_0x48c130){if(_0x106407[0x0])throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x1de));const _0x58a707=readSqlStatementsFromFile(_0x48c130);if(_0x58a707[_0xa89e1a(0x201)]===0x0)throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x1e6));if(_0x58a707[_0xa89e1a(0x201)]>0x1)throw new SDKError(ErrorCode[_0xa89e1a(0x1fe)],_0xa89e1a(0x207));_0xb5e2=_0x58a707[0x0];}else{if(!_0x106407[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xa89e1a(0x1da));_0xb5e2=_0x106407[0x0];}_0x5ba98f[_0xa89e1a(0x215)]&&(console[_0xa89e1a(0x1cd)]('Job\x20type:\x20'+_0x24c89b),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x220)+_0x5a4d4b),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x1d7)+_0xb5e2[_0xa89e1a(0x1e3)](0x0,0x64)+(_0xb5e2[_0xa89e1a(0x201)]>0x64?'...':'')));const _0x2ebcc8=await withSpinner(_0xa89e1a(0x210),()=>_0x5b94aa[_0xa89e1a(0x20d)]['submit'](_0x5a4d4b,_0xb5e2,_0x24c89b,_0x59b144),{'verbose':_0x5ba98f[_0xa89e1a(0x215)]}),_0x2def73=_0x2ebcc8[_0xa89e1a(0x1f1)];return console['error'](_0xa89e1a(0x1ce)),console[_0xa89e1a(0x1cd)](_0xa89e1a(0x1f4)+_0x2def73[_0xa89e1a(0x1d1)]),await handleSDKOutput([_0x2def73],_0x5ba98f),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x5c5c6f(0x1f9)]='job:result';['description']='Get\x20job\x20results';[a26_0x5c5c6f(0x21e)](_0x19c577){const _0x46bd59=a26_0x5c5c6f,_0x34f444=_0x19c577[_0x46bd59(0x212)][0x0];if(!_0x34f444)return _0x46bd59(0x1d3);return undefined;}async['execute'](_0x1ced31){const _0x1fab5b=a26_0x5c5c6f,{options:_0xce332,args:_0x4f04f7,tdx:_0x44a963}=_0x1ced31,_0x542ce3=_0x4f04f7[0x0],_0xe76915=await withSpinner(_0x1fab5b(0x208),()=>_0x44a963[_0x1fab5b(0x20d)]['result'](_0x542ce3),{'verbose':_0xce332[_0x1fab5b(0x215)]}),_0x822eeb=_0xe76915[_0x1fab5b(0x1f1)];return console['error'](_0x1fab5b(0x1e0)+_0x822eeb['length']+_0x1fab5b(0x20b)+(_0x822eeb[_0x1fab5b(0x201)]!==0x1?'s':'')),await handleSDKOutput(_0x822eeb,_0xce332),0x0;}}
|
|
1
|
+
const a26_0x15ed47=a26_0x441f;(function(_0x2f939d,_0x259fca){const _0x1f30ed=a26_0x441f,_0x15b813=_0x2f939d();while(!![]){try{const _0x2780c0=-parseInt(_0x1f30ed(0x162))/0x1+parseInt(_0x1f30ed(0x17a))/0x2*(-parseInt(_0x1f30ed(0x161))/0x3)+parseInt(_0x1f30ed(0x175))/0x4*(-parseInt(_0x1f30ed(0x195))/0x5)+parseInt(_0x1f30ed(0x1ad))/0x6*(-parseInt(_0x1f30ed(0x19d))/0x7)+-parseInt(_0x1f30ed(0x196))/0x8+-parseInt(_0x1f30ed(0x17e))/0x9+parseInt(_0x1f30ed(0x18b))/0xa;if(_0x2780c0===_0x259fca)break;else _0x15b813['push'](_0x15b813['shift']());}catch(_0x20a637){_0x15b813['push'](_0x15b813['shift']());}}}(a26_0x3956,0xdd648));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a26_0x3956(){const _0xeea68=['Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job_id','url','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','created_at','substring','success','jobType','268572ieHaLP','debug','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','INVALID_ARGUMENT','now','2hNJvrS','information_schema','job:kill','file','10171683eFjJQR','validate','\x20row','yes','Query:\x20','data','user_name','red','error','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','getTime','Submitting\x20job...','log','80603530dcDCXY','length','✔\x20Retrieved\x20','trino','just\x20now','site','h\x20ago','Getting\x20job\x20results...','verbose','dim','30JtITxo','6344344laVAoW','result','kill','List\x20jobs','...','database','Limit:\x20','1570506MbAKBv','green','jobs','job:submit','submit','\x20\x20Job\x20ID:\x20','start_at','push','name','join','args','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','floor','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','48VYBFHf','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submitting\x20kill\x20request...','round','mo\x20ago','Listing\x20jobs...','query','✔\x20Job\x20submitted','description','Getting\x20job\x20details...','Status\x20filter:\x20','map','4678644JELemv','1473029QlNYCh','Job\x20type:\x20','Submit\x20a\x20job','execute','Get\x20job\x20results','job:show','status','✔\x20Found\x20','type','priority','abs'];a26_0x3956=function(){return _0xeea68;};return a26_0x3956();}import{getJobUrl}from'../sdk/client/endpoints.js';function a26_0x441f(_0x580599,_0x388d46){_0x580599=_0x580599-0x158;const _0x395694=a26_0x3956();let _0x441f4b=_0x395694[_0x580599];return _0x441f4b;}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x139651 from'chalk';function formatDuration(_0x41dffc){const _0xb3a063=a26_0x441f;if(_0x41dffc<0x3c)return _0x41dffc+'s';if(_0x41dffc<0xe10)return Math[_0xb3a063(0x1aa)](_0x41dffc/0x3c)+'m\x20'+_0x41dffc%0x3c+'s';const _0x3d04e4=Math[_0xb3a063(0x1aa)](_0x41dffc/0xe10),_0x3eb6ec=Math[_0xb3a063(0x1aa)](_0x41dffc%0xe10/0x3c);return _0x3eb6ec>0x0?_0x3d04e4+'h\x20'+_0x3eb6ec+'m':_0x3d04e4+'h';}function formatRelativeTime(_0x4598e1){const _0x112b33=a26_0x441f,_0x5f310e=Date[_0x112b33(0x179)]()-_0x4598e1[_0x112b33(0x188)](),_0x10a6ff=Math[_0x112b33(0x1aa)](Math[_0x112b33(0x16c)](_0x5f310e)/0x3e8);if(_0x10a6ff<0x3c)return _0x112b33(0x18f);const _0x36f629=Math[_0x112b33(0x1aa)](_0x10a6ff/0x3c);if(_0x36f629<0x3c)return _0x36f629+'m\x20ago';const _0x50a0cd=Math[_0x112b33(0x1aa)](_0x36f629/0x3c);if(_0x50a0cd<0x18)return _0x50a0cd+_0x112b33(0x191);const _0x2df986=Math[_0x112b33(0x1aa)](_0x50a0cd/0x18);if(_0x2df986<0x1e)return _0x2df986+'d\x20ago';return Math[_0x112b33(0x1aa)](_0x2df986/0x1e)+_0x112b33(0x159);}export class JobListCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x19f);['description']=a26_0x15ed47(0x199);async['execute'](_0xd5047d){const _0x4ba03e=a26_0x15ed47,{options:_0x3e78c3,tdx:_0x163a4f}=_0xd5047d,_0x39f0f8=resolveLimit(_0x3e78c3['limit'],DEFAULT_DISPLAY_LIMIT),_0x310cf3=_0x3e78c3[_0x4ba03e(0x168)];_0x3e78c3['verbose']&&(console[_0x4ba03e(0x186)](_0x4ba03e(0x19c)+_0x39f0f8+'\x20jobs'),_0x310cf3&&console['error'](_0x4ba03e(0x15f)+_0x310cf3));const _0x5615dd=await withSpinner(_0x4ba03e(0x15a),()=>_0x163a4f[_0x4ba03e(0x19f)]['list']({'from':0x0,'to':_0x39f0f8-0x1,'status':_0x310cf3}),{'verbose':_0x3e78c3[_0x4ba03e(0x193)]}),_0x2777fc=_0x5615dd[_0x4ba03e(0x183)];console[_0x4ba03e(0x186)](_0x4ba03e(0x169)+_0x2777fc[_0x4ba03e(0x18c)]+'\x20job'+(_0x2777fc[_0x4ba03e(0x18c)]!==0x1?'s':''));const _0x1f09d1=_0x3e78c3[_0x4ba03e(0x190)];if(isStructuredFormat(_0x3e78c3)){const _0x10a81b=_0x2777fc[_0x4ba03e(0x160)](_0x3fb419=>{const _0x93da33=_0x4ba03e;let _0x5dc4b4;if(_0x3fb419[_0x93da33(0x1a3)]&&_0x3fb419[_0x93da33(0x1ab)]){const _0x2a4b9a=new Date(_0x3fb419[_0x93da33(0x1a3)])['getTime'](),_0x12fbea=new Date(_0x3fb419[_0x93da33(0x1ab)])[_0x93da33(0x188)]();_0x5dc4b4=Math[_0x93da33(0x158)]((_0x12fbea-_0x2a4b9a)/0x3e8);}return{'job_id':_0x3fb419[_0x93da33(0x16e)],'type':_0x3fb419['type']==='presto'?_0x93da33(0x18e):_0x3fb419[_0x93da33(0x16a)],'status':_0x3fb419['status'],'user_name':_0x3fb419[_0x93da33(0x184)],'duration_sec':_0x5dc4b4,'created_at':_0x3fb419['created_at'],'started_at':_0x3fb419[_0x93da33(0x1a3)],'end_at':_0x3fb419[_0x93da33(0x1ab)]};});await handleSDKOutput(_0x10a81b,_0x3e78c3);}else for(const _0x2e438c of _0x2777fc){const _0x34eddc=_0x2e438c[_0x4ba03e(0x168)]===_0x4ba03e(0x173)?a26_0x139651[_0x4ba03e(0x19e)]:_0x2e438c[_0x4ba03e(0x168)]===_0x4ba03e(0x186)?a26_0x139651[_0x4ba03e(0x185)]:a26_0x139651[_0x4ba03e(0x194)],_0x48f6eb=_0x34eddc(_0x2e438c[_0x4ba03e(0x168)]),_0x4b8f3e=getJobUrl(_0x1f09d1,_0x2e438c['job_id']),_0x4fe026=hyperlink(_0x2e438c[_0x4ba03e(0x16e)],_0x4b8f3e),_0x3b1185=a26_0x139651[_0x4ba03e(0x194)](_0x2e438c[_0x4ba03e(0x16a)]==='presto'?_0x4ba03e(0x18e):_0x2e438c['type']),_0x402f89=[];if(_0x2e438c[_0x4ba03e(0x1a3)]&&_0x2e438c[_0x4ba03e(0x1ab)]){const _0x2dbe98=Math[_0x4ba03e(0x158)]((new Date(_0x2e438c[_0x4ba03e(0x1ab)])['getTime']()-new Date(_0x2e438c[_0x4ba03e(0x1a3)])['getTime']())/0x3e8);_0x402f89[_0x4ba03e(0x1a4)](formatDuration(_0x2dbe98));}if(_0x2e438c[_0x4ba03e(0x1ab)])_0x402f89[_0x4ba03e(0x1a4)](formatRelativeTime(new Date(_0x2e438c['end_at'])));else _0x2e438c[_0x4ba03e(0x1a3)]&&_0x402f89[_0x4ba03e(0x1a4)](formatRelativeTime(new Date(_0x2e438c[_0x4ba03e(0x1a3)])));const _0x5334bc=_0x402f89[_0x4ba03e(0x18c)]>0x0?a26_0x139651[_0x4ba03e(0x194)]('\x20'+_0x402f89[_0x4ba03e(0x1a6)](',\x20')):'';console[_0x4ba03e(0x18a)]('⚡\x20'+_0x4fe026+'\x20'+_0x3b1185+'\x20'+_0x48f6eb+_0x5334bc);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x167);[a26_0x15ed47(0x15d)]='Show\x20job\x20details';['validate'](_0x2d96b3){const _0x4846aa=a26_0x15ed47,_0x206755=_0x2d96b3[_0x4846aa(0x1a7)][0x0];if(!_0x206755)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x15ed47(0x165)](_0x35101b){const _0xd8d800=a26_0x15ed47,{options:_0x219d09,args:_0x3ca8c6,tdx:_0x2b6f05}=_0x35101b,_0x293252=_0x3ca8c6[0x0],_0x56be8b=await withSpinner(_0xd8d800(0x15e),()=>_0x2b6f05[_0xd8d800(0x19f)]['show'](_0x293252),{'verbose':_0x219d09[_0xd8d800(0x193)]}),_0xd02e01=_0x56be8b[_0xd8d800(0x183)];let _0x4a1dab;if(_0xd02e01[_0xd8d800(0x1a3)]&&_0xd02e01[_0xd8d800(0x1ab)]){const _0x1d7a8d=new Date(_0xd02e01['start_at'])['getTime'](),_0x3d35cf=new Date(_0xd02e01[_0xd8d800(0x1ab)])['getTime']();_0x4a1dab=Math[_0xd8d800(0x158)]((_0x3d35cf-_0x1d7a8d)/0x3e8);}const _0x1db267={'job_id':_0xd02e01['job_id'],'type':_0xd02e01[_0xd8d800(0x16a)],'status':_0xd02e01[_0xd8d800(0x168)],..._0xd02e01[_0xd8d800(0x184)]&&{'user_name':_0xd02e01[_0xd8d800(0x184)]},..._0x4a1dab!==undefined&&{'duration_sec':_0x4a1dab},..._0xd02e01[_0xd8d800(0x171)]&&{'created_at':_0xd02e01['created_at']},..._0xd02e01['start_at']&&{'started_at':_0xd02e01[_0xd8d800(0x1a3)]},..._0xd02e01[_0xd8d800(0x1ab)]&&{'end_at':_0xd02e01[_0xd8d800(0x1ab)]},..._0xd02e01[_0xd8d800(0x19b)]&&{'database':_0xd02e01[_0xd8d800(0x19b)]},..._0xd02e01[_0xd8d800(0x16b)]!==undefined&&{'priority':_0xd02e01[_0xd8d800(0x16b)]},..._0xd02e01[_0xd8d800(0x16f)]&&{'url':_0xd02e01[_0xd8d800(0x16f)]},..._0xd02e01[_0xd8d800(0x15b)]&&{'query':_0xd02e01['query']},..._0xd02e01[_0xd8d800(0x176)]&&{'debug':_0xd02e01['debug']}};return await handleSingleObjectOutput(_0x1db267,_0x219d09),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x15ed47(0x17c);['description']='Kill\x20a\x20job';['validate'](_0x5882cd){const _0x1fd88b=a26_0x15ed47,_0x33ae56=_0x5882cd[_0x1fd88b(0x1a7)][0x0];if(!_0x33ae56)return _0x1fd88b(0x170);return undefined;}async['execute'](_0xd781b){const _0x3b8dfb=a26_0x15ed47,{options:_0x227777,args:_0x4408f3,tdx:_0x41a841}=_0xd781b,_0x5790db=_0x4408f3[0x0];if(!_0x227777[_0x3b8dfb(0x181)]){const _0x2ed42c=await confirm(_0x3b8dfb(0x177)+_0x5790db+'?');if(!_0x2ed42c)return console[_0x3b8dfb(0x186)]('Cancelled'),0x0;}return await withSpinner(_0x3b8dfb(0x1af),()=>_0x41a841['jobs'][_0x3b8dfb(0x198)](_0x5790db),{'verbose':_0x227777['verbose']}),console[_0x3b8dfb(0x186)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x5790db),console[_0x3b8dfb(0x186)](_0x3b8dfb(0x1a8)+_0x5790db+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x1a0);[a26_0x15ed47(0x15d)]=a26_0x15ed47(0x164);async['execute'](_0x1ecccb){const _0x16e6f2=a26_0x15ed47,{options:_0x83cd82,args:_0x52bf41,tdx:_0x480fec}=_0x1ecccb,_0x3f5f9b=_0x83cd82[_0x16e6f2(0x174)]||_0x16e6f2(0x18e),_0x470d9d=_0x83cd82[_0x16e6f2(0x17d)],_0x225e2a=_0x83cd82[_0x16e6f2(0x19b)]||_0x16e6f2(0x17b),_0x21e05b=_0x83cd82[_0x16e6f2(0x197)];if(_0x3f5f9b!=='trino'&&_0x3f5f9b!=='hive')throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x187));let _0x7b0daa;if(_0x470d9d){if(_0x52bf41[0x0])throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x1ae));const _0x391f7b=readSqlStatementsFromFile(_0x470d9d);if(_0x391f7b[_0x16e6f2(0x18c)]===0x0)throw new SDKError(ErrorCode[_0x16e6f2(0x178)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x391f7b[_0x16e6f2(0x18c)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x16e6f2(0x1a9));_0x7b0daa=_0x391f7b[0x0];}else{if(!_0x52bf41[0x0])throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x16d));_0x7b0daa=_0x52bf41[0x0];}_0x83cd82[_0x16e6f2(0x193)]&&(console[_0x16e6f2(0x186)](_0x16e6f2(0x163)+_0x3f5f9b),console['error']('Database:\x20'+_0x225e2a),console[_0x16e6f2(0x186)](_0x16e6f2(0x182)+_0x7b0daa[_0x16e6f2(0x172)](0x0,0x64)+(_0x7b0daa[_0x16e6f2(0x18c)]>0x64?_0x16e6f2(0x19a):'')));const _0x26c54c=await withSpinner(_0x16e6f2(0x189),()=>_0x480fec[_0x16e6f2(0x19f)][_0x16e6f2(0x1a1)](_0x225e2a,_0x7b0daa,_0x3f5f9b,_0x21e05b),{'verbose':_0x83cd82[_0x16e6f2(0x193)]}),_0x44a5a4=_0x26c54c[_0x16e6f2(0x183)];return console[_0x16e6f2(0x186)](_0x16e6f2(0x15c)),console[_0x16e6f2(0x186)](_0x16e6f2(0x1a2)+_0x44a5a4[_0x16e6f2(0x16e)]),await handleSDKOutput([_0x44a5a4],_0x83cd82),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a26_0x15ed47(0x15d)]=a26_0x15ed47(0x166);[a26_0x15ed47(0x17f)](_0x1d1d97){const _0x287bcb=a26_0x15ed47,_0x2c65f8=_0x1d1d97[_0x287bcb(0x1a7)][0x0];if(!_0x2c65f8)return _0x287bcb(0x1ac);return undefined;}async[a26_0x15ed47(0x165)](_0x448982){const _0x185fd2=a26_0x15ed47,{options:_0x2d61b6,args:_0x5c3d98,tdx:_0x41a907}=_0x448982,_0x552ce2=_0x5c3d98[0x0],_0x1a9224=await withSpinner(_0x185fd2(0x192),()=>_0x41a907[_0x185fd2(0x19f)]['result'](_0x552ce2),{'verbose':_0x2d61b6[_0x185fd2(0x193)]}),_0x17702a=_0x1a9224[_0x185fd2(0x183)];return console[_0x185fd2(0x186)](_0x185fd2(0x18d)+_0x17702a[_0x185fd2(0x18c)]+_0x185fd2(0x180)+(_0x17702a[_0x185fd2(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x17702a,_0x2d61b6),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x5627fc=a27_0x43a0;(function(_0x52149c,_0x1b2ebc){const _0x3f357a=a27_0x43a0,_0x127300=_0x52149c();while(!![]){try{const _0x54f7e2=-parseInt(_0x3f357a(0xcd))/0x1*(parseInt(_0x3f357a(0x106))/0x2)+-parseInt(_0x3f357a(0x145))/0x3*(-parseInt(_0x3f357a(0x162))/0x4)+parseInt(_0x3f357a(0xd2))/0x5+parseInt(_0x3f357a(0x17b))/0x6+-parseInt(_0x3f357a(0x197))/0x7+-parseInt(_0x3f357a(0x13e))/0x8*(-parseInt(_0x3f357a(0x125))/0x9)+-parseInt(_0x3f357a(0xab))/0xa;if(_0x54f7e2===_0x1b2ebc)break;else _0x127300['push'](_0x127300['shift']());}catch(_0x567bbd){_0x127300['push'](_0x127300['shift']());}}}(a27_0xdeb3,0x9dab4));import a27_0x442aed from'chalk';import a27_0x26af62 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';function a27_0x43a0(_0x7338de,_0xae8de8){_0x7338de=_0x7338de-0x94;const _0xdeb320=a27_0xdeb3();let _0x43a0e1=_0xdeb320[_0x7338de];return _0x43a0e1;}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x5d51a9){const _0x2992e8=a27_0x43a0;return!_0x5d51a9&&(console[_0x2992e8(0x14e)](_0x2992e8(0x9a)),console[_0x2992e8(0x14e)](_0x2992e8(0xae))),!!_0x5d51a9;}function withJsonFormat(_0x1d2726){const _0x3cfe25=a27_0x43a0;if(!_0x1d2726[_0x3cfe25(0xc3)]&&!_0x1d2726['json']&&!_0x1d2726[_0x3cfe25(0x140)]&&!_0x1d2726[_0x3cfe25(0x151)])return{..._0x1d2726,'format':_0x3cfe25(0x164),'json':!![]};return _0x1d2726;}function formatJourneyState(_0x2bd2c6){const _0x2a7b24=a27_0x43a0;switch(_0x2bd2c6){case _0x2a7b24(0xf1):return a27_0x442aed[_0x2a7b24(0x175)](_0x2a7b24(0x160));case _0x2a7b24(0x154):return a27_0x442aed[_0x2a7b24(0xbd)]('(draft)');case _0x2a7b24(0x156):return a27_0x442aed[_0x2a7b24(0x144)](_0x2a7b24(0x174));case _0x2a7b24(0xb8):return a27_0x442aed[_0x2a7b24(0x19e)](_0x2a7b24(0xcf));case _0x2a7b24(0xd4):return a27_0x442aed[_0x2a7b24(0xbd)]('(archived)');default:return'('+_0x2bd2c6+')';}}function a27_0xdeb3(){const _0x529f93=['exitOrJumpSize','format','state','Show\x20journey\x20statistics','Error:\x20--version\x20option\x20is\x20required','journey:version:view','nodes','\x0aError:','get','push','file','9XBsPRV',',\x20version:\x20','(completed)','📁\x20','description','4420315QBudAh','milestoneSize','archived','has','links','Cancelled','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','createdAt','Listing\x20journeys...','values','Parent\x20segment:\x20','Options:','base','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','getLatestJourneyId','journeys','Fetching\x20','🗺️\x20','/j/da','rule','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','/app/ps/','filePath','listActivationsFlat','setPhase','session','Resolving\x20parent\x20segment...','segment','red','audienceId','enteredSize','launched','cyan','Getting\x20journey\x20details...','helpText','Folder\x20path:\x20','test','journey','Show\x20journey\x20details','find','Available\x20stages:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','user','✔\x20All\x20files\x20are\x20up\x20to\x20date','reentryMode','journeyBundleName','journeyBundleId','limit','listJourneysWithFolders','absolutePath','Resolved\x20YAML\x20file:\x20','Resolving\x20version...','91106aRucGl','targetDir','Show\x20journey\x20table\x20column\x20mapping','no_parent','journeyName','data','activation','\x20journey','/j/da/je','\x20(draft)\x20—\x20\x22','relative','journey:list','Table:\x20','\x5c$&','getSegment','length','log','Error:\x20Parent\x20segment\x20context\x20required','sort','\x20journeys','execute','getTrafficData','localeCompare','\x20files?','Error:\x20Invalid\x20--type\x20\x22','getStatistics','Fetching\x20journeys\x20and\x20folders...','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Listing\x20journey\x20activations...','Export\x20journey(s)\x20as\x20YAML\x20files','3852KKSQZn','stage','parentName','version','journey:stats','segmentName','Journey\x20name:\x20','List\x20activations\x20for\x20a\x20journey','\x20versions)','\x20\x20-\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','\x22\x20not\x20found','journey:pause','then','List\x20all\x20versions\x20of\x20a\x20journey','verbose','parent_segment','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','List\x20journeys\x20in\x20current\x20context','table','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)','relativePath','content','journeyId','hasChanges','20168zyDjtW','getColumnMapping','jsonl','...','type','root\x20folder','yellow','3qgjNqk','toLowerCase','Pattern:\x20','includeStats','map','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','entries','Found\x20','listVersions','error','bold','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','tsv','\x20\x20Consolidating\x20duplicate\x20segment:\x20','all','draft','resume','paused','errorCode','Pause\x20a\x20running\x20journey','\x20changed\x20files','attributes','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','utf-8','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','folderId','resolveParentId','(running)','journey:traffic','3557188QlyPMu','completionRate','json','Error:\x20Invalid\x20version\x20number:\x20','stringify','rootFolderId','Target\x20directory:\x20','journey:pull','listFolders','.yml','\x0aPull\x20summary:','\x20Opening\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','message','diff','\x20\x20Parent\x20segment:\x20','getParentFull','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','(paused)','green','✔\x20Context\x20set:\x20','buildIdToNameMap','yes','goal','name','2301792nVStaY','segments','Aborted.','\x22\x20paused','split','journey:push','Listing\x20journey\x20versions...','\x20not\x20found.\x20Available:\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:version:create','\x20version','\x20\x20Name:\x20','exitOrJumpRate','goalSize','View\x20a\x20specific\x20version\x20of\x20a\x20journey','/e/','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','replace','history','stages','join','\x20Created\x20v','Error:\x20Journey\x20not\x20found:\x20','isNew','activationParams','from','Fetching\x20users\x20and\x20connections...','201677Nrtlcu','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Creating\x20new\x20version...','resolveJourneyId','size','site','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','blue','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Input:\x20','connector_config','parentSegment','add','Target\x20file:\x20','set','getJourney','✔\x20Found\x20','updatedAt','listJourneysFromParentSegment','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20','filter','Getting\x20column\x20mapping...','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','journey:columns','resolveSegment','journeyStages','includeHistory','\x20new\x20files','Resolving\x20journey...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Write\x20','\x20details...','\x20\x20Target:\x20','versionNumber','folderPath','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20\x20Statistics\x20not\x20available','21513800XhjlsL','conversion','cwd','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','journey:resume','-\x20no\x20files\x20written','connection','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20=\x20','\x20\x20Journey\x20ID:\x20','hasPeriod','Getting\x20journey\x20statistics...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','completed','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','repeat','stageNameMap','resourceName','dim','✔\x20Journey\x20\x22','INVALID_ARGUMENT','tdx.json','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'];a27_0xdeb3=function(){return _0x529f93;};return a27_0xdeb3();}function formatJourneyItem(_0x32173e,_0x24500f='',_0x442257){const _0xe964d8=a27_0x43a0,_0x4895a1=formatJourneyState(_0x32173e[_0xe964d8(0xc4)]),_0x15121d=_0x442257?hyperlink(_0x32173e[_0xe964d8(0xff)],_0x442257):_0x32173e[_0xe964d8(0xff)];return _0x24500f+_0xe964d8(0xe3)+_0x15121d+'\x20'+_0x4895a1;}function escapeRegex(_0x27871c){const _0x2fc561=a27_0x43a0;return _0x27871c[_0x2fc561(0x18d)](/[.*+?^${}()|[\]\\]/g,_0x2fc561(0x113));}function globToRegex(_0x46924d){const _0x3935cd=a27_0x43a0,_0x2af9b5=_0x46924d[_0x3935cd(0x17f)]('*')[_0x3935cd(0x149)](escapeRegex);return new RegExp(_0x2af9b5[_0x3935cd(0x190)]('.*'),'i');}function buildRuleToNameMapping(_0x2d8f97){const _0x5c4dde=a27_0x43a0,_0x352b23=new Map();if(_0x2d8f97[_0x5c4dde(0x17c)])for(const [_0x3eccf3,_0x875692]of Object[_0x5c4dde(0x14b)](_0x2d8f97[_0x5c4dde(0x17c)])){if(_0x875692['rule']){const _0x481e15=serializeRule(_0x875692[_0x5c4dde(0xe5)]),_0x41e7c7=_0x352b23['get'](_0x481e15);_0x41e7c7?_0x41e7c7[_0x5c4dde(0xcb)](_0x3eccf3):_0x352b23[_0x5c4dde(0x1a5)](_0x481e15,[_0x3eccf3]);}}return _0x352b23;}async function resolveJourneyIdFromInput(_0x3f7f83,_0x3d738c,_0xdfd4fc){const _0x1bb6c5=a27_0x43a0,_0x3fde9f=await resolveJourneyTarget(_0x3f7f83,_0x3d738c['parentSegment'],_0x3d738c[_0x1bb6c5(0x134)]),_0x3aba88=_0x3fde9f[_0x1bb6c5(0x1a2)];if(!_0x3aba88)throw new SDKError(ErrorCode[_0x1bb6c5(0xbf)],_0x1bb6c5(0xa2));const _0x1fa23f=await withSpinner(_0x1bb6c5(0xec),()=>_0xdfd4fc['segment'][_0x1bb6c5(0x15f)](_0x3aba88),{'verbose':_0x3d738c[_0x1bb6c5(0x134)]}),_0x31da95=_0x1fa23f[_0x1bb6c5(0x10b)],_0xb05354=await withSpinner(_0x1bb6c5(0xa1),()=>_0xdfd4fc[_0x1bb6c5(0xf7)][_0x1bb6c5(0x19a)](_0x31da95,_0x3fde9f[_0x1bb6c5(0x10a)]),{'verbose':_0x3d738c[_0x1bb6c5(0x134)]});return{'journeyId':_0xb05354[_0x1bb6c5(0x10b)],'journeyName':_0x3fde9f[_0x1bb6c5(0x10a)],'parentSegmentId':_0x31da95};}async function resolveJourneyTarget(_0xed1084,_0x2d63b9,_0x37cffc){const _0x519f16=a27_0x43a0;if(isYamlFilePath(_0xed1084))try{const _0x2e68b4=await resolveYamlFilePath(_0xed1084);return _0x37cffc&&(console[_0x519f16(0x14e)](_0x519f16(0x104)+_0xed1084),console['error'](_0x519f16(0x171)+_0x2e68b4[_0x519f16(0x1a2)]),console['error'](_0x519f16(0x186)+_0x2e68b4[_0x519f16(0x12a)]),console[_0x519f16(0x14e)]('\x20\x20Folder\x20path:\x20'+(_0x2e68b4[_0x519f16(0xa8)]||'(root)'))),{'journeyName':_0x2e68b4[_0x519f16(0x12a)],'parentSegment':_0x2e68b4[_0x519f16(0x1a2)],'resolved':_0x2e68b4};}catch(_0x2e10ca){throw new SDKError(ErrorCode[_0x519f16(0xbf)],_0x519f16(0xc1)+_0x2e10ca[_0x519f16(0x16f)]);}if(!_0x2d63b9)throw new SDKError(ErrorCode[_0x519f16(0xbf)],_0x519f16(0x96));return{'journeyName':_0xed1084,'parentSegment':_0x2d63b9};}export class JourneyListCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x111);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x137);async['execute'](_0x1a87cd){const _0x23e7f9=a27_0x5627fc,{options:_0x23c1be,args:_0x4228a4,tdx:_0x27e7a5}=_0x1a87cd,_0x4a764c=_0x4228a4[0x0],_0x284307=_0x23c1be['parentSegment'];if(!_0x284307)return console[_0x23e7f9(0x14e)](_0x23e7f9(0x117)),console[_0x23e7f9(0x14e)](_0x23e7f9(0xb7)),0x1;const _0x2f63cd=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x27e7a5[_0x23e7f9(0xed)][_0x23e7f9(0x15f)](_0x284307),{'verbose':_0x23c1be[_0x23e7f9(0x134)]}),_0x9db5ca=_0x2f63cd[_0x23e7f9(0x10b)];_0x23c1be[_0x23e7f9(0x134)]&&(console[_0x23e7f9(0x14e)](_0x23e7f9(0xdc)+_0x284307+'\x20(ID:\x20'+_0x9db5ca+')'),_0x4a764c&&console[_0x23e7f9(0x14e)](_0x23e7f9(0x147)+_0x4a764c));const _0x366b46=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x27e7a5[_0x23e7f9(0xed)][_0x23e7f9(0x172)](_0x9db5ca),{'verbose':_0x23c1be[_0x23e7f9(0x134)]}),_0x4e2dc3=_0x366b46['data'],_0x1ce778=_0x4e2dc3[_0x23e7f9(0x167)],_0x3eb3d3=await withSpinner(_0x23e7f9(0xda),()=>_0x27e7a5[_0x23e7f9(0xf7)][_0x23e7f9(0x102)](_0x9db5ca,_0x1ce778),{'verbose':_0x23c1be[_0x23e7f9(0x134)]});let _0x375a99=_0x3eb3d3['data'][_0x23e7f9(0xe1)];const _0x4e12be=_0x3eb3d3['data']['folders'],_0x4b755c=new Map();for(const _0x1c0365 of _0x4e12be){_0x4b755c[_0x23e7f9(0x1a5)](_0x1c0365['id'],_0x1c0365[_0x23e7f9(0x17a)]);}if(_0x4a764c){const _0x29f5c7=globToRegex(_0x4a764c);_0x375a99=_0x375a99[_0x23e7f9(0x98)](_0x269606=>_0x29f5c7[_0x23e7f9(0xf6)](_0x269606[_0x23e7f9(0xff)]));}console['error'](_0x23e7f9(0x1a7)+_0x375a99['length']+_0x23e7f9(0x10d)+(_0x375a99[_0x23e7f9(0x115)]!==0x1?'s':''));const _0x383aa7=_0x37b9e7=>{const _0x3339ac=_0x23e7f9;return getConsoleNextUrl(_0x23c1be[_0x3339ac(0x19c)],_0x3339ac(0xe7)+_0x9db5ca+_0x3339ac(0x18a)+_0x37b9e7+_0x3339ac(0xe4));};if(_0x23c1be['format']===_0x23e7f9(0x138))await handleSDKOutput(_0x375a99,_0x23c1be);else{if(_0x23c1be['format']===_0x23e7f9(0x164)){const _0x553334=_0x375a99[_0x23e7f9(0x149)](_0x3ec652=>({..._0x3ec652,'url':_0x383aa7(_0x3ec652['id'])}));await handleSDKOutput(_0x553334,_0x23c1be);}else{console[_0x23e7f9(0x116)]('['+_0x284307+']');const _0x5f5afa=new Map(),_0x2b47b0=[];for(const _0x5ad893 of _0x375a99){if(!_0x5ad893[_0x23e7f9(0x15e)]||_0x5ad893[_0x23e7f9(0x15e)]===_0x1ce778)_0x2b47b0[_0x23e7f9(0xcb)](_0x5ad893);else{const _0x535a54=_0x5f5afa[_0x23e7f9(0xca)](_0x5ad893[_0x23e7f9(0x15e)])||[];_0x535a54[_0x23e7f9(0xcb)](_0x5ad893),_0x5f5afa['set'](_0x5ad893['folderId'],_0x535a54);}}const _0x293c11=(_0x2335de,_0x481b2a)=>_0x2335de[_0x23e7f9(0xff)][_0x23e7f9(0x11c)](_0x481b2a[_0x23e7f9(0xff)],undefined,{'sensitivity':_0x23e7f9(0xde)});_0x2b47b0['sort'](_0x293c11);for(const _0x5224d2 of _0x2b47b0){console[_0x23e7f9(0x116)](formatJourneyItem(_0x5224d2,'',_0x383aa7(_0x5224d2['id'])));}const _0x362a4d=[..._0x5f5afa['entries']()]['sort']((_0x5a6135,_0xd8b3f7)=>{const _0x7f2f73=_0x23e7f9,_0x344519=_0x4b755c[_0x7f2f73(0xca)](_0x5a6135[0x0])||_0x5a6135[0x0],_0x47df8c=_0x4b755c['get'](_0xd8b3f7[0x0])||_0xd8b3f7[0x0];return _0x344519[_0x7f2f73(0x11c)](_0x47df8c,undefined,{'sensitivity':'base'});});for(const [_0x7e27f6,_0x58907d]of _0x362a4d){const _0x15e535=_0x4b755c[_0x23e7f9(0xca)](_0x7e27f6)||_0x7e27f6;console['log'](_0x23e7f9(0xd0)+_0x15e535),_0x58907d[_0x23e7f9(0x118)](_0x293c11);for(const _0x2cb356 of _0x58907d){console[_0x23e7f9(0x116)](formatJourneyItem(_0x2cb356,'\x20\x20',_0x383aa7(_0x2cb356['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:view';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xf8);async[a27_0x5627fc(0x11a)](_0x40362a){const _0x5b5ba0=a27_0x5627fc,{options:_0x54a855,args:_0x57388d,tdx:_0x5c14d4}=_0x40362a,_0x5b6dc2=_0x57388d[0x0];if(!_0x5b6dc2)return console[_0x5b5ba0(0x14e)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5b5ba0(0x14e)](_0x5b5ba0(0x136)),console['error'](_0x5b5ba0(0xdd)),console[_0x5b5ba0(0x14e)](_0x5b5ba0(0x173)),0x1;_0x54a855[_0x5b5ba0(0x134)]&&console['error'](_0x5b5ba0(0x1a0)+_0x5b6dc2);const {journeyId:_0x153d8f,parentSegmentId:_0x1dd807}=await resolveJourneyIdFromInput(_0x5b6dc2,_0x54a855,_0x5c14d4);if(_0x54a855['web']){const _0x3ad213=getConsoleNextUrl(_0x54a855[_0x5b5ba0(0x19c)],_0x5b5ba0(0xe7)+_0x1dd807+_0x5b5ba0(0x18a)+_0x153d8f+'/j/da/je');return console[_0x5b5ba0(0x14e)](a27_0x442aed[_0x5b5ba0(0x175)]('✔')+_0x5b5ba0(0x16d)+a27_0x442aed[_0x5b5ba0(0xf2)](_0x3ad213)),openBrowser(_0x3ad213),0x0;}const _0x39362a=await withSpinner(_0x5b5ba0(0xf3),()=>_0x5c14d4['journey']['getJourney'](_0x153d8f),{'verbose':_0x54a855[_0x5b5ba0(0x134)]}),_0x16a52c=_0x39362a[_0x5b5ba0(0x10b)],_0x2d2937=_0x54a855[_0x5b5ba0(0x148)];let _0x164bef;if(_0x2d2937)try{const _0x294313=await withSpinner(_0x5b5ba0(0xb6),()=>_0x5c14d4['journey'][_0x5b5ba0(0x11f)](_0x153d8f),{'verbose':_0x54a855[_0x5b5ba0(0x134)]});_0x164bef=_0x294313[_0x5b5ba0(0x10b)];}catch{_0x54a855[_0x5b5ba0(0x134)]&&console[_0x5b5ba0(0x14e)](_0x5b5ba0(0xaa));}const _0x57d3d7=getConsoleNextUrl(_0x54a855[_0x5b5ba0(0x19c)],'/app/ps/'+_0x1dd807+_0x5b5ba0(0x18a)+_0x153d8f+_0x5b5ba0(0x10e)),_0x41ebb8={'id':_0x16a52c['id'],'name':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x17a)],'description':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xd1)],'state':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xc4)],'paused':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x156)],'reentry_mode':_0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0xfe)],'stages':_0x16a52c[_0x5b5ba0(0x15a)]['journeyStages']?.[_0x5b5ba0(0x115)]||0x0,..._0x16a52c[_0x5b5ba0(0x15a)][_0x5b5ba0(0x179)]&&{'goal':_0x16a52c[_0x5b5ba0(0x15a)]['goal']['name']},..._0x164bef&&{'statistics':{'size':_0x164bef[_0x5b5ba0(0x19b)],'entered':_0x164bef[_0x5b5ba0(0xf0)],'goal_achieved':_0x164bef[_0x5b5ba0(0x188)],'completion_rate':_0x164bef[_0x5b5ba0(0x163)],'exit_or_jump':_0x164bef[_0x5b5ba0(0xc2)],'exit_or_jump_rate':_0x164bef[_0x5b5ba0(0x187)],'stages':_0x164bef['stages']}},'url':_0x57d3d7};return await handleSingleObjectOutput(_0x41ebb8,_0x54a855),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x129);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xc5);async['execute'](_0x4a4159){const _0x373a1c=a27_0x5627fc,{options:_0x389b2a,args:_0x4df103,tdx:_0x5da45b}=_0x4a4159,_0x17cb7f=_0x4df103[0x0];if(!requireNameOrPath(_0x17cb7f))return 0x1;_0x389b2a[_0x373a1c(0x134)]&&console[_0x373a1c(0x14e)](_0x373a1c(0x1a0)+_0x17cb7f);const _0x2b44f6=_0x389b2a,_0x2a10d7=_0x2b44f6[_0x373a1c(0x195)],_0x18e93c=_0x2b44f6['to'],_0x4b7b52=_0x2b44f6[_0x373a1c(0x9f)],_0x498b41=_0x2b44f6[_0x373a1c(0x126)];_0x4b7b52&&!_0x2a10d7&&!_0x18e93c&&console['error'](_0x373a1c(0x121));const _0x4baa8f=_0x4b7b52?withJsonFormat(_0x389b2a):_0x389b2a,{journeyId:_0x3d9782,journeyName:_0x121c20}=await resolveJourneyIdFromInput(_0x17cb7f,_0x4baa8f,_0x5da45b),_0x5ca777=_0x2a10d7||_0x18e93c?{'from':_0x2a10d7,'to':_0x18e93c}:undefined,_0x48ee78=await withSpinner(_0x373a1c(0xb6),()=>Promise[_0x373a1c(0x153)]([_0x5da45b[_0x373a1c(0xf7)][_0x373a1c(0x1a6)](_0x3d9782),_0x5da45b[_0x373a1c(0xf7)][_0x373a1c(0x11f)](_0x3d9782,_0x5ca777)]),{'verbose':_0x4baa8f['verbose']}),[_0x130b78,_0x1da74b]=_0x48ee78[_0x373a1c(0x10b)];if(!_0x1da74b||_0x1da74b[_0x373a1c(0x13c)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x121c20),console[_0x373a1c(0x14e)](_0x373a1c(0xdf)),0x0;const _0x18b72b=buildStageNameMap(_0x130b78),_0x5a1094=!!(_0x5ca777&&_0x1da74b[_0x373a1c(0x18e)]?.['length']),_0x37dbaa={'stageNameMap':_0x18b72b,'hasPeriod':_0x5a1094,'includeHistory':!!_0x4b7b52};if(_0x498b41&&_0x1da74b[_0x373a1c(0x18f)]){const _0x10044f=_0x1da74b[_0x373a1c(0x18f)][_0x373a1c(0xf9)](_0x19276e=>{const _0x2ecdc3=_0x373a1c,_0x23bfab=_0x18b72b['get'](_0x19276e['id'])??'';return _0x23bfab[_0x2ecdc3(0x146)]()===_0x498b41[_0x2ecdc3(0x146)]();});if(_0x10044f)return await handleSingleObjectOutput(formatStageStats(_0x10044f,_0x37dbaa),_0x4baa8f),0x0;const _0x146734=_0x1da74b['stages']['map'](_0x4011ca=>_0x18b72b[_0x373a1c(0xca)](_0x4011ca['id'])??_0x4011ca['id']);return console[_0x373a1c(0x14e)]('Error:\x20Stage\x20\x22'+_0x498b41+_0x373a1c(0x130)),console[_0x373a1c(0x14e)](_0x373a1c(0xfa)+_0x146734[_0x373a1c(0x190)](',\x20')),0x1;}const _0x3f2761=_0x1da74b['stages']?.[_0x373a1c(0x149)](_0x2339da=>formatStageStats(_0x2339da,_0x37dbaa)),_0x5ee15e=assembleJourneyStats(_0x1da74b,{'from':_0x2a10d7,'to':_0x18e93c,'includeHistory':_0x4b7b52});return await this['renderStats'](_0x5ee15e,_0x3f2761??[],_0x4baa8f),0x0;}async['renderStats'](_0x310413,_0x391da5,_0x474066){const _0x354225=a27_0x5627fc,_0x1c92ea=_0x474066[_0x354225(0xc3)]==='json'||_0x474066[_0x354225(0xc3)]==='jsonl'||_0x474066['json']||_0x474066[_0x354225(0x140)];if(_0x1c92ea){_0x310413[_0x354225(0x18f)]=_0x391da5,await handleSingleObjectOutput(_0x310413,_0x474066);return;}await handleSingleObjectOutput(_0x310413,_0x474066);for(const _0x15727b of _0x391da5){console[_0x354225(0x116)](''),console[_0x354225(0x116)](String(a27_0x442aed[_0x354225(0xf2)][_0x354225(0x14f)]('['+_0x15727b[_0x354225(0x17a)]+']'))+a27_0x442aed[_0x354225(0xbd)]('\x20'+_0x15727b['id']));const {id:_0xd8f077,name:_0x51d5b4,..._0x441d13}=_0x15727b;await handleSingleObjectOutput(_0x441d13,_0x474066);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x161);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x15b);async['execute'](_0x30b6fe){const _0x38e2fe=a27_0x5627fc,{options:_0x14bed1,args:_0x54a264,tdx:_0x466e23}=_0x30b6fe,_0x3d2d7a=_0x54a264[0x0];if(!requireNameOrPath(_0x3d2d7a))return 0x1;_0x14bed1[_0x38e2fe(0x134)]&&console['error'](_0x38e2fe(0x1a0)+_0x3d2d7a);const _0x1ff9b7=_0x14bed1,_0x12df21=_0x1ff9b7[_0x38e2fe(0x142)],_0x416196=_0x1ff9b7['from'],_0x5cd6c7=_0x1ff9b7['to'],_0x184b96=_0x1ff9b7[_0x38e2fe(0x101)];if(_0x12df21&&_0x12df21!==_0x38e2fe(0xac)&&_0x12df21!==_0x38e2fe(0x10c))return console[_0x38e2fe(0x14e)](_0x38e2fe(0x11e)+_0x12df21+_0x38e2fe(0x18b)),0x1;const _0x243032=withJsonFormat(_0x14bed1),{journeyId:_0x18843b,journeyName:_0x1c37ad}=await resolveJourneyIdFromInput(_0x3d2d7a,_0x243032,_0x466e23),_0x35f9b3={'type':_0x12df21,'from':_0x416196,'to':_0x5cd6c7,'limit':_0x184b96},_0x3e31f9=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x466e23[_0x38e2fe(0xf7)][_0x38e2fe(0x11b)](_0x18843b,_0x35f9b3),{'verbose':_0x243032['verbose']}),_0x14ba06=_0x3e31f9[_0x38e2fe(0x10b)],_0x163598=_0x14ba06[_0x38e2fe(0xac)]&&(_0x14ba06[_0x38e2fe(0xac)][_0x38e2fe(0xc8)]['length']>0x0||_0x14ba06[_0x38e2fe(0xac)][_0x38e2fe(0xd6)][_0x38e2fe(0x115)]>0x0),_0x48e3d4=_0x14ba06[_0x38e2fe(0x10c)]&&_0x14ba06[_0x38e2fe(0x10c)][_0x38e2fe(0x115)]>0x0;if(!_0x163598&&!_0x48e3d4)return console[_0x38e2fe(0x14e)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x1c37ad),console[_0x38e2fe(0x14e)](_0x38e2fe(0x19f)),_0x416196&&_0x5cd6c7&&console['error'](_0x38e2fe(0xe6)),0x0;return await handleSingleObjectOutput(_0x14ba06,_0x243032),0x0;}}function formatStageStats(_0x4b0ae7,_0xfc60b){const _0x30f579=a27_0x5627fc,_0x277dbd=_0xfc60b['hasPeriod']&&_0x4b0ae7[_0x30f579(0x18e)]?.[_0x30f579(0x115)]?aggregateStageHistory(_0x4b0ae7[_0x30f579(0x18e)]):{'size':_0x4b0ae7[_0x30f579(0x19b)],'entered':_0x4b0ae7['enteredSize'],'milestone':_0x4b0ae7[_0x30f579(0xd3)],'milestone_rate':_0x4b0ae7['completeMilestoneRate'],'exit_or_jump':_0x4b0ae7['exitOrJumpSize'],'exit_or_jump_rate':_0x4b0ae7['exitOrJumpRate']},_0xd007df={'id':_0x4b0ae7['id'],'name':_0xfc60b[_0x30f579(0xbb)][_0x30f579(0xca)](_0x4b0ae7['id'])??_0x4b0ae7['id'],..._0x277dbd};return _0xfc60b[_0x30f579(0xb5)]&&_0xfc60b[_0x30f579(0x9f)]&&_0x4b0ae7['history']&&(_0xd007df[_0x30f579(0x18e)]=_0x4b0ae7['history']),_0xd007df;}export class JourneyPauseCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x131);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x158);async[a27_0x5627fc(0x11a)](_0x47c3da){const _0x186e38=a27_0x5627fc,{options:_0x3822e1,args:_0x1733d8,tdx:_0x18e35c}=_0x47c3da,_0x29a9f2=_0x1733d8[0x0];if(!requireNameOrPath(_0x29a9f2))return 0x1;_0x3822e1['verbose']&&console['error']('Input:\x20'+_0x29a9f2);const {journeyId:_0x4ce76b,journeyName:_0x147357}=await resolveJourneyIdFromInput(_0x29a9f2,_0x3822e1,_0x18e35c);if(!_0x3822e1[_0x186e38(0x178)]){const _0x52e4b4=await confirm(_0x186e38(0x18c)+_0x147357+'\x22?');if(!_0x52e4b4)return console[_0x186e38(0x14e)](_0x186e38(0xd7)),0x0;}const _0x8ba66b=await withSpinner('Pausing\x20journey...',()=>_0x18e35c[_0x186e38(0xf7)]['pause'](_0x4ce76b),{'verbose':_0x3822e1[_0x186e38(0x134)]}),_0x215b66=_0x8ba66b[_0x186e38(0x10b)];return console[_0x186e38(0x14e)]('✔\x20Journey\x20\x22'+_0x215b66[_0x186e38(0x15a)][_0x186e38(0x17a)]+_0x186e38(0x17e)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x5627fc(0xaf);[a27_0x5627fc(0xd1)]='Resume\x20a\x20paused\x20journey';async[a27_0x5627fc(0x11a)](_0x1f5f73){const _0x8fa0e1=a27_0x5627fc,{options:_0x4c7daf,args:_0x736758,tdx:_0x33ccc0}=_0x1f5f73,_0x36923d=_0x736758[0x0];if(!requireNameOrPath(_0x36923d))return 0x1;_0x4c7daf[_0x8fa0e1(0x134)]&&console[_0x8fa0e1(0x14e)](_0x8fa0e1(0x1a0)+_0x36923d);const {journeyId:_0x85affd,journeyName:_0x1bbead}=await resolveJourneyIdFromInput(_0x36923d,_0x4c7daf,_0x33ccc0);if(!_0x4c7daf[_0x8fa0e1(0x178)]){const _0x410041=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x1bbead+'\x22?');if(!_0x410041)return console[_0x8fa0e1(0x14e)](_0x8fa0e1(0xd7)),0x0;}const _0xf12157=await withSpinner('Resuming\x20journey...',()=>_0x33ccc0[_0x8fa0e1(0xf7)][_0x8fa0e1(0x155)](_0x85affd),{'verbose':_0x4c7daf[_0x8fa0e1(0x134)]}),_0x23d535=_0xf12157[_0x8fa0e1(0x10b)];return console[_0x8fa0e1(0x14e)](_0x8fa0e1(0xbe)+_0x23d535['attributes'][_0x8fa0e1(0x17a)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x169);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x124);async[a27_0x5627fc(0x11a)](_0x1f3898){const _0x2b134d=a27_0x5627fc,{options:_0x2474ea,args:_0x5add57,tdx:_0xd533ec}=_0x1f3898,_0x22c7fd=_0x2474ea,_0x3efbb7=_0x5add57[0x0],_0x41d986=_0x3efbb7&&isYamlFilePath(_0x3efbb7),_0x1109b7=await resolveTarget({'arg':_0x41d986?_0x3efbb7:undefined,'contextParent':_0x2474ea[_0x2b134d(0x1a2)],'cwd':process[_0x2b134d(0xad)]()});if(!isSuccessfulResolution(_0x1109b7))return _0x1109b7[_0x2b134d(0x157)]===_0x2b134d(0x109)?(console['error'](a27_0x442aed[_0x2b134d(0x144)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x2b134d(0x139)),console[_0x2b134d(0x14e)](_0x2b134d(0x12f)),console[_0x2b134d(0x14e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console['error'](_0x2b134d(0x19d))):(console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0xee)](_0x2b134d(0x97)+_0x1109b7[_0x2b134d(0x16f)]+'\x0a')),_0x1109b7[_0x2b134d(0xf4)]&&console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0xf2)](_0x1109b7['helpText']))),0x1;let _0x5a5dd0=_0x41d986?undefined:_0x3efbb7,_0x577286,_0x1effdf;_0x1109b7['type']===_0x2b134d(0xcc)&&(_0x5a5dd0=_0x1109b7[_0x2b134d(0xbc)],_0x577286=_0x1109b7[_0x2b134d(0xe8)],_0x1effdf=_0x1109b7['folderPath']);const _0x36585b=_0x1109b7[_0x2b134d(0x127)],_0x36dc93=_0x1109b7[_0x2b134d(0x107)];_0x22c7fd[_0x2b134d(0x134)]&&(console[_0x2b134d(0x14e)]('Parent\x20segment:\x20'+_0x36585b),console[_0x2b134d(0x14e)](_0x2b134d(0x168)+_0x36dc93),_0x5a5dd0&&console[_0x2b134d(0x14e)](_0x2b134d(0x12b)+_0x5a5dd0),_0x577286&&console[_0x2b134d(0x14e)](_0x2b134d(0x1a4)+_0x577286),_0x1effdf&&console['error'](_0x2b134d(0xf5)+_0x1effdf));const _0xcb396d=await withSpinner(_0x2b134d(0xec),()=>_0xd533ec['segment'][_0x2b134d(0x15f)](_0x36585b),{'verbose':_0x2474ea[_0x2b134d(0x134)]}),_0x30fdcb=_0xcb396d[_0x2b134d(0x10b)],{journeys:_0x443f92,folders:_0x5ebf1d}=await withSpinner(_0x2b134d(0x120),async()=>{const _0x273e79=_0x2b134d,[_0x4d8d15,_0x1b675f]=await Promise[_0x273e79(0x153)]([_0xd533ec[_0x273e79(0xf7)][_0x273e79(0x95)](_0x30fdcb,undefined,{'includeAllVersions':!![]}),_0xd533ec[_0x273e79(0xed)][_0x273e79(0x16a)](_0x30fdcb)]);return{'journeys':_0x4d8d15,'folders':_0x1b675f};},{'verbose':_0x2474ea['verbose']})[_0x2b134d(0x132)](_0x3134cd=>_0x3134cd['data']);let _0x2ac801=_0x443f92;const _0x5671ac=buildFolderIdToPathMap(_0x5ebf1d);if(_0x5a5dd0){const _0x22cdc0=_0x2ac801[_0x2b134d(0x98)](_0x1ae8fc=>_0x1ae8fc['journeyBundleName'][_0x2b134d(0x146)]()===_0x5a5dd0[_0x2b134d(0x146)]());if(_0x22cdc0[_0x2b134d(0x115)]===0x0)return console[_0x2b134d(0x14e)](_0x2b134d(0x192)+_0x5a5dd0),console['error'](_0x2b134d(0x9b)),0x1;_0x2ac801=_0x22cdc0;}if(_0x1effdf!==undefined){const _0x41bd14=_0x2ac801[_0x2b134d(0x98)](_0x2f4976=>{const _0x56543e=_0x2b134d,_0x2c6c76=_0x2f4976[_0x56543e(0x15e)]?_0x5671ac['get'](_0x2f4976[_0x56543e(0x15e)])||'':'';return _0x2c6c76===_0x1effdf;});if(_0x41bd14[_0x2b134d(0x115)]===0x0&&_0x2ac801['length']>0x0){console[_0x2b134d(0x14e)]('Error:\x20Journey\x20\x27'+_0x5a5dd0+'\x27\x20not\x20found\x20in\x20'+(_0x1effdf||_0x2b134d(0x143))),console[_0x2b134d(0x14e)](_0x2b134d(0x16e));for(const _0x514c72 of _0x2ac801){const _0xeaac40=_0x514c72[_0x2b134d(0x15e)]?_0x5671ac[_0x2b134d(0xca)](_0x514c72[_0x2b134d(0x15e)])||'':'';console[_0x2b134d(0x14e)](_0x2b134d(0x12e)+(_0xeaac40||'(root)')+'/'+_0x514c72[_0x2b134d(0xff)]);}return 0x1;}_0x2ac801=_0x41bd14;}if(_0x2ac801[_0x2b134d(0x115)]===0x0)return console[_0x2b134d(0x14e)]('No\x20journeys\x20found'),0x0;const _0x57f78a=new Map();for(const _0x1db39d of _0x2ac801){const _0x11b13f=_0x1db39d[_0x2b134d(0x100)];!_0x57f78a[_0x2b134d(0xd5)](_0x11b13f)&&_0x57f78a[_0x2b134d(0x1a5)](_0x11b13f,[]),_0x57f78a[_0x2b134d(0xca)](_0x11b13f)[_0x2b134d(0xcb)](_0x1db39d);}for(const _0x1cd84c of _0x57f78a[_0x2b134d(0xdb)]()){_0x1cd84c[_0x2b134d(0x118)]((_0x19c54b,_0x2888c0)=>(_0x19c54b[_0x2b134d(0xa7)]||0x0)-(_0x2888c0['versionNumber']||0x0));}const _0x21a371=[],{idToEmailMap:_0x219abe,connectionIdToNameMap:_0x53b4f5}=await withSpinner(_0x2b134d(0x196),async()=>{const _0x369aa0=_0x2b134d,[_0x28138b,_0x44184a]=await Promise[_0x369aa0(0x153)]([_0xd533ec[_0x369aa0(0xfc)]['buildIdToEmailMap'](),_0xd533ec[_0x369aa0(0xb1)][_0x369aa0(0x177)]()]);return{'idToEmailMap':_0x28138b,'connectionIdToNameMap':_0x44184a};},{'verbose':_0x2474ea[_0x2b134d(0x134)]})[_0x2b134d(0x132)](_0x48fb75=>_0x48fb75[_0x2b134d(0x10b)]);for(const _0x4a2125 of _0x57f78a['values']()){const _0x47cdc8=_0x4a2125[0x0][_0x2b134d(0xff)],_0x1c5998=_0x4a2125[0x0][_0x2b134d(0x15e)],_0x22fb95=_0x1c5998?_0x5671ac[_0x2b134d(0xca)](_0x1c5998)||'':'',_0x286516=_0x22fb95?a27_0x26af62[_0x2b134d(0x190)](_0x36dc93,_0x22fb95):_0x36dc93,_0x3a9ebd=_0x577286||a27_0x26af62[_0x2b134d(0x190)](_0x286516,sanitizeFileName(_0x47cdc8)+'.yml');let _0x390385,_0xfecf52;if(existsSync(_0x3a9ebd))try{const _0x1eff73=readFileSync(_0x3a9ebd,'utf-8'),_0x455955=parseYamlString(_0x1eff73);_0xfecf52=_0x455955,_0x390385=buildRuleToNameMapping(_0x455955),_0x22c7fd[_0x2b134d(0x134)]&&_0x390385[_0x2b134d(0x19b)]>0x0&&console[_0x2b134d(0x14e)](_0x2b134d(0x14c)+_0x390385['size']+_0x2b134d(0xb2)+_0x47cdc8);}catch(_0x5cb9ac){_0x22c7fd[_0x2b134d(0x134)]&&console[_0x2b134d(0x14e)](_0x2b134d(0x183)+_0x5cb9ac['message']);}const _0x161709=[],_0xc3cb9e=new Set(),_0x2e5279=new Map(),_0x280405=new Map(),_0xb09e83=new Set(),_0x539f9d=new Map(),_0x30e872=new Map(),_0x581ded=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x47cdc8+_0x2b134d(0x141),async _0x163581=>{const _0x56e6ef=_0x2b134d;for(const _0x26203b of _0x4a2125){const _0x41bd7b=_0x4a2125[_0x56e6ef(0x115)]>0x1?_0x26203b[_0x56e6ef(0xff)]+'\x20v'+(_0x26203b[_0x56e6ef(0xa7)]||0x1):_0x26203b[_0x56e6ef(0xff)];_0x163581[_0x56e6ef(0xea)](_0x56e6ef(0xe2)+_0x41bd7b);const _0x1a6152=await _0xd533ec[_0x56e6ef(0xf7)][_0x56e6ef(0x1a6)](_0x26203b['id']),_0x150119=_0x1a6152[_0x56e6ef(0x15a)]?.[_0x56e6ef(0xef)],_0x443345={'resolveSegment':async _0x58497a=>{const _0x10372a=_0x56e6ef;if(!_0x150119)return{'name':_0x58497a,'isJourneyLocal':![]};const _0x24774c=_0x2e5279['get'](_0x58497a);if(_0x24774c)return _0x24774c;try{const _0xa7e7b6=await _0xd533ec['segment'][_0x10372a(0x114)](_0x150119,_0x58497a),_0x48b813=_0xa7e7b6['kind']===SEGMENT_KIND_JOURNEY;let _0x15efdf,_0x4d5adc=_0xa7e7b6[_0x10372a(0x17a)];if(_0x48b813&&_0xa7e7b6['rule']){const _0xa2b11e=await segmentResponseToDef(_0xa7e7b6,{'resolveSegmentName':async _0x13e0e9=>{const _0x36d292=_0x10372a,_0xa88c8c=_0x2e5279[_0x36d292(0xca)](_0x13e0e9);if(_0xa88c8c)return _0xa88c8c[_0x36d292(0x17a)];const _0x5d9079=await _0x443345[_0x36d292(0x9d)](_0x13e0e9);return _0x5d9079['name'];}}),_0x16e49b=_0xa2b11e[_0x10372a(0xe5)];_0x15efdf={'description':_0xa7e7b6['description'],'rule':_0x16e49b};const _0x5b7cd1=serializeRule(_0x16e49b),_0xe61848=_0x280405[_0x10372a(0xca)](_0x5b7cd1);if(_0xe61848)_0x4d5adc=_0xe61848,_0x15efdf=undefined,_0x22c7fd[_0x10372a(0x134)]&&console['error'](_0x10372a(0x152)+_0xa7e7b6[_0x10372a(0x17a)]+'\x20->\x20'+_0xe61848);else{let _0x4af7a0=![];if(_0x390385){const _0x15f7f3=_0x390385['get'](_0x5b7cd1);if(_0x15f7f3){const _0x1e245f=_0x15f7f3[_0x10372a(0xf9)](_0xf127bf=>!_0xc3cb9e[_0x10372a(0xd5)](_0xf127bf));_0x1e245f&&(_0x4d5adc=_0x1e245f,_0xc3cb9e[_0x10372a(0x1a3)](_0x1e245f),_0x280405['set'](_0x5b7cd1,_0x1e245f),_0x4af7a0=!![],_0x22c7fd[_0x10372a(0x134)]&&console[_0x10372a(0x14e)](_0x10372a(0x122)+_0x1e245f+'\x20(rule\x20match)'));}}if(!_0x4af7a0){const _0x2d2bc2=generateJourneyLocalName(_0xa7e7b6['name']);_0x2d2bc2&&(_0x4d5adc=_0x2d2bc2);let _0x22d2c3=_0x4d5adc,_0x5d0a73=0x2;while(_0xc3cb9e[_0x10372a(0xd5)](_0x22d2c3)){_0x22d2c3=_0x4d5adc+'_'+_0x5d0a73,_0x5d0a73++;}_0xc3cb9e['add'](_0x22d2c3),_0x280405['set'](_0x5b7cd1,_0x22d2c3),_0x4d5adc=_0x22d2c3;}}}const _0x56df4a={'name':_0x4d5adc,'isJourneyLocal':_0x48b813,'definition':_0x15efdf};return _0x2e5279[_0x10372a(0x1a5)](_0x58497a,_0x56df4a),_0x56df4a;}catch(_0x4ff56c){return _0x2474ea[_0x10372a(0x134)]&&console[_0x10372a(0x14e)](_0x10372a(0x198)+_0x58497a+':\x20'+_0x4ff56c[_0x10372a(0x16f)]),{'name':_0x58497a,'isJourneyLocal':![]};}},'resolveActivation':async _0x414a01=>{const _0x1861ce=_0x56e6ef,_0x2b54ea=_0x539f9d[_0x1861ce(0xca)](_0x414a01);if(_0x2b54ea)return _0x2b54ea;try{const _0x49df00=await _0xd533ec[_0x1861ce(0xf7)]['getActivation'](_0x26203b['id'],_0x414a01),_0x1d7839=journeyActivationStepToYaml(_0x49df00,_0x219abe,_0x53b4f5),_0x2c8a34=JSON[_0x1861ce(0x166)]({'name':_0x1d7839['name'],'connection':_0x1d7839[_0x1861ce(0xb1)],'connector_config':_0x1d7839[_0x1861ce(0x1a1)]}),_0x269117=_0x30e872['get'](_0x2c8a34);if(_0x269117){const _0x487b83={'name':_0x269117,'isJourneyLocal':!![],'definition':_0x1d7839};return _0x539f9d[_0x1861ce(0x1a5)](_0x414a01,_0x487b83),_0x487b83;}const _0x2f7b79=_0x49df00['attributes'][_0x1861ce(0x194)][_0x1861ce(0x17a)]||_0x414a01,_0x5ef22b=sanitizeYamlKey(_0x2f7b79)||'activation_'+_0x414a01;let _0x5741f5=_0x5ef22b,_0x5882a6=0x2;while(_0xb09e83['has'](_0x5741f5)){_0x5741f5=_0x5ef22b+'_'+_0x5882a6,_0x5882a6++;}_0xb09e83[_0x1861ce(0x1a3)](_0x5741f5),_0x30e872[_0x1861ce(0x1a5)](_0x2c8a34,_0x5741f5);const _0x46c10f={'name':_0x5741f5,'isJourneyLocal':!![],'definition':_0x1d7839};return _0x539f9d[_0x1861ce(0x1a5)](_0x414a01,_0x46c10f),_0x46c10f;}catch(_0x27ff0e){return _0x2474ea[_0x1861ce(0x134)]&&console[_0x1861ce(0x14e)](_0x1861ce(0xfb)+_0x414a01+':\x20'+_0x27ff0e['message']),{'name':_0x414a01,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x57c0c7,_0x52df0)=>{const _0x3ad821=_0x56e6ef;return resolveJumpTarget(_0x57c0c7,_0x52df0,_0x581ded,_0x2f2ac2=>_0xd533ec[_0x3ad821(0xf7)][_0x3ad821(0x1a6)](_0x2f2ac2));}},_0x4375f6=await journeyResponseToDef(_0x1a6152,_0x443345);_0x161709['push']({'item':_0x26203b,'yaml':_0x4375f6});}},{'verbose':_0x2474ea[_0x2b134d(0x134)]});const _0xbc94e9=await _0xd533ec[_0x2b134d(0xf7)][_0x2b134d(0xe0)](_0x4a2125[0x0]['journeyBundleId']),_0x1d3775=buildMergedJourneyDef(_0x161709,_0x390385,_0xbc94e9),_0x40091b=normalizeJourneyDef(_0x1d3775,_0xfecf52),_0x32c317=toYamlString(_0x40091b),_0x44fe90=_0x577286||a27_0x26af62[_0x2b134d(0x190)](_0x286516,sanitizeFileName(_0x47cdc8)+_0x2b134d(0x16b));!_0x577286&&_0x22fb95&&!existsSync(_0x286516)&&mkdirSync(_0x286516,{'recursive':!![]});const _0x10786d=a27_0x26af62[_0x2b134d(0x110)](process[_0x2b134d(0xad)](),_0x44fe90);if(existsSync(_0x44fe90)){const _0x194518=readFileSync(_0x44fe90,_0x2b134d(0x15c)),_0x4f15a6=generateDiff(_0x194518,_0x32c317),_0x5f8094=hasChanges(_0x4f15a6);_0x21a371['push']({'relativePath':_0x10786d,'absolutePath':_0x44fe90,'content':_0x32c317,'isNew':![],'hasChanges':_0x5f8094,'diff':_0x5f8094?formatDiffWithColors(_0x4f15a6):undefined});}else _0x21a371[_0x2b134d(0xcb)]({'relativePath':_0x10786d,'absolutePath':_0x44fe90,'content':_0x32c317,'isNew':!![],'hasChanges':![]});}const _0xaa075c=_0x21a371[_0x2b134d(0x98)](_0xb9af36=>_0xb9af36[_0x2b134d(0x193)]),_0x45c9ca=_0x21a371['filter'](_0x36eaba=>!_0x36eaba[_0x2b134d(0x193)]&&_0x36eaba[_0x2b134d(0x13d)]),_0x10c78f=_0x21a371[_0x2b134d(0x98)](_0xc461a5=>!_0xc461a5[_0x2b134d(0x193)]&&!_0xc461a5[_0x2b134d(0x13d)]),_0x3a655c=_0x2ac801[_0x2b134d(0x115)],_0x313f58=_0x57f78a[_0x2b134d(0x19b)],_0x458f24=_0x3a655c>_0x313f58?'\x20('+_0x3a655c+_0x2b134d(0x12d):'';console[_0x2b134d(0x14e)](_0x2b134d(0x16c)),console['error']('\x20\x20'+a27_0x442aed[_0x2b134d(0xf2)](_0x313f58+_0x2b134d(0x119))+a27_0x442aed[_0x2b134d(0xbd)](_0x458f24)),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0x175)]('+\x20'+_0xaa075c['length']+_0x2b134d(0xa0))),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0x144)]('~\x20'+_0x45c9ca[_0x2b134d(0x115)]+_0x2b134d(0x159))),console[_0x2b134d(0x14e)]('\x20\x20'+a27_0x442aed[_0x2b134d(0xbd)]('=\x20'+_0x10c78f[_0x2b134d(0x115)]+'\x20unchanged\x20files')),console[_0x2b134d(0x14e)](_0x2b134d(0xa6)+a27_0x442aed[_0x2b134d(0xf2)](_0x36dc93)+'\x0a');if(_0x45c9ca[_0x2b134d(0x115)]>0x0)for(const _0x4b4ef9 of _0x45c9ca){console['error']('\x0aChanges\x20to\x20\x27'+_0x4b4ef9[_0x2b134d(0x13a)]+'\x27:'),console['error']('─'[_0x2b134d(0xba)](0x3c)),console['error'](_0x4b4ef9[_0x2b134d(0x170)]),console[_0x2b134d(0x14e)]('─'[_0x2b134d(0xba)](0x3c));}if(_0x22c7fd['dryRun'])return console[_0x2b134d(0x14e)](a27_0x442aed['yellow'](_0x2b134d(0xa3))),0x0;if(_0xaa075c[_0x2b134d(0x115)]===0x0&&_0x45c9ca[_0x2b134d(0x115)]===0x0)return console['error'](a27_0x442aed['green'](_0x2b134d(0xfd))),saveSessionContext({'parent_segment':_0x36585b},_0x22c7fd[_0x2b134d(0xeb)]),console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x175)](_0x2b134d(0x176)+a27_0x442aed[_0x2b134d(0xbd)](_0x2b134d(0x135))+_0x2b134d(0xb3)+a27_0x442aed[_0x2b134d(0xf2)](_0x36585b))),0x0;if(!_0x22c7fd['yes']&&(_0xaa075c[_0x2b134d(0x115)]>0x0||_0x45c9ca[_0x2b134d(0x115)]>0x0)){if(!isInteractive())return console['error'](a27_0x442aed['red'](_0x2b134d(0xc9)),_0x2b134d(0x14a)),console['error'](a27_0x442aed['dim'](_0x2b134d(0x150))),0x1;const _0x1a574e=await confirmKey(_0x2b134d(0xa4)+(_0xaa075c[_0x2b134d(0x115)]+_0x45c9ca[_0x2b134d(0x115)])+_0x2b134d(0x11d));if(!_0x1a574e)return console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x144)](_0x2b134d(0x17d)),_0x2b134d(0xb0)),0x1;}!existsSync(_0x36dc93)&&mkdirSync(_0x36dc93,{'recursive':!![]});const _0x936b84=a27_0x26af62['join'](_0x36dc93,_0x2b134d(0xc0));writeFileSync(_0x936b84,createTdxConfigContent(_0x36585b),_0x2b134d(0x15c));for(const _0x22b2f5 of _0x21a371){(_0x22b2f5[_0x2b134d(0x193)]||_0x22b2f5['hasChanges'])&&writeFileSync(_0x22b2f5[_0x2b134d(0x103)],_0x22b2f5[_0x2b134d(0x13b)],'utf-8');}return console['error'](a27_0x442aed[_0x2b134d(0x175)]('✔\x20Pulled\x20'+(_0xaa075c[_0x2b134d(0x115)]+_0x45c9ca[_0x2b134d(0x115)])+'\x20journey\x20files\x20to\x20'+_0x36dc93)),saveSessionContext({'parent_segment':_0x36585b},_0x22c7fd['session']),console[_0x2b134d(0x14e)](a27_0x442aed[_0x2b134d(0x175)](_0x2b134d(0x176)+a27_0x442aed[_0x2b134d(0xbd)]('parent_segment')+_0x2b134d(0xb3)+a27_0x442aed[_0x2b134d(0xf2)](_0x36585b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x5627fc(0x9c);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x108);async[a27_0x5627fc(0x11a)](_0x30e19c){const _0x160019=a27_0x5627fc,{options:_0x103588,args:_0x351841,tdx:_0x2aefbe}=_0x30e19c,_0x4bab86=_0x351841[0x0];if(!requireNameOrPath(_0x4bab86))return 0x1;_0x103588[_0x160019(0x134)]&&console[_0x160019(0x14e)](_0x160019(0x1a0)+_0x4bab86);const {journeyId:_0xad9751}=await resolveJourneyIdFromInput(_0x4bab86,_0x103588,_0x2aefbe),_0x5f4717=await withSpinner(_0x160019(0x99),()=>_0x2aefbe[_0x160019(0xf7)][_0x160019(0x13f)](_0xad9751),{'verbose':_0x103588['verbose']}),_0x2c3cff=_0x5f4717[_0x160019(0x10b)];return console[_0x160019(0x116)]('Database:\x20'+_0x2c3cff['database']),console[_0x160019(0x116)](_0x160019(0x112)+_0x2c3cff[_0x160019(0x138)]),await handleSDKOutput(_0x2c3cff['columns'],_0x103588),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:activations';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x12c);async[a27_0x5627fc(0x11a)](_0x2b10c4){const _0x4061bd=a27_0x5627fc,{options:_0x11e13b,args:_0x1b2fe4,tdx:_0x546946}=_0x2b10c4,_0x4f2950=_0x1b2fe4[0x0];if(!requireNameOrPath(_0x4f2950))return 0x1;_0x11e13b[_0x4061bd(0x134)]&&console['error']('Input:\x20'+_0x4f2950);const {journeyId:_0x16eef5}=await resolveJourneyIdFromInput(_0x4f2950,_0x11e13b,_0x546946),_0x217856=await withSpinner(_0x4061bd(0x123),()=>_0x546946[_0x4061bd(0xf7)][_0x4061bd(0xe9)](_0x16eef5),{'verbose':_0x11e13b[_0x4061bd(0x134)]}),_0x6ca65f=_0x217856[_0x4061bd(0x10b)];return console['error'](_0x4061bd(0x14c)+_0x6ca65f[_0x4061bd(0x115)]+'\x20activation'+(_0x6ca65f[_0x4061bd(0x115)]!==0x1?'s':'')),await handleSDKOutput(_0x6ca65f,_0x11e13b),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x5627fc(0x180);['description']=a27_0x5627fc(0xd8);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x5d16a5){const _0x2a095e=a27_0x5627fc,_0x37dae8=_0x5d16a5['args'][0x0];let _0x1a082c;if(_0x37dae8){const _0x4cd9b1=await resolveTarget({'arg':_0x37dae8,'contextParent':_0x5d16a5['options']['parentSegment'],'cwd':process[_0x2a095e(0xad)]()});isSuccessfulResolution(_0x4cd9b1)&&_0x4cd9b1[_0x2a095e(0x142)]===_0x2a095e(0xcc)&&(_0x1a082c=_0x4cd9b1[_0x2a095e(0xe8)]);}const _0x397a39={..._0x5d16a5,'options':{..._0x5d16a5['options'],'journeysOnly':!![],..._0x1a082c&&{'singleFilePath':_0x1a082c}}};return this['segmentPushCommand']['execute'](_0x397a39);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x5627fc(0x17a)]='journey:versions';[a27_0x5627fc(0xd1)]=a27_0x5627fc(0x133);async[a27_0x5627fc(0x11a)](_0x37d826){const _0x40575e=a27_0x5627fc,{options:_0x44d72d,args:_0x4bd4c9,tdx:_0x2be5b1}=_0x37d826,_0x59d23b=_0x4bd4c9[0x0];if(!requireNameOrPath(_0x59d23b))return 0x1;if(_0x44d72d['verbose'])console[_0x40575e(0x14e)](_0x40575e(0x1a0)+_0x59d23b);const {journeyId:_0x18da28}=await resolveJourneyIdFromInput(_0x59d23b,_0x44d72d,_0x2be5b1),_0x332806=await withSpinner(_0x40575e(0x181),()=>_0x2be5b1['journey'][_0x40575e(0x14d)](_0x18da28),{'verbose':_0x44d72d['verbose']}),{bundleName:_0x5db35d,versions:_0x2bf11b,latestJourneyId:_0x29caa2}=_0x332806[_0x40575e(0x10b)];console[_0x40575e(0x14e)](_0x5db35d+':\x20'+_0x2bf11b[_0x40575e(0x115)]+_0x40575e(0x185)+(_0x2bf11b[_0x40575e(0x115)]!==0x1?'s':''));const _0x20a023=_0x2bf11b['map'](_0x250b88=>({'version':_0x250b88[_0x40575e(0xa7)],'journey_id':_0x250b88[_0x40575e(0x13c)],'name':_0x250b88['name'],'state':_0x250b88[_0x40575e(0xc4)],'paused':_0x250b88[_0x40575e(0x156)],'latest':_0x250b88[_0x40575e(0x13c)]===_0x29caa2,'created_at':_0x250b88[_0x40575e(0xd9)]}));return await handleSDKOutput(_0x20a023,_0x44d72d),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x5627fc(0x17a)]=a27_0x5627fc(0x184);[a27_0x5627fc(0xd1)]=a27_0x5627fc(0xa9);async[a27_0x5627fc(0x11a)](_0x5dbb2a){const _0x457ecf=a27_0x5627fc,{options:_0x24d9d9,args:_0x510991,tdx:_0x57b45f}=_0x5dbb2a,_0x2787cb=_0x510991[0x0];if(!requireNameOrPath(_0x2787cb))return 0x1;if(_0x24d9d9[_0x457ecf(0x134)])console['error'](_0x457ecf(0x1a0)+_0x2787cb);const {journeyId:_0x1db675,journeyName:_0x2fb6b5}=await resolveJourneyIdFromInput(_0x2787cb,_0x24d9d9,_0x57b45f);if(!_0x24d9d9[_0x457ecf(0x178)]){const _0x4e266b=await confirm(_0x457ecf(0x15d)+_0x2fb6b5+'\x22?');if(!_0x4e266b)return console[_0x457ecf(0x14e)]('Cancelled'),0x0;}const _0x12bef6=await withSpinner(_0x457ecf(0x199),()=>_0x57b45f[_0x457ecf(0xf7)]['createVersion'](_0x1db675),{'verbose':_0x24d9d9[_0x457ecf(0x134)]}),_0x31ca14=_0x12bef6[_0x457ecf(0x10b)];return console[_0x457ecf(0x14e)](a27_0x442aed['green']('✔')+_0x457ecf(0x191)+_0x31ca14['attributes'][_0x457ecf(0xa7)]+_0x457ecf(0x10f)+_0x31ca14['attributes'][_0x457ecf(0x17a)]+'\x22'),console[_0x457ecf(0x14e)](_0x457ecf(0xb4)+_0x31ca14['id']),await handleSingleObjectOutput({'id':_0x31ca14['id'],'name':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0x17a)],'version':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0xa7)],'state':_0x31ca14[_0x457ecf(0x15a)][_0x457ecf(0xc4)],'bundle_id':_0x31ca14['attributes'][_0x457ecf(0x100)],'created_at':_0x31ca14['attributes'][_0x457ecf(0xd9)]},_0x24d9d9),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a27_0x5627fc(0xc7);['description']=a27_0x5627fc(0x189);async[a27_0x5627fc(0x11a)](_0x29ec97){const _0x234c7a=a27_0x5627fc,{options:_0x3498d2,args:_0x325ed6,tdx:_0x159f19}=_0x29ec97,_0x591a78=_0x325ed6[0x0];if(!requireNameOrPath(_0x591a78))return 0x1;const _0x54ee1f=_0x3498d2[_0x234c7a(0x128)];if(!_0x54ee1f)return console[_0x234c7a(0x14e)](_0x234c7a(0xc6)),console[_0x234c7a(0x14e)](_0x234c7a(0xb9)),0x1;const _0x113d09=parseInt(_0x54ee1f,0xa);if(isNaN(_0x113d09)||_0x113d09<0x1)return console[_0x234c7a(0x14e)](_0x234c7a(0x165)+_0x54ee1f),0x1;if(_0x3498d2[_0x234c7a(0x134)])console[_0x234c7a(0x14e)](_0x234c7a(0x1a0)+_0x591a78+_0x234c7a(0xce)+_0x113d09);const {journeyId:_0xb0ddcc,parentSegmentId:_0x3247b4}=await resolveJourneyIdFromInput(_0x591a78,_0x3498d2,_0x159f19),_0x3c6de9=await withSpinner(_0x234c7a(0x105),()=>_0x159f19[_0x234c7a(0xf7)][_0x234c7a(0x14d)](_0xb0ddcc),{'verbose':_0x3498d2['verbose']}),{versions:_0x299d97,latestJourneyId:_0x1880ae}=_0x3c6de9[_0x234c7a(0x10b)],_0x539b20=_0x299d97[_0x234c7a(0xf9)](_0x4437d0=>_0x4437d0[_0x234c7a(0xa7)]===_0x113d09);if(!_0x539b20){const _0x26de53=_0x299d97['map'](_0x439334=>'v'+_0x439334[_0x234c7a(0xa7)])['join'](',\x20');return console[_0x234c7a(0x14e)]('Error:\x20Version\x20'+_0x113d09+_0x234c7a(0x182)+_0x26de53),0x1;}const _0x5ca6a7=await withSpinner('Getting\x20version\x20'+_0x113d09+_0x234c7a(0xa5),()=>_0x159f19[_0x234c7a(0xf7)][_0x234c7a(0x1a6)](_0x539b20[_0x234c7a(0x13c)]),{'verbose':_0x3498d2[_0x234c7a(0x134)]}),_0x456e5f=_0x5ca6a7[_0x234c7a(0x10b)],_0x59bb8d=getConsoleNextUrl(_0x3498d2[_0x234c7a(0x19c)],'/app/ps/'+_0x3247b4+'/e/'+_0x539b20['journeyId']+_0x234c7a(0x10e));return await handleSingleObjectOutput({'id':_0x456e5f['id'],'name':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x17a)],'version':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xa7)],'description':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xd1)],'state':_0x456e5f[_0x234c7a(0x15a)]['state'],'paused':_0x456e5f[_0x234c7a(0x15a)]['paused'],'reentry_mode':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xfe)],'stages':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x9e)]?.[_0x234c7a(0x115)]||0x0,..._0x456e5f['attributes'][_0x234c7a(0x179)]&&{'goal':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0x179)][_0x234c7a(0x17a)]},'latest':_0x539b20['journeyId']===_0x1880ae,'created_at':_0x456e5f[_0x234c7a(0x15a)][_0x234c7a(0xd9)],'updated_at':_0x456e5f['attributes'][_0x234c7a(0x94)],'url':_0x59bb8d},_0x3498d2),0x0;}}
|
|
1
|
+
const a27_0x19f833=a27_0x3cf7;(function(_0xf3ff5d,_0x333eed){const _0x54b230=a27_0x3cf7,_0x31ad23=_0xf3ff5d();while(!![]){try{const _0x45de78=parseInt(_0x54b230(0x209))/0x1*(-parseInt(_0x54b230(0x27e))/0x2)+parseInt(_0x54b230(0x22c))/0x3+parseInt(_0x54b230(0x1fd))/0x4*(parseInt(_0x54b230(0x24f))/0x5)+parseInt(_0x54b230(0x2a8))/0x6+parseInt(_0x54b230(0x1c8))/0x7*(-parseInt(_0x54b230(0x1f8))/0x8)+-parseInt(_0x54b230(0x205))/0x9*(-parseInt(_0x54b230(0x1f1))/0xa)+-parseInt(_0x54b230(0x2b0))/0xb*(parseInt(_0x54b230(0x247))/0xc);if(_0x45de78===_0x333eed)break;else _0x31ad23['push'](_0x31ad23['shift']());}catch(_0x22e268){_0x31ad23['push'](_0x31ad23['shift']());}}}(a27_0x1d5e,0x4eba4));import a27_0x50d849 from'chalk';import a27_0x3be399 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a27_0x3cf7(_0x961c97,_0x35ad6e){_0x961c97=_0x961c97-0x1aa;const _0x1d5ee1=a27_0x1d5e();let _0x3cf780=_0x1d5ee1[_0x961c97];return _0x3cf780;}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';function a27_0x1d5e(){const _0x3d6eae=['Options:','✔\x20Journey\x20\x22','tdx.json','enteredSize','sort','\x22\x20paused','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20details...','Error:\x20Journey\x20not\x20found:\x20','then','Resolving\x20journey...','journeyStages','archived','content','journey:stats','entries','parentSegment','isNew','.yml','paused','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journey:view','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','getActivation','message','push','utf-8','relativePath','\x27\x20not\x20found\x20in\x20','492834YFqTZZ','journey:activations','Error:\x20Invalid\x20version\x20number:\x20','history','no_parent','includeHistory','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pause','segment','journey:versions','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','/e/','user','journey','file','\x20Created\x20v','reentryMode','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleName','listJourneysWithFolders','cwd','\x20journeys','rootFolderId','Resolving\x20parent\x20segment...','args','json','136308HMbzGA','Getting\x20journey\x20statistics...','setPhase','has','Database:\x20','error','helpText','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','1616245WTpWHp','replace','conversion','table','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Listing\x20journeys...','limit','yes','\x20(draft)\x20—\x20\x22','versionNumber','absolutePath','toLowerCase','stringify','rule','size','Getting\x20journey\x20details...','\x20=\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','dryRun','journeyBundleId','Fetching\x20journeys\x20and\x20folders...','Write\x20','connection','Found\x20','resolveJourneyId','goal','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Warning:\x20Could\x20not\x20resolve\x20segment\x20','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)','Folder\x20path:\x20','\x20Opening\x20','Table:\x20','Parent\x20segment:\x20','updatedAt','name','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','relative','\x20\x20Name:\x20','Resuming\x20journey...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','journeyId','\x20\x20Folder\x20path:\x20','targetDir','listFolders','type','1025578MWbLdv','state','site','\x20\x20Journey\x20ID:\x20','journey:version:view','\x20->\x20','\x20not\x20found.\x20Available:\x20','blue','dim','\x20changed\x20files','description','parent_segment','Cancelled','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','bold','log','getLatestJourneyId','-\x20no\x20files\x20written','List\x20activations\x20for\x20a\x20journey','execute','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Show\x20journey\x20details','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Fetching\x20','options','find','createVersion','folderId','yellow','jsonl','map','completionRate','No\x20journeys\x20found','Show\x20journey\x20statistics','from','Journey\x20name:\x20','\x20activation','journey:traffic','Target\x20directory:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','completed','Error:\x20Parent\x20segment\x20context\x20required','2044530GwBVSa','links','\x20version','/j/da/je','✔\x20Pulled\x20','getJourney','\x5c$&','\x20\x20Preserving\x20local\x20segment\x20name:\x20','253QRgTXp','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','base','journey:pause','kind','attributes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','listVersions','\x20versions)','stages','segments','getParentFull','(running)','filePath','List\x20all\x20versions\x20of\x20a\x20journey','parentName','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','getTrafficData','Getting\x20version\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','activation','split','Resolved\x20YAML\x20file:\x20','exitOrJumpRate','launched','root\x20folder','database','folderPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Getting\x20journey\x20traffic\x20data...','createdAt','(draft)','folders','renderStats','\x20(ID:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','filter','buildIdToNameMap','Fetching\x20users\x20and\x20connections...','\x0aChanges\x20to\x20\x27','join','413497sOZtFR','\x0aPull\x20summary:','session','getStatistics','Listing\x20journey\x20versions...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','resolveSegment','segmentPushCommand','resume','draft','values','\x20journey\x20files\x20to\x20','🗺️\x20','INVALID_ARGUMENT','journey:columns','getColumnMapping','\x20\x20Target:\x20','✔\x20Found\x20','(completed)','segmentName','cyan','Input:\x20','web','format','columns','Aborted.','Available\x20stages:\x20','stage',',\x20version:\x20','get','resolveParentId','List\x20journeys\x20in\x20current\x20context','tsv','Error:\x20--version\x20option\x20is\x20required','add','Error:\x20Version\x20','hasChanges','\x20(rule\x20match)','green','(root)','getSegment','110ZKAVxU','errorCode','journey:resume','set','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','stageNameMap','\x20journey','24zzUjWf','data','localeCompare','all','exitOrJumpSize','4jwteFP','\x22\x20resumed','milestoneSize','View\x20a\x20specific\x20version\x20of\x20a\x20journey','red','resourceName','\x20files?','verbose','364455kWyRvN','length','\x22\x20not\x20found','Export\x20journey(s)\x20as\x20YAML\x20files','1JvjhMh','journey:pull','/app/ps/','Pausing\x20journey...','Error:\x20Invalid\x20--type\x20\x22','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)'];a27_0x1d5e=function(){return _0x3d6eae;};return a27_0x1d5e();}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(_0x14612f){const _0x26dd17=a27_0x3cf7;return!_0x14612f&&(console[_0x26dd17(0x24c)](_0x26dd17(0x292)),console[_0x26dd17(0x24c)](_0x26dd17(0x1cd))),!!_0x14612f;}function withJsonFormat(_0x337a0d){const _0x1dacaa=a27_0x3cf7;if(!_0x337a0d['format']&&!_0x337a0d['json']&&!_0x337a0d[_0x1dacaa(0x29b)]&&!_0x337a0d[_0x1dacaa(0x1e8)])return{..._0x337a0d,'format':_0x1dacaa(0x246),'json':!![]};return _0x337a0d;}function formatJourneyState(_0x6119d0){const _0x4cb83b=a27_0x3cf7;switch(_0x6119d0){case _0x4cb83b(0x1b7):return a27_0x50d849['green'](_0x4cb83b(0x1ab));case _0x4cb83b(0x1d1):return a27_0x50d849[_0x4cb83b(0x286)](_0x4cb83b(0x1be));case _0x4cb83b(0x222):return a27_0x50d849['yellow']('(paused)');case _0x4cb83b(0x2a6):return a27_0x50d849[_0x4cb83b(0x285)](_0x4cb83b(0x1da));case _0x4cb83b(0x21b):return a27_0x50d849[_0x4cb83b(0x286)]('(archived)');default:return'('+_0x6119d0+')';}}function formatJourneyItem(_0x179471,_0x98ad4c='',_0x3befc0){const _0x326fb5=a27_0x3cf7,_0x4863a9=formatJourneyState(_0x179471[_0x326fb5(0x27f)]),_0x179589=_0x3befc0?hyperlink(_0x179471[_0x326fb5(0x23f)],_0x3befc0):_0x179471[_0x326fb5(0x23f)];return _0x98ad4c+_0x326fb5(0x1d4)+_0x179589+'\x20'+_0x4863a9;}function escapeRegex(_0x13be22){const _0xfc2e73=a27_0x3cf7;return _0x13be22[_0xfc2e73(0x250)](/[.*+?^${}()|[\]\\]/g,_0xfc2e73(0x2ae));}function globToRegex(_0x559bf7){const _0x3901b=a27_0x3cf7,_0x410265=_0x559bf7[_0x3901b(0x1b4)]('*')[_0x3901b(0x29c)](escapeRegex);return new RegExp(_0x410265[_0x3901b(0x1c7)]('.*'),'i');}function buildRuleToNameMapping(_0x7bc18){const _0x3411d5=a27_0x3cf7,_0x3cfca8=new Map();if(_0x7bc18['segments'])for(const [_0x18dde4,_0x18679a]of Object['entries'](_0x7bc18[_0x3411d5(0x2ba)])){if(_0x18679a[_0x3411d5(0x25c)]){const _0x422868=serializeRule(_0x18679a[_0x3411d5(0x25c)]),_0x124491=_0x3cfca8[_0x3411d5(0x1e5)](_0x422868);_0x124491?_0x124491[_0x3411d5(0x228)](_0x18dde4):_0x3cfca8[_0x3411d5(0x1f4)](_0x422868,[_0x18dde4]);}}return _0x3cfca8;}async function resolveJourneyIdFromInput(_0x2949c0,_0x1c308a,_0x194fa2){const _0x19a016=a27_0x3cf7,_0x1c307b=await resolveJourneyTarget(_0x2949c0,_0x1c308a['parentSegment'],_0x1c308a[_0x19a016(0x204)]),_0x43a3ef=_0x1c307b[_0x19a016(0x21f)];if(!_0x43a3ef)throw new SDKError(ErrorCode[_0x19a016(0x1d5)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x386498=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x194fa2['segment'][_0x19a016(0x1e6)](_0x43a3ef),{'verbose':_0x1c308a[_0x19a016(0x204)]}),_0x39e596=_0x386498[_0x19a016(0x1f9)],_0x3030b9=await withSpinner(_0x19a016(0x219),()=>_0x194fa2[_0x19a016(0x23a)][_0x19a016(0x267)](_0x39e596,_0x1c307b['journeyName']),{'verbose':_0x1c308a[_0x19a016(0x204)]});return{'journeyId':_0x3030b9['data'],'journeyName':_0x1c307b['journeyName'],'parentSegmentId':_0x39e596};}async function resolveJourneyTarget(_0x28f4ee,_0xfca37a,_0x11eff0){const _0x1f725d=a27_0x3cf7;if(isYamlFilePath(_0x28f4ee))try{const _0x1243d3=await resolveYamlFilePath(_0x28f4ee);return _0x11eff0&&(console[_0x1f725d(0x24c)](_0x1f725d(0x1b5)+_0x28f4ee),console[_0x1f725d(0x24c)]('\x20\x20Parent\x20segment:\x20'+_0x1243d3[_0x1f725d(0x21f)]),console[_0x1f725d(0x24c)](_0x1f725d(0x276)+_0x1243d3[_0x1f725d(0x1db)]),console[_0x1f725d(0x24c)](_0x1f725d(0x27a)+(_0x1243d3[_0x1f725d(0x1ba)]||_0x1f725d(0x1ef)))),{'journeyName':_0x1243d3[_0x1f725d(0x1db)],'parentSegment':_0x1243d3[_0x1f725d(0x21f)],'resolved':_0x1243d3};}catch(_0x1dfa69){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1dfa69['message']);}if(!_0xfca37a)throw new SDKError(ErrorCode[_0x1f725d(0x1d5)],_0x1f725d(0x232));return{'journeyName':_0x28f4ee,'parentSegment':_0xfca37a};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x19f833(0x288)]=a27_0x19f833(0x1e7);async[a27_0x19f833(0x291)](_0x1d90c3){const _0x237628=a27_0x19f833,{options:_0x11bfdf,args:_0x203c74,tdx:_0x22d633}=_0x1d90c3,_0xa1021a=_0x203c74[0x0],_0x2ff624=_0x11bfdf['parentSegment'];if(!_0x2ff624)return console[_0x237628(0x24c)](_0x237628(0x2a7)),console[_0x237628(0x24c)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x196aa6=await withSpinner(_0x237628(0x244),()=>_0x22d633[_0x237628(0x235)][_0x237628(0x1e6)](_0x2ff624),{'verbose':_0x11bfdf[_0x237628(0x204)]}),_0x5e132c=_0x196aa6[_0x237628(0x1f9)];_0x11bfdf[_0x237628(0x204)]&&(console['error'](_0x237628(0x271)+_0x2ff624+_0x237628(0x1c1)+_0x5e132c+')'),_0xa1021a&&console[_0x237628(0x24c)]('Pattern:\x20'+_0xa1021a));const _0xe4644f=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x22d633[_0x237628(0x235)][_0x237628(0x1aa)](_0x5e132c),{'verbose':_0x11bfdf[_0x237628(0x204)]}),_0xa54110=_0xe4644f[_0x237628(0x1f9)],_0x12ef51=_0xa54110[_0x237628(0x243)],_0x5017db=await withSpinner(_0x237628(0x254),()=>_0x22d633[_0x237628(0x23a)][_0x237628(0x240)](_0x5e132c,_0x12ef51),{'verbose':_0x11bfdf[_0x237628(0x204)]});let _0x559bc8=_0x5017db['data']['journeys'];const _0x9a4269=_0x5017db[_0x237628(0x1f9)][_0x237628(0x1bf)],_0xc58194=new Map();for(const _0x5bca8e of _0x9a4269){_0xc58194[_0x237628(0x1f4)](_0x5bca8e['id'],_0x5bca8e['name']);}if(_0xa1021a){const _0x7341a1=globToRegex(_0xa1021a);_0x559bc8=_0x559bc8[_0x237628(0x1c3)](_0x1c98f9=>_0x7341a1['test'](_0x1c98f9[_0x237628(0x23f)]));}console[_0x237628(0x24c)](_0x237628(0x1d9)+_0x559bc8['length']+_0x237628(0x1f7)+(_0x559bc8[_0x237628(0x206)]!==0x1?'s':''));const _0x168d05=_0x2f8451=>{const _0x5706ed=_0x237628;return getConsoleNextUrl(_0x11bfdf['site'],_0x5706ed(0x20b)+_0x5e132c+'/e/'+_0x2f8451+'/j/da');};if(_0x11bfdf[_0x237628(0x1df)]===_0x237628(0x252))await handleSDKOutput(_0x559bc8,_0x11bfdf);else{if(_0x11bfdf[_0x237628(0x1df)]===_0x237628(0x246)){const _0x2640a0=_0x559bc8[_0x237628(0x29c)](_0x543a3a=>({..._0x543a3a,'url':_0x168d05(_0x543a3a['id'])}));await handleSDKOutput(_0x2640a0,_0x11bfdf);}else{console[_0x237628(0x28d)]('['+_0x2ff624+']');const _0x4bd55b=new Map(),_0x39eb88=[];for(const _0x367352 of _0x559bc8){if(!_0x367352[_0x237628(0x299)]||_0x367352['folderId']===_0x12ef51)_0x39eb88[_0x237628(0x228)](_0x367352);else{const _0x158e2a=_0x4bd55b['get'](_0x367352[_0x237628(0x299)])||[];_0x158e2a[_0x237628(0x228)](_0x367352),_0x4bd55b[_0x237628(0x1f4)](_0x367352['folderId'],_0x158e2a);}}const _0x1f8ac3=(_0x60d0a7,_0x3cce2e)=>_0x60d0a7['journeyBundleName'][_0x237628(0x1fa)](_0x3cce2e[_0x237628(0x23f)],undefined,{'sensitivity':_0x237628(0x2b2)});_0x39eb88[_0x237628(0x213)](_0x1f8ac3);for(const _0x4fe321 of _0x39eb88){console[_0x237628(0x28d)](formatJourneyItem(_0x4fe321,'',_0x168d05(_0x4fe321['id'])));}const _0x3cda2e=[..._0x4bd55b[_0x237628(0x21e)]()][_0x237628(0x213)]((_0x491388,_0x308203)=>{const _0x409dbe=_0x237628,_0xbfbdd2=_0xc58194[_0x409dbe(0x1e5)](_0x491388[0x0])||_0x491388[0x0],_0x4ea57f=_0xc58194['get'](_0x308203[0x0])||_0x308203[0x0];return _0xbfbdd2[_0x409dbe(0x1fa)](_0x4ea57f,undefined,{'sensitivity':'base'});});for(const [_0x2051e3,_0x3d5dc1]of _0x3cda2e){const _0xebc31a=_0xc58194[_0x237628(0x1e5)](_0x2051e3)||_0x2051e3;console[_0x237628(0x28d)]('📁\x20'+_0xebc31a),_0x3d5dc1[_0x237628(0x213)](_0x1f8ac3);for(const _0x3f4a0e of _0x3d5dc1){console[_0x237628(0x28d)](formatJourneyItem(_0x3f4a0e,'\x20\x20',_0x168d05(_0x3f4a0e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x224);[a27_0x19f833(0x288)]=a27_0x19f833(0x293);async[a27_0x19f833(0x291)](_0x410666){const _0x9744c5=a27_0x19f833,{options:_0x267b32,args:_0x1d671c,tdx:_0x2759c8}=_0x410666,_0x2d93a3=_0x1d671c[0x0];if(!_0x2d93a3)return console[_0x9744c5(0x24c)](_0x9744c5(0x292)),console[_0x9744c5(0x24c)](_0x9744c5(0x26a)),console[_0x9744c5(0x24c)](_0x9744c5(0x20f)),console[_0x9744c5(0x24c)](_0x9744c5(0x1c2)),0x1;_0x267b32[_0x9744c5(0x204)]&&console[_0x9744c5(0x24c)](_0x9744c5(0x1dd)+_0x2d93a3);const {journeyId:_0x3ab156,parentSegmentId:_0x5cdf08}=await resolveJourneyIdFromInput(_0x2d93a3,_0x267b32,_0x2759c8);if(_0x267b32[_0x9744c5(0x1de)]){const _0x3955a2=getConsoleNextUrl(_0x267b32[_0x9744c5(0x280)],_0x9744c5(0x20b)+_0x5cdf08+'/e/'+_0x3ab156+_0x9744c5(0x2ab));return console[_0x9744c5(0x24c)](a27_0x50d849['green']('✔')+_0x9744c5(0x26f)+a27_0x50d849[_0x9744c5(0x1dc)](_0x3955a2)),openBrowser(_0x3955a2),0x0;}const _0x335685=await withSpinner(_0x9744c5(0x25e),()=>_0x2759c8[_0x9744c5(0x23a)][_0x9744c5(0x2ad)](_0x3ab156),{'verbose':_0x267b32[_0x9744c5(0x204)]}),_0x2c0d08=_0x335685['data'],_0x16c1ca=_0x267b32['includeStats'];let _0x1cd588;if(_0x16c1ca)try{const _0x29d0ae=await withSpinner(_0x9744c5(0x248),()=>_0x2759c8[_0x9744c5(0x23a)]['getStatistics'](_0x3ab156),{'verbose':_0x267b32[_0x9744c5(0x204)]});_0x1cd588=_0x29d0ae[_0x9744c5(0x1f9)];}catch{_0x267b32[_0x9744c5(0x204)]&&console[_0x9744c5(0x24c)]('\x20\x20Statistics\x20not\x20available');}const _0x3b32e6=getConsoleNextUrl(_0x267b32[_0x9744c5(0x280)],_0x9744c5(0x20b)+_0x5cdf08+_0x9744c5(0x238)+_0x3ab156+_0x9744c5(0x2ab)),_0x10f5c2={'id':_0x2c0d08['id'],'name':_0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x273)],'description':_0x2c0d08['attributes'][_0x9744c5(0x288)],'state':_0x2c0d08['attributes'][_0x9744c5(0x27f)],'paused':_0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x222)],'reentry_mode':_0x2c0d08['attributes'][_0x9744c5(0x23d)],'stages':_0x2c0d08[_0x9744c5(0x2b5)]['journeyStages']?.[_0x9744c5(0x206)]||0x0,..._0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x268)]&&{'goal':_0x2c0d08['attributes'][_0x9744c5(0x268)][_0x9744c5(0x273)]},..._0x1cd588&&{'statistics':{'size':_0x1cd588['size'],'entered':_0x1cd588['enteredSize'],'goal_achieved':_0x1cd588['goalSize'],'completion_rate':_0x1cd588[_0x9744c5(0x29d)],'exit_or_jump':_0x1cd588['exitOrJumpSize'],'exit_or_jump_rate':_0x1cd588[_0x9744c5(0x1b6)],'stages':_0x1cd588[_0x9744c5(0x2b9)]}},'url':_0x3b32e6};return await handleSingleObjectOutput(_0x10f5c2,_0x267b32),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x21d);['description']=a27_0x19f833(0x29f);async[a27_0x19f833(0x291)](_0x5d3240){const _0x503828=a27_0x19f833,{options:_0x3562fe,args:_0x442c80,tdx:_0x202e8f}=_0x5d3240,_0x3b38b6=_0x442c80[0x0];if(!requireNameOrPath(_0x3b38b6))return 0x1;_0x3562fe[_0x503828(0x204)]&&console[_0x503828(0x24c)](_0x503828(0x1dd)+_0x3b38b6);const _0x55fbcc=_0x3562fe,_0x52f25b=_0x55fbcc['from'],_0x12a920=_0x55fbcc['to'],_0x55621f=_0x55fbcc[_0x503828(0x231)],_0x105b99=_0x55fbcc[_0x503828(0x1e3)];_0x55621f&&!_0x52f25b&&!_0x12a920&&console[_0x503828(0x24c)](_0x503828(0x260));const _0x2a3f28=_0x55621f?withJsonFormat(_0x3562fe):_0x3562fe,{journeyId:_0xd19a76,journeyName:_0x2e8613}=await resolveJourneyIdFromInput(_0x3b38b6,_0x2a3f28,_0x202e8f),_0x49ede8=_0x52f25b||_0x12a920?{'from':_0x52f25b,'to':_0x12a920}:undefined,_0x2cb44c=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x503828(0x1fb)]([_0x202e8f[_0x503828(0x23a)][_0x503828(0x2ad)](_0xd19a76),_0x202e8f['journey'][_0x503828(0x1cb)](_0xd19a76,_0x49ede8)]),{'verbose':_0x2a3f28['verbose']}),[_0x3ff106,_0x5992d3]=_0x2cb44c['data'];if(!_0x5992d3||_0x5992d3[_0x503828(0x279)]===null)return console[_0x503828(0x24c)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x2e8613),console['error'](_0x503828(0x23e)),0x0;const _0x1f34ce=buildStageNameMap(_0x3ff106),_0x5ba849=!!(_0x49ede8&&_0x5992d3[_0x503828(0x22f)]?.['length']),_0x1f4cf5={'stageNameMap':_0x1f34ce,'hasPeriod':_0x5ba849,'includeHistory':!!_0x55621f};if(_0x105b99&&_0x5992d3[_0x503828(0x2b9)]){const _0x12cc48=_0x5992d3['stages'][_0x503828(0x297)](_0x29e75b=>{const _0x18be80=_0x503828,_0x3fdc07=_0x1f34ce['get'](_0x29e75b['id'])??'';return _0x3fdc07[_0x18be80(0x25a)]()===_0x105b99[_0x18be80(0x25a)]();});if(_0x12cc48)return await handleSingleObjectOutput(formatStageStats(_0x12cc48,_0x1f4cf5),_0x2a3f28),0x0;const _0x2acde0=_0x5992d3['stages'][_0x503828(0x29c)](_0x14485d=>_0x1f34ce[_0x503828(0x1e5)](_0x14485d['id'])??_0x14485d['id']);return console[_0x503828(0x24c)]('Error:\x20Stage\x20\x22'+_0x105b99+_0x503828(0x207)),console['error'](_0x503828(0x1e2)+_0x2acde0[_0x503828(0x1c7)](',\x20')),0x1;}const _0x269cdd=_0x5992d3[_0x503828(0x2b9)]?.['map'](_0x1f7b12=>formatStageStats(_0x1f7b12,_0x1f4cf5)),_0x2926b6=assembleJourneyStats(_0x5992d3,{'from':_0x52f25b,'to':_0x12a920,'includeHistory':_0x55621f});return await this[_0x503828(0x1c0)](_0x2926b6,_0x269cdd??[],_0x2a3f28),0x0;}async[a27_0x19f833(0x1c0)](_0x6e816a,_0x1d0604,_0x2e4a37){const _0x5ad736=a27_0x19f833,_0x3f12fc=_0x2e4a37[_0x5ad736(0x1df)]==='json'||_0x2e4a37[_0x5ad736(0x1df)]===_0x5ad736(0x29b)||_0x2e4a37[_0x5ad736(0x246)]||_0x2e4a37[_0x5ad736(0x29b)];if(_0x3f12fc){_0x6e816a[_0x5ad736(0x2b9)]=_0x1d0604,await handleSingleObjectOutput(_0x6e816a,_0x2e4a37);return;}await handleSingleObjectOutput(_0x6e816a,_0x2e4a37);for(const _0x1ca9da of _0x1d0604){console[_0x5ad736(0x28d)](''),console[_0x5ad736(0x28d)](String(a27_0x50d849[_0x5ad736(0x1dc)][_0x5ad736(0x28c)]('['+_0x1ca9da[_0x5ad736(0x273)]+']'))+a27_0x50d849[_0x5ad736(0x286)]('\x20'+_0x1ca9da['id']));const {id:_0x97b37c,name:_0x3ee12b,..._0x393063}=_0x1ca9da;await handleSingleObjectOutput(_0x393063,_0x2e4a37);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a27_0x19f833(0x2a3);[a27_0x19f833(0x288)]=a27_0x19f833(0x20e);async['execute'](_0x4c1b78){const _0x152bdf=a27_0x19f833,{options:_0x50dd14,args:_0x126d36,tdx:_0x14594c}=_0x4c1b78,_0xd26a57=_0x126d36[0x0];if(!requireNameOrPath(_0xd26a57))return 0x1;_0x50dd14[_0x152bdf(0x204)]&&console[_0x152bdf(0x24c)](_0x152bdf(0x1dd)+_0xd26a57);const _0x5e3da1=_0x50dd14,_0x408f8b=_0x5e3da1[_0x152bdf(0x27d)],_0x570c32=_0x5e3da1[_0x152bdf(0x2a0)],_0x1de7e5=_0x5e3da1['to'],_0x9d8d66=_0x5e3da1[_0x152bdf(0x255)];if(_0x408f8b&&_0x408f8b!=='conversion'&&_0x408f8b!=='activation')return console[_0x152bdf(0x24c)](_0x152bdf(0x20d)+_0x408f8b+_0x152bdf(0x223)),0x1;const _0x5d4a52=withJsonFormat(_0x50dd14),{journeyId:_0x35f3bc,journeyName:_0x5bbf21}=await resolveJourneyIdFromInput(_0xd26a57,_0x5d4a52,_0x14594c),_0x2968e1={'type':_0x408f8b,'from':_0x570c32,'to':_0x1de7e5,'limit':_0x9d8d66},_0xc9a37a=await withSpinner(_0x152bdf(0x1bc),()=>_0x14594c['journey'][_0x152bdf(0x1b0)](_0x35f3bc,_0x2968e1),{'verbose':_0x5d4a52['verbose']}),_0x151095=_0xc9a37a[_0x152bdf(0x1f9)],_0x3acf4d=_0x151095[_0x152bdf(0x251)]&&(_0x151095[_0x152bdf(0x251)]['nodes'][_0x152bdf(0x206)]>0x0||_0x151095[_0x152bdf(0x251)][_0x152bdf(0x2a9)][_0x152bdf(0x206)]>0x0),_0x2cb60b=_0x151095[_0x152bdf(0x1b3)]&&_0x151095['activation'][_0x152bdf(0x206)]>0x0;if(!_0x3acf4d&&!_0x2cb60b)return console[_0x152bdf(0x24c)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x5bbf21),console['error'](_0x152bdf(0x237)),_0x570c32&&_0x1de7e5&&console[_0x152bdf(0x24c)](_0x152bdf(0x1af)),0x0;return await handleSingleObjectOutput(_0x151095,_0x5d4a52),0x0;}}function formatStageStats(_0x541f28,_0x516dfb){const _0x35260c=a27_0x19f833,_0x523d6e=_0x516dfb['hasPeriod']&&_0x541f28['history']?.[_0x35260c(0x206)]?aggregateStageHistory(_0x541f28[_0x35260c(0x22f)]):{'size':_0x541f28['size'],'entered':_0x541f28[_0x35260c(0x212)],'milestone':_0x541f28[_0x35260c(0x1ff)],'milestone_rate':_0x541f28['completeMilestoneRate'],'exit_or_jump':_0x541f28[_0x35260c(0x1fc)],'exit_or_jump_rate':_0x541f28[_0x35260c(0x1b6)]},_0x45fb4e={'id':_0x541f28['id'],'name':_0x516dfb[_0x35260c(0x1f6)][_0x35260c(0x1e5)](_0x541f28['id'])??_0x541f28['id'],..._0x523d6e};return _0x516dfb['hasPeriod']&&_0x516dfb[_0x35260c(0x231)]&&_0x541f28['history']&&(_0x45fb4e[_0x35260c(0x22f)]=_0x541f28[_0x35260c(0x22f)]),_0x45fb4e;}export class JourneyPauseCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x2b3);[a27_0x19f833(0x288)]='Pause\x20a\x20running\x20journey';async['execute'](_0x34ee15){const _0x3bd639=a27_0x19f833,{options:_0x3a33eb,args:_0x2f9640,tdx:_0x2cb894}=_0x34ee15,_0x80ea91=_0x2f9640[0x0];if(!requireNameOrPath(_0x80ea91))return 0x1;_0x3a33eb[_0x3bd639(0x204)]&&console['error']('Input:\x20'+_0x80ea91);const {journeyId:_0x40d73d,journeyName:_0x1435ac}=await resolveJourneyIdFromInput(_0x80ea91,_0x3a33eb,_0x2cb894);if(!_0x3a33eb['yes']){const _0x50e644=await confirm(_0x3bd639(0x24e)+_0x1435ac+'\x22?');if(!_0x50e644)return console[_0x3bd639(0x24c)](_0x3bd639(0x28a)),0x0;}const _0x509214=await withSpinner(_0x3bd639(0x20c),()=>_0x2cb894[_0x3bd639(0x23a)][_0x3bd639(0x234)](_0x40d73d),{'verbose':_0x3a33eb[_0x3bd639(0x204)]}),_0x7a1279=_0x509214[_0x3bd639(0x1f9)];return console[_0x3bd639(0x24c)]('✔\x20Journey\x20\x22'+_0x7a1279[_0x3bd639(0x2b5)][_0x3bd639(0x273)]+_0x3bd639(0x214)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x1f3);[a27_0x19f833(0x288)]='Resume\x20a\x20paused\x20journey';async[a27_0x19f833(0x291)](_0x54121e){const _0x44e5ba=a27_0x19f833,{options:_0x1df14d,args:_0x3fb439,tdx:_0x1e96fa}=_0x54121e,_0x1dc42e=_0x3fb439[0x0];if(!requireNameOrPath(_0x1dc42e))return 0x1;_0x1df14d['verbose']&&console['error'](_0x44e5ba(0x1dd)+_0x1dc42e);const {journeyId:_0x177b9a,journeyName:_0x285788}=await resolveJourneyIdFromInput(_0x1dc42e,_0x1df14d,_0x1e96fa);if(!_0x1df14d[_0x44e5ba(0x256)]){const _0x2c60b9=await confirm(_0x44e5ba(0x274)+_0x285788+'\x22?');if(!_0x2c60b9)return console[_0x44e5ba(0x24c)](_0x44e5ba(0x28a)),0x0;}const _0x512405=await withSpinner(_0x44e5ba(0x277),()=>_0x1e96fa['journey'][_0x44e5ba(0x1d0)](_0x177b9a),{'verbose':_0x1df14d['verbose']}),_0x52b065=_0x512405[_0x44e5ba(0x1f9)];return console[_0x44e5ba(0x24c)](_0x44e5ba(0x210)+_0x52b065['attributes'][_0x44e5ba(0x273)]+_0x44e5ba(0x1fe)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x19f833(0x20a);[a27_0x19f833(0x288)]=a27_0x19f833(0x208);async[a27_0x19f833(0x291)](_0x128b9a){const _0x17f7c7=a27_0x19f833,{options:_0x1430f0,args:_0x2128fa,tdx:_0x52ade8}=_0x128b9a,_0x42603a=_0x1430f0,_0x4a94a0=_0x2128fa[0x0],_0x1b5f6f=_0x4a94a0&&isYamlFilePath(_0x4a94a0),_0x5c6970=await resolveTarget({'arg':_0x1b5f6f?_0x4a94a0:undefined,'contextParent':_0x1430f0[_0x17f7c7(0x21f)],'cwd':process[_0x17f7c7(0x241)]()});if(!isSuccessfulResolution(_0x5c6970))return _0x5c6970[_0x17f7c7(0x1f2)]===_0x17f7c7(0x230)?(console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x29a)](_0x17f7c7(0x2b6))),console[_0x17f7c7(0x24c)](_0x17f7c7(0x26d)),console['error'](_0x17f7c7(0x1bb)),console[_0x17f7c7(0x24c)](_0x17f7c7(0x278)),console['error'](_0x17f7c7(0x28b))):(console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x201)]('Error:\x20'+_0x5c6970[_0x17f7c7(0x227)]+'\x0a')),_0x5c6970[_0x17f7c7(0x24d)]&&console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1dc)](_0x5c6970['helpText']))),0x1;let _0x380e14=_0x1b5f6f?undefined:_0x4a94a0,_0x56710a,_0x3b320a;_0x5c6970[_0x17f7c7(0x27d)]===_0x17f7c7(0x23b)&&(_0x380e14=_0x5c6970[_0x17f7c7(0x202)],_0x56710a=_0x5c6970[_0x17f7c7(0x1ac)],_0x3b320a=_0x5c6970['folderPath']);const _0x4a2652=_0x5c6970[_0x17f7c7(0x1ae)],_0x27d0ee=_0x5c6970[_0x17f7c7(0x27b)];_0x42603a['verbose']&&(console[_0x17f7c7(0x24c)](_0x17f7c7(0x271)+_0x4a2652),console[_0x17f7c7(0x24c)](_0x17f7c7(0x2a4)+_0x27d0ee),_0x380e14&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x2a1)+_0x380e14),_0x56710a&&console[_0x17f7c7(0x24c)]('Target\x20file:\x20'+_0x56710a),_0x3b320a&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x26e)+_0x3b320a));const _0x1ecc95=await withSpinner(_0x17f7c7(0x244),()=>_0x52ade8[_0x17f7c7(0x235)][_0x17f7c7(0x1e6)](_0x4a2652),{'verbose':_0x1430f0[_0x17f7c7(0x204)]}),_0x592679=_0x1ecc95['data'],{journeys:_0x2ee82d,folders:_0x1b35a0}=await withSpinner(_0x17f7c7(0x263),async()=>{const _0x2ee45e=_0x17f7c7,[_0x57f0ba,_0x14f452]=await Promise[_0x2ee45e(0x1fb)]([_0x52ade8[_0x2ee45e(0x23a)]['listJourneysFromParentSegment'](_0x592679,undefined,{'includeAllVersions':!![]}),_0x52ade8['segment'][_0x2ee45e(0x27c)](_0x592679)]);return{'journeys':_0x57f0ba,'folders':_0x14f452};},{'verbose':_0x1430f0['verbose']})[_0x17f7c7(0x218)](_0x456718=>_0x456718[_0x17f7c7(0x1f9)]);let _0x44aae5=_0x2ee82d;const _0x2c010c=buildFolderIdToPathMap(_0x1b35a0);if(_0x380e14){const _0x36bacb=_0x44aae5[_0x17f7c7(0x1c3)](_0x4d6870=>_0x4d6870[_0x17f7c7(0x23f)]['toLowerCase']()===_0x380e14[_0x17f7c7(0x25a)]());if(_0x36bacb['length']===0x0)return console[_0x17f7c7(0x24c)](_0x17f7c7(0x217)+_0x380e14),console[_0x17f7c7(0x24c)](_0x17f7c7(0x1b2)),0x1;_0x44aae5=_0x36bacb;}if(_0x3b320a!==undefined){const _0xa282e=_0x44aae5[_0x17f7c7(0x1c3)](_0x2493dc=>{const _0x26994c=_0x17f7c7,_0x28aa48=_0x2493dc['folderId']?_0x2c010c[_0x26994c(0x1e5)](_0x2493dc[_0x26994c(0x299)])||'':'';return _0x28aa48===_0x3b320a;});if(_0xa282e[_0x17f7c7(0x206)]===0x0&&_0x44aae5[_0x17f7c7(0x206)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x380e14+_0x17f7c7(0x22b)+(_0x3b320a||_0x17f7c7(0x1b8))),console[_0x17f7c7(0x24c)](_0x17f7c7(0x225));for(const _0x3a30e7 of _0x44aae5){const _0x558429=_0x3a30e7[_0x17f7c7(0x299)]?_0x2c010c[_0x17f7c7(0x1e5)](_0x3a30e7[_0x17f7c7(0x299)])||'':'';console[_0x17f7c7(0x24c)]('\x20\x20-\x20'+(_0x558429||_0x17f7c7(0x1ef))+'/'+_0x3a30e7[_0x17f7c7(0x23f)]);}return 0x1;}_0x44aae5=_0xa282e;}if(_0x44aae5[_0x17f7c7(0x206)]===0x0)return console[_0x17f7c7(0x24c)](_0x17f7c7(0x29e)),0x0;const _0x48e3f8=new Map();for(const _0x3e2a66 of _0x44aae5){const _0x2873f4=_0x3e2a66[_0x17f7c7(0x262)];!_0x48e3f8[_0x17f7c7(0x24a)](_0x2873f4)&&_0x48e3f8[_0x17f7c7(0x1f4)](_0x2873f4,[]),_0x48e3f8[_0x17f7c7(0x1e5)](_0x2873f4)[_0x17f7c7(0x228)](_0x3e2a66);}for(const _0x772000 of _0x48e3f8[_0x17f7c7(0x1d2)]()){_0x772000['sort']((_0x3cfa54,_0x34cd1c)=>(_0x3cfa54['versionNumber']||0x0)-(_0x34cd1c[_0x17f7c7(0x258)]||0x0));}const _0x35991f=[],{idToEmailMap:_0x5098dc,connectionIdToNameMap:_0x9f6c1f}=await withSpinner(_0x17f7c7(0x1c5),async()=>{const _0x7e412f=_0x17f7c7,[_0x293e7f,_0x23c2d1]=await Promise['all']([_0x52ade8[_0x7e412f(0x239)]['buildIdToEmailMap'](),_0x52ade8[_0x7e412f(0x265)][_0x7e412f(0x1c4)]()]);return{'idToEmailMap':_0x293e7f,'connectionIdToNameMap':_0x23c2d1};},{'verbose':_0x1430f0[_0x17f7c7(0x204)]})[_0x17f7c7(0x218)](_0x1b8782=>_0x1b8782[_0x17f7c7(0x1f9)]);for(const _0x317e03 of _0x48e3f8['values']()){const _0x1abb6d=_0x317e03[0x0][_0x17f7c7(0x23f)],_0x684a5=_0x317e03[0x0][_0x17f7c7(0x299)],_0x586dd6=_0x684a5?_0x2c010c[_0x17f7c7(0x1e5)](_0x684a5)||'':'',_0x4b783e=_0x586dd6?a27_0x3be399[_0x17f7c7(0x1c7)](_0x27d0ee,_0x586dd6):_0x27d0ee,_0x439a0a=_0x56710a||a27_0x3be399[_0x17f7c7(0x1c7)](_0x4b783e,sanitizeFileName(_0x1abb6d)+_0x17f7c7(0x221));let _0x43dba8,_0x2bdee3;if(existsSync(_0x439a0a))try{const _0x2634ad=readFileSync(_0x439a0a,'utf-8'),_0x5131f8=parseYamlString(_0x2634ad);_0x2bdee3=_0x5131f8,_0x43dba8=buildRuleToNameMapping(_0x5131f8),_0x42603a[_0x17f7c7(0x204)]&&_0x43dba8[_0x17f7c7(0x25d)]>0x0&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x266)+_0x43dba8[_0x17f7c7(0x25d)]+_0x17f7c7(0x2b1)+_0x1abb6d);}catch(_0x2463cd){_0x42603a[_0x17f7c7(0x204)]&&console['error'](_0x17f7c7(0x294)+_0x2463cd[_0x17f7c7(0x227)]);}const _0x3911c9=[],_0x3d4a39=new Set(),_0x13b5c9=new Map(),_0x162602=new Map(),_0x132b0e=new Set(),_0x415e5f=new Map(),_0x5763f5=new Map(),_0x39ac59=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x1abb6d+'...',async _0x24c1a2=>{const _0x3c7ca5=_0x17f7c7;for(const _0x33ba3f of _0x317e03){const _0x5d5171=_0x317e03['length']>0x1?_0x33ba3f[_0x3c7ca5(0x23f)]+'\x20v'+(_0x33ba3f[_0x3c7ca5(0x258)]||0x1):_0x33ba3f[_0x3c7ca5(0x23f)];_0x24c1a2[_0x3c7ca5(0x249)](_0x3c7ca5(0x295)+_0x5d5171);const _0x21d4d0=await _0x52ade8['journey'][_0x3c7ca5(0x2ad)](_0x33ba3f['id']),_0x273797=_0x21d4d0['attributes']?.['audienceId'],_0x4352a0={'resolveSegment':async _0x3a9249=>{const _0x380baa=_0x3c7ca5;if(!_0x273797)return{'name':_0x3a9249,'isJourneyLocal':![]};const _0x1e06ba=_0x13b5c9['get'](_0x3a9249);if(_0x1e06ba)return _0x1e06ba;try{const _0x3b654d=await _0x52ade8[_0x380baa(0x235)][_0x380baa(0x1f0)](_0x273797,_0x3a9249),_0x3c720a=_0x3b654d[_0x380baa(0x2b4)]===SEGMENT_KIND_JOURNEY;let _0x5d9870,_0x5f3957=_0x3b654d[_0x380baa(0x273)];if(_0x3c720a&&_0x3b654d['rule']){const _0x40a868=await segmentResponseToDef(_0x3b654d,{'resolveSegmentName':async _0xb508f4=>{const _0x46aacd=_0x380baa,_0x14a74d=_0x13b5c9[_0x46aacd(0x1e5)](_0xb508f4);if(_0x14a74d)return _0x14a74d[_0x46aacd(0x273)];const _0x164119=await _0x4352a0[_0x46aacd(0x1ce)](_0xb508f4);return _0x164119[_0x46aacd(0x273)];}}),_0x528685=_0x40a868[_0x380baa(0x25c)];_0x5d9870={'description':_0x3b654d['description'],'rule':_0x528685};const _0x14f23f=serializeRule(_0x528685),_0x1e7270=_0x162602['get'](_0x14f23f);if(_0x1e7270)_0x5f3957=_0x1e7270,_0x5d9870=undefined,_0x42603a[_0x380baa(0x204)]&&console['error'](_0x380baa(0x253)+_0x3b654d[_0x380baa(0x273)]+_0x380baa(0x283)+_0x1e7270);else{let _0xacffb7=![];if(_0x43dba8){const _0x1a69fc=_0x43dba8[_0x380baa(0x1e5)](_0x14f23f);if(_0x1a69fc){const _0x3d6e5e=_0x1a69fc['find'](_0x3cc225=>!_0x3d4a39[_0x380baa(0x24a)](_0x3cc225));_0x3d6e5e&&(_0x5f3957=_0x3d6e5e,_0x3d4a39[_0x380baa(0x1ea)](_0x3d6e5e),_0x162602[_0x380baa(0x1f4)](_0x14f23f,_0x3d6e5e),_0xacffb7=!![],_0x42603a['verbose']&&console[_0x380baa(0x24c)](_0x380baa(0x2af)+_0x3d6e5e+_0x380baa(0x1ed)));}}if(!_0xacffb7){const _0x415f8d=generateJourneyLocalName(_0x3b654d[_0x380baa(0x273)]);_0x415f8d&&(_0x5f3957=_0x415f8d);let _0x54bf11=_0x5f3957,_0x37b71e=0x2;while(_0x3d4a39[_0x380baa(0x24a)](_0x54bf11)){_0x54bf11=_0x5f3957+'_'+_0x37b71e,_0x37b71e++;}_0x3d4a39[_0x380baa(0x1ea)](_0x54bf11),_0x162602[_0x380baa(0x1f4)](_0x14f23f,_0x54bf11),_0x5f3957=_0x54bf11;}}}const _0x551b13={'name':_0x5f3957,'isJourneyLocal':_0x3c720a,'definition':_0x5d9870};return _0x13b5c9['set'](_0x3a9249,_0x551b13),_0x551b13;}catch(_0x12a642){return _0x1430f0[_0x380baa(0x204)]&&console[_0x380baa(0x24c)](_0x380baa(0x26c)+_0x3a9249+':\x20'+_0x12a642[_0x380baa(0x227)]),{'name':_0x3a9249,'isJourneyLocal':![]};}},'resolveActivation':async _0x20556b=>{const _0xadb995=_0x3c7ca5,_0x3922c0=_0x415e5f[_0xadb995(0x1e5)](_0x20556b);if(_0x3922c0)return _0x3922c0;try{const _0x2c7611=await _0x52ade8[_0xadb995(0x23a)][_0xadb995(0x226)](_0x33ba3f['id'],_0x20556b),_0x4dfc1d=journeyActivationStepToYaml(_0x2c7611,_0x5098dc,_0x9f6c1f),_0x3a7d03=JSON[_0xadb995(0x25b)]({'name':_0x4dfc1d[_0xadb995(0x273)],'connection':_0x4dfc1d[_0xadb995(0x265)],'connector_config':_0x4dfc1d['connector_config']}),_0x604f7=_0x5763f5[_0xadb995(0x1e5)](_0x3a7d03);if(_0x604f7){const _0xcadbde={'name':_0x604f7,'isJourneyLocal':!![],'definition':_0x4dfc1d};return _0x415e5f[_0xadb995(0x1f4)](_0x20556b,_0xcadbde),_0xcadbde;}const _0x4cdf2d=_0x2c7611[_0xadb995(0x2b5)]['activationParams']['name']||_0x20556b,_0x44dbb0=sanitizeYamlKey(_0x4cdf2d)||'activation_'+_0x20556b;let _0x31ead7=_0x44dbb0,_0x5272ed=0x2;while(_0x132b0e[_0xadb995(0x24a)](_0x31ead7)){_0x31ead7=_0x44dbb0+'_'+_0x5272ed,_0x5272ed++;}_0x132b0e[_0xadb995(0x1ea)](_0x31ead7),_0x5763f5[_0xadb995(0x1f4)](_0x3a7d03,_0x31ead7);const _0x4069f5={'name':_0x31ead7,'isJourneyLocal':!![],'definition':_0x4dfc1d};return _0x415e5f[_0xadb995(0x1f4)](_0x20556b,_0x4069f5),_0x4069f5;}catch(_0x392e67){return _0x1430f0['verbose']&&console[_0xadb995(0x24c)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x20556b+':\x20'+_0x392e67['message']),{'name':_0x20556b,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x194b01,_0x223e7a)=>{const _0x51bb6e=_0x3c7ca5;return resolveJumpTarget(_0x194b01,_0x223e7a,_0x39ac59,_0x24855b=>_0x52ade8[_0x51bb6e(0x23a)]['getJourney'](_0x24855b));}},_0x3e7db7=await journeyResponseToDef(_0x21d4d0,_0x4352a0);_0x3911c9[_0x3c7ca5(0x228)]({'item':_0x33ba3f,'yaml':_0x3e7db7});}},{'verbose':_0x1430f0[_0x17f7c7(0x204)]});const _0x580f17=await _0x52ade8[_0x17f7c7(0x23a)][_0x17f7c7(0x28e)](_0x317e03[0x0][_0x17f7c7(0x262)]),_0x303afa=buildMergedJourneyDef(_0x3911c9,_0x43dba8,_0x580f17),_0x9eff4d=normalizeJourneyDef(_0x303afa,_0x2bdee3),_0x322544=toYamlString(_0x9eff4d),_0xe67ffb=_0x56710a||a27_0x3be399[_0x17f7c7(0x1c7)](_0x4b783e,sanitizeFileName(_0x1abb6d)+'.yml');!_0x56710a&&_0x586dd6&&!existsSync(_0x4b783e)&&mkdirSync(_0x4b783e,{'recursive':!![]});const _0x3762fc=a27_0x3be399[_0x17f7c7(0x275)](process['cwd'](),_0xe67ffb);if(existsSync(_0xe67ffb)){const _0x3d035b=readFileSync(_0xe67ffb,_0x17f7c7(0x229)),_0x42d9e8=generateDiff(_0x3d035b,_0x322544),_0x142a5a=hasChanges(_0x42d9e8);_0x35991f[_0x17f7c7(0x228)]({'relativePath':_0x3762fc,'absolutePath':_0xe67ffb,'content':_0x322544,'isNew':![],'hasChanges':_0x142a5a,'diff':_0x142a5a?formatDiffWithColors(_0x42d9e8):undefined});}else _0x35991f['push']({'relativePath':_0x3762fc,'absolutePath':_0xe67ffb,'content':_0x322544,'isNew':!![],'hasChanges':![]});}const _0x81c9f=_0x35991f[_0x17f7c7(0x1c3)](_0x537651=>_0x537651['isNew']),_0x5b6695=_0x35991f['filter'](_0x5461b8=>!_0x5461b8[_0x17f7c7(0x220)]&&_0x5461b8[_0x17f7c7(0x1ec)]),_0x5aa4a3=_0x35991f[_0x17f7c7(0x1c3)](_0x503666=>!_0x503666[_0x17f7c7(0x220)]&&!_0x503666[_0x17f7c7(0x1ec)]),_0x538fea=_0x44aae5[_0x17f7c7(0x206)],_0x369eb1=_0x48e3f8[_0x17f7c7(0x25d)],_0x12408c=_0x538fea>_0x369eb1?'\x20('+_0x538fea+_0x17f7c7(0x2b8):'';console[_0x17f7c7(0x24c)](_0x17f7c7(0x1c9)),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['cyan'](_0x369eb1+_0x17f7c7(0x242))+a27_0x50d849['dim'](_0x12408c)),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['green']('+\x20'+_0x81c9f['length']+'\x20new\x20files')),console['error']('\x20\x20'+a27_0x50d849[_0x17f7c7(0x29a)]('~\x20'+_0x5b6695[_0x17f7c7(0x206)]+_0x17f7c7(0x287))),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['dim']('=\x20'+_0x5aa4a3[_0x17f7c7(0x206)]+'\x20unchanged\x20files')),console[_0x17f7c7(0x24c)](_0x17f7c7(0x1d8)+a27_0x50d849[_0x17f7c7(0x1dc)](_0x27d0ee)+'\x0a');if(_0x5b6695[_0x17f7c7(0x206)]>0x0)for(const _0x1c5a96 of _0x5b6695){console[_0x17f7c7(0x24c)](_0x17f7c7(0x1c6)+_0x1c5a96[_0x17f7c7(0x22a)]+'\x27:'),console[_0x17f7c7(0x24c)]('─'['repeat'](0x3c)),console[_0x17f7c7(0x24c)](_0x1c5a96['diff']),console[_0x17f7c7(0x24c)]('─'['repeat'](0x3c));}if(_0x42603a[_0x17f7c7(0x261)])return console['error'](a27_0x50d849[_0x17f7c7(0x29a)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x81c9f[_0x17f7c7(0x206)]===0x0&&_0x5b6695[_0x17f7c7(0x206)]===0x0)return console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)](_0x17f7c7(0x2a5))),saveSessionContext({'parent_segment':_0x4a2652},_0x42603a[_0x17f7c7(0x1ca)]),console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)]('✔\x20Context\x20set:\x20'+a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x289))+_0x17f7c7(0x25f)+a27_0x50d849['cyan'](_0x4a2652))),0x0;if(!_0x42603a[_0x17f7c7(0x256)]&&(_0x81c9f[_0x17f7c7(0x206)]>0x0||_0x5b6695['length']>0x0)){if(!isInteractive())return console['error'](a27_0x50d849[_0x17f7c7(0x201)]('\x0aError:'),_0x17f7c7(0x26b)),console['error'](a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x233))),0x1;const _0x1133ab=await confirmKey(_0x17f7c7(0x264)+(_0x81c9f[_0x17f7c7(0x206)]+_0x5b6695['length'])+_0x17f7c7(0x203));if(!_0x1133ab)return console['error'](a27_0x50d849[_0x17f7c7(0x29a)](_0x17f7c7(0x1e1)),_0x17f7c7(0x28f)),0x1;}!existsSync(_0x27d0ee)&&mkdirSync(_0x27d0ee,{'recursive':!![]});const _0x291ce9=a27_0x3be399[_0x17f7c7(0x1c7)](_0x27d0ee,_0x17f7c7(0x211));writeFileSync(_0x291ce9,createTdxConfigContent(_0x4a2652),_0x17f7c7(0x229));for(const _0x4e69bb of _0x35991f){(_0x4e69bb[_0x17f7c7(0x220)]||_0x4e69bb['hasChanges'])&&writeFileSync(_0x4e69bb[_0x17f7c7(0x259)],_0x4e69bb[_0x17f7c7(0x21c)],'utf-8');}return console['error'](a27_0x50d849['green'](_0x17f7c7(0x2ac)+(_0x81c9f[_0x17f7c7(0x206)]+_0x5b6695[_0x17f7c7(0x206)])+_0x17f7c7(0x1d3)+_0x27d0ee)),saveSessionContext({'parent_segment':_0x4a2652},_0x42603a['session']),console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)]('✔\x20Context\x20set:\x20'+a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x289))+_0x17f7c7(0x25f)+a27_0x50d849[_0x17f7c7(0x1dc)](_0x4a2652))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x19f833(0x1d6);[a27_0x19f833(0x288)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x19f833(0x291)](_0x1e1e7e){const _0x49f550=a27_0x19f833,{options:_0x2781f2,args:_0x3a8d55,tdx:_0x27703d}=_0x1e1e7e,_0x28135e=_0x3a8d55[0x0];if(!requireNameOrPath(_0x28135e))return 0x1;_0x2781f2[_0x49f550(0x204)]&&console[_0x49f550(0x24c)]('Input:\x20'+_0x28135e);const {journeyId:_0x54add4}=await resolveJourneyIdFromInput(_0x28135e,_0x2781f2,_0x27703d),_0x542645=await withSpinner('Getting\x20column\x20mapping...',()=>_0x27703d[_0x49f550(0x23a)][_0x49f550(0x1d7)](_0x54add4),{'verbose':_0x2781f2[_0x49f550(0x204)]}),_0x2bf590=_0x542645[_0x49f550(0x1f9)];return console[_0x49f550(0x28d)](_0x49f550(0x24b)+_0x2bf590[_0x49f550(0x1b9)]),console[_0x49f550(0x28d)](_0x49f550(0x270)+_0x2bf590[_0x49f550(0x252)]),await handleSDKOutput(_0x2bf590[_0x49f550(0x1e0)],_0x2781f2),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x22d);[a27_0x19f833(0x288)]=a27_0x19f833(0x290);async[a27_0x19f833(0x291)](_0x554135){const _0x54eb29=a27_0x19f833,{options:_0x2a5c3c,args:_0x297d94,tdx:_0x2f8d45}=_0x554135,_0xd6b5b8=_0x297d94[0x0];if(!requireNameOrPath(_0xd6b5b8))return 0x1;_0x2a5c3c[_0x54eb29(0x204)]&&console[_0x54eb29(0x24c)](_0x54eb29(0x1dd)+_0xd6b5b8);const {journeyId:_0x33b700}=await resolveJourneyIdFromInput(_0xd6b5b8,_0x2a5c3c,_0x2f8d45),_0x1feebe=await withSpinner('Listing\x20journey\x20activations...',()=>_0x2f8d45[_0x54eb29(0x23a)]['listActivationsFlat'](_0x33b700),{'verbose':_0x2a5c3c[_0x54eb29(0x204)]}),_0x5a70fa=_0x1feebe['data'];return console[_0x54eb29(0x24c)](_0x54eb29(0x266)+_0x5a70fa[_0x54eb29(0x206)]+_0x54eb29(0x2a2)+(_0x5a70fa[_0x54eb29(0x206)]!==0x1?'s':'')),await handleSDKOutput(_0x5a70fa,_0x2a5c3c),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x19f833(0x273)]='journey:push';[a27_0x19f833(0x288)]=a27_0x19f833(0x269);[a27_0x19f833(0x1cf)]=new SegmentPushCommand();async['execute'](_0x23975d){const _0x321d76=a27_0x19f833,_0x20ab19=_0x23975d[_0x321d76(0x245)][0x0];let _0x529c83;if(_0x20ab19){const _0x202dd3=await resolveTarget({'arg':_0x20ab19,'contextParent':_0x23975d[_0x321d76(0x296)][_0x321d76(0x21f)],'cwd':process[_0x321d76(0x241)]()});isSuccessfulResolution(_0x202dd3)&&_0x202dd3[_0x321d76(0x27d)]==='file'&&(_0x529c83=_0x202dd3[_0x321d76(0x1ac)]);}const _0x32d0d0={..._0x23975d,'options':{..._0x23975d['options'],'journeysOnly':!![],..._0x529c83&&{'singleFilePath':_0x529c83}}};return this['segmentPushCommand'][_0x321d76(0x291)](_0x32d0d0);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x236);[a27_0x19f833(0x288)]=a27_0x19f833(0x1ad);async[a27_0x19f833(0x291)](_0x48c85a){const _0x3b3e0c=a27_0x19f833,{options:_0x193e06,args:_0x160f0d,tdx:_0x1f99bf}=_0x48c85a,_0xa8191d=_0x160f0d[0x0];if(!requireNameOrPath(_0xa8191d))return 0x1;if(_0x193e06[_0x3b3e0c(0x204)])console[_0x3b3e0c(0x24c)](_0x3b3e0c(0x1dd)+_0xa8191d);const {journeyId:_0x254a4d}=await resolveJourneyIdFromInput(_0xa8191d,_0x193e06,_0x1f99bf),_0x38695d=await withSpinner(_0x3b3e0c(0x1cc),()=>_0x1f99bf[_0x3b3e0c(0x23a)]['listVersions'](_0x254a4d),{'verbose':_0x193e06['verbose']}),{bundleName:_0x25e71a,versions:_0x1b1021,latestJourneyId:_0x5a19f3}=_0x38695d[_0x3b3e0c(0x1f9)];console['error'](_0x25e71a+':\x20'+_0x1b1021[_0x3b3e0c(0x206)]+_0x3b3e0c(0x2aa)+(_0x1b1021[_0x3b3e0c(0x206)]!==0x1?'s':''));const _0x3f7eb7=_0x1b1021[_0x3b3e0c(0x29c)](_0x2ee19c=>({'version':_0x2ee19c['versionNumber'],'journey_id':_0x2ee19c[_0x3b3e0c(0x279)],'name':_0x2ee19c[_0x3b3e0c(0x273)],'state':_0x2ee19c['state'],'paused':_0x2ee19c['paused'],'latest':_0x2ee19c[_0x3b3e0c(0x279)]===_0x5a19f3,'created_at':_0x2ee19c['createdAt']}));return await handleSDKOutput(_0x3f7eb7,_0x193e06),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';[a27_0x19f833(0x288)]=a27_0x19f833(0x1f5);async[a27_0x19f833(0x291)](_0x55209b){const _0x11fa03=a27_0x19f833,{options:_0x5ab5e2,args:_0x2b0b39,tdx:_0x16ba5a}=_0x55209b,_0x5b038e=_0x2b0b39[0x0];if(!requireNameOrPath(_0x5b038e))return 0x1;if(_0x5ab5e2[_0x11fa03(0x204)])console[_0x11fa03(0x24c)](_0x11fa03(0x1dd)+_0x5b038e);const {journeyId:_0x1c7205,journeyName:_0x54b24c}=await resolveJourneyIdFromInput(_0x5b038e,_0x5ab5e2,_0x16ba5a);if(!_0x5ab5e2[_0x11fa03(0x256)]){const _0x3a24ca=await confirm(_0x11fa03(0x215)+_0x54b24c+'\x22?');if(!_0x3a24ca)return console['error']('Cancelled'),0x0;}const _0x2b5817=await withSpinner('Creating\x20new\x20version...',()=>_0x16ba5a[_0x11fa03(0x23a)][_0x11fa03(0x298)](_0x1c7205),{'verbose':_0x5ab5e2[_0x11fa03(0x204)]}),_0x245e0e=_0x2b5817[_0x11fa03(0x1f9)];return console[_0x11fa03(0x24c)](a27_0x50d849['green']('✔')+_0x11fa03(0x23c)+_0x245e0e['attributes'][_0x11fa03(0x258)]+_0x11fa03(0x257)+_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x273)]+'\x22'),console[_0x11fa03(0x24c)](_0x11fa03(0x281)+_0x245e0e['id']),await handleSingleObjectOutput({'id':_0x245e0e['id'],'name':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x273)],'version':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x258)],'state':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x27f)],'bundle_id':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x262)],'created_at':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x1bd)]},_0x5ab5e2),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x282);[a27_0x19f833(0x288)]=a27_0x19f833(0x200);async['execute'](_0x24b66c){const _0x19dbf3=a27_0x19f833,{options:_0x1623ca,args:_0x52ba31,tdx:_0x23aa84}=_0x24b66c,_0x229b40=_0x52ba31[0x0];if(!requireNameOrPath(_0x229b40))return 0x1;const _0x1291f1=_0x1623ca['version'];if(!_0x1291f1)return console[_0x19dbf3(0x24c)](_0x19dbf3(0x1e9)),console[_0x19dbf3(0x24c)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x18b584=parseInt(_0x1291f1,0xa);if(isNaN(_0x18b584)||_0x18b584<0x1)return console[_0x19dbf3(0x24c)](_0x19dbf3(0x22e)+_0x1291f1),0x1;if(_0x1623ca[_0x19dbf3(0x204)])console['error'](_0x19dbf3(0x1dd)+_0x229b40+_0x19dbf3(0x1e4)+_0x18b584);const {journeyId:_0x2d4f02,parentSegmentId:_0x24f63c}=await resolveJourneyIdFromInput(_0x229b40,_0x1623ca,_0x23aa84),_0x45038b=await withSpinner('Resolving\x20version...',()=>_0x23aa84[_0x19dbf3(0x23a)][_0x19dbf3(0x2b7)](_0x2d4f02),{'verbose':_0x1623ca[_0x19dbf3(0x204)]}),{versions:_0x49773,latestJourneyId:_0x2c86ea}=_0x45038b[_0x19dbf3(0x1f9)],_0x1165e6=_0x49773[_0x19dbf3(0x297)](_0x4b5574=>_0x4b5574[_0x19dbf3(0x258)]===_0x18b584);if(!_0x1165e6){const _0x1e0874=_0x49773[_0x19dbf3(0x29c)](_0x8c653e=>'v'+_0x8c653e['versionNumber'])[_0x19dbf3(0x1c7)](',\x20');return console[_0x19dbf3(0x24c)](_0x19dbf3(0x1eb)+_0x18b584+_0x19dbf3(0x284)+_0x1e0874),0x1;}const _0x132947=await withSpinner(_0x19dbf3(0x1b1)+_0x18b584+_0x19dbf3(0x216),()=>_0x23aa84[_0x19dbf3(0x23a)][_0x19dbf3(0x2ad)](_0x1165e6[_0x19dbf3(0x279)]),{'verbose':_0x1623ca[_0x19dbf3(0x204)]}),_0x1b39bb=_0x132947[_0x19dbf3(0x1f9)],_0x5e6168=getConsoleNextUrl(_0x1623ca['site'],'/app/ps/'+_0x24f63c+_0x19dbf3(0x238)+_0x1165e6['journeyId']+_0x19dbf3(0x2ab));return await handleSingleObjectOutput({'id':_0x1b39bb['id'],'name':_0x1b39bb[_0x19dbf3(0x2b5)]['name'],'version':_0x1b39bb['attributes'][_0x19dbf3(0x258)],'description':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x288)],'state':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x27f)],'paused':_0x1b39bb[_0x19dbf3(0x2b5)]['paused'],'reentry_mode':_0x1b39bb[_0x19dbf3(0x2b5)]['reentryMode'],'stages':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x21a)]?.[_0x19dbf3(0x206)]||0x0,..._0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x268)]&&{'goal':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x268)][_0x19dbf3(0x273)]},'latest':_0x1165e6[_0x19dbf3(0x279)]===_0x2c86ea,'created_at':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x1bd)],'updated_at':_0x1b39bb['attributes'][_0x19dbf3(0x272)],'url':_0x5e6168},_0x1623ca),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0xa4d9a4=a28_0xac02;(function(_0x977a3f,_0x27171a){const _0x3b0ae0=a28_0xac02,_0x1272e2=_0x977a3f();while(!![]){try{const _0x5feded=parseInt(_0x3b0ae0(0xe8))/0x1*(-parseInt(_0x3b0ae0(0xc7))/0x2)+-parseInt(_0x3b0ae0(0xcb))/0x3*(-parseInt(_0x3b0ae0(0xcd))/0x4)+parseInt(_0x3b0ae0(0xd3))/0x5*(parseInt(_0x3b0ae0(0xf4))/0x6)+parseInt(_0x3b0ae0(0xe4))/0x7+parseInt(_0x3b0ae0(0xec))/0x8*(-parseInt(_0x3b0ae0(0xe3))/0x9)+parseInt(_0x3b0ae0(0xe1))/0xa*(parseInt(_0x3b0ae0(0xd5))/0xb)+-parseInt(_0x3b0ae0(0xe9))/0xc*(parseInt(_0x3b0ae0(0xfb))/0xd);if(_0x5feded===_0x27171a)break;else _0x1272e2['push'](_0x1272e2['shift']());}catch(_0x3cbf77){_0x1272e2['push'](_0x1272e2['shift']());}}}(a28_0x33cc,0x4f242));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x33cc(){const _0x214e75=['395DQhKgT','\x20warning(s)\x20found','1157739SGBgdY','validCount','length','reason','Error:\x20Directory\x20not\x20found:\x20','cyan','yellow','cwd','error','filter','warningCount','\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','10AVCqvs','.yml','3123fiwWge','3978030mdQTDK','journey:validate','errors','warnings','12433XturGk','170748VLOSzV','skippedCount','helpText','11576RzHFoY','verbose','name','log','\x20journey(s)\x20with\x20errors,\x20','Validate\x20journey\x20YAML\x20files','\x20(skipped:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','35466xRsNyZ','red','targetDir','\x20segment\x20file(s)\x20skipped','No\x20journey\x20YAML\x20files\x20found\x20in\x20','valid','file','52VWYHzO','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20valid','description','type','no_parent','46WteZQS','parentSegment','\x20segment\x20file(s)\x20skipped)','endsWith','9ZSbQYG','dim','38184PrPyaz','invalidCount','errorCode','✔\x20All\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a28_0x33cc=function(){return _0x214e75;};return a28_0x33cc();}import{existsSync}from'fs';import a28_0x511ef6 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0xac02(_0x5b493d,_0x3440a8){_0x5b493d=_0x5b493d-0xc6;const _0x33cce6=a28_0x33cc();let _0xac023d=_0x33cce6[_0x5b493d];return _0xac023d;}export class JourneyValidateCommand extends BaseCommand{[a28_0xa4d9a4(0xee)]=a28_0xa4d9a4(0xe5);[a28_0xa4d9a4(0xfe)]=a28_0xa4d9a4(0xf1);async['execute'](_0x3df3c8){const _0x523619=a28_0xa4d9a4,{options:_0x1383c6,args:_0x190dbf}=_0x3df3c8,_0x2acee3=_0x1383c6,_0x2f7448=await resolveTarget({'arg':_0x190dbf[0x0],'contextParent':_0x1383c6[_0x523619(0xc8)],'cwd':process[_0x523619(0xdc)]()});if(!isSuccessfulResolution(_0x2f7448))return _0x2f7448[_0x523619(0xcf)]===_0x523619(0xc6)?(console['error'](a28_0x511ef6[_0x523619(0xdb)](_0x523619(0xd2))),console[_0x523619(0xdd)](_0x523619(0xfc)),console[_0x523619(0xdd)](_0x523619(0xe0)),console[_0x523619(0xdd)](_0x523619(0xf3))):(console['error'](a28_0x511ef6[_0x523619(0xf5)]('Error:\x20'+_0x2f7448['message']+'\x0a')),_0x2f7448[_0x523619(0xeb)]&&console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xda)](_0x2f7448[_0x523619(0xeb)]))),0x1;const _0x4b3ea7=_0x2f7448[_0x523619(0xf6)],_0x42fc57=_0x2f7448[_0x523619(0xff)]===_0x523619(0xfa)?_0x2f7448['filePath']:undefined;if(!_0x42fc57&&!existsSync(_0x4b3ea7))return console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xf5)](_0x523619(0xd9)+_0x4b3ea7+'\x0a')),0x1;let _0x3017d8;if(_0x42fc57){if(!_0x42fc57[_0x523619(0xca)](_0x523619(0xe2))&&!_0x42fc57[_0x523619(0xca)]('.yaml'))return console[_0x523619(0xdd)](a28_0x511ef6['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x42fc57+'\x0a')),0x1;_0x3017d8=[_0x42fc57];}else _0x3017d8=findYamlFiles(_0x4b3ea7);if(_0x3017d8[_0x523619(0xd7)]===0x0)return console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xf5)](_0x523619(0xd1)+_0x4b3ea7+'\x0a')),0x1;const _0x585c68=validateYamlFiles(_0x3017d8,_0x4b3ea7,{'filterType':'journey'}),_0x2852c1=calculateSummary(_0x585c68),_0x8e9329=_0x585c68[_0x523619(0xde)](isValidationResult);if(_0x8e9329['length']===0x0)return console[_0x523619(0xdd)](a28_0x511ef6['yellow'](_0x523619(0xf8)+_0x4b3ea7+'\x0a')),_0x2852c1[_0x523619(0xea)]>0x0&&console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xcc)]('('+_0x2852c1[_0x523619(0xea)]+_0x523619(0xc9))),0x0;for(const _0x21e0e8 of _0x585c68){if(!isValidationResult(_0x21e0e8)){_0x2acee3['verbose']&&console['log'](a28_0x511ef6['dim']('-\x20'+_0x21e0e8['relativePath']+_0x523619(0xf2)+_0x21e0e8[_0x523619(0xd8)]+')'));continue;}const {relativePath:_0x3231fa,source:_0x561608,result:_0xcab201}=_0x21e0e8;if(_0xcab201['valid']&&_0xcab201['warnings'][_0x523619(0xd7)]===0x0)_0x2acee3[_0x523619(0xed)]&&console[_0x523619(0xef)](a28_0x511ef6['green']('✔\x20'+_0x3231fa));else _0xcab201[_0x523619(0xf9)]?(console['log'](a28_0x511ef6[_0x523619(0xdb)]('⚠\x20'+_0x3231fa+':\x20'+_0xcab201[_0x523619(0xe7)][_0x523619(0xd7)]+'\x20warning(s)')),console[_0x523619(0xef)](formatValidationResult(_0xcab201,_0x561608,_0x3231fa))):(console['log'](a28_0x511ef6[_0x523619(0xf5)]('✖\x20'+_0x3231fa+':\x20'+_0xcab201[_0x523619(0xe6)][_0x523619(0xd7)]+'\x20error(s)')),console['log'](formatValidationResult(_0xcab201,_0x561608,_0x3231fa)));}return console['log'](''),_0x2852c1['hasErrors']?(console[_0x523619(0xef)](a28_0x511ef6['red']('Validation\x20failed:\x20'+_0x2852c1[_0x523619(0xce)]+_0x523619(0xf0)+_0x2852c1[_0x523619(0xd6)]+_0x523619(0xfd))),_0x2852c1['warningCount']>0x0&&console['log'](a28_0x511ef6[_0x523619(0xdb)](_0x2852c1[_0x523619(0xdf)]+_0x523619(0xd4))),_0x2852c1[_0x523619(0xea)]>0x0&&console[_0x523619(0xef)](a28_0x511ef6['dim'](_0x2852c1[_0x523619(0xea)]+_0x523619(0xf7))),0x1):(console[_0x523619(0xef)](a28_0x511ef6['green'](_0x523619(0xd0)+_0x2852c1[_0x523619(0xd6)]+'\x20journey(s)\x20valid')),_0x2852c1['warningCount']>0x0&&console[_0x523619(0xef)](a28_0x511ef6[_0x523619(0xdb)](_0x2852c1['warningCount']+_0x523619(0xd4))),_0x2852c1['skippedCount']>0x0&&console[_0x523619(0xef)](a28_0x511ef6[_0x523619(0xcc)](_0x2852c1[_0x523619(0xea)]+_0x523619(0xf7))),0x0);}}
|