@treasuredata/tdx 2026.7.0 → 2026.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-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/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.d.ts +1 -0
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x23c0b6=a24_0x3501;(function(_0x3f2cd6,_0x58e246){const _0x1552a0=a24_0x3501,_0x22db00=_0x3f2cd6();while(!![]){try{const _0x45da4=-parseInt(_0x1552a0(0xf9))/0x1+-parseInt(_0x1552a0(0x111))/0x2+parseInt(_0x1552a0(0x121))/0x3*(-parseInt(_0x1552a0(0x113))/0x4)+-parseInt(_0x1552a0(0x11e))/0x5*(-parseInt(_0x1552a0(0x13a))/0x6)+-parseInt(_0x1552a0(0x106))/0x7*(-parseInt(_0x1552a0(0xf3))/0x8)+-parseInt(_0x1552a0(0x122))/0x9*(parseInt(_0x1552a0(0x136))/0xa)+parseInt(_0x1552a0(0x110))/0xb;if(_0x45da4===_0x58e246)break;else _0x22db00['push'](_0x22db00['shift']());}catch(_0x4c67ae){_0x22db00['push'](_0x22db00['shift']());}}}(a24_0x40da,0xef543));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a24_0x3501(_0x34431b,_0xae63a5){_0x34431b=_0x34431b-0xf1;const _0x40dae8=a24_0x40da();let _0x3501c8=_0x40dae8[_0x34431b];return _0x3501c8;}import{isYamlFile}from'../sdk/segment/file-discovery.js';function a24_0x40da(){const _0x2f690e=['cyan','update','configDir','created','templateId','session','Found\x20','2470DkeZSL','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\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)','\x27...','191610VjthOG','Resolving\x20references...','Push\x20','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','8AsWuQu','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20templates?','Workspace\x20is\x20required.','✔\x20All\x20templates\x20are\x20up\x20to\x20date','1\x20template\x20file:\x20','474013eWRYmL','error','filter','Aborted.','resolveWorkspaceId','action','path','\x20template\x20files','errors','✔\x20Created\x20','description','green','engage_workspace','8074941GRNqwY','yellow','resolve','engage','def','dim','\x0aValidation\x20errors\x20in\x20','name','length','\x20errors:','40222985WpWmqY','1541846CRuDnC','Preparing\x20push\x20to\x20workspace\x20\x27','4732pQDNbc','red','site','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x20templates','config','warnings','\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','dryRun','dirname','10ytlzVz','updated','Pushing\x20templates...','2607JPDqPb','59058UFpgDq','setPhase','verbose','message','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','-\x20no\x20changes\x20applied','yes','\x0aPush\x20summary\x20for\x20workspace\x20\x27','data','workspace','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20'];a24_0x40da=function(){return _0x2f690e;};return a24_0x40da();}import a24_0x2024ca from'chalk';import a24_0x91b8c9 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{[a24_0x23c0b6(0x10d)]='engage:template:push';[a24_0x23c0b6(0x103)]=a24_0x23c0b6(0x126);async[a24_0x23c0b6(0x12c)](_0x362101){const _0x1d5d4c=a24_0x23c0b6,{options:_0x3dea83,args:_0x4c5286,tdx:_0x3e2b5a}=_0x362101,_0x1be4a5=_0x3dea83,_0x56017c=_0x4c5286[0x0],_0x4ece5e=_0x56017c?a24_0x91b8c9[_0x1d5d4c(0x108)](_0x56017c):undefined,_0x1426a0=_0x4ece5e?isYamlFile(_0x4ece5e):![];let _0x767b07;if(_0x1426a0&&_0x4ece5e)_0x767b07=a24_0x91b8c9[_0x1d5d4c(0x11d)](_0x4ece5e);else _0x4ece5e?_0x767b07=_0x4ece5e:_0x767b07=process['cwd']();let _0x42db31;const _0x4dd1d8=tryFindTdxConfig(_0x767b07);_0x4dd1d8?.[_0x1d5d4c(0x119)]['engage_workspace']&&(_0x42db31=_0x4dd1d8[_0x1d5d4c(0x119)][_0x1d5d4c(0x105)],!_0x1426a0&&(_0x767b07=_0x4dd1d8[_0x1d5d4c(0x131)]));_0x1be4a5['workspace']&&(_0x42db31=_0x1be4a5[_0x1d5d4c(0x12b)]);if(!_0x42db31){const _0x101a7d=loadSessionContext(_0x1be4a5['session']);_0x101a7d?.[_0x1d5d4c(0x105)]&&(_0x42db31=_0x101a7d[_0x1d5d4c(0x105)]);}if(!_0x42db31)return console[_0x1d5d4c(0xfa)](a24_0x2024ca[_0x1d5d4c(0x107)](_0x1d5d4c(0xf6))),console[_0x1d5d4c(0xfa)](_0x1d5d4c(0x11b)),console[_0x1d5d4c(0xfa)](_0x1d5d4c(0x138)),console['error']('\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'),console[_0x1d5d4c(0xfa)](_0x1d5d4c(0x117)),0x1;let _0x19e0e6;_0x1426a0&&_0x4ece5e?_0x19e0e6=[parseTemplateFile(_0x4ece5e,a24_0x91b8c9[_0x1d5d4c(0x11d)](_0x4ece5e))]:_0x19e0e6=discoverAndParseTemplateFiles(_0x767b07);if(_0x19e0e6[_0x1d5d4c(0x10e)]===0x0)return console[_0x1d5d4c(0xfa)](a24_0x2024ca[_0x1d5d4c(0x107)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x767b07)),console[_0x1d5d4c(0xfa)](a24_0x2024ca['dim'](_0x1d5d4c(0xf2))),0x1;const _0x196a7b=_0x19e0e6[_0x1d5d4c(0x10e)]===0x1?_0x1d5d4c(0xf8)+_0x19e0e6[0x0]['def']['name']:_0x19e0e6['length']+_0x1d5d4c(0x100);console[_0x1d5d4c(0xfa)](_0x1d5d4c(0x135)+a24_0x2024ca[_0x1d5d4c(0x12f)](_0x196a7b));let _0x1146a5=![];for(const _0x1b6620 of _0x19e0e6){const _0x5286c5=validateTemplateDef(_0x1b6620[_0x1d5d4c(0x10a)]);if(!_0x5286c5['valid']){_0x1146a5=!![],console['error'](a24_0x2024ca[_0x1d5d4c(0x114)](_0x1d5d4c(0x10c)+_0x1b6620['relativePath']+':'));for(const _0x12e537 of _0x5286c5[_0x1d5d4c(0x101)]){console[_0x1d5d4c(0xfa)]('\x20\x20'+a24_0x2024ca[_0x1d5d4c(0x114)]('✗')+'\x20'+_0x12e537[_0x1d5d4c(0xff)]+':\x20'+_0x12e537[_0x1d5d4c(0x125)]);}}for(const _0x9f7195 of _0x5286c5[_0x1d5d4c(0x11a)]){console['error']('\x20\x20'+a24_0x2024ca[_0x1d5d4c(0x107)]('⚠')+'\x20'+_0x9f7195[_0x1d5d4c(0xff)]+':\x20'+_0x9f7195[_0x1d5d4c(0x125)]);}}if(_0x1146a5)return console['error'](a24_0x2024ca[_0x1d5d4c(0x114)](_0x1d5d4c(0x116))),0x1;const _0x54ba26=await _0x3e2b5a[_0x1d5d4c(0x109)][_0x1d5d4c(0xfd)](_0x42db31),_0x89ca77=await withProgressSpinner(_0x1d5d4c(0x112)+_0x42db31+_0x1d5d4c(0x139),_0x44c760=>preparePush({'engage':_0x3e2b5a[_0x1d5d4c(0x109)]},_0x19e0e6,_0x54ba26,{'progress':{'update':_0x425c4b=>_0x44c760[_0x1d5d4c(0x123)](_0x425c4b)}}),{'verbose':_0x1be4a5[_0x1d5d4c(0x124)]}),_0x13e734=_0x89ca77[_0x1d5d4c(0x12a)];await withProgressSpinner(_0x1d5d4c(0x13b),_0x31478b=>resolveAndBuildInputs({'engage':_0x3e2b5a['engage']},_0x13e734,_0x54ba26,{'progress':{'update':_0x58c5d2=>_0x31478b[_0x1d5d4c(0x123)](_0x58c5d2)}}),{'verbose':_0x1be4a5[_0x1d5d4c(0x124)]});const _0x319b8a=_0x13e734[_0x1d5d4c(0xfb)](_0x1d6396=>_0x1d6396[_0x1d5d4c(0xfe)]==='create'),_0x54573c=_0x13e734[_0x1d5d4c(0xfb)](_0x181f7c=>_0x181f7c[_0x1d5d4c(0xfe)]===_0x1d5d4c(0x130));console[_0x1d5d4c(0xfa)](_0x1d5d4c(0x129)+_0x42db31+'\x27:');if(_0x319b8a[_0x1d5d4c(0x10e)]>0x0){console[_0x1d5d4c(0xfa)]('\x20\x20'+a24_0x2024ca[_0x1d5d4c(0x104)]('+\x20'+_0x319b8a[_0x1d5d4c(0x10e)]+'\x20new\x20templates:'));for(const _0x10ccb4 of _0x319b8a){console[_0x1d5d4c(0xfa)](_0x1d5d4c(0x12e)+a24_0x2024ca[_0x1d5d4c(0x104)]('+')+'\x20'+_0x10ccb4['def'][_0x1d5d4c(0x10d)]);}}if(_0x54573c[_0x1d5d4c(0x10e)]>0x0){console[_0x1d5d4c(0xfa)]('\x20\x20'+a24_0x2024ca[_0x1d5d4c(0x107)]('~\x20'+_0x54573c[_0x1d5d4c(0x10e)]+'\x20templates\x20to\x20update:'));for(const _0x4f6eb8 of _0x54573c){console[_0x1d5d4c(0xfa)](_0x1d5d4c(0x12e)+a24_0x2024ca['yellow']('~')+'\x20'+_0x4f6eb8[_0x1d5d4c(0x10a)][_0x1d5d4c(0x10d)]);}}if(_0x319b8a['length']===0x0&&_0x54573c[_0x1d5d4c(0x10e)]===0x0)return console[_0x1d5d4c(0xfa)](a24_0x2024ca[_0x1d5d4c(0x104)](_0x1d5d4c(0xf7))),0x0;if(_0x1be4a5[_0x1d5d4c(0x11c)])return console[_0x1d5d4c(0xfa)](a24_0x2024ca[_0x1d5d4c(0x107)](_0x1d5d4c(0x137))),0x0;if(!_0x1be4a5[_0x1d5d4c(0x128)]){if(!isInteractive())return console[_0x1d5d4c(0xfa)](a24_0x2024ca[_0x1d5d4c(0x114)]('\x0aError:'),_0x1d5d4c(0x12d)),console[_0x1d5d4c(0xfa)](a24_0x2024ca[_0x1d5d4c(0x10b)](_0x1d5d4c(0xf4))),0x1;const _0x3773f0=await confirmKey(_0x1d5d4c(0xf1)+(_0x319b8a['length']+_0x54573c[_0x1d5d4c(0x10e)])+_0x1d5d4c(0xf5));if(!_0x3773f0)return console[_0x1d5d4c(0xfa)](a24_0x2024ca[_0x1d5d4c(0x107)](_0x1d5d4c(0xfc)),_0x1d5d4c(0x127)),0x1;}const _0x56ef8a=await withProgressSpinner(_0x1d5d4c(0x120),_0x480aeb=>executePush({'engage':_0x3e2b5a[_0x1d5d4c(0x109)]},_0x13e734,{'progress':{'update':_0x38985b=>_0x480aeb[_0x1d5d4c(0x123)](_0x38985b)}}),{'verbose':_0x1be4a5[_0x1d5d4c(0x124)]}),_0xc3ed2e=_0x56ef8a['data'];for(const _0x5727ea of _0xc3ed2e['results']){if(_0x5727ea[_0x1d5d4c(0x133)]&&(_0x5727ea[_0x1d5d4c(0xfe)]===_0x1d5d4c(0x132)||_0x5727ea[_0x1d5d4c(0xfe)]==='updated')){const _0x1adab3=getTemplateUrl(_0x1be4a5[_0x1d5d4c(0x115)],_0x54ba26,_0x5727ea['templateId']),_0x1eefab=_0x5727ea[_0x1d5d4c(0xfe)]===_0x1d5d4c(0x132)?'+':'~',_0xfa2377=_0x5727ea[_0x1d5d4c(0xfe)]==='created'?a24_0x2024ca[_0x1d5d4c(0x104)](_0x1eefab):a24_0x2024ca[_0x1d5d4c(0x107)](_0x1eefab);console[_0x1d5d4c(0xfa)]('\x20\x20'+_0xfa2377+'\x20'+hyperlink(_0x5727ea[_0x1d5d4c(0x10d)],_0x1adab3)+'\x20'+a24_0x2024ca['dim'](_0x1adab3));}}_0xc3ed2e['created']>0x0&&console[_0x1d5d4c(0xfa)](a24_0x2024ca[_0x1d5d4c(0x104)](_0x1d5d4c(0x102)+_0xc3ed2e[_0x1d5d4c(0x132)]+_0x1d5d4c(0x118)));_0xc3ed2e['updated']>0x0&&console['error'](a24_0x2024ca[_0x1d5d4c(0x104)]('✔\x20Updated\x20'+_0xc3ed2e[_0x1d5d4c(0x11f)]+_0x1d5d4c(0x118)));if(_0xc3ed2e[_0x1d5d4c(0x101)]['length']>0x0){console['error'](a24_0x2024ca[_0x1d5d4c(0x114)]('✘\x20'+_0xc3ed2e[_0x1d5d4c(0x101)][_0x1d5d4c(0x10e)]+_0x1d5d4c(0x10f)));for(const _0x22bfcf of _0xc3ed2e[_0x1d5d4c(0x101)]){console[_0x1d5d4c(0xfa)]('\x20\x20'+a24_0x2024ca[_0x1d5d4c(0x114)](_0x22bfcf[_0x1d5d4c(0x10d)])+':\x20'+_0x22bfcf[_0x1d5d4c(0xfa)]);}}return saveSessionContext({'engage_workspace':_0x42db31},_0x1be4a5[_0x1d5d4c(0x134)]),_0xc3ed2e[_0x1d5d4c(0x101)][_0x1d5d4c(0x10e)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a24_0x3b12c3=a24_0x1fc0;(function(_0x2a35dc,_0x12aee8){const _0x211af5=a24_0x1fc0,_0x5748b7=_0x2a35dc();while(!![]){try{const _0x524fc3=-parseInt(_0x211af5(0xe7))/0x1*(-parseInt(_0x211af5(0xe9))/0x2)+parseInt(_0x211af5(0xbc))/0x3*(-parseInt(_0x211af5(0xca))/0x4)+-parseInt(_0x211af5(0xb6))/0x5+parseInt(_0x211af5(0xd3))/0x6+-parseInt(_0x211af5(0xe2))/0x7+-parseInt(_0x211af5(0xeb))/0x8*(-parseInt(_0x211af5(0xb7))/0x9)+-parseInt(_0x211af5(0xb8))/0xa;if(_0x524fc3===_0x12aee8)break;else _0x5748b7['push'](_0x5748b7['shift']());}catch(_0x14412e){_0x5748b7['push'](_0x5748b7['shift']());}}}(a24_0x4ed1,0x9e5ae));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a24_0x1fc0(_0x229562,_0xb56d0){_0x229562=_0x229562-0xb4;const _0x4ed1e3=a24_0x4ed1();let _0x1fc01f=_0x4ed1e3[_0x229562];return _0x1fc01f;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x77464b from'chalk';import a24_0x23d290 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 a24_0x4ed1(){const _0x395189=['761QQJVHV','\x20templates?','2498cnOIig','create','40cCzOAN','name','action','verbose','execute','resolve','yes','\x27...','\x20\x20\x20\x20','filter','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','yellow','green','site','685285QJqePN','1609677TsofAH','11961980CsYtSh','Workspace\x20is\x20required.','engage:template:push','dryRun','99183nDtCly','setPhase','red','Pushing\x20templates...','length','updated','Found\x20','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','engage_workspace','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20template\x20files','Aborted.','dirname','workspace','16qClsGq','warnings','\x20templates','\x20new\x20templates:','cyan','dim','1\x20template\x20file:\x20','templateId','errors','3417600MhUirx','engage','message','data','cwd','-\x20no\x20changes\x20applied','created','\x0aError:','session','configDir','update','relativePath','def','description','✔\x20Created\x20','2101631xgVJeZ','config','error','\x20templates\x20to\x20update:','valid'];a24_0x4ed1=function(){return _0x395189;};return a24_0x4ed1();}export class EngageTemplatePushCommand extends BaseCommand{[a24_0x3b12c3(0xec)]=a24_0x3b12c3(0xba);[a24_0x3b12c3(0xe0)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x3b12c3(0xef)](_0x2890f0){const _0x67ed97=a24_0x3b12c3,{options:_0x348305,args:_0x4d10a9,tdx:_0x4302fc}=_0x2890f0,_0x14a482=_0x348305,_0x390a8f=_0x4d10a9[0x0],_0x25b41f=_0x390a8f?a24_0x23d290[_0x67ed97(0xf0)](_0x390a8f):undefined,_0x562bbf=_0x25b41f?isYamlFile(_0x25b41f):![];let _0x49dbaa;if(_0x562bbf&&_0x25b41f)_0x49dbaa=a24_0x23d290[_0x67ed97(0xc8)](_0x25b41f);else _0x25b41f?_0x49dbaa=_0x25b41f:_0x49dbaa=process[_0x67ed97(0xd7)]();let _0x4451f3;const _0x492d65=tryFindTdxConfig(_0x49dbaa);_0x492d65?.[_0x67ed97(0xe3)]['engage_workspace']&&(_0x4451f3=_0x492d65[_0x67ed97(0xe3)][_0x67ed97(0xc4)],!_0x562bbf&&(_0x49dbaa=_0x492d65[_0x67ed97(0xdc)]));_0x14a482[_0x67ed97(0xc9)]&&(_0x4451f3=_0x14a482[_0x67ed97(0xc9)]);if(!_0x4451f3){const _0x5dcd08=loadSessionContext(_0x14a482[_0x67ed97(0xdb)]);_0x5dcd08?.[_0x67ed97(0xc4)]&&(_0x4451f3=_0x5dcd08[_0x67ed97(0xc4)]);}if(!_0x4451f3)return console[_0x67ed97(0xe4)](a24_0x77464b[_0x67ed97(0xf6)](_0x67ed97(0xb9))),console[_0x67ed97(0xe4)]('\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['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console[_0x67ed97(0xe4)]('\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'),console['error']('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x231804;_0x562bbf&&_0x25b41f?_0x231804=[parseTemplateFile(_0x25b41f,a24_0x23d290[_0x67ed97(0xc8)](_0x25b41f))]:_0x231804=discoverAndParseTemplateFiles(_0x49dbaa);if(_0x231804[_0x67ed97(0xc0)]===0x0)return console['error'](a24_0x77464b[_0x67ed97(0xf6)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x49dbaa)),console[_0x67ed97(0xe4)](a24_0x77464b[_0x67ed97(0xcf)]('Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.')),0x1;const _0x151ce8=_0x231804[_0x67ed97(0xc0)]===0x1?_0x67ed97(0xd0)+_0x231804[0x0][_0x67ed97(0xdf)][_0x67ed97(0xec)]:_0x231804[_0x67ed97(0xc0)]+_0x67ed97(0xc6);console[_0x67ed97(0xe4)](_0x67ed97(0xc2)+a24_0x77464b[_0x67ed97(0xce)](_0x151ce8));let _0x39a87a=![];for(const _0x2d9dff of _0x231804){const _0x30d3d9=validateTemplateDef(_0x2d9dff[_0x67ed97(0xdf)]);if(!_0x30d3d9[_0x67ed97(0xe6)]){_0x39a87a=!![],console['error'](a24_0x77464b[_0x67ed97(0xbe)]('\x0aValidation\x20errors\x20in\x20'+_0x2d9dff[_0x67ed97(0xde)]+':'));for(const _0x4615a1 of _0x30d3d9['errors']){console[_0x67ed97(0xe4)]('\x20\x20'+a24_0x77464b[_0x67ed97(0xbe)]('✗')+'\x20'+_0x4615a1['path']+':\x20'+_0x4615a1[_0x67ed97(0xd5)]);}}for(const _0xb439ec of _0x30d3d9[_0x67ed97(0xcb)]){console[_0x67ed97(0xe4)]('\x20\x20'+a24_0x77464b[_0x67ed97(0xf6)]('⚠')+'\x20'+_0xb439ec['path']+':\x20'+_0xb439ec[_0x67ed97(0xd5)]);}}if(_0x39a87a)return console[_0x67ed97(0xe4)](a24_0x77464b[_0x67ed97(0xbe)](_0x67ed97(0xc3))),0x1;const _0x461f52=await _0x4302fc[_0x67ed97(0xd4)]['resolveWorkspaceId'](_0x4451f3),_0xbf7677=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x4451f3+_0x67ed97(0xf2),_0x4d3467=>preparePush({'engage':_0x4302fc[_0x67ed97(0xd4)]},_0x231804,_0x461f52,{'progress':{'update':_0x2d22dd=>_0x4d3467['setPhase'](_0x2d22dd)}}),{'verbose':_0x14a482[_0x67ed97(0xee)]}),_0x296480=_0xbf7677['data'];await withProgressSpinner('Resolving\x20references...',_0x6ad1f9=>resolveAndBuildInputs({'engage':_0x4302fc[_0x67ed97(0xd4)]},_0x296480,_0x461f52,{'progress':{'update':_0x34bc1b=>_0x6ad1f9['setPhase'](_0x34bc1b)}}),{'verbose':_0x14a482[_0x67ed97(0xee)]});const _0x4d58be=_0x296480['filter'](_0x1dfcf0=>_0x1dfcf0[_0x67ed97(0xed)]===_0x67ed97(0xea)),_0x5573ed=_0x296480[_0x67ed97(0xf4)](_0x2229c8=>_0x2229c8[_0x67ed97(0xed)]===_0x67ed97(0xdd));console[_0x67ed97(0xe4)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x4451f3+'\x27:');if(_0x4d58be[_0x67ed97(0xc0)]>0x0){console[_0x67ed97(0xe4)]('\x20\x20'+a24_0x77464b[_0x67ed97(0xb4)]('+\x20'+_0x4d58be[_0x67ed97(0xc0)]+_0x67ed97(0xcd)));for(const _0x1b5583 of _0x4d58be){console[_0x67ed97(0xe4)](_0x67ed97(0xf3)+a24_0x77464b[_0x67ed97(0xb4)]('+')+'\x20'+_0x1b5583['def']['name']);}}if(_0x5573ed[_0x67ed97(0xc0)]>0x0){console[_0x67ed97(0xe4)]('\x20\x20'+a24_0x77464b['yellow']('~\x20'+_0x5573ed[_0x67ed97(0xc0)]+_0x67ed97(0xe5)));for(const _0x1402bf of _0x5573ed){console[_0x67ed97(0xe4)]('\x20\x20\x20\x20'+a24_0x77464b[_0x67ed97(0xf6)]('~')+'\x20'+_0x1402bf[_0x67ed97(0xdf)]['name']);}}if(_0x4d58be[_0x67ed97(0xc0)]===0x0&&_0x5573ed[_0x67ed97(0xc0)]===0x0)return console[_0x67ed97(0xe4)](a24_0x77464b[_0x67ed97(0xb4)]('\u2714\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x14a482[_0x67ed97(0xbb)])return console['error'](a24_0x77464b[_0x67ed97(0xf6)](_0x67ed97(0xf5))),0x0;if(!_0x14a482[_0x67ed97(0xf1)]){if(!isInteractive())return console['error'](a24_0x77464b[_0x67ed97(0xbe)](_0x67ed97(0xda)),_0x67ed97(0xc5)),console[_0x67ed97(0xe4)](a24_0x77464b[_0x67ed97(0xcf)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1eb086=await confirmKey('Push\x20'+(_0x4d58be[_0x67ed97(0xc0)]+_0x5573ed[_0x67ed97(0xc0)])+_0x67ed97(0xe8));if(!_0x1eb086)return console['error'](a24_0x77464b[_0x67ed97(0xf6)](_0x67ed97(0xc7)),_0x67ed97(0xd8)),0x1;}const _0x3f7bb3=await withProgressSpinner(_0x67ed97(0xbf),_0x3b472b=>executePush({'engage':_0x4302fc[_0x67ed97(0xd4)]},_0x296480,{'progress':{'update':_0x14f2ec=>_0x3b472b[_0x67ed97(0xbd)](_0x14f2ec)}}),{'verbose':_0x14a482[_0x67ed97(0xee)]}),_0x383e93=_0x3f7bb3[_0x67ed97(0xd6)];for(const _0x261e39 of _0x383e93['results']){if(_0x261e39[_0x67ed97(0xd1)]&&(_0x261e39[_0x67ed97(0xed)]===_0x67ed97(0xd9)||_0x261e39['action']===_0x67ed97(0xc1))){const _0x1a2ef3=getTemplateUrl(_0x14a482[_0x67ed97(0xb5)],_0x461f52,_0x261e39[_0x67ed97(0xd1)]),_0x56baef=_0x261e39['action']==='created'?'+':'~',_0x5c0918=_0x261e39[_0x67ed97(0xed)]===_0x67ed97(0xd9)?a24_0x77464b[_0x67ed97(0xb4)](_0x56baef):a24_0x77464b[_0x67ed97(0xf6)](_0x56baef);console[_0x67ed97(0xe4)]('\x20\x20'+_0x5c0918+'\x20'+hyperlink(_0x261e39[_0x67ed97(0xec)],_0x1a2ef3)+'\x20'+a24_0x77464b[_0x67ed97(0xcf)](_0x1a2ef3));}}_0x383e93[_0x67ed97(0xd9)]>0x0&&console[_0x67ed97(0xe4)](a24_0x77464b[_0x67ed97(0xb4)](_0x67ed97(0xe1)+_0x383e93['created']+'\x20templates'));_0x383e93[_0x67ed97(0xc1)]>0x0&&console[_0x67ed97(0xe4)](a24_0x77464b['green']('✔\x20Updated\x20'+_0x383e93[_0x67ed97(0xc1)]+_0x67ed97(0xcc)));if(_0x383e93[_0x67ed97(0xd2)][_0x67ed97(0xc0)]>0x0){console[_0x67ed97(0xe4)](a24_0x77464b[_0x67ed97(0xbe)]('✘\x20'+_0x383e93['errors'][_0x67ed97(0xc0)]+'\x20errors:'));for(const _0x10daa3 of _0x383e93[_0x67ed97(0xd2)]){console[_0x67ed97(0xe4)]('\x20\x20'+a24_0x77464b[_0x67ed97(0xbe)](_0x10daa3[_0x67ed97(0xec)])+':\x20'+_0x10daa3['error']);}}return saveSessionContext({'engage_workspace':_0x4451f3},_0x14a482[_0x67ed97(0xdb)]),_0x383e93[_0x67ed97(0xd2)][_0x67ed97(0xc0)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x57a8d0=a25_0x2025;function a25_0x2ea7(){const _0xe554b=['verbose','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','resolve','918570BLVdra','No\x20template\x20YAML\x20files\x20found\x20in\x20','reason','Validate\x20template\x20YAML\x20files','invalidCount','924952YDFGkR','warningCount','207455TGyMXI','name','\x20template(s)\x20with\x20errors,\x20','endsWith','dirname','warnings','length','valid','red','\x20error(s)','.yml','log','\x20warning(s)','engage:template:validate','dim','131534odAEQe','hasErrors','24VfenLM','description','\x20(skipped:\x20','yellow','\x20warning(s)\x20found','errors','4YAQhOV','\x20valid','skippedCount','\x20template(s)\x20valid','1470OjTWen','\x20non-template\x20file(s)\x20skipped','filter','3440646CZZjnk','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','15003QsQwPL','green','error','21DwpSaJ','1436912PXoAzb','execute','validCount'];a25_0x2ea7=function(){return _0xe554b;};return a25_0x2ea7();}(function(_0x1e2f81,_0x286c92){const _0x4bc3e3=a25_0x2025,_0x45665c=_0x1e2f81();while(!![]){try{const _0x5044b3=parseInt(_0x4bc3e3(0x134))/0x1*(parseInt(_0x4bc3e3(0x12c))/0x2)+-parseInt(_0x4bc3e3(0x116))/0x3+parseInt(_0x4bc3e3(0x110))/0x4+parseInt(_0x4bc3e3(0x11d))/0x5*(parseInt(_0x4bc3e3(0x12e))/0x6)+parseInt(_0x4bc3e3(0x10f))/0x7*(-parseInt(_0x4bc3e3(0x11b))/0x8)+-parseInt(_0x4bc3e3(0x13d))/0x9*(parseInt(_0x4bc3e3(0x138))/0xa)+parseInt(_0x4bc3e3(0x13b))/0xb;if(_0x5044b3===_0x286c92)break;else _0x45665c['push'](_0x45665c['shift']());}catch(_0x23abae){_0x45665c['push'](_0x45665c['shift']());}}}(a25_0x2ea7,0x318c6));function a25_0x2025(_0x2941fe,_0x1e61d3){_0x2941fe=_0x2941fe-0x10e;const _0x2ea7f6=a25_0x2ea7();let _0x20259d=_0x2ea7f6[_0x2941fe];return _0x20259d;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x27b23e from'chalk';import a25_0x43e66d from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x57a8d0(0x11e)]=a25_0x57a8d0(0x12a);[a25_0x57a8d0(0x12f)]=a25_0x57a8d0(0x119);async[a25_0x57a8d0(0x111)](_0x2a2f7a){const _0x4085a6=a25_0x57a8d0,{options:_0xd27fe9,args:_0x2bff52}=_0x2a2f7a,_0x1db272=_0xd27fe9,_0x2a1a78=_0x2bff52[0x0],_0x36d6a4=_0x2a1a78?a25_0x43e66d[_0x4085a6(0x115)](_0x2a1a78):undefined,_0xa4dd06=_0x36d6a4?isYamlFile(_0x36d6a4):![];let _0x57b257,_0x1adc42;if(_0xa4dd06&&_0x36d6a4)_0x57b257=a25_0x43e66d[_0x4085a6(0x121)](_0x36d6a4),_0x1adc42=_0x36d6a4;else _0x36d6a4?_0x57b257=_0x36d6a4:_0x57b257=process['cwd']();if(!_0x1adc42&&!existsSync(_0x57b257))return console['error'](a25_0x27b23e['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x57b257+'\x0a')),0x1;let _0x1ab048;if(_0x1adc42){if(!_0x1adc42[_0x4085a6(0x120)](_0x4085a6(0x127))&&!_0x1adc42[_0x4085a6(0x120)]('.yaml'))return console[_0x4085a6(0x10e)](a25_0x27b23e[_0x4085a6(0x125)](_0x4085a6(0x114)+_0x1adc42+'\x0a')),0x1;_0x1ab048=[_0x1adc42];}else _0x1ab048=findYamlFiles(_0x57b257);if(_0x1ab048[_0x4085a6(0x123)]===0x0)return console[_0x4085a6(0x10e)](a25_0x27b23e[_0x4085a6(0x125)](_0x4085a6(0x13c)+_0x57b257+'\x0a')),0x1;const _0x497e74=validateYamlFiles(_0x1ab048,_0x57b257,{'filterType':'template'}),_0xbef670=calculateSummary(_0x497e74),_0x103ffd=_0x497e74[_0x4085a6(0x13a)](isValidationResult);if(_0x103ffd['length']===0x0)return console['error'](a25_0x27b23e[_0x4085a6(0x131)](_0x4085a6(0x117)+_0x57b257+'\x0a')),_0xbef670[_0x4085a6(0x136)]>0x0&&console['error'](a25_0x27b23e[_0x4085a6(0x12b)]('('+_0xbef670[_0x4085a6(0x136)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x5f5c25 of _0x497e74){if(!isValidationResult(_0x5f5c25)){_0x1db272[_0x4085a6(0x113)]&&console['log'](a25_0x27b23e[_0x4085a6(0x12b)]('-\x20'+_0x5f5c25['relativePath']+_0x4085a6(0x130)+_0x5f5c25[_0x4085a6(0x118)]+')'));continue;}const {relativePath:_0x34f95e,source:_0x304998,result:_0x14ba16}=_0x5f5c25;if(_0x14ba16['valid']&&_0x14ba16[_0x4085a6(0x122)][_0x4085a6(0x123)]===0x0)_0x1db272[_0x4085a6(0x113)]&&console[_0x4085a6(0x128)](a25_0x27b23e['green']('✔\x20'+_0x34f95e));else _0x14ba16[_0x4085a6(0x124)]?(console[_0x4085a6(0x128)](a25_0x27b23e[_0x4085a6(0x131)]('⚠\x20'+_0x34f95e+':\x20'+_0x14ba16[_0x4085a6(0x122)][_0x4085a6(0x123)]+_0x4085a6(0x129))),console['log'](formatValidationResult(_0x14ba16,_0x304998,_0x34f95e))):(console[_0x4085a6(0x128)](a25_0x27b23e[_0x4085a6(0x125)]('✖\x20'+_0x34f95e+':\x20'+_0x14ba16[_0x4085a6(0x133)]['length']+_0x4085a6(0x126))),console[_0x4085a6(0x128)](formatValidationResult(_0x14ba16,_0x304998,_0x34f95e)));}return console[_0x4085a6(0x128)](''),_0xbef670[_0x4085a6(0x12d)]?(console[_0x4085a6(0x128)](a25_0x27b23e[_0x4085a6(0x125)]('Validation\x20failed:\x20'+_0xbef670[_0x4085a6(0x11a)]+_0x4085a6(0x11f)+_0xbef670['validCount']+_0x4085a6(0x135))),_0xbef670[_0x4085a6(0x11c)]>0x0&&console['log'](a25_0x27b23e[_0x4085a6(0x131)](_0xbef670[_0x4085a6(0x11c)]+'\x20warning(s)\x20found')),_0xbef670['skippedCount']>0x0&&console[_0x4085a6(0x128)](a25_0x27b23e['dim'](_0xbef670[_0x4085a6(0x136)]+_0x4085a6(0x139))),0x1):(console[_0x4085a6(0x128)](a25_0x27b23e[_0x4085a6(0x13e)]('✔\x20All\x20'+_0xbef670[_0x4085a6(0x112)]+_0x4085a6(0x137))),_0xbef670[_0x4085a6(0x11c)]>0x0&&console['log'](a25_0x27b23e['yellow'](_0xbef670[_0x4085a6(0x11c)]+_0x4085a6(0x132))),_0xbef670[_0x4085a6(0x136)]>0x0&&console['log'](a25_0x27b23e[_0x4085a6(0x12b)](_0xbef670['skippedCount']+_0x4085a6(0x139))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x58d1d5=a26_0x55de;(function(_0x4a812a,_0x56bde4){const _0x248d8d=a26_0x55de,_0x4a5795=_0x4a812a();while(!![]){try{const _0x1fa131=-parseInt(_0x248d8d(0x1c8))/0x1+parseInt(_0x248d8d(0x204))/0x2*(-parseInt(_0x248d8d(0x1c7))/0x3)+-parseInt(_0x248d8d(0x1c2))/0x4+parseInt(_0x248d8d(0x1ec))/0x5+-parseInt(_0x248d8d(0x208))/0x6*(-parseInt(_0x248d8d(0x1c0))/0x7)+parseInt(_0x248d8d(0x20b))/0x8+parseInt(_0x248d8d(0x1da))/0x9;if(_0x1fa131===_0x56bde4)break;else _0x4a5795['push'](_0x4a5795['shift']());}catch(_0x81a87b){_0x4a5795['push'](_0x4a5795['shift']());}}}(a26_0x4a8a,0xc053c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';function a26_0x4a8a(){const _0x1f97dd=['site','Show\x20job\x20details','kill','abs','m\x20ago','Job\x20type:\x20','Kill\x20a\x20job','user_name','getTime','error','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','type','jobs','\x27\x20to\x20verify\x20the\x20job\x20status','map','validate','status','just\x20now','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Query:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','\x20row','59938tsvaOa','database','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','INVALID_ARGUMENT','1594878IclCBi','job_id','green','9764016QWYNMU','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','limit','end_at','hive','verbose','jobType','push','7UzRJDa','Database:\x20','3785452QpKpmL','name','yes','Listing\x20jobs...','...','63yJFHwp','182945zZynuQ','\x20job','submit','execute','url','description','Submit\x20a\x20job','data','result','information_schema','args','job:kill','red','Cancelled','dim','query','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','created_at','1539522XAhMUz','start_at','log','mo\x20ago','List\x20jobs','Submitting\x20job...','trino','join','debug','h\x20ago','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','show','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','priority','length','job:result','round','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','4445280YFuGTd','floor'];a26_0x4a8a=function(){return _0x1f97dd;};return a26_0x4a8a();}import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a26_0x55de(_0x14a726,_0x5b6141){_0x14a726=_0x14a726-0x1b9;const _0x4a8af8=a26_0x4a8a();let _0x55debb=_0x4a8af8[_0x14a726];return _0x55debb;}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0xcb340d from'chalk';function formatDuration(_0x5403d7){const _0x204728=a26_0x55de;if(_0x5403d7<0x3c)return _0x5403d7+'s';if(_0x5403d7<0xe10)return Math[_0x204728(0x1ed)](_0x5403d7/0x3c)+'m\x20'+_0x5403d7%0x3c+'s';const _0x574341=Math[_0x204728(0x1ed)](_0x5403d7/0xe10),_0x3c85bb=Math[_0x204728(0x1ed)](_0x5403d7%0xe10/0x3c);return _0x3c85bb>0x0?_0x574341+'h\x20'+_0x3c85bb+'m':_0x574341+'h';}function formatRelativeTime(_0x41a0ae){const _0x2559c1=a26_0x55de,_0x490e4c=Date['now']()-_0x41a0ae['getTime'](),_0x23f58d=Math['floor'](Math[_0x2559c1(0x1f1)](_0x490e4c)/0x3e8);if(_0x23f58d<0x3c)return _0x2559c1(0x1ff);const _0x3b882b=Math[_0x2559c1(0x1ed)](_0x23f58d/0x3c);if(_0x3b882b<0x3c)return _0x3b882b+_0x2559c1(0x1f2);const _0x34301e=Math['floor'](_0x3b882b/0x3c);if(_0x34301e<0x18)return _0x34301e+_0x2559c1(0x1e3);const _0x354703=Math[_0x2559c1(0x1ed)](_0x34301e/0x18);if(_0x354703<0x1e)return _0x354703+'d\x20ago';return Math['floor'](_0x354703/0x1e)+_0x2559c1(0x1dd);}export class JobListCommand extends BaseCommand{[a26_0x58d1d5(0x1c3)]=a26_0x58d1d5(0x1fa);[a26_0x58d1d5(0x1cd)]=a26_0x58d1d5(0x1de);async[a26_0x58d1d5(0x1cb)](_0x32cfa){const _0x25f0a0=a26_0x58d1d5,{options:_0x9c1353,tdx:_0x5f2b09}=_0x32cfa,_0x1e9cae=resolveLimit(_0x9c1353[_0x25f0a0(0x1ba)],DEFAULT_DISPLAY_LIMIT),_0x2af7a9=_0x9c1353[_0x25f0a0(0x1fe)];_0x9c1353[_0x25f0a0(0x1bd)]&&(console['error']('Limit:\x20'+_0x1e9cae+'\x20jobs'),_0x2af7a9&&console[_0x25f0a0(0x1f7)]('Status\x20filter:\x20'+_0x2af7a9));const _0x27c779=await withSpinner(_0x25f0a0(0x1c5),()=>_0x5f2b09[_0x25f0a0(0x1fa)]['list']({'from':0x0,'to':_0x1e9cae-0x1,'status':_0x2af7a9}),{'verbose':_0x9c1353[_0x25f0a0(0x1bd)]}),_0x5d6253=_0x27c779['data'];console[_0x25f0a0(0x1f7)]('✔\x20Found\x20'+_0x5d6253['length']+_0x25f0a0(0x1c9)+(_0x5d6253['length']!==0x1?'s':''));const _0x59a50a=_0x9c1353[_0x25f0a0(0x1ee)];if(isStructuredFormat(_0x9c1353)){const _0x4a68a0=_0x5d6253[_0x25f0a0(0x1fc)](_0x30e7a0=>{const _0x4b4085=_0x25f0a0;let _0x51e468;if(_0x30e7a0[_0x4b4085(0x1db)]&&_0x30e7a0[_0x4b4085(0x1bb)]){const _0x12a6fc=new Date(_0x30e7a0[_0x4b4085(0x1db)])[_0x4b4085(0x1f6)](),_0x43cee1=new Date(_0x30e7a0['end_at'])[_0x4b4085(0x1f6)]();_0x51e468=Math[_0x4b4085(0x1ea)]((_0x43cee1-_0x12a6fc)/0x3e8);}return{'job_id':_0x30e7a0[_0x4b4085(0x209)],'type':_0x30e7a0[_0x4b4085(0x1f9)]==='presto'?_0x4b4085(0x1e0):_0x30e7a0[_0x4b4085(0x1f9)],'status':_0x30e7a0[_0x4b4085(0x1fe)],'user_name':_0x30e7a0[_0x4b4085(0x1f5)],'duration_sec':_0x51e468,'created_at':_0x30e7a0[_0x4b4085(0x1d9)],'started_at':_0x30e7a0[_0x4b4085(0x1db)],'end_at':_0x30e7a0['end_at']};});await handleSDKOutput(_0x4a68a0,_0x9c1353);}else for(const _0x3afa98 of _0x5d6253){const _0x53bdde=_0x3afa98[_0x25f0a0(0x1fe)]==='success'?a26_0xcb340d[_0x25f0a0(0x20a)]:_0x3afa98[_0x25f0a0(0x1fe)]===_0x25f0a0(0x1f7)?a26_0xcb340d[_0x25f0a0(0x1d4)]:a26_0xcb340d[_0x25f0a0(0x1d6)],_0xf8580f=_0x53bdde(_0x3afa98[_0x25f0a0(0x1fe)]),_0x5aa5d4=getJobUrl(_0x59a50a,_0x3afa98[_0x25f0a0(0x209)]),_0x4c4595=hyperlink(_0x3afa98[_0x25f0a0(0x209)],_0x5aa5d4),_0x181780=a26_0xcb340d[_0x25f0a0(0x1d6)](_0x3afa98[_0x25f0a0(0x1f9)]==='presto'?'trino':_0x3afa98[_0x25f0a0(0x1f9)]),_0x4da8e2=[];if(_0x3afa98['start_at']&&_0x3afa98[_0x25f0a0(0x1bb)]){const _0x546099=Math[_0x25f0a0(0x1ea)]((new Date(_0x3afa98['end_at'])['getTime']()-new Date(_0x3afa98['start_at'])[_0x25f0a0(0x1f6)]())/0x3e8);_0x4da8e2['push'](formatDuration(_0x546099));}if(_0x3afa98[_0x25f0a0(0x1bb)])_0x4da8e2[_0x25f0a0(0x1bf)](formatRelativeTime(new Date(_0x3afa98[_0x25f0a0(0x1bb)])));else _0x3afa98[_0x25f0a0(0x1db)]&&_0x4da8e2[_0x25f0a0(0x1bf)](formatRelativeTime(new Date(_0x3afa98[_0x25f0a0(0x1db)])));const _0x528dce=_0x4da8e2['length']>0x0?a26_0xcb340d['dim']('\x20'+_0x4da8e2[_0x25f0a0(0x1e1)](',\x20')):'';console[_0x25f0a0(0x1dc)]('⚡\x20'+_0x4c4595+'\x20'+_0x181780+'\x20'+_0xf8580f+_0x528dce);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x58d1d5(0x1c3)]='job:show';[a26_0x58d1d5(0x1cd)]=a26_0x58d1d5(0x1ef);[a26_0x58d1d5(0x1fd)](_0x3694e5){const _0xc41cf5=a26_0x58d1d5,_0x4430ce=_0x3694e5['args'][0x0];if(!_0x4430ce)return _0xc41cf5(0x1d8);return undefined;}async[a26_0x58d1d5(0x1cb)](_0x591aad){const _0x4d4f38=a26_0x58d1d5,{options:_0xcacbb8,args:_0x49e92f,tdx:_0x2d6cee}=_0x591aad,_0x3c31d8=_0x49e92f[0x0],_0x28fef1=await withSpinner('Getting\x20job\x20details...',()=>_0x2d6cee[_0x4d4f38(0x1fa)][_0x4d4f38(0x1e5)](_0x3c31d8),{'verbose':_0xcacbb8[_0x4d4f38(0x1bd)]}),_0x33b22f=_0x28fef1['data'];let _0x123a4a;if(_0x33b22f['start_at']&&_0x33b22f[_0x4d4f38(0x1bb)]){const _0x2a51d2=new Date(_0x33b22f[_0x4d4f38(0x1db)])[_0x4d4f38(0x1f6)](),_0xd20c2e=new Date(_0x33b22f['end_at'])[_0x4d4f38(0x1f6)]();_0x123a4a=Math[_0x4d4f38(0x1ea)]((_0xd20c2e-_0x2a51d2)/0x3e8);}const _0x12a45b={'job_id':_0x33b22f[_0x4d4f38(0x209)],'type':_0x33b22f[_0x4d4f38(0x1f9)],'status':_0x33b22f[_0x4d4f38(0x1fe)],..._0x33b22f[_0x4d4f38(0x1f5)]&&{'user_name':_0x33b22f['user_name']},..._0x123a4a!==undefined&&{'duration_sec':_0x123a4a},..._0x33b22f[_0x4d4f38(0x1d9)]&&{'created_at':_0x33b22f[_0x4d4f38(0x1d9)]},..._0x33b22f[_0x4d4f38(0x1db)]&&{'started_at':_0x33b22f['start_at']},..._0x33b22f['end_at']&&{'end_at':_0x33b22f[_0x4d4f38(0x1bb)]},..._0x33b22f[_0x4d4f38(0x205)]&&{'database':_0x33b22f[_0x4d4f38(0x205)]},..._0x33b22f[_0x4d4f38(0x1e7)]!==undefined&&{'priority':_0x33b22f[_0x4d4f38(0x1e7)]},..._0x33b22f[_0x4d4f38(0x1cc)]&&{'url':_0x33b22f[_0x4d4f38(0x1cc)]},..._0x33b22f[_0x4d4f38(0x1d7)]&&{'query':_0x33b22f['query']},..._0x33b22f[_0x4d4f38(0x1e2)]&&{'debug':_0x33b22f[_0x4d4f38(0x1e2)]}};return await handleSingleObjectOutput(_0x12a45b,_0xcacbb8),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x58d1d5(0x1d3);[a26_0x58d1d5(0x1cd)]=a26_0x58d1d5(0x1f4);[a26_0x58d1d5(0x1fd)](_0x42ddf6){const _0x51789f=a26_0x58d1d5,_0x497d2a=_0x42ddf6['args'][0x0];if(!_0x497d2a)return _0x51789f(0x202);return undefined;}async[a26_0x58d1d5(0x1cb)](_0x3edec0){const _0x5e87d0=a26_0x58d1d5,{options:_0x2afec3,args:_0x46a573,tdx:_0x47d72f}=_0x3edec0,_0x2a2173=_0x46a573[0x0];if(!_0x2afec3[_0x5e87d0(0x1c4)]){const _0x3cefa3=await confirm(_0x5e87d0(0x200)+_0x2a2173+'?');if(!_0x3cefa3)return console['error'](_0x5e87d0(0x1d5)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x47d72f[_0x5e87d0(0x1fa)][_0x5e87d0(0x1f0)](_0x2a2173),{'verbose':_0x2afec3[_0x5e87d0(0x1bd)]}),console['error'](_0x5e87d0(0x1e6)+_0x2a2173),console['error'](_0x5e87d0(0x1e4)+_0x2a2173+_0x5e87d0(0x1fb)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a26_0x58d1d5(0x1cd)]=a26_0x58d1d5(0x1ce);async[a26_0x58d1d5(0x1cb)](_0x3bfd57){const _0x1e0961=a26_0x58d1d5,{options:_0x271980,args:_0x1c5ea6,tdx:_0x4dffa8}=_0x3bfd57,_0x3df3a5=_0x271980[_0x1e0961(0x1be)]||_0x1e0961(0x1e0),_0xfd2a8f=_0x271980['file'],_0x5bba60=_0x271980[_0x1e0961(0x205)]||_0x1e0961(0x1d1),_0x3b2913=_0x271980[_0x1e0961(0x1d0)];if(_0x3df3a5!=='trino'&&_0x3df3a5!==_0x1e0961(0x1bc))throw new SDKError(ErrorCode[_0x1e0961(0x207)],_0x1e0961(0x1eb));let _0x248a12;if(_0xfd2a8f){if(_0x1c5ea6[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1e0961(0x1f8));const _0x160bab=readSqlStatementsFromFile(_0xfd2a8f);if(_0x160bab['length']===0x0)throw new SDKError(ErrorCode[_0x1e0961(0x207)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x160bab['length']>0x1)throw new SDKError(ErrorCode[_0x1e0961(0x207)],_0x1e0961(0x206));_0x248a12=_0x160bab[0x0];}else{if(!_0x1c5ea6[0x0])throw new SDKError(ErrorCode[_0x1e0961(0x207)],_0x1e0961(0x1b9));_0x248a12=_0x1c5ea6[0x0];}_0x271980['verbose']&&(console['error'](_0x1e0961(0x1f3)+_0x3df3a5),console[_0x1e0961(0x1f7)](_0x1e0961(0x1c1)+_0x5bba60),console[_0x1e0961(0x1f7)](_0x1e0961(0x201)+_0x248a12['substring'](0x0,0x64)+(_0x248a12[_0x1e0961(0x1e8)]>0x64?_0x1e0961(0x1c6):'')));const _0x34167b=await withSpinner(_0x1e0961(0x1df),()=>_0x4dffa8[_0x1e0961(0x1fa)][_0x1e0961(0x1ca)](_0x5bba60,_0x248a12,_0x3df3a5,_0x3b2913),{'verbose':_0x271980['verbose']}),_0x14c940=_0x34167b['data'];return console['error']('✔\x20Job\x20submitted'),console['error']('\x20\x20Job\x20ID:\x20'+_0x14c940[_0x1e0961(0x209)]),await handleSDKOutput([_0x14c940],_0x271980),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x58d1d5(0x1c3)]=a26_0x58d1d5(0x1e9);[a26_0x58d1d5(0x1cd)]='Get\x20job\x20results';[a26_0x58d1d5(0x1fd)](_0x175a03){const _0x31c234=a26_0x58d1d5,_0x538a25=_0x175a03[_0x31c234(0x1d2)][0x0];if(!_0x538a25)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x58d1d5(0x1cb)](_0x1eb42a){const _0x3ce337=a26_0x58d1d5,{options:_0x6c8c1d,args:_0x34b284,tdx:_0x126a87}=_0x1eb42a,_0x5971e0=_0x34b284[0x0],_0x232589=await withSpinner('Getting\x20job\x20results...',()=>_0x126a87[_0x3ce337(0x1fa)][_0x3ce337(0x1d0)](_0x5971e0),{'verbose':_0x6c8c1d['verbose']}),_0x5c5706=_0x232589[_0x3ce337(0x1cf)];return console[_0x3ce337(0x1f7)]('✔\x20Retrieved\x20'+_0x5c5706[_0x3ce337(0x1e8)]+_0x3ce337(0x203)+(_0x5c5706['length']!==0x1?'s':'')),await handleSDKOutput(_0x5c5706,_0x6c8c1d),0x0;}}
|
|
1
|
+
const a26_0x17d7f7=a26_0x5c33;(function(_0x40b427,_0x51cab7){const _0x20f9a0=a26_0x5c33,_0x5f0864=_0x40b427();while(!![]){try{const _0x4d152f=parseInt(_0x20f9a0(0x208))/0x1*(parseInt(_0x20f9a0(0x241))/0x2)+parseInt(_0x20f9a0(0x204))/0x3*(parseInt(_0x20f9a0(0x220))/0x4)+-parseInt(_0x20f9a0(0x1f6))/0x5*(-parseInt(_0x20f9a0(0x22b))/0x6)+-parseInt(_0x20f9a0(0x21c))/0x7*(-parseInt(_0x20f9a0(0x22f))/0x8)+-parseInt(_0x20f9a0(0x20b))/0x9*(-parseInt(_0x20f9a0(0x237))/0xa)+-parseInt(_0x20f9a0(0x202))/0xb+-parseInt(_0x20f9a0(0x211))/0xc;if(_0x4d152f===_0x51cab7)break;else _0x5f0864['push'](_0x5f0864['shift']());}catch(_0x58bb7c){_0x5f0864['push'](_0x5f0864['shift']());}}}(a26_0x5c9f,0x799f9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x221d5f from'chalk';function formatDuration(_0x2b8b58){const _0x47216b=a26_0x5c33;if(_0x2b8b58<0x3c)return _0x2b8b58+'s';if(_0x2b8b58<0xe10)return Math[_0x47216b(0x23f)](_0x2b8b58/0x3c)+'m\x20'+_0x2b8b58%0x3c+'s';const _0x524d7c=Math['floor'](_0x2b8b58/0xe10),_0x259d62=Math[_0x47216b(0x23f)](_0x2b8b58%0xe10/0x3c);return _0x259d62>0x0?_0x524d7c+'h\x20'+_0x259d62+'m':_0x524d7c+'h';}function formatRelativeTime(_0x2be010){const _0xdf5cb0=a26_0x5c33,_0x3cfa5b=Date['now']()-_0x2be010[_0xdf5cb0(0x201)](),_0x22d4d1=Math['floor'](Math[_0xdf5cb0(0x20f)](_0x3cfa5b)/0x3e8);if(_0x22d4d1<0x3c)return'just\x20now';const _0x221b14=Math[_0xdf5cb0(0x23f)](_0x22d4d1/0x3c);if(_0x221b14<0x3c)return _0x221b14+'m\x20ago';const _0x180b5d=Math['floor'](_0x221b14/0x3c);if(_0x180b5d<0x18)return _0x180b5d+_0xdf5cb0(0x243);const _0x3525a9=Math[_0xdf5cb0(0x23f)](_0x180b5d/0x18);if(_0x3525a9<0x1e)return _0x3525a9+'d\x20ago';return Math[_0xdf5cb0(0x23f)](_0x3525a9/0x1e)+'mo\x20ago';}function a26_0x5c33(_0x3f1bb0,_0x3c7a76){_0x3f1bb0=_0x3f1bb0-0x1ef;const _0x5c9fdd=a26_0x5c9f();let _0x5c335d=_0x5c9fdd[_0x3f1bb0];return _0x5c335d;}export class JobListCommand extends BaseCommand{['name']=a26_0x17d7f7(0x221);['description']=a26_0x17d7f7(0x239);async[a26_0x17d7f7(0x216)](_0x1e69de){const _0x4105a4=a26_0x17d7f7,{options:_0x24a318,tdx:_0x14dfa3}=_0x1e69de,_0x42862c=resolveLimit(_0x24a318[_0x4105a4(0x22e)],DEFAULT_DISPLAY_LIMIT),_0x5db6b9=_0x24a318[_0x4105a4(0x1f9)];_0x24a318[_0x4105a4(0x207)]&&(console['error'](_0x4105a4(0x23b)+_0x42862c+_0x4105a4(0x1f7)),_0x5db6b9&&console['error'](_0x4105a4(0x233)+_0x5db6b9));const _0x3a46ac=await withSpinner(_0x4105a4(0x1ef),()=>_0x14dfa3[_0x4105a4(0x221)][_0x4105a4(0x23a)]({'from':0x0,'to':_0x42862c-0x1,'status':_0x5db6b9}),{'verbose':_0x24a318[_0x4105a4(0x207)]}),_0x3a8121=_0x3a46ac['data'];console['error'](_0x4105a4(0x20c)+_0x3a8121[_0x4105a4(0x1fa)]+_0x4105a4(0x244)+(_0x3a8121[_0x4105a4(0x1fa)]!==0x1?'s':''));const _0x420477=_0x24a318['site'];if(isStructuredFormat(_0x24a318)){const _0x5e1da0=_0x3a8121[_0x4105a4(0x1fe)](_0x5f35db=>{const _0x191548=_0x4105a4;let _0x59718f;if(_0x5f35db['start_at']&&_0x5f35db[_0x191548(0x212)]){const _0x583f4d=new Date(_0x5f35db['start_at'])['getTime'](),_0x5b01e1=new Date(_0x5f35db[_0x191548(0x212)])[_0x191548(0x201)]();_0x59718f=Math[_0x191548(0x231)]((_0x5b01e1-_0x583f4d)/0x3e8);}return{'job_id':_0x5f35db[_0x191548(0x229)],'type':_0x5f35db['type']==='presto'?_0x191548(0x209):_0x5f35db[_0x191548(0x1fd)],'status':_0x5f35db[_0x191548(0x1f9)],'user_name':_0x5f35db[_0x191548(0x20d)],'duration_sec':_0x59718f,'created_at':_0x5f35db[_0x191548(0x245)],'started_at':_0x5f35db[_0x191548(0x230)],'end_at':_0x5f35db[_0x191548(0x212)]};});await handleSDKOutput(_0x5e1da0,_0x24a318);}else for(const _0x83b63b of _0x3a8121){const _0x476438=_0x83b63b['status']===_0x4105a4(0x23c)?a26_0x221d5f['green']:_0x83b63b[_0x4105a4(0x1f9)]==='error'?a26_0x221d5f[_0x4105a4(0x238)]:a26_0x221d5f[_0x4105a4(0x20a)],_0x5d82dc=_0x476438(_0x83b63b[_0x4105a4(0x1f9)]),_0xe2efcd=getJobUrl(_0x420477,_0x83b63b[_0x4105a4(0x229)]),_0x1d616a=hyperlink(_0x83b63b[_0x4105a4(0x229)],_0xe2efcd),_0x23304d=a26_0x221d5f[_0x4105a4(0x20a)](_0x83b63b['type']===_0x4105a4(0x1f8)?'trino':_0x83b63b[_0x4105a4(0x1fd)]),_0x5c0dd8=[];if(_0x83b63b[_0x4105a4(0x230)]&&_0x83b63b['end_at']){const _0x4d3389=Math[_0x4105a4(0x231)]((new Date(_0x83b63b[_0x4105a4(0x212)])[_0x4105a4(0x201)]()-new Date(_0x83b63b[_0x4105a4(0x230)])[_0x4105a4(0x201)]())/0x3e8);_0x5c0dd8[_0x4105a4(0x23e)](formatDuration(_0x4d3389));}if(_0x83b63b[_0x4105a4(0x212)])_0x5c0dd8[_0x4105a4(0x23e)](formatRelativeTime(new Date(_0x83b63b[_0x4105a4(0x212)])));else _0x83b63b[_0x4105a4(0x230)]&&_0x5c0dd8[_0x4105a4(0x23e)](formatRelativeTime(new Date(_0x83b63b[_0x4105a4(0x230)])));const _0x173439=_0x5c0dd8[_0x4105a4(0x1fa)]>0x0?a26_0x221d5f[_0x4105a4(0x20a)]('\x20'+_0x5c0dd8[_0x4105a4(0x22d)](',\x20')):'';console['log']('⚡\x20'+_0x1d616a+'\x20'+_0x23304d+'\x20'+_0x5d82dc+_0x173439);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x17d7f7(0x226);[a26_0x17d7f7(0x219)]='Show\x20job\x20details';['validate'](_0xa8ac6a){const _0x5cd117=a26_0x17d7f7,_0x188a4e=_0xa8ac6a[_0x5cd117(0x205)][0x0];if(!_0x188a4e)return _0x5cd117(0x215);return undefined;}async[a26_0x17d7f7(0x216)](_0x5b4be1){const _0x3f7e3f=a26_0x17d7f7,{options:_0x4949cc,args:_0x1236b3,tdx:_0x21a7ab}=_0x5b4be1,_0x1a36a5=_0x1236b3[0x0],_0x50fdf2=await withSpinner('Getting\x20job\x20details...',()=>_0x21a7ab[_0x3f7e3f(0x221)][_0x3f7e3f(0x236)](_0x1a36a5),{'verbose':_0x4949cc[_0x3f7e3f(0x207)]}),_0xace231=_0x50fdf2[_0x3f7e3f(0x210)];let _0xc6b39d;if(_0xace231[_0x3f7e3f(0x230)]&&_0xace231[_0x3f7e3f(0x212)]){const _0xba0323=new Date(_0xace231[_0x3f7e3f(0x230)])[_0x3f7e3f(0x201)](),_0x46f46e=new Date(_0xace231[_0x3f7e3f(0x212)])['getTime']();_0xc6b39d=Math['round']((_0x46f46e-_0xba0323)/0x3e8);}const _0x325d78={'job_id':_0xace231[_0x3f7e3f(0x229)],'type':_0xace231[_0x3f7e3f(0x1fd)],'status':_0xace231['status'],..._0xace231[_0x3f7e3f(0x20d)]&&{'user_name':_0xace231['user_name']},..._0xc6b39d!==undefined&&{'duration_sec':_0xc6b39d},..._0xace231[_0x3f7e3f(0x245)]&&{'created_at':_0xace231[_0x3f7e3f(0x245)]},..._0xace231[_0x3f7e3f(0x230)]&&{'started_at':_0xace231['start_at']},..._0xace231[_0x3f7e3f(0x212)]&&{'end_at':_0xace231[_0x3f7e3f(0x212)]},..._0xace231['database']&&{'database':_0xace231['database']},..._0xace231['priority']!==undefined&&{'priority':_0xace231['priority']},..._0xace231[_0x3f7e3f(0x203)]&&{'url':_0xace231['url']},..._0xace231[_0x3f7e3f(0x21a)]&&{'query':_0xace231['query']},..._0xace231[_0x3f7e3f(0x240)]&&{'debug':_0xace231['debug']}};return await handleSingleObjectOutput(_0x325d78,_0x4949cc),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x17d7f7(0x21e)]='job:kill';[a26_0x17d7f7(0x219)]=a26_0x17d7f7(0x22c);['validate'](_0x2102af){const _0x45786e=a26_0x17d7f7,_0xb6680f=_0x2102af['args'][0x0];if(!_0xb6680f)return _0x45786e(0x1f0);return undefined;}async['execute'](_0xcd9b4b){const _0x256884=a26_0x17d7f7,{options:_0x3f4b34,args:_0x44c7fc,tdx:_0x507b56}=_0xcd9b4b,_0x477ecd=_0x44c7fc[0x0];if(!_0x3f4b34[_0x256884(0x21b)]){const _0x52e094=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x477ecd+'?');if(!_0x52e094)return console['error'](_0x256884(0x1ff)),0x0;}return await withSpinner(_0x256884(0x234),()=>_0x507b56[_0x256884(0x221)][_0x256884(0x222)](_0x477ecd),{'verbose':_0x3f4b34[_0x256884(0x207)]}),console[_0x256884(0x1fb)](_0x256884(0x232)+_0x477ecd),console[_0x256884(0x1fb)](_0x256884(0x214)+_0x477ecd+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x17d7f7(0x22a);['description']='Submit\x20a\x20job';async[a26_0x17d7f7(0x216)](_0x3ba90e){const _0x2a8712=a26_0x17d7f7,{options:_0x338ed3,args:_0x25624b,tdx:_0x1d967e}=_0x3ba90e,_0x10ad2f=_0x338ed3[_0x2a8712(0x217)]||_0x2a8712(0x209),_0x389108=_0x338ed3[_0x2a8712(0x20e)],_0x205764=_0x338ed3['database']||'information_schema',_0x31215f=_0x338ed3[_0x2a8712(0x1fc)];if(_0x10ad2f!=='trino'&&_0x10ad2f!==_0x2a8712(0x223))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2a8712(0x218));let _0x58f02b;if(_0x389108){if(_0x25624b[0x0])throw new SDKError(ErrorCode[_0x2a8712(0x225)],_0x2a8712(0x1f3));const _0x1e8d90=readSqlStatementsFromFile(_0x389108);if(_0x1e8d90[_0x2a8712(0x1fa)]===0x0)throw new SDKError(ErrorCode[_0x2a8712(0x225)],_0x2a8712(0x23d));if(_0x1e8d90[_0x2a8712(0x1fa)]>0x1)throw new SDKError(ErrorCode[_0x2a8712(0x225)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x58f02b=_0x1e8d90[0x0];}else{if(!_0x25624b[0x0])throw new SDKError(ErrorCode[_0x2a8712(0x225)],_0x2a8712(0x224));_0x58f02b=_0x25624b[0x0];}_0x338ed3[_0x2a8712(0x207)]&&(console[_0x2a8712(0x1fb)](_0x2a8712(0x1f1)+_0x10ad2f),console[_0x2a8712(0x1fb)](_0x2a8712(0x200)+_0x205764),console[_0x2a8712(0x1fb)](_0x2a8712(0x1f2)+_0x58f02b[_0x2a8712(0x242)](0x0,0x64)+(_0x58f02b[_0x2a8712(0x1fa)]>0x64?_0x2a8712(0x213):'')));const _0x437926=await withSpinner(_0x2a8712(0x21d),()=>_0x1d967e['jobs']['submit'](_0x205764,_0x58f02b,_0x10ad2f,_0x31215f),{'verbose':_0x338ed3[_0x2a8712(0x207)]}),_0x1f629d=_0x437926['data'];return console[_0x2a8712(0x1fb)](_0x2a8712(0x1f4)),console['error'](_0x2a8712(0x1f5)+_0x1f629d[_0x2a8712(0x229)]),await handleSDKOutput([_0x1f629d],_0x338ed3),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x17d7f7(0x21e)]=a26_0x17d7f7(0x206);['description']=a26_0x17d7f7(0x227);['validate'](_0xced652){const _0x27146d=_0xced652['args'][0x0];if(!_0x27146d)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x17d7f7(0x216)](_0xf83967){const _0x1121f5=a26_0x17d7f7,{options:_0x28ea9a,args:_0x3ab289,tdx:_0x1d4093}=_0xf83967,_0x3b56e9=_0x3ab289[0x0],_0x1b28be=await withSpinner(_0x1121f5(0x228),()=>_0x1d4093['jobs'][_0x1121f5(0x1fc)](_0x3b56e9),{'verbose':_0x28ea9a[_0x1121f5(0x207)]}),_0x1c96d5=_0x1b28be[_0x1121f5(0x210)];return console[_0x1121f5(0x1fb)](_0x1121f5(0x21f)+_0x1c96d5[_0x1121f5(0x1fa)]+_0x1121f5(0x235)+(_0x1c96d5[_0x1121f5(0x1fa)]!==0x1?'s':'')),await handleSDKOutput(_0x1c96d5,_0x28ea9a),0x0;}}function a26_0x5c9f(){const _0x508beb=['...','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','execute','jobType','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','description','query','yes','7sVnPea','Submitting\x20job...','name','✔\x20Retrieved\x20','6652LBrxQE','jobs','kill','hive','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','INVALID_ARGUMENT','job:show','Get\x20job\x20results','Getting\x20job\x20results...','job_id','job:submit','6jmjWJq','Kill\x20a\x20job','join','limit','1891912acgNfb','start_at','round','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Status\x20filter:\x20','Submitting\x20kill\x20request...','\x20row','show','2651870IHWJZO','red','List\x20jobs','list','Limit:\x20','success','No\x20SQL\x20statements\x20found\x20in\x20file','push','floor','debug','2fvkBne','substring','h\x20ago','\x20job','created_at','Listing\x20jobs...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20type:\x20','Query:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','✔\x20Job\x20submitted','\x20\x20Job\x20ID:\x20','1708705HWREmE','\x20jobs','presto','status','length','error','result','type','map','Cancelled','Database:\x20','getTime','10682826BobWKP','url','57JAFZSu','args','job:result','verbose','687995SWXrSO','trino','dim','27BsMsCd','✔\x20Found\x20','user_name','file','abs','data','7488576lzUkEA','end_at'];a26_0x5c9f=function(){return _0x508beb;};return a26_0x5c9f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x1885b1=a27_0x377b;(function(_0x3842ce,_0x5130be){const _0x1c2a33=a27_0x377b,_0x1aecce=_0x3842ce();while(!![]){try{const _0x80ae29=parseInt(_0x1c2a33(0x148))/0x1*(parseInt(_0x1c2a33(0x1cc))/0x2)+parseInt(_0x1c2a33(0x1e4))/0x3*(parseInt(_0x1c2a33(0x1f6))/0x4)+-parseInt(_0x1c2a33(0x10e))/0x5+parseInt(_0x1c2a33(0x107))/0x6+parseInt(_0x1c2a33(0x1bd))/0x7+-parseInt(_0x1c2a33(0x1e1))/0x8+parseInt(_0x1c2a33(0x1b1))/0x9*(-parseInt(_0x1c2a33(0x237))/0xa);if(_0x80ae29===_0x5130be)break;else _0x1aecce['push'](_0x1aecce['shift']());}catch(_0x3e1079){_0x1aecce['push'](_0x1aecce['shift']());}}}(a27_0x2458,0x8daeb));import a27_0x368f8b from'chalk';import a27_0x28133f 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(_0x45d9c3){const _0x3df905=a27_0x377b;return!_0x45d9c3&&(console[_0x3df905(0x1f0)](_0x3df905(0x163)),console[_0x3df905(0x1f0)](_0x3df905(0x115))),!!_0x45d9c3;}function withJsonFormat(_0x146cb0){const _0x4c873d=a27_0x377b;if(!_0x146cb0[_0x4c873d(0x1fd)]&&!_0x146cb0[_0x4c873d(0x10d)]&&!_0x146cb0[_0x4c873d(0x117)]&&!_0x146cb0[_0x4c873d(0x13a)])return{..._0x146cb0,'format':_0x4c873d(0x10d),'json':!![]};return _0x146cb0;}function formatJourneyState(_0x3d28d7){const _0x54e08c=a27_0x377b;switch(_0x3d28d7){case _0x54e08c(0x139):return a27_0x368f8b[_0x54e08c(0x20e)](_0x54e08c(0x1dc));case _0x54e08c(0x1aa):return a27_0x368f8b[_0x54e08c(0x10f)]('(draft)');case _0x54e08c(0x12c):return a27_0x368f8b['yellow'](_0x54e08c(0x1c2));case _0x54e08c(0x200):return a27_0x368f8b['blue'](_0x54e08c(0x100));case _0x54e08c(0x132):return a27_0x368f8b[_0x54e08c(0x10f)](_0x54e08c(0x16b));default:return'('+_0x3d28d7+')';}}function a27_0x2458(){const _0xf8d558=['Folder\x20path:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Target\x20file:\x20','utf-8','(paused)','\x20versions)','base','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20Found\x20','Error:\x20Version\x20','Error:\x20Invalid\x20--type\x20\x22','bold','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Getting\x20column\x20mapping...','8ewPEvA','session','Parent\x20segment:\x20','reentryMode','version','parentSegment','journey:version:view','root\x20folder','goalSize','cyan','segment','No\x20journeys\x20found','nodes','\x20unchanged\x20files','filePath','\x20\x20-\x20','(running)','pausedAt','Listing\x20journey\x20versions...','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Listing\x20journey\x20activations...','1774288gEZAgt','\x20not\x20found.\x20Available:\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','1893YenyBm','Getting\x20journey\x20traffic\x20data...','Pause\x20a\x20running\x20journey','\x20version','✔\x20Journey\x20\x22','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','attributes','log','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Cancelled','\x20\x20Journey\x20ID:\x20','targetDir','error','listFolders','journeyName','from','\x22\x20not\x20found','\x20[runs\x20on\x20refresh]','3892vOlmZU','test','database','filter','journey:run','journey:traffic','Resolved\x20YAML\x20file:\x20','format','stage','activation','completed','Creating\x20new\x20version...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','localeCompare','hasChanges','absolutePath','Getting\x20journey\x20statistics...','\x20details...','goal','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','description','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)','yes','workflowSessionId','green','ID:','Aborted.','\x20activation','\x20(ID:\x20','relative','List\x20all\x20versions\x20of\x20a\x20journey','Warning:\x20Could\x20not\x20resolve\x20activation\x20','journeyBundleId','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','\x22\x20resumed','journey:version:create','getActivation','\x0aChanges\x20to\x20\x27','\x20=\x20','conversion','Error:\x20Invalid\x20version\x20number:\x20','find','Status:','\x20\x20Preserving\x20local\x20segment\x20name:\x20','site','No\x20statistics\x20available\x20for\x20journey:\x20','List\x20journeys\x20in\x20current\x20context','journey:activations','journeyStages','✔\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','scheduleType','stages','Error:\x20','(none)','exitOrJumpRate','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','values','exitOrJumpSize','segmentPushCommand','Options:','Fetching\x20parent\x20segment...','no_parent','Database:\x20','executeDryRun','30ENdVWc','listVersions','(completed)','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20Journey\x20workflow\x20started','...','split','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journey:stats','6397332rYFegR','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','no\x20connection','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Listing\x20journeys...','Pattern:\x20','json','991045cJSdVr','dim','\x20files?','journey:pause','createdAt','journeyId','resourceName','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','history','jsonl','\x20changed\x20files','cwd','✔\x20All\x20files\x20are\x20up\x20to\x20date','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','journey:resume','\x20Created\x20v','Show\x20journey\x20details','activationParams','journey:view','updatedAt','execute','resolveSegment','rule','versionNumber','yellow','sort','Parent\x20segment\x20ID:','status','renderStats','toLowerCase','paused','journey:pull','\x20Opening\x20','journeyBundleName','Paused\x20at:','\x27\x20not\x20found\x20in\x20','archived','helpText','journey:list','parent_segment','repeat','Show\x20journey\x20table\x20column\x20mapping','listJourneysWithFolders','launched','tsv','options','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','data','pause','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','all','Fetching\x20journey\x20','replace','Found\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','📁\x20','-\x20no\x20files\x20written','154669FmpkxH','Stages:','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Error:\x20Journey\x20\x27','Error:\x20--version\x20option\x20is\x20required','Input:\x20','\x20->\x20','Session:','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','workflowId','args','milestoneSize','getJourney','state','Available\x20stages:\x20','journey:push','get','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','/e/','getStatistics','\x20\x20Parent\x20segment:\x20','\x20journey\x20files\x20to\x20','table','Table:\x20','journey:columns','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','has','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','connectionId','Paused:','resume','set','push','\x0aError:','Fetching\x20users\x20and\x20connections...','(archived)','segments','columns','activation_','enteredSize','dryRun','Fetching\x20','Pausing\x20journey...','type','createVersion','\x20\x20Statistics\x20not\x20available','isNew','Show\x20journey\x20statistics','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','Target\x20directory:\x20','Fetching\x20journeys\x20and\x20folders...','\x22\x20paused','includeHistory','Activations:','Resuming\x20journey...','Write\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','runAfterJourneyRefresh','/j/da','folderId','audienceId','verbose','\x20journeys','runAt','Resolving\x20parent\x20segment...','connection','Resolving\x20journey...','name','⚠️\x20','journeys','limit','file','size','listActivationsFlat','List\x20activations\x20for\x20a\x20journey','Getting\x20journey\x20details...','folderPath','\x20@\x20','red','none','hasPeriod','entries','\x20\x20Consolidating\x20duplicate\x20segment:\x20','✔\x20Pulled\x20','\x20\x20Target:\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','buildIdToNameMap','add','parentName','join',',\x20schedule:\x20','/app/ps/','content','/j/da/je','message','map','journey','\x0aPull\x20summary:','draft','State:','journey:versions','INVALID_ARGUMENT','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Journey:','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','4636521zplsqC','.journey.yml','diff','resolveParentId','(unnamed)','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','kind','getTrafficData','connection\x20','\x20new\x20files','length','getLatestJourneyId','1728804VSsEcB'];a27_0x2458=function(){return _0xf8d558;};return a27_0x2458();}function formatJourneyItem(_0x4ef38a,_0x375b46='',_0x5a331a){const _0x283e43=a27_0x377b,_0x2bc1f1=formatJourneyState(_0x4ef38a[_0x283e43(0x155)]),_0x585537=_0x5a331a?hyperlink(_0x4ef38a[_0x283e43(0x12f)],_0x5a331a):_0x4ef38a[_0x283e43(0x12f)];return _0x375b46+'🗺️\x20'+_0x585537+'\x20'+_0x2bc1f1;}function escapeRegex(_0x900c17){const _0x3efe5c=a27_0x377b;return _0x900c17[_0x3efe5c(0x143)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x154813){const _0x2bd257=a27_0x377b,_0x40564d=_0x154813[_0x2bd257(0x104)]('*')[_0x2bd257(0x1a7)](escapeRegex);return new RegExp(_0x40564d[_0x2bd257(0x1a1)]('.*'),'i');}function buildRuleToNameMapping(_0x217ca7){const _0x2f719c=a27_0x377b,_0x44acac=new Map();if(_0x217ca7['segments'])for(const [_0x163ca3,_0x273d75]of Object[_0x2f719c(0x199)](_0x217ca7[_0x2f719c(0x16c)])){if(_0x273d75[_0x2f719c(0x124)]){const _0x59f2a4=serializeRule(_0x273d75[_0x2f719c(0x124)]),_0x4f7e8d=_0x44acac['get'](_0x59f2a4);_0x4f7e8d?_0x4f7e8d[_0x2f719c(0x168)](_0x163ca3):_0x44acac[_0x2f719c(0x167)](_0x59f2a4,[_0x163ca3]);}}return _0x44acac;}async function resolveJourneyIdFromInput(_0x1c2684,_0x26951,_0x20fe26){const _0x37c42b=a27_0x377b,_0x1bc12f=await resolveJourneyTarget(_0x1c2684,_0x26951[_0x37c42b(0x1d1)],_0x26951[_0x37c42b(0x185)]),_0x142732=_0x1bc12f[_0x37c42b(0x1d1)];if(!_0x142732)throw new SDKError(ErrorCode[_0x37c42b(0x1ad)],_0x37c42b(0x209));const _0x54492=await withSpinner(_0x37c42b(0x188),()=>_0x20fe26[_0x37c42b(0x1d6)][_0x37c42b(0x1b4)](_0x142732),{'verbose':_0x26951[_0x37c42b(0x185)]}),_0x343b05=_0x54492['data'],_0x2334f7=await withSpinner(_0x37c42b(0x18a),()=>_0x20fe26[_0x37c42b(0x1a8)]['resolveJourneyId'](_0x343b05,_0x1bc12f[_0x37c42b(0x1f2)]),{'verbose':_0x26951[_0x37c42b(0x185)]});return{'journeyId':_0x2334f7[_0x37c42b(0x13e)],'journeyName':_0x1bc12f['journeyName'],'parentSegmentId':_0x343b05};}async function resolveJourneyTarget(_0x16763c,_0x48a2c3,_0x470534){const _0x28c496=a27_0x377b;if(isYamlFilePath(_0x16763c))try{const _0x506add=await resolveYamlFilePath(_0x16763c);return _0x470534&&(console['error'](_0x28c496(0x1fc)+_0x16763c),console['error'](_0x28c496(0x15c)+_0x506add[_0x28c496(0x1d1)]),console[_0x28c496(0x1f0)]('\x20\x20Name:\x20'+_0x506add['segmentName']),console[_0x28c496(0x1f0)]('\x20\x20Folder\x20path:\x20'+(_0x506add[_0x28c496(0x194)]||'(root)'))),{'journeyName':_0x506add['segmentName'],'parentSegment':_0x506add[_0x28c496(0x1d1)],'resolved':_0x506add};}catch(_0x19ef1d){throw new SDKError(ErrorCode[_0x28c496(0x1ad)],_0x28c496(0x13c)+_0x19ef1d['message']);}if(!_0x48a2c3)throw new SDKError(ErrorCode[_0x28c496(0x1ad)],_0x28c496(0x1ec));return{'journeyName':_0x16763c,'parentSegment':_0x48a2c3};}export class JourneyListCommand extends BaseCommand{['name']=a27_0x1885b1(0x134);['description']=a27_0x1885b1(0x224);async[a27_0x1885b1(0x122)](_0x225a19){const _0x223ac8=a27_0x1885b1,{options:_0x57dd93,args:_0x34411c,tdx:_0x569b2d}=_0x225a19,_0x36e815=_0x34411c[0x0],_0xaa77b8=_0x57dd93[_0x223ac8(0x1d1)];if(!_0xaa77b8)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0x223ac8(0x202)),0x1;const _0x4a6634=await withSpinner(_0x223ac8(0x188),()=>_0x569b2d[_0x223ac8(0x1d6)][_0x223ac8(0x1b4)](_0xaa77b8),{'verbose':_0x57dd93['verbose']}),_0x31ceb8=_0x4a6634[_0x223ac8(0x13e)];_0x57dd93[_0x223ac8(0x185)]&&(console[_0x223ac8(0x1f0)](_0x223ac8(0x1ce)+_0xaa77b8+_0x223ac8(0x212)+_0x31ceb8+')'),_0x36e815&&console[_0x223ac8(0x1f0)](_0x223ac8(0x10c)+_0x36e815));const _0x4e84d0=await withSpinner(_0x223ac8(0x233),()=>_0x569b2d[_0x223ac8(0x1d6)]['getParentFull'](_0x31ceb8),{'verbose':_0x57dd93['verbose']}),_0x497b25=_0x4e84d0[_0x223ac8(0x13e)],_0x2233d2=_0x497b25['rootFolderId'],_0x45689f=await withSpinner(_0x223ac8(0x10b),()=>_0x569b2d[_0x223ac8(0x1a8)][_0x223ac8(0x138)](_0x31ceb8,_0x2233d2),{'verbose':_0x57dd93[_0x223ac8(0x185)]});let _0x1ca357=_0x45689f[_0x223ac8(0x13e)][_0x223ac8(0x18d)];const _0x5cee5b=_0x45689f[_0x223ac8(0x13e)]['folders'],_0x57b5e7=new Map();for(const _0x258edf of _0x5cee5b){_0x57b5e7[_0x223ac8(0x167)](_0x258edf['id'],_0x258edf['name']);}if(_0x36e815){const _0x4e8dfd=globToRegex(_0x36e815);_0x1ca357=_0x1ca357[_0x223ac8(0x1f9)](_0x476dab=>_0x4e8dfd[_0x223ac8(0x1f7)](_0x476dab[_0x223ac8(0x12f)]));}console['error'](_0x223ac8(0x1c6)+_0x1ca357['length']+'\x20journey'+(_0x1ca357[_0x223ac8(0x1bb)]!==0x1?'s':''));const _0x42bb02=_0x2b5639=>{const _0x20bc12=_0x223ac8;return getConsoleNextUrl(_0x57dd93['site'],_0x20bc12(0x1a3)+_0x31ceb8+_0x20bc12(0x15a)+_0x2b5639+_0x20bc12(0x182));};if(_0x57dd93[_0x223ac8(0x1fd)]===_0x223ac8(0x15e))await handleSDKOutput(_0x1ca357,_0x57dd93);else{if(_0x57dd93[_0x223ac8(0x1fd)]==='json'){const _0xf0790e=_0x1ca357[_0x223ac8(0x1a7)](_0x278620=>({..._0x278620,'url':_0x42bb02(_0x278620['id'])}));await handleSDKOutput(_0xf0790e,_0x57dd93);}else{console['log']('['+_0xaa77b8+']');const _0x3eccb6=new Map(),_0x2bcb42=[];for(const _0x3f9b2e of _0x1ca357){if(!_0x3f9b2e[_0x223ac8(0x183)]||_0x3f9b2e['folderId']===_0x2233d2)_0x2bcb42[_0x223ac8(0x168)](_0x3f9b2e);else{const _0x5f5d6a=_0x3eccb6[_0x223ac8(0x158)](_0x3f9b2e[_0x223ac8(0x183)])||[];_0x5f5d6a[_0x223ac8(0x168)](_0x3f9b2e),_0x3eccb6['set'](_0x3f9b2e[_0x223ac8(0x183)],_0x5f5d6a);}}const _0x51746f=(_0x23d8ec,_0x3ee988)=>_0x23d8ec['journeyBundleName'][_0x223ac8(0x203)](_0x3ee988[_0x223ac8(0x12f)],undefined,{'sensitivity':_0x223ac8(0x1c4)});_0x2bcb42[_0x223ac8(0x127)](_0x51746f);for(const _0x9a10c3 of _0x2bcb42){console[_0x223ac8(0x1eb)](formatJourneyItem(_0x9a10c3,'',_0x42bb02(_0x9a10c3['id'])));}const _0x28d159=[..._0x3eccb6[_0x223ac8(0x199)]()]['sort']((_0x386e68,_0x38a440)=>{const _0x32566b=_0x223ac8,_0x306c31=_0x57b5e7['get'](_0x386e68[0x0])||_0x386e68[0x0],_0x1b3db6=_0x57b5e7[_0x32566b(0x158)](_0x38a440[0x0])||_0x38a440[0x0];return _0x306c31[_0x32566b(0x203)](_0x1b3db6,undefined,{'sensitivity':'base'});});for(const [_0x499b02,_0x2b370b]of _0x28d159){const _0xe76b41=_0x57b5e7['get'](_0x499b02)||_0x499b02;console[_0x223ac8(0x1eb)](_0x223ac8(0x146)+_0xe76b41),_0x2b370b[_0x223ac8(0x127)](_0x51746f);for(const _0x4466ca of _0x2b370b){console[_0x223ac8(0x1eb)](formatJourneyItem(_0x4466ca,'\x20\x20',_0x42bb02(_0x4466ca['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x1885b1(0x18b)]=a27_0x1885b1(0x120);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x11e);async[a27_0x1885b1(0x122)](_0x227aa5){const _0x1500c1=a27_0x1885b1,{options:_0x4d025c,args:_0x3ea138,tdx:_0x1083d4}=_0x227aa5,_0x27a111=_0x3ea138[0x0];if(!_0x27a111)return console[_0x1500c1(0x1f0)](_0x1500c1(0x163)),console[_0x1500c1(0x1f0)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x1500c1(0x1f0)](_0x1500c1(0x232)),console['error'](_0x1500c1(0x1e9)),0x1;_0x4d025c['verbose']&&console[_0x1500c1(0x1f0)]('Input:\x20'+_0x27a111);const {journeyId:_0x4e204d,parentSegmentId:_0x3da537}=await resolveJourneyIdFromInput(_0x27a111,_0x4d025c,_0x1083d4);if(_0x4d025c['web']){const _0x43ecc7=getConsoleNextUrl(_0x4d025c[_0x1500c1(0x222)],_0x1500c1(0x1a3)+_0x3da537+_0x1500c1(0x15a)+_0x4e204d+_0x1500c1(0x1a5));return console[_0x1500c1(0x1f0)](a27_0x368f8b[_0x1500c1(0x20e)]('✔')+_0x1500c1(0x12e)+a27_0x368f8b[_0x1500c1(0x1d5)](_0x43ecc7)),openBrowser(_0x43ecc7),0x0;}const _0x5664d7=await withSpinner(_0x1500c1(0x193),()=>_0x1083d4['journey']['getJourney'](_0x4e204d),{'verbose':_0x4d025c['verbose']}),_0x590bb8=_0x5664d7['data'],_0x23103e=_0x4d025c['includeStats'];let _0x64fd52;if(_0x23103e)try{const _0x4bfcb8=await withSpinner(_0x1500c1(0x206),()=>_0x1083d4[_0x1500c1(0x1a8)][_0x1500c1(0x15b)](_0x4e204d),{'verbose':_0x4d025c[_0x1500c1(0x185)]});_0x64fd52=_0x4bfcb8[_0x1500c1(0x13e)];}catch{_0x4d025c['verbose']&&console[_0x1500c1(0x1f0)](_0x1500c1(0x175));}const _0x32e836=getConsoleNextUrl(_0x4d025c[_0x1500c1(0x222)],'/app/ps/'+_0x3da537+'/e/'+_0x4e204d+_0x1500c1(0x1a5)),_0x1b5621={'id':_0x590bb8['id'],'name':_0x590bb8[_0x1500c1(0x1ea)]['name'],'description':_0x590bb8[_0x1500c1(0x1ea)][_0x1500c1(0x20a)],'state':_0x590bb8[_0x1500c1(0x1ea)]['state'],'paused':_0x590bb8[_0x1500c1(0x1ea)][_0x1500c1(0x12c)],'reentry_mode':_0x590bb8[_0x1500c1(0x1ea)]['reentryMode'],'stages':_0x590bb8[_0x1500c1(0x1ea)][_0x1500c1(0x226)]?.[_0x1500c1(0x1bb)]||0x0,..._0x590bb8[_0x1500c1(0x1ea)][_0x1500c1(0x208)]&&{'goal':_0x590bb8[_0x1500c1(0x1ea)]['goal'][_0x1500c1(0x18b)]},..._0x64fd52&&{'statistics':{'size':_0x64fd52[_0x1500c1(0x190)],'entered':_0x64fd52['enteredSize'],'goal_achieved':_0x64fd52[_0x1500c1(0x1d4)],'completion_rate':_0x64fd52['completionRate'],'exit_or_jump':_0x64fd52[_0x1500c1(0x230)],'exit_or_jump_rate':_0x64fd52['exitOrJumpRate'],'stages':_0x64fd52[_0x1500c1(0x22a)]}},'url':_0x32e836};return await handleSingleObjectOutput(_0x1b5621,_0x4d025c),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x1885b1(0x18b)]=a27_0x1885b1(0x106);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x177);async['execute'](_0x38dd22){const _0x549cd9=a27_0x1885b1,{options:_0x3350f6,args:_0x268e08,tdx:_0x22984f}=_0x38dd22,_0x23fd9d=_0x268e08[0x0];if(!requireNameOrPath(_0x23fd9d))return 0x1;_0x3350f6[_0x549cd9(0x185)]&&console[_0x549cd9(0x1f0)](_0x549cd9(0x14d)+_0x23fd9d);const _0x326d2c=_0x3350f6,_0x465bc8=_0x326d2c[_0x549cd9(0x1f3)],_0x4c0056=_0x326d2c['to'],_0x4f9437=_0x326d2c[_0x549cd9(0x17c)],_0x2b08b6=_0x326d2c[_0x549cd9(0x1fe)];_0x4f9437&&!_0x465bc8&&!_0x4c0056&&console[_0x549cd9(0x1f0)](_0x549cd9(0x14a));const _0x8f796a=_0x4f9437?withJsonFormat(_0x3350f6):_0x3350f6,{journeyId:_0x138d03,journeyName:_0x156904}=await resolveJourneyIdFromInput(_0x23fd9d,_0x8f796a,_0x22984f),_0x3b9946=_0x465bc8||_0x4c0056?{'from':_0x465bc8,'to':_0x4c0056}:undefined,_0x4764de=await withSpinner(_0x549cd9(0x206),()=>Promise[_0x549cd9(0x141)]([_0x22984f[_0x549cd9(0x1a8)][_0x549cd9(0x154)](_0x138d03),_0x22984f[_0x549cd9(0x1a8)][_0x549cd9(0x15b)](_0x138d03,_0x3b9946)]),{'verbose':_0x8f796a[_0x549cd9(0x185)]}),[_0x2e14cd,_0x3dfc6e]=_0x4764de['data'];if(!_0x3dfc6e||_0x3dfc6e[_0x549cd9(0x113)]===null)return console[_0x549cd9(0x1f0)](_0x549cd9(0x223)+_0x156904),console['error'](_0x549cd9(0x105)),0x0;const _0x51a853=buildStageNameMap(_0x2e14cd),_0x25e40d=!!(_0x3b9946&&_0x3dfc6e['history']?.[_0x549cd9(0x1bb)]),_0x1ca5b1={'stageNameMap':_0x51a853,'hasPeriod':_0x25e40d,'includeHistory':!!_0x4f9437};if(_0x2b08b6&&_0x3dfc6e['stages']){const _0x367b75=_0x3dfc6e[_0x549cd9(0x22a)][_0x549cd9(0x21f)](_0x364957=>{const _0x5ce8ab=_0x549cd9,_0x4e5c33=_0x51a853[_0x5ce8ab(0x158)](_0x364957['id'])??'';return _0x4e5c33['toLowerCase']()===_0x2b08b6[_0x5ce8ab(0x12b)]();});if(_0x367b75)return await handleSingleObjectOutput(formatStageStats(_0x367b75,_0x1ca5b1),_0x8f796a),0x0;const _0x10dfca=_0x3dfc6e[_0x549cd9(0x22a)]['map'](_0x4311af=>_0x51a853[_0x549cd9(0x158)](_0x4311af['id'])??_0x4311af['id']);return console['error']('Error:\x20Stage\x20\x22'+_0x2b08b6+_0x549cd9(0x1f4)),console[_0x549cd9(0x1f0)](_0x549cd9(0x156)+_0x10dfca[_0x549cd9(0x1a1)](',\x20')),0x1;}const _0x10e5c0=_0x3dfc6e[_0x549cd9(0x22a)]?.[_0x549cd9(0x1a7)](_0x3d9905=>formatStageStats(_0x3d9905,_0x1ca5b1)),_0x204997=assembleJourneyStats(_0x3dfc6e,{'from':_0x465bc8,'to':_0x4c0056,'includeHistory':_0x4f9437});return await this[_0x549cd9(0x12a)](_0x204997,_0x10e5c0??[],_0x8f796a),0x0;}async[a27_0x1885b1(0x12a)](_0x25d5d9,_0x25adf0,_0x9e2b8d){const _0x7a1328=a27_0x1885b1,_0x425add=_0x9e2b8d[_0x7a1328(0x1fd)]==='json'||_0x9e2b8d['format']===_0x7a1328(0x117)||_0x9e2b8d[_0x7a1328(0x10d)]||_0x9e2b8d[_0x7a1328(0x117)];if(_0x425add){_0x25d5d9[_0x7a1328(0x22a)]=_0x25adf0,await handleSingleObjectOutput(_0x25d5d9,_0x9e2b8d);return;}await handleSingleObjectOutput(_0x25d5d9,_0x9e2b8d);for(const _0x42dae1 of _0x25adf0){console[_0x7a1328(0x1eb)](''),console['log'](String(a27_0x368f8b[_0x7a1328(0x1d5)][_0x7a1328(0x1c9)]('['+_0x42dae1[_0x7a1328(0x18b)]+']'))+a27_0x368f8b[_0x7a1328(0x10f)]('\x20'+_0x42dae1['id']));const {id:_0x5c52d5,name:_0x23fc25,..._0x206c81}=_0x42dae1;await handleSingleObjectOutput(_0x206c81,_0x9e2b8d);}}}function a27_0x377b(_0x3e214e,_0x2ba783){_0x3e214e=_0x3e214e-0x100;const _0x24588e=a27_0x2458();let _0x377b71=_0x24588e[_0x3e214e];return _0x377b71;}export class JourneyTrafficCommand extends BaseCommand{[a27_0x1885b1(0x18b)]=a27_0x1885b1(0x1fb);['description']=a27_0x1885b1(0x1b6);async[a27_0x1885b1(0x122)](_0xce7807){const _0x26d36b=a27_0x1885b1,{options:_0x11890c,args:_0x1db632,tdx:_0x5717bd}=_0xce7807,_0x5e982a=_0x1db632[0x0];if(!requireNameOrPath(_0x5e982a))return 0x1;_0x11890c[_0x26d36b(0x185)]&&console['error'](_0x26d36b(0x14d)+_0x5e982a);const _0x4242ab=_0x11890c,_0x1161ff=_0x4242ab[_0x26d36b(0x173)],_0x57b390=_0x4242ab[_0x26d36b(0x1f3)],_0x3fd44c=_0x4242ab['to'],_0x525abb=_0x4242ab[_0x26d36b(0x18e)];if(_0x1161ff&&_0x1161ff!=='conversion'&&_0x1161ff!==_0x26d36b(0x1ff))return console['error'](_0x26d36b(0x1c8)+_0x1161ff+_0x26d36b(0x140)),0x1;const _0x3eacb1=withJsonFormat(_0x11890c),{journeyId:_0x3b9e49,journeyName:_0x1db1d9}=await resolveJourneyIdFromInput(_0x5e982a,_0x3eacb1,_0x5717bd),_0xbb31d7={'type':_0x1161ff,'from':_0x57b390,'to':_0x3fd44c,'limit':_0x525abb},_0x2e1a70=await withSpinner(_0x26d36b(0x1e5),()=>_0x5717bd[_0x26d36b(0x1a8)][_0x26d36b(0x1b8)](_0x3b9e49,_0xbb31d7),{'verbose':_0x3eacb1[_0x26d36b(0x185)]}),_0x3f2ba1=_0x2e1a70[_0x26d36b(0x13e)],_0x436090=_0x3f2ba1[_0x26d36b(0x21d)]&&(_0x3f2ba1[_0x26d36b(0x21d)][_0x26d36b(0x1d8)][_0x26d36b(0x1bb)]>0x0||_0x3f2ba1[_0x26d36b(0x21d)]['links']['length']>0x0),_0x34ffcd=_0x3f2ba1[_0x26d36b(0x1ff)]&&_0x3f2ba1[_0x26d36b(0x1ff)][_0x26d36b(0x1bb)]>0x0;if(!_0x436090&&!_0x34ffcd)return console[_0x26d36b(0x1f0)](_0x26d36b(0x1df)+_0x1db1d9),console[_0x26d36b(0x1f0)](_0x26d36b(0x180)),_0x57b390&&_0x3fd44c&&console[_0x26d36b(0x1f0)](_0x26d36b(0x10a)),0x0;return await handleSingleObjectOutput(_0x3f2ba1,_0x3eacb1),0x0;}}function formatStageStats(_0x4de622,_0x4e5144){const _0x1b5b26=a27_0x1885b1,_0x407f61=_0x4e5144[_0x1b5b26(0x198)]&&_0x4de622[_0x1b5b26(0x116)]?.[_0x1b5b26(0x1bb)]?aggregateStageHistory(_0x4de622[_0x1b5b26(0x116)]):{'size':_0x4de622[_0x1b5b26(0x190)],'entered':_0x4de622[_0x1b5b26(0x16f)],'milestone':_0x4de622[_0x1b5b26(0x153)],'milestone_rate':_0x4de622['completeMilestoneRate'],'exit_or_jump':_0x4de622['exitOrJumpSize'],'exit_or_jump_rate':_0x4de622[_0x1b5b26(0x22d)]},_0x546c4e={'id':_0x4de622['id'],'name':_0x4e5144['stageNameMap']['get'](_0x4de622['id'])??_0x4de622['id'],..._0x407f61};return _0x4e5144[_0x1b5b26(0x198)]&&_0x4e5144[_0x1b5b26(0x17c)]&&_0x4de622[_0x1b5b26(0x116)]&&(_0x546c4e['history']=_0x4de622[_0x1b5b26(0x116)]),_0x546c4e;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x1885b1(0x111);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x1e6);async[a27_0x1885b1(0x122)](_0x1441f2){const _0x61ff1d=a27_0x1885b1,{options:_0x51a86f,args:_0x52effa,tdx:_0x39b91b}=_0x1441f2,_0x2e8dc9=_0x52effa[0x0];if(!requireNameOrPath(_0x2e8dc9))return 0x1;_0x51a86f['verbose']&&console[_0x61ff1d(0x1f0)](_0x61ff1d(0x14d)+_0x2e8dc9);const {journeyId:_0x3ecce4,journeyName:_0xb76d6e}=await resolveJourneyIdFromInput(_0x2e8dc9,_0x51a86f,_0x39b91b);if(!_0x51a86f['yes']){const _0x561e9c=await confirm(_0x61ff1d(0x1ae)+_0xb76d6e+'\x22?');if(!_0x561e9c)return console[_0x61ff1d(0x1f0)]('Cancelled'),0x0;}const _0xf908dd=await withSpinner(_0x61ff1d(0x172),()=>_0x39b91b[_0x61ff1d(0x1a8)][_0x61ff1d(0x13f)](_0x3ecce4),{'verbose':_0x51a86f[_0x61ff1d(0x185)]}),_0xfbd8f=_0xf908dd['data'];return console[_0x61ff1d(0x1f0)]('✔\x20Journey\x20\x22'+_0xfbd8f[_0x61ff1d(0x1ea)][_0x61ff1d(0x18b)]+_0x61ff1d(0x17b)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x1885b1(0x18b)]=a27_0x1885b1(0x1fa);[a27_0x1885b1(0x20a)]='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a27_0x1885b1(0x122)](_0x328a16){const _0x3f928c=a27_0x1885b1,{options:_0x4a406d,args:_0x4414f9,tdx:_0x25ba12}=_0x328a16,_0x141ff0=_0x4414f9[0x0];if(!requireNameOrPath(_0x141ff0))return 0x1;_0x4a406d[_0x3f928c(0x185)]&&console[_0x3f928c(0x1f0)](_0x3f928c(0x14d)+_0x141ff0);const {journeyId:_0x280819,journeyName:_0x2f4cc5}=await resolveJourneyIdFromInput(_0x141ff0,_0x4a406d,_0x25ba12);if(_0x4a406d[_0x3f928c(0x170)])return await this[_0x3f928c(0x236)](_0x328a16,_0x280819,_0x2f4cc5);if(!_0x4a406d[_0x3f928c(0x20c)]){const _0x2d7c3c=await confirm(_0x3f928c(0x178)+_0x2f4cc5+'\x22?');if(!_0x2d7c3c)return console[_0x3f928c(0x1f0)]('Cancelled'),0x0;}const _0x41d51b=await withSpinner('Triggering\x20journey\x20workflow...',()=>_0x25ba12['journey']['run'](_0x280819),{'verbose':_0x4a406d[_0x3f928c(0x185)]}),_0x5df8e1=_0x41d51b[_0x3f928c(0x13e)],_0x2477c9=getWorkflowSessionUrl(_0x4a406d[_0x3f928c(0x222)],_0x5df8e1[_0x3f928c(0x151)],_0x5df8e1[_0x3f928c(0x20d)]);return console['error']('\x0a'+a27_0x368f8b[_0x3f928c(0x20e)]('✔')+_0x3f928c(0x102)),console[_0x3f928c(0x1f0)]('\x20\x20'+a27_0x368f8b[_0x3f928c(0x10f)]('Journey:')+'\x20'+_0x2f4cc5),console[_0x3f928c(0x1f0)]('\x20\x20'+a27_0x368f8b[_0x3f928c(0x10f)](_0x3f928c(0x220))+'\x20'+_0x5df8e1[_0x3f928c(0x129)]),console['error']('\x20\x20'+a27_0x368f8b['dim'](_0x3f928c(0x14f))+'\x20'+_0x5df8e1[_0x3f928c(0x20d)]),console[_0x3f928c(0x1f0)]('\x20\x20'+_0x2477c9),0x0;}async['executeDryRun'](_0x260c17,_0x1e1e37,_0x65140c){const _0x3e4980=a27_0x1885b1,{options:_0x245458,tdx:_0x57d02d}=_0x260c17,_0xe489e4=await withSpinner('Fetching\x20journey\x20'+_0x65140c+_0x3e4980(0x103),()=>Promise[_0x3e4980(0x141)]([_0x57d02d[_0x3e4980(0x1a8)][_0x3e4980(0x154)](_0x1e1e37),_0x57d02d[_0x3e4980(0x1a8)][_0x3e4980(0x191)](_0x1e1e37)]),{'verbose':_0x245458[_0x3e4980(0x185)]}),[_0x518cb7,_0x52fd5]=_0xe489e4['data'],_0x59ce97=_0x518cb7[_0x3e4980(0x1ea)],_0x57f31c=_0x59ce97[_0x3e4980(0x226)];console[_0x3e4980(0x1eb)](a27_0x368f8b[_0x3e4980(0x1c9)](_0x3e4980(0x1af)),_0x59ce97[_0x3e4980(0x18b)]),console['log'](a27_0x368f8b[_0x3e4980(0x1c9)](_0x3e4980(0x20f)),_0x518cb7['id']),console[_0x3e4980(0x1eb)](a27_0x368f8b['bold'](_0x3e4980(0x1ab)),_0x59ce97['state']),console[_0x3e4980(0x1eb)](a27_0x368f8b['bold'](_0x3e4980(0x165)),_0x59ce97[_0x3e4980(0x12c)]?a27_0x368f8b[_0x3e4980(0x126)](_0x3e4980(0x20c)):a27_0x368f8b[_0x3e4980(0x20e)]('no')),console['log'](a27_0x368f8b[_0x3e4980(0x1c9)](_0x3e4980(0x128)),_0x59ce97[_0x3e4980(0x184)]);const _0x5ac08a=_0x57f31c[_0x3e4980(0x1bb)]>0x0?'\x20('+_0x57f31c[_0x3e4980(0x1a7)](_0x2e7454=>_0x2e7454[_0x3e4980(0x18b)])[_0x3e4980(0x1a1)](',\x20')+')':'';console[_0x3e4980(0x1eb)](a27_0x368f8b[_0x3e4980(0x1c9)](_0x3e4980(0x149)),''+_0x57f31c[_0x3e4980(0x1bb)]+_0x5ac08a),console[_0x3e4980(0x1eb)]('');if(_0x52fd5[_0x3e4980(0x1bb)]===0x0)console[_0x3e4980(0x1eb)](a27_0x368f8b['bold'](_0x3e4980(0x17d)),a27_0x368f8b[_0x3e4980(0x10f)](_0x3e4980(0x22c)));else{console[_0x3e4980(0x1eb)](a27_0x368f8b[_0x3e4980(0x1c9)](_0x3e4980(0x17d)));for(const _0x13a381 of _0x52fd5){const _0x39a1b9=_0x13a381[_0x3e4980(0x18b)]??_0x3e4980(0x1b5),_0x30fb55=_0x13a381[_0x3e4980(0x164)]!=null?_0x3e4980(0x1b9)+_0x13a381['connectionId']:_0x3e4980(0x109),_0x259709=_0x13a381[_0x3e4980(0x229)]?''+_0x13a381[_0x3e4980(0x229)]+(_0x13a381[_0x3e4980(0x187)]?_0x3e4980(0x195)+_0x13a381[_0x3e4980(0x187)]:''):_0x3e4980(0x197),_0x1cb86f=_0x13a381[_0x3e4980(0x181)]?_0x3e4980(0x1f5):'';console[_0x3e4980(0x1eb)]('\x20\x20'+a27_0x368f8b[_0x3e4980(0x126)]('⚠️\x20')+'\x20'+_0x39a1b9+'\x20\x20←\x20'+_0x30fb55+_0x3e4980(0x1a2)+_0x259709+_0x1cb86f);}}return console['log'](a27_0x368f8b[_0x3e4980(0x126)](_0x3e4980(0x228))),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x1885b1(0x11c);[a27_0x1885b1(0x20a)]='Resume\x20a\x20paused\x20journey';async['execute'](_0x14360f){const _0x2e42b7=a27_0x1885b1,{options:_0x582920,args:_0x5ae2e9,tdx:_0x24cea8}=_0x14360f,_0x1a04ee=_0x5ae2e9[0x0];if(!requireNameOrPath(_0x1a04ee))return 0x1;_0x582920[_0x2e42b7(0x185)]&&console[_0x2e42b7(0x1f0)](_0x2e42b7(0x14d)+_0x1a04ee);const {journeyId:_0x4c87e1,journeyName:_0x2076a5}=await resolveJourneyIdFromInput(_0x1a04ee,_0x582920,_0x24cea8);if(_0x582920[_0x2e42b7(0x170)])return await this['executeDryRun'](_0x14360f,_0x4c87e1,_0x2076a5);if(!_0x582920[_0x2e42b7(0x20c)]){const _0x59e9de=await confirm(_0x2e42b7(0x145)+_0x2076a5+'\x22?');if(!_0x59e9de)return console['error'](_0x2e42b7(0x1ed)),0x0;}const _0x48751e=await withSpinner(_0x2e42b7(0x17e),()=>_0x24cea8[_0x2e42b7(0x1a8)][_0x2e42b7(0x166)](_0x4c87e1),{'verbose':_0x582920[_0x2e42b7(0x185)]}),_0x4653e6=_0x48751e[_0x2e42b7(0x13e)];return console['error'](_0x2e42b7(0x1e8)+_0x4653e6['attributes'][_0x2e42b7(0x18b)]+_0x2e42b7(0x218)),0x0;}async['executeDryRun'](_0x19b22e,_0x3031fb,_0x1bdc88){const _0x18ddbb=a27_0x1885b1,{options:_0x2eed13,tdx:_0x575bba}=_0x19b22e,_0x3df849=await withSpinner(_0x18ddbb(0x142)+_0x1bdc88+_0x18ddbb(0x103),()=>Promise[_0x18ddbb(0x141)]([_0x575bba['journey'][_0x18ddbb(0x154)](_0x3031fb),_0x575bba[_0x18ddbb(0x1a8)]['listActivationsFlat'](_0x3031fb)]),{'verbose':_0x2eed13['verbose']}),[_0x388e83,_0x1c8ad9]=_0x3df849[_0x18ddbb(0x13e)],_0x365fa8=_0x388e83[_0x18ddbb(0x1ea)],_0x2fa458=_0x365fa8[_0x18ddbb(0x226)];console[_0x18ddbb(0x1eb)](a27_0x368f8b[_0x18ddbb(0x1c9)]('Journey:'),_0x365fa8[_0x18ddbb(0x18b)]),console[_0x18ddbb(0x1eb)](a27_0x368f8b[_0x18ddbb(0x1c9)](_0x18ddbb(0x20f)),_0x388e83['id']),console[_0x18ddbb(0x1eb)](a27_0x368f8b[_0x18ddbb(0x1c9)](_0x18ddbb(0x1ab)),_0x365fa8[_0x18ddbb(0x155)]),console['log'](a27_0x368f8b[_0x18ddbb(0x1c9)](_0x18ddbb(0x165)),_0x365fa8['paused']?a27_0x368f8b[_0x18ddbb(0x126)](_0x18ddbb(0x20c)):a27_0x368f8b[_0x18ddbb(0x20e)]('no'));_0x365fa8[_0x18ddbb(0x1dd)]&&console['log'](a27_0x368f8b['bold'](_0x18ddbb(0x130)),_0x365fa8[_0x18ddbb(0x1dd)]);console['log'](a27_0x368f8b[_0x18ddbb(0x1c9)](_0x18ddbb(0x128)),_0x365fa8[_0x18ddbb(0x184)]);const _0xc45171=_0x2fa458[_0x18ddbb(0x1bb)]>0x0?'\x20('+_0x2fa458[_0x18ddbb(0x1a7)](_0x62d112=>_0x62d112[_0x18ddbb(0x18b)])[_0x18ddbb(0x1a1)](',\x20')+')':'';console[_0x18ddbb(0x1eb)](a27_0x368f8b[_0x18ddbb(0x1c9)]('Stages:'),''+_0x2fa458[_0x18ddbb(0x1bb)]+_0xc45171),console['log']('');if(_0x1c8ad9[_0x18ddbb(0x1bb)]===0x0)console[_0x18ddbb(0x1eb)](a27_0x368f8b[_0x18ddbb(0x1c9)]('Activations:'),a27_0x368f8b[_0x18ddbb(0x10f)](_0x18ddbb(0x22c)));else{console[_0x18ddbb(0x1eb)](a27_0x368f8b[_0x18ddbb(0x1c9)](_0x18ddbb(0x17d)));for(const _0x173309 of _0x1c8ad9){const _0x490d70=_0x173309[_0x18ddbb(0x18b)]??_0x18ddbb(0x1b5),_0x591091=_0x173309[_0x18ddbb(0x164)]!=null?_0x18ddbb(0x1b9)+_0x173309['connectionId']:_0x18ddbb(0x109),_0x6ef003=_0x173309[_0x18ddbb(0x229)]?''+_0x173309[_0x18ddbb(0x229)]+(_0x173309[_0x18ddbb(0x187)]?_0x18ddbb(0x195)+_0x173309[_0x18ddbb(0x187)]:''):_0x18ddbb(0x197),_0x2b386e=_0x173309[_0x18ddbb(0x181)]?_0x18ddbb(0x1f5):'';console[_0x18ddbb(0x1eb)]('\x20\x20'+a27_0x368f8b[_0x18ddbb(0x126)](_0x18ddbb(0x18c))+'\x20'+_0x490d70+'\x20\x20←\x20'+_0x591091+',\x20schedule:\x20'+_0x6ef003+_0x2b386e);}}return console['log'](a27_0x368f8b[_0x18ddbb(0x126)](_0x18ddbb(0x217))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x1885b1(0x18b)]=a27_0x1885b1(0x12d);[a27_0x1885b1(0x20a)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x1885b1(0x122)](_0x5ec51b){const _0x2c50bd=a27_0x1885b1,{options:_0x1da8e8,args:_0x4d1a5e,tdx:_0x31878c}=_0x5ec51b,_0x5a8310=_0x1da8e8,_0x398e43=_0x4d1a5e[0x0],_0x41f191=_0x398e43&&isYamlFilePath(_0x398e43),_0x12f18a=await resolveTarget({'arg':_0x41f191?_0x398e43:undefined,'contextParent':_0x1da8e8[_0x2c50bd(0x1d1)],'cwd':process[_0x2c50bd(0x119)]()});if(!isSuccessfulResolution(_0x12f18a))return _0x12f18a['errorCode']===_0x2c50bd(0x234)?(console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x126)](_0x2c50bd(0x159))),console['error'](_0x2c50bd(0x20b)),console['error'](_0x2c50bd(0x13d)),console['error'](_0x2c50bd(0x1ca)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x196)](_0x2c50bd(0x22b)+_0x12f18a[_0x2c50bd(0x1a6)]+'\x0a')),_0x12f18a[_0x2c50bd(0x133)]&&console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x1d5)](_0x12f18a['helpText']))),0x1;let _0x2ed000=_0x41f191?undefined:_0x398e43,_0x2e8227,_0x45c735;_0x12f18a[_0x2c50bd(0x173)]===_0x2c50bd(0x18f)&&(_0x2ed000=_0x12f18a[_0x2c50bd(0x114)],_0x2e8227=_0x12f18a[_0x2c50bd(0x1da)],_0x45c735=_0x12f18a['folderPath']);const _0x2eaec2=_0x12f18a[_0x2c50bd(0x1a0)],_0x785bff=_0x12f18a[_0x2c50bd(0x1ef)];_0x5a8310[_0x2c50bd(0x185)]&&(console[_0x2c50bd(0x1f0)](_0x2c50bd(0x1ce)+_0x2eaec2),console[_0x2c50bd(0x1f0)](_0x2c50bd(0x179)+_0x785bff),_0x2ed000&&console[_0x2c50bd(0x1f0)]('Journey\x20name:\x20'+_0x2ed000),_0x2e8227&&console[_0x2c50bd(0x1f0)](_0x2c50bd(0x1c0)+_0x2e8227),_0x45c735&&console[_0x2c50bd(0x1f0)](_0x2c50bd(0x1be)+_0x45c735));const _0x563ccf=await withSpinner(_0x2c50bd(0x188),()=>_0x31878c['segment'][_0x2c50bd(0x1b4)](_0x2eaec2),{'verbose':_0x1da8e8[_0x2c50bd(0x185)]}),_0xc62c5f=_0x563ccf[_0x2c50bd(0x13e)],{journeys:_0x22da60,folders:_0x5a871f}=await withSpinner(_0x2c50bd(0x17a),async()=>{const _0x2cf06f=_0x2c50bd,[_0x1efc61,_0x39c6c4]=await Promise[_0x2cf06f(0x141)]([_0x31878c[_0x2cf06f(0x1a8)]['listJourneysFromParentSegment'](_0xc62c5f,undefined,{'includeAllVersions':!![]}),_0x31878c[_0x2cf06f(0x1d6)][_0x2cf06f(0x1f1)](_0xc62c5f)]);return{'journeys':_0x1efc61,'folders':_0x39c6c4};},{'verbose':_0x1da8e8['verbose']})['then'](_0xbd1fa3=>_0xbd1fa3[_0x2c50bd(0x13e)]);let _0x2ca581=_0x22da60;const _0x55dcd0=buildFolderIdToPathMap(_0x5a871f);if(_0x2ed000){const _0x3ba7f8=_0x2ca581['filter'](_0x49916c=>_0x49916c[_0x2c50bd(0x12f)][_0x2c50bd(0x12b)]()===_0x2ed000[_0x2c50bd(0x12b)]());if(_0x3ba7f8['length']===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x2ed000),console['error'](_0x2c50bd(0x161)),0x1;_0x2ca581=_0x3ba7f8;}if(_0x45c735!==undefined){const _0x168200=_0x2ca581[_0x2c50bd(0x1f9)](_0x514f3b=>{const _0x3850af=_0x2c50bd,_0x578a3f=_0x514f3b[_0x3850af(0x183)]?_0x55dcd0['get'](_0x514f3b[_0x3850af(0x183)])||'':'';return _0x578a3f===_0x45c735;});if(_0x168200[_0x2c50bd(0x1bb)]===0x0&&_0x2ca581[_0x2c50bd(0x1bb)]>0x0){console[_0x2c50bd(0x1f0)](_0x2c50bd(0x14b)+_0x2ed000+_0x2c50bd(0x131)+(_0x45c735||_0x2c50bd(0x1d3))),console[_0x2c50bd(0x1f0)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x78a4d2 of _0x2ca581){const _0x219cfa=_0x78a4d2[_0x2c50bd(0x183)]?_0x55dcd0['get'](_0x78a4d2[_0x2c50bd(0x183)])||'':'';console[_0x2c50bd(0x1f0)](_0x2c50bd(0x1db)+(_0x219cfa||'(root)')+'/'+_0x78a4d2['journeyBundleName']);}return 0x1;}_0x2ca581=_0x168200;}if(_0x2ca581['length']===0x0)return console[_0x2c50bd(0x1f0)](_0x2c50bd(0x1d7)),0x0;const _0x259716=new Map();for(const _0x242bb3 of _0x2ca581){const _0x4f54dd=_0x242bb3[_0x2c50bd(0x216)];!_0x259716[_0x2c50bd(0x162)](_0x4f54dd)&&_0x259716[_0x2c50bd(0x167)](_0x4f54dd,[]),_0x259716[_0x2c50bd(0x158)](_0x4f54dd)['push'](_0x242bb3);}for(const _0x17a709 of _0x259716[_0x2c50bd(0x22f)]()){_0x17a709[_0x2c50bd(0x127)]((_0x59d4b5,_0x9414b)=>(_0x59d4b5[_0x2c50bd(0x125)]||0x0)-(_0x9414b[_0x2c50bd(0x125)]||0x0));}const _0x4174e2=[],{idToEmailMap:_0x185297,connectionIdToNameMap:_0x2fb054}=await withSpinner(_0x2c50bd(0x16a),async()=>{const _0x244120=_0x2c50bd,[_0x7b1862,_0x422881]=await Promise[_0x244120(0x141)]([_0x31878c['user']['buildIdToEmailMap'](),_0x31878c[_0x244120(0x189)][_0x244120(0x19e)]()]);return{'idToEmailMap':_0x7b1862,'connectionIdToNameMap':_0x422881};},{'verbose':_0x1da8e8[_0x2c50bd(0x185)]})['then'](_0x12622e=>_0x12622e[_0x2c50bd(0x13e)]);for(const _0x2095b3 of _0x259716['values']()){const _0x57fc5f=_0x2095b3[0x0][_0x2c50bd(0x12f)],_0x3c0505=_0x2095b3[0x0][_0x2c50bd(0x183)],_0x16f4dc=_0x3c0505?_0x55dcd0['get'](_0x3c0505)||'':'',_0x10431e=_0x16f4dc?a27_0x28133f[_0x2c50bd(0x1a1)](_0x785bff,_0x16f4dc):_0x785bff,_0x328e9c=_0x2e8227||a27_0x28133f[_0x2c50bd(0x1a1)](_0x10431e,sanitizeFileName(_0x57fc5f)+_0x2c50bd(0x1b2));let _0x38d7b8,_0x14ce41;if(existsSync(_0x328e9c))try{const _0x229cd6=readFileSync(_0x328e9c,_0x2c50bd(0x1c1)),_0x57f812=parseYamlString(_0x229cd6);_0x14ce41=_0x57f812,_0x38d7b8=buildRuleToNameMapping(_0x57f812),_0x5a8310['verbose']&&_0x38d7b8['size']>0x0&&console[_0x2c50bd(0x1f0)](_0x2c50bd(0x144)+_0x38d7b8[_0x2c50bd(0x190)]+_0x2c50bd(0x1bf)+_0x57fc5f);}catch(_0x5cdd77){_0x5a8310['verbose']&&console[_0x2c50bd(0x1f0)](_0x2c50bd(0x19d)+_0x5cdd77['message']);}const _0x3b1f5f=[],_0x16e0a5=new Set(),_0x4975b2=new Map(),_0xb1248f=new Map(),_0x4714d2=new Set(),_0x5009f4=new Map(),_0x2b4a37=new Map(),_0x4fb0da=createJumpTargetCache();await withProgressSpinner(_0x2c50bd(0x171)+_0x57fc5f+_0x2c50bd(0x103),async _0x13cbb4=>{const _0x2e6a53=_0x2c50bd;for(const _0x4199a8 of _0x2095b3){const _0x162f75=_0x2095b3['length']>0x1?_0x4199a8['journeyBundleName']+'\x20v'+(_0x4199a8[_0x2e6a53(0x125)]||0x1):_0x4199a8[_0x2e6a53(0x12f)];_0x13cbb4['setPhase']('Fetching\x20'+_0x162f75);const _0xee437f=await _0x31878c[_0x2e6a53(0x1a8)][_0x2e6a53(0x154)](_0x4199a8['id']),_0x15327d=_0xee437f[_0x2e6a53(0x1ea)]?.[_0x2e6a53(0x184)],_0x3567a9={'resolveSegment':async _0x4000ce=>{const _0x52f9ab=_0x2e6a53;if(!_0x15327d)return{'name':_0x4000ce,'isJourneyLocal':![]};const _0x477a81=_0x4975b2[_0x52f9ab(0x158)](_0x4000ce);if(_0x477a81)return _0x477a81;try{const _0x14d874=await _0x31878c[_0x52f9ab(0x1d6)]['getSegment'](_0x15327d,_0x4000ce),_0x3845b9=_0x14d874[_0x52f9ab(0x1b7)]===SEGMENT_KIND_JOURNEY;let _0x3afde2,_0x1de5d9=_0x14d874['name'];if(_0x3845b9&&_0x14d874[_0x52f9ab(0x124)]){const _0x5d233c=await segmentResponseToDef(_0x14d874,{'resolveSegmentName':async _0xeae66b=>{const _0x31729e=_0x52f9ab,_0x2ba3f4=_0x4975b2[_0x31729e(0x158)](_0xeae66b);if(_0x2ba3f4)return _0x2ba3f4[_0x31729e(0x18b)];const _0x282304=await _0x3567a9[_0x31729e(0x123)](_0xeae66b);return _0x282304[_0x31729e(0x18b)];}}),_0x23c881=_0x5d233c['rule'];_0x3afde2={'description':_0x14d874[_0x52f9ab(0x20a)],'rule':_0x23c881};const _0x17e9c5=serializeRule(_0x23c881),_0x55cdef=_0xb1248f[_0x52f9ab(0x158)](_0x17e9c5);if(_0x55cdef)_0x1de5d9=_0x55cdef,_0x3afde2=undefined,_0x5a8310[_0x52f9ab(0x185)]&&console[_0x52f9ab(0x1f0)](_0x52f9ab(0x19a)+_0x14d874[_0x52f9ab(0x18b)]+_0x52f9ab(0x14e)+_0x55cdef);else{let _0x10e8e4=![];if(_0x38d7b8){const _0x5f3b59=_0x38d7b8[_0x52f9ab(0x158)](_0x17e9c5);if(_0x5f3b59){const _0x3253c5=_0x5f3b59['find'](_0x3e0d2a=>!_0x16e0a5[_0x52f9ab(0x162)](_0x3e0d2a));_0x3253c5&&(_0x1de5d9=_0x3253c5,_0x16e0a5[_0x52f9ab(0x19f)](_0x3253c5),_0xb1248f['set'](_0x17e9c5,_0x3253c5),_0x10e8e4=!![],_0x5a8310[_0x52f9ab(0x185)]&&console[_0x52f9ab(0x1f0)](_0x52f9ab(0x221)+_0x3253c5+'\x20(rule\x20match)'));}}if(!_0x10e8e4){const _0x34d895=generateJourneyLocalName(_0x14d874[_0x52f9ab(0x18b)]);_0x34d895&&(_0x1de5d9=_0x34d895);let _0x220035=_0x1de5d9,_0x5de115=0x2;while(_0x16e0a5[_0x52f9ab(0x162)](_0x220035)){_0x220035=_0x1de5d9+'_'+_0x5de115,_0x5de115++;}_0x16e0a5[_0x52f9ab(0x19f)](_0x220035),_0xb1248f[_0x52f9ab(0x167)](_0x17e9c5,_0x220035),_0x1de5d9=_0x220035;}}}const _0x475555={'name':_0x1de5d9,'isJourneyLocal':_0x3845b9,'definition':_0x3afde2};return _0x4975b2[_0x52f9ab(0x167)](_0x4000ce,_0x475555),_0x475555;}catch(_0x5737df){return _0x1da8e8[_0x52f9ab(0x185)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x4000ce+':\x20'+_0x5737df['message']),{'name':_0x4000ce,'isJourneyLocal':![]};}},'resolveActivation':async _0x499e24=>{const _0x189377=_0x2e6a53,_0x271bf2=_0x5009f4['get'](_0x499e24);if(_0x271bf2)return _0x271bf2;try{const _0x369f6b=await _0x31878c[_0x189377(0x1a8)][_0x189377(0x21a)](_0x4199a8['id'],_0x499e24),_0x486b3b=journeyActivationStepToYaml(_0x369f6b,_0x185297,_0x2fb054),_0x24d9c1=JSON['stringify']({'name':_0x486b3b[_0x189377(0x18b)],'connection':_0x486b3b[_0x189377(0x189)],'connector_config':_0x486b3b['connector_config']}),_0x57c109=_0x2b4a37[_0x189377(0x158)](_0x24d9c1);if(_0x57c109){const _0x57974d={'name':_0x57c109,'isJourneyLocal':!![],'definition':_0x486b3b};return _0x5009f4[_0x189377(0x167)](_0x499e24,_0x57974d),_0x57974d;}const _0x128911=_0x369f6b[_0x189377(0x1ea)][_0x189377(0x11f)][_0x189377(0x18b)]||_0x499e24,_0x2b7b1b=sanitizeYamlKey(_0x128911)||_0x189377(0x16e)+_0x499e24;let _0x535276=_0x2b7b1b,_0x3788da=0x2;while(_0x4714d2[_0x189377(0x162)](_0x535276)){_0x535276=_0x2b7b1b+'_'+_0x3788da,_0x3788da++;}_0x4714d2[_0x189377(0x19f)](_0x535276),_0x2b4a37[_0x189377(0x167)](_0x24d9c1,_0x535276);const _0x4b1083={'name':_0x535276,'isJourneyLocal':!![],'definition':_0x486b3b};return _0x5009f4[_0x189377(0x167)](_0x499e24,_0x4b1083),_0x4b1083;}catch(_0x2ee16f){return _0x1da8e8['verbose']&&console[_0x189377(0x1f0)](_0x189377(0x215)+_0x499e24+':\x20'+_0x2ee16f[_0x189377(0x1a6)]),{'name':_0x499e24,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x15573d,_0x3f565c)=>{const _0x4d31c8=_0x2e6a53;return resolveJumpTarget(_0x15573d,_0x3f565c,_0x4fb0da,_0xc585c7=>_0x31878c['journey'][_0x4d31c8(0x154)](_0xc585c7));}},_0x2ea68b=await journeyResponseToDef(_0xee437f,_0x3567a9);_0x3b1f5f[_0x2e6a53(0x168)]({'item':_0x4199a8,'yaml':_0x2ea68b});}},{'verbose':_0x1da8e8[_0x2c50bd(0x185)]});const _0x152491=await _0x31878c[_0x2c50bd(0x1a8)][_0x2c50bd(0x1bc)](_0x2095b3[0x0][_0x2c50bd(0x216)]),_0x17a576=buildMergedJourneyDef(_0x3b1f5f,_0x38d7b8,_0x152491),_0x2460ca=normalizeJourneyDef(_0x17a576,_0x14ce41),_0x15e7ea=toYamlString(_0x2460ca),_0x4caeb0=_0x2e8227||a27_0x28133f[_0x2c50bd(0x1a1)](_0x10431e,sanitizeFileName(_0x57fc5f)+_0x2c50bd(0x1b2));!_0x2e8227&&_0x16f4dc&&!existsSync(_0x10431e)&&mkdirSync(_0x10431e,{'recursive':!![]});const _0x56d334=a27_0x28133f[_0x2c50bd(0x213)](process[_0x2c50bd(0x119)](),_0x4caeb0);if(existsSync(_0x4caeb0)){const _0x5efbc1=readFileSync(_0x4caeb0,'utf-8'),_0x549b7f=generateDiff(_0x5efbc1,_0x15e7ea),_0x29760a=hasChanges(_0x549b7f);_0x4174e2[_0x2c50bd(0x168)]({'relativePath':_0x56d334,'absolutePath':_0x4caeb0,'content':_0x15e7ea,'isNew':![],'hasChanges':_0x29760a,'diff':_0x29760a?formatDiffWithColors(_0x549b7f):undefined});}else _0x4174e2[_0x2c50bd(0x168)]({'relativePath':_0x56d334,'absolutePath':_0x4caeb0,'content':_0x15e7ea,'isNew':!![],'hasChanges':![]});}const _0xa09d22=_0x4174e2[_0x2c50bd(0x1f9)](_0x478ada=>_0x478ada['isNew']),_0x48a8f3=_0x4174e2[_0x2c50bd(0x1f9)](_0x590412=>!_0x590412['isNew']&&_0x590412[_0x2c50bd(0x204)]),_0x14d68a=_0x4174e2[_0x2c50bd(0x1f9)](_0x3f5e31=>!_0x3f5e31[_0x2c50bd(0x176)]&&!_0x3f5e31[_0x2c50bd(0x204)]),_0x40f47a=_0x2ca581[_0x2c50bd(0x1bb)],_0x419e05=_0x259716['size'],_0x2c9190=_0x40f47a>_0x419e05?'\x20('+_0x40f47a+_0x2c50bd(0x1c3):'';console[_0x2c50bd(0x1f0)](_0x2c50bd(0x1a9)),console[_0x2c50bd(0x1f0)]('\x20\x20'+a27_0x368f8b[_0x2c50bd(0x1d5)](_0x419e05+_0x2c50bd(0x186))+a27_0x368f8b[_0x2c50bd(0x10f)](_0x2c9190)),console[_0x2c50bd(0x1f0)]('\x20\x20'+a27_0x368f8b[_0x2c50bd(0x20e)]('+\x20'+_0xa09d22[_0x2c50bd(0x1bb)]+_0x2c50bd(0x1ba))),console['error']('\x20\x20'+a27_0x368f8b[_0x2c50bd(0x126)]('~\x20'+_0x48a8f3[_0x2c50bd(0x1bb)]+_0x2c50bd(0x118))),console[_0x2c50bd(0x1f0)]('\x20\x20'+a27_0x368f8b['dim']('=\x20'+_0x14d68a[_0x2c50bd(0x1bb)]+_0x2c50bd(0x1d9))),console['error'](_0x2c50bd(0x19c)+a27_0x368f8b[_0x2c50bd(0x1d5)](_0x785bff)+'\x0a');if(_0x48a8f3[_0x2c50bd(0x1bb)]>0x0)for(const _0x23d426 of _0x48a8f3){console[_0x2c50bd(0x1f0)](_0x2c50bd(0x21b)+_0x23d426['relativePath']+'\x27:'),console[_0x2c50bd(0x1f0)]('─'['repeat'](0x3c)),console[_0x2c50bd(0x1f0)](_0x23d426[_0x2c50bd(0x1b3)]),console['error']('─'[_0x2c50bd(0x136)](0x3c));}if(_0x5a8310[_0x2c50bd(0x170)])return console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x126)](_0x2c50bd(0x1c5))),0x0;if(_0xa09d22['length']===0x0&&_0x48a8f3[_0x2c50bd(0x1bb)]===0x0)return console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x20e)](_0x2c50bd(0x11a))),saveSessionContext({'parent_segment':_0x2eaec2},_0x5a8310[_0x2c50bd(0x1cd)]),console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x20e)](_0x2c50bd(0x227)+a27_0x368f8b['dim']('parent_segment')+_0x2c50bd(0x21c)+a27_0x368f8b['cyan'](_0x2eaec2))),0x0;if(!_0x5a8310[_0x2c50bd(0x20c)]&&(_0xa09d22['length']>0x0||_0x48a8f3[_0x2c50bd(0x1bb)]>0x0)){if(!isInteractive())return console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x196)](_0x2c50bd(0x169)),_0x2c50bd(0x22e)),console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x10f)](_0x2c50bd(0x108))),0x1;const _0x4e35fa=await confirmKey(_0x2c50bd(0x17f)+(_0xa09d22[_0x2c50bd(0x1bb)]+_0x48a8f3[_0x2c50bd(0x1bb)])+_0x2c50bd(0x110));if(!_0x4e35fa)return console[_0x2c50bd(0x1f0)](a27_0x368f8b['yellow'](_0x2c50bd(0x210)),_0x2c50bd(0x147)),0x1;}!existsSync(_0x785bff)&&mkdirSync(_0x785bff,{'recursive':!![]});const _0x470990=a27_0x28133f[_0x2c50bd(0x1a1)](_0x785bff,'tdx.json');writeFileSync(_0x470990,createTdxConfigContent(_0x2eaec2),_0x2c50bd(0x1c1));for(const _0x121418 of _0x4174e2){(_0x121418['isNew']||_0x121418[_0x2c50bd(0x204)])&&writeFileSync(_0x121418[_0x2c50bd(0x205)],_0x121418[_0x2c50bd(0x1a4)],_0x2c50bd(0x1c1));}return console['error'](a27_0x368f8b['green'](_0x2c50bd(0x19b)+(_0xa09d22['length']+_0x48a8f3[_0x2c50bd(0x1bb)])+_0x2c50bd(0x15d)+_0x785bff)),saveSessionContext({'parent_segment':_0x2eaec2},_0x5a8310['session']),console[_0x2c50bd(0x1f0)](a27_0x368f8b[_0x2c50bd(0x20e)](_0x2c50bd(0x227)+a27_0x368f8b[_0x2c50bd(0x10f)](_0x2c50bd(0x135))+'\x20=\x20'+a27_0x368f8b['cyan'](_0x2eaec2))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x1885b1(0x160);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x137);async[a27_0x1885b1(0x122)](_0x3580f8){const _0x1d860e=a27_0x1885b1,{options:_0x2e6e15,args:_0x429245,tdx:_0x356a28}=_0x3580f8,_0x2098d3=_0x429245[0x0];if(!requireNameOrPath(_0x2098d3))return 0x1;_0x2e6e15[_0x1d860e(0x185)]&&console[_0x1d860e(0x1f0)](_0x1d860e(0x14d)+_0x2098d3);const {journeyId:_0x40146f}=await resolveJourneyIdFromInput(_0x2098d3,_0x2e6e15,_0x356a28),_0x46288e=await withSpinner(_0x1d860e(0x1cb),()=>_0x356a28[_0x1d860e(0x1a8)]['getColumnMapping'](_0x40146f),{'verbose':_0x2e6e15[_0x1d860e(0x185)]}),_0x3f4a9b=_0x46288e[_0x1d860e(0x13e)];return console[_0x1d860e(0x1eb)](_0x1d860e(0x235)+_0x3f4a9b[_0x1d860e(0x1f8)]),console['log'](_0x1d860e(0x15f)+_0x3f4a9b[_0x1d860e(0x15e)]),await handleSDKOutput(_0x3f4a9b[_0x1d860e(0x16d)],_0x2e6e15),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x1885b1(0x225);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x192);async['execute'](_0x5ac6b9){const _0x2e943c=a27_0x1885b1,{options:_0x2312d9,args:_0x2cfe75,tdx:_0x333908}=_0x5ac6b9,_0x15014e=_0x2cfe75[0x0];if(!requireNameOrPath(_0x15014e))return 0x1;_0x2312d9[_0x2e943c(0x185)]&&console[_0x2e943c(0x1f0)](_0x2e943c(0x14d)+_0x15014e);const {journeyId:_0x45cb12}=await resolveJourneyIdFromInput(_0x15014e,_0x2312d9,_0x333908),_0x3f2c3a=await withSpinner(_0x2e943c(0x1e0),()=>_0x333908[_0x2e943c(0x1a8)][_0x2e943c(0x191)](_0x45cb12),{'verbose':_0x2312d9[_0x2e943c(0x185)]}),_0x30f85c=_0x3f2c3a[_0x2e943c(0x13e)];return console['error']('Found\x20'+_0x30f85c[_0x2e943c(0x1bb)]+_0x2e943c(0x211)+(_0x30f85c['length']!==0x1?'s':'')),await handleSDKOutput(_0x30f85c,_0x2312d9),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x1885b1(0x18b)]=a27_0x1885b1(0x157);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x11b);[a27_0x1885b1(0x231)]=new SegmentPushCommand();async[a27_0x1885b1(0x122)](_0x2466aa){const _0x26640f=a27_0x1885b1,_0x9a8ff9=_0x2466aa[_0x26640f(0x152)][0x0];let _0x32b3ea;if(_0x9a8ff9){const _0x5a9693=await resolveTarget({'arg':_0x9a8ff9,'contextParent':_0x2466aa['options'][_0x26640f(0x1d1)],'cwd':process[_0x26640f(0x119)]()});isSuccessfulResolution(_0x5a9693)&&_0x5a9693[_0x26640f(0x173)]===_0x26640f(0x18f)&&(_0x32b3ea=_0x5a9693[_0x26640f(0x1da)]);}const _0x500581={..._0x2466aa,'options':{..._0x2466aa[_0x26640f(0x13b)],'journeysOnly':!![],..._0x32b3ea&&{'singleFilePath':_0x32b3ea}}};return this['segmentPushCommand']['execute'](_0x500581);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a27_0x1885b1(0x1ac);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x214);async[a27_0x1885b1(0x122)](_0x5729ed){const _0x3a8c9b=a27_0x1885b1,{options:_0x58cbdf,args:_0x224c31,tdx:_0x393105}=_0x5729ed,_0x5828ba=_0x224c31[0x0];if(!requireNameOrPath(_0x5828ba))return 0x1;if(_0x58cbdf[_0x3a8c9b(0x185)])console[_0x3a8c9b(0x1f0)](_0x3a8c9b(0x14d)+_0x5828ba);const {journeyId:_0x215447}=await resolveJourneyIdFromInput(_0x5828ba,_0x58cbdf,_0x393105),_0xf21ddc=await withSpinner(_0x3a8c9b(0x1de),()=>_0x393105[_0x3a8c9b(0x1a8)][_0x3a8c9b(0x238)](_0x215447),{'verbose':_0x58cbdf[_0x3a8c9b(0x185)]}),{bundleName:_0x1b27d7,versions:_0x49d4be,latestJourneyId:_0xa506b8}=_0xf21ddc[_0x3a8c9b(0x13e)];console[_0x3a8c9b(0x1f0)](_0x1b27d7+':\x20'+_0x49d4be[_0x3a8c9b(0x1bb)]+_0x3a8c9b(0x1e7)+(_0x49d4be[_0x3a8c9b(0x1bb)]!==0x1?'s':''));const _0x2c3635=_0x49d4be[_0x3a8c9b(0x1a7)](_0x1acfc7=>({'version':_0x1acfc7[_0x3a8c9b(0x125)],'journey_id':_0x1acfc7[_0x3a8c9b(0x113)],'name':_0x1acfc7['name'],'state':_0x1acfc7[_0x3a8c9b(0x155)],'paused':_0x1acfc7['paused'],'latest':_0x1acfc7[_0x3a8c9b(0x113)]===_0xa506b8,'created_at':_0x1acfc7[_0x3a8c9b(0x112)]}));return await handleSDKOutput(_0x2c3635,_0x58cbdf),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0x1885b1(0x219);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x150);async[a27_0x1885b1(0x122)](_0xbeeb72){const _0x2ae904=a27_0x1885b1,{options:_0x41e7d1,args:_0x2e297d,tdx:_0x51537d}=_0xbeeb72,_0x4e41fd=_0x2e297d[0x0];if(!requireNameOrPath(_0x4e41fd))return 0x1;if(_0x41e7d1['verbose'])console['error'](_0x2ae904(0x14d)+_0x4e41fd);const {journeyId:_0x44244e,journeyName:_0x41a913}=await resolveJourneyIdFromInput(_0x4e41fd,_0x41e7d1,_0x51537d);if(!_0x41e7d1[_0x2ae904(0x20c)]){const _0x53166b=await confirm(_0x2ae904(0x1b0)+_0x41a913+'\x22?');if(!_0x53166b)return console[_0x2ae904(0x1f0)]('Cancelled'),0x0;}const _0x18ac19=await withSpinner(_0x2ae904(0x201),()=>_0x51537d[_0x2ae904(0x1a8)][_0x2ae904(0x174)](_0x44244e),{'verbose':_0x41e7d1[_0x2ae904(0x185)]}),_0x1a149f=_0x18ac19['data'];return console['error'](a27_0x368f8b['green']('✔')+_0x2ae904(0x11d)+_0x1a149f[_0x2ae904(0x1ea)][_0x2ae904(0x125)]+'\x20(draft)\x20—\x20\x22'+_0x1a149f[_0x2ae904(0x1ea)][_0x2ae904(0x18b)]+'\x22'),console['error'](_0x2ae904(0x1ee)+_0x1a149f['id']),await handleSingleObjectOutput({'id':_0x1a149f['id'],'name':_0x1a149f[_0x2ae904(0x1ea)][_0x2ae904(0x18b)],'version':_0x1a149f[_0x2ae904(0x1ea)][_0x2ae904(0x125)],'state':_0x1a149f[_0x2ae904(0x1ea)][_0x2ae904(0x155)],'bundle_id':_0x1a149f[_0x2ae904(0x1ea)][_0x2ae904(0x216)],'created_at':_0x1a149f[_0x2ae904(0x1ea)][_0x2ae904(0x112)]},_0x41e7d1),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x1885b1(0x18b)]=a27_0x1885b1(0x1d2);[a27_0x1885b1(0x20a)]=a27_0x1885b1(0x1e3);async['execute'](_0x22e327){const _0x103bf1=a27_0x1885b1,{options:_0x328c6c,args:_0x414796,tdx:_0x8b91f3}=_0x22e327,_0x565a98=_0x414796[0x0];if(!requireNameOrPath(_0x565a98))return 0x1;const _0x9223bf=_0x328c6c[_0x103bf1(0x1d0)];if(!_0x9223bf)return console[_0x103bf1(0x1f0)](_0x103bf1(0x14c)),console['error'](_0x103bf1(0x101)),0x1;const _0x5df897=parseInt(_0x9223bf,0xa);if(isNaN(_0x5df897)||_0x5df897<0x1)return console[_0x103bf1(0x1f0)](_0x103bf1(0x21e)+_0x9223bf),0x1;if(_0x328c6c[_0x103bf1(0x185)])console[_0x103bf1(0x1f0)]('Input:\x20'+_0x565a98+',\x20version:\x20'+_0x5df897);const {journeyId:_0x555f2,parentSegmentId:_0x166b5d}=await resolveJourneyIdFromInput(_0x565a98,_0x328c6c,_0x8b91f3),_0x3069c1=await withSpinner('Resolving\x20version...',()=>_0x8b91f3[_0x103bf1(0x1a8)][_0x103bf1(0x238)](_0x555f2),{'verbose':_0x328c6c[_0x103bf1(0x185)]}),{versions:_0x4ae83d,latestJourneyId:_0x20dd17}=_0x3069c1[_0x103bf1(0x13e)],_0x4bfac4=_0x4ae83d[_0x103bf1(0x21f)](_0x1ed646=>_0x1ed646[_0x103bf1(0x125)]===_0x5df897);if(!_0x4bfac4){const _0x50b23d=_0x4ae83d[_0x103bf1(0x1a7)](_0x162fe3=>'v'+_0x162fe3['versionNumber'])['join'](',\x20');return console[_0x103bf1(0x1f0)](_0x103bf1(0x1c7)+_0x5df897+_0x103bf1(0x1e2)+_0x50b23d),0x1;}const _0x1ad9d5=await withSpinner('Getting\x20version\x20'+_0x5df897+_0x103bf1(0x207),()=>_0x8b91f3['journey'][_0x103bf1(0x154)](_0x4bfac4['journeyId']),{'verbose':_0x328c6c[_0x103bf1(0x185)]}),_0x2ff69f=_0x1ad9d5[_0x103bf1(0x13e)],_0x460a5c=getConsoleNextUrl(_0x328c6c[_0x103bf1(0x222)],_0x103bf1(0x1a3)+_0x166b5d+_0x103bf1(0x15a)+_0x4bfac4[_0x103bf1(0x113)]+_0x103bf1(0x1a5));return await handleSingleObjectOutput({'id':_0x2ff69f['id'],'name':_0x2ff69f[_0x103bf1(0x1ea)][_0x103bf1(0x18b)],'version':_0x2ff69f[_0x103bf1(0x1ea)][_0x103bf1(0x125)],'description':_0x2ff69f[_0x103bf1(0x1ea)][_0x103bf1(0x20a)],'state':_0x2ff69f[_0x103bf1(0x1ea)][_0x103bf1(0x155)],'paused':_0x2ff69f[_0x103bf1(0x1ea)][_0x103bf1(0x12c)],'reentry_mode':_0x2ff69f['attributes'][_0x103bf1(0x1cf)],'stages':_0x2ff69f['attributes']['journeyStages']?.[_0x103bf1(0x1bb)]||0x0,..._0x2ff69f[_0x103bf1(0x1ea)][_0x103bf1(0x208)]&&{'goal':_0x2ff69f['attributes'][_0x103bf1(0x208)][_0x103bf1(0x18b)]},'latest':_0x4bfac4[_0x103bf1(0x113)]===_0x20dd17,'created_at':_0x2ff69f['attributes']['createdAt'],'updated_at':_0x2ff69f['attributes'][_0x103bf1(0x121)],'url':_0x460a5c},_0x328c6c),0x0;}}
|
|
1
|
+
function a27_0x5841(_0xd98306,_0x5bab55){_0xd98306=_0xd98306-0x196;const _0x165bb3=a27_0x165b();let _0x5841af=_0x165bb3[_0xd98306];return _0x5841af;}const a27_0x59bece=a27_0x5841;(function(_0x1198df,_0x3032f3){const _0x42e92c=a27_0x5841,_0x158c30=_0x1198df();while(!![]){try{const _0x41c927=parseInt(_0x42e92c(0x1e0))/0x1*(parseInt(_0x42e92c(0x1c5))/0x2)+parseInt(_0x42e92c(0x208))/0x3+-parseInt(_0x42e92c(0x269))/0x4+-parseInt(_0x42e92c(0x29b))/0x5+-parseInt(_0x42e92c(0x242))/0x6+-parseInt(_0x42e92c(0x29c))/0x7*(-parseInt(_0x42e92c(0x247))/0x8)+-parseInt(_0x42e92c(0x1d0))/0x9*(-parseInt(_0x42e92c(0x282))/0xa);if(_0x41c927===_0x3032f3)break;else _0x158c30['push'](_0x158c30['shift']());}catch(_0x18fed1){_0x158c30['push'](_0x158c30['shift']());}}}(a27_0x165b,0x4f57b));import a27_0x581c34 from'chalk';import a27_0x50ef65 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(_0x2f5297){const _0x4c1e7c=a27_0x5841;return!_0x2f5297&&(console[_0x4c1e7c(0x272)](_0x4c1e7c(0x265)),console[_0x4c1e7c(0x272)](_0x4c1e7c(0x1f0))),!!_0x2f5297;}function withJsonFormat(_0x5f192d){const _0x58b136=a27_0x5841;if(!_0x5f192d[_0x58b136(0x2a5)]&&!_0x5f192d[_0x58b136(0x251)]&&!_0x5f192d[_0x58b136(0x1f6)]&&!_0x5f192d[_0x58b136(0x19b)])return{..._0x5f192d,'format':_0x58b136(0x251),'json':!![]};return _0x5f192d;}function formatJourneyState(_0x4ee603){const _0x2f82f4=a27_0x5841;switch(_0x4ee603){case _0x2f82f4(0x228):return a27_0x581c34['green']('(running)');case'draft':return a27_0x581c34[_0x2f82f4(0x26b)](_0x2f82f4(0x27c));case'paused':return a27_0x581c34['yellow'](_0x2f82f4(0x243));case _0x2f82f4(0x273):return a27_0x581c34[_0x2f82f4(0x1fb)](_0x2f82f4(0x1a6));case'archived':return a27_0x581c34[_0x2f82f4(0x26b)](_0x2f82f4(0x213));default:return'('+_0x4ee603+')';}}function formatJourneyItem(_0x1d8029,_0x420ea8='',_0x3c0b42){const _0x2663a6=a27_0x5841,_0xed9ac=formatJourneyState(_0x1d8029[_0x2663a6(0x223)]),_0x4bc885=_0x3c0b42?hyperlink(_0x1d8029[_0x2663a6(0x1da)],_0x3c0b42):_0x1d8029[_0x2663a6(0x1da)];return _0x420ea8+'🗺️\x20'+_0x4bc885+'\x20'+_0xed9ac;}function a27_0x165b(){const _0x1bdad9=['errorCode','1464oCOzki','resolveSegment','attributes','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','add','\x20\x20Journey\x20ID:\x20','folderPath','(unnamed)','\x22\x20resumed','✔\x20Context\x20set:\x20','json','set','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','journey:pause','\x22\x20not\x20found','Triggering\x20journey\x20workflow...','run','\x20(ID:\x20','base','workflowSessionId','⚠️\x20','Folder\x20path:\x20','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','execute','scheduleType','\x20[runs\x20on\x20refresh]','runAt','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Database:\x20','options','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Listing\x20journey\x20activations...','folderId','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','382620EqpfAl','getLatestJourneyId','dim','✔\x20All\x20files\x20are\x20up\x20to\x20date','toLowerCase','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','/app/ps/','segmentPushCommand','Aborted.','error','completed','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','session',',\x20version:\x20','Table:\x20','file','No\x20journeys\x20found','Error:\x20Journey\x20not\x20found:\x20','conversion','(draft)','rootFolderId','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','pausedAt','args','\x20\x20Consolidating\x20duplicate\x20segment:\x20','956140kXEmeQ','absolutePath','\x20journey\x20files\x20to\x20','\x20\x20Name:\x20','stringify','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20Journey\x20workflow\x20started','listJourneysFromParentSegment','entries','get','workflowId','\x20\x20Preserving\x20local\x20segment\x20name:\x20','journeyBundleId','dryRun','\x20versions)','runAfterJourneyRefresh','\x20Opening\x20','\x20(draft)\x20—\x20\x22','parent_segment','List\x20journeys\x20in\x20current\x20context','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','audienceId','\x20@\x20','red','journey:versions','1612385TWwNzw','10668hvEiom','\x20not\x20found.\x20Available:\x20','description','Target\x20file:\x20','\x20new\x20files','/j/da/je','completionRate','\x20changed\x20files','localeCompare','format','exitOrJumpSize','Error:\x20Parent\x20segment\x20context\x20required','Show\x20journey\x20details','relativePath','push','journey:run','journey:push','segments','updatedAt','reentryMode','buildIdToNameMap','...','has','log','Error:\x20Journey\x20\x27','listJourneysWithFolders','Resolving\x20parent\x20segment...','\x20Created\x20v','resourceName','No\x20statistics\x20available\x20for\x20journey:\x20','Input:\x20','size','kind','sort','exitOrJumpRate','Show\x20journey\x20table\x20column\x20mapping','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Paused\x20at:','no\x20connection','parentName','\x20\x20←\x20','rule','yes','Error:\x20--version\x20option\x20is\x20required','executeDryRun','tsv','createVersion','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20unchanged\x20files','listVersions','then','\x27\x20not\x20found\x20in\x20','\x0aPull\x20summary:','journey:resume','name','(completed)','segmentName','journey','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','utf-8','(root)','INVALID_ARGUMENT','cyan','getTrafficData','Warning:\x20Could\x20not\x20resolve\x20activation\x20','data','split','values','\x20version','message','cwd','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','resolveParentId','journeys','\x5c$&','map','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Pause\x20a\x20running\x20journey','Resuming\x20journey...','buildIdToEmailMap','isNew','-\x20no\x20files\x20written','Found\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','filter','Parent\x20segment\x20ID:','10paeanU','Listing\x20journey\x20versions...','(none)','find','diff','all','enteredSize','Resolved\x20YAML\x20file:\x20','yellow','content','columns','54zKMbcv','journeyName','none','hasChanges','join','Error:\x20Version\x20','journeyId','Available\x20stages:\x20','journeyStages','length','journeyBundleName','\x20\x20Target:\x20','resume','setPhase','.journey.yml','Activations:','51518pgSTag','parentSegment','createdAt','paused','includeStats','\x20journey','✔\x20Journey\x20\x22','\x20=\x20','type','hasPeriod','Cancelled','includeHistory','filePath','\x0aChanges\x20to\x20\x27','Listing\x20journeys...','getActivation','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','journey:list','connector_config','version','getJourney','root\x20folder','jsonl','verbose','segment','activation','goal','blue','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','bold','Fetching\x20journey\x20','journey:view','user','Target\x20directory:\x20','journey:version:create','no_parent','\x20\x20Statistics\x20not\x20available','Journey\x20name:\x20','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','journey:traffic','797283AuLhHo','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Paused:','Fetching\x20journeys\x20and\x20folders...','renderStats','✔\x20Found\x20','List\x20all\x20versions\x20of\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','/j/da','versionNumber','(archived)','Error:\x20','getStatistics','Journey:','Getting\x20journey\x20statistics...','getSegment','stages','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)',',\x20schedule:\x20','journey:stats','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','getParentFull','table','Fetching\x20','journey:pull','Pattern:\x20','state','Options:','listActivationsFlat','View\x20a\x20specific\x20version\x20of\x20a\x20journey','/e/','launched','\x20\x20Parent\x20segment:\x20','helpText','getColumnMapping','\x20activation','listFolders','green','Error:\x20Stage\x20\x22','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','site','ID:','status','tdx.json','State:','Pausing\x20journey...','Stages:','connectionId','history','\x20\x20-\x20','limit','connection\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20details...','activation_','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','3796848zoFXOf','(paused)','Parent\x20segment:\x20','relative'];a27_0x165b=function(){return _0x1bdad9;};return a27_0x165b();}function escapeRegex(_0x445d6b){const _0x8ffe84=a27_0x5841;return _0x445d6b['replace'](/[.*+?^${}()|[\]\\]/g,_0x8ffe84(0x1b9));}function globToRegex(_0x168a37){const _0x18b1df=a27_0x5841,_0xb7b630=_0x168a37[_0x18b1df(0x1b1)]('*')[_0x18b1df(0x1ba)](escapeRegex);return new RegExp(_0xb7b630[_0x18b1df(0x1d4)]('.*'),'i');}function buildRuleToNameMapping(_0x198a06){const _0x1111f2=a27_0x5841,_0x300915=new Map();if(_0x198a06['segments'])for(const [_0x5d623d,_0x5a68be]of Object[_0x1111f2(0x28a)](_0x198a06[_0x1111f2(0x2ad)])){if(_0x5a68be['rule']){const _0x3a5a25=serializeRule(_0x5a68be['rule']),_0x281f33=_0x300915[_0x1111f2(0x28b)](_0x3a5a25);_0x281f33?_0x281f33['push'](_0x5d623d):_0x300915[_0x1111f2(0x252)](_0x3a5a25,[_0x5d623d]);}}return _0x300915;}async function resolveJourneyIdFromInput(_0x448c9f,_0x32f8fe,_0x5c73e8){const _0x5f9c15=a27_0x5841,_0x5b78d8=await resolveJourneyTarget(_0x448c9f,_0x32f8fe[_0x5f9c15(0x1e1)],_0x32f8fe[_0x5f9c15(0x1f7)]),_0x34879c=_0x5b78d8[_0x5f9c15(0x1e1)];if(!_0x34879c)throw new SDKError(ErrorCode[_0x5f9c15(0x1ac)],_0x5f9c15(0x2c1));const _0x517450=await withSpinner(_0x5f9c15(0x2b6),()=>_0x5c73e8[_0x5f9c15(0x1f8)][_0x5f9c15(0x1b7)](_0x34879c),{'verbose':_0x32f8fe[_0x5f9c15(0x1f7)]}),_0x48aaec=_0x517450[_0x5f9c15(0x1b0)],_0x3b9836=await withSpinner('Resolving\x20journey...',()=>_0x5c73e8[_0x5f9c15(0x1a8)]['resolveJourneyId'](_0x48aaec,_0x5b78d8[_0x5f9c15(0x1d1)]),{'verbose':_0x32f8fe[_0x5f9c15(0x1f7)]});return{'journeyId':_0x3b9836['data'],'journeyName':_0x5b78d8[_0x5f9c15(0x1d1)],'parentSegmentId':_0x48aaec};}async function resolveJourneyTarget(_0x4eb370,_0x77e15d,_0x966972){const _0x1ddc4f=a27_0x5841;if(isYamlFilePath(_0x4eb370))try{const _0x3c4e9b=await resolveYamlFilePath(_0x4eb370);return _0x966972&&(console[_0x1ddc4f(0x272)](_0x1ddc4f(0x1cc)+_0x4eb370),console['error'](_0x1ddc4f(0x229)+_0x3c4e9b[_0x1ddc4f(0x1e1)]),console[_0x1ddc4f(0x272)](_0x1ddc4f(0x285)+_0x3c4e9b[_0x1ddc4f(0x1a7)]),console[_0x1ddc4f(0x272)]('\x20\x20Folder\x20path:\x20'+(_0x3c4e9b[_0x1ddc4f(0x24d)]||_0x1ddc4f(0x1ab)))),{'journeyName':_0x3c4e9b[_0x1ddc4f(0x1a7)],'parentSegment':_0x3c4e9b['parentSegment'],'resolved':_0x3c4e9b};}catch(_0x383290){throw new SDKError(ErrorCode[_0x1ddc4f(0x1ac)],_0x1ddc4f(0x1fc)+_0x383290['message']);}if(!_0x77e15d)throw new SDKError(ErrorCode[_0x1ddc4f(0x1ac)],_0x1ddc4f(0x210));return{'journeyName':_0x4eb370,'parentSegment':_0x77e15d};}export class JourneyListCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x1f1);[a27_0x59bece(0x29e)]=a27_0x59bece(0x295);async['execute'](_0x393493){const _0x20cc2d=a27_0x59bece,{options:_0xd5d6aa,args:_0xc3f136,tdx:_0x28d5d8}=_0x393493,_0x1be73a=_0xc3f136[0x0],_0x3fd67b=_0xd5d6aa[_0x20cc2d(0x1e1)];if(!_0x3fd67b)return console[_0x20cc2d(0x272)](_0x20cc2d(0x2a7)),console['error']('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x2d14f6=await withSpinner(_0x20cc2d(0x2b6),()=>_0x28d5d8[_0x20cc2d(0x1f8)][_0x20cc2d(0x1b7)](_0x3fd67b),{'verbose':_0xd5d6aa[_0x20cc2d(0x1f7)]}),_0x543d63=_0x2d14f6[_0x20cc2d(0x1b0)];_0xd5d6aa['verbose']&&(console[_0x20cc2d(0x272)]('Parent\x20segment:\x20'+_0x3fd67b+_0x20cc2d(0x258)+_0x543d63+')'),_0x1be73a&&console[_0x20cc2d(0x272)](_0x20cc2d(0x222)+_0x1be73a));const _0x257847=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x28d5d8[_0x20cc2d(0x1f8)][_0x20cc2d(0x21e)](_0x543d63),{'verbose':_0xd5d6aa[_0x20cc2d(0x1f7)]}),_0x194283=_0x257847['data'],_0x4974ba=_0x194283[_0x20cc2d(0x27d)],_0x33e091=await withSpinner(_0x20cc2d(0x1ee),()=>_0x28d5d8['journey'][_0x20cc2d(0x2b5)](_0x543d63,_0x4974ba),{'verbose':_0xd5d6aa[_0x20cc2d(0x1f7)]});let _0x3075c3=_0x33e091['data'][_0x20cc2d(0x1b8)];const _0x25cbd8=_0x33e091[_0x20cc2d(0x1b0)]['folders'],_0x1d32c0=new Map();for(const _0x311b10 of _0x25cbd8){_0x1d32c0[_0x20cc2d(0x252)](_0x311b10['id'],_0x311b10['name']);}if(_0x1be73a){const _0x381458=globToRegex(_0x1be73a);_0x3075c3=_0x3075c3[_0x20cc2d(0x1c3)](_0x1d1a2a=>_0x381458['test'](_0x1d1a2a[_0x20cc2d(0x1da)]));}console['error'](_0x20cc2d(0x20d)+_0x3075c3[_0x20cc2d(0x1d9)]+_0x20cc2d(0x1e5)+(_0x3075c3['length']!==0x1?'s':''));const _0x12781c=_0x466b1c=>{const _0xa88d55=_0x20cc2d;return getConsoleNextUrl(_0xd5d6aa['site'],'/app/ps/'+_0x543d63+_0xa88d55(0x227)+_0x466b1c+_0xa88d55(0x211));};if(_0xd5d6aa[_0x20cc2d(0x2a5)]===_0x20cc2d(0x21f))await handleSDKOutput(_0x3075c3,_0xd5d6aa);else{if(_0xd5d6aa[_0x20cc2d(0x2a5)]===_0x20cc2d(0x251)){const _0x25581a=_0x3075c3[_0x20cc2d(0x1ba)](_0x5d39e6=>({..._0x5d39e6,'url':_0x12781c(_0x5d39e6['id'])}));await handleSDKOutput(_0x25581a,_0xd5d6aa);}else{console['log']('['+_0x3fd67b+']');const _0x5157f9=new Map(),_0x23d66a=[];for(const _0x5d4607 of _0x3075c3){if(!_0x5d4607['folderId']||_0x5d4607[_0x20cc2d(0x267)]===_0x4974ba)_0x23d66a[_0x20cc2d(0x2aa)](_0x5d4607);else{const _0x5e707e=_0x5157f9[_0x20cc2d(0x28b)](_0x5d4607[_0x20cc2d(0x267)])||[];_0x5e707e[_0x20cc2d(0x2aa)](_0x5d4607),_0x5157f9[_0x20cc2d(0x252)](_0x5d4607['folderId'],_0x5e707e);}}const _0x2ccf67=(_0x200eec,_0x29f371)=>_0x200eec['journeyBundleName'][_0x20cc2d(0x2a4)](_0x29f371[_0x20cc2d(0x1da)],undefined,{'sensitivity':_0x20cc2d(0x259)});_0x23d66a['sort'](_0x2ccf67);for(const _0x509d06 of _0x23d66a){console[_0x20cc2d(0x2b3)](formatJourneyItem(_0x509d06,'',_0x12781c(_0x509d06['id'])));}const _0x388e01=[..._0x5157f9['entries']()][_0x20cc2d(0x2bd)]((_0x251ecd,_0x47745c)=>{const _0x4de479=_0x20cc2d,_0x12e8f5=_0x1d32c0['get'](_0x251ecd[0x0])||_0x251ecd[0x0],_0x483a65=_0x1d32c0['get'](_0x47745c[0x0])||_0x47745c[0x0];return _0x12e8f5[_0x4de479(0x2a4)](_0x483a65,undefined,{'sensitivity':_0x4de479(0x259)});});for(const [_0x53481a,_0x367129]of _0x388e01){const _0x3a589e=_0x1d32c0[_0x20cc2d(0x28b)](_0x53481a)||_0x53481a;console['log']('📁\x20'+_0x3a589e),_0x367129['sort'](_0x2ccf67);for(const _0x6fbd93 of _0x367129){console[_0x20cc2d(0x2b3)](formatJourneyItem(_0x6fbd93,'\x20\x20',_0x12781c(_0x6fbd93['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x1ff);[a27_0x59bece(0x29e)]=a27_0x59bece(0x2a8);async['execute'](_0x1345ce){const _0x1d9a81=a27_0x59bece,{options:_0x193061,args:_0x346242,tdx:_0x2624d0}=_0x1345ce,_0x2b962b=_0x346242[0x0];if(!_0x2b962b)return console[_0x1d9a81(0x272)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x1d9a81(0x272)](_0x1d9a81(0x21d)),console[_0x1d9a81(0x272)](_0x1d9a81(0x224)),console[_0x1d9a81(0x272)](_0x1d9a81(0x253)),0x1;_0x193061[_0x1d9a81(0x1f7)]&&console[_0x1d9a81(0x272)](_0x1d9a81(0x2ba)+_0x2b962b);const {journeyId:_0x5c0546,parentSegmentId:_0x4a68b8}=await resolveJourneyIdFromInput(_0x2b962b,_0x193061,_0x2624d0);if(_0x193061['web']){const _0x841695=getConsoleNextUrl(_0x193061['site'],_0x1d9a81(0x26f)+_0x4a68b8+_0x1d9a81(0x227)+_0x5c0546+_0x1d9a81(0x2a1));return console[_0x1d9a81(0x272)](a27_0x581c34[_0x1d9a81(0x22e)]('✔')+_0x1d9a81(0x292)+a27_0x581c34[_0x1d9a81(0x1ad)](_0x841695)),openBrowser(_0x841695),0x0;}const _0x48593c=await withSpinner('Getting\x20journey\x20details...',()=>_0x2624d0[_0x1d9a81(0x1a8)][_0x1d9a81(0x1f4)](_0x5c0546),{'verbose':_0x193061[_0x1d9a81(0x1f7)]}),_0x255fcd=_0x48593c[_0x1d9a81(0x1b0)],_0x467863=_0x193061[_0x1d9a81(0x1e4)];let _0x5abf16;if(_0x467863)try{const _0x3e6025=await withSpinner(_0x1d9a81(0x217),()=>_0x2624d0[_0x1d9a81(0x1a8)][_0x1d9a81(0x215)](_0x5c0546),{'verbose':_0x193061[_0x1d9a81(0x1f7)]});_0x5abf16=_0x3e6025[_0x1d9a81(0x1b0)];}catch{_0x193061[_0x1d9a81(0x1f7)]&&console[_0x1d9a81(0x272)](_0x1d9a81(0x204));}const _0x4a80af=getConsoleNextUrl(_0x193061[_0x1d9a81(0x231)],'/app/ps/'+_0x4a68b8+_0x1d9a81(0x227)+_0x5c0546+_0x1d9a81(0x2a1)),_0x5e44b8={'id':_0x255fcd['id'],'name':_0x255fcd['attributes'][_0x1d9a81(0x1a5)],'description':_0x255fcd[_0x1d9a81(0x249)]['description'],'state':_0x255fcd[_0x1d9a81(0x249)][_0x1d9a81(0x223)],'paused':_0x255fcd[_0x1d9a81(0x249)]['paused'],'reentry_mode':_0x255fcd['attributes'][_0x1d9a81(0x2af)],'stages':_0x255fcd[_0x1d9a81(0x249)]['journeyStages']?.[_0x1d9a81(0x1d9)]||0x0,..._0x255fcd[_0x1d9a81(0x249)][_0x1d9a81(0x1fa)]&&{'goal':_0x255fcd[_0x1d9a81(0x249)][_0x1d9a81(0x1fa)][_0x1d9a81(0x1a5)]},..._0x5abf16&&{'statistics':{'size':_0x5abf16[_0x1d9a81(0x2bb)],'entered':_0x5abf16[_0x1d9a81(0x1cb)],'goal_achieved':_0x5abf16['goalSize'],'completion_rate':_0x5abf16[_0x1d9a81(0x2a2)],'exit_or_jump':_0x5abf16[_0x1d9a81(0x2a6)],'exit_or_jump_rate':_0x5abf16[_0x1d9a81(0x2be)],'stages':_0x5abf16[_0x1d9a81(0x219)]}},'url':_0x4a80af};return await handleSingleObjectOutput(_0x5e44b8,_0x193061),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x59bece(0x21c);[a27_0x59bece(0x29e)]='Show\x20journey\x20statistics';async[a27_0x59bece(0x25e)](_0x48cd9b){const _0x26f4b5=a27_0x59bece,{options:_0x4b9cf0,args:_0x4dbec3,tdx:_0x1bf773}=_0x48cd9b,_0x23819f=_0x4dbec3[0x0];if(!requireNameOrPath(_0x23819f))return 0x1;_0x4b9cf0['verbose']&&console[_0x26f4b5(0x272)](_0x26f4b5(0x2ba)+_0x23819f);const _0x3391b4=_0x4b9cf0,_0xa5ae58=_0x3391b4['from'],_0x4a922f=_0x3391b4['to'],_0xa2ce09=_0x3391b4[_0x26f4b5(0x1eb)],_0x9f9785=_0x3391b4['stage'];_0xa2ce09&&!_0xa5ae58&&!_0x4a922f&&console[_0x26f4b5(0x272)](_0x26f4b5(0x24a));const _0x4f61b3=_0xa2ce09?withJsonFormat(_0x4b9cf0):_0x4b9cf0,{journeyId:_0x11ae62,journeyName:_0x3c8df6}=await resolveJourneyIdFromInput(_0x23819f,_0x4f61b3,_0x1bf773),_0x57bee4=_0xa5ae58||_0x4a922f?{'from':_0xa5ae58,'to':_0x4a922f}:undefined,_0x42d5c7=await withSpinner(_0x26f4b5(0x217),()=>Promise['all']([_0x1bf773[_0x26f4b5(0x1a8)]['getJourney'](_0x11ae62),_0x1bf773[_0x26f4b5(0x1a8)][_0x26f4b5(0x215)](_0x11ae62,_0x57bee4)]),{'verbose':_0x4f61b3[_0x26f4b5(0x1f7)]}),[_0x4e0d30,_0x1307cd]=_0x42d5c7[_0x26f4b5(0x1b0)];if(!_0x1307cd||_0x1307cd[_0x26f4b5(0x1d6)]===null)return console[_0x26f4b5(0x272)](_0x26f4b5(0x2b9)+_0x3c8df6),console[_0x26f4b5(0x272)](_0x26f4b5(0x274)),0x0;const _0x2507c5=buildStageNameMap(_0x4e0d30),_0x4a5716=!!(_0x57bee4&&_0x1307cd[_0x26f4b5(0x239)]?.[_0x26f4b5(0x1d9)]),_0x325b45={'stageNameMap':_0x2507c5,'hasPeriod':_0x4a5716,'includeHistory':!!_0xa2ce09};if(_0x9f9785&&_0x1307cd[_0x26f4b5(0x219)]){const _0x337cfa=_0x1307cd[_0x26f4b5(0x219)]['find'](_0x133533=>{const _0x5b5cd0=_0x26f4b5,_0x5e784c=_0x2507c5['get'](_0x133533['id'])??'';return _0x5e784c[_0x5b5cd0(0x26d)]()===_0x9f9785[_0x5b5cd0(0x26d)]();});if(_0x337cfa)return await handleSingleObjectOutput(formatStageStats(_0x337cfa,_0x325b45),_0x4f61b3),0x0;const _0x54c1f1=_0x1307cd[_0x26f4b5(0x219)]['map'](_0x413237=>_0x2507c5[_0x26f4b5(0x28b)](_0x413237['id'])??_0x413237['id']);return console[_0x26f4b5(0x272)](_0x26f4b5(0x22f)+_0x9f9785+_0x26f4b5(0x255)),console[_0x26f4b5(0x272)](_0x26f4b5(0x1d7)+_0x54c1f1[_0x26f4b5(0x1d4)](',\x20')),0x1;}const _0x18958b=_0x1307cd[_0x26f4b5(0x219)]?.['map'](_0x56c162=>formatStageStats(_0x56c162,_0x325b45)),_0x3692a6=assembleJourneyStats(_0x1307cd,{'from':_0xa5ae58,'to':_0x4a922f,'includeHistory':_0xa2ce09});return await this[_0x26f4b5(0x20c)](_0x3692a6,_0x18958b??[],_0x4f61b3),0x0;}async[a27_0x59bece(0x20c)](_0x4983a4,_0x5ceb73,_0x2be138){const _0x28b621=a27_0x59bece,_0x1efb15=_0x2be138['format']===_0x28b621(0x251)||_0x2be138[_0x28b621(0x2a5)]==='jsonl'||_0x2be138['json']||_0x2be138['jsonl'];if(_0x1efb15){_0x4983a4[_0x28b621(0x219)]=_0x5ceb73,await handleSingleObjectOutput(_0x4983a4,_0x2be138);return;}await handleSingleObjectOutput(_0x4983a4,_0x2be138);for(const _0x4f8385 of _0x5ceb73){console[_0x28b621(0x2b3)](''),console['log'](String(a27_0x581c34[_0x28b621(0x1ad)]['bold']('['+_0x4f8385[_0x28b621(0x1a5)]+']'))+a27_0x581c34[_0x28b621(0x26b)]('\x20'+_0x4f8385['id']));const {id:_0x15305d,name:_0x10cc8a,..._0xf9151f}=_0x4f8385;await handleSingleObjectOutput(_0xf9151f,_0x2be138);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x207);[a27_0x59bece(0x29e)]=a27_0x59bece(0x240);async[a27_0x59bece(0x25e)](_0x598e8d){const _0x4f1a6c=a27_0x59bece,{options:_0x1ab596,args:_0x4f2cb4,tdx:_0x197ff8}=_0x598e8d,_0x33ecb8=_0x4f2cb4[0x0];if(!requireNameOrPath(_0x33ecb8))return 0x1;_0x1ab596[_0x4f1a6c(0x1f7)]&&console[_0x4f1a6c(0x272)]('Input:\x20'+_0x33ecb8);const _0x25b6aa=_0x1ab596,_0x56f411=_0x25b6aa[_0x4f1a6c(0x1e8)],_0x314750=_0x25b6aa['from'],_0x78c3f=_0x25b6aa['to'],_0x1f3ed9=_0x25b6aa[_0x4f1a6c(0x23b)];if(_0x56f411&&_0x56f411!==_0x4f1a6c(0x27b)&&_0x56f411!==_0x4f1a6c(0x1f9))return console[_0x4f1a6c(0x272)]('Error:\x20Invalid\x20--type\x20\x22'+_0x56f411+_0x4f1a6c(0x268)),0x1;const _0x37e347=withJsonFormat(_0x1ab596),{journeyId:_0x1444c1,journeyName:_0x2e758a}=await resolveJourneyIdFromInput(_0x33ecb8,_0x37e347,_0x197ff8),_0x23e875={'type':_0x56f411,'from':_0x314750,'to':_0x78c3f,'limit':_0x1f3ed9},_0x112a8d=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x197ff8[_0x4f1a6c(0x1a8)][_0x4f1a6c(0x1ae)](_0x1444c1,_0x23e875),{'verbose':_0x37e347['verbose']}),_0x21ca10=_0x112a8d['data'],_0x2ee63f=_0x21ca10[_0x4f1a6c(0x27b)]&&(_0x21ca10[_0x4f1a6c(0x27b)]['nodes'][_0x4f1a6c(0x1d9)]>0x0||_0x21ca10[_0x4f1a6c(0x27b)]['links'][_0x4f1a6c(0x1d9)]>0x0),_0x31da43=_0x21ca10[_0x4f1a6c(0x1f9)]&&_0x21ca10['activation'][_0x4f1a6c(0x1d9)]>0x0;if(!_0x2ee63f&&!_0x31da43)return console[_0x4f1a6c(0x272)](_0x4f1a6c(0x230)+_0x2e758a),console['error'](_0x4f1a6c(0x262)),_0x314750&&_0x78c3f&&console[_0x4f1a6c(0x272)](_0x4f1a6c(0x25d)),0x0;return await handleSingleObjectOutput(_0x21ca10,_0x37e347),0x0;}}function formatStageStats(_0x34f6f8,_0x4e7255){const _0x4bd51c=a27_0x59bece,_0x35ef4f=_0x4e7255[_0x4bd51c(0x1e9)]&&_0x34f6f8['history']?.[_0x4bd51c(0x1d9)]?aggregateStageHistory(_0x34f6f8['history']):{'size':_0x34f6f8[_0x4bd51c(0x2bb)],'entered':_0x34f6f8[_0x4bd51c(0x1cb)],'milestone':_0x34f6f8['milestoneSize'],'milestone_rate':_0x34f6f8['completeMilestoneRate'],'exit_or_jump':_0x34f6f8[_0x4bd51c(0x2a6)],'exit_or_jump_rate':_0x34f6f8[_0x4bd51c(0x2be)]},_0x33fe0a={'id':_0x34f6f8['id'],'name':_0x4e7255['stageNameMap'][_0x4bd51c(0x28b)](_0x34f6f8['id'])??_0x34f6f8['id'],..._0x35ef4f};return _0x4e7255[_0x4bd51c(0x1e9)]&&_0x4e7255['includeHistory']&&_0x34f6f8[_0x4bd51c(0x239)]&&(_0x33fe0a[_0x4bd51c(0x239)]=_0x34f6f8[_0x4bd51c(0x239)]),_0x33fe0a;}export class JourneyPauseCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x254);[a27_0x59bece(0x29e)]=a27_0x59bece(0x1bc);async[a27_0x59bece(0x25e)](_0x33a32d){const _0x23903e=a27_0x59bece,{options:_0x336974,args:_0x2cf9a8,tdx:_0x261f06}=_0x33a32d,_0x46f64b=_0x2cf9a8[0x0];if(!requireNameOrPath(_0x46f64b))return 0x1;_0x336974[_0x23903e(0x1f7)]&&console[_0x23903e(0x272)](_0x23903e(0x2ba)+_0x46f64b);const {journeyId:_0x47b916,journeyName:_0x4cdd55}=await resolveJourneyIdFromInput(_0x46f64b,_0x336974,_0x261f06);if(!_0x336974[_0x23903e(0x198)]){const _0x45cfc1=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x4cdd55+'\x22?');if(!_0x45cfc1)return console['error'](_0x23903e(0x1ea)),0x0;}const _0x2f6afd=await withSpinner(_0x23903e(0x236),()=>_0x261f06[_0x23903e(0x1a8)]['pause'](_0x47b916),{'verbose':_0x336974[_0x23903e(0x1f7)]}),_0x405d84=_0x2f6afd[_0x23903e(0x1b0)];return console[_0x23903e(0x272)](_0x23903e(0x1e6)+_0x405d84['attributes'][_0x23903e(0x1a5)]+'\x22\x20paused'),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x2ab);['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a27_0x59bece(0x25e)](_0x479bd4){const _0x5a76a4=a27_0x59bece,{options:_0x584e60,args:_0x4d8aa3,tdx:_0x491111}=_0x479bd4,_0x5cb812=_0x4d8aa3[0x0];if(!requireNameOrPath(_0x5cb812))return 0x1;_0x584e60['verbose']&&console[_0x5a76a4(0x272)](_0x5a76a4(0x2ba)+_0x5cb812);const {journeyId:_0x440b9d,journeyName:_0x58217b}=await resolveJourneyIdFromInput(_0x5cb812,_0x584e60,_0x491111);if(_0x584e60['dryRun'])return await this[_0x5a76a4(0x19a)](_0x479bd4,_0x440b9d,_0x58217b);if(!_0x584e60[_0x5a76a4(0x198)]){const _0x2510d9=await confirm(_0x5a76a4(0x19d)+_0x58217b+'\x22?');if(!_0x2510d9)return console[_0x5a76a4(0x272)](_0x5a76a4(0x1ea)),0x0;}const _0x32c969=await withSpinner(_0x5a76a4(0x256),()=>_0x491111[_0x5a76a4(0x1a8)][_0x5a76a4(0x257)](_0x440b9d),{'verbose':_0x584e60['verbose']}),_0x223d1a=_0x32c969[_0x5a76a4(0x1b0)],_0x2ef917=getWorkflowSessionUrl(_0x584e60[_0x5a76a4(0x231)],_0x223d1a[_0x5a76a4(0x28c)],_0x223d1a['workflowSessionId']);return console[_0x5a76a4(0x272)]('\x0a'+a27_0x581c34[_0x5a76a4(0x22e)]('✔')+_0x5a76a4(0x288)),console[_0x5a76a4(0x272)]('\x20\x20'+a27_0x581c34[_0x5a76a4(0x26b)]('Journey:')+'\x20'+_0x58217b),console[_0x5a76a4(0x272)]('\x20\x20'+a27_0x581c34['dim']('Status:')+'\x20'+_0x223d1a[_0x5a76a4(0x233)]),console[_0x5a76a4(0x272)]('\x20\x20'+a27_0x581c34['dim']('Session:')+'\x20'+_0x223d1a[_0x5a76a4(0x25a)]),console[_0x5a76a4(0x272)]('\x20\x20'+_0x2ef917),0x0;}async[a27_0x59bece(0x19a)](_0x31a1ca,_0x3315c9,_0x35eb7f){const _0x1a7825=a27_0x59bece,{options:_0x4eedf2,tdx:_0x280810}=_0x31a1ca,_0x263677=await withSpinner(_0x1a7825(0x1fe)+_0x35eb7f+_0x1a7825(0x2b1),()=>Promise[_0x1a7825(0x1ca)]([_0x280810[_0x1a7825(0x1a8)]['getJourney'](_0x3315c9),_0x280810[_0x1a7825(0x1a8)]['listActivationsFlat'](_0x3315c9)]),{'verbose':_0x4eedf2[_0x1a7825(0x1f7)]}),[_0x43694f,_0x162c9a]=_0x263677['data'],_0x3bade5=_0x43694f[_0x1a7825(0x249)],_0x13a3bc=_0x3bade5[_0x1a7825(0x1d8)];console[_0x1a7825(0x2b3)](a27_0x581c34[_0x1a7825(0x1fd)](_0x1a7825(0x216)),_0x3bade5[_0x1a7825(0x1a5)]),console[_0x1a7825(0x2b3)](a27_0x581c34['bold'](_0x1a7825(0x232)),_0x43694f['id']),console[_0x1a7825(0x2b3)](a27_0x581c34[_0x1a7825(0x1fd)](_0x1a7825(0x235)),_0x3bade5[_0x1a7825(0x223)]),console[_0x1a7825(0x2b3)](a27_0x581c34['bold'](_0x1a7825(0x20a)),_0x3bade5[_0x1a7825(0x1e3)]?a27_0x581c34[_0x1a7825(0x1cd)](_0x1a7825(0x198)):a27_0x581c34[_0x1a7825(0x22e)]('no')),console[_0x1a7825(0x2b3)](a27_0x581c34[_0x1a7825(0x1fd)](_0x1a7825(0x1c4)),_0x3bade5[_0x1a7825(0x297)]);const _0x56fda8=_0x13a3bc['length']>0x0?'\x20('+_0x13a3bc[_0x1a7825(0x1ba)](_0x2115e5=>_0x2115e5[_0x1a7825(0x1a5)])[_0x1a7825(0x1d4)](',\x20')+')':'';console[_0x1a7825(0x2b3)](a27_0x581c34[_0x1a7825(0x1fd)](_0x1a7825(0x237)),''+_0x13a3bc[_0x1a7825(0x1d9)]+_0x56fda8),console['log']('');if(_0x162c9a['length']===0x0)console[_0x1a7825(0x2b3)](a27_0x581c34[_0x1a7825(0x1fd)](_0x1a7825(0x1df)),a27_0x581c34[_0x1a7825(0x26b)](_0x1a7825(0x1c7)));else{console[_0x1a7825(0x2b3)](a27_0x581c34['bold']('Activations:'));for(const _0x2497af of _0x162c9a){const _0x49e943=_0x2497af['name']??_0x1a7825(0x24e),_0x46779b=_0x2497af[_0x1a7825(0x238)]!=null?_0x1a7825(0x23c)+_0x2497af[_0x1a7825(0x238)]:_0x1a7825(0x2c3),_0xcd2bd1=_0x2497af[_0x1a7825(0x25f)]?''+_0x2497af['scheduleType']+(_0x2497af['runAt']?_0x1a7825(0x298)+_0x2497af['runAt']:''):_0x1a7825(0x1d2),_0x4581e7=_0x2497af[_0x1a7825(0x291)]?_0x1a7825(0x260):'';console[_0x1a7825(0x2b3)]('\x20\x20'+a27_0x581c34['yellow']('⚠️\x20')+'\x20'+_0x49e943+_0x1a7825(0x196)+_0x46779b+_0x1a7825(0x21b)+_0xcd2bd1+_0x4581e7);}}return console[_0x1a7825(0x2b3)](a27_0x581c34[_0x1a7825(0x1cd)](_0x1a7825(0x1bb))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x1a4);[a27_0x59bece(0x29e)]='Resume\x20a\x20paused\x20journey';async[a27_0x59bece(0x25e)](_0x4d43ef){const _0x2439f2=a27_0x59bece,{options:_0x291c73,args:_0x4c1549,tdx:_0x1d6e08}=_0x4d43ef,_0x1287b3=_0x4c1549[0x0];if(!requireNameOrPath(_0x1287b3))return 0x1;_0x291c73[_0x2439f2(0x1f7)]&&console[_0x2439f2(0x272)](_0x2439f2(0x2ba)+_0x1287b3);const {journeyId:_0x1a5b62,journeyName:_0x5d87fa}=await resolveJourneyIdFromInput(_0x1287b3,_0x291c73,_0x1d6e08);if(_0x291c73['dryRun'])return await this['executeDryRun'](_0x4d43ef,_0x1a5b62,_0x5d87fa);if(!_0x291c73['yes']){const _0x6f2fe8=await confirm(_0x2439f2(0x20f)+_0x5d87fa+'\x22?');if(!_0x6f2fe8)return console[_0x2439f2(0x272)](_0x2439f2(0x1ea)),0x0;}const _0x2462ff=await withSpinner(_0x2439f2(0x1bd),()=>_0x1d6e08[_0x2439f2(0x1a8)][_0x2439f2(0x1dc)](_0x1a5b62),{'verbose':_0x291c73['verbose']}),_0xbf253d=_0x2462ff[_0x2439f2(0x1b0)];return console[_0x2439f2(0x272)](_0x2439f2(0x1e6)+_0xbf253d[_0x2439f2(0x249)][_0x2439f2(0x1a5)]+_0x2439f2(0x24f)),0x0;}async[a27_0x59bece(0x19a)](_0x1ddc68,_0x210cb1,_0x28d506){const _0x366859=a27_0x59bece,{options:_0x29c59f,tdx:_0x55692b}=_0x1ddc68,_0x2c8dbd=await withSpinner(_0x366859(0x1fe)+_0x28d506+_0x366859(0x2b1),()=>Promise[_0x366859(0x1ca)]([_0x55692b['journey']['getJourney'](_0x210cb1),_0x55692b['journey'][_0x366859(0x225)](_0x210cb1)]),{'verbose':_0x29c59f['verbose']}),[_0x17145f,_0x179c9d]=_0x2c8dbd[_0x366859(0x1b0)],_0x2fe5be=_0x17145f[_0x366859(0x249)],_0x46eccc=_0x2fe5be[_0x366859(0x1d8)];console[_0x366859(0x2b3)](a27_0x581c34['bold'](_0x366859(0x216)),_0x2fe5be['name']),console[_0x366859(0x2b3)](a27_0x581c34['bold'](_0x366859(0x232)),_0x17145f['id']),console['log'](a27_0x581c34[_0x366859(0x1fd)](_0x366859(0x235)),_0x2fe5be['state']),console[_0x366859(0x2b3)](a27_0x581c34[_0x366859(0x1fd)](_0x366859(0x20a)),_0x2fe5be[_0x366859(0x1e3)]?a27_0x581c34[_0x366859(0x1cd)](_0x366859(0x198)):a27_0x581c34[_0x366859(0x22e)]('no'));_0x2fe5be[_0x366859(0x27f)]&&console[_0x366859(0x2b3)](a27_0x581c34[_0x366859(0x1fd)](_0x366859(0x2c2)),_0x2fe5be[_0x366859(0x27f)]);console[_0x366859(0x2b3)](a27_0x581c34[_0x366859(0x1fd)](_0x366859(0x1c4)),_0x2fe5be[_0x366859(0x297)]);const _0x4ea78a=_0x46eccc[_0x366859(0x1d9)]>0x0?'\x20('+_0x46eccc[_0x366859(0x1ba)](_0x529a81=>_0x529a81[_0x366859(0x1a5)])[_0x366859(0x1d4)](',\x20')+')':'';console[_0x366859(0x2b3)](a27_0x581c34[_0x366859(0x1fd)](_0x366859(0x237)),''+_0x46eccc['length']+_0x4ea78a),console[_0x366859(0x2b3)]('');if(_0x179c9d[_0x366859(0x1d9)]===0x0)console['log'](a27_0x581c34[_0x366859(0x1fd)](_0x366859(0x1df)),a27_0x581c34['dim']('(none)'));else{console[_0x366859(0x2b3)](a27_0x581c34['bold'](_0x366859(0x1df)));for(const _0xb30fc0 of _0x179c9d){const _0x2c4d1c=_0xb30fc0[_0x366859(0x1a5)]??_0x366859(0x24e),_0x559f9c=_0xb30fc0[_0x366859(0x238)]!=null?_0x366859(0x23c)+_0xb30fc0[_0x366859(0x238)]:_0x366859(0x2c3),_0x3ec077=_0xb30fc0[_0x366859(0x25f)]?''+_0xb30fc0['scheduleType']+(_0xb30fc0[_0x366859(0x261)]?_0x366859(0x298)+_0xb30fc0[_0x366859(0x261)]:''):_0x366859(0x1d2),_0x368048=_0xb30fc0[_0x366859(0x291)]?_0x366859(0x260):'';console[_0x366859(0x2b3)]('\x20\x20'+a27_0x581c34[_0x366859(0x1cd)](_0x366859(0x25b))+'\x20'+_0x2c4d1c+_0x366859(0x196)+_0x559f9c+_0x366859(0x21b)+_0x3ec077+_0x368048);}}return console[_0x366859(0x2b3)](a27_0x581c34[_0x366859(0x1cd)](_0x366859(0x206))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x221);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x59bece(0x25e)](_0x5402e6){const _0x1222d8=a27_0x59bece,{options:_0xff169f,args:_0x4ddc73,tdx:_0x45593e}=_0x5402e6,_0x543f5c=_0xff169f,_0xab8107=_0x4ddc73[0x0],_0x5c3ad6=_0xab8107&&isYamlFilePath(_0xab8107),_0x308473=await resolveTarget({'arg':_0x5c3ad6?_0xab8107:undefined,'contextParent':_0xff169f[_0x1222d8(0x1e1)],'cwd':process[_0x1222d8(0x1b5)]()});if(!isSuccessfulResolution(_0x308473))return _0x308473[_0x1222d8(0x246)]===_0x1222d8(0x203)?(console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x1cd)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1222d8(0x272)](_0x1222d8(0x21a)),console[_0x1222d8(0x272)](_0x1222d8(0x2c0)),console[_0x1222d8(0x272)](_0x1222d8(0x1c2)),console['error'](_0x1222d8(0x1a9))):(console['error'](a27_0x581c34[_0x1222d8(0x299)](_0x1222d8(0x214)+_0x308473['message']+'\x0a')),_0x308473[_0x1222d8(0x22a)]&&console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x1ad)](_0x308473['helpText']))),0x1;let _0x453aff=_0x5c3ad6?undefined:_0xab8107,_0x219f8f,_0x2a744e;_0x308473[_0x1222d8(0x1e8)]===_0x1222d8(0x278)&&(_0x453aff=_0x308473[_0x1222d8(0x2b8)],_0x219f8f=_0x308473[_0x1222d8(0x1ec)],_0x2a744e=_0x308473[_0x1222d8(0x24d)]);const _0x2bff25=_0x308473[_0x1222d8(0x2c4)],_0x28525c=_0x308473['targetDir'];_0x543f5c[_0x1222d8(0x1f7)]&&(console[_0x1222d8(0x272)](_0x1222d8(0x244)+_0x2bff25),console[_0x1222d8(0x272)](_0x1222d8(0x201)+_0x28525c),_0x453aff&&console['error'](_0x1222d8(0x205)+_0x453aff),_0x219f8f&&console[_0x1222d8(0x272)](_0x1222d8(0x29f)+_0x219f8f),_0x2a744e&&console['error'](_0x1222d8(0x25c)+_0x2a744e));const _0x3624cc=await withSpinner(_0x1222d8(0x2b6),()=>_0x45593e['segment']['resolveParentId'](_0x2bff25),{'verbose':_0xff169f[_0x1222d8(0x1f7)]}),_0x2359a6=_0x3624cc['data'],{journeys:_0x3048aa,folders:_0x415f72}=await withSpinner(_0x1222d8(0x20b),async()=>{const _0x261da6=_0x1222d8,[_0x53cab9,_0x2dcb9c]=await Promise[_0x261da6(0x1ca)]([_0x45593e['journey'][_0x261da6(0x289)](_0x2359a6,undefined,{'includeAllVersions':!![]}),_0x45593e['segment'][_0x261da6(0x22d)](_0x2359a6)]);return{'journeys':_0x53cab9,'folders':_0x2dcb9c};},{'verbose':_0xff169f[_0x1222d8(0x1f7)]})[_0x1222d8(0x1a1)](_0x3a1e27=>_0x3a1e27['data']);let _0x1f871f=_0x3048aa;const _0x1aae88=buildFolderIdToPathMap(_0x415f72);if(_0x453aff){const _0x3c9a68=_0x1f871f['filter'](_0x28e9c1=>_0x28e9c1[_0x1222d8(0x1da)][_0x1222d8(0x26d)]()===_0x453aff[_0x1222d8(0x26d)]());if(_0x3c9a68[_0x1222d8(0x1d9)]===0x0)return console['error'](_0x1222d8(0x27a)+_0x453aff),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x1f871f=_0x3c9a68;}if(_0x2a744e!==undefined){const _0x1767e6=_0x1f871f[_0x1222d8(0x1c3)](_0x1bf28d=>{const _0x511440=_0x1222d8,_0x15d6e4=_0x1bf28d['folderId']?_0x1aae88[_0x511440(0x28b)](_0x1bf28d[_0x511440(0x267)])||'':'';return _0x15d6e4===_0x2a744e;});if(_0x1767e6['length']===0x0&&_0x1f871f[_0x1222d8(0x1d9)]>0x0){console[_0x1222d8(0x272)](_0x1222d8(0x2b4)+_0x453aff+_0x1222d8(0x1a2)+(_0x2a744e||_0x1222d8(0x1f5))),console[_0x1222d8(0x272)](_0x1222d8(0x241));for(const _0x2f654e of _0x1f871f){const _0x360a0a=_0x2f654e[_0x1222d8(0x267)]?_0x1aae88['get'](_0x2f654e[_0x1222d8(0x267)])||'':'';console[_0x1222d8(0x272)](_0x1222d8(0x23a)+(_0x360a0a||_0x1222d8(0x1ab))+'/'+_0x2f654e['journeyBundleName']);}return 0x1;}_0x1f871f=_0x1767e6;}if(_0x1f871f[_0x1222d8(0x1d9)]===0x0)return console[_0x1222d8(0x272)](_0x1222d8(0x279)),0x0;const _0x246ee0=new Map();for(const _0xc38c16 of _0x1f871f){const _0x5c38d6=_0xc38c16[_0x1222d8(0x28e)];!_0x246ee0['has'](_0x5c38d6)&&_0x246ee0['set'](_0x5c38d6,[]),_0x246ee0[_0x1222d8(0x28b)](_0x5c38d6)[_0x1222d8(0x2aa)](_0xc38c16);}for(const _0x8e4e51 of _0x246ee0[_0x1222d8(0x1b2)]()){_0x8e4e51[_0x1222d8(0x2bd)]((_0x1c868b,_0xb34dc7)=>(_0x1c868b[_0x1222d8(0x212)]||0x0)-(_0xb34dc7['versionNumber']||0x0));}const _0x393e5d=[],{idToEmailMap:_0x2f8687,connectionIdToNameMap:_0x20f7c2}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x1fc91f=_0x1222d8,[_0x2d8758,_0x2dd11d]=await Promise['all']([_0x45593e[_0x1fc91f(0x200)][_0x1fc91f(0x1be)](),_0x45593e['connection'][_0x1fc91f(0x2b0)]()]);return{'idToEmailMap':_0x2d8758,'connectionIdToNameMap':_0x2dd11d};},{'verbose':_0xff169f[_0x1222d8(0x1f7)]})[_0x1222d8(0x1a1)](_0x450525=>_0x450525['data']);for(const _0x18397c of _0x246ee0[_0x1222d8(0x1b2)]()){const _0x311ca2=_0x18397c[0x0][_0x1222d8(0x1da)],_0x433df6=_0x18397c[0x0]['folderId'],_0x350bc6=_0x433df6?_0x1aae88['get'](_0x433df6)||'':'',_0x23a07d=_0x350bc6?a27_0x50ef65[_0x1222d8(0x1d4)](_0x28525c,_0x350bc6):_0x28525c,_0x115056=_0x219f8f||a27_0x50ef65[_0x1222d8(0x1d4)](_0x23a07d,sanitizeFileName(_0x311ca2)+_0x1222d8(0x1de));let _0x1d92d6,_0xa39ecd;if(existsSync(_0x115056))try{const _0x353bd7=readFileSync(_0x115056,'utf-8'),_0x46a845=parseYamlString(_0x353bd7);_0xa39ecd=_0x46a845,_0x1d92d6=buildRuleToNameMapping(_0x46a845),_0x543f5c[_0x1222d8(0x1f7)]&&_0x1d92d6['size']>0x0&&console['error'](_0x1222d8(0x1c1)+_0x1d92d6[_0x1222d8(0x2bb)]+_0x1222d8(0x287)+_0x311ca2);}catch(_0x5af65e){_0x543f5c[_0x1222d8(0x1f7)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x5af65e['message']);}const _0x3d7f48=[],_0x3fc7a4=new Set(),_0x42bcaf=new Map(),_0x409c3a=new Map(),_0xbb894e=new Set(),_0x19ea26=new Map(),_0x10d8cb=new Map(),_0x1b0da5=createJumpTargetCache();await withProgressSpinner(_0x1222d8(0x220)+_0x311ca2+_0x1222d8(0x2b1),async _0x558268=>{const _0x41d69e=_0x1222d8;for(const _0x182218 of _0x18397c){const _0x22a168=_0x18397c['length']>0x1?_0x182218[_0x41d69e(0x1da)]+'\x20v'+(_0x182218['versionNumber']||0x1):_0x182218[_0x41d69e(0x1da)];_0x558268[_0x41d69e(0x1dd)]('Fetching\x20'+_0x22a168);const _0x4971f9=await _0x45593e[_0x41d69e(0x1a8)][_0x41d69e(0x1f4)](_0x182218['id']),_0x50151c=_0x4971f9[_0x41d69e(0x249)]?.[_0x41d69e(0x297)],_0x3871dd={'resolveSegment':async _0x5c3eb5=>{const _0x586058=_0x41d69e;if(!_0x50151c)return{'name':_0x5c3eb5,'isJourneyLocal':![]};const _0x48c1a5=_0x42bcaf[_0x586058(0x28b)](_0x5c3eb5);if(_0x48c1a5)return _0x48c1a5;try{const _0x3f108c=await _0x45593e[_0x586058(0x1f8)][_0x586058(0x218)](_0x50151c,_0x5c3eb5),_0x5cb83f=_0x3f108c[_0x586058(0x2bc)]===SEGMENT_KIND_JOURNEY;let _0xf35966,_0x2435b4=_0x3f108c[_0x586058(0x1a5)];if(_0x5cb83f&&_0x3f108c['rule']){const _0x332da4=await segmentResponseToDef(_0x3f108c,{'resolveSegmentName':async _0x35b002=>{const _0x4cfdb8=_0x586058,_0x15d264=_0x42bcaf[_0x4cfdb8(0x28b)](_0x35b002);if(_0x15d264)return _0x15d264[_0x4cfdb8(0x1a5)];const _0x4fcaf6=await _0x3871dd[_0x4cfdb8(0x248)](_0x35b002);return _0x4fcaf6[_0x4cfdb8(0x1a5)];}}),_0x17aaf4=_0x332da4[_0x586058(0x197)];_0xf35966={'description':_0x3f108c[_0x586058(0x29e)],'rule':_0x17aaf4};const _0x7bcacd=serializeRule(_0x17aaf4),_0x46f380=_0x409c3a['get'](_0x7bcacd);if(_0x46f380)_0x2435b4=_0x46f380,_0xf35966=undefined,_0x543f5c['verbose']&&console[_0x586058(0x272)](_0x586058(0x281)+_0x3f108c['name']+'\x20->\x20'+_0x46f380);else{let _0x3c5ab0=![];if(_0x1d92d6){const _0x31bfef=_0x1d92d6[_0x586058(0x28b)](_0x7bcacd);if(_0x31bfef){const _0x799566=_0x31bfef[_0x586058(0x1c8)](_0x1e16b5=>!_0x3fc7a4['has'](_0x1e16b5));_0x799566&&(_0x2435b4=_0x799566,_0x3fc7a4[_0x586058(0x24b)](_0x799566),_0x409c3a[_0x586058(0x252)](_0x7bcacd,_0x799566),_0x3c5ab0=!![],_0x543f5c[_0x586058(0x1f7)]&&console[_0x586058(0x272)](_0x586058(0x28d)+_0x799566+'\x20(rule\x20match)'));}}if(!_0x3c5ab0){const _0xc2076d=generateJourneyLocalName(_0x3f108c[_0x586058(0x1a5)]);_0xc2076d&&(_0x2435b4=_0xc2076d);let _0x3bb04d=_0x2435b4,_0x5ac855=0x2;while(_0x3fc7a4[_0x586058(0x2b2)](_0x3bb04d)){_0x3bb04d=_0x2435b4+'_'+_0x5ac855,_0x5ac855++;}_0x3fc7a4['add'](_0x3bb04d),_0x409c3a[_0x586058(0x252)](_0x7bcacd,_0x3bb04d),_0x2435b4=_0x3bb04d;}}}const _0x5edfbd={'name':_0x2435b4,'isJourneyLocal':_0x5cb83f,'definition':_0xf35966};return _0x42bcaf['set'](_0x5c3eb5,_0x5edfbd),_0x5edfbd;}catch(_0x56027f){return _0xff169f[_0x586058(0x1f7)]&&console[_0x586058(0x272)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x5c3eb5+':\x20'+_0x56027f[_0x586058(0x1b4)]),{'name':_0x5c3eb5,'isJourneyLocal':![]};}},'resolveActivation':async _0x2fc6c6=>{const _0x38653e=_0x41d69e,_0x2232e0=_0x19ea26[_0x38653e(0x28b)](_0x2fc6c6);if(_0x2232e0)return _0x2232e0;try{const _0xf83220=await _0x45593e[_0x38653e(0x1a8)][_0x38653e(0x1ef)](_0x182218['id'],_0x2fc6c6),_0x5b92aa=journeyActivationStepToYaml(_0xf83220,_0x2f8687,_0x20f7c2),_0x2dde65=JSON[_0x38653e(0x286)]({'name':_0x5b92aa[_0x38653e(0x1a5)],'connection':_0x5b92aa['connection'],'connector_config':_0x5b92aa[_0x38653e(0x1f2)]}),_0x813aef=_0x10d8cb['get'](_0x2dde65);if(_0x813aef){const _0x5132a9={'name':_0x813aef,'isJourneyLocal':!![],'definition':_0x5b92aa};return _0x19ea26['set'](_0x2fc6c6,_0x5132a9),_0x5132a9;}const _0x3c0a68=_0xf83220[_0x38653e(0x249)]['activationParams'][_0x38653e(0x1a5)]||_0x2fc6c6,_0x53f1b2=sanitizeYamlKey(_0x3c0a68)||_0x38653e(0x23f)+_0x2fc6c6;let _0x1e13c4=_0x53f1b2,_0x3762b7=0x2;while(_0xbb894e['has'](_0x1e13c4)){_0x1e13c4=_0x53f1b2+'_'+_0x3762b7,_0x3762b7++;}_0xbb894e[_0x38653e(0x24b)](_0x1e13c4),_0x10d8cb['set'](_0x2dde65,_0x1e13c4);const _0x24ad49={'name':_0x1e13c4,'isJourneyLocal':!![],'definition':_0x5b92aa};return _0x19ea26[_0x38653e(0x252)](_0x2fc6c6,_0x24ad49),_0x24ad49;}catch(_0x3fafd0){return _0xff169f['verbose']&&console[_0x38653e(0x272)](_0x38653e(0x1af)+_0x2fc6c6+':\x20'+_0x3fafd0[_0x38653e(0x1b4)]),{'name':_0x2fc6c6,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x432ff1,_0x308ddf)=>{const _0xc65f40=_0x41d69e;return resolveJumpTarget(_0x432ff1,_0x308ddf,_0x1b0da5,_0x8ba3bb=>_0x45593e[_0xc65f40(0x1a8)]['getJourney'](_0x8ba3bb));}},_0x485a96=await journeyResponseToDef(_0x4971f9,_0x3871dd);_0x3d7f48['push']({'item':_0x182218,'yaml':_0x485a96});}},{'verbose':_0xff169f[_0x1222d8(0x1f7)]});const _0xfcbe5c=await _0x45593e[_0x1222d8(0x1a8)][_0x1222d8(0x26a)](_0x18397c[0x0][_0x1222d8(0x28e)]),_0x5abfbe=buildMergedJourneyDef(_0x3d7f48,_0x1d92d6,_0xfcbe5c),_0x5db694=normalizeJourneyDef(_0x5abfbe,_0xa39ecd),_0x27dff2=toYamlString(_0x5db694),_0x12fe22=_0x219f8f||a27_0x50ef65[_0x1222d8(0x1d4)](_0x23a07d,sanitizeFileName(_0x311ca2)+_0x1222d8(0x1de));!_0x219f8f&&_0x350bc6&&!existsSync(_0x23a07d)&&mkdirSync(_0x23a07d,{'recursive':!![]});const _0x14f5c2=a27_0x50ef65[_0x1222d8(0x245)](process['cwd'](),_0x12fe22);if(existsSync(_0x12fe22)){const _0x2edd05=readFileSync(_0x12fe22,_0x1222d8(0x1aa)),_0x4d15f7=generateDiff(_0x2edd05,_0x27dff2),_0xe99f1d=hasChanges(_0x4d15f7);_0x393e5d[_0x1222d8(0x2aa)]({'relativePath':_0x14f5c2,'absolutePath':_0x12fe22,'content':_0x27dff2,'isNew':![],'hasChanges':_0xe99f1d,'diff':_0xe99f1d?formatDiffWithColors(_0x4d15f7):undefined});}else _0x393e5d[_0x1222d8(0x2aa)]({'relativePath':_0x14f5c2,'absolutePath':_0x12fe22,'content':_0x27dff2,'isNew':!![],'hasChanges':![]});}const _0x423279=_0x393e5d[_0x1222d8(0x1c3)](_0x459cc7=>_0x459cc7[_0x1222d8(0x1bf)]),_0xa1aa63=_0x393e5d[_0x1222d8(0x1c3)](_0x58dfb3=>!_0x58dfb3[_0x1222d8(0x1bf)]&&_0x58dfb3[_0x1222d8(0x1d3)]),_0x534073=_0x393e5d[_0x1222d8(0x1c3)](_0xd4efc=>!_0xd4efc[_0x1222d8(0x1bf)]&&!_0xd4efc[_0x1222d8(0x1d3)]),_0x46b42b=_0x1f871f[_0x1222d8(0x1d9)],_0x1f9bc0=_0x246ee0[_0x1222d8(0x2bb)],_0x1c9eb0=_0x46b42b>_0x1f9bc0?'\x20('+_0x46b42b+_0x1222d8(0x290):'';console[_0x1222d8(0x272)](_0x1222d8(0x1a3)),console[_0x1222d8(0x272)]('\x20\x20'+a27_0x581c34[_0x1222d8(0x1ad)](_0x1f9bc0+'\x20journeys')+a27_0x581c34[_0x1222d8(0x26b)](_0x1c9eb0)),console[_0x1222d8(0x272)]('\x20\x20'+a27_0x581c34['green']('+\x20'+_0x423279[_0x1222d8(0x1d9)]+_0x1222d8(0x2a0))),console[_0x1222d8(0x272)]('\x20\x20'+a27_0x581c34[_0x1222d8(0x1cd)]('~\x20'+_0xa1aa63[_0x1222d8(0x1d9)]+_0x1222d8(0x2a3))),console[_0x1222d8(0x272)]('\x20\x20'+a27_0x581c34[_0x1222d8(0x26b)]('=\x20'+_0x534073[_0x1222d8(0x1d9)]+_0x1222d8(0x19f))),console[_0x1222d8(0x272)](_0x1222d8(0x1db)+a27_0x581c34[_0x1222d8(0x1ad)](_0x28525c)+'\x0a');if(_0xa1aa63[_0x1222d8(0x1d9)]>0x0)for(const _0x5e888c of _0xa1aa63){console[_0x1222d8(0x272)](_0x1222d8(0x1ed)+_0x5e888c[_0x1222d8(0x2a9)]+'\x27:'),console[_0x1222d8(0x272)]('─'['repeat'](0x3c)),console['error'](_0x5e888c[_0x1222d8(0x1c9)]),console[_0x1222d8(0x272)]('─'['repeat'](0x3c));}if(_0x543f5c[_0x1222d8(0x28f)])return console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x1cd)](_0x1222d8(0x1b6))),0x0;if(_0x423279[_0x1222d8(0x1d9)]===0x0&&_0xa1aa63[_0x1222d8(0x1d9)]===0x0)return console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x22e)](_0x1222d8(0x26c))),saveSessionContext({'parent_segment':_0x2bff25},_0x543f5c[_0x1222d8(0x275)]),console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x22e)](_0x1222d8(0x250)+a27_0x581c34[_0x1222d8(0x26b)]('parent_segment')+_0x1222d8(0x1e7)+a27_0x581c34['cyan'](_0x2bff25))),0x0;if(!_0x543f5c['yes']&&(_0x423279[_0x1222d8(0x1d9)]>0x0||_0xa1aa63[_0x1222d8(0x1d9)]>0x0)){if(!isInteractive())return console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x299)]('\x0aError:'),_0x1222d8(0x296)),console['error'](a27_0x581c34[_0x1222d8(0x26b)](_0x1222d8(0x23d))),0x1;const _0x1ac6d8=await confirmKey('Write\x20'+(_0x423279['length']+_0xa1aa63[_0x1222d8(0x1d9)])+'\x20files?');if(!_0x1ac6d8)return console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x1cd)](_0x1222d8(0x271)),_0x1222d8(0x1c0)),0x1;}!existsSync(_0x28525c)&&mkdirSync(_0x28525c,{'recursive':!![]});const _0x4fc8e6=a27_0x50ef65['join'](_0x28525c,_0x1222d8(0x234));writeFileSync(_0x4fc8e6,createTdxConfigContent(_0x2bff25),_0x1222d8(0x1aa));for(const _0x5340e6 of _0x393e5d){(_0x5340e6[_0x1222d8(0x1bf)]||_0x5340e6['hasChanges'])&&writeFileSync(_0x5340e6[_0x1222d8(0x283)],_0x5340e6[_0x1222d8(0x1ce)],'utf-8');}return console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x22e)]('✔\x20Pulled\x20'+(_0x423279['length']+_0xa1aa63[_0x1222d8(0x1d9)])+_0x1222d8(0x284)+_0x28525c)),saveSessionContext({'parent_segment':_0x2bff25},_0x543f5c[_0x1222d8(0x275)]),console[_0x1222d8(0x272)](a27_0x581c34[_0x1222d8(0x22e)](_0x1222d8(0x250)+a27_0x581c34[_0x1222d8(0x26b)](_0x1222d8(0x294))+_0x1222d8(0x1e7)+a27_0x581c34[_0x1222d8(0x1ad)](_0x2bff25))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a27_0x59bece(0x29e)]=a27_0x59bece(0x2bf);async[a27_0x59bece(0x25e)](_0x59e05d){const _0x55e4e0=a27_0x59bece,{options:_0x134ee9,args:_0x5237b7,tdx:_0x2e9b3d}=_0x59e05d,_0x1ac70b=_0x5237b7[0x0];if(!requireNameOrPath(_0x1ac70b))return 0x1;_0x134ee9[_0x55e4e0(0x1f7)]&&console[_0x55e4e0(0x272)]('Input:\x20'+_0x1ac70b);const {journeyId:_0x1e0c2b}=await resolveJourneyIdFromInput(_0x1ac70b,_0x134ee9,_0x2e9b3d),_0x1c445e=await withSpinner('Getting\x20column\x20mapping...',()=>_0x2e9b3d[_0x55e4e0(0x1a8)][_0x55e4e0(0x22b)](_0x1e0c2b),{'verbose':_0x134ee9['verbose']}),_0x54b891=_0x1c445e[_0x55e4e0(0x1b0)];return console[_0x55e4e0(0x2b3)](_0x55e4e0(0x263)+_0x54b891['database']),console[_0x55e4e0(0x2b3)](_0x55e4e0(0x277)+_0x54b891[_0x55e4e0(0x21f)]),await handleSDKOutput(_0x54b891[_0x55e4e0(0x1cf)],_0x134ee9),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x59bece(0x1a5)]='journey:activations';[a27_0x59bece(0x29e)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x59bece(0x25e)](_0x2bf0fd){const _0x4cf4a2=a27_0x59bece,{options:_0x3d838b,args:_0x4a4365,tdx:_0x1a7325}=_0x2bf0fd,_0x305fd2=_0x4a4365[0x0];if(!requireNameOrPath(_0x305fd2))return 0x1;_0x3d838b[_0x4cf4a2(0x1f7)]&&console[_0x4cf4a2(0x272)](_0x4cf4a2(0x2ba)+_0x305fd2);const {journeyId:_0x169dec}=await resolveJourneyIdFromInput(_0x305fd2,_0x3d838b,_0x1a7325),_0x965080=await withSpinner(_0x4cf4a2(0x266),()=>_0x1a7325[_0x4cf4a2(0x1a8)][_0x4cf4a2(0x225)](_0x169dec),{'verbose':_0x3d838b[_0x4cf4a2(0x1f7)]}),_0x4a2df9=_0x965080['data'];return console['error'](_0x4cf4a2(0x1c1)+_0x4a2df9[_0x4cf4a2(0x1d9)]+_0x4cf4a2(0x22c)+(_0x4a2df9[_0x4cf4a2(0x1d9)]!==0x1?'s':'')),await handleSDKOutput(_0x4a2df9,_0x3d838b),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x59bece(0x2ac);['description']=a27_0x59bece(0x26e);[a27_0x59bece(0x270)]=new SegmentPushCommand();async['execute'](_0x3c16ca){const _0x80598c=a27_0x59bece,_0x5095ea=_0x3c16ca[_0x80598c(0x280)][0x0];let _0x429d9f;if(_0x5095ea){const _0x23c666=await resolveTarget({'arg':_0x5095ea,'contextParent':_0x3c16ca[_0x80598c(0x264)][_0x80598c(0x1e1)],'cwd':process[_0x80598c(0x1b5)]()});isSuccessfulResolution(_0x23c666)&&_0x23c666[_0x80598c(0x1e8)]===_0x80598c(0x278)&&(_0x429d9f=_0x23c666[_0x80598c(0x1ec)]);}const _0x23f1de={..._0x3c16ca,'options':{..._0x3c16ca[_0x80598c(0x264)],'journeysOnly':!![],..._0x429d9f&&{'singleFilePath':_0x429d9f}}};return this[_0x80598c(0x270)][_0x80598c(0x25e)](_0x23f1de);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x29a);[a27_0x59bece(0x29e)]=a27_0x59bece(0x20e);async[a27_0x59bece(0x25e)](_0x3478a5){const _0x44e656=a27_0x59bece,{options:_0x3773cb,args:_0x5aca08,tdx:_0x4bad4f}=_0x3478a5,_0x5f4ba8=_0x5aca08[0x0];if(!requireNameOrPath(_0x5f4ba8))return 0x1;if(_0x3773cb['verbose'])console[_0x44e656(0x272)](_0x44e656(0x2ba)+_0x5f4ba8);const {journeyId:_0x538358}=await resolveJourneyIdFromInput(_0x5f4ba8,_0x3773cb,_0x4bad4f),_0x3eef1d=await withSpinner(_0x44e656(0x1c6),()=>_0x4bad4f['journey'][_0x44e656(0x1a0)](_0x538358),{'verbose':_0x3773cb[_0x44e656(0x1f7)]}),{bundleName:_0x4341e1,versions:_0x27273b,latestJourneyId:_0x283307}=_0x3eef1d['data'];console['error'](_0x4341e1+':\x20'+_0x27273b[_0x44e656(0x1d9)]+_0x44e656(0x1b3)+(_0x27273b[_0x44e656(0x1d9)]!==0x1?'s':''));const _0x3454e7=_0x27273b[_0x44e656(0x1ba)](_0x5af268=>({'version':_0x5af268['versionNumber'],'journey_id':_0x5af268[_0x44e656(0x1d6)],'name':_0x5af268[_0x44e656(0x1a5)],'state':_0x5af268[_0x44e656(0x223)],'paused':_0x5af268['paused'],'latest':_0x5af268[_0x44e656(0x1d6)]===_0x283307,'created_at':_0x5af268[_0x44e656(0x1e2)]}));return await handleSDKOutput(_0x3454e7,_0x3773cb),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x59bece(0x1a5)]=a27_0x59bece(0x202);[a27_0x59bece(0x29e)]=a27_0x59bece(0x27e);async[a27_0x59bece(0x25e)](_0x31668a){const _0x27c86e=a27_0x59bece,{options:_0x300293,args:_0x34d622,tdx:_0x39ec54}=_0x31668a,_0x5d92e6=_0x34d622[0x0];if(!requireNameOrPath(_0x5d92e6))return 0x1;if(_0x300293[_0x27c86e(0x1f7)])console[_0x27c86e(0x272)](_0x27c86e(0x2ba)+_0x5d92e6);const {journeyId:_0x16f226,journeyName:_0xdaf579}=await resolveJourneyIdFromInput(_0x5d92e6,_0x300293,_0x39ec54);if(!_0x300293['yes']){const _0x2aee30=await confirm(_0x27c86e(0x209)+_0xdaf579+'\x22?');if(!_0x2aee30)return console[_0x27c86e(0x272)](_0x27c86e(0x1ea)),0x0;}const _0x4140cd=await withSpinner('Creating\x20new\x20version...',()=>_0x39ec54[_0x27c86e(0x1a8)][_0x27c86e(0x19c)](_0x16f226),{'verbose':_0x300293[_0x27c86e(0x1f7)]}),_0x2d4522=_0x4140cd[_0x27c86e(0x1b0)];return console['error'](a27_0x581c34[_0x27c86e(0x22e)]('\u2714')+_0x27c86e(0x2b7)+_0x2d4522[_0x27c86e(0x249)]['versionNumber']+_0x27c86e(0x293)+_0x2d4522[_0x27c86e(0x249)][_0x27c86e(0x1a5)]+'\x22'),console[_0x27c86e(0x272)](_0x27c86e(0x24c)+_0x2d4522['id']),await handleSingleObjectOutput({'id':_0x2d4522['id'],'name':_0x2d4522[_0x27c86e(0x249)][_0x27c86e(0x1a5)],'version':_0x2d4522[_0x27c86e(0x249)][_0x27c86e(0x212)],'state':_0x2d4522[_0x27c86e(0x249)][_0x27c86e(0x223)],'bundle_id':_0x2d4522[_0x27c86e(0x249)]['journeyBundleId'],'created_at':_0x2d4522[_0x27c86e(0x249)]['createdAt']},_0x300293),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x59bece(0x1a5)]='journey:version:view';['description']=a27_0x59bece(0x226);async['execute'](_0x36ae6c){const _0x277d90=a27_0x59bece,{options:_0x1512d6,args:_0x287dfe,tdx:_0x179f84}=_0x36ae6c,_0x41234f=_0x287dfe[0x0];if(!requireNameOrPath(_0x41234f))return 0x1;const _0xe38f6e=_0x1512d6[_0x277d90(0x1f3)];if(!_0xe38f6e)return console[_0x277d90(0x272)](_0x277d90(0x199)),console['error'](_0x277d90(0x19e)),0x1;const _0x1d6c54=parseInt(_0xe38f6e,0xa);if(isNaN(_0x1d6c54)||_0x1d6c54<0x1)return console[_0x277d90(0x272)]('Error:\x20Invalid\x20version\x20number:\x20'+_0xe38f6e),0x1;if(_0x1512d6[_0x277d90(0x1f7)])console[_0x277d90(0x272)](_0x277d90(0x2ba)+_0x41234f+_0x277d90(0x276)+_0x1d6c54);const {journeyId:_0x475174,parentSegmentId:_0x2be906}=await resolveJourneyIdFromInput(_0x41234f,_0x1512d6,_0x179f84),_0x2c598d=await withSpinner('Resolving\x20version...',()=>_0x179f84['journey']['listVersions'](_0x475174),{'verbose':_0x1512d6['verbose']}),{versions:_0x227a00,latestJourneyId:_0x30610f}=_0x2c598d['data'],_0x2f128f=_0x227a00[_0x277d90(0x1c8)](_0x1cde46=>_0x1cde46[_0x277d90(0x212)]===_0x1d6c54);if(!_0x2f128f){const _0x292c7b=_0x227a00[_0x277d90(0x1ba)](_0x20ea14=>'v'+_0x20ea14[_0x277d90(0x212)])[_0x277d90(0x1d4)](',\x20');return console[_0x277d90(0x272)](_0x277d90(0x1d5)+_0x1d6c54+_0x277d90(0x29d)+_0x292c7b),0x1;}const _0x17310e=await withSpinner('Getting\x20version\x20'+_0x1d6c54+_0x277d90(0x23e),()=>_0x179f84[_0x277d90(0x1a8)]['getJourney'](_0x2f128f[_0x277d90(0x1d6)]),{'verbose':_0x1512d6['verbose']}),_0x5b9804=_0x17310e[_0x277d90(0x1b0)],_0x5aa578=getConsoleNextUrl(_0x1512d6[_0x277d90(0x231)],_0x277d90(0x26f)+_0x2be906+_0x277d90(0x227)+_0x2f128f['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x5b9804['id'],'name':_0x5b9804[_0x277d90(0x249)]['name'],'version':_0x5b9804['attributes']['versionNumber'],'description':_0x5b9804[_0x277d90(0x249)][_0x277d90(0x29e)],'state':_0x5b9804['attributes'][_0x277d90(0x223)],'paused':_0x5b9804['attributes'][_0x277d90(0x1e3)],'reentry_mode':_0x5b9804[_0x277d90(0x249)][_0x277d90(0x2af)],'stages':_0x5b9804['attributes']['journeyStages']?.[_0x277d90(0x1d9)]||0x0,..._0x5b9804[_0x277d90(0x249)][_0x277d90(0x1fa)]&&{'goal':_0x5b9804[_0x277d90(0x249)][_0x277d90(0x1fa)]['name']},'latest':_0x2f128f['journeyId']===_0x30610f,'created_at':_0x5b9804['attributes'][_0x277d90(0x1e2)],'updated_at':_0x5b9804[_0x277d90(0x249)][_0x277d90(0x2ae)],'url':_0x5aa578},_0x1512d6),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x3ef4f7=a28_0x48cc;(function(_0x119d4a,_0x247986){const _0x306db5=a28_0x48cc,_0x525873=_0x119d4a();while(!![]){try{const _0x344eeb=parseInt(_0x306db5(0x1de))/0x1*(-parseInt(_0x306db5(0x1ee))/0x2)+parseInt(_0x306db5(0x1c7))/0x3+-parseInt(_0x306db5(0x1bf))/0x4+parseInt(_0x306db5(0x1f6))/0x5+parseInt(_0x306db5(0x1eb))/0x6*(-parseInt(_0x306db5(0x1c2))/0x7)+parseInt(_0x306db5(0x1c3))/0x8*(parseInt(_0x306db5(0x1ca))/0x9)+-parseInt(_0x306db5(0x1c6))/0xa;if(_0x344eeb===_0x247986)break;else _0x525873['push'](_0x525873['shift']());}catch(_0x5403b5){_0x525873['push'](_0x525873['shift']());}}}(a28_0x30c7,0xe0897));import{BaseCommand}from'./command.js';function a28_0x48cc(_0x57d571,_0x5219ec){_0x57d571=_0x57d571-0x1be;const _0x30c793=a28_0x30c7();let _0x48cc3b=_0x30c793[_0x57d571];return _0x48cc3b;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x592486 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{['name']=a28_0x3ef4f7(0x1ed);['description']=a28_0x3ef4f7(0x1e8);async[a28_0x3ef4f7(0x1cf)](_0x24b095){const _0x36d741=a28_0x3ef4f7,{options:_0xd829ca,args:_0x48ad7c}=_0x24b095,_0x2ea1ae=_0xd829ca,_0x23f378=await resolveTarget({'arg':_0x48ad7c[0x0],'contextParent':_0xd829ca[_0x36d741(0x1c1)],'cwd':process[_0x36d741(0x1e6)]()});if(!isSuccessfulResolution(_0x23f378))return _0x23f378['errorCode']===_0x36d741(0x1f4)?(console[_0x36d741(0x1ef)](a28_0x592486[_0x36d741(0x1df)](_0x36d741(0x1be))),console[_0x36d741(0x1ef)](_0x36d741(0x1f1)),console['error'](_0x36d741(0x1f3)),console[_0x36d741(0x1ef)](_0x36d741(0x1cd))):(console[_0x36d741(0x1ef)](a28_0x592486[_0x36d741(0x1dc)](_0x36d741(0x1da)+_0x23f378[_0x36d741(0x1e9)]+'\x0a')),_0x23f378[_0x36d741(0x1c9)]&&console['error'](a28_0x592486[_0x36d741(0x1dd)](_0x23f378[_0x36d741(0x1c9)]))),0x1;const _0x3a5076=_0x23f378[_0x36d741(0x1db)],_0xd61212=_0x23f378[_0x36d741(0x1d5)]===_0x36d741(0x1d4)?_0x23f378[_0x36d741(0x1f7)]:undefined;if(!_0xd61212&&!existsSync(_0x3a5076))return console[_0x36d741(0x1ef)](a28_0x592486[_0x36d741(0x1dc)](_0x36d741(0x1e0)+_0x3a5076+'\x0a')),0x1;let _0x1bbcfd;if(_0xd61212){if(!_0xd61212[_0x36d741(0x1d8)](_0x36d741(0x1cb))&&!_0xd61212['endsWith'](_0x36d741(0x1e7)))return console[_0x36d741(0x1ef)](a28_0x592486['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xd61212+'\x0a')),0x1;_0x1bbcfd=[_0xd61212];}else _0x1bbcfd=findYamlFiles(_0x3a5076);if(_0x1bbcfd[_0x36d741(0x1f0)]===0x0)return console[_0x36d741(0x1ef)](a28_0x592486['red'](_0x36d741(0x1d9)+_0x3a5076+'\x0a')),0x1;const _0x37382c=validateYamlFiles(_0x1bbcfd,_0x3a5076,{'filterType':_0x36d741(0x1ce)}),_0x31ed4c=calculateSummary(_0x37382c),_0x5c15a9=_0x37382c['filter'](isValidationResult);if(_0x5c15a9[_0x36d741(0x1f0)]===0x0)return console[_0x36d741(0x1ef)](a28_0x592486[_0x36d741(0x1df)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x3a5076+'\x0a')),_0x31ed4c['skippedCount']>0x0&&console[_0x36d741(0x1ef)](a28_0x592486[_0x36d741(0x1c0)]('('+_0x31ed4c[_0x36d741(0x1c4)]+_0x36d741(0x1d0))),0x0;for(const _0x4b1ac4 of _0x37382c){if(!isValidationResult(_0x4b1ac4)){_0x2ea1ae[_0x36d741(0x1e5)]&&console[_0x36d741(0x1e2)](a28_0x592486[_0x36d741(0x1c0)]('-\x20'+_0x4b1ac4[_0x36d741(0x1d2)]+'\x20(skipped:\x20'+_0x4b1ac4[_0x36d741(0x1e4)]+')'));continue;}const {relativePath:_0x4442f2,source:_0x4a0b7a,result:_0x12a472}=_0x4b1ac4;if(_0x12a472[_0x36d741(0x1d7)]&&_0x12a472['warnings'][_0x36d741(0x1f0)]===0x0)_0x2ea1ae[_0x36d741(0x1e5)]&&console[_0x36d741(0x1e2)](a28_0x592486[_0x36d741(0x1e1)]('✔\x20'+_0x4442f2));else _0x12a472[_0x36d741(0x1d7)]?(console[_0x36d741(0x1e2)](a28_0x592486[_0x36d741(0x1df)]('⚠\x20'+_0x4442f2+':\x20'+_0x12a472['warnings'][_0x36d741(0x1f0)]+_0x36d741(0x1f8))),console[_0x36d741(0x1e2)](formatValidationResult(_0x12a472,_0x4a0b7a,_0x4442f2))):(console[_0x36d741(0x1e2)](a28_0x592486[_0x36d741(0x1dc)]('✖\x20'+_0x4442f2+':\x20'+_0x12a472['errors']['length']+'\x20error(s)')),console[_0x36d741(0x1e2)](formatValidationResult(_0x12a472,_0x4a0b7a,_0x4442f2)));}return console['log'](''),_0x31ed4c[_0x36d741(0x1e3)]?(console[_0x36d741(0x1e2)](a28_0x592486[_0x36d741(0x1dc)](_0x36d741(0x1d3)+_0x31ed4c[_0x36d741(0x1cc)]+_0x36d741(0x1d6)+_0x31ed4c[_0x36d741(0x1c8)]+_0x36d741(0x1f2))),_0x31ed4c[_0x36d741(0x1ec)]>0x0&&console[_0x36d741(0x1e2)](a28_0x592486[_0x36d741(0x1df)](_0x31ed4c[_0x36d741(0x1ec)]+_0x36d741(0x1c5))),_0x31ed4c[_0x36d741(0x1c4)]>0x0&&console['log'](a28_0x592486['dim'](_0x31ed4c[_0x36d741(0x1c4)]+_0x36d741(0x1f5))),0x1):(console[_0x36d741(0x1e2)](a28_0x592486[_0x36d741(0x1e1)](_0x36d741(0x1d1)+_0x31ed4c[_0x36d741(0x1c8)]+_0x36d741(0x1ea))),_0x31ed4c[_0x36d741(0x1ec)]>0x0&&console[_0x36d741(0x1e2)](a28_0x592486['yellow'](_0x31ed4c[_0x36d741(0x1ec)]+_0x36d741(0x1c5))),_0x31ed4c['skippedCount']>0x0&&console[_0x36d741(0x1e2)](a28_0x592486[_0x36d741(0x1c0)](_0x31ed4c['skippedCount']+_0x36d741(0x1f5))),0x0);}}function a28_0x30c7(){const _0x522d07=['warningCount','journey:validate','1464020cJEpGZ','error','length','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20valid','\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','no_parent','\x20segment\x20file(s)\x20skipped','8461915IQWhTx','filePath','\x20warning(s)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','957396iGHJIy','dim','parentSegment','149261kzhBSK','8eorvhD','skippedCount','\x20warning(s)\x20found','8790650EnAohw','2412231netQHA','validCount','helpText','9179748ULQYLN','.yml','invalidCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','journey','execute','\x20segment\x20file(s)\x20skipped)','✔\x20All\x20','relativePath','Validation\x20failed:\x20','file','type','\x20journey(s)\x20with\x20errors,\x20','valid','endsWith','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20','targetDir','red','cyan','1EKHphp','yellow','Error:\x20Directory\x20not\x20found:\x20','green','log','hasErrors','reason','verbose','cwd','.yaml','Validate\x20journey\x20YAML\x20files','message','\x20journey(s)\x20valid','210QujKid'];a28_0x30c7=function(){return _0x522d07;};return a28_0x30c7();}
|