@treasuredata/tdx 2026.3.54 β 2026.4.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +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/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.d.ts +27 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +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.d.ts +10 -0
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +61 -3
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +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/agent/types/agent-def.d.ts +43 -0
- package/dist/sdk/agent/types/agent-def.d.ts.map +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.d.ts +73 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +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.d.ts +28 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +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.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +2 -2
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +158 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workflow.d.ts +26 -0
- package/dist/sdk/types/workflow.d.ts.map +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.d.ts +22 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.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/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.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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 +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x330afd=a23_0x5161;(function(_0x282037,_0x5d8543){const _0x233753=a23_0x5161,_0x37f5de=_0x282037();while(!![]){try{const _0x14c35e=parseInt(_0x233753(0x18c))/0x1+parseInt(_0x233753(0x19f))/0x2+-parseInt(_0x233753(0x17b))/0x3+parseInt(_0x233753(0x180))/0x4+parseInt(_0x233753(0x182))/0x5+-parseInt(_0x233753(0x188))/0x6*(parseInt(_0x233753(0x1a2))/0x7)+-parseInt(_0x233753(0x197))/0x8*(-parseInt(_0x233753(0x18f))/0x9);if(_0x14c35e===_0x5d8543)break;else _0x37f5de['push'](_0x37f5de['shift']());}catch(_0x6db15e){_0x37f5de['push'](_0x37f5de['shift']());}}}(a23_0x2785,0xc855d));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';function a23_0x5161(_0x32cc5d,_0x28d811){_0x32cc5d=_0x32cc5d-0x171;const _0x278588=a23_0x2785();let _0x516101=_0x278588[_0x32cc5d];return _0x516101;}function a23_0x2785(){const _0x5f3fc6=['\x0aChanges\x20to\x20\x27','dryRun','files','engage_workspace','559640MOEsHH','counts','5085730dXhxHA','dirname','config','dim','cwd','error','18cvbqMD','yellow','Workspace\x20is\x20required.','absolutePath','1347474oTwEin','β\x20All\x20files\x20are\x20up\x20to\x20date','green','9YkJHOe','name','filter','red','workspace','Write\x20','\x20files\x20to\x20','templates','3541528CxNGTV','repeat','description','engage','Pull\x20templates\x20to\x20YAML\x20files','isNew','engage:template:pull','\x20templates','385294jyBgyN','No\x20templates\x20found\x20in\x20workspace\x20\x27','-\x20no\x20files\x20written','3193953NklcAI','Aborted.','targetDir','\x20changed\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','β\x20Context\x20set:\x20','\x20files?','\x0aPull\x20summary\x20for\x20workspace\x20\x27','hasChanges','cyan','session','β\x20Pulled\x20','\x20\x20Target:\x20','length','workspaceName','\x0aError:','2851374itpRBu'];a23_0x2785=function(){return _0x5f3fc6;};return a23_0x2785();}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a23_0x31be8e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x2e49df from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x330afd(0x190)]=a23_0x330afd(0x19d);[a23_0x330afd(0x199)]=a23_0x330afd(0x19b);async['execute'](_0x54228a){const _0x252b50=a23_0x330afd,{options:_0x2d3301,args:_0x117efd,tdx:_0xd0320d}=_0x54228a,_0x3b0259=_0x2d3301,_0x2f7e4b=await resolveWorkspaceName(_0x117efd[0x0],_0x3b0259);if(!_0x2f7e4b)return console[_0x252b50(0x187)](a23_0x31be8e['yellow'](_0x252b50(0x18a))),console[_0x252b50(0x187)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console['error'](_0x252b50(0x1a6)),console[_0x252b50(0x187)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x345c63=await withProgressSpinner('Pulling\x20templates\x20from\x20\x27'+_0x2f7e4b+'\x27...',_0x5bc7ca=>pullTemplates({'engage':_0xd0320d[_0x252b50(0x19a)]},_0x2f7e4b,{'templateName':_0x3b0259['name'],'progress':{'update':_0x2d5d75=>{_0x5bc7ca['setPhase'](_0x2d5d75);}}}),{'verbose':_0x3b0259['verbose']}),_0x39f528=_0x345c63['data'];if(_0x39f528[_0x252b50(0x181)]['templates']===0x0)return console['error'](a23_0x31be8e[_0x252b50(0x189)](_0x252b50(0x1a0)+_0x39f528[_0x252b50(0x179)]+'\x27')),0x0;const _0x29bfc5=_0x39f528[_0x252b50(0x17e)][_0x252b50(0x191)](_0x1b0b44=>_0x1b0b44[_0x252b50(0x19c)]),_0x33bcea=_0x39f528[_0x252b50(0x17e)][_0x252b50(0x191)](_0x2a600a=>!_0x2a600a['isNew']&&_0x2a600a[_0x252b50(0x173)]),_0x53f1dc=_0x39f528['files'][_0x252b50(0x191)](_0x38bb19=>!_0x38bb19['isNew']&&!_0x38bb19['hasChanges']);console['error'](_0x252b50(0x172)+_0x39f528['workspaceName']+'\x27:'),console['error']('\x20\x20'+a23_0x31be8e[_0x252b50(0x174)](_0x39f528[_0x252b50(0x181)][_0x252b50(0x196)]+_0x252b50(0x19e))),console[_0x252b50(0x187)]('\x20\x20'+a23_0x31be8e[_0x252b50(0x18e)]('+\x20'+_0x29bfc5[_0x252b50(0x178)]+'\x20new\x20files')),console[_0x252b50(0x187)]('\x20\x20'+a23_0x31be8e[_0x252b50(0x189)]('~\x20'+_0x33bcea[_0x252b50(0x178)]+_0x252b50(0x1a5))),console['error']('\x20\x20'+a23_0x31be8e['dim']('=\x20'+_0x53f1dc['length']+'\x20unchanged\x20files')),console[_0x252b50(0x187)](_0x252b50(0x177)+a23_0x31be8e[_0x252b50(0x174)](_0x39f528[_0x252b50(0x1a4)])+'\x0a');if(_0x33bcea[_0x252b50(0x178)]>0x0)for(const _0x5397d3 of _0x33bcea){console[_0x252b50(0x187)](_0x252b50(0x17c)+_0x5397d3['relativePath']+'\x27:'),console[_0x252b50(0x187)]('β'[_0x252b50(0x198)](0x3c)),console[_0x252b50(0x187)](_0x5397d3['diff']),console['error']('β'[_0x252b50(0x198)](0x3c));}if(_0x3b0259[_0x252b50(0x17d)])return console[_0x252b50(0x187)](a23_0x31be8e[_0x252b50(0x189)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x29bfc5['length']===0x0&&_0x33bcea[_0x252b50(0x178)]===0x0)return console[_0x252b50(0x187)](a23_0x31be8e['green'](_0x252b50(0x18d))),saveSessionContext({'engage_workspace':_0x39f528[_0x252b50(0x179)]},_0x3b0259[_0x252b50(0x175)]),0x0;if(!_0x3b0259['yes']){if(!isInteractive())return console['error'](a23_0x31be8e[_0x252b50(0x192)](_0x252b50(0x17a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a23_0x31be8e[_0x252b50(0x185)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x584294=await confirmKey(_0x252b50(0x194)+(_0x29bfc5[_0x252b50(0x178)]+_0x33bcea[_0x252b50(0x178)])+_0x252b50(0x171));if(!_0x584294)return console['error'](a23_0x31be8e[_0x252b50(0x189)](_0x252b50(0x1a3)),_0x252b50(0x1a1)),0x1;}for(const _0x2d1bc7 of _0x39f528[_0x252b50(0x17e)]){if(_0x2d1bc7['isNew']||_0x2d1bc7['hasChanges']){const _0x1cd773=a23_0x2e49df[_0x252b50(0x183)](_0x2d1bc7[_0x252b50(0x18b)]);!existsSync(_0x1cd773)&&mkdirSync(_0x1cd773,{'recursive':!![]}),writeFileSync(_0x2d1bc7[_0x252b50(0x18b)],_0x2d1bc7['content'],'utf-8');}}return console['error'](a23_0x31be8e[_0x252b50(0x18e)](_0x252b50(0x176)+(_0x29bfc5[_0x252b50(0x178)]+_0x33bcea['length'])+_0x252b50(0x195)+_0x39f528[_0x252b50(0x1a4)])),saveSessionContext({'engage_workspace':_0x39f528['workspaceName']},_0x3b0259[_0x252b50(0x175)]),console[_0x252b50(0x187)](a23_0x31be8e[_0x252b50(0x18e)](_0x252b50(0x1a7)+a23_0x31be8e[_0x252b50(0x185)](_0x252b50(0x17f))+'\x20=\x20'+a23_0x31be8e[_0x252b50(0x174)](_0x39f528[_0x252b50(0x179)]))),0x0;}}async function resolveWorkspaceName(_0x33d9db,_0x25866b){const _0x427133=a23_0x330afd;if(_0x33d9db)return _0x33d9db;if(_0x25866b[_0x427133(0x193)])return _0x25866b[_0x427133(0x193)];const _0x2d18b5=tryFindTdxConfig(process[_0x427133(0x186)]());if(_0x2d18b5?.[_0x427133(0x184)][_0x427133(0x17f)])return _0x2d18b5[_0x427133(0x184)][_0x427133(0x17f)];const _0xd20127=loadSessionContext(_0x25866b['session']);if(_0xd20127?.[_0x427133(0x17f)])return _0xd20127['engage_workspace'];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x8033de=a24_0x37e5;(function(_0x56bcc2,_0x1089d1){const _0x27e092=a24_0x37e5,_0x1d211a=_0x56bcc2();while(!![]){try{const _0x28e00c=-parseInt(_0x27e092(0xde))/0x1*(-parseInt(_0x27e092(0xe9))/0x2)+-parseInt(_0x27e092(0x100))/0x3*(parseInt(_0x27e092(0xec))/0x4)+parseInt(_0x27e092(0xfa))/0x5+parseInt(_0x27e092(0xe0))/0x6*(-parseInt(_0x27e092(0xf6))/0x7)+parseInt(_0x27e092(0xd0))/0x8*(parseInt(_0x27e092(0xd8))/0x9)+-parseInt(_0x27e092(0xe3))/0xa+parseInt(_0x27e092(0xbd))/0xb;if(_0x28e00c===_0x1089d1)break;else _0x1d211a['push'](_0x1d211a['shift']());}catch(_0x408a72){_0x1d211a['push'](_0x1d211a['shift']());}}}(a24_0x15df,0xc007d));import{BaseCommand}from'./command.js';function a24_0x15df(){const _0x55387b=['16458222JIZeFp','message','Aborted.','filter','update','resolveWorkspaceId','cwd','red','\x20new\x20templates:','\x0aError:','templateId','Preparing\x20push\x20to\x20workspace\x20\x27','verbose','dryRun','dim','\x27...','green','\x20\x20\x20\x20','workspace','11992PCtXlF','β\x20Created\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','config','setPhase','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','engage','yellow','6111ZXAQDq','length','execute','resolve','No\x20template\x20YAML\x20files\x20found\x20in\x20','Resolving\x20references...','77Xwttyi','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2382cAALIv','engage_workspace','created','15421690PHVwWr','data','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','errors','1\x20template\x20file:\x20','Found\x20','27758bhiHSv','Workspace\x20is\x20required.','description','1076nkWggl','error','path','create','\x20templates','name','\x20errors:','action','site','session','10423xuVLqw','\x20templates?','Pushing\x20templates...','β\x20Updated\x20','4036190BaElsA','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\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','cyan','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','def','16395eOVWdV','-\x20no\x20changes\x20applied','results','updated','valid','relativePath','yes','warnings','\x0aValidation\x20errors\x20in\x20'];a24_0x15df=function(){return _0x55387b;};return a24_0x15df();}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_0x129c70 from'chalk';import a24_0x127784 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';function a24_0x37e5(_0x986465,_0x59d6c0){_0x986465=_0x986465-0xbc;const _0x15df5d=a24_0x15df();let _0x37e55c=_0x15df5d[_0x986465];return _0x37e55c;}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_0x8033de(0xf1)]='engage:template:push';[a24_0x8033de(0xeb)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x8033de(0xda)](_0x7bafa6){const _0x3ace9c=a24_0x8033de,{options:_0x1a7207,args:_0x50244d,tdx:_0x3a3f65}=_0x7bafa6,_0x40c7d1=_0x1a7207,_0x13d60e=_0x50244d[0x0],_0x4a16b7=_0x13d60e?a24_0x127784[_0x3ace9c(0xdb)](_0x13d60e):undefined,_0x1dde34=_0x4a16b7?isYamlFile(_0x4a16b7):![];let _0x5eb842;if(_0x1dde34&&_0x4a16b7)_0x5eb842=a24_0x127784['dirname'](_0x4a16b7);else _0x4a16b7?_0x5eb842=_0x4a16b7:_0x5eb842=process[_0x3ace9c(0xc3)]();let _0x261f50;const _0x1ffa12=tryFindTdxConfig(_0x5eb842);_0x1ffa12?.['config'][_0x3ace9c(0xe1)]&&(_0x261f50=_0x1ffa12[_0x3ace9c(0xd3)][_0x3ace9c(0xe1)],!_0x1dde34&&(_0x5eb842=_0x1ffa12['configDir']));_0x40c7d1[_0x3ace9c(0xcf)]&&(_0x261f50=_0x40c7d1[_0x3ace9c(0xcf)]);if(!_0x261f50){const _0x437e7a=loadSessionContext(_0x40c7d1[_0x3ace9c(0xf5)]);_0x437e7a?.[_0x3ace9c(0xe1)]&&(_0x261f50=_0x437e7a['engage_workspace']);}if(!_0x261f50)return console['error'](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xea))),console[_0x3ace9c(0xed)](_0x3ace9c(0xfc)),console[_0x3ace9c(0xed)](_0x3ace9c(0xd5)),console[_0x3ace9c(0xed)](_0x3ace9c(0xd2)),console[_0x3ace9c(0xed)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x211a54;_0x1dde34&&_0x4a16b7?_0x211a54=[parseTemplateFile(_0x4a16b7,a24_0x127784['dirname'](_0x4a16b7))]:_0x211a54=discoverAndParseTemplateFiles(_0x5eb842);if(_0x211a54[_0x3ace9c(0xd9)]===0x0)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xdc)+_0x5eb842)),console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcb)](_0x3ace9c(0xfb))),0x1;const _0x241892=_0x211a54['length']===0x1?_0x3ace9c(0xe7)+_0x211a54[0x0][_0x3ace9c(0xff)][_0x3ace9c(0xf1)]:_0x211a54[_0x3ace9c(0xd9)]+'\x20template\x20files';console[_0x3ace9c(0xed)](_0x3ace9c(0xe8)+a24_0x129c70[_0x3ace9c(0xfd)](_0x241892));let _0x362103=![];for(const _0x4b7076 of _0x211a54){const _0x22ba1c=validateTemplateDef(_0x4b7076[_0x3ace9c(0xff)]);if(!_0x22ba1c[_0x3ace9c(0x104)]){_0x362103=!![],console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xbc)+_0x4b7076[_0x3ace9c(0x105)]+':'));for(const _0x8acefa of _0x22ba1c[_0x3ace9c(0xe6)]){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xc4)]('β')+'\x20'+_0x8acefa['path']+':\x20'+_0x8acefa['message']);}}for(const _0x150948 of _0x22ba1c[_0x3ace9c(0x107)]){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xd7)]('β ')+'\x20'+_0x150948[_0x3ace9c(0xee)]+':\x20'+_0x150948[_0x3ace9c(0xbe)]);}}if(_0x362103)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xfe))),0x1;const _0x2204fc=await _0x3a3f65[_0x3ace9c(0xd6)][_0x3ace9c(0xc2)](_0x261f50),_0x160b09=await withProgressSpinner(_0x3ace9c(0xc8)+_0x261f50+_0x3ace9c(0xcc),_0x8180ca=>preparePush({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x211a54,_0x2204fc,{'progress':{'update':_0x49f2cd=>_0x8180ca[_0x3ace9c(0xd4)](_0x49f2cd)}}),{'verbose':_0x40c7d1['verbose']}),_0x201529=_0x160b09[_0x3ace9c(0xe4)];await withProgressSpinner(_0x3ace9c(0xdd),_0x16ba48=>resolveAndBuildInputs({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x201529,_0x2204fc,{'progress':{'update':_0x1e85d5=>_0x16ba48[_0x3ace9c(0xd4)](_0x1e85d5)}}),{'verbose':_0x40c7d1[_0x3ace9c(0xc9)]});const _0x1c9113=_0x201529[_0x3ace9c(0xc0)](_0x843618=>_0x843618['action']===_0x3ace9c(0xef)),_0x138caf=_0x201529[_0x3ace9c(0xc0)](_0x33991a=>_0x33991a['action']===_0x3ace9c(0xc1));console[_0x3ace9c(0xed)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x261f50+'\x27:');if(_0x1c9113[_0x3ace9c(0xd9)]>0x0){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xcd)]('+\x20'+_0x1c9113[_0x3ace9c(0xd9)]+_0x3ace9c(0xc5)));for(const _0x175fb0 of _0x1c9113){console[_0x3ace9c(0xed)](_0x3ace9c(0xce)+a24_0x129c70[_0x3ace9c(0xcd)]('+')+'\x20'+_0x175fb0['def']['name']);}}if(_0x138caf[_0x3ace9c(0xd9)]>0x0){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xd7)]('~\x20'+_0x138caf[_0x3ace9c(0xd9)]+'\x20templates\x20to\x20update:'));for(const _0x18c323 of _0x138caf){console['error'](_0x3ace9c(0xce)+a24_0x129c70['yellow']('~')+'\x20'+_0x18c323[_0x3ace9c(0xff)][_0x3ace9c(0xf1)]);}}if(_0x1c9113[_0x3ace9c(0xd9)]===0x0&&_0x138caf[_0x3ace9c(0xd9)]===0x0)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcd)]('β\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x40c7d1[_0x3ace9c(0xca)])return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xe5))),0x0;if(!_0x40c7d1[_0x3ace9c(0x106)]){if(!isInteractive())return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xc6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcb)](_0x3ace9c(0xdf))),0x1;const _0x520fd7=await confirmKey('Push\x20'+(_0x1c9113[_0x3ace9c(0xd9)]+_0x138caf[_0x3ace9c(0xd9)])+_0x3ace9c(0xf7));if(!_0x520fd7)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xbf)),_0x3ace9c(0x101)),0x1;}const _0x150f19=await withProgressSpinner(_0x3ace9c(0xf8),_0x90197c=>executePush({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x201529,{'progress':{'update':_0x166e75=>_0x90197c[_0x3ace9c(0xd4)](_0x166e75)}}),{'verbose':_0x40c7d1[_0x3ace9c(0xc9)]}),_0x364315=_0x150f19[_0x3ace9c(0xe4)];for(const _0x2b173e of _0x364315[_0x3ace9c(0x102)]){if(_0x2b173e[_0x3ace9c(0xc7)]&&(_0x2b173e['action']===_0x3ace9c(0xe2)||_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0x103))){const _0x7f05d1=getTemplateUrl(_0x40c7d1[_0x3ace9c(0xf4)],_0x2204fc,_0x2b173e[_0x3ace9c(0xc7)]),_0xb45d90=_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0xe2)?'+':'~',_0x29f2fa=_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0xe2)?a24_0x129c70[_0x3ace9c(0xcd)](_0xb45d90):a24_0x129c70['yellow'](_0xb45d90);console['error']('\x20\x20'+_0x29f2fa+'\x20'+hyperlink(_0x2b173e[_0x3ace9c(0xf1)],_0x7f05d1)+'\x20'+a24_0x129c70['dim'](_0x7f05d1));}}_0x364315[_0x3ace9c(0xe2)]>0x0&&console['error'](a24_0x129c70[_0x3ace9c(0xcd)](_0x3ace9c(0xd1)+_0x364315[_0x3ace9c(0xe2)]+'\x20templates'));_0x364315[_0x3ace9c(0x103)]>0x0&&console['error'](a24_0x129c70[_0x3ace9c(0xcd)](_0x3ace9c(0xf9)+_0x364315[_0x3ace9c(0x103)]+_0x3ace9c(0xf0)));if(_0x364315[_0x3ace9c(0xe6)]['length']>0x0){console[_0x3ace9c(0xed)](a24_0x129c70['red']('β\x20'+_0x364315[_0x3ace9c(0xe6)][_0x3ace9c(0xd9)]+_0x3ace9c(0xf2)));for(const _0x100b57 of _0x364315['errors']){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70['red'](_0x100b57['name'])+':\x20'+_0x100b57[_0x3ace9c(0xed)]);}}return saveSessionContext({'engage_workspace':_0x261f50},_0x40c7d1['session']),_0x364315[_0x3ace9c(0xe6)][_0x3ace9c(0xd9)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a24_0x20d278=a24_0x59bb;(function(_0x2e062b,_0x194831){const _0x34c01f=a24_0x59bb,_0x14613c=_0x2e062b();while(!![]){try{const _0x1bbe23=parseInt(_0x34c01f(0x1b8))/0x1*(-parseInt(_0x34c01f(0x1d5))/0x2)+parseInt(_0x34c01f(0x18d))/0x3+parseInt(_0x34c01f(0x1b9))/0x4+parseInt(_0x34c01f(0x19b))/0x5*(-parseInt(_0x34c01f(0x1c8))/0x6)+parseInt(_0x34c01f(0x192))/0x7*(parseInt(_0x34c01f(0x1c4))/0x8)+parseInt(_0x34c01f(0x1b2))/0x9*(parseInt(_0x34c01f(0x189))/0xa)+parseInt(_0x34c01f(0x1a5))/0xb;if(_0x1bbe23===_0x194831)break;else _0x14613c['push'](_0x14613c['shift']());}catch(_0x13bcd0){_0x14613c['push'](_0x14613c['shift']());}}}(a24_0x178a,0x8047e));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a24_0x59bb(_0x17d124,_0x59d4dd){_0x17d124=_0x17d124-0x189;const _0x178a6e=a24_0x178a();let _0x59bbbd=_0x178a6e[_0x17d124];return _0x59bbbd;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a24_0x178a(){const _0x192f22=['\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','β\x20Updated\x20','relativePath','2lQtMOL','928432lyYqPD','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','config','β\x20Created\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','action','Pushing\x20templates...','setPhase','dim','β\x20All\x20templates\x20are\x20up\x20to\x20date','cwd','8cOgakg','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','Push\x20','data','6qcZwzZ','execute','cyan','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x20templates?','length','\x20template\x20files','No\x20template\x20YAML\x20files\x20found\x20in\x20','def','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','session','filter','engage_workspace','915322ccmpUi','2680vblVUh','configDir','dirname','\x20\x20\x20\x20','1922757AMryWZ','Aborted.','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','errors','171857rrbYVR','path','green','description','message','resolve','\x0aValidation\x20errors\x20in\x20','name','engage','917265ipwVkw','create','workspace','updated','templateId','-\x20no\x20changes\x20applied','yellow','created','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','Workspace\x20is\x20required.','3202485qmWZrO','red','yes','warnings','1\x20template\x20file:\x20','\x20templates','Resolving\x20references...','update','site','\x20errors:','Found\x20','results','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','14625cEngnp','verbose','dryRun'];a24_0x178a=function(){return _0x192f22;};return a24_0x178a();}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x59ec54 from'chalk';import a24_0x44e6fa from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x20d278(0x199)]='engage:template:push';[a24_0x20d278(0x195)]=a24_0x20d278(0x1bd);async[a24_0x20d278(0x1c9)](_0x44b034){const _0x5096f8=a24_0x20d278,{options:_0x44180d,args:_0x33431e,tdx:_0x54cdde}=_0x44b034,_0x780568=_0x44180d,_0xecfef=_0x33431e[0x0],_0x1790a3=_0xecfef?a24_0x44e6fa[_0x5096f8(0x197)](_0xecfef):undefined,_0x529f18=_0x1790a3?isYamlFile(_0x1790a3):![];let _0x231bf7;if(_0x529f18&&_0x1790a3)_0x231bf7=a24_0x44e6fa[_0x5096f8(0x18b)](_0x1790a3);else _0x1790a3?_0x231bf7=_0x1790a3:_0x231bf7=process[_0x5096f8(0x1c3)]();let _0x39873c;const _0x206ddb=tryFindTdxConfig(_0x231bf7);_0x206ddb?.['config']['engage_workspace']&&(_0x39873c=_0x206ddb[_0x5096f8(0x1bb)][_0x5096f8(0x1d4)],!_0x529f18&&(_0x231bf7=_0x206ddb[_0x5096f8(0x18a)]));_0x780568['workspace']&&(_0x39873c=_0x780568[_0x5096f8(0x19d)]);if(!_0x39873c){const _0x4487f4=loadSessionContext(_0x780568[_0x5096f8(0x1d2)]);_0x4487f4?.['engage_workspace']&&(_0x39873c=_0x4487f4['engage_workspace']);}if(!_0x39873c)return console[_0x5096f8(0x18f)](a24_0x59ec54[_0x5096f8(0x1a1)](_0x5096f8(0x1a4))),console['error']('\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console[_0x5096f8(0x18f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console[_0x5096f8(0x18f)](_0x5096f8(0x190)),console[_0x5096f8(0x18f)](_0x5096f8(0x1a3)),0x1;let _0xc303d0;_0x529f18&&_0x1790a3?_0xc303d0=[parseTemplateFile(_0x1790a3,a24_0x44e6fa[_0x5096f8(0x18b)](_0x1790a3))]:_0xc303d0=discoverAndParseTemplateFiles(_0x231bf7);if(_0xc303d0['length']===0x0)return console[_0x5096f8(0x18f)](a24_0x59ec54[_0x5096f8(0x1a1)](_0x5096f8(0x1cf)+_0x231bf7)),console['error'](a24_0x59ec54['dim'](_0x5096f8(0x1c5))),0x1;const _0xe54337=_0xc303d0[_0x5096f8(0x1cd)]===0x1?_0x5096f8(0x1a9)+_0xc303d0[0x0][_0x5096f8(0x1d0)]['name']:_0xc303d0[_0x5096f8(0x1cd)]+_0x5096f8(0x1ce);console[_0x5096f8(0x18f)](_0x5096f8(0x1af)+a24_0x59ec54[_0x5096f8(0x1ca)](_0xe54337));let _0xc4913c=![];for(const _0x21ce14 of _0xc303d0){const _0x124a9d=validateTemplateDef(_0x21ce14[_0x5096f8(0x1d0)]);if(!_0x124a9d['valid']){_0xc4913c=!![],console['error'](a24_0x59ec54[_0x5096f8(0x1a6)](_0x5096f8(0x198)+_0x21ce14[_0x5096f8(0x1b7)]+':'));for(const _0x94965f of _0x124a9d[_0x5096f8(0x191)]){console['error']('\x20\x20'+a24_0x59ec54[_0x5096f8(0x1a6)]('β')+'\x20'+_0x94965f['path']+':\x20'+_0x94965f[_0x5096f8(0x196)]);}}for(const _0x44b316 of _0x124a9d[_0x5096f8(0x1a8)]){console[_0x5096f8(0x18f)]('\x20\x20'+a24_0x59ec54[_0x5096f8(0x1a1)]('β ')+'\x20'+_0x44b316[_0x5096f8(0x193)]+':\x20'+_0x44b316[_0x5096f8(0x196)]);}}if(_0xc4913c)return console[_0x5096f8(0x18f)](a24_0x59ec54[_0x5096f8(0x1a6)](_0x5096f8(0x1b5))),0x1;const _0x3e2cfd=await _0x54cdde[_0x5096f8(0x19a)]['resolveWorkspaceId'](_0x39873c),_0x33486d=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x39873c+'\x27...',_0x520de1=>preparePush({'engage':_0x54cdde[_0x5096f8(0x19a)]},_0xc303d0,_0x3e2cfd,{'progress':{'update':_0x5b44cd=>_0x520de1[_0x5096f8(0x1c0)](_0x5b44cd)}}),{'verbose':_0x780568[_0x5096f8(0x1b3)]}),_0x408fee=_0x33486d['data'];await withProgressSpinner(_0x5096f8(0x1ab),_0x399fd0=>resolveAndBuildInputs({'engage':_0x54cdde['engage']},_0x408fee,_0x3e2cfd,{'progress':{'update':_0x1c72c9=>_0x399fd0[_0x5096f8(0x1c0)](_0x1c72c9)}}),{'verbose':_0x780568[_0x5096f8(0x1b3)]});const _0x967614=_0x408fee[_0x5096f8(0x1d3)](_0x4f5456=>_0x4f5456[_0x5096f8(0x1be)]===_0x5096f8(0x19c)),_0x37369f=_0x408fee[_0x5096f8(0x1d3)](_0x3cd573=>_0x3cd573[_0x5096f8(0x1be)]===_0x5096f8(0x1ac));console[_0x5096f8(0x18f)](_0x5096f8(0x1cb)+_0x39873c+'\x27:');if(_0x967614['length']>0x0){console[_0x5096f8(0x18f)]('\x20\x20'+a24_0x59ec54[_0x5096f8(0x194)]('+\x20'+_0x967614[_0x5096f8(0x1cd)]+'\x20new\x20templates:'));for(const _0x4c04ea of _0x967614){console['error']('\x20\x20\x20\x20'+a24_0x59ec54['green']('+')+'\x20'+_0x4c04ea[_0x5096f8(0x1d0)][_0x5096f8(0x199)]);}}if(_0x37369f[_0x5096f8(0x1cd)]>0x0){console['error']('\x20\x20'+a24_0x59ec54[_0x5096f8(0x1a1)]('~\x20'+_0x37369f['length']+'\x20templates\x20to\x20update:'));for(const _0x4c9288 of _0x37369f){console[_0x5096f8(0x18f)](_0x5096f8(0x18c)+a24_0x59ec54[_0x5096f8(0x1a1)]('~')+'\x20'+_0x4c9288[_0x5096f8(0x1d0)]['name']);}}if(_0x967614['length']===0x0&&_0x37369f['length']===0x0)return console['error'](a24_0x59ec54[_0x5096f8(0x194)](_0x5096f8(0x1c2))),0x0;if(_0x780568[_0x5096f8(0x1b4)])return console[_0x5096f8(0x18f)](a24_0x59ec54[_0x5096f8(0x1a1)](_0x5096f8(0x1ba))),0x0;if(!_0x780568[_0x5096f8(0x1a7)]){if(!isInteractive())return console[_0x5096f8(0x18f)](a24_0x59ec54[_0x5096f8(0x1a6)]('\x0aError:'),_0x5096f8(0x1d1)),console['error'](a24_0x59ec54[_0x5096f8(0x1c1)](_0x5096f8(0x1b1))),0x1;const _0x2c0e66=await confirmKey(_0x5096f8(0x1c6)+(_0x967614[_0x5096f8(0x1cd)]+_0x37369f[_0x5096f8(0x1cd)])+_0x5096f8(0x1cc));if(!_0x2c0e66)return console[_0x5096f8(0x18f)](a24_0x59ec54['yellow'](_0x5096f8(0x18e)),_0x5096f8(0x1a0)),0x1;}const _0x26fd07=await withProgressSpinner(_0x5096f8(0x1bf),_0x318e57=>executePush({'engage':_0x54cdde[_0x5096f8(0x19a)]},_0x408fee,{'progress':{'update':_0x578a27=>_0x318e57[_0x5096f8(0x1c0)](_0x578a27)}}),{'verbose':_0x780568[_0x5096f8(0x1b3)]}),_0x2fb898=_0x26fd07[_0x5096f8(0x1c7)];for(const _0x41dd29 of _0x2fb898[_0x5096f8(0x1b0)]){if(_0x41dd29[_0x5096f8(0x19f)]&&(_0x41dd29[_0x5096f8(0x1be)]==='created'||_0x41dd29[_0x5096f8(0x1be)]===_0x5096f8(0x19e))){const _0x5bd61b=getTemplateUrl(_0x780568[_0x5096f8(0x1ad)],_0x3e2cfd,_0x41dd29['templateId']),_0x40e737=_0x41dd29['action']==='created'?'+':'~',_0x111f70=_0x41dd29[_0x5096f8(0x1be)]===_0x5096f8(0x1a2)?a24_0x59ec54['green'](_0x40e737):a24_0x59ec54[_0x5096f8(0x1a1)](_0x40e737);console[_0x5096f8(0x18f)]('\x20\x20'+_0x111f70+'\x20'+hyperlink(_0x41dd29[_0x5096f8(0x199)],_0x5bd61b)+'\x20'+a24_0x59ec54[_0x5096f8(0x1c1)](_0x5bd61b));}}_0x2fb898[_0x5096f8(0x1a2)]>0x0&&console[_0x5096f8(0x18f)](a24_0x59ec54[_0x5096f8(0x194)](_0x5096f8(0x1bc)+_0x2fb898[_0x5096f8(0x1a2)]+_0x5096f8(0x1aa)));_0x2fb898['updated']>0x0&&console[_0x5096f8(0x18f)](a24_0x59ec54[_0x5096f8(0x194)](_0x5096f8(0x1b6)+_0x2fb898['updated']+_0x5096f8(0x1aa)));if(_0x2fb898[_0x5096f8(0x191)][_0x5096f8(0x1cd)]>0x0){console['error'](a24_0x59ec54[_0x5096f8(0x1a6)]('β\x20'+_0x2fb898[_0x5096f8(0x191)][_0x5096f8(0x1cd)]+_0x5096f8(0x1ae)));for(const _0x359c8d of _0x2fb898['errors']){console[_0x5096f8(0x18f)]('\x20\x20'+a24_0x59ec54[_0x5096f8(0x1a6)](_0x359c8d['name'])+':\x20'+_0x359c8d['error']);}}return saveSessionContext({'engage_workspace':_0x39873c},_0x780568[_0x5096f8(0x1d2)]),_0x2fb898['errors'][_0x5096f8(0x1cd)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x21374b=a25_0x3e54;(function(_0x2752bc,_0x22eb98){const _0xdaef7f=a25_0x3e54,_0x26dd3e=_0x2752bc();while(!![]){try{const _0x173ad3=-parseInt(_0xdaef7f(0x190))/0x1+parseInt(_0xdaef7f(0x19d))/0x2+-parseInt(_0xdaef7f(0x18a))/0x3+-parseInt(_0xdaef7f(0x17a))/0x4*(-parseInt(_0xdaef7f(0x199))/0x5)+parseInt(_0xdaef7f(0x194))/0x6+-parseInt(_0xdaef7f(0x18c))/0x7*(parseInt(_0xdaef7f(0x184))/0x8)+parseInt(_0xdaef7f(0x188))/0x9*(parseInt(_0xdaef7f(0x181))/0xa);if(_0x173ad3===_0x22eb98)break;else _0x26dd3e['push'](_0x26dd3e['shift']());}catch(_0x90f179){_0x26dd3e['push'](_0x26dd3e['shift']());}}}(a25_0x15a3,0xe1116));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a25_0x15a3(){const _0x1c4796=['filter','\x20warning(s)','red','β\x20All\x20','13464350rZnHIk','dirname','description','18728mwsODN','\x20(skipped:\x20','\x20warning(s)\x20found','.yaml','9pFzMwa','execute','1192542AIsiSK','\x20template(s)\x20valid','2499cbWjHF','\x20non-template\x20file(s)\x20skipped','verbose','length','1046952CVbmVu','\x20error(s)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','resolve','1764426dpZVZP','skippedCount','log','cwd','\x20non-template\x20file(s)\x20skipped)','45EWJATQ','template','invalidCount','errors','1977864JVCWVr','error','warnings','.yml','No\x20template\x20YAML\x20files\x20found\x20in\x20','endsWith','hasErrors','\x20valid','warningCount','valid','254508IgpwYg','yellow','dim'];a25_0x15a3=function(){return _0x1c4796;};return a25_0x15a3();}import a25_0x37781b from'chalk';import a25_0x53bff2 from'path';function a25_0x3e54(_0x2da682,_0x4b5991){_0x2da682=_0x2da682-0x175;const _0x15a3e6=a25_0x15a3();let _0x3e5425=_0x15a3e6[_0x2da682];return _0x3e5425;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']='engage:template:validate';[a25_0x21374b(0x183)]='Validate\x20template\x20YAML\x20files';async[a25_0x21374b(0x189)](_0x2074c1){const _0x2cef8c=a25_0x21374b,{options:_0x68b48d,args:_0x3fbafb}=_0x2074c1,_0x565673=_0x68b48d,_0x2121d5=_0x3fbafb[0x0],_0x1388ec=_0x2121d5?a25_0x53bff2[_0x2cef8c(0x193)](_0x2121d5):undefined,_0x2797aa=_0x1388ec?isYamlFile(_0x1388ec):![];let _0x439835,_0xe7f28b;if(_0x2797aa&&_0x1388ec)_0x439835=a25_0x53bff2[_0x2cef8c(0x182)](_0x1388ec),_0xe7f28b=_0x1388ec;else _0x1388ec?_0x439835=_0x1388ec:_0x439835=process[_0x2cef8c(0x197)]();if(!_0xe7f28b&&!existsSync(_0x439835))return console[_0x2cef8c(0x19e)](a25_0x37781b[_0x2cef8c(0x17f)]('Error:\x20Directory\x20not\x20found:\x20'+_0x439835+'\x0a')),0x1;let _0x5540fd;if(_0xe7f28b){if(!_0xe7f28b[_0x2cef8c(0x175)](_0x2cef8c(0x1a0))&&!_0xe7f28b[_0x2cef8c(0x175)](_0x2cef8c(0x187)))return console[_0x2cef8c(0x19e)](a25_0x37781b[_0x2cef8c(0x17f)](_0x2cef8c(0x192)+_0xe7f28b+'\x0a')),0x1;_0x5540fd=[_0xe7f28b];}else _0x5540fd=findYamlFiles(_0x439835);if(_0x5540fd['length']===0x0)return console[_0x2cef8c(0x19e)](a25_0x37781b['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x439835+'\x0a')),0x1;const _0x3ec60d=validateYamlFiles(_0x5540fd,_0x439835,{'filterType':_0x2cef8c(0x19a)}),_0x104f1c=calculateSummary(_0x3ec60d),_0x10dc69=_0x3ec60d[_0x2cef8c(0x17d)](isValidationResult);if(_0x10dc69['length']===0x0)return console[_0x2cef8c(0x19e)](a25_0x37781b[_0x2cef8c(0x17b)](_0x2cef8c(0x1a1)+_0x439835+'\x0a')),_0x104f1c['skippedCount']>0x0&&console['error'](a25_0x37781b[_0x2cef8c(0x17c)]('('+_0x104f1c['skippedCount']+_0x2cef8c(0x198))),0x0;for(const _0x405d98 of _0x3ec60d){if(!isValidationResult(_0x405d98)){_0x565673[_0x2cef8c(0x18e)]&&console['log'](a25_0x37781b['dim']('-\x20'+_0x405d98['relativePath']+_0x2cef8c(0x185)+_0x405d98['reason']+')'));continue;}const {relativePath:_0x313d89,source:_0x20d740,result:_0x27fdaf}=_0x405d98;if(_0x27fdaf[_0x2cef8c(0x179)]&&_0x27fdaf[_0x2cef8c(0x19f)][_0x2cef8c(0x18f)]===0x0)_0x565673[_0x2cef8c(0x18e)]&&console[_0x2cef8c(0x196)](a25_0x37781b['green']('β\x20'+_0x313d89));else _0x27fdaf[_0x2cef8c(0x179)]?(console[_0x2cef8c(0x196)](a25_0x37781b[_0x2cef8c(0x17b)]('β \x20'+_0x313d89+':\x20'+_0x27fdaf[_0x2cef8c(0x19f)][_0x2cef8c(0x18f)]+_0x2cef8c(0x17e))),console[_0x2cef8c(0x196)](formatValidationResult(_0x27fdaf,_0x20d740,_0x313d89))):(console[_0x2cef8c(0x196)](a25_0x37781b[_0x2cef8c(0x17f)]('β\x20'+_0x313d89+':\x20'+_0x27fdaf[_0x2cef8c(0x19c)][_0x2cef8c(0x18f)]+_0x2cef8c(0x191))),console['log'](formatValidationResult(_0x27fdaf,_0x20d740,_0x313d89)));}return console[_0x2cef8c(0x196)](''),_0x104f1c[_0x2cef8c(0x176)]?(console[_0x2cef8c(0x196)](a25_0x37781b[_0x2cef8c(0x17f)]('Validation\x20failed:\x20'+_0x104f1c[_0x2cef8c(0x19b)]+'\x20template(s)\x20with\x20errors,\x20'+_0x104f1c['validCount']+_0x2cef8c(0x177))),_0x104f1c['warningCount']>0x0&&console[_0x2cef8c(0x196)](a25_0x37781b[_0x2cef8c(0x17b)](_0x104f1c[_0x2cef8c(0x178)]+_0x2cef8c(0x186))),_0x104f1c[_0x2cef8c(0x195)]>0x0&&console[_0x2cef8c(0x196)](a25_0x37781b[_0x2cef8c(0x17c)](_0x104f1c['skippedCount']+_0x2cef8c(0x18d))),0x1):(console[_0x2cef8c(0x196)](a25_0x37781b['green'](_0x2cef8c(0x180)+_0x104f1c['validCount']+_0x2cef8c(0x18b))),_0x104f1c[_0x2cef8c(0x178)]>0x0&&console[_0x2cef8c(0x196)](a25_0x37781b[_0x2cef8c(0x17b)](_0x104f1c[_0x2cef8c(0x178)]+_0x2cef8c(0x186))),_0x104f1c[_0x2cef8c(0x195)]>0x0&&console[_0x2cef8c(0x196)](a25_0x37781b[_0x2cef8c(0x17c)](_0x104f1c[_0x2cef8c(0x195)]+_0x2cef8c(0x18d))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x4fd919=a26_0x60da;function a26_0x60da(_0x3f4645,_0x1a4951){_0x3f4645=_0x3f4645-0x1c7;const _0x9dc464=a26_0x9dc4();let _0x60da95=_0x9dc464[_0x3f4645];return _0x60da95;}(function(_0xe438d0,_0x92a403){const _0x5b721c=a26_0x60da,_0x2dcba2=_0xe438d0();while(!![]){try{const _0xe9a898=parseInt(_0x5b721c(0x1e8))/0x1+-parseInt(_0x5b721c(0x1f2))/0x2*(-parseInt(_0x5b721c(0x200))/0x3)+parseInt(_0x5b721c(0x1cf))/0x4*(parseInt(_0x5b721c(0x1cb))/0x5)+-parseInt(_0x5b721c(0x1ca))/0x6+-parseInt(_0x5b721c(0x20d))/0x7+parseInt(_0x5b721c(0x1cc))/0x8*(-parseInt(_0x5b721c(0x1ff))/0x9)+parseInt(_0x5b721c(0x1f7))/0xa*(parseInt(_0x5b721c(0x21e))/0xb);if(_0xe9a898===_0x92a403)break;else _0x2dcba2['push'](_0x2dcba2['shift']());}catch(_0x1b0bad){_0x2dcba2['push'](_0x2dcba2['shift']());}}}(a26_0x9dc4,0xd5531));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a26_0x9dc4(){const _0x338335=['floor','...','jobs','map','Submitting\x20kill\x20request...','substring','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','11TIIVkP','show','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Query:\x20','Getting\x20job\x20results...','length','job_id','7554300WWlDNP','1565owgftu','8pKJMTl','start_at','execute','14152EBkeRi','user_name','push','Submitting\x20job...','β\x20Found\x20','job:result','abs','presto','red','data','round','limit','join','debug','d\x20ago','Cancelled','log','list','status','green','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Get\x20job\x20results','\x20row','job:submit','1311787REnOYm','β\x20Job\x20submitted','h\x20ago','validate','Kill\x20a\x20job','created_at','file','getTime','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Getting\x20job\x20details...','227126hJXwWT','now','priority','name','result','16535990LksakQ','end_at','Show\x20job\x20details','job:show','No\x20SQL\x20statements\x20found\x20in\x20file','dim','information_schema','List\x20jobs','11688237dUuVOI','3gsHWtl','verbose','database','trino','Listing\x20jobs...','type','\x27\x20to\x20verify\x20the\x20job\x20status','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','just\x20now','args','success','\x20job','url','5283761LiOEwf','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','m\x20ago','hive','error','jobType','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','description'];a26_0x9dc4=function(){return _0x338335;};return a26_0x9dc4();}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x1cb628 from'chalk';function formatDuration(_0x98000d){const _0x1aab72=a26_0x60da;if(_0x98000d<0x3c)return _0x98000d+'s';if(_0x98000d<0xe10)return Math[_0x1aab72(0x217)](_0x98000d/0x3c)+'m\x20'+_0x98000d%0x3c+'s';const _0x1aa12c=Math[_0x1aab72(0x217)](_0x98000d/0xe10),_0x5432ea=Math[_0x1aab72(0x217)](_0x98000d%0xe10/0x3c);return _0x5432ea>0x0?_0x1aa12c+'h\x20'+_0x5432ea+'m':_0x1aa12c+'h';}function formatRelativeTime(_0x1799ac){const _0x59a4c4=a26_0x60da,_0x4295b3=Date[_0x59a4c4(0x1f3)]()-_0x1799ac[_0x59a4c4(0x1ef)](),_0x3fa49c=Math['floor'](Math[_0x59a4c4(0x1d5)](_0x4295b3)/0x3e8);if(_0x3fa49c<0x3c)return _0x59a4c4(0x208);const _0x234245=Math[_0x59a4c4(0x217)](_0x3fa49c/0x3c);if(_0x234245<0x3c)return _0x234245+_0x59a4c4(0x20f);const _0x4ea579=Math[_0x59a4c4(0x217)](_0x234245/0x3c);if(_0x4ea579<0x18)return _0x4ea579+_0x59a4c4(0x1ea);const _0x39c35f=Math['floor'](_0x4ea579/0x18);if(_0x39c35f<0x1e)return _0x39c35f+_0x59a4c4(0x1dd);return Math[_0x59a4c4(0x217)](_0x39c35f/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']=a26_0x4fd919(0x219);[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1fe);async[a26_0x4fd919(0x1ce)](_0x77bd3d){const _0x568b0d=a26_0x4fd919,{options:_0x22efe8,tdx:_0x52ed2f}=_0x77bd3d,_0x446a4b=resolveLimit(_0x22efe8[_0x568b0d(0x1da)],DEFAULT_DISPLAY_LIMIT),_0x50ed3c=_0x22efe8[_0x568b0d(0x1e1)];_0x22efe8[_0x568b0d(0x201)]&&(console[_0x568b0d(0x211)]('Limit:\x20'+_0x446a4b+'\x20jobs'),_0x50ed3c&&console['error']('Status\x20filter:\x20'+_0x50ed3c));const _0x33abab=await withSpinner(_0x568b0d(0x204),()=>_0x52ed2f['jobs'][_0x568b0d(0x1e0)]({'from':0x0,'to':_0x446a4b-0x1,'status':_0x50ed3c}),{'verbose':_0x22efe8[_0x568b0d(0x201)]}),_0x46b54e=_0x33abab['data'];console['error'](_0x568b0d(0x1d3)+_0x46b54e[_0x568b0d(0x1c8)]+_0x568b0d(0x20b)+(_0x46b54e[_0x568b0d(0x1c8)]!==0x1?'s':''));const _0xa9edbf=_0x22efe8['site'];if(isStructuredFormat(_0x22efe8)){const _0x4e58e4=_0x46b54e[_0x568b0d(0x21a)](_0xa06a9f=>{const _0x164de7=_0x568b0d;let _0x193dbc;if(_0xa06a9f['start_at']&&_0xa06a9f[_0x164de7(0x1f8)]){const _0x415eb=new Date(_0xa06a9f[_0x164de7(0x1cd)])[_0x164de7(0x1ef)](),_0x24258b=new Date(_0xa06a9f[_0x164de7(0x1f8)])[_0x164de7(0x1ef)]();_0x193dbc=Math[_0x164de7(0x1d9)]((_0x24258b-_0x415eb)/0x3e8);}return{'job_id':_0xa06a9f[_0x164de7(0x1c9)],'type':_0xa06a9f['type']===_0x164de7(0x1d6)?_0x164de7(0x203):_0xa06a9f[_0x164de7(0x205)],'status':_0xa06a9f[_0x164de7(0x1e1)],'user_name':_0xa06a9f[_0x164de7(0x1d0)],'duration_sec':_0x193dbc,'created_at':_0xa06a9f[_0x164de7(0x1ed)],'started_at':_0xa06a9f[_0x164de7(0x1cd)],'end_at':_0xa06a9f[_0x164de7(0x1f8)]};});await handleSDKOutput(_0x4e58e4,_0x22efe8);}else for(const _0xf8f390 of _0x46b54e){const _0x61f957=_0xf8f390[_0x568b0d(0x1e1)]===_0x568b0d(0x20a)?a26_0x1cb628[_0x568b0d(0x1e2)]:_0xf8f390[_0x568b0d(0x1e1)]===_0x568b0d(0x211)?a26_0x1cb628[_0x568b0d(0x1d7)]:a26_0x1cb628[_0x568b0d(0x1fc)],_0x4a9cda=_0x61f957(_0xf8f390[_0x568b0d(0x1e1)]),_0x16b5c2=getJobUrl(_0xa9edbf,_0xf8f390[_0x568b0d(0x1c9)]),_0x1a1c8e=hyperlink(_0xf8f390['job_id'],_0x16b5c2),_0x11e8c6=a26_0x1cb628[_0x568b0d(0x1fc)](_0xf8f390[_0x568b0d(0x205)]==='presto'?'trino':_0xf8f390[_0x568b0d(0x205)]),_0x1a1230=[];if(_0xf8f390[_0x568b0d(0x1cd)]&&_0xf8f390[_0x568b0d(0x1f8)]){const _0x11f590=Math[_0x568b0d(0x1d9)]((new Date(_0xf8f390[_0x568b0d(0x1f8)])[_0x568b0d(0x1ef)]()-new Date(_0xf8f390[_0x568b0d(0x1cd)])[_0x568b0d(0x1ef)]())/0x3e8);_0x1a1230[_0x568b0d(0x1d1)](formatDuration(_0x11f590));}if(_0xf8f390[_0x568b0d(0x1f8)])_0x1a1230[_0x568b0d(0x1d1)](formatRelativeTime(new Date(_0xf8f390[_0x568b0d(0x1f8)])));else _0xf8f390[_0x568b0d(0x1cd)]&&_0x1a1230[_0x568b0d(0x1d1)](formatRelativeTime(new Date(_0xf8f390[_0x568b0d(0x1cd)])));const _0x1fe0cf=_0x1a1230[_0x568b0d(0x1c8)]>0x0?a26_0x1cb628[_0x568b0d(0x1fc)]('\x20'+_0x1a1230[_0x568b0d(0x1db)](',\x20')):'';console[_0x568b0d(0x1df)]('β‘\x20'+_0x1a1c8e+'\x20'+_0x11e8c6+'\x20'+_0x4a9cda+_0x1fe0cf);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1fa);[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1f9);['validate'](_0x10f476){const _0x4793a4=a26_0x4fd919,_0x2d810b=_0x10f476[_0x4793a4(0x209)][0x0];if(!_0x2d810b)return _0x4793a4(0x215);return undefined;}async[a26_0x4fd919(0x1ce)](_0xfbf524){const _0x2ac5d9=a26_0x4fd919,{options:_0x480f4c,args:_0x3a7079,tdx:_0x1314ce}=_0xfbf524,_0x3c4acd=_0x3a7079[0x0],_0xa603a0=await withSpinner(_0x2ac5d9(0x1f1),()=>_0x1314ce[_0x2ac5d9(0x219)][_0x2ac5d9(0x21f)](_0x3c4acd),{'verbose':_0x480f4c['verbose']}),_0xc81805=_0xa603a0[_0x2ac5d9(0x1d8)];let _0x1c2e45;if(_0xc81805['start_at']&&_0xc81805[_0x2ac5d9(0x1f8)]){const _0x8ffb18=new Date(_0xc81805[_0x2ac5d9(0x1cd)])[_0x2ac5d9(0x1ef)](),_0x32305e=new Date(_0xc81805[_0x2ac5d9(0x1f8)])[_0x2ac5d9(0x1ef)]();_0x1c2e45=Math['round']((_0x32305e-_0x8ffb18)/0x3e8);}const _0x4a5d15={'job_id':_0xc81805[_0x2ac5d9(0x1c9)],'type':_0xc81805[_0x2ac5d9(0x205)],'status':_0xc81805['status'],..._0xc81805[_0x2ac5d9(0x1d0)]&&{'user_name':_0xc81805[_0x2ac5d9(0x1d0)]},..._0x1c2e45!==undefined&&{'duration_sec':_0x1c2e45},..._0xc81805[_0x2ac5d9(0x1ed)]&&{'created_at':_0xc81805['created_at']},..._0xc81805[_0x2ac5d9(0x1cd)]&&{'started_at':_0xc81805[_0x2ac5d9(0x1cd)]},..._0xc81805[_0x2ac5d9(0x1f8)]&&{'end_at':_0xc81805['end_at']},..._0xc81805[_0x2ac5d9(0x202)]&&{'database':_0xc81805['database']},..._0xc81805[_0x2ac5d9(0x1f4)]!==undefined&&{'priority':_0xc81805[_0x2ac5d9(0x1f4)]},..._0xc81805[_0x2ac5d9(0x20c)]&&{'url':_0xc81805[_0x2ac5d9(0x20c)]},..._0xc81805['query']&&{'query':_0xc81805['query']},..._0xc81805['debug']&&{'debug':_0xc81805[_0x2ac5d9(0x1dc)]}};return await handleSingleObjectOutput(_0x4a5d15,_0x480f4c),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]='job:kill';[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1ec);[a26_0x4fd919(0x1eb)](_0xae416e){const _0x65eb0=a26_0x4fd919,_0x4384ba=_0xae416e[_0x65eb0(0x209)][0x0];if(!_0x4384ba)return _0x65eb0(0x214);return undefined;}async['execute'](_0x203031){const _0x1db736=a26_0x4fd919,{options:_0x224f57,args:_0x4588d2,tdx:_0xc29d00}=_0x203031,_0x50498d=_0x4588d2[0x0];if(!_0x224f57['yes']){const _0x2d5d8d=await confirm(_0x1db736(0x1f0)+_0x50498d+'?');if(!_0x2d5d8d)return console[_0x1db736(0x211)](_0x1db736(0x1de)),0x0;}return await withSpinner(_0x1db736(0x21b),()=>_0xc29d00['jobs']['kill'](_0x50498d),{'verbose':_0x224f57[_0x1db736(0x201)]}),console[_0x1db736(0x211)](_0x1db736(0x207)+_0x50498d),console[_0x1db736(0x211)](_0x1db736(0x1e3)+_0x50498d+_0x1db736(0x206)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1e7);['description']='Submit\x20a\x20job';async[a26_0x4fd919(0x1ce)](_0x1db8d7){const _0x885f27=a26_0x4fd919,{options:_0x17b0d0,args:_0x3499fb,tdx:_0x114f19}=_0x1db8d7,_0x32e44c=_0x17b0d0[_0x885f27(0x212)]||_0x885f27(0x203),_0x2611bb=_0x17b0d0[_0x885f27(0x1ee)],_0x1bfa4b=_0x17b0d0[_0x885f27(0x202)]||_0x885f27(0x1fd),_0x5c6a4b=_0x17b0d0[_0x885f27(0x1f6)];if(_0x32e44c!==_0x885f27(0x203)&&_0x32e44c!==_0x885f27(0x210))throw new SDKError(ErrorCode[_0x885f27(0x220)],_0x885f27(0x21d));let _0x257ecf;if(_0x2611bb){if(_0x3499fb[0x0])throw new SDKError(ErrorCode[_0x885f27(0x220)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x354bd1=readSqlStatementsFromFile(_0x2611bb);if(_0x354bd1[_0x885f27(0x1c8)]===0x0)throw new SDKError(ErrorCode[_0x885f27(0x220)],_0x885f27(0x1fb));if(_0x354bd1[_0x885f27(0x1c8)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x885f27(0x20e));_0x257ecf=_0x354bd1[0x0];}else{if(!_0x3499fb[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x885f27(0x1e4));_0x257ecf=_0x3499fb[0x0];}_0x17b0d0[_0x885f27(0x201)]&&(console[_0x885f27(0x211)]('Job\x20type:\x20'+_0x32e44c),console[_0x885f27(0x211)](_0x885f27(0x213)+_0x1bfa4b),console['error'](_0x885f27(0x222)+_0x257ecf[_0x885f27(0x21c)](0x0,0x64)+(_0x257ecf[_0x885f27(0x1c8)]>0x64?_0x885f27(0x218):'')));const _0x1e2ca1=await withSpinner(_0x885f27(0x1d2),()=>_0x114f19[_0x885f27(0x219)]['submit'](_0x1bfa4b,_0x257ecf,_0x32e44c,_0x5c6a4b),{'verbose':_0x17b0d0[_0x885f27(0x201)]}),_0xd81f9d=_0x1e2ca1[_0x885f27(0x1d8)];return console[_0x885f27(0x211)](_0x885f27(0x1e9)),console[_0x885f27(0x211)]('\x20\x20Job\x20ID:\x20'+_0xd81f9d[_0x885f27(0x1c9)]),await handleSDKOutput([_0xd81f9d],_0x17b0d0),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1d4);['description']=a26_0x4fd919(0x1e5);[a26_0x4fd919(0x1eb)](_0x1d88b6){const _0x260a97=a26_0x4fd919,_0x176618=_0x1d88b6['args'][0x0];if(!_0x176618)return _0x260a97(0x221);return undefined;}async[a26_0x4fd919(0x1ce)](_0x3e878e){const _0x4f79bc=a26_0x4fd919,{options:_0x3b23b0,args:_0x4ef9dc,tdx:_0x1691bb}=_0x3e878e,_0x3ef827=_0x4ef9dc[0x0],_0x3a9b23=await withSpinner(_0x4f79bc(0x1c7),()=>_0x1691bb[_0x4f79bc(0x219)]['result'](_0x3ef827),{'verbose':_0x3b23b0[_0x4f79bc(0x201)]}),_0x58bc97=_0x3a9b23[_0x4f79bc(0x1d8)];return console[_0x4f79bc(0x211)]('β\x20Retrieved\x20'+_0x58bc97[_0x4f79bc(0x1c8)]+_0x4f79bc(0x1e6)+(_0x58bc97[_0x4f79bc(0x1c8)]!==0x1?'s':'')),await handleSDKOutput(_0x58bc97,_0x3b23b0),0x0;}}
|
|
1
|
+
const a26_0x58b84f=a26_0x5947;(function(_0x58be65,_0x3ea9ae){const _0x205f08=a26_0x5947,_0x1b734c=_0x58be65();while(!![]){try{const _0x779652=-parseInt(_0x205f08(0x154))/0x1*(-parseInt(_0x205f08(0x15a))/0x2)+parseInt(_0x205f08(0x148))/0x3+parseInt(_0x205f08(0x14f))/0x4+parseInt(_0x205f08(0x159))/0x5+-parseInt(_0x205f08(0x15e))/0x6*(-parseInt(_0x205f08(0x147))/0x7)+parseInt(_0x205f08(0x173))/0x8+-parseInt(_0x205f08(0x177))/0x9*(parseInt(_0x205f08(0x189))/0xa);if(_0x779652===_0x3ea9ae)break;else _0x1b734c['push'](_0x1b734c['shift']());}catch(_0x4e0a2f){_0x1b734c['push'](_0x1b734c['shift']());}}}(a26_0x4565,0x9169f));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3c442f from'chalk';function formatDuration(_0x4edc62){const _0x2b0386=a26_0x5947;if(_0x4edc62<0x3c)return _0x4edc62+'s';if(_0x4edc62<0xe10)return Math['floor'](_0x4edc62/0x3c)+'m\x20'+_0x4edc62%0x3c+'s';const _0x17fb3a=Math[_0x2b0386(0x183)](_0x4edc62/0xe10),_0x2c88ea=Math[_0x2b0386(0x183)](_0x4edc62%0xe10/0x3c);return _0x2c88ea>0x0?_0x17fb3a+'h\x20'+_0x2c88ea+'m':_0x17fb3a+'h';}function a26_0x5947(_0x8c2b2c,_0x1cfe7b){_0x8c2b2c=_0x8c2b2c-0x144;const _0x456547=a26_0x4565();let _0x594705=_0x456547[_0x8c2b2c];return _0x594705;}function formatRelativeTime(_0xd818b4){const _0x4f7af6=a26_0x5947,_0x5e5553=Date[_0x4f7af6(0x190)]()-_0xd818b4[_0x4f7af6(0x184)](),_0x2c75bd=Math[_0x4f7af6(0x183)](Math[_0x4f7af6(0x15b)](_0x5e5553)/0x3e8);if(_0x2c75bd<0x3c)return _0x4f7af6(0x18c);const _0x3f7b7f=Math[_0x4f7af6(0x183)](_0x2c75bd/0x3c);if(_0x3f7b7f<0x3c)return _0x3f7b7f+'m\x20ago';const _0x5c056a=Math['floor'](_0x3f7b7f/0x3c);if(_0x5c056a<0x18)return _0x5c056a+_0x4f7af6(0x14b);const _0x380980=Math['floor'](_0x5c056a/0x18);if(_0x380980<0x1e)return _0x380980+'d\x20ago';return Math[_0x4f7af6(0x183)](_0x380980/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x58b84f(0x164)]=a26_0x58b84f(0x161);[a26_0x58b84f(0x17f)]='List\x20jobs';async['execute'](_0x7a1588){const _0x12a48a=a26_0x58b84f,{options:_0x163c5f,tdx:_0x1c73de}=_0x7a1588,_0x56b9be=resolveLimit(_0x163c5f[_0x12a48a(0x163)],DEFAULT_DISPLAY_LIMIT),_0x5be9dd=_0x163c5f[_0x12a48a(0x16a)];_0x163c5f[_0x12a48a(0x17c)]&&(console[_0x12a48a(0x167)](_0x12a48a(0x155)+_0x56b9be+_0x12a48a(0x16d)),_0x5be9dd&&console[_0x12a48a(0x167)](_0x12a48a(0x156)+_0x5be9dd));const _0x3cb348=await withSpinner(_0x12a48a(0x149),()=>_0x1c73de[_0x12a48a(0x161)][_0x12a48a(0x153)]({'from':0x0,'to':_0x56b9be-0x1,'status':_0x5be9dd}),{'verbose':_0x163c5f[_0x12a48a(0x17c)]}),_0x58308e=_0x3cb348[_0x12a48a(0x15d)];console[_0x12a48a(0x167)](_0x12a48a(0x14a)+_0x58308e[_0x12a48a(0x166)]+_0x12a48a(0x191)+(_0x58308e[_0x12a48a(0x166)]!==0x1?'s':''));const _0x27b524=_0x163c5f[_0x12a48a(0x182)];if(isStructuredFormat(_0x163c5f)){const _0x3251ee=_0x58308e[_0x12a48a(0x144)](_0x1679c3=>{const _0x3a941d=_0x12a48a;let _0x765401;if(_0x1679c3['start_at']&&_0x1679c3[_0x3a941d(0x193)]){const _0x292092=new Date(_0x1679c3[_0x3a941d(0x157)])['getTime'](),_0x2b1b73=new Date(_0x1679c3['end_at'])[_0x3a941d(0x184)]();_0x765401=Math[_0x3a941d(0x150)]((_0x2b1b73-_0x292092)/0x3e8);}return{'job_id':_0x1679c3[_0x3a941d(0x16c)],'type':_0x1679c3['type']===_0x3a941d(0x18d)?_0x3a941d(0x171):_0x1679c3['type'],'status':_0x1679c3[_0x3a941d(0x16a)],'user_name':_0x1679c3['user_name'],'duration_sec':_0x765401,'created_at':_0x1679c3['created_at'],'started_at':_0x1679c3[_0x3a941d(0x157)],'end_at':_0x1679c3[_0x3a941d(0x193)]};});await handleSDKOutput(_0x3251ee,_0x163c5f);}else for(const _0x12b11e of _0x58308e){const _0x192fd1=_0x12b11e[_0x12a48a(0x16a)]===_0x12a48a(0x15c)?a26_0x3c442f['green']:_0x12b11e[_0x12a48a(0x16a)]===_0x12a48a(0x167)?a26_0x3c442f[_0x12a48a(0x185)]:a26_0x3c442f['dim'],_0x40c76b=_0x192fd1(_0x12b11e['status']),_0x988615=getJobUrl(_0x27b524,_0x12b11e[_0x12a48a(0x16c)]),_0x146429=hyperlink(_0x12b11e['job_id'],_0x988615),_0x19c210=a26_0x3c442f[_0x12a48a(0x187)](_0x12b11e[_0x12a48a(0x17e)]===_0x12a48a(0x18d)?_0x12a48a(0x171):_0x12b11e[_0x12a48a(0x17e)]),_0x4350cc=[];if(_0x12b11e[_0x12a48a(0x157)]&&_0x12b11e[_0x12a48a(0x193)]){const _0x333c18=Math['round']((new Date(_0x12b11e[_0x12a48a(0x193)])[_0x12a48a(0x184)]()-new Date(_0x12b11e['start_at'])[_0x12a48a(0x184)]())/0x3e8);_0x4350cc[_0x12a48a(0x18a)](formatDuration(_0x333c18));}if(_0x12b11e['end_at'])_0x4350cc[_0x12a48a(0x18a)](formatRelativeTime(new Date(_0x12b11e['end_at'])));else _0x12b11e[_0x12a48a(0x157)]&&_0x4350cc[_0x12a48a(0x18a)](formatRelativeTime(new Date(_0x12b11e[_0x12a48a(0x157)])));const _0x51c3e0=_0x4350cc[_0x12a48a(0x166)]>0x0?a26_0x3c442f[_0x12a48a(0x187)]('\x20'+_0x4350cc[_0x12a48a(0x151)](',\x20')):'';console['log']('β‘\x20'+_0x146429+'\x20'+_0x19c210+'\x20'+_0x40c76b+_0x51c3e0);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x58b84f(0x164)]='job:show';[a26_0x58b84f(0x17f)]='Show\x20job\x20details';[a26_0x58b84f(0x181)](_0x5608ab){const _0x53cd7e=a26_0x58b84f,_0x4cf074=_0x5608ab[_0x53cd7e(0x18b)][0x0];if(!_0x4cf074)return _0x53cd7e(0x14c);return undefined;}async[a26_0x58b84f(0x165)](_0xddf83d){const _0x534ba6=a26_0x58b84f,{options:_0x276715,args:_0x281eaa,tdx:_0x3aee2d}=_0xddf83d,_0x4edab9=_0x281eaa[0x0],_0x6e78fc=await withSpinner(_0x534ba6(0x14e),()=>_0x3aee2d[_0x534ba6(0x161)][_0x534ba6(0x194)](_0x4edab9),{'verbose':_0x276715[_0x534ba6(0x17c)]}),_0x494612=_0x6e78fc[_0x534ba6(0x15d)];let _0x366a48;if(_0x494612[_0x534ba6(0x157)]&&_0x494612[_0x534ba6(0x193)]){const _0x46b885=new Date(_0x494612[_0x534ba6(0x157)])['getTime'](),_0x3191dd=new Date(_0x494612['end_at'])[_0x534ba6(0x184)]();_0x366a48=Math[_0x534ba6(0x150)]((_0x3191dd-_0x46b885)/0x3e8);}const _0xb4521f={'job_id':_0x494612['job_id'],'type':_0x494612[_0x534ba6(0x17e)],'status':_0x494612[_0x534ba6(0x16a)],..._0x494612[_0x534ba6(0x192)]&&{'user_name':_0x494612[_0x534ba6(0x192)]},..._0x366a48!==undefined&&{'duration_sec':_0x366a48},..._0x494612['created_at']&&{'created_at':_0x494612[_0x534ba6(0x158)]},..._0x494612[_0x534ba6(0x157)]&&{'started_at':_0x494612[_0x534ba6(0x157)]},..._0x494612['end_at']&&{'end_at':_0x494612['end_at']},..._0x494612[_0x534ba6(0x168)]&&{'database':_0x494612[_0x534ba6(0x168)]},..._0x494612[_0x534ba6(0x178)]!==undefined&&{'priority':_0x494612['priority']},..._0x494612[_0x534ba6(0x15f)]&&{'url':_0x494612[_0x534ba6(0x15f)]},..._0x494612[_0x534ba6(0x146)]&&{'query':_0x494612[_0x534ba6(0x146)]},..._0x494612[_0x534ba6(0x169)]&&{'debug':_0x494612[_0x534ba6(0x169)]}};return await handleSingleObjectOutput(_0xb4521f,_0x276715),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x58b84f(0x164)]=a26_0x58b84f(0x195);['description']='Kill\x20a\x20job';[a26_0x58b84f(0x181)](_0x4587fe){const _0x54dc8d=a26_0x58b84f,_0x439501=_0x4587fe[_0x54dc8d(0x18b)][0x0];if(!_0x439501)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0x58b84f(0x165)](_0x3e4e6d){const _0x40fda1=a26_0x58b84f,{options:_0x550978,args:_0x4fcd6a,tdx:_0x8ec043}=_0x3e4e6d,_0x4456c5=_0x4fcd6a[0x0];if(!_0x550978['yes']){const _0x2c45f4=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x4456c5+'?');if(!_0x2c45f4)return console[_0x40fda1(0x167)]('Cancelled'),0x0;}return await withSpinner(_0x40fda1(0x179),()=>_0x8ec043[_0x40fda1(0x161)][_0x40fda1(0x16b)](_0x4456c5),{'verbose':_0x550978[_0x40fda1(0x17c)]}),console[_0x40fda1(0x167)](_0x40fda1(0x17b)+_0x4456c5),console[_0x40fda1(0x167)](_0x40fda1(0x17d)+_0x4456c5+_0x40fda1(0x186)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x58b84f(0x16f);['description']=a26_0x58b84f(0x162);async['execute'](_0x44e917){const _0x142b11=a26_0x58b84f,{options:_0xff940,args:_0x38b319,tdx:_0x27f408}=_0x44e917,_0x218eb3=_0xff940['jobType']||'trino',_0x5be1b3=_0xff940[_0x142b11(0x170)],_0x5ec608=_0xff940[_0x142b11(0x168)]||'information_schema',_0x181fbf=_0xff940[_0x142b11(0x17a)];if(_0x218eb3!=='trino'&&_0x218eb3!==_0x142b11(0x174))throw new SDKError(ErrorCode[_0x142b11(0x18f)],_0x142b11(0x176));let _0x485e26;if(_0x5be1b3){if(_0x38b319[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x142b11(0x175));const _0x3b7094=readSqlStatementsFromFile(_0x5be1b3);if(_0x3b7094['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x3b7094[_0x142b11(0x166)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x485e26=_0x3b7094[0x0];}else{if(!_0x38b319[0x0])throw new SDKError(ErrorCode[_0x142b11(0x18f)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x485e26=_0x38b319[0x0];}_0xff940[_0x142b11(0x17c)]&&(console[_0x142b11(0x167)](_0x142b11(0x172)+_0x218eb3),console[_0x142b11(0x167)]('Database:\x20'+_0x5ec608),console[_0x142b11(0x167)](_0x142b11(0x16e)+_0x485e26[_0x142b11(0x152)](0x0,0x64)+(_0x485e26[_0x142b11(0x166)]>0x64?'...':'')));const _0x18acba=await withSpinner('Submitting\x20job...',()=>_0x27f408[_0x142b11(0x161)][_0x142b11(0x160)](_0x5ec608,_0x485e26,_0x218eb3,_0x181fbf),{'verbose':_0xff940[_0x142b11(0x17c)]}),_0x2b258c=_0x18acba[_0x142b11(0x15d)];return console[_0x142b11(0x167)]('β\x20Job\x20submitted'),console[_0x142b11(0x167)](_0x142b11(0x145)+_0x2b258c['job_id']),await handleSDKOutput([_0x2b258c],_0xff940),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a26_0x58b84f(0x180);['description']=a26_0x58b84f(0x188);['validate'](_0x30fbee){const _0x1acb1e=a26_0x58b84f,_0x284df5=_0x30fbee[_0x1acb1e(0x18b)][0x0];if(!_0x284df5)return _0x1acb1e(0x18e);return undefined;}async[a26_0x58b84f(0x165)](_0x2c170a){const _0x52034a=a26_0x58b84f,{options:_0x3fb24f,args:_0x6caaec,tdx:_0x477462}=_0x2c170a,_0x48cc70=_0x6caaec[0x0],_0x2a468b=await withSpinner('Getting\x20job\x20results...',()=>_0x477462['jobs'][_0x52034a(0x17a)](_0x48cc70),{'verbose':_0x3fb24f[_0x52034a(0x17c)]}),_0x5f33c3=_0x2a468b[_0x52034a(0x15d)];return console[_0x52034a(0x167)](_0x52034a(0x14d)+_0x5f33c3[_0x52034a(0x166)]+'\x20row'+(_0x5f33c3[_0x52034a(0x166)]!==0x1?'s':'')),await handleSDKOutput(_0x5f33c3,_0x3fb24f),0x0;}}function a26_0x4565(){const _0x4b34ea=['end_at','show','job:kill','map','\x20\x20Job\x20ID:\x20','query','293965TABFFV','304146pMUwID','Listing\x20jobs...','β\x20Found\x20','h\x20ago','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','β\x20Retrieved\x20','Getting\x20job\x20details...','4614832hrcDyH','round','join','substring','list','29777qUWYYl','Limit:\x20','Status\x20filter:\x20','start_at','created_at','2993830gUDrQF','44iTlWQA','abs','success','data','18YBKOkp','url','submit','jobs','Submit\x20a\x20job','limit','name','execute','length','error','database','debug','status','kill','job_id','\x20jobs','Query:\x20','job:submit','file','trino','Job\x20type:\x20','1743032ZMAqzK','hive','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','9xWwHcO','priority','Submitting\x20kill\x20request...','result','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','verbose','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','type','description','job:result','validate','site','floor','getTime','red','\x27\x20to\x20verify\x20the\x20job\x20status','dim','Get\x20job\x20results','22571990THZgkJ','push','args','just\x20now','presto','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','INVALID_ARGUMENT','now','\x20job','user_name'];a26_0x4565=function(){return _0x4b34ea;};return a26_0x4565();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x511dbc=a27_0x1a99;(function(_0xe64560,_0x25c92d){const _0x13ceea=a27_0x1a99,_0x1df65f=_0xe64560();while(!![]){try{const _0x245dd5=parseInt(_0x13ceea(0x29a))/0x1*(parseInt(_0x13ceea(0x1ed))/0x2)+parseInt(_0x13ceea(0x2cd))/0x3*(-parseInt(_0x13ceea(0x217))/0x4)+-parseInt(_0x13ceea(0x2c6))/0x5+parseInt(_0x13ceea(0x2a7))/0x6+parseInt(_0x13ceea(0x1d3))/0x7+-parseInt(_0x13ceea(0x27c))/0x8*(parseInt(_0x13ceea(0x1e9))/0x9)+-parseInt(_0x13ceea(0x291))/0xa*(-parseInt(_0x13ceea(0x1fe))/0xb);if(_0x245dd5===_0x25c92d)break;else _0x1df65f['push'](_0x1df65f['shift']());}catch(_0x13e1e9){_0x1df65f['push'](_0x1df65f['shift']());}}}(a27_0x215c,0xa2451));import a27_0x43744a from'chalk';import a27_0x303d57 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';function a27_0x1a99(_0x1a91ee,_0xcaad39){_0x1a91ee=_0x1a91ee-0x1c7;const _0x215c59=a27_0x215c();let _0x1a9982=_0x215c59[_0x1a91ee];return _0x1a9982;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x28c9c5){const _0x41f619=a27_0x1a99;return!_0x28c9c5&&(console[_0x41f619(0x290)](_0x41f619(0x24e)),console[_0x41f619(0x290)](_0x41f619(0x21b))),!!_0x28c9c5;}function withJsonFormat(_0x306828){const _0x276579=a27_0x1a99;if(!_0x306828['format']&&!_0x306828[_0x276579(0x25b)]&&!_0x306828[_0x276579(0x1cd)]&&!_0x306828[_0x276579(0x250)])return{..._0x306828,'format':_0x276579(0x25b),'json':!![]};return _0x306828;}function formatJourneyState(_0x585232){const _0x1e8827=a27_0x1a99;switch(_0x585232){case _0x1e8827(0x242):return a27_0x43744a[_0x1e8827(0x29c)]('(running)');case _0x1e8827(0x1d4):return a27_0x43744a['dim'](_0x1e8827(0x1e4));case _0x1e8827(0x203):return a27_0x43744a[_0x1e8827(0x294)](_0x1e8827(0x1c7));case _0x1e8827(0x1ff):return a27_0x43744a['blue'](_0x1e8827(0x222));case _0x1e8827(0x1f2):return a27_0x43744a[_0x1e8827(0x23d)](_0x1e8827(0x23e));default:return'('+_0x585232+')';}}function formatJourneyItem(_0x2639d1,_0x6ea31a='',_0x138eff){const _0x1b77c1=a27_0x1a99,_0x2cdc85=formatJourneyState(_0x2639d1[_0x1b77c1(0x24f)]),_0x5853a0=_0x138eff?hyperlink(_0x2639d1[_0x1b77c1(0x2bb)],_0x138eff):_0x2639d1['journeyBundleName'];return _0x6ea31a+'πΊοΈ\x20'+_0x5853a0+'\x20'+_0x2cdc85;}function escapeRegex(_0x195215){const _0x58da43=a27_0x1a99;return _0x195215[_0x58da43(0x25a)](/[.*+?^${}()|[\]\\]/g,_0x58da43(0x22f));}function globToRegex(_0x51428c){const _0x376c19=a27_0x1a99,_0x571374=_0x51428c[_0x376c19(0x260)]('*')[_0x376c19(0x20c)](escapeRegex);return new RegExp(_0x571374[_0x376c19(0x299)]('.*'),'i');}function buildRuleToNameMapping(_0x14fd26){const _0x50284d=a27_0x1a99,_0x3219ef=new Map();if(_0x14fd26[_0x50284d(0x24b)])for(const [_0x2fe671,_0x56fe2f]of Object[_0x50284d(0x1cb)](_0x14fd26['segments'])){if(_0x56fe2f[_0x50284d(0x1d8)]){const _0x2ccbcb=serializeRule(_0x56fe2f[_0x50284d(0x1d8)]),_0x46c1aa=_0x3219ef[_0x50284d(0x1f9)](_0x2ccbcb);_0x46c1aa?_0x46c1aa['push'](_0x2fe671):_0x3219ef[_0x50284d(0x2b0)](_0x2ccbcb,[_0x2fe671]);}}return _0x3219ef;}async function resolveJourneyIdFromInput(_0x8f38c0,_0x8ccd76,_0x14d589){const _0x48f785=a27_0x1a99,_0xe449ac=await resolveJourneyTarget(_0x8f38c0,_0x8ccd76[_0x48f785(0x220)],_0x8ccd76[_0x48f785(0x1e3)]),_0x2637d3=_0xe449ac[_0x48f785(0x220)];if(!_0x2637d3)throw new SDKError(ErrorCode[_0x48f785(0x1e2)],_0x48f785(0x1fa));const _0x138fca=await withSpinner(_0x48f785(0x2c3),()=>_0x14d589['segment'][_0x48f785(0x21f)](_0x2637d3),{'verbose':_0x8ccd76[_0x48f785(0x1e3)]}),_0x13e18b=_0x138fca['data'],_0xc6bda0=await withSpinner(_0x48f785(0x2cc),()=>_0x14d589[_0x48f785(0x24d)]['resolveJourneyId'](_0x13e18b,_0xe449ac[_0x48f785(0x25e)]),{'verbose':_0x8ccd76[_0x48f785(0x1e3)]});return{'journeyId':_0xc6bda0['data'],'journeyName':_0xe449ac['journeyName'],'parentSegmentId':_0x13e18b};}async function resolveJourneyTarget(_0x17f3c0,_0x30eceb,_0x2e6eea){const _0x397c6c=a27_0x1a99;if(isYamlFilePath(_0x17f3c0))try{const _0x20ec0c=await resolveYamlFilePath(_0x17f3c0);return _0x2e6eea&&(console[_0x397c6c(0x290)](_0x397c6c(0x28d)+_0x17f3c0),console[_0x397c6c(0x290)](_0x397c6c(0x27f)+_0x20ec0c['parentSegment']),console[_0x397c6c(0x290)]('\x20\x20Name:\x20'+_0x20ec0c['segmentName']),console[_0x397c6c(0x290)](_0x397c6c(0x25c)+(_0x20ec0c[_0x397c6c(0x27b)]||_0x397c6c(0x23b)))),{'journeyName':_0x20ec0c[_0x397c6c(0x27d)],'parentSegment':_0x20ec0c[_0x397c6c(0x220)],'resolved':_0x20ec0c};}catch(_0x5dd925){throw new SDKError(ErrorCode[_0x397c6c(0x1e2)],_0x397c6c(0x21e)+_0x5dd925[_0x397c6c(0x28e)]);}if(!_0x30eceb)throw new SDKError(ErrorCode[_0x397c6c(0x1e2)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x17f3c0,'parentSegment':_0x30eceb};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x511dbc(0x225)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x511dbc(0x229)](_0x3a9a22){const _0xed7d61=a27_0x511dbc,{options:_0x5d4b4e,args:_0x55aabd,tdx:_0x3e5c7d}=_0x3a9a22,_0x4d24c4=_0x55aabd[0x0],_0x4b48ee=_0x5d4b4e['parentSegment'];if(!_0x4b48ee)return console[_0xed7d61(0x290)](_0xed7d61(0x213)),console[_0xed7d61(0x290)](_0xed7d61(0x241)),0x1;const _0x6be85e=await withSpinner(_0xed7d61(0x2c3),()=>_0x3e5c7d['segment'][_0xed7d61(0x21f)](_0x4b48ee),{'verbose':_0x5d4b4e[_0xed7d61(0x1e3)]}),_0x4aad3b=_0x6be85e[_0xed7d61(0x253)];_0x5d4b4e[_0xed7d61(0x1e3)]&&(console[_0xed7d61(0x290)](_0xed7d61(0x2b5)+_0x4b48ee+_0xed7d61(0x1d7)+_0x4aad3b+')'),_0x4d24c4&&console[_0xed7d61(0x290)]('Pattern:\x20'+_0x4d24c4));const _0x4d99dd=await withSpinner(_0xed7d61(0x240),()=>_0x3e5c7d[_0xed7d61(0x207)]['getParentFull'](_0x4aad3b),{'verbose':_0x5d4b4e['verbose']}),_0x315711=_0x4d99dd[_0xed7d61(0x253)],_0x4a6aca=_0x315711[_0xed7d61(0x1ca)],_0x3d1517=await withSpinner(_0xed7d61(0x243),()=>_0x3e5c7d[_0xed7d61(0x24d)][_0xed7d61(0x20d)](_0x4aad3b,_0x4a6aca),{'verbose':_0x5d4b4e[_0xed7d61(0x1e3)]});let _0x57f69f=_0x3d1517[_0xed7d61(0x253)]['journeys'];const _0x25e973=_0x3d1517[_0xed7d61(0x253)]['folders'],_0x3f490d=new Map();for(const _0x4e8f25 of _0x25e973){_0x3f490d['set'](_0x4e8f25['id'],_0x4e8f25[_0xed7d61(0x2ac)]);}if(_0x4d24c4){const _0x4110ae=globToRegex(_0x4d24c4);_0x57f69f=_0x57f69f[_0xed7d61(0x266)](_0x501ff6=>_0x4110ae[_0xed7d61(0x20f)](_0x501ff6[_0xed7d61(0x2bb)]));}console[_0xed7d61(0x290)]('β\x20Found\x20'+_0x57f69f[_0xed7d61(0x284)]+_0xed7d61(0x20a)+(_0x57f69f[_0xed7d61(0x284)]!==0x1?'s':''));const _0x351eae=_0xe55dce=>{const _0x346d2a=_0xed7d61;return getConsoleNextUrl(_0x5d4b4e[_0x346d2a(0x2b8)],_0x346d2a(0x236)+_0x4aad3b+'/e/'+_0xe55dce+_0x346d2a(0x2bd));};if(_0x5d4b4e[_0xed7d61(0x1ce)]==='table')await handleSDKOutput(_0x57f69f,_0x5d4b4e);else{if(_0x5d4b4e[_0xed7d61(0x1ce)]===_0xed7d61(0x25b)){const _0xb81f83=_0x57f69f[_0xed7d61(0x20c)](_0x324f17=>({..._0x324f17,'url':_0x351eae(_0x324f17['id'])}));await handleSDKOutput(_0xb81f83,_0x5d4b4e);}else{console[_0xed7d61(0x279)]('['+_0x4b48ee+']');const _0x11878c=new Map(),_0x5260e9=[];for(const _0x1a0a7f of _0x57f69f){if(!_0x1a0a7f[_0xed7d61(0x216)]||_0x1a0a7f[_0xed7d61(0x216)]===_0x4a6aca)_0x5260e9[_0xed7d61(0x202)](_0x1a0a7f);else{const _0x4fefb8=_0x11878c[_0xed7d61(0x1f9)](_0x1a0a7f['folderId'])||[];_0x4fefb8[_0xed7d61(0x202)](_0x1a0a7f),_0x11878c[_0xed7d61(0x2b0)](_0x1a0a7f['folderId'],_0x4fefb8);}}const _0x3f06d6=(_0x337f3b,_0x46a208)=>_0x337f3b[_0xed7d61(0x2bb)][_0xed7d61(0x285)](_0x46a208['journeyBundleName'],undefined,{'sensitivity':_0xed7d61(0x280)});_0x5260e9[_0xed7d61(0x234)](_0x3f06d6);for(const _0xbdcc87 of _0x5260e9){console[_0xed7d61(0x279)](formatJourneyItem(_0xbdcc87,'',_0x351eae(_0xbdcc87['id'])));}const _0x585473=[..._0x11878c[_0xed7d61(0x1cb)]()][_0xed7d61(0x234)]((_0x2e7e0b,_0x16d70e)=>{const _0x589935=_0xed7d61,_0x1f6ef7=_0x3f490d[_0x589935(0x1f9)](_0x2e7e0b[0x0])||_0x2e7e0b[0x0],_0x5d0405=_0x3f490d['get'](_0x16d70e[0x0])||_0x16d70e[0x0];return _0x1f6ef7[_0x589935(0x285)](_0x5d0405,undefined,{'sensitivity':_0x589935(0x280)});});for(const [_0x21b4f1,_0x9923bf]of _0x585473){const _0xbccc7d=_0x3f490d['get'](_0x21b4f1)||_0x21b4f1;console[_0xed7d61(0x279)](_0xed7d61(0x230)+_0xbccc7d),_0x9923bf[_0xed7d61(0x234)](_0x3f06d6);for(const _0x2b72c2 of _0x9923bf){console[_0xed7d61(0x279)](formatJourneyItem(_0x2b72c2,'\x20\x20',_0x351eae(_0x2b72c2['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x28b);[a27_0x511dbc(0x225)]='Show\x20journey\x20details';async['execute'](_0xf7b1c2){const _0x514c81=a27_0x511dbc,{options:_0xd563c8,args:_0x193302,tdx:_0x245e47}=_0xf7b1c2,_0x543fd4=_0x193302[0x0];if(!_0x543fd4)return console[_0x514c81(0x290)](_0x514c81(0x24e)),console[_0x514c81(0x290)](_0x514c81(0x1d6)),console[_0x514c81(0x290)](_0x514c81(0x1f6)),console[_0x514c81(0x290)](_0x514c81(0x255)),0x1;_0xd563c8[_0x514c81(0x1e3)]&&console[_0x514c81(0x290)](_0x514c81(0x257)+_0x543fd4);const {journeyId:_0x1f7a98,parentSegmentId:_0x54f891}=await resolveJourneyIdFromInput(_0x543fd4,_0xd563c8,_0x245e47);if(_0xd563c8[_0x514c81(0x264)]){const _0x138bc9=getConsoleNextUrl(_0xd563c8['site'],_0x514c81(0x236)+_0x54f891+_0x514c81(0x1dd)+_0x1f7a98+_0x514c81(0x23a));return console[_0x514c81(0x290)](a27_0x43744a['green']('β')+_0x514c81(0x2c0)+a27_0x43744a['cyan'](_0x138bc9)),openBrowser(_0x138bc9),0x0;}const _0x3dad8c=await withSpinner(_0x514c81(0x1e0),()=>_0x245e47['journey'][_0x514c81(0x1fb)](_0x1f7a98),{'verbose':_0xd563c8[_0x514c81(0x1e3)]}),_0x41ba43=_0x3dad8c[_0x514c81(0x253)],_0x39d9f3=_0xd563c8[_0x514c81(0x2c1)];let _0x3a91e2;if(_0x39d9f3)try{const _0x134913=await withSpinner(_0x514c81(0x28c),()=>_0x245e47[_0x514c81(0x24d)][_0x514c81(0x226)](_0x1f7a98),{'verbose':_0xd563c8[_0x514c81(0x1e3)]});_0x3a91e2=_0x134913[_0x514c81(0x253)];}catch{_0xd563c8[_0x514c81(0x1e3)]&&console[_0x514c81(0x290)](_0x514c81(0x26f));}const _0x2e21d9=getConsoleNextUrl(_0xd563c8[_0x514c81(0x2b8)],_0x514c81(0x236)+_0x54f891+_0x514c81(0x1dd)+_0x1f7a98+_0x514c81(0x23a)),_0x2e3722={'id':_0x41ba43['id'],'name':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x2ac)],'description':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x225)],'state':_0x41ba43['attributes'][_0x514c81(0x24f)],'paused':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x203)],'reentry_mode':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x206)],'stages':_0x41ba43[_0x514c81(0x1e5)]['journeyStages']?.['length']||0x0,..._0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x292)]&&{'goal':_0x41ba43[_0x514c81(0x1e5)]['goal'][_0x514c81(0x2ac)]},..._0x3a91e2&&{'statistics':{'size':_0x3a91e2['size'],'entered':_0x3a91e2['enteredSize'],'goal_achieved':_0x3a91e2[_0x514c81(0x2a1)],'completion_rate':_0x3a91e2[_0x514c81(0x23c)],'exit_or_jump':_0x3a91e2['exitOrJumpSize'],'exit_or_jump_rate':_0x3a91e2['exitOrJumpRate'],'stages':_0x3a91e2[_0x514c81(0x2b9)]}},'url':_0x2e21d9};return await handleSingleObjectOutput(_0x2e3722,_0xd563c8),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:stats';[a27_0x511dbc(0x225)]='Show\x20journey\x20statistics';async['execute'](_0x14700b){const _0x4774e1=a27_0x511dbc,{options:_0x5cf05a,args:_0x45db6b,tdx:_0x576cab}=_0x14700b,_0x48bf32=_0x45db6b[0x0];if(!requireNameOrPath(_0x48bf32))return 0x1;_0x5cf05a[_0x4774e1(0x1e3)]&&console[_0x4774e1(0x290)](_0x4774e1(0x257)+_0x48bf32);const _0x35d477=_0x5cf05a,_0x377900=_0x35d477[_0x4774e1(0x1f1)],_0x12461d=_0x35d477['to'],_0x3a77f2=_0x35d477[_0x4774e1(0x2bc)],_0x29cf6f=_0x35d477[_0x4774e1(0x227)];_0x3a77f2&&!_0x377900&&!_0x12461d&&console[_0x4774e1(0x290)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x721956=_0x3a77f2?withJsonFormat(_0x5cf05a):_0x5cf05a,{journeyId:_0x4ca1f4,journeyName:_0x50621c}=await resolveJourneyIdFromInput(_0x48bf32,_0x721956,_0x576cab),_0x50bcb4=_0x377900||_0x12461d?{'from':_0x377900,'to':_0x12461d}:undefined,_0x310af4=await withSpinner(_0x4774e1(0x28c),()=>Promise[_0x4774e1(0x245)]([_0x576cab[_0x4774e1(0x24d)][_0x4774e1(0x1fb)](_0x4ca1f4),_0x576cab[_0x4774e1(0x24d)]['getStatistics'](_0x4ca1f4,_0x50bcb4)]),{'verbose':_0x721956[_0x4774e1(0x1e3)]}),[_0x1aaacb,_0x8a4a34]=_0x310af4['data'];if(!_0x8a4a34||_0x8a4a34[_0x4774e1(0x2a5)]===null)return console[_0x4774e1(0x290)](_0x4774e1(0x247)+_0x50621c),console[_0x4774e1(0x290)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x42a78d=buildStageNameMap(_0x1aaacb),_0x252258=!!(_0x50bcb4&&_0x8a4a34['history']?.[_0x4774e1(0x284)]),_0x1f5a81={'stageNameMap':_0x42a78d,'hasPeriod':_0x252258,'includeHistory':!!_0x3a77f2};if(_0x29cf6f&&_0x8a4a34[_0x4774e1(0x2b9)]){const _0x4ccf0d=_0x8a4a34[_0x4774e1(0x2b9)][_0x4774e1(0x239)](_0x5d4c79=>{const _0x13e4d2=_0x4774e1,_0x1c3e28=_0x42a78d['get'](_0x5d4c79['id'])??'';return _0x1c3e28['toLowerCase']()===_0x29cf6f[_0x13e4d2(0x273)]();});if(_0x4ccf0d)return await handleSingleObjectOutput(formatStageStats(_0x4ccf0d,_0x1f5a81),_0x721956),0x0;const _0x2ca367=_0x8a4a34[_0x4774e1(0x2b9)][_0x4774e1(0x20c)](_0x4c7699=>_0x42a78d[_0x4774e1(0x1f9)](_0x4c7699['id'])??_0x4c7699['id']);return console[_0x4774e1(0x290)](_0x4774e1(0x28a)+_0x29cf6f+_0x4774e1(0x20e)),console[_0x4774e1(0x290)](_0x4774e1(0x26c)+_0x2ca367[_0x4774e1(0x299)](',\x20')),0x1;}const _0x3c4050=_0x8a4a34[_0x4774e1(0x2b9)]?.['map'](_0x5db373=>formatStageStats(_0x5db373,_0x1f5a81)),_0x136a5c=assembleJourneyStats(_0x8a4a34,{'from':_0x377900,'to':_0x12461d,'includeHistory':_0x3a77f2});return await this[_0x4774e1(0x258)](_0x136a5c,_0x3c4050??[],_0x721956),0x0;}async['renderStats'](_0x5ae606,_0x45cf32,_0x17b7ca){const _0x5dcb50=a27_0x511dbc,_0xc3e9bf=_0x17b7ca['format']==='json'||_0x17b7ca[_0x5dcb50(0x1ce)]===_0x5dcb50(0x1cd)||_0x17b7ca[_0x5dcb50(0x25b)]||_0x17b7ca[_0x5dcb50(0x1cd)];if(_0xc3e9bf){_0x5ae606['stages']=_0x45cf32,await handleSingleObjectOutput(_0x5ae606,_0x17b7ca);return;}await handleSingleObjectOutput(_0x5ae606,_0x17b7ca);for(const _0x317783 of _0x45cf32){console['log'](''),console[_0x5dcb50(0x279)](String(a27_0x43744a[_0x5dcb50(0x232)]['bold']('['+_0x317783[_0x5dcb50(0x2ac)]+']'))+a27_0x43744a[_0x5dcb50(0x23d)]('\x20'+_0x317783['id']));const {id:_0x194aeb,name:_0x4146b7,..._0x2e62bd}=_0x317783;await handleSingleObjectOutput(_0x2e62bd,_0x17b7ca);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x246);['description']=a27_0x511dbc(0x219);async[a27_0x511dbc(0x229)](_0x56aec2){const _0xfd53cf=a27_0x511dbc,{options:_0x53e6bb,args:_0x15585a,tdx:_0x4823df}=_0x56aec2,_0xdbecc7=_0x15585a[0x0];if(!requireNameOrPath(_0xdbecc7))return 0x1;_0x53e6bb['verbose']&&console[_0xfd53cf(0x290)](_0xfd53cf(0x257)+_0xdbecc7);const _0x406d2c=_0x53e6bb,_0x5c9761=_0x406d2c[_0xfd53cf(0x26d)],_0x3e88c3=_0x406d2c['from'],_0x229b2b=_0x406d2c['to'],_0x46a257=_0x406d2c[_0xfd53cf(0x261)];if(_0x5c9761&&_0x5c9761!==_0xfd53cf(0x2a6)&&_0x5c9761!==_0xfd53cf(0x214))return console['error'](_0xfd53cf(0x2b1)+_0x5c9761+_0xfd53cf(0x21a)),0x1;const _0xbc0c01=withJsonFormat(_0x53e6bb),{journeyId:_0x2a500a,journeyName:_0x455c09}=await resolveJourneyIdFromInput(_0xdbecc7,_0xbc0c01,_0x4823df),_0x283c8e={'type':_0x5c9761,'from':_0x3e88c3,'to':_0x229b2b,'limit':_0x46a257},_0x40e6cb=await withSpinner(_0xfd53cf(0x21d),()=>_0x4823df[_0xfd53cf(0x24d)][_0xfd53cf(0x282)](_0x2a500a,_0x283c8e),{'verbose':_0xbc0c01[_0xfd53cf(0x1e3)]}),_0x39f174=_0x40e6cb['data'],_0x4caffd=_0x39f174[_0xfd53cf(0x2a6)]&&(_0x39f174['conversion'][_0xfd53cf(0x2c4)]['length']>0x0||_0x39f174[_0xfd53cf(0x2a6)][_0xfd53cf(0x29e)][_0xfd53cf(0x284)]>0x0),_0xe0120d=_0x39f174[_0xfd53cf(0x214)]&&_0x39f174[_0xfd53cf(0x214)][_0xfd53cf(0x284)]>0x0;if(!_0x4caffd&&!_0xe0120d)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x455c09),console[_0xfd53cf(0x290)](_0xfd53cf(0x274)),_0x3e88c3&&_0x229b2b&&console['error']('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x39f174,_0xbc0c01),0x0;}}function formatStageStats(_0x410a5d,_0x2b73e2){const _0x575516=a27_0x511dbc,_0x946736=_0x2b73e2['hasPeriod']&&_0x410a5d[_0x575516(0x2c5)]?.['length']?aggregateStageHistory(_0x410a5d['history']):{'size':_0x410a5d[_0x575516(0x201)],'entered':_0x410a5d[_0x575516(0x210)],'milestone':_0x410a5d['milestoneSize'],'milestone_rate':_0x410a5d['completeMilestoneRate'],'exit_or_jump':_0x410a5d[_0x575516(0x2cb)],'exit_or_jump_rate':_0x410a5d[_0x575516(0x1dc)]},_0x163aee={'id':_0x410a5d['id'],'name':_0x2b73e2['stageNameMap'][_0x575516(0x1f9)](_0x410a5d['id'])??_0x410a5d['id'],..._0x946736};return _0x2b73e2[_0x575516(0x224)]&&_0x2b73e2['includeHistory']&&_0x410a5d[_0x575516(0x2c5)]&&(_0x163aee[_0x575516(0x2c5)]=_0x410a5d[_0x575516(0x2c5)]),_0x163aee;}export class JourneyPauseCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x1eb);[a27_0x511dbc(0x225)]=a27_0x511dbc(0x24a);async[a27_0x511dbc(0x229)](_0x7e0167){const _0x4cacfb=a27_0x511dbc,{options:_0x5ba591,args:_0x20ece1,tdx:_0x4d65f3}=_0x7e0167,_0x36ed7c=_0x20ece1[0x0];if(!requireNameOrPath(_0x36ed7c))return 0x1;_0x5ba591[_0x4cacfb(0x1e3)]&&console[_0x4cacfb(0x290)]('Input:\x20'+_0x36ed7c);const {journeyId:_0x1c2f70,journeyName:_0x3f13cc}=await resolveJourneyIdFromInput(_0x36ed7c,_0x5ba591,_0x4d65f3);if(!_0x5ba591[_0x4cacfb(0x1cf)]){const _0x5097d8=await confirm(_0x4cacfb(0x2a2)+_0x3f13cc+'\x22?');if(!_0x5097d8)return console[_0x4cacfb(0x290)](_0x4cacfb(0x259)),0x0;}const _0x1e4a44=await withSpinner(_0x4cacfb(0x1de),()=>_0x4d65f3[_0x4cacfb(0x24d)][_0x4cacfb(0x254)](_0x1c2f70),{'verbose':_0x5ba591[_0x4cacfb(0x1e3)]}),_0x4efcdc=_0x1e4a44[_0x4cacfb(0x253)];return console[_0x4cacfb(0x290)](_0x4cacfb(0x25d)+_0x4efcdc[_0x4cacfb(0x1e5)][_0x4cacfb(0x2ac)]+_0x4cacfb(0x2ad)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:resume';[a27_0x511dbc(0x225)]='Resume\x20a\x20paused\x20journey';async[a27_0x511dbc(0x229)](_0x369920){const _0x268665=a27_0x511dbc,{options:_0x26a731,args:_0x1559cc,tdx:_0x4fac32}=_0x369920,_0x1f2b8c=_0x1559cc[0x0];if(!requireNameOrPath(_0x1f2b8c))return 0x1;_0x26a731[_0x268665(0x1e3)]&&console[_0x268665(0x290)](_0x268665(0x257)+_0x1f2b8c);const {journeyId:_0x3eae6f,journeyName:_0x13b547}=await resolveJourneyIdFromInput(_0x1f2b8c,_0x26a731,_0x4fac32);if(!_0x26a731[_0x268665(0x1cf)]){const _0x5de853=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x13b547+'\x22?');if(!_0x5de853)return console[_0x268665(0x290)](_0x268665(0x259)),0x0;}const _0x4ea8bc=await withSpinner('Resuming\x20journey...',()=>_0x4fac32['journey']['resume'](_0x3eae6f),{'verbose':_0x26a731[_0x268665(0x1e3)]}),_0x39f45a=_0x4ea8bc[_0x268665(0x253)];return console[_0x268665(0x290)](_0x268665(0x25d)+_0x39f45a['attributes']['name']+_0x268665(0x2cf)),0x0;}}function a27_0x215c(){const _0x48abbf=['replace','json','\x20\x20Folder\x20path:\x20','β\x20Journey\x20\x22','journeyName','\x20journeys','split','limit','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Found\x20','web','resolveSegment','filter','Getting\x20column\x20mapping...','\x27\x20not\x20found\x20in\x20','table','isNew','\x20files?','Available\x20stages:\x20','type','\x20Created\x20v','\x20\x20Statistics\x20not\x20available','Warning:\x20Could\x20not\x20resolve\x20activation\x20','session','stringify','toLowerCase','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','values','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','log','cwd','folderPath','16ikekEx','segmentName','getSegment','\x20\x20Parent\x20segment:\x20','base','file','getTrafficData','getActivation','length','localeCompare','Journey\x20name:\x20','buildIdToNameMap','\x20(draft)\x20β\x20\x22','\x20version','Error:\x20Stage\x20\x22','journey:view','Getting\x20journey\x20statistics...','Resolved\x20YAML\x20file:\x20','message','hasChanges','error','10ttkwCQ','goal','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','yellow','listFolders','listJourneysFromParentSegment','add','options','join','408GhmxMz','Warning:\x20Could\x20not\x20resolve\x20segment\x20','green','journey:pull','links','listActivationsFlat','\x20activation','goalSize','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20Version\x20','journeyId','conversion','4782954fgTltZ','Folder\x20path:\x20',',\x20version:\x20','setPhase','audienceId','name','\x22\x20paused','List\x20all\x20versions\x20of\x20a\x20journey','createdAt','set','Error:\x20Invalid\x20--type\x20\x22','absolutePath','errorCode','Fetching\x20','Parent\x20segment:\x20','journey:versions','parent_segment','site','stages','journey:version:create','journeyBundleName','includeHistory','/j/da','versionNumber','activationParams','\x20Opening\x20','includeStats','...','Resolving\x20parent\x20segment...','nodes','history','4525565fWongF','Listing\x20journey\x20activations...','red','Fetching\x20users\x20and\x20connections...','helpText','exitOrJumpSize','Resolving\x20journey...','3462891iKtWwE','filePath','\x22\x20resumed','(paused)','Error:\x20Journey\x20not\x20found:\x20','No\x20journeys\x20found','rootFolderId','entries','journeyBundleId','jsonl','format','yes','user','then','Error:\x20--version\x20option\x20is\x20required','7093849whfcpS','draft','-\x20no\x20files\x20written','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x20(ID:\x20','rule','β\x20Context\x20set:\x20','Error:\x20','createVersion','exitOrJumpRate','/e/','Pausing\x20journey...','\x20\x20Journey\x20ID:\x20','Getting\x20journey\x20details...','journey:activations','INVALID_ARGUMENT','verbose','(draft)','attributes','getColumnMapping','Write\x20','Export\x20journey(s)\x20as\x20YAML\x20files','1563183UyUGiW','repeat','journey:pause','relativePath','4538HTzsev','\x20\x20Consolidating\x20duplicate\x20segment:\x20','has','listVersions','from','archived','version','activation_','connector_config','Options:','Database:\x20','journeyStages','get','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','getJourney','Show\x20journey\x20table\x20column\x20mapping','args','3686353ToESlW','completed','β\x20Pulled\x20','size','push','paused','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Table:\x20','reentryMode','segment','connection','\x20unchanged\x20files','\x20journey','Error:\x20Journey\x20\x27','map','listJourneysWithFolders','\x22\x20not\x20found','test','enteredSize','targetDir','β\x20All\x20files\x20are\x20up\x20to\x20date','Error:\x20Parent\x20segment\x20context\x20required','activation','buildIdToEmailMap','folderId','4guccYx','\x20not\x20found.\x20Available:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Resolving\x20version...','Getting\x20journey\x20traffic\x20data...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','resolveParentId','parentSegment','Listing\x20journey\x20versions...','(completed)','parentName','hasPeriod','description','getStatistics','stage','segmentPushCommand','execute','Fetching\x20journeys\x20and\x20folders...','.yml','\x20(rule\x20match)','\x20versions)','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)','\x5c$&','π\x20','database','cyan','Creating\x20new\x20version...','sort','\x20new\x20files','/app/ps/','\x20journey\x20files\x20to\x20','content','find','/j/da/je','(root)','completionRate','dim','(archived)','utf-8','Fetching\x20parent\x20segment...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','launched','Listing\x20journeys...','diff','all','journey:traffic','No\x20statistics\x20available\x20for\x20journey:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','getLatestJourneyId','Pause\x20a\x20running\x20journey','segments','kind','journey','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','state','tsv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aPull\x20summary:','data','pause','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20\x20-\x20','Input:\x20','renderStats','Cancelled'];a27_0x215c=function(){return _0x48abbf;};return a27_0x215c();}export class JourneyPullCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x29d);['description']=a27_0x511dbc(0x1e8);async[a27_0x511dbc(0x229)](_0x1f0183){const _0x5dd557=a27_0x511dbc,{options:_0x32d24a,args:_0x26f6f3,tdx:_0x34b05d}=_0x1f0183,_0x1dc154=_0x32d24a,_0x5f0c25=_0x26f6f3[0x0],_0x31714c=_0x5f0c25&&isYamlFilePath(_0x5f0c25),_0x1974af=await resolveTarget({'arg':_0x31714c?_0x5f0c25:undefined,'contextParent':_0x32d24a[_0x5dd557(0x220)],'cwd':process[_0x5dd557(0x27a)]()});if(!isSuccessfulResolution(_0x1974af))return _0x1974af[_0x5dd557(0x2b3)]==='no_parent'?(console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x294)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x5dd557(0x22e)),console[_0x5dd557(0x290)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x5dd557(0x290)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x5dd557(0x290)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a27_0x43744a['red'](_0x5dd557(0x1da)+_0x1974af[_0x5dd557(0x28e)]+'\x0a')),_0x1974af[_0x5dd557(0x2ca)]&&console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x232)](_0x1974af[_0x5dd557(0x2ca)]))),0x1;let _0x3f591b=_0x31714c?undefined:_0x5f0c25,_0x376a04,_0x515a76;_0x1974af['type']===_0x5dd557(0x281)&&(_0x3f591b=_0x1974af['resourceName'],_0x376a04=_0x1974af[_0x5dd557(0x2ce)],_0x515a76=_0x1974af[_0x5dd557(0x27b)]);const _0x39ad06=_0x1974af[_0x5dd557(0x223)],_0x369aed=_0x1974af[_0x5dd557(0x211)];_0x1dc154['verbose']&&(console['error']('Parent\x20segment:\x20'+_0x39ad06),console[_0x5dd557(0x290)]('Target\x20directory:\x20'+_0x369aed),_0x3f591b&&console[_0x5dd557(0x290)](_0x5dd557(0x286)+_0x3f591b),_0x376a04&&console['error']('Target\x20file:\x20'+_0x376a04),_0x515a76&&console['error'](_0x5dd557(0x2a8)+_0x515a76));const _0x216ce0=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x34b05d['segment'][_0x5dd557(0x21f)](_0x39ad06),{'verbose':_0x32d24a[_0x5dd557(0x1e3)]}),_0x2618e3=_0x216ce0[_0x5dd557(0x253)],{journeys:_0x59ff24,folders:_0x3a60ee}=await withSpinner(_0x5dd557(0x22a),async()=>{const _0x4672f9=_0x5dd557,[_0x54ff2d,_0x7c4f97]=await Promise[_0x4672f9(0x245)]([_0x34b05d[_0x4672f9(0x24d)][_0x4672f9(0x296)](_0x2618e3,undefined,{'includeAllVersions':!![]}),_0x34b05d[_0x4672f9(0x207)][_0x4672f9(0x295)](_0x2618e3)]);return{'journeys':_0x54ff2d,'folders':_0x7c4f97};},{'verbose':_0x32d24a[_0x5dd557(0x1e3)]})[_0x5dd557(0x1d1)](_0x1904ec=>_0x1904ec[_0x5dd557(0x253)]);let _0xcadd8=_0x59ff24;const _0x3a3f66=buildFolderIdToPathMap(_0x3a60ee);if(_0x3f591b){const _0x4cf2f6=_0xcadd8[_0x5dd557(0x266)](_0x3042b7=>_0x3042b7[_0x5dd557(0x2bb)]['toLowerCase']()===_0x3f591b[_0x5dd557(0x273)]());if(_0x4cf2f6[_0x5dd557(0x284)]===0x0)return console['error'](_0x5dd557(0x1c8)+_0x3f591b),console[_0x5dd557(0x290)](_0x5dd557(0x204)),0x1;_0xcadd8=_0x4cf2f6;}if(_0x515a76!==undefined){const _0x25062b=_0xcadd8[_0x5dd557(0x266)](_0x39395e=>{const _0x34120c=_0x5dd557,_0x68d21e=_0x39395e[_0x34120c(0x216)]?_0x3a3f66[_0x34120c(0x1f9)](_0x39395e['folderId'])||'':'';return _0x68d21e===_0x515a76;});if(_0x25062b[_0x5dd557(0x284)]===0x0&&_0xcadd8['length']>0x0){console[_0x5dd557(0x290)](_0x5dd557(0x20b)+_0x3f591b+_0x5dd557(0x268)+(_0x515a76||'root\x20folder')),console[_0x5dd557(0x290)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x2ef3fe of _0xcadd8){const _0x217562=_0x2ef3fe[_0x5dd557(0x216)]?_0x3a3f66[_0x5dd557(0x1f9)](_0x2ef3fe[_0x5dd557(0x216)])||'':'';console[_0x5dd557(0x290)](_0x5dd557(0x256)+(_0x217562||'(root)')+'/'+_0x2ef3fe['journeyBundleName']);}return 0x1;}_0xcadd8=_0x25062b;}if(_0xcadd8[_0x5dd557(0x284)]===0x0)return console[_0x5dd557(0x290)](_0x5dd557(0x1c9)),0x0;const _0x59ae4c=new Map();for(const _0x52161b of _0xcadd8){const _0x39854c=_0x52161b[_0x5dd557(0x1cc)];!_0x59ae4c[_0x5dd557(0x1ef)](_0x39854c)&&_0x59ae4c['set'](_0x39854c,[]),_0x59ae4c[_0x5dd557(0x1f9)](_0x39854c)[_0x5dd557(0x202)](_0x52161b);}for(const _0x1ed008 of _0x59ae4c['values']()){_0x1ed008['sort']((_0x261771,_0x1f0679)=>(_0x261771[_0x5dd557(0x2be)]||0x0)-(_0x1f0679['versionNumber']||0x0));}const _0x429447=[],{idToEmailMap:_0x5c8b99,connectionIdToNameMap:_0x40f3d5}=await withSpinner(_0x5dd557(0x2c9),async()=>{const _0x423751=_0x5dd557,[_0x41eb38,_0x322580]=await Promise[_0x423751(0x245)]([_0x34b05d[_0x423751(0x1d0)][_0x423751(0x215)](),_0x34b05d[_0x423751(0x208)][_0x423751(0x287)]()]);return{'idToEmailMap':_0x41eb38,'connectionIdToNameMap':_0x322580};},{'verbose':_0x32d24a[_0x5dd557(0x1e3)]})[_0x5dd557(0x1d1)](_0x3e1edc=>_0x3e1edc[_0x5dd557(0x253)]);for(const _0x27cf56 of _0x59ae4c[_0x5dd557(0x275)]()){const _0x4c4545=_0x27cf56[0x0][_0x5dd557(0x2bb)],_0x48bfbf=_0x27cf56[0x0][_0x5dd557(0x216)],_0x51b26a=_0x48bfbf?_0x3a3f66[_0x5dd557(0x1f9)](_0x48bfbf)||'':'',_0xa25dde=_0x51b26a?a27_0x303d57[_0x5dd557(0x299)](_0x369aed,_0x51b26a):_0x369aed,_0x363452=_0x376a04||a27_0x303d57[_0x5dd557(0x299)](_0xa25dde,sanitizeFileName(_0x4c4545)+_0x5dd557(0x22b));let _0x408a10,_0x2e3ba2;if(existsSync(_0x363452))try{const _0x4f8cda=readFileSync(_0x363452,_0x5dd557(0x23f)),_0x8807f3=parseYamlString(_0x4f8cda);_0x2e3ba2=_0x8807f3,_0x408a10=buildRuleToNameMapping(_0x8807f3),_0x1dc154['verbose']&&_0x408a10['size']>0x0&&console['error'](_0x5dd557(0x263)+_0x408a10[_0x5dd557(0x201)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x4c4545);}catch(_0x25e4e4){_0x1dc154[_0x5dd557(0x1e3)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x25e4e4['message']);}const _0x50ef38=[],_0x219cb2=new Set(),_0x43aa9e=new Map(),_0x54c445=new Map(),_0x57dbe3=new Set(),_0x2ace5d=new Map(),_0x3221ca=new Map(),_0x36cc9a=createJumpTargetCache();await withProgressSpinner(_0x5dd557(0x2b4)+_0x4c4545+_0x5dd557(0x2c2),async _0x3a03eb=>{const _0x21a660=_0x5dd557;for(const _0x1a7e68 of _0x27cf56){const _0x36de4c=_0x27cf56['length']>0x1?_0x1a7e68[_0x21a660(0x2bb)]+'\x20v'+(_0x1a7e68[_0x21a660(0x2be)]||0x1):_0x1a7e68[_0x21a660(0x2bb)];_0x3a03eb[_0x21a660(0x2aa)](_0x21a660(0x2b4)+_0x36de4c);const _0x13409a=await _0x34b05d[_0x21a660(0x24d)][_0x21a660(0x1fb)](_0x1a7e68['id']),_0x1bc445=_0x13409a['attributes']?.[_0x21a660(0x2ab)],_0xf007de={'resolveSegment':async _0x1338dc=>{const _0x3713cc=_0x21a660;if(!_0x1bc445)return{'name':_0x1338dc,'isJourneyLocal':![]};const _0x2c91ed=_0x43aa9e[_0x3713cc(0x1f9)](_0x1338dc);if(_0x2c91ed)return _0x2c91ed;try{const _0x4db57a=await _0x34b05d['segment'][_0x3713cc(0x27e)](_0x1bc445,_0x1338dc),_0x58ff78=_0x4db57a[_0x3713cc(0x24c)]===SEGMENT_KIND_JOURNEY;let _0x9260f,_0x4c6b50=_0x4db57a['name'];if(_0x58ff78&&_0x4db57a['rule']){const _0xd32b82=await segmentResponseToDef(_0x4db57a,{'resolveSegmentName':async _0x1c1ebb=>{const _0x264a93=_0x3713cc,_0x10c41c=_0x43aa9e[_0x264a93(0x1f9)](_0x1c1ebb);if(_0x10c41c)return _0x10c41c[_0x264a93(0x2ac)];const _0x4def9e=await _0xf007de[_0x264a93(0x265)](_0x1c1ebb);return _0x4def9e['name'];}}),_0x391c81=_0xd32b82[_0x3713cc(0x1d8)];_0x9260f={'description':_0x4db57a[_0x3713cc(0x225)],'rule':_0x391c81};const _0x176c08=serializeRule(_0x391c81),_0x265c41=_0x54c445[_0x3713cc(0x1f9)](_0x176c08);if(_0x265c41)_0x4c6b50=_0x265c41,_0x9260f=undefined,_0x1dc154[_0x3713cc(0x1e3)]&&console[_0x3713cc(0x290)](_0x3713cc(0x1ee)+_0x4db57a[_0x3713cc(0x2ac)]+'\x20->\x20'+_0x265c41);else{let _0x217596=![];if(_0x408a10){const _0x348d0e=_0x408a10[_0x3713cc(0x1f9)](_0x176c08);if(_0x348d0e){const _0x53d16c=_0x348d0e[_0x3713cc(0x239)](_0xb38560=>!_0x219cb2[_0x3713cc(0x1ef)](_0xb38560));_0x53d16c&&(_0x4c6b50=_0x53d16c,_0x219cb2[_0x3713cc(0x297)](_0x53d16c),_0x54c445['set'](_0x176c08,_0x53d16c),_0x217596=!![],_0x1dc154[_0x3713cc(0x1e3)]&&console['error'](_0x3713cc(0x277)+_0x53d16c+_0x3713cc(0x22c)));}}if(!_0x217596){const _0x3836ea=generateJourneyLocalName(_0x4db57a['name']);_0x3836ea&&(_0x4c6b50=_0x3836ea);let _0x4140e2=_0x4c6b50,_0x21ce2e=0x2;while(_0x219cb2['has'](_0x4140e2)){_0x4140e2=_0x4c6b50+'_'+_0x21ce2e,_0x21ce2e++;}_0x219cb2[_0x3713cc(0x297)](_0x4140e2),_0x54c445[_0x3713cc(0x2b0)](_0x176c08,_0x4140e2),_0x4c6b50=_0x4140e2;}}}const _0x5313d5={'name':_0x4c6b50,'isJourneyLocal':_0x58ff78,'definition':_0x9260f};return _0x43aa9e[_0x3713cc(0x2b0)](_0x1338dc,_0x5313d5),_0x5313d5;}catch(_0x169ac4){return _0x32d24a['verbose']&&console['error'](_0x3713cc(0x29b)+_0x1338dc+':\x20'+_0x169ac4[_0x3713cc(0x28e)]),{'name':_0x1338dc,'isJourneyLocal':![]};}},'resolveActivation':async _0x2b3e15=>{const _0x1d70ae=_0x21a660,_0x462d45=_0x2ace5d[_0x1d70ae(0x1f9)](_0x2b3e15);if(_0x462d45)return _0x462d45;try{const _0x4793d4=await _0x34b05d[_0x1d70ae(0x24d)][_0x1d70ae(0x283)](_0x1a7e68['id'],_0x2b3e15),_0x355b8d=journeyActivationStepToYaml(_0x4793d4,_0x5c8b99,_0x40f3d5),_0x1f3729=JSON[_0x1d70ae(0x272)]({'name':_0x355b8d[_0x1d70ae(0x2ac)],'connection':_0x355b8d[_0x1d70ae(0x208)],'connector_config':_0x355b8d[_0x1d70ae(0x1f5)]}),_0xa8eef0=_0x3221ca['get'](_0x1f3729);if(_0xa8eef0){const _0x133edc={'name':_0xa8eef0,'isJourneyLocal':!![],'definition':_0x355b8d};return _0x2ace5d['set'](_0x2b3e15,_0x133edc),_0x133edc;}const _0x1cdbf9=_0x4793d4[_0x1d70ae(0x1e5)][_0x1d70ae(0x2bf)][_0x1d70ae(0x2ac)]||_0x2b3e15,_0x2acdbf=sanitizeYamlKey(_0x1cdbf9)||_0x1d70ae(0x1f4)+_0x2b3e15;let _0x2579b1=_0x2acdbf,_0x3202a6=0x2;while(_0x57dbe3[_0x1d70ae(0x1ef)](_0x2579b1)){_0x2579b1=_0x2acdbf+'_'+_0x3202a6,_0x3202a6++;}_0x57dbe3[_0x1d70ae(0x297)](_0x2579b1),_0x3221ca[_0x1d70ae(0x2b0)](_0x1f3729,_0x2579b1);const _0x5edcac={'name':_0x2579b1,'isJourneyLocal':!![],'definition':_0x355b8d};return _0x2ace5d['set'](_0x2b3e15,_0x5edcac),_0x5edcac;}catch(_0x4b7daa){return _0x32d24a[_0x1d70ae(0x1e3)]&&console['error'](_0x1d70ae(0x270)+_0x2b3e15+':\x20'+_0x4b7daa[_0x1d70ae(0x28e)]),{'name':_0x2b3e15,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1da5ed,_0x3640f7)=>{const _0x42ba80=_0x21a660;return resolveJumpTarget(_0x1da5ed,_0x3640f7,_0x36cc9a,_0xb79474=>_0x34b05d[_0x42ba80(0x24d)][_0x42ba80(0x1fb)](_0xb79474));}},_0x12f993=await journeyResponseToDef(_0x13409a,_0xf007de);_0x50ef38[_0x21a660(0x202)]({'item':_0x1a7e68,'yaml':_0x12f993});}},{'verbose':_0x32d24a['verbose']});const _0x554d01=await _0x34b05d[_0x5dd557(0x24d)][_0x5dd557(0x249)](_0x27cf56[0x0][_0x5dd557(0x1cc)]),_0x286191=buildMergedJourneyDef(_0x50ef38,_0x408a10,_0x554d01),_0x2f3969=normalizeJourneyDef(_0x286191,_0x2e3ba2),_0x197a5b=toYamlString(_0x2f3969),_0x19183f=_0x376a04||a27_0x303d57[_0x5dd557(0x299)](_0xa25dde,sanitizeFileName(_0x4c4545)+_0x5dd557(0x22b));!_0x376a04&&_0x51b26a&&!existsSync(_0xa25dde)&&mkdirSync(_0xa25dde,{'recursive':!![]});const _0x40ca62=a27_0x303d57['relative'](process[_0x5dd557(0x27a)](),_0x19183f);if(existsSync(_0x19183f)){const _0x2fe1f8=readFileSync(_0x19183f,'utf-8'),_0x5cfeeb=generateDiff(_0x2fe1f8,_0x197a5b),_0xe20145=hasChanges(_0x5cfeeb);_0x429447[_0x5dd557(0x202)]({'relativePath':_0x40ca62,'absolutePath':_0x19183f,'content':_0x197a5b,'isNew':![],'hasChanges':_0xe20145,'diff':_0xe20145?formatDiffWithColors(_0x5cfeeb):undefined});}else _0x429447['push']({'relativePath':_0x40ca62,'absolutePath':_0x19183f,'content':_0x197a5b,'isNew':!![],'hasChanges':![]});}const _0x17a88f=_0x429447['filter'](_0x51055b=>_0x51055b['isNew']),_0x31bd18=_0x429447[_0x5dd557(0x266)](_0x5bd33d=>!_0x5bd33d[_0x5dd557(0x26a)]&&_0x5bd33d['hasChanges']),_0x52bb6c=_0x429447['filter'](_0x15213a=>!_0x15213a[_0x5dd557(0x26a)]&&!_0x15213a[_0x5dd557(0x28f)]),_0x22e9f0=_0xcadd8['length'],_0x6b1e36=_0x59ae4c[_0x5dd557(0x201)],_0x5287e3=_0x22e9f0>_0x6b1e36?'\x20('+_0x22e9f0+_0x5dd557(0x22d):'';console['error'](_0x5dd557(0x252)),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x6b1e36+_0x5dd557(0x25f))+a27_0x43744a['dim'](_0x5287e3)),console['error']('\x20\x20'+a27_0x43744a[_0x5dd557(0x29c)]('+\x20'+_0x17a88f[_0x5dd557(0x284)]+_0x5dd557(0x235))),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a[_0x5dd557(0x294)]('~\x20'+_0x31bd18[_0x5dd557(0x284)]+'\x20changed\x20files')),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a['dim']('=\x20'+_0x52bb6c['length']+_0x5dd557(0x209))),console[_0x5dd557(0x290)]('\x20\x20Target:\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x369aed)+'\x0a');if(_0x31bd18['length']>0x0)for(const _0x1945fd of _0x31bd18){console[_0x5dd557(0x290)]('\x0aChanges\x20to\x20\x27'+_0x1945fd[_0x5dd557(0x1ec)]+'\x27:'),console[_0x5dd557(0x290)]('β'[_0x5dd557(0x1ea)](0x3c)),console['error'](_0x1945fd[_0x5dd557(0x244)]),console[_0x5dd557(0x290)]('β'['repeat'](0x3c));}if(_0x1dc154['dryRun'])return console['error'](a27_0x43744a[_0x5dd557(0x294)](_0x5dd557(0x248))),0x0;if(_0x17a88f[_0x5dd557(0x284)]===0x0&&_0x31bd18['length']===0x0)return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x212))),saveSessionContext({'parent_segment':_0x39ad06},_0x1dc154[_0x5dd557(0x271)]),console['error'](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x1d9)+a27_0x43744a[_0x5dd557(0x23d)]('parent_segment')+'\x20=\x20'+a27_0x43744a['cyan'](_0x39ad06))),0x0;if(!_0x1dc154[_0x5dd557(0x1cf)]&&(_0x17a88f['length']>0x0||_0x31bd18[_0x5dd557(0x284)]>0x0)){if(!isInteractive())return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x2c8)]('\x0aError:'),_0x5dd557(0x2a3)),console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x23d)](_0x5dd557(0x251))),0x1;const _0x2f1688=await confirmKey(_0x5dd557(0x1e7)+(_0x17a88f[_0x5dd557(0x284)]+_0x31bd18[_0x5dd557(0x284)])+_0x5dd557(0x26b));if(!_0x2f1688)return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x294)]('Aborted.'),_0x5dd557(0x1d5)),0x1;}!existsSync(_0x369aed)&&mkdirSync(_0x369aed,{'recursive':!![]});const _0x561a85=a27_0x303d57[_0x5dd557(0x299)](_0x369aed,'tdx.json');writeFileSync(_0x561a85,createTdxConfigContent(_0x39ad06),_0x5dd557(0x23f));for(const _0x5eb9f5 of _0x429447){(_0x5eb9f5[_0x5dd557(0x26a)]||_0x5eb9f5[_0x5dd557(0x28f)])&&writeFileSync(_0x5eb9f5[_0x5dd557(0x2b2)],_0x5eb9f5[_0x5dd557(0x238)],_0x5dd557(0x23f));}return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x200)+(_0x17a88f[_0x5dd557(0x284)]+_0x31bd18['length'])+_0x5dd557(0x237)+_0x369aed)),saveSessionContext({'parent_segment':_0x39ad06},_0x1dc154[_0x5dd557(0x271)]),console[_0x5dd557(0x290)](a27_0x43744a['green'](_0x5dd557(0x1d9)+a27_0x43744a[_0x5dd557(0x23d)](_0x5dd557(0x2b7))+'\x20=\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x39ad06))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a27_0x511dbc(0x225)]=a27_0x511dbc(0x1fc);async[a27_0x511dbc(0x229)](_0x887335){const _0x1500d9=a27_0x511dbc,{options:_0x1b9dc7,args:_0x21f75f,tdx:_0x46e7db}=_0x887335,_0x4479c5=_0x21f75f[0x0];if(!requireNameOrPath(_0x4479c5))return 0x1;_0x1b9dc7[_0x1500d9(0x1e3)]&&console[_0x1500d9(0x290)](_0x1500d9(0x257)+_0x4479c5);const {journeyId:_0x22fd0a}=await resolveJourneyIdFromInput(_0x4479c5,_0x1b9dc7,_0x46e7db),_0x42b059=await withSpinner(_0x1500d9(0x267),()=>_0x46e7db[_0x1500d9(0x24d)][_0x1500d9(0x1e6)](_0x22fd0a),{'verbose':_0x1b9dc7['verbose']}),_0x2e4b50=_0x42b059[_0x1500d9(0x253)];return console[_0x1500d9(0x279)](_0x1500d9(0x1f7)+_0x2e4b50[_0x1500d9(0x231)]),console[_0x1500d9(0x279)](_0x1500d9(0x205)+_0x2e4b50[_0x1500d9(0x269)]),await handleSDKOutput(_0x2e4b50['columns'],_0x1b9dc7),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x1e1);[a27_0x511dbc(0x225)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x511dbc(0x229)](_0x30c6ed){const _0x1c45c7=a27_0x511dbc,{options:_0x180226,args:_0x351c0e,tdx:_0x4b9119}=_0x30c6ed,_0x40cc86=_0x351c0e[0x0];if(!requireNameOrPath(_0x40cc86))return 0x1;_0x180226[_0x1c45c7(0x1e3)]&&console[_0x1c45c7(0x290)](_0x1c45c7(0x257)+_0x40cc86);const {journeyId:_0x2c8abb}=await resolveJourneyIdFromInput(_0x40cc86,_0x180226,_0x4b9119),_0x5e0d4c=await withSpinner(_0x1c45c7(0x2c7),()=>_0x4b9119[_0x1c45c7(0x24d)][_0x1c45c7(0x29f)](_0x2c8abb),{'verbose':_0x180226['verbose']}),_0x4baf60=_0x5e0d4c['data'];return console[_0x1c45c7(0x290)](_0x1c45c7(0x263)+_0x4baf60[_0x1c45c7(0x284)]+_0x1c45c7(0x2a0)+(_0x4baf60['length']!==0x1?'s':'')),await handleSDKOutput(_0x4baf60,_0x180226),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:push';[a27_0x511dbc(0x225)]=a27_0x511dbc(0x293);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x511dbc(0x229)](_0x3b1778){const _0x50d3c5=a27_0x511dbc,_0x4750f4=_0x3b1778[_0x50d3c5(0x1fd)][0x0];let _0x53ebd2;if(_0x4750f4){const _0xbc8a1c=await resolveTarget({'arg':_0x4750f4,'contextParent':_0x3b1778[_0x50d3c5(0x298)][_0x50d3c5(0x220)],'cwd':process[_0x50d3c5(0x27a)]()});isSuccessfulResolution(_0xbc8a1c)&&_0xbc8a1c['type']==='file'&&(_0x53ebd2=_0xbc8a1c[_0x50d3c5(0x2ce)]);}const _0x80780c={..._0x3b1778,'options':{..._0x3b1778[_0x50d3c5(0x298)],'journeysOnly':!![],..._0x53ebd2&&{'singleFilePath':_0x53ebd2}}};return this[_0x50d3c5(0x228)]['execute'](_0x80780c);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a27_0x511dbc(0x2b6);[a27_0x511dbc(0x225)]=a27_0x511dbc(0x2ae);async[a27_0x511dbc(0x229)](_0x90b254){const _0x1ea319=a27_0x511dbc,{options:_0x34a93f,args:_0x38d910,tdx:_0x3583d6}=_0x90b254,_0x42ee2e=_0x38d910[0x0];if(!requireNameOrPath(_0x42ee2e))return 0x1;if(_0x34a93f['verbose'])console[_0x1ea319(0x290)](_0x1ea319(0x257)+_0x42ee2e);const {journeyId:_0x17b66b}=await resolveJourneyIdFromInput(_0x42ee2e,_0x34a93f,_0x3583d6),_0x4855ae=await withSpinner(_0x1ea319(0x221),()=>_0x3583d6[_0x1ea319(0x24d)][_0x1ea319(0x1f0)](_0x17b66b),{'verbose':_0x34a93f[_0x1ea319(0x1e3)]}),{bundleName:_0xd4cfbd,versions:_0x3e7980,latestJourneyId:_0x4c67ef}=_0x4855ae[_0x1ea319(0x253)];console[_0x1ea319(0x290)](_0xd4cfbd+':\x20'+_0x3e7980[_0x1ea319(0x284)]+_0x1ea319(0x289)+(_0x3e7980[_0x1ea319(0x284)]!==0x1?'s':''));const _0x5df20d=_0x3e7980[_0x1ea319(0x20c)](_0x304666=>({'version':_0x304666[_0x1ea319(0x2be)],'journey_id':_0x304666[_0x1ea319(0x2a5)],'name':_0x304666[_0x1ea319(0x2ac)],'state':_0x304666['state'],'paused':_0x304666[_0x1ea319(0x203)],'latest':_0x304666[_0x1ea319(0x2a5)]===_0x4c67ef,'created_at':_0x304666['createdAt']}));return await handleSDKOutput(_0x5df20d,_0x34a93f),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x2ba);['description']=a27_0x511dbc(0x276);async[a27_0x511dbc(0x229)](_0x431522){const _0x4cabd5=a27_0x511dbc,{options:_0x49d896,args:_0x79fc78,tdx:_0x17b6b7}=_0x431522,_0xb78b1b=_0x79fc78[0x0];if(!requireNameOrPath(_0xb78b1b))return 0x1;if(_0x49d896[_0x4cabd5(0x1e3)])console[_0x4cabd5(0x290)](_0x4cabd5(0x257)+_0xb78b1b);const {journeyId:_0x45ecec,journeyName:_0x1e7d46}=await resolveJourneyIdFromInput(_0xb78b1b,_0x49d896,_0x17b6b7);if(!_0x49d896['yes']){const _0x4de838=await confirm(_0x4cabd5(0x278)+_0x1e7d46+'\x22?');if(!_0x4de838)return console[_0x4cabd5(0x290)](_0x4cabd5(0x259)),0x0;}const _0x155c82=await withSpinner(_0x4cabd5(0x233),()=>_0x17b6b7[_0x4cabd5(0x24d)][_0x4cabd5(0x1db)](_0x45ecec),{'verbose':_0x49d896[_0x4cabd5(0x1e3)]}),_0x21628d=_0x155c82['data'];return console[_0x4cabd5(0x290)](a27_0x43744a['green']('β')+_0x4cabd5(0x26e)+_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2be)]+_0x4cabd5(0x288)+_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2ac)]+'\x22'),console[_0x4cabd5(0x290)](_0x4cabd5(0x1df)+_0x21628d['id']),await handleSingleObjectOutput({'id':_0x21628d['id'],'name':_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2ac)],'version':_0x21628d['attributes'][_0x4cabd5(0x2be)],'state':_0x21628d['attributes'][_0x4cabd5(0x24f)],'bundle_id':_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x1cc)],'created_at':_0x21628d[_0x4cabd5(0x1e5)]['createdAt']},_0x49d896),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:version:view';[a27_0x511dbc(0x225)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x511dbc(0x229)](_0x46057b){const _0x27ce79=a27_0x511dbc,{options:_0x3006d0,args:_0x3eb20a,tdx:_0x18821a}=_0x46057b,_0x42397e=_0x3eb20a[0x0];if(!requireNameOrPath(_0x42397e))return 0x1;const _0x230acb=_0x3006d0[_0x27ce79(0x1f3)];if(!_0x230acb)return console['error'](_0x27ce79(0x1d2)),console[_0x27ce79(0x290)](_0x27ce79(0x262)),0x1;const _0x3ea895=parseInt(_0x230acb,0xa);if(isNaN(_0x3ea895)||_0x3ea895<0x1)return console[_0x27ce79(0x290)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x230acb),0x1;if(_0x3006d0['verbose'])console[_0x27ce79(0x290)](_0x27ce79(0x257)+_0x42397e+_0x27ce79(0x2a9)+_0x3ea895);const {journeyId:_0x3c1655,parentSegmentId:_0x523549}=await resolveJourneyIdFromInput(_0x42397e,_0x3006d0,_0x18821a),_0x39ad2a=await withSpinner(_0x27ce79(0x21c),()=>_0x18821a['journey'][_0x27ce79(0x1f0)](_0x3c1655),{'verbose':_0x3006d0[_0x27ce79(0x1e3)]}),{versions:_0x2298c3,latestJourneyId:_0x2187f3}=_0x39ad2a[_0x27ce79(0x253)],_0x20e857=_0x2298c3['find'](_0x274d8c=>_0x274d8c['versionNumber']===_0x3ea895);if(!_0x20e857){const _0x14b59b=_0x2298c3[_0x27ce79(0x20c)](_0x15116e=>'v'+_0x15116e[_0x27ce79(0x2be)])[_0x27ce79(0x299)](',\x20');return console[_0x27ce79(0x290)](_0x27ce79(0x2a4)+_0x3ea895+_0x27ce79(0x218)+_0x14b59b),0x1;}const _0x49e6d0=await withSpinner('Getting\x20version\x20'+_0x3ea895+'\x20details...',()=>_0x18821a[_0x27ce79(0x24d)]['getJourney'](_0x20e857['journeyId']),{'verbose':_0x3006d0[_0x27ce79(0x1e3)]}),_0x227f1a=_0x49e6d0[_0x27ce79(0x253)],_0x34cca8=getConsoleNextUrl(_0x3006d0[_0x27ce79(0x2b8)],_0x27ce79(0x236)+_0x523549+_0x27ce79(0x1dd)+_0x20e857[_0x27ce79(0x2a5)]+_0x27ce79(0x23a));return await handleSingleObjectOutput({'id':_0x227f1a['id'],'name':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x2ac)],'version':_0x227f1a[_0x27ce79(0x1e5)]['versionNumber'],'description':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x225)],'state':_0x227f1a[_0x27ce79(0x1e5)]['state'],'paused':_0x227f1a[_0x27ce79(0x1e5)]['paused'],'reentry_mode':_0x227f1a['attributes'][_0x27ce79(0x206)],'stages':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x1f8)]?.[_0x27ce79(0x284)]||0x0,..._0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x292)]&&{'goal':_0x227f1a['attributes'][_0x27ce79(0x292)][_0x27ce79(0x2ac)]},'latest':_0x20e857[_0x27ce79(0x2a5)]===_0x2187f3,'created_at':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x2af)],'updated_at':_0x227f1a['attributes']['updatedAt'],'url':_0x34cca8},_0x3006d0),0x0;}}
|
|
1
|
+
const a27_0x4c3490=a27_0x3258;(function(_0x50d8a7,_0x56c288){const _0x581646=a27_0x3258,_0x1553bd=_0x50d8a7();while(!![]){try{const _0x301eba=-parseInt(_0x581646(0xe4))/0x1*(parseInt(_0x581646(0x141))/0x2)+parseInt(_0x581646(0x11a))/0x3*(-parseInt(_0x581646(0x116))/0x4)+parseInt(_0x581646(0x1e0))/0x5*(-parseInt(_0x581646(0x1a3))/0x6)+parseInt(_0x581646(0xe2))/0x7+parseInt(_0x581646(0x153))/0x8*(parseInt(_0x581646(0x1cc))/0x9)+parseInt(_0x581646(0x199))/0xa+-parseInt(_0x581646(0xfa))/0xb*(parseInt(_0x581646(0x1d8))/0xc);if(_0x301eba===_0x56c288)break;else _0x1553bd['push'](_0x1553bd['shift']());}catch(_0x90ceb8){_0x1553bd['push'](_0x1553bd['shift']());}}}(a27_0x59f5,0x85dbb));import a27_0x4757ba from'chalk';import a27_0x4e2fa5 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a27_0x3258(_0x15f9c7,_0x304bd0){_0x15f9c7=_0x15f9c7-0xd9;const _0x59f547=a27_0x59f5();let _0x325806=_0x59f547[_0x15f9c7];return _0x325806;}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}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x35894f){const _0x28a356=a27_0x3258;return!_0x35894f&&(console[_0x28a356(0x148)](_0x28a356(0x1bb)),console[_0x28a356(0x148)](_0x28a356(0xfb))),!!_0x35894f;}function withJsonFormat(_0x25276b){const _0x59ba4a=a27_0x3258;if(!_0x25276b['format']&&!_0x25276b['json']&&!_0x25276b['jsonl']&&!_0x25276b['tsv'])return{..._0x25276b,'format':_0x59ba4a(0x144),'json':!![]};return _0x25276b;}function formatJourneyState(_0x5a2f90){const _0x501ef0=a27_0x3258;switch(_0x5a2f90){case _0x501ef0(0x1a5):return a27_0x4757ba[_0x501ef0(0x137)](_0x501ef0(0x1c2));case _0x501ef0(0x112):return a27_0x4757ba[_0x501ef0(0x14d)](_0x501ef0(0x161));case _0x501ef0(0x19e):return a27_0x4757ba[_0x501ef0(0x16d)](_0x501ef0(0x18f));case'completed':return a27_0x4757ba[_0x501ef0(0x13e)](_0x501ef0(0x176));case _0x501ef0(0x170):return a27_0x4757ba['dim'](_0x501ef0(0x17b));default:return'('+_0x5a2f90+')';}}function formatJourneyItem(_0x4f4eeb,_0x1fb023='',_0x4ed652){const _0x35b8c0=a27_0x3258,_0x344cb7=formatJourneyState(_0x4f4eeb[_0x35b8c0(0xda)]),_0x30494e=_0x4ed652?hyperlink(_0x4f4eeb['journeyBundleName'],_0x4ed652):_0x4f4eeb[_0x35b8c0(0x1db)];return _0x1fb023+_0x35b8c0(0x165)+_0x30494e+'\x20'+_0x344cb7;}function escapeRegex(_0x567ee5){const _0x4c933b=a27_0x3258;return _0x567ee5[_0x4c933b(0x123)](/[.*+?^${}()|[\]\\]/g,_0x4c933b(0x136));}function globToRegex(_0x4e8a94){const _0x40cb84=a27_0x3258,_0x4d2625=_0x4e8a94[_0x40cb84(0x15d)]('*')[_0x40cb84(0x100)](escapeRegex);return new RegExp(_0x4d2625[_0x40cb84(0x155)]('.*'),'i');}function buildRuleToNameMapping(_0x44c576){const _0x200fa1=a27_0x3258,_0x2e8390=new Map();if(_0x44c576[_0x200fa1(0x171)])for(const [_0xae4aff,_0x4fcbbb]of Object[_0x200fa1(0x1b8)](_0x44c576[_0x200fa1(0x171)])){if(_0x4fcbbb[_0x200fa1(0x1c1)]){const _0x4215fb=serializeRule(_0x4fcbbb['rule']),_0x45dd27=_0x2e8390['get'](_0x4215fb);_0x45dd27?_0x45dd27[_0x200fa1(0x19a)](_0xae4aff):_0x2e8390[_0x200fa1(0x14e)](_0x4215fb,[_0xae4aff]);}}return _0x2e8390;}async function resolveJourneyIdFromInput(_0x409d86,_0x2dd48a,_0x1d80be){const _0x3be9e1=a27_0x3258,_0x4037b9=await resolveJourneyTarget(_0x409d86,_0x2dd48a[_0x3be9e1(0x126)],_0x2dd48a[_0x3be9e1(0x142)]),_0x5726d8=_0x4037b9[_0x3be9e1(0x126)];if(!_0x5726d8)throw new SDKError(ErrorCode[_0x3be9e1(0x156)],_0x3be9e1(0x152));const _0x21ab84=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x1d80be[_0x3be9e1(0x186)][_0x3be9e1(0x1b4)](_0x5726d8),{'verbose':_0x2dd48a[_0x3be9e1(0x142)]}),_0x555fe1=_0x21ab84[_0x3be9e1(0x105)],_0xff2ef7=await withSpinner('Resolving\x20journey...',()=>_0x1d80be['journey'][_0x3be9e1(0x11c)](_0x555fe1,_0x4037b9[_0x3be9e1(0x1d0)]),{'verbose':_0x2dd48a[_0x3be9e1(0x142)]});return{'journeyId':_0xff2ef7[_0x3be9e1(0x105)],'journeyName':_0x4037b9[_0x3be9e1(0x1d0)],'parentSegmentId':_0x555fe1};}async function resolveJourneyTarget(_0xc306ad,_0x38b137,_0x2f6784){const _0x34eaa6=a27_0x3258;if(isYamlFilePath(_0xc306ad))try{const _0x232af0=await resolveYamlFilePath(_0xc306ad);return _0x2f6784&&(console[_0x34eaa6(0x148)](_0x34eaa6(0x149)+_0xc306ad),console[_0x34eaa6(0x148)](_0x34eaa6(0x17a)+_0x232af0[_0x34eaa6(0x126)]),console[_0x34eaa6(0x148)](_0x34eaa6(0x187)+_0x232af0['segmentName']),console['error'](_0x34eaa6(0x196)+(_0x232af0[_0x34eaa6(0x12b)]||_0x34eaa6(0x1de)))),{'journeyName':_0x232af0[_0x34eaa6(0x140)],'parentSegment':_0x232af0[_0x34eaa6(0x126)],'resolved':_0x232af0};}catch(_0x1e363d){throw new SDKError(ErrorCode[_0x34eaa6(0x156)],_0x34eaa6(0x16f)+_0x1e363d[_0x34eaa6(0x1af)]);}if(!_0x38b137)throw new SDKError(ErrorCode[_0x34eaa6(0x156)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0xc306ad,'parentSegment':_0x38b137};}export class JourneyListCommand extends BaseCommand{[a27_0x4c3490(0x159)]=a27_0x4c3490(0x1ac);[a27_0x4c3490(0x16e)]=a27_0x4c3490(0xe9);async['execute'](_0x2293fa){const _0x3334ec=a27_0x4c3490,{options:_0x1c6d4d,args:_0x3bdd4c,tdx:_0x1d0774}=_0x2293fa,_0x32418b=_0x3bdd4c[0x0],_0x30b459=_0x1c6d4d[_0x3334ec(0x126)];if(!_0x30b459)return console[_0x3334ec(0x148)](_0x3334ec(0x111)),console[_0x3334ec(0x148)](_0x3334ec(0x1d2)),0x1;const _0x3f4ea8=await withSpinner(_0x3334ec(0x18a),()=>_0x1d0774[_0x3334ec(0x186)][_0x3334ec(0x1b4)](_0x30b459),{'verbose':_0x1c6d4d['verbose']}),_0x13e812=_0x3f4ea8[_0x3334ec(0x105)];_0x1c6d4d['verbose']&&(console[_0x3334ec(0x148)](_0x3334ec(0x146)+_0x30b459+_0x3334ec(0xed)+_0x13e812+')'),_0x32418b&&console[_0x3334ec(0x148)](_0x3334ec(0x1d7)+_0x32418b));const _0x49f254=await withSpinner(_0x3334ec(0x106),()=>_0x1d0774[_0x3334ec(0x186)][_0x3334ec(0x1b7)](_0x13e812),{'verbose':_0x1c6d4d['verbose']}),_0x429c8a=_0x49f254[_0x3334ec(0x105)],_0x4aa56f=_0x429c8a[_0x3334ec(0x1df)],_0x4dbb0e=await withSpinner(_0x3334ec(0x145),()=>_0x1d0774['journey'][_0x3334ec(0x1b1)](_0x13e812,_0x4aa56f),{'verbose':_0x1c6d4d[_0x3334ec(0x142)]});let _0x27876b=_0x4dbb0e[_0x3334ec(0x105)][_0x3334ec(0x195)];const _0x53919c=_0x4dbb0e[_0x3334ec(0x105)][_0x3334ec(0x19f)],_0x520e50=new Map();for(const _0x5d4b23 of _0x53919c){_0x520e50[_0x3334ec(0x14e)](_0x5d4b23['id'],_0x5d4b23['name']);}if(_0x32418b){const _0x4b4ae3=globToRegex(_0x32418b);_0x27876b=_0x27876b[_0x3334ec(0x1cf)](_0xbbb015=>_0x4b4ae3['test'](_0xbbb015['journeyBundleName']));}console[_0x3334ec(0x148)]('β\x20Found\x20'+_0x27876b[_0x3334ec(0x11d)]+_0x3334ec(0x198)+(_0x27876b[_0x3334ec(0x11d)]!==0x1?'s':''));const _0x2adbd7=_0x113648=>{const _0x3ea5d2=_0x3334ec;return getConsoleNextUrl(_0x1c6d4d[_0x3ea5d2(0x1ba)],_0x3ea5d2(0x120)+_0x13e812+_0x3ea5d2(0x1aa)+_0x113648+'/j/da');};if(_0x1c6d4d[_0x3334ec(0xf8)]===_0x3334ec(0x190))await handleSDKOutput(_0x27876b,_0x1c6d4d);else{if(_0x1c6d4d['format']==='json'){const _0x544e2e=_0x27876b[_0x3334ec(0x100)](_0x156c74=>({..._0x156c74,'url':_0x2adbd7(_0x156c74['id'])}));await handleSDKOutput(_0x544e2e,_0x1c6d4d);}else{console['log']('['+_0x30b459+']');const _0x1c89f4=new Map(),_0x5cda71=[];for(const _0x15b5a3 of _0x27876b){if(!_0x15b5a3[_0x3334ec(0x1c9)]||_0x15b5a3['folderId']===_0x4aa56f)_0x5cda71[_0x3334ec(0x19a)](_0x15b5a3);else{const _0x3c88ee=_0x1c89f4['get'](_0x15b5a3['folderId'])||[];_0x3c88ee[_0x3334ec(0x19a)](_0x15b5a3),_0x1c89f4[_0x3334ec(0x14e)](_0x15b5a3[_0x3334ec(0x1c9)],_0x3c88ee);}}const _0x59c8be=(_0x4d7421,_0xe4049)=>_0x4d7421[_0x3334ec(0x1db)][_0x3334ec(0x1d6)](_0xe4049[_0x3334ec(0x1db)],undefined,{'sensitivity':_0x3334ec(0x122)});_0x5cda71[_0x3334ec(0x15c)](_0x59c8be);for(const _0x2c1118 of _0x5cda71){console[_0x3334ec(0x184)](formatJourneyItem(_0x2c1118,'',_0x2adbd7(_0x2c1118['id'])));}const _0x1f4435=[..._0x1c89f4['entries']()]['sort']((_0x10452c,_0x3d3876)=>{const _0xf6a893=_0x3334ec,_0x5d6796=_0x520e50['get'](_0x10452c[0x0])||_0x10452c[0x0],_0x3f38a8=_0x520e50[_0xf6a893(0xdb)](_0x3d3876[0x0])||_0x3d3876[0x0];return _0x5d6796[_0xf6a893(0x1d6)](_0x3f38a8,undefined,{'sensitivity':_0xf6a893(0x122)});});for(const [_0x3e1f63,_0x455813]of _0x1f4435){const _0x215234=_0x520e50[_0x3334ec(0xdb)](_0x3e1f63)||_0x3e1f63;console[_0x3334ec(0x184)]('π\x20'+_0x215234),_0x455813['sort'](_0x59c8be);for(const _0x50f256 of _0x455813){console[_0x3334ec(0x184)](formatJourneyItem(_0x50f256,'\x20\x20',_0x2adbd7(_0x50f256['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a27_0x4c3490(0x16e)]='Show\x20journey\x20details';async['execute'](_0x5a8c4){const _0x1e66e8=a27_0x4c3490,{options:_0x39182f,args:_0x43bdff,tdx:_0x26efec}=_0x5a8c4,_0x23f4cd=_0x43bdff[0x0];if(!_0x23f4cd)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x1e66e8(0x148)](_0x1e66e8(0xde)),console[_0x1e66e8(0x148)]('Options:'),console[_0x1e66e8(0x148)](_0x1e66e8(0x1c8)),0x1;_0x39182f[_0x1e66e8(0x142)]&&console[_0x1e66e8(0x148)]('Input:\x20'+_0x23f4cd);const {journeyId:_0x4ac50f,parentSegmentId:_0xda94f3}=await resolveJourneyIdFromInput(_0x23f4cd,_0x39182f,_0x26efec);if(_0x39182f['web']){const _0x262442=getConsoleNextUrl(_0x39182f[_0x1e66e8(0x1ba)],'/app/ps/'+_0xda94f3+'/e/'+_0x4ac50f+'/j/da/je');return console[_0x1e66e8(0x148)](a27_0x4757ba['green']('β')+_0x1e66e8(0x151)+a27_0x4757ba['cyan'](_0x262442)),openBrowser(_0x262442),0x0;}const _0x364e47=await withSpinner(_0x1e66e8(0x125),()=>_0x26efec[_0x1e66e8(0x11e)][_0x1e66e8(0x138)](_0x4ac50f),{'verbose':_0x39182f['verbose']}),_0x1dd74b=_0x364e47[_0x1e66e8(0x105)],_0x59b335=_0x39182f[_0x1e66e8(0x157)];let _0x1a6c8f;if(_0x59b335)try{const _0x5356f7=await withSpinner(_0x1e66e8(0x16c),()=>_0x26efec[_0x1e66e8(0x11e)][_0x1e66e8(0x158)](_0x4ac50f),{'verbose':_0x39182f['verbose']});_0x1a6c8f=_0x5356f7['data'];}catch{_0x39182f[_0x1e66e8(0x142)]&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0xe1c40a=getConsoleNextUrl(_0x39182f[_0x1e66e8(0x1ba)],'/app/ps/'+_0xda94f3+_0x1e66e8(0x1aa)+_0x4ac50f+'/j/da/je'),_0x80d678={'id':_0x1dd74b['id'],'name':_0x1dd74b[_0x1e66e8(0xd9)][_0x1e66e8(0x159)],'description':_0x1dd74b['attributes'][_0x1e66e8(0x16e)],'state':_0x1dd74b[_0x1e66e8(0xd9)]['state'],'paused':_0x1dd74b[_0x1e66e8(0xd9)][_0x1e66e8(0x19e)],'reentry_mode':_0x1dd74b[_0x1e66e8(0xd9)]['reentryMode'],'stages':_0x1dd74b[_0x1e66e8(0xd9)][_0x1e66e8(0x1d9)]?.[_0x1e66e8(0x11d)]||0x0,..._0x1dd74b[_0x1e66e8(0xd9)][_0x1e66e8(0xe7)]&&{'goal':_0x1dd74b[_0x1e66e8(0xd9)][_0x1e66e8(0xe7)][_0x1e66e8(0x159)]},..._0x1a6c8f&&{'statistics':{'size':_0x1a6c8f['size'],'entered':_0x1a6c8f[_0x1e66e8(0x10e)],'goal_achieved':_0x1a6c8f['goalSize'],'completion_rate':_0x1a6c8f[_0x1e66e8(0x131)],'exit_or_jump':_0x1a6c8f[_0x1e66e8(0x12a)],'exit_or_jump_rate':_0x1a6c8f['exitOrJumpRate'],'stages':_0x1a6c8f['stages']}},'url':_0xe1c40a};return await handleSingleObjectOutput(_0x80d678,_0x39182f),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x4c3490(0x1d3);['description']='Show\x20journey\x20statistics';async[a27_0x4c3490(0xeb)](_0x229594){const _0x5a0c51=a27_0x4c3490,{options:_0x5c42a8,args:_0x120d94,tdx:_0x11d4a1}=_0x229594,_0x4dd843=_0x120d94[0x0];if(!requireNameOrPath(_0x4dd843))return 0x1;_0x5c42a8[_0x5a0c51(0x142)]&&console[_0x5a0c51(0x148)](_0x5a0c51(0x1dd)+_0x4dd843);const _0x192152=_0x5c42a8,_0x1095d7=_0x192152[_0x5a0c51(0x16a)],_0x3f8889=_0x192152['to'],_0x20b187=_0x192152[_0x5a0c51(0x1c5)],_0x424a1c=_0x192152['stage'];_0x20b187&&!_0x1095d7&&!_0x3f8889&&console[_0x5a0c51(0x148)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x289d29=_0x20b187?withJsonFormat(_0x5c42a8):_0x5c42a8,{journeyId:_0x84aeca,journeyName:_0x40dfd2}=await resolveJourneyIdFromInput(_0x4dd843,_0x289d29,_0x11d4a1),_0x277161=_0x1095d7||_0x3f8889?{'from':_0x1095d7,'to':_0x3f8889}:undefined,_0x3f1810=await withSpinner(_0x5a0c51(0x16c),()=>Promise['all']([_0x11d4a1[_0x5a0c51(0x11e)][_0x5a0c51(0x138)](_0x84aeca),_0x11d4a1[_0x5a0c51(0x11e)][_0x5a0c51(0x158)](_0x84aeca,_0x277161)]),{'verbose':_0x289d29[_0x5a0c51(0x142)]}),[_0x3df330,_0x47e36f]=_0x3f1810[_0x5a0c51(0x105)];if(!_0x47e36f||_0x47e36f['journeyId']===null)return console[_0x5a0c51(0x148)](_0x5a0c51(0x133)+_0x40dfd2),console[_0x5a0c51(0x148)](_0x5a0c51(0x124)),0x0;const _0x3c84bc=buildStageNameMap(_0x3df330),_0x5c0c86=!!(_0x277161&&_0x47e36f['history']?.[_0x5a0c51(0x11d)]),_0x1d33ba={'stageNameMap':_0x3c84bc,'hasPeriod':_0x5c0c86,'includeHistory':!!_0x20b187};if(_0x424a1c&&_0x47e36f[_0x5a0c51(0x1dc)]){const _0x548271=_0x47e36f[_0x5a0c51(0x1dc)]['find'](_0x2f6370=>{const _0x2fb0d1=_0x5a0c51,_0x2e06f5=_0x3c84bc['get'](_0x2f6370['id'])??'';return _0x2e06f5[_0x2fb0d1(0x188)]()===_0x424a1c[_0x2fb0d1(0x188)]();});if(_0x548271)return await handleSingleObjectOutput(formatStageStats(_0x548271,_0x1d33ba),_0x289d29),0x0;const _0x2a26d9=_0x47e36f[_0x5a0c51(0x1dc)]['map'](_0x382e2f=>_0x3c84bc[_0x5a0c51(0xdb)](_0x382e2f['id'])??_0x382e2f['id']);return console['error'](_0x5a0c51(0x19c)+_0x424a1c+_0x5a0c51(0x1b9)),console[_0x5a0c51(0x148)](_0x5a0c51(0x13c)+_0x2a26d9['join'](',\x20')),0x1;}const _0x3fec26=_0x47e36f[_0x5a0c51(0x1dc)]?.[_0x5a0c51(0x100)](_0x850b04=>formatStageStats(_0x850b04,_0x1d33ba)),_0x1658cd=assembleJourneyStats(_0x47e36f,{'from':_0x1095d7,'to':_0x3f8889,'includeHistory':_0x20b187});return await this['renderStats'](_0x1658cd,_0x3fec26??[],_0x289d29),0x0;}async['renderStats'](_0x4bb454,_0x159d07,_0x461ec9){const _0x46eaad=a27_0x4c3490,_0xb02517=_0x461ec9[_0x46eaad(0xf8)]===_0x46eaad(0x144)||_0x461ec9['format']==='jsonl'||_0x461ec9[_0x46eaad(0x144)]||_0x461ec9['jsonl'];if(_0xb02517){_0x4bb454[_0x46eaad(0x1dc)]=_0x159d07,await handleSingleObjectOutput(_0x4bb454,_0x461ec9);return;}await handleSingleObjectOutput(_0x4bb454,_0x461ec9);for(const _0x202abb of _0x159d07){console[_0x46eaad(0x184)](''),console['log'](String(a27_0x4757ba['cyan']['bold']('['+_0x202abb[_0x46eaad(0x159)]+']'))+a27_0x4757ba[_0x46eaad(0x14d)]('\x20'+_0x202abb['id']));const {id:_0x1f3d45,name:_0x3843e8,..._0x1d8300}=_0x202abb;await handleSingleObjectOutput(_0x1d8300,_0x461ec9);}}}function a27_0x59f5(){const _0x4a5bd8=['Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20unchanged\x20files','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','folderId','links','\x20journey\x20files\x20to\x20','1971369XUzELU','createdAt','tdx.json','filter','journeyName','relative','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','journey:stats','hasChanges','limit','localeCompare','Pattern:\x20','1371372ZAUVCW','journeyStages','β\x20Context\x20set:\x20','journeyBundleName','stages','Input:\x20','(root)','rootFolderId','25HWHmnw','Fetching\x20users\x20and\x20connections...','Resuming\x20journey...','attributes','state','get','Aborted.','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Fetching\x20journeys\x20and\x20folders...','no_parent','\x20\x20Preserving\x20local\x20segment\x20name:\x20','5764234XCIkrx','journey:columns','242639fmWNhF','isNew','Listing\x20journey\x20activations...','goal','session','List\x20journeys\x20in\x20current\x20context','List\x20activations\x20for\x20a\x20journey','execute','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20(ID:\x20','Resume\x20a\x20paused\x20journey','Pause\x20a\x20running\x20journey','\x20->\x20','buildIdToNameMap','Pausing\x20journey...','activation','activation_','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journeyId','has','format','\x20=\x20','55vMQaWO','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','history','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','segmentPushCommand','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','map','.yml','resolveSegment','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20\x20-\x20','data','Fetching\x20parent\x20segment...','Journey\x20name:\x20','add','connection','journey:pull','Database:\x20','Getting\x20journey\x20traffic\x20data...','conversion','enteredSize','\x20(rule\x20match)','\x20(draft)\x20β\x20\x22','Error:\x20Parent\x20segment\x20context\x20required','draft','\x22\x20paused','List\x20all\x20versions\x20of\x20a\x20journey','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','24328YgtPeE','cwd','all','journey:versions','72BtTaPr','user','resolveJourneyId','length','journey','Show\x20journey\x20table\x20column\x20mapping','/app/ps/','...','base','replace','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Getting\x20journey\x20details...','parentSegment','Resolving\x20version...','Fetching\x20','version','exitOrJumpSize','folderPath','dryRun','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Error:\x20','yes','journey:version:view','completionRate','\x0aChanges\x20to\x20\x27','No\x20statistics\x20available\x20for\x20journey:\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','/j/da/je','\x5c$&','green','getJourney','find','connector_config','Target\x20file:\x20','Available\x20stages:\x20','getTrafficData','blue','\x20\x20Target:\x20','segmentName','8ferVSi','verbose','Warning:\x20Could\x20not\x20resolve\x20segment\x20','json','Listing\x20journeys...','Parent\x20segment:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','error','Resolved\x20YAML\x20file:\x20','Error:\x20--version\x20option\x20is\x20required','\x20details...','repeat','dim','set','completeMilestoneRate','\x20not\x20found.\x20Available:\x20','\x20Opening\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','32KwuCZn','listVersions','join','INVALID_ARGUMENT','includeStats','getStatistics','name','resourceName',',\x20version:\x20','sort','split','\x20changed\x20files','Warning:\x20Could\x20not\x20resolve\x20activation\x20','setPhase','(draft)','Cancelled','journey:version:create','options','πΊοΈ\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','nodes','buildIdToEmailMap','from','database','Getting\x20journey\x20statistics...','yellow','description','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','archived','segments','\x22\x20resumed','content','\x0aPull\x20summary:','relativePath','(completed)','helpText','then','\x20new\x20files','\x20\x20Parent\x20segment:\x20','(archived)','parent_segment','cyan','View\x20a\x20specific\x20version\x20of\x20a\x20journey','hasPeriod','β\x20Journey\x20\x22','Write\x20','β\x20All\x20files\x20are\x20up\x20to\x20date','Folder\x20path:\x20','log','type','segment','\x20\x20Name:\x20','toLowerCase','getColumnMapping','Resolving\x20parent\x20segment...','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','filePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Getting\x20version\x20','(paused)','table','targetDir','β\x20Pulled\x20','values','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','journeys','\x20\x20Folder\x20path:\x20','size','\x20journey','9955460szUxsT','push','No\x20journeys\x20found','Error:\x20Stage\x20\x22','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)','paused','folders','journey:activations','journeyBundleId','stringify','550752sjMFRB','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','launched','Error:\x20Journey\x20not\x20found:\x20','Listing\x20journey\x20versions...','Found\x20','\x27\x20not\x20found\x20in\x20','/e/','Error:\x20Invalid\x20version\x20number:\x20','journey:list','red','\x0aError:','message','absolutePath','listJourneysWithFolders','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','file','resolveParentId','utf-8','versionNumber','getParentFull','entries','\x22\x20not\x20found','site','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Export\x20journey(s)\x20as\x20YAML\x20files','exitOrJumpRate','pause','\x20activation','resume','rule','(running)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getSegment','includeHistory'];a27_0x59f5=function(){return _0x4a5bd8;};return a27_0x59f5();}export class JourneyTrafficCommand extends BaseCommand{['name']='journey:traffic';['description']=a27_0x4c3490(0xdd);async['execute'](_0x32ca64){const _0x4e6e02=a27_0x4c3490,{options:_0x49f5db,args:_0x2c2c4f,tdx:_0x5a84ba}=_0x32ca64,_0x14e1b7=_0x2c2c4f[0x0];if(!requireNameOrPath(_0x14e1b7))return 0x1;_0x49f5db['verbose']&&console[_0x4e6e02(0x148)](_0x4e6e02(0x1dd)+_0x14e1b7);const _0x5937a8=_0x49f5db,_0xc1efca=_0x5937a8[_0x4e6e02(0x185)],_0x4b53e4=_0x5937a8[_0x4e6e02(0x16a)],_0x31d2e6=_0x5937a8['to'],_0x437328=_0x5937a8[_0x4e6e02(0x1d5)];if(_0xc1efca&&_0xc1efca!=='conversion'&&_0xc1efca!==_0x4e6e02(0xf3))return console[_0x4e6e02(0x148)]('Error:\x20Invalid\x20--type\x20\x22'+_0xc1efca+_0x4e6e02(0x134)),0x1;const _0x9f9eff=withJsonFormat(_0x49f5db),{journeyId:_0x55e84c,journeyName:_0x33dd4e}=await resolveJourneyIdFromInput(_0x14e1b7,_0x9f9eff,_0x5a84ba),_0x3e96f1={'type':_0xc1efca,'from':_0x4b53e4,'to':_0x31d2e6,'limit':_0x437328},_0x2961e7=await withSpinner(_0x4e6e02(0x10c),()=>_0x5a84ba[_0x4e6e02(0x11e)][_0x4e6e02(0x13d)](_0x55e84c,_0x3e96f1),{'verbose':_0x9f9eff[_0x4e6e02(0x142)]}),_0x272211=_0x2961e7['data'],_0x512b9d=_0x272211[_0x4e6e02(0x10d)]&&(_0x272211[_0x4e6e02(0x10d)][_0x4e6e02(0x168)][_0x4e6e02(0x11d)]>0x0||_0x272211[_0x4e6e02(0x10d)][_0x4e6e02(0x1ca)][_0x4e6e02(0x11d)]>0x0),_0x3b8920=_0x272211[_0x4e6e02(0xf3)]&&_0x272211['activation'][_0x4e6e02(0x11d)]>0x0;if(!_0x512b9d&&!_0x3b8920)return console['error'](_0x4e6e02(0x166)+_0x33dd4e),console[_0x4e6e02(0x148)](_0x4e6e02(0x147)),_0x4b53e4&&_0x31d2e6&&console[_0x4e6e02(0x148)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x272211,_0x9f9eff),0x0;}}function formatStageStats(_0x1e44b4,_0x29cf0f){const _0x467e57=a27_0x4c3490,_0x2e320e=_0x29cf0f[_0x467e57(0x17f)]&&_0x1e44b4['history']?.[_0x467e57(0x11d)]?aggregateStageHistory(_0x1e44b4[_0x467e57(0xfc)]):{'size':_0x1e44b4[_0x467e57(0x197)],'entered':_0x1e44b4[_0x467e57(0x10e)],'milestone':_0x1e44b4['milestoneSize'],'milestone_rate':_0x1e44b4[_0x467e57(0x14f)],'exit_or_jump':_0x1e44b4[_0x467e57(0x12a)],'exit_or_jump_rate':_0x1e44b4[_0x467e57(0x1bd)]},_0x1124e9={'id':_0x1e44b4['id'],'name':_0x29cf0f['stageNameMap'][_0x467e57(0xdb)](_0x1e44b4['id'])??_0x1e44b4['id'],..._0x2e320e};return _0x29cf0f['hasPeriod']&&_0x29cf0f[_0x467e57(0x1c5)]&&_0x1e44b4[_0x467e57(0xfc)]&&(_0x1124e9['history']=_0x1e44b4[_0x467e57(0xfc)]),_0x1124e9;}export class JourneyPauseCommand extends BaseCommand{[a27_0x4c3490(0x159)]='journey:pause';[a27_0x4c3490(0x16e)]=a27_0x4c3490(0xef);async[a27_0x4c3490(0xeb)](_0x5a72ce){const _0x15130c=a27_0x4c3490,{options:_0x4099d9,args:_0x51af19,tdx:_0x3a689b}=_0x5a72ce,_0x54c971=_0x51af19[0x0];if(!requireNameOrPath(_0x54c971))return 0x1;_0x4099d9[_0x15130c(0x142)]&&console[_0x15130c(0x148)]('Input:\x20'+_0x54c971);const {journeyId:_0x5f55cc,journeyName:_0x511628}=await resolveJourneyIdFromInput(_0x54c971,_0x4099d9,_0x3a689b);if(!_0x4099d9[_0x15130c(0x12f)]){const _0x1f8640=await confirm(_0x15130c(0x194)+_0x511628+'\x22?');if(!_0x1f8640)return console[_0x15130c(0x148)]('Cancelled'),0x0;}const _0x41b1e3=await withSpinner(_0x15130c(0xf2),()=>_0x3a689b['journey'][_0x15130c(0x1be)](_0x5f55cc),{'verbose':_0x4099d9[_0x15130c(0x142)]}),_0x591962=_0x41b1e3[_0x15130c(0x105)];return console['error'](_0x15130c(0x180)+_0x591962[_0x15130c(0xd9)]['name']+_0x15130c(0x113)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x4c3490(0x159)]='journey:resume';[a27_0x4c3490(0x16e)]=a27_0x4c3490(0xee);async[a27_0x4c3490(0xeb)](_0x18311d){const _0x1e36db=a27_0x4c3490,{options:_0x3c503f,args:_0x45a859,tdx:_0x41cf76}=_0x18311d,_0x345d46=_0x45a859[0x0];if(!requireNameOrPath(_0x345d46))return 0x1;_0x3c503f[_0x1e36db(0x142)]&&console[_0x1e36db(0x148)](_0x1e36db(0x1dd)+_0x345d46);const {journeyId:_0x1fdbdd,journeyName:_0x26414f}=await resolveJourneyIdFromInput(_0x345d46,_0x3c503f,_0x41cf76);if(!_0x3c503f['yes']){const _0x1ecc17=await confirm(_0x1e36db(0x12d)+_0x26414f+'\x22?');if(!_0x1ecc17)return console[_0x1e36db(0x148)](_0x1e36db(0x162)),0x0;}const _0x264d0d=await withSpinner(_0x1e36db(0x1e2),()=>_0x41cf76[_0x1e36db(0x11e)][_0x1e36db(0x1c0)](_0x1fdbdd),{'verbose':_0x3c503f[_0x1e36db(0x142)]}),_0x289182=_0x264d0d[_0x1e36db(0x105)];return console[_0x1e36db(0x148)](_0x1e36db(0x180)+_0x289182['attributes'][_0x1e36db(0x159)]+_0x1e36db(0x172)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x4c3490(0x159)]=a27_0x4c3490(0x10a);[a27_0x4c3490(0x16e)]=a27_0x4c3490(0x1bc);async[a27_0x4c3490(0xeb)](_0x35c3c6){const _0x4d4239=a27_0x4c3490,{options:_0x245549,args:_0x17093f,tdx:_0xece696}=_0x35c3c6,_0x563384=_0x245549,_0x450f49=_0x17093f[0x0],_0x165a34=_0x450f49&&isYamlFilePath(_0x450f49),_0x301c0a=await resolveTarget({'arg':_0x165a34?_0x450f49:undefined,'contextParent':_0x245549['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x301c0a))return _0x301c0a['errorCode']===_0x4d4239(0xe0)?(console[_0x4d4239(0x148)](a27_0x4757ba[_0x4d4239(0x16d)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x4d4239(0x19d)),console[_0x4d4239(0x148)](_0x4d4239(0x18d)),console['error'](_0x4d4239(0xff)),console[_0x4d4239(0x148)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x4d4239(0x148)](a27_0x4757ba[_0x4d4239(0x1ad)](_0x4d4239(0x12e)+_0x301c0a[_0x4d4239(0x1af)]+'\x0a')),_0x301c0a[_0x4d4239(0x177)]&&console[_0x4d4239(0x148)](a27_0x4757ba['cyan'](_0x301c0a[_0x4d4239(0x177)]))),0x1;let _0x1c31f4=_0x165a34?undefined:_0x450f49,_0xe5c975,_0x37dc80;_0x301c0a['type']===_0x4d4239(0x1b3)&&(_0x1c31f4=_0x301c0a[_0x4d4239(0x15a)],_0xe5c975=_0x301c0a[_0x4d4239(0x18c)],_0x37dc80=_0x301c0a['folderPath']);const _0x562cea=_0x301c0a['parentName'],_0x18930c=_0x301c0a[_0x4d4239(0x191)];_0x563384[_0x4d4239(0x142)]&&(console[_0x4d4239(0x148)](_0x4d4239(0x146)+_0x562cea),console[_0x4d4239(0x148)]('Target\x20directory:\x20'+_0x18930c),_0x1c31f4&&console[_0x4d4239(0x148)](_0x4d4239(0x107)+_0x1c31f4),_0xe5c975&&console[_0x4d4239(0x148)](_0x4d4239(0x13b)+_0xe5c975),_0x37dc80&&console[_0x4d4239(0x148)](_0x4d4239(0x183)+_0x37dc80));const _0x3b419b=await withSpinner('Resolving\x20parent\x20segment...',()=>_0xece696['segment'][_0x4d4239(0x1b4)](_0x562cea),{'verbose':_0x245549[_0x4d4239(0x142)]}),_0x300b4d=_0x3b419b[_0x4d4239(0x105)],{journeys:_0x55b20f,folders:_0x61b875}=await withSpinner(_0x4d4239(0xdf),async()=>{const _0x13b553=_0x4d4239,[_0x450e34,_0x533eea]=await Promise[_0x13b553(0x118)]([_0xece696[_0x13b553(0x11e)]['listJourneysFromParentSegment'](_0x300b4d,undefined,{'includeAllVersions':!![]}),_0xece696[_0x13b553(0x186)]['listFolders'](_0x300b4d)]);return{'journeys':_0x450e34,'folders':_0x533eea};},{'verbose':_0x245549['verbose']})[_0x4d4239(0x178)](_0x384bbd=>_0x384bbd[_0x4d4239(0x105)]);let _0x38daf8=_0x55b20f;const _0x47ac16=buildFolderIdToPathMap(_0x61b875);if(_0x1c31f4){const _0x25afc2=_0x38daf8['filter'](_0x5ef43b=>_0x5ef43b[_0x4d4239(0x1db)][_0x4d4239(0x188)]()===_0x1c31f4[_0x4d4239(0x188)]());if(_0x25afc2[_0x4d4239(0x11d)]===0x0)return console['error'](_0x4d4239(0x1a6)+_0x1c31f4),console['error'](_0x4d4239(0xfd)),0x1;_0x38daf8=_0x25afc2;}if(_0x37dc80!==undefined){const _0xe684a5=_0x38daf8[_0x4d4239(0x1cf)](_0x4b922d=>{const _0x4f8223=_0x4d4239,_0x6cf38c=_0x4b922d[_0x4f8223(0x1c9)]?_0x47ac16['get'](_0x4b922d[_0x4f8223(0x1c9)])||'':'';return _0x6cf38c===_0x37dc80;});if(_0xe684a5[_0x4d4239(0x11d)]===0x0&&_0x38daf8['length']>0x0){console[_0x4d4239(0x148)]('Error:\x20Journey\x20\x27'+_0x1c31f4+_0x4d4239(0x1a9)+(_0x37dc80||'root\x20folder')),console[_0x4d4239(0x148)](_0x4d4239(0x1a4));for(const _0x121bbd of _0x38daf8){const _0x28b1b7=_0x121bbd['folderId']?_0x47ac16['get'](_0x121bbd[_0x4d4239(0x1c9)])||'':'';console[_0x4d4239(0x148)](_0x4d4239(0x104)+(_0x28b1b7||_0x4d4239(0x1de))+'/'+_0x121bbd[_0x4d4239(0x1db)]);}return 0x1;}_0x38daf8=_0xe684a5;}if(_0x38daf8['length']===0x0)return console[_0x4d4239(0x148)](_0x4d4239(0x19b)),0x0;const _0x200860=new Map();for(const _0x5e100d of _0x38daf8){const _0x33dc7e=_0x5e100d['journeyBundleId'];!_0x200860[_0x4d4239(0xf7)](_0x33dc7e)&&_0x200860[_0x4d4239(0x14e)](_0x33dc7e,[]),_0x200860[_0x4d4239(0xdb)](_0x33dc7e)['push'](_0x5e100d);}for(const _0x5a4a3b of _0x200860['values']()){_0x5a4a3b[_0x4d4239(0x15c)]((_0x39f798,_0x28c8fb)=>(_0x39f798[_0x4d4239(0x1b6)]||0x0)-(_0x28c8fb['versionNumber']||0x0));}const _0x2b215b=[],{idToEmailMap:_0x27d568,connectionIdToNameMap:_0x59d242}=await withSpinner(_0x4d4239(0x1e1),async()=>{const _0x377471=_0x4d4239,[_0x4a7bda,_0x5f09e0]=await Promise[_0x377471(0x118)]([_0xece696[_0x377471(0x11b)][_0x377471(0x169)](),_0xece696[_0x377471(0x109)][_0x377471(0xf1)]()]);return{'idToEmailMap':_0x4a7bda,'connectionIdToNameMap':_0x5f09e0};},{'verbose':_0x245549['verbose']})[_0x4d4239(0x178)](_0x33f57f=>_0x33f57f[_0x4d4239(0x105)]);for(const _0x2a70e3 of _0x200860[_0x4d4239(0x193)]()){const _0x508f53=_0x2a70e3[0x0]['journeyBundleName'],_0x3e01b9=_0x2a70e3[0x0]['folderId'],_0x5625a2=_0x3e01b9?_0x47ac16['get'](_0x3e01b9)||'':'',_0x33783a=_0x5625a2?a27_0x4e2fa5[_0x4d4239(0x155)](_0x18930c,_0x5625a2):_0x18930c,_0x33fcd9=_0xe5c975||a27_0x4e2fa5['join'](_0x33783a,sanitizeFileName(_0x508f53)+'.yml');let _0x1004e0,_0x3ed98c;if(existsSync(_0x33fcd9))try{const _0xb780bb=readFileSync(_0x33fcd9,_0x4d4239(0x1b5)),_0x49b074=parseYamlString(_0xb780bb);_0x3ed98c=_0x49b074,_0x1004e0=buildRuleToNameMapping(_0x49b074),_0x563384[_0x4d4239(0x142)]&&_0x1004e0['size']>0x0&&console['error'](_0x4d4239(0x1a8)+_0x1004e0[_0x4d4239(0x197)]+_0x4d4239(0xec)+_0x508f53);}catch(_0x4abf65){_0x563384[_0x4d4239(0x142)]&&console['error'](_0x4d4239(0x103)+_0x4abf65[_0x4d4239(0x1af)]);}const _0x234cca=[],_0x5dac4e=new Set(),_0x5a1eb8=new Map(),_0x54bd7c=new Map(),_0x4189a8=new Set(),_0x5cbca2=new Map(),_0x375c3b=new Map(),_0x3ad583=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x508f53+_0x4d4239(0x121),async _0x5994e2=>{const _0x5c0b5c=_0x4d4239;for(const _0x3ba4c4 of _0x2a70e3){const _0x427b4c=_0x2a70e3['length']>0x1?_0x3ba4c4['journeyBundleName']+'\x20v'+(_0x3ba4c4['versionNumber']||0x1):_0x3ba4c4[_0x5c0b5c(0x1db)];_0x5994e2[_0x5c0b5c(0x160)](_0x5c0b5c(0x128)+_0x427b4c);const _0x2c76d4=await _0xece696[_0x5c0b5c(0x11e)]['getJourney'](_0x3ba4c4['id']),_0xe61db2=_0x2c76d4['attributes']?.['audienceId'],_0x126e0d={'resolveSegment':async _0x95ecdb=>{const _0x27241a=_0x5c0b5c;if(!_0xe61db2)return{'name':_0x95ecdb,'isJourneyLocal':![]};const _0x1fa257=_0x5a1eb8[_0x27241a(0xdb)](_0x95ecdb);if(_0x1fa257)return _0x1fa257;try{const _0x1e3bed=await _0xece696[_0x27241a(0x186)][_0x27241a(0x1c4)](_0xe61db2,_0x95ecdb),_0x25c482=_0x1e3bed['kind']===SEGMENT_KIND_JOURNEY;let _0x3de902,_0x19f9df=_0x1e3bed[_0x27241a(0x159)];if(_0x25c482&&_0x1e3bed[_0x27241a(0x1c1)]){const _0x3f3d32=await segmentResponseToDef(_0x1e3bed,{'resolveSegmentName':async _0x3f7cd5=>{const _0x334f71=_0x27241a,_0x29bd68=_0x5a1eb8[_0x334f71(0xdb)](_0x3f7cd5);if(_0x29bd68)return _0x29bd68[_0x334f71(0x159)];const _0x514abe=await _0x126e0d[_0x334f71(0x102)](_0x3f7cd5);return _0x514abe[_0x334f71(0x159)];}}),_0x387c72=_0x3f3d32[_0x27241a(0x1c1)];_0x3de902={'description':_0x1e3bed[_0x27241a(0x16e)],'rule':_0x387c72};const _0x45f686=serializeRule(_0x387c72),_0x14597c=_0x54bd7c['get'](_0x45f686);if(_0x14597c)_0x19f9df=_0x14597c,_0x3de902=undefined,_0x563384['verbose']&&console[_0x27241a(0x148)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x1e3bed['name']+_0x27241a(0xf0)+_0x14597c);else{let _0x2ed5ec=![];if(_0x1004e0){const _0x39abf3=_0x1004e0['get'](_0x45f686);if(_0x39abf3){const _0x58fe1e=_0x39abf3[_0x27241a(0x139)](_0x1b52ba=>!_0x5dac4e[_0x27241a(0xf7)](_0x1b52ba));_0x58fe1e&&(_0x19f9df=_0x58fe1e,_0x5dac4e[_0x27241a(0x108)](_0x58fe1e),_0x54bd7c[_0x27241a(0x14e)](_0x45f686,_0x58fe1e),_0x2ed5ec=!![],_0x563384[_0x27241a(0x142)]&&console[_0x27241a(0x148)](_0x27241a(0xe1)+_0x58fe1e+_0x27241a(0x10f)));}}if(!_0x2ed5ec){const _0x321f=generateJourneyLocalName(_0x1e3bed[_0x27241a(0x159)]);_0x321f&&(_0x19f9df=_0x321f);let _0x365d65=_0x19f9df,_0x15e218=0x2;while(_0x5dac4e[_0x27241a(0xf7)](_0x365d65)){_0x365d65=_0x19f9df+'_'+_0x15e218,_0x15e218++;}_0x5dac4e[_0x27241a(0x108)](_0x365d65),_0x54bd7c[_0x27241a(0x14e)](_0x45f686,_0x365d65),_0x19f9df=_0x365d65;}}}const _0x4f6555={'name':_0x19f9df,'isJourneyLocal':_0x25c482,'definition':_0x3de902};return _0x5a1eb8['set'](_0x95ecdb,_0x4f6555),_0x4f6555;}catch(_0x3ae4ad){return _0x245549[_0x27241a(0x142)]&&console[_0x27241a(0x148)](_0x27241a(0x143)+_0x95ecdb+':\x20'+_0x3ae4ad['message']),{'name':_0x95ecdb,'isJourneyLocal':![]};}},'resolveActivation':async _0x2af88d=>{const _0x320d35=_0x5c0b5c,_0x52d6a5=_0x5cbca2[_0x320d35(0xdb)](_0x2af88d);if(_0x52d6a5)return _0x52d6a5;try{const _0x4466d5=await _0xece696['journey']['getActivation'](_0x3ba4c4['id'],_0x2af88d),_0x46ccfc=journeyActivationStepToYaml(_0x4466d5,_0x27d568,_0x59d242),_0xedb64c=JSON[_0x320d35(0x1a2)]({'name':_0x46ccfc[_0x320d35(0x159)],'connection':_0x46ccfc[_0x320d35(0x109)],'connector_config':_0x46ccfc[_0x320d35(0x13a)]}),_0x3180b0=_0x375c3b[_0x320d35(0xdb)](_0xedb64c);if(_0x3180b0){const _0x1c3225={'name':_0x3180b0,'isJourneyLocal':!![],'definition':_0x46ccfc};return _0x5cbca2[_0x320d35(0x14e)](_0x2af88d,_0x1c3225),_0x1c3225;}const _0x4ca8e9=_0x4466d5[_0x320d35(0xd9)]['activationParams'][_0x320d35(0x159)]||_0x2af88d,_0x167092=sanitizeYamlKey(_0x4ca8e9)||_0x320d35(0xf4)+_0x2af88d;let _0x3f5bc7=_0x167092,_0x1b95e8=0x2;while(_0x4189a8['has'](_0x3f5bc7)){_0x3f5bc7=_0x167092+'_'+_0x1b95e8,_0x1b95e8++;}_0x4189a8[_0x320d35(0x108)](_0x3f5bc7),_0x375c3b['set'](_0xedb64c,_0x3f5bc7);const _0x405ac5={'name':_0x3f5bc7,'isJourneyLocal':!![],'definition':_0x46ccfc};return _0x5cbca2[_0x320d35(0x14e)](_0x2af88d,_0x405ac5),_0x405ac5;}catch(_0x2b4370){return _0x245549[_0x320d35(0x142)]&&console['error'](_0x320d35(0x15f)+_0x2af88d+':\x20'+_0x2b4370[_0x320d35(0x1af)]),{'name':_0x2af88d,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x3e6008,_0x10576b)=>{const _0x5aeb10=_0x5c0b5c;return resolveJumpTarget(_0x3e6008,_0x10576b,_0x3ad583,_0x3d2c88=>_0xece696[_0x5aeb10(0x11e)][_0x5aeb10(0x138)](_0x3d2c88));}},_0x3676dd=await journeyResponseToDef(_0x2c76d4,_0x126e0d);_0x234cca[_0x5c0b5c(0x19a)]({'item':_0x3ba4c4,'yaml':_0x3676dd});}},{'verbose':_0x245549[_0x4d4239(0x142)]});const _0x25220d=await _0xece696[_0x4d4239(0x11e)]['getLatestJourneyId'](_0x2a70e3[0x0][_0x4d4239(0x1a1)]),_0x3287b7=buildMergedJourneyDef(_0x234cca,_0x1004e0,_0x25220d),_0x530c1f=normalizeJourneyDef(_0x3287b7,_0x3ed98c),_0x14a8a5=toYamlString(_0x530c1f),_0x348ccf=_0xe5c975||a27_0x4e2fa5[_0x4d4239(0x155)](_0x33783a,sanitizeFileName(_0x508f53)+_0x4d4239(0x101));!_0xe5c975&&_0x5625a2&&!existsSync(_0x33783a)&&mkdirSync(_0x33783a,{'recursive':!![]});const _0x1be331=a27_0x4e2fa5[_0x4d4239(0x1d1)](process['cwd'](),_0x348ccf);if(existsSync(_0x348ccf)){const _0x1c9848=readFileSync(_0x348ccf,'utf-8'),_0x931bb2=generateDiff(_0x1c9848,_0x14a8a5),_0x3000cc=hasChanges(_0x931bb2);_0x2b215b['push']({'relativePath':_0x1be331,'absolutePath':_0x348ccf,'content':_0x14a8a5,'isNew':![],'hasChanges':_0x3000cc,'diff':_0x3000cc?formatDiffWithColors(_0x931bb2):undefined});}else _0x2b215b[_0x4d4239(0x19a)]({'relativePath':_0x1be331,'absolutePath':_0x348ccf,'content':_0x14a8a5,'isNew':!![],'hasChanges':![]});}const _0x567ccc=_0x2b215b['filter'](_0x4b1945=>_0x4b1945[_0x4d4239(0xe5)]),_0x17368f=_0x2b215b[_0x4d4239(0x1cf)](_0x480c7c=>!_0x480c7c['isNew']&&_0x480c7c['hasChanges']),_0x8f68b=_0x2b215b[_0x4d4239(0x1cf)](_0x49c8ac=>!_0x49c8ac[_0x4d4239(0xe5)]&&!_0x49c8ac['hasChanges']),_0x4eb3d3=_0x38daf8[_0x4d4239(0x11d)],_0x31d5c2=_0x200860['size'],_0x49aea0=_0x4eb3d3>_0x31d5c2?'\x20('+_0x4eb3d3+'\x20versions)':'';console[_0x4d4239(0x148)](_0x4d4239(0x174)),console[_0x4d4239(0x148)]('\x20\x20'+a27_0x4757ba[_0x4d4239(0x17d)](_0x31d5c2+'\x20journeys')+a27_0x4757ba[_0x4d4239(0x14d)](_0x49aea0)),console[_0x4d4239(0x148)]('\x20\x20'+a27_0x4757ba[_0x4d4239(0x137)]('+\x20'+_0x567ccc[_0x4d4239(0x11d)]+_0x4d4239(0x179))),console[_0x4d4239(0x148)]('\x20\x20'+a27_0x4757ba[_0x4d4239(0x16d)]('~\x20'+_0x17368f['length']+_0x4d4239(0x15e))),console['error']('\x20\x20'+a27_0x4757ba['dim']('=\x20'+_0x8f68b[_0x4d4239(0x11d)]+_0x4d4239(0x1c7))),console[_0x4d4239(0x148)](_0x4d4239(0x13f)+a27_0x4757ba[_0x4d4239(0x17d)](_0x18930c)+'\x0a');if(_0x17368f[_0x4d4239(0x11d)]>0x0)for(const _0x2b6c82 of _0x17368f){console['error'](_0x4d4239(0x132)+_0x2b6c82[_0x4d4239(0x175)]+'\x27:'),console[_0x4d4239(0x148)]('β'[_0x4d4239(0x14c)](0x3c)),console['error'](_0x2b6c82['diff']),console[_0x4d4239(0x148)]('β'[_0x4d4239(0x14c)](0x3c));}if(_0x563384[_0x4d4239(0x12c)])return console[_0x4d4239(0x148)](a27_0x4757ba['yellow'](_0x4d4239(0xf5))),0x0;if(_0x567ccc[_0x4d4239(0x11d)]===0x0&&_0x17368f[_0x4d4239(0x11d)]===0x0)return console[_0x4d4239(0x148)](a27_0x4757ba['green'](_0x4d4239(0x182))),saveSessionContext({'parent_segment':_0x562cea},_0x563384[_0x4d4239(0xe8)]),console['error'](a27_0x4757ba['green'](_0x4d4239(0x1da)+a27_0x4757ba[_0x4d4239(0x14d)](_0x4d4239(0x17c))+'\x20=\x20'+a27_0x4757ba[_0x4d4239(0x17d)](_0x562cea))),0x0;if(!_0x563384[_0x4d4239(0x12f)]&&(_0x567ccc[_0x4d4239(0x11d)]>0x0||_0x17368f['length']>0x0)){if(!isInteractive())return console['error'](a27_0x4757ba[_0x4d4239(0x1ad)](_0x4d4239(0x1ae)),_0x4d4239(0x167)),console['error'](a27_0x4757ba['dim'](_0x4d4239(0x1c3))),0x1;const _0x4ee2bf=await confirmKey(_0x4d4239(0x181)+(_0x567ccc[_0x4d4239(0x11d)]+_0x17368f[_0x4d4239(0x11d)])+'\x20files?');if(!_0x4ee2bf)return console[_0x4d4239(0x148)](a27_0x4757ba[_0x4d4239(0x16d)](_0x4d4239(0xdc)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x18930c)&&mkdirSync(_0x18930c,{'recursive':!![]});const _0x2dc0af=a27_0x4e2fa5[_0x4d4239(0x155)](_0x18930c,_0x4d4239(0x1ce));writeFileSync(_0x2dc0af,createTdxConfigContent(_0x562cea),'utf-8');for(const _0x388ab3 of _0x2b215b){(_0x388ab3['isNew']||_0x388ab3[_0x4d4239(0x1d4)])&&writeFileSync(_0x388ab3[_0x4d4239(0x1b0)],_0x388ab3[_0x4d4239(0x173)],'utf-8');}return console[_0x4d4239(0x148)](a27_0x4757ba[_0x4d4239(0x137)](_0x4d4239(0x192)+(_0x567ccc['length']+_0x17368f[_0x4d4239(0x11d)])+_0x4d4239(0x1cb)+_0x18930c)),saveSessionContext({'parent_segment':_0x562cea},_0x563384[_0x4d4239(0xe8)]),console[_0x4d4239(0x148)](a27_0x4757ba[_0x4d4239(0x137)](_0x4d4239(0x1da)+a27_0x4757ba['dim'](_0x4d4239(0x17c))+_0x4d4239(0xf9)+a27_0x4757ba['cyan'](_0x562cea))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x4c3490(0x159)]=a27_0x4c3490(0xe3);[a27_0x4c3490(0x16e)]=a27_0x4c3490(0x11f);async[a27_0x4c3490(0xeb)](_0x261f0a){const _0x33b26=a27_0x4c3490,{options:_0x4e5fad,args:_0x46960a,tdx:_0x540468}=_0x261f0a,_0x5aacf7=_0x46960a[0x0];if(!requireNameOrPath(_0x5aacf7))return 0x1;_0x4e5fad['verbose']&&console[_0x33b26(0x148)](_0x33b26(0x1dd)+_0x5aacf7);const {journeyId:_0x13a4e7}=await resolveJourneyIdFromInput(_0x5aacf7,_0x4e5fad,_0x540468),_0xf7ba3d=await withSpinner('Getting\x20column\x20mapping...',()=>_0x540468[_0x33b26(0x11e)][_0x33b26(0x189)](_0x13a4e7),{'verbose':_0x4e5fad[_0x33b26(0x142)]}),_0x11f46f=_0xf7ba3d['data'];return console[_0x33b26(0x184)](_0x33b26(0x10b)+_0x11f46f[_0x33b26(0x16b)]),console[_0x33b26(0x184)]('Table:\x20'+_0x11f46f[_0x33b26(0x190)]),await handleSDKOutput(_0x11f46f['columns'],_0x4e5fad),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x4c3490(0x159)]=a27_0x4c3490(0x1a0);[a27_0x4c3490(0x16e)]=a27_0x4c3490(0xea);async[a27_0x4c3490(0xeb)](_0x19fddf){const _0x575c24=a27_0x4c3490,{options:_0x4d6ecb,args:_0x5568b2,tdx:_0x46889f}=_0x19fddf,_0xd995f8=_0x5568b2[0x0];if(!requireNameOrPath(_0xd995f8))return 0x1;_0x4d6ecb[_0x575c24(0x142)]&&console['error']('Input:\x20'+_0xd995f8);const {journeyId:_0x257991}=await resolveJourneyIdFromInput(_0xd995f8,_0x4d6ecb,_0x46889f),_0x9a7456=await withSpinner(_0x575c24(0xe6),()=>_0x46889f['journey']['listActivationsFlat'](_0x257991),{'verbose':_0x4d6ecb[_0x575c24(0x142)]}),_0x3eb0e0=_0x9a7456[_0x575c24(0x105)];return console['error']('Found\x20'+_0x3eb0e0[_0x575c24(0x11d)]+_0x575c24(0x1bf)+(_0x3eb0e0['length']!==0x1?'s':'')),await handleSDKOutput(_0x3eb0e0,_0x4d6ecb),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x4c3490(0x159)]='journey:push';[a27_0x4c3490(0x16e)]=a27_0x4c3490(0x18b);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x4c3490(0xeb)](_0xc42c4a){const _0x203eeb=a27_0x4c3490,_0x4ce8b2=_0xc42c4a['args'][0x0];let _0x2913ed;if(_0x4ce8b2){const _0x4bc678=await resolveTarget({'arg':_0x4ce8b2,'contextParent':_0xc42c4a[_0x203eeb(0x164)][_0x203eeb(0x126)],'cwd':process[_0x203eeb(0x117)]()});isSuccessfulResolution(_0x4bc678)&&_0x4bc678[_0x203eeb(0x185)]==='file'&&(_0x2913ed=_0x4bc678[_0x203eeb(0x18c)]);}const _0x5ba4d5={..._0xc42c4a,'options':{..._0xc42c4a[_0x203eeb(0x164)],'journeysOnly':!![],..._0x2913ed&&{'singleFilePath':_0x2913ed}}};return this[_0x203eeb(0xfe)][_0x203eeb(0xeb)](_0x5ba4d5);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x4c3490(0x159)]=a27_0x4c3490(0x119);[a27_0x4c3490(0x16e)]=a27_0x4c3490(0x114);async[a27_0x4c3490(0xeb)](_0x18d4b2){const _0x17e4aa=a27_0x4c3490,{options:_0x449945,args:_0x3f59b4,tdx:_0x3043c1}=_0x18d4b2,_0x55ab8c=_0x3f59b4[0x0];if(!requireNameOrPath(_0x55ab8c))return 0x1;if(_0x449945[_0x17e4aa(0x142)])console['error'](_0x17e4aa(0x1dd)+_0x55ab8c);const {journeyId:_0x60ad09}=await resolveJourneyIdFromInput(_0x55ab8c,_0x449945,_0x3043c1),_0x314fcc=await withSpinner(_0x17e4aa(0x1a7),()=>_0x3043c1[_0x17e4aa(0x11e)][_0x17e4aa(0x154)](_0x60ad09),{'verbose':_0x449945[_0x17e4aa(0x142)]}),{bundleName:_0x18a3d2,versions:_0x3ea3a4,latestJourneyId:_0x3764ea}=_0x314fcc[_0x17e4aa(0x105)];console[_0x17e4aa(0x148)](_0x18a3d2+':\x20'+_0x3ea3a4[_0x17e4aa(0x11d)]+'\x20version'+(_0x3ea3a4[_0x17e4aa(0x11d)]!==0x1?'s':''));const _0x41cf4b=_0x3ea3a4['map'](_0xd8c800=>({'version':_0xd8c800[_0x17e4aa(0x1b6)],'journey_id':_0xd8c800[_0x17e4aa(0xf6)],'name':_0xd8c800[_0x17e4aa(0x159)],'state':_0xd8c800[_0x17e4aa(0xda)],'paused':_0xd8c800[_0x17e4aa(0x19e)],'latest':_0xd8c800[_0x17e4aa(0xf6)]===_0x3764ea,'created_at':_0xd8c800[_0x17e4aa(0x1cd)]}));return await handleSDKOutput(_0x41cf4b,_0x449945),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0x4c3490(0x163);['description']=a27_0x4c3490(0x115);async['execute'](_0x5c4507){const _0x123cc3=a27_0x4c3490,{options:_0xe1dd0,args:_0x485821,tdx:_0xed5531}=_0x5c4507,_0x3a761e=_0x485821[0x0];if(!requireNameOrPath(_0x3a761e))return 0x1;if(_0xe1dd0[_0x123cc3(0x142)])console[_0x123cc3(0x148)]('Input:\x20'+_0x3a761e);const {journeyId:_0x798e37,journeyName:_0x53c1b1}=await resolveJourneyIdFromInput(_0x3a761e,_0xe1dd0,_0xed5531);if(!_0xe1dd0[_0x123cc3(0x12f)]){const _0x5ad31a=await confirm(_0x123cc3(0x1b2)+_0x53c1b1+'\x22?');if(!_0x5ad31a)return console['error'](_0x123cc3(0x162)),0x0;}const _0x4061b5=await withSpinner('Creating\x20new\x20version...',()=>_0xed5531[_0x123cc3(0x11e)]['createVersion'](_0x798e37),{'verbose':_0xe1dd0['verbose']}),_0x46d3db=_0x4061b5[_0x123cc3(0x105)];return console[_0x123cc3(0x148)](a27_0x4757ba[_0x123cc3(0x137)]('β')+'\x20Created\x20v'+_0x46d3db[_0x123cc3(0xd9)][_0x123cc3(0x1b6)]+_0x123cc3(0x110)+_0x46d3db[_0x123cc3(0xd9)]['name']+'\x22'),console['error']('\x20\x20Journey\x20ID:\x20'+_0x46d3db['id']),await handleSingleObjectOutput({'id':_0x46d3db['id'],'name':_0x46d3db[_0x123cc3(0xd9)][_0x123cc3(0x159)],'version':_0x46d3db[_0x123cc3(0xd9)][_0x123cc3(0x1b6)],'state':_0x46d3db[_0x123cc3(0xd9)][_0x123cc3(0xda)],'bundle_id':_0x46d3db['attributes']['journeyBundleId'],'created_at':_0x46d3db[_0x123cc3(0xd9)][_0x123cc3(0x1cd)]},_0xe1dd0),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a27_0x4c3490(0x130);[a27_0x4c3490(0x16e)]=a27_0x4c3490(0x17e);async[a27_0x4c3490(0xeb)](_0x54b9a5){const _0x574e9f=a27_0x4c3490,{options:_0x42739d,args:_0x9602fa,tdx:_0x4448af}=_0x54b9a5,_0x17e5d8=_0x9602fa[0x0];if(!requireNameOrPath(_0x17e5d8))return 0x1;const _0x33ed26=_0x42739d[_0x574e9f(0x129)];if(!_0x33ed26)return console['error'](_0x574e9f(0x14a)),console[_0x574e9f(0x148)](_0x574e9f(0x1c6)),0x1;const _0x4e3a19=parseInt(_0x33ed26,0xa);if(isNaN(_0x4e3a19)||_0x4e3a19<0x1)return console[_0x574e9f(0x148)](_0x574e9f(0x1ab)+_0x33ed26),0x1;if(_0x42739d[_0x574e9f(0x142)])console[_0x574e9f(0x148)](_0x574e9f(0x1dd)+_0x17e5d8+_0x574e9f(0x15b)+_0x4e3a19);const {journeyId:_0x18a2bf,parentSegmentId:_0x3d8a62}=await resolveJourneyIdFromInput(_0x17e5d8,_0x42739d,_0x4448af),_0x59612b=await withSpinner(_0x574e9f(0x127),()=>_0x4448af[_0x574e9f(0x11e)]['listVersions'](_0x18a2bf),{'verbose':_0x42739d[_0x574e9f(0x142)]}),{versions:_0x3a9590,latestJourneyId:_0x2d30d2}=_0x59612b['data'],_0x15ae26=_0x3a9590[_0x574e9f(0x139)](_0x3562a5=>_0x3562a5[_0x574e9f(0x1b6)]===_0x4e3a19);if(!_0x15ae26){const _0x3ed141=_0x3a9590[_0x574e9f(0x100)](_0x1380d2=>'v'+_0x1380d2['versionNumber'])['join'](',\x20');return console[_0x574e9f(0x148)]('Error:\x20Version\x20'+_0x4e3a19+_0x574e9f(0x150)+_0x3ed141),0x1;}const _0x43b4d2=await withSpinner(_0x574e9f(0x18e)+_0x4e3a19+_0x574e9f(0x14b),()=>_0x4448af[_0x574e9f(0x11e)]['getJourney'](_0x15ae26['journeyId']),{'verbose':_0x42739d[_0x574e9f(0x142)]}),_0x12daea=_0x43b4d2[_0x574e9f(0x105)],_0x2e9d51=getConsoleNextUrl(_0x42739d[_0x574e9f(0x1ba)],_0x574e9f(0x120)+_0x3d8a62+_0x574e9f(0x1aa)+_0x15ae26['journeyId']+_0x574e9f(0x135));return await handleSingleObjectOutput({'id':_0x12daea['id'],'name':_0x12daea[_0x574e9f(0xd9)][_0x574e9f(0x159)],'version':_0x12daea[_0x574e9f(0xd9)][_0x574e9f(0x1b6)],'description':_0x12daea[_0x574e9f(0xd9)]['description'],'state':_0x12daea[_0x574e9f(0xd9)][_0x574e9f(0xda)],'paused':_0x12daea[_0x574e9f(0xd9)][_0x574e9f(0x19e)],'reentry_mode':_0x12daea[_0x574e9f(0xd9)]['reentryMode'],'stages':_0x12daea[_0x574e9f(0xd9)][_0x574e9f(0x1d9)]?.[_0x574e9f(0x11d)]||0x0,..._0x12daea[_0x574e9f(0xd9)][_0x574e9f(0xe7)]&&{'goal':_0x12daea['attributes']['goal'][_0x574e9f(0x159)]},'latest':_0x15ae26[_0x574e9f(0xf6)]===_0x2d30d2,'created_at':_0x12daea[_0x574e9f(0xd9)][_0x574e9f(0x1cd)],'updated_at':_0x12daea['attributes']['updatedAt'],'url':_0x2e9d51},_0x42739d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a28_0x5dcb73=a28_0x3f0e;function a28_0x3f0e(_0x3e52e0,_0x4975cf){_0x3e52e0=_0x3e52e0-0x7b;const _0x22c82c=a28_0x22c8();let _0x3f0ee3=_0x22c82c[_0x3e52e0];return _0x3f0ee3;}(function(_0x37b870,_0x5b96f0){const _0x237d63=a28_0x3f0e,_0x141187=_0x37b870();while(!![]){try{const _0x5b4ef2=parseInt(_0x237d63(0x91))/0x1*(parseInt(_0x237d63(0x87))/0x2)+parseInt(_0x237d63(0xb2))/0x3*(parseInt(_0x237d63(0x9c))/0x4)+-parseInt(_0x237d63(0xaa))/0x5*(-parseInt(_0x237d63(0x82))/0x6)+-parseInt(_0x237d63(0x94))/0x7*(parseInt(_0x237d63(0x96))/0x8)+parseInt(_0x237d63(0x81))/0x9*(-parseInt(_0x237d63(0x95))/0xa)+parseInt(_0x237d63(0x7f))/0xb+-parseInt(_0x237d63(0xae))/0xc*(-parseInt(_0x237d63(0x8d))/0xd);if(_0x5b4ef2===_0x5b96f0)break;else _0x141187['push'](_0x141187['shift']());}catch(_0x30044b){_0x141187['push'](_0x141187['shift']());}}}(a28_0x22c8,0xbda45));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x22c8(){const _0x29c063=['skippedCount','\x20journey(s)\x20with\x20errors,\x20','message','invalidCount','Error:\x20Directory\x20not\x20found:\x20','\x20journey(s)\x20valid','55HTKBiI','\x20error(s)','warningCount','description','1553868PtFpoq','\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','hasErrors','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','168582ZvzQPW','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','helpText','\x20segment\x20file(s)\x20skipped)','error','cyan','verbose','green','564520zHdaWH','valid','9GjpOYW','665394ccmpqK','.yaml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20(skipped:\x20','log','11392ZqdUFh','\x20warning(s)','endsWith','warnings','relativePath','β\x20All\x20','13iPVHJc','red','\x20segment\x20file(s)\x20skipped','reason','2qkZDrP','cwd','yellow','7oJBIPx','9189220HLSIJf','8070856oAirYP','errors','targetDir','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dim','validCount','92zyfuAm','\x20warning(s)\x20found','name','length','\x20valid','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','no_parent','parentSegment'];a28_0x22c8=function(){return _0x29c063;};return a28_0x22c8();}import{existsSync}from'fs';import a28_0x5c228c from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x5dcb73(0x9e)]='journey:validate';[a28_0x5dcb73(0xad)]='Validate\x20journey\x20YAML\x20files';async['execute'](_0x223b7f){const _0x23b6ad=a28_0x5dcb73,{options:_0x5c428f,args:_0x490062}=_0x223b7f,_0x1c50c5=_0x5c428f,_0x320153=await resolveTarget({'arg':_0x490062[0x0],'contextParent':_0x5c428f[_0x23b6ad(0xa3)],'cwd':process[_0x23b6ad(0x92)]()});if(!isSuccessfulResolution(_0x320153))return _0x320153['errorCode']===_0x23b6ad(0xa2)?(console[_0x23b6ad(0x7b)](a28_0x5c228c['yellow'](_0x23b6ad(0xa1))),console[_0x23b6ad(0x7b)](_0x23b6ad(0xb3)),console[_0x23b6ad(0x7b)](_0x23b6ad(0xaf)),console[_0x23b6ad(0x7b)](_0x23b6ad(0xb1))):(console[_0x23b6ad(0x7b)](a28_0x5c228c[_0x23b6ad(0x8e)]('Error:\x20'+_0x320153[_0x23b6ad(0xa6)]+'\x0a')),_0x320153[_0x23b6ad(0xb4)]&&console[_0x23b6ad(0x7b)](a28_0x5c228c[_0x23b6ad(0x7c)](_0x320153[_0x23b6ad(0xb4)]))),0x1;const _0x23879c=_0x320153[_0x23b6ad(0x98)],_0x317d5d=_0x320153['type']==='file'?_0x320153['filePath']:undefined;if(!_0x317d5d&&!existsSync(_0x23879c))return console['error'](a28_0x5c228c['red'](_0x23b6ad(0xa8)+_0x23879c+'\x0a')),0x1;let _0x5f4fcd;if(_0x317d5d){if(!_0x317d5d['endsWith']('.yml')&&!_0x317d5d[_0x23b6ad(0x89)](_0x23b6ad(0x83)))return console[_0x23b6ad(0x7b)](a28_0x5c228c[_0x23b6ad(0x8e)](_0x23b6ad(0x99)+_0x317d5d+'\x0a')),0x1;_0x5f4fcd=[_0x317d5d];}else _0x5f4fcd=findYamlFiles(_0x23879c);if(_0x5f4fcd[_0x23b6ad(0x9f)]===0x0)return console['error'](a28_0x5c228c[_0x23b6ad(0x8e)](_0x23b6ad(0x84)+_0x23879c+'\x0a')),0x1;const _0x1deb39=validateYamlFiles(_0x5f4fcd,_0x23879c,{'filterType':'journey'}),_0x578907=calculateSummary(_0x1deb39),_0xd93498=_0x1deb39['filter'](isValidationResult);if(_0xd93498[_0x23b6ad(0x9f)]===0x0)return console[_0x23b6ad(0x7b)](a28_0x5c228c['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x23879c+'\x0a')),_0x578907['skippedCount']>0x0&&console[_0x23b6ad(0x7b)](a28_0x5c228c['dim']('('+_0x578907[_0x23b6ad(0xa4)]+_0x23b6ad(0xb5))),0x0;for(const _0x1a286d of _0x1deb39){if(!isValidationResult(_0x1a286d)){_0x1c50c5[_0x23b6ad(0x7d)]&&console['log'](a28_0x5c228c[_0x23b6ad(0x9a)]('-\x20'+_0x1a286d[_0x23b6ad(0x8b)]+_0x23b6ad(0x85)+_0x1a286d[_0x23b6ad(0x90)]+')'));continue;}const {relativePath:_0x1e0f0e,source:_0x3ef783,result:_0x4732ad}=_0x1a286d;if(_0x4732ad[_0x23b6ad(0x80)]&&_0x4732ad[_0x23b6ad(0x8a)][_0x23b6ad(0x9f)]===0x0)_0x1c50c5[_0x23b6ad(0x7d)]&&console[_0x23b6ad(0x86)](a28_0x5c228c[_0x23b6ad(0x7e)]('β\x20'+_0x1e0f0e));else _0x4732ad[_0x23b6ad(0x80)]?(console[_0x23b6ad(0x86)](a28_0x5c228c[_0x23b6ad(0x93)]('β \x20'+_0x1e0f0e+':\x20'+_0x4732ad[_0x23b6ad(0x8a)][_0x23b6ad(0x9f)]+_0x23b6ad(0x88))),console[_0x23b6ad(0x86)](formatValidationResult(_0x4732ad,_0x3ef783,_0x1e0f0e))):(console['log'](a28_0x5c228c[_0x23b6ad(0x8e)]('β\x20'+_0x1e0f0e+':\x20'+_0x4732ad[_0x23b6ad(0x97)][_0x23b6ad(0x9f)]+_0x23b6ad(0xab))),console['log'](formatValidationResult(_0x4732ad,_0x3ef783,_0x1e0f0e)));}return console[_0x23b6ad(0x86)](''),_0x578907[_0x23b6ad(0xb0)]?(console[_0x23b6ad(0x86)](a28_0x5c228c['red']('Validation\x20failed:\x20'+_0x578907[_0x23b6ad(0xa7)]+_0x23b6ad(0xa5)+_0x578907[_0x23b6ad(0x9b)]+_0x23b6ad(0xa0))),_0x578907['warningCount']>0x0&&console[_0x23b6ad(0x86)](a28_0x5c228c[_0x23b6ad(0x93)](_0x578907[_0x23b6ad(0xac)]+'\x20warning(s)\x20found')),_0x578907['skippedCount']>0x0&&console['log'](a28_0x5c228c[_0x23b6ad(0x9a)](_0x578907[_0x23b6ad(0xa4)]+_0x23b6ad(0x8f))),0x1):(console[_0x23b6ad(0x86)](a28_0x5c228c[_0x23b6ad(0x7e)](_0x23b6ad(0x8c)+_0x578907[_0x23b6ad(0x9b)]+_0x23b6ad(0xa9))),_0x578907['warningCount']>0x0&&console['log'](a28_0x5c228c['yellow'](_0x578907[_0x23b6ad(0xac)]+_0x23b6ad(0x9d))),_0x578907[_0x23b6ad(0xa4)]>0x0&&console[_0x23b6ad(0x86)](a28_0x5c228c[_0x23b6ad(0x9a)](_0x578907[_0x23b6ad(0xa4)]+_0x23b6ad(0x8f))),0x0);}}
|