@treasuredata/tdx 2026.8.0 → 2026.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.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.d.ts +9 -0
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +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.d.ts +10 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-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.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/auth-token.d.ts +23 -0
- package/dist/sdk/auth-token.d.ts.map +1 -0
- package/dist/sdk/auth-token.js +1 -0
- package/dist/sdk/auth-token.js.map +1 -0
- 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-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.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/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/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/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.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.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/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 a27_0x183692=a27_0x5690;(function(_0x70be9,_0x176897){const _0x4f8b39=a27_0x5690,_0x4af8f1=_0x70be9();while(!![]){try{const _0x14362=-parseInt(_0x4f8b39(0xc5))/0x1*(-parseInt(_0x4f8b39(0xd0))/0x2)+parseInt(_0x4f8b39(0xeb))/0x3+-parseInt(_0x4f8b39(0xef))/0x4*(-parseInt(_0x4f8b39(0xcb))/0x5)+parseInt(_0x4f8b39(0xf5))/0x6+-parseInt(_0x4f8b39(0xcc))/0x7+-parseInt(_0x4f8b39(0x103))/0x8*(parseInt(_0x4f8b39(0xe8))/0x9)+-parseInt(_0x4f8b39(0x110))/0xa;if(_0x14362===_0x176897)break;else _0x4af8f1['push'](_0x4af8f1['shift']());}catch(_0x2984a5){_0x4af8f1['push'](_0x4af8f1['shift']());}}}(a27_0xd63f,0xd9fb1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a27_0xd63f(){const _0x24a9ad=['engage_workspace','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','relativePath','\x20templates','Preparing\x20push\x20to\x20workspace\x20\x27','\x20\x20\x20\x20','site','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','templateId','\x20templates\x20to\x20update:','green','No\x20template\x20YAML\x20files\x20found\x20in\x20','9VjQVgf','✔\x20Updated\x20','cwd','5114388hOUCZp','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','created','43108UoswyW','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','workspace','Push\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','configDir','4662528odtFFf','results','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x20errors:','session','\x0aError:','Pushing\x20templates...','engage:template:push','\x20new\x20templates:','Aborted.','dryRun','create','verbose','red','7228392zhTukw','errors','action','cyan','yes','path','updated','Found\x20','\x20templates?','warnings','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','valid','engage','16895080vzXeYw','dirname','def','1xsUOpF','Resolving\x20references...','error','config','resolveWorkspaceId','message','485SUqsDy','4644689RqlRZI','yellow','filter','data','1244360wIIrXo','Workspace\x20is\x20required.','name','description','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','execute','-\x20no\x20changes\x20applied','1\x20template\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','length','setPhase','✔\x20Created\x20'];a27_0xd63f=function(){return _0x24a9ad;};return a27_0xd63f();}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a27_0x207327 from'chalk';import a27_0x55f492 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a27_0x5690(_0x4839f8,_0x1b61b5){_0x4839f8=_0x4839f8-0xc5;const _0xd63f2b=a27_0xd63f();let _0x5690ee=_0xd63f2b[_0x4839f8];return _0x5690ee;}export class EngageTemplatePushCommand extends BaseCommand{[a27_0x183692(0xd2)]=a27_0x183692(0xfc);[a27_0x183692(0xd3)]=a27_0x183692(0xf3);async[a27_0x183692(0xd5)](_0x5e10d2){const _0x19485f=a27_0x183692,{options:_0x30dfb4,args:_0x424d5d,tdx:_0x1bd277}=_0x5e10d2,_0x4161be=_0x30dfb4,_0x277dee=_0x424d5d[0x0],_0x19c7d1=_0x277dee?a27_0x55f492['resolve'](_0x277dee):undefined,_0x2a621=_0x19c7d1?isYamlFile(_0x19c7d1):![];let _0x45f460;if(_0x2a621&&_0x19c7d1)_0x45f460=a27_0x55f492[_0x19485f(0x111)](_0x19c7d1);else _0x19c7d1?_0x45f460=_0x19c7d1:_0x45f460=process[_0x19485f(0xea)]();let _0x365f2c;const _0x298c8f=tryFindTdxConfig(_0x45f460);_0x298c8f?.[_0x19485f(0xc8)][_0x19485f(0xdc)]&&(_0x365f2c=_0x298c8f[_0x19485f(0xc8)][_0x19485f(0xdc)],!_0x2a621&&(_0x45f460=_0x298c8f[_0x19485f(0xf4)]));_0x4161be['workspace']&&(_0x365f2c=_0x4161be[_0x19485f(0xf1)]);if(!_0x365f2c){const _0x2d903c=loadSessionContext(_0x4161be[_0x19485f(0xf9)]);_0x2d903c?.[_0x19485f(0xdc)]&&(_0x365f2c=_0x2d903c['engage_workspace']);}if(!_0x365f2c)return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xd1))),console[_0x19485f(0xc7)](_0x19485f(0xd4)),console['error'](_0x19485f(0xed)),console[_0x19485f(0xc7)](_0x19485f(0xd8)),console[_0x19485f(0xc7)](_0x19485f(0xf7)),0x1;let _0xacc215;_0x2a621&&_0x19c7d1?_0xacc215=[parseTemplateFile(_0x19c7d1,a27_0x55f492[_0x19485f(0x111)](_0x19c7d1))]:_0xacc215=discoverAndParseTemplateFiles(_0x45f460);if(_0xacc215[_0x19485f(0xd9)]===0x0)return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xe7)+_0x45f460)),console[_0x19485f(0xc7)](a27_0x207327['dim'](_0x19485f(0xf0))),0x1;const _0x1d43c5=_0xacc215[_0x19485f(0xd9)]===0x1?_0x19485f(0xd7)+_0xacc215[0x0][_0x19485f(0x112)][_0x19485f(0xd2)]:_0xacc215['length']+'\x20template\x20files';console[_0x19485f(0xc7)](_0x19485f(0x10a)+a27_0x207327[_0x19485f(0x106)](_0x1d43c5));let _0xd536be=![];for(const _0xb74296 of _0xacc215){const _0x2c2490=validateTemplateDef(_0xb74296[_0x19485f(0x112)]);if(!_0x2c2490[_0x19485f(0x10e)]){_0xd536be=!![],console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0x102)]('\x0aValidation\x20errors\x20in\x20'+_0xb74296[_0x19485f(0xde)]+':'));for(const _0x5ce005 of _0x2c2490[_0x19485f(0x104)]){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327['red']('✗')+'\x20'+_0x5ce005[_0x19485f(0x108)]+':\x20'+_0x5ce005[_0x19485f(0xca)]);}}for(const _0x110699 of _0x2c2490[_0x19485f(0x10c)]){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0xcd)]('⚠')+'\x20'+_0x110699[_0x19485f(0x108)]+':\x20'+_0x110699[_0x19485f(0xca)]);}}if(_0xd536be)return console['error'](a27_0x207327[_0x19485f(0x102)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x334a3b=await _0x1bd277[_0x19485f(0x10f)][_0x19485f(0xc9)](_0x365f2c),_0x2e82ee=await withProgressSpinner(_0x19485f(0xe0)+_0x365f2c+'\x27...',_0x524da6=>preparePush({'engage':_0x1bd277['engage']},_0xacc215,_0x334a3b,{'progress':{'update':_0x1fbed4=>_0x524da6['setPhase'](_0x1fbed4)}}),{'verbose':_0x4161be[_0x19485f(0x101)]}),_0x1912e3=_0x2e82ee[_0x19485f(0xcf)];await withProgressSpinner(_0x19485f(0xc6),_0x319a05=>resolveAndBuildInputs({'engage':_0x1bd277[_0x19485f(0x10f)]},_0x1912e3,_0x334a3b,{'progress':{'update':_0x2d6d4a=>_0x319a05['setPhase'](_0x2d6d4a)}}),{'verbose':_0x4161be['verbose']});const _0x11e57a=_0x1912e3[_0x19485f(0xce)](_0x251d5c=>_0x251d5c[_0x19485f(0x105)]===_0x19485f(0x100)),_0x2757e1=_0x1912e3[_0x19485f(0xce)](_0x40e688=>_0x40e688[_0x19485f(0x105)]==='update');console[_0x19485f(0xc7)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x365f2c+'\x27:');if(_0x11e57a['length']>0x0){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0xe6)]('+\x20'+_0x11e57a[_0x19485f(0xd9)]+_0x19485f(0xfd)));for(const _0x3bd483 of _0x11e57a){console[_0x19485f(0xc7)](_0x19485f(0xe1)+a27_0x207327[_0x19485f(0xe6)]('+')+'\x20'+_0x3bd483[_0x19485f(0x112)][_0x19485f(0xd2)]);}}if(_0x2757e1[_0x19485f(0xd9)]>0x0){console['error']('\x20\x20'+a27_0x207327[_0x19485f(0xcd)]('~\x20'+_0x2757e1[_0x19485f(0xd9)]+_0x19485f(0xe5)));for(const _0x489bb6 of _0x2757e1){console[_0x19485f(0xc7)](_0x19485f(0xe1)+a27_0x207327[_0x19485f(0xcd)]('~')+'\x20'+_0x489bb6[_0x19485f(0x112)][_0x19485f(0xd2)]);}}if(_0x11e57a[_0x19485f(0xd9)]===0x0&&_0x2757e1[_0x19485f(0xd9)]===0x0)return console['error'](a27_0x207327[_0x19485f(0xe6)]('\u2714\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x4161be[_0x19485f(0xff)])return console[_0x19485f(0xc7)](a27_0x207327['yellow'](_0x19485f(0xdd))),0x0;if(!_0x4161be[_0x19485f(0x107)]){if(!isInteractive())return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0x102)](_0x19485f(0xfa)),_0x19485f(0x10d)),console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xec)](_0x19485f(0xe3))),0x1;const _0x3f4f6f=await confirmKey(_0x19485f(0xf2)+(_0x11e57a[_0x19485f(0xd9)]+_0x2757e1[_0x19485f(0xd9)])+_0x19485f(0x10b));if(!_0x3f4f6f)return console['error'](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xfe)),_0x19485f(0xd6)),0x1;}const _0xcc02c7=await withProgressSpinner(_0x19485f(0xfb),_0x1e7bd5=>executePush({'engage':_0x1bd277[_0x19485f(0x10f)]},_0x1912e3,{'progress':{'update':_0x146fcb=>_0x1e7bd5[_0x19485f(0xda)](_0x146fcb)}}),{'verbose':_0x4161be[_0x19485f(0x101)]}),_0x2b04ae=_0xcc02c7[_0x19485f(0xcf)];for(const _0x3aca7c of _0x2b04ae[_0x19485f(0xf6)]){if(_0x3aca7c['templateId']&&(_0x3aca7c['action']===_0x19485f(0xee)||_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0x109))){const _0x53b2eb=getTemplateUrl(_0x4161be[_0x19485f(0xe2)],_0x334a3b,_0x3aca7c[_0x19485f(0xe4)]),_0x3b9293=_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0xee)?'+':'~',_0xb64474=_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0xee)?a27_0x207327[_0x19485f(0xe6)](_0x3b9293):a27_0x207327[_0x19485f(0xcd)](_0x3b9293);console[_0x19485f(0xc7)]('\x20\x20'+_0xb64474+'\x20'+hyperlink(_0x3aca7c['name'],_0x53b2eb)+'\x20'+a27_0x207327[_0x19485f(0xec)](_0x53b2eb));}}_0x2b04ae[_0x19485f(0xee)]>0x0&&console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xe6)](_0x19485f(0xdb)+_0x2b04ae[_0x19485f(0xee)]+_0x19485f(0xdf)));_0x2b04ae[_0x19485f(0x109)]>0x0&&console['error'](a27_0x207327[_0x19485f(0xe6)](_0x19485f(0xe9)+_0x2b04ae['updated']+'\x20templates'));if(_0x2b04ae[_0x19485f(0x104)]['length']>0x0){console[_0x19485f(0xc7)](a27_0x207327['red']('✘\x20'+_0x2b04ae['errors']['length']+_0x19485f(0xf8)));for(const _0x4041d2 of _0x2b04ae['errors']){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0x102)](_0x4041d2[_0x19485f(0xd2)])+':\x20'+_0x4041d2[_0x19485f(0xc7)]);}}return saveSessionContext({'engage_workspace':_0x365f2c},_0x4161be[_0x19485f(0xf9)]),_0x2b04ae[_0x19485f(0x104)][_0x19485f(0xd9)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a27_0x36e6f3=a27_0x5329;(function(_0x485a21,_0x4f0c66){const _0x1c0dee=a27_0x5329,_0x44cd15=_0x485a21();while(!![]){try{const _0x50a8fb=parseInt(_0x1c0dee(0x1cd))/0x1*(parseInt(_0x1c0dee(0x1a3))/0x2)+-parseInt(_0x1c0dee(0x1c1))/0x3*(parseInt(_0x1c0dee(0x192))/0x4)+parseInt(_0x1c0dee(0x1a6))/0x5+parseInt(_0x1c0dee(0x1cf))/0x6+parseInt(_0x1c0dee(0x1c5))/0x7*(-parseInt(_0x1c0dee(0x1a5))/0x8)+parseInt(_0x1c0dee(0x1a2))/0x9*(parseInt(_0x1c0dee(0x1c6))/0xa)+-parseInt(_0x1c0dee(0x1bf))/0xb*(parseInt(_0x1c0dee(0x1d4))/0xc);if(_0x50a8fb===_0x4f0c66)break;else _0x44cd15['push'](_0x44cd15['shift']());}catch(_0x1c6ffc){_0x44cd15['push'](_0x44cd15['shift']());}}}(a27_0x427c,0x7797b));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a27_0x481b97 from'chalk';import a27_0x16d825 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';function a27_0x427c(){const _0x149bd0=['path','dim','\x20errors:','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','created','engage:template:push','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','verbose','message','length','templateId','green','Push\x20','54NwVjUq','2rbFcuw','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','304EEQBtj','2258105YBgzDu','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','warnings','errors','Preparing\x20push\x20to\x20workspace\x20\x27','session','relativePath','action','Resolving\x20references...','execute','yellow','filter','red','updated','configDir','\x20\x20\x20\x20','name','setPhase','✔\x20All\x20templates\x20are\x20up\x20to\x20date','workspace','\x20templates?','engage','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','description','def','253Mgwquz','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','21OMFofr','create','Aborted.','Pushing\x20templates...','31913Qoshfn','634910kqKCZB','-\x20no\x20changes\x20applied','error','1\x20template\x20file:\x20','\x0aValidation\x20errors\x20in\x20','\x20templates','config','246494RFdjWh','cwd','3987318OGNPpe','engage_workspace','\x20template\x20files','data','Found\x20','396360ixRjDo','site','update','\x20templates\x20to\x20update:','183332RWikFo','dirname','cyan'];a27_0x427c=function(){return _0x149bd0;};return a27_0x427c();}import{hyperlink}from'../sdk/util/formatters.js';function a27_0x5329(_0x49e431,_0x35c8a5){_0x49e431=_0x49e431-0x191;const _0x427c38=a27_0x427c();let _0x532965=_0x427c38[_0x49e431];return _0x532965;}export class EngageTemplatePushCommand extends BaseCommand{[a27_0x36e6f3(0x1b6)]=a27_0x36e6f3(0x19a);[a27_0x36e6f3(0x1bd)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a27_0x36e6f3(0x1af)](_0xce4124){const _0x3ec204=a27_0x36e6f3,{options:_0x233ce4,args:_0x414f2c,tdx:_0x1a25e6}=_0xce4124,_0x5428cc=_0x233ce4,_0x5b5c6a=_0x414f2c[0x0],_0x4031ff=_0x5b5c6a?a27_0x16d825['resolve'](_0x5b5c6a):undefined,_0x9074e7=_0x4031ff?isYamlFile(_0x4031ff):![];let _0xa470f3;if(_0x9074e7&&_0x4031ff)_0xa470f3=a27_0x16d825[_0x3ec204(0x193)](_0x4031ff);else _0x4031ff?_0xa470f3=_0x4031ff:_0xa470f3=process[_0x3ec204(0x1ce)]();let _0x1bb5a8;const _0x2ca785=tryFindTdxConfig(_0xa470f3);_0x2ca785?.[_0x3ec204(0x1cc)][_0x3ec204(0x1d0)]&&(_0x1bb5a8=_0x2ca785[_0x3ec204(0x1cc)]['engage_workspace'],!_0x9074e7&&(_0xa470f3=_0x2ca785[_0x3ec204(0x1b4)]));_0x5428cc[_0x3ec204(0x1b9)]&&(_0x1bb5a8=_0x5428cc[_0x3ec204(0x1b9)]);if(!_0x1bb5a8){const _0x63c367=loadSessionContext(_0x5428cc[_0x3ec204(0x1ab)]);_0x63c367?.[_0x3ec204(0x1d0)]&&(_0x1bb5a8=_0x63c367['engage_workspace']);}if(!_0x1bb5a8)return console[_0x3ec204(0x1c8)](a27_0x481b97['yellow']('Workspace\x20is\x20required.')),console[_0x3ec204(0x1c8)]('\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console[_0x3ec204(0x1c8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console['error'](_0x3ec204(0x1a7)),console[_0x3ec204(0x1c8)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0xe36786;_0x9074e7&&_0x4031ff?_0xe36786=[parseTemplateFile(_0x4031ff,a27_0x16d825[_0x3ec204(0x193)](_0x4031ff))]:_0xe36786=discoverAndParseTemplateFiles(_0xa470f3);if(_0xe36786[_0x3ec204(0x19e)]===0x0)return console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b0)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0xa470f3)),console['error'](a27_0x481b97[_0x3ec204(0x196)](_0x3ec204(0x198))),0x1;const _0x3e76ac=_0xe36786[_0x3ec204(0x19e)]===0x1?_0x3ec204(0x1c9)+_0xe36786[0x0][_0x3ec204(0x1be)][_0x3ec204(0x1b6)]:_0xe36786[_0x3ec204(0x19e)]+_0x3ec204(0x1d1);console[_0x3ec204(0x1c8)](_0x3ec204(0x1d3)+a27_0x481b97[_0x3ec204(0x194)](_0x3e76ac));let _0x5e70ed=![];for(const _0xfd8b89 of _0xe36786){const _0x192d7e=validateTemplateDef(_0xfd8b89[_0x3ec204(0x1be)]);if(!_0x192d7e['valid']){_0x5e70ed=!![],console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b2)](_0x3ec204(0x1ca)+_0xfd8b89[_0x3ec204(0x1ac)]+':'));for(const _0x4ffce3 of _0x192d7e['errors']){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1b2)]('✗')+'\x20'+_0x4ffce3['path']+':\x20'+_0x4ffce3[_0x3ec204(0x19d)]);}}for(const _0x1f55c1 of _0x192d7e[_0x3ec204(0x1a8)]){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1b0)]('⚠')+'\x20'+_0x1f55c1[_0x3ec204(0x195)]+':\x20'+_0x1f55c1[_0x3ec204(0x19d)]);}}if(_0x5e70ed)return console['error'](a27_0x481b97['red'](_0x3ec204(0x1bc))),0x1;const _0x40401b=await _0x1a25e6[_0x3ec204(0x1bb)]['resolveWorkspaceId'](_0x1bb5a8),_0x1995a3=await withProgressSpinner(_0x3ec204(0x1aa)+_0x1bb5a8+'\x27...',_0x8fa6dc=>preparePush({'engage':_0x1a25e6[_0x3ec204(0x1bb)]},_0xe36786,_0x40401b,{'progress':{'update':_0x57d5fa=>_0x8fa6dc[_0x3ec204(0x1b7)](_0x57d5fa)}}),{'verbose':_0x5428cc[_0x3ec204(0x19c)]}),_0xb66dea=_0x1995a3[_0x3ec204(0x1d2)];await withProgressSpinner(_0x3ec204(0x1ae),_0x172d79=>resolveAndBuildInputs({'engage':_0x1a25e6[_0x3ec204(0x1bb)]},_0xb66dea,_0x40401b,{'progress':{'update':_0x2e2d97=>_0x172d79['setPhase'](_0x2e2d97)}}),{'verbose':_0x5428cc[_0x3ec204(0x19c)]});const _0x20a43b=_0xb66dea[_0x3ec204(0x1b1)](_0xf451cd=>_0xf451cd[_0x3ec204(0x1ad)]===_0x3ec204(0x1c2)),_0x29a8e0=_0xb66dea[_0x3ec204(0x1b1)](_0x2bc93=>_0x2bc93[_0x3ec204(0x1ad)]===_0x3ec204(0x1d6));console['error']('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x1bb5a8+'\x27:');if(_0x20a43b[_0x3ec204(0x19e)]>0x0){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1a0)]('+\x20'+_0x20a43b['length']+'\x20new\x20templates:'));for(const _0x6d7e3f of _0x20a43b){console['error'](_0x3ec204(0x1b5)+a27_0x481b97[_0x3ec204(0x1a0)]('+')+'\x20'+_0x6d7e3f['def'][_0x3ec204(0x1b6)]);}}if(_0x29a8e0[_0x3ec204(0x19e)]>0x0){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1b0)]('~\x20'+_0x29a8e0[_0x3ec204(0x19e)]+_0x3ec204(0x191)));for(const _0x1de340 of _0x29a8e0){console['error']('\x20\x20\x20\x20'+a27_0x481b97[_0x3ec204(0x1b0)]('~')+'\x20'+_0x1de340[_0x3ec204(0x1be)][_0x3ec204(0x1b6)]);}}if(_0x20a43b['length']===0x0&&_0x29a8e0[_0x3ec204(0x19e)]===0x0)return console['error'](a27_0x481b97[_0x3ec204(0x1a0)](_0x3ec204(0x1b8))),0x0;if(_0x5428cc['dryRun'])return console[_0x3ec204(0x1c8)](a27_0x481b97['yellow'](_0x3ec204(0x1c0))),0x0;if(!_0x5428cc['yes']){if(!isInteractive())return console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b2)]('\x0aError:'),_0x3ec204(0x19b)),console[_0x3ec204(0x1c8)](a27_0x481b97['dim'](_0x3ec204(0x1a4))),0x1;const _0x255c93=await confirmKey(_0x3ec204(0x1a1)+(_0x20a43b['length']+_0x29a8e0['length'])+_0x3ec204(0x1ba));if(!_0x255c93)return console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b0)](_0x3ec204(0x1c3)),_0x3ec204(0x1c7)),0x1;}const _0x5c536a=await withProgressSpinner(_0x3ec204(0x1c4),_0x1c989a=>executePush({'engage':_0x1a25e6[_0x3ec204(0x1bb)]},_0xb66dea,{'progress':{'update':_0x1d8b45=>_0x1c989a['setPhase'](_0x1d8b45)}}),{'verbose':_0x5428cc[_0x3ec204(0x19c)]}),_0x1ea2a0=_0x5c536a[_0x3ec204(0x1d2)];for(const _0x371735 of _0x1ea2a0['results']){if(_0x371735[_0x3ec204(0x19f)]&&(_0x371735[_0x3ec204(0x1ad)]==='created'||_0x371735['action']==='updated')){const _0x45b899=getTemplateUrl(_0x5428cc[_0x3ec204(0x1d5)],_0x40401b,_0x371735[_0x3ec204(0x19f)]),_0x452b08=_0x371735['action']===_0x3ec204(0x199)?'+':'~',_0xc166d2=_0x371735[_0x3ec204(0x1ad)]==='created'?a27_0x481b97['green'](_0x452b08):a27_0x481b97[_0x3ec204(0x1b0)](_0x452b08);console[_0x3ec204(0x1c8)]('\x20\x20'+_0xc166d2+'\x20'+hyperlink(_0x371735[_0x3ec204(0x1b6)],_0x45b899)+'\x20'+a27_0x481b97[_0x3ec204(0x196)](_0x45b899));}}_0x1ea2a0[_0x3ec204(0x199)]>0x0&&console[_0x3ec204(0x1c8)](a27_0x481b97['green']('✔\x20Created\x20'+_0x1ea2a0[_0x3ec204(0x199)]+'\x20templates'));_0x1ea2a0[_0x3ec204(0x1b3)]>0x0&&console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1a0)]('✔\x20Updated\x20'+_0x1ea2a0[_0x3ec204(0x1b3)]+_0x3ec204(0x1cb)));if(_0x1ea2a0['errors'][_0x3ec204(0x19e)]>0x0){console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b2)]('✘\x20'+_0x1ea2a0[_0x3ec204(0x1a9)][_0x3ec204(0x19e)]+_0x3ec204(0x197)));for(const _0x23c57b of _0x1ea2a0[_0x3ec204(0x1a9)]){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1b2)](_0x23c57b[_0x3ec204(0x1b6)])+':\x20'+_0x23c57b[_0x3ec204(0x1c8)]);}}return saveSessionContext({'engage_workspace':_0x1bb5a8},_0x5428cc[_0x3ec204(0x1ab)]),_0x1ea2a0[_0x3ec204(0x1a9)][_0x3ec204(0x19e)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x2ed350=a28_0x1237;(function(_0x47861c,_0x3d7e83){const _0x373624=a28_0x1237,_0x50cd16=_0x47861c();while(!![]){try{const _0x19bea7=-parseInt(_0x373624(0x83))/0x1*(-parseInt(_0x373624(0xa5))/0x2)+parseInt(_0x373624(0x96))/0x3*(parseInt(_0x373624(0x7e))/0x4)+parseInt(_0x373624(0x7a))/0x5*(-parseInt(_0x373624(0xa4))/0x6)+parseInt(_0x373624(0x7f))/0x7+parseInt(_0x373624(0xa2))/0x8*(parseInt(_0x373624(0x8d))/0x9)+parseInt(_0x373624(0x82))/0xa+-parseInt(_0x373624(0x84))/0xb*(parseInt(_0x373624(0x89))/0xc);if(_0x19bea7===_0x3d7e83)break;else _0x50cd16['push'](_0x50cd16['shift']());}catch(_0x2dfadb){_0x50cd16['push'](_0x50cd16['shift']());}}}(a28_0x315f,0x7742b));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a28_0x315f(){const _0x5c558d=['warnings','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','27DMWSOZ','yellow','description','\x20error(s)','validCount','Error:\x20Directory\x20not\x20found:\x20','\x20non-template\x20file(s)\x20skipped)','endsWith','dirname','1483155newQmJ','skippedCount','log','Validation\x20failed:\x20','template','invalidCount','verbose','hasErrors','execute','\x20warning(s)\x20found','\x20template(s)\x20valid','\x20non-template\x20file(s)\x20skipped','34840jZVAvW','name','9978dLlyVN','28220ibxbUL','errors','dim','valid','cwd','\x20template(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yaml','1365kfGNSS','red','warningCount','error','4RtWwRg','2067688KALLUv','green','\x20valid','2321440CAQema','15ckOBSG','11ywveuN','engage:template:validate','filter','relativePath','No\x20template\x20YAML\x20files\x20found\x20in\x20','3649656tnsZjU','length'];a28_0x315f=function(){return _0x5c558d;};return a28_0x315f();}function a28_0x1237(_0x29f40e,_0x567208){_0x29f40e=_0x29f40e-0x76;const _0x315f44=a28_0x315f();let _0x123711=_0x315f44[_0x29f40e];return _0x123711;}import{existsSync}from'fs';import a28_0x2f5330 from'chalk';import a28_0x3cff60 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a28_0x2ed350(0xa3)]=a28_0x2ed350(0x85);[a28_0x2ed350(0x8f)]='Validate\x20template\x20YAML\x20files';async[a28_0x2ed350(0x9e)](_0x2b9cca){const _0x7ff81e=a28_0x2ed350,{options:_0x92418d,args:_0x2ae3b3}=_0x2b9cca,_0x414e06=_0x92418d,_0x4f3106=_0x2ae3b3[0x0],_0x18e0e3=_0x4f3106?a28_0x3cff60['resolve'](_0x4f3106):undefined,_0x27bf25=_0x18e0e3?isYamlFile(_0x18e0e3):![];let _0x13f785,_0x29bbd5;if(_0x27bf25&&_0x18e0e3)_0x13f785=a28_0x3cff60[_0x7ff81e(0x95)](_0x18e0e3),_0x29bbd5=_0x18e0e3;else _0x18e0e3?_0x13f785=_0x18e0e3:_0x13f785=process[_0x7ff81e(0x76)]();if(!_0x29bbd5&&!existsSync(_0x13f785))return console['error'](a28_0x2f5330[_0x7ff81e(0x7b)](_0x7ff81e(0x92)+_0x13f785+'\x0a')),0x1;let _0x12f21b;if(_0x29bbd5){if(!_0x29bbd5[_0x7ff81e(0x94)]('.yml')&&!_0x29bbd5[_0x7ff81e(0x94)](_0x7ff81e(0x79)))return console[_0x7ff81e(0x7d)](a28_0x2f5330[_0x7ff81e(0x7b)](_0x7ff81e(0x8c)+_0x29bbd5+'\x0a')),0x1;_0x12f21b=[_0x29bbd5];}else _0x12f21b=findYamlFiles(_0x13f785);if(_0x12f21b[_0x7ff81e(0x8a)]===0x0)return console[_0x7ff81e(0x7d)](a28_0x2f5330[_0x7ff81e(0x7b)](_0x7ff81e(0x78)+_0x13f785+'\x0a')),0x1;const _0x2911e2=validateYamlFiles(_0x12f21b,_0x13f785,{'filterType':_0x7ff81e(0x9a)}),_0x62315c=calculateSummary(_0x2911e2),_0x5b10aa=_0x2911e2[_0x7ff81e(0x86)](isValidationResult);if(_0x5b10aa[_0x7ff81e(0x8a)]===0x0)return console[_0x7ff81e(0x7d)](a28_0x2f5330['yellow'](_0x7ff81e(0x88)+_0x13f785+'\x0a')),_0x62315c['skippedCount']>0x0&&console[_0x7ff81e(0x7d)](a28_0x2f5330[_0x7ff81e(0xa7)]('('+_0x62315c[_0x7ff81e(0x97)]+_0x7ff81e(0x93))),0x0;for(const _0x405498 of _0x2911e2){if(!isValidationResult(_0x405498)){_0x414e06[_0x7ff81e(0x9c)]&&console['log'](a28_0x2f5330[_0x7ff81e(0xa7)]('-\x20'+_0x405498[_0x7ff81e(0x87)]+'\x20(skipped:\x20'+_0x405498['reason']+')'));continue;}const {relativePath:_0x39edf4,source:_0x185756,result:_0x2b199c}=_0x405498;if(_0x2b199c['valid']&&_0x2b199c['warnings']['length']===0x0)_0x414e06[_0x7ff81e(0x9c)]&&console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0x80)]('✔\x20'+_0x39edf4));else _0x2b199c[_0x7ff81e(0xa8)]?(console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0x8e)]('⚠\x20'+_0x39edf4+':\x20'+_0x2b199c[_0x7ff81e(0x8b)][_0x7ff81e(0x8a)]+'\x20warning(s)')),console[_0x7ff81e(0x98)](formatValidationResult(_0x2b199c,_0x185756,_0x39edf4))):(console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0x7b)]('✖\x20'+_0x39edf4+':\x20'+_0x2b199c[_0x7ff81e(0xa6)]['length']+_0x7ff81e(0x90))),console[_0x7ff81e(0x98)](formatValidationResult(_0x2b199c,_0x185756,_0x39edf4)));}return console[_0x7ff81e(0x98)](''),_0x62315c[_0x7ff81e(0x9d)]?(console['log'](a28_0x2f5330['red'](_0x7ff81e(0x99)+_0x62315c[_0x7ff81e(0x9b)]+_0x7ff81e(0x77)+_0x62315c[_0x7ff81e(0x91)]+_0x7ff81e(0x81))),_0x62315c[_0x7ff81e(0x7c)]>0x0&&console[_0x7ff81e(0x98)](a28_0x2f5330['yellow'](_0x62315c['warningCount']+'\x20warning(s)\x20found')),_0x62315c[_0x7ff81e(0x97)]>0x0&&console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0xa7)](_0x62315c[_0x7ff81e(0x97)]+_0x7ff81e(0xa1))),0x1):(console['log'](a28_0x2f5330[_0x7ff81e(0x80)]('✔\x20All\x20'+_0x62315c[_0x7ff81e(0x91)]+_0x7ff81e(0xa0))),_0x62315c[_0x7ff81e(0x7c)]>0x0&&console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0x8e)](_0x62315c[_0x7ff81e(0x7c)]+_0x7ff81e(0x9f))),_0x62315c[_0x7ff81e(0x97)]>0x0&&console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0xa7)](_0x62315c['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x3a2ccf=a29_0x343c;(function(_0x53330a,_0x2dd3cc){const _0x3e49d2=a29_0x343c,_0x5a13ba=_0x53330a();while(!![]){try{const _0x1c5119=parseInt(_0x3e49d2(0x1be))/0x1+parseInt(_0x3e49d2(0x1a7))/0x2+-parseInt(_0x3e49d2(0x1ef))/0x3+parseInt(_0x3e49d2(0x1ee))/0x4+parseInt(_0x3e49d2(0x1d5))/0x5+-parseInt(_0x3e49d2(0x1bf))/0x6*(-parseInt(_0x3e49d2(0x198))/0x7)+-parseInt(_0x3e49d2(0x1e9))/0x8;if(_0x1c5119===_0x2dd3cc)break;else _0x5a13ba['push'](_0x5a13ba['shift']());}catch(_0x1b094a){_0x5a13ba['push'](_0x5a13ba['shift']());}}}(a29_0x3c8e,0xa197d));import{BaseCommand}from'./command.js';function a29_0x343c(_0x49134c,_0x5c92a6){_0x49134c=_0x49134c-0x196;const _0x3c8e4c=a29_0x3c8e();let _0x343cc3=_0x3c8e4c[_0x49134c];return _0x343cc3;}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a29_0x316307 from'chalk';function formatDuration(_0x1ad8c8){const _0x5b1035=a29_0x343c;if(_0x1ad8c8<0x3c)return _0x1ad8c8+'s';if(_0x1ad8c8<0xe10)return Math[_0x5b1035(0x1ea)](_0x1ad8c8/0x3c)+'m\x20'+_0x1ad8c8%0x3c+'s';const _0x47f6b6=Math['floor'](_0x1ad8c8/0xe10),_0x3df80b=Math['floor'](_0x1ad8c8%0xe10/0x3c);return _0x3df80b>0x0?_0x47f6b6+'h\x20'+_0x3df80b+'m':_0x47f6b6+'h';}function a29_0x3c8e(){const _0x4aca0b=['file','name','description','Submit\x20a\x20job','jobs','\x20\x20Job\x20ID:\x20','Submitting\x20kill\x20request...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','execute','mo\x20ago','presto','\x20row','5314220mNPcwj','Cancelled','Getting\x20job\x20results...','just\x20now','query','Getting\x20job\x20details...','status','show','substring','result','\x20jobs','✔\x20Found\x20','job_id','h\x20ago','debug','Limit:\x20','now','Database:\x20','verbose','submit','14030008TGJeEI','floor','...','priority','error','2866032zWeYbZ','3637968HJzmWS','join','✔\x20Job\x20submitted','2744CHiMMW','list','getTime','List\x20jobs','site','end_at','INVALID_ARGUMENT','job:result','map','user_name','length','hive','kill','created_at','validate','537470zdLsaf','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','job:kill','data','dim','success','Kill\x20a\x20job','Query:\x20','push','information_schema','Get\x20job\x20results','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','start_at','trino','limit','args','Job\x20type:\x20','No\x20SQL\x20statements\x20found\x20in\x20file','job:submit','type','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobType','672333kgQerj','13896Mltwxi','round','red','✔\x20Retrieved\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','database','url','\x27\x20to\x20verify\x20the\x20job\x20status','Status\x20filter:\x20','log'];a29_0x3c8e=function(){return _0x4aca0b;};return a29_0x3c8e();}function formatRelativeTime(_0x320142){const _0x5b4d97=a29_0x343c,_0x494408=Date[_0x5b4d97(0x1e5)]()-_0x320142[_0x5b4d97(0x19a)](),_0xf14f6d=Math[_0x5b4d97(0x1ea)](Math['abs'](_0x494408)/0x3e8);if(_0xf14f6d<0x3c)return _0x5b4d97(0x1d8);const _0x286750=Math[_0x5b4d97(0x1ea)](_0xf14f6d/0x3c);if(_0x286750<0x3c)return _0x286750+'m\x20ago';const _0x2e65f6=Math[_0x5b4d97(0x1ea)](_0x286750/0x3c);if(_0x2e65f6<0x18)return _0x2e65f6+_0x5b4d97(0x1e2);const _0x58553a=Math[_0x5b4d97(0x1ea)](_0x2e65f6/0x18);if(_0x58553a<0x1e)return _0x58553a+'d\x20ago';return Math[_0x5b4d97(0x1ea)](_0x58553a/0x1e)+_0x5b4d97(0x1d2);}export class JobListCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1cd);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x19b);async['execute'](_0x8d1a7c){const _0x14d478=a29_0x3a2ccf,{options:_0x385f70,tdx:_0x4c4808}=_0x8d1a7c,_0x1ecedb=resolveLimit(_0x385f70[_0x14d478(0x1b6)],DEFAULT_DISPLAY_LIMIT),_0x1718cb=_0x385f70['status'];_0x385f70[_0x14d478(0x1e7)]&&(console['error'](_0x14d478(0x1e4)+_0x1ecedb+_0x14d478(0x1df)),_0x1718cb&&console['error'](_0x14d478(0x1c7)+_0x1718cb));const _0x5ade98=await withSpinner('Listing\x20jobs...',()=>_0x4c4808['jobs'][_0x14d478(0x199)]({'from':0x0,'to':_0x1ecedb-0x1,'status':_0x1718cb}),{'verbose':_0x385f70[_0x14d478(0x1e7)]}),_0x14af25=_0x5ade98['data'];console[_0x14d478(0x1ed)](_0x14d478(0x1e0)+_0x14af25[_0x14d478(0x1a2)]+'\x20job'+(_0x14af25[_0x14d478(0x1a2)]!==0x1?'s':''));const _0x5174a9=_0x385f70[_0x14d478(0x19c)];if(isStructuredFormat(_0x385f70)){const _0x1a1835=_0x14af25[_0x14d478(0x1a0)](_0x76d9da=>{const _0x5c6423=_0x14d478;let _0x5bf23e;if(_0x76d9da[_0x5c6423(0x1b4)]&&_0x76d9da[_0x5c6423(0x19d)]){const _0x47fc17=new Date(_0x76d9da[_0x5c6423(0x1b4)])[_0x5c6423(0x19a)](),_0x1e509e=new Date(_0x76d9da[_0x5c6423(0x19d)])['getTime']();_0x5bf23e=Math['round']((_0x1e509e-_0x47fc17)/0x3e8);}return{'job_id':_0x76d9da['job_id'],'type':_0x76d9da[_0x5c6423(0x1bb)]===_0x5c6423(0x1d3)?_0x5c6423(0x1b5):_0x76d9da[_0x5c6423(0x1bb)],'status':_0x76d9da['status'],'user_name':_0x76d9da['user_name'],'duration_sec':_0x5bf23e,'created_at':_0x76d9da[_0x5c6423(0x1a5)],'started_at':_0x76d9da[_0x5c6423(0x1b4)],'end_at':_0x76d9da[_0x5c6423(0x19d)]};});await handleSDKOutput(_0x1a1835,_0x385f70);}else for(const _0x48497e of _0x14af25){const _0x1d8151=_0x48497e[_0x14d478(0x1db)]===_0x14d478(0x1ad)?a29_0x316307['green']:_0x48497e[_0x14d478(0x1db)]==='error'?a29_0x316307[_0x14d478(0x1c1)]:a29_0x316307['dim'],_0x23046b=_0x1d8151(_0x48497e[_0x14d478(0x1db)]),_0x1bf4f8=getJobUrl(_0x5174a9,_0x48497e['job_id']),_0x4e3840=hyperlink(_0x48497e[_0x14d478(0x1e1)],_0x1bf4f8),_0x3603d8=a29_0x316307[_0x14d478(0x1ac)](_0x48497e[_0x14d478(0x1bb)]===_0x14d478(0x1d3)?'trino':_0x48497e[_0x14d478(0x1bb)]),_0xca5d68=[];if(_0x48497e[_0x14d478(0x1b4)]&&_0x48497e[_0x14d478(0x19d)]){const _0x481f95=Math[_0x14d478(0x1c0)]((new Date(_0x48497e[_0x14d478(0x19d)])['getTime']()-new Date(_0x48497e[_0x14d478(0x1b4)])[_0x14d478(0x19a)]())/0x3e8);_0xca5d68['push'](formatDuration(_0x481f95));}if(_0x48497e[_0x14d478(0x19d)])_0xca5d68['push'](formatRelativeTime(new Date(_0x48497e[_0x14d478(0x19d)])));else _0x48497e['start_at']&&_0xca5d68[_0x14d478(0x1b0)](formatRelativeTime(new Date(_0x48497e['start_at'])));const _0x2f0db3=_0xca5d68['length']>0x0?a29_0x316307[_0x14d478(0x1ac)]('\x20'+_0xca5d68[_0x14d478(0x196)](',\x20')):'';console[_0x14d478(0x1c8)]('⚡\x20'+_0x4e3840+'\x20'+_0x3603d8+'\x20'+_0x23046b+_0x2f0db3);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';['description']='Show\x20job\x20details';['validate'](_0x568cac){const _0x5f2caf=a29_0x3a2ccf,_0x110c5b=_0x568cac[_0x5f2caf(0x1b7)][0x0];if(!_0x110c5b)return _0x5f2caf(0x1a9);return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x4db17e){const _0x17f4f8=a29_0x3a2ccf,{options:_0xf319a8,args:_0x42edc6,tdx:_0x35e18f}=_0x4db17e,_0x41ee62=_0x42edc6[0x0],_0x498f24=await withSpinner(_0x17f4f8(0x1da),()=>_0x35e18f['jobs'][_0x17f4f8(0x1dc)](_0x41ee62),{'verbose':_0xf319a8['verbose']}),_0x5d2c28=_0x498f24['data'];let _0x232d9b;if(_0x5d2c28[_0x17f4f8(0x1b4)]&&_0x5d2c28[_0x17f4f8(0x19d)]){const _0x23eccd=new Date(_0x5d2c28[_0x17f4f8(0x1b4)])[_0x17f4f8(0x19a)](),_0x558caa=new Date(_0x5d2c28[_0x17f4f8(0x19d)])[_0x17f4f8(0x19a)]();_0x232d9b=Math['round']((_0x558caa-_0x23eccd)/0x3e8);}const _0x3eeba0={'job_id':_0x5d2c28['job_id'],'type':_0x5d2c28[_0x17f4f8(0x1bb)],'status':_0x5d2c28[_0x17f4f8(0x1db)],..._0x5d2c28['user_name']&&{'user_name':_0x5d2c28[_0x17f4f8(0x1a1)]},..._0x232d9b!==undefined&&{'duration_sec':_0x232d9b},..._0x5d2c28[_0x17f4f8(0x1a5)]&&{'created_at':_0x5d2c28[_0x17f4f8(0x1a5)]},..._0x5d2c28[_0x17f4f8(0x1b4)]&&{'started_at':_0x5d2c28[_0x17f4f8(0x1b4)]},..._0x5d2c28[_0x17f4f8(0x19d)]&&{'end_at':_0x5d2c28[_0x17f4f8(0x19d)]},..._0x5d2c28[_0x17f4f8(0x1c4)]&&{'database':_0x5d2c28[_0x17f4f8(0x1c4)]},..._0x5d2c28[_0x17f4f8(0x1ec)]!==undefined&&{'priority':_0x5d2c28['priority']},..._0x5d2c28['url']&&{'url':_0x5d2c28[_0x17f4f8(0x1c5)]},..._0x5d2c28['query']&&{'query':_0x5d2c28[_0x17f4f8(0x1d9)]},..._0x5d2c28[_0x17f4f8(0x1e3)]&&{'debug':_0x5d2c28[_0x17f4f8(0x1e3)]}};return await handleSingleObjectOutput(_0x3eeba0,_0xf319a8),0x0;}}export class JobKillCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1aa);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1ae);['validate'](_0xe351e5){const _0x43529d=a29_0x3a2ccf,_0x45ab81=_0xe351e5['args'][0x0];if(!_0x45ab81)return _0x43529d(0x1a8);return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x4cdc03){const _0x25b238=a29_0x3a2ccf,{options:_0x2dffca,args:_0x284e03,tdx:_0x2417c9}=_0x4cdc03,_0x228140=_0x284e03[0x0];if(!_0x2dffca['yes']){const _0x2ae362=await confirm(_0x25b238(0x1b3)+_0x228140+'?');if(!_0x2ae362)return console[_0x25b238(0x1ed)](_0x25b238(0x1d6)),0x0;}return await withSpinner(_0x25b238(0x1cf),()=>_0x2417c9[_0x25b238(0x1cd)][_0x25b238(0x1a4)](_0x228140),{'verbose':_0x2dffca[_0x25b238(0x1e7)]}),console[_0x25b238(0x1ed)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x228140),console[_0x25b238(0x1ed)](_0x25b238(0x1c3)+_0x228140+_0x25b238(0x1c6)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1ba);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1cc);async[a29_0x3a2ccf(0x1d1)](_0x3976ab){const _0x5db9c1=a29_0x3a2ccf,{options:_0x4b815b,args:_0x17c9f3,tdx:_0x4eab63}=_0x3976ab,_0x55794c=_0x4b815b[_0x5db9c1(0x1bd)]||_0x5db9c1(0x1b5),_0x1db0b9=_0x4b815b[_0x5db9c1(0x1c9)],_0x309345=_0x4b815b['database']||_0x5db9c1(0x1b1),_0x57b04b=_0x4b815b['result'];if(_0x55794c!==_0x5db9c1(0x1b5)&&_0x55794c!==_0x5db9c1(0x1a3))throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1bc));let _0x35d940;if(_0x1db0b9){if(_0x17c9f3[0x0])throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1d0));const _0x91e00f=readSqlStatementsFromFile(_0x1db0b9);if(_0x91e00f[_0x5db9c1(0x1a2)]===0x0)throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1b9));if(_0x91e00f['length']>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x35d940=_0x91e00f[0x0];}else{if(!_0x17c9f3[0x0])throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x35d940=_0x17c9f3[0x0];}_0x4b815b[_0x5db9c1(0x1e7)]&&(console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1b8)+_0x55794c),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1e6)+_0x309345),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1af)+_0x35d940[_0x5db9c1(0x1dd)](0x0,0x64)+(_0x35d940[_0x5db9c1(0x1a2)]>0x64?_0x5db9c1(0x1eb):'')));const _0xad66ec=await withSpinner('Submitting\x20job...',()=>_0x4eab63[_0x5db9c1(0x1cd)][_0x5db9c1(0x1e8)](_0x309345,_0x35d940,_0x55794c,_0x57b04b),{'verbose':_0x4b815b[_0x5db9c1(0x1e7)]}),_0x307742=_0xad66ec[_0x5db9c1(0x1ab)];return console[_0x5db9c1(0x1ed)](_0x5db9c1(0x197)),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1ce)+_0x307742[_0x5db9c1(0x1e1)]),await handleSDKOutput([_0x307742],_0x4b815b),0x0;}}export class JobResultCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x19f);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1b2);[a29_0x3a2ccf(0x1a6)](_0xe17f98){const _0x3c9e69=a29_0x3a2ccf,_0x24dfad=_0xe17f98[_0x3c9e69(0x1b7)][0x0];if(!_0x24dfad)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x451722){const _0x6c7dbb=a29_0x3a2ccf,{options:_0x30f8e5,args:_0x32ad4a,tdx:_0x1f9364}=_0x451722,_0x13dd75=_0x32ad4a[0x0],_0x5f1935=await withSpinner(_0x6c7dbb(0x1d7),()=>_0x1f9364['jobs'][_0x6c7dbb(0x1de)](_0x13dd75),{'verbose':_0x30f8e5['verbose']}),_0x5991f8=_0x5f1935[_0x6c7dbb(0x1ab)];return console[_0x6c7dbb(0x1ed)](_0x6c7dbb(0x1c2)+_0x5991f8['length']+_0x6c7dbb(0x1d4)+(_0x5991f8['length']!==0x1?'s':'')),await handleSDKOutput(_0x5991f8,_0x30f8e5),0x0;}}
|
|
1
|
+
function a29_0x2d77(_0x2f5cda,_0x239fea){_0x2f5cda=_0x2f5cda-0x154;const _0x329cf7=a29_0x329c();let _0x2d7791=_0x329cf7[_0x2f5cda];return _0x2d7791;}const a29_0x2eb8a4=a29_0x2d77;(function(_0x5c9c8b,_0x6fe919){const _0x11ccf1=a29_0x2d77,_0x450512=_0x5c9c8b();while(!![]){try{const _0x3a516e=parseInt(_0x11ccf1(0x170))/0x1*(-parseInt(_0x11ccf1(0x15e))/0x2)+parseInt(_0x11ccf1(0x168))/0x3+-parseInt(_0x11ccf1(0x161))/0x4*(-parseInt(_0x11ccf1(0x1a5))/0x5)+parseInt(_0x11ccf1(0x16a))/0x6+parseInt(_0x11ccf1(0x177))/0x7*(-parseInt(_0x11ccf1(0x1a4))/0x8)+-parseInt(_0x11ccf1(0x162))/0x9+parseInt(_0x11ccf1(0x16d))/0xa*(parseInt(_0x11ccf1(0x18f))/0xb);if(_0x3a516e===_0x6fe919)break;else _0x450512['push'](_0x450512['shift']());}catch(_0x3c8773){_0x450512['push'](_0x450512['shift']());}}}(a29_0x329c,0xb2bd6));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x329c(){const _0xaf59e1=['22052IwfLiN','11774295dcfVAm','file','Listing\x20jobs...','created_at','now','join','1693167IIckoN','yes','3962742RHVdLO','Cancelled','type','5960QNcncy','show','job:submit','258oSFWjC','job_id','job:result','debug','execute','INVALID_ARGUMENT','✔\x20Job\x20submitted','14POfvmI','description','\x27\x20to\x20verify\x20the\x20job\x20status','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','h\x20ago','green','success','mo\x20ago','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','information_schema','Database:\x20','floor','trino','getTime','List\x20jobs','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','args','result','status','user_name','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','No\x20SQL\x20statements\x20found\x20in\x20file','Limit:\x20','29546hNQHGG','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','red','Submitting\x20kill\x20request...','push','data','length','verbose','abs','round','jobs','map','d\x20ago','\x20jobs','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','end_at','start_at','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','dim','url','presto','2795784jUAKwm','695mHRHyE','Getting\x20job\x20details...','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','job:show','database','substring','Get\x20job\x20results','Query:\x20','error','query','name','6610lWbwoX','list','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'];a29_0x329c=function(){return _0xaf59e1;};return a29_0x329c();}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 a29_0xb739ab from'chalk';function formatDuration(_0x2c17d2){const _0x390ae5=a29_0x2d77;if(_0x2c17d2<0x3c)return _0x2c17d2+'s';if(_0x2c17d2<0xe10)return Math['floor'](_0x2c17d2/0x3c)+'m\x20'+_0x2c17d2%0x3c+'s';const _0x36bae0=Math[_0x390ae5(0x183)](_0x2c17d2/0xe10),_0x4bbb78=Math[_0x390ae5(0x183)](_0x2c17d2%0xe10/0x3c);return _0x4bbb78>0x0?_0x36bae0+'h\x20'+_0x4bbb78+'m':_0x36bae0+'h';}function formatRelativeTime(_0x2f8b79){const _0x11041c=a29_0x2d77,_0x393528=Date[_0x11041c(0x166)]()-_0x2f8b79[_0x11041c(0x185)](),_0x5c8e85=Math['floor'](Math[_0x11041c(0x197)](_0x393528)/0x3e8);if(_0x5c8e85<0x3c)return'just\x20now';const _0x41729d=Math[_0x11041c(0x183)](_0x5c8e85/0x3c);if(_0x41729d<0x3c)return _0x41729d+'m\x20ago';const _0x19996c=Math[_0x11041c(0x183)](_0x41729d/0x3c);if(_0x19996c<0x18)return _0x19996c+_0x11041c(0x17b);const _0x2cc0e0=Math[_0x11041c(0x183)](_0x19996c/0x18);if(_0x2cc0e0<0x1e)return _0x2cc0e0+_0x11041c(0x19b);return Math[_0x11041c(0x183)](_0x2cc0e0/0x1e)+_0x11041c(0x17e);}export class JobListCommand extends BaseCommand{[a29_0x2eb8a4(0x15d)]=a29_0x2eb8a4(0x199);[a29_0x2eb8a4(0x178)]=a29_0x2eb8a4(0x186);async['execute'](_0x535969){const _0x4965f1=a29_0x2eb8a4,{options:_0x9fa43a,tdx:_0x36f02b}=_0x535969,_0xbf9e3d=resolveLimit(_0x9fa43a['limit'],DEFAULT_DISPLAY_LIMIT),_0x34eff4=_0x9fa43a[_0x4965f1(0x18a)];_0x9fa43a[_0x4965f1(0x196)]&&(console['error'](_0x4965f1(0x18e)+_0xbf9e3d+_0x4965f1(0x19c)),_0x34eff4&&console['error']('Status\x20filter:\x20'+_0x34eff4));const _0x3a317f=await withSpinner(_0x4965f1(0x164),()=>_0x36f02b[_0x4965f1(0x199)][_0x4965f1(0x15f)]({'from':0x0,'to':_0xbf9e3d-0x1,'status':_0x34eff4}),{'verbose':_0x9fa43a['verbose']}),_0x2f4609=_0x3a317f[_0x4965f1(0x194)];console[_0x4965f1(0x15b)]('✔\x20Found\x20'+_0x2f4609[_0x4965f1(0x195)]+'\x20job'+(_0x2f4609[_0x4965f1(0x195)]!==0x1?'s':''));const _0x765a3d=_0x9fa43a[_0x4965f1(0x17f)];if(isStructuredFormat(_0x9fa43a)){const _0x443bef=_0x2f4609[_0x4965f1(0x19a)](_0x3cb27c=>{const _0x4b1481=_0x4965f1;let _0x8c8d23;if(_0x3cb27c['start_at']&&_0x3cb27c['end_at']){const _0x4b1611=new Date(_0x3cb27c[_0x4b1481(0x19f)])[_0x4b1481(0x185)](),_0x23b3d6=new Date(_0x3cb27c[_0x4b1481(0x19e)])['getTime']();_0x8c8d23=Math[_0x4b1481(0x198)]((_0x23b3d6-_0x4b1611)/0x3e8);}return{'job_id':_0x3cb27c['job_id'],'type':_0x3cb27c[_0x4b1481(0x16c)]===_0x4b1481(0x1a3)?_0x4b1481(0x184):_0x3cb27c[_0x4b1481(0x16c)],'status':_0x3cb27c['status'],'user_name':_0x3cb27c[_0x4b1481(0x18b)],'duration_sec':_0x8c8d23,'created_at':_0x3cb27c['created_at'],'started_at':_0x3cb27c['start_at'],'end_at':_0x3cb27c[_0x4b1481(0x19e)]};});await handleSDKOutput(_0x443bef,_0x9fa43a);}else for(const _0x11f8b3 of _0x2f4609){const _0x34d16d=_0x11f8b3['status']===_0x4965f1(0x17d)?a29_0xb739ab[_0x4965f1(0x17c)]:_0x11f8b3['status']===_0x4965f1(0x15b)?a29_0xb739ab[_0x4965f1(0x191)]:a29_0xb739ab[_0x4965f1(0x1a1)],_0xcc02fb=_0x34d16d(_0x11f8b3[_0x4965f1(0x18a)]),_0x2c74e2=getJobUrl(_0x765a3d,_0x11f8b3[_0x4965f1(0x171)]),_0x34fc8a=hyperlink(_0x11f8b3[_0x4965f1(0x171)],_0x2c74e2),_0x23af98=a29_0xb739ab[_0x4965f1(0x1a1)](_0x11f8b3[_0x4965f1(0x16c)]==='presto'?_0x4965f1(0x184):_0x11f8b3[_0x4965f1(0x16c)]),_0xdfb51a=[];if(_0x11f8b3[_0x4965f1(0x19f)]&&_0x11f8b3[_0x4965f1(0x19e)]){const _0x375f83=Math[_0x4965f1(0x198)]((new Date(_0x11f8b3[_0x4965f1(0x19e)])[_0x4965f1(0x185)]()-new Date(_0x11f8b3[_0x4965f1(0x19f)])[_0x4965f1(0x185)]())/0x3e8);_0xdfb51a[_0x4965f1(0x193)](formatDuration(_0x375f83));}if(_0x11f8b3[_0x4965f1(0x19e)])_0xdfb51a[_0x4965f1(0x193)](formatRelativeTime(new Date(_0x11f8b3[_0x4965f1(0x19e)])));else _0x11f8b3[_0x4965f1(0x19f)]&&_0xdfb51a[_0x4965f1(0x193)](formatRelativeTime(new Date(_0x11f8b3[_0x4965f1(0x19f)])));const _0x4d4d69=_0xdfb51a[_0x4965f1(0x195)]>0x0?a29_0xb739ab[_0x4965f1(0x1a1)]('\x20'+_0xdfb51a[_0x4965f1(0x167)](',\x20')):'';console['log']('⚡\x20'+_0x34fc8a+'\x20'+_0x23af98+'\x20'+_0xcc02fb+_0x4d4d69);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a29_0x2eb8a4(0x15d)]=a29_0x2eb8a4(0x156);[a29_0x2eb8a4(0x178)]='Show\x20job\x20details';['validate'](_0x154c54){const _0x2236ab=a29_0x2eb8a4,_0x17c1b1=_0x154c54[_0x2236ab(0x188)][0x0];if(!_0x17c1b1)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a29_0x2eb8a4(0x174)](_0x2bb8ef){const _0x5049c9=a29_0x2eb8a4,{options:_0x354b83,args:_0xc71290,tdx:_0x52cc96}=_0x2bb8ef,_0x2ced58=_0xc71290[0x0],_0x174ba4=await withSpinner(_0x5049c9(0x154),()=>_0x52cc96[_0x5049c9(0x199)][_0x5049c9(0x16e)](_0x2ced58),{'verbose':_0x354b83[_0x5049c9(0x196)]}),_0x12e3de=_0x174ba4[_0x5049c9(0x194)];let _0x2942a4;if(_0x12e3de[_0x5049c9(0x19f)]&&_0x12e3de[_0x5049c9(0x19e)]){const _0x4424ae=new Date(_0x12e3de[_0x5049c9(0x19f)])[_0x5049c9(0x185)](),_0x24f544=new Date(_0x12e3de[_0x5049c9(0x19e)])[_0x5049c9(0x185)]();_0x2942a4=Math[_0x5049c9(0x198)]((_0x24f544-_0x4424ae)/0x3e8);}const _0x6a6a6a={'job_id':_0x12e3de['job_id'],'type':_0x12e3de[_0x5049c9(0x16c)],'status':_0x12e3de[_0x5049c9(0x18a)],..._0x12e3de[_0x5049c9(0x18b)]&&{'user_name':_0x12e3de[_0x5049c9(0x18b)]},..._0x2942a4!==undefined&&{'duration_sec':_0x2942a4},..._0x12e3de[_0x5049c9(0x165)]&&{'created_at':_0x12e3de[_0x5049c9(0x165)]},..._0x12e3de[_0x5049c9(0x19f)]&&{'started_at':_0x12e3de[_0x5049c9(0x19f)]},..._0x12e3de[_0x5049c9(0x19e)]&&{'end_at':_0x12e3de[_0x5049c9(0x19e)]},..._0x12e3de[_0x5049c9(0x157)]&&{'database':_0x12e3de[_0x5049c9(0x157)]},..._0x12e3de['priority']!==undefined&&{'priority':_0x12e3de['priority']},..._0x12e3de[_0x5049c9(0x1a2)]&&{'url':_0x12e3de[_0x5049c9(0x1a2)]},..._0x12e3de[_0x5049c9(0x15c)]&&{'query':_0x12e3de['query']},..._0x12e3de[_0x5049c9(0x173)]&&{'debug':_0x12e3de[_0x5049c9(0x173)]}};return await handleSingleObjectOutput(_0x6a6a6a,_0x354b83),0x0;}}export class JobKillCommand extends BaseCommand{['name']='job:kill';[a29_0x2eb8a4(0x178)]='Kill\x20a\x20job';['validate'](_0x13ab9a){const _0xd53170=a29_0x2eb8a4,_0x415ec9=_0x13ab9a[_0xd53170(0x188)][0x0];if(!_0x415ec9)return _0xd53170(0x180);return undefined;}async[a29_0x2eb8a4(0x174)](_0x3bafd5){const _0x507fa7=a29_0x2eb8a4,{options:_0x1aefa5,args:_0x417ee3,tdx:_0x438d32}=_0x3bafd5,_0x7d15ec=_0x417ee3[0x0];if(!_0x1aefa5[_0x507fa7(0x169)]){const _0x340307=await confirm(_0x507fa7(0x190)+_0x7d15ec+'?');if(!_0x340307)return console[_0x507fa7(0x15b)](_0x507fa7(0x16b)),0x0;}return await withSpinner(_0x507fa7(0x192),()=>_0x438d32[_0x507fa7(0x199)]['kill'](_0x7d15ec),{'verbose':_0x1aefa5[_0x507fa7(0x196)]}),console[_0x507fa7(0x15b)](_0x507fa7(0x19d)+_0x7d15ec),console['error'](_0x507fa7(0x155)+_0x7d15ec+_0x507fa7(0x179)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a29_0x2eb8a4(0x16f);['description']='Submit\x20a\x20job';async[a29_0x2eb8a4(0x174)](_0x37c70c){const _0x31075f=a29_0x2eb8a4,{options:_0x585995,args:_0x5441e7,tdx:_0x463b1d}=_0x37c70c,_0x551363=_0x585995['jobType']||_0x31075f(0x184),_0x177855=_0x585995[_0x31075f(0x163)],_0x381d11=_0x585995[_0x31075f(0x157)]||_0x31075f(0x181),_0x58b965=_0x585995[_0x31075f(0x189)];if(_0x551363!==_0x31075f(0x184)&&_0x551363!=='hive')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x31075f(0x160));let _0x76c84e;if(_0x177855){if(_0x5441e7[0x0])throw new SDKError(ErrorCode[_0x31075f(0x175)],_0x31075f(0x17a));const _0x2d286c=readSqlStatementsFromFile(_0x177855);if(_0x2d286c[_0x31075f(0x195)]===0x0)throw new SDKError(ErrorCode[_0x31075f(0x175)],_0x31075f(0x18d));if(_0x2d286c[_0x31075f(0x195)]>0x1)throw new SDKError(ErrorCode[_0x31075f(0x175)],_0x31075f(0x187));_0x76c84e=_0x2d286c[0x0];}else{if(!_0x5441e7[0x0])throw new SDKError(ErrorCode[_0x31075f(0x175)],_0x31075f(0x1a0));_0x76c84e=_0x5441e7[0x0];}_0x585995[_0x31075f(0x196)]&&(console['error']('Job\x20type:\x20'+_0x551363),console[_0x31075f(0x15b)](_0x31075f(0x182)+_0x381d11),console['error'](_0x31075f(0x15a)+_0x76c84e[_0x31075f(0x158)](0x0,0x64)+(_0x76c84e[_0x31075f(0x195)]>0x64?'...':'')));const _0x281378=await withSpinner('Submitting\x20job...',()=>_0x463b1d[_0x31075f(0x199)]['submit'](_0x381d11,_0x76c84e,_0x551363,_0x58b965),{'verbose':_0x585995[_0x31075f(0x196)]}),_0x325666=_0x281378['data'];return console[_0x31075f(0x15b)](_0x31075f(0x176)),console[_0x31075f(0x15b)]('\x20\x20Job\x20ID:\x20'+_0x325666[_0x31075f(0x171)]),await handleSDKOutput([_0x325666],_0x585995),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a29_0x2eb8a4(0x172);[a29_0x2eb8a4(0x178)]=a29_0x2eb8a4(0x159);['validate'](_0xddd75c){const _0x4e0b09=a29_0x2eb8a4,_0x10bbaa=_0xddd75c['args'][0x0];if(!_0x10bbaa)return _0x4e0b09(0x18c);return undefined;}async[a29_0x2eb8a4(0x174)](_0x220995){const _0x331290=a29_0x2eb8a4,{options:_0x3122d0,args:_0x538a51,tdx:_0x4c2662}=_0x220995,_0x4ba968=_0x538a51[0x0],_0x109219=await withSpinner('Getting\x20job\x20results...',()=>_0x4c2662['jobs'][_0x331290(0x189)](_0x4ba968),{'verbose':_0x3122d0['verbose']}),_0x53e786=_0x109219[_0x331290(0x194)];return console[_0x331290(0x15b)]('✔\x20Retrieved\x20'+_0x53e786[_0x331290(0x195)]+'\x20row'+(_0x53e786[_0x331290(0x195)]!==0x1?'s':'')),await handleSDKOutput(_0x53e786,_0x3122d0),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x242395=a30_0x5b1b;(function(_0x2a74d4,_0x763d39){const _0x23dab1=a30_0x5b1b,_0x3b1b9b=_0x2a74d4();while(!![]){try{const _0xae7c58=parseInt(_0x23dab1(0x1f0))/0x1*(parseInt(_0x23dab1(0x1fe))/0x2)+-parseInt(_0x23dab1(0x13c))/0x3*(parseInt(_0x23dab1(0x203))/0x4)+parseInt(_0x23dab1(0x1c3))/0x5+-parseInt(_0x23dab1(0x1c1))/0x6+parseInt(_0x23dab1(0x202))/0x7*(-parseInt(_0x23dab1(0x155))/0x8)+parseInt(_0x23dab1(0x1cf))/0x9+parseInt(_0x23dab1(0x1bf))/0xa;if(_0xae7c58===_0x763d39)break;else _0x3b1b9b['push'](_0x3b1b9b['shift']());}catch(_0x30f705){_0x3b1b9b['push'](_0x3b1b9b['shift']());}}}(a30_0x1f27,0x3dfe5));import a30_0x247543 from'chalk';function a30_0x1f27(){const _0x4d8456=['resourceName','database','Database:\x20','Write\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Listing\x20journey\x20versions...','2690990TeHKDD','repeat','1821396dePSne','targetDir','2178545cPVtpC','Aborted.','updatedAt','parentSegment','dryRun','\x20\x20Parent\x20segment:\x20','journeyStages','parentName','stage','Journey:','Error:\x20Invalid\x20version\x20number:\x20','Error:\x20--version\x20option\x20is\x20required','1458837hsOqzF','audienceId','activation','\x20@\x20','nodes','journey:version:create','red','ID:','(unnamed)','\x20\x20Consolidating\x20duplicate\x20segment:\x20','getParentFull','journey:columns','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Warning:\x20Could\x20not\x20resolve\x20segment\x20','description','Parent\x20segment:\x20','\x20(ID:\x20','from','jsonl','Fetching\x20parent\x20segment...','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','data','\x22\x20resumed','\x20(draft)\x20—\x20\x22','scheduleType','Status:','resolveParentId','journey:pull','has','history','isNew','utf-8','segment','1YViRtn','\x22\x20not\x20found','pausedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Available\x20stages:\x20','listActivationsFlat','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Getting\x20journey\x20details...','listVersions','tdx.json','state','localeCompare','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','sort','767246qUIaav','runAt','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','pause','3004085WEVuYA','8AdbUXS','yellow','journeyName','length','cyan','type','.journey.yml','limit','Error:\x20Journey\x20not\x20found:\x20','\x20changed\x20files','\x20\x20-\x20','dim','renderStats','map','listJourneysFromParentSegment','goal','Target\x20file:\x20','resolveJourneyId','journey:version:view','Resolving\x20parent\x20segment...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','launched','web','test','values','✔\x20All\x20files\x20are\x20up\x20to\x20date','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','session','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','connection','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','draft','journey:view','stageNameMap','push','No\x20statistics\x20available\x20for\x20journey:\x20','(none)','green','journeyId','yes','find','toLowerCase','List\x20all\x20versions\x20of\x20a\x20journey','segmentName','Listing\x20journeys...','\x20journey\x20files\x20to\x20','Error:\x20','hasChanges','json','Fetching\x20journey\x20','exitOrJumpRate','Pattern:\x20','Activations:','journey:run','\x22\x20paused','journey:resume','getActivation','filePath','connection\x20','columns','✔\x20Found\x20','parent_segment','segmentPushCommand','error','Journey\x20name:\x20','(draft)','\x20\x20Target:\x20','Getting\x20column\x20mapping...','getJourney','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20Opening\x20','Show\x20journey\x20table\x20column\x20mapping','site','log','none','file','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Parent\x20segment\x20context\x20required','then','Found\x20','Export\x20journey(s)\x20as\x20YAML\x20files','Input:\x20','table','conversion','Folder\x20path:\x20','Paused\x20at:','cwd','Getting\x20journey\x20statistics...','\x20not\x20found.\x20Available:\x20','execute','\x20version','\x20new\x20files','395817Smwlqn','goalSize','hasPeriod','versionNumber','root\x20folder','all','add','\x20Journey\x20workflow\x20started','executeDryRun','includeHistory','paused','📁\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journey','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Error:\x20Invalid\x20--type\x20\x22','kind','Error:\x20Stage\x20\x22','/j/da/je','Parent\x20segment\x20ID:','\x27\x20not\x20found\x20in\x20','get','Resolving\x20journey...','State:','\x20=\x20','8MyPDFH','\x0aError:','Session:','blue','\x20details...','setPhase','enteredSize','getSegment','activation_','journeyBundleId','name','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','(archived)','user','no\x20connection','reentryMode','\x20files?','segments','\x5c$&','bold','resolveSegment','connectionId','milestoneSize','✔\x20Context\x20set:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','set','journey:activations','connector_config','absolutePath','content','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Table:\x20','version','journeyBundleName','INVALID_ARGUMENT','🗺️\x20','folders','includeStats','buildIdToNameMap','diff','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','size','\x0aPull\x20summary:','journey:list','attributes','rootFolderId','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','journey:versions','Pausing\x20journey...','Show\x20journey\x20statistics','Resume\x20a\x20paused\x20journey','workflowSessionId','journey:traffic','\x20\x20Folder\x20path:\x20','buildIdToEmailMap','Paused:','rule','...','relative','createdAt','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20Journey\x20\x22','Cancelled','Resolving\x20version...','stages','\x20journey','getStatistics','\x20\x20←\x20','No\x20journeys\x20found','Triggering\x20journey\x20workflow...','runAfterJourneyRefresh','workflowId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','activationParams',',\x20schedule:\x20','Listing\x20journey\x20activations...','Stages:','⚠️\x20','journey:stats','message','folderPath','Error:\x20Journey\x20\x27','relativePath','filter','split','join','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','/app/ps/','\x20versions)','run','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','format','(root)','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','/e/','Target\x20directory:\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','verbose','Trigger\x20on-demand\x20journey\x20workflow\x20execution'];a30_0x1f27=function(){return _0x4d8456;};return a30_0x1f27();}import a30_0x326e95 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 requireNameOrPath(_0x107bab){const _0x461b7d=a30_0x5b1b;return!_0x107bab&&(console[_0x461b7d(0x11f)](_0x461b7d(0x1e3)),console[_0x461b7d(0x11f)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x107bab;}function withJsonFormat(_0x53ea4c){const _0x585773=a30_0x5b1b;if(!_0x53ea4c[_0x585773(0x1b1)]&&!_0x53ea4c['json']&&!_0x53ea4c[_0x585773(0x1e1)]&&!_0x53ea4c['tsv'])return{..._0x53ea4c,'format':_0x585773(0x233),'json':!![]};return _0x53ea4c;}function formatJourneyState(_0x2f3333){const _0x29830d=a30_0x5b1b;switch(_0x2f3333){case _0x29830d(0x218):return a30_0x247543[_0x29830d(0x228)]('(running)');case _0x29830d(0x222):return a30_0x247543['dim'](_0x29830d(0x121));case _0x29830d(0x146):return a30_0x247543[_0x29830d(0x204)]('(paused)');case'completed':return a30_0x247543[_0x29830d(0x158)]('(completed)');case'archived':return a30_0x247543[_0x29830d(0x20e)](_0x29830d(0x162));default:return'('+_0x2f3333+')';}}function a30_0x5b1b(_0xab05a2,_0x3ae91c){_0xab05a2=_0xab05a2-0x111;const _0x1f2719=a30_0x1f27();let _0x5b1b95=_0x1f2719[_0xab05a2];return _0x5b1b95;}function formatJourneyItem(_0x3f6524,_0x593db7='',_0x3fb256){const _0x37878c=a30_0x5b1b,_0x489b79=formatJourneyState(_0x3f6524['state']),_0x464dbe=_0x3fb256?hyperlink(_0x3f6524[_0x37878c(0x177)],_0x3fb256):_0x3f6524[_0x37878c(0x177)];return _0x593db7+_0x37878c(0x179)+_0x464dbe+'\x20'+_0x489b79;}function escapeRegex(_0x30b05c){const _0x2102c4=a30_0x5b1b;return _0x30b05c['replace'](/[.*+?^${}()|[\]\\]/g,_0x2102c4(0x168));}function globToRegex(_0x545520){const _0x588dbf=a30_0x5b1b,_0x4bb3f7=_0x545520[_0x588dbf(0x1aa)]('*')[_0x588dbf(0x210)](escapeRegex);return new RegExp(_0x4bb3f7[_0x588dbf(0x1ab)]('.*'),'i');}function buildRuleToNameMapping(_0x535d52){const _0x536a22=a30_0x5b1b,_0x564b5b=new Map();if(_0x535d52[_0x536a22(0x167)])for(const [_0xeb7f4c,_0x558c93]of Object['entries'](_0x535d52['segments'])){if(_0x558c93[_0x536a22(0x18e)]){const _0xa6102d=serializeRule(_0x558c93['rule']),_0x58793f=_0x564b5b['get'](_0xa6102d);_0x58793f?_0x58793f['push'](_0xeb7f4c):_0x564b5b[_0x536a22(0x16f)](_0xa6102d,[_0xeb7f4c]);}}return _0x564b5b;}async function resolveJourneyIdFromInput(_0x4a56d8,_0x4969aa,_0x253dfe){const _0x150c74=a30_0x5b1b,_0x301480=await resolveJourneyTarget(_0x4a56d8,_0x4969aa[_0x150c74(0x1c6)],_0x4969aa['verbose']),_0x385de7=_0x301480[_0x150c74(0x1c6)];if(!_0x385de7)throw new SDKError(ErrorCode[_0x150c74(0x178)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0xc48321=await withSpinner(_0x150c74(0x216),()=>_0x253dfe['segment']['resolveParentId'](_0x385de7),{'verbose':_0x4969aa[_0x150c74(0x1b7)]}),_0x42493d=_0xc48321[_0x150c74(0x1e4)],_0x31d147=await withSpinner(_0x150c74(0x152),()=>_0x253dfe[_0x150c74(0x149)][_0x150c74(0x214)](_0x42493d,_0x301480[_0x150c74(0x205)]),{'verbose':_0x4969aa[_0x150c74(0x1b7)]});return{'journeyId':_0x31d147['data'],'journeyName':_0x301480[_0x150c74(0x205)],'parentSegmentId':_0x42493d};}async function resolveJourneyTarget(_0x1a5885,_0x48ebce,_0x3f4a5b){const _0x5c3f0e=a30_0x5b1b;if(isYamlFilePath(_0x1a5885))try{const _0x3f369e=await resolveYamlFilePath(_0x1a5885);return _0x3f4a5b&&(console[_0x5c3f0e(0x11f)]('Resolved\x20YAML\x20file:\x20'+_0x1a5885),console[_0x5c3f0e(0x11f)](_0x5c3f0e(0x1c8)+_0x3f369e[_0x5c3f0e(0x1c6)]),console[_0x5c3f0e(0x11f)]('\x20\x20Name:\x20'+_0x3f369e[_0x5c3f0e(0x22e)]),console[_0x5c3f0e(0x11f)](_0x5c3f0e(0x18b)+(_0x3f369e[_0x5c3f0e(0x1a6)]||_0x5c3f0e(0x1b2)))),{'journeyName':_0x3f369e['segmentName'],'parentSegment':_0x3f369e['parentSegment'],'resolved':_0x3f369e};}catch(_0x1a5d7d){throw new SDKError(ErrorCode[_0x5c3f0e(0x178)],_0x5c3f0e(0x1bd)+_0x1a5d7d[_0x5c3f0e(0x1a5)]);}if(!_0x48ebce)throw new SDKError(ErrorCode[_0x5c3f0e(0x178)],_0x5c3f0e(0x174));return{'journeyName':_0x1a5885,'parentSegment':_0x48ebce};}export class JourneyListCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x181);['description']='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x198efd){const _0x16ef6e=a30_0x242395,{options:_0x4e979b,args:_0x1a921f,tdx:_0x42f25b}=_0x198efd,_0x3e81fe=_0x1a921f[0x0],_0x4eca6d=_0x4e979b[_0x16ef6e(0x1c6)];if(!_0x4eca6d)return console[_0x16ef6e(0x11f)](_0x16ef6e(0x12d)),console[_0x16ef6e(0x11f)](_0x16ef6e(0x16e)),0x1;const _0x1873a6=await withSpinner(_0x16ef6e(0x216),()=>_0x42f25b[_0x16ef6e(0x1ef)]['resolveParentId'](_0x4eca6d),{'verbose':_0x4e979b[_0x16ef6e(0x1b7)]}),_0x16c4b6=_0x1873a6[_0x16ef6e(0x1e4)];_0x4e979b[_0x16ef6e(0x1b7)]&&(console['error']('Parent\x20segment:\x20'+_0x4eca6d+_0x16ef6e(0x1df)+_0x16c4b6+')'),_0x3e81fe&&console[_0x16ef6e(0x11f)](_0x16ef6e(0x113)+_0x3e81fe));const _0x456d6d=await withSpinner(_0x16ef6e(0x1e2),()=>_0x42f25b[_0x16ef6e(0x1ef)][_0x16ef6e(0x1d9)](_0x16c4b6),{'verbose':_0x4e979b['verbose']}),_0x4f0677=_0x456d6d[_0x16ef6e(0x1e4)],_0x4eb520=_0x4f0677[_0x16ef6e(0x183)],_0x5d839e=await withSpinner(_0x16ef6e(0x22f),()=>_0x42f25b['journey']['listJourneysWithFolders'](_0x16c4b6,_0x4eb520),{'verbose':_0x4e979b[_0x16ef6e(0x1b7)]});let _0x460289=_0x5d839e[_0x16ef6e(0x1e4)]['journeys'];const _0x1a8cc4=_0x5d839e[_0x16ef6e(0x1e4)][_0x16ef6e(0x17a)],_0x2e1025=new Map();for(const _0x3d1085 of _0x1a8cc4){_0x2e1025[_0x16ef6e(0x16f)](_0x3d1085['id'],_0x3d1085[_0x16ef6e(0x15f)]);}if(_0x3e81fe){const _0x47ee45=globToRegex(_0x3e81fe);_0x460289=_0x460289[_0x16ef6e(0x1a9)](_0x4ab1e0=>_0x47ee45[_0x16ef6e(0x21a)](_0x4ab1e0['journeyBundleName']));}console[_0x16ef6e(0x11f)](_0x16ef6e(0x11c)+_0x460289[_0x16ef6e(0x206)]+_0x16ef6e(0x197)+(_0x460289[_0x16ef6e(0x206)]!==0x1?'s':''));const _0x266631=_0x25092a=>{const _0x515373=_0x16ef6e;return getConsoleNextUrl(_0x4e979b[_0x515373(0x128)],_0x515373(0x1ad)+_0x16c4b6+'/e/'+_0x25092a+'/j/da');};if(_0x4e979b[_0x16ef6e(0x1b1)]===_0x16ef6e(0x132))await handleSDKOutput(_0x460289,_0x4e979b);else{if(_0x4e979b[_0x16ef6e(0x1b1)]==='json'){const _0x4cb109=_0x460289[_0x16ef6e(0x210)](_0x3d9298=>({..._0x3d9298,'url':_0x266631(_0x3d9298['id'])}));await handleSDKOutput(_0x4cb109,_0x4e979b);}else{console[_0x16ef6e(0x129)]('['+_0x4eca6d+']');const _0x4ad449=new Map(),_0x566e7d=[];for(const _0x3a5b9a of _0x460289){if(!_0x3a5b9a[_0x16ef6e(0x160)]||_0x3a5b9a[_0x16ef6e(0x160)]===_0x4eb520)_0x566e7d[_0x16ef6e(0x225)](_0x3a5b9a);else{const _0x2d372c=_0x4ad449[_0x16ef6e(0x151)](_0x3a5b9a[_0x16ef6e(0x160)])||[];_0x2d372c[_0x16ef6e(0x225)](_0x3a5b9a),_0x4ad449[_0x16ef6e(0x16f)](_0x3a5b9a['folderId'],_0x2d372c);}}const _0x33ae00=(_0x28ae83,_0x5ee218)=>_0x28ae83[_0x16ef6e(0x177)][_0x16ef6e(0x1fb)](_0x5ee218[_0x16ef6e(0x177)],undefined,{'sensitivity':'base'});_0x566e7d[_0x16ef6e(0x1fd)](_0x33ae00);for(const _0x3e530a of _0x566e7d){console[_0x16ef6e(0x129)](formatJourneyItem(_0x3e530a,'',_0x266631(_0x3e530a['id'])));}const _0x375976=[..._0x4ad449['entries']()][_0x16ef6e(0x1fd)]((_0x174056,_0x24ec84)=>{const _0x146f1f=_0x16ef6e,_0x620b04=_0x2e1025['get'](_0x174056[0x0])||_0x174056[0x0],_0x53db4d=_0x2e1025[_0x146f1f(0x151)](_0x24ec84[0x0])||_0x24ec84[0x0];return _0x620b04['localeCompare'](_0x53db4d,undefined,{'sensitivity':'base'});});for(const [_0x875c8a,_0x3549a8]of _0x375976){const _0x150265=_0x2e1025['get'](_0x875c8a)||_0x875c8a;console[_0x16ef6e(0x129)](_0x16ef6e(0x147)+_0x150265),_0x3549a8['sort'](_0x33ae00);for(const _0x16f313 of _0x3549a8){console[_0x16ef6e(0x129)](formatJourneyItem(_0x16f313,'\x20\x20',_0x266631(_0x16f313['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x223);['description']='Show\x20journey\x20details';async['execute'](_0x3b5715){const _0x59311c=a30_0x242395,{options:_0x1c92cc,args:_0x4ee79b,tdx:_0x982dbb}=_0x3b5715,_0x15db16=_0x4ee79b[0x0];if(!_0x15db16)return console[_0x59311c(0x11f)](_0x59311c(0x1e3)),console[_0x59311c(0x11f)](_0x59311c(0x1f6)),console[_0x59311c(0x11f)]('Options:'),console[_0x59311c(0x11f)](_0x59311c(0x1b3)),0x1;_0x1c92cc[_0x59311c(0x1b7)]&&console['error']('Input:\x20'+_0x15db16);const {journeyId:_0x5e7466,parentSegmentId:_0x35625a}=await resolveJourneyIdFromInput(_0x15db16,_0x1c92cc,_0x982dbb);if(_0x1c92cc[_0x59311c(0x219)]){const _0x5c5c4f=getConsoleNextUrl(_0x1c92cc[_0x59311c(0x128)],'/app/ps/'+_0x35625a+'/e/'+_0x5e7466+'/j/da/je');return console['error'](a30_0x247543[_0x59311c(0x228)]('✔')+_0x59311c(0x126)+a30_0x247543[_0x59311c(0x207)](_0x5c5c4f)),openBrowser(_0x5c5c4f),0x0;}const _0x19cf90=await withSpinner(_0x59311c(0x1f7),()=>_0x982dbb[_0x59311c(0x149)][_0x59311c(0x124)](_0x5e7466),{'verbose':_0x1c92cc[_0x59311c(0x1b7)]}),_0x52eb18=_0x19cf90[_0x59311c(0x1e4)],_0x33d392=_0x1c92cc[_0x59311c(0x17b)];let _0x4cdde7;if(_0x33d392)try{const _0x2dd32c=await withSpinner(_0x59311c(0x137),()=>_0x982dbb[_0x59311c(0x149)][_0x59311c(0x198)](_0x5e7466),{'verbose':_0x1c92cc[_0x59311c(0x1b7)]});_0x4cdde7=_0x2dd32c[_0x59311c(0x1e4)];}catch{_0x1c92cc[_0x59311c(0x1b7)]&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x2885d5=getConsoleNextUrl(_0x1c92cc[_0x59311c(0x128)],_0x59311c(0x1ad)+_0x35625a+_0x59311c(0x1b4)+_0x5e7466+_0x59311c(0x14e)),_0x1e096e={'id':_0x52eb18['id'],'name':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x15f)],'description':_0x52eb18[_0x59311c(0x182)]['description'],'state':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x1fa)],'paused':_0x52eb18['attributes'][_0x59311c(0x146)],'reentry_mode':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x165)],'stages':_0x52eb18['attributes'][_0x59311c(0x1c9)]?.[_0x59311c(0x206)]||0x0,..._0x52eb18[_0x59311c(0x182)]['goal']&&{'goal':_0x52eb18['attributes'][_0x59311c(0x212)]['name']},..._0x4cdde7&&{'statistics':{'size':_0x4cdde7['size'],'entered':_0x4cdde7[_0x59311c(0x15b)],'goal_achieved':_0x4cdde7[_0x59311c(0x13d)],'completion_rate':_0x4cdde7['completionRate'],'exit_or_jump':_0x4cdde7['exitOrJumpSize'],'exit_or_jump_rate':_0x4cdde7[_0x59311c(0x112)],'stages':_0x4cdde7[_0x59311c(0x196)]}},'url':_0x2885d5};return await handleSingleObjectOutput(_0x1e096e,_0x1c92cc),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1a4);[a30_0x242395(0x1dd)]=a30_0x242395(0x187);async[a30_0x242395(0x139)](_0x62ff1f){const _0xf829f6=a30_0x242395,{options:_0x318391,args:_0x3a888e,tdx:_0x45b717}=_0x62ff1f,_0x2211e6=_0x3a888e[0x0];if(!requireNameOrPath(_0x2211e6))return 0x1;_0x318391[_0xf829f6(0x1b7)]&&console[_0xf829f6(0x11f)](_0xf829f6(0x131)+_0x2211e6);const _0x3e53f3=_0x318391,_0xa253e7=_0x3e53f3[_0xf829f6(0x1e0)],_0x2a1cbc=_0x3e53f3['to'],_0x5d5668=_0x3e53f3[_0xf829f6(0x145)],_0x375cf5=_0x3e53f3[_0xf829f6(0x1cb)];_0x5d5668&&!_0xa253e7&&!_0x2a1cbc&&console['error'](_0xf829f6(0x1b0));const _0x226012=_0x5d5668?withJsonFormat(_0x318391):_0x318391,{journeyId:_0x3b63a0,journeyName:_0x12c234}=await resolveJourneyIdFromInput(_0x2211e6,_0x226012,_0x45b717),_0x17a196=_0xa253e7||_0x2a1cbc?{'from':_0xa253e7,'to':_0x2a1cbc}:undefined,_0x1795ac=await withSpinner(_0xf829f6(0x137),()=>Promise[_0xf829f6(0x141)]([_0x45b717[_0xf829f6(0x149)][_0xf829f6(0x124)](_0x3b63a0),_0x45b717[_0xf829f6(0x149)]['getStatistics'](_0x3b63a0,_0x17a196)]),{'verbose':_0x226012[_0xf829f6(0x1b7)]}),[_0x353093,_0x4206c3]=_0x1795ac['data'];if(!_0x4206c3||_0x4206c3[_0xf829f6(0x229)]===null)return console[_0xf829f6(0x11f)](_0xf829f6(0x226)+_0x12c234),console[_0xf829f6(0x11f)](_0xf829f6(0x200)),0x0;const _0x18fe2c=buildStageNameMap(_0x353093),_0x40196a=!!(_0x17a196&&_0x4206c3['history']?.[_0xf829f6(0x206)]),_0x257c8b={'stageNameMap':_0x18fe2c,'hasPeriod':_0x40196a,'includeHistory':!!_0x5d5668};if(_0x375cf5&&_0x4206c3[_0xf829f6(0x196)]){const _0x2067bf=_0x4206c3[_0xf829f6(0x196)][_0xf829f6(0x22b)](_0x3aff99=>{const _0x3d2cf6=_0xf829f6,_0x30edbc=_0x18fe2c['get'](_0x3aff99['id'])??'';return _0x30edbc[_0x3d2cf6(0x22c)]()===_0x375cf5[_0x3d2cf6(0x22c)]();});if(_0x2067bf)return await handleSingleObjectOutput(formatStageStats(_0x2067bf,_0x257c8b),_0x226012),0x0;const _0x2af79b=_0x4206c3[_0xf829f6(0x196)]['map'](_0x63443d=>_0x18fe2c[_0xf829f6(0x151)](_0x63443d['id'])??_0x63443d['id']);return console[_0xf829f6(0x11f)](_0xf829f6(0x14d)+_0x375cf5+_0xf829f6(0x1f1)),console[_0xf829f6(0x11f)](_0xf829f6(0x1f4)+_0x2af79b['join'](',\x20')),0x1;}const _0x479009=_0x4206c3[_0xf829f6(0x196)]?.[_0xf829f6(0x210)](_0x3a8f51=>formatStageStats(_0x3a8f51,_0x257c8b)),_0x3fb99d=assembleJourneyStats(_0x4206c3,{'from':_0xa253e7,'to':_0x2a1cbc,'includeHistory':_0x5d5668});return await this[_0xf829f6(0x20f)](_0x3fb99d,_0x479009??[],_0x226012),0x0;}async[a30_0x242395(0x20f)](_0x58f43b,_0x12be18,_0x510db0){const _0x2b5d4f=a30_0x242395,_0x1096b0=_0x510db0[_0x2b5d4f(0x1b1)]==='json'||_0x510db0[_0x2b5d4f(0x1b1)]===_0x2b5d4f(0x1e1)||_0x510db0['json']||_0x510db0[_0x2b5d4f(0x1e1)];if(_0x1096b0){_0x58f43b['stages']=_0x12be18,await handleSingleObjectOutput(_0x58f43b,_0x510db0);return;}await handleSingleObjectOutput(_0x58f43b,_0x510db0);for(const _0x43b635 of _0x12be18){console['log'](''),console['log'](String(a30_0x247543['cyan']['bold']('['+_0x43b635[_0x2b5d4f(0x15f)]+']'))+a30_0x247543['dim']('\x20'+_0x43b635['id']));const {id:_0x12d6c8,name:_0x486622,..._0x5872d9}=_0x43b635;await handleSingleObjectOutput(_0x5872d9,_0x510db0);}}}export class JourneyTrafficCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x18a);['description']=a30_0x242395(0x221);async[a30_0x242395(0x139)](_0x380a21){const _0x320650=a30_0x242395,{options:_0x378985,args:_0x1d722,tdx:_0x584f21}=_0x380a21,_0x2c2286=_0x1d722[0x0];if(!requireNameOrPath(_0x2c2286))return 0x1;_0x378985[_0x320650(0x1b7)]&&console[_0x320650(0x11f)]('Input:\x20'+_0x2c2286);const _0x154f56=_0x378985,_0xbe0ecf=_0x154f56['type'],_0x2fc01d=_0x154f56[_0x320650(0x1e0)],_0x23d230=_0x154f56['to'],_0x5aff24=_0x154f56[_0x320650(0x20a)];if(_0xbe0ecf&&_0xbe0ecf!==_0x320650(0x133)&&_0xbe0ecf!==_0x320650(0x1d1))return console[_0x320650(0x11f)](_0x320650(0x14b)+_0xbe0ecf+_0x320650(0x148)),0x1;const _0x4c836d=withJsonFormat(_0x378985),{journeyId:_0x16d048,journeyName:_0x85ab77}=await resolveJourneyIdFromInput(_0x2c2286,_0x4c836d,_0x584f21),_0x5604f4={'type':_0xbe0ecf,'from':_0x2fc01d,'to':_0x23d230,'limit':_0x5aff24},_0x5267d0=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x584f21[_0x320650(0x149)]['getTrafficData'](_0x16d048,_0x5604f4),{'verbose':_0x4c836d['verbose']}),_0x11c0eb=_0x5267d0['data'],_0x345440=_0x11c0eb['conversion']&&(_0x11c0eb['conversion'][_0x320650(0x1d3)]['length']>0x0||_0x11c0eb['conversion']['links'][_0x320650(0x206)]>0x0),_0x3e0ca2=_0x11c0eb[_0x320650(0x1d1)]&&_0x11c0eb[_0x320650(0x1d1)][_0x320650(0x206)]>0x0;if(!_0x345440&&!_0x3e0ca2)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x85ab77),console['error'](_0x320650(0x17e)),_0x2fc01d&&_0x23d230&&console[_0x320650(0x11f)](_0x320650(0x19e)),0x0;return await handleSingleObjectOutput(_0x11c0eb,_0x4c836d),0x0;}}function formatStageStats(_0x1356fb,_0x328ca4){const _0x78da3f=a30_0x242395,_0x405624=_0x328ca4['hasPeriod']&&_0x1356fb[_0x78da3f(0x1ec)]?.['length']?aggregateStageHistory(_0x1356fb[_0x78da3f(0x1ec)]):{'size':_0x1356fb[_0x78da3f(0x17f)],'entered':_0x1356fb[_0x78da3f(0x15b)],'milestone':_0x1356fb[_0x78da3f(0x16c)],'milestone_rate':_0x1356fb['completeMilestoneRate'],'exit_or_jump':_0x1356fb['exitOrJumpSize'],'exit_or_jump_rate':_0x1356fb[_0x78da3f(0x112)]},_0x41450a={'id':_0x1356fb['id'],'name':_0x328ca4[_0x78da3f(0x224)][_0x78da3f(0x151)](_0x1356fb['id'])??_0x1356fb['id'],..._0x405624};return _0x328ca4[_0x78da3f(0x13e)]&&_0x328ca4['includeHistory']&&_0x1356fb[_0x78da3f(0x1ec)]&&(_0x41450a['history']=_0x1356fb['history']),_0x41450a;}export class JourneyPauseCommand extends BaseCommand{[a30_0x242395(0x15f)]='journey:pause';[a30_0x242395(0x1dd)]='Pause\x20a\x20running\x20journey';async['execute'](_0x2c010c){const _0x651185=a30_0x242395,{options:_0x76018c,args:_0x10e3b0,tdx:_0x4dbb5c}=_0x2c010c,_0x3b01fe=_0x10e3b0[0x0];if(!requireNameOrPath(_0x3b01fe))return 0x1;_0x76018c[_0x651185(0x1b7)]&&console[_0x651185(0x11f)]('Input:\x20'+_0x3b01fe);const {journeyId:_0x4679af,journeyName:_0xab0547}=await resolveJourneyIdFromInput(_0x3b01fe,_0x76018c,_0x4dbb5c);if(!_0x76018c[_0x651185(0x22a)]){const _0x15044d=await confirm(_0x651185(0x217)+_0xab0547+'\x22?');if(!_0x15044d)return console['error'](_0x651185(0x194)),0x0;}const _0x702e59=await withSpinner(_0x651185(0x186),()=>_0x4dbb5c['journey'][_0x651185(0x201)](_0x4679af),{'verbose':_0x76018c[_0x651185(0x1b7)]}),_0x11b082=_0x702e59[_0x651185(0x1e4)];return console[_0x651185(0x11f)](_0x651185(0x193)+_0x11b082[_0x651185(0x182)][_0x651185(0x15f)]+_0x651185(0x116)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x115);[a30_0x242395(0x1dd)]=a30_0x242395(0x1b8);async['execute'](_0x48c1c8){const _0x432587=a30_0x242395,{options:_0x172b91,args:_0x3e39bf,tdx:_0x194e64}=_0x48c1c8,_0x4e3e36=_0x3e39bf[0x0];if(!requireNameOrPath(_0x4e3e36))return 0x1;_0x172b91[_0x432587(0x1b7)]&&console[_0x432587(0x11f)]('Input:\x20'+_0x4e3e36);const {journeyId:_0x84e5a2,journeyName:_0x30d2b6}=await resolveJourneyIdFromInput(_0x4e3e36,_0x172b91,_0x194e64);if(_0x172b91[_0x432587(0x1c7)])return await this[_0x432587(0x144)](_0x48c1c8,_0x84e5a2,_0x30d2b6);if(!_0x172b91['yes']){const _0x2e79bf=await confirm(_0x432587(0x184)+_0x30d2b6+'\x22?');if(!_0x2e79bf)return console[_0x432587(0x11f)](_0x432587(0x194)),0x0;}const _0x4102e0=await withSpinner(_0x432587(0x19b),()=>_0x194e64[_0x432587(0x149)][_0x432587(0x1af)](_0x84e5a2),{'verbose':_0x172b91[_0x432587(0x1b7)]}),_0x411348=_0x4102e0[_0x432587(0x1e4)],_0x357523=getWorkflowSessionUrl(_0x172b91[_0x432587(0x128)],_0x411348[_0x432587(0x19d)],_0x411348['workflowSessionId']);return console[_0x432587(0x11f)]('\x0a'+a30_0x247543[_0x432587(0x228)]('✔')+_0x432587(0x143)),console[_0x432587(0x11f)]('\x20\x20'+a30_0x247543[_0x432587(0x20e)](_0x432587(0x1cc))+'\x20'+_0x30d2b6),console['error']('\x20\x20'+a30_0x247543['dim'](_0x432587(0x1e8))+'\x20'+_0x411348['status']),console['error']('\x20\x20'+a30_0x247543[_0x432587(0x20e)](_0x432587(0x157))+'\x20'+_0x411348[_0x432587(0x189)]),console[_0x432587(0x11f)]('\x20\x20'+_0x357523),0x0;}async[a30_0x242395(0x144)](_0x5604a2,_0x40a2ee,_0x263704){const _0x46027d=a30_0x242395,{options:_0x26cd83,tdx:_0x17a1db}=_0x5604a2,_0x20fa1f=await withSpinner(_0x46027d(0x111)+_0x263704+_0x46027d(0x18f),()=>Promise[_0x46027d(0x141)]([_0x17a1db['journey'][_0x46027d(0x124)](_0x40a2ee),_0x17a1db[_0x46027d(0x149)][_0x46027d(0x1f5)](_0x40a2ee)]),{'verbose':_0x26cd83[_0x46027d(0x1b7)]}),[_0x572dc0,_0xd80b8e]=_0x20fa1f['data'],_0x337d5b=_0x572dc0[_0x46027d(0x182)],_0x6d2980=_0x337d5b[_0x46027d(0x1c9)];console[_0x46027d(0x129)](a30_0x247543['bold']('Journey:'),_0x337d5b[_0x46027d(0x15f)]),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x1d6)),_0x572dc0['id']),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x153)),_0x337d5b[_0x46027d(0x1fa)]),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x18d)),_0x337d5b[_0x46027d(0x146)]?a30_0x247543['yellow'](_0x46027d(0x22a)):a30_0x247543[_0x46027d(0x228)]('no')),console[_0x46027d(0x129)](a30_0x247543['bold'](_0x46027d(0x14f)),_0x337d5b[_0x46027d(0x1d0)]);const _0x3076c2=_0x6d2980['length']>0x0?'\x20('+_0x6d2980[_0x46027d(0x210)](_0x49a650=>_0x49a650[_0x46027d(0x15f)])[_0x46027d(0x1ab)](',\x20')+')':'';console[_0x46027d(0x129)](a30_0x247543['bold']('Stages:'),''+_0x6d2980['length']+_0x3076c2),console[_0x46027d(0x129)]('');if(_0xd80b8e[_0x46027d(0x206)]===0x0)console['log'](a30_0x247543[_0x46027d(0x169)]('Activations:'),a30_0x247543[_0x46027d(0x20e)]('(none)'));else{console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x114)));for(const _0x58647c of _0xd80b8e){const _0x18c38c=_0x58647c[_0x46027d(0x15f)]??_0x46027d(0x1d7),_0xd604da=_0x58647c['connectionId']!=null?'connection\x20'+_0x58647c[_0x46027d(0x16b)]:_0x46027d(0x164),_0x30117d=_0x58647c[_0x46027d(0x1e7)]?''+_0x58647c[_0x46027d(0x1e7)]+(_0x58647c['runAt']?_0x46027d(0x1d2)+_0x58647c[_0x46027d(0x1ff)]:''):_0x46027d(0x12a),_0x5f2457=_0x58647c[_0x46027d(0x19c)]?'\x20[runs\x20on\x20refresh]':'';console[_0x46027d(0x129)]('\x20\x20'+a30_0x247543[_0x46027d(0x204)](_0x46027d(0x1a3))+'\x20'+_0x18c38c+_0x46027d(0x199)+_0xd604da+_0x46027d(0x1a0)+_0x30117d+_0x5f2457);}}return console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x204)](_0x46027d(0x1db))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x117);[a30_0x242395(0x1dd)]=a30_0x242395(0x188);async['execute'](_0x33dd85){const _0x402e69=a30_0x242395,{options:_0x5405bc,args:_0xcb0ef3,tdx:_0x5b27ac}=_0x33dd85,_0x19c49f=_0xcb0ef3[0x0];if(!requireNameOrPath(_0x19c49f))return 0x1;_0x5405bc[_0x402e69(0x1b7)]&&console[_0x402e69(0x11f)](_0x402e69(0x131)+_0x19c49f);const {journeyId:_0x418a3b,journeyName:_0x38a210}=await resolveJourneyIdFromInput(_0x19c49f,_0x5405bc,_0x5b27ac);if(_0x5405bc['dryRun'])return await this['executeDryRun'](_0x33dd85,_0x418a3b,_0x38a210);if(!_0x5405bc[_0x402e69(0x22a)]){const _0x54a7be=await confirm(_0x402e69(0x1f3)+_0x38a210+'\x22?');if(!_0x54a7be)return console[_0x402e69(0x11f)](_0x402e69(0x194)),0x0;}const _0x336852=await withSpinner('Resuming\x20journey...',()=>_0x5b27ac['journey']['resume'](_0x418a3b),{'verbose':_0x5405bc['verbose']}),_0x106385=_0x336852[_0x402e69(0x1e4)];return console[_0x402e69(0x11f)](_0x402e69(0x193)+_0x106385[_0x402e69(0x182)][_0x402e69(0x15f)]+_0x402e69(0x1e5)),0x0;}async[a30_0x242395(0x144)](_0x586c6b,_0x3363f5,_0x11a451){const _0x16285b=a30_0x242395,{options:_0x1066b8,tdx:_0xb3018a}=_0x586c6b,_0x18972b=await withSpinner(_0x16285b(0x111)+_0x11a451+_0x16285b(0x18f),()=>Promise[_0x16285b(0x141)]([_0xb3018a[_0x16285b(0x149)][_0x16285b(0x124)](_0x3363f5),_0xb3018a[_0x16285b(0x149)][_0x16285b(0x1f5)](_0x3363f5)]),{'verbose':_0x1066b8[_0x16285b(0x1b7)]}),[_0xf528ec,_0x576273]=_0x18972b[_0x16285b(0x1e4)],_0x143246=_0xf528ec['attributes'],_0x5873e4=_0x143246[_0x16285b(0x1c9)];console['log'](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1cc)),_0x143246[_0x16285b(0x15f)]),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1d6)),_0xf528ec['id']),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)]('State:'),_0x143246['state']),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x18d)),_0x143246[_0x16285b(0x146)]?a30_0x247543[_0x16285b(0x204)](_0x16285b(0x22a)):a30_0x247543[_0x16285b(0x228)]('no'));_0x143246[_0x16285b(0x1f2)]&&console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x135)),_0x143246[_0x16285b(0x1f2)]);console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)]('Parent\x20segment\x20ID:'),_0x143246['audienceId']);const _0x2952d0=_0x5873e4[_0x16285b(0x206)]>0x0?'\x20('+_0x5873e4[_0x16285b(0x210)](_0x4ddce1=>_0x4ddce1[_0x16285b(0x15f)])[_0x16285b(0x1ab)](',\x20')+')':'';console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1a2)),''+_0x5873e4[_0x16285b(0x206)]+_0x2952d0),console[_0x16285b(0x129)]('');if(_0x576273[_0x16285b(0x206)]===0x0)console['log'](a30_0x247543['bold']('Activations:'),a30_0x247543[_0x16285b(0x20e)](_0x16285b(0x227)));else{console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x114)));for(const _0x27642b of _0x576273){const _0x1e2af4=_0x27642b['name']??_0x16285b(0x1d7),_0x30f57f=_0x27642b[_0x16285b(0x16b)]!=null?_0x16285b(0x11a)+_0x27642b[_0x16285b(0x16b)]:_0x16285b(0x164),_0x559e87=_0x27642b[_0x16285b(0x1e7)]?''+_0x27642b[_0x16285b(0x1e7)]+(_0x27642b[_0x16285b(0x1ff)]?_0x16285b(0x1d2)+_0x27642b['runAt']:''):_0x16285b(0x12a),_0x2a9215=_0x27642b[_0x16285b(0x19c)]?'\x20[runs\x20on\x20refresh]':'';console[_0x16285b(0x129)]('\x20\x20'+a30_0x247543[_0x16285b(0x204)]('⚠️\x20')+'\x20'+_0x1e2af4+_0x16285b(0x199)+_0x30f57f+_0x16285b(0x1a0)+_0x559e87+_0x2a9215);}}return console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x204)]('\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.')),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a30_0x242395(0x1ea);[a30_0x242395(0x1dd)]=a30_0x242395(0x130);async[a30_0x242395(0x139)](_0x566d4f){const _0x296f44=a30_0x242395,{options:_0x4f27c4,args:_0x11ddc2,tdx:_0x252690}=_0x566d4f,_0x2a82c8=_0x4f27c4,_0x3ebbcc=_0x11ddc2[0x0],_0x12d0a2=_0x3ebbcc&&isYamlFilePath(_0x3ebbcc),_0x1dd5e3=await resolveTarget({'arg':_0x12d0a2?_0x3ebbcc:undefined,'contextParent':_0x4f27c4[_0x296f44(0x1c6)],'cwd':process[_0x296f44(0x136)]()});if(!isSuccessfulResolution(_0x1dd5e3))return _0x1dd5e3['errorCode']==='no_parent'?(console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x204)](_0x296f44(0x12c))),console['error']('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console['error'](_0x296f44(0x161)),console[_0x296f44(0x11f)](_0x296f44(0x1b6)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a30_0x247543[_0x296f44(0x1d5)](_0x296f44(0x231)+_0x1dd5e3[_0x296f44(0x1a5)]+'\x0a')),_0x1dd5e3['helpText']&&console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x207)](_0x1dd5e3['helpText']))),0x1;let _0x16a0df=_0x12d0a2?undefined:_0x3ebbcc,_0x5a7a77,_0x4acf81;_0x1dd5e3[_0x296f44(0x208)]===_0x296f44(0x12b)&&(_0x16a0df=_0x1dd5e3[_0x296f44(0x1b9)],_0x5a7a77=_0x1dd5e3['filePath'],_0x4acf81=_0x1dd5e3[_0x296f44(0x1a6)]);const _0x5ba65b=_0x1dd5e3[_0x296f44(0x1ca)],_0x498ac7=_0x1dd5e3[_0x296f44(0x1c2)];_0x2a82c8[_0x296f44(0x1b7)]&&(console[_0x296f44(0x11f)](_0x296f44(0x1de)+_0x5ba65b),console[_0x296f44(0x11f)](_0x296f44(0x1b5)+_0x498ac7),_0x16a0df&&console['error'](_0x296f44(0x120)+_0x16a0df),_0x5a7a77&&console[_0x296f44(0x11f)](_0x296f44(0x213)+_0x5a7a77),_0x4acf81&&console[_0x296f44(0x11f)](_0x296f44(0x134)+_0x4acf81));const _0x255f4f=await withSpinner(_0x296f44(0x216),()=>_0x252690[_0x296f44(0x1ef)][_0x296f44(0x1e9)](_0x5ba65b),{'verbose':_0x4f27c4['verbose']}),_0x55c876=_0x255f4f['data'],{journeys:_0x39f31,folders:_0x316849}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x4bd0d3=_0x296f44,[_0x4afa34,_0x692e7f]=await Promise[_0x4bd0d3(0x141)]([_0x252690['journey'][_0x4bd0d3(0x211)](_0x55c876,undefined,{'includeAllVersions':!![]}),_0x252690[_0x4bd0d3(0x1ef)]['listFolders'](_0x55c876)]);return{'journeys':_0x4afa34,'folders':_0x692e7f};},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]})[_0x296f44(0x12e)](_0x2f44e4=>_0x2f44e4[_0x296f44(0x1e4)]);let _0xdd5270=_0x39f31;const _0x543ef7=buildFolderIdToPathMap(_0x316849);if(_0x16a0df){const _0x3e8f64=_0xdd5270[_0x296f44(0x1a9)](_0x433653=>_0x433653[_0x296f44(0x177)]['toLowerCase']()===_0x16a0df[_0x296f44(0x22c)]());if(_0x3e8f64[_0x296f44(0x206)]===0x0)return console[_0x296f44(0x11f)](_0x296f44(0x20b)+_0x16a0df),console[_0x296f44(0x11f)](_0x296f44(0x1ac)),0x1;_0xdd5270=_0x3e8f64;}if(_0x4acf81!==undefined){const _0x525d9a=_0xdd5270[_0x296f44(0x1a9)](_0x505ea6=>{const _0x17d037=_0x296f44,_0x4a4b23=_0x505ea6[_0x17d037(0x160)]?_0x543ef7['get'](_0x505ea6['folderId'])||'':'';return _0x4a4b23===_0x4acf81;});if(_0x525d9a[_0x296f44(0x206)]===0x0&&_0xdd5270[_0x296f44(0x206)]>0x0){console[_0x296f44(0x11f)](_0x296f44(0x1a7)+_0x16a0df+_0x296f44(0x150)+(_0x4acf81||_0x296f44(0x140))),console[_0x296f44(0x11f)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x433f39 of _0xdd5270){const _0x2922be=_0x433f39[_0x296f44(0x160)]?_0x543ef7['get'](_0x433f39['folderId'])||'':'';console[_0x296f44(0x11f)](_0x296f44(0x20d)+(_0x2922be||_0x296f44(0x1b2))+'/'+_0x433f39[_0x296f44(0x177)]);}return 0x1;}_0xdd5270=_0x525d9a;}if(_0xdd5270['length']===0x0)return console[_0x296f44(0x11f)](_0x296f44(0x19a)),0x0;const _0x445779=new Map();for(const _0x25d50f of _0xdd5270){const _0x172e5b=_0x25d50f[_0x296f44(0x15e)];!_0x445779[_0x296f44(0x1eb)](_0x172e5b)&&_0x445779[_0x296f44(0x16f)](_0x172e5b,[]),_0x445779[_0x296f44(0x151)](_0x172e5b)[_0x296f44(0x225)](_0x25d50f);}for(const _0x421de2 of _0x445779[_0x296f44(0x21b)]()){_0x421de2[_0x296f44(0x1fd)]((_0x590c3b,_0x217474)=>(_0x590c3b['versionNumber']||0x0)-(_0x217474[_0x296f44(0x13f)]||0x0));}const _0x1f2674=[],{idToEmailMap:_0x22682f,connectionIdToNameMap:_0x2a9b6}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x5efb58=_0x296f44,[_0x5c0a81,_0x24dc15]=await Promise[_0x5efb58(0x141)]([_0x252690[_0x5efb58(0x163)][_0x5efb58(0x18c)](),_0x252690[_0x5efb58(0x220)][_0x5efb58(0x17c)]()]);return{'idToEmailMap':_0x5c0a81,'connectionIdToNameMap':_0x24dc15};},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]})[_0x296f44(0x12e)](_0x5ae3ac=>_0x5ae3ac[_0x296f44(0x1e4)]);for(const _0x36703b of _0x445779[_0x296f44(0x21b)]()){const _0x2e5db8=_0x36703b[0x0][_0x296f44(0x177)],_0x1afd88=_0x36703b[0x0][_0x296f44(0x160)],_0x1f560f=_0x1afd88?_0x543ef7[_0x296f44(0x151)](_0x1afd88)||'':'',_0x4b541d=_0x1f560f?a30_0x326e95[_0x296f44(0x1ab)](_0x498ac7,_0x1f560f):_0x498ac7,_0x3aae6e=_0x5a7a77||a30_0x326e95[_0x296f44(0x1ab)](_0x4b541d,sanitizeFileName(_0x2e5db8)+_0x296f44(0x209));let _0x38ac90,_0x2e72f9;if(existsSync(_0x3aae6e))try{const _0x2c6387=readFileSync(_0x3aae6e,_0x296f44(0x1ee)),_0x507641=parseYamlString(_0x2c6387);_0x2e72f9=_0x507641,_0x38ac90=buildRuleToNameMapping(_0x507641),_0x2a82c8[_0x296f44(0x1b7)]&&_0x38ac90['size']>0x0&&console[_0x296f44(0x11f)](_0x296f44(0x12f)+_0x38ac90[_0x296f44(0x17f)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x2e5db8);}catch(_0x8d479d){_0x2a82c8[_0x296f44(0x1b7)]&&console[_0x296f44(0x11f)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x8d479d[_0x296f44(0x1a5)]);}const _0x4f20ce=[],_0x306c89=new Set(),_0x4babad=new Map(),_0x3f737b=new Map(),_0x52db2e=new Set(),_0x20b996=new Map(),_0x51415c=new Map(),_0x5e3625=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x2e5db8+_0x296f44(0x18f),async _0x4cde79=>{const _0x1bffc1=_0x296f44;for(const _0x20fe9c of _0x36703b){const _0x51b65b=_0x36703b[_0x1bffc1(0x206)]>0x1?_0x20fe9c['journeyBundleName']+'\x20v'+(_0x20fe9c[_0x1bffc1(0x13f)]||0x1):_0x20fe9c[_0x1bffc1(0x177)];_0x4cde79[_0x1bffc1(0x15a)]('Fetching\x20'+_0x51b65b);const _0x148ec9=await _0x252690[_0x1bffc1(0x149)][_0x1bffc1(0x124)](_0x20fe9c['id']),_0x5915f4=_0x148ec9[_0x1bffc1(0x182)]?.[_0x1bffc1(0x1d0)],_0x59b4bd={'resolveSegment':async _0x567f1e=>{const _0x2443f8=_0x1bffc1;if(!_0x5915f4)return{'name':_0x567f1e,'isJourneyLocal':![]};const _0x8ea0d8=_0x4babad[_0x2443f8(0x151)](_0x567f1e);if(_0x8ea0d8)return _0x8ea0d8;try{const _0x31688e=await _0x252690[_0x2443f8(0x1ef)][_0x2443f8(0x15c)](_0x5915f4,_0x567f1e),_0x2e4822=_0x31688e[_0x2443f8(0x14c)]===SEGMENT_KIND_JOURNEY;let _0x5b7836,_0x17eee0=_0x31688e[_0x2443f8(0x15f)];if(_0x2e4822&&_0x31688e[_0x2443f8(0x18e)]){const _0x242c3f=await segmentResponseToDef(_0x31688e,{'resolveSegmentName':async _0x9b76b5=>{const _0x228720=_0x2443f8,_0x323029=_0x4babad[_0x228720(0x151)](_0x9b76b5);if(_0x323029)return _0x323029[_0x228720(0x15f)];const _0x995b20=await _0x59b4bd[_0x228720(0x16a)](_0x9b76b5);return _0x995b20['name'];}}),_0x4e0534=_0x242c3f[_0x2443f8(0x18e)];_0x5b7836={'description':_0x31688e[_0x2443f8(0x1dd)],'rule':_0x4e0534};const _0x5c8ce8=serializeRule(_0x4e0534),_0x5d731b=_0x3f737b[_0x2443f8(0x151)](_0x5c8ce8);if(_0x5d731b)_0x17eee0=_0x5d731b,_0x5b7836=undefined,_0x2a82c8[_0x2443f8(0x1b7)]&&console[_0x2443f8(0x11f)](_0x2443f8(0x1d8)+_0x31688e[_0x2443f8(0x15f)]+'\x20->\x20'+_0x5d731b);else{let _0x2455d9=![];if(_0x38ac90){const _0xb39b51=_0x38ac90[_0x2443f8(0x151)](_0x5c8ce8);if(_0xb39b51){const _0x22cd1e=_0xb39b51[_0x2443f8(0x22b)](_0x5a8e9a=>!_0x306c89['has'](_0x5a8e9a));_0x22cd1e&&(_0x17eee0=_0x22cd1e,_0x306c89[_0x2443f8(0x142)](_0x22cd1e),_0x3f737b[_0x2443f8(0x16f)](_0x5c8ce8,_0x22cd1e),_0x2455d9=!![],_0x2a82c8['verbose']&&console[_0x2443f8(0x11f)](_0x2443f8(0x125)+_0x22cd1e+'\x20(rule\x20match)'));}}if(!_0x2455d9){const _0x68f4de=generateJourneyLocalName(_0x31688e[_0x2443f8(0x15f)]);_0x68f4de&&(_0x17eee0=_0x68f4de);let _0x5d58b8=_0x17eee0,_0x40c1ea=0x2;while(_0x306c89[_0x2443f8(0x1eb)](_0x5d58b8)){_0x5d58b8=_0x17eee0+'_'+_0x40c1ea,_0x40c1ea++;}_0x306c89[_0x2443f8(0x142)](_0x5d58b8),_0x3f737b['set'](_0x5c8ce8,_0x5d58b8),_0x17eee0=_0x5d58b8;}}}const _0x1aaf2f={'name':_0x17eee0,'isJourneyLocal':_0x2e4822,'definition':_0x5b7836};return _0x4babad[_0x2443f8(0x16f)](_0x567f1e,_0x1aaf2f),_0x1aaf2f;}catch(_0x325b3a){return _0x4f27c4['verbose']&&console[_0x2443f8(0x11f)](_0x2443f8(0x1dc)+_0x567f1e+':\x20'+_0x325b3a['message']),{'name':_0x567f1e,'isJourneyLocal':![]};}},'resolveActivation':async _0x53f4b0=>{const _0x334c33=_0x1bffc1,_0x4aef5a=_0x20b996['get'](_0x53f4b0);if(_0x4aef5a)return _0x4aef5a;try{const _0xe09e35=await _0x252690[_0x334c33(0x149)][_0x334c33(0x118)](_0x20fe9c['id'],_0x53f4b0),_0x77a5e1=journeyActivationStepToYaml(_0xe09e35,_0x22682f,_0x2a9b6),_0x3555d8=JSON['stringify']({'name':_0x77a5e1['name'],'connection':_0x77a5e1[_0x334c33(0x220)],'connector_config':_0x77a5e1[_0x334c33(0x171)]}),_0xd38ad5=_0x51415c['get'](_0x3555d8);if(_0xd38ad5){const _0x21f63f={'name':_0xd38ad5,'isJourneyLocal':!![],'definition':_0x77a5e1};return _0x20b996[_0x334c33(0x16f)](_0x53f4b0,_0x21f63f),_0x21f63f;}const _0x2f9c08=_0xe09e35[_0x334c33(0x182)][_0x334c33(0x19f)][_0x334c33(0x15f)]||_0x53f4b0,_0x4a26da=sanitizeYamlKey(_0x2f9c08)||_0x334c33(0x15d)+_0x53f4b0;let _0x227441=_0x4a26da,_0x1f0c7a=0x2;while(_0x52db2e[_0x334c33(0x1eb)](_0x227441)){_0x227441=_0x4a26da+'_'+_0x1f0c7a,_0x1f0c7a++;}_0x52db2e['add'](_0x227441),_0x51415c[_0x334c33(0x16f)](_0x3555d8,_0x227441);const _0x1569d9={'name':_0x227441,'isJourneyLocal':!![],'definition':_0x77a5e1};return _0x20b996[_0x334c33(0x16f)](_0x53f4b0,_0x1569d9),_0x1569d9;}catch(_0x21aea4){return _0x4f27c4[_0x334c33(0x1b7)]&&console[_0x334c33(0x11f)](_0x334c33(0x14a)+_0x53f4b0+':\x20'+_0x21aea4[_0x334c33(0x1a5)]),{'name':_0x53f4b0,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x35af3f,_0x1f3123)=>{const _0x1d498f=_0x1bffc1;return resolveJumpTarget(_0x35af3f,_0x1f3123,_0x5e3625,_0x12d3a4=>_0x252690[_0x1d498f(0x149)][_0x1d498f(0x124)](_0x12d3a4));}},_0x2c6232=await journeyResponseToDef(_0x148ec9,_0x59b4bd);_0x4f20ce[_0x1bffc1(0x225)]({'item':_0x20fe9c,'yaml':_0x2c6232});}},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]});const _0x3608fb=await _0x252690[_0x296f44(0x149)]['getLatestJourneyId'](_0x36703b[0x0][_0x296f44(0x15e)]),_0x53f179=buildMergedJourneyDef(_0x4f20ce,_0x38ac90,_0x3608fb),_0x21f934=normalizeJourneyDef(_0x53f179,_0x2e72f9),_0x46cdee=toYamlString(_0x21f934),_0x4d4aa9=_0x5a7a77||a30_0x326e95[_0x296f44(0x1ab)](_0x4b541d,sanitizeFileName(_0x2e5db8)+'.journey.yml');!_0x5a7a77&&_0x1f560f&&!existsSync(_0x4b541d)&&mkdirSync(_0x4b541d,{'recursive':!![]});const _0x112b5d=a30_0x326e95[_0x296f44(0x190)](process[_0x296f44(0x136)](),_0x4d4aa9);if(existsSync(_0x4d4aa9)){const _0x5f0fb9=readFileSync(_0x4d4aa9,'utf-8'),_0x494894=generateDiff(_0x5f0fb9,_0x46cdee),_0x5b04e7=hasChanges(_0x494894);_0x1f2674[_0x296f44(0x225)]({'relativePath':_0x112b5d,'absolutePath':_0x4d4aa9,'content':_0x46cdee,'isNew':![],'hasChanges':_0x5b04e7,'diff':_0x5b04e7?formatDiffWithColors(_0x494894):undefined});}else _0x1f2674[_0x296f44(0x225)]({'relativePath':_0x112b5d,'absolutePath':_0x4d4aa9,'content':_0x46cdee,'isNew':!![],'hasChanges':![]});}const _0x4bc1cb=_0x1f2674[_0x296f44(0x1a9)](_0x5a8d04=>_0x5a8d04['isNew']),_0x42f045=_0x1f2674['filter'](_0x3679d4=>!_0x3679d4['isNew']&&_0x3679d4['hasChanges']),_0x36d61b=_0x1f2674[_0x296f44(0x1a9)](_0x3766e4=>!_0x3766e4[_0x296f44(0x1ed)]&&!_0x3766e4[_0x296f44(0x232)]),_0x297db0=_0xdd5270['length'],_0x5efce8=_0x445779['size'],_0x379d4f=_0x297db0>_0x5efce8?'\x20('+_0x297db0+_0x296f44(0x1ae):'';console[_0x296f44(0x11f)](_0x296f44(0x180)),console['error']('\x20\x20'+a30_0x247543[_0x296f44(0x207)](_0x5efce8+'\x20journeys')+a30_0x247543[_0x296f44(0x20e)](_0x379d4f)),console[_0x296f44(0x11f)]('\x20\x20'+a30_0x247543['green']('+\x20'+_0x4bc1cb['length']+_0x296f44(0x13b))),console['error']('\x20\x20'+a30_0x247543[_0x296f44(0x204)]('~\x20'+_0x42f045['length']+_0x296f44(0x20c))),console[_0x296f44(0x11f)]('\x20\x20'+a30_0x247543[_0x296f44(0x20e)]('=\x20'+_0x36d61b[_0x296f44(0x206)]+'\x20unchanged\x20files')),console[_0x296f44(0x11f)](_0x296f44(0x122)+a30_0x247543['cyan'](_0x498ac7)+'\x0a');if(_0x42f045[_0x296f44(0x206)]>0x0)for(const _0x15ec7c of _0x42f045){console[_0x296f44(0x11f)]('\x0aChanges\x20to\x20\x27'+_0x15ec7c[_0x296f44(0x1a8)]+'\x27:'),console[_0x296f44(0x11f)]('─'[_0x296f44(0x1c0)](0x3c)),console['error'](_0x15ec7c[_0x296f44(0x17d)]),console[_0x296f44(0x11f)]('─'[_0x296f44(0x1c0)](0x3c));}if(_0x2a82c8['dryRun'])return console['error'](a30_0x247543['yellow'](_0x296f44(0x192))),0x0;if(_0x4bc1cb[_0x296f44(0x206)]===0x0&&_0x42f045[_0x296f44(0x206)]===0x0)return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x21c))),saveSessionContext({'parent_segment':_0x5ba65b},_0x2a82c8['session']),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x16d)+a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x11d))+_0x296f44(0x154)+a30_0x247543[_0x296f44(0x207)](_0x5ba65b))),0x0;if(!_0x2a82c8[_0x296f44(0x22a)]&&(_0x4bc1cb[_0x296f44(0x206)]>0x0||_0x42f045[_0x296f44(0x206)]>0x0)){if(!isInteractive())return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x1d5)](_0x296f44(0x156)),_0x296f44(0x1fc)),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x21f))),0x1;const _0x5b8689=await confirmKey(_0x296f44(0x1bc)+(_0x4bc1cb[_0x296f44(0x206)]+_0x42f045[_0x296f44(0x206)])+_0x296f44(0x166));if(!_0x5b8689)return console['error'](a30_0x247543['yellow'](_0x296f44(0x1c4)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x498ac7)&&mkdirSync(_0x498ac7,{'recursive':!![]});const _0x471f01=a30_0x326e95[_0x296f44(0x1ab)](_0x498ac7,_0x296f44(0x1f9));writeFileSync(_0x471f01,createTdxConfigContent(_0x5ba65b),_0x296f44(0x1ee));for(const _0x110952 of _0x1f2674){(_0x110952[_0x296f44(0x1ed)]||_0x110952[_0x296f44(0x232)])&&writeFileSync(_0x110952[_0x296f44(0x172)],_0x110952[_0x296f44(0x173)],_0x296f44(0x1ee));}return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)]('✔\x20Pulled\x20'+(_0x4bc1cb['length']+_0x42f045[_0x296f44(0x206)])+_0x296f44(0x230)+_0x498ac7)),saveSessionContext({'parent_segment':_0x5ba65b},_0x2a82c8[_0x296f44(0x21e)]),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x16d)+a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x11d))+_0x296f44(0x154)+a30_0x247543['cyan'](_0x5ba65b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1da);[a30_0x242395(0x1dd)]=a30_0x242395(0x127);async[a30_0x242395(0x139)](_0x4934c7){const _0xccda4a=a30_0x242395,{options:_0x281868,args:_0x3d54e7,tdx:_0x19d69d}=_0x4934c7,_0x5747fd=_0x3d54e7[0x0];if(!requireNameOrPath(_0x5747fd))return 0x1;_0x281868[_0xccda4a(0x1b7)]&&console[_0xccda4a(0x11f)]('Input:\x20'+_0x5747fd);const {journeyId:_0x6691f8}=await resolveJourneyIdFromInput(_0x5747fd,_0x281868,_0x19d69d),_0x5b096e=await withSpinner(_0xccda4a(0x123),()=>_0x19d69d[_0xccda4a(0x149)]['getColumnMapping'](_0x6691f8),{'verbose':_0x281868[_0xccda4a(0x1b7)]}),_0x431a33=_0x5b096e[_0xccda4a(0x1e4)];return console[_0xccda4a(0x129)](_0xccda4a(0x1bb)+_0x431a33[_0xccda4a(0x1ba)]),console['log'](_0xccda4a(0x175)+_0x431a33[_0xccda4a(0x132)]),await handleSDKOutput(_0x431a33[_0xccda4a(0x11b)],_0x281868),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x170);['description']='List\x20activations\x20for\x20a\x20journey';async[a30_0x242395(0x139)](_0x438b93){const _0x48541f=a30_0x242395,{options:_0x5cb539,args:_0x501ecb,tdx:_0x4e5c58}=_0x438b93,_0x4ce543=_0x501ecb[0x0];if(!requireNameOrPath(_0x4ce543))return 0x1;_0x5cb539[_0x48541f(0x1b7)]&&console[_0x48541f(0x11f)](_0x48541f(0x131)+_0x4ce543);const {journeyId:_0x5a9e02}=await resolveJourneyIdFromInput(_0x4ce543,_0x5cb539,_0x4e5c58),_0x4fba4d=await withSpinner(_0x48541f(0x1a1),()=>_0x4e5c58[_0x48541f(0x149)][_0x48541f(0x1f5)](_0x5a9e02),{'verbose':_0x5cb539[_0x48541f(0x1b7)]}),_0x35cb3d=_0x4fba4d[_0x48541f(0x1e4)];return console[_0x48541f(0x11f)]('Found\x20'+_0x35cb3d[_0x48541f(0x206)]+'\x20activation'+(_0x35cb3d[_0x48541f(0x206)]!==0x1?'s':'')),await handleSDKOutput(_0x35cb3d,_0x5cb539),0x0;}}export class JourneyPushCommand extends BaseCommand{[a30_0x242395(0x15f)]='journey:push';['description']=a30_0x242395(0x21d);[a30_0x242395(0x11e)]=new SegmentPushCommand();async['execute'](_0x125e68){const _0x210a29=a30_0x242395,_0x7acc73=_0x125e68['args'][0x0];let _0x375bc4;if(_0x7acc73){const _0x2084ae=await resolveTarget({'arg':_0x7acc73,'contextParent':_0x125e68['options'][_0x210a29(0x1c6)],'cwd':process['cwd']()});isSuccessfulResolution(_0x2084ae)&&_0x2084ae[_0x210a29(0x208)]===_0x210a29(0x12b)&&(_0x375bc4=_0x2084ae[_0x210a29(0x119)]);}const _0x218290={..._0x125e68,'options':{..._0x125e68['options'],'journeysOnly':!![],..._0x375bc4&&{'singleFilePath':_0x375bc4}}};return this['segmentPushCommand']['execute'](_0x218290);}}export class JourneyVersionsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x185);[a30_0x242395(0x1dd)]=a30_0x242395(0x22d);async[a30_0x242395(0x139)](_0x149551){const _0x23fbd0=a30_0x242395,{options:_0x2ea128,args:_0x30b25b,tdx:_0x1eedda}=_0x149551,_0x35e7c6=_0x30b25b[0x0];if(!requireNameOrPath(_0x35e7c6))return 0x1;if(_0x2ea128['verbose'])console[_0x23fbd0(0x11f)](_0x23fbd0(0x131)+_0x35e7c6);const {journeyId:_0x511d43}=await resolveJourneyIdFromInput(_0x35e7c6,_0x2ea128,_0x1eedda),_0x1230fd=await withSpinner(_0x23fbd0(0x1be),()=>_0x1eedda[_0x23fbd0(0x149)]['listVersions'](_0x511d43),{'verbose':_0x2ea128[_0x23fbd0(0x1b7)]}),{bundleName:_0x2bcc3a,versions:_0x4833be,latestJourneyId:_0x162361}=_0x1230fd['data'];console['error'](_0x2bcc3a+':\x20'+_0x4833be[_0x23fbd0(0x206)]+_0x23fbd0(0x13a)+(_0x4833be[_0x23fbd0(0x206)]!==0x1?'s':''));const _0x1be073=_0x4833be[_0x23fbd0(0x210)](_0x57409d=>({'version':_0x57409d[_0x23fbd0(0x13f)],'journey_id':_0x57409d[_0x23fbd0(0x229)],'name':_0x57409d['name'],'state':_0x57409d['state'],'paused':_0x57409d[_0x23fbd0(0x146)],'latest':_0x57409d['journeyId']===_0x162361,'created_at':_0x57409d[_0x23fbd0(0x191)]}));return await handleSDKOutput(_0x1be073,_0x2ea128),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1d4);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a30_0x242395(0x139)](_0x2478b6){const _0x462110=a30_0x242395,{options:_0x406056,args:_0x47ba17,tdx:_0x47eadb}=_0x2478b6,_0x4d9dad=_0x47ba17[0x0];if(!requireNameOrPath(_0x4d9dad))return 0x1;if(_0x406056[_0x462110(0x1b7)])console['error']('Input:\x20'+_0x4d9dad);const {journeyId:_0x1977e3,journeyName:_0x53adb2}=await resolveJourneyIdFromInput(_0x4d9dad,_0x406056,_0x47eadb);if(!_0x406056[_0x462110(0x22a)]){const _0x2cf70d=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x53adb2+'\x22?');if(!_0x2cf70d)return console[_0x462110(0x11f)]('Cancelled'),0x0;}const _0x26e8c1=await withSpinner('Creating\x20new\x20version...',()=>_0x47eadb['journey']['createVersion'](_0x1977e3),{'verbose':_0x406056[_0x462110(0x1b7)]}),_0x3ecf46=_0x26e8c1[_0x462110(0x1e4)];return console['error'](a30_0x247543[_0x462110(0x228)]('\u2714')+'\x20Created\x20v'+_0x3ecf46[_0x462110(0x182)][_0x462110(0x13f)]+_0x462110(0x1e6)+_0x3ecf46[_0x462110(0x182)][_0x462110(0x15f)]+'\x22'),console['error']('\x20\x20Journey\x20ID:\x20'+_0x3ecf46['id']),await handleSingleObjectOutput({'id':_0x3ecf46['id'],'name':_0x3ecf46['attributes'][_0x462110(0x15f)],'version':_0x3ecf46[_0x462110(0x182)][_0x462110(0x13f)],'state':_0x3ecf46[_0x462110(0x182)][_0x462110(0x1fa)],'bundle_id':_0x3ecf46[_0x462110(0x182)][_0x462110(0x15e)],'created_at':_0x3ecf46['attributes'][_0x462110(0x191)]},_0x406056),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x215);['description']='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async['execute'](_0x588c05){const _0x1f0169=a30_0x242395,{options:_0x84a606,args:_0xaaf78b,tdx:_0x53d5b0}=_0x588c05,_0x12fa7d=_0xaaf78b[0x0];if(!requireNameOrPath(_0x12fa7d))return 0x1;const _0x33f5c6=_0x84a606[_0x1f0169(0x176)];if(!_0x33f5c6)return console[_0x1f0169(0x11f)](_0x1f0169(0x1ce)),console[_0x1f0169(0x11f)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x43cfaa=parseInt(_0x33f5c6,0xa);if(isNaN(_0x43cfaa)||_0x43cfaa<0x1)return console[_0x1f0169(0x11f)](_0x1f0169(0x1cd)+_0x33f5c6),0x1;if(_0x84a606['verbose'])console[_0x1f0169(0x11f)](_0x1f0169(0x131)+_0x12fa7d+',\x20version:\x20'+_0x43cfaa);const {journeyId:_0x554e84,parentSegmentId:_0x28d766}=await resolveJourneyIdFromInput(_0x12fa7d,_0x84a606,_0x53d5b0),_0x4ae5d2=await withSpinner(_0x1f0169(0x195),()=>_0x53d5b0[_0x1f0169(0x149)][_0x1f0169(0x1f8)](_0x554e84),{'verbose':_0x84a606['verbose']}),{versions:_0x53bc8c,latestJourneyId:_0x28b381}=_0x4ae5d2[_0x1f0169(0x1e4)],_0x4a2a04=_0x53bc8c[_0x1f0169(0x22b)](_0x228c2e=>_0x228c2e[_0x1f0169(0x13f)]===_0x43cfaa);if(!_0x4a2a04){const _0x328891=_0x53bc8c['map'](_0x2dd069=>'v'+_0x2dd069[_0x1f0169(0x13f)])[_0x1f0169(0x1ab)](',\x20');return console['error']('Error:\x20Version\x20'+_0x43cfaa+_0x1f0169(0x138)+_0x328891),0x1;}const _0x36e5c1=await withSpinner('Getting\x20version\x20'+_0x43cfaa+_0x1f0169(0x159),()=>_0x53d5b0[_0x1f0169(0x149)][_0x1f0169(0x124)](_0x4a2a04[_0x1f0169(0x229)]),{'verbose':_0x84a606[_0x1f0169(0x1b7)]}),_0x70cec9=_0x36e5c1[_0x1f0169(0x1e4)],_0x264427=getConsoleNextUrl(_0x84a606[_0x1f0169(0x128)],_0x1f0169(0x1ad)+_0x28d766+_0x1f0169(0x1b4)+_0x4a2a04[_0x1f0169(0x229)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x70cec9['id'],'name':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x15f)],'version':_0x70cec9[_0x1f0169(0x182)]['versionNumber'],'description':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1dd)],'state':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1fa)],'paused':_0x70cec9['attributes'][_0x1f0169(0x146)],'reentry_mode':_0x70cec9[_0x1f0169(0x182)]['reentryMode'],'stages':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1c9)]?.['length']||0x0,..._0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x212)]&&{'goal':_0x70cec9[_0x1f0169(0x182)]['goal'][_0x1f0169(0x15f)]},'latest':_0x4a2a04['journeyId']===_0x28b381,'created_at':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x191)],'updated_at':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1c5)],'url':_0x264427},_0x84a606),0x0;}}
|
|
1
|
+
const a30_0x9050c5=a30_0x130d;(function(_0x580aa5,_0x19f3f9){const _0x5f06f1=a30_0x130d,_0x2d438c=_0x580aa5();while(!![]){try{const _0x2fafe4=-parseInt(_0x5f06f1(0xd5))/0x1*(parseInt(_0x5f06f1(0x18a))/0x2)+-parseInt(_0x5f06f1(0x198))/0x3*(parseInt(_0x5f06f1(0x90))/0x4)+parseInt(_0x5f06f1(0xf6))/0x5+-parseInt(_0x5f06f1(0x103))/0x6+parseInt(_0x5f06f1(0x118))/0x7+parseInt(_0x5f06f1(0x13e))/0x8*(parseInt(_0x5f06f1(0x11b))/0x9)+parseInt(_0x5f06f1(0x8f))/0xa;if(_0x2fafe4===_0x19f3f9)break;else _0x2d438c['push'](_0x2d438c['shift']());}catch(_0x33dac1){_0x2d438c['push'](_0x2d438c['shift']());}}}(a30_0x5ef9,0xb2501));import a30_0x2170a8 from'chalk';import a30_0x39acee 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 requireNameOrPath(_0x305b37){const _0x349d51=a30_0x130d;return!_0x305b37&&(console['error'](_0x349d51(0x8e)),console[_0x349d51(0x92)](_0x349d51(0xbe))),!!_0x305b37;}function withJsonFormat(_0x55aba8){const _0x2a4d45=a30_0x130d;if(!_0x55aba8[_0x2a4d45(0x1ad)]&&!_0x55aba8[_0x2a4d45(0x106)]&&!_0x55aba8[_0x2a4d45(0x182)]&&!_0x55aba8[_0x2a4d45(0x194)])return{..._0x55aba8,'format':'json','json':!![]};return _0x55aba8;}function formatJourneyState(_0x3f6ea8){const _0x49e376=a30_0x130d;switch(_0x3f6ea8){case'launched':return a30_0x2170a8[_0x49e376(0x1a3)]('(running)');case _0x49e376(0xf8):return a30_0x2170a8[_0x49e376(0xc0)](_0x49e376(0x18f));case _0x49e376(0x9f):return a30_0x2170a8[_0x49e376(0xc5)](_0x49e376(0x10e));case _0x49e376(0x192):return a30_0x2170a8['blue']('(completed)');case _0x49e376(0x7c):return a30_0x2170a8[_0x49e376(0xc0)](_0x49e376(0x1a0));default:return'('+_0x3f6ea8+')';}}function formatJourneyItem(_0x27d098,_0x3f82b2='',_0x1f70a4){const _0x3628da=a30_0x130d,_0x3cd931=formatJourneyState(_0x27d098['state']),_0x13e40b=_0x1f70a4?hyperlink(_0x27d098[_0x3628da(0x15f)],_0x1f70a4):_0x27d098[_0x3628da(0x15f)];return _0x3f82b2+_0x3628da(0xa8)+_0x13e40b+'\x20'+_0x3cd931;}function escapeRegex(_0x310fc8){const _0x22cdca=a30_0x130d;return _0x310fc8[_0x22cdca(0x108)](/[.*+?^${}()|[\]\\]/g,_0x22cdca(0x19c));}function a30_0x130d(_0x15e58e,_0x41bdc1){_0x15e58e=_0x15e58e-0x7a;const _0x5ef9f6=a30_0x5ef9();let _0x130dbb=_0x5ef9f6[_0x15e58e];return _0x130dbb;}function globToRegex(_0x1f8078){const _0x26ee99=a30_0x130d,_0x3bd716=_0x1f8078[_0x26ee99(0x1ac)]('*')[_0x26ee99(0x17a)](escapeRegex);return new RegExp(_0x3bd716[_0x26ee99(0x101)]('.*'),'i');}function buildRuleToNameMapping(_0x4bd776){const _0x5615a4=a30_0x130d,_0x2b3abd=new Map();if(_0x4bd776[_0x5615a4(0x150)])for(const [_0x1708f0,_0x534884]of Object['entries'](_0x4bd776[_0x5615a4(0x150)])){if(_0x534884[_0x5615a4(0xd8)]){const _0x22ee1b=serializeRule(_0x534884[_0x5615a4(0xd8)]),_0x5da87c=_0x2b3abd[_0x5615a4(0xa3)](_0x22ee1b);_0x5da87c?_0x5da87c[_0x5615a4(0x121)](_0x1708f0):_0x2b3abd['set'](_0x22ee1b,[_0x1708f0]);}}return _0x2b3abd;}async function resolveJourneyIdFromInput(_0x234f08,_0xb775a0,_0x510585){const _0x168ca8=a30_0x130d,_0x5ed73f=await resolveJourneyTarget(_0x234f08,_0xb775a0[_0x168ca8(0x190)],_0xb775a0[_0x168ca8(0x175)]),_0x3449e9=_0x5ed73f['parentSegment'];if(!_0x3449e9)throw new SDKError(ErrorCode[_0x168ca8(0x14e)],_0x168ca8(0x116));const _0x25e8f7=await withSpinner(_0x168ca8(0x98),()=>_0x510585['segment'][_0x168ca8(0x115)](_0x3449e9),{'verbose':_0xb775a0['verbose']}),_0x1ae3ea=_0x25e8f7[_0x168ca8(0x14b)],_0x4e2959=await withSpinner(_0x168ca8(0xf9),()=>_0x510585[_0x168ca8(0xc3)][_0x168ca8(0x10d)](_0x1ae3ea,_0x5ed73f[_0x168ca8(0x97)]),{'verbose':_0xb775a0[_0x168ca8(0x175)]});return{'journeyId':_0x4e2959[_0x168ca8(0x14b)],'journeyName':_0x5ed73f[_0x168ca8(0x97)],'parentSegmentId':_0x1ae3ea};}async function resolveJourneyTarget(_0x192626,_0x4320d3,_0x26ad90){const _0x3543d0=a30_0x130d;if(isYamlFilePath(_0x192626))try{const _0x281b13=await resolveYamlFilePath(_0x192626);return _0x26ad90&&(console[_0x3543d0(0x92)](_0x3543d0(0xce)+_0x192626),console['error'](_0x3543d0(0x102)+_0x281b13[_0x3543d0(0x190)]),console['error'](_0x3543d0(0x134)+_0x281b13['segmentName']),console[_0x3543d0(0x92)](_0x3543d0(0x176)+(_0x281b13['folderPath']||_0x3543d0(0xb0)))),{'journeyName':_0x281b13[_0x3543d0(0x14d)],'parentSegment':_0x281b13[_0x3543d0(0x190)],'resolved':_0x281b13};}catch(_0x4dd79a){throw new SDKError(ErrorCode[_0x3543d0(0x14e)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4dd79a[_0x3543d0(0x177)]);}if(!_0x4320d3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3543d0(0x13c));return{'journeyName':_0x192626,'parentSegment':_0x4320d3};}export class JourneyListCommand extends BaseCommand{['name']=a30_0x9050c5(0x151);[a30_0x9050c5(0x16c)]=a30_0x9050c5(0x158);async[a30_0x9050c5(0x1a1)](_0x241ad7){const _0x55f2ac=a30_0x9050c5,{options:_0x3a7aad,args:_0xb8c196,tdx:_0x35c776}=_0x241ad7,_0x4a7e91=_0xb8c196[0x0],_0x1be1a7=_0x3a7aad[_0x55f2ac(0x190)];if(!_0x1be1a7)return console[_0x55f2ac(0x92)](_0x55f2ac(0x193)),console[_0x55f2ac(0x92)](_0x55f2ac(0x187)),0x1;const _0x36f887=await withSpinner(_0x55f2ac(0x98),()=>_0x35c776[_0x55f2ac(0xc2)]['resolveParentId'](_0x1be1a7),{'verbose':_0x3a7aad[_0x55f2ac(0x175)]}),_0x1fcf7f=_0x36f887[_0x55f2ac(0x14b)];_0x3a7aad['verbose']&&(console[_0x55f2ac(0x92)](_0x55f2ac(0x136)+_0x1be1a7+_0x55f2ac(0x138)+_0x1fcf7f+')'),_0x4a7e91&&console[_0x55f2ac(0x92)](_0x55f2ac(0x7f)+_0x4a7e91));const _0x177032=await withSpinner(_0x55f2ac(0x149),()=>_0x35c776['segment'][_0x55f2ac(0xe7)](_0x1fcf7f),{'verbose':_0x3a7aad[_0x55f2ac(0x175)]}),_0x37fa88=_0x177032[_0x55f2ac(0x14b)],_0x3928b5=_0x37fa88[_0x55f2ac(0xa7)],_0x1db0bb=await withSpinner(_0x55f2ac(0xa5),()=>_0x35c776[_0x55f2ac(0xc3)][_0x55f2ac(0xe3)](_0x1fcf7f,_0x3928b5),{'verbose':_0x3a7aad['verbose']});let _0xc613f4=_0x1db0bb[_0x55f2ac(0x14b)][_0x55f2ac(0x197)];const _0x5b3403=_0x1db0bb['data'][_0x55f2ac(0x111)],_0x1ba3f0=new Map();for(const _0x35c6a2 of _0x5b3403){_0x1ba3f0[_0x55f2ac(0x11d)](_0x35c6a2['id'],_0x35c6a2['name']);}if(_0x4a7e91){const _0x995951=globToRegex(_0x4a7e91);_0xc613f4=_0xc613f4[_0x55f2ac(0x119)](_0x461c4f=>_0x995951[_0x55f2ac(0xa6)](_0x461c4f[_0x55f2ac(0x15f)]));}console['error'](_0x55f2ac(0x168)+_0xc613f4[_0x55f2ac(0x130)]+_0x55f2ac(0xca)+(_0xc613f4[_0x55f2ac(0x130)]!==0x1?'s':''));const _0x2b1d37=_0x35c4c7=>{const _0x49d804=_0x55f2ac;return getConsoleNextUrl(_0x3a7aad[_0x49d804(0x110)],'/app/ps/'+_0x1fcf7f+'/e/'+_0x35c4c7+'/j/da');};if(_0x3a7aad['format']==='table')await handleSDKOutput(_0xc613f4,_0x3a7aad);else{if(_0x3a7aad[_0x55f2ac(0x1ad)]==='json'){const _0x34ac89=_0xc613f4[_0x55f2ac(0x17a)](_0x487904=>({..._0x487904,'url':_0x2b1d37(_0x487904['id'])}));await handleSDKOutput(_0x34ac89,_0x3a7aad);}else{console[_0x55f2ac(0x172)]('['+_0x1be1a7+']');const _0x106106=new Map(),_0x37609a=[];for(const _0x232f0e of _0xc613f4){if(!_0x232f0e[_0x55f2ac(0xd7)]||_0x232f0e[_0x55f2ac(0xd7)]===_0x3928b5)_0x37609a['push'](_0x232f0e);else{const _0x1dad4d=_0x106106[_0x55f2ac(0xa3)](_0x232f0e[_0x55f2ac(0xd7)])||[];_0x1dad4d[_0x55f2ac(0x121)](_0x232f0e),_0x106106['set'](_0x232f0e[_0x55f2ac(0xd7)],_0x1dad4d);}}const _0x100794=(_0x195b07,_0x1ba7fb)=>_0x195b07['journeyBundleName']['localeCompare'](_0x1ba7fb[_0x55f2ac(0x15f)],undefined,{'sensitivity':'base'});_0x37609a['sort'](_0x100794);for(const _0x134299 of _0x37609a){console[_0x55f2ac(0x172)](formatJourneyItem(_0x134299,'',_0x2b1d37(_0x134299['id'])));}const _0x2f7eaf=[..._0x106106['entries']()][_0x55f2ac(0xb9)]((_0x248bd0,_0x351a94)=>{const _0x2a1191=_0x55f2ac,_0x123ff1=_0x1ba3f0[_0x2a1191(0xa3)](_0x248bd0[0x0])||_0x248bd0[0x0],_0x2cc063=_0x1ba3f0['get'](_0x351a94[0x0])||_0x351a94[0x0];return _0x123ff1['localeCompare'](_0x2cc063,undefined,{'sensitivity':_0x2a1191(0x126)});});for(const [_0x54267e,_0xc8ee7a]of _0x2f7eaf){const _0x610b72=_0x1ba3f0[_0x55f2ac(0xa3)](_0x54267e)||_0x54267e;console[_0x55f2ac(0x172)](_0x55f2ac(0x199)+_0x610b72),_0xc8ee7a[_0x55f2ac(0xb9)](_0x100794);for(const _0x172175 of _0xc8ee7a){console[_0x55f2ac(0x172)](formatJourneyItem(_0x172175,'\x20\x20',_0x2b1d37(_0x172175['id'])));}}}}return 0x0;}}function a30_0x5ef9(){const _0xdd721e=['segmentName','INVALID_ARGUMENT','segmentPushCommand','segments','journey:list','isNew','Parent\x20segment\x20ID:','conversion','...','\x20new\x20files','has','List\x20journeys\x20in\x20current\x20context','setPhase','\x20details...','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)','Error:\x20--version\x20option\x20is\x20required','journey:version:create','file','journeyBundleName','State:','runAt','Session:','\x22\x20paused','run','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','cyan','journey:versions','✔\x20Found\x20','content','journey:activations','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','description','tdx.json','\x20Opening\x20','history','Found\x20','Listing\x20journey\x20versions...','log','Input:\x20','exitOrJumpRate','verbose','\x20\x20Folder\x20path:\x20','message','root\x20folder','web','map','find','user','exitOrJumpSize','connection','Activations:','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','nodes','jsonl','resourceName','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','then','\x20@\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20=\x20','Error:\x20Version\x20','1350nlECxT','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','diff','\x20\x20Statistics\x20not\x20available','add','(draft)','parentSegment','journeyBundleId','completed','Error:\x20Parent\x20segment\x20context\x20required','tsv','Target\x20directory:\x20','No\x20journeys\x20found','journeys','1101JlwqWa','📁\x20','activationParams','/e/','\x5c$&','workflowId','includeHistory','Available\x20stages:\x20','(archived)','execute','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','green','.journey.yml','milestoneSize','attributes','Table:\x20','buildIdToNameMap','completeMilestoneRate','✔\x20Journey\x20\x22','runAfterJourneyRefresh','split','format','\x0aChanges\x20to\x20\x27','state','archived','/j/da/je','Export\x20journey(s)\x20as\x20YAML\x20files','Pattern:\x20','database','resume','folderPath','Paused\x20at:','Fetching\x20','✔\x20Context\x20set:\x20','limit','Resolving\x20version...','type','\x20Created\x20v','toLowerCase','Triggering\x20journey\x20workflow...','renderStats','journeyId','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','1065450SoultL','7604YqVWoy','Status:','error','getJourney','pausedAt','journey:push','Error:\x20Journey\x20\x27','journeyName','Resolving\x20parent\x20segment...','\x20files?','journey:columns','Fetching\x20journeys\x20and\x20folders...','listActivationsFlat','\x20\x20Consolidating\x20duplicate\x20segment:\x20','reentryMode','paused','session','utf-8','listVersions','get','Resume\x20a\x20paused\x20journey','Listing\x20journeys...','test','rootFolderId','🗺️\x20','journey:traffic','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','getColumnMapping','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','links','\x20unchanged\x20files','size','(root)','columns','executeDryRun','Show\x20journey\x20details','-\x20no\x20files\x20written','helpText','goal','options','listFolders','sort','\x20->\x20','\x20\x20Target:\x20','No\x20statistics\x20available\x20for\x20journey:\x20','table','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','bold','dim','\x27\x20not\x20found\x20in\x20','segment','journey','no\x20connection','yellow','List\x20all\x20versions\x20of\x20a\x20journey','⚠️\x20','completionRate','updatedAt','\x20journey','scheduleType','Show\x20journey\x20table\x20column\x20mapping','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Resolved\x20YAML\x20file:\x20','pause','name','journey:run','\x20\x20-\x20','ID:','createVersion','1117dmdMyz','Error:\x20Invalid\x20version\x20number:\x20','folderId','rule','none','List\x20activations\x20for\x20a\x20journey','cwd','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','getStatistics','Getting\x20column\x20mapping...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','args','Database:\x20','listJourneysWithFolders','\x20version','from','Fetching\x20journey\x20','getParentFull','Paused:','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x22\x20not\x20found','\x20(rule\x20match)','journeyStages',',\x20version:\x20','hasPeriod','journey:pull','getSegment','includeStats',',\x20schedule:\x20','\x20\x20←\x20','relativePath','Listing\x20journey\x20activations...','5872520KifYOS','\x20\x20Preserving\x20local\x20segment\x20name:\x20','draft','Resolving\x20journey...','\x0aPull\x20summary:','stageNameMap','Warning:\x20Could\x20not\x20resolve\x20segment\x20','audienceId','no_parent','Getting\x20journey\x20statistics...','absolutePath','join','\x20\x20Parent\x20segment:\x20','6536952hkNaBl','\x20journeys','enteredSize','json','Fetching\x20users\x20and\x20connections...','replace','\x0aError:','kind','dryRun','listJourneysFromParentSegment','resolveJourneyId','(paused)','/app/ps/','site','folders','Journey\x20name:\x20','Resuming\x20journey...','versionNumber','resolveParentId','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','6274485YvTHCV','filter','\x20\x20Journey\x20ID:\x20','9846891aONxto','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','set','Stages:','\x20(draft)\x20—\x20\x22','relative','push','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Getting\x20version\x20','Target\x20file:\x20','yes','base','View\x20a\x20specific\x20version\x20of\x20a\x20journey','targetDir','createdAt','parent_segment','status','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Options:','filePath','red','length','Error:\x20Journey\x20not\x20found:\x20','getTrafficData','all','\x20\x20Name:\x20','stringify','Parent\x20segment:\x20','activation','\x20(ID:\x20','parentName','errorCode','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','stage','8RRkkos','stages','journey:stats','journey:pause','Journey:','Cancelled','Getting\x20journey\x20traffic\x20data...','connection\x20','hasChanges','connectionId','\x20not\x20found.\x20Available:\x20','Fetching\x20parent\x20segment...','journey:version:view','data','workflowSessionId'];a30_0x5ef9=function(){return _0xdd721e;};return a30_0x5ef9();}export class JourneyViewCommand extends BaseCommand{[a30_0x9050c5(0xd0)]='journey:view';['description']=a30_0x9050c5(0xb3);async['execute'](_0x230be6){const _0x339a8c=a30_0x9050c5,{options:_0x529a94,args:_0x14948a,tdx:_0x4be49f}=_0x230be6,_0x14e2a4=_0x14948a[0x0];if(!_0x14e2a4)return console['error'](_0x339a8c(0x8e)),console[_0x339a8c(0x92)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x339a8c(0x92)](_0x339a8c(0x12d)),console[_0x339a8c(0x92)](_0x339a8c(0x117)),0x1;_0x529a94['verbose']&&console[_0x339a8c(0x92)](_0x339a8c(0x173)+_0x14e2a4);const {journeyId:_0x5d35a8,parentSegmentId:_0x52edd2}=await resolveJourneyIdFromInput(_0x14e2a4,_0x529a94,_0x4be49f);if(_0x529a94[_0x339a8c(0x179)]){const _0x2a740e=getConsoleNextUrl(_0x529a94[_0x339a8c(0x110)],'/app/ps/'+_0x52edd2+_0x339a8c(0x19b)+_0x5d35a8+_0x339a8c(0x7d));return console[_0x339a8c(0x92)](a30_0x2170a8[_0x339a8c(0x1a3)]('✔')+_0x339a8c(0x16e)+a30_0x2170a8[_0x339a8c(0x166)](_0x2a740e)),openBrowser(_0x2a740e),0x0;}const _0x82e7bf=await withSpinner('Getting\x20journey\x20details...',()=>_0x4be49f[_0x339a8c(0xc3)][_0x339a8c(0x93)](_0x5d35a8),{'verbose':_0x529a94[_0x339a8c(0x175)]}),_0x4d1a7a=_0x82e7bf[_0x339a8c(0x14b)],_0x2ff02e=_0x529a94[_0x339a8c(0xf1)];let _0x40ff7e;if(_0x2ff02e)try{const _0x43ca47=await withSpinner(_0x339a8c(0xff),()=>_0x4be49f['journey'][_0x339a8c(0xdd)](_0x5d35a8),{'verbose':_0x529a94[_0x339a8c(0x175)]});_0x40ff7e=_0x43ca47[_0x339a8c(0x14b)];}catch{_0x529a94['verbose']&&console[_0x339a8c(0x92)](_0x339a8c(0x18d));}const _0x20edc4=getConsoleNextUrl(_0x529a94['site'],_0x339a8c(0x10f)+_0x52edd2+_0x339a8c(0x19b)+_0x5d35a8+'/j/da/je'),_0xc53bfe={'id':_0x4d1a7a['id'],'name':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0xd0)],'description':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0x16c)],'state':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0x7b)],'paused':_0x4d1a7a[_0x339a8c(0x1a6)]['paused'],'reentry_mode':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0x9e)],'stages':_0x4d1a7a[_0x339a8c(0x1a6)]['journeyStages']?.[_0x339a8c(0x130)]||0x0,..._0x4d1a7a['attributes'][_0x339a8c(0xb6)]&&{'goal':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0xb6)][_0x339a8c(0xd0)]},..._0x40ff7e&&{'statistics':{'size':_0x40ff7e[_0x339a8c(0xaf)],'entered':_0x40ff7e['enteredSize'],'goal_achieved':_0x40ff7e['goalSize'],'completion_rate':_0x40ff7e[_0x339a8c(0xc8)],'exit_or_jump':_0x40ff7e[_0x339a8c(0x17d)],'exit_or_jump_rate':_0x40ff7e[_0x339a8c(0x174)],'stages':_0x40ff7e[_0x339a8c(0x13f)]}},'url':_0x20edc4};return await handleSingleObjectOutput(_0xc53bfe,_0x529a94),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x140);[a30_0x9050c5(0x16c)]='Show\x20journey\x20statistics';async[a30_0x9050c5(0x1a1)](_0x181630){const _0x51494d=a30_0x9050c5,{options:_0x4f397b,args:_0x4e4108,tdx:_0x5c7807}=_0x181630,_0x96bf23=_0x4e4108[0x0];if(!requireNameOrPath(_0x96bf23))return 0x1;_0x4f397b['verbose']&&console[_0x51494d(0x92)](_0x51494d(0x173)+_0x96bf23);const _0x2726cf=_0x4f397b,_0xf316e7=_0x2726cf['from'],_0x3ed26c=_0x2726cf['to'],_0x4d8cc0=_0x2726cf[_0x51494d(0x19e)],_0x229480=_0x2726cf[_0x51494d(0x13d)];_0x4d8cc0&&!_0xf316e7&&!_0x3ed26c&&console[_0x51494d(0x92)](_0x51494d(0xe0));const _0x3eb77c=_0x4d8cc0?withJsonFormat(_0x4f397b):_0x4f397b,{journeyId:_0x1a5161,journeyName:_0x43072c}=await resolveJourneyIdFromInput(_0x96bf23,_0x3eb77c,_0x5c7807),_0x1b6f7b=_0xf316e7||_0x3ed26c?{'from':_0xf316e7,'to':_0x3ed26c}:undefined,_0x3a29ae=await withSpinner(_0x51494d(0xff),()=>Promise[_0x51494d(0x133)]([_0x5c7807[_0x51494d(0xc3)][_0x51494d(0x93)](_0x1a5161),_0x5c7807[_0x51494d(0xc3)]['getStatistics'](_0x1a5161,_0x1b6f7b)]),{'verbose':_0x3eb77c['verbose']}),[_0x5deabe,_0x2cb6c3]=_0x3a29ae['data'];if(!_0x2cb6c3||_0x2cb6c3[_0x51494d(0x8d)]===null)return console[_0x51494d(0x92)](_0x51494d(0xbc)+_0x43072c),console['error'](_0x51494d(0x180)),0x0;const _0x3a6fcc=buildStageNameMap(_0x5deabe),_0x29c8e1=!!(_0x1b6f7b&&_0x2cb6c3[_0x51494d(0x16f)]?.['length']),_0x1fae28={'stageNameMap':_0x3a6fcc,'hasPeriod':_0x29c8e1,'includeHistory':!!_0x4d8cc0};if(_0x229480&&_0x2cb6c3[_0x51494d(0x13f)]){const _0x4427e9=_0x2cb6c3['stages'][_0x51494d(0x17b)](_0x580fac=>{const _0xd85b7b=_0x51494d,_0x212f89=_0x3a6fcc[_0xd85b7b(0xa3)](_0x580fac['id'])??'';return _0x212f89[_0xd85b7b(0x8a)]()===_0x229480[_0xd85b7b(0x8a)]();});if(_0x4427e9)return await handleSingleObjectOutput(formatStageStats(_0x4427e9,_0x1fae28),_0x3eb77c),0x0;const _0x2c35a3=_0x2cb6c3['stages'][_0x51494d(0x17a)](_0x305317=>_0x3a6fcc[_0x51494d(0xa3)](_0x305317['id'])??_0x305317['id']);return console[_0x51494d(0x92)]('Error:\x20Stage\x20\x22'+_0x229480+_0x51494d(0xea)),console['error'](_0x51494d(0x19f)+_0x2c35a3['join'](',\x20')),0x1;}const _0x4e2b93=_0x2cb6c3[_0x51494d(0x13f)]?.[_0x51494d(0x17a)](_0x16440c=>formatStageStats(_0x16440c,_0x1fae28)),_0x14b9f=assembleJourneyStats(_0x2cb6c3,{'from':_0xf316e7,'to':_0x3ed26c,'includeHistory':_0x4d8cc0});return await this[_0x51494d(0x8c)](_0x14b9f,_0x4e2b93??[],_0x3eb77c),0x0;}async['renderStats'](_0x140db2,_0x3b503f,_0x4820bc){const _0x333977=a30_0x9050c5,_0x8da82e=_0x4820bc[_0x333977(0x1ad)]===_0x333977(0x106)||_0x4820bc[_0x333977(0x1ad)]===_0x333977(0x182)||_0x4820bc[_0x333977(0x106)]||_0x4820bc[_0x333977(0x182)];if(_0x8da82e){_0x140db2[_0x333977(0x13f)]=_0x3b503f,await handleSingleObjectOutput(_0x140db2,_0x4820bc);return;}await handleSingleObjectOutput(_0x140db2,_0x4820bc);for(const _0x549944 of _0x3b503f){console[_0x333977(0x172)](''),console[_0x333977(0x172)](String(a30_0x2170a8[_0x333977(0x166)]['bold']('['+_0x549944[_0x333977(0xd0)]+']'))+a30_0x2170a8[_0x333977(0xc0)]('\x20'+_0x549944['id']));const {id:_0x39635a,name:_0x226449,..._0x29afb6}=_0x549944;await handleSingleObjectOutput(_0x29afb6,_0x4820bc);}}}export class JourneyTrafficCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0xa9);['description']=a30_0x9050c5(0xdc);async[a30_0x9050c5(0x1a1)](_0x5bd628){const _0x5126b8=a30_0x9050c5,{options:_0xf77932,args:_0x101c8d,tdx:_0x44ed3d}=_0x5bd628,_0x5be10a=_0x101c8d[0x0];if(!requireNameOrPath(_0x5be10a))return 0x1;_0xf77932[_0x5126b8(0x175)]&&console[_0x5126b8(0x92)](_0x5126b8(0x173)+_0x5be10a);const _0xa58382=_0xf77932,_0x398ea6=_0xa58382[_0x5126b8(0x88)],_0x500506=_0xa58382[_0x5126b8(0xe5)],_0x3d8502=_0xa58382['to'],_0x145310=_0xa58382[_0x5126b8(0x86)];if(_0x398ea6&&_0x398ea6!=='conversion'&&_0x398ea6!==_0x5126b8(0x137))return console[_0x5126b8(0x92)]('Error:\x20Invalid\x20--type\x20\x22'+_0x398ea6+_0x5126b8(0x165)),0x1;const _0x1c1607=withJsonFormat(_0xf77932),{journeyId:_0x22c65b,journeyName:_0x4b81e3}=await resolveJourneyIdFromInput(_0x5be10a,_0x1c1607,_0x44ed3d),_0x3c5996={'type':_0x398ea6,'from':_0x500506,'to':_0x3d8502,'limit':_0x145310},_0x1f1233=await withSpinner(_0x5126b8(0x144),()=>_0x44ed3d['journey'][_0x5126b8(0x132)](_0x22c65b,_0x3c5996),{'verbose':_0x1c1607[_0x5126b8(0x175)]}),_0x1c204f=_0x1f1233[_0x5126b8(0x14b)],_0x590491=_0x1c204f[_0x5126b8(0x154)]&&(_0x1c204f[_0x5126b8(0x154)][_0x5126b8(0x181)][_0x5126b8(0x130)]>0x0||_0x1c204f[_0x5126b8(0x154)][_0x5126b8(0xad)][_0x5126b8(0x130)]>0x0),_0x1880d6=_0x1c204f[_0x5126b8(0x137)]&&_0x1c204f[_0x5126b8(0x137)]['length']>0x0;if(!_0x590491&&!_0x1880d6)return console[_0x5126b8(0x92)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x4b81e3),console[_0x5126b8(0x92)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x500506&&_0x3d8502&&console[_0x5126b8(0x92)]('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(_0x1c204f,_0x1c1607),0x0;}}function formatStageStats(_0x40f1dc,_0x4ef016){const _0x1defd8=a30_0x9050c5,_0x16d207=_0x4ef016[_0x1defd8(0xee)]&&_0x40f1dc[_0x1defd8(0x16f)]?.[_0x1defd8(0x130)]?aggregateStageHistory(_0x40f1dc['history']):{'size':_0x40f1dc[_0x1defd8(0xaf)],'entered':_0x40f1dc[_0x1defd8(0x105)],'milestone':_0x40f1dc[_0x1defd8(0x1a5)],'milestone_rate':_0x40f1dc[_0x1defd8(0x1a9)],'exit_or_jump':_0x40f1dc[_0x1defd8(0x17d)],'exit_or_jump_rate':_0x40f1dc[_0x1defd8(0x174)]},_0x350a10={'id':_0x40f1dc['id'],'name':_0x4ef016[_0x1defd8(0xfb)][_0x1defd8(0xa3)](_0x40f1dc['id'])??_0x40f1dc['id'],..._0x16d207};return _0x4ef016[_0x1defd8(0xee)]&&_0x4ef016['includeHistory']&&_0x40f1dc['history']&&(_0x350a10['history']=_0x40f1dc['history']),_0x350a10;}export class JourneyPauseCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x141);[a30_0x9050c5(0x16c)]='Pause\x20a\x20running\x20journey';async[a30_0x9050c5(0x1a1)](_0x1e4bb8){const _0x3ad1bc=a30_0x9050c5,{options:_0x21e993,args:_0x913f3c,tdx:_0x55b1ce}=_0x1e4bb8,_0x3317b5=_0x913f3c[0x0];if(!requireNameOrPath(_0x3317b5))return 0x1;_0x21e993['verbose']&&console[_0x3ad1bc(0x92)](_0x3ad1bc(0x173)+_0x3317b5);const {journeyId:_0x58ea74,journeyName:_0x70d7fa}=await resolveJourneyIdFromInput(_0x3317b5,_0x21e993,_0x55b1ce);if(!_0x21e993['yes']){const _0x5646b1=await confirm(_0x3ad1bc(0x16b)+_0x70d7fa+'\x22?');if(!_0x5646b1)return console[_0x3ad1bc(0x92)]('Cancelled'),0x0;}const _0x373c44=await withSpinner('Pausing\x20journey...',()=>_0x55b1ce[_0x3ad1bc(0xc3)][_0x3ad1bc(0xcf)](_0x58ea74),{'verbose':_0x21e993['verbose']}),_0xe5b757=_0x373c44[_0x3ad1bc(0x14b)];return console['error']('✔\x20Journey\x20\x22'+_0xe5b757[_0x3ad1bc(0x1a6)]['name']+_0x3ad1bc(0x163)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0xd1);[a30_0x9050c5(0x16c)]='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a30_0x9050c5(0x1a1)](_0x54e24b){const _0x1999f1=a30_0x9050c5,{options:_0x488a4d,args:_0x96baf6,tdx:_0xf07d6b}=_0x54e24b,_0x2ad697=_0x96baf6[0x0];if(!requireNameOrPath(_0x2ad697))return 0x1;_0x488a4d[_0x1999f1(0x175)]&&console['error'](_0x1999f1(0x173)+_0x2ad697);const {journeyId:_0x46f845,journeyName:_0x10efc0}=await resolveJourneyIdFromInput(_0x2ad697,_0x488a4d,_0xf07d6b);if(_0x488a4d['dryRun'])return await this[_0x1999f1(0xb2)](_0x54e24b,_0x46f845,_0x10efc0);if(!_0x488a4d['yes']){const _0x9ee019=await confirm(_0x1999f1(0x1a2)+_0x10efc0+'\x22?');if(!_0x9ee019)return console[_0x1999f1(0x92)](_0x1999f1(0x143)),0x0;}const _0x1d544c=await withSpinner(_0x1999f1(0x8b),()=>_0xf07d6b[_0x1999f1(0xc3)][_0x1999f1(0x164)](_0x46f845),{'verbose':_0x488a4d[_0x1999f1(0x175)]}),_0xcfba0c=_0x1d544c[_0x1999f1(0x14b)],_0x52b443=getWorkflowSessionUrl(_0x488a4d['site'],_0xcfba0c[_0x1999f1(0x19d)],_0xcfba0c[_0x1999f1(0x14c)]);return console[_0x1999f1(0x92)]('\x0a'+a30_0x2170a8[_0x1999f1(0x1a3)]('✔')+'\x20Journey\x20workflow\x20started'),console[_0x1999f1(0x92)]('\x20\x20'+a30_0x2170a8['dim']('Journey:')+'\x20'+_0x10efc0),console[_0x1999f1(0x92)]('\x20\x20'+a30_0x2170a8[_0x1999f1(0xc0)](_0x1999f1(0x91))+'\x20'+_0xcfba0c[_0x1999f1(0x12b)]),console[_0x1999f1(0x92)]('\x20\x20'+a30_0x2170a8[_0x1999f1(0xc0)](_0x1999f1(0x162))+'\x20'+_0xcfba0c[_0x1999f1(0x14c)]),console[_0x1999f1(0x92)]('\x20\x20'+_0x52b443),0x0;}async[a30_0x9050c5(0xb2)](_0xf9a72c,_0x534de0,_0x39e5b8){const _0x450728=a30_0x9050c5,{options:_0x2a3dff,tdx:_0x575c38}=_0xf9a72c,_0x2b07d9=await withSpinner(_0x450728(0xe6)+_0x39e5b8+_0x450728(0x155),()=>Promise[_0x450728(0x133)]([_0x575c38[_0x450728(0xc3)][_0x450728(0x93)](_0x534de0),_0x575c38[_0x450728(0xc3)]['listActivationsFlat'](_0x534de0)]),{'verbose':_0x2a3dff[_0x450728(0x175)]}),[_0x58a835,_0x3b89c2]=_0x2b07d9[_0x450728(0x14b)],_0x5cb012=_0x58a835['attributes'],_0x1cf39a=_0x5cb012['journeyStages'];console[_0x450728(0x172)](a30_0x2170a8[_0x450728(0xbf)](_0x450728(0x142)),_0x5cb012['name']),console[_0x450728(0x172)](a30_0x2170a8['bold'](_0x450728(0xd3)),_0x58a835['id']),console[_0x450728(0x172)](a30_0x2170a8['bold']('State:'),_0x5cb012['state']),console['log'](a30_0x2170a8[_0x450728(0xbf)](_0x450728(0xe8)),_0x5cb012[_0x450728(0x9f)]?a30_0x2170a8[_0x450728(0xc5)]('yes'):a30_0x2170a8[_0x450728(0x1a3)]('no')),console['log'](a30_0x2170a8['bold'](_0x450728(0x153)),_0x5cb012[_0x450728(0xfd)]);const _0x481e40=_0x1cf39a[_0x450728(0x130)]>0x0?'\x20('+_0x1cf39a[_0x450728(0x17a)](_0x5e1184=>_0x5e1184[_0x450728(0xd0)])['join'](',\x20')+')':'';console[_0x450728(0x172)](a30_0x2170a8[_0x450728(0xbf)](_0x450728(0x11e)),''+_0x1cf39a[_0x450728(0x130)]+_0x481e40),console[_0x450728(0x172)]('');if(_0x3b89c2[_0x450728(0x130)]===0x0)console['log'](a30_0x2170a8['bold'](_0x450728(0x17f)),a30_0x2170a8[_0x450728(0xc0)]('(none)'));else{console[_0x450728(0x172)](a30_0x2170a8['bold'](_0x450728(0x17f)));for(const _0x21641f of _0x3b89c2){const _0x54a9a0=_0x21641f['name']??'(unnamed)',_0x33dcaa=_0x21641f[_0x450728(0x147)]!=null?_0x450728(0x145)+_0x21641f[_0x450728(0x147)]:_0x450728(0xc4),_0x29b164=_0x21641f[_0x450728(0xcb)]?''+_0x21641f[_0x450728(0xcb)]+(_0x21641f[_0x450728(0x161)]?_0x450728(0x186)+_0x21641f[_0x450728(0x161)]:''):_0x450728(0xd9),_0x338ff4=_0x21641f[_0x450728(0x1ab)]?'\x20[runs\x20on\x20refresh]':'';console[_0x450728(0x172)]('\x20\x20'+a30_0x2170a8[_0x450728(0xc5)](_0x450728(0xc7))+'\x20'+_0x54a9a0+_0x450728(0xf3)+_0x33dcaa+_0x450728(0xf2)+_0x29b164+_0x338ff4);}}return console[_0x450728(0x172)](a30_0x2170a8[_0x450728(0xc5)](_0x450728(0x12c))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a30_0x9050c5(0xd0)]='journey:resume';[a30_0x9050c5(0x16c)]=a30_0x9050c5(0xa4);async[a30_0x9050c5(0x1a1)](_0xd4c52c){const _0x4a1f67=a30_0x9050c5,{options:_0x18074a,args:_0x3d5096,tdx:_0x14093b}=_0xd4c52c,_0x5ca287=_0x3d5096[0x0];if(!requireNameOrPath(_0x5ca287))return 0x1;_0x18074a[_0x4a1f67(0x175)]&&console[_0x4a1f67(0x92)](_0x4a1f67(0x173)+_0x5ca287);const {journeyId:_0x2374f5,journeyName:_0x274ad8}=await resolveJourneyIdFromInput(_0x5ca287,_0x18074a,_0x14093b);if(_0x18074a[_0x4a1f67(0x10b)])return await this['executeDryRun'](_0xd4c52c,_0x2374f5,_0x274ad8);if(!_0x18074a[_0x4a1f67(0x125)]){const _0x199c3e=await confirm(_0x4a1f67(0x122)+_0x274ad8+'\x22?');if(!_0x199c3e)return console[_0x4a1f67(0x92)](_0x4a1f67(0x143)),0x0;}const _0x18b207=await withSpinner(_0x4a1f67(0x113),()=>_0x14093b[_0x4a1f67(0xc3)][_0x4a1f67(0x81)](_0x2374f5),{'verbose':_0x18074a[_0x4a1f67(0x175)]}),_0x363902=_0x18b207[_0x4a1f67(0x14b)];return console[_0x4a1f67(0x92)](_0x4a1f67(0x1aa)+_0x363902[_0x4a1f67(0x1a6)]['name']+'\x22\x20resumed'),0x0;}async[a30_0x9050c5(0xb2)](_0x4675c7,_0x28af6f,_0x10753c){const _0x549132=a30_0x9050c5,{options:_0x1f2385,tdx:_0x444f34}=_0x4675c7,_0x2acc4c=await withSpinner(_0x549132(0xe6)+_0x10753c+_0x549132(0x155),()=>Promise['all']([_0x444f34[_0x549132(0xc3)]['getJourney'](_0x28af6f),_0x444f34[_0x549132(0xc3)][_0x549132(0x9c)](_0x28af6f)]),{'verbose':_0x1f2385[_0x549132(0x175)]}),[_0x577fc8,_0x12a72d]=_0x2acc4c[_0x549132(0x14b)],_0x194059=_0x577fc8[_0x549132(0x1a6)],_0x35f11f=_0x194059['journeyStages'];console['log'](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x142)),_0x194059['name']),console[_0x549132(0x172)](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0xd3)),_0x577fc8['id']),console['log'](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x160)),_0x194059[_0x549132(0x7b)]),console[_0x549132(0x172)](a30_0x2170a8['bold'](_0x549132(0xe8)),_0x194059[_0x549132(0x9f)]?a30_0x2170a8[_0x549132(0xc5)](_0x549132(0x125)):a30_0x2170a8[_0x549132(0x1a3)]('no'));_0x194059[_0x549132(0x94)]&&console['log'](a30_0x2170a8['bold'](_0x549132(0x83)),_0x194059[_0x549132(0x94)]);console[_0x549132(0x172)](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x153)),_0x194059['audienceId']);const _0x2f8805=_0x35f11f[_0x549132(0x130)]>0x0?'\x20('+_0x35f11f[_0x549132(0x17a)](_0x594152=>_0x594152[_0x549132(0xd0)])['join'](',\x20')+')':'';console[_0x549132(0x172)](a30_0x2170a8['bold'](_0x549132(0x11e)),''+_0x35f11f[_0x549132(0x130)]+_0x2f8805),console[_0x549132(0x172)]('');if(_0x12a72d[_0x549132(0x130)]===0x0)console['log'](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x17f)),a30_0x2170a8[_0x549132(0xc0)]('(none)'));else{console[_0x549132(0x172)](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x17f)));for(const _0xb586c3 of _0x12a72d){const _0x69366d=_0xb586c3[_0x549132(0xd0)]??'(unnamed)',_0x32623f=_0xb586c3[_0x549132(0x147)]!=null?_0x549132(0x145)+_0xb586c3[_0x549132(0x147)]:_0x549132(0xc4),_0x3a9e89=_0xb586c3[_0x549132(0xcb)]?''+_0xb586c3[_0x549132(0xcb)]+(_0xb586c3[_0x549132(0x161)]?'\x20@\x20'+_0xb586c3[_0x549132(0x161)]:''):_0x549132(0xd9),_0x4353d2=_0xb586c3[_0x549132(0x1ab)]?'\x20[runs\x20on\x20refresh]':'';console['log']('\x20\x20'+a30_0x2170a8[_0x549132(0xc5)](_0x549132(0xc7))+'\x20'+_0x69366d+_0x549132(0xf3)+_0x32623f+_0x549132(0xf2)+_0x3a9e89+_0x4353d2);}}return console['log'](a30_0x2170a8[_0x549132(0xc5)]('\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.')),0x0;}}export class JourneyPullCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0xef);['description']=a30_0x9050c5(0x7e);async[a30_0x9050c5(0x1a1)](_0x4bfe90){const _0x1b736d=a30_0x9050c5,{options:_0x407f33,args:_0x312009,tdx:_0x466178}=_0x4bfe90,_0xf17abd=_0x407f33,_0x41dea3=_0x312009[0x0],_0x31f2f7=_0x41dea3&&isYamlFilePath(_0x41dea3),_0x2a534c=await resolveTarget({'arg':_0x31f2f7?_0x41dea3:undefined,'contextParent':_0x407f33[_0x1b736d(0x190)],'cwd':process[_0x1b736d(0xdb)]()});if(!isSuccessfulResolution(_0x2a534c))return _0x2a534c[_0x1b736d(0x13a)]===_0x1b736d(0xfe)?(console['error'](a30_0x2170a8['yellow'](_0x1b736d(0xac))),console['error'](_0x1b736d(0x15b)),console[_0x1b736d(0x92)](_0x1b736d(0x11c)),console[_0x1b736d(0x92)](_0x1b736d(0xdf)),console[_0x1b736d(0x92)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a30_0x2170a8['red']('Error:\x20'+_0x2a534c[_0x1b736d(0x177)]+'\x0a')),_0x2a534c[_0x1b736d(0xb5)]&&console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0x166)](_0x2a534c[_0x1b736d(0xb5)]))),0x1;let _0x2b61b7=_0x31f2f7?undefined:_0x41dea3,_0x5dfd43,_0x35431f;_0x2a534c[_0x1b736d(0x88)]===_0x1b736d(0x15e)&&(_0x2b61b7=_0x2a534c[_0x1b736d(0x183)],_0x5dfd43=_0x2a534c['filePath'],_0x35431f=_0x2a534c[_0x1b736d(0x82)]);const _0x58cb12=_0x2a534c[_0x1b736d(0x139)],_0x4ba0e6=_0x2a534c[_0x1b736d(0x128)];_0xf17abd[_0x1b736d(0x175)]&&(console[_0x1b736d(0x92)](_0x1b736d(0x136)+_0x58cb12),console[_0x1b736d(0x92)](_0x1b736d(0x195)+_0x4ba0e6),_0x2b61b7&&console[_0x1b736d(0x92)](_0x1b736d(0x112)+_0x2b61b7),_0x5dfd43&&console[_0x1b736d(0x92)](_0x1b736d(0x124)+_0x5dfd43),_0x35431f&&console[_0x1b736d(0x92)]('Folder\x20path:\x20'+_0x35431f));const _0x2a579f=await withSpinner(_0x1b736d(0x98),()=>_0x466178[_0x1b736d(0xc2)][_0x1b736d(0x115)](_0x58cb12),{'verbose':_0x407f33[_0x1b736d(0x175)]}),_0x5b8f73=_0x2a579f[_0x1b736d(0x14b)],{journeys:_0x219d4e,folders:_0x11036a}=await withSpinner(_0x1b736d(0x9b),async()=>{const _0x3d4bf1=_0x1b736d,[_0x257b25,_0x24b82b]=await Promise[_0x3d4bf1(0x133)]([_0x466178[_0x3d4bf1(0xc3)][_0x3d4bf1(0x10c)](_0x5b8f73,undefined,{'includeAllVersions':!![]}),_0x466178['segment'][_0x3d4bf1(0xb8)](_0x5b8f73)]);return{'journeys':_0x257b25,'folders':_0x24b82b};},{'verbose':_0x407f33[_0x1b736d(0x175)]})[_0x1b736d(0x185)](_0x519e2f=>_0x519e2f[_0x1b736d(0x14b)]);let _0x8da429=_0x219d4e;const _0x28b9b8=buildFolderIdToPathMap(_0x11036a);if(_0x2b61b7){const _0x231534=_0x8da429['filter'](_0x3d9416=>_0x3d9416['journeyBundleName'][_0x1b736d(0x8a)]()===_0x2b61b7['toLowerCase']());if(_0x231534[_0x1b736d(0x130)]===0x0)return console['error'](_0x1b736d(0x131)+_0x2b61b7),console['error'](_0x1b736d(0x184)),0x1;_0x8da429=_0x231534;}if(_0x35431f!==undefined){const _0x2eb5f5=_0x8da429[_0x1b736d(0x119)](_0x4780d1=>{const _0x23a9da=_0x1b736d,_0x2a72f6=_0x4780d1[_0x23a9da(0xd7)]?_0x28b9b8['get'](_0x4780d1['folderId'])||'':'';return _0x2a72f6===_0x35431f;});if(_0x2eb5f5[_0x1b736d(0x130)]===0x0&&_0x8da429[_0x1b736d(0x130)]>0x0){console['error'](_0x1b736d(0x96)+_0x2b61b7+_0x1b736d(0xc1)+(_0x35431f||_0x1b736d(0x178))),console['error'](_0x1b736d(0xaa));for(const _0x5eb689 of _0x8da429){const _0x4929de=_0x5eb689[_0x1b736d(0xd7)]?_0x28b9b8[_0x1b736d(0xa3)](_0x5eb689[_0x1b736d(0xd7)])||'':'';console[_0x1b736d(0x92)](_0x1b736d(0xd2)+(_0x4929de||_0x1b736d(0xb0))+'/'+_0x5eb689[_0x1b736d(0x15f)]);}return 0x1;}_0x8da429=_0x2eb5f5;}if(_0x8da429['length']===0x0)return console['error'](_0x1b736d(0x196)),0x0;const _0x5025d2=new Map();for(const _0x9427d4 of _0x8da429){const _0x5c6362=_0x9427d4[_0x1b736d(0x191)];!_0x5025d2[_0x1b736d(0x157)](_0x5c6362)&&_0x5025d2[_0x1b736d(0x11d)](_0x5c6362,[]),_0x5025d2['get'](_0x5c6362)[_0x1b736d(0x121)](_0x9427d4);}for(const _0x11d23e of _0x5025d2['values']()){_0x11d23e[_0x1b736d(0xb9)]((_0x12e224,_0x1a0921)=>(_0x12e224[_0x1b736d(0x114)]||0x0)-(_0x1a0921[_0x1b736d(0x114)]||0x0));}const _0x1bbadc=[],{idToEmailMap:_0xb4ebaa,connectionIdToNameMap:_0xe40f1c}=await withSpinner(_0x1b736d(0x107),async()=>{const _0x38f7a0=_0x1b736d,[_0x4e3aa3,_0x4d0c4e]=await Promise[_0x38f7a0(0x133)]([_0x466178[_0x38f7a0(0x17c)]['buildIdToEmailMap'](),_0x466178[_0x38f7a0(0x17e)][_0x38f7a0(0x1a8)]()]);return{'idToEmailMap':_0x4e3aa3,'connectionIdToNameMap':_0x4d0c4e};},{'verbose':_0x407f33[_0x1b736d(0x175)]})['then'](_0x29a3d4=>_0x29a3d4['data']);for(const _0x432a22 of _0x5025d2['values']()){const _0x5899b3=_0x432a22[0x0][_0x1b736d(0x15f)],_0x3adea2=_0x432a22[0x0][_0x1b736d(0xd7)],_0x37b952=_0x3adea2?_0x28b9b8[_0x1b736d(0xa3)](_0x3adea2)||'':'',_0x3712fd=_0x37b952?a30_0x39acee[_0x1b736d(0x101)](_0x4ba0e6,_0x37b952):_0x4ba0e6,_0x485b75=_0x5dfd43||a30_0x39acee['join'](_0x3712fd,sanitizeFileName(_0x5899b3)+_0x1b736d(0x1a4));let _0x9a98e7,_0x1a2f7a;if(existsSync(_0x485b75))try{const _0x40f520=readFileSync(_0x485b75,'utf-8'),_0x4c93a4=parseYamlString(_0x40f520);_0x1a2f7a=_0x4c93a4,_0x9a98e7=buildRuleToNameMapping(_0x4c93a4),_0xf17abd['verbose']&&_0x9a98e7[_0x1b736d(0xaf)]>0x0&&console[_0x1b736d(0x92)](_0x1b736d(0x170)+_0x9a98e7['size']+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x5899b3);}catch(_0x53b103){_0xf17abd[_0x1b736d(0x175)]&&console[_0x1b736d(0x92)](_0x1b736d(0x18b)+_0x53b103[_0x1b736d(0x177)]);}const _0x41eac2=[],_0x3437eb=new Set(),_0x1cf453=new Map(),_0x4da90b=new Map(),_0x388dc1=new Set(),_0x468d2b=new Map(),_0x24cb4a=new Map(),_0x104f37=createJumpTargetCache();await withProgressSpinner(_0x1b736d(0x84)+_0x5899b3+_0x1b736d(0x155),async _0x32cae1=>{const _0x14759e=_0x1b736d;for(const _0x1b3f4b of _0x432a22){const _0x46deef=_0x432a22[_0x14759e(0x130)]>0x1?_0x1b3f4b[_0x14759e(0x15f)]+'\x20v'+(_0x1b3f4b['versionNumber']||0x1):_0x1b3f4b[_0x14759e(0x15f)];_0x32cae1[_0x14759e(0x159)](_0x14759e(0x84)+_0x46deef);const _0xa84921=await _0x466178['journey'][_0x14759e(0x93)](_0x1b3f4b['id']),_0x1b6ea5=_0xa84921['attributes']?.[_0x14759e(0xfd)],_0x2cffd8={'resolveSegment':async _0x160b94=>{const _0x6c0198=_0x14759e;if(!_0x1b6ea5)return{'name':_0x160b94,'isJourneyLocal':![]};const _0x120718=_0x1cf453[_0x6c0198(0xa3)](_0x160b94);if(_0x120718)return _0x120718;try{const _0x3b90d2=await _0x466178[_0x6c0198(0xc2)][_0x6c0198(0xf0)](_0x1b6ea5,_0x160b94),_0xa8ce08=_0x3b90d2[_0x6c0198(0x10a)]===SEGMENT_KIND_JOURNEY;let _0x52b8d6,_0x5a4d44=_0x3b90d2[_0x6c0198(0xd0)];if(_0xa8ce08&&_0x3b90d2[_0x6c0198(0xd8)]){const _0x3c272d=await segmentResponseToDef(_0x3b90d2,{'resolveSegmentName':async _0x2ee412=>{const _0x18ec77=_0x6c0198,_0x430087=_0x1cf453[_0x18ec77(0xa3)](_0x2ee412);if(_0x430087)return _0x430087[_0x18ec77(0xd0)];const _0x5b255a=await _0x2cffd8['resolveSegment'](_0x2ee412);return _0x5b255a['name'];}}),_0x49a29c=_0x3c272d[_0x6c0198(0xd8)];_0x52b8d6={'description':_0x3b90d2[_0x6c0198(0x16c)],'rule':_0x49a29c};const _0x2d0bcd=serializeRule(_0x49a29c),_0x12a984=_0x4da90b[_0x6c0198(0xa3)](_0x2d0bcd);if(_0x12a984)_0x5a4d44=_0x12a984,_0x52b8d6=undefined,_0xf17abd[_0x6c0198(0x175)]&&console['error'](_0x6c0198(0x9d)+_0x3b90d2[_0x6c0198(0xd0)]+_0x6c0198(0xba)+_0x12a984);else{let _0x2501c5=![];if(_0x9a98e7){const _0x3d34be=_0x9a98e7['get'](_0x2d0bcd);if(_0x3d34be){const _0x224226=_0x3d34be['find'](_0x476c67=>!_0x3437eb[_0x6c0198(0x157)](_0x476c67));_0x224226&&(_0x5a4d44=_0x224226,_0x3437eb['add'](_0x224226),_0x4da90b[_0x6c0198(0x11d)](_0x2d0bcd,_0x224226),_0x2501c5=!![],_0xf17abd['verbose']&&console[_0x6c0198(0x92)](_0x6c0198(0xf7)+_0x224226+_0x6c0198(0xeb)));}}if(!_0x2501c5){const _0xd3d0a9=generateJourneyLocalName(_0x3b90d2['name']);_0xd3d0a9&&(_0x5a4d44=_0xd3d0a9);let _0x571c29=_0x5a4d44,_0x1b6f07=0x2;while(_0x3437eb[_0x6c0198(0x157)](_0x571c29)){_0x571c29=_0x5a4d44+'_'+_0x1b6f07,_0x1b6f07++;}_0x3437eb[_0x6c0198(0x18e)](_0x571c29),_0x4da90b[_0x6c0198(0x11d)](_0x2d0bcd,_0x571c29),_0x5a4d44=_0x571c29;}}}const _0x180455={'name':_0x5a4d44,'isJourneyLocal':_0xa8ce08,'definition':_0x52b8d6};return _0x1cf453[_0x6c0198(0x11d)](_0x160b94,_0x180455),_0x180455;}catch(_0xda40d4){return _0x407f33[_0x6c0198(0x175)]&&console[_0x6c0198(0x92)](_0x6c0198(0xfc)+_0x160b94+':\x20'+_0xda40d4[_0x6c0198(0x177)]),{'name':_0x160b94,'isJourneyLocal':![]};}},'resolveActivation':async _0x1684dc=>{const _0x401cfd=_0x14759e,_0x15df4b=_0x468d2b['get'](_0x1684dc);if(_0x15df4b)return _0x15df4b;try{const _0x2102f5=await _0x466178[_0x401cfd(0xc3)]['getActivation'](_0x1b3f4b['id'],_0x1684dc),_0x3cb42d=journeyActivationStepToYaml(_0x2102f5,_0xb4ebaa,_0xe40f1c),_0x3f7b40=JSON[_0x401cfd(0x135)]({'name':_0x3cb42d[_0x401cfd(0xd0)],'connection':_0x3cb42d[_0x401cfd(0x17e)],'connector_config':_0x3cb42d['connector_config']}),_0x2dc93e=_0x24cb4a['get'](_0x3f7b40);if(_0x2dc93e){const _0xc8821f={'name':_0x2dc93e,'isJourneyLocal':!![],'definition':_0x3cb42d};return _0x468d2b[_0x401cfd(0x11d)](_0x1684dc,_0xc8821f),_0xc8821f;}const _0x31c29b=_0x2102f5[_0x401cfd(0x1a6)][_0x401cfd(0x19a)][_0x401cfd(0xd0)]||_0x1684dc,_0x2be5c3=sanitizeYamlKey(_0x31c29b)||'activation_'+_0x1684dc;let _0x1faf8e=_0x2be5c3,_0x349acc=0x2;while(_0x388dc1[_0x401cfd(0x157)](_0x1faf8e)){_0x1faf8e=_0x2be5c3+'_'+_0x349acc,_0x349acc++;}_0x388dc1[_0x401cfd(0x18e)](_0x1faf8e),_0x24cb4a['set'](_0x3f7b40,_0x1faf8e);const _0x19be24={'name':_0x1faf8e,'isJourneyLocal':!![],'definition':_0x3cb42d};return _0x468d2b[_0x401cfd(0x11d)](_0x1684dc,_0x19be24),_0x19be24;}catch(_0x4066ae){return _0x407f33[_0x401cfd(0x175)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x1684dc+':\x20'+_0x4066ae[_0x401cfd(0x177)]),{'name':_0x1684dc,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0xfc5655,_0x1ec5bf)=>{const _0x11cc8b=_0x14759e;return resolveJumpTarget(_0xfc5655,_0x1ec5bf,_0x104f37,_0x1cedd3=>_0x466178[_0x11cc8b(0xc3)][_0x11cc8b(0x93)](_0x1cedd3));}},_0x135755=await journeyResponseToDef(_0xa84921,_0x2cffd8);_0x41eac2[_0x14759e(0x121)]({'item':_0x1b3f4b,'yaml':_0x135755});}},{'verbose':_0x407f33[_0x1b736d(0x175)]});const _0x3a4601=await _0x466178[_0x1b736d(0xc3)]['getLatestJourneyId'](_0x432a22[0x0]['journeyBundleId']),_0x22d1da=buildMergedJourneyDef(_0x41eac2,_0x9a98e7,_0x3a4601),_0x4bed9c=normalizeJourneyDef(_0x22d1da,_0x1a2f7a),_0x30ab6d=toYamlString(_0x4bed9c),_0xc01586=_0x5dfd43||a30_0x39acee[_0x1b736d(0x101)](_0x3712fd,sanitizeFileName(_0x5899b3)+_0x1b736d(0x1a4));!_0x5dfd43&&_0x37b952&&!existsSync(_0x3712fd)&&mkdirSync(_0x3712fd,{'recursive':!![]});const _0x41dac5=a30_0x39acee[_0x1b736d(0x120)](process['cwd'](),_0xc01586);if(existsSync(_0xc01586)){const _0x517503=readFileSync(_0xc01586,_0x1b736d(0xa1)),_0x30a3bb=generateDiff(_0x517503,_0x30ab6d),_0x5990b4=hasChanges(_0x30a3bb);_0x1bbadc[_0x1b736d(0x121)]({'relativePath':_0x41dac5,'absolutePath':_0xc01586,'content':_0x30ab6d,'isNew':![],'hasChanges':_0x5990b4,'diff':_0x5990b4?formatDiffWithColors(_0x30a3bb):undefined});}else _0x1bbadc['push']({'relativePath':_0x41dac5,'absolutePath':_0xc01586,'content':_0x30ab6d,'isNew':!![],'hasChanges':![]});}const _0xf1c4bd=_0x1bbadc[_0x1b736d(0x119)](_0x1c7de5=>_0x1c7de5['isNew']),_0x33124b=_0x1bbadc[_0x1b736d(0x119)](_0xa0fa84=>!_0xa0fa84[_0x1b736d(0x152)]&&_0xa0fa84['hasChanges']),_0x4a4292=_0x1bbadc['filter'](_0x3ef265=>!_0x3ef265[_0x1b736d(0x152)]&&!_0x3ef265[_0x1b736d(0x146)]),_0x4ff7ca=_0x8da429[_0x1b736d(0x130)],_0x408c28=_0x5025d2[_0x1b736d(0xaf)],_0x25d110=_0x4ff7ca>_0x408c28?'\x20('+_0x4ff7ca+'\x20versions)':'';console['error'](_0x1b736d(0xfa)),console[_0x1b736d(0x92)]('\x20\x20'+a30_0x2170a8[_0x1b736d(0x166)](_0x408c28+_0x1b736d(0x104))+a30_0x2170a8[_0x1b736d(0xc0)](_0x25d110)),console['error']('\x20\x20'+a30_0x2170a8['green']('+\x20'+_0xf1c4bd['length']+_0x1b736d(0x156))),console[_0x1b736d(0x92)]('\x20\x20'+a30_0x2170a8['yellow']('~\x20'+_0x33124b[_0x1b736d(0x130)]+'\x20changed\x20files')),console['error']('\x20\x20'+a30_0x2170a8[_0x1b736d(0xc0)]('=\x20'+_0x4a4292[_0x1b736d(0x130)]+_0x1b736d(0xae))),console[_0x1b736d(0x92)](_0x1b736d(0xbb)+a30_0x2170a8['cyan'](_0x4ba0e6)+'\x0a');if(_0x33124b[_0x1b736d(0x130)]>0x0)for(const _0x31af0a of _0x33124b){console[_0x1b736d(0x92)](_0x1b736d(0x7a)+_0x31af0a[_0x1b736d(0xf4)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x31af0a[_0x1b736d(0x18c)]),console[_0x1b736d(0x92)]('─'['repeat'](0x3c));}if(_0xf17abd['dryRun'])return console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0xc5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xf1c4bd[_0x1b736d(0x130)]===0x0&&_0x33124b[_0x1b736d(0x130)]===0x0)return console['error'](a30_0x2170a8[_0x1b736d(0x1a3)](_0x1b736d(0xe9))),saveSessionContext({'parent_segment':_0x58cb12},_0xf17abd[_0x1b736d(0xa0)]),console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0x1a3)](_0x1b736d(0x85)+a30_0x2170a8[_0x1b736d(0xc0)](_0x1b736d(0x12a))+'\x20=\x20'+a30_0x2170a8[_0x1b736d(0x166)](_0x58cb12))),0x0;if(!_0xf17abd['yes']&&(_0xf1c4bd[_0x1b736d(0x130)]>0x0||_0x33124b[_0x1b736d(0x130)]>0x0)){if(!isInteractive())return console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0x12f)](_0x1b736d(0x109)),_0x1b736d(0xcd)),console[_0x1b736d(0x92)](a30_0x2170a8['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5f0a06=await confirmKey('Write\x20'+(_0xf1c4bd[_0x1b736d(0x130)]+_0x33124b['length'])+_0x1b736d(0x99));if(!_0x5f0a06)return console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0xc5)]('Aborted.'),_0x1b736d(0xb4)),0x1;}!existsSync(_0x4ba0e6)&&mkdirSync(_0x4ba0e6,{'recursive':!![]});const _0x30e0c3=a30_0x39acee[_0x1b736d(0x101)](_0x4ba0e6,_0x1b736d(0x16d));writeFileSync(_0x30e0c3,createTdxConfigContent(_0x58cb12),'utf-8');for(const _0x73ac6b of _0x1bbadc){(_0x73ac6b[_0x1b736d(0x152)]||_0x73ac6b[_0x1b736d(0x146)])&&writeFileSync(_0x73ac6b[_0x1b736d(0x100)],_0x73ac6b[_0x1b736d(0x169)],_0x1b736d(0xa1));}return console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0x1a3)]('✔\x20Pulled\x20'+(_0xf1c4bd[_0x1b736d(0x130)]+_0x33124b[_0x1b736d(0x130)])+'\x20journey\x20files\x20to\x20'+_0x4ba0e6)),saveSessionContext({'parent_segment':_0x58cb12},_0xf17abd[_0x1b736d(0xa0)]),console['error'](a30_0x2170a8[_0x1b736d(0x1a3)](_0x1b736d(0x85)+a30_0x2170a8[_0x1b736d(0xc0)](_0x1b736d(0x12a))+_0x1b736d(0x188)+a30_0x2170a8['cyan'](_0x58cb12))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x9a);[a30_0x9050c5(0x16c)]=a30_0x9050c5(0xcc);async['execute'](_0x2379b0){const _0x36c191=a30_0x9050c5,{options:_0x2dcf1d,args:_0x4e130b,tdx:_0x44c538}=_0x2379b0,_0x29ba57=_0x4e130b[0x0];if(!requireNameOrPath(_0x29ba57))return 0x1;_0x2dcf1d[_0x36c191(0x175)]&&console[_0x36c191(0x92)](_0x36c191(0x173)+_0x29ba57);const {journeyId:_0x2eb6de}=await resolveJourneyIdFromInput(_0x29ba57,_0x2dcf1d,_0x44c538),_0x2b89ef=await withSpinner(_0x36c191(0xde),()=>_0x44c538[_0x36c191(0xc3)][_0x36c191(0xab)](_0x2eb6de),{'verbose':_0x2dcf1d[_0x36c191(0x175)]}),_0x51cbb0=_0x2b89ef[_0x36c191(0x14b)];return console[_0x36c191(0x172)](_0x36c191(0xe2)+_0x51cbb0[_0x36c191(0x80)]),console[_0x36c191(0x172)](_0x36c191(0x1a7)+_0x51cbb0[_0x36c191(0xbd)]),await handleSDKOutput(_0x51cbb0[_0x36c191(0xb1)],_0x2dcf1d),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x16a);['description']=a30_0x9050c5(0xda);async[a30_0x9050c5(0x1a1)](_0xc3032c){const _0x58e8d8=a30_0x9050c5,{options:_0x21f9fa,args:_0x5dbe83,tdx:_0x3c5940}=_0xc3032c,_0x3d2bf1=_0x5dbe83[0x0];if(!requireNameOrPath(_0x3d2bf1))return 0x1;_0x21f9fa[_0x58e8d8(0x175)]&&console['error'](_0x58e8d8(0x173)+_0x3d2bf1);const {journeyId:_0x54479a}=await resolveJourneyIdFromInput(_0x3d2bf1,_0x21f9fa,_0x3c5940),_0x1841ff=await withSpinner(_0x58e8d8(0xf5),()=>_0x3c5940['journey']['listActivationsFlat'](_0x54479a),{'verbose':_0x21f9fa[_0x58e8d8(0x175)]}),_0x396788=_0x1841ff[_0x58e8d8(0x14b)];return console[_0x58e8d8(0x92)](_0x58e8d8(0x170)+_0x396788[_0x58e8d8(0x130)]+'\x20activation'+(_0x396788['length']!==0x1?'s':'')),await handleSDKOutput(_0x396788,_0x21f9fa),0x0;}}export class JourneyPushCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x95);['description']=a30_0x9050c5(0x13b);[a30_0x9050c5(0x14f)]=new SegmentPushCommand();async['execute'](_0x4b3a28){const _0x3bf176=a30_0x9050c5,_0x31f8f7=_0x4b3a28[_0x3bf176(0xe1)][0x0];let _0x39c680;if(_0x31f8f7){const _0x222c9c=await resolveTarget({'arg':_0x31f8f7,'contextParent':_0x4b3a28[_0x3bf176(0xb7)]['parentSegment'],'cwd':process[_0x3bf176(0xdb)]()});isSuccessfulResolution(_0x222c9c)&&_0x222c9c['type']===_0x3bf176(0x15e)&&(_0x39c680=_0x222c9c[_0x3bf176(0x12e)]);}const _0x2a592f={..._0x4b3a28,'options':{..._0x4b3a28[_0x3bf176(0xb7)],'journeysOnly':!![],..._0x39c680&&{'singleFilePath':_0x39c680}}};return this['segmentPushCommand'][_0x3bf176(0x1a1)](_0x2a592f);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a30_0x9050c5(0x167);[a30_0x9050c5(0x16c)]=a30_0x9050c5(0xc6);async[a30_0x9050c5(0x1a1)](_0x54e190){const _0x34d227=a30_0x9050c5,{options:_0x1c2a8e,args:_0x2a9409,tdx:_0x4869be}=_0x54e190,_0x5bbcca=_0x2a9409[0x0];if(!requireNameOrPath(_0x5bbcca))return 0x1;if(_0x1c2a8e['verbose'])console['error'](_0x34d227(0x173)+_0x5bbcca);const {journeyId:_0x3f089a}=await resolveJourneyIdFromInput(_0x5bbcca,_0x1c2a8e,_0x4869be),_0x3864c7=await withSpinner(_0x34d227(0x171),()=>_0x4869be[_0x34d227(0xc3)]['listVersions'](_0x3f089a),{'verbose':_0x1c2a8e[_0x34d227(0x175)]}),{bundleName:_0x4fd1d3,versions:_0x5b1cc6,latestJourneyId:_0x34854c}=_0x3864c7[_0x34d227(0x14b)];console['error'](_0x4fd1d3+':\x20'+_0x5b1cc6[_0x34d227(0x130)]+_0x34d227(0xe4)+(_0x5b1cc6[_0x34d227(0x130)]!==0x1?'s':''));const _0x1ba438=_0x5b1cc6[_0x34d227(0x17a)](_0x54f90b=>({'version':_0x54f90b['versionNumber'],'journey_id':_0x54f90b[_0x34d227(0x8d)],'name':_0x54f90b[_0x34d227(0xd0)],'state':_0x54f90b[_0x34d227(0x7b)],'paused':_0x54f90b[_0x34d227(0x9f)],'latest':_0x54f90b['journeyId']===_0x34854c,'created_at':_0x54f90b[_0x34d227(0x129)]}));return await handleSDKOutput(_0x1ba438,_0x1c2a8e),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x15d);[a30_0x9050c5(0x16c)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a30_0x9050c5(0x1a1)](_0x1bc003){const _0x37343c=a30_0x9050c5,{options:_0x56bb23,args:_0x293543,tdx:_0x4c18b7}=_0x1bc003,_0x32a1dc=_0x293543[0x0];if(!requireNameOrPath(_0x32a1dc))return 0x1;if(_0x56bb23[_0x37343c(0x175)])console[_0x37343c(0x92)](_0x37343c(0x173)+_0x32a1dc);const {journeyId:_0x977cf4,journeyName:_0x28b172}=await resolveJourneyIdFromInput(_0x32a1dc,_0x56bb23,_0x4c18b7);if(!_0x56bb23[_0x37343c(0x125)]){const _0xf92afc=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x28b172+'\x22?');if(!_0xf92afc)return console['error'](_0x37343c(0x143)),0x0;}const _0x2d7843=await withSpinner('Creating\x20new\x20version...',()=>_0x4c18b7[_0x37343c(0xc3)][_0x37343c(0xd4)](_0x977cf4),{'verbose':_0x56bb23[_0x37343c(0x175)]}),_0x356a77=_0x2d7843['data'];return console[_0x37343c(0x92)](a30_0x2170a8[_0x37343c(0x1a3)]('\u2714')+_0x37343c(0x89)+_0x356a77[_0x37343c(0x1a6)][_0x37343c(0x114)]+_0x37343c(0x11f)+_0x356a77[_0x37343c(0x1a6)][_0x37343c(0xd0)]+'\x22'),console[_0x37343c(0x92)](_0x37343c(0x11a)+_0x356a77['id']),await handleSingleObjectOutput({'id':_0x356a77['id'],'name':_0x356a77[_0x37343c(0x1a6)][_0x37343c(0xd0)],'version':_0x356a77['attributes'][_0x37343c(0x114)],'state':_0x356a77[_0x37343c(0x1a6)][_0x37343c(0x7b)],'bundle_id':_0x356a77[_0x37343c(0x1a6)][_0x37343c(0x191)],'created_at':_0x356a77[_0x37343c(0x1a6)]['createdAt']},_0x56bb23),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x14a);[a30_0x9050c5(0x16c)]=a30_0x9050c5(0x127);async[a30_0x9050c5(0x1a1)](_0x266ede){const _0x2d9233=a30_0x9050c5,{options:_0x98531e,args:_0x191231,tdx:_0x23456b}=_0x266ede,_0x264382=_0x191231[0x0];if(!requireNameOrPath(_0x264382))return 0x1;const _0x4e59e3=_0x98531e['version'];if(!_0x4e59e3)return console[_0x2d9233(0x92)](_0x2d9233(0x15c)),console[_0x2d9233(0x92)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x397a13=parseInt(_0x4e59e3,0xa);if(isNaN(_0x397a13)||_0x397a13<0x1)return console[_0x2d9233(0x92)](_0x2d9233(0xd6)+_0x4e59e3),0x1;if(_0x98531e[_0x2d9233(0x175)])console[_0x2d9233(0x92)](_0x2d9233(0x173)+_0x264382+_0x2d9233(0xed)+_0x397a13);const {journeyId:_0x53b3e2,parentSegmentId:_0x1135e5}=await resolveJourneyIdFromInput(_0x264382,_0x98531e,_0x23456b),_0x4f3aab=await withSpinner(_0x2d9233(0x87),()=>_0x23456b['journey'][_0x2d9233(0xa2)](_0x53b3e2),{'verbose':_0x98531e[_0x2d9233(0x175)]}),{versions:_0x3d7499,latestJourneyId:_0x587b5f}=_0x4f3aab[_0x2d9233(0x14b)],_0x481a40=_0x3d7499[_0x2d9233(0x17b)](_0x5502e4=>_0x5502e4[_0x2d9233(0x114)]===_0x397a13);if(!_0x481a40){const _0x3f8b08=_0x3d7499[_0x2d9233(0x17a)](_0x125a6a=>'v'+_0x125a6a[_0x2d9233(0x114)])['join'](',\x20');return console[_0x2d9233(0x92)](_0x2d9233(0x189)+_0x397a13+_0x2d9233(0x148)+_0x3f8b08),0x1;}const _0x3fa432=await withSpinner(_0x2d9233(0x123)+_0x397a13+_0x2d9233(0x15a),()=>_0x23456b[_0x2d9233(0xc3)][_0x2d9233(0x93)](_0x481a40['journeyId']),{'verbose':_0x98531e[_0x2d9233(0x175)]}),_0x44ab46=_0x3fa432['data'],_0x151c37=getConsoleNextUrl(_0x98531e[_0x2d9233(0x110)],'/app/ps/'+_0x1135e5+'/e/'+_0x481a40[_0x2d9233(0x8d)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x44ab46['id'],'name':_0x44ab46['attributes'][_0x2d9233(0xd0)],'version':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x114)],'description':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x16c)],'state':_0x44ab46['attributes'][_0x2d9233(0x7b)],'paused':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x9f)],'reentry_mode':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x9e)],'stages':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0xec)]?.[_0x2d9233(0x130)]||0x0,..._0x44ab46['attributes'][_0x2d9233(0xb6)]&&{'goal':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0xb6)][_0x2d9233(0xd0)]},'latest':_0x481a40[_0x2d9233(0x8d)]===_0x587b5f,'created_at':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x129)],'updated_at':_0x44ab46['attributes'][_0x2d9233(0xc9)],'url':_0x151c37},_0x98531e),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x33fc87=a31_0x274c;(function(_0x4bad1f,_0x1622e1){const _0x95432a=a31_0x274c,_0x199017=_0x4bad1f();while(!![]){try{const _0x5197d2=parseInt(_0x95432a(0x174))/0x1*(parseInt(_0x95432a(0x176))/0x2)+-parseInt(_0x95432a(0x1a1))/0x3+parseInt(_0x95432a(0x17c))/0x4+parseInt(_0x95432a(0x192))/0x5*(parseInt(_0x95432a(0x195))/0x6)+parseInt(_0x95432a(0x171))/0x7*(-parseInt(_0x95432a(0x193))/0x8)+-parseInt(_0x95432a(0x18e))/0x9+parseInt(_0x95432a(0x1a2))/0xa;if(_0x5197d2===_0x1622e1)break;else _0x199017['push'](_0x199017['shift']());}catch(_0x5cb59b){_0x199017['push'](_0x199017['shift']());}}}(a31_0x1d4b,0x823ac));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a31_0x274c(_0x226e69,_0x4d0add){_0x226e69=_0x226e69-0x16e;const _0x1d4b4d=a31_0x1d4b();let _0x274cac=_0x1d4b4d[_0x226e69];return _0x274cac;}import a31_0x3fdb8b from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a31_0x1d4b(){const _0x38d3b1=['dim','skippedCount','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','red','hasErrors','file','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','parentSegment','targetDir','\x20segment\x20file(s)\x20skipped','cwd','errors','\x20error(s)','message','valid','4440222NOvlvb','helpText','\x20warning(s)\x20found','No\x20journey\x20YAML\x20files\x20found\x20in\x20','4630XjYvwW','16eOXXWD','Validation\x20failed:\x20','5688lyVnpO','validCount','\x20journey(s)\x20valid','.yaml','green','.yml','\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','warnings','yellow','\x20valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','relativePath','2580348tEYsfU','5187290ergnFV','endsWith','error','\x20journey(s)\x20with\x20errors,\x20','journey','Error:\x20Directory\x20not\x20found:\x20','1417381ybnhlj','verbose','warningCount','3vLMcAB','✔\x20All\x20','475834AvdKte','length','description','type','reason','log','726128ifPIFC','\x20(skipped:\x20'];a31_0x1d4b=function(){return _0x38d3b1;};return a31_0x1d4b();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a31_0x33fc87(0x180)]='journey:validate';[a31_0x33fc87(0x178)]='Validate\x20journey\x20YAML\x20files';async['execute'](_0x5cc216){const _0x49ce70=a31_0x33fc87,{options:_0x190ae0,args:_0x2a8df4}=_0x5cc216,_0x412aca=_0x190ae0,_0x93f9ad=await resolveTarget({'arg':_0x2a8df4[0x0],'contextParent':_0x190ae0[_0x49ce70(0x186)],'cwd':process[_0x49ce70(0x189)]()});if(!isSuccessfulResolution(_0x93f9ad))return _0x93f9ad['errorCode']==='no_parent'?(console['error'](a31_0x3fdb8b[_0x49ce70(0x19d)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x49ce70(0x1a4)](_0x49ce70(0x19b)),console[_0x49ce70(0x1a4)](_0x49ce70(0x181))):(console[_0x49ce70(0x1a4)](a31_0x3fdb8b[_0x49ce70(0x182)]('Error:\x20'+_0x93f9ad[_0x49ce70(0x18c)]+'\x0a')),_0x93f9ad[_0x49ce70(0x18f)]&&console[_0x49ce70(0x1a4)](a31_0x3fdb8b['cyan'](_0x93f9ad[_0x49ce70(0x18f)]))),0x1;const _0x22efc7=_0x93f9ad[_0x49ce70(0x187)],_0x149ef1=_0x93f9ad[_0x49ce70(0x179)]===_0x49ce70(0x184)?_0x93f9ad['filePath']:undefined;if(!_0x149ef1&&!existsSync(_0x22efc7))return console[_0x49ce70(0x1a4)](a31_0x3fdb8b[_0x49ce70(0x182)](_0x49ce70(0x170)+_0x22efc7+'\x0a')),0x1;let _0x19f114;if(_0x149ef1){if(!_0x149ef1[_0x49ce70(0x1a3)](_0x49ce70(0x19a))&&!_0x149ef1[_0x49ce70(0x1a3)](_0x49ce70(0x198)))return console['error'](a31_0x3fdb8b[_0x49ce70(0x182)](_0x49ce70(0x185)+_0x149ef1+'\x0a')),0x1;_0x19f114=[_0x149ef1];}else _0x19f114=findYamlFiles(_0x22efc7);if(_0x19f114[_0x49ce70(0x177)]===0x0)return console[_0x49ce70(0x1a4)](a31_0x3fdb8b[_0x49ce70(0x182)](_0x49ce70(0x19f)+_0x22efc7+'\x0a')),0x1;const _0x24d096=validateYamlFiles(_0x19f114,_0x22efc7,{'filterType':_0x49ce70(0x16f)}),_0x555df8=calculateSummary(_0x24d096),_0x41fa18=_0x24d096['filter'](isValidationResult);if(_0x41fa18[_0x49ce70(0x177)]===0x0)return console['error'](a31_0x3fdb8b['yellow'](_0x49ce70(0x191)+_0x22efc7+'\x0a')),_0x555df8[_0x49ce70(0x17f)]>0x0&&console[_0x49ce70(0x1a4)](a31_0x3fdb8b[_0x49ce70(0x17e)]('('+_0x555df8['skippedCount']+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x1de45a of _0x24d096){if(!isValidationResult(_0x1de45a)){_0x412aca[_0x49ce70(0x172)]&&console[_0x49ce70(0x17b)](a31_0x3fdb8b[_0x49ce70(0x17e)]('-\x20'+_0x1de45a[_0x49ce70(0x1a0)]+_0x49ce70(0x17d)+_0x1de45a[_0x49ce70(0x17a)]+')'));continue;}const {relativePath:_0x2f73ff,source:_0x970b3c,result:_0x1a20a3}=_0x1de45a;if(_0x1a20a3[_0x49ce70(0x18d)]&&_0x1a20a3[_0x49ce70(0x19c)]['length']===0x0)_0x412aca['verbose']&&console['log'](a31_0x3fdb8b[_0x49ce70(0x199)]('✔\x20'+_0x2f73ff));else _0x1a20a3[_0x49ce70(0x18d)]?(console[_0x49ce70(0x17b)](a31_0x3fdb8b[_0x49ce70(0x19d)]('⚠\x20'+_0x2f73ff+':\x20'+_0x1a20a3[_0x49ce70(0x19c)]['length']+'\x20warning(s)')),console[_0x49ce70(0x17b)](formatValidationResult(_0x1a20a3,_0x970b3c,_0x2f73ff))):(console[_0x49ce70(0x17b)](a31_0x3fdb8b[_0x49ce70(0x182)]('✖\x20'+_0x2f73ff+':\x20'+_0x1a20a3[_0x49ce70(0x18a)][_0x49ce70(0x177)]+_0x49ce70(0x18b))),console[_0x49ce70(0x17b)](formatValidationResult(_0x1a20a3,_0x970b3c,_0x2f73ff)));}return console[_0x49ce70(0x17b)](''),_0x555df8[_0x49ce70(0x183)]?(console['log'](a31_0x3fdb8b[_0x49ce70(0x182)](_0x49ce70(0x194)+_0x555df8['invalidCount']+_0x49ce70(0x16e)+_0x555df8[_0x49ce70(0x196)]+_0x49ce70(0x19e))),_0x555df8[_0x49ce70(0x173)]>0x0&&console[_0x49ce70(0x17b)](a31_0x3fdb8b[_0x49ce70(0x19d)](_0x555df8[_0x49ce70(0x173)]+_0x49ce70(0x190))),_0x555df8[_0x49ce70(0x17f)]>0x0&&console[_0x49ce70(0x17b)](a31_0x3fdb8b[_0x49ce70(0x17e)](_0x555df8['skippedCount']+_0x49ce70(0x188))),0x1):(console['log'](a31_0x3fdb8b[_0x49ce70(0x199)](_0x49ce70(0x175)+_0x555df8['validCount']+_0x49ce70(0x197))),_0x555df8['warningCount']>0x0&&console[_0x49ce70(0x17b)](a31_0x3fdb8b[_0x49ce70(0x19d)](_0x555df8['warningCount']+_0x49ce70(0x190))),_0x555df8['skippedCount']>0x0&&console[_0x49ce70(0x17b)](a31_0x3fdb8b[_0x49ce70(0x17e)](_0x555df8['skippedCount']+_0x49ce70(0x188))),0x0);}}
|