@treasuredata/tdx 2026.3.49 → 2026.3.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.d.ts +6 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.d.ts +1 -0
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +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/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +21 -4
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/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.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/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.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x22ec4f=a23_0x440e;(function(_0x15e3b2,_0x4df343){const _0x282589=a23_0x440e,_0x5bc3c1=_0x15e3b2();while(!![]){try{const _0x4cb56d=parseInt(_0x282589(0xdf))/0x1+parseInt(_0x282589(0xf5))/0x2*(parseInt(_0x282589(0x103))/0x3)+parseInt(_0x282589(0xe2))/0x4*(-parseInt(_0x282589(0x101))/0x5)+parseInt(_0x282589(0x116))/0x6+parseInt(_0x282589(0x112))/0x7+parseInt(_0x282589(0x104))/0x8*(parseInt(_0x282589(0xdb))/0x9)+-parseInt(_0x282589(0xe5))/0xa;if(_0x4cb56d===_0x4df343)break;else _0x5bc3c1['push'](_0x5bc3c1['shift']());}catch(_0x5b381d){_0x5bc3c1['push'](_0x5bc3c1['shift']());}}}(a23_0x5172,0x77931));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a23_0x5172(){const _0x3314d1=['targetDir','diff','16GiLUMB','cwd','Write\x20','4788640JZvDVg','\x20templates','counts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Workspace\x20is\x20required.','workspaceName','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','yes','✔\x20Context\x20set:\x20','config','isNew','verbose','absolutePath','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','Aborted.','hasChanges','266jBfpcj','green','files','Pulling\x20templates\x20from\x20\x27','name','cyan','templates','filter','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','error','red','yellow','972590gwwYcx','setPhase','12252PSMQrY','24RKWYnD','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','session','\x20changed\x20files','length','\x20files?','✔\x20Pulled\x20','workspace','dim','data','dirname','dryRun','\x0aChanges\x20to\x20\x27','engage_workspace','2067471xUKmJw','\x20=\x20','content','utf-8','1943844rwYugE','\x20unchanged\x20files','relativePath','No\x20templates\x20found\x20in\x20workspace\x20\x27','66141YxBAYf','\x27...','repeat','\x0aError:','562167apwgVM'];a23_0x5172=function(){return _0x3314d1;};return a23_0x5172();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a23_0x440e(_0x3c6add,_0x166eb8){_0x3c6add=_0x3c6add-0xdb;const _0x5172e1=a23_0x5172();let _0x440e3e=_0x5172e1[_0x3c6add];return _0x440e3e;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a23_0x272c72 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x24e230 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x22ec4f(0xf9)]='engage:template:pull';['description']='Pull\x20templates\x20to\x20YAML\x20files';async['execute'](_0x225b50){const _0xac47af=a23_0x22ec4f,{options:_0x21a328,args:_0x2dc700,tdx:_0x75e79f}=_0x225b50,_0x1623ae=_0x21a328,_0x64bde6=await resolveWorkspaceName(_0x2dc700[0x0],_0x1623ae);if(!_0x64bde6)return console['error'](a23_0x272c72[_0xac47af(0x100)](_0xac47af(0xe9))),console[_0xac47af(0xfe)](_0xac47af(0xf2)),console['error'](_0xac47af(0xeb)),console[_0xac47af(0xfe)](_0xac47af(0xfd)),0x1;const _0x4e211d=await withProgressSpinner(_0xac47af(0xf8)+_0x64bde6+_0xac47af(0xdc),_0x2d703c=>pullTemplates({'engage':_0x75e79f['engage']},_0x64bde6,{'templateName':_0x1623ae[_0xac47af(0xf9)],'progress':{'update':_0x270bbc=>{const _0x528c27=_0xac47af;_0x2d703c[_0x528c27(0x102)](_0x270bbc);}}}),{'verbose':_0x1623ae[_0xac47af(0xf0)]}),_0x12e75f=_0x4e211d[_0xac47af(0x10d)];if(_0x12e75f[_0xac47af(0xe7)]['templates']===0x0)return console[_0xac47af(0xfe)](a23_0x272c72[_0xac47af(0x100)](_0xac47af(0x119)+_0x12e75f['workspaceName']+'\x27')),0x0;const _0x3ef653=_0x12e75f[_0xac47af(0xf7)][_0xac47af(0xfc)](_0x5b5335=>_0x5b5335[_0xac47af(0xef)]),_0x1d88df=_0x12e75f[_0xac47af(0xf7)][_0xac47af(0xfc)](_0x123707=>!_0x123707['isNew']&&_0x123707[_0xac47af(0xf4)]),_0x10c090=_0x12e75f['files'][_0xac47af(0xfc)](_0x3a390d=>!_0x3a390d[_0xac47af(0xef)]&&!_0x3a390d[_0xac47af(0xf4)]);console['error']('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x12e75f[_0xac47af(0xea)]+'\x27:'),console[_0xac47af(0xfe)]('\x20\x20'+a23_0x272c72[_0xac47af(0xfa)](_0x12e75f['counts'][_0xac47af(0xfb)]+_0xac47af(0xe6))),console['error']('\x20\x20'+a23_0x272c72[_0xac47af(0xf6)]('+\x20'+_0x3ef653[_0xac47af(0x108)]+'\x20new\x20files')),console[_0xac47af(0xfe)]('\x20\x20'+a23_0x272c72[_0xac47af(0x100)]('~\x20'+_0x1d88df[_0xac47af(0x108)]+_0xac47af(0x107))),console[_0xac47af(0xfe)]('\x20\x20'+a23_0x272c72[_0xac47af(0x10c)]('=\x20'+_0x10c090[_0xac47af(0x108)]+_0xac47af(0x117))),console[_0xac47af(0xfe)]('\x20\x20Target:\x20'+a23_0x272c72[_0xac47af(0xfa)](_0x12e75f[_0xac47af(0xe0)])+'\x0a');if(_0x1d88df[_0xac47af(0x108)]>0x0)for(const _0x170dd4 of _0x1d88df){console[_0xac47af(0xfe)](_0xac47af(0x110)+_0x170dd4[_0xac47af(0x118)]+'\x27:'),console[_0xac47af(0xfe)]('─'[_0xac47af(0xdd)](0x3c)),console[_0xac47af(0xfe)](_0x170dd4[_0xac47af(0xe1)]),console[_0xac47af(0xfe)]('─'[_0xac47af(0xdd)](0x3c));}if(_0x1623ae[_0xac47af(0x10f)])return console['error'](a23_0x272c72[_0xac47af(0x100)](_0xac47af(0x105))),0x0;if(_0x3ef653[_0xac47af(0x108)]===0x0&&_0x1d88df[_0xac47af(0x108)]===0x0)return console[_0xac47af(0xfe)](a23_0x272c72['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'engage_workspace':_0x12e75f[_0xac47af(0xea)]},_0x1623ae[_0xac47af(0x106)]),0x0;if(!_0x1623ae[_0xac47af(0xec)]){if(!isInteractive())return console[_0xac47af(0xfe)](a23_0x272c72[_0xac47af(0xff)](_0xac47af(0xde)),_0xac47af(0xe8)),console[_0xac47af(0xfe)](a23_0x272c72[_0xac47af(0x10c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5dc4bb=await confirmKey(_0xac47af(0xe4)+(_0x3ef653[_0xac47af(0x108)]+_0x1d88df[_0xac47af(0x108)])+_0xac47af(0x109));if(!_0x5dc4bb)return console[_0xac47af(0xfe)](a23_0x272c72['yellow'](_0xac47af(0xf3)),'-\x20no\x20files\x20written'),0x1;}for(const _0x3a35d0 of _0x12e75f[_0xac47af(0xf7)]){if(_0x3a35d0[_0xac47af(0xef)]||_0x3a35d0[_0xac47af(0xf4)]){const _0x1de510=a23_0x24e230[_0xac47af(0x10e)](_0x3a35d0[_0xac47af(0xf1)]);!existsSync(_0x1de510)&&mkdirSync(_0x1de510,{'recursive':!![]}),writeFileSync(_0x3a35d0[_0xac47af(0xf1)],_0x3a35d0[_0xac47af(0x114)],_0xac47af(0x115));}}return console[_0xac47af(0xfe)](a23_0x272c72['green'](_0xac47af(0x10a)+(_0x3ef653[_0xac47af(0x108)]+_0x1d88df['length'])+'\x20files\x20to\x20'+_0x12e75f['targetDir'])),saveSessionContext({'engage_workspace':_0x12e75f[_0xac47af(0xea)]},_0x1623ae['session']),console[_0xac47af(0xfe)](a23_0x272c72[_0xac47af(0xf6)](_0xac47af(0xed)+a23_0x272c72[_0xac47af(0x10c)](_0xac47af(0x111))+_0xac47af(0x113)+a23_0x272c72[_0xac47af(0xfa)](_0x12e75f[_0xac47af(0xea)]))),0x0;}}async function resolveWorkspaceName(_0x47a673,_0x20bbbb){const _0x1f400f=a23_0x22ec4f;if(_0x47a673)return _0x47a673;if(_0x20bbbb[_0x1f400f(0x10b)])return _0x20bbbb[_0x1f400f(0x10b)];const _0x5c393d=tryFindTdxConfig(process[_0x1f400f(0xe3)]());if(_0x5c393d?.[_0x1f400f(0xee)][_0x1f400f(0x111)])return _0x5c393d[_0x1f400f(0xee)][_0x1f400f(0x111)];const _0x9ef9b5=loadSessionContext(_0x20bbbb[_0x1f400f(0x106)]);if(_0x9ef9b5?.[_0x1f400f(0x111)])return _0x9ef9b5[_0x1f400f(0x111)];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x3acc63=a24_0x1bfa;(function(_0x5e1e83,_0x84e55b){const _0x3fc3be=a24_0x1bfa,_0x1035d0=_0x5e1e83();while(!![]){try{const _0x583122=parseInt(_0x3fc3be(0x19b))/0x1*(parseInt(_0x3fc3be(0x181))/0x2)+-parseInt(_0x3fc3be(0x1bb))/0x3*(-parseInt(_0x3fc3be(0x18c))/0x4)+-parseInt(_0x3fc3be(0x19c))/0x5*(-parseInt(_0x3fc3be(0x1b3))/0x6)+-parseInt(_0x3fc3be(0x1b1))/0x7+-parseInt(_0x3fc3be(0x192))/0x8*(parseInt(_0x3fc3be(0x1a0))/0x9)+parseInt(_0x3fc3be(0x1b0))/0xa*(parseInt(_0x3fc3be(0x194))/0xb)+-parseInt(_0x3fc3be(0x1a4))/0xc;if(_0x583122===_0x84e55b)break;else _0x1035d0['push'](_0x1035d0['shift']());}catch(_0x312f29){_0x1035d0['push'](_0x1035d0['shift']());}}}(a24_0x170f,0xe578f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';function a24_0x170f(){const _0x45c540=['created','errors','136376LrIFrr','661915uDzIEv','results','-\x20no\x20changes\x20applied','data','10694745xnyDDN','cwd','create','dim','16493220oGvmuz','\x27...','setPhase','\x20new\x20templates:','\x0aError:','Resolving\x20references...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','green','red','resolveWorkspaceId','resolve','valid','5446510jXsIUW','1448412jQSngn','cyan','6JayvoQ','\x20templates?','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','path','\x20\x20\x20\x20','1\x20template\x20file:\x20','Pushing\x20templates...','action','10467ZtLUQY','Preparing\x20push\x20to\x20workspace\x20\x27','updated','templateId','✔\x20Updated\x20','verbose','warnings','name','\x0aValidation\x20errors\x20in\x20','configDir','error','engage_workspace','Push\x20','engage:template:push','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','22mhBwjw','message','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','def','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','length','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','yellow','config','\x20templates','508HCyLIA','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x20templates\x20to\x20update:','workspace','dryRun','dirname','8YIGzAX','session','33CZQjOg','Found\x20','execute','\x20template\x20files','engage'];a24_0x170f=function(){return _0x45c540;};return a24_0x170f();}import a24_0x589996 from'chalk';import a24_0x211a3f from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';function a24_0x1bfa(_0x115d79,_0x5e58da){_0x115d79=_0x115d79-0x17c;const _0x170f24=a24_0x170f();let _0x1bfaf0=_0x170f24[_0x115d79];return _0x1bfaf0;}import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x3acc63(0x1c2)]=a24_0x3acc63(0x17e);['description']='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x3acc63(0x196)](_0x50dec7){const _0x30ae19=a24_0x3acc63,{options:_0x5d17c1,args:_0x548ca5,tdx:_0x2e269b}=_0x50dec7,_0x30ab26=_0x5d17c1,_0x3aa4b3=_0x548ca5[0x0],_0x54105c=_0x3aa4b3?a24_0x211a3f[_0x30ae19(0x1ae)](_0x3aa4b3):undefined,_0x156ebf=_0x54105c?isYamlFile(_0x54105c):![];let _0x49ed62;if(_0x156ebf&&_0x54105c)_0x49ed62=a24_0x211a3f[_0x30ae19(0x191)](_0x54105c);else _0x54105c?_0x49ed62=_0x54105c:_0x49ed62=process[_0x30ae19(0x1a1)]();let _0x38c862;const _0x17a250=tryFindTdxConfig(_0x49ed62);_0x17a250?.[_0x30ae19(0x18a)][_0x30ae19(0x17c)]&&(_0x38c862=_0x17a250['config'][_0x30ae19(0x17c)],!_0x156ebf&&(_0x49ed62=_0x17a250[_0x30ae19(0x1c4)]));_0x30ab26[_0x30ae19(0x18f)]&&(_0x38c862=_0x30ab26['workspace']);if(!_0x38c862){const _0x3755cb=loadSessionContext(_0x30ab26['session']);_0x3755cb?.[_0x30ae19(0x17c)]&&(_0x38c862=_0x3755cb['engage_workspace']);}if(!_0x38c862)return console[_0x30ae19(0x1c5)](a24_0x589996[_0x30ae19(0x189)]('Workspace\x20is\x20required.')),console[_0x30ae19(0x1c5)](_0x30ae19(0x188)),console[_0x30ae19(0x1c5)]('\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['error'](_0x30ae19(0x185)),console[_0x30ae19(0x1c5)](_0x30ae19(0x17f)),0x1;let _0xc3e0ff;_0x156ebf&&_0x54105c?_0xc3e0ff=[parseTemplateFile(_0x54105c,a24_0x211a3f[_0x30ae19(0x191)](_0x54105c))]:_0xc3e0ff=discoverAndParseTemplateFiles(_0x49ed62);if(_0xc3e0ff[_0x30ae19(0x186)]===0x0)return console[_0x30ae19(0x1c5)](a24_0x589996[_0x30ae19(0x189)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x49ed62)),console[_0x30ae19(0x1c5)](a24_0x589996[_0x30ae19(0x1a3)](_0x30ae19(0x18d))),0x1;const _0x2d8aff=_0xc3e0ff[_0x30ae19(0x186)]===0x1?_0x30ae19(0x1b8)+_0xc3e0ff[0x0]['def'][_0x30ae19(0x1c2)]:_0xc3e0ff['length']+_0x30ae19(0x197);console[_0x30ae19(0x1c5)](_0x30ae19(0x195)+a24_0x589996[_0x30ae19(0x1b2)](_0x2d8aff));let _0x522dee=![];for(const _0x3a8b76 of _0xc3e0ff){const _0x4ac5fc=validateTemplateDef(_0x3a8b76[_0x30ae19(0x184)]);if(!_0x4ac5fc[_0x30ae19(0x1af)]){_0x522dee=!![],console['error'](a24_0x589996['red'](_0x30ae19(0x1c3)+_0x3a8b76['relativePath']+':'));for(const _0xc6b63b of _0x4ac5fc[_0x30ae19(0x19a)]){console[_0x30ae19(0x1c5)]('\x20\x20'+a24_0x589996[_0x30ae19(0x1ac)]('✗')+'\x20'+_0xc6b63b['path']+':\x20'+_0xc6b63b[_0x30ae19(0x182)]);}}for(const _0x5582f0 of _0x4ac5fc[_0x30ae19(0x1c1)]){console[_0x30ae19(0x1c5)]('\x20\x20'+a24_0x589996[_0x30ae19(0x189)]('⚠')+'\x20'+_0x5582f0[_0x30ae19(0x1b6)]+':\x20'+_0x5582f0[_0x30ae19(0x182)]);}}if(_0x522dee)return console[_0x30ae19(0x1c5)](a24_0x589996['red'](_0x30ae19(0x1b5))),0x1;const _0x250ac4=await _0x2e269b[_0x30ae19(0x198)][_0x30ae19(0x1ad)](_0x38c862),_0x5673ed=await withProgressSpinner(_0x30ae19(0x1bc)+_0x38c862+_0x30ae19(0x1a5),_0x22802c=>preparePush({'engage':_0x2e269b[_0x30ae19(0x198)]},_0xc3e0ff,_0x250ac4,{'progress':{'update':_0x32ad41=>_0x22802c[_0x30ae19(0x1a6)](_0x32ad41)}}),{'verbose':_0x30ab26[_0x30ae19(0x1c0)]}),_0x3cf28c=_0x5673ed[_0x30ae19(0x19f)];await withProgressSpinner(_0x30ae19(0x1a9),_0x467777=>resolveAndBuildInputs({'engage':_0x2e269b[_0x30ae19(0x198)]},_0x3cf28c,_0x250ac4,{'progress':{'update':_0x136822=>_0x467777[_0x30ae19(0x1a6)](_0x136822)}}),{'verbose':_0x30ab26[_0x30ae19(0x1c0)]});const _0x4a6c3a=_0x3cf28c['filter'](_0x36ab19=>_0x36ab19['action']===_0x30ae19(0x1a2)),_0x16c3bc=_0x3cf28c['filter'](_0x3cf51c=>_0x3cf51c[_0x30ae19(0x1ba)]==='update');console[_0x30ae19(0x1c5)](_0x30ae19(0x187)+_0x38c862+'\x27:');if(_0x4a6c3a[_0x30ae19(0x186)]>0x0){console[_0x30ae19(0x1c5)]('\x20\x20'+a24_0x589996[_0x30ae19(0x1ab)]('+\x20'+_0x4a6c3a[_0x30ae19(0x186)]+_0x30ae19(0x1a7)));for(const _0x51f2ba of _0x4a6c3a){console['error'](_0x30ae19(0x1b7)+a24_0x589996[_0x30ae19(0x1ab)]('+')+'\x20'+_0x51f2ba[_0x30ae19(0x184)][_0x30ae19(0x1c2)]);}}if(_0x16c3bc[_0x30ae19(0x186)]>0x0){console[_0x30ae19(0x1c5)]('\x20\x20'+a24_0x589996[_0x30ae19(0x189)]('~\x20'+_0x16c3bc[_0x30ae19(0x186)]+_0x30ae19(0x18e)));for(const _0x2398e6 of _0x16c3bc){console['error'](_0x30ae19(0x1b7)+a24_0x589996[_0x30ae19(0x189)]('~')+'\x20'+_0x2398e6['def'][_0x30ae19(0x1c2)]);}}if(_0x4a6c3a[_0x30ae19(0x186)]===0x0&&_0x16c3bc[_0x30ae19(0x186)]===0x0)return console['error'](a24_0x589996[_0x30ae19(0x1ab)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x30ab26[_0x30ae19(0x190)])return console[_0x30ae19(0x1c5)](a24_0x589996['yellow'](_0x30ae19(0x183))),0x0;if(!_0x30ab26['yes']){if(!isInteractive())return console[_0x30ae19(0x1c5)](a24_0x589996[_0x30ae19(0x1ac)](_0x30ae19(0x1a8)),_0x30ae19(0x1aa)),console[_0x30ae19(0x1c5)](a24_0x589996[_0x30ae19(0x1a3)](_0x30ae19(0x180))),0x1;const _0x28c1a1=await confirmKey(_0x30ae19(0x17d)+(_0x4a6c3a['length']+_0x16c3bc[_0x30ae19(0x186)])+_0x30ae19(0x1b4));if(!_0x28c1a1)return console[_0x30ae19(0x1c5)](a24_0x589996[_0x30ae19(0x189)]('Aborted.'),_0x30ae19(0x19e)),0x1;}const _0x4bdfd6=await withProgressSpinner(_0x30ae19(0x1b9),_0x187856=>executePush({'engage':_0x2e269b[_0x30ae19(0x198)]},_0x3cf28c,{'progress':{'update':_0x2afcc5=>_0x187856['setPhase'](_0x2afcc5)}}),{'verbose':_0x30ab26[_0x30ae19(0x1c0)]}),_0x1645af=_0x4bdfd6['data'];for(const _0x3085eb of _0x1645af[_0x30ae19(0x19d)]){if(_0x3085eb[_0x30ae19(0x1be)]&&(_0x3085eb[_0x30ae19(0x1ba)]===_0x30ae19(0x199)||_0x3085eb[_0x30ae19(0x1ba)]===_0x30ae19(0x1bd))){const _0x518225=getTemplateUrl(_0x30ab26['site'],_0x250ac4,_0x3085eb['templateId']),_0x1a5cf3=_0x3085eb['action']===_0x30ae19(0x199)?'+':'~',_0x58e4d1=_0x3085eb[_0x30ae19(0x1ba)]===_0x30ae19(0x199)?a24_0x589996[_0x30ae19(0x1ab)](_0x1a5cf3):a24_0x589996['yellow'](_0x1a5cf3);console['error']('\x20\x20'+_0x58e4d1+'\x20'+hyperlink(_0x3085eb[_0x30ae19(0x1c2)],_0x518225)+'\x20'+a24_0x589996[_0x30ae19(0x1a3)](_0x518225));}}_0x1645af[_0x30ae19(0x199)]>0x0&&console['error'](a24_0x589996['green']('✔\x20Created\x20'+_0x1645af['created']+_0x30ae19(0x18b)));_0x1645af[_0x30ae19(0x1bd)]>0x0&&console[_0x30ae19(0x1c5)](a24_0x589996['green'](_0x30ae19(0x1bf)+_0x1645af[_0x30ae19(0x1bd)]+_0x30ae19(0x18b)));if(_0x1645af[_0x30ae19(0x19a)][_0x30ae19(0x186)]>0x0){console['error'](a24_0x589996[_0x30ae19(0x1ac)]('✘\x20'+_0x1645af[_0x30ae19(0x19a)][_0x30ae19(0x186)]+'\x20errors:'));for(const _0x36deec of _0x1645af[_0x30ae19(0x19a)]){console[_0x30ae19(0x1c5)]('\x20\x20'+a24_0x589996[_0x30ae19(0x1ac)](_0x36deec['name'])+':\x20'+_0x36deec['error']);}}return saveSessionContext({'engage_workspace':_0x38c862},_0x30ab26[_0x30ae19(0x193)]),_0x1645af[_0x30ae19(0x19a)][_0x30ae19(0x186)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a24_0x5e4b69=a24_0x84c4;(function(_0x37e067,_0xfd79ef){const _0x16787d=a24_0x84c4,_0x20fd5f=_0x37e067();while(!![]){try{const _0x506eae=parseInt(_0x16787d(0x1ee))/0x1*(-parseInt(_0x16787d(0x1fc))/0x2)+-parseInt(_0x16787d(0x203))/0x3+parseInt(_0x16787d(0x21a))/0x4+-parseInt(_0x16787d(0x224))/0x5+-parseInt(_0x16787d(0x212))/0x6+-parseInt(_0x16787d(0x222))/0x7+parseInt(_0x16787d(0x1e9))/0x8*(parseInt(_0x16787d(0x214))/0x9);if(_0x506eae===_0xfd79ef)break;else _0x20fd5f['push'](_0x20fd5f['shift']());}catch(_0x45182e){_0x20fd5f['push'](_0x20fd5f['shift']());}}}(a24_0x2848,0xe0808));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';function a24_0x2848(){const _0x480b02=['dirname','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','warnings','56517336JCqXhF','Found\x20','resolveWorkspaceId','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','resolve','1252259MMtCXt','def','config','\x0aError:','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','workspace','\x20template\x20files','green','length','verbose','description','updated','\x20templates?','action','2EJebcZ','-\x20no\x20changes\x20applied','No\x20template\x20YAML\x20files\x20found\x20in\x20','Push\x20','\x0aValidation\x20errors\x20in\x20','1\x20template\x20file:\x20','create','694491ufrHqp','✔\x20All\x20templates\x20are\x20up\x20to\x20date','valid','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','name','templateId','path','site','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','setPhase','Resolving\x20references...','dryRun','cwd','error','9005274rkYozT','engage','9kqUPcL','Preparing\x20push\x20to\x20workspace\x20\x27','created','dim','filter','Workspace\x20is\x20required.','616628sjNpLV','errors','\x20templates\x20to\x20update:','red','\x20templates','yellow','yes','engage_workspace','10773798djpNbZ','session','8877575QreNKj','message'];a24_0x2848=function(){return _0x480b02;};return a24_0x2848();}import a24_0x449d3e from'chalk';import a24_0x1e2a38 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a24_0x84c4(_0x3e46ab,_0x3ba094){_0x3e46ab=_0x3e46ab-0x1e9;const _0x2848c4=a24_0x2848();let _0x84c4d2=_0x2848c4[_0x3e46ab];return _0x84c4d2;}export class EngageTemplatePushCommand extends BaseCommand{['name']='engage:template:push';[a24_0x5e4b69(0x1f8)]=a24_0x5e4b69(0x20c);async['execute'](_0x3949e9){const _0x323950=a24_0x5e4b69,{options:_0x278d39,args:_0x49e28d,tdx:_0x3871f9}=_0x3949e9,_0x389fb6=_0x278d39,_0x3a5406=_0x49e28d[0x0],_0x55feb5=_0x3a5406?a24_0x1e2a38[_0x323950(0x1ed)](_0x3a5406):undefined,_0x3ed3a6=_0x55feb5?isYamlFile(_0x55feb5):![];let _0x327bd4;if(_0x3ed3a6&&_0x55feb5)_0x327bd4=a24_0x1e2a38[_0x323950(0x226)](_0x55feb5);else _0x55feb5?_0x327bd4=_0x55feb5:_0x327bd4=process[_0x323950(0x210)]();let _0x3a4645;const _0x35673c=tryFindTdxConfig(_0x327bd4);_0x35673c?.[_0x323950(0x1f0)][_0x323950(0x221)]&&(_0x3a4645=_0x35673c[_0x323950(0x1f0)][_0x323950(0x221)],!_0x3ed3a6&&(_0x327bd4=_0x35673c['configDir']));_0x389fb6[_0x323950(0x1f3)]&&(_0x3a4645=_0x389fb6['workspace']);if(!_0x3a4645){const _0x1c5c0e=loadSessionContext(_0x389fb6[_0x323950(0x223)]);_0x1c5c0e?.[_0x323950(0x221)]&&(_0x3a4645=_0x1c5c0e[_0x323950(0x221)]);}if(!_0x3a4645)return console['error'](a24_0x449d3e[_0x323950(0x21f)](_0x323950(0x219))),console[_0x323950(0x211)]('\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[_0x323950(0x211)]('\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[_0x323950(0x211)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console['error'](_0x323950(0x1f2)),0x1;let _0x4fb31a;_0x3ed3a6&&_0x55feb5?_0x4fb31a=[parseTemplateFile(_0x55feb5,a24_0x1e2a38[_0x323950(0x226)](_0x55feb5))]:_0x4fb31a=discoverAndParseTemplateFiles(_0x327bd4);if(_0x4fb31a[_0x323950(0x1f6)]===0x0)return console['error'](a24_0x449d3e[_0x323950(0x21f)](_0x323950(0x1fe)+_0x327bd4)),console[_0x323950(0x211)](a24_0x449d3e[_0x323950(0x217)](_0x323950(0x1ec))),0x1;const _0x3aff05=_0x4fb31a[_0x323950(0x1f6)]===0x1?_0x323950(0x201)+_0x4fb31a[0x0][_0x323950(0x1ef)][_0x323950(0x208)]:_0x4fb31a['length']+_0x323950(0x1f4);console[_0x323950(0x211)](_0x323950(0x1ea)+a24_0x449d3e['cyan'](_0x3aff05));let _0x50e4d7=![];for(const _0x484675 of _0x4fb31a){const _0x1ebf74=validateTemplateDef(_0x484675[_0x323950(0x1ef)]);if(!_0x1ebf74[_0x323950(0x205)]){_0x50e4d7=!![],console['error'](a24_0x449d3e[_0x323950(0x21d)](_0x323950(0x200)+_0x484675['relativePath']+':'));for(const _0x131d49 of _0x1ebf74['errors']){console['error']('\x20\x20'+a24_0x449d3e['red']('✗')+'\x20'+_0x131d49[_0x323950(0x20a)]+':\x20'+_0x131d49[_0x323950(0x225)]);}}for(const _0x247f0b of _0x1ebf74[_0x323950(0x228)]){console['error']('\x20\x20'+a24_0x449d3e[_0x323950(0x21f)]('⚠')+'\x20'+_0x247f0b[_0x323950(0x20a)]+':\x20'+_0x247f0b['message']);}}if(_0x50e4d7)return console[_0x323950(0x211)](a24_0x449d3e[_0x323950(0x21d)](_0x323950(0x206))),0x1;const _0x1433eb=await _0x3871f9[_0x323950(0x213)][_0x323950(0x1eb)](_0x3a4645),_0x4757e6=await withProgressSpinner(_0x323950(0x215)+_0x3a4645+'\x27...',_0x4fae82=>preparePush({'engage':_0x3871f9['engage']},_0x4fb31a,_0x1433eb,{'progress':{'update':_0x18360f=>_0x4fae82[_0x323950(0x20d)](_0x18360f)}}),{'verbose':_0x389fb6[_0x323950(0x1f7)]}),_0x4e565c=_0x4757e6['data'];await withProgressSpinner(_0x323950(0x20e),_0x1fadee=>resolveAndBuildInputs({'engage':_0x3871f9[_0x323950(0x213)]},_0x4e565c,_0x1433eb,{'progress':{'update':_0x117bc8=>_0x1fadee[_0x323950(0x20d)](_0x117bc8)}}),{'verbose':_0x389fb6[_0x323950(0x1f7)]});const _0x19c822=_0x4e565c[_0x323950(0x218)](_0x4c3a7c=>_0x4c3a7c[_0x323950(0x1fb)]===_0x323950(0x202)),_0x2b5d61=_0x4e565c['filter'](_0x4324ae=>_0x4324ae[_0x323950(0x1fb)]==='update');console[_0x323950(0x211)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x3a4645+'\x27:');if(_0x19c822[_0x323950(0x1f6)]>0x0){console['error']('\x20\x20'+a24_0x449d3e[_0x323950(0x1f5)]('+\x20'+_0x19c822[_0x323950(0x1f6)]+'\x20new\x20templates:'));for(const _0x487afa of _0x19c822){console['error']('\x20\x20\x20\x20'+a24_0x449d3e[_0x323950(0x1f5)]('+')+'\x20'+_0x487afa[_0x323950(0x1ef)][_0x323950(0x208)]);}}if(_0x2b5d61['length']>0x0){console[_0x323950(0x211)]('\x20\x20'+a24_0x449d3e['yellow']('~\x20'+_0x2b5d61[_0x323950(0x1f6)]+_0x323950(0x21c)));for(const _0x116ed8 of _0x2b5d61){console[_0x323950(0x211)]('\x20\x20\x20\x20'+a24_0x449d3e[_0x323950(0x21f)]('~')+'\x20'+_0x116ed8[_0x323950(0x1ef)][_0x323950(0x208)]);}}if(_0x19c822['length']===0x0&&_0x2b5d61[_0x323950(0x1f6)]===0x0)return console[_0x323950(0x211)](a24_0x449d3e[_0x323950(0x1f5)](_0x323950(0x204))),0x0;if(_0x389fb6[_0x323950(0x20f)])return console[_0x323950(0x211)](a24_0x449d3e['yellow'](_0x323950(0x227))),0x0;if(!_0x389fb6[_0x323950(0x220)]){if(!isInteractive())return console['error'](a24_0x449d3e['red'](_0x323950(0x1f1)),_0x323950(0x207)),console[_0x323950(0x211)](a24_0x449d3e['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1cf449=await confirmKey(_0x323950(0x1ff)+(_0x19c822[_0x323950(0x1f6)]+_0x2b5d61[_0x323950(0x1f6)])+_0x323950(0x1fa));if(!_0x1cf449)return console['error'](a24_0x449d3e['yellow']('Aborted.'),_0x323950(0x1fd)),0x1;}const _0x4656bb=await withProgressSpinner('Pushing\x20templates...',_0x28c970=>executePush({'engage':_0x3871f9[_0x323950(0x213)]},_0x4e565c,{'progress':{'update':_0x1ddd38=>_0x28c970[_0x323950(0x20d)](_0x1ddd38)}}),{'verbose':_0x389fb6[_0x323950(0x1f7)]}),_0xe1e520=_0x4656bb['data'];for(const _0x2de510 of _0xe1e520['results']){if(_0x2de510[_0x323950(0x209)]&&(_0x2de510[_0x323950(0x1fb)]==='created'||_0x2de510['action']===_0x323950(0x1f9))){const _0x496b34=getTemplateUrl(_0x389fb6[_0x323950(0x20b)],_0x1433eb,_0x2de510[_0x323950(0x209)]),_0x1f985b=_0x2de510[_0x323950(0x1fb)]===_0x323950(0x216)?'+':'~',_0x54c0aa=_0x2de510[_0x323950(0x1fb)]===_0x323950(0x216)?a24_0x449d3e[_0x323950(0x1f5)](_0x1f985b):a24_0x449d3e[_0x323950(0x21f)](_0x1f985b);console[_0x323950(0x211)]('\x20\x20'+_0x54c0aa+'\x20'+hyperlink(_0x2de510[_0x323950(0x208)],_0x496b34)+'\x20'+a24_0x449d3e['dim'](_0x496b34));}}_0xe1e520[_0x323950(0x216)]>0x0&&console[_0x323950(0x211)](a24_0x449d3e[_0x323950(0x1f5)]('✔\x20Created\x20'+_0xe1e520[_0x323950(0x216)]+_0x323950(0x21e)));_0xe1e520['updated']>0x0&&console['error'](a24_0x449d3e[_0x323950(0x1f5)]('✔\x20Updated\x20'+_0xe1e520[_0x323950(0x1f9)]+_0x323950(0x21e)));if(_0xe1e520[_0x323950(0x21b)]['length']>0x0){console[_0x323950(0x211)](a24_0x449d3e['red']('✘\x20'+_0xe1e520[_0x323950(0x21b)][_0x323950(0x1f6)]+'\x20errors:'));for(const _0x2978e2 of _0xe1e520[_0x323950(0x21b)]){console['error']('\x20\x20'+a24_0x449d3e['red'](_0x2978e2[_0x323950(0x208)])+':\x20'+_0x2978e2[_0x323950(0x211)]);}}return saveSessionContext({'engage_workspace':_0x3a4645},_0x389fb6[_0x323950(0x223)]),_0xe1e520[_0x323950(0x21b)][_0x323950(0x1f6)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x25fdb0=a25_0x1867;function a25_0x347a(){const _0x1b67e8=['180874XxYKzR','validCount','\x20valid','cwd','reason','green','No\x20template\x20YAML\x20files\x20found\x20in\x20','12SEUQVb','\x20non-template\x20file(s)\x20skipped','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','25RkKWGl','.yaml','\x20warning(s)\x20found','red','202600PXCiuV','\x20template(s)\x20with\x20errors,\x20','419020UYkvto','✔\x20All\x20','description','562340aeJqZU','resolve','error','warningCount','dirname','template','Error:\x20Directory\x20not\x20found:\x20','relativePath','Validate\x20template\x20YAML\x20files','log','name','9810kMTtfh','warnings','1882990zqvTsg','filter','engage:template:validate','yellow','skippedCount','hasErrors','errors','99040IggbLj','\x20non-template\x20file(s)\x20skipped)','length','valid','\x20template(s)\x20valid','9lCnMFQ','dim','33iITuNr'];a25_0x347a=function(){return _0x1b67e8;};return a25_0x347a();}(function(_0x77bb65,_0x4c42e0){const _0x5b9441=a25_0x1867,_0x395124=_0x77bb65();while(!![]){try{const _0x315270=-parseInt(_0x5b9441(0x96))/0x1+parseInt(_0x5b9441(0x9e))/0x2*(-parseInt(_0x5b9441(0xa5))/0x3)+parseInt(_0x5b9441(0x82))/0x4+parseInt(_0x5b9441(0xa8))/0x5*(-parseInt(_0x5b9441(0x8d))/0x6)+parseInt(_0x5b9441(0xae))/0x7+parseInt(_0x5b9441(0xac))/0x8*(-parseInt(_0x5b9441(0x9b))/0x9)+parseInt(_0x5b9441(0x8f))/0xa*(parseInt(_0x5b9441(0x9d))/0xb);if(_0x315270===_0x4c42e0)break;else _0x395124['push'](_0x395124['shift']());}catch(_0x130579){_0x395124['push'](_0x395124['shift']());}}}(a25_0x347a,0x422ce));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x1867(_0x2949f9,_0x40e303){_0x2949f9=_0x2949f9-0x82;const _0x347aac=a25_0x347a();let _0x18678c=_0x347aac[_0x2949f9];return _0x18678c;}import{existsSync}from'fs';import a25_0x3e59a5 from'chalk';import a25_0x296dac from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x25fdb0(0x8c)]=a25_0x25fdb0(0x91);[a25_0x25fdb0(0xb0)]=a25_0x25fdb0(0x8a);async['execute'](_0x4d06ba){const _0xed2064=a25_0x25fdb0,{options:_0x24c9ec,args:_0x5da8c3}=_0x4d06ba,_0x47b020=_0x24c9ec,_0x9a897=_0x5da8c3[0x0],_0x2d15f0=_0x9a897?a25_0x296dac[_0xed2064(0x83)](_0x9a897):undefined,_0x29d4a3=_0x2d15f0?isYamlFile(_0x2d15f0):![];let _0x3c150a,_0x17fc13;if(_0x29d4a3&&_0x2d15f0)_0x3c150a=a25_0x296dac[_0xed2064(0x86)](_0x2d15f0),_0x17fc13=_0x2d15f0;else _0x2d15f0?_0x3c150a=_0x2d15f0:_0x3c150a=process[_0xed2064(0xa1)]();if(!_0x17fc13&&!existsSync(_0x3c150a))return console[_0xed2064(0x84)](a25_0x3e59a5['red'](_0xed2064(0x88)+_0x3c150a+'\x0a')),0x1;let _0xd167f3;if(_0x17fc13){if(!_0x17fc13['endsWith']('.yml')&&!_0x17fc13['endsWith'](_0xed2064(0xa9)))return console['error'](a25_0x3e59a5[_0xed2064(0xab)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x17fc13+'\x0a')),0x1;_0xd167f3=[_0x17fc13];}else _0xd167f3=findYamlFiles(_0x3c150a);if(_0xd167f3['length']===0x0)return console[_0xed2064(0x84)](a25_0x3e59a5[_0xed2064(0xab)](_0xed2064(0xa7)+_0x3c150a+'\x0a')),0x1;const _0x3bfc7f=validateYamlFiles(_0xd167f3,_0x3c150a,{'filterType':_0xed2064(0x87)}),_0x5f0cbe=calculateSummary(_0x3bfc7f),_0x5b2ebc=_0x3bfc7f[_0xed2064(0x90)](isValidationResult);if(_0x5b2ebc[_0xed2064(0x98)]===0x0)return console['error'](a25_0x3e59a5[_0xed2064(0x92)](_0xed2064(0xa4)+_0x3c150a+'\x0a')),_0x5f0cbe[_0xed2064(0x93)]>0x0&&console[_0xed2064(0x84)](a25_0x3e59a5[_0xed2064(0x9c)]('('+_0x5f0cbe[_0xed2064(0x93)]+_0xed2064(0x97))),0x0;for(const _0x3934c7 of _0x3bfc7f){if(!isValidationResult(_0x3934c7)){_0x47b020['verbose']&&console[_0xed2064(0x8b)](a25_0x3e59a5[_0xed2064(0x9c)]('-\x20'+_0x3934c7[_0xed2064(0x89)]+'\x20(skipped:\x20'+_0x3934c7[_0xed2064(0xa2)]+')'));continue;}const {relativePath:_0x4e9d78,source:_0x212466,result:_0x7a4dbb}=_0x3934c7;if(_0x7a4dbb[_0xed2064(0x99)]&&_0x7a4dbb['warnings'][_0xed2064(0x98)]===0x0)_0x47b020['verbose']&&console[_0xed2064(0x8b)](a25_0x3e59a5[_0xed2064(0xa3)]('✔\x20'+_0x4e9d78));else _0x7a4dbb[_0xed2064(0x99)]?(console[_0xed2064(0x8b)](a25_0x3e59a5[_0xed2064(0x92)]('⚠\x20'+_0x4e9d78+':\x20'+_0x7a4dbb[_0xed2064(0x8e)][_0xed2064(0x98)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x7a4dbb,_0x212466,_0x4e9d78))):(console[_0xed2064(0x8b)](a25_0x3e59a5[_0xed2064(0xab)]('✖\x20'+_0x4e9d78+':\x20'+_0x7a4dbb[_0xed2064(0x95)]['length']+'\x20error(s)')),console[_0xed2064(0x8b)](formatValidationResult(_0x7a4dbb,_0x212466,_0x4e9d78)));}return console['log'](''),_0x5f0cbe[_0xed2064(0x94)]?(console[_0xed2064(0x8b)](a25_0x3e59a5[_0xed2064(0xab)]('Validation\x20failed:\x20'+_0x5f0cbe['invalidCount']+_0xed2064(0xad)+_0x5f0cbe[_0xed2064(0x9f)]+_0xed2064(0xa0))),_0x5f0cbe[_0xed2064(0x85)]>0x0&&console['log'](a25_0x3e59a5['yellow'](_0x5f0cbe[_0xed2064(0x85)]+_0xed2064(0xaa))),_0x5f0cbe[_0xed2064(0x93)]>0x0&&console[_0xed2064(0x8b)](a25_0x3e59a5[_0xed2064(0x9c)](_0x5f0cbe[_0xed2064(0x93)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console['log'](a25_0x3e59a5[_0xed2064(0xa3)](_0xed2064(0xaf)+_0x5f0cbe['validCount']+_0xed2064(0x9a))),_0x5f0cbe[_0xed2064(0x85)]>0x0&&console['log'](a25_0x3e59a5['yellow'](_0x5f0cbe[_0xed2064(0x85)]+_0xed2064(0xaa))),_0x5f0cbe[_0xed2064(0x93)]>0x0&&console[_0xed2064(0x8b)](a25_0x3e59a5[_0xed2064(0x9c)](_0x5f0cbe[_0xed2064(0x93)]+_0xed2064(0xa6))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x277631=a26_0x431f;(function(_0x290a34,_0x1c6db5){const _0x6591ca=a26_0x431f,_0x56f023=_0x290a34();while(!![]){try{const _0x5627f7=parseInt(_0x6591ca(0x196))/0x1+-parseInt(_0x6591ca(0x1a4))/0x2+-parseInt(_0x6591ca(0x19c))/0x3+-parseInt(_0x6591ca(0x1a7))/0x4*(-parseInt(_0x6591ca(0x1c6))/0x5)+parseInt(_0x6591ca(0x1b6))/0x6*(parseInt(_0x6591ca(0x191))/0x7)+-parseInt(_0x6591ca(0x193))/0x8+parseInt(_0x6591ca(0x1c7))/0x9*(-parseInt(_0x6591ca(0x19d))/0xa);if(_0x5627f7===_0x1c6db5)break;else _0x56f023['push'](_0x56f023['shift']());}catch(_0x31fbee){_0x56f023['push'](_0x56f023['shift']());}}}(a26_0x16a2,0x32b08));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a26_0x431f(_0x5272d4,_0x2c794b){_0x5272d4=_0x5272d4-0x173;const _0x16a28a=a26_0x16a2();let _0x431f81=_0x16a28a[_0x5272d4];return _0x431f81;}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_0x809e52 from'chalk';function formatDuration(_0x364275){const _0x153514=a26_0x431f;if(_0x364275<0x3c)return _0x364275+'s';if(_0x364275<0xe10)return Math[_0x153514(0x1c0)](_0x364275/0x3c)+'m\x20'+_0x364275%0x3c+'s';const _0x2e20a8=Math[_0x153514(0x1c0)](_0x364275/0xe10),_0x17b739=Math[_0x153514(0x1c0)](_0x364275%0xe10/0x3c);return _0x17b739>0x0?_0x2e20a8+'h\x20'+_0x17b739+'m':_0x2e20a8+'h';}function formatRelativeTime(_0x3886bc){const _0x1a395f=a26_0x431f,_0x5ed47a=Date[_0x1a395f(0x184)]()-_0x3886bc[_0x1a395f(0x1c3)](),_0x19c49c=Math['floor'](Math[_0x1a395f(0x1b7)](_0x5ed47a)/0x3e8);if(_0x19c49c<0x3c)return _0x1a395f(0x1be);const _0x4092de=Math[_0x1a395f(0x1c0)](_0x19c49c/0x3c);if(_0x4092de<0x3c)return _0x4092de+_0x1a395f(0x1c9);const _0x18c458=Math['floor'](_0x4092de/0x3c);if(_0x18c458<0x18)return _0x18c458+'h\x20ago';const _0x47e74e=Math[_0x1a395f(0x1c0)](_0x18c458/0x18);if(_0x47e74e<0x1e)return _0x47e74e+_0x1a395f(0x1c2);return Math['floor'](_0x47e74e/0x1e)+_0x1a395f(0x1bc);}export class JobListCommand extends BaseCommand{[a26_0x277631(0x177)]=a26_0x277631(0x1a5);[a26_0x277631(0x1b1)]=a26_0x277631(0x186);async['execute'](_0x423e0e){const _0x2ac00c=a26_0x277631,{options:_0x258243,tdx:_0x31f905}=_0x423e0e,_0x3862a5=resolveLimit(_0x258243['limit'],DEFAULT_DISPLAY_LIMIT),_0x104720=_0x258243[_0x2ac00c(0x18a)];_0x258243[_0x2ac00c(0x1bf)]&&(console[_0x2ac00c(0x1b8)](_0x2ac00c(0x199)+_0x3862a5+_0x2ac00c(0x1ab)),_0x104720&&console['error'](_0x2ac00c(0x1c1)+_0x104720));const _0x480b99=await withSpinner(_0x2ac00c(0x173),()=>_0x31f905['jobs'][_0x2ac00c(0x1a3)]({'from':0x0,'to':_0x3862a5-0x1,'status':_0x104720}),{'verbose':_0x258243['verbose']}),_0x3fd607=_0x480b99[_0x2ac00c(0x1bb)];console[_0x2ac00c(0x1b8)]('✔\x20Found\x20'+_0x3fd607['length']+'\x20job'+(_0x3fd607['length']!==0x1?'s':''));const _0x26b78c=_0x258243[_0x2ac00c(0x18c)];if(isStructuredFormat(_0x258243)){const _0x11b295=_0x3fd607[_0x2ac00c(0x1aa)](_0x44f721=>{const _0x27da01=_0x2ac00c;let _0x300111;if(_0x44f721['start_at']&&_0x44f721[_0x27da01(0x195)]){const _0x48e0a2=new Date(_0x44f721[_0x27da01(0x183)])[_0x27da01(0x1c3)](),_0x2c468b=new Date(_0x44f721[_0x27da01(0x195)])[_0x27da01(0x1c3)]();_0x300111=Math[_0x27da01(0x190)]((_0x2c468b-_0x48e0a2)/0x3e8);}return{'job_id':_0x44f721['job_id'],'type':_0x44f721[_0x27da01(0x18e)]===_0x27da01(0x194)?_0x27da01(0x1ca):_0x44f721['type'],'status':_0x44f721['status'],'user_name':_0x44f721[_0x27da01(0x1a8)],'duration_sec':_0x300111,'created_at':_0x44f721[_0x27da01(0x1a6)],'started_at':_0x44f721['start_at'],'end_at':_0x44f721[_0x27da01(0x195)]};});await handleSDKOutput(_0x11b295,_0x258243);}else for(const _0x5ca939 of _0x3fd607){const _0x1339fa=_0x5ca939[_0x2ac00c(0x18a)]==='success'?a26_0x809e52[_0x2ac00c(0x1b4)]:_0x5ca939['status']==='error'?a26_0x809e52['red']:a26_0x809e52[_0x2ac00c(0x17b)],_0x229861=_0x1339fa(_0x5ca939[_0x2ac00c(0x18a)]),_0x21484b=getJobUrl(_0x26b78c,_0x5ca939['job_id']),_0x489af9=hyperlink(_0x5ca939[_0x2ac00c(0x1ae)],_0x21484b),_0x25ca91=a26_0x809e52['dim'](_0x5ca939[_0x2ac00c(0x18e)]==='presto'?_0x2ac00c(0x1ca):_0x5ca939[_0x2ac00c(0x18e)]),_0x426157=[];if(_0x5ca939[_0x2ac00c(0x183)]&&_0x5ca939[_0x2ac00c(0x195)]){const _0x440057=Math[_0x2ac00c(0x190)]((new Date(_0x5ca939[_0x2ac00c(0x195)])['getTime']()-new Date(_0x5ca939[_0x2ac00c(0x183)])[_0x2ac00c(0x1c3)]())/0x3e8);_0x426157[_0x2ac00c(0x198)](formatDuration(_0x440057));}if(_0x5ca939['end_at'])_0x426157[_0x2ac00c(0x198)](formatRelativeTime(new Date(_0x5ca939[_0x2ac00c(0x195)])));else _0x5ca939[_0x2ac00c(0x183)]&&_0x426157[_0x2ac00c(0x198)](formatRelativeTime(new Date(_0x5ca939[_0x2ac00c(0x183)])));const _0x70a84=_0x426157[_0x2ac00c(0x1b3)]>0x0?a26_0x809e52[_0x2ac00c(0x17b)]('\x20'+_0x426157[_0x2ac00c(0x1c5)](',\x20')):'';console[_0x2ac00c(0x1b2)]('⚡\x20'+_0x489af9+'\x20'+_0x25ca91+'\x20'+_0x229861+_0x70a84);}return 0x0;}}function a26_0x16a2(){const _0x56a939=['submit','Getting\x20job\x20details...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','status','✔\x20Retrieved\x20','site','job:kill','type','result','round','15036cOgHWr','url','2127280yzNjEc','presto','end_at','127902razxrT','job:submit','push','Limit:\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','query','485943QwlTcD','224570hRswuH','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','file','debug','substring','Show\x20job\x20details','list','149446DqmYLR','jobs','created_at','35132UtMAiA','user_name','validate','map','\x20jobs','execute','✔\x20Job\x20submitted','job_id','Query:\x20','Cancelled','description','log','length','green','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','1158LaLSxQ','abs','error','database','information_schema','data','mo\x20ago','Kill\x20a\x20job','just\x20now','verbose','floor','Status\x20filter:\x20','d\x20ago','getTime','kill','join','185mhYMVy','63ZwrixW','Submitting\x20kill\x20request...','m\x20ago','trino','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Listing\x20jobs...','\x20\x20Job\x20ID:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','name','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Submit\x20a\x20job','hive','dim','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Get\x20job\x20results','show','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','INVALID_ARGUMENT','args','priority','start_at','now','...','List\x20jobs'];a26_0x16a2=function(){return _0x56a939;};return a26_0x16a2();}export class JobShowCommand extends BaseCommand{['name']='job:show';['description']=a26_0x277631(0x1a2);[a26_0x277631(0x1a9)](_0x2e8650){const _0x527906=a26_0x277631,_0x158aad=_0x2e8650[_0x527906(0x181)][0x0];if(!_0x158aad)return _0x527906(0x178);return undefined;}async['execute'](_0x4be18f){const _0xa92d4=a26_0x277631,{options:_0x2f5e3b,args:_0x5d748b,tdx:_0xed75a7}=_0x4be18f,_0x26abb2=_0x5d748b[0x0],_0x11a58a=await withSpinner(_0xa92d4(0x188),()=>_0xed75a7[_0xa92d4(0x1a5)][_0xa92d4(0x17e)](_0x26abb2),{'verbose':_0x2f5e3b[_0xa92d4(0x1bf)]}),_0x431dd5=_0x11a58a[_0xa92d4(0x1bb)];let _0x240be3;if(_0x431dd5[_0xa92d4(0x183)]&&_0x431dd5[_0xa92d4(0x195)]){const _0x5dc1f2=new Date(_0x431dd5[_0xa92d4(0x183)])['getTime'](),_0x6e135c=new Date(_0x431dd5[_0xa92d4(0x195)])[_0xa92d4(0x1c3)]();_0x240be3=Math['round']((_0x6e135c-_0x5dc1f2)/0x3e8);}const _0x53c17c={'job_id':_0x431dd5[_0xa92d4(0x1ae)],'type':_0x431dd5[_0xa92d4(0x18e)],'status':_0x431dd5['status'],..._0x431dd5[_0xa92d4(0x1a8)]&&{'user_name':_0x431dd5[_0xa92d4(0x1a8)]},..._0x240be3!==undefined&&{'duration_sec':_0x240be3},..._0x431dd5['created_at']&&{'created_at':_0x431dd5[_0xa92d4(0x1a6)]},..._0x431dd5[_0xa92d4(0x183)]&&{'started_at':_0x431dd5[_0xa92d4(0x183)]},..._0x431dd5[_0xa92d4(0x195)]&&{'end_at':_0x431dd5[_0xa92d4(0x195)]},..._0x431dd5[_0xa92d4(0x1b9)]&&{'database':_0x431dd5['database']},..._0x431dd5[_0xa92d4(0x182)]!==undefined&&{'priority':_0x431dd5[_0xa92d4(0x182)]},..._0x431dd5[_0xa92d4(0x192)]&&{'url':_0x431dd5[_0xa92d4(0x192)]},..._0x431dd5['query']&&{'query':_0x431dd5[_0xa92d4(0x19b)]},..._0x431dd5['debug']&&{'debug':_0x431dd5[_0xa92d4(0x1a0)]}};return await handleSingleObjectOutput(_0x53c17c,_0x2f5e3b),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x277631(0x177)]=a26_0x277631(0x18d);[a26_0x277631(0x1b1)]=a26_0x277631(0x1bd);['validate'](_0x9096e8){const _0x483a7f=a26_0x277631,_0x533259=_0x9096e8[_0x483a7f(0x181)][0x0];if(!_0x533259)return _0x483a7f(0x189);return undefined;}async[a26_0x277631(0x1ac)](_0x2ec594){const _0x852442=a26_0x277631,{options:_0x536866,args:_0x2eae6a,tdx:_0x59d4fc}=_0x2ec594,_0x34f4d9=_0x2eae6a[0x0];if(!_0x536866['yes']){const _0xca7356=await confirm(_0x852442(0x176)+_0x34f4d9+'?');if(!_0xca7356)return console[_0x852442(0x1b8)](_0x852442(0x1b0)),0x0;}return await withSpinner(_0x852442(0x1c8),()=>_0x59d4fc[_0x852442(0x1a5)][_0x852442(0x1c4)](_0x34f4d9),{'verbose':_0x536866[_0x852442(0x1bf)]}),console['error'](_0x852442(0x17c)+_0x34f4d9),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x34f4d9+_0x852442(0x175)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x277631(0x177)]=a26_0x277631(0x197);[a26_0x277631(0x1b1)]=a26_0x277631(0x179);async[a26_0x277631(0x1ac)](_0x5700af){const _0xc7a765=a26_0x277631,{options:_0x16b657,args:_0x21662a,tdx:_0xbc8b5e}=_0x5700af,_0x36c34a=_0x16b657['jobType']||_0xc7a765(0x1ca),_0x243227=_0x16b657[_0xc7a765(0x19f)],_0x4a835b=_0x16b657['database']||_0xc7a765(0x1ba),_0x3d00bf=_0x16b657[_0xc7a765(0x18f)];if(_0x36c34a!==_0xc7a765(0x1ca)&&_0x36c34a!==_0xc7a765(0x17a))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xc7a765(0x19e));let _0x5eb285;if(_0x243227){if(_0x21662a[0x0])throw new SDKError(ErrorCode[_0xc7a765(0x180)],_0xc7a765(0x17f));const _0x502c26=readSqlStatementsFromFile(_0x243227);if(_0x502c26[_0xc7a765(0x1b3)]===0x0)throw new SDKError(ErrorCode[_0xc7a765(0x180)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x502c26[_0xc7a765(0x1b3)]>0x1)throw new SDKError(ErrorCode[_0xc7a765(0x180)],_0xc7a765(0x1b5));_0x5eb285=_0x502c26[0x0];}else{if(!_0x21662a[0x0])throw new SDKError(ErrorCode[_0xc7a765(0x180)],_0xc7a765(0x19a));_0x5eb285=_0x21662a[0x0];}_0x16b657[_0xc7a765(0x1bf)]&&(console[_0xc7a765(0x1b8)]('Job\x20type:\x20'+_0x36c34a),console['error']('Database:\x20'+_0x4a835b),console[_0xc7a765(0x1b8)](_0xc7a765(0x1af)+_0x5eb285[_0xc7a765(0x1a1)](0x0,0x64)+(_0x5eb285[_0xc7a765(0x1b3)]>0x64?_0xc7a765(0x185):'')));const _0x54026a=await withSpinner('Submitting\x20job...',()=>_0xbc8b5e[_0xc7a765(0x1a5)][_0xc7a765(0x187)](_0x4a835b,_0x5eb285,_0x36c34a,_0x3d00bf),{'verbose':_0x16b657[_0xc7a765(0x1bf)]}),_0x45950f=_0x54026a[_0xc7a765(0x1bb)];return console['error'](_0xc7a765(0x1ad)),console[_0xc7a765(0x1b8)](_0xc7a765(0x174)+_0x45950f[_0xc7a765(0x1ae)]),await handleSDKOutput([_0x45950f],_0x16b657),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x277631(0x177)]='job:result';[a26_0x277631(0x1b1)]=a26_0x277631(0x17d);[a26_0x277631(0x1a9)](_0x32bb27){const _0x9123e0=a26_0x277631,_0x3f2583=_0x32bb27['args'][0x0];if(!_0x3f2583)return _0x9123e0(0x1cb);return undefined;}async[a26_0x277631(0x1ac)](_0x2a24e4){const _0xac97ce=a26_0x277631,{options:_0x45ff28,args:_0x31c3db,tdx:_0x12e131}=_0x2a24e4,_0x4a75c1=_0x31c3db[0x0],_0x2d5da6=await withSpinner('Getting\x20job\x20results...',()=>_0x12e131[_0xac97ce(0x1a5)][_0xac97ce(0x18f)](_0x4a75c1),{'verbose':_0x45ff28[_0xac97ce(0x1bf)]}),_0x592b5a=_0x2d5da6[_0xac97ce(0x1bb)];return console['error'](_0xac97ce(0x18b)+_0x592b5a[_0xac97ce(0x1b3)]+'\x20row'+(_0x592b5a[_0xac97ce(0x1b3)]!==0x1?'s':'')),await handleSDKOutput(_0x592b5a,_0x45ff28),0x0;}}
|
|
1
|
+
function a26_0x3b4d(_0x28ed04,_0x4fce9f){_0x28ed04=_0x28ed04-0x1d3;const _0x55b909=a26_0x55b9();let _0x3b4de7=_0x55b909[_0x28ed04];return _0x3b4de7;}const a26_0xf2cfb3=a26_0x3b4d;(function(_0x39a297,_0x448084){const _0x18725f=a26_0x3b4d,_0x3aea4d=_0x39a297();while(!![]){try{const _0x153a8a=-parseInt(_0x18725f(0x20c))/0x1*(parseInt(_0x18725f(0x20d))/0x2)+-parseInt(_0x18725f(0x21f))/0x3+-parseInt(_0x18725f(0x1d8))/0x4+parseInt(_0x18725f(0x1d6))/0x5+parseInt(_0x18725f(0x1fe))/0x6*(-parseInt(_0x18725f(0x1df))/0x7)+-parseInt(_0x18725f(0x215))/0x8+parseInt(_0x18725f(0x216))/0x9;if(_0x153a8a===_0x448084)break;else _0x3aea4d['push'](_0x3aea4d['shift']());}catch(_0x186e1d){_0x3aea4d['push'](_0x3aea4d['shift']());}}}(a26_0x55b9,0x8c07e));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_0x3ffb54 from'chalk';function a26_0x55b9(){const _0x55def5=['length','yes','jobs','Status\x20filter:\x20','\x20row','query','round','7601poSkFe','244lwTbQb','Submitting\x20kill\x20request...','getTime','just\x20now','job:kill','Cancelled','h\x20ago','information_schema','3664968rVmYkr','26697411SFATwp','✔\x20Found\x20','Show\x20job\x20details','status','INVALID_ARGUMENT','type','Job\x20type:\x20','\x20\x20Job\x20ID:\x20','description','3179259VkALTe','submit','trino','green','Query:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','result','Get\x20job\x20results','file','Listing\x20jobs...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','debug','join','Database:\x20','3000170HsTKYn','\x27\x20to\x20verify\x20the\x20job\x20status','963188RGwAzV','execute','job_id','database','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','presto','Getting\x20job\x20results...','1073989jAYjDP','end_at','Submit\x20a\x20job','floor','data','validate','...','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Getting\x20job\x20details...','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','priority','✔\x20Retrieved\x20','args','jobType','list','show','Kill\x20a\x20job','url','m\x20ago','hive','push','now','error','kill','Limit:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','success','verbose','created_at','\x20job','start_at','12AMPxEN','log','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','job:submit','map','name','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'];a26_0x55b9=function(){return _0x55def5;};return a26_0x55b9();}function formatDuration(_0x2ed21a){const _0x2e5b77=a26_0x3b4d;if(_0x2ed21a<0x3c)return _0x2ed21a+'s';if(_0x2ed21a<0xe10)return Math[_0x2e5b77(0x1e2)](_0x2ed21a/0x3c)+'m\x20'+_0x2ed21a%0x3c+'s';const _0x5f04e0=Math[_0x2e5b77(0x1e2)](_0x2ed21a/0xe10),_0x21f1e9=Math[_0x2e5b77(0x1e2)](_0x2ed21a%0xe10/0x3c);return _0x21f1e9>0x0?_0x5f04e0+'h\x20'+_0x21f1e9+'m':_0x5f04e0+'h';}function formatRelativeTime(_0x1a7aa0){const _0x57217d=a26_0x3b4d,_0x5cf8b0=Date[_0x57217d(0x1f4)]()-_0x1a7aa0[_0x57217d(0x20f)](),_0x3a7ee9=Math[_0x57217d(0x1e2)](Math['abs'](_0x5cf8b0)/0x3e8);if(_0x3a7ee9<0x3c)return _0x57217d(0x210);const _0x44eea5=Math[_0x57217d(0x1e2)](_0x3a7ee9/0x3c);if(_0x44eea5<0x3c)return _0x44eea5+_0x57217d(0x1f1);const _0x20d792=Math['floor'](_0x44eea5/0x3c);if(_0x20d792<0x18)return _0x20d792+_0x57217d(0x213);const _0x287283=Math[_0x57217d(0x1e2)](_0x20d792/0x18);if(_0x287283<0x1e)return _0x287283+'d\x20ago';return Math['floor'](_0x287283/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']=a26_0xf2cfb3(0x207);[a26_0xf2cfb3(0x21e)]='List\x20jobs';async[a26_0xf2cfb3(0x1d9)](_0x2cb41d){const _0x259ea4=a26_0xf2cfb3,{options:_0x5399e0,tdx:_0x3b8d27}=_0x2cb41d,_0x50c206=resolveLimit(_0x5399e0['limit'],DEFAULT_DISPLAY_LIMIT),_0x3a6145=_0x5399e0['status'];_0x5399e0['verbose']&&(console[_0x259ea4(0x1f5)](_0x259ea4(0x1f7)+_0x50c206+'\x20jobs'),_0x3a6145&&console[_0x259ea4(0x1f5)](_0x259ea4(0x208)+_0x3a6145));const _0x514179=await withSpinner(_0x259ea4(0x228),()=>_0x3b8d27[_0x259ea4(0x207)][_0x259ea4(0x1ed)]({'from':0x0,'to':_0x50c206-0x1,'status':_0x3a6145}),{'verbose':_0x5399e0[_0x259ea4(0x1fa)]}),_0x4856aa=_0x514179[_0x259ea4(0x1e3)];console[_0x259ea4(0x1f5)](_0x259ea4(0x217)+_0x4856aa[_0x259ea4(0x205)]+_0x259ea4(0x1fc)+(_0x4856aa[_0x259ea4(0x205)]!==0x1?'s':''));const _0x57b9b7=_0x5399e0['site'];if(isStructuredFormat(_0x5399e0)){const _0x5cd084=_0x4856aa[_0x259ea4(0x202)](_0x1f77df=>{const _0x1b92b3=_0x259ea4;let _0x37bfc3;if(_0x1f77df[_0x1b92b3(0x1fd)]&&_0x1f77df[_0x1b92b3(0x1e0)]){const _0x57e542=new Date(_0x1f77df[_0x1b92b3(0x1fd)])[_0x1b92b3(0x20f)](),_0x234673=new Date(_0x1f77df[_0x1b92b3(0x1e0)])[_0x1b92b3(0x20f)]();_0x37bfc3=Math['round']((_0x234673-_0x57e542)/0x3e8);}return{'job_id':_0x1f77df[_0x1b92b3(0x1da)],'type':_0x1f77df[_0x1b92b3(0x21b)]==='presto'?_0x1b92b3(0x221):_0x1f77df['type'],'status':_0x1f77df['status'],'user_name':_0x1f77df['user_name'],'duration_sec':_0x37bfc3,'created_at':_0x1f77df['created_at'],'started_at':_0x1f77df[_0x1b92b3(0x1fd)],'end_at':_0x1f77df[_0x1b92b3(0x1e0)]};});await handleSDKOutput(_0x5cd084,_0x5399e0);}else for(const _0x944217 of _0x4856aa){const _0x5fc391=_0x944217[_0x259ea4(0x219)]===_0x259ea4(0x1f9)?a26_0x3ffb54[_0x259ea4(0x222)]:_0x944217[_0x259ea4(0x219)]===_0x259ea4(0x1f5)?a26_0x3ffb54['red']:a26_0x3ffb54['dim'],_0x5e7a46=_0x5fc391(_0x944217[_0x259ea4(0x219)]),_0x4535df=getJobUrl(_0x57b9b7,_0x944217[_0x259ea4(0x1da)]),_0xdb6f25=hyperlink(_0x944217[_0x259ea4(0x1da)],_0x4535df),_0x319d63=a26_0x3ffb54['dim'](_0x944217[_0x259ea4(0x21b)]===_0x259ea4(0x1dd)?_0x259ea4(0x221):_0x944217[_0x259ea4(0x21b)]),_0x25b3ef=[];if(_0x944217['start_at']&&_0x944217['end_at']){const _0x3c9473=Math[_0x259ea4(0x20b)]((new Date(_0x944217['end_at'])[_0x259ea4(0x20f)]()-new Date(_0x944217[_0x259ea4(0x1fd)])[_0x259ea4(0x20f)]())/0x3e8);_0x25b3ef[_0x259ea4(0x1f3)](formatDuration(_0x3c9473));}if(_0x944217['end_at'])_0x25b3ef[_0x259ea4(0x1f3)](formatRelativeTime(new Date(_0x944217[_0x259ea4(0x1e0)])));else _0x944217['start_at']&&_0x25b3ef[_0x259ea4(0x1f3)](formatRelativeTime(new Date(_0x944217[_0x259ea4(0x1fd)])));const _0x49295d=_0x25b3ef[_0x259ea4(0x205)]>0x0?a26_0x3ffb54['dim']('\x20'+_0x25b3ef[_0x259ea4(0x1d4)](',\x20')):'';console[_0x259ea4(0x1ff)]('⚡\x20'+_0xdb6f25+'\x20'+_0x319d63+'\x20'+_0x5e7a46+_0x49295d);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';[a26_0xf2cfb3(0x21e)]=a26_0xf2cfb3(0x218);[a26_0xf2cfb3(0x1e4)](_0x5383d6){const _0x112bb1=a26_0xf2cfb3,_0x2fcc24=_0x5383d6[_0x112bb1(0x1eb)][0x0];if(!_0x2fcc24)return _0x112bb1(0x1f8);return undefined;}async['execute'](_0x1d0bab){const _0x71c996=a26_0xf2cfb3,{options:_0x46c000,args:_0x3e5f50,tdx:_0x202fb3}=_0x1d0bab,_0x56b8b5=_0x3e5f50[0x0],_0x79261c=await withSpinner(_0x71c996(0x1e7),()=>_0x202fb3[_0x71c996(0x207)][_0x71c996(0x1ee)](_0x56b8b5),{'verbose':_0x46c000[_0x71c996(0x1fa)]}),_0x26f74f=_0x79261c['data'];let _0x1d19f5;if(_0x26f74f[_0x71c996(0x1fd)]&&_0x26f74f[_0x71c996(0x1e0)]){const _0x189ced=new Date(_0x26f74f[_0x71c996(0x1fd)])[_0x71c996(0x20f)](),_0x31cb85=new Date(_0x26f74f['end_at'])[_0x71c996(0x20f)]();_0x1d19f5=Math[_0x71c996(0x20b)]((_0x31cb85-_0x189ced)/0x3e8);}const _0x44b5f6={'job_id':_0x26f74f[_0x71c996(0x1da)],'type':_0x26f74f[_0x71c996(0x21b)],'status':_0x26f74f[_0x71c996(0x219)],..._0x26f74f['user_name']&&{'user_name':_0x26f74f['user_name']},..._0x1d19f5!==undefined&&{'duration_sec':_0x1d19f5},..._0x26f74f[_0x71c996(0x1fb)]&&{'created_at':_0x26f74f[_0x71c996(0x1fb)]},..._0x26f74f[_0x71c996(0x1fd)]&&{'started_at':_0x26f74f[_0x71c996(0x1fd)]},..._0x26f74f[_0x71c996(0x1e0)]&&{'end_at':_0x26f74f['end_at']},..._0x26f74f[_0x71c996(0x1db)]&&{'database':_0x26f74f[_0x71c996(0x1db)]},..._0x26f74f[_0x71c996(0x1e9)]!==undefined&&{'priority':_0x26f74f[_0x71c996(0x1e9)]},..._0x26f74f['url']&&{'url':_0x26f74f[_0x71c996(0x1f0)]},..._0x26f74f[_0x71c996(0x20a)]&&{'query':_0x26f74f['query']},..._0x26f74f[_0x71c996(0x1d3)]&&{'debug':_0x26f74f[_0x71c996(0x1d3)]}};return await handleSingleObjectOutput(_0x44b5f6,_0x46c000),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0xf2cfb3(0x211);['description']=a26_0xf2cfb3(0x1ef);[a26_0xf2cfb3(0x1e4)](_0x42c3e3){const _0x4a1dc0=a26_0xf2cfb3,_0xef7c41=_0x42c3e3[_0x4a1dc0(0x1eb)][0x0];if(!_0xef7c41)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0xf2cfb3(0x1d9)](_0x155336){const _0x56b8b4=a26_0xf2cfb3,{options:_0x88d405,args:_0x475b30,tdx:_0x56b250}=_0x155336,_0x2dba41=_0x475b30[0x0];if(!_0x88d405[_0x56b8b4(0x206)]){const _0x52bf63=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x2dba41+'?');if(!_0x52bf63)return console[_0x56b8b4(0x1f5)](_0x56b8b4(0x212)),0x0;}return await withSpinner(_0x56b8b4(0x20e),()=>_0x56b250['jobs'][_0x56b8b4(0x1f6)](_0x2dba41),{'verbose':_0x88d405['verbose']}),console[_0x56b8b4(0x1f5)](_0x56b8b4(0x1e6)+_0x2dba41),console[_0x56b8b4(0x1f5)](_0x56b8b4(0x200)+_0x2dba41+_0x56b8b4(0x1d7)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0xf2cfb3(0x203)]=a26_0xf2cfb3(0x201);['description']=a26_0xf2cfb3(0x1e1);async[a26_0xf2cfb3(0x1d9)](_0x5d71a0){const _0x17832d=a26_0xf2cfb3,{options:_0x18ad55,args:_0x1dd451,tdx:_0x578266}=_0x5d71a0,_0x26ce97=_0x18ad55[_0x17832d(0x1ec)]||_0x17832d(0x221),_0x492291=_0x18ad55[_0x17832d(0x227)],_0x28f1ce=_0x18ad55[_0x17832d(0x1db)]||_0x17832d(0x214),_0x6a578b=_0x18ad55[_0x17832d(0x225)];if(_0x26ce97!==_0x17832d(0x221)&&_0x26ce97!==_0x17832d(0x1f2))throw new SDKError(ErrorCode[_0x17832d(0x21a)],_0x17832d(0x1e8));let _0x3c968d;if(_0x492291){if(_0x1dd451[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x17832d(0x224));const _0x21c5c9=readSqlStatementsFromFile(_0x492291);if(_0x21c5c9[_0x17832d(0x205)]===0x0)throw new SDKError(ErrorCode[_0x17832d(0x21a)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x21c5c9['length']>0x1)throw new SDKError(ErrorCode[_0x17832d(0x21a)],_0x17832d(0x204));_0x3c968d=_0x21c5c9[0x0];}else{if(!_0x1dd451[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x17832d(0x1dc));_0x3c968d=_0x1dd451[0x0];}_0x18ad55[_0x17832d(0x1fa)]&&(console[_0x17832d(0x1f5)](_0x17832d(0x21c)+_0x26ce97),console[_0x17832d(0x1f5)](_0x17832d(0x1d5)+_0x28f1ce),console['error'](_0x17832d(0x223)+_0x3c968d['substring'](0x0,0x64)+(_0x3c968d[_0x17832d(0x205)]>0x64?_0x17832d(0x1e5):'')));const _0x476af8=await withSpinner('Submitting\x20job...',()=>_0x578266[_0x17832d(0x207)][_0x17832d(0x220)](_0x28f1ce,_0x3c968d,_0x26ce97,_0x6a578b),{'verbose':_0x18ad55[_0x17832d(0x1fa)]}),_0x3abeaf=_0x476af8[_0x17832d(0x1e3)];return console[_0x17832d(0x1f5)]('✔\x20Job\x20submitted'),console['error'](_0x17832d(0x21d)+_0x3abeaf['job_id']),await handleSDKOutput([_0x3abeaf],_0x18ad55),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0xf2cfb3(0x203)]='job:result';[a26_0xf2cfb3(0x21e)]=a26_0xf2cfb3(0x226);[a26_0xf2cfb3(0x1e4)](_0x18ca5d){const _0xf64dbe=a26_0xf2cfb3,_0x3d7a5b=_0x18ca5d[_0xf64dbe(0x1eb)][0x0];if(!_0x3d7a5b)return _0xf64dbe(0x229);return undefined;}async[a26_0xf2cfb3(0x1d9)](_0x215103){const _0x45f867=a26_0xf2cfb3,{options:_0x42ebc3,args:_0x38bffd,tdx:_0x2ad94f}=_0x215103,_0x1ce3df=_0x38bffd[0x0],_0x23f2a2=await withSpinner(_0x45f867(0x1de),()=>_0x2ad94f['jobs'][_0x45f867(0x225)](_0x1ce3df),{'verbose':_0x42ebc3[_0x45f867(0x1fa)]}),_0x579136=_0x23f2a2[_0x45f867(0x1e3)];return console[_0x45f867(0x1f5)](_0x45f867(0x1ea)+_0x579136[_0x45f867(0x205)]+_0x45f867(0x209)+(_0x579136['length']!==0x1?'s':'')),await handleSDKOutput(_0x579136,_0x42ebc3),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x5cdbb3=a27_0x597f;(function(_0x349260,_0x90bcbc){const _0x180a5c=a27_0x597f,_0x5c46a6=_0x349260();while(!![]){try{const _0x59d1b7=parseInt(_0x180a5c(0x1b3))/0x1*(parseInt(_0x180a5c(0x1b4))/0x2)+-parseInt(_0x180a5c(0x1bf))/0x3+parseInt(_0x180a5c(0x185))/0x4+parseInt(_0x180a5c(0x102))/0x5+parseInt(_0x180a5c(0x123))/0x6+parseInt(_0x180a5c(0xf3))/0x7+-parseInt(_0x180a5c(0x158))/0x8;if(_0x59d1b7===_0x90bcbc)break;else _0x5c46a6['push'](_0x5c46a6['shift']());}catch(_0x517475){_0x5c46a6['push'](_0x5c46a6['shift']());}}}(a27_0x4513,0xdf5d2));import a27_0x11882f from'chalk';import a27_0x1dc4f8 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';function a27_0x4513(){const _0x1eec92=['test','buildIdToNameMap','\x20\x20Statistics\x20not\x20available','resolveSegment','bold','✔\x20Found\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x20\x20Preserving\x20local\x20segment\x20name:\x20','hasPeriod','\x20activation','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','27717840lQrRyM','history','\x20not\x20found.\x20Available:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20Journey\x20\x22','Options:','filter','web','Error:\x20Journey\x20\x27','sort','\x20\x20Folder\x20path:\x20','🗺️\x20','\x20\x20Name:\x20','journey:traffic','columns','then','stages','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','links','segments','\x0aChanges\x20to\x20\x27','getStatistics','createVersion','\x22\x20not\x20found','\x27\x20not\x20found\x20in\x20','archived','Input:\x20','activation','rootFolderId','pause','diff','session','journeyName','/j/da','cwd','journey:version:create','journeyStages','limit','has','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','size','Fetching\x20','Error:\x20Invalid\x20version\x20number:\x20','Show\x20journey\x20statistics','\x20version','6653296EVfDHj','listFolders','\x20=\x20','tsv','\x20details...','Resolving\x20parent\x20segment...','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','stageNameMap','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aPull\x20summary:','draft','milestoneSize','replace','Creating\x20new\x20version...','format','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','folderId','audienceId','args','segmentPushCommand','tdx.json','journeyBundleName','Warning:\x20Could\x20not\x20resolve\x20segment\x20','(root)','entries','folderPath','yes','journey:version:view','/j/da/je','user','values','parent_segment','completeMilestoneRate','Show\x20journey\x20details','✔\x20Pulled\x20','Write\x20','No\x20statistics\x20available\x20for\x20journey:\x20','options','data','Error:\x20--version\x20option\x20is\x20required','nodes','\x20unchanged\x20files','helpText','\x20(ID:\x20','/e/','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','160639YBGATg','2pUmgWi','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','getSegment','Resolving\x20journey...','green','targetDir','Pattern:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Table:\x20','red','name','3302856BvRbjR','conversion','✔\x20Context\x20set:\x20','setPhase','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','file','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','state','connection','Getting\x20journey\x20statistics...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Found\x20','Folder\x20path:\x20','Getting\x20column\x20mapping...','(paused)','map','completionRate','execute','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey','log','all','listJourneysWithFolders','Fetching\x20users\x20and\x20connections...','journey:pull','errorCode','description','site','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','localeCompare','/app/ps/','length','Listing\x20journey\x20activations...','\x20\x20Journey\x20ID:\x20','error','relative','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x5c$&','yellow','Getting\x20journey\x20traffic\x20data...','Aborted.','\x20\x20Target:\x20','Cancelled','jsonl','journeyBundleId','journeyId','table','goalSize',',\x20version:\x20','\x20(rule\x20match)','completed','no_parent','getJourney','(running)','7983815PjEUZP','Error:\x20','type','activationParams','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','versionNumber','toLowerCase','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','message','Resolving\x20version...','absolutePath','enteredSize','\x20\x20-\x20','resolveParentId','Journey\x20name:\x20','9126995KfsMHX','base','getTrafficData','journey:columns','Parent\x20segment:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','set','\x20journey','buildIdToEmailMap','version','Show\x20journey\x20table\x20column\x20mapping','segmentName','join','reentryMode','json','paused','Resolved\x20YAML\x20file:\x20','exitOrJumpRate','repeat','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','\x20files?','Fetching\x20parent\x20segment...','find','segment','kind','filePath','goal','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','content','(completed)','Resume\x20a\x20paused\x20journey','blue','4144038wYsajg','\x20changed\x20files','dryRun','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','No\x20journeys\x20found','cyan','INVALID_ARGUMENT','updatedAt','\x22\x20paused','includeStats','Database:\x20','journey:view','add','verbose','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','database','isNew','Resuming\x20journey...','utf-8','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','includeHistory','get','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20new\x20files','renderStats','relativePath','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','push','exitOrJumpSize','createdAt','parentSegment','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20journeys','rule','attributes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','listVersions','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','List\x20journeys\x20in\x20current\x20context','listActivationsFlat','listJourneysFromParentSegment','from'];a27_0x4513=function(){return _0x1eec92;};return a27_0x4513();}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(_0x50bbbb){const _0x42f5d5=a27_0x597f;return!_0x50bbbb&&(console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x42f5d5(0x1e3)](_0x42f5d5(0x131))),!!_0x50bbbb;}function withJsonFormat(_0x417c9d){const _0x53172f=a27_0x597f;if(!_0x417c9d[_0x53172f(0x193)]&&!_0x417c9d[_0x53172f(0x110)]&&!_0x417c9d['jsonl']&&!_0x417c9d[_0x53172f(0x188)])return{..._0x417c9d,'format':_0x53172f(0x110),'json':!![]};return _0x417c9d;}function formatJourneyState(_0x38d60b){const _0x276c57=a27_0x597f;switch(_0x38d60b){case'launched':return a27_0x11882f[_0x276c57(0x1b8)](_0x276c57(0xf2));case _0x276c57(0x18f):return a27_0x11882f[_0x276c57(0x1c5)]('(draft)');case _0x276c57(0x111):return a27_0x11882f[_0x276c57(0x1e7)](_0x276c57(0x1ce));case _0x276c57(0xef):return a27_0x11882f[_0x276c57(0x122)](_0x276c57(0x120));case _0x276c57(0x171):return a27_0x11882f[_0x276c57(0x1c5)]('(archived)');default:return'('+_0x38d60b+')';}}function formatJourneyItem(_0x4ef996,_0x471bfb='',_0x43e70e){const _0x5c1880=a27_0x597f,_0x593ea8=formatJourneyState(_0x4ef996['state']),_0x161963=_0x43e70e?hyperlink(_0x4ef996[_0x5c1880(0x19a)],_0x43e70e):_0x4ef996[_0x5c1880(0x19a)];return _0x471bfb+_0x5c1880(0x163)+_0x161963+'\x20'+_0x593ea8;}function escapeRegex(_0x29ec2a){const _0x330295=a27_0x597f;return _0x29ec2a[_0x330295(0x191)](/[.*+?^${}()|[\]\\]/g,_0x330295(0x1e6));}function globToRegex(_0x4576ed){const _0x4c0494=a27_0x597f,_0xb0fba6=_0x4576ed['split']('*')[_0x4c0494(0x1cf)](escapeRegex);return new RegExp(_0xb0fba6['join']('.*'),'i');}function buildRuleToNameMapping(_0x3d2068){const _0x37ec46=a27_0x597f,_0x19d9ff=new Map();if(_0x3d2068[_0x37ec46(0x16b)])for(const [_0x5938d5,_0x4e77b0]of Object[_0x37ec46(0x19d)](_0x3d2068['segments'])){if(_0x4e77b0[_0x37ec46(0x144)]){const _0x469e10=serializeRule(_0x4e77b0['rule']),_0x3d93cb=_0x19d9ff[_0x37ec46(0x138)](_0x469e10);_0x3d93cb?_0x3d93cb['push'](_0x5938d5):_0x19d9ff[_0x37ec46(0x108)](_0x469e10,[_0x5938d5]);}}return _0x19d9ff;}async function resolveJourneyIdFromInput(_0xb5cf92,_0x2a3241,_0x26a23d){const _0x2662ab=a27_0x597f,_0xfe1286=await resolveJourneyTarget(_0xb5cf92,_0x2a3241[_0x2662ab(0x141)],_0x2a3241[_0x2662ab(0x130)]),_0x3bab85=_0xfe1286['parentSegment'];if(!_0x3bab85)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2662ab(0x1ca));const _0x56d132=await withSpinner(_0x2662ab(0x18a),()=>_0x26a23d[_0x2662ab(0x119)][_0x2662ab(0x100)](_0x3bab85),{'verbose':_0x2a3241['verbose']}),_0x51a63d=_0x56d132[_0x2662ab(0x1ab)],_0x1366cd=await withSpinner(_0x2662ab(0x1b7),()=>_0x26a23d[_0x2662ab(0x1d3)]['resolveJourneyId'](_0x51a63d,_0xfe1286[_0x2662ab(0x178)]),{'verbose':_0x2a3241[_0x2662ab(0x130)]});return{'journeyId':_0x1366cd[_0x2662ab(0x1ab)],'journeyName':_0xfe1286[_0x2662ab(0x178)],'parentSegmentId':_0x51a63d};}function a27_0x597f(_0x2c06ec,_0xdff5c3){_0x2c06ec=_0x2c06ec-0xef;const _0x4513b3=a27_0x4513();let _0x597fe3=_0x4513b3[_0x2c06ec];return _0x597fe3;}async function resolveJourneyTarget(_0x11e4df,_0x305578,_0x13a68a){const _0x4e0f02=a27_0x597f;if(isYamlFilePath(_0x11e4df))try{const _0x50ec24=await resolveYamlFilePath(_0x11e4df);return _0x13a68a&&(console[_0x4e0f02(0x1e3)](_0x4e0f02(0x112)+_0x11e4df),console[_0x4e0f02(0x1e3)]('\x20\x20Parent\x20segment:\x20'+_0x50ec24[_0x4e0f02(0x141)]),console[_0x4e0f02(0x1e3)](_0x4e0f02(0x164)+_0x50ec24[_0x4e0f02(0x10d)]),console['error'](_0x4e0f02(0x162)+(_0x50ec24[_0x4e0f02(0x19e)]||_0x4e0f02(0x19c)))),{'journeyName':_0x50ec24[_0x4e0f02(0x10d)],'parentSegment':_0x50ec24[_0x4e0f02(0x141)],'resolved':_0x50ec24};}catch(_0x50b68a){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x50b68a[_0x4e0f02(0xfb)]);}if(!_0x305578)throw new SDKError(ErrorCode[_0x4e0f02(0x129)],_0x4e0f02(0x107));return{'journeyName':_0x11e4df,'parentSegment':_0x305578};}export class JourneyListCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]='journey:list';[a27_0x5cdbb3(0x1da)]=a27_0x5cdbb3(0x149);async[a27_0x5cdbb3(0x1d1)](_0x3d5d13){const _0x1a3a7d=a27_0x5cdbb3,{options:_0x1f091b,args:_0x3faaad,tdx:_0x12103a}=_0x3d5d13,_0xc8da97=_0x3faaad[0x0],_0xfcc7f5=_0x1f091b[_0x1a3a7d(0x141)];if(!_0xfcc7f5)return console[_0x1a3a7d(0x1e3)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x1a3a7d(0x1e3)](_0x1a3a7d(0x148)),0x1;const _0x282e04=await withSpinner(_0x1a3a7d(0x18a),()=>_0x12103a[_0x1a3a7d(0x119)][_0x1a3a7d(0x100)](_0xfcc7f5),{'verbose':_0x1f091b[_0x1a3a7d(0x130)]}),_0x238745=_0x282e04[_0x1a3a7d(0x1ab)];_0x1f091b[_0x1a3a7d(0x130)]&&(console[_0x1a3a7d(0x1e3)](_0x1a3a7d(0x106)+_0xfcc7f5+_0x1a3a7d(0x1b0)+_0x238745+')'),_0xc8da97&&console['error'](_0x1a3a7d(0x1ba)+_0xc8da97));const _0x55831e=await withSpinner(_0x1a3a7d(0x117),()=>_0x12103a[_0x1a3a7d(0x119)]['getParentFull'](_0x238745),{'verbose':_0x1f091b['verbose']}),_0x19e609=_0x55831e[_0x1a3a7d(0x1ab)],_0x992e65=_0x19e609[_0x1a3a7d(0x174)],_0x1b8f54=await withSpinner('Listing\x20journeys...',()=>_0x12103a[_0x1a3a7d(0x1d3)][_0x1a3a7d(0x1d6)](_0x238745,_0x992e65),{'verbose':_0x1f091b[_0x1a3a7d(0x130)]});let _0x20e5f3=_0x1b8f54[_0x1a3a7d(0x1ab)]['journeys'];const _0x5a9ac4=_0x1b8f54[_0x1a3a7d(0x1ab)]['folders'],_0x47749c=new Map();for(const _0x4c0978 of _0x5a9ac4){_0x47749c[_0x1a3a7d(0x108)](_0x4c0978['id'],_0x4c0978[_0x1a3a7d(0x1be)]);}if(_0xc8da97){const _0x411c47=globToRegex(_0xc8da97);_0x20e5f3=_0x20e5f3[_0x1a3a7d(0x15e)](_0x3fb999=>_0x411c47[_0x1a3a7d(0x14d)](_0x3fb999[_0x1a3a7d(0x19a)]));}console[_0x1a3a7d(0x1e3)](_0x1a3a7d(0x152)+_0x20e5f3['length']+_0x1a3a7d(0x109)+(_0x20e5f3[_0x1a3a7d(0x1e0)]!==0x1?'s':''));const _0x2c2b24=_0x27c24d=>{const _0x36ff93=_0x1a3a7d;return getConsoleNextUrl(_0x1f091b[_0x36ff93(0x1db)],'/app/ps/'+_0x238745+_0x36ff93(0x1b1)+_0x27c24d+_0x36ff93(0x179));};if(_0x1f091b[_0x1a3a7d(0x193)]==='table')await handleSDKOutput(_0x20e5f3,_0x1f091b);else{if(_0x1f091b[_0x1a3a7d(0x193)]==='json'){const _0x460571=_0x20e5f3[_0x1a3a7d(0x1cf)](_0x427917=>({..._0x427917,'url':_0x2c2b24(_0x427917['id'])}));await handleSDKOutput(_0x460571,_0x1f091b);}else{console['log']('['+_0xfcc7f5+']');const _0x32769a=new Map(),_0x4d26da=[];for(const _0x5bdc44 of _0x20e5f3){if(!_0x5bdc44[_0x1a3a7d(0x195)]||_0x5bdc44[_0x1a3a7d(0x195)]===_0x992e65)_0x4d26da[_0x1a3a7d(0x13e)](_0x5bdc44);else{const _0x564dc2=_0x32769a[_0x1a3a7d(0x138)](_0x5bdc44[_0x1a3a7d(0x195)])||[];_0x564dc2[_0x1a3a7d(0x13e)](_0x5bdc44),_0x32769a[_0x1a3a7d(0x108)](_0x5bdc44[_0x1a3a7d(0x195)],_0x564dc2);}}const _0x4e97de=(_0xcb9c6,_0x3f8c5f)=>_0xcb9c6[_0x1a3a7d(0x19a)][_0x1a3a7d(0x1de)](_0x3f8c5f['journeyBundleName'],undefined,{'sensitivity':'base'});_0x4d26da[_0x1a3a7d(0x161)](_0x4e97de);for(const _0x3f8ed1 of _0x4d26da){console[_0x1a3a7d(0x1d4)](formatJourneyItem(_0x3f8ed1,'',_0x2c2b24(_0x3f8ed1['id'])));}const _0x5bfaa8=[..._0x32769a['entries']()]['sort']((_0x557f95,_0x400cd3)=>{const _0x17f80d=_0x1a3a7d,_0x51dfd4=_0x47749c['get'](_0x557f95[0x0])||_0x557f95[0x0],_0x2e66b0=_0x47749c['get'](_0x400cd3[0x0])||_0x400cd3[0x0];return _0x51dfd4['localeCompare'](_0x2e66b0,undefined,{'sensitivity':_0x17f80d(0x103)});});for(const [_0x14bd02,_0x2b3884]of _0x5bfaa8){const _0x1777a9=_0x47749c[_0x1a3a7d(0x138)](_0x14bd02)||_0x14bd02;console[_0x1a3a7d(0x1d4)]('📁\x20'+_0x1777a9),_0x2b3884['sort'](_0x4e97de);for(const _0xe31129 of _0x2b3884){console[_0x1a3a7d(0x1d4)](formatJourneyItem(_0xe31129,'\x20\x20',_0x2c2b24(_0xe31129['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x5cdbb3(0x12e);[a27_0x5cdbb3(0x1da)]=a27_0x5cdbb3(0x1a6);async[a27_0x5cdbb3(0x1d1)](_0x54a590){const _0x45701e=a27_0x5cdbb3,{options:_0x371bd2,args:_0x461384,tdx:_0x318dc6}=_0x54a590,_0x5cb4cf=_0x461384[0x0];if(!_0x5cb4cf)return console[_0x45701e(0x1e3)](_0x45701e(0x142)),console[_0x45701e(0x1e3)](_0x45701e(0x18b)),console[_0x45701e(0x1e3)](_0x45701e(0x15d)),console['error'](_0x45701e(0xf7)),0x1;_0x371bd2[_0x45701e(0x130)]&&console[_0x45701e(0x1e3)]('Input:\x20'+_0x5cb4cf);const {journeyId:_0x3ab05d,parentSegmentId:_0x5855c8}=await resolveJourneyIdFromInput(_0x5cb4cf,_0x371bd2,_0x318dc6);if(_0x371bd2[_0x45701e(0x15f)]){const _0xd44576=getConsoleNextUrl(_0x371bd2[_0x45701e(0x1db)],_0x45701e(0x1df)+_0x5855c8+_0x45701e(0x1b1)+_0x3ab05d+'/j/da/je');return console['error'](a27_0x11882f[_0x45701e(0x1b8)]('✔')+'\x20Opening\x20'+a27_0x11882f[_0x45701e(0x128)](_0xd44576)),openBrowser(_0xd44576),0x0;}const _0x1c5a29=await withSpinner('Getting\x20journey\x20details...',()=>_0x318dc6['journey'][_0x45701e(0xf1)](_0x3ab05d),{'verbose':_0x371bd2[_0x45701e(0x130)]}),_0x122c20=_0x1c5a29[_0x45701e(0x1ab)],_0x2400f9=_0x371bd2[_0x45701e(0x12c)];let _0x2ae812;if(_0x2400f9)try{const _0x1a7680=await withSpinner(_0x45701e(0x1c9),()=>_0x318dc6[_0x45701e(0x1d3)][_0x45701e(0x16d)](_0x3ab05d),{'verbose':_0x371bd2[_0x45701e(0x130)]});_0x2ae812=_0x1a7680[_0x45701e(0x1ab)];}catch{_0x371bd2['verbose']&&console[_0x45701e(0x1e3)](_0x45701e(0x14f));}const _0x4098e3=getConsoleNextUrl(_0x371bd2['site'],_0x45701e(0x1df)+_0x5855c8+_0x45701e(0x1b1)+_0x3ab05d+_0x45701e(0x1a1)),_0x4af42d={'id':_0x122c20['id'],'name':_0x122c20[_0x45701e(0x145)]['name'],'description':_0x122c20[_0x45701e(0x145)]['description'],'state':_0x122c20[_0x45701e(0x145)]['state'],'paused':_0x122c20[_0x45701e(0x145)][_0x45701e(0x111)],'reentry_mode':_0x122c20['attributes'][_0x45701e(0x10f)],'stages':_0x122c20['attributes']['journeyStages']?.[_0x45701e(0x1e0)]||0x0,..._0x122c20[_0x45701e(0x145)][_0x45701e(0x11c)]&&{'goal':_0x122c20[_0x45701e(0x145)][_0x45701e(0x11c)][_0x45701e(0x1be)]},..._0x2ae812&&{'statistics':{'size':_0x2ae812[_0x45701e(0x180)],'entered':_0x2ae812[_0x45701e(0xfe)],'goal_achieved':_0x2ae812[_0x45701e(0x1f0)],'completion_rate':_0x2ae812[_0x45701e(0x1d0)],'exit_or_jump':_0x2ae812[_0x45701e(0x13f)],'exit_or_jump_rate':_0x2ae812[_0x45701e(0x113)],'stages':_0x2ae812['stages']}},'url':_0x4098e3};return await handleSingleObjectOutput(_0x4af42d,_0x371bd2),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]='journey:stats';[a27_0x5cdbb3(0x1da)]=a27_0x5cdbb3(0x183);async[a27_0x5cdbb3(0x1d1)](_0x560760){const _0x252742=a27_0x5cdbb3,{options:_0x9852ec,args:_0x27aed0,tdx:_0x3d3ba2}=_0x560760,_0x3c56f6=_0x27aed0[0x0];if(!requireNameOrPath(_0x3c56f6))return 0x1;_0x9852ec[_0x252742(0x130)]&&console[_0x252742(0x1e3)](_0x252742(0x172)+_0x3c56f6);const _0x3bda79=_0x9852ec,_0x28dcb5=_0x3bda79[_0x252742(0x14c)],_0x34cdb7=_0x3bda79['to'],_0x457b7c=_0x3bda79[_0x252742(0x137)],_0x3aff2f=_0x3bda79['stage'];_0x457b7c&&!_0x28dcb5&&!_0x34cdb7&&console[_0x252742(0x1e3)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x5c8cc4=_0x457b7c?withJsonFormat(_0x9852ec):_0x9852ec,{journeyId:_0x2fead4,journeyName:_0x357a7b}=await resolveJourneyIdFromInput(_0x3c56f6,_0x5c8cc4,_0x3d3ba2),_0x23985a=_0x28dcb5||_0x34cdb7?{'from':_0x28dcb5,'to':_0x34cdb7}:undefined,_0x4ef75d=await withSpinner(_0x252742(0x1c9),()=>Promise[_0x252742(0x1d5)]([_0x3d3ba2[_0x252742(0x1d3)]['getJourney'](_0x2fead4),_0x3d3ba2[_0x252742(0x1d3)][_0x252742(0x16d)](_0x2fead4,_0x23985a)]),{'verbose':_0x5c8cc4[_0x252742(0x130)]}),[_0x20022c,_0x51baa2]=_0x4ef75d[_0x252742(0x1ab)];if(!_0x51baa2||_0x51baa2[_0x252742(0x1ee)]===null)return console[_0x252742(0x1e3)](_0x252742(0x1a9)+_0x357a7b),console[_0x252742(0x1e3)](_0x252742(0x1c3)),0x0;const _0x1fa849=buildStageNameMap(_0x20022c),_0x56ed25=!!(_0x23985a&&_0x51baa2[_0x252742(0x159)]?.[_0x252742(0x1e0)]),_0xab29ac={'stageNameMap':_0x1fa849,'hasPeriod':_0x56ed25,'includeHistory':!!_0x457b7c};if(_0x3aff2f&&_0x51baa2['stages']){const _0x5b3dd3=_0x51baa2['stages'][_0x252742(0x118)](_0x498fe6=>{const _0x5d72a6=_0x252742,_0x5642f4=_0x1fa849[_0x5d72a6(0x138)](_0x498fe6['id'])??'';return _0x5642f4['toLowerCase']()===_0x3aff2f[_0x5d72a6(0xf9)]();});if(_0x5b3dd3)return await handleSingleObjectOutput(formatStageStats(_0x5b3dd3,_0xab29ac),_0x5c8cc4),0x0;const _0x4e08b6=_0x51baa2[_0x252742(0x168)]['map'](_0x353045=>_0x1fa849[_0x252742(0x138)](_0x353045['id'])??_0x353045['id']);return console[_0x252742(0x1e3)]('Error:\x20Stage\x20\x22'+_0x3aff2f+_0x252742(0x16f)),console[_0x252742(0x1e3)]('Available\x20stages:\x20'+_0x4e08b6[_0x252742(0x10e)](',\x20')),0x1;}const _0x18c4e1=_0x51baa2[_0x252742(0x168)]?.['map'](_0x5db1a8=>formatStageStats(_0x5db1a8,_0xab29ac)),_0x1ce26d=assembleJourneyStats(_0x51baa2,{'from':_0x28dcb5,'to':_0x34cdb7,'includeHistory':_0x457b7c});return await this[_0x252742(0x13b)](_0x1ce26d,_0x18c4e1??[],_0x5c8cc4),0x0;}async['renderStats'](_0x1fc171,_0x2e78ea,_0x36bd6c){const _0x3b66f1=a27_0x5cdbb3,_0x1315c0=_0x36bd6c[_0x3b66f1(0x193)]===_0x3b66f1(0x110)||_0x36bd6c['format']===_0x3b66f1(0x1ec)||_0x36bd6c[_0x3b66f1(0x110)]||_0x36bd6c[_0x3b66f1(0x1ec)];if(_0x1315c0){_0x1fc171[_0x3b66f1(0x168)]=_0x2e78ea,await handleSingleObjectOutput(_0x1fc171,_0x36bd6c);return;}await handleSingleObjectOutput(_0x1fc171,_0x36bd6c);for(const _0x343523 of _0x2e78ea){console['log'](''),console[_0x3b66f1(0x1d4)](String(a27_0x11882f['cyan'][_0x3b66f1(0x151)]('['+_0x343523['name']+']'))+a27_0x11882f['dim']('\x20'+_0x343523['id']));const {id:_0x36e7f2,name:_0x2a9fca,..._0x8ae207}=_0x343523;await handleSingleObjectOutput(_0x8ae207,_0x36bd6c);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]=a27_0x5cdbb3(0x165);['description']=a27_0x5cdbb3(0x169);async['execute'](_0x2ca8b5){const _0x11c318=a27_0x5cdbb3,{options:_0x5bf151,args:_0x39138c,tdx:_0x1d56b5}=_0x2ca8b5,_0x5dc996=_0x39138c[0x0];if(!requireNameOrPath(_0x5dc996))return 0x1;_0x5bf151[_0x11c318(0x130)]&&console[_0x11c318(0x1e3)](_0x11c318(0x172)+_0x5dc996);const _0x396d6c=_0x5bf151,_0x39f2f1=_0x396d6c[_0x11c318(0xf5)],_0x5c0dbe=_0x396d6c[_0x11c318(0x14c)],_0xa99ba0=_0x396d6c['to'],_0x13d5e7=_0x396d6c[_0x11c318(0x17d)];if(_0x39f2f1&&_0x39f2f1!=='conversion'&&_0x39f2f1!==_0x11c318(0x173))return console[_0x11c318(0x1e3)]('Error:\x20Invalid\x20--type\x20\x22'+_0x39f2f1+_0x11c318(0x115)),0x1;const _0x1b25e1=withJsonFormat(_0x5bf151),{journeyId:_0x1ed140,journeyName:_0x230e79}=await resolveJourneyIdFromInput(_0x5dc996,_0x1b25e1,_0x1d56b5),_0x4c5ae4={'type':_0x39f2f1,'from':_0x5c0dbe,'to':_0xa99ba0,'limit':_0x13d5e7},_0x28e2af=await withSpinner(_0x11c318(0x1e8),()=>_0x1d56b5[_0x11c318(0x1d3)][_0x11c318(0x104)](_0x1ed140,_0x4c5ae4),{'verbose':_0x1b25e1[_0x11c318(0x130)]}),_0x2be62d=_0x28e2af[_0x11c318(0x1ab)],_0x1ebbd4=_0x2be62d['conversion']&&(_0x2be62d[_0x11c318(0x1c0)][_0x11c318(0x1ad)][_0x11c318(0x1e0)]>0x0||_0x2be62d[_0x11c318(0x1c0)][_0x11c318(0x16a)]['length']>0x0),_0x23d587=_0x2be62d[_0x11c318(0x173)]&&_0x2be62d[_0x11c318(0x173)]['length']>0x0;if(!_0x1ebbd4&&!_0x23d587)return console[_0x11c318(0x1e3)](_0x11c318(0x17f)+_0x230e79),console[_0x11c318(0x1e3)](_0x11c318(0x1b5)),_0x5c0dbe&&_0xa99ba0&&console[_0x11c318(0x1e3)](_0x11c318(0x13d)),0x0;return await handleSingleObjectOutput(_0x2be62d,_0x1b25e1),0x0;}}function formatStageStats(_0xaa366f,_0x8944c2){const _0x13373d=a27_0x5cdbb3,_0x3daa5f=_0x8944c2['hasPeriod']&&_0xaa366f['history']?.[_0x13373d(0x1e0)]?aggregateStageHistory(_0xaa366f[_0x13373d(0x159)]):{'size':_0xaa366f['size'],'entered':_0xaa366f[_0x13373d(0xfe)],'milestone':_0xaa366f[_0x13373d(0x190)],'milestone_rate':_0xaa366f[_0x13373d(0x1a5)],'exit_or_jump':_0xaa366f['exitOrJumpSize'],'exit_or_jump_rate':_0xaa366f[_0x13373d(0x113)]},_0x8d9762={'id':_0xaa366f['id'],'name':_0x8944c2[_0x13373d(0x18c)][_0x13373d(0x138)](_0xaa366f['id'])??_0xaa366f['id'],..._0x3daa5f};return _0x8944c2[_0x13373d(0x155)]&&_0x8944c2[_0x13373d(0x137)]&&_0xaa366f[_0x13373d(0x159)]&&(_0x8d9762['history']=_0xaa366f[_0x13373d(0x159)]),_0x8d9762;}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a27_0x5cdbb3(0x1da)]='Pause\x20a\x20running\x20journey';async[a27_0x5cdbb3(0x1d1)](_0x37340f){const _0x251f60=a27_0x5cdbb3,{options:_0x3e6250,args:_0x437f62,tdx:_0x19b0d2}=_0x37340f,_0x276b06=_0x437f62[0x0];if(!requireNameOrPath(_0x276b06))return 0x1;_0x3e6250[_0x251f60(0x130)]&&console['error']('Input:\x20'+_0x276b06);const {journeyId:_0x5988e3,journeyName:_0x58b4ad}=await resolveJourneyIdFromInput(_0x276b06,_0x3e6250,_0x19b0d2);if(!_0x3e6250[_0x251f60(0x19f)]){const _0x609649=await confirm(_0x251f60(0x194)+_0x58b4ad+'\x22?');if(!_0x609649)return console[_0x251f60(0x1e3)]('Cancelled'),0x0;}const _0x34d8bb=await withSpinner('Pausing\x20journey...',()=>_0x19b0d2['journey'][_0x251f60(0x175)](_0x5988e3),{'verbose':_0x3e6250['verbose']}),_0x49b0ba=_0x34d8bb[_0x251f60(0x1ab)];return console['error'](_0x251f60(0x15c)+_0x49b0ba['attributes']['name']+_0x251f60(0x12b)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]='journey:resume';['description']=a27_0x5cdbb3(0x121);async[a27_0x5cdbb3(0x1d1)](_0xc42e8e){const _0x21a109=a27_0x5cdbb3,{options:_0x5af522,args:_0x56b079,tdx:_0x4c6148}=_0xc42e8e,_0x2770b1=_0x56b079[0x0];if(!requireNameOrPath(_0x2770b1))return 0x1;_0x5af522[_0x21a109(0x130)]&&console[_0x21a109(0x1e3)](_0x21a109(0x172)+_0x2770b1);const {journeyId:_0xfacbbd,journeyName:_0x187e85}=await resolveJourneyIdFromInput(_0x2770b1,_0x5af522,_0x4c6148);if(!_0x5af522['yes']){const _0x2c5e01=await confirm(_0x21a109(0x126)+_0x187e85+'\x22?');if(!_0x2c5e01)return console[_0x21a109(0x1e3)](_0x21a109(0x1eb)),0x0;}const _0x29168e=await withSpinner(_0x21a109(0x134),()=>_0x4c6148[_0x21a109(0x1d3)]['resume'](_0xfacbbd),{'verbose':_0x5af522[_0x21a109(0x130)]}),_0x32b90f=_0x29168e[_0x21a109(0x1ab)];return console[_0x21a109(0x1e3)]('✔\x20Journey\x20\x22'+_0x32b90f[_0x21a109(0x145)][_0x21a109(0x1be)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]=a27_0x5cdbb3(0x1d8);[a27_0x5cdbb3(0x1da)]=a27_0x5cdbb3(0x11e);async['execute'](_0x4c4766){const _0x2d50e9=a27_0x5cdbb3,{options:_0x526498,args:_0x5b8e8e,tdx:_0x27ba7b}=_0x4c4766,_0x440101=_0x526498,_0x275ac5=_0x5b8e8e[0x0],_0x21b6d4=_0x275ac5&&isYamlFilePath(_0x275ac5),_0x11396a=await resolveTarget({'arg':_0x21b6d4?_0x275ac5:undefined,'contextParent':_0x526498[_0x2d50e9(0x141)],'cwd':process[_0x2d50e9(0x17a)]()});if(!isSuccessfulResolution(_0x11396a))return _0x11396a[_0x2d50e9(0x1d9)]===_0x2d50e9(0xf0)?(console[_0x2d50e9(0x1e3)](a27_0x11882f[_0x2d50e9(0x1e7)](_0x2d50e9(0x157))),console[_0x2d50e9(0x1e3)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x2d50e9(0x1e3)](_0x2d50e9(0x1dd)),console[_0x2d50e9(0x1e3)](_0x2d50e9(0x1c6)),console[_0x2d50e9(0x1e3)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x2d50e9(0x1e3)](a27_0x11882f[_0x2d50e9(0x1bd)](_0x2d50e9(0xf4)+_0x11396a[_0x2d50e9(0xfb)]+'\x0a')),_0x11396a[_0x2d50e9(0x1af)]&&console['error'](a27_0x11882f[_0x2d50e9(0x128)](_0x11396a[_0x2d50e9(0x1af)]))),0x1;let _0x23d0da=_0x21b6d4?undefined:_0x275ac5,_0x45b180,_0x38f261;_0x11396a['type']===_0x2d50e9(0x1c4)&&(_0x23d0da=_0x11396a['resourceName'],_0x45b180=_0x11396a[_0x2d50e9(0x11b)],_0x38f261=_0x11396a[_0x2d50e9(0x19e)]);const _0x50c46b=_0x11396a['parentName'],_0x4583ed=_0x11396a[_0x2d50e9(0x1b9)];_0x440101[_0x2d50e9(0x130)]&&(console['error'](_0x2d50e9(0x106)+_0x50c46b),console[_0x2d50e9(0x1e3)]('Target\x20directory:\x20'+_0x4583ed),_0x23d0da&&console[_0x2d50e9(0x1e3)](_0x2d50e9(0x101)+_0x23d0da),_0x45b180&&console[_0x2d50e9(0x1e3)]('Target\x20file:\x20'+_0x45b180),_0x38f261&&console['error'](_0x2d50e9(0x1cc)+_0x38f261));const _0x42e622=await withSpinner(_0x2d50e9(0x18a),()=>_0x27ba7b[_0x2d50e9(0x119)][_0x2d50e9(0x100)](_0x50c46b),{'verbose':_0x526498[_0x2d50e9(0x130)]}),_0x159b06=_0x42e622[_0x2d50e9(0x1ab)],{journeys:_0x31d116,folders:_0x3f7d59}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x2f940c=_0x2d50e9,[_0x5a8b7c,_0x5930d0]=await Promise[_0x2f940c(0x1d5)]([_0x27ba7b['journey'][_0x2f940c(0x14b)](_0x159b06,undefined,{'includeAllVersions':!![]}),_0x27ba7b[_0x2f940c(0x119)][_0x2f940c(0x186)](_0x159b06)]);return{'journeys':_0x5a8b7c,'folders':_0x5930d0};},{'verbose':_0x526498[_0x2d50e9(0x130)]})[_0x2d50e9(0x167)](_0x3d7048=>_0x3d7048['data']);let _0x4775f3=_0x31d116;const _0x59b123=buildFolderIdToPathMap(_0x3f7d59);if(_0x23d0da){const _0x46896a=_0x4775f3[_0x2d50e9(0x15e)](_0x5c8609=>_0x5c8609[_0x2d50e9(0x19a)][_0x2d50e9(0xf9)]()===_0x23d0da['toLowerCase']());if(_0x46896a[_0x2d50e9(0x1e0)]===0x0)return console[_0x2d50e9(0x1e3)]('Error:\x20Journey\x20not\x20found:\x20'+_0x23d0da),console[_0x2d50e9(0x1e3)](_0x2d50e9(0xfa)),0x1;_0x4775f3=_0x46896a;}if(_0x38f261!==undefined){const _0x5bec2d=_0x4775f3[_0x2d50e9(0x15e)](_0x4ed409=>{const _0x596956=_0x2d50e9,_0xed78=_0x4ed409[_0x596956(0x195)]?_0x59b123['get'](_0x4ed409[_0x596956(0x195)])||'':'';return _0xed78===_0x38f261;});if(_0x5bec2d[_0x2d50e9(0x1e0)]===0x0&&_0x4775f3['length']>0x0){console[_0x2d50e9(0x1e3)](_0x2d50e9(0x160)+_0x23d0da+_0x2d50e9(0x170)+(_0x38f261||'root\x20folder')),console[_0x2d50e9(0x1e3)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x523bd5 of _0x4775f3){const _0x5052af=_0x523bd5[_0x2d50e9(0x195)]?_0x59b123['get'](_0x523bd5[_0x2d50e9(0x195)])||'':'';console[_0x2d50e9(0x1e3)](_0x2d50e9(0xff)+(_0x5052af||_0x2d50e9(0x19c))+'/'+_0x523bd5[_0x2d50e9(0x19a)]);}return 0x1;}_0x4775f3=_0x5bec2d;}if(_0x4775f3[_0x2d50e9(0x1e0)]===0x0)return console[_0x2d50e9(0x1e3)](_0x2d50e9(0x127)),0x0;const _0x17d7c1=new Map();for(const _0x3c86a5 of _0x4775f3){const _0x50c528=_0x3c86a5[_0x2d50e9(0x1ed)];!_0x17d7c1['has'](_0x50c528)&&_0x17d7c1[_0x2d50e9(0x108)](_0x50c528,[]),_0x17d7c1[_0x2d50e9(0x138)](_0x50c528)[_0x2d50e9(0x13e)](_0x3c86a5);}for(const _0x508365 of _0x17d7c1[_0x2d50e9(0x1a3)]()){_0x508365[_0x2d50e9(0x161)]((_0x307c90,_0x10c39b)=>(_0x307c90['versionNumber']||0x0)-(_0x10c39b[_0x2d50e9(0xf8)]||0x0));}const _0x5d8a8a=[],{idToEmailMap:_0x191b88,connectionIdToNameMap:_0x2a74a7}=await withSpinner(_0x2d50e9(0x1d7),async()=>{const _0x4f5237=_0x2d50e9,[_0x1e3f70,_0x43a67b]=await Promise['all']([_0x27ba7b[_0x4f5237(0x1a2)][_0x4f5237(0x10a)](),_0x27ba7b[_0x4f5237(0x1c8)][_0x4f5237(0x14e)]()]);return{'idToEmailMap':_0x1e3f70,'connectionIdToNameMap':_0x43a67b};},{'verbose':_0x526498[_0x2d50e9(0x130)]})[_0x2d50e9(0x167)](_0x45b699=>_0x45b699[_0x2d50e9(0x1ab)]);for(const _0xb0d0ce of _0x17d7c1[_0x2d50e9(0x1a3)]()){const _0x36813a=_0xb0d0ce[0x0][_0x2d50e9(0x19a)],_0x204d62=_0xb0d0ce[0x0][_0x2d50e9(0x195)],_0x2947f5=_0x204d62?_0x59b123['get'](_0x204d62)||'':'',_0xbc7acb=_0x2947f5?a27_0x1dc4f8[_0x2d50e9(0x10e)](_0x4583ed,_0x2947f5):_0x4583ed,_0x30e90e=_0x45b180||a27_0x1dc4f8[_0x2d50e9(0x10e)](_0xbc7acb,sanitizeFileName(_0x36813a)+'.yml');let _0x451ee6,_0x402cc3;if(existsSync(_0x30e90e))try{const _0x2cae67=readFileSync(_0x30e90e,_0x2d50e9(0x135)),_0x209d8d=parseYamlString(_0x2cae67);_0x402cc3=_0x209d8d,_0x451ee6=buildRuleToNameMapping(_0x209d8d),_0x440101[_0x2d50e9(0x130)]&&_0x451ee6[_0x2d50e9(0x180)]>0x0&&console['error'](_0x2d50e9(0x1cb)+_0x451ee6['size']+_0x2d50e9(0x1b2)+_0x36813a);}catch(_0x3d91c0){_0x440101[_0x2d50e9(0x130)]&&console[_0x2d50e9(0x1e3)](_0x2d50e9(0x1e5)+_0x3d91c0[_0x2d50e9(0xfb)]);}const _0xacbbd=[],_0x4d1e42=new Set(),_0x322117=new Map(),_0x2539bf=new Map(),_0x3f09e1=new Set(),_0x32cbb6=new Map(),_0x479f5a=new Map(),_0x140ed2=createJumpTargetCache();await withProgressSpinner(_0x2d50e9(0x181)+_0x36813a+'...',async _0x52b440=>{const _0x1c66a4=_0x2d50e9;for(const _0x9cf8bd of _0xb0d0ce){const _0x18a53c=_0xb0d0ce[_0x1c66a4(0x1e0)]>0x1?_0x9cf8bd[_0x1c66a4(0x19a)]+'\x20v'+(_0x9cf8bd['versionNumber']||0x1):_0x9cf8bd[_0x1c66a4(0x19a)];_0x52b440[_0x1c66a4(0x1c2)](_0x1c66a4(0x181)+_0x18a53c);const _0x296ca0=await _0x27ba7b[_0x1c66a4(0x1d3)][_0x1c66a4(0xf1)](_0x9cf8bd['id']),_0xf76e3b=_0x296ca0['attributes']?.[_0x1c66a4(0x196)],_0x2639cb={'resolveSegment':async _0x4c5861=>{const _0x57e85f=_0x1c66a4;if(!_0xf76e3b)return{'name':_0x4c5861,'isJourneyLocal':![]};const _0x5f254e=_0x322117[_0x57e85f(0x138)](_0x4c5861);if(_0x5f254e)return _0x5f254e;try{const _0x59191a=await _0x27ba7b[_0x57e85f(0x119)][_0x57e85f(0x1b6)](_0xf76e3b,_0x4c5861),_0x21f537=_0x59191a[_0x57e85f(0x11a)]===SEGMENT_KIND_JOURNEY;let _0x21aac0,_0x15c6a7=_0x59191a['name'];if(_0x21f537&&_0x59191a[_0x57e85f(0x144)]){const _0x4f1788=await segmentResponseToDef(_0x59191a,{'resolveSegmentName':async _0x40e873=>{const _0x5abcda=_0x57e85f,_0x448cdd=_0x322117['get'](_0x40e873);if(_0x448cdd)return _0x448cdd['name'];const _0x2d3fc6=await _0x2639cb[_0x5abcda(0x150)](_0x40e873);return _0x2d3fc6['name'];}}),_0xefb06b=_0x4f1788[_0x57e85f(0x144)];_0x21aac0={'description':_0x59191a[_0x57e85f(0x1da)],'rule':_0xefb06b};const _0x49253c=serializeRule(_0xefb06b),_0x182241=_0x2539bf[_0x57e85f(0x138)](_0x49253c);if(_0x182241)_0x15c6a7=_0x182241,_0x21aac0=undefined,_0x440101['verbose']&&console['error'](_0x57e85f(0x11d)+_0x59191a[_0x57e85f(0x1be)]+'\x20->\x20'+_0x182241);else{let _0x15978d=![];if(_0x451ee6){const _0xc90df5=_0x451ee6[_0x57e85f(0x138)](_0x49253c);if(_0xc90df5){const _0x1d6955=_0xc90df5[_0x57e85f(0x118)](_0x45d3b8=>!_0x4d1e42[_0x57e85f(0x17e)](_0x45d3b8));_0x1d6955&&(_0x15c6a7=_0x1d6955,_0x4d1e42[_0x57e85f(0x12f)](_0x1d6955),_0x2539bf[_0x57e85f(0x108)](_0x49253c,_0x1d6955),_0x15978d=!![],_0x440101[_0x57e85f(0x130)]&&console[_0x57e85f(0x1e3)](_0x57e85f(0x154)+_0x1d6955+_0x57e85f(0x1f2)));}}if(!_0x15978d){const _0x40193b=generateJourneyLocalName(_0x59191a['name']);_0x40193b&&(_0x15c6a7=_0x40193b);let _0x3fb245=_0x15c6a7,_0x5cd94d=0x2;while(_0x4d1e42[_0x57e85f(0x17e)](_0x3fb245)){_0x3fb245=_0x15c6a7+'_'+_0x5cd94d,_0x5cd94d++;}_0x4d1e42[_0x57e85f(0x12f)](_0x3fb245),_0x2539bf[_0x57e85f(0x108)](_0x49253c,_0x3fb245),_0x15c6a7=_0x3fb245;}}}const _0x288695={'name':_0x15c6a7,'isJourneyLocal':_0x21f537,'definition':_0x21aac0};return _0x322117['set'](_0x4c5861,_0x288695),_0x288695;}catch(_0x6c16c4){return _0x526498[_0x57e85f(0x130)]&&console[_0x57e85f(0x1e3)](_0x57e85f(0x19b)+_0x4c5861+':\x20'+_0x6c16c4[_0x57e85f(0xfb)]),{'name':_0x4c5861,'isJourneyLocal':![]};}},'resolveActivation':async _0x2c9583=>{const _0x16cbf5=_0x1c66a4,_0x1cb094=_0x32cbb6['get'](_0x2c9583);if(_0x1cb094)return _0x1cb094;try{const _0x372f2a=await _0x27ba7b['journey']['getActivation'](_0x9cf8bd['id'],_0x2c9583),_0x1c3f29=journeyActivationStepToYaml(_0x372f2a,_0x191b88,_0x2a74a7),_0x443352=JSON['stringify']({'name':_0x1c3f29['name'],'connection':_0x1c3f29[_0x16cbf5(0x1c8)],'connector_config':_0x1c3f29['connector_config']}),_0x4f27d6=_0x479f5a[_0x16cbf5(0x138)](_0x443352);if(_0x4f27d6){const _0x36ab61={'name':_0x4f27d6,'isJourneyLocal':!![],'definition':_0x1c3f29};return _0x32cbb6[_0x16cbf5(0x108)](_0x2c9583,_0x36ab61),_0x36ab61;}const _0x40a349=_0x372f2a[_0x16cbf5(0x145)][_0x16cbf5(0xf6)][_0x16cbf5(0x1be)]||_0x2c9583,_0x22981d=sanitizeYamlKey(_0x40a349)||'activation_'+_0x2c9583;let _0x5987d3=_0x22981d,_0x4aa733=0x2;while(_0x3f09e1[_0x16cbf5(0x17e)](_0x5987d3)){_0x5987d3=_0x22981d+'_'+_0x4aa733,_0x4aa733++;}_0x3f09e1[_0x16cbf5(0x12f)](_0x5987d3),_0x479f5a['set'](_0x443352,_0x5987d3);const _0x25817b={'name':_0x5987d3,'isJourneyLocal':!![],'definition':_0x1c3f29};return _0x32cbb6[_0x16cbf5(0x108)](_0x2c9583,_0x25817b),_0x25817b;}catch(_0x53146d){return _0x526498['verbose']&&console[_0x16cbf5(0x1e3)](_0x16cbf5(0x153)+_0x2c9583+':\x20'+_0x53146d[_0x16cbf5(0xfb)]),{'name':_0x2c9583,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x2ce204,_0x442898)=>{return resolveJumpTarget(_0x2ce204,_0x442898,_0x140ed2,_0x4ff8dc=>_0x27ba7b['journey']['getJourney'](_0x4ff8dc));}},_0x7bf75d=await journeyResponseToDef(_0x296ca0,_0x2639cb);_0xacbbd[_0x1c66a4(0x13e)]({'item':_0x9cf8bd,'yaml':_0x7bf75d});}},{'verbose':_0x526498['verbose']});const _0xb021af=await _0x27ba7b[_0x2d50e9(0x1d3)]['getLatestJourneyId'](_0xb0d0ce[0x0]['journeyBundleId']),_0x21580e=buildMergedJourneyDef(_0xacbbd,_0x451ee6,_0xb021af),_0xa48425=normalizeJourneyDef(_0x21580e,_0x402cc3),_0x2a813c=toYamlString(_0xa48425),_0xb2e36b=_0x45b180||a27_0x1dc4f8['join'](_0xbc7acb,sanitizeFileName(_0x36813a)+'.yml');!_0x45b180&&_0x2947f5&&!existsSync(_0xbc7acb)&&mkdirSync(_0xbc7acb,{'recursive':!![]});const _0x51c913=a27_0x1dc4f8[_0x2d50e9(0x1e4)](process[_0x2d50e9(0x17a)](),_0xb2e36b);if(existsSync(_0xb2e36b)){const _0x2e0f46=readFileSync(_0xb2e36b,_0x2d50e9(0x135)),_0x358d37=generateDiff(_0x2e0f46,_0x2a813c),_0x359e80=hasChanges(_0x358d37);_0x5d8a8a['push']({'relativePath':_0x51c913,'absolutePath':_0xb2e36b,'content':_0x2a813c,'isNew':![],'hasChanges':_0x359e80,'diff':_0x359e80?formatDiffWithColors(_0x358d37):undefined});}else _0x5d8a8a['push']({'relativePath':_0x51c913,'absolutePath':_0xb2e36b,'content':_0x2a813c,'isNew':!![],'hasChanges':![]});}const _0x3ed462=_0x5d8a8a['filter'](_0x1a430f=>_0x1a430f['isNew']),_0x2251d6=_0x5d8a8a[_0x2d50e9(0x15e)](_0x21d76a=>!_0x21d76a[_0x2d50e9(0x133)]&&_0x21d76a[_0x2d50e9(0x1dc)]),_0x51ae33=_0x5d8a8a[_0x2d50e9(0x15e)](_0x6f1fc=>!_0x6f1fc[_0x2d50e9(0x133)]&&!_0x6f1fc[_0x2d50e9(0x1dc)]),_0x16fadb=_0x4775f3[_0x2d50e9(0x1e0)],_0x1f6f59=_0x17d7c1['size'],_0x4e60a0=_0x16fadb>_0x1f6f59?'\x20('+_0x16fadb+'\x20versions)':'';console['error'](_0x2d50e9(0x18e)),console[_0x2d50e9(0x1e3)]('\x20\x20'+a27_0x11882f[_0x2d50e9(0x128)](_0x1f6f59+_0x2d50e9(0x143))+a27_0x11882f['dim'](_0x4e60a0)),console[_0x2d50e9(0x1e3)]('\x20\x20'+a27_0x11882f['green']('+\x20'+_0x3ed462[_0x2d50e9(0x1e0)]+_0x2d50e9(0x13a))),console[_0x2d50e9(0x1e3)]('\x20\x20'+a27_0x11882f[_0x2d50e9(0x1e7)]('~\x20'+_0x2251d6['length']+_0x2d50e9(0x124))),console['error']('\x20\x20'+a27_0x11882f[_0x2d50e9(0x1c5)]('=\x20'+_0x51ae33[_0x2d50e9(0x1e0)]+_0x2d50e9(0x1ae))),console['error'](_0x2d50e9(0x1ea)+a27_0x11882f[_0x2d50e9(0x128)](_0x4583ed)+'\x0a');if(_0x2251d6[_0x2d50e9(0x1e0)]>0x0)for(const _0x668a32 of _0x2251d6){console[_0x2d50e9(0x1e3)](_0x2d50e9(0x16c)+_0x668a32[_0x2d50e9(0x13c)]+'\x27:'),console[_0x2d50e9(0x1e3)]('─'['repeat'](0x3c)),console[_0x2d50e9(0x1e3)](_0x668a32[_0x2d50e9(0x176)]),console[_0x2d50e9(0x1e3)]('─'[_0x2d50e9(0x114)](0x3c));}if(_0x440101[_0x2d50e9(0x125)])return console['error'](a27_0x11882f[_0x2d50e9(0x1e7)](_0x2d50e9(0x15b))),0x0;if(_0x3ed462[_0x2d50e9(0x1e0)]===0x0&&_0x2251d6[_0x2d50e9(0x1e0)]===0x0)return console[_0x2d50e9(0x1e3)](a27_0x11882f[_0x2d50e9(0x1b8)](_0x2d50e9(0x18d))),saveSessionContext({'parent_segment':_0x50c46b},_0x440101[_0x2d50e9(0x177)]),console[_0x2d50e9(0x1e3)](a27_0x11882f['green'](_0x2d50e9(0x1c1)+a27_0x11882f['dim'](_0x2d50e9(0x1a4))+_0x2d50e9(0x187)+a27_0x11882f[_0x2d50e9(0x128)](_0x50c46b))),0x0;if(!_0x440101[_0x2d50e9(0x19f)]&&(_0x3ed462[_0x2d50e9(0x1e0)]>0x0||_0x2251d6[_0x2d50e9(0x1e0)]>0x0)){if(!isInteractive())return console[_0x2d50e9(0x1e3)](a27_0x11882f[_0x2d50e9(0x1bd)]('\x0aError:'),_0x2d50e9(0x146)),console[_0x2d50e9(0x1e3)](a27_0x11882f[_0x2d50e9(0x1c5)](_0x2d50e9(0x1bb))),0x1;const _0x48206a=await confirmKey(_0x2d50e9(0x1a8)+(_0x3ed462[_0x2d50e9(0x1e0)]+_0x2251d6[_0x2d50e9(0x1e0)])+_0x2d50e9(0x116));if(!_0x48206a)return console[_0x2d50e9(0x1e3)](a27_0x11882f[_0x2d50e9(0x1e7)](_0x2d50e9(0x1e9)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x4583ed)&&mkdirSync(_0x4583ed,{'recursive':!![]});const _0x521878=a27_0x1dc4f8[_0x2d50e9(0x10e)](_0x4583ed,_0x2d50e9(0x199));writeFileSync(_0x521878,createTdxConfigContent(_0x50c46b),'utf-8');for(const _0x302249 of _0x5d8a8a){(_0x302249['isNew']||_0x302249['hasChanges'])&&writeFileSync(_0x302249[_0x2d50e9(0xfd)],_0x302249[_0x2d50e9(0x11f)],_0x2d50e9(0x135));}return console['error'](a27_0x11882f[_0x2d50e9(0x1b8)](_0x2d50e9(0x1a7)+(_0x3ed462['length']+_0x2251d6[_0x2d50e9(0x1e0)])+'\x20journey\x20files\x20to\x20'+_0x4583ed)),saveSessionContext({'parent_segment':_0x50c46b},_0x440101[_0x2d50e9(0x177)]),console[_0x2d50e9(0x1e3)](a27_0x11882f[_0x2d50e9(0x1b8)](_0x2d50e9(0x1c1)+a27_0x11882f[_0x2d50e9(0x1c5)](_0x2d50e9(0x1a4))+_0x2d50e9(0x187)+a27_0x11882f[_0x2d50e9(0x128)](_0x50c46b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x5cdbb3(0x105);[a27_0x5cdbb3(0x1da)]=a27_0x5cdbb3(0x10c);async[a27_0x5cdbb3(0x1d1)](_0x22f9f6){const _0xc086fe=a27_0x5cdbb3,{options:_0x310176,args:_0xbfd725,tdx:_0x39e29e}=_0x22f9f6,_0x4d48f0=_0xbfd725[0x0];if(!requireNameOrPath(_0x4d48f0))return 0x1;_0x310176[_0xc086fe(0x130)]&&console[_0xc086fe(0x1e3)](_0xc086fe(0x172)+_0x4d48f0);const {journeyId:_0x296ad4}=await resolveJourneyIdFromInput(_0x4d48f0,_0x310176,_0x39e29e),_0x942936=await withSpinner(_0xc086fe(0x1cd),()=>_0x39e29e[_0xc086fe(0x1d3)]['getColumnMapping'](_0x296ad4),{'verbose':_0x310176['verbose']}),_0x539d3f=_0x942936[_0xc086fe(0x1ab)];return console[_0xc086fe(0x1d4)](_0xc086fe(0x12d)+_0x539d3f[_0xc086fe(0x132)]),console[_0xc086fe(0x1d4)](_0xc086fe(0x1bc)+_0x539d3f[_0xc086fe(0x1ef)]),await handleSDKOutput(_0x539d3f[_0xc086fe(0x166)],_0x310176),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a27_0x5cdbb3(0x1da)]='List\x20activations\x20for\x20a\x20journey';async['execute'](_0x3dbfcf){const _0x2102b9=a27_0x5cdbb3,{options:_0x42e58c,args:_0x4bac47,tdx:_0x40fcb4}=_0x3dbfcf,_0xc356f3=_0x4bac47[0x0];if(!requireNameOrPath(_0xc356f3))return 0x1;_0x42e58c[_0x2102b9(0x130)]&&console['error']('Input:\x20'+_0xc356f3);const {journeyId:_0x5b2a93}=await resolveJourneyIdFromInput(_0xc356f3,_0x42e58c,_0x40fcb4),_0x715791=await withSpinner(_0x2102b9(0x1e1),()=>_0x40fcb4[_0x2102b9(0x1d3)][_0x2102b9(0x14a)](_0x5b2a93),{'verbose':_0x42e58c[_0x2102b9(0x130)]}),_0x19b9e=_0x715791['data'];return console[_0x2102b9(0x1e3)]('Found\x20'+_0x19b9e['length']+_0x2102b9(0x156)+(_0x19b9e[_0x2102b9(0x1e0)]!==0x1?'s':'')),await handleSDKOutput(_0x19b9e,_0x42e58c),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]='journey:push';[a27_0x5cdbb3(0x1da)]=a27_0x5cdbb3(0x136);[a27_0x5cdbb3(0x198)]=new SegmentPushCommand();async[a27_0x5cdbb3(0x1d1)](_0x9d4f31){const _0x205283=a27_0x5cdbb3,_0x55ad76=_0x9d4f31[_0x205283(0x197)][0x0];let _0x38af72;if(_0x55ad76){const _0x53d940=await resolveTarget({'arg':_0x55ad76,'contextParent':_0x9d4f31[_0x205283(0x1aa)][_0x205283(0x141)],'cwd':process[_0x205283(0x17a)]()});isSuccessfulResolution(_0x53d940)&&_0x53d940[_0x205283(0xf5)]==='file'&&(_0x38af72=_0x53d940[_0x205283(0x11b)]);}const _0x5df996={..._0x9d4f31,'options':{..._0x9d4f31['options'],'journeysOnly':!![],..._0x38af72&&{'singleFilePath':_0x38af72}}};return this['segmentPushCommand'][_0x205283(0x1d1)](_0x5df996);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]='journey:versions';[a27_0x5cdbb3(0x1da)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x5cdbb3(0x1d1)](_0x9ce4d0){const _0x8b64e=a27_0x5cdbb3,{options:_0x1b49f7,args:_0x24075f,tdx:_0x470e39}=_0x9ce4d0,_0xa61fe0=_0x24075f[0x0];if(!requireNameOrPath(_0xa61fe0))return 0x1;if(_0x1b49f7[_0x8b64e(0x130)])console[_0x8b64e(0x1e3)](_0x8b64e(0x172)+_0xa61fe0);const {journeyId:_0x1ed483}=await resolveJourneyIdFromInput(_0xa61fe0,_0x1b49f7,_0x470e39),_0x1f2c46=await withSpinner('Listing\x20journey\x20versions...',()=>_0x470e39[_0x8b64e(0x1d3)][_0x8b64e(0x147)](_0x1ed483),{'verbose':_0x1b49f7[_0x8b64e(0x130)]}),{bundleName:_0x42f6a1,versions:_0x25e650,latestJourneyId:_0x2fdec3}=_0x1f2c46['data'];console[_0x8b64e(0x1e3)](_0x42f6a1+':\x20'+_0x25e650[_0x8b64e(0x1e0)]+_0x8b64e(0x184)+(_0x25e650['length']!==0x1?'s':''));const _0x2304a8=_0x25e650['map'](_0x838cae=>({'version':_0x838cae[_0x8b64e(0xf8)],'journey_id':_0x838cae[_0x8b64e(0x1ee)],'name':_0x838cae[_0x8b64e(0x1be)],'state':_0x838cae[_0x8b64e(0x1c7)],'paused':_0x838cae[_0x8b64e(0x111)],'latest':_0x838cae[_0x8b64e(0x1ee)]===_0x2fdec3,'created_at':_0x838cae[_0x8b64e(0x140)]}));return await handleSDKOutput(_0x2304a8,_0x1b49f7),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]=a27_0x5cdbb3(0x17b);[a27_0x5cdbb3(0x1da)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async['execute'](_0x37fcc3){const _0x33fd7d=a27_0x5cdbb3,{options:_0x1f90fa,args:_0x3a70f4,tdx:_0x1ccafa}=_0x37fcc3,_0x2012f8=_0x3a70f4[0x0];if(!requireNameOrPath(_0x2012f8))return 0x1;if(_0x1f90fa[_0x33fd7d(0x130)])console['error'](_0x33fd7d(0x172)+_0x2012f8);const {journeyId:_0x4e7959,journeyName:_0x1e23df}=await resolveJourneyIdFromInput(_0x2012f8,_0x1f90fa,_0x1ccafa);if(!_0x1f90fa[_0x33fd7d(0x19f)]){const _0x56d64c=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x1e23df+'\x22?');if(!_0x56d64c)return console[_0x33fd7d(0x1e3)](_0x33fd7d(0x1eb)),0x0;}const _0x432fa9=await withSpinner(_0x33fd7d(0x192),()=>_0x1ccafa[_0x33fd7d(0x1d3)][_0x33fd7d(0x16e)](_0x4e7959),{'verbose':_0x1f90fa[_0x33fd7d(0x130)]}),_0x4224ee=_0x432fa9[_0x33fd7d(0x1ab)];return console[_0x33fd7d(0x1e3)](a27_0x11882f[_0x33fd7d(0x1b8)]('✔')+'\x20Created\x20v'+_0x4224ee[_0x33fd7d(0x145)][_0x33fd7d(0xf8)]+'\x20(draft)\x20—\x20\x22'+_0x4224ee['attributes'][_0x33fd7d(0x1be)]+'\x22'),console[_0x33fd7d(0x1e3)](_0x33fd7d(0x1e2)+_0x4224ee['id']),await handleSingleObjectOutput({'id':_0x4224ee['id'],'name':_0x4224ee['attributes'][_0x33fd7d(0x1be)],'version':_0x4224ee[_0x33fd7d(0x145)][_0x33fd7d(0xf8)],'state':_0x4224ee[_0x33fd7d(0x145)][_0x33fd7d(0x1c7)],'bundle_id':_0x4224ee[_0x33fd7d(0x145)]['journeyBundleId'],'created_at':_0x4224ee[_0x33fd7d(0x145)][_0x33fd7d(0x140)]},_0x1f90fa),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x5cdbb3(0x1be)]=a27_0x5cdbb3(0x1a0);[a27_0x5cdbb3(0x1da)]=a27_0x5cdbb3(0x139);async[a27_0x5cdbb3(0x1d1)](_0x407f39){const _0x5ed306=a27_0x5cdbb3,{options:_0x4802fd,args:_0x4bfafa,tdx:_0x2c82c0}=_0x407f39,_0xf16e1=_0x4bfafa[0x0];if(!requireNameOrPath(_0xf16e1))return 0x1;const _0x9bb498=_0x4802fd[_0x5ed306(0x10b)];if(!_0x9bb498)return console['error'](_0x5ed306(0x1ac)),console['error'](_0x5ed306(0x1d2)),0x1;const _0xccddfd=parseInt(_0x9bb498,0xa);if(isNaN(_0xccddfd)||_0xccddfd<0x1)return console[_0x5ed306(0x1e3)](_0x5ed306(0x182)+_0x9bb498),0x1;if(_0x4802fd[_0x5ed306(0x130)])console[_0x5ed306(0x1e3)](_0x5ed306(0x172)+_0xf16e1+_0x5ed306(0x1f1)+_0xccddfd);const {journeyId:_0x52203a,parentSegmentId:_0x202f38}=await resolveJourneyIdFromInput(_0xf16e1,_0x4802fd,_0x2c82c0),_0xb6a5bf=await withSpinner(_0x5ed306(0xfc),()=>_0x2c82c0[_0x5ed306(0x1d3)][_0x5ed306(0x147)](_0x52203a),{'verbose':_0x4802fd['verbose']}),{versions:_0x1ee9de,latestJourneyId:_0x991f0e}=_0xb6a5bf['data'],_0x1c416a=_0x1ee9de[_0x5ed306(0x118)](_0x222d00=>_0x222d00[_0x5ed306(0xf8)]===_0xccddfd);if(!_0x1c416a){const _0x409e24=_0x1ee9de[_0x5ed306(0x1cf)](_0x1c2a8f=>'v'+_0x1c2a8f[_0x5ed306(0xf8)])['join'](',\x20');return console[_0x5ed306(0x1e3)]('Error:\x20Version\x20'+_0xccddfd+_0x5ed306(0x15a)+_0x409e24),0x1;}const _0xc53550=await withSpinner('Getting\x20version\x20'+_0xccddfd+_0x5ed306(0x189),()=>_0x2c82c0[_0x5ed306(0x1d3)][_0x5ed306(0xf1)](_0x1c416a['journeyId']),{'verbose':_0x4802fd['verbose']}),_0x4b676c=_0xc53550['data'],_0x57eabe=getConsoleNextUrl(_0x4802fd[_0x5ed306(0x1db)],_0x5ed306(0x1df)+_0x202f38+'/e/'+_0x1c416a[_0x5ed306(0x1ee)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x4b676c['id'],'name':_0x4b676c[_0x5ed306(0x145)]['name'],'version':_0x4b676c[_0x5ed306(0x145)]['versionNumber'],'description':_0x4b676c[_0x5ed306(0x145)]['description'],'state':_0x4b676c[_0x5ed306(0x145)][_0x5ed306(0x1c7)],'paused':_0x4b676c[_0x5ed306(0x145)]['paused'],'reentry_mode':_0x4b676c['attributes'][_0x5ed306(0x10f)],'stages':_0x4b676c[_0x5ed306(0x145)][_0x5ed306(0x17c)]?.[_0x5ed306(0x1e0)]||0x0,..._0x4b676c['attributes'][_0x5ed306(0x11c)]&&{'goal':_0x4b676c['attributes'][_0x5ed306(0x11c)]['name']},'latest':_0x1c416a[_0x5ed306(0x1ee)]===_0x991f0e,'created_at':_0x4b676c[_0x5ed306(0x145)][_0x5ed306(0x140)],'updated_at':_0x4b676c[_0x5ed306(0x145)][_0x5ed306(0x12a)],'url':_0x57eabe},_0x4802fd),0x0;}}
|
|
1
|
+
const a27_0x4a917e=a27_0xe10d;(function(_0xb73dc8,_0x12dea0){const _0x33385f=a27_0xe10d,_0x4df6a0=_0xb73dc8();while(!![]){try{const _0x2760dd=-parseInt(_0x33385f(0x10f))/0x1*(parseInt(_0x33385f(0x1cf))/0x2)+parseInt(_0x33385f(0x1a1))/0x3*(parseInt(_0x33385f(0x1c5))/0x4)+-parseInt(_0x33385f(0x1a7))/0x5*(parseInt(_0x33385f(0x140))/0x6)+parseInt(_0x33385f(0x15c))/0x7*(parseInt(_0x33385f(0xe5))/0x8)+parseInt(_0x33385f(0x141))/0x9+-parseInt(_0x33385f(0x108))/0xa*(-parseInt(_0x33385f(0x17b))/0xb)+-parseInt(_0x33385f(0x13a))/0xc*(parseInt(_0x33385f(0x1ba))/0xd);if(_0x2760dd===_0x12dea0)break;else _0x4df6a0['push'](_0x4df6a0['shift']());}catch(_0x23c4a9){_0x4df6a0['push'](_0x4df6a0['shift']());}}}(a27_0x3ff4,0x7fefc));import a27_0xf82e6a from'chalk';import a27_0x51581f from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x3e06b1){const _0x5c0498=a27_0xe10d;return!_0x3e06b1&&(console['error'](_0x5c0498(0xe7)),console[_0x5c0498(0x1a5)](_0x5c0498(0x103))),!!_0x3e06b1;}function withJsonFormat(_0x2d7767){const _0x2cd2fd=a27_0xe10d;if(!_0x2d7767[_0x2cd2fd(0x162)]&&!_0x2d7767[_0x2cd2fd(0x121)]&&!_0x2d7767[_0x2cd2fd(0xc4)]&&!_0x2d7767[_0x2cd2fd(0x196)])return{..._0x2d7767,'format':_0x2cd2fd(0x121),'json':!![]};return _0x2d7767;}function a27_0xe10d(_0xb28b97,_0xbc8be7){_0xb28b97=_0xb28b97-0xc3;const _0x3ff4d4=a27_0x3ff4();let _0xe10dcf=_0x3ff4d4[_0xb28b97];return _0xe10dcf;}function formatJourneyState(_0x278cde){const _0x494ac0=a27_0xe10d;switch(_0x278cde){case _0x494ac0(0x101):return a27_0xf82e6a[_0x494ac0(0x19e)](_0x494ac0(0x114));case _0x494ac0(0xcd):return a27_0xf82e6a[_0x494ac0(0x1b1)]('(draft)');case _0x494ac0(0x12c):return a27_0xf82e6a[_0x494ac0(0x17a)](_0x494ac0(0x112));case'completed':return a27_0xf82e6a[_0x494ac0(0x14f)]('(completed)');case _0x494ac0(0x18a):return a27_0xf82e6a[_0x494ac0(0x1b1)]('(archived)');default:return'('+_0x278cde+')';}}function formatJourneyItem(_0x458a56,_0x50d6e7='',_0x312be6){const _0x20d19a=a27_0xe10d,_0xb740d7=formatJourneyState(_0x458a56[_0x20d19a(0x13b)]),_0x131790=_0x312be6?hyperlink(_0x458a56['journeyBundleName'],_0x312be6):_0x458a56[_0x20d19a(0xdb)];return _0x50d6e7+'🗺️\x20'+_0x131790+'\x20'+_0xb740d7;}function escapeRegex(_0x305e09){const _0x43072e=a27_0xe10d;return _0x305e09[_0x43072e(0x17f)](/[.*+?^${}()|[\]\\]/g,_0x43072e(0x14c));}function globToRegex(_0x1075a3){const _0x5025e7=a27_0xe10d,_0x4b11ae=_0x1075a3[_0x5025e7(0x174)]('*')[_0x5025e7(0xd1)](escapeRegex);return new RegExp(_0x4b11ae['join']('.*'),'i');}function buildRuleToNameMapping(_0x583c17){const _0x30b622=a27_0xe10d,_0x5f5da8=new Map();if(_0x583c17['segments'])for(const [_0xe10e62,_0xa335a]of Object[_0x30b622(0xca)](_0x583c17['segments'])){if(_0xa335a[_0x30b622(0xdd)]){const _0x519081=serializeRule(_0xa335a[_0x30b622(0xdd)]),_0x5a3c48=_0x5f5da8[_0x30b622(0x1c7)](_0x519081);_0x5a3c48?_0x5a3c48[_0x30b622(0x165)](_0xe10e62):_0x5f5da8[_0x30b622(0x159)](_0x519081,[_0xe10e62]);}}return _0x5f5da8;}async function resolveJourneyIdFromInput(_0x352004,_0x4d4b67,_0x1260be){const _0x214de6=a27_0xe10d,_0x4eaac6=await resolveJourneyTarget(_0x352004,_0x4d4b67[_0x214de6(0xe8)],_0x4d4b67[_0x214de6(0x124)]),_0x5229f6=_0x4eaac6[_0x214de6(0xe8)];if(!_0x5229f6)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x214de6(0x115));const _0x26f886=await withSpinner(_0x214de6(0xeb),()=>_0x1260be['segment'][_0x214de6(0x1cb)](_0x5229f6),{'verbose':_0x4d4b67[_0x214de6(0x124)]}),_0x5c74ec=_0x26f886['data'],_0x44fa84=await withSpinner('Resolving\x20journey...',()=>_0x1260be[_0x214de6(0x14a)]['resolveJourneyId'](_0x5c74ec,_0x4eaac6[_0x214de6(0xc5)]),{'verbose':_0x4d4b67[_0x214de6(0x124)]});return{'journeyId':_0x44fa84[_0x214de6(0x1ce)],'journeyName':_0x4eaac6[_0x214de6(0xc5)],'parentSegmentId':_0x5c74ec};}async function resolveJourneyTarget(_0x53925d,_0xf2e75b,_0x2aa94f){const _0x554ff9=a27_0xe10d;if(isYamlFilePath(_0x53925d))try{const _0x13295d=await resolveYamlFilePath(_0x53925d);return _0x2aa94f&&(console['error'](_0x554ff9(0x1b3)+_0x53925d),console[_0x554ff9(0x1a5)](_0x554ff9(0x154)+_0x13295d[_0x554ff9(0xe8)]),console['error']('\x20\x20Name:\x20'+_0x13295d[_0x554ff9(0x16e)]),console[_0x554ff9(0x1a5)](_0x554ff9(0xfb)+(_0x13295d[_0x554ff9(0x113)]||_0x554ff9(0x129)))),{'journeyName':_0x13295d[_0x554ff9(0x16e)],'parentSegment':_0x13295d['parentSegment'],'resolved':_0x13295d};}catch(_0x45b6e0){throw new SDKError(ErrorCode[_0x554ff9(0x1b5)],_0x554ff9(0x195)+_0x45b6e0[_0x554ff9(0x153)]);}if(!_0xf2e75b)throw new SDKError(ErrorCode[_0x554ff9(0x1b5)],_0x554ff9(0x156));return{'journeyName':_0x53925d,'parentSegment':_0xf2e75b};}export class JourneyListCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0x179);['description']=a27_0x4a917e(0xe4);async[a27_0x4a917e(0x144)](_0xa0c88f){const _0x38c9e8=a27_0x4a917e,{options:_0x3585c5,args:_0x30d382,tdx:_0x40861c}=_0xa0c88f,_0x1bc4c0=_0x30d382[0x0],_0x6f9ea0=_0x3585c5[_0x38c9e8(0xe8)];if(!_0x6f9ea0)return console[_0x38c9e8(0x1a5)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x38c9e8(0x1a5)](_0x38c9e8(0xf8)),0x1;const _0x1b38a2=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x40861c[_0x38c9e8(0x110)][_0x38c9e8(0x1cb)](_0x6f9ea0),{'verbose':_0x3585c5[_0x38c9e8(0x124)]}),_0x2a134=_0x1b38a2[_0x38c9e8(0x1ce)];_0x3585c5[_0x38c9e8(0x124)]&&(console[_0x38c9e8(0x1a5)](_0x38c9e8(0x145)+_0x6f9ea0+_0x38c9e8(0xde)+_0x2a134+')'),_0x1bc4c0&&console['error']('Pattern:\x20'+_0x1bc4c0));const _0x1c215a=await withSpinner(_0x38c9e8(0x122),()=>_0x40861c[_0x38c9e8(0x110)][_0x38c9e8(0x143)](_0x2a134),{'verbose':_0x3585c5[_0x38c9e8(0x124)]}),_0xd03f20=_0x1c215a['data'],_0x27609f=_0xd03f20['rootFolderId'],_0x325a21=await withSpinner(_0x38c9e8(0x164),()=>_0x40861c[_0x38c9e8(0x14a)][_0x38c9e8(0x16c)](_0x2a134,_0x27609f),{'verbose':_0x3585c5['verbose']});let _0xc8fe63=_0x325a21[_0x38c9e8(0x1ce)][_0x38c9e8(0x155)];const _0x523137=_0x325a21[_0x38c9e8(0x1ce)][_0x38c9e8(0x172)],_0x33043a=new Map();for(const _0x1ff4f4 of _0x523137){_0x33043a[_0x38c9e8(0x159)](_0x1ff4f4['id'],_0x1ff4f4[_0x38c9e8(0x126)]);}if(_0x1bc4c0){const _0x1a0536=globToRegex(_0x1bc4c0);_0xc8fe63=_0xc8fe63[_0x38c9e8(0x18b)](_0x159024=>_0x1a0536[_0x38c9e8(0x105)](_0x159024[_0x38c9e8(0xdb)]));}console[_0x38c9e8(0x1a5)](_0x38c9e8(0x11b)+_0xc8fe63[_0x38c9e8(0x13c)]+_0x38c9e8(0x131)+(_0xc8fe63[_0x38c9e8(0x13c)]!==0x1?'s':''));const _0x10e533=_0x1f75a5=>{const _0x54b67b=_0x38c9e8;return getConsoleNextUrl(_0x3585c5[_0x54b67b(0x191)],_0x54b67b(0x12b)+_0x2a134+_0x54b67b(0x178)+_0x1f75a5+_0x54b67b(0x127));};if(_0x3585c5['format']===_0x38c9e8(0x128))await handleSDKOutput(_0xc8fe63,_0x3585c5);else{if(_0x3585c5[_0x38c9e8(0x162)]===_0x38c9e8(0x121)){const _0x4d77b9=_0xc8fe63['map'](_0x31608e=>({..._0x31608e,'url':_0x10e533(_0x31608e['id'])}));await handleSDKOutput(_0x4d77b9,_0x3585c5);}else{console[_0x38c9e8(0xf7)]('['+_0x6f9ea0+']');const _0x3aeef7=new Map(),_0x5c101c=[];for(const _0x3a2f1b of _0xc8fe63){if(!_0x3a2f1b[_0x38c9e8(0xf3)]||_0x3a2f1b[_0x38c9e8(0xf3)]===_0x27609f)_0x5c101c['push'](_0x3a2f1b);else{const _0x3713b8=_0x3aeef7[_0x38c9e8(0x1c7)](_0x3a2f1b[_0x38c9e8(0xf3)])||[];_0x3713b8['push'](_0x3a2f1b),_0x3aeef7[_0x38c9e8(0x159)](_0x3a2f1b[_0x38c9e8(0xf3)],_0x3713b8);}}const _0x5f3ef7=(_0x4c2fe7,_0x2020e0)=>_0x4c2fe7[_0x38c9e8(0xdb)][_0x38c9e8(0xfc)](_0x2020e0[_0x38c9e8(0xdb)],undefined,{'sensitivity':_0x38c9e8(0xcb)});_0x5c101c[_0x38c9e8(0xf4)](_0x5f3ef7);for(const _0x4988d6 of _0x5c101c){console[_0x38c9e8(0xf7)](formatJourneyItem(_0x4988d6,'',_0x10e533(_0x4988d6['id'])));}const _0x52b2b7=[..._0x3aeef7[_0x38c9e8(0xca)]()][_0x38c9e8(0xf4)]((_0x3eec24,_0x5f2505)=>{const _0x44d712=_0x38c9e8,_0x5f42cc=_0x33043a['get'](_0x3eec24[0x0])||_0x3eec24[0x0],_0x5005ec=_0x33043a['get'](_0x5f2505[0x0])||_0x5f2505[0x0];return _0x5f42cc[_0x44d712(0xfc)](_0x5005ec,undefined,{'sensitivity':_0x44d712(0xcb)});});for(const [_0x3d4e23,_0x49f523]of _0x52b2b7){const _0x50e4c8=_0x33043a[_0x38c9e8(0x1c7)](_0x3d4e23)||_0x3d4e23;console[_0x38c9e8(0xf7)](_0x38c9e8(0x123)+_0x50e4c8),_0x49f523[_0x38c9e8(0xf4)](_0x5f3ef7);for(const _0x52112a of _0x49f523){console['log'](formatJourneyItem(_0x52112a,'\x20\x20',_0x10e533(_0x52112a['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0x134);[a27_0x4a917e(0x1b7)]='Show\x20journey\x20details';async[a27_0x4a917e(0x144)](_0x514604){const _0x294f02=a27_0x4a917e,{options:_0x26f832,args:_0x5e9b30,tdx:_0x53214c}=_0x514604,_0x2558ff=_0x5e9b30[0x0];if(!_0x2558ff)return console['error'](_0x294f02(0xe7)),console[_0x294f02(0x1a5)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x294f02(0x1a5)]('Options:'),console['error'](_0x294f02(0x152)),0x1;_0x26f832['verbose']&&console[_0x294f02(0x1a5)](_0x294f02(0x1a6)+_0x2558ff);const {journeyId:_0x54d3fe,parentSegmentId:_0x47a3b0}=await resolveJourneyIdFromInput(_0x2558ff,_0x26f832,_0x53214c);if(_0x26f832['web']){const _0x440459=getConsoleNextUrl(_0x26f832[_0x294f02(0x191)],_0x294f02(0x12b)+_0x47a3b0+_0x294f02(0x178)+_0x54d3fe+_0x294f02(0x1a4));return console[_0x294f02(0x1a5)](a27_0xf82e6a[_0x294f02(0x19e)]('✔')+_0x294f02(0x186)+a27_0xf82e6a[_0x294f02(0x1b2)](_0x440459)),openBrowser(_0x440459),0x0;}const _0x388292=await withSpinner(_0x294f02(0x1a2),()=>_0x53214c['journey']['getJourney'](_0x54d3fe),{'verbose':_0x26f832['verbose']}),_0x18749a=_0x388292['data'],_0xeec376=_0x26f832[_0x294f02(0x125)];let _0x3b702b;if(_0xeec376)try{const _0x40b1a6=await withSpinner(_0x294f02(0x1cc),()=>_0x53214c[_0x294f02(0x14a)][_0x294f02(0xed)](_0x54d3fe),{'verbose':_0x26f832['verbose']});_0x3b702b=_0x40b1a6['data'];}catch{_0x26f832['verbose']&&console['error'](_0x294f02(0x181));}const _0x3e0c4b=getConsoleNextUrl(_0x26f832[_0x294f02(0x191)],_0x294f02(0x12b)+_0x47a3b0+_0x294f02(0x178)+_0x54d3fe+_0x294f02(0x1a4)),_0x33fb5b={'id':_0x18749a['id'],'name':_0x18749a[_0x294f02(0xc7)][_0x294f02(0x126)],'description':_0x18749a['attributes'][_0x294f02(0x1b7)],'state':_0x18749a[_0x294f02(0xc7)][_0x294f02(0x13b)],'paused':_0x18749a['attributes'][_0x294f02(0x12c)],'reentry_mode':_0x18749a[_0x294f02(0xc7)]['reentryMode'],'stages':_0x18749a[_0x294f02(0xc7)][_0x294f02(0xd3)]?.['length']||0x0,..._0x18749a[_0x294f02(0xc7)][_0x294f02(0xe6)]&&{'goal':_0x18749a[_0x294f02(0xc7)][_0x294f02(0xe6)]['name']},..._0x3b702b&&{'statistics':{'size':_0x3b702b['size'],'entered':_0x3b702b['enteredSize'],'goal_achieved':_0x3b702b[_0x294f02(0x17c)],'completion_rate':_0x3b702b[_0x294f02(0x14b)],'exit_or_jump':_0x3b702b[_0x294f02(0x11a)],'exit_or_jump_rate':_0x3b702b[_0x294f02(0x189)],'stages':_0x3b702b[_0x294f02(0x149)]}},'url':_0x3e0c4b};return await handleSingleObjectOutput(_0x33fb5b,_0x26f832),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0x11c);[a27_0x4a917e(0x1b7)]=a27_0x4a917e(0xfe);async[a27_0x4a917e(0x144)](_0x43298d){const _0x22a634=a27_0x4a917e,{options:_0x2f499d,args:_0x1e9350,tdx:_0x258cad}=_0x43298d,_0x4bc299=_0x1e9350[0x0];if(!requireNameOrPath(_0x4bc299))return 0x1;_0x2f499d[_0x22a634(0x124)]&&console['error'](_0x22a634(0x1a6)+_0x4bc299);const _0x194ede=_0x2f499d,_0x4a6a60=_0x194ede['from'],_0x4d3761=_0x194ede['to'],_0x2a43ee=_0x194ede[_0x22a634(0x168)],_0x1cbd38=_0x194ede[_0x22a634(0x167)];_0x2a43ee&&!_0x4a6a60&&!_0x4d3761&&console[_0x22a634(0x1a5)](_0x22a634(0x16a));const _0x550049=_0x2a43ee?withJsonFormat(_0x2f499d):_0x2f499d,{journeyId:_0x2c9361,journeyName:_0x3774c6}=await resolveJourneyIdFromInput(_0x4bc299,_0x550049,_0x258cad),_0xa3c32=_0x4a6a60||_0x4d3761?{'from':_0x4a6a60,'to':_0x4d3761}:undefined,_0x2d4830=await withSpinner(_0x22a634(0x1cc),()=>Promise['all']([_0x258cad[_0x22a634(0x14a)][_0x22a634(0xec)](_0x2c9361),_0x258cad['journey'][_0x22a634(0xed)](_0x2c9361,_0xa3c32)]),{'verbose':_0x550049[_0x22a634(0x124)]}),[_0x115976,_0x5aae74]=_0x2d4830[_0x22a634(0x1ce)];if(!_0x5aae74||_0x5aae74['journeyId']===null)return console[_0x22a634(0x1a5)](_0x22a634(0xf1)+_0x3774c6),console[_0x22a634(0x1a5)](_0x22a634(0x171)),0x0;const _0x4ba968=buildStageNameMap(_0x115976),_0x5af7b5=!!(_0xa3c32&&_0x5aae74[_0x22a634(0x19f)]?.[_0x22a634(0x13c)]),_0x12eef3={'stageNameMap':_0x4ba968,'hasPeriod':_0x5af7b5,'includeHistory':!!_0x2a43ee};if(_0x1cbd38&&_0x5aae74['stages']){const _0x2267ff=_0x5aae74['stages'][_0x22a634(0x142)](_0x21a19e=>{const _0x90e42b=_0x22a634,_0xb73ee0=_0x4ba968[_0x90e42b(0x1c7)](_0x21a19e['id'])??'';return _0xb73ee0[_0x90e42b(0x18e)]()===_0x1cbd38[_0x90e42b(0x18e)]();});if(_0x2267ff)return await handleSingleObjectOutput(formatStageStats(_0x2267ff,_0x12eef3),_0x550049),0x0;const _0xa795f2=_0x5aae74[_0x22a634(0x149)][_0x22a634(0xd1)](_0x573613=>_0x4ba968[_0x22a634(0x1c7)](_0x573613['id'])??_0x573613['id']);return console[_0x22a634(0x1a5)]('Error:\x20Stage\x20\x22'+_0x1cbd38+'\x22\x20not\x20found'),console['error']('Available\x20stages:\x20'+_0xa795f2[_0x22a634(0xd9)](',\x20')),0x1;}const _0x33fe10=_0x5aae74['stages']?.['map'](_0x556b04=>formatStageStats(_0x556b04,_0x12eef3)),_0x1deb5b=assembleJourneyStats(_0x5aae74,{'from':_0x4a6a60,'to':_0x4d3761,'includeHistory':_0x2a43ee});return await this[_0x22a634(0xc8)](_0x1deb5b,_0x33fe10??[],_0x550049),0x0;}async[a27_0x4a917e(0xc8)](_0x4bb28,_0x1cd248,_0x5586a2){const _0x4f5da9=a27_0x4a917e,_0x5dcfa1=_0x5586a2[_0x4f5da9(0x162)]==='json'||_0x5586a2[_0x4f5da9(0x162)]===_0x4f5da9(0xc4)||_0x5586a2[_0x4f5da9(0x121)]||_0x5586a2[_0x4f5da9(0xc4)];if(_0x5dcfa1){_0x4bb28[_0x4f5da9(0x149)]=_0x1cd248,await handleSingleObjectOutput(_0x4bb28,_0x5586a2);return;}await handleSingleObjectOutput(_0x4bb28,_0x5586a2);for(const _0x426fe4 of _0x1cd248){console[_0x4f5da9(0xf7)](''),console[_0x4f5da9(0xf7)](String(a27_0xf82e6a[_0x4f5da9(0x1b2)][_0x4f5da9(0xc3)]('['+_0x426fe4[_0x4f5da9(0x126)]+']'))+a27_0xf82e6a['dim']('\x20'+_0x426fe4['id']));const {id:_0x17c4bc,name:_0x4582df,..._0x3de02a}=_0x426fe4;await handleSingleObjectOutput(_0x3de02a,_0x5586a2);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a27_0x4a917e(0x132);[a27_0x4a917e(0x1b7)]=a27_0x4a917e(0x104);async[a27_0x4a917e(0x144)](_0x5b49be){const _0x4a0c6c=a27_0x4a917e,{options:_0x1544d2,args:_0x3bab93,tdx:_0x5e98a4}=_0x5b49be,_0x2de219=_0x3bab93[0x0];if(!requireNameOrPath(_0x2de219))return 0x1;_0x1544d2[_0x4a0c6c(0x124)]&&console[_0x4a0c6c(0x1a5)](_0x4a0c6c(0x1a6)+_0x2de219);const _0x285c6b=_0x1544d2,_0x187047=_0x285c6b['type'],_0x19d943=_0x285c6b['from'],_0x4a1ad7=_0x285c6b['to'],_0x28e40f=_0x285c6b['limit'];if(_0x187047&&_0x187047!==_0x4a0c6c(0x16f)&&_0x187047!==_0x4a0c6c(0x16b))return console[_0x4a0c6c(0x1a5)](_0x4a0c6c(0xd0)+_0x187047+_0x4a0c6c(0x1bc)),0x1;const _0x2ab869=withJsonFormat(_0x1544d2),{journeyId:_0xecb5ec,journeyName:_0x37c816}=await resolveJourneyIdFromInput(_0x2de219,_0x2ab869,_0x5e98a4),_0x33d04a={'type':_0x187047,'from':_0x19d943,'to':_0x4a1ad7,'limit':_0x28e40f},_0x3d666d=await withSpinner(_0x4a0c6c(0xe2),()=>_0x5e98a4[_0x4a0c6c(0x14a)]['getTrafficData'](_0xecb5ec,_0x33d04a),{'verbose':_0x2ab869[_0x4a0c6c(0x124)]}),_0x10b029=_0x3d666d[_0x4a0c6c(0x1ce)],_0x3efbe9=_0x10b029['conversion']&&(_0x10b029[_0x4a0c6c(0x16f)][_0x4a0c6c(0x19c)]['length']>0x0||_0x10b029['conversion'][_0x4a0c6c(0x1a9)][_0x4a0c6c(0x13c)]>0x0),_0x59fe43=_0x10b029[_0x4a0c6c(0x16b)]&&_0x10b029[_0x4a0c6c(0x16b)][_0x4a0c6c(0x13c)]>0x0;if(!_0x3efbe9&&!_0x59fe43)return console[_0x4a0c6c(0x1a5)](_0x4a0c6c(0xcf)+_0x37c816),console[_0x4a0c6c(0x1a5)](_0x4a0c6c(0x10d)),_0x19d943&&_0x4a1ad7&&console[_0x4a0c6c(0x1a5)](_0x4a0c6c(0x1ac)),0x0;return await handleSingleObjectOutput(_0x10b029,_0x2ab869),0x0;}}function formatStageStats(_0x2b7660,_0x387479){const _0x1c212b=a27_0x4a917e,_0x10fdd6=_0x387479[_0x1c212b(0x177)]&&_0x2b7660[_0x1c212b(0x19f)]?.[_0x1c212b(0x13c)]?aggregateStageHistory(_0x2b7660[_0x1c212b(0x19f)]):{'size':_0x2b7660[_0x1c212b(0x175)],'entered':_0x2b7660[_0x1c212b(0xe3)],'milestone':_0x2b7660[_0x1c212b(0x185)],'milestone_rate':_0x2b7660[_0x1c212b(0x13e)],'exit_or_jump':_0x2b7660['exitOrJumpSize'],'exit_or_jump_rate':_0x2b7660[_0x1c212b(0x189)]},_0x54e308={'id':_0x2b7660['id'],'name':_0x387479['stageNameMap']['get'](_0x2b7660['id'])??_0x2b7660['id'],..._0x10fdd6};return _0x387479[_0x1c212b(0x177)]&&_0x387479[_0x1c212b(0x168)]&&_0x2b7660['history']&&(_0x54e308[_0x1c212b(0x19f)]=_0x2b7660[_0x1c212b(0x19f)]),_0x54e308;}function a27_0x3ff4(){const _0x451558=['Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','dryRun','listFolders','\x22\x20resumed','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','exitOrJumpSize','✔\x20Found\x20','journey:stats','connector_config','errorCode','Show\x20journey\x20table\x20column\x20mapping','reentryMode','json','Fetching\x20parent\x20segment...','📁\x20','verbose','includeStats','name','/j/da','table','(root)','\x20->\x20','/app/ps/','paused','Getting\x20column\x20mapping...','absolutePath','resolveSegment','segmentPushCommand','\x20journey','journey:traffic','options','journey:view','\x20journey\x20files\x20to\x20','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','buildIdToNameMap','Error:\x20--version\x20option\x20is\x20required','\x20version','5803608rYmqKW','state','length',',\x20version:\x20','completeMilestoneRate','listActivationsFlat','128046udEiTX','5665248TXkzWt','find','getParentFull','execute','Parent\x20segment:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','utf-8','resume','stages','journey','completionRate','\x5c$&','Listing\x20journey\x20versions...','getLatestJourneyId','blue','Folder\x20path:\x20','database','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','message','\x20\x20Parent\x20segment:\x20','journeys','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20new\x20files','journey:versions','set','Getting\x20version\x20','file','1337wvSbXr','parent_segment','✔\x20Pulled\x20','relativePath','\x20journeys','getActivation','format','then','Listing\x20journeys...','push','pause','stage','includeHistory','createVersion','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','activation','listJourneysWithFolders','Journey\x20name:\x20','segmentName','conversion','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','folders','journey:pull','split','size','\x20unchanged\x20files','hasPeriod','/e/','journey:list','yellow','1936cjvleU','goalSize','\x20=\x20','Error:\x20Journey\x20not\x20found:\x20','replace','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Statistics\x20not\x20available','Found\x20','\x20details...','connection','milestoneSize','\x20Opening\x20','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','exitOrJumpRate','archived','filter','\x20not\x20found.\x20Available:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toLowerCase','values','user','site','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Cancelled','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','tsv','\x20files?','listVersions','Target\x20directory:\x20','journey:version:create','setPhase','nodes','View\x20a\x20specific\x20version\x20of\x20a\x20journey','green','history','\x20activation','77433tmjDxc','Getting\x20journey\x20details...','Error:\x20Journey\x20\x27','/j/da/je','error','Input:\x20','160wjiQLj','add','links','no_parent','red','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','session','...','\x20\x20Journey\x20ID:\x20','cwd','dim','cyan','Resolved\x20YAML\x20file:\x20','versionNumber','INVALID_ARGUMENT','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','description','Database:\x20','filePath','26rOIqvj','journeyBundleId','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Aborted.','hasChanges','\x20\x20-\x20','List\x20activations\x20for\x20a\x20journey','Error:\x20','activationParams','✔\x20Journey\x20\x22','104QdugGN','Warning:\x20Could\x20not\x20resolve\x20activation\x20','get','version','all','getSegment','resolveParentId','Getting\x20journey\x20statistics...','yes','data','2MDEjUT','bold','jsonl','journeyName','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','attributes','renderStats','\x20(draft)\x20—\x20\x22','entries','base','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','draft','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Error:\x20Invalid\x20--type\x20\x22','map','has','journeyStages','No\x20journeys\x20found','targetDir','listJourneysFromParentSegment','Creating\x20new\x20version...','relative','join','tdx.json','journeyBundleName','Error:\x20Version\x20','rule','\x20(ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x27\x20not\x20found\x20in\x20','helpText','Getting\x20journey\x20traffic\x20data...','enteredSize','List\x20journeys\x20in\x20current\x20context','29168teimHl','goal','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','parentSegment','journey:version:view','✔\x20Context\x20set:\x20','Resolving\x20parent\x20segment...','getJourney','getStatistics','journey:pause','\x20\x20Target:\x20','journeyId','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','folderId','sort','\x0aPull\x20summary:','repeat','log','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','journey:activations','\x20(rule\x20match)','\x20\x20Folder\x20path:\x20','localeCompare','Error:\x20Invalid\x20version\x20number:\x20','Show\x20journey\x20statistics','Listing\x20journey\x20activations...','.yml','launched','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','test','resourceName','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)','42410lLGPgH','buildIdToEmailMap','\x20versions)','\x0aChanges\x20to\x20\x27','journey:columns','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','isNew','569152FPHUSK','segment','createdAt','(paused)','folderPath','(running)'];a27_0x3ff4=function(){return _0x451558;};return a27_0x3ff4();}export class JourneyPauseCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0xee);[a27_0x4a917e(0x1b7)]='Pause\x20a\x20running\x20journey';async[a27_0x4a917e(0x144)](_0x4494a4){const _0x2f65c7=a27_0x4a917e,{options:_0x4c9f97,args:_0x1f3c74,tdx:_0x40cb63}=_0x4494a4,_0x4d6ff9=_0x1f3c74[0x0];if(!requireNameOrPath(_0x4d6ff9))return 0x1;_0x4c9f97['verbose']&&console['error'](_0x2f65c7(0x1a6)+_0x4d6ff9);const {journeyId:_0x403f15,journeyName:_0xd28ffe}=await resolveJourneyIdFromInput(_0x4d6ff9,_0x4c9f97,_0x40cb63);if(!_0x4c9f97[_0x2f65c7(0x1cd)]){const _0x463a0a=await confirm(_0x2f65c7(0x194)+_0xd28ffe+'\x22?');if(!_0x463a0a)return console[_0x2f65c7(0x1a5)](_0x2f65c7(0x193)),0x0;}const _0x32297d=await withSpinner('Pausing\x20journey...',()=>_0x40cb63[_0x2f65c7(0x14a)][_0x2f65c7(0x166)](_0x403f15),{'verbose':_0x4c9f97[_0x2f65c7(0x124)]}),_0x524c56=_0x32297d[_0x2f65c7(0x1ce)];return console[_0x2f65c7(0x1a5)](_0x2f65c7(0x1c4)+_0x524c56[_0x2f65c7(0xc7)]['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x4a917e(0x126)]='journey:resume';[a27_0x4a917e(0x1b7)]='Resume\x20a\x20paused\x20journey';async['execute'](_0xfc9acf){const _0x4581e2=a27_0x4a917e,{options:_0x17582e,args:_0x38367e,tdx:_0x1844d2}=_0xfc9acf,_0x47bd0a=_0x38367e[0x0];if(!requireNameOrPath(_0x47bd0a))return 0x1;_0x17582e['verbose']&&console[_0x4581e2(0x1a5)](_0x4581e2(0x1a6)+_0x47bd0a);const {journeyId:_0x3e9ccd,journeyName:_0x50c533}=await resolveJourneyIdFromInput(_0x47bd0a,_0x17582e,_0x1844d2);if(!_0x17582e[_0x4581e2(0x1cd)]){const _0x461b3f=await confirm(_0x4581e2(0xdf)+_0x50c533+'\x22?');if(!_0x461b3f)return console[_0x4581e2(0x1a5)](_0x4581e2(0x193)),0x0;}const _0xfa9fe6=await withSpinner('Resuming\x20journey...',()=>_0x1844d2[_0x4581e2(0x14a)][_0x4581e2(0x148)](_0x3e9ccd),{'verbose':_0x17582e[_0x4581e2(0x124)]}),_0x2fa3a3=_0xfa9fe6[_0x4581e2(0x1ce)];return console[_0x4581e2(0x1a5)](_0x4581e2(0x1c4)+_0x2fa3a3[_0x4581e2(0xc7)][_0x4581e2(0x126)]+_0x4581e2(0x118)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0x173);[a27_0x4a917e(0x1b7)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x4a917e(0x144)](_0x246782){const _0x433b1a=a27_0x4a917e,{options:_0x3ddaa7,args:_0x20fa4e,tdx:_0x4de32e}=_0x246782,_0x156c83=_0x3ddaa7,_0x26d521=_0x20fa4e[0x0],_0x309b4b=_0x26d521&&isYamlFilePath(_0x26d521),_0x2a1514=await resolveTarget({'arg':_0x309b4b?_0x26d521:undefined,'contextParent':_0x3ddaa7['parentSegment'],'cwd':process[_0x433b1a(0x1b0)]()});if(!isSuccessfulResolution(_0x2a1514))return _0x2a1514[_0x433b1a(0x11e)]===_0x433b1a(0x1aa)?(console['error'](a27_0xf82e6a[_0x433b1a(0x17a)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x433b1a(0x1a5)](_0x433b1a(0x107)),console['error'](_0x433b1a(0x188)),console[_0x433b1a(0x1a5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x433b1a(0x1a5)](_0x433b1a(0x18d))):(console[_0x433b1a(0x1a5)](a27_0xf82e6a['red'](_0x433b1a(0x1c2)+_0x2a1514[_0x433b1a(0x153)]+'\x0a')),_0x2a1514[_0x433b1a(0xe1)]&&console[_0x433b1a(0x1a5)](a27_0xf82e6a[_0x433b1a(0x1b2)](_0x2a1514[_0x433b1a(0xe1)]))),0x1;let _0x5ce0d7=_0x309b4b?undefined:_0x26d521,_0x41d11b,_0x589d7c;_0x2a1514[_0x433b1a(0x187)]===_0x433b1a(0x15b)&&(_0x5ce0d7=_0x2a1514[_0x433b1a(0x106)],_0x41d11b=_0x2a1514[_0x433b1a(0x1b9)],_0x589d7c=_0x2a1514[_0x433b1a(0x113)]);const _0xa59edb=_0x2a1514['parentName'],_0x2b8227=_0x2a1514[_0x433b1a(0xd5)];_0x156c83[_0x433b1a(0x124)]&&(console[_0x433b1a(0x1a5)](_0x433b1a(0x145)+_0xa59edb),console[_0x433b1a(0x1a5)](_0x433b1a(0x199)+_0x2b8227),_0x5ce0d7&&console['error'](_0x433b1a(0x16d)+_0x5ce0d7),_0x41d11b&&console[_0x433b1a(0x1a5)]('Target\x20file:\x20'+_0x41d11b),_0x589d7c&&console['error'](_0x433b1a(0x150)+_0x589d7c));const _0x2285ca=await withSpinner(_0x433b1a(0xeb),()=>_0x4de32e[_0x433b1a(0x110)]['resolveParentId'](_0xa59edb),{'verbose':_0x3ddaa7['verbose']}),_0x20617d=_0x2285ca['data'],{journeys:_0x4e2838,folders:_0x6919d0}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x47af03=_0x433b1a,[_0xbbc23a,_0x21ec38]=await Promise[_0x47af03(0x1c9)]([_0x4de32e['journey'][_0x47af03(0xd6)](_0x20617d,undefined,{'includeAllVersions':!![]}),_0x4de32e[_0x47af03(0x110)][_0x47af03(0x117)](_0x20617d)]);return{'journeys':_0xbbc23a,'folders':_0x21ec38};},{'verbose':_0x3ddaa7[_0x433b1a(0x124)]})[_0x433b1a(0x163)](_0x3e68d2=>_0x3e68d2['data']);let _0x4ec61a=_0x4e2838;const _0xe5fb1b=buildFolderIdToPathMap(_0x6919d0);if(_0x5ce0d7){const _0x5ec08f=_0x4ec61a[_0x433b1a(0x18b)](_0x1e2ba5=>_0x1e2ba5[_0x433b1a(0xdb)][_0x433b1a(0x18e)]()===_0x5ce0d7[_0x433b1a(0x18e)]());if(_0x5ec08f[_0x433b1a(0x13c)]===0x0)return console['error'](_0x433b1a(0x17e)+_0x5ce0d7),console[_0x433b1a(0x1a5)](_0x433b1a(0x119)),0x1;_0x4ec61a=_0x5ec08f;}if(_0x589d7c!==undefined){const _0x2f2f61=_0x4ec61a[_0x433b1a(0x18b)](_0x22197f=>{const _0x240113=_0x433b1a,_0x93f5fd=_0x22197f[_0x240113(0xf3)]?_0xe5fb1b[_0x240113(0x1c7)](_0x22197f['folderId'])||'':'';return _0x93f5fd===_0x589d7c;});if(_0x2f2f61[_0x433b1a(0x13c)]===0x0&&_0x4ec61a['length']>0x0){console[_0x433b1a(0x1a5)](_0x433b1a(0x1a3)+_0x5ce0d7+_0x433b1a(0xe0)+(_0x589d7c||'root\x20folder')),console[_0x433b1a(0x1a5)](_0x433b1a(0xcc));for(const _0x330eb4 of _0x4ec61a){const _0x2f749e=_0x330eb4[_0x433b1a(0xf3)]?_0xe5fb1b[_0x433b1a(0x1c7)](_0x330eb4[_0x433b1a(0xf3)])||'':'';console['error'](_0x433b1a(0x1c0)+(_0x2f749e||_0x433b1a(0x129))+'/'+_0x330eb4['journeyBundleName']);}return 0x1;}_0x4ec61a=_0x2f2f61;}if(_0x4ec61a['length']===0x0)return console[_0x433b1a(0x1a5)](_0x433b1a(0xd4)),0x0;const _0xc352ac=new Map();for(const _0x35ff84 of _0x4ec61a){const _0x35bcc8=_0x35ff84[_0x433b1a(0x1bb)];!_0xc352ac['has'](_0x35bcc8)&&_0xc352ac['set'](_0x35bcc8,[]),_0xc352ac['get'](_0x35bcc8)[_0x433b1a(0x165)](_0x35ff84);}for(const _0x58e1d4 of _0xc352ac[_0x433b1a(0x18f)]()){_0x58e1d4[_0x433b1a(0xf4)]((_0x33dbda,_0x64901b)=>(_0x33dbda[_0x433b1a(0x1b4)]||0x0)-(_0x64901b['versionNumber']||0x0));}const _0x2f20c6=[],{idToEmailMap:_0x14b26c,connectionIdToNameMap:_0x2c744b}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x5a70f6=_0x433b1a,[_0xf308be,_0x156e47]=await Promise[_0x5a70f6(0x1c9)]([_0x4de32e[_0x5a70f6(0x190)][_0x5a70f6(0x109)](),_0x4de32e[_0x5a70f6(0x184)][_0x5a70f6(0x137)]()]);return{'idToEmailMap':_0xf308be,'connectionIdToNameMap':_0x156e47};},{'verbose':_0x3ddaa7['verbose']})[_0x433b1a(0x163)](_0x577c22=>_0x577c22['data']);for(const _0x405d6f of _0xc352ac[_0x433b1a(0x18f)]()){const _0xcfea59=_0x405d6f[0x0][_0x433b1a(0xdb)],_0x5661df=_0x405d6f[0x0]['folderId'],_0x43a87c=_0x5661df?_0xe5fb1b[_0x433b1a(0x1c7)](_0x5661df)||'':'',_0x2ca75b=_0x43a87c?a27_0x51581f[_0x433b1a(0xd9)](_0x2b8227,_0x43a87c):_0x2b8227,_0x595656=_0x41d11b||a27_0x51581f[_0x433b1a(0xd9)](_0x2ca75b,sanitizeFileName(_0xcfea59)+_0x433b1a(0x100));let _0x2ae1b8,_0x5767d0;if(existsSync(_0x595656))try{const _0x625b85=readFileSync(_0x595656,_0x433b1a(0x147)),_0x202dcb=parseYamlString(_0x625b85);_0x5767d0=_0x202dcb,_0x2ae1b8=buildRuleToNameMapping(_0x202dcb),_0x156c83[_0x433b1a(0x124)]&&_0x2ae1b8[_0x433b1a(0x175)]>0x0&&console[_0x433b1a(0x1a5)](_0x433b1a(0x182)+_0x2ae1b8[_0x433b1a(0x175)]+_0x433b1a(0x1bd)+_0xcfea59);}catch(_0x56875f){_0x156c83['verbose']&&console[_0x433b1a(0x1a5)](_0x433b1a(0xc6)+_0x56875f[_0x433b1a(0x153)]);}const _0x4c9d0a=[],_0x1e8746=new Set(),_0x52f753=new Map(),_0x4f952a=new Map(),_0x5cfbce=new Set(),_0x4ca17f=new Map(),_0x2563c0=new Map(),_0x525af3=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0xcfea59+_0x433b1a(0x1ae),async _0x28036d=>{const _0x4c57a3=_0x433b1a;for(const _0x3c14a7 of _0x405d6f){const _0x3a7e64=_0x405d6f[_0x4c57a3(0x13c)]>0x1?_0x3c14a7[_0x4c57a3(0xdb)]+'\x20v'+(_0x3c14a7[_0x4c57a3(0x1b4)]||0x1):_0x3c14a7['journeyBundleName'];_0x28036d[_0x4c57a3(0x19b)]('Fetching\x20'+_0x3a7e64);const _0x35dcf5=await _0x4de32e[_0x4c57a3(0x14a)][_0x4c57a3(0xec)](_0x3c14a7['id']),_0x35ecbb=_0x35dcf5[_0x4c57a3(0xc7)]?.['audienceId'],_0x144ef5={'resolveSegment':async _0x277e9d=>{const _0x354745=_0x4c57a3;if(!_0x35ecbb)return{'name':_0x277e9d,'isJourneyLocal':![]};const _0x583e85=_0x52f753[_0x354745(0x1c7)](_0x277e9d);if(_0x583e85)return _0x583e85;try{const _0x1f2016=await _0x4de32e[_0x354745(0x110)][_0x354745(0x1ca)](_0x35ecbb,_0x277e9d),_0x2cc7d9=_0x1f2016['kind']===SEGMENT_KIND_JOURNEY;let _0x4d75b3,_0x1fc446=_0x1f2016['name'];if(_0x2cc7d9&&_0x1f2016['rule']){const _0x4f3042=await segmentResponseToDef(_0x1f2016,{'resolveSegmentName':async _0x2be389=>{const _0x15b7da=_0x354745,_0x1504bd=_0x52f753[_0x15b7da(0x1c7)](_0x2be389);if(_0x1504bd)return _0x1504bd[_0x15b7da(0x126)];const _0x4dbf19=await _0x144ef5[_0x15b7da(0x12f)](_0x2be389);return _0x4dbf19['name'];}}),_0x1ebe9f=_0x4f3042[_0x354745(0xdd)];_0x4d75b3={'description':_0x1f2016[_0x354745(0x1b7)],'rule':_0x1ebe9f};const _0x58b337=serializeRule(_0x1ebe9f),_0x54feec=_0x4f952a[_0x354745(0x1c7)](_0x58b337);if(_0x54feec)_0x1fc446=_0x54feec,_0x4d75b3=undefined,_0x156c83[_0x354745(0x124)]&&console['error'](_0x354745(0xf2)+_0x1f2016['name']+_0x354745(0x12a)+_0x54feec);else{let _0x130494=![];if(_0x2ae1b8){const _0x27ac09=_0x2ae1b8[_0x354745(0x1c7)](_0x58b337);if(_0x27ac09){const _0x2d3318=_0x27ac09[_0x354745(0x142)](_0x2803df=>!_0x1e8746[_0x354745(0xd2)](_0x2803df));_0x2d3318&&(_0x1fc446=_0x2d3318,_0x1e8746[_0x354745(0x1a8)](_0x2d3318),_0x4f952a['set'](_0x58b337,_0x2d3318),_0x130494=!![],_0x156c83['verbose']&&console[_0x354745(0x1a5)](_0x354745(0x102)+_0x2d3318+_0x354745(0xfa)));}}if(!_0x130494){const _0x46c34b=generateJourneyLocalName(_0x1f2016[_0x354745(0x126)]);_0x46c34b&&(_0x1fc446=_0x46c34b);let _0x57c183=_0x1fc446,_0x14c485=0x2;while(_0x1e8746['has'](_0x57c183)){_0x57c183=_0x1fc446+'_'+_0x14c485,_0x14c485++;}_0x1e8746[_0x354745(0x1a8)](_0x57c183),_0x4f952a['set'](_0x58b337,_0x57c183),_0x1fc446=_0x57c183;}}}const _0x1183c4={'name':_0x1fc446,'isJourneyLocal':_0x2cc7d9,'definition':_0x4d75b3};return _0x52f753[_0x354745(0x159)](_0x277e9d,_0x1183c4),_0x1183c4;}catch(_0x4f2eb2){return _0x3ddaa7[_0x354745(0x124)]&&console[_0x354745(0x1a5)](_0x354745(0x192)+_0x277e9d+':\x20'+_0x4f2eb2[_0x354745(0x153)]),{'name':_0x277e9d,'isJourneyLocal':![]};}},'resolveActivation':async _0x3754b5=>{const _0x5d244c=_0x4c57a3,_0x112773=_0x4ca17f[_0x5d244c(0x1c7)](_0x3754b5);if(_0x112773)return _0x112773;try{const _0x7c8379=await _0x4de32e[_0x5d244c(0x14a)][_0x5d244c(0x161)](_0x3c14a7['id'],_0x3754b5),_0x3d4b04=journeyActivationStepToYaml(_0x7c8379,_0x14b26c,_0x2c744b),_0x2548fe=JSON['stringify']({'name':_0x3d4b04[_0x5d244c(0x126)],'connection':_0x3d4b04[_0x5d244c(0x184)],'connector_config':_0x3d4b04[_0x5d244c(0x11d)]}),_0x7ddf67=_0x2563c0[_0x5d244c(0x1c7)](_0x2548fe);if(_0x7ddf67){const _0x22206b={'name':_0x7ddf67,'isJourneyLocal':!![],'definition':_0x3d4b04};return _0x4ca17f['set'](_0x3754b5,_0x22206b),_0x22206b;}const _0x429206=_0x7c8379[_0x5d244c(0xc7)][_0x5d244c(0x1c3)][_0x5d244c(0x126)]||_0x3754b5,_0x30cba7=sanitizeYamlKey(_0x429206)||'activation_'+_0x3754b5;let _0x59a8e4=_0x30cba7,_0x3ed251=0x2;while(_0x5cfbce['has'](_0x59a8e4)){_0x59a8e4=_0x30cba7+'_'+_0x3ed251,_0x3ed251++;}_0x5cfbce['add'](_0x59a8e4),_0x2563c0[_0x5d244c(0x159)](_0x2548fe,_0x59a8e4);const _0x1fde46={'name':_0x59a8e4,'isJourneyLocal':!![],'definition':_0x3d4b04};return _0x4ca17f['set'](_0x3754b5,_0x1fde46),_0x1fde46;}catch(_0x1deec6){return _0x3ddaa7[_0x5d244c(0x124)]&&console[_0x5d244c(0x1a5)](_0x5d244c(0x1c6)+_0x3754b5+':\x20'+_0x1deec6[_0x5d244c(0x153)]),{'name':_0x3754b5,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x51e26f,_0x515669)=>{const _0x24f10f=_0x4c57a3;return resolveJumpTarget(_0x51e26f,_0x515669,_0x525af3,_0x40f746=>_0x4de32e[_0x24f10f(0x14a)][_0x24f10f(0xec)](_0x40f746));}},_0x177b3d=await journeyResponseToDef(_0x35dcf5,_0x144ef5);_0x4c9d0a[_0x4c57a3(0x165)]({'item':_0x3c14a7,'yaml':_0x177b3d});}},{'verbose':_0x3ddaa7['verbose']});const _0x336ec0=await _0x4de32e[_0x433b1a(0x14a)][_0x433b1a(0x14e)](_0x405d6f[0x0][_0x433b1a(0x1bb)]),_0x1bd98d=buildMergedJourneyDef(_0x4c9d0a,_0x2ae1b8,_0x336ec0),_0xc411e6=normalizeJourneyDef(_0x1bd98d,_0x5767d0),_0x39b410=toYamlString(_0xc411e6),_0x2bc3d5=_0x41d11b||a27_0x51581f['join'](_0x2ca75b,sanitizeFileName(_0xcfea59)+_0x433b1a(0x100));!_0x41d11b&&_0x43a87c&&!existsSync(_0x2ca75b)&&mkdirSync(_0x2ca75b,{'recursive':!![]});const _0x3474cc=a27_0x51581f[_0x433b1a(0xd8)](process[_0x433b1a(0x1b0)](),_0x2bc3d5);if(existsSync(_0x2bc3d5)){const _0x38622e=readFileSync(_0x2bc3d5,_0x433b1a(0x147)),_0x250f00=generateDiff(_0x38622e,_0x39b410),_0xbb6272=hasChanges(_0x250f00);_0x2f20c6['push']({'relativePath':_0x3474cc,'absolutePath':_0x2bc3d5,'content':_0x39b410,'isNew':![],'hasChanges':_0xbb6272,'diff':_0xbb6272?formatDiffWithColors(_0x250f00):undefined});}else _0x2f20c6['push']({'relativePath':_0x3474cc,'absolutePath':_0x2bc3d5,'content':_0x39b410,'isNew':!![],'hasChanges':![]});}const _0x76f1c4=_0x2f20c6['filter'](_0x411254=>_0x411254[_0x433b1a(0x10e)]),_0x3df458=_0x2f20c6['filter'](_0x28b601=>!_0x28b601[_0x433b1a(0x10e)]&&_0x28b601[_0x433b1a(0x1bf)]),_0x219418=_0x2f20c6[_0x433b1a(0x18b)](_0x35c8cc=>!_0x35c8cc[_0x433b1a(0x10e)]&&!_0x35c8cc[_0x433b1a(0x1bf)]),_0x5ab3ce=_0x4ec61a[_0x433b1a(0x13c)],_0x314ecb=_0xc352ac[_0x433b1a(0x175)],_0x618e7f=_0x5ab3ce>_0x314ecb?'\x20('+_0x5ab3ce+_0x433b1a(0x10a):'';console[_0x433b1a(0x1a5)](_0x433b1a(0xf5)),console['error']('\x20\x20'+a27_0xf82e6a['cyan'](_0x314ecb+_0x433b1a(0x160))+a27_0xf82e6a['dim'](_0x618e7f)),console['error']('\x20\x20'+a27_0xf82e6a['green']('+\x20'+_0x76f1c4['length']+_0x433b1a(0x157))),console[_0x433b1a(0x1a5)]('\x20\x20'+a27_0xf82e6a['yellow']('~\x20'+_0x3df458[_0x433b1a(0x13c)]+'\x20changed\x20files')),console[_0x433b1a(0x1a5)]('\x20\x20'+a27_0xf82e6a[_0x433b1a(0x1b1)]('=\x20'+_0x219418[_0x433b1a(0x13c)]+_0x433b1a(0x176))),console[_0x433b1a(0x1a5)](_0x433b1a(0xef)+a27_0xf82e6a[_0x433b1a(0x1b2)](_0x2b8227)+'\x0a');if(_0x3df458['length']>0x0)for(const _0x109630 of _0x3df458){console[_0x433b1a(0x1a5)](_0x433b1a(0x10b)+_0x109630[_0x433b1a(0x15f)]+'\x27:'),console[_0x433b1a(0x1a5)]('─'[_0x433b1a(0xf6)](0x3c)),console['error'](_0x109630['diff']),console['error']('─'[_0x433b1a(0xf6)](0x3c));}if(_0x156c83[_0x433b1a(0x116)])return console[_0x433b1a(0x1a5)](a27_0xf82e6a[_0x433b1a(0x17a)](_0x433b1a(0xce))),0x0;if(_0x76f1c4[_0x433b1a(0x13c)]===0x0&&_0x3df458[_0x433b1a(0x13c)]===0x0)return console['error'](a27_0xf82e6a[_0x433b1a(0x19e)](_0x433b1a(0x180))),saveSessionContext({'parent_segment':_0xa59edb},_0x156c83[_0x433b1a(0x1ad)]),console[_0x433b1a(0x1a5)](a27_0xf82e6a[_0x433b1a(0x19e)](_0x433b1a(0xea)+a27_0xf82e6a[_0x433b1a(0x1b1)](_0x433b1a(0x15d))+_0x433b1a(0x17d)+a27_0xf82e6a[_0x433b1a(0x1b2)](_0xa59edb))),0x0;if(!_0x156c83[_0x433b1a(0x1cd)]&&(_0x76f1c4[_0x433b1a(0x13c)]>0x0||_0x3df458['length']>0x0)){if(!isInteractive())return console[_0x433b1a(0x1a5)](a27_0xf82e6a[_0x433b1a(0x1ab)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x433b1a(0x1a5)](a27_0xf82e6a[_0x433b1a(0x1b1)](_0x433b1a(0x1b6))),0x1;const _0x3a3749=await confirmKey('Write\x20'+(_0x76f1c4[_0x433b1a(0x13c)]+_0x3df458[_0x433b1a(0x13c)])+_0x433b1a(0x197));if(!_0x3a3749)return console['error'](a27_0xf82e6a[_0x433b1a(0x17a)](_0x433b1a(0x1be)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x2b8227)&&mkdirSync(_0x2b8227,{'recursive':!![]});const _0x31c33d=a27_0x51581f[_0x433b1a(0xd9)](_0x2b8227,_0x433b1a(0xda));writeFileSync(_0x31c33d,createTdxConfigContent(_0xa59edb),_0x433b1a(0x147));for(const _0x1e4c8e of _0x2f20c6){(_0x1e4c8e[_0x433b1a(0x10e)]||_0x1e4c8e[_0x433b1a(0x1bf)])&&writeFileSync(_0x1e4c8e[_0x433b1a(0x12e)],_0x1e4c8e['content'],'utf-8');}return console[_0x433b1a(0x1a5)](a27_0xf82e6a[_0x433b1a(0x19e)](_0x433b1a(0x15e)+(_0x76f1c4[_0x433b1a(0x13c)]+_0x3df458[_0x433b1a(0x13c)])+_0x433b1a(0x135)+_0x2b8227)),saveSessionContext({'parent_segment':_0xa59edb},_0x156c83[_0x433b1a(0x1ad)]),console['error'](a27_0xf82e6a['green'](_0x433b1a(0xea)+a27_0xf82e6a['dim'](_0x433b1a(0x15d))+_0x433b1a(0x17d)+a27_0xf82e6a[_0x433b1a(0x1b2)](_0xa59edb))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x4a917e(0x10c);['description']=a27_0x4a917e(0x11f);async['execute'](_0x37e3e2){const _0x5abdb4=a27_0x4a917e,{options:_0x268697,args:_0x8d94fe,tdx:_0x4a832e}=_0x37e3e2,_0x3af4d4=_0x8d94fe[0x0];if(!requireNameOrPath(_0x3af4d4))return 0x1;_0x268697[_0x5abdb4(0x124)]&&console['error'](_0x5abdb4(0x1a6)+_0x3af4d4);const {journeyId:_0x46f9e6}=await resolveJourneyIdFromInput(_0x3af4d4,_0x268697,_0x4a832e),_0x5ee8a8=await withSpinner(_0x5abdb4(0x12d),()=>_0x4a832e[_0x5abdb4(0x14a)]['getColumnMapping'](_0x46f9e6),{'verbose':_0x268697['verbose']}),_0x1363a9=_0x5ee8a8[_0x5abdb4(0x1ce)];return console[_0x5abdb4(0xf7)](_0x5abdb4(0x1b8)+_0x1363a9[_0x5abdb4(0x151)]),console['log']('Table:\x20'+_0x1363a9[_0x5abdb4(0x128)]),await handleSDKOutput(_0x1363a9['columns'],_0x268697),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0xf9);[a27_0x4a917e(0x1b7)]=a27_0x4a917e(0x1c1);async[a27_0x4a917e(0x144)](_0x53ea8f){const _0x5260c1=a27_0x4a917e,{options:_0x4d5786,args:_0x4b297b,tdx:_0x8214e9}=_0x53ea8f,_0x40cc25=_0x4b297b[0x0];if(!requireNameOrPath(_0x40cc25))return 0x1;_0x4d5786[_0x5260c1(0x124)]&&console[_0x5260c1(0x1a5)]('Input:\x20'+_0x40cc25);const {journeyId:_0x3924a5}=await resolveJourneyIdFromInput(_0x40cc25,_0x4d5786,_0x8214e9),_0x30822a=await withSpinner(_0x5260c1(0xff),()=>_0x8214e9[_0x5260c1(0x14a)][_0x5260c1(0x13f)](_0x3924a5),{'verbose':_0x4d5786[_0x5260c1(0x124)]}),_0x2c4b78=_0x30822a[_0x5260c1(0x1ce)];return console[_0x5260c1(0x1a5)](_0x5260c1(0x182)+_0x2c4b78[_0x5260c1(0x13c)]+_0x5260c1(0x1a0)+(_0x2c4b78['length']!==0x1?'s':'')),await handleSDKOutput(_0x2c4b78,_0x4d5786),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']='journey:push';[a27_0x4a917e(0x1b7)]=a27_0x4a917e(0x136);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x61d1c7){const _0x21ca91=a27_0x4a917e,_0x37379e=_0x61d1c7['args'][0x0];let _0x1e5c8b;if(_0x37379e){const _0x177455=await resolveTarget({'arg':_0x37379e,'contextParent':_0x61d1c7[_0x21ca91(0x133)]['parentSegment'],'cwd':process[_0x21ca91(0x1b0)]()});isSuccessfulResolution(_0x177455)&&_0x177455['type']==='file'&&(_0x1e5c8b=_0x177455['filePath']);}const _0x28151e={..._0x61d1c7,'options':{..._0x61d1c7[_0x21ca91(0x133)],'journeysOnly':!![],..._0x1e5c8b&&{'singleFilePath':_0x1e5c8b}}};return this[_0x21ca91(0x130)][_0x21ca91(0x144)](_0x28151e);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0x158);['description']='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x4a917e(0x144)](_0xb1fecc){const _0x57cb10=a27_0x4a917e,{options:_0x23ea96,args:_0x9a4bfd,tdx:_0x14dc58}=_0xb1fecc,_0x4ed2af=_0x9a4bfd[0x0];if(!requireNameOrPath(_0x4ed2af))return 0x1;if(_0x23ea96['verbose'])console[_0x57cb10(0x1a5)](_0x57cb10(0x1a6)+_0x4ed2af);const {journeyId:_0x45098e}=await resolveJourneyIdFromInput(_0x4ed2af,_0x23ea96,_0x14dc58),_0x311acc=await withSpinner(_0x57cb10(0x14d),()=>_0x14dc58[_0x57cb10(0x14a)][_0x57cb10(0x198)](_0x45098e),{'verbose':_0x23ea96[_0x57cb10(0x124)]}),{bundleName:_0x2db2fe,versions:_0x537bfd,latestJourneyId:_0x1c4ae6}=_0x311acc[_0x57cb10(0x1ce)];console[_0x57cb10(0x1a5)](_0x2db2fe+':\x20'+_0x537bfd[_0x57cb10(0x13c)]+_0x57cb10(0x139)+(_0x537bfd[_0x57cb10(0x13c)]!==0x1?'s':''));const _0x2272bf=_0x537bfd['map'](_0x258e18=>({'version':_0x258e18['versionNumber'],'journey_id':_0x258e18[_0x57cb10(0xf0)],'name':_0x258e18[_0x57cb10(0x126)],'state':_0x258e18[_0x57cb10(0x13b)],'paused':_0x258e18[_0x57cb10(0x12c)],'latest':_0x258e18[_0x57cb10(0xf0)]===_0x1c4ae6,'created_at':_0x258e18[_0x57cb10(0x111)]}));return await handleSDKOutput(_0x2272bf,_0x23ea96),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0x19a);[a27_0x4a917e(0x1b7)]=a27_0x4a917e(0x146);async[a27_0x4a917e(0x144)](_0x1d901a){const _0x59d19b=a27_0x4a917e,{options:_0x184141,args:_0x439ad5,tdx:_0x5f2df7}=_0x1d901a,_0x3db706=_0x439ad5[0x0];if(!requireNameOrPath(_0x3db706))return 0x1;if(_0x184141['verbose'])console['error']('Input:\x20'+_0x3db706);const {journeyId:_0x1b1ae6,journeyName:_0x383faf}=await resolveJourneyIdFromInput(_0x3db706,_0x184141,_0x5f2df7);if(!_0x184141[_0x59d19b(0x1cd)]){const _0x1f9aab=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x383faf+'\x22?');if(!_0x1f9aab)return console['error'](_0x59d19b(0x193)),0x0;}const _0x3d65c6=await withSpinner(_0x59d19b(0xd7),()=>_0x5f2df7[_0x59d19b(0x14a)][_0x59d19b(0x169)](_0x1b1ae6),{'verbose':_0x184141['verbose']}),_0x4047be=_0x3d65c6['data'];return console['error'](a27_0xf82e6a[_0x59d19b(0x19e)]('✔')+'\x20Created\x20v'+_0x4047be[_0x59d19b(0xc7)]['versionNumber']+_0x59d19b(0xc9)+_0x4047be[_0x59d19b(0xc7)]['name']+'\x22'),console[_0x59d19b(0x1a5)](_0x59d19b(0x1af)+_0x4047be['id']),await handleSingleObjectOutput({'id':_0x4047be['id'],'name':_0x4047be[_0x59d19b(0xc7)][_0x59d19b(0x126)],'version':_0x4047be['attributes'][_0x59d19b(0x1b4)],'state':_0x4047be[_0x59d19b(0xc7)][_0x59d19b(0x13b)],'bundle_id':_0x4047be[_0x59d19b(0xc7)][_0x59d19b(0x1bb)],'created_at':_0x4047be[_0x59d19b(0xc7)][_0x59d19b(0x111)]},_0x184141),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x4a917e(0x126)]=a27_0x4a917e(0xe9);[a27_0x4a917e(0x1b7)]=a27_0x4a917e(0x19d);async['execute'](_0xc8f829){const _0x5a1b3e=a27_0x4a917e,{options:_0x260cd9,args:_0x7cb0ae,tdx:_0x279940}=_0xc8f829,_0x5ec2e4=_0x7cb0ae[0x0];if(!requireNameOrPath(_0x5ec2e4))return 0x1;const _0x317d40=_0x260cd9[_0x5a1b3e(0x1c8)];if(!_0x317d40)return console['error'](_0x5a1b3e(0x138)),console['error'](_0x5a1b3e(0x170)),0x1;const _0x2bb1df=parseInt(_0x317d40,0xa);if(isNaN(_0x2bb1df)||_0x2bb1df<0x1)return console['error'](_0x5a1b3e(0xfd)+_0x317d40),0x1;if(_0x260cd9['verbose'])console['error'](_0x5a1b3e(0x1a6)+_0x5ec2e4+_0x5a1b3e(0x13d)+_0x2bb1df);const {journeyId:_0x828609,parentSegmentId:_0x41f02e}=await resolveJourneyIdFromInput(_0x5ec2e4,_0x260cd9,_0x279940),_0x4f0c8c=await withSpinner('Resolving\x20version...',()=>_0x279940[_0x5a1b3e(0x14a)][_0x5a1b3e(0x198)](_0x828609),{'verbose':_0x260cd9[_0x5a1b3e(0x124)]}),{versions:_0x14fc51,latestJourneyId:_0x514632}=_0x4f0c8c[_0x5a1b3e(0x1ce)],_0x15650a=_0x14fc51['find'](_0x5d46f5=>_0x5d46f5[_0x5a1b3e(0x1b4)]===_0x2bb1df);if(!_0x15650a){const _0x15f9f4=_0x14fc51['map'](_0x58ba32=>'v'+_0x58ba32[_0x5a1b3e(0x1b4)])[_0x5a1b3e(0xd9)](',\x20');return console[_0x5a1b3e(0x1a5)](_0x5a1b3e(0xdc)+_0x2bb1df+_0x5a1b3e(0x18c)+_0x15f9f4),0x1;}const _0x4001c1=await withSpinner(_0x5a1b3e(0x15a)+_0x2bb1df+_0x5a1b3e(0x183),()=>_0x279940['journey'][_0x5a1b3e(0xec)](_0x15650a['journeyId']),{'verbose':_0x260cd9[_0x5a1b3e(0x124)]}),_0x221fe7=_0x4001c1[_0x5a1b3e(0x1ce)],_0x3b2153=getConsoleNextUrl(_0x260cd9['site'],_0x5a1b3e(0x12b)+_0x41f02e+_0x5a1b3e(0x178)+_0x15650a[_0x5a1b3e(0xf0)]+_0x5a1b3e(0x1a4));return await handleSingleObjectOutput({'id':_0x221fe7['id'],'name':_0x221fe7['attributes'][_0x5a1b3e(0x126)],'version':_0x221fe7[_0x5a1b3e(0xc7)][_0x5a1b3e(0x1b4)],'description':_0x221fe7[_0x5a1b3e(0xc7)][_0x5a1b3e(0x1b7)],'state':_0x221fe7[_0x5a1b3e(0xc7)][_0x5a1b3e(0x13b)],'paused':_0x221fe7['attributes']['paused'],'reentry_mode':_0x221fe7[_0x5a1b3e(0xc7)][_0x5a1b3e(0x120)],'stages':_0x221fe7[_0x5a1b3e(0xc7)]['journeyStages']?.[_0x5a1b3e(0x13c)]||0x0,..._0x221fe7[_0x5a1b3e(0xc7)][_0x5a1b3e(0xe6)]&&{'goal':_0x221fe7[_0x5a1b3e(0xc7)]['goal'][_0x5a1b3e(0x126)]},'latest':_0x15650a[_0x5a1b3e(0xf0)]===_0x514632,'created_at':_0x221fe7[_0x5a1b3e(0xc7)][_0x5a1b3e(0x111)],'updated_at':_0x221fe7[_0x5a1b3e(0xc7)]['updatedAt'],'url':_0x3b2153},_0x260cd9),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x4af36e=a28_0x45bf;(function(_0x53e902,_0x3e2c8f){const _0x337608=a28_0x45bf,_0x57893e=_0x53e902();while(!![]){try{const _0x2e537c=-parseInt(_0x337608(0xf0))/0x1+-parseInt(_0x337608(0xfd))/0x2+parseInt(_0x337608(0xe6))/0x3+parseInt(_0x337608(0x10d))/0x4+-parseInt(_0x337608(0xf8))/0x5+parseInt(_0x337608(0x116))/0x6+parseInt(_0x337608(0xdf))/0x7*(parseInt(_0x337608(0xfe))/0x8);if(_0x2e537c===_0x3e2c8f)break;else _0x57893e['push'](_0x57893e['shift']());}catch(_0x5da35d){_0x57893e['push'](_0x57893e['shift']());}}}(a28_0xb65b,0x7086c));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x4dd60e from'chalk';function a28_0x45bf(_0x546fe6,_0x9c94dd){_0x546fe6=_0x546fe6-0xdf;const _0xb65b8b=a28_0xb65b();let _0x45bf39=_0xb65b8b[_0x546fe6];return _0x45bf39;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a28_0x4af36e(0xe2);[a28_0x4af36e(0x105)]=a28_0x4af36e(0x100);async[a28_0x4af36e(0x111)](_0x2c65b8){const _0x4d2801=a28_0x4af36e,{options:_0x53e0bc,args:_0x32c5a9}=_0x2c65b8,_0x5098b4=_0x53e0bc,_0x58e445=await resolveTarget({'arg':_0x32c5a9[0x0],'contextParent':_0x53e0bc[_0x4d2801(0xe9)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x58e445))return _0x58e445[_0x4d2801(0xe4)]==='no_parent'?(console[_0x4d2801(0xeb)](a28_0x4dd60e[_0x4d2801(0xe8)](_0x4d2801(0xf2))),console['error'](_0x4d2801(0xee)),console[_0x4d2801(0xeb)]('\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'),console['error'](_0x4d2801(0x10f))):(console[_0x4d2801(0xeb)](a28_0x4dd60e[_0x4d2801(0x115)](_0x4d2801(0xff)+_0x58e445['message']+'\x0a')),_0x58e445['helpText']&&console[_0x4d2801(0xeb)](a28_0x4dd60e[_0x4d2801(0x10e)](_0x58e445[_0x4d2801(0xf5)]))),0x1;const _0x242021=_0x58e445[_0x4d2801(0x112)],_0x11964e=_0x58e445[_0x4d2801(0x113)]===_0x4d2801(0xf7)?_0x58e445['filePath']:undefined;if(!_0x11964e&&!existsSync(_0x242021))return console['error'](a28_0x4dd60e[_0x4d2801(0x115)](_0x4d2801(0x108)+_0x242021+'\x0a')),0x1;let _0x195c80;if(_0x11964e){if(!_0x11964e[_0x4d2801(0xe3)](_0x4d2801(0xf1))&&!_0x11964e['endsWith']('.yaml'))return console[_0x4d2801(0xeb)](a28_0x4dd60e[_0x4d2801(0x115)](_0x4d2801(0xec)+_0x11964e+'\x0a')),0x1;_0x195c80=[_0x11964e];}else _0x195c80=findYamlFiles(_0x242021);if(_0x195c80[_0x4d2801(0xf6)]===0x0)return console[_0x4d2801(0xeb)](a28_0x4dd60e[_0x4d2801(0x115)](_0x4d2801(0x107)+_0x242021+'\x0a')),0x1;const _0x5b0c52=validateYamlFiles(_0x195c80,_0x242021,{'filterType':_0x4d2801(0xea)}),_0x15ecd8=calculateSummary(_0x5b0c52),_0x5787ae=_0x5b0c52[_0x4d2801(0xef)](isValidationResult);if(_0x5787ae[_0x4d2801(0xf6)]===0x0)return console[_0x4d2801(0xeb)](a28_0x4dd60e[_0x4d2801(0xe8)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x242021+'\x0a')),_0x15ecd8[_0x4d2801(0x102)]>0x0&&console[_0x4d2801(0xeb)](a28_0x4dd60e[_0x4d2801(0xe5)]('('+_0x15ecd8[_0x4d2801(0x102)]+_0x4d2801(0xe0))),0x0;for(const _0x4a7ba1 of _0x5b0c52){if(!isValidationResult(_0x4a7ba1)){_0x5098b4[_0x4d2801(0x114)]&&console[_0x4d2801(0x10c)](a28_0x4dd60e[_0x4d2801(0xe5)]('-\x20'+_0x4a7ba1['relativePath']+_0x4d2801(0x110)+_0x4a7ba1[_0x4d2801(0x104)]+')'));continue;}const {relativePath:_0x5a08cf,source:_0x421a45,result:_0x58b0ec}=_0x4a7ba1;if(_0x58b0ec[_0x4d2801(0x101)]&&_0x58b0ec['warnings'][_0x4d2801(0xf6)]===0x0)_0x5098b4[_0x4d2801(0x114)]&&console['log'](a28_0x4dd60e[_0x4d2801(0xfc)]('✔\x20'+_0x5a08cf));else _0x58b0ec[_0x4d2801(0x101)]?(console[_0x4d2801(0x10c)](a28_0x4dd60e[_0x4d2801(0xe8)]('⚠\x20'+_0x5a08cf+':\x20'+_0x58b0ec[_0x4d2801(0xfb)][_0x4d2801(0xf6)]+_0x4d2801(0x103))),console['log'](formatValidationResult(_0x58b0ec,_0x421a45,_0x5a08cf))):(console['log'](a28_0x4dd60e[_0x4d2801(0x115)]('✖\x20'+_0x5a08cf+':\x20'+_0x58b0ec['errors'][_0x4d2801(0xf6)]+_0x4d2801(0xed))),console[_0x4d2801(0x10c)](formatValidationResult(_0x58b0ec,_0x421a45,_0x5a08cf)));}return console[_0x4d2801(0x10c)](''),_0x15ecd8[_0x4d2801(0x10b)]?(console[_0x4d2801(0x10c)](a28_0x4dd60e[_0x4d2801(0x115)]('Validation\x20failed:\x20'+_0x15ecd8[_0x4d2801(0xf9)]+_0x4d2801(0xf3)+_0x15ecd8[_0x4d2801(0xe1)]+_0x4d2801(0x109))),_0x15ecd8['warningCount']>0x0&&console[_0x4d2801(0x10c)](a28_0x4dd60e['yellow'](_0x15ecd8[_0x4d2801(0xf4)]+_0x4d2801(0xe7))),_0x15ecd8[_0x4d2801(0x102)]>0x0&&console['log'](a28_0x4dd60e[_0x4d2801(0xe5)](_0x15ecd8[_0x4d2801(0x102)]+_0x4d2801(0x10a))),0x1):(console[_0x4d2801(0x10c)](a28_0x4dd60e[_0x4d2801(0xfc)](_0x4d2801(0x106)+_0x15ecd8[_0x4d2801(0xe1)]+_0x4d2801(0xfa))),_0x15ecd8[_0x4d2801(0xf4)]>0x0&&console['log'](a28_0x4dd60e[_0x4d2801(0xe8)](_0x15ecd8[_0x4d2801(0xf4)]+_0x4d2801(0xe7))),_0x15ecd8[_0x4d2801(0x102)]>0x0&&console[_0x4d2801(0x10c)](a28_0x4dd60e[_0x4d2801(0xe5)](_0x15ecd8[_0x4d2801(0x102)]+_0x4d2801(0x10a))),0x0);}}function a28_0xb65b(){const _0x120172=['execute','targetDir','type','verbose','red','2421906zKGsLP','42ayPGFO','\x20segment\x20file(s)\x20skipped)','validCount','journey:validate','endsWith','errorCode','dim','2468031EKITDg','\x20warning(s)\x20found','yellow','parentSegment','journey','error','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20error(s)','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','filter','574869pOmqxw','.yml','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20journey(s)\x20with\x20errors,\x20','warningCount','helpText','length','file','1829055EdBrXq','invalidCount','\x20journey(s)\x20valid','warnings','green','596144eAoZkU','55256zYrdVN','Error:\x20','Validate\x20journey\x20YAML\x20files','valid','skippedCount','\x20warning(s)','reason','description','✔\x20All\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20Directory\x20not\x20found:\x20','\x20valid','\x20segment\x20file(s)\x20skipped','hasErrors','log','1727560EDMMkC','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20(skipped:\x20'];a28_0xb65b=function(){return _0x120172;};return a28_0xb65b();}
|