@treasuredata/tdx 2026.8.0 → 2026.8.2
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.d.ts +2 -0
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/types.d.ts +2 -0
- package/dist/sdk/cas/types.d.ts.map +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/cas.d.ts +4 -0
- package/dist/sdk/types/cas.d.ts.map +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_0x11bfea=a27_0x5142;(function(_0x34de71,_0x30d447){const _0x38933c=a27_0x5142,_0x1066e7=_0x34de71();while(!![]){try{const _0x42ea19=parseInt(_0x38933c(0x157))/0x1+parseInt(_0x38933c(0x154))/0x2+-parseInt(_0x38933c(0x159))/0x3*(-parseInt(_0x38933c(0x13e))/0x4)+-parseInt(_0x38933c(0x15e))/0x5+parseInt(_0x38933c(0x168))/0x6*(-parseInt(_0x38933c(0x16c))/0x7)+parseInt(_0x38933c(0x167))/0x8*(parseInt(_0x38933c(0x12f))/0x9)+-parseInt(_0x38933c(0x171))/0xa;if(_0x42ea19===_0x30d447)break;else _0x1066e7['push'](_0x1066e7['shift']());}catch(_0x4d8763){_0x1066e7['push'](_0x1066e7['shift']());}}}(a27_0x654b,0x60688));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a27_0x5142(_0x1636eb,_0x27de43){_0x1636eb=_0x1636eb-0x12c;const _0x654bbf=a27_0x654b();let _0x5142f9=_0x654bbf[_0x1636eb];return _0x5142f9;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a27_0x654b(){const _0x586fd4=['verbose','190558ifSegh','engage_workspace','5982rkxZlK','cwd','configDir','def','Pushing\x20templates...','3782720ulOtBz','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','updated','error','engage:template:push','action','yes','yellow','create','55480xEatRx','169980DnmIVE','filter','path','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','35oLzeYx','\x20templates\x20to\x20update:','description','\x20templates','\x0aPush\x20summary\x20for\x20workspace\x20\x27','5364150rCpeou','green','setPhase','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x20errors:','session','\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)','918SVLstN','-\x20no\x20changes\x20applied','Resolving\x20references...','errors','\x0aError:','Aborted.','resolve','message','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\x20\x20\x20\x20','relativePath','\x20templates?','Workspace\x20is\x20required.','Found\x20','templateId','440ydIgLJ','config','dirname','length','cyan','engage','red','workspace','\x20template\x20files','execute','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aValidation\x20errors\x20in\x20','\x20new\x20templates:','dim','✔\x20Updated\x20','data','site','created','name','\x27...','resolveWorkspaceId','\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','1424458HMjYnN','Push\x20'];a27_0x654b=function(){return _0x586fd4;};return a27_0x654b();}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a27_0x19d614 from'chalk';import a27_0x19a443 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';export class EngageTemplatePushCommand extends BaseCommand{[a27_0x11bfea(0x150)]=a27_0x11bfea(0x162);[a27_0x11bfea(0x16e)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a27_0x11bfea(0x147)](_0x4472ad){const _0x48d92c=a27_0x11bfea,{options:_0x267f3c,args:_0x1dd4c1,tdx:_0x1b16b7}=_0x4472ad,_0x5f7629=_0x267f3c,_0x58f6c0=_0x1dd4c1[0x0],_0x1dff19=_0x58f6c0?a27_0x19a443[_0x48d92c(0x135)](_0x58f6c0):undefined,_0x3c6e76=_0x1dff19?isYamlFile(_0x1dff19):![];let _0x24037a;if(_0x3c6e76&&_0x1dff19)_0x24037a=a27_0x19a443[_0x48d92c(0x140)](_0x1dff19);else _0x1dff19?_0x24037a=_0x1dff19:_0x24037a=process[_0x48d92c(0x15a)]();let _0x590a7c;const _0x9c59ed=tryFindTdxConfig(_0x24037a);_0x9c59ed?.[_0x48d92c(0x13f)][_0x48d92c(0x158)]&&(_0x590a7c=_0x9c59ed[_0x48d92c(0x13f)][_0x48d92c(0x158)],!_0x3c6e76&&(_0x24037a=_0x9c59ed[_0x48d92c(0x15b)]));_0x5f7629[_0x48d92c(0x145)]&&(_0x590a7c=_0x5f7629[_0x48d92c(0x145)]);if(!_0x590a7c){const _0x548025=loadSessionContext(_0x5f7629['session']);_0x548025?.[_0x48d92c(0x158)]&&(_0x590a7c=_0x548025[_0x48d92c(0x158)]);}if(!_0x590a7c)return console[_0x48d92c(0x161)](a27_0x19d614['yellow'](_0x48d92c(0x13b))),console['error']('\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[_0x48d92c(0x161)](_0x48d92c(0x12e)),console[_0x48d92c(0x161)](_0x48d92c(0x153)),console['error'](_0x48d92c(0x148)),0x1;let _0x3d90a6;_0x3c6e76&&_0x1dff19?_0x3d90a6=[parseTemplateFile(_0x1dff19,a27_0x19a443['dirname'](_0x1dff19))]:_0x3d90a6=discoverAndParseTemplateFiles(_0x24037a);if(_0x3d90a6[_0x48d92c(0x141)]===0x0)return console[_0x48d92c(0x161)](a27_0x19d614[_0x48d92c(0x165)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x24037a)),console['error'](a27_0x19d614['dim'](_0x48d92c(0x16b))),0x1;const _0x34e241=_0x3d90a6[_0x48d92c(0x141)]===0x1?'1\x20template\x20file:\x20'+_0x3d90a6[0x0]['def'][_0x48d92c(0x150)]:_0x3d90a6[_0x48d92c(0x141)]+_0x48d92c(0x146);console[_0x48d92c(0x161)](_0x48d92c(0x13c)+a27_0x19d614[_0x48d92c(0x142)](_0x34e241));let _0x5ac69b=![];for(const _0x240372 of _0x3d90a6){const _0x23d840=validateTemplateDef(_0x240372['def']);if(!_0x23d840['valid']){_0x5ac69b=!![],console['error'](a27_0x19d614[_0x48d92c(0x144)](_0x48d92c(0x149)+_0x240372[_0x48d92c(0x139)]+':'));for(const _0x489afe of _0x23d840[_0x48d92c(0x132)]){console[_0x48d92c(0x161)]('\x20\x20'+a27_0x19d614[_0x48d92c(0x144)]('✗')+'\x20'+_0x489afe[_0x48d92c(0x16a)]+':\x20'+_0x489afe[_0x48d92c(0x136)]);}}for(const _0x5e4fe8 of _0x23d840['warnings']){console[_0x48d92c(0x161)]('\x20\x20'+a27_0x19d614['yellow']('⚠')+'\x20'+_0x5e4fe8[_0x48d92c(0x16a)]+':\x20'+_0x5e4fe8[_0x48d92c(0x136)]);}}if(_0x5ac69b)return console[_0x48d92c(0x161)](a27_0x19d614['red'](_0x48d92c(0x174))),0x1;const _0x232f7e=await _0x1b16b7[_0x48d92c(0x143)][_0x48d92c(0x152)](_0x590a7c),_0x3517d0=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x590a7c+_0x48d92c(0x151),_0x226b0b=>preparePush({'engage':_0x1b16b7[_0x48d92c(0x143)]},_0x3d90a6,_0x232f7e,{'progress':{'update':_0x3afc4a=>_0x226b0b[_0x48d92c(0x173)](_0x3afc4a)}}),{'verbose':_0x5f7629['verbose']}),_0x2dde78=_0x3517d0[_0x48d92c(0x14d)];await withProgressSpinner(_0x48d92c(0x131),_0xda9bd6=>resolveAndBuildInputs({'engage':_0x1b16b7[_0x48d92c(0x143)]},_0x2dde78,_0x232f7e,{'progress':{'update':_0x49323a=>_0xda9bd6[_0x48d92c(0x173)](_0x49323a)}}),{'verbose':_0x5f7629[_0x48d92c(0x156)]});const _0x4da3cd=_0x2dde78[_0x48d92c(0x169)](_0x2518c2=>_0x2518c2['action']===_0x48d92c(0x166)),_0x452485=_0x2dde78[_0x48d92c(0x169)](_0x1cb791=>_0x1cb791[_0x48d92c(0x163)]==='update');console['error'](_0x48d92c(0x170)+_0x590a7c+'\x27:');if(_0x4da3cd[_0x48d92c(0x141)]>0x0){console[_0x48d92c(0x161)]('\x20\x20'+a27_0x19d614[_0x48d92c(0x172)]('+\x20'+_0x4da3cd[_0x48d92c(0x141)]+_0x48d92c(0x14a)));for(const _0x2ec3d9 of _0x4da3cd){console['error'](_0x48d92c(0x138)+a27_0x19d614[_0x48d92c(0x172)]('+')+'\x20'+_0x2ec3d9[_0x48d92c(0x15c)][_0x48d92c(0x150)]);}}if(_0x452485[_0x48d92c(0x141)]>0x0){console[_0x48d92c(0x161)]('\x20\x20'+a27_0x19d614[_0x48d92c(0x165)]('~\x20'+_0x452485[_0x48d92c(0x141)]+_0x48d92c(0x16d)));for(const _0x5afbc7 of _0x452485){console[_0x48d92c(0x161)](_0x48d92c(0x138)+a27_0x19d614[_0x48d92c(0x165)]('~')+'\x20'+_0x5afbc7[_0x48d92c(0x15c)][_0x48d92c(0x150)]);}}if(_0x4da3cd[_0x48d92c(0x141)]===0x0&&_0x452485[_0x48d92c(0x141)]===0x0)return console[_0x48d92c(0x161)](a27_0x19d614[_0x48d92c(0x172)]('\u2714\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x5f7629['dryRun'])return console[_0x48d92c(0x161)](a27_0x19d614['yellow'](_0x48d92c(0x137))),0x0;if(!_0x5f7629[_0x48d92c(0x164)]){if(!isInteractive())return console[_0x48d92c(0x161)](a27_0x19d614[_0x48d92c(0x144)](_0x48d92c(0x133)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a27_0x19d614[_0x48d92c(0x14b)](_0x48d92c(0x15f))),0x1;const _0x56c352=await confirmKey(_0x48d92c(0x155)+(_0x4da3cd[_0x48d92c(0x141)]+_0x452485[_0x48d92c(0x141)])+_0x48d92c(0x13a));if(!_0x56c352)return console[_0x48d92c(0x161)](a27_0x19d614[_0x48d92c(0x165)](_0x48d92c(0x134)),_0x48d92c(0x130)),0x1;}const _0x43698e=await withProgressSpinner(_0x48d92c(0x15d),_0x2709bd=>executePush({'engage':_0x1b16b7[_0x48d92c(0x143)]},_0x2dde78,{'progress':{'update':_0x2c9335=>_0x2709bd[_0x48d92c(0x173)](_0x2c9335)}}),{'verbose':_0x5f7629[_0x48d92c(0x156)]}),_0xc04764=_0x43698e['data'];for(const _0x53d283 of _0xc04764['results']){if(_0x53d283[_0x48d92c(0x13d)]&&(_0x53d283[_0x48d92c(0x163)]===_0x48d92c(0x14f)||_0x53d283[_0x48d92c(0x163)]===_0x48d92c(0x160))){const _0x21d475=getTemplateUrl(_0x5f7629[_0x48d92c(0x14e)],_0x232f7e,_0x53d283[_0x48d92c(0x13d)]),_0x3a1c10=_0x53d283['action']===_0x48d92c(0x14f)?'+':'~',_0x34d646=_0x53d283[_0x48d92c(0x163)]===_0x48d92c(0x14f)?a27_0x19d614['green'](_0x3a1c10):a27_0x19d614['yellow'](_0x3a1c10);console[_0x48d92c(0x161)]('\x20\x20'+_0x34d646+'\x20'+hyperlink(_0x53d283['name'],_0x21d475)+'\x20'+a27_0x19d614[_0x48d92c(0x14b)](_0x21d475));}}_0xc04764[_0x48d92c(0x14f)]>0x0&&console[_0x48d92c(0x161)](a27_0x19d614[_0x48d92c(0x172)]('✔\x20Created\x20'+_0xc04764[_0x48d92c(0x14f)]+_0x48d92c(0x16f)));_0xc04764['updated']>0x0&&console[_0x48d92c(0x161)](a27_0x19d614[_0x48d92c(0x172)](_0x48d92c(0x14c)+_0xc04764['updated']+_0x48d92c(0x16f)));if(_0xc04764[_0x48d92c(0x132)]['length']>0x0){console[_0x48d92c(0x161)](a27_0x19d614[_0x48d92c(0x144)]('✘\x20'+_0xc04764[_0x48d92c(0x132)][_0x48d92c(0x141)]+_0x48d92c(0x12c)));for(const _0x4e8d4d of _0xc04764[_0x48d92c(0x132)]){console[_0x48d92c(0x161)]('\x20\x20'+a27_0x19d614[_0x48d92c(0x144)](_0x4e8d4d[_0x48d92c(0x150)])+':\x20'+_0x4e8d4d[_0x48d92c(0x161)]);}}return saveSessionContext({'engage_workspace':_0x590a7c},_0x5f7629[_0x48d92c(0x12d)]),_0xc04764['errors'][_0x48d92c(0x141)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x29f1b1=a28_0xafb0;function a28_0x1fac(){const _0x12c377=['293160SVUrVu','resolve','errors','valid','\x20valid','\x20non-template\x20file(s)\x20skipped','\x20template(s)\x20valid','verbose','dim','description','\x20warning(s)','error','length','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','execute','576223WRWshL','\x20warning(s)\x20found','relativePath','engage:template:validate','✔\x20All\x20','6634054IcPHia','cwd','\x20(skipped:\x20','warningCount','3631896HbThFh','log','skippedCount','warnings','endsWith','invalidCount','reason','red','.yml','template','3976431bTtTSi','\x20error(s)','Error:\x20Directory\x20not\x20found:\x20','yellow','green','\x20non-template\x20file(s)\x20skipped)','6221610RPaSVk','8CnsGjY','validCount','Validation\x20failed:\x20','1149214AgQNtV','4cuMMKe','dirname','filter'];a28_0x1fac=function(){return _0x12c377;};return a28_0x1fac();}(function(_0x53bb6b,_0x6d49c5){const _0x291520=a28_0xafb0,_0x22429f=_0x53bb6b();while(!![]){try{const _0x545c5f=parseInt(_0x291520(0x106))/0x1+-parseInt(_0x291520(0xf3))/0x2+parseInt(_0x291520(0xe9))/0x3*(parseInt(_0x291520(0xf4))/0x4)+-parseInt(_0x291520(0xf7))/0x5+-parseInt(_0x291520(0x10f))/0x6+parseInt(_0x291520(0x10b))/0x7+-parseInt(_0x291520(0xf0))/0x8*(parseInt(_0x291520(0xef))/0x9);if(_0x545c5f===_0x6d49c5)break;else _0x22429f['push'](_0x22429f['shift']());}catch(_0xb2d93c){_0x22429f['push'](_0x22429f['shift']());}}}(a28_0x1fac,0xe0819));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x18b536 from'chalk';import a28_0x335252 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0xafb0(_0x23c60d,_0x5768dd){_0x23c60d=_0x23c60d-0xe2;const _0x1fac3b=a28_0x1fac();let _0xafb00f=_0x1fac3b[_0x23c60d];return _0xafb00f;}export class EngageTemplateValidateCommand extends BaseCommand{['name']=a28_0x29f1b1(0x109);[a28_0x29f1b1(0x100)]='Validate\x20template\x20YAML\x20files';async[a28_0x29f1b1(0x105)](_0x5df2e6){const _0x5def89=a28_0x29f1b1,{options:_0x3a81a3,args:_0x564310}=_0x5df2e6,_0x2ea9e3=_0x3a81a3,_0x5a67fb=_0x564310[0x0],_0x4d6733=_0x5a67fb?a28_0x335252[_0x5def89(0xf8)](_0x5a67fb):undefined,_0x425b02=_0x4d6733?isYamlFile(_0x4d6733):![];let _0x113a56,_0x89021d;if(_0x425b02&&_0x4d6733)_0x113a56=a28_0x335252[_0x5def89(0xf5)](_0x4d6733),_0x89021d=_0x4d6733;else _0x4d6733?_0x113a56=_0x4d6733:_0x113a56=process[_0x5def89(0x10c)]();if(!_0x89021d&&!existsSync(_0x113a56))return console[_0x5def89(0x102)](a28_0x18b536[_0x5def89(0xe6)](_0x5def89(0xeb)+_0x113a56+'\x0a')),0x1;let _0xf52641;if(_0x89021d){if(!_0x89021d['endsWith'](_0x5def89(0xe7))&&!_0x89021d[_0x5def89(0xe3)]('.yaml'))return console[_0x5def89(0x102)](a28_0x18b536[_0x5def89(0xe6)](_0x5def89(0x104)+_0x89021d+'\x0a')),0x1;_0xf52641=[_0x89021d];}else _0xf52641=findYamlFiles(_0x113a56);if(_0xf52641['length']===0x0)return console[_0x5def89(0x102)](a28_0x18b536[_0x5def89(0xe6)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x113a56+'\x0a')),0x1;const _0x17236e=validateYamlFiles(_0xf52641,_0x113a56,{'filterType':_0x5def89(0xe8)}),_0x49c106=calculateSummary(_0x17236e),_0x3f289c=_0x17236e[_0x5def89(0xf6)](isValidationResult);if(_0x3f289c[_0x5def89(0x103)]===0x0)return console[_0x5def89(0x102)](a28_0x18b536[_0x5def89(0xec)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x113a56+'\x0a')),_0x49c106[_0x5def89(0x111)]>0x0&&console[_0x5def89(0x102)](a28_0x18b536[_0x5def89(0xff)]('('+_0x49c106['skippedCount']+_0x5def89(0xee))),0x0;for(const _0x6a4f7f of _0x17236e){if(!isValidationResult(_0x6a4f7f)){_0x2ea9e3['verbose']&&console[_0x5def89(0x110)](a28_0x18b536[_0x5def89(0xff)]('-\x20'+_0x6a4f7f[_0x5def89(0x108)]+_0x5def89(0x10d)+_0x6a4f7f[_0x5def89(0xe5)]+')'));continue;}const {relativePath:_0x254964,source:_0xacea47,result:_0x5a52d0}=_0x6a4f7f;if(_0x5a52d0[_0x5def89(0xfa)]&&_0x5a52d0[_0x5def89(0xe2)]['length']===0x0)_0x2ea9e3[_0x5def89(0xfe)]&&console[_0x5def89(0x110)](a28_0x18b536[_0x5def89(0xed)]('✔\x20'+_0x254964));else _0x5a52d0[_0x5def89(0xfa)]?(console[_0x5def89(0x110)](a28_0x18b536[_0x5def89(0xec)]('⚠\x20'+_0x254964+':\x20'+_0x5a52d0['warnings'][_0x5def89(0x103)]+_0x5def89(0x101))),console[_0x5def89(0x110)](formatValidationResult(_0x5a52d0,_0xacea47,_0x254964))):(console[_0x5def89(0x110)](a28_0x18b536['red']('✖\x20'+_0x254964+':\x20'+_0x5a52d0[_0x5def89(0xf9)][_0x5def89(0x103)]+_0x5def89(0xea))),console['log'](formatValidationResult(_0x5a52d0,_0xacea47,_0x254964)));}return console[_0x5def89(0x110)](''),_0x49c106['hasErrors']?(console[_0x5def89(0x110)](a28_0x18b536[_0x5def89(0xe6)](_0x5def89(0xf2)+_0x49c106[_0x5def89(0xe4)]+'\x20template(s)\x20with\x20errors,\x20'+_0x49c106[_0x5def89(0xf1)]+_0x5def89(0xfb))),_0x49c106[_0x5def89(0x10e)]>0x0&&console['log'](a28_0x18b536['yellow'](_0x49c106[_0x5def89(0x10e)]+'\x20warning(s)\x20found')),_0x49c106[_0x5def89(0x111)]>0x0&&console['log'](a28_0x18b536[_0x5def89(0xff)](_0x49c106['skippedCount']+_0x5def89(0xfc))),0x1):(console[_0x5def89(0x110)](a28_0x18b536[_0x5def89(0xed)](_0x5def89(0x10a)+_0x49c106[_0x5def89(0xf1)]+_0x5def89(0xfd))),_0x49c106[_0x5def89(0x10e)]>0x0&&console['log'](a28_0x18b536[_0x5def89(0xec)](_0x49c106[_0x5def89(0x10e)]+_0x5def89(0x107))),_0x49c106['skippedCount']>0x0&&console[_0x5def89(0x110)](a28_0x18b536['dim'](_0x49c106[_0x5def89(0x111)]+_0x5def89(0xfc))),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
|
+
const a29_0x27adf6=a29_0xec60;(function(_0x10454a,_0x1d5a49){const _0x585ba4=a29_0xec60,_0x201e4c=_0x10454a();while(!![]){try{const _0x370cb2=parseInt(_0x585ba4(0x134))/0x1*(parseInt(_0x585ba4(0x122))/0x2)+parseInt(_0x585ba4(0x111))/0x3*(-parseInt(_0x585ba4(0x13a))/0x4)+parseInt(_0x585ba4(0x15c))/0x5+parseInt(_0x585ba4(0x130))/0x6*(-parseInt(_0x585ba4(0x109))/0x7)+parseInt(_0x585ba4(0x11c))/0x8*(-parseInt(_0x585ba4(0x141))/0x9)+-parseInt(_0x585ba4(0x14e))/0xa+parseInt(_0x585ba4(0x10a))/0xb*(parseInt(_0x585ba4(0x10c))/0xc);if(_0x370cb2===_0x1d5a49)break;else _0x201e4c['push'](_0x201e4c['shift']());}catch(_0x4ca438){_0x201e4c['push'](_0x201e4c['shift']());}}}(a29_0x3dbd,0x2e21e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a29_0x3dbd(){const _0x393514=['6718vbydDD','description','type','yes','\x20job','file','map','job:result','start_at','floor','presto','validate','Limit:\x20','dim','6cSrNVe','status','substring','mo\x20ago','43lebDqD','Listing\x20jobs...','Submitting\x20job...','result','m\x20ago','Show\x20job\x20details','24qRpafF','Status\x20filter:\x20','Kill\x20a\x20job','length','jobs','execute','just\x20now','10305OavfjJ','url','List\x20jobs','✔\x20Retrieved\x20','\x20\x20Job\x20ID:\x20','abs','trino','site','list','✔\x20Found\x20','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','job:show','Cancelled','1412300vUfpLV','job_id','name','now','Query:\x20','Submit\x20a\x20job','Submitting\x20kill\x20request...','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','error','round','data','query','end_at','530605fMvGvt','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','jobType','debug','show','d\x20ago','INVALID_ARGUMENT','submit','898373WTzzmM','203038mCHofH','args','384SlyYOm','verbose','database','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','kill','157566UalUwM','priority','Database:\x20','push','getTime','hive','Getting\x20job\x20results...','information_schema','Getting\x20job\x20details...','\x20jobs','user_name','472wHIwiF','\x20row','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','limit','created_at','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'];a29_0x3dbd=function(){return _0x393514;};return a29_0x3dbd();}import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';function a29_0xec60(_0xd33768,_0x2e5a89){_0xd33768=_0xd33768-0x107;const _0x3dbd4=a29_0x3dbd();let _0xec6029=_0x3dbd4[_0xd33768];return _0xec6029;}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_0x9b1426 from'chalk';function formatDuration(_0x402958){const _0xbed49e=a29_0xec60;if(_0x402958<0x3c)return _0x402958+'s';if(_0x402958<0xe10)return Math[_0xbed49e(0x12b)](_0x402958/0x3c)+'m\x20'+_0x402958%0x3c+'s';const _0x239707=Math['floor'](_0x402958/0xe10),_0x37cc7a=Math[_0xbed49e(0x12b)](_0x402958%0xe10/0x3c);return _0x37cc7a>0x0?_0x239707+'h\x20'+_0x37cc7a+'m':_0x239707+'h';}function formatRelativeTime(_0x3a56a2){const _0x37ba3a=a29_0xec60,_0x40a958=Date[_0x37ba3a(0x151)]()-_0x3a56a2[_0x37ba3a(0x115)](),_0x5222e9=Math[_0x37ba3a(0x12b)](Math[_0x37ba3a(0x146)](_0x40a958)/0x3e8);if(_0x5222e9<0x3c)return _0x37ba3a(0x140);const _0xd29270=Math[_0x37ba3a(0x12b)](_0x5222e9/0x3c);if(_0xd29270<0x3c)return _0xd29270+_0x37ba3a(0x138);const _0x1faa12=Math[_0x37ba3a(0x12b)](_0xd29270/0x3c);if(_0x1faa12<0x18)return _0x1faa12+'h\x20ago';const _0x77f084=Math[_0x37ba3a(0x12b)](_0x1faa12/0x18);if(_0x77f084<0x1e)return _0x77f084+_0x37ba3a(0x161);return Math['floor'](_0x77f084/0x1e)+_0x37ba3a(0x133);}export class JobListCommand extends BaseCommand{[a29_0x27adf6(0x150)]=a29_0x27adf6(0x13e);[a29_0x27adf6(0x123)]=a29_0x27adf6(0x143);async[a29_0x27adf6(0x13f)](_0x36bfd1){const _0x2c9b9a=a29_0x27adf6,{options:_0x296e23,tdx:_0x3d4053}=_0x36bfd1,_0x12519c=resolveLimit(_0x296e23[_0x2c9b9a(0x11f)],DEFAULT_DISPLAY_LIMIT),_0x177ae5=_0x296e23[_0x2c9b9a(0x131)];_0x296e23[_0x2c9b9a(0x10d)]&&(console[_0x2c9b9a(0x157)](_0x2c9b9a(0x12e)+_0x12519c+_0x2c9b9a(0x11a)),_0x177ae5&&console[_0x2c9b9a(0x157)](_0x2c9b9a(0x13b)+_0x177ae5));const _0x379a67=await withSpinner(_0x2c9b9a(0x135),()=>_0x3d4053[_0x2c9b9a(0x13e)][_0x2c9b9a(0x149)]({'from':0x0,'to':_0x12519c-0x1,'status':_0x177ae5}),{'verbose':_0x296e23['verbose']}),_0x34aa21=_0x379a67[_0x2c9b9a(0x159)];console[_0x2c9b9a(0x157)](_0x2c9b9a(0x14a)+_0x34aa21[_0x2c9b9a(0x13d)]+_0x2c9b9a(0x126)+(_0x34aa21[_0x2c9b9a(0x13d)]!==0x1?'s':''));const _0x59dc24=_0x296e23[_0x2c9b9a(0x148)];if(isStructuredFormat(_0x296e23)){const _0x2277af=_0x34aa21[_0x2c9b9a(0x128)](_0x35d46d=>{const _0x3d6c1f=_0x2c9b9a;let _0x5baab1;if(_0x35d46d['start_at']&&_0x35d46d[_0x3d6c1f(0x15b)]){const _0x448afb=new Date(_0x35d46d[_0x3d6c1f(0x12a)])[_0x3d6c1f(0x115)](),_0x76186d=new Date(_0x35d46d[_0x3d6c1f(0x15b)])[_0x3d6c1f(0x115)]();_0x5baab1=Math[_0x3d6c1f(0x158)]((_0x76186d-_0x448afb)/0x3e8);}return{'job_id':_0x35d46d[_0x3d6c1f(0x14f)],'type':_0x35d46d['type']===_0x3d6c1f(0x12c)?_0x3d6c1f(0x147):_0x35d46d[_0x3d6c1f(0x124)],'status':_0x35d46d[_0x3d6c1f(0x131)],'user_name':_0x35d46d[_0x3d6c1f(0x11b)],'duration_sec':_0x5baab1,'created_at':_0x35d46d[_0x3d6c1f(0x120)],'started_at':_0x35d46d[_0x3d6c1f(0x12a)],'end_at':_0x35d46d[_0x3d6c1f(0x15b)]};});await handleSDKOutput(_0x2277af,_0x296e23);}else for(const _0x483b71 of _0x34aa21){const _0x3250ec=_0x483b71[_0x2c9b9a(0x131)]==='success'?a29_0x9b1426['green']:_0x483b71[_0x2c9b9a(0x131)]===_0x2c9b9a(0x157)?a29_0x9b1426['red']:a29_0x9b1426['dim'],_0x2ba18e=_0x3250ec(_0x483b71[_0x2c9b9a(0x131)]),_0x1c3f88=getJobUrl(_0x59dc24,_0x483b71[_0x2c9b9a(0x14f)]),_0x43995f=hyperlink(_0x483b71[_0x2c9b9a(0x14f)],_0x1c3f88),_0x3fc9c5=a29_0x9b1426[_0x2c9b9a(0x12f)](_0x483b71[_0x2c9b9a(0x124)]===_0x2c9b9a(0x12c)?_0x2c9b9a(0x147):_0x483b71[_0x2c9b9a(0x124)]),_0x25613b=[];if(_0x483b71[_0x2c9b9a(0x12a)]&&_0x483b71[_0x2c9b9a(0x15b)]){const _0x580f40=Math['round']((new Date(_0x483b71['end_at'])['getTime']()-new Date(_0x483b71[_0x2c9b9a(0x12a)])[_0x2c9b9a(0x115)]())/0x3e8);_0x25613b[_0x2c9b9a(0x114)](formatDuration(_0x580f40));}if(_0x483b71[_0x2c9b9a(0x15b)])_0x25613b['push'](formatRelativeTime(new Date(_0x483b71['end_at'])));else _0x483b71['start_at']&&_0x25613b[_0x2c9b9a(0x114)](formatRelativeTime(new Date(_0x483b71[_0x2c9b9a(0x12a)])));const _0xe98296=_0x25613b[_0x2c9b9a(0x13d)]>0x0?a29_0x9b1426[_0x2c9b9a(0x12f)]('\x20'+_0x25613b['join'](',\x20')):'';console['log']('⚡\x20'+_0x43995f+'\x20'+_0x3fc9c5+'\x20'+_0x2ba18e+_0xe98296);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a29_0x27adf6(0x150)]=a29_0x27adf6(0x14c);[a29_0x27adf6(0x123)]=a29_0x27adf6(0x139);[a29_0x27adf6(0x12d)](_0x5c093e){const _0x5af156=a29_0x27adf6,_0x435261=_0x5c093e[_0x5af156(0x10b)][0x0];if(!_0x435261)return _0x5af156(0x156);return undefined;}async[a29_0x27adf6(0x13f)](_0x4c2794){const _0x1dbc5e=a29_0x27adf6,{options:_0xd73d91,args:_0x2ba252,tdx:_0x5460c6}=_0x4c2794,_0x3443ad=_0x2ba252[0x0],_0x4aa765=await withSpinner(_0x1dbc5e(0x119),()=>_0x5460c6['jobs'][_0x1dbc5e(0x160)](_0x3443ad),{'verbose':_0xd73d91['verbose']}),_0x207969=_0x4aa765['data'];let _0x57214c;if(_0x207969[_0x1dbc5e(0x12a)]&&_0x207969[_0x1dbc5e(0x15b)]){const _0x3703e7=new Date(_0x207969['start_at'])[_0x1dbc5e(0x115)](),_0x5f4e9d=new Date(_0x207969[_0x1dbc5e(0x15b)])[_0x1dbc5e(0x115)]();_0x57214c=Math[_0x1dbc5e(0x158)]((_0x5f4e9d-_0x3703e7)/0x3e8);}const _0x1668e8={'job_id':_0x207969[_0x1dbc5e(0x14f)],'type':_0x207969[_0x1dbc5e(0x124)],'status':_0x207969[_0x1dbc5e(0x131)],..._0x207969['user_name']&&{'user_name':_0x207969[_0x1dbc5e(0x11b)]},..._0x57214c!==undefined&&{'duration_sec':_0x57214c},..._0x207969[_0x1dbc5e(0x120)]&&{'created_at':_0x207969['created_at']},..._0x207969[_0x1dbc5e(0x12a)]&&{'started_at':_0x207969[_0x1dbc5e(0x12a)]},..._0x207969[_0x1dbc5e(0x15b)]&&{'end_at':_0x207969[_0x1dbc5e(0x15b)]},..._0x207969['database']&&{'database':_0x207969[_0x1dbc5e(0x10e)]},..._0x207969['priority']!==undefined&&{'priority':_0x207969[_0x1dbc5e(0x112)]},..._0x207969[_0x1dbc5e(0x142)]&&{'url':_0x207969[_0x1dbc5e(0x142)]},..._0x207969[_0x1dbc5e(0x15a)]&&{'query':_0x207969[_0x1dbc5e(0x15a)]},..._0x207969['debug']&&{'debug':_0x207969[_0x1dbc5e(0x15f)]}};return await handleSingleObjectOutput(_0x1668e8,_0xd73d91),0x0;}}export class JobKillCommand extends BaseCommand{[a29_0x27adf6(0x150)]='job:kill';[a29_0x27adf6(0x123)]=a29_0x27adf6(0x13c);['validate'](_0x5554c9){const _0x589310=a29_0x27adf6,_0x123a8d=_0x5554c9[_0x589310(0x10b)][0x0];if(!_0x123a8d)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a29_0x27adf6(0x13f)](_0x1f409e){const _0x3d497c=a29_0x27adf6,{options:_0x2782f3,args:_0x468f8f,tdx:_0x477b58}=_0x1f409e,_0x4a2c95=_0x468f8f[0x0];if(!_0x2782f3[_0x3d497c(0x125)]){const _0xbc61fe=await confirm(_0x3d497c(0x10f)+_0x4a2c95+'?');if(!_0xbc61fe)return console[_0x3d497c(0x157)](_0x3d497c(0x14d)),0x0;}return await withSpinner(_0x3d497c(0x154),()=>_0x477b58[_0x3d497c(0x13e)][_0x3d497c(0x110)](_0x4a2c95),{'verbose':_0x2782f3[_0x3d497c(0x10d)]}),console['error'](_0x3d497c(0x11e)+_0x4a2c95),console['error'](_0x3d497c(0x155)+_0x4a2c95+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a29_0x27adf6(0x150)]='job:submit';['description']=a29_0x27adf6(0x153);async['execute'](_0x3dc647){const _0xff86d0=a29_0x27adf6,{options:_0x4483b7,args:_0x531633,tdx:_0x19414f}=_0x3dc647,_0xf7519c=_0x4483b7[_0xff86d0(0x15e)]||_0xff86d0(0x147),_0x3bb57e=_0x4483b7[_0xff86d0(0x127)],_0x477755=_0x4483b7['database']||_0xff86d0(0x118),_0x2db070=_0x4483b7[_0xff86d0(0x137)];if(_0xf7519c!==_0xff86d0(0x147)&&_0xf7519c!==_0xff86d0(0x116))throw new SDKError(ErrorCode[_0xff86d0(0x107)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0xb16e9;if(_0x3bb57e){if(_0x531633[0x0])throw new SDKError(ErrorCode[_0xff86d0(0x107)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x113089=readSqlStatementsFromFile(_0x3bb57e);if(_0x113089[_0xff86d0(0x13d)]===0x0)throw new SDKError(ErrorCode[_0xff86d0(0x107)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x113089[_0xff86d0(0x13d)]>0x1)throw new SDKError(ErrorCode[_0xff86d0(0x107)],_0xff86d0(0x14b));_0xb16e9=_0x113089[0x0];}else{if(!_0x531633[0x0])throw new SDKError(ErrorCode[_0xff86d0(0x107)],_0xff86d0(0x121));_0xb16e9=_0x531633[0x0];}_0x4483b7[_0xff86d0(0x10d)]&&(console[_0xff86d0(0x157)]('Job\x20type:\x20'+_0xf7519c),console['error'](_0xff86d0(0x113)+_0x477755),console[_0xff86d0(0x157)](_0xff86d0(0x152)+_0xb16e9[_0xff86d0(0x132)](0x0,0x64)+(_0xb16e9[_0xff86d0(0x13d)]>0x64?'...':'')));const _0x3adc3b=await withSpinner(_0xff86d0(0x136),()=>_0x19414f[_0xff86d0(0x13e)][_0xff86d0(0x108)](_0x477755,_0xb16e9,_0xf7519c,_0x2db070),{'verbose':_0x4483b7['verbose']}),_0x498c15=_0x3adc3b['data'];return console[_0xff86d0(0x157)]('✔\x20Job\x20submitted'),console[_0xff86d0(0x157)](_0xff86d0(0x145)+_0x498c15['job_id']),await handleSDKOutput([_0x498c15],_0x4483b7),0x0;}}export class JobResultCommand extends BaseCommand{[a29_0x27adf6(0x150)]=a29_0x27adf6(0x129);[a29_0x27adf6(0x123)]='Get\x20job\x20results';[a29_0x27adf6(0x12d)](_0x301e4e){const _0x1c2365=a29_0x27adf6,_0x3d2480=_0x301e4e[_0x1c2365(0x10b)][0x0];if(!_0x3d2480)return _0x1c2365(0x15d);return undefined;}async[a29_0x27adf6(0x13f)](_0x827de2){const _0x350860=a29_0x27adf6,{options:_0x1c1fee,args:_0x4c7e9a,tdx:_0x1f8fd7}=_0x827de2,_0x1a2fc8=_0x4c7e9a[0x0],_0x5ce826=await withSpinner(_0x350860(0x117),()=>_0x1f8fd7[_0x350860(0x13e)]['result'](_0x1a2fc8),{'verbose':_0x1c1fee[_0x350860(0x10d)]}),_0x35d354=_0x5ce826['data'];return console[_0x350860(0x157)](_0x350860(0x144)+_0x35d354[_0x350860(0x13d)]+_0x350860(0x11d)+(_0x35d354[_0x350860(0x13d)]!==0x1?'s':'')),await handleSDKOutput(_0x35d354,_0x1c1fee),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_0x4f6ce0=a30_0x3dc0;(function(_0x3eb309,_0x473f3f){const _0x2bd308=a30_0x3dc0,_0x400d36=_0x3eb309();while(!![]){try{const _0x5be766=-parseInt(_0x2bd308(0x1ac))/0x1*(-parseInt(_0x2bd308(0x1c9))/0x2)+-parseInt(_0x2bd308(0x1b7))/0x3+parseInt(_0x2bd308(0x168))/0x4+-parseInt(_0x2bd308(0x1d5))/0x5+-parseInt(_0x2bd308(0x238))/0x6+parseInt(_0x2bd308(0x126))/0x7+parseInt(_0x2bd308(0x11c))/0x8;if(_0x5be766===_0x473f3f)break;else _0x400d36['push'](_0x400d36['shift']());}catch(_0x3d522a){_0x400d36['push'](_0x400d36['shift']());}}}(a30_0x3b24,0x61198));import a30_0x1af5e5 from'chalk';import a30_0x73190 from'path';function a30_0x3dc0(_0x315b2a,_0x4795d1){_0x315b2a=_0x315b2a-0x109;const _0x3b24e7=a30_0x3b24();let _0x3dc0fe=_0x3b24e7[_0x315b2a];return _0x3dc0fe;}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';function a30_0x3b24(){const _0x77c3e4=['Parent\x20segment\x20ID:','goal','resourceName','✔\x20All\x20files\x20are\x20up\x20to\x20date','journey:run','Error:\x20Journey\x20\x27','\x20files?','renderStats','listJourneysFromParentSegment','No\x20journeys\x20found','Journey:','green','size','error','reentryMode','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','get','attributes','📁\x20','journey:traffic','folderPath','dryRun','yes','journeyStages','activation_','Status:','setPhase','Listing\x20journey\x20activations...','then','✔\x20Found\x20','Trigger\x20on-demand\x20journey\x20workflow\x20execution','conversion','Listing\x20journeys...','(none)','Aborted.','journey:version:view','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','10AYKaYe','bold','Listing\x20journey\x20versions...','List\x20activations\x20for\x20a\x20journey','format','journeyBundleId','Error:\x20Version\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','isNew','journey:view','filter','1720878gTaUXG','\x0aChanges\x20to\x20\x27','Show\x20journey\x20table\x20column\x20mapping','table','json','stages','Pausing\x20journey...','Fetching\x20journeys\x20and\x20folders...','Resolving\x20version...','Paused:','Table:\x20','createdAt','\x20\x20Target:\x20','resolveParentId','completeMilestoneRate','Error:\x20Journey\x20not\x20found:\x20','journeyBundleName','getColumnMapping','123206rsEBVF','args','ID:','(completed)','\x20=\x20','rule','has','\x0aPull\x20summary:','Session:','red','\x20details...','Error:\x20Parent\x20segment\x20context\x20required','444415GraTZo','\x27\x20not\x20found\x20in\x20','resolveSegment','listVersions','\x5c$&',',\x20schedule:\x20','...','errorCode','connection','\x20journeys','Paused\x20at:','Show\x20journey\x20details','toLowerCase','state','base','stringify','buildIdToNameMap','Pause\x20a\x20running\x20journey','history','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)','runAt','segments','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','localeCompare','folders','no\x20connection','Creating\x20new\x20version...','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Available\x20stages:\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','⚠️\x20','Getting\x20journey\x20statistics...','\x20journey','✔\x20Journey\x20\x22','scheduleType','data','Show\x20journey\x20statistics','all','createVersion','\x0aError:','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','audienceId','journey:stats','\x20Created\x20v','workflowId','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20not\x20found.\x20Available:\x20','journey:activations','Error:\x20--version\x20option\x20is\x20required','segmentName','none','resolveJourneyId','-\x20no\x20files\x20written','\x20@\x20','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','log','Database:\x20','milestoneSize','\x20\x20Journey\x20ID:\x20','\x20[runs\x20on\x20refresh]','rootFolderId','diff','Fetching\x20journey\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','kind','split','description','filePath','Resuming\x20journey...','no_parent','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','cyan','goalSize','limit','root\x20folder','\x22\x20paused','Activations:','List\x20all\x20versions\x20of\x20a\x20journey','segment','run','segmentPushCommand','dim','\x20versions)','jsonl','(root)','List\x20journeys\x20in\x20current\x20context','Write\x20','Parent\x20segment:\x20','Resolving\x20parent\x20segment...','helpText','Fetching\x20users\x20and\x20connections...','\x22\x20resumed','paused','tdx.json','pause','name','join','Stages:','execute','4611570oyEnXA','hasPeriod',',\x20version:\x20','parentSegment','✔\x20Context\x20set:\x20','stageNameMap','message','exitOrJumpSize','utf-8','/app/ps/','executeDryRun','getJourney','session','journey:version:create','runAfterJourneyRefresh','journey','folderId','buildIdToEmailMap','file','completed','2481576DvGjLZ','Getting\x20version\x20','connection\x20','add','Pattern:\x20','Error:\x20Invalid\x20--type\x20\x22','getLatestJourneyId','listActivationsFlat','journey:resume','Input:\x20','2348017rLWhcs','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Export\x20journey(s)\x20as\x20YAML\x20files','relativePath','(paused)','connectionId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Options:','includeHistory','targetDir','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','repeat','getTrafficData','cwd','journey:pull','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','INVALID_ARGUMENT','set','Resolved\x20YAML\x20file:\x20','\x20version','(archived)','launched','/j/da/je','Fetching\x20','/e/','yellow','(running)','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','from','workflowSessionId','\x22\x20not\x20found','site','(unnamed)','push','Fetching\x20parent\x20segment...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Found\x20','\x20new\x20files','journeyName','options','State:','/j/da','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','🗺️\x20','Getting\x20column\x20mapping...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','✔\x20Pulled\x20','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','Cancelled','activationParams','sort','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','web','\x20(rule\x20match)','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Target\x20directory:\x20','parent_segment','\x20unchanged\x20files','type','Error:\x20Invalid\x20version\x20number:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','versionNumber','map','journey:push','updatedAt','tsv','2268664LBiKgC','Getting\x20journey\x20details...','values','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','journeyId','verbose','\x20\x20Preserving\x20local\x20segment\x20name:\x20','journey:pause','find','\x20\x20Folder\x20path:\x20','version','user','draft','journey:versions','archived','blue','\x20\x20Statistics\x20not\x20available','activation','\x20\x20←\x20','Error:\x20','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','nodes','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','length','exitOrJumpRate','getStatistics','getActivation','pausedAt','.journey.yml','hasChanges'];a30_0x3b24=function(){return _0x77c3e4;};return a30_0x3b24();}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(_0x2d184b){const _0x4022e7=a30_0x3dc0;return!_0x2d184b&&(console['error'](_0x4022e7(0x214)),console[_0x4022e7(0x194)](_0x4022e7(0x130))),!!_0x2d184b;}function withJsonFormat(_0x3a3d96){const _0x2e5e07=a30_0x3dc0;if(!_0x3a3d96[_0x2e5e07(0x1b0)]&&!_0x3a3d96[_0x2e5e07(0x1bb)]&&!_0x3a3d96[_0x2e5e07(0x228)]&&!_0x3a3d96[_0x2e5e07(0x167)])return{..._0x3a3d96,'format':_0x2e5e07(0x1bb),'json':!![]};return _0x3a3d96;}function formatJourneyState(_0x17590e){const _0x37a958=a30_0x3dc0;switch(_0x17590e){case _0x37a958(0x13b):return a30_0x1af5e5[_0x37a958(0x192)](_0x37a958(0x140));case _0x37a958(0x174):return a30_0x1af5e5[_0x37a958(0x226)]('(draft)');case _0x37a958(0x231):return a30_0x1af5e5[_0x37a958(0x13f)](_0x37a958(0x12a));case _0x37a958(0x11b):return a30_0x1af5e5[_0x37a958(0x177)](_0x37a958(0x1cc));case _0x37a958(0x176):return a30_0x1af5e5[_0x37a958(0x226)](_0x37a958(0x13a));default:return'('+_0x17590e+')';}}function formatJourneyItem(_0x18aba2,_0x54f697='',_0x243fb4){const _0x3baafb=a30_0x3dc0,_0x1fac2b=formatJourneyState(_0x18aba2[_0x3baafb(0x1e2)]),_0x109917=_0x243fb4?hyperlink(_0x18aba2['journeyBundleName'],_0x243fb4):_0x18aba2[_0x3baafb(0x1c7)];return _0x54f697+_0x3baafb(0x151)+_0x109917+'\x20'+_0x1fac2b;}function escapeRegex(_0x267b94){const _0x5bc42f=a30_0x3dc0;return _0x267b94['replace'](/[.*+?^${}()|[\]\\]/g,_0x5bc42f(0x1d9));}function globToRegex(_0x1309df){const _0x2371e8=a30_0x3dc0,_0x1820f8=_0x1309df[_0x2371e8(0x216)]('*')['map'](escapeRegex);return new RegExp(_0x1820f8[_0x2371e8(0x235)]('.*'),'i');}function buildRuleToNameMapping(_0x4f073e){const _0x50123e=a30_0x3dc0,_0x2763b7=new Map();if(_0x4f073e['segments'])for(const [_0x5d39b7,_0x273a52]of Object['entries'](_0x4f073e[_0x50123e(0x1ea)])){if(_0x273a52[_0x50123e(0x1ce)]){const _0x394220=serializeRule(_0x273a52['rule']),_0x543eaa=_0x2763b7[_0x50123e(0x197)](_0x394220);_0x543eaa?_0x543eaa[_0x50123e(0x147)](_0x5d39b7):_0x2763b7[_0x50123e(0x137)](_0x394220,[_0x5d39b7]);}}return _0x2763b7;}async function resolveJourneyIdFromInput(_0x39111d,_0x55dd46,_0x27ede2){const _0x1dfe02=a30_0x3dc0,_0x29d03d=await resolveJourneyTarget(_0x39111d,_0x55dd46[_0x1dfe02(0x10b)],_0x55dd46[_0x1dfe02(0x16d)]),_0x5d70b6=_0x29d03d[_0x1dfe02(0x10b)];if(!_0x5d70b6)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1dfe02(0x1eb));const _0x327d96=await withSpinner(_0x1dfe02(0x22d),()=>_0x27ede2[_0x1dfe02(0x223)][_0x1dfe02(0x1c4)](_0x5d70b6),{'verbose':_0x55dd46[_0x1dfe02(0x16d)]}),_0x54386a=_0x327d96[_0x1dfe02(0x1f8)],_0xa977b3=await withSpinner('Resolving\x20journey...',()=>_0x27ede2['journey'][_0x1dfe02(0x208)](_0x54386a,_0x29d03d[_0x1dfe02(0x14c)]),{'verbose':_0x55dd46[_0x1dfe02(0x16d)]});return{'journeyId':_0xa977b3['data'],'journeyName':_0x29d03d[_0x1dfe02(0x14c)],'parentSegmentId':_0x54386a};}async function resolveJourneyTarget(_0x430691,_0x37bfbb,_0x195e7e){const _0xb7f312=a30_0x3dc0;if(isYamlFilePath(_0x430691))try{const _0x4e5507=await resolveYamlFilePath(_0x430691);return _0x195e7e&&(console[_0xb7f312(0x194)](_0xb7f312(0x138)+_0x430691),console[_0xb7f312(0x194)]('\x20\x20Parent\x20segment:\x20'+_0x4e5507['parentSegment']),console[_0xb7f312(0x194)]('\x20\x20Name:\x20'+_0x4e5507[_0xb7f312(0x206)]),console['error'](_0xb7f312(0x171)+(_0x4e5507[_0xb7f312(0x19b)]||_0xb7f312(0x229)))),{'journeyName':_0x4e5507[_0xb7f312(0x206)],'parentSegment':_0x4e5507[_0xb7f312(0x10b)],'resolved':_0x4e5507};}catch(_0x58b357){throw new SDKError(ErrorCode[_0xb7f312(0x136)],_0xb7f312(0x1ab)+_0x58b357[_0xb7f312(0x10e)]);}if(!_0x37bfbb)throw new SDKError(ErrorCode[_0xb7f312(0x136)],_0xb7f312(0x12c));return{'journeyName':_0x430691,'parentSegment':_0x37bfbb};}export class JourneyListCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]='journey:list';[a30_0x4f6ce0(0x217)]=a30_0x4f6ce0(0x22a);async[a30_0x4f6ce0(0x237)](_0x30549f){const _0x25a6ec=a30_0x4f6ce0,{options:_0x5096a6,args:_0x2fd989,tdx:_0x5053fc}=_0x30549f,_0x1bdbb2=_0x2fd989[0x0],_0x3f9eea=_0x5096a6[_0x25a6ec(0x10b)];if(!_0x3f9eea)return console[_0x25a6ec(0x194)](_0x25a6ec(0x1d4)),console[_0x25a6ec(0x194)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x3cfd5d=await withSpinner(_0x25a6ec(0x22d),()=>_0x5053fc['segment'][_0x25a6ec(0x1c4)](_0x3f9eea),{'verbose':_0x5096a6[_0x25a6ec(0x16d)]}),_0x255a3f=_0x3cfd5d[_0x25a6ec(0x1f8)];_0x5096a6['verbose']&&(console['error'](_0x25a6ec(0x22c)+_0x3f9eea+'\x20(ID:\x20'+_0x255a3f+')'),_0x1bdbb2&&console[_0x25a6ec(0x194)](_0x25a6ec(0x120)+_0x1bdbb2));const _0x3673ba=await withSpinner(_0x25a6ec(0x148),()=>_0x5053fc[_0x25a6ec(0x223)]['getParentFull'](_0x255a3f),{'verbose':_0x5096a6[_0x25a6ec(0x16d)]}),_0x1711bc=_0x3673ba[_0x25a6ec(0x1f8)],_0x37b4e2=_0x1711bc[_0x25a6ec(0x211)],_0x8d5e65=await withSpinner(_0x25a6ec(0x1a7),()=>_0x5053fc[_0x25a6ec(0x117)]['listJourneysWithFolders'](_0x255a3f,_0x37b4e2),{'verbose':_0x5096a6[_0x25a6ec(0x16d)]});let _0x5118bc=_0x8d5e65[_0x25a6ec(0x1f8)]['journeys'];const _0x5ae0fb=_0x8d5e65[_0x25a6ec(0x1f8)][_0x25a6ec(0x1ed)],_0x55e783=new Map();for(const _0x275c45 of _0x5ae0fb){_0x55e783[_0x25a6ec(0x137)](_0x275c45['id'],_0x275c45[_0x25a6ec(0x234)]);}if(_0x1bdbb2){const _0x44caa9=globToRegex(_0x1bdbb2);_0x5118bc=_0x5118bc[_0x25a6ec(0x1b6)](_0xae74b6=>_0x44caa9['test'](_0xae74b6[_0x25a6ec(0x1c7)]));}console[_0x25a6ec(0x194)](_0x25a6ec(0x1a4)+_0x5118bc[_0x25a6ec(0x180)]+_0x25a6ec(0x1f5)+(_0x5118bc[_0x25a6ec(0x180)]!==0x1?'s':''));const _0x5977ed=_0x16ef2f=>{const _0x29c18b=_0x25a6ec;return getConsoleNextUrl(_0x5096a6[_0x29c18b(0x145)],_0x29c18b(0x111)+_0x255a3f+_0x29c18b(0x13e)+_0x16ef2f+_0x29c18b(0x14f));};if(_0x5096a6[_0x25a6ec(0x1b0)]===_0x25a6ec(0x1ba))await handleSDKOutput(_0x5118bc,_0x5096a6);else{if(_0x5096a6[_0x25a6ec(0x1b0)]===_0x25a6ec(0x1bb)){const _0x5b8ea4=_0x5118bc[_0x25a6ec(0x164)](_0x456b69=>({..._0x456b69,'url':_0x5977ed(_0x456b69['id'])}));await handleSDKOutput(_0x5b8ea4,_0x5096a6);}else{console[_0x25a6ec(0x20c)]('['+_0x3f9eea+']');const _0x3240d8=new Map(),_0x1627f7=[];for(const _0x532e12 of _0x5118bc){if(!_0x532e12['folderId']||_0x532e12[_0x25a6ec(0x118)]===_0x37b4e2)_0x1627f7[_0x25a6ec(0x147)](_0x532e12);else{const _0x3bae9b=_0x3240d8[_0x25a6ec(0x197)](_0x532e12[_0x25a6ec(0x118)])||[];_0x3bae9b['push'](_0x532e12),_0x3240d8[_0x25a6ec(0x137)](_0x532e12[_0x25a6ec(0x118)],_0x3bae9b);}}const _0x491bb7=(_0x58b0fb,_0xb407d9)=>_0x58b0fb[_0x25a6ec(0x1c7)][_0x25a6ec(0x1ec)](_0xb407d9[_0x25a6ec(0x1c7)],undefined,{'sensitivity':'base'});_0x1627f7[_0x25a6ec(0x158)](_0x491bb7);for(const _0x3cdcae of _0x1627f7){console[_0x25a6ec(0x20c)](formatJourneyItem(_0x3cdcae,'',_0x5977ed(_0x3cdcae['id'])));}const _0x25d35a=[..._0x3240d8['entries']()][_0x25a6ec(0x158)]((_0x3dd341,_0x433cf5)=>{const _0xc1a2ca=_0x25a6ec,_0x7f8acb=_0x55e783['get'](_0x3dd341[0x0])||_0x3dd341[0x0],_0x46589a=_0x55e783[_0xc1a2ca(0x197)](_0x433cf5[0x0])||_0x433cf5[0x0];return _0x7f8acb['localeCompare'](_0x46589a,undefined,{'sensitivity':_0xc1a2ca(0x1e3)});});for(const [_0x4362c1,_0x52a354]of _0x25d35a){const _0x508066=_0x55e783[_0x25a6ec(0x197)](_0x4362c1)||_0x4362c1;console[_0x25a6ec(0x20c)](_0x25a6ec(0x199)+_0x508066),_0x52a354[_0x25a6ec(0x158)](_0x491bb7);for(const _0x33656d of _0x52a354){console[_0x25a6ec(0x20c)](formatJourneyItem(_0x33656d,'\x20\x20',_0x5977ed(_0x33656d['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]=a30_0x4f6ce0(0x1b5);[a30_0x4f6ce0(0x217)]=a30_0x4f6ce0(0x1e0);async['execute'](_0x42d414){const _0x4672dc=a30_0x4f6ce0,{options:_0x561f75,args:_0x56cbfd,tdx:_0x3b7bba}=_0x42d414,_0x10d552=_0x56cbfd[0x0];if(!_0x10d552)return console['error'](_0x4672dc(0x214)),console['error'](_0x4672dc(0x141)),console[_0x4672dc(0x194)](_0x4672dc(0x12d)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x561f75[_0x4672dc(0x16d)]&&console[_0x4672dc(0x194)](_0x4672dc(0x125)+_0x10d552);const {journeyId:_0x32846a,parentSegmentId:_0x5ddfce}=await resolveJourneyIdFromInput(_0x10d552,_0x561f75,_0x3b7bba);if(_0x561f75[_0x4672dc(0x15a)]){const _0x8aef56=getConsoleNextUrl(_0x561f75[_0x4672dc(0x145)],_0x4672dc(0x111)+_0x5ddfce+_0x4672dc(0x13e)+_0x32846a+_0x4672dc(0x13c));return console[_0x4672dc(0x194)](a30_0x1af5e5[_0x4672dc(0x192)]('✔')+'\x20Opening\x20'+a30_0x1af5e5['cyan'](_0x8aef56)),openBrowser(_0x8aef56),0x0;}const _0xf46ff6=await withSpinner(_0x4672dc(0x169),()=>_0x3b7bba['journey'][_0x4672dc(0x113)](_0x32846a),{'verbose':_0x561f75['verbose']}),_0x5ae8f6=_0xf46ff6[_0x4672dc(0x1f8)],_0x5dec03=_0x561f75['includeStats'];let _0x33310b;if(_0x5dec03)try{const _0x1b8017=await withSpinner(_0x4672dc(0x1f4),()=>_0x3b7bba[_0x4672dc(0x117)][_0x4672dc(0x182)](_0x32846a),{'verbose':_0x561f75[_0x4672dc(0x16d)]});_0x33310b=_0x1b8017[_0x4672dc(0x1f8)];}catch{_0x561f75[_0x4672dc(0x16d)]&&console[_0x4672dc(0x194)](_0x4672dc(0x178));}const _0x36857c=getConsoleNextUrl(_0x561f75[_0x4672dc(0x145)],_0x4672dc(0x111)+_0x5ddfce+_0x4672dc(0x13e)+_0x32846a+_0x4672dc(0x13c)),_0x4fe389={'id':_0x5ae8f6['id'],'name':_0x5ae8f6[_0x4672dc(0x198)][_0x4672dc(0x234)],'description':_0x5ae8f6[_0x4672dc(0x198)][_0x4672dc(0x217)],'state':_0x5ae8f6[_0x4672dc(0x198)][_0x4672dc(0x1e2)],'paused':_0x5ae8f6['attributes'][_0x4672dc(0x231)],'reentry_mode':_0x5ae8f6[_0x4672dc(0x198)][_0x4672dc(0x195)],'stages':_0x5ae8f6[_0x4672dc(0x198)][_0x4672dc(0x19e)]?.[_0x4672dc(0x180)]||0x0,..._0x5ae8f6[_0x4672dc(0x198)][_0x4672dc(0x188)]&&{'goal':_0x5ae8f6[_0x4672dc(0x198)][_0x4672dc(0x188)][_0x4672dc(0x234)]},..._0x33310b&&{'statistics':{'size':_0x33310b[_0x4672dc(0x193)],'entered':_0x33310b['enteredSize'],'goal_achieved':_0x33310b[_0x4672dc(0x21d)],'completion_rate':_0x33310b['completionRate'],'exit_or_jump':_0x33310b['exitOrJumpSize'],'exit_or_jump_rate':_0x33310b['exitOrJumpRate'],'stages':_0x33310b[_0x4672dc(0x1bc)]}},'url':_0x36857c};return await handleSingleObjectOutput(_0x4fe389,_0x561f75),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a30_0x4f6ce0(0x1ff);[a30_0x4f6ce0(0x217)]=a30_0x4f6ce0(0x1f9);async[a30_0x4f6ce0(0x237)](_0xe7d112){const _0x52af12=a30_0x4f6ce0,{options:_0x14e947,args:_0x313473,tdx:_0x39e807}=_0xe7d112,_0x366676=_0x313473[0x0];if(!requireNameOrPath(_0x366676))return 0x1;_0x14e947[_0x52af12(0x16d)]&&console[_0x52af12(0x194)](_0x52af12(0x125)+_0x366676);const _0x422d18=_0x14e947,_0x4cbe84=_0x422d18[_0x52af12(0x142)],_0x23d148=_0x422d18['to'],_0x4fc349=_0x422d18['includeHistory'],_0x3c0261=_0x422d18['stage'];_0x4fc349&&!_0x4cbe84&&!_0x23d148&&console[_0x52af12(0x194)](_0x52af12(0x21b));const _0x599ca3=_0x4fc349?withJsonFormat(_0x14e947):_0x14e947,{journeyId:_0x2b3d80,journeyName:_0x1d1cfb}=await resolveJourneyIdFromInput(_0x366676,_0x599ca3,_0x39e807),_0x11ef40=_0x4cbe84||_0x23d148?{'from':_0x4cbe84,'to':_0x23d148}:undefined,_0x19666a=await withSpinner(_0x52af12(0x1f4),()=>Promise[_0x52af12(0x1fa)]([_0x39e807[_0x52af12(0x117)]['getJourney'](_0x2b3d80),_0x39e807['journey'][_0x52af12(0x182)](_0x2b3d80,_0x11ef40)]),{'verbose':_0x599ca3[_0x52af12(0x16d)]}),[_0x18bc38,_0x3e089c]=_0x19666a[_0x52af12(0x1f8)];if(!_0x3e089c||_0x3e089c['journeyId']===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x1d1cfb),console['error']('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x49ad8e=buildStageNameMap(_0x18bc38),_0x43ad78=!!(_0x11ef40&&_0x3e089c[_0x52af12(0x1e7)]?.[_0x52af12(0x180)]),_0x43a585={'stageNameMap':_0x49ad8e,'hasPeriod':_0x43ad78,'includeHistory':!!_0x4fc349};if(_0x3c0261&&_0x3e089c[_0x52af12(0x1bc)]){const _0x412c87=_0x3e089c[_0x52af12(0x1bc)][_0x52af12(0x170)](_0x2a2bea=>{const _0x345c78=_0x52af12,_0x10f28f=_0x49ad8e[_0x345c78(0x197)](_0x2a2bea['id'])??'';return _0x10f28f[_0x345c78(0x1e1)]()===_0x3c0261[_0x345c78(0x1e1)]();});if(_0x412c87)return await handleSingleObjectOutput(formatStageStats(_0x412c87,_0x43a585),_0x599ca3),0x0;const _0x210de6=_0x3e089c[_0x52af12(0x1bc)]['map'](_0x332b7e=>_0x49ad8e[_0x52af12(0x197)](_0x332b7e['id'])??_0x332b7e['id']);return console['error']('Error:\x20Stage\x20\x22'+_0x3c0261+_0x52af12(0x144)),console[_0x52af12(0x194)](_0x52af12(0x1f1)+_0x210de6['join'](',\x20')),0x1;}const _0x10972a=_0x3e089c[_0x52af12(0x1bc)]?.[_0x52af12(0x164)](_0x20a22a=>formatStageStats(_0x20a22a,_0x43a585)),_0x856a92=assembleJourneyStats(_0x3e089c,{'from':_0x4cbe84,'to':_0x23d148,'includeHistory':_0x4fc349});return await this[_0x52af12(0x18e)](_0x856a92,_0x10972a??[],_0x599ca3),0x0;}async[a30_0x4f6ce0(0x18e)](_0x3ef142,_0x59af91,_0x1ad69f){const _0x2e7b7c=a30_0x4f6ce0,_0x65e9b4=_0x1ad69f[_0x2e7b7c(0x1b0)]==='json'||_0x1ad69f[_0x2e7b7c(0x1b0)]===_0x2e7b7c(0x228)||_0x1ad69f[_0x2e7b7c(0x1bb)]||_0x1ad69f[_0x2e7b7c(0x228)];if(_0x65e9b4){_0x3ef142[_0x2e7b7c(0x1bc)]=_0x59af91,await handleSingleObjectOutput(_0x3ef142,_0x1ad69f);return;}await handleSingleObjectOutput(_0x3ef142,_0x1ad69f);for(const _0x597114 of _0x59af91){console[_0x2e7b7c(0x20c)](''),console['log'](String(a30_0x1af5e5[_0x2e7b7c(0x21c)][_0x2e7b7c(0x1ad)]('['+_0x597114[_0x2e7b7c(0x234)]+']'))+a30_0x1af5e5[_0x2e7b7c(0x226)]('\x20'+_0x597114['id']));const {id:_0x55c3f9,name:_0xf4c368,..._0xbcfdea}=_0x597114;await handleSingleObjectOutput(_0xbcfdea,_0x1ad69f);}}}export class JourneyTrafficCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]=a30_0x4f6ce0(0x19a);[a30_0x4f6ce0(0x217)]=a30_0x4f6ce0(0x16b);async[a30_0x4f6ce0(0x237)](_0x11190a){const _0x593d03=a30_0x4f6ce0,{options:_0x3a8893,args:_0x2ad9a8,tdx:_0x27e19b}=_0x11190a,_0x28e8fa=_0x2ad9a8[0x0];if(!requireNameOrPath(_0x28e8fa))return 0x1;_0x3a8893[_0x593d03(0x16d)]&&console[_0x593d03(0x194)]('Input:\x20'+_0x28e8fa);const _0x33dd1f=_0x3a8893,_0xdcebf3=_0x33dd1f[_0x593d03(0x160)],_0x468120=_0x33dd1f[_0x593d03(0x142)],_0x11d2fb=_0x33dd1f['to'],_0x415578=_0x33dd1f[_0x593d03(0x21e)];if(_0xdcebf3&&_0xdcebf3!==_0x593d03(0x1a6)&&_0xdcebf3!=='activation')return console[_0x593d03(0x194)](_0x593d03(0x121)+_0xdcebf3+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x1badb3=withJsonFormat(_0x3a8893),{journeyId:_0x13a989,journeyName:_0x194493}=await resolveJourneyIdFromInput(_0x28e8fa,_0x1badb3,_0x27e19b),_0x52504f={'type':_0xdcebf3,'from':_0x468120,'to':_0x11d2fb,'limit':_0x415578},_0x599da8=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x27e19b[_0x593d03(0x117)][_0x593d03(0x132)](_0x13a989,_0x52504f),{'verbose':_0x1badb3[_0x593d03(0x16d)]}),_0x53b3ab=_0x599da8['data'],_0x57fc61=_0x53b3ab['conversion']&&(_0x53b3ab[_0x593d03(0x1a6)][_0x593d03(0x17d)][_0x593d03(0x180)]>0x0||_0x53b3ab[_0x593d03(0x1a6)]['links']['length']>0x0),_0x4b35ec=_0x53b3ab[_0x593d03(0x179)]&&_0x53b3ab['activation']['length']>0x0;if(!_0x57fc61&&!_0x4b35ec)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x194493),console[_0x593d03(0x194)](_0x593d03(0x196)),_0x468120&&_0x11d2fb&&console[_0x593d03(0x194)](_0x593d03(0x15c)),0x0;return await handleSingleObjectOutput(_0x53b3ab,_0x1badb3),0x0;}}function formatStageStats(_0xa4104b,_0x255257){const _0x1a4d5a=a30_0x4f6ce0,_0x4578ae=_0x255257[_0x1a4d5a(0x109)]&&_0xa4104b['history']?.[_0x1a4d5a(0x180)]?aggregateStageHistory(_0xa4104b[_0x1a4d5a(0x1e7)]):{'size':_0xa4104b[_0x1a4d5a(0x193)],'entered':_0xa4104b['enteredSize'],'milestone':_0xa4104b[_0x1a4d5a(0x20e)],'milestone_rate':_0xa4104b[_0x1a4d5a(0x1c5)],'exit_or_jump':_0xa4104b[_0x1a4d5a(0x10f)],'exit_or_jump_rate':_0xa4104b[_0x1a4d5a(0x181)]},_0x52eba7={'id':_0xa4104b['id'],'name':_0x255257[_0x1a4d5a(0x10d)][_0x1a4d5a(0x197)](_0xa4104b['id'])??_0xa4104b['id'],..._0x4578ae};return _0x255257[_0x1a4d5a(0x109)]&&_0x255257[_0x1a4d5a(0x12e)]&&_0xa4104b[_0x1a4d5a(0x1e7)]&&(_0x52eba7[_0x1a4d5a(0x1e7)]=_0xa4104b[_0x1a4d5a(0x1e7)]),_0x52eba7;}export class JourneyPauseCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]=a30_0x4f6ce0(0x16f);['description']=a30_0x4f6ce0(0x1e6);async[a30_0x4f6ce0(0x237)](_0x1da7fb){const _0x1b58a1=a30_0x4f6ce0,{options:_0x3cf5b9,args:_0x534419,tdx:_0x3dc585}=_0x1da7fb,_0x48f127=_0x534419[0x0];if(!requireNameOrPath(_0x48f127))return 0x1;_0x3cf5b9[_0x1b58a1(0x16d)]&&console[_0x1b58a1(0x194)]('Input:\x20'+_0x48f127);const {journeyId:_0x111e65,journeyName:_0x5c1249}=await resolveJourneyIdFromInput(_0x48f127,_0x3cf5b9,_0x3dc585);if(!_0x3cf5b9['yes']){const _0x280025=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x5c1249+'\x22?');if(!_0x280025)return console[_0x1b58a1(0x194)](_0x1b58a1(0x156)),0x0;}const _0x593d76=await withSpinner(_0x1b58a1(0x1bd),()=>_0x3dc585[_0x1b58a1(0x117)][_0x1b58a1(0x233)](_0x111e65),{'verbose':_0x3cf5b9[_0x1b58a1(0x16d)]}),_0x2dc590=_0x593d76[_0x1b58a1(0x1f8)];return console[_0x1b58a1(0x194)](_0x1b58a1(0x1f6)+_0x2dc590['attributes'][_0x1b58a1(0x234)]+_0x1b58a1(0x220)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]=a30_0x4f6ce0(0x18b);['description']=a30_0x4f6ce0(0x1a5);async['execute'](_0x5cad2a){const _0x25a86e=a30_0x4f6ce0,{options:_0x4c08d5,args:_0x580452,tdx:_0x55da44}=_0x5cad2a,_0x4940d1=_0x580452[0x0];if(!requireNameOrPath(_0x4940d1))return 0x1;_0x4c08d5['verbose']&&console[_0x25a86e(0x194)](_0x25a86e(0x125)+_0x4940d1);const {journeyId:_0x4173b3,journeyName:_0x50f6ff}=await resolveJourneyIdFromInput(_0x4940d1,_0x4c08d5,_0x55da44);if(_0x4c08d5['dryRun'])return await this[_0x25a86e(0x112)](_0x5cad2a,_0x4173b3,_0x50f6ff);if(!_0x4c08d5['yes']){const _0x48d60f=await confirm(_0x25a86e(0x1fd)+_0x50f6ff+'\x22?');if(!_0x48d60f)return console['error'](_0x25a86e(0x156)),0x0;}const _0x5f0c61=await withSpinner('Triggering\x20journey\x20workflow...',()=>_0x55da44[_0x25a86e(0x117)][_0x25a86e(0x224)](_0x4173b3),{'verbose':_0x4c08d5[_0x25a86e(0x16d)]}),_0x3fc302=_0x5f0c61[_0x25a86e(0x1f8)],_0x47fa75=getWorkflowSessionUrl(_0x4c08d5[_0x25a86e(0x145)],_0x3fc302[_0x25a86e(0x201)],_0x3fc302[_0x25a86e(0x143)]);return console[_0x25a86e(0x194)]('\x0a'+a30_0x1af5e5['green']('✔')+'\x20Journey\x20workflow\x20started'),console['error']('\x20\x20'+a30_0x1af5e5[_0x25a86e(0x226)](_0x25a86e(0x191))+'\x20'+_0x50f6ff),console[_0x25a86e(0x194)]('\x20\x20'+a30_0x1af5e5[_0x25a86e(0x226)](_0x25a86e(0x1a0))+'\x20'+_0x3fc302['status']),console[_0x25a86e(0x194)]('\x20\x20'+a30_0x1af5e5[_0x25a86e(0x226)](_0x25a86e(0x1d1))+'\x20'+_0x3fc302[_0x25a86e(0x143)]),console['error']('\x20\x20'+_0x47fa75),0x0;}async[a30_0x4f6ce0(0x112)](_0x938d2a,_0x2d64fa,_0x4a8fd7){const _0x230f1a=a30_0x4f6ce0,{options:_0x5bf6ac,tdx:_0x442941}=_0x938d2a,_0x58d9ae=await withSpinner(_0x230f1a(0x213)+_0x4a8fd7+'...',()=>Promise[_0x230f1a(0x1fa)]([_0x442941[_0x230f1a(0x117)]['getJourney'](_0x2d64fa),_0x442941[_0x230f1a(0x117)][_0x230f1a(0x123)](_0x2d64fa)]),{'verbose':_0x5bf6ac[_0x230f1a(0x16d)]}),[_0x263e76,_0x3c00e0]=_0x58d9ae[_0x230f1a(0x1f8)],_0x1ca348=_0x263e76[_0x230f1a(0x198)],_0x2c1394=_0x1ca348['journeyStages'];console[_0x230f1a(0x20c)](a30_0x1af5e5[_0x230f1a(0x1ad)](_0x230f1a(0x191)),_0x1ca348['name']),console[_0x230f1a(0x20c)](a30_0x1af5e5[_0x230f1a(0x1ad)](_0x230f1a(0x1cb)),_0x263e76['id']),console['log'](a30_0x1af5e5[_0x230f1a(0x1ad)]('State:'),_0x1ca348[_0x230f1a(0x1e2)]),console[_0x230f1a(0x20c)](a30_0x1af5e5[_0x230f1a(0x1ad)](_0x230f1a(0x1c0)),_0x1ca348[_0x230f1a(0x231)]?a30_0x1af5e5[_0x230f1a(0x13f)](_0x230f1a(0x19d)):a30_0x1af5e5['green']('no')),console[_0x230f1a(0x20c)](a30_0x1af5e5['bold'](_0x230f1a(0x187)),_0x1ca348['audienceId']);const _0x528f23=_0x2c1394[_0x230f1a(0x180)]>0x0?'\x20('+_0x2c1394[_0x230f1a(0x164)](_0x52e8be=>_0x52e8be[_0x230f1a(0x234)])[_0x230f1a(0x235)](',\x20')+')':'';console[_0x230f1a(0x20c)](a30_0x1af5e5[_0x230f1a(0x1ad)](_0x230f1a(0x236)),''+_0x2c1394['length']+_0x528f23),console[_0x230f1a(0x20c)]('');if(_0x3c00e0[_0x230f1a(0x180)]===0x0)console['log'](a30_0x1af5e5[_0x230f1a(0x1ad)](_0x230f1a(0x221)),a30_0x1af5e5['dim'](_0x230f1a(0x1a8)));else{console[_0x230f1a(0x20c)](a30_0x1af5e5[_0x230f1a(0x1ad)](_0x230f1a(0x221)));for(const _0x195fe2 of _0x3c00e0){const _0x35189a=_0x195fe2['name']??'(unnamed)',_0x496eb9=_0x195fe2[_0x230f1a(0x12b)]!=null?_0x230f1a(0x11e)+_0x195fe2[_0x230f1a(0x12b)]:_0x230f1a(0x1ee),_0x5c516a=_0x195fe2[_0x230f1a(0x1f7)]?''+_0x195fe2[_0x230f1a(0x1f7)]+(_0x195fe2[_0x230f1a(0x1e9)]?_0x230f1a(0x20a)+_0x195fe2[_0x230f1a(0x1e9)]:''):_0x230f1a(0x207),_0x413bb1=_0x195fe2[_0x230f1a(0x116)]?_0x230f1a(0x210):'';console[_0x230f1a(0x20c)]('\x20\x20'+a30_0x1af5e5[_0x230f1a(0x13f)](_0x230f1a(0x1f3))+'\x20'+_0x35189a+'\x20\x20←\x20'+_0x496eb9+_0x230f1a(0x1da)+_0x5c516a+_0x413bb1);}}return console['log'](a30_0x1af5e5[_0x230f1a(0x13f)](_0x230f1a(0x20b))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]=a30_0x4f6ce0(0x124);['description']='Resume\x20a\x20paused\x20journey';async[a30_0x4f6ce0(0x237)](_0x4ac002){const _0x41ae83=a30_0x4f6ce0,{options:_0x1471a3,args:_0x4b42b7,tdx:_0x8cef6e}=_0x4ac002,_0x6e3d07=_0x4b42b7[0x0];if(!requireNameOrPath(_0x6e3d07))return 0x1;_0x1471a3[_0x41ae83(0x16d)]&&console[_0x41ae83(0x194)](_0x41ae83(0x125)+_0x6e3d07);const {journeyId:_0x543491,journeyName:_0x8e8803}=await resolveJourneyIdFromInput(_0x6e3d07,_0x1471a3,_0x8cef6e);if(_0x1471a3[_0x41ae83(0x19c)])return await this[_0x41ae83(0x112)](_0x4ac002,_0x543491,_0x8e8803);if(!_0x1471a3[_0x41ae83(0x19d)]){const _0x3c067c=await confirm(_0x41ae83(0x127)+_0x8e8803+'\x22?');if(!_0x3c067c)return console[_0x41ae83(0x194)]('Cancelled'),0x0;}const _0x4c3090=await withSpinner(_0x41ae83(0x219),()=>_0x8cef6e[_0x41ae83(0x117)]['resume'](_0x543491),{'verbose':_0x1471a3['verbose']}),_0x18bcf5=_0x4c3090[_0x41ae83(0x1f8)];return console[_0x41ae83(0x194)]('✔\x20Journey\x20\x22'+_0x18bcf5[_0x41ae83(0x198)][_0x41ae83(0x234)]+_0x41ae83(0x230)),0x0;}async[a30_0x4f6ce0(0x112)](_0x262c94,_0x1cf5e7,_0x3d7b81){const _0x2938c1=a30_0x4f6ce0,{options:_0x12357c,tdx:_0x2ae072}=_0x262c94,_0xaaefb2=await withSpinner(_0x2938c1(0x213)+_0x3d7b81+'...',()=>Promise[_0x2938c1(0x1fa)]([_0x2ae072[_0x2938c1(0x117)][_0x2938c1(0x113)](_0x1cf5e7),_0x2ae072['journey'][_0x2938c1(0x123)](_0x1cf5e7)]),{'verbose':_0x12357c['verbose']}),[_0x541494,_0x58353a]=_0xaaefb2[_0x2938c1(0x1f8)],_0x3d7a38=_0x541494[_0x2938c1(0x198)],_0x43c553=_0x3d7a38[_0x2938c1(0x19e)];console[_0x2938c1(0x20c)](a30_0x1af5e5[_0x2938c1(0x1ad)]('Journey:'),_0x3d7a38[_0x2938c1(0x234)]),console[_0x2938c1(0x20c)](a30_0x1af5e5[_0x2938c1(0x1ad)]('ID:'),_0x541494['id']),console[_0x2938c1(0x20c)](a30_0x1af5e5[_0x2938c1(0x1ad)](_0x2938c1(0x14e)),_0x3d7a38[_0x2938c1(0x1e2)]),console['log'](a30_0x1af5e5['bold'](_0x2938c1(0x1c0)),_0x3d7a38[_0x2938c1(0x231)]?a30_0x1af5e5[_0x2938c1(0x13f)](_0x2938c1(0x19d)):a30_0x1af5e5['green']('no'));_0x3d7a38[_0x2938c1(0x184)]&&console[_0x2938c1(0x20c)](a30_0x1af5e5['bold'](_0x2938c1(0x1df)),_0x3d7a38['pausedAt']);console[_0x2938c1(0x20c)](a30_0x1af5e5[_0x2938c1(0x1ad)](_0x2938c1(0x187)),_0x3d7a38[_0x2938c1(0x1fe)]);const _0x31ea47=_0x43c553[_0x2938c1(0x180)]>0x0?'\x20('+_0x43c553[_0x2938c1(0x164)](_0x1ea736=>_0x1ea736[_0x2938c1(0x234)])['join'](',\x20')+')':'';console['log'](a30_0x1af5e5['bold']('Stages:'),''+_0x43c553[_0x2938c1(0x180)]+_0x31ea47),console[_0x2938c1(0x20c)]('');if(_0x58353a[_0x2938c1(0x180)]===0x0)console[_0x2938c1(0x20c)](a30_0x1af5e5[_0x2938c1(0x1ad)](_0x2938c1(0x221)),a30_0x1af5e5[_0x2938c1(0x226)]('(none)'));else{console[_0x2938c1(0x20c)](a30_0x1af5e5['bold'](_0x2938c1(0x221)));for(const _0xd4ddfe of _0x58353a){const _0x301565=_0xd4ddfe[_0x2938c1(0x234)]??_0x2938c1(0x146),_0x48b167=_0xd4ddfe['connectionId']!=null?_0x2938c1(0x11e)+_0xd4ddfe[_0x2938c1(0x12b)]:_0x2938c1(0x1ee),_0x21c71d=_0xd4ddfe[_0x2938c1(0x1f7)]?''+_0xd4ddfe['scheduleType']+(_0xd4ddfe['runAt']?_0x2938c1(0x20a)+_0xd4ddfe[_0x2938c1(0x1e9)]:''):_0x2938c1(0x207),_0x35dcdd=_0xd4ddfe[_0x2938c1(0x116)]?_0x2938c1(0x210):'';console['log']('\x20\x20'+a30_0x1af5e5[_0x2938c1(0x13f)]('⚠️\x20')+'\x20'+_0x301565+_0x2938c1(0x17a)+_0x48b167+',\x20schedule:\x20'+_0x21c71d+_0x35dcdd);}}return console[_0x2938c1(0x20c)](a30_0x1af5e5[_0x2938c1(0x13f)](_0x2938c1(0x155))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]=a30_0x4f6ce0(0x134);[a30_0x4f6ce0(0x217)]=a30_0x4f6ce0(0x128);async[a30_0x4f6ce0(0x237)](_0x1e6827){const _0x2548c0=a30_0x4f6ce0,{options:_0x2d3119,args:_0x3d71f4,tdx:_0x496ce1}=_0x1e6827,_0x236ac9=_0x2d3119,_0x483dc3=_0x3d71f4[0x0],_0x1344ed=_0x483dc3&&isYamlFilePath(_0x483dc3),_0x4f0ced=await resolveTarget({'arg':_0x1344ed?_0x483dc3:undefined,'contextParent':_0x2d3119[_0x2548c0(0x10b)],'cwd':process[_0x2548c0(0x133)]()});if(!isSuccessfulResolution(_0x4f0ced))return _0x4f0ced[_0x2548c0(0x1dc)]===_0x2548c0(0x21a)?(console[_0x2548c0(0x194)](a30_0x1af5e5[_0x2548c0(0x13f)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2548c0(0x194)](_0x2548c0(0x1e8)),console['error'](_0x2548c0(0x1b3)),console[_0x2548c0(0x194)](_0x2548c0(0x150)),console[_0x2548c0(0x194)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x2548c0(0x194)](a30_0x1af5e5[_0x2548c0(0x1d2)](_0x2548c0(0x17b)+_0x4f0ced['message']+'\x0a')),_0x4f0ced['helpText']&&console[_0x2548c0(0x194)](a30_0x1af5e5['cyan'](_0x4f0ced[_0x2548c0(0x22e)]))),0x1;let _0x4f0101=_0x1344ed?undefined:_0x483dc3,_0x302997,_0x38aab8;_0x4f0ced[_0x2548c0(0x160)]==='file'&&(_0x4f0101=_0x4f0ced[_0x2548c0(0x189)],_0x302997=_0x4f0ced[_0x2548c0(0x218)],_0x38aab8=_0x4f0ced[_0x2548c0(0x19b)]);const _0x6cafcc=_0x4f0ced['parentName'],_0x5b40cc=_0x4f0ced[_0x2548c0(0x12f)];_0x236ac9[_0x2548c0(0x16d)]&&(console['error'](_0x2548c0(0x22c)+_0x6cafcc),console[_0x2548c0(0x194)](_0x2548c0(0x15d)+_0x5b40cc),_0x4f0101&&console[_0x2548c0(0x194)]('Journey\x20name:\x20'+_0x4f0101),_0x302997&&console[_0x2548c0(0x194)]('Target\x20file:\x20'+_0x302997),_0x38aab8&&console['error']('Folder\x20path:\x20'+_0x38aab8));const _0xe49216=await withSpinner(_0x2548c0(0x22d),()=>_0x496ce1[_0x2548c0(0x223)]['resolveParentId'](_0x6cafcc),{'verbose':_0x2d3119[_0x2548c0(0x16d)]}),_0x40f7ca=_0xe49216[_0x2548c0(0x1f8)],{journeys:_0x3cb4a0,folders:_0xc53c23}=await withSpinner(_0x2548c0(0x1be),async()=>{const _0x1b9ba5=_0x2548c0,[_0x56f204,_0xc9361b]=await Promise[_0x1b9ba5(0x1fa)]([_0x496ce1[_0x1b9ba5(0x117)][_0x1b9ba5(0x18f)](_0x40f7ca,undefined,{'includeAllVersions':!![]}),_0x496ce1[_0x1b9ba5(0x223)]['listFolders'](_0x40f7ca)]);return{'journeys':_0x56f204,'folders':_0xc9361b};},{'verbose':_0x2d3119[_0x2548c0(0x16d)]})[_0x2548c0(0x1a3)](_0x5e628f=>_0x5e628f['data']);let _0x152e61=_0x3cb4a0;const _0x167bf4=buildFolderIdToPathMap(_0xc53c23);if(_0x4f0101){const _0x2b2c98=_0x152e61[_0x2548c0(0x1b6)](_0x527d45=>_0x527d45['journeyBundleName'][_0x2548c0(0x1e1)]()===_0x4f0101['toLowerCase']());if(_0x2b2c98[_0x2548c0(0x180)]===0x0)return console['error'](_0x2548c0(0x1c6)+_0x4f0101),console['error'](_0x2548c0(0x1f0)),0x1;_0x152e61=_0x2b2c98;}if(_0x38aab8!==undefined){const _0x5e0792=_0x152e61[_0x2548c0(0x1b6)](_0x3a26a3=>{const _0x3b116d=_0x2548c0,_0x5d2f70=_0x3a26a3[_0x3b116d(0x118)]?_0x167bf4['get'](_0x3a26a3['folderId'])||'':'';return _0x5d2f70===_0x38aab8;});if(_0x5e0792[_0x2548c0(0x180)]===0x0&&_0x152e61[_0x2548c0(0x180)]>0x0){console[_0x2548c0(0x194)](_0x2548c0(0x18c)+_0x4f0101+_0x2548c0(0x1d6)+(_0x38aab8||_0x2548c0(0x21f))),console[_0x2548c0(0x194)](_0x2548c0(0x135));for(const _0x61e876 of _0x152e61){const _0x5b08e8=_0x61e876[_0x2548c0(0x118)]?_0x167bf4[_0x2548c0(0x197)](_0x61e876['folderId'])||'':'';console[_0x2548c0(0x194)]('\x20\x20-\x20'+(_0x5b08e8||_0x2548c0(0x229))+'/'+_0x61e876[_0x2548c0(0x1c7)]);}return 0x1;}_0x152e61=_0x5e0792;}if(_0x152e61[_0x2548c0(0x180)]===0x0)return console[_0x2548c0(0x194)](_0x2548c0(0x190)),0x0;const _0x1342d6=new Map();for(const _0x444274 of _0x152e61){const _0x1fb8d6=_0x444274['journeyBundleId'];!_0x1342d6['has'](_0x1fb8d6)&&_0x1342d6[_0x2548c0(0x137)](_0x1fb8d6,[]),_0x1342d6[_0x2548c0(0x197)](_0x1fb8d6)[_0x2548c0(0x147)](_0x444274);}for(const _0x197e1c of _0x1342d6[_0x2548c0(0x16a)]()){_0x197e1c[_0x2548c0(0x158)]((_0x1736dc,_0x1ffe13)=>(_0x1736dc[_0x2548c0(0x163)]||0x0)-(_0x1ffe13['versionNumber']||0x0));}const _0x46860a=[],{idToEmailMap:_0x8e6b82,connectionIdToNameMap:_0x5e49c5}=await withSpinner(_0x2548c0(0x22f),async()=>{const _0x31a75=_0x2548c0,[_0x32568c,_0x5c6b49]=await Promise[_0x31a75(0x1fa)]([_0x496ce1[_0x31a75(0x173)][_0x31a75(0x119)](),_0x496ce1[_0x31a75(0x1dd)][_0x31a75(0x1e5)]()]);return{'idToEmailMap':_0x32568c,'connectionIdToNameMap':_0x5c6b49};},{'verbose':_0x2d3119['verbose']})[_0x2548c0(0x1a3)](_0x4b827d=>_0x4b827d[_0x2548c0(0x1f8)]);for(const _0x171d1e of _0x1342d6[_0x2548c0(0x16a)]()){const _0x5c65a7=_0x171d1e[0x0][_0x2548c0(0x1c7)],_0x5e497e=_0x171d1e[0x0][_0x2548c0(0x118)],_0x2660fe=_0x5e497e?_0x167bf4['get'](_0x5e497e)||'':'',_0x208255=_0x2660fe?a30_0x73190[_0x2548c0(0x235)](_0x5b40cc,_0x2660fe):_0x5b40cc,_0x26e308=_0x302997||a30_0x73190['join'](_0x208255,sanitizeFileName(_0x5c65a7)+_0x2548c0(0x185));let _0xd9c5fb,_0x4fbe59;if(existsSync(_0x26e308))try{const _0x5bf9e2=readFileSync(_0x26e308,_0x2548c0(0x110)),_0x255bbf=parseYamlString(_0x5bf9e2);_0x4fbe59=_0x255bbf,_0xd9c5fb=buildRuleToNameMapping(_0x255bbf),_0x236ac9[_0x2548c0(0x16d)]&&_0xd9c5fb['size']>0x0&&console[_0x2548c0(0x194)]('Found\x20'+_0xd9c5fb[_0x2548c0(0x193)]+_0x2548c0(0x162)+_0x5c65a7);}catch(_0x1cd7fe){_0x236ac9['verbose']&&console[_0x2548c0(0x194)](_0x2548c0(0x17f)+_0x1cd7fe[_0x2548c0(0x10e)]);}const _0x246a7c=[],_0x3850fd=new Set(),_0x33345b=new Map(),_0x2633af=new Map(),_0x38b723=new Set(),_0xd26840=new Map(),_0x9e31b4=new Map(),_0x6c07f8=createJumpTargetCache();await withProgressSpinner(_0x2548c0(0x13d)+_0x5c65a7+_0x2548c0(0x1db),async _0x5e5f0d=>{const _0x3b3dc9=_0x2548c0;for(const _0x1b6c1d of _0x171d1e){const _0x1291f0=_0x171d1e[_0x3b3dc9(0x180)]>0x1?_0x1b6c1d['journeyBundleName']+'\x20v'+(_0x1b6c1d['versionNumber']||0x1):_0x1b6c1d['journeyBundleName'];_0x5e5f0d[_0x3b3dc9(0x1a1)]('Fetching\x20'+_0x1291f0);const _0x33aea5=await _0x496ce1[_0x3b3dc9(0x117)]['getJourney'](_0x1b6c1d['id']),_0x32f0dd=_0x33aea5[_0x3b3dc9(0x198)]?.['audienceId'],_0x1038a9={'resolveSegment':async _0x3de47d=>{const _0x164c24=_0x3b3dc9;if(!_0x32f0dd)return{'name':_0x3de47d,'isJourneyLocal':![]};const _0x342b73=_0x33345b[_0x164c24(0x197)](_0x3de47d);if(_0x342b73)return _0x342b73;try{const _0x206ed0=await _0x496ce1[_0x164c24(0x223)]['getSegment'](_0x32f0dd,_0x3de47d),_0x100e62=_0x206ed0[_0x164c24(0x215)]===SEGMENT_KIND_JOURNEY;let _0x213421,_0x25c860=_0x206ed0['name'];if(_0x100e62&&_0x206ed0[_0x164c24(0x1ce)]){const _0x7e2501=await segmentResponseToDef(_0x206ed0,{'resolveSegmentName':async _0x3657f6=>{const _0x58e2cf=_0x164c24,_0x55a696=_0x33345b[_0x58e2cf(0x197)](_0x3657f6);if(_0x55a696)return _0x55a696[_0x58e2cf(0x234)];const _0x244a6f=await _0x1038a9[_0x58e2cf(0x1d7)](_0x3657f6);return _0x244a6f[_0x58e2cf(0x234)];}}),_0x14ea2b=_0x7e2501[_0x164c24(0x1ce)];_0x213421={'description':_0x206ed0[_0x164c24(0x217)],'rule':_0x14ea2b};const _0x3c582b=serializeRule(_0x14ea2b),_0x25ea66=_0x2633af[_0x164c24(0x197)](_0x3c582b);if(_0x25ea66)_0x25c860=_0x25ea66,_0x213421=undefined,_0x236ac9['verbose']&&console[_0x164c24(0x194)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x206ed0['name']+'\x20->\x20'+_0x25ea66);else{let _0x434c85=![];if(_0xd9c5fb){const _0x4d21e9=_0xd9c5fb['get'](_0x3c582b);if(_0x4d21e9){const _0xad17d2=_0x4d21e9[_0x164c24(0x170)](_0xaf9aaa=>!_0x3850fd[_0x164c24(0x1cf)](_0xaf9aaa));_0xad17d2&&(_0x25c860=_0xad17d2,_0x3850fd['add'](_0xad17d2),_0x2633af[_0x164c24(0x137)](_0x3c582b,_0xad17d2),_0x434c85=!![],_0x236ac9['verbose']&&console[_0x164c24(0x194)](_0x164c24(0x16e)+_0xad17d2+_0x164c24(0x15b)));}}if(!_0x434c85){const _0x4bdb06=generateJourneyLocalName(_0x206ed0['name']);_0x4bdb06&&(_0x25c860=_0x4bdb06);let _0x58bfb3=_0x25c860,_0x4a89f3=0x2;while(_0x3850fd[_0x164c24(0x1cf)](_0x58bfb3)){_0x58bfb3=_0x25c860+'_'+_0x4a89f3,_0x4a89f3++;}_0x3850fd[_0x164c24(0x11f)](_0x58bfb3),_0x2633af[_0x164c24(0x137)](_0x3c582b,_0x58bfb3),_0x25c860=_0x58bfb3;}}}const _0x30bc11={'name':_0x25c860,'isJourneyLocal':_0x100e62,'definition':_0x213421};return _0x33345b[_0x164c24(0x137)](_0x3de47d,_0x30bc11),_0x30bc11;}catch(_0x2cfb4f){return _0x2d3119[_0x164c24(0x16d)]&&console[_0x164c24(0x194)](_0x164c24(0x17e)+_0x3de47d+':\x20'+_0x2cfb4f[_0x164c24(0x10e)]),{'name':_0x3de47d,'isJourneyLocal':![]};}},'resolveActivation':async _0x5abe0f=>{const _0x3eb3c1=_0x3b3dc9,_0x146867=_0xd26840[_0x3eb3c1(0x197)](_0x5abe0f);if(_0x146867)return _0x146867;try{const _0x3ba5b9=await _0x496ce1['journey'][_0x3eb3c1(0x183)](_0x1b6c1d['id'],_0x5abe0f),_0x2d1a95=journeyActivationStepToYaml(_0x3ba5b9,_0x8e6b82,_0x5e49c5),_0x29eacb=JSON[_0x3eb3c1(0x1e4)]({'name':_0x2d1a95[_0x3eb3c1(0x234)],'connection':_0x2d1a95[_0x3eb3c1(0x1dd)],'connector_config':_0x2d1a95['connector_config']}),_0x46961e=_0x9e31b4['get'](_0x29eacb);if(_0x46961e){const _0x4f4f1e={'name':_0x46961e,'isJourneyLocal':!![],'definition':_0x2d1a95};return _0xd26840[_0x3eb3c1(0x137)](_0x5abe0f,_0x4f4f1e),_0x4f4f1e;}const _0x28a0b4=_0x3ba5b9['attributes'][_0x3eb3c1(0x157)]['name']||_0x5abe0f,_0x54def4=sanitizeYamlKey(_0x28a0b4)||_0x3eb3c1(0x19f)+_0x5abe0f;let _0x4987f9=_0x54def4,_0xc771ca=0x2;while(_0x38b723['has'](_0x4987f9)){_0x4987f9=_0x54def4+'_'+_0xc771ca,_0xc771ca++;}_0x38b723[_0x3eb3c1(0x11f)](_0x4987f9),_0x9e31b4['set'](_0x29eacb,_0x4987f9);const _0x8e6c42={'name':_0x4987f9,'isJourneyLocal':!![],'definition':_0x2d1a95};return _0xd26840[_0x3eb3c1(0x137)](_0x5abe0f,_0x8e6c42),_0x8e6c42;}catch(_0x5d435c){return _0x2d3119[_0x3eb3c1(0x16d)]&&console[_0x3eb3c1(0x194)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x5abe0f+':\x20'+_0x5d435c[_0x3eb3c1(0x10e)]),{'name':_0x5abe0f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x59591b,_0x2b9c7d)=>{const _0x4fedb7=_0x3b3dc9;return resolveJumpTarget(_0x59591b,_0x2b9c7d,_0x6c07f8,_0x313557=>_0x496ce1[_0x4fedb7(0x117)]['getJourney'](_0x313557));}},_0x1b3019=await journeyResponseToDef(_0x33aea5,_0x1038a9);_0x246a7c[_0x3b3dc9(0x147)]({'item':_0x1b6c1d,'yaml':_0x1b3019});}},{'verbose':_0x2d3119[_0x2548c0(0x16d)]});const _0x4660a4=await _0x496ce1['journey'][_0x2548c0(0x122)](_0x171d1e[0x0][_0x2548c0(0x1b1)]),_0x4f0621=buildMergedJourneyDef(_0x246a7c,_0xd9c5fb,_0x4660a4),_0x1aaf3d=normalizeJourneyDef(_0x4f0621,_0x4fbe59),_0x2bda99=toYamlString(_0x1aaf3d),_0x4e8f8c=_0x302997||a30_0x73190[_0x2548c0(0x235)](_0x208255,sanitizeFileName(_0x5c65a7)+'.journey.yml');!_0x302997&&_0x2660fe&&!existsSync(_0x208255)&&mkdirSync(_0x208255,{'recursive':!![]});const _0x4a5c50=a30_0x73190['relative'](process[_0x2548c0(0x133)](),_0x4e8f8c);if(existsSync(_0x4e8f8c)){const _0x11684a=readFileSync(_0x4e8f8c,'utf-8'),_0x3ea776=generateDiff(_0x11684a,_0x2bda99),_0x298d96=hasChanges(_0x3ea776);_0x46860a[_0x2548c0(0x147)]({'relativePath':_0x4a5c50,'absolutePath':_0x4e8f8c,'content':_0x2bda99,'isNew':![],'hasChanges':_0x298d96,'diff':_0x298d96?formatDiffWithColors(_0x3ea776):undefined});}else _0x46860a[_0x2548c0(0x147)]({'relativePath':_0x4a5c50,'absolutePath':_0x4e8f8c,'content':_0x2bda99,'isNew':!![],'hasChanges':![]});}const _0x2b2f64=_0x46860a[_0x2548c0(0x1b6)](_0x58c7b1=>_0x58c7b1[_0x2548c0(0x1b4)]),_0x2cca2f=_0x46860a[_0x2548c0(0x1b6)](_0x3bcacf=>!_0x3bcacf[_0x2548c0(0x1b4)]&&_0x3bcacf[_0x2548c0(0x186)]),_0x2b0fb6=_0x46860a['filter'](_0x16c404=>!_0x16c404[_0x2548c0(0x1b4)]&&!_0x16c404[_0x2548c0(0x186)]),_0x377e69=_0x152e61[_0x2548c0(0x180)],_0x1703e6=_0x1342d6[_0x2548c0(0x193)],_0x495312=_0x377e69>_0x1703e6?'\x20('+_0x377e69+_0x2548c0(0x227):'';console[_0x2548c0(0x194)](_0x2548c0(0x1d0)),console[_0x2548c0(0x194)]('\x20\x20'+a30_0x1af5e5[_0x2548c0(0x21c)](_0x1703e6+_0x2548c0(0x1de))+a30_0x1af5e5[_0x2548c0(0x226)](_0x495312)),console[_0x2548c0(0x194)]('\x20\x20'+a30_0x1af5e5[_0x2548c0(0x192)]('+\x20'+_0x2b2f64[_0x2548c0(0x180)]+_0x2548c0(0x14b))),console[_0x2548c0(0x194)]('\x20\x20'+a30_0x1af5e5[_0x2548c0(0x13f)]('~\x20'+_0x2cca2f[_0x2548c0(0x180)]+'\x20changed\x20files')),console[_0x2548c0(0x194)]('\x20\x20'+a30_0x1af5e5[_0x2548c0(0x226)]('=\x20'+_0x2b0fb6[_0x2548c0(0x180)]+_0x2548c0(0x15f))),console[_0x2548c0(0x194)](_0x2548c0(0x1c3)+a30_0x1af5e5[_0x2548c0(0x21c)](_0x5b40cc)+'\x0a');if(_0x2cca2f[_0x2548c0(0x180)]>0x0)for(const _0x2e0fbf of _0x2cca2f){console['error'](_0x2548c0(0x1b8)+_0x2e0fbf[_0x2548c0(0x129)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x2e0fbf[_0x2548c0(0x212)]),console[_0x2548c0(0x194)]('─'[_0x2548c0(0x131)](0x3c));}if(_0x236ac9[_0x2548c0(0x19c)])return console[_0x2548c0(0x194)](a30_0x1af5e5['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2b2f64[_0x2548c0(0x180)]===0x0&&_0x2cca2f['length']===0x0)return console['error'](a30_0x1af5e5[_0x2548c0(0x192)](_0x2548c0(0x18a))),saveSessionContext({'parent_segment':_0x6cafcc},_0x236ac9[_0x2548c0(0x114)]),console[_0x2548c0(0x194)](a30_0x1af5e5[_0x2548c0(0x192)](_0x2548c0(0x10c)+a30_0x1af5e5['dim'](_0x2548c0(0x15e))+'\x20=\x20'+a30_0x1af5e5[_0x2548c0(0x21c)](_0x6cafcc))),0x0;if(!_0x236ac9[_0x2548c0(0x19d)]&&(_0x2b2f64[_0x2548c0(0x180)]>0x0||_0x2cca2f[_0x2548c0(0x180)]>0x0)){if(!isInteractive())return console[_0x2548c0(0x194)](a30_0x1af5e5[_0x2548c0(0x1d2)](_0x2548c0(0x1fc)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2548c0(0x194)](a30_0x1af5e5[_0x2548c0(0x226)](_0x2548c0(0x149))),0x1;const _0x590319=await confirmKey(_0x2548c0(0x22b)+(_0x2b2f64[_0x2548c0(0x180)]+_0x2cca2f[_0x2548c0(0x180)])+_0x2548c0(0x18d));if(!_0x590319)return console[_0x2548c0(0x194)](a30_0x1af5e5[_0x2548c0(0x13f)](_0x2548c0(0x1a9)),_0x2548c0(0x209)),0x1;}!existsSync(_0x5b40cc)&&mkdirSync(_0x5b40cc,{'recursive':!![]});const _0x288bc2=a30_0x73190[_0x2548c0(0x235)](_0x5b40cc,_0x2548c0(0x232));writeFileSync(_0x288bc2,createTdxConfigContent(_0x6cafcc),_0x2548c0(0x110));for(const _0xd30e74 of _0x46860a){(_0xd30e74[_0x2548c0(0x1b4)]||_0xd30e74[_0x2548c0(0x186)])&&writeFileSync(_0xd30e74['absolutePath'],_0xd30e74['content'],_0x2548c0(0x110));}return console[_0x2548c0(0x194)](a30_0x1af5e5[_0x2548c0(0x192)](_0x2548c0(0x154)+(_0x2b2f64['length']+_0x2cca2f[_0x2548c0(0x180)])+'\x20journey\x20files\x20to\x20'+_0x5b40cc)),saveSessionContext({'parent_segment':_0x6cafcc},_0x236ac9[_0x2548c0(0x114)]),console['error'](a30_0x1af5e5['green'](_0x2548c0(0x10c)+a30_0x1af5e5[_0x2548c0(0x226)](_0x2548c0(0x15e))+_0x2548c0(0x1cd)+a30_0x1af5e5[_0x2548c0(0x21c)](_0x6cafcc))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]='journey:columns';[a30_0x4f6ce0(0x217)]=a30_0x4f6ce0(0x1b9);async[a30_0x4f6ce0(0x237)](_0xf2f958){const _0x354712=a30_0x4f6ce0,{options:_0x9115a5,args:_0x3b4493,tdx:_0x5995d2}=_0xf2f958,_0x290122=_0x3b4493[0x0];if(!requireNameOrPath(_0x290122))return 0x1;_0x9115a5[_0x354712(0x16d)]&&console[_0x354712(0x194)](_0x354712(0x125)+_0x290122);const {journeyId:_0x503c94}=await resolveJourneyIdFromInput(_0x290122,_0x9115a5,_0x5995d2),_0x44b6de=await withSpinner(_0x354712(0x152),()=>_0x5995d2['journey'][_0x354712(0x1c8)](_0x503c94),{'verbose':_0x9115a5[_0x354712(0x16d)]}),_0x2b100e=_0x44b6de[_0x354712(0x1f8)];return console[_0x354712(0x20c)](_0x354712(0x20d)+_0x2b100e['database']),console[_0x354712(0x20c)](_0x354712(0x1c1)+_0x2b100e[_0x354712(0x1ba)]),await handleSDKOutput(_0x2b100e['columns'],_0x9115a5),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]=a30_0x4f6ce0(0x204);['description']=a30_0x4f6ce0(0x1af);async['execute'](_0x1d53a6){const _0x47af45=a30_0x4f6ce0,{options:_0x26c820,args:_0x14c7da,tdx:_0x4ce9d4}=_0x1d53a6,_0x215676=_0x14c7da[0x0];if(!requireNameOrPath(_0x215676))return 0x1;_0x26c820['verbose']&&console[_0x47af45(0x194)](_0x47af45(0x125)+_0x215676);const {journeyId:_0x4d1a42}=await resolveJourneyIdFromInput(_0x215676,_0x26c820,_0x4ce9d4),_0x1edf0a=await withSpinner(_0x47af45(0x1a2),()=>_0x4ce9d4[_0x47af45(0x117)][_0x47af45(0x123)](_0x4d1a42),{'verbose':_0x26c820['verbose']}),_0x5e90fb=_0x1edf0a[_0x47af45(0x1f8)];return console['error'](_0x47af45(0x14a)+_0x5e90fb[_0x47af45(0x180)]+'\x20activation'+(_0x5e90fb[_0x47af45(0x180)]!==0x1?'s':'')),await handleSDKOutput(_0x5e90fb,_0x26c820),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a30_0x4f6ce0(0x165);['description']=a30_0x4f6ce0(0x17c);[a30_0x4f6ce0(0x225)]=new SegmentPushCommand();async['execute'](_0x11d97d){const _0x3e47fb=a30_0x4f6ce0,_0x1c9ccf=_0x11d97d[_0x3e47fb(0x1ca)][0x0];let _0x475895;if(_0x1c9ccf){const _0x134610=await resolveTarget({'arg':_0x1c9ccf,'contextParent':_0x11d97d['options'][_0x3e47fb(0x10b)],'cwd':process[_0x3e47fb(0x133)]()});isSuccessfulResolution(_0x134610)&&_0x134610[_0x3e47fb(0x160)]===_0x3e47fb(0x11a)&&(_0x475895=_0x134610['filePath']);}const _0x120f0d={..._0x11d97d,'options':{..._0x11d97d[_0x3e47fb(0x14d)],'journeysOnly':!![],..._0x475895&&{'singleFilePath':_0x475895}}};return this[_0x3e47fb(0x225)][_0x3e47fb(0x237)](_0x120f0d);}}export class JourneyVersionsCommand extends BaseCommand{[a30_0x4f6ce0(0x234)]=a30_0x4f6ce0(0x175);['description']=a30_0x4f6ce0(0x222);async[a30_0x4f6ce0(0x237)](_0x2b53f4){const _0x4e98ad=a30_0x4f6ce0,{options:_0xaccfdf,args:_0x500fac,tdx:_0x4e723d}=_0x2b53f4,_0x24e9ee=_0x500fac[0x0];if(!requireNameOrPath(_0x24e9ee))return 0x1;if(_0xaccfdf['verbose'])console['error'](_0x4e98ad(0x125)+_0x24e9ee);const {journeyId:_0x2ee0ea}=await resolveJourneyIdFromInput(_0x24e9ee,_0xaccfdf,_0x4e723d),_0x261ef4=await withSpinner(_0x4e98ad(0x1ae),()=>_0x4e723d['journey'][_0x4e98ad(0x1d8)](_0x2ee0ea),{'verbose':_0xaccfdf[_0x4e98ad(0x16d)]}),{bundleName:_0x3df3d2,versions:_0x2ddb92,latestJourneyId:_0x47a800}=_0x261ef4[_0x4e98ad(0x1f8)];console[_0x4e98ad(0x194)](_0x3df3d2+':\x20'+_0x2ddb92[_0x4e98ad(0x180)]+_0x4e98ad(0x139)+(_0x2ddb92['length']!==0x1?'s':''));const _0x1db81b=_0x2ddb92['map'](_0x5485cc=>({'version':_0x5485cc[_0x4e98ad(0x163)],'journey_id':_0x5485cc[_0x4e98ad(0x16c)],'name':_0x5485cc[_0x4e98ad(0x234)],'state':_0x5485cc[_0x4e98ad(0x1e2)],'paused':_0x5485cc['paused'],'latest':_0x5485cc['journeyId']===_0x47a800,'created_at':_0x5485cc[_0x4e98ad(0x1c2)]}));return await handleSDKOutput(_0x1db81b,_0xaccfdf),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a30_0x4f6ce0(0x115);[a30_0x4f6ce0(0x217)]=a30_0x4f6ce0(0x153);async[a30_0x4f6ce0(0x237)](_0x8ba3fd){const _0xc1f1d0=a30_0x4f6ce0,{options:_0x5c40f1,args:_0x6edae2,tdx:_0x39b86b}=_0x8ba3fd,_0x2e7534=_0x6edae2[0x0];if(!requireNameOrPath(_0x2e7534))return 0x1;if(_0x5c40f1[_0xc1f1d0(0x16d)])console[_0xc1f1d0(0x194)](_0xc1f1d0(0x125)+_0x2e7534);const {journeyId:_0x1a0791,journeyName:_0x520ca5}=await resolveJourneyIdFromInput(_0x2e7534,_0x5c40f1,_0x39b86b);if(!_0x5c40f1[_0xc1f1d0(0x19d)]){const _0x480e08=await confirm(_0xc1f1d0(0x159)+_0x520ca5+'\x22?');if(!_0x480e08)return console[_0xc1f1d0(0x194)](_0xc1f1d0(0x156)),0x0;}const _0x23c766=await withSpinner(_0xc1f1d0(0x1ef),()=>_0x39b86b[_0xc1f1d0(0x117)][_0xc1f1d0(0x1fb)](_0x1a0791),{'verbose':_0x5c40f1[_0xc1f1d0(0x16d)]}),_0x2bf99d=_0x23c766[_0xc1f1d0(0x1f8)];return console['error'](a30_0x1af5e5[_0xc1f1d0(0x192)]('\u2714')+_0xc1f1d0(0x200)+_0x2bf99d['attributes'][_0xc1f1d0(0x163)]+'\x20(draft)\x20—\x20\x22'+_0x2bf99d[_0xc1f1d0(0x198)]['name']+'\x22'),console[_0xc1f1d0(0x194)](_0xc1f1d0(0x20f)+_0x2bf99d['id']),await handleSingleObjectOutput({'id':_0x2bf99d['id'],'name':_0x2bf99d[_0xc1f1d0(0x198)][_0xc1f1d0(0x234)],'version':_0x2bf99d[_0xc1f1d0(0x198)][_0xc1f1d0(0x163)],'state':_0x2bf99d['attributes'][_0xc1f1d0(0x1e2)],'bundle_id':_0x2bf99d[_0xc1f1d0(0x198)][_0xc1f1d0(0x1b1)],'created_at':_0x2bf99d[_0xc1f1d0(0x198)][_0xc1f1d0(0x1c2)]},_0x5c40f1),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a30_0x4f6ce0(0x1aa);[a30_0x4f6ce0(0x217)]=a30_0x4f6ce0(0x202);async[a30_0x4f6ce0(0x237)](_0x1ac110){const _0x19a196=a30_0x4f6ce0,{options:_0x147692,args:_0x141a8a,tdx:_0x4a63c7}=_0x1ac110,_0x5268db=_0x141a8a[0x0];if(!requireNameOrPath(_0x5268db))return 0x1;const _0x213d1d=_0x147692[_0x19a196(0x172)];if(!_0x213d1d)return console['error'](_0x19a196(0x205)),console[_0x19a196(0x194)](_0x19a196(0x1f2)),0x1;const _0x55907b=parseInt(_0x213d1d,0xa);if(isNaN(_0x55907b)||_0x55907b<0x1)return console[_0x19a196(0x194)](_0x19a196(0x161)+_0x213d1d),0x1;if(_0x147692[_0x19a196(0x16d)])console[_0x19a196(0x194)](_0x19a196(0x125)+_0x5268db+_0x19a196(0x10a)+_0x55907b);const {journeyId:_0x3fac43,parentSegmentId:_0x10b9ae}=await resolveJourneyIdFromInput(_0x5268db,_0x147692,_0x4a63c7),_0xf60d50=await withSpinner(_0x19a196(0x1bf),()=>_0x4a63c7[_0x19a196(0x117)][_0x19a196(0x1d8)](_0x3fac43),{'verbose':_0x147692[_0x19a196(0x16d)]}),{versions:_0x3cb722,latestJourneyId:_0x2812ad}=_0xf60d50['data'],_0x6f59d8=_0x3cb722[_0x19a196(0x170)](_0x440f0d=>_0x440f0d[_0x19a196(0x163)]===_0x55907b);if(!_0x6f59d8){const _0x5fe6ec=_0x3cb722[_0x19a196(0x164)](_0xebab2f=>'v'+_0xebab2f[_0x19a196(0x163)])[_0x19a196(0x235)](',\x20');return console[_0x19a196(0x194)](_0x19a196(0x1b2)+_0x55907b+_0x19a196(0x203)+_0x5fe6ec),0x1;}const _0x3fc28b=await withSpinner(_0x19a196(0x11d)+_0x55907b+_0x19a196(0x1d3),()=>_0x4a63c7[_0x19a196(0x117)]['getJourney'](_0x6f59d8['journeyId']),{'verbose':_0x147692[_0x19a196(0x16d)]}),_0x2bd9e9=_0x3fc28b[_0x19a196(0x1f8)],_0x3723c8=getConsoleNextUrl(_0x147692['site'],_0x19a196(0x111)+_0x10b9ae+_0x19a196(0x13e)+_0x6f59d8[_0x19a196(0x16c)]+_0x19a196(0x13c));return await handleSingleObjectOutput({'id':_0x2bd9e9['id'],'name':_0x2bd9e9['attributes'][_0x19a196(0x234)],'version':_0x2bd9e9['attributes'][_0x19a196(0x163)],'description':_0x2bd9e9['attributes'][_0x19a196(0x217)],'state':_0x2bd9e9[_0x19a196(0x198)][_0x19a196(0x1e2)],'paused':_0x2bd9e9[_0x19a196(0x198)][_0x19a196(0x231)],'reentry_mode':_0x2bd9e9['attributes']['reentryMode'],'stages':_0x2bd9e9[_0x19a196(0x198)][_0x19a196(0x19e)]?.[_0x19a196(0x180)]||0x0,..._0x2bd9e9[_0x19a196(0x198)][_0x19a196(0x188)]&&{'goal':_0x2bd9e9[_0x19a196(0x198)][_0x19a196(0x188)][_0x19a196(0x234)]},'latest':_0x6f59d8[_0x19a196(0x16c)]===_0x2812ad,'created_at':_0x2bd9e9['attributes'][_0x19a196(0x1c2)],'updated_at':_0x2bd9e9[_0x19a196(0x198)][_0x19a196(0x166)],'url':_0x3723c8},_0x147692),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x4b218b=a31_0x26f5;(function(_0x243969,_0x32dfb0){const _0x40f9cb=a31_0x26f5,_0x23e240=_0x243969();while(!![]){try{const _0x789dd1=-parseInt(_0x40f9cb(0x184))/0x1*(-parseInt(_0x40f9cb(0x166))/0x2)+parseInt(_0x40f9cb(0x173))/0x3*(parseInt(_0x40f9cb(0x16f))/0x4)+-parseInt(_0x40f9cb(0x171))/0x5*(-parseInt(_0x40f9cb(0x180))/0x6)+-parseInt(_0x40f9cb(0x159))/0x7*(parseInt(_0x40f9cb(0x160))/0x8)+-parseInt(_0x40f9cb(0x15e))/0x9*(parseInt(_0x40f9cb(0x14b))/0xa)+-parseInt(_0x40f9cb(0x15c))/0xb+-parseInt(_0x40f9cb(0x17e))/0xc;if(_0x789dd1===_0x32dfb0)break;else _0x23e240['push'](_0x23e240['shift']());}catch(_0x3b04f2){_0x23e240['push'](_0x23e240['shift']());}}}(a31_0x1b53,0x30c77));import{BaseCommand}from'./command.js';function a31_0x26f5(_0x32da3,_0x4c8383){_0x32da3=_0x32da3-0x147;const _0x1b5364=a31_0x1b53();let _0x26f5fb=_0x1b5364[_0x32da3];return _0x26f5fb;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a31_0x1b53(){const _0x546971=['warningCount','2knIQhV','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','invalidCount','errorCode','yellow','parentSegment','relativePath','Validation\x20failed:\x20','endsWith','107944yKBoeq','type','2705pYuyHq','green','42ztnyFX','log','journey:validate','filter','red','skippedCount','helpText','message','targetDir','\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','\x20segment\x20file(s)\x20skipped','2847756RAhnes','name','3780WoceeS','execute','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','232862rrdUYY','\x20error(s)','\x20segment\x20file(s)\x20skipped)','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','cwd','10hADGxY','no_parent','filePath','\x20(skipped:\x20','verbose','Error:\x20Directory\x20not\x20found:\x20','reason','dim','description','\x20warning(s)','journey','errors','error','validCount','1358707qVfldA','cyan','valid','1464947sAqiqe','length','1683954nCZlXX','warnings','8ZfNzyW','✔\x20All\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20journey(s)\x20valid','.yaml'];a31_0x1b53=function(){return _0x546971;};return a31_0x1b53();}import{existsSync}from'fs';import a31_0x6eebc6 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a31_0x4b218b(0x17f)]=a31_0x4b218b(0x175);[a31_0x4b218b(0x153)]='Validate\x20journey\x20YAML\x20files';async[a31_0x4b218b(0x181)](_0x5e3d6c){const _0x51f5cc=a31_0x4b218b,{options:_0x82c13b,args:_0x3b1e97}=_0x5e3d6c,_0x324530=_0x82c13b,_0xb09da8=await resolveTarget({'arg':_0x3b1e97[0x0],'contextParent':_0x82c13b[_0x51f5cc(0x16b)],'cwd':process[_0x51f5cc(0x14a)]()});if(!isSuccessfulResolution(_0xb09da8))return _0xb09da8[_0x51f5cc(0x169)]===_0x51f5cc(0x14c)?(console[_0x51f5cc(0x157)](a31_0x6eebc6[_0x51f5cc(0x16a)](_0x51f5cc(0x162))),console[_0x51f5cc(0x157)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x51f5cc(0x157)](_0x51f5cc(0x17c)),console[_0x51f5cc(0x157)](_0x51f5cc(0x183))):(console[_0x51f5cc(0x157)](a31_0x6eebc6['red'](_0x51f5cc(0x182)+_0xb09da8[_0x51f5cc(0x17a)]+'\x0a')),_0xb09da8['helpText']&&console['error'](a31_0x6eebc6[_0x51f5cc(0x15a)](_0xb09da8[_0x51f5cc(0x179)]))),0x1;const _0x20bde0=_0xb09da8[_0x51f5cc(0x17b)],_0x17c624=_0xb09da8[_0x51f5cc(0x170)]==='file'?_0xb09da8[_0x51f5cc(0x14d)]:undefined;if(!_0x17c624&&!existsSync(_0x20bde0))return console[_0x51f5cc(0x157)](a31_0x6eebc6[_0x51f5cc(0x177)](_0x51f5cc(0x150)+_0x20bde0+'\x0a')),0x1;let _0xa76265;if(_0x17c624){if(!_0x17c624[_0x51f5cc(0x16e)]('.yml')&&!_0x17c624[_0x51f5cc(0x16e)](_0x51f5cc(0x164)))return console['error'](a31_0x6eebc6[_0x51f5cc(0x177)](_0x51f5cc(0x167)+_0x17c624+'\x0a')),0x1;_0xa76265=[_0x17c624];}else _0xa76265=findYamlFiles(_0x20bde0);if(_0xa76265[_0x51f5cc(0x15d)]===0x0)return console['error'](a31_0x6eebc6[_0x51f5cc(0x177)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x20bde0+'\x0a')),0x1;const _0x349216=validateYamlFiles(_0xa76265,_0x20bde0,{'filterType':_0x51f5cc(0x155)}),_0x5a81aa=calculateSummary(_0x349216),_0x2f882f=_0x349216[_0x51f5cc(0x176)](isValidationResult);if(_0x2f882f[_0x51f5cc(0x15d)]===0x0)return console['error'](a31_0x6eebc6['yellow'](_0x51f5cc(0x148)+_0x20bde0+'\x0a')),_0x5a81aa[_0x51f5cc(0x178)]>0x0&&console['error'](a31_0x6eebc6['dim']('('+_0x5a81aa[_0x51f5cc(0x178)]+_0x51f5cc(0x147))),0x0;for(const _0x4e8ef9 of _0x349216){if(!isValidationResult(_0x4e8ef9)){_0x324530[_0x51f5cc(0x14f)]&&console[_0x51f5cc(0x174)](a31_0x6eebc6['dim']('-\x20'+_0x4e8ef9[_0x51f5cc(0x16c)]+_0x51f5cc(0x14e)+_0x4e8ef9[_0x51f5cc(0x151)]+')'));continue;}const {relativePath:_0x17da56,source:_0x1030f3,result:_0x3e42f0}=_0x4e8ef9;if(_0x3e42f0[_0x51f5cc(0x15b)]&&_0x3e42f0['warnings'][_0x51f5cc(0x15d)]===0x0)_0x324530['verbose']&&console[_0x51f5cc(0x174)](a31_0x6eebc6[_0x51f5cc(0x172)]('✔\x20'+_0x17da56));else _0x3e42f0[_0x51f5cc(0x15b)]?(console[_0x51f5cc(0x174)](a31_0x6eebc6[_0x51f5cc(0x16a)]('⚠\x20'+_0x17da56+':\x20'+_0x3e42f0[_0x51f5cc(0x15f)][_0x51f5cc(0x15d)]+_0x51f5cc(0x154))),console[_0x51f5cc(0x174)](formatValidationResult(_0x3e42f0,_0x1030f3,_0x17da56))):(console[_0x51f5cc(0x174)](a31_0x6eebc6[_0x51f5cc(0x177)]('✖\x20'+_0x17da56+':\x20'+_0x3e42f0[_0x51f5cc(0x156)][_0x51f5cc(0x15d)]+_0x51f5cc(0x185))),console[_0x51f5cc(0x174)](formatValidationResult(_0x3e42f0,_0x1030f3,_0x17da56)));}return console['log'](''),_0x5a81aa['hasErrors']?(console['log'](a31_0x6eebc6[_0x51f5cc(0x177)](_0x51f5cc(0x16d)+_0x5a81aa[_0x51f5cc(0x168)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x5a81aa[_0x51f5cc(0x158)]+'\x20valid')),_0x5a81aa[_0x51f5cc(0x165)]>0x0&&console[_0x51f5cc(0x174)](a31_0x6eebc6['yellow'](_0x5a81aa[_0x51f5cc(0x165)]+_0x51f5cc(0x149))),_0x5a81aa[_0x51f5cc(0x178)]>0x0&&console[_0x51f5cc(0x174)](a31_0x6eebc6[_0x51f5cc(0x152)](_0x5a81aa['skippedCount']+_0x51f5cc(0x17d))),0x1):(console[_0x51f5cc(0x174)](a31_0x6eebc6[_0x51f5cc(0x172)](_0x51f5cc(0x161)+_0x5a81aa[_0x51f5cc(0x158)]+_0x51f5cc(0x163))),_0x5a81aa['warningCount']>0x0&&console[_0x51f5cc(0x174)](a31_0x6eebc6[_0x51f5cc(0x16a)](_0x5a81aa[_0x51f5cc(0x165)]+_0x51f5cc(0x149))),_0x5a81aa[_0x51f5cc(0x178)]>0x0&&console[_0x51f5cc(0x174)](a31_0x6eebc6[_0x51f5cc(0x152)](_0x5a81aa[_0x51f5cc(0x178)]+_0x51f5cc(0x17d))),0x0);}}
|