@treasuredata/tdx 2026.5.1 → 2026.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.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/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.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/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/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_0x68e686=a24_0x140d;function a24_0x6a76(){const _0x1eb790=['error','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','execute','configDir','\x0aPush\x20summary\x20for\x20workspace\x20\x27','templateId','Workspace\x20is\x20required.','site','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','dim','path','906194cPjRxX','setPhase','\x20errors:','✔\x20Created\x20','Aborted.','1188222QTFJgv','✔\x20Updated\x20','-\x20no\x20changes\x20applied','valid','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4755996CBpdmf','1\x20template\x20file:\x20','1168904jcwqWq','created','updated','\x20new\x20templates:','length','\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','name','yes','def','cwd','\x0aError:','message','81JnXPbQ','\x27...','Push\x20','\x20templates','1418130gmvaED','results','workspace','Found\x20','engage_workspace','dirname','cyan','\x20templates\x20to\x20update:','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\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','red','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','yellow','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','config','651388tMXVAA','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','session','engage','engage:template:push','4053126EcDprB','warnings','action','resolve','data','\x20templates?','Preparing\x20push\x20to\x20workspace\x20\x27','green','errors','verbose','dryRun','20zwkQxm','\x20\x20\x20\x20'];a24_0x6a76=function(){return _0x1eb790;};return a24_0x6a76();}(function(_0x20f017,_0xe5e209){const _0x401464=a24_0x140d,_0x121420=_0x20f017();while(!![]){try{const _0x1b22b9=parseInt(_0x401464(0x1e5))/0x1+parseInt(_0x401464(0x201))/0x2+-parseInt(_0x401464(0x1ea))/0x3+parseInt(_0x401464(0x210))/0x4*(parseInt(_0x401464(0x1d8))/0x5)+parseInt(_0x401464(0x215))/0x6+-parseInt(_0x401464(0x1ef))/0x7+-parseInt(_0x401464(0x1f1))/0x8*(parseInt(_0x401464(0x1fd))/0x9);if(_0x1b22b9===_0xe5e209)break;else _0x121420['push'](_0x121420['shift']());}catch(_0x441423){_0x121420['push'](_0x121420['shift']());}}}(a24_0x6a76,0x86ae1));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_0xa2eb78 from'chalk';import a24_0x515500 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';function a24_0x140d(_0x334359,_0x431177){_0x334359=_0x334359-0x1d7;const _0x6a76cf=a24_0x6a76();let _0x140d20=_0x6a76cf[_0x334359];return _0x140d20;}import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x68e686(0x1f7)]=a24_0x68e686(0x214);['description']=a24_0x68e686(0x1e2);async[a24_0x68e686(0x1dc)](_0x124e87){const _0x36de03=a24_0x68e686,{options:_0x32af02,args:_0x20d234,tdx:_0x389cfd}=_0x124e87,_0x3ac680=_0x32af02,_0x1dc06a=_0x20d234[0x0],_0x87d8ef=_0x1dc06a?a24_0x515500[_0x36de03(0x218)](_0x1dc06a):undefined,_0x4b1792=_0x87d8ef?isYamlFile(_0x87d8ef):![];let _0x567138;if(_0x4b1792&&_0x87d8ef)_0x567138=a24_0x515500[_0x36de03(0x206)](_0x87d8ef);else _0x87d8ef?_0x567138=_0x87d8ef:_0x567138=process[_0x36de03(0x1fa)]();let _0xa171db;const _0x490854=tryFindTdxConfig(_0x567138);_0x490854?.[_0x36de03(0x20f)]['engage_workspace']&&(_0xa171db=_0x490854[_0x36de03(0x20f)]['engage_workspace'],!_0x4b1792&&(_0x567138=_0x490854[_0x36de03(0x1dd)]));_0x3ac680[_0x36de03(0x203)]&&(_0xa171db=_0x3ac680[_0x36de03(0x203)]);if(!_0xa171db){const _0x241507=loadSessionContext(_0x3ac680[_0x36de03(0x212)]);_0x241507?.[_0x36de03(0x205)]&&(_0xa171db=_0x241507[_0x36de03(0x205)]);}if(!_0xa171db)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x1e0))),console['error'](_0x36de03(0x20a)),console[_0x36de03(0x1da)](_0x36de03(0x1db)),console[_0x36de03(0x1da)](_0x36de03(0x1f6)),console[_0x36de03(0x1da)](_0x36de03(0x209)),0x1;let _0x4ba940;_0x4b1792&&_0x87d8ef?_0x4ba940=[parseTemplateFile(_0x87d8ef,a24_0x515500[_0x36de03(0x206)](_0x87d8ef))]:_0x4ba940=discoverAndParseTemplateFiles(_0x567138);if(_0x4ba940[_0x36de03(0x1f5)]===0x0)return console['error'](a24_0xa2eb78[_0x36de03(0x20d)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x567138)),console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x1e3)](_0x36de03(0x20e))),0x1;const _0x1487b4=_0x4ba940[_0x36de03(0x1f5)]===0x1?_0x36de03(0x1f0)+_0x4ba940[0x0][_0x36de03(0x1f9)][_0x36de03(0x1f7)]:_0x4ba940[_0x36de03(0x1f5)]+'\x20template\x20files';console[_0x36de03(0x1da)](_0x36de03(0x204)+a24_0xa2eb78[_0x36de03(0x207)](_0x1487b4));let _0x1c0361=![];for(const _0x391045 of _0x4ba940){const _0x1cc900=validateTemplateDef(_0x391045[_0x36de03(0x1f9)]);if(!_0x1cc900[_0x36de03(0x1ed)]){_0x1c0361=!![],console['error'](a24_0xa2eb78[_0x36de03(0x20b)]('\x0aValidation\x20errors\x20in\x20'+_0x391045['relativePath']+':'));for(const _0x41278d of _0x1cc900[_0x36de03(0x21d)]){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78['red']('✗')+'\x20'+_0x41278d[_0x36de03(0x1e4)]+':\x20'+_0x41278d[_0x36de03(0x1fc)]);}}for(const _0x2c5d6b of _0x1cc900[_0x36de03(0x216)]){console['error']('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20d)]('⚠')+'\x20'+_0x2c5d6b['path']+':\x20'+_0x2c5d6b['message']);}}if(_0x1c0361)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20b)](_0x36de03(0x211))),0x1;const _0x5e1b8f=await _0x389cfd[_0x36de03(0x213)]['resolveWorkspaceId'](_0xa171db),_0x4161f7=await withProgressSpinner(_0x36de03(0x21b)+_0xa171db+_0x36de03(0x1fe),_0x1c6851=>preparePush({'engage':_0x389cfd['engage']},_0x4ba940,_0x5e1b8f,{'progress':{'update':_0x5281b3=>_0x1c6851[_0x36de03(0x1e6)](_0x5281b3)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]}),_0x270bda=_0x4161f7[_0x36de03(0x219)];await withProgressSpinner('Resolving\x20references...',_0x3a253e=>resolveAndBuildInputs({'engage':_0x389cfd[_0x36de03(0x213)]},_0x270bda,_0x5e1b8f,{'progress':{'update':_0xfdc96=>_0x3a253e[_0x36de03(0x1e6)](_0xfdc96)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]});const _0x54bff2=_0x270bda['filter'](_0x5cf4d8=>_0x5cf4d8[_0x36de03(0x217)]==='create'),_0x3831b9=_0x270bda['filter'](_0x4fe271=>_0x4fe271['action']==='update');console[_0x36de03(0x1da)](_0x36de03(0x1de)+_0xa171db+'\x27:');if(_0x54bff2[_0x36de03(0x1f5)]>0x0){console['error']('\x20\x20'+a24_0xa2eb78[_0x36de03(0x21c)]('+\x20'+_0x54bff2[_0x36de03(0x1f5)]+_0x36de03(0x1f4)));for(const _0x561c3e of _0x54bff2){console[_0x36de03(0x1da)]('\x20\x20\x20\x20'+a24_0xa2eb78[_0x36de03(0x21c)]('+')+'\x20'+_0x561c3e[_0x36de03(0x1f9)][_0x36de03(0x1f7)]);}}if(_0x3831b9['length']>0x0){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20d)]('~\x20'+_0x3831b9['length']+_0x36de03(0x208)));for(const _0xe60fb0 of _0x3831b9){console[_0x36de03(0x1da)](_0x36de03(0x1d9)+a24_0xa2eb78[_0x36de03(0x20d)]('~')+'\x20'+_0xe60fb0[_0x36de03(0x1f9)][_0x36de03(0x1f7)]);}}if(_0x54bff2[_0x36de03(0x1f5)]===0x0&&_0x3831b9[_0x36de03(0x1f5)]===0x0)return console['error'](a24_0xa2eb78[_0x36de03(0x21c)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x3ac680[_0x36de03(0x1d7)])return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x20c))),0x0;if(!_0x3ac680[_0x36de03(0x1f8)]){if(!isInteractive())return console['error'](a24_0xa2eb78['red'](_0x36de03(0x1fb)),_0x36de03(0x1ee)),console['error'](a24_0xa2eb78[_0x36de03(0x1e3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x28ddba=await confirmKey(_0x36de03(0x1ff)+(_0x54bff2[_0x36de03(0x1f5)]+_0x3831b9[_0x36de03(0x1f5)])+_0x36de03(0x21a));if(!_0x28ddba)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x1e9)),_0x36de03(0x1ec)),0x1;}const _0x2a87dc=await withProgressSpinner('Pushing\x20templates...',_0xb89116=>executePush({'engage':_0x389cfd[_0x36de03(0x213)]},_0x270bda,{'progress':{'update':_0x19f8c3=>_0xb89116[_0x36de03(0x1e6)](_0x19f8c3)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]}),_0x130c00=_0x2a87dc[_0x36de03(0x219)];for(const _0x35b96c of _0x130c00[_0x36de03(0x202)]){if(_0x35b96c[_0x36de03(0x1df)]&&(_0x35b96c[_0x36de03(0x217)]==='created'||_0x35b96c[_0x36de03(0x217)]==='updated')){const _0x5afb2f=getTemplateUrl(_0x3ac680[_0x36de03(0x1e1)],_0x5e1b8f,_0x35b96c['templateId']),_0x5475e0=_0x35b96c['action']===_0x36de03(0x1f2)?'+':'~',_0x2263cc=_0x35b96c['action']===_0x36de03(0x1f2)?a24_0xa2eb78[_0x36de03(0x21c)](_0x5475e0):a24_0xa2eb78[_0x36de03(0x20d)](_0x5475e0);console[_0x36de03(0x1da)]('\x20\x20'+_0x2263cc+'\x20'+hyperlink(_0x35b96c[_0x36de03(0x1f7)],_0x5afb2f)+'\x20'+a24_0xa2eb78['dim'](_0x5afb2f));}}_0x130c00[_0x36de03(0x1f2)]>0x0&&console[_0x36de03(0x1da)](a24_0xa2eb78['green'](_0x36de03(0x1e8)+_0x130c00[_0x36de03(0x1f2)]+_0x36de03(0x200)));_0x130c00[_0x36de03(0x1f3)]>0x0&&console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x21c)](_0x36de03(0x1eb)+_0x130c00['updated']+'\x20templates'));if(_0x130c00[_0x36de03(0x21d)][_0x36de03(0x1f5)]>0x0){console['error'](a24_0xa2eb78[_0x36de03(0x20b)]('✘\x20'+_0x130c00['errors'][_0x36de03(0x1f5)]+_0x36de03(0x1e7)));for(const _0x2c8b30 of _0x130c00['errors']){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20b)](_0x2c8b30['name'])+':\x20'+_0x2c8b30[_0x36de03(0x1da)]);}}return saveSessionContext({'engage_workspace':_0xa171db},_0x3ac680[_0x36de03(0x212)]),_0x130c00['errors']['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x1a5d74=a25_0x3e7d;function a25_0x2ad6(){const _0x5380ca=['yellow','9VMJsWn','resolve','.yaml','8utjKrL','1584772vOglsJ','cwd','warnings','\x20(skipped:\x20','reason','16498TEIbOF','Validate\x20template\x20YAML\x20files','\x20template(s)\x20with\x20errors,\x20','\x20non-template\x20file(s)\x20skipped)','Error:\x20Directory\x20not\x20found:\x20','skippedCount','red','\x20non-template\x20file(s)\x20skipped','2531331UDxQkQ','name','339410lbjbkZ','errors','error','length','validCount','25302pLDFdz','execute','endsWith','description','log','warningCount','engage:template:validate','11886700rAXpcG','invalidCount','440GMaTeY','verbose','1551837wgWCcp','\x20template(s)\x20valid','\x20warning(s)','.yml','No\x20template\x20YAML\x20files\x20found\x20in\x20','valid','template','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a25_0x2ad6=function(){return _0x5380ca;};return a25_0x2ad6();}(function(_0x136520,_0x58a558){const _0x586ea8=a25_0x3e7d,_0x35aa77=_0x136520();while(!![]){try{const _0x5ebd7f=parseInt(_0x586ea8(0x1c9))/0x1+-parseInt(_0x586ea8(0x1bf))/0x2*(parseInt(_0x586ea8(0x1e2))/0x3)+-parseInt(_0x586ea8(0x1ba))/0x4+parseInt(_0x586ea8(0x1d7))/0x5*(-parseInt(_0x586ea8(0x1ce))/0x6)+-parseInt(_0x586ea8(0x1d9))/0x7*(parseInt(_0x586ea8(0x1b9))/0x8)+-parseInt(_0x586ea8(0x1c7))/0x9+parseInt(_0x586ea8(0x1d5))/0xa;if(_0x5ebd7f===_0x58a558)break;else _0x35aa77['push'](_0x35aa77['shift']());}catch(_0x3da7f2){_0x35aa77['push'](_0x35aa77['shift']());}}}(a25_0x2ad6,0x38e86));function a25_0x3e7d(_0x5e6e73,_0x28ae06){_0x5e6e73=_0x5e6e73-0x1b9;const _0x2ad647=a25_0x2ad6();let _0x3e7da9=_0x2ad647[_0x5e6e73];return _0x3e7da9;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x3de6ff from'chalk';import a25_0x4a1a70 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x1a5d74(0x1c8)]=a25_0x1a5d74(0x1d4);[a25_0x1a5d74(0x1d1)]=a25_0x1a5d74(0x1c0);async[a25_0x1a5d74(0x1cf)](_0x294428){const _0x153d90=a25_0x1a5d74,{options:_0x3002eb,args:_0x1c36cd}=_0x294428,_0x59875d=_0x3002eb,_0x254165=_0x1c36cd[0x0],_0x24e57e=_0x254165?a25_0x4a1a70[_0x153d90(0x1e3)](_0x254165):undefined,_0x547264=_0x24e57e?isYamlFile(_0x24e57e):![];let _0x41816b,_0xadb725;if(_0x547264&&_0x24e57e)_0x41816b=a25_0x4a1a70['dirname'](_0x24e57e),_0xadb725=_0x24e57e;else _0x24e57e?_0x41816b=_0x24e57e:_0x41816b=process[_0x153d90(0x1bb)]();if(!_0xadb725&&!existsSync(_0x41816b))return console[_0x153d90(0x1cb)](a25_0x3de6ff['red'](_0x153d90(0x1c3)+_0x41816b+'\x0a')),0x1;let _0x506298;if(_0xadb725){if(!_0xadb725[_0x153d90(0x1d0)](_0x153d90(0x1dc))&&!_0xadb725[_0x153d90(0x1d0)](_0x153d90(0x1e4)))return console[_0x153d90(0x1cb)](a25_0x3de6ff['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xadb725+'\x0a')),0x1;_0x506298=[_0xadb725];}else _0x506298=findYamlFiles(_0x41816b);if(_0x506298[_0x153d90(0x1cc)]===0x0)return console[_0x153d90(0x1cb)](a25_0x3de6ff['red'](_0x153d90(0x1e0)+_0x41816b+'\x0a')),0x1;const _0x55090e=validateYamlFiles(_0x506298,_0x41816b,{'filterType':_0x153d90(0x1df)}),_0x364ac0=calculateSummary(_0x55090e),_0x4b69a2=_0x55090e['filter'](isValidationResult);if(_0x4b69a2[_0x153d90(0x1cc)]===0x0)return console[_0x153d90(0x1cb)](a25_0x3de6ff['yellow'](_0x153d90(0x1dd)+_0x41816b+'\x0a')),_0x364ac0[_0x153d90(0x1c4)]>0x0&&console[_0x153d90(0x1cb)](a25_0x3de6ff['dim']('('+_0x364ac0[_0x153d90(0x1c4)]+_0x153d90(0x1c2))),0x0;for(const _0x5874cc of _0x55090e){if(!isValidationResult(_0x5874cc)){_0x59875d[_0x153d90(0x1d8)]&&console[_0x153d90(0x1d2)](a25_0x3de6ff['dim']('-\x20'+_0x5874cc['relativePath']+_0x153d90(0x1bd)+_0x5874cc[_0x153d90(0x1be)]+')'));continue;}const {relativePath:_0x31e140,source:_0x555b14,result:_0x1734e4}=_0x5874cc;if(_0x1734e4[_0x153d90(0x1de)]&&_0x1734e4[_0x153d90(0x1bc)][_0x153d90(0x1cc)]===0x0)_0x59875d[_0x153d90(0x1d8)]&&console[_0x153d90(0x1d2)](a25_0x3de6ff['green']('✔\x20'+_0x31e140));else _0x1734e4[_0x153d90(0x1de)]?(console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1e1)]('⚠\x20'+_0x31e140+':\x20'+_0x1734e4[_0x153d90(0x1bc)]['length']+_0x153d90(0x1db))),console[_0x153d90(0x1d2)](formatValidationResult(_0x1734e4,_0x555b14,_0x31e140))):(console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1c5)]('✖\x20'+_0x31e140+':\x20'+_0x1734e4[_0x153d90(0x1ca)][_0x153d90(0x1cc)]+'\x20error(s)')),console[_0x153d90(0x1d2)](formatValidationResult(_0x1734e4,_0x555b14,_0x31e140)));}return console[_0x153d90(0x1d2)](''),_0x364ac0['hasErrors']?(console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1c5)]('Validation\x20failed:\x20'+_0x364ac0[_0x153d90(0x1d6)]+_0x153d90(0x1c1)+_0x364ac0['validCount']+'\x20valid')),_0x364ac0['warningCount']>0x0&&console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1e1)](_0x364ac0[_0x153d90(0x1d3)]+'\x20warning(s)\x20found')),_0x364ac0[_0x153d90(0x1c4)]>0x0&&console[_0x153d90(0x1d2)](a25_0x3de6ff['dim'](_0x364ac0[_0x153d90(0x1c4)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x153d90(0x1d2)](a25_0x3de6ff['green']('✔\x20All\x20'+_0x364ac0[_0x153d90(0x1cd)]+_0x153d90(0x1da))),_0x364ac0[_0x153d90(0x1d3)]>0x0&&console[_0x153d90(0x1d2)](a25_0x3de6ff[_0x153d90(0x1e1)](_0x364ac0[_0x153d90(0x1d3)]+'\x20warning(s)\x20found')),_0x364ac0[_0x153d90(0x1c4)]>0x0&&console['log'](a25_0x3de6ff['dim'](_0x364ac0[_0x153d90(0x1c4)]+_0x153d90(0x1c6))),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_0x16265d=a26_0x8100;(function(_0x126985,_0x14699d){const _0x283a9e=a26_0x8100,_0x25579b=_0x126985();while(!![]){try{const _0x45457c=-parseInt(_0x283a9e(0x1c0))/0x1*(parseInt(_0x283a9e(0x1b9))/0x2)+-parseInt(_0x283a9e(0x1a4))/0x3*(parseInt(_0x283a9e(0x1c1))/0x4)+parseInt(_0x283a9e(0x1bc))/0x5*(-parseInt(_0x283a9e(0x1ac))/0x6)+parseInt(_0x283a9e(0x1d6))/0x7*(parseInt(_0x283a9e(0x193))/0x8)+parseInt(_0x283a9e(0x1c7))/0x9+-parseInt(_0x283a9e(0x191))/0xa*(parseInt(_0x283a9e(0x1d8))/0xb)+parseInt(_0x283a9e(0x1a8))/0xc*(parseInt(_0x283a9e(0x1e7))/0xd);if(_0x45457c===_0x14699d)break;else _0x25579b['push'](_0x25579b['shift']());}catch(_0x2c1813){_0x25579b['push'](_0x25579b['shift']());}}}(a26_0xfd63,0x5dfc7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a26_0xfd63(){const _0x1f8a12=['Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','round','\x20row','success','Show\x20job\x20details','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','substring','presto','join','d\x20ago','push','130686bdOsHC','priority','✔\x20Job\x20submitted','database','44376wWFJsD','end_at','Database:\x20','trino','2999556urORqm','No\x20SQL\x20statements\x20found\x20in\x20file','map','user_name','now','job_id','args','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','start_at','site','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','execute','4BFHvjg','status','error','5wFaHCg','List\x20jobs','length','Submit\x20a\x20job','97943WYLQyx','44KQtXEV','INVALID_ARGUMENT','kill','✔\x20Retrieved\x20','jobs','getTime','5653116eoHPTE','validate','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job:kill','\x20jobs','yes','floor','data','mo\x20ago','verbose','limit','Get\x20job\x20results','Status\x20filter:\x20','created_at','information_schema','68656aZalJO','result','133617AfpSZZ','name','type','description','file','Submitting\x20kill\x20request...','dim','Listing\x20jobs...','debug','\x20job','submit','Submitting\x20job...','\x20\x20Job\x20ID:\x20','Cancelled','Getting\x20job\x20results...','2639InqvWz','h\x20ago','url','Limit:\x20','show','just\x20now','✔\x20Found\x20','190goJGVe','query','336kIBZmh','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','green','m\x20ago','abs'];a26_0xfd63=function(){return _0x1f8a12;};return a26_0xfd63();}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_0x2942b7 from'chalk';function formatDuration(_0x4c4e71){const _0x486441=a26_0x8100;if(_0x4c4e71<0x3c)return _0x4c4e71+'s';if(_0x4c4e71<0xe10)return Math[_0x486441(0x1cd)](_0x4c4e71/0x3c)+'m\x20'+_0x4c4e71%0x3c+'s';const _0x315548=Math['floor'](_0x4c4e71/0xe10),_0x1bb5ca=Math[_0x486441(0x1cd)](_0x4c4e71%0xe10/0x3c);return _0x1bb5ca>0x0?_0x315548+'h\x20'+_0x1bb5ca+'m':_0x315548+'h';}function formatRelativeTime(_0x1f994f){const _0x212f80=a26_0x8100,_0x5f3e81=Date[_0x212f80(0x1b0)]()-_0x1f994f[_0x212f80(0x1c6)](),_0x4a5aee=Math[_0x212f80(0x1cd)](Math[_0x212f80(0x198)](_0x5f3e81)/0x3e8);if(_0x4a5aee<0x3c)return _0x212f80(0x1ec);const _0x5a36c3=Math[_0x212f80(0x1cd)](_0x4a5aee/0x3c);if(_0x5a36c3<0x3c)return _0x5a36c3+_0x212f80(0x197);const _0x40a5a7=Math[_0x212f80(0x1cd)](_0x5a36c3/0x3c);if(_0x40a5a7<0x18)return _0x40a5a7+_0x212f80(0x1e8);const _0x5aaf8c=Math[_0x212f80(0x1cd)](_0x40a5a7/0x18);if(_0x5aaf8c<0x1e)return _0x5aaf8c+_0x212f80(0x1a2);return Math[_0x212f80(0x1cd)](_0x5aaf8c/0x1e)+_0x212f80(0x1cf);}export class JobListCommand extends BaseCommand{[a26_0x16265d(0x1d9)]=a26_0x16265d(0x1c5);['description']=a26_0x16265d(0x1bd);async[a26_0x16265d(0x1b8)](_0x3c3f70){const _0x447bf5=a26_0x16265d,{options:_0x531024,tdx:_0x11bb08}=_0x3c3f70,_0x3f6323=resolveLimit(_0x531024[_0x447bf5(0x1d1)],DEFAULT_DISPLAY_LIMIT),_0x179dbf=_0x531024[_0x447bf5(0x1ba)];_0x531024[_0x447bf5(0x1d0)]&&(console[_0x447bf5(0x1bb)](_0x447bf5(0x1ea)+_0x3f6323+_0x447bf5(0x1cb)),_0x179dbf&&console['error'](_0x447bf5(0x1d3)+_0x179dbf));const _0x4abb8f=await withSpinner(_0x447bf5(0x1df),()=>_0x11bb08['jobs']['list']({'from':0x0,'to':_0x3f6323-0x1,'status':_0x179dbf}),{'verbose':_0x531024['verbose']}),_0x5cb73e=_0x4abb8f['data'];console[_0x447bf5(0x1bb)](_0x447bf5(0x1ed)+_0x5cb73e['length']+_0x447bf5(0x1e1)+(_0x5cb73e[_0x447bf5(0x1be)]!==0x1?'s':''));const _0x58e974=_0x531024[_0x447bf5(0x1b6)];if(isStructuredFormat(_0x531024)){const _0xe48e57=_0x5cb73e[_0x447bf5(0x1ae)](_0x52f4eb=>{const _0x2ea552=_0x447bf5;let _0xce87c5;if(_0x52f4eb['start_at']&&_0x52f4eb[_0x2ea552(0x1a9)]){const _0x50a845=new Date(_0x52f4eb['start_at'])[_0x2ea552(0x1c6)](),_0x4bd04b=new Date(_0x52f4eb[_0x2ea552(0x1a9)])[_0x2ea552(0x1c6)]();_0xce87c5=Math[_0x2ea552(0x19a)]((_0x4bd04b-_0x50a845)/0x3e8);}return{'job_id':_0x52f4eb[_0x2ea552(0x1b1)],'type':_0x52f4eb[_0x2ea552(0x1da)]===_0x2ea552(0x1a0)?_0x2ea552(0x1ab):_0x52f4eb[_0x2ea552(0x1da)],'status':_0x52f4eb[_0x2ea552(0x1ba)],'user_name':_0x52f4eb[_0x2ea552(0x1af)],'duration_sec':_0xce87c5,'created_at':_0x52f4eb['created_at'],'started_at':_0x52f4eb[_0x2ea552(0x1b5)],'end_at':_0x52f4eb[_0x2ea552(0x1a9)]};});await handleSDKOutput(_0xe48e57,_0x531024);}else for(const _0x583ce2 of _0x5cb73e){const _0x69dc07=_0x583ce2[_0x447bf5(0x1ba)]===_0x447bf5(0x19c)?a26_0x2942b7[_0x447bf5(0x196)]:_0x583ce2[_0x447bf5(0x1ba)]==='error'?a26_0x2942b7['red']:a26_0x2942b7[_0x447bf5(0x1de)],_0x201de5=_0x69dc07(_0x583ce2[_0x447bf5(0x1ba)]),_0x18908e=getJobUrl(_0x58e974,_0x583ce2[_0x447bf5(0x1b1)]),_0x2ac982=hyperlink(_0x583ce2[_0x447bf5(0x1b1)],_0x18908e),_0x1bfef2=a26_0x2942b7[_0x447bf5(0x1de)](_0x583ce2[_0x447bf5(0x1da)]===_0x447bf5(0x1a0)?_0x447bf5(0x1ab):_0x583ce2[_0x447bf5(0x1da)]),_0x10a760=[];if(_0x583ce2[_0x447bf5(0x1b5)]&&_0x583ce2[_0x447bf5(0x1a9)]){const _0x4790b5=Math[_0x447bf5(0x19a)]((new Date(_0x583ce2[_0x447bf5(0x1a9)])[_0x447bf5(0x1c6)]()-new Date(_0x583ce2[_0x447bf5(0x1b5)])[_0x447bf5(0x1c6)]())/0x3e8);_0x10a760[_0x447bf5(0x1a3)](formatDuration(_0x4790b5));}if(_0x583ce2[_0x447bf5(0x1a9)])_0x10a760['push'](formatRelativeTime(new Date(_0x583ce2[_0x447bf5(0x1a9)])));else _0x583ce2[_0x447bf5(0x1b5)]&&_0x10a760[_0x447bf5(0x1a3)](formatRelativeTime(new Date(_0x583ce2[_0x447bf5(0x1b5)])));const _0x572600=_0x10a760[_0x447bf5(0x1be)]>0x0?a26_0x2942b7[_0x447bf5(0x1de)]('\x20'+_0x10a760[_0x447bf5(0x1a1)](',\x20')):'';console['log']('⚡\x20'+_0x2ac982+'\x20'+_0x1bfef2+'\x20'+_0x201de5+_0x572600);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x16265d(0x1d9)]='job:show';[a26_0x16265d(0x1db)]=a26_0x16265d(0x19d);['validate'](_0x1aa18a){const _0x1b86b3=a26_0x16265d,_0x3528c5=_0x1aa18a[_0x1b86b3(0x1b2)][0x0];if(!_0x3528c5)return _0x1b86b3(0x195);return undefined;}async[a26_0x16265d(0x1b8)](_0x4e5270){const _0x4ebf61=a26_0x16265d,{options:_0xcc61b1,args:_0x174b35,tdx:_0x48952d}=_0x4e5270,_0x1fa0c1=_0x174b35[0x0],_0x517201=await withSpinner('Getting\x20job\x20details...',()=>_0x48952d[_0x4ebf61(0x1c5)][_0x4ebf61(0x1eb)](_0x1fa0c1),{'verbose':_0xcc61b1[_0x4ebf61(0x1d0)]}),_0x4bc12a=_0x517201[_0x4ebf61(0x1ce)];let _0x3a56c2;if(_0x4bc12a[_0x4ebf61(0x1b5)]&&_0x4bc12a['end_at']){const _0x417c4c=new Date(_0x4bc12a['start_at'])[_0x4ebf61(0x1c6)](),_0x329909=new Date(_0x4bc12a[_0x4ebf61(0x1a9)])[_0x4ebf61(0x1c6)]();_0x3a56c2=Math[_0x4ebf61(0x19a)]((_0x329909-_0x417c4c)/0x3e8);}const _0x4e75bb={'job_id':_0x4bc12a[_0x4ebf61(0x1b1)],'type':_0x4bc12a[_0x4ebf61(0x1da)],'status':_0x4bc12a[_0x4ebf61(0x1ba)],..._0x4bc12a[_0x4ebf61(0x1af)]&&{'user_name':_0x4bc12a[_0x4ebf61(0x1af)]},..._0x3a56c2!==undefined&&{'duration_sec':_0x3a56c2},..._0x4bc12a[_0x4ebf61(0x1d4)]&&{'created_at':_0x4bc12a[_0x4ebf61(0x1d4)]},..._0x4bc12a['start_at']&&{'started_at':_0x4bc12a[_0x4ebf61(0x1b5)]},..._0x4bc12a['end_at']&&{'end_at':_0x4bc12a['end_at']},..._0x4bc12a[_0x4ebf61(0x1a7)]&&{'database':_0x4bc12a[_0x4ebf61(0x1a7)]},..._0x4bc12a['priority']!==undefined&&{'priority':_0x4bc12a[_0x4ebf61(0x1a5)]},..._0x4bc12a[_0x4ebf61(0x1e9)]&&{'url':_0x4bc12a[_0x4ebf61(0x1e9)]},..._0x4bc12a['query']&&{'query':_0x4bc12a[_0x4ebf61(0x192)]},..._0x4bc12a['debug']&&{'debug':_0x4bc12a[_0x4ebf61(0x1e0)]}};return await handleSingleObjectOutput(_0x4e75bb,_0xcc61b1),0x0;}}function a26_0x8100(_0x18830e,_0x2597b8){_0x18830e=_0x18830e-0x191;const _0xfd6382=a26_0xfd63();let _0x8100c0=_0xfd6382[_0x18830e];return _0x8100c0;}export class JobKillCommand extends BaseCommand{['name']=a26_0x16265d(0x1ca);[a26_0x16265d(0x1db)]='Kill\x20a\x20job';[a26_0x16265d(0x1c8)](_0x271ca9){const _0x455754=a26_0x16265d,_0xe4488e=_0x271ca9[_0x455754(0x1b2)][0x0];if(!_0xe4488e)return _0x455754(0x19e);return undefined;}async[a26_0x16265d(0x1b8)](_0x23fe62){const _0x1c76bd=a26_0x16265d,{options:_0x28aeba,args:_0x1cddfd,tdx:_0x485fef}=_0x23fe62,_0x149ac0=_0x1cddfd[0x0];if(!_0x28aeba[_0x1c76bd(0x1cc)]){const _0x4d23bd=await confirm(_0x1c76bd(0x199)+_0x149ac0+'?');if(!_0x4d23bd)return console[_0x1c76bd(0x1bb)](_0x1c76bd(0x1e5)),0x0;}return await withSpinner(_0x1c76bd(0x1dd),()=>_0x485fef[_0x1c76bd(0x1c5)][_0x1c76bd(0x1c3)](_0x149ac0),{'verbose':_0x28aeba[_0x1c76bd(0x1d0)]}),console['error'](_0x1c76bd(0x1c9)+_0x149ac0),console[_0x1c76bd(0x1bb)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x149ac0+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a26_0x16265d(0x1db)]=a26_0x16265d(0x1bf);async['execute'](_0x3344ab){const _0x4505c3=a26_0x16265d,{options:_0x19fd4d,args:_0x35a846,tdx:_0x5318ca}=_0x3344ab,_0x8da89c=_0x19fd4d['jobType']||_0x4505c3(0x1ab),_0x2087d9=_0x19fd4d[_0x4505c3(0x1dc)],_0x57f821=_0x19fd4d['database']||_0x4505c3(0x1d5),_0x2e4b6c=_0x19fd4d[_0x4505c3(0x1d7)];if(_0x8da89c!==_0x4505c3(0x1ab)&&_0x8da89c!=='hive')throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b4));let _0x45f2ae;if(_0x2087d9){if(_0x35a846[0x0])throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b7));const _0x5aa022=readSqlStatementsFromFile(_0x2087d9);if(_0x5aa022[_0x4505c3(0x1be)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4505c3(0x1ad));if(_0x5aa022[_0x4505c3(0x1be)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x45f2ae=_0x5aa022[0x0];}else{if(!_0x35a846[0x0])throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b3));_0x45f2ae=_0x35a846[0x0];}_0x19fd4d[_0x4505c3(0x1d0)]&&(console['error'](_0x4505c3(0x194)+_0x8da89c),console[_0x4505c3(0x1bb)](_0x4505c3(0x1aa)+_0x57f821),console[_0x4505c3(0x1bb)]('Query:\x20'+_0x45f2ae[_0x4505c3(0x19f)](0x0,0x64)+(_0x45f2ae[_0x4505c3(0x1be)]>0x64?'...':'')));const _0x11a383=await withSpinner(_0x4505c3(0x1e3),()=>_0x5318ca[_0x4505c3(0x1c5)][_0x4505c3(0x1e2)](_0x57f821,_0x45f2ae,_0x8da89c,_0x2e4b6c),{'verbose':_0x19fd4d[_0x4505c3(0x1d0)]}),_0x4685df=_0x11a383['data'];return console['error'](_0x4505c3(0x1a6)),console[_0x4505c3(0x1bb)](_0x4505c3(0x1e4)+_0x4685df[_0x4505c3(0x1b1)]),await handleSDKOutput([_0x4685df],_0x19fd4d),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x16265d(0x1d9)]='job:result';[a26_0x16265d(0x1db)]=a26_0x16265d(0x1d2);[a26_0x16265d(0x1c8)](_0x4bc829){const _0x5d335d=a26_0x16265d,_0xe49c74=_0x4bc829[_0x5d335d(0x1b2)][0x0];if(!_0xe49c74)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x16265d(0x1b8)](_0x52155b){const _0x1ce41e=a26_0x16265d,{options:_0x1b9539,args:_0x5e0f03,tdx:_0x4d0595}=_0x52155b,_0x2a4365=_0x5e0f03[0x0],_0x4b1117=await withSpinner(_0x1ce41e(0x1e6),()=>_0x4d0595[_0x1ce41e(0x1c5)][_0x1ce41e(0x1d7)](_0x2a4365),{'verbose':_0x1b9539['verbose']}),_0x697253=_0x4b1117[_0x1ce41e(0x1ce)];return console[_0x1ce41e(0x1bb)](_0x1ce41e(0x1c4)+_0x697253[_0x1ce41e(0x1be)]+_0x1ce41e(0x19b)+(_0x697253[_0x1ce41e(0x1be)]!==0x1?'s':'')),await handleSDKOutput(_0x697253,_0x1b9539),0x0;}}
|
|
@@ -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_0x4c00bc=a27_0x30cf;(function(_0x4a6289,_0x3c0b3d){const _0x1087cb=a27_0x30cf,_0x2222ea=_0x4a6289();while(!![]){try{const _0x87ac3=parseInt(_0x1087cb(0xb1))/0x1*(parseInt(_0x1087cb(0x12d))/0x2)+-parseInt(_0x1087cb(0x120))/0x3+-parseInt(_0x1087cb(0x155))/0x4+-parseInt(_0x1087cb(0x112))/0x5+-parseInt(_0x1087cb(0xee))/0x6*(-parseInt(_0x1087cb(0x185))/0x7)+-parseInt(_0x1087cb(0xca))/0x8+parseInt(_0x1087cb(0xfd))/0x9;if(_0x87ac3===_0x3c0b3d)break;else _0x2222ea['push'](_0x2222ea['shift']());}catch(_0xe5061a){_0x2222ea['push'](_0x2222ea['shift']());}}}(a27_0x3305,0xe4106));import a27_0x2a8216 from'chalk';import a27_0x576223 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';function a27_0x30cf(_0x545530,_0x11e852){_0x545530=_0x545530-0x7f;const _0x33058e=a27_0x3305();let _0x30cf80=_0x33058e[_0x545530];return _0x30cf80;}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(_0x1b85ed){const _0x3ac23d=a27_0x30cf;return!_0x1b85ed&&(console[_0x3ac23d(0x133)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x3ac23d(0x133)](_0x3ac23d(0x13b))),!!_0x1b85ed;}function withJsonFormat(_0x1f96f6){const _0xc4ef96=a27_0x30cf;if(!_0x1f96f6[_0xc4ef96(0xb9)]&&!_0x1f96f6[_0xc4ef96(0xeb)]&&!_0x1f96f6[_0xc4ef96(0x138)]&&!_0x1f96f6['tsv'])return{..._0x1f96f6,'format':_0xc4ef96(0xeb),'json':!![]};return _0x1f96f6;}function formatJourneyState(_0x28c779){const _0x249294=a27_0x30cf;switch(_0x28c779){case'launched':return a27_0x2a8216['green'](_0x249294(0xf3));case _0x249294(0x93):return a27_0x2a8216[_0x249294(0x10e)](_0x249294(0xc8));case _0x249294(0xc5):return a27_0x2a8216[_0x249294(0xa6)]('(paused)');case _0x249294(0x163):return a27_0x2a8216['blue'](_0x249294(0x95));case'archived':return a27_0x2a8216[_0x249294(0x10e)](_0x249294(0xbd));default:return'('+_0x28c779+')';}}function a27_0x3305(){const _0x4cf7c0=['INVALID_ARGUMENT','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','add','\x20\x20Name:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','cwd','options','connectionId','nodes','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','2YEOFNP','\x20->\x20','runAfterJourneyRefresh','updatedAt','journeyStages','session','error','/app/ps/','runAt','setPhase','journey:columns','jsonl','links','folderPath','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','attributes','enteredSize','Paused\x20at:','exitOrJumpRate','status','tdx.json','completeMilestoneRate','Fetching\x20','\x20\x20Statistics\x20not\x20available','Getting\x20journey\x20traffic\x20data...','journey:stats','(unnamed)','\x20\x20←\x20','parentName','rule','columns','Error:\x20Version\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','replace','\x20\x20Journey\x20ID:\x20','journey:resume','audienceId','entries','no\x20connection','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','5762364ApoJdS','parent_segment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Table:\x20','base','\x5c$&','listVersions','scheduleType','yes','Listing\x20journey\x20activations...','type','Error:\x20Invalid\x20version\x20number:\x20','join','set','completed','Warning:\x20Could\x20not\x20resolve\x20activation\x20','📁\x20','reentryMode','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','getColumnMapping','\x20[runs\x20on\x20refresh]','\x20activation','resolveParentId','milestoneSize','push','Getting\x20journey\x20statistics...','history',',\x20schedule:\x20','includeStats','no_parent','dryRun','\x20changed\x20files','Input:\x20','executeDryRun','State:','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','workflowSessionId','\x20details...','⚠️\x20','Listing\x20journeys...','Session:','getStatistics','Listing\x20journey\x20versions...','Pattern:\x20','size','get','Error:\x20Journey\x20not\x20found:\x20','site','10815791HrfIyJ','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20not\x20found.\x20Available:\x20','\x0aError:','stages','kind','createVersion','segments','journey:view','file','\x20=\x20','\x20(rule\x20match)','Aborted.','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20Target:\x20','Resolving\x20parent\x20segment...','bold','Error:\x20Stage\x20\x22','verbose','state','\x20journey\x20files\x20to\x20','message','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pausedAt','root\x20folder','data','green','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Getting\x20journey\x20details...','red','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','map','Options:','activation','Folder\x20path:\x20','resume','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','cyan','listActivationsFlat','content','\x20unchanged\x20files','resolveSegment','.yml','getParentFull','journey:pull','relativePath','ID:','utf-8','absolutePath','folderId','\x20Opening\x20','all','draft','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','(completed)','\x20@\x20','\x20(ID:\x20','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)','buildIdToEmailMap','versionNumber','segmentPushCommand','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','version','Error:\x20Journey\x20\x27','values','exitOrJumpSize','Export\x20journey(s)\x20as\x20YAML\x20files','pause','description','getActivation','yellow','Paused:','length','table','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Error:\x20Invalid\x20--type\x20\x22','connection','name','Resolved\x20YAML\x20file:\x20','sort','Cancelled','1122123Ijfsdv','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','/j/da','journeyName','...','Activations:','folders','Fetching\x20journeys\x20and\x20folders...','format','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Write\x20','Error:\x20','(archived)','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','journeys','\x20\x20-\x20','resolveJourneyId','conversion','journey:list','has','paused','✔\x20Journey\x20\x22','Resuming\x20journey...','(draft)','Fetching\x20journey\x20','9789688QkEbcT','buildIdToNameMap','parentSegment','-\x20no\x20files\x20written','journeyId','getLatestJourneyId','Parent\x20segment\x20ID:','listJourneysWithFolders','/e/','segment','hasPeriod','\x20\x20Parent\x20segment:\x20','filePath','targetDir','split','Triggering\x20journey\x20workflow...','then','hasChanges','createdAt','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','repeat','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Getting\x20version\x20','filter','Resume\x20a\x20paused\x20journey','✔\x20Context\x20set:\x20','Target\x20file:\x20','goal','Show\x20journey\x20details','journey','journeyBundleId','✔\x20Found\x20','stringify','json','/j/da/je','Error:\x20Parent\x20segment\x20context\x20required','6vOsVuw','connector_config','\x20journeys','segmentName','\x20\x20Folder\x20path:\x20','(running)','\x20Created\x20v','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','connection\x20','List\x20all\x20versions\x20of\x20a\x20journey','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','rootFolderId','Target\x20directory:\x20','args','goalSize','26527527iBcUtt','Stages:','toLowerCase','Show\x20journey\x20statistics','find','✔\x20Pulled\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','execute','No\x20journeys\x20found','relative','Fetching\x20users\x20and\x20connections...','journey:pause','log','database','limit','\x0aPull\x20summary:','getJourney','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Pause\x20a\x20running\x20journey','Getting\x20column\x20mapping...','7564015jaHvxd','Journey:','\x0aChanges\x20to\x20\x27','journey:run','diff','\x27\x20not\x20found\x20in\x20','isNew','(root)','getTrafficData','Resolving\x20version...','\x20version','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Creating\x20new\x20version...','journeyBundleName','1510452xnwukj'];a27_0x3305=function(){return _0x4cf7c0;};return a27_0x3305();}function formatJourneyItem(_0x354753,_0x346a84='',_0x2a4579){const _0xa0568f=a27_0x30cf,_0x51d9d6=formatJourneyState(_0x354753[_0xa0568f(0x199)]),_0x2cf954=_0x2a4579?hyperlink(_0x354753['journeyBundleName'],_0x2a4579):_0x354753[_0xa0568f(0x11f)];return _0x346a84+'🗺️\x20'+_0x2cf954+'\x20'+_0x51d9d6;}function escapeRegex(_0x38ed11){const _0x9ed1a3=a27_0x30cf;return _0x38ed11[_0x9ed1a3(0x14e)](/[.*+?^${}()|[\]\\]/g,_0x9ed1a3(0x15a));}function globToRegex(_0x1e76e2){const _0x43dbc0=a27_0x30cf,_0x3f5d4d=_0x1e76e2[_0x43dbc0(0xd8)]('*')[_0x43dbc0(0x1a5)](escapeRegex);return new RegExp(_0x3f5d4d[_0x43dbc0(0x161)]('.*'),'i');}function buildRuleToNameMapping(_0x3296f4){const _0x4d3665=a27_0x30cf,_0x3ef412=new Map();if(_0x3296f4[_0x4d3665(0x18c)])for(const [_0x335178,_0x2a480a]of Object['entries'](_0x3296f4[_0x4d3665(0x18c)])){if(_0x2a480a[_0x4d3665(0x14a)]){const _0x59531c=serializeRule(_0x2a480a[_0x4d3665(0x14a)]),_0x2119f9=_0x3ef412[_0x4d3665(0x182)](_0x59531c);_0x2119f9?_0x2119f9['push'](_0x335178):_0x3ef412[_0x4d3665(0x162)](_0x59531c,[_0x335178]);}}return _0x3ef412;}async function resolveJourneyIdFromInput(_0x16b1d9,_0x3010d0,_0x4d30ca){const _0x17c480=a27_0x30cf,_0xc7fb49=await resolveJourneyTarget(_0x16b1d9,_0x3010d0['parentSegment'],_0x3010d0[_0x17c480(0x198)]),_0x1bcf60=_0xc7fb49[_0x17c480(0xcc)];if(!_0x1bcf60)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x17c480(0xf8));const _0x1955a3=await withSpinner(_0x17c480(0x195),()=>_0x4d30ca[_0x17c480(0xd3)][_0x17c480(0x16b)](_0x1bcf60),{'verbose':_0x3010d0[_0x17c480(0x198)]}),_0x870977=_0x1955a3['data'],_0x1022f5=await withSpinner('Resolving\x20journey...',()=>_0x4d30ca[_0x17c480(0xe7)][_0x17c480(0xc1)](_0x870977,_0xc7fb49[_0x17c480(0xb4)]),{'verbose':_0x3010d0[_0x17c480(0x198)]});return{'journeyId':_0x1022f5[_0x17c480(0x19f)],'journeyName':_0xc7fb49['journeyName'],'parentSegmentId':_0x870977};}async function resolveJourneyTarget(_0x3b8ebc,_0x4a906c,_0x166acc){const _0x39096d=a27_0x30cf;if(isYamlFilePath(_0x3b8ebc))try{const _0x1386da=await resolveYamlFilePath(_0x3b8ebc);return _0x166acc&&(console['error'](_0x39096d(0xae)+_0x3b8ebc),console[_0x39096d(0x133)](_0x39096d(0xd5)+_0x1386da['parentSegment']),console[_0x39096d(0x133)](_0x39096d(0x126)+_0x1386da[_0x39096d(0xf1)]),console[_0x39096d(0x133)](_0x39096d(0xf2)+(_0x1386da[_0x39096d(0x13a)]||_0x39096d(0x119)))),{'journeyName':_0x1386da[_0x39096d(0xf1)],'parentSegment':_0x1386da[_0x39096d(0xcc)],'resolved':_0x1386da};}catch(_0x28780f){throw new SDKError(ErrorCode[_0x39096d(0x121)],_0x39096d(0x94)+_0x28780f[_0x39096d(0x19b)]);}if(!_0x4a906c)throw new SDKError(ErrorCode[_0x39096d(0x121)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x3b8ebc,'parentSegment':_0x4a906c};}export class JourneyListCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0xc3);[a27_0x4c00bc(0xa4)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x4c00bc(0x104)](_0x34eedd){const _0x1df8a5=a27_0x4c00bc,{options:_0xcce67b,args:_0x33cf1f,tdx:_0x18dff6}=_0x34eedd,_0x20bd53=_0x33cf1f[0x0],_0x11f51e=_0xcce67b['parentSegment'];if(!_0x11f51e)return console[_0x1df8a5(0x133)](_0x1df8a5(0xed)),console[_0x1df8a5(0x133)](_0x1df8a5(0x124)),0x1;const _0x41d0a2=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x18dff6['segment'][_0x1df8a5(0x16b)](_0x11f51e),{'verbose':_0xcce67b['verbose']}),_0x73cff=_0x41d0a2[_0x1df8a5(0x19f)];_0xcce67b[_0x1df8a5(0x198)]&&(console[_0x1df8a5(0x133)]('Parent\x20segment:\x20'+_0x11f51e+_0x1df8a5(0x97)+_0x73cff+')'),_0x20bd53&&console[_0x1df8a5(0x133)](_0x1df8a5(0x180)+_0x20bd53));const _0x1fe90a=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x18dff6[_0x1df8a5(0xd3)][_0x1df8a5(0x8a)](_0x73cff),{'verbose':_0xcce67b[_0x1df8a5(0x198)]}),_0x2a4aef=_0x1fe90a[_0x1df8a5(0x19f)],_0x2e667a=_0x2a4aef[_0x1df8a5(0xf9)],_0x4a0782=await withSpinner(_0x1df8a5(0x17c),()=>_0x18dff6[_0x1df8a5(0xe7)][_0x1df8a5(0xd1)](_0x73cff,_0x2e667a),{'verbose':_0xcce67b[_0x1df8a5(0x198)]});let _0x39e614=_0x4a0782['data'][_0x1df8a5(0xbf)];const _0x42914f=_0x4a0782['data'][_0x1df8a5(0xb7)],_0x119a21=new Map();for(const _0x5df9c8 of _0x42914f){_0x119a21[_0x1df8a5(0x162)](_0x5df9c8['id'],_0x5df9c8['name']);}if(_0x20bd53){const _0x28424e=globToRegex(_0x20bd53);_0x39e614=_0x39e614['filter'](_0x176e23=>_0x28424e['test'](_0x176e23['journeyBundleName']));}console[_0x1df8a5(0x133)](_0x1df8a5(0xe9)+_0x39e614[_0x1df8a5(0xa8)]+'\x20journey'+(_0x39e614[_0x1df8a5(0xa8)]!==0x1?'s':''));const _0x3f6691=_0x18c785=>{const _0x32a9e1=_0x1df8a5;return getConsoleNextUrl(_0xcce67b[_0x32a9e1(0x184)],_0x32a9e1(0x134)+_0x73cff+_0x32a9e1(0xd2)+_0x18c785+_0x32a9e1(0xb3));};if(_0xcce67b[_0x1df8a5(0xb9)]===_0x1df8a5(0xa9))await handleSDKOutput(_0x39e614,_0xcce67b);else{if(_0xcce67b[_0x1df8a5(0xb9)]===_0x1df8a5(0xeb)){const _0x4d0f10=_0x39e614[_0x1df8a5(0x1a5)](_0x3f7ced=>({..._0x3f7ced,'url':_0x3f6691(_0x3f7ced['id'])}));await handleSDKOutput(_0x4d0f10,_0xcce67b);}else{console['log']('['+_0x11f51e+']');const _0xeb899f=new Map(),_0x579e1d=[];for(const _0xc41cf9 of _0x39e614){if(!_0xc41cf9[_0x1df8a5(0x90)]||_0xc41cf9[_0x1df8a5(0x90)]===_0x2e667a)_0x579e1d[_0x1df8a5(0x16d)](_0xc41cf9);else{const _0x29f0f9=_0xeb899f['get'](_0xc41cf9[_0x1df8a5(0x90)])||[];_0x29f0f9[_0x1df8a5(0x16d)](_0xc41cf9),_0xeb899f[_0x1df8a5(0x162)](_0xc41cf9[_0x1df8a5(0x90)],_0x29f0f9);}}const _0x6f3ee0=(_0xc3fd54,_0xe4df71)=>_0xc3fd54[_0x1df8a5(0x11f)]['localeCompare'](_0xe4df71[_0x1df8a5(0x11f)],undefined,{'sensitivity':'base'});_0x579e1d[_0x1df8a5(0xaf)](_0x6f3ee0);for(const _0x25bc95 of _0x579e1d){console[_0x1df8a5(0x109)](formatJourneyItem(_0x25bc95,'',_0x3f6691(_0x25bc95['id'])));}const _0x11bd3b=[..._0xeb899f[_0x1df8a5(0x152)]()]['sort']((_0x28104e,_0x196c41)=>{const _0x24f953=_0x1df8a5,_0x12cda6=_0x119a21[_0x24f953(0x182)](_0x28104e[0x0])||_0x28104e[0x0],_0x24c1f7=_0x119a21[_0x24f953(0x182)](_0x196c41[0x0])||_0x196c41[0x0];return _0x12cda6['localeCompare'](_0x24c1f7,undefined,{'sensitivity':_0x24f953(0x159)});});for(const [_0x279d25,_0x1e662d]of _0x11bd3b){const _0xc021ab=_0x119a21['get'](_0x279d25)||_0x279d25;console[_0x1df8a5(0x109)](_0x1df8a5(0x165)+_0xc021ab),_0x1e662d[_0x1df8a5(0xaf)](_0x6f3ee0);for(const _0x6d7c81 of _0x1e662d){console[_0x1df8a5(0x109)](formatJourneyItem(_0x6d7c81,'\x20\x20',_0x3f6691(_0x6d7c81['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x18d);['description']=a27_0x4c00bc(0xe6);async[a27_0x4c00bc(0x104)](_0x283d23){const _0x1b918f=a27_0x4c00bc,{options:_0x55cdbf,args:_0x2b140d,tdx:_0x3bd2af}=_0x283d23,_0x54eb6b=_0x2b140d[0x0];if(!_0x54eb6b)return console[_0x1b918f(0x133)](_0x1b918f(0xf5)),console[_0x1b918f(0x133)](_0x1b918f(0x192)),console[_0x1b918f(0x133)](_0x1b918f(0x7f)),console['error'](_0x1b918f(0x154)),0x1;_0x55cdbf[_0x1b918f(0x198)]&&console[_0x1b918f(0x133)](_0x1b918f(0x175)+_0x54eb6b);const {journeyId:_0x5e4e93,parentSegmentId:_0x3a15c2}=await resolveJourneyIdFromInput(_0x54eb6b,_0x55cdbf,_0x3bd2af);if(_0x55cdbf['web']){const _0x141319=getConsoleNextUrl(_0x55cdbf[_0x1b918f(0x184)],'/app/ps/'+_0x3a15c2+_0x1b918f(0xd2)+_0x5e4e93+_0x1b918f(0xec));return console[_0x1b918f(0x133)](a27_0x2a8216['green']('✔')+_0x1b918f(0x91)+a27_0x2a8216[_0x1b918f(0x84)](_0x141319)),openBrowser(_0x141319),0x0;}const _0x160599=await withSpinner(_0x1b918f(0x1a2),()=>_0x3bd2af[_0x1b918f(0xe7)][_0x1b918f(0x10d)](_0x5e4e93),{'verbose':_0x55cdbf[_0x1b918f(0x198)]}),_0x21e039=_0x160599[_0x1b918f(0x19f)],_0x551b27=_0x55cdbf[_0x1b918f(0x171)];let _0x5636dc;if(_0x551b27)try{const _0x540f5b=await withSpinner(_0x1b918f(0x16e),()=>_0x3bd2af[_0x1b918f(0xe7)][_0x1b918f(0x17e)](_0x5e4e93),{'verbose':_0x55cdbf[_0x1b918f(0x198)]});_0x5636dc=_0x540f5b['data'];}catch{_0x55cdbf[_0x1b918f(0x198)]&&console[_0x1b918f(0x133)](_0x1b918f(0x144));}const _0x4ad5d6=getConsoleNextUrl(_0x55cdbf[_0x1b918f(0x184)],'/app/ps/'+_0x3a15c2+_0x1b918f(0xd2)+_0x5e4e93+'/j/da/je'),_0x289f9c={'id':_0x21e039['id'],'name':_0x21e039['attributes']['name'],'description':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xa4)],'state':_0x21e039['attributes'][_0x1b918f(0x199)],'paused':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xc5)],'reentry_mode':_0x21e039[_0x1b918f(0x13c)]['reentryMode'],'stages':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0x131)]?.['length']||0x0,..._0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xe5)]&&{'goal':_0x21e039[_0x1b918f(0x13c)]['goal']['name']},..._0x5636dc&&{'statistics':{'size':_0x5636dc[_0x1b918f(0x181)],'entered':_0x5636dc[_0x1b918f(0x13d)],'goal_achieved':_0x5636dc[_0x1b918f(0xfc)],'completion_rate':_0x5636dc['completionRate'],'exit_or_jump':_0x5636dc[_0x1b918f(0xa1)],'exit_or_jump_rate':_0x5636dc[_0x1b918f(0x13f)],'stages':_0x5636dc['stages']}},'url':_0x4ad5d6};return await handleSingleObjectOutput(_0x289f9c,_0x55cdbf),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x146);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x100);async[a27_0x4c00bc(0x104)](_0x2a93cf){const _0x506c7d=a27_0x4c00bc,{options:_0x52ce2d,args:_0x95fdb9,tdx:_0x4f107f}=_0x2a93cf,_0x3429ac=_0x95fdb9[0x0];if(!requireNameOrPath(_0x3429ac))return 0x1;_0x52ce2d['verbose']&&console[_0x506c7d(0x133)]('Input:\x20'+_0x3429ac);const _0x18a128=_0x52ce2d,_0x3899e3=_0x18a128['from'],_0x37f692=_0x18a128['to'],_0x32b0f0=_0x18a128['includeHistory'],_0x243188=_0x18a128['stage'];_0x32b0f0&&!_0x3899e3&&!_0x37f692&&console[_0x506c7d(0x133)](_0x506c7d(0x186));const _0x16a83d=_0x32b0f0?withJsonFormat(_0x52ce2d):_0x52ce2d,{journeyId:_0x35069f,journeyName:_0x4d11ea}=await resolveJourneyIdFromInput(_0x3429ac,_0x16a83d,_0x4f107f),_0x4133e0=_0x3899e3||_0x37f692?{'from':_0x3899e3,'to':_0x37f692}:undefined,_0xcb816=await withSpinner(_0x506c7d(0x16e),()=>Promise[_0x506c7d(0x92)]([_0x4f107f[_0x506c7d(0xe7)][_0x506c7d(0x10d)](_0x35069f),_0x4f107f[_0x506c7d(0xe7)][_0x506c7d(0x17e)](_0x35069f,_0x4133e0)]),{'verbose':_0x16a83d['verbose']}),[_0x448f82,_0x483c24]=_0xcb816[_0x506c7d(0x19f)];if(!_0x483c24||_0x483c24[_0x506c7d(0xce)]===null)return console[_0x506c7d(0x133)](_0x506c7d(0x193)+_0x4d11ea),console[_0x506c7d(0x133)](_0x506c7d(0x178)),0x0;const _0x4b02e3=buildStageNameMap(_0x448f82),_0x3fb926=!!(_0x4133e0&&_0x483c24['history']?.[_0x506c7d(0xa8)]),_0x1f205d={'stageNameMap':_0x4b02e3,'hasPeriod':_0x3fb926,'includeHistory':!!_0x32b0f0};if(_0x243188&&_0x483c24[_0x506c7d(0x189)]){const _0x598661=_0x483c24[_0x506c7d(0x189)]['find'](_0x518f93=>{const _0x1b889a=_0x506c7d,_0x2501c2=_0x4b02e3[_0x1b889a(0x182)](_0x518f93['id'])??'';return _0x2501c2['toLowerCase']()===_0x243188['toLowerCase']();});if(_0x598661)return await handleSingleObjectOutput(formatStageStats(_0x598661,_0x1f205d),_0x16a83d),0x0;const _0x154a00=_0x483c24[_0x506c7d(0x189)]['map'](_0x597956=>_0x4b02e3['get'](_0x597956['id'])??_0x597956['id']);return console[_0x506c7d(0x133)](_0x506c7d(0x197)+_0x243188+'\x22\x20not\x20found'),console['error']('Available\x20stages:\x20'+_0x154a00[_0x506c7d(0x161)](',\x20')),0x1;}const _0x416fc8=_0x483c24[_0x506c7d(0x189)]?.['map'](_0x1df05e=>formatStageStats(_0x1df05e,_0x1f205d)),_0x573aa2=assembleJourneyStats(_0x483c24,{'from':_0x3899e3,'to':_0x37f692,'includeHistory':_0x32b0f0});return await this['renderStats'](_0x573aa2,_0x416fc8??[],_0x16a83d),0x0;}async['renderStats'](_0x4a22d9,_0x5b2d5c,_0x41c24e){const _0x33de08=a27_0x4c00bc,_0x15c9fc=_0x41c24e['format']===_0x33de08(0xeb)||_0x41c24e[_0x33de08(0xb9)]===_0x33de08(0x138)||_0x41c24e[_0x33de08(0xeb)]||_0x41c24e[_0x33de08(0x138)];if(_0x15c9fc){_0x4a22d9[_0x33de08(0x189)]=_0x5b2d5c,await handleSingleObjectOutput(_0x4a22d9,_0x41c24e);return;}await handleSingleObjectOutput(_0x4a22d9,_0x41c24e);for(const _0x44f03a of _0x5b2d5c){console[_0x33de08(0x109)](''),console[_0x33de08(0x109)](String(a27_0x2a8216[_0x33de08(0x84)][_0x33de08(0x196)]('['+_0x44f03a[_0x33de08(0xad)]+']'))+a27_0x2a8216[_0x33de08(0x10e)]('\x20'+_0x44f03a['id']));const {id:_0x204282,name:_0x4cabee,..._0xe9c3fc}=_0x44f03a;await handleSingleObjectOutput(_0xe9c3fc,_0x41c24e);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:traffic';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x127);async[a27_0x4c00bc(0x104)](_0x15146a){const _0x18176c=a27_0x4c00bc,{options:_0x37709d,args:_0x40fa4f,tdx:_0x406128}=_0x15146a,_0x479731=_0x40fa4f[0x0];if(!requireNameOrPath(_0x479731))return 0x1;_0x37709d[_0x18176c(0x198)]&&console['error'](_0x18176c(0x175)+_0x479731);const _0xa18e16=_0x37709d,_0x284688=_0xa18e16[_0x18176c(0x15f)],_0xbe4160=_0xa18e16['from'],_0x5b0d7d=_0xa18e16['to'],_0x3733a1=_0xa18e16[_0x18176c(0x10b)];if(_0x284688&&_0x284688!==_0x18176c(0xc2)&&_0x284688!==_0x18176c(0x80))return console['error'](_0x18176c(0xab)+_0x284688+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5b276=withJsonFormat(_0x37709d),{journeyId:_0x2551b4,journeyName:_0x1b03cf}=await resolveJourneyIdFromInput(_0x479731,_0x5b276,_0x406128),_0x5a3310={'type':_0x284688,'from':_0xbe4160,'to':_0x5b0d7d,'limit':_0x3733a1},_0x2a68ed=await withSpinner(_0x18176c(0x145),()=>_0x406128[_0x18176c(0xe7)][_0x18176c(0x11a)](_0x2551b4,_0x5a3310),{'verbose':_0x5b276[_0x18176c(0x198)]}),_0x524423=_0x2a68ed[_0x18176c(0x19f)],_0xd91427=_0x524423[_0x18176c(0xc2)]&&(_0x524423[_0x18176c(0xc2)][_0x18176c(0x12b)][_0x18176c(0xa8)]>0x0||_0x524423[_0x18176c(0xc2)][_0x18176c(0x139)]['length']>0x0),_0x5e7401=_0x524423['activation']&&_0x524423[_0x18176c(0x80)][_0x18176c(0xa8)]>0x0;if(!_0xd91427&&!_0x5e7401)return console[_0x18176c(0x133)](_0x18176c(0x1a4)+_0x1b03cf),console[_0x18176c(0x133)](_0x18176c(0x12c)),_0xbe4160&&_0x5b0d7d&&console['error'](_0x18176c(0xdd)),0x0;return await handleSingleObjectOutput(_0x524423,_0x5b276),0x0;}}function formatStageStats(_0x5481e9,_0x35a529){const _0x5c923d=a27_0x4c00bc,_0x2f80dd=_0x35a529[_0x5c923d(0xd4)]&&_0x5481e9['history']?.['length']?aggregateStageHistory(_0x5481e9['history']):{'size':_0x5481e9[_0x5c923d(0x181)],'entered':_0x5481e9[_0x5c923d(0x13d)],'milestone':_0x5481e9[_0x5c923d(0x16c)],'milestone_rate':_0x5481e9[_0x5c923d(0x142)],'exit_or_jump':_0x5481e9[_0x5c923d(0xa1)],'exit_or_jump_rate':_0x5481e9[_0x5c923d(0x13f)]},_0x2b5b7e={'id':_0x5481e9['id'],'name':_0x35a529['stageNameMap'][_0x5c923d(0x182)](_0x5481e9['id'])??_0x5481e9['id'],..._0x2f80dd};return _0x35a529['hasPeriod']&&_0x35a529['includeHistory']&&_0x5481e9[_0x5c923d(0x16f)]&&(_0x2b5b7e[_0x5c923d(0x16f)]=_0x5481e9[_0x5c923d(0x16f)]),_0x2b5b7e;}export class JourneyPauseCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x108);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x110);async['execute'](_0x23731e){const _0x3188d6=a27_0x4c00bc,{options:_0x486743,args:_0x18f630,tdx:_0x3e984f}=_0x23731e,_0x4b8c26=_0x18f630[0x0];if(!requireNameOrPath(_0x4b8c26))return 0x1;_0x486743[_0x3188d6(0x198)]&&console[_0x3188d6(0x133)]('Input:\x20'+_0x4b8c26);const {journeyId:_0x5a985f,journeyName:_0x444854}=await resolveJourneyIdFromInput(_0x4b8c26,_0x486743,_0x3e984f);if(!_0x486743[_0x3188d6(0x15d)]){const _0x35e023=await confirm(_0x3188d6(0x103)+_0x444854+'\x22?');if(!_0x35e023)return console[_0x3188d6(0x133)]('Cancelled'),0x0;}const _0x273350=await withSpinner('Pausing\x20journey...',()=>_0x3e984f[_0x3188d6(0xe7)][_0x3188d6(0xa3)](_0x5a985f),{'verbose':_0x486743[_0x3188d6(0x198)]}),_0x408030=_0x273350[_0x3188d6(0x19f)];return console[_0x3188d6(0x133)](_0x3188d6(0xc6)+_0x408030['attributes'][_0x3188d6(0xad)]+'\x22\x20paused'),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x115);['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a27_0x4c00bc(0x104)](_0x561e2e){const _0x1dcee1=a27_0x4c00bc,{options:_0x3a15f7,args:_0xe27bd8,tdx:_0x473e3a}=_0x561e2e,_0x40df19=_0xe27bd8[0x0];if(!requireNameOrPath(_0x40df19))return 0x1;_0x3a15f7['verbose']&&console[_0x1dcee1(0x133)]('Input:\x20'+_0x40df19);const {journeyId:_0x377de4,journeyName:_0x3c35c3}=await resolveJourneyIdFromInput(_0x40df19,_0x3a15f7,_0x473e3a);if(_0x3a15f7[_0x1dcee1(0x173)])return await this[_0x1dcee1(0x176)](_0x561e2e,_0x377de4,_0x3c35c3);if(!_0x3a15f7[_0x1dcee1(0x15d)]){const _0x295cb0=await confirm(_0x1dcee1(0x9c)+_0x3c35c3+'\x22?');if(!_0x295cb0)return console[_0x1dcee1(0x133)]('Cancelled'),0x0;}const _0x411f3d=await withSpinner(_0x1dcee1(0xd9),()=>_0x473e3a[_0x1dcee1(0xe7)]['run'](_0x377de4),{'verbose':_0x3a15f7[_0x1dcee1(0x198)]}),_0x480a10=_0x411f3d[_0x1dcee1(0x19f)],_0xf8265d=getWorkflowSessionUrl(_0x3a15f7[_0x1dcee1(0x184)],_0x480a10['workflowId'],_0x480a10[_0x1dcee1(0x179)]);return console[_0x1dcee1(0x133)]('\x0a'+a27_0x2a8216[_0x1dcee1(0x1a0)]('✔')+'\x20Journey\x20workflow\x20started'),console[_0x1dcee1(0x133)]('\x20\x20'+a27_0x2a8216['dim'](_0x1dcee1(0x113))+'\x20'+_0x3c35c3),console['error']('\x20\x20'+a27_0x2a8216[_0x1dcee1(0x10e)]('Status:')+'\x20'+_0x480a10[_0x1dcee1(0x140)]),console['error']('\x20\x20'+a27_0x2a8216[_0x1dcee1(0x10e)](_0x1dcee1(0x17d))+'\x20'+_0x480a10[_0x1dcee1(0x179)]),console[_0x1dcee1(0x133)]('\x20\x20'+_0xf8265d),0x0;}async[a27_0x4c00bc(0x176)](_0x3f31af,_0xfc5a35,_0x2b9ea1){const _0x57e832=a27_0x4c00bc,{options:_0x1d4015,tdx:_0x4be0b2}=_0x3f31af,_0x496672=await withSpinner('Fetching\x20journey\x20'+_0x2b9ea1+_0x57e832(0xb5),()=>Promise['all']([_0x4be0b2[_0x57e832(0xe7)][_0x57e832(0x10d)](_0xfc5a35),_0x4be0b2['journey'][_0x57e832(0x85)](_0xfc5a35)]),{'verbose':_0x1d4015[_0x57e832(0x198)]}),[_0x8310f8,_0x19b80b]=_0x496672[_0x57e832(0x19f)],_0xd3262a=_0x8310f8[_0x57e832(0x13c)],_0x135916=_0xd3262a['journeyStages'];console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0x113)),_0xd3262a[_0x57e832(0xad)]),console['log'](a27_0x2a8216[_0x57e832(0x196)]('ID:'),_0x8310f8['id']),console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0x177)),_0xd3262a['state']),console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0xa7)),_0xd3262a['paused']?a27_0x2a8216['yellow'](_0x57e832(0x15d)):a27_0x2a8216[_0x57e832(0x1a0)]('no')),console['log'](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xd0)),_0xd3262a[_0x57e832(0x151)]);const _0x5c9ff6=_0x135916[_0x57e832(0xa8)]>0x0?'\x20('+_0x135916[_0x57e832(0x1a5)](_0x4ef7b5=>_0x4ef7b5[_0x57e832(0xad)])['join'](',\x20')+')':'';console['log'](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xfe)),''+_0x135916[_0x57e832(0xa8)]+_0x5c9ff6),console[_0x57e832(0x109)]('');if(_0x19b80b['length']===0x0)console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xb6)),a27_0x2a8216[_0x57e832(0x10e)]('(none)'));else{console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0xb6)));for(const _0x12778f of _0x19b80b){const _0x3b7fe0=_0x12778f[_0x57e832(0xad)]??_0x57e832(0x147),_0x214d56=_0x12778f[_0x57e832(0x12a)]!=null?_0x57e832(0xf6)+_0x12778f['connectionId']:_0x57e832(0x153),_0xfe1e59=_0x12778f['scheduleType']?''+_0x12778f[_0x57e832(0x15c)]+(_0x12778f[_0x57e832(0x135)]?_0x57e832(0x96)+_0x12778f[_0x57e832(0x135)]:''):'none',_0x3ee8c3=_0x12778f[_0x57e832(0x12f)]?_0x57e832(0x169):'';console['log']('\x20\x20'+a27_0x2a8216[_0x57e832(0xa6)]('⚠️\x20')+'\x20'+_0x3b7fe0+_0x57e832(0x148)+_0x214d56+_0x57e832(0x170)+_0xfe1e59+_0x3ee8c3);}}return console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0xa6)](_0x57e832(0x11d))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x150);['description']=a27_0x4c00bc(0xe2);async[a27_0x4c00bc(0x104)](_0x4f5341){const _0x2a61fa=a27_0x4c00bc,{options:_0x7f81f1,args:_0x5e8335,tdx:_0x689d9a}=_0x4f5341,_0x2cf046=_0x5e8335[0x0];if(!requireNameOrPath(_0x2cf046))return 0x1;_0x7f81f1['verbose']&&console[_0x2a61fa(0x133)]('Input:\x20'+_0x2cf046);const {journeyId:_0x333fb9,journeyName:_0x30b121}=await resolveJourneyIdFromInput(_0x2cf046,_0x7f81f1,_0x689d9a);if(_0x7f81f1[_0x2a61fa(0x173)])return await this[_0x2a61fa(0x176)](_0x4f5341,_0x333fb9,_0x30b121);if(!_0x7f81f1['yes']){const _0x185ab9=await confirm(_0x2a61fa(0x9d)+_0x30b121+'\x22?');if(!_0x185ab9)return console[_0x2a61fa(0x133)](_0x2a61fa(0xb0)),0x0;}const _0xbc55ba=await withSpinner(_0x2a61fa(0xc7),()=>_0x689d9a[_0x2a61fa(0xe7)][_0x2a61fa(0x82)](_0x333fb9),{'verbose':_0x7f81f1['verbose']}),_0x36cd7a=_0xbc55ba['data'];return console['error']('✔\x20Journey\x20\x22'+_0x36cd7a[_0x2a61fa(0x13c)][_0x2a61fa(0xad)]+'\x22\x20resumed'),0x0;}async['executeDryRun'](_0x16038d,_0x40f0ca,_0x64ef77){const _0x1a18f0=a27_0x4c00bc,{options:_0x2e0718,tdx:_0x150c79}=_0x16038d,_0x3fa4fa=await withSpinner(_0x1a18f0(0xc9)+_0x64ef77+_0x1a18f0(0xb5),()=>Promise['all']([_0x150c79[_0x1a18f0(0xe7)][_0x1a18f0(0x10d)](_0x40f0ca),_0x150c79[_0x1a18f0(0xe7)][_0x1a18f0(0x85)](_0x40f0ca)]),{'verbose':_0x2e0718[_0x1a18f0(0x198)]}),[_0x2c2f6c,_0xfbc3ff]=_0x3fa4fa[_0x1a18f0(0x19f)],_0xee01d2=_0x2c2f6c[_0x1a18f0(0x13c)],_0x5f2e14=_0xee01d2[_0x1a18f0(0x131)];console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x113)),_0xee01d2[_0x1a18f0(0xad)]),console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x8d)),_0x2c2f6c['id']),console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x177)),_0xee01d2['state']),console['log'](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xa7)),_0xee01d2[_0x1a18f0(0xc5)]?a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x15d)):a27_0x2a8216['green']('no'));_0xee01d2[_0x1a18f0(0x19d)]&&console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x13e)),_0xee01d2['pausedAt']);console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xd0)),_0xee01d2[_0x1a18f0(0x151)]);const _0x52a059=_0x5f2e14['length']>0x0?'\x20('+_0x5f2e14['map'](_0x1f038e=>_0x1f038e['name'])[_0x1a18f0(0x161)](',\x20')+')':'';console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xfe)),''+_0x5f2e14[_0x1a18f0(0xa8)]+_0x52a059),console[_0x1a18f0(0x109)]('');if(_0xfbc3ff[_0x1a18f0(0xa8)]===0x0)console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xb6)),a27_0x2a8216['dim']('(none)'));else{console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xb6)));for(const _0x29da44 of _0xfbc3ff){const _0x276bf9=_0x29da44[_0x1a18f0(0xad)]??_0x1a18f0(0x147),_0x1a5f8c=_0x29da44[_0x1a18f0(0x12a)]!=null?'connection\x20'+_0x29da44[_0x1a18f0(0x12a)]:_0x1a18f0(0x153),_0x587861=_0x29da44[_0x1a18f0(0x15c)]?''+_0x29da44['scheduleType']+(_0x29da44['runAt']?_0x1a18f0(0x96)+_0x29da44[_0x1a18f0(0x135)]:''):'none',_0x2122af=_0x29da44[_0x1a18f0(0x12f)]?_0x1a18f0(0x169):'';console[_0x1a18f0(0x109)]('\x20\x20'+a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x17b))+'\x20'+_0x276bf9+_0x1a18f0(0x148)+_0x1a5f8c+_0x1a18f0(0x170)+_0x587861+_0x2122af);}}return console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x83))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x8b);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xa2);async[a27_0x4c00bc(0x104)](_0x5e728b){const _0x190bea=a27_0x4c00bc,{options:_0x50eb65,args:_0x368cf3,tdx:_0x3dc5e7}=_0x5e728b,_0x2770e2=_0x50eb65,_0x1c327f=_0x368cf3[0x0],_0x14d022=_0x1c327f&&isYamlFilePath(_0x1c327f),_0x63c769=await resolveTarget({'arg':_0x14d022?_0x1c327f:undefined,'contextParent':_0x50eb65['parentSegment'],'cwd':process[_0x190bea(0x128)]()});if(!isSuccessfulResolution(_0x63c769))return _0x63c769['errorCode']===_0x190bea(0x172)?(console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0xa6)](_0x190bea(0x157))),console[_0x190bea(0x133)](_0x190bea(0x98)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x190bea(0x10f)),console[_0x190bea(0x133)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a3)](_0x190bea(0xbc)+_0x63c769['message']+'\x0a')),_0x63c769['helpText']&&console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x84)](_0x63c769['helpText']))),0x1;let _0x26b984=_0x14d022?undefined:_0x1c327f,_0x5ef123,_0x1c696a;_0x63c769[_0x190bea(0x15f)]===_0x190bea(0x18e)&&(_0x26b984=_0x63c769['resourceName'],_0x5ef123=_0x63c769['filePath'],_0x1c696a=_0x63c769[_0x190bea(0x13a)]);const _0x45ce42=_0x63c769[_0x190bea(0x149)],_0x57a808=_0x63c769[_0x190bea(0xd7)];_0x2770e2[_0x190bea(0x198)]&&(console[_0x190bea(0x133)]('Parent\x20segment:\x20'+_0x45ce42),console['error'](_0x190bea(0xfa)+_0x57a808),_0x26b984&&console['error']('Journey\x20name:\x20'+_0x26b984),_0x5ef123&&console['error'](_0x190bea(0xe4)+_0x5ef123),_0x1c696a&&console[_0x190bea(0x133)](_0x190bea(0x81)+_0x1c696a));const _0x6fa035=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3dc5e7[_0x190bea(0xd3)][_0x190bea(0x16b)](_0x45ce42),{'verbose':_0x50eb65[_0x190bea(0x198)]}),_0x19ec8d=_0x6fa035[_0x190bea(0x19f)],{journeys:_0x484f56,folders:_0x4cfab8}=await withSpinner(_0x190bea(0xb8),async()=>{const _0x1d8515=_0x190bea,[_0x37bb4d,_0x4a7ad2]=await Promise[_0x1d8515(0x92)]([_0x3dc5e7['journey']['listJourneysFromParentSegment'](_0x19ec8d,undefined,{'includeAllVersions':!![]}),_0x3dc5e7[_0x1d8515(0xd3)]['listFolders'](_0x19ec8d)]);return{'journeys':_0x37bb4d,'folders':_0x4a7ad2};},{'verbose':_0x50eb65[_0x190bea(0x198)]})[_0x190bea(0xda)](_0x1de5b8=>_0x1de5b8[_0x190bea(0x19f)]);let _0x3b3fce=_0x484f56;const _0x2c27e4=buildFolderIdToPathMap(_0x4cfab8);if(_0x26b984){const _0x5a18b0=_0x3b3fce[_0x190bea(0xe1)](_0x46c391=>_0x46c391[_0x190bea(0x11f)][_0x190bea(0xff)]()===_0x26b984['toLowerCase']());if(_0x5a18b0[_0x190bea(0xa8)]===0x0)return console[_0x190bea(0x133)](_0x190bea(0x183)+_0x26b984),console['error'](_0x190bea(0xbe)),0x1;_0x3b3fce=_0x5a18b0;}if(_0x1c696a!==undefined){const _0x209890=_0x3b3fce[_0x190bea(0xe1)](_0x17f350=>{const _0x34bb5d=_0x190bea,_0x20bcf0=_0x17f350['folderId']?_0x2c27e4['get'](_0x17f350[_0x34bb5d(0x90)])||'':'';return _0x20bcf0===_0x1c696a;});if(_0x209890['length']===0x0&&_0x3b3fce[_0x190bea(0xa8)]>0x0){console[_0x190bea(0x133)](_0x190bea(0x9f)+_0x26b984+_0x190bea(0x117)+(_0x1c696a||_0x190bea(0x19e))),console['error'](_0x190bea(0x122));for(const _0x4b42af of _0x3b3fce){const _0x332635=_0x4b42af['folderId']?_0x2c27e4[_0x190bea(0x182)](_0x4b42af[_0x190bea(0x90)])||'':'';console[_0x190bea(0x133)](_0x190bea(0xc0)+(_0x332635||_0x190bea(0x119))+'/'+_0x4b42af[_0x190bea(0x11f)]);}return 0x1;}_0x3b3fce=_0x209890;}if(_0x3b3fce[_0x190bea(0xa8)]===0x0)return console[_0x190bea(0x133)](_0x190bea(0x105)),0x0;const _0x1a98cd=new Map();for(const _0x39d2cd of _0x3b3fce){const _0x43aa06=_0x39d2cd[_0x190bea(0xe8)];!_0x1a98cd[_0x190bea(0xc4)](_0x43aa06)&&_0x1a98cd['set'](_0x43aa06,[]),_0x1a98cd[_0x190bea(0x182)](_0x43aa06)[_0x190bea(0x16d)](_0x39d2cd);}for(const _0x1ec293 of _0x1a98cd['values']()){_0x1ec293[_0x190bea(0xaf)]((_0x1f83a7,_0x455c7d)=>(_0x1f83a7[_0x190bea(0x9a)]||0x0)-(_0x455c7d['versionNumber']||0x0));}const _0x2f08a9=[],{idToEmailMap:_0x48ad27,connectionIdToNameMap:_0x4237c1}=await withSpinner(_0x190bea(0x107),async()=>{const _0x363f7f=_0x190bea,[_0x2349a0,_0x4b983a]=await Promise[_0x363f7f(0x92)]([_0x3dc5e7['user'][_0x363f7f(0x99)](),_0x3dc5e7[_0x363f7f(0xac)][_0x363f7f(0xcb)]()]);return{'idToEmailMap':_0x2349a0,'connectionIdToNameMap':_0x4b983a};},{'verbose':_0x50eb65[_0x190bea(0x198)]})[_0x190bea(0xda)](_0x42d91c=>_0x42d91c[_0x190bea(0x19f)]);for(const _0x2f368f of _0x1a98cd[_0x190bea(0xa0)]()){const _0x1aa554=_0x2f368f[0x0][_0x190bea(0x11f)],_0x1ed508=_0x2f368f[0x0][_0x190bea(0x90)],_0x30960e=_0x1ed508?_0x2c27e4[_0x190bea(0x182)](_0x1ed508)||'':'',_0x21a37c=_0x30960e?a27_0x576223[_0x190bea(0x161)](_0x57a808,_0x30960e):_0x57a808,_0x2914ef=_0x5ef123||a27_0x576223['join'](_0x21a37c,sanitizeFileName(_0x1aa554)+_0x190bea(0x89));let _0x2acae6,_0x3312e7;if(existsSync(_0x2914ef))try{const _0x328098=readFileSync(_0x2914ef,_0x190bea(0x8e)),_0x20fdf5=parseYamlString(_0x328098);_0x3312e7=_0x20fdf5,_0x2acae6=buildRuleToNameMapping(_0x20fdf5),_0x2770e2[_0x190bea(0x198)]&&_0x2acae6[_0x190bea(0x181)]>0x0&&console[_0x190bea(0x133)]('Found\x20'+_0x2acae6[_0x190bea(0x181)]+_0x190bea(0xba)+_0x1aa554);}catch(_0x4740d8){_0x2770e2['verbose']&&console[_0x190bea(0x133)](_0x190bea(0xdf)+_0x4740d8[_0x190bea(0x19b)]);}const _0x3dd878=[],_0x32ac76=new Set(),_0x320c89=new Map(),_0x22a3eb=new Map(),_0x409bc5=new Set(),_0x3d1d6e=new Map(),_0x144b32=new Map(),_0x4ead6a=createJumpTargetCache();await withProgressSpinner(_0x190bea(0x143)+_0x1aa554+_0x190bea(0xb5),async _0x27c563=>{const _0x1f8749=_0x190bea;for(const _0x1d17bc of _0x2f368f){const _0x483037=_0x2f368f[_0x1f8749(0xa8)]>0x1?_0x1d17bc['journeyBundleName']+'\x20v'+(_0x1d17bc[_0x1f8749(0x9a)]||0x1):_0x1d17bc[_0x1f8749(0x11f)];_0x27c563[_0x1f8749(0x136)](_0x1f8749(0x143)+_0x483037);const _0x3f49a5=await _0x3dc5e7[_0x1f8749(0xe7)][_0x1f8749(0x10d)](_0x1d17bc['id']),_0x1064a3=_0x3f49a5[_0x1f8749(0x13c)]?.[_0x1f8749(0x151)],_0x533e71={'resolveSegment':async _0x508259=>{const _0x405895=_0x1f8749;if(!_0x1064a3)return{'name':_0x508259,'isJourneyLocal':![]};const _0x567e87=_0x320c89[_0x405895(0x182)](_0x508259);if(_0x567e87)return _0x567e87;try{const _0x77388e=await _0x3dc5e7[_0x405895(0xd3)]['getSegment'](_0x1064a3,_0x508259),_0x5c3c16=_0x77388e[_0x405895(0x18a)]===SEGMENT_KIND_JOURNEY;let _0x4027ab,_0xe5e58b=_0x77388e[_0x405895(0xad)];if(_0x5c3c16&&_0x77388e[_0x405895(0x14a)]){const _0x4c0a30=await segmentResponseToDef(_0x77388e,{'resolveSegmentName':async _0x30ac03=>{const _0x4a9c23=_0x405895,_0x208ae1=_0x320c89[_0x4a9c23(0x182)](_0x30ac03);if(_0x208ae1)return _0x208ae1['name'];const _0x1ede7d=await _0x533e71[_0x4a9c23(0x88)](_0x30ac03);return _0x1ede7d[_0x4a9c23(0xad)];}}),_0x292340=_0x4c0a30[_0x405895(0x14a)];_0x4027ab={'description':_0x77388e['description'],'rule':_0x292340};const _0x3ffb9f=serializeRule(_0x292340),_0x570c15=_0x22a3eb[_0x405895(0x182)](_0x3ffb9f);if(_0x570c15)_0xe5e58b=_0x570c15,_0x4027ab=undefined,_0x2770e2[_0x405895(0x198)]&&console[_0x405895(0x133)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x77388e[_0x405895(0xad)]+_0x405895(0x12e)+_0x570c15);else{let _0x379515=![];if(_0x2acae6){const _0x36434d=_0x2acae6[_0x405895(0x182)](_0x3ffb9f);if(_0x36434d){const _0x3d4677=_0x36434d[_0x405895(0x101)](_0x151d43=>!_0x32ac76[_0x405895(0xc4)](_0x151d43));_0x3d4677&&(_0xe5e58b=_0x3d4677,_0x32ac76['add'](_0x3d4677),_0x22a3eb[_0x405895(0x162)](_0x3ffb9f,_0x3d4677),_0x379515=!![],_0x2770e2[_0x405895(0x198)]&&console[_0x405895(0x133)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x3d4677+_0x405895(0x190)));}}if(!_0x379515){const _0x6dbeaf=generateJourneyLocalName(_0x77388e['name']);_0x6dbeaf&&(_0xe5e58b=_0x6dbeaf);let _0x5a898d=_0xe5e58b,_0x2cd1fc=0x2;while(_0x32ac76['has'](_0x5a898d)){_0x5a898d=_0xe5e58b+'_'+_0x2cd1fc,_0x2cd1fc++;}_0x32ac76[_0x405895(0x125)](_0x5a898d),_0x22a3eb[_0x405895(0x162)](_0x3ffb9f,_0x5a898d),_0xe5e58b=_0x5a898d;}}}const _0xce502b={'name':_0xe5e58b,'isJourneyLocal':_0x5c3c16,'definition':_0x4027ab};return _0x320c89[_0x405895(0x162)](_0x508259,_0xce502b),_0xce502b;}catch(_0x1cc926){return _0x50eb65[_0x405895(0x198)]&&console[_0x405895(0x133)](_0x405895(0xaa)+_0x508259+':\x20'+_0x1cc926[_0x405895(0x19b)]),{'name':_0x508259,'isJourneyLocal':![]};}},'resolveActivation':async _0x6d7897=>{const _0x123818=_0x1f8749,_0xb4b251=_0x3d1d6e[_0x123818(0x182)](_0x6d7897);if(_0xb4b251)return _0xb4b251;try{const _0xbe3621=await _0x3dc5e7[_0x123818(0xe7)][_0x123818(0xa5)](_0x1d17bc['id'],_0x6d7897),_0x5f09fd=journeyActivationStepToYaml(_0xbe3621,_0x48ad27,_0x4237c1),_0xbe7dec=JSON[_0x123818(0xea)]({'name':_0x5f09fd[_0x123818(0xad)],'connection':_0x5f09fd[_0x123818(0xac)],'connector_config':_0x5f09fd[_0x123818(0xef)]}),_0x202081=_0x144b32[_0x123818(0x182)](_0xbe7dec);if(_0x202081){const _0x3bdbf1={'name':_0x202081,'isJourneyLocal':!![],'definition':_0x5f09fd};return _0x3d1d6e[_0x123818(0x162)](_0x6d7897,_0x3bdbf1),_0x3bdbf1;}const _0x5b58aa=_0xbe3621[_0x123818(0x13c)]['activationParams']['name']||_0x6d7897,_0x39199f=sanitizeYamlKey(_0x5b58aa)||'activation_'+_0x6d7897;let _0xe3fbc3=_0x39199f,_0x1689e7=0x2;while(_0x409bc5[_0x123818(0xc4)](_0xe3fbc3)){_0xe3fbc3=_0x39199f+'_'+_0x1689e7,_0x1689e7++;}_0x409bc5['add'](_0xe3fbc3),_0x144b32[_0x123818(0x162)](_0xbe7dec,_0xe3fbc3);const _0x306809={'name':_0xe3fbc3,'isJourneyLocal':!![],'definition':_0x5f09fd};return _0x3d1d6e['set'](_0x6d7897,_0x306809),_0x306809;}catch(_0xc02063){return _0x50eb65[_0x123818(0x198)]&&console['error'](_0x123818(0x164)+_0x6d7897+':\x20'+_0xc02063[_0x123818(0x19b)]),{'name':_0x6d7897,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x405f9f,_0x4285a1)=>{const _0x2bf3ff=_0x1f8749;return resolveJumpTarget(_0x405f9f,_0x4285a1,_0x4ead6a,_0x4af410=>_0x3dc5e7[_0x2bf3ff(0xe7)][_0x2bf3ff(0x10d)](_0x4af410));}},_0x92ee58=await journeyResponseToDef(_0x3f49a5,_0x533e71);_0x3dd878[_0x1f8749(0x16d)]({'item':_0x1d17bc,'yaml':_0x92ee58});}},{'verbose':_0x50eb65[_0x190bea(0x198)]});const _0x32faec=await _0x3dc5e7[_0x190bea(0xe7)][_0x190bea(0xcf)](_0x2f368f[0x0][_0x190bea(0xe8)]),_0x4eb849=buildMergedJourneyDef(_0x3dd878,_0x2acae6,_0x32faec),_0x4e3000=normalizeJourneyDef(_0x4eb849,_0x3312e7),_0x294a5=toYamlString(_0x4e3000),_0x42fbac=_0x5ef123||a27_0x576223['join'](_0x21a37c,sanitizeFileName(_0x1aa554)+_0x190bea(0x89));!_0x5ef123&&_0x30960e&&!existsSync(_0x21a37c)&&mkdirSync(_0x21a37c,{'recursive':!![]});const _0x4e4412=a27_0x576223[_0x190bea(0x106)](process[_0x190bea(0x128)](),_0x42fbac);if(existsSync(_0x42fbac)){const _0xa02e24=readFileSync(_0x42fbac,'utf-8'),_0x26fba5=generateDiff(_0xa02e24,_0x294a5),_0x4064ba=hasChanges(_0x26fba5);_0x2f08a9['push']({'relativePath':_0x4e4412,'absolutePath':_0x42fbac,'content':_0x294a5,'isNew':![],'hasChanges':_0x4064ba,'diff':_0x4064ba?formatDiffWithColors(_0x26fba5):undefined});}else _0x2f08a9[_0x190bea(0x16d)]({'relativePath':_0x4e4412,'absolutePath':_0x42fbac,'content':_0x294a5,'isNew':!![],'hasChanges':![]});}const _0x521bcd=_0x2f08a9[_0x190bea(0xe1)](_0x262051=>_0x262051[_0x190bea(0x118)]),_0x868edd=_0x2f08a9[_0x190bea(0xe1)](_0x549fc1=>!_0x549fc1[_0x190bea(0x118)]&&_0x549fc1['hasChanges']),_0x40753e=_0x2f08a9['filter'](_0x40362e=>!_0x40362e[_0x190bea(0x118)]&&!_0x40362e[_0x190bea(0xdb)]),_0x393bf5=_0x3b3fce[_0x190bea(0xa8)],_0x10d2a1=_0x1a98cd[_0x190bea(0x181)],_0x4fc624=_0x393bf5>_0x10d2a1?'\x20('+_0x393bf5+'\x20versions)':'';console[_0x190bea(0x133)](_0x190bea(0x10c)),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216[_0x190bea(0x84)](_0x10d2a1+_0x190bea(0xf0))+a27_0x2a8216[_0x190bea(0x10e)](_0x4fc624)),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216['green']('+\x20'+_0x521bcd['length']+'\x20new\x20files')),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216[_0x190bea(0xa6)]('~\x20'+_0x868edd[_0x190bea(0xa8)]+_0x190bea(0x174))),console['error']('\x20\x20'+a27_0x2a8216[_0x190bea(0x10e)]('=\x20'+_0x40753e[_0x190bea(0xa8)]+_0x190bea(0x87))),console[_0x190bea(0x133)](_0x190bea(0x194)+a27_0x2a8216['cyan'](_0x57a808)+'\x0a');if(_0x868edd[_0x190bea(0xa8)]>0x0)for(const _0x2983f8 of _0x868edd){console[_0x190bea(0x133)](_0x190bea(0x114)+_0x2983f8[_0x190bea(0x8c)]+'\x27:'),console[_0x190bea(0x133)]('─'[_0x190bea(0xde)](0x3c)),console[_0x190bea(0x133)](_0x2983f8[_0x190bea(0x116)]),console[_0x190bea(0x133)]('─'['repeat'](0x3c));}if(_0x2770e2[_0x190bea(0x173)])return console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0xa6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x521bcd['length']===0x0&&_0x868edd['length']===0x0)return console['error'](a27_0x2a8216[_0x190bea(0x1a0)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x45ce42},_0x2770e2[_0x190bea(0x132)]),console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a0)](_0x190bea(0xe3)+a27_0x2a8216[_0x190bea(0x10e)](_0x190bea(0x156))+_0x190bea(0x18f)+a27_0x2a8216[_0x190bea(0x84)](_0x45ce42))),0x0;if(!_0x2770e2[_0x190bea(0x15d)]&&(_0x521bcd['length']>0x0||_0x868edd[_0x190bea(0xa8)]>0x0)){if(!isInteractive())return console['error'](a27_0x2a8216['red'](_0x190bea(0x188)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x10e)](_0x190bea(0x19c))),0x1;const _0x450cc1=await confirmKey(_0x190bea(0xbb)+(_0x521bcd[_0x190bea(0xa8)]+_0x868edd['length'])+'\x20files?');if(!_0x450cc1)return console['error'](a27_0x2a8216[_0x190bea(0xa6)](_0x190bea(0x191)),_0x190bea(0xcd)),0x1;}!existsSync(_0x57a808)&&mkdirSync(_0x57a808,{'recursive':!![]});const _0x3ff38e=a27_0x576223[_0x190bea(0x161)](_0x57a808,_0x190bea(0x141));writeFileSync(_0x3ff38e,createTdxConfigContent(_0x45ce42),_0x190bea(0x8e));for(const _0x37b201 of _0x2f08a9){(_0x37b201[_0x190bea(0x118)]||_0x37b201['hasChanges'])&&writeFileSync(_0x37b201[_0x190bea(0x8f)],_0x37b201[_0x190bea(0x86)],'utf-8');}return console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a0)](_0x190bea(0x102)+(_0x521bcd[_0x190bea(0xa8)]+_0x868edd[_0x190bea(0xa8)])+_0x190bea(0x19a)+_0x57a808)),saveSessionContext({'parent_segment':_0x45ce42},_0x2770e2[_0x190bea(0x132)]),console['error'](a27_0x2a8216['green'](_0x190bea(0xe3)+a27_0x2a8216['dim']('parent_segment')+_0x190bea(0x18f)+a27_0x2a8216[_0x190bea(0x84)](_0x45ce42))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x137);[a27_0x4c00bc(0xa4)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x4c00bc(0x104)](_0x456ec7){const _0x301631=a27_0x4c00bc,{options:_0x55089c,args:_0x47bdfc,tdx:_0x1fa3d1}=_0x456ec7,_0x32ed95=_0x47bdfc[0x0];if(!requireNameOrPath(_0x32ed95))return 0x1;_0x55089c[_0x301631(0x198)]&&console['error']('Input:\x20'+_0x32ed95);const {journeyId:_0x161fe1}=await resolveJourneyIdFromInput(_0x32ed95,_0x55089c,_0x1fa3d1),_0x3e6d71=await withSpinner(_0x301631(0x111),()=>_0x1fa3d1['journey'][_0x301631(0x168)](_0x161fe1),{'verbose':_0x55089c[_0x301631(0x198)]}),_0x4b43e4=_0x3e6d71[_0x301631(0x19f)];return console[_0x301631(0x109)]('Database:\x20'+_0x4b43e4[_0x301631(0x10a)]),console[_0x301631(0x109)](_0x301631(0x158)+_0x4b43e4[_0x301631(0xa9)]),await handleSDKOutput(_0x4b43e4[_0x301631(0x14b)],_0x55089c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a27_0x4c00bc(0xa4)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x4c00bc(0x104)](_0x108f64){const _0x39dfd0=a27_0x4c00bc,{options:_0x1b97a4,args:_0x5ac393,tdx:_0x1ade52}=_0x108f64,_0xb57d15=_0x5ac393[0x0];if(!requireNameOrPath(_0xb57d15))return 0x1;_0x1b97a4[_0x39dfd0(0x198)]&&console[_0x39dfd0(0x133)]('Input:\x20'+_0xb57d15);const {journeyId:_0x1aefe0}=await resolveJourneyIdFromInput(_0xb57d15,_0x1b97a4,_0x1ade52),_0x2fde32=await withSpinner(_0x39dfd0(0x15e),()=>_0x1ade52[_0x39dfd0(0xe7)]['listActivationsFlat'](_0x1aefe0),{'verbose':_0x1b97a4['verbose']}),_0x1606c1=_0x2fde32[_0x39dfd0(0x19f)];return console['error']('Found\x20'+_0x1606c1[_0x39dfd0(0xa8)]+_0x39dfd0(0x16a)+(_0x1606c1[_0x39dfd0(0xa8)]!==0x1?'s':'')),await handleSDKOutput(_0x1606c1,_0x1b97a4),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:push';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xb2);[a27_0x4c00bc(0x9b)]=new SegmentPushCommand();async[a27_0x4c00bc(0x104)](_0x3b3232){const _0x58de36=a27_0x4c00bc,_0x5f7c69=_0x3b3232[_0x58de36(0xfb)][0x0];let _0x4ef3c8;if(_0x5f7c69){const _0x5dafd8=await resolveTarget({'arg':_0x5f7c69,'contextParent':_0x3b3232[_0x58de36(0x129)]['parentSegment'],'cwd':process['cwd']()});isSuccessfulResolution(_0x5dafd8)&&_0x5dafd8[_0x58de36(0x15f)]==='file'&&(_0x4ef3c8=_0x5dafd8[_0x58de36(0xd6)]);}const _0x4f0688={..._0x3b3232,'options':{..._0x3b3232[_0x58de36(0x129)],'journeysOnly':!![],..._0x4ef3c8&&{'singleFilePath':_0x4ef3c8}}};return this[_0x58de36(0x9b)][_0x58de36(0x104)](_0x4f0688);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:versions';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xf7);async['execute'](_0x159546){const _0xcdeb5a=a27_0x4c00bc,{options:_0x1c66c8,args:_0x127e1e,tdx:_0x4c68bd}=_0x159546,_0x34319f=_0x127e1e[0x0];if(!requireNameOrPath(_0x34319f))return 0x1;if(_0x1c66c8[_0xcdeb5a(0x198)])console[_0xcdeb5a(0x133)]('Input:\x20'+_0x34319f);const {journeyId:_0x154655}=await resolveJourneyIdFromInput(_0x34319f,_0x1c66c8,_0x4c68bd),_0x293ae2=await withSpinner(_0xcdeb5a(0x17f),()=>_0x4c68bd[_0xcdeb5a(0xe7)][_0xcdeb5a(0x15b)](_0x154655),{'verbose':_0x1c66c8[_0xcdeb5a(0x198)]}),{bundleName:_0x51c7d3,versions:_0x1d4861,latestJourneyId:_0x2c1d34}=_0x293ae2['data'];console[_0xcdeb5a(0x133)](_0x51c7d3+':\x20'+_0x1d4861[_0xcdeb5a(0xa8)]+_0xcdeb5a(0x11c)+(_0x1d4861['length']!==0x1?'s':''));const _0x4e11e6=_0x1d4861[_0xcdeb5a(0x1a5)](_0x10d87b=>({'version':_0x10d87b[_0xcdeb5a(0x9a)],'journey_id':_0x10d87b[_0xcdeb5a(0xce)],'name':_0x10d87b[_0xcdeb5a(0xad)],'state':_0x10d87b[_0xcdeb5a(0x199)],'paused':_0x10d87b['paused'],'latest':_0x10d87b[_0xcdeb5a(0xce)]===_0x2c1d34,'created_at':_0x10d87b['createdAt']}));return await handleSDKOutput(_0x4e11e6,_0x1c66c8),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:version:create';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x14d);async[a27_0x4c00bc(0x104)](_0x316729){const _0x1aaa0b=a27_0x4c00bc,{options:_0x426742,args:_0x170d10,tdx:_0x19e69f}=_0x316729,_0x485eaf=_0x170d10[0x0];if(!requireNameOrPath(_0x485eaf))return 0x1;if(_0x426742[_0x1aaa0b(0x198)])console[_0x1aaa0b(0x133)]('Input:\x20'+_0x485eaf);const {journeyId:_0x20633a,journeyName:_0x3ed3eb}=await resolveJourneyIdFromInput(_0x485eaf,_0x426742,_0x19e69f);if(!_0x426742[_0x1aaa0b(0x15d)]){const _0x4c8ff6=await confirm(_0x1aaa0b(0x167)+_0x3ed3eb+'\x22?');if(!_0x4c8ff6)return console[_0x1aaa0b(0x133)](_0x1aaa0b(0xb0)),0x0;}const _0x23f86a=await withSpinner(_0x1aaa0b(0x11e),()=>_0x19e69f['journey'][_0x1aaa0b(0x18b)](_0x20633a),{'verbose':_0x426742[_0x1aaa0b(0x198)]}),_0x287c7f=_0x23f86a[_0x1aaa0b(0x19f)];return console[_0x1aaa0b(0x133)](a27_0x2a8216[_0x1aaa0b(0x1a0)]('✔')+_0x1aaa0b(0xf4)+_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0x9a)]+'\x20(draft)\x20—\x20\x22'+_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0xad)]+'\x22'),console[_0x1aaa0b(0x133)](_0x1aaa0b(0x14f)+_0x287c7f['id']),await handleSingleObjectOutput({'id':_0x287c7f['id'],'name':_0x287c7f['attributes'][_0x1aaa0b(0xad)],'version':_0x287c7f[_0x1aaa0b(0x13c)]['versionNumber'],'state':_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0x199)],'bundle_id':_0x287c7f['attributes'][_0x1aaa0b(0xe8)],'created_at':_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0xdc)]},_0x426742),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:version:view';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x123);async['execute'](_0x1b5e04){const _0x65dffc=a27_0x4c00bc,{options:_0x192093,args:_0x298392,tdx:_0x453bc6}=_0x1b5e04,_0x40c551=_0x298392[0x0];if(!requireNameOrPath(_0x40c551))return 0x1;const _0x1ec4b1=_0x192093[_0x65dffc(0x9e)];if(!_0x1ec4b1)return console[_0x65dffc(0x133)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x65dffc(0x133)](_0x65dffc(0x1a1)),0x1;const _0x3abd0f=parseInt(_0x1ec4b1,0xa);if(isNaN(_0x3abd0f)||_0x3abd0f<0x1)return console[_0x65dffc(0x133)](_0x65dffc(0x160)+_0x1ec4b1),0x1;if(_0x192093[_0x65dffc(0x198)])console[_0x65dffc(0x133)](_0x65dffc(0x175)+_0x40c551+',\x20version:\x20'+_0x3abd0f);const {journeyId:_0x54ebf2,parentSegmentId:_0x1e819a}=await resolveJourneyIdFromInput(_0x40c551,_0x192093,_0x453bc6),_0x19e2bc=await withSpinner(_0x65dffc(0x11b),()=>_0x453bc6['journey']['listVersions'](_0x54ebf2),{'verbose':_0x192093['verbose']}),{versions:_0x2b7bfb,latestJourneyId:_0x2b0c55}=_0x19e2bc['data'],_0x1a0548=_0x2b7bfb[_0x65dffc(0x101)](_0x57a90e=>_0x57a90e[_0x65dffc(0x9a)]===_0x3abd0f);if(!_0x1a0548){const _0x3dd5f3=_0x2b7bfb[_0x65dffc(0x1a5)](_0x5db883=>'v'+_0x5db883[_0x65dffc(0x9a)])[_0x65dffc(0x161)](',\x20');return console[_0x65dffc(0x133)](_0x65dffc(0x14c)+_0x3abd0f+_0x65dffc(0x187)+_0x3dd5f3),0x1;}const _0x582b88=await withSpinner(_0x65dffc(0xe0)+_0x3abd0f+_0x65dffc(0x17a),()=>_0x453bc6[_0x65dffc(0xe7)][_0x65dffc(0x10d)](_0x1a0548[_0x65dffc(0xce)]),{'verbose':_0x192093[_0x65dffc(0x198)]}),_0x54a82c=_0x582b88[_0x65dffc(0x19f)],_0x4ddece=getConsoleNextUrl(_0x192093['site'],'/app/ps/'+_0x1e819a+_0x65dffc(0xd2)+_0x1a0548[_0x65dffc(0xce)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x54a82c['id'],'name':_0x54a82c['attributes']['name'],'version':_0x54a82c['attributes']['versionNumber'],'description':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xa4)],'state':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0x199)],'paused':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xc5)],'reentry_mode':_0x54a82c['attributes'][_0x65dffc(0x166)],'stages':_0x54a82c['attributes'][_0x65dffc(0x131)]?.[_0x65dffc(0xa8)]||0x0,..._0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xe5)]&&{'goal':_0x54a82c['attributes']['goal']['name']},'latest':_0x1a0548[_0x65dffc(0xce)]===_0x2b0c55,'created_at':_0x54a82c[_0x65dffc(0x13c)]['createdAt'],'updated_at':_0x54a82c['attributes'][_0x65dffc(0x130)],'url':_0x4ddece},_0x192093),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x38ee08=a28_0x18c2;(function(_0x477c56,_0xfd7b1d){const _0x3ca0cb=a28_0x18c2,_0x3964c2=_0x477c56();while(!![]){try{const _0x21653e=parseInt(_0x3ca0cb(0x125))/0x1+-parseInt(_0x3ca0cb(0x114))/0x2+-parseInt(_0x3ca0cb(0x11a))/0x3+-parseInt(_0x3ca0cb(0x113))/0x4+-parseInt(_0x3ca0cb(0x105))/0x5+parseInt(_0x3ca0cb(0x112))/0x6*(parseInt(_0x3ca0cb(0x119))/0x7)+parseInt(_0x3ca0cb(0x110))/0x8*(parseInt(_0x3ca0cb(0x126))/0x9);if(_0x21653e===_0xfd7b1d)break;else _0x3964c2['push'](_0x3964c2['shift']());}catch(_0x103a6f){_0x3964c2['push'](_0x3964c2['shift']());}}}(a28_0x3666,0x6ef16));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x18c2(_0x5ffed8,_0x19a243){_0x5ffed8=_0x5ffed8-0xf2;const _0x366693=a28_0x3666();let _0x18c260=_0x366693[_0x5ffed8];return _0x18c260;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x42fa77 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0x3666(){const _0x42ffe3=['\x20valid','warnings','skippedCount','\x20segment\x20file(s)\x20skipped)','journey:validate','40090zUOQkF','verbose','filePath','red','\x20journey(s)\x20valid','warningCount','dim','Validation\x20failed:\x20','yellow','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','700968QCxiys','validCount','6BLVuBv','303140sjWrdu','1481282upmSjG','errorCode','hasErrors','helpText','no_parent','860902cnLXRd','1805736HzFUhK','No\x20journey\x20YAML\x20files\x20found\x20in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errors','✔\x20All\x20','\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','name','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','green','targetDir','\x20warning(s)','268235lLzjcN','153TzSatR','type','error','\x20error(s)','\x20(skipped:\x20','execute','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','relativePath','filter','log','\x20warning(s)\x20found','Validate\x20journey\x20YAML\x20files','parentSegment','.yml','file','\x20journey(s)\x20with\x20errors,\x20','\x20segment\x20file(s)\x20skipped','length','description','valid'];a28_0x3666=function(){return _0x42ffe3;};return a28_0x3666();}export class JourneyValidateCommand extends BaseCommand{[a28_0x38ee08(0x120)]=a28_0x38ee08(0x104);[a28_0x38ee08(0xfe)]=a28_0x38ee08(0xf7);async[a28_0x38ee08(0x12b)](_0x3390a4){const _0x3493aa=a28_0x38ee08,{options:_0x2df516,args:_0x2b1eb1}=_0x3390a4,_0x2488fb=_0x2df516,_0x5643f1=await resolveTarget({'arg':_0x2b1eb1[0x0],'contextParent':_0x2df516[_0x3493aa(0xf8)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5643f1))return _0x5643f1[_0x3493aa(0x115)]===_0x3493aa(0x118)?(console[_0x3493aa(0x128)](a28_0x42fa77[_0x3493aa(0x10d)](_0x3493aa(0x11c))),console[_0x3493aa(0x128)](_0x3493aa(0xf2)),console[_0x3493aa(0x128)](_0x3493aa(0x11f)),console[_0x3493aa(0x128)](_0x3493aa(0x10f))):(console[_0x3493aa(0x128)](a28_0x42fa77[_0x3493aa(0x108)]('Error:\x20'+_0x5643f1['message']+'\x0a')),_0x5643f1[_0x3493aa(0x117)]&&console[_0x3493aa(0x128)](a28_0x42fa77['cyan'](_0x5643f1[_0x3493aa(0x117)]))),0x1;const _0x1f3e1b=_0x5643f1[_0x3493aa(0x123)],_0x4bf7d4=_0x5643f1[_0x3493aa(0x127)]===_0x3493aa(0xfa)?_0x5643f1[_0x3493aa(0x107)]:undefined;if(!_0x4bf7d4&&!existsSync(_0x1f3e1b))return console['error'](a28_0x42fa77[_0x3493aa(0x108)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1f3e1b+'\x0a')),0x1;let _0xe1a140;if(_0x4bf7d4){if(!_0x4bf7d4[_0x3493aa(0x10e)](_0x3493aa(0xf9))&&!_0x4bf7d4[_0x3493aa(0x10e)]('.yaml'))return console['error'](a28_0x42fa77[_0x3493aa(0x108)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x4bf7d4+'\x0a')),0x1;_0xe1a140=[_0x4bf7d4];}else _0xe1a140=findYamlFiles(_0x1f3e1b);if(_0xe1a140[_0x3493aa(0xfd)]===0x0)return console['error'](a28_0x42fa77[_0x3493aa(0x108)](_0x3493aa(0x121)+_0x1f3e1b+'\x0a')),0x1;const _0x2cf0ee=validateYamlFiles(_0xe1a140,_0x1f3e1b,{'filterType':'journey'}),_0x5ce08c=calculateSummary(_0x2cf0ee),_0x5c556f=_0x2cf0ee[_0x3493aa(0xf4)](isValidationResult);if(_0x5c556f[_0x3493aa(0xfd)]===0x0)return console['error'](a28_0x42fa77[_0x3493aa(0x10d)](_0x3493aa(0x11b)+_0x1f3e1b+'\x0a')),_0x5ce08c[_0x3493aa(0x102)]>0x0&&console[_0x3493aa(0x128)](a28_0x42fa77[_0x3493aa(0x10b)]('('+_0x5ce08c[_0x3493aa(0x102)]+_0x3493aa(0x103))),0x0;for(const _0x290feb of _0x2cf0ee){if(!isValidationResult(_0x290feb)){_0x2488fb[_0x3493aa(0x106)]&&console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x10b)]('-\x20'+_0x290feb[_0x3493aa(0xf3)]+_0x3493aa(0x12a)+_0x290feb['reason']+')'));continue;}const {relativePath:_0x401d79,source:_0x3a927b,result:_0x1b3f55}=_0x290feb;if(_0x1b3f55[_0x3493aa(0xff)]&&_0x1b3f55['warnings'][_0x3493aa(0xfd)]===0x0)_0x2488fb[_0x3493aa(0x106)]&&console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x122)]('✔\x20'+_0x401d79));else _0x1b3f55[_0x3493aa(0xff)]?(console['log'](a28_0x42fa77[_0x3493aa(0x10d)]('⚠\x20'+_0x401d79+':\x20'+_0x1b3f55[_0x3493aa(0x101)][_0x3493aa(0xfd)]+_0x3493aa(0x124))),console[_0x3493aa(0xf5)](formatValidationResult(_0x1b3f55,_0x3a927b,_0x401d79))):(console[_0x3493aa(0xf5)](a28_0x42fa77['red']('✖\x20'+_0x401d79+':\x20'+_0x1b3f55[_0x3493aa(0x11d)][_0x3493aa(0xfd)]+_0x3493aa(0x129))),console['log'](formatValidationResult(_0x1b3f55,_0x3a927b,_0x401d79)));}return console['log'](''),_0x5ce08c[_0x3493aa(0x116)]?(console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x108)](_0x3493aa(0x10c)+_0x5ce08c['invalidCount']+_0x3493aa(0xfb)+_0x5ce08c[_0x3493aa(0x111)]+_0x3493aa(0x100))),_0x5ce08c[_0x3493aa(0x10a)]>0x0&&console['log'](a28_0x42fa77[_0x3493aa(0x10d)](_0x5ce08c['warningCount']+_0x3493aa(0xf6))),_0x5ce08c[_0x3493aa(0x102)]>0x0&&console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x10b)](_0x5ce08c['skippedCount']+_0x3493aa(0xfc))),0x1):(console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x122)](_0x3493aa(0x11e)+_0x5ce08c[_0x3493aa(0x111)]+_0x3493aa(0x109))),_0x5ce08c[_0x3493aa(0x10a)]>0x0&&console[_0x3493aa(0xf5)](a28_0x42fa77[_0x3493aa(0x10d)](_0x5ce08c['warningCount']+_0x3493aa(0xf6))),_0x5ce08c[_0x3493aa(0x102)]>0x0&&console['log'](a28_0x42fa77['dim'](_0x5ce08c['skippedCount']+_0x3493aa(0xfc))),0x0);}}
|