@treasuredata/tdx 2026.3.55 → 2026.4.1
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.d.ts.map +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/file-discovery.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a25_0x15bd0b=a25_0x479a;(function(_0xf090e9,_0x1da1a3){const _0x232a4f=a25_0x479a,_0x541ca7=_0xf090e9();while(!![]){try{const _0x4fdba4=parseInt(_0x232a4f(0x9e))/0x1*(parseInt(_0x232a4f(0x8c))/0x2)+-parseInt(_0x232a4f(0x87))/0x3*(-parseInt(_0x232a4f(0x97))/0x4)+-parseInt(_0x232a4f(0x92))/0x5*(parseInt(_0x232a4f(0x90))/0x6)+-parseInt(_0x232a4f(0xa9))/0x7*(-parseInt(_0x232a4f(0x85))/0x8)+parseInt(_0x232a4f(0x7a))/0x9*(parseInt(_0x232a4f(0x89))/0xa)+-parseInt(_0x232a4f(0x77))/0xb*(parseInt(_0x232a4f(0xa7))/0xc)+-parseInt(_0x232a4f(0x94))/0xd*(parseInt(_0x232a4f(0x7c))/0xe);if(_0x4fdba4===_0x1da1a3)break;else _0x541ca7['push'](_0x541ca7['shift']());}catch(_0x16f1b9){_0x541ca7['push'](_0x541ca7['shift']());}}}(a25_0x35e4,0x1fbd2));function a25_0x35e4(){const _0x1166df=['175734uaiPyC','length','56BuvpBo','valid','validCount','green','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20Directory\x20not\x20found:\x20','filter','execute','cwd','3568nZVXCv','\x20error(s)','279504sfcbdh','Validate\x20template\x20YAML\x20files','50euuCcB','reason','template','44jUJMJc','.yaml','Validation\x20failed:\x20','\x20(skipped:\x20','14022GlkbBy','endsWith','245fCvwgJ','name','188006wymlgO','yellow','dirname','8HDYEAQ','\x20non-template\x20file(s)\x20skipped','relativePath','error','hasErrors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20template(s)\x20with\x20errors,\x20','1571OAPKbK','engage:template:validate','.yml','\x20warning(s)','dim','\x20warning(s)\x20found','verbose','warningCount','✔\x20All\x20','1151988WYSQlP','skippedCount','1253IsvrZY','red','11xyjYGQ','warnings','log'];a25_0x35e4=function(){return _0x1166df;};return a25_0x35e4();}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x348617 from'chalk';function a25_0x479a(_0x15b104,_0x13c788){_0x15b104=_0x15b104-0x77;const _0x35e4c1=a25_0x35e4();let _0x479a4a=_0x35e4c1[_0x15b104];return _0x479a4a;}import a25_0x5bf09e 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_0x15bd0b(0x93)]=a25_0x15bd0b(0x9f);['description']=a25_0x15bd0b(0x88);async[a25_0x15bd0b(0x83)](_0x146ae){const _0x42c18c=a25_0x15bd0b,{options:_0x2ddfc7,args:_0x1d4162}=_0x146ae,_0x3df754=_0x2ddfc7,_0x24091c=_0x1d4162[0x0],_0x78ea0c=_0x24091c?a25_0x5bf09e['resolve'](_0x24091c):undefined,_0x3f06c3=_0x78ea0c?isYamlFile(_0x78ea0c):![];let _0x4caec7,_0x158764;if(_0x3f06c3&&_0x78ea0c)_0x4caec7=a25_0x5bf09e[_0x42c18c(0x96)](_0x78ea0c),_0x158764=_0x78ea0c;else _0x78ea0c?_0x4caec7=_0x78ea0c:_0x4caec7=process[_0x42c18c(0x84)]();if(!_0x158764&&!existsSync(_0x4caec7))return console['error'](a25_0x348617[_0x42c18c(0xaa)](_0x42c18c(0x81)+_0x4caec7+'\x0a')),0x1;let _0x58c702;if(_0x158764){if(!_0x158764['endsWith'](_0x42c18c(0xa0))&&!_0x158764[_0x42c18c(0x91)](_0x42c18c(0x8d)))return console['error'](a25_0x348617['red'](_0x42c18c(0x80)+_0x158764+'\x0a')),0x1;_0x58c702=[_0x158764];}else _0x58c702=findYamlFiles(_0x4caec7);if(_0x58c702[_0x42c18c(0x7b)]===0x0)return console[_0x42c18c(0x9a)](a25_0x348617[_0x42c18c(0xaa)](_0x42c18c(0x9c)+_0x4caec7+'\x0a')),0x1;const _0x224e3c=validateYamlFiles(_0x58c702,_0x4caec7,{'filterType':_0x42c18c(0x8b)}),_0xd5201c=calculateSummary(_0x224e3c),_0x2d5c6c=_0x224e3c[_0x42c18c(0x82)](isValidationResult);if(_0x2d5c6c[_0x42c18c(0x7b)]===0x0)return console[_0x42c18c(0x9a)](a25_0x348617[_0x42c18c(0x95)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x4caec7+'\x0a')),_0xd5201c[_0x42c18c(0xa8)]>0x0&&console[_0x42c18c(0x9a)](a25_0x348617[_0x42c18c(0xa2)]('('+_0xd5201c[_0x42c18c(0xa8)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x404f02 of _0x224e3c){if(!isValidationResult(_0x404f02)){_0x3df754[_0x42c18c(0xa4)]&&console[_0x42c18c(0x79)](a25_0x348617['dim']('-\x20'+_0x404f02[_0x42c18c(0x99)]+_0x42c18c(0x8f)+_0x404f02[_0x42c18c(0x8a)]+')'));continue;}const {relativePath:_0x13a4a9,source:_0xd48b0e,result:_0x2f5bc5}=_0x404f02;if(_0x2f5bc5[_0x42c18c(0x7d)]&&_0x2f5bc5[_0x42c18c(0x78)][_0x42c18c(0x7b)]===0x0)_0x3df754[_0x42c18c(0xa4)]&&console['log'](a25_0x348617[_0x42c18c(0x7f)]('✔\x20'+_0x13a4a9));else _0x2f5bc5[_0x42c18c(0x7d)]?(console[_0x42c18c(0x79)](a25_0x348617[_0x42c18c(0x95)]('⚠\x20'+_0x13a4a9+':\x20'+_0x2f5bc5[_0x42c18c(0x78)]['length']+_0x42c18c(0xa1))),console[_0x42c18c(0x79)](formatValidationResult(_0x2f5bc5,_0xd48b0e,_0x13a4a9))):(console['log'](a25_0x348617[_0x42c18c(0xaa)]('✖\x20'+_0x13a4a9+':\x20'+_0x2f5bc5['errors'][_0x42c18c(0x7b)]+_0x42c18c(0x86))),console[_0x42c18c(0x79)](formatValidationResult(_0x2f5bc5,_0xd48b0e,_0x13a4a9)));}return console['log'](''),_0xd5201c[_0x42c18c(0x9b)]?(console[_0x42c18c(0x79)](a25_0x348617[_0x42c18c(0xaa)](_0x42c18c(0x8e)+_0xd5201c['invalidCount']+_0x42c18c(0x9d)+_0xd5201c[_0x42c18c(0x7e)]+'\x20valid')),_0xd5201c[_0x42c18c(0xa5)]>0x0&&console['log'](a25_0x348617[_0x42c18c(0x95)](_0xd5201c[_0x42c18c(0xa5)]+'\x20warning(s)\x20found')),_0xd5201c[_0x42c18c(0xa8)]>0x0&&console[_0x42c18c(0x79)](a25_0x348617['dim'](_0xd5201c[_0x42c18c(0xa8)]+_0x42c18c(0x98))),0x1):(console[_0x42c18c(0x79)](a25_0x348617[_0x42c18c(0x7f)](_0x42c18c(0xa6)+_0xd5201c[_0x42c18c(0x7e)]+'\x20template(s)\x20valid')),_0xd5201c['warningCount']>0x0&&console[_0x42c18c(0x79)](a25_0x348617['yellow'](_0xd5201c['warningCount']+_0x42c18c(0xa3))),_0xd5201c[_0x42c18c(0xa8)]>0x0&&console[_0x42c18c(0x79)](a25_0x348617['dim'](_0xd5201c[_0x42c18c(0xa8)]+_0x42c18c(0x98))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x38cb67=a26_0x11d9;(function(_0x26c6ff,_0x1f91b7){const _0x1d1755=a26_0x11d9,_0x1e6d6b=_0x26c6ff();while(!![]){try{const _0x5a4cfc=-parseInt(_0x1d1755(0x220))/0x1+parseInt(_0x1d1755(0x20d))/0x2+parseInt(_0x1d1755(0x21a))/0x3+-parseInt(_0x1d1755(0x228))/0x4+-parseInt(_0x1d1755(0x209))/0x5*(-parseInt(_0x1d1755(0x1ed))/0x6)+-parseInt(_0x1d1755(0x225))/0x7*(parseInt(_0x1d1755(0x1d6))/0x8)+-parseInt(_0x1d1755(0x20e))/0x9*(-parseInt(_0x1d1755(0x1eb))/0xa);if(_0x5a4cfc===_0x1f91b7)break;else _0x1e6d6b['push'](_0x1e6d6b['shift']());}catch(_0x3a825c){_0x1e6d6b['push'](_0x1e6d6b['shift']());}}}(a26_0x2f7c,0x37e3d));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_0x11d9(_0x1228e6,_0x38724b){_0x1228e6=_0x1228e6-0x1cf;const _0x2f7c7f=a26_0x2f7c();let _0x11d9ac=_0x2f7c7f[_0x1228e6];return _0x11d9ac;}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3afaeb from'chalk';function formatDuration(_0x49a9f8){const _0x4491f8=a26_0x11d9;if(_0x49a9f8<0x3c)return _0x49a9f8+'s';if(_0x49a9f8<0xe10)return Math[_0x4491f8(0x223)](_0x49a9f8/0x3c)+'m\x20'+_0x49a9f8%0x3c+'s';const _0x477e86=Math[_0x4491f8(0x223)](_0x49a9f8/0xe10),_0x823843=Math['floor'](_0x49a9f8%0xe10/0x3c);return _0x823843>0x0?_0x477e86+'h\x20'+_0x823843+'m':_0x477e86+'h';}function a26_0x2f7c(){const _0x2c356f=['presto','error','kill','Job\x20type:\x20','type','INVALID_ARGUMENT','length','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','1032726JVInrv','Listing\x20jobs...','hive','round','red','job_id','172334JIdLoJ','green','push','floor','validate','19908lEShKc','Database:\x20','priority','172072lSGKWP','\x20row','getTime','log','mo\x20ago','show','data','args','1224gpuWfz','query','✔\x20Retrieved\x20','now','substring','...','job:submit','jobs','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','yes','verbose','Getting\x20job\x20details...','h\x20ago','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job:result','status','dim','\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Query:\x20','database','10tykgeX','Submit\x20a\x20job','30FhpWSz','execute','limit','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','map','name','join','information_schema','Status\x20filter:\x20','start_at','\x20\x20Job\x20ID:\x20','job:show','trino','No\x20SQL\x20statements\x20found\x20in\x20file','end_at','\x20jobs','Getting\x20job\x20results...','\x27\x20to\x20verify\x20the\x20job\x20status','url','description','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','file','result','user_name','jobType','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job:kill','debug','146085QrsBrr','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','List\x20jobs','abs','415468VwNheI','1632132YCmjBP','d\x20ago','created_at','m\x20ago'];a26_0x2f7c=function(){return _0x2c356f;};return a26_0x2f7c();}function formatRelativeTime(_0x3c2a42){const _0x2b8892=a26_0x11d9,_0x4c5761=Date[_0x2b8892(0x1d9)]()-_0x3c2a42[_0x2b8892(0x1d0)](),_0x31a642=Math[_0x2b8892(0x223)](Math[_0x2b8892(0x20c)](_0x4c5761)/0x3e8);if(_0x31a642<0x3c)return'just\x20now';const _0x4c46ce=Math[_0x2b8892(0x223)](_0x31a642/0x3c);if(_0x4c46ce<0x3c)return _0x4c46ce+_0x2b8892(0x211);const _0x2b089c=Math[_0x2b8892(0x223)](_0x4c46ce/0x3c);if(_0x2b089c<0x18)return _0x2b089c+_0x2b8892(0x1e2);const _0x348893=Math[_0x2b8892(0x223)](_0x2b089c/0x18);if(_0x348893<0x1e)return _0x348893+_0x2b8892(0x20f);return Math[_0x2b8892(0x223)](_0x348893/0x1e)+_0x2b8892(0x1d2);}export class JobListCommand extends BaseCommand{[a26_0x38cb67(0x1f2)]=a26_0x38cb67(0x1dd);[a26_0x38cb67(0x200)]=a26_0x38cb67(0x20b);async[a26_0x38cb67(0x1ee)](_0x4749d2){const _0x47f8d0=a26_0x38cb67,{options:_0x3e4771,tdx:_0x33a758}=_0x4749d2,_0x471f94=resolveLimit(_0x3e4771[_0x47f8d0(0x1ef)],DEFAULT_DISPLAY_LIMIT),_0x5c0df0=_0x3e4771[_0x47f8d0(0x1e5)];_0x3e4771['verbose']&&(console[_0x47f8d0(0x213)]('Limit:\x20'+_0x471f94+_0x47f8d0(0x1fc)),_0x5c0df0&&console[_0x47f8d0(0x213)](_0x47f8d0(0x1f5)+_0x5c0df0));const _0x52e903=await withSpinner(_0x47f8d0(0x21b),()=>_0x33a758['jobs']['list']({'from':0x0,'to':_0x471f94-0x1,'status':_0x5c0df0}),{'verbose':_0x3e4771[_0x47f8d0(0x1e0)]}),_0x477d6d=_0x52e903[_0x47f8d0(0x1d4)];console[_0x47f8d0(0x213)]('✔\x20Found\x20'+_0x477d6d['length']+_0x47f8d0(0x1e7)+(_0x477d6d[_0x47f8d0(0x218)]!==0x1?'s':''));const _0x63e844=_0x3e4771['site'];if(isStructuredFormat(_0x3e4771)){const _0x36863f=_0x477d6d[_0x47f8d0(0x1f1)](_0x544131=>{const _0x17efaa=_0x47f8d0;let _0xaed71;if(_0x544131['start_at']&&_0x544131[_0x17efaa(0x1fb)]){const _0x39d3e2=new Date(_0x544131['start_at'])[_0x17efaa(0x1d0)](),_0x360394=new Date(_0x544131[_0x17efaa(0x1fb)])[_0x17efaa(0x1d0)]();_0xaed71=Math[_0x17efaa(0x21d)]((_0x360394-_0x39d3e2)/0x3e8);}return{'job_id':_0x544131[_0x17efaa(0x21f)],'type':_0x544131[_0x17efaa(0x216)]===_0x17efaa(0x212)?'trino':_0x544131['type'],'status':_0x544131[_0x17efaa(0x1e5)],'user_name':_0x544131['user_name'],'duration_sec':_0xaed71,'created_at':_0x544131[_0x17efaa(0x210)],'started_at':_0x544131[_0x17efaa(0x1f6)],'end_at':_0x544131[_0x17efaa(0x1fb)]};});await handleSDKOutput(_0x36863f,_0x3e4771);}else for(const _0x356ca4 of _0x477d6d){const _0x529984=_0x356ca4[_0x47f8d0(0x1e5)]==='success'?a26_0x3afaeb[_0x47f8d0(0x221)]:_0x356ca4[_0x47f8d0(0x1e5)]===_0x47f8d0(0x213)?a26_0x3afaeb[_0x47f8d0(0x21e)]:a26_0x3afaeb['dim'],_0x5f5c88=_0x529984(_0x356ca4[_0x47f8d0(0x1e5)]),_0x4a5253=getJobUrl(_0x63e844,_0x356ca4[_0x47f8d0(0x21f)]),_0x356c08=hyperlink(_0x356ca4['job_id'],_0x4a5253),_0x3c165b=a26_0x3afaeb[_0x47f8d0(0x1e6)](_0x356ca4[_0x47f8d0(0x216)]===_0x47f8d0(0x212)?_0x47f8d0(0x1f9):_0x356ca4[_0x47f8d0(0x216)]),_0x475439=[];if(_0x356ca4[_0x47f8d0(0x1f6)]&&_0x356ca4[_0x47f8d0(0x1fb)]){const _0x1d8842=Math[_0x47f8d0(0x21d)]((new Date(_0x356ca4[_0x47f8d0(0x1fb)])[_0x47f8d0(0x1d0)]()-new Date(_0x356ca4[_0x47f8d0(0x1f6)])[_0x47f8d0(0x1d0)]())/0x3e8);_0x475439['push'](formatDuration(_0x1d8842));}if(_0x356ca4[_0x47f8d0(0x1fb)])_0x475439[_0x47f8d0(0x222)](formatRelativeTime(new Date(_0x356ca4[_0x47f8d0(0x1fb)])));else _0x356ca4[_0x47f8d0(0x1f6)]&&_0x475439[_0x47f8d0(0x222)](formatRelativeTime(new Date(_0x356ca4[_0x47f8d0(0x1f6)])));const _0x25ba62=_0x475439[_0x47f8d0(0x218)]>0x0?a26_0x3afaeb[_0x47f8d0(0x1e6)]('\x20'+_0x475439[_0x47f8d0(0x1f3)](',\x20')):'';console[_0x47f8d0(0x1d1)]('⚡\x20'+_0x356c08+'\x20'+_0x3c165b+'\x20'+_0x5f5c88+_0x25ba62);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x38cb67(0x1f8);[a26_0x38cb67(0x200)]='Show\x20job\x20details';[a26_0x38cb67(0x224)](_0x1ca205){const _0x36bc01=a26_0x38cb67,_0x270e46=_0x1ca205[_0x36bc01(0x1d5)][0x0];if(!_0x270e46)return _0x36bc01(0x201);return undefined;}async[a26_0x38cb67(0x1ee)](_0x581272){const _0x113a0a=a26_0x38cb67,{options:_0x1b9d23,args:_0x3865e5,tdx:_0x22316e}=_0x581272,_0x59cbce=_0x3865e5[0x0],_0x41c0ed=await withSpinner(_0x113a0a(0x1e1),()=>_0x22316e[_0x113a0a(0x1dd)][_0x113a0a(0x1d3)](_0x59cbce),{'verbose':_0x1b9d23['verbose']}),_0x24522a=_0x41c0ed['data'];let _0x239421;if(_0x24522a[_0x113a0a(0x1f6)]&&_0x24522a[_0x113a0a(0x1fb)]){const _0x2bab6c=new Date(_0x24522a['start_at'])['getTime'](),_0x1cfaf2=new Date(_0x24522a[_0x113a0a(0x1fb)])[_0x113a0a(0x1d0)]();_0x239421=Math['round']((_0x1cfaf2-_0x2bab6c)/0x3e8);}const _0x4c932a={'job_id':_0x24522a[_0x113a0a(0x21f)],'type':_0x24522a['type'],'status':_0x24522a['status'],..._0x24522a[_0x113a0a(0x204)]&&{'user_name':_0x24522a[_0x113a0a(0x204)]},..._0x239421!==undefined&&{'duration_sec':_0x239421},..._0x24522a[_0x113a0a(0x210)]&&{'created_at':_0x24522a[_0x113a0a(0x210)]},..._0x24522a[_0x113a0a(0x1f6)]&&{'started_at':_0x24522a[_0x113a0a(0x1f6)]},..._0x24522a[_0x113a0a(0x1fb)]&&{'end_at':_0x24522a[_0x113a0a(0x1fb)]},..._0x24522a[_0x113a0a(0x1ea)]&&{'database':_0x24522a['database']},..._0x24522a[_0x113a0a(0x227)]!==undefined&&{'priority':_0x24522a[_0x113a0a(0x227)]},..._0x24522a[_0x113a0a(0x1ff)]&&{'url':_0x24522a[_0x113a0a(0x1ff)]},..._0x24522a[_0x113a0a(0x1d7)]&&{'query':_0x24522a[_0x113a0a(0x1d7)]},..._0x24522a['debug']&&{'debug':_0x24522a[_0x113a0a(0x208)]}};return await handleSingleObjectOutput(_0x4c932a,_0x1b9d23),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x38cb67(0x1f2)]=a26_0x38cb67(0x207);['description']='Kill\x20a\x20job';['validate'](_0x266173){const _0x37a79c=a26_0x38cb67,_0x2bbcd6=_0x266173[_0x37a79c(0x1d5)][0x0];if(!_0x2bbcd6)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0x38cb67(0x1ee)](_0xedc9dd){const _0xa9ef9e=a26_0x38cb67,{options:_0x25ebb5,args:_0x1c6c4e,tdx:_0x4ca46f}=_0xedc9dd,_0x2d6018=_0x1c6c4e[0x0];if(!_0x25ebb5[_0xa9ef9e(0x1df)]){const _0x5790d7=await confirm(_0xa9ef9e(0x206)+_0x2d6018+'?');if(!_0x5790d7)return console[_0xa9ef9e(0x213)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x4ca46f[_0xa9ef9e(0x1dd)][_0xa9ef9e(0x214)](_0x2d6018),{'verbose':_0x25ebb5[_0xa9ef9e(0x1e0)]}),console[_0xa9ef9e(0x213)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x2d6018),console[_0xa9ef9e(0x213)](_0xa9ef9e(0x1f0)+_0x2d6018+_0xa9ef9e(0x1fe)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x38cb67(0x1f2)]=a26_0x38cb67(0x1dc);['description']=a26_0x38cb67(0x1ec);async[a26_0x38cb67(0x1ee)](_0x230a1f){const _0x4999b3=a26_0x38cb67,{options:_0x41fecc,args:_0x58660c,tdx:_0x4ab56a}=_0x230a1f,_0x3bdd4e=_0x41fecc[_0x4999b3(0x205)]||'trino',_0xf485c1=_0x41fecc[_0x4999b3(0x202)],_0x3b39ae=_0x41fecc[_0x4999b3(0x1ea)]||_0x4999b3(0x1f4),_0x5893a3=_0x41fecc['result'];if(_0x3bdd4e!=='trino'&&_0x3bdd4e!==_0x4999b3(0x21c))throw new SDKError(ErrorCode[_0x4999b3(0x217)],_0x4999b3(0x1de));let _0x34d35d;if(_0xf485c1){if(_0x58660c[0x0])throw new SDKError(ErrorCode[_0x4999b3(0x217)],_0x4999b3(0x20a));const _0x187e65=readSqlStatementsFromFile(_0xf485c1);if(_0x187e65['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4999b3(0x1fa));if(_0x187e65[_0x4999b3(0x218)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4999b3(0x219));_0x34d35d=_0x187e65[0x0];}else{if(!_0x58660c[0x0])throw new SDKError(ErrorCode[_0x4999b3(0x217)],_0x4999b3(0x1e3));_0x34d35d=_0x58660c[0x0];}_0x41fecc[_0x4999b3(0x1e0)]&&(console[_0x4999b3(0x213)](_0x4999b3(0x215)+_0x3bdd4e),console[_0x4999b3(0x213)](_0x4999b3(0x226)+_0x3b39ae),console['error'](_0x4999b3(0x1e9)+_0x34d35d[_0x4999b3(0x1da)](0x0,0x64)+(_0x34d35d[_0x4999b3(0x218)]>0x64?_0x4999b3(0x1db):'')));const _0x4d731d=await withSpinner('Submitting\x20job...',()=>_0x4ab56a[_0x4999b3(0x1dd)]['submit'](_0x3b39ae,_0x34d35d,_0x3bdd4e,_0x5893a3),{'verbose':_0x41fecc[_0x4999b3(0x1e0)]}),_0x2774e2=_0x4d731d[_0x4999b3(0x1d4)];return console[_0x4999b3(0x213)]('✔\x20Job\x20submitted'),console[_0x4999b3(0x213)](_0x4999b3(0x1f7)+_0x2774e2[_0x4999b3(0x21f)]),await handleSDKOutput([_0x2774e2],_0x41fecc),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x38cb67(0x1f2)]=a26_0x38cb67(0x1e4);[a26_0x38cb67(0x200)]='Get\x20job\x20results';[a26_0x38cb67(0x224)](_0x335794){const _0x14b92e=a26_0x38cb67,_0x1f8957=_0x335794[_0x14b92e(0x1d5)][0x0];if(!_0x1f8957)return _0x14b92e(0x1e8);return undefined;}async['execute'](_0x3640ac){const _0x3fe809=a26_0x38cb67,{options:_0x5019f6,args:_0x195e87,tdx:_0x52bfc2}=_0x3640ac,_0x4f500b=_0x195e87[0x0],_0x299d7f=await withSpinner(_0x3fe809(0x1fd),()=>_0x52bfc2[_0x3fe809(0x1dd)][_0x3fe809(0x203)](_0x4f500b),{'verbose':_0x5019f6[_0x3fe809(0x1e0)]}),_0x13c857=_0x299d7f['data'];return console['error'](_0x3fe809(0x1d8)+_0x13c857[_0x3fe809(0x218)]+_0x3fe809(0x1cf)+(_0x13c857[_0x3fe809(0x218)]!==0x1?'s':'')),await handleSDKOutput(_0x13c857,_0x5019f6),0x0;}}
|
|
1
|
+
const a26_0x20d0b1=a26_0x5948;(function(_0x3219a1,_0x54ba76){const _0x288107=a26_0x5948,_0x150300=_0x3219a1();while(!![]){try{const _0x207500=-parseInt(_0x288107(0x136))/0x1+-parseInt(_0x288107(0x122))/0x2*(parseInt(_0x288107(0x152))/0x3)+parseInt(_0x288107(0x156))/0x4*(parseInt(_0x288107(0x109))/0x5)+parseInt(_0x288107(0x11f))/0x6*(-parseInt(_0x288107(0x111))/0x7)+-parseInt(_0x288107(0x12a))/0x8*(parseInt(_0x288107(0x148))/0x9)+parseInt(_0x288107(0x14b))/0xa*(parseInt(_0x288107(0x105))/0xb)+-parseInt(_0x288107(0x128))/0xc*(-parseInt(_0x288107(0x14f))/0xd);if(_0x207500===_0x54ba76)break;else _0x150300['push'](_0x150300['shift']());}catch(_0x2e15d2){_0x150300['push'](_0x150300['shift']());}}}(a26_0x4b95,0x37ec7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a26_0x4b95(){const _0x26ed76=['...','substring','Submit\x20a\x20job','limit','join','No\x20SQL\x20statements\x20found\x20in\x20file','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','✔\x20Job\x20submitted','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','List\x20jobs','information_schema','142343kxtmBm','type','Get\x20job\x20results','jobs','data','map','description','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','submit','\x20job','validate','start_at','Status\x20filter:\x20','presto','Database:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','abs','612bRVxIr','name','h\x20ago','3348050bVAqyG','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','round','Kill\x20a\x20job','4498evnGrZ','job:show','d\x20ago','260724oQYaoo','m\x20ago','green','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','228ykmYFL','\x20jobs','success','job_id','verbose','debug','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','red','INVALID_ARGUMENT','created_at','jobType','database','mo\x20ago','Getting\x20job\x20results...','getTime','11waxiXi','\x20row','floor','log','9765hrcQqe','Query:\x20','now','push','error','Show\x20job\x20details','execute','priority','637742DjMVYg','job:kill','status','hive','Limit:\x20','Listing\x20jobs...','args','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','url','query','dim','end_at','file','✔\x20Retrieved\x20','6mSVtnM','Job\x20type:\x20','✔\x20Found\x20','2pEQROb','user_name','trino','\x20\x20Job\x20ID:\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','length','19452PBFmqx','Submitting\x20kill\x20request...','53832upIpfO'];a26_0x4b95=function(){return _0x26ed76;};return a26_0x4b95();}import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x328fb4 from'chalk';function formatDuration(_0x36f871){const _0x4620f4=a26_0x5948;if(_0x36f871<0x3c)return _0x36f871+'s';if(_0x36f871<0xe10)return Math[_0x4620f4(0x107)](_0x36f871/0x3c)+'m\x20'+_0x36f871%0x3c+'s';const _0x22cce4=Math[_0x4620f4(0x107)](_0x36f871/0xe10),_0xbda759=Math[_0x4620f4(0x107)](_0x36f871%0xe10/0x3c);return _0xbda759>0x0?_0x22cce4+'h\x20'+_0xbda759+'m':_0x22cce4+'h';}function formatRelativeTime(_0x21771f){const _0xf6ae4e=a26_0x5948,_0x16cb8d=Date[_0xf6ae4e(0x10b)]()-_0x21771f[_0xf6ae4e(0x104)](),_0x5c818f=Math[_0xf6ae4e(0x107)](Math[_0xf6ae4e(0x147)](_0x16cb8d)/0x3e8);if(_0x5c818f<0x3c)return'just\x20now';const _0x1d105c=Math[_0xf6ae4e(0x107)](_0x5c818f/0x3c);if(_0x1d105c<0x3c)return _0x1d105c+_0xf6ae4e(0x153);const _0x55c9dd=Math['floor'](_0x1d105c/0x3c);if(_0x55c9dd<0x18)return _0x55c9dd+_0xf6ae4e(0x14a);const _0x3cdb42=Math[_0xf6ae4e(0x107)](_0x55c9dd/0x18);if(_0x3cdb42<0x1e)return _0x3cdb42+_0xf6ae4e(0x151);return Math['floor'](_0x3cdb42/0x1e)+_0xf6ae4e(0x102);}function a26_0x5948(_0x4993f3,_0x157a38){_0x4993f3=_0x4993f3-0xfd;const _0x4b95f9=a26_0x4b95();let _0x594882=_0x4b95f9[_0x4993f3];return _0x594882;}export class JobListCommand extends BaseCommand{[a26_0x20d0b1(0x149)]=a26_0x20d0b1(0x139);['description']=a26_0x20d0b1(0x134);async[a26_0x20d0b1(0x10f)](_0x5865e7){const _0x58d0c7=a26_0x20d0b1,{options:_0x1af216,tdx:_0x23b5a3}=_0x5865e7,_0x3a33d0=resolveLimit(_0x1af216[_0x58d0c7(0x12e)],DEFAULT_DISPLAY_LIMIT),_0x3d1cd2=_0x1af216[_0x58d0c7(0x113)];_0x1af216[_0x58d0c7(0x15a)]&&(console[_0x58d0c7(0x10d)](_0x58d0c7(0x115)+_0x3a33d0+_0x58d0c7(0x157)),_0x3d1cd2&&console['error'](_0x58d0c7(0x143)+_0x3d1cd2));const _0x9fe3b5=await withSpinner(_0x58d0c7(0x116),()=>_0x23b5a3[_0x58d0c7(0x139)]['list']({'from':0x0,'to':_0x3a33d0-0x1,'status':_0x3d1cd2}),{'verbose':_0x1af216[_0x58d0c7(0x15a)]}),_0x45186b=_0x9fe3b5['data'];console[_0x58d0c7(0x10d)](_0x58d0c7(0x121)+_0x45186b[_0x58d0c7(0x127)]+_0x58d0c7(0x140)+(_0x45186b['length']!==0x1?'s':''));const _0x91dc6e=_0x1af216[_0x58d0c7(0x13d)];if(isStructuredFormat(_0x1af216)){const _0x4a0620=_0x45186b[_0x58d0c7(0x13b)](_0x3bb192=>{const _0x295f6f=_0x58d0c7;let _0x5ab415;if(_0x3bb192[_0x295f6f(0x142)]&&_0x3bb192[_0x295f6f(0x11c)]){const _0x257b30=new Date(_0x3bb192[_0x295f6f(0x142)])[_0x295f6f(0x104)](),_0x527c76=new Date(_0x3bb192['end_at'])['getTime']();_0x5ab415=Math[_0x295f6f(0x14d)]((_0x527c76-_0x257b30)/0x3e8);}return{'job_id':_0x3bb192[_0x295f6f(0x159)],'type':_0x3bb192[_0x295f6f(0x137)]===_0x295f6f(0x144)?_0x295f6f(0x124):_0x3bb192['type'],'status':_0x3bb192[_0x295f6f(0x113)],'user_name':_0x3bb192[_0x295f6f(0x123)],'duration_sec':_0x5ab415,'created_at':_0x3bb192[_0x295f6f(0xff)],'started_at':_0x3bb192[_0x295f6f(0x142)],'end_at':_0x3bb192[_0x295f6f(0x11c)]};});await handleSDKOutput(_0x4a0620,_0x1af216);}else for(const _0x454f9b of _0x45186b){const _0x2b1024=_0x454f9b[_0x58d0c7(0x113)]===_0x58d0c7(0x158)?a26_0x328fb4[_0x58d0c7(0x154)]:_0x454f9b['status']==='error'?a26_0x328fb4[_0x58d0c7(0xfd)]:a26_0x328fb4['dim'],_0x1da9a8=_0x2b1024(_0x454f9b[_0x58d0c7(0x113)]),_0x35aa13=getJobUrl(_0x91dc6e,_0x454f9b['job_id']),_0x55a974=hyperlink(_0x454f9b[_0x58d0c7(0x159)],_0x35aa13),_0x25c770=a26_0x328fb4[_0x58d0c7(0x11b)](_0x454f9b[_0x58d0c7(0x137)]===_0x58d0c7(0x144)?_0x58d0c7(0x124):_0x454f9b[_0x58d0c7(0x137)]),_0x332c9b=[];if(_0x454f9b[_0x58d0c7(0x142)]&&_0x454f9b['end_at']){const _0x3376ce=Math[_0x58d0c7(0x14d)]((new Date(_0x454f9b['end_at'])[_0x58d0c7(0x104)]()-new Date(_0x454f9b[_0x58d0c7(0x142)])['getTime']())/0x3e8);_0x332c9b[_0x58d0c7(0x10c)](formatDuration(_0x3376ce));}if(_0x454f9b[_0x58d0c7(0x11c)])_0x332c9b[_0x58d0c7(0x10c)](formatRelativeTime(new Date(_0x454f9b['end_at'])));else _0x454f9b[_0x58d0c7(0x142)]&&_0x332c9b[_0x58d0c7(0x10c)](formatRelativeTime(new Date(_0x454f9b[_0x58d0c7(0x142)])));const _0x3a5f4a=_0x332c9b['length']>0x0?a26_0x328fb4[_0x58d0c7(0x11b)]('\x20'+_0x332c9b[_0x58d0c7(0x12f)](',\x20')):'';console[_0x58d0c7(0x108)]('⚡\x20'+_0x55a974+'\x20'+_0x25c770+'\x20'+_0x1da9a8+_0x3a5f4a);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x20d0b1(0x149)]=a26_0x20d0b1(0x150);[a26_0x20d0b1(0x13c)]=a26_0x20d0b1(0x10e);[a26_0x20d0b1(0x141)](_0x37a209){const _0x373efc=a26_0x20d0b1,_0x30e5ad=_0x37a209[_0x373efc(0x117)][0x0];if(!_0x30e5ad)return _0x373efc(0x155);return undefined;}async['execute'](_0x184c44){const _0x515b41=a26_0x20d0b1,{options:_0x3a07f1,args:_0xd285cb,tdx:_0x5a487f}=_0x184c44,_0x27d0ec=_0xd285cb[0x0],_0x50e6b1=await withSpinner('Getting\x20job\x20details...',()=>_0x5a487f[_0x515b41(0x139)]['show'](_0x27d0ec),{'verbose':_0x3a07f1[_0x515b41(0x15a)]}),_0xcc3f09=_0x50e6b1['data'];let _0x85013a;if(_0xcc3f09['start_at']&&_0xcc3f09[_0x515b41(0x11c)]){const _0x412e1f=new Date(_0xcc3f09[_0x515b41(0x142)])[_0x515b41(0x104)](),_0x4576bd=new Date(_0xcc3f09[_0x515b41(0x11c)])['getTime']();_0x85013a=Math[_0x515b41(0x14d)]((_0x4576bd-_0x412e1f)/0x3e8);}const _0x90100d={'job_id':_0xcc3f09[_0x515b41(0x159)],'type':_0xcc3f09[_0x515b41(0x137)],'status':_0xcc3f09[_0x515b41(0x113)],..._0xcc3f09['user_name']&&{'user_name':_0xcc3f09['user_name']},..._0x85013a!==undefined&&{'duration_sec':_0x85013a},..._0xcc3f09['created_at']&&{'created_at':_0xcc3f09[_0x515b41(0xff)]},..._0xcc3f09[_0x515b41(0x142)]&&{'started_at':_0xcc3f09[_0x515b41(0x142)]},..._0xcc3f09[_0x515b41(0x11c)]&&{'end_at':_0xcc3f09['end_at']},..._0xcc3f09[_0x515b41(0x101)]&&{'database':_0xcc3f09[_0x515b41(0x101)]},..._0xcc3f09['priority']!==undefined&&{'priority':_0xcc3f09[_0x515b41(0x110)]},..._0xcc3f09[_0x515b41(0x119)]&&{'url':_0xcc3f09[_0x515b41(0x119)]},..._0xcc3f09[_0x515b41(0x11a)]&&{'query':_0xcc3f09['query']},..._0xcc3f09[_0x515b41(0x15b)]&&{'debug':_0xcc3f09[_0x515b41(0x15b)]}};return await handleSingleObjectOutput(_0x90100d,_0x3a07f1),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x20d0b1(0x112);[a26_0x20d0b1(0x13c)]=a26_0x20d0b1(0x14e);[a26_0x20d0b1(0x141)](_0x577b07){const _0x56a85a=a26_0x20d0b1,_0x4d0adf=_0x577b07[_0x56a85a(0x117)][0x0];if(!_0x4d0adf)return _0x56a85a(0x133);return undefined;}async[a26_0x20d0b1(0x10f)](_0xc5aef8){const _0x32a024=a26_0x20d0b1,{options:_0x5c253c,args:_0x398922,tdx:_0x1402f7}=_0xc5aef8,_0x1ec4ca=_0x398922[0x0];if(!_0x5c253c['yes']){const _0x66189e=await confirm(_0x32a024(0x131)+_0x1ec4ca+'?');if(!_0x66189e)return console[_0x32a024(0x10d)]('Cancelled'),0x0;}return await withSpinner(_0x32a024(0x129),()=>_0x1402f7['jobs']['kill'](_0x1ec4ca),{'verbose':_0x5c253c[_0x32a024(0x15a)]}),console['error'](_0x32a024(0x15c)+_0x1ec4ca),console[_0x32a024(0x10d)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x1ec4ca+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x20d0b1(0x149)]='job:submit';[a26_0x20d0b1(0x13c)]=a26_0x20d0b1(0x12d);async[a26_0x20d0b1(0x10f)](_0x1cfc33){const _0xcaa6d3=a26_0x20d0b1,{options:_0x43ce13,args:_0x21ac8b,tdx:_0x32f1fa}=_0x1cfc33,_0x49a644=_0x43ce13[_0xcaa6d3(0x100)]||_0xcaa6d3(0x124),_0x4d0fd5=_0x43ce13[_0xcaa6d3(0x11d)],_0x6fd7fc=_0x43ce13[_0xcaa6d3(0x101)]||_0xcaa6d3(0x135),_0x42071e=_0x43ce13['result'];if(_0x49a644!=='trino'&&_0x49a644!==_0xcaa6d3(0x114))throw new SDKError(ErrorCode[_0xcaa6d3(0xfe)],_0xcaa6d3(0x14c));let _0x5cb193;if(_0x4d0fd5){if(_0x21ac8b[0x0])throw new SDKError(ErrorCode[_0xcaa6d3(0xfe)],_0xcaa6d3(0x146));const _0x3364e0=readSqlStatementsFromFile(_0x4d0fd5);if(_0x3364e0[_0xcaa6d3(0x127)]===0x0)throw new SDKError(ErrorCode[_0xcaa6d3(0xfe)],_0xcaa6d3(0x130));if(_0x3364e0[_0xcaa6d3(0x127)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xcaa6d3(0x118));_0x5cb193=_0x3364e0[0x0];}else{if(!_0x21ac8b[0x0])throw new SDKError(ErrorCode[_0xcaa6d3(0xfe)],_0xcaa6d3(0x126));_0x5cb193=_0x21ac8b[0x0];}_0x43ce13['verbose']&&(console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x120)+_0x49a644),console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x145)+_0x6fd7fc),console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x10a)+_0x5cb193[_0xcaa6d3(0x12c)](0x0,0x64)+(_0x5cb193[_0xcaa6d3(0x127)]>0x64?_0xcaa6d3(0x12b):'')));const _0x359b26=await withSpinner('Submitting\x20job...',()=>_0x32f1fa['jobs'][_0xcaa6d3(0x13f)](_0x6fd7fc,_0x5cb193,_0x49a644,_0x42071e),{'verbose':_0x43ce13[_0xcaa6d3(0x15a)]}),_0x53aee4=_0x359b26[_0xcaa6d3(0x13a)];return console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x132)),console[_0xcaa6d3(0x10d)](_0xcaa6d3(0x125)+_0x53aee4[_0xcaa6d3(0x159)]),await handleSDKOutput([_0x53aee4],_0x43ce13),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x20d0b1(0x149)]='job:result';[a26_0x20d0b1(0x13c)]=a26_0x20d0b1(0x138);[a26_0x20d0b1(0x141)](_0x18a27e){const _0x54d846=a26_0x20d0b1,_0x105fab=_0x18a27e['args'][0x0];if(!_0x105fab)return _0x54d846(0x13e);return undefined;}async[a26_0x20d0b1(0x10f)](_0x1b9d4d){const _0x40ceea=a26_0x20d0b1,{options:_0x57bb58,args:_0x5686b9,tdx:_0x102e1f}=_0x1b9d4d,_0x524fb2=_0x5686b9[0x0],_0x33ac25=await withSpinner(_0x40ceea(0x103),()=>_0x102e1f[_0x40ceea(0x139)]['result'](_0x524fb2),{'verbose':_0x57bb58[_0x40ceea(0x15a)]}),_0x1817df=_0x33ac25[_0x40ceea(0x13a)];return console['error'](_0x40ceea(0x11e)+_0x1817df[_0x40ceea(0x127)]+_0x40ceea(0x106)+(_0x1817df['length']!==0x1?'s':'')),await handleSDKOutput(_0x1817df,_0x57bb58),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x53a51e=a27_0x5b9d;(function(_0x11fa17,_0x5dac7a){const _0x430ecd=a27_0x5b9d,_0x47201d=_0x11fa17();while(!![]){try{const _0x23daca=parseInt(_0x430ecd(0x18e))/0x1+-parseInt(_0x430ecd(0x1d7))/0x2*(-parseInt(_0x430ecd(0x1ae))/0x3)+parseInt(_0x430ecd(0x1ac))/0x4*(parseInt(_0x430ecd(0x15e))/0x5)+parseInt(_0x430ecd(0x1a2))/0x6*(parseInt(_0x430ecd(0x168))/0x7)+parseInt(_0x430ecd(0x16f))/0x8+-parseInt(_0x430ecd(0xf6))/0x9+-parseInt(_0x430ecd(0x17b))/0xa;if(_0x23daca===_0x5dac7a)break;else _0x47201d['push'](_0x47201d['shift']());}catch(_0x4dd1fe){_0x47201d['push'](_0x47201d['shift']());}}}(a27_0x34ea,0x1a42f));import a27_0x564625 from'chalk';import a27_0x2ae22b from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a27_0x5b9d(_0x39a1b7,_0x5cfbb6){_0x39a1b7=_0x39a1b7-0xef;const _0x34ea60=a27_0x34ea();let _0x5b9d39=_0x34ea60[_0x39a1b7];return _0x5b9d39;}import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';function a27_0x34ea(){const _0x4f01de=['Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','content','createVersion','\x20=\x20','diff','includeHistory','2644420nESpnw','buildIdToEmailMap','exitOrJumpRate','Fetching\x20','listFolders','Error:\x20Journey\x20not\x20found:\x20','absolutePath','journeyBundleId','\x20changed\x20files','folderId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','file','kind','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22',',\x20version:\x20','conversion','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','journey:push','100977eXbDQF','journey','(draft)','\x20activation','Getting\x20column\x20mapping...','connection','Resolving\x20version...','isNew','error','Target\x20directory:\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Creating\x20new\x20version...','Warning:\x20Could\x20not\x20resolve\x20segment\x20','.yml','size','paused','segmentName','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','List\x20activations\x20for\x20a\x20journey','nodes','678CSaXZK','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Parent\x20segment:\x20','\x20(rule\x20match)','columns','filePath','log','\x20(ID:\x20','yellow','12WNPbgF','archived','57YVDumh','renderStats','Options:','\x20Created\x20v','listJourneysFromParentSegment','session','journey:view','(root)','Resolving\x20parent\x20segment...','\x22\x20paused','Pause\x20a\x20running\x20journey','Write\x20','green','completionRate','blue','\x20(draft)\x20—\x20\x22','exitOrJumpSize','getStatistics','listJourneysWithFolders','relativePath','json','table','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x0aChanges\x20to\x20\x27','journeyId','dryRun','journeyName','Input:\x20','Show\x20journey\x20details','join','milestoneSize','resourceName','Fetching\x20journeys\x20and\x20folders...','segmentPushCommand','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20\x20Statistics\x20not\x20available','journey:stats','stages','\x20journey\x20files\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Resume\x20a\x20paused\x20journey','10588mLPSvI','...','database','type','Error:\x20Journey\x20\x27','length','\x20\x20Folder\x20path:\x20','\x20->\x20','pause','parent_segment','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','List\x20all\x20versions\x20of\x20a\x20journey','journey:traffic','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Fetching\x20parent\x20segment...','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Available\x20stages:\x20','repeat','add','cwd','all','getColumnMapping','INVALID_ARGUMENT','completeMilestoneRate','Resolved\x20YAML\x20file:\x20','yes','execute','updatedAt','has','Warning:\x20Could\x20not\x20resolve\x20activation\x20','filter','Target\x20file:\x20','List\x20journeys\x20in\x20current\x20context','user','Fetching\x20users\x20and\x20connections...','\x20\x20Target:\x20','history','\x20\x20Name:\x20','listActivationsFlat','\x0aPull\x20summary:','entries','createdAt','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Stage\x20\x22','relative','sort','limit','set','getActivation','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','741501hKJcji','Pausing\x20journey...','description','get','data','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','attributes','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','find','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20new\x20files','then','Getting\x20journey\x20statistics...','(completed)','Resuming\x20journey...','journey:resume','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','name','/app/ps/','journey:pause','journeys','red','folderPath','format','hasChanges','setPhase','test','Error:\x20Invalid\x20version\x20number:\x20','getJourney','folders','Resolving\x20journey...','Cancelled','options','getSegment','goalSize','✔\x20Journey\x20\x22','Show\x20journey\x20statistics','Getting\x20version\x20','push','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x22\x20resumed','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','verbose','getLatestJourneyId','Folder\x20path:\x20','Error:\x20--version\x20option\x20is\x20required','helpText','\x20unchanged\x20files','versionNumber','\x5c$&','goal','state','Found\x20','base','journey:activations','/e/','reentryMode','No\x20statistics\x20available\x20for\x20journey:\x20','localeCompare','\x22\x20not\x20found','utf-8','targetDir','Getting\x20journey\x20details...','(paused)','/j/da/je','segment','-\x20no\x20files\x20written','Show\x20journey\x20table\x20column\x20mapping','enteredSize','split','errorCode','args','\x20version','rule','\x20journey','Database:\x20','\x20versions)','activation','Listing\x20journey\x20versions...','\x20not\x20found.\x20Available:\x20','completed','message','journeyBundleName','journey:versions','segments','\x20files?','✔\x20Pulled\x20','Journey\x20name:\x20','Listing\x20journey\x20activations...','dim','connector_config','Table:\x20','hasPeriod','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','includeStats','toLowerCase','Export\x20journey(s)\x20as\x20YAML\x20files','\x20Opening\x20','resolveSegment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Listing\x20journeys...','bold','Error:\x20Parent\x20segment\x20context\x20required','331225meyIci','listVersions','\x20\x20Journey\x20ID:\x20','getParentFull','rootFolderId','parentSegment','launched','site','from','values','3241NzbVcv','getTrafficData','jsonl','journeyStages','root\x20folder','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)','web','14248JUJxtg','links','cyan','map','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','journey:columns'];a27_0x34ea=function(){return _0x4f01de;};return a27_0x34ea();}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(_0x21ac62){const _0x41bf13=a27_0x5b9d;return!_0x21ac62&&(console['error'](_0x41bf13(0x1c4)),console[_0x41bf13(0x196)](_0x41bf13(0x107))),!!_0x21ac62;}function withJsonFormat(_0x480afb){const _0x283b06=a27_0x5b9d;if(!_0x480afb[_0x283b06(0x10e)]&&!_0x480afb[_0x283b06(0x1c2)]&&!_0x480afb[_0x283b06(0x16a)]&&!_0x480afb['tsv'])return{..._0x480afb,'format':'json','json':!![]};return _0x480afb;}function formatJourneyState(_0x35194e){const _0x33f103=a27_0x5b9d;switch(_0x35194e){case _0x33f103(0x164):return a27_0x564625[_0x33f103(0x1ba)]('(running)');case'draft':return a27_0x564625[_0x33f103(0x150)](_0x33f103(0x190));case _0x33f103(0x19d):return a27_0x564625[_0x33f103(0x1ab)](_0x33f103(0x136));case _0x33f103(0x147):return a27_0x564625[_0x33f103(0x1bc)](_0x33f103(0x104));case _0x33f103(0x1ad):return a27_0x564625[_0x33f103(0x150)]('(archived)');default:return'('+_0x35194e+')';}}function formatJourneyItem(_0x18b61d,_0x2eff6a='',_0x5efc69){const _0x517a89=a27_0x5b9d,_0x43ada1=formatJourneyState(_0x18b61d['state']),_0x57184e=_0x5efc69?hyperlink(_0x18b61d['journeyBundleName'],_0x5efc69):_0x18b61d[_0x517a89(0x149)];return _0x2eff6a+'🗺️\x20'+_0x57184e+'\x20'+_0x43ada1;}function escapeRegex(_0x169c2f){const _0x317fee=a27_0x5b9d;return _0x169c2f['replace'](/[.*+?^${}()|[\]\\]/g,_0x317fee(0x128));}function globToRegex(_0x2041fb){const _0x41dd9e=a27_0x5b9d,_0x2201ee=_0x2041fb[_0x41dd9e(0x13c)]('*')[_0x41dd9e(0x172)](escapeRegex);return new RegExp(_0x2201ee[_0x41dd9e(0x1cb)]('.*'),'i');}function buildRuleToNameMapping(_0x2bdc21){const _0x1e42c9=a27_0x5b9d,_0x5c0fcb=new Map();if(_0x2bdc21[_0x1e42c9(0x14b)])for(const [_0x4bc7de,_0xad402d]of Object[_0x1e42c9(0x1ff)](_0x2bdc21[_0x1e42c9(0x14b)])){if(_0xad402d[_0x1e42c9(0x140)]){const _0x5c3f61=serializeRule(_0xad402d[_0x1e42c9(0x140)]),_0x43bf98=_0x5c0fcb['get'](_0x5c3f61);_0x43bf98?_0x43bf98[_0x1e42c9(0x11d)](_0x4bc7de):_0x5c0fcb[_0x1e42c9(0xf3)](_0x5c3f61,[_0x4bc7de]);}}return _0x5c0fcb;}async function resolveJourneyIdFromInput(_0x478e04,_0x47ea59,_0x41165d){const _0x1135b3=a27_0x5b9d,_0x4c0939=await resolveJourneyTarget(_0x478e04,_0x47ea59['parentSegment'],_0x47ea59[_0x1135b3(0x121)]),_0x4fb05e=_0x4c0939[_0x1135b3(0x163)];if(!_0x4fb05e)throw new SDKError(ErrorCode[_0x1135b3(0x1ed)],_0x1135b3(0x1e4));const _0x1d7afa=await withSpinner(_0x1135b3(0x1b6),()=>_0x41165d['segment']['resolveParentId'](_0x4fb05e),{'verbose':_0x47ea59[_0x1135b3(0x121)]}),_0x324265=_0x1d7afa[_0x1135b3(0xfa)],_0x3afd40=await withSpinner(_0x1135b3(0x115),()=>_0x41165d[_0x1135b3(0x18f)]['resolveJourneyId'](_0x324265,_0x4c0939[_0x1135b3(0x1c8)]),{'verbose':_0x47ea59['verbose']});return{'journeyId':_0x3afd40[_0x1135b3(0xfa)],'journeyName':_0x4c0939[_0x1135b3(0x1c8)],'parentSegmentId':_0x324265};}async function resolveJourneyTarget(_0x350958,_0x488d80,_0xeb57b0){const _0x2bd994=a27_0x5b9d;if(isYamlFilePath(_0x350958))try{const _0x1c9d37=await resolveYamlFilePath(_0x350958);return _0xeb57b0&&(console[_0x2bd994(0x196)](_0x2bd994(0x1ef)+_0x350958),console['error']('\x20\x20Parent\x20segment:\x20'+_0x1c9d37['parentSegment']),console[_0x2bd994(0x196)](_0x2bd994(0x1fc)+_0x1c9d37[_0x2bd994(0x19e)]),console[_0x2bd994(0x196)](_0x2bd994(0x1dd)+(_0x1c9d37[_0x2bd994(0x10d)]||_0x2bd994(0x1b5)))),{'journeyName':_0x1c9d37[_0x2bd994(0x19e)],'parentSegment':_0x1c9d37[_0x2bd994(0x163)],'resolved':_0x1c9d37};}catch(_0x3fe76f){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x3fe76f[_0x2bd994(0x148)]);}if(!_0x488d80)throw new SDKError(ErrorCode[_0x2bd994(0x1ed)],_0x2bd994(0x201));return{'journeyName':_0x350958,'parentSegment':_0x488d80};}export class JourneyListCommand extends BaseCommand{[a27_0x53a51e(0x108)]='journey:list';['description']=a27_0x53a51e(0x1f7);async['execute'](_0x5a5bf0){const _0x32549f=a27_0x53a51e,{options:_0xc59df9,args:_0x56d760,tdx:_0x5afd8c}=_0x5a5bf0,_0x16e08c=_0x56d760[0x0],_0x47ba5c=_0xc59df9[_0x32549f(0x163)];if(!_0x47ba5c)return console[_0x32549f(0x196)](_0x32549f(0x15d)),console[_0x32549f(0x196)](_0x32549f(0x188)),0x1;const _0x1d29d9=await withSpinner(_0x32549f(0x1b6),()=>_0x5afd8c[_0x32549f(0x138)]['resolveParentId'](_0x47ba5c),{'verbose':_0xc59df9[_0x32549f(0x121)]}),_0x57ce32=_0x1d29d9['data'];_0xc59df9[_0x32549f(0x121)]&&(console[_0x32549f(0x196)](_0x32549f(0x1a5)+_0x47ba5c+_0x32549f(0x1aa)+_0x57ce32+')'),_0x16e08c&&console[_0x32549f(0x196)]('Pattern:\x20'+_0x16e08c));const _0x2ad3a2=await withSpinner(_0x32549f(0x1e5),()=>_0x5afd8c[_0x32549f(0x138)][_0x32549f(0x161)](_0x57ce32),{'verbose':_0xc59df9[_0x32549f(0x121)]}),_0x2e267f=_0x2ad3a2[_0x32549f(0xfa)],_0x44c1ac=_0x2e267f[_0x32549f(0x162)],_0x22f4cd=await withSpinner(_0x32549f(0x15b),()=>_0x5afd8c[_0x32549f(0x18f)][_0x32549f(0x1c0)](_0x57ce32,_0x44c1ac),{'verbose':_0xc59df9[_0x32549f(0x121)]});let _0x1bacfe=_0x22f4cd['data'][_0x32549f(0x10b)];const _0x559cd9=_0x22f4cd[_0x32549f(0xfa)][_0x32549f(0x114)],_0xa81fd3=new Map();for(const _0x5db01e of _0x559cd9){_0xa81fd3['set'](_0x5db01e['id'],_0x5db01e[_0x32549f(0x108)]);}if(_0x16e08c){const _0xbceb1e=globToRegex(_0x16e08c);_0x1bacfe=_0x1bacfe[_0x32549f(0x1f5)](_0x10fac6=>_0xbceb1e[_0x32549f(0x111)](_0x10fac6[_0x32549f(0x149)]));}console['error']('✔\x20Found\x20'+_0x1bacfe[_0x32549f(0x1dc)]+_0x32549f(0x141)+(_0x1bacfe[_0x32549f(0x1dc)]!==0x1?'s':''));const _0x443fec=_0x3f50a0=>{const _0x38470f=_0x32549f;return getConsoleNextUrl(_0xc59df9[_0x38470f(0x165)],'/app/ps/'+_0x57ce32+'/e/'+_0x3f50a0+'/j/da');};if(_0xc59df9[_0x32549f(0x10e)]===_0x32549f(0x1c3))await handleSDKOutput(_0x1bacfe,_0xc59df9);else{if(_0xc59df9[_0x32549f(0x10e)]===_0x32549f(0x1c2)){const _0x19d1b8=_0x1bacfe[_0x32549f(0x172)](_0x2d78ad=>({..._0x2d78ad,'url':_0x443fec(_0x2d78ad['id'])}));await handleSDKOutput(_0x19d1b8,_0xc59df9);}else{console[_0x32549f(0x1a9)]('['+_0x47ba5c+']');const _0x15ebcd=new Map(),_0x331348=[];for(const _0x388b1c of _0x1bacfe){if(!_0x388b1c['folderId']||_0x388b1c[_0x32549f(0x184)]===_0x44c1ac)_0x331348['push'](_0x388b1c);else{const _0x353caa=_0x15ebcd[_0x32549f(0xf9)](_0x388b1c[_0x32549f(0x184)])||[];_0x353caa['push'](_0x388b1c),_0x15ebcd[_0x32549f(0xf3)](_0x388b1c[_0x32549f(0x184)],_0x353caa);}}const _0x372c43=(_0x36ba96,_0x52f02b)=>_0x36ba96[_0x32549f(0x149)][_0x32549f(0x131)](_0x52f02b[_0x32549f(0x149)],undefined,{'sensitivity':'base'});_0x331348['sort'](_0x372c43);for(const _0x1f4050 of _0x331348){console[_0x32549f(0x1a9)](formatJourneyItem(_0x1f4050,'',_0x443fec(_0x1f4050['id'])));}const _0x5b8c82=[..._0x15ebcd[_0x32549f(0x1ff)]()][_0x32549f(0xf1)]((_0x335034,_0x168932)=>{const _0x18a5ec=_0x32549f,_0x357d9e=_0xa81fd3[_0x18a5ec(0xf9)](_0x335034[0x0])||_0x335034[0x0],_0x5ceb33=_0xa81fd3[_0x18a5ec(0xf9)](_0x168932[0x0])||_0x168932[0x0];return _0x357d9e[_0x18a5ec(0x131)](_0x5ceb33,undefined,{'sensitivity':_0x18a5ec(0x12c)});});for(const [_0x486f07,_0x424b6c]of _0x5b8c82){const _0x2fd838=_0xa81fd3[_0x32549f(0xf9)](_0x486f07)||_0x486f07;console[_0x32549f(0x1a9)]('📁\x20'+_0x2fd838),_0x424b6c[_0x32549f(0xf1)](_0x372c43);for(const _0x456ecd of _0x424b6c){console[_0x32549f(0x1a9)](formatJourneyItem(_0x456ecd,'\x20\x20',_0x443fec(_0x456ecd['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x53a51e(0x1b4);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1ca);async[a27_0x53a51e(0x1f1)](_0x1bca66){const _0x936275=a27_0x53a51e,{options:_0x1fb520,args:_0x18141e,tdx:_0x5e7617}=_0x1bca66,_0x1954c6=_0x18141e[0x0];if(!_0x1954c6)return console[_0x936275(0x196)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x936275(0x196)](_0x936275(0xfb)),console['error'](_0x936275(0x1b0)),console[_0x936275(0x196)](_0x936275(0x120)),0x1;_0x1fb520[_0x936275(0x121)]&&console[_0x936275(0x196)]('Input:\x20'+_0x1954c6);const {journeyId:_0x304529,parentSegmentId:_0x2d3100}=await resolveJourneyIdFromInput(_0x1954c6,_0x1fb520,_0x5e7617);if(_0x1fb520[_0x936275(0x16e)]){const _0x4abd88=getConsoleNextUrl(_0x1fb520[_0x936275(0x165)],_0x936275(0x109)+_0x2d3100+'/e/'+_0x304529+_0x936275(0x137));return console[_0x936275(0x196)](a27_0x564625[_0x936275(0x1ba)]('✔')+_0x936275(0x158)+a27_0x564625['cyan'](_0x4abd88)),openBrowser(_0x4abd88),0x0;}const _0x4b7fc8=await withSpinner(_0x936275(0x135),()=>_0x5e7617[_0x936275(0x18f)][_0x936275(0x113)](_0x304529),{'verbose':_0x1fb520[_0x936275(0x121)]}),_0x4c9d51=_0x4b7fc8[_0x936275(0xfa)],_0x5ee5bf=_0x1fb520[_0x936275(0x155)];let _0x9ca0e3;if(_0x5ee5bf)try{const _0x16bc8b=await withSpinner(_0x936275(0x103),()=>_0x5e7617[_0x936275(0x18f)][_0x936275(0x1bf)](_0x304529),{'verbose':_0x1fb520[_0x936275(0x121)]});_0x9ca0e3=_0x16bc8b[_0x936275(0xfa)];}catch{_0x1fb520[_0x936275(0x121)]&&console[_0x936275(0x196)](_0x936275(0x1d1));}const _0x1017f1=getConsoleNextUrl(_0x1fb520['site'],_0x936275(0x109)+_0x2d3100+_0x936275(0x12e)+_0x304529+_0x936275(0x137)),_0x240f7f={'id':_0x4c9d51['id'],'name':_0x4c9d51['attributes']['name'],'description':_0x4c9d51[_0x936275(0xfc)]['description'],'state':_0x4c9d51[_0x936275(0xfc)][_0x936275(0x12a)],'paused':_0x4c9d51[_0x936275(0xfc)]['paused'],'reentry_mode':_0x4c9d51[_0x936275(0xfc)][_0x936275(0x12f)],'stages':_0x4c9d51[_0x936275(0xfc)][_0x936275(0x16b)]?.[_0x936275(0x1dc)]||0x0,..._0x4c9d51[_0x936275(0xfc)][_0x936275(0x129)]&&{'goal':_0x4c9d51[_0x936275(0xfc)][_0x936275(0x129)]['name']},..._0x9ca0e3&&{'statistics':{'size':_0x9ca0e3['size'],'entered':_0x9ca0e3[_0x936275(0x13b)],'goal_achieved':_0x9ca0e3[_0x936275(0x119)],'completion_rate':_0x9ca0e3[_0x936275(0x1bb)],'exit_or_jump':_0x9ca0e3['exitOrJumpSize'],'exit_or_jump_rate':_0x9ca0e3['exitOrJumpRate'],'stages':_0x9ca0e3[_0x936275(0x1d3)]}},'url':_0x1017f1};return await handleSingleObjectOutput(_0x240f7f,_0x1fb520),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x1d2);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x11b);async[a27_0x53a51e(0x1f1)](_0x24ab8e){const _0x2054c2=a27_0x53a51e,{options:_0x177ed6,args:_0xc53f19,tdx:_0x275651}=_0x24ab8e,_0x118843=_0xc53f19[0x0];if(!requireNameOrPath(_0x118843))return 0x1;_0x177ed6[_0x2054c2(0x121)]&&console[_0x2054c2(0x196)]('Input:\x20'+_0x118843);const _0x40b6f0=_0x177ed6,_0x5591a5=_0x40b6f0[_0x2054c2(0x166)],_0x206ef6=_0x40b6f0['to'],_0x5d2c7f=_0x40b6f0[_0x2054c2(0x17a)],_0x4a2635=_0x40b6f0['stage'];_0x5d2c7f&&!_0x5591a5&&!_0x206ef6&&console[_0x2054c2(0x196)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x286d01=_0x5d2c7f?withJsonFormat(_0x177ed6):_0x177ed6,{journeyId:_0x32b91c,journeyName:_0x131ea8}=await resolveJourneyIdFromInput(_0x118843,_0x286d01,_0x275651),_0x278b14=_0x5591a5||_0x206ef6?{'from':_0x5591a5,'to':_0x206ef6}:undefined,_0x104b5d=await withSpinner(_0x2054c2(0x103),()=>Promise['all']([_0x275651[_0x2054c2(0x18f)][_0x2054c2(0x113)](_0x32b91c),_0x275651[_0x2054c2(0x18f)][_0x2054c2(0x1bf)](_0x32b91c,_0x278b14)]),{'verbose':_0x286d01[_0x2054c2(0x121)]}),[_0x463e6c,_0x14c633]=_0x104b5d[_0x2054c2(0xfa)];if(!_0x14c633||_0x14c633[_0x2054c2(0x1c6)]===null)return console[_0x2054c2(0x196)](_0x2054c2(0x130)+_0x131ea8),console[_0x2054c2(0x196)](_0x2054c2(0x1e1)),0x0;const _0x40d2b9=buildStageNameMap(_0x463e6c),_0x218c74=!!(_0x278b14&&_0x14c633[_0x2054c2(0x1fb)]?.['length']),_0x47b915={'stageNameMap':_0x40d2b9,'hasPeriod':_0x218c74,'includeHistory':!!_0x5d2c7f};if(_0x4a2635&&_0x14c633[_0x2054c2(0x1d3)]){const _0x516cd6=_0x14c633[_0x2054c2(0x1d3)][_0x2054c2(0xff)](_0x1d88da=>{const _0x181a2d=_0x2054c2,_0x3272f2=_0x40d2b9[_0x181a2d(0xf9)](_0x1d88da['id'])??'';return _0x3272f2[_0x181a2d(0x156)]()===_0x4a2635['toLowerCase']();});if(_0x516cd6)return await handleSingleObjectOutput(formatStageStats(_0x516cd6,_0x47b915),_0x286d01),0x0;const _0x184a03=_0x14c633[_0x2054c2(0x1d3)][_0x2054c2(0x172)](_0x5bdcdf=>_0x40d2b9['get'](_0x5bdcdf['id'])??_0x5bdcdf['id']);return console[_0x2054c2(0x196)](_0x2054c2(0xef)+_0x4a2635+_0x2054c2(0x132)),console[_0x2054c2(0x196)](_0x2054c2(0x1e7)+_0x184a03[_0x2054c2(0x1cb)](',\x20')),0x1;}const _0x59d68d=_0x14c633[_0x2054c2(0x1d3)]?.[_0x2054c2(0x172)](_0x1163b0=>formatStageStats(_0x1163b0,_0x47b915)),_0x454529=assembleJourneyStats(_0x14c633,{'from':_0x5591a5,'to':_0x206ef6,'includeHistory':_0x5d2c7f});return await this[_0x2054c2(0x1af)](_0x454529,_0x59d68d??[],_0x286d01),0x0;}async[a27_0x53a51e(0x1af)](_0x439c39,_0xe97e80,_0x494841){const _0x124548=a27_0x53a51e,_0x1aa118=_0x494841['format']===_0x124548(0x1c2)||_0x494841['format']===_0x124548(0x16a)||_0x494841[_0x124548(0x1c2)]||_0x494841[_0x124548(0x16a)];if(_0x1aa118){_0x439c39[_0x124548(0x1d3)]=_0xe97e80,await handleSingleObjectOutput(_0x439c39,_0x494841);return;}await handleSingleObjectOutput(_0x439c39,_0x494841);for(const _0x1a0cb8 of _0xe97e80){console[_0x124548(0x1a9)](''),console[_0x124548(0x1a9)](String(a27_0x564625[_0x124548(0x171)][_0x124548(0x15c)]('['+_0x1a0cb8[_0x124548(0x108)]+']'))+a27_0x564625[_0x124548(0x150)]('\x20'+_0x1a0cb8['id']));const {id:_0x3c41bf,name:_0x1fb37f,..._0x290208}=_0x1a0cb8;await handleSingleObjectOutput(_0x290208,_0x494841);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x1e3);[a27_0x53a51e(0xf8)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a27_0x53a51e(0x1f1)](_0x263b42){const _0x3d89d7=a27_0x53a51e,{options:_0x4331e0,args:_0x4e23fb,tdx:_0x1a015c}=_0x263b42,_0x12ac1e=_0x4e23fb[0x0];if(!requireNameOrPath(_0x12ac1e))return 0x1;_0x4331e0[_0x3d89d7(0x121)]&&console[_0x3d89d7(0x196)](_0x3d89d7(0x1c9)+_0x12ac1e);const _0x1c9668=_0x4331e0,_0x215b4a=_0x1c9668[_0x3d89d7(0x1da)],_0x4c09fb=_0x1c9668[_0x3d89d7(0x166)],_0x4e1343=_0x1c9668['to'],_0x57f89b=_0x1c9668[_0x3d89d7(0xf2)];if(_0x215b4a&&_0x215b4a!==_0x3d89d7(0x18a)&&_0x215b4a!=='activation')return console[_0x3d89d7(0x196)]('Error:\x20Invalid\x20--type\x20\x22'+_0x215b4a+_0x3d89d7(0x198)),0x1;const _0x321eb4=withJsonFormat(_0x4331e0),{journeyId:_0x46272f,journeyName:_0x1be614}=await resolveJourneyIdFromInput(_0x12ac1e,_0x321eb4,_0x1a015c),_0x129157={'type':_0x215b4a,'from':_0x4c09fb,'to':_0x4e1343,'limit':_0x57f89b},_0x56f486=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x1a015c[_0x3d89d7(0x18f)][_0x3d89d7(0x169)](_0x46272f,_0x129157),{'verbose':_0x321eb4['verbose']}),_0x311f94=_0x56f486[_0x3d89d7(0xfa)],_0x4c2973=_0x311f94[_0x3d89d7(0x18a)]&&(_0x311f94[_0x3d89d7(0x18a)][_0x3d89d7(0x1a1)][_0x3d89d7(0x1dc)]>0x0||_0x311f94[_0x3d89d7(0x18a)][_0x3d89d7(0x170)][_0x3d89d7(0x1dc)]>0x0),_0x146a49=_0x311f94[_0x3d89d7(0x144)]&&_0x311f94['activation'][_0x3d89d7(0x1dc)]>0x0;if(!_0x4c2973&&!_0x146a49)return console[_0x3d89d7(0x196)](_0x3d89d7(0x1a3)+_0x1be614),console[_0x3d89d7(0x196)](_0x3d89d7(0xfe)),_0x4c09fb&&_0x4e1343&&console[_0x3d89d7(0x196)](_0x3d89d7(0x185)),0x0;return await handleSingleObjectOutput(_0x311f94,_0x321eb4),0x0;}}function formatStageStats(_0xd47ce5,_0x2fd0e7){const _0x49acd9=a27_0x53a51e,_0x39dfb0=_0x2fd0e7[_0x49acd9(0x153)]&&_0xd47ce5[_0x49acd9(0x1fb)]?.['length']?aggregateStageHistory(_0xd47ce5[_0x49acd9(0x1fb)]):{'size':_0xd47ce5[_0x49acd9(0x19c)],'entered':_0xd47ce5[_0x49acd9(0x13b)],'milestone':_0xd47ce5[_0x49acd9(0x1cc)],'milestone_rate':_0xd47ce5[_0x49acd9(0x1ee)],'exit_or_jump':_0xd47ce5[_0x49acd9(0x1be)],'exit_or_jump_rate':_0xd47ce5[_0x49acd9(0x17d)]},_0x58b7f6={'id':_0xd47ce5['id'],'name':_0x2fd0e7['stageNameMap'][_0x49acd9(0xf9)](_0xd47ce5['id'])??_0xd47ce5['id'],..._0x39dfb0};return _0x2fd0e7[_0x49acd9(0x153)]&&_0x2fd0e7[_0x49acd9(0x17a)]&&_0xd47ce5[_0x49acd9(0x1fb)]&&(_0x58b7f6['history']=_0xd47ce5[_0x49acd9(0x1fb)]),_0x58b7f6;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x53a51e(0x10a);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1b8);async[a27_0x53a51e(0x1f1)](_0x2b8829){const _0x567bfc=a27_0x53a51e,{options:_0x5793e0,args:_0xf569ea,tdx:_0x1e89ee}=_0x2b8829,_0x1af1f0=_0xf569ea[0x0];if(!requireNameOrPath(_0x1af1f0))return 0x1;_0x5793e0[_0x567bfc(0x121)]&&console[_0x567bfc(0x196)](_0x567bfc(0x1c9)+_0x1af1f0);const {journeyId:_0x4d824d,journeyName:_0x5d562e}=await resolveJourneyIdFromInput(_0x1af1f0,_0x5793e0,_0x1e89ee);if(!_0x5793e0['yes']){const _0x20fe79=await confirm(_0x567bfc(0xf5)+_0x5d562e+'\x22?');if(!_0x20fe79)return console[_0x567bfc(0x196)]('Cancelled'),0x0;}const _0x1fcb49=await withSpinner(_0x567bfc(0xf7),()=>_0x1e89ee[_0x567bfc(0x18f)][_0x567bfc(0x1df)](_0x4d824d),{'verbose':_0x5793e0[_0x567bfc(0x121)]}),_0x20ecf2=_0x1fcb49[_0x567bfc(0xfa)];return console['error'](_0x567bfc(0x11a)+_0x20ecf2[_0x567bfc(0xfc)][_0x567bfc(0x108)]+_0x567bfc(0x1b7)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x53a51e(0x106);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1d6);async[a27_0x53a51e(0x1f1)](_0x359150){const _0x484d4f=a27_0x53a51e,{options:_0x2fc28c,args:_0x11392e,tdx:_0x2717cb}=_0x359150,_0x561988=_0x11392e[0x0];if(!requireNameOrPath(_0x561988))return 0x1;_0x2fc28c[_0x484d4f(0x121)]&&console[_0x484d4f(0x196)]('Input:\x20'+_0x561988);const {journeyId:_0x2cae2e,journeyName:_0x2f94e4}=await resolveJourneyIdFromInput(_0x561988,_0x2fc28c,_0x2717cb);if(!_0x2fc28c['yes']){const _0x4e6c93=await confirm(_0x484d4f(0x19f)+_0x2f94e4+'\x22?');if(!_0x4e6c93)return console[_0x484d4f(0x196)](_0x484d4f(0x116)),0x0;}const _0x160dd7=await withSpinner(_0x484d4f(0x105),()=>_0x2717cb[_0x484d4f(0x18f)]['resume'](_0x2cae2e),{'verbose':_0x2fc28c['verbose']}),_0x335cd8=_0x160dd7['data'];return console[_0x484d4f(0x196)](_0x484d4f(0x11a)+_0x335cd8[_0x484d4f(0xfc)]['name']+_0x484d4f(0x11f)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x53a51e(0x108)]='journey:pull';[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x157);async[a27_0x53a51e(0x1f1)](_0x24c8c3){const _0x35a253=a27_0x53a51e,{options:_0x34653a,args:_0x4dc1ba,tdx:_0x2dea17}=_0x24c8c3,_0x588306=_0x34653a,_0x2f829f=_0x4dc1ba[0x0],_0x37f9eb=_0x2f829f&&isYamlFilePath(_0x2f829f),_0x3607d0=await resolveTarget({'arg':_0x37f9eb?_0x2f829f:undefined,'contextParent':_0x34653a[_0x35a253(0x163)],'cwd':process[_0x35a253(0x1ea)]()});if(!isSuccessfulResolution(_0x3607d0))return _0x3607d0[_0x35a253(0x13d)]==='no_parent'?(console[_0x35a253(0x196)](a27_0x564625['yellow'](_0x35a253(0x154))),console[_0x35a253(0x196)](_0x35a253(0x16d)),console[_0x35a253(0x196)](_0x35a253(0x1d5)),console[_0x35a253(0x196)](_0x35a253(0x100)),console['error'](_0x35a253(0x1a4))):(console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x10c)]('Error:\x20'+_0x3607d0[_0x35a253(0x148)]+'\x0a')),_0x3607d0[_0x35a253(0x125)]&&console['error'](a27_0x564625[_0x35a253(0x171)](_0x3607d0[_0x35a253(0x125)]))),0x1;let _0x16d25f=_0x37f9eb?undefined:_0x2f829f,_0x8bdabd,_0x24d66d;_0x3607d0[_0x35a253(0x1da)]===_0x35a253(0x186)&&(_0x16d25f=_0x3607d0[_0x35a253(0x1cd)],_0x8bdabd=_0x3607d0['filePath'],_0x24d66d=_0x3607d0[_0x35a253(0x10d)]);const _0x201ec8=_0x3607d0['parentName'],_0x4c075e=_0x3607d0[_0x35a253(0x134)];_0x588306[_0x35a253(0x121)]&&(console[_0x35a253(0x196)](_0x35a253(0x1a5)+_0x201ec8),console['error'](_0x35a253(0x197)+_0x4c075e),_0x16d25f&&console[_0x35a253(0x196)](_0x35a253(0x14e)+_0x16d25f),_0x8bdabd&&console[_0x35a253(0x196)](_0x35a253(0x1f6)+_0x8bdabd),_0x24d66d&&console[_0x35a253(0x196)](_0x35a253(0x123)+_0x24d66d));const _0x8148a0=await withSpinner(_0x35a253(0x1b6),()=>_0x2dea17[_0x35a253(0x138)]['resolveParentId'](_0x201ec8),{'verbose':_0x34653a[_0x35a253(0x121)]}),_0x52011f=_0x8148a0[_0x35a253(0xfa)],{journeys:_0x2413a6,folders:_0x2fc8b0}=await withSpinner(_0x35a253(0x1ce),async()=>{const _0x272e88=_0x35a253,[_0x1a8730,_0xe818d7]=await Promise['all']([_0x2dea17[_0x272e88(0x18f)][_0x272e88(0x1b2)](_0x52011f,undefined,{'includeAllVersions':!![]}),_0x2dea17[_0x272e88(0x138)][_0x272e88(0x17f)](_0x52011f)]);return{'journeys':_0x1a8730,'folders':_0xe818d7};},{'verbose':_0x34653a[_0x35a253(0x121)]})['then'](_0x225fe6=>_0x225fe6[_0x35a253(0xfa)]);let _0x4e8e5b=_0x2413a6;const _0x38ef0f=buildFolderIdToPathMap(_0x2fc8b0);if(_0x16d25f){const _0x12b43b=_0x4e8e5b[_0x35a253(0x1f5)](_0x158e91=>_0x158e91[_0x35a253(0x149)][_0x35a253(0x156)]()===_0x16d25f[_0x35a253(0x156)]());if(_0x12b43b[_0x35a253(0x1dc)]===0x0)return console[_0x35a253(0x196)](_0x35a253(0x180)+_0x16d25f),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x4e8e5b=_0x12b43b;}if(_0x24d66d!==undefined){const _0x409ae8=_0x4e8e5b[_0x35a253(0x1f5)](_0x199892=>{const _0x589f44=_0x35a253,_0x150849=_0x199892[_0x589f44(0x184)]?_0x38ef0f[_0x589f44(0xf9)](_0x199892['folderId'])||'':'';return _0x150849===_0x24d66d;});if(_0x409ae8['length']===0x0&&_0x4e8e5b[_0x35a253(0x1dc)]>0x0){console['error'](_0x35a253(0x1db)+_0x16d25f+'\x27\x20not\x20found\x20in\x20'+(_0x24d66d||_0x35a253(0x16c))),console[_0x35a253(0x196)](_0x35a253(0x18c));for(const _0x387359 of _0x4e8e5b){const _0x52650a=_0x387359[_0x35a253(0x184)]?_0x38ef0f[_0x35a253(0xf9)](_0x387359[_0x35a253(0x184)])||'':'';console[_0x35a253(0x196)]('\x20\x20-\x20'+(_0x52650a||_0x35a253(0x1b5))+'/'+_0x387359[_0x35a253(0x149)]);}return 0x1;}_0x4e8e5b=_0x409ae8;}if(_0x4e8e5b['length']===0x0)return console[_0x35a253(0x196)]('No\x20journeys\x20found'),0x0;const _0x15dce8=new Map();for(const _0x313346 of _0x4e8e5b){const _0x38938d=_0x313346['journeyBundleId'];!_0x15dce8['has'](_0x38938d)&&_0x15dce8[_0x35a253(0xf3)](_0x38938d,[]),_0x15dce8[_0x35a253(0xf9)](_0x38938d)[_0x35a253(0x11d)](_0x313346);}for(const _0x299d26 of _0x15dce8['values']()){_0x299d26[_0x35a253(0xf1)]((_0xc7d769,_0x16cf61)=>(_0xc7d769[_0x35a253(0x127)]||0x0)-(_0x16cf61[_0x35a253(0x127)]||0x0));}const _0x140b8d=[],{idToEmailMap:_0x5c709c,connectionIdToNameMap:_0x586ae3}=await withSpinner(_0x35a253(0x1f9),async()=>{const _0x33e20f=_0x35a253,[_0x4a4c9e,_0x1d3d54]=await Promise[_0x33e20f(0x1eb)]([_0x2dea17[_0x33e20f(0x1f8)][_0x33e20f(0x17c)](),_0x2dea17[_0x33e20f(0x193)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x4a4c9e,'connectionIdToNameMap':_0x1d3d54};},{'verbose':_0x34653a[_0x35a253(0x121)]})[_0x35a253(0x102)](_0x1cc420=>_0x1cc420['data']);for(const _0xe5d873 of _0x15dce8[_0x35a253(0x167)]()){const _0x4460a9=_0xe5d873[0x0][_0x35a253(0x149)],_0x2c58bb=_0xe5d873[0x0][_0x35a253(0x184)],_0x3ba6d6=_0x2c58bb?_0x38ef0f[_0x35a253(0xf9)](_0x2c58bb)||'':'',_0xba407c=_0x3ba6d6?a27_0x2ae22b['join'](_0x4c075e,_0x3ba6d6):_0x4c075e,_0x38ec39=_0x8bdabd||a27_0x2ae22b[_0x35a253(0x1cb)](_0xba407c,sanitizeFileName(_0x4460a9)+_0x35a253(0x19b));let _0x19b60f,_0x10c93c;if(existsSync(_0x38ec39))try{const _0x3d1ecc=readFileSync(_0x38ec39,'utf-8'),_0x52aa91=parseYamlString(_0x3d1ecc);_0x10c93c=_0x52aa91,_0x19b60f=buildRuleToNameMapping(_0x52aa91),_0x588306[_0x35a253(0x121)]&&_0x19b60f[_0x35a253(0x19c)]>0x0&&console[_0x35a253(0x196)]('Found\x20'+_0x19b60f['size']+_0x35a253(0x1d0)+_0x4460a9);}catch(_0x25d266){_0x588306[_0x35a253(0x121)]&&console[_0x35a253(0x196)](_0x35a253(0xfd)+_0x25d266[_0x35a253(0x148)]);}const _0x22a5d8=[],_0x5116e5=new Set(),_0xde3919=new Map(),_0xbfc2e5=new Map(),_0x579cc2=new Set(),_0x1f7245=new Map(),_0x1903ab=new Map(),_0x257c49=createJumpTargetCache();await withProgressSpinner(_0x35a253(0x17e)+_0x4460a9+_0x35a253(0x1d8),async _0x2da00e=>{const _0x2c04e3=_0x35a253;for(const _0x210298 of _0xe5d873){const _0x9184e9=_0xe5d873[_0x2c04e3(0x1dc)]>0x1?_0x210298[_0x2c04e3(0x149)]+'\x20v'+(_0x210298[_0x2c04e3(0x127)]||0x1):_0x210298['journeyBundleName'];_0x2da00e[_0x2c04e3(0x110)]('Fetching\x20'+_0x9184e9);const _0x12368c=await _0x2dea17['journey'][_0x2c04e3(0x113)](_0x210298['id']),_0x84b709=_0x12368c[_0x2c04e3(0xfc)]?.['audienceId'],_0x1fc397={'resolveSegment':async _0x52d2c0=>{const _0x51b9f1=_0x2c04e3;if(!_0x84b709)return{'name':_0x52d2c0,'isJourneyLocal':![]};const _0x21db33=_0xde3919[_0x51b9f1(0xf9)](_0x52d2c0);if(_0x21db33)return _0x21db33;try{const _0x5a8a79=await _0x2dea17[_0x51b9f1(0x138)][_0x51b9f1(0x118)](_0x84b709,_0x52d2c0),_0x23f5d4=_0x5a8a79[_0x51b9f1(0x187)]===SEGMENT_KIND_JOURNEY;let _0x5a274d,_0x13a09f=_0x5a8a79[_0x51b9f1(0x108)];if(_0x23f5d4&&_0x5a8a79[_0x51b9f1(0x140)]){const _0x331e88=await segmentResponseToDef(_0x5a8a79,{'resolveSegmentName':async _0x300922=>{const _0x1ab168=_0x51b9f1,_0x5d1173=_0xde3919[_0x1ab168(0xf9)](_0x300922);if(_0x5d1173)return _0x5d1173[_0x1ab168(0x108)];const _0x4dbe9b=await _0x1fc397[_0x1ab168(0x159)](_0x300922);return _0x4dbe9b[_0x1ab168(0x108)];}}),_0xb17715=_0x331e88[_0x51b9f1(0x140)];_0x5a274d={'description':_0x5a8a79[_0x51b9f1(0xf8)],'rule':_0xb17715};const _0x5e8a75=serializeRule(_0xb17715),_0x228c7a=_0xbfc2e5[_0x51b9f1(0xf9)](_0x5e8a75);if(_0x228c7a)_0x13a09f=_0x228c7a,_0x5a274d=undefined,_0x588306['verbose']&&console[_0x51b9f1(0x196)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x5a8a79[_0x51b9f1(0x108)]+_0x51b9f1(0x1de)+_0x228c7a);else{let _0x1964b3=![];if(_0x19b60f){const _0x12fc79=_0x19b60f[_0x51b9f1(0xf9)](_0x5e8a75);if(_0x12fc79){const _0x4794da=_0x12fc79[_0x51b9f1(0xff)](_0xede5e1=>!_0x5116e5[_0x51b9f1(0x1f3)](_0xede5e1));_0x4794da&&(_0x13a09f=_0x4794da,_0x5116e5[_0x51b9f1(0x1e9)](_0x4794da),_0xbfc2e5[_0x51b9f1(0xf3)](_0x5e8a75,_0x4794da),_0x1964b3=!![],_0x588306[_0x51b9f1(0x121)]&&console[_0x51b9f1(0x196)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x4794da+_0x51b9f1(0x1a6)));}}if(!_0x1964b3){const _0x5337f0=generateJourneyLocalName(_0x5a8a79[_0x51b9f1(0x108)]);_0x5337f0&&(_0x13a09f=_0x5337f0);let _0x5a9d8b=_0x13a09f,_0x554c85=0x2;while(_0x5116e5[_0x51b9f1(0x1f3)](_0x5a9d8b)){_0x5a9d8b=_0x13a09f+'_'+_0x554c85,_0x554c85++;}_0x5116e5[_0x51b9f1(0x1e9)](_0x5a9d8b),_0xbfc2e5[_0x51b9f1(0xf3)](_0x5e8a75,_0x5a9d8b),_0x13a09f=_0x5a9d8b;}}}const _0xe84fe7={'name':_0x13a09f,'isJourneyLocal':_0x23f5d4,'definition':_0x5a274d};return _0xde3919[_0x51b9f1(0xf3)](_0x52d2c0,_0xe84fe7),_0xe84fe7;}catch(_0x42fb5d){return _0x34653a[_0x51b9f1(0x121)]&&console[_0x51b9f1(0x196)](_0x51b9f1(0x19a)+_0x52d2c0+':\x20'+_0x42fb5d['message']),{'name':_0x52d2c0,'isJourneyLocal':![]};}},'resolveActivation':async _0x6a0988=>{const _0x2ed7c1=_0x2c04e3,_0x559a57=_0x1f7245[_0x2ed7c1(0xf9)](_0x6a0988);if(_0x559a57)return _0x559a57;try{const _0x49bc5c=await _0x2dea17[_0x2ed7c1(0x18f)][_0x2ed7c1(0xf4)](_0x210298['id'],_0x6a0988),_0x5c7441=journeyActivationStepToYaml(_0x49bc5c,_0x5c709c,_0x586ae3),_0xee63ae=JSON['stringify']({'name':_0x5c7441['name'],'connection':_0x5c7441[_0x2ed7c1(0x193)],'connector_config':_0x5c7441[_0x2ed7c1(0x151)]}),_0x4331cb=_0x1903ab[_0x2ed7c1(0xf9)](_0xee63ae);if(_0x4331cb){const _0x41ff98={'name':_0x4331cb,'isJourneyLocal':!![],'definition':_0x5c7441};return _0x1f7245[_0x2ed7c1(0xf3)](_0x6a0988,_0x41ff98),_0x41ff98;}const _0x59cb3b=_0x49bc5c['attributes']['activationParams'][_0x2ed7c1(0x108)]||_0x6a0988,_0x2c73b5=sanitizeYamlKey(_0x59cb3b)||'activation_'+_0x6a0988;let _0x598158=_0x2c73b5,_0x5bfba5=0x2;while(_0x579cc2[_0x2ed7c1(0x1f3)](_0x598158)){_0x598158=_0x2c73b5+'_'+_0x5bfba5,_0x5bfba5++;}_0x579cc2[_0x2ed7c1(0x1e9)](_0x598158),_0x1903ab['set'](_0xee63ae,_0x598158);const _0x4e7b91={'name':_0x598158,'isJourneyLocal':!![],'definition':_0x5c7441};return _0x1f7245[_0x2ed7c1(0xf3)](_0x6a0988,_0x4e7b91),_0x4e7b91;}catch(_0x4e4e5d){return _0x34653a['verbose']&&console[_0x2ed7c1(0x196)](_0x2ed7c1(0x1f4)+_0x6a0988+':\x20'+_0x4e4e5d[_0x2ed7c1(0x148)]),{'name':_0x6a0988,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x2d7fd4,_0x4f9e39)=>{const _0x4d8e3b=_0x2c04e3;return resolveJumpTarget(_0x2d7fd4,_0x4f9e39,_0x257c49,_0xee3a5=>_0x2dea17[_0x4d8e3b(0x18f)]['getJourney'](_0xee3a5));}},_0x2895d4=await journeyResponseToDef(_0x12368c,_0x1fc397);_0x22a5d8[_0x2c04e3(0x11d)]({'item':_0x210298,'yaml':_0x2895d4});}},{'verbose':_0x34653a[_0x35a253(0x121)]});const _0x1face8=await _0x2dea17[_0x35a253(0x18f)][_0x35a253(0x122)](_0xe5d873[0x0][_0x35a253(0x182)]),_0x1ae337=buildMergedJourneyDef(_0x22a5d8,_0x19b60f,_0x1face8),_0x376381=normalizeJourneyDef(_0x1ae337,_0x10c93c),_0x38b865=toYamlString(_0x376381),_0x4f85d7=_0x8bdabd||a27_0x2ae22b[_0x35a253(0x1cb)](_0xba407c,sanitizeFileName(_0x4460a9)+'.yml');!_0x8bdabd&&_0x3ba6d6&&!existsSync(_0xba407c)&&mkdirSync(_0xba407c,{'recursive':!![]});const _0x151d1a=a27_0x2ae22b[_0x35a253(0xf0)](process[_0x35a253(0x1ea)](),_0x4f85d7);if(existsSync(_0x4f85d7)){const _0x3a29bb=readFileSync(_0x4f85d7,_0x35a253(0x133)),_0x51980c=generateDiff(_0x3a29bb,_0x38b865),_0x2b970d=hasChanges(_0x51980c);_0x140b8d['push']({'relativePath':_0x151d1a,'absolutePath':_0x4f85d7,'content':_0x38b865,'isNew':![],'hasChanges':_0x2b970d,'diff':_0x2b970d?formatDiffWithColors(_0x51980c):undefined});}else _0x140b8d[_0x35a253(0x11d)]({'relativePath':_0x151d1a,'absolutePath':_0x4f85d7,'content':_0x38b865,'isNew':!![],'hasChanges':![]});}const _0x5c2a94=_0x140b8d[_0x35a253(0x1f5)](_0x4795a4=>_0x4795a4[_0x35a253(0x195)]),_0x187844=_0x140b8d[_0x35a253(0x1f5)](_0x4e0dce=>!_0x4e0dce['isNew']&&_0x4e0dce[_0x35a253(0x10f)]),_0x5bcf4b=_0x140b8d[_0x35a253(0x1f5)](_0x226e1e=>!_0x226e1e[_0x35a253(0x195)]&&!_0x226e1e['hasChanges']),_0x4af3ed=_0x4e8e5b[_0x35a253(0x1dc)],_0x232e2a=_0x15dce8[_0x35a253(0x19c)],_0x2d1fcd=_0x4af3ed>_0x232e2a?'\x20('+_0x4af3ed+_0x35a253(0x143):'';console[_0x35a253(0x196)](_0x35a253(0x1fe)),console['error']('\x20\x20'+a27_0x564625[_0x35a253(0x171)](_0x232e2a+'\x20journeys')+a27_0x564625[_0x35a253(0x150)](_0x2d1fcd)),console['error']('\x20\x20'+a27_0x564625[_0x35a253(0x1ba)]('+\x20'+_0x5c2a94[_0x35a253(0x1dc)]+_0x35a253(0x101))),console[_0x35a253(0x196)]('\x20\x20'+a27_0x564625[_0x35a253(0x1ab)]('~\x20'+_0x187844['length']+_0x35a253(0x183))),console['error']('\x20\x20'+a27_0x564625[_0x35a253(0x150)]('=\x20'+_0x5bcf4b[_0x35a253(0x1dc)]+_0x35a253(0x126))),console[_0x35a253(0x196)](_0x35a253(0x1fa)+a27_0x564625[_0x35a253(0x171)](_0x4c075e)+'\x0a');if(_0x187844[_0x35a253(0x1dc)]>0x0)for(const _0xea825c of _0x187844){console['error'](_0x35a253(0x1c5)+_0xea825c[_0x35a253(0x1c1)]+'\x27:'),console['error']('─'[_0x35a253(0x1e8)](0x3c)),console['error'](_0xea825c[_0x35a253(0x179)]),console[_0x35a253(0x196)]('─'[_0x35a253(0x1e8)](0x3c));}if(_0x588306[_0x35a253(0x1c7)])return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ab)](_0x35a253(0x11e))),0x0;if(_0x5c2a94[_0x35a253(0x1dc)]===0x0&&_0x187844['length']===0x0)return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ba)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x201ec8},_0x588306[_0x35a253(0x1b3)]),console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ba)]('✔\x20Context\x20set:\x20'+a27_0x564625[_0x35a253(0x150)](_0x35a253(0x1e0))+_0x35a253(0x178)+a27_0x564625[_0x35a253(0x171)](_0x201ec8))),0x0;if(!_0x588306['yes']&&(_0x5c2a94[_0x35a253(0x1dc)]>0x0||_0x187844[_0x35a253(0x1dc)]>0x0)){if(!isInteractive())return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x10c)]('\x0aError:'),_0x35a253(0x15a)),console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x150)](_0x35a253(0x18b))),0x1;const _0x1fbdf4=await confirmKey(_0x35a253(0x1b9)+(_0x5c2a94['length']+_0x187844[_0x35a253(0x1dc)])+_0x35a253(0x14c));if(!_0x1fbdf4)return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ab)]('Aborted.'),_0x35a253(0x139)),0x1;}!existsSync(_0x4c075e)&&mkdirSync(_0x4c075e,{'recursive':!![]});const _0x11d29c=a27_0x2ae22b['join'](_0x4c075e,'tdx.json');writeFileSync(_0x11d29c,createTdxConfigContent(_0x201ec8),_0x35a253(0x133));for(const _0x40b209 of _0x140b8d){(_0x40b209[_0x35a253(0x195)]||_0x40b209[_0x35a253(0x10f)])&&writeFileSync(_0x40b209[_0x35a253(0x181)],_0x40b209[_0x35a253(0x176)],_0x35a253(0x133));}return console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ba)](_0x35a253(0x14d)+(_0x5c2a94['length']+_0x187844[_0x35a253(0x1dc)])+_0x35a253(0x1d4)+_0x4c075e)),saveSessionContext({'parent_segment':_0x201ec8},_0x588306[_0x35a253(0x1b3)]),console[_0x35a253(0x196)](a27_0x564625[_0x35a253(0x1ba)]('✔\x20Context\x20set:\x20'+a27_0x564625[_0x35a253(0x150)](_0x35a253(0x1e0))+_0x35a253(0x178)+a27_0x564625[_0x35a253(0x171)](_0x201ec8))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x174);['description']=a27_0x53a51e(0x13a);async[a27_0x53a51e(0x1f1)](_0x3f84a2){const _0x40407b=a27_0x53a51e,{options:_0x3a2b6a,args:_0x355e83,tdx:_0x1b4575}=_0x3f84a2,_0x479a33=_0x355e83[0x0];if(!requireNameOrPath(_0x479a33))return 0x1;_0x3a2b6a[_0x40407b(0x121)]&&console[_0x40407b(0x196)]('Input:\x20'+_0x479a33);const {journeyId:_0x1262fa}=await resolveJourneyIdFromInput(_0x479a33,_0x3a2b6a,_0x1b4575),_0x3ba217=await withSpinner(_0x40407b(0x192),()=>_0x1b4575['journey'][_0x40407b(0x1ec)](_0x1262fa),{'verbose':_0x3a2b6a[_0x40407b(0x121)]}),_0x107dbc=_0x3ba217[_0x40407b(0xfa)];return console[_0x40407b(0x1a9)](_0x40407b(0x142)+_0x107dbc[_0x40407b(0x1d9)]),console[_0x40407b(0x1a9)](_0x40407b(0x152)+_0x107dbc['table']),await handleSDKOutput(_0x107dbc[_0x40407b(0x1a7)],_0x3a2b6a),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x12d);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1a0);async[a27_0x53a51e(0x1f1)](_0x681c63){const _0x2c8faf=a27_0x53a51e,{options:_0x864663,args:_0x5bf70b,tdx:_0xaa584a}=_0x681c63,_0x439de7=_0x5bf70b[0x0];if(!requireNameOrPath(_0x439de7))return 0x1;_0x864663[_0x2c8faf(0x121)]&&console[_0x2c8faf(0x196)](_0x2c8faf(0x1c9)+_0x439de7);const {journeyId:_0x46eeb4}=await resolveJourneyIdFromInput(_0x439de7,_0x864663,_0xaa584a),_0x79dac8=await withSpinner(_0x2c8faf(0x14f),()=>_0xaa584a[_0x2c8faf(0x18f)][_0x2c8faf(0x1fd)](_0x46eeb4),{'verbose':_0x864663[_0x2c8faf(0x121)]}),_0x4d85ae=_0x79dac8[_0x2c8faf(0xfa)];return console[_0x2c8faf(0x196)](_0x2c8faf(0x12b)+_0x4d85ae[_0x2c8faf(0x1dc)]+_0x2c8faf(0x191)+(_0x4d85ae[_0x2c8faf(0x1dc)]!==0x1?'s':'')),await handleSDKOutput(_0x4d85ae,_0x864663),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x18d);['description']=a27_0x53a51e(0x173);[a27_0x53a51e(0x1cf)]=new SegmentPushCommand();async[a27_0x53a51e(0x1f1)](_0x303bd2){const _0x39bbf3=a27_0x53a51e,_0x5a21d4=_0x303bd2[_0x39bbf3(0x13e)][0x0];let _0x494bde;if(_0x5a21d4){const _0x500ddd=await resolveTarget({'arg':_0x5a21d4,'contextParent':_0x303bd2[_0x39bbf3(0x117)][_0x39bbf3(0x163)],'cwd':process[_0x39bbf3(0x1ea)]()});isSuccessfulResolution(_0x500ddd)&&_0x500ddd['type']===_0x39bbf3(0x186)&&(_0x494bde=_0x500ddd[_0x39bbf3(0x1a8)]);}const _0x213b2c={..._0x303bd2,'options':{..._0x303bd2[_0x39bbf3(0x117)],'journeysOnly':!![],..._0x494bde&&{'singleFilePath':_0x494bde}}};return this[_0x39bbf3(0x1cf)][_0x39bbf3(0x1f1)](_0x213b2c);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x53a51e(0x108)]=a27_0x53a51e(0x14a);[a27_0x53a51e(0xf8)]=a27_0x53a51e(0x1e2);async[a27_0x53a51e(0x1f1)](_0x16d5f0){const _0x4bb37c=a27_0x53a51e,{options:_0x38ea07,args:_0x28ceae,tdx:_0x206cab}=_0x16d5f0,_0x4982e7=_0x28ceae[0x0];if(!requireNameOrPath(_0x4982e7))return 0x1;if(_0x38ea07['verbose'])console[_0x4bb37c(0x196)](_0x4bb37c(0x1c9)+_0x4982e7);const {journeyId:_0x2b1ed9}=await resolveJourneyIdFromInput(_0x4982e7,_0x38ea07,_0x206cab),_0x23c0a6=await withSpinner(_0x4bb37c(0x145),()=>_0x206cab[_0x4bb37c(0x18f)][_0x4bb37c(0x15f)](_0x2b1ed9),{'verbose':_0x38ea07[_0x4bb37c(0x121)]}),{bundleName:_0x3b1ff8,versions:_0x387598,latestJourneyId:_0x4e5a18}=_0x23c0a6[_0x4bb37c(0xfa)];console[_0x4bb37c(0x196)](_0x3b1ff8+':\x20'+_0x387598[_0x4bb37c(0x1dc)]+_0x4bb37c(0x13f)+(_0x387598[_0x4bb37c(0x1dc)]!==0x1?'s':''));const _0x2f3074=_0x387598[_0x4bb37c(0x172)](_0x29d467=>({'version':_0x29d467['versionNumber'],'journey_id':_0x29d467[_0x4bb37c(0x1c6)],'name':_0x29d467['name'],'state':_0x29d467[_0x4bb37c(0x12a)],'paused':_0x29d467['paused'],'latest':_0x29d467[_0x4bb37c(0x1c6)]===_0x4e5a18,'created_at':_0x29d467[_0x4bb37c(0x200)]}));return await handleSDKOutput(_0x2f3074,_0x38ea07),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x53a51e(0x108)]='journey:version:create';[a27_0x53a51e(0xf8)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x53a51e(0x1f1)](_0x41c815){const _0x217db4=a27_0x53a51e,{options:_0x5d5205,args:_0x46a9f3,tdx:_0x426c99}=_0x41c815,_0x2c66e8=_0x46a9f3[0x0];if(!requireNameOrPath(_0x2c66e8))return 0x1;if(_0x5d5205['verbose'])console[_0x217db4(0x196)]('Input:\x20'+_0x2c66e8);const {journeyId:_0x1181e8,journeyName:_0x143f76}=await resolveJourneyIdFromInput(_0x2c66e8,_0x5d5205,_0x426c99);if(!_0x5d5205[_0x217db4(0x1f0)]){const _0x2af9db=await confirm(_0x217db4(0x175)+_0x143f76+'\x22?');if(!_0x2af9db)return console[_0x217db4(0x196)](_0x217db4(0x116)),0x0;}const _0x19ca77=await withSpinner(_0x217db4(0x199),()=>_0x426c99['journey'][_0x217db4(0x177)](_0x1181e8),{'verbose':_0x5d5205[_0x217db4(0x121)]}),_0x3a4bef=_0x19ca77[_0x217db4(0xfa)];return console[_0x217db4(0x196)](a27_0x564625['green']('✔')+_0x217db4(0x1b1)+_0x3a4bef[_0x217db4(0xfc)][_0x217db4(0x127)]+_0x217db4(0x1bd)+_0x3a4bef['attributes'][_0x217db4(0x108)]+'\x22'),console[_0x217db4(0x196)](_0x217db4(0x160)+_0x3a4bef['id']),await handleSingleObjectOutput({'id':_0x3a4bef['id'],'name':_0x3a4bef[_0x217db4(0xfc)][_0x217db4(0x108)],'version':_0x3a4bef['attributes']['versionNumber'],'state':_0x3a4bef['attributes'][_0x217db4(0x12a)],'bundle_id':_0x3a4bef[_0x217db4(0xfc)][_0x217db4(0x182)],'created_at':_0x3a4bef[_0x217db4(0xfc)][_0x217db4(0x200)]},_0x5d5205),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x53a51e(0x108)]='journey:version:view';['description']=a27_0x53a51e(0x1e6);async[a27_0x53a51e(0x1f1)](_0x4a6521){const _0x45bbd1=a27_0x53a51e,{options:_0x2bd522,args:_0x274fc2,tdx:_0x571e12}=_0x4a6521,_0x1f4668=_0x274fc2[0x0];if(!requireNameOrPath(_0x1f4668))return 0x1;const _0x51aa14=_0x2bd522['version'];if(!_0x51aa14)return console['error'](_0x45bbd1(0x124)),console[_0x45bbd1(0x196)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x41c54e=parseInt(_0x51aa14,0xa);if(isNaN(_0x41c54e)||_0x41c54e<0x1)return console[_0x45bbd1(0x196)](_0x45bbd1(0x112)+_0x51aa14),0x1;if(_0x2bd522[_0x45bbd1(0x121)])console[_0x45bbd1(0x196)]('Input:\x20'+_0x1f4668+_0x45bbd1(0x189)+_0x41c54e);const {journeyId:_0x547959,parentSegmentId:_0x4186e5}=await resolveJourneyIdFromInput(_0x1f4668,_0x2bd522,_0x571e12),_0x538417=await withSpinner(_0x45bbd1(0x194),()=>_0x571e12['journey'][_0x45bbd1(0x15f)](_0x547959),{'verbose':_0x2bd522[_0x45bbd1(0x121)]}),{versions:_0x4a2493,latestJourneyId:_0x3516de}=_0x538417['data'],_0x2d75b3=_0x4a2493[_0x45bbd1(0xff)](_0x57becc=>_0x57becc[_0x45bbd1(0x127)]===_0x41c54e);if(!_0x2d75b3){const _0x11de64=_0x4a2493['map'](_0x1256d1=>'v'+_0x1256d1['versionNumber'])[_0x45bbd1(0x1cb)](',\x20');return console[_0x45bbd1(0x196)]('Error:\x20Version\x20'+_0x41c54e+_0x45bbd1(0x146)+_0x11de64),0x1;}const _0x14a644=await withSpinner(_0x45bbd1(0x11c)+_0x41c54e+'\x20details...',()=>_0x571e12[_0x45bbd1(0x18f)]['getJourney'](_0x2d75b3['journeyId']),{'verbose':_0x2bd522[_0x45bbd1(0x121)]}),_0xbf1e05=_0x14a644[_0x45bbd1(0xfa)],_0x235709=getConsoleNextUrl(_0x2bd522[_0x45bbd1(0x165)],_0x45bbd1(0x109)+_0x4186e5+_0x45bbd1(0x12e)+_0x2d75b3[_0x45bbd1(0x1c6)]+_0x45bbd1(0x137));return await handleSingleObjectOutput({'id':_0xbf1e05['id'],'name':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x108)],'version':_0xbf1e05['attributes'][_0x45bbd1(0x127)],'description':_0xbf1e05[_0x45bbd1(0xfc)]['description'],'state':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x12a)],'paused':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x19d)],'reentry_mode':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x12f)],'stages':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x16b)]?.[_0x45bbd1(0x1dc)]||0x0,..._0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x129)]&&{'goal':_0xbf1e05[_0x45bbd1(0xfc)][_0x45bbd1(0x129)][_0x45bbd1(0x108)]},'latest':_0x2d75b3[_0x45bbd1(0x1c6)]===_0x3516de,'created_at':_0xbf1e05['attributes']['createdAt'],'updated_at':_0xbf1e05['attributes'][_0x45bbd1(0x1f2)],'url':_0x235709},_0x2bd522),0x0;}}
|
|
1
|
+
const a27_0x2f1e80=a27_0x26ca;(function(_0x5de078,_0x8a172a){const _0x59eb80=a27_0x26ca,_0xaf4d7d=_0x5de078();while(!![]){try{const _0x11be02=parseInt(_0x59eb80(0x14f))/0x1*(parseInt(_0x59eb80(0x19d))/0x2)+parseInt(_0x59eb80(0x1c6))/0x3+parseInt(_0x59eb80(0x18f))/0x4+-parseInt(_0x59eb80(0x181))/0x5+parseInt(_0x59eb80(0x192))/0x6*(parseInt(_0x59eb80(0xd9))/0x7)+-parseInt(_0x59eb80(0x170))/0x8+parseInt(_0x59eb80(0x186))/0x9*(-parseInt(_0x59eb80(0x183))/0xa);if(_0x11be02===_0x8a172a)break;else _0xaf4d7d['push'](_0xaf4d7d['shift']());}catch(_0x2c35f5){_0xaf4d7d['push'](_0xaf4d7d['shift']());}}}(a27_0x17c9,0xc55c2));import a27_0x1b29e0 from'chalk';import a27_0x3c39c9 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';function a27_0x26ca(_0x2e95f0,_0x155138){_0x2e95f0=_0x2e95f0-0xd2;const _0x17c932=a27_0x17c9();let _0x26ca9a=_0x17c932[_0x2e95f0];return _0x26ca9a;}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(_0x384a22){const _0x2bf945=a27_0x26ca;return!_0x384a22&&(console['error'](_0x2bf945(0x1c8)),console[_0x2bf945(0x164)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x384a22;}function withJsonFormat(_0x52fee9){const _0x31ad3e=a27_0x26ca;if(!_0x52fee9[_0x31ad3e(0x18e)]&&!_0x52fee9[_0x31ad3e(0x141)]&&!_0x52fee9[_0x31ad3e(0x1ba)]&&!_0x52fee9[_0x31ad3e(0x12d)])return{..._0x52fee9,'format':'json','json':!![]};return _0x52fee9;}function formatJourneyState(_0x31f7ea){const _0x474d17=a27_0x26ca;switch(_0x31f7ea){case _0x474d17(0x103):return a27_0x1b29e0[_0x474d17(0x174)](_0x474d17(0x189));case'draft':return a27_0x1b29e0['dim'](_0x474d17(0x13b));case _0x474d17(0xe9):return a27_0x1b29e0[_0x474d17(0xe7)](_0x474d17(0xf7));case _0x474d17(0x118):return a27_0x1b29e0[_0x474d17(0x148)](_0x474d17(0xf3));case _0x474d17(0x17e):return a27_0x1b29e0[_0x474d17(0x10d)](_0x474d17(0x116));default:return'('+_0x31f7ea+')';}}function formatJourneyItem(_0x5c4649,_0x210608='',_0x587e6c){const _0x4812b5=a27_0x26ca,_0x190cd0=formatJourneyState(_0x5c4649[_0x4812b5(0x104)]),_0x547a25=_0x587e6c?hyperlink(_0x5c4649[_0x4812b5(0xe4)],_0x587e6c):_0x5c4649['journeyBundleName'];return _0x210608+_0x4812b5(0x161)+_0x547a25+'\x20'+_0x190cd0;}function escapeRegex(_0x8c185){const _0x421c18=a27_0x26ca;return _0x8c185['replace'](/[.*+?^${}()|[\]\\]/g,_0x421c18(0x153));}function globToRegex(_0x14e549){const _0x1fe947=a27_0x26ca,_0x1d50c6=_0x14e549[_0x1fe947(0x1ca)]('*')[_0x1fe947(0x1d3)](escapeRegex);return new RegExp(_0x1d50c6[_0x1fe947(0x1b9)]('.*'),'i');}function a27_0x17c9(){const _0x3858a2=['Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','nodes','(root)','(draft)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20->\x20','Error:\x20Invalid\x20--type\x20\x22','enteredSize','Error:\x20--version\x20option\x20is\x20required','json','Export\x20journey(s)\x20as\x20YAML\x20files','has','errorCode','values','renderStats','getColumnMapping','blue','from','log','journey:pull','Fetching\x20parent\x20segment...','history','\x20unchanged\x20files','653fylguI','diff','message','tdx.json','\x5c$&','List\x20all\x20versions\x20of\x20a\x20journey','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','set','Listing\x20journey\x20activations...','\x20\x20Statistics\x20not\x20available','yes','toLowerCase','List\x20journeys\x20in\x20current\x20context','verbose','listActivationsFlat','Resuming\x20journey...','entries','journey:pause','🗺️\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Target\x20file:\x20','error','dryRun','createdAt','then','\x20(ID:\x20','setPhase','sort','\x22\x20resumed','content','Error:\x20Version\x20','Table:\x20','Resolved\x20YAML\x20file:\x20','4887888zDnBXz','helpText','journeyName','✔\x20Context\x20set:\x20','green','...','Fetching\x20','args','journey:resume','.yml','/e/','Cancelled','isNew','attributes','archived','site','Show\x20journey\x20details','385725lNKazB','filter','7301960DmFqqk','journeyBundleId','Options:','18PqGGxp','user','\x20(rule\x20match)','(running)','test','links','resolveJourneyId','Listing\x20journeys...','format','3450312lQqAno','journey:activations','segmentName','498PMoKrP','INVALID_ARGUMENT','\x20details...','absolutePath','name','/app/ps/','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Resume\x20a\x20paused\x20journey','/j/da/je','journey:versions','Parent\x20segment:\x20','1058ATtEJp','Pause\x20a\x20running\x20journey','\x20\x20-\x20','root\x20folder','find','\x20\x20Target:\x20','session','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Folder\x20path:\x20','resourceName','Journey\x20name:\x20','\x20versions)','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','no_parent','journey:version:view','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Error:\x20','resolveParentId','\x20journey\x20files\x20to\x20','✔\x20Pulled\x20','journey:list','\x20\x20Folder\x20path:\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','goalSize','exitOrJumpRate',',\x20version:\x20','Database:\x20','Aborted.','join','jsonl','completeMilestoneRate','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','all','Available\x20stages:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Getting\x20journey\x20traffic\x20data...','Listing\x20journey\x20versions...','filePath','red','description','base','1458894SJNzpe','journeyId','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20(draft)\x20—\x20\x22','split','segment','stringify','Resolving\x20version...','versionNumber','\x20changed\x20files','\x0aPull\x20summary:','activation','✔\x20Journey\x20\x22','map','buildIdToEmailMap','📁\x20','getActivation','conversion','cyan','\x20new\x20files','columns','options','106484TSogLY','push','cwd','kind','buildIdToNameMap','\x20activation','Input:\x20','Error:\x20Invalid\x20version\x20number:\x20','segments','\x20journey','Resolving\x20parent\x20segment...','journeyBundleName','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Error:\x20Stage\x20\x22','yellow','rule','paused','parentSegment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_segment','localeCompare','journey','relative','hasChanges','\x20version','includeHistory','(completed)','journeys','folderPath','folderId','(paused)','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','createVersion','journey:version:create','\x20\x20Preserving\x20local\x20segment\x20name:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','get','connection','journey:view','exitOrJumpSize','Warning:\x20Could\x20not\x20resolve\x20activation\x20','launched','state','repeat','/j/da','version','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','getJourney','data','stage','journeyStages','dim','\x27\x20not\x20found\x20in\x20','parentName','add','Getting\x20journey\x20statistics...','reentryMode','\x22\x20not\x20found','listVersions','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','(archived)','getTrafficData','completed','bold','milestoneSize','Found\x20','\x0aError:','\x20journeys','size','connector_config','Show\x20journey\x20table\x20column\x20mapping','length','getParentFull','\x20=\x20','file','includeStats','type','getStatistics','database','Getting\x20version\x20','completionRate','activation_','stages','tsv','hasPeriod','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20Opening\x20','goal','execute','utf-8','updatedAt','Pattern:\x20','listFolders','journey:stats'];a27_0x17c9=function(){return _0x3858a2;};return a27_0x17c9();}function buildRuleToNameMapping(_0x166c68){const _0x4d68a8=a27_0x26ca,_0x4ad25c=new Map();if(_0x166c68[_0x4d68a8(0xe1)])for(const [_0x504b2a,_0x51d0eb]of Object['entries'](_0x166c68['segments'])){if(_0x51d0eb[_0x4d68a8(0xe8)]){const _0x355ab2=serializeRule(_0x51d0eb[_0x4d68a8(0xe8)]),_0x33e9e3=_0x4ad25c['get'](_0x355ab2);_0x33e9e3?_0x33e9e3[_0x4d68a8(0xda)](_0x504b2a):_0x4ad25c['set'](_0x355ab2,[_0x504b2a]);}}return _0x4ad25c;}async function resolveJourneyIdFromInput(_0x3ba86b,_0x245543,_0x2d995a){const _0x5dab9a=a27_0x26ca,_0x5411ad=await resolveJourneyTarget(_0x3ba86b,_0x245543[_0x5dab9a(0xea)],_0x245543[_0x5dab9a(0x15c)]),_0x2ad67c=_0x5411ad[_0x5dab9a(0xea)];if(!_0x2ad67c)throw new SDKError(ErrorCode[_0x5dab9a(0x193)],_0x5dab9a(0x1b3));const _0x3e6a10=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2d995a[_0x5dab9a(0x1cb)]['resolveParentId'](_0x2ad67c),{'verbose':_0x245543['verbose']}),_0x220922=_0x3e6a10['data'],_0x803775=await withSpinner('Resolving\x20journey...',()=>_0x2d995a[_0x5dab9a(0xee)][_0x5dab9a(0x18c)](_0x220922,_0x5411ad[_0x5dab9a(0x172)]),{'verbose':_0x245543[_0x5dab9a(0x15c)]});return{'journeyId':_0x803775[_0x5dab9a(0x10a)],'journeyName':_0x5411ad['journeyName'],'parentSegmentId':_0x220922};}async function resolveJourneyTarget(_0x2cc96d,_0x44e7c2,_0x4997bb){const _0x44a3b0=a27_0x26ca;if(isYamlFilePath(_0x2cc96d))try{const _0x47fb18=await resolveYamlFilePath(_0x2cc96d);return _0x4997bb&&(console[_0x44a3b0(0x164)](_0x44a3b0(0x16f)+_0x2cc96d),console[_0x44a3b0(0x164)]('\x20\x20Parent\x20segment:\x20'+_0x47fb18[_0x44a3b0(0xea)]),console[_0x44a3b0(0x164)]('\x20\x20Name:\x20'+_0x47fb18[_0x44a3b0(0x191)]),console['error'](_0x44a3b0(0x1b2)+(_0x47fb18[_0x44a3b0(0xf5)]||_0x44a3b0(0x13a)))),{'journeyName':_0x47fb18[_0x44a3b0(0x191)],'parentSegment':_0x47fb18['parentSegment'],'resolved':_0x47fb18};}catch(_0x227f6d){throw new SDKError(ErrorCode[_0x44a3b0(0x193)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x227f6d[_0x44a3b0(0x151)]);}if(!_0x44e7c2)throw new SDKError(ErrorCode[_0x44a3b0(0x193)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x2cc96d,'parentSegment':_0x44e7c2};}export class JourneyListCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x1b1);[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x15b);async[a27_0x2f1e80(0x132)](_0x2b059d){const _0x19ca20=a27_0x2f1e80,{options:_0x106e35,args:_0x432434,tdx:_0x55d270}=_0x2b059d,_0x4b5fe8=_0x432434[0x0],_0x3e26d8=_0x106e35['parentSegment'];if(!_0x3e26d8)return console[_0x19ca20(0x164)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x19ca20(0x164)](_0x19ca20(0x155)),0x1;const _0x373c66=await withSpinner(_0x19ca20(0xe3),()=>_0x55d270[_0x19ca20(0x1cb)][_0x19ca20(0x1ae)](_0x3e26d8),{'verbose':_0x106e35['verbose']}),_0x195c9b=_0x373c66[_0x19ca20(0x10a)];_0x106e35['verbose']&&(console[_0x19ca20(0x164)](_0x19ca20(0x19c)+_0x3e26d8+_0x19ca20(0x168)+_0x195c9b+')'),_0x4b5fe8&&console['error'](_0x19ca20(0x135)+_0x4b5fe8));const _0x34b156=await withSpinner(_0x19ca20(0x14c),()=>_0x55d270[_0x19ca20(0x1cb)][_0x19ca20(0x122)](_0x195c9b),{'verbose':_0x106e35[_0x19ca20(0x15c)]}),_0x162d12=_0x34b156[_0x19ca20(0x10a)],_0x2b47db=_0x162d12['rootFolderId'],_0x5403a2=await withSpinner(_0x19ca20(0x18d),()=>_0x55d270[_0x19ca20(0xee)]['listJourneysWithFolders'](_0x195c9b,_0x2b47db),{'verbose':_0x106e35[_0x19ca20(0x15c)]});let _0x56966f=_0x5403a2[_0x19ca20(0x10a)][_0x19ca20(0xf4)];const _0x43a562=_0x5403a2[_0x19ca20(0x10a)]['folders'],_0xe8f95=new Map();for(const _0x47d4c3 of _0x43a562){_0xe8f95['set'](_0x47d4c3['id'],_0x47d4c3[_0x19ca20(0x196)]);}if(_0x4b5fe8){const _0x1d1156=globToRegex(_0x4b5fe8);_0x56966f=_0x56966f[_0x19ca20(0x182)](_0x12f719=>_0x1d1156[_0x19ca20(0x18a)](_0x12f719[_0x19ca20(0xe4)]));}console['error']('✔\x20Found\x20'+_0x56966f[_0x19ca20(0x121)]+_0x19ca20(0xe2)+(_0x56966f[_0x19ca20(0x121)]!==0x1?'s':''));const _0x4f3fe1=_0x21281a=>{const _0x3b13a0=_0x19ca20;return getConsoleNextUrl(_0x106e35[_0x3b13a0(0x17f)],_0x3b13a0(0x197)+_0x195c9b+'/e/'+_0x21281a+_0x3b13a0(0x106));};if(_0x106e35['format']==='table')await handleSDKOutput(_0x56966f,_0x106e35);else{if(_0x106e35[_0x19ca20(0x18e)]===_0x19ca20(0x141)){const _0x35d13c=_0x56966f[_0x19ca20(0x1d3)](_0x130b31=>({..._0x130b31,'url':_0x4f3fe1(_0x130b31['id'])}));await handleSDKOutput(_0x35d13c,_0x106e35);}else{console[_0x19ca20(0x14a)]('['+_0x3e26d8+']');const _0x239bd4=new Map(),_0x2c9674=[];for(const _0x25221f of _0x56966f){if(!_0x25221f[_0x19ca20(0xf6)]||_0x25221f[_0x19ca20(0xf6)]===_0x2b47db)_0x2c9674['push'](_0x25221f);else{const _0x416c31=_0x239bd4[_0x19ca20(0xfe)](_0x25221f['folderId'])||[];_0x416c31[_0x19ca20(0xda)](_0x25221f),_0x239bd4[_0x19ca20(0x156)](_0x25221f[_0x19ca20(0xf6)],_0x416c31);}}const _0x45ac76=(_0x489c7a,_0x10b43e)=>_0x489c7a[_0x19ca20(0xe4)][_0x19ca20(0xed)](_0x10b43e[_0x19ca20(0xe4)],undefined,{'sensitivity':_0x19ca20(0x1c5)});_0x2c9674[_0x19ca20(0x16a)](_0x45ac76);for(const _0xce9b37 of _0x2c9674){console['log'](formatJourneyItem(_0xce9b37,'',_0x4f3fe1(_0xce9b37['id'])));}const _0x1c61fd=[..._0x239bd4[_0x19ca20(0x15f)]()][_0x19ca20(0x16a)]((_0x383a3c,_0x27791c)=>{const _0x4fbecc=_0x19ca20,_0x434372=_0xe8f95[_0x4fbecc(0xfe)](_0x383a3c[0x0])||_0x383a3c[0x0],_0x5571bb=_0xe8f95[_0x4fbecc(0xfe)](_0x27791c[0x0])||_0x27791c[0x0];return _0x434372[_0x4fbecc(0xed)](_0x5571bb,undefined,{'sensitivity':_0x4fbecc(0x1c5)});});for(const [_0x46ad79,_0x44145b]of _0x1c61fd){const _0x554b23=_0xe8f95[_0x19ca20(0xfe)](_0x46ad79)||_0x46ad79;console[_0x19ca20(0x14a)](_0x19ca20(0xd2)+_0x554b23),_0x44145b[_0x19ca20(0x16a)](_0x45ac76);for(const _0x88a143 of _0x44145b){console['log'](formatJourneyItem(_0x88a143,'\x20\x20',_0x4f3fe1(_0x88a143['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x100);['description']=a27_0x2f1e80(0x180);async['execute'](_0x598274){const _0x45eb57=a27_0x2f1e80,{options:_0x5c1fdd,args:_0x117fc4,tdx:_0x2b3288}=_0x598274,_0x3c23d6=_0x117fc4[0x0];if(!_0x3c23d6)return console['error'](_0x45eb57(0x1c8)),console[_0x45eb57(0x164)](_0x45eb57(0x1bc)),console[_0x45eb57(0x164)](_0x45eb57(0x185)),console[_0x45eb57(0x164)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x5c1fdd['verbose']&&console[_0x45eb57(0x164)](_0x45eb57(0xdf)+_0x3c23d6);const {journeyId:_0x5c5b6e,parentSegmentId:_0x5d83f7}=await resolveJourneyIdFromInput(_0x3c23d6,_0x5c1fdd,_0x2b3288);if(_0x5c1fdd['web']){const _0x35c496=getConsoleNextUrl(_0x5c1fdd[_0x45eb57(0x17f)],_0x45eb57(0x197)+_0x5d83f7+_0x45eb57(0x17a)+_0x5c5b6e+'/j/da/je');return console[_0x45eb57(0x164)](a27_0x1b29e0['green']('✔')+_0x45eb57(0x130)+a27_0x1b29e0[_0x45eb57(0xd5)](_0x35c496)),openBrowser(_0x35c496),0x0;}const _0x3da9a7=await withSpinner('Getting\x20journey\x20details...',()=>_0x2b3288['journey'][_0x45eb57(0x109)](_0x5c5b6e),{'verbose':_0x5c1fdd[_0x45eb57(0x15c)]}),_0x214b8e=_0x3da9a7[_0x45eb57(0x10a)],_0x51b651=_0x5c1fdd[_0x45eb57(0x125)];let _0x25513a;if(_0x51b651)try{const _0x7aa8af=await withSpinner(_0x45eb57(0x111),()=>_0x2b3288[_0x45eb57(0xee)][_0x45eb57(0x127)](_0x5c5b6e),{'verbose':_0x5c1fdd[_0x45eb57(0x15c)]});_0x25513a=_0x7aa8af[_0x45eb57(0x10a)];}catch{_0x5c1fdd[_0x45eb57(0x15c)]&&console[_0x45eb57(0x164)](_0x45eb57(0x158));}const _0x43863b=getConsoleNextUrl(_0x5c1fdd[_0x45eb57(0x17f)],'/app/ps/'+_0x5d83f7+_0x45eb57(0x17a)+_0x5c5b6e+'/j/da/je'),_0x237b0f={'id':_0x214b8e['id'],'name':_0x214b8e['attributes'][_0x45eb57(0x196)],'description':_0x214b8e[_0x45eb57(0x17d)][_0x45eb57(0x1c4)],'state':_0x214b8e['attributes'][_0x45eb57(0x104)],'paused':_0x214b8e['attributes'][_0x45eb57(0xe9)],'reentry_mode':_0x214b8e[_0x45eb57(0x17d)][_0x45eb57(0x112)],'stages':_0x214b8e['attributes'][_0x45eb57(0x10c)]?.[_0x45eb57(0x121)]||0x0,..._0x214b8e[_0x45eb57(0x17d)][_0x45eb57(0x131)]&&{'goal':_0x214b8e[_0x45eb57(0x17d)][_0x45eb57(0x131)][_0x45eb57(0x196)]},..._0x25513a&&{'statistics':{'size':_0x25513a[_0x45eb57(0x11e)],'entered':_0x25513a[_0x45eb57(0x13f)],'goal_achieved':_0x25513a[_0x45eb57(0x1b4)],'completion_rate':_0x25513a[_0x45eb57(0x12a)],'exit_or_jump':_0x25513a[_0x45eb57(0x101)],'exit_or_jump_rate':_0x25513a[_0x45eb57(0x1b5)],'stages':_0x25513a[_0x45eb57(0x12c)]}},'url':_0x43863b};return await handleSingleObjectOutput(_0x237b0f,_0x5c1fdd),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x137);[a27_0x2f1e80(0x1c4)]='Show\x20journey\x20statistics';async[a27_0x2f1e80(0x132)](_0x4e6cfa){const _0x66eb0=a27_0x2f1e80,{options:_0x2d1b8f,args:_0x2f2739,tdx:_0x444b58}=_0x4e6cfa,_0x2cb974=_0x2f2739[0x0];if(!requireNameOrPath(_0x2cb974))return 0x1;_0x2d1b8f['verbose']&&console[_0x66eb0(0x164)]('Input:\x20'+_0x2cb974);const _0x38de8d=_0x2d1b8f,_0x3edb7a=_0x38de8d[_0x66eb0(0x149)],_0x2fef97=_0x38de8d['to'],_0x4c5eef=_0x38de8d['includeHistory'],_0x45bc9c=_0x38de8d[_0x66eb0(0x10b)];_0x4c5eef&&!_0x3edb7a&&!_0x2fef97&&console[_0x66eb0(0x164)](_0x66eb0(0x1ac));const _0x44d0fc=_0x4c5eef?withJsonFormat(_0x2d1b8f):_0x2d1b8f,{journeyId:_0x2c1480,journeyName:_0x27441f}=await resolveJourneyIdFromInput(_0x2cb974,_0x44d0fc,_0x444b58),_0x491a2f=_0x3edb7a||_0x2fef97?{'from':_0x3edb7a,'to':_0x2fef97}:undefined,_0x564bae=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise['all']([_0x444b58['journey'][_0x66eb0(0x109)](_0x2c1480),_0x444b58[_0x66eb0(0xee)][_0x66eb0(0x127)](_0x2c1480,_0x491a2f)]),{'verbose':_0x44d0fc['verbose']}),[_0x42efa3,_0x42322c]=_0x564bae[_0x66eb0(0x10a)];if(!_0x42322c||_0x42322c[_0x66eb0(0x1c7)]===null)return console[_0x66eb0(0x164)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x27441f),console[_0x66eb0(0x164)](_0x66eb0(0xf8)),0x0;const _0xba8222=buildStageNameMap(_0x42efa3),_0x4c6c8a=!!(_0x491a2f&&_0x42322c[_0x66eb0(0x14d)]?.[_0x66eb0(0x121)]),_0x45d0b0={'stageNameMap':_0xba8222,'hasPeriod':_0x4c6c8a,'includeHistory':!!_0x4c5eef};if(_0x45bc9c&&_0x42322c['stages']){const _0x3879a5=_0x42322c['stages']['find'](_0x2e1b3f=>{const _0x490ec1=_0x66eb0,_0x23915a=_0xba8222[_0x490ec1(0xfe)](_0x2e1b3f['id'])??'';return _0x23915a[_0x490ec1(0x15a)]()===_0x45bc9c[_0x490ec1(0x15a)]();});if(_0x3879a5)return await handleSingleObjectOutput(formatStageStats(_0x3879a5,_0x45d0b0),_0x44d0fc),0x0;const _0x5f0256=_0x42322c[_0x66eb0(0x12c)][_0x66eb0(0x1d3)](_0x119994=>_0xba8222[_0x66eb0(0xfe)](_0x119994['id'])??_0x119994['id']);return console[_0x66eb0(0x164)](_0x66eb0(0xe6)+_0x45bc9c+_0x66eb0(0x113)),console[_0x66eb0(0x164)](_0x66eb0(0x1be)+_0x5f0256[_0x66eb0(0x1b9)](',\x20')),0x1;}const _0x269be0=_0x42322c[_0x66eb0(0x12c)]?.[_0x66eb0(0x1d3)](_0x1804fe=>formatStageStats(_0x1804fe,_0x45d0b0)),_0x20f4d4=assembleJourneyStats(_0x42322c,{'from':_0x3edb7a,'to':_0x2fef97,'includeHistory':_0x4c5eef});return await this[_0x66eb0(0x146)](_0x20f4d4,_0x269be0??[],_0x44d0fc),0x0;}async[a27_0x2f1e80(0x146)](_0x5697bc,_0x34bfe4,_0x895f2a){const _0x4cb734=a27_0x2f1e80,_0x106a38=_0x895f2a[_0x4cb734(0x18e)]===_0x4cb734(0x141)||_0x895f2a[_0x4cb734(0x18e)]===_0x4cb734(0x1ba)||_0x895f2a['json']||_0x895f2a[_0x4cb734(0x1ba)];if(_0x106a38){_0x5697bc['stages']=_0x34bfe4,await handleSingleObjectOutput(_0x5697bc,_0x895f2a);return;}await handleSingleObjectOutput(_0x5697bc,_0x895f2a);for(const _0x27c0af of _0x34bfe4){console[_0x4cb734(0x14a)](''),console['log'](String(a27_0x1b29e0[_0x4cb734(0xd5)][_0x4cb734(0x119)]('['+_0x27c0af[_0x4cb734(0x196)]+']'))+a27_0x1b29e0[_0x4cb734(0x10d)]('\x20'+_0x27c0af['id']));const {id:_0x381c3a,name:_0x488ea4,..._0x42b1d6}=_0x27c0af;await handleSingleObjectOutput(_0x42b1d6,_0x895f2a);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x2f1e80(0x196)]='journey:traffic';['description']='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a27_0x2f1e80(0x132)](_0x480ece){const _0x1a8ec0=a27_0x2f1e80,{options:_0x4ba525,args:_0x2bd354,tdx:_0x500b60}=_0x480ece,_0x1d2c2c=_0x2bd354[0x0];if(!requireNameOrPath(_0x1d2c2c))return 0x1;_0x4ba525[_0x1a8ec0(0x15c)]&&console['error'](_0x1a8ec0(0xdf)+_0x1d2c2c);const _0x2e2791=_0x4ba525,_0x455cac=_0x2e2791[_0x1a8ec0(0x126)],_0x5d0aa4=_0x2e2791[_0x1a8ec0(0x149)],_0x1dd8b8=_0x2e2791['to'],_0xe275ec=_0x2e2791['limit'];if(_0x455cac&&_0x455cac!=='conversion'&&_0x455cac!==_0x1a8ec0(0x1d1))return console[_0x1a8ec0(0x164)](_0x1a8ec0(0x13e)+_0x455cac+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x1d4ca3=withJsonFormat(_0x4ba525),{journeyId:_0x16d0ae,journeyName:_0x174187}=await resolveJourneyIdFromInput(_0x1d2c2c,_0x1d4ca3,_0x500b60),_0x13d94c={'type':_0x455cac,'from':_0x5d0aa4,'to':_0x1dd8b8,'limit':_0xe275ec},_0x846f1a=await withSpinner(_0x1a8ec0(0x1c0),()=>_0x500b60[_0x1a8ec0(0xee)][_0x1a8ec0(0x117)](_0x16d0ae,_0x13d94c),{'verbose':_0x1d4ca3[_0x1a8ec0(0x15c)]}),_0x4e7309=_0x846f1a[_0x1a8ec0(0x10a)],_0x52490a=_0x4e7309[_0x1a8ec0(0xd4)]&&(_0x4e7309['conversion'][_0x1a8ec0(0x139)]['length']>0x0||_0x4e7309[_0x1a8ec0(0xd4)][_0x1a8ec0(0x18b)][_0x1a8ec0(0x121)]>0x0),_0x39cd7a=_0x4e7309[_0x1a8ec0(0x1d1)]&&_0x4e7309[_0x1a8ec0(0x1d1)][_0x1a8ec0(0x121)]>0x0;if(!_0x52490a&&!_0x39cd7a)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x174187),console[_0x1a8ec0(0x164)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x5d0aa4&&_0x1dd8b8&&console[_0x1a8ec0(0x164)]('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(_0x4e7309,_0x1d4ca3),0x0;}}function formatStageStats(_0x36aa4c,_0x19f704){const _0x394a9d=a27_0x2f1e80,_0xaed72a=_0x19f704['hasPeriod']&&_0x36aa4c[_0x394a9d(0x14d)]?.['length']?aggregateStageHistory(_0x36aa4c['history']):{'size':_0x36aa4c[_0x394a9d(0x11e)],'entered':_0x36aa4c[_0x394a9d(0x13f)],'milestone':_0x36aa4c[_0x394a9d(0x11a)],'milestone_rate':_0x36aa4c[_0x394a9d(0x1bb)],'exit_or_jump':_0x36aa4c[_0x394a9d(0x101)],'exit_or_jump_rate':_0x36aa4c['exitOrJumpRate']},_0x56f048={'id':_0x36aa4c['id'],'name':_0x19f704['stageNameMap'][_0x394a9d(0xfe)](_0x36aa4c['id'])??_0x36aa4c['id'],..._0xaed72a};return _0x19f704[_0x394a9d(0x12e)]&&_0x19f704[_0x394a9d(0xf2)]&&_0x36aa4c[_0x394a9d(0x14d)]&&(_0x56f048[_0x394a9d(0x14d)]=_0x36aa4c[_0x394a9d(0x14d)]),_0x56f048;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x2f1e80(0x160);['description']=a27_0x2f1e80(0x19e);async[a27_0x2f1e80(0x132)](_0x4b05d1){const _0x5ba8b9=a27_0x2f1e80,{options:_0x5156e8,args:_0x2ea4a2,tdx:_0x45e672}=_0x4b05d1,_0x485159=_0x2ea4a2[0x0];if(!requireNameOrPath(_0x485159))return 0x1;_0x5156e8['verbose']&&console[_0x5ba8b9(0x164)]('Input:\x20'+_0x485159);const {journeyId:_0x3cc869,journeyName:_0x236a01}=await resolveJourneyIdFromInput(_0x485159,_0x5156e8,_0x45e672);if(!_0x5156e8[_0x5ba8b9(0x159)]){const _0x5d427a=await confirm(_0x5ba8b9(0x162)+_0x236a01+'\x22?');if(!_0x5d427a)return console['error'](_0x5ba8b9(0x17b)),0x0;}const _0x2b84b8=await withSpinner('Pausing\x20journey...',()=>_0x45e672[_0x5ba8b9(0xee)]['pause'](_0x3cc869),{'verbose':_0x5156e8[_0x5ba8b9(0x15c)]}),_0xa32607=_0x2b84b8[_0x5ba8b9(0x10a)];return console['error'](_0x5ba8b9(0x1d2)+_0xa32607[_0x5ba8b9(0x17d)]['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x2f1e80(0x178);['description']=a27_0x2f1e80(0x199);async['execute'](_0x4559b1){const _0x485b54=a27_0x2f1e80,{options:_0x159c19,args:_0x5482f6,tdx:_0xffcb2f}=_0x4559b1,_0x9479aa=_0x5482f6[0x0];if(!requireNameOrPath(_0x9479aa))return 0x1;_0x159c19[_0x485b54(0x15c)]&&console[_0x485b54(0x164)](_0x485b54(0xdf)+_0x9479aa);const {journeyId:_0x113870,journeyName:_0x274de2}=await resolveJourneyIdFromInput(_0x9479aa,_0x159c19,_0xffcb2f);if(!_0x159c19[_0x485b54(0x159)]){const _0x55ff85=await confirm(_0x485b54(0x1bf)+_0x274de2+'\x22?');if(!_0x55ff85)return console[_0x485b54(0x164)]('Cancelled'),0x0;}const _0x2a7195=await withSpinner(_0x485b54(0x15e),()=>_0xffcb2f[_0x485b54(0xee)]['resume'](_0x113870),{'verbose':_0x159c19[_0x485b54(0x15c)]}),_0x7daa4a=_0x2a7195['data'];return console['error'](_0x485b54(0x1d2)+_0x7daa4a[_0x485b54(0x17d)][_0x485b54(0x196)]+_0x485b54(0x16b)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x2f1e80(0x14b);[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x142);async['execute'](_0x2fb07d){const _0xfa7c4c=a27_0x2f1e80,{options:_0x38dd94,args:_0x81e63c,tdx:_0x122e52}=_0x2fb07d,_0x3287c3=_0x38dd94,_0xe743ab=_0x81e63c[0x0],_0x380de7=_0xe743ab&&isYamlFilePath(_0xe743ab),_0x4e1865=await resolveTarget({'arg':_0x380de7?_0xe743ab:undefined,'contextParent':_0x38dd94['parentSegment'],'cwd':process[_0xfa7c4c(0xdb)]()});if(!isSuccessfulResolution(_0x4e1865))return _0x4e1865[_0xfa7c4c(0x144)]===_0xfa7c4c(0x1aa)?(console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0xe7)](_0xfa7c4c(0xfc))),console[_0xfa7c4c(0x164)]('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[_0xfa7c4c(0x164)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0xfa7c4c(0xe5)),console[_0xfa7c4c(0x164)](_0xfa7c4c(0x13c))):(console['error'](a27_0x1b29e0['red'](_0xfa7c4c(0x1ad)+_0x4e1865[_0xfa7c4c(0x151)]+'\x0a')),_0x4e1865['helpText']&&console['error'](a27_0x1b29e0[_0xfa7c4c(0xd5)](_0x4e1865[_0xfa7c4c(0x171)]))),0x1;let _0x5b2180=_0x380de7?undefined:_0xe743ab,_0x2cb958,_0xb11b9b;_0x4e1865[_0xfa7c4c(0x126)]===_0xfa7c4c(0x124)&&(_0x5b2180=_0x4e1865[_0xfa7c4c(0x1a6)],_0x2cb958=_0x4e1865[_0xfa7c4c(0x1c2)],_0xb11b9b=_0x4e1865[_0xfa7c4c(0xf5)]);const _0x29eda6=_0x4e1865[_0xfa7c4c(0x10f)],_0x3704b4=_0x4e1865['targetDir'];_0x3287c3[_0xfa7c4c(0x15c)]&&(console[_0xfa7c4c(0x164)](_0xfa7c4c(0x19c)+_0x29eda6),console['error']('Target\x20directory:\x20'+_0x3704b4),_0x5b2180&&console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a7)+_0x5b2180),_0x2cb958&&console['error'](_0xfa7c4c(0x163)+_0x2cb958),_0xb11b9b&&console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a5)+_0xb11b9b));const _0x1ce0b8=await withSpinner(_0xfa7c4c(0xe3),()=>_0x122e52['segment'][_0xfa7c4c(0x1ae)](_0x29eda6),{'verbose':_0x38dd94['verbose']}),_0x32a982=_0x1ce0b8[_0xfa7c4c(0x10a)],{journeys:_0x3a83c0,folders:_0x44332b}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x773cb5=_0xfa7c4c,[_0x5cf6b8,_0x23905b]=await Promise[_0x773cb5(0x1bd)]([_0x122e52['journey']['listJourneysFromParentSegment'](_0x32a982,undefined,{'includeAllVersions':!![]}),_0x122e52[_0x773cb5(0x1cb)][_0x773cb5(0x136)](_0x32a982)]);return{'journeys':_0x5cf6b8,'folders':_0x23905b};},{'verbose':_0x38dd94['verbose']})[_0xfa7c4c(0x167)](_0x4d5bad=>_0x4d5bad[_0xfa7c4c(0x10a)]);let _0x3be400=_0x3a83c0;const _0x42f16d=buildFolderIdToPathMap(_0x44332b);if(_0x5b2180){const _0x1dbfc3=_0x3be400['filter'](_0x510aff=>_0x510aff[_0xfa7c4c(0xe4)][_0xfa7c4c(0x15a)]()===_0x5b2180[_0xfa7c4c(0x15a)]());if(_0x1dbfc3[_0xfa7c4c(0x121)]===0x0)return console[_0xfa7c4c(0x164)]('Error:\x20Journey\x20not\x20found:\x20'+_0x5b2180),console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a4)),0x1;_0x3be400=_0x1dbfc3;}if(_0xb11b9b!==undefined){const _0x2fbef2=_0x3be400['filter'](_0x43f496=>{const _0x519f73=_0xfa7c4c,_0x543b62=_0x43f496[_0x519f73(0xf6)]?_0x42f16d[_0x519f73(0xfe)](_0x43f496[_0x519f73(0xf6)])||'':'';return _0x543b62===_0xb11b9b;});if(_0x2fbef2[_0xfa7c4c(0x121)]===0x0&&_0x3be400[_0xfa7c4c(0x121)]>0x0){console[_0xfa7c4c(0x164)]('Error:\x20Journey\x20\x27'+_0x5b2180+_0xfa7c4c(0x10e)+(_0xb11b9b||_0xfa7c4c(0x1a0))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x2f11a3 of _0x3be400){const _0x5554f4=_0x2f11a3[_0xfa7c4c(0xf6)]?_0x42f16d[_0xfa7c4c(0xfe)](_0x2f11a3['folderId'])||'':'';console[_0xfa7c4c(0x164)](_0xfa7c4c(0x19f)+(_0x5554f4||_0xfa7c4c(0x13a))+'/'+_0x2f11a3[_0xfa7c4c(0xe4)]);}return 0x1;}_0x3be400=_0x2fbef2;}if(_0x3be400[_0xfa7c4c(0x121)]===0x0)return console[_0xfa7c4c(0x164)]('No\x20journeys\x20found'),0x0;const _0x532008=new Map();for(const _0x154e72 of _0x3be400){const _0x165ea1=_0x154e72['journeyBundleId'];!_0x532008[_0xfa7c4c(0x143)](_0x165ea1)&&_0x532008[_0xfa7c4c(0x156)](_0x165ea1,[]),_0x532008[_0xfa7c4c(0xfe)](_0x165ea1)['push'](_0x154e72);}for(const _0x4b719e of _0x532008[_0xfa7c4c(0x145)]()){_0x4b719e[_0xfa7c4c(0x16a)]((_0x58cae7,_0x22ae76)=>(_0x58cae7[_0xfa7c4c(0x1ce)]||0x0)-(_0x22ae76['versionNumber']||0x0));}const _0x58d5aa=[],{idToEmailMap:_0x29a3b9,connectionIdToNameMap:_0x51909c}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x2155ea=_0xfa7c4c,[_0x2f32d4,_0x3e520b]=await Promise[_0x2155ea(0x1bd)]([_0x122e52[_0x2155ea(0x187)][_0x2155ea(0x1d4)](),_0x122e52['connection'][_0x2155ea(0xdd)]()]);return{'idToEmailMap':_0x2f32d4,'connectionIdToNameMap':_0x3e520b};},{'verbose':_0x38dd94[_0xfa7c4c(0x15c)]})[_0xfa7c4c(0x167)](_0xdf6699=>_0xdf6699[_0xfa7c4c(0x10a)]);for(const _0x3a1fa5 of _0x532008[_0xfa7c4c(0x145)]()){const _0x16c08d=_0x3a1fa5[0x0][_0xfa7c4c(0xe4)],_0x312e14=_0x3a1fa5[0x0][_0xfa7c4c(0xf6)],_0x58fc58=_0x312e14?_0x42f16d[_0xfa7c4c(0xfe)](_0x312e14)||'':'',_0x3fc829=_0x58fc58?a27_0x3c39c9[_0xfa7c4c(0x1b9)](_0x3704b4,_0x58fc58):_0x3704b4,_0x144481=_0x2cb958||a27_0x3c39c9['join'](_0x3fc829,sanitizeFileName(_0x16c08d)+'.yml');let _0x5962f0,_0x163461;if(existsSync(_0x144481))try{const _0x42409c=readFileSync(_0x144481,_0xfa7c4c(0x133)),_0x16cf5a=parseYamlString(_0x42409c);_0x163461=_0x16cf5a,_0x5962f0=buildRuleToNameMapping(_0x16cf5a),_0x3287c3['verbose']&&_0x5962f0['size']>0x0&&console[_0xfa7c4c(0x164)]('Found\x20'+_0x5962f0[_0xfa7c4c(0x11e)]+_0xfa7c4c(0x108)+_0x16c08d);}catch(_0x6c84e1){_0x3287c3[_0xfa7c4c(0x15c)]&&console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a9)+_0x6c84e1['message']);}const _0x2caf33=[],_0x2ae4df=new Set(),_0x10cae6=new Map(),_0x562543=new Map(),_0x43582b=new Set(),_0x416e71=new Map(),_0x47e980=new Map(),_0x9c93a8=createJumpTargetCache();await withProgressSpinner(_0xfa7c4c(0x176)+_0x16c08d+_0xfa7c4c(0x175),async _0x918963=>{const _0x2044f9=_0xfa7c4c;for(const _0x43f728 of _0x3a1fa5){const _0x35d4bf=_0x3a1fa5['length']>0x1?_0x43f728[_0x2044f9(0xe4)]+'\x20v'+(_0x43f728[_0x2044f9(0x1ce)]||0x1):_0x43f728[_0x2044f9(0xe4)];_0x918963[_0x2044f9(0x169)](_0x2044f9(0x176)+_0x35d4bf);const _0x30ee70=await _0x122e52[_0x2044f9(0xee)]['getJourney'](_0x43f728['id']),_0x693d3d=_0x30ee70[_0x2044f9(0x17d)]?.['audienceId'],_0xdb47ef={'resolveSegment':async _0x17541a=>{const _0x1b0338=_0x2044f9;if(!_0x693d3d)return{'name':_0x17541a,'isJourneyLocal':![]};const _0x2c24c6=_0x10cae6['get'](_0x17541a);if(_0x2c24c6)return _0x2c24c6;try{const _0x3a38ed=await _0x122e52[_0x1b0338(0x1cb)]['getSegment'](_0x693d3d,_0x17541a),_0x149638=_0x3a38ed[_0x1b0338(0xdc)]===SEGMENT_KIND_JOURNEY;let _0x3a12e2,_0x1519a0=_0x3a38ed['name'];if(_0x149638&&_0x3a38ed[_0x1b0338(0xe8)]){const _0x245db4=await segmentResponseToDef(_0x3a38ed,{'resolveSegmentName':async _0x369320=>{const _0x1de9a1=_0x1b0338,_0xf04a9d=_0x10cae6[_0x1de9a1(0xfe)](_0x369320);if(_0xf04a9d)return _0xf04a9d['name'];const _0x19b696=await _0xdb47ef['resolveSegment'](_0x369320);return _0x19b696[_0x1de9a1(0x196)];}}),_0x563691=_0x245db4['rule'];_0x3a12e2={'description':_0x3a38ed[_0x1b0338(0x1c4)],'rule':_0x563691};const _0x4fa993=serializeRule(_0x563691),_0x2f7c2c=_0x562543[_0x1b0338(0xfe)](_0x4fa993);if(_0x2f7c2c)_0x1519a0=_0x2f7c2c,_0x3a12e2=undefined,_0x3287c3[_0x1b0338(0x15c)]&&console[_0x1b0338(0x164)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x3a38ed[_0x1b0338(0x196)]+_0x1b0338(0x13d)+_0x2f7c2c);else{let _0x356583=![];if(_0x5962f0){const _0x4b96a2=_0x5962f0[_0x1b0338(0xfe)](_0x4fa993);if(_0x4b96a2){const _0x575273=_0x4b96a2[_0x1b0338(0x1a1)](_0xbb68bf=>!_0x2ae4df[_0x1b0338(0x143)](_0xbb68bf));_0x575273&&(_0x1519a0=_0x575273,_0x2ae4df[_0x1b0338(0x110)](_0x575273),_0x562543[_0x1b0338(0x156)](_0x4fa993,_0x575273),_0x356583=!![],_0x3287c3['verbose']&&console['error'](_0x1b0338(0xfb)+_0x575273+_0x1b0338(0x188)));}}if(!_0x356583){const _0x3a749b=generateJourneyLocalName(_0x3a38ed[_0x1b0338(0x196)]);_0x3a749b&&(_0x1519a0=_0x3a749b);let _0x303591=_0x1519a0,_0x4c47d9=0x2;while(_0x2ae4df[_0x1b0338(0x143)](_0x303591)){_0x303591=_0x1519a0+'_'+_0x4c47d9,_0x4c47d9++;}_0x2ae4df['add'](_0x303591),_0x562543[_0x1b0338(0x156)](_0x4fa993,_0x303591),_0x1519a0=_0x303591;}}}const _0x146d46={'name':_0x1519a0,'isJourneyLocal':_0x149638,'definition':_0x3a12e2};return _0x10cae6[_0x1b0338(0x156)](_0x17541a,_0x146d46),_0x146d46;}catch(_0x544ff6){return _0x38dd94['verbose']&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x17541a+':\x20'+_0x544ff6[_0x1b0338(0x151)]),{'name':_0x17541a,'isJourneyLocal':![]};}},'resolveActivation':async _0x30a716=>{const _0x2a5f8c=_0x2044f9,_0x46d205=_0x416e71[_0x2a5f8c(0xfe)](_0x30a716);if(_0x46d205)return _0x46d205;try{const _0x471b72=await _0x122e52[_0x2a5f8c(0xee)][_0x2a5f8c(0xd3)](_0x43f728['id'],_0x30a716),_0x52fc04=journeyActivationStepToYaml(_0x471b72,_0x29a3b9,_0x51909c),_0x578d35=JSON[_0x2a5f8c(0x1cc)]({'name':_0x52fc04[_0x2a5f8c(0x196)],'connection':_0x52fc04[_0x2a5f8c(0xff)],'connector_config':_0x52fc04[_0x2a5f8c(0x11f)]}),_0x3fc802=_0x47e980[_0x2a5f8c(0xfe)](_0x578d35);if(_0x3fc802){const _0x56919a={'name':_0x3fc802,'isJourneyLocal':!![],'definition':_0x52fc04};return _0x416e71[_0x2a5f8c(0x156)](_0x30a716,_0x56919a),_0x56919a;}const _0x4ee6b9=_0x471b72['attributes']['activationParams'][_0x2a5f8c(0x196)]||_0x30a716,_0x39f447=sanitizeYamlKey(_0x4ee6b9)||_0x2a5f8c(0x12b)+_0x30a716;let _0x315f77=_0x39f447,_0x5f2cd9=0x2;while(_0x43582b[_0x2a5f8c(0x143)](_0x315f77)){_0x315f77=_0x39f447+'_'+_0x5f2cd9,_0x5f2cd9++;}_0x43582b[_0x2a5f8c(0x110)](_0x315f77),_0x47e980['set'](_0x578d35,_0x315f77);const _0x195887={'name':_0x315f77,'isJourneyLocal':!![],'definition':_0x52fc04};return _0x416e71['set'](_0x30a716,_0x195887),_0x195887;}catch(_0x6ba9ce){return _0x38dd94['verbose']&&console[_0x2a5f8c(0x164)](_0x2a5f8c(0x102)+_0x30a716+':\x20'+_0x6ba9ce[_0x2a5f8c(0x151)]),{'name':_0x30a716,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x85452c,_0x420051)=>{const _0x31caf5=_0x2044f9;return resolveJumpTarget(_0x85452c,_0x420051,_0x9c93a8,_0x3fc743=>_0x122e52[_0x31caf5(0xee)][_0x31caf5(0x109)](_0x3fc743));}},_0x4cdc20=await journeyResponseToDef(_0x30ee70,_0xdb47ef);_0x2caf33[_0x2044f9(0xda)]({'item':_0x43f728,'yaml':_0x4cdc20});}},{'verbose':_0x38dd94[_0xfa7c4c(0x15c)]});const _0x5ea692=await _0x122e52['journey']['getLatestJourneyId'](_0x3a1fa5[0x0][_0xfa7c4c(0x184)]),_0x4f9e3c=buildMergedJourneyDef(_0x2caf33,_0x5962f0,_0x5ea692),_0x2a7f93=normalizeJourneyDef(_0x4f9e3c,_0x163461),_0x223477=toYamlString(_0x2a7f93),_0x12e968=_0x2cb958||a27_0x3c39c9['join'](_0x3fc829,sanitizeFileName(_0x16c08d)+_0xfa7c4c(0x179));!_0x2cb958&&_0x58fc58&&!existsSync(_0x3fc829)&&mkdirSync(_0x3fc829,{'recursive':!![]});const _0x22c5b8=a27_0x3c39c9[_0xfa7c4c(0xef)](process[_0xfa7c4c(0xdb)](),_0x12e968);if(existsSync(_0x12e968)){const _0x47fd8c=readFileSync(_0x12e968,_0xfa7c4c(0x133)),_0x9ebda2=generateDiff(_0x47fd8c,_0x223477),_0x34ed7e=hasChanges(_0x9ebda2);_0x58d5aa[_0xfa7c4c(0xda)]({'relativePath':_0x22c5b8,'absolutePath':_0x12e968,'content':_0x223477,'isNew':![],'hasChanges':_0x34ed7e,'diff':_0x34ed7e?formatDiffWithColors(_0x9ebda2):undefined});}else _0x58d5aa[_0xfa7c4c(0xda)]({'relativePath':_0x22c5b8,'absolutePath':_0x12e968,'content':_0x223477,'isNew':!![],'hasChanges':![]});}const _0x4a3a81=_0x58d5aa['filter'](_0x268351=>_0x268351[_0xfa7c4c(0x17c)]),_0x3c0ff7=_0x58d5aa['filter'](_0x4ae012=>!_0x4ae012[_0xfa7c4c(0x17c)]&&_0x4ae012[_0xfa7c4c(0xf0)]),_0x5954c2=_0x58d5aa[_0xfa7c4c(0x182)](_0x4f394e=>!_0x4f394e[_0xfa7c4c(0x17c)]&&!_0x4f394e[_0xfa7c4c(0xf0)]),_0x358216=_0x3be400[_0xfa7c4c(0x121)],_0x270e95=_0x532008['size'],_0xa25ad2=_0x358216>_0x270e95?'\x20('+_0x358216+_0xfa7c4c(0x1a8):'';console['error'](_0xfa7c4c(0x1d0)),console[_0xfa7c4c(0x164)]('\x20\x20'+a27_0x1b29e0[_0xfa7c4c(0xd5)](_0x270e95+_0xfa7c4c(0x11d))+a27_0x1b29e0[_0xfa7c4c(0x10d)](_0xa25ad2)),console[_0xfa7c4c(0x164)]('\x20\x20'+a27_0x1b29e0['green']('+\x20'+_0x4a3a81[_0xfa7c4c(0x121)]+_0xfa7c4c(0xd6))),console[_0xfa7c4c(0x164)]('\x20\x20'+a27_0x1b29e0[_0xfa7c4c(0xe7)]('~\x20'+_0x3c0ff7[_0xfa7c4c(0x121)]+_0xfa7c4c(0x1cf))),console[_0xfa7c4c(0x164)]('\x20\x20'+a27_0x1b29e0['dim']('=\x20'+_0x5954c2['length']+_0xfa7c4c(0x14e))),console[_0xfa7c4c(0x164)](_0xfa7c4c(0x1a2)+a27_0x1b29e0['cyan'](_0x3704b4)+'\x0a');if(_0x3c0ff7[_0xfa7c4c(0x121)]>0x0)for(const _0x1a280a of _0x3c0ff7){console['error']('\x0aChanges\x20to\x20\x27'+_0x1a280a['relativePath']+'\x27:'),console[_0xfa7c4c(0x164)]('─'[_0xfa7c4c(0x105)](0x3c)),console[_0xfa7c4c(0x164)](_0x1a280a[_0xfa7c4c(0x150)]),console[_0xfa7c4c(0x164)]('─'[_0xfa7c4c(0x105)](0x3c));}if(_0x3287c3[_0xfa7c4c(0x165)])return console['error'](a27_0x1b29e0[_0xfa7c4c(0xe7)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4a3a81['length']===0x0&&_0x3c0ff7['length']===0x0)return console[_0xfa7c4c(0x164)](a27_0x1b29e0['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x29eda6},_0x3287c3[_0xfa7c4c(0x1a3)]),console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0x174)](_0xfa7c4c(0x173)+a27_0x1b29e0[_0xfa7c4c(0x10d)](_0xfa7c4c(0xec))+_0xfa7c4c(0x123)+a27_0x1b29e0[_0xfa7c4c(0xd5)](_0x29eda6))),0x0;if(!_0x3287c3[_0xfa7c4c(0x159)]&&(_0x4a3a81[_0xfa7c4c(0x121)]>0x0||_0x3c0ff7[_0xfa7c4c(0x121)]>0x0)){if(!isInteractive())return console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0x1c3)](_0xfa7c4c(0x11c)),_0xfa7c4c(0xeb)),console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0x10d)](_0xfa7c4c(0x12f))),0x1;const _0x1016b1=await confirmKey('Write\x20'+(_0x4a3a81[_0xfa7c4c(0x121)]+_0x3c0ff7['length'])+'\x20files?');if(!_0x1016b1)return console[_0xfa7c4c(0x164)](a27_0x1b29e0[_0xfa7c4c(0xe7)](_0xfa7c4c(0x1b8)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x3704b4)&&mkdirSync(_0x3704b4,{'recursive':!![]});const _0x170496=a27_0x3c39c9[_0xfa7c4c(0x1b9)](_0x3704b4,_0xfa7c4c(0x152));writeFileSync(_0x170496,createTdxConfigContent(_0x29eda6),_0xfa7c4c(0x133));for(const _0x5d23e5 of _0x58d5aa){(_0x5d23e5[_0xfa7c4c(0x17c)]||_0x5d23e5['hasChanges'])&&writeFileSync(_0x5d23e5[_0xfa7c4c(0x195)],_0x5d23e5[_0xfa7c4c(0x16c)],'utf-8');}return console[_0xfa7c4c(0x164)](a27_0x1b29e0['green'](_0xfa7c4c(0x1b0)+(_0x4a3a81[_0xfa7c4c(0x121)]+_0x3c0ff7['length'])+_0xfa7c4c(0x1af)+_0x3704b4)),saveSessionContext({'parent_segment':_0x29eda6},_0x3287c3[_0xfa7c4c(0x1a3)]),console['error'](a27_0x1b29e0[_0xfa7c4c(0x174)](_0xfa7c4c(0x173)+a27_0x1b29e0[_0xfa7c4c(0x10d)]('parent_segment')+_0xfa7c4c(0x123)+a27_0x1b29e0[_0xfa7c4c(0xd5)](_0x29eda6))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x2f1e80(0x196)]='journey:columns';[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x120);async[a27_0x2f1e80(0x132)](_0x4428b4){const _0x1583aa=a27_0x2f1e80,{options:_0x5d2187,args:_0x23a42f,tdx:_0x524dfe}=_0x4428b4,_0x4fa945=_0x23a42f[0x0];if(!requireNameOrPath(_0x4fa945))return 0x1;_0x5d2187[_0x1583aa(0x15c)]&&console[_0x1583aa(0x164)]('Input:\x20'+_0x4fa945);const {journeyId:_0x3f7e36}=await resolveJourneyIdFromInput(_0x4fa945,_0x5d2187,_0x524dfe),_0x1f0bb0=await withSpinner('Getting\x20column\x20mapping...',()=>_0x524dfe[_0x1583aa(0xee)][_0x1583aa(0x147)](_0x3f7e36),{'verbose':_0x5d2187[_0x1583aa(0x15c)]}),_0x2d39ec=_0x1f0bb0[_0x1583aa(0x10a)];return console[_0x1583aa(0x14a)](_0x1583aa(0x1b7)+_0x2d39ec[_0x1583aa(0x128)]),console[_0x1583aa(0x14a)](_0x1583aa(0x16e)+_0x2d39ec['table']),await handleSDKOutput(_0x2d39ec[_0x1583aa(0xd7)],_0x5d2187),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x2f1e80(0x190);[a27_0x2f1e80(0x1c4)]='List\x20activations\x20for\x20a\x20journey';async['execute'](_0x571ee6){const _0x3e2a23=a27_0x2f1e80,{options:_0x41e10e,args:_0x4204af,tdx:_0x269b57}=_0x571ee6,_0x110671=_0x4204af[0x0];if(!requireNameOrPath(_0x110671))return 0x1;_0x41e10e[_0x3e2a23(0x15c)]&&console['error']('Input:\x20'+_0x110671);const {journeyId:_0x210c44}=await resolveJourneyIdFromInput(_0x110671,_0x41e10e,_0x269b57),_0x3e2602=await withSpinner(_0x3e2a23(0x157),()=>_0x269b57['journey'][_0x3e2a23(0x15d)](_0x210c44),{'verbose':_0x41e10e['verbose']}),_0x221875=_0x3e2602[_0x3e2a23(0x10a)];return console[_0x3e2a23(0x164)](_0x3e2a23(0x11b)+_0x221875[_0x3e2a23(0x121)]+_0x3e2a23(0xde)+(_0x221875['length']!==0x1?'s':'')),await handleSDKOutput(_0x221875,_0x41e10e),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x2f1e80(0x196)]='journey:push';[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0xfd);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x2f1e80(0x132)](_0x5ae6af){const _0x138f26=a27_0x2f1e80,_0x38953f=_0x5ae6af[_0x138f26(0x177)][0x0];let _0x580544;if(_0x38953f){const _0x46f37b=await resolveTarget({'arg':_0x38953f,'contextParent':_0x5ae6af['options'][_0x138f26(0xea)],'cwd':process[_0x138f26(0xdb)]()});isSuccessfulResolution(_0x46f37b)&&_0x46f37b['type']==='file'&&(_0x580544=_0x46f37b[_0x138f26(0x1c2)]);}const _0x5bcea2={..._0x5ae6af,'options':{..._0x5ae6af[_0x138f26(0xd8)],'journeysOnly':!![],..._0x580544&&{'singleFilePath':_0x580544}}};return this['segmentPushCommand'][_0x138f26(0x132)](_0x5bcea2);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x19b);[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x154);async[a27_0x2f1e80(0x132)](_0x3f78e1){const _0x21aad7=a27_0x2f1e80,{options:_0x357684,args:_0x237cb1,tdx:_0x407818}=_0x3f78e1,_0x5cc36e=_0x237cb1[0x0];if(!requireNameOrPath(_0x5cc36e))return 0x1;if(_0x357684[_0x21aad7(0x15c)])console[_0x21aad7(0x164)](_0x21aad7(0xdf)+_0x5cc36e);const {journeyId:_0x5392de}=await resolveJourneyIdFromInput(_0x5cc36e,_0x357684,_0x407818),_0x364162=await withSpinner(_0x21aad7(0x1c1),()=>_0x407818[_0x21aad7(0xee)][_0x21aad7(0x114)](_0x5392de),{'verbose':_0x357684[_0x21aad7(0x15c)]}),{bundleName:_0x3f7b0d,versions:_0x245135,latestJourneyId:_0x3669ad}=_0x364162[_0x21aad7(0x10a)];console[_0x21aad7(0x164)](_0x3f7b0d+':\x20'+_0x245135[_0x21aad7(0x121)]+_0x21aad7(0xf1)+(_0x245135[_0x21aad7(0x121)]!==0x1?'s':''));const _0x3e9a7c=_0x245135[_0x21aad7(0x1d3)](_0x508da9=>({'version':_0x508da9[_0x21aad7(0x1ce)],'journey_id':_0x508da9['journeyId'],'name':_0x508da9['name'],'state':_0x508da9['state'],'paused':_0x508da9[_0x21aad7(0xe9)],'latest':_0x508da9[_0x21aad7(0x1c7)]===_0x3669ad,'created_at':_0x508da9[_0x21aad7(0x166)]}));return await handleSDKOutput(_0x3e9a7c,_0x357684),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0xfa);[a27_0x2f1e80(0x1c4)]=a27_0x2f1e80(0x138);async[a27_0x2f1e80(0x132)](_0x2594e5){const _0x17b941=a27_0x2f1e80,{options:_0x5eecc0,args:_0x4d8da7,tdx:_0x51eef4}=_0x2594e5,_0x4186c7=_0x4d8da7[0x0];if(!requireNameOrPath(_0x4186c7))return 0x1;if(_0x5eecc0[_0x17b941(0x15c)])console[_0x17b941(0x164)](_0x17b941(0xdf)+_0x4186c7);const {journeyId:_0x404d73,journeyName:_0x2a4a3e}=await resolveJourneyIdFromInput(_0x4186c7,_0x5eecc0,_0x51eef4);if(!_0x5eecc0['yes']){const _0xd41099=await confirm(_0x17b941(0x115)+_0x2a4a3e+'\x22?');if(!_0xd41099)return console[_0x17b941(0x164)](_0x17b941(0x17b)),0x0;}const _0x2c0e3f=await withSpinner('Creating\x20new\x20version...',()=>_0x51eef4[_0x17b941(0xee)][_0x17b941(0xf9)](_0x404d73),{'verbose':_0x5eecc0['verbose']}),_0x3e0b37=_0x2c0e3f[_0x17b941(0x10a)];return console[_0x17b941(0x164)](a27_0x1b29e0['green']('✔')+'\x20Created\x20v'+_0x3e0b37['attributes'][_0x17b941(0x1ce)]+_0x17b941(0x1c9)+_0x3e0b37[_0x17b941(0x17d)]['name']+'\x22'),console[_0x17b941(0x164)]('\x20\x20Journey\x20ID:\x20'+_0x3e0b37['id']),await handleSingleObjectOutput({'id':_0x3e0b37['id'],'name':_0x3e0b37['attributes'][_0x17b941(0x196)],'version':_0x3e0b37['attributes'][_0x17b941(0x1ce)],'state':_0x3e0b37[_0x17b941(0x17d)]['state'],'bundle_id':_0x3e0b37['attributes'][_0x17b941(0x184)],'created_at':_0x3e0b37['attributes'][_0x17b941(0x166)]},_0x5eecc0),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x2f1e80(0x196)]=a27_0x2f1e80(0x1ab);[a27_0x2f1e80(0x1c4)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x2f1e80(0x132)](_0x19e540){const _0x436352=a27_0x2f1e80,{options:_0xbda917,args:_0x41866e,tdx:_0x4c5340}=_0x19e540,_0x5b33b3=_0x41866e[0x0];if(!requireNameOrPath(_0x5b33b3))return 0x1;const _0x1a62d8=_0xbda917[_0x436352(0x107)];if(!_0x1a62d8)return console['error'](_0x436352(0x140)),console[_0x436352(0x164)](_0x436352(0x198)),0x1;const _0x4ddbda=parseInt(_0x1a62d8,0xa);if(isNaN(_0x4ddbda)||_0x4ddbda<0x1)return console[_0x436352(0x164)](_0x436352(0xe0)+_0x1a62d8),0x1;if(_0xbda917[_0x436352(0x15c)])console[_0x436352(0x164)](_0x436352(0xdf)+_0x5b33b3+_0x436352(0x1b6)+_0x4ddbda);const {journeyId:_0x25ae71,parentSegmentId:_0xc26b4d}=await resolveJourneyIdFromInput(_0x5b33b3,_0xbda917,_0x4c5340),_0x5a9911=await withSpinner(_0x436352(0x1cd),()=>_0x4c5340[_0x436352(0xee)][_0x436352(0x114)](_0x25ae71),{'verbose':_0xbda917[_0x436352(0x15c)]}),{versions:_0x268c65,latestJourneyId:_0x303ae6}=_0x5a9911[_0x436352(0x10a)],_0x2a5963=_0x268c65[_0x436352(0x1a1)](_0x4f6f39=>_0x4f6f39[_0x436352(0x1ce)]===_0x4ddbda);if(!_0x2a5963){const _0x7eed9b=_0x268c65[_0x436352(0x1d3)](_0x3a0ba1=>'v'+_0x3a0ba1[_0x436352(0x1ce)])[_0x436352(0x1b9)](',\x20');return console['error'](_0x436352(0x16d)+_0x4ddbda+'\x20not\x20found.\x20Available:\x20'+_0x7eed9b),0x1;}const _0x170bb6=await withSpinner(_0x436352(0x129)+_0x4ddbda+_0x436352(0x194),()=>_0x4c5340[_0x436352(0xee)][_0x436352(0x109)](_0x2a5963[_0x436352(0x1c7)]),{'verbose':_0xbda917[_0x436352(0x15c)]}),_0x511041=_0x170bb6[_0x436352(0x10a)],_0x47a7a9=getConsoleNextUrl(_0xbda917[_0x436352(0x17f)],'/app/ps/'+_0xc26b4d+'/e/'+_0x2a5963[_0x436352(0x1c7)]+_0x436352(0x19a));return await handleSingleObjectOutput({'id':_0x511041['id'],'name':_0x511041[_0x436352(0x17d)][_0x436352(0x196)],'version':_0x511041[_0x436352(0x17d)]['versionNumber'],'description':_0x511041[_0x436352(0x17d)][_0x436352(0x1c4)],'state':_0x511041[_0x436352(0x17d)][_0x436352(0x104)],'paused':_0x511041['attributes'][_0x436352(0xe9)],'reentry_mode':_0x511041[_0x436352(0x17d)][_0x436352(0x112)],'stages':_0x511041[_0x436352(0x17d)][_0x436352(0x10c)]?.[_0x436352(0x121)]||0x0,..._0x511041[_0x436352(0x17d)][_0x436352(0x131)]&&{'goal':_0x511041[_0x436352(0x17d)]['goal'][_0x436352(0x196)]},'latest':_0x2a5963['journeyId']===_0x303ae6,'created_at':_0x511041[_0x436352(0x17d)][_0x436352(0x166)],'updated_at':_0x511041['attributes'][_0x436352(0x134)],'url':_0x47a7a9},_0xbda917),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x3b997d=a28_0x13a3;(function(_0x154248,_0x19bdab){const _0x2a4506=a28_0x13a3,_0x3eb8f7=_0x154248();while(!![]){try{const _0x5307ba=-parseInt(_0x2a4506(0xd9))/0x1+parseInt(_0x2a4506(0x100))/0x2*(parseInt(_0x2a4506(0xf9))/0x3)+parseInt(_0x2a4506(0x10a))/0x4+parseInt(_0x2a4506(0xf0))/0x5*(-parseInt(_0x2a4506(0x10c))/0x6)+-parseInt(_0x2a4506(0xe8))/0x7*(-parseInt(_0x2a4506(0xe1))/0x8)+parseInt(_0x2a4506(0xf7))/0x9*(-parseInt(_0x2a4506(0xfc))/0xa)+parseInt(_0x2a4506(0xe3))/0xb;if(_0x5307ba===_0x19bdab)break;else _0x3eb8f7['push'](_0x3eb8f7['shift']());}catch(_0xbd4841){_0x3eb8f7['push'](_0x3eb8f7['shift']());}}}(a28_0x54f3,0x1f9c2));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x54f3(){const _0x3c7f27=['315608QIzcgW','file','12198kxLESm','filePath','reason','message','valid','\x20journey(s)\x20valid','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','validCount','\x20warning(s)\x20found','.yml','\x20segment\x20file(s)\x20skipped','execute','126412oQlFSK','warnings','.yaml','\x20journey(s)\x20with\x20errors,\x20','hasErrors','Error:\x20Directory\x20not\x20found:\x20','\x20valid','skippedCount','24kfjFRp','verbose','4803942LHULXk','description','error','helpText','endsWith','7210VabVmw','type','errorCode','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','✔\x20All\x20','invalidCount','yellow','625eLCxWq','\x20segment\x20file(s)\x20skipped)','Validate\x20journey\x20YAML\x20files','parentSegment','cyan','no_parent','journey:validate','48303FFLSVq','No\x20journey\x20YAML\x20files\x20found\x20in\x20','41268WsxBoA','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','170pWOQHw','green','Validation\x20failed:\x20','red','12pJHWNj','\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','targetDir','warningCount','\x20warning(s)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','log','\x20(skipped:\x20','journey','dim'];a28_0x54f3=function(){return _0x3c7f27;};return a28_0x54f3();}import a28_0x525e51 from'chalk';function a28_0x13a3(_0x10643,_0x39f16b){_0x10643=_0x10643-0xd7;const _0x54f31e=a28_0x54f3();let _0x13a347=_0x54f31e[_0x10643];return _0x13a347;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a28_0x3b997d(0xf6);[a28_0x3b997d(0xe4)]=a28_0x3b997d(0xf2);async[a28_0x3b997d(0xd8)](_0x52dc1d){const _0x2065af=a28_0x3b997d,{options:_0x2d6bf3,args:_0x396565}=_0x52dc1d,_0x4ddf4a=_0x2d6bf3,_0x4e9dd6=await resolveTarget({'arg':_0x396565[0x0],'contextParent':_0x2d6bf3[_0x2065af(0xf3)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4e9dd6))return _0x4e9dd6[_0x2065af(0xea)]===_0x2065af(0xf5)?(console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xef)](_0x2065af(0x112))),console[_0x2065af(0xe5)](_0x2065af(0xfb)),console[_0x2065af(0xe5)](_0x2065af(0x101)),console[_0x2065af(0xe5)](_0x2065af(0xfa))):(console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xff)]('Error:\x20'+_0x4e9dd6[_0x2065af(0x10f)]+'\x0a')),_0x4e9dd6['helpText']&&console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xf4)](_0x4e9dd6[_0x2065af(0xe6)]))),0x1;const _0x8ad3bb=_0x4e9dd6[_0x2065af(0x102)],_0x5c1a36=_0x4e9dd6[_0x2065af(0xe9)]===_0x2065af(0x10b)?_0x4e9dd6[_0x2065af(0x10d)]:undefined;if(!_0x5c1a36&&!existsSync(_0x8ad3bb))return console['error'](a28_0x525e51['red'](_0x2065af(0xde)+_0x8ad3bb+'\x0a')),0x1;let _0x3db7b1;if(_0x5c1a36){if(!_0x5c1a36['endsWith'](_0x2065af(0x115))&&!_0x5c1a36[_0x2065af(0xe7)](_0x2065af(0xdb)))return console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xff)](_0x2065af(0x105)+_0x5c1a36+'\x0a')),0x1;_0x3db7b1=[_0x5c1a36];}else _0x3db7b1=findYamlFiles(_0x8ad3bb);if(_0x3db7b1[_0x2065af(0xec)]===0x0)return console['error'](a28_0x525e51['red'](_0x2065af(0xeb)+_0x8ad3bb+'\x0a')),0x1;const _0x495636=validateYamlFiles(_0x3db7b1,_0x8ad3bb,{'filterType':_0x2065af(0x108)}),_0x2345d5=calculateSummary(_0x495636),_0x5d67a2=_0x495636['filter'](isValidationResult);if(_0x5d67a2[_0x2065af(0xec)]===0x0)return console[_0x2065af(0xe5)](a28_0x525e51[_0x2065af(0xef)](_0x2065af(0xf8)+_0x8ad3bb+'\x0a')),_0x2345d5[_0x2065af(0xe0)]>0x0&&console['error'](a28_0x525e51[_0x2065af(0x109)]('('+_0x2345d5[_0x2065af(0xe0)]+_0x2065af(0xf1))),0x0;for(const _0x216ca5 of _0x495636){if(!isValidationResult(_0x216ca5)){_0x4ddf4a[_0x2065af(0xe2)]&&console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0x109)]('-\x20'+_0x216ca5['relativePath']+_0x2065af(0x107)+_0x216ca5[_0x2065af(0x10e)]+')'));continue;}const {relativePath:_0x4b3f8d,source:_0x1acbd1,result:_0x300cb7}=_0x216ca5;if(_0x300cb7['valid']&&_0x300cb7['warnings']['length']===0x0)_0x4ddf4a[_0x2065af(0xe2)]&&console[_0x2065af(0x106)](a28_0x525e51['green']('✔\x20'+_0x4b3f8d));else _0x300cb7[_0x2065af(0x110)]?(console[_0x2065af(0x106)](a28_0x525e51['yellow']('⚠\x20'+_0x4b3f8d+':\x20'+_0x300cb7[_0x2065af(0xda)]['length']+_0x2065af(0x104))),console['log'](formatValidationResult(_0x300cb7,_0x1acbd1,_0x4b3f8d))):(console[_0x2065af(0x106)](a28_0x525e51['red']('✖\x20'+_0x4b3f8d+':\x20'+_0x300cb7['errors'][_0x2065af(0xec)]+'\x20error(s)')),console[_0x2065af(0x106)](formatValidationResult(_0x300cb7,_0x1acbd1,_0x4b3f8d)));}return console['log'](''),_0x2345d5[_0x2065af(0xdd)]?(console['log'](a28_0x525e51[_0x2065af(0xff)](_0x2065af(0xfe)+_0x2345d5[_0x2065af(0xee)]+_0x2065af(0xdc)+_0x2345d5[_0x2065af(0x113)]+_0x2065af(0xdf))),_0x2345d5['warningCount']>0x0&&console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0xef)](_0x2345d5['warningCount']+_0x2065af(0x114))),_0x2345d5[_0x2065af(0xe0)]>0x0&&console[_0x2065af(0x106)](a28_0x525e51['dim'](_0x2345d5[_0x2065af(0xe0)]+_0x2065af(0xd7))),0x1):(console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0xfd)](_0x2065af(0xed)+_0x2345d5[_0x2065af(0x113)]+_0x2065af(0x111))),_0x2345d5[_0x2065af(0x103)]>0x0&&console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0xef)](_0x2345d5['warningCount']+_0x2065af(0x114))),_0x2345d5['skippedCount']>0x0&&console[_0x2065af(0x106)](a28_0x525e51[_0x2065af(0x109)](_0x2345d5['skippedCount']+_0x2065af(0xd7))),0x0);}}
|