@treasuredata/tdx 2026.6.0 → 2026.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +8 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/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/cdp.d.ts +4 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x68e686=a24_0x140d;function a24_0x6a76(){const _0x1eb790=['error','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','execute','configDir','\x0aPush\x20summary\x20for\x20workspace\x20\x27','templateId','Workspace\x20is\x20required.','site','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','dim','path','906194cPjRxX','setPhase','\x20errors:','✔\x20Created\x20','Aborted.','1188222QTFJgv','✔\x20Updated\x20','-\x20no\x20changes\x20applied','valid','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4755996CBpdmf','1\x20template\x20file:\x20','1168904jcwqWq','created','updated','\x20new\x20templates:','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','name','yes','def','cwd','\x0aError:','message','81JnXPbQ','\x27...','Push\x20','\x20templates','1418130gmvaED','results','workspace','Found\x20','engage_workspace','dirname','cyan','\x20templates\x20to\x20update:','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','red','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','yellow','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','config','651388tMXVAA','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','session','engage','engage:template:push','4053126EcDprB','warnings','action','resolve','data','\x20templates?','Preparing\x20push\x20to\x20workspace\x20\x27','green','errors','verbose','dryRun','20zwkQxm','\x20\x20\x20\x20'];a24_0x6a76=function(){return _0x1eb790;};return a24_0x6a76();}(function(_0x20f017,_0xe5e209){const _0x401464=a24_0x140d,_0x121420=_0x20f017();while(!![]){try{const _0x1b22b9=parseInt(_0x401464(0x1e5))/0x1+parseInt(_0x401464(0x201))/0x2+-parseInt(_0x401464(0x1ea))/0x3+parseInt(_0x401464(0x210))/0x4*(parseInt(_0x401464(0x1d8))/0x5)+parseInt(_0x401464(0x215))/0x6+-parseInt(_0x401464(0x1ef))/0x7+-parseInt(_0x401464(0x1f1))/0x8*(parseInt(_0x401464(0x1fd))/0x9);if(_0x1b22b9===_0xe5e209)break;else _0x121420['push'](_0x121420['shift']());}catch(_0x441423){_0x121420['push'](_0x121420['shift']());}}}(a24_0x6a76,0x86ae1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0xa2eb78 from'chalk';import a24_0x515500 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';function a24_0x140d(_0x334359,_0x431177){_0x334359=_0x334359-0x1d7;const _0x6a76cf=a24_0x6a76();let _0x140d20=_0x6a76cf[_0x334359];return _0x140d20;}import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x68e686(0x1f7)]=a24_0x68e686(0x214);['description']=a24_0x68e686(0x1e2);async[a24_0x68e686(0x1dc)](_0x124e87){const _0x36de03=a24_0x68e686,{options:_0x32af02,args:_0x20d234,tdx:_0x389cfd}=_0x124e87,_0x3ac680=_0x32af02,_0x1dc06a=_0x20d234[0x0],_0x87d8ef=_0x1dc06a?a24_0x515500[_0x36de03(0x218)](_0x1dc06a):undefined,_0x4b1792=_0x87d8ef?isYamlFile(_0x87d8ef):![];let _0x567138;if(_0x4b1792&&_0x87d8ef)_0x567138=a24_0x515500[_0x36de03(0x206)](_0x87d8ef);else _0x87d8ef?_0x567138=_0x87d8ef:_0x567138=process[_0x36de03(0x1fa)]();let _0xa171db;const _0x490854=tryFindTdxConfig(_0x567138);_0x490854?.[_0x36de03(0x20f)]['engage_workspace']&&(_0xa171db=_0x490854[_0x36de03(0x20f)]['engage_workspace'],!_0x4b1792&&(_0x567138=_0x490854[_0x36de03(0x1dd)]));_0x3ac680[_0x36de03(0x203)]&&(_0xa171db=_0x3ac680[_0x36de03(0x203)]);if(!_0xa171db){const _0x241507=loadSessionContext(_0x3ac680[_0x36de03(0x212)]);_0x241507?.[_0x36de03(0x205)]&&(_0xa171db=_0x241507[_0x36de03(0x205)]);}if(!_0xa171db)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x1e0))),console['error'](_0x36de03(0x20a)),console[_0x36de03(0x1da)](_0x36de03(0x1db)),console[_0x36de03(0x1da)](_0x36de03(0x1f6)),console[_0x36de03(0x1da)](_0x36de03(0x209)),0x1;let _0x4ba940;_0x4b1792&&_0x87d8ef?_0x4ba940=[parseTemplateFile(_0x87d8ef,a24_0x515500[_0x36de03(0x206)](_0x87d8ef))]:_0x4ba940=discoverAndParseTemplateFiles(_0x567138);if(_0x4ba940[_0x36de03(0x1f5)]===0x0)return console['error'](a24_0xa2eb78[_0x36de03(0x20d)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x567138)),console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x1e3)](_0x36de03(0x20e))),0x1;const _0x1487b4=_0x4ba940[_0x36de03(0x1f5)]===0x1?_0x36de03(0x1f0)+_0x4ba940[0x0][_0x36de03(0x1f9)][_0x36de03(0x1f7)]:_0x4ba940[_0x36de03(0x1f5)]+'\x20template\x20files';console[_0x36de03(0x1da)](_0x36de03(0x204)+a24_0xa2eb78[_0x36de03(0x207)](_0x1487b4));let _0x1c0361=![];for(const _0x391045 of _0x4ba940){const _0x1cc900=validateTemplateDef(_0x391045[_0x36de03(0x1f9)]);if(!_0x1cc900[_0x36de03(0x1ed)]){_0x1c0361=!![],console['error'](a24_0xa2eb78[_0x36de03(0x20b)]('\x0aValidation\x20errors\x20in\x20'+_0x391045['relativePath']+':'));for(const _0x41278d of _0x1cc900[_0x36de03(0x21d)]){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78['red']('✗')+'\x20'+_0x41278d[_0x36de03(0x1e4)]+':\x20'+_0x41278d[_0x36de03(0x1fc)]);}}for(const _0x2c5d6b of _0x1cc900[_0x36de03(0x216)]){console['error']('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20d)]('⚠')+'\x20'+_0x2c5d6b['path']+':\x20'+_0x2c5d6b['message']);}}if(_0x1c0361)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20b)](_0x36de03(0x211))),0x1;const _0x5e1b8f=await _0x389cfd[_0x36de03(0x213)]['resolveWorkspaceId'](_0xa171db),_0x4161f7=await withProgressSpinner(_0x36de03(0x21b)+_0xa171db+_0x36de03(0x1fe),_0x1c6851=>preparePush({'engage':_0x389cfd['engage']},_0x4ba940,_0x5e1b8f,{'progress':{'update':_0x5281b3=>_0x1c6851[_0x36de03(0x1e6)](_0x5281b3)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]}),_0x270bda=_0x4161f7[_0x36de03(0x219)];await withProgressSpinner('Resolving\x20references...',_0x3a253e=>resolveAndBuildInputs({'engage':_0x389cfd[_0x36de03(0x213)]},_0x270bda,_0x5e1b8f,{'progress':{'update':_0xfdc96=>_0x3a253e[_0x36de03(0x1e6)](_0xfdc96)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]});const _0x54bff2=_0x270bda['filter'](_0x5cf4d8=>_0x5cf4d8[_0x36de03(0x217)]==='create'),_0x3831b9=_0x270bda['filter'](_0x4fe271=>_0x4fe271['action']==='update');console[_0x36de03(0x1da)](_0x36de03(0x1de)+_0xa171db+'\x27:');if(_0x54bff2[_0x36de03(0x1f5)]>0x0){console['error']('\x20\x20'+a24_0xa2eb78[_0x36de03(0x21c)]('+\x20'+_0x54bff2[_0x36de03(0x1f5)]+_0x36de03(0x1f4)));for(const _0x561c3e of _0x54bff2){console[_0x36de03(0x1da)]('\x20\x20\x20\x20'+a24_0xa2eb78[_0x36de03(0x21c)]('+')+'\x20'+_0x561c3e[_0x36de03(0x1f9)][_0x36de03(0x1f7)]);}}if(_0x3831b9['length']>0x0){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20d)]('~\x20'+_0x3831b9['length']+_0x36de03(0x208)));for(const _0xe60fb0 of _0x3831b9){console[_0x36de03(0x1da)](_0x36de03(0x1d9)+a24_0xa2eb78[_0x36de03(0x20d)]('~')+'\x20'+_0xe60fb0[_0x36de03(0x1f9)][_0x36de03(0x1f7)]);}}if(_0x54bff2[_0x36de03(0x1f5)]===0x0&&_0x3831b9[_0x36de03(0x1f5)]===0x0)return console['error'](a24_0xa2eb78[_0x36de03(0x21c)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x3ac680[_0x36de03(0x1d7)])return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x20c))),0x0;if(!_0x3ac680[_0x36de03(0x1f8)]){if(!isInteractive())return console['error'](a24_0xa2eb78['red'](_0x36de03(0x1fb)),_0x36de03(0x1ee)),console['error'](a24_0xa2eb78[_0x36de03(0x1e3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x28ddba=await confirmKey(_0x36de03(0x1ff)+(_0x54bff2[_0x36de03(0x1f5)]+_0x3831b9[_0x36de03(0x1f5)])+_0x36de03(0x21a));if(!_0x28ddba)return console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x20d)](_0x36de03(0x1e9)),_0x36de03(0x1ec)),0x1;}const _0x2a87dc=await withProgressSpinner('Pushing\x20templates...',_0xb89116=>executePush({'engage':_0x389cfd[_0x36de03(0x213)]},_0x270bda,{'progress':{'update':_0x19f8c3=>_0xb89116[_0x36de03(0x1e6)](_0x19f8c3)}}),{'verbose':_0x3ac680[_0x36de03(0x21e)]}),_0x130c00=_0x2a87dc[_0x36de03(0x219)];for(const _0x35b96c of _0x130c00[_0x36de03(0x202)]){if(_0x35b96c[_0x36de03(0x1df)]&&(_0x35b96c[_0x36de03(0x217)]==='created'||_0x35b96c[_0x36de03(0x217)]==='updated')){const _0x5afb2f=getTemplateUrl(_0x3ac680[_0x36de03(0x1e1)],_0x5e1b8f,_0x35b96c['templateId']),_0x5475e0=_0x35b96c['action']===_0x36de03(0x1f2)?'+':'~',_0x2263cc=_0x35b96c['action']===_0x36de03(0x1f2)?a24_0xa2eb78[_0x36de03(0x21c)](_0x5475e0):a24_0xa2eb78[_0x36de03(0x20d)](_0x5475e0);console[_0x36de03(0x1da)]('\x20\x20'+_0x2263cc+'\x20'+hyperlink(_0x35b96c[_0x36de03(0x1f7)],_0x5afb2f)+'\x20'+a24_0xa2eb78['dim'](_0x5afb2f));}}_0x130c00[_0x36de03(0x1f2)]>0x0&&console[_0x36de03(0x1da)](a24_0xa2eb78['green'](_0x36de03(0x1e8)+_0x130c00[_0x36de03(0x1f2)]+_0x36de03(0x200)));_0x130c00[_0x36de03(0x1f3)]>0x0&&console[_0x36de03(0x1da)](a24_0xa2eb78[_0x36de03(0x21c)](_0x36de03(0x1eb)+_0x130c00['updated']+'\x20templates'));if(_0x130c00[_0x36de03(0x21d)][_0x36de03(0x1f5)]>0x0){console['error'](a24_0xa2eb78[_0x36de03(0x20b)]('✘\x20'+_0x130c00['errors'][_0x36de03(0x1f5)]+_0x36de03(0x1e7)));for(const _0x2c8b30 of _0x130c00['errors']){console[_0x36de03(0x1da)]('\x20\x20'+a24_0xa2eb78[_0x36de03(0x20b)](_0x2c8b30['name'])+':\x20'+_0x2c8b30[_0x36de03(0x1da)]);}}return saveSessionContext({'engage_workspace':_0xa171db},_0x3ac680[_0x36de03(0x212)]),_0x130c00['errors']['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a24_0x19b1a3=a24_0x46ca;(function(_0x532635,_0x1c1341){const _0x3f9dfd=a24_0x46ca,_0x239c63=_0x532635();while(!![]){try{const _0x334156=parseInt(_0x3f9dfd(0x1a2))/0x1*(parseInt(_0x3f9dfd(0x16f))/0x2)+-parseInt(_0x3f9dfd(0x19b))/0x3+-parseInt(_0x3f9dfd(0x155))/0x4*(-parseInt(_0x3f9dfd(0x174))/0x5)+-parseInt(_0x3f9dfd(0x154))/0x6*(parseInt(_0x3f9dfd(0x166))/0x7)+parseInt(_0x3f9dfd(0x1a0))/0x8+parseInt(_0x3f9dfd(0x168))/0x9*(-parseInt(_0x3f9dfd(0x16b))/0xa)+parseInt(_0x3f9dfd(0x197))/0xb*(parseInt(_0x3f9dfd(0x161))/0xc);if(_0x334156===_0x1c1341)break;else _0x239c63['push'](_0x239c63['shift']());}catch(_0x57468e){_0x239c63['push'](_0x239c63['shift']());}}}(a24_0x9393,0xb72f0));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x40f081 from'chalk';import a24_0x2f4f86 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';function a24_0x46ca(_0x2eb27c,_0x779958){_0x2eb27c=_0x2eb27c-0x154;const _0x93935e=a24_0x9393();let _0x46cac2=_0x93935e[_0x2eb27c];return _0x46cac2;}import{validateTemplateDef}from'../sdk/engage/template-validator.js';function a24_0x9393(){const _0x1b8f9b=['21938yCLXjI','Workspace\x20is\x20required.','3015ZpMwgF','-\x20no\x20changes\x20applied','data','32220mIloMy','Aborted.','path','configDir','1191134HdRvia','yellow','action','errors','green','55NsHMwE','def','\x0aError:','results','created','✔\x20Created\x20','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','cwd','yes','update','1\x20template\x20file:\x20','warnings','\x20\x20\x20\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','engage','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','No\x20template\x20YAML\x20files\x20found\x20in\x20','red','dim','\x20errors:','create','config','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','engage_workspace','✔\x20All\x20templates\x20are\x20up\x20to\x20date','\x20template\x20files','name','resolve','resolveWorkspaceId','cyan','length','Found\x20','\x0aValidation\x20errors\x20in\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','33AvpWGy','updated','Push\x20','\x20templates','2164575ovUZKn','\x27...','\x20templates?','\x20new\x20templates:','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','2688776IMYtxz','Pushing\x20templates...','2FWNpXA','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','6RPxwUh','234844JpvADy','setPhase','relativePath','execute','Resolving\x20references...','✔\x20Updated\x20','error','valid','templateId','workspace','\x20templates\x20to\x20update:','dirname','1525188nRyPzI','verbose','session','engage:template:push','dryRun'];a24_0x9393=function(){return _0x1b8f9b;};return a24_0x9393();}import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x19b1a3(0x18f)]=a24_0x19b1a3(0x164);['description']=a24_0x19b1a3(0x182);async[a24_0x19b1a3(0x158)](_0x2e16f0){const _0x292945=a24_0x19b1a3,{options:_0x11e272,args:_0x60c7ed,tdx:_0x394ac6}=_0x2e16f0,_0x29270e=_0x11e272,_0x57ca35=_0x60c7ed[0x0],_0x1d1fe6=_0x57ca35?a24_0x2f4f86[_0x292945(0x190)](_0x57ca35):undefined,_0x39ea91=_0x1d1fe6?isYamlFile(_0x1d1fe6):![];let _0x11e756;if(_0x39ea91&&_0x1d1fe6)_0x11e756=a24_0x2f4f86[_0x292945(0x160)](_0x1d1fe6);else _0x1d1fe6?_0x11e756=_0x1d1fe6:_0x11e756=process[_0x292945(0x17c)]();let _0x4e18b3;const _0x115cdd=tryFindTdxConfig(_0x11e756);_0x115cdd?.[_0x292945(0x18a)][_0x292945(0x18c)]&&(_0x4e18b3=_0x115cdd['config'][_0x292945(0x18c)],!_0x39ea91&&(_0x11e756=_0x115cdd[_0x292945(0x16e)]));_0x29270e[_0x292945(0x15e)]&&(_0x4e18b3=_0x29270e[_0x292945(0x15e)]);if(!_0x4e18b3){const _0x278227=loadSessionContext(_0x29270e[_0x292945(0x163)]);_0x278227?.[_0x292945(0x18c)]&&(_0x4e18b3=_0x278227[_0x292945(0x18c)]);}if(!_0x4e18b3)return console[_0x292945(0x15b)](a24_0x40f081['yellow'](_0x292945(0x167))),console[_0x292945(0x15b)](_0x292945(0x1a3)),console[_0x292945(0x15b)](_0x292945(0x18b)),console[_0x292945(0x15b)](_0x292945(0x17b)),console[_0x292945(0x15b)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x30e172;_0x39ea91&&_0x1d1fe6?_0x30e172=[parseTemplateFile(_0x1d1fe6,a24_0x2f4f86[_0x292945(0x160)](_0x1d1fe6))]:_0x30e172=discoverAndParseTemplateFiles(_0x11e756);if(_0x30e172[_0x292945(0x193)]===0x0)return console['error'](a24_0x40f081[_0x292945(0x170)](_0x292945(0x185)+_0x11e756)),console['error'](a24_0x40f081['dim'](_0x292945(0x19f))),0x1;const _0x159132=_0x30e172[_0x292945(0x193)]===0x1?_0x292945(0x17f)+_0x30e172[0x0]['def'][_0x292945(0x18f)]:_0x30e172[_0x292945(0x193)]+_0x292945(0x18e);console[_0x292945(0x15b)](_0x292945(0x194)+a24_0x40f081[_0x292945(0x192)](_0x159132));let _0x10a78b=![];for(const _0x57b8d3 of _0x30e172){const _0x9b9a8e=validateTemplateDef(_0x57b8d3[_0x292945(0x175)]);if(!_0x9b9a8e[_0x292945(0x15c)]){_0x10a78b=!![],console[_0x292945(0x15b)](a24_0x40f081['red'](_0x292945(0x195)+_0x57b8d3[_0x292945(0x157)]+':'));for(const _0x5c9b94 of _0x9b9a8e['errors']){console[_0x292945(0x15b)]('\x20\x20'+a24_0x40f081[_0x292945(0x186)]('✗')+'\x20'+_0x5c9b94[_0x292945(0x16d)]+':\x20'+_0x5c9b94['message']);}}for(const _0x38097e of _0x9b9a8e[_0x292945(0x180)]){console[_0x292945(0x15b)]('\x20\x20'+a24_0x40f081[_0x292945(0x170)]('⚠')+'\x20'+_0x38097e[_0x292945(0x16d)]+':\x20'+_0x38097e[_0x292945(0x17a)]);}}if(_0x10a78b)return console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x186)](_0x292945(0x184))),0x1;const _0x19b4c5=await _0x394ac6[_0x292945(0x183)][_0x292945(0x191)](_0x4e18b3),_0x201469=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x4e18b3+_0x292945(0x19c),_0x21e47c=>preparePush({'engage':_0x394ac6['engage']},_0x30e172,_0x19b4c5,{'progress':{'update':_0x3c4eb0=>_0x21e47c[_0x292945(0x156)](_0x3c4eb0)}}),{'verbose':_0x29270e['verbose']}),_0x3665b9=_0x201469[_0x292945(0x16a)];await withProgressSpinner(_0x292945(0x159),_0x13c759=>resolveAndBuildInputs({'engage':_0x394ac6['engage']},_0x3665b9,_0x19b4c5,{'progress':{'update':_0x487319=>_0x13c759[_0x292945(0x156)](_0x487319)}}),{'verbose':_0x29270e[_0x292945(0x162)]});const _0xeca276=_0x3665b9['filter'](_0x1fdd2c=>_0x1fdd2c['action']===_0x292945(0x189)),_0x1a9895=_0x3665b9['filter'](_0x3d8337=>_0x3d8337['action']===_0x292945(0x17e));console[_0x292945(0x15b)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x4e18b3+'\x27:');if(_0xeca276[_0x292945(0x193)]>0x0){console['error']('\x20\x20'+a24_0x40f081[_0x292945(0x173)]('+\x20'+_0xeca276[_0x292945(0x193)]+_0x292945(0x19e)));for(const _0xf9ca8 of _0xeca276){console['error'](_0x292945(0x181)+a24_0x40f081[_0x292945(0x173)]('+')+'\x20'+_0xf9ca8['def'][_0x292945(0x18f)]);}}if(_0x1a9895[_0x292945(0x193)]>0x0){console[_0x292945(0x15b)]('\x20\x20'+a24_0x40f081[_0x292945(0x170)]('~\x20'+_0x1a9895[_0x292945(0x193)]+_0x292945(0x15f)));for(const _0x2a96cd of _0x1a9895){console[_0x292945(0x15b)](_0x292945(0x181)+a24_0x40f081[_0x292945(0x170)]('~')+'\x20'+_0x2a96cd[_0x292945(0x175)][_0x292945(0x18f)]);}}if(_0xeca276[_0x292945(0x193)]===0x0&&_0x1a9895[_0x292945(0x193)]===0x0)return console['error'](a24_0x40f081[_0x292945(0x173)](_0x292945(0x18d))),0x0;if(_0x29270e[_0x292945(0x165)])return console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x170)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x29270e[_0x292945(0x17d)]){if(!isInteractive())return console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x186)](_0x292945(0x176)),_0x292945(0x196)),console[_0x292945(0x15b)](a24_0x40f081['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x384314=await confirmKey(_0x292945(0x199)+(_0xeca276[_0x292945(0x193)]+_0x1a9895[_0x292945(0x193)])+_0x292945(0x19d));if(!_0x384314)return console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x170)](_0x292945(0x16c)),_0x292945(0x169)),0x1;}const _0x1dd781=await withProgressSpinner(_0x292945(0x1a1),_0x41ad74=>executePush({'engage':_0x394ac6['engage']},_0x3665b9,{'progress':{'update':_0x52ed76=>_0x41ad74['setPhase'](_0x52ed76)}}),{'verbose':_0x29270e[_0x292945(0x162)]}),_0x439f5f=_0x1dd781[_0x292945(0x16a)];for(const _0x3565a8 of _0x439f5f[_0x292945(0x177)]){if(_0x3565a8[_0x292945(0x15d)]&&(_0x3565a8[_0x292945(0x171)]==='created'||_0x3565a8[_0x292945(0x171)]===_0x292945(0x198))){const _0x372d05=getTemplateUrl(_0x29270e['site'],_0x19b4c5,_0x3565a8[_0x292945(0x15d)]),_0x2ede61=_0x3565a8[_0x292945(0x171)]===_0x292945(0x178)?'+':'~',_0x4ddcd3=_0x3565a8[_0x292945(0x171)]===_0x292945(0x178)?a24_0x40f081[_0x292945(0x173)](_0x2ede61):a24_0x40f081['yellow'](_0x2ede61);console[_0x292945(0x15b)]('\x20\x20'+_0x4ddcd3+'\x20'+hyperlink(_0x3565a8['name'],_0x372d05)+'\x20'+a24_0x40f081[_0x292945(0x187)](_0x372d05));}}_0x439f5f[_0x292945(0x178)]>0x0&&console[_0x292945(0x15b)](a24_0x40f081[_0x292945(0x173)](_0x292945(0x179)+_0x439f5f[_0x292945(0x178)]+_0x292945(0x19a)));_0x439f5f['updated']>0x0&&console[_0x292945(0x15b)](a24_0x40f081['green'](_0x292945(0x15a)+_0x439f5f[_0x292945(0x198)]+_0x292945(0x19a)));if(_0x439f5f['errors']['length']>0x0){console[_0x292945(0x15b)](a24_0x40f081['red']('✘\x20'+_0x439f5f[_0x292945(0x172)]['length']+_0x292945(0x188)));for(const _0x3bd728 of _0x439f5f[_0x292945(0x172)]){console[_0x292945(0x15b)]('\x20\x20'+a24_0x40f081[_0x292945(0x186)](_0x3bd728[_0x292945(0x18f)])+':\x20'+_0x3bd728[_0x292945(0x15b)]);}}return saveSessionContext({'engage_workspace':_0x4e18b3},_0x29270e[_0x292945(0x163)]),_0x439f5f[_0x292945(0x172)][_0x292945(0x193)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x2885aa=a25_0x3514;(function(_0x5307cb,_0x13dc7d){const _0x27f516=a25_0x3514,_0x2de732=_0x5307cb();while(!![]){try{const _0x344fff=parseInt(_0x27f516(0xf8))/0x1*(-parseInt(_0x27f516(0xd8))/0x2)+parseInt(_0x27f516(0xd5))/0x3+parseInt(_0x27f516(0xfb))/0x4+-parseInt(_0x27f516(0xf3))/0x5*(-parseInt(_0x27f516(0xf0))/0x6)+-parseInt(_0x27f516(0xd4))/0x7+parseInt(_0x27f516(0xdd))/0x8+-parseInt(_0x27f516(0xee))/0x9;if(_0x344fff===_0x13dc7d)break;else _0x2de732['push'](_0x2de732['shift']());}catch(_0x3f3eb7){_0x2de732['push'](_0x2de732['shift']());}}}(a25_0x5949,0xc7bb2));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x22539a from'chalk';import a25_0x248011 from'path';function a25_0x3514(_0x40b676,_0x3a8b7f){_0x40b676=_0x40b676-0xce;const _0x59490c=a25_0x5949();let _0x35147f=_0x59490c[_0x40b676];return _0x35147f;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a25_0x5949(){const _0x131541=['\x20warning(s)','1666364RRzUtA','description','Validation\x20failed:\x20','log','template','dirname','Error:\x20Directory\x20not\x20found:\x20','No\x20template\x20YAML\x20files\x20found\x20in\x20','cwd','red','483434VeJvVd','2662662CiQTuL','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20template(s)\x20valid','1966jkJjes','resolve','green','dim','name','12360800GTJDZk','verbose','.yml','valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','hasErrors','\x20non-template\x20file(s)\x20skipped','reason','invalidCount','\x20(skipped:\x20','✔\x20All\x20','validCount','error','\x20template(s)\x20with\x20errors,\x20','warningCount','engage:template:validate','20977470rgEDwY','yellow','12zjJGai','Validate\x20template\x20YAML\x20files','\x20valid','3897895FaTiOq','relativePath','skippedCount','.yaml','\x20non-template\x20file(s)\x20skipped)','1211GcAxrV','endsWith'];a25_0x5949=function(){return _0x131541;};return a25_0x5949();}export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x2885aa(0xdc)]=a25_0x2885aa(0xed);[a25_0x2885aa(0xfc)]=a25_0x2885aa(0xf1);async['execute'](_0x153c59){const _0x2e88cf=a25_0x2885aa,{options:_0x486c43,args:_0x584ac9}=_0x153c59,_0x487d6d=_0x486c43,_0xd3205c=_0x584ac9[0x0],_0x522373=_0xd3205c?a25_0x248011[_0x2e88cf(0xd9)](_0xd3205c):undefined,_0x59efa6=_0x522373?isYamlFile(_0x522373):![];let _0x41c375,_0x4a29a6;if(_0x59efa6&&_0x522373)_0x41c375=a25_0x248011[_0x2e88cf(0xcf)](_0x522373),_0x4a29a6=_0x522373;else _0x522373?_0x41c375=_0x522373:_0x41c375=process[_0x2e88cf(0xd2)]();if(!_0x4a29a6&&!existsSync(_0x41c375))return console['error'](a25_0x22539a[_0x2e88cf(0xd3)](_0x2e88cf(0xd0)+_0x41c375+'\x0a')),0x1;let _0x3e4cc1;if(_0x4a29a6){if(!_0x4a29a6['endsWith'](_0x2e88cf(0xdf))&&!_0x4a29a6[_0x2e88cf(0xf9)](_0x2e88cf(0xf6)))return console[_0x2e88cf(0xea)](a25_0x22539a[_0x2e88cf(0xd3)](_0x2e88cf(0xd6)+_0x4a29a6+'\x0a')),0x1;_0x3e4cc1=[_0x4a29a6];}else _0x3e4cc1=findYamlFiles(_0x41c375);if(_0x3e4cc1[_0x2e88cf(0xe2)]===0x0)return console[_0x2e88cf(0xea)](a25_0x22539a[_0x2e88cf(0xd3)](_0x2e88cf(0xe1)+_0x41c375+'\x0a')),0x1;const _0x3d3348=validateYamlFiles(_0x3e4cc1,_0x41c375,{'filterType':_0x2e88cf(0xce)}),_0x571ff7=calculateSummary(_0x3d3348),_0x23a39d=_0x3d3348['filter'](isValidationResult);if(_0x23a39d['length']===0x0)return console[_0x2e88cf(0xea)](a25_0x22539a[_0x2e88cf(0xef)](_0x2e88cf(0xd1)+_0x41c375+'\x0a')),_0x571ff7[_0x2e88cf(0xf5)]>0x0&&console[_0x2e88cf(0xea)](a25_0x22539a[_0x2e88cf(0xdb)]('('+_0x571ff7[_0x2e88cf(0xf5)]+_0x2e88cf(0xf7))),0x0;for(const _0xf37d05 of _0x3d3348){if(!isValidationResult(_0xf37d05)){_0x487d6d[_0x2e88cf(0xde)]&&console['log'](a25_0x22539a[_0x2e88cf(0xdb)]('-\x20'+_0xf37d05[_0x2e88cf(0xf4)]+_0x2e88cf(0xe7)+_0xf37d05[_0x2e88cf(0xe5)]+')'));continue;}const {relativePath:_0x45a421,source:_0x54415d,result:_0x49a902}=_0xf37d05;if(_0x49a902[_0x2e88cf(0xe0)]&&_0x49a902['warnings'][_0x2e88cf(0xe2)]===0x0)_0x487d6d[_0x2e88cf(0xde)]&&console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xda)]('✔\x20'+_0x45a421));else _0x49a902['valid']?(console['log'](a25_0x22539a[_0x2e88cf(0xef)]('⚠\x20'+_0x45a421+':\x20'+_0x49a902['warnings'][_0x2e88cf(0xe2)]+_0x2e88cf(0xfa))),console['log'](formatValidationResult(_0x49a902,_0x54415d,_0x45a421))):(console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xd3)]('✖\x20'+_0x45a421+':\x20'+_0x49a902['errors'][_0x2e88cf(0xe2)]+'\x20error(s)')),console[_0x2e88cf(0xfe)](formatValidationResult(_0x49a902,_0x54415d,_0x45a421)));}return console['log'](''),_0x571ff7[_0x2e88cf(0xe3)]?(console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xd3)](_0x2e88cf(0xfd)+_0x571ff7[_0x2e88cf(0xe6)]+_0x2e88cf(0xeb)+_0x571ff7['validCount']+_0x2e88cf(0xf2))),_0x571ff7[_0x2e88cf(0xec)]>0x0&&console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xef)](_0x571ff7['warningCount']+'\x20warning(s)\x20found')),_0x571ff7['skippedCount']>0x0&&console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xdb)](_0x571ff7[_0x2e88cf(0xf5)]+_0x2e88cf(0xe4))),0x1):(console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xda)](_0x2e88cf(0xe8)+_0x571ff7[_0x2e88cf(0xe9)]+_0x2e88cf(0xd7))),_0x571ff7[_0x2e88cf(0xec)]>0x0&&console['log'](a25_0x22539a[_0x2e88cf(0xef)](_0x571ff7['warningCount']+'\x20warning(s)\x20found')),_0x571ff7['skippedCount']>0x0&&console[_0x2e88cf(0xfe)](a25_0x22539a[_0x2e88cf(0xdb)](_0x571ff7[_0x2e88cf(0xf5)]+_0x2e88cf(0xe4))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x16265d=a26_0x8100;(function(_0x126985,_0x14699d){const _0x283a9e=a26_0x8100,_0x25579b=_0x126985();while(!![]){try{const _0x45457c=-parseInt(_0x283a9e(0x1c0))/0x1*(parseInt(_0x283a9e(0x1b9))/0x2)+-parseInt(_0x283a9e(0x1a4))/0x3*(parseInt(_0x283a9e(0x1c1))/0x4)+parseInt(_0x283a9e(0x1bc))/0x5*(-parseInt(_0x283a9e(0x1ac))/0x6)+parseInt(_0x283a9e(0x1d6))/0x7*(parseInt(_0x283a9e(0x193))/0x8)+parseInt(_0x283a9e(0x1c7))/0x9+-parseInt(_0x283a9e(0x191))/0xa*(parseInt(_0x283a9e(0x1d8))/0xb)+parseInt(_0x283a9e(0x1a8))/0xc*(parseInt(_0x283a9e(0x1e7))/0xd);if(_0x45457c===_0x14699d)break;else _0x25579b['push'](_0x25579b['shift']());}catch(_0x2c1813){_0x25579b['push'](_0x25579b['shift']());}}}(a26_0xfd63,0x5dfc7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a26_0xfd63(){const _0x1f8a12=['Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','round','\x20row','success','Show\x20job\x20details','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','substring','presto','join','d\x20ago','push','130686bdOsHC','priority','✔\x20Job\x20submitted','database','44376wWFJsD','end_at','Database:\x20','trino','2999556urORqm','No\x20SQL\x20statements\x20found\x20in\x20file','map','user_name','now','job_id','args','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','start_at','site','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','execute','4BFHvjg','status','error','5wFaHCg','List\x20jobs','length','Submit\x20a\x20job','97943WYLQyx','44KQtXEV','INVALID_ARGUMENT','kill','✔\x20Retrieved\x20','jobs','getTime','5653116eoHPTE','validate','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job:kill','\x20jobs','yes','floor','data','mo\x20ago','verbose','limit','Get\x20job\x20results','Status\x20filter:\x20','created_at','information_schema','68656aZalJO','result','133617AfpSZZ','name','type','description','file','Submitting\x20kill\x20request...','dim','Listing\x20jobs...','debug','\x20job','submit','Submitting\x20job...','\x20\x20Job\x20ID:\x20','Cancelled','Getting\x20job\x20results...','2639InqvWz','h\x20ago','url','Limit:\x20','show','just\x20now','✔\x20Found\x20','190goJGVe','query','336kIBZmh','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','green','m\x20ago','abs'];a26_0xfd63=function(){return _0x1f8a12;};return a26_0xfd63();}import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x2942b7 from'chalk';function formatDuration(_0x4c4e71){const _0x486441=a26_0x8100;if(_0x4c4e71<0x3c)return _0x4c4e71+'s';if(_0x4c4e71<0xe10)return Math[_0x486441(0x1cd)](_0x4c4e71/0x3c)+'m\x20'+_0x4c4e71%0x3c+'s';const _0x315548=Math['floor'](_0x4c4e71/0xe10),_0x1bb5ca=Math[_0x486441(0x1cd)](_0x4c4e71%0xe10/0x3c);return _0x1bb5ca>0x0?_0x315548+'h\x20'+_0x1bb5ca+'m':_0x315548+'h';}function formatRelativeTime(_0x1f994f){const _0x212f80=a26_0x8100,_0x5f3e81=Date[_0x212f80(0x1b0)]()-_0x1f994f[_0x212f80(0x1c6)](),_0x4a5aee=Math[_0x212f80(0x1cd)](Math[_0x212f80(0x198)](_0x5f3e81)/0x3e8);if(_0x4a5aee<0x3c)return _0x212f80(0x1ec);const _0x5a36c3=Math[_0x212f80(0x1cd)](_0x4a5aee/0x3c);if(_0x5a36c3<0x3c)return _0x5a36c3+_0x212f80(0x197);const _0x40a5a7=Math[_0x212f80(0x1cd)](_0x5a36c3/0x3c);if(_0x40a5a7<0x18)return _0x40a5a7+_0x212f80(0x1e8);const _0x5aaf8c=Math[_0x212f80(0x1cd)](_0x40a5a7/0x18);if(_0x5aaf8c<0x1e)return _0x5aaf8c+_0x212f80(0x1a2);return Math[_0x212f80(0x1cd)](_0x5aaf8c/0x1e)+_0x212f80(0x1cf);}export class JobListCommand extends BaseCommand{[a26_0x16265d(0x1d9)]=a26_0x16265d(0x1c5);['description']=a26_0x16265d(0x1bd);async[a26_0x16265d(0x1b8)](_0x3c3f70){const _0x447bf5=a26_0x16265d,{options:_0x531024,tdx:_0x11bb08}=_0x3c3f70,_0x3f6323=resolveLimit(_0x531024[_0x447bf5(0x1d1)],DEFAULT_DISPLAY_LIMIT),_0x179dbf=_0x531024[_0x447bf5(0x1ba)];_0x531024[_0x447bf5(0x1d0)]&&(console[_0x447bf5(0x1bb)](_0x447bf5(0x1ea)+_0x3f6323+_0x447bf5(0x1cb)),_0x179dbf&&console['error'](_0x447bf5(0x1d3)+_0x179dbf));const _0x4abb8f=await withSpinner(_0x447bf5(0x1df),()=>_0x11bb08['jobs']['list']({'from':0x0,'to':_0x3f6323-0x1,'status':_0x179dbf}),{'verbose':_0x531024['verbose']}),_0x5cb73e=_0x4abb8f['data'];console[_0x447bf5(0x1bb)](_0x447bf5(0x1ed)+_0x5cb73e['length']+_0x447bf5(0x1e1)+(_0x5cb73e[_0x447bf5(0x1be)]!==0x1?'s':''));const _0x58e974=_0x531024[_0x447bf5(0x1b6)];if(isStructuredFormat(_0x531024)){const _0xe48e57=_0x5cb73e[_0x447bf5(0x1ae)](_0x52f4eb=>{const _0x2ea552=_0x447bf5;let _0xce87c5;if(_0x52f4eb['start_at']&&_0x52f4eb[_0x2ea552(0x1a9)]){const _0x50a845=new Date(_0x52f4eb['start_at'])[_0x2ea552(0x1c6)](),_0x4bd04b=new Date(_0x52f4eb[_0x2ea552(0x1a9)])[_0x2ea552(0x1c6)]();_0xce87c5=Math[_0x2ea552(0x19a)]((_0x4bd04b-_0x50a845)/0x3e8);}return{'job_id':_0x52f4eb[_0x2ea552(0x1b1)],'type':_0x52f4eb[_0x2ea552(0x1da)]===_0x2ea552(0x1a0)?_0x2ea552(0x1ab):_0x52f4eb[_0x2ea552(0x1da)],'status':_0x52f4eb[_0x2ea552(0x1ba)],'user_name':_0x52f4eb[_0x2ea552(0x1af)],'duration_sec':_0xce87c5,'created_at':_0x52f4eb['created_at'],'started_at':_0x52f4eb[_0x2ea552(0x1b5)],'end_at':_0x52f4eb[_0x2ea552(0x1a9)]};});await handleSDKOutput(_0xe48e57,_0x531024);}else for(const _0x583ce2 of _0x5cb73e){const _0x69dc07=_0x583ce2[_0x447bf5(0x1ba)]===_0x447bf5(0x19c)?a26_0x2942b7[_0x447bf5(0x196)]:_0x583ce2[_0x447bf5(0x1ba)]==='error'?a26_0x2942b7['red']:a26_0x2942b7[_0x447bf5(0x1de)],_0x201de5=_0x69dc07(_0x583ce2[_0x447bf5(0x1ba)]),_0x18908e=getJobUrl(_0x58e974,_0x583ce2[_0x447bf5(0x1b1)]),_0x2ac982=hyperlink(_0x583ce2[_0x447bf5(0x1b1)],_0x18908e),_0x1bfef2=a26_0x2942b7[_0x447bf5(0x1de)](_0x583ce2[_0x447bf5(0x1da)]===_0x447bf5(0x1a0)?_0x447bf5(0x1ab):_0x583ce2[_0x447bf5(0x1da)]),_0x10a760=[];if(_0x583ce2[_0x447bf5(0x1b5)]&&_0x583ce2[_0x447bf5(0x1a9)]){const _0x4790b5=Math[_0x447bf5(0x19a)]((new Date(_0x583ce2[_0x447bf5(0x1a9)])[_0x447bf5(0x1c6)]()-new Date(_0x583ce2[_0x447bf5(0x1b5)])[_0x447bf5(0x1c6)]())/0x3e8);_0x10a760[_0x447bf5(0x1a3)](formatDuration(_0x4790b5));}if(_0x583ce2[_0x447bf5(0x1a9)])_0x10a760['push'](formatRelativeTime(new Date(_0x583ce2[_0x447bf5(0x1a9)])));else _0x583ce2[_0x447bf5(0x1b5)]&&_0x10a760[_0x447bf5(0x1a3)](formatRelativeTime(new Date(_0x583ce2[_0x447bf5(0x1b5)])));const _0x572600=_0x10a760[_0x447bf5(0x1be)]>0x0?a26_0x2942b7[_0x447bf5(0x1de)]('\x20'+_0x10a760[_0x447bf5(0x1a1)](',\x20')):'';console['log']('⚡\x20'+_0x2ac982+'\x20'+_0x1bfef2+'\x20'+_0x201de5+_0x572600);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x16265d(0x1d9)]='job:show';[a26_0x16265d(0x1db)]=a26_0x16265d(0x19d);['validate'](_0x1aa18a){const _0x1b86b3=a26_0x16265d,_0x3528c5=_0x1aa18a[_0x1b86b3(0x1b2)][0x0];if(!_0x3528c5)return _0x1b86b3(0x195);return undefined;}async[a26_0x16265d(0x1b8)](_0x4e5270){const _0x4ebf61=a26_0x16265d,{options:_0xcc61b1,args:_0x174b35,tdx:_0x48952d}=_0x4e5270,_0x1fa0c1=_0x174b35[0x0],_0x517201=await withSpinner('Getting\x20job\x20details...',()=>_0x48952d[_0x4ebf61(0x1c5)][_0x4ebf61(0x1eb)](_0x1fa0c1),{'verbose':_0xcc61b1[_0x4ebf61(0x1d0)]}),_0x4bc12a=_0x517201[_0x4ebf61(0x1ce)];let _0x3a56c2;if(_0x4bc12a[_0x4ebf61(0x1b5)]&&_0x4bc12a['end_at']){const _0x417c4c=new Date(_0x4bc12a['start_at'])[_0x4ebf61(0x1c6)](),_0x329909=new Date(_0x4bc12a[_0x4ebf61(0x1a9)])[_0x4ebf61(0x1c6)]();_0x3a56c2=Math[_0x4ebf61(0x19a)]((_0x329909-_0x417c4c)/0x3e8);}const _0x4e75bb={'job_id':_0x4bc12a[_0x4ebf61(0x1b1)],'type':_0x4bc12a[_0x4ebf61(0x1da)],'status':_0x4bc12a[_0x4ebf61(0x1ba)],..._0x4bc12a[_0x4ebf61(0x1af)]&&{'user_name':_0x4bc12a[_0x4ebf61(0x1af)]},..._0x3a56c2!==undefined&&{'duration_sec':_0x3a56c2},..._0x4bc12a[_0x4ebf61(0x1d4)]&&{'created_at':_0x4bc12a[_0x4ebf61(0x1d4)]},..._0x4bc12a['start_at']&&{'started_at':_0x4bc12a[_0x4ebf61(0x1b5)]},..._0x4bc12a['end_at']&&{'end_at':_0x4bc12a['end_at']},..._0x4bc12a[_0x4ebf61(0x1a7)]&&{'database':_0x4bc12a[_0x4ebf61(0x1a7)]},..._0x4bc12a['priority']!==undefined&&{'priority':_0x4bc12a[_0x4ebf61(0x1a5)]},..._0x4bc12a[_0x4ebf61(0x1e9)]&&{'url':_0x4bc12a[_0x4ebf61(0x1e9)]},..._0x4bc12a['query']&&{'query':_0x4bc12a[_0x4ebf61(0x192)]},..._0x4bc12a['debug']&&{'debug':_0x4bc12a[_0x4ebf61(0x1e0)]}};return await handleSingleObjectOutput(_0x4e75bb,_0xcc61b1),0x0;}}function a26_0x8100(_0x18830e,_0x2597b8){_0x18830e=_0x18830e-0x191;const _0xfd6382=a26_0xfd63();let _0x8100c0=_0xfd6382[_0x18830e];return _0x8100c0;}export class JobKillCommand extends BaseCommand{['name']=a26_0x16265d(0x1ca);[a26_0x16265d(0x1db)]='Kill\x20a\x20job';[a26_0x16265d(0x1c8)](_0x271ca9){const _0x455754=a26_0x16265d,_0xe4488e=_0x271ca9[_0x455754(0x1b2)][0x0];if(!_0xe4488e)return _0x455754(0x19e);return undefined;}async[a26_0x16265d(0x1b8)](_0x23fe62){const _0x1c76bd=a26_0x16265d,{options:_0x28aeba,args:_0x1cddfd,tdx:_0x485fef}=_0x23fe62,_0x149ac0=_0x1cddfd[0x0];if(!_0x28aeba[_0x1c76bd(0x1cc)]){const _0x4d23bd=await confirm(_0x1c76bd(0x199)+_0x149ac0+'?');if(!_0x4d23bd)return console[_0x1c76bd(0x1bb)](_0x1c76bd(0x1e5)),0x0;}return await withSpinner(_0x1c76bd(0x1dd),()=>_0x485fef[_0x1c76bd(0x1c5)][_0x1c76bd(0x1c3)](_0x149ac0),{'verbose':_0x28aeba[_0x1c76bd(0x1d0)]}),console['error'](_0x1c76bd(0x1c9)+_0x149ac0),console[_0x1c76bd(0x1bb)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x149ac0+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a26_0x16265d(0x1db)]=a26_0x16265d(0x1bf);async['execute'](_0x3344ab){const _0x4505c3=a26_0x16265d,{options:_0x19fd4d,args:_0x35a846,tdx:_0x5318ca}=_0x3344ab,_0x8da89c=_0x19fd4d['jobType']||_0x4505c3(0x1ab),_0x2087d9=_0x19fd4d[_0x4505c3(0x1dc)],_0x57f821=_0x19fd4d['database']||_0x4505c3(0x1d5),_0x2e4b6c=_0x19fd4d[_0x4505c3(0x1d7)];if(_0x8da89c!==_0x4505c3(0x1ab)&&_0x8da89c!=='hive')throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b4));let _0x45f2ae;if(_0x2087d9){if(_0x35a846[0x0])throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b7));const _0x5aa022=readSqlStatementsFromFile(_0x2087d9);if(_0x5aa022[_0x4505c3(0x1be)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4505c3(0x1ad));if(_0x5aa022[_0x4505c3(0x1be)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x45f2ae=_0x5aa022[0x0];}else{if(!_0x35a846[0x0])throw new SDKError(ErrorCode[_0x4505c3(0x1c2)],_0x4505c3(0x1b3));_0x45f2ae=_0x35a846[0x0];}_0x19fd4d[_0x4505c3(0x1d0)]&&(console['error'](_0x4505c3(0x194)+_0x8da89c),console[_0x4505c3(0x1bb)](_0x4505c3(0x1aa)+_0x57f821),console[_0x4505c3(0x1bb)]('Query:\x20'+_0x45f2ae[_0x4505c3(0x19f)](0x0,0x64)+(_0x45f2ae[_0x4505c3(0x1be)]>0x64?'...':'')));const _0x11a383=await withSpinner(_0x4505c3(0x1e3),()=>_0x5318ca[_0x4505c3(0x1c5)][_0x4505c3(0x1e2)](_0x57f821,_0x45f2ae,_0x8da89c,_0x2e4b6c),{'verbose':_0x19fd4d[_0x4505c3(0x1d0)]}),_0x4685df=_0x11a383['data'];return console['error'](_0x4505c3(0x1a6)),console[_0x4505c3(0x1bb)](_0x4505c3(0x1e4)+_0x4685df[_0x4505c3(0x1b1)]),await handleSDKOutput([_0x4685df],_0x19fd4d),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x16265d(0x1d9)]='job:result';[a26_0x16265d(0x1db)]=a26_0x16265d(0x1d2);[a26_0x16265d(0x1c8)](_0x4bc829){const _0x5d335d=a26_0x16265d,_0xe49c74=_0x4bc829[_0x5d335d(0x1b2)][0x0];if(!_0xe49c74)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x16265d(0x1b8)](_0x52155b){const _0x1ce41e=a26_0x16265d,{options:_0x1b9539,args:_0x5e0f03,tdx:_0x4d0595}=_0x52155b,_0x2a4365=_0x5e0f03[0x0],_0x4b1117=await withSpinner(_0x1ce41e(0x1e6),()=>_0x4d0595[_0x1ce41e(0x1c5)][_0x1ce41e(0x1d7)](_0x2a4365),{'verbose':_0x1b9539['verbose']}),_0x697253=_0x4b1117[_0x1ce41e(0x1ce)];return console[_0x1ce41e(0x1bb)](_0x1ce41e(0x1c4)+_0x697253[_0x1ce41e(0x1be)]+_0x1ce41e(0x19b)+(_0x697253[_0x1ce41e(0x1be)]!==0x1?'s':'')),await handleSDKOutput(_0x697253,_0x1b9539),0x0;}}
|
|
1
|
+
const a26_0x4f248f=a26_0x4352;(function(_0x6f294f,_0x2369f8){const _0x26db39=a26_0x4352,_0x2dba53=_0x6f294f();while(!![]){try{const _0x32501b=-parseInt(_0x26db39(0xdc))/0x1*(parseInt(_0x26db39(0xd0))/0x2)+-parseInt(_0x26db39(0xee))/0x3*(-parseInt(_0x26db39(0x101))/0x4)+-parseInt(_0x26db39(0x105))/0x5*(parseInt(_0x26db39(0xd7))/0x6)+-parseInt(_0x26db39(0xf0))/0x7*(-parseInt(_0x26db39(0x112))/0x8)+-parseInt(_0x26db39(0xec))/0x9*(parseInt(_0x26db39(0xeb))/0xa)+parseInt(_0x26db39(0xdf))/0xb*(-parseInt(_0x26db39(0xcf))/0xc)+parseInt(_0x26db39(0xff))/0xd;if(_0x32501b===_0x2369f8)break;else _0x2dba53['push'](_0x2dba53['shift']());}catch(_0x2335ae){_0x2dba53['push'](_0x2dba53['shift']());}}}(a26_0x38d6,0xb2c62));import{BaseCommand}from'./command.js';function a26_0x4352(_0x2a5670,_0x276e47){_0x2a5670=_0x2a5670-0xcd;const _0x38d6f3=a26_0x38d6();let _0x43524d=_0x38d6f3[_0x2a5670];return _0x43524d;}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x26f008 from'chalk';function formatDuration(_0x267163){const _0x4d031b=a26_0x4352;if(_0x267163<0x3c)return _0x267163+'s';if(_0x267163<0xe10)return Math[_0x4d031b(0xde)](_0x267163/0x3c)+'m\x20'+_0x267163%0x3c+'s';const _0x5e28b4=Math['floor'](_0x267163/0xe10),_0x40f1c0=Math[_0x4d031b(0xde)](_0x267163%0xe10/0x3c);return _0x40f1c0>0x0?_0x5e28b4+'h\x20'+_0x40f1c0+'m':_0x5e28b4+'h';}function formatRelativeTime(_0x475444){const _0x390598=a26_0x4352,_0x488d08=Date[_0x390598(0xfb)]()-_0x475444[_0x390598(0x10a)](),_0x169605=Math[_0x390598(0xde)](Math['abs'](_0x488d08)/0x3e8);if(_0x169605<0x3c)return _0x390598(0xe0);const _0x1720ca=Math[_0x390598(0xde)](_0x169605/0x3c);if(_0x1720ca<0x3c)return _0x1720ca+_0x390598(0xd8);const _0x4cc44a=Math['floor'](_0x1720ca/0x3c);if(_0x4cc44a<0x18)return _0x4cc44a+_0x390598(0x122);const _0x3a0097=Math[_0x390598(0xde)](_0x4cc44a/0x18);if(_0x3a0097<0x1e)return _0x3a0097+_0x390598(0x120);return Math[_0x390598(0xde)](_0x3a0097/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x4f248f(0x10d)]='jobs';[a26_0x4f248f(0x119)]='List\x20jobs';async[a26_0x4f248f(0x116)](_0x5bd196){const _0x3ca343=a26_0x4f248f,{options:_0x7f631e,tdx:_0x4a2a31}=_0x5bd196,_0x120cab=resolveLimit(_0x7f631e[_0x3ca343(0x103)],DEFAULT_DISPLAY_LIMIT),_0x21475e=_0x7f631e['status'];_0x7f631e[_0x3ca343(0x100)]&&(console['error'](_0x3ca343(0xd3)+_0x120cab+'\x20jobs'),_0x21475e&&console[_0x3ca343(0xce)](_0x3ca343(0x115)+_0x21475e));const _0x4851a7=await withSpinner(_0x3ca343(0xd4),()=>_0x4a2a31[_0x3ca343(0x10f)][_0x3ca343(0xf5)]({'from':0x0,'to':_0x120cab-0x1,'status':_0x21475e}),{'verbose':_0x7f631e['verbose']}),_0x3aa9ce=_0x4851a7['data'];console[_0x3ca343(0xce)](_0x3ca343(0xfe)+_0x3aa9ce[_0x3ca343(0x117)]+'\x20job'+(_0x3aa9ce[_0x3ca343(0x117)]!==0x1?'s':''));const _0x2299e0=_0x7f631e[_0x3ca343(0xf8)];if(isStructuredFormat(_0x7f631e)){const _0x3c8119=_0x3aa9ce[_0x3ca343(0xe3)](_0x1c8414=>{const _0x250d38=_0x3ca343;let _0x3d4ff9;if(_0x1c8414[_0x250d38(0xe7)]&&_0x1c8414['end_at']){const _0x880c02=new Date(_0x1c8414[_0x250d38(0xe7)])['getTime'](),_0x23dde5=new Date(_0x1c8414['end_at'])['getTime']();_0x3d4ff9=Math[_0x250d38(0xd2)]((_0x23dde5-_0x880c02)/0x3e8);}return{'job_id':_0x1c8414[_0x250d38(0x11a)],'type':_0x1c8414[_0x250d38(0x121)]===_0x250d38(0xd5)?_0x250d38(0xe8):_0x1c8414['type'],'status':_0x1c8414[_0x250d38(0xe6)],'user_name':_0x1c8414['user_name'],'duration_sec':_0x3d4ff9,'created_at':_0x1c8414[_0x250d38(0x118)],'started_at':_0x1c8414['start_at'],'end_at':_0x1c8414[_0x250d38(0x11c)]};});await handleSDKOutput(_0x3c8119,_0x7f631e);}else for(const _0x333e26 of _0x3aa9ce){const _0x1070a0=_0x333e26['status']==='success'?a26_0x26f008[_0x3ca343(0xdb)]:_0x333e26['status']===_0x3ca343(0xce)?a26_0x26f008[_0x3ca343(0xe1)]:a26_0x26f008[_0x3ca343(0xef)],_0x109872=_0x1070a0(_0x333e26[_0x3ca343(0xe6)]),_0x4b025a=getJobUrl(_0x2299e0,_0x333e26['job_id']),_0x2e97ab=hyperlink(_0x333e26['job_id'],_0x4b025a),_0x57c986=a26_0x26f008[_0x3ca343(0xef)](_0x333e26[_0x3ca343(0x121)]===_0x3ca343(0xd5)?_0x3ca343(0xe8):_0x333e26['type']),_0xe5df71=[];if(_0x333e26['start_at']&&_0x333e26[_0x3ca343(0x11c)]){const _0x170d2c=Math['round']((new Date(_0x333e26[_0x3ca343(0x11c)])[_0x3ca343(0x10a)]()-new Date(_0x333e26['start_at'])['getTime']())/0x3e8);_0xe5df71[_0x3ca343(0x11f)](formatDuration(_0x170d2c));}if(_0x333e26[_0x3ca343(0x11c)])_0xe5df71[_0x3ca343(0x11f)](formatRelativeTime(new Date(_0x333e26[_0x3ca343(0x11c)])));else _0x333e26[_0x3ca343(0xe7)]&&_0xe5df71[_0x3ca343(0x11f)](formatRelativeTime(new Date(_0x333e26[_0x3ca343(0xe7)])));const _0x5514d7=_0xe5df71[_0x3ca343(0x117)]>0x0?a26_0x26f008['dim']('\x20'+_0xe5df71['join'](',\x20')):'';console[_0x3ca343(0x109)]('⚡\x20'+_0x2e97ab+'\x20'+_0x57c986+'\x20'+_0x109872+_0x5514d7);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x4f248f(0x10d)]='job:show';[a26_0x4f248f(0x119)]=a26_0x4f248f(0x10c);[a26_0x4f248f(0x107)](_0xd021ca){const _0x44e2c2=a26_0x4f248f,_0x24049d=_0xd021ca['args'][0x0];if(!_0x24049d)return _0x44e2c2(0x10b);return undefined;}async[a26_0x4f248f(0x116)](_0x2ab86c){const _0x25a05b=a26_0x4f248f,{options:_0x5cd10d,args:_0x11f590,tdx:_0x58d1f7}=_0x2ab86c,_0x3a6680=_0x11f590[0x0],_0x1dac93=await withSpinner(_0x25a05b(0xf2),()=>_0x58d1f7[_0x25a05b(0x10f)][_0x25a05b(0xd1)](_0x3a6680),{'verbose':_0x5cd10d[_0x25a05b(0x100)]}),_0x1ed5dc=_0x1dac93[_0x25a05b(0x114)];let _0x426eea;if(_0x1ed5dc[_0x25a05b(0xe7)]&&_0x1ed5dc[_0x25a05b(0x11c)]){const _0x4e11d3=new Date(_0x1ed5dc['start_at'])['getTime'](),_0x441dbd=new Date(_0x1ed5dc[_0x25a05b(0x11c)])['getTime']();_0x426eea=Math[_0x25a05b(0xd2)]((_0x441dbd-_0x4e11d3)/0x3e8);}const _0x161a0d={'job_id':_0x1ed5dc['job_id'],'type':_0x1ed5dc[_0x25a05b(0x121)],'status':_0x1ed5dc['status'],..._0x1ed5dc[_0x25a05b(0xd6)]&&{'user_name':_0x1ed5dc[_0x25a05b(0xd6)]},..._0x426eea!==undefined&&{'duration_sec':_0x426eea},..._0x1ed5dc[_0x25a05b(0x118)]&&{'created_at':_0x1ed5dc[_0x25a05b(0x118)]},..._0x1ed5dc[_0x25a05b(0xe7)]&&{'started_at':_0x1ed5dc[_0x25a05b(0xe7)]},..._0x1ed5dc[_0x25a05b(0x11c)]&&{'end_at':_0x1ed5dc[_0x25a05b(0x11c)]},..._0x1ed5dc[_0x25a05b(0xf3)]&&{'database':_0x1ed5dc[_0x25a05b(0xf3)]},..._0x1ed5dc[_0x25a05b(0xf6)]!==undefined&&{'priority':_0x1ed5dc[_0x25a05b(0xf6)]},..._0x1ed5dc[_0x25a05b(0x106)]&&{'url':_0x1ed5dc[_0x25a05b(0x106)]},..._0x1ed5dc[_0x25a05b(0xe4)]&&{'query':_0x1ed5dc['query']},..._0x1ed5dc[_0x25a05b(0xfc)]&&{'debug':_0x1ed5dc[_0x25a05b(0xfc)]}};return await handleSingleObjectOutput(_0x161a0d,_0x5cd10d),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x4f248f(0x10d)]='job:kill';[a26_0x4f248f(0x119)]='Kill\x20a\x20job';[a26_0x4f248f(0x107)](_0x1c1ac4){const _0x2afb8a=a26_0x4f248f,_0x4a7309=_0x1c1ac4[_0x2afb8a(0xf7)][0x0];if(!_0x4a7309)return _0x2afb8a(0x104);return undefined;}async[a26_0x4f248f(0x116)](_0x513766){const _0x18f4de=a26_0x4f248f,{options:_0x208cad,args:_0x5575fc,tdx:_0x50573f}=_0x513766,_0x16f6ce=_0x5575fc[0x0];if(!_0x208cad[_0x18f4de(0xf1)]){const _0x4f2a54=await confirm(_0x18f4de(0x11e)+_0x16f6ce+'?');if(!_0x4f2a54)return console[_0x18f4de(0xce)](_0x18f4de(0x113)),0x0;}return await withSpinner(_0x18f4de(0x102),()=>_0x50573f[_0x18f4de(0x10f)]['kill'](_0x16f6ce),{'verbose':_0x208cad['verbose']}),console['error'](_0x18f4de(0xdd)+_0x16f6ce),console[_0x18f4de(0xce)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x16f6ce+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x4f248f(0x10d)]=a26_0x4f248f(0xcd);[a26_0x4f248f(0x119)]='Submit\x20a\x20job';async['execute'](_0x29f79d){const _0x4573de=a26_0x4f248f,{options:_0x8bc48e,args:_0x4a2f91,tdx:_0x34a0db}=_0x29f79d,_0x3645d2=_0x8bc48e[_0x4573de(0xd9)]||_0x4573de(0xe8),_0x432b27=_0x8bc48e['file'],_0x582729=_0x8bc48e[_0x4573de(0xf3)]||'information_schema',_0x1f3e55=_0x8bc48e[_0x4573de(0x108)];if(_0x3645d2!==_0x4573de(0xe8)&&_0x3645d2!==_0x4573de(0xfa))throw new SDKError(ErrorCode[_0x4573de(0x11b)],_0x4573de(0x10e));let _0x42f730;if(_0x432b27){if(_0x4a2f91[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4573de(0xf9));const _0x52616b=readSqlStatementsFromFile(_0x432b27);if(_0x52616b[_0x4573de(0x117)]===0x0)throw new SDKError(ErrorCode[_0x4573de(0x11b)],_0x4573de(0xe2));if(_0x52616b[_0x4573de(0x117)]>0x1)throw new SDKError(ErrorCode[_0x4573de(0x11b)],_0x4573de(0x11d));_0x42f730=_0x52616b[0x0];}else{if(!_0x4a2f91[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4573de(0xf4));_0x42f730=_0x4a2f91[0x0];}_0x8bc48e['verbose']&&(console[_0x4573de(0xce)]('Job\x20type:\x20'+_0x3645d2),console['error']('Database:\x20'+_0x582729),console['error'](_0x4573de(0x111)+_0x42f730['substring'](0x0,0x64)+(_0x42f730['length']>0x64?_0x4573de(0xda):'')));const _0x2b9785=await withSpinner(_0x4573de(0xed),()=>_0x34a0db[_0x4573de(0x10f)][_0x4573de(0xe5)](_0x582729,_0x42f730,_0x3645d2,_0x1f3e55),{'verbose':_0x8bc48e[_0x4573de(0x100)]}),_0x279f55=_0x2b9785[_0x4573de(0x114)];return console[_0x4573de(0xce)]('✔\x20Job\x20submitted'),console[_0x4573de(0xce)](_0x4573de(0xfd)+_0x279f55[_0x4573de(0x11a)]),await handleSDKOutput([_0x279f55],_0x8bc48e),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';['description']='Get\x20job\x20results';[a26_0x4f248f(0x107)](_0x4881ea){const _0x6db4da=a26_0x4f248f,_0x464a2a=_0x4881ea['args'][0x0];if(!_0x464a2a)return _0x6db4da(0x110);return undefined;}async[a26_0x4f248f(0x116)](_0x2e2782){const _0x2a42f8=a26_0x4f248f,{options:_0x44d367,args:_0x174337,tdx:_0x265821}=_0x2e2782,_0x25afc3=_0x174337[0x0],_0x3c77f2=await withSpinner(_0x2a42f8(0xe9),()=>_0x265821[_0x2a42f8(0x10f)][_0x2a42f8(0x108)](_0x25afc3),{'verbose':_0x44d367[_0x2a42f8(0x100)]}),_0x45c7e0=_0x3c77f2[_0x2a42f8(0x114)];return console['error'](_0x2a42f8(0xea)+_0x45c7e0[_0x2a42f8(0x117)]+'\x20row'+(_0x45c7e0[_0x2a42f8(0x117)]!==0x1?'s':'')),await handleSDKOutput(_0x45c7e0,_0x44d367),0x0;}}function a26_0x38d6(){const _0x59feb8=['2793IaSEDY','dim','119evAxHY','yes','Getting\x20job\x20details...','database','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','list','priority','args','site','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','hive','now','debug','\x20\x20Job\x20ID:\x20','✔\x20Found\x20','27951794XEhxbP','verbose','5440QhTDMS','Submitting\x20kill\x20request...','limit','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','1991840foqFmQ','url','validate','result','log','getTime','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Show\x20job\x20details','name','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Query:\x20','297456gSPUjY','Cancelled','data','Status\x20filter:\x20','execute','length','created_at','description','job_id','INVALID_ARGUMENT','end_at','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','push','d\x20ago','type','h\x20ago','job:submit','error','48ChDspj','2529066Pidyxj','show','round','Limit:\x20','Listing\x20jobs...','presto','user_name','6mQGFzw','m\x20ago','jobType','...','green','1BAEfny','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','floor','749287AEmkYq','just\x20now','red','No\x20SQL\x20statements\x20found\x20in\x20file','map','query','submit','status','start_at','trino','Getting\x20job\x20results...','✔\x20Retrieved\x20','30gekZFQ','4142295cAkeiu','Submitting\x20job...'];a26_0x38d6=function(){return _0x59feb8;};return a26_0x38d6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x4c00bc=a27_0x30cf;(function(_0x4a6289,_0x3c0b3d){const _0x1087cb=a27_0x30cf,_0x2222ea=_0x4a6289();while(!![]){try{const _0x87ac3=parseInt(_0x1087cb(0xb1))/0x1*(parseInt(_0x1087cb(0x12d))/0x2)+-parseInt(_0x1087cb(0x120))/0x3+-parseInt(_0x1087cb(0x155))/0x4+-parseInt(_0x1087cb(0x112))/0x5+-parseInt(_0x1087cb(0xee))/0x6*(-parseInt(_0x1087cb(0x185))/0x7)+-parseInt(_0x1087cb(0xca))/0x8+parseInt(_0x1087cb(0xfd))/0x9;if(_0x87ac3===_0x3c0b3d)break;else _0x2222ea['push'](_0x2222ea['shift']());}catch(_0xe5061a){_0x2222ea['push'](_0x2222ea['shift']());}}}(a27_0x3305,0xe4106));import a27_0x2a8216 from'chalk';import a27_0x576223 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a27_0x30cf(_0x545530,_0x11e852){_0x545530=_0x545530-0x7f;const _0x33058e=a27_0x3305();let _0x30cf80=_0x33058e[_0x545530];return _0x30cf80;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1b85ed){const _0x3ac23d=a27_0x30cf;return!_0x1b85ed&&(console[_0x3ac23d(0x133)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x3ac23d(0x133)](_0x3ac23d(0x13b))),!!_0x1b85ed;}function withJsonFormat(_0x1f96f6){const _0xc4ef96=a27_0x30cf;if(!_0x1f96f6[_0xc4ef96(0xb9)]&&!_0x1f96f6[_0xc4ef96(0xeb)]&&!_0x1f96f6[_0xc4ef96(0x138)]&&!_0x1f96f6['tsv'])return{..._0x1f96f6,'format':_0xc4ef96(0xeb),'json':!![]};return _0x1f96f6;}function formatJourneyState(_0x28c779){const _0x249294=a27_0x30cf;switch(_0x28c779){case'launched':return a27_0x2a8216['green'](_0x249294(0xf3));case _0x249294(0x93):return a27_0x2a8216[_0x249294(0x10e)](_0x249294(0xc8));case _0x249294(0xc5):return a27_0x2a8216[_0x249294(0xa6)]('(paused)');case _0x249294(0x163):return a27_0x2a8216['blue'](_0x249294(0x95));case'archived':return a27_0x2a8216[_0x249294(0x10e)](_0x249294(0xbd));default:return'('+_0x28c779+')';}}function a27_0x3305(){const _0x4cf7c0=['INVALID_ARGUMENT','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','add','\x20\x20Name:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','cwd','options','connectionId','nodes','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','2YEOFNP','\x20->\x20','runAfterJourneyRefresh','updatedAt','journeyStages','session','error','/app/ps/','runAt','setPhase','journey:columns','jsonl','links','folderPath','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','attributes','enteredSize','Paused\x20at:','exitOrJumpRate','status','tdx.json','completeMilestoneRate','Fetching\x20','\x20\x20Statistics\x20not\x20available','Getting\x20journey\x20traffic\x20data...','journey:stats','(unnamed)','\x20\x20←\x20','parentName','rule','columns','Error:\x20Version\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','replace','\x20\x20Journey\x20ID:\x20','journey:resume','audienceId','entries','no\x20connection','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','5762364ApoJdS','parent_segment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Table:\x20','base','\x5c$&','listVersions','scheduleType','yes','Listing\x20journey\x20activations...','type','Error:\x20Invalid\x20version\x20number:\x20','join','set','completed','Warning:\x20Could\x20not\x20resolve\x20activation\x20','📁\x20','reentryMode','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','getColumnMapping','\x20[runs\x20on\x20refresh]','\x20activation','resolveParentId','milestoneSize','push','Getting\x20journey\x20statistics...','history',',\x20schedule:\x20','includeStats','no_parent','dryRun','\x20changed\x20files','Input:\x20','executeDryRun','State:','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','workflowSessionId','\x20details...','⚠️\x20','Listing\x20journeys...','Session:','getStatistics','Listing\x20journey\x20versions...','Pattern:\x20','size','get','Error:\x20Journey\x20not\x20found:\x20','site','10815791HrfIyJ','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20not\x20found.\x20Available:\x20','\x0aError:','stages','kind','createVersion','segments','journey:view','file','\x20=\x20','\x20(rule\x20match)','Aborted.','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20Target:\x20','Resolving\x20parent\x20segment...','bold','Error:\x20Stage\x20\x22','verbose','state','\x20journey\x20files\x20to\x20','message','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pausedAt','root\x20folder','data','green','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Getting\x20journey\x20details...','red','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','map','Options:','activation','Folder\x20path:\x20','resume','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','cyan','listActivationsFlat','content','\x20unchanged\x20files','resolveSegment','.yml','getParentFull','journey:pull','relativePath','ID:','utf-8','absolutePath','folderId','\x20Opening\x20','all','draft','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','(completed)','\x20@\x20','\x20(ID:\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','buildIdToEmailMap','versionNumber','segmentPushCommand','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','version','Error:\x20Journey\x20\x27','values','exitOrJumpSize','Export\x20journey(s)\x20as\x20YAML\x20files','pause','description','getActivation','yellow','Paused:','length','table','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Error:\x20Invalid\x20--type\x20\x22','connection','name','Resolved\x20YAML\x20file:\x20','sort','Cancelled','1122123Ijfsdv','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','/j/da','journeyName','...','Activations:','folders','Fetching\x20journeys\x20and\x20folders...','format','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Write\x20','Error:\x20','(archived)','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','journeys','\x20\x20-\x20','resolveJourneyId','conversion','journey:list','has','paused','✔\x20Journey\x20\x22','Resuming\x20journey...','(draft)','Fetching\x20journey\x20','9789688QkEbcT','buildIdToNameMap','parentSegment','-\x20no\x20files\x20written','journeyId','getLatestJourneyId','Parent\x20segment\x20ID:','listJourneysWithFolders','/e/','segment','hasPeriod','\x20\x20Parent\x20segment:\x20','filePath','targetDir','split','Triggering\x20journey\x20workflow...','then','hasChanges','createdAt','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','repeat','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Getting\x20version\x20','filter','Resume\x20a\x20paused\x20journey','✔\x20Context\x20set:\x20','Target\x20file:\x20','goal','Show\x20journey\x20details','journey','journeyBundleId','✔\x20Found\x20','stringify','json','/j/da/je','Error:\x20Parent\x20segment\x20context\x20required','6vOsVuw','connector_config','\x20journeys','segmentName','\x20\x20Folder\x20path:\x20','(running)','\x20Created\x20v','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','connection\x20','List\x20all\x20versions\x20of\x20a\x20journey','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','rootFolderId','Target\x20directory:\x20','args','goalSize','26527527iBcUtt','Stages:','toLowerCase','Show\x20journey\x20statistics','find','✔\x20Pulled\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','execute','No\x20journeys\x20found','relative','Fetching\x20users\x20and\x20connections...','journey:pause','log','database','limit','\x0aPull\x20summary:','getJourney','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Pause\x20a\x20running\x20journey','Getting\x20column\x20mapping...','7564015jaHvxd','Journey:','\x0aChanges\x20to\x20\x27','journey:run','diff','\x27\x20not\x20found\x20in\x20','isNew','(root)','getTrafficData','Resolving\x20version...','\x20version','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Creating\x20new\x20version...','journeyBundleName','1510452xnwukj'];a27_0x3305=function(){return _0x4cf7c0;};return a27_0x3305();}function formatJourneyItem(_0x354753,_0x346a84='',_0x2a4579){const _0xa0568f=a27_0x30cf,_0x51d9d6=formatJourneyState(_0x354753[_0xa0568f(0x199)]),_0x2cf954=_0x2a4579?hyperlink(_0x354753['journeyBundleName'],_0x2a4579):_0x354753[_0xa0568f(0x11f)];return _0x346a84+'🗺️\x20'+_0x2cf954+'\x20'+_0x51d9d6;}function escapeRegex(_0x38ed11){const _0x9ed1a3=a27_0x30cf;return _0x38ed11[_0x9ed1a3(0x14e)](/[.*+?^${}()|[\]\\]/g,_0x9ed1a3(0x15a));}function globToRegex(_0x1e76e2){const _0x43dbc0=a27_0x30cf,_0x3f5d4d=_0x1e76e2[_0x43dbc0(0xd8)]('*')[_0x43dbc0(0x1a5)](escapeRegex);return new RegExp(_0x3f5d4d[_0x43dbc0(0x161)]('.*'),'i');}function buildRuleToNameMapping(_0x3296f4){const _0x4d3665=a27_0x30cf,_0x3ef412=new Map();if(_0x3296f4[_0x4d3665(0x18c)])for(const [_0x335178,_0x2a480a]of Object['entries'](_0x3296f4[_0x4d3665(0x18c)])){if(_0x2a480a[_0x4d3665(0x14a)]){const _0x59531c=serializeRule(_0x2a480a[_0x4d3665(0x14a)]),_0x2119f9=_0x3ef412[_0x4d3665(0x182)](_0x59531c);_0x2119f9?_0x2119f9['push'](_0x335178):_0x3ef412[_0x4d3665(0x162)](_0x59531c,[_0x335178]);}}return _0x3ef412;}async function resolveJourneyIdFromInput(_0x16b1d9,_0x3010d0,_0x4d30ca){const _0x17c480=a27_0x30cf,_0xc7fb49=await resolveJourneyTarget(_0x16b1d9,_0x3010d0['parentSegment'],_0x3010d0[_0x17c480(0x198)]),_0x1bcf60=_0xc7fb49[_0x17c480(0xcc)];if(!_0x1bcf60)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x17c480(0xf8));const _0x1955a3=await withSpinner(_0x17c480(0x195),()=>_0x4d30ca[_0x17c480(0xd3)][_0x17c480(0x16b)](_0x1bcf60),{'verbose':_0x3010d0[_0x17c480(0x198)]}),_0x870977=_0x1955a3['data'],_0x1022f5=await withSpinner('Resolving\x20journey...',()=>_0x4d30ca[_0x17c480(0xe7)][_0x17c480(0xc1)](_0x870977,_0xc7fb49[_0x17c480(0xb4)]),{'verbose':_0x3010d0[_0x17c480(0x198)]});return{'journeyId':_0x1022f5[_0x17c480(0x19f)],'journeyName':_0xc7fb49['journeyName'],'parentSegmentId':_0x870977};}async function resolveJourneyTarget(_0x3b8ebc,_0x4a906c,_0x166acc){const _0x39096d=a27_0x30cf;if(isYamlFilePath(_0x3b8ebc))try{const _0x1386da=await resolveYamlFilePath(_0x3b8ebc);return _0x166acc&&(console['error'](_0x39096d(0xae)+_0x3b8ebc),console[_0x39096d(0x133)](_0x39096d(0xd5)+_0x1386da['parentSegment']),console[_0x39096d(0x133)](_0x39096d(0x126)+_0x1386da[_0x39096d(0xf1)]),console[_0x39096d(0x133)](_0x39096d(0xf2)+(_0x1386da[_0x39096d(0x13a)]||_0x39096d(0x119)))),{'journeyName':_0x1386da[_0x39096d(0xf1)],'parentSegment':_0x1386da[_0x39096d(0xcc)],'resolved':_0x1386da};}catch(_0x28780f){throw new SDKError(ErrorCode[_0x39096d(0x121)],_0x39096d(0x94)+_0x28780f[_0x39096d(0x19b)]);}if(!_0x4a906c)throw new SDKError(ErrorCode[_0x39096d(0x121)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x3b8ebc,'parentSegment':_0x4a906c};}export class JourneyListCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0xc3);[a27_0x4c00bc(0xa4)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x4c00bc(0x104)](_0x34eedd){const _0x1df8a5=a27_0x4c00bc,{options:_0xcce67b,args:_0x33cf1f,tdx:_0x18dff6}=_0x34eedd,_0x20bd53=_0x33cf1f[0x0],_0x11f51e=_0xcce67b['parentSegment'];if(!_0x11f51e)return console[_0x1df8a5(0x133)](_0x1df8a5(0xed)),console[_0x1df8a5(0x133)](_0x1df8a5(0x124)),0x1;const _0x41d0a2=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x18dff6['segment'][_0x1df8a5(0x16b)](_0x11f51e),{'verbose':_0xcce67b['verbose']}),_0x73cff=_0x41d0a2[_0x1df8a5(0x19f)];_0xcce67b[_0x1df8a5(0x198)]&&(console[_0x1df8a5(0x133)]('Parent\x20segment:\x20'+_0x11f51e+_0x1df8a5(0x97)+_0x73cff+')'),_0x20bd53&&console[_0x1df8a5(0x133)](_0x1df8a5(0x180)+_0x20bd53));const _0x1fe90a=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x18dff6[_0x1df8a5(0xd3)][_0x1df8a5(0x8a)](_0x73cff),{'verbose':_0xcce67b[_0x1df8a5(0x198)]}),_0x2a4aef=_0x1fe90a[_0x1df8a5(0x19f)],_0x2e667a=_0x2a4aef[_0x1df8a5(0xf9)],_0x4a0782=await withSpinner(_0x1df8a5(0x17c),()=>_0x18dff6[_0x1df8a5(0xe7)][_0x1df8a5(0xd1)](_0x73cff,_0x2e667a),{'verbose':_0xcce67b[_0x1df8a5(0x198)]});let _0x39e614=_0x4a0782['data'][_0x1df8a5(0xbf)];const _0x42914f=_0x4a0782['data'][_0x1df8a5(0xb7)],_0x119a21=new Map();for(const _0x5df9c8 of _0x42914f){_0x119a21[_0x1df8a5(0x162)](_0x5df9c8['id'],_0x5df9c8['name']);}if(_0x20bd53){const _0x28424e=globToRegex(_0x20bd53);_0x39e614=_0x39e614['filter'](_0x176e23=>_0x28424e['test'](_0x176e23['journeyBundleName']));}console[_0x1df8a5(0x133)](_0x1df8a5(0xe9)+_0x39e614[_0x1df8a5(0xa8)]+'\x20journey'+(_0x39e614[_0x1df8a5(0xa8)]!==0x1?'s':''));const _0x3f6691=_0x18c785=>{const _0x32a9e1=_0x1df8a5;return getConsoleNextUrl(_0xcce67b[_0x32a9e1(0x184)],_0x32a9e1(0x134)+_0x73cff+_0x32a9e1(0xd2)+_0x18c785+_0x32a9e1(0xb3));};if(_0xcce67b[_0x1df8a5(0xb9)]===_0x1df8a5(0xa9))await handleSDKOutput(_0x39e614,_0xcce67b);else{if(_0xcce67b[_0x1df8a5(0xb9)]===_0x1df8a5(0xeb)){const _0x4d0f10=_0x39e614[_0x1df8a5(0x1a5)](_0x3f7ced=>({..._0x3f7ced,'url':_0x3f6691(_0x3f7ced['id'])}));await handleSDKOutput(_0x4d0f10,_0xcce67b);}else{console['log']('['+_0x11f51e+']');const _0xeb899f=new Map(),_0x579e1d=[];for(const _0xc41cf9 of _0x39e614){if(!_0xc41cf9[_0x1df8a5(0x90)]||_0xc41cf9[_0x1df8a5(0x90)]===_0x2e667a)_0x579e1d[_0x1df8a5(0x16d)](_0xc41cf9);else{const _0x29f0f9=_0xeb899f['get'](_0xc41cf9[_0x1df8a5(0x90)])||[];_0x29f0f9[_0x1df8a5(0x16d)](_0xc41cf9),_0xeb899f[_0x1df8a5(0x162)](_0xc41cf9[_0x1df8a5(0x90)],_0x29f0f9);}}const _0x6f3ee0=(_0xc3fd54,_0xe4df71)=>_0xc3fd54[_0x1df8a5(0x11f)]['localeCompare'](_0xe4df71[_0x1df8a5(0x11f)],undefined,{'sensitivity':'base'});_0x579e1d[_0x1df8a5(0xaf)](_0x6f3ee0);for(const _0x25bc95 of _0x579e1d){console[_0x1df8a5(0x109)](formatJourneyItem(_0x25bc95,'',_0x3f6691(_0x25bc95['id'])));}const _0x11bd3b=[..._0xeb899f[_0x1df8a5(0x152)]()]['sort']((_0x28104e,_0x196c41)=>{const _0x24f953=_0x1df8a5,_0x12cda6=_0x119a21[_0x24f953(0x182)](_0x28104e[0x0])||_0x28104e[0x0],_0x24c1f7=_0x119a21[_0x24f953(0x182)](_0x196c41[0x0])||_0x196c41[0x0];return _0x12cda6['localeCompare'](_0x24c1f7,undefined,{'sensitivity':_0x24f953(0x159)});});for(const [_0x279d25,_0x1e662d]of _0x11bd3b){const _0xc021ab=_0x119a21['get'](_0x279d25)||_0x279d25;console[_0x1df8a5(0x109)](_0x1df8a5(0x165)+_0xc021ab),_0x1e662d[_0x1df8a5(0xaf)](_0x6f3ee0);for(const _0x6d7c81 of _0x1e662d){console[_0x1df8a5(0x109)](formatJourneyItem(_0x6d7c81,'\x20\x20',_0x3f6691(_0x6d7c81['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x18d);['description']=a27_0x4c00bc(0xe6);async[a27_0x4c00bc(0x104)](_0x283d23){const _0x1b918f=a27_0x4c00bc,{options:_0x55cdbf,args:_0x2b140d,tdx:_0x3bd2af}=_0x283d23,_0x54eb6b=_0x2b140d[0x0];if(!_0x54eb6b)return console[_0x1b918f(0x133)](_0x1b918f(0xf5)),console[_0x1b918f(0x133)](_0x1b918f(0x192)),console[_0x1b918f(0x133)](_0x1b918f(0x7f)),console['error'](_0x1b918f(0x154)),0x1;_0x55cdbf[_0x1b918f(0x198)]&&console[_0x1b918f(0x133)](_0x1b918f(0x175)+_0x54eb6b);const {journeyId:_0x5e4e93,parentSegmentId:_0x3a15c2}=await resolveJourneyIdFromInput(_0x54eb6b,_0x55cdbf,_0x3bd2af);if(_0x55cdbf['web']){const _0x141319=getConsoleNextUrl(_0x55cdbf[_0x1b918f(0x184)],'/app/ps/'+_0x3a15c2+_0x1b918f(0xd2)+_0x5e4e93+_0x1b918f(0xec));return console[_0x1b918f(0x133)](a27_0x2a8216['green']('✔')+_0x1b918f(0x91)+a27_0x2a8216[_0x1b918f(0x84)](_0x141319)),openBrowser(_0x141319),0x0;}const _0x160599=await withSpinner(_0x1b918f(0x1a2),()=>_0x3bd2af[_0x1b918f(0xe7)][_0x1b918f(0x10d)](_0x5e4e93),{'verbose':_0x55cdbf[_0x1b918f(0x198)]}),_0x21e039=_0x160599[_0x1b918f(0x19f)],_0x551b27=_0x55cdbf[_0x1b918f(0x171)];let _0x5636dc;if(_0x551b27)try{const _0x540f5b=await withSpinner(_0x1b918f(0x16e),()=>_0x3bd2af[_0x1b918f(0xe7)][_0x1b918f(0x17e)](_0x5e4e93),{'verbose':_0x55cdbf[_0x1b918f(0x198)]});_0x5636dc=_0x540f5b['data'];}catch{_0x55cdbf[_0x1b918f(0x198)]&&console[_0x1b918f(0x133)](_0x1b918f(0x144));}const _0x4ad5d6=getConsoleNextUrl(_0x55cdbf[_0x1b918f(0x184)],'/app/ps/'+_0x3a15c2+_0x1b918f(0xd2)+_0x5e4e93+'/j/da/je'),_0x289f9c={'id':_0x21e039['id'],'name':_0x21e039['attributes']['name'],'description':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xa4)],'state':_0x21e039['attributes'][_0x1b918f(0x199)],'paused':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xc5)],'reentry_mode':_0x21e039[_0x1b918f(0x13c)]['reentryMode'],'stages':_0x21e039[_0x1b918f(0x13c)][_0x1b918f(0x131)]?.['length']||0x0,..._0x21e039[_0x1b918f(0x13c)][_0x1b918f(0xe5)]&&{'goal':_0x21e039[_0x1b918f(0x13c)]['goal']['name']},..._0x5636dc&&{'statistics':{'size':_0x5636dc[_0x1b918f(0x181)],'entered':_0x5636dc[_0x1b918f(0x13d)],'goal_achieved':_0x5636dc[_0x1b918f(0xfc)],'completion_rate':_0x5636dc['completionRate'],'exit_or_jump':_0x5636dc[_0x1b918f(0xa1)],'exit_or_jump_rate':_0x5636dc[_0x1b918f(0x13f)],'stages':_0x5636dc['stages']}},'url':_0x4ad5d6};return await handleSingleObjectOutput(_0x289f9c,_0x55cdbf),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x146);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x100);async[a27_0x4c00bc(0x104)](_0x2a93cf){const _0x506c7d=a27_0x4c00bc,{options:_0x52ce2d,args:_0x95fdb9,tdx:_0x4f107f}=_0x2a93cf,_0x3429ac=_0x95fdb9[0x0];if(!requireNameOrPath(_0x3429ac))return 0x1;_0x52ce2d['verbose']&&console[_0x506c7d(0x133)]('Input:\x20'+_0x3429ac);const _0x18a128=_0x52ce2d,_0x3899e3=_0x18a128['from'],_0x37f692=_0x18a128['to'],_0x32b0f0=_0x18a128['includeHistory'],_0x243188=_0x18a128['stage'];_0x32b0f0&&!_0x3899e3&&!_0x37f692&&console[_0x506c7d(0x133)](_0x506c7d(0x186));const _0x16a83d=_0x32b0f0?withJsonFormat(_0x52ce2d):_0x52ce2d,{journeyId:_0x35069f,journeyName:_0x4d11ea}=await resolveJourneyIdFromInput(_0x3429ac,_0x16a83d,_0x4f107f),_0x4133e0=_0x3899e3||_0x37f692?{'from':_0x3899e3,'to':_0x37f692}:undefined,_0xcb816=await withSpinner(_0x506c7d(0x16e),()=>Promise[_0x506c7d(0x92)]([_0x4f107f[_0x506c7d(0xe7)][_0x506c7d(0x10d)](_0x35069f),_0x4f107f[_0x506c7d(0xe7)][_0x506c7d(0x17e)](_0x35069f,_0x4133e0)]),{'verbose':_0x16a83d['verbose']}),[_0x448f82,_0x483c24]=_0xcb816[_0x506c7d(0x19f)];if(!_0x483c24||_0x483c24[_0x506c7d(0xce)]===null)return console[_0x506c7d(0x133)](_0x506c7d(0x193)+_0x4d11ea),console[_0x506c7d(0x133)](_0x506c7d(0x178)),0x0;const _0x4b02e3=buildStageNameMap(_0x448f82),_0x3fb926=!!(_0x4133e0&&_0x483c24['history']?.[_0x506c7d(0xa8)]),_0x1f205d={'stageNameMap':_0x4b02e3,'hasPeriod':_0x3fb926,'includeHistory':!!_0x32b0f0};if(_0x243188&&_0x483c24[_0x506c7d(0x189)]){const _0x598661=_0x483c24[_0x506c7d(0x189)]['find'](_0x518f93=>{const _0x1b889a=_0x506c7d,_0x2501c2=_0x4b02e3[_0x1b889a(0x182)](_0x518f93['id'])??'';return _0x2501c2['toLowerCase']()===_0x243188['toLowerCase']();});if(_0x598661)return await handleSingleObjectOutput(formatStageStats(_0x598661,_0x1f205d),_0x16a83d),0x0;const _0x154a00=_0x483c24[_0x506c7d(0x189)]['map'](_0x597956=>_0x4b02e3['get'](_0x597956['id'])??_0x597956['id']);return console[_0x506c7d(0x133)](_0x506c7d(0x197)+_0x243188+'\x22\x20not\x20found'),console['error']('Available\x20stages:\x20'+_0x154a00[_0x506c7d(0x161)](',\x20')),0x1;}const _0x416fc8=_0x483c24[_0x506c7d(0x189)]?.['map'](_0x1df05e=>formatStageStats(_0x1df05e,_0x1f205d)),_0x573aa2=assembleJourneyStats(_0x483c24,{'from':_0x3899e3,'to':_0x37f692,'includeHistory':_0x32b0f0});return await this['renderStats'](_0x573aa2,_0x416fc8??[],_0x16a83d),0x0;}async['renderStats'](_0x4a22d9,_0x5b2d5c,_0x41c24e){const _0x33de08=a27_0x4c00bc,_0x15c9fc=_0x41c24e['format']===_0x33de08(0xeb)||_0x41c24e[_0x33de08(0xb9)]===_0x33de08(0x138)||_0x41c24e[_0x33de08(0xeb)]||_0x41c24e[_0x33de08(0x138)];if(_0x15c9fc){_0x4a22d9[_0x33de08(0x189)]=_0x5b2d5c,await handleSingleObjectOutput(_0x4a22d9,_0x41c24e);return;}await handleSingleObjectOutput(_0x4a22d9,_0x41c24e);for(const _0x44f03a of _0x5b2d5c){console[_0x33de08(0x109)](''),console[_0x33de08(0x109)](String(a27_0x2a8216[_0x33de08(0x84)][_0x33de08(0x196)]('['+_0x44f03a[_0x33de08(0xad)]+']'))+a27_0x2a8216[_0x33de08(0x10e)]('\x20'+_0x44f03a['id']));const {id:_0x204282,name:_0x4cabee,..._0xe9c3fc}=_0x44f03a;await handleSingleObjectOutput(_0xe9c3fc,_0x41c24e);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:traffic';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x127);async[a27_0x4c00bc(0x104)](_0x15146a){const _0x18176c=a27_0x4c00bc,{options:_0x37709d,args:_0x40fa4f,tdx:_0x406128}=_0x15146a,_0x479731=_0x40fa4f[0x0];if(!requireNameOrPath(_0x479731))return 0x1;_0x37709d[_0x18176c(0x198)]&&console['error'](_0x18176c(0x175)+_0x479731);const _0xa18e16=_0x37709d,_0x284688=_0xa18e16[_0x18176c(0x15f)],_0xbe4160=_0xa18e16['from'],_0x5b0d7d=_0xa18e16['to'],_0x3733a1=_0xa18e16[_0x18176c(0x10b)];if(_0x284688&&_0x284688!==_0x18176c(0xc2)&&_0x284688!==_0x18176c(0x80))return console['error'](_0x18176c(0xab)+_0x284688+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x5b276=withJsonFormat(_0x37709d),{journeyId:_0x2551b4,journeyName:_0x1b03cf}=await resolveJourneyIdFromInput(_0x479731,_0x5b276,_0x406128),_0x5a3310={'type':_0x284688,'from':_0xbe4160,'to':_0x5b0d7d,'limit':_0x3733a1},_0x2a68ed=await withSpinner(_0x18176c(0x145),()=>_0x406128[_0x18176c(0xe7)][_0x18176c(0x11a)](_0x2551b4,_0x5a3310),{'verbose':_0x5b276[_0x18176c(0x198)]}),_0x524423=_0x2a68ed[_0x18176c(0x19f)],_0xd91427=_0x524423[_0x18176c(0xc2)]&&(_0x524423[_0x18176c(0xc2)][_0x18176c(0x12b)][_0x18176c(0xa8)]>0x0||_0x524423[_0x18176c(0xc2)][_0x18176c(0x139)]['length']>0x0),_0x5e7401=_0x524423['activation']&&_0x524423[_0x18176c(0x80)][_0x18176c(0xa8)]>0x0;if(!_0xd91427&&!_0x5e7401)return console[_0x18176c(0x133)](_0x18176c(0x1a4)+_0x1b03cf),console[_0x18176c(0x133)](_0x18176c(0x12c)),_0xbe4160&&_0x5b0d7d&&console['error'](_0x18176c(0xdd)),0x0;return await handleSingleObjectOutput(_0x524423,_0x5b276),0x0;}}function formatStageStats(_0x5481e9,_0x35a529){const _0x5c923d=a27_0x4c00bc,_0x2f80dd=_0x35a529[_0x5c923d(0xd4)]&&_0x5481e9['history']?.['length']?aggregateStageHistory(_0x5481e9['history']):{'size':_0x5481e9[_0x5c923d(0x181)],'entered':_0x5481e9[_0x5c923d(0x13d)],'milestone':_0x5481e9[_0x5c923d(0x16c)],'milestone_rate':_0x5481e9[_0x5c923d(0x142)],'exit_or_jump':_0x5481e9[_0x5c923d(0xa1)],'exit_or_jump_rate':_0x5481e9[_0x5c923d(0x13f)]},_0x2b5b7e={'id':_0x5481e9['id'],'name':_0x35a529['stageNameMap'][_0x5c923d(0x182)](_0x5481e9['id'])??_0x5481e9['id'],..._0x2f80dd};return _0x35a529['hasPeriod']&&_0x35a529['includeHistory']&&_0x5481e9[_0x5c923d(0x16f)]&&(_0x2b5b7e[_0x5c923d(0x16f)]=_0x5481e9[_0x5c923d(0x16f)]),_0x2b5b7e;}export class JourneyPauseCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x108);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x110);async['execute'](_0x23731e){const _0x3188d6=a27_0x4c00bc,{options:_0x486743,args:_0x18f630,tdx:_0x3e984f}=_0x23731e,_0x4b8c26=_0x18f630[0x0];if(!requireNameOrPath(_0x4b8c26))return 0x1;_0x486743[_0x3188d6(0x198)]&&console[_0x3188d6(0x133)]('Input:\x20'+_0x4b8c26);const {journeyId:_0x5a985f,journeyName:_0x444854}=await resolveJourneyIdFromInput(_0x4b8c26,_0x486743,_0x3e984f);if(!_0x486743[_0x3188d6(0x15d)]){const _0x35e023=await confirm(_0x3188d6(0x103)+_0x444854+'\x22?');if(!_0x35e023)return console[_0x3188d6(0x133)]('Cancelled'),0x0;}const _0x273350=await withSpinner('Pausing\x20journey...',()=>_0x3e984f[_0x3188d6(0xe7)][_0x3188d6(0xa3)](_0x5a985f),{'verbose':_0x486743[_0x3188d6(0x198)]}),_0x408030=_0x273350[_0x3188d6(0x19f)];return console[_0x3188d6(0x133)](_0x3188d6(0xc6)+_0x408030['attributes'][_0x3188d6(0xad)]+'\x22\x20paused'),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x115);['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a27_0x4c00bc(0x104)](_0x561e2e){const _0x1dcee1=a27_0x4c00bc,{options:_0x3a15f7,args:_0xe27bd8,tdx:_0x473e3a}=_0x561e2e,_0x40df19=_0xe27bd8[0x0];if(!requireNameOrPath(_0x40df19))return 0x1;_0x3a15f7['verbose']&&console[_0x1dcee1(0x133)]('Input:\x20'+_0x40df19);const {journeyId:_0x377de4,journeyName:_0x3c35c3}=await resolveJourneyIdFromInput(_0x40df19,_0x3a15f7,_0x473e3a);if(_0x3a15f7[_0x1dcee1(0x173)])return await this[_0x1dcee1(0x176)](_0x561e2e,_0x377de4,_0x3c35c3);if(!_0x3a15f7[_0x1dcee1(0x15d)]){const _0x295cb0=await confirm(_0x1dcee1(0x9c)+_0x3c35c3+'\x22?');if(!_0x295cb0)return console[_0x1dcee1(0x133)]('Cancelled'),0x0;}const _0x411f3d=await withSpinner(_0x1dcee1(0xd9),()=>_0x473e3a[_0x1dcee1(0xe7)]['run'](_0x377de4),{'verbose':_0x3a15f7[_0x1dcee1(0x198)]}),_0x480a10=_0x411f3d[_0x1dcee1(0x19f)],_0xf8265d=getWorkflowSessionUrl(_0x3a15f7[_0x1dcee1(0x184)],_0x480a10['workflowId'],_0x480a10[_0x1dcee1(0x179)]);return console[_0x1dcee1(0x133)]('\x0a'+a27_0x2a8216[_0x1dcee1(0x1a0)]('✔')+'\x20Journey\x20workflow\x20started'),console[_0x1dcee1(0x133)]('\x20\x20'+a27_0x2a8216['dim'](_0x1dcee1(0x113))+'\x20'+_0x3c35c3),console['error']('\x20\x20'+a27_0x2a8216[_0x1dcee1(0x10e)]('Status:')+'\x20'+_0x480a10[_0x1dcee1(0x140)]),console['error']('\x20\x20'+a27_0x2a8216[_0x1dcee1(0x10e)](_0x1dcee1(0x17d))+'\x20'+_0x480a10[_0x1dcee1(0x179)]),console[_0x1dcee1(0x133)]('\x20\x20'+_0xf8265d),0x0;}async[a27_0x4c00bc(0x176)](_0x3f31af,_0xfc5a35,_0x2b9ea1){const _0x57e832=a27_0x4c00bc,{options:_0x1d4015,tdx:_0x4be0b2}=_0x3f31af,_0x496672=await withSpinner('Fetching\x20journey\x20'+_0x2b9ea1+_0x57e832(0xb5),()=>Promise['all']([_0x4be0b2[_0x57e832(0xe7)][_0x57e832(0x10d)](_0xfc5a35),_0x4be0b2['journey'][_0x57e832(0x85)](_0xfc5a35)]),{'verbose':_0x1d4015[_0x57e832(0x198)]}),[_0x8310f8,_0x19b80b]=_0x496672[_0x57e832(0x19f)],_0xd3262a=_0x8310f8[_0x57e832(0x13c)],_0x135916=_0xd3262a['journeyStages'];console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0x113)),_0xd3262a[_0x57e832(0xad)]),console['log'](a27_0x2a8216[_0x57e832(0x196)]('ID:'),_0x8310f8['id']),console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0x177)),_0xd3262a['state']),console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0xa7)),_0xd3262a['paused']?a27_0x2a8216['yellow'](_0x57e832(0x15d)):a27_0x2a8216[_0x57e832(0x1a0)]('no')),console['log'](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xd0)),_0xd3262a[_0x57e832(0x151)]);const _0x5c9ff6=_0x135916[_0x57e832(0xa8)]>0x0?'\x20('+_0x135916[_0x57e832(0x1a5)](_0x4ef7b5=>_0x4ef7b5[_0x57e832(0xad)])['join'](',\x20')+')':'';console['log'](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xfe)),''+_0x135916[_0x57e832(0xa8)]+_0x5c9ff6),console[_0x57e832(0x109)]('');if(_0x19b80b['length']===0x0)console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0x196)](_0x57e832(0xb6)),a27_0x2a8216[_0x57e832(0x10e)]('(none)'));else{console[_0x57e832(0x109)](a27_0x2a8216['bold'](_0x57e832(0xb6)));for(const _0x12778f of _0x19b80b){const _0x3b7fe0=_0x12778f[_0x57e832(0xad)]??_0x57e832(0x147),_0x214d56=_0x12778f[_0x57e832(0x12a)]!=null?_0x57e832(0xf6)+_0x12778f['connectionId']:_0x57e832(0x153),_0xfe1e59=_0x12778f['scheduleType']?''+_0x12778f[_0x57e832(0x15c)]+(_0x12778f[_0x57e832(0x135)]?_0x57e832(0x96)+_0x12778f[_0x57e832(0x135)]:''):'none',_0x3ee8c3=_0x12778f[_0x57e832(0x12f)]?_0x57e832(0x169):'';console['log']('\x20\x20'+a27_0x2a8216[_0x57e832(0xa6)]('⚠️\x20')+'\x20'+_0x3b7fe0+_0x57e832(0x148)+_0x214d56+_0x57e832(0x170)+_0xfe1e59+_0x3ee8c3);}}return console[_0x57e832(0x109)](a27_0x2a8216[_0x57e832(0xa6)](_0x57e832(0x11d))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x150);['description']=a27_0x4c00bc(0xe2);async[a27_0x4c00bc(0x104)](_0x4f5341){const _0x2a61fa=a27_0x4c00bc,{options:_0x7f81f1,args:_0x5e8335,tdx:_0x689d9a}=_0x4f5341,_0x2cf046=_0x5e8335[0x0];if(!requireNameOrPath(_0x2cf046))return 0x1;_0x7f81f1['verbose']&&console[_0x2a61fa(0x133)]('Input:\x20'+_0x2cf046);const {journeyId:_0x333fb9,journeyName:_0x30b121}=await resolveJourneyIdFromInput(_0x2cf046,_0x7f81f1,_0x689d9a);if(_0x7f81f1[_0x2a61fa(0x173)])return await this[_0x2a61fa(0x176)](_0x4f5341,_0x333fb9,_0x30b121);if(!_0x7f81f1['yes']){const _0x185ab9=await confirm(_0x2a61fa(0x9d)+_0x30b121+'\x22?');if(!_0x185ab9)return console[_0x2a61fa(0x133)](_0x2a61fa(0xb0)),0x0;}const _0xbc55ba=await withSpinner(_0x2a61fa(0xc7),()=>_0x689d9a[_0x2a61fa(0xe7)][_0x2a61fa(0x82)](_0x333fb9),{'verbose':_0x7f81f1['verbose']}),_0x36cd7a=_0xbc55ba['data'];return console['error']('✔\x20Journey\x20\x22'+_0x36cd7a[_0x2a61fa(0x13c)][_0x2a61fa(0xad)]+'\x22\x20resumed'),0x0;}async['executeDryRun'](_0x16038d,_0x40f0ca,_0x64ef77){const _0x1a18f0=a27_0x4c00bc,{options:_0x2e0718,tdx:_0x150c79}=_0x16038d,_0x3fa4fa=await withSpinner(_0x1a18f0(0xc9)+_0x64ef77+_0x1a18f0(0xb5),()=>Promise['all']([_0x150c79[_0x1a18f0(0xe7)][_0x1a18f0(0x10d)](_0x40f0ca),_0x150c79[_0x1a18f0(0xe7)][_0x1a18f0(0x85)](_0x40f0ca)]),{'verbose':_0x2e0718[_0x1a18f0(0x198)]}),[_0x2c2f6c,_0xfbc3ff]=_0x3fa4fa[_0x1a18f0(0x19f)],_0xee01d2=_0x2c2f6c[_0x1a18f0(0x13c)],_0x5f2e14=_0xee01d2[_0x1a18f0(0x131)];console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x113)),_0xee01d2[_0x1a18f0(0xad)]),console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x8d)),_0x2c2f6c['id']),console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x177)),_0xee01d2['state']),console['log'](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xa7)),_0xee01d2[_0x1a18f0(0xc5)]?a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x15d)):a27_0x2a8216['green']('no'));_0xee01d2[_0x1a18f0(0x19d)]&&console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0x13e)),_0xee01d2['pausedAt']);console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xd0)),_0xee01d2[_0x1a18f0(0x151)]);const _0x52a059=_0x5f2e14['length']>0x0?'\x20('+_0x5f2e14['map'](_0x1f038e=>_0x1f038e['name'])[_0x1a18f0(0x161)](',\x20')+')':'';console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xfe)),''+_0x5f2e14[_0x1a18f0(0xa8)]+_0x52a059),console[_0x1a18f0(0x109)]('');if(_0xfbc3ff[_0x1a18f0(0xa8)]===0x0)console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xb6)),a27_0x2a8216['dim']('(none)'));else{console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0x196)](_0x1a18f0(0xb6)));for(const _0x29da44 of _0xfbc3ff){const _0x276bf9=_0x29da44[_0x1a18f0(0xad)]??_0x1a18f0(0x147),_0x1a5f8c=_0x29da44[_0x1a18f0(0x12a)]!=null?'connection\x20'+_0x29da44[_0x1a18f0(0x12a)]:_0x1a18f0(0x153),_0x587861=_0x29da44[_0x1a18f0(0x15c)]?''+_0x29da44['scheduleType']+(_0x29da44['runAt']?_0x1a18f0(0x96)+_0x29da44[_0x1a18f0(0x135)]:''):'none',_0x2122af=_0x29da44[_0x1a18f0(0x12f)]?_0x1a18f0(0x169):'';console[_0x1a18f0(0x109)]('\x20\x20'+a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x17b))+'\x20'+_0x276bf9+_0x1a18f0(0x148)+_0x1a5f8c+_0x1a18f0(0x170)+_0x587861+_0x2122af);}}return console[_0x1a18f0(0x109)](a27_0x2a8216[_0x1a18f0(0xa6)](_0x1a18f0(0x83))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x8b);[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xa2);async[a27_0x4c00bc(0x104)](_0x5e728b){const _0x190bea=a27_0x4c00bc,{options:_0x50eb65,args:_0x368cf3,tdx:_0x3dc5e7}=_0x5e728b,_0x2770e2=_0x50eb65,_0x1c327f=_0x368cf3[0x0],_0x14d022=_0x1c327f&&isYamlFilePath(_0x1c327f),_0x63c769=await resolveTarget({'arg':_0x14d022?_0x1c327f:undefined,'contextParent':_0x50eb65['parentSegment'],'cwd':process[_0x190bea(0x128)]()});if(!isSuccessfulResolution(_0x63c769))return _0x63c769['errorCode']===_0x190bea(0x172)?(console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0xa6)](_0x190bea(0x157))),console[_0x190bea(0x133)](_0x190bea(0x98)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x190bea(0x10f)),console[_0x190bea(0x133)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a3)](_0x190bea(0xbc)+_0x63c769['message']+'\x0a')),_0x63c769['helpText']&&console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x84)](_0x63c769['helpText']))),0x1;let _0x26b984=_0x14d022?undefined:_0x1c327f,_0x5ef123,_0x1c696a;_0x63c769[_0x190bea(0x15f)]===_0x190bea(0x18e)&&(_0x26b984=_0x63c769['resourceName'],_0x5ef123=_0x63c769['filePath'],_0x1c696a=_0x63c769[_0x190bea(0x13a)]);const _0x45ce42=_0x63c769[_0x190bea(0x149)],_0x57a808=_0x63c769[_0x190bea(0xd7)];_0x2770e2[_0x190bea(0x198)]&&(console[_0x190bea(0x133)]('Parent\x20segment:\x20'+_0x45ce42),console['error'](_0x190bea(0xfa)+_0x57a808),_0x26b984&&console['error']('Journey\x20name:\x20'+_0x26b984),_0x5ef123&&console['error'](_0x190bea(0xe4)+_0x5ef123),_0x1c696a&&console[_0x190bea(0x133)](_0x190bea(0x81)+_0x1c696a));const _0x6fa035=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3dc5e7[_0x190bea(0xd3)][_0x190bea(0x16b)](_0x45ce42),{'verbose':_0x50eb65[_0x190bea(0x198)]}),_0x19ec8d=_0x6fa035[_0x190bea(0x19f)],{journeys:_0x484f56,folders:_0x4cfab8}=await withSpinner(_0x190bea(0xb8),async()=>{const _0x1d8515=_0x190bea,[_0x37bb4d,_0x4a7ad2]=await Promise[_0x1d8515(0x92)]([_0x3dc5e7['journey']['listJourneysFromParentSegment'](_0x19ec8d,undefined,{'includeAllVersions':!![]}),_0x3dc5e7[_0x1d8515(0xd3)]['listFolders'](_0x19ec8d)]);return{'journeys':_0x37bb4d,'folders':_0x4a7ad2};},{'verbose':_0x50eb65[_0x190bea(0x198)]})[_0x190bea(0xda)](_0x1de5b8=>_0x1de5b8[_0x190bea(0x19f)]);let _0x3b3fce=_0x484f56;const _0x2c27e4=buildFolderIdToPathMap(_0x4cfab8);if(_0x26b984){const _0x5a18b0=_0x3b3fce[_0x190bea(0xe1)](_0x46c391=>_0x46c391[_0x190bea(0x11f)][_0x190bea(0xff)]()===_0x26b984['toLowerCase']());if(_0x5a18b0[_0x190bea(0xa8)]===0x0)return console[_0x190bea(0x133)](_0x190bea(0x183)+_0x26b984),console['error'](_0x190bea(0xbe)),0x1;_0x3b3fce=_0x5a18b0;}if(_0x1c696a!==undefined){const _0x209890=_0x3b3fce[_0x190bea(0xe1)](_0x17f350=>{const _0x34bb5d=_0x190bea,_0x20bcf0=_0x17f350['folderId']?_0x2c27e4['get'](_0x17f350[_0x34bb5d(0x90)])||'':'';return _0x20bcf0===_0x1c696a;});if(_0x209890['length']===0x0&&_0x3b3fce[_0x190bea(0xa8)]>0x0){console[_0x190bea(0x133)](_0x190bea(0x9f)+_0x26b984+_0x190bea(0x117)+(_0x1c696a||_0x190bea(0x19e))),console['error'](_0x190bea(0x122));for(const _0x4b42af of _0x3b3fce){const _0x332635=_0x4b42af['folderId']?_0x2c27e4[_0x190bea(0x182)](_0x4b42af[_0x190bea(0x90)])||'':'';console[_0x190bea(0x133)](_0x190bea(0xc0)+(_0x332635||_0x190bea(0x119))+'/'+_0x4b42af[_0x190bea(0x11f)]);}return 0x1;}_0x3b3fce=_0x209890;}if(_0x3b3fce[_0x190bea(0xa8)]===0x0)return console[_0x190bea(0x133)](_0x190bea(0x105)),0x0;const _0x1a98cd=new Map();for(const _0x39d2cd of _0x3b3fce){const _0x43aa06=_0x39d2cd[_0x190bea(0xe8)];!_0x1a98cd[_0x190bea(0xc4)](_0x43aa06)&&_0x1a98cd['set'](_0x43aa06,[]),_0x1a98cd[_0x190bea(0x182)](_0x43aa06)[_0x190bea(0x16d)](_0x39d2cd);}for(const _0x1ec293 of _0x1a98cd['values']()){_0x1ec293[_0x190bea(0xaf)]((_0x1f83a7,_0x455c7d)=>(_0x1f83a7[_0x190bea(0x9a)]||0x0)-(_0x455c7d['versionNumber']||0x0));}const _0x2f08a9=[],{idToEmailMap:_0x48ad27,connectionIdToNameMap:_0x4237c1}=await withSpinner(_0x190bea(0x107),async()=>{const _0x363f7f=_0x190bea,[_0x2349a0,_0x4b983a]=await Promise[_0x363f7f(0x92)]([_0x3dc5e7['user'][_0x363f7f(0x99)](),_0x3dc5e7[_0x363f7f(0xac)][_0x363f7f(0xcb)]()]);return{'idToEmailMap':_0x2349a0,'connectionIdToNameMap':_0x4b983a};},{'verbose':_0x50eb65[_0x190bea(0x198)]})[_0x190bea(0xda)](_0x42d91c=>_0x42d91c[_0x190bea(0x19f)]);for(const _0x2f368f of _0x1a98cd[_0x190bea(0xa0)]()){const _0x1aa554=_0x2f368f[0x0][_0x190bea(0x11f)],_0x1ed508=_0x2f368f[0x0][_0x190bea(0x90)],_0x30960e=_0x1ed508?_0x2c27e4[_0x190bea(0x182)](_0x1ed508)||'':'',_0x21a37c=_0x30960e?a27_0x576223[_0x190bea(0x161)](_0x57a808,_0x30960e):_0x57a808,_0x2914ef=_0x5ef123||a27_0x576223['join'](_0x21a37c,sanitizeFileName(_0x1aa554)+_0x190bea(0x89));let _0x2acae6,_0x3312e7;if(existsSync(_0x2914ef))try{const _0x328098=readFileSync(_0x2914ef,_0x190bea(0x8e)),_0x20fdf5=parseYamlString(_0x328098);_0x3312e7=_0x20fdf5,_0x2acae6=buildRuleToNameMapping(_0x20fdf5),_0x2770e2[_0x190bea(0x198)]&&_0x2acae6[_0x190bea(0x181)]>0x0&&console[_0x190bea(0x133)]('Found\x20'+_0x2acae6[_0x190bea(0x181)]+_0x190bea(0xba)+_0x1aa554);}catch(_0x4740d8){_0x2770e2['verbose']&&console[_0x190bea(0x133)](_0x190bea(0xdf)+_0x4740d8[_0x190bea(0x19b)]);}const _0x3dd878=[],_0x32ac76=new Set(),_0x320c89=new Map(),_0x22a3eb=new Map(),_0x409bc5=new Set(),_0x3d1d6e=new Map(),_0x144b32=new Map(),_0x4ead6a=createJumpTargetCache();await withProgressSpinner(_0x190bea(0x143)+_0x1aa554+_0x190bea(0xb5),async _0x27c563=>{const _0x1f8749=_0x190bea;for(const _0x1d17bc of _0x2f368f){const _0x483037=_0x2f368f[_0x1f8749(0xa8)]>0x1?_0x1d17bc['journeyBundleName']+'\x20v'+(_0x1d17bc[_0x1f8749(0x9a)]||0x1):_0x1d17bc[_0x1f8749(0x11f)];_0x27c563[_0x1f8749(0x136)](_0x1f8749(0x143)+_0x483037);const _0x3f49a5=await _0x3dc5e7[_0x1f8749(0xe7)][_0x1f8749(0x10d)](_0x1d17bc['id']),_0x1064a3=_0x3f49a5[_0x1f8749(0x13c)]?.[_0x1f8749(0x151)],_0x533e71={'resolveSegment':async _0x508259=>{const _0x405895=_0x1f8749;if(!_0x1064a3)return{'name':_0x508259,'isJourneyLocal':![]};const _0x567e87=_0x320c89[_0x405895(0x182)](_0x508259);if(_0x567e87)return _0x567e87;try{const _0x77388e=await _0x3dc5e7[_0x405895(0xd3)]['getSegment'](_0x1064a3,_0x508259),_0x5c3c16=_0x77388e[_0x405895(0x18a)]===SEGMENT_KIND_JOURNEY;let _0x4027ab,_0xe5e58b=_0x77388e[_0x405895(0xad)];if(_0x5c3c16&&_0x77388e[_0x405895(0x14a)]){const _0x4c0a30=await segmentResponseToDef(_0x77388e,{'resolveSegmentName':async _0x30ac03=>{const _0x4a9c23=_0x405895,_0x208ae1=_0x320c89[_0x4a9c23(0x182)](_0x30ac03);if(_0x208ae1)return _0x208ae1['name'];const _0x1ede7d=await _0x533e71[_0x4a9c23(0x88)](_0x30ac03);return _0x1ede7d[_0x4a9c23(0xad)];}}),_0x292340=_0x4c0a30[_0x405895(0x14a)];_0x4027ab={'description':_0x77388e['description'],'rule':_0x292340};const _0x3ffb9f=serializeRule(_0x292340),_0x570c15=_0x22a3eb[_0x405895(0x182)](_0x3ffb9f);if(_0x570c15)_0xe5e58b=_0x570c15,_0x4027ab=undefined,_0x2770e2[_0x405895(0x198)]&&console[_0x405895(0x133)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x77388e[_0x405895(0xad)]+_0x405895(0x12e)+_0x570c15);else{let _0x379515=![];if(_0x2acae6){const _0x36434d=_0x2acae6[_0x405895(0x182)](_0x3ffb9f);if(_0x36434d){const _0x3d4677=_0x36434d[_0x405895(0x101)](_0x151d43=>!_0x32ac76[_0x405895(0xc4)](_0x151d43));_0x3d4677&&(_0xe5e58b=_0x3d4677,_0x32ac76['add'](_0x3d4677),_0x22a3eb[_0x405895(0x162)](_0x3ffb9f,_0x3d4677),_0x379515=!![],_0x2770e2[_0x405895(0x198)]&&console[_0x405895(0x133)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x3d4677+_0x405895(0x190)));}}if(!_0x379515){const _0x6dbeaf=generateJourneyLocalName(_0x77388e['name']);_0x6dbeaf&&(_0xe5e58b=_0x6dbeaf);let _0x5a898d=_0xe5e58b,_0x2cd1fc=0x2;while(_0x32ac76['has'](_0x5a898d)){_0x5a898d=_0xe5e58b+'_'+_0x2cd1fc,_0x2cd1fc++;}_0x32ac76[_0x405895(0x125)](_0x5a898d),_0x22a3eb[_0x405895(0x162)](_0x3ffb9f,_0x5a898d),_0xe5e58b=_0x5a898d;}}}const _0xce502b={'name':_0xe5e58b,'isJourneyLocal':_0x5c3c16,'definition':_0x4027ab};return _0x320c89[_0x405895(0x162)](_0x508259,_0xce502b),_0xce502b;}catch(_0x1cc926){return _0x50eb65[_0x405895(0x198)]&&console[_0x405895(0x133)](_0x405895(0xaa)+_0x508259+':\x20'+_0x1cc926[_0x405895(0x19b)]),{'name':_0x508259,'isJourneyLocal':![]};}},'resolveActivation':async _0x6d7897=>{const _0x123818=_0x1f8749,_0xb4b251=_0x3d1d6e[_0x123818(0x182)](_0x6d7897);if(_0xb4b251)return _0xb4b251;try{const _0xbe3621=await _0x3dc5e7[_0x123818(0xe7)][_0x123818(0xa5)](_0x1d17bc['id'],_0x6d7897),_0x5f09fd=journeyActivationStepToYaml(_0xbe3621,_0x48ad27,_0x4237c1),_0xbe7dec=JSON[_0x123818(0xea)]({'name':_0x5f09fd[_0x123818(0xad)],'connection':_0x5f09fd[_0x123818(0xac)],'connector_config':_0x5f09fd[_0x123818(0xef)]}),_0x202081=_0x144b32[_0x123818(0x182)](_0xbe7dec);if(_0x202081){const _0x3bdbf1={'name':_0x202081,'isJourneyLocal':!![],'definition':_0x5f09fd};return _0x3d1d6e[_0x123818(0x162)](_0x6d7897,_0x3bdbf1),_0x3bdbf1;}const _0x5b58aa=_0xbe3621[_0x123818(0x13c)]['activationParams']['name']||_0x6d7897,_0x39199f=sanitizeYamlKey(_0x5b58aa)||'activation_'+_0x6d7897;let _0xe3fbc3=_0x39199f,_0x1689e7=0x2;while(_0x409bc5[_0x123818(0xc4)](_0xe3fbc3)){_0xe3fbc3=_0x39199f+'_'+_0x1689e7,_0x1689e7++;}_0x409bc5['add'](_0xe3fbc3),_0x144b32[_0x123818(0x162)](_0xbe7dec,_0xe3fbc3);const _0x306809={'name':_0xe3fbc3,'isJourneyLocal':!![],'definition':_0x5f09fd};return _0x3d1d6e['set'](_0x6d7897,_0x306809),_0x306809;}catch(_0xc02063){return _0x50eb65[_0x123818(0x198)]&&console['error'](_0x123818(0x164)+_0x6d7897+':\x20'+_0xc02063[_0x123818(0x19b)]),{'name':_0x6d7897,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x405f9f,_0x4285a1)=>{const _0x2bf3ff=_0x1f8749;return resolveJumpTarget(_0x405f9f,_0x4285a1,_0x4ead6a,_0x4af410=>_0x3dc5e7[_0x2bf3ff(0xe7)][_0x2bf3ff(0x10d)](_0x4af410));}},_0x92ee58=await journeyResponseToDef(_0x3f49a5,_0x533e71);_0x3dd878[_0x1f8749(0x16d)]({'item':_0x1d17bc,'yaml':_0x92ee58});}},{'verbose':_0x50eb65[_0x190bea(0x198)]});const _0x32faec=await _0x3dc5e7[_0x190bea(0xe7)][_0x190bea(0xcf)](_0x2f368f[0x0][_0x190bea(0xe8)]),_0x4eb849=buildMergedJourneyDef(_0x3dd878,_0x2acae6,_0x32faec),_0x4e3000=normalizeJourneyDef(_0x4eb849,_0x3312e7),_0x294a5=toYamlString(_0x4e3000),_0x42fbac=_0x5ef123||a27_0x576223['join'](_0x21a37c,sanitizeFileName(_0x1aa554)+_0x190bea(0x89));!_0x5ef123&&_0x30960e&&!existsSync(_0x21a37c)&&mkdirSync(_0x21a37c,{'recursive':!![]});const _0x4e4412=a27_0x576223[_0x190bea(0x106)](process[_0x190bea(0x128)](),_0x42fbac);if(existsSync(_0x42fbac)){const _0xa02e24=readFileSync(_0x42fbac,'utf-8'),_0x26fba5=generateDiff(_0xa02e24,_0x294a5),_0x4064ba=hasChanges(_0x26fba5);_0x2f08a9['push']({'relativePath':_0x4e4412,'absolutePath':_0x42fbac,'content':_0x294a5,'isNew':![],'hasChanges':_0x4064ba,'diff':_0x4064ba?formatDiffWithColors(_0x26fba5):undefined});}else _0x2f08a9[_0x190bea(0x16d)]({'relativePath':_0x4e4412,'absolutePath':_0x42fbac,'content':_0x294a5,'isNew':!![],'hasChanges':![]});}const _0x521bcd=_0x2f08a9[_0x190bea(0xe1)](_0x262051=>_0x262051[_0x190bea(0x118)]),_0x868edd=_0x2f08a9[_0x190bea(0xe1)](_0x549fc1=>!_0x549fc1[_0x190bea(0x118)]&&_0x549fc1['hasChanges']),_0x40753e=_0x2f08a9['filter'](_0x40362e=>!_0x40362e[_0x190bea(0x118)]&&!_0x40362e[_0x190bea(0xdb)]),_0x393bf5=_0x3b3fce[_0x190bea(0xa8)],_0x10d2a1=_0x1a98cd[_0x190bea(0x181)],_0x4fc624=_0x393bf5>_0x10d2a1?'\x20('+_0x393bf5+'\x20versions)':'';console[_0x190bea(0x133)](_0x190bea(0x10c)),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216[_0x190bea(0x84)](_0x10d2a1+_0x190bea(0xf0))+a27_0x2a8216[_0x190bea(0x10e)](_0x4fc624)),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216['green']('+\x20'+_0x521bcd['length']+'\x20new\x20files')),console[_0x190bea(0x133)]('\x20\x20'+a27_0x2a8216[_0x190bea(0xa6)]('~\x20'+_0x868edd[_0x190bea(0xa8)]+_0x190bea(0x174))),console['error']('\x20\x20'+a27_0x2a8216[_0x190bea(0x10e)]('=\x20'+_0x40753e[_0x190bea(0xa8)]+_0x190bea(0x87))),console[_0x190bea(0x133)](_0x190bea(0x194)+a27_0x2a8216['cyan'](_0x57a808)+'\x0a');if(_0x868edd[_0x190bea(0xa8)]>0x0)for(const _0x2983f8 of _0x868edd){console[_0x190bea(0x133)](_0x190bea(0x114)+_0x2983f8[_0x190bea(0x8c)]+'\x27:'),console[_0x190bea(0x133)]('─'[_0x190bea(0xde)](0x3c)),console[_0x190bea(0x133)](_0x2983f8[_0x190bea(0x116)]),console[_0x190bea(0x133)]('─'['repeat'](0x3c));}if(_0x2770e2[_0x190bea(0x173)])return console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0xa6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x521bcd['length']===0x0&&_0x868edd['length']===0x0)return console['error'](a27_0x2a8216[_0x190bea(0x1a0)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x45ce42},_0x2770e2[_0x190bea(0x132)]),console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a0)](_0x190bea(0xe3)+a27_0x2a8216[_0x190bea(0x10e)](_0x190bea(0x156))+_0x190bea(0x18f)+a27_0x2a8216[_0x190bea(0x84)](_0x45ce42))),0x0;if(!_0x2770e2[_0x190bea(0x15d)]&&(_0x521bcd['length']>0x0||_0x868edd[_0x190bea(0xa8)]>0x0)){if(!isInteractive())return console['error'](a27_0x2a8216['red'](_0x190bea(0x188)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x10e)](_0x190bea(0x19c))),0x1;const _0x450cc1=await confirmKey(_0x190bea(0xbb)+(_0x521bcd[_0x190bea(0xa8)]+_0x868edd['length'])+'\x20files?');if(!_0x450cc1)return console['error'](a27_0x2a8216[_0x190bea(0xa6)](_0x190bea(0x191)),_0x190bea(0xcd)),0x1;}!existsSync(_0x57a808)&&mkdirSync(_0x57a808,{'recursive':!![]});const _0x3ff38e=a27_0x576223[_0x190bea(0x161)](_0x57a808,_0x190bea(0x141));writeFileSync(_0x3ff38e,createTdxConfigContent(_0x45ce42),_0x190bea(0x8e));for(const _0x37b201 of _0x2f08a9){(_0x37b201[_0x190bea(0x118)]||_0x37b201['hasChanges'])&&writeFileSync(_0x37b201[_0x190bea(0x8f)],_0x37b201[_0x190bea(0x86)],'utf-8');}return console[_0x190bea(0x133)](a27_0x2a8216[_0x190bea(0x1a0)](_0x190bea(0x102)+(_0x521bcd[_0x190bea(0xa8)]+_0x868edd[_0x190bea(0xa8)])+_0x190bea(0x19a)+_0x57a808)),saveSessionContext({'parent_segment':_0x45ce42},_0x2770e2[_0x190bea(0x132)]),console['error'](a27_0x2a8216['green'](_0x190bea(0xe3)+a27_0x2a8216['dim']('parent_segment')+_0x190bea(0x18f)+a27_0x2a8216[_0x190bea(0x84)](_0x45ce42))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]=a27_0x4c00bc(0x137);[a27_0x4c00bc(0xa4)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x4c00bc(0x104)](_0x456ec7){const _0x301631=a27_0x4c00bc,{options:_0x55089c,args:_0x47bdfc,tdx:_0x1fa3d1}=_0x456ec7,_0x32ed95=_0x47bdfc[0x0];if(!requireNameOrPath(_0x32ed95))return 0x1;_0x55089c[_0x301631(0x198)]&&console['error']('Input:\x20'+_0x32ed95);const {journeyId:_0x161fe1}=await resolveJourneyIdFromInput(_0x32ed95,_0x55089c,_0x1fa3d1),_0x3e6d71=await withSpinner(_0x301631(0x111),()=>_0x1fa3d1['journey'][_0x301631(0x168)](_0x161fe1),{'verbose':_0x55089c[_0x301631(0x198)]}),_0x4b43e4=_0x3e6d71[_0x301631(0x19f)];return console[_0x301631(0x109)]('Database:\x20'+_0x4b43e4[_0x301631(0x10a)]),console[_0x301631(0x109)](_0x301631(0x158)+_0x4b43e4[_0x301631(0xa9)]),await handleSDKOutput(_0x4b43e4[_0x301631(0x14b)],_0x55089c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a27_0x4c00bc(0xa4)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x4c00bc(0x104)](_0x108f64){const _0x39dfd0=a27_0x4c00bc,{options:_0x1b97a4,args:_0x5ac393,tdx:_0x1ade52}=_0x108f64,_0xb57d15=_0x5ac393[0x0];if(!requireNameOrPath(_0xb57d15))return 0x1;_0x1b97a4[_0x39dfd0(0x198)]&&console[_0x39dfd0(0x133)]('Input:\x20'+_0xb57d15);const {journeyId:_0x1aefe0}=await resolveJourneyIdFromInput(_0xb57d15,_0x1b97a4,_0x1ade52),_0x2fde32=await withSpinner(_0x39dfd0(0x15e),()=>_0x1ade52[_0x39dfd0(0xe7)]['listActivationsFlat'](_0x1aefe0),{'verbose':_0x1b97a4['verbose']}),_0x1606c1=_0x2fde32[_0x39dfd0(0x19f)];return console['error']('Found\x20'+_0x1606c1[_0x39dfd0(0xa8)]+_0x39dfd0(0x16a)+(_0x1606c1[_0x39dfd0(0xa8)]!==0x1?'s':'')),await handleSDKOutput(_0x1606c1,_0x1b97a4),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:push';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xb2);[a27_0x4c00bc(0x9b)]=new SegmentPushCommand();async[a27_0x4c00bc(0x104)](_0x3b3232){const _0x58de36=a27_0x4c00bc,_0x5f7c69=_0x3b3232[_0x58de36(0xfb)][0x0];let _0x4ef3c8;if(_0x5f7c69){const _0x5dafd8=await resolveTarget({'arg':_0x5f7c69,'contextParent':_0x3b3232[_0x58de36(0x129)]['parentSegment'],'cwd':process['cwd']()});isSuccessfulResolution(_0x5dafd8)&&_0x5dafd8[_0x58de36(0x15f)]==='file'&&(_0x4ef3c8=_0x5dafd8[_0x58de36(0xd6)]);}const _0x4f0688={..._0x3b3232,'options':{..._0x3b3232[_0x58de36(0x129)],'journeysOnly':!![],..._0x4ef3c8&&{'singleFilePath':_0x4ef3c8}}};return this[_0x58de36(0x9b)][_0x58de36(0x104)](_0x4f0688);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:versions';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0xf7);async['execute'](_0x159546){const _0xcdeb5a=a27_0x4c00bc,{options:_0x1c66c8,args:_0x127e1e,tdx:_0x4c68bd}=_0x159546,_0x34319f=_0x127e1e[0x0];if(!requireNameOrPath(_0x34319f))return 0x1;if(_0x1c66c8[_0xcdeb5a(0x198)])console[_0xcdeb5a(0x133)]('Input:\x20'+_0x34319f);const {journeyId:_0x154655}=await resolveJourneyIdFromInput(_0x34319f,_0x1c66c8,_0x4c68bd),_0x293ae2=await withSpinner(_0xcdeb5a(0x17f),()=>_0x4c68bd[_0xcdeb5a(0xe7)][_0xcdeb5a(0x15b)](_0x154655),{'verbose':_0x1c66c8[_0xcdeb5a(0x198)]}),{bundleName:_0x51c7d3,versions:_0x1d4861,latestJourneyId:_0x2c1d34}=_0x293ae2['data'];console[_0xcdeb5a(0x133)](_0x51c7d3+':\x20'+_0x1d4861[_0xcdeb5a(0xa8)]+_0xcdeb5a(0x11c)+(_0x1d4861['length']!==0x1?'s':''));const _0x4e11e6=_0x1d4861[_0xcdeb5a(0x1a5)](_0x10d87b=>({'version':_0x10d87b[_0xcdeb5a(0x9a)],'journey_id':_0x10d87b[_0xcdeb5a(0xce)],'name':_0x10d87b[_0xcdeb5a(0xad)],'state':_0x10d87b[_0xcdeb5a(0x199)],'paused':_0x10d87b['paused'],'latest':_0x10d87b[_0xcdeb5a(0xce)]===_0x2c1d34,'created_at':_0x10d87b['createdAt']}));return await handleSDKOutput(_0x4e11e6,_0x1c66c8),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:version:create';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x14d);async[a27_0x4c00bc(0x104)](_0x316729){const _0x1aaa0b=a27_0x4c00bc,{options:_0x426742,args:_0x170d10,tdx:_0x19e69f}=_0x316729,_0x485eaf=_0x170d10[0x0];if(!requireNameOrPath(_0x485eaf))return 0x1;if(_0x426742[_0x1aaa0b(0x198)])console[_0x1aaa0b(0x133)]('Input:\x20'+_0x485eaf);const {journeyId:_0x20633a,journeyName:_0x3ed3eb}=await resolveJourneyIdFromInput(_0x485eaf,_0x426742,_0x19e69f);if(!_0x426742[_0x1aaa0b(0x15d)]){const _0x4c8ff6=await confirm(_0x1aaa0b(0x167)+_0x3ed3eb+'\x22?');if(!_0x4c8ff6)return console[_0x1aaa0b(0x133)](_0x1aaa0b(0xb0)),0x0;}const _0x23f86a=await withSpinner(_0x1aaa0b(0x11e),()=>_0x19e69f['journey'][_0x1aaa0b(0x18b)](_0x20633a),{'verbose':_0x426742[_0x1aaa0b(0x198)]}),_0x287c7f=_0x23f86a[_0x1aaa0b(0x19f)];return console[_0x1aaa0b(0x133)](a27_0x2a8216[_0x1aaa0b(0x1a0)]('✔')+_0x1aaa0b(0xf4)+_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0x9a)]+'\x20(draft)\x20—\x20\x22'+_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0xad)]+'\x22'),console[_0x1aaa0b(0x133)](_0x1aaa0b(0x14f)+_0x287c7f['id']),await handleSingleObjectOutput({'id':_0x287c7f['id'],'name':_0x287c7f['attributes'][_0x1aaa0b(0xad)],'version':_0x287c7f[_0x1aaa0b(0x13c)]['versionNumber'],'state':_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0x199)],'bundle_id':_0x287c7f['attributes'][_0x1aaa0b(0xe8)],'created_at':_0x287c7f[_0x1aaa0b(0x13c)][_0x1aaa0b(0xdc)]},_0x426742),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x4c00bc(0xad)]='journey:version:view';[a27_0x4c00bc(0xa4)]=a27_0x4c00bc(0x123);async['execute'](_0x1b5e04){const _0x65dffc=a27_0x4c00bc,{options:_0x192093,args:_0x298392,tdx:_0x453bc6}=_0x1b5e04,_0x40c551=_0x298392[0x0];if(!requireNameOrPath(_0x40c551))return 0x1;const _0x1ec4b1=_0x192093[_0x65dffc(0x9e)];if(!_0x1ec4b1)return console[_0x65dffc(0x133)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x65dffc(0x133)](_0x65dffc(0x1a1)),0x1;const _0x3abd0f=parseInt(_0x1ec4b1,0xa);if(isNaN(_0x3abd0f)||_0x3abd0f<0x1)return console[_0x65dffc(0x133)](_0x65dffc(0x160)+_0x1ec4b1),0x1;if(_0x192093[_0x65dffc(0x198)])console[_0x65dffc(0x133)](_0x65dffc(0x175)+_0x40c551+',\x20version:\x20'+_0x3abd0f);const {journeyId:_0x54ebf2,parentSegmentId:_0x1e819a}=await resolveJourneyIdFromInput(_0x40c551,_0x192093,_0x453bc6),_0x19e2bc=await withSpinner(_0x65dffc(0x11b),()=>_0x453bc6['journey']['listVersions'](_0x54ebf2),{'verbose':_0x192093['verbose']}),{versions:_0x2b7bfb,latestJourneyId:_0x2b0c55}=_0x19e2bc['data'],_0x1a0548=_0x2b7bfb[_0x65dffc(0x101)](_0x57a90e=>_0x57a90e[_0x65dffc(0x9a)]===_0x3abd0f);if(!_0x1a0548){const _0x3dd5f3=_0x2b7bfb[_0x65dffc(0x1a5)](_0x5db883=>'v'+_0x5db883[_0x65dffc(0x9a)])[_0x65dffc(0x161)](',\x20');return console[_0x65dffc(0x133)](_0x65dffc(0x14c)+_0x3abd0f+_0x65dffc(0x187)+_0x3dd5f3),0x1;}const _0x582b88=await withSpinner(_0x65dffc(0xe0)+_0x3abd0f+_0x65dffc(0x17a),()=>_0x453bc6[_0x65dffc(0xe7)][_0x65dffc(0x10d)](_0x1a0548[_0x65dffc(0xce)]),{'verbose':_0x192093[_0x65dffc(0x198)]}),_0x54a82c=_0x582b88[_0x65dffc(0x19f)],_0x4ddece=getConsoleNextUrl(_0x192093['site'],'/app/ps/'+_0x1e819a+_0x65dffc(0xd2)+_0x1a0548[_0x65dffc(0xce)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x54a82c['id'],'name':_0x54a82c['attributes']['name'],'version':_0x54a82c['attributes']['versionNumber'],'description':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xa4)],'state':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0x199)],'paused':_0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xc5)],'reentry_mode':_0x54a82c['attributes'][_0x65dffc(0x166)],'stages':_0x54a82c['attributes'][_0x65dffc(0x131)]?.[_0x65dffc(0xa8)]||0x0,..._0x54a82c[_0x65dffc(0x13c)][_0x65dffc(0xe5)]&&{'goal':_0x54a82c['attributes']['goal']['name']},'latest':_0x1a0548[_0x65dffc(0xce)]===_0x2b0c55,'created_at':_0x54a82c[_0x65dffc(0x13c)]['createdAt'],'updated_at':_0x54a82c['attributes'][_0x65dffc(0x130)],'url':_0x4ddece},_0x192093),0x0;}}
|
|
1
|
+
const a27_0x363bd7=a27_0x2667;(function(_0x2a0c5f,_0x12c4a6){const _0x27958a=a27_0x2667,_0x3002d2=_0x2a0c5f();while(!![]){try{const _0x556356=-parseInt(_0x27958a(0x1e1))/0x1*(parseInt(_0x27958a(0x203))/0x2)+-parseInt(_0x27958a(0x19a))/0x3+-parseInt(_0x27958a(0x1e2))/0x4+parseInt(_0x27958a(0x122))/0x5+parseInt(_0x27958a(0xfd))/0x6*(parseInt(_0x27958a(0x202))/0x7)+-parseInt(_0x27958a(0x200))/0x8+parseInt(_0x27958a(0x1c7))/0x9*(parseInt(_0x27958a(0x12b))/0xa);if(_0x556356===_0x12c4a6)break;else _0x3002d2['push'](_0x3002d2['shift']());}catch(_0x32b08a){_0x3002d2['push'](_0x3002d2['shift']());}}}(a27_0x43f2,0x57948));import a27_0x241683 from'chalk';import a27_0x5d2d5b from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1ec54e){const _0x54fed2=a27_0x2667;return!_0x1ec54e&&(console[_0x54fed2(0x1d4)](_0x54fed2(0x1f7)),console[_0x54fed2(0x1d4)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x1ec54e;}function withJsonFormat(_0x264017){const _0x51f9c3=a27_0x2667;if(!_0x264017[_0x51f9c3(0x149)]&&!_0x264017[_0x51f9c3(0x1e3)]&&!_0x264017[_0x51f9c3(0x12c)]&&!_0x264017[_0x51f9c3(0x160)])return{..._0x264017,'format':'json','json':!![]};return _0x264017;}function formatJourneyState(_0xee0e13){const _0x4e1be4=a27_0x2667;switch(_0xee0e13){case _0x4e1be4(0xd5):return a27_0x241683[_0x4e1be4(0xee)](_0x4e1be4(0x101));case _0x4e1be4(0x18c):return a27_0x241683[_0x4e1be4(0x11f)](_0x4e1be4(0x1b5));case _0x4e1be4(0x1ec):return a27_0x241683['yellow']('(paused)');case _0x4e1be4(0xe3):return a27_0x241683['blue'](_0x4e1be4(0x1d5));case'archived':return a27_0x241683[_0x4e1be4(0x11f)](_0x4e1be4(0x19f));default:return'('+_0xee0e13+')';}}function formatJourneyItem(_0x1ca1fc,_0x2ef9e2='',_0x51163c){const _0x2a9ef9=a27_0x2667,_0x280e05=formatJourneyState(_0x1ca1fc[_0x2a9ef9(0x1d2)]),_0x5878ae=_0x51163c?hyperlink(_0x1ca1fc[_0x2a9ef9(0xf9)],_0x51163c):_0x1ca1fc[_0x2a9ef9(0xf9)];return _0x2ef9e2+'🗺️\x20'+_0x5878ae+'\x20'+_0x280e05;}function escapeRegex(_0x170cd8){const _0x14512e=a27_0x2667;return _0x170cd8[_0x14512e(0x187)](/[.*+?^${}()|[\]\\]/g,_0x14512e(0x1c9));}function globToRegex(_0x2648f6){const _0x55feb9=a27_0x2667,_0x15d3a1=_0x2648f6['split']('*')['map'](escapeRegex);return new RegExp(_0x15d3a1[_0x55feb9(0x1b2)]('.*'),'i');}function buildRuleToNameMapping(_0x1ab9ae){const _0x5dc97b=a27_0x2667,_0x25c955=new Map();if(_0x1ab9ae[_0x5dc97b(0x12d)])for(const [_0x4c77e0,_0x43f656]of Object[_0x5dc97b(0x114)](_0x1ab9ae[_0x5dc97b(0x12d)])){if(_0x43f656[_0x5dc97b(0x134)]){const _0x42452b=serializeRule(_0x43f656[_0x5dc97b(0x134)]),_0x41117d=_0x25c955[_0x5dc97b(0x146)](_0x42452b);_0x41117d?_0x41117d[_0x5dc97b(0x14b)](_0x4c77e0):_0x25c955['set'](_0x42452b,[_0x4c77e0]);}}return _0x25c955;}async function resolveJourneyIdFromInput(_0x1d8e84,_0x2401e1,_0x5c33d8){const _0x384d4a=a27_0x2667,_0x4da578=await resolveJourneyTarget(_0x1d8e84,_0x2401e1[_0x384d4a(0x135)],_0x2401e1[_0x384d4a(0x1b7)]),_0x31bc58=_0x4da578[_0x384d4a(0x135)];if(!_0x31bc58)throw new SDKError(ErrorCode[_0x384d4a(0x1ab)],_0x384d4a(0x148));const _0x375af3=await withSpinner(_0x384d4a(0x142),()=>_0x5c33d8[_0x384d4a(0x1b6)]['resolveParentId'](_0x31bc58),{'verbose':_0x2401e1['verbose']}),_0x392f17=_0x375af3[_0x384d4a(0x129)],_0x53c612=await withSpinner(_0x384d4a(0x1f8),()=>_0x5c33d8[_0x384d4a(0x1ba)]['resolveJourneyId'](_0x392f17,_0x4da578[_0x384d4a(0x1a8)]),{'verbose':_0x2401e1[_0x384d4a(0x1b7)]});return{'journeyId':_0x53c612[_0x384d4a(0x129)],'journeyName':_0x4da578[_0x384d4a(0x1a8)],'parentSegmentId':_0x392f17};}async function resolveJourneyTarget(_0x53a3fd,_0x1c0e10,_0x4a0fa9){const _0x2d6aca=a27_0x2667;if(isYamlFilePath(_0x53a3fd))try{const _0x12ebb6=await resolveYamlFilePath(_0x53a3fd);return _0x4a0fa9&&(console[_0x2d6aca(0x1d4)]('Resolved\x20YAML\x20file:\x20'+_0x53a3fd),console[_0x2d6aca(0x1d4)]('\x20\x20Parent\x20segment:\x20'+_0x12ebb6[_0x2d6aca(0x135)]),console[_0x2d6aca(0x1d4)](_0x2d6aca(0x13a)+_0x12ebb6[_0x2d6aca(0x1ff)]),console[_0x2d6aca(0x1d4)]('\x20\x20Folder\x20path:\x20'+(_0x12ebb6['folderPath']||_0x2d6aca(0x12f)))),{'journeyName':_0x12ebb6['segmentName'],'parentSegment':_0x12ebb6[_0x2d6aca(0x135)],'resolved':_0x12ebb6};}catch(_0x101595){throw new SDKError(ErrorCode[_0x2d6aca(0x1ab)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x101595['message']);}if(!_0x1c0e10)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2d6aca(0x12a));return{'journeyName':_0x53a3fd,'parentSegment':_0x1c0e10};}export class JourneyListCommand extends BaseCommand{[a27_0x363bd7(0x113)]='journey:list';[a27_0x363bd7(0x139)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x363bd7(0x1f2)](_0x4c6838){const _0x713ee6=a27_0x363bd7,{options:_0x28ea28,args:_0x512621,tdx:_0x2d3513}=_0x4c6838,_0x2862c7=_0x512621[0x0],_0x571ddc=_0x28ea28[_0x713ee6(0x135)];if(!_0x571ddc)return console['error'](_0x713ee6(0x190)),console['error'](_0x713ee6(0x1a0)),0x1;const _0x54206d=await withSpinner(_0x713ee6(0x142),()=>_0x2d3513[_0x713ee6(0x1b6)]['resolveParentId'](_0x571ddc),{'verbose':_0x28ea28[_0x713ee6(0x1b7)]}),_0x5503f0=_0x54206d['data'];_0x28ea28['verbose']&&(console['error'](_0x713ee6(0xdd)+_0x571ddc+_0x713ee6(0x172)+_0x5503f0+')'),_0x2862c7&&console['error']('Pattern:\x20'+_0x2862c7));const _0x4bfd0b=await withSpinner(_0x713ee6(0x1b9),()=>_0x2d3513[_0x713ee6(0x1b6)][_0x713ee6(0x18d)](_0x5503f0),{'verbose':_0x28ea28[_0x713ee6(0x1b7)]}),_0x51846b=_0x4bfd0b['data'],_0x54ce23=_0x51846b['rootFolderId'],_0x26b063=await withSpinner('Listing\x20journeys...',()=>_0x2d3513[_0x713ee6(0x1ba)]['listJourneysWithFolders'](_0x5503f0,_0x54ce23),{'verbose':_0x28ea28[_0x713ee6(0x1b7)]});let _0x3ade1d=_0x26b063[_0x713ee6(0x129)]['journeys'];const _0xe3faf3=_0x26b063[_0x713ee6(0x129)][_0x713ee6(0x1a2)],_0x57cb1f=new Map();for(const _0x4150f4 of _0xe3faf3){_0x57cb1f['set'](_0x4150f4['id'],_0x4150f4[_0x713ee6(0x113)]);}if(_0x2862c7){const _0x4942db=globToRegex(_0x2862c7);_0x3ade1d=_0x3ade1d[_0x713ee6(0x1ea)](_0x35891a=>_0x4942db[_0x713ee6(0x10b)](_0x35891a[_0x713ee6(0xf9)]));}console[_0x713ee6(0x1d4)](_0x713ee6(0x183)+_0x3ade1d[_0x713ee6(0x198)]+_0x713ee6(0xf6)+(_0x3ade1d['length']!==0x1?'s':''));const _0x22a0aa=_0x579172=>{const _0x4ae7f8=_0x713ee6;return getConsoleNextUrl(_0x28ea28[_0x4ae7f8(0x164)],_0x4ae7f8(0x169)+_0x5503f0+_0x4ae7f8(0x18f)+_0x579172+_0x4ae7f8(0x143));};if(_0x28ea28[_0x713ee6(0x149)]===_0x713ee6(0x115))await handleSDKOutput(_0x3ade1d,_0x28ea28);else{if(_0x28ea28[_0x713ee6(0x149)]==='json'){const _0x2be437=_0x3ade1d[_0x713ee6(0x19e)](_0x14d7b6=>({..._0x14d7b6,'url':_0x22a0aa(_0x14d7b6['id'])}));await handleSDKOutput(_0x2be437,_0x28ea28);}else{console['log']('['+_0x571ddc+']');const _0x28fcbf=new Map(),_0x52baf4=[];for(const _0x4b6a8d of _0x3ade1d){if(!_0x4b6a8d[_0x713ee6(0x1bf)]||_0x4b6a8d[_0x713ee6(0x1bf)]===_0x54ce23)_0x52baf4[_0x713ee6(0x14b)](_0x4b6a8d);else{const _0xb0e211=_0x28fcbf['get'](_0x4b6a8d[_0x713ee6(0x1bf)])||[];_0xb0e211[_0x713ee6(0x14b)](_0x4b6a8d),_0x28fcbf[_0x713ee6(0x1e9)](_0x4b6a8d['folderId'],_0xb0e211);}}const _0x20d5ae=(_0x2cf8ed,_0x3e5697)=>_0x2cf8ed['journeyBundleName'][_0x713ee6(0xfc)](_0x3e5697[_0x713ee6(0xf9)],undefined,{'sensitivity':_0x713ee6(0x14e)});_0x52baf4[_0x713ee6(0x1e6)](_0x20d5ae);for(const _0xb14602 of _0x52baf4){console[_0x713ee6(0xf2)](formatJourneyItem(_0xb14602,'',_0x22a0aa(_0xb14602['id'])));}const _0x355a5a=[..._0x28fcbf['entries']()][_0x713ee6(0x1e6)]((_0xf73dc,_0x1a31a4)=>{const _0x356568=_0x713ee6,_0x3e9a5f=_0x57cb1f[_0x356568(0x146)](_0xf73dc[0x0])||_0xf73dc[0x0],_0x2d0c04=_0x57cb1f[_0x356568(0x146)](_0x1a31a4[0x0])||_0x1a31a4[0x0];return _0x3e9a5f['localeCompare'](_0x2d0c04,undefined,{'sensitivity':_0x356568(0x14e)});});for(const [_0x2d46d1,_0x11b648]of _0x355a5a){const _0x42c29f=_0x57cb1f[_0x713ee6(0x146)](_0x2d46d1)||_0x2d46d1;console[_0x713ee6(0xf2)]('📁\x20'+_0x42c29f),_0x11b648[_0x713ee6(0x1e6)](_0x20d5ae);for(const _0x3703b7 of _0x11b648){console['log'](formatJourneyItem(_0x3703b7,'\x20\x20',_0x22a0aa(_0x3703b7['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x363bd7(0x1fe);['description']=a27_0x363bd7(0x120);async[a27_0x363bd7(0x1f2)](_0x573489){const _0x1ad072=a27_0x363bd7,{options:_0x452c67,args:_0x4f80da,tdx:_0x5cb494}=_0x573489,_0x26a17e=_0x4f80da[0x0];if(!_0x26a17e)return console['error'](_0x1ad072(0x1f7)),console[_0x1ad072(0x1d4)](_0x1ad072(0x17e)),console['error'](_0x1ad072(0x1c6)),console['error'](_0x1ad072(0x104)),0x1;_0x452c67[_0x1ad072(0x1b7)]&&console[_0x1ad072(0x1d4)]('Input:\x20'+_0x26a17e);const {journeyId:_0x156b70,parentSegmentId:_0x992be9}=await resolveJourneyIdFromInput(_0x26a17e,_0x452c67,_0x5cb494);if(_0x452c67[_0x1ad072(0x179)]){const _0x4eb998=getConsoleNextUrl(_0x452c67[_0x1ad072(0x164)],_0x1ad072(0x169)+_0x992be9+_0x1ad072(0x18f)+_0x156b70+_0x1ad072(0x1c0));return console[_0x1ad072(0x1d4)](a27_0x241683[_0x1ad072(0xee)]('✔')+'\x20Opening\x20'+a27_0x241683[_0x1ad072(0x111)](_0x4eb998)),openBrowser(_0x4eb998),0x0;}const _0x33c097=await withSpinner(_0x1ad072(0x16c),()=>_0x5cb494[_0x1ad072(0x1ba)]['getJourney'](_0x156b70),{'verbose':_0x452c67[_0x1ad072(0x1b7)]}),_0x1fce61=_0x33c097[_0x1ad072(0x129)],_0x1b9855=_0x452c67['includeStats'];let _0x22169a;if(_0x1b9855)try{const _0x32f1f2=await withSpinner(_0x1ad072(0x171),()=>_0x5cb494[_0x1ad072(0x1ba)][_0x1ad072(0xf1)](_0x156b70),{'verbose':_0x452c67[_0x1ad072(0x1b7)]});_0x22169a=_0x32f1f2[_0x1ad072(0x129)];}catch{_0x452c67['verbose']&&console['error'](_0x1ad072(0x110));}const _0xd8668c=getConsoleNextUrl(_0x452c67[_0x1ad072(0x164)],_0x1ad072(0x169)+_0x992be9+_0x1ad072(0x18f)+_0x156b70+'/j/da/je'),_0x371d42={'id':_0x1fce61['id'],'name':_0x1fce61[_0x1ad072(0x147)][_0x1ad072(0x113)],'description':_0x1fce61['attributes'][_0x1ad072(0x139)],'state':_0x1fce61[_0x1ad072(0x147)]['state'],'paused':_0x1fce61[_0x1ad072(0x147)]['paused'],'reentry_mode':_0x1fce61[_0x1ad072(0x147)][_0x1ad072(0x197)],'stages':_0x1fce61['attributes'][_0x1ad072(0x16d)]?.[_0x1ad072(0x198)]||0x0,..._0x1fce61['attributes'][_0x1ad072(0x1c5)]&&{'goal':_0x1fce61['attributes'][_0x1ad072(0x1c5)][_0x1ad072(0x113)]},..._0x22169a&&{'statistics':{'size':_0x22169a[_0x1ad072(0x126)],'entered':_0x22169a[_0x1ad072(0x1fa)],'goal_achieved':_0x22169a[_0x1ad072(0x1df)],'completion_rate':_0x22169a['completionRate'],'exit_or_jump':_0x22169a[_0x1ad072(0x1c3)],'exit_or_jump_rate':_0x22169a['exitOrJumpRate'],'stages':_0x22169a[_0x1ad072(0x144)]}},'url':_0xd8668c};return await handleSingleObjectOutput(_0x371d42,_0x452c67),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x363bd7(0xf5);[a27_0x363bd7(0x139)]=a27_0x363bd7(0x10c);async[a27_0x363bd7(0x1f2)](_0x2c26f3){const _0x578135=a27_0x363bd7,{options:_0x986316,args:_0x2a4306,tdx:_0x3a1eca}=_0x2c26f3,_0x22d715=_0x2a4306[0x0];if(!requireNameOrPath(_0x22d715))return 0x1;_0x986316[_0x578135(0x1b7)]&&console[_0x578135(0x1d4)](_0x578135(0x1f4)+_0x22d715);const _0x55b85=_0x986316,_0x811e6e=_0x55b85[_0x578135(0x13c)],_0x29b1f6=_0x55b85['to'],_0xf0c888=_0x55b85[_0x578135(0x10d)],_0x2120de=_0x55b85[_0x578135(0x1c4)];_0xf0c888&&!_0x811e6e&&!_0x29b1f6&&console[_0x578135(0x1d4)](_0x578135(0x182));const _0x3959b5=_0xf0c888?withJsonFormat(_0x986316):_0x986316,{journeyId:_0x77a1c7,journeyName:_0x11e822}=await resolveJourneyIdFromInput(_0x22d715,_0x3959b5,_0x3a1eca),_0x58420c=_0x811e6e||_0x29b1f6?{'from':_0x811e6e,'to':_0x29b1f6}:undefined,_0x59aa2e=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x578135(0xdc)]([_0x3a1eca[_0x578135(0x1ba)][_0x578135(0x1c8)](_0x77a1c7),_0x3a1eca[_0x578135(0x1ba)][_0x578135(0xf1)](_0x77a1c7,_0x58420c)]),{'verbose':_0x3959b5[_0x578135(0x1b7)]}),[_0xc61890,_0x44000f]=_0x59aa2e[_0x578135(0x129)];if(!_0x44000f||_0x44000f[_0x578135(0x1c2)]===null)return console[_0x578135(0x1d4)](_0x578135(0xf0)+_0x11e822),console[_0x578135(0x1d4)](_0x578135(0x193)),0x0;const _0x5ee543=buildStageNameMap(_0xc61890),_0x4a32ac=!!(_0x58420c&&_0x44000f[_0x578135(0x1d8)]?.[_0x578135(0x198)]),_0x379835={'stageNameMap':_0x5ee543,'hasPeriod':_0x4a32ac,'includeHistory':!!_0xf0c888};if(_0x2120de&&_0x44000f[_0x578135(0x144)]){const _0x51533=_0x44000f['stages'][_0x578135(0x1bd)](_0x2be13e=>{const _0x105dc2=_0x578135,_0xde0d82=_0x5ee543[_0x105dc2(0x146)](_0x2be13e['id'])??'';return _0xde0d82['toLowerCase']()===_0x2120de[_0x105dc2(0x16e)]();});if(_0x51533)return await handleSingleObjectOutput(formatStageStats(_0x51533,_0x379835),_0x3959b5),0x0;const _0x279bdf=_0x44000f['stages'][_0x578135(0x19e)](_0x3fb302=>_0x5ee543[_0x578135(0x146)](_0x3fb302['id'])??_0x3fb302['id']);return console[_0x578135(0x1d4)](_0x578135(0x14d)+_0x2120de+_0x578135(0x1db)),console['error'](_0x578135(0xfe)+_0x279bdf[_0x578135(0x1b2)](',\x20')),0x1;}const _0x33fd1e=_0x44000f[_0x578135(0x144)]?.[_0x578135(0x19e)](_0x2f1cb2=>formatStageStats(_0x2f1cb2,_0x379835)),_0x5ac0b2=assembleJourneyStats(_0x44000f,{'from':_0x811e6e,'to':_0x29b1f6,'includeHistory':_0xf0c888});return await this['renderStats'](_0x5ac0b2,_0x33fd1e??[],_0x3959b5),0x0;}async[a27_0x363bd7(0x17d)](_0x14b069,_0x4f8016,_0x5c2fe3){const _0x10d9d6=a27_0x363bd7,_0x23379c=_0x5c2fe3['format']===_0x10d9d6(0x1e3)||_0x5c2fe3[_0x10d9d6(0x149)]===_0x10d9d6(0x12c)||_0x5c2fe3['json']||_0x5c2fe3[_0x10d9d6(0x12c)];if(_0x23379c){_0x14b069[_0x10d9d6(0x144)]=_0x4f8016,await handleSingleObjectOutput(_0x14b069,_0x5c2fe3);return;}await handleSingleObjectOutput(_0x14b069,_0x5c2fe3);for(const _0x57fea6 of _0x4f8016){console[_0x10d9d6(0xf2)](''),console[_0x10d9d6(0xf2)](String(a27_0x241683[_0x10d9d6(0x111)][_0x10d9d6(0x127)]('['+_0x57fea6['name']+']'))+a27_0x241683[_0x10d9d6(0x11f)]('\x20'+_0x57fea6['id']));const {id:_0x3d4403,name:_0x3c2b59,..._0x368dd1}=_0x57fea6;await handleSingleObjectOutput(_0x368dd1,_0x5c2fe3);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x363bd7(0x113)]='journey:traffic';[a27_0x363bd7(0x139)]=a27_0x363bd7(0x132);async['execute'](_0x38e930){const _0x2c702a=a27_0x363bd7,{options:_0x5df529,args:_0x47d3ac,tdx:_0x68d842}=_0x38e930,_0x77f335=_0x47d3ac[0x0];if(!requireNameOrPath(_0x77f335))return 0x1;_0x5df529[_0x2c702a(0x1b7)]&&console[_0x2c702a(0x1d4)](_0x2c702a(0x1f4)+_0x77f335);const _0x2e4db4=_0x5df529,_0x4b79e8=_0x2e4db4[_0x2c702a(0x156)],_0x1fc6f7=_0x2e4db4[_0x2c702a(0x13c)],_0xebd471=_0x2e4db4['to'],_0x59f1e8=_0x2e4db4[_0x2c702a(0x161)];if(_0x4b79e8&&_0x4b79e8!=='conversion'&&_0x4b79e8!==_0x2c702a(0x158))return console[_0x2c702a(0x1d4)](_0x2c702a(0x17f)+_0x4b79e8+_0x2c702a(0xe4)),0x1;const _0x52c401=withJsonFormat(_0x5df529),{journeyId:_0x4f6920,journeyName:_0x5eabda}=await resolveJourneyIdFromInput(_0x77f335,_0x52c401,_0x68d842),_0x24f2c2={'type':_0x4b79e8,'from':_0x1fc6f7,'to':_0xebd471,'limit':_0x59f1e8},_0xd896f5=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x68d842['journey'][_0x2c702a(0x108)](_0x4f6920,_0x24f2c2),{'verbose':_0x52c401[_0x2c702a(0x1b7)]}),_0x1a197a=_0xd896f5[_0x2c702a(0x129)],_0x18d7b3=_0x1a197a[_0x2c702a(0x15e)]&&(_0x1a197a['conversion'][_0x2c702a(0x13e)][_0x2c702a(0x198)]>0x0||_0x1a197a[_0x2c702a(0x15e)][_0x2c702a(0xfb)][_0x2c702a(0x198)]>0x0),_0x38bb15=_0x1a197a[_0x2c702a(0x158)]&&_0x1a197a['activation'][_0x2c702a(0x198)]>0x0;if(!_0x18d7b3&&!_0x38bb15)return console[_0x2c702a(0x1d4)](_0x2c702a(0x1ce)+_0x5eabda),console[_0x2c702a(0x1d4)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x1fc6f7&&_0xebd471&&console['error'](_0x2c702a(0x18b)),0x0;return await handleSingleObjectOutput(_0x1a197a,_0x52c401),0x0;}}function formatStageStats(_0x2773f3,_0x252c4b){const _0x283d71=a27_0x363bd7,_0x4f74a5=_0x252c4b[_0x283d71(0x1b1)]&&_0x2773f3[_0x283d71(0x1d8)]?.[_0x283d71(0x198)]?aggregateStageHistory(_0x2773f3['history']):{'size':_0x2773f3['size'],'entered':_0x2773f3['enteredSize'],'milestone':_0x2773f3[_0x283d71(0x1bc)],'milestone_rate':_0x2773f3[_0x283d71(0x11a)],'exit_or_jump':_0x2773f3['exitOrJumpSize'],'exit_or_jump_rate':_0x2773f3[_0x283d71(0x1b8)]},_0xeddd04={'id':_0x2773f3['id'],'name':_0x252c4b[_0x283d71(0xd8)][_0x283d71(0x146)](_0x2773f3['id'])??_0x2773f3['id'],..._0x4f74a5};return _0x252c4b[_0x283d71(0x1b1)]&&_0x252c4b[_0x283d71(0x10d)]&&_0x2773f3['history']&&(_0xeddd04[_0x283d71(0x1d8)]=_0x2773f3[_0x283d71(0x1d8)]),_0xeddd04;}export class JourneyPauseCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x13f);[a27_0x363bd7(0x139)]=a27_0x363bd7(0x159);async[a27_0x363bd7(0x1f2)](_0x1111ec){const _0x1889a7=a27_0x363bd7,{options:_0x2a9d31,args:_0x470b24,tdx:_0x2746ae}=_0x1111ec,_0x23590b=_0x470b24[0x0];if(!requireNameOrPath(_0x23590b))return 0x1;_0x2a9d31[_0x1889a7(0x1b7)]&&console['error'](_0x1889a7(0x1f4)+_0x23590b);const {journeyId:_0x238724,journeyName:_0x5deefe}=await resolveJourneyIdFromInput(_0x23590b,_0x2a9d31,_0x2746ae);if(!_0x2a9d31[_0x1889a7(0xfa)]){const _0x3208e5=await confirm(_0x1889a7(0x14c)+_0x5deefe+'\x22?');if(!_0x3208e5)return console['error'](_0x1889a7(0x10f)),0x0;}const _0x2ebaec=await withSpinner(_0x1889a7(0x1de),()=>_0x2746ae['journey'][_0x1889a7(0x1aa)](_0x238724),{'verbose':_0x2a9d31[_0x1889a7(0x1b7)]}),_0x58b961=_0x2ebaec['data'];return console[_0x1889a7(0x1d4)](_0x1889a7(0x103)+_0x58b961['attributes'][_0x1889a7(0x113)]+'\x22\x20paused'),0x0;}}export class JourneyRunCommand extends BaseCommand{['name']='journey:run';['description']='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a27_0x363bd7(0x1f2)](_0x940919){const _0x4868e8=a27_0x363bd7,{options:_0x46c7cd,args:_0x20feac,tdx:_0xd7d0af}=_0x940919,_0x590e48=_0x20feac[0x0];if(!requireNameOrPath(_0x590e48))return 0x1;_0x46c7cd['verbose']&&console['error']('Input:\x20'+_0x590e48);const {journeyId:_0x1e1081,journeyName:_0x538fb2}=await resolveJourneyIdFromInput(_0x590e48,_0x46c7cd,_0xd7d0af);if(_0x46c7cd[_0x4868e8(0x1ac)])return await this['executeDryRun'](_0x940919,_0x1e1081,_0x538fb2);if(!_0x46c7cd[_0x4868e8(0xfa)]){const _0x2c0f35=await confirm(_0x4868e8(0x13d)+_0x538fb2+'\x22?');if(!_0x2c0f35)return console[_0x4868e8(0x1d4)](_0x4868e8(0x10f)),0x0;}const _0x4ab574=await withSpinner(_0x4868e8(0xeb),()=>_0xd7d0af['journey'][_0x4868e8(0x199)](_0x1e1081),{'verbose':_0x46c7cd[_0x4868e8(0x1b7)]}),_0x4618a7=_0x4ab574[_0x4868e8(0x129)],_0x3cfd04=getWorkflowSessionUrl(_0x46c7cd[_0x4868e8(0x164)],_0x4618a7[_0x4868e8(0x162)],_0x4618a7['workflowSessionId']);return console[_0x4868e8(0x1d4)]('\x0a'+a27_0x241683[_0x4868e8(0xee)]('✔')+_0x4868e8(0xd9)),console['error']('\x20\x20'+a27_0x241683[_0x4868e8(0x11f)](_0x4868e8(0x1f1))+'\x20'+_0x538fb2),console[_0x4868e8(0x1d4)]('\x20\x20'+a27_0x241683['dim'](_0x4868e8(0x181))+'\x20'+_0x4618a7[_0x4868e8(0x10a)]),console['error']('\x20\x20'+a27_0x241683[_0x4868e8(0x11f)](_0x4868e8(0x1a3))+'\x20'+_0x4618a7[_0x4868e8(0x11c)]),console['error']('\x20\x20'+_0x3cfd04),0x0;}async[a27_0x363bd7(0x206)](_0x54a00c,_0x18715c,_0x4121a3){const _0x5cebf9=a27_0x363bd7,{options:_0x285679,tdx:_0x245562}=_0x54a00c,_0x29c59d=await withSpinner('Fetching\x20journey\x20'+_0x4121a3+_0x5cebf9(0x1b0),()=>Promise[_0x5cebf9(0xdc)]([_0x245562[_0x5cebf9(0x1ba)][_0x5cebf9(0x1c8)](_0x18715c),_0x245562[_0x5cebf9(0x1ba)]['listActivationsFlat'](_0x18715c)]),{'verbose':_0x285679[_0x5cebf9(0x1b7)]}),[_0x4be95a,_0x463e09]=_0x29c59d[_0x5cebf9(0x129)],_0x2a64de=_0x4be95a[_0x5cebf9(0x147)],_0x1fe0e6=_0x2a64de[_0x5cebf9(0x16d)];console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x1f1)),_0x2a64de[_0x5cebf9(0x113)]),console['log'](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x1dd)),_0x4be95a['id']),console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)]('State:'),_0x2a64de['state']),console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x137)),_0x2a64de[_0x5cebf9(0x1ec)]?a27_0x241683[_0x5cebf9(0x14a)]('yes'):a27_0x241683[_0x5cebf9(0xee)]('no')),console['log'](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x117)),_0x2a64de[_0x5cebf9(0x11d)]);const _0x312790=_0x1fe0e6[_0x5cebf9(0x198)]>0x0?'\x20('+_0x1fe0e6[_0x5cebf9(0x19e)](_0x173146=>_0x173146['name'])[_0x5cebf9(0x1b2)](',\x20')+')':'';console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)](_0x5cebf9(0x130)),''+_0x1fe0e6['length']+_0x312790),console[_0x5cebf9(0xf2)]('');if(_0x463e09['length']===0x0)console[_0x5cebf9(0xf2)](a27_0x241683[_0x5cebf9(0x127)]('Activations:'),a27_0x241683[_0x5cebf9(0x11f)](_0x5cebf9(0x157)));else{console[_0x5cebf9(0xf2)](a27_0x241683['bold']('Activations:'));for(const _0x26b008 of _0x463e09){const _0x460719=_0x26b008[_0x5cebf9(0x113)]??'(unnamed)',_0x38eb2b=_0x26b008[_0x5cebf9(0x1d1)]!=null?'connection\x20'+_0x26b008[_0x5cebf9(0x1d1)]:_0x5cebf9(0xe7),_0x2e39ba=_0x26b008[_0x5cebf9(0x112)]?''+_0x26b008['scheduleType']+(_0x26b008[_0x5cebf9(0x201)]?'\x20@\x20'+_0x26b008[_0x5cebf9(0x201)]:''):_0x5cebf9(0x1e4),_0x5c6b0a=_0x26b008[_0x5cebf9(0x176)]?_0x5cebf9(0x1c1):'';console[_0x5cebf9(0xf2)]('\x20\x20'+a27_0x241683[_0x5cebf9(0x14a)](_0x5cebf9(0x1da))+'\x20'+_0x460719+_0x5cebf9(0x102)+_0x38eb2b+',\x20schedule:\x20'+_0x2e39ba+_0x5c6b0a);}}return console['log'](a27_0x241683['yellow']('\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.')),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x1f0);['description']=a27_0x363bd7(0x174);async['execute'](_0x2af228){const _0x460c09=a27_0x363bd7,{options:_0x36d0a3,args:_0x115fe5,tdx:_0x22fd24}=_0x2af228,_0x580c32=_0x115fe5[0x0];if(!requireNameOrPath(_0x580c32))return 0x1;_0x36d0a3[_0x460c09(0x1b7)]&&console[_0x460c09(0x1d4)](_0x460c09(0x1f4)+_0x580c32);const {journeyId:_0x55b989,journeyName:_0x5969d4}=await resolveJourneyIdFromInput(_0x580c32,_0x36d0a3,_0x22fd24);if(_0x36d0a3[_0x460c09(0x1ac)])return await this[_0x460c09(0x206)](_0x2af228,_0x55b989,_0x5969d4);if(!_0x36d0a3[_0x460c09(0xfa)]){const _0x3044b0=await confirm(_0x460c09(0x178)+_0x5969d4+'\x22?');if(!_0x3044b0)return console['error']('Cancelled'),0x0;}const _0x782d73=await withSpinner('Resuming\x20journey...',()=>_0x22fd24[_0x460c09(0x1ba)][_0x460c09(0x18e)](_0x55b989),{'verbose':_0x36d0a3[_0x460c09(0x1b7)]}),_0x4ad79e=_0x782d73[_0x460c09(0x129)];return console[_0x460c09(0x1d4)](_0x460c09(0x103)+_0x4ad79e['attributes'][_0x460c09(0x113)]+_0x460c09(0x140)),0x0;}async[a27_0x363bd7(0x206)](_0x261691,_0x26bb4e,_0x1789ab){const _0x5bbd69=a27_0x363bd7,{options:_0x271787,tdx:_0x3243c5}=_0x261691,_0x1b7a1f=await withSpinner(_0x5bbd69(0x107)+_0x1789ab+_0x5bbd69(0x1b0),()=>Promise[_0x5bbd69(0xdc)]([_0x3243c5['journey'][_0x5bbd69(0x1c8)](_0x26bb4e),_0x3243c5[_0x5bbd69(0x1ba)]['listActivationsFlat'](_0x26bb4e)]),{'verbose':_0x271787[_0x5bbd69(0x1b7)]}),[_0x41d263,_0x5637c7]=_0x1b7a1f[_0x5bbd69(0x129)],_0x41cc78=_0x41d263[_0x5bbd69(0x147)],_0x541594=_0x41cc78[_0x5bbd69(0x16d)];console['log'](a27_0x241683[_0x5bbd69(0x127)](_0x5bbd69(0x1f1)),_0x41cc78[_0x5bbd69(0x113)]),console[_0x5bbd69(0xf2)](a27_0x241683['bold'](_0x5bbd69(0x1dd)),_0x41d263['id']),console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x127)](_0x5bbd69(0x1a7)),_0x41cc78[_0x5bbd69(0x1d2)]),console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x127)]('Paused:'),_0x41cc78[_0x5bbd69(0x1ec)]?a27_0x241683['yellow']('yes'):a27_0x241683[_0x5bbd69(0xee)]('no'));_0x41cc78[_0x5bbd69(0x1fc)]&&console['log'](a27_0x241683[_0x5bbd69(0x127)]('Paused\x20at:'),_0x41cc78[_0x5bbd69(0x1fc)]);console['log'](a27_0x241683['bold']('Parent\x20segment\x20ID:'),_0x41cc78[_0x5bbd69(0x11d)]);const _0x2ad71b=_0x541594[_0x5bbd69(0x198)]>0x0?'\x20('+_0x541594[_0x5bbd69(0x19e)](_0x48952f=>_0x48952f[_0x5bbd69(0x113)])[_0x5bbd69(0x1b2)](',\x20')+')':'';console[_0x5bbd69(0xf2)](a27_0x241683['bold']('Stages:'),''+_0x541594['length']+_0x2ad71b),console['log']('');if(_0x5637c7[_0x5bbd69(0x198)]===0x0)console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x127)](_0x5bbd69(0x1a9)),a27_0x241683[_0x5bbd69(0x11f)](_0x5bbd69(0x157)));else{console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x127)]('Activations:'));for(const _0x15b1ce of _0x5637c7){const _0x3e471f=_0x15b1ce[_0x5bbd69(0x113)]??_0x5bbd69(0x175),_0x58326c=_0x15b1ce[_0x5bbd69(0x1d1)]!=null?_0x5bbd69(0x204)+_0x15b1ce[_0x5bbd69(0x1d1)]:_0x5bbd69(0xe7),_0x5bc830=_0x15b1ce[_0x5bbd69(0x112)]?''+_0x15b1ce[_0x5bbd69(0x112)]+(_0x15b1ce[_0x5bbd69(0x201)]?_0x5bbd69(0x185)+_0x15b1ce['runAt']:''):_0x5bbd69(0x1e4),_0x55da6b=_0x15b1ce[_0x5bbd69(0x176)]?_0x5bbd69(0x1c1):'';console['log']('\x20\x20'+a27_0x241683[_0x5bbd69(0x14a)](_0x5bbd69(0x1da))+'\x20'+_0x3e471f+_0x5bbd69(0x102)+_0x58326c+',\x20schedule:\x20'+_0x5bc830+_0x55da6b);}}return console[_0x5bbd69(0xf2)](a27_0x241683[_0x5bbd69(0x14a)](_0x5bbd69(0x173))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x1e5);[a27_0x363bd7(0x139)]=a27_0x363bd7(0x1a4);async[a27_0x363bd7(0x1f2)](_0x457274){const _0x322175=a27_0x363bd7,{options:_0x49f163,args:_0x49c975,tdx:_0x1f7832}=_0x457274,_0x17d6eb=_0x49f163,_0x188963=_0x49c975[0x0],_0x31b6e2=_0x188963&&isYamlFilePath(_0x188963),_0x2ad234=await resolveTarget({'arg':_0x31b6e2?_0x188963:undefined,'contextParent':_0x49f163[_0x322175(0x135)],'cwd':process[_0x322175(0x19b)]()});if(!isSuccessfulResolution(_0x2ad234))return _0x2ad234[_0x322175(0x1ca)]===_0x322175(0x196)?(console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x14a)](_0x322175(0xdf))),console[_0x322175(0x1d4)](_0x322175(0x100)),console[_0x322175(0x1d4)](_0x322175(0x133)),console['error'](_0x322175(0x209)),console[_0x322175(0x1d4)](_0x322175(0x1dc))):(console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x168)](_0x322175(0x195)+_0x2ad234[_0x322175(0x188)]+'\x0a')),_0x2ad234[_0x322175(0x131)]&&console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x111)](_0x2ad234[_0x322175(0x131)]))),0x1;let _0x90cb83=_0x31b6e2?undefined:_0x188963,_0x474f8b,_0x4128dc;_0x2ad234[_0x322175(0x156)]===_0x322175(0x17b)&&(_0x90cb83=_0x2ad234[_0x322175(0x1cd)],_0x474f8b=_0x2ad234['filePath'],_0x4128dc=_0x2ad234[_0x322175(0x116)]);const _0x3cd28c=_0x2ad234[_0x322175(0xe9)],_0x3c50fe=_0x2ad234[_0x322175(0x10e)];_0x17d6eb['verbose']&&(console['error'](_0x322175(0xdd)+_0x3cd28c),console[_0x322175(0x1d4)](_0x322175(0x1e0)+_0x3c50fe),_0x90cb83&&console['error'](_0x322175(0xda)+_0x90cb83),_0x474f8b&&console[_0x322175(0x1d4)](_0x322175(0x16f)+_0x474f8b),_0x4128dc&&console[_0x322175(0x1d4)](_0x322175(0x1cc)+_0x4128dc));const _0x31474b=await withSpinner(_0x322175(0x142),()=>_0x1f7832[_0x322175(0x1b6)][_0x322175(0xf7)](_0x3cd28c),{'verbose':_0x49f163['verbose']}),_0x1ed0a0=_0x31474b[_0x322175(0x129)],{journeys:_0x1bbadd,folders:_0x873088}=await withSpinner(_0x322175(0x1fd),async()=>{const _0x18a154=_0x322175,[_0x54dd31,_0x3be966]=await Promise[_0x18a154(0xdc)]([_0x1f7832['journey'][_0x18a154(0x125)](_0x1ed0a0,undefined,{'includeAllVersions':!![]}),_0x1f7832[_0x18a154(0x1b6)][_0x18a154(0x186)](_0x1ed0a0)]);return{'journeys':_0x54dd31,'folders':_0x3be966};},{'verbose':_0x49f163[_0x322175(0x1b7)]})[_0x322175(0x138)](_0x199b04=>_0x199b04['data']);let _0x3f7dd1=_0x1bbadd;const _0x34f0de=buildFolderIdToPathMap(_0x873088);if(_0x90cb83){const _0x58de86=_0x3f7dd1[_0x322175(0x1ea)](_0xc02672=>_0xc02672[_0x322175(0xf9)][_0x322175(0x16e)]()===_0x90cb83['toLowerCase']());if(_0x58de86[_0x322175(0x198)]===0x0)return console[_0x322175(0x1d4)](_0x322175(0xe0)+_0x90cb83),console[_0x322175(0x1d4)](_0x322175(0x109)),0x1;_0x3f7dd1=_0x58de86;}if(_0x4128dc!==undefined){const _0x47df85=_0x3f7dd1[_0x322175(0x1ea)](_0x351003=>{const _0x1569e3=_0x322175,_0x495fce=_0x351003['folderId']?_0x34f0de[_0x1569e3(0x146)](_0x351003['folderId'])||'':'';return _0x495fce===_0x4128dc;});if(_0x47df85[_0x322175(0x198)]===0x0&&_0x3f7dd1[_0x322175(0x198)]>0x0){console['error'](_0x322175(0x1eb)+_0x90cb83+_0x322175(0x1cf)+(_0x4128dc||_0x322175(0x189))),console['error'](_0x322175(0x121));for(const _0xcc15c of _0x3f7dd1){const _0x22e890=_0xcc15c['folderId']?_0x34f0de['get'](_0xcc15c[_0x322175(0x1bf)])||'':'';console[_0x322175(0x1d4)]('\x20\x20-\x20'+(_0x22e890||_0x322175(0x12f))+'/'+_0xcc15c[_0x322175(0xf9)]);}return 0x1;}_0x3f7dd1=_0x47df85;}if(_0x3f7dd1[_0x322175(0x198)]===0x0)return console[_0x322175(0x1d4)]('No\x20journeys\x20found'),0x0;const _0x322123=new Map();for(const _0x37f085 of _0x3f7dd1){const _0x365b98=_0x37f085[_0x322175(0x11e)];!_0x322123[_0x322175(0xff)](_0x365b98)&&_0x322123['set'](_0x365b98,[]),_0x322123[_0x322175(0x146)](_0x365b98)[_0x322175(0x14b)](_0x37f085);}for(const _0x375ca8 of _0x322123[_0x322175(0x19d)]()){_0x375ca8['sort']((_0x407d14,_0x1f2a84)=>(_0x407d14[_0x322175(0x1cb)]||0x0)-(_0x1f2a84[_0x322175(0x1cb)]||0x0));}const _0x141120=[],{idToEmailMap:_0x3649a4,connectionIdToNameMap:_0x92da22}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x5abfd2=_0x322175,[_0x329bee,_0xdac6a7]=await Promise[_0x5abfd2(0xdc)]([_0x1f7832[_0x5abfd2(0x12e)][_0x5abfd2(0xd3)](),_0x1f7832[_0x5abfd2(0x15b)][_0x5abfd2(0x15f)]()]);return{'idToEmailMap':_0x329bee,'connectionIdToNameMap':_0xdac6a7};},{'verbose':_0x49f163['verbose']})[_0x322175(0x138)](_0x2fb53e=>_0x2fb53e[_0x322175(0x129)]);for(const _0x3e8b8c of _0x322123[_0x322175(0x19d)]()){const _0x2a65ff=_0x3e8b8c[0x0]['journeyBundleName'],_0x23344d=_0x3e8b8c[0x0][_0x322175(0x1bf)],_0x1d4547=_0x23344d?_0x34f0de['get'](_0x23344d)||'':'',_0x4bf7a4=_0x1d4547?a27_0x5d2d5b[_0x322175(0x1b2)](_0x3c50fe,_0x1d4547):_0x3c50fe,_0x3f86f0=_0x474f8b||a27_0x5d2d5b['join'](_0x4bf7a4,sanitizeFileName(_0x2a65ff)+_0x322175(0x141));let _0x3c1e76,_0x2d77fd;if(existsSync(_0x3f86f0))try{const _0x58049d=readFileSync(_0x3f86f0,_0x322175(0x1ef)),_0x547eb6=parseYamlString(_0x58049d);_0x2d77fd=_0x547eb6,_0x3c1e76=buildRuleToNameMapping(_0x547eb6),_0x17d6eb[_0x322175(0x1b7)]&&_0x3c1e76[_0x322175(0x126)]>0x0&&console['error'](_0x322175(0x118)+_0x3c1e76[_0x322175(0x126)]+_0x322175(0x1f6)+_0x2a65ff);}catch(_0x42510f){_0x17d6eb[_0x322175(0x1b7)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x42510f[_0x322175(0x188)]);}const _0x1cfcf4=[],_0x3c2966=new Set(),_0x1350f5=new Map(),_0xcd576b=new Map(),_0x5744f1=new Set(),_0x35dcd2=new Map(),_0x30281c=new Map(),_0x4a70ea=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x2a65ff+_0x322175(0x1b0),async _0x90c8e0=>{const _0x107fc8=_0x322175;for(const _0x2105fc of _0x3e8b8c){const _0x466014=_0x3e8b8c[_0x107fc8(0x198)]>0x1?_0x2105fc[_0x107fc8(0xf9)]+'\x20v'+(_0x2105fc[_0x107fc8(0x1cb)]||0x1):_0x2105fc[_0x107fc8(0xf9)];_0x90c8e0[_0x107fc8(0x170)](_0x107fc8(0x106)+_0x466014);const _0xd2073e=await _0x1f7832['journey']['getJourney'](_0x2105fc['id']),_0x2e2da8=_0xd2073e['attributes']?.['audienceId'],_0x12ff3c={'resolveSegment':async _0x314f37=>{const _0x163e10=_0x107fc8;if(!_0x2e2da8)return{'name':_0x314f37,'isJourneyLocal':![]};const _0x4aeb6a=_0x1350f5[_0x163e10(0x146)](_0x314f37);if(_0x4aeb6a)return _0x4aeb6a;try{const _0x16bdd2=await _0x1f7832['segment'][_0x163e10(0x208)](_0x2e2da8,_0x314f37),_0x1ad769=_0x16bdd2[_0x163e10(0x17a)]===SEGMENT_KIND_JOURNEY;let _0x450780,_0x2646b8=_0x16bdd2[_0x163e10(0x113)];if(_0x1ad769&&_0x16bdd2[_0x163e10(0x134)]){const _0x6ab857=await segmentResponseToDef(_0x16bdd2,{'resolveSegmentName':async _0x3f45fc=>{const _0x169abe=_0x163e10,_0x2837d3=_0x1350f5['get'](_0x3f45fc);if(_0x2837d3)return _0x2837d3[_0x169abe(0x113)];const _0x57639d=await _0x12ff3c[_0x169abe(0x151)](_0x3f45fc);return _0x57639d[_0x169abe(0x113)];}}),_0x271884=_0x6ab857[_0x163e10(0x134)];_0x450780={'description':_0x16bdd2['description'],'rule':_0x271884};const _0x4ed286=serializeRule(_0x271884),_0x5d70c7=_0xcd576b[_0x163e10(0x146)](_0x4ed286);if(_0x5d70c7)_0x2646b8=_0x5d70c7,_0x450780=undefined,_0x17d6eb[_0x163e10(0x1b7)]&&console[_0x163e10(0x1d4)](_0x163e10(0xd6)+_0x16bdd2[_0x163e10(0x113)]+_0x163e10(0x207)+_0x5d70c7);else{let _0x125bfb=![];if(_0x3c1e76){const _0x25c978=_0x3c1e76[_0x163e10(0x146)](_0x4ed286);if(_0x25c978){const _0x816e09=_0x25c978['find'](_0x10e186=>!_0x3c2966[_0x163e10(0xff)](_0x10e186));_0x816e09&&(_0x2646b8=_0x816e09,_0x3c2966[_0x163e10(0xf8)](_0x816e09),_0xcd576b['set'](_0x4ed286,_0x816e09),_0x125bfb=!![],_0x17d6eb[_0x163e10(0x1b7)]&&console[_0x163e10(0x1d4)](_0x163e10(0x145)+_0x816e09+_0x163e10(0x1e7)));}}if(!_0x125bfb){const _0x2ebcd5=generateJourneyLocalName(_0x16bdd2[_0x163e10(0x113)]);_0x2ebcd5&&(_0x2646b8=_0x2ebcd5);let _0x15d686=_0x2646b8,_0x2f58ab=0x2;while(_0x3c2966[_0x163e10(0xff)](_0x15d686)){_0x15d686=_0x2646b8+'_'+_0x2f58ab,_0x2f58ab++;}_0x3c2966['add'](_0x15d686),_0xcd576b['set'](_0x4ed286,_0x15d686),_0x2646b8=_0x15d686;}}}const _0x28b69a={'name':_0x2646b8,'isJourneyLocal':_0x1ad769,'definition':_0x450780};return _0x1350f5[_0x163e10(0x1e9)](_0x314f37,_0x28b69a),_0x28b69a;}catch(_0x1f289e){return _0x49f163[_0x163e10(0x1b7)]&&console[_0x163e10(0x1d4)](_0x163e10(0x191)+_0x314f37+':\x20'+_0x1f289e[_0x163e10(0x188)]),{'name':_0x314f37,'isJourneyLocal':![]};}},'resolveActivation':async _0x369726=>{const _0x1b4abe=_0x107fc8,_0x34fee0=_0x35dcd2[_0x1b4abe(0x146)](_0x369726);if(_0x34fee0)return _0x34fee0;try{const _0x3c05de=await _0x1f7832['journey'][_0x1b4abe(0xed)](_0x2105fc['id'],_0x369726),_0x1dc06c=journeyActivationStepToYaml(_0x3c05de,_0x3649a4,_0x92da22),_0x22e10c=JSON['stringify']({'name':_0x1dc06c[_0x1b4abe(0x113)],'connection':_0x1dc06c[_0x1b4abe(0x15b)],'connector_config':_0x1dc06c[_0x1b4abe(0x123)]}),_0x231681=_0x30281c[_0x1b4abe(0x146)](_0x22e10c);if(_0x231681){const _0x5d2f57={'name':_0x231681,'isJourneyLocal':!![],'definition':_0x1dc06c};return _0x35dcd2['set'](_0x369726,_0x5d2f57),_0x5d2f57;}const _0x161841=_0x3c05de[_0x1b4abe(0x147)][_0x1b4abe(0xde)][_0x1b4abe(0x113)]||_0x369726,_0x11cda9=sanitizeYamlKey(_0x161841)||_0x1b4abe(0x1af)+_0x369726;let _0x5ed27f=_0x11cda9,_0x300f91=0x2;while(_0x5744f1[_0x1b4abe(0xff)](_0x5ed27f)){_0x5ed27f=_0x11cda9+'_'+_0x300f91,_0x300f91++;}_0x5744f1[_0x1b4abe(0xf8)](_0x5ed27f),_0x30281c['set'](_0x22e10c,_0x5ed27f);const _0x384b74={'name':_0x5ed27f,'isJourneyLocal':!![],'definition':_0x1dc06c};return _0x35dcd2['set'](_0x369726,_0x384b74),_0x384b74;}catch(_0xe66e41){return _0x49f163[_0x1b4abe(0x1b7)]&&console[_0x1b4abe(0x1d4)](_0x1b4abe(0x1ee)+_0x369726+':\x20'+_0xe66e41[_0x1b4abe(0x188)]),{'name':_0x369726,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x574eb5,_0x2fe2fa)=>{const _0x153438=_0x107fc8;return resolveJumpTarget(_0x574eb5,_0x2fe2fa,_0x4a70ea,_0x2218a3=>_0x1f7832[_0x153438(0x1ba)][_0x153438(0x1c8)](_0x2218a3));}},_0x172f6f=await journeyResponseToDef(_0xd2073e,_0x12ff3c);_0x1cfcf4[_0x107fc8(0x14b)]({'item':_0x2105fc,'yaml':_0x172f6f});}},{'verbose':_0x49f163['verbose']});const _0x12efc1=await _0x1f7832[_0x322175(0x1ba)][_0x322175(0x15d)](_0x3e8b8c[0x0]['journeyBundleId']),_0x1817b2=buildMergedJourneyDef(_0x1cfcf4,_0x3c1e76,_0x12efc1),_0x1deaa3=normalizeJourneyDef(_0x1817b2,_0x2d77fd),_0x4cd053=toYamlString(_0x1deaa3),_0x569363=_0x474f8b||a27_0x5d2d5b['join'](_0x4bf7a4,sanitizeFileName(_0x2a65ff)+_0x322175(0x141));!_0x474f8b&&_0x1d4547&&!existsSync(_0x4bf7a4)&&mkdirSync(_0x4bf7a4,{'recursive':!![]});const _0x152308=a27_0x5d2d5b[_0x322175(0x154)](process[_0x322175(0x19b)](),_0x569363);if(existsSync(_0x569363)){const _0x1c4cc9=readFileSync(_0x569363,_0x322175(0x1ef)),_0xf4b3b7=generateDiff(_0x1c4cc9,_0x4cd053),_0x1e5a0f=hasChanges(_0xf4b3b7);_0x141120[_0x322175(0x14b)]({'relativePath':_0x152308,'absolutePath':_0x569363,'content':_0x4cd053,'isNew':![],'hasChanges':_0x1e5a0f,'diff':_0x1e5a0f?formatDiffWithColors(_0xf4b3b7):undefined});}else _0x141120[_0x322175(0x14b)]({'relativePath':_0x152308,'absolutePath':_0x569363,'content':_0x4cd053,'isNew':!![],'hasChanges':![]});}const _0x5a3c26=_0x141120[_0x322175(0x1ea)](_0xd2095e=>_0xd2095e[_0x322175(0xe2)]),_0x333634=_0x141120['filter'](_0x4e7a3c=>!_0x4e7a3c['isNew']&&_0x4e7a3c[_0x322175(0x1a5)]),_0x38a517=_0x141120[_0x322175(0x1ea)](_0xdc88e=>!_0xdc88e[_0x322175(0xe2)]&&!_0xdc88e['hasChanges']),_0x13d34b=_0x3f7dd1['length'],_0x36764b=_0x322123[_0x322175(0x126)],_0x151b6c=_0x13d34b>_0x36764b?'\x20('+_0x13d34b+_0x322175(0x1ad):'';console['error'](_0x322175(0x15a)),console['error']('\x20\x20'+a27_0x241683[_0x322175(0x111)](_0x36764b+_0x322175(0x1d3))+a27_0x241683['dim'](_0x151b6c)),console[_0x322175(0x1d4)]('\x20\x20'+a27_0x241683[_0x322175(0xee)]('+\x20'+_0x5a3c26[_0x322175(0x198)]+_0x322175(0x153))),console[_0x322175(0x1d4)]('\x20\x20'+a27_0x241683[_0x322175(0x14a)]('~\x20'+_0x333634['length']+_0x322175(0xe5))),console[_0x322175(0x1d4)]('\x20\x20'+a27_0x241683[_0x322175(0x11f)]('=\x20'+_0x38a517[_0x322175(0x198)]+'\x20unchanged\x20files')),console['error'](_0x322175(0x152)+a27_0x241683['cyan'](_0x3c50fe)+'\x0a');if(_0x333634[_0x322175(0x198)]>0x0)for(const _0x389a05 of _0x333634){console[_0x322175(0x1d4)](_0x322175(0x167)+_0x389a05['relativePath']+'\x27:'),console[_0x322175(0x1d4)]('─'[_0x322175(0x1b4)](0x3c)),console['error'](_0x389a05[_0x322175(0x1f5)]),console['error']('─'[_0x322175(0x1b4)](0x3c));}if(_0x17d6eb['dryRun'])return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x14a)](_0x322175(0xec))),0x0;if(_0x5a3c26[_0x322175(0x198)]===0x0&&_0x333634[_0x322175(0x198)]===0x0)return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0xee)](_0x322175(0x177))),saveSessionContext({'parent_segment':_0x3cd28c},_0x17d6eb[_0x322175(0x184)]),console[_0x322175(0x1d4)](a27_0x241683['green']('✔\x20Context\x20set:\x20'+a27_0x241683[_0x322175(0x11f)](_0x322175(0x14f))+_0x322175(0x205)+a27_0x241683[_0x322175(0x111)](_0x3cd28c))),0x0;if(!_0x17d6eb[_0x322175(0xfa)]&&(_0x5a3c26[_0x322175(0x198)]>0x0||_0x333634[_0x322175(0x198)]>0x0)){if(!isInteractive())return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x168)](_0x322175(0xf4)),_0x322175(0x15c)),console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x11f)](_0x322175(0x194))),0x1;const _0x286aaf=await confirmKey(_0x322175(0x165)+(_0x5a3c26[_0x322175(0x198)]+_0x333634[_0x322175(0x198)])+_0x322175(0x19c));if(!_0x286aaf)return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0x14a)]('Aborted.'),_0x322175(0x11b)),0x1;}!existsSync(_0x3c50fe)&&mkdirSync(_0x3c50fe,{'recursive':!![]});const _0x1e5985=a27_0x5d2d5b[_0x322175(0x1b2)](_0x3c50fe,_0x322175(0x1fb));writeFileSync(_0x1e5985,createTdxConfigContent(_0x3cd28c),_0x322175(0x1ef));for(const _0x10ab4a of _0x141120){(_0x10ab4a[_0x322175(0xe2)]||_0x10ab4a['hasChanges'])&&writeFileSync(_0x10ab4a['absolutePath'],_0x10ab4a[_0x322175(0x124)],_0x322175(0x1ef));}return console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0xee)](_0x322175(0x18a)+(_0x5a3c26[_0x322175(0x198)]+_0x333634[_0x322175(0x198)])+_0x322175(0x1d0)+_0x3c50fe)),saveSessionContext({'parent_segment':_0x3cd28c},_0x17d6eb[_0x322175(0x184)]),console[_0x322175(0x1d4)](a27_0x241683[_0x322175(0xee)](_0x322175(0x192)+a27_0x241683[_0x322175(0x11f)](_0x322175(0x14f))+_0x322175(0x205)+a27_0x241683['cyan'](_0x3cd28c))),0x0;}}function a27_0x2667(_0x31bf25,_0x3dd466){_0x31bf25=_0x31bf25-0xd3;const _0x43f2e2=a27_0x43f2();let _0x2667a2=_0x43f2e2[_0x31bf25];return _0x2667a2;}export class JourneyColumnsCommand extends BaseCommand{[a27_0x363bd7(0x113)]='journey:columns';[a27_0x363bd7(0x139)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x363bd7(0x1f2)](_0x5a144c){const _0x2a9f99=a27_0x363bd7,{options:_0x3010ab,args:_0xe0e550,tdx:_0x3c2e7b}=_0x5a144c,_0x5724a0=_0xe0e550[0x0];if(!requireNameOrPath(_0x5724a0))return 0x1;_0x3010ab[_0x2a9f99(0x1b7)]&&console[_0x2a9f99(0x1d4)](_0x2a9f99(0x1f4)+_0x5724a0);const {journeyId:_0x47b995}=await resolveJourneyIdFromInput(_0x5724a0,_0x3010ab,_0x3c2e7b),_0x3f1588=await withSpinner(_0x2a9f99(0x1a6),()=>_0x3c2e7b[_0x2a9f99(0x1ba)][_0x2a9f99(0x1f3)](_0x47b995),{'verbose':_0x3010ab['verbose']}),_0xc58d9e=_0x3f1588[_0x2a9f99(0x129)];return console['log'](_0x2a9f99(0x1b3)+_0xc58d9e[_0x2a9f99(0x1d6)]),console[_0x2a9f99(0xf2)](_0x2a9f99(0x128)+_0xc58d9e['table']),await handleSDKOutput(_0xc58d9e[_0x2a9f99(0x1f9)],_0x3010ab),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x180);['description']=a27_0x363bd7(0x150);async[a27_0x363bd7(0x1f2)](_0x52f967){const _0x1cee43=a27_0x363bd7,{options:_0x55f265,args:_0x2001dc,tdx:_0x47493b}=_0x52f967,_0x5d0410=_0x2001dc[0x0];if(!requireNameOrPath(_0x5d0410))return 0x1;_0x55f265[_0x1cee43(0x1b7)]&&console[_0x1cee43(0x1d4)]('Input:\x20'+_0x5d0410);const {journeyId:_0x3aeac1}=await resolveJourneyIdFromInput(_0x5d0410,_0x55f265,_0x47493b),_0x4abad9=await withSpinner(_0x1cee43(0xd4),()=>_0x47493b['journey'][_0x1cee43(0xe8)](_0x3aeac1),{'verbose':_0x55f265[_0x1cee43(0x1b7)]}),_0x4e1665=_0x4abad9['data'];return console[_0x1cee43(0x1d4)](_0x1cee43(0x118)+_0x4e1665[_0x1cee43(0x198)]+'\x20activation'+(_0x4e1665[_0x1cee43(0x198)]!==0x1?'s':'')),await handleSDKOutput(_0x4e1665,_0x55f265),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x155);[a27_0x363bd7(0x139)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI';['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x1a5b6e){const _0x3ac1f3=a27_0x363bd7,_0x226b20=_0x1a5b6e[_0x3ac1f3(0x1d7)][0x0];let _0x5a1663;if(_0x226b20){const _0x1d03e7=await resolveTarget({'arg':_0x226b20,'contextParent':_0x1a5b6e[_0x3ac1f3(0x166)][_0x3ac1f3(0x135)],'cwd':process['cwd']()});isSuccessfulResolution(_0x1d03e7)&&_0x1d03e7[_0x3ac1f3(0x156)]===_0x3ac1f3(0x17b)&&(_0x5a1663=_0x1d03e7['filePath']);}const _0x551078={..._0x1a5b6e,'options':{..._0x1a5b6e[_0x3ac1f3(0x166)],'journeysOnly':!![],..._0x5a1663&&{'singleFilePath':_0x5a1663}}};return this[_0x3ac1f3(0xdb)]['execute'](_0x551078);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x1a1);['description']='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x363bd7(0x1f2)](_0x306a3b){const _0x25a90e=a27_0x363bd7,{options:_0x3dd78c,args:_0x32db11,tdx:_0xb9da0b}=_0x306a3b,_0x5a5484=_0x32db11[0x0];if(!requireNameOrPath(_0x5a5484))return 0x1;if(_0x3dd78c['verbose'])console[_0x25a90e(0x1d4)](_0x25a90e(0x1f4)+_0x5a5484);const {journeyId:_0xd5028d}=await resolveJourneyIdFromInput(_0x5a5484,_0x3dd78c,_0xb9da0b),_0x1822ce=await withSpinner('Listing\x20journey\x20versions...',()=>_0xb9da0b['journey'][_0x25a90e(0x163)](_0xd5028d),{'verbose':_0x3dd78c[_0x25a90e(0x1b7)]}),{bundleName:_0x4649b3,versions:_0x32a39d,latestJourneyId:_0x3ba639}=_0x1822ce[_0x25a90e(0x129)];console[_0x25a90e(0x1d4)](_0x4649b3+':\x20'+_0x32a39d[_0x25a90e(0x198)]+_0x25a90e(0xea)+(_0x32a39d[_0x25a90e(0x198)]!==0x1?'s':''));const _0x2fb483=_0x32a39d[_0x25a90e(0x19e)](_0x454841=>({'version':_0x454841[_0x25a90e(0x1cb)],'journey_id':_0x454841[_0x25a90e(0x1c2)],'name':_0x454841[_0x25a90e(0x113)],'state':_0x454841[_0x25a90e(0x1d2)],'paused':_0x454841[_0x25a90e(0x1ec)],'latest':_0x454841['journeyId']===_0x3ba639,'created_at':_0x454841['createdAt']}));return await handleSDKOutput(_0x2fb483,_0x3dd78c),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x16a);['description']=a27_0x363bd7(0xf3);async['execute'](_0x287550){const _0x424421=a27_0x363bd7,{options:_0x1b3d9c,args:_0x4f147d,tdx:_0x286e41}=_0x287550,_0x14166d=_0x4f147d[0x0];if(!requireNameOrPath(_0x14166d))return 0x1;if(_0x1b3d9c[_0x424421(0x1b7)])console[_0x424421(0x1d4)](_0x424421(0x1f4)+_0x14166d);const {journeyId:_0x497fbb,journeyName:_0x44e2f6}=await resolveJourneyIdFromInput(_0x14166d,_0x1b3d9c,_0x286e41);if(!_0x1b3d9c['yes']){const _0x32cb55=await confirm(_0x424421(0x16b)+_0x44e2f6+'\x22?');if(!_0x32cb55)return console[_0x424421(0x1d4)](_0x424421(0x10f)),0x0;}const _0x1965f4=await withSpinner('Creating\x20new\x20version...',()=>_0x286e41['journey'][_0x424421(0x17c)](_0x497fbb),{'verbose':_0x1b3d9c['verbose']}),_0x5d812a=_0x1965f4['data'];return console['error'](a27_0x241683[_0x424421(0xee)]('✔')+_0x424421(0x1ae)+_0x5d812a[_0x424421(0x147)][_0x424421(0x1cb)]+_0x424421(0x1d9)+_0x5d812a['attributes'][_0x424421(0x113)]+'\x22'),console[_0x424421(0x1d4)](_0x424421(0x1bb)+_0x5d812a['id']),await handleSingleObjectOutput({'id':_0x5d812a['id'],'name':_0x5d812a[_0x424421(0x147)][_0x424421(0x113)],'version':_0x5d812a[_0x424421(0x147)]['versionNumber'],'state':_0x5d812a['attributes'][_0x424421(0x1d2)],'bundle_id':_0x5d812a['attributes'][_0x424421(0x11e)],'created_at':_0x5d812a['attributes'][_0x424421(0xef)]},_0x1b3d9c),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x363bd7(0x113)]=a27_0x363bd7(0x119);[a27_0x363bd7(0x139)]=a27_0x363bd7(0x13b);async[a27_0x363bd7(0x1f2)](_0x16e455){const _0x4c12b1=a27_0x363bd7,{options:_0x1c8207,args:_0x597d77,tdx:_0x5b0593}=_0x16e455,_0x1b3f1a=_0x597d77[0x0];if(!requireNameOrPath(_0x1b3f1a))return 0x1;const _0x21b128=_0x1c8207[_0x4c12b1(0xe6)];if(!_0x21b128)return console['error'](_0x4c12b1(0x1ed)),console['error'](_0x4c12b1(0x136)),0x1;const _0x3af859=parseInt(_0x21b128,0xa);if(isNaN(_0x3af859)||_0x3af859<0x1)return console[_0x4c12b1(0x1d4)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x21b128),0x1;if(_0x1c8207[_0x4c12b1(0x1b7)])console[_0x4c12b1(0x1d4)]('Input:\x20'+_0x1b3f1a+',\x20version:\x20'+_0x3af859);const {journeyId:_0x4b301b,parentSegmentId:_0x174f61}=await resolveJourneyIdFromInput(_0x1b3f1a,_0x1c8207,_0x5b0593),_0x1932f8=await withSpinner(_0x4c12b1(0x1be),()=>_0x5b0593[_0x4c12b1(0x1ba)]['listVersions'](_0x4b301b),{'verbose':_0x1c8207['verbose']}),{versions:_0x3bb7e7,latestJourneyId:_0x49ec5f}=_0x1932f8[_0x4c12b1(0x129)],_0x4fe33a=_0x3bb7e7[_0x4c12b1(0x1bd)](_0x2f5965=>_0x2f5965[_0x4c12b1(0x1cb)]===_0x3af859);if(!_0x4fe33a){const _0x177af6=_0x3bb7e7[_0x4c12b1(0x19e)](_0x5b3fc7=>'v'+_0x5b3fc7[_0x4c12b1(0x1cb)])['join'](',\x20');return console[_0x4c12b1(0x1d4)](_0x4c12b1(0x1e8)+_0x3af859+_0x4c12b1(0xd7)+_0x177af6),0x1;}const _0x4922be=await withSpinner('Getting\x20version\x20'+_0x3af859+_0x4c12b1(0x105),()=>_0x5b0593[_0x4c12b1(0x1ba)][_0x4c12b1(0x1c8)](_0x4fe33a[_0x4c12b1(0x1c2)]),{'verbose':_0x1c8207[_0x4c12b1(0x1b7)]}),_0x503ffb=_0x4922be['data'],_0x5461a2=getConsoleNextUrl(_0x1c8207[_0x4c12b1(0x164)],_0x4c12b1(0x169)+_0x174f61+_0x4c12b1(0x18f)+_0x4fe33a[_0x4c12b1(0x1c2)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x503ffb['id'],'name':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x113)],'version':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x1cb)],'description':_0x503ffb['attributes'][_0x4c12b1(0x139)],'state':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x1d2)],'paused':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x1ec)],'reentry_mode':_0x503ffb['attributes'][_0x4c12b1(0x197)],'stages':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x16d)]?.[_0x4c12b1(0x198)]||0x0,..._0x503ffb['attributes'][_0x4c12b1(0x1c5)]&&{'goal':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0x1c5)]['name']},'latest':_0x4fe33a['journeyId']===_0x49ec5f,'created_at':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0xef)],'updated_at':_0x503ffb[_0x4c12b1(0x147)][_0x4c12b1(0xe1)],'url':_0x5461a2},_0x1c8207),0x0;}}function a27_0x43f2(){const _0x2b06d0=['resolveParentId','add','journeyBundleName','yes','links','localeCompare','12YJCwOS','Available\x20stages:\x20','has','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','(running)','\x20\x20←\x20','✔\x20Journey\x20\x22','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20details...','Fetching\x20','Fetching\x20journey\x20','getTrafficData','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','status','test','Show\x20journey\x20statistics','includeHistory','targetDir','Cancelled','\x20\x20Statistics\x20not\x20available','cyan','scheduleType','name','entries','table','folderPath','Parent\x20segment\x20ID:','Found\x20','journey:version:view','completeMilestoneRate','-\x20no\x20files\x20written','workflowSessionId','audienceId','journeyBundleId','dim','Show\x20journey\x20details','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','655155DaPSOq','connector_config','content','listJourneysFromParentSegment','size','bold','Table:\x20','data','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','10UAlGCu','jsonl','segments','user','(root)','Stages:','helpText','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','rule','parentSegment','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Paused:','then','description','\x20\x20Name:\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','from','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','nodes','journey:pause','\x22\x20resumed','.yml','Resolving\x20parent\x20segment...','/j/da','stages','\x20\x20Preserving\x20local\x20segment\x20name:\x20','get','attributes','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','format','yellow','push','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Error:\x20Stage\x20\x22','base','parent_segment','List\x20activations\x20for\x20a\x20journey','resolveSegment','\x20\x20Target:\x20','\x20new\x20files','relative','journey:push','type','(none)','activation','Pause\x20a\x20running\x20journey','\x0aPull\x20summary:','connection','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getLatestJourneyId','conversion','buildIdToNameMap','tsv','limit','workflowId','listVersions','site','Write\x20','options','\x0aChanges\x20to\x20\x27','red','/app/ps/','journey:version:create','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Getting\x20journey\x20details...','journeyStages','toLowerCase','Target\x20file:\x20','setPhase','Getting\x20journey\x20statistics...','\x20(ID:\x20','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','Resume\x20a\x20paused\x20journey','(unnamed)','runAfterJourneyRefresh','✔\x20All\x20files\x20are\x20up\x20to\x20date','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','web','kind','file','createVersion','renderStats','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Error:\x20Invalid\x20--type\x20\x22','journey:activations','Status:','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','✔\x20Found\x20','session','\x20@\x20','listFolders','replace','message','root\x20folder','✔\x20Pulled\x20','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','draft','getParentFull','resume','/e/','Error:\x20Parent\x20segment\x20context\x20required','Warning:\x20Could\x20not\x20resolve\x20segment\x20','✔\x20Context\x20set:\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20','no_parent','reentryMode','length','run','1710000hsmqpu','cwd','\x20files?','values','map','(archived)','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','journey:versions','folders','Session:','Export\x20journey(s)\x20as\x20YAML\x20files','hasChanges','Getting\x20column\x20mapping...','State:','journeyName','Activations:','pause','INVALID_ARGUMENT','dryRun','\x20versions)','\x20Created\x20v','activation_','...','hasPeriod','join','Database:\x20','repeat','(draft)','segment','verbose','exitOrJumpRate','Fetching\x20parent\x20segment...','journey','\x20\x20Journey\x20ID:\x20','milestoneSize','find','Resolving\x20version...','folderId','/j/da/je','\x20[runs\x20on\x20refresh]','journeyId','exitOrJumpSize','stage','goal','Options:','8660061egREUY','getJourney','\x5c$&','errorCode','versionNumber','Folder\x20path:\x20','resourceName','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x27\x20not\x20found\x20in\x20','\x20journey\x20files\x20to\x20','connectionId','state','\x20journeys','error','(completed)','database','args','history','\x20(draft)\x20—\x20\x22','⚠️\x20','\x22\x20not\x20found','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','ID:','Pausing\x20journey...','goalSize','Target\x20directory:\x20','13903OwTmUD','472508ChMbvj','json','none','journey:pull','sort','\x20(rule\x20match)','Error:\x20Version\x20','set','filter','Error:\x20Journey\x20\x27','paused','Error:\x20--version\x20option\x20is\x20required','Warning:\x20Could\x20not\x20resolve\x20activation\x20','utf-8','journey:resume','Journey:','execute','getColumnMapping','Input:\x20','diff','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Resolving\x20journey...','columns','enteredSize','tdx.json','pausedAt','Fetching\x20journeys\x20and\x20folders...','journey:view','segmentName','2450336QSLLXk','runAt','2320759VbJhtq','58wSsNoi','connection\x20','\x20=\x20','executeDryRun','\x20->\x20','getSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','buildIdToEmailMap','Listing\x20journey\x20activations...','launched','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20not\x20found.\x20Available:\x20','stageNameMap','\x20Journey\x20workflow\x20started','Journey\x20name:\x20','segmentPushCommand','all','Parent\x20segment:\x20','activationParams','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Journey\x20not\x20found:\x20','updatedAt','isNew','completed','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','\x20changed\x20files','version','no\x20connection','listActivationsFlat','parentName','\x20version','Triggering\x20journey\x20workflow...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','getActivation','green','createdAt','No\x20statistics\x20available\x20for\x20journey:\x20','getStatistics','log','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x0aError:','journey:stats','\x20journey'];a27_0x43f2=function(){return _0x2b06d0;};return a27_0x43f2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0xe18124=a28_0x5264;(function(_0x35542a,_0x1ad89d){const _0x4f27af=a28_0x5264,_0x359559=_0x35542a();while(!![]){try{const _0x2d537c=parseInt(_0x4f27af(0x1b9))/0x1*(parseInt(_0x4f27af(0x18d))/0x2)+parseInt(_0x4f27af(0x1b7))/0x3+parseInt(_0x4f27af(0x1a5))/0x4+-parseInt(_0x4f27af(0x193))/0x5+parseInt(_0x4f27af(0x1b6))/0x6+-parseInt(_0x4f27af(0x18e))/0x7*(-parseInt(_0x4f27af(0x1af))/0x8)+-parseInt(_0x4f27af(0x18f))/0x9;if(_0x2d537c===_0x1ad89d)break;else _0x359559['push'](_0x359559['shift']());}catch(_0xe216fb){_0x359559['push'](_0x359559['shift']());}}}(a28_0x128f,0xa8d88));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x5264(_0x2c8b4e,_0x2e958c){_0x2c8b4e=_0x2c8b4e-0x18a;const _0x128f39=a28_0x128f();let _0x526458=_0x128f39[_0x2c8b4e];return _0x526458;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x55ce53 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0x128f(){const _0x577828=['2210106hEatWT','3028362SPVdii','\x20warning(s)','11833UVpDlv','green','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose','Validate\x20journey\x20YAML\x20files','parentSegment','name','.yml','type','execute','relativePath','helpText','88KPEERk','34923dGoyPk','5729544wufYlY','validCount','no_parent','skippedCount','5031410bELfll','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Validation\x20failed:\x20','\x20valid','\x20warning(s)\x20found','endsWith','warnings','file','errorCode','journey:validate','✔\x20All\x20','invalidCount','cwd','log','error','valid','filter','red','1524616AswMhJ','cyan','Error:\x20','targetDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','journey','Error:\x20Directory\x20not\x20found:\x20','warningCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20error(s)','88VUHFxh','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','reason','\x20journey(s)\x20valid','length','dim'];a28_0x128f=function(){return _0x577828;};return a28_0x128f();}export class JourneyValidateCommand extends BaseCommand{[a28_0xe18124(0x1bf)]=a28_0xe18124(0x19c);['description']=a28_0xe18124(0x1bd);async[a28_0xe18124(0x18a)](_0x1c1d64){const _0x15cc1e=a28_0xe18124,{options:_0x54344e,args:_0x3949c4}=_0x1c1d64,_0x52238d=_0x54344e,_0x46b975=await resolveTarget({'arg':_0x3949c4[0x0],'contextParent':_0x54344e[_0x15cc1e(0x1be)],'cwd':process[_0x15cc1e(0x19f)]()});if(!isSuccessfulResolution(_0x46b975))return _0x46b975[_0x15cc1e(0x19b)]===_0x15cc1e(0x191)?(console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1b0)](_0x15cc1e(0x194))),console[_0x15cc1e(0x1a1)](_0x15cc1e(0x1bb)),console[_0x15cc1e(0x1a1)](_0x15cc1e(0x1a9)),console[_0x15cc1e(0x1a1)](_0x15cc1e(0x1b1))):(console['error'](a28_0x55ce53['red'](_0x15cc1e(0x1a7)+_0x46b975['message']+'\x0a')),_0x46b975[_0x15cc1e(0x18c)]&&console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1a6)](_0x46b975[_0x15cc1e(0x18c)]))),0x1;const _0x52c47c=_0x46b975[_0x15cc1e(0x1a8)],_0x3e83b7=_0x46b975[_0x15cc1e(0x1c1)]===_0x15cc1e(0x19a)?_0x46b975['filePath']:undefined;if(!_0x3e83b7&&!existsSync(_0x52c47c))return console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1a4)](_0x15cc1e(0x1ab)+_0x52c47c+'\x0a')),0x1;let _0x1743ae;if(_0x3e83b7){if(!_0x3e83b7[_0x15cc1e(0x198)](_0x15cc1e(0x1c0))&&!_0x3e83b7[_0x15cc1e(0x198)]('.yaml'))return console['error'](a28_0x55ce53[_0x15cc1e(0x1a4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3e83b7+'\x0a')),0x1;_0x1743ae=[_0x3e83b7];}else _0x1743ae=findYamlFiles(_0x52c47c);if(_0x1743ae[_0x15cc1e(0x1b4)]===0x0)return console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1a4)](_0x15cc1e(0x1ad)+_0x52c47c+'\x0a')),0x1;const _0x39546b=validateYamlFiles(_0x1743ae,_0x52c47c,{'filterType':_0x15cc1e(0x1aa)}),_0x21e81d=calculateSummary(_0x39546b),_0x46a1e0=_0x39546b[_0x15cc1e(0x1a3)](isValidationResult);if(_0x46a1e0[_0x15cc1e(0x1b4)]===0x0)return console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1b0)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x52c47c+'\x0a')),_0x21e81d['skippedCount']>0x0&&console[_0x15cc1e(0x1a1)](a28_0x55ce53[_0x15cc1e(0x1b5)]('('+_0x21e81d[_0x15cc1e(0x192)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x16675c of _0x39546b){if(!isValidationResult(_0x16675c)){_0x52238d['verbose']&&console[_0x15cc1e(0x1a0)](a28_0x55ce53['dim']('-\x20'+_0x16675c[_0x15cc1e(0x18b)]+'\x20(skipped:\x20'+_0x16675c[_0x15cc1e(0x1b2)]+')'));continue;}const {relativePath:_0x5b16a0,source:_0x1843cd,result:_0x1d0b34}=_0x16675c;if(_0x1d0b34[_0x15cc1e(0x1a2)]&&_0x1d0b34[_0x15cc1e(0x199)][_0x15cc1e(0x1b4)]===0x0)_0x52238d[_0x15cc1e(0x1bc)]&&console['log'](a28_0x55ce53[_0x15cc1e(0x1ba)]('✔\x20'+_0x5b16a0));else _0x1d0b34[_0x15cc1e(0x1a2)]?(console[_0x15cc1e(0x1a0)](a28_0x55ce53[_0x15cc1e(0x1b0)]('⚠\x20'+_0x5b16a0+':\x20'+_0x1d0b34[_0x15cc1e(0x199)][_0x15cc1e(0x1b4)]+_0x15cc1e(0x1b8))),console[_0x15cc1e(0x1a0)](formatValidationResult(_0x1d0b34,_0x1843cd,_0x5b16a0))):(console['log'](a28_0x55ce53[_0x15cc1e(0x1a4)]('✖\x20'+_0x5b16a0+':\x20'+_0x1d0b34['errors'][_0x15cc1e(0x1b4)]+_0x15cc1e(0x1ae))),console['log'](formatValidationResult(_0x1d0b34,_0x1843cd,_0x5b16a0)));}return console[_0x15cc1e(0x1a0)](''),_0x21e81d['hasErrors']?(console[_0x15cc1e(0x1a0)](a28_0x55ce53[_0x15cc1e(0x1a4)](_0x15cc1e(0x195)+_0x21e81d[_0x15cc1e(0x19e)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x21e81d[_0x15cc1e(0x190)]+_0x15cc1e(0x196))),_0x21e81d[_0x15cc1e(0x1ac)]>0x0&&console['log'](a28_0x55ce53[_0x15cc1e(0x1b0)](_0x21e81d[_0x15cc1e(0x1ac)]+'\x20warning(s)\x20found')),_0x21e81d[_0x15cc1e(0x192)]>0x0&&console[_0x15cc1e(0x1a0)](a28_0x55ce53['dim'](_0x21e81d[_0x15cc1e(0x192)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x15cc1e(0x1a0)](a28_0x55ce53[_0x15cc1e(0x1ba)](_0x15cc1e(0x19d)+_0x21e81d[_0x15cc1e(0x190)]+_0x15cc1e(0x1b3))),_0x21e81d[_0x15cc1e(0x1ac)]>0x0&&console['log'](a28_0x55ce53[_0x15cc1e(0x1b0)](_0x21e81d[_0x15cc1e(0x1ac)]+_0x15cc1e(0x197))),_0x21e81d[_0x15cc1e(0x192)]>0x0&&console[_0x15cc1e(0x1a0)](a28_0x55ce53['dim'](_0x21e81d['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x0);}}
|