@treasuredata/tdx 2026.8.7 → 2026.9.0
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/codex-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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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.d.ts +48 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-landing-page-command.d.ts +48 -0
- package/dist/commands/engage-landing-page-command.d.ts.map +1 -0
- package/dist/commands/engage-landing-page-command.js +1 -0
- package/dist/commands/engage-landing-page-command.js.map +1 -0
- 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/p13n-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-move-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/table-deleted.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/site-mismatch.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.d.ts +28 -0
- package/dist/mcp/tools/tdx-run.d.ts.map +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-run.js.map +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/auth-token.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.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/cas/validate-files.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.d.ts +58 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +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/p13n-studio-api-client.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/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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/landing-page-init.d.ts +15 -0
- package/dist/sdk/engage/landing-page-init.d.ts.map +1 -0
- package/dist/sdk/engage/landing-page-init.js +1 -0
- package/dist/sdk/engage/landing-page-init.js.map +1 -0
- package/dist/sdk/engage/landing-page-public-asset.d.ts +16 -0
- package/dist/sdk/engage/landing-page-public-asset.d.ts.map +1 -0
- package/dist/sdk/engage/landing-page-public-asset.js +1 -0
- package/dist/sdk/engage/landing-page-public-asset.js.map +1 -0
- package/dist/sdk/engage/landing-page-pull.d.ts +42 -0
- package/dist/sdk/engage/landing-page-pull.d.ts.map +1 -0
- package/dist/sdk/engage/landing-page-pull.js +1 -0
- package/dist/sdk/engage/landing-page-pull.js.map +1 -0
- package/dist/sdk/engage/landing-page-push.d.ts +44 -0
- package/dist/sdk/engage/landing-page-push.d.ts.map +1 -0
- package/dist/sdk/engage/landing-page-push.js +1 -0
- package/dist/sdk/engage/landing-page-push.js.map +1 -0
- package/dist/sdk/engage/landing-page-static-site.d.ts +37 -0
- package/dist/sdk/engage/landing-page-static-site.d.ts.map +1 -0
- package/dist/sdk/engage/landing-page-static-site.js +1 -0
- package/dist/sdk/engage/landing-page-static-site.js.map +1 -0
- package/dist/sdk/engage/landing-page-validator.d.ts +17 -0
- package/dist/sdk/engage/landing-page-validator.d.ts.map +1 -0
- package/dist/sdk/engage/landing-page-validator.js +1 -0
- package/dist/sdk/engage/landing-page-validator.js.map +1 -0
- package/dist/sdk/engage/landing-page-workspace.d.ts +10 -0
- package/dist/sdk/engage/landing-page-workspace.d.ts.map +1 -0
- package/dist/sdk/engage/landing-page-workspace.js +1 -0
- package/dist/sdk/engage/landing-page-workspace.js.map +1 -0
- package/dist/sdk/engage/landing-page-yaml.d.ts +20 -0
- package/dist/sdk/engage/landing-page-yaml.d.ts.map +1 -0
- package/dist/sdk/engage/landing-page-yaml.js +1 -0
- package/dist/sdk/engage/landing-page-yaml.js.map +1 -0
- 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/always-on-campaign-schema.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/landing-page-schema.d.ts +21 -0
- package/dist/sdk/engage/types/landing-page-schema.d.ts.map +1 -0
- package/dist/sdk/engage/types/landing-page-schema.js +1 -0
- package/dist/sdk/engage/types/landing-page-schema.js.map +1 -0
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +91 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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/llm/user-settings.js +1 -1
- package/dist/sdk/p13n-studio.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.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.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +182 -0
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +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/util/tree-search.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/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.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/proxy-fetch.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 a30_0x82e7d7=a30_0x1802;(function(_0x474bab,_0x17d78a){const _0x1200b5=a30_0x1802,_0x221769=_0x474bab();while(!![]){try{const _0x69d757=-parseInt(_0x1200b5(0xda))/0x1+parseInt(_0x1200b5(0xfc))/0x2+parseInt(_0x1200b5(0xf2))/0x3+parseInt(_0x1200b5(0x10f))/0x4*(parseInt(_0x1200b5(0xed))/0x5)+-parseInt(_0x1200b5(0xea))/0x6+parseInt(_0x1200b5(0x107))/0x7*(-parseInt(_0x1200b5(0x115))/0x8)+parseInt(_0x1200b5(0xcb))/0x9*(parseInt(_0x1200b5(0xd3))/0xa);if(_0x69d757===_0x17d78a)break;else _0x221769['push'](_0x221769['shift']());}catch(_0xa3ab8f){_0x221769['push'](_0x221769['shift']());}}}(a30_0x454f,0x9706c));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';function a30_0x1802(_0x4b665e,_0xbea13c){_0x4b665e=_0x4b665e-0xc0;const _0x454fe8=a30_0x454f();let _0x18027f=_0x454fe8[_0x4b665e];return _0x18027f;}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 a30_0x51a2d1 from'chalk';function formatDuration(_0x54f2a7){const _0x3325a7=a30_0x1802;if(_0x54f2a7<0x3c)return _0x54f2a7+'s';if(_0x54f2a7<0xe10)return Math[_0x3325a7(0xe2)](_0x54f2a7/0x3c)+'m\x20'+_0x54f2a7%0x3c+'s';const _0x8349dd=Math['floor'](_0x54f2a7/0xe10),_0x27feb3=Math['floor'](_0x54f2a7%0xe10/0x3c);return _0x27feb3>0x0?_0x8349dd+'h\x20'+_0x27feb3+'m':_0x8349dd+'h';}function formatRelativeTime(_0x45a1ad){const _0x242951=a30_0x1802,_0x38b059=Date['now']()-_0x45a1ad[_0x242951(0x110)](),_0x418142=Math['floor'](Math['abs'](_0x38b059)/0x3e8);if(_0x418142<0x3c)return _0x242951(0xe0);const _0xc0b9dc=Math[_0x242951(0xe2)](_0x418142/0x3c);if(_0xc0b9dc<0x3c)return _0xc0b9dc+'m\x20ago';const _0x563e8e=Math[_0x242951(0xe2)](_0xc0b9dc/0x3c);if(_0x563e8e<0x18)return _0x563e8e+_0x242951(0xc6);const _0x56f1f1=Math['floor'](_0x563e8e/0x18);if(_0x56f1f1<0x1e)return _0x56f1f1+_0x242951(0x117);return Math[_0x242951(0xe2)](_0x56f1f1/0x1e)+_0x242951(0xca);}export class JobListCommand extends BaseCommand{[a30_0x82e7d7(0xc9)]=a30_0x82e7d7(0xd7);['description']=a30_0x82e7d7(0xdb);async['execute'](_0x362ba2){const _0x2951f0=a30_0x82e7d7,{options:_0x3059f8,tdx:_0xef8a4a}=_0x362ba2,_0x13a16a=resolveLimit(_0x3059f8[_0x2951f0(0xd6)],DEFAULT_DISPLAY_LIMIT),_0x446b80=_0x3059f8[_0x2951f0(0xec)];_0x3059f8['verbose']&&(console[_0x2951f0(0xe1)](_0x2951f0(0xe9)+_0x13a16a+_0x2951f0(0xee)),_0x446b80&&console[_0x2951f0(0xe1)](_0x2951f0(0xf3)+_0x446b80));const _0x479ed4=await withSpinner(_0x2951f0(0x108),()=>_0xef8a4a[_0x2951f0(0xd7)][_0x2951f0(0xe6)]({'from':0x0,'to':_0x13a16a-0x1,'status':_0x446b80}),{'verbose':_0x3059f8['verbose']}),_0x50500e=_0x479ed4['data'];console[_0x2951f0(0xe1)](_0x2951f0(0xc4)+_0x50500e[_0x2951f0(0xe4)]+_0x2951f0(0xcc)+(_0x50500e['length']!==0x1?'s':''));const _0x4dfc05=_0x3059f8['site'];if(isStructuredFormat(_0x3059f8)){const _0x57428b=_0x50500e[_0x2951f0(0x10b)](_0x407384=>{const _0x347c2f=_0x2951f0;let _0x2653f4;if(_0x407384[_0x347c2f(0x116)]&&_0x407384[_0x347c2f(0x118)]){const _0xf898ec=new Date(_0x407384['start_at'])[_0x347c2f(0x110)](),_0xc02d4=new Date(_0x407384[_0x347c2f(0x118)])[_0x347c2f(0x110)]();_0x2653f4=Math[_0x347c2f(0xc0)]((_0xc02d4-_0xf898ec)/0x3e8);}return{'job_id':_0x407384[_0x347c2f(0x10e)],'type':_0x407384[_0x347c2f(0xd8)]===_0x347c2f(0x10a)?_0x347c2f(0x104):_0x407384[_0x347c2f(0xd8)],'status':_0x407384['status'],'user_name':_0x407384[_0x347c2f(0xf5)],'duration_sec':_0x2653f4,'created_at':_0x407384[_0x347c2f(0xd4)],'started_at':_0x407384[_0x347c2f(0x116)],'end_at':_0x407384[_0x347c2f(0x118)]};});await handleSDKOutput(_0x57428b,_0x3059f8);}else for(const _0x301290 of _0x50500e){const _0x5e242f=_0x301290[_0x2951f0(0xec)]===_0x2951f0(0xe7)?a30_0x51a2d1[_0x2951f0(0x112)]:_0x301290[_0x2951f0(0xec)]==='error'?a30_0x51a2d1[_0x2951f0(0xe8)]:a30_0x51a2d1['dim'],_0x1136d5=_0x5e242f(_0x301290[_0x2951f0(0xec)]),_0x878455=getJobUrl(_0x4dfc05,_0x301290['job_id']),_0x277978=hyperlink(_0x301290[_0x2951f0(0x10e)],_0x878455),_0x45b443=a30_0x51a2d1['dim'](_0x301290['type']===_0x2951f0(0x10a)?_0x2951f0(0x104):_0x301290['type']),_0x5d00f0=[];if(_0x301290[_0x2951f0(0x116)]&&_0x301290['end_at']){const _0xff219a=Math[_0x2951f0(0xc0)]((new Date(_0x301290[_0x2951f0(0x118)])[_0x2951f0(0x110)]()-new Date(_0x301290['start_at'])[_0x2951f0(0x110)]())/0x3e8);_0x5d00f0[_0x2951f0(0x111)](formatDuration(_0xff219a));}if(_0x301290['end_at'])_0x5d00f0[_0x2951f0(0x111)](formatRelativeTime(new Date(_0x301290[_0x2951f0(0x118)])));else _0x301290[_0x2951f0(0x116)]&&_0x5d00f0['push'](formatRelativeTime(new Date(_0x301290[_0x2951f0(0x116)])));const _0x34c53c=_0x5d00f0[_0x2951f0(0xe4)]>0x0?a30_0x51a2d1[_0x2951f0(0xf8)]('\x20'+_0x5d00f0['join'](',\x20')):'';console[_0x2951f0(0x10c)]('⚡\x20'+_0x277978+'\x20'+_0x45b443+'\x20'+_0x1136d5+_0x34c53c);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a30_0x82e7d7(0xc9)]=a30_0x82e7d7(0x106);[a30_0x82e7d7(0x109)]=a30_0x82e7d7(0x113);[a30_0x82e7d7(0xc2)](_0x307854){const _0x4d4c47=a30_0x82e7d7,_0x5cdb69=_0x307854[_0x4d4c47(0x105)][0x0];if(!_0x5cdb69)return _0x4d4c47(0xc5);return undefined;}async[a30_0x82e7d7(0xef)](_0x403d11){const _0x48fd65=a30_0x82e7d7,{options:_0x4d0eb6,args:_0x59f8c1,tdx:_0x10eb64}=_0x403d11,_0x39bed5=_0x59f8c1[0x0],_0x373660=await withSpinner(_0x48fd65(0xff),()=>_0x10eb64[_0x48fd65(0xd7)][_0x48fd65(0xc8)](_0x39bed5),{'verbose':_0x4d0eb6[_0x48fd65(0xcf)]}),_0x435ab2=_0x373660['data'];let _0x3fb58a;if(_0x435ab2[_0x48fd65(0x116)]&&_0x435ab2['end_at']){const _0x2c2a29=new Date(_0x435ab2[_0x48fd65(0x116)])[_0x48fd65(0x110)](),_0x4a1b77=new Date(_0x435ab2[_0x48fd65(0x118)])[_0x48fd65(0x110)]();_0x3fb58a=Math[_0x48fd65(0xc0)]((_0x4a1b77-_0x2c2a29)/0x3e8);}const _0x5b39a8={'job_id':_0x435ab2[_0x48fd65(0x10e)],'type':_0x435ab2['type'],'status':_0x435ab2[_0x48fd65(0xec)],..._0x435ab2[_0x48fd65(0xf5)]&&{'user_name':_0x435ab2[_0x48fd65(0xf5)]},..._0x3fb58a!==undefined&&{'duration_sec':_0x3fb58a},..._0x435ab2['created_at']&&{'created_at':_0x435ab2[_0x48fd65(0xd4)]},..._0x435ab2[_0x48fd65(0x116)]&&{'started_at':_0x435ab2[_0x48fd65(0x116)]},..._0x435ab2[_0x48fd65(0x118)]&&{'end_at':_0x435ab2['end_at']},..._0x435ab2[_0x48fd65(0x100)]&&{'database':_0x435ab2[_0x48fd65(0x100)]},..._0x435ab2['priority']!==undefined&&{'priority':_0x435ab2['priority']},..._0x435ab2[_0x48fd65(0xf4)]&&{'url':_0x435ab2[_0x48fd65(0xf4)]},..._0x435ab2[_0x48fd65(0xe5)]&&{'query':_0x435ab2[_0x48fd65(0xe5)]},..._0x435ab2['debug']&&{'debug':_0x435ab2['debug']}};return await handleSingleObjectOutput(_0x5b39a8,_0x4d0eb6),0x0;}}export class JobKillCommand extends BaseCommand{[a30_0x82e7d7(0xc9)]='job:kill';[a30_0x82e7d7(0x109)]=a30_0x82e7d7(0xf1);[a30_0x82e7d7(0xc2)](_0x24008a){const _0xf2fc32=a30_0x82e7d7,_0x1caf80=_0x24008a[_0xf2fc32(0x105)][0x0];if(!_0x1caf80)return _0xf2fc32(0xeb);return undefined;}async[a30_0x82e7d7(0xef)](_0x2442b6){const _0x58d67c=a30_0x82e7d7,{options:_0x59e52b,args:_0x3314fe,tdx:_0x5256a6}=_0x2442b6,_0x2da7ec=_0x3314fe[0x0];if(!_0x59e52b[_0x58d67c(0xd5)]){const _0x21fbd4=await confirm(_0x58d67c(0xf9)+_0x2da7ec+'?');if(!_0x21fbd4)return console[_0x58d67c(0xe1)](_0x58d67c(0xe3)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x5256a6[_0x58d67c(0xd7)][_0x58d67c(0xc1)](_0x2da7ec),{'verbose':_0x59e52b[_0x58d67c(0xcf)]}),console[_0x58d67c(0xe1)](_0x58d67c(0xf6)+_0x2da7ec),console[_0x58d67c(0xe1)](_0x58d67c(0xf0)+_0x2da7ec+_0x58d67c(0x102)),0x0;}}function a30_0x454f(){const _0xe5fef7=['information_schema','10dygQpD','created_at','yes','limit','jobs','type','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','894719kCMfVC','List\x20jobs','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job:submit','Job\x20type:\x20','file','just\x20now','error','floor','Cancelled','length','query','list','success','red','Limit:\x20','529350AsKMiA','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','status','5GeTntF','\x20jobs','execute','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Kill\x20a\x20job','431409LQUgaY','Status\x20filter:\x20','url','user_name','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Query:\x20','dim','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Database:\x20','...','1070780uUnaSC','Getting\x20job\x20results...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Getting\x20job\x20details...','database','✔\x20Retrieved\x20','\x27\x20to\x20verify\x20the\x20job\x20status','✔\x20Job\x20submitted','trino','args','job:show','9667jtwFOe','Listing\x20jobs...','description','presto','map','log','Submitting\x20job...','job_id','2031404amloXf','getTime','push','green','Show\x20job\x20details','Get\x20job\x20results','4552gJCqkb','start_at','d\x20ago','end_at','round','kill','validate','INVALID_ARGUMENT','✔\x20Found\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','h\x20ago','Submit\x20a\x20job','show','name','mo\x20ago','10802637sVLgCG','\x20job','\x20\x20Job\x20ID:\x20','data','verbose','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','result'];a30_0x454f=function(){return _0xe5fef7;};return a30_0x454f();}export class JobSubmitCommand extends BaseCommand{['name']=a30_0x82e7d7(0xdd);['description']=a30_0x82e7d7(0xc7);async[a30_0x82e7d7(0xef)](_0x5e7492){const _0x59fe8d=a30_0x82e7d7,{options:_0x258d87,args:_0x1edf26,tdx:_0x353246}=_0x5e7492,_0x93ccb2=_0x258d87['jobType']||_0x59fe8d(0x104),_0x369bf6=_0x258d87[_0x59fe8d(0xdf)],_0xd8e241=_0x258d87[_0x59fe8d(0x100)]||_0x59fe8d(0xd2),_0x39b84e=_0x258d87[_0x59fe8d(0xd1)];if(_0x93ccb2!==_0x59fe8d(0x104)&&_0x93ccb2!=='hive')throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],_0x59fe8d(0xd0));let _0x5d5ef5;if(_0x369bf6){if(_0x1edf26[0x0])throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],_0x59fe8d(0xfe));const _0x8184aa=readSqlStatementsFromFile(_0x369bf6);if(_0x8184aa[_0x59fe8d(0xe4)]===0x0)throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x8184aa['length']>0x1)throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x5d5ef5=_0x8184aa[0x0];}else{if(!_0x1edf26[0x0])throw new SDKError(ErrorCode[_0x59fe8d(0xc3)],_0x59fe8d(0xdc));_0x5d5ef5=_0x1edf26[0x0];}_0x258d87[_0x59fe8d(0xcf)]&&(console['error'](_0x59fe8d(0xde)+_0x93ccb2),console[_0x59fe8d(0xe1)](_0x59fe8d(0xfa)+_0xd8e241),console[_0x59fe8d(0xe1)](_0x59fe8d(0xf7)+_0x5d5ef5['substring'](0x0,0x64)+(_0x5d5ef5[_0x59fe8d(0xe4)]>0x64?_0x59fe8d(0xfb):'')));const _0x109f15=await withSpinner(_0x59fe8d(0x10d),()=>_0x353246[_0x59fe8d(0xd7)]['submit'](_0xd8e241,_0x5d5ef5,_0x93ccb2,_0x39b84e),{'verbose':_0x258d87[_0x59fe8d(0xcf)]}),_0x4b7f35=_0x109f15[_0x59fe8d(0xce)];return console['error'](_0x59fe8d(0x103)),console[_0x59fe8d(0xe1)](_0x59fe8d(0xcd)+_0x4b7f35[_0x59fe8d(0x10e)]),await handleSDKOutput([_0x4b7f35],_0x258d87),0x0;}}export class JobResultCommand extends BaseCommand{[a30_0x82e7d7(0xc9)]='job:result';[a30_0x82e7d7(0x109)]=a30_0x82e7d7(0x114);[a30_0x82e7d7(0xc2)](_0x2cc83b){const _0x128956=a30_0x82e7d7,_0x24ff35=_0x2cc83b[_0x128956(0x105)][0x0];if(!_0x24ff35)return _0x128956(0xd9);return undefined;}async[a30_0x82e7d7(0xef)](_0x1583f6){const _0x91bd4f=a30_0x82e7d7,{options:_0x430606,args:_0x50d728,tdx:_0x1a7f14}=_0x1583f6,_0x541360=_0x50d728[0x0],_0x51aa39=await withSpinner(_0x91bd4f(0xfd),()=>_0x1a7f14[_0x91bd4f(0xd7)]['result'](_0x541360),{'verbose':_0x430606[_0x91bd4f(0xcf)]}),_0x330fd2=_0x51aa39[_0x91bd4f(0xce)];return console['error'](_0x91bd4f(0x101)+_0x330fd2['length']+'\x20row'+(_0x330fd2[_0x91bd4f(0xe4)]!==0x1?'s':'')),await handleSDKOutput(_0x330fd2,_0x430606),0x0;}}
|
|
1
|
+
const a31_0x345a99=a31_0x134a;(function(_0x362100,_0x4e59d){const _0x18a5b0=a31_0x134a,_0x1f11ee=_0x362100();while(!![]){try{const _0x33df14=-parseInt(_0x18a5b0(0x20f))/0x1+-parseInt(_0x18a5b0(0x236))/0x2+parseInt(_0x18a5b0(0x1f4))/0x3+-parseInt(_0x18a5b0(0x222))/0x4*(-parseInt(_0x18a5b0(0x206))/0x5)+parseInt(_0x18a5b0(0x215))/0x6+-parseInt(_0x18a5b0(0x1ec))/0x7+-parseInt(_0x18a5b0(0x204))/0x8;if(_0x33df14===_0x4e59d)break;else _0x1f11ee['push'](_0x1f11ee['shift']());}catch(_0xae5416){_0x1f11ee['push'](_0x1f11ee['shift']());}}}(a31_0x3df8,0x4c028));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a31_0x134a(_0x50fdd3,_0x486d9d){_0x50fdd3=_0x50fdd3-0x1e5;const _0x3df8d6=a31_0x3df8();let _0x134abe=_0x3df8d6[_0x50fdd3];return _0x134abe;}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 a31_0x1ae2ab from'chalk';function formatDuration(_0x13fbc0){const _0x3e8f9c=a31_0x134a;if(_0x13fbc0<0x3c)return _0x13fbc0+'s';if(_0x13fbc0<0xe10)return Math[_0x3e8f9c(0x22d)](_0x13fbc0/0x3c)+'m\x20'+_0x13fbc0%0x3c+'s';const _0x23427b=Math['floor'](_0x13fbc0/0xe10),_0x225a5d=Math[_0x3e8f9c(0x22d)](_0x13fbc0%0xe10/0x3c);return _0x225a5d>0x0?_0x23427b+'h\x20'+_0x225a5d+'m':_0x23427b+'h';}function formatRelativeTime(_0x4f779c){const _0x42cea3=a31_0x134a,_0x4a12e1=Date[_0x42cea3(0x1f9)]()-_0x4f779c[_0x42cea3(0x203)](),_0x114b95=Math[_0x42cea3(0x22d)](Math['abs'](_0x4a12e1)/0x3e8);if(_0x114b95<0x3c)return _0x42cea3(0x218);const _0x15ca5b=Math[_0x42cea3(0x22d)](_0x114b95/0x3c);if(_0x15ca5b<0x3c)return _0x15ca5b+_0x42cea3(0x1ff);const _0x3c4df0=Math[_0x42cea3(0x22d)](_0x15ca5b/0x3c);if(_0x3c4df0<0x18)return _0x3c4df0+_0x42cea3(0x1ef);const _0x44490e=Math[_0x42cea3(0x22d)](_0x3c4df0/0x18);if(_0x44490e<0x1e)return _0x44490e+_0x42cea3(0x229);return Math['floor'](_0x44490e/0x1e)+_0x42cea3(0x21b);}export class JobListCommand extends BaseCommand{[a31_0x345a99(0x1e7)]=a31_0x345a99(0x1f0);['description']=a31_0x345a99(0x1ee);async[a31_0x345a99(0x22c)](_0x179c2c){const _0x698f21=a31_0x345a99,{options:_0x1a0466,tdx:_0x406372}=_0x179c2c,_0x5e5db8=resolveLimit(_0x1a0466['limit'],DEFAULT_DISPLAY_LIMIT),_0x12258b=_0x1a0466[_0x698f21(0x1eb)];_0x1a0466[_0x698f21(0x214)]&&(console[_0x698f21(0x221)]('Limit:\x20'+_0x5e5db8+'\x20jobs'),_0x12258b&&console[_0x698f21(0x221)](_0x698f21(0x202)+_0x12258b));const _0x422590=await withSpinner(_0x698f21(0x22b),()=>_0x406372[_0x698f21(0x1f0)][_0x698f21(0x210)]({'from':0x0,'to':_0x5e5db8-0x1,'status':_0x12258b}),{'verbose':_0x1a0466[_0x698f21(0x214)]}),_0x4ee2eb=_0x422590[_0x698f21(0x1fd)];console[_0x698f21(0x221)]('✔\x20Found\x20'+_0x4ee2eb['length']+_0x698f21(0x211)+(_0x4ee2eb[_0x698f21(0x1e6)]!==0x1?'s':''));const _0x28e5ef=_0x1a0466[_0x698f21(0x1fe)];if(isStructuredFormat(_0x1a0466)){const _0x1f4742=_0x4ee2eb[_0x698f21(0x231)](_0x156a02=>{const _0x32fc7b=_0x698f21;let _0x431d40;if(_0x156a02['start_at']&&_0x156a02[_0x32fc7b(0x220)]){const _0x4016d3=new Date(_0x156a02[_0x32fc7b(0x1e8)])[_0x32fc7b(0x203)](),_0x63f030=new Date(_0x156a02[_0x32fc7b(0x220)])[_0x32fc7b(0x203)]();_0x431d40=Math[_0x32fc7b(0x22a)]((_0x63f030-_0x4016d3)/0x3e8);}return{'job_id':_0x156a02[_0x32fc7b(0x1e5)],'type':_0x156a02[_0x32fc7b(0x228)]===_0x32fc7b(0x1f6)?'trino':_0x156a02[_0x32fc7b(0x228)],'status':_0x156a02['status'],'user_name':_0x156a02[_0x32fc7b(0x21e)],'duration_sec':_0x431d40,'created_at':_0x156a02[_0x32fc7b(0x20c)],'started_at':_0x156a02['start_at'],'end_at':_0x156a02['end_at']};});await handleSDKOutput(_0x1f4742,_0x1a0466);}else for(const _0x2cd0e9 of _0x4ee2eb){const _0x202527=_0x2cd0e9['status']==='success'?a31_0x1ae2ab[_0x698f21(0x1e9)]:_0x2cd0e9[_0x698f21(0x1eb)]===_0x698f21(0x221)?a31_0x1ae2ab[_0x698f21(0x230)]:a31_0x1ae2ab['dim'],_0x407741=_0x202527(_0x2cd0e9[_0x698f21(0x1eb)]),_0x4e724a=getJobUrl(_0x28e5ef,_0x2cd0e9[_0x698f21(0x1e5)]),_0x266968=hyperlink(_0x2cd0e9[_0x698f21(0x1e5)],_0x4e724a),_0x190e0a=a31_0x1ae2ab[_0x698f21(0x209)](_0x2cd0e9[_0x698f21(0x228)]===_0x698f21(0x1f6)?'trino':_0x2cd0e9[_0x698f21(0x228)]),_0x1ab98f=[];if(_0x2cd0e9[_0x698f21(0x1e8)]&&_0x2cd0e9[_0x698f21(0x220)]){const _0xd68f02=Math['round']((new Date(_0x2cd0e9['end_at'])[_0x698f21(0x203)]()-new Date(_0x2cd0e9['start_at'])['getTime']())/0x3e8);_0x1ab98f[_0x698f21(0x1f2)](formatDuration(_0xd68f02));}if(_0x2cd0e9['end_at'])_0x1ab98f[_0x698f21(0x1f2)](formatRelativeTime(new Date(_0x2cd0e9[_0x698f21(0x220)])));else _0x2cd0e9[_0x698f21(0x1e8)]&&_0x1ab98f[_0x698f21(0x1f2)](formatRelativeTime(new Date(_0x2cd0e9[_0x698f21(0x1e8)])));const _0x1d2f2d=_0x1ab98f['length']>0x0?a31_0x1ae2ab[_0x698f21(0x209)]('\x20'+_0x1ab98f[_0x698f21(0x20e)](',\x20')):'';console['log']('⚡\x20'+_0x266968+'\x20'+_0x190e0a+'\x20'+_0x407741+_0x1d2f2d);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a31_0x345a99(0x1e7)]='job:show';[a31_0x345a99(0x208)]=a31_0x345a99(0x227);['validate'](_0xa26bc5){const _0x26d9c9=a31_0x345a99,_0x8e16a1=_0xa26bc5[_0x26d9c9(0x1f5)][0x0];if(!_0x8e16a1)return _0x26d9c9(0x1f8);return undefined;}async[a31_0x345a99(0x22c)](_0x28201a){const _0x4d5ccd=a31_0x345a99,{options:_0x504391,args:_0x14b3e6,tdx:_0x1cb7db}=_0x28201a,_0x1308c0=_0x14b3e6[0x0],_0x49bb36=await withSpinner(_0x4d5ccd(0x235),()=>_0x1cb7db[_0x4d5ccd(0x1f0)]['show'](_0x1308c0),{'verbose':_0x504391[_0x4d5ccd(0x214)]}),_0x5440be=_0x49bb36[_0x4d5ccd(0x1fd)];let _0x2b8415;if(_0x5440be[_0x4d5ccd(0x1e8)]&&_0x5440be[_0x4d5ccd(0x220)]){const _0x2721b8=new Date(_0x5440be['start_at'])[_0x4d5ccd(0x203)](),_0x283cd4=new Date(_0x5440be['end_at'])[_0x4d5ccd(0x203)]();_0x2b8415=Math[_0x4d5ccd(0x22a)]((_0x283cd4-_0x2721b8)/0x3e8);}const _0x2c5577={'job_id':_0x5440be[_0x4d5ccd(0x1e5)],'type':_0x5440be['type'],'status':_0x5440be[_0x4d5ccd(0x1eb)],..._0x5440be['user_name']&&{'user_name':_0x5440be[_0x4d5ccd(0x21e)]},..._0x2b8415!==undefined&&{'duration_sec':_0x2b8415},..._0x5440be['created_at']&&{'created_at':_0x5440be['created_at']},..._0x5440be[_0x4d5ccd(0x1e8)]&&{'started_at':_0x5440be[_0x4d5ccd(0x1e8)]},..._0x5440be[_0x4d5ccd(0x220)]&&{'end_at':_0x5440be['end_at']},..._0x5440be['database']&&{'database':_0x5440be[_0x4d5ccd(0x234)]},..._0x5440be['priority']!==undefined&&{'priority':_0x5440be[_0x4d5ccd(0x226)]},..._0x5440be[_0x4d5ccd(0x205)]&&{'url':_0x5440be['url']},..._0x5440be[_0x4d5ccd(0x1fc)]&&{'query':_0x5440be['query']},..._0x5440be[_0x4d5ccd(0x201)]&&{'debug':_0x5440be[_0x4d5ccd(0x201)]}};return await handleSingleObjectOutput(_0x2c5577,_0x504391),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a31_0x345a99(0x20b);[a31_0x345a99(0x208)]='Kill\x20a\x20job';['validate'](_0x3a70dd){const _0x1a7fd9=a31_0x345a99,_0x57065c=_0x3a70dd[_0x1a7fd9(0x1f5)][0x0];if(!_0x57065c)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a31_0x345a99(0x22c)](_0x7fb0cb){const _0x12dcec=a31_0x345a99,{options:_0x465dd0,args:_0x522470,tdx:_0xc0f3ee}=_0x7fb0cb,_0x35d346=_0x522470[0x0];if(!_0x465dd0['yes']){const _0x37a93d=await confirm(_0x12dcec(0x1fb)+_0x35d346+'?');if(!_0x37a93d)return console[_0x12dcec(0x221)]('Cancelled'),0x0;}return await withSpinner(_0x12dcec(0x225),()=>_0xc0f3ee[_0x12dcec(0x1f0)][_0x12dcec(0x1ed)](_0x35d346),{'verbose':_0x465dd0['verbose']}),console['error'](_0x12dcec(0x212)+_0x35d346),console[_0x12dcec(0x221)](_0x12dcec(0x207)+_0x35d346+_0x12dcec(0x219)),0x0;}}function a31_0x3df8(){const _0x11dcd4=['✔\x20Job\x20submitted','status','77917gpqARl','kill','List\x20jobs','h\x20ago','jobs','trino','push','validate','1558926NPeVeH','args','presto','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','now','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','query','data','site','m\x20ago','Get\x20job\x20results','debug','Status\x20filter:\x20','getTime','4825448XZKDXX','url','1820CYdKUt','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','description','dim','hive','job:kill','created_at','job:result','join','335415SPpjif','list','\x20job','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','substring','verbose','2475288nqnOTk','INVALID_ARGUMENT','file','just\x20now','\x27\x20to\x20verify\x20the\x20job\x20status','result','mo\x20ago','\x20\x20Job\x20ID:\x20','✔\x20Retrieved\x20','user_name','job:submit','end_at','error','5296glyMwX','No\x20SQL\x20statements\x20found\x20in\x20file','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submitting\x20kill\x20request...','priority','Show\x20job\x20details','type','d\x20ago','round','Listing\x20jobs...','execute','floor','Query:\x20','submit','red','map','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Database:\x20','database','Getting\x20job\x20details...','306126KLlYzp','job_id','length','name','start_at','green'];a31_0x3df8=function(){return _0x11dcd4;};return a31_0x3df8();}export class JobSubmitCommand extends BaseCommand{[a31_0x345a99(0x1e7)]=a31_0x345a99(0x21f);[a31_0x345a99(0x208)]='Submit\x20a\x20job';async[a31_0x345a99(0x22c)](_0x3020d){const _0x52d6f9=a31_0x345a99,{options:_0x231dee,args:_0x5e9e69,tdx:_0x4dd4ea}=_0x3020d,_0x17db6d=_0x231dee['jobType']||_0x52d6f9(0x1f1),_0x13cbc1=_0x231dee[_0x52d6f9(0x217)],_0x3512bb=_0x231dee[_0x52d6f9(0x234)]||'information_schema',_0x2ffe72=_0x231dee[_0x52d6f9(0x21a)];if(_0x17db6d!==_0x52d6f9(0x1f1)&&_0x17db6d!==_0x52d6f9(0x20a))throw new SDKError(ErrorCode[_0x52d6f9(0x216)],_0x52d6f9(0x1f7));let _0x567aa0;if(_0x13cbc1){if(_0x5e9e69[0x0])throw new SDKError(ErrorCode[_0x52d6f9(0x216)],_0x52d6f9(0x224));const _0x4861de=readSqlStatementsFromFile(_0x13cbc1);if(_0x4861de[_0x52d6f9(0x1e6)]===0x0)throw new SDKError(ErrorCode[_0x52d6f9(0x216)],_0x52d6f9(0x223));if(_0x4861de[_0x52d6f9(0x1e6)]>0x1)throw new SDKError(ErrorCode[_0x52d6f9(0x216)],_0x52d6f9(0x1fa));_0x567aa0=_0x4861de[0x0];}else{if(!_0x5e9e69[0x0])throw new SDKError(ErrorCode[_0x52d6f9(0x216)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x567aa0=_0x5e9e69[0x0];}_0x231dee[_0x52d6f9(0x214)]&&(console[_0x52d6f9(0x221)]('Job\x20type:\x20'+_0x17db6d),console[_0x52d6f9(0x221)](_0x52d6f9(0x233)+_0x3512bb),console['error'](_0x52d6f9(0x22e)+_0x567aa0[_0x52d6f9(0x213)](0x0,0x64)+(_0x567aa0[_0x52d6f9(0x1e6)]>0x64?'...':'')));const _0x1d080c=await withSpinner('Submitting\x20job...',()=>_0x4dd4ea['jobs'][_0x52d6f9(0x22f)](_0x3512bb,_0x567aa0,_0x17db6d,_0x2ffe72),{'verbose':_0x231dee[_0x52d6f9(0x214)]}),_0x1bc004=_0x1d080c[_0x52d6f9(0x1fd)];return console[_0x52d6f9(0x221)](_0x52d6f9(0x1ea)),console[_0x52d6f9(0x221)](_0x52d6f9(0x21c)+_0x1bc004[_0x52d6f9(0x1e5)]),await handleSDKOutput([_0x1bc004],_0x231dee),0x0;}}export class JobResultCommand extends BaseCommand{[a31_0x345a99(0x1e7)]=a31_0x345a99(0x20d);[a31_0x345a99(0x208)]=a31_0x345a99(0x200);[a31_0x345a99(0x1f3)](_0x4a2487){const _0x1cdd22=a31_0x345a99,_0x3d9675=_0x4a2487['args'][0x0];if(!_0x3d9675)return _0x1cdd22(0x232);return undefined;}async['execute'](_0x488f84){const _0x3c6b0d=a31_0x345a99,{options:_0x1c5092,args:_0x53d1cc,tdx:_0xca8e2b}=_0x488f84,_0x1eb0a6=_0x53d1cc[0x0],_0x1a9109=await withSpinner('Getting\x20job\x20results...',()=>_0xca8e2b[_0x3c6b0d(0x1f0)][_0x3c6b0d(0x21a)](_0x1eb0a6),{'verbose':_0x1c5092[_0x3c6b0d(0x214)]}),_0x43596b=_0x1a9109['data'];return console[_0x3c6b0d(0x221)](_0x3c6b0d(0x21d)+_0x43596b[_0x3c6b0d(0x1e6)]+'\x20row'+(_0x43596b[_0x3c6b0d(0x1e6)]!==0x1?'s':'')),await handleSDKOutput(_0x43596b,_0x1c5092),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x2594d4=a31_0x4301;function a31_0x3016(){const _0x25f540=['\x20(rule\x20match)','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','🗺️\x20','Listing\x20journey\x20activations...','/e/','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','completionRate','completed','Journey\x20name:\x20','journey','\x27\x20not\x20found\x20in\x20','resolveSegment','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x0aPull\x20summary:','Error:\x20Invalid\x20version\x20number:\x20','folderPath','📁\x20','\x0aError:','Fetching\x20','root\x20folder','resolveParentId','segments','INVALID_ARGUMENT','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','find','absolutePath','description','Available\x20stages:\x20','\x20details...','execute','setPhase','then','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','workflowId','options','Resolving\x20parent\x20segment...','getParentFull','workflowSessionId','Export\x20journey(s)\x20as\x20YAML\x20files','\x20Opening\x20','user','Warning:\x20Could\x20not\x20resolve\x20segment\x20','cyan','name','exitOrJumpSize','blue','\x20activation','journey:list','columns','\x20version','Show\x20journey\x20statistics','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Pause\x20a\x20running\x20journey','Found\x20','segmentPushCommand','goalSize','status','(paused)','\x5c$&','journey:pause','journey:traffic','draft','\x20@\x20','utf-8','⚠️\x20','conversion','no\x20connection','exitOrJumpRate','journeyStages','\x20files?','state','5014614bWfNUy','buildIdToNameMap','milestoneSize','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','args','List\x20all\x20versions\x20of\x20a\x20journey','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x22\x20paused','segmentName','Listing\x20journeys...','\x20\x20-\x20','journeyBundleName','getTrafficData','versionNumber','map','goal','getLatestJourneyId','resourceName','size','red','renderStats','Resolved\x20YAML\x20file:\x20','connection','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20','Target\x20directory:\x20','458989YEaSci','has','launched','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Input:\x20','(unnamed)','9DbyfcU','Target\x20file:\x20','Fetching\x20journey\x20','runAt','error','message','filter','run','Table:\x20','scheduleType','journeyName','/app/ps/','.journey.yml','\x20\x20Folder\x20path:\x20','audienceId','relativePath','limit','\x20journey','Parent\x20segment:\x20','✔\x20Context\x20set:\x20','dim','(running)','test','paused','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20=\x20','green','listVersions','✔\x20Found\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','session','Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','rule','16088570izoCkr','activation_','toLowerCase','getJourney','/j/da/je','4knxNPO','folderId','Listing\x20journey\x20versions...','pausedAt','Getting\x20journey\x20statistics...','listJourneysFromParentSegment','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Error:\x20Version\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Show\x20journey\x20details','11309160PtRGmY','add','diff','Error:\x20Stage\x20\x22','Triggering\x20journey\x20workflow...','Write\x20','\x22\x20resumed','journey:push','2cYifRU','journey:pull','journey:columns','site','join','Fetching\x20journeys\x20and\x20folders...','createdAt','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Resolving\x20journey...','segment','Journey:','log','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','-\x20no\x20files\x20written','enteredSize','journey:versions','sort','stage','Aborted.','(draft)','attributes','tdx.json','set','verbose','Error:\x20Parent\x20segment\x20context\x20required','updatedAt','resume','Stages:','/j/da','file','yes','connectionId','get','Show\x20journey\x20table\x20column\x20mapping','format','ID:','6848004pzywPU','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','dryRun','\x20\x20Preserving\x20local\x20segment\x20name:\x20','yellow','executeDryRun','getColumnMapping','connection\x20','content','Paused:','reentryMode','rootFolderId',',\x20schedule:\x20','cwd','(none)','\x20\x20Name:\x20','Getting\x20journey\x20traffic\x20data...','✔\x20Journey\x20\x22','entries','stages','getSegment','buildIdToEmailMap','\x20\x20←\x20','Fetching\x20users\x20and\x20connections...','kind','helpText','no_parent','Error:\x20Journey\x20not\x20found:\x20','push','\x20journeys','List\x20journeys\x20in\x20current\x20context','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','json','listJourneysWithFolders','parentName','hasChanges','includeHistory','data','stringify','Resume\x20a\x20paused\x20journey','version','folders','activation','journey:resume','all','\x20\x20Parent\x20segment:\x20','journey:stats','Resuming\x20journey...','\x20changed\x20files','length','base',',\x20version:\x20','parent_segment','Pausing\x20journey...','isNew','jsonl','journeyId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','localeCompare','Options:','links','journeyBundleId','State:','hasPeriod','parentSegment','Getting\x20journey\x20details...','type','\x20not\x20found.\x20Available:\x20','\x20versions)','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)','filePath','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','history','\x20\x20Journey\x20ID:\x20','\x0aChanges\x20to\x20\x27','2435120EdXvkP','createVersion','(root)','11lOeDva','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','(completed)','...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','listActivationsFlat','474eCzOXZ','\x20Created\x20v','pause','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','runAfterJourneyRefresh','\x20journey\x20files\x20to\x20','Error:\x20Journey\x20\x27','completeMilestoneRate','No\x20journeys\x20found','Activations:','database','✔\x20All\x20files\x20are\x20up\x20to\x20date','connector_config','none','journey:activations','\x20unchanged\x20files','Error:\x20--version\x20option\x20is\x20required','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','getStatistics','archived','table','bold','Cancelled','nodes','75929mpMOcg','values','split','from','repeat'];a31_0x3016=function(){return _0x25f540;};return a31_0x3016();}(function(_0x27cbdf,_0x365ffb){const _0x49c6f1=a31_0x4301,_0x1a2be2=_0x27cbdf();while(!![]){try{const _0x10fe4f=parseInt(_0x49c6f1(0x2bd))/0x1*(parseInt(_0x49c6f1(0x2fd))/0x2)+-parseInt(_0x49c6f1(0x2a3))/0x3*(parseInt(_0x49c6f1(0x2ea))/0x4)+parseInt(_0x49c6f1(0x236))/0x5+-parseInt(_0x49c6f1(0x23f))/0x6*(-parseInt(_0x49c6f1(0x257))/0x7)+parseInt(_0x49c6f1(0x2f5))/0x8*(-parseInt(_0x49c6f1(0x2c3))/0x9)+parseInt(_0x49c6f1(0x2e5))/0xa+parseInt(_0x49c6f1(0x239))/0xb*(parseInt(_0x49c6f1(0x1eb))/0xc);if(_0x10fe4f===_0x365ffb)break;else _0x1a2be2['push'](_0x1a2be2['shift']());}catch(_0x5c1ed9){_0x1a2be2['push'](_0x1a2be2['shift']());}}}(a31_0x3016,0xdb0f3));import a31_0xbf56a2 from'chalk';import a31_0x28469a 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,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function a31_0x4301(_0x4b3ea5,_0x229006){_0x4b3ea5=_0x4b3ea5-0x1d8;const _0x30161e=a31_0x3016();let _0x4301aa=_0x30161e[_0x4b3ea5];return _0x4301aa;}function requireNameOrPath(_0x2a37a0){const _0x128598=a31_0x4301;return!_0x2a37a0&&(console[_0x128598(0x2c7)](_0x128598(0x2db)),console['error']('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x2a37a0;}function withJsonFormat(_0x198d55){const _0xcac120=a31_0x4301;if(!_0x198d55[_0xcac120(0x1e9)]&&!_0x198d55['json']&&!_0x198d55[_0xcac120(0x222)]&&!_0x198d55['tsv'])return{..._0x198d55,'format':'json','json':!![]};return _0x198d55;}function formatJourneyState(_0x58e88b){const _0x1643d6=a31_0x4301;switch(_0x58e88b){case _0x1643d6(0x2bf):return a31_0xbf56a2[_0x1643d6(0x2dd)](_0x1643d6(0x2d8));case _0x1643d6(0x299):return a31_0xbf56a2[_0x1643d6(0x2d7)](_0x1643d6(0x1da));case'paused':return a31_0xbf56a2['yellow'](_0x1643d6(0x295));case _0x1643d6(0x263):return a31_0xbf56a2[_0x1643d6(0x289)](_0x1643d6(0x23b));case _0x1643d6(0x252):return a31_0xbf56a2[_0x1643d6(0x2d7)]('(archived)');default:return'('+_0x58e88b+')';}}function formatJourneyItem(_0x195779,_0x4c5936='',_0x2066d7){const _0x4e3091=a31_0x4301,_0x185fdf=formatJourneyState(_0x195779['state']),_0x6260d5=_0x2066d7?hyperlink(_0x195779['journeyBundleName'],_0x2066d7):_0x195779[_0x4e3091(0x2ae)];return _0x4c5936+_0x4e3091(0x25e)+_0x6260d5+'\x20'+_0x185fdf;}function escapeRegex(_0x48575e){const _0x15b59e=a31_0x4301;return _0x48575e['replace'](/[.*+?^${}()|[\]\\]/g,_0x15b59e(0x296));}function globToRegex(_0x397f3d){const _0x4184c0=a31_0x4301,_0x5b204b=_0x397f3d[_0x4184c0(0x259)]('*')[_0x4184c0(0x2b1)](escapeRegex);return new RegExp(_0x5b204b[_0x4184c0(0x301)]('.*'),'i');}function buildRuleToNameMapping(_0x4cb5ec){const _0x1d8a1c=a31_0x4301,_0x496478=new Map();if(_0x4cb5ec[_0x1d8a1c(0x271)])for(const [_0xd87c8,_0x5eb9fb]of Object[_0x1d8a1c(0x1fd)](_0x4cb5ec['segments'])){if(_0x5eb9fb[_0x1d8a1c(0x2e4)]){const _0x3e757c=serializeRule(_0x5eb9fb[_0x1d8a1c(0x2e4)]),_0x3f437b=_0x496478[_0x1d8a1c(0x1e7)](_0x3e757c);_0x3f437b?_0x3f437b[_0x1d8a1c(0x207)](_0xd87c8):_0x496478[_0x1d8a1c(0x1dd)](_0x3e757c,[_0xd87c8]);}}return _0x496478;}async function resolveJourneyIdFromInput(_0x33bf31,_0x230bb9,_0x351c29){const _0x2c3861=a31_0x4301,_0x481b1c=await resolveJourneyTarget(_0x33bf31,_0x230bb9['parentSegment'],_0x230bb9[_0x2c3861(0x1de)]),_0x317a97=_0x481b1c[_0x2c3861(0x22b)];if(!_0x317a97)throw new SDKError(ErrorCode[_0x2c3861(0x272)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x55d745=await withSpinner(_0x2c3861(0x27f),()=>_0x351c29['segment'][_0x2c3861(0x270)](_0x317a97),{'verbose':_0x230bb9[_0x2c3861(0x1de)]}),_0x5c546f=_0x55d745[_0x2c3861(0x210)],_0x185062=await withSpinner(_0x2c3861(0x305),()=>_0x351c29[_0x2c3861(0x265)]['resolveJourneyId'](_0x5c546f,_0x481b1c[_0x2c3861(0x2cd)]),{'verbose':_0x230bb9[_0x2c3861(0x1de)]});return{'journeyId':_0x185062[_0x2c3861(0x210)],'journeyName':_0x481b1c[_0x2c3861(0x2cd)],'parentSegmentId':_0x5c546f};}async function resolveJourneyTarget(_0x16e833,_0x21748e,_0x1a2e7b){const _0x212386=a31_0x4301;if(isYamlFilePath(_0x16e833))try{const _0x39383c=await resolveYamlFilePath(_0x16e833);return _0x1a2e7b&&(console[_0x212386(0x2c7)](_0x212386(0x2b8)+_0x16e833),console['error'](_0x212386(0x218)+_0x39383c['parentSegment']),console[_0x212386(0x2c7)](_0x212386(0x1fa)+_0x39383c[_0x212386(0x2ab)]),console[_0x212386(0x2c7)](_0x212386(0x2d0)+(_0x39383c[_0x212386(0x26b)]||_0x212386(0x238)))),{'journeyName':_0x39383c[_0x212386(0x2ab)],'parentSegment':_0x39383c[_0x212386(0x22b)],'resolved':_0x39383c};}catch(_0x5ed9a3){throw new SDKError(ErrorCode[_0x212386(0x272)],_0x212386(0x27c)+_0x5ed9a3[_0x212386(0x2c8)]);}if(!_0x21748e)throw new SDKError(ErrorCode[_0x212386(0x272)],_0x212386(0x2c0));return{'journeyName':_0x16e833,'parentSegment':_0x21748e};}export class JourneyListCommand extends BaseCommand{['name']=a31_0x2594d4(0x28b);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x209);async[a31_0x2594d4(0x279)](_0x12a9e6){const _0x449138=a31_0x2594d4,{options:_0x24afa2,args:_0x435c1b,tdx:_0x3b2afa}=_0x12a9e6,_0x7ffe3e=_0x435c1b[0x0],_0xd5a9b4=_0x24afa2[_0x449138(0x22b)];if(!_0xd5a9b4)return console[_0x449138(0x2c7)](_0x449138(0x1df)),console[_0x449138(0x2c7)](_0x449138(0x250)),0x1;const _0x1d03a3=await withSpinner(_0x449138(0x27f),()=>_0x3b2afa[_0x449138(0x306)][_0x449138(0x270)](_0xd5a9b4),{'verbose':_0x24afa2[_0x449138(0x1de)]}),_0x4a3739=_0x1d03a3['data'];_0x24afa2['verbose']&&(console[_0x449138(0x2c7)](_0x449138(0x2d5)+_0xd5a9b4+'\x20(ID:\x20'+_0x4a3739+')'),_0x7ffe3e&&console[_0x449138(0x2c7)]('Pattern:\x20'+_0x7ffe3e));const _0x4a81d3=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x3b2afa['segment'][_0x449138(0x280)](_0x4a3739),{'verbose':_0x24afa2['verbose']}),_0x287b03=_0x4a81d3[_0x449138(0x210)],_0x194308=_0x287b03[_0x449138(0x1f6)],_0x3bcbca=await withSpinner(_0x449138(0x2ac),()=>_0x3b2afa['journey'][_0x449138(0x20c)](_0x4a3739,_0x194308),{'verbose':_0x24afa2[_0x449138(0x1de)]});let _0x1de31c=_0x3bcbca['data']['journeys'];const _0x470793=_0x3bcbca['data'][_0x449138(0x214)],_0x3c9dd0=new Map();for(const _0x49b097 of _0x470793){_0x3c9dd0['set'](_0x49b097['id'],_0x49b097[_0x449138(0x287)]);}if(_0x7ffe3e){const _0x3010b6=globToRegex(_0x7ffe3e);_0x1de31c=_0x1de31c[_0x449138(0x2c9)](_0xdde874=>_0x3010b6[_0x449138(0x2d9)](_0xdde874[_0x449138(0x2ae)]));}console[_0x449138(0x2c7)](_0x449138(0x2df)+_0x1de31c[_0x449138(0x21c)]+_0x449138(0x2d4)+(_0x1de31c[_0x449138(0x21c)]!==0x1?'s':''));const _0x2f5baf=_0x4e415e=>{const _0x19dd09=_0x449138;return getConsoleNextUrl(_0x24afa2[_0x19dd09(0x300)],'/app/ps/'+_0x4a3739+'/e/'+_0x4e415e+_0x19dd09(0x1e3));};if(_0x24afa2['format']===_0x449138(0x253))await handleSDKOutput(_0x1de31c,_0x24afa2);else{if(_0x24afa2[_0x449138(0x1e9)]==='json'){const _0x5d942f=_0x1de31c['map'](_0x132eda=>({..._0x132eda,'url':_0x2f5baf(_0x132eda['id'])}));await handleSDKOutput(_0x5d942f,_0x24afa2);}else{console['log']('['+_0xd5a9b4+']');const _0x3b04ba=new Map(),_0x459cbc=[];for(const _0x140702 of _0x1de31c){if(!_0x140702[_0x449138(0x2eb)]||_0x140702[_0x449138(0x2eb)]===_0x194308)_0x459cbc['push'](_0x140702);else{const _0x1fbfa7=_0x3b04ba[_0x449138(0x1e7)](_0x140702[_0x449138(0x2eb)])||[];_0x1fbfa7[_0x449138(0x207)](_0x140702),_0x3b04ba[_0x449138(0x1dd)](_0x140702[_0x449138(0x2eb)],_0x1fbfa7);}}const _0xe6f00a=(_0x3799a4,_0x5039a2)=>_0x3799a4['journeyBundleName'][_0x449138(0x225)](_0x5039a2[_0x449138(0x2ae)],undefined,{'sensitivity':'base'});_0x459cbc[_0x449138(0x30d)](_0xe6f00a);for(const _0x1eff76 of _0x459cbc){console['log'](formatJourneyItem(_0x1eff76,'',_0x2f5baf(_0x1eff76['id'])));}const _0x15d3e2=[..._0x3b04ba['entries']()][_0x449138(0x30d)]((_0x23d6a4,_0x57bfc1)=>{const _0x126f58=_0x449138,_0x54ba12=_0x3c9dd0[_0x126f58(0x1e7)](_0x23d6a4[0x0])||_0x23d6a4[0x0],_0x486752=_0x3c9dd0['get'](_0x57bfc1[0x0])||_0x57bfc1[0x0];return _0x54ba12['localeCompare'](_0x486752,undefined,{'sensitivity':_0x126f58(0x21d)});});for(const [_0x53a941,_0x4178dd]of _0x15d3e2){const _0x4ad47e=_0x3c9dd0['get'](_0x53a941)||_0x53a941;console['log'](_0x449138(0x26c)+_0x4ad47e),_0x4178dd[_0x449138(0x30d)](_0xe6f00a);for(const _0x3ad692 of _0x4178dd){console[_0x449138(0x308)](formatJourneyItem(_0x3ad692,'\x20\x20',_0x2f5baf(_0x3ad692['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a31_0x2594d4(0x276)]=a31_0x2594d4(0x2f4);async[a31_0x2594d4(0x279)](_0x251069){const _0x198b27=a31_0x2594d4,{options:_0x28de68,args:_0x6375bb,tdx:_0x26f7dc}=_0x251069,_0x25061d=_0x6375bb[0x0];if(!_0x25061d)return console[_0x198b27(0x2c7)](_0x198b27(0x2db)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x198b27(0x2c7)](_0x198b27(0x226)),console['error'](_0x198b27(0x20a)),0x1;_0x28de68[_0x198b27(0x1de)]&&console[_0x198b27(0x2c7)](_0x198b27(0x2c1)+_0x25061d);const {journeyId:_0x2b7f79,parentSegmentId:_0x360f9a}=await resolveJourneyIdFromInput(_0x25061d,_0x28de68,_0x26f7dc);if(_0x28de68['web']){const _0x3235a2=getConsoleNextUrl(_0x28de68[_0x198b27(0x300)],_0x198b27(0x2ce)+_0x360f9a+'/e/'+_0x2b7f79+_0x198b27(0x2e9));return console['error'](a31_0xbf56a2['green']('✔')+_0x198b27(0x283)+a31_0xbf56a2[_0x198b27(0x286)](_0x3235a2)),openBrowser(_0x3235a2),0x0;}const _0x2b9ebc=await withSpinner(_0x198b27(0x22c),()=>_0x26f7dc[_0x198b27(0x265)]['getJourney'](_0x2b7f79),{'verbose':_0x28de68[_0x198b27(0x1de)]}),_0xf45ce3=_0x2b9ebc['data'],_0xffc753=_0x28de68['includeStats'];let _0x3fc6bd;if(_0xffc753)try{const _0x2a5aee=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x26f7dc[_0x198b27(0x265)]['getStatistics'](_0x2b7f79),{'verbose':_0x28de68['verbose']});_0x3fc6bd=_0x2a5aee[_0x198b27(0x210)];}catch{_0x28de68[_0x198b27(0x1de)]&&console[_0x198b27(0x2c7)]('\x20\x20Statistics\x20not\x20available');}const _0x2b23de=getConsoleNextUrl(_0x28de68[_0x198b27(0x300)],_0x198b27(0x2ce)+_0x360f9a+_0x198b27(0x260)+_0x2b7f79+_0x198b27(0x2e9)),_0x5ce28d={'id':_0xf45ce3['id'],'name':_0xf45ce3['attributes'][_0x198b27(0x287)],'description':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x276)],'state':_0xf45ce3['attributes']['state'],'paused':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x2da)],'reentry_mode':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x1f5)],'stages':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x2a0)]?.[_0x198b27(0x21c)]||0x0,..._0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x2b2)]&&{'goal':_0xf45ce3[_0x198b27(0x1db)][_0x198b27(0x2b2)]['name']},..._0x3fc6bd&&{'statistics':{'size':_0x3fc6bd['size'],'entered':_0x3fc6bd['enteredSize'],'goal_achieved':_0x3fc6bd[_0x198b27(0x293)],'completion_rate':_0x3fc6bd[_0x198b27(0x262)],'exit_or_jump':_0x3fc6bd[_0x198b27(0x288)],'exit_or_jump_rate':_0x3fc6bd[_0x198b27(0x29f)],'stages':_0x3fc6bd[_0x198b27(0x1fe)]}},'url':_0x2b23de};return await handleSingleObjectOutput(_0x5ce28d,_0x28de68),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x219);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x28e);async['execute'](_0x3c3279){const _0x102b9a=a31_0x2594d4,{options:_0x3c3080,args:_0x4c4ece,tdx:_0xd73c89}=_0x3c3279,_0x174c48=_0x4c4ece[0x0];if(!requireNameOrPath(_0x174c48))return 0x1;_0x3c3080[_0x102b9a(0x1de)]&&console['error']('Input:\x20'+_0x174c48);const _0x3c201e=_0x3c3080,_0x4115ec=_0x3c201e['from'],_0x19266b=_0x3c201e['to'],_0x1f0544=_0x3c201e[_0x102b9a(0x20f)],_0x3bec03=_0x3c201e[_0x102b9a(0x1d8)];_0x1f0544&&!_0x4115ec&&!_0x19266b&&console[_0x102b9a(0x2c7)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x3d5a92=_0x1f0544?withJsonFormat(_0x3c3080):_0x3c3080,{journeyId:_0x3a269e,journeyName:_0x15ca3c}=await resolveJourneyIdFromInput(_0x174c48,_0x3d5a92,_0xd73c89),_0x43962f=_0x4115ec||_0x19266b?{'from':_0x4115ec,'to':_0x19266b}:undefined,_0x5dcf5a=await withSpinner(_0x102b9a(0x2ee),()=>Promise[_0x102b9a(0x217)]([_0xd73c89[_0x102b9a(0x265)]['getJourney'](_0x3a269e),_0xd73c89['journey'][_0x102b9a(0x251)](_0x3a269e,_0x43962f)]),{'verbose':_0x3d5a92['verbose']}),[_0x5e83a4,_0x1018c4]=_0x5dcf5a[_0x102b9a(0x210)];if(!_0x1018c4||_0x1018c4['journeyId']===null)return console[_0x102b9a(0x2c7)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x15ca3c),console[_0x102b9a(0x2c7)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x5b7c0d=buildStageNameMap(_0x5e83a4),_0xc8ae7b=!!(_0x43962f&&_0x1018c4['history']?.[_0x102b9a(0x21c)]),_0x593dbd={'stageNameMap':_0x5b7c0d,'hasPeriod':_0xc8ae7b,'includeHistory':!!_0x1f0544};if(_0x3bec03&&_0x1018c4[_0x102b9a(0x1fe)]){const _0x4fefc5=_0x1018c4[_0x102b9a(0x1fe)][_0x102b9a(0x274)](_0x2e3495=>{const _0x112af6=_0x5b7c0d['get'](_0x2e3495['id'])??'';return _0x112af6['toLowerCase']()===_0x3bec03['toLowerCase']();});if(_0x4fefc5)return await handleSingleObjectOutput(formatStageStats(_0x4fefc5,_0x593dbd),_0x3d5a92),0x0;const _0xfbca7b=_0x1018c4[_0x102b9a(0x1fe)][_0x102b9a(0x2b1)](_0x382d94=>_0x5b7c0d[_0x102b9a(0x1e7)](_0x382d94['id'])??_0x382d94['id']);return console[_0x102b9a(0x2c7)](_0x102b9a(0x2f8)+_0x3bec03+'\x22\x20not\x20found'),console[_0x102b9a(0x2c7)](_0x102b9a(0x277)+_0xfbca7b[_0x102b9a(0x301)](',\x20')),0x1;}const _0x55d051=_0x1018c4[_0x102b9a(0x1fe)]?.[_0x102b9a(0x2b1)](_0x36eb90=>formatStageStats(_0x36eb90,_0x593dbd)),_0x4e826d=assembleJourneyStats(_0x1018c4,{'from':_0x4115ec,'to':_0x19266b,'includeHistory':_0x1f0544});return await this[_0x102b9a(0x2b7)](_0x4e826d,_0x55d051??[],_0x3d5a92),0x0;}async['renderStats'](_0x46d715,_0xabe0dc,_0x7de9c8){const _0x5ddab9=a31_0x2594d4,_0x1f3281=_0x7de9c8[_0x5ddab9(0x1e9)]===_0x5ddab9(0x20b)||_0x7de9c8[_0x5ddab9(0x1e9)]==='jsonl'||_0x7de9c8[_0x5ddab9(0x20b)]||_0x7de9c8[_0x5ddab9(0x222)];if(_0x1f3281){_0x46d715['stages']=_0xabe0dc,await handleSingleObjectOutput(_0x46d715,_0x7de9c8);return;}await handleSingleObjectOutput(_0x46d715,_0x7de9c8);for(const _0x48f3c4 of _0xabe0dc){console['log'](''),console[_0x5ddab9(0x308)](String(a31_0xbf56a2[_0x5ddab9(0x286)]['bold']('['+_0x48f3c4['name']+']'))+a31_0xbf56a2[_0x5ddab9(0x2d7)]('\x20'+_0x48f3c4['id']));const {id:_0x4404f1,name:_0x3111cd,..._0x6c8625}=_0x48f3c4;await handleSingleObjectOutput(_0x6c8625,_0x7de9c8);}}}export class JourneyTrafficCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x298);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x273);async[a31_0x2594d4(0x279)](_0x5d67f1){const _0x41bd4f=a31_0x2594d4,{options:_0x111d20,args:_0x2ca0a1,tdx:_0x33c29c}=_0x5d67f1,_0x1905b3=_0x2ca0a1[0x0];if(!requireNameOrPath(_0x1905b3))return 0x1;_0x111d20['verbose']&&console['error'](_0x41bd4f(0x2c1)+_0x1905b3);const _0x546d24=_0x111d20,_0x18253d=_0x546d24[_0x41bd4f(0x22d)],_0x5d0fcb=_0x546d24[_0x41bd4f(0x25a)],_0x472a59=_0x546d24['to'],_0x33746d=_0x546d24[_0x41bd4f(0x2d3)];if(_0x18253d&&_0x18253d!==_0x41bd4f(0x29d)&&_0x18253d!==_0x41bd4f(0x215))return console[_0x41bd4f(0x2c7)]('Error:\x20Invalid\x20--type\x20\x22'+_0x18253d+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x21d313=withJsonFormat(_0x111d20),{journeyId:_0x4d73cb,journeyName:_0x3f2268}=await resolveJourneyIdFromInput(_0x1905b3,_0x21d313,_0x33c29c),_0x9e779b={'type':_0x18253d,'from':_0x5d0fcb,'to':_0x472a59,'limit':_0x33746d},_0x11ce8a=await withSpinner(_0x41bd4f(0x1fb),()=>_0x33c29c[_0x41bd4f(0x265)][_0x41bd4f(0x2af)](_0x4d73cb,_0x9e779b),{'verbose':_0x21d313[_0x41bd4f(0x1de)]}),_0x4d73f8=_0x11ce8a[_0x41bd4f(0x210)],_0x555eb2=_0x4d73f8[_0x41bd4f(0x29d)]&&(_0x4d73f8[_0x41bd4f(0x29d)][_0x41bd4f(0x256)][_0x41bd4f(0x21c)]>0x0||_0x4d73f8[_0x41bd4f(0x29d)][_0x41bd4f(0x227)][_0x41bd4f(0x21c)]>0x0),_0x4e8666=_0x4d73f8['activation']&&_0x4d73f8['activation'][_0x41bd4f(0x21c)]>0x0;if(!_0x555eb2&&!_0x4e8666)return console[_0x41bd4f(0x2c7)](_0x41bd4f(0x261)+_0x3f2268),console[_0x41bd4f(0x2c7)](_0x41bd4f(0x23a)),_0x5d0fcb&&_0x472a59&&console[_0x41bd4f(0x2c7)]('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(_0x4d73f8,_0x21d313),0x0;}}function formatStageStats(_0x4c62b3,_0x3db407){const _0x1b0f2a=a31_0x2594d4,_0x2a255c=_0x3db407[_0x1b0f2a(0x22a)]&&_0x4c62b3[_0x1b0f2a(0x233)]?.[_0x1b0f2a(0x21c)]?aggregateStageHistory(_0x4c62b3[_0x1b0f2a(0x233)]):{'size':_0x4c62b3[_0x1b0f2a(0x2b5)],'entered':_0x4c62b3[_0x1b0f2a(0x30b)],'milestone':_0x4c62b3[_0x1b0f2a(0x2a5)],'milestone_rate':_0x4c62b3[_0x1b0f2a(0x246)],'exit_or_jump':_0x4c62b3['exitOrJumpSize'],'exit_or_jump_rate':_0x4c62b3[_0x1b0f2a(0x29f)]},_0x21e674={'id':_0x4c62b3['id'],'name':_0x3db407['stageNameMap'][_0x1b0f2a(0x1e7)](_0x4c62b3['id'])??_0x4c62b3['id'],..._0x2a255c};return _0x3db407[_0x1b0f2a(0x22a)]&&_0x3db407['includeHistory']&&_0x4c62b3['history']&&(_0x21e674[_0x1b0f2a(0x233)]=_0x4c62b3['history']),_0x21e674;}export class JourneyPauseCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x297);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x290);async[a31_0x2594d4(0x279)](_0x1ae706){const _0x1054cb=a31_0x2594d4,{options:_0x18e3b1,args:_0x50dbf1,tdx:_0x4145c3}=_0x1ae706,_0x52cdcf=_0x50dbf1[0x0];if(!requireNameOrPath(_0x52cdcf))return 0x1;_0x18e3b1[_0x1054cb(0x1de)]&&console[_0x1054cb(0x2c7)](_0x1054cb(0x2c1)+_0x52cdcf);const {journeyId:_0xe05ba9,journeyName:_0x453a2a}=await resolveJourneyIdFromInput(_0x52cdcf,_0x18e3b1,_0x4145c3);if(!_0x18e3b1[_0x1054cb(0x1e5)]){const _0x40eeec=await confirm(_0x1054cb(0x2f1)+_0x453a2a+'\x22?');if(!_0x40eeec)return console['error']('Cancelled'),0x0;}const _0x5a1e54=await withSpinner(_0x1054cb(0x220),()=>_0x4145c3[_0x1054cb(0x265)][_0x1054cb(0x241)](_0xe05ba9),{'verbose':_0x18e3b1[_0x1054cb(0x1de)]}),_0x371fb6=_0x5a1e54[_0x1054cb(0x210)];return console[_0x1054cb(0x2c7)]('✔\x20Journey\x20\x22'+_0x371fb6[_0x1054cb(0x1db)]['name']+_0x1054cb(0x2aa)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a31_0x2594d4(0x287)]='journey:run';['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a31_0x2594d4(0x279)](_0x59d950){const _0x5cb6ee=a31_0x2594d4,{options:_0x8e7183,args:_0x1dd963,tdx:_0xe6a8b4}=_0x59d950,_0x2bcb7a=_0x1dd963[0x0];if(!requireNameOrPath(_0x2bcb7a))return 0x1;_0x8e7183['verbose']&&console[_0x5cb6ee(0x2c7)](_0x5cb6ee(0x2c1)+_0x2bcb7a);const {journeyId:_0x4d6791,journeyName:_0x514d8e}=await resolveJourneyIdFromInput(_0x2bcb7a,_0x8e7183,_0xe6a8b4);if(_0x8e7183['dryRun'])return await this[_0x5cb6ee(0x1f0)](_0x59d950,_0x4d6791,_0x514d8e);if(!_0x8e7183['yes']){const _0x2c0c03=await confirm(_0x5cb6ee(0x25d)+_0x514d8e+'\x22?');if(!_0x2c0c03)return console[_0x5cb6ee(0x2c7)](_0x5cb6ee(0x255)),0x0;}const _0x204775=await withSpinner(_0x5cb6ee(0x2f9),()=>_0xe6a8b4[_0x5cb6ee(0x265)][_0x5cb6ee(0x2ca)](_0x4d6791),{'verbose':_0x8e7183[_0x5cb6ee(0x1de)]}),_0x2a5407=_0x204775[_0x5cb6ee(0x210)],_0x37f41d=getWorkflowSessionUrl(_0x8e7183[_0x5cb6ee(0x300)],_0x2a5407[_0x5cb6ee(0x27d)],_0x2a5407[_0x5cb6ee(0x281)]);return console[_0x5cb6ee(0x2c7)]('\x0a'+a31_0xbf56a2[_0x5cb6ee(0x2dd)]('✔')+'\x20Journey\x20workflow\x20started'),console[_0x5cb6ee(0x2c7)]('\x20\x20'+a31_0xbf56a2[_0x5cb6ee(0x2d7)](_0x5cb6ee(0x307))+'\x20'+_0x514d8e),console['error']('\x20\x20'+a31_0xbf56a2[_0x5cb6ee(0x2d7)]('Status:')+'\x20'+_0x2a5407[_0x5cb6ee(0x294)]),console[_0x5cb6ee(0x2c7)]('\x20\x20'+a31_0xbf56a2[_0x5cb6ee(0x2d7)]('Session:')+'\x20'+_0x2a5407[_0x5cb6ee(0x281)]),console[_0x5cb6ee(0x2c7)]('\x20\x20'+_0x37f41d),0x0;}async['executeDryRun'](_0x440a74,_0x196445,_0x4bf367){const _0x28a5f6=a31_0x2594d4,{options:_0x111c63,tdx:_0x38ccca}=_0x440a74,_0x2fbb22=await withSpinner(_0x28a5f6(0x2c5)+_0x4bf367+_0x28a5f6(0x23c),()=>Promise[_0x28a5f6(0x217)]([_0x38ccca['journey'][_0x28a5f6(0x2e8)](_0x196445),_0x38ccca[_0x28a5f6(0x265)][_0x28a5f6(0x23e)](_0x196445)]),{'verbose':_0x111c63['verbose']}),[_0x3eddd9,_0x352df1]=_0x2fbb22[_0x28a5f6(0x210)],_0x5403e9=_0x3eddd9[_0x28a5f6(0x1db)],_0x2d4836=_0x5403e9[_0x28a5f6(0x2a0)];console['log'](a31_0xbf56a2[_0x28a5f6(0x254)]('Journey:'),_0x5403e9[_0x28a5f6(0x287)]),console[_0x28a5f6(0x308)](a31_0xbf56a2[_0x28a5f6(0x254)](_0x28a5f6(0x1ea)),_0x3eddd9['id']),console[_0x28a5f6(0x308)](a31_0xbf56a2[_0x28a5f6(0x254)](_0x28a5f6(0x229)),_0x5403e9['state']),console[_0x28a5f6(0x308)](a31_0xbf56a2['bold'](_0x28a5f6(0x1f4)),_0x5403e9[_0x28a5f6(0x2da)]?a31_0xbf56a2[_0x28a5f6(0x1ef)]('yes'):a31_0xbf56a2[_0x28a5f6(0x2dd)]('no')),console[_0x28a5f6(0x308)](a31_0xbf56a2['bold']('Parent\x20segment\x20ID:'),_0x5403e9[_0x28a5f6(0x2d1)]);const _0x588e9c=_0x2d4836[_0x28a5f6(0x21c)]>0x0?'\x20('+_0x2d4836[_0x28a5f6(0x2b1)](_0x506c28=>_0x506c28[_0x28a5f6(0x287)])[_0x28a5f6(0x301)](',\x20')+')':'';console[_0x28a5f6(0x308)](a31_0xbf56a2[_0x28a5f6(0x254)]('Stages:'),''+_0x2d4836[_0x28a5f6(0x21c)]+_0x588e9c),console[_0x28a5f6(0x308)]('');if(_0x352df1[_0x28a5f6(0x21c)]===0x0)console[_0x28a5f6(0x308)](a31_0xbf56a2[_0x28a5f6(0x254)](_0x28a5f6(0x248)),a31_0xbf56a2[_0x28a5f6(0x2d7)](_0x28a5f6(0x1f9)));else{console['log'](a31_0xbf56a2[_0x28a5f6(0x254)]('Activations:'));for(const _0x2a6a5d of _0x352df1){const _0x5e6b11=_0x2a6a5d[_0x28a5f6(0x287)]??'(unnamed)',_0x4909d0=_0x2a6a5d['connectionId']!=null?'connection\x20'+_0x2a6a5d['connectionId']:_0x28a5f6(0x29e),_0x3cd51b=_0x2a6a5d[_0x28a5f6(0x2cc)]?''+_0x2a6a5d[_0x28a5f6(0x2cc)]+(_0x2a6a5d[_0x28a5f6(0x2c6)]?_0x28a5f6(0x29a)+_0x2a6a5d[_0x28a5f6(0x2c6)]:''):'none',_0x5bb212=_0x2a6a5d[_0x28a5f6(0x243)]?'\x20[runs\x20on\x20refresh]':'';console[_0x28a5f6(0x308)]('\x20\x20'+a31_0xbf56a2[_0x28a5f6(0x1ef)](_0x28a5f6(0x29c))+'\x20'+_0x5e6b11+_0x28a5f6(0x201)+_0x4909d0+_0x28a5f6(0x1f7)+_0x3cd51b+_0x5bb212);}}return console['log'](a31_0xbf56a2[_0x28a5f6(0x1ef)](_0x28a5f6(0x1ec))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x216);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x212);async['execute'](_0x494365){const _0x4827e9=a31_0x2594d4,{options:_0x4f1ecb,args:_0x22dfe9,tdx:_0x32eb22}=_0x494365,_0x58575d=_0x22dfe9[0x0];if(!requireNameOrPath(_0x58575d))return 0x1;_0x4f1ecb[_0x4827e9(0x1de)]&&console['error'](_0x4827e9(0x2c1)+_0x58575d);const {journeyId:_0x53001d,journeyName:_0x24b654}=await resolveJourneyIdFromInput(_0x58575d,_0x4f1ecb,_0x32eb22);if(_0x4f1ecb[_0x4827e9(0x1ed)])return await this[_0x4827e9(0x1f0)](_0x494365,_0x53001d,_0x24b654);if(!_0x4f1ecb[_0x4827e9(0x1e5)]){const _0x3bf777=await confirm(_0x4827e9(0x28f)+_0x24b654+'\x22?');if(!_0x3bf777)return console[_0x4827e9(0x2c7)](_0x4827e9(0x255)),0x0;}const _0x462060=await withSpinner(_0x4827e9(0x21a),()=>_0x32eb22['journey'][_0x4827e9(0x1e1)](_0x53001d),{'verbose':_0x4f1ecb[_0x4827e9(0x1de)]}),_0x9f8a4e=_0x462060[_0x4827e9(0x210)];return console[_0x4827e9(0x2c7)](_0x4827e9(0x1fc)+_0x9f8a4e[_0x4827e9(0x1db)]['name']+_0x4827e9(0x2fb)),0x0;}async[a31_0x2594d4(0x1f0)](_0x4c5a90,_0x3b835e,_0x16a63f){const _0x21194e=a31_0x2594d4,{options:_0xb037b1,tdx:_0x520a3f}=_0x4c5a90,_0x36559d=await withSpinner(_0x21194e(0x2c5)+_0x16a63f+_0x21194e(0x23c),()=>Promise['all']([_0x520a3f['journey'][_0x21194e(0x2e8)](_0x3b835e),_0x520a3f[_0x21194e(0x265)][_0x21194e(0x23e)](_0x3b835e)]),{'verbose':_0xb037b1[_0x21194e(0x1de)]}),[_0x204285,_0x2bb4f3]=_0x36559d[_0x21194e(0x210)],_0x45318c=_0x204285[_0x21194e(0x1db)],_0x263348=_0x45318c[_0x21194e(0x2a0)];console['log'](a31_0xbf56a2[_0x21194e(0x254)]('Journey:'),_0x45318c['name']),console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x1ea)),_0x204285['id']),console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x229)),_0x45318c[_0x21194e(0x2a2)]),console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x1f4)),_0x45318c[_0x21194e(0x2da)]?a31_0xbf56a2['yellow'](_0x21194e(0x1e5)):a31_0xbf56a2[_0x21194e(0x2dd)]('no'));_0x45318c['pausedAt']&&console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)]('Paused\x20at:'),_0x45318c[_0x21194e(0x2ed)]);console[_0x21194e(0x308)](a31_0xbf56a2['bold']('Parent\x20segment\x20ID:'),_0x45318c['audienceId']);const _0x3cabe4=_0x263348[_0x21194e(0x21c)]>0x0?'\x20('+_0x263348[_0x21194e(0x2b1)](_0x508ae7=>_0x508ae7[_0x21194e(0x287)])[_0x21194e(0x301)](',\x20')+')':'';console[_0x21194e(0x308)](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x1e2)),''+_0x263348[_0x21194e(0x21c)]+_0x3cabe4),console[_0x21194e(0x308)]('');if(_0x2bb4f3[_0x21194e(0x21c)]===0x0)console['log'](a31_0xbf56a2[_0x21194e(0x254)](_0x21194e(0x248)),a31_0xbf56a2[_0x21194e(0x2d7)](_0x21194e(0x1f9)));else{console['log'](a31_0xbf56a2['bold'](_0x21194e(0x248)));for(const _0x53d1c8 of _0x2bb4f3){const _0x2ec58c=_0x53d1c8[_0x21194e(0x287)]??_0x21194e(0x2c2),_0x41094b=_0x53d1c8['connectionId']!=null?_0x21194e(0x1f2)+_0x53d1c8[_0x21194e(0x1e6)]:_0x21194e(0x29e),_0x5b1801=_0x53d1c8[_0x21194e(0x2cc)]?''+_0x53d1c8[_0x21194e(0x2cc)]+(_0x53d1c8[_0x21194e(0x2c6)]?'\x20@\x20'+_0x53d1c8[_0x21194e(0x2c6)]:''):_0x21194e(0x24c),_0x3a707b=_0x53d1c8[_0x21194e(0x243)]?'\x20[runs\x20on\x20refresh]':'';console['log']('\x20\x20'+a31_0xbf56a2[_0x21194e(0x1ef)](_0x21194e(0x29c))+'\x20'+_0x2ec58c+_0x21194e(0x201)+_0x41094b+_0x21194e(0x1f7)+_0x5b1801+_0x3a707b);}}return console['log'](a31_0xbf56a2['yellow'](_0x21194e(0x309))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x2fe);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x282);async['execute'](_0xd6abba){const _0x5b28f4=a31_0x2594d4,{options:_0x3fd0ab,args:_0x50bc5d,tdx:_0x29c9c5}=_0xd6abba,_0x290ed8=_0x3fd0ab,_0xa5c89f=_0x50bc5d[0x0],_0x4f3326=_0xa5c89f&&isYamlFilePath(_0xa5c89f),_0x437235=await resolveTarget({'arg':_0x4f3326?_0xa5c89f:undefined,'contextParent':_0x3fd0ab[_0x5b28f4(0x22b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x437235))return _0x437235['errorCode']===_0x5b28f4(0x205)?(console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x1ef)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5b28f4(0x2c7)](_0x5b28f4(0x230)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2e3)),console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2a9))):(console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x2b6)](_0x5b28f4(0x2bb)+_0x437235[_0x5b28f4(0x2c8)]+'\x0a')),_0x437235[_0x5b28f4(0x204)]&&console['error'](a31_0xbf56a2['cyan'](_0x437235[_0x5b28f4(0x204)]))),0x1;let _0x4006c9=_0x4f3326?undefined:_0xa5c89f,_0xcc55,_0x242ade;_0x437235[_0x5b28f4(0x22d)]===_0x5b28f4(0x1e4)&&(_0x4006c9=_0x437235[_0x5b28f4(0x2b4)],_0xcc55=_0x437235['filePath'],_0x242ade=_0x437235['folderPath']);const _0x22d50e=_0x437235[_0x5b28f4(0x20d)],_0x371604=_0x437235['targetDir'];_0x290ed8[_0x5b28f4(0x1de)]&&(console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2d5)+_0x22d50e),console['error'](_0x5b28f4(0x2bc)+_0x371604),_0x4006c9&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x264)+_0x4006c9),_0xcc55&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2c4)+_0xcc55),_0x242ade&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2e2)+_0x242ade));const _0x1ebd67=await withSpinner(_0x5b28f4(0x27f),()=>_0x29c9c5[_0x5b28f4(0x306)]['resolveParentId'](_0x22d50e),{'verbose':_0x3fd0ab[_0x5b28f4(0x1de)]}),_0x293e14=_0x1ebd67['data'],{journeys:_0x38869b,folders:_0x488a5a}=await withSpinner(_0x5b28f4(0x302),async()=>{const _0x437f4c=_0x5b28f4,[_0x36469e,_0x455a97]=await Promise['all']([_0x29c9c5[_0x437f4c(0x265)][_0x437f4c(0x2ef)](_0x293e14,undefined,{'includeAllVersions':!![]}),_0x29c9c5[_0x437f4c(0x306)]['listFolders'](_0x293e14)]);return{'journeys':_0x36469e,'folders':_0x455a97};},{'verbose':_0x3fd0ab['verbose']})[_0x5b28f4(0x27b)](_0x3da2e8=>_0x3da2e8[_0x5b28f4(0x210)]);let _0x47435c=_0x38869b;const _0x4606c9=buildFolderIdToPathMap(_0x488a5a);if(_0x4006c9){const _0x632334=_0x47435c[_0x5b28f4(0x2c9)](_0x17da97=>_0x17da97['journeyBundleName'][_0x5b28f4(0x2e7)]()===_0x4006c9['toLowerCase']());if(_0x632334['length']===0x0)return console[_0x5b28f4(0x2c7)](_0x5b28f4(0x206)+_0x4006c9),console['error'](_0x5b28f4(0x242)),0x1;_0x47435c=_0x632334;}if(_0x242ade!==undefined){const _0x2f8298=_0x47435c['filter'](_0x5dfea9=>{const _0x4dd6e4=_0x5b28f4,_0x4dba2d=_0x5dfea9[_0x4dd6e4(0x2eb)]?_0x4606c9[_0x4dd6e4(0x1e7)](_0x5dfea9['folderId'])||'':'';return _0x4dba2d===_0x242ade;});if(_0x2f8298[_0x5b28f4(0x21c)]===0x0&&_0x47435c['length']>0x0){console['error'](_0x5b28f4(0x245)+_0x4006c9+_0x5b28f4(0x266)+(_0x242ade||_0x5b28f4(0x26f))),console['error'](_0x5b28f4(0x2ba));for(const _0x1e3cf7 of _0x47435c){const _0xf62a60=_0x1e3cf7[_0x5b28f4(0x2eb)]?_0x4606c9[_0x5b28f4(0x1e7)](_0x1e3cf7[_0x5b28f4(0x2eb)])||'':'';console['error'](_0x5b28f4(0x2ad)+(_0xf62a60||_0x5b28f4(0x238))+'/'+_0x1e3cf7[_0x5b28f4(0x2ae)]);}return 0x1;}_0x47435c=_0x2f8298;}if(_0x47435c[_0x5b28f4(0x21c)]===0x0)return console[_0x5b28f4(0x2c7)](_0x5b28f4(0x247)),0x0;const _0x49021a=new Map();for(const _0x28a789 of _0x47435c){const _0x1e88b9=_0x28a789[_0x5b28f4(0x228)];!_0x49021a[_0x5b28f4(0x2be)](_0x1e88b9)&&_0x49021a['set'](_0x1e88b9,[]),_0x49021a[_0x5b28f4(0x1e7)](_0x1e88b9)[_0x5b28f4(0x207)](_0x28a789);}for(const _0x4a5c7f of _0x49021a[_0x5b28f4(0x258)]()){_0x4a5c7f['sort']((_0x6d3bfc,_0x101171)=>(_0x6d3bfc[_0x5b28f4(0x2b0)]||0x0)-(_0x101171[_0x5b28f4(0x2b0)]||0x0));}const _0x5a53a2=[],{idToEmailMap:_0x19430e,connectionIdToNameMap:_0x10a2f4}=await withSpinner(_0x5b28f4(0x202),async()=>{const _0x550ea0=_0x5b28f4,[_0x260051,_0x365376]=await Promise[_0x550ea0(0x217)]([_0x29c9c5[_0x550ea0(0x284)][_0x550ea0(0x200)](),_0x29c9c5[_0x550ea0(0x2b9)][_0x550ea0(0x2a4)]()]);return{'idToEmailMap':_0x260051,'connectionIdToNameMap':_0x365376};},{'verbose':_0x3fd0ab[_0x5b28f4(0x1de)]})['then'](_0x11c9c8=>_0x11c9c8[_0x5b28f4(0x210)]);for(const _0x4d8890 of _0x49021a[_0x5b28f4(0x258)]()){const _0x137a50=_0x4d8890[0x0][_0x5b28f4(0x2ae)],_0x32c3f8=_0x4d8890[0x0][_0x5b28f4(0x2eb)],_0x424893=_0x32c3f8?_0x4606c9[_0x5b28f4(0x1e7)](_0x32c3f8)||'':'',_0x3f7ff2=_0x424893?a31_0x28469a[_0x5b28f4(0x301)](_0x371604,_0x424893):_0x371604,_0x370522=_0xcc55||a31_0x28469a[_0x5b28f4(0x301)](_0x3f7ff2,sanitizeFileName(_0x137a50)+_0x5b28f4(0x2cf));let _0x50b669,_0x4cd1a5;if(existsSync(_0x370522))try{const _0x2c1a97=readFileSync(_0x370522,'utf-8'),_0x517f91=parseYamlString(_0x2c1a97);_0x4cd1a5=_0x517f91,_0x50b669=buildRuleToNameMapping(_0x517f91),_0x290ed8[_0x5b28f4(0x1de)]&&_0x50b669[_0x5b28f4(0x2b5)]>0x0&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x291)+_0x50b669[_0x5b28f4(0x2b5)]+_0x5b28f4(0x304)+_0x137a50);}catch(_0x171287){_0x290ed8[_0x5b28f4(0x1de)]&&console[_0x5b28f4(0x2c7)](_0x5b28f4(0x2e0)+_0x171287[_0x5b28f4(0x2c8)]);}const _0x2cb1d2=[],_0x724d95=new Set(),_0x54a949=new Map(),_0xf5f866=new Map(),_0x37a115=new Set(),_0x5ac801=new Map(),_0x497ed7=new Map(),_0x33ccee=createJumpTargetCache();await withProgressSpinner(_0x5b28f4(0x26e)+_0x137a50+_0x5b28f4(0x23c),async _0x1212d4=>{const _0x4c9caa=_0x5b28f4;for(const _0x2705e5 of _0x4d8890){const _0x2669b9=_0x4d8890[_0x4c9caa(0x21c)]>0x1?_0x2705e5[_0x4c9caa(0x2ae)]+'\x20v'+(_0x2705e5[_0x4c9caa(0x2b0)]||0x1):_0x2705e5[_0x4c9caa(0x2ae)];_0x1212d4[_0x4c9caa(0x27a)]('Fetching\x20'+_0x2669b9);const _0x5ad205=await _0x29c9c5[_0x4c9caa(0x265)][_0x4c9caa(0x2e8)](_0x2705e5['id']),_0x3eaf8e=_0x5ad205['attributes']?.['audienceId'],_0x4c95e6={'resolveSegment':async _0x510c73=>{const _0x3b2e47=_0x4c9caa;if(!_0x3eaf8e)return{'name':_0x510c73,'isJourneyLocal':![]};const _0x473e94=_0x54a949['get'](_0x510c73);if(_0x473e94)return _0x473e94;try{const _0x392621=await _0x29c9c5[_0x3b2e47(0x306)][_0x3b2e47(0x1ff)](_0x3eaf8e,_0x510c73),_0x5e41d0=_0x392621[_0x3b2e47(0x203)]===SEGMENT_KIND_JOURNEY;let _0x1d6a87,_0x48c054=_0x392621[_0x3b2e47(0x287)];if(_0x5e41d0&&_0x392621[_0x3b2e47(0x2e4)]){const _0x11ab6d=await segmentResponseToDef(_0x392621,{'resolveSegmentName':async _0x4cc391=>{const _0x14fe66=_0x3b2e47,_0xc80c7a=_0x54a949[_0x14fe66(0x1e7)](_0x4cc391);if(_0xc80c7a)return _0xc80c7a[_0x14fe66(0x287)];const _0xce2845=await _0x4c95e6[_0x14fe66(0x267)](_0x4cc391);return _0xce2845[_0x14fe66(0x287)];}}),_0x2b1c47=_0x11ab6d['rule'];_0x1d6a87={'description':_0x392621['description'],'rule':_0x2b1c47};const _0x54206b=serializeRule(_0x2b1c47),_0x2926d6=_0xf5f866['get'](_0x54206b);if(_0x2926d6)_0x48c054=_0x2926d6,_0x1d6a87=undefined,_0x290ed8[_0x3b2e47(0x1de)]&&console['error'](_0x3b2e47(0x268)+_0x392621[_0x3b2e47(0x287)]+'\x20->\x20'+_0x2926d6);else{let _0x4a7705=![];if(_0x50b669){const _0x4c7e30=_0x50b669[_0x3b2e47(0x1e7)](_0x54206b);if(_0x4c7e30){const _0x505f71=_0x4c7e30[_0x3b2e47(0x274)](_0x39ce2e=>!_0x724d95[_0x3b2e47(0x2be)](_0x39ce2e));_0x505f71&&(_0x48c054=_0x505f71,_0x724d95[_0x3b2e47(0x2f6)](_0x505f71),_0xf5f866[_0x3b2e47(0x1dd)](_0x54206b,_0x505f71),_0x4a7705=!![],_0x290ed8[_0x3b2e47(0x1de)]&&console[_0x3b2e47(0x2c7)](_0x3b2e47(0x1ee)+_0x505f71+_0x3b2e47(0x25c)));}}if(!_0x4a7705){const _0x3b03f9=generateJourneyLocalName(_0x392621[_0x3b2e47(0x287)]);_0x3b03f9&&(_0x48c054=_0x3b03f9);let _0x2a20d8=_0x48c054,_0x3e1b2b=0x2;while(_0x724d95['has'](_0x2a20d8)){_0x2a20d8=_0x48c054+'_'+_0x3e1b2b,_0x3e1b2b++;}_0x724d95[_0x3b2e47(0x2f6)](_0x2a20d8),_0xf5f866['set'](_0x54206b,_0x2a20d8),_0x48c054=_0x2a20d8;}}}const _0x20e961={'name':_0x48c054,'isJourneyLocal':_0x5e41d0,'definition':_0x1d6a87};return _0x54a949[_0x3b2e47(0x1dd)](_0x510c73,_0x20e961),_0x20e961;}catch(_0x578016){return _0x3fd0ab[_0x3b2e47(0x1de)]&&console[_0x3b2e47(0x2c7)](_0x3b2e47(0x285)+_0x510c73+':\x20'+_0x578016[_0x3b2e47(0x2c8)]),{'name':_0x510c73,'isJourneyLocal':![]};}},'resolveActivation':async _0x12aeba=>{const _0x3fed52=_0x4c9caa,_0x1e4c67=_0x5ac801[_0x3fed52(0x1e7)](_0x12aeba);if(_0x1e4c67)return _0x1e4c67;try{const _0x10a0f6=await _0x29c9c5['journey']['getActivation'](_0x2705e5['id'],_0x12aeba),_0xf14e90=journeyActivationStepToYaml(_0x10a0f6,_0x19430e,_0x10a2f4),_0x207fed=JSON[_0x3fed52(0x211)]({'name':_0xf14e90[_0x3fed52(0x287)],'connection':_0xf14e90[_0x3fed52(0x2b9)],'connector_config':_0xf14e90[_0x3fed52(0x24b)]}),_0x35cf9d=_0x497ed7[_0x3fed52(0x1e7)](_0x207fed);if(_0x35cf9d){const _0x464bb5={'name':_0x35cf9d,'isJourneyLocal':!![],'definition':_0xf14e90};return _0x5ac801['set'](_0x12aeba,_0x464bb5),_0x464bb5;}const _0x364b59=_0x10a0f6[_0x3fed52(0x1db)]['activationParams'][_0x3fed52(0x287)]||_0x12aeba,_0x308511=sanitizeYamlKey(_0x364b59)||_0x3fed52(0x2e6)+_0x12aeba;let _0x15759f=_0x308511,_0x576a47=0x2;while(_0x37a115[_0x3fed52(0x2be)](_0x15759f)){_0x15759f=_0x308511+'_'+_0x576a47,_0x576a47++;}_0x37a115[_0x3fed52(0x2f6)](_0x15759f),_0x497ed7['set'](_0x207fed,_0x15759f);const _0x1dd664={'name':_0x15759f,'isJourneyLocal':!![],'definition':_0xf14e90};return _0x5ac801[_0x3fed52(0x1dd)](_0x12aeba,_0x1dd664),_0x1dd664;}catch(_0xc9ba3f){return _0x3fd0ab[_0x3fed52(0x1de)]&&console[_0x3fed52(0x2c7)](_0x3fed52(0x2f3)+_0x12aeba+':\x20'+_0xc9ba3f[_0x3fed52(0x2c8)]),{'name':_0x12aeba,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x52cde3,_0x5c7a8b)=>{const _0x4d1207=_0x4c9caa;return resolveJumpTarget(_0x52cde3,_0x5c7a8b,_0x33ccee,_0x1fe278=>_0x29c9c5[_0x4d1207(0x265)][_0x4d1207(0x2e8)](_0x1fe278));}},_0x13981f=await journeyResponseToDef(_0x5ad205,_0x4c95e6);_0x2cb1d2[_0x4c9caa(0x207)]({'item':_0x2705e5,'yaml':_0x13981f});}},{'verbose':_0x3fd0ab[_0x5b28f4(0x1de)]});const _0x1744c3=await _0x29c9c5['journey'][_0x5b28f4(0x2b3)](_0x4d8890[0x0]['journeyBundleId']),_0x350bf5=buildMergedJourneyDef(_0x2cb1d2,_0x50b669,_0x1744c3),_0x12b766=normalizeJourneyDef(_0x350bf5,_0x4cd1a5),_0x4a02df=toYamlString(_0x12b766),_0x39d006=_0xcc55||a31_0x28469a[_0x5b28f4(0x301)](_0x3f7ff2,sanitizeFileName(_0x137a50)+'.journey.yml');!_0xcc55&&_0x424893&&!existsSync(_0x3f7ff2)&&mkdirSync(_0x3f7ff2,{'recursive':!![]});const _0x337844=a31_0x28469a['relative'](process['cwd'](),_0x39d006);if(existsSync(_0x39d006)){const _0x18d704=readFileSync(_0x39d006,_0x5b28f4(0x29b)),_0x3314cd=generateDiff(_0x18d704,_0x4a02df),_0x13413a=hasChanges(_0x3314cd);_0x5a53a2[_0x5b28f4(0x207)]({'relativePath':_0x337844,'absolutePath':_0x39d006,'content':_0x4a02df,'isNew':![],'hasChanges':_0x13413a,'diff':_0x13413a?formatDiffWithColors(_0x3314cd):undefined});}else _0x5a53a2[_0x5b28f4(0x207)]({'relativePath':_0x337844,'absolutePath':_0x39d006,'content':_0x4a02df,'isNew':!![],'hasChanges':![]});}const _0xb82cdd=_0x5a53a2[_0x5b28f4(0x2c9)](_0x4b8fcc=>_0x4b8fcc['isNew']),_0x4dc8b9=_0x5a53a2[_0x5b28f4(0x2c9)](_0x121b43=>!_0x121b43['isNew']&&_0x121b43[_0x5b28f4(0x20e)]),_0x54e023=_0x5a53a2[_0x5b28f4(0x2c9)](_0x5b99f2=>!_0x5b99f2[_0x5b28f4(0x221)]&&!_0x5b99f2['hasChanges']),_0x5ac01a=_0x47435c[_0x5b28f4(0x21c)],_0x57b92b=_0x49021a[_0x5b28f4(0x2b5)],_0x223345=_0x5ac01a>_0x57b92b?'\x20('+_0x5ac01a+_0x5b28f4(0x22f):'';console[_0x5b28f4(0x2c7)](_0x5b28f4(0x269)),console['error']('\x20\x20'+a31_0xbf56a2['cyan'](_0x57b92b+_0x5b28f4(0x208))+a31_0xbf56a2['dim'](_0x223345)),console[_0x5b28f4(0x2c7)]('\x20\x20'+a31_0xbf56a2['green']('+\x20'+_0xb82cdd[_0x5b28f4(0x21c)]+'\x20new\x20files')),console[_0x5b28f4(0x2c7)]('\x20\x20'+a31_0xbf56a2['yellow']('~\x20'+_0x4dc8b9[_0x5b28f4(0x21c)]+_0x5b28f4(0x21b))),console[_0x5b28f4(0x2c7)]('\x20\x20'+a31_0xbf56a2['dim']('=\x20'+_0x54e023[_0x5b28f4(0x21c)]+_0x5b28f4(0x24e))),console[_0x5b28f4(0x2c7)]('\x20\x20Target:\x20'+a31_0xbf56a2[_0x5b28f4(0x286)](_0x371604)+'\x0a');if(_0x4dc8b9['length']>0x0)for(const _0x234adc of _0x4dc8b9){console['error'](_0x5b28f4(0x235)+_0x234adc[_0x5b28f4(0x2d2)]+'\x27:'),console[_0x5b28f4(0x2c7)]('─'[_0x5b28f4(0x25b)](0x3c)),console[_0x5b28f4(0x2c7)](_0x234adc[_0x5b28f4(0x2f7)]),console['error']('─'['repeat'](0x3c));}if(_0x290ed8[_0x5b28f4(0x1ed)])return console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x1ef)](_0x5b28f4(0x23d))),0x0;if(_0xb82cdd[_0x5b28f4(0x21c)]===0x0&&_0x4dc8b9[_0x5b28f4(0x21c)]===0x0)return console['error'](a31_0xbf56a2[_0x5b28f4(0x2dd)](_0x5b28f4(0x24a))),saveSessionContext({'parent_segment':_0x22d50e},_0x290ed8[_0x5b28f4(0x2e1)]),console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x2dd)](_0x5b28f4(0x2d6)+a31_0xbf56a2[_0x5b28f4(0x2d7)]('parent_segment')+'\x20=\x20'+a31_0xbf56a2['cyan'](_0x22d50e))),0x0;if(!_0x290ed8[_0x5b28f4(0x1e5)]&&(_0xb82cdd[_0x5b28f4(0x21c)]>0x0||_0x4dc8b9[_0x5b28f4(0x21c)]>0x0)){if(!isInteractive())return console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x2b6)](_0x5b28f4(0x26d)),_0x5b28f4(0x224)),console['error'](a31_0xbf56a2['dim'](_0x5b28f4(0x232))),0x1;const _0x3a77c7=await confirmKey(_0x5b28f4(0x2fa)+(_0xb82cdd[_0x5b28f4(0x21c)]+_0x4dc8b9[_0x5b28f4(0x21c)])+_0x5b28f4(0x2a1));if(!_0x3a77c7)return console['error'](a31_0xbf56a2[_0x5b28f4(0x1ef)](_0x5b28f4(0x1d9)),_0x5b28f4(0x30a)),0x1;}!existsSync(_0x371604)&&mkdirSync(_0x371604,{'recursive':!![]});const _0x32a920=a31_0x28469a['join'](_0x371604,_0x5b28f4(0x1dc));writeFileSync(_0x32a920,createTdxConfigContent(_0x22d50e),_0x5b28f4(0x29b));for(const _0xd8283e of _0x5a53a2){(_0xd8283e['isNew']||_0xd8283e[_0x5b28f4(0x20e)])&&writeFileSync(_0xd8283e[_0x5b28f4(0x275)],_0xd8283e[_0x5b28f4(0x1f3)],'utf-8');}return console[_0x5b28f4(0x2c7)](a31_0xbf56a2[_0x5b28f4(0x2dd)]('✔\x20Pulled\x20'+(_0xb82cdd[_0x5b28f4(0x21c)]+_0x4dc8b9[_0x5b28f4(0x21c)])+_0x5b28f4(0x244)+_0x371604)),saveSessionContext({'parent_segment':_0x22d50e},_0x290ed8['session']),console[_0x5b28f4(0x2c7)](a31_0xbf56a2['green'](_0x5b28f4(0x2d6)+a31_0xbf56a2['dim'](_0x5b28f4(0x21f))+_0x5b28f4(0x2dc)+a31_0xbf56a2[_0x5b28f4(0x286)](_0x22d50e))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x2ff);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x1e8);async[a31_0x2594d4(0x279)](_0x404b83){const _0x480387=a31_0x2594d4,{options:_0x1641bb,args:_0x503c54,tdx:_0x3ea352}=_0x404b83,_0xb9699f=_0x503c54[0x0];if(!requireNameOrPath(_0xb9699f))return 0x1;_0x1641bb['verbose']&&console[_0x480387(0x2c7)]('Input:\x20'+_0xb9699f);const {journeyId:_0x7a98f7}=await resolveJourneyIdFromInput(_0xb9699f,_0x1641bb,_0x3ea352),_0x200002=await withSpinner('Getting\x20column\x20mapping...',()=>_0x3ea352['journey'][_0x480387(0x1f1)](_0x7a98f7),{'verbose':_0x1641bb[_0x480387(0x1de)]}),_0x2a36ef=_0x200002['data'];return console[_0x480387(0x308)]('Database:\x20'+_0x2a36ef[_0x480387(0x249)]),console['log'](_0x480387(0x2cb)+_0x2a36ef[_0x480387(0x253)]),await handleSDKOutput(_0x2a36ef[_0x480387(0x28c)],_0x1641bb),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x24d);[a31_0x2594d4(0x276)]='List\x20activations\x20for\x20a\x20journey';async['execute'](_0x3648bb){const _0x12656f=a31_0x2594d4,{options:_0x573f3d,args:_0x48461e,tdx:_0x49203c}=_0x3648bb,_0x17f2aa=_0x48461e[0x0];if(!requireNameOrPath(_0x17f2aa))return 0x1;_0x573f3d[_0x12656f(0x1de)]&&console[_0x12656f(0x2c7)]('Input:\x20'+_0x17f2aa);const {journeyId:_0x7aa8e1}=await resolveJourneyIdFromInput(_0x17f2aa,_0x573f3d,_0x49203c),_0x257b7e=await withSpinner(_0x12656f(0x25f),()=>_0x49203c[_0x12656f(0x265)][_0x12656f(0x23e)](_0x7aa8e1),{'verbose':_0x573f3d[_0x12656f(0x1de)]}),_0x162bed=_0x257b7e[_0x12656f(0x210)];return console[_0x12656f(0x2c7)](_0x12656f(0x291)+_0x162bed[_0x12656f(0x21c)]+_0x12656f(0x28a)+(_0x162bed[_0x12656f(0x21c)]!==0x1?'s':'')),await handleSDKOutput(_0x162bed,_0x573f3d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a31_0x2594d4(0x287)]=a31_0x2594d4(0x2fc);['description']='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI';[a31_0x2594d4(0x292)]=new SegmentPushCommand();async[a31_0x2594d4(0x279)](_0x24a644){const _0x1126e6=a31_0x2594d4,_0x8e2cb8=_0x24a644[_0x1126e6(0x2a7)][0x0];let _0x2d97ed;if(_0x8e2cb8){const _0x48379c=await resolveTarget({'arg':_0x8e2cb8,'contextParent':_0x24a644[_0x1126e6(0x27e)]['parentSegment'],'cwd':process[_0x1126e6(0x1f8)]()});isSuccessfulResolution(_0x48379c)&&_0x48379c[_0x1126e6(0x22d)]===_0x1126e6(0x1e4)&&(_0x2d97ed=_0x48379c[_0x1126e6(0x231)]);}const _0x305d38={..._0x24a644,'options':{..._0x24a644[_0x1126e6(0x27e)],'journeysOnly':!![],..._0x2d97ed&&{'singleFilePath':_0x2d97ed}}};return this[_0x1126e6(0x292)][_0x1126e6(0x279)](_0x305d38);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a31_0x2594d4(0x30c);[a31_0x2594d4(0x276)]=a31_0x2594d4(0x2a8);async[a31_0x2594d4(0x279)](_0x121431){const _0x3f34c8=a31_0x2594d4,{options:_0x3592e6,args:_0x553d9f,tdx:_0x1d0b06}=_0x121431,_0x4e4953=_0x553d9f[0x0];if(!requireNameOrPath(_0x4e4953))return 0x1;if(_0x3592e6[_0x3f34c8(0x1de)])console[_0x3f34c8(0x2c7)](_0x3f34c8(0x2c1)+_0x4e4953);const {journeyId:_0x1b5116}=await resolveJourneyIdFromInput(_0x4e4953,_0x3592e6,_0x1d0b06),_0x40b510=await withSpinner(_0x3f34c8(0x2ec),()=>_0x1d0b06[_0x3f34c8(0x265)][_0x3f34c8(0x2de)](_0x1b5116),{'verbose':_0x3592e6['verbose']}),{bundleName:_0x1c944a,versions:_0x2b484f,latestJourneyId:_0x714506}=_0x40b510[_0x3f34c8(0x210)];console['error'](_0x1c944a+':\x20'+_0x2b484f[_0x3f34c8(0x21c)]+_0x3f34c8(0x28d)+(_0x2b484f[_0x3f34c8(0x21c)]!==0x1?'s':''));const _0xb15e8d=_0x2b484f[_0x3f34c8(0x2b1)](_0x2ede7a=>({'version':_0x2ede7a[_0x3f34c8(0x2b0)],'journey_id':_0x2ede7a[_0x3f34c8(0x223)],'name':_0x2ede7a[_0x3f34c8(0x287)],'state':_0x2ede7a[_0x3f34c8(0x2a2)],'paused':_0x2ede7a[_0x3f34c8(0x2da)],'latest':_0x2ede7a['journeyId']===_0x714506,'created_at':_0x2ede7a[_0x3f34c8(0x303)]}));return await handleSDKOutput(_0xb15e8d,_0x3592e6),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';['description']=a31_0x2594d4(0x2a6);async['execute'](_0x5ca9bc){const _0x10eb6c=a31_0x2594d4,{options:_0x495c25,args:_0x278cd1,tdx:_0x48b770}=_0x5ca9bc,_0xcdf91=_0x278cd1[0x0];if(!requireNameOrPath(_0xcdf91))return 0x1;if(_0x495c25['verbose'])console[_0x10eb6c(0x2c7)](_0x10eb6c(0x2c1)+_0xcdf91);const {journeyId:_0x41fce3,journeyName:_0x3fb7be}=await resolveJourneyIdFromInput(_0xcdf91,_0x495c25,_0x48b770);if(!_0x495c25['yes']){const _0x52b9b1=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x3fb7be+'\x22?');if(!_0x52b9b1)return console[_0x10eb6c(0x2c7)]('Cancelled'),0x0;}const _0x162b3c=await withSpinner('Creating\x20new\x20version...',()=>_0x48b770[_0x10eb6c(0x265)][_0x10eb6c(0x237)](_0x41fce3),{'verbose':_0x495c25[_0x10eb6c(0x1de)]}),_0x1ec196=_0x162b3c[_0x10eb6c(0x210)];return console[_0x10eb6c(0x2c7)](a31_0xbf56a2[_0x10eb6c(0x2dd)]('\u2714')+_0x10eb6c(0x240)+_0x1ec196[_0x10eb6c(0x1db)][_0x10eb6c(0x2b0)]+'\x20(draft)\x20—\x20\x22'+_0x1ec196[_0x10eb6c(0x1db)][_0x10eb6c(0x287)]+'\x22'),console[_0x10eb6c(0x2c7)](_0x10eb6c(0x234)+_0x1ec196['id']),await handleSingleObjectOutput({'id':_0x1ec196['id'],'name':_0x1ec196[_0x10eb6c(0x1db)][_0x10eb6c(0x287)],'version':_0x1ec196[_0x10eb6c(0x1db)]['versionNumber'],'state':_0x1ec196[_0x10eb6c(0x1db)]['state'],'bundle_id':_0x1ec196['attributes'][_0x10eb6c(0x228)],'created_at':_0x1ec196['attributes'][_0x10eb6c(0x303)]},_0x495c25),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a31_0x2594d4(0x287)]='journey:version:view';['description']=a31_0x2594d4(0x2f0);async[a31_0x2594d4(0x279)](_0x552952){const _0x2f38e2=a31_0x2594d4,{options:_0x1922ae,args:_0x4d3d51,tdx:_0x4587c1}=_0x552952,_0x577dc6=_0x4d3d51[0x0];if(!requireNameOrPath(_0x577dc6))return 0x1;const _0x152e56=_0x1922ae[_0x2f38e2(0x213)];if(!_0x152e56)return console[_0x2f38e2(0x2c7)](_0x2f38e2(0x24f)),console[_0x2f38e2(0x2c7)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x3d8b8a=parseInt(_0x152e56,0xa);if(isNaN(_0x3d8b8a)||_0x3d8b8a<0x1)return console[_0x2f38e2(0x2c7)](_0x2f38e2(0x26a)+_0x152e56),0x1;if(_0x1922ae[_0x2f38e2(0x1de)])console[_0x2f38e2(0x2c7)]('Input:\x20'+_0x577dc6+_0x2f38e2(0x21e)+_0x3d8b8a);const {journeyId:_0x27c787,parentSegmentId:_0x1be853}=await resolveJourneyIdFromInput(_0x577dc6,_0x1922ae,_0x4587c1),_0x4ba2fe=await withSpinner('Resolving\x20version...',()=>_0x4587c1['journey']['listVersions'](_0x27c787),{'verbose':_0x1922ae[_0x2f38e2(0x1de)]}),{versions:_0x2a3257,latestJourneyId:_0x56027b}=_0x4ba2fe['data'],_0x43c960=_0x2a3257[_0x2f38e2(0x274)](_0x506b1e=>_0x506b1e[_0x2f38e2(0x2b0)]===_0x3d8b8a);if(!_0x43c960){const _0x1f7585=_0x2a3257[_0x2f38e2(0x2b1)](_0x5edd55=>'v'+_0x5edd55[_0x2f38e2(0x2b0)])['join'](',\x20');return console[_0x2f38e2(0x2c7)](_0x2f38e2(0x2f2)+_0x3d8b8a+_0x2f38e2(0x22e)+_0x1f7585),0x1;}const _0x5375d7=await withSpinner('Getting\x20version\x20'+_0x3d8b8a+_0x2f38e2(0x278),()=>_0x4587c1[_0x2f38e2(0x265)][_0x2f38e2(0x2e8)](_0x43c960['journeyId']),{'verbose':_0x1922ae[_0x2f38e2(0x1de)]}),_0x382483=_0x5375d7[_0x2f38e2(0x210)],_0x39630=getConsoleNextUrl(_0x1922ae[_0x2f38e2(0x300)],_0x2f38e2(0x2ce)+_0x1be853+'/e/'+_0x43c960[_0x2f38e2(0x223)]+_0x2f38e2(0x2e9));return await handleSingleObjectOutput({'id':_0x382483['id'],'name':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x287)],'version':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x2b0)],'description':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x276)],'state':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x2a2)],'paused':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x2da)],'reentry_mode':_0x382483['attributes'][_0x2f38e2(0x1f5)],'stages':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x2a0)]?.[_0x2f38e2(0x21c)]||0x0,..._0x382483['attributes'][_0x2f38e2(0x2b2)]&&{'goal':_0x382483['attributes'][_0x2f38e2(0x2b2)][_0x2f38e2(0x287)]},'latest':_0x43c960[_0x2f38e2(0x223)]===_0x56027b,'created_at':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x303)],'updated_at':_0x382483[_0x2f38e2(0x1db)][_0x2f38e2(0x1e0)],'url':_0x39630},_0x1922ae),0x0;}}
|
|
1
|
+
const a32_0x438e5f=a32_0x33ad;(function(_0x18d7fb,_0x2b81ce){const _0x3ebdbc=a32_0x33ad,_0x430a30=_0x18d7fb();while(!![]){try{const _0x5366ee=parseInt(_0x3ebdbc(0x16b))/0x1*(-parseInt(_0x3ebdbc(0x217))/0x2)+-parseInt(_0x3ebdbc(0x171))/0x3+parseInt(_0x3ebdbc(0x1c8))/0x4+parseInt(_0x3ebdbc(0x1f5))/0x5*(-parseInt(_0x3ebdbc(0x1e2))/0x6)+parseInt(_0x3ebdbc(0x1a9))/0x7+parseInt(_0x3ebdbc(0x214))/0x8*(parseInt(_0x3ebdbc(0x1eb))/0x9)+-parseInt(_0x3ebdbc(0x221))/0xa*(-parseInt(_0x3ebdbc(0x123))/0xb);if(_0x5366ee===_0x2b81ce)break;else _0x430a30['push'](_0x430a30['shift']());}catch(_0x5493a5){_0x430a30['push'](_0x430a30['shift']());}}}(a32_0x569b,0x79d39));import a32_0x4f5289 from'chalk';import a32_0x708177 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';function a32_0x569b(){const _0x293d0e=['verbose','Session:','table','INVALID_ARGUMENT','message','audienceId','(draft)','connector_config','folderPath','test','\x20activation','1979901YMtbny','resourceName','nodes','Journey:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','kind','Journey\x20name:\x20','links','List\x20journeys\x20in\x20current\x20context','isNew','Cancelled','Write\x20','connection\x20','/e/','Resuming\x20journey...','listJourneysWithFolders','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Pause\x20a\x20running\x20journey','web','No\x20journeys\x20found','Pattern:\x20','/j/da/je','Warning:\x20Could\x20not\x20resolve\x20activation\x20','includeStats','✔\x20Found\x20','resume','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','bold','conversion','red','Error:\x20--version\x20option\x20is\x20required','428568aPNbOg','Resolving\x20parent\x20segment...','no_parent','createdAt','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','green','attributes','yellow','stringify','\x22\x20resumed','journeys','relative','\x20Created\x20v','⚠️\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20=\x20','(root)','file','jsonl','\x22\x20not\x20found','Creating\x20new\x20version...','diff','\x20[runs\x20on\x20refresh]','🗺️\x20','dryRun','args','4194lzsGYs','parent_segment','completed','connection','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Error:\x20Journey\x20not\x20found:\x20','parentName','runAfterJourneyRefresh','Folder\x20path:\x20','81tuuJif','List\x20activations\x20for\x20a\x20journey','journey:list','journeyName','state','paused','\x20\x20-\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Parent\x20segment:\x20','options','5390cxNtaU','push','pausedAt','columns','/app/ps/','replace','journey:versions','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20\x20Statistics\x20not\x20available','size','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','(none)','...','json','then','filePath','Resolving\x20journey...','\x20files?','blue','values','user','map','utf-8','renderStats','\x20(rule\x20match)','📁\x20','Error:\x20Invalid\x20--type\x20\x22','journeyBundleName','\x5c$&','254808TSowms','journeyBundleId','listVersions','261246LJGfGI','site','\x20\x20←\x20','journey:resume','segments','rule','\x20@\x20','journey:version:create','status','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','10840430iyKvZu','root\x20folder','(unnamed)','description','Available\x20stages:\x20','getLatestJourneyId','sort','\x20\x20Consolidating\x20duplicate\x20segment:\x20','base','Error:\x20Journey\x20\x27','Error:\x20Stage\x20\x22','getStatistics','completionRate','absolutePath','\x20journey\x20files\x20to\x20','Fetching\x20journey\x20','error','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Database:\x20','activationParams','goal','log','limit','\x20not\x20found.\x20Available:\x20','Getting\x20journey\x20details...','Resolving\x20version...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x22\x20paused','all','segment','scheduleType','resolveParentId','\x20version','Error:\x20Version\x20','targetDir','journey:pause','cyan','tsv','type','includeHistory','length','Resume\x20a\x20paused\x20journey','Status:','\x20Journey\x20workflow\x20started','reentryMode','entries','folders','11PDWAHb','connectionId','run','\x20versions)','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)','no\x20connection','Activations:','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','helpText','segmentPushCommand','toLowerCase','Listing\x20journeys...','\x20\x20Name:\x20','join','journeyId','getActivation','journey','filter','Show\x20journey\x20statistics','none','Parent\x20segment\x20ID:','(archived)','Input:\x20','\x20\x20Journey\x20ID:\x20','relativePath','milestoneSize','launched','No\x20statistics\x20available\x20for\x20journey:\x20','tdx.json','✔\x20Pulled\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','execute','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','executeDryRun','Target\x20directory:\x20','find','✔\x20Context\x20set:\x20','errorCode','getJourney','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','repeat','Aborted.','listActivationsFlat','\x20(ID:\x20','activation','Export\x20journey(s)\x20as\x20YAML\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file',',\x20version:\x20','exitOrJumpRate','hasPeriod','(paused)','Error:\x20Invalid\x20version\x20number:\x20','hasChanges','workflowSessionId','database','✔\x20Journey\x20\x22','journey:push','Error:\x20Parent\x20segment\x20context\x20required','versionNumber','format','exitOrJumpSize','name','from','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20Opening\x20','parentSegment','\x27\x20not\x20found\x20in\x20','Fetching\x20journeys\x20and\x20folders...','Getting\x20version\x20','Getting\x20journey\x20statistics...','Resolved\x20YAML\x20file:\x20','2SNwWGp','version','\x20unchanged\x20files','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','session','740754lomBdU','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','State:','data','stages','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','setPhase','(completed)','\x20journeys','resolveSegment','Stages:','ID:','stageNameMap','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','segmentName','\x20(draft)\x20—\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Paused:','runAt','Show\x20journey\x20table\x20column\x20mapping','\x0aPull\x20summary:','Fetching\x20parent\x20segment...','\x20\x20Target:\x20','workflowId','get','Found\x20','buildIdToNameMap','Paused\x20at:','.journey.yml','\x20\x20Parent\x20segment:\x20','folderId','Warning:\x20Could\x20not\x20resolve\x20segment\x20','yes','dim','\x20\x20Folder\x20path:\x20','enteredSize',',\x20schedule:\x20','set','activation_','cwd','journeyStages','history','Show\x20journey\x20details','has','Listing\x20journey\x20versions...'];a32_0x569b=function(){return _0x293d0e;};return a32_0x569b();}function a32_0x33ad(_0x105eac,_0x403db6){_0x105eac=_0x105eac-0xfb;const _0x569b6f=a32_0x569b();let _0x33adab=_0x569b6f[_0x105eac];return _0x33adab;}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,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0xe66660){const _0x33b7c0=a32_0x33ad;return!_0xe66660&&(console[_0x33b7c0(0x103)](_0x33b7c0(0x1cc)),console[_0x33b7c0(0x103)](_0x33b7c0(0x1e6))),!!_0xe66660;}function withJsonFormat(_0x114c1f){const _0x32a2fd=a32_0x33ad;if(!_0x114c1f[_0x32a2fd(0x15f)]&&!_0x114c1f[_0x32a2fd(0x204)]&&!_0x114c1f[_0x32a2fd(0x1da)]&&!_0x114c1f[_0x32a2fd(0x119)])return{..._0x114c1f,'format':_0x32a2fd(0x204),'json':!![]};return _0x114c1f;}function formatJourneyState(_0x8cee1){const _0x84712a=a32_0x33ad;switch(_0x8cee1){case _0x84712a(0x13e):return a32_0x4f5289[_0x84712a(0x1cd)]('(running)');case'draft':return a32_0x4f5289['dim'](_0x84712a(0x1a4));case _0x84712a(0x1f0):return a32_0x4f5289[_0x84712a(0x1cf)](_0x84712a(0x156));case _0x84712a(0x1e4):return a32_0x4f5289[_0x84712a(0x209)](_0x84712a(0x178));case'archived':return a32_0x4f5289['dim'](_0x84712a(0x139));default:return'('+_0x8cee1+')';}}function formatJourneyItem(_0x58ab43,_0x30683c='',_0x4c308b){const _0x3b429f=a32_0x33ad,_0x54e2e6=formatJourneyState(_0x58ab43[_0x3b429f(0x1ef)]),_0x6302a5=_0x4c308b?hyperlink(_0x58ab43['journeyBundleName'],_0x4c308b):_0x58ab43[_0x3b429f(0x212)];return _0x30683c+_0x3b429f(0x1df)+_0x6302a5+'\x20'+_0x54e2e6;}function escapeRegex(_0x3f4145){const _0x5cf69b=a32_0x33ad;return _0x3f4145[_0x5cf69b(0x1fa)](/[.*+?^${}()|[\]\\]/g,_0x5cf69b(0x213));}function globToRegex(_0x1c2d5a){const _0x1cb1b8=a32_0x33ad,_0x3fe4c0=_0x1c2d5a['split']('*')[_0x1cb1b8(0x20c)](escapeRegex);return new RegExp(_0x3fe4c0[_0x1cb1b8(0x131)]('.*'),'i');}function buildRuleToNameMapping(_0x3eb54b){const _0x47978c=a32_0x33ad,_0x416c8d=new Map();if(_0x3eb54b[_0x47978c(0x21b)])for(const [_0x49e138,_0x2e8319]of Object[_0x47978c(0x121)](_0x3eb54b[_0x47978c(0x21b)])){if(_0x2e8319[_0x47978c(0x21c)]){const _0x5e6d7f=serializeRule(_0x2e8319['rule']),_0x554b95=_0x416c8d['get'](_0x5e6d7f);_0x554b95?_0x554b95[_0x47978c(0x1f6)](_0x49e138):_0x416c8d[_0x47978c(0x196)](_0x5e6d7f,[_0x49e138]);}}return _0x416c8d;}async function resolveJourneyIdFromInput(_0xa87019,_0x427021,_0x4ce304){const _0x3530c4=a32_0x33ad,_0x17e417=await resolveJourneyTarget(_0xa87019,_0x427021['parentSegment'],_0x427021[_0x3530c4(0x19e)]),_0x1a5876=_0x17e417['parentSegment'];if(!_0x1a5876)throw new SDKError(ErrorCode[_0x3530c4(0x1a1)],_0x3530c4(0x1ff));const _0x3265a5=await withSpinner(_0x3530c4(0x1c9),()=>_0x4ce304[_0x3530c4(0x111)][_0x3530c4(0x113)](_0x1a5876),{'verbose':_0x427021[_0x3530c4(0x19e)]}),_0x4bc9ca=_0x3265a5[_0x3530c4(0x174)],_0x4313d7=await withSpinner(_0x3530c4(0x207),()=>_0x4ce304[_0x3530c4(0x134)]['resolveJourneyId'](_0x4bc9ca,_0x17e417[_0x3530c4(0x1ee)]),{'verbose':_0x427021[_0x3530c4(0x19e)]});return{'journeyId':_0x4313d7[_0x3530c4(0x174)],'journeyName':_0x17e417[_0x3530c4(0x1ee)],'parentSegmentId':_0x4bc9ca};}async function resolveJourneyTarget(_0x579413,_0x193c7c,_0x3e5e69){const _0x3c7975=a32_0x33ad;if(isYamlFilePath(_0x579413))try{const _0x1653cf=await resolveYamlFilePath(_0x579413);return _0x3e5e69&&(console[_0x3c7975(0x103)](_0x3c7975(0x16a)+_0x579413),console['error'](_0x3c7975(0x18e)+_0x1653cf[_0x3c7975(0x165)]),console[_0x3c7975(0x103)](_0x3c7975(0x130)+_0x1653cf[_0x3c7975(0x17f)]),console[_0x3c7975(0x103)](_0x3c7975(0x193)+(_0x1653cf[_0x3c7975(0x1a6)]||_0x3c7975(0x1d8)))),{'journeyName':_0x1653cf[_0x3c7975(0x17f)],'parentSegment':_0x1653cf[_0x3c7975(0x165)],'resolved':_0x1653cf};}catch(_0x1c984b){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3c7975(0x10e)+_0x1c984b[_0x3c7975(0x1a2)]);}if(!_0x193c7c)throw new SDKError(ErrorCode[_0x3c7975(0x1a1)],_0x3c7975(0x163));return{'journeyName':_0x579413,'parentSegment':_0x193c7c};}export class JourneyListCommand extends BaseCommand{['name']=a32_0x438e5f(0x1ed);['description']=a32_0x438e5f(0x1b1);async['execute'](_0x328fd5){const _0x4ea41e=a32_0x438e5f,{options:_0x1ca2d5,args:_0x2f3f81,tdx:_0x5355f8}=_0x328fd5,_0x218f95=_0x2f3f81[0x0],_0x131cd2=_0x1ca2d5[_0x4ea41e(0x165)];if(!_0x131cd2)return console['error'](_0x4ea41e(0x15d)),console[_0x4ea41e(0x103)](_0x4ea41e(0x16e)),0x1;const _0x4fbaaf=await withSpinner(_0x4ea41e(0x1c9),()=>_0x5355f8['segment']['resolveParentId'](_0x131cd2),{'verbose':_0x1ca2d5[_0x4ea41e(0x19e)]}),_0x5963c4=_0x4fbaaf[_0x4ea41e(0x174)];_0x1ca2d5[_0x4ea41e(0x19e)]&&(console[_0x4ea41e(0x103)](_0x4ea41e(0x1f3)+_0x131cd2+_0x4ea41e(0x14f)+_0x5963c4+')'),_0x218f95&&console[_0x4ea41e(0x103)](_0x4ea41e(0x1bd)+_0x218f95));const _0x5c244d=await withSpinner(_0x4ea41e(0x186),()=>_0x5355f8[_0x4ea41e(0x111)]['getParentFull'](_0x5963c4),{'verbose':_0x1ca2d5['verbose']}),_0x3fccc5=_0x5c244d[_0x4ea41e(0x174)],_0x2f2e32=_0x3fccc5['rootFolderId'],_0xce75e6=await withSpinner(_0x4ea41e(0x12f),()=>_0x5355f8[_0x4ea41e(0x134)][_0x4ea41e(0x1b8)](_0x5963c4,_0x2f2e32),{'verbose':_0x1ca2d5[_0x4ea41e(0x19e)]});let _0x5334f3=_0xce75e6[_0x4ea41e(0x174)][_0x4ea41e(0x1d2)];const _0x402833=_0xce75e6[_0x4ea41e(0x174)][_0x4ea41e(0x122)],_0x4e612e=new Map();for(const _0x26f290 of _0x402833){_0x4e612e[_0x4ea41e(0x196)](_0x26f290['id'],_0x26f290[_0x4ea41e(0x161)]);}if(_0x218f95){const _0x19c6cf=globToRegex(_0x218f95);_0x5334f3=_0x5334f3[_0x4ea41e(0x135)](_0x398906=>_0x19c6cf[_0x4ea41e(0x1a7)](_0x398906['journeyBundleName']));}console[_0x4ea41e(0x103)](_0x4ea41e(0x1c1)+_0x5334f3['length']+'\x20journey'+(_0x5334f3[_0x4ea41e(0x11c)]!==0x1?'s':''));const _0x45197c=_0x70e25b=>{const _0x55f0e7=_0x4ea41e;return getConsoleNextUrl(_0x1ca2d5[_0x55f0e7(0x218)],_0x55f0e7(0x1f9)+_0x5963c4+_0x55f0e7(0x1b6)+_0x70e25b+'/j/da');};if(_0x1ca2d5[_0x4ea41e(0x15f)]===_0x4ea41e(0x1a0))await handleSDKOutput(_0x5334f3,_0x1ca2d5);else{if(_0x1ca2d5[_0x4ea41e(0x15f)]===_0x4ea41e(0x204)){const _0x1dafff=_0x5334f3[_0x4ea41e(0x20c)](_0x3dbca1=>({..._0x3dbca1,'url':_0x45197c(_0x3dbca1['id'])}));await handleSDKOutput(_0x1dafff,_0x1ca2d5);}else{console[_0x4ea41e(0x108)]('['+_0x131cd2+']');const _0x23a561=new Map(),_0x58cbf3=[];for(const _0x4c756a of _0x5334f3){if(!_0x4c756a[_0x4ea41e(0x18f)]||_0x4c756a[_0x4ea41e(0x18f)]===_0x2f2e32)_0x58cbf3[_0x4ea41e(0x1f6)](_0x4c756a);else{const _0x13d948=_0x23a561['get'](_0x4c756a['folderId'])||[];_0x13d948[_0x4ea41e(0x1f6)](_0x4c756a),_0x23a561[_0x4ea41e(0x196)](_0x4c756a['folderId'],_0x13d948);}}const _0x5dc945=(_0x18628a,_0x575bbf)=>_0x18628a[_0x4ea41e(0x212)]['localeCompare'](_0x575bbf[_0x4ea41e(0x212)],undefined,{'sensitivity':_0x4ea41e(0xfb)});_0x58cbf3['sort'](_0x5dc945);for(const _0x15efb0 of _0x58cbf3){console[_0x4ea41e(0x108)](formatJourneyItem(_0x15efb0,'',_0x45197c(_0x15efb0['id'])));}const _0x3d4fec=[..._0x23a561['entries']()][_0x4ea41e(0x227)]((_0x329f63,_0x5ca2c1)=>{const _0x5aca39=_0x4ea41e,_0x52b1d9=_0x4e612e[_0x5aca39(0x189)](_0x329f63[0x0])||_0x329f63[0x0],_0x37564e=_0x4e612e['get'](_0x5ca2c1[0x0])||_0x5ca2c1[0x0];return _0x52b1d9['localeCompare'](_0x37564e,undefined,{'sensitivity':_0x5aca39(0xfb)});});for(const [_0x5d1766,_0x498987]of _0x3d4fec){const _0xc025b=_0x4e612e[_0x4ea41e(0x189)](_0x5d1766)||_0x5d1766;console['log'](_0x4ea41e(0x210)+_0xc025b),_0x498987['sort'](_0x5dc945);for(const _0x170c39 of _0x498987){console['log'](formatJourneyItem(_0x170c39,'\x20\x20',_0x45197c(_0x170c39['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a32_0x438e5f(0x161)]='journey:view';[a32_0x438e5f(0x224)]=a32_0x438e5f(0x19b);async['execute'](_0xc186fb){const _0x27c20e=a32_0x438e5f,{options:_0x4a7691,args:_0x3fd67a,tdx:_0x353795}=_0xc186fb,_0x39d29c=_0x3fd67a[0x0];if(!_0x39d29c)return console['error'](_0x27c20e(0x1cc)),console[_0x27c20e(0x103)](_0x27c20e(0x16f)),console[_0x27c20e(0x103)]('Options:'),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x4a7691[_0x27c20e(0x19e)]&&console[_0x27c20e(0x103)](_0x27c20e(0x13a)+_0x39d29c);const {journeyId:_0xceaf85,parentSegmentId:_0x209021}=await resolveJourneyIdFromInput(_0x39d29c,_0x4a7691,_0x353795);if(_0x4a7691[_0x27c20e(0x1bb)]){const _0x58a3ad=getConsoleNextUrl(_0x4a7691[_0x27c20e(0x218)],_0x27c20e(0x1f9)+_0x209021+'/e/'+_0xceaf85+'/j/da/je');return console['error'](a32_0x4f5289[_0x27c20e(0x1cd)]('✔')+_0x27c20e(0x164)+a32_0x4f5289[_0x27c20e(0x118)](_0x58a3ad)),openBrowser(_0x58a3ad),0x0;}const _0x48c10e=await withSpinner(_0x27c20e(0x10b),()=>_0x353795['journey'][_0x27c20e(0x14a)](_0xceaf85),{'verbose':_0x4a7691[_0x27c20e(0x19e)]}),_0x568b7e=_0x48c10e[_0x27c20e(0x174)],_0x1843d7=_0x4a7691[_0x27c20e(0x1c0)];let _0x1e170d;if(_0x1843d7)try{const _0xb5b2bc=await withSpinner(_0x27c20e(0x169),()=>_0x353795['journey'][_0x27c20e(0xfe)](_0xceaf85),{'verbose':_0x4a7691[_0x27c20e(0x19e)]});_0x1e170d=_0xb5b2bc[_0x27c20e(0x174)];}catch{_0x4a7691[_0x27c20e(0x19e)]&&console[_0x27c20e(0x103)](_0x27c20e(0x1fd));}const _0x2f76ad=getConsoleNextUrl(_0x4a7691[_0x27c20e(0x218)],_0x27c20e(0x1f9)+_0x209021+_0x27c20e(0x1b6)+_0xceaf85+_0x27c20e(0x1be)),_0x226936={'id':_0x568b7e['id'],'name':_0x568b7e[_0x27c20e(0x1ce)]['name'],'description':_0x568b7e[_0x27c20e(0x1ce)]['description'],'state':_0x568b7e[_0x27c20e(0x1ce)][_0x27c20e(0x1ef)],'paused':_0x568b7e[_0x27c20e(0x1ce)][_0x27c20e(0x1f0)],'reentry_mode':_0x568b7e[_0x27c20e(0x1ce)][_0x27c20e(0x120)],'stages':_0x568b7e['attributes'][_0x27c20e(0x199)]?.['length']||0x0,..._0x568b7e[_0x27c20e(0x1ce)][_0x27c20e(0x107)]&&{'goal':_0x568b7e['attributes'][_0x27c20e(0x107)][_0x27c20e(0x161)]},..._0x1e170d&&{'statistics':{'size':_0x1e170d[_0x27c20e(0x1fe)],'entered':_0x1e170d[_0x27c20e(0x194)],'goal_achieved':_0x1e170d['goalSize'],'completion_rate':_0x1e170d[_0x27c20e(0xff)],'exit_or_jump':_0x1e170d[_0x27c20e(0x160)],'exit_or_jump_rate':_0x1e170d[_0x27c20e(0x154)],'stages':_0x1e170d['stages']}},'url':_0x2f76ad};return await handleSingleObjectOutput(_0x226936,_0x4a7691),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a32_0x438e5f(0x161)]='journey:stats';[a32_0x438e5f(0x224)]=a32_0x438e5f(0x136);async[a32_0x438e5f(0x143)](_0xac0fd3){const _0x35a8a2=a32_0x438e5f,{options:_0x366bad,args:_0x3c8299,tdx:_0x247ef7}=_0xac0fd3,_0x4d88b5=_0x3c8299[0x0];if(!requireNameOrPath(_0x4d88b5))return 0x1;_0x366bad[_0x35a8a2(0x19e)]&&console[_0x35a8a2(0x103)](_0x35a8a2(0x13a)+_0x4d88b5);const _0xb3def2=_0x366bad,_0x1b1219=_0xb3def2['from'],_0x420cc6=_0xb3def2['to'],_0x5da5b5=_0xb3def2[_0x35a8a2(0x11b)],_0x4db23f=_0xb3def2['stage'];_0x5da5b5&&!_0x1b1219&&!_0x420cc6&&console['error'](_0x35a8a2(0x1c3));const _0x3a92eb=_0x5da5b5?withJsonFormat(_0x366bad):_0x366bad,{journeyId:_0xa919e1,journeyName:_0x2e78e5}=await resolveJourneyIdFromInput(_0x4d88b5,_0x3a92eb,_0x247ef7),_0x33d4a1=_0x1b1219||_0x420cc6?{'from':_0x1b1219,'to':_0x420cc6}:undefined,_0x3c6991=await withSpinner(_0x35a8a2(0x169),()=>Promise['all']([_0x247ef7['journey'][_0x35a8a2(0x14a)](_0xa919e1),_0x247ef7[_0x35a8a2(0x134)]['getStatistics'](_0xa919e1,_0x33d4a1)]),{'verbose':_0x3a92eb['verbose']}),[_0x4510fe,_0x4f4b48]=_0x3c6991[_0x35a8a2(0x174)];if(!_0x4f4b48||_0x4f4b48[_0x35a8a2(0x132)]===null)return console['error'](_0x35a8a2(0x13f)+_0x2e78e5),console[_0x35a8a2(0x103)](_0x35a8a2(0x172)),0x0;const _0x2f5ca1=buildStageNameMap(_0x4510fe),_0x3674f4=!!(_0x33d4a1&&_0x4f4b48[_0x35a8a2(0x19a)]?.[_0x35a8a2(0x11c)]),_0x3ec2a1={'stageNameMap':_0x2f5ca1,'hasPeriod':_0x3674f4,'includeHistory':!!_0x5da5b5};if(_0x4db23f&&_0x4f4b48['stages']){const _0xa6bba9=_0x4f4b48['stages']['find'](_0x546b6a=>{const _0x3c1c5a=_0x35a8a2,_0x26125c=_0x2f5ca1[_0x3c1c5a(0x189)](_0x546b6a['id'])??'';return _0x26125c[_0x3c1c5a(0x12e)]()===_0x4db23f[_0x3c1c5a(0x12e)]();});if(_0xa6bba9)return await handleSingleObjectOutput(formatStageStats(_0xa6bba9,_0x3ec2a1),_0x3a92eb),0x0;const _0x316ecd=_0x4f4b48[_0x35a8a2(0x175)][_0x35a8a2(0x20c)](_0x33251d=>_0x2f5ca1[_0x35a8a2(0x189)](_0x33251d['id'])??_0x33251d['id']);return console[_0x35a8a2(0x103)](_0x35a8a2(0xfd)+_0x4db23f+_0x35a8a2(0x1db)),console[_0x35a8a2(0x103)](_0x35a8a2(0x225)+_0x316ecd[_0x35a8a2(0x131)](',\x20')),0x1;}const _0x33f22b=_0x4f4b48[_0x35a8a2(0x175)]?.[_0x35a8a2(0x20c)](_0x1334e7=>formatStageStats(_0x1334e7,_0x3ec2a1)),_0x2e99d1=assembleJourneyStats(_0x4f4b48,{'from':_0x1b1219,'to':_0x420cc6,'includeHistory':_0x5da5b5});return await this[_0x35a8a2(0x20e)](_0x2e99d1,_0x33f22b??[],_0x3a92eb),0x0;}async['renderStats'](_0xfaf226,_0x168d0c,_0x352afb){const _0x6b107d=a32_0x438e5f,_0x1a98b5=_0x352afb[_0x6b107d(0x15f)]===_0x6b107d(0x204)||_0x352afb[_0x6b107d(0x15f)]===_0x6b107d(0x1da)||_0x352afb[_0x6b107d(0x204)]||_0x352afb[_0x6b107d(0x1da)];if(_0x1a98b5){_0xfaf226[_0x6b107d(0x175)]=_0x168d0c,await handleSingleObjectOutput(_0xfaf226,_0x352afb);return;}await handleSingleObjectOutput(_0xfaf226,_0x352afb);for(const _0x15b6b7 of _0x168d0c){console[_0x6b107d(0x108)](''),console[_0x6b107d(0x108)](String(a32_0x4f5289['cyan']['bold']('['+_0x15b6b7['name']+']'))+a32_0x4f5289[_0x6b107d(0x192)]('\x20'+_0x15b6b7['id']));const {id:_0x4f173c,name:_0x3e0da5,..._0x1ff97a}=_0x15b6b7;await handleSingleObjectOutput(_0x1ff97a,_0x352afb);}}}export class JourneyTrafficCommand extends BaseCommand{[a32_0x438e5f(0x161)]='journey:traffic';[a32_0x438e5f(0x224)]=a32_0x438e5f(0x17e);async[a32_0x438e5f(0x143)](_0x2082b3){const _0x4ee714=a32_0x438e5f,{options:_0x28eaaf,args:_0x862b20,tdx:_0x230d50}=_0x2082b3,_0x37198e=_0x862b20[0x0];if(!requireNameOrPath(_0x37198e))return 0x1;_0x28eaaf[_0x4ee714(0x19e)]&&console[_0x4ee714(0x103)](_0x4ee714(0x13a)+_0x37198e);const _0x570533=_0x28eaaf,_0x4744e2=_0x570533[_0x4ee714(0x11a)],_0x943b44=_0x570533[_0x4ee714(0x162)],_0x4cdb60=_0x570533['to'],_0x20400c=_0x570533[_0x4ee714(0x109)];if(_0x4744e2&&_0x4744e2!==_0x4ee714(0x1c5)&&_0x4744e2!==_0x4ee714(0x150))return console[_0x4ee714(0x103)](_0x4ee714(0x211)+_0x4744e2+_0x4ee714(0x144)),0x1;const _0x4d014d=withJsonFormat(_0x28eaaf),{journeyId:_0x3b7d68,journeyName:_0x36273e}=await resolveJourneyIdFromInput(_0x37198e,_0x4d014d,_0x230d50),_0x2a6097={'type':_0x4744e2,'from':_0x943b44,'to':_0x4cdb60,'limit':_0x20400c},_0xec6f2e=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x230d50[_0x4ee714(0x134)]['getTrafficData'](_0x3b7d68,_0x2a6097),{'verbose':_0x4d014d[_0x4ee714(0x19e)]}),_0x487fbc=_0xec6f2e[_0x4ee714(0x174)],_0x28ac7f=_0x487fbc[_0x4ee714(0x1c5)]&&(_0x487fbc[_0x4ee714(0x1c5)][_0x4ee714(0x1ab)][_0x4ee714(0x11c)]>0x0||_0x487fbc[_0x4ee714(0x1c5)][_0x4ee714(0x1b0)]['length']>0x0),_0xe00576=_0x487fbc[_0x4ee714(0x150)]&&_0x487fbc['activation'][_0x4ee714(0x11c)]>0x0;if(!_0x28ac7f&&!_0xe00576)return console['error'](_0x4ee714(0x12a)+_0x36273e),console[_0x4ee714(0x103)](_0x4ee714(0x1d6)),_0x943b44&&_0x4cdb60&&console['error'](_0x4ee714(0x10d)),0x0;return await handleSingleObjectOutput(_0x487fbc,_0x4d014d),0x0;}}function formatStageStats(_0x56fd6c,_0x15b775){const _0x1eec02=a32_0x438e5f,_0x28a3=_0x15b775['hasPeriod']&&_0x56fd6c[_0x1eec02(0x19a)]?.[_0x1eec02(0x11c)]?aggregateStageHistory(_0x56fd6c[_0x1eec02(0x19a)]):{'size':_0x56fd6c[_0x1eec02(0x1fe)],'entered':_0x56fd6c[_0x1eec02(0x194)],'milestone':_0x56fd6c[_0x1eec02(0x13d)],'milestone_rate':_0x56fd6c['completeMilestoneRate'],'exit_or_jump':_0x56fd6c[_0x1eec02(0x160)],'exit_or_jump_rate':_0x56fd6c[_0x1eec02(0x154)]},_0x2a9793={'id':_0x56fd6c['id'],'name':_0x15b775[_0x1eec02(0x17d)][_0x1eec02(0x189)](_0x56fd6c['id'])??_0x56fd6c['id'],..._0x28a3};return _0x15b775[_0x1eec02(0x155)]&&_0x15b775[_0x1eec02(0x11b)]&&_0x56fd6c[_0x1eec02(0x19a)]&&(_0x2a9793[_0x1eec02(0x19a)]=_0x56fd6c[_0x1eec02(0x19a)]),_0x2a9793;}export class JourneyPauseCommand extends BaseCommand{['name']=a32_0x438e5f(0x117);[a32_0x438e5f(0x224)]=a32_0x438e5f(0x1ba);async[a32_0x438e5f(0x143)](_0x1bbaf9){const _0x37f4b3=a32_0x438e5f,{options:_0x5c8f0c,args:_0x3a3856,tdx:_0x5c9718}=_0x1bbaf9,_0x14adf7=_0x3a3856[0x0];if(!requireNameOrPath(_0x14adf7))return 0x1;_0x5c8f0c[_0x37f4b3(0x19e)]&&console[_0x37f4b3(0x103)](_0x37f4b3(0x13a)+_0x14adf7);const {journeyId:_0x554938,journeyName:_0x596b5a}=await resolveJourneyIdFromInput(_0x14adf7,_0x5c8f0c,_0x5c9718);if(!_0x5c8f0c[_0x37f4b3(0x191)]){const _0x4c3931=await confirm(_0x37f4b3(0x1f2)+_0x596b5a+'\x22?');if(!_0x4c3931)return console[_0x37f4b3(0x103)](_0x37f4b3(0x1b3)),0x0;}const _0x4f4b15=await withSpinner('Pausing\x20journey...',()=>_0x5c9718[_0x37f4b3(0x134)]['pause'](_0x554938),{'verbose':_0x5c8f0c['verbose']}),_0x20c972=_0x4f4b15[_0x37f4b3(0x174)];return console['error'](_0x37f4b3(0x15b)+_0x20c972[_0x37f4b3(0x1ce)][_0x37f4b3(0x161)]+_0x37f4b3(0x10f)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a32_0x438e5f(0x161)]='journey:run';['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a32_0x438e5f(0x143)](_0x2e9653){const _0x47ce29=a32_0x438e5f,{options:_0x5c044a,args:_0x3b657f,tdx:_0x34adb8}=_0x2e9653,_0x1ae616=_0x3b657f[0x0];if(!requireNameOrPath(_0x1ae616))return 0x1;_0x5c044a[_0x47ce29(0x19e)]&&console[_0x47ce29(0x103)](_0x47ce29(0x13a)+_0x1ae616);const {journeyId:_0x17014e,journeyName:_0x1ae985}=await resolveJourneyIdFromInput(_0x1ae616,_0x5c044a,_0x34adb8);if(_0x5c044a[_0x47ce29(0x1e0)])return await this[_0x47ce29(0x145)](_0x2e9653,_0x17014e,_0x1ae985);if(!_0x5c044a[_0x47ce29(0x191)]){const _0xc4b4e7=await confirm('Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22'+_0x1ae985+'\x22?');if(!_0xc4b4e7)return console[_0x47ce29(0x103)](_0x47ce29(0x1b3)),0x0;}const _0x372c28=await withSpinner('Triggering\x20journey\x20workflow...',()=>_0x34adb8[_0x47ce29(0x134)][_0x47ce29(0x125)](_0x17014e),{'verbose':_0x5c044a[_0x47ce29(0x19e)]}),_0xdd8c0e=_0x372c28[_0x47ce29(0x174)],_0xf3d56b=getWorkflowSessionUrl(_0x5c044a[_0x47ce29(0x218)],_0xdd8c0e[_0x47ce29(0x188)],_0xdd8c0e['workflowSessionId']);return console[_0x47ce29(0x103)]('\x0a'+a32_0x4f5289[_0x47ce29(0x1cd)]('✔')+_0x47ce29(0x11f)),console['error']('\x20\x20'+a32_0x4f5289[_0x47ce29(0x192)](_0x47ce29(0x1ac))+'\x20'+_0x1ae985),console[_0x47ce29(0x103)]('\x20\x20'+a32_0x4f5289[_0x47ce29(0x192)](_0x47ce29(0x11e))+'\x20'+_0xdd8c0e[_0x47ce29(0x21f)]),console[_0x47ce29(0x103)]('\x20\x20'+a32_0x4f5289[_0x47ce29(0x192)](_0x47ce29(0x19f))+'\x20'+_0xdd8c0e[_0x47ce29(0x159)]),console[_0x47ce29(0x103)]('\x20\x20'+_0xf3d56b),0x0;}async[a32_0x438e5f(0x145)](_0x1ecc8c,_0x3bede3,_0x3f0e26){const _0x1505ba=a32_0x438e5f,{options:_0x158f01,tdx:_0x5b6f95}=_0x1ecc8c,_0x1f2ca6=await withSpinner('Fetching\x20journey\x20'+_0x3f0e26+'...',()=>Promise[_0x1505ba(0x110)]([_0x5b6f95[_0x1505ba(0x134)][_0x1505ba(0x14a)](_0x3bede3),_0x5b6f95[_0x1505ba(0x134)][_0x1505ba(0x14e)](_0x3bede3)]),{'verbose':_0x158f01[_0x1505ba(0x19e)]}),[_0xdb66e7,_0x554c78]=_0x1f2ca6[_0x1505ba(0x174)],_0x47ff08=_0xdb66e7['attributes'],_0xd47b9b=_0x47ff08[_0x1505ba(0x199)];console[_0x1505ba(0x108)](a32_0x4f5289['bold'](_0x1505ba(0x1ac)),_0x47ff08[_0x1505ba(0x161)]),console[_0x1505ba(0x108)](a32_0x4f5289['bold']('ID:'),_0xdb66e7['id']),console[_0x1505ba(0x108)](a32_0x4f5289['bold'](_0x1505ba(0x173)),_0x47ff08[_0x1505ba(0x1ef)]),console[_0x1505ba(0x108)](a32_0x4f5289['bold']('Paused:'),_0x47ff08[_0x1505ba(0x1f0)]?a32_0x4f5289[_0x1505ba(0x1cf)]('yes'):a32_0x4f5289['green']('no')),console[_0x1505ba(0x108)](a32_0x4f5289[_0x1505ba(0x1c4)](_0x1505ba(0x138)),_0x47ff08[_0x1505ba(0x1a3)]);const _0x167e4e=_0xd47b9b['length']>0x0?'\x20('+_0xd47b9b[_0x1505ba(0x20c)](_0x4c75df=>_0x4c75df[_0x1505ba(0x161)])[_0x1505ba(0x131)](',\x20')+')':'';console[_0x1505ba(0x108)](a32_0x4f5289['bold'](_0x1505ba(0x17b)),''+_0xd47b9b['length']+_0x167e4e),console['log']('');if(_0x554c78['length']===0x0)console['log'](a32_0x4f5289['bold'](_0x1505ba(0x129)),a32_0x4f5289[_0x1505ba(0x192)](_0x1505ba(0x202)));else{console['log'](a32_0x4f5289['bold'](_0x1505ba(0x129)));for(const _0x58a0d8 of _0x554c78){const _0x1b5fe7=_0x58a0d8[_0x1505ba(0x161)]??_0x1505ba(0x223),_0x313a2e=_0x58a0d8['connectionId']!=null?_0x1505ba(0x1b5)+_0x58a0d8[_0x1505ba(0x124)]:'no\x20connection',_0x458b72=_0x58a0d8[_0x1505ba(0x112)]?''+_0x58a0d8['scheduleType']+(_0x58a0d8[_0x1505ba(0x183)]?_0x1505ba(0x21d)+_0x58a0d8[_0x1505ba(0x183)]:''):_0x1505ba(0x137),_0x9e106e=_0x58a0d8[_0x1505ba(0x1e9)]?_0x1505ba(0x1de):'';console[_0x1505ba(0x108)]('\x20\x20'+a32_0x4f5289[_0x1505ba(0x1cf)](_0x1505ba(0x1d5))+'\x20'+_0x1b5fe7+_0x1505ba(0x219)+_0x313a2e+',\x20schedule:\x20'+_0x458b72+_0x9e106e);}}return console[_0x1505ba(0x108)](a32_0x4f5289[_0x1505ba(0x1cf)]('\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.')),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a32_0x438e5f(0x161)]=a32_0x438e5f(0x21a);[a32_0x438e5f(0x224)]=a32_0x438e5f(0x11d);async[a32_0x438e5f(0x143)](_0xac4e31){const _0x3d8da0=a32_0x438e5f,{options:_0x451bfc,args:_0x2ff739,tdx:_0x1d1f37}=_0xac4e31,_0x2ba23e=_0x2ff739[0x0];if(!requireNameOrPath(_0x2ba23e))return 0x1;_0x451bfc[_0x3d8da0(0x19e)]&&console[_0x3d8da0(0x103)](_0x3d8da0(0x13a)+_0x2ba23e);const {journeyId:_0x5621da,journeyName:_0x26448c}=await resolveJourneyIdFromInput(_0x2ba23e,_0x451bfc,_0x1d1f37);if(_0x451bfc[_0x3d8da0(0x1e0)])return await this[_0x3d8da0(0x145)](_0xac4e31,_0x5621da,_0x26448c);if(!_0x451bfc[_0x3d8da0(0x191)]){const _0x2d8dad=await confirm(_0x3d8da0(0x142)+_0x26448c+'\x22?');if(!_0x2d8dad)return console[_0x3d8da0(0x103)]('Cancelled'),0x0;}const _0x1417dc=await withSpinner(_0x3d8da0(0x1b7),()=>_0x1d1f37[_0x3d8da0(0x134)][_0x3d8da0(0x1c2)](_0x5621da),{'verbose':_0x451bfc[_0x3d8da0(0x19e)]}),_0x3b2211=_0x1417dc[_0x3d8da0(0x174)];return console[_0x3d8da0(0x103)]('✔\x20Journey\x20\x22'+_0x3b2211['attributes']['name']+_0x3d8da0(0x1d1)),0x0;}async[a32_0x438e5f(0x145)](_0x1dfdf7,_0x4c7675,_0x1b06ce){const _0x59c137=a32_0x438e5f,{options:_0xec1a05,tdx:_0x3c1d83}=_0x1dfdf7,_0x22a087=await withSpinner(_0x59c137(0x102)+_0x1b06ce+_0x59c137(0x203),()=>Promise[_0x59c137(0x110)]([_0x3c1d83['journey'][_0x59c137(0x14a)](_0x4c7675),_0x3c1d83[_0x59c137(0x134)][_0x59c137(0x14e)](_0x4c7675)]),{'verbose':_0xec1a05[_0x59c137(0x19e)]}),[_0x497db6,_0x552b4e]=_0x22a087[_0x59c137(0x174)],_0x469229=_0x497db6['attributes'],_0x4f75e8=_0x469229['journeyStages'];console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)](_0x59c137(0x1ac)),_0x469229[_0x59c137(0x161)]),console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)](_0x59c137(0x17c)),_0x497db6['id']),console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)](_0x59c137(0x173)),_0x469229[_0x59c137(0x1ef)]),console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)](_0x59c137(0x182)),_0x469229[_0x59c137(0x1f0)]?a32_0x4f5289['yellow']('yes'):a32_0x4f5289[_0x59c137(0x1cd)]('no'));_0x469229[_0x59c137(0x1f7)]&&console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)](_0x59c137(0x18c)),_0x469229[_0x59c137(0x1f7)]);console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)](_0x59c137(0x138)),_0x469229[_0x59c137(0x1a3)]);const _0x288fb0=_0x4f75e8[_0x59c137(0x11c)]>0x0?'\x20('+_0x4f75e8[_0x59c137(0x20c)](_0x72f59b=>_0x72f59b[_0x59c137(0x161)])[_0x59c137(0x131)](',\x20')+')':'';console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)]('Stages:'),''+_0x4f75e8['length']+_0x288fb0),console[_0x59c137(0x108)]('');if(_0x552b4e[_0x59c137(0x11c)]===0x0)console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)](_0x59c137(0x129)),a32_0x4f5289[_0x59c137(0x192)](_0x59c137(0x202)));else{console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1c4)](_0x59c137(0x129)));for(const _0x21eae2 of _0x552b4e){const _0x408ffd=_0x21eae2[_0x59c137(0x161)]??_0x59c137(0x223),_0x7ee0da=_0x21eae2['connectionId']!=null?_0x59c137(0x1b5)+_0x21eae2[_0x59c137(0x124)]:_0x59c137(0x128),_0x47d00f=_0x21eae2[_0x59c137(0x112)]?''+_0x21eae2[_0x59c137(0x112)]+(_0x21eae2[_0x59c137(0x183)]?_0x59c137(0x21d)+_0x21eae2[_0x59c137(0x183)]:''):'none',_0x1e8a6c=_0x21eae2[_0x59c137(0x1e9)]?'\x20[runs\x20on\x20refresh]':'';console['log']('\x20\x20'+a32_0x4f5289[_0x59c137(0x1cf)](_0x59c137(0x1d5))+'\x20'+_0x408ffd+_0x59c137(0x219)+_0x7ee0da+_0x59c137(0x195)+_0x47d00f+_0x1e8a6c);}}return console[_0x59c137(0x108)](a32_0x4f5289[_0x59c137(0x1cf)](_0x59c137(0x14b))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a32_0x438e5f(0x161)]='journey:pull';[a32_0x438e5f(0x224)]=a32_0x438e5f(0x151);async['execute'](_0x242756){const _0x188210=a32_0x438e5f,{options:_0x4c7ac6,args:_0x268d45,tdx:_0x1908a7}=_0x242756,_0x58590e=_0x4c7ac6,_0x3ebe24=_0x268d45[0x0],_0x58f9f6=_0x3ebe24&&isYamlFilePath(_0x3ebe24),_0x343f96=await resolveTarget({'arg':_0x58f9f6?_0x3ebe24:undefined,'contextParent':_0x4c7ac6['parentSegment'],'cwd':process[_0x188210(0x198)]()});if(!isSuccessfulResolution(_0x343f96))return _0x343f96[_0x188210(0x149)]===_0x188210(0x1ca)?(console['error'](a32_0x4f5289[_0x188210(0x1cf)](_0x188210(0x104))),console[_0x188210(0x103)](_0x188210(0x127)),console['error'](_0x188210(0x181)),console[_0x188210(0x103)](_0x188210(0x152)),console[_0x188210(0x103)](_0x188210(0x1b9))):(console['error'](a32_0x4f5289[_0x188210(0x1c6)]('Error:\x20'+_0x343f96[_0x188210(0x1a2)]+'\x0a')),_0x343f96[_0x188210(0x12c)]&&console['error'](a32_0x4f5289[_0x188210(0x118)](_0x343f96['helpText']))),0x1;let _0x5736f3=_0x58f9f6?undefined:_0x3ebe24,_0xb0716a,_0x86d10c;_0x343f96[_0x188210(0x11a)]===_0x188210(0x1d9)&&(_0x5736f3=_0x343f96[_0x188210(0x1aa)],_0xb0716a=_0x343f96[_0x188210(0x206)],_0x86d10c=_0x343f96[_0x188210(0x1a6)]);const _0x318ecd=_0x343f96[_0x188210(0x1e8)],_0xcac527=_0x343f96[_0x188210(0x116)];_0x58590e[_0x188210(0x19e)]&&(console['error']('Parent\x20segment:\x20'+_0x318ecd),console['error'](_0x188210(0x146)+_0xcac527),_0x5736f3&&console[_0x188210(0x103)](_0x188210(0x1af)+_0x5736f3),_0xb0716a&&console[_0x188210(0x103)]('Target\x20file:\x20'+_0xb0716a),_0x86d10c&&console[_0x188210(0x103)](_0x188210(0x1ea)+_0x86d10c));const _0x15aa5d=await withSpinner(_0x188210(0x1c9),()=>_0x1908a7[_0x188210(0x111)][_0x188210(0x113)](_0x318ecd),{'verbose':_0x4c7ac6[_0x188210(0x19e)]}),_0x179c2c=_0x15aa5d[_0x188210(0x174)],{journeys:_0x435428,folders:_0x47f32c}=await withSpinner(_0x188210(0x167),async()=>{const _0x57bf02=_0x188210,[_0x1bf356,_0x537803]=await Promise[_0x57bf02(0x110)]([_0x1908a7[_0x57bf02(0x134)]['listJourneysFromParentSegment'](_0x179c2c,undefined,{'includeAllVersions':!![]}),_0x1908a7[_0x57bf02(0x111)]['listFolders'](_0x179c2c)]);return{'journeys':_0x1bf356,'folders':_0x537803};},{'verbose':_0x4c7ac6['verbose']})[_0x188210(0x205)](_0xa316a2=>_0xa316a2[_0x188210(0x174)]);let _0x382750=_0x435428;const _0x4e68ec=buildFolderIdToPathMap(_0x47f32c);if(_0x5736f3){const _0x53ef69=_0x382750[_0x188210(0x135)](_0x13367a=>_0x13367a[_0x188210(0x212)][_0x188210(0x12e)]()===_0x5736f3[_0x188210(0x12e)]());if(_0x53ef69[_0x188210(0x11c)]===0x0)return console['error'](_0x188210(0x1e7)+_0x5736f3),console[_0x188210(0x103)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x382750=_0x53ef69;}if(_0x86d10c!==undefined){const _0x18f4e0=_0x382750[_0x188210(0x135)](_0x5a0b5a=>{const _0x51eb70=_0x188210,_0x5e4ce6=_0x5a0b5a['folderId']?_0x4e68ec['get'](_0x5a0b5a[_0x51eb70(0x18f)])||'':'';return _0x5e4ce6===_0x86d10c;});if(_0x18f4e0[_0x188210(0x11c)]===0x0&&_0x382750[_0x188210(0x11c)]>0x0){console[_0x188210(0x103)](_0x188210(0xfc)+_0x5736f3+_0x188210(0x166)+(_0x86d10c||_0x188210(0x222))),console[_0x188210(0x103)](_0x188210(0x220));for(const _0x4f9f38 of _0x382750){const _0x4fa281=_0x4f9f38[_0x188210(0x18f)]?_0x4e68ec['get'](_0x4f9f38['folderId'])||'':'';console[_0x188210(0x103)](_0x188210(0x1f1)+(_0x4fa281||_0x188210(0x1d8))+'/'+_0x4f9f38[_0x188210(0x212)]);}return 0x1;}_0x382750=_0x18f4e0;}if(_0x382750[_0x188210(0x11c)]===0x0)return console[_0x188210(0x103)](_0x188210(0x1bc)),0x0;const _0x984503=new Map();for(const _0x3a485e of _0x382750){const _0x13f768=_0x3a485e[_0x188210(0x215)];!_0x984503[_0x188210(0x19c)](_0x13f768)&&_0x984503['set'](_0x13f768,[]),_0x984503[_0x188210(0x189)](_0x13f768)[_0x188210(0x1f6)](_0x3a485e);}for(const _0x20a699 of _0x984503['values']()){_0x20a699[_0x188210(0x227)]((_0x1a3ced,_0x17deec)=>(_0x1a3ced['versionNumber']||0x0)-(_0x17deec[_0x188210(0x15e)]||0x0));}const _0x1699bc=[],{idToEmailMap:_0x3c51de,connectionIdToNameMap:_0x473b0a}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x2b82e3=_0x188210,[_0x304b83,_0x3fb7a7]=await Promise[_0x2b82e3(0x110)]([_0x1908a7[_0x2b82e3(0x20b)]['buildIdToEmailMap'](),_0x1908a7[_0x2b82e3(0x1e5)][_0x2b82e3(0x18b)]()]);return{'idToEmailMap':_0x304b83,'connectionIdToNameMap':_0x3fb7a7};},{'verbose':_0x4c7ac6[_0x188210(0x19e)]})[_0x188210(0x205)](_0x476bcb=>_0x476bcb[_0x188210(0x174)]);for(const _0x38f8ad of _0x984503[_0x188210(0x20a)]()){const _0x2441dc=_0x38f8ad[0x0][_0x188210(0x212)],_0x40b13a=_0x38f8ad[0x0][_0x188210(0x18f)],_0x4fca46=_0x40b13a?_0x4e68ec[_0x188210(0x189)](_0x40b13a)||'':'',_0x10e7c3=_0x4fca46?a32_0x708177[_0x188210(0x131)](_0xcac527,_0x4fca46):_0xcac527,_0x3ce963=_0xb0716a||a32_0x708177[_0x188210(0x131)](_0x10e7c3,sanitizeFileName(_0x2441dc)+_0x188210(0x18d));let _0x5c6beb,_0x9fd09e;if(existsSync(_0x3ce963))try{const _0x3860ca=readFileSync(_0x3ce963,_0x188210(0x20d)),_0x36e813=parseYamlString(_0x3860ca);_0x9fd09e=_0x36e813,_0x5c6beb=buildRuleToNameMapping(_0x36e813),_0x58590e[_0x188210(0x19e)]&&_0x5c6beb['size']>0x0&&console[_0x188210(0x103)]('Found\x20'+_0x5c6beb[_0x188210(0x1fe)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x2441dc);}catch(_0xcc720b){_0x58590e[_0x188210(0x19e)]&&console[_0x188210(0x103)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0xcc720b[_0x188210(0x1a2)]);}const _0x44249d=[],_0x28c2c4=new Set(),_0x52edac=new Map(),_0x54e950=new Map(),_0x317920=new Set(),_0x167f7=new Map(),_0x834833=new Map(),_0x341482=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x2441dc+'...',async _0x190464=>{const _0x157d80=_0x188210;for(const _0xd50b06 of _0x38f8ad){const _0x40650d=_0x38f8ad['length']>0x1?_0xd50b06[_0x157d80(0x212)]+'\x20v'+(_0xd50b06[_0x157d80(0x15e)]||0x1):_0xd50b06[_0x157d80(0x212)];_0x190464[_0x157d80(0x177)]('Fetching\x20'+_0x40650d);const _0x5a2d01=await _0x1908a7['journey']['getJourney'](_0xd50b06['id']),_0x5ca107=_0x5a2d01[_0x157d80(0x1ce)]?.[_0x157d80(0x1a3)],_0x51a631={'resolveSegment':async _0x469eb0=>{const _0x58f79f=_0x157d80;if(!_0x5ca107)return{'name':_0x469eb0,'isJourneyLocal':![]};const _0x23e239=_0x52edac[_0x58f79f(0x189)](_0x469eb0);if(_0x23e239)return _0x23e239;try{const _0x3831c2=await _0x1908a7[_0x58f79f(0x111)]['getSegment'](_0x5ca107,_0x469eb0),_0x4dbf1e=_0x3831c2[_0x58f79f(0x1ae)]===SEGMENT_KIND_JOURNEY;let _0x45a930,_0x17b2a1=_0x3831c2[_0x58f79f(0x161)];if(_0x4dbf1e&&_0x3831c2[_0x58f79f(0x21c)]){const _0x254f3e=await segmentResponseToDef(_0x3831c2,{'resolveSegmentName':async _0x59be57=>{const _0x5e56b6=_0x58f79f,_0x1f8fb9=_0x52edac[_0x5e56b6(0x189)](_0x59be57);if(_0x1f8fb9)return _0x1f8fb9[_0x5e56b6(0x161)];const _0x46dd51=await _0x51a631[_0x5e56b6(0x17a)](_0x59be57);return _0x46dd51[_0x5e56b6(0x161)];}}),_0x32da8a=_0x254f3e[_0x58f79f(0x21c)];_0x45a930={'description':_0x3831c2[_0x58f79f(0x224)],'rule':_0x32da8a};const _0x9861c4=serializeRule(_0x32da8a),_0x8d3e5b=_0x54e950[_0x58f79f(0x189)](_0x9861c4);if(_0x8d3e5b)_0x17b2a1=_0x8d3e5b,_0x45a930=undefined,_0x58590e[_0x58f79f(0x19e)]&&console['error'](_0x58f79f(0x228)+_0x3831c2[_0x58f79f(0x161)]+'\x20->\x20'+_0x8d3e5b);else{let _0x274d6b=![];if(_0x5c6beb){const _0x4654c5=_0x5c6beb['get'](_0x9861c4);if(_0x4654c5){const _0x4a20b2=_0x4654c5[_0x58f79f(0x147)](_0x25292b=>!_0x28c2c4[_0x58f79f(0x19c)](_0x25292b));_0x4a20b2&&(_0x17b2a1=_0x4a20b2,_0x28c2c4['add'](_0x4a20b2),_0x54e950[_0x58f79f(0x196)](_0x9861c4,_0x4a20b2),_0x274d6b=!![],_0x58590e[_0x58f79f(0x19e)]&&console[_0x58f79f(0x103)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x4a20b2+_0x58f79f(0x20f)));}}if(!_0x274d6b){const _0x53bc61=generateJourneyLocalName(_0x3831c2['name']);_0x53bc61&&(_0x17b2a1=_0x53bc61);let _0x48ccbb=_0x17b2a1,_0x222abc=0x2;while(_0x28c2c4[_0x58f79f(0x19c)](_0x48ccbb)){_0x48ccbb=_0x17b2a1+'_'+_0x222abc,_0x222abc++;}_0x28c2c4['add'](_0x48ccbb),_0x54e950[_0x58f79f(0x196)](_0x9861c4,_0x48ccbb),_0x17b2a1=_0x48ccbb;}}}const _0x29ae48={'name':_0x17b2a1,'isJourneyLocal':_0x4dbf1e,'definition':_0x45a930};return _0x52edac['set'](_0x469eb0,_0x29ae48),_0x29ae48;}catch(_0xe08fdf){return _0x4c7ac6[_0x58f79f(0x19e)]&&console['error'](_0x58f79f(0x190)+_0x469eb0+':\x20'+_0xe08fdf[_0x58f79f(0x1a2)]),{'name':_0x469eb0,'isJourneyLocal':![]};}},'resolveActivation':async _0x3f3130=>{const _0x439e4c=_0x157d80,_0x53bf5a=_0x167f7[_0x439e4c(0x189)](_0x3f3130);if(_0x53bf5a)return _0x53bf5a;try{const _0x278289=await _0x1908a7['journey'][_0x439e4c(0x133)](_0xd50b06['id'],_0x3f3130),_0x5b7865=journeyActivationStepToYaml(_0x278289,_0x3c51de,_0x473b0a),_0x288cfd=JSON[_0x439e4c(0x1d0)]({'name':_0x5b7865[_0x439e4c(0x161)],'connection':_0x5b7865[_0x439e4c(0x1e5)],'connector_config':_0x5b7865[_0x439e4c(0x1a5)]}),_0x2b69f8=_0x834833[_0x439e4c(0x189)](_0x288cfd);if(_0x2b69f8){const _0x5d47cb={'name':_0x2b69f8,'isJourneyLocal':!![],'definition':_0x5b7865};return _0x167f7['set'](_0x3f3130,_0x5d47cb),_0x5d47cb;}const _0x362e26=_0x278289[_0x439e4c(0x1ce)][_0x439e4c(0x106)][_0x439e4c(0x161)]||_0x3f3130,_0x13b792=sanitizeYamlKey(_0x362e26)||_0x439e4c(0x197)+_0x3f3130;let _0x3d8bec=_0x13b792,_0x3aef0e=0x2;while(_0x317920[_0x439e4c(0x19c)](_0x3d8bec)){_0x3d8bec=_0x13b792+'_'+_0x3aef0e,_0x3aef0e++;}_0x317920['add'](_0x3d8bec),_0x834833[_0x439e4c(0x196)](_0x288cfd,_0x3d8bec);const _0x32d929={'name':_0x3d8bec,'isJourneyLocal':!![],'definition':_0x5b7865};return _0x167f7[_0x439e4c(0x196)](_0x3f3130,_0x32d929),_0x32d929;}catch(_0x461e17){return _0x4c7ac6[_0x439e4c(0x19e)]&&console[_0x439e4c(0x103)](_0x439e4c(0x1bf)+_0x3f3130+':\x20'+_0x461e17['message']),{'name':_0x3f3130,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5bbe03,_0x57b39c)=>{const _0x3fa428=_0x157d80;return resolveJumpTarget(_0x5bbe03,_0x57b39c,_0x341482,_0x40e859=>_0x1908a7[_0x3fa428(0x134)]['getJourney'](_0x40e859));}},_0x4c58c9=await journeyResponseToDef(_0x5a2d01,_0x51a631);_0x44249d[_0x157d80(0x1f6)]({'item':_0xd50b06,'yaml':_0x4c58c9});}},{'verbose':_0x4c7ac6[_0x188210(0x19e)]});const _0x5ce598=await _0x1908a7['journey'][_0x188210(0x226)](_0x38f8ad[0x0]['journeyBundleId']),_0x9fa5d1=buildMergedJourneyDef(_0x44249d,_0x5c6beb,_0x5ce598),_0x398c33=normalizeJourneyDef(_0x9fa5d1,_0x9fd09e),_0xbc4483=toYamlString(_0x398c33),_0x4c97eb=_0xb0716a||a32_0x708177['join'](_0x10e7c3,sanitizeFileName(_0x2441dc)+_0x188210(0x18d));!_0xb0716a&&_0x4fca46&&!existsSync(_0x10e7c3)&&mkdirSync(_0x10e7c3,{'recursive':!![]});const _0x3a0181=a32_0x708177[_0x188210(0x1d3)](process['cwd'](),_0x4c97eb);if(existsSync(_0x4c97eb)){const _0x4ad1d1=readFileSync(_0x4c97eb,_0x188210(0x20d)),_0x579e33=generateDiff(_0x4ad1d1,_0xbc4483),_0x3a21f9=hasChanges(_0x579e33);_0x1699bc[_0x188210(0x1f6)]({'relativePath':_0x3a0181,'absolutePath':_0x4c97eb,'content':_0xbc4483,'isNew':![],'hasChanges':_0x3a21f9,'diff':_0x3a21f9?formatDiffWithColors(_0x579e33):undefined});}else _0x1699bc[_0x188210(0x1f6)]({'relativePath':_0x3a0181,'absolutePath':_0x4c97eb,'content':_0xbc4483,'isNew':!![],'hasChanges':![]});}const _0x44e07b=_0x1699bc[_0x188210(0x135)](_0x2e4ee0=>_0x2e4ee0[_0x188210(0x1b2)]),_0x28ffc7=_0x1699bc[_0x188210(0x135)](_0x2bc627=>!_0x2bc627[_0x188210(0x1b2)]&&_0x2bc627[_0x188210(0x158)]),_0x1b1e8c=_0x1699bc['filter'](_0x21c56c=>!_0x21c56c[_0x188210(0x1b2)]&&!_0x21c56c[_0x188210(0x158)]),_0x3a3803=_0x382750[_0x188210(0x11c)],_0x3c0b6a=_0x984503[_0x188210(0x1fe)],_0x28cdf5=_0x3a3803>_0x3c0b6a?'\x20('+_0x3a3803+_0x188210(0x126):'';console[_0x188210(0x103)](_0x188210(0x185)),console[_0x188210(0x103)]('\x20\x20'+a32_0x4f5289[_0x188210(0x118)](_0x3c0b6a+_0x188210(0x179))+a32_0x4f5289[_0x188210(0x192)](_0x28cdf5)),console[_0x188210(0x103)]('\x20\x20'+a32_0x4f5289[_0x188210(0x1cd)]('+\x20'+_0x44e07b[_0x188210(0x11c)]+'\x20new\x20files')),console[_0x188210(0x103)]('\x20\x20'+a32_0x4f5289['yellow']('~\x20'+_0x28ffc7[_0x188210(0x11c)]+'\x20changed\x20files')),console[_0x188210(0x103)]('\x20\x20'+a32_0x4f5289[_0x188210(0x192)]('=\x20'+_0x1b1e8c[_0x188210(0x11c)]+_0x188210(0x16d))),console[_0x188210(0x103)](_0x188210(0x187)+a32_0x4f5289[_0x188210(0x118)](_0xcac527)+'\x0a');if(_0x28ffc7[_0x188210(0x11c)]>0x0)for(const _0x3233bd of _0x28ffc7){console[_0x188210(0x103)]('\x0aChanges\x20to\x20\x27'+_0x3233bd[_0x188210(0x13c)]+'\x27:'),console[_0x188210(0x103)]('─'[_0x188210(0x14c)](0x3c)),console['error'](_0x3233bd[_0x188210(0x1dd)]),console[_0x188210(0x103)]('─'[_0x188210(0x14c)](0x3c));}if(_0x58590e[_0x188210(0x1e0)])return console[_0x188210(0x103)](a32_0x4f5289[_0x188210(0x1cf)](_0x188210(0x201))),0x0;if(_0x44e07b[_0x188210(0x11c)]===0x0&&_0x28ffc7[_0x188210(0x11c)]===0x0)return console[_0x188210(0x103)](a32_0x4f5289[_0x188210(0x1cd)](_0x188210(0x12b))),saveSessionContext({'parent_segment':_0x318ecd},_0x58590e[_0x188210(0x170)]),console[_0x188210(0x103)](a32_0x4f5289[_0x188210(0x1cd)](_0x188210(0x148)+a32_0x4f5289[_0x188210(0x192)]('parent_segment')+_0x188210(0x1d7)+a32_0x4f5289[_0x188210(0x118)](_0x318ecd))),0x0;if(!_0x58590e[_0x188210(0x191)]&&(_0x44e07b[_0x188210(0x11c)]>0x0||_0x28ffc7['length']>0x0)){if(!isInteractive())return console[_0x188210(0x103)](a32_0x4f5289['red']('\x0aError:'),_0x188210(0x176)),console[_0x188210(0x103)](a32_0x4f5289[_0x188210(0x192)](_0x188210(0x1ad))),0x1;const _0x1f1d53=await confirmKey(_0x188210(0x1b4)+(_0x44e07b[_0x188210(0x11c)]+_0x28ffc7[_0x188210(0x11c)])+_0x188210(0x208));if(!_0x1f1d53)return console[_0x188210(0x103)](a32_0x4f5289['yellow'](_0x188210(0x14d)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0xcac527)&&mkdirSync(_0xcac527,{'recursive':!![]});const _0x3f36cf=a32_0x708177[_0x188210(0x131)](_0xcac527,_0x188210(0x140));writeFileSync(_0x3f36cf,createTdxConfigContent(_0x318ecd),_0x188210(0x20d));for(const _0x5e36ac of _0x1699bc){(_0x5e36ac['isNew']||_0x5e36ac['hasChanges'])&&writeFileSync(_0x5e36ac[_0x188210(0x100)],_0x5e36ac['content'],'utf-8');}return console[_0x188210(0x103)](a32_0x4f5289[_0x188210(0x1cd)](_0x188210(0x141)+(_0x44e07b[_0x188210(0x11c)]+_0x28ffc7[_0x188210(0x11c)])+_0x188210(0x101)+_0xcac527)),saveSessionContext({'parent_segment':_0x318ecd},_0x58590e['session']),console['error'](a32_0x4f5289['green']('✔\x20Context\x20set:\x20'+a32_0x4f5289[_0x188210(0x192)](_0x188210(0x1e3))+'\x20=\x20'+a32_0x4f5289[_0x188210(0x118)](_0x318ecd))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a32_0x438e5f(0x161)]='journey:columns';['description']=a32_0x438e5f(0x184);async[a32_0x438e5f(0x143)](_0x4766db){const _0x13952c=a32_0x438e5f,{options:_0x4f97d3,args:_0x1d1f92,tdx:_0x538e52}=_0x4766db,_0x1fb83a=_0x1d1f92[0x0];if(!requireNameOrPath(_0x1fb83a))return 0x1;_0x4f97d3[_0x13952c(0x19e)]&&console[_0x13952c(0x103)]('Input:\x20'+_0x1fb83a);const {journeyId:_0x4156b8}=await resolveJourneyIdFromInput(_0x1fb83a,_0x4f97d3,_0x538e52),_0xd0029d=await withSpinner('Getting\x20column\x20mapping...',()=>_0x538e52[_0x13952c(0x134)]['getColumnMapping'](_0x4156b8),{'verbose':_0x4f97d3[_0x13952c(0x19e)]}),_0x5703a9=_0xd0029d['data'];return console[_0x13952c(0x108)](_0x13952c(0x105)+_0x5703a9[_0x13952c(0x15a)]),console['log']('Table:\x20'+_0x5703a9['table']),await handleSDKOutput(_0x5703a9[_0x13952c(0x1f8)],_0x4f97d3),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a32_0x438e5f(0x161)]='journey:activations';[a32_0x438e5f(0x224)]=a32_0x438e5f(0x1ec);async['execute'](_0x4aa308){const _0x538980=a32_0x438e5f,{options:_0x1e1544,args:_0xb5f7ed,tdx:_0x2e8f6d}=_0x4aa308,_0x4293a=_0xb5f7ed[0x0];if(!requireNameOrPath(_0x4293a))return 0x1;_0x1e1544[_0x538980(0x19e)]&&console['error'](_0x538980(0x13a)+_0x4293a);const {journeyId:_0x2007da}=await resolveJourneyIdFromInput(_0x4293a,_0x1e1544,_0x2e8f6d),_0x5ac58e=await withSpinner('Listing\x20journey\x20activations...',()=>_0x2e8f6d['journey'][_0x538980(0x14e)](_0x2007da),{'verbose':_0x1e1544[_0x538980(0x19e)]}),_0x16c57e=_0x5ac58e[_0x538980(0x174)];return console[_0x538980(0x103)](_0x538980(0x18a)+_0x16c57e['length']+_0x538980(0x1a8)+(_0x16c57e[_0x538980(0x11c)]!==0x1?'s':'')),await handleSDKOutput(_0x16c57e,_0x1e1544),0x0;}}export class JourneyPushCommand extends BaseCommand{[a32_0x438e5f(0x161)]=a32_0x438e5f(0x15c);[a32_0x438e5f(0x224)]=a32_0x438e5f(0x200);[a32_0x438e5f(0x12d)]=new SegmentPushCommand();async[a32_0x438e5f(0x143)](_0x16dfe2){const _0x2c5eff=a32_0x438e5f,_0x5d1793=_0x16dfe2[_0x2c5eff(0x1e1)][0x0];let _0x2578b4;if(_0x5d1793){const _0x5d91eb=await resolveTarget({'arg':_0x5d1793,'contextParent':_0x16dfe2[_0x2c5eff(0x1f4)]['parentSegment'],'cwd':process[_0x2c5eff(0x198)]()});isSuccessfulResolution(_0x5d91eb)&&_0x5d91eb['type']==='file'&&(_0x2578b4=_0x5d91eb[_0x2c5eff(0x206)]);}const _0x3ffe91={..._0x16dfe2,'options':{..._0x16dfe2['options'],'journeysOnly':!![],..._0x2578b4&&{'singleFilePath':_0x2578b4}}};return this[_0x2c5eff(0x12d)]['execute'](_0x3ffe91);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a32_0x438e5f(0x1fb);[a32_0x438e5f(0x224)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a32_0x438e5f(0x143)](_0x2c55a4){const _0x5c5c42=a32_0x438e5f,{options:_0x5a8442,args:_0x38511b,tdx:_0x384c15}=_0x2c55a4,_0x29e736=_0x38511b[0x0];if(!requireNameOrPath(_0x29e736))return 0x1;if(_0x5a8442['verbose'])console[_0x5c5c42(0x103)]('Input:\x20'+_0x29e736);const {journeyId:_0x4241ad}=await resolveJourneyIdFromInput(_0x29e736,_0x5a8442,_0x384c15),_0x4e6c88=await withSpinner(_0x5c5c42(0x19d),()=>_0x384c15['journey'][_0x5c5c42(0x216)](_0x4241ad),{'verbose':_0x5a8442[_0x5c5c42(0x19e)]}),{bundleName:_0x4cde99,versions:_0xe6b6e7,latestJourneyId:_0x4e2330}=_0x4e6c88[_0x5c5c42(0x174)];console[_0x5c5c42(0x103)](_0x4cde99+':\x20'+_0xe6b6e7['length']+_0x5c5c42(0x114)+(_0xe6b6e7[_0x5c5c42(0x11c)]!==0x1?'s':''));const _0x59bc17=_0xe6b6e7[_0x5c5c42(0x20c)](_0x143515=>({'version':_0x143515[_0x5c5c42(0x15e)],'journey_id':_0x143515[_0x5c5c42(0x132)],'name':_0x143515['name'],'state':_0x143515['state'],'paused':_0x143515[_0x5c5c42(0x1f0)],'latest':_0x143515['journeyId']===_0x4e2330,'created_at':_0x143515[_0x5c5c42(0x1cb)]}));return await handleSDKOutput(_0x59bc17,_0x5a8442),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a32_0x438e5f(0x161)]=a32_0x438e5f(0x21e);[a32_0x438e5f(0x224)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a32_0x438e5f(0x143)](_0x2b6e9e){const _0xceb97d=a32_0x438e5f,{options:_0xad3793,args:_0x4b49fa,tdx:_0x5ea2a5}=_0x2b6e9e,_0x3c63cb=_0x4b49fa[0x0];if(!requireNameOrPath(_0x3c63cb))return 0x1;if(_0xad3793['verbose'])console['error'](_0xceb97d(0x13a)+_0x3c63cb);const {journeyId:_0x5de6bc,journeyName:_0x454952}=await resolveJourneyIdFromInput(_0x3c63cb,_0xad3793,_0x5ea2a5);if(!_0xad3793['yes']){const _0x196265=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x454952+'\x22?');if(!_0x196265)return console['error'](_0xceb97d(0x1b3)),0x0;}const _0x29a75d=await withSpinner(_0xceb97d(0x1dc),()=>_0x5ea2a5[_0xceb97d(0x134)]['createVersion'](_0x5de6bc),{'verbose':_0xad3793[_0xceb97d(0x19e)]}),_0x5a1017=_0x29a75d[_0xceb97d(0x174)];return console['error'](a32_0x4f5289[_0xceb97d(0x1cd)]('\u2714')+_0xceb97d(0x1d4)+_0x5a1017[_0xceb97d(0x1ce)]['versionNumber']+_0xceb97d(0x180)+_0x5a1017[_0xceb97d(0x1ce)][_0xceb97d(0x161)]+'\x22'),console['error'](_0xceb97d(0x13b)+_0x5a1017['id']),await handleSingleObjectOutput({'id':_0x5a1017['id'],'name':_0x5a1017[_0xceb97d(0x1ce)]['name'],'version':_0x5a1017[_0xceb97d(0x1ce)]['versionNumber'],'state':_0x5a1017[_0xceb97d(0x1ce)][_0xceb97d(0x1ef)],'bundle_id':_0x5a1017[_0xceb97d(0x1ce)]['journeyBundleId'],'created_at':_0x5a1017[_0xceb97d(0x1ce)]['createdAt']},_0xad3793),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a32_0x438e5f(0x224)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a32_0x438e5f(0x143)](_0x3f9fc3){const _0x35433e=a32_0x438e5f,{options:_0x365072,args:_0x37f59e,tdx:_0x4f81a0}=_0x3f9fc3,_0x2ae90b=_0x37f59e[0x0];if(!requireNameOrPath(_0x2ae90b))return 0x1;const _0x220ddc=_0x365072[_0x35433e(0x16c)];if(!_0x220ddc)return console[_0x35433e(0x103)](_0x35433e(0x1c7)),console[_0x35433e(0x103)](_0x35433e(0x1fc)),0x1;const _0x5078bd=parseInt(_0x220ddc,0xa);if(isNaN(_0x5078bd)||_0x5078bd<0x1)return console[_0x35433e(0x103)](_0x35433e(0x157)+_0x220ddc),0x1;if(_0x365072[_0x35433e(0x19e)])console[_0x35433e(0x103)](_0x35433e(0x13a)+_0x2ae90b+_0x35433e(0x153)+_0x5078bd);const {journeyId:_0x1f3346,parentSegmentId:_0x115bb7}=await resolveJourneyIdFromInput(_0x2ae90b,_0x365072,_0x4f81a0),_0x459915=await withSpinner(_0x35433e(0x10c),()=>_0x4f81a0[_0x35433e(0x134)][_0x35433e(0x216)](_0x1f3346),{'verbose':_0x365072['verbose']}),{versions:_0x56b845,latestJourneyId:_0x23d7cb}=_0x459915['data'],_0x1b4ef1=_0x56b845['find'](_0x16c941=>_0x16c941[_0x35433e(0x15e)]===_0x5078bd);if(!_0x1b4ef1){const _0x3db153=_0x56b845[_0x35433e(0x20c)](_0x5e6288=>'v'+_0x5e6288[_0x35433e(0x15e)])[_0x35433e(0x131)](',\x20');return console[_0x35433e(0x103)](_0x35433e(0x115)+_0x5078bd+_0x35433e(0x10a)+_0x3db153),0x1;}const _0x83365=await withSpinner(_0x35433e(0x168)+_0x5078bd+'\x20details...',()=>_0x4f81a0['journey']['getJourney'](_0x1b4ef1[_0x35433e(0x132)]),{'verbose':_0x365072[_0x35433e(0x19e)]}),_0x14f162=_0x83365[_0x35433e(0x174)],_0x59b581=getConsoleNextUrl(_0x365072[_0x35433e(0x218)],_0x35433e(0x1f9)+_0x115bb7+_0x35433e(0x1b6)+_0x1b4ef1[_0x35433e(0x132)]+_0x35433e(0x1be));return await handleSingleObjectOutput({'id':_0x14f162['id'],'name':_0x14f162[_0x35433e(0x1ce)][_0x35433e(0x161)],'version':_0x14f162['attributes'][_0x35433e(0x15e)],'description':_0x14f162[_0x35433e(0x1ce)][_0x35433e(0x224)],'state':_0x14f162[_0x35433e(0x1ce)][_0x35433e(0x1ef)],'paused':_0x14f162[_0x35433e(0x1ce)][_0x35433e(0x1f0)],'reentry_mode':_0x14f162[_0x35433e(0x1ce)][_0x35433e(0x120)],'stages':_0x14f162[_0x35433e(0x1ce)][_0x35433e(0x199)]?.[_0x35433e(0x11c)]||0x0,..._0x14f162[_0x35433e(0x1ce)]['goal']&&{'goal':_0x14f162[_0x35433e(0x1ce)][_0x35433e(0x107)][_0x35433e(0x161)]},'latest':_0x1b4ef1[_0x35433e(0x132)]===_0x23d7cb,'created_at':_0x14f162[_0x35433e(0x1ce)]['createdAt'],'updated_at':_0x14f162['attributes']['updatedAt'],'url':_0x59b581},_0x365072),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a33_0x4c54(){const _0xc74317=['skippedCount','3HLYZnF','\x20journey(s)\x20valid','6743745xNFMCW','endsWith','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','hasErrors','.yml','Validation\x20failed:\x20','verbose','warnings','dim','\x20valid','type','2145480lbPSqc','red','\x20segment\x20file(s)\x20skipped','cyan','filePath','no_parent','\x20warning(s)\x20found','\x20warning(s)','1625855DwGXSK','relativePath','log','file','\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','valid','cwd','error','539094kdJmPx','green','Error:\x20','parentSegment','1947848mnQOzT','\x20(skipped:\x20','length','1XvGTkW','filter','No\x20journey\x20YAML\x20files\x20found\x20in\x20','Validate\x20journey\x20YAML\x20files','yellow','warningCount','invalidCount','errorCode','Error:\x20Directory\x20not\x20found:\x20','helpText','971168cdfouM','validCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','journey','name','errors','267925DPMXhv','\x20error(s)'];a33_0x4c54=function(){return _0xc74317;};return a33_0x4c54();}const a33_0x933c7a=a33_0x1b54;(function(_0x77ec6,_0x450952){const _0x22589a=a33_0x1b54,_0x443db5=_0x77ec6();while(!![]){try{const _0x492bbe=-parseInt(_0x22589a(0x1e4))/0x1*(-parseInt(_0x22589a(0x1dd))/0x2)+parseInt(_0x22589a(0x1f7))/0x3*(parseInt(_0x22589a(0x1e1))/0x4)+-parseInt(_0x22589a(0x1f4))/0x5+parseInt(_0x22589a(0x205))/0x6+parseInt(_0x22589a(0x1d5))/0x7+-parseInt(_0x22589a(0x1ee))/0x8+-parseInt(_0x22589a(0x1f9))/0x9;if(_0x492bbe===_0x450952)break;else _0x443db5['push'](_0x443db5['shift']());}catch(_0x4d4c01){_0x443db5['push'](_0x443db5['shift']());}}}(a33_0x4c54,0x670b4));function a33_0x1b54(_0x23f5d2,_0x2e192e){_0x23f5d2=_0x23f5d2-0x1d1;const _0x4c54ab=a33_0x4c54();let _0x1b541d=_0x4c54ab[_0x23f5d2];return _0x1b541d;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a33_0x5d4a85 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a33_0x933c7a(0x1f2)]='journey:validate';['description']=a33_0x933c7a(0x1e7);async['execute'](_0x4f44b3){const _0x4402cd=a33_0x933c7a,{options:_0x4f246c,args:_0x312808}=_0x4f44b3,_0x588d77=_0x4f246c,_0x3d7309=await resolveTarget({'arg':_0x312808[0x0],'contextParent':_0x4f246c[_0x4402cd(0x1e0)],'cwd':process[_0x4402cd(0x1db)]()});if(!isSuccessfulResolution(_0x3d7309))return _0x3d7309[_0x4402cd(0x1eb)]===_0x4402cd(0x1d2)?(console['error'](a33_0x5d4a85[_0x4402cd(0x1e8)](_0x4402cd(0x1fb))),console[_0x4402cd(0x1dc)](_0x4402cd(0x1fc)),console[_0x4402cd(0x1dc)](_0x4402cd(0x1d9)),console[_0x4402cd(0x1dc)](_0x4402cd(0x1f0))):(console[_0x4402cd(0x1dc)](a33_0x5d4a85[_0x4402cd(0x206)](_0x4402cd(0x1df)+_0x3d7309['message']+'\x0a')),_0x3d7309[_0x4402cd(0x1ed)]&&console[_0x4402cd(0x1dc)](a33_0x5d4a85[_0x4402cd(0x208)](_0x3d7309['helpText']))),0x1;const _0x11423b=_0x3d7309['targetDir'],_0x2e4fcb=_0x3d7309[_0x4402cd(0x204)]===_0x4402cd(0x1d8)?_0x3d7309[_0x4402cd(0x1d1)]:undefined;if(!_0x2e4fcb&&!existsSync(_0x11423b))return console[_0x4402cd(0x1dc)](a33_0x5d4a85['red'](_0x4402cd(0x1ec)+_0x11423b+'\x0a')),0x1;let _0x44148b;if(_0x2e4fcb){if(!_0x2e4fcb['endsWith'](_0x4402cd(0x1fe))&&!_0x2e4fcb[_0x4402cd(0x1fa)]('.yaml'))return console[_0x4402cd(0x1dc)](a33_0x5d4a85[_0x4402cd(0x206)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x2e4fcb+'\x0a')),0x1;_0x44148b=[_0x2e4fcb];}else _0x44148b=findYamlFiles(_0x11423b);if(_0x44148b[_0x4402cd(0x1e3)]===0x0)return console[_0x4402cd(0x1dc)](a33_0x5d4a85[_0x4402cd(0x206)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x11423b+'\x0a')),0x1;const _0x5808ab=validateYamlFiles(_0x44148b,_0x11423b,{'filterType':_0x4402cd(0x1f1)}),_0x2c85ac=calculateSummary(_0x5808ab),_0x25eeee=_0x5808ab[_0x4402cd(0x1e5)](isValidationResult);if(_0x25eeee[_0x4402cd(0x1e3)]===0x0)return console[_0x4402cd(0x1dc)](a33_0x5d4a85[_0x4402cd(0x1e8)](_0x4402cd(0x1e6)+_0x11423b+'\x0a')),_0x2c85ac[_0x4402cd(0x1f6)]>0x0&&console[_0x4402cd(0x1dc)](a33_0x5d4a85[_0x4402cd(0x202)]('('+_0x2c85ac[_0x4402cd(0x1f6)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0xe7c948 of _0x5808ab){if(!isValidationResult(_0xe7c948)){_0x588d77['verbose']&&console[_0x4402cd(0x1d7)](a33_0x5d4a85[_0x4402cd(0x202)]('-\x20'+_0xe7c948[_0x4402cd(0x1d6)]+_0x4402cd(0x1e2)+_0xe7c948['reason']+')'));continue;}const {relativePath:_0x53471b,source:_0x664985,result:_0x4d036b}=_0xe7c948;if(_0x4d036b[_0x4402cd(0x1da)]&&_0x4d036b[_0x4402cd(0x201)][_0x4402cd(0x1e3)]===0x0)_0x588d77[_0x4402cd(0x200)]&&console[_0x4402cd(0x1d7)](a33_0x5d4a85[_0x4402cd(0x1de)]('✔\x20'+_0x53471b));else _0x4d036b[_0x4402cd(0x1da)]?(console['log'](a33_0x5d4a85[_0x4402cd(0x1e8)]('⚠\x20'+_0x53471b+':\x20'+_0x4d036b[_0x4402cd(0x201)]['length']+_0x4402cd(0x1d4))),console[_0x4402cd(0x1d7)](formatValidationResult(_0x4d036b,_0x664985,_0x53471b))):(console[_0x4402cd(0x1d7)](a33_0x5d4a85['red']('✖\x20'+_0x53471b+':\x20'+_0x4d036b[_0x4402cd(0x1f3)][_0x4402cd(0x1e3)]+_0x4402cd(0x1f5))),console[_0x4402cd(0x1d7)](formatValidationResult(_0x4d036b,_0x664985,_0x53471b)));}return console['log'](''),_0x2c85ac[_0x4402cd(0x1fd)]?(console[_0x4402cd(0x1d7)](a33_0x5d4a85[_0x4402cd(0x206)](_0x4402cd(0x1ff)+_0x2c85ac[_0x4402cd(0x1ea)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x2c85ac[_0x4402cd(0x1ef)]+_0x4402cd(0x203))),_0x2c85ac[_0x4402cd(0x1e9)]>0x0&&console['log'](a33_0x5d4a85[_0x4402cd(0x1e8)](_0x2c85ac[_0x4402cd(0x1e9)]+_0x4402cd(0x1d3))),_0x2c85ac['skippedCount']>0x0&&console[_0x4402cd(0x1d7)](a33_0x5d4a85[_0x4402cd(0x202)](_0x2c85ac[_0x4402cd(0x1f6)]+_0x4402cd(0x207))),0x1):(console[_0x4402cd(0x1d7)](a33_0x5d4a85['green']('✔\x20All\x20'+_0x2c85ac[_0x4402cd(0x1ef)]+_0x4402cd(0x1f8))),_0x2c85ac[_0x4402cd(0x1e9)]>0x0&&console['log'](a33_0x5d4a85['yellow'](_0x2c85ac[_0x4402cd(0x1e9)]+_0x4402cd(0x1d3))),_0x2c85ac[_0x4402cd(0x1f6)]>0x0&&console[_0x4402cd(0x1d7)](a33_0x5d4a85[_0x4402cd(0x202)](_0x2c85ac['skippedCount']+_0x4402cd(0x207))),0x0);}}
|