@treasuredata/tdx 2026.4.7 → 2026.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x2428e4=a25_0x225c;function a25_0x225c(_0x609fc7,_0x302910){_0x609fc7=_0x609fc7-0x71;const _0x36bdef=a25_0x36bd();let _0x225c4c=_0x36bdef[_0x609fc7];return _0x225c4c;}(function(_0x1bce31,_0x214b1f){const _0x3ae716=a25_0x225c,_0x473cc9=_0x1bce31();while(!![]){try{const _0x5a745=parseInt(_0x3ae716(0x79))/0x1+parseInt(_0x3ae716(0x87))/0x2*(parseInt(_0x3ae716(0x90))/0x3)+parseInt(_0x3ae716(0x92))/0x4+-parseInt(_0x3ae716(0x9a))/0x5+-parseInt(_0x3ae716(0x85))/0x6+parseInt(_0x3ae716(0x9b))/0x7+-parseInt(_0x3ae716(0x8e))/0x8;if(_0x5a745===_0x214b1f)break;else _0x473cc9['push'](_0x473cc9['shift']());}catch(_0x5c279e){_0x473cc9['push'](_0x473cc9['shift']());}}}(a25_0x36bd,0x5f8a1));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x36bd(){const _0x12c23b=['green','length','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20non-template\x20file(s)\x20skipped)','invalidCount','skippedCount','4103288LjSVAs','\x20(skipped:\x20','337809voJvPZ','dirname','182704vwkqiK','Error:\x20Directory\x20not\x20found:\x20','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20template(s)\x20valid','red','valid','Validation\x20failed:\x20','.yml','1657265emoRSO','1102479xgAkqx','template','cwd','resolve','warningCount','reason','warnings','engage:template:validate','description','name','✔\x20All\x20','validCount','657771wbnvRR','log','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','dim','execute','\x20non-template\x20file(s)\x20skipped','verbose','endsWith','\x20warning(s)\x20found','\x20warning(s)','error','filter','453978OFRrhI','yellow','8elAdav'];a25_0x36bd=function(){return _0x12c23b;};return a25_0x36bd();}import{existsSync}from'fs';import a25_0x3383c7 from'chalk';import a25_0x1fdd10 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_0x2428e4(0x76)]=a25_0x2428e4(0x74);[a25_0x2428e4(0x75)]='Validate\x20template\x20YAML\x20files';async[a25_0x2428e4(0x7d)](_0x344512){const _0x152e6c=a25_0x2428e4,{options:_0x326be2,args:_0x4c518a}=_0x344512,_0x36787e=_0x326be2,_0x140e2b=_0x4c518a[0x0],_0x2ac742=_0x140e2b?a25_0x1fdd10[_0x152e6c(0x9e)](_0x140e2b):undefined,_0x365d6e=_0x2ac742?isYamlFile(_0x2ac742):![];let _0xfa9f1a,_0x8d220c;if(_0x365d6e&&_0x2ac742)_0xfa9f1a=a25_0x1fdd10[_0x152e6c(0x91)](_0x2ac742),_0x8d220c=_0x2ac742;else _0x2ac742?_0xfa9f1a=_0x2ac742:_0xfa9f1a=process[_0x152e6c(0x9d)]();if(!_0x8d220c&&!existsSync(_0xfa9f1a))return console['error'](a25_0x3383c7['red'](_0x152e6c(0x93)+_0xfa9f1a+'\x0a')),0x1;let _0x446f28;if(_0x8d220c){if(!_0x8d220c['endsWith'](_0x152e6c(0x99))&&!_0x8d220c[_0x152e6c(0x80)]('.yaml'))return console[_0x152e6c(0x83)](a25_0x3383c7[_0x152e6c(0x96)](_0x152e6c(0x8a)+_0x8d220c+'\x0a')),0x1;_0x446f28=[_0x8d220c];}else _0x446f28=findYamlFiles(_0xfa9f1a);if(_0x446f28[_0x152e6c(0x89)]===0x0)return console[_0x152e6c(0x83)](a25_0x3383c7[_0x152e6c(0x96)](_0x152e6c(0x7b)+_0xfa9f1a+'\x0a')),0x1;const _0x4fb85a=validateYamlFiles(_0x446f28,_0xfa9f1a,{'filterType':_0x152e6c(0x9c)}),_0x429e60=calculateSummary(_0x4fb85a),_0x530148=_0x4fb85a[_0x152e6c(0x84)](isValidationResult);if(_0x530148['length']===0x0)return console[_0x152e6c(0x83)](a25_0x3383c7['yellow'](_0x152e6c(0x94)+_0xfa9f1a+'\x0a')),_0x429e60['skippedCount']>0x0&&console[_0x152e6c(0x83)](a25_0x3383c7[_0x152e6c(0x7c)]('('+_0x429e60[_0x152e6c(0x8d)]+_0x152e6c(0x8b))),0x0;for(const _0x2695c1 of _0x4fb85a){if(!isValidationResult(_0x2695c1)){_0x36787e[_0x152e6c(0x7f)]&&console[_0x152e6c(0x7a)](a25_0x3383c7['dim']('-\x20'+_0x2695c1['relativePath']+_0x152e6c(0x8f)+_0x2695c1[_0x152e6c(0x72)]+')'));continue;}const {relativePath:_0xe56233,source:_0x4f8206,result:_0xc7d631}=_0x2695c1;if(_0xc7d631[_0x152e6c(0x97)]&&_0xc7d631[_0x152e6c(0x73)]['length']===0x0)_0x36787e[_0x152e6c(0x7f)]&&console['log'](a25_0x3383c7[_0x152e6c(0x88)]('✔\x20'+_0xe56233));else _0xc7d631[_0x152e6c(0x97)]?(console[_0x152e6c(0x7a)](a25_0x3383c7[_0x152e6c(0x86)]('⚠\x20'+_0xe56233+':\x20'+_0xc7d631[_0x152e6c(0x73)]['length']+_0x152e6c(0x82))),console[_0x152e6c(0x7a)](formatValidationResult(_0xc7d631,_0x4f8206,_0xe56233))):(console[_0x152e6c(0x7a)](a25_0x3383c7[_0x152e6c(0x96)]('✖\x20'+_0xe56233+':\x20'+_0xc7d631['errors']['length']+'\x20error(s)')),console['log'](formatValidationResult(_0xc7d631,_0x4f8206,_0xe56233)));}return console[_0x152e6c(0x7a)](''),_0x429e60['hasErrors']?(console[_0x152e6c(0x7a)](a25_0x3383c7[_0x152e6c(0x96)](_0x152e6c(0x98)+_0x429e60[_0x152e6c(0x8c)]+'\x20template(s)\x20with\x20errors,\x20'+_0x429e60[_0x152e6c(0x78)]+'\x20valid')),_0x429e60[_0x152e6c(0x71)]>0x0&&console[_0x152e6c(0x7a)](a25_0x3383c7[_0x152e6c(0x86)](_0x429e60[_0x152e6c(0x71)]+_0x152e6c(0x81))),_0x429e60[_0x152e6c(0x8d)]>0x0&&console['log'](a25_0x3383c7['dim'](_0x429e60[_0x152e6c(0x8d)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x152e6c(0x7a)](a25_0x3383c7['green'](_0x152e6c(0x77)+_0x429e60['validCount']+_0x152e6c(0x95))),_0x429e60['warningCount']>0x0&&console[_0x152e6c(0x7a)](a25_0x3383c7[_0x152e6c(0x86)](_0x429e60[_0x152e6c(0x71)]+_0x152e6c(0x81))),_0x429e60[_0x152e6c(0x8d)]>0x0&&console[_0x152e6c(0x7a)](a25_0x3383c7['dim'](_0x429e60[_0x152e6c(0x8d)]+_0x152e6c(0x7e))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0xbf4631=a26_0x161d;(function(_0x6069e4,_0x512e7d){const _0x48ef06=a26_0x161d,_0x5ab66e=_0x6069e4();while(!![]){try{const _0x40fec4=parseInt(_0x48ef06(0x18e))/0x1+parseInt(_0x48ef06(0x1a0))/0x2*(parseInt(_0x48ef06(0x1c3))/0x3)+parseInt(_0x48ef06(0x1b5))/0x4*(-parseInt(_0x48ef06(0x1a3))/0x5)+-parseInt(_0x48ef06(0x18f))/0x6*(-parseInt(_0x48ef06(0x1d2))/0x7)+-parseInt(_0x48ef06(0x1c0))/0x8*(-parseInt(_0x48ef06(0x1a9))/0x9)+-parseInt(_0x48ef06(0x180))/0xa*(parseInt(_0x48ef06(0x1b2))/0xb)+-parseInt(_0x48ef06(0x196))/0xc*(parseInt(_0x48ef06(0x19e))/0xd);if(_0x40fec4===_0x512e7d)break;else _0x5ab66e['push'](_0x5ab66e['shift']());}catch(_0x377fbe){_0x5ab66e['push'](_0x5ab66e['shift']());}}}(a26_0x3253,0xd6802));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a26_0x3253(){const _0x115919=['Show\x20job\x20details','url','kill','Getting\x20job\x20details...','user_name','List\x20jobs','execute','hive','11lkdbLS','error','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','4xetUHH','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','jobType','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','trino','type','Database:\x20','database','just\x20now','Getting\x20job\x20results...','yes','32ZSXaMq','\x27\x20to\x20verify\x20the\x20job\x20status','floor','3014733lAHRnJ','file','Listing\x20jobs...','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','now','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','map','No\x20SQL\x20statements\x20found\x20in\x20file','log','args','verbose','created_at','Cancelled','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','8308839vSBMPB','result','\x20row','end_at','getTime','✔\x20Job\x20submitted','query','Query:\x20','Submitting\x20job...','data','job_id','Kill\x20a\x20job','length','push','priority','h\x20ago','6244510gjQzte','Status\x20filter:\x20','\x20jobs','mo\x20ago','...','jobs','Submit\x20a\x20job','submit','name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','INVALID_ARGUMENT','show','start_at','round','775185PwkwAM','6xVUJaD','abs','\x20job','job:submit','✔\x20Found\x20','debug','status','22745748jKIJUN','Submitting\x20kill\x20request...','presto','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','red','description','join','13HmlkOF','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','2lTEQmw','job:result','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','1779185mbUUdk','substring','validate','Limit:\x20','dim','limit','1771398zwcGOd'];a26_0x3253=function(){return _0x115919;};return a26_0x3253();}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_0x161d(_0x46234b,_0x3c43ad){_0x46234b=_0x46234b-0x179;const _0x325318=a26_0x3253();let _0x161ddb=_0x325318[_0x46234b];return _0x161ddb;}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x46d3ab from'chalk';function formatDuration(_0x1926f7){const _0x4e8c73=a26_0x161d;if(_0x1926f7<0x3c)return _0x1926f7+'s';if(_0x1926f7<0xe10)return Math['floor'](_0x1926f7/0x3c)+'m\x20'+_0x1926f7%0x3c+'s';const _0x3e4697=Math[_0x4e8c73(0x1c2)](_0x1926f7/0xe10),_0x7ba71a=Math[_0x4e8c73(0x1c2)](_0x1926f7%0xe10/0x3c);return _0x7ba71a>0x0?_0x3e4697+'h\x20'+_0x7ba71a+'m':_0x3e4697+'h';}function formatRelativeTime(_0xd6a20d){const _0xf54111=a26_0x161d,_0x3033b7=Date[_0xf54111(0x1c7)]()-_0xd6a20d[_0xf54111(0x1d6)](),_0x37d489=Math['floor'](Math[_0xf54111(0x190)](_0x3033b7)/0x3e8);if(_0x37d489<0x3c)return _0xf54111(0x1bd);const _0x28fa24=Math[_0xf54111(0x1c2)](_0x37d489/0x3c);if(_0x28fa24<0x3c)return _0x28fa24+'m\x20ago';const _0x705900=Math[_0xf54111(0x1c2)](_0x28fa24/0x3c);if(_0x705900<0x18)return _0x705900+_0xf54111(0x17f);const _0x375aae=Math[_0xf54111(0x1c2)](_0x705900/0x18);if(_0x375aae<0x1e)return _0x375aae+'d\x20ago';return Math[_0xf54111(0x1c2)](_0x375aae/0x1e)+_0xf54111(0x183);}export class JobListCommand extends BaseCommand{[a26_0xbf4631(0x188)]='jobs';[a26_0xbf4631(0x19c)]=a26_0xbf4631(0x1af);async[a26_0xbf4631(0x1b0)](_0x5241ff){const _0x4a45d1=a26_0xbf4631,{options:_0x10aa16,tdx:_0x4ff72e}=_0x5241ff,_0x4ef32d=resolveLimit(_0x10aa16[_0x4a45d1(0x1a8)],DEFAULT_DISPLAY_LIMIT),_0x148e17=_0x10aa16[_0x4a45d1(0x195)];_0x10aa16['verbose']&&(console['error'](_0x4a45d1(0x1a6)+_0x4ef32d+_0x4a45d1(0x182)),_0x148e17&&console[_0x4a45d1(0x1b3)](_0x4a45d1(0x181)+_0x148e17));const _0x2842d2=await withSpinner(_0x4a45d1(0x1c5),()=>_0x4ff72e[_0x4a45d1(0x185)]['list']({'from':0x0,'to':_0x4ef32d-0x1,'status':_0x148e17}),{'verbose':_0x10aa16[_0x4a45d1(0x1cd)]}),_0x559055=_0x2842d2['data'];console[_0x4a45d1(0x1b3)](_0x4a45d1(0x193)+_0x559055[_0x4a45d1(0x17c)]+_0x4a45d1(0x191)+(_0x559055[_0x4a45d1(0x17c)]!==0x1?'s':''));const _0x2d5537=_0x10aa16[_0x4a45d1(0x1d0)];if(isStructuredFormat(_0x10aa16)){const _0x5ce3ad=_0x559055[_0x4a45d1(0x1c9)](_0x27c946=>{const _0x456363=_0x4a45d1;let _0x49f25f;if(_0x27c946[_0x456363(0x18c)]&&_0x27c946[_0x456363(0x1d5)]){const _0x4ab9c1=new Date(_0x27c946['start_at'])[_0x456363(0x1d6)](),_0x1dc06f=new Date(_0x27c946[_0x456363(0x1d5)])['getTime']();_0x49f25f=Math[_0x456363(0x18d)]((_0x1dc06f-_0x4ab9c1)/0x3e8);}return{'job_id':_0x27c946[_0x456363(0x17a)],'type':_0x27c946[_0x456363(0x1ba)]===_0x456363(0x198)?_0x456363(0x1b9):_0x27c946['type'],'status':_0x27c946['status'],'user_name':_0x27c946[_0x456363(0x1ae)],'duration_sec':_0x49f25f,'created_at':_0x27c946['created_at'],'started_at':_0x27c946[_0x456363(0x18c)],'end_at':_0x27c946[_0x456363(0x1d5)]};});await handleSDKOutput(_0x5ce3ad,_0x10aa16);}else for(const _0x1da066 of _0x559055){const _0x20ddfd=_0x1da066[_0x4a45d1(0x195)]==='success'?a26_0x46d3ab['green']:_0x1da066[_0x4a45d1(0x195)]==='error'?a26_0x46d3ab[_0x4a45d1(0x19b)]:a26_0x46d3ab['dim'],_0x1bcd7b=_0x20ddfd(_0x1da066[_0x4a45d1(0x195)]),_0x3e363b=getJobUrl(_0x2d5537,_0x1da066[_0x4a45d1(0x17a)]),_0x44d179=hyperlink(_0x1da066[_0x4a45d1(0x17a)],_0x3e363b),_0x4632f4=a26_0x46d3ab[_0x4a45d1(0x1a7)](_0x1da066[_0x4a45d1(0x1ba)]===_0x4a45d1(0x198)?_0x4a45d1(0x1b9):_0x1da066['type']),_0x41809f=[];if(_0x1da066[_0x4a45d1(0x18c)]&&_0x1da066[_0x4a45d1(0x1d5)]){const _0x629820=Math[_0x4a45d1(0x18d)]((new Date(_0x1da066[_0x4a45d1(0x1d5)])[_0x4a45d1(0x1d6)]()-new Date(_0x1da066[_0x4a45d1(0x18c)])[_0x4a45d1(0x1d6)]())/0x3e8);_0x41809f[_0x4a45d1(0x17d)](formatDuration(_0x629820));}if(_0x1da066[_0x4a45d1(0x1d5)])_0x41809f[_0x4a45d1(0x17d)](formatRelativeTime(new Date(_0x1da066[_0x4a45d1(0x1d5)])));else _0x1da066[_0x4a45d1(0x18c)]&&_0x41809f[_0x4a45d1(0x17d)](formatRelativeTime(new Date(_0x1da066[_0x4a45d1(0x18c)])));const _0xa19224=_0x41809f[_0x4a45d1(0x17c)]>0x0?a26_0x46d3ab[_0x4a45d1(0x1a7)]('\x20'+_0x41809f[_0x4a45d1(0x19d)](',\x20')):'';console[_0x4a45d1(0x1cb)]('⚡\x20'+_0x44d179+'\x20'+_0x4632f4+'\x20'+_0x1bcd7b+_0xa19224);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0xbf4631(0x188)]='job:show';['description']=a26_0xbf4631(0x1aa);[a26_0xbf4631(0x1a5)](_0x4a1a5c){const _0x3e2ad2=a26_0xbf4631,_0xad1900=_0x4a1a5c[_0x3e2ad2(0x1cc)][0x0];if(!_0xad1900)return _0x3e2ad2(0x19a);return undefined;}async[a26_0xbf4631(0x1b0)](_0x1f8db2){const _0x31fc3f=a26_0xbf4631,{options:_0x2835d8,args:_0x5e59b6,tdx:_0x253b98}=_0x1f8db2,_0x4aea2a=_0x5e59b6[0x0],_0x56dbf0=await withSpinner(_0x31fc3f(0x1ad),()=>_0x253b98[_0x31fc3f(0x185)][_0x31fc3f(0x18b)](_0x4aea2a),{'verbose':_0x2835d8[_0x31fc3f(0x1cd)]}),_0x238d53=_0x56dbf0[_0x31fc3f(0x179)];let _0x233a64;if(_0x238d53[_0x31fc3f(0x18c)]&&_0x238d53[_0x31fc3f(0x1d5)]){const _0x46082d=new Date(_0x238d53[_0x31fc3f(0x18c)])[_0x31fc3f(0x1d6)](),_0x5370d7=new Date(_0x238d53[_0x31fc3f(0x1d5)])[_0x31fc3f(0x1d6)]();_0x233a64=Math[_0x31fc3f(0x18d)]((_0x5370d7-_0x46082d)/0x3e8);}const _0xa8447a={'job_id':_0x238d53[_0x31fc3f(0x17a)],'type':_0x238d53['type'],'status':_0x238d53['status'],..._0x238d53[_0x31fc3f(0x1ae)]&&{'user_name':_0x238d53[_0x31fc3f(0x1ae)]},..._0x233a64!==undefined&&{'duration_sec':_0x233a64},..._0x238d53[_0x31fc3f(0x1ce)]&&{'created_at':_0x238d53['created_at']},..._0x238d53[_0x31fc3f(0x18c)]&&{'started_at':_0x238d53[_0x31fc3f(0x18c)]},..._0x238d53[_0x31fc3f(0x1d5)]&&{'end_at':_0x238d53[_0x31fc3f(0x1d5)]},..._0x238d53[_0x31fc3f(0x1bc)]&&{'database':_0x238d53[_0x31fc3f(0x1bc)]},..._0x238d53[_0x31fc3f(0x17e)]!==undefined&&{'priority':_0x238d53[_0x31fc3f(0x17e)]},..._0x238d53[_0x31fc3f(0x1ab)]&&{'url':_0x238d53['url']},..._0x238d53['query']&&{'query':_0x238d53[_0x31fc3f(0x1d8)]},..._0x238d53[_0x31fc3f(0x194)]&&{'debug':_0x238d53['debug']}};return await handleSingleObjectOutput(_0xa8447a,_0x2835d8),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0xbf4631(0x188)]='job:kill';[a26_0xbf4631(0x19c)]=a26_0xbf4631(0x17b);[a26_0xbf4631(0x1a5)](_0x4fbda8){const _0x315b9a=a26_0xbf4631,_0x19f719=_0x4fbda8[_0x315b9a(0x1cc)][0x0];if(!_0x19f719)return _0x315b9a(0x1d1);return undefined;}async[a26_0xbf4631(0x1b0)](_0x4c18aa){const _0x2eb680=a26_0xbf4631,{options:_0x47dcff,args:_0xe61619,tdx:_0x2d608f}=_0x4c18aa,_0x4567eb=_0xe61619[0x0];if(!_0x47dcff[_0x2eb680(0x1bf)]){const _0x2bee90=await confirm(_0x2eb680(0x189)+_0x4567eb+'?');if(!_0x2bee90)return console['error'](_0x2eb680(0x1cf)),0x0;}return await withSpinner(_0x2eb680(0x197),()=>_0x2d608f['jobs'][_0x2eb680(0x1ac)](_0x4567eb),{'verbose':_0x47dcff[_0x2eb680(0x1cd)]}),console['error'](_0x2eb680(0x1b4)+_0x4567eb),console[_0x2eb680(0x1b3)](_0x2eb680(0x19f)+_0x4567eb+_0x2eb680(0x1c1)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a26_0xbf4631(0x192);['description']=a26_0xbf4631(0x186);async[a26_0xbf4631(0x1b0)](_0x385d2c){const _0x47f361=a26_0xbf4631,{options:_0xf7b5c8,args:_0x58a7fa,tdx:_0x48ddb4}=_0x385d2c,_0x40eb4c=_0xf7b5c8[_0x47f361(0x1b7)]||_0x47f361(0x1b9),_0x5c6d1b=_0xf7b5c8[_0x47f361(0x1c4)],_0x439cd0=_0xf7b5c8[_0x47f361(0x1bc)]||'information_schema',_0x2c9214=_0xf7b5c8[_0x47f361(0x1d3)];if(_0x40eb4c!==_0x47f361(0x1b9)&&_0x40eb4c!==_0x47f361(0x1b1))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x47f361(0x1c6));let _0x3ee933;if(_0x5c6d1b){if(_0x58a7fa[0x0])throw new SDKError(ErrorCode[_0x47f361(0x18a)],_0x47f361(0x1a2));const _0x29dd93=readSqlStatementsFromFile(_0x5c6d1b);if(_0x29dd93['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x47f361(0x1ca));if(_0x29dd93['length']>0x1)throw new SDKError(ErrorCode[_0x47f361(0x18a)],_0x47f361(0x1b8));_0x3ee933=_0x29dd93[0x0];}else{if(!_0x58a7fa[0x0])throw new SDKError(ErrorCode[_0x47f361(0x18a)],_0x47f361(0x1b6));_0x3ee933=_0x58a7fa[0x0];}_0xf7b5c8[_0x47f361(0x1cd)]&&(console[_0x47f361(0x1b3)](_0x47f361(0x199)+_0x40eb4c),console[_0x47f361(0x1b3)](_0x47f361(0x1bb)+_0x439cd0),console[_0x47f361(0x1b3)](_0x47f361(0x1d9)+_0x3ee933[_0x47f361(0x1a4)](0x0,0x64)+(_0x3ee933[_0x47f361(0x17c)]>0x64?_0x47f361(0x184):'')));const _0xc71531=await withSpinner(_0x47f361(0x1da),()=>_0x48ddb4[_0x47f361(0x185)][_0x47f361(0x187)](_0x439cd0,_0x3ee933,_0x40eb4c,_0x2c9214),{'verbose':_0xf7b5c8[_0x47f361(0x1cd)]}),_0x4c1807=_0xc71531[_0x47f361(0x179)];return console[_0x47f361(0x1b3)](_0x47f361(0x1d7)),console[_0x47f361(0x1b3)]('\x20\x20Job\x20ID:\x20'+_0x4c1807[_0x47f361(0x17a)]),await handleSDKOutput([_0x4c1807],_0xf7b5c8),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0xbf4631(0x188)]=a26_0xbf4631(0x1a1);['description']='Get\x20job\x20results';['validate'](_0x2554a0){const _0x4c7db5=a26_0xbf4631,_0x272bf8=_0x2554a0['args'][0x0];if(!_0x272bf8)return _0x4c7db5(0x1c8);return undefined;}async['execute'](_0x13d587){const _0x37b97f=a26_0xbf4631,{options:_0x538f33,args:_0x1a6ca6,tdx:_0x43ce14}=_0x13d587,_0x3ec72c=_0x1a6ca6[0x0],_0x37cf02=await withSpinner(_0x37b97f(0x1be),()=>_0x43ce14[_0x37b97f(0x185)][_0x37b97f(0x1d3)](_0x3ec72c),{'verbose':_0x538f33[_0x37b97f(0x1cd)]}),_0x4a7b22=_0x37cf02[_0x37b97f(0x179)];return console[_0x37b97f(0x1b3)]('✔\x20Retrieved\x20'+_0x4a7b22['length']+_0x37b97f(0x1d4)+(_0x4a7b22[_0x37b97f(0x17c)]!==0x1?'s':'')),await handleSDKOutput(_0x4a7b22,_0x538f33),0x0;}}
|
|
1
|
+
const a26_0x2ae59e=a26_0x47ea;(function(_0x1aafdb,_0x1be2b5){const _0x562c04=a26_0x47ea,_0x3eb363=_0x1aafdb();while(!![]){try{const _0x497308=parseInt(_0x562c04(0xc8))/0x1+parseInt(_0x562c04(0xf4))/0x2+parseInt(_0x562c04(0xce))/0x3+-parseInt(_0x562c04(0xd6))/0x4+parseInt(_0x562c04(0xe4))/0x5+parseInt(_0x562c04(0xca))/0x6+-parseInt(_0x562c04(0xe6))/0x7;if(_0x497308===_0x1be2b5)break;else _0x3eb363['push'](_0x3eb363['shift']());}catch(_0x4ddf4c){_0x3eb363['push'](_0x3eb363['shift']());}}}(a26_0x4460,0x32b15));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a26_0x4460(){const _0x1d1c9b=['391531TSNMZt','site','938190XtIjAN','created_at','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','INVALID_ARGUMENT','796251MjdmuZ','floor','\x27\x20to\x20verify\x20the\x20job\x20status','\x20row','file','\x20job','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','34160IUugGJ','Show\x20job\x20details','round','jobs','length','job:result','Submitting\x20job...','join','show','job:kill','Listing\x20jobs...','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','map','26980wmBNgG','yes','6032530iBsiXZ','✔\x20Found\x20','error','name','...','trino','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','green','getTime','hive','execute','query','push','debug','518516rjatAO','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','h\x20ago','user_name','presto','url','Kill\x20a\x20job','✔\x20Retrieved\x20','Query:\x20','dim','just\x20now','priority','Submit\x20a\x20job','job:submit','job_id','verbose','status','job:show','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','mo\x20ago','data','start_at','result','Status\x20filter:\x20','log','Cancelled','\x20jobs','description','success','List\x20jobs','✔\x20Job\x20submitted','No\x20SQL\x20statements\x20found\x20in\x20file','information_schema','Getting\x20job\x20details...','validate','jobType','Job\x20type:\x20','submit','substring','list','database','abs','args','type','limit'];a26_0x4460=function(){return _0x1d1c9b;};return a26_0x4460();}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3bb8c2 from'chalk';function formatDuration(_0x45be33){const _0x5ff4ed=a26_0x47ea;if(_0x45be33<0x3c)return _0x45be33+'s';if(_0x45be33<0xe10)return Math[_0x5ff4ed(0xcf)](_0x45be33/0x3c)+'m\x20'+_0x45be33%0x3c+'s';const _0x5b38b4=Math[_0x5ff4ed(0xcf)](_0x45be33/0xe10),_0x13196c=Math[_0x5ff4ed(0xcf)](_0x45be33%0xe10/0x3c);return _0x13196c>0x0?_0x5b38b4+'h\x20'+_0x13196c+'m':_0x5b38b4+'h';}function formatRelativeTime(_0x337e72){const _0x22a19f=a26_0x47ea,_0x3736d2=Date['now']()-_0x337e72[_0x22a19f(0xee)](),_0x32dba6=Math[_0x22a19f(0xcf)](Math[_0x22a19f(0x11e)](_0x3736d2)/0x3e8);if(_0x32dba6<0x3c)return _0x22a19f(0xff);const _0x54e148=Math[_0x22a19f(0xcf)](_0x32dba6/0x3c);if(_0x54e148<0x3c)return _0x54e148+'m\x20ago';const _0x46198a=Math['floor'](_0x54e148/0x3c);if(_0x46198a<0x18)return _0x46198a+_0x22a19f(0xf7);const _0x4da0d7=Math[_0x22a19f(0xcf)](_0x46198a/0x18);if(_0x4da0d7<0x1e)return _0x4da0d7+'d\x20ago';return Math[_0x22a19f(0xcf)](_0x4da0d7/0x1e)+_0x22a19f(0x108);}export class JobListCommand extends BaseCommand{[a26_0x2ae59e(0xe9)]=a26_0x2ae59e(0xd9);['description']=a26_0x2ae59e(0x112);async[a26_0x2ae59e(0xf0)](_0xa9a186){const _0x29a637=a26_0x2ae59e,{options:_0xbf080e,tdx:_0x29633d}=_0xa9a186,_0x379ce5=resolveLimit(_0xbf080e[_0x29a637(0xc7)],DEFAULT_DISPLAY_LIMIT),_0x9eee6d=_0xbf080e[_0x29a637(0x105)];_0xbf080e[_0x29a637(0x104)]&&(console[_0x29a637(0xe8)]('Limit:\x20'+_0x379ce5+_0x29a637(0x10f)),_0x9eee6d&&console[_0x29a637(0xe8)](_0x29a637(0x10c)+_0x9eee6d));const _0x16e402=await withSpinner(_0x29a637(0xe0),()=>_0x29633d[_0x29a637(0xd9)][_0x29a637(0x11c)]({'from':0x0,'to':_0x379ce5-0x1,'status':_0x9eee6d}),{'verbose':_0xbf080e[_0x29a637(0x104)]}),_0x36d636=_0x16e402[_0x29a637(0x109)];console[_0x29a637(0xe8)](_0x29a637(0xe7)+_0x36d636['length']+_0x29a637(0xd3)+(_0x36d636['length']!==0x1?'s':''));const _0xcace02=_0xbf080e[_0x29a637(0xc9)];if(isStructuredFormat(_0xbf080e)){const _0x19103a=_0x36d636[_0x29a637(0xe3)](_0x28490c=>{const _0x346e7b=_0x29a637;let _0x1a3410;if(_0x28490c[_0x346e7b(0x10a)]&&_0x28490c[_0x346e7b(0xd4)]){const _0x5ab848=new Date(_0x28490c['start_at'])['getTime'](),_0x330b95=new Date(_0x28490c[_0x346e7b(0xd4)])['getTime']();_0x1a3410=Math[_0x346e7b(0xd8)]((_0x330b95-_0x5ab848)/0x3e8);}return{'job_id':_0x28490c[_0x346e7b(0x103)],'type':_0x28490c[_0x346e7b(0xc6)]===_0x346e7b(0xf9)?'trino':_0x28490c[_0x346e7b(0xc6)],'status':_0x28490c['status'],'user_name':_0x28490c[_0x346e7b(0xf8)],'duration_sec':_0x1a3410,'created_at':_0x28490c[_0x346e7b(0xcb)],'started_at':_0x28490c[_0x346e7b(0x10a)],'end_at':_0x28490c[_0x346e7b(0xd4)]};});await handleSDKOutput(_0x19103a,_0xbf080e);}else for(const _0x4221f9 of _0x36d636){const _0x5ddcd2=_0x4221f9[_0x29a637(0x105)]===_0x29a637(0x111)?a26_0x3bb8c2[_0x29a637(0xed)]:_0x4221f9['status']==='error'?a26_0x3bb8c2['red']:a26_0x3bb8c2['dim'],_0x3e3905=_0x5ddcd2(_0x4221f9['status']),_0xad5182=getJobUrl(_0xcace02,_0x4221f9[_0x29a637(0x103)]),_0x28c3e9=hyperlink(_0x4221f9[_0x29a637(0x103)],_0xad5182),_0x194335=a26_0x3bb8c2['dim'](_0x4221f9[_0x29a637(0xc6)]===_0x29a637(0xf9)?_0x29a637(0xeb):_0x4221f9[_0x29a637(0xc6)]),_0x966115=[];if(_0x4221f9[_0x29a637(0x10a)]&&_0x4221f9[_0x29a637(0xd4)]){const _0x379479=Math['round']((new Date(_0x4221f9[_0x29a637(0xd4)])[_0x29a637(0xee)]()-new Date(_0x4221f9[_0x29a637(0x10a)])[_0x29a637(0xee)]())/0x3e8);_0x966115['push'](formatDuration(_0x379479));}if(_0x4221f9[_0x29a637(0xd4)])_0x966115[_0x29a637(0xf2)](formatRelativeTime(new Date(_0x4221f9[_0x29a637(0xd4)])));else _0x4221f9[_0x29a637(0x10a)]&&_0x966115[_0x29a637(0xf2)](formatRelativeTime(new Date(_0x4221f9[_0x29a637(0x10a)])));const _0x253fc6=_0x966115['length']>0x0?a26_0x3bb8c2[_0x29a637(0xfe)]('\x20'+_0x966115[_0x29a637(0xdd)](',\x20')):'';console[_0x29a637(0x10d)]('⚡\x20'+_0x28c3e9+'\x20'+_0x194335+'\x20'+_0x3e3905+_0x253fc6);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x2ae59e(0xe9)]=a26_0x2ae59e(0x106);['description']=a26_0x2ae59e(0xd7);[a26_0x2ae59e(0x117)](_0x4c61e4){const _0x247d13=a26_0x2ae59e,_0x1ce283=_0x4c61e4[_0x247d13(0xc5)][0x0];if(!_0x1ce283)return _0x247d13(0xd5);return undefined;}async[a26_0x2ae59e(0xf0)](_0x26a5fd){const _0x23a65f=a26_0x2ae59e,{options:_0x179b38,args:_0x14b3f1,tdx:_0x2ddbc7}=_0x26a5fd,_0xe9ff0b=_0x14b3f1[0x0],_0x1745c8=await withSpinner(_0x23a65f(0x116),()=>_0x2ddbc7[_0x23a65f(0xd9)][_0x23a65f(0xde)](_0xe9ff0b),{'verbose':_0x179b38[_0x23a65f(0x104)]}),_0x1fb608=_0x1745c8['data'];let _0xf84aec;if(_0x1fb608['start_at']&&_0x1fb608[_0x23a65f(0xd4)]){const _0x44077e=new Date(_0x1fb608[_0x23a65f(0x10a)])[_0x23a65f(0xee)](),_0x26a1fd=new Date(_0x1fb608['end_at'])[_0x23a65f(0xee)]();_0xf84aec=Math[_0x23a65f(0xd8)]((_0x26a1fd-_0x44077e)/0x3e8);}const _0x2a836c={'job_id':_0x1fb608['job_id'],'type':_0x1fb608['type'],'status':_0x1fb608['status'],..._0x1fb608['user_name']&&{'user_name':_0x1fb608[_0x23a65f(0xf8)]},..._0xf84aec!==undefined&&{'duration_sec':_0xf84aec},..._0x1fb608[_0x23a65f(0xcb)]&&{'created_at':_0x1fb608[_0x23a65f(0xcb)]},..._0x1fb608[_0x23a65f(0x10a)]&&{'started_at':_0x1fb608[_0x23a65f(0x10a)]},..._0x1fb608[_0x23a65f(0xd4)]&&{'end_at':_0x1fb608[_0x23a65f(0xd4)]},..._0x1fb608[_0x23a65f(0x11d)]&&{'database':_0x1fb608[_0x23a65f(0x11d)]},..._0x1fb608[_0x23a65f(0x100)]!==undefined&&{'priority':_0x1fb608['priority']},..._0x1fb608[_0x23a65f(0xfa)]&&{'url':_0x1fb608[_0x23a65f(0xfa)]},..._0x1fb608[_0x23a65f(0xf1)]&&{'query':_0x1fb608[_0x23a65f(0xf1)]},..._0x1fb608[_0x23a65f(0xf3)]&&{'debug':_0x1fb608[_0x23a65f(0xf3)]}};return await handleSingleObjectOutput(_0x2a836c,_0x179b38),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x2ae59e(0xe9)]=a26_0x2ae59e(0xdf);[a26_0x2ae59e(0x110)]=a26_0x2ae59e(0xfb);[a26_0x2ae59e(0x117)](_0x1e260f){const _0x175d27=a26_0x2ae59e,_0x3f321f=_0x1e260f[_0x175d27(0xc5)][0x0];if(!_0x3f321f)return _0x175d27(0xf6);return undefined;}async[a26_0x2ae59e(0xf0)](_0x26354c){const _0x15a7c5=a26_0x2ae59e,{options:_0x24184f,args:_0x4b8a5a,tdx:_0x3a6df5}=_0x26354c,_0x5d78fd=_0x4b8a5a[0x0];if(!_0x24184f[_0x15a7c5(0xe5)]){const _0x4fbd35=await confirm(_0x15a7c5(0xf5)+_0x5d78fd+'?');if(!_0x4fbd35)return console['error'](_0x15a7c5(0x10e)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x3a6df5[_0x15a7c5(0xd9)]['kill'](_0x5d78fd),{'verbose':_0x24184f[_0x15a7c5(0x104)]}),console['error'](_0x15a7c5(0xe1)+_0x5d78fd),console[_0x15a7c5(0xe8)](_0x15a7c5(0xcc)+_0x5d78fd+_0x15a7c5(0xd0)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x2ae59e(0x102);[a26_0x2ae59e(0x110)]=a26_0x2ae59e(0x101);async[a26_0x2ae59e(0xf0)](_0x5530ea){const _0x860999=a26_0x2ae59e,{options:_0x39473d,args:_0x3d8a17,tdx:_0x10121b}=_0x5530ea,_0x4d8fb7=_0x39473d[_0x860999(0x118)]||_0x860999(0xeb),_0x3fcb3e=_0x39473d[_0x860999(0xd2)],_0x3a033c=_0x39473d[_0x860999(0x11d)]||_0x860999(0x115),_0x82f3b3=_0x39473d[_0x860999(0x10b)];if(_0x4d8fb7!=='trino'&&_0x4d8fb7!==_0x860999(0xef))throw new SDKError(ErrorCode[_0x860999(0xcd)],_0x860999(0xec));let _0x628a59;if(_0x3fcb3e){if(_0x3d8a17[0x0])throw new SDKError(ErrorCode[_0x860999(0xcd)],_0x860999(0x107));const _0x310e66=readSqlStatementsFromFile(_0x3fcb3e);if(_0x310e66[_0x860999(0xda)]===0x0)throw new SDKError(ErrorCode[_0x860999(0xcd)],_0x860999(0x114));if(_0x310e66[_0x860999(0xda)]>0x1)throw new SDKError(ErrorCode[_0x860999(0xcd)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x628a59=_0x310e66[0x0];}else{if(!_0x3d8a17[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x628a59=_0x3d8a17[0x0];}_0x39473d[_0x860999(0x104)]&&(console[_0x860999(0xe8)](_0x860999(0x119)+_0x4d8fb7),console[_0x860999(0xe8)]('Database:\x20'+_0x3a033c),console[_0x860999(0xe8)](_0x860999(0xfd)+_0x628a59[_0x860999(0x11b)](0x0,0x64)+(_0x628a59[_0x860999(0xda)]>0x64?_0x860999(0xea):'')));const _0x2a67d6=await withSpinner(_0x860999(0xdc),()=>_0x10121b[_0x860999(0xd9)][_0x860999(0x11a)](_0x3a033c,_0x628a59,_0x4d8fb7,_0x82f3b3),{'verbose':_0x39473d[_0x860999(0x104)]}),_0x18b010=_0x2a67d6['data'];return console[_0x860999(0xe8)](_0x860999(0x113)),console['error']('\x20\x20Job\x20ID:\x20'+_0x18b010[_0x860999(0x103)]),await handleSDKOutput([_0x18b010],_0x39473d),0x0;}}function a26_0x47ea(_0x40f4bd,_0x2872fd){_0x40f4bd=_0x40f4bd-0xc5;const _0x44602e=a26_0x4460();let _0x47ea7b=_0x44602e[_0x40f4bd];return _0x47ea7b;}export class JobResultCommand extends BaseCommand{[a26_0x2ae59e(0xe9)]=a26_0x2ae59e(0xdb);[a26_0x2ae59e(0x110)]='Get\x20job\x20results';[a26_0x2ae59e(0x117)](_0x4261f5){const _0x1ff60b=a26_0x2ae59e,_0x1bcbf6=_0x4261f5[_0x1ff60b(0xc5)][0x0];if(!_0x1bcbf6)return _0x1ff60b(0xe2);return undefined;}async[a26_0x2ae59e(0xf0)](_0x2c66fb){const _0xe8f4f=a26_0x2ae59e,{options:_0x52caa2,args:_0x446ef7,tdx:_0x2a8de3}=_0x2c66fb,_0x5514ee=_0x446ef7[0x0],_0x3f81e3=await withSpinner('Getting\x20job\x20results...',()=>_0x2a8de3[_0xe8f4f(0xd9)][_0xe8f4f(0x10b)](_0x5514ee),{'verbose':_0x52caa2[_0xe8f4f(0x104)]}),_0x4f7bb5=_0x3f81e3[_0xe8f4f(0x109)];return console[_0xe8f4f(0xe8)](_0xe8f4f(0xfc)+_0x4f7bb5[_0xe8f4f(0xda)]+_0xe8f4f(0xd1)+(_0x4f7bb5['length']!==0x1?'s':'')),await handleSDKOutput(_0x4f7bb5,_0x52caa2),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x3d26ae=a27_0x2150;(function(_0xacad7c,_0x36d645){const _0x431c28=a27_0x2150,_0xd7a9fb=_0xacad7c();while(!![]){try{const _0x37b6c3=parseInt(_0x431c28(0x13d))/0x1*(-parseInt(_0x431c28(0x1af))/0x2)+parseInt(_0x431c28(0x1a5))/0x3+parseInt(_0x431c28(0x17e))/0x4*(-parseInt(_0x431c28(0x154))/0x5)+-parseInt(_0x431c28(0x18f))/0x6*(-parseInt(_0x431c28(0x1d4))/0x7)+parseInt(_0x431c28(0x144))/0x8+-parseInt(_0x431c28(0x164))/0x9*(-parseInt(_0x431c28(0x153))/0xa)+parseInt(_0x431c28(0x17b))/0xb;if(_0x37b6c3===_0x36d645)break;else _0xd7a9fb['push'](_0xd7a9fb['shift']());}catch(_0x6e1afe){_0xd7a9fb['push'](_0xd7a9fb['shift']());}}}(a27_0x117b,0xcc54d));import a27_0x36bf62 from'chalk';import a27_0x745048 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';function a27_0x2150(_0x1fdd06,_0x3e5995){_0x1fdd06=_0x1fdd06-0xfb;const _0x117b3b=a27_0x117b();let _0x215037=_0x117b3b[_0x1fdd06];return _0x215037;}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(_0x1d031b){const _0x18c68=a27_0x2150;return!_0x1d031b&&(console[_0x18c68(0x14b)](_0x18c68(0x19e)),console['error']('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x1d031b;}function withJsonFormat(_0x2da335){const _0x31e27f=a27_0x2150;if(!_0x2da335[_0x31e27f(0x143)]&&!_0x2da335[_0x31e27f(0x1b7)]&&!_0x2da335[_0x31e27f(0x148)]&&!_0x2da335[_0x31e27f(0x108)])return{..._0x2da335,'format':_0x31e27f(0x1b7),'json':!![]};return _0x2da335;}function formatJourneyState(_0x42b868){const _0x538b2f=a27_0x2150;switch(_0x42b868){case _0x538b2f(0x188):return a27_0x36bf62[_0x538b2f(0x1f5)]('(running)');case _0x538b2f(0x171):return a27_0x36bf62[_0x538b2f(0x10c)](_0x538b2f(0x1bc));case'paused':return a27_0x36bf62[_0x538b2f(0x18c)](_0x538b2f(0x109));case _0x538b2f(0x13b):return a27_0x36bf62['blue'](_0x538b2f(0x1a0));case _0x538b2f(0x166):return a27_0x36bf62[_0x538b2f(0x10c)]('(archived)');default:return'('+_0x42b868+')';}}function formatJourneyItem(_0xd8f4de,_0x1124ee='',_0x1e62af){const _0x569873=a27_0x2150,_0x181566=formatJourneyState(_0xd8f4de[_0x569873(0x1f0)]),_0x306138=_0x1e62af?hyperlink(_0xd8f4de[_0x569873(0x17d)],_0x1e62af):_0xd8f4de[_0x569873(0x17d)];return _0x1124ee+_0x569873(0x111)+_0x306138+'\x20'+_0x181566;}function escapeRegex(_0x2d9e46){const _0x3ff062=a27_0x2150;return _0x2d9e46['replace'](/[.*+?^${}()|[\]\\]/g,_0x3ff062(0x14c));}function globToRegex(_0x50b613){const _0x22e416=a27_0x2150,_0x569685=_0x50b613['split']('*')[_0x22e416(0x150)](escapeRegex);return new RegExp(_0x569685[_0x22e416(0x134)]('.*'),'i');}function buildRuleToNameMapping(_0x151a9a){const _0x143c0d=a27_0x2150,_0x4d3efd=new Map();if(_0x151a9a[_0x143c0d(0x1c9)])for(const [_0x23b083,_0x32908a]of Object['entries'](_0x151a9a[_0x143c0d(0x1c9)])){if(_0x32908a['rule']){const _0x86e96=serializeRule(_0x32908a['rule']),_0x12f6ad=_0x4d3efd[_0x143c0d(0x173)](_0x86e96);_0x12f6ad?_0x12f6ad['push'](_0x23b083):_0x4d3efd['set'](_0x86e96,[_0x23b083]);}}return _0x4d3efd;}async function resolveJourneyIdFromInput(_0x11dee6,_0x477e70,_0x119ce0){const _0x38e224=a27_0x2150,_0x256615=await resolveJourneyTarget(_0x11dee6,_0x477e70[_0x38e224(0x1ec)],_0x477e70[_0x38e224(0x1e3)]),_0x4f39a2=_0x256615[_0x38e224(0x1ec)];if(!_0x4f39a2)throw new SDKError(ErrorCode[_0x38e224(0x1db)],_0x38e224(0x162));const _0x1cff55=await withSpinner(_0x38e224(0x1e2),()=>_0x119ce0[_0x38e224(0x1aa)][_0x38e224(0x13a)](_0x4f39a2),{'verbose':_0x477e70[_0x38e224(0x1e3)]}),_0x5ac3ca=_0x1cff55['data'],_0x57dd5b=await withSpinner(_0x38e224(0x1c3),()=>_0x119ce0[_0x38e224(0x15c)][_0x38e224(0x106)](_0x5ac3ca,_0x256615[_0x38e224(0x189)]),{'verbose':_0x477e70[_0x38e224(0x1e3)]});return{'journeyId':_0x57dd5b['data'],'journeyName':_0x256615[_0x38e224(0x189)],'parentSegmentId':_0x5ac3ca};}async function resolveJourneyTarget(_0x17f8fb,_0x1a432d,_0x3c6bd9){const _0x505ba2=a27_0x2150;if(isYamlFilePath(_0x17f8fb))try{const _0x455614=await resolveYamlFilePath(_0x17f8fb);return _0x3c6bd9&&(console[_0x505ba2(0x14b)](_0x505ba2(0x1fc)+_0x17f8fb),console[_0x505ba2(0x14b)](_0x505ba2(0x198)+_0x455614[_0x505ba2(0x1ec)]),console[_0x505ba2(0x14b)](_0x505ba2(0x176)+_0x455614[_0x505ba2(0x205)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x455614[_0x505ba2(0x104)]||_0x505ba2(0x137)))),{'journeyName':_0x455614[_0x505ba2(0x205)],'parentSegment':_0x455614['parentSegment'],'resolved':_0x455614};}catch(_0x4d220d){throw new SDKError(ErrorCode[_0x505ba2(0x1db)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4d220d[_0x505ba2(0x1a6)]);}if(!_0x1a432d)throw new SDKError(ErrorCode[_0x505ba2(0x1db)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x17f8fb,'parentSegment':_0x1a432d};}function a27_0x117b(){const _0x534858=['96022xMFrXa','journey:traffic','Getting\x20column\x20mapping...','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Cancelled','\x20\x20Preserving\x20local\x20segment\x20name:\x20','format','6590976RzjGSM','stageNameMap','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','args','jsonl','Database:\x20','relative','error','\x5c$&','Show\x20journey\x20table\x20column\x20mapping','Error:\x20Journey\x20\x27','file','map','stringify','then','10ALVIwU','220lRxOel','no_parent','resolveSegment','yes','session','values','utf-8','Parent\x20segment:\x20','journey','Warning:\x20Could\x20not\x20resolve\x20segment\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','journeyStages','kind','Resuming\x20journey...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','find','4778523afuWIe','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','archived','createdAt','Error:\x20','hasChanges','journey:version:create','getJourney','buildIdToEmailMap','✔\x20Journey\x20\x22','\x0aError:','cwd','\x20(ID:\x20','draft','/app/ps/','get','version','set','\x20\x20Name:\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','listJourneysFromParentSegment','folderId','\x20Opening\x20','7212667DSZldB','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)','journeyBundleName','93344frLlDp','✔\x20Found\x20','Error:\x20Version\x20','Input:\x20','Creating\x20new\x20version...','Found\x20','base','buildIdToNameMap','localeCompare','description','launched','journeyName','No\x20journeys\x20found','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','yellow','Error:\x20Stage\x20\x22','pause','1734168hRiFSW','web','size','/j/da/je','activation','journey:version:view','\x27\x20not\x20found\x20in\x20','getTrafficData','Pattern:\x20','\x20\x20Parent\x20segment:\x20','Fetching\x20journeys\x20and\x20folders...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','resume','Available\x20stages:\x20','journey:pause','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Write\x20','(completed)','\x22\x20resumed','conversion','targetDir','completionRate','2149335kPIqKz','message','journey:columns','limit','rule','segment','reentryMode','site','journey:push','listActivationsFlat','24TxuEnS','includeHistory','resourceName','✔\x20Pulled\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','database','\x20=\x20','content','json','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','options','paused','Show\x20journey\x20details','(draft)','all','\x20version','/e/','\x20versions)','journey:activations','\x20Created\x20v','Resolving\x20journey...','journeyId','push','attributes','cyan','tdx.json','segments','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','\x20not\x20found.\x20Available:\x20','rootFolderId','has','Show\x20journey\x20statistics','enteredSize','sort','helpText','Folder\x20path:\x20','Getting\x20journey\x20details...','7sToDMa','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','listJourneysWithFolders','segmentPushCommand','List\x20journeys\x20in\x20current\x20context','repeat','versionNumber','INVALID_ARGUMENT','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','red','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','relativePath','journey:versions','from','Resolving\x20parent\x20segment...','verbose','folders','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','goalSize','entries','\x20details...','\x20journeys','\x0aChanges\x20to\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','parentSegment','List\x20activations\x20for\x20a\x20journey','renderStats','Fetching\x20','state','updatedAt','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','getActivation',',\x20version:\x20','green','bold','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Listing\x20journey\x20activations...','journey:view','/j/da','stages','Resolved\x20YAML\x20file:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','createVersion','listFolders','Error:\x20Invalid\x20version\x20number:\x20','goal','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Target\x20directory:\x20','journeyBundleId','segmentName','Options:','Getting\x20journey\x20traffic\x20data...','\x20\x20Consolidating\x20duplicate\x20segment:\x20','name','columns','links','milestoneSize','Error:\x20Invalid\x20--type\x20\x22','getSegment','type','execute','history','folderPath','-\x20no\x20files\x20written','resolveJourneyId','\x20\x20Target:\x20','tsv','(paused)','absolutePath','\x20activation','dim','exitOrJumpRate','dryRun','isNew','Getting\x20journey\x20statistics...','🗺️\x20','parent_segment','getLatestJourneyId','Resume\x20a\x20paused\x20journey','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pause\x20a\x20running\x20journey','toLowerCase','Error:\x20Journey\x20not\x20found:\x20','data','filter','journey:resume','connection','\x20(draft)\x20—\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Target\x20file:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x20(rule\x20match)','Fetching\x20parent\x20segment...','✔\x20Context\x20set:\x20','user','includeStats','connector_config','table','add','root\x20folder','length','test','listVersions','No\x20statistics\x20available\x20for\x20journey:\x20','.yml','\x20\x20-\x20','log','journeys','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','View\x20a\x20specific\x20version\x20of\x20a\x20journey','join','\x22\x20not\x20found','Journey\x20name:\x20','(root)','getColumnMapping','getStatistics','resolveParentId','completed','hasPeriod'];a27_0x117b=function(){return _0x534858;};return a27_0x117b();}export class JourneyListCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]='journey:list';[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x1d8);async['execute'](_0x54a925){const _0xb4119c=a27_0x3d26ae,{options:_0x5d8dfa,args:_0xaf4adb,tdx:_0x2c3e23}=_0x54a925,_0x3d2ae7=_0xaf4adb[0x0],_0x5beb08=_0x5d8dfa[_0xb4119c(0x1ec)];if(!_0x5beb08)return console[_0xb4119c(0x14b)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error']('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x3a4fd3=await withSpinner(_0xb4119c(0x1e2),()=>_0x2c3e23[_0xb4119c(0x1aa)][_0xb4119c(0x13a)](_0x5beb08),{'verbose':_0x5d8dfa[_0xb4119c(0x1e3)]}),_0x48376c=_0x3a4fd3[_0xb4119c(0x119)];_0x5d8dfa[_0xb4119c(0x1e3)]&&(console[_0xb4119c(0x14b)](_0xb4119c(0x15b)+_0x5beb08+_0xb4119c(0x170)+_0x48376c+')'),_0x3d2ae7&&console[_0xb4119c(0x14b)](_0xb4119c(0x197)+_0x3d2ae7));const _0x816aa0=await withSpinner(_0xb4119c(0x122),()=>_0x2c3e23[_0xb4119c(0x1aa)]['getParentFull'](_0x48376c),{'verbose':_0x5d8dfa['verbose']}),_0x121518=_0x816aa0[_0xb4119c(0x119)],_0x5a80a5=_0x121518[_0xb4119c(0x1cc)],_0x4adcf4=await withSpinner('Listing\x20journeys...',()=>_0x2c3e23[_0xb4119c(0x15c)][_0xb4119c(0x1d6)](_0x48376c,_0x5a80a5),{'verbose':_0x5d8dfa[_0xb4119c(0x1e3)]});let _0x3c745e=_0x4adcf4[_0xb4119c(0x119)][_0xb4119c(0x131)];const _0x16882b=_0x4adcf4['data'][_0xb4119c(0x1e4)],_0x50808b=new Map();for(const _0x278723 of _0x16882b){_0x50808b[_0xb4119c(0x175)](_0x278723['id'],_0x278723[_0xb4119c(0xfb)]);}if(_0x3d2ae7){const _0x59dd67=globToRegex(_0x3d2ae7);_0x3c745e=_0x3c745e[_0xb4119c(0x11a)](_0x543638=>_0x59dd67[_0xb4119c(0x12b)](_0x543638['journeyBundleName']));}console['error'](_0xb4119c(0x17f)+_0x3c745e['length']+'\x20journey'+(_0x3c745e['length']!==0x1?'s':''));const _0x2f9d08=_0x1182f1=>{const _0x4ea209=_0xb4119c;return getConsoleNextUrl(_0x5d8dfa['site'],'/app/ps/'+_0x48376c+_0x4ea209(0x1bf)+_0x1182f1+_0x4ea209(0x1fa));};if(_0x5d8dfa['format']===_0xb4119c(0x127))await handleSDKOutput(_0x3c745e,_0x5d8dfa);else{if(_0x5d8dfa[_0xb4119c(0x143)]===_0xb4119c(0x1b7)){const _0x3dc36c=_0x3c745e['map'](_0x409eff=>({..._0x409eff,'url':_0x2f9d08(_0x409eff['id'])}));await handleSDKOutput(_0x3dc36c,_0x5d8dfa);}else{console[_0xb4119c(0x130)]('['+_0x5beb08+']');const _0x4e8cc6=new Map(),_0x41598b=[];for(const _0x4a4b99 of _0x3c745e){if(!_0x4a4b99['folderId']||_0x4a4b99['folderId']===_0x5a80a5)_0x41598b[_0xb4119c(0x1c5)](_0x4a4b99);else{const _0x324cda=_0x4e8cc6['get'](_0x4a4b99['folderId'])||[];_0x324cda[_0xb4119c(0x1c5)](_0x4a4b99),_0x4e8cc6[_0xb4119c(0x175)](_0x4a4b99['folderId'],_0x324cda);}}const _0x31d707=(_0x5edf5e,_0x6aafb8)=>_0x5edf5e['journeyBundleName']['localeCompare'](_0x6aafb8[_0xb4119c(0x17d)],undefined,{'sensitivity':_0xb4119c(0x184)});_0x41598b[_0xb4119c(0x1d0)](_0x31d707);for(const _0x42159a of _0x41598b){console[_0xb4119c(0x130)](formatJourneyItem(_0x42159a,'',_0x2f9d08(_0x42159a['id'])));}const _0x223a05=[..._0x4e8cc6[_0xb4119c(0x1e7)]()][_0xb4119c(0x1d0)]((_0x9458f7,_0x1c2bf0)=>{const _0x198f93=_0xb4119c,_0x35f641=_0x50808b['get'](_0x9458f7[0x0])||_0x9458f7[0x0],_0x44378e=_0x50808b[_0x198f93(0x173)](_0x1c2bf0[0x0])||_0x1c2bf0[0x0];return _0x35f641[_0x198f93(0x186)](_0x44378e,undefined,{'sensitivity':_0x198f93(0x184)});});for(const [_0x35f46a,_0x1e87f5]of _0x223a05){const _0x53614f=_0x50808b[_0xb4119c(0x173)](_0x35f46a)||_0x35f46a;console[_0xb4119c(0x130)]('📁\x20'+_0x53614f),_0x1e87f5[_0xb4119c(0x1d0)](_0x31d707);for(const _0x3b3a02 of _0x1e87f5){console['log'](formatJourneyItem(_0x3b3a02,'\x20\x20',_0x2f9d08(_0x3b3a02['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x1f9);['description']=a27_0x3d26ae(0x1bb);async[a27_0x3d26ae(0x102)](_0x30b336){const _0x6350a2=a27_0x3d26ae,{options:_0x129434,args:_0x26658b,tdx:_0x73e9cb}=_0x30b336,_0x6b77c8=_0x26658b[0x0];if(!_0x6b77c8)return console[_0x6350a2(0x14b)](_0x6350a2(0x19e)),console['error'](_0x6350a2(0x146)),console[_0x6350a2(0x14b)](_0x6350a2(0x206)),console[_0x6350a2(0x14b)](_0x6350a2(0x1eb)),0x1;_0x129434[_0x6350a2(0x1e3)]&&console[_0x6350a2(0x14b)](_0x6350a2(0x181)+_0x6b77c8);const {journeyId:_0x55c476,parentSegmentId:_0xac8857}=await resolveJourneyIdFromInput(_0x6b77c8,_0x129434,_0x73e9cb);if(_0x129434[_0x6350a2(0x190)]){const _0x1906e7=getConsoleNextUrl(_0x129434['site'],_0x6350a2(0x172)+_0xac8857+_0x6350a2(0x1bf)+_0x55c476+'/j/da/je');return console[_0x6350a2(0x14b)](a27_0x36bf62['green']('✔')+_0x6350a2(0x17a)+a27_0x36bf62[_0x6350a2(0x1c7)](_0x1906e7)),openBrowser(_0x1906e7),0x0;}const _0x3fd26d=await withSpinner(_0x6350a2(0x1d3),()=>_0x73e9cb[_0x6350a2(0x15c)][_0x6350a2(0x16b)](_0x55c476),{'verbose':_0x129434['verbose']}),_0x19ec39=_0x3fd26d[_0x6350a2(0x119)],_0x75071=_0x129434[_0x6350a2(0x125)];let _0x209027;if(_0x75071)try{const _0x5b0449=await withSpinner(_0x6350a2(0x110),()=>_0x73e9cb['journey']['getStatistics'](_0x55c476),{'verbose':_0x129434[_0x6350a2(0x1e3)]});_0x209027=_0x5b0449[_0x6350a2(0x119)];}catch{_0x129434['verbose']&&console[_0x6350a2(0x14b)]('\x20\x20Statistics\x20not\x20available');}const _0x15620b=getConsoleNextUrl(_0x129434[_0x6350a2(0x1ac)],_0x6350a2(0x172)+_0xac8857+_0x6350a2(0x1bf)+_0x55c476+_0x6350a2(0x192)),_0x503585={'id':_0x19ec39['id'],'name':_0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0xfb)],'description':_0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0x187)],'state':_0x19ec39['attributes'][_0x6350a2(0x1f0)],'paused':_0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0x1ba)],'reentry_mode':_0x19ec39['attributes'][_0x6350a2(0x1ab)],'stages':_0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0x15f)]?.[_0x6350a2(0x12a)]||0x0,..._0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0x201)]&&{'goal':_0x19ec39['attributes'][_0x6350a2(0x201)]['name']},..._0x209027&&{'statistics':{'size':_0x209027[_0x6350a2(0x191)],'entered':_0x209027[_0x6350a2(0x1cf)],'goal_achieved':_0x209027[_0x6350a2(0x1e6)],'completion_rate':_0x209027[_0x6350a2(0x1a4)],'exit_or_jump':_0x209027['exitOrJumpSize'],'exit_or_jump_rate':_0x209027[_0x6350a2(0x10d)],'stages':_0x209027['stages']}},'url':_0x15620b};return await handleSingleObjectOutput(_0x503585,_0x129434),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]='journey:stats';['description']=a27_0x3d26ae(0x1ce);async[a27_0x3d26ae(0x102)](_0x31a7f9){const _0x16ed56=a27_0x3d26ae,{options:_0x1fd87b,args:_0x28bc6b,tdx:_0x2d9afe}=_0x31a7f9,_0x2ec8c1=_0x28bc6b[0x0];if(!requireNameOrPath(_0x2ec8c1))return 0x1;_0x1fd87b[_0x16ed56(0x1e3)]&&console['error'](_0x16ed56(0x181)+_0x2ec8c1);const _0x43187e=_0x1fd87b,_0x3d6120=_0x43187e[_0x16ed56(0x1e1)],_0x5d5f7d=_0x43187e['to'],_0x46c04e=_0x43187e[_0x16ed56(0x1b0)],_0x4debfb=_0x43187e['stage'];_0x46c04e&&!_0x3d6120&&!_0x5d5f7d&&console[_0x16ed56(0x14b)](_0x16ed56(0x1d5));const _0x326bd3=_0x46c04e?withJsonFormat(_0x1fd87b):_0x1fd87b,{journeyId:_0x2a1007,journeyName:_0x3263e1}=await resolveJourneyIdFromInput(_0x2ec8c1,_0x326bd3,_0x2d9afe),_0x47a473=_0x3d6120||_0x5d5f7d?{'from':_0x3d6120,'to':_0x5d5f7d}:undefined,_0x5df003=await withSpinner(_0x16ed56(0x110),()=>Promise[_0x16ed56(0x1bd)]([_0x2d9afe[_0x16ed56(0x15c)][_0x16ed56(0x16b)](_0x2a1007),_0x2d9afe['journey'][_0x16ed56(0x139)](_0x2a1007,_0x47a473)]),{'verbose':_0x326bd3['verbose']}),[_0x49ac73,_0x20d9a1]=_0x5df003[_0x16ed56(0x119)];if(!_0x20d9a1||_0x20d9a1[_0x16ed56(0x1c4)]===null)return console[_0x16ed56(0x14b)](_0x16ed56(0x12d)+_0x3263e1),console[_0x16ed56(0x14b)](_0x16ed56(0x140)),0x0;const _0x4bf2f9=buildStageNameMap(_0x49ac73),_0x3a4f94=!!(_0x47a473&&_0x20d9a1['history']?.[_0x16ed56(0x12a)]),_0x461d80={'stageNameMap':_0x4bf2f9,'hasPeriod':_0x3a4f94,'includeHistory':!!_0x46c04e};if(_0x4debfb&&_0x20d9a1['stages']){const _0x1e65d2=_0x20d9a1['stages'][_0x16ed56(0x163)](_0x41f8cd=>{const _0x2d67fc=_0x16ed56,_0x11239d=_0x4bf2f9['get'](_0x41f8cd['id'])??'';return _0x11239d[_0x2d67fc(0x117)]()===_0x4debfb[_0x2d67fc(0x117)]();});if(_0x1e65d2)return await handleSingleObjectOutput(formatStageStats(_0x1e65d2,_0x461d80),_0x326bd3),0x0;const _0x2aa95d=_0x20d9a1[_0x16ed56(0x1fb)][_0x16ed56(0x150)](_0x3033d7=>_0x4bf2f9['get'](_0x3033d7['id'])??_0x3033d7['id']);return console[_0x16ed56(0x14b)](_0x16ed56(0x18d)+_0x4debfb+_0x16ed56(0x135)),console[_0x16ed56(0x14b)](_0x16ed56(0x19c)+_0x2aa95d[_0x16ed56(0x134)](',\x20')),0x1;}const _0x53b581=_0x20d9a1[_0x16ed56(0x1fb)]?.[_0x16ed56(0x150)](_0x170ea2=>formatStageStats(_0x170ea2,_0x461d80)),_0x46fa3a=assembleJourneyStats(_0x20d9a1,{'from':_0x3d6120,'to':_0x5d5f7d,'includeHistory':_0x46c04e});return await this[_0x16ed56(0x1ee)](_0x46fa3a,_0x53b581??[],_0x326bd3),0x0;}async[a27_0x3d26ae(0x1ee)](_0x532c58,_0x5168e1,_0x5c5f81){const _0x2de5b2=a27_0x3d26ae,_0x15abb6=_0x5c5f81[_0x2de5b2(0x143)]===_0x2de5b2(0x1b7)||_0x5c5f81[_0x2de5b2(0x143)]===_0x2de5b2(0x148)||_0x5c5f81[_0x2de5b2(0x1b7)]||_0x5c5f81[_0x2de5b2(0x148)];if(_0x15abb6){_0x532c58[_0x2de5b2(0x1fb)]=_0x5168e1,await handleSingleObjectOutput(_0x532c58,_0x5c5f81);return;}await handleSingleObjectOutput(_0x532c58,_0x5c5f81);for(const _0x53f0de of _0x5168e1){console['log'](''),console[_0x2de5b2(0x130)](String(a27_0x36bf62[_0x2de5b2(0x1c7)][_0x2de5b2(0x1f6)]('['+_0x53f0de['name']+']'))+a27_0x36bf62[_0x2de5b2(0x10c)]('\x20'+_0x53f0de['id']));const {id:_0x281ea9,name:_0x276b94,..._0x49d5df}=_0x53f0de;await handleSingleObjectOutput(_0x49d5df,_0x5c5f81);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x13e);['description']=a27_0x3d26ae(0x120);async['execute'](_0x34ec9f){const _0x10a549=a27_0x3d26ae,{options:_0xfe6344,args:_0x40abf7,tdx:_0x310f69}=_0x34ec9f,_0x2b3110=_0x40abf7[0x0];if(!requireNameOrPath(_0x2b3110))return 0x1;_0xfe6344['verbose']&&console[_0x10a549(0x14b)](_0x10a549(0x181)+_0x2b3110);const _0x49dc6f=_0xfe6344,_0x320e65=_0x49dc6f['type'],_0x315ef6=_0x49dc6f[_0x10a549(0x1e1)],_0x26d548=_0x49dc6f['to'],_0x55d7ce=_0x49dc6f[_0x10a549(0x1a8)];if(_0x320e65&&_0x320e65!==_0x10a549(0x1a2)&&_0x320e65!==_0x10a549(0x193))return console[_0x10a549(0x14b)](_0x10a549(0xff)+_0x320e65+_0x10a549(0x165)),0x1;const _0x4e5f22=withJsonFormat(_0xfe6344),{journeyId:_0x45676d,journeyName:_0x147b5f}=await resolveJourneyIdFromInput(_0x2b3110,_0x4e5f22,_0x310f69),_0x9f702d={'type':_0x320e65,'from':_0x315ef6,'to':_0x26d548,'limit':_0x55d7ce},_0x32c187=await withSpinner(_0x10a549(0x207),()=>_0x310f69[_0x10a549(0x15c)][_0x10a549(0x196)](_0x45676d,_0x9f702d),{'verbose':_0x4e5f22['verbose']}),_0x5316f2=_0x32c187[_0x10a549(0x119)],_0x542e56=_0x5316f2[_0x10a549(0x1a2)]&&(_0x5316f2[_0x10a549(0x1a2)]['nodes'][_0x10a549(0x12a)]>0x0||_0x5316f2[_0x10a549(0x1a2)][_0x10a549(0xfd)][_0x10a549(0x12a)]>0x0),_0x4183e5=_0x5316f2[_0x10a549(0x193)]&&_0x5316f2[_0x10a549(0x193)][_0x10a549(0x12a)]>0x0;if(!_0x542e56&&!_0x4183e5)return console[_0x10a549(0x14b)](_0x10a549(0x1dc)+_0x147b5f),console[_0x10a549(0x14b)](_0x10a549(0x1b8)),_0x315ef6&&_0x26d548&&console[_0x10a549(0x14b)](_0x10a549(0x1f2)),0x0;return await handleSingleObjectOutput(_0x5316f2,_0x4e5f22),0x0;}}function formatStageStats(_0x5df9f2,_0x1adda5){const _0x19e205=a27_0x3d26ae,_0x5db753=_0x1adda5[_0x19e205(0x13c)]&&_0x5df9f2[_0x19e205(0x103)]?.[_0x19e205(0x12a)]?aggregateStageHistory(_0x5df9f2['history']):{'size':_0x5df9f2['size'],'entered':_0x5df9f2[_0x19e205(0x1cf)],'milestone':_0x5df9f2[_0x19e205(0xfe)],'milestone_rate':_0x5df9f2['completeMilestoneRate'],'exit_or_jump':_0x5df9f2['exitOrJumpSize'],'exit_or_jump_rate':_0x5df9f2[_0x19e205(0x10d)]},_0x33f5e0={'id':_0x5df9f2['id'],'name':_0x1adda5[_0x19e205(0x145)][_0x19e205(0x173)](_0x5df9f2['id'])??_0x5df9f2['id'],..._0x5db753};return _0x1adda5['hasPeriod']&&_0x1adda5[_0x19e205(0x1b0)]&&_0x5df9f2[_0x19e205(0x103)]&&(_0x33f5e0[_0x19e205(0x103)]=_0x5df9f2['history']),_0x33f5e0;}export class JourneyPauseCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x19d);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x116);async[a27_0x3d26ae(0x102)](_0xecf025){const _0x75872b=a27_0x3d26ae,{options:_0x1f8202,args:_0x53d939,tdx:_0x241383}=_0xecf025,_0x438777=_0x53d939[0x0];if(!requireNameOrPath(_0x438777))return 0x1;_0x1f8202['verbose']&&console[_0x75872b(0x14b)]('Input:\x20'+_0x438777);const {journeyId:_0xd2e6fc,journeyName:_0x2cce55}=await resolveJourneyIdFromInput(_0x438777,_0x1f8202,_0x241383);if(!_0x1f8202[_0x75872b(0x157)]){const _0x22793d=await confirm(_0x75872b(0x1fd)+_0x2cce55+'\x22?');if(!_0x22793d)return console[_0x75872b(0x14b)](_0x75872b(0x141)),0x0;}const _0x172fa6=await withSpinner('Pausing\x20journey...',()=>_0x241383[_0x75872b(0x15c)][_0x75872b(0x18e)](_0xd2e6fc),{'verbose':_0x1f8202['verbose']}),_0x197667=_0x172fa6[_0x75872b(0x119)];return console[_0x75872b(0x14b)]('✔\x20Journey\x20\x22'+_0x197667[_0x75872b(0x1c6)][_0x75872b(0xfb)]+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x11b);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x114);async[a27_0x3d26ae(0x102)](_0x383b1a){const _0x226b44=a27_0x3d26ae,{options:_0x267535,args:_0x59f9c1,tdx:_0x25fa27}=_0x383b1a,_0x4a2c23=_0x59f9c1[0x0];if(!requireNameOrPath(_0x4a2c23))return 0x1;_0x267535['verbose']&&console[_0x226b44(0x14b)](_0x226b44(0x181)+_0x4a2c23);const {journeyId:_0x18d4e6,journeyName:_0x5d9447}=await resolveJourneyIdFromInput(_0x4a2c23,_0x267535,_0x25fa27);if(!_0x267535[_0x226b44(0x157)]){const _0x1787af=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x5d9447+'\x22?');if(!_0x1787af)return console[_0x226b44(0x14b)](_0x226b44(0x141)),0x0;}const _0x79a60f=await withSpinner(_0x226b44(0x161),()=>_0x25fa27[_0x226b44(0x15c)][_0x226b44(0x19b)](_0x18d4e6),{'verbose':_0x267535[_0x226b44(0x1e3)]}),_0x51366b=_0x79a60f[_0x226b44(0x119)];return console[_0x226b44(0x14b)](_0x226b44(0x16d)+_0x51366b[_0x226b44(0x1c6)][_0x226b44(0xfb)]+_0x226b44(0x1a1)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']='journey:pull';['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x3d26ae(0x102)](_0x171988){const _0x202a22=a27_0x3d26ae,{options:_0x44d3f9,args:_0x3306c7,tdx:_0x493a32}=_0x171988,_0x5388fd=_0x44d3f9,_0x56e4da=_0x3306c7[0x0],_0x383751=_0x56e4da&&isYamlFilePath(_0x56e4da),_0x317bbc=await resolveTarget({'arg':_0x383751?_0x56e4da:undefined,'contextParent':_0x44d3f9[_0x202a22(0x1ec)],'cwd':process[_0x202a22(0x16f)]()});if(!isSuccessfulResolution(_0x317bbc))return _0x317bbc['errorCode']===_0x202a22(0x155)?(console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x18c)](_0x202a22(0x1e5))),console[_0x202a22(0x14b)](_0x202a22(0x17c)),console['error'](_0x202a22(0x15e)),console[_0x202a22(0x14b)](_0x202a22(0x19a)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1dd)](_0x202a22(0x168)+_0x317bbc[_0x202a22(0x1a6)]+'\x0a')),_0x317bbc['helpText']&&console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1c7)](_0x317bbc[_0x202a22(0x1d1)]))),0x1;let _0x542ebf=_0x383751?undefined:_0x56e4da,_0x215eaa,_0x239464;_0x317bbc['type']===_0x202a22(0x14f)&&(_0x542ebf=_0x317bbc[_0x202a22(0x1b1)],_0x215eaa=_0x317bbc['filePath'],_0x239464=_0x317bbc[_0x202a22(0x104)]);const _0x54d989=_0x317bbc['parentName'],_0x58ee80=_0x317bbc[_0x202a22(0x1a3)];_0x5388fd[_0x202a22(0x1e3)]&&(console[_0x202a22(0x14b)](_0x202a22(0x15b)+_0x54d989),console[_0x202a22(0x14b)](_0x202a22(0x203)+_0x58ee80),_0x542ebf&&console[_0x202a22(0x14b)](_0x202a22(0x136)+_0x542ebf),_0x215eaa&&console[_0x202a22(0x14b)](_0x202a22(0x11f)+_0x215eaa),_0x239464&&console['error'](_0x202a22(0x1d2)+_0x239464));const _0xc0a784=await withSpinner(_0x202a22(0x1e2),()=>_0x493a32[_0x202a22(0x1aa)][_0x202a22(0x13a)](_0x54d989),{'verbose':_0x44d3f9[_0x202a22(0x1e3)]}),_0x9eb97e=_0xc0a784['data'],{journeys:_0x2313bb,folders:_0x58322d}=await withSpinner(_0x202a22(0x199),async()=>{const _0xc53e7f=_0x202a22,[_0x5d9bdd,_0x21b8c6]=await Promise[_0xc53e7f(0x1bd)]([_0x493a32[_0xc53e7f(0x15c)][_0xc53e7f(0x178)](_0x9eb97e,undefined,{'includeAllVersions':!![]}),_0x493a32[_0xc53e7f(0x1aa)][_0xc53e7f(0x1ff)](_0x9eb97e)]);return{'journeys':_0x5d9bdd,'folders':_0x21b8c6};},{'verbose':_0x44d3f9['verbose']})[_0x202a22(0x152)](_0x57a5ac=>_0x57a5ac['data']);let _0x6ff93d=_0x2313bb;const _0x4f85e7=buildFolderIdToPathMap(_0x58322d);if(_0x542ebf){const _0x662f9d=_0x6ff93d[_0x202a22(0x11a)](_0x353ea6=>_0x353ea6[_0x202a22(0x17d)][_0x202a22(0x117)]()===_0x542ebf['toLowerCase']());if(_0x662f9d[_0x202a22(0x12a)]===0x0)return console['error'](_0x202a22(0x118)+_0x542ebf),console['error'](_0x202a22(0x1de)),0x1;_0x6ff93d=_0x662f9d;}if(_0x239464!==undefined){const _0xfd0be6=_0x6ff93d[_0x202a22(0x11a)](_0x5576c3=>{const _0x35a68e=_0x202a22,_0x439617=_0x5576c3['folderId']?_0x4f85e7[_0x35a68e(0x173)](_0x5576c3['folderId'])||'':'';return _0x439617===_0x239464;});if(_0xfd0be6[_0x202a22(0x12a)]===0x0&&_0x6ff93d['length']>0x0){console['error'](_0x202a22(0x14e)+_0x542ebf+_0x202a22(0x195)+(_0x239464||_0x202a22(0x129))),console[_0x202a22(0x14b)](_0x202a22(0x202));for(const _0x114d9e of _0x6ff93d){const _0x36751b=_0x114d9e[_0x202a22(0x179)]?_0x4f85e7['get'](_0x114d9e[_0x202a22(0x179)])||'':'';console[_0x202a22(0x14b)](_0x202a22(0x12f)+(_0x36751b||_0x202a22(0x137))+'/'+_0x114d9e[_0x202a22(0x17d)]);}return 0x1;}_0x6ff93d=_0xfd0be6;}if(_0x6ff93d[_0x202a22(0x12a)]===0x0)return console['error'](_0x202a22(0x18a)),0x0;const _0x1b588e=new Map();for(const _0x2f090d of _0x6ff93d){const _0x304d98=_0x2f090d['journeyBundleId'];!_0x1b588e[_0x202a22(0x1cd)](_0x304d98)&&_0x1b588e['set'](_0x304d98,[]),_0x1b588e[_0x202a22(0x173)](_0x304d98)[_0x202a22(0x1c5)](_0x2f090d);}for(const _0x3adc2b of _0x1b588e[_0x202a22(0x159)]()){_0x3adc2b['sort']((_0x3fae87,_0x528c39)=>(_0x3fae87[_0x202a22(0x1da)]||0x0)-(_0x528c39[_0x202a22(0x1da)]||0x0));}const _0x4fe3a7=[],{idToEmailMap:_0x222b45,connectionIdToNameMap:_0x14267b}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x1eb7a4=_0x202a22,[_0x3794ae,_0x3df635]=await Promise['all']([_0x493a32[_0x1eb7a4(0x124)][_0x1eb7a4(0x16c)](),_0x493a32['connection'][_0x1eb7a4(0x185)]()]);return{'idToEmailMap':_0x3794ae,'connectionIdToNameMap':_0x3df635};},{'verbose':_0x44d3f9[_0x202a22(0x1e3)]})['then'](_0x2d8020=>_0x2d8020[_0x202a22(0x119)]);for(const _0x4617bc of _0x1b588e[_0x202a22(0x159)]()){const _0x5ce9bb=_0x4617bc[0x0][_0x202a22(0x17d)],_0x346a5a=_0x4617bc[0x0][_0x202a22(0x179)],_0x1a48b1=_0x346a5a?_0x4f85e7[_0x202a22(0x173)](_0x346a5a)||'':'',_0x3694f8=_0x1a48b1?a27_0x745048[_0x202a22(0x134)](_0x58ee80,_0x1a48b1):_0x58ee80,_0x52fc24=_0x215eaa||a27_0x745048[_0x202a22(0x134)](_0x3694f8,sanitizeFileName(_0x5ce9bb)+_0x202a22(0x12e));let _0x35f346,_0x3caeec;if(existsSync(_0x52fc24))try{const _0x224651=readFileSync(_0x52fc24,_0x202a22(0x15a)),_0x1a2b38=parseYamlString(_0x224651);_0x3caeec=_0x1a2b38,_0x35f346=buildRuleToNameMapping(_0x1a2b38),_0x5388fd[_0x202a22(0x1e3)]&&_0x35f346[_0x202a22(0x191)]>0x0&&console[_0x202a22(0x14b)](_0x202a22(0x183)+_0x35f346[_0x202a22(0x191)]+_0x202a22(0x1b3)+_0x5ce9bb);}catch(_0x568b10){_0x5388fd[_0x202a22(0x1e3)]&&console[_0x202a22(0x14b)](_0x202a22(0x18b)+_0x568b10['message']);}const _0x2ec686=[],_0x5ec7dd=new Set(),_0x28ef57=new Map(),_0x9ed35f=new Map(),_0x32678d=new Set(),_0x2f0a3a=new Map(),_0x309a3c=new Map(),_0x21e78a=createJumpTargetCache();await withProgressSpinner(_0x202a22(0x1ef)+_0x5ce9bb+'...',async _0x100eac=>{const _0x477e1e=_0x202a22;for(const _0x368817 of _0x4617bc){const _0x182465=_0x4617bc[_0x477e1e(0x12a)]>0x1?_0x368817[_0x477e1e(0x17d)]+'\x20v'+(_0x368817[_0x477e1e(0x1da)]||0x1):_0x368817['journeyBundleName'];_0x100eac['setPhase']('Fetching\x20'+_0x182465);const _0x39b67b=await _0x493a32[_0x477e1e(0x15c)][_0x477e1e(0x16b)](_0x368817['id']),_0x1d6954=_0x39b67b[_0x477e1e(0x1c6)]?.['audienceId'],_0x53942={'resolveSegment':async _0x27758c=>{const _0x2b4136=_0x477e1e;if(!_0x1d6954)return{'name':_0x27758c,'isJourneyLocal':![]};const _0x5785bf=_0x28ef57[_0x2b4136(0x173)](_0x27758c);if(_0x5785bf)return _0x5785bf;try{const _0xa13c2b=await _0x493a32['segment'][_0x2b4136(0x100)](_0x1d6954,_0x27758c),_0x2495c1=_0xa13c2b[_0x2b4136(0x160)]===SEGMENT_KIND_JOURNEY;let _0x5ceeb9,_0x7a208f=_0xa13c2b['name'];if(_0x2495c1&&_0xa13c2b[_0x2b4136(0x1a9)]){const _0x748c84=await segmentResponseToDef(_0xa13c2b,{'resolveSegmentName':async _0x1b6030=>{const _0x2e0b7f=_0x2b4136,_0x4a6398=_0x28ef57['get'](_0x1b6030);if(_0x4a6398)return _0x4a6398['name'];const _0x34b275=await _0x53942[_0x2e0b7f(0x156)](_0x1b6030);return _0x34b275[_0x2e0b7f(0xfb)];}}),_0x51abfe=_0x748c84[_0x2b4136(0x1a9)];_0x5ceeb9={'description':_0xa13c2b[_0x2b4136(0x187)],'rule':_0x51abfe};const _0x14f686=serializeRule(_0x51abfe),_0x403e27=_0x9ed35f['get'](_0x14f686);if(_0x403e27)_0x7a208f=_0x403e27,_0x5ceeb9=undefined,_0x5388fd['verbose']&&console[_0x2b4136(0x14b)](_0x2b4136(0x208)+_0xa13c2b['name']+'\x20->\x20'+_0x403e27);else{let _0x2d0ae7=![];if(_0x35f346){const _0x341905=_0x35f346[_0x2b4136(0x173)](_0x14f686);if(_0x341905){const _0xe2544a=_0x341905[_0x2b4136(0x163)](_0x41d7e2=>!_0x5ec7dd[_0x2b4136(0x1cd)](_0x41d7e2));_0xe2544a&&(_0x7a208f=_0xe2544a,_0x5ec7dd[_0x2b4136(0x128)](_0xe2544a),_0x9ed35f[_0x2b4136(0x175)](_0x14f686,_0xe2544a),_0x2d0ae7=!![],_0x5388fd[_0x2b4136(0x1e3)]&&console['error'](_0x2b4136(0x142)+_0xe2544a+_0x2b4136(0x121)));}}if(!_0x2d0ae7){const _0x18a73e=generateJourneyLocalName(_0xa13c2b[_0x2b4136(0xfb)]);_0x18a73e&&(_0x7a208f=_0x18a73e);let _0x8f02a5=_0x7a208f,_0x49d1bb=0x2;while(_0x5ec7dd[_0x2b4136(0x1cd)](_0x8f02a5)){_0x8f02a5=_0x7a208f+'_'+_0x49d1bb,_0x49d1bb++;}_0x5ec7dd[_0x2b4136(0x128)](_0x8f02a5),_0x9ed35f['set'](_0x14f686,_0x8f02a5),_0x7a208f=_0x8f02a5;}}}const _0x3c5ef8={'name':_0x7a208f,'isJourneyLocal':_0x2495c1,'definition':_0x5ceeb9};return _0x28ef57[_0x2b4136(0x175)](_0x27758c,_0x3c5ef8),_0x3c5ef8;}catch(_0x184f10){return _0x44d3f9['verbose']&&console[_0x2b4136(0x14b)](_0x2b4136(0x15d)+_0x27758c+':\x20'+_0x184f10[_0x2b4136(0x1a6)]),{'name':_0x27758c,'isJourneyLocal':![]};}},'resolveActivation':async _0x268bb3=>{const _0x3eb2f4=_0x477e1e,_0xef0042=_0x2f0a3a[_0x3eb2f4(0x173)](_0x268bb3);if(_0xef0042)return _0xef0042;try{const _0x319133=await _0x493a32[_0x3eb2f4(0x15c)][_0x3eb2f4(0x1f3)](_0x368817['id'],_0x268bb3),_0x1c5dd3=journeyActivationStepToYaml(_0x319133,_0x222b45,_0x14267b),_0x103c45=JSON[_0x3eb2f4(0x151)]({'name':_0x1c5dd3['name'],'connection':_0x1c5dd3[_0x3eb2f4(0x11c)],'connector_config':_0x1c5dd3[_0x3eb2f4(0x126)]}),_0xfa73c3=_0x309a3c[_0x3eb2f4(0x173)](_0x103c45);if(_0xfa73c3){const _0x1e2db2={'name':_0xfa73c3,'isJourneyLocal':!![],'definition':_0x1c5dd3};return _0x2f0a3a['set'](_0x268bb3,_0x1e2db2),_0x1e2db2;}const _0x24b252=_0x319133[_0x3eb2f4(0x1c6)]['activationParams']['name']||_0x268bb3,_0x1426af=sanitizeYamlKey(_0x24b252)||'activation_'+_0x268bb3;let _0x2c58bd=_0x1426af,_0x568fd6=0x2;while(_0x32678d[_0x3eb2f4(0x1cd)](_0x2c58bd)){_0x2c58bd=_0x1426af+'_'+_0x568fd6,_0x568fd6++;}_0x32678d['add'](_0x2c58bd),_0x309a3c[_0x3eb2f4(0x175)](_0x103c45,_0x2c58bd);const _0x33b93e={'name':_0x2c58bd,'isJourneyLocal':!![],'definition':_0x1c5dd3};return _0x2f0a3a[_0x3eb2f4(0x175)](_0x268bb3,_0x33b93e),_0x33b93e;}catch(_0x5c5c97){return _0x44d3f9['verbose']&&console[_0x3eb2f4(0x14b)](_0x3eb2f4(0x1f7)+_0x268bb3+':\x20'+_0x5c5c97[_0x3eb2f4(0x1a6)]),{'name':_0x268bb3,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x58d386,_0x3ddfcd)=>{const _0x4b3b7d=_0x477e1e;return resolveJumpTarget(_0x58d386,_0x3ddfcd,_0x21e78a,_0x344ed1=>_0x493a32[_0x4b3b7d(0x15c)][_0x4b3b7d(0x16b)](_0x344ed1));}},_0x455806=await journeyResponseToDef(_0x39b67b,_0x53942);_0x2ec686['push']({'item':_0x368817,'yaml':_0x455806});}},{'verbose':_0x44d3f9[_0x202a22(0x1e3)]});const _0x505a63=await _0x493a32[_0x202a22(0x15c)][_0x202a22(0x113)](_0x4617bc[0x0][_0x202a22(0x204)]),_0x312380=buildMergedJourneyDef(_0x2ec686,_0x35f346,_0x505a63),_0x32dd16=normalizeJourneyDef(_0x312380,_0x3caeec),_0x51a7de=toYamlString(_0x32dd16),_0x17e8b5=_0x215eaa||a27_0x745048[_0x202a22(0x134)](_0x3694f8,sanitizeFileName(_0x5ce9bb)+_0x202a22(0x12e));!_0x215eaa&&_0x1a48b1&&!existsSync(_0x3694f8)&&mkdirSync(_0x3694f8,{'recursive':!![]});const _0x5ec409=a27_0x745048[_0x202a22(0x14a)](process[_0x202a22(0x16f)](),_0x17e8b5);if(existsSync(_0x17e8b5)){const _0x4bf217=readFileSync(_0x17e8b5,'utf-8'),_0x141ef0=generateDiff(_0x4bf217,_0x51a7de),_0x18e41e=hasChanges(_0x141ef0);_0x4fe3a7[_0x202a22(0x1c5)]({'relativePath':_0x5ec409,'absolutePath':_0x17e8b5,'content':_0x51a7de,'isNew':![],'hasChanges':_0x18e41e,'diff':_0x18e41e?formatDiffWithColors(_0x141ef0):undefined});}else _0x4fe3a7[_0x202a22(0x1c5)]({'relativePath':_0x5ec409,'absolutePath':_0x17e8b5,'content':_0x51a7de,'isNew':!![],'hasChanges':![]});}const _0x582f9f=_0x4fe3a7[_0x202a22(0x11a)](_0x26d7d2=>_0x26d7d2['isNew']),_0x21dc21=_0x4fe3a7[_0x202a22(0x11a)](_0x2cd640=>!_0x2cd640[_0x202a22(0x10f)]&&_0x2cd640[_0x202a22(0x169)]),_0x4d3b43=_0x4fe3a7[_0x202a22(0x11a)](_0x59e8aa=>!_0x59e8aa[_0x202a22(0x10f)]&&!_0x59e8aa[_0x202a22(0x169)]),_0x318b27=_0x6ff93d[_0x202a22(0x12a)],_0x4e31c3=_0x1b588e[_0x202a22(0x191)],_0x1a92f8=_0x318b27>_0x4e31c3?'\x20('+_0x318b27+_0x202a22(0x1c0):'';console[_0x202a22(0x14b)]('\x0aPull\x20summary:'),console[_0x202a22(0x14b)]('\x20\x20'+a27_0x36bf62[_0x202a22(0x1c7)](_0x4e31c3+_0x202a22(0x1e9))+a27_0x36bf62[_0x202a22(0x10c)](_0x1a92f8)),console[_0x202a22(0x14b)]('\x20\x20'+a27_0x36bf62[_0x202a22(0x1f5)]('+\x20'+_0x582f9f['length']+'\x20new\x20files')),console[_0x202a22(0x14b)]('\x20\x20'+a27_0x36bf62[_0x202a22(0x18c)]('~\x20'+_0x21dc21[_0x202a22(0x12a)]+'\x20changed\x20files')),console[_0x202a22(0x14b)]('\x20\x20'+a27_0x36bf62['dim']('=\x20'+_0x4d3b43[_0x202a22(0x12a)]+'\x20unchanged\x20files')),console[_0x202a22(0x14b)](_0x202a22(0x107)+a27_0x36bf62[_0x202a22(0x1c7)](_0x58ee80)+'\x0a');if(_0x21dc21['length']>0x0)for(const _0x11ece4 of _0x21dc21){console[_0x202a22(0x14b)](_0x202a22(0x1ea)+_0x11ece4[_0x202a22(0x1df)]+'\x27:'),console[_0x202a22(0x14b)]('─'[_0x202a22(0x1d9)](0x3c)),console['error'](_0x11ece4['diff']),console[_0x202a22(0x14b)]('─'[_0x202a22(0x1d9)](0x3c));}if(_0x5388fd[_0x202a22(0x10e)])return console[_0x202a22(0x14b)](a27_0x36bf62['yellow'](_0x202a22(0x11e))),0x0;if(_0x582f9f['length']===0x0&&_0x21dc21['length']===0x0)return console[_0x202a22(0x14b)](a27_0x36bf62['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x54d989},_0x5388fd[_0x202a22(0x158)]),console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1f5)]('✔\x20Context\x20set:\x20'+a27_0x36bf62[_0x202a22(0x10c)](_0x202a22(0x112))+_0x202a22(0x1b5)+a27_0x36bf62[_0x202a22(0x1c7)](_0x54d989))),0x0;if(!_0x5388fd[_0x202a22(0x157)]&&(_0x582f9f[_0x202a22(0x12a)]>0x0||_0x21dc21[_0x202a22(0x12a)]>0x0)){if(!isInteractive())return console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1dd)](_0x202a22(0x16e)),_0x202a22(0x115)),console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x10c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x13d86e=await confirmKey(_0x202a22(0x19f)+(_0x582f9f[_0x202a22(0x12a)]+_0x21dc21[_0x202a22(0x12a)])+'\x20files?');if(!_0x13d86e)return console['error'](a27_0x36bf62[_0x202a22(0x18c)]('Aborted.'),_0x202a22(0x105)),0x1;}!existsSync(_0x58ee80)&&mkdirSync(_0x58ee80,{'recursive':!![]});const _0x15a2b9=a27_0x745048[_0x202a22(0x134)](_0x58ee80,_0x202a22(0x1c8));writeFileSync(_0x15a2b9,createTdxConfigContent(_0x54d989),_0x202a22(0x15a));for(const _0x5b67aa of _0x4fe3a7){(_0x5b67aa[_0x202a22(0x10f)]||_0x5b67aa[_0x202a22(0x169)])&&writeFileSync(_0x5b67aa[_0x202a22(0x10a)],_0x5b67aa[_0x202a22(0x1b6)],_0x202a22(0x15a));}return console['error'](a27_0x36bf62[_0x202a22(0x1f5)](_0x202a22(0x1b2)+(_0x582f9f[_0x202a22(0x12a)]+_0x21dc21['length'])+'\x20journey\x20files\x20to\x20'+_0x58ee80)),saveSessionContext({'parent_segment':_0x54d989},_0x5388fd[_0x202a22(0x158)]),console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1f5)](_0x202a22(0x123)+a27_0x36bf62['dim']('parent_segment')+_0x202a22(0x1b5)+a27_0x36bf62[_0x202a22(0x1c7)](_0x54d989))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x3d26ae(0x1a7);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x14d);async[a27_0x3d26ae(0x102)](_0x2d93ca){const _0x5b0790=a27_0x3d26ae,{options:_0x4837bd,args:_0x50582f,tdx:_0x3dcd2c}=_0x2d93ca,_0x3e02fa=_0x50582f[0x0];if(!requireNameOrPath(_0x3e02fa))return 0x1;_0x4837bd[_0x5b0790(0x1e3)]&&console[_0x5b0790(0x14b)](_0x5b0790(0x181)+_0x3e02fa);const {journeyId:_0x5dfa38}=await resolveJourneyIdFromInput(_0x3e02fa,_0x4837bd,_0x3dcd2c),_0x48bdd1=await withSpinner(_0x5b0790(0x13f),()=>_0x3dcd2c[_0x5b0790(0x15c)][_0x5b0790(0x138)](_0x5dfa38),{'verbose':_0x4837bd[_0x5b0790(0x1e3)]}),_0x4e4911=_0x48bdd1[_0x5b0790(0x119)];return console[_0x5b0790(0x130)](_0x5b0790(0x149)+_0x4e4911[_0x5b0790(0x1b4)]),console[_0x5b0790(0x130)]('Table:\x20'+_0x4e4911[_0x5b0790(0x127)]),await handleSDKOutput(_0x4e4911[_0x5b0790(0xfc)],_0x4837bd),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x1c1);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x1ed);async[a27_0x3d26ae(0x102)](_0x567c98){const _0x438b00=a27_0x3d26ae,{options:_0x3ab812,args:_0x2469b2,tdx:_0x243abf}=_0x567c98,_0x3ebec2=_0x2469b2[0x0];if(!requireNameOrPath(_0x3ebec2))return 0x1;_0x3ab812[_0x438b00(0x1e3)]&&console[_0x438b00(0x14b)]('Input:\x20'+_0x3ebec2);const {journeyId:_0x360b0f}=await resolveJourneyIdFromInput(_0x3ebec2,_0x3ab812,_0x243abf),_0x5abd7c=await withSpinner(_0x438b00(0x1f8),()=>_0x243abf[_0x438b00(0x15c)][_0x438b00(0x1ae)](_0x360b0f),{'verbose':_0x3ab812['verbose']}),_0xfcd1ce=_0x5abd7c[_0x438b00(0x119)];return console[_0x438b00(0x14b)]('Found\x20'+_0xfcd1ce[_0x438b00(0x12a)]+_0x438b00(0x10b)+(_0xfcd1ce[_0x438b00(0x12a)]!==0x1?'s':'')),await handleSDKOutput(_0xfcd1ce,_0x3ab812),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x3d26ae(0x1ad);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x1ca);[a27_0x3d26ae(0x1d7)]=new SegmentPushCommand();async[a27_0x3d26ae(0x102)](_0x3b087f){const _0x5d080d=a27_0x3d26ae,_0x5af19d=_0x3b087f[_0x5d080d(0x147)][0x0];let _0x1419e9;if(_0x5af19d){const _0x1c1bbb=await resolveTarget({'arg':_0x5af19d,'contextParent':_0x3b087f[_0x5d080d(0x1b9)]['parentSegment'],'cwd':process[_0x5d080d(0x16f)]()});isSuccessfulResolution(_0x1c1bbb)&&_0x1c1bbb[_0x5d080d(0x101)]===_0x5d080d(0x14f)&&(_0x1419e9=_0x1c1bbb['filePath']);}const _0x2f31a2={..._0x3b087f,'options':{..._0x3b087f[_0x5d080d(0x1b9)],'journeysOnly':!![],..._0x1419e9&&{'singleFilePath':_0x1419e9}}};return this[_0x5d080d(0x1d7)][_0x5d080d(0x102)](_0x2f31a2);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x1e0);[a27_0x3d26ae(0x187)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x3d26ae(0x102)](_0x1372e8){const _0x272940=a27_0x3d26ae,{options:_0x49fe25,args:_0x10c2c2,tdx:_0xabeb00}=_0x1372e8,_0xc8f7a3=_0x10c2c2[0x0];if(!requireNameOrPath(_0xc8f7a3))return 0x1;if(_0x49fe25['verbose'])console[_0x272940(0x14b)](_0x272940(0x181)+_0xc8f7a3);const {journeyId:_0x54f819}=await resolveJourneyIdFromInput(_0xc8f7a3,_0x49fe25,_0xabeb00),_0x457a7b=await withSpinner('Listing\x20journey\x20versions...',()=>_0xabeb00[_0x272940(0x15c)][_0x272940(0x12c)](_0x54f819),{'verbose':_0x49fe25[_0x272940(0x1e3)]}),{bundleName:_0x58f1af,versions:_0x15f742,latestJourneyId:_0x590a2f}=_0x457a7b['data'];console[_0x272940(0x14b)](_0x58f1af+':\x20'+_0x15f742[_0x272940(0x12a)]+_0x272940(0x1be)+(_0x15f742[_0x272940(0x12a)]!==0x1?'s':''));const _0x1918d7=_0x15f742[_0x272940(0x150)](_0xe1f991=>({'version':_0xe1f991[_0x272940(0x1da)],'journey_id':_0xe1f991['journeyId'],'name':_0xe1f991['name'],'state':_0xe1f991[_0x272940(0x1f0)],'paused':_0xe1f991['paused'],'latest':_0xe1f991[_0x272940(0x1c4)]===_0x590a2f,'created_at':_0xe1f991[_0x272940(0x167)]}));return await handleSDKOutput(_0x1918d7,_0x49fe25),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0x3d26ae(0x16a);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x132);async[a27_0x3d26ae(0x102)](_0x3af4fc){const _0x33ecd1=a27_0x3d26ae,{options:_0xb071d0,args:_0x42d78d,tdx:_0x13c57c}=_0x3af4fc,_0x44057e=_0x42d78d[0x0];if(!requireNameOrPath(_0x44057e))return 0x1;if(_0xb071d0[_0x33ecd1(0x1e3)])console[_0x33ecd1(0x14b)](_0x33ecd1(0x181)+_0x44057e);const {journeyId:_0x1bc1b5,journeyName:_0x11c946}=await resolveJourneyIdFromInput(_0x44057e,_0xb071d0,_0x13c57c);if(!_0xb071d0[_0x33ecd1(0x157)]){const _0x27af06=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x11c946+'\x22?');if(!_0x27af06)return console[_0x33ecd1(0x14b)](_0x33ecd1(0x141)),0x0;}const _0x597021=await withSpinner(_0x33ecd1(0x182),()=>_0x13c57c[_0x33ecd1(0x15c)][_0x33ecd1(0x1fe)](_0x1bc1b5),{'verbose':_0xb071d0[_0x33ecd1(0x1e3)]}),_0x30ddf9=_0x597021['data'];return console[_0x33ecd1(0x14b)](a27_0x36bf62[_0x33ecd1(0x1f5)]('✔')+_0x33ecd1(0x1c2)+_0x30ddf9['attributes'][_0x33ecd1(0x1da)]+_0x33ecd1(0x11d)+_0x30ddf9[_0x33ecd1(0x1c6)][_0x33ecd1(0xfb)]+'\x22'),console[_0x33ecd1(0x14b)]('\x20\x20Journey\x20ID:\x20'+_0x30ddf9['id']),await handleSingleObjectOutput({'id':_0x30ddf9['id'],'name':_0x30ddf9[_0x33ecd1(0x1c6)][_0x33ecd1(0xfb)],'version':_0x30ddf9['attributes'][_0x33ecd1(0x1da)],'state':_0x30ddf9[_0x33ecd1(0x1c6)][_0x33ecd1(0x1f0)],'bundle_id':_0x30ddf9['attributes']['journeyBundleId'],'created_at':_0x30ddf9[_0x33ecd1(0x1c6)][_0x33ecd1(0x167)]},_0xb071d0),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x194);['description']=a27_0x3d26ae(0x133);async[a27_0x3d26ae(0x102)](_0x469b24){const _0x5f0894=a27_0x3d26ae,{options:_0x563b67,args:_0x16954b,tdx:_0xd02701}=_0x469b24,_0x213827=_0x16954b[0x0];if(!requireNameOrPath(_0x213827))return 0x1;const _0x4182e7=_0x563b67[_0x5f0894(0x174)];if(!_0x4182e7)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x5f0894(0x14b)](_0x5f0894(0x177)),0x1;const _0x129636=parseInt(_0x4182e7,0xa);if(isNaN(_0x129636)||_0x129636<0x1)return console[_0x5f0894(0x14b)](_0x5f0894(0x200)+_0x4182e7),0x1;if(_0x563b67['verbose'])console[_0x5f0894(0x14b)]('Input:\x20'+_0x213827+_0x5f0894(0x1f4)+_0x129636);const {journeyId:_0x238217,parentSegmentId:_0x4d5fd8}=await resolveJourneyIdFromInput(_0x213827,_0x563b67,_0xd02701),_0x6a14ee=await withSpinner('Resolving\x20version...',()=>_0xd02701[_0x5f0894(0x15c)][_0x5f0894(0x12c)](_0x238217),{'verbose':_0x563b67[_0x5f0894(0x1e3)]}),{versions:_0x37faa3,latestJourneyId:_0x5a0ad4}=_0x6a14ee['data'],_0x1a2c0a=_0x37faa3[_0x5f0894(0x163)](_0x5c366f=>_0x5c366f[_0x5f0894(0x1da)]===_0x129636);if(!_0x1a2c0a){const _0x2646eb=_0x37faa3[_0x5f0894(0x150)](_0x10b49b=>'v'+_0x10b49b['versionNumber'])[_0x5f0894(0x134)](',\x20');return console[_0x5f0894(0x14b)](_0x5f0894(0x180)+_0x129636+_0x5f0894(0x1cb)+_0x2646eb),0x1;}const _0x454b1a=await withSpinner('Getting\x20version\x20'+_0x129636+_0x5f0894(0x1e8),()=>_0xd02701[_0x5f0894(0x15c)][_0x5f0894(0x16b)](_0x1a2c0a[_0x5f0894(0x1c4)]),{'verbose':_0x563b67[_0x5f0894(0x1e3)]}),_0xdfc86=_0x454b1a[_0x5f0894(0x119)],_0x1b974d=getConsoleNextUrl(_0x563b67['site'],_0x5f0894(0x172)+_0x4d5fd8+'/e/'+_0x1a2c0a[_0x5f0894(0x1c4)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0xdfc86['id'],'name':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0xfb)],'version':_0xdfc86['attributes'][_0x5f0894(0x1da)],'description':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x187)],'state':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x1f0)],'paused':_0xdfc86[_0x5f0894(0x1c6)]['paused'],'reentry_mode':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x1ab)],'stages':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x15f)]?.[_0x5f0894(0x12a)]||0x0,..._0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x201)]&&{'goal':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x201)]['name']},'latest':_0x1a2c0a[_0x5f0894(0x1c4)]===_0x5a0ad4,'created_at':_0xdfc86[_0x5f0894(0x1c6)]['createdAt'],'updated_at':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x1f1)],'url':_0x1b974d},_0x563b67),0x0;}}
|
|
1
|
+
const a27_0x354a54=a27_0x47c0;(function(_0x2b4a99,_0x32ca84){const _0x5273de=a27_0x47c0,_0x153d4f=_0x2b4a99();while(!![]){try{const _0x27031f=parseInt(_0x5273de(0x1c0))/0x1+parseInt(_0x5273de(0x146))/0x2*(parseInt(_0x5273de(0x1f6))/0x3)+-parseInt(_0x5273de(0x10a))/0x4*(-parseInt(_0x5273de(0x17a))/0x5)+-parseInt(_0x5273de(0x1ee))/0x6*(-parseInt(_0x5273de(0x1aa))/0x7)+-parseInt(_0x5273de(0x12b))/0x8+parseInt(_0x5273de(0x1b1))/0x9*(parseInt(_0x5273de(0x1e7))/0xa)+-parseInt(_0x5273de(0x1a9))/0xb*(-parseInt(_0x5273de(0x1cf))/0xc);if(_0x27031f===_0x32ca84)break;else _0x153d4f['push'](_0x153d4f['shift']());}catch(_0x4babe8){_0x153d4f['push'](_0x153d4f['shift']());}}}(a27_0x4c19,0xdcd5b));import a27_0x5dfa1a from'chalk';import a27_0x40bb69 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x4fba64){const _0x381b7d=a27_0x47c0;return!_0x4fba64&&(console[_0x381b7d(0x115)](_0x381b7d(0x1dc)),console[_0x381b7d(0x115)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x4fba64;}function a27_0x4c19(){const _0x825f25=['Aborted.','createVersion','createdAt','Listing\x20journeys...','links','770512MGVNBc','Resume\x20a\x20paused\x20journey','folders','tsv','localeCompare','message','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journey','resolveParentId','✔\x20Pulled\x20','versionNumber','join','limit','journey:stats','session','📁\x20','journey:versions','segments','Pattern:\x20','split','Fetching\x20','List\x20journeys\x20in\x20current\x20context','parent_segment','jsonl','draft','resolveJourneyId','exitOrJumpRate','all','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','journeys','user','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','size','journey:pull','journey:pause','stageNameMap','Pausing\x20journey...','activation','\x20\x20Name:\x20','content','/e/','journey:version:create','stage','getTrafficData','errorCode','\x20files?','listVersions','journeyBundleName','options','\x20\x20Folder\x20path:\x20','from','yellow','5715feMbnG','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','kind','\x20\x20Target:\x20','attributes','map','filePath','completeMilestoneRate','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journey:version:view','Error:\x20Invalid\x20--type\x20\x22','toLowerCase','Error:\x20Journey\x20not\x20found:\x20','has','\x5c$&','parentSegment','archived','absolutePath','Error:\x20Version\x20','base','\x20changed\x20files','Getting\x20journey\x20traffic\x20data...','completionRate','(draft)','rootFolderId','file','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20-\x20','find','Fetching\x20journeys\x20and\x20folders...','folderPath','Error:\x20Invalid\x20version\x20number:\x20','Error:\x20Journey\x20\x27','Error:\x20Parent\x20segment\x20context\x20required','\x20journeys','List\x20all\x20versions\x20of\x20a\x20journey','reentryMode','dim','state','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','no_parent','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x22\x20not\x20found','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20=\x20','journey:push','2514523ZhRrCW','75593ueaMbJ','Getting\x20version\x20','Show\x20journey\x20statistics','set','\x20versions)','getStatistics','nodes','9YjCzRh','✔\x20Journey\x20\x22','No\x20statistics\x20available\x20for\x20journey:\x20','✔\x20Found\x20','Creating\x20new\x20version...','\x22\x20resumed','Error:\x20--version\x20option\x20is\x20required','getSegment','activationParams','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','List\x20activations\x20for\x20a\x20journey','conversion','(archived)','Getting\x20journey\x20statistics...','description','262042EUljDx','audienceId','isNew','data','Export\x20journey(s)\x20as\x20YAML\x20files','journey:columns','INVALID_ARGUMENT','get','folderId','cwd','Pause\x20a\x20running\x20journey','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Fetching\x20users\x20and\x20connections...','json','segmentPushCommand','12josBJO','Resuming\x20journey...','relativePath','helpText','resourceName','journey:resume','\x20journey','sort','Getting\x20journey\x20details...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','...','milestoneSize','\x20->\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','/app/ps/','journeyStages','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x0aChanges\x20to\x20\x27','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','args','/j/da/je','goal','buildIdToEmailMap','3751830dEBXUV','\x20version','exitOrJumpSize','pause','Target\x20file:\x20','Resolving\x20parent\x20segment...','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','348JEmqmx','then','stringify','site','resume','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey:list','Resolved\x20YAML\x20file:\x20','3uHCtVJ','segment','hasPeriod','Database:\x20','listJourneysWithFolders','format','listJourneysFromParentSegment','getParentFull','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','connection','\x22\x20paused','\x20journey\x20files\x20to\x20','segmentName','columns','Parent\x20segment:\x20','parentName','getLatestJourneyId','utf-8','activation_','\x20\x20Parent\x20segment:\x20','🗺️\x20','cyan','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','getJourney','getColumnMapping','includeHistory','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','\x20unchanged\x20files','log','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20new\x20files','Resolving\x20journey...','targetDir','enteredSize','filter','relative','journeyId','journeyName','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','tdx.json','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Journey\x20ID:\x20','table','Target\x20directory:\x20','add','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','2572fslBRO','journeyBundleId','connector_config','.yml','\x20\x20Statistics\x20not\x20available','values','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','buildIdToNameMap','\x20activation','Input:\x20','renderStats','error','\x20Created\x20v','database','launched','(paused)','(root)','\x0aError:','blue','root\x20folder','history','push','red','repeat','Found\x20','Journey\x20name:\x20','completed','verbose','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser',',\x20version:\x20','\x20Opening\x20','dryRun','type','13662608oXxHfg','✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Context\x20set:\x20','listActivationsFlat','name','listFolders','paused','stages','\x20\x20Consolidating\x20duplicate\x20segment:\x20','rule','Error:\x20','hasChanges','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','execute','yes','/j/da','test','\x20details...','length','setPhase','Cancelled','(completed)'];a27_0x4c19=function(){return _0x825f25;};return a27_0x4c19();}function withJsonFormat(_0x59e82c){const _0x40a665=a27_0x47c0;if(!_0x59e82c[_0x40a665(0x1fb)]&&!_0x59e82c[_0x40a665(0x1cd)]&&!_0x59e82c[_0x40a665(0x15d)]&&!_0x59e82c[_0x40a665(0x149)])return{..._0x59e82c,'format':_0x40a665(0x1cd),'json':!![]};return _0x59e82c;}function formatJourneyState(_0x32db29){const _0x3cc87e=a27_0x47c0;switch(_0x32db29){case _0x3cc87e(0x118):return a27_0x5dfa1a[_0x3cc87e(0x1a3)]('(running)');case _0x3cc87e(0x15e):return a27_0x5dfa1a[_0x3cc87e(0x19f)](_0x3cc87e(0x191));case'paused':return a27_0x5dfa1a[_0x3cc87e(0x179)](_0x3cc87e(0x119));case _0x3cc87e(0x124):return a27_0x5dfa1a[_0x3cc87e(0x11c)](_0x3cc87e(0x140));case _0x3cc87e(0x18a):return a27_0x5dfa1a[_0x3cc87e(0x19f)](_0x3cc87e(0x1bd));default:return'('+_0x32db29+')';}}function formatJourneyItem(_0x4c2f93,_0x14719d='',_0x564056){const _0x3412f2=a27_0x47c0,_0x314a04=formatJourneyState(_0x4c2f93[_0x3412f2(0x1a0)]),_0x14ae60=_0x564056?hyperlink(_0x4c2f93['journeyBundleName'],_0x564056):_0x4c2f93[_0x3412f2(0x175)];return _0x14719d+_0x3412f2(0x20a)+_0x14ae60+'\x20'+_0x314a04;}function escapeRegex(_0xb66043){const _0x533173=a27_0x47c0;return _0xb66043['replace'](/[.*+?^${}()|[\]\\]/g,_0x533173(0x188));}function globToRegex(_0x4f5632){const _0x3f0801=a27_0x47c0,_0x22b4ab=_0x4f5632[_0x3f0801(0x159)]('*')[_0x3f0801(0x17f)](escapeRegex);return new RegExp(_0x22b4ab[_0x3f0801(0x151)]('.*'),'i');}function buildRuleToNameMapping(_0x4f1b04){const _0x1e9a7b=a27_0x47c0,_0x219d29=new Map();if(_0x4f1b04[_0x1e9a7b(0x157)])for(const [_0x31c736,_0x541199]of Object['entries'](_0x4f1b04[_0x1e9a7b(0x157)])){if(_0x541199[_0x1e9a7b(0x134)]){const _0x17e8cd=serializeRule(_0x541199[_0x1e9a7b(0x134)]),_0x5c7875=_0x219d29[_0x1e9a7b(0x1c7)](_0x17e8cd);_0x5c7875?_0x5c7875['push'](_0x31c736):_0x219d29[_0x1e9a7b(0x1ad)](_0x17e8cd,[_0x31c736]);}}return _0x219d29;}async function resolveJourneyIdFromInput(_0x14852c,_0x2b0aec,_0x28b3c5){const _0x61795d=a27_0x47c0,_0x1adb83=await resolveJourneyTarget(_0x14852c,_0x2b0aec[_0x61795d(0x189)],_0x2b0aec[_0x61795d(0x125)]),_0x275d78=_0x1adb83['parentSegment'];if(!_0x275d78)throw new SDKError(ErrorCode[_0x61795d(0x1c6)],_0x61795d(0x104));const _0x2ffe37=await withSpinner(_0x61795d(0x1ec),()=>_0x28b3c5[_0x61795d(0x1f7)]['resolveParentId'](_0x275d78),{'verbose':_0x2b0aec[_0x61795d(0x125)]}),_0x111c2c=_0x2ffe37[_0x61795d(0x1c3)],_0xdf67c4=await withSpinner(_0x61795d(0xfb),()=>_0x28b3c5[_0x61795d(0x14d)][_0x61795d(0x15f)](_0x111c2c,_0x1adb83[_0x61795d(0x101)]),{'verbose':_0x2b0aec['verbose']});return{'journeyId':_0xdf67c4[_0x61795d(0x1c3)],'journeyName':_0x1adb83[_0x61795d(0x101)],'parentSegmentId':_0x111c2c};}async function resolveJourneyTarget(_0x509b1f,_0x265694,_0x46e27b){const _0x965aa0=a27_0x47c0;if(isYamlFilePath(_0x509b1f))try{const _0x2128dd=await resolveYamlFilePath(_0x509b1f);return _0x46e27b&&(console['error'](_0x965aa0(0x1f5)+_0x509b1f),console[_0x965aa0(0x115)](_0x965aa0(0x209)+_0x2128dd[_0x965aa0(0x189)]),console[_0x965aa0(0x115)](_0x965aa0(0x16c)+_0x2128dd[_0x965aa0(0x202)]),console['error'](_0x965aa0(0x177)+(_0x2128dd[_0x965aa0(0x198)]||_0x965aa0(0x11a)))),{'journeyName':_0x2128dd[_0x965aa0(0x202)],'parentSegment':_0x2128dd[_0x965aa0(0x189)],'resolved':_0x2128dd};}catch(_0x192440){throw new SDKError(ErrorCode[_0x965aa0(0x1c6)],_0x965aa0(0x1d8)+_0x192440[_0x965aa0(0x14b)]);}if(!_0x265694)throw new SDKError(ErrorCode[_0x965aa0(0x1c6)],_0x965aa0(0x194));return{'journeyName':_0x509b1f,'parentSegment':_0x265694};}export class JourneyListCommand extends BaseCommand{['name']=a27_0x354a54(0x1f4);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x15b);async[a27_0x354a54(0x138)](_0x2660e4){const _0x49e471=a27_0x354a54,{options:_0x56d291,args:_0x176235,tdx:_0x332324}=_0x2660e4,_0x46a0a0=_0x176235[0x0],_0x39c5f3=_0x56d291[_0x49e471(0x189)];if(!_0x39c5f3)return console[_0x49e471(0x115)](_0x49e471(0x19b)),console[_0x49e471(0x115)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x2ee023=await withSpinner(_0x49e471(0x1ec),()=>_0x332324[_0x49e471(0x1f7)][_0x49e471(0x14e)](_0x39c5f3),{'verbose':_0x56d291[_0x49e471(0x125)]}),_0x1df356=_0x2ee023[_0x49e471(0x1c3)];_0x56d291[_0x49e471(0x125)]&&(console[_0x49e471(0x115)](_0x49e471(0x204)+_0x39c5f3+'\x20(ID:\x20'+_0x1df356+')'),_0x46a0a0&&console['error'](_0x49e471(0x158)+_0x46a0a0));const _0x5eb581=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x332324[_0x49e471(0x1f7)][_0x49e471(0x1fd)](_0x1df356),{'verbose':_0x56d291[_0x49e471(0x125)]}),_0x44ff6c=_0x5eb581['data'],_0x146411=_0x44ff6c[_0x49e471(0x192)],_0x301696=await withSpinner(_0x49e471(0x144),()=>_0x332324['journey'][_0x49e471(0x1fa)](_0x1df356,_0x146411),{'verbose':_0x56d291[_0x49e471(0x125)]});let _0x17883e=_0x301696[_0x49e471(0x1c3)][_0x49e471(0x163)];const _0x4a3dad=_0x301696['data'][_0x49e471(0x148)],_0x5905e7=new Map();for(const _0x27ea4c of _0x4a3dad){_0x5905e7[_0x49e471(0x1ad)](_0x27ea4c['id'],_0x27ea4c[_0x49e471(0x12f)]);}if(_0x46a0a0){const _0x54a579=globToRegex(_0x46a0a0);_0x17883e=_0x17883e[_0x49e471(0xfe)](_0x5b84ba=>_0x54a579[_0x49e471(0x13b)](_0x5b84ba['journeyBundleName']));}console[_0x49e471(0x115)](_0x49e471(0x1b4)+_0x17883e[_0x49e471(0x13d)]+_0x49e471(0x1d5)+(_0x17883e[_0x49e471(0x13d)]!==0x1?'s':''));const _0xc4f6d5=_0x24b114=>{const _0x107fa9=_0x49e471;return getConsoleNextUrl(_0x56d291[_0x107fa9(0x1f1)],'/app/ps/'+_0x1df356+_0x107fa9(0x16e)+_0x24b114+_0x107fa9(0x13a));};if(_0x56d291['format']===_0x49e471(0x106))await handleSDKOutput(_0x17883e,_0x56d291);else{if(_0x56d291[_0x49e471(0x1fb)]===_0x49e471(0x1cd)){const _0x512bd7=_0x17883e[_0x49e471(0x17f)](_0x2dc17f=>({..._0x2dc17f,'url':_0xc4f6d5(_0x2dc17f['id'])}));await handleSDKOutput(_0x512bd7,_0x56d291);}else{console[_0x49e471(0xf8)]('['+_0x39c5f3+']');const _0x2b63bf=new Map(),_0x364b71=[];for(const _0x253493 of _0x17883e){if(!_0x253493[_0x49e471(0x1c8)]||_0x253493['folderId']===_0x146411)_0x364b71['push'](_0x253493);else{const _0x1a76e0=_0x2b63bf[_0x49e471(0x1c7)](_0x253493[_0x49e471(0x1c8)])||[];_0x1a76e0[_0x49e471(0x11f)](_0x253493),_0x2b63bf[_0x49e471(0x1ad)](_0x253493[_0x49e471(0x1c8)],_0x1a76e0);}}const _0x151c1e=(_0x554818,_0x29f155)=>_0x554818[_0x49e471(0x175)][_0x49e471(0x14a)](_0x29f155[_0x49e471(0x175)],undefined,{'sensitivity':'base'});_0x364b71[_0x49e471(0x1d6)](_0x151c1e);for(const _0x12b7fa of _0x364b71){console[_0x49e471(0xf8)](formatJourneyItem(_0x12b7fa,'',_0xc4f6d5(_0x12b7fa['id'])));}const _0x1fb007=[..._0x2b63bf['entries']()][_0x49e471(0x1d6)]((_0x4aec54,_0x37077a)=>{const _0x43a820=_0x49e471,_0xea0cd6=_0x5905e7[_0x43a820(0x1c7)](_0x4aec54[0x0])||_0x4aec54[0x0],_0x6e39f1=_0x5905e7['get'](_0x37077a[0x0])||_0x37077a[0x0];return _0xea0cd6[_0x43a820(0x14a)](_0x6e39f1,undefined,{'sensitivity':_0x43a820(0x18d)});});for(const [_0x301b71,_0x4dd6fe]of _0x1fb007){const _0x13c0b1=_0x5905e7['get'](_0x301b71)||_0x301b71;console[_0x49e471(0xf8)](_0x49e471(0x155)+_0x13c0b1),_0x4dd6fe[_0x49e471(0x1d6)](_0x151c1e);for(const _0x51f08b of _0x4dd6fe){console[_0x49e471(0xf8)](formatJourneyItem(_0x51f08b,'\x20\x20',_0xc4f6d5(_0x51f08b['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x354a54(0x12f)]='journey:view';[a27_0x354a54(0x1bf)]='Show\x20journey\x20details';async[a27_0x354a54(0x138)](_0x4a58c3){const _0x6010cd=a27_0x354a54,{options:_0x473cf7,args:_0xbe58b5,tdx:_0x2a34d7}=_0x4a58c3,_0x2b507d=_0xbe58b5[0x0];if(!_0x2b507d)return console[_0x6010cd(0x115)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x6010cd(0x115)](_0x6010cd(0x109)),console[_0x6010cd(0x115)]('Options:'),console['error'](_0x6010cd(0x126)),0x1;_0x473cf7[_0x6010cd(0x125)]&&console[_0x6010cd(0x115)](_0x6010cd(0x113)+_0x2b507d);const {journeyId:_0x32b1c1,parentSegmentId:_0x67bb2a}=await resolveJourneyIdFromInput(_0x2b507d,_0x473cf7,_0x2a34d7);if(_0x473cf7['web']){const _0xb9c58b=getConsoleNextUrl(_0x473cf7[_0x6010cd(0x1f1)],_0x6010cd(0x1dd)+_0x67bb2a+_0x6010cd(0x16e)+_0x32b1c1+_0x6010cd(0x1e4));return console['error'](a27_0x5dfa1a[_0x6010cd(0x1a3)]('✔')+_0x6010cd(0x128)+a27_0x5dfa1a[_0x6010cd(0x20b)](_0xb9c58b)),openBrowser(_0xb9c58b),0x0;}const _0x267f9c=await withSpinner(_0x6010cd(0x1d7),()=>_0x2a34d7['journey']['getJourney'](_0x32b1c1),{'verbose':_0x473cf7['verbose']}),_0x1d84d5=_0x267f9c[_0x6010cd(0x1c3)],_0x9cd8e0=_0x473cf7['includeStats'];let _0x501dde;if(_0x9cd8e0)try{const _0x5315b4=await withSpinner(_0x6010cd(0x1be),()=>_0x2a34d7[_0x6010cd(0x14d)][_0x6010cd(0x1af)](_0x32b1c1),{'verbose':_0x473cf7[_0x6010cd(0x125)]});_0x501dde=_0x5315b4['data'];}catch{_0x473cf7['verbose']&&console[_0x6010cd(0x115)](_0x6010cd(0x10e));}const _0x1db36a=getConsoleNextUrl(_0x473cf7[_0x6010cd(0x1f1)],'/app/ps/'+_0x67bb2a+_0x6010cd(0x16e)+_0x32b1c1+_0x6010cd(0x1e4)),_0x23c7a6={'id':_0x1d84d5['id'],'name':_0x1d84d5['attributes']['name'],'description':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x1bf)],'state':_0x1d84d5['attributes'][_0x6010cd(0x1a0)],'paused':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x131)],'reentry_mode':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x19e)],'stages':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x1de)]?.['length']||0x0,..._0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x1e5)]&&{'goal':_0x1d84d5[_0x6010cd(0x17e)][_0x6010cd(0x1e5)][_0x6010cd(0x12f)]},..._0x501dde&&{'statistics':{'size':_0x501dde[_0x6010cd(0x166)],'entered':_0x501dde['enteredSize'],'goal_achieved':_0x501dde['goalSize'],'completion_rate':_0x501dde[_0x6010cd(0x190)],'exit_or_jump':_0x501dde[_0x6010cd(0x1e9)],'exit_or_jump_rate':_0x501dde['exitOrJumpRate'],'stages':_0x501dde[_0x6010cd(0x132)]}},'url':_0x1db36a};return await handleSingleObjectOutput(_0x23c7a6,_0x473cf7),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x153);['description']=a27_0x354a54(0x1ac);async[a27_0x354a54(0x138)](_0x1e3c43){const _0x25e132=a27_0x354a54,{options:_0x3bbc0f,args:_0x2a76e8,tdx:_0xcbec4a}=_0x1e3c43,_0x300219=_0x2a76e8[0x0];if(!requireNameOrPath(_0x300219))return 0x1;_0x3bbc0f['verbose']&&console[_0x25e132(0x115)](_0x25e132(0x113)+_0x300219);const _0x1aad18=_0x3bbc0f,_0x5f4011=_0x1aad18['from'],_0x155b60=_0x1aad18['to'],_0x296e9b=_0x1aad18[_0x25e132(0xf5)],_0x4168a2=_0x1aad18[_0x25e132(0x170)];_0x296e9b&&!_0x5f4011&&!_0x155b60&&console[_0x25e132(0x115)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x187a02=_0x296e9b?withJsonFormat(_0x3bbc0f):_0x3bbc0f,{journeyId:_0x233b75,journeyName:_0x392f64}=await resolveJourneyIdFromInput(_0x300219,_0x187a02,_0xcbec4a),_0x20f077=_0x5f4011||_0x155b60?{'from':_0x5f4011,'to':_0x155b60}:undefined,_0x1d576f=await withSpinner(_0x25e132(0x1be),()=>Promise[_0x25e132(0x161)]([_0xcbec4a[_0x25e132(0x14d)]['getJourney'](_0x233b75),_0xcbec4a[_0x25e132(0x14d)][_0x25e132(0x1af)](_0x233b75,_0x20f077)]),{'verbose':_0x187a02[_0x25e132(0x125)]}),[_0x3a9701,_0x334f7d]=_0x1d576f[_0x25e132(0x1c3)];if(!_0x334f7d||_0x334f7d['journeyId']===null)return console[_0x25e132(0x115)](_0x25e132(0x1b3)+_0x392f64),console[_0x25e132(0x115)](_0x25e132(0x165)),0x0;const _0x34a585=buildStageNameMap(_0x3a9701),_0x3890b2=!!(_0x20f077&&_0x334f7d[_0x25e132(0x11e)]?.['length']),_0x21f155={'stageNameMap':_0x34a585,'hasPeriod':_0x3890b2,'includeHistory':!!_0x296e9b};if(_0x4168a2&&_0x334f7d['stages']){const _0x44299e=_0x334f7d[_0x25e132(0x132)][_0x25e132(0x196)](_0x57c692=>{const _0x5b5f41=_0x25e132,_0x5effea=_0x34a585[_0x5b5f41(0x1c7)](_0x57c692['id'])??'';return _0x5effea['toLowerCase']()===_0x4168a2['toLowerCase']();});if(_0x44299e)return await handleSingleObjectOutput(formatStageStats(_0x44299e,_0x21f155),_0x187a02),0x0;const _0x2a7247=_0x334f7d['stages'][_0x25e132(0x17f)](_0x317663=>_0x34a585[_0x25e132(0x1c7)](_0x317663['id'])??_0x317663['id']);return console[_0x25e132(0x115)]('Error:\x20Stage\x20\x22'+_0x4168a2+_0x25e132(0x1a5)),console[_0x25e132(0x115)]('Available\x20stages:\x20'+_0x2a7247[_0x25e132(0x151)](',\x20')),0x1;}const _0x309c12=_0x334f7d[_0x25e132(0x132)]?.[_0x25e132(0x17f)](_0x421490=>formatStageStats(_0x421490,_0x21f155)),_0x5e8c28=assembleJourneyStats(_0x334f7d,{'from':_0x5f4011,'to':_0x155b60,'includeHistory':_0x296e9b});return await this[_0x25e132(0x114)](_0x5e8c28,_0x309c12??[],_0x187a02),0x0;}async[a27_0x354a54(0x114)](_0x377ec0,_0x4a5513,_0x5eeaa5){const _0x7f4419=a27_0x354a54,_0x1b1518=_0x5eeaa5[_0x7f4419(0x1fb)]===_0x7f4419(0x1cd)||_0x5eeaa5['format']===_0x7f4419(0x15d)||_0x5eeaa5[_0x7f4419(0x1cd)]||_0x5eeaa5['jsonl'];if(_0x1b1518){_0x377ec0[_0x7f4419(0x132)]=_0x4a5513,await handleSingleObjectOutput(_0x377ec0,_0x5eeaa5);return;}await handleSingleObjectOutput(_0x377ec0,_0x5eeaa5);for(const _0x1d5995 of _0x4a5513){console['log'](''),console[_0x7f4419(0xf8)](String(a27_0x5dfa1a[_0x7f4419(0x20b)]['bold']('['+_0x1d5995[_0x7f4419(0x12f)]+']'))+a27_0x5dfa1a[_0x7f4419(0x19f)]('\x20'+_0x1d5995['id']));const {id:_0x27c611,name:_0x20b728,..._0x20460d}=_0x1d5995;await handleSingleObjectOutput(_0x20460d,_0x5eeaa5);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x354a54(0x12f)]='journey:traffic';[a27_0x354a54(0x1bf)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async['execute'](_0x305ae4){const _0x291390=a27_0x354a54,{options:_0x343620,args:_0x5d4a28,tdx:_0x55b1cd}=_0x305ae4,_0x13daa0=_0x5d4a28[0x0];if(!requireNameOrPath(_0x13daa0))return 0x1;_0x343620['verbose']&&console[_0x291390(0x115)](_0x291390(0x113)+_0x13daa0);const _0x50ca9d=_0x343620,_0x16be75=_0x50ca9d[_0x291390(0x12a)],_0x67589d=_0x50ca9d[_0x291390(0x178)],_0x1d7ba6=_0x50ca9d['to'],_0x1e8e96=_0x50ca9d[_0x291390(0x152)];if(_0x16be75&&_0x16be75!==_0x291390(0x1bc)&&_0x16be75!==_0x291390(0x16b))return console[_0x291390(0x115)](_0x291390(0x184)+_0x16be75+_0x291390(0x110)),0x1;const _0x14a053=withJsonFormat(_0x343620),{journeyId:_0xee832,journeyName:_0x249fba}=await resolveJourneyIdFromInput(_0x13daa0,_0x14a053,_0x55b1cd),_0x489801={'type':_0x16be75,'from':_0x67589d,'to':_0x1d7ba6,'limit':_0x1e8e96},_0x302f75=await withSpinner(_0x291390(0x18f),()=>_0x55b1cd[_0x291390(0x14d)][_0x291390(0x171)](_0xee832,_0x489801),{'verbose':_0x14a053['verbose']}),_0x3d949c=_0x302f75[_0x291390(0x1c3)],_0x1418da=_0x3d949c[_0x291390(0x1bc)]&&(_0x3d949c[_0x291390(0x1bc)][_0x291390(0x1b0)][_0x291390(0x13d)]>0x0||_0x3d949c['conversion'][_0x291390(0x145)][_0x291390(0x13d)]>0x0),_0x21a1a3=_0x3d949c[_0x291390(0x16b)]&&_0x3d949c['activation'][_0x291390(0x13d)]>0x0;if(!_0x1418da&&!_0x21a1a3)return console[_0x291390(0x115)](_0x291390(0x1df)+_0x249fba),console[_0x291390(0x115)](_0x291390(0x1e2)),_0x67589d&&_0x1d7ba6&&console[_0x291390(0x115)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x3d949c,_0x14a053),0x0;}}function formatStageStats(_0x2bb10e,_0x11ddf8){const _0x28e549=a27_0x354a54,_0x15503f=_0x11ddf8[_0x28e549(0x1f8)]&&_0x2bb10e[_0x28e549(0x11e)]?.['length']?aggregateStageHistory(_0x2bb10e[_0x28e549(0x11e)]):{'size':_0x2bb10e[_0x28e549(0x166)],'entered':_0x2bb10e[_0x28e549(0xfd)],'milestone':_0x2bb10e[_0x28e549(0x1da)],'milestone_rate':_0x2bb10e[_0x28e549(0x181)],'exit_or_jump':_0x2bb10e[_0x28e549(0x1e9)],'exit_or_jump_rate':_0x2bb10e[_0x28e549(0x160)]},_0x491613={'id':_0x2bb10e['id'],'name':_0x11ddf8[_0x28e549(0x169)][_0x28e549(0x1c7)](_0x2bb10e['id'])??_0x2bb10e['id'],..._0x15503f};return _0x11ddf8[_0x28e549(0x1f8)]&&_0x11ddf8[_0x28e549(0xf5)]&&_0x2bb10e['history']&&(_0x491613['history']=_0x2bb10e['history']),_0x491613;}export class JourneyPauseCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x168);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x1ca);async['execute'](_0x5bd0a0){const _0x16d7d3=a27_0x354a54,{options:_0x17cb0d,args:_0x44eec5,tdx:_0x5df25a}=_0x5bd0a0,_0x14f68e=_0x44eec5[0x0];if(!requireNameOrPath(_0x14f68e))return 0x1;_0x17cb0d['verbose']&&console[_0x16d7d3(0x115)]('Input:\x20'+_0x14f68e);const {journeyId:_0xfdc679,journeyName:_0x49a566}=await resolveJourneyIdFromInput(_0x14f68e,_0x17cb0d,_0x5df25a);if(!_0x17cb0d[_0x16d7d3(0x139)]){const _0x1f3a6c=await confirm(_0x16d7d3(0x1ba)+_0x49a566+'\x22?');if(!_0x1f3a6c)return console[_0x16d7d3(0x115)](_0x16d7d3(0x13f)),0x0;}const _0x32f37f=await withSpinner(_0x16d7d3(0x16a),()=>_0x5df25a[_0x16d7d3(0x14d)][_0x16d7d3(0x1ea)](_0xfdc679),{'verbose':_0x17cb0d[_0x16d7d3(0x125)]}),_0x38d185=_0x32f37f[_0x16d7d3(0x1c3)];return console[_0x16d7d3(0x115)](_0x16d7d3(0x1b2)+_0x38d185[_0x16d7d3(0x17e)]['name']+_0x16d7d3(0x200)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x1d4);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x147);async['execute'](_0x205fcc){const _0x4e66ca=a27_0x354a54,{options:_0x3c7a67,args:_0x55d1bf,tdx:_0x152494}=_0x205fcc,_0x22cc35=_0x55d1bf[0x0];if(!requireNameOrPath(_0x22cc35))return 0x1;_0x3c7a67[_0x4e66ca(0x125)]&&console['error'](_0x4e66ca(0x113)+_0x22cc35);const {journeyId:_0x432766,journeyName:_0x2ffb0e}=await resolveJourneyIdFromInput(_0x22cc35,_0x3c7a67,_0x152494);if(!_0x3c7a67[_0x4e66ca(0x139)]){const _0x3c9e70=await confirm(_0x4e66ca(0x162)+_0x2ffb0e+'\x22?');if(!_0x3c9e70)return console[_0x4e66ca(0x115)](_0x4e66ca(0x13f)),0x0;}const _0x53b588=await withSpinner(_0x4e66ca(0x1d0),()=>_0x152494['journey'][_0x4e66ca(0x1f2)](_0x432766),{'verbose':_0x3c7a67[_0x4e66ca(0x125)]}),_0x2cca73=_0x53b588['data'];return console['error'](_0x4e66ca(0x1b2)+_0x2cca73[_0x4e66ca(0x17e)]['name']+_0x4e66ca(0x1b6)),0x0;}}function a27_0x47c0(_0x2a0655,_0x26462c){_0x2a0655=_0x2a0655-0xf2;const _0x4c19bd=a27_0x4c19();let _0x47c0cf=_0x4c19bd[_0x2a0655];return _0x47c0cf;}export class JourneyPullCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x167);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x1c4);async[a27_0x354a54(0x138)](_0x2855fd){const _0x313c01=a27_0x354a54,{options:_0x236083,args:_0x176493,tdx:_0x4f34de}=_0x2855fd,_0x456ab9=_0x236083,_0x24ef79=_0x176493[0x0],_0x356c5a=_0x24ef79&&isYamlFilePath(_0x24ef79),_0x15262b=await resolveTarget({'arg':_0x356c5a?_0x24ef79:undefined,'contextParent':_0x236083[_0x313c01(0x189)],'cwd':process[_0x313c01(0x1c9)]()});if(!isSuccessfulResolution(_0x15262b))return _0x15262b[_0x313c01(0x172)]===_0x313c01(0x1a2)?(console['error'](a27_0x5dfa1a[_0x313c01(0x179)](_0x313c01(0xf2))),console['error']('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x313c01(0x115)](_0x313c01(0x102)),console['error'](_0x313c01(0x1a4)),console[_0x313c01(0x115)](_0x313c01(0x1a1))):(console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x120)](_0x313c01(0x135)+_0x15262b[_0x313c01(0x14b)]+'\x0a')),_0x15262b[_0x313c01(0x1d2)]&&console[_0x313c01(0x115)](a27_0x5dfa1a['cyan'](_0x15262b[_0x313c01(0x1d2)]))),0x1;let _0x4649a8=_0x356c5a?undefined:_0x24ef79,_0x3c66e6,_0x44ca81;_0x15262b[_0x313c01(0x12a)]===_0x313c01(0x193)&&(_0x4649a8=_0x15262b[_0x313c01(0x1d3)],_0x3c66e6=_0x15262b['filePath'],_0x44ca81=_0x15262b[_0x313c01(0x198)]);const _0x1a337d=_0x15262b[_0x313c01(0x205)],_0x126c33=_0x15262b[_0x313c01(0xfc)];_0x456ab9[_0x313c01(0x125)]&&(console['error'](_0x313c01(0x204)+_0x1a337d),console[_0x313c01(0x115)](_0x313c01(0x107)+_0x126c33),_0x4649a8&&console[_0x313c01(0x115)](_0x313c01(0x123)+_0x4649a8),_0x3c66e6&&console[_0x313c01(0x115)](_0x313c01(0x1eb)+_0x3c66e6),_0x44ca81&&console['error']('Folder\x20path:\x20'+_0x44ca81));const _0x5e9d59=await withSpinner(_0x313c01(0x1ec),()=>_0x4f34de[_0x313c01(0x1f7)][_0x313c01(0x14e)](_0x1a337d),{'verbose':_0x236083[_0x313c01(0x125)]}),_0x358205=_0x5e9d59['data'],{journeys:_0x25392d,folders:_0x26bcba}=await withSpinner(_0x313c01(0x197),async()=>{const _0x4b7ff2=_0x313c01,[_0xdf7aea,_0x183818]=await Promise['all']([_0x4f34de['journey'][_0x4b7ff2(0x1fc)](_0x358205,undefined,{'includeAllVersions':!![]}),_0x4f34de[_0x4b7ff2(0x1f7)][_0x4b7ff2(0x130)](_0x358205)]);return{'journeys':_0xdf7aea,'folders':_0x183818};},{'verbose':_0x236083[_0x313c01(0x125)]})['then'](_0x53bb2d=>_0x53bb2d[_0x313c01(0x1c3)]);let _0x2a8698=_0x25392d;const _0x387d13=buildFolderIdToPathMap(_0x26bcba);if(_0x4649a8){const _0x40bf26=_0x2a8698[_0x313c01(0xfe)](_0x32fa39=>_0x32fa39['journeyBundleName']['toLowerCase']()===_0x4649a8[_0x313c01(0x185)]());if(_0x40bf26[_0x313c01(0x13d)]===0x0)return console['error'](_0x313c01(0x186)+_0x4649a8),console[_0x313c01(0x115)](_0x313c01(0x1cb)),0x1;_0x2a8698=_0x40bf26;}if(_0x44ca81!==undefined){const _0x3e39c8=_0x2a8698[_0x313c01(0xfe)](_0x553c59=>{const _0x22eaaf=_0x313c01,_0x3e278b=_0x553c59[_0x22eaaf(0x1c8)]?_0x387d13[_0x22eaaf(0x1c7)](_0x553c59[_0x22eaaf(0x1c8)])||'':'';return _0x3e278b===_0x44ca81;});if(_0x3e39c8[_0x313c01(0x13d)]===0x0&&_0x2a8698['length']>0x0){console[_0x313c01(0x115)](_0x313c01(0x19a)+_0x4649a8+'\x27\x20not\x20found\x20in\x20'+(_0x44ca81||_0x313c01(0x11d))),console[_0x313c01(0x115)](_0x313c01(0xf6));for(const _0x590b47 of _0x2a8698){const _0x51ef42=_0x590b47[_0x313c01(0x1c8)]?_0x387d13[_0x313c01(0x1c7)](_0x590b47[_0x313c01(0x1c8)])||'':'';console[_0x313c01(0x115)](_0x313c01(0x195)+(_0x51ef42||_0x313c01(0x11a))+'/'+_0x590b47[_0x313c01(0x175)]);}return 0x1;}_0x2a8698=_0x3e39c8;}if(_0x2a8698['length']===0x0)return console[_0x313c01(0x115)]('No\x20journeys\x20found'),0x0;const _0x56ec78=new Map();for(const _0x2cd1c2 of _0x2a8698){const _0x346984=_0x2cd1c2[_0x313c01(0x10b)];!_0x56ec78[_0x313c01(0x187)](_0x346984)&&_0x56ec78[_0x313c01(0x1ad)](_0x346984,[]),_0x56ec78['get'](_0x346984)[_0x313c01(0x11f)](_0x2cd1c2);}for(const _0x276325 of _0x56ec78[_0x313c01(0x10f)]()){_0x276325['sort']((_0x527be4,_0x368667)=>(_0x527be4[_0x313c01(0x150)]||0x0)-(_0x368667['versionNumber']||0x0));}const _0x50c544=[],{idToEmailMap:_0x4d1f41,connectionIdToNameMap:_0x49fb36}=await withSpinner(_0x313c01(0x1cc),async()=>{const _0x283a35=_0x313c01,[_0x895a7f,_0x7ea5ef]=await Promise[_0x283a35(0x161)]([_0x4f34de[_0x283a35(0x164)][_0x283a35(0x1e6)](),_0x4f34de[_0x283a35(0x1ff)][_0x283a35(0x111)]()]);return{'idToEmailMap':_0x895a7f,'connectionIdToNameMap':_0x7ea5ef};},{'verbose':_0x236083[_0x313c01(0x125)]})[_0x313c01(0x1ef)](_0x11cb56=>_0x11cb56['data']);for(const _0x1f9231 of _0x56ec78[_0x313c01(0x10f)]()){const _0xd27d2b=_0x1f9231[0x0][_0x313c01(0x175)],_0x540aa6=_0x1f9231[0x0][_0x313c01(0x1c8)],_0x2b4742=_0x540aa6?_0x387d13[_0x313c01(0x1c7)](_0x540aa6)||'':'',_0x2ccdad=_0x2b4742?a27_0x40bb69['join'](_0x126c33,_0x2b4742):_0x126c33,_0x16d04c=_0x3c66e6||a27_0x40bb69[_0x313c01(0x151)](_0x2ccdad,sanitizeFileName(_0xd27d2b)+_0x313c01(0x10d));let _0x1d572d,_0x1ef7e9;if(existsSync(_0x16d04c))try{const _0x18f90b=readFileSync(_0x16d04c,'utf-8'),_0x41ce0a=parseYamlString(_0x18f90b);_0x1ef7e9=_0x41ce0a,_0x1d572d=buildRuleToNameMapping(_0x41ce0a),_0x456ab9['verbose']&&_0x1d572d[_0x313c01(0x166)]>0x0&&console[_0x313c01(0x115)](_0x313c01(0x122)+_0x1d572d[_0x313c01(0x166)]+_0x313c01(0x1fe)+_0xd27d2b);}catch(_0x3bd945){_0x456ab9[_0x313c01(0x125)]&&console[_0x313c01(0x115)](_0x313c01(0x1ed)+_0x3bd945[_0x313c01(0x14b)]);}const _0x4c4266=[],_0x4e196f=new Set(),_0x41734e=new Map(),_0x277a8e=new Map(),_0x357391=new Set(),_0x426bc5=new Map(),_0x2920aa=new Map(),_0x16b35e=createJumpTargetCache();await withProgressSpinner(_0x313c01(0x15a)+_0xd27d2b+_0x313c01(0x1d9),async _0x3f6107=>{const _0x3ea60b=_0x313c01;for(const _0x296501 of _0x1f9231){const _0x5c96b7=_0x1f9231[_0x3ea60b(0x13d)]>0x1?_0x296501[_0x3ea60b(0x175)]+'\x20v'+(_0x296501['versionNumber']||0x1):_0x296501[_0x3ea60b(0x175)];_0x3f6107[_0x3ea60b(0x13e)](_0x3ea60b(0x15a)+_0x5c96b7);const _0x12dc13=await _0x4f34de[_0x3ea60b(0x14d)]['getJourney'](_0x296501['id']),_0x2485de=_0x12dc13[_0x3ea60b(0x17e)]?.[_0x3ea60b(0x1c1)],_0x3593a4={'resolveSegment':async _0x44b4e9=>{const _0x1c727d=_0x3ea60b;if(!_0x2485de)return{'name':_0x44b4e9,'isJourneyLocal':![]};const _0x39401b=_0x41734e[_0x1c727d(0x1c7)](_0x44b4e9);if(_0x39401b)return _0x39401b;try{const _0x1a691a=await _0x4f34de[_0x1c727d(0x1f7)][_0x1c727d(0x1b8)](_0x2485de,_0x44b4e9),_0x2e57b1=_0x1a691a[_0x1c727d(0x17c)]===SEGMENT_KIND_JOURNEY;let _0x557216,_0x737902=_0x1a691a[_0x1c727d(0x12f)];if(_0x2e57b1&&_0x1a691a['rule']){const _0x33871b=await segmentResponseToDef(_0x1a691a,{'resolveSegmentName':async _0x250c50=>{const _0x17b3c2=_0x1c727d,_0x1e5eab=_0x41734e[_0x17b3c2(0x1c7)](_0x250c50);if(_0x1e5eab)return _0x1e5eab['name'];const _0x204618=await _0x3593a4['resolveSegment'](_0x250c50);return _0x204618['name'];}}),_0x8ce530=_0x33871b['rule'];_0x557216={'description':_0x1a691a['description'],'rule':_0x8ce530};const _0x540f5c=serializeRule(_0x8ce530),_0x4b4360=_0x277a8e[_0x1c727d(0x1c7)](_0x540f5c);if(_0x4b4360)_0x737902=_0x4b4360,_0x557216=undefined,_0x456ab9[_0x1c727d(0x125)]&&console[_0x1c727d(0x115)](_0x1c727d(0x133)+_0x1a691a[_0x1c727d(0x12f)]+_0x1c727d(0x1db)+_0x4b4360);else{let _0x8a7a1d=![];if(_0x1d572d){const _0x529bcf=_0x1d572d['get'](_0x540f5c);if(_0x529bcf){const _0x259726=_0x529bcf[_0x1c727d(0x196)](_0x5159fb=>!_0x4e196f[_0x1c727d(0x187)](_0x5159fb));_0x259726&&(_0x737902=_0x259726,_0x4e196f[_0x1c727d(0x108)](_0x259726),_0x277a8e[_0x1c727d(0x1ad)](_0x540f5c,_0x259726),_0x8a7a1d=!![],_0x456ab9[_0x1c727d(0x125)]&&console[_0x1c727d(0x115)](_0x1c727d(0xf9)+_0x259726+'\x20(rule\x20match)'));}}if(!_0x8a7a1d){const _0x174e2e=generateJourneyLocalName(_0x1a691a[_0x1c727d(0x12f)]);_0x174e2e&&(_0x737902=_0x174e2e);let _0x4f75b9=_0x737902,_0x406c56=0x2;while(_0x4e196f[_0x1c727d(0x187)](_0x4f75b9)){_0x4f75b9=_0x737902+'_'+_0x406c56,_0x406c56++;}_0x4e196f[_0x1c727d(0x108)](_0x4f75b9),_0x277a8e[_0x1c727d(0x1ad)](_0x540f5c,_0x4f75b9),_0x737902=_0x4f75b9;}}}const _0x4c94b4={'name':_0x737902,'isJourneyLocal':_0x2e57b1,'definition':_0x557216};return _0x41734e[_0x1c727d(0x1ad)](_0x44b4e9,_0x4c94b4),_0x4c94b4;}catch(_0x9945a1){return _0x236083['verbose']&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x44b4e9+':\x20'+_0x9945a1[_0x1c727d(0x14b)]),{'name':_0x44b4e9,'isJourneyLocal':![]};}},'resolveActivation':async _0x7611b8=>{const _0x1c6c76=_0x3ea60b,_0x41f0d6=_0x426bc5[_0x1c6c76(0x1c7)](_0x7611b8);if(_0x41f0d6)return _0x41f0d6;try{const _0xf1f7e0=await _0x4f34de[_0x1c6c76(0x14d)]['getActivation'](_0x296501['id'],_0x7611b8),_0xb50135=journeyActivationStepToYaml(_0xf1f7e0,_0x4d1f41,_0x49fb36),_0x1f4f03=JSON[_0x1c6c76(0x1f0)]({'name':_0xb50135[_0x1c6c76(0x12f)],'connection':_0xb50135['connection'],'connector_config':_0xb50135[_0x1c6c76(0x10c)]}),_0x50c9e5=_0x2920aa[_0x1c6c76(0x1c7)](_0x1f4f03);if(_0x50c9e5){const _0x81da69={'name':_0x50c9e5,'isJourneyLocal':!![],'definition':_0xb50135};return _0x426bc5[_0x1c6c76(0x1ad)](_0x7611b8,_0x81da69),_0x81da69;}const _0x58a7a6=_0xf1f7e0[_0x1c6c76(0x17e)][_0x1c6c76(0x1b9)][_0x1c6c76(0x12f)]||_0x7611b8,_0x3aaf64=sanitizeYamlKey(_0x58a7a6)||_0x1c6c76(0x208)+_0x7611b8;let _0x39c01f=_0x3aaf64,_0x810dd0=0x2;while(_0x357391[_0x1c6c76(0x187)](_0x39c01f)){_0x39c01f=_0x3aaf64+'_'+_0x810dd0,_0x810dd0++;}_0x357391[_0x1c6c76(0x108)](_0x39c01f),_0x2920aa[_0x1c6c76(0x1ad)](_0x1f4f03,_0x39c01f);const _0x3e4cf9={'name':_0x39c01f,'isJourneyLocal':!![],'definition':_0xb50135};return _0x426bc5[_0x1c6c76(0x1ad)](_0x7611b8,_0x3e4cf9),_0x3e4cf9;}catch(_0x6c8d42){return _0x236083[_0x1c6c76(0x125)]&&console['error'](_0x1c6c76(0x1e0)+_0x7611b8+':\x20'+_0x6c8d42[_0x1c6c76(0x14b)]),{'name':_0x7611b8,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x45cdcb,_0x53b8b8)=>{const _0xc4fcb3=_0x3ea60b;return resolveJumpTarget(_0x45cdcb,_0x53b8b8,_0x16b35e,_0x3ac0e4=>_0x4f34de['journey'][_0xc4fcb3(0xf3)](_0x3ac0e4));}},_0x3bd6aa=await journeyResponseToDef(_0x12dc13,_0x3593a4);_0x4c4266['push']({'item':_0x296501,'yaml':_0x3bd6aa});}},{'verbose':_0x236083[_0x313c01(0x125)]});const _0x5cd75b=await _0x4f34de[_0x313c01(0x14d)][_0x313c01(0x206)](_0x1f9231[0x0][_0x313c01(0x10b)]),_0x168cea=buildMergedJourneyDef(_0x4c4266,_0x1d572d,_0x5cd75b),_0x53549c=normalizeJourneyDef(_0x168cea,_0x1ef7e9),_0x16c69c=toYamlString(_0x53549c),_0x58a580=_0x3c66e6||a27_0x40bb69[_0x313c01(0x151)](_0x2ccdad,sanitizeFileName(_0xd27d2b)+'.yml');!_0x3c66e6&&_0x2b4742&&!existsSync(_0x2ccdad)&&mkdirSync(_0x2ccdad,{'recursive':!![]});const _0x50bac9=a27_0x40bb69[_0x313c01(0xff)](process[_0x313c01(0x1c9)](),_0x58a580);if(existsSync(_0x58a580)){const _0x2d6d34=readFileSync(_0x58a580,_0x313c01(0x207)),_0x13b5ca=generateDiff(_0x2d6d34,_0x16c69c),_0x62de6c=hasChanges(_0x13b5ca);_0x50c544[_0x313c01(0x11f)]({'relativePath':_0x50bac9,'absolutePath':_0x58a580,'content':_0x16c69c,'isNew':![],'hasChanges':_0x62de6c,'diff':_0x62de6c?formatDiffWithColors(_0x13b5ca):undefined});}else _0x50c544[_0x313c01(0x11f)]({'relativePath':_0x50bac9,'absolutePath':_0x58a580,'content':_0x16c69c,'isNew':!![],'hasChanges':![]});}const _0x14eb00=_0x50c544['filter'](_0x3bd531=>_0x3bd531[_0x313c01(0x1c2)]),_0xd01a2d=_0x50c544[_0x313c01(0xfe)](_0xb54b70=>!_0xb54b70[_0x313c01(0x1c2)]&&_0xb54b70[_0x313c01(0x136)]),_0x4b8a42=_0x50c544['filter'](_0x1e856b=>!_0x1e856b[_0x313c01(0x1c2)]&&!_0x1e856b[_0x313c01(0x136)]),_0x215da2=_0x2a8698[_0x313c01(0x13d)],_0x314225=_0x56ec78[_0x313c01(0x166)],_0x14f2ad=_0x215da2>_0x314225?'\x20('+_0x215da2+_0x313c01(0x1ae):'';console[_0x313c01(0x115)]('\x0aPull\x20summary:'),console[_0x313c01(0x115)]('\x20\x20'+a27_0x5dfa1a[_0x313c01(0x20b)](_0x314225+_0x313c01(0x19c))+a27_0x5dfa1a['dim'](_0x14f2ad)),console['error']('\x20\x20'+a27_0x5dfa1a['green']('+\x20'+_0x14eb00[_0x313c01(0x13d)]+_0x313c01(0xfa))),console[_0x313c01(0x115)]('\x20\x20'+a27_0x5dfa1a['yellow']('~\x20'+_0xd01a2d[_0x313c01(0x13d)]+_0x313c01(0x18e))),console[_0x313c01(0x115)]('\x20\x20'+a27_0x5dfa1a[_0x313c01(0x19f)]('=\x20'+_0x4b8a42[_0x313c01(0x13d)]+_0x313c01(0xf7))),console[_0x313c01(0x115)](_0x313c01(0x17d)+a27_0x5dfa1a['cyan'](_0x126c33)+'\x0a');if(_0xd01a2d['length']>0x0)for(const _0x22dc23 of _0xd01a2d){console['error'](_0x313c01(0x1e1)+_0x22dc23[_0x313c01(0x1d1)]+'\x27:'),console[_0x313c01(0x115)]('─'[_0x313c01(0x121)](0x3c)),console[_0x313c01(0x115)](_0x22dc23['diff']),console[_0x313c01(0x115)]('─'[_0x313c01(0x121)](0x3c));}if(_0x456ab9[_0x313c01(0x129)])return console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x179)](_0x313c01(0x17b))),0x0;if(_0x14eb00['length']===0x0&&_0xd01a2d[_0x313c01(0x13d)]===0x0)return console['error'](a27_0x5dfa1a['green'](_0x313c01(0x12c))),saveSessionContext({'parent_segment':_0x1a337d},_0x456ab9[_0x313c01(0x154)]),console['error'](a27_0x5dfa1a[_0x313c01(0x1a3)](_0x313c01(0x12d)+a27_0x5dfa1a[_0x313c01(0x19f)](_0x313c01(0x15c))+_0x313c01(0x1a7)+a27_0x5dfa1a['cyan'](_0x1a337d))),0x0;if(!_0x456ab9['yes']&&(_0x14eb00[_0x313c01(0x13d)]>0x0||_0xd01a2d[_0x313c01(0x13d)]>0x0)){if(!isInteractive())return console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x120)](_0x313c01(0x11b)),_0x313c01(0x14c)),console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x19f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x24fe8f=await confirmKey('Write\x20'+(_0x14eb00[_0x313c01(0x13d)]+_0xd01a2d[_0x313c01(0x13d)])+_0x313c01(0x173));if(!_0x24fe8f)return console['error'](a27_0x5dfa1a[_0x313c01(0x179)](_0x313c01(0x141)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x126c33)&&mkdirSync(_0x126c33,{'recursive':!![]});const _0x361fe1=a27_0x40bb69[_0x313c01(0x151)](_0x126c33,_0x313c01(0x103));writeFileSync(_0x361fe1,createTdxConfigContent(_0x1a337d),_0x313c01(0x207));for(const _0x4eeeb7 of _0x50c544){(_0x4eeeb7['isNew']||_0x4eeeb7['hasChanges'])&&writeFileSync(_0x4eeeb7[_0x313c01(0x18b)],_0x4eeeb7[_0x313c01(0x16d)],_0x313c01(0x207));}return console[_0x313c01(0x115)](a27_0x5dfa1a['green'](_0x313c01(0x14f)+(_0x14eb00[_0x313c01(0x13d)]+_0xd01a2d[_0x313c01(0x13d)])+_0x313c01(0x201)+_0x126c33)),saveSessionContext({'parent_segment':_0x1a337d},_0x456ab9[_0x313c01(0x154)]),console[_0x313c01(0x115)](a27_0x5dfa1a[_0x313c01(0x1a3)]('✔\x20Context\x20set:\x20'+a27_0x5dfa1a['dim'](_0x313c01(0x15c))+_0x313c01(0x1a7)+a27_0x5dfa1a[_0x313c01(0x20b)](_0x1a337d))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x1c5);[a27_0x354a54(0x1bf)]='Show\x20journey\x20table\x20column\x20mapping';async['execute'](_0x3b4f75){const _0x57591e=a27_0x354a54,{options:_0x515d4c,args:_0x5d9e4d,tdx:_0x1958c6}=_0x3b4f75,_0x5aa7f4=_0x5d9e4d[0x0];if(!requireNameOrPath(_0x5aa7f4))return 0x1;_0x515d4c[_0x57591e(0x125)]&&console['error'](_0x57591e(0x113)+_0x5aa7f4);const {journeyId:_0x532e6b}=await resolveJourneyIdFromInput(_0x5aa7f4,_0x515d4c,_0x1958c6),_0x2cd468=await withSpinner('Getting\x20column\x20mapping...',()=>_0x1958c6[_0x57591e(0x14d)][_0x57591e(0xf4)](_0x532e6b),{'verbose':_0x515d4c['verbose']}),_0x59f3e1=_0x2cd468[_0x57591e(0x1c3)];return console[_0x57591e(0xf8)](_0x57591e(0x1f9)+_0x59f3e1[_0x57591e(0x117)]),console[_0x57591e(0xf8)]('Table:\x20'+_0x59f3e1['table']),await handleSDKOutput(_0x59f3e1[_0x57591e(0x203)],_0x515d4c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a27_0x354a54(0x1bf)]=a27_0x354a54(0x1bb);async['execute'](_0x54f361){const _0x1c366e=a27_0x354a54,{options:_0x33c2a3,args:_0x227139,tdx:_0x524aab}=_0x54f361,_0x58420a=_0x227139[0x0];if(!requireNameOrPath(_0x58420a))return 0x1;_0x33c2a3[_0x1c366e(0x125)]&&console[_0x1c366e(0x115)](_0x1c366e(0x113)+_0x58420a);const {journeyId:_0x471936}=await resolveJourneyIdFromInput(_0x58420a,_0x33c2a3,_0x524aab),_0x5119ac=await withSpinner('Listing\x20journey\x20activations...',()=>_0x524aab[_0x1c366e(0x14d)][_0x1c366e(0x12e)](_0x471936),{'verbose':_0x33c2a3[_0x1c366e(0x125)]}),_0x546a90=_0x5119ac['data'];return console['error'](_0x1c366e(0x122)+_0x546a90['length']+_0x1c366e(0x112)+(_0x546a90['length']!==0x1?'s':'')),await handleSDKOutput(_0x546a90,_0x33c2a3),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x1a8);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x137);[a27_0x354a54(0x1ce)]=new SegmentPushCommand();async[a27_0x354a54(0x138)](_0x2f05a9){const _0x262029=a27_0x354a54,_0x3c8607=_0x2f05a9[_0x262029(0x1e3)][0x0];let _0x2d4c07;if(_0x3c8607){const _0x4611ec=await resolveTarget({'arg':_0x3c8607,'contextParent':_0x2f05a9[_0x262029(0x176)]['parentSegment'],'cwd':process['cwd']()});isSuccessfulResolution(_0x4611ec)&&_0x4611ec[_0x262029(0x12a)]==='file'&&(_0x2d4c07=_0x4611ec[_0x262029(0x180)]);}const _0x1b5ae3={..._0x2f05a9,'options':{..._0x2f05a9[_0x262029(0x176)],'journeysOnly':!![],..._0x2d4c07&&{'singleFilePath':_0x2d4c07}}};return this[_0x262029(0x1ce)][_0x262029(0x138)](_0x1b5ae3);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x156);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x19d);async[a27_0x354a54(0x138)](_0x13f668){const _0x5edd0c=a27_0x354a54,{options:_0x4bd55c,args:_0x17d131,tdx:_0x236b50}=_0x13f668,_0x518219=_0x17d131[0x0];if(!requireNameOrPath(_0x518219))return 0x1;if(_0x4bd55c['verbose'])console[_0x5edd0c(0x115)]('Input:\x20'+_0x518219);const {journeyId:_0x2df839}=await resolveJourneyIdFromInput(_0x518219,_0x4bd55c,_0x236b50),_0x118cc2=await withSpinner('Listing\x20journey\x20versions...',()=>_0x236b50[_0x5edd0c(0x14d)]['listVersions'](_0x2df839),{'verbose':_0x4bd55c[_0x5edd0c(0x125)]}),{bundleName:_0x308029,versions:_0x57bec1,latestJourneyId:_0x2ef940}=_0x118cc2[_0x5edd0c(0x1c3)];console[_0x5edd0c(0x115)](_0x308029+':\x20'+_0x57bec1[_0x5edd0c(0x13d)]+_0x5edd0c(0x1e8)+(_0x57bec1[_0x5edd0c(0x13d)]!==0x1?'s':''));const _0x487edc=_0x57bec1['map'](_0x1ba13d=>({'version':_0x1ba13d['versionNumber'],'journey_id':_0x1ba13d['journeyId'],'name':_0x1ba13d[_0x5edd0c(0x12f)],'state':_0x1ba13d[_0x5edd0c(0x1a0)],'paused':_0x1ba13d[_0x5edd0c(0x131)],'latest':_0x1ba13d[_0x5edd0c(0x100)]===_0x2ef940,'created_at':_0x1ba13d[_0x5edd0c(0x143)]}));return await handleSDKOutput(_0x487edc,_0x4bd55c),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x16f);[a27_0x354a54(0x1bf)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x354a54(0x138)](_0x20ea5d){const _0xa8bc66=a27_0x354a54,{options:_0x56c2c5,args:_0x576525,tdx:_0x18d6f7}=_0x20ea5d,_0x492d68=_0x576525[0x0];if(!requireNameOrPath(_0x492d68))return 0x1;if(_0x56c2c5[_0xa8bc66(0x125)])console[_0xa8bc66(0x115)](_0xa8bc66(0x113)+_0x492d68);const {journeyId:_0x266f96,journeyName:_0x58f18d}=await resolveJourneyIdFromInput(_0x492d68,_0x56c2c5,_0x18d6f7);if(!_0x56c2c5[_0xa8bc66(0x139)]){const _0xf094a4=await confirm(_0xa8bc66(0x1a6)+_0x58f18d+'\x22?');if(!_0xf094a4)return console[_0xa8bc66(0x115)](_0xa8bc66(0x13f)),0x0;}const _0x5a620f=await withSpinner(_0xa8bc66(0x1b5),()=>_0x18d6f7['journey'][_0xa8bc66(0x142)](_0x266f96),{'verbose':_0x56c2c5['verbose']}),_0x457d0f=_0x5a620f[_0xa8bc66(0x1c3)];return console[_0xa8bc66(0x115)](a27_0x5dfa1a[_0xa8bc66(0x1a3)]('✔')+_0xa8bc66(0x116)+_0x457d0f['attributes'][_0xa8bc66(0x150)]+'\x20(draft)\x20—\x20\x22'+_0x457d0f['attributes'][_0xa8bc66(0x12f)]+'\x22'),console[_0xa8bc66(0x115)](_0xa8bc66(0x105)+_0x457d0f['id']),await handleSingleObjectOutput({'id':_0x457d0f['id'],'name':_0x457d0f[_0xa8bc66(0x17e)][_0xa8bc66(0x12f)],'version':_0x457d0f[_0xa8bc66(0x17e)][_0xa8bc66(0x150)],'state':_0x457d0f[_0xa8bc66(0x17e)]['state'],'bundle_id':_0x457d0f[_0xa8bc66(0x17e)][_0xa8bc66(0x10b)],'created_at':_0x457d0f[_0xa8bc66(0x17e)][_0xa8bc66(0x143)]},_0x56c2c5),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x354a54(0x12f)]=a27_0x354a54(0x183);[a27_0x354a54(0x1bf)]=a27_0x354a54(0x182);async[a27_0x354a54(0x138)](_0x332ed9){const _0x384c08=a27_0x354a54,{options:_0x27ec7b,args:_0x20b8fd,tdx:_0x39b05b}=_0x332ed9,_0x492741=_0x20b8fd[0x0];if(!requireNameOrPath(_0x492741))return 0x1;const _0x553112=_0x27ec7b['version'];if(!_0x553112)return console[_0x384c08(0x115)](_0x384c08(0x1b7)),console[_0x384c08(0x115)](_0x384c08(0x1f3)),0x1;const _0x28a03=parseInt(_0x553112,0xa);if(isNaN(_0x28a03)||_0x28a03<0x1)return console[_0x384c08(0x115)](_0x384c08(0x199)+_0x553112),0x1;if(_0x27ec7b[_0x384c08(0x125)])console['error'](_0x384c08(0x113)+_0x492741+_0x384c08(0x127)+_0x28a03);const {journeyId:_0x1818e1,parentSegmentId:_0xb188be}=await resolveJourneyIdFromInput(_0x492741,_0x27ec7b,_0x39b05b),_0x5a87f6=await withSpinner('Resolving\x20version...',()=>_0x39b05b[_0x384c08(0x14d)][_0x384c08(0x174)](_0x1818e1),{'verbose':_0x27ec7b[_0x384c08(0x125)]}),{versions:_0xf4350f,latestJourneyId:_0x40b481}=_0x5a87f6[_0x384c08(0x1c3)],_0x3f1520=_0xf4350f[_0x384c08(0x196)](_0xcb055=>_0xcb055[_0x384c08(0x150)]===_0x28a03);if(!_0x3f1520){const _0x58e10d=_0xf4350f[_0x384c08(0x17f)](_0x4d7ea0=>'v'+_0x4d7ea0[_0x384c08(0x150)])[_0x384c08(0x151)](',\x20');return console[_0x384c08(0x115)](_0x384c08(0x18c)+_0x28a03+'\x20not\x20found.\x20Available:\x20'+_0x58e10d),0x1;}const _0x2c733e=await withSpinner(_0x384c08(0x1ab)+_0x28a03+_0x384c08(0x13c),()=>_0x39b05b[_0x384c08(0x14d)][_0x384c08(0xf3)](_0x3f1520[_0x384c08(0x100)]),{'verbose':_0x27ec7b[_0x384c08(0x125)]}),_0x50ef77=_0x2c733e[_0x384c08(0x1c3)],_0x4256c7=getConsoleNextUrl(_0x27ec7b[_0x384c08(0x1f1)],_0x384c08(0x1dd)+_0xb188be+_0x384c08(0x16e)+_0x3f1520['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x50ef77['id'],'name':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x12f)],'version':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x150)],'description':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1bf)],'state':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1a0)],'paused':_0x50ef77['attributes'][_0x384c08(0x131)],'reentry_mode':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x19e)],'stages':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1de)]?.[_0x384c08(0x13d)]||0x0,..._0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1e5)]&&{'goal':_0x50ef77[_0x384c08(0x17e)][_0x384c08(0x1e5)][_0x384c08(0x12f)]},'latest':_0x3f1520[_0x384c08(0x100)]===_0x40b481,'created_at':_0x50ef77['attributes'][_0x384c08(0x143)],'updated_at':_0x50ef77[_0x384c08(0x17e)]['updatedAt'],'url':_0x4256c7},_0x27ec7b),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a28_0x40aab8=a28_0x1d70;(function(_0x1cf2ec,_0xf165e0){const _0x3fde35=a28_0x1d70,_0x4cbcc4=_0x1cf2ec();while(!![]){try{const _0x520804=parseInt(_0x3fde35(0x119))/0x1+parseInt(_0x3fde35(0x13b))/0x2+-parseInt(_0x3fde35(0x125))/0x3*(-parseInt(_0x3fde35(0x11d))/0x4)+-parseInt(_0x3fde35(0x126))/0x5+-parseInt(_0x3fde35(0x129))/0x6+parseInt(_0x3fde35(0x117))/0x7*(parseInt(_0x3fde35(0x13c))/0x8)+parseInt(_0x3fde35(0x12f))/0x9*(-parseInt(_0x3fde35(0x11e))/0xa);if(_0x520804===_0xf165e0)break;else _0x4cbcc4['push'](_0x4cbcc4['shift']());}catch(_0x47ab82){_0x4cbcc4['push'](_0x4cbcc4['shift']());}}}(a28_0x27a9,0x26ad9));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1d70(_0x467324,_0x2f4f96){_0x467324=_0x467324-0x115;const _0x27a942=a28_0x27a9();let _0x1d70ca=_0x27a942[_0x467324];return _0x1d70ca;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x9706e2 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0x27a9(){const _0x4e431f=['reason','\x20segment\x20file(s)\x20skipped','type','Error:\x20','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','valid','helpText','\x20segment\x20file(s)\x20skipped)','skippedCount','execute','✔\x20All\x20','\x20(skipped:\x20','filter','log','\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','endsWith','targetDir','614201xfclAl','invalidCount','107741MtwGpT','errors','error','No\x20journey\x20YAML\x20files\x20found\x20in\x20','884ubJoKU','5660akbtjX','yellow','file','verbose','.yml','\x20valid','description','2979UVoabn','1434420OQLRuo','red','message','52908TYEeAG','hasErrors','Validate\x20journey\x20YAML\x20files','\x20warning(s)\x20found','parentSegment','warningCount','3375HCmqJC','errorCode','journey','length','\x20journey(s)\x20valid','warnings','name','\x20journey(s)\x20with\x20errors,\x20','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','relativePath','\x20warning(s)','327394OzvRPG','16mVyqaY','no_parent','Error:\x20Directory\x20not\x20found:\x20','dim','.yaml'];a28_0x27a9=function(){return _0x4e431f;};return a28_0x27a9();}export class JourneyValidateCommand extends BaseCommand{[a28_0x40aab8(0x135)]='journey:validate';[a28_0x40aab8(0x124)]=a28_0x40aab8(0x12b);async[a28_0x40aab8(0x14a)](_0x23033d){const _0x13da5d=a28_0x40aab8,{options:_0x2e3ee1,args:_0x53d8b9}=_0x23033d,_0x2258b4=_0x2e3ee1,_0x9d8b=await resolveTarget({'arg':_0x53d8b9[0x0],'contextParent':_0x2e3ee1[_0x13da5d(0x12d)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x9d8b))return _0x9d8b[_0x13da5d(0x130)]===_0x13da5d(0x13d)?(console[_0x13da5d(0x11b)](a28_0x9706e2[_0x13da5d(0x11f)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x13da5d(0x11b)](_0x13da5d(0x145)),console['error'](_0x13da5d(0x14f)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x13da5d(0x11b)](a28_0x9706e2[_0x13da5d(0x127)](_0x13da5d(0x144)+_0x9d8b[_0x13da5d(0x128)]+'\x0a')),_0x9d8b['helpText']&&console['error'](a28_0x9706e2[_0x13da5d(0x137)](_0x9d8b[_0x13da5d(0x147)]))),0x1;const _0x3774cf=_0x9d8b[_0x13da5d(0x116)],_0x5a7497=_0x9d8b[_0x13da5d(0x143)]===_0x13da5d(0x120)?_0x9d8b['filePath']:undefined;if(!_0x5a7497&&!existsSync(_0x3774cf))return console['error'](a28_0x9706e2[_0x13da5d(0x127)](_0x13da5d(0x13e)+_0x3774cf+'\x0a')),0x1;let _0x500f42;if(_0x5a7497){if(!_0x5a7497[_0x13da5d(0x115)](_0x13da5d(0x122))&&!_0x5a7497[_0x13da5d(0x115)](_0x13da5d(0x140)))return console[_0x13da5d(0x11b)](a28_0x9706e2[_0x13da5d(0x127)](_0x13da5d(0x138)+_0x5a7497+'\x0a')),0x1;_0x500f42=[_0x5a7497];}else _0x500f42=findYamlFiles(_0x3774cf);if(_0x500f42[_0x13da5d(0x132)]===0x0)return console[_0x13da5d(0x11b)](a28_0x9706e2['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x3774cf+'\x0a')),0x1;const _0x3c2a8d=validateYamlFiles(_0x500f42,_0x3774cf,{'filterType':_0x13da5d(0x131)}),_0x4ea3dc=calculateSummary(_0x3c2a8d),_0x5eb8f0=_0x3c2a8d[_0x13da5d(0x14d)](isValidationResult);if(_0x5eb8f0[_0x13da5d(0x132)]===0x0)return console[_0x13da5d(0x11b)](a28_0x9706e2[_0x13da5d(0x11f)](_0x13da5d(0x11c)+_0x3774cf+'\x0a')),_0x4ea3dc[_0x13da5d(0x149)]>0x0&&console['error'](a28_0x9706e2[_0x13da5d(0x13f)]('('+_0x4ea3dc[_0x13da5d(0x149)]+_0x13da5d(0x148))),0x0;for(const _0x3c28e8 of _0x3c2a8d){if(!isValidationResult(_0x3c28e8)){_0x2258b4[_0x13da5d(0x121)]&&console[_0x13da5d(0x14e)](a28_0x9706e2[_0x13da5d(0x13f)]('-\x20'+_0x3c28e8[_0x13da5d(0x139)]+_0x13da5d(0x14c)+_0x3c28e8[_0x13da5d(0x141)]+')'));continue;}const {relativePath:_0x7199f9,source:_0x3896fa,result:_0x3da4ce}=_0x3c28e8;if(_0x3da4ce['valid']&&_0x3da4ce[_0x13da5d(0x134)][_0x13da5d(0x132)]===0x0)_0x2258b4[_0x13da5d(0x121)]&&console[_0x13da5d(0x14e)](a28_0x9706e2['green']('✔\x20'+_0x7199f9));else _0x3da4ce[_0x13da5d(0x146)]?(console[_0x13da5d(0x14e)](a28_0x9706e2[_0x13da5d(0x11f)]('⚠\x20'+_0x7199f9+':\x20'+_0x3da4ce[_0x13da5d(0x134)][_0x13da5d(0x132)]+_0x13da5d(0x13a))),console[_0x13da5d(0x14e)](formatValidationResult(_0x3da4ce,_0x3896fa,_0x7199f9))):(console[_0x13da5d(0x14e)](a28_0x9706e2['red']('✖\x20'+_0x7199f9+':\x20'+_0x3da4ce[_0x13da5d(0x11a)]['length']+'\x20error(s)')),console[_0x13da5d(0x14e)](formatValidationResult(_0x3da4ce,_0x3896fa,_0x7199f9)));}return console['log'](''),_0x4ea3dc[_0x13da5d(0x12a)]?(console[_0x13da5d(0x14e)](a28_0x9706e2[_0x13da5d(0x127)]('Validation\x20failed:\x20'+_0x4ea3dc[_0x13da5d(0x118)]+_0x13da5d(0x136)+_0x4ea3dc['validCount']+_0x13da5d(0x123))),_0x4ea3dc[_0x13da5d(0x12e)]>0x0&&console[_0x13da5d(0x14e)](a28_0x9706e2['yellow'](_0x4ea3dc[_0x13da5d(0x12e)]+_0x13da5d(0x12c))),_0x4ea3dc['skippedCount']>0x0&&console[_0x13da5d(0x14e)](a28_0x9706e2['dim'](_0x4ea3dc['skippedCount']+_0x13da5d(0x142))),0x1):(console[_0x13da5d(0x14e)](a28_0x9706e2['green'](_0x13da5d(0x14b)+_0x4ea3dc['validCount']+_0x13da5d(0x133))),_0x4ea3dc[_0x13da5d(0x12e)]>0x0&&console[_0x13da5d(0x14e)](a28_0x9706e2['yellow'](_0x4ea3dc[_0x13da5d(0x12e)]+_0x13da5d(0x12c))),_0x4ea3dc[_0x13da5d(0x149)]>0x0&&console['log'](a28_0x9706e2[_0x13da5d(0x13f)](_0x4ea3dc[_0x13da5d(0x149)]+_0x13da5d(0x142))),0x0);}}
|