@treasuredata/tdx 2026.5.1 → 2026.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/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/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +8 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +4 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/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
|
-
function a24_0x52d9(){const _0x36b2b3=['6EPtNbW','986430sRvvuu','configDir','relativePath','\x20\x20\x20\x20','183092psvqnV','created','\x0aValidation\x20errors\x20in\x20','session','882575GTpTtZ','workspace','verbose','191272UjUheU','data','engage_workspace','templateId','setPhase','updated','✔\x20All\x20templates\x20are\x20up\x20to\x20date','134728CYgvAc','errors','\x20new\x20templates:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20errors:','action','Found\x20','message','error','update','yes','filter','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','✔\x20Created\x20','config','valid','yellow','\x20templates','22736aXqPUl','resolveWorkspaceId','path','\x20templates\x20to\x20update:','dim','Resolving\x20references...','resolve','Aborted.','-\x20no\x20changes\x20applied','21ocstTx','6MJPJCZ','413586rEEyPK','\x0aPush\x20summary\x20for\x20workspace\x20\x27','engage','description','dryRun','cyan','create','def','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','warnings','dirname','\x20template\x20files','22GygJDy','red','\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)','Pushing\x20templates...','name','results','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','length','Preparing\x20push\x20to\x20workspace\x20\x27','\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','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','green','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.'];a24_0x52d9=function(){return _0x36b2b3;};return a24_0x52d9();}const a24_0x2d0679=a24_0x4c5c;(function(_0x16d5ef,_0x4f85f7){const _0x1df401=a24_0x4c5c,_0x2f42d9=_0x16d5ef();while(!![]){try{const _0x287c4d=parseInt(_0x1df401(0x9b))/0x1+parseInt(_0x1df401(0xa9))/0x2+-parseInt(_0x1df401(0xdf))/0x3*(parseInt(_0x1df401(0xbb))/0x4)+parseInt(_0x1df401(0x9f))/0x5*(parseInt(_0x1df401(0xc5))/0x6)+-parseInt(_0x1df401(0xc4))/0x7*(parseInt(_0x1df401(0xa2))/0x8)+-parseInt(_0x1df401(0xc6))/0x9+-parseInt(_0x1df401(0xe0))/0xa*(parseInt(_0x1df401(0xd2))/0xb);if(_0x287c4d===_0x4f85f7)break;else _0x2f42d9['push'](_0x2f42d9['shift']());}catch(_0x1f2093){_0x2f42d9['push'](_0x2f42d9['shift']());}}}(a24_0x52d9,0x1891c));function a24_0x4c5c(_0x84f09f,_0x489132){_0x84f09f=_0x84f09f-0x99;const _0x52d9ab=a24_0x52d9();let _0x4c5c96=_0x52d9ab[_0x84f09f];return _0x4c5c96;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x225897 from'chalk';import a24_0x104652 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{['name']='engage:template:push';[a24_0x2d0679(0xc9)]=a24_0x2d0679(0xce);async['execute'](_0x1b7c71){const _0x4c313a=a24_0x2d0679,{options:_0x1b43be,args:_0x5ee811,tdx:_0x587dc4}=_0x1b7c71,_0x3fd970=_0x1b43be,_0x5d7f4f=_0x5ee811[0x0],_0x1a5032=_0x5d7f4f?a24_0x104652[_0x4c313a(0xc1)](_0x5d7f4f):undefined,_0x138e8d=_0x1a5032?isYamlFile(_0x1a5032):![];let _0x3fa093;if(_0x138e8d&&_0x1a5032)_0x3fa093=a24_0x104652['dirname'](_0x1a5032);else _0x1a5032?_0x3fa093=_0x1a5032:_0x3fa093=process['cwd']();let _0xba3d70;const _0x2e7270=tryFindTdxConfig(_0x3fa093);_0x2e7270?.[_0x4c313a(0xb7)]['engage_workspace']&&(_0xba3d70=_0x2e7270[_0x4c313a(0xb7)][_0x4c313a(0xa4)],!_0x138e8d&&(_0x3fa093=_0x2e7270[_0x4c313a(0xe1)]));_0x3fd970[_0x4c313a(0xa0)]&&(_0xba3d70=_0x3fd970[_0x4c313a(0xa0)]);if(!_0xba3d70){const _0xff9a88=loadSessionContext(_0x3fd970[_0x4c313a(0x9e)]);_0xff9a88?.[_0x4c313a(0xa4)]&&(_0xba3d70=_0xff9a88[_0x4c313a(0xa4)]);}if(!_0xba3d70)return console['error'](a24_0x225897[_0x4c313a(0xb9)]('Workspace\x20is\x20required.')),console[_0x4c313a(0xb1)](_0x4c313a(0xdb)),console[_0x4c313a(0xb1)](_0x4c313a(0xd4)),console[_0x4c313a(0xb1)](_0x4c313a(0xd8)),console['error']('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x221344;_0x138e8d&&_0x1a5032?_0x221344=[parseTemplateFile(_0x1a5032,a24_0x104652[_0x4c313a(0xd0)](_0x1a5032))]:_0x221344=discoverAndParseTemplateFiles(_0x3fa093);if(_0x221344[_0x4c313a(0xd9)]===0x0)return console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xb9)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x3fa093)),console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xbf)](_0x4c313a(0xde))),0x1;const _0x55d695=_0x221344[_0x4c313a(0xd9)]===0x1?'1\x20template\x20file:\x20'+_0x221344[0x0]['def'][_0x4c313a(0xd6)]:_0x221344['length']+_0x4c313a(0xd1);console[_0x4c313a(0xb1)](_0x4c313a(0xaf)+a24_0x225897[_0x4c313a(0xcb)](_0x55d695));let _0x3d8830=![];for(const _0x4b03b9 of _0x221344){const _0x12fea3=validateTemplateDef(_0x4b03b9[_0x4c313a(0xcd)]);if(!_0x12fea3[_0x4c313a(0xb8)]){_0x3d8830=!![],console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xd3)](_0x4c313a(0x9d)+_0x4b03b9[_0x4c313a(0x99)]+':'));for(const _0x212e11 of _0x12fea3['errors']){console['error']('\x20\x20'+a24_0x225897[_0x4c313a(0xd3)]('✗')+'\x20'+_0x212e11['path']+':\x20'+_0x212e11[_0x4c313a(0xb0)]);}}for(const _0x5e0a01 of _0x12fea3[_0x4c313a(0xcf)]){console['error']('\x20\x20'+a24_0x225897[_0x4c313a(0xb9)]('⚠')+'\x20'+_0x5e0a01[_0x4c313a(0xbd)]+':\x20'+_0x5e0a01['message']);}}if(_0x3d8830)return console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xd3)](_0x4c313a(0xb5))),0x1;const _0x554b37=await _0x587dc4[_0x4c313a(0xc8)][_0x4c313a(0xbc)](_0xba3d70),_0xbe6185=await withProgressSpinner(_0x4c313a(0xda)+_0xba3d70+'\x27...',_0x1ab17a=>preparePush({'engage':_0x587dc4[_0x4c313a(0xc8)]},_0x221344,_0x554b37,{'progress':{'update':_0xd617eb=>_0x1ab17a[_0x4c313a(0xa6)](_0xd617eb)}}),{'verbose':_0x3fd970[_0x4c313a(0xa1)]}),_0x34cece=_0xbe6185['data'];await withProgressSpinner(_0x4c313a(0xc0),_0x17d94=>resolveAndBuildInputs({'engage':_0x587dc4[_0x4c313a(0xc8)]},_0x34cece,_0x554b37,{'progress':{'update':_0x303849=>_0x17d94[_0x4c313a(0xa6)](_0x303849)}}),{'verbose':_0x3fd970[_0x4c313a(0xa1)]});const _0x2f3c09=_0x34cece[_0x4c313a(0xb4)](_0x2704db=>_0x2704db[_0x4c313a(0xae)]===_0x4c313a(0xcc)),_0x536a10=_0x34cece[_0x4c313a(0xb4)](_0x16e7a2=>_0x16e7a2[_0x4c313a(0xae)]===_0x4c313a(0xb2));console[_0x4c313a(0xb1)](_0x4c313a(0xc7)+_0xba3d70+'\x27:');if(_0x2f3c09[_0x4c313a(0xd9)]>0x0){console[_0x4c313a(0xb1)]('\x20\x20'+a24_0x225897[_0x4c313a(0xdd)]('+\x20'+_0x2f3c09[_0x4c313a(0xd9)]+_0x4c313a(0xab)));for(const _0x2958a6 of _0x2f3c09){console['error']('\x20\x20\x20\x20'+a24_0x225897['green']('+')+'\x20'+_0x2958a6[_0x4c313a(0xcd)][_0x4c313a(0xd6)]);}}if(_0x536a10[_0x4c313a(0xd9)]>0x0){console['error']('\x20\x20'+a24_0x225897['yellow']('~\x20'+_0x536a10[_0x4c313a(0xd9)]+_0x4c313a(0xbe)));for(const _0x5da1a7 of _0x536a10){console[_0x4c313a(0xb1)](_0x4c313a(0x9a)+a24_0x225897[_0x4c313a(0xb9)]('~')+'\x20'+_0x5da1a7['def'][_0x4c313a(0xd6)]);}}if(_0x2f3c09[_0x4c313a(0xd9)]===0x0&&_0x536a10[_0x4c313a(0xd9)]===0x0)return console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xdd)](_0x4c313a(0xa8))),0x0;if(_0x3fd970[_0x4c313a(0xca)])return console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xb9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x3fd970[_0x4c313a(0xb3)]){if(!isInteractive())return console['error'](a24_0x225897['red']('\x0aError:'),_0x4c313a(0xdc)),console[_0x4c313a(0xb1)](a24_0x225897['dim'](_0x4c313a(0xac))),0x1;const _0x472612=await confirmKey('Push\x20'+(_0x2f3c09[_0x4c313a(0xd9)]+_0x536a10['length'])+'\x20templates?');if(!_0x472612)return console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xb9)](_0x4c313a(0xc2)),_0x4c313a(0xc3)),0x1;}const _0x24248a=await withProgressSpinner(_0x4c313a(0xd5),_0xde83ea=>executePush({'engage':_0x587dc4[_0x4c313a(0xc8)]},_0x34cece,{'progress':{'update':_0x226eb2=>_0xde83ea[_0x4c313a(0xa6)](_0x226eb2)}}),{'verbose':_0x3fd970[_0x4c313a(0xa1)]}),_0x4ab70e=_0x24248a[_0x4c313a(0xa3)];for(const _0x2b7cd8 of _0x4ab70e[_0x4c313a(0xd7)]){if(_0x2b7cd8['templateId']&&(_0x2b7cd8['action']===_0x4c313a(0x9c)||_0x2b7cd8[_0x4c313a(0xae)]==='updated')){const _0x3c0380=getTemplateUrl(_0x3fd970['site'],_0x554b37,_0x2b7cd8[_0x4c313a(0xa5)]),_0x4cf881=_0x2b7cd8[_0x4c313a(0xae)]==='created'?'+':'~',_0xbc4d2c=_0x2b7cd8[_0x4c313a(0xae)]===_0x4c313a(0x9c)?a24_0x225897[_0x4c313a(0xdd)](_0x4cf881):a24_0x225897[_0x4c313a(0xb9)](_0x4cf881);console[_0x4c313a(0xb1)]('\x20\x20'+_0xbc4d2c+'\x20'+hyperlink(_0x2b7cd8[_0x4c313a(0xd6)],_0x3c0380)+'\x20'+a24_0x225897[_0x4c313a(0xbf)](_0x3c0380));}}_0x4ab70e[_0x4c313a(0x9c)]>0x0&&console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xdd)](_0x4c313a(0xb6)+_0x4ab70e[_0x4c313a(0x9c)]+_0x4c313a(0xba)));_0x4ab70e[_0x4c313a(0xa7)]>0x0&&console[_0x4c313a(0xb1)](a24_0x225897[_0x4c313a(0xdd)]('✔\x20Updated\x20'+_0x4ab70e[_0x4c313a(0xa7)]+'\x20templates'));if(_0x4ab70e[_0x4c313a(0xaa)][_0x4c313a(0xd9)]>0x0){console[_0x4c313a(0xb1)](a24_0x225897['red']('✘\x20'+_0x4ab70e[_0x4c313a(0xaa)][_0x4c313a(0xd9)]+_0x4c313a(0xad)));for(const _0x55780e of _0x4ab70e['errors']){console[_0x4c313a(0xb1)]('\x20\x20'+a24_0x225897[_0x4c313a(0xd3)](_0x55780e['name'])+':\x20'+_0x55780e[_0x4c313a(0xb1)]);}}return saveSessionContext({'engage_workspace':_0xba3d70},_0x3fd970[_0x4c313a(0x9e)]),_0x4ab70e['errors'][_0x4c313a(0xd9)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a24_0x19b1a3=a24_0x46ca;(function(_0x532635,_0x1c1341){const _0x3f9dfd=a24_0x46ca,_0x239c63=_0x532635();while(!![]){try{const _0x334156=parseInt(_0x3f9dfd(0x1a2))/0x1*(parseInt(_0x3f9dfd(0x16f))/0x2)+-parseInt(_0x3f9dfd(0x19b))/0x3+-parseInt(_0x3f9dfd(0x155))/0x4*(-parseInt(_0x3f9dfd(0x174))/0x5)+-parseInt(_0x3f9dfd(0x154))/0x6*(parseInt(_0x3f9dfd(0x166))/0x7)+parseInt(_0x3f9dfd(0x1a0))/0x8+parseInt(_0x3f9dfd(0x168))/0x9*(-parseInt(_0x3f9dfd(0x16b))/0xa)+parseInt(_0x3f9dfd(0x197))/0xb*(parseInt(_0x3f9dfd(0x161))/0xc);if(_0x334156===_0x1c1341)break;else _0x239c63['push'](_0x239c63['shift']());}catch(_0x57468e){_0x239c63['push'](_0x239c63['shift']());}}}(a24_0x9393,0xb72f0));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x40f081 from'chalk';import a24_0x2f4f86 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';function a24_0x46ca(_0x2eb27c,_0x779958){_0x2eb27c=_0x2eb27c-0x154;const _0x93935e=a24_0x9393();let _0x46cac2=_0x93935e[_0x2eb27c];return _0x46cac2;}import{validateTemplateDef}from'../sdk/engage/template-validator.js';function a24_0x9393(){const _0x1b8f9b=['21938yCLXjI','Workspace\x20is\x20required.','3015ZpMwgF','-\x20no\x20changes\x20applied','data','32220mIloMy','Aborted.','path','configDir','1191134HdRvia','yellow','action','errors','green','55NsHMwE','def','\x0aError:','results','created','✔\x20Created\x20','message','\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','cwd','yes','update','1\x20template\x20file:\x20','warnings','\x20\x20\x20\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','engage','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','No\x20template\x20YAML\x20files\x20found\x20in\x20','red','dim','\x20errors:','create','config','\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)','engage_workspace','✔\x20All\x20templates\x20are\x20up\x20to\x20date','\x20template\x20files','name','resolve','resolveWorkspaceId','cyan','length','Found\x20','\x0aValidation\x20errors\x20in\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','33AvpWGy','updated','Push\x20','\x20templates','2164575ovUZKn','\x27...','\x20templates?','\x20new\x20templates:','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','2688776IMYtxz','Pushing\x20templates...','2FWNpXA','\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','6RPxwUh','234844JpvADy','setPhase','relativePath','execute','Resolving\x20references...','✔\x20Updated\x20','error','valid','templateId','workspace','\x20templates\x20to\x20update:','dirname','1525188nRyPzI','verbose','session','engage:template:push','dryRun'];a24_0x9393=function(){return _0x1b8f9b;};return a24_0x9393();}import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x19b1a3(0x18f)]=a24_0x19b1a3(0x164);['description']=a24_0x19b1a3(0x182);async[a24_0x19b1a3(0x158)](_0x2e16f0){const _0x292945=a24_0x19b1a3,{options:_0x11e272,args:_0x60c7ed,tdx:_0x394ac6}=_0x2e16f0,_0x29270e=_0x11e272,_0x57ca35=_0x60c7ed[0x0],_0x1d1fe6=_0x57ca35?a24_0x2f4f86[_0x292945(0x190)](_0x57ca35):undefined,_0x39ea91=_0x1d1fe6?isYamlFile(_0x1d1fe6):![];let _0x11e756;if(_0x39ea91&&_0x1d1fe6)_0x11e756=a24_0x2f4f86[_0x292945(0x160)](_0x1d1fe6);else _0x1d1fe6?_0x11e756=_0x1d1fe6:_0x11e756=process[_0x292945(0x17c)]();let _0x4e18b3;const _0x115cdd=tryFindTdxConfig(_0x11e756);_0x115cdd?.[_0x292945(0x18a)][_0x292945(0x18c)]&&(_0x4e18b3=_0x115cdd['config'][_0x292945(0x18c)],!_0x39ea91&&(_0x11e756=_0x115cdd[_0x292945(0x16e)]));_0x29270e[_0x292945(0x15e)]&&(_0x4e18b3=_0x29270e[_0x292945(0x15e)]);if(!_0x4e18b3){const _0x278227=loadSessionContext(_0x29270e[_0x292945(0x163)]);_0x278227?.[_0x292945(0x18c)]&&(_0x4e18b3=_0x278227[_0x292945(0x18c)]);}if(!_0x4e18b3)return console[_0x292945(0x15b)](a24_0x40f081['yellow'](_0x292945(0x167))),console[_0x292945(0x15b)](_0x292945(0x1a3)),console[_0x292945(0x15b)](_0x292945(0x18b)),console[_0x292945(0x15b)](_0x292945(0x17b)),console[_0x292945(0x15b)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x30e172;_0x39ea91&&_0x1d1fe6?_0x30e172=[parseTemplateFile(_0x1d1fe6,a24_0x2f4f86[_0x292945(0x160)](_0x1d1fe6))]:_0x30e172=discoverAndParseTemplateFiles(_0x11e756);if(_0x30e172[_0x292945(0x193)]===0x0)return console['error'](a24_0x40f081[_0x292945(0x170)](_0x292945(0x185)+_0x11e756)),console['error'](a24_0x40f081['dim'](_0x292945(0x19f))),0x1;const _0x159132=_0x30e172[_0x292945(0x193)]===0x1?_0x292945(0x17f)+_0x30e172[0x0]['def'][_0x292945(0x18f)]:_0x30e172[_0x292945(0x193)]+_0x292945(0x18e);console[_0x292945(0x15b)](_0x292945(0x194)+a24_0x40f081[_0x292945(0x192)](_0x159132));let _0x10a78b=![];for(const _0x57b8d3 of _0x30e172){const _0x9b9a8e=validateTemplateDef(_0x57b8d3[_0x292945(0x175)]);if(!_0x9b9a8e[_0x292945(0x15c)]){_0x10a78b=!![],console[_0x292945(0x15b)](a24_0x40f081['red'](_0x292945(0x195)+_0x57b8d3[_0x292945(0x157)]+':'));for(const _0x5c9b94 of _0x9b9a8e['errors']){console[_0x292945(0x15b)]('\x20\x20'+a24_0x40f081[_0x292945(0x186)]('✗')+'\x20'+_0x5c9b94[_0x292945(0x16d)]+':\x20'+_0x5c9b94['message']);}}for(const _0x38097e of _0x9b9a8e[_0x292945(0x180)]){console[_0x292945(0x15b)]('\x20\x20'+a24_0x40f081[_0x292945(0x170)]('⚠')+'\x20'+_0x38097e[_0x292945(0x16d)]+':\x20'+_0x38097e[_0x292945(0x17a)]);}}if(_0x10a78b)return console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x186)](_0x292945(0x184))),0x1;const _0x19b4c5=await _0x394ac6[_0x292945(0x183)][_0x292945(0x191)](_0x4e18b3),_0x201469=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x4e18b3+_0x292945(0x19c),_0x21e47c=>preparePush({'engage':_0x394ac6['engage']},_0x30e172,_0x19b4c5,{'progress':{'update':_0x3c4eb0=>_0x21e47c[_0x292945(0x156)](_0x3c4eb0)}}),{'verbose':_0x29270e['verbose']}),_0x3665b9=_0x201469[_0x292945(0x16a)];await withProgressSpinner(_0x292945(0x159),_0x13c759=>resolveAndBuildInputs({'engage':_0x394ac6['engage']},_0x3665b9,_0x19b4c5,{'progress':{'update':_0x487319=>_0x13c759[_0x292945(0x156)](_0x487319)}}),{'verbose':_0x29270e[_0x292945(0x162)]});const _0xeca276=_0x3665b9['filter'](_0x1fdd2c=>_0x1fdd2c['action']===_0x292945(0x189)),_0x1a9895=_0x3665b9['filter'](_0x3d8337=>_0x3d8337['action']===_0x292945(0x17e));console[_0x292945(0x15b)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x4e18b3+'\x27:');if(_0xeca276[_0x292945(0x193)]>0x0){console['error']('\x20\x20'+a24_0x40f081[_0x292945(0x173)]('+\x20'+_0xeca276[_0x292945(0x193)]+_0x292945(0x19e)));for(const _0xf9ca8 of _0xeca276){console['error'](_0x292945(0x181)+a24_0x40f081[_0x292945(0x173)]('+')+'\x20'+_0xf9ca8['def'][_0x292945(0x18f)]);}}if(_0x1a9895[_0x292945(0x193)]>0x0){console[_0x292945(0x15b)]('\x20\x20'+a24_0x40f081[_0x292945(0x170)]('~\x20'+_0x1a9895[_0x292945(0x193)]+_0x292945(0x15f)));for(const _0x2a96cd of _0x1a9895){console[_0x292945(0x15b)](_0x292945(0x181)+a24_0x40f081[_0x292945(0x170)]('~')+'\x20'+_0x2a96cd[_0x292945(0x175)][_0x292945(0x18f)]);}}if(_0xeca276[_0x292945(0x193)]===0x0&&_0x1a9895[_0x292945(0x193)]===0x0)return console['error'](a24_0x40f081[_0x292945(0x173)](_0x292945(0x18d))),0x0;if(_0x29270e[_0x292945(0x165)])return console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x170)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x29270e[_0x292945(0x17d)]){if(!isInteractive())return console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x186)](_0x292945(0x176)),_0x292945(0x196)),console[_0x292945(0x15b)](a24_0x40f081['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x384314=await confirmKey(_0x292945(0x199)+(_0xeca276[_0x292945(0x193)]+_0x1a9895[_0x292945(0x193)])+_0x292945(0x19d));if(!_0x384314)return console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x170)](_0x292945(0x16c)),_0x292945(0x169)),0x1;}const _0x1dd781=await withProgressSpinner(_0x292945(0x1a1),_0x41ad74=>executePush({'engage':_0x394ac6['engage']},_0x3665b9,{'progress':{'update':_0x52ed76=>_0x41ad74['setPhase'](_0x52ed76)}}),{'verbose':_0x29270e[_0x292945(0x162)]}),_0x439f5f=_0x1dd781[_0x292945(0x16a)];for(const _0x3565a8 of _0x439f5f[_0x292945(0x177)]){if(_0x3565a8[_0x292945(0x15d)]&&(_0x3565a8[_0x292945(0x171)]==='created'||_0x3565a8[_0x292945(0x171)]===_0x292945(0x198))){const _0x372d05=getTemplateUrl(_0x29270e['site'],_0x19b4c5,_0x3565a8[_0x292945(0x15d)]),_0x2ede61=_0x3565a8[_0x292945(0x171)]===_0x292945(0x178)?'+':'~',_0x4ddcd3=_0x3565a8[_0x292945(0x171)]===_0x292945(0x178)?a24_0x40f081[_0x292945(0x173)](_0x2ede61):a24_0x40f081['yellow'](_0x2ede61);console[_0x292945(0x15b)]('\x20\x20'+_0x4ddcd3+'\x20'+hyperlink(_0x3565a8['name'],_0x372d05)+'\x20'+a24_0x40f081[_0x292945(0x187)](_0x372d05));}}_0x439f5f[_0x292945(0x178)]>0x0&&console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x173)](_0x292945(0x179)+_0x439f5f[_0x292945(0x178)]+_0x292945(0x19a)));_0x439f5f['updated']>0x0&&console[_0x292945(0x15b)](a24_0x40f081['green'](_0x292945(0x15a)+_0x439f5f[_0x292945(0x198)]+_0x292945(0x19a)));if(_0x439f5f['errors']['length']>0x0){console[_0x292945(0x15b)](a24_0x40f081['red']('✘\x20'+_0x439f5f[_0x292945(0x172)]['length']+_0x292945(0x188)));for(const _0x3bd728 of _0x439f5f[_0x292945(0x172)]){console[_0x292945(0x15b)]('\x20\x20'+a24_0x40f081[_0x292945(0x186)](_0x3bd728[_0x292945(0x18f)])+':\x20'+_0x3bd728[_0x292945(0x15b)]);}}return saveSessionContext({'engage_workspace':_0x4e18b3},_0x29270e[_0x292945(0x163)]),_0x439f5f[_0x292945(0x172)][_0x292945(0x193)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x2885aa=a25_0x3514;(function(_0x5307cb,_0x13dc7d){const _0x27f516=a25_0x3514,_0x2de732=_0x5307cb();while(!![]){try{const _0x344fff=parseInt(_0x27f516(0xf8))/0x1*(-parseInt(_0x27f516(0xd8))/0x2)+parseInt(_0x27f516(0xd5))/0x3+parseInt(_0x27f516(0xfb))/0x4+-parseInt(_0x27f516(0xf3))/0x5*(-parseInt(_0x27f516(0xf0))/0x6)+-parseInt(_0x27f516(0xd4))/0x7+parseInt(_0x27f516(0xdd))/0x8+-parseInt(_0x27f516(0xee))/0x9;if(_0x344fff===_0x13dc7d)break;else _0x2de732['push'](_0x2de732['shift']());}catch(_0x3f3eb7){_0x2de732['push'](_0x2de732['shift']());}}}(a25_0x5949,0xc7bb2));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x22539a from'chalk';import a25_0x248011 from'path';function a25_0x3514(_0x40b676,_0x3a8b7f){_0x40b676=_0x40b676-0xce;const _0x59490c=a25_0x5949();let _0x35147f=_0x59490c[_0x40b676];return _0x35147f;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a25_0x5949(){const _0x131541=['\x20warning(s)','1666364RRzUtA','description','Validation\x20failed:\x20','log','template','dirname','Error:\x20Directory\x20not\x20found:\x20','No\x20template\x20YAML\x20files\x20found\x20in\x20','cwd','red','483434VeJvVd','2662662CiQTuL','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20template(s)\x20valid','1966jkJjes','resolve','green','dim','name','12360800GTJDZk','verbose','.yml','valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','hasErrors','\x20non-template\x20file(s)\x20skipped','reason','invalidCount','\x20(skipped:\x20','✔\x20All\x20','validCount','error','\x20template(s)\x20with\x20errors,\x20','warningCount','engage:template:validate','20977470rgEDwY','yellow','12zjJGai','Validate\x20template\x20YAML\x20files','\x20valid','3897895FaTiOq','relativePath','skippedCount','.yaml','\x20non-template\x20file(s)\x20skipped)','1211GcAxrV','endsWith'];a25_0x5949=function(){return _0x131541;};return a25_0x5949();}export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x2885aa(0xdc)]=a25_0x2885aa(0xed);[a25_0x2885aa(0xfc)]=a25_0x2885aa(0xf1);async['execute'](_0x153c59){const _0x2e88cf=a25_0x2885aa,{options:_0x486c43,args:_0x584ac9}=_0x153c59,_0x487d6d=_0x486c43,_0xd3205c=_0x584ac9[0x0],_0x522373=_0xd3205c?a25_0x248011[_0x2e88cf(0xd9)](_0xd3205c):undefined,_0x59efa6=_0x522373?isYamlFile(_0x522373):![];let _0x41c375,_0x4a29a6;if(_0x59efa6&&_0x522373)_0x41c375=a25_0x248011[_0x2e88cf(0xcf)](_0x522373),_0x4a29a6=_0x522373;else _0x522373?_0x41c375=_0x522373:_0x41c375=process[_0x2e88cf(0xd2)]();if(!_0x4a29a6&&!existsSync(_0x41c375))return console['error'](a25_0x22539a[_0x2e88cf(0xd3)](_0x2e88cf(0xd0)+_0x41c375+'\x0a')),0x1;let _0x3e4cc1;if(_0x4a29a6){if(!_0x4a29a6['endsWith'](_0x2e88cf(0xdf))&&!_0x4a29a6[_0x2e88cf(0xf9)](_0x2e88cf(0xf6)))return console[_0x2e88cf(0xea)](a25_0x22539a[_0x2e88cf(0xd3)](_0x2e88cf(0xd6)+_0x4a29a6+'\x0a')),0x1;_0x3e4cc1=[_0x4a29a6];}else _0x3e4cc1=findYamlFiles(_0x41c375);if(_0x3e4cc1[_0x2e88cf(0xe2)]===0x0)return console[_0x2e88cf(0xea)](a25_0x22539a[_0x2e88cf(0xd3)](_0x2e88cf(0xe1)+_0x41c375+'\x0a')),0x1;const _0x3d3348=validateYamlFiles(_0x3e4cc1,_0x41c375,{'filterType':_0x2e88cf(0xce)}),_0x571ff7=calculateSummary(_0x3d3348),_0x23a39d=_0x3d3348['filter'](isValidationResult);if(_0x23a39d['length']===0x0)return console[_0x2e88cf(0xea)](a25_0x22539a[_0x2e88cf(0xef)](_0x2e88cf(0xd1)+_0x41c375+'\x0a')),_0x571ff7[_0x2e88cf(0xf5)]>0x0&&console[_0x2e88cf(0xea)](a25_0x22539a[_0x2e88cf(0xdb)]('('+_0x571ff7[_0x2e88cf(0xf5)]+_0x2e88cf(0xf7))),0x0;for(const _0xf37d05 of _0x3d3348){if(!isValidationResult(_0xf37d05)){_0x487d6d[_0x2e88cf(0xde)]&&console['log'](a25_0x22539a[_0x2e88cf(0xdb)]('-\x20'+_0xf37d05[_0x2e88cf(0xf4)]+_0x2e88cf(0xe7)+_0xf37d05[_0x2e88cf(0xe5)]+')'));continue;}const {relativePath:_0x45a421,source:_0x54415d,result:_0x49a902}=_0xf37d05;if(_0x49a902[_0x2e88cf(0xe0)]&&_0x49a902['warnings'][_0x2e88cf(0xe2)]===0x0)_0x487d6d[_0x2e88cf(0xde)]&&console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xda)]('✔\x20'+_0x45a421));else _0x49a902['valid']?(console['log'](a25_0x22539a[_0x2e88cf(0xef)]('⚠\x20'+_0x45a421+':\x20'+_0x49a902['warnings'][_0x2e88cf(0xe2)]+_0x2e88cf(0xfa))),console['log'](formatValidationResult(_0x49a902,_0x54415d,_0x45a421))):(console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xd3)]('✖\x20'+_0x45a421+':\x20'+_0x49a902['errors'][_0x2e88cf(0xe2)]+'\x20error(s)')),console[_0x2e88cf(0xfe)](formatValidationResult(_0x49a902,_0x54415d,_0x45a421)));}return console['log'](''),_0x571ff7[_0x2e88cf(0xe3)]?(console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xd3)](_0x2e88cf(0xfd)+_0x571ff7[_0x2e88cf(0xe6)]+_0x2e88cf(0xeb)+_0x571ff7['validCount']+_0x2e88cf(0xf2))),_0x571ff7[_0x2e88cf(0xec)]>0x0&&console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xef)](_0x571ff7['warningCount']+'\x20warning(s)\x20found')),_0x571ff7['skippedCount']>0x0&&console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xdb)](_0x571ff7[_0x2e88cf(0xf5)]+_0x2e88cf(0xe4))),0x1):(console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xda)](_0x2e88cf(0xe8)+_0x571ff7[_0x2e88cf(0xe9)]+_0x2e88cf(0xd7))),_0x571ff7[_0x2e88cf(0xec)]>0x0&&console['log'](a25_0x22539a[_0x2e88cf(0xef)](_0x571ff7['warningCount']+'\x20warning(s)\x20found')),_0x571ff7['skippedCount']>0x0&&console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xdb)](_0x571ff7[_0x2e88cf(0xf5)]+_0x2e88cf(0xe4))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x33ef8a=a26_0x374c;(function(_0x31f3da,_0xaa6028){const _0x585a7a=a26_0x374c,_0xc8b275=_0x31f3da();while(!![]){try{const _0x5ba516=-parseInt(_0x585a7a(0x1f7))/0x1+parseInt(_0x585a7a(0x20c))/0x2+parseInt(_0x585a7a(0x1d5))/0x3+-parseInt(_0x585a7a(0x1f2))/0x4*(parseInt(_0x585a7a(0x1f5))/0x5)+parseInt(_0x585a7a(0x200))/0x6*(-parseInt(_0x585a7a(0x211))/0x7)+-parseInt(_0x585a7a(0x1d7))/0x8+parseInt(_0x585a7a(0x1da))/0x9;if(_0x5ba516===_0xaa6028)break;else _0xc8b275['push'](_0xc8b275['shift']());}catch(_0x248eb3){_0xc8b275['push'](_0xc8b275['shift']());}}}(a26_0xa433,0x56f60));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0xa433(){const _0x3209d3=['✔\x20Job\x20submitted','length','args','red','round','...','dim','jobs','join','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','start_at','type','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','description','Show\x20job\x20details','2049308wmpTFV','Cancelled','Listing\x20jobs...','5lMfIKf','database','479791ClIOkF','Status\x20filter:\x20','Getting\x20job\x20results...','green','map','Query:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','file','data','1668PYQUnS','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','error','✔\x20Retrieved\x20','List\x20jobs','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','verbose','user_name','\x20\x20Job\x20ID:\x20','trino','execute','list','632410GktaSN','query','Submitting\x20kill\x20request...','Limit:\x20','name','16702gYkMKC','hive','mo\x20ago','d\x20ago','\x20job','end_at','success','log','result','job:show','created_at','yes','floor','site','push','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','No\x20SQL\x20statements\x20found\x20in\x20file','url','Database:\x20','INVALID_ARGUMENT','getTime','status','priority','debug','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','601638kquAPw','Kill\x20a\x20job','744408PUEtaE','presto','validate','14291262COQyPs','job:kill','job:result','limit','h\x20ago','information_schema','now','submit','job_id'];a26_0xa433=function(){return _0x3209d3;};return a26_0xa433();}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_0x409776 from'chalk';function formatDuration(_0x390931){const _0x1d4c67=a26_0x374c;if(_0x390931<0x3c)return _0x390931+'s';if(_0x390931<0xe10)return Math['floor'](_0x390931/0x3c)+'m\x20'+_0x390931%0x3c+'s';const _0x341a93=Math[_0x1d4c67(0x1c8)](_0x390931/0xe10),_0x4db5eb=Math['floor'](_0x390931%0xe10/0x3c);return _0x4db5eb>0x0?_0x341a93+'h\x20'+_0x4db5eb+'m':_0x341a93+'h';}function formatRelativeTime(_0x4e206b){const _0x2df2cc=a26_0x374c,_0x4e167a=Date[_0x2df2cc(0x1e0)]()-_0x4e206b['getTime'](),_0x181d10=Math[_0x2df2cc(0x1c8)](Math['abs'](_0x4e167a)/0x3e8);if(_0x181d10<0x3c)return'just\x20now';const _0x30b6b7=Math[_0x2df2cc(0x1c8)](_0x181d10/0x3c);if(_0x30b6b7<0x3c)return _0x30b6b7+'m\x20ago';const _0x25c52d=Math['floor'](_0x30b6b7/0x3c);if(_0x25c52d<0x18)return _0x25c52d+_0x2df2cc(0x1de);const _0x1c5219=Math[_0x2df2cc(0x1c8)](_0x25c52d/0x18);if(_0x1c5219<0x1e)return _0x1c5219+_0x2df2cc(0x214);return Math[_0x2df2cc(0x1c8)](_0x1c5219/0x1e)+_0x2df2cc(0x213);}export class JobListCommand extends BaseCommand{[a26_0x33ef8a(0x210)]=a26_0x33ef8a(0x1ea);['description']=a26_0x33ef8a(0x204);async[a26_0x33ef8a(0x20a)](_0x52557a){const _0x24ca74=a26_0x33ef8a,{options:_0x77b81b,tdx:_0x33e172}=_0x52557a,_0x52bef2=resolveLimit(_0x77b81b[_0x24ca74(0x1dd)],DEFAULT_DISPLAY_LIMIT),_0xff232d=_0x77b81b['status'];_0x77b81b[_0x24ca74(0x206)]&&(console[_0x24ca74(0x202)](_0x24ca74(0x20f)+_0x52bef2+'\x20jobs'),_0xff232d&&console['error'](_0x24ca74(0x1f8)+_0xff232d));const _0x1054b2=await withSpinner(_0x24ca74(0x1f4),()=>_0x33e172[_0x24ca74(0x1ea)][_0x24ca74(0x20b)]({'from':0x0,'to':_0x52bef2-0x1,'status':_0xff232d}),{'verbose':_0x77b81b[_0x24ca74(0x206)]}),_0x587e74=_0x1054b2[_0x24ca74(0x1ff)];console[_0x24ca74(0x202)]('✔\x20Found\x20'+_0x587e74[_0x24ca74(0x1e4)]+_0x24ca74(0x215)+(_0x587e74['length']!==0x1?'s':''));const _0x1a454b=_0x77b81b[_0x24ca74(0x1c9)];if(isStructuredFormat(_0x77b81b)){const _0x1e05a8=_0x587e74[_0x24ca74(0x1fb)](_0x5dcae8=>{const _0x59d0ef=_0x24ca74;let _0x22d8d6;if(_0x5dcae8[_0x59d0ef(0x1ed)]&&_0x5dcae8['end_at']){const _0x4c0a55=new Date(_0x5dcae8[_0x59d0ef(0x1ed)])['getTime'](),_0x50212c=new Date(_0x5dcae8[_0x59d0ef(0x216)])['getTime']();_0x22d8d6=Math[_0x59d0ef(0x1e7)]((_0x50212c-_0x4c0a55)/0x3e8);}return{'job_id':_0x5dcae8[_0x59d0ef(0x1e2)],'type':_0x5dcae8[_0x59d0ef(0x1ee)]===_0x59d0ef(0x1d8)?'trino':_0x5dcae8[_0x59d0ef(0x1ee)],'status':_0x5dcae8[_0x59d0ef(0x1d1)],'user_name':_0x5dcae8[_0x59d0ef(0x207)],'duration_sec':_0x22d8d6,'created_at':_0x5dcae8[_0x59d0ef(0x1c6)],'started_at':_0x5dcae8[_0x59d0ef(0x1ed)],'end_at':_0x5dcae8[_0x59d0ef(0x216)]};});await handleSDKOutput(_0x1e05a8,_0x77b81b);}else for(const _0x1fa4cf of _0x587e74){const _0x5529f5=_0x1fa4cf['status']===_0x24ca74(0x217)?a26_0x409776[_0x24ca74(0x1fa)]:_0x1fa4cf[_0x24ca74(0x1d1)]===_0x24ca74(0x202)?a26_0x409776[_0x24ca74(0x1e6)]:a26_0x409776[_0x24ca74(0x1e9)],_0x70ae22=_0x5529f5(_0x1fa4cf[_0x24ca74(0x1d1)]),_0x297d29=getJobUrl(_0x1a454b,_0x1fa4cf[_0x24ca74(0x1e2)]),_0x301a83=hyperlink(_0x1fa4cf[_0x24ca74(0x1e2)],_0x297d29),_0x4d47da=a26_0x409776['dim'](_0x1fa4cf[_0x24ca74(0x1ee)]===_0x24ca74(0x1d8)?_0x24ca74(0x209):_0x1fa4cf[_0x24ca74(0x1ee)]),_0xb0833d=[];if(_0x1fa4cf[_0x24ca74(0x1ed)]&&_0x1fa4cf['end_at']){const _0x3cce9f=Math[_0x24ca74(0x1e7)]((new Date(_0x1fa4cf[_0x24ca74(0x216)])[_0x24ca74(0x1d0)]()-new Date(_0x1fa4cf[_0x24ca74(0x1ed)])['getTime']())/0x3e8);_0xb0833d[_0x24ca74(0x1ca)](formatDuration(_0x3cce9f));}if(_0x1fa4cf[_0x24ca74(0x216)])_0xb0833d[_0x24ca74(0x1ca)](formatRelativeTime(new Date(_0x1fa4cf[_0x24ca74(0x216)])));else _0x1fa4cf['start_at']&&_0xb0833d[_0x24ca74(0x1ca)](formatRelativeTime(new Date(_0x1fa4cf['start_at'])));const _0x3253fd=_0xb0833d[_0x24ca74(0x1e4)]>0x0?a26_0x409776[_0x24ca74(0x1e9)]('\x20'+_0xb0833d[_0x24ca74(0x1eb)](',\x20')):'';console[_0x24ca74(0x1c3)]('⚡\x20'+_0x301a83+'\x20'+_0x4d47da+'\x20'+_0x70ae22+_0x3253fd);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x33ef8a(0x210)]=a26_0x33ef8a(0x1c5);['description']=a26_0x33ef8a(0x1f1);[a26_0x33ef8a(0x1d9)](_0x55eb9f){const _0x45363e=_0x55eb9f['args'][0x0];if(!_0x45363e)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x33ef8a(0x20a)](_0x3c5e5e){const _0x630f4b=a26_0x33ef8a,{options:_0x37fd96,args:_0x5ca32d,tdx:_0x5f09c4}=_0x3c5e5e,_0xbfdc12=_0x5ca32d[0x0],_0x3d39b7=await withSpinner('Getting\x20job\x20details...',()=>_0x5f09c4[_0x630f4b(0x1ea)]['show'](_0xbfdc12),{'verbose':_0x37fd96[_0x630f4b(0x206)]}),_0x575798=_0x3d39b7['data'];let _0x4833d1;if(_0x575798[_0x630f4b(0x1ed)]&&_0x575798[_0x630f4b(0x216)]){const _0x5d5455=new Date(_0x575798[_0x630f4b(0x1ed)])[_0x630f4b(0x1d0)](),_0xbba1a0=new Date(_0x575798[_0x630f4b(0x216)])[_0x630f4b(0x1d0)]();_0x4833d1=Math[_0x630f4b(0x1e7)]((_0xbba1a0-_0x5d5455)/0x3e8);}const _0x2f8cda={'job_id':_0x575798[_0x630f4b(0x1e2)],'type':_0x575798[_0x630f4b(0x1ee)],'status':_0x575798['status'],..._0x575798['user_name']&&{'user_name':_0x575798[_0x630f4b(0x207)]},..._0x4833d1!==undefined&&{'duration_sec':_0x4833d1},..._0x575798['created_at']&&{'created_at':_0x575798[_0x630f4b(0x1c6)]},..._0x575798[_0x630f4b(0x1ed)]&&{'started_at':_0x575798[_0x630f4b(0x1ed)]},..._0x575798[_0x630f4b(0x216)]&&{'end_at':_0x575798[_0x630f4b(0x216)]},..._0x575798[_0x630f4b(0x1f6)]&&{'database':_0x575798['database']},..._0x575798[_0x630f4b(0x1d2)]!==undefined&&{'priority':_0x575798[_0x630f4b(0x1d2)]},..._0x575798[_0x630f4b(0x1cd)]&&{'url':_0x575798[_0x630f4b(0x1cd)]},..._0x575798[_0x630f4b(0x20d)]&&{'query':_0x575798[_0x630f4b(0x20d)]},..._0x575798[_0x630f4b(0x1d3)]&&{'debug':_0x575798['debug']}};return await handleSingleObjectOutput(_0x2f8cda,_0x37fd96),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x33ef8a(0x210)]=a26_0x33ef8a(0x1db);[a26_0x33ef8a(0x1f0)]=a26_0x33ef8a(0x1d6);[a26_0x33ef8a(0x1d9)](_0x199dd2){const _0x54172a=a26_0x33ef8a,_0x28fe72=_0x199dd2['args'][0x0];if(!_0x28fe72)return _0x54172a(0x1ec);return undefined;}async[a26_0x33ef8a(0x20a)](_0x3edc18){const _0x202ae2=a26_0x33ef8a,{options:_0x4eeeee,args:_0x122522,tdx:_0xcdb7e3}=_0x3edc18,_0x1157c3=_0x122522[0x0];if(!_0x4eeeee[_0x202ae2(0x1c7)]){const _0x3c8fd3=await confirm(_0x202ae2(0x201)+_0x1157c3+'?');if(!_0x3c8fd3)return console[_0x202ae2(0x202)](_0x202ae2(0x1f3)),0x0;}return await withSpinner(_0x202ae2(0x20e),()=>_0xcdb7e3[_0x202ae2(0x1ea)]['kill'](_0x1157c3),{'verbose':_0x4eeeee['verbose']}),console['error']('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x1157c3),console['error'](_0x202ae2(0x1ef)+_0x1157c3+_0x202ae2(0x1fd)),0x0;}}function a26_0x374c(_0x31c2b3,_0x359211){_0x31c2b3=_0x31c2b3-0x1c3;const _0xa4332c=a26_0xa433();let _0x374cf4=_0xa4332c[_0x31c2b3];return _0x374cf4;}export class JobSubmitCommand extends BaseCommand{[a26_0x33ef8a(0x210)]='job:submit';[a26_0x33ef8a(0x1f0)]='Submit\x20a\x20job';async['execute'](_0x44bcbb){const _0x1b7702=a26_0x33ef8a,{options:_0x31226f,args:_0x36ce39,tdx:_0x81dc6f}=_0x44bcbb,_0x4f660e=_0x31226f['jobType']||'trino',_0x2bee8c=_0x31226f[_0x1b7702(0x1fe)],_0x4fb936=_0x31226f['database']||_0x1b7702(0x1df),_0x1afaf7=_0x31226f[_0x1b7702(0x1c4)];if(_0x4f660e!=='trino'&&_0x4f660e!==_0x1b7702(0x212))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b7702(0x1d4));let _0x5194b8;if(_0x2bee8c){if(_0x36ce39[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b7702(0x205));const _0x30361a=readSqlStatementsFromFile(_0x2bee8c);if(_0x30361a['length']===0x0)throw new SDKError(ErrorCode[_0x1b7702(0x1cf)],_0x1b7702(0x1cc));if(_0x30361a['length']>0x1)throw new SDKError(ErrorCode[_0x1b7702(0x1cf)],_0x1b7702(0x1cb));_0x5194b8=_0x30361a[0x0];}else{if(!_0x36ce39[0x0])throw new SDKError(ErrorCode[_0x1b7702(0x1cf)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x5194b8=_0x36ce39[0x0];}_0x31226f[_0x1b7702(0x206)]&&(console[_0x1b7702(0x202)]('Job\x20type:\x20'+_0x4f660e),console[_0x1b7702(0x202)](_0x1b7702(0x1ce)+_0x4fb936),console['error'](_0x1b7702(0x1fc)+_0x5194b8['substring'](0x0,0x64)+(_0x5194b8['length']>0x64?_0x1b7702(0x1e8):'')));const _0x276c87=await withSpinner('Submitting\x20job...',()=>_0x81dc6f[_0x1b7702(0x1ea)][_0x1b7702(0x1e1)](_0x4fb936,_0x5194b8,_0x4f660e,_0x1afaf7),{'verbose':_0x31226f[_0x1b7702(0x206)]}),_0x1ea704=_0x276c87[_0x1b7702(0x1ff)];return console[_0x1b7702(0x202)](_0x1b7702(0x1e3)),console[_0x1b7702(0x202)](_0x1b7702(0x208)+_0x1ea704[_0x1b7702(0x1e2)]),await handleSDKOutput([_0x1ea704],_0x31226f),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x33ef8a(0x210)]=a26_0x33ef8a(0x1dc);[a26_0x33ef8a(0x1f0)]='Get\x20job\x20results';[a26_0x33ef8a(0x1d9)](_0x1f4b02){const _0xe68f0=a26_0x33ef8a,_0x308316=_0x1f4b02[_0xe68f0(0x1e5)][0x0];if(!_0x308316)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x33ef8a(0x20a)](_0x3ad16f){const _0x407ebe=a26_0x33ef8a,{options:_0x25ca05,args:_0x14afab,tdx:_0x2ccf9b}=_0x3ad16f,_0xc3ca8f=_0x14afab[0x0],_0x11c72d=await withSpinner(_0x407ebe(0x1f9),()=>_0x2ccf9b[_0x407ebe(0x1ea)]['result'](_0xc3ca8f),{'verbose':_0x25ca05[_0x407ebe(0x206)]}),_0x5e4d79=_0x11c72d[_0x407ebe(0x1ff)];return console[_0x407ebe(0x202)](_0x407ebe(0x203)+_0x5e4d79[_0x407ebe(0x1e4)]+'\x20row'+(_0x5e4d79[_0x407ebe(0x1e4)]!==0x1?'s':'')),await handleSDKOutput(_0x5e4d79,_0x25ca05),0x0;}}
|
|
1
|
+
const a26_0x4f248f=a26_0x4352;(function(_0x6f294f,_0x2369f8){const _0x26db39=a26_0x4352,_0x2dba53=_0x6f294f();while(!![]){try{const _0x32501b=-parseInt(_0x26db39(0xdc))/0x1*(parseInt(_0x26db39(0xd0))/0x2)+-parseInt(_0x26db39(0xee))/0x3*(-parseInt(_0x26db39(0x101))/0x4)+-parseInt(_0x26db39(0x105))/0x5*(parseInt(_0x26db39(0xd7))/0x6)+-parseInt(_0x26db39(0xf0))/0x7*(-parseInt(_0x26db39(0x112))/0x8)+-parseInt(_0x26db39(0xec))/0x9*(parseInt(_0x26db39(0xeb))/0xa)+parseInt(_0x26db39(0xdf))/0xb*(-parseInt(_0x26db39(0xcf))/0xc)+parseInt(_0x26db39(0xff))/0xd;if(_0x32501b===_0x2369f8)break;else _0x2dba53['push'](_0x2dba53['shift']());}catch(_0x2335ae){_0x2dba53['push'](_0x2dba53['shift']());}}}(a26_0x38d6,0xb2c62));import{BaseCommand}from'./command.js';function a26_0x4352(_0x2a5670,_0x276e47){_0x2a5670=_0x2a5670-0xcd;const _0x38d6f3=a26_0x38d6();let _0x43524d=_0x38d6f3[_0x2a5670];return _0x43524d;}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_0x26f008 from'chalk';function formatDuration(_0x267163){const _0x4d031b=a26_0x4352;if(_0x267163<0x3c)return _0x267163+'s';if(_0x267163<0xe10)return Math[_0x4d031b(0xde)](_0x267163/0x3c)+'m\x20'+_0x267163%0x3c+'s';const _0x5e28b4=Math['floor'](_0x267163/0xe10),_0x40f1c0=Math[_0x4d031b(0xde)](_0x267163%0xe10/0x3c);return _0x40f1c0>0x0?_0x5e28b4+'h\x20'+_0x40f1c0+'m':_0x5e28b4+'h';}function formatRelativeTime(_0x475444){const _0x390598=a26_0x4352,_0x488d08=Date[_0x390598(0xfb)]()-_0x475444[_0x390598(0x10a)](),_0x169605=Math[_0x390598(0xde)](Math['abs'](_0x488d08)/0x3e8);if(_0x169605<0x3c)return _0x390598(0xe0);const _0x1720ca=Math[_0x390598(0xde)](_0x169605/0x3c);if(_0x1720ca<0x3c)return _0x1720ca+_0x390598(0xd8);const _0x4cc44a=Math['floor'](_0x1720ca/0x3c);if(_0x4cc44a<0x18)return _0x4cc44a+_0x390598(0x122);const _0x3a0097=Math[_0x390598(0xde)](_0x4cc44a/0x18);if(_0x3a0097<0x1e)return _0x3a0097+_0x390598(0x120);return Math[_0x390598(0xde)](_0x3a0097/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x4f248f(0x10d)]='jobs';[a26_0x4f248f(0x119)]='List\x20jobs';async[a26_0x4f248f(0x116)](_0x5bd196){const _0x3ca343=a26_0x4f248f,{options:_0x7f631e,tdx:_0x4a2a31}=_0x5bd196,_0x120cab=resolveLimit(_0x7f631e[_0x3ca343(0x103)],DEFAULT_DISPLAY_LIMIT),_0x21475e=_0x7f631e['status'];_0x7f631e[_0x3ca343(0x100)]&&(console['error'](_0x3ca343(0xd3)+_0x120cab+'\x20jobs'),_0x21475e&&console[_0x3ca343(0xce)](_0x3ca343(0x115)+_0x21475e));const _0x4851a7=await withSpinner(_0x3ca343(0xd4),()=>_0x4a2a31[_0x3ca343(0x10f)][_0x3ca343(0xf5)]({'from':0x0,'to':_0x120cab-0x1,'status':_0x21475e}),{'verbose':_0x7f631e['verbose']}),_0x3aa9ce=_0x4851a7['data'];console[_0x3ca343(0xce)](_0x3ca343(0xfe)+_0x3aa9ce[_0x3ca343(0x117)]+'\x20job'+(_0x3aa9ce[_0x3ca343(0x117)]!==0x1?'s':''));const _0x2299e0=_0x7f631e[_0x3ca343(0xf8)];if(isStructuredFormat(_0x7f631e)){const _0x3c8119=_0x3aa9ce[_0x3ca343(0xe3)](_0x1c8414=>{const _0x250d38=_0x3ca343;let _0x3d4ff9;if(_0x1c8414[_0x250d38(0xe7)]&&_0x1c8414['end_at']){const _0x880c02=new Date(_0x1c8414[_0x250d38(0xe7)])['getTime'](),_0x23dde5=new Date(_0x1c8414['end_at'])['getTime']();_0x3d4ff9=Math[_0x250d38(0xd2)]((_0x23dde5-_0x880c02)/0x3e8);}return{'job_id':_0x1c8414[_0x250d38(0x11a)],'type':_0x1c8414[_0x250d38(0x121)]===_0x250d38(0xd5)?_0x250d38(0xe8):_0x1c8414['type'],'status':_0x1c8414[_0x250d38(0xe6)],'user_name':_0x1c8414['user_name'],'duration_sec':_0x3d4ff9,'created_at':_0x1c8414[_0x250d38(0x118)],'started_at':_0x1c8414['start_at'],'end_at':_0x1c8414[_0x250d38(0x11c)]};});await handleSDKOutput(_0x3c8119,_0x7f631e);}else for(const _0x333e26 of _0x3aa9ce){const _0x1070a0=_0x333e26['status']==='success'?a26_0x26f008[_0x3ca343(0xdb)]:_0x333e26['status']===_0x3ca343(0xce)?a26_0x26f008[_0x3ca343(0xe1)]:a26_0x26f008[_0x3ca343(0xef)],_0x109872=_0x1070a0(_0x333e26[_0x3ca343(0xe6)]),_0x4b025a=getJobUrl(_0x2299e0,_0x333e26['job_id']),_0x2e97ab=hyperlink(_0x333e26['job_id'],_0x4b025a),_0x57c986=a26_0x26f008[_0x3ca343(0xef)](_0x333e26[_0x3ca343(0x121)]===_0x3ca343(0xd5)?_0x3ca343(0xe8):_0x333e26['type']),_0xe5df71=[];if(_0x333e26['start_at']&&_0x333e26[_0x3ca343(0x11c)]){const _0x170d2c=Math['round']((new Date(_0x333e26[_0x3ca343(0x11c)])[_0x3ca343(0x10a)]()-new Date(_0x333e26['start_at'])['getTime']())/0x3e8);_0xe5df71[_0x3ca343(0x11f)](formatDuration(_0x170d2c));}if(_0x333e26[_0x3ca343(0x11c)])_0xe5df71[_0x3ca343(0x11f)](formatRelativeTime(new Date(_0x333e26[_0x3ca343(0x11c)])));else _0x333e26[_0x3ca343(0xe7)]&&_0xe5df71[_0x3ca343(0x11f)](formatRelativeTime(new Date(_0x333e26[_0x3ca343(0xe7)])));const _0x5514d7=_0xe5df71[_0x3ca343(0x117)]>0x0?a26_0x26f008['dim']('\x20'+_0xe5df71['join'](',\x20')):'';console[_0x3ca343(0x109)]('⚡\x20'+_0x2e97ab+'\x20'+_0x57c986+'\x20'+_0x109872+_0x5514d7);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x4f248f(0x10d)]='job:show';[a26_0x4f248f(0x119)]=a26_0x4f248f(0x10c);[a26_0x4f248f(0x107)](_0xd021ca){const _0x44e2c2=a26_0x4f248f,_0x24049d=_0xd021ca['args'][0x0];if(!_0x24049d)return _0x44e2c2(0x10b);return undefined;}async[a26_0x4f248f(0x116)](_0x2ab86c){const _0x25a05b=a26_0x4f248f,{options:_0x5cd10d,args:_0x11f590,tdx:_0x58d1f7}=_0x2ab86c,_0x3a6680=_0x11f590[0x0],_0x1dac93=await withSpinner(_0x25a05b(0xf2),()=>_0x58d1f7[_0x25a05b(0x10f)][_0x25a05b(0xd1)](_0x3a6680),{'verbose':_0x5cd10d[_0x25a05b(0x100)]}),_0x1ed5dc=_0x1dac93[_0x25a05b(0x114)];let _0x426eea;if(_0x1ed5dc[_0x25a05b(0xe7)]&&_0x1ed5dc[_0x25a05b(0x11c)]){const _0x4e11d3=new Date(_0x1ed5dc['start_at'])['getTime'](),_0x441dbd=new Date(_0x1ed5dc[_0x25a05b(0x11c)])['getTime']();_0x426eea=Math[_0x25a05b(0xd2)]((_0x441dbd-_0x4e11d3)/0x3e8);}const _0x161a0d={'job_id':_0x1ed5dc['job_id'],'type':_0x1ed5dc[_0x25a05b(0x121)],'status':_0x1ed5dc['status'],..._0x1ed5dc[_0x25a05b(0xd6)]&&{'user_name':_0x1ed5dc[_0x25a05b(0xd6)]},..._0x426eea!==undefined&&{'duration_sec':_0x426eea},..._0x1ed5dc[_0x25a05b(0x118)]&&{'created_at':_0x1ed5dc[_0x25a05b(0x118)]},..._0x1ed5dc[_0x25a05b(0xe7)]&&{'started_at':_0x1ed5dc[_0x25a05b(0xe7)]},..._0x1ed5dc[_0x25a05b(0x11c)]&&{'end_at':_0x1ed5dc[_0x25a05b(0x11c)]},..._0x1ed5dc[_0x25a05b(0xf3)]&&{'database':_0x1ed5dc[_0x25a05b(0xf3)]},..._0x1ed5dc[_0x25a05b(0xf6)]!==undefined&&{'priority':_0x1ed5dc[_0x25a05b(0xf6)]},..._0x1ed5dc[_0x25a05b(0x106)]&&{'url':_0x1ed5dc[_0x25a05b(0x106)]},..._0x1ed5dc[_0x25a05b(0xe4)]&&{'query':_0x1ed5dc['query']},..._0x1ed5dc[_0x25a05b(0xfc)]&&{'debug':_0x1ed5dc[_0x25a05b(0xfc)]}};return await handleSingleObjectOutput(_0x161a0d,_0x5cd10d),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x4f248f(0x10d)]='job:kill';[a26_0x4f248f(0x119)]='Kill\x20a\x20job';[a26_0x4f248f(0x107)](_0x1c1ac4){const _0x2afb8a=a26_0x4f248f,_0x4a7309=_0x1c1ac4[_0x2afb8a(0xf7)][0x0];if(!_0x4a7309)return _0x2afb8a(0x104);return undefined;}async[a26_0x4f248f(0x116)](_0x513766){const _0x18f4de=a26_0x4f248f,{options:_0x208cad,args:_0x5575fc,tdx:_0x50573f}=_0x513766,_0x16f6ce=_0x5575fc[0x0];if(!_0x208cad[_0x18f4de(0xf1)]){const _0x4f2a54=await confirm(_0x18f4de(0x11e)+_0x16f6ce+'?');if(!_0x4f2a54)return console[_0x18f4de(0xce)](_0x18f4de(0x113)),0x0;}return await withSpinner(_0x18f4de(0x102),()=>_0x50573f[_0x18f4de(0x10f)]['kill'](_0x16f6ce),{'verbose':_0x208cad['verbose']}),console['error'](_0x18f4de(0xdd)+_0x16f6ce),console[_0x18f4de(0xce)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x16f6ce+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x4f248f(0x10d)]=a26_0x4f248f(0xcd);[a26_0x4f248f(0x119)]='Submit\x20a\x20job';async['execute'](_0x29f79d){const _0x4573de=a26_0x4f248f,{options:_0x8bc48e,args:_0x4a2f91,tdx:_0x34a0db}=_0x29f79d,_0x3645d2=_0x8bc48e[_0x4573de(0xd9)]||_0x4573de(0xe8),_0x432b27=_0x8bc48e['file'],_0x582729=_0x8bc48e[_0x4573de(0xf3)]||'information_schema',_0x1f3e55=_0x8bc48e[_0x4573de(0x108)];if(_0x3645d2!==_0x4573de(0xe8)&&_0x3645d2!==_0x4573de(0xfa))throw new SDKError(ErrorCode[_0x4573de(0x11b)],_0x4573de(0x10e));let _0x42f730;if(_0x432b27){if(_0x4a2f91[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4573de(0xf9));const _0x52616b=readSqlStatementsFromFile(_0x432b27);if(_0x52616b[_0x4573de(0x117)]===0x0)throw new SDKError(ErrorCode[_0x4573de(0x11b)],_0x4573de(0xe2));if(_0x52616b[_0x4573de(0x117)]>0x1)throw new SDKError(ErrorCode[_0x4573de(0x11b)],_0x4573de(0x11d));_0x42f730=_0x52616b[0x0];}else{if(!_0x4a2f91[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4573de(0xf4));_0x42f730=_0x4a2f91[0x0];}_0x8bc48e['verbose']&&(console[_0x4573de(0xce)]('Job\x20type:\x20'+_0x3645d2),console['error']('Database:\x20'+_0x582729),console['error'](_0x4573de(0x111)+_0x42f730['substring'](0x0,0x64)+(_0x42f730['length']>0x64?_0x4573de(0xda):'')));const _0x2b9785=await withSpinner(_0x4573de(0xed),()=>_0x34a0db[_0x4573de(0x10f)][_0x4573de(0xe5)](_0x582729,_0x42f730,_0x3645d2,_0x1f3e55),{'verbose':_0x8bc48e[_0x4573de(0x100)]}),_0x279f55=_0x2b9785[_0x4573de(0x114)];return console[_0x4573de(0xce)]('✔\x20Job\x20submitted'),console[_0x4573de(0xce)](_0x4573de(0xfd)+_0x279f55[_0x4573de(0x11a)]),await handleSDKOutput([_0x279f55],_0x8bc48e),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';['description']='Get\x20job\x20results';[a26_0x4f248f(0x107)](_0x4881ea){const _0x6db4da=a26_0x4f248f,_0x464a2a=_0x4881ea['args'][0x0];if(!_0x464a2a)return _0x6db4da(0x110);return undefined;}async[a26_0x4f248f(0x116)](_0x2e2782){const _0x2a42f8=a26_0x4f248f,{options:_0x44d367,args:_0x174337,tdx:_0x265821}=_0x2e2782,_0x25afc3=_0x174337[0x0],_0x3c77f2=await withSpinner(_0x2a42f8(0xe9),()=>_0x265821[_0x2a42f8(0x10f)][_0x2a42f8(0x108)](_0x25afc3),{'verbose':_0x44d367[_0x2a42f8(0x100)]}),_0x45c7e0=_0x3c77f2[_0x2a42f8(0x114)];return console['error'](_0x2a42f8(0xea)+_0x45c7e0[_0x2a42f8(0x117)]+'\x20row'+(_0x45c7e0[_0x2a42f8(0x117)]!==0x1?'s':'')),await handleSDKOutput(_0x45c7e0,_0x44d367),0x0;}}function a26_0x38d6(){const _0x59feb8=['2793IaSEDY','dim','119evAxHY','yes','Getting\x20job\x20details...','database','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','list','priority','args','site','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','hive','now','debug','\x20\x20Job\x20ID:\x20','✔\x20Found\x20','27951794XEhxbP','verbose','5440QhTDMS','Submitting\x20kill\x20request...','limit','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','1991840foqFmQ','url','validate','result','log','getTime','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Show\x20job\x20details','name','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Query:\x20','297456gSPUjY','Cancelled','data','Status\x20filter:\x20','execute','length','created_at','description','job_id','INVALID_ARGUMENT','end_at','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','push','d\x20ago','type','h\x20ago','job:submit','error','48ChDspj','2529066Pidyxj','show','round','Limit:\x20','Listing\x20jobs...','presto','user_name','6mQGFzw','m\x20ago','jobType','...','green','1BAEfny','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','floor','749287AEmkYq','just\x20now','red','No\x20SQL\x20statements\x20found\x20in\x20file','map','query','submit','status','start_at','trino','Getting\x20job\x20results...','✔\x20Retrieved\x20','30gekZFQ','4142295cAkeiu','Submitting\x20job...'];a26_0x38d6=function(){return _0x59feb8;};return a26_0x38d6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0xf1319a=a27_0x2be4;(function(_0x1225dd,_0x30c34f){const _0x2b814c=a27_0x2be4,_0x14ea2b=_0x1225dd();while(!![]){try{const _0xd99020=-parseInt(_0x2b814c(0x194))/0x1*(parseInt(_0x2b814c(0x1c2))/0x2)+-parseInt(_0x2b814c(0x17f))/0x3+-parseInt(_0x2b814c(0x16c))/0x4*(-parseInt(_0x2b814c(0x1ea))/0x5)+parseInt(_0x2b814c(0x153))/0x6*(parseInt(_0x2b814c(0x228))/0x7)+parseInt(_0x2b814c(0x165))/0x8*(-parseInt(_0x2b814c(0x239))/0x9)+-parseInt(_0x2b814c(0x238))/0xa+parseInt(_0x2b814c(0x209))/0xb*(parseInt(_0x2b814c(0x1f4))/0xc);if(_0xd99020===_0x30c34f)break;else _0x14ea2b['push'](_0x14ea2b['shift']());}catch(_0x278915){_0x14ea2b['push'](_0x14ea2b['shift']());}}}(a27_0x41a9,0x84c4a));import a27_0xadadca from'chalk';import a27_0x12d0f7 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';function a27_0x41a9(){const _0x42552c=['\x20=\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','pause','\x20Opening\x20','No\x20journeys\x20found','Export\x20journey(s)\x20as\x20YAML\x20files','Error:\x20--version\x20option\x20is\x20required','name','from',',\x20schedule:\x20','✔\x20Context\x20set:\x20','Fetching\x20parent\x20segment...','getLatestJourneyId','1886775MFbkug','pausedAt','getTrafficData','/e/','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Write\x20','\x20not\x20found.\x20Available:\x20','Activations:','exitOrJumpRate','cyan','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journeyId','description','Trigger\x20on-demand\x20journey\x20workflow\x20execution','state','toLowerCase','isNew','diff','Resuming\x20journey...','bold','Error:\x20Stage\x20\x22','50349PjWsnc','\x20unchanged\x20files','relativePath','executeDryRun','\x20journey','no_parent','Target\x20directory:\x20','\x20\x20Folder\x20path:\x20','has','(unnamed)','completionRate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','runAt','List\x20activations\x20for\x20a\x20journey','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','completed','replace','\x5c$&','columns','Resolving\x20version...','content','get','updatedAt','parent_segment','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','workflowSessionId','test','connectionId','setPhase','segment','🗺️\x20','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Target\x20file:\x20','versionNumber','format','localeCompare','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','root\x20folder','Triggering\x20journey\x20workflow...','none','createdAt','session','audienceId','connection\x20','Resolving\x20parent\x20segment...','Journey\x20name:\x20','42lrXDPr','journey:stats','journey:columns','\x22\x20resumed','buildIdToNameMap','base','entries','user','length','error','journeyBundleName','Getting\x20journey\x20traffic\x20data...','reentryMode','Resume\x20a\x20paused\x20journey','rootFolderId','Input:\x20','connection','goal','resolveParentId','\x20[runs\x20on\x20refresh]','createVersion','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Error:\x20Version\x20','yes','Status:','Listing\x20journey\x20activations...','filter','journey:versions','Journey:','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','limit','run','add','State:','Error:\x20Invalid\x20--type\x20\x22','getStatistics','helpText','getColumnMapping','Warning:\x20Could\x20not\x20resolve\x20activation\x20','all','5055GwMhWR','\x0aChanges\x20to\x20\x27','Pausing\x20journey...','Getting\x20column\x20mapping...','journeyBundleId','/app/ps/','Resolved\x20YAML\x20file:\x20','nodes','Listing\x20journeys...','stage','20268dEtpWb','completeMilestoneRate','getJourney','Folder\x20path:\x20','utf-8','Parent\x20segment\x20ID:','includeStats','Paused:','Fetching\x20','file','Error:\x20Journey\x20not\x20found:\x20','join','listJourneysFromParentSegment','relative','hasPeriod','getParentFull','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','listActivationsFlat','errorCode','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','database','10527bGhIem','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','repeat','/j/da/je','(root)','\x0aPull\x20summary:','archived','hasChanges','red','activation','yellow','\x20version','journey:push','set','milestoneSize','buildIdToEmailMap','(paused)','stages','runAfterJourneyRefresh','📁\x20','Fetching\x20users\x20and\x20connections...','journey:traffic',',\x20version:\x20','find','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','...','journey:pause','listVersions','no\x20connection','message','folderPath','14okIKBR','Stages:','(draft)','cwd','scheduleType','segments','then','\x20@\x20','log','Getting\x20journey\x20details...','type','List\x20journeys\x20in\x20current\x20context','\x20\x20Name:\x20','List\x20all\x20versions\x20of\x20a\x20journey','values','parentName','5694690CAKCoJ','9sRSYNw','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Fetching\x20journey\x20','history','attributes','\x20Journey\x20workflow\x20started','map','journeyStages','ID:','⚠️\x20','\x20files?','exitOrJumpSize','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','Parent\x20segment:\x20','\x20changed\x20files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parentSegment','\x20\x20-\x20','segmentPushCommand','enteredSize','journey:run','Getting\x20version\x20','Cancelled','listFolders','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journey:activations','json','Getting\x20journey\x20statistics...','filePath','tdx.json','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','paused','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','getSegment','Pattern:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','segmentName','site','goalSize','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20\x20Parent\x20segment:\x20','execute','journey:view','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Found\x20','INVALID_ARGUMENT','dim','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)','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','connector_config','\x22\x20paused','sort','push','journey','folderId','Options:','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20details...','conversion','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','✔\x20Pulled\x20','\x22\x20not\x20found','\x20activation','.yml','options','Resolving\x20journey...','(completed)','split','tsv','folders','✔\x20Journey\x20\x22','journey:version:view','table','1809246SRamOu','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','size','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','jsonl','(archived)','version','getActivation','(none)','green','\x20new\x20files','Error:\x20','includeHistory','journeyName','journey:version:create','Show\x20journey\x20statistics','data','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','1336344WPfGKW','resourceName','activationParams','\x20->\x20','\x0aError:','rule','\x20journeys','2956vcRFok','/j/da','Fetching\x20journeys\x20and\x20folders...','launched','journeys','verbose'];a27_0x41a9=function(){return _0x42552c;};return a27_0x41a9();}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(_0x566d7e){const _0x51b176=a27_0x2be4;return!_0x566d7e&&(console['error'](_0x51b176(0x12c)),console['error'](_0x51b176(0x1b3))),!!_0x566d7e;}function withJsonFormat(_0x587463){const _0x14ed3c=a27_0x2be4;if(!_0x587463['format']&&!_0x587463[_0x14ed3c(0x253)]&&!_0x587463[_0x14ed3c(0x157)]&&!_0x587463[_0x14ed3c(0x14e)])return{..._0x587463,'format':'json','json':!![]};return _0x587463;}function formatJourneyState(_0x508094){const _0x218692=a27_0x2be4;switch(_0x508094){case _0x218692(0x16f):return a27_0xadadca[_0x218692(0x15c)]('(running)');case'draft':return a27_0xadadca['dim'](_0x218692(0x22a));case _0x218692(0x259):return a27_0xadadca[_0x218692(0x213)](_0x218692(0x219));case _0x218692(0x1a3):return a27_0xadadca['blue'](_0x218692(0x14c));case _0x218692(0x20f):return a27_0xadadca[_0x218692(0x138)](_0x218692(0x158));default:return'('+_0x508094+')';}}function a27_0x2be4(_0x54a19e,_0x1a66a7){_0x54a19e=_0x54a19e-0x129;const _0x41a998=a27_0x41a9();let _0x2be49a=_0x41a998[_0x54a19e];return _0x2be49a;}function formatJourneyItem(_0x4c5687,_0x371270='',_0x5e4b61){const _0x48672a=a27_0x2be4,_0x577d93=formatJourneyState(_0x4c5687[_0x48672a(0x18d)]),_0x217789=_0x5e4b61?hyperlink(_0x4c5687[_0x48672a(0x1cc)],_0x5e4b61):_0x4c5687[_0x48672a(0x1cc)];return _0x371270+_0x48672a(0x1b2)+_0x217789+'\x20'+_0x577d93;}function escapeRegex(_0xb85a4b){const _0x40f35d=a27_0x2be4;return _0xb85a4b[_0x40f35d(0x1a4)](/[.*+?^${}()|[\]\\]/g,_0x40f35d(0x1a5));}function globToRegex(_0x17964c){const _0x529b0b=a27_0x2be4,_0xea008=_0x17964c[_0x529b0b(0x14d)]('*')[_0x529b0b(0x23f)](escapeRegex);return new RegExp(_0xea008[_0x529b0b(0x1ff)]('.*'),'i');}function buildRuleToNameMapping(_0xdb0f61){const _0xfa2294=a27_0x2be4,_0x3ce788=new Map();if(_0xdb0f61[_0xfa2294(0x22d)])for(const [_0xc0887a,_0x112aec]of Object[_0xfa2294(0x1c8)](_0xdb0f61[_0xfa2294(0x22d)])){if(_0x112aec[_0xfa2294(0x16a)]){const _0x1da6f0=serializeRule(_0x112aec[_0xfa2294(0x16a)]),_0x54468b=_0x3ce788[_0xfa2294(0x1a9)](_0x1da6f0);_0x54468b?_0x54468b[_0xfa2294(0x13e)](_0xc0887a):_0x3ce788[_0xfa2294(0x216)](_0x1da6f0,[_0xc0887a]);}}return _0x3ce788;}async function resolveJourneyIdFromInput(_0x410b80,_0x55ea9c,_0x55c9b2){const _0x22656f=a27_0x2be4,_0x872f88=await resolveJourneyTarget(_0x410b80,_0x55ea9c['parentSegment'],_0x55ea9c[_0x22656f(0x171)]),_0x3de149=_0x872f88[_0x22656f(0x249)];if(!_0x3de149)throw new SDKError(ErrorCode[_0x22656f(0x137)],_0x22656f(0x1ac));const _0x2ba212=await withSpinner(_0x22656f(0x1c0),()=>_0x55c9b2[_0x22656f(0x1b1)][_0x22656f(0x1d4)](_0x3de149),{'verbose':_0x55ea9c[_0x22656f(0x171)]}),_0x4f20fb=_0x2ba212[_0x22656f(0x163)],_0x3b0cd7=await withSpinner(_0x22656f(0x14b),()=>_0x55c9b2[_0x22656f(0x13f)]['resolveJourneyId'](_0x4f20fb,_0x872f88['journeyName']),{'verbose':_0x55ea9c[_0x22656f(0x171)]});return{'journeyId':_0x3b0cd7['data'],'journeyName':_0x872f88[_0x22656f(0x160)],'parentSegmentId':_0x4f20fb};}async function resolveJourneyTarget(_0x2556aa,_0x36f1be,_0x3ae29b){const _0x4fb545=a27_0x2be4;if(isYamlFilePath(_0x2556aa))try{const _0xbc9856=await resolveYamlFilePath(_0x2556aa);return _0x3ae29b&&(console[_0x4fb545(0x1cb)](_0x4fb545(0x1f0)+_0x2556aa),console['error'](_0x4fb545(0x132)+_0xbc9856['parentSegment']),console[_0x4fb545(0x1cb)](_0x4fb545(0x234)+_0xbc9856[_0x4fb545(0x12e)]),console[_0x4fb545(0x1cb)](_0x4fb545(0x19b)+(_0xbc9856['folderPath']||_0x4fb545(0x20d)))),{'journeyName':_0xbc9856[_0x4fb545(0x12e)],'parentSegment':_0xbc9856[_0x4fb545(0x249)],'resolved':_0xbc9856};}catch(_0x3f2aec){throw new SDKError(ErrorCode[_0x4fb545(0x137)],_0x4fb545(0x23a)+_0x3f2aec[_0x4fb545(0x226)]);}if(!_0x36f1be)throw new SDKError(ErrorCode[_0x4fb545(0x137)],_0x4fb545(0x221));return{'journeyName':_0x2556aa,'parentSegment':_0x36f1be};}export class JourneyListCommand extends BaseCommand{[a27_0xf1319a(0x179)]='journey:list';[a27_0xf1319a(0x18b)]=a27_0xf1319a(0x233);async[a27_0xf1319a(0x133)](_0xd4f140){const _0x1597c3=a27_0xf1319a,{options:_0x504581,args:_0x44b884,tdx:_0x41b263}=_0xd4f140,_0x2208b3=_0x44b884[0x0],_0x5a1c70=_0x504581[_0x1597c3(0x249)];if(!_0x5a1c70)return console[_0x1597c3(0x1cb)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x1597c3(0x1cb)](_0x1597c3(0x145)),0x1;const _0x15e994=await withSpinner(_0x1597c3(0x1c0),()=>_0x41b263[_0x1597c3(0x1b1)]['resolveParentId'](_0x5a1c70),{'verbose':_0x504581[_0x1597c3(0x171)]}),_0x79eefa=_0x15e994[_0x1597c3(0x163)];_0x504581['verbose']&&(console['error'](_0x1597c3(0x246)+_0x5a1c70+'\x20(ID:\x20'+_0x79eefa+')'),_0x2208b3&&console['error'](_0x1597c3(0x25c)+_0x2208b3));const _0x4e698e=await withSpinner(_0x1597c3(0x17d),()=>_0x41b263[_0x1597c3(0x1b1)][_0x1597c3(0x203)](_0x79eefa),{'verbose':_0x504581[_0x1597c3(0x171)]}),_0x45f9a5=_0x4e698e[_0x1597c3(0x163)],_0x3625fd=_0x45f9a5[_0x1597c3(0x1d0)],_0x3c2a52=await withSpinner(_0x1597c3(0x1f2),()=>_0x41b263[_0x1597c3(0x13f)]['listJourneysWithFolders'](_0x79eefa,_0x3625fd),{'verbose':_0x504581[_0x1597c3(0x171)]});let _0x327e4d=_0x3c2a52[_0x1597c3(0x163)][_0x1597c3(0x170)];const _0x4da289=_0x3c2a52[_0x1597c3(0x163)][_0x1597c3(0x14f)],_0x5c9f64=new Map();for(const _0x58b0e4 of _0x4da289){_0x5c9f64[_0x1597c3(0x216)](_0x58b0e4['id'],_0x58b0e4[_0x1597c3(0x179)]);}if(_0x2208b3){const _0x91dc86=globToRegex(_0x2208b3);_0x327e4d=_0x327e4d[_0x1597c3(0x1dc)](_0x428e1b=>_0x91dc86[_0x1597c3(0x1ae)](_0x428e1b['journeyBundleName']));}console[_0x1597c3(0x1cb)]('✔\x20Found\x20'+_0x327e4d['length']+_0x1597c3(0x198)+(_0x327e4d['length']!==0x1?'s':''));const _0x5e4875=_0x4f4512=>{const _0x335676=_0x1597c3;return getConsoleNextUrl(_0x504581[_0x335676(0x12f)],_0x335676(0x1ef)+_0x79eefa+_0x335676(0x182)+_0x4f4512+_0x335676(0x16d));};if(_0x504581['format']===_0x1597c3(0x152))await handleSDKOutput(_0x327e4d,_0x504581);else{if(_0x504581[_0x1597c3(0x1b6)]===_0x1597c3(0x253)){const _0x2bb053=_0x327e4d[_0x1597c3(0x23f)](_0x506667=>({..._0x506667,'url':_0x5e4875(_0x506667['id'])}));await handleSDKOutput(_0x2bb053,_0x504581);}else{console[_0x1597c3(0x230)]('['+_0x5a1c70+']');const _0x5a8e40=new Map(),_0x22ce07=[];for(const _0x102a27 of _0x327e4d){if(!_0x102a27[_0x1597c3(0x140)]||_0x102a27[_0x1597c3(0x140)]===_0x3625fd)_0x22ce07['push'](_0x102a27);else{const _0x3eefbd=_0x5a8e40[_0x1597c3(0x1a9)](_0x102a27['folderId'])||[];_0x3eefbd['push'](_0x102a27),_0x5a8e40[_0x1597c3(0x216)](_0x102a27[_0x1597c3(0x140)],_0x3eefbd);}}const _0x2e84c7=(_0x1ad67d,_0x3553cc)=>_0x1ad67d[_0x1597c3(0x1cc)][_0x1597c3(0x1b7)](_0x3553cc[_0x1597c3(0x1cc)],undefined,{'sensitivity':_0x1597c3(0x1c7)});_0x22ce07[_0x1597c3(0x13d)](_0x2e84c7);for(const _0x402d32 of _0x22ce07){console['log'](formatJourneyItem(_0x402d32,'',_0x5e4875(_0x402d32['id'])));}const _0x30ee11=[..._0x5a8e40['entries']()]['sort']((_0x3a50e3,_0x1133f0)=>{const _0x539059=_0x1597c3,_0x1662b4=_0x5c9f64['get'](_0x3a50e3[0x0])||_0x3a50e3[0x0],_0x106968=_0x5c9f64[_0x539059(0x1a9)](_0x1133f0[0x0])||_0x1133f0[0x0];return _0x1662b4['localeCompare'](_0x106968,undefined,{'sensitivity':_0x539059(0x1c7)});});for(const [_0x23d7ce,_0x2e211f]of _0x30ee11){const _0x474a7e=_0x5c9f64['get'](_0x23d7ce)||_0x23d7ce;console[_0x1597c3(0x230)](_0x1597c3(0x21c)+_0x474a7e),_0x2e211f[_0x1597c3(0x13d)](_0x2e84c7);for(const _0x19e743 of _0x2e211f){console[_0x1597c3(0x230)](formatJourneyItem(_0x19e743,'\x20\x20',_0x5e4875(_0x19e743['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0xf1319a(0x134);[a27_0xf1319a(0x18b)]='Show\x20journey\x20details';async[a27_0xf1319a(0x133)](_0x31bc25){const _0x4f06a1=a27_0xf1319a,{options:_0x595e30,args:_0x2ea2f0,tdx:_0xb90a3c}=_0x31bc25,_0x1e4fb1=_0x2ea2f0[0x0];if(!_0x1e4fb1)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x4f06a1(0x25a)),console[_0x4f06a1(0x1cb)](_0x4f06a1(0x141)),console[_0x4f06a1(0x1cb)](_0x4f06a1(0x156)),0x1;_0x595e30[_0x4f06a1(0x171)]&&console['error'](_0x4f06a1(0x1d1)+_0x1e4fb1);const {journeyId:_0x3928b7,parentSegmentId:_0x197c1c}=await resolveJourneyIdFromInput(_0x1e4fb1,_0x595e30,_0xb90a3c);if(_0x595e30['web']){const _0x1abf2e=getConsoleNextUrl(_0x595e30['site'],_0x4f06a1(0x1ef)+_0x197c1c+'/e/'+_0x3928b7+_0x4f06a1(0x20c));return console['error'](a27_0xadadca[_0x4f06a1(0x15c)]('✔')+_0x4f06a1(0x175)+a27_0xadadca[_0x4f06a1(0x188)](_0x1abf2e)),openBrowser(_0x1abf2e),0x0;}const _0x3ab2f2=await withSpinner(_0x4f06a1(0x231),()=>_0xb90a3c[_0x4f06a1(0x13f)][_0x4f06a1(0x1f6)](_0x3928b7),{'verbose':_0x595e30[_0x4f06a1(0x171)]}),_0x16b5c9=_0x3ab2f2[_0x4f06a1(0x163)],_0x1acda5=_0x595e30[_0x4f06a1(0x1fa)];let _0x70caba;if(_0x1acda5)try{const _0x3fe014=await withSpinner(_0x4f06a1(0x254),()=>_0xb90a3c[_0x4f06a1(0x13f)][_0x4f06a1(0x1e5)](_0x3928b7),{'verbose':_0x595e30[_0x4f06a1(0x171)]});_0x70caba=_0x3fe014[_0x4f06a1(0x163)];}catch{_0x595e30[_0x4f06a1(0x171)]&&console[_0x4f06a1(0x1cb)]('\x20\x20Statistics\x20not\x20available');}const _0x112a8f=getConsoleNextUrl(_0x595e30[_0x4f06a1(0x12f)],_0x4f06a1(0x1ef)+_0x197c1c+'/e/'+_0x3928b7+_0x4f06a1(0x20c)),_0x18e3d9={'id':_0x16b5c9['id'],'name':_0x16b5c9[_0x4f06a1(0x23d)]['name'],'description':_0x16b5c9[_0x4f06a1(0x23d)][_0x4f06a1(0x18b)],'state':_0x16b5c9['attributes'][_0x4f06a1(0x18d)],'paused':_0x16b5c9[_0x4f06a1(0x23d)]['paused'],'reentry_mode':_0x16b5c9[_0x4f06a1(0x23d)][_0x4f06a1(0x1ce)],'stages':_0x16b5c9[_0x4f06a1(0x23d)][_0x4f06a1(0x240)]?.[_0x4f06a1(0x1ca)]||0x0,..._0x16b5c9[_0x4f06a1(0x23d)][_0x4f06a1(0x1d3)]&&{'goal':_0x16b5c9[_0x4f06a1(0x23d)][_0x4f06a1(0x1d3)][_0x4f06a1(0x179)]},..._0x70caba&&{'statistics':{'size':_0x70caba[_0x4f06a1(0x155)],'entered':_0x70caba[_0x4f06a1(0x24c)],'goal_achieved':_0x70caba[_0x4f06a1(0x130)],'completion_rate':_0x70caba[_0x4f06a1(0x19e)],'exit_or_jump':_0x70caba[_0x4f06a1(0x244)],'exit_or_jump_rate':_0x70caba['exitOrJumpRate'],'stages':_0x70caba[_0x4f06a1(0x21a)]}},'url':_0x112a8f};return await handleSingleObjectOutput(_0x18e3d9,_0x595e30),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0xf1319a(0x179)]=a27_0xf1319a(0x1c3);[a27_0xf1319a(0x18b)]=a27_0xf1319a(0x162);async[a27_0xf1319a(0x133)](_0x25c7eb){const _0x441c2a=a27_0xf1319a,{options:_0x213ccd,args:_0x21050b,tdx:_0x68cc97}=_0x25c7eb,_0x5d2b53=_0x21050b[0x0];if(!requireNameOrPath(_0x5d2b53))return 0x1;_0x213ccd[_0x441c2a(0x171)]&&console[_0x441c2a(0x1cb)](_0x441c2a(0x1d1)+_0x5d2b53);const _0x251237=_0x213ccd,_0x53e71c=_0x251237[_0x441c2a(0x17a)],_0x405f51=_0x251237['to'],_0x193d75=_0x251237['includeHistory'],_0x53e22b=_0x251237[_0x441c2a(0x1f3)];_0x193d75&&!_0x53e71c&&!_0x405f51&&console['error'](_0x441c2a(0x12a));const _0x2b2a02=_0x193d75?withJsonFormat(_0x213ccd):_0x213ccd,{journeyId:_0xdddb85,journeyName:_0x2dbefd}=await resolveJourneyIdFromInput(_0x5d2b53,_0x2b2a02,_0x68cc97),_0x48eb9a=_0x53e71c||_0x405f51?{'from':_0x53e71c,'to':_0x405f51}:undefined,_0xfb8e6c=await withSpinner(_0x441c2a(0x254),()=>Promise[_0x441c2a(0x1e9)]([_0x68cc97[_0x441c2a(0x13f)][_0x441c2a(0x1f6)](_0xdddb85),_0x68cc97['journey']['getStatistics'](_0xdddb85,_0x48eb9a)]),{'verbose':_0x2b2a02[_0x441c2a(0x171)]}),[_0x21a87a,_0x5aa6d8]=_0xfb8e6c['data'];if(!_0x5aa6d8||_0x5aa6d8['journeyId']===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x2dbefd),console[_0x441c2a(0x1cb)](_0x441c2a(0x251)),0x0;const _0x481a50=buildStageNameMap(_0x21a87a),_0x116fba=!!(_0x48eb9a&&_0x5aa6d8[_0x441c2a(0x23c)]?.[_0x441c2a(0x1ca)]),_0x3a518b={'stageNameMap':_0x481a50,'hasPeriod':_0x116fba,'includeHistory':!!_0x193d75};if(_0x53e22b&&_0x5aa6d8['stages']){const _0x3a8a59=_0x5aa6d8[_0x441c2a(0x21a)]['find'](_0x561503=>{const _0xb5e275=_0x441c2a,_0x32211b=_0x481a50[_0xb5e275(0x1a9)](_0x561503['id'])??'';return _0x32211b[_0xb5e275(0x18e)]()===_0x53e22b[_0xb5e275(0x18e)]();});if(_0x3a8a59)return await handleSingleObjectOutput(formatStageStats(_0x3a8a59,_0x3a518b),_0x2b2a02),0x0;const _0x22e511=_0x5aa6d8['stages']['map'](_0x173ff4=>_0x481a50[_0x441c2a(0x1a9)](_0x173ff4['id'])??_0x173ff4['id']);return console[_0x441c2a(0x1cb)](_0x441c2a(0x193)+_0x53e22b+_0x441c2a(0x147)),console[_0x441c2a(0x1cb)]('Available\x20stages:\x20'+_0x22e511[_0x441c2a(0x1ff)](',\x20')),0x1;}const _0x58a122=_0x5aa6d8['stages']?.[_0x441c2a(0x23f)](_0x45af0d=>formatStageStats(_0x45af0d,_0x3a518b)),_0x3b9fa8=assembleJourneyStats(_0x5aa6d8,{'from':_0x53e71c,'to':_0x405f51,'includeHistory':_0x193d75});return await this['renderStats'](_0x3b9fa8,_0x58a122??[],_0x2b2a02),0x0;}async['renderStats'](_0xb8121a,_0xaeb25f,_0x50f74d){const _0x5c572b=a27_0xf1319a,_0x813016=_0x50f74d[_0x5c572b(0x1b6)]===_0x5c572b(0x253)||_0x50f74d[_0x5c572b(0x1b6)]===_0x5c572b(0x157)||_0x50f74d[_0x5c572b(0x253)]||_0x50f74d[_0x5c572b(0x157)];if(_0x813016){_0xb8121a[_0x5c572b(0x21a)]=_0xaeb25f,await handleSingleObjectOutput(_0xb8121a,_0x50f74d);return;}await handleSingleObjectOutput(_0xb8121a,_0x50f74d);for(const _0x315342 of _0xaeb25f){console['log'](''),console[_0x5c572b(0x230)](String(a27_0xadadca[_0x5c572b(0x188)][_0x5c572b(0x192)]('['+_0x315342[_0x5c572b(0x179)]+']'))+a27_0xadadca[_0x5c572b(0x138)]('\x20'+_0x315342['id']));const {id:_0x5506df,name:_0x20ecc2,..._0xfeafc}=_0x315342;await handleSingleObjectOutput(_0xfeafc,_0x50f74d);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0xf1319a(0x179)]=a27_0xf1319a(0x21e);[a27_0xf1319a(0x18b)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a27_0xf1319a(0x133)](_0x1704bd){const _0x1c985b=a27_0xf1319a,{options:_0x46a664,args:_0x19b359,tdx:_0x4fa84f}=_0x1704bd,_0x3a541c=_0x19b359[0x0];if(!requireNameOrPath(_0x3a541c))return 0x1;_0x46a664['verbose']&&console[_0x1c985b(0x1cb)](_0x1c985b(0x1d1)+_0x3a541c);const _0x2126ee=_0x46a664,_0x2ec104=_0x2126ee['type'],_0x4282fd=_0x2126ee['from'],_0x1c1fed=_0x2126ee['to'],_0x21859f=_0x2126ee[_0x1c985b(0x1e0)];if(_0x2ec104&&_0x2ec104!=='conversion'&&_0x2ec104!==_0x1c985b(0x212))return console[_0x1c985b(0x1cb)](_0x1c985b(0x1e4)+_0x2ec104+_0x1c985b(0x1b8)),0x1;const _0x51996a=withJsonFormat(_0x46a664),{journeyId:_0x16df79,journeyName:_0x33fb59}=await resolveJourneyIdFromInput(_0x3a541c,_0x51996a,_0x4fa84f),_0x506096={'type':_0x2ec104,'from':_0x4282fd,'to':_0x1c1fed,'limit':_0x21859f},_0x363628=await withSpinner(_0x1c985b(0x1cd),()=>_0x4fa84f[_0x1c985b(0x13f)][_0x1c985b(0x181)](_0x16df79,_0x506096),{'verbose':_0x51996a[_0x1c985b(0x171)]}),_0x213b75=_0x363628[_0x1c985b(0x163)],_0x5a05e2=_0x213b75['conversion']&&(_0x213b75[_0x1c985b(0x144)][_0x1c985b(0x1f1)][_0x1c985b(0x1ca)]>0x0||_0x213b75[_0x1c985b(0x144)]['links']['length']>0x0),_0x393161=_0x213b75[_0x1c985b(0x212)]&&_0x213b75[_0x1c985b(0x212)][_0x1c985b(0x1ca)]>0x0;if(!_0x5a05e2&&!_0x393161)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x33fb59),console[_0x1c985b(0x1cb)](_0x1c985b(0x135)),_0x4282fd&&_0x1c1fed&&console['error'](_0x1c985b(0x1df)),0x0;return await handleSingleObjectOutput(_0x213b75,_0x51996a),0x0;}}function formatStageStats(_0x2fa3ed,_0x31a1b6){const _0x174224=a27_0xf1319a,_0x2f0f4a=_0x31a1b6[_0x174224(0x202)]&&_0x2fa3ed['history']?.[_0x174224(0x1ca)]?aggregateStageHistory(_0x2fa3ed[_0x174224(0x23c)]):{'size':_0x2fa3ed[_0x174224(0x155)],'entered':_0x2fa3ed[_0x174224(0x24c)],'milestone':_0x2fa3ed[_0x174224(0x217)],'milestone_rate':_0x2fa3ed[_0x174224(0x1f5)],'exit_or_jump':_0x2fa3ed[_0x174224(0x244)],'exit_or_jump_rate':_0x2fa3ed[_0x174224(0x187)]},_0x1a14f5={'id':_0x2fa3ed['id'],'name':_0x31a1b6['stageNameMap'][_0x174224(0x1a9)](_0x2fa3ed['id'])??_0x2fa3ed['id'],..._0x2f0f4a};return _0x31a1b6[_0x174224(0x202)]&&_0x31a1b6[_0x174224(0x15f)]&&_0x2fa3ed[_0x174224(0x23c)]&&(_0x1a14f5[_0x174224(0x23c)]=_0x2fa3ed[_0x174224(0x23c)]),_0x1a14f5;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0xf1319a(0x223);[a27_0xf1319a(0x18b)]='Pause\x20a\x20running\x20journey';async[a27_0xf1319a(0x133)](_0x1b1d45){const _0x447d1c=a27_0xf1319a,{options:_0x3731d7,args:_0x1a01bd,tdx:_0x3d615e}=_0x1b1d45,_0x3283eb=_0x1a01bd[0x0];if(!requireNameOrPath(_0x3283eb))return 0x1;_0x3731d7['verbose']&&console[_0x447d1c(0x1cb)](_0x447d1c(0x1d1)+_0x3283eb);const {journeyId:_0x12dcf0,journeyName:_0x1ff060}=await resolveJourneyIdFromInput(_0x3283eb,_0x3731d7,_0x3d615e);if(!_0x3731d7[_0x447d1c(0x1d9)]){const _0x3dfc1b=await confirm(_0x447d1c(0x207)+_0x1ff060+'\x22?');if(!_0x3dfc1b)return console[_0x447d1c(0x1cb)](_0x447d1c(0x24f)),0x0;}const _0xaa4fd2=await withSpinner(_0x447d1c(0x1ec),()=>_0x3d615e['journey'][_0x447d1c(0x174)](_0x12dcf0),{'verbose':_0x3731d7[_0x447d1c(0x171)]}),_0xa6816e=_0xaa4fd2[_0x447d1c(0x163)];return console[_0x447d1c(0x1cb)](_0x447d1c(0x150)+_0xa6816e[_0x447d1c(0x23d)][_0x447d1c(0x179)]+_0x447d1c(0x13c)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0xf1319a(0x179)]=a27_0xf1319a(0x24d);[a27_0xf1319a(0x18b)]=a27_0xf1319a(0x18c);async[a27_0xf1319a(0x133)](_0x1fadfe){const _0xdf1bb9=a27_0xf1319a,{options:_0x2a4f6f,args:_0x2772d3,tdx:_0x311351}=_0x1fadfe,_0x1463e3=_0x2772d3[0x0];if(!requireNameOrPath(_0x1463e3))return 0x1;_0x2a4f6f[_0xdf1bb9(0x171)]&&console[_0xdf1bb9(0x1cb)]('Input:\x20'+_0x1463e3);const {journeyId:_0x171aa8,journeyName:_0x42a81f}=await resolveJourneyIdFromInput(_0x1463e3,_0x2a4f6f,_0x311351);if(_0x2a4f6f['dryRun'])return await this[_0xdf1bb9(0x197)](_0x1fadfe,_0x171aa8,_0x42a81f);if(!_0x2a4f6f[_0xdf1bb9(0x1d9)]){const _0x138069=await confirm(_0xdf1bb9(0x12d)+_0x42a81f+'\x22?');if(!_0x138069)return console['error'](_0xdf1bb9(0x24f)),0x0;}const _0xb37f8f=await withSpinner(_0xdf1bb9(0x1ba),()=>_0x311351['journey'][_0xdf1bb9(0x1e1)](_0x171aa8),{'verbose':_0x2a4f6f[_0xdf1bb9(0x171)]}),_0x2803fe=_0xb37f8f['data'],_0x2435e1=getWorkflowSessionUrl(_0x2a4f6f[_0xdf1bb9(0x12f)],_0x2803fe['workflowId'],_0x2803fe[_0xdf1bb9(0x1ad)]);return console[_0xdf1bb9(0x1cb)]('\x0a'+a27_0xadadca[_0xdf1bb9(0x15c)]('✔')+_0xdf1bb9(0x23e)),console['error']('\x20\x20'+a27_0xadadca[_0xdf1bb9(0x138)](_0xdf1bb9(0x1de))+'\x20'+_0x42a81f),console[_0xdf1bb9(0x1cb)]('\x20\x20'+a27_0xadadca[_0xdf1bb9(0x138)](_0xdf1bb9(0x1da))+'\x20'+_0x2803fe['status']),console[_0xdf1bb9(0x1cb)]('\x20\x20'+a27_0xadadca[_0xdf1bb9(0x138)]('Session:')+'\x20'+_0x2803fe[_0xdf1bb9(0x1ad)]),console['error']('\x20\x20'+_0x2435e1),0x0;}async[a27_0xf1319a(0x197)](_0xa00e58,_0xa1bb4b,_0x3316a8){const _0x31a574=a27_0xf1319a,{options:_0x2a64f4,tdx:_0x1eadb6}=_0xa00e58,_0x1efb17=await withSpinner(_0x31a574(0x23b)+_0x3316a8+_0x31a574(0x222),()=>Promise[_0x31a574(0x1e9)]([_0x1eadb6[_0x31a574(0x13f)]['getJourney'](_0xa1bb4b),_0x1eadb6[_0x31a574(0x13f)][_0x31a574(0x205)](_0xa1bb4b)]),{'verbose':_0x2a64f4[_0x31a574(0x171)]}),[_0x3a6b07,_0x59eed7]=_0x1efb17[_0x31a574(0x163)],_0x3ee83d=_0x3a6b07[_0x31a574(0x23d)],_0x27c272=_0x3ee83d[_0x31a574(0x240)];console[_0x31a574(0x230)](a27_0xadadca[_0x31a574(0x192)](_0x31a574(0x1de)),_0x3ee83d[_0x31a574(0x179)]),console[_0x31a574(0x230)](a27_0xadadca[_0x31a574(0x192)](_0x31a574(0x241)),_0x3a6b07['id']),console[_0x31a574(0x230)](a27_0xadadca[_0x31a574(0x192)]('State:'),_0x3ee83d[_0x31a574(0x18d)]),console[_0x31a574(0x230)](a27_0xadadca[_0x31a574(0x192)](_0x31a574(0x1fb)),_0x3ee83d[_0x31a574(0x259)]?a27_0xadadca[_0x31a574(0x213)](_0x31a574(0x1d9)):a27_0xadadca['green']('no')),console[_0x31a574(0x230)](a27_0xadadca[_0x31a574(0x192)]('Parent\x20segment\x20ID:'),_0x3ee83d[_0x31a574(0x1be)]);const _0x2ebb07=_0x27c272[_0x31a574(0x1ca)]>0x0?'\x20('+_0x27c272['map'](_0x303d02=>_0x303d02[_0x31a574(0x179)])['join'](',\x20')+')':'';console[_0x31a574(0x230)](a27_0xadadca[_0x31a574(0x192)](_0x31a574(0x229)),''+_0x27c272[_0x31a574(0x1ca)]+_0x2ebb07),console['log']('');if(_0x59eed7[_0x31a574(0x1ca)]===0x0)console[_0x31a574(0x230)](a27_0xadadca['bold'](_0x31a574(0x186)),a27_0xadadca[_0x31a574(0x138)](_0x31a574(0x15b)));else{console[_0x31a574(0x230)](a27_0xadadca['bold'](_0x31a574(0x186)));for(const _0x1479d4 of _0x59eed7){const _0x4592b9=_0x1479d4[_0x31a574(0x179)]??'(unnamed)',_0xad6388=_0x1479d4[_0x31a574(0x1af)]!=null?_0x31a574(0x1bf)+_0x1479d4['connectionId']:_0x31a574(0x225),_0x450f2b=_0x1479d4[_0x31a574(0x22c)]?''+_0x1479d4[_0x31a574(0x22c)]+(_0x1479d4[_0x31a574(0x1a0)]?'\x20@\x20'+_0x1479d4['runAt']:''):_0x31a574(0x1bb),_0x211553=_0x1479d4[_0x31a574(0x21b)]?_0x31a574(0x1d5):'';console[_0x31a574(0x230)]('\x20\x20'+a27_0xadadca[_0x31a574(0x213)](_0x31a574(0x242))+'\x20'+_0x4592b9+'\x20\x20←\x20'+_0xad6388+_0x31a574(0x17b)+_0x450f2b+_0x211553);}}return console['log'](a27_0xadadca[_0x31a574(0x213)](_0x31a574(0x204))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0xf1319a(0x179)]='journey:resume';[a27_0xf1319a(0x18b)]=a27_0xf1319a(0x1cf);async[a27_0xf1319a(0x133)](_0x2c0f88){const _0xf08f77=a27_0xf1319a,{options:_0x15b9ae,args:_0x16dd62,tdx:_0x41ea91}=_0x2c0f88,_0x1bc6a7=_0x16dd62[0x0];if(!requireNameOrPath(_0x1bc6a7))return 0x1;_0x15b9ae['verbose']&&console[_0xf08f77(0x1cb)](_0xf08f77(0x1d1)+_0x1bc6a7);const {journeyId:_0x1fbdaa,journeyName:_0x3f40f2}=await resolveJourneyIdFromInput(_0x1bc6a7,_0x15b9ae,_0x41ea91);if(_0x15b9ae['dryRun'])return await this[_0xf08f77(0x197)](_0x2c0f88,_0x1fbdaa,_0x3f40f2);if(!_0x15b9ae['yes']){const _0x5f1a79=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x3f40f2+'\x22?');if(!_0x5f1a79)return console[_0xf08f77(0x1cb)]('Cancelled'),0x0;}const _0x436669=await withSpinner(_0xf08f77(0x191),()=>_0x41ea91[_0xf08f77(0x13f)]['resume'](_0x1fbdaa),{'verbose':_0x15b9ae['verbose']}),_0x1d2392=_0x436669[_0xf08f77(0x163)];return console[_0xf08f77(0x1cb)](_0xf08f77(0x150)+_0x1d2392['attributes'][_0xf08f77(0x179)]+_0xf08f77(0x1c5)),0x0;}async[a27_0xf1319a(0x197)](_0x542933,_0x35740c,_0x5e76a6){const _0x189a5b=a27_0xf1319a,{options:_0x3cb032,tdx:_0x3f3055}=_0x542933,_0x28867f=await withSpinner(_0x189a5b(0x23b)+_0x5e76a6+_0x189a5b(0x222),()=>Promise[_0x189a5b(0x1e9)]([_0x3f3055[_0x189a5b(0x13f)][_0x189a5b(0x1f6)](_0x35740c),_0x3f3055[_0x189a5b(0x13f)][_0x189a5b(0x205)](_0x35740c)]),{'verbose':_0x3cb032['verbose']}),[_0x5110a0,_0x1baeee]=_0x28867f[_0x189a5b(0x163)],_0x56c704=_0x5110a0[_0x189a5b(0x23d)],_0x3ad4b9=_0x56c704[_0x189a5b(0x240)];console['log'](a27_0xadadca[_0x189a5b(0x192)]('Journey:'),_0x56c704[_0x189a5b(0x179)]),console[_0x189a5b(0x230)](a27_0xadadca[_0x189a5b(0x192)](_0x189a5b(0x241)),_0x5110a0['id']),console[_0x189a5b(0x230)](a27_0xadadca[_0x189a5b(0x192)](_0x189a5b(0x1e3)),_0x56c704[_0x189a5b(0x18d)]),console[_0x189a5b(0x230)](a27_0xadadca[_0x189a5b(0x192)](_0x189a5b(0x1fb)),_0x56c704[_0x189a5b(0x259)]?a27_0xadadca[_0x189a5b(0x213)]('yes'):a27_0xadadca[_0x189a5b(0x15c)]('no'));_0x56c704[_0x189a5b(0x180)]&&console[_0x189a5b(0x230)](a27_0xadadca[_0x189a5b(0x192)]('Paused\x20at:'),_0x56c704['pausedAt']);console[_0x189a5b(0x230)](a27_0xadadca['bold'](_0x189a5b(0x1f9)),_0x56c704[_0x189a5b(0x1be)]);const _0x54089f=_0x3ad4b9[_0x189a5b(0x1ca)]>0x0?'\x20('+_0x3ad4b9[_0x189a5b(0x23f)](_0x35b671=>_0x35b671[_0x189a5b(0x179)])[_0x189a5b(0x1ff)](',\x20')+')':'';console[_0x189a5b(0x230)](a27_0xadadca['bold']('Stages:'),''+_0x3ad4b9[_0x189a5b(0x1ca)]+_0x54089f),console[_0x189a5b(0x230)]('');if(_0x1baeee[_0x189a5b(0x1ca)]===0x0)console['log'](a27_0xadadca[_0x189a5b(0x192)]('Activations:'),a27_0xadadca[_0x189a5b(0x138)]('(none)'));else{console[_0x189a5b(0x230)](a27_0xadadca[_0x189a5b(0x192)](_0x189a5b(0x186)));for(const _0x13b583 of _0x1baeee){const _0x23636a=_0x13b583[_0x189a5b(0x179)]??_0x189a5b(0x19d),_0x614e5c=_0x13b583[_0x189a5b(0x1af)]!=null?_0x189a5b(0x1bf)+_0x13b583['connectionId']:'no\x20connection',_0x11a80c=_0x13b583['scheduleType']?''+_0x13b583[_0x189a5b(0x22c)]+(_0x13b583['runAt']?_0x189a5b(0x22f)+_0x13b583[_0x189a5b(0x1a0)]:''):_0x189a5b(0x1bb),_0xc668c2=_0x13b583['runAfterJourneyRefresh']?_0x189a5b(0x1d5):'';console[_0x189a5b(0x230)]('\x20\x20'+a27_0xadadca[_0x189a5b(0x213)]('⚠️\x20')+'\x20'+_0x23636a+'\x20\x20←\x20'+_0x614e5c+',\x20schedule:\x20'+_0x11a80c+_0xc668c2);}}return console[_0x189a5b(0x230)](a27_0xadadca[_0x189a5b(0x213)](_0x189a5b(0x245))),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']='journey:pull';['description']=a27_0xf1319a(0x177);async[a27_0xf1319a(0x133)](_0x46967d){const _0x562e46=a27_0xf1319a,{options:_0x210616,args:_0x5b2597,tdx:_0x254c81}=_0x46967d,_0x526192=_0x210616,_0xbbfce7=_0x5b2597[0x0],_0x3a531e=_0xbbfce7&&isYamlFilePath(_0xbbfce7),_0x1e31c1=await resolveTarget({'arg':_0x3a531e?_0xbbfce7:undefined,'contextParent':_0x210616['parentSegment'],'cwd':process[_0x562e46(0x22b)]()});if(!isSuccessfulResolution(_0x1e31c1))return _0x1e31c1[_0x562e46(0x206)]===_0x562e46(0x199)?(console[_0x562e46(0x1cb)](a27_0xadadca[_0x562e46(0x213)](_0x562e46(0x19f))),console['error'](_0x562e46(0x139)),console['error'](_0x562e46(0x20a)),console[_0x562e46(0x1cb)](_0x562e46(0x1a2)),console[_0x562e46(0x1cb)](_0x562e46(0x183))):(console[_0x562e46(0x1cb)](a27_0xadadca[_0x562e46(0x211)](_0x562e46(0x15e)+_0x1e31c1['message']+'\x0a')),_0x1e31c1[_0x562e46(0x1e6)]&&console[_0x562e46(0x1cb)](a27_0xadadca[_0x562e46(0x188)](_0x1e31c1[_0x562e46(0x1e6)]))),0x1;let _0x503e61=_0x3a531e?undefined:_0xbbfce7,_0x29acd1,_0xdb0205;_0x1e31c1[_0x562e46(0x232)]===_0x562e46(0x1fd)&&(_0x503e61=_0x1e31c1[_0x562e46(0x166)],_0x29acd1=_0x1e31c1[_0x562e46(0x255)],_0xdb0205=_0x1e31c1[_0x562e46(0x227)]);const _0x1d2844=_0x1e31c1[_0x562e46(0x237)],_0x3a9d7c=_0x1e31c1['targetDir'];_0x526192[_0x562e46(0x171)]&&(console[_0x562e46(0x1cb)](_0x562e46(0x246)+_0x1d2844),console[_0x562e46(0x1cb)](_0x562e46(0x19a)+_0x3a9d7c),_0x503e61&&console[_0x562e46(0x1cb)](_0x562e46(0x1c1)+_0x503e61),_0x29acd1&&console[_0x562e46(0x1cb)](_0x562e46(0x1b4)+_0x29acd1),_0xdb0205&&console['error'](_0x562e46(0x1f7)+_0xdb0205));const _0x8cca5f=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x254c81[_0x562e46(0x1b1)][_0x562e46(0x1d4)](_0x1d2844),{'verbose':_0x210616[_0x562e46(0x171)]}),_0x5e7429=_0x8cca5f['data'],{journeys:_0x5628b3,folders:_0x82cf21}=await withSpinner(_0x562e46(0x16e),async()=>{const _0x267dbb=_0x562e46,[_0x2e6c56,_0x3aeccb]=await Promise[_0x267dbb(0x1e9)]([_0x254c81['journey'][_0x267dbb(0x200)](_0x5e7429,undefined,{'includeAllVersions':!![]}),_0x254c81[_0x267dbb(0x1b1)][_0x267dbb(0x250)](_0x5e7429)]);return{'journeys':_0x2e6c56,'folders':_0x3aeccb};},{'verbose':_0x210616['verbose']})[_0x562e46(0x22e)](_0x3ddb39=>_0x3ddb39[_0x562e46(0x163)]);let _0x294d10=_0x5628b3;const _0x5e3da3=buildFolderIdToPathMap(_0x82cf21);if(_0x503e61){const _0x48cb60=_0x294d10['filter'](_0x7da5b6=>_0x7da5b6[_0x562e46(0x1cc)][_0x562e46(0x18e)]()===_0x503e61[_0x562e46(0x18e)]());if(_0x48cb60[_0x562e46(0x1ca)]===0x0)return console['error'](_0x562e46(0x1fe)+_0x503e61),console[_0x562e46(0x1cb)](_0x562e46(0x257)),0x1;_0x294d10=_0x48cb60;}if(_0xdb0205!==undefined){const _0x823ddb=_0x294d10[_0x562e46(0x1dc)](_0x431c31=>{const _0x32e67f=_0x562e46,_0x37438f=_0x431c31[_0x32e67f(0x140)]?_0x5e3da3[_0x32e67f(0x1a9)](_0x431c31['folderId'])||'':'';return _0x37438f===_0xdb0205;});if(_0x823ddb[_0x562e46(0x1ca)]===0x0&&_0x294d10[_0x562e46(0x1ca)]>0x0){console[_0x562e46(0x1cb)]('Error:\x20Journey\x20\x27'+_0x503e61+'\x27\x20not\x20found\x20in\x20'+(_0xdb0205||_0x562e46(0x1b9))),console[_0x562e46(0x1cb)](_0x562e46(0x164));for(const _0xdcd84a of _0x294d10){const _0x389ab4=_0xdcd84a[_0x562e46(0x140)]?_0x5e3da3[_0x562e46(0x1a9)](_0xdcd84a[_0x562e46(0x140)])||'':'';console[_0x562e46(0x1cb)](_0x562e46(0x24a)+(_0x389ab4||_0x562e46(0x20d))+'/'+_0xdcd84a[_0x562e46(0x1cc)]);}return 0x1;}_0x294d10=_0x823ddb;}if(_0x294d10[_0x562e46(0x1ca)]===0x0)return console[_0x562e46(0x1cb)](_0x562e46(0x176)),0x0;const _0x467837=new Map();for(const _0x49d5ed of _0x294d10){const _0x4c4c39=_0x49d5ed['journeyBundleId'];!_0x467837[_0x562e46(0x19c)](_0x4c4c39)&&_0x467837['set'](_0x4c4c39,[]),_0x467837[_0x562e46(0x1a9)](_0x4c4c39)['push'](_0x49d5ed);}for(const _0x5517de of _0x467837[_0x562e46(0x236)]()){_0x5517de[_0x562e46(0x13d)]((_0x44ec4d,_0x333535)=>(_0x44ec4d[_0x562e46(0x1b5)]||0x0)-(_0x333535['versionNumber']||0x0));}const _0x1fe1ea=[],{idToEmailMap:_0x2460f6,connectionIdToNameMap:_0x1fa884}=await withSpinner(_0x562e46(0x21d),async()=>{const _0x2b59fe=_0x562e46,[_0x38c2bd,_0xb3d27d]=await Promise[_0x2b59fe(0x1e9)]([_0x254c81[_0x2b59fe(0x1c9)][_0x2b59fe(0x218)](),_0x254c81[_0x2b59fe(0x1d2)][_0x2b59fe(0x1c6)]()]);return{'idToEmailMap':_0x38c2bd,'connectionIdToNameMap':_0xb3d27d};},{'verbose':_0x210616[_0x562e46(0x171)]})[_0x562e46(0x22e)](_0x809620=>_0x809620['data']);for(const _0x225a56 of _0x467837[_0x562e46(0x236)]()){const _0x1c7952=_0x225a56[0x0][_0x562e46(0x1cc)],_0x15f85d=_0x225a56[0x0][_0x562e46(0x140)],_0x33498b=_0x15f85d?_0x5e3da3[_0x562e46(0x1a9)](_0x15f85d)||'':'',_0x49a793=_0x33498b?a27_0x12d0f7['join'](_0x3a9d7c,_0x33498b):_0x3a9d7c,_0x3ca152=_0x29acd1||a27_0x12d0f7[_0x562e46(0x1ff)](_0x49a793,sanitizeFileName(_0x1c7952)+'.yml');let _0x8315c0,_0x4b4804;if(existsSync(_0x3ca152))try{const _0x3b55f9=readFileSync(_0x3ca152,_0x562e46(0x1f8)),_0x1b7c05=parseYamlString(_0x3b55f9);_0x4b4804=_0x1b7c05,_0x8315c0=buildRuleToNameMapping(_0x1b7c05),_0x526192['verbose']&&_0x8315c0[_0x562e46(0x155)]>0x0&&console['error']('Found\x20'+_0x8315c0[_0x562e46(0x155)]+_0x562e46(0x173)+_0x1c7952);}catch(_0x31eb7a){_0x526192[_0x562e46(0x171)]&&console['error'](_0x562e46(0x1d7)+_0x31eb7a[_0x562e46(0x226)]);}const _0x5c9311=[],_0x55358a=new Set(),_0x16cf08=new Map(),_0x1cc057=new Map(),_0xd42d95=new Set(),_0xbacd77=new Map(),_0xd4a7c7=new Map(),_0x12e9eb=createJumpTargetCache();await withProgressSpinner(_0x562e46(0x1fc)+_0x1c7952+_0x562e46(0x222),async _0x1142b5=>{const _0x3f100f=_0x562e46;for(const _0x9f12e7 of _0x225a56){const _0x576f72=_0x225a56[_0x3f100f(0x1ca)]>0x1?_0x9f12e7[_0x3f100f(0x1cc)]+'\x20v'+(_0x9f12e7['versionNumber']||0x1):_0x9f12e7[_0x3f100f(0x1cc)];_0x1142b5[_0x3f100f(0x1b0)](_0x3f100f(0x1fc)+_0x576f72);const _0x3560c9=await _0x254c81[_0x3f100f(0x13f)]['getJourney'](_0x9f12e7['id']),_0x532076=_0x3560c9[_0x3f100f(0x23d)]?.['audienceId'],_0x4075bb={'resolveSegment':async _0x793688=>{const _0x5e3017=_0x3f100f;if(!_0x532076)return{'name':_0x793688,'isJourneyLocal':![]};const _0x3983d6=_0x16cf08[_0x5e3017(0x1a9)](_0x793688);if(_0x3983d6)return _0x3983d6;try{const _0xd83304=await _0x254c81['segment'][_0x5e3017(0x25b)](_0x532076,_0x793688),_0x48c7ea=_0xd83304['kind']===SEGMENT_KIND_JOURNEY;let _0x4abb96,_0xf26de3=_0xd83304[_0x5e3017(0x179)];if(_0x48c7ea&&_0xd83304[_0x5e3017(0x16a)]){const _0x591de7=await segmentResponseToDef(_0xd83304,{'resolveSegmentName':async _0x214184=>{const _0x28bbcd=_0x5e3017,_0x1f295c=_0x16cf08[_0x28bbcd(0x1a9)](_0x214184);if(_0x1f295c)return _0x1f295c['name'];const _0xd26271=await _0x4075bb['resolveSegment'](_0x214184);return _0xd26271[_0x28bbcd(0x179)];}}),_0x2e5b40=_0x591de7[_0x5e3017(0x16a)];_0x4abb96={'description':_0xd83304[_0x5e3017(0x18b)],'rule':_0x2e5b40};const _0x23d0f5=serializeRule(_0x2e5b40),_0x4cca24=_0x1cc057[_0x5e3017(0x1a9)](_0x23d0f5);if(_0x4cca24)_0xf26de3=_0x4cca24,_0x4abb96=undefined,_0x526192['verbose']&&console[_0x5e3017(0x1cb)](_0x5e3017(0x131)+_0xd83304[_0x5e3017(0x179)]+_0x5e3017(0x168)+_0x4cca24);else{let _0x541430=![];if(_0x8315c0){const _0x4bf5f6=_0x8315c0['get'](_0x23d0f5);if(_0x4bf5f6){const _0x550371=_0x4bf5f6['find'](_0x354dd1=>!_0x55358a['has'](_0x354dd1));_0x550371&&(_0xf26de3=_0x550371,_0x55358a['add'](_0x550371),_0x1cc057[_0x5e3017(0x216)](_0x23d0f5,_0x550371),_0x541430=!![],_0x526192['verbose']&&console[_0x5e3017(0x1cb)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x550371+'\x20(rule\x20match)'));}}if(!_0x541430){const _0x54ad9c=generateJourneyLocalName(_0xd83304[_0x5e3017(0x179)]);_0x54ad9c&&(_0xf26de3=_0x54ad9c);let _0x56ade0=_0xf26de3,_0x4ee36f=0x2;while(_0x55358a[_0x5e3017(0x19c)](_0x56ade0)){_0x56ade0=_0xf26de3+'_'+_0x4ee36f,_0x4ee36f++;}_0x55358a['add'](_0x56ade0),_0x1cc057[_0x5e3017(0x216)](_0x23d0f5,_0x56ade0),_0xf26de3=_0x56ade0;}}}const _0x3373aa={'name':_0xf26de3,'isJourneyLocal':_0x48c7ea,'definition':_0x4abb96};return _0x16cf08['set'](_0x793688,_0x3373aa),_0x3373aa;}catch(_0x2dce41){return _0x210616[_0x5e3017(0x171)]&&console[_0x5e3017(0x1cb)](_0x5e3017(0x12b)+_0x793688+':\x20'+_0x2dce41[_0x5e3017(0x226)]),{'name':_0x793688,'isJourneyLocal':![]};}},'resolveActivation':async _0x30c3e4=>{const _0x3388a6=_0x3f100f,_0x476605=_0xbacd77[_0x3388a6(0x1a9)](_0x30c3e4);if(_0x476605)return _0x476605;try{const _0x1ba210=await _0x254c81[_0x3388a6(0x13f)][_0x3388a6(0x15a)](_0x9f12e7['id'],_0x30c3e4),_0x1a58e6=journeyActivationStepToYaml(_0x1ba210,_0x2460f6,_0x1fa884),_0x542502=JSON['stringify']({'name':_0x1a58e6['name'],'connection':_0x1a58e6['connection'],'connector_config':_0x1a58e6[_0x3388a6(0x13b)]}),_0x41aff6=_0xd4a7c7[_0x3388a6(0x1a9)](_0x542502);if(_0x41aff6){const _0x24cd44={'name':_0x41aff6,'isJourneyLocal':!![],'definition':_0x1a58e6};return _0xbacd77['set'](_0x30c3e4,_0x24cd44),_0x24cd44;}const _0x1a254a=_0x1ba210['attributes'][_0x3388a6(0x167)]['name']||_0x30c3e4,_0x95953d=sanitizeYamlKey(_0x1a254a)||'activation_'+_0x30c3e4;let _0x22652e=_0x95953d,_0x1ec5aa=0x2;while(_0xd42d95['has'](_0x22652e)){_0x22652e=_0x95953d+'_'+_0x1ec5aa,_0x1ec5aa++;}_0xd42d95[_0x3388a6(0x1e2)](_0x22652e),_0xd4a7c7['set'](_0x542502,_0x22652e);const _0x14878f={'name':_0x22652e,'isJourneyLocal':!![],'definition':_0x1a58e6};return _0xbacd77[_0x3388a6(0x216)](_0x30c3e4,_0x14878f),_0x14878f;}catch(_0x4afbf9){return _0x210616[_0x3388a6(0x171)]&&console[_0x3388a6(0x1cb)](_0x3388a6(0x1e8)+_0x30c3e4+':\x20'+_0x4afbf9[_0x3388a6(0x226)]),{'name':_0x30c3e4,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x394728,_0x31d5b0)=>{const _0x58486a=_0x3f100f;return resolveJumpTarget(_0x394728,_0x31d5b0,_0x12e9eb,_0x344a28=>_0x254c81[_0x58486a(0x13f)]['getJourney'](_0x344a28));}},_0x2876fa=await journeyResponseToDef(_0x3560c9,_0x4075bb);_0x5c9311['push']({'item':_0x9f12e7,'yaml':_0x2876fa});}},{'verbose':_0x210616[_0x562e46(0x171)]});const _0x2c8f46=await _0x254c81[_0x562e46(0x13f)][_0x562e46(0x17e)](_0x225a56[0x0]['journeyBundleId']),_0x2dd961=buildMergedJourneyDef(_0x5c9311,_0x8315c0,_0x2c8f46),_0x535043=normalizeJourneyDef(_0x2dd961,_0x4b4804),_0x40c3c2=toYamlString(_0x535043),_0x1becf5=_0x29acd1||a27_0x12d0f7[_0x562e46(0x1ff)](_0x49a793,sanitizeFileName(_0x1c7952)+_0x562e46(0x149));!_0x29acd1&&_0x33498b&&!existsSync(_0x49a793)&&mkdirSync(_0x49a793,{'recursive':!![]});const _0x4d9aff=a27_0x12d0f7[_0x562e46(0x201)](process[_0x562e46(0x22b)](),_0x1becf5);if(existsSync(_0x1becf5)){const _0x184514=readFileSync(_0x1becf5,_0x562e46(0x1f8)),_0x237a59=generateDiff(_0x184514,_0x40c3c2),_0x464c2=hasChanges(_0x237a59);_0x1fe1ea[_0x562e46(0x13e)]({'relativePath':_0x4d9aff,'absolutePath':_0x1becf5,'content':_0x40c3c2,'isNew':![],'hasChanges':_0x464c2,'diff':_0x464c2?formatDiffWithColors(_0x237a59):undefined});}else _0x1fe1ea[_0x562e46(0x13e)]({'relativePath':_0x4d9aff,'absolutePath':_0x1becf5,'content':_0x40c3c2,'isNew':!![],'hasChanges':![]});}const _0x5e4552=_0x1fe1ea[_0x562e46(0x1dc)](_0x61183f=>_0x61183f[_0x562e46(0x18f)]),_0x11c65a=_0x1fe1ea[_0x562e46(0x1dc)](_0x2d5e2b=>!_0x2d5e2b[_0x562e46(0x18f)]&&_0x2d5e2b[_0x562e46(0x210)]),_0xb2d73c=_0x1fe1ea[_0x562e46(0x1dc)](_0x8ccfad=>!_0x8ccfad[_0x562e46(0x18f)]&&!_0x8ccfad[_0x562e46(0x210)]),_0x1a9481=_0x294d10[_0x562e46(0x1ca)],_0x322610=_0x467837['size'],_0x4a1500=_0x1a9481>_0x322610?'\x20('+_0x1a9481+'\x20versions)':'';console['error'](_0x562e46(0x20e)),console[_0x562e46(0x1cb)]('\x20\x20'+a27_0xadadca[_0x562e46(0x188)](_0x322610+_0x562e46(0x16b))+a27_0xadadca[_0x562e46(0x138)](_0x4a1500)),console['error']('\x20\x20'+a27_0xadadca[_0x562e46(0x15c)]('+\x20'+_0x5e4552[_0x562e46(0x1ca)]+_0x562e46(0x15d))),console['error']('\x20\x20'+a27_0xadadca[_0x562e46(0x213)]('~\x20'+_0x11c65a[_0x562e46(0x1ca)]+_0x562e46(0x247))),console['error']('\x20\x20'+a27_0xadadca[_0x562e46(0x138)]('=\x20'+_0xb2d73c['length']+_0x562e46(0x195))),console[_0x562e46(0x1cb)]('\x20\x20Target:\x20'+a27_0xadadca[_0x562e46(0x188)](_0x3a9d7c)+'\x0a');if(_0x11c65a['length']>0x0)for(const _0x2e3a20 of _0x11c65a){console['error'](_0x562e46(0x1eb)+_0x2e3a20[_0x562e46(0x196)]+'\x27:'),console[_0x562e46(0x1cb)]('─'[_0x562e46(0x20b)](0x3c)),console[_0x562e46(0x1cb)](_0x2e3a20[_0x562e46(0x190)]),console[_0x562e46(0x1cb)]('─'[_0x562e46(0x20b)](0x3c));}if(_0x526192['dryRun'])return console[_0x562e46(0x1cb)](a27_0xadadca[_0x562e46(0x213)](_0x562e46(0x142))),0x0;if(_0x5e4552[_0x562e46(0x1ca)]===0x0&&_0x11c65a[_0x562e46(0x1ca)]===0x0)return console['error'](a27_0xadadca[_0x562e46(0x15c)](_0x562e46(0x129))),saveSessionContext({'parent_segment':_0x1d2844},_0x526192[_0x562e46(0x1bd)]),console[_0x562e46(0x1cb)](a27_0xadadca[_0x562e46(0x15c)](_0x562e46(0x17c)+a27_0xadadca['dim'](_0x562e46(0x1ab))+_0x562e46(0x172)+a27_0xadadca[_0x562e46(0x188)](_0x1d2844))),0x0;if(!_0x526192[_0x562e46(0x1d9)]&&(_0x5e4552[_0x562e46(0x1ca)]>0x0||_0x11c65a[_0x562e46(0x1ca)]>0x0)){if(!isInteractive())return console['error'](a27_0xadadca[_0x562e46(0x211)](_0x562e46(0x169)),_0x562e46(0x248)),console[_0x562e46(0x1cb)](a27_0xadadca[_0x562e46(0x138)](_0x562e46(0x154))),0x1;const _0x2fff6b=await confirmKey(_0x562e46(0x184)+(_0x5e4552[_0x562e46(0x1ca)]+_0x11c65a['length'])+_0x562e46(0x243));if(!_0x2fff6b)return console['error'](a27_0xadadca[_0x562e46(0x213)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x3a9d7c)&&mkdirSync(_0x3a9d7c,{'recursive':!![]});const _0x5edc42=a27_0x12d0f7['join'](_0x3a9d7c,_0x562e46(0x256));writeFileSync(_0x5edc42,createTdxConfigContent(_0x1d2844),_0x562e46(0x1f8));for(const _0x4cb9f6 of _0x1fe1ea){(_0x4cb9f6[_0x562e46(0x18f)]||_0x4cb9f6[_0x562e46(0x210)])&&writeFileSync(_0x4cb9f6['absolutePath'],_0x4cb9f6[_0x562e46(0x1a8)],_0x562e46(0x1f8));}return console[_0x562e46(0x1cb)](a27_0xadadca['green'](_0x562e46(0x146)+(_0x5e4552['length']+_0x11c65a[_0x562e46(0x1ca)])+'\x20journey\x20files\x20to\x20'+_0x3a9d7c)),saveSessionContext({'parent_segment':_0x1d2844},_0x526192[_0x562e46(0x1bd)]),console[_0x562e46(0x1cb)](a27_0xadadca['green'](_0x562e46(0x17c)+a27_0xadadca[_0x562e46(0x138)](_0x562e46(0x1ab))+_0x562e46(0x172)+a27_0xadadca[_0x562e46(0x188)](_0x1d2844))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0xf1319a(0x179)]=a27_0xf1319a(0x1c4);[a27_0xf1319a(0x18b)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0xf1319a(0x133)](_0x1ec6c4){const _0x399def=a27_0xf1319a,{options:_0x1c67ce,args:_0x16c1ea,tdx:_0x1c2865}=_0x1ec6c4,_0x3d4952=_0x16c1ea[0x0];if(!requireNameOrPath(_0x3d4952))return 0x1;_0x1c67ce[_0x399def(0x171)]&&console['error'](_0x399def(0x1d1)+_0x3d4952);const {journeyId:_0x2b4a5b}=await resolveJourneyIdFromInput(_0x3d4952,_0x1c67ce,_0x1c2865),_0x40cbcf=await withSpinner(_0x399def(0x1ed),()=>_0x1c2865[_0x399def(0x13f)][_0x399def(0x1e7)](_0x2b4a5b),{'verbose':_0x1c67ce['verbose']}),_0x58b266=_0x40cbcf['data'];return console[_0x399def(0x230)]('Database:\x20'+_0x58b266[_0x399def(0x208)]),console[_0x399def(0x230)]('Table:\x20'+_0x58b266['table']),await handleSDKOutput(_0x58b266[_0x399def(0x1a6)],_0x1c67ce),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0xf1319a(0x179)]=a27_0xf1319a(0x252);[a27_0xf1319a(0x18b)]=a27_0xf1319a(0x1a1);async[a27_0xf1319a(0x133)](_0x2825cb){const _0x2d3e13=a27_0xf1319a,{options:_0x692fe8,args:_0x1fd84f,tdx:_0x2322ed}=_0x2825cb,_0x32c566=_0x1fd84f[0x0];if(!requireNameOrPath(_0x32c566))return 0x1;_0x692fe8[_0x2d3e13(0x171)]&&console[_0x2d3e13(0x1cb)]('Input:\x20'+_0x32c566);const {journeyId:_0x391680}=await resolveJourneyIdFromInput(_0x32c566,_0x692fe8,_0x2322ed),_0x45a121=await withSpinner(_0x2d3e13(0x1db),()=>_0x2322ed['journey'][_0x2d3e13(0x205)](_0x391680),{'verbose':_0x692fe8[_0x2d3e13(0x171)]}),_0x3349f6=_0x45a121[_0x2d3e13(0x163)];return console[_0x2d3e13(0x1cb)](_0x2d3e13(0x136)+_0x3349f6['length']+_0x2d3e13(0x148)+(_0x3349f6[_0x2d3e13(0x1ca)]!==0x1?'s':'')),await handleSDKOutput(_0x3349f6,_0x692fe8),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0xf1319a(0x179)]=a27_0xf1319a(0x215);[a27_0xf1319a(0x18b)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI';[a27_0xf1319a(0x24b)]=new SegmentPushCommand();async[a27_0xf1319a(0x133)](_0x768a3c){const _0x43d092=a27_0xf1319a,_0x6abebc=_0x768a3c['args'][0x0];let _0x2df75e;if(_0x6abebc){const _0x143923=await resolveTarget({'arg':_0x6abebc,'contextParent':_0x768a3c[_0x43d092(0x14a)][_0x43d092(0x249)],'cwd':process[_0x43d092(0x22b)]()});isSuccessfulResolution(_0x143923)&&_0x143923[_0x43d092(0x232)]==='file'&&(_0x2df75e=_0x143923['filePath']);}const _0x549f04={..._0x768a3c,'options':{..._0x768a3c['options'],'journeysOnly':!![],..._0x2df75e&&{'singleFilePath':_0x2df75e}}};return this[_0x43d092(0x24b)][_0x43d092(0x133)](_0x549f04);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a27_0xf1319a(0x1dd);[a27_0xf1319a(0x18b)]=a27_0xf1319a(0x235);async[a27_0xf1319a(0x133)](_0x27f9e9){const _0x38cf30=a27_0xf1319a,{options:_0x25289e,args:_0x3cf453,tdx:_0x3da1c0}=_0x27f9e9,_0xea2322=_0x3cf453[0x0];if(!requireNameOrPath(_0xea2322))return 0x1;if(_0x25289e[_0x38cf30(0x171)])console[_0x38cf30(0x1cb)]('Input:\x20'+_0xea2322);const {journeyId:_0x257e05}=await resolveJourneyIdFromInput(_0xea2322,_0x25289e,_0x3da1c0),_0x899a27=await withSpinner('Listing\x20journey\x20versions...',()=>_0x3da1c0['journey']['listVersions'](_0x257e05),{'verbose':_0x25289e[_0x38cf30(0x171)]}),{bundleName:_0x48ea5e,versions:_0x48505c,latestJourneyId:_0x2ca8e5}=_0x899a27[_0x38cf30(0x163)];console[_0x38cf30(0x1cb)](_0x48ea5e+':\x20'+_0x48505c[_0x38cf30(0x1ca)]+_0x38cf30(0x214)+(_0x48505c[_0x38cf30(0x1ca)]!==0x1?'s':''));const _0x5a7ca1=_0x48505c[_0x38cf30(0x23f)](_0x5dd9e3=>({'version':_0x5dd9e3[_0x38cf30(0x1b5)],'journey_id':_0x5dd9e3['journeyId'],'name':_0x5dd9e3[_0x38cf30(0x179)],'state':_0x5dd9e3['state'],'paused':_0x5dd9e3[_0x38cf30(0x259)],'latest':_0x5dd9e3[_0x38cf30(0x18a)]===_0x2ca8e5,'created_at':_0x5dd9e3[_0x38cf30(0x1bc)]}));return await handleSDKOutput(_0x5a7ca1,_0x25289e),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0xf1319a(0x161);[a27_0xf1319a(0x18b)]=a27_0xf1319a(0x258);async['execute'](_0x455b89){const _0x1f0fce=a27_0xf1319a,{options:_0x116163,args:_0x59d076,tdx:_0x5956d8}=_0x455b89,_0x21f5e7=_0x59d076[0x0];if(!requireNameOrPath(_0x21f5e7))return 0x1;if(_0x116163[_0x1f0fce(0x171)])console['error'](_0x1f0fce(0x1d1)+_0x21f5e7);const {journeyId:_0x2f6d31,journeyName:_0x5b1fb2}=await resolveJourneyIdFromInput(_0x21f5e7,_0x116163,_0x5956d8);if(!_0x116163[_0x1f0fce(0x1d9)]){const _0x304434=await confirm(_0x1f0fce(0x189)+_0x5b1fb2+'\x22?');if(!_0x304434)return console[_0x1f0fce(0x1cb)](_0x1f0fce(0x24f)),0x0;}const _0x452fe3=await withSpinner('Creating\x20new\x20version...',()=>_0x5956d8['journey'][_0x1f0fce(0x1d6)](_0x2f6d31),{'verbose':_0x116163[_0x1f0fce(0x171)]}),_0x2bc1d1=_0x452fe3[_0x1f0fce(0x163)];return console[_0x1f0fce(0x1cb)](a27_0xadadca[_0x1f0fce(0x15c)]('✔')+'\x20Created\x20v'+_0x2bc1d1['attributes'][_0x1f0fce(0x1b5)]+'\x20(draft)\x20—\x20\x22'+_0x2bc1d1['attributes']['name']+'\x22'),console['error']('\x20\x20Journey\x20ID:\x20'+_0x2bc1d1['id']),await handleSingleObjectOutput({'id':_0x2bc1d1['id'],'name':_0x2bc1d1['attributes']['name'],'version':_0x2bc1d1[_0x1f0fce(0x23d)][_0x1f0fce(0x1b5)],'state':_0x2bc1d1['attributes'][_0x1f0fce(0x18d)],'bundle_id':_0x2bc1d1['attributes'][_0x1f0fce(0x1ee)],'created_at':_0x2bc1d1[_0x1f0fce(0x23d)][_0x1f0fce(0x1bc)]},_0x116163),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0xf1319a(0x179)]=a27_0xf1319a(0x151);[a27_0xf1319a(0x18b)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0xf1319a(0x133)](_0x46e3ec){const _0x50dadc=a27_0xf1319a,{options:_0x165073,args:_0x2538c3,tdx:_0x56b69c}=_0x46e3ec,_0x2a11eb=_0x2538c3[0x0];if(!requireNameOrPath(_0x2a11eb))return 0x1;const _0x5eeee6=_0x165073[_0x50dadc(0x159)];if(!_0x5eeee6)return console['error'](_0x50dadc(0x178)),console[_0x50dadc(0x1cb)](_0x50dadc(0x13a)),0x1;const _0x583f37=parseInt(_0x5eeee6,0xa);if(isNaN(_0x583f37)||_0x583f37<0x1)return console[_0x50dadc(0x1cb)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x5eeee6),0x1;if(_0x165073[_0x50dadc(0x171)])console[_0x50dadc(0x1cb)](_0x50dadc(0x1d1)+_0x2a11eb+_0x50dadc(0x21f)+_0x583f37);const {journeyId:_0xf06f0e,parentSegmentId:_0xd5a503}=await resolveJourneyIdFromInput(_0x2a11eb,_0x165073,_0x56b69c),_0x1e9741=await withSpinner(_0x50dadc(0x1a7),()=>_0x56b69c[_0x50dadc(0x13f)][_0x50dadc(0x224)](_0xf06f0e),{'verbose':_0x165073[_0x50dadc(0x171)]}),{versions:_0x23923a,latestJourneyId:_0x3e66fe}=_0x1e9741[_0x50dadc(0x163)],_0x4b1681=_0x23923a[_0x50dadc(0x220)](_0x57e35e=>_0x57e35e[_0x50dadc(0x1b5)]===_0x583f37);if(!_0x4b1681){const _0xe5dc97=_0x23923a[_0x50dadc(0x23f)](_0x2a99fd=>'v'+_0x2a99fd['versionNumber'])[_0x50dadc(0x1ff)](',\x20');return console[_0x50dadc(0x1cb)](_0x50dadc(0x1d8)+_0x583f37+_0x50dadc(0x185)+_0xe5dc97),0x1;}const _0x214f4c=await withSpinner(_0x50dadc(0x24e)+_0x583f37+_0x50dadc(0x143),()=>_0x56b69c['journey']['getJourney'](_0x4b1681[_0x50dadc(0x18a)]),{'verbose':_0x165073['verbose']}),_0x4b5237=_0x214f4c[_0x50dadc(0x163)],_0x5c5158=getConsoleNextUrl(_0x165073[_0x50dadc(0x12f)],_0x50dadc(0x1ef)+_0xd5a503+_0x50dadc(0x182)+_0x4b1681[_0x50dadc(0x18a)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x4b5237['id'],'name':_0x4b5237[_0x50dadc(0x23d)]['name'],'version':_0x4b5237['attributes'][_0x50dadc(0x1b5)],'description':_0x4b5237[_0x50dadc(0x23d)][_0x50dadc(0x18b)],'state':_0x4b5237[_0x50dadc(0x23d)][_0x50dadc(0x18d)],'paused':_0x4b5237[_0x50dadc(0x23d)][_0x50dadc(0x259)],'reentry_mode':_0x4b5237[_0x50dadc(0x23d)][_0x50dadc(0x1ce)],'stages':_0x4b5237['attributes'][_0x50dadc(0x240)]?.['length']||0x0,..._0x4b5237['attributes']['goal']&&{'goal':_0x4b5237[_0x50dadc(0x23d)][_0x50dadc(0x1d3)][_0x50dadc(0x179)]},'latest':_0x4b1681[_0x50dadc(0x18a)]===_0x3e66fe,'created_at':_0x4b5237['attributes'][_0x50dadc(0x1bc)],'updated_at':_0x4b5237['attributes'][_0x50dadc(0x1aa)],'url':_0x5c5158},_0x165073),0x0;}}
|
|
1
|
+
const a27_0x363bd7=a27_0x2667;(function(_0x2a0c5f,_0x12c4a6){const _0x27958a=a27_0x2667,_0x3002d2=_0x2a0c5f();while(!![]){try{const _0x556356=-parseInt(_0x27958a(0x1e1))/0x1*(parseInt(_0x27958a(0x203))/0x2)+-parseInt(_0x27958a(0x19a))/0x3+-parseInt(_0x27958a(0x1e2))/0x4+parseInt(_0x27958a(0x122))/0x5+parseInt(_0x27958a(0xfd))/0x6*(parseInt(_0x27958a(0x202))/0x7)+-parseInt(_0x27958a(0x200))/0x8+parseInt(_0x27958a(0x1c7))/0x9*(parseInt(_0x27958a(0x12b))/0xa);if(_0x556356===_0x12c4a6)break;else _0x3002d2['push'](_0x3002d2['shift']());}catch(_0x32b08a){_0x3002d2['push'](_0x3002d2['shift']());}}}(a27_0x43f2,0x57948));import a27_0x241683 from'chalk';import a27_0x5d2d5b 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(_0x1ec54e){const _0x54fed2=a27_0x2667;return!_0x1ec54e&&(console[_0x54fed2(0x1d4)](_0x54fed2(0x1f7)),console[_0x54fed2(0x1d4)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x1ec54e;}function withJsonFormat(_0x264017){const _0x51f9c3=a27_0x2667;if(!_0x264017[_0x51f9c3(0x149)]&&!_0x264017[_0x51f9c3(0x1e3)]&&!_0x264017[_0x51f9c3(0x12c)]&&!_0x264017[_0x51f9c3(0x160)])return{..._0x264017,'format':'json','json':!![]};return _0x264017;}function formatJourneyState(_0xee0e13){const _0x4e1be4=a27_0x2667;switch(_0xee0e13){case _0x4e1be4(0xd5):return a27_0x241683[_0x4e1be4(0xee)](_0x4e1be4(0x101));case _0x4e1be4(0x18c):return a27_0x241683[_0x4e1be4(0x11f)](_0x4e1be4(0x1b5));case _0x4e1be4(0x1ec):return a27_0x241683['yellow']('(paused)');case _0x4e1be4(0xe3):return a27_0x241683['blue'](_0x4e1be4(0x1d5));case'archived':return a27_0x241683[_0x4e1be4(0x11f)](_0x4e1be4(0x19f));default:return'('+_0xee0e13+')';}}function formatJourneyItem(_0x1ca1fc,_0x2ef9e2='',_0x51163c){const _0x2a9ef9=a27_0x2667,_0x280e05=formatJourneyState(_0x1ca1fc[_0x2a9ef9(0x1d2)]),_0x5878ae=_0x51163c?hyperlink(_0x1ca1fc[_0x2a9ef9(0xf9)],_0x51163c):_0x1ca1fc[_0x2a9ef9(0xf9)];return _0x2ef9e2+'🗺️\x20'+_0x5878ae+'\x20'+_0x280e05;}function escapeRegex(_0x170cd8){const _0x14512e=a27_0x2667;return _0x170cd8[_0x14512e(0x187)](/[.*+?^${}()|[\]\\]/g,_0x14512e(0x1c9));}function globToRegex(_0x2648f6){const _0x55feb9=a27_0x2667,_0x15d3a1=_0x2648f6['split']('*')['map'](escapeRegex);return new RegExp(_0x15d3a1[_0x55feb9(0x1b2)]('.*'),'i');}function buildRuleToNameMapping(_0x1ab9ae){const _0x5dc97b=a27_0x2667,_0x25c955=new Map();if(_0x1ab9ae[_0x5dc97b(0x12d)])for(const [_0x4c77e0,_0x43f656]of Object[_0x5dc97b(0x114)](_0x1ab9ae[_0x5dc97b(0x12d)])){if(_0x43f656[_0x5dc97b(0x134)]){const _0x42452b=serializeRule(_0x43f656[_0x5dc97b(0x134)]),_0x41117d=_0x25c955[_0x5dc97b(0x146)](_0x42452b);_0x41117d?_0x41117d[_0x5dc97b(0x14b)](_0x4c77e0):_0x25c955['set'](_0x42452b,[_0x4c77e0]);}}return _0x25c955;}async function resolveJourneyIdFromInput(_0x1d8e84,_0x2401e1,_0x5c33d8){const _0x384d4a=a27_0x2667,_0x4da578=await resolveJourneyTarget(_0x1d8e84,_0x2401e1[_0x384d4a(0x135)],_0x2401e1[_0x384d4a(0x1b7)]),_0x31bc58=_0x4da578[_0x384d4a(0x135)];if(!_0x31bc58)throw new SDKError(ErrorCode[_0x384d4a(0x1ab)],_0x384d4a(0x148));const _0x375af3=await withSpinner(_0x384d4a(0x142),()=>_0x5c33d8[_0x384d4a(0x1b6)]['resolveParentId'](_0x31bc58),{'verbose':_0x2401e1['verbose']}),_0x392f17=_0x375af3[_0x384d4a(0x129)],_0x53c612=await withSpinner(_0x384d4a(0x1f8),()=>_0x5c33d8[_0x384d4a(0x1ba)]['resolveJourneyId'](_0x392f17,_0x4da578[_0x384d4a(0x1a8)]),{'verbose':_0x2401e1[_0x384d4a(0x1b7)]});return{'journeyId':_0x53c612[_0x384d4a(0x129)],'journeyName':_0x4da578[_0x384d4a(0x1a8)],'parentSegmentId':_0x392f17};}async function resolveJourneyTarget(_0x53a3fd,_0x1c0e10,_0x4a0fa9){const _0x2d6aca=a27_0x2667;if(isYamlFilePath(_0x53a3fd))try{const _0x12ebb6=await resolveYamlFilePath(_0x53a3fd);return _0x4a0fa9&&(console[_0x2d6aca(0x1d4)]('Resolved\x20YAML\x20file:\x20'+_0x53a3fd),console[_0x2d6aca(0x1d4)]('\x20\x20Parent\x20segment:\x20'+_0x12ebb6[_0x2d6aca(0x135)]),console[_0x2d6aca(0x1d4)](_0x2d6aca(0x13a)+_0x12ebb6[_0x2d6aca(0x1ff)]),console[_0x2d6aca(0x1d4)]('\x20\x20Folder\x20path:\x20'+(_0x12ebb6['folderPath']||_0x2d6aca(0x12f)))),{'journeyName':_0x12ebb6['segmentName'],'parentSegment':_0x12ebb6[_0x2d6aca(0x135)],'resolved':_0x12ebb6};}catch(_0x101595){throw new SDKError(ErrorCode[_0x2d6aca(0x1ab)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x101595['message']);}if(!_0x1c0e10)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2d6aca(0x12a));return{'journeyName':_0x53a3fd,'parentSegment':_0x1c0e10};}export class JourneyListCommand extends BaseCommand{[a27_0x363bd7(0x113)]='journey:list';[a27_0x363bd7(0x139)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x363bd7(0x1f2)](_0x4c6838){const _0x713ee6=a27_0x363bd7,{options:_0x28ea28,args:_0x512621,tdx:_0x2d3513}=_0x4c6838,_0x2862c7=_0x512621[0x0],_0x571ddc=_0x28ea28[_0x713ee6(0x135)];if(!_0x571ddc)return console['error'](_0x713ee6(0x190)),console['error'](_0x713ee6(0x1a0)),0x1;const _0x54206d=await withSpinner(_0x713ee6(0x142),()=>_0x2d3513[_0x713ee6(0x1b6)]['resolveParentId'](_0x571ddc),{'verbose':_0x28ea28[_0x713ee6(0x1b7)]}),_0x5503f0=_0x54206d['data'];_0x28ea28['verbose']&&(console['error'](_0x713ee6(0xdd)+_0x571ddc+_0x713ee6(0x172)+_0x5503f0+')'),_0x2862c7&&console['error']('Pattern:\x20'+_0x2862c7));const _0x4bfd0b=await withSpinner(_0x713ee6(0x1b9),()=>_0x2d3513[_0x713ee6(0x1b6)][_0x713ee6(0x18d)](_0x5503f0),{'verbose':_0x28ea28[_0x713ee6(0x1b7)]}),_0x51846b=_0x4bfd0b['data'],_0x54ce23=_0x51846b['rootFolderId'],_0x26b063=await withSpinner('Listing\x20journeys...',()=>_0x2d3513[_0x713ee6(0x1ba)]['listJourneysWithFolders'](_0x5503f0,_0x54ce23),{'verbose':_0x28ea28[_0x713ee6(0x1b7)]});let _0x3ade1d=_0x26b063[_0x713ee6(0x129)]['journeys'];const _0xe3faf3=_0x26b063[_0x713ee6(0x129)][_0x713ee6(0x1a2)],_0x57cb1f=new Map();for(const _0x4150f4 of _0xe3faf3){_0x57cb1f['set'](_0x4150f4['id'],_0x4150f4[_0x713ee6(0x113)]);}if(_0x2862c7){const _0x4942db=globToRegex(_0x2862c7);_0x3ade1d=_0x3ade1d[_0x713ee6(0x1ea)](_0x35891a=>_0x4942db[_0x713ee6(0x10b)](_0x35891a[_0x713ee6(0xf9)]));}console[_0x713ee6(0x1d4)](_0x713ee6(0x183)+_0x3ade1d[_0x713ee6(0x198)]+_0x713ee6(0xf6)+(_0x3ade1d['length']!==0x1?'s':''));const _0x22a0aa=_0x579172=>{const _0x4ae7f8=_0x713ee6;return getConsoleNextUrl(_0x28ea28[_0x4ae7f8(0x164)],_0x4ae7f8(0x169)+_0x5503f0+_0x4ae7f8(0x18f)+_0x579172+_0x4ae7f8(0x143));};if(_0x28ea28[_0x713ee6(0x149)]===_0x713ee6(0x115))await handleSDKOutput(_0x3ade1d,_0x28ea28);else{if(_0x28ea28[_0x713ee6(0x149)]==='json'){const _0x2be437=_0x3ade1d[_0x713ee6(0x19e)](_0x14d7b6=>({..._0x14d7b6,'url':_0x22a0aa(_0x14d7b6['id'])}));await handleSDKOutput(_0x2be437,_0x28ea28);}else{console['log']('['+_0x571ddc+']');const _0x28fcbf=new Map(),_0x52baf4=[];for(const _0x4b6a8d of _0x3ade1d){if(!_0x4b6a8d[_0x713ee6(0x1bf)]||_0x4b6a8d[_0x713ee6(0x1bf)]===_0x54ce23)_0x52baf4[_0x713ee6(0x14b)](_0x4b6a8d);else{const _0xb0e211=_0x28fcbf['get'](_0x4b6a8d[_0x713ee6(0x1bf)])||[];_0xb0e211[_0x713ee6(0x14b)](_0x4b6a8d),_0x28fcbf[_0x713ee6(0x1e9)](_0x4b6a8d['folderId'],_0xb0e211);}}const _0x20d5ae=(_0x2cf8ed,_0x3e5697)=>_0x2cf8ed['journeyBundleName'][_0x713ee6(0xfc)](_0x3e5697[_0x713ee6(0xf9)],undefined,{'sensitivity':_0x713ee6(0x14e)});_0x52baf4[_0x713ee6(0x1e6)](_0x20d5ae);for(const _0xb14602 of _0x52baf4){console[_0x713ee6(0xf2)](formatJourneyItem(_0xb14602,'',_0x22a0aa(_0xb14602['id'])));}const _0x355a5a=[..._0x28fcbf['entries']()][_0x713ee6(0x1e6)]((_0xf73dc,_0x1a31a4)=>{const _0x356568=_0x713ee6,_0x3e9a5f=_0x57cb1f[_0x356568(0x146)](_0xf73dc[0x0])||_0xf73dc[0x0],_0x2d0c04=_0x57cb1f[_0x356568(0x146)](_0x1a31a4[0x0])||_0x1a31a4[0x0];return _0x3e9a5f['localeCompare'](_0x2d0c04,undefined,{'sensitivity':_0x356568(0x14e)});});for(const [_0x2d46d1,_0x11b648]of _0x355a5a){const _0x42c29f=_0x57cb1f[_0x713ee6(0x146)](_0x2d46d1)||_0x2d46d1;console[_0x713ee6(0xf2)]('📁\x20'+_0x42c29f),_0x11b648[_0x713ee6(0x1e6)](_0x20d5ae);for(const _0x3703b7 of _0x11b648){console['log'](formatJourneyItem(_0x3703b7,'\x20\x20',_0x22a0aa(_0x3703b7['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x363bd7(0x1fe);['description']=a27_0x363bd7(0x120);async[a27_0x363bd7(0x1f2)](_0x573489){const _0x1ad072=a27_0x363bd7,{options:_0x452c67,args:_0x4f80da,tdx:_0x5cb494}=_0x573489,_0x26a17e=_0x4f80da[0x0];if(!_0x26a17e)return console['error'](_0x1ad072(0x1f7)),console[_0x1ad072(0x1d4)](_0x1ad072(0x17e)),console['error'](_0x1ad072(0x1c6)),console['error'](_0x1ad072(0x104)),0x1;_0x452c67[_0x1ad072(0x1b7)]&&console[_0x1ad072(0x1d4)]('Input:\x20'+_0x26a17e);const {journeyId:_0x156b70,parentSegmentId:_0x992be9}=await resolveJourneyIdFromInput(_0x26a17e,_0x452c67,_0x5cb494);if(_0x452c67[_0x1ad072(0x179)]){const _0x4eb998=getConsoleNextUrl(_0x452c67[_0x1ad072(0x164)],_0x1ad072(0x169)+_0x992be9+_0x1ad072(0x18f)+_0x156b70+_0x1ad072(0x1c0));return console[_0x1ad072(0x1d4)](a27_0x241683[_0x1ad072(0xee)]('✔')+'\x20Opening\x20'+a27_0x241683[_0x1ad072(0x111)](_0x4eb998)),openBrowser(_0x4eb998),0x0;}const _0x33c097=await withSpinner(_0x1ad072(0x16c),()=>_0x5cb494[_0x1ad072(0x1ba)]['getJourney'](_0x156b70),{'verbose':_0x452c67[_0x1ad072(0x1b7)]}),_0x1fce61=_0x33c097[_0x1ad072(0x129)],_0x1b9855=_0x452c67['includeStats'];let _0x22169a;if(_0x1b9855)try{const _0x32f1f2=await withSpinner(_0x1ad072(0x171),()=>_0x5cb494[_0x1ad072(0x1ba)][_0x1ad072(0xf1)](_0x156b70),{'verbose':_0x452c67[_0x1ad072(0x1b7)]});_0x22169a=_0x32f1f2[_0x1ad072(0x129)];}catch{_0x452c67['verbose']&&console['error'](_0x1ad072(0x110));}const _0xd8668c=getConsoleNextUrl(_0x452c67[_0x1ad072(0x164)],_0x1ad072(0x169)+_0x992be9+_0x1ad072(0x18f)+_0x156b70+'/j/da/je'),_0x371d42={'id':_0x1fce61['id'],'name':_0x1fce61[_0x1ad072(0x147)][_0x1ad072(0x113)],'description':_0x1fce61['attributes'][_0x1ad072(0x139)],'state':_0x1fce61[_0x1ad072(0x147)]['state'],'paused':_0x1fce61[_0x1ad072(0x147)]['paused'],'reentry_mode':_0x1fce61[_0x1ad072(0x147)][_0x1ad072(0x197)],'stages':_0x1fce61['attributes'][_0x1ad072(0x16d)]?.[_0x1ad072(0x198)]||0x0,..._0x1fce61['attributes'][_0x1ad072(0x1c5)]&&{'goal':_0x1fce61['attributes'][_0x1ad072(0x1c5)][_0x1ad072(0x113)]},..._0x22169a&&{'statistics':{'size':_0x22169a[_0x1ad072(0x126)],'entered':_0x22169a[_0x1ad072(0x1fa)],'goal_achieved':_0x22169a[_0x1ad072(0x1df)],'completion_rate':_0x22169a['completionRate'],'exit_or_jump':_0x22169a[_0x1ad072(0x1c3)],'exit_or_jump_rate':_0x22169a['exitOrJumpRate'],'stages':_0x22169a[_0x1ad072(0x144)]}},'url':_0xd8668c};return await handleSingleObjectOutput(_0x371d42,_0x452c67),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x363bd7(0xf5);[a27_0x363bd7(0x139)]=a27_0x363bd7(0x10c);async[a27_0x363bd7(0x1f2)](_0x2c26f3){const _0x578135=a27_0x363bd7,{options:_0x986316,args:_0x2a4306,tdx:_0x3a1eca}=_0x2c26f3,_0x22d715=_0x2a4306[0x0];if(!requireNameOrPath(_0x22d715))return 0x1;_0x986316[_0x578135(0x1b7)]&&console[_0x578135(0x1d4)](_0x578135(0x1f4)+_0x22d715);const _0x55b85=_0x986316,_0x811e6e=_0x55b85[_0x578135(0x13c)],_0x29b1f6=_0x55b85['to'],_0xf0c888=_0x55b85[_0x578135(0x10d)],_0x2120de=_0x55b85[_0x578135(0x1c4)];_0xf0c888&&!_0x811e6e&&!_0x29b1f6&&console[_0x578135(0x1d4)](_0x578135(0x182));const _0x3959b5=_0xf0c888?withJsonFormat(_0x986316):_0x986316,{journeyId:_0x77a1c7,journeyName:_0x11e822}=await resolveJourneyIdFromInput(_0x22d715,_0x3959b5,_0x3a1eca),_0x58420c=_0x811e6e||_0x29b1f6?{'from':_0x811e6e,'to':_0x29b1f6}:undefined,_0x59aa2e=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x578135(0xdc)]([_0x3a1eca[_0x578135(0x1ba)][_0x578135(0x1c8)](_0x77a1c7),_0x3a1eca[_0x578135(0x1ba)][_0x578135(0xf1)](_0x77a1c7,_0x58420c)]),{'verbose':_0x3959b5[_0x578135(0x1b7)]}),[_0xc61890,_0x44000f]=_0x59aa2e[_0x578135(0x129)];if(!_0x44000f||_0x44000f[_0x578135(0x1c2)]===null)return console[_0x578135(0x1d4)](_0x578135(0xf0)+_0x11e822),console[_0x578135(0x1d4)](_0x578135(0x193)),0x0;const _0x5ee543=buildStageNameMap(_0xc61890),_0x4a32ac=!!(_0x58420c&&_0x44000f[_0x578135(0x1d8)]?.[_0x578135(0x198)]),_0x379835={'stageNameMap':_0x5ee543,'hasPeriod':_0x4a32ac,'includeHistory':!!_0xf0c888};if(_0x2120de&&_0x44000f[_0x578135(0x144)]){const _0x51533=_0x44000f['stages'][_0x578135(0x1bd)](_0x2be13e=>{const _0x105dc2=_0x578135,_0xde0d82=_0x5ee543[_0x105dc2(0x146)](_0x2be13e['id'])??'';return _0xde0d82['toLowerCase']()===_0x2120de[_0x105dc2(0x16e)]();});if(_0x51533)return await handleSingleObjectOutput(formatStageStats(_0x51533,_0x379835),_0x3959b5),0x0;const _0x279bdf=_0x44000f['stages'][_0x578135(0x19e)](_0x3fb302=>_0x5ee543[_0x578135(0x146)](_0x3fb302['id'])??_0x3fb302['id']);return console[_0x578135(0x1d4)](_0x578135(0x14d)+_0x2120de+_0x578135(0x1db)),console['error'](_0x578135(0xfe)+_0x279bdf[_0x578135(0x1b2)](',\x20')),0x1;}const _0x33fd1e=_0x44000f[_0x578135(0x144)]?.[_0x578135(0x19e)](_0x2f1cb2=>formatStageStats(_0x2f1cb2,_0x379835)),_0x5ac0b2=assembleJourneyStats(_0x44000f,{'from':_0x811e6e,'to':_0x29b1f6,'includeHistory':_0xf0c888});return await this['renderStats'](_0x5ac0b2,_0x33fd1e??[],_0x3959b5),0x0;}async[a27_0x363bd7(0x17d)](_0x14b069,_0x4f8016,_0x5c2fe3){const _0x10d9d6=a27_0x363bd7,_0x23379c=_0x5c2fe3['format']===_0x10d9d6(0x1e3)||_0x5c2fe3[_0x10d9d6(0x149)]===_0x10d9d6(0x12c)||_0x5c2fe3['json']||_0x5c2fe3[_0x10d9d6(0x12c)];if(_0x23379c){_0x14b069[_0x10d9d6(0x144)]=_0x4f8016,await handleSingleObjectOutput(_0x14b069,_0x5c2fe3);return;}await handleSingleObjectOutput(_0x14b069,_0x5c2fe3);for(const _0x57fea6 of _0x4f8016){console[_0x10d9d6(0xf2)](''),console[_0x10d9d6(0xf2)](String(a27_0x241683[_0x10d9d6(0x111)][_0x10d9d6(0x127)]('['+_0x57fea6['name']+']'))+a27_0x241683[_0x10d9d6(0x11f)]('\x20'+_0x57fea6['id']));const {id:_0x3d4403,name:_0x3c2b59,..._0x368dd1}=_0x57fea6;await handleSingleObjectOutput(_0x368dd1,_0x5c2fe3);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x363bd7(0x113)]='journey:traffic';[a27_0x363bd7(0x139)]=a27_0x363bd7(0x132);async['execute'](_0x38e930){const _0x2c702a=a27_0x363bd7,{options:_0x5df529,args:_0x47d3ac,tdx:_0x68d842}=_0x38e930,_0x77f335=_0x47d3ac[0x0];if(!requireNameOrPath(_0x77f335))return 0x1;_0x5df529[_0x2c702a(0x1b7)]&&console[_0x2c702a(0x1d4)](_0x2c702a(0x1f4)+_0x77f335);const _0x2e4db4=_0x5df529,_0x4b79e8=_0x2e4db4[_0x2c702a(0x156)],_0x1fc6f7=_0x2e4db4[_0x2c702a(0x13c)],_0xebd471=_0x2e4db4['to'],_0x59f1e8=_0x2e4db4[_0x2c702a(0x161)];if(_0x4b79e8&&_0x4b79e8!=='conversion'&&_0x4b79e8!==_0x2c702a(0x158))return console[_0x2c702a(0x1d4)](_0x2c702a(0x17f)+_0x4b79e8+_0x2c702a(0xe4)),0x1;const _0x52c401=withJsonFormat(_0x5df529),{journeyId:_0x4f6920,journeyName:_0x5eabda}=await resolveJourneyIdFromInput(_0x77f335,_0x52c401,_0x68d842),_0x24f2c2={'type':_0x4b79e8,'from':_0x1fc6f7,'to':_0xebd471,'limit':_0x59f1e8},_0xd896f5=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x68d842['journey'][_0x2c702a(0x108)](_0x4f6920,_0x24f2c2),{'verbose':_0x52c401[_0x2c702a(0x1b7)]}),_0x1a197a=_0xd896f5[_0x2c702a(0x129)],_0x18d7b3=_0x1a197a[_0x2c702a(0x15e)]&&(_0x1a197a['conversion'][_0x2c702a(0x13e)][_0x2c702a(0x198)]>0x0||_0x1a197a[_0x2c702a(0x15e)][_0x2c702a(0xfb)][_0x2c702a(0x198)]>0x0),_0x38bb15=_0x1a197a[_0x2c702a(0x158)]&&_0x1a197a['activation'][_0x2c702a(0x198)]>0x0;if(!_0x18d7b3&&!_0x38bb15)return console[_0x2c702a(0x1d4)](_0x2c702a(0x1ce)+_0x5eabda),console[_0x2c702a(0x1d4)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x1fc6f7&&_0xebd471&&console['error'](_0x2c702a(0x18b)),0x0;return await handleSingleObjectOutput(_0x1a197a,_0x52c401),0x0;}}function formatStageStats(_0x2773f3,_0x252c4b){const _0x283d71=a27_0x363bd7,_0x4f74a5=_0x252c4b[_0x283d71(0x1b1)]&&_0x2773f3[_0x283d71(0x1d8)]?.[_0x283d71(0x198)]?aggregateStageHistory(_0x2773f3['history']):{'size':_0x2773f3['size'],'entered':_0x2773f3['enteredSize'],'milestone':_0x2773f3[_0x283d71(0x1bc)],'milestone_rate':_0x2773f3[_0x283d71(0x11a)],'exit_or_jump':_0x2773f3['exitOrJumpSize'],'exit_or_jump_rate':_0x2773f3[_0x283d71(0x1b8)]},_0xeddd04={'id':_0x2773f3['id'],'name':_0x252c4b[_0x283d71(0xd8)][_0x283d71(0x146)](_0x2773f3['id'])??_0x2773f3['id'],..._0x4f74a5};return _0x252c4b[_0x283d71(0x1b1)]&&_0x252c4b[_0x283d71(0x10d)]&&_0x2773f3['history']&&(_0xeddd04[_0x283d71(0x1d8)]=_0x2773f3[_0x283d71(0x1d8)]),_0xeddd04;}export class JourneyPauseCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x13f);[a27_0x363bd7(0x139)]=a27_0x363bd7(0x159);async[a27_0x363bd7(0x1f2)](_0x1111ec){const _0x1889a7=a27_0x363bd7,{options:_0x2a9d31,args:_0x470b24,tdx:_0x2746ae}=_0x1111ec,_0x23590b=_0x470b24[0x0];if(!requireNameOrPath(_0x23590b))return 0x1;_0x2a9d31[_0x1889a7(0x1b7)]&&console['error'](_0x1889a7(0x1f4)+_0x23590b);const {journeyId:_0x238724,journeyName:_0x5deefe}=await resolveJourneyIdFromInput(_0x23590b,_0x2a9d31,_0x2746ae);if(!_0x2a9d31[_0x1889a7(0xfa)]){const _0x3208e5=await confirm(_0x1889a7(0x14c)+_0x5deefe+'\x22?');if(!_0x3208e5)return console['error'](_0x1889a7(0x10f)),0x0;}const _0x2ebaec=await withSpinner(_0x1889a7(0x1de),()=>_0x2746ae['journey'][_0x1889a7(0x1aa)](_0x238724),{'verbose':_0x2a9d31[_0x1889a7(0x1b7)]}),_0x58b961=_0x2ebaec['data'];return console[_0x1889a7(0x1d4)](_0x1889a7(0x103)+_0x58b961['attributes'][_0x1889a7(0x113)]+'\x22\x20paused'),0x0;}}export class JourneyRunCommand extends BaseCommand{['name']='journey:run';['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a27_0x363bd7(0x1f2)](_0x940919){const _0x4868e8=a27_0x363bd7,{options:_0x46c7cd,args:_0x20feac,tdx:_0xd7d0af}=_0x940919,_0x590e48=_0x20feac[0x0];if(!requireNameOrPath(_0x590e48))return 0x1;_0x46c7cd['verbose']&&console['error']('Input:\x20'+_0x590e48);const {journeyId:_0x1e1081,journeyName:_0x538fb2}=await resolveJourneyIdFromInput(_0x590e48,_0x46c7cd,_0xd7d0af);if(_0x46c7cd[_0x4868e8(0x1ac)])return await this['executeDryRun'](_0x940919,_0x1e1081,_0x538fb2);if(!_0x46c7cd[_0x4868e8(0xfa)]){const _0x2c0f35=await confirm(_0x4868e8(0x13d)+_0x538fb2+'\x22?');if(!_0x2c0f35)return console[_0x4868e8(0x1d4)](_0x4868e8(0x10f)),0x0;}const _0x4ab574=await withSpinner(_0x4868e8(0xeb),()=>_0xd7d0af['journey'][_0x4868e8(0x199)](_0x1e1081),{'verbose':_0x46c7cd[_0x4868e8(0x1b7)]}),_0x4618a7=_0x4ab574[_0x4868e8(0x129)],_0x3cfd04=getWorkflowSessionUrl(_0x46c7cd[_0x4868e8(0x164)],_0x4618a7[_0x4868e8(0x162)],_0x4618a7['workflowSessionId']);return console[_0x4868e8(0x1d4)]('\x0a'+a27_0x241683[_0x4868e8(0xee)]('✔')+_0x4868e8(0xd9)),console['error']('\x20\x20'+a27_0x241683[_0x4868e8(0x11f)](_0x4868e8(0x1f1))+'\x20'+_0x538fb2),console[_0x4868e8(0x1d4)]('\x20\x20'+a27_0x241683['dim'](_0x4868e8(0x181))+'\x20'+_0x4618a7[_0x4868e8(0x10a)]),console['error']('\x20\x20'+a27_0x241683[_0x4868e8(0x11f)](_0x4868e8(0x1a3))+'\x20'+_0x4618a7[_0x4868e8(0x11c)]),console['error']('\x20\x20'+_0x3cfd04),0x0;}async[a27_0x363bd7(0x206)](_0x54a00c,_0x18715c,_0x4121a3){const _0x5cebf9=a27_0x363bd7,{options:_0x285679,tdx:_0x245562}=_0x54a00c,_0x29c59d=await withSpinner('Fetching\x20journey\x20'+_0x4121a3+_0x5cebf9(0x1b0),()=>Promise[_0x5cebf9(0xdc)]([_0x245562[_0x5cebf9(0x1ba)][_0x5cebf9(0x1c8)](_0x18715c),_0x245562[_0x5cebf9(0x1ba)]['listActivationsFlat'](_0x18715c)]),{'verbose':_0x285679[_0x5cebf9(0x1b7)]}),[_0x4be95a,_0x463e09]=_0x29c59d[_0x5cebf9(0x129)],_0x2a64de=_0x4be95a[_0x5cebf9(0x147)],_0x1fe0e6=_0x2a64de[_0x5cebf9(0x16d)];console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x1f1)),_0x2a64de[_0x5cebf9(0x113)]),console['log'](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x1dd)),_0x4be95a['id']),console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)]('State:'),_0x2a64de['state']),console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x137)),_0x2a64de[_0x5cebf9(0x1ec)]?a27_0x241683[_0x5cebf9(0x14a)]('yes'):a27_0x241683[_0x5cebf9(0xee)]('no')),console['log'](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x117)),_0x2a64de[_0x5cebf9(0x11d)]);const _0x312790=_0x1fe0e6[_0x5cebf9(0x198)]>0x0?'\x20('+_0x1fe0e6[_0x5cebf9(0x19e)](_0x173146=>_0x173146['name'])[_0x5cebf9(0x1b2)](',\x20')+')':'';console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x130)),''+_0x1fe0e6['length']+_0x312790),console[_0x5cebf9(0xf2)]('');if(_0x463e09['length']===0x0)console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)]('Activations:'),a27_0x241683[_0x5cebf9(0x11f)](_0x5cebf9(0x157)));else{console[_0x5cebf9(0xf2)](a27_0x241683['bold']('Activations:'));for(const _0x26b008 of _0x463e09){const _0x460719=_0x26b008[_0x5cebf9(0x113)]??'(unnamed)',_0x38eb2b=_0x26b008[_0x5cebf9(0x1d1)]!=null?'connection\x20'+_0x26b008[_0x5cebf9(0x1d1)]:_0x5cebf9(0xe7),_0x2e39ba=_0x26b008[_0x5cebf9(0x112)]?''+_0x26b008['scheduleType']+(_0x26b008[_0x5cebf9(0x201)]?'\x20@\x20'+_0x26b008[_0x5cebf9(0x201)]:''):_0x5cebf9(0x1e4),_0x5c6b0a=_0x26b008[_0x5cebf9(0x176)]?_0x5cebf9(0x1c1):'';console[_0x5cebf9(0xf2)]('\x20\x20'+a27_0x241683[_0x5cebf9(0x14a)](_0x5cebf9(0x1da))+'\x20'+_0x460719+_0x5cebf9(0x102)+_0x38eb2b+',\x20schedule:\x20'+_0x2e39ba+_0x5c6b0a);}}return console['log'](a27_0x241683['yellow']('\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.')),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x1f0);['description']=a27_0x363bd7(0x174);async['execute'](_0x2af228){const _0x460c09=a27_0x363bd7,{options:_0x36d0a3,args:_0x115fe5,tdx:_0x22fd24}=_0x2af228,_0x580c32=_0x115fe5[0x0];if(!requireNameOrPath(_0x580c32))return 0x1;_0x36d0a3[_0x460c09(0x1b7)]&&console[_0x460c09(0x1d4)](_0x460c09(0x1f4)+_0x580c32);const {journeyId:_0x55b989,journeyName:_0x5969d4}=await resolveJourneyIdFromInput(_0x580c32,_0x36d0a3,_0x22fd24);if(_0x36d0a3[_0x460c09(0x1ac)])return await this[_0x460c09(0x206)](_0x2af228,_0x55b989,_0x5969d4);if(!_0x36d0a3[_0x460c09(0xfa)]){const _0x3044b0=await confirm(_0x460c09(0x178)+_0x5969d4+'\x22?');if(!_0x3044b0)return console['error']('Cancelled'),0x0;}const _0x782d73=await withSpinner('Resuming\x20journey...',()=>_0x22fd24[_0x460c09(0x1ba)][_0x460c09(0x18e)](_0x55b989),{'verbose':_0x36d0a3[_0x460c09(0x1b7)]}),_0x4ad79e=_0x782d73[_0x460c09(0x129)];return console[_0x460c09(0x1d4)](_0x460c09(0x103)+_0x4ad79e['attributes'][_0x460c09(0x113)]+_0x460c09(0x140)),0x0;}async[a27_0x363bd7(0x206)](_0x261691,_0x26bb4e,_0x1789ab){const _0x5bbd69=a27_0x363bd7,{options:_0x271787,tdx:_0x3243c5}=_0x261691,_0x1b7a1f=await withSpinner(_0x5bbd69(0x107)+_0x1789ab+_0x5bbd69(0x1b0),()=>Promise[_0x5bbd69(0xdc)]([_0x3243c5['journey'][_0x5bbd69(0x1c8)](_0x26bb4e),_0x3243c5[_0x5bbd69(0x1ba)]['listActivationsFlat'](_0x26bb4e)]),{'verbose':_0x271787[_0x5bbd69(0x1b7)]}),[_0x41d263,_0x5637c7]=_0x1b7a1f[_0x5bbd69(0x129)],_0x41cc78=_0x41d263[_0x5bbd69(0x147)],_0x541594=_0x41cc78[_0x5bbd69(0x16d)];console['log'](a27_0x241683[_0x5bbd69(0x127)](_0x5bbd69(0x1f1)),_0x41cc78[_0x5bbd69(0x113)]),console[_0x5bbd69(0xf2)](a27_0x241683['bold'](_0x5bbd69(0x1dd)),_0x41d263['id']),console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x127)](_0x5bbd69(0x1a7)),_0x41cc78[_0x5bbd69(0x1d2)]),console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x127)]('Paused:'),_0x41cc78[_0x5bbd69(0x1ec)]?a27_0x241683['yellow']('yes'):a27_0x241683[_0x5bbd69(0xee)]('no'));_0x41cc78[_0x5bbd69(0x1fc)]&&console['log'](a27_0x241683[_0x5bbd69(0x127)]('Paused\x20at:'),_0x41cc78[_0x5bbd69(0x1fc)]);console['log'](a27_0x241683['bold']('Parent\x20segment\x20ID:'),_0x41cc78[_0x5bbd69(0x11d)]);const _0x2ad71b=_0x541594[_0x5bbd69(0x198)]>0x0?'\x20('+_0x541594[_0x5bbd69(0x19e)](_0x48952f=>_0x48952f[_0x5bbd69(0x113)])[_0x5bbd69(0x1b2)](',\x20')+')':'';console[_0x5bbd69(0xf2)](a27_0x241683['bold']('Stages:'),''+_0x541594['length']+_0x2ad71b),console['log']('');if(_0x5637c7[_0x5bbd69(0x198)]===0x0)console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x127)](_0x5bbd69(0x1a9)),a27_0x241683[_0x5bbd69(0x11f)](_0x5bbd69(0x157)));else{console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x127)]('Activations:'));for(const _0x15b1ce of _0x5637c7){const _0x3e471f=_0x15b1ce[_0x5bbd69(0x113)]??_0x5bbd69(0x175),_0x58326c=_0x15b1ce[_0x5bbd69(0x1d1)]!=null?_0x5bbd69(0x204)+_0x15b1ce[_0x5bbd69(0x1d1)]:_0x5bbd69(0xe7),_0x5bc830=_0x15b1ce[_0x5bbd69(0x112)]?''+_0x15b1ce[_0x5bbd69(0x112)]+(_0x15b1ce[_0x5bbd69(0x201)]?_0x5bbd69(0x185)+_0x15b1ce['runAt']:''):_0x5bbd69(0x1e4),_0x55da6b=_0x15b1ce[_0x5bbd69(0x176)]?_0x5bbd69(0x1c1):'';console['log']('\x20\x20'+a27_0x241683[_0x5bbd69(0x14a)](_0x5bbd69(0x1da))+'\x20'+_0x3e471f+_0x5bbd69(0x102)+_0x58326c+',\x20schedule:\x20'+_0x5bc830+_0x55da6b);}}return console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x14a)](_0x5bbd69(0x173))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x1e5);[a27_0x363bd7(0x139)]=a27_0x363bd7(0x1a4);async[a27_0x363bd7(0x1f2)](_0x457274){const _0x322175=a27_0x363bd7,{options:_0x49f163,args:_0x49c975,tdx:_0x1f7832}=_0x457274,_0x17d6eb=_0x49f163,_0x188963=_0x49c975[0x0],_0x31b6e2=_0x188963&&isYamlFilePath(_0x188963),_0x2ad234=await resolveTarget({'arg':_0x31b6e2?_0x188963:undefined,'contextParent':_0x49f163[_0x322175(0x135)],'cwd':process[_0x322175(0x19b)]()});if(!isSuccessfulResolution(_0x2ad234))return _0x2ad234[_0x322175(0x1ca)]===_0x322175(0x196)?(console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x14a)](_0x322175(0xdf))),console[_0x322175(0x1d4)](_0x322175(0x100)),console[_0x322175(0x1d4)](_0x322175(0x133)),console['error'](_0x322175(0x209)),console[_0x322175(0x1d4)](_0x322175(0x1dc))):(console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x168)](_0x322175(0x195)+_0x2ad234[_0x322175(0x188)]+'\x0a')),_0x2ad234[_0x322175(0x131)]&&console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x111)](_0x2ad234[_0x322175(0x131)]))),0x1;let _0x90cb83=_0x31b6e2?undefined:_0x188963,_0x474f8b,_0x4128dc;_0x2ad234[_0x322175(0x156)]===_0x322175(0x17b)&&(_0x90cb83=_0x2ad234[_0x322175(0x1cd)],_0x474f8b=_0x2ad234['filePath'],_0x4128dc=_0x2ad234[_0x322175(0x116)]);const _0x3cd28c=_0x2ad234[_0x322175(0xe9)],_0x3c50fe=_0x2ad234[_0x322175(0x10e)];_0x17d6eb['verbose']&&(console['error'](_0x322175(0xdd)+_0x3cd28c),console[_0x322175(0x1d4)](_0x322175(0x1e0)+_0x3c50fe),_0x90cb83&&console['error'](_0x322175(0xda)+_0x90cb83),_0x474f8b&&console[_0x322175(0x1d4)](_0x322175(0x16f)+_0x474f8b),_0x4128dc&&console[_0x322175(0x1d4)](_0x322175(0x1cc)+_0x4128dc));const _0x31474b=await withSpinner(_0x322175(0x142),()=>_0x1f7832[_0x322175(0x1b6)][_0x322175(0xf7)](_0x3cd28c),{'verbose':_0x49f163['verbose']}),_0x1ed0a0=_0x31474b[_0x322175(0x129)],{journeys:_0x1bbadd,folders:_0x873088}=await withSpinner(_0x322175(0x1fd),async()=>{const _0x18a154=_0x322175,[_0x54dd31,_0x3be966]=await Promise[_0x18a154(0xdc)]([_0x1f7832['journey'][_0x18a154(0x125)](_0x1ed0a0,undefined,{'includeAllVersions':!![]}),_0x1f7832[_0x18a154(0x1b6)][_0x18a154(0x186)](_0x1ed0a0)]);return{'journeys':_0x54dd31,'folders':_0x3be966};},{'verbose':_0x49f163[_0x322175(0x1b7)]})[_0x322175(0x138)](_0x199b04=>_0x199b04['data']);let _0x3f7dd1=_0x1bbadd;const _0x34f0de=buildFolderIdToPathMap(_0x873088);if(_0x90cb83){const _0x58de86=_0x3f7dd1[_0x322175(0x1ea)](_0xc02672=>_0xc02672[_0x322175(0xf9)][_0x322175(0x16e)]()===_0x90cb83['toLowerCase']());if(_0x58de86[_0x322175(0x198)]===0x0)return console[_0x322175(0x1d4)](_0x322175(0xe0)+_0x90cb83),console[_0x322175(0x1d4)](_0x322175(0x109)),0x1;_0x3f7dd1=_0x58de86;}if(_0x4128dc!==undefined){const _0x47df85=_0x3f7dd1[_0x322175(0x1ea)](_0x351003=>{const _0x1569e3=_0x322175,_0x495fce=_0x351003['folderId']?_0x34f0de[_0x1569e3(0x146)](_0x351003['folderId'])||'':'';return _0x495fce===_0x4128dc;});if(_0x47df85[_0x322175(0x198)]===0x0&&_0x3f7dd1[_0x322175(0x198)]>0x0){console['error'](_0x322175(0x1eb)+_0x90cb83+_0x322175(0x1cf)+(_0x4128dc||_0x322175(0x189))),console['error'](_0x322175(0x121));for(const _0xcc15c of _0x3f7dd1){const _0x22e890=_0xcc15c['folderId']?_0x34f0de['get'](_0xcc15c[_0x322175(0x1bf)])||'':'';console[_0x322175(0x1d4)]('\x20\x20-\x20'+(_0x22e890||_0x322175(0x12f))+'/'+_0xcc15c[_0x322175(0xf9)]);}return 0x1;}_0x3f7dd1=_0x47df85;}if(_0x3f7dd1[_0x322175(0x198)]===0x0)return console[_0x322175(0x1d4)]('No\x20journeys\x20found'),0x0;const _0x322123=new Map();for(const _0x37f085 of _0x3f7dd1){const _0x365b98=_0x37f085[_0x322175(0x11e)];!_0x322123[_0x322175(0xff)](_0x365b98)&&_0x322123['set'](_0x365b98,[]),_0x322123[_0x322175(0x146)](_0x365b98)[_0x322175(0x14b)](_0x37f085);}for(const _0x375ca8 of _0x322123[_0x322175(0x19d)]()){_0x375ca8['sort']((_0x407d14,_0x1f2a84)=>(_0x407d14[_0x322175(0x1cb)]||0x0)-(_0x1f2a84[_0x322175(0x1cb)]||0x0));}const _0x141120=[],{idToEmailMap:_0x3649a4,connectionIdToNameMap:_0x92da22}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x5abfd2=_0x322175,[_0x329bee,_0xdac6a7]=await Promise[_0x5abfd2(0xdc)]([_0x1f7832[_0x5abfd2(0x12e)][_0x5abfd2(0xd3)](),_0x1f7832[_0x5abfd2(0x15b)][_0x5abfd2(0x15f)]()]);return{'idToEmailMap':_0x329bee,'connectionIdToNameMap':_0xdac6a7};},{'verbose':_0x49f163['verbose']})[_0x322175(0x138)](_0x2fb53e=>_0x2fb53e[_0x322175(0x129)]);for(const _0x3e8b8c of _0x322123[_0x322175(0x19d)]()){const _0x2a65ff=_0x3e8b8c[0x0]['journeyBundleName'],_0x23344d=_0x3e8b8c[0x0][_0x322175(0x1bf)],_0x1d4547=_0x23344d?_0x34f0de['get'](_0x23344d)||'':'',_0x4bf7a4=_0x1d4547?a27_0x5d2d5b[_0x322175(0x1b2)](_0x3c50fe,_0x1d4547):_0x3c50fe,_0x3f86f0=_0x474f8b||a27_0x5d2d5b['join'](_0x4bf7a4,sanitizeFileName(_0x2a65ff)+_0x322175(0x141));let _0x3c1e76,_0x2d77fd;if(existsSync(_0x3f86f0))try{const _0x58049d=readFileSync(_0x3f86f0,_0x322175(0x1ef)),_0x547eb6=parseYamlString(_0x58049d);_0x2d77fd=_0x547eb6,_0x3c1e76=buildRuleToNameMapping(_0x547eb6),_0x17d6eb[_0x322175(0x1b7)]&&_0x3c1e76[_0x322175(0x126)]>0x0&&console['error'](_0x322175(0x118)+_0x3c1e76[_0x322175(0x126)]+_0x322175(0x1f6)+_0x2a65ff);}catch(_0x42510f){_0x17d6eb[_0x322175(0x1b7)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x42510f[_0x322175(0x188)]);}const _0x1cfcf4=[],_0x3c2966=new Set(),_0x1350f5=new Map(),_0xcd576b=new Map(),_0x5744f1=new Set(),_0x35dcd2=new Map(),_0x30281c=new Map(),_0x4a70ea=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x2a65ff+_0x322175(0x1b0),async _0x90c8e0=>{const _0x107fc8=_0x322175;for(const _0x2105fc of _0x3e8b8c){const _0x466014=_0x3e8b8c[_0x107fc8(0x198)]>0x1?_0x2105fc[_0x107fc8(0xf9)]+'\x20v'+(_0x2105fc[_0x107fc8(0x1cb)]||0x1):_0x2105fc[_0x107fc8(0xf9)];_0x90c8e0[_0x107fc8(0x170)](_0x107fc8(0x106)+_0x466014);const _0xd2073e=await _0x1f7832['journey']['getJourney'](_0x2105fc['id']),_0x2e2da8=_0xd2073e['attributes']?.['audienceId'],_0x12ff3c={'resolveSegment':async _0x314f37=>{const _0x163e10=_0x107fc8;if(!_0x2e2da8)return{'name':_0x314f37,'isJourneyLocal':![]};const _0x4aeb6a=_0x1350f5[_0x163e10(0x146)](_0x314f37);if(_0x4aeb6a)return _0x4aeb6a;try{const _0x16bdd2=await _0x1f7832['segment'][_0x163e10(0x208)](_0x2e2da8,_0x314f37),_0x1ad769=_0x16bdd2[_0x163e10(0x17a)]===SEGMENT_KIND_JOURNEY;let _0x450780,_0x2646b8=_0x16bdd2[_0x163e10(0x113)];if(_0x1ad769&&_0x16bdd2[_0x163e10(0x134)]){const _0x6ab857=await segmentResponseToDef(_0x16bdd2,{'resolveSegmentName':async _0x3f45fc=>{const _0x169abe=_0x163e10,_0x2837d3=_0x1350f5['get'](_0x3f45fc);if(_0x2837d3)return _0x2837d3[_0x169abe(0x113)];const _0x57639d=await _0x12ff3c[_0x169abe(0x151)](_0x3f45fc);return _0x57639d[_0x169abe(0x113)];}}),_0x271884=_0x6ab857[_0x163e10(0x134)];_0x450780={'description':_0x16bdd2['description'],'rule':_0x271884};const _0x4ed286=serializeRule(_0x271884),_0x5d70c7=_0xcd576b[_0x163e10(0x146)](_0x4ed286);if(_0x5d70c7)_0x2646b8=_0x5d70c7,_0x450780=undefined,_0x17d6eb[_0x163e10(0x1b7)]&&console[_0x163e10(0x1d4)](_0x163e10(0xd6)+_0x16bdd2[_0x163e10(0x113)]+_0x163e10(0x207)+_0x5d70c7);else{let _0x125bfb=![];if(_0x3c1e76){const _0x25c978=_0x3c1e76[_0x163e10(0x146)](_0x4ed286);if(_0x25c978){const _0x816e09=_0x25c978['find'](_0x10e186=>!_0x3c2966[_0x163e10(0xff)](_0x10e186));_0x816e09&&(_0x2646b8=_0x816e09,_0x3c2966[_0x163e10(0xf8)](_0x816e09),_0xcd576b['set'](_0x4ed286,_0x816e09),_0x125bfb=!![],_0x17d6eb[_0x163e10(0x1b7)]&&console[_0x163e10(0x1d4)](_0x163e10(0x145)+_0x816e09+_0x163e10(0x1e7)));}}if(!_0x125bfb){const _0x2ebcd5=generateJourneyLocalName(_0x16bdd2[_0x163e10(0x113)]);_0x2ebcd5&&(_0x2646b8=_0x2ebcd5);let _0x15d686=_0x2646b8,_0x2f58ab=0x2;while(_0x3c2966[_0x163e10(0xff)](_0x15d686)){_0x15d686=_0x2646b8+'_'+_0x2f58ab,_0x2f58ab++;}_0x3c2966['add'](_0x15d686),_0xcd576b['set'](_0x4ed286,_0x15d686),_0x2646b8=_0x15d686;}}}const _0x28b69a={'name':_0x2646b8,'isJourneyLocal':_0x1ad769,'definition':_0x450780};return _0x1350f5[_0x163e10(0x1e9)](_0x314f37,_0x28b69a),_0x28b69a;}catch(_0x1f289e){return _0x49f163[_0x163e10(0x1b7)]&&console[_0x163e10(0x1d4)](_0x163e10(0x191)+_0x314f37+':\x20'+_0x1f289e[_0x163e10(0x188)]),{'name':_0x314f37,'isJourneyLocal':![]};}},'resolveActivation':async _0x369726=>{const _0x1b4abe=_0x107fc8,_0x34fee0=_0x35dcd2[_0x1b4abe(0x146)](_0x369726);if(_0x34fee0)return _0x34fee0;try{const _0x3c05de=await _0x1f7832['journey'][_0x1b4abe(0xed)](_0x2105fc['id'],_0x369726),_0x1dc06c=journeyActivationStepToYaml(_0x3c05de,_0x3649a4,_0x92da22),_0x22e10c=JSON['stringify']({'name':_0x1dc06c[_0x1b4abe(0x113)],'connection':_0x1dc06c[_0x1b4abe(0x15b)],'connector_config':_0x1dc06c[_0x1b4abe(0x123)]}),_0x231681=_0x30281c[_0x1b4abe(0x146)](_0x22e10c);if(_0x231681){const _0x5d2f57={'name':_0x231681,'isJourneyLocal':!![],'definition':_0x1dc06c};return _0x35dcd2['set'](_0x369726,_0x5d2f57),_0x5d2f57;}const _0x161841=_0x3c05de[_0x1b4abe(0x147)][_0x1b4abe(0xde)][_0x1b4abe(0x113)]||_0x369726,_0x11cda9=sanitizeYamlKey(_0x161841)||_0x1b4abe(0x1af)+_0x369726;let _0x5ed27f=_0x11cda9,_0x300f91=0x2;while(_0x5744f1[_0x1b4abe(0xff)](_0x5ed27f)){_0x5ed27f=_0x11cda9+'_'+_0x300f91,_0x300f91++;}_0x5744f1[_0x1b4abe(0xf8)](_0x5ed27f),_0x30281c['set'](_0x22e10c,_0x5ed27f);const _0x384b74={'name':_0x5ed27f,'isJourneyLocal':!![],'definition':_0x1dc06c};return _0x35dcd2['set'](_0x369726,_0x384b74),_0x384b74;}catch(_0xe66e41){return _0x49f163[_0x1b4abe(0x1b7)]&&console[_0x1b4abe(0x1d4)](_0x1b4abe(0x1ee)+_0x369726+':\x20'+_0xe66e41[_0x1b4abe(0x188)]),{'name':_0x369726,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x574eb5,_0x2fe2fa)=>{const _0x153438=_0x107fc8;return resolveJumpTarget(_0x574eb5,_0x2fe2fa,_0x4a70ea,_0x2218a3=>_0x1f7832[_0x153438(0x1ba)][_0x153438(0x1c8)](_0x2218a3));}},_0x172f6f=await journeyResponseToDef(_0xd2073e,_0x12ff3c);_0x1cfcf4[_0x107fc8(0x14b)]({'item':_0x2105fc,'yaml':_0x172f6f});}},{'verbose':_0x49f163['verbose']});const _0x12efc1=await _0x1f7832[_0x322175(0x1ba)][_0x322175(0x15d)](_0x3e8b8c[0x0]['journeyBundleId']),_0x1817b2=buildMergedJourneyDef(_0x1cfcf4,_0x3c1e76,_0x12efc1),_0x1deaa3=normalizeJourneyDef(_0x1817b2,_0x2d77fd),_0x4cd053=toYamlString(_0x1deaa3),_0x569363=_0x474f8b||a27_0x5d2d5b['join'](_0x4bf7a4,sanitizeFileName(_0x2a65ff)+_0x322175(0x141));!_0x474f8b&&_0x1d4547&&!existsSync(_0x4bf7a4)&&mkdirSync(_0x4bf7a4,{'recursive':!![]});const _0x152308=a27_0x5d2d5b[_0x322175(0x154)](process[_0x322175(0x19b)](),_0x569363);if(existsSync(_0x569363)){const _0x1c4cc9=readFileSync(_0x569363,_0x322175(0x1ef)),_0xf4b3b7=generateDiff(_0x1c4cc9,_0x4cd053),_0x1e5a0f=hasChanges(_0xf4b3b7);_0x141120[_0x322175(0x14b)]({'relativePath':_0x152308,'absolutePath':_0x569363,'content':_0x4cd053,'isNew':![],'hasChanges':_0x1e5a0f,'diff':_0x1e5a0f?formatDiffWithColors(_0xf4b3b7):undefined});}else _0x141120[_0x322175(0x14b)]({'relativePath':_0x152308,'absolutePath':_0x569363,'content':_0x4cd053,'isNew':!![],'hasChanges':![]});}const _0x5a3c26=_0x141120[_0x322175(0x1ea)](_0xd2095e=>_0xd2095e[_0x322175(0xe2)]),_0x333634=_0x141120['filter'](_0x4e7a3c=>!_0x4e7a3c['isNew']&&_0x4e7a3c[_0x322175(0x1a5)]),_0x38a517=_0x141120[_0x322175(0x1ea)](_0xdc88e=>!_0xdc88e[_0x322175(0xe2)]&&!_0xdc88e['hasChanges']),_0x13d34b=_0x3f7dd1['length'],_0x36764b=_0x322123[_0x322175(0x126)],_0x151b6c=_0x13d34b>_0x36764b?'\x20('+_0x13d34b+_0x322175(0x1ad):'';console['error'](_0x322175(0x15a)),console['error']('\x20\x20'+a27_0x241683[_0x322175(0x111)](_0x36764b+_0x322175(0x1d3))+a27_0x241683['dim'](_0x151b6c)),console[_0x322175(0x1d4)]('\x20\x20'+a27_0x241683[_0x322175(0xee)]('+\x20'+_0x5a3c26[_0x322175(0x198)]+_0x322175(0x153))),console[_0x322175(0x1d4)]('\x20\x20'+a27_0x241683[_0x322175(0x14a)]('~\x20'+_0x333634['length']+_0x322175(0xe5))),console[_0x322175(0x1d4)]('\x20\x20'+a27_0x241683[_0x322175(0x11f)]('=\x20'+_0x38a517[_0x322175(0x198)]+'\x20unchanged\x20files')),console['error'](_0x322175(0x152)+a27_0x241683['cyan'](_0x3c50fe)+'\x0a');if(_0x333634[_0x322175(0x198)]>0x0)for(const _0x389a05 of _0x333634){console[_0x322175(0x1d4)](_0x322175(0x167)+_0x389a05['relativePath']+'\x27:'),console[_0x322175(0x1d4)]('─'[_0x322175(0x1b4)](0x3c)),console['error'](_0x389a05[_0x322175(0x1f5)]),console['error']('─'[_0x322175(0x1b4)](0x3c));}if(_0x17d6eb['dryRun'])return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x14a)](_0x322175(0xec))),0x0;if(_0x5a3c26[_0x322175(0x198)]===0x0&&_0x333634[_0x322175(0x198)]===0x0)return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0xee)](_0x322175(0x177))),saveSessionContext({'parent_segment':_0x3cd28c},_0x17d6eb[_0x322175(0x184)]),console[_0x322175(0x1d4)](a27_0x241683['green']('✔\x20Context\x20set:\x20'+a27_0x241683[_0x322175(0x11f)](_0x322175(0x14f))+_0x322175(0x205)+a27_0x241683[_0x322175(0x111)](_0x3cd28c))),0x0;if(!_0x17d6eb[_0x322175(0xfa)]&&(_0x5a3c26[_0x322175(0x198)]>0x0||_0x333634[_0x322175(0x198)]>0x0)){if(!isInteractive())return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x168)](_0x322175(0xf4)),_0x322175(0x15c)),console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x11f)](_0x322175(0x194))),0x1;const _0x286aaf=await confirmKey(_0x322175(0x165)+(_0x5a3c26[_0x322175(0x198)]+_0x333634[_0x322175(0x198)])+_0x322175(0x19c));if(!_0x286aaf)return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x14a)]('Aborted.'),_0x322175(0x11b)),0x1;}!existsSync(_0x3c50fe)&&mkdirSync(_0x3c50fe,{'recursive':!![]});const _0x1e5985=a27_0x5d2d5b[_0x322175(0x1b2)](_0x3c50fe,_0x322175(0x1fb));writeFileSync(_0x1e5985,createTdxConfigContent(_0x3cd28c),_0x322175(0x1ef));for(const _0x10ab4a of _0x141120){(_0x10ab4a[_0x322175(0xe2)]||_0x10ab4a['hasChanges'])&&writeFileSync(_0x10ab4a['absolutePath'],_0x10ab4a[_0x322175(0x124)],_0x322175(0x1ef));}return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0xee)](_0x322175(0x18a)+(_0x5a3c26[_0x322175(0x198)]+_0x333634[_0x322175(0x198)])+_0x322175(0x1d0)+_0x3c50fe)),saveSessionContext({'parent_segment':_0x3cd28c},_0x17d6eb[_0x322175(0x184)]),console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0xee)](_0x322175(0x192)+a27_0x241683[_0x322175(0x11f)](_0x322175(0x14f))+_0x322175(0x205)+a27_0x241683['cyan'](_0x3cd28c))),0x0;}}function a27_0x2667(_0x31bf25,_0x3dd466){_0x31bf25=_0x31bf25-0xd3;const _0x43f2e2=a27_0x43f2();let _0x2667a2=_0x43f2e2[_0x31bf25];return _0x2667a2;}export class JourneyColumnsCommand extends BaseCommand{[a27_0x363bd7(0x113)]='journey:columns';[a27_0x363bd7(0x139)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x363bd7(0x1f2)](_0x5a144c){const _0x2a9f99=a27_0x363bd7,{options:_0x3010ab,args:_0xe0e550,tdx:_0x3c2e7b}=_0x5a144c,_0x5724a0=_0xe0e550[0x0];if(!requireNameOrPath(_0x5724a0))return 0x1;_0x3010ab[_0x2a9f99(0x1b7)]&&console[_0x2a9f99(0x1d4)](_0x2a9f99(0x1f4)+_0x5724a0);const {journeyId:_0x47b995}=await resolveJourneyIdFromInput(_0x5724a0,_0x3010ab,_0x3c2e7b),_0x3f1588=await withSpinner(_0x2a9f99(0x1a6),()=>_0x3c2e7b[_0x2a9f99(0x1ba)][_0x2a9f99(0x1f3)](_0x47b995),{'verbose':_0x3010ab['verbose']}),_0xc58d9e=_0x3f1588[_0x2a9f99(0x129)];return console['log'](_0x2a9f99(0x1b3)+_0xc58d9e[_0x2a9f99(0x1d6)]),console[_0x2a9f99(0xf2)](_0x2a9f99(0x128)+_0xc58d9e['table']),await handleSDKOutput(_0xc58d9e[_0x2a9f99(0x1f9)],_0x3010ab),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x180);['description']=a27_0x363bd7(0x150);async[a27_0x363bd7(0x1f2)](_0x52f967){const _0x1cee43=a27_0x363bd7,{options:_0x55f265,args:_0x2001dc,tdx:_0x47493b}=_0x52f967,_0x5d0410=_0x2001dc[0x0];if(!requireNameOrPath(_0x5d0410))return 0x1;_0x55f265[_0x1cee43(0x1b7)]&&console[_0x1cee43(0x1d4)]('Input:\x20'+_0x5d0410);const {journeyId:_0x3aeac1}=await resolveJourneyIdFromInput(_0x5d0410,_0x55f265,_0x47493b),_0x4abad9=await withSpinner(_0x1cee43(0xd4),()=>_0x47493b['journey'][_0x1cee43(0xe8)](_0x3aeac1),{'verbose':_0x55f265[_0x1cee43(0x1b7)]}),_0x4e1665=_0x4abad9['data'];return console[_0x1cee43(0x1d4)](_0x1cee43(0x118)+_0x4e1665[_0x1cee43(0x198)]+'\x20activation'+(_0x4e1665[_0x1cee43(0x198)]!==0x1?'s':'')),await handleSDKOutput(_0x4e1665,_0x55f265),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x155);[a27_0x363bd7(0x139)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI';['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x1a5b6e){const _0x3ac1f3=a27_0x363bd7,_0x226b20=_0x1a5b6e[_0x3ac1f3(0x1d7)][0x0];let _0x5a1663;if(_0x226b20){const _0x1d03e7=await resolveTarget({'arg':_0x226b20,'contextParent':_0x1a5b6e[_0x3ac1f3(0x166)][_0x3ac1f3(0x135)],'cwd':process['cwd']()});isSuccessfulResolution(_0x1d03e7)&&_0x1d03e7[_0x3ac1f3(0x156)]===_0x3ac1f3(0x17b)&&(_0x5a1663=_0x1d03e7['filePath']);}const _0x551078={..._0x1a5b6e,'options':{..._0x1a5b6e[_0x3ac1f3(0x166)],'journeysOnly':!![],..._0x5a1663&&{'singleFilePath':_0x5a1663}}};return this[_0x3ac1f3(0xdb)]['execute'](_0x551078);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x1a1);['description']='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x363bd7(0x1f2)](_0x306a3b){const _0x25a90e=a27_0x363bd7,{options:_0x3dd78c,args:_0x32db11,tdx:_0xb9da0b}=_0x306a3b,_0x5a5484=_0x32db11[0x0];if(!requireNameOrPath(_0x5a5484))return 0x1;if(_0x3dd78c['verbose'])console[_0x25a90e(0x1d4)](_0x25a90e(0x1f4)+_0x5a5484);const {journeyId:_0xd5028d}=await resolveJourneyIdFromInput(_0x5a5484,_0x3dd78c,_0xb9da0b),_0x1822ce=await withSpinner('Listing\x20journey\x20versions...',()=>_0xb9da0b['journey'][_0x25a90e(0x163)](_0xd5028d),{'verbose':_0x3dd78c[_0x25a90e(0x1b7)]}),{bundleName:_0x4649b3,versions:_0x32a39d,latestJourneyId:_0x3ba639}=_0x1822ce[_0x25a90e(0x129)];console[_0x25a90e(0x1d4)](_0x4649b3+':\x20'+_0x32a39d[_0x25a90e(0x198)]+_0x25a90e(0xea)+(_0x32a39d[_0x25a90e(0x198)]!==0x1?'s':''));const _0x2fb483=_0x32a39d[_0x25a90e(0x19e)](_0x454841=>({'version':_0x454841[_0x25a90e(0x1cb)],'journey_id':_0x454841[_0x25a90e(0x1c2)],'name':_0x454841[_0x25a90e(0x113)],'state':_0x454841[_0x25a90e(0x1d2)],'paused':_0x454841[_0x25a90e(0x1ec)],'latest':_0x454841['journeyId']===_0x3ba639,'created_at':_0x454841['createdAt']}));return await handleSDKOutput(_0x2fb483,_0x3dd78c),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x16a);['description']=a27_0x363bd7(0xf3);async['execute'](_0x287550){const _0x424421=a27_0x363bd7,{options:_0x1b3d9c,args:_0x4f147d,tdx:_0x286e41}=_0x287550,_0x14166d=_0x4f147d[0x0];if(!requireNameOrPath(_0x14166d))return 0x1;if(_0x1b3d9c[_0x424421(0x1b7)])console[_0x424421(0x1d4)](_0x424421(0x1f4)+_0x14166d);const {journeyId:_0x497fbb,journeyName:_0x44e2f6}=await resolveJourneyIdFromInput(_0x14166d,_0x1b3d9c,_0x286e41);if(!_0x1b3d9c['yes']){const _0x32cb55=await confirm(_0x424421(0x16b)+_0x44e2f6+'\x22?');if(!_0x32cb55)return console[_0x424421(0x1d4)](_0x424421(0x10f)),0x0;}const _0x1965f4=await withSpinner('Creating\x20new\x20version...',()=>_0x286e41['journey'][_0x424421(0x17c)](_0x497fbb),{'verbose':_0x1b3d9c['verbose']}),_0x5d812a=_0x1965f4['data'];return console['error'](a27_0x241683[_0x424421(0xee)]('✔')+_0x424421(0x1ae)+_0x5d812a[_0x424421(0x147)][_0x424421(0x1cb)]+_0x424421(0x1d9)+_0x5d812a['attributes'][_0x424421(0x113)]+'\x22'),console[_0x424421(0x1d4)](_0x424421(0x1bb)+_0x5d812a['id']),await handleSingleObjectOutput({'id':_0x5d812a['id'],'name':_0x5d812a[_0x424421(0x147)][_0x424421(0x113)],'version':_0x5d812a[_0x424421(0x147)]['versionNumber'],'state':_0x5d812a['attributes'][_0x424421(0x1d2)],'bundle_id':_0x5d812a['attributes'][_0x424421(0x11e)],'created_at':_0x5d812a['attributes'][_0x424421(0xef)]},_0x1b3d9c),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x119);[a27_0x363bd7(0x139)]=a27_0x363bd7(0x13b);async[a27_0x363bd7(0x1f2)](_0x16e455){const _0x4c12b1=a27_0x363bd7,{options:_0x1c8207,args:_0x597d77,tdx:_0x5b0593}=_0x16e455,_0x1b3f1a=_0x597d77[0x0];if(!requireNameOrPath(_0x1b3f1a))return 0x1;const _0x21b128=_0x1c8207[_0x4c12b1(0xe6)];if(!_0x21b128)return console['error'](_0x4c12b1(0x1ed)),console['error'](_0x4c12b1(0x136)),0x1;const _0x3af859=parseInt(_0x21b128,0xa);if(isNaN(_0x3af859)||_0x3af859<0x1)return console[_0x4c12b1(0x1d4)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x21b128),0x1;if(_0x1c8207[_0x4c12b1(0x1b7)])console[_0x4c12b1(0x1d4)]('Input:\x20'+_0x1b3f1a+',\x20version:\x20'+_0x3af859);const {journeyId:_0x4b301b,parentSegmentId:_0x174f61}=await resolveJourneyIdFromInput(_0x1b3f1a,_0x1c8207,_0x5b0593),_0x1932f8=await withSpinner(_0x4c12b1(0x1be),()=>_0x5b0593[_0x4c12b1(0x1ba)]['listVersions'](_0x4b301b),{'verbose':_0x1c8207['verbose']}),{versions:_0x3bb7e7,latestJourneyId:_0x49ec5f}=_0x1932f8[_0x4c12b1(0x129)],_0x4fe33a=_0x3bb7e7[_0x4c12b1(0x1bd)](_0x2f5965=>_0x2f5965[_0x4c12b1(0x1cb)]===_0x3af859);if(!_0x4fe33a){const _0x177af6=_0x3bb7e7[_0x4c12b1(0x19e)](_0x5b3fc7=>'v'+_0x5b3fc7[_0x4c12b1(0x1cb)])['join'](',\x20');return console[_0x4c12b1(0x1d4)](_0x4c12b1(0x1e8)+_0x3af859+_0x4c12b1(0xd7)+_0x177af6),0x1;}const _0x4922be=await withSpinner('Getting\x20version\x20'+_0x3af859+_0x4c12b1(0x105),()=>_0x5b0593[_0x4c12b1(0x1ba)][_0x4c12b1(0x1c8)](_0x4fe33a[_0x4c12b1(0x1c2)]),{'verbose':_0x1c8207[_0x4c12b1(0x1b7)]}),_0x503ffb=_0x4922be['data'],_0x5461a2=getConsoleNextUrl(_0x1c8207[_0x4c12b1(0x164)],_0x4c12b1(0x169)+_0x174f61+_0x4c12b1(0x18f)+_0x4fe33a[_0x4c12b1(0x1c2)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x503ffb['id'],'name':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x113)],'version':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x1cb)],'description':_0x503ffb['attributes'][_0x4c12b1(0x139)],'state':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x1d2)],'paused':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x1ec)],'reentry_mode':_0x503ffb['attributes'][_0x4c12b1(0x197)],'stages':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x16d)]?.[_0x4c12b1(0x198)]||0x0,..._0x503ffb['attributes'][_0x4c12b1(0x1c5)]&&{'goal':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x1c5)]['name']},'latest':_0x4fe33a['journeyId']===_0x49ec5f,'created_at':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0xef)],'updated_at':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0xe1)],'url':_0x5461a2},_0x1c8207),0x0;}}function a27_0x43f2(){const _0x2b06d0=['resolveParentId','add','journeyBundleName','yes','links','localeCompare','12YJCwOS','Available\x20stages:\x20','has','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)','(running)','\x20\x20←\x20','✔\x20Journey\x20\x22','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20details...','Fetching\x20','Fetching\x20journey\x20','getTrafficData','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','status','test','Show\x20journey\x20statistics','includeHistory','targetDir','Cancelled','\x20\x20Statistics\x20not\x20available','cyan','scheduleType','name','entries','table','folderPath','Parent\x20segment\x20ID:','Found\x20','journey:version:view','completeMilestoneRate','-\x20no\x20files\x20written','workflowSessionId','audienceId','journeyBundleId','dim','Show\x20journey\x20details','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','655155DaPSOq','connector_config','content','listJourneysFromParentSegment','size','bold','Table:\x20','data','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','10UAlGCu','jsonl','segments','user','(root)','Stages:','helpText','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','rule','parentSegment','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Paused:','then','description','\x20\x20Name:\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','from','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','nodes','journey:pause','\x22\x20resumed','.yml','Resolving\x20parent\x20segment...','/j/da','stages','\x20\x20Preserving\x20local\x20segment\x20name:\x20','get','attributes','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','format','yellow','push','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Error:\x20Stage\x20\x22','base','parent_segment','List\x20activations\x20for\x20a\x20journey','resolveSegment','\x20\x20Target:\x20','\x20new\x20files','relative','journey:push','type','(none)','activation','Pause\x20a\x20running\x20journey','\x0aPull\x20summary:','connection','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getLatestJourneyId','conversion','buildIdToNameMap','tsv','limit','workflowId','listVersions','site','Write\x20','options','\x0aChanges\x20to\x20\x27','red','/app/ps/','journey:version:create','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Getting\x20journey\x20details...','journeyStages','toLowerCase','Target\x20file:\x20','setPhase','Getting\x20journey\x20statistics...','\x20(ID:\x20','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','Resume\x20a\x20paused\x20journey','(unnamed)','runAfterJourneyRefresh','✔\x20All\x20files\x20are\x20up\x20to\x20date','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','web','kind','file','createVersion','renderStats','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Error:\x20Invalid\x20--type\x20\x22','journey:activations','Status:','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','✔\x20Found\x20','session','\x20@\x20','listFolders','replace','message','root\x20folder','✔\x20Pulled\x20','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','draft','getParentFull','resume','/e/','Error:\x20Parent\x20segment\x20context\x20required','Warning:\x20Could\x20not\x20resolve\x20segment\x20','✔\x20Context\x20set:\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20','no_parent','reentryMode','length','run','1710000hsmqpu','cwd','\x20files?','values','map','(archived)','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','journey:versions','folders','Session:','Export\x20journey(s)\x20as\x20YAML\x20files','hasChanges','Getting\x20column\x20mapping...','State:','journeyName','Activations:','pause','INVALID_ARGUMENT','dryRun','\x20versions)','\x20Created\x20v','activation_','...','hasPeriod','join','Database:\x20','repeat','(draft)','segment','verbose','exitOrJumpRate','Fetching\x20parent\x20segment...','journey','\x20\x20Journey\x20ID:\x20','milestoneSize','find','Resolving\x20version...','folderId','/j/da/je','\x20[runs\x20on\x20refresh]','journeyId','exitOrJumpSize','stage','goal','Options:','8660061egREUY','getJourney','\x5c$&','errorCode','versionNumber','Folder\x20path:\x20','resourceName','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x27\x20not\x20found\x20in\x20','\x20journey\x20files\x20to\x20','connectionId','state','\x20journeys','error','(completed)','database','args','history','\x20(draft)\x20—\x20\x22','⚠️\x20','\x22\x20not\x20found','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','ID:','Pausing\x20journey...','goalSize','Target\x20directory:\x20','13903OwTmUD','472508ChMbvj','json','none','journey:pull','sort','\x20(rule\x20match)','Error:\x20Version\x20','set','filter','Error:\x20Journey\x20\x27','paused','Error:\x20--version\x20option\x20is\x20required','Warning:\x20Could\x20not\x20resolve\x20activation\x20','utf-8','journey:resume','Journey:','execute','getColumnMapping','Input:\x20','diff','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Resolving\x20journey...','columns','enteredSize','tdx.json','pausedAt','Fetching\x20journeys\x20and\x20folders...','journey:view','segmentName','2450336QSLLXk','runAt','2320759VbJhtq','58wSsNoi','connection\x20','\x20=\x20','executeDryRun','\x20->\x20','getSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','buildIdToEmailMap','Listing\x20journey\x20activations...','launched','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20not\x20found.\x20Available:\x20','stageNameMap','\x20Journey\x20workflow\x20started','Journey\x20name:\x20','segmentPushCommand','all','Parent\x20segment:\x20','activationParams','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Journey\x20not\x20found:\x20','updatedAt','isNew','completed','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','\x20changed\x20files','version','no\x20connection','listActivationsFlat','parentName','\x20version','Triggering\x20journey\x20workflow...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','getActivation','green','createdAt','No\x20statistics\x20available\x20for\x20journey:\x20','getStatistics','log','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x0aError:','journey:stats','\x20journey'];a27_0x43f2=function(){return _0x2b06d0;};return a27_0x43f2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0xe18124=a28_0x5264;(function(_0x35542a,_0x1ad89d){const _0x4f27af=a28_0x5264,_0x359559=_0x35542a();while(!![]){try{const _0x2d537c=parseInt(_0x4f27af(0x1b9))/0x1*(parseInt(_0x4f27af(0x18d))/0x2)+parseInt(_0x4f27af(0x1b7))/0x3+parseInt(_0x4f27af(0x1a5))/0x4+-parseInt(_0x4f27af(0x193))/0x5+parseInt(_0x4f27af(0x1b6))/0x6+-parseInt(_0x4f27af(0x18e))/0x7*(-parseInt(_0x4f27af(0x1af))/0x8)+-parseInt(_0x4f27af(0x18f))/0x9;if(_0x2d537c===_0x1ad89d)break;else _0x359559['push'](_0x359559['shift']());}catch(_0xe216fb){_0x359559['push'](_0x359559['shift']());}}}(a28_0x128f,0xa8d88));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x5264(_0x2c8b4e,_0x2e958c){_0x2c8b4e=_0x2c8b4e-0x18a;const _0x128f39=a28_0x128f();let _0x526458=_0x128f39[_0x2c8b4e];return _0x526458;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x55ce53 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0x128f(){const _0x577828=['2210106hEatWT','3028362SPVdii','\x20warning(s)','11833UVpDlv','green','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose','Validate\x20journey\x20YAML\x20files','parentSegment','name','.yml','type','execute','relativePath','helpText','88KPEERk','34923dGoyPk','5729544wufYlY','validCount','no_parent','skippedCount','5031410bELfll','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Validation\x20failed:\x20','\x20valid','\x20warning(s)\x20found','endsWith','warnings','file','errorCode','journey:validate','✔\x20All\x20','invalidCount','cwd','log','error','valid','filter','red','1524616AswMhJ','cyan','Error:\x20','targetDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','journey','Error:\x20Directory\x20not\x20found:\x20','warningCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20error(s)','88VUHFxh','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','reason','\x20journey(s)\x20valid','length','dim'];a28_0x128f=function(){return _0x577828;};return a28_0x128f();}export class JourneyValidateCommand extends BaseCommand{[a28_0xe18124(0x1bf)]=a28_0xe18124(0x19c);['description']=a28_0xe18124(0x1bd);async[a28_0xe18124(0x18a)](_0x1c1d64){const _0x15cc1e=a28_0xe18124,{options:_0x54344e,args:_0x3949c4}=_0x1c1d64,_0x52238d=_0x54344e,_0x46b975=await resolveTarget({'arg':_0x3949c4[0x0],'contextParent':_0x54344e[_0x15cc1e(0x1be)],'cwd':process[_0x15cc1e(0x19f)]()});if(!isSuccessfulResolution(_0x46b975))return _0x46b975[_0x15cc1e(0x19b)]===_0x15cc1e(0x191)?(console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1b0)](_0x15cc1e(0x194))),console[_0x15cc1e(0x1a1)](_0x15cc1e(0x1bb)),console[_0x15cc1e(0x1a1)](_0x15cc1e(0x1a9)),console[_0x15cc1e(0x1a1)](_0x15cc1e(0x1b1))):(console['error'](a28_0x55ce53['red'](_0x15cc1e(0x1a7)+_0x46b975['message']+'\x0a')),_0x46b975[_0x15cc1e(0x18c)]&&console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1a6)](_0x46b975[_0x15cc1e(0x18c)]))),0x1;const _0x52c47c=_0x46b975[_0x15cc1e(0x1a8)],_0x3e83b7=_0x46b975[_0x15cc1e(0x1c1)]===_0x15cc1e(0x19a)?_0x46b975['filePath']:undefined;if(!_0x3e83b7&&!existsSync(_0x52c47c))return console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1a4)](_0x15cc1e(0x1ab)+_0x52c47c+'\x0a')),0x1;let _0x1743ae;if(_0x3e83b7){if(!_0x3e83b7[_0x15cc1e(0x198)](_0x15cc1e(0x1c0))&&!_0x3e83b7[_0x15cc1e(0x198)]('.yaml'))return console['error'](a28_0x55ce53[_0x15cc1e(0x1a4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3e83b7+'\x0a')),0x1;_0x1743ae=[_0x3e83b7];}else _0x1743ae=findYamlFiles(_0x52c47c);if(_0x1743ae[_0x15cc1e(0x1b4)]===0x0)return console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1a4)](_0x15cc1e(0x1ad)+_0x52c47c+'\x0a')),0x1;const _0x39546b=validateYamlFiles(_0x1743ae,_0x52c47c,{'filterType':_0x15cc1e(0x1aa)}),_0x21e81d=calculateSummary(_0x39546b),_0x46a1e0=_0x39546b[_0x15cc1e(0x1a3)](isValidationResult);if(_0x46a1e0[_0x15cc1e(0x1b4)]===0x0)return console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1b0)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x52c47c+'\x0a')),_0x21e81d['skippedCount']>0x0&&console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1b5)]('('+_0x21e81d[_0x15cc1e(0x192)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x16675c of _0x39546b){if(!isValidationResult(_0x16675c)){_0x52238d['verbose']&&console[_0x15cc1e(0x1a0)](a28_0x55ce53['dim']('-\x20'+_0x16675c[_0x15cc1e(0x18b)]+'\x20(skipped:\x20'+_0x16675c[_0x15cc1e(0x1b2)]+')'));continue;}const {relativePath:_0x5b16a0,source:_0x1843cd,result:_0x1d0b34}=_0x16675c;if(_0x1d0b34[_0x15cc1e(0x1a2)]&&_0x1d0b34[_0x15cc1e(0x199)][_0x15cc1e(0x1b4)]===0x0)_0x52238d[_0x15cc1e(0x1bc)]&&console['log'](a28_0x55ce53[_0x15cc1e(0x1ba)]('✔\x20'+_0x5b16a0));else _0x1d0b34[_0x15cc1e(0x1a2)]?(console[_0x15cc1e(0x1a0)](a28_0x55ce53[_0x15cc1e(0x1b0)]('⚠\x20'+_0x5b16a0+':\x20'+_0x1d0b34[_0x15cc1e(0x199)][_0x15cc1e(0x1b4)]+_0x15cc1e(0x1b8))),console[_0x15cc1e(0x1a0)](formatValidationResult(_0x1d0b34,_0x1843cd,_0x5b16a0))):(console['log'](a28_0x55ce53[_0x15cc1e(0x1a4)]('✖\x20'+_0x5b16a0+':\x20'+_0x1d0b34['errors'][_0x15cc1e(0x1b4)]+_0x15cc1e(0x1ae))),console['log'](formatValidationResult(_0x1d0b34,_0x1843cd,_0x5b16a0)));}return console[_0x15cc1e(0x1a0)](''),_0x21e81d['hasErrors']?(console[_0x15cc1e(0x1a0)](a28_0x55ce53[_0x15cc1e(0x1a4)](_0x15cc1e(0x195)+_0x21e81d[_0x15cc1e(0x19e)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x21e81d[_0x15cc1e(0x190)]+_0x15cc1e(0x196))),_0x21e81d[_0x15cc1e(0x1ac)]>0x0&&console['log'](a28_0x55ce53[_0x15cc1e(0x1b0)](_0x21e81d[_0x15cc1e(0x1ac)]+'\x20warning(s)\x20found')),_0x21e81d[_0x15cc1e(0x192)]>0x0&&console[_0x15cc1e(0x1a0)](a28_0x55ce53['dim'](_0x21e81d[_0x15cc1e(0x192)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x15cc1e(0x1a0)](a28_0x55ce53[_0x15cc1e(0x1ba)](_0x15cc1e(0x19d)+_0x21e81d[_0x15cc1e(0x190)]+_0x15cc1e(0x1b3))),_0x21e81d[_0x15cc1e(0x1ac)]>0x0&&console['log'](a28_0x55ce53[_0x15cc1e(0x1b0)](_0x21e81d[_0x15cc1e(0x1ac)]+_0x15cc1e(0x197))),_0x21e81d[_0x15cc1e(0x192)]>0x0&&console[_0x15cc1e(0x1a0)](a28_0x55ce53['dim'](_0x21e81d['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x0);}}
|