@treasuredata/tdx 2026.4.0 → 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.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_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_0x2e5cc9=a26_0x42b9;function a26_0x42b9(_0x594c94,_0x904da){_0x594c94=_0x594c94-0x153;const _0x460002=a26_0x4600();let _0x42b9a0=_0x460002[_0x594c94];return _0x42b9a0;}(function(_0x417099,_0x2763a7){const _0x1e68a5=a26_0x42b9,_0x529cc9=_0x417099();while(!![]){try{const _0x439222=-parseInt(_0x1e68a5(0x17c))/0x1*(-parseInt(_0x1e68a5(0x176))/0x2)+parseInt(_0x1e68a5(0x18a))/0x3+parseInt(_0x1e68a5(0x18b))/0x4*(parseInt(_0x1e68a5(0x188))/0x5)+parseInt(_0x1e68a5(0x192))/0x6*(parseInt(_0x1e68a5(0x168))/0x7)+parseInt(_0x1e68a5(0x155))/0x8+parseInt(_0x1e68a5(0x165))/0x9+parseInt(_0x1e68a5(0x189))/0xa*(-parseInt(_0x1e68a5(0x17d))/0xb);if(_0x439222===_0x2763a7)break;else _0x529cc9['push'](_0x529cc9['shift']());}catch(_0x2d9f27){_0x529cc9['push'](_0x529cc9['shift']());}}}(a26_0x4600,0x2ada2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a26_0x4600(){const _0xb91505=['dim','presto','6875LBtgbs','1640140DmGsSH','532581AdWPxc','460wbOMxz','job:kill','database','INVALID_ARGUMENT','...','✔\x20Retrieved\x20','verbose','6zcXOwe','list','substring','d\x20ago','log','Database:\x20','type','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','green','show','validate','mo\x20ago','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','kill','success','Get\x20job\x20results','trino','args','result','Getting\x20job\x20details...','job:result','abs','status','job:submit','name','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','1494896EdbnbA','getTime','limit','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','map','Submitting\x20job...','Getting\x20job\x20results...','url','m\x20ago','✔\x20Found\x20','Listing\x20jobs...','execute','description','push','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','No\x20SQL\x20statements\x20found\x20in\x20file','415971EMGkHD','Kill\x20a\x20job','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','363587FxbQgH','error','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','priority','submit','Submitting\x20kill\x20request...','start_at','Limit:\x20','query','job_id','length','Submit\x20a\x20job','end_at','debug','60OLfdaY','user_name','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','\x20row','yes','jobType','1563DJqNhs','33TAadpn','data','Show\x20job\x20details','List\x20jobs','created_at','floor','jobs','✔\x20Job\x20submitted','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'];a26_0x4600=function(){return _0xb91505;};return a26_0x4600();}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x1dc756 from'chalk';function formatDuration(_0xa70931){const _0x2dcac9=a26_0x42b9;if(_0xa70931<0x3c)return _0xa70931+'s';if(_0xa70931<0xe10)return Math['floor'](_0xa70931/0x3c)+'m\x20'+_0xa70931%0x3c+'s';const _0x32c156=Math['floor'](_0xa70931/0xe10),_0x32804a=Math[_0x2dcac9(0x182)](_0xa70931%0xe10/0x3c);return _0x32804a>0x0?_0x32c156+'h\x20'+_0x32804a+'m':_0x32c156+'h';}function formatRelativeTime(_0xb563a2){const _0x508204=a26_0x42b9,_0x553346=Date['now']()-_0xb563a2[_0x508204(0x156)](),_0x33abb5=Math[_0x508204(0x182)](Math[_0x508204(0x1a7)](_0x553346)/0x3e8);if(_0x33abb5<0x3c)return'just\x20now';const _0x5891d9=Math[_0x508204(0x182)](_0x33abb5/0x3c);if(_0x5891d9<0x3c)return _0x5891d9+_0x508204(0x15d);const _0x19d35f=Math[_0x508204(0x182)](_0x5891d9/0x3c);if(_0x19d35f<0x18)return _0x19d35f+'h\x20ago';const _0x4100db=Math[_0x508204(0x182)](_0x19d35f/0x18);if(_0x4100db<0x1e)return _0x4100db+_0x508204(0x195);return Math[_0x508204(0x182)](_0x4100db/0x1e)+_0x508204(0x19d);}export class JobListCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x183);[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x180);async[a26_0x2e5cc9(0x160)](_0x3d0b4e){const _0x5f5c9b=a26_0x2e5cc9,{options:_0x5e9071,tdx:_0x362a5d}=_0x3d0b4e,_0x2bd87f=resolveLimit(_0x5e9071[_0x5f5c9b(0x157)],DEFAULT_DISPLAY_LIMIT),_0x25ce4d=_0x5e9071[_0x5f5c9b(0x1a8)];_0x5e9071[_0x5f5c9b(0x191)]&&(console[_0x5f5c9b(0x169)](_0x5f5c9b(0x16f)+_0x2bd87f+'\x20jobs'),_0x25ce4d&&console[_0x5f5c9b(0x169)]('Status\x20filter:\x20'+_0x25ce4d));const _0x5bdca4=await withSpinner(_0x5f5c9b(0x15f),()=>_0x362a5d[_0x5f5c9b(0x183)][_0x5f5c9b(0x193)]({'from':0x0,'to':_0x2bd87f-0x1,'status':_0x25ce4d}),{'verbose':_0x5e9071[_0x5f5c9b(0x191)]}),_0x150768=_0x5bdca4[_0x5f5c9b(0x17e)];console[_0x5f5c9b(0x169)](_0x5f5c9b(0x15e)+_0x150768[_0x5f5c9b(0x172)]+'\x20job'+(_0x150768[_0x5f5c9b(0x172)]!==0x1?'s':''));const _0x4ebf72=_0x5e9071['site'];if(isStructuredFormat(_0x5e9071)){const _0x155f86=_0x150768[_0x5f5c9b(0x159)](_0x394d76=>{const _0x2c4861=_0x5f5c9b;let _0x492284;if(_0x394d76[_0x2c4861(0x16e)]&&_0x394d76['end_at']){const _0x2e7430=new Date(_0x394d76[_0x2c4861(0x16e)])[_0x2c4861(0x156)](),_0x28fe24=new Date(_0x394d76[_0x2c4861(0x174)])['getTime']();_0x492284=Math['round']((_0x28fe24-_0x2e7430)/0x3e8);}return{'job_id':_0x394d76['job_id'],'type':_0x394d76[_0x2c4861(0x198)]===_0x2c4861(0x187)?_0x2c4861(0x1a2):_0x394d76[_0x2c4861(0x198)],'status':_0x394d76[_0x2c4861(0x1a8)],'user_name':_0x394d76[_0x2c4861(0x177)],'duration_sec':_0x492284,'created_at':_0x394d76[_0x2c4861(0x181)],'started_at':_0x394d76['start_at'],'end_at':_0x394d76[_0x2c4861(0x174)]};});await handleSDKOutput(_0x155f86,_0x5e9071);}else for(const _0x481501 of _0x150768){const _0x2bcd50=_0x481501[_0x5f5c9b(0x1a8)]===_0x5f5c9b(0x1a0)?a26_0x1dc756[_0x5f5c9b(0x19a)]:_0x481501[_0x5f5c9b(0x1a8)]===_0x5f5c9b(0x169)?a26_0x1dc756['red']:a26_0x1dc756[_0x5f5c9b(0x186)],_0x335588=_0x2bcd50(_0x481501[_0x5f5c9b(0x1a8)]),_0x57036d=getJobUrl(_0x4ebf72,_0x481501[_0x5f5c9b(0x171)]),_0x55bf24=hyperlink(_0x481501[_0x5f5c9b(0x171)],_0x57036d),_0x2ae34a=a26_0x1dc756['dim'](_0x481501[_0x5f5c9b(0x198)]===_0x5f5c9b(0x187)?_0x5f5c9b(0x1a2):_0x481501[_0x5f5c9b(0x198)]),_0xd7e3c6=[];if(_0x481501[_0x5f5c9b(0x16e)]&&_0x481501[_0x5f5c9b(0x174)]){const _0x36838d=Math['round']((new Date(_0x481501[_0x5f5c9b(0x174)])['getTime']()-new Date(_0x481501['start_at'])[_0x5f5c9b(0x156)]())/0x3e8);_0xd7e3c6[_0x5f5c9b(0x162)](formatDuration(_0x36838d));}if(_0x481501['end_at'])_0xd7e3c6[_0x5f5c9b(0x162)](formatRelativeTime(new Date(_0x481501['end_at'])));else _0x481501[_0x5f5c9b(0x16e)]&&_0xd7e3c6[_0x5f5c9b(0x162)](formatRelativeTime(new Date(_0x481501[_0x5f5c9b(0x16e)])));const _0x3f02df=_0xd7e3c6['length']>0x0?a26_0x1dc756[_0x5f5c9b(0x186)]('\x20'+_0xd7e3c6['join'](',\x20')):'';console[_0x5f5c9b(0x196)]('⚡\x20'+_0x55bf24+'\x20'+_0x2ae34a+'\x20'+_0x335588+_0x3f02df);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x17f);[a26_0x2e5cc9(0x19c)](_0x44f9b9){const _0x590cd1=a26_0x2e5cc9,_0x3b37ed=_0x44f9b9[_0x590cd1(0x1a3)][0x0];if(!_0x3b37ed)return _0x590cd1(0x178);return undefined;}async['execute'](_0x251d76){const _0x25223e=a26_0x2e5cc9,{options:_0x5dd776,args:_0x257a57,tdx:_0x59d781}=_0x251d76,_0x20e9f4=_0x257a57[0x0],_0x25c7d6=await withSpinner(_0x25223e(0x1a5),()=>_0x59d781[_0x25223e(0x183)][_0x25223e(0x19b)](_0x20e9f4),{'verbose':_0x5dd776[_0x25223e(0x191)]}),_0x49fbb8=_0x25c7d6[_0x25223e(0x17e)];let _0x3a9219;if(_0x49fbb8[_0x25223e(0x16e)]&&_0x49fbb8[_0x25223e(0x174)]){const _0x270a68=new Date(_0x49fbb8[_0x25223e(0x16e)])[_0x25223e(0x156)](),_0x1a9d1b=new Date(_0x49fbb8[_0x25223e(0x174)])[_0x25223e(0x156)]();_0x3a9219=Math['round']((_0x1a9d1b-_0x270a68)/0x3e8);}const _0x918a07={'job_id':_0x49fbb8['job_id'],'type':_0x49fbb8[_0x25223e(0x198)],'status':_0x49fbb8[_0x25223e(0x1a8)],..._0x49fbb8[_0x25223e(0x177)]&&{'user_name':_0x49fbb8[_0x25223e(0x177)]},..._0x3a9219!==undefined&&{'duration_sec':_0x3a9219},..._0x49fbb8[_0x25223e(0x181)]&&{'created_at':_0x49fbb8['created_at']},..._0x49fbb8[_0x25223e(0x16e)]&&{'started_at':_0x49fbb8['start_at']},..._0x49fbb8[_0x25223e(0x174)]&&{'end_at':_0x49fbb8[_0x25223e(0x174)]},..._0x49fbb8['database']&&{'database':_0x49fbb8[_0x25223e(0x18d)]},..._0x49fbb8['priority']!==undefined&&{'priority':_0x49fbb8[_0x25223e(0x16b)]},..._0x49fbb8[_0x25223e(0x15c)]&&{'url':_0x49fbb8['url']},..._0x49fbb8['query']&&{'query':_0x49fbb8[_0x25223e(0x170)]},..._0x49fbb8[_0x25223e(0x175)]&&{'debug':_0x49fbb8[_0x25223e(0x175)]}};return await handleSingleObjectOutput(_0x918a07,_0x5dd776),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x18c);['description']=a26_0x2e5cc9(0x166);['validate'](_0x40b8d2){const _0x575548=a26_0x2e5cc9,_0x1465d6=_0x40b8d2[_0x575548(0x1a3)][0x0];if(!_0x1465d6)return _0x575548(0x163);return undefined;}async[a26_0x2e5cc9(0x160)](_0x3c51b7){const _0x3267e0=a26_0x2e5cc9,{options:_0x4c2e8e,args:_0x4af19d,tdx:_0x6e2583}=_0x3c51b7,_0x36b1aa=_0x4af19d[0x0];if(!_0x4c2e8e[_0x3267e0(0x17a)]){const _0x325467=await confirm(_0x3267e0(0x19e)+_0x36b1aa+'?');if(!_0x325467)return console['error']('Cancelled'),0x0;}return await withSpinner(_0x3267e0(0x16d),()=>_0x6e2583['jobs'][_0x3267e0(0x19f)](_0x36b1aa),{'verbose':_0x4c2e8e['verbose']}),console[_0x3267e0(0x169)](_0x3267e0(0x154)+_0x36b1aa),console['error'](_0x3267e0(0x167)+_0x36b1aa+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x1a9);['description']=a26_0x2e5cc9(0x173);async[a26_0x2e5cc9(0x160)](_0x3b8394){const _0x157188=a26_0x2e5cc9,{options:_0x9a984,args:_0x21616e,tdx:_0x173f8f}=_0x3b8394,_0x425b7c=_0x9a984[_0x157188(0x17b)]||_0x157188(0x1a2),_0x26eb14=_0x9a984['file'],_0x2f9729=_0x9a984['database']||'information_schema',_0x4487dc=_0x9a984['result'];if(_0x425b7c!==_0x157188(0x1a2)&&_0x425b7c!=='hive')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x157188(0x16a));let _0x1b705f;if(_0x26eb14){if(_0x21616e[0x0])throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x158));const _0x25d03a=readSqlStatementsFromFile(_0x26eb14);if(_0x25d03a[_0x157188(0x172)]===0x0)throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x164));if(_0x25d03a[_0x157188(0x172)]>0x1)throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x185));_0x1b705f=_0x25d03a[0x0];}else{if(!_0x21616e[0x0])throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x199));_0x1b705f=_0x21616e[0x0];}_0x9a984[_0x157188(0x191)]&&(console[_0x157188(0x169)]('Job\x20type:\x20'+_0x425b7c),console['error'](_0x157188(0x197)+_0x2f9729),console['error']('Query:\x20'+_0x1b705f[_0x157188(0x194)](0x0,0x64)+(_0x1b705f[_0x157188(0x172)]>0x64?_0x157188(0x18f):'')));const _0x44f162=await withSpinner(_0x157188(0x15a),()=>_0x173f8f[_0x157188(0x183)][_0x157188(0x16c)](_0x2f9729,_0x1b705f,_0x425b7c,_0x4487dc),{'verbose':_0x9a984[_0x157188(0x191)]}),_0x25fec7=_0x44f162[_0x157188(0x17e)];return console[_0x157188(0x169)](_0x157188(0x184)),console[_0x157188(0x169)]('\x20\x20Job\x20ID:\x20'+_0x25fec7[_0x157188(0x171)]),await handleSDKOutput([_0x25fec7],_0x9a984),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a26_0x2e5cc9(0x1a6);[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x1a1);[a26_0x2e5cc9(0x19c)](_0x8e2ef1){const _0x4c216a=a26_0x2e5cc9,_0xc95241=_0x8e2ef1[_0x4c216a(0x1a3)][0x0];if(!_0xc95241)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x2e5cc9(0x160)](_0x539c26){const _0x59575b=a26_0x2e5cc9,{options:_0x3872a9,args:_0x48305c,tdx:_0xba2d6d}=_0x539c26,_0x5b0607=_0x48305c[0x0],_0x23ed90=await withSpinner(_0x59575b(0x15b),()=>_0xba2d6d[_0x59575b(0x183)][_0x59575b(0x1a4)](_0x5b0607),{'verbose':_0x3872a9['verbose']}),_0x5659d8=_0x23ed90[_0x59575b(0x17e)];return console[_0x59575b(0x169)](_0x59575b(0x190)+_0x5659d8[_0x59575b(0x172)]+_0x59575b(0x179)+(_0x5659d8[_0x59575b(0x172)]!==0x1?'s':'')),await handleSDKOutput(_0x5659d8,_0x3872a9),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_0x272d82=a27_0x45e0;(function(_0x5e1019,_0x1288f7){const _0x133a5c=a27_0x45e0,_0x379224=_0x5e1019();while(!![]){try{const _0xf98c05=-parseInt(_0x133a5c(0x1d2))/0x1*(-parseInt(_0x133a5c(0x1fc))/0x2)+parseInt(_0x133a5c(0x1a2))/0x3+parseInt(_0x133a5c(0x278))/0x4+parseInt(_0x133a5c(0x27d))/0x5*(-parseInt(_0x133a5c(0x203))/0x6)+parseInt(_0x133a5c(0x249))/0x7+-parseInt(_0x133a5c(0x227))/0x8+-parseInt(_0x133a5c(0x232))/0x9*(parseInt(_0x133a5c(0x191))/0xa);if(_0xf98c05===_0x1288f7)break;else _0x379224['push'](_0x379224['shift']());}catch(_0x4f4107){_0x379224['push'](_0x379224['shift']());}}}(a27_0x2486,0xe60f6));import a27_0x58417c from'chalk';import a27_0x4af32d from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1bc6cf){const _0x584977=a27_0x45e0;return!_0x1bc6cf&&(console[_0x584977(0x1f1)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x584977(0x1f1)](_0x584977(0x1fd))),!!_0x1bc6cf;}function withJsonFormat(_0x143382){const _0x4cdc48=a27_0x45e0;if(!_0x143382[_0x4cdc48(0x267)]&&!_0x143382[_0x4cdc48(0x1c0)]&&!_0x143382[_0x4cdc48(0x226)]&&!_0x143382[_0x4cdc48(0x23e)])return{..._0x143382,'format':'json','json':!![]};return _0x143382;}function formatJourneyState(_0x701511){const _0x434d33=a27_0x45e0;switch(_0x701511){case _0x434d33(0x233):return a27_0x58417c[_0x434d33(0x237)]('(running)');case _0x434d33(0x1bd):return a27_0x58417c[_0x434d33(0x256)]('(draft)');case _0x434d33(0x20c):return a27_0x58417c[_0x434d33(0x1d6)]('(paused)');case'completed':return a27_0x58417c[_0x434d33(0x201)](_0x434d33(0x21d));case _0x434d33(0x239):return a27_0x58417c[_0x434d33(0x256)](_0x434d33(0x286));default:return'('+_0x701511+')';}}function formatJourneyItem(_0x499296,_0x2e1d6c='',_0x15e8d3){const _0x2cc7db=a27_0x45e0,_0x25ff2d=formatJourneyState(_0x499296[_0x2cc7db(0x1b2)]),_0x3f0e4e=_0x15e8d3?hyperlink(_0x499296[_0x2cc7db(0x1a9)],_0x15e8d3):_0x499296[_0x2cc7db(0x1a9)];return _0x2e1d6c+_0x2cc7db(0x1aa)+_0x3f0e4e+'\x20'+_0x25ff2d;}function escapeRegex(_0x1cec87){const _0x19d1ac=a27_0x45e0;return _0x1cec87[_0x19d1ac(0x1b9)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x395820){const _0x32dcb7=a27_0x45e0,_0x4426a4=_0x395820[_0x32dcb7(0x19b)]('*')['map'](escapeRegex);return new RegExp(_0x4426a4[_0x32dcb7(0x1c1)]('.*'),'i');}function buildRuleToNameMapping(_0x288b3b){const _0x3c6c7a=a27_0x45e0,_0x246dbf=new Map();if(_0x288b3b[_0x3c6c7a(0x228)])for(const [_0x45e545,_0x4f6fec]of Object[_0x3c6c7a(0x243)](_0x288b3b['segments'])){if(_0x4f6fec['rule']){const _0x7d20d1=serializeRule(_0x4f6fec[_0x3c6c7a(0x1dd)]),_0x24b518=_0x246dbf[_0x3c6c7a(0x1a6)](_0x7d20d1);_0x24b518?_0x24b518[_0x3c6c7a(0x202)](_0x45e545):_0x246dbf[_0x3c6c7a(0x1e4)](_0x7d20d1,[_0x45e545]);}}return _0x246dbf;}async function resolveJourneyIdFromInput(_0x5ac580,_0xedca34,_0x2a00bb){const _0x30c706=a27_0x45e0,_0x1030db=await resolveJourneyTarget(_0x5ac580,_0xedca34['parentSegment'],_0xedca34[_0x30c706(0x1f4)]),_0x1d4ca4=_0x1030db[_0x30c706(0x26f)];if(!_0x1d4ca4)throw new SDKError(ErrorCode[_0x30c706(0x289)],_0x30c706(0x252));const _0x12bd97=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2a00bb[_0x30c706(0x24a)][_0x30c706(0x231)](_0x1d4ca4),{'verbose':_0xedca34[_0x30c706(0x1f4)]}),_0x10388d=_0x12bd97[_0x30c706(0x28a)],_0x2c7e8b=await withSpinner('Resolving\x20journey...',()=>_0x2a00bb['journey']['resolveJourneyId'](_0x10388d,_0x1030db['journeyName']),{'verbose':_0xedca34['verbose']});return{'journeyId':_0x2c7e8b[_0x30c706(0x28a)],'journeyName':_0x1030db['journeyName'],'parentSegmentId':_0x10388d};}function a27_0x45e0(_0x2064d4,_0x6d85bc){_0x2064d4=_0x2064d4-0x191;const _0x248607=a27_0x2486();let _0x45e0a4=_0x248607[_0x2064d4];return _0x45e0a4;}async function resolveJourneyTarget(_0x196ea8,_0x115056,_0x394aa7){const _0x3a6cda=a27_0x45e0;if(isYamlFilePath(_0x196ea8))try{const _0x1e6453=await resolveYamlFilePath(_0x196ea8);return _0x394aa7&&(console['error'](_0x3a6cda(0x236)+_0x196ea8),console[_0x3a6cda(0x1f1)](_0x3a6cda(0x215)+_0x1e6453[_0x3a6cda(0x26f)]),console['error'](_0x3a6cda(0x234)+_0x1e6453[_0x3a6cda(0x1a5)]),console[_0x3a6cda(0x1f1)](_0x3a6cda(0x248)+(_0x1e6453[_0x3a6cda(0x1ce)]||_0x3a6cda(0x285)))),{'journeyName':_0x1e6453['segmentName'],'parentSegment':_0x1e6453[_0x3a6cda(0x26f)],'resolved':_0x1e6453};}catch(_0x264a36){throw new SDKError(ErrorCode[_0x3a6cda(0x289)],_0x3a6cda(0x1db)+_0x264a36[_0x3a6cda(0x290)]);}if(!_0x115056)throw new SDKError(ErrorCode[_0x3a6cda(0x289)],_0x3a6cda(0x274));return{'journeyName':_0x196ea8,'parentSegment':_0x115056};}function a27_0x2486(){const _0x40aa55=['hasPeriod','parentSegment','\x20changed\x20files','\x20activation','\x20=\x20','from','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20parent\x20segment...','buildIdToEmailMap','setPhase','343004RwtBAq','Found\x20','Show\x20journey\x20statistics','web','Error:\x20Stage\x20\x22','25AFODsq','\x22\x20paused','journey:columns','✔\x20Pulled\x20','localeCompare','journey:push','resolveSegment','journey:resume','(root)','(archived)','includeHistory','Input:\x20','INVALID_ARGUMENT','data','add','stageNameMap','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','all','\x20not\x20found.\x20Available:\x20','message','table','enteredSize','journey:version:create','-\x20no\x20files\x20written','11890oyqOLm','\x20new\x20files','audienceId','user','\x20journeys','Getting\x20version\x20','map','utf-8','Pattern:\x20','\x20Opening\x20','split','listActivationsFlat','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','✔\x20Journey\x20\x22','\x20\x20-\x20','getActivation','journey:stats','1337190RvXBUk','\x20(draft)\x20—\x20\x22','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segmentName','get','Creating\x20new\x20version...','No\x20statistics\x20available\x20for\x20journey:\x20','journeyBundleName','🗺️\x20','Export\x20journey(s)\x20as\x20YAML\x20files','Pause\x20a\x20running\x20journey','hasChanges','List\x20all\x20versions\x20of\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','values','state','log','getSegment','Getting\x20journey\x20details...','nodes','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Show\x20journey\x20table\x20column\x20mapping','replace','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20(ID:\x20','No\x20journeys\x20found','draft','pause','Cancelled','json','join','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','goalSize','has','size','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20journey\x20files\x20to\x20','✔\x20Found\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','\x20files?','cwd','connection','folderPath','site','Aborted.','absolutePath','11106OzSuRt','journey','isNew','relative','yellow','goal','buildIdToNameMap','journey:view','.yml','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Invalid\x20--type\x20\x22','rule','Options:','options','activationParams','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Invalid\x20version\x20number:\x20','diff','set','Database:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','createVersion','/app/ps/','listVersions','journeyId','\x20unchanged\x20files','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','execute','stages','attributes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','error','\x20\x20Target:\x20','conversion','verbose','Warning:\x20Could\x20not\x20resolve\x20activation\x20','segmentPushCommand','Resuming\x20journey...','resume','repeat','...','/e/','222NfhxNu','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Parent\x20segment:\x20','find','content','blue','push','1478238AWxBOi','reentryMode','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','stringify','base','Fetching\x20users\x20and\x20connections...','updatedAt','description','journey:pause','paused','Target\x20directory:\x20','Getting\x20journey\x20traffic\x20data...','getColumnMapping','journey:activations','yes','Error:\x20Journey\x20not\x20found:\x20','Fetching\x20journeys\x20and\x20folders...','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','\x20\x20Parent\x20segment:\x20','file','getJourney','versionNumber','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','completeMilestoneRate','history','(completed)','toLowerCase','renderStats','root\x20folder','tdx.json','\x20versions)','Available\x20stages:\x20','no_parent','Error:\x20','jsonl','280984dpqMfL','segments','dryRun','filePath','listJourneysFromParentSegment','📁\x20','Resolving\x20version...','/j/da/je','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Listing\x20journey\x20activations...','resolveParentId','2619GEYCXg','launched','\x20\x20Name:\x20','\x20\x20Journey\x20ID:\x20','Resolved\x20YAML\x20file:\x20','green','relativePath','archived','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeyStages','test','journeyBundleId','tsv','\x0aChanges\x20to\x20\x27','\x20\x20Preserving\x20local\x20segment\x20name:\x20','session','journey:list','entries','getStatistics','Show\x20journey\x20details','sort','listJourneysWithFolders','\x20\x20Folder\x20path:\x20','5537462TUbWBq','segment','Fetching\x20','rootFolderId','targetDir','cyan','columns','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Pausing\x20journey...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20version','\x22\x20resumed','then','dim','folderId','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20Created\x20v','name','helpText','Resume\x20a\x20paused\x20journey','✔\x20Context\x20set:\x20','\x20\x20Statistics\x20not\x20available','createdAt','activation','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','red','limit','Getting\x20journey\x20statistics...','exitOrJumpRate','format','type','filter','\x20details...','\x20journey','parent_segment','/j/da'];a27_0x2486=function(){return _0x40aa55;};return a27_0x2486();}export class JourneyListCommand extends BaseCommand{['name']=a27_0x272d82(0x242);[a27_0x272d82(0x20a)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x272d82(0x1ed)](_0x1fd0a7){const _0x541475=a27_0x272d82,{options:_0x2dcb14,args:_0x416582,tdx:_0x5d4371}=_0x1fd0a7,_0x8b4af9=_0x416582[0x0],_0x409bb8=_0x2dcb14[_0x541475(0x26f)];if(!_0x409bb8)return console[_0x541475(0x1f1)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x541475(0x1f1)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x12dda1=await withSpinner(_0x541475(0x275),()=>_0x5d4371[_0x541475(0x24a)][_0x541475(0x231)](_0x409bb8),{'verbose':_0x2dcb14[_0x541475(0x1f4)]}),_0x493100=_0x12dda1['data'];_0x2dcb14[_0x541475(0x1f4)]&&(console[_0x541475(0x1f1)](_0x541475(0x1fe)+_0x409bb8+_0x541475(0x1bb)+_0x493100+')'),_0x8b4af9&&console[_0x541475(0x1f1)](_0x541475(0x199)+_0x8b4af9));const _0x1fe36d=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x5d4371[_0x541475(0x24a)]['getParentFull'](_0x493100),{'verbose':_0x2dcb14['verbose']}),_0x4511c0=_0x1fe36d[_0x541475(0x28a)],_0x28f0f0=_0x4511c0[_0x541475(0x24c)],_0x1f6b66=await withSpinner('Listing\x20journeys...',()=>_0x5d4371[_0x541475(0x1d3)][_0x541475(0x247)](_0x493100,_0x28f0f0),{'verbose':_0x2dcb14[_0x541475(0x1f4)]});let _0x45a7ec=_0x1f6b66[_0x541475(0x28a)][_0x541475(0x1c6)];const _0x2db8cc=_0x1f6b66[_0x541475(0x28a)]['folders'],_0x41e350=new Map();for(const _0x5923a2 of _0x2db8cc){_0x41e350['set'](_0x5923a2['id'],_0x5923a2[_0x541475(0x25a)]);}if(_0x8b4af9){const _0x5bc7f4=globToRegex(_0x8b4af9);_0x45a7ec=_0x45a7ec[_0x541475(0x269)](_0x39e81e=>_0x5bc7f4[_0x541475(0x23c)](_0x39e81e[_0x541475(0x1a9)]));}console['error'](_0x541475(0x1c9)+_0x45a7ec[_0x541475(0x219)]+_0x541475(0x26b)+(_0x45a7ec[_0x541475(0x219)]!==0x1?'s':''));const _0x5a0e27=_0x28bdc0=>{const _0x4cfe73=_0x541475;return getConsoleNextUrl(_0x2dcb14[_0x4cfe73(0x1cf)],'/app/ps/'+_0x493100+'/e/'+_0x28bdc0+_0x4cfe73(0x26d));};if(_0x2dcb14[_0x541475(0x267)]==='table')await handleSDKOutput(_0x45a7ec,_0x2dcb14);else{if(_0x2dcb14[_0x541475(0x267)]===_0x541475(0x1c0)){const _0x41e367=_0x45a7ec[_0x541475(0x197)](_0x1f240f=>({..._0x1f240f,'url':_0x5a0e27(_0x1f240f['id'])}));await handleSDKOutput(_0x41e367,_0x2dcb14);}else{console[_0x541475(0x1b3)]('['+_0x409bb8+']');const _0x313172=new Map(),_0x4a42e3=[];for(const _0x50b13c of _0x45a7ec){if(!_0x50b13c[_0x541475(0x257)]||_0x50b13c[_0x541475(0x257)]===_0x28f0f0)_0x4a42e3[_0x541475(0x202)](_0x50b13c);else{const _0x3030b9=_0x313172[_0x541475(0x1a6)](_0x50b13c['folderId'])||[];_0x3030b9['push'](_0x50b13c),_0x313172[_0x541475(0x1e4)](_0x50b13c[_0x541475(0x257)],_0x3030b9);}}const _0x203ddc=(_0x38ca12,_0x41acec)=>_0x38ca12[_0x541475(0x1a9)][_0x541475(0x281)](_0x41acec[_0x541475(0x1a9)],undefined,{'sensitivity':'base'});_0x4a42e3[_0x541475(0x246)](_0x203ddc);for(const _0xfbadc5 of _0x4a42e3){console['log'](formatJourneyItem(_0xfbadc5,'',_0x5a0e27(_0xfbadc5['id'])));}const _0x301cbb=[..._0x313172[_0x541475(0x243)]()][_0x541475(0x246)]((_0x553a51,_0x160e4f)=>{const _0x3a170a=_0x541475,_0x2cd47e=_0x41e350[_0x3a170a(0x1a6)](_0x553a51[0x0])||_0x553a51[0x0],_0x2283e6=_0x41e350[_0x3a170a(0x1a6)](_0x160e4f[0x0])||_0x160e4f[0x0];return _0x2cd47e[_0x3a170a(0x281)](_0x2283e6,undefined,{'sensitivity':_0x3a170a(0x207)});});for(const [_0x33d3e0,_0x338ffd]of _0x301cbb){const _0x2ad850=_0x41e350[_0x541475(0x1a6)](_0x33d3e0)||_0x33d3e0;console[_0x541475(0x1b3)](_0x541475(0x22c)+_0x2ad850),_0x338ffd[_0x541475(0x246)](_0x203ddc);for(const _0x35f6ef of _0x338ffd){console[_0x541475(0x1b3)](formatJourneyItem(_0x35f6ef,'\x20\x20',_0x5a0e27(_0x35f6ef['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x272d82(0x1d9);[a27_0x272d82(0x20a)]=a27_0x272d82(0x245);async['execute'](_0x276720){const _0x5d50a3=a27_0x272d82,{options:_0x4de081,args:_0x40fd7a,tdx:_0x1fbd12}=_0x276720,_0x1563b1=_0x40fd7a[0x0];if(!_0x1563b1)return console[_0x5d50a3(0x1f1)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5d50a3(0x1f1)](_0x5d50a3(0x1b7)),console[_0x5d50a3(0x1f1)](_0x5d50a3(0x1de)),console['error'](_0x5d50a3(0x19d)),0x1;_0x4de081['verbose']&&console['error'](_0x5d50a3(0x288)+_0x1563b1);const {journeyId:_0x3a7709,parentSegmentId:_0x8464e0}=await resolveJourneyIdFromInput(_0x1563b1,_0x4de081,_0x1fbd12);if(_0x4de081[_0x5d50a3(0x27b)]){const _0x422cda=getConsoleNextUrl(_0x4de081['site'],'/app/ps/'+_0x8464e0+_0x5d50a3(0x1fb)+_0x3a7709+_0x5d50a3(0x22e));return console[_0x5d50a3(0x1f1)](a27_0x58417c[_0x5d50a3(0x237)]('✔')+_0x5d50a3(0x19a)+a27_0x58417c[_0x5d50a3(0x24e)](_0x422cda)),openBrowser(_0x422cda),0x0;}const _0x2f6ee5=await withSpinner(_0x5d50a3(0x1b5),()=>_0x1fbd12[_0x5d50a3(0x1d3)][_0x5d50a3(0x217)](_0x3a7709),{'verbose':_0x4de081[_0x5d50a3(0x1f4)]}),_0x1b33ae=_0x2f6ee5[_0x5d50a3(0x28a)],_0x403577=_0x4de081[_0x5d50a3(0x262)];let _0x5d313d;if(_0x403577)try{const _0x5cf31c=await withSpinner(_0x5d50a3(0x265),()=>_0x1fbd12[_0x5d50a3(0x1d3)][_0x5d50a3(0x244)](_0x3a7709),{'verbose':_0x4de081['verbose']});_0x5d313d=_0x5cf31c[_0x5d50a3(0x28a)];}catch{_0x4de081['verbose']&&console[_0x5d50a3(0x1f1)](_0x5d50a3(0x25e));}const _0x17c06b=getConsoleNextUrl(_0x4de081[_0x5d50a3(0x1cf)],_0x5d50a3(0x1e8)+_0x8464e0+_0x5d50a3(0x1fb)+_0x3a7709+_0x5d50a3(0x22e)),_0x4c9843={'id':_0x1b33ae['id'],'name':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x25a)],'description':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x20a)],'state':_0x1b33ae['attributes'][_0x5d50a3(0x1b2)],'paused':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x20c)],'reentry_mode':_0x1b33ae[_0x5d50a3(0x1ef)]['reentryMode'],'stages':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x23b)]?.['length']||0x0,..._0x1b33ae['attributes'][_0x5d50a3(0x1d7)]&&{'goal':_0x1b33ae['attributes']['goal'][_0x5d50a3(0x25a)]},..._0x5d313d&&{'statistics':{'size':_0x5d313d[_0x5d50a3(0x1c5)],'entered':_0x5d313d[_0x5d50a3(0x292)],'goal_achieved':_0x5d313d[_0x5d50a3(0x1c3)],'completion_rate':_0x5d313d['completionRate'],'exit_or_jump':_0x5d313d['exitOrJumpSize'],'exit_or_jump_rate':_0x5d313d[_0x5d50a3(0x266)],'stages':_0x5d313d[_0x5d50a3(0x1ee)]}},'url':_0x17c06b};return await handleSingleObjectOutput(_0x4c9843,_0x4de081),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x272d82(0x1a1);[a27_0x272d82(0x20a)]=a27_0x272d82(0x27a);async[a27_0x272d82(0x1ed)](_0x5d8b3d){const _0x5b60fe=a27_0x272d82,{options:_0x4ec8dd,args:_0x407784,tdx:_0x358c82}=_0x5d8b3d,_0x35943a=_0x407784[0x0];if(!requireNameOrPath(_0x35943a))return 0x1;_0x4ec8dd['verbose']&&console[_0x5b60fe(0x1f1)](_0x5b60fe(0x288)+_0x35943a);const _0x50cccb=_0x4ec8dd,_0x47bfdb=_0x50cccb[_0x5b60fe(0x273)],_0x569e6e=_0x50cccb['to'],_0x1f66e5=_0x50cccb[_0x5b60fe(0x287)],_0x4c107b=_0x50cccb['stage'];_0x1f66e5&&!_0x47bfdb&&!_0x569e6e&&console[_0x5b60fe(0x1f1)](_0x5b60fe(0x258));const _0x361080=_0x1f66e5?withJsonFormat(_0x4ec8dd):_0x4ec8dd,{journeyId:_0x359ec9,journeyName:_0x5e4690}=await resolveJourneyIdFromInput(_0x35943a,_0x361080,_0x358c82),_0x438a01=_0x47bfdb||_0x569e6e?{'from':_0x47bfdb,'to':_0x569e6e}:undefined,_0x118cac=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x5b60fe(0x28e)]([_0x358c82[_0x5b60fe(0x1d3)]['getJourney'](_0x359ec9),_0x358c82[_0x5b60fe(0x1d3)][_0x5b60fe(0x244)](_0x359ec9,_0x438a01)]),{'verbose':_0x361080[_0x5b60fe(0x1f4)]}),[_0x57b464,_0x4d57f0]=_0x118cac[_0x5b60fe(0x28a)];if(!_0x4d57f0||_0x4d57f0[_0x5b60fe(0x1ea)]===null)return console['error'](_0x5b60fe(0x1a8)+_0x5e4690),console[_0x5b60fe(0x1f1)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x547063=buildStageNameMap(_0x57b464),_0x5dec4f=!!(_0x438a01&&_0x4d57f0[_0x5b60fe(0x21c)]?.[_0x5b60fe(0x219)]),_0x5b1072={'stageNameMap':_0x547063,'hasPeriod':_0x5dec4f,'includeHistory':!!_0x1f66e5};if(_0x4c107b&&_0x4d57f0[_0x5b60fe(0x1ee)]){const _0x5129e7=_0x4d57f0['stages'][_0x5b60fe(0x1ff)](_0x21c890=>{const _0x2fad07=_0x5b60fe,_0x2b1260=_0x547063[_0x2fad07(0x1a6)](_0x21c890['id'])??'';return _0x2b1260[_0x2fad07(0x21e)]()===_0x4c107b['toLowerCase']();});if(_0x5129e7)return await handleSingleObjectOutput(formatStageStats(_0x5129e7,_0x5b1072),_0x361080),0x0;const _0x2ac798=_0x4d57f0['stages'][_0x5b60fe(0x197)](_0x5d35f3=>_0x547063['get'](_0x5d35f3['id'])??_0x5d35f3['id']);return console['error'](_0x5b60fe(0x27c)+_0x4c107b+'\x22\x20not\x20found'),console[_0x5b60fe(0x1f1)](_0x5b60fe(0x223)+_0x2ac798['join'](',\x20')),0x1;}const _0x54d2f1=_0x4d57f0['stages']?.[_0x5b60fe(0x197)](_0x1ae4ce=>formatStageStats(_0x1ae4ce,_0x5b1072)),_0x4c42fa=assembleJourneyStats(_0x4d57f0,{'from':_0x47bfdb,'to':_0x569e6e,'includeHistory':_0x1f66e5});return await this['renderStats'](_0x4c42fa,_0x54d2f1??[],_0x361080),0x0;}async[a27_0x272d82(0x21f)](_0xdd509d,_0x33f02f,_0x3b9bdb){const _0x457005=a27_0x272d82,_0x2262bb=_0x3b9bdb[_0x457005(0x267)]==='json'||_0x3b9bdb[_0x457005(0x267)]==='jsonl'||_0x3b9bdb[_0x457005(0x1c0)]||_0x3b9bdb[_0x457005(0x226)];if(_0x2262bb){_0xdd509d['stages']=_0x33f02f,await handleSingleObjectOutput(_0xdd509d,_0x3b9bdb);return;}await handleSingleObjectOutput(_0xdd509d,_0x3b9bdb);for(const _0x1ad0c0 of _0x33f02f){console[_0x457005(0x1b3)](''),console[_0x457005(0x1b3)](String(a27_0x58417c[_0x457005(0x24e)]['bold']('['+_0x1ad0c0['name']+']'))+a27_0x58417c['dim']('\x20'+_0x1ad0c0['id']));const {id:_0x59944f,name:_0x486544,..._0x3abe73}=_0x1ad0c0;await handleSingleObjectOutput(_0x3abe73,_0x3b9bdb);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:traffic';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1b0);async[a27_0x272d82(0x1ed)](_0x30a572){const _0x272aa1=a27_0x272d82,{options:_0x3a3338,args:_0xb70696,tdx:_0xecb553}=_0x30a572,_0x45f50b=_0xb70696[0x0];if(!requireNameOrPath(_0x45f50b))return 0x1;_0x3a3338[_0x272aa1(0x1f4)]&&console[_0x272aa1(0x1f1)]('Input:\x20'+_0x45f50b);const _0x2faff9=_0x3a3338,_0x1be2db=_0x2faff9[_0x272aa1(0x268)],_0x1e7418=_0x2faff9[_0x272aa1(0x273)],_0x3e6e5b=_0x2faff9['to'],_0x59a4a6=_0x2faff9[_0x272aa1(0x264)];if(_0x1be2db&&_0x1be2db!=='conversion'&&_0x1be2db!==_0x272aa1(0x260))return console[_0x272aa1(0x1f1)](_0x272aa1(0x1dc)+_0x1be2db+_0x272aa1(0x214)),0x1;const _0x4beb90=withJsonFormat(_0x3a3338),{journeyId:_0x4fd337,journeyName:_0x256b05}=await resolveJourneyIdFromInput(_0x45f50b,_0x4beb90,_0xecb553),_0x2338b9={'type':_0x1be2db,'from':_0x1e7418,'to':_0x3e6e5b,'limit':_0x59a4a6},_0x6c9e76=await withSpinner(_0x272aa1(0x20e),()=>_0xecb553[_0x272aa1(0x1d3)]['getTrafficData'](_0x4fd337,_0x2338b9),{'verbose':_0x4beb90[_0x272aa1(0x1f4)]}),_0x706e2f=_0x6c9e76[_0x272aa1(0x28a)],_0x4ac09e=_0x706e2f[_0x272aa1(0x1f3)]&&(_0x706e2f[_0x272aa1(0x1f3)][_0x272aa1(0x1b6)][_0x272aa1(0x219)]>0x0||_0x706e2f[_0x272aa1(0x1f3)]['links'][_0x272aa1(0x219)]>0x0),_0x182f2c=_0x706e2f[_0x272aa1(0x260)]&&_0x706e2f['activation'][_0x272aa1(0x219)]>0x0;if(!_0x4ac09e&&!_0x182f2c)return console[_0x272aa1(0x1f1)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x256b05),console[_0x272aa1(0x1f1)](_0x272aa1(0x205)),_0x1e7418&&_0x3e6e5b&&console['error'](_0x272aa1(0x1ec)),0x0;return await handleSingleObjectOutput(_0x706e2f,_0x4beb90),0x0;}}function formatStageStats(_0xc0c88a,_0x2f1314){const _0x573149=a27_0x272d82,_0x11f4ef=_0x2f1314[_0x573149(0x26e)]&&_0xc0c88a[_0x573149(0x21c)]?.[_0x573149(0x219)]?aggregateStageHistory(_0xc0c88a[_0x573149(0x21c)]):{'size':_0xc0c88a['size'],'entered':_0xc0c88a[_0x573149(0x292)],'milestone':_0xc0c88a['milestoneSize'],'milestone_rate':_0xc0c88a[_0x573149(0x21b)],'exit_or_jump':_0xc0c88a['exitOrJumpSize'],'exit_or_jump_rate':_0xc0c88a[_0x573149(0x266)]},_0xed360e={'id':_0xc0c88a['id'],'name':_0x2f1314[_0x573149(0x28c)][_0x573149(0x1a6)](_0xc0c88a['id'])??_0xc0c88a['id'],..._0x11f4ef};return _0x2f1314['hasPeriod']&&_0x2f1314[_0x573149(0x287)]&&_0xc0c88a[_0x573149(0x21c)]&&(_0xed360e[_0x573149(0x21c)]=_0xc0c88a[_0x573149(0x21c)]),_0xed360e;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x272d82(0x20b);[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ac);async[a27_0x272d82(0x1ed)](_0x3148bb){const _0x34cc1b=a27_0x272d82,{options:_0x43b613,args:_0x15d738,tdx:_0x41cfe6}=_0x3148bb,_0x206b90=_0x15d738[0x0];if(!requireNameOrPath(_0x206b90))return 0x1;_0x43b613[_0x34cc1b(0x1f4)]&&console[_0x34cc1b(0x1f1)](_0x34cc1b(0x288)+_0x206b90);const {journeyId:_0x591fcf,journeyName:_0x257a83}=await resolveJourneyIdFromInput(_0x206b90,_0x43b613,_0x41cfe6);if(!_0x43b613[_0x34cc1b(0x211)]){const _0x28f680=await confirm(_0x34cc1b(0x1af)+_0x257a83+'\x22?');if(!_0x28f680)return console[_0x34cc1b(0x1f1)]('Cancelled'),0x0;}const _0x1cc95c=await withSpinner(_0x34cc1b(0x251),()=>_0x41cfe6['journey'][_0x34cc1b(0x1be)](_0x591fcf),{'verbose':_0x43b613[_0x34cc1b(0x1f4)]}),_0x4901c3=_0x1cc95c['data'];return console['error']('✔\x20Journey\x20\x22'+_0x4901c3['attributes']['name']+_0x34cc1b(0x27e)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x284);[a27_0x272d82(0x20a)]=a27_0x272d82(0x25c);async[a27_0x272d82(0x1ed)](_0x15953f){const _0x375734=a27_0x272d82,{options:_0x25b749,args:_0x5be57e,tdx:_0x5d7c36}=_0x15953f,_0x401896=_0x5be57e[0x0];if(!requireNameOrPath(_0x401896))return 0x1;_0x25b749['verbose']&&console[_0x375734(0x1f1)](_0x375734(0x288)+_0x401896);const {journeyId:_0x7faf69,journeyName:_0x14f3f1}=await resolveJourneyIdFromInput(_0x401896,_0x25b749,_0x5d7c36);if(!_0x25b749[_0x375734(0x211)]){const _0x87f38d=await confirm(_0x375734(0x1e6)+_0x14f3f1+'\x22?');if(!_0x87f38d)return console['error'](_0x375734(0x1bf)),0x0;}const _0x566135=await withSpinner(_0x375734(0x1f7),()=>_0x5d7c36[_0x375734(0x1d3)][_0x375734(0x1f8)](_0x7faf69),{'verbose':_0x25b749[_0x375734(0x1f4)]}),_0x3842a5=_0x566135[_0x375734(0x28a)];return console[_0x375734(0x1f1)](_0x375734(0x19e)+_0x3842a5[_0x375734(0x1ef)]['name']+_0x375734(0x254)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:pull';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ab);async['execute'](_0xa7a3f4){const _0x3260e3=a27_0x272d82,{options:_0x412d2b,args:_0x8a1022,tdx:_0x358727}=_0xa7a3f4,_0x158192=_0x412d2b,_0x40390b=_0x8a1022[0x0],_0x26d578=_0x40390b&&isYamlFilePath(_0x40390b),_0x3262e3=await resolveTarget({'arg':_0x26d578?_0x40390b:undefined,'contextParent':_0x412d2b[_0x3260e3(0x26f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3262e3))return _0x3262e3['errorCode']===_0x3260e3(0x224)?(console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)](_0x3260e3(0x1e1))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1ca)),console[_0x3260e3(0x1f1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x3260e3(0x21a)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a27_0x58417c[_0x3260e3(0x263)](_0x3260e3(0x225)+_0x3262e3[_0x3260e3(0x290)]+'\x0a')),_0x3262e3[_0x3260e3(0x25b)]&&console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x24e)](_0x3262e3[_0x3260e3(0x25b)]))),0x1;let _0x149721=_0x26d578?undefined:_0x40390b,_0x1a8aae,_0x2592fd;_0x3262e3[_0x3260e3(0x268)]===_0x3260e3(0x216)&&(_0x149721=_0x3262e3['resourceName'],_0x1a8aae=_0x3262e3['filePath'],_0x2592fd=_0x3262e3[_0x3260e3(0x1ce)]);const _0x24e462=_0x3262e3['parentName'],_0x3d490c=_0x3262e3[_0x3260e3(0x24d)];_0x158192['verbose']&&(console[_0x3260e3(0x1f1)](_0x3260e3(0x1fe)+_0x24e462),console['error'](_0x3260e3(0x20d)+_0x3d490c),_0x149721&&console[_0x3260e3(0x1f1)]('Journey\x20name:\x20'+_0x149721),_0x1a8aae&&console['error']('Target\x20file:\x20'+_0x1a8aae),_0x2592fd&&console[_0x3260e3(0x1f1)]('Folder\x20path:\x20'+_0x2592fd));const _0x116c6d=await withSpinner(_0x3260e3(0x275),()=>_0x358727[_0x3260e3(0x24a)][_0x3260e3(0x231)](_0x24e462),{'verbose':_0x412d2b[_0x3260e3(0x1f4)]}),_0x45b8c4=_0x116c6d['data'],{journeys:_0x35475e,folders:_0x22aff8}=await withSpinner(_0x3260e3(0x213),async()=>{const _0x41d39c=_0x3260e3,[_0x43a93a,_0x2dce06]=await Promise[_0x41d39c(0x28e)]([_0x358727[_0x41d39c(0x1d3)][_0x41d39c(0x22b)](_0x45b8c4,undefined,{'includeAllVersions':!![]}),_0x358727[_0x41d39c(0x24a)]['listFolders'](_0x45b8c4)]);return{'journeys':_0x43a93a,'folders':_0x2dce06};},{'verbose':_0x412d2b['verbose']})[_0x3260e3(0x255)](_0x1728b2=>_0x1728b2[_0x3260e3(0x28a)]);let _0x1c8b5f=_0x35475e;const _0x4e77d7=buildFolderIdToPathMap(_0x22aff8);if(_0x149721){const _0x5d0500=_0x1c8b5f['filter'](_0x3251aa=>_0x3251aa[_0x3260e3(0x1a9)][_0x3260e3(0x21e)]()===_0x149721[_0x3260e3(0x21e)]());if(_0x5d0500[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](_0x3260e3(0x212)+_0x149721),console[_0x3260e3(0x1f1)](_0x3260e3(0x261)),0x1;_0x1c8b5f=_0x5d0500;}if(_0x2592fd!==undefined){const _0xeaaf64=_0x1c8b5f[_0x3260e3(0x269)](_0x2d52df=>{const _0x14c153=_0x3260e3,_0x38d076=_0x2d52df[_0x14c153(0x257)]?_0x4e77d7['get'](_0x2d52df[_0x14c153(0x257)])||'':'';return _0x38d076===_0x2592fd;});if(_0xeaaf64[_0x3260e3(0x219)]===0x0&&_0x1c8b5f[_0x3260e3(0x219)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x149721+'\x27\x20not\x20found\x20in\x20'+(_0x2592fd||_0x3260e3(0x220))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1c2));for(const _0x536d84 of _0x1c8b5f){const _0x21d427=_0x536d84[_0x3260e3(0x257)]?_0x4e77d7[_0x3260e3(0x1a6)](_0x536d84['folderId'])||'':'';console[_0x3260e3(0x1f1)](_0x3260e3(0x19f)+(_0x21d427||_0x3260e3(0x285))+'/'+_0x536d84['journeyBundleName']);}return 0x1;}_0x1c8b5f=_0xeaaf64;}if(_0x1c8b5f[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](_0x3260e3(0x1bc)),0x0;const _0x211981=new Map();for(const _0x4dafc4 of _0x1c8b5f){const _0x1ea7ac=_0x4dafc4[_0x3260e3(0x23d)];!_0x211981['has'](_0x1ea7ac)&&_0x211981[_0x3260e3(0x1e4)](_0x1ea7ac,[]),_0x211981[_0x3260e3(0x1a6)](_0x1ea7ac)['push'](_0x4dafc4);}for(const _0x3dffd0 of _0x211981['values']()){_0x3dffd0[_0x3260e3(0x246)]((_0x6ee40e,_0x3a1ddf)=>(_0x6ee40e[_0x3260e3(0x218)]||0x0)-(_0x3a1ddf[_0x3260e3(0x218)]||0x0));}const _0xef995c=[],{idToEmailMap:_0x4d81c9,connectionIdToNameMap:_0x2f2124}=await withSpinner(_0x3260e3(0x208),async()=>{const _0x270117=_0x3260e3,[_0x31d953,_0x38b86a]=await Promise[_0x270117(0x28e)]([_0x358727[_0x270117(0x194)][_0x270117(0x276)](),_0x358727[_0x270117(0x1cd)][_0x270117(0x1d8)]()]);return{'idToEmailMap':_0x31d953,'connectionIdToNameMap':_0x38b86a};},{'verbose':_0x412d2b[_0x3260e3(0x1f4)]})[_0x3260e3(0x255)](_0x3d0c37=>_0x3d0c37[_0x3260e3(0x28a)]);for(const _0x3dddb8 of _0x211981[_0x3260e3(0x1b1)]()){const _0x15cfe1=_0x3dddb8[0x0][_0x3260e3(0x1a9)],_0x4dd49b=_0x3dddb8[0x0][_0x3260e3(0x257)],_0x12d010=_0x4dd49b?_0x4e77d7[_0x3260e3(0x1a6)](_0x4dd49b)||'':'',_0x4fc022=_0x12d010?a27_0x4af32d[_0x3260e3(0x1c1)](_0x3d490c,_0x12d010):_0x3d490c,_0x3b0518=_0x1a8aae||a27_0x4af32d[_0x3260e3(0x1c1)](_0x4fc022,sanitizeFileName(_0x15cfe1)+_0x3260e3(0x1da));let _0x353eb1,_0x29e250;if(existsSync(_0x3b0518))try{const _0x5587de=readFileSync(_0x3b0518,_0x3260e3(0x198)),_0x2517c1=parseYamlString(_0x5587de);_0x29e250=_0x2517c1,_0x353eb1=buildRuleToNameMapping(_0x2517c1),_0x158192[_0x3260e3(0x1f4)]&&_0x353eb1['size']>0x0&&console[_0x3260e3(0x1f1)](_0x3260e3(0x279)+_0x353eb1[_0x3260e3(0x1c5)]+_0x3260e3(0x1a4)+_0x15cfe1);}catch(_0x7d44c6){_0x158192[_0x3260e3(0x1f4)]&&console[_0x3260e3(0x1f1)](_0x3260e3(0x1ba)+_0x7d44c6[_0x3260e3(0x290)]);}const _0x38d5ea=[],_0x475b7e=new Set(),_0x5b9ffb=new Map(),_0x515b8b=new Map(),_0x5908f9=new Set(),_0x3c8807=new Map(),_0x3b3a96=new Map(),_0x2f7590=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x15cfe1+_0x3260e3(0x1fa),async _0x286792=>{const _0x521631=_0x3260e3;for(const _0x123aa9 of _0x3dddb8){const _0xa20b=_0x3dddb8[_0x521631(0x219)]>0x1?_0x123aa9[_0x521631(0x1a9)]+'\x20v'+(_0x123aa9[_0x521631(0x218)]||0x1):_0x123aa9['journeyBundleName'];_0x286792[_0x521631(0x277)](_0x521631(0x24b)+_0xa20b);const _0x2dc859=await _0x358727['journey'][_0x521631(0x217)](_0x123aa9['id']),_0x480e9b=_0x2dc859[_0x521631(0x1ef)]?.[_0x521631(0x193)],_0x1e1e03={'resolveSegment':async _0x33d4da=>{const _0x503d96=_0x521631;if(!_0x480e9b)return{'name':_0x33d4da,'isJourneyLocal':![]};const _0x8f1ea0=_0x5b9ffb['get'](_0x33d4da);if(_0x8f1ea0)return _0x8f1ea0;try{const _0x45953e=await _0x358727[_0x503d96(0x24a)][_0x503d96(0x1b4)](_0x480e9b,_0x33d4da),_0x2be7f9=_0x45953e['kind']===SEGMENT_KIND_JOURNEY;let _0x30de1f,_0x5b6ecd=_0x45953e[_0x503d96(0x25a)];if(_0x2be7f9&&_0x45953e[_0x503d96(0x1dd)]){const _0x451d1c=await segmentResponseToDef(_0x45953e,{'resolveSegmentName':async _0x598a4=>{const _0x2256d8=_0x503d96,_0x2fa909=_0x5b9ffb[_0x2256d8(0x1a6)](_0x598a4);if(_0x2fa909)return _0x2fa909[_0x2256d8(0x25a)];const _0x1016bf=await _0x1e1e03[_0x2256d8(0x283)](_0x598a4);return _0x1016bf[_0x2256d8(0x25a)];}}),_0x1dc3a5=_0x451d1c[_0x503d96(0x1dd)];_0x30de1f={'description':_0x45953e[_0x503d96(0x20a)],'rule':_0x1dc3a5};const _0xcf7d8a=serializeRule(_0x1dc3a5),_0x40c5bf=_0x515b8b[_0x503d96(0x1a6)](_0xcf7d8a);if(_0x40c5bf)_0x5b6ecd=_0x40c5bf,_0x30de1f=undefined,_0x158192['verbose']&&console[_0x503d96(0x1f1)](_0x503d96(0x250)+_0x45953e[_0x503d96(0x25a)]+'\x20->\x20'+_0x40c5bf);else{let _0x2e687d=![];if(_0x353eb1){const _0x4f7b08=_0x353eb1[_0x503d96(0x1a6)](_0xcf7d8a);if(_0x4f7b08){const _0xd8a8f3=_0x4f7b08['find'](_0x3c7a02=>!_0x475b7e[_0x503d96(0x1c4)](_0x3c7a02));_0xd8a8f3&&(_0x5b6ecd=_0xd8a8f3,_0x475b7e[_0x503d96(0x28b)](_0xd8a8f3),_0x515b8b[_0x503d96(0x1e4)](_0xcf7d8a,_0xd8a8f3),_0x2e687d=!![],_0x158192[_0x503d96(0x1f4)]&&console['error'](_0x503d96(0x240)+_0xd8a8f3+'\x20(rule\x20match)'));}}if(!_0x2e687d){const _0x37c663=generateJourneyLocalName(_0x45953e['name']);_0x37c663&&(_0x5b6ecd=_0x37c663);let _0x32e528=_0x5b6ecd,_0x3e590a=0x2;while(_0x475b7e[_0x503d96(0x1c4)](_0x32e528)){_0x32e528=_0x5b6ecd+'_'+_0x3e590a,_0x3e590a++;}_0x475b7e[_0x503d96(0x28b)](_0x32e528),_0x515b8b['set'](_0xcf7d8a,_0x32e528),_0x5b6ecd=_0x32e528;}}}const _0x30a90f={'name':_0x5b6ecd,'isJourneyLocal':_0x2be7f9,'definition':_0x30de1f};return _0x5b9ffb[_0x503d96(0x1e4)](_0x33d4da,_0x30a90f),_0x30a90f;}catch(_0x16761a){return _0x412d2b[_0x503d96(0x1f4)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x33d4da+':\x20'+_0x16761a[_0x503d96(0x290)]),{'name':_0x33d4da,'isJourneyLocal':![]};}},'resolveActivation':async _0x34754f=>{const _0x4472f7=_0x521631,_0x1c47b4=_0x3c8807[_0x4472f7(0x1a6)](_0x34754f);if(_0x1c47b4)return _0x1c47b4;try{const _0x13c81c=await _0x358727[_0x4472f7(0x1d3)][_0x4472f7(0x1a0)](_0x123aa9['id'],_0x34754f),_0x2cb28c=journeyActivationStepToYaml(_0x13c81c,_0x4d81c9,_0x2f2124),_0x3c9d78=JSON[_0x4472f7(0x206)]({'name':_0x2cb28c[_0x4472f7(0x25a)],'connection':_0x2cb28c['connection'],'connector_config':_0x2cb28c['connector_config']}),_0x7e20e7=_0x3b3a96[_0x4472f7(0x1a6)](_0x3c9d78);if(_0x7e20e7){const _0x55a786={'name':_0x7e20e7,'isJourneyLocal':!![],'definition':_0x2cb28c};return _0x3c8807[_0x4472f7(0x1e4)](_0x34754f,_0x55a786),_0x55a786;}const _0x26a238=_0x13c81c[_0x4472f7(0x1ef)][_0x4472f7(0x1e0)][_0x4472f7(0x25a)]||_0x34754f,_0x463b27=sanitizeYamlKey(_0x26a238)||'activation_'+_0x34754f;let _0xdd4744=_0x463b27,_0x5bbe2e=0x2;while(_0x5908f9['has'](_0xdd4744)){_0xdd4744=_0x463b27+'_'+_0x5bbe2e,_0x5bbe2e++;}_0x5908f9[_0x4472f7(0x28b)](_0xdd4744),_0x3b3a96[_0x4472f7(0x1e4)](_0x3c9d78,_0xdd4744);const _0x1e1761={'name':_0xdd4744,'isJourneyLocal':!![],'definition':_0x2cb28c};return _0x3c8807['set'](_0x34754f,_0x1e1761),_0x1e1761;}catch(_0xa3ff3b){return _0x412d2b[_0x4472f7(0x1f4)]&&console[_0x4472f7(0x1f1)](_0x4472f7(0x1f5)+_0x34754f+':\x20'+_0xa3ff3b['message']),{'name':_0x34754f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x329bb7,_0x278579)=>{const _0x43ff76=_0x521631;return resolveJumpTarget(_0x329bb7,_0x278579,_0x2f7590,_0x452dba=>_0x358727[_0x43ff76(0x1d3)][_0x43ff76(0x217)](_0x452dba));}},_0x38fd4b=await journeyResponseToDef(_0x2dc859,_0x1e1e03);_0x38d5ea[_0x521631(0x202)]({'item':_0x123aa9,'yaml':_0x38fd4b});}},{'verbose':_0x412d2b[_0x3260e3(0x1f4)]});const _0x2fee0f=await _0x358727['journey']['getLatestJourneyId'](_0x3dddb8[0x0][_0x3260e3(0x23d)]),_0x1075fc=buildMergedJourneyDef(_0x38d5ea,_0x353eb1,_0x2fee0f),_0x1f2c7d=normalizeJourneyDef(_0x1075fc,_0x29e250),_0x2aee62=toYamlString(_0x1f2c7d),_0x1c8ab8=_0x1a8aae||a27_0x4af32d[_0x3260e3(0x1c1)](_0x4fc022,sanitizeFileName(_0x15cfe1)+_0x3260e3(0x1da));!_0x1a8aae&&_0x12d010&&!existsSync(_0x4fc022)&&mkdirSync(_0x4fc022,{'recursive':!![]});const _0x4f8267=a27_0x4af32d[_0x3260e3(0x1d5)](process['cwd'](),_0x1c8ab8);if(existsSync(_0x1c8ab8)){const _0x55a288=readFileSync(_0x1c8ab8,_0x3260e3(0x198)),_0x26bf52=generateDiff(_0x55a288,_0x2aee62),_0x57e802=hasChanges(_0x26bf52);_0xef995c['push']({'relativePath':_0x4f8267,'absolutePath':_0x1c8ab8,'content':_0x2aee62,'isNew':![],'hasChanges':_0x57e802,'diff':_0x57e802?formatDiffWithColors(_0x26bf52):undefined});}else _0xef995c[_0x3260e3(0x202)]({'relativePath':_0x4f8267,'absolutePath':_0x1c8ab8,'content':_0x2aee62,'isNew':!![],'hasChanges':![]});}const _0x41cb9b=_0xef995c['filter'](_0x46853a=>_0x46853a[_0x3260e3(0x1d4)]),_0x207776=_0xef995c['filter'](_0x18db8d=>!_0x18db8d['isNew']&&_0x18db8d[_0x3260e3(0x1ad)]),_0x402a25=_0xef995c[_0x3260e3(0x269)](_0xba71e8=>!_0xba71e8[_0x3260e3(0x1d4)]&&!_0xba71e8[_0x3260e3(0x1ad)]),_0x29b2e1=_0x1c8b5f[_0x3260e3(0x219)],_0xfb2b40=_0x211981['size'],_0xf5307d=_0x29b2e1>_0xfb2b40?'\x20('+_0x29b2e1+_0x3260e3(0x222):'';console[_0x3260e3(0x1f1)]('\x0aPull\x20summary:'),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x24e)](_0xfb2b40+_0x3260e3(0x195))+a27_0x58417c['dim'](_0xf5307d)),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x237)]('+\x20'+_0x41cb9b['length']+_0x3260e3(0x192))),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x1d6)]('~\x20'+_0x207776[_0x3260e3(0x219)]+_0x3260e3(0x270))),console['error']('\x20\x20'+a27_0x58417c['dim']('=\x20'+_0x402a25['length']+_0x3260e3(0x1eb))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1f2)+a27_0x58417c[_0x3260e3(0x24e)](_0x3d490c)+'\x0a');if(_0x207776[_0x3260e3(0x219)]>0x0)for(const _0x141e4b of _0x207776){console[_0x3260e3(0x1f1)](_0x3260e3(0x23f)+_0x141e4b[_0x3260e3(0x238)]+'\x27:'),console[_0x3260e3(0x1f1)]('─'[_0x3260e3(0x1f9)](0x3c)),console[_0x3260e3(0x1f1)](_0x141e4b[_0x3260e3(0x1e3)]),console['error']('─'[_0x3260e3(0x1f9)](0x3c));}if(_0x158192[_0x3260e3(0x229)])return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x41cb9b[_0x3260e3(0x219)]===0x0&&_0x207776[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x24e462},_0x158192[_0x3260e3(0x241)]),console['error'](a27_0x58417c['green'](_0x3260e3(0x25d)+a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x26c))+'\x20=\x20'+a27_0x58417c['cyan'](_0x24e462))),0x0;if(!_0x158192[_0x3260e3(0x211)]&&(_0x41cb9b[_0x3260e3(0x219)]>0x0||_0x207776[_0x3260e3(0x219)]>0x0)){if(!isInteractive())return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x263)]('\x0aError:'),_0x3260e3(0x1c7)),console['error'](a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x1f0))),0x1;const _0x3f45c6=await confirmKey('Write\x20'+(_0x41cb9b[_0x3260e3(0x219)]+_0x207776[_0x3260e3(0x219)])+_0x3260e3(0x1cb));if(!_0x3f45c6)return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)](_0x3260e3(0x1d0)),_0x3260e3(0x294)),0x1;}!existsSync(_0x3d490c)&&mkdirSync(_0x3d490c,{'recursive':!![]});const _0x5e9247=a27_0x4af32d[_0x3260e3(0x1c1)](_0x3d490c,_0x3260e3(0x221));writeFileSync(_0x5e9247,createTdxConfigContent(_0x24e462),_0x3260e3(0x198));for(const _0xec8149 of _0xef995c){(_0xec8149['isNew']||_0xec8149[_0x3260e3(0x1ad)])&&writeFileSync(_0xec8149[_0x3260e3(0x1d1)],_0xec8149[_0x3260e3(0x200)],_0x3260e3(0x198));}return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)](_0x3260e3(0x280)+(_0x41cb9b[_0x3260e3(0x219)]+_0x207776[_0x3260e3(0x219)])+_0x3260e3(0x1c8)+_0x3d490c)),saveSessionContext({'parent_segment':_0x24e462},_0x158192['session']),console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)](_0x3260e3(0x25d)+a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x26c))+_0x3260e3(0x272)+a27_0x58417c[_0x3260e3(0x24e)](_0x24e462))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x272d82(0x27f);['description']=a27_0x272d82(0x1b8);async['execute'](_0x39e35d){const _0x53222b=a27_0x272d82,{options:_0x19986e,args:_0x2d876b,tdx:_0x3c349f}=_0x39e35d,_0x3a884b=_0x2d876b[0x0];if(!requireNameOrPath(_0x3a884b))return 0x1;_0x19986e[_0x53222b(0x1f4)]&&console[_0x53222b(0x1f1)](_0x53222b(0x288)+_0x3a884b);const {journeyId:_0x6fe0f2}=await resolveJourneyIdFromInput(_0x3a884b,_0x19986e,_0x3c349f),_0x5b3fff=await withSpinner('Getting\x20column\x20mapping...',()=>_0x3c349f[_0x53222b(0x1d3)][_0x53222b(0x20f)](_0x6fe0f2),{'verbose':_0x19986e[_0x53222b(0x1f4)]}),_0x3ecbc1=_0x5b3fff['data'];return console['log'](_0x53222b(0x1e5)+_0x3ecbc1['database']),console[_0x53222b(0x1b3)]('Table:\x20'+_0x3ecbc1[_0x53222b(0x291)]),await handleSDKOutput(_0x3ecbc1[_0x53222b(0x24f)],_0x19986e),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x210);[a27_0x272d82(0x20a)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x272d82(0x1ed)](_0x16c70e){const _0x9182ba=a27_0x272d82,{options:_0x28abc2,args:_0x1c1045,tdx:_0x38f328}=_0x16c70e,_0x430ea6=_0x1c1045[0x0];if(!requireNameOrPath(_0x430ea6))return 0x1;_0x28abc2['verbose']&&console[_0x9182ba(0x1f1)](_0x9182ba(0x288)+_0x430ea6);const {journeyId:_0x130058}=await resolveJourneyIdFromInput(_0x430ea6,_0x28abc2,_0x38f328),_0x343df6=await withSpinner(_0x9182ba(0x230),()=>_0x38f328[_0x9182ba(0x1d3)][_0x9182ba(0x19c)](_0x130058),{'verbose':_0x28abc2['verbose']}),_0x36f9b9=_0x343df6[_0x9182ba(0x28a)];return console[_0x9182ba(0x1f1)](_0x9182ba(0x279)+_0x36f9b9[_0x9182ba(0x219)]+_0x9182ba(0x271)+(_0x36f9b9[_0x9182ba(0x219)]!==0x1?'s':'')),await handleSDKOutput(_0x36f9b9,_0x28abc2),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x272d82(0x282);[a27_0x272d82(0x20a)]=a27_0x272d82(0x28d);[a27_0x272d82(0x1f6)]=new SegmentPushCommand();async[a27_0x272d82(0x1ed)](_0x45071f){const _0xa8b3ad=a27_0x272d82,_0x141f93=_0x45071f['args'][0x0];let _0x5b56b6;if(_0x141f93){const _0x460483=await resolveTarget({'arg':_0x141f93,'contextParent':_0x45071f[_0xa8b3ad(0x1df)][_0xa8b3ad(0x26f)],'cwd':process[_0xa8b3ad(0x1cc)]()});isSuccessfulResolution(_0x460483)&&_0x460483[_0xa8b3ad(0x268)]===_0xa8b3ad(0x216)&&(_0x5b56b6=_0x460483[_0xa8b3ad(0x22a)]);}const _0x20bdc5={..._0x45071f,'options':{..._0x45071f[_0xa8b3ad(0x1df)],'journeysOnly':!![],..._0x5b56b6&&{'singleFilePath':_0x5b56b6}}};return this['segmentPushCommand'][_0xa8b3ad(0x1ed)](_0x20bdc5);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:versions';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ae);async['execute'](_0x2ac52a){const _0x150c25=a27_0x272d82,{options:_0x4fccad,args:_0x1cc0c5,tdx:_0x3de626}=_0x2ac52a,_0xfdcc65=_0x1cc0c5[0x0];if(!requireNameOrPath(_0xfdcc65))return 0x1;if(_0x4fccad[_0x150c25(0x1f4)])console[_0x150c25(0x1f1)]('Input:\x20'+_0xfdcc65);const {journeyId:_0x51e138}=await resolveJourneyIdFromInput(_0xfdcc65,_0x4fccad,_0x3de626),_0x420992=await withSpinner('Listing\x20journey\x20versions...',()=>_0x3de626[_0x150c25(0x1d3)][_0x150c25(0x1e9)](_0x51e138),{'verbose':_0x4fccad[_0x150c25(0x1f4)]}),{bundleName:_0x443bd4,versions:_0x1434d4,latestJourneyId:_0x5c5988}=_0x420992['data'];console[_0x150c25(0x1f1)](_0x443bd4+':\x20'+_0x1434d4[_0x150c25(0x219)]+_0x150c25(0x253)+(_0x1434d4[_0x150c25(0x219)]!==0x1?'s':''));const _0x5197ef=_0x1434d4[_0x150c25(0x197)](_0x1d8b20=>({'version':_0x1d8b20[_0x150c25(0x218)],'journey_id':_0x1d8b20[_0x150c25(0x1ea)],'name':_0x1d8b20[_0x150c25(0x25a)],'state':_0x1d8b20[_0x150c25(0x1b2)],'paused':_0x1d8b20['paused'],'latest':_0x1d8b20['journeyId']===_0x5c5988,'created_at':_0x1d8b20[_0x150c25(0x25f)]}));return await handleSDKOutput(_0x5197ef,_0x4fccad),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x293);[a27_0x272d82(0x20a)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x272d82(0x1ed)](_0x2249b9){const _0x116fb9=a27_0x272d82,{options:_0x4a9fb9,args:_0x380a0a,tdx:_0x2e41a7}=_0x2249b9,_0x16abb5=_0x380a0a[0x0];if(!requireNameOrPath(_0x16abb5))return 0x1;if(_0x4a9fb9[_0x116fb9(0x1f4)])console[_0x116fb9(0x1f1)](_0x116fb9(0x288)+_0x16abb5);const {journeyId:_0x3762c,journeyName:_0x1ab763}=await resolveJourneyIdFromInput(_0x16abb5,_0x4a9fb9,_0x2e41a7);if(!_0x4a9fb9[_0x116fb9(0x211)]){const _0x4f3ff0=await confirm(_0x116fb9(0x22f)+_0x1ab763+'\x22?');if(!_0x4f3ff0)return console[_0x116fb9(0x1f1)](_0x116fb9(0x1bf)),0x0;}const _0x4b2dd1=await withSpinner(_0x116fb9(0x1a7),()=>_0x2e41a7[_0x116fb9(0x1d3)][_0x116fb9(0x1e7)](_0x3762c),{'verbose':_0x4a9fb9['verbose']}),_0x473fbd=_0x4b2dd1['data'];return console[_0x116fb9(0x1f1)](a27_0x58417c['green']('✔')+_0x116fb9(0x259)+_0x473fbd[_0x116fb9(0x1ef)]['versionNumber']+_0x116fb9(0x1a3)+_0x473fbd['attributes'][_0x116fb9(0x25a)]+'\x22'),console[_0x116fb9(0x1f1)](_0x116fb9(0x235)+_0x473fbd['id']),await handleSingleObjectOutput({'id':_0x473fbd['id'],'name':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x25a)],'version':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x218)],'state':_0x473fbd['attributes'][_0x116fb9(0x1b2)],'bundle_id':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x23d)],'created_at':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x25f)]},_0x4a9fb9),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';['description']=a27_0x272d82(0x23a);async[a27_0x272d82(0x1ed)](_0x4175f5){const _0x208b8d=a27_0x272d82,{options:_0x41b396,args:_0x4677bc,tdx:_0x45e2de}=_0x4175f5,_0x557b1c=_0x4677bc[0x0];if(!requireNameOrPath(_0x557b1c))return 0x1;const _0x2882d1=_0x41b396['version'];if(!_0x2882d1)return console[_0x208b8d(0x1f1)]('Error:\x20--version\x20option\x20is\x20required'),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x4e0238=parseInt(_0x2882d1,0xa);if(isNaN(_0x4e0238)||_0x4e0238<0x1)return console['error'](_0x208b8d(0x1e2)+_0x2882d1),0x1;if(_0x41b396['verbose'])console[_0x208b8d(0x1f1)](_0x208b8d(0x288)+_0x557b1c+',\x20version:\x20'+_0x4e0238);const {journeyId:_0x485899,parentSegmentId:_0x247082}=await resolveJourneyIdFromInput(_0x557b1c,_0x41b396,_0x45e2de),_0x4b6117=await withSpinner(_0x208b8d(0x22d),()=>_0x45e2de[_0x208b8d(0x1d3)][_0x208b8d(0x1e9)](_0x485899),{'verbose':_0x41b396['verbose']}),{versions:_0x4ebeda,latestJourneyId:_0x24c20d}=_0x4b6117[_0x208b8d(0x28a)],_0x446396=_0x4ebeda[_0x208b8d(0x1ff)](_0x2551e8=>_0x2551e8[_0x208b8d(0x218)]===_0x4e0238);if(!_0x446396){const _0x3ceb71=_0x4ebeda[_0x208b8d(0x197)](_0x534795=>'v'+_0x534795['versionNumber'])[_0x208b8d(0x1c1)](',\x20');return console['error']('Error:\x20Version\x20'+_0x4e0238+_0x208b8d(0x28f)+_0x3ceb71),0x1;}const _0x56f275=await withSpinner(_0x208b8d(0x196)+_0x4e0238+_0x208b8d(0x26a),()=>_0x45e2de[_0x208b8d(0x1d3)][_0x208b8d(0x217)](_0x446396[_0x208b8d(0x1ea)]),{'verbose':_0x41b396[_0x208b8d(0x1f4)]}),_0x55be3d=_0x56f275[_0x208b8d(0x28a)],_0x44e2f0=getConsoleNextUrl(_0x41b396[_0x208b8d(0x1cf)],_0x208b8d(0x1e8)+_0x247082+_0x208b8d(0x1fb)+_0x446396[_0x208b8d(0x1ea)]+_0x208b8d(0x22e));return await handleSingleObjectOutput({'id':_0x55be3d['id'],'name':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x25a)],'version':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x218)],'description':_0x55be3d['attributes'][_0x208b8d(0x20a)],'state':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x1b2)],'paused':_0x55be3d[_0x208b8d(0x1ef)]['paused'],'reentry_mode':_0x55be3d['attributes'][_0x208b8d(0x204)],'stages':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x23b)]?.[_0x208b8d(0x219)]||0x0,..._0x55be3d['attributes'][_0x208b8d(0x1d7)]&&{'goal':_0x55be3d['attributes']['goal'][_0x208b8d(0x25a)]},'latest':_0x446396[_0x208b8d(0x1ea)]===_0x24c20d,'created_at':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x25f)],'updated_at':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x209)],'url':_0x44e2f0},_0x41b396),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);}}
|