@treasuredata/tdx 2026.4.22 → 2026.4.23
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/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.d.ts +7 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/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_0x5bca4d=a24_0x25b6;(function(_0x3eeadb,_0x5462dc){const _0x99a35b=a24_0x25b6,_0x5bcdb1=_0x3eeadb();while(!![]){try{const _0x48c65a=parseInt(_0x99a35b(0x96))/0x1+parseInt(_0x99a35b(0x8c))/0x2*(-parseInt(_0x99a35b(0xbc))/0x3)+parseInt(_0x99a35b(0xbf))/0x4*(parseInt(_0x99a35b(0x83))/0x5)+parseInt(_0x99a35b(0xc8))/0x6+parseInt(_0x99a35b(0x9c))/0x7+-parseInt(_0x99a35b(0x91))/0x8*(parseInt(_0x99a35b(0xc5))/0x9)+-parseInt(_0x99a35b(0x8b))/0xa;if(_0x48c65a===_0x5462dc)break;else _0x5bcdb1['push'](_0x5bcdb1['shift']());}catch(_0x4815c6){_0x5bcdb1['push'](_0x5bcdb1['shift']());}}}(a24_0x5c33,0x520ff));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_0x216ab4 from'chalk';import a24_0x1dff50 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';function a24_0x5c33(){const _0x5e5c05=['warnings','error','yellow','\x20templates','21RpABWt','red','configDir','8sDhkGy','dirname','config','✔\x20Created\x20','\x27...','\x0aValidation\x20errors\x20in\x20','2250glfTpF','templateId','dim','1107834chyoCO','length','green','504405GSuzXy','message','resolveWorkspaceId','Push\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20new\x20templates:','setPhase','resolve','648020hnfynL','10522GJCDPj','Preparing\x20push\x20to\x20workspace\x20\x27','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','\x20\x20\x20\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','14928ncaqBm','\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)','\x20errors:','filter','errors','166717VxEwvi','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','Aborted.','path','description','2457966urJCTq','\x0aPush\x20summary\x20for\x20workspace\x20\x27','execute','\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','1\x20template\x20file:\x20','session','site','\x20templates\x20to\x20update:','updated','update','engage','engage:template:push','workspace','yes','def','create','data','name','valid','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','relativePath','action','-\x20no\x20changes\x20applied','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','created','\x20templates?','engage_workspace','Found\x20'];a24_0x5c33=function(){return _0x5e5c05;};return a24_0x5c33();}import{getTemplateUrl}from'../sdk/client/endpoints.js';function a24_0x25b6(_0x592a29,_0x357d17){_0x592a29=_0x592a29-0x83;const _0x5c33f3=a24_0x5c33();let _0x25b676=_0x5c33f3[_0x592a29];return _0x25b676;}import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x5bca4d(0xad)]=a24_0x5bca4d(0xa7);[a24_0x5bca4d(0x9b)]=a24_0x5bca4d(0xaf);async[a24_0x5bca4d(0x9e)](_0xa7fefb){const _0x1d46cf=a24_0x5bca4d,{options:_0x1b8a74,args:_0x1686de,tdx:_0x205cf3}=_0xa7fefb,_0x4cc6fa=_0x1b8a74,_0x5e9efe=_0x1686de[0x0],_0x307806=_0x5e9efe?a24_0x1dff50[_0x1d46cf(0x8a)](_0x5e9efe):undefined,_0x37abbf=_0x307806?isYamlFile(_0x307806):![];let _0x158676;if(_0x37abbf&&_0x307806)_0x158676=a24_0x1dff50[_0x1d46cf(0xc0)](_0x307806);else _0x307806?_0x158676=_0x307806:_0x158676=process['cwd']();let _0x384f2d;const _0x29ede2=tryFindTdxConfig(_0x158676);_0x29ede2?.[_0x1d46cf(0xc1)][_0x1d46cf(0xb6)]&&(_0x384f2d=_0x29ede2[_0x1d46cf(0xc1)][_0x1d46cf(0xb6)],!_0x37abbf&&(_0x158676=_0x29ede2[_0x1d46cf(0xbe)]));_0x4cc6fa[_0x1d46cf(0xa8)]&&(_0x384f2d=_0x4cc6fa[_0x1d46cf(0xa8)]);if(!_0x384f2d){const _0x97745a=loadSessionContext(_0x4cc6fa[_0x1d46cf(0xa1)]);_0x97745a?.[_0x1d46cf(0xb6)]&&(_0x384f2d=_0x97745a['engage_workspace']);}if(!_0x384f2d)return console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xba)]('Workspace\x20is\x20required.')),console[_0x1d46cf(0xb9)](_0x1d46cf(0x8e)),console['error'](_0x1d46cf(0x92)),console[_0x1d46cf(0xb9)](_0x1d46cf(0x9f)),console['error'](_0x1d46cf(0x98)),0x1;let _0x31d199;_0x37abbf&&_0x307806?_0x31d199=[parseTemplateFile(_0x307806,a24_0x1dff50['dirname'](_0x307806))]:_0x31d199=discoverAndParseTemplateFiles(_0x158676);if(_0x31d199['length']===0x0)return console[_0x1d46cf(0xb9)](a24_0x216ab4['yellow']('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x158676)),console['error'](a24_0x216ab4[_0x1d46cf(0xc7)](_0x1d46cf(0x97))),0x1;const _0x398fcf=_0x31d199['length']===0x1?_0x1d46cf(0xa0)+_0x31d199[0x0][_0x1d46cf(0xaa)][_0x1d46cf(0xad)]:_0x31d199['length']+'\x20template\x20files';console[_0x1d46cf(0xb9)](_0x1d46cf(0xb7)+a24_0x216ab4['cyan'](_0x398fcf));let _0x2876f1=![];for(const _0x2bd728 of _0x31d199){const _0x36aa3d=validateTemplateDef(_0x2bd728['def']);if(!_0x36aa3d[_0x1d46cf(0xae)]){_0x2876f1=!![],console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xbd)](_0x1d46cf(0xc4)+_0x2bd728[_0x1d46cf(0xb0)]+':'));for(const _0x5880fd of _0x36aa3d[_0x1d46cf(0x95)]){console['error']('\x20\x20'+a24_0x216ab4[_0x1d46cf(0xbd)]('✗')+'\x20'+_0x5880fd[_0x1d46cf(0x9a)]+':\x20'+_0x5880fd['message']);}}for(const _0x38cb58 of _0x36aa3d[_0x1d46cf(0xb8)]){console[_0x1d46cf(0xb9)]('\x20\x20'+a24_0x216ab4[_0x1d46cf(0xba)]('⚠')+'\x20'+_0x38cb58[_0x1d46cf(0x9a)]+':\x20'+_0x38cb58[_0x1d46cf(0x84)]);}}if(_0x2876f1)return console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xbd)](_0x1d46cf(0xb3))),0x1;const _0xcb21fa=await _0x205cf3[_0x1d46cf(0xa6)][_0x1d46cf(0x85)](_0x384f2d),_0x333168=await withProgressSpinner(_0x1d46cf(0x8d)+_0x384f2d+_0x1d46cf(0xc3),_0x1af8f0=>preparePush({'engage':_0x205cf3['engage']},_0x31d199,_0xcb21fa,{'progress':{'update':_0x3f34e3=>_0x1af8f0[_0x1d46cf(0x89)](_0x3f34e3)}}),{'verbose':_0x4cc6fa['verbose']}),_0x37c551=_0x333168['data'];await withProgressSpinner('Resolving\x20references...',_0x410212=>resolveAndBuildInputs({'engage':_0x205cf3[_0x1d46cf(0xa6)]},_0x37c551,_0xcb21fa,{'progress':{'update':_0x349f9f=>_0x410212[_0x1d46cf(0x89)](_0x349f9f)}}),{'verbose':_0x4cc6fa['verbose']});const _0x1034b6=_0x37c551[_0x1d46cf(0x94)](_0x6b04f4=>_0x6b04f4[_0x1d46cf(0xb1)]===_0x1d46cf(0xab)),_0x991c61=_0x37c551['filter'](_0x18b6ec=>_0x18b6ec[_0x1d46cf(0xb1)]===_0x1d46cf(0xa5));console[_0x1d46cf(0xb9)](_0x1d46cf(0x9d)+_0x384f2d+'\x27:');if(_0x1034b6['length']>0x0){console[_0x1d46cf(0xb9)]('\x20\x20'+a24_0x216ab4[_0x1d46cf(0xca)]('+\x20'+_0x1034b6[_0x1d46cf(0xc9)]+_0x1d46cf(0x88)));for(const _0x33571c of _0x1034b6){console[_0x1d46cf(0xb9)]('\x20\x20\x20\x20'+a24_0x216ab4['green']('+')+'\x20'+_0x33571c[_0x1d46cf(0xaa)][_0x1d46cf(0xad)]);}}if(_0x991c61['length']>0x0){console[_0x1d46cf(0xb9)]('\x20\x20'+a24_0x216ab4[_0x1d46cf(0xba)]('~\x20'+_0x991c61['length']+_0x1d46cf(0xa3)));for(const _0x54c08a of _0x991c61){console[_0x1d46cf(0xb9)](_0x1d46cf(0x8f)+a24_0x216ab4[_0x1d46cf(0xba)]('~')+'\x20'+_0x54c08a['def'][_0x1d46cf(0xad)]);}}if(_0x1034b6[_0x1d46cf(0xc9)]===0x0&&_0x991c61['length']===0x0)return console[_0x1d46cf(0xb9)](a24_0x216ab4['green']('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x4cc6fa['dryRun'])return console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xba)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x4cc6fa[_0x1d46cf(0xa9)]){if(!isInteractive())return console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xbd)]('\x0aError:'),_0x1d46cf(0x87)),console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xc7)](_0x1d46cf(0x90))),0x1;const _0x2fa6ef=await confirmKey(_0x1d46cf(0x86)+(_0x1034b6[_0x1d46cf(0xc9)]+_0x991c61[_0x1d46cf(0xc9)])+_0x1d46cf(0xb5));if(!_0x2fa6ef)return console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xba)](_0x1d46cf(0x99)),_0x1d46cf(0xb2)),0x1;}const _0x308e0b=await withProgressSpinner('Pushing\x20templates...',_0x20fc88=>executePush({'engage':_0x205cf3['engage']},_0x37c551,{'progress':{'update':_0x56fb58=>_0x20fc88[_0x1d46cf(0x89)](_0x56fb58)}}),{'verbose':_0x4cc6fa['verbose']}),_0x385e79=_0x308e0b[_0x1d46cf(0xac)];for(const _0x1cb8c2 of _0x385e79['results']){if(_0x1cb8c2[_0x1d46cf(0xc6)]&&(_0x1cb8c2[_0x1d46cf(0xb1)]===_0x1d46cf(0xb4)||_0x1cb8c2['action']===_0x1d46cf(0xa4))){const _0x497539=getTemplateUrl(_0x4cc6fa[_0x1d46cf(0xa2)],_0xcb21fa,_0x1cb8c2[_0x1d46cf(0xc6)]),_0x4a0d0e=_0x1cb8c2['action']==='created'?'+':'~',_0x1f57b2=_0x1cb8c2[_0x1d46cf(0xb1)]==='created'?a24_0x216ab4[_0x1d46cf(0xca)](_0x4a0d0e):a24_0x216ab4['yellow'](_0x4a0d0e);console['error']('\x20\x20'+_0x1f57b2+'\x20'+hyperlink(_0x1cb8c2['name'],_0x497539)+'\x20'+a24_0x216ab4[_0x1d46cf(0xc7)](_0x497539));}}_0x385e79[_0x1d46cf(0xb4)]>0x0&&console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xca)](_0x1d46cf(0xc2)+_0x385e79[_0x1d46cf(0xb4)]+_0x1d46cf(0xbb)));_0x385e79[_0x1d46cf(0xa4)]>0x0&&console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xca)]('✔\x20Updated\x20'+_0x385e79['updated']+_0x1d46cf(0xbb)));if(_0x385e79[_0x1d46cf(0x95)]['length']>0x0){console[_0x1d46cf(0xb9)](a24_0x216ab4[_0x1d46cf(0xbd)]('✘\x20'+_0x385e79[_0x1d46cf(0x95)][_0x1d46cf(0xc9)]+_0x1d46cf(0x93)));for(const _0x48f79d of _0x385e79[_0x1d46cf(0x95)]){console[_0x1d46cf(0xb9)]('\x20\x20'+a24_0x216ab4[_0x1d46cf(0xbd)](_0x48f79d['name'])+':\x20'+_0x48f79d['error']);}}return saveSessionContext({'engage_workspace':_0x384f2d},_0x4cc6fa[_0x1d46cf(0xa1)]),_0x385e79[_0x1d46cf(0x95)][_0x1d46cf(0xc9)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a24_0x3405c3=a24_0x5f0d;function a24_0x2b53(){const _0xfaf50=['\x0aPush\x20summary\x20for\x20workspace\x20\x27','update','configDir','Workspace\x20is\x20required.','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x20templates?','918171Annwjc','420005RwuyQL','1740718FktelF','527157sdrKzh','data','message','yellow','execute','setPhase','✔\x20All\x20templates\x20are\x20up\x20to\x20date','workspace','filter','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','dirname','red','errors','1196757tCKuET','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20templates\x20to\x20update:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','results','length','9043918ouarCN','8KoNQhB','2EMslzJ','-\x20no\x20changes\x20applied','engage_workspace','70gPgyJq','created','engage','cyan','valid','✔\x20Updated\x20','updated','name','78NZGtWG','Push\x20','session','error','\x0aValidation\x20errors\x20in\x20','config','25104KgcSEe','Aborted.','def','\x20templates','Resolving\x20references...','dryRun','1\x20template\x20file:\x20','resolveWorkspaceId','verbose','green','36XVyiMV','\x20\x20\x20\x20','\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','path','\x20new\x20templates:','4873PTgiWF','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','action','dim','Preparing\x20push\x20to\x20workspace\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','site','warnings'];a24_0x2b53=function(){return _0xfaf50;};return a24_0x2b53();}(function(_0x213879,_0x2aaaca){const _0x3112ec=a24_0x5f0d,_0x26ab7d=_0x213879();while(!![]){try{const _0xc50a22=-parseInt(_0x3112ec(0x164))/0x1*(parseInt(_0x3112ec(0x16d))/0x2)+parseInt(_0x3112ec(0x157))/0x3*(parseInt(_0x3112ec(0x188))/0x4)+-parseInt(_0x3112ec(0x155))/0x5*(-parseInt(_0x3112ec(0x178))/0x6)+parseInt(_0x3112ec(0x156))/0x7*(parseInt(_0x3112ec(0x16c))/0x8)+parseInt(_0x3112ec(0x154))/0x9*(parseInt(_0x3112ec(0x170))/0xa)+-parseInt(_0x3112ec(0x146))/0xb*(parseInt(_0x3112ec(0x17e))/0xc)+-parseInt(_0x3112ec(0x16b))/0xd;if(_0xc50a22===_0x2aaaca)break;else _0x26ab7d['push'](_0x26ab7d['shift']());}catch(_0x37a3d2){_0x26ab7d['push'](_0x26ab7d['shift']());}}}(a24_0x2b53,0xc77c4));import{BaseCommand}from'./command.js';function a24_0x5f0d(_0x1a5919,_0x2b18d9){_0x1a5919=_0x1a5919-0x142;const _0x2b53aa=a24_0x2b53();let _0x5f0dfe=_0x2b53aa[_0x1a5919];return _0x5f0dfe;}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_0x1a98db from'chalk';import a24_0x4087c8 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x3405c3(0x177)]='engage:template:push';['description']=a24_0x3405c3(0x160);async[a24_0x3405c3(0x15b)](_0x5000ad){const _0x27af48=a24_0x3405c3,{options:_0x2e1f07,args:_0x14bbbd,tdx:_0x23577b}=_0x5000ad,_0x20d141=_0x2e1f07,_0xd29863=_0x14bbbd[0x0],_0xde4a9a=_0xd29863?a24_0x4087c8['resolve'](_0xd29863):undefined,_0x47a18e=_0xde4a9a?isYamlFile(_0xde4a9a):![];let _0x52d615;if(_0x47a18e&&_0xde4a9a)_0x52d615=a24_0x4087c8[_0x27af48(0x161)](_0xde4a9a);else _0xde4a9a?_0x52d615=_0xde4a9a:_0x52d615=process['cwd']();let _0x4be874;const _0x160936=tryFindTdxConfig(_0x52d615);_0x160936?.[_0x27af48(0x17d)][_0x27af48(0x16f)]&&(_0x4be874=_0x160936[_0x27af48(0x17d)][_0x27af48(0x16f)],!_0x47a18e&&(_0x52d615=_0x160936[_0x27af48(0x150)]));_0x20d141[_0x27af48(0x15e)]&&(_0x4be874=_0x20d141[_0x27af48(0x15e)]);if(!_0x4be874){const _0x3f61f9=loadSessionContext(_0x20d141[_0x27af48(0x17a)]);_0x3f61f9?.[_0x27af48(0x16f)]&&(_0x4be874=_0x3f61f9[_0x27af48(0x16f)]);}if(!_0x4be874)return console[_0x27af48(0x17b)](a24_0x1a98db[_0x27af48(0x15a)](_0x27af48(0x151))),console[_0x27af48(0x17b)](_0x27af48(0x143)),console['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)'),console[_0x27af48(0x17b)](_0x27af48(0x168)),console[_0x27af48(0x17b)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x589dc8;_0x47a18e&&_0xde4a9a?_0x589dc8=[parseTemplateFile(_0xde4a9a,a24_0x4087c8[_0x27af48(0x161)](_0xde4a9a))]:_0x589dc8=discoverAndParseTemplateFiles(_0x52d615);if(_0x589dc8[_0x27af48(0x16a)]===0x0)return console['error'](a24_0x1a98db[_0x27af48(0x15a)](_0x27af48(0x165)+_0x52d615)),console[_0x27af48(0x17b)](a24_0x1a98db[_0x27af48(0x149)](_0x27af48(0x147))),0x1;const _0x38c3f3=_0x589dc8[_0x27af48(0x16a)]===0x1?_0x27af48(0x184)+_0x589dc8[0x0][_0x27af48(0x180)]['name']:_0x589dc8['length']+'\x20template\x20files';console['error']('Found\x20'+a24_0x1a98db[_0x27af48(0x173)](_0x38c3f3));let _0xb90bb3=![];for(const _0x5b8508 of _0x589dc8){const _0x1f7ddd=validateTemplateDef(_0x5b8508[_0x27af48(0x180)]);if(!_0x1f7ddd[_0x27af48(0x174)]){_0xb90bb3=!![],console['error'](a24_0x1a98db[_0x27af48(0x162)](_0x27af48(0x17c)+_0x5b8508['relativePath']+':'));for(const _0x5be34e of _0x1f7ddd['errors']){console[_0x27af48(0x17b)]('\x20\x20'+a24_0x1a98db[_0x27af48(0x162)]('✗')+'\x20'+_0x5be34e[_0x27af48(0x144)]+':\x20'+_0x5be34e[_0x27af48(0x159)]);}}for(const _0x593506 of _0x1f7ddd[_0x27af48(0x14d)]){console[_0x27af48(0x17b)]('\x20\x20'+a24_0x1a98db[_0x27af48(0x15a)]('⚠')+'\x20'+_0x593506[_0x27af48(0x144)]+':\x20'+_0x593506[_0x27af48(0x159)]);}}if(_0xb90bb3)return console[_0x27af48(0x17b)](a24_0x1a98db['red'](_0x27af48(0x152))),0x1;const _0x267b44=await _0x23577b[_0x27af48(0x172)][_0x27af48(0x185)](_0x4be874),_0x4718ba=await withProgressSpinner(_0x27af48(0x14a)+_0x4be874+'\x27...',_0x527d6c=>preparePush({'engage':_0x23577b[_0x27af48(0x172)]},_0x589dc8,_0x267b44,{'progress':{'update':_0x4adfc1=>_0x527d6c[_0x27af48(0x15c)](_0x4adfc1)}}),{'verbose':_0x20d141[_0x27af48(0x186)]}),_0x4b7465=_0x4718ba[_0x27af48(0x158)];await withProgressSpinner(_0x27af48(0x182),_0x551d34=>resolveAndBuildInputs({'engage':_0x23577b['engage']},_0x4b7465,_0x267b44,{'progress':{'update':_0x381d74=>_0x551d34[_0x27af48(0x15c)](_0x381d74)}}),{'verbose':_0x20d141[_0x27af48(0x186)]});const _0x3e69e1=_0x4b7465[_0x27af48(0x15f)](_0x4d9751=>_0x4d9751[_0x27af48(0x148)]==='create'),_0xc34534=_0x4b7465[_0x27af48(0x15f)](_0x1426a1=>_0x1426a1[_0x27af48(0x148)]===_0x27af48(0x14f));console['error'](_0x27af48(0x14e)+_0x4be874+'\x27:');if(_0x3e69e1['length']>0x0){console['error']('\x20\x20'+a24_0x1a98db[_0x27af48(0x187)]('+\x20'+_0x3e69e1[_0x27af48(0x16a)]+_0x27af48(0x145)));for(const _0x4c03bd of _0x3e69e1){console[_0x27af48(0x17b)](_0x27af48(0x142)+a24_0x1a98db[_0x27af48(0x187)]('+')+'\x20'+_0x4c03bd[_0x27af48(0x180)]['name']);}}if(_0xc34534[_0x27af48(0x16a)]>0x0){console[_0x27af48(0x17b)]('\x20\x20'+a24_0x1a98db[_0x27af48(0x15a)]('~\x20'+_0xc34534[_0x27af48(0x16a)]+_0x27af48(0x166)));for(const _0x3a7756 of _0xc34534){console['error'](_0x27af48(0x142)+a24_0x1a98db['yellow']('~')+'\x20'+_0x3a7756[_0x27af48(0x180)]['name']);}}if(_0x3e69e1[_0x27af48(0x16a)]===0x0&&_0xc34534[_0x27af48(0x16a)]===0x0)return console[_0x27af48(0x17b)](a24_0x1a98db[_0x27af48(0x187)](_0x27af48(0x15d))),0x0;if(_0x20d141[_0x27af48(0x183)])return console['error'](a24_0x1a98db[_0x27af48(0x15a)](_0x27af48(0x14b))),0x0;if(!_0x20d141['yes']){if(!isInteractive())return console[_0x27af48(0x17b)](a24_0x1a98db['red']('\x0aError:'),_0x27af48(0x167)),console[_0x27af48(0x17b)](a24_0x1a98db[_0x27af48(0x149)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c2df1=await confirmKey(_0x27af48(0x179)+(_0x3e69e1[_0x27af48(0x16a)]+_0xc34534['length'])+_0x27af48(0x153));if(!_0x4c2df1)return console['error'](a24_0x1a98db[_0x27af48(0x15a)](_0x27af48(0x17f)),_0x27af48(0x16e)),0x1;}const _0x371ecd=await withProgressSpinner('Pushing\x20templates...',_0x2f905e=>executePush({'engage':_0x23577b[_0x27af48(0x172)]},_0x4b7465,{'progress':{'update':_0x4eec3a=>_0x2f905e[_0x27af48(0x15c)](_0x4eec3a)}}),{'verbose':_0x20d141[_0x27af48(0x186)]}),_0x4d9642=_0x371ecd['data'];for(const _0x2d3c9f of _0x4d9642[_0x27af48(0x169)]){if(_0x2d3c9f['templateId']&&(_0x2d3c9f['action']===_0x27af48(0x171)||_0x2d3c9f[_0x27af48(0x148)]===_0x27af48(0x176))){const _0x599728=getTemplateUrl(_0x20d141[_0x27af48(0x14c)],_0x267b44,_0x2d3c9f['templateId']),_0x338d6a=_0x2d3c9f[_0x27af48(0x148)]===_0x27af48(0x171)?'+':'~',_0x126cbc=_0x2d3c9f[_0x27af48(0x148)]===_0x27af48(0x171)?a24_0x1a98db[_0x27af48(0x187)](_0x338d6a):a24_0x1a98db[_0x27af48(0x15a)](_0x338d6a);console['error']('\x20\x20'+_0x126cbc+'\x20'+hyperlink(_0x2d3c9f[_0x27af48(0x177)],_0x599728)+'\x20'+a24_0x1a98db[_0x27af48(0x149)](_0x599728));}}_0x4d9642[_0x27af48(0x171)]>0x0&&console[_0x27af48(0x17b)](a24_0x1a98db[_0x27af48(0x187)]('✔\x20Created\x20'+_0x4d9642[_0x27af48(0x171)]+_0x27af48(0x181)));_0x4d9642['updated']>0x0&&console[_0x27af48(0x17b)](a24_0x1a98db[_0x27af48(0x187)](_0x27af48(0x175)+_0x4d9642[_0x27af48(0x176)]+_0x27af48(0x181)));if(_0x4d9642[_0x27af48(0x163)][_0x27af48(0x16a)]>0x0){console[_0x27af48(0x17b)](a24_0x1a98db[_0x27af48(0x162)]('✘\x20'+_0x4d9642['errors']['length']+'\x20errors:'));for(const _0x5333f6 of _0x4d9642[_0x27af48(0x163)]){console[_0x27af48(0x17b)]('\x20\x20'+a24_0x1a98db[_0x27af48(0x162)](_0x5333f6[_0x27af48(0x177)])+':\x20'+_0x5333f6['error']);}}return saveSessionContext({'engage_workspace':_0x4be874},_0x20d141['session']),_0x4d9642[_0x27af48(0x163)][_0x27af48(0x16a)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0xb34b6=a25_0x3ad9;(function(_0x92559b,_0x41599b){const _0x47c87f=a25_0x3ad9,_0x51bd57=_0x92559b();while(!![]){try{const _0x8180f6=-parseInt(_0x47c87f(0xb6))/0x1+parseInt(_0x47c87f(0xaa))/0x2*(-parseInt(_0x47c87f(0xa5))/0x3)+parseInt(_0x47c87f(0xc1))/0x4*(-parseInt(_0x47c87f(0xcb))/0x5)+parseInt(_0x47c87f(0xa4))/0x6+-parseInt(_0x47c87f(0xa7))/0x7*(parseInt(_0x47c87f(0xb8))/0x8)+parseInt(_0x47c87f(0xd4))/0x9+parseInt(_0x47c87f(0xbc))/0xa;if(_0x8180f6===_0x41599b)break;else _0x51bd57['push'](_0x51bd57['shift']());}catch(_0xa1d538){_0x51bd57['push'](_0x51bd57['shift']());}}}(a25_0xb3e4,0x21edf));function a25_0x3ad9(_0x4170d0,_0x169771){_0x4170d0=_0x4170d0-0xa3;const _0xb3e458=a25_0xb3e4();let _0x3ad991=_0xb3e458[_0x4170d0];return _0x3ad991;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0xb3e4(){const _0x2f3e87=['green','\x20non-template\x20file(s)\x20skipped','invalidCount','7366200IKBctC','resolve','relativePath','log','verbose','108PJnbzi','No\x20template\x20YAML\x20files\x20found\x20in\x20','warningCount','validCount','description','.yaml','dirname','length','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20(skipped:\x20','36285XJCxdX','✔\x20All\x20','dim','yellow','skippedCount','execute','\x20valid','red','Error:\x20Directory\x20not\x20found:\x20','656928WPJvbL','\x20template(s)\x20with\x20errors,\x20','23970qExqkH','140664ktGDDS','endsWith','2933SbIaKN','warnings','\x20template(s)\x20valid','10kzmXJP','engage:template:validate','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','valid','\x20warning(s)\x20found','cwd','Validation\x20failed:\x20','template','Validate\x20template\x20YAML\x20files','filter','error','reason','162548hsmHgL','\x20error(s)','1560QirJmd'];a25_0xb3e4=function(){return _0x2f3e87;};return a25_0xb3e4();}import{existsSync}from'fs';import a25_0x4e08f6 from'chalk';import a25_0x429fb0 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a25_0xb34b6(0xab);[a25_0xb34b6(0xc5)]=a25_0xb34b6(0xb2);async[a25_0xb34b6(0xd0)](_0x1f1ad9){const _0x5c60d4=a25_0xb34b6,{options:_0x20ceed,args:_0x5cbd45}=_0x1f1ad9,_0x201f54=_0x20ceed,_0xa7e89a=_0x5cbd45[0x0],_0xaf2881=_0xa7e89a?a25_0x429fb0[_0x5c60d4(0xbd)](_0xa7e89a):undefined,_0x5bd3e2=_0xaf2881?isYamlFile(_0xaf2881):![];let _0x292ac4,_0x5351e2;if(_0x5bd3e2&&_0xaf2881)_0x292ac4=a25_0x429fb0[_0x5c60d4(0xc7)](_0xaf2881),_0x5351e2=_0xaf2881;else _0xaf2881?_0x292ac4=_0xaf2881:_0x292ac4=process[_0x5c60d4(0xaf)]();if(!_0x5351e2&&!existsSync(_0x292ac4))return console[_0x5c60d4(0xb4)](a25_0x4e08f6[_0x5c60d4(0xd2)](_0x5c60d4(0xd3)+_0x292ac4+'\x0a')),0x1;let _0x51f1db;if(_0x5351e2){if(!_0x5351e2[_0x5c60d4(0xa6)]('.yml')&&!_0x5351e2[_0x5c60d4(0xa6)](_0x5c60d4(0xc6)))return console[_0x5c60d4(0xb4)](a25_0x4e08f6[_0x5c60d4(0xd2)](_0x5c60d4(0xc9)+_0x5351e2+'\x0a')),0x1;_0x51f1db=[_0x5351e2];}else _0x51f1db=findYamlFiles(_0x292ac4);if(_0x51f1db[_0x5c60d4(0xc8)]===0x0)return console[_0x5c60d4(0xb4)](a25_0x4e08f6[_0x5c60d4(0xd2)](_0x5c60d4(0xac)+_0x292ac4+'\x0a')),0x1;const _0x13f4ca=validateYamlFiles(_0x51f1db,_0x292ac4,{'filterType':_0x5c60d4(0xb1)}),_0x405bf0=calculateSummary(_0x13f4ca),_0x1b92ee=_0x13f4ca[_0x5c60d4(0xb3)](isValidationResult);if(_0x1b92ee[_0x5c60d4(0xc8)]===0x0)return console[_0x5c60d4(0xb4)](a25_0x4e08f6[_0x5c60d4(0xce)](_0x5c60d4(0xc2)+_0x292ac4+'\x0a')),_0x405bf0[_0x5c60d4(0xcf)]>0x0&&console[_0x5c60d4(0xb4)](a25_0x4e08f6[_0x5c60d4(0xcd)]('('+_0x405bf0[_0x5c60d4(0xcf)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x186fa9 of _0x13f4ca){if(!isValidationResult(_0x186fa9)){_0x201f54[_0x5c60d4(0xc0)]&&console['log'](a25_0x4e08f6[_0x5c60d4(0xcd)]('-\x20'+_0x186fa9[_0x5c60d4(0xbe)]+_0x5c60d4(0xca)+_0x186fa9[_0x5c60d4(0xb5)]+')'));continue;}const {relativePath:_0xe0349,source:_0x58387b,result:_0x495f13}=_0x186fa9;if(_0x495f13[_0x5c60d4(0xad)]&&_0x495f13[_0x5c60d4(0xa8)]['length']===0x0)_0x201f54[_0x5c60d4(0xc0)]&&console[_0x5c60d4(0xbf)](a25_0x4e08f6[_0x5c60d4(0xb9)]('✔\x20'+_0xe0349));else _0x495f13['valid']?(console['log'](a25_0x4e08f6[_0x5c60d4(0xce)]('⚠\x20'+_0xe0349+':\x20'+_0x495f13['warnings']['length']+'\x20warning(s)')),console['log'](formatValidationResult(_0x495f13,_0x58387b,_0xe0349))):(console[_0x5c60d4(0xbf)](a25_0x4e08f6[_0x5c60d4(0xd2)]('✖\x20'+_0xe0349+':\x20'+_0x495f13['errors']['length']+_0x5c60d4(0xb7))),console['log'](formatValidationResult(_0x495f13,_0x58387b,_0xe0349)));}return console[_0x5c60d4(0xbf)](''),_0x405bf0['hasErrors']?(console[_0x5c60d4(0xbf)](a25_0x4e08f6[_0x5c60d4(0xd2)](_0x5c60d4(0xb0)+_0x405bf0[_0x5c60d4(0xbb)]+_0x5c60d4(0xa3)+_0x405bf0[_0x5c60d4(0xc4)]+_0x5c60d4(0xd1))),_0x405bf0[_0x5c60d4(0xc3)]>0x0&&console['log'](a25_0x4e08f6['yellow'](_0x405bf0[_0x5c60d4(0xc3)]+_0x5c60d4(0xae))),_0x405bf0['skippedCount']>0x0&&console[_0x5c60d4(0xbf)](a25_0x4e08f6[_0x5c60d4(0xcd)](_0x405bf0[_0x5c60d4(0xcf)]+_0x5c60d4(0xba))),0x1):(console[_0x5c60d4(0xbf)](a25_0x4e08f6[_0x5c60d4(0xb9)](_0x5c60d4(0xcc)+_0x405bf0[_0x5c60d4(0xc4)]+_0x5c60d4(0xa9))),_0x405bf0[_0x5c60d4(0xc3)]>0x0&&console['log'](a25_0x4e08f6[_0x5c60d4(0xce)](_0x405bf0[_0x5c60d4(0xc3)]+_0x5c60d4(0xae))),_0x405bf0[_0x5c60d4(0xcf)]>0x0&&console[_0x5c60d4(0xbf)](a25_0x4e08f6['dim'](_0x405bf0[_0x5c60d4(0xcf)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0xf1aa11=a26_0x5690;(function(_0x522f30,_0x1e8f76){const _0x4e0cd7=a26_0x5690,_0x4d6458=_0x522f30();while(!![]){try{const _0x794250=-parseInt(_0x4e0cd7(0x107))/0x1+-parseInt(_0x4e0cd7(0x10e))/0x2*(-parseInt(_0x4e0cd7(0x12f))/0x3)+parseInt(_0x4e0cd7(0x14d))/0x4+-parseInt(_0x4e0cd7(0x14a))/0x5+parseInt(_0x4e0cd7(0x13a))/0x6+parseInt(_0x4e0cd7(0x142))/0x7*(-parseInt(_0x4e0cd7(0x136))/0x8)+-parseInt(_0x4e0cd7(0x152))/0x9*(parseInt(_0x4e0cd7(0xff))/0xa);if(_0x794250===_0x1e8f76)break;else _0x4d6458['push'](_0x4d6458['shift']());}catch(_0x414f79){_0x4d6458['push'](_0x4d6458['shift']());}}}(a26_0x179e,0x24f0c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x86228d from'chalk';function formatDuration(_0x18024a){const _0x99b2f=a26_0x5690;if(_0x18024a<0x3c)return _0x18024a+'s';if(_0x18024a<0xe10)return Math[_0x99b2f(0x127)](_0x18024a/0x3c)+'m\x20'+_0x18024a%0x3c+'s';const _0x20d1d1=Math[_0x99b2f(0x127)](_0x18024a/0xe10),_0x4ed30a=Math['floor'](_0x18024a%0xe10/0x3c);return _0x4ed30a>0x0?_0x20d1d1+'h\x20'+_0x4ed30a+'m':_0x20d1d1+'h';}function a26_0x5690(_0x3498b7,_0x12c795){_0x3498b7=_0x3498b7-0xfe;const _0x179e8d=a26_0x179e();let _0x569037=_0x179e8d[_0x3498b7];return _0x569037;}function formatRelativeTime(_0xb3efc6){const _0xbd32f5=a26_0x5690,_0xa4485=Date[_0xbd32f5(0x144)]()-_0xb3efc6[_0xbd32f5(0x102)](),_0x18c308=Math[_0xbd32f5(0x127)](Math[_0xbd32f5(0x10c)](_0xa4485)/0x3e8);if(_0x18c308<0x3c)return'just\x20now';const _0x4cdb6d=Math['floor'](_0x18c308/0x3c);if(_0x4cdb6d<0x3c)return _0x4cdb6d+'m\x20ago';const _0x1b8416=Math[_0xbd32f5(0x127)](_0x4cdb6d/0x3c);if(_0x1b8416<0x18)return _0x1b8416+_0xbd32f5(0x101);const _0x558f05=Math[_0xbd32f5(0x127)](_0x1b8416/0x18);if(_0x558f05<0x1e)return _0x558f05+_0xbd32f5(0x12b);return Math['floor'](_0x558f05/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0xf1aa11(0x13e)]=a26_0xf1aa11(0x146);[a26_0xf1aa11(0x12e)]=a26_0xf1aa11(0x10d);async['execute'](_0x573594){const _0x104700=a26_0xf1aa11,{options:_0x126741,tdx:_0x338f08}=_0x573594,_0x2c693e=resolveLimit(_0x126741[_0x104700(0x103)],DEFAULT_DISPLAY_LIMIT),_0x4f70f4=_0x126741[_0x104700(0x120)];_0x126741['verbose']&&(console[_0x104700(0x121)](_0x104700(0x112)+_0x2c693e+'\x20jobs'),_0x4f70f4&&console[_0x104700(0x121)](_0x104700(0x10a)+_0x4f70f4));const _0x235bfd=await withSpinner(_0x104700(0x13c),()=>_0x338f08[_0x104700(0x146)]['list']({'from':0x0,'to':_0x2c693e-0x1,'status':_0x4f70f4}),{'verbose':_0x126741[_0x104700(0x133)]}),_0x1e848d=_0x235bfd[_0x104700(0x126)];console[_0x104700(0x121)]('✔\x20Found\x20'+_0x1e848d['length']+_0x104700(0x11d)+(_0x1e848d[_0x104700(0x12c)]!==0x1?'s':''));const _0xabc07b=_0x126741[_0x104700(0x122)];if(isStructuredFormat(_0x126741)){const _0x2e8fd0=_0x1e848d[_0x104700(0x11c)](_0x53c2cb=>{const _0x49eec9=_0x104700;let _0x2ff21a;if(_0x53c2cb['start_at']&&_0x53c2cb[_0x49eec9(0x100)]){const _0x20a3e2=new Date(_0x53c2cb[_0x49eec9(0x109)])[_0x49eec9(0x102)](),_0x47ed48=new Date(_0x53c2cb[_0x49eec9(0x100)])['getTime']();_0x2ff21a=Math[_0x49eec9(0x111)]((_0x47ed48-_0x20a3e2)/0x3e8);}return{'job_id':_0x53c2cb[_0x49eec9(0x117)],'type':_0x53c2cb[_0x49eec9(0x141)]===_0x49eec9(0x105)?_0x49eec9(0x147):_0x53c2cb['type'],'status':_0x53c2cb[_0x49eec9(0x120)],'user_name':_0x53c2cb[_0x49eec9(0x138)],'duration_sec':_0x2ff21a,'created_at':_0x53c2cb[_0x49eec9(0x148)],'started_at':_0x53c2cb[_0x49eec9(0x109)],'end_at':_0x53c2cb[_0x49eec9(0x100)]};});await handleSDKOutput(_0x2e8fd0,_0x126741);}else for(const _0x50a9a9 of _0x1e848d){const _0x2a0617=_0x50a9a9[_0x104700(0x120)]===_0x104700(0x118)?a26_0x86228d[_0x104700(0x13d)]:_0x50a9a9[_0x104700(0x120)]===_0x104700(0x121)?a26_0x86228d[_0x104700(0x129)]:a26_0x86228d['dim'],_0x25056e=_0x2a0617(_0x50a9a9[_0x104700(0x120)]),_0x3be34a=getJobUrl(_0xabc07b,_0x50a9a9[_0x104700(0x117)]),_0x4be797=hyperlink(_0x50a9a9['job_id'],_0x3be34a),_0x2f542e=a26_0x86228d[_0x104700(0x12a)](_0x50a9a9[_0x104700(0x141)]===_0x104700(0x105)?_0x104700(0x147):_0x50a9a9[_0x104700(0x141)]),_0xe6519c=[];if(_0x50a9a9[_0x104700(0x109)]&&_0x50a9a9[_0x104700(0x100)]){const _0x585350=Math[_0x104700(0x111)]((new Date(_0x50a9a9[_0x104700(0x100)])['getTime']()-new Date(_0x50a9a9['start_at'])[_0x104700(0x102)]())/0x3e8);_0xe6519c['push'](formatDuration(_0x585350));}if(_0x50a9a9[_0x104700(0x100)])_0xe6519c['push'](formatRelativeTime(new Date(_0x50a9a9[_0x104700(0x100)])));else _0x50a9a9[_0x104700(0x109)]&&_0xe6519c['push'](formatRelativeTime(new Date(_0x50a9a9[_0x104700(0x109)])));const _0x3fd401=_0xe6519c[_0x104700(0x12c)]>0x0?a26_0x86228d[_0x104700(0x12a)]('\x20'+_0xe6519c[_0x104700(0x124)](',\x20')):'';console[_0x104700(0x140)]('⚡\x20'+_0x4be797+'\x20'+_0x2f542e+'\x20'+_0x25056e+_0x3fd401);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0xf1aa11(0x13e)]='job:show';[a26_0xf1aa11(0x12e)]=a26_0xf1aa11(0x10b);[a26_0xf1aa11(0x134)](_0x32654d){const _0x4a9f48=a26_0xf1aa11,_0x319dfd=_0x32654d[_0x4a9f48(0x113)][0x0];if(!_0x319dfd)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0xf1aa11(0x104)](_0x5589b1){const _0x326494=a26_0xf1aa11,{options:_0x28b6d9,args:_0x5eee5d,tdx:_0x5d0137}=_0x5589b1,_0x591c89=_0x5eee5d[0x0],_0x13ded2=await withSpinner(_0x326494(0x150),()=>_0x5d0137['jobs'][_0x326494(0x139)](_0x591c89),{'verbose':_0x28b6d9['verbose']}),_0x1ff3a8=_0x13ded2[_0x326494(0x126)];let _0x29db62;if(_0x1ff3a8[_0x326494(0x109)]&&_0x1ff3a8[_0x326494(0x100)]){const _0x49e6eb=new Date(_0x1ff3a8[_0x326494(0x109)])[_0x326494(0x102)](),_0x4d9aaf=new Date(_0x1ff3a8[_0x326494(0x100)])['getTime']();_0x29db62=Math[_0x326494(0x111)]((_0x4d9aaf-_0x49e6eb)/0x3e8);}const _0x350ff5={'job_id':_0x1ff3a8[_0x326494(0x117)],'type':_0x1ff3a8[_0x326494(0x141)],'status':_0x1ff3a8[_0x326494(0x120)],..._0x1ff3a8[_0x326494(0x138)]&&{'user_name':_0x1ff3a8[_0x326494(0x138)]},..._0x29db62!==undefined&&{'duration_sec':_0x29db62},..._0x1ff3a8[_0x326494(0x148)]&&{'created_at':_0x1ff3a8[_0x326494(0x148)]},..._0x1ff3a8[_0x326494(0x109)]&&{'started_at':_0x1ff3a8[_0x326494(0x109)]},..._0x1ff3a8['end_at']&&{'end_at':_0x1ff3a8[_0x326494(0x100)]},..._0x1ff3a8['database']&&{'database':_0x1ff3a8[_0x326494(0x13b)]},..._0x1ff3a8[_0x326494(0x137)]!==undefined&&{'priority':_0x1ff3a8[_0x326494(0x137)]},..._0x1ff3a8[_0x326494(0x125)]&&{'url':_0x1ff3a8['url']},..._0x1ff3a8['query']&&{'query':_0x1ff3a8[_0x326494(0x13f)]},..._0x1ff3a8[_0x326494(0x131)]&&{'debug':_0x1ff3a8['debug']}};return await handleSingleObjectOutput(_0x350ff5,_0x28b6d9),0x0;}}function a26_0x179e(){const _0x98c0bf=['hive','file','Getting\x20job\x20details...','Job\x20type:\x20','487665IhCbZk','\x27\x20to\x20verify\x20the\x20job\x20status','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','30RjpfOe','end_at','h\x20ago','getTime','limit','execute','presto','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','87262upWMGH','INVALID_ARGUMENT','start_at','Status\x20filter:\x20','Show\x20job\x20details','abs','List\x20jobs','33106OXYxyw','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','No\x20SQL\x20statements\x20found\x20in\x20file','round','Limit:\x20','args','yes','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','information_schema','job_id','success','substring','...','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','map','\x20job','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','✔\x20Retrieved\x20','status','error','site','Submit\x20a\x20job','join','url','data','floor','kill','red','dim','d\x20ago','length','Database:\x20','description','27iAgyEv','Cancelled','debug','Getting\x20job\x20results...','verbose','validate','result','206224RYWTMZ','priority','user_name','show','1474188gjFgGz','database','Listing\x20jobs...','green','name','query','log','type','49iijHHP','\x20row','now','job:kill','jobs','trino','created_at','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','101560XsjVeS','Get\x20job\x20results','submit','828832qNiZTu'];a26_0x179e=function(){return _0x98c0bf;};return a26_0x179e();}export class JobKillCommand extends BaseCommand{[a26_0xf1aa11(0x13e)]=a26_0xf1aa11(0x145);['description']='Kill\x20a\x20job';[a26_0xf1aa11(0x134)](_0x484e53){const _0x46289f=a26_0xf1aa11,_0x2cfbe3=_0x484e53[_0x46289f(0x113)][0x0];if(!_0x2cfbe3)return _0x46289f(0x10f);return undefined;}async[a26_0xf1aa11(0x104)](_0x584b61){const _0x483eaa=a26_0xf1aa11,{options:_0x310ff7,args:_0x388401,tdx:_0x46f210}=_0x584b61,_0x3ef35e=_0x388401[0x0];if(!_0x310ff7[_0x483eaa(0x114)]){const _0x4f5ff6=await confirm(_0x483eaa(0x11e)+_0x3ef35e+'?');if(!_0x4f5ff6)return console[_0x483eaa(0x121)](_0x483eaa(0x130)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x46f210[_0x483eaa(0x146)][_0x483eaa(0x128)](_0x3ef35e),{'verbose':_0x310ff7['verbose']}),console[_0x483eaa(0x121)](_0x483eaa(0x11b)+_0x3ef35e),console[_0x483eaa(0x121)](_0x483eaa(0x115)+_0x3ef35e+_0x483eaa(0x153)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a26_0xf1aa11(0x12e)]=a26_0xf1aa11(0x123);async[a26_0xf1aa11(0x104)](_0x2cb13b){const _0x3fd525=a26_0xf1aa11,{options:_0x214db8,args:_0x459f71,tdx:_0x5327e4}=_0x2cb13b,_0x3c76c3=_0x214db8['jobType']||_0x3fd525(0x147),_0x130fb1=_0x214db8[_0x3fd525(0x14f)],_0x445db8=_0x214db8[_0x3fd525(0x13b)]||_0x3fd525(0x116),_0x5ed2f9=_0x214db8[_0x3fd525(0x135)];if(_0x3c76c3!=='trino'&&_0x3c76c3!==_0x3fd525(0x14e))throw new SDKError(ErrorCode[_0x3fd525(0x108)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x1d76be;if(_0x130fb1){if(_0x459f71[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3fd525(0x149));const _0x38e962=readSqlStatementsFromFile(_0x130fb1);if(_0x38e962[_0x3fd525(0x12c)]===0x0)throw new SDKError(ErrorCode[_0x3fd525(0x108)],_0x3fd525(0x110));if(_0x38e962[_0x3fd525(0x12c)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3fd525(0x106));_0x1d76be=_0x38e962[0x0];}else{if(!_0x459f71[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x1d76be=_0x459f71[0x0];}_0x214db8[_0x3fd525(0x133)]&&(console[_0x3fd525(0x121)](_0x3fd525(0x151)+_0x3c76c3),console[_0x3fd525(0x121)](_0x3fd525(0x12d)+_0x445db8),console[_0x3fd525(0x121)]('Query:\x20'+_0x1d76be[_0x3fd525(0x119)](0x0,0x64)+(_0x1d76be['length']>0x64?_0x3fd525(0x11a):'')));const _0x36f064=await withSpinner('Submitting\x20job...',()=>_0x5327e4[_0x3fd525(0x146)][_0x3fd525(0x14c)](_0x445db8,_0x1d76be,_0x3c76c3,_0x5ed2f9),{'verbose':_0x214db8['verbose']}),_0x1df6cb=_0x36f064['data'];return console['error']('✔\x20Job\x20submitted'),console[_0x3fd525(0x121)]('\x20\x20Job\x20ID:\x20'+_0x1df6cb[_0x3fd525(0x117)]),await handleSDKOutput([_0x1df6cb],_0x214db8),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0xf1aa11(0x13e)]='job:result';['description']=a26_0xf1aa11(0x14b);[a26_0xf1aa11(0x134)](_0x284719){const _0x47cd22=a26_0xf1aa11,_0x45ca44=_0x284719[_0x47cd22(0x113)][0x0];if(!_0x45ca44)return _0x47cd22(0xfe);return undefined;}async[a26_0xf1aa11(0x104)](_0x2c3b12){const _0x1e6b5b=a26_0xf1aa11,{options:_0x38dd6f,args:_0x167d31,tdx:_0x3f925e}=_0x2c3b12,_0x5562bd=_0x167d31[0x0],_0x42e945=await withSpinner(_0x1e6b5b(0x132),()=>_0x3f925e[_0x1e6b5b(0x146)][_0x1e6b5b(0x135)](_0x5562bd),{'verbose':_0x38dd6f[_0x1e6b5b(0x133)]}),_0x8ce736=_0x42e945[_0x1e6b5b(0x126)];return console['error'](_0x1e6b5b(0x11f)+_0x8ce736[_0x1e6b5b(0x12c)]+_0x1e6b5b(0x143)+(_0x8ce736[_0x1e6b5b(0x12c)]!==0x1?'s':'')),await handleSDKOutput(_0x8ce736,_0x38dd6f),0x0;}}
|
|
1
|
+
const a26_0x9a770f=a26_0x1408;(function(_0x296002,_0x56d466){const _0xce573d=a26_0x1408,_0x48c8a2=_0x296002();while(!![]){try{const _0xbd7f2a=parseInt(_0xce573d(0x175))/0x1*(parseInt(_0xce573d(0x196))/0x2)+-parseInt(_0xce573d(0x161))/0x3*(-parseInt(_0xce573d(0x16e))/0x4)+parseInt(_0xce573d(0x19e))/0x5+parseInt(_0xce573d(0x193))/0x6*(parseInt(_0xce573d(0x194))/0x7)+-parseInt(_0xce573d(0x178))/0x8+-parseInt(_0xce573d(0x165))/0x9+-parseInt(_0xce573d(0x186))/0xa;if(_0xbd7f2a===_0x56d466)break;else _0x48c8a2['push'](_0x48c8a2['shift']());}catch(_0xeed48f){_0x48c8a2['push'](_0x48c8a2['shift']());}}}(a26_0x244a,0xcbe5d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x53e1ec from'chalk';function formatDuration(_0x437462){const _0x525666=a26_0x1408;if(_0x437462<0x3c)return _0x437462+'s';if(_0x437462<0xe10)return Math['floor'](_0x437462/0x3c)+'m\x20'+_0x437462%0x3c+'s';const _0x30fe99=Math['floor'](_0x437462/0xe10),_0x3bfb28=Math[_0x525666(0x17e)](_0x437462%0xe10/0x3c);return _0x3bfb28>0x0?_0x30fe99+'h\x20'+_0x3bfb28+'m':_0x30fe99+'h';}function formatRelativeTime(_0x5561cf){const _0x1896dd=a26_0x1408,_0x3971f2=Date['now']()-_0x5561cf[_0x1896dd(0x18a)](),_0x55037f=Math[_0x1896dd(0x17e)](Math['abs'](_0x3971f2)/0x3e8);if(_0x55037f<0x3c)return _0x1896dd(0x162);const _0x2877d2=Math[_0x1896dd(0x17e)](_0x55037f/0x3c);if(_0x2877d2<0x3c)return _0x2877d2+_0x1896dd(0x180);const _0x2f1d51=Math['floor'](_0x2877d2/0x3c);if(_0x2f1d51<0x18)return _0x2f1d51+'h\x20ago';const _0x1d8f64=Math[_0x1896dd(0x17e)](_0x2f1d51/0x18);if(_0x1d8f64<0x1e)return _0x1d8f64+_0x1896dd(0x164);return Math[_0x1896dd(0x17e)](_0x1d8f64/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x9a770f(0x155)]=a26_0x9a770f(0x16b);[a26_0x9a770f(0x179)]=a26_0x9a770f(0x198);async['execute'](_0x376e44){const _0x3102a8=a26_0x9a770f,{options:_0x234862,tdx:_0xe336d}=_0x376e44,_0x44be2e=resolveLimit(_0x234862[_0x3102a8(0x18c)],DEFAULT_DISPLAY_LIMIT),_0xacd48=_0x234862[_0x3102a8(0x15b)];_0x234862[_0x3102a8(0x16d)]&&(console[_0x3102a8(0x16f)](_0x3102a8(0x188)+_0x44be2e+_0x3102a8(0x183)),_0xacd48&&console[_0x3102a8(0x16f)](_0x3102a8(0x184)+_0xacd48));const _0x2ff5f4=await withSpinner(_0x3102a8(0x15f),()=>_0xe336d[_0x3102a8(0x16b)][_0x3102a8(0x159)]({'from':0x0,'to':_0x44be2e-0x1,'status':_0xacd48}),{'verbose':_0x234862[_0x3102a8(0x16d)]}),_0x208365=_0x2ff5f4[_0x3102a8(0x166)];console['error'](_0x3102a8(0x1a3)+_0x208365[_0x3102a8(0x1a7)]+'\x20job'+(_0x208365[_0x3102a8(0x1a7)]!==0x1?'s':''));const _0x13213a=_0x234862['site'];if(isStructuredFormat(_0x234862)){const _0x5974be=_0x208365['map'](_0x32dae3=>{const _0xd962c0=_0x3102a8;let _0x4427cf;if(_0x32dae3[_0xd962c0(0x1a4)]&&_0x32dae3[_0xd962c0(0x190)]){const _0x4047f0=new Date(_0x32dae3[_0xd962c0(0x1a4)])['getTime'](),_0x5e2bbd=new Date(_0x32dae3['end_at'])[_0xd962c0(0x18a)]();_0x4427cf=Math[_0xd962c0(0x189)]((_0x5e2bbd-_0x4047f0)/0x3e8);}return{'job_id':_0x32dae3[_0xd962c0(0x16a)],'type':_0x32dae3[_0xd962c0(0x171)]===_0xd962c0(0x1a1)?_0xd962c0(0x15c):_0x32dae3[_0xd962c0(0x171)],'status':_0x32dae3[_0xd962c0(0x15b)],'user_name':_0x32dae3[_0xd962c0(0x16c)],'duration_sec':_0x4427cf,'created_at':_0x32dae3[_0xd962c0(0x191)],'started_at':_0x32dae3['start_at'],'end_at':_0x32dae3[_0xd962c0(0x190)]};});await handleSDKOutput(_0x5974be,_0x234862);}else for(const _0x11621a of _0x208365){const _0x40d19f=_0x11621a[_0x3102a8(0x15b)]==='success'?a26_0x53e1ec[_0x3102a8(0x170)]:_0x11621a[_0x3102a8(0x15b)]===_0x3102a8(0x16f)?a26_0x53e1ec['red']:a26_0x53e1ec['dim'],_0x126738=_0x40d19f(_0x11621a[_0x3102a8(0x15b)]),_0x3376a8=getJobUrl(_0x13213a,_0x11621a[_0x3102a8(0x16a)]),_0x15e99b=hyperlink(_0x11621a[_0x3102a8(0x16a)],_0x3376a8),_0x221fbc=a26_0x53e1ec[_0x3102a8(0x157)](_0x11621a[_0x3102a8(0x171)]===_0x3102a8(0x1a1)?'trino':_0x11621a[_0x3102a8(0x171)]),_0x1dc737=[];if(_0x11621a['start_at']&&_0x11621a[_0x3102a8(0x190)]){const _0x174afd=Math[_0x3102a8(0x189)]((new Date(_0x11621a[_0x3102a8(0x190)])[_0x3102a8(0x18a)]()-new Date(_0x11621a['start_at'])['getTime']())/0x3e8);_0x1dc737[_0x3102a8(0x1a5)](formatDuration(_0x174afd));}if(_0x11621a[_0x3102a8(0x190)])_0x1dc737[_0x3102a8(0x1a5)](formatRelativeTime(new Date(_0x11621a['end_at'])));else _0x11621a[_0x3102a8(0x1a4)]&&_0x1dc737[_0x3102a8(0x1a5)](formatRelativeTime(new Date(_0x11621a['start_at'])));const _0x7555a=_0x1dc737[_0x3102a8(0x1a7)]>0x0?a26_0x53e1ec[_0x3102a8(0x157)]('\x20'+_0x1dc737[_0x3102a8(0x185)](',\x20')):'';console[_0x3102a8(0x1a8)]('⚡\x20'+_0x15e99b+'\x20'+_0x221fbc+'\x20'+_0x126738+_0x7555a);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x9a770f(0x155)]=a26_0x9a770f(0x154);[a26_0x9a770f(0x179)]=a26_0x9a770f(0x197);[a26_0x9a770f(0x17c)](_0x690052){const _0x56a441=a26_0x9a770f,_0x3d5dbf=_0x690052[_0x56a441(0x1a0)][0x0];if(!_0x3d5dbf)return _0x56a441(0x17b);return undefined;}async[a26_0x9a770f(0x1a6)](_0x4ff802){const _0xd63203=a26_0x9a770f,{options:_0xc65b2b,args:_0x492bc6,tdx:_0x1dbfba}=_0x4ff802,_0x399b59=_0x492bc6[0x0],_0x34e785=await withSpinner('Getting\x20job\x20details...',()=>_0x1dbfba['jobs']['show'](_0x399b59),{'verbose':_0xc65b2b['verbose']}),_0x36e1c4=_0x34e785[_0xd63203(0x166)];let _0x2a9f0e;if(_0x36e1c4[_0xd63203(0x1a4)]&&_0x36e1c4['end_at']){const _0x4730f4=new Date(_0x36e1c4[_0xd63203(0x1a4)])[_0xd63203(0x18a)](),_0xf4a73f=new Date(_0x36e1c4[_0xd63203(0x190)])[_0xd63203(0x18a)]();_0x2a9f0e=Math[_0xd63203(0x189)]((_0xf4a73f-_0x4730f4)/0x3e8);}const _0x2c3c7f={'job_id':_0x36e1c4[_0xd63203(0x16a)],'type':_0x36e1c4['type'],'status':_0x36e1c4[_0xd63203(0x15b)],..._0x36e1c4[_0xd63203(0x16c)]&&{'user_name':_0x36e1c4[_0xd63203(0x16c)]},..._0x2a9f0e!==undefined&&{'duration_sec':_0x2a9f0e},..._0x36e1c4[_0xd63203(0x191)]&&{'created_at':_0x36e1c4[_0xd63203(0x191)]},..._0x36e1c4['start_at']&&{'started_at':_0x36e1c4['start_at']},..._0x36e1c4[_0xd63203(0x190)]&&{'end_at':_0x36e1c4[_0xd63203(0x190)]},..._0x36e1c4[_0xd63203(0x18f)]&&{'database':_0x36e1c4[_0xd63203(0x18f)]},..._0x36e1c4[_0xd63203(0x160)]!==undefined&&{'priority':_0x36e1c4[_0xd63203(0x160)]},..._0x36e1c4['url']&&{'url':_0x36e1c4[_0xd63203(0x19a)]},..._0x36e1c4[_0xd63203(0x153)]&&{'query':_0x36e1c4[_0xd63203(0x153)]},..._0x36e1c4[_0xd63203(0x19c)]&&{'debug':_0x36e1c4[_0xd63203(0x19c)]}};return await handleSingleObjectOutput(_0x2c3c7f,_0xc65b2b),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x9a770f(0x155)]=a26_0x9a770f(0x19b);[a26_0x9a770f(0x179)]=a26_0x9a770f(0x18e);[a26_0x9a770f(0x17c)](_0x5ba87a){const _0x1a0fb4=a26_0x9a770f,_0xf44fab=_0x5ba87a[_0x1a0fb4(0x1a0)][0x0];if(!_0xf44fab)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async['execute'](_0x684b41){const _0x268067=a26_0x9a770f,{options:_0x2555c7,args:_0x3385cc,tdx:_0x3e59d8}=_0x684b41,_0x12acc7=_0x3385cc[0x0];if(!_0x2555c7[_0x268067(0x17a)]){const _0x100604=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x12acc7+'?');if(!_0x100604)return console[_0x268067(0x16f)](_0x268067(0x15d)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x3e59d8[_0x268067(0x16b)][_0x268067(0x19d)](_0x12acc7),{'verbose':_0x2555c7[_0x268067(0x16d)]}),console['error'](_0x268067(0x18b)+_0x12acc7),console['error'](_0x268067(0x176)+_0x12acc7+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}function a26_0x1408(_0x4daf64,_0x3d2fb9){_0x4daf64=_0x4daf64-0x153;const _0x244a21=a26_0x244a();let _0x140894=_0x244a21[_0x4daf64];return _0x140894;}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x9a770f(0x15e);['description']=a26_0x9a770f(0x174);async[a26_0x9a770f(0x1a6)](_0x325ff6){const _0x43a06e=a26_0x9a770f,{options:_0x79d215,args:_0xe9408e,tdx:_0x175e36}=_0x325ff6,_0x114a52=_0x79d215['jobType']||_0x43a06e(0x15c),_0x86a594=_0x79d215['file'],_0x208303=_0x79d215['database']||_0x43a06e(0x15a),_0x204066=_0x79d215[_0x43a06e(0x181)];if(_0x114a52!==_0x43a06e(0x15c)&&_0x114a52!==_0x43a06e(0x173))throw new SDKError(ErrorCode[_0x43a06e(0x177)],_0x43a06e(0x17f));let _0x30b158;if(_0x86a594){if(_0xe9408e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x43a06e(0x156));const _0x35ca2e=readSqlStatementsFromFile(_0x86a594);if(_0x35ca2e[_0x43a06e(0x1a7)]===0x0)throw new SDKError(ErrorCode[_0x43a06e(0x177)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x35ca2e[_0x43a06e(0x1a7)]>0x1)throw new SDKError(ErrorCode[_0x43a06e(0x177)],_0x43a06e(0x199));_0x30b158=_0x35ca2e[0x0];}else{if(!_0xe9408e[0x0])throw new SDKError(ErrorCode[_0x43a06e(0x177)],_0x43a06e(0x17d));_0x30b158=_0xe9408e[0x0];}_0x79d215[_0x43a06e(0x16d)]&&(console[_0x43a06e(0x16f)](_0x43a06e(0x187)+_0x114a52),console[_0x43a06e(0x16f)](_0x43a06e(0x167)+_0x208303),console[_0x43a06e(0x16f)](_0x43a06e(0x19f)+_0x30b158[_0x43a06e(0x182)](0x0,0x64)+(_0x30b158['length']>0x64?_0x43a06e(0x158):'')));const _0x46bc52=await withSpinner(_0x43a06e(0x195),()=>_0x175e36[_0x43a06e(0x16b)][_0x43a06e(0x169)](_0x208303,_0x30b158,_0x114a52,_0x204066),{'verbose':_0x79d215['verbose']}),_0x41d08d=_0x46bc52['data'];return console[_0x43a06e(0x16f)](_0x43a06e(0x168)),console[_0x43a06e(0x16f)]('\x20\x20Job\x20ID:\x20'+_0x41d08d[_0x43a06e(0x16a)]),await handleSDKOutput([_0x41d08d],_0x79d215),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x9a770f(0x155)]=a26_0x9a770f(0x163);[a26_0x9a770f(0x179)]=a26_0x9a770f(0x172);['validate'](_0x9999c2){const _0x2b60e8=_0x9999c2['args'][0x0];if(!_0x2b60e8)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x9a770f(0x1a6)](_0x457eee){const _0x2e700b=a26_0x9a770f,{options:_0x5c601e,args:_0x4509e1,tdx:_0x198396}=_0x457eee,_0x171ee5=_0x4509e1[0x0],_0x5eefd1=await withSpinner(_0x2e700b(0x192),()=>_0x198396['jobs'][_0x2e700b(0x181)](_0x171ee5),{'verbose':_0x5c601e[_0x2e700b(0x16d)]}),_0x4ab3ed=_0x5eefd1[_0x2e700b(0x166)];return console['error'](_0x2e700b(0x1a2)+_0x4ab3ed[_0x2e700b(0x1a7)]+_0x2e700b(0x18d)+(_0x4ab3ed[_0x2e700b(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x4ab3ed,_0x5c601e),0x0;}}function a26_0x244a(){const _0x3477f0=['round','getTime','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','limit','\x20row','Kill\x20a\x20job','database','end_at','created_at','Getting\x20job\x20results...','24bHiWtM','2721712Zpeatx','Submitting\x20job...','83206IPXLJs','Show\x20job\x20details','List\x20jobs','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','url','job:kill','debug','kill','6591725jJiPUE','Query:\x20','args','presto','✔\x20Retrieved\x20','✔\x20Found\x20','start_at','push','execute','length','log','query','job:show','name','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','dim','...','list','information_schema','status','trino','Cancelled','job:submit','Listing\x20jobs...','priority','45KrKwnV','just\x20now','job:result','d\x20ago','7111521tKYNao','data','Database:\x20','✔\x20Job\x20submitted','submit','job_id','jobs','user_name','verbose','151076aPcIXe','error','green','type','Get\x20job\x20results','hive','Submit\x20a\x20job','9VOCgVf','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','INVALID_ARGUMENT','12265728xWrBkx','description','yes','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','validate','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','floor','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','m\x20ago','result','substring','\x20jobs','Status\x20filter:\x20','join','6560210CtsbWD','Job\x20type:\x20','Limit:\x20'];a26_0x244a=function(){return _0x3477f0;};return a26_0x244a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x337567=a27_0x3ba9;(function(_0x59092c,_0x3561ac){const _0x423291=a27_0x3ba9,_0xacbc06=_0x59092c();while(!![]){try{const _0x3672d6=parseInt(_0x423291(0x239))/0x1*(parseInt(_0x423291(0x1a0))/0x2)+parseInt(_0x423291(0x1b2))/0x3*(parseInt(_0x423291(0x249))/0x4)+parseInt(_0x423291(0x1d2))/0x5*(-parseInt(_0x423291(0x1af))/0x6)+parseInt(_0x423291(0x171))/0x7+parseInt(_0x423291(0x148))/0x8*(parseInt(_0x423291(0x173))/0x9)+-parseInt(_0x423291(0x1e8))/0xa+parseInt(_0x423291(0x16e))/0xb*(-parseInt(_0x423291(0x143))/0xc);if(_0x3672d6===_0x3561ac)break;else _0xacbc06['push'](_0xacbc06['shift']());}catch(_0x55c28c){_0xacbc06['push'](_0xacbc06['shift']());}}}(a27_0x29a4,0x82880));import a27_0x230dea from'chalk';import a27_0x4c5d0c from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';function a27_0x29a4(){const _0x3c3f9c=['1145574ZGRmaz','\x20[runs\x20on\x20refresh]','\x20@\x20','3aqpcwK','launched','attributes','enteredSize','State:','getSegment','hasChanges','all','versionNumber','table','none','\x20\x20-\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','name','\x20(draft)\x20—\x20\x22','\x20(rule\x20match)','no_parent','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','stringify','Listing\x20journeys...','data','connector_config','entries','stageNameMap','folderId','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Error:\x20Invalid\x20version\x20number:\x20','✔\x20Journey\x20\x22','buildIdToNameMap','Fetching\x20users\x20and\x20connections...','blue','filter','10CCrQFG','parentName','utf-8','Show\x20journey\x20details','Activations:','segmentName','reentryMode','segmentPushCommand','(running)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20journey\x20files\x20to\x20','dryRun','execute','INVALID_ARGUMENT','journeyStages',',\x20schedule:\x20','Target\x20directory:\x20','Error:\x20Invalid\x20--type\x20\x22','jsonl','resume','\x20\x20Folder\x20path:\x20','4886100FRnJZd','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','connectionId','renderStats','✔\x20Context\x20set:\x20','/e/','\x20new\x20files','values','Getting\x20column\x20mapping...','\x20\x20Name:\x20','Input:\x20','Show\x20journey\x20statistics','journey:versions','sort','\x0aPull\x20summary:','⚠️\x20','List\x20journeys\x20in\x20current\x20context','listActivationsFlat','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Resume\x20a\x20paused\x20journey','\x5c$&','Journey\x20name:\x20','Resolving\x20journey...','segments','conversion','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','find','.yml','parentSegment','green','executeDryRun','\x20\x20←\x20','Pattern:\x20','List\x20all\x20versions\x20of\x20a\x20journey','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Fetching\x20journey\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','completeMilestoneRate','red','stages','connection\x20','get','journeyName','json','log','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyId','\x20=\x20','links','connection','errorCode','Pause\x20a\x20running\x20journey','getLatestJourneyId','Found\x20','nodes','limit','parent_segment','/j/da/je','folders','activation','createdAt','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','rootFolderId','✔\x20Pulled\x20','Pausing\x20journey...','filePath','map','message','no\x20connection','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','getJourney','(completed)','\x20\x20Statistics\x20not\x20available','\x20journeys','journey:activations','journeyBundleName','createVersion','size','2691kfQzxb','Error:\x20','history','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Resolving\x20version...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Creating\x20new\x20version...','Target\x20file:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','resolveParentId','args','milestoneSize','journey:push','goal','listVersions','Error:\x20Journey\x20\x27','2814644wUSjNN','/app/ps/','segment','yellow','goalSize','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','...','Write\x20','(unnamed)','✔\x20Found\x20','\x20files?','set','Table:\x20','yes','List\x20activations\x20for\x20a\x20journey','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Paused\x20at:','Error:\x20Stage\x20\x22','diff','resolveJourneyId','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','includeHistory','folderPath','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Aborted.','\x20details...','475704jLEtok','user','\x20changed\x20files','journey:version:create','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','310296AKIXDV','Fetching\x20parent\x20segment...','Parent\x20segment:\x20','then','Journey:','file','Resolving\x20parent\x20segment...','options','includeStats','resourceName','join','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20activation','\x22\x20not\x20found','scheduleType','push','Error:\x20Journey\x20not\x20found:\x20','Getting\x20journey\x20traffic\x20data...','error','hasPeriod','Listing\x20journey\x20versions...','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Listing\x20journey\x20activations...','audienceId','journeyBundleId','Fetching\x20','journey:columns','length','Fetching\x20journeys\x20and\x20folders...','completionRate','ID:','state','isNew','verbose','description','listJourneysWithFolders','has','exitOrJumpSize','275uKMLyf','runAt','buildIdToEmailMap','7074039qFqAkh','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','9kSnrvG','paused','bold','pausedAt','exitOrJumpRate','replace','journey:traffic','add','stage','getTrafficData','journey:version:view','activationParams','content','tdx.json','journey:pull','absolutePath','\x20Created\x20v','No\x20statistics\x20available\x20for\x20journey:\x20',',\x20version:\x20','cwd','\x20(ID:\x20','Database:\x20','base','dim','\x0aError:','Error:\x20--version\x20option\x20is\x20required','localeCompare','split','Show\x20journey\x20table\x20column\x20mapping','journey:view','repeat','journey','Stages:','toLowerCase','relative','from','type','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','(none)','columns','🗺️\x20','Getting\x20journey\x20statistics...','\x20not\x20found.\x20Available:\x20','journey:resume','journey:stats','478gqFzyx','No\x20journeys\x20found','listFolders','session','cyan','site','rule','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','pause','activation_','\x20version','format','archived','Paused:','helpText'];a27_0x29a4=function(){return _0x3c3f9c;};return a27_0x29a4();}import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x2914d0){const _0x377b98=a27_0x3ba9;return!_0x2914d0&&(console[_0x377b98(0x15a)](_0x377b98(0x1e9)),console['error'](_0x377b98(0x153))),!!_0x2914d0;}function withJsonFormat(_0x184454){const _0x447c5b=a27_0x3ba9;if(!_0x184454[_0x447c5b(0x1ab)]&&!_0x184454['json']&&!_0x184454[_0x447c5b(0x1e5)]&&!_0x184454['tsv'])return{..._0x184454,'format':_0x447c5b(0x215),'json':!![]};return _0x184454;}function formatJourneyState(_0x232422){const _0x24d676=a27_0x3ba9;switch(_0x232422){case _0x24d676(0x1b3):return a27_0x230dea[_0x24d676(0x207)](_0x24d676(0x1da));case'draft':return a27_0x230dea[_0x24d676(0x18a)]('(draft)');case _0x24d676(0x174):return a27_0x230dea[_0x24d676(0x24c)]('(paused)');case'completed':return a27_0x230dea[_0x24d676(0x1d0)](_0x24d676(0x232));case _0x24d676(0x1ac):return a27_0x230dea[_0x24d676(0x18a)]('(archived)');default:return'('+_0x232422+')';}}function formatJourneyItem(_0x40a399,_0x470722='',_0x49175d){const _0x1b31f5=a27_0x3ba9,_0x460d72=formatJourneyState(_0x40a399['state']),_0x2d6430=_0x49175d?hyperlink(_0x40a399['journeyBundleName'],_0x49175d):_0x40a399[_0x1b31f5(0x236)];return _0x470722+_0x1b31f5(0x19b)+_0x2d6430+'\x20'+_0x460d72;}function escapeRegex(_0x1b2f54){const _0x49bc0b=a27_0x3ba9;return _0x1b2f54[_0x49bc0b(0x178)](/[.*+?^${}()|[\]\\]/g,_0x49bc0b(0x1fd));}function globToRegex(_0xd2102c){const _0x3a98aa=a27_0x3ba9,_0x2aa937=_0xd2102c[_0x3a98aa(0x18e)]('*')['map'](escapeRegex);return new RegExp(_0x2aa937[_0x3a98aa(0x152)]('.*'),'i');}function buildRuleToNameMapping(_0x1a83f2){const _0x470d0b=a27_0x3ba9,_0x164db1=new Map();if(_0x1a83f2[_0x470d0b(0x200)])for(const [_0x226288,_0x132151]of Object[_0x470d0b(0x1c8)](_0x1a83f2['segments'])){if(_0x132151[_0x470d0b(0x1a6)]){const _0x55badb=serializeRule(_0x132151[_0x470d0b(0x1a6)]),_0x18f2b0=_0x164db1['get'](_0x55badb);_0x18f2b0?_0x18f2b0[_0x470d0b(0x157)](_0x226288):_0x164db1[_0x470d0b(0x254)](_0x55badb,[_0x226288]);}}return _0x164db1;}async function resolveJourneyIdFromInput(_0x253e4f,_0xdc1537,_0x8af9e1){const _0x1b179a=a27_0x3ba9,_0x16c8ca=await resolveJourneyTarget(_0x253e4f,_0xdc1537['parentSegment'],_0xdc1537['verbose']),_0xcb9f95=_0x16c8ca[_0x1b179a(0x206)];if(!_0xcb9f95)throw new SDKError(ErrorCode[_0x1b179a(0x1e0)],_0x1b179a(0x24e));const _0x17d5e6=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x8af9e1[_0x1b179a(0x24b)][_0x1b179a(0x242)](_0xcb9f95),{'verbose':_0xdc1537[_0x1b179a(0x169)]}),_0xd110f1=_0x17d5e6[_0x1b179a(0x1c6)],_0x36961d=await withSpinner(_0x1b179a(0x1ff),()=>_0x8af9e1[_0x1b179a(0x192)][_0x1b179a(0x13c)](_0xd110f1,_0x16c8ca[_0x1b179a(0x214)]),{'verbose':_0xdc1537[_0x1b179a(0x169)]});return{'journeyId':_0x36961d[_0x1b179a(0x1c6)],'journeyName':_0x16c8ca[_0x1b179a(0x214)],'parentSegmentId':_0xd110f1};}async function resolveJourneyTarget(_0x4f39e6,_0x10110e,_0x32b917){const _0x3b3664=a27_0x3ba9;if(isYamlFilePath(_0x4f39e6))try{const _0x288d6c=await resolveYamlFilePath(_0x4f39e6);return _0x32b917&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x4f39e6),console['error']('\x20\x20Parent\x20segment:\x20'+_0x288d6c[_0x3b3664(0x206)]),console[_0x3b3664(0x15a)](_0x3b3664(0x1f1)+_0x288d6c[_0x3b3664(0x1d7)]),console[_0x3b3664(0x15a)](_0x3b3664(0x1e7)+(_0x288d6c[_0x3b3664(0x13f)]||'(root)'))),{'journeyName':_0x288d6c['segmentName'],'parentSegment':_0x288d6c[_0x3b3664(0x206)],'resolved':_0x288d6c};}catch(_0x335f06){throw new SDKError(ErrorCode[_0x3b3664(0x1e0)],_0x3b3664(0x20c)+_0x335f06[_0x3b3664(0x22d)]);}if(!_0x10110e)throw new SDKError(ErrorCode[_0x3b3664(0x1e0)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x4f39e6,'parentSegment':_0x10110e};}export class JourneyListCommand extends BaseCommand{[a27_0x337567(0x1bf)]='journey:list';[a27_0x337567(0x16a)]=a27_0x337567(0x1f8);async[a27_0x337567(0x1df)](_0x329380){const _0x44e708=a27_0x337567,{options:_0xd0ce,args:_0x39c0f1,tdx:_0x20baa8}=_0x329380,_0xa5d955=_0x39c0f1[0x0],_0x36e126=_0xd0ce[_0x44e708(0x206)];if(!_0x36e126)return console[_0x44e708(0x15a)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x44e708(0x15a)](_0x44e708(0x241)),0x1;const _0x2bff71=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x20baa8[_0x44e708(0x24b)][_0x44e708(0x242)](_0x36e126),{'verbose':_0xd0ce[_0x44e708(0x169)]}),_0x25759c=_0x2bff71['data'];_0xd0ce[_0x44e708(0x169)]&&(console[_0x44e708(0x15a)](_0x44e708(0x14a)+_0x36e126+_0x44e708(0x187)+_0x25759c+')'),_0xa5d955&&console[_0x44e708(0x15a)](_0x44e708(0x20a)+_0xa5d955));const _0x406799=await withSpinner(_0x44e708(0x149),()=>_0x20baa8['segment']['getParentFull'](_0x25759c),{'verbose':_0xd0ce[_0x44e708(0x169)]}),_0x1032ae=_0x406799[_0x44e708(0x1c6)],_0xd9d091=_0x1032ae[_0x44e708(0x228)],_0x4ae0a5=await withSpinner(_0x44e708(0x1c5),()=>_0x20baa8['journey'][_0x44e708(0x16b)](_0x25759c,_0xd9d091),{'verbose':_0xd0ce[_0x44e708(0x169)]});let _0x5616fa=_0x4ae0a5[_0x44e708(0x1c6)]['journeys'];const _0x5107f6=_0x4ae0a5[_0x44e708(0x1c6)][_0x44e708(0x224)],_0x28a659=new Map();for(const _0x362d18 of _0x5107f6){_0x28a659[_0x44e708(0x254)](_0x362d18['id'],_0x362d18[_0x44e708(0x1bf)]);}if(_0xa5d955){const _0x5bb101=globToRegex(_0xa5d955);_0x5616fa=_0x5616fa[_0x44e708(0x1d1)](_0x202f10=>_0x5bb101['test'](_0x202f10[_0x44e708(0x236)]));}console['error'](_0x44e708(0x252)+_0x5616fa['length']+'\x20journey'+(_0x5616fa[_0x44e708(0x163)]!==0x1?'s':''));const _0x572445=_0x160927=>{const _0x36bbe0=_0x44e708;return getConsoleNextUrl(_0xd0ce['site'],_0x36bbe0(0x24a)+_0x25759c+_0x36bbe0(0x1ed)+_0x160927+'/j/da');};if(_0xd0ce[_0x44e708(0x1ab)]===_0x44e708(0x1bb))await handleSDKOutput(_0x5616fa,_0xd0ce);else{if(_0xd0ce[_0x44e708(0x1ab)]===_0x44e708(0x215)){const _0xb15ece=_0x5616fa[_0x44e708(0x22c)](_0x3f557e=>({..._0x3f557e,'url':_0x572445(_0x3f557e['id'])}));await handleSDKOutput(_0xb15ece,_0xd0ce);}else{console[_0x44e708(0x216)]('['+_0x36e126+']');const _0x105868=new Map(),_0x18616e=[];for(const _0x5461fc of _0x5616fa){if(!_0x5461fc[_0x44e708(0x1ca)]||_0x5461fc[_0x44e708(0x1ca)]===_0xd9d091)_0x18616e[_0x44e708(0x157)](_0x5461fc);else{const _0x2d5130=_0x105868['get'](_0x5461fc['folderId'])||[];_0x2d5130[_0x44e708(0x157)](_0x5461fc),_0x105868['set'](_0x5461fc['folderId'],_0x2d5130);}}const _0x2ebaf2=(_0x4799ea,_0x1e7e53)=>_0x4799ea[_0x44e708(0x236)][_0x44e708(0x18d)](_0x1e7e53[_0x44e708(0x236)],undefined,{'sensitivity':_0x44e708(0x189)});_0x18616e[_0x44e708(0x1f5)](_0x2ebaf2);for(const _0x37c14e of _0x18616e){console[_0x44e708(0x216)](formatJourneyItem(_0x37c14e,'',_0x572445(_0x37c14e['id'])));}const _0x135254=[..._0x105868[_0x44e708(0x1c8)]()]['sort']((_0x4ead60,_0x19efa1)=>{const _0x984e23=_0x44e708,_0x170b3e=_0x28a659[_0x984e23(0x213)](_0x4ead60[0x0])||_0x4ead60[0x0],_0x45c01d=_0x28a659[_0x984e23(0x213)](_0x19efa1[0x0])||_0x19efa1[0x0];return _0x170b3e[_0x984e23(0x18d)](_0x45c01d,undefined,{'sensitivity':_0x984e23(0x189)});});for(const [_0x5adb46,_0x3a0392]of _0x135254){const _0x12c9f1=_0x28a659[_0x44e708(0x213)](_0x5adb46)||_0x5adb46;console[_0x44e708(0x216)]('📁\x20'+_0x12c9f1),_0x3a0392[_0x44e708(0x1f5)](_0x2ebaf2);for(const _0x15885b of _0x3a0392){console['log'](formatJourneyItem(_0x15885b,'\x20\x20',_0x572445(_0x15885b['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x337567(0x190);[a27_0x337567(0x16a)]=a27_0x337567(0x1d5);async[a27_0x337567(0x1df)](_0x473d9f){const _0x23cb2c=a27_0x337567,{options:_0x52daa6,args:_0x9c94e2,tdx:_0x48b569}=_0x473d9f,_0x31d65a=_0x9c94e2[0x0];if(!_0x31d65a)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x23cb2c(0x15a)](_0x23cb2c(0x1fb)),console['error']('Options:'),console['error'](_0x23cb2c(0x13d)),0x1;_0x52daa6[_0x23cb2c(0x169)]&&console[_0x23cb2c(0x15a)](_0x23cb2c(0x1f2)+_0x31d65a);const {journeyId:_0x367431,parentSegmentId:_0xe18b55}=await resolveJourneyIdFromInput(_0x31d65a,_0x52daa6,_0x48b569);if(_0x52daa6['web']){const _0x3a84b4=getConsoleNextUrl(_0x52daa6[_0x23cb2c(0x1a5)],'/app/ps/'+_0xe18b55+'/e/'+_0x367431+_0x23cb2c(0x223));return console['error'](a27_0x230dea[_0x23cb2c(0x207)]('✔')+'\x20Opening\x20'+a27_0x230dea[_0x23cb2c(0x1a4)](_0x3a84b4)),openBrowser(_0x3a84b4),0x0;}const _0x374b84=await withSpinner('Getting\x20journey\x20details...',()=>_0x48b569[_0x23cb2c(0x192)][_0x23cb2c(0x231)](_0x367431),{'verbose':_0x52daa6[_0x23cb2c(0x169)]}),_0x569aa5=_0x374b84[_0x23cb2c(0x1c6)],_0x37c4cd=_0x52daa6[_0x23cb2c(0x150)];let _0x5899d6;if(_0x37c4cd)try{const _0x3cb211=await withSpinner(_0x23cb2c(0x19c),()=>_0x48b569['journey']['getStatistics'](_0x367431),{'verbose':_0x52daa6[_0x23cb2c(0x169)]});_0x5899d6=_0x3cb211[_0x23cb2c(0x1c6)];}catch{_0x52daa6[_0x23cb2c(0x169)]&&console[_0x23cb2c(0x15a)](_0x23cb2c(0x233));}const _0x59cdea=getConsoleNextUrl(_0x52daa6[_0x23cb2c(0x1a5)],_0x23cb2c(0x24a)+_0xe18b55+_0x23cb2c(0x1ed)+_0x367431+_0x23cb2c(0x223)),_0x101854={'id':_0x569aa5['id'],'name':_0x569aa5[_0x23cb2c(0x1b4)][_0x23cb2c(0x1bf)],'description':_0x569aa5[_0x23cb2c(0x1b4)]['description'],'state':_0x569aa5['attributes'][_0x23cb2c(0x167)],'paused':_0x569aa5[_0x23cb2c(0x1b4)][_0x23cb2c(0x174)],'reentry_mode':_0x569aa5[_0x23cb2c(0x1b4)]['reentryMode'],'stages':_0x569aa5[_0x23cb2c(0x1b4)][_0x23cb2c(0x1e1)]?.[_0x23cb2c(0x163)]||0x0,..._0x569aa5[_0x23cb2c(0x1b4)][_0x23cb2c(0x246)]&&{'goal':_0x569aa5[_0x23cb2c(0x1b4)][_0x23cb2c(0x246)]['name']},..._0x5899d6&&{'statistics':{'size':_0x5899d6['size'],'entered':_0x5899d6[_0x23cb2c(0x1b5)],'goal_achieved':_0x5899d6[_0x23cb2c(0x24d)],'completion_rate':_0x5899d6[_0x23cb2c(0x165)],'exit_or_jump':_0x5899d6[_0x23cb2c(0x16d)],'exit_or_jump_rate':_0x5899d6[_0x23cb2c(0x177)],'stages':_0x5899d6[_0x23cb2c(0x211)]}},'url':_0x59cdea};return await handleSingleObjectOutput(_0x101854,_0x52daa6),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x19f);[a27_0x337567(0x16a)]=a27_0x337567(0x1f3);async['execute'](_0x53c3d1){const _0x20824f=a27_0x337567,{options:_0xe86ccf,args:_0x178720,tdx:_0xa52704}=_0x53c3d1,_0x2345b8=_0x178720[0x0];if(!requireNameOrPath(_0x2345b8))return 0x1;_0xe86ccf['verbose']&&console[_0x20824f(0x15a)](_0x20824f(0x1f2)+_0x2345b8);const _0x37ece3=_0xe86ccf,_0x48d157=_0x37ece3[_0x20824f(0x196)],_0x281509=_0x37ece3['to'],_0x189c85=_0x37ece3[_0x20824f(0x13e)],_0x53f1e9=_0x37ece3[_0x20824f(0x17b)];_0x189c85&&!_0x48d157&&!_0x281509&&console[_0x20824f(0x15a)](_0x20824f(0x1be));const _0x21674e=_0x189c85?withJsonFormat(_0xe86ccf):_0xe86ccf,{journeyId:_0x2e96cb,journeyName:_0x1740c7}=await resolveJourneyIdFromInput(_0x2345b8,_0x21674e,_0xa52704),_0x53b9c1=_0x48d157||_0x281509?{'from':_0x48d157,'to':_0x281509}:undefined,_0x5948f5=await withSpinner(_0x20824f(0x19c),()=>Promise[_0x20824f(0x1b9)]([_0xa52704[_0x20824f(0x192)][_0x20824f(0x231)](_0x2e96cb),_0xa52704[_0x20824f(0x192)]['getStatistics'](_0x2e96cb,_0x53b9c1)]),{'verbose':_0x21674e[_0x20824f(0x169)]}),[_0x4bfaa1,_0x9ef1d1]=_0x5948f5[_0x20824f(0x1c6)];if(!_0x9ef1d1||_0x9ef1d1['journeyId']===null)return console[_0x20824f(0x15a)](_0x20824f(0x184)+_0x1740c7),console[_0x20824f(0x15a)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x372e7d=buildStageNameMap(_0x4bfaa1),_0x3d5e76=!!(_0x53b9c1&&_0x9ef1d1[_0x20824f(0x23b)]?.['length']),_0x49b6b6={'stageNameMap':_0x372e7d,'hasPeriod':_0x3d5e76,'includeHistory':!!_0x189c85};if(_0x53f1e9&&_0x9ef1d1[_0x20824f(0x211)]){const _0xb8c48a=_0x9ef1d1[_0x20824f(0x211)][_0x20824f(0x204)](_0x316952=>{const _0x170e30=_0x20824f,_0x46692a=_0x372e7d[_0x170e30(0x213)](_0x316952['id'])??'';return _0x46692a[_0x170e30(0x194)]()===_0x53f1e9[_0x170e30(0x194)]();});if(_0xb8c48a)return await handleSingleObjectOutput(formatStageStats(_0xb8c48a,_0x49b6b6),_0x21674e),0x0;const _0x57e664=_0x9ef1d1[_0x20824f(0x211)]['map'](_0x3e8ed9=>_0x372e7d[_0x20824f(0x213)](_0x3e8ed9['id'])??_0x3e8ed9['id']);return console[_0x20824f(0x15a)](_0x20824f(0x13a)+_0x53f1e9+_0x20824f(0x155)),console[_0x20824f(0x15a)]('Available\x20stages:\x20'+_0x57e664[_0x20824f(0x152)](',\x20')),0x1;}const _0x2efd7e=_0x9ef1d1[_0x20824f(0x211)]?.[_0x20824f(0x22c)](_0x204d62=>formatStageStats(_0x204d62,_0x49b6b6)),_0x11010=assembleJourneyStats(_0x9ef1d1,{'from':_0x48d157,'to':_0x281509,'includeHistory':_0x189c85});return await this['renderStats'](_0x11010,_0x2efd7e??[],_0x21674e),0x0;}async[a27_0x337567(0x1eb)](_0xdcc4e4,_0x42aa3e,_0x4b468d){const _0x5b25a1=a27_0x337567,_0xb70824=_0x4b468d[_0x5b25a1(0x1ab)]===_0x5b25a1(0x215)||_0x4b468d[_0x5b25a1(0x1ab)]==='jsonl'||_0x4b468d[_0x5b25a1(0x215)]||_0x4b468d[_0x5b25a1(0x1e5)];if(_0xb70824){_0xdcc4e4['stages']=_0x42aa3e,await handleSingleObjectOutput(_0xdcc4e4,_0x4b468d);return;}await handleSingleObjectOutput(_0xdcc4e4,_0x4b468d);for(const _0x5a50e0 of _0x42aa3e){console[_0x5b25a1(0x216)](''),console[_0x5b25a1(0x216)](String(a27_0x230dea[_0x5b25a1(0x1a4)][_0x5b25a1(0x175)]('['+_0x5a50e0[_0x5b25a1(0x1bf)]+']'))+a27_0x230dea[_0x5b25a1(0x18a)]('\x20'+_0x5a50e0['id']));const {id:_0x56ec52,name:_0x286095,..._0x42bf4a}=_0x5a50e0;await handleSingleObjectOutput(_0x42bf4a,_0x4b468d);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x179);[a27_0x337567(0x16a)]=a27_0x337567(0x203);async[a27_0x337567(0x1df)](_0x3709d8){const _0x499a1e=a27_0x337567,{options:_0x24958e,args:_0xcedafe,tdx:_0x3be521}=_0x3709d8,_0x12fa9b=_0xcedafe[0x0];if(!requireNameOrPath(_0x12fa9b))return 0x1;_0x24958e[_0x499a1e(0x169)]&&console[_0x499a1e(0x15a)]('Input:\x20'+_0x12fa9b);const _0x1e375b=_0x24958e,_0x4dfd20=_0x1e375b[_0x499a1e(0x197)],_0x5a3eac=_0x1e375b[_0x499a1e(0x196)],_0xdf010=_0x1e375b['to'],_0x313c6b=_0x1e375b[_0x499a1e(0x221)];if(_0x4dfd20&&_0x4dfd20!==_0x499a1e(0x201)&&_0x4dfd20!==_0x499a1e(0x225))return console[_0x499a1e(0x15a)](_0x499a1e(0x1e4)+_0x4dfd20+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x1f3e6a=withJsonFormat(_0x24958e),{journeyId:_0x560cc9,journeyName:_0x421be0}=await resolveJourneyIdFromInput(_0x12fa9b,_0x1f3e6a,_0x3be521),_0x2a634b={'type':_0x4dfd20,'from':_0x5a3eac,'to':_0xdf010,'limit':_0x313c6b},_0x4dd60f=await withSpinner(_0x499a1e(0x159),()=>_0x3be521[_0x499a1e(0x192)][_0x499a1e(0x17c)](_0x560cc9,_0x2a634b),{'verbose':_0x1f3e6a[_0x499a1e(0x169)]}),_0xdbc6b0=_0x4dd60f[_0x499a1e(0x1c6)],_0x11147d=_0xdbc6b0['conversion']&&(_0xdbc6b0[_0x499a1e(0x201)][_0x499a1e(0x220)][_0x499a1e(0x163)]>0x0||_0xdbc6b0['conversion'][_0x499a1e(0x21a)][_0x499a1e(0x163)]>0x0),_0x2d980d=_0xdbc6b0[_0x499a1e(0x225)]&&_0xdbc6b0[_0x499a1e(0x225)][_0x499a1e(0x163)]>0x0;if(!_0x11147d&&!_0x2d980d)return console[_0x499a1e(0x15a)](_0x499a1e(0x140)+_0x421be0),console['error'](_0x499a1e(0x217)),_0x5a3eac&&_0xdf010&&console[_0x499a1e(0x15a)](_0x499a1e(0x23e)),0x0;return await handleSingleObjectOutput(_0xdbc6b0,_0x1f3e6a),0x0;}}function formatStageStats(_0x138c7a,_0x396220){const _0x5594d4=a27_0x337567,_0x4d63a5=_0x396220[_0x5594d4(0x15b)]&&_0x138c7a['history']?.[_0x5594d4(0x163)]?aggregateStageHistory(_0x138c7a[_0x5594d4(0x23b)]):{'size':_0x138c7a['size'],'entered':_0x138c7a[_0x5594d4(0x1b5)],'milestone':_0x138c7a[_0x5594d4(0x244)],'milestone_rate':_0x138c7a[_0x5594d4(0x20f)],'exit_or_jump':_0x138c7a['exitOrJumpSize'],'exit_or_jump_rate':_0x138c7a[_0x5594d4(0x177)]},_0x10c291={'id':_0x138c7a['id'],'name':_0x396220[_0x5594d4(0x1c9)][_0x5594d4(0x213)](_0x138c7a['id'])??_0x138c7a['id'],..._0x4d63a5};return _0x396220[_0x5594d4(0x15b)]&&_0x396220[_0x5594d4(0x13e)]&&_0x138c7a[_0x5594d4(0x23b)]&&(_0x10c291[_0x5594d4(0x23b)]=_0x138c7a[_0x5594d4(0x23b)]),_0x10c291;}export class JourneyPauseCommand extends BaseCommand{[a27_0x337567(0x1bf)]='journey:pause';[a27_0x337567(0x16a)]=a27_0x337567(0x21d);async[a27_0x337567(0x1df)](_0xaf8c71){const _0xab002e=a27_0x337567,{options:_0x4d66a7,args:_0x4e7ef5,tdx:_0xe2836b}=_0xaf8c71,_0xb7553=_0x4e7ef5[0x0];if(!requireNameOrPath(_0xb7553))return 0x1;_0x4d66a7[_0xab002e(0x169)]&&console[_0xab002e(0x15a)](_0xab002e(0x1f2)+_0xb7553);const {journeyId:_0x4fb4d2,journeyName:_0x282e05}=await resolveJourneyIdFromInput(_0xb7553,_0x4d66a7,_0xe2836b);if(!_0x4d66a7['yes']){const _0x31c3bf=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x282e05+'\x22?');if(!_0x31c3bf)return console[_0xab002e(0x15a)]('Cancelled'),0x0;}const _0x26bbe5=await withSpinner(_0xab002e(0x22a),()=>_0xe2836b[_0xab002e(0x192)][_0xab002e(0x1a8)](_0x4fb4d2),{'verbose':_0x4d66a7[_0xab002e(0x169)]}),_0x1aa611=_0x26bbe5[_0xab002e(0x1c6)];return console[_0xab002e(0x15a)](_0xab002e(0x1cd)+_0x1aa611[_0xab002e(0x1b4)]['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x19e);[a27_0x337567(0x16a)]=a27_0x337567(0x1fc);async[a27_0x337567(0x1df)](_0x3be8f5){const _0x4c24a7=a27_0x337567,{options:_0x311b30,args:_0x51a41d,tdx:_0x14673f}=_0x3be8f5,_0xa4609d=_0x51a41d[0x0];if(!requireNameOrPath(_0xa4609d))return 0x1;_0x311b30[_0x4c24a7(0x169)]&&console[_0x4c24a7(0x15a)](_0x4c24a7(0x1f2)+_0xa4609d);const {journeyId:_0xd4b918,journeyName:_0x3616c9}=await resolveJourneyIdFromInput(_0xa4609d,_0x311b30,_0x14673f);if(_0x311b30[_0x4c24a7(0x1de)])return await this[_0x4c24a7(0x208)](_0x3be8f5,_0xd4b918,_0x3616c9);if(!_0x311b30[_0x4c24a7(0x136)]){const _0x43de43=await confirm(_0x4c24a7(0x227)+_0x3616c9+'\x22?');if(!_0x43de43)return console[_0x4c24a7(0x15a)]('Cancelled'),0x0;}const _0x3f53ed=await withSpinner('Resuming\x20journey...',()=>_0x14673f[_0x4c24a7(0x192)][_0x4c24a7(0x1e6)](_0xd4b918),{'verbose':_0x311b30[_0x4c24a7(0x169)]}),_0x39f4ad=_0x3f53ed[_0x4c24a7(0x1c6)];return console[_0x4c24a7(0x15a)](_0x4c24a7(0x1cd)+_0x39f4ad['attributes'][_0x4c24a7(0x1bf)]+'\x22\x20resumed'),0x0;}async[a27_0x337567(0x208)](_0x5a8039,_0x235a4b,_0x5b59d6){const _0x5d34d3=a27_0x337567,{options:_0x3b2e69,tdx:_0x2d2579}=_0x5a8039,_0x54c12b=await withSpinner(_0x5d34d3(0x20d)+_0x5b59d6+_0x5d34d3(0x24f),()=>Promise['all']([_0x2d2579[_0x5d34d3(0x192)]['getJourney'](_0x235a4b),_0x2d2579[_0x5d34d3(0x192)][_0x5d34d3(0x1f9)](_0x235a4b)]),{'verbose':_0x3b2e69['verbose']}),[_0x59f946,_0x20fb3c]=_0x54c12b[_0x5d34d3(0x1c6)],_0x427c66=_0x59f946['attributes'],_0x49920e=_0x427c66['journeyStages'];console[_0x5d34d3(0x216)](a27_0x230dea[_0x5d34d3(0x175)](_0x5d34d3(0x14c)),_0x427c66[_0x5d34d3(0x1bf)]),console[_0x5d34d3(0x216)](a27_0x230dea[_0x5d34d3(0x175)](_0x5d34d3(0x166)),_0x59f946['id']),console[_0x5d34d3(0x216)](a27_0x230dea[_0x5d34d3(0x175)](_0x5d34d3(0x1b6)),_0x427c66['state']),console[_0x5d34d3(0x216)](a27_0x230dea[_0x5d34d3(0x175)](_0x5d34d3(0x1ad)),_0x427c66[_0x5d34d3(0x174)]?a27_0x230dea[_0x5d34d3(0x24c)](_0x5d34d3(0x136)):a27_0x230dea[_0x5d34d3(0x207)]('no'));_0x427c66[_0x5d34d3(0x176)]&&console[_0x5d34d3(0x216)](a27_0x230dea[_0x5d34d3(0x175)](_0x5d34d3(0x139)),_0x427c66[_0x5d34d3(0x176)]);console[_0x5d34d3(0x216)](a27_0x230dea['bold']('Parent\x20segment\x20ID:'),_0x427c66['audienceId']);const _0x44a663=_0x49920e[_0x5d34d3(0x163)]>0x0?'\x20('+_0x49920e['map'](_0x4fc0e8=>_0x4fc0e8[_0x5d34d3(0x1bf)])['join'](',\x20')+')':'';console[_0x5d34d3(0x216)](a27_0x230dea['bold'](_0x5d34d3(0x193)),''+_0x49920e[_0x5d34d3(0x163)]+_0x44a663),console['log']('');if(_0x20fb3c[_0x5d34d3(0x163)]===0x0)console['log'](a27_0x230dea['bold'](_0x5d34d3(0x1d6)),a27_0x230dea['dim'](_0x5d34d3(0x199)));else{console[_0x5d34d3(0x216)](a27_0x230dea[_0x5d34d3(0x175)](_0x5d34d3(0x1d6)));for(const _0x43abd0 of _0x20fb3c){const _0x397e2c=_0x43abd0[_0x5d34d3(0x1bf)]??_0x5d34d3(0x251),_0xebd1ab=_0x43abd0[_0x5d34d3(0x1ea)]!=null?_0x5d34d3(0x212)+_0x43abd0[_0x5d34d3(0x1ea)]:_0x5d34d3(0x22e),_0x300dd0=_0x43abd0[_0x5d34d3(0x156)]?''+_0x43abd0[_0x5d34d3(0x156)]+(_0x43abd0[_0x5d34d3(0x16f)]?_0x5d34d3(0x1b1)+_0x43abd0[_0x5d34d3(0x16f)]:''):_0x5d34d3(0x1bc),_0x24de4a=_0x43abd0['runAfterJourneyRefresh']?_0x5d34d3(0x1b0):'';console[_0x5d34d3(0x216)]('\x20\x20'+a27_0x230dea[_0x5d34d3(0x24c)](_0x5d34d3(0x1f7))+'\x20'+_0x397e2c+_0x5d34d3(0x209)+_0xebd1ab+_0x5d34d3(0x1e2)+_0x300dd0+_0x24de4a);}}return console[_0x5d34d3(0x216)](a27_0x230dea[_0x5d34d3(0x24c)](_0x5d34d3(0x1a7))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x181);[a27_0x337567(0x16a)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x337567(0x1df)](_0x50f5bc){const _0x269daf=a27_0x337567,{options:_0x1be1b6,args:_0x5e4159,tdx:_0x1e8fcf}=_0x50f5bc,_0x392b34=_0x1be1b6,_0x59c26b=_0x5e4159[0x0],_0x5e8b83=_0x59c26b&&isYamlFilePath(_0x59c26b),_0x26e4e4=await resolveTarget({'arg':_0x5e8b83?_0x59c26b:undefined,'contextParent':_0x1be1b6[_0x269daf(0x206)],'cwd':process[_0x269daf(0x186)]()});if(!isSuccessfulResolution(_0x26e4e4))return _0x26e4e4[_0x269daf(0x21c)]===_0x269daf(0x1c2)?(console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x24c)](_0x269daf(0x138))),console[_0x269daf(0x15a)](_0x269daf(0x1fa)),console[_0x269daf(0x15a)](_0x269daf(0x230)),console[_0x269daf(0x15a)](_0x269daf(0x20e)),console['error'](_0x269daf(0x1db))):(console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x210)](_0x269daf(0x23a)+_0x26e4e4['message']+'\x0a')),_0x26e4e4[_0x269daf(0x1ae)]&&console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x1a4)](_0x26e4e4[_0x269daf(0x1ae)]))),0x1;let _0x2509e5=_0x5e8b83?undefined:_0x59c26b,_0x490bb2,_0x5b8e7f;_0x26e4e4[_0x269daf(0x197)]===_0x269daf(0x14d)&&(_0x2509e5=_0x26e4e4[_0x269daf(0x151)],_0x490bb2=_0x26e4e4[_0x269daf(0x22b)],_0x5b8e7f=_0x26e4e4['folderPath']);const _0xdd427=_0x26e4e4[_0x269daf(0x1d3)],_0x140000=_0x26e4e4['targetDir'];_0x392b34[_0x269daf(0x169)]&&(console['error']('Parent\x20segment:\x20'+_0xdd427),console[_0x269daf(0x15a)](_0x269daf(0x1e3)+_0x140000),_0x2509e5&&console['error'](_0x269daf(0x1fe)+_0x2509e5),_0x490bb2&&console[_0x269daf(0x15a)](_0x269daf(0x240)+_0x490bb2),_0x5b8e7f&&console['error']('Folder\x20path:\x20'+_0x5b8e7f));const _0x2468d3=await withSpinner(_0x269daf(0x14e),()=>_0x1e8fcf[_0x269daf(0x24b)][_0x269daf(0x242)](_0xdd427),{'verbose':_0x1be1b6[_0x269daf(0x169)]}),_0x5e2b40=_0x2468d3[_0x269daf(0x1c6)],{journeys:_0x39a916,folders:_0x5067bc}=await withSpinner(_0x269daf(0x164),async()=>{const _0x42d85c=_0x269daf,[_0x1e7ca4,_0x5bcf01]=await Promise['all']([_0x1e8fcf['journey']['listJourneysFromParentSegment'](_0x5e2b40,undefined,{'includeAllVersions':!![]}),_0x1e8fcf[_0x42d85c(0x24b)][_0x42d85c(0x1a2)](_0x5e2b40)]);return{'journeys':_0x1e7ca4,'folders':_0x5bcf01};},{'verbose':_0x1be1b6[_0x269daf(0x169)]})[_0x269daf(0x14b)](_0x902138=>_0x902138[_0x269daf(0x1c6)]);let _0x393740=_0x39a916;const _0x3c7ce1=buildFolderIdToPathMap(_0x5067bc);if(_0x2509e5){const _0x102c8d=_0x393740['filter'](_0x518ae9=>_0x518ae9[_0x269daf(0x236)][_0x269daf(0x194)]()===_0x2509e5['toLowerCase']());if(_0x102c8d['length']===0x0)return console[_0x269daf(0x15a)](_0x269daf(0x158)+_0x2509e5),console[_0x269daf(0x15a)](_0x269daf(0x1c3)),0x1;_0x393740=_0x102c8d;}if(_0x5b8e7f!==undefined){const _0x5c114a=_0x393740[_0x269daf(0x1d1)](_0x1b5737=>{const _0x5de330=_0x269daf,_0x574363=_0x1b5737['folderId']?_0x3c7ce1[_0x5de330(0x213)](_0x1b5737['folderId'])||'':'';return _0x574363===_0x5b8e7f;});if(_0x5c114a[_0x269daf(0x163)]===0x0&&_0x393740['length']>0x0){console[_0x269daf(0x15a)](_0x269daf(0x248)+_0x2509e5+'\x27\x20not\x20found\x20in\x20'+(_0x5b8e7f||'root\x20folder')),console['error'](_0x269daf(0x198));for(const _0x465f39 of _0x393740){const _0x574286=_0x465f39[_0x269daf(0x1ca)]?_0x3c7ce1[_0x269daf(0x213)](_0x465f39['folderId'])||'':'';console[_0x269daf(0x15a)](_0x269daf(0x1bd)+(_0x574286||'(root)')+'/'+_0x465f39[_0x269daf(0x236)]);}return 0x1;}_0x393740=_0x5c114a;}if(_0x393740[_0x269daf(0x163)]===0x0)return console['error'](_0x269daf(0x1a1)),0x0;const _0x1ef242=new Map();for(const _0x52c078 of _0x393740){const _0x30f78c=_0x52c078[_0x269daf(0x160)];!_0x1ef242[_0x269daf(0x16c)](_0x30f78c)&&_0x1ef242['set'](_0x30f78c,[]),_0x1ef242[_0x269daf(0x213)](_0x30f78c)[_0x269daf(0x157)](_0x52c078);}for(const _0x21fd17 of _0x1ef242[_0x269daf(0x1ef)]()){_0x21fd17[_0x269daf(0x1f5)]((_0x3636a4,_0xdc6bc2)=>(_0x3636a4[_0x269daf(0x1ba)]||0x0)-(_0xdc6bc2[_0x269daf(0x1ba)]||0x0));}const _0x250d34=[],{idToEmailMap:_0x35b640,connectionIdToNameMap:_0x4d3b5f}=await withSpinner(_0x269daf(0x1cf),async()=>{const _0x13fab2=_0x269daf,[_0x5242e4,_0x118ef2]=await Promise[_0x13fab2(0x1b9)]([_0x1e8fcf[_0x13fab2(0x144)][_0x13fab2(0x170)](),_0x1e8fcf[_0x13fab2(0x21b)][_0x13fab2(0x1ce)]()]);return{'idToEmailMap':_0x5242e4,'connectionIdToNameMap':_0x118ef2};},{'verbose':_0x1be1b6[_0x269daf(0x169)]})['then'](_0x3950f6=>_0x3950f6[_0x269daf(0x1c6)]);for(const _0x3bbe46 of _0x1ef242['values']()){const _0x1b5b11=_0x3bbe46[0x0][_0x269daf(0x236)],_0x51c16d=_0x3bbe46[0x0][_0x269daf(0x1ca)],_0x7bf64f=_0x51c16d?_0x3c7ce1['get'](_0x51c16d)||'':'',_0x37ec8f=_0x7bf64f?a27_0x4c5d0c[_0x269daf(0x152)](_0x140000,_0x7bf64f):_0x140000,_0x2521f8=_0x490bb2||a27_0x4c5d0c[_0x269daf(0x152)](_0x37ec8f,sanitizeFileName(_0x1b5b11)+_0x269daf(0x205));let _0x31d619,_0x11f601;if(existsSync(_0x2521f8))try{const _0x3505b9=readFileSync(_0x2521f8,_0x269daf(0x1d4)),_0x201dcc=parseYamlString(_0x3505b9);_0x11f601=_0x201dcc,_0x31d619=buildRuleToNameMapping(_0x201dcc),_0x392b34[_0x269daf(0x169)]&&_0x31d619[_0x269daf(0x238)]>0x0&&console[_0x269daf(0x15a)]('Found\x20'+_0x31d619[_0x269daf(0x238)]+_0x269daf(0x147)+_0x1b5b11);}catch(_0x14588a){_0x392b34['verbose']&&console[_0x269daf(0x15a)](_0x269daf(0x1cb)+_0x14588a['message']);}const _0x40f59c=[],_0x31753a=new Set(),_0x3f8ae8=new Map(),_0x2ab422=new Map(),_0xe78358=new Set(),_0x3be932=new Map(),_0x27bdb1=new Map(),_0x441dc6=createJumpTargetCache();await withProgressSpinner(_0x269daf(0x161)+_0x1b5b11+_0x269daf(0x24f),async _0x436e1a=>{const _0x58116a=_0x269daf;for(const _0x37c9f6 of _0x3bbe46){const _0x2da8d1=_0x3bbe46[_0x58116a(0x163)]>0x1?_0x37c9f6[_0x58116a(0x236)]+'\x20v'+(_0x37c9f6[_0x58116a(0x1ba)]||0x1):_0x37c9f6['journeyBundleName'];_0x436e1a['setPhase'](_0x58116a(0x161)+_0x2da8d1);const _0x4b972e=await _0x1e8fcf[_0x58116a(0x192)][_0x58116a(0x231)](_0x37c9f6['id']),_0x6d0169=_0x4b972e[_0x58116a(0x1b4)]?.[_0x58116a(0x15f)],_0x111a7d={'resolveSegment':async _0x13242d=>{const _0x5fe5a4=_0x58116a;if(!_0x6d0169)return{'name':_0x13242d,'isJourneyLocal':![]};const _0x121277=_0x3f8ae8[_0x5fe5a4(0x213)](_0x13242d);if(_0x121277)return _0x121277;try{const _0x3bcd20=await _0x1e8fcf[_0x5fe5a4(0x24b)][_0x5fe5a4(0x1b7)](_0x6d0169,_0x13242d),_0x2f4381=_0x3bcd20['kind']===SEGMENT_KIND_JOURNEY;let _0x3b218b,_0x48ca87=_0x3bcd20[_0x5fe5a4(0x1bf)];if(_0x2f4381&&_0x3bcd20['rule']){const _0x4a1fe8=await segmentResponseToDef(_0x3bcd20,{'resolveSegmentName':async _0x5c3972=>{const _0x5e4815=_0x5fe5a4,_0x3b0057=_0x3f8ae8[_0x5e4815(0x213)](_0x5c3972);if(_0x3b0057)return _0x3b0057[_0x5e4815(0x1bf)];const _0x17f44c=await _0x111a7d['resolveSegment'](_0x5c3972);return _0x17f44c['name'];}}),_0x10d4a3=_0x4a1fe8[_0x5fe5a4(0x1a6)];_0x3b218b={'description':_0x3bcd20[_0x5fe5a4(0x16a)],'rule':_0x10d4a3};const _0xb36cec=serializeRule(_0x10d4a3),_0x3daa82=_0x2ab422[_0x5fe5a4(0x213)](_0xb36cec);if(_0x3daa82)_0x48ca87=_0x3daa82,_0x3b218b=undefined,_0x392b34[_0x5fe5a4(0x169)]&&console[_0x5fe5a4(0x15a)](_0x5fe5a4(0x22f)+_0x3bcd20[_0x5fe5a4(0x1bf)]+'\x20->\x20'+_0x3daa82);else{let _0x2382f8=![];if(_0x31d619){const _0x23627c=_0x31d619[_0x5fe5a4(0x213)](_0xb36cec);if(_0x23627c){const _0x33ff3f=_0x23627c[_0x5fe5a4(0x204)](_0xa2a165=>!_0x31753a[_0x5fe5a4(0x16c)](_0xa2a165));_0x33ff3f&&(_0x48ca87=_0x33ff3f,_0x31753a[_0x5fe5a4(0x17a)](_0x33ff3f),_0x2ab422[_0x5fe5a4(0x254)](_0xb36cec,_0x33ff3f),_0x2382f8=!![],_0x392b34[_0x5fe5a4(0x169)]&&console[_0x5fe5a4(0x15a)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x33ff3f+_0x5fe5a4(0x1c1)));}}if(!_0x2382f8){const _0x150587=generateJourneyLocalName(_0x3bcd20[_0x5fe5a4(0x1bf)]);_0x150587&&(_0x48ca87=_0x150587);let _0x24ffb5=_0x48ca87,_0x15926c=0x2;while(_0x31753a[_0x5fe5a4(0x16c)](_0x24ffb5)){_0x24ffb5=_0x48ca87+'_'+_0x15926c,_0x15926c++;}_0x31753a['add'](_0x24ffb5),_0x2ab422[_0x5fe5a4(0x254)](_0xb36cec,_0x24ffb5),_0x48ca87=_0x24ffb5;}}}const _0x13ff29={'name':_0x48ca87,'isJourneyLocal':_0x2f4381,'definition':_0x3b218b};return _0x3f8ae8[_0x5fe5a4(0x254)](_0x13242d,_0x13ff29),_0x13ff29;}catch(_0x12aa2f){return _0x1be1b6['verbose']&&console[_0x5fe5a4(0x15a)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x13242d+':\x20'+_0x12aa2f[_0x5fe5a4(0x22d)]),{'name':_0x13242d,'isJourneyLocal':![]};}},'resolveActivation':async _0x1afb87=>{const _0x33cdcb=_0x58116a,_0x1a8a2a=_0x3be932[_0x33cdcb(0x213)](_0x1afb87);if(_0x1a8a2a)return _0x1a8a2a;try{const _0x343fb1=await _0x1e8fcf['journey']['getActivation'](_0x37c9f6['id'],_0x1afb87),_0x18f240=journeyActivationStepToYaml(_0x343fb1,_0x35b640,_0x4d3b5f),_0x408ae7=JSON[_0x33cdcb(0x1c4)]({'name':_0x18f240['name'],'connection':_0x18f240[_0x33cdcb(0x21b)],'connector_config':_0x18f240[_0x33cdcb(0x1c7)]}),_0x467f08=_0x27bdb1[_0x33cdcb(0x213)](_0x408ae7);if(_0x467f08){const _0x42b05c={'name':_0x467f08,'isJourneyLocal':!![],'definition':_0x18f240};return _0x3be932['set'](_0x1afb87,_0x42b05c),_0x42b05c;}const _0x3aec82=_0x343fb1[_0x33cdcb(0x1b4)][_0x33cdcb(0x17e)][_0x33cdcb(0x1bf)]||_0x1afb87,_0x1027fa=sanitizeYamlKey(_0x3aec82)||_0x33cdcb(0x1a9)+_0x1afb87;let _0x15edf5=_0x1027fa,_0x5be026=0x2;while(_0xe78358[_0x33cdcb(0x16c)](_0x15edf5)){_0x15edf5=_0x1027fa+'_'+_0x5be026,_0x5be026++;}_0xe78358['add'](_0x15edf5),_0x27bdb1[_0x33cdcb(0x254)](_0x408ae7,_0x15edf5);const _0x27699a={'name':_0x15edf5,'isJourneyLocal':!![],'definition':_0x18f240};return _0x3be932['set'](_0x1afb87,_0x27699a),_0x27699a;}catch(_0x100ca8){return _0x1be1b6[_0x33cdcb(0x169)]&&console[_0x33cdcb(0x15a)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x1afb87+':\x20'+_0x100ca8[_0x33cdcb(0x22d)]),{'name':_0x1afb87,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x2bde37,_0xba496b)=>{const _0x32a06d=_0x58116a;return resolveJumpTarget(_0x2bde37,_0xba496b,_0x441dc6,_0x34697c=>_0x1e8fcf[_0x32a06d(0x192)][_0x32a06d(0x231)](_0x34697c));}},_0x46c973=await journeyResponseToDef(_0x4b972e,_0x111a7d);_0x40f59c['push']({'item':_0x37c9f6,'yaml':_0x46c973});}},{'verbose':_0x1be1b6[_0x269daf(0x169)]});const _0xfe17b4=await _0x1e8fcf['journey'][_0x269daf(0x21e)](_0x3bbe46[0x0][_0x269daf(0x160)]),_0x4f1e60=buildMergedJourneyDef(_0x40f59c,_0x31d619,_0xfe17b4),_0x1ac1ac=normalizeJourneyDef(_0x4f1e60,_0x11f601),_0x107ea1=toYamlString(_0x1ac1ac),_0x3c41cc=_0x490bb2||a27_0x4c5d0c['join'](_0x37ec8f,sanitizeFileName(_0x1b5b11)+_0x269daf(0x205));!_0x490bb2&&_0x7bf64f&&!existsSync(_0x37ec8f)&&mkdirSync(_0x37ec8f,{'recursive':!![]});const _0x4584b9=a27_0x4c5d0c[_0x269daf(0x195)](process[_0x269daf(0x186)](),_0x3c41cc);if(existsSync(_0x3c41cc)){const _0x5c1b9e=readFileSync(_0x3c41cc,_0x269daf(0x1d4)),_0x3bc95a=generateDiff(_0x5c1b9e,_0x107ea1),_0x177750=hasChanges(_0x3bc95a);_0x250d34[_0x269daf(0x157)]({'relativePath':_0x4584b9,'absolutePath':_0x3c41cc,'content':_0x107ea1,'isNew':![],'hasChanges':_0x177750,'diff':_0x177750?formatDiffWithColors(_0x3bc95a):undefined});}else _0x250d34[_0x269daf(0x157)]({'relativePath':_0x4584b9,'absolutePath':_0x3c41cc,'content':_0x107ea1,'isNew':!![],'hasChanges':![]});}const _0x23cf57=_0x250d34['filter'](_0x1e170b=>_0x1e170b['isNew']),_0x190e9d=_0x250d34[_0x269daf(0x1d1)](_0xe91bb1=>!_0xe91bb1[_0x269daf(0x168)]&&_0xe91bb1['hasChanges']),_0x207a16=_0x250d34[_0x269daf(0x1d1)](_0xf42902=>!_0xf42902[_0x269daf(0x168)]&&!_0xf42902[_0x269daf(0x1b8)]),_0x24175e=_0x393740[_0x269daf(0x163)],_0x8e87c6=_0x1ef242['size'],_0x2904da=_0x24175e>_0x8e87c6?'\x20('+_0x24175e+'\x20versions)':'';console['error'](_0x269daf(0x1f6)),console[_0x269daf(0x15a)]('\x20\x20'+a27_0x230dea[_0x269daf(0x1a4)](_0x8e87c6+_0x269daf(0x234))+a27_0x230dea['dim'](_0x2904da)),console['error']('\x20\x20'+a27_0x230dea[_0x269daf(0x207)]('+\x20'+_0x23cf57[_0x269daf(0x163)]+_0x269daf(0x1ee))),console[_0x269daf(0x15a)]('\x20\x20'+a27_0x230dea[_0x269daf(0x24c)]('~\x20'+_0x190e9d[_0x269daf(0x163)]+_0x269daf(0x145))),console[_0x269daf(0x15a)]('\x20\x20'+a27_0x230dea[_0x269daf(0x18a)]('=\x20'+_0x207a16[_0x269daf(0x163)]+'\x20unchanged\x20files')),console['error']('\x20\x20Target:\x20'+a27_0x230dea[_0x269daf(0x1a4)](_0x140000)+'\x0a');if(_0x190e9d[_0x269daf(0x163)]>0x0)for(const _0x370462 of _0x190e9d){console[_0x269daf(0x15a)]('\x0aChanges\x20to\x20\x27'+_0x370462['relativePath']+'\x27:'),console[_0x269daf(0x15a)]('─'[_0x269daf(0x191)](0x3c)),console[_0x269daf(0x15a)](_0x370462[_0x269daf(0x13b)]),console[_0x269daf(0x15a)]('─'[_0x269daf(0x191)](0x3c));}if(_0x392b34[_0x269daf(0x1de)])return console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x24c)](_0x269daf(0x202))),0x0;if(_0x23cf57['length']===0x0&&_0x190e9d['length']===0x0)return console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x207)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0xdd427},_0x392b34[_0x269daf(0x1a3)]),console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x207)](_0x269daf(0x1ec)+a27_0x230dea[_0x269daf(0x18a)](_0x269daf(0x222))+'\x20=\x20'+a27_0x230dea[_0x269daf(0x1a4)](_0xdd427))),0x0;if(!_0x392b34['yes']&&(_0x23cf57['length']>0x0||_0x190e9d[_0x269daf(0x163)]>0x0)){if(!isInteractive())return console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x210)](_0x269daf(0x18b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x18a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x384a70=await confirmKey(_0x269daf(0x250)+(_0x23cf57[_0x269daf(0x163)]+_0x190e9d['length'])+_0x269daf(0x253));if(!_0x384a70)return console[_0x269daf(0x15a)](a27_0x230dea['yellow'](_0x269daf(0x141)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x140000)&&mkdirSync(_0x140000,{'recursive':!![]});const _0x18bdd8=a27_0x4c5d0c[_0x269daf(0x152)](_0x140000,_0x269daf(0x180));writeFileSync(_0x18bdd8,createTdxConfigContent(_0xdd427),_0x269daf(0x1d4));for(const _0x5a6620 of _0x250d34){(_0x5a6620['isNew']||_0x5a6620[_0x269daf(0x1b8)])&&writeFileSync(_0x5a6620[_0x269daf(0x182)],_0x5a6620[_0x269daf(0x17f)],'utf-8');}return console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x207)](_0x269daf(0x229)+(_0x23cf57[_0x269daf(0x163)]+_0x190e9d[_0x269daf(0x163)])+_0x269daf(0x1dd)+_0x140000)),saveSessionContext({'parent_segment':_0xdd427},_0x392b34['session']),console[_0x269daf(0x15a)](a27_0x230dea[_0x269daf(0x207)](_0x269daf(0x1ec)+a27_0x230dea['dim']('parent_segment')+_0x269daf(0x219)+a27_0x230dea[_0x269daf(0x1a4)](_0xdd427))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x162);[a27_0x337567(0x16a)]=a27_0x337567(0x18f);async[a27_0x337567(0x1df)](_0x1b6aeb){const _0x290ca7=a27_0x337567,{options:_0x22d13d,args:_0x1d424c,tdx:_0x1d503b}=_0x1b6aeb,_0xeeda3a=_0x1d424c[0x0];if(!requireNameOrPath(_0xeeda3a))return 0x1;_0x22d13d['verbose']&&console[_0x290ca7(0x15a)](_0x290ca7(0x1f2)+_0xeeda3a);const {journeyId:_0x39a790}=await resolveJourneyIdFromInput(_0xeeda3a,_0x22d13d,_0x1d503b),_0x123b09=await withSpinner(_0x290ca7(0x1f0),()=>_0x1d503b[_0x290ca7(0x192)]['getColumnMapping'](_0x39a790),{'verbose':_0x22d13d[_0x290ca7(0x169)]}),_0x1a27eb=_0x123b09[_0x290ca7(0x1c6)];return console['log'](_0x290ca7(0x188)+_0x1a27eb['database']),console['log'](_0x290ca7(0x255)+_0x1a27eb[_0x290ca7(0x1bb)]),await handleSDKOutput(_0x1a27eb[_0x290ca7(0x19a)],_0x22d13d),0x0;}}function a27_0x3ba9(_0x39c74d,_0x463850){_0x39c74d=_0x39c74d-0x136;const _0x29a45a=a27_0x29a4();let _0x3ba93c=_0x29a45a[_0x39c74d];return _0x3ba93c;}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x337567(0x235);[a27_0x337567(0x16a)]=a27_0x337567(0x137);async[a27_0x337567(0x1df)](_0x2c7ec4){const _0x29b063=a27_0x337567,{options:_0x17fac8,args:_0x1b39e2,tdx:_0x3d27b6}=_0x2c7ec4,_0x2d87dc=_0x1b39e2[0x0];if(!requireNameOrPath(_0x2d87dc))return 0x1;_0x17fac8[_0x29b063(0x169)]&&console[_0x29b063(0x15a)](_0x29b063(0x1f2)+_0x2d87dc);const {journeyId:_0x1452b2}=await resolveJourneyIdFromInput(_0x2d87dc,_0x17fac8,_0x3d27b6),_0x333d24=await withSpinner(_0x29b063(0x15e),()=>_0x3d27b6[_0x29b063(0x192)][_0x29b063(0x1f9)](_0x1452b2),{'verbose':_0x17fac8['verbose']}),_0x42a30e=_0x333d24[_0x29b063(0x1c6)];return console['error'](_0x29b063(0x21f)+_0x42a30e[_0x29b063(0x163)]+_0x29b063(0x154)+(_0x42a30e[_0x29b063(0x163)]!==0x1?'s':'')),await handleSDKOutput(_0x42a30e,_0x17fac8),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x245);[a27_0x337567(0x16a)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a27_0x337567(0x1d9)]=new SegmentPushCommand();async['execute'](_0x48f536){const _0x266176=a27_0x337567,_0x538fe2=_0x48f536[_0x266176(0x243)][0x0];let _0x52403b;if(_0x538fe2){const _0x37ea6f=await resolveTarget({'arg':_0x538fe2,'contextParent':_0x48f536[_0x266176(0x14f)][_0x266176(0x206)],'cwd':process[_0x266176(0x186)]()});isSuccessfulResolution(_0x37ea6f)&&_0x37ea6f[_0x266176(0x197)]===_0x266176(0x14d)&&(_0x52403b=_0x37ea6f[_0x266176(0x22b)]);}const _0x211741={..._0x48f536,'options':{..._0x48f536[_0x266176(0x14f)],'journeysOnly':!![],..._0x52403b&&{'singleFilePath':_0x52403b}}};return this[_0x266176(0x1d9)]['execute'](_0x211741);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x1f4);['description']=a27_0x337567(0x20b);async[a27_0x337567(0x1df)](_0xb74863){const _0x154a49=a27_0x337567,{options:_0x44c4f2,args:_0x1dd388,tdx:_0x3da7ff}=_0xb74863,_0x132852=_0x1dd388[0x0];if(!requireNameOrPath(_0x132852))return 0x1;if(_0x44c4f2[_0x154a49(0x169)])console[_0x154a49(0x15a)](_0x154a49(0x1f2)+_0x132852);const {journeyId:_0x3680da}=await resolveJourneyIdFromInput(_0x132852,_0x44c4f2,_0x3da7ff),_0x2c5a80=await withSpinner(_0x154a49(0x15c),()=>_0x3da7ff[_0x154a49(0x192)][_0x154a49(0x247)](_0x3680da),{'verbose':_0x44c4f2[_0x154a49(0x169)]}),{bundleName:_0x522f14,versions:_0x191f8e,latestJourneyId:_0x5eb7fc}=_0x2c5a80['data'];console[_0x154a49(0x15a)](_0x522f14+':\x20'+_0x191f8e['length']+_0x154a49(0x1aa)+(_0x191f8e['length']!==0x1?'s':''));const _0x115d6f=_0x191f8e[_0x154a49(0x22c)](_0x546c75=>({'version':_0x546c75[_0x154a49(0x1ba)],'journey_id':_0x546c75[_0x154a49(0x218)],'name':_0x546c75[_0x154a49(0x1bf)],'state':_0x546c75[_0x154a49(0x167)],'paused':_0x546c75[_0x154a49(0x174)],'latest':_0x546c75[_0x154a49(0x218)]===_0x5eb7fc,'created_at':_0x546c75[_0x154a49(0x226)]}));return await handleSDKOutput(_0x115d6f,_0x44c4f2),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x146);[a27_0x337567(0x16a)]=a27_0x337567(0x1dc);async['execute'](_0x3fb2cd){const _0x3aa865=a27_0x337567,{options:_0x5dc9be,args:_0x10ec17,tdx:_0xd9281}=_0x3fb2cd,_0x54026e=_0x10ec17[0x0];if(!requireNameOrPath(_0x54026e))return 0x1;if(_0x5dc9be['verbose'])console[_0x3aa865(0x15a)](_0x3aa865(0x1f2)+_0x54026e);const {journeyId:_0x2eb4ac,journeyName:_0x409fec}=await resolveJourneyIdFromInput(_0x54026e,_0x5dc9be,_0xd9281);if(!_0x5dc9be[_0x3aa865(0x136)]){const _0x7e71f8=await confirm(_0x3aa865(0x15d)+_0x409fec+'\x22?');if(!_0x7e71f8)return console[_0x3aa865(0x15a)]('Cancelled'),0x0;}const _0x50d22e=await withSpinner(_0x3aa865(0x23f),()=>_0xd9281[_0x3aa865(0x192)][_0x3aa865(0x237)](_0x2eb4ac),{'verbose':_0x5dc9be['verbose']}),_0x117a0e=_0x50d22e[_0x3aa865(0x1c6)];return console[_0x3aa865(0x15a)](a27_0x230dea['green']('✔')+_0x3aa865(0x183)+_0x117a0e['attributes'][_0x3aa865(0x1ba)]+_0x3aa865(0x1c0)+_0x117a0e['attributes']['name']+'\x22'),console[_0x3aa865(0x15a)]('\x20\x20Journey\x20ID:\x20'+_0x117a0e['id']),await handleSingleObjectOutput({'id':_0x117a0e['id'],'name':_0x117a0e['attributes'][_0x3aa865(0x1bf)],'version':_0x117a0e[_0x3aa865(0x1b4)][_0x3aa865(0x1ba)],'state':_0x117a0e[_0x3aa865(0x1b4)][_0x3aa865(0x167)],'bundle_id':_0x117a0e[_0x3aa865(0x1b4)][_0x3aa865(0x160)],'created_at':_0x117a0e[_0x3aa865(0x1b4)][_0x3aa865(0x226)]},_0x5dc9be),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x337567(0x1bf)]=a27_0x337567(0x17d);[a27_0x337567(0x16a)]=a27_0x337567(0x23c);async[a27_0x337567(0x1df)](_0x43ea01){const _0x8956ee=a27_0x337567,{options:_0x484826,args:_0x2b0097,tdx:_0x111bf1}=_0x43ea01,_0x54799f=_0x2b0097[0x0];if(!requireNameOrPath(_0x54799f))return 0x1;const _0x35947e=_0x484826['version'];if(!_0x35947e)return console[_0x8956ee(0x15a)](_0x8956ee(0x18c)),console[_0x8956ee(0x15a)](_0x8956ee(0x172)),0x1;const _0x453f3b=parseInt(_0x35947e,0xa);if(isNaN(_0x453f3b)||_0x453f3b<0x1)return console[_0x8956ee(0x15a)](_0x8956ee(0x1cc)+_0x35947e),0x1;if(_0x484826[_0x8956ee(0x169)])console[_0x8956ee(0x15a)](_0x8956ee(0x1f2)+_0x54799f+_0x8956ee(0x185)+_0x453f3b);const {journeyId:_0x410801,parentSegmentId:_0x290a5f}=await resolveJourneyIdFromInput(_0x54799f,_0x484826,_0x111bf1),_0x50ea85=await withSpinner(_0x8956ee(0x23d),()=>_0x111bf1[_0x8956ee(0x192)][_0x8956ee(0x247)](_0x410801),{'verbose':_0x484826[_0x8956ee(0x169)]}),{versions:_0x462d9e,latestJourneyId:_0x8b9519}=_0x50ea85['data'],_0xb8c257=_0x462d9e[_0x8956ee(0x204)](_0x95a0a4=>_0x95a0a4[_0x8956ee(0x1ba)]===_0x453f3b);if(!_0xb8c257){const _0x364c45=_0x462d9e[_0x8956ee(0x22c)](_0x21c061=>'v'+_0x21c061['versionNumber'])['join'](',\x20');return console[_0x8956ee(0x15a)]('Error:\x20Version\x20'+_0x453f3b+_0x8956ee(0x19d)+_0x364c45),0x1;}const _0x4bc289=await withSpinner('Getting\x20version\x20'+_0x453f3b+_0x8956ee(0x142),()=>_0x111bf1['journey']['getJourney'](_0xb8c257[_0x8956ee(0x218)]),{'verbose':_0x484826[_0x8956ee(0x169)]}),_0x5ae59d=_0x4bc289[_0x8956ee(0x1c6)],_0x5c7f15=getConsoleNextUrl(_0x484826[_0x8956ee(0x1a5)],_0x8956ee(0x24a)+_0x290a5f+'/e/'+_0xb8c257[_0x8956ee(0x218)]+_0x8956ee(0x223));return await handleSingleObjectOutput({'id':_0x5ae59d['id'],'name':_0x5ae59d[_0x8956ee(0x1b4)]['name'],'version':_0x5ae59d[_0x8956ee(0x1b4)][_0x8956ee(0x1ba)],'description':_0x5ae59d[_0x8956ee(0x1b4)]['description'],'state':_0x5ae59d[_0x8956ee(0x1b4)][_0x8956ee(0x167)],'paused':_0x5ae59d[_0x8956ee(0x1b4)]['paused'],'reentry_mode':_0x5ae59d[_0x8956ee(0x1b4)][_0x8956ee(0x1d8)],'stages':_0x5ae59d['attributes'][_0x8956ee(0x1e1)]?.[_0x8956ee(0x163)]||0x0,..._0x5ae59d[_0x8956ee(0x1b4)][_0x8956ee(0x246)]&&{'goal':_0x5ae59d[_0x8956ee(0x1b4)]['goal'][_0x8956ee(0x1bf)]},'latest':_0xb8c257[_0x8956ee(0x218)]===_0x8b9519,'created_at':_0x5ae59d[_0x8956ee(0x1b4)][_0x8956ee(0x226)],'updated_at':_0x5ae59d[_0x8956ee(0x1b4)]['updatedAt'],'url':_0x5c7f15},_0x484826),0x0;}}
|
|
1
|
+
const a27_0x7e19eb=a27_0x3dc8;(function(_0x34b682,_0x4ef4ff){const _0x3dae1a=a27_0x3dc8,_0x383964=_0x34b682();while(!![]){try{const _0x5ed9b8=-parseInt(_0x3dae1a(0x238))/0x1*(-parseInt(_0x3dae1a(0x1fb))/0x2)+-parseInt(_0x3dae1a(0x21e))/0x3+parseInt(_0x3dae1a(0x19d))/0x4*(parseInt(_0x3dae1a(0x27a))/0x5)+parseInt(_0x3dae1a(0x247))/0x6*(parseInt(_0x3dae1a(0x200))/0x7)+-parseInt(_0x3dae1a(0x1c9))/0x8+parseInt(_0x3dae1a(0x1a1))/0x9*(-parseInt(_0x3dae1a(0x27c))/0xa)+-parseInt(_0x3dae1a(0x206))/0xb*(-parseInt(_0x3dae1a(0x1da))/0xc);if(_0x5ed9b8===_0x4ef4ff)break;else _0x383964['push'](_0x383964['shift']());}catch(_0x150b94){_0x383964['push'](_0x383964['shift']());}}}(a27_0x5a9b,0xa6844));import a27_0x38e41f from'chalk';import a27_0x3238b5 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a27_0x3dc8(_0x7cc8ea,_0x19b18e){_0x7cc8ea=_0x7cc8ea-0x164;const _0x5a9b2a=a27_0x5a9b();let _0x3dc8d1=_0x5a9b2a[_0x7cc8ea];return _0x3dc8d1;}import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x5c952a){const _0x33ce03=a27_0x3dc8;return!_0x5c952a&&(console[_0x33ce03(0x1a2)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x33ce03(0x1a2)](_0x33ce03(0x1e8))),!!_0x5c952a;}function withJsonFormat(_0x53bd01){const _0x38edb8=a27_0x3dc8;if(!_0x53bd01[_0x38edb8(0x26b)]&&!_0x53bd01[_0x38edb8(0x1d6)]&&!_0x53bd01[_0x38edb8(0x248)]&&!_0x53bd01[_0x38edb8(0x186)])return{..._0x53bd01,'format':_0x38edb8(0x1d6),'json':!![]};return _0x53bd01;}function formatJourneyState(_0x20eb40){const _0x22b41c=a27_0x3dc8;switch(_0x20eb40){case _0x22b41c(0x1e6):return a27_0x38e41f[_0x22b41c(0x174)](_0x22b41c(0x1e4));case _0x22b41c(0x25f):return a27_0x38e41f[_0x22b41c(0x1ee)](_0x22b41c(0x190));case _0x22b41c(0x24d):return a27_0x38e41f[_0x22b41c(0x20f)](_0x22b41c(0x1de));case _0x22b41c(0x259):return a27_0x38e41f['blue'](_0x22b41c(0x215));case _0x22b41c(0x22f):return a27_0x38e41f[_0x22b41c(0x1ee)](_0x22b41c(0x272));default:return'('+_0x20eb40+')';}}function formatJourneyItem(_0x3f952f,_0x5c976f='',_0x121428){const _0x306384=a27_0x3dc8,_0x397748=formatJourneyState(_0x3f952f['state']),_0x5a8698=_0x121428?hyperlink(_0x3f952f[_0x306384(0x1af)],_0x121428):_0x3f952f['journeyBundleName'];return _0x5c976f+'🗺️\x20'+_0x5a8698+'\x20'+_0x397748;}function escapeRegex(_0x18aa7a){const _0xb31465=a27_0x3dc8;return _0x18aa7a[_0xb31465(0x1f9)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x210dc0){const _0x5d08dc=a27_0x3dc8,_0x4b06cb=_0x210dc0[_0x5d08dc(0x201)]('*')['map'](escapeRegex);return new RegExp(_0x4b06cb[_0x5d08dc(0x19f)]('.*'),'i');}function buildRuleToNameMapping(_0x35f965){const _0x37e56d=a27_0x3dc8,_0x4ac94e=new Map();if(_0x35f965['segments'])for(const [_0x5838c8,_0x35226d]of Object[_0x37e56d(0x197)](_0x35f965[_0x37e56d(0x236)])){if(_0x35226d[_0x37e56d(0x23a)]){const _0x5186e2=serializeRule(_0x35226d['rule']),_0x196f5d=_0x4ac94e[_0x37e56d(0x23f)](_0x5186e2);_0x196f5d?_0x196f5d[_0x37e56d(0x214)](_0x5838c8):_0x4ac94e[_0x37e56d(0x1c2)](_0x5186e2,[_0x5838c8]);}}return _0x4ac94e;}async function resolveJourneyIdFromInput(_0x355602,_0x1ec704,_0x4f50ed){const _0x3a9d33=a27_0x3dc8,_0x307e4c=await resolveJourneyTarget(_0x355602,_0x1ec704[_0x3a9d33(0x279)],_0x1ec704['verbose']),_0x542fd6=_0x307e4c[_0x3a9d33(0x279)];if(!_0x542fd6)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3a9d33(0x1d9));const _0x1008c4=await withSpinner(_0x3a9d33(0x25a),()=>_0x4f50ed[_0x3a9d33(0x26e)]['resolveParentId'](_0x542fd6),{'verbose':_0x1ec704[_0x3a9d33(0x182)]}),_0x4a3008=_0x1008c4[_0x3a9d33(0x205)],_0x5604f0=await withSpinner(_0x3a9d33(0x194),()=>_0x4f50ed[_0x3a9d33(0x1d0)][_0x3a9d33(0x211)](_0x4a3008,_0x307e4c[_0x3a9d33(0x19e)]),{'verbose':_0x1ec704[_0x3a9d33(0x182)]});return{'journeyId':_0x5604f0[_0x3a9d33(0x205)],'journeyName':_0x307e4c[_0x3a9d33(0x19e)],'parentSegmentId':_0x4a3008};}async function resolveJourneyTarget(_0x1d5188,_0x413d44,_0x4913c0){const _0x21e8bb=a27_0x3dc8;if(isYamlFilePath(_0x1d5188))try{const _0x3a0bad=await resolveYamlFilePath(_0x1d5188);return _0x4913c0&&(console[_0x21e8bb(0x1a2)](_0x21e8bb(0x25d)+_0x1d5188),console[_0x21e8bb(0x1a2)](_0x21e8bb(0x27f)+_0x3a0bad[_0x21e8bb(0x279)]),console[_0x21e8bb(0x1a2)](_0x21e8bb(0x224)+_0x3a0bad[_0x21e8bb(0x1bf)]),console[_0x21e8bb(0x1a2)](_0x21e8bb(0x20a)+(_0x3a0bad[_0x21e8bb(0x228)]||_0x21e8bb(0x21d)))),{'journeyName':_0x3a0bad[_0x21e8bb(0x1bf)],'parentSegment':_0x3a0bad[_0x21e8bb(0x279)],'resolved':_0x3a0bad};}catch(_0x5e4a17){throw new SDKError(ErrorCode[_0x21e8bb(0x223)],_0x21e8bb(0x1ae)+_0x5e4a17['message']);}if(!_0x413d44)throw new SDKError(ErrorCode[_0x21e8bb(0x223)],_0x21e8bb(0x1a4));return{'journeyName':_0x1d5188,'parentSegment':_0x413d44};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x7e19eb(0x25e)]=a27_0x7e19eb(0x24e);async['execute'](_0x274ae3){const _0x76fc66=a27_0x7e19eb,{options:_0x3b8abe,args:_0x5d209a,tdx:_0xd1676d}=_0x274ae3,_0x54563b=_0x5d209a[0x0],_0x1c3321=_0x3b8abe[_0x76fc66(0x279)];if(!_0x1c3321)return console['error'](_0x76fc66(0x1dd)),console[_0x76fc66(0x1a2)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x51647b=await withSpinner(_0x76fc66(0x25a),()=>_0xd1676d[_0x76fc66(0x26e)][_0x76fc66(0x270)](_0x1c3321),{'verbose':_0x3b8abe['verbose']}),_0x5cbeaf=_0x51647b['data'];_0x3b8abe[_0x76fc66(0x182)]&&(console[_0x76fc66(0x1a2)]('Parent\x20segment:\x20'+_0x1c3321+_0x76fc66(0x1be)+_0x5cbeaf+')'),_0x54563b&&console[_0x76fc66(0x1a2)]('Pattern:\x20'+_0x54563b));const _0x9124d=await withSpinner('Fetching\x20parent\x20segment...',()=>_0xd1676d[_0x76fc66(0x26e)][_0x76fc66(0x1bc)](_0x5cbeaf),{'verbose':_0x3b8abe[_0x76fc66(0x182)]}),_0x1b792e=_0x9124d[_0x76fc66(0x205)],_0x3f9dc8=_0x1b792e[_0x76fc66(0x1ba)],_0x26a221=await withSpinner(_0x76fc66(0x22b),()=>_0xd1676d[_0x76fc66(0x1d0)][_0x76fc66(0x1d3)](_0x5cbeaf,_0x3f9dc8),{'verbose':_0x3b8abe[_0x76fc66(0x182)]});let _0xc6de7d=_0x26a221[_0x76fc66(0x205)][_0x76fc66(0x18e)];const _0x1db2e3=_0x26a221[_0x76fc66(0x205)][_0x76fc66(0x262)],_0x49af6d=new Map();for(const _0x386054 of _0x1db2e3){_0x49af6d[_0x76fc66(0x1c2)](_0x386054['id'],_0x386054[_0x76fc66(0x18f)]);}if(_0x54563b){const _0x501105=globToRegex(_0x54563b);_0xc6de7d=_0xc6de7d[_0x76fc66(0x1cf)](_0x504e0f=>_0x501105[_0x76fc66(0x1dc)](_0x504e0f[_0x76fc66(0x1af)]));}console[_0x76fc66(0x1a2)]('✔\x20Found\x20'+_0xc6de7d[_0x76fc66(0x216)]+_0x76fc66(0x185)+(_0xc6de7d['length']!==0x1?'s':''));const _0x471c88=_0x3ab96e=>{const _0x113669=_0x76fc66;return getConsoleNextUrl(_0x3b8abe[_0x113669(0x277)],'/app/ps/'+_0x5cbeaf+'/e/'+_0x3ab96e+_0x113669(0x1f6));};if(_0x3b8abe['format']===_0x76fc66(0x1b1))await handleSDKOutput(_0xc6de7d,_0x3b8abe);else{if(_0x3b8abe[_0x76fc66(0x26b)]===_0x76fc66(0x1d6)){const _0x29193d=_0xc6de7d[_0x76fc66(0x1e2)](_0x272654=>({..._0x272654,'url':_0x471c88(_0x272654['id'])}));await handleSDKOutput(_0x29193d,_0x3b8abe);}else{console[_0x76fc66(0x171)]('['+_0x1c3321+']');const _0x358e0d=new Map(),_0x24bc12=[];for(const _0x5db413 of _0xc6de7d){if(!_0x5db413[_0x76fc66(0x18a)]||_0x5db413['folderId']===_0x3f9dc8)_0x24bc12[_0x76fc66(0x214)](_0x5db413);else{const _0xf85b91=_0x358e0d[_0x76fc66(0x23f)](_0x5db413[_0x76fc66(0x18a)])||[];_0xf85b91[_0x76fc66(0x214)](_0x5db413),_0x358e0d[_0x76fc66(0x1c2)](_0x5db413[_0x76fc66(0x18a)],_0xf85b91);}}const _0x382a17=(_0x5832a8,_0x1cbe2b)=>_0x5832a8[_0x76fc66(0x1af)][_0x76fc66(0x266)](_0x1cbe2b[_0x76fc66(0x1af)],undefined,{'sensitivity':_0x76fc66(0x16f)});_0x24bc12[_0x76fc66(0x235)](_0x382a17);for(const _0x15db29 of _0x24bc12){console[_0x76fc66(0x171)](formatJourneyItem(_0x15db29,'',_0x471c88(_0x15db29['id'])));}const _0x4b5c0f=[..._0x358e0d[_0x76fc66(0x197)]()]['sort']((_0x2c68d8,_0x56461b)=>{const _0x48a801=_0x76fc66,_0x7e4883=_0x49af6d[_0x48a801(0x23f)](_0x2c68d8[0x0])||_0x2c68d8[0x0],_0x5745b2=_0x49af6d['get'](_0x56461b[0x0])||_0x56461b[0x0];return _0x7e4883[_0x48a801(0x266)](_0x5745b2,undefined,{'sensitivity':_0x48a801(0x16f)});});for(const [_0x1d950b,_0x206005]of _0x4b5c0f){const _0x269d95=_0x49af6d[_0x76fc66(0x23f)](_0x1d950b)||_0x1d950b;console[_0x76fc66(0x171)](_0x76fc66(0x1a3)+_0x269d95),_0x206005['sort'](_0x382a17);for(const _0x498d3e of _0x206005){console['log'](formatJourneyItem(_0x498d3e,'\x20\x20',_0x471c88(_0x498d3e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x7e19eb(0x19b);[a27_0x7e19eb(0x25e)]='Show\x20journey\x20details';async[a27_0x7e19eb(0x21c)](_0x41e444){const _0x315f12=a27_0x7e19eb,{options:_0x1975ca,args:_0x519ee6,tdx:_0x14ffb4}=_0x41e444,_0x3021fc=_0x519ee6[0x0];if(!_0x3021fc)return console[_0x315f12(0x1a2)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x315f12(0x1a2)](_0x315f12(0x219)),console[_0x315f12(0x1a2)](_0x315f12(0x173)),console[_0x315f12(0x1a2)](_0x315f12(0x26c)),0x1;_0x1975ca[_0x315f12(0x182)]&&console[_0x315f12(0x1a2)](_0x315f12(0x17e)+_0x3021fc);const {journeyId:_0x4c0fc0,parentSegmentId:_0x3a7f27}=await resolveJourneyIdFromInput(_0x3021fc,_0x1975ca,_0x14ffb4);if(_0x1975ca[_0x315f12(0x1c5)]){const _0x562122=getConsoleNextUrl(_0x1975ca[_0x315f12(0x277)],_0x315f12(0x1d2)+_0x3a7f27+_0x315f12(0x212)+_0x4c0fc0+_0x315f12(0x176));return console[_0x315f12(0x1a2)](a27_0x38e41f[_0x315f12(0x174)]('✔')+'\x20Opening\x20'+a27_0x38e41f['cyan'](_0x562122)),openBrowser(_0x562122),0x0;}const _0x47ebee=await withSpinner(_0x315f12(0x1f0),()=>_0x14ffb4[_0x315f12(0x1d0)][_0x315f12(0x19c)](_0x4c0fc0),{'verbose':_0x1975ca['verbose']}),_0x25f3f5=_0x47ebee['data'],_0x16f23a=_0x1975ca[_0x315f12(0x221)];let _0x5972f4;if(_0x16f23a)try{const _0x181993=await withSpinner(_0x315f12(0x17b),()=>_0x14ffb4[_0x315f12(0x1d0)][_0x315f12(0x165)](_0x4c0fc0),{'verbose':_0x1975ca['verbose']});_0x5972f4=_0x181993['data'];}catch{_0x1975ca[_0x315f12(0x182)]&&console['error'](_0x315f12(0x19a));}const _0x4621af=getConsoleNextUrl(_0x1975ca['site'],'/app/ps/'+_0x3a7f27+_0x315f12(0x212)+_0x4c0fc0+'/j/da/je'),_0x5e9b71={'id':_0x25f3f5['id'],'name':_0x25f3f5[_0x315f12(0x1d7)][_0x315f12(0x18f)],'description':_0x25f3f5['attributes']['description'],'state':_0x25f3f5['attributes'][_0x315f12(0x18d)],'paused':_0x25f3f5[_0x315f12(0x1d7)]['paused'],'reentry_mode':_0x25f3f5[_0x315f12(0x1d7)]['reentryMode'],'stages':_0x25f3f5[_0x315f12(0x1d7)][_0x315f12(0x199)]?.[_0x315f12(0x216)]||0x0,..._0x25f3f5['attributes']['goal']&&{'goal':_0x25f3f5[_0x315f12(0x1d7)]['goal'][_0x315f12(0x18f)]},..._0x5972f4&&{'statistics':{'size':_0x5972f4['size'],'entered':_0x5972f4[_0x315f12(0x209)],'goal_achieved':_0x5972f4[_0x315f12(0x25c)],'completion_rate':_0x5972f4[_0x315f12(0x1a5)],'exit_or_jump':_0x5972f4[_0x315f12(0x258)],'exit_or_jump_rate':_0x5972f4['exitOrJumpRate'],'stages':_0x5972f4['stages']}},'url':_0x4621af};return await handleSingleObjectOutput(_0x5e9b71,_0x1975ca),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]=a27_0x7e19eb(0x254);[a27_0x7e19eb(0x25e)]=a27_0x7e19eb(0x1fd);async[a27_0x7e19eb(0x21c)](_0xc0afd2){const _0x37d6d4=a27_0x7e19eb,{options:_0x8ce67,args:_0x1af95a,tdx:_0x197f26}=_0xc0afd2,_0x59d5c3=_0x1af95a[0x0];if(!requireNameOrPath(_0x59d5c3))return 0x1;_0x8ce67['verbose']&&console[_0x37d6d4(0x1a2)](_0x37d6d4(0x17e)+_0x59d5c3);const _0x1237b4=_0x8ce67,_0x4af6f5=_0x1237b4[_0x37d6d4(0x172)],_0x12b255=_0x1237b4['to'],_0x2e7ef7=_0x1237b4[_0x37d6d4(0x280)],_0x13eef6=_0x1237b4[_0x37d6d4(0x180)];_0x2e7ef7&&!_0x4af6f5&&!_0x12b255&&console[_0x37d6d4(0x1a2)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x213909=_0x2e7ef7?withJsonFormat(_0x8ce67):_0x8ce67,{journeyId:_0x273174,journeyName:_0x566c9a}=await resolveJourneyIdFromInput(_0x59d5c3,_0x213909,_0x197f26),_0x4b6c78=_0x4af6f5||_0x12b255?{'from':_0x4af6f5,'to':_0x12b255}:undefined,_0x4ff136=await withSpinner(_0x37d6d4(0x17b),()=>Promise[_0x37d6d4(0x175)]([_0x197f26[_0x37d6d4(0x1d0)][_0x37d6d4(0x19c)](_0x273174),_0x197f26['journey']['getStatistics'](_0x273174,_0x4b6c78)]),{'verbose':_0x213909[_0x37d6d4(0x182)]}),[_0x3df091,_0x2f38cd]=_0x4ff136[_0x37d6d4(0x205)];if(!_0x2f38cd||_0x2f38cd['journeyId']===null)return console[_0x37d6d4(0x1a2)](_0x37d6d4(0x287)+_0x566c9a),console[_0x37d6d4(0x1a2)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x50b019=buildStageNameMap(_0x3df091),_0x14588e=!!(_0x4b6c78&&_0x2f38cd['history']?.['length']),_0x3d3010={'stageNameMap':_0x50b019,'hasPeriod':_0x14588e,'includeHistory':!!_0x2e7ef7};if(_0x13eef6&&_0x2f38cd[_0x37d6d4(0x1f1)]){const _0x5de5ae=_0x2f38cd[_0x37d6d4(0x1f1)][_0x37d6d4(0x1b6)](_0x4a8bcf=>{const _0x3376a6=_0x37d6d4,_0xa5aac9=_0x50b019[_0x3376a6(0x23f)](_0x4a8bcf['id'])??'';return _0xa5aac9[_0x3376a6(0x21a)]()===_0x13eef6[_0x3376a6(0x21a)]();});if(_0x5de5ae)return await handleSingleObjectOutput(formatStageStats(_0x5de5ae,_0x3d3010),_0x213909),0x0;const _0x237f6b=_0x2f38cd[_0x37d6d4(0x1f1)][_0x37d6d4(0x1e2)](_0x460664=>_0x50b019['get'](_0x460664['id'])??_0x460664['id']);return console[_0x37d6d4(0x1a2)]('Error:\x20Stage\x20\x22'+_0x13eef6+_0x37d6d4(0x1a6)),console[_0x37d6d4(0x1a2)](_0x37d6d4(0x179)+_0x237f6b['join'](',\x20')),0x1;}const _0x39a771=_0x2f38cd[_0x37d6d4(0x1f1)]?.[_0x37d6d4(0x1e2)](_0x3fc544=>formatStageStats(_0x3fc544,_0x3d3010)),_0x231121=assembleJourneyStats(_0x2f38cd,{'from':_0x4af6f5,'to':_0x12b255,'includeHistory':_0x2e7ef7});return await this[_0x37d6d4(0x281)](_0x231121,_0x39a771??[],_0x213909),0x0;}async['renderStats'](_0x12d4e4,_0xdd5894,_0x1c293d){const _0x2a886e=a27_0x7e19eb,_0x4dac1f=_0x1c293d[_0x2a886e(0x26b)]===_0x2a886e(0x1d6)||_0x1c293d[_0x2a886e(0x26b)]==='jsonl'||_0x1c293d[_0x2a886e(0x1d6)]||_0x1c293d[_0x2a886e(0x248)];if(_0x4dac1f){_0x12d4e4[_0x2a886e(0x1f1)]=_0xdd5894,await handleSingleObjectOutput(_0x12d4e4,_0x1c293d);return;}await handleSingleObjectOutput(_0x12d4e4,_0x1c293d);for(const _0x1e5ed5 of _0xdd5894){console[_0x2a886e(0x171)](''),console[_0x2a886e(0x171)](String(a27_0x38e41f[_0x2a886e(0x26f)]['bold']('['+_0x1e5ed5[_0x2a886e(0x18f)]+']'))+a27_0x38e41f[_0x2a886e(0x1ee)]('\x20'+_0x1e5ed5['id']));const {id:_0x28137d,name:_0x554e8d,..._0x4d797e}=_0x1e5ed5;await handleSingleObjectOutput(_0x4d797e,_0x1c293d);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]=a27_0x7e19eb(0x1e7);['description']=a27_0x7e19eb(0x28a);async[a27_0x7e19eb(0x21c)](_0x53a279){const _0x1ac243=a27_0x7e19eb,{options:_0x270756,args:_0x5c759d,tdx:_0x344c52}=_0x53a279,_0x1dda1c=_0x5c759d[0x0];if(!requireNameOrPath(_0x1dda1c))return 0x1;_0x270756['verbose']&&console[_0x1ac243(0x1a2)](_0x1ac243(0x17e)+_0x1dda1c);const _0x5b4b48=_0x270756,_0x447eb7=_0x5b4b48[_0x1ac243(0x18b)],_0x2e3bdd=_0x5b4b48[_0x1ac243(0x172)],_0x2d40e6=_0x5b4b48['to'],_0x280ac8=_0x5b4b48['limit'];if(_0x447eb7&&_0x447eb7!==_0x1ac243(0x24c)&&_0x447eb7!==_0x1ac243(0x283))return console['error'](_0x1ac243(0x1ca)+_0x447eb7+_0x1ac243(0x1c3)),0x1;const _0x3efd80=withJsonFormat(_0x270756),{journeyId:_0x4da6fb,journeyName:_0x12a2f9}=await resolveJourneyIdFromInput(_0x1dda1c,_0x3efd80,_0x344c52),_0xa4274e={'type':_0x447eb7,'from':_0x2e3bdd,'to':_0x2d40e6,'limit':_0x280ac8},_0x2ba93f=await withSpinner(_0x1ac243(0x1b3),()=>_0x344c52[_0x1ac243(0x1d0)][_0x1ac243(0x1ec)](_0x4da6fb,_0xa4274e),{'verbose':_0x3efd80['verbose']}),_0x38590b=_0x2ba93f[_0x1ac243(0x205)],_0x29f6fd=_0x38590b[_0x1ac243(0x24c)]&&(_0x38590b[_0x1ac243(0x24c)][_0x1ac243(0x20e)]['length']>0x0||_0x38590b[_0x1ac243(0x24c)][_0x1ac243(0x1c6)][_0x1ac243(0x216)]>0x0),_0x56b242=_0x38590b['activation']&&_0x38590b['activation'][_0x1ac243(0x216)]>0x0;if(!_0x29f6fd&&!_0x56b242)return console['error'](_0x1ac243(0x1ad)+_0x12a2f9),console[_0x1ac243(0x1a2)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x2e3bdd&&_0x2d40e6&&console['error'](_0x1ac243(0x22c)),0x0;return await handleSingleObjectOutput(_0x38590b,_0x3efd80),0x0;}}function formatStageStats(_0x5e914e,_0x41d1eb){const _0x6ab7e3=a27_0x7e19eb,_0x2b4df9=_0x41d1eb['hasPeriod']&&_0x5e914e[_0x6ab7e3(0x271)]?.[_0x6ab7e3(0x216)]?aggregateStageHistory(_0x5e914e[_0x6ab7e3(0x271)]):{'size':_0x5e914e['size'],'entered':_0x5e914e[_0x6ab7e3(0x209)],'milestone':_0x5e914e[_0x6ab7e3(0x188)],'milestone_rate':_0x5e914e[_0x6ab7e3(0x1a0)],'exit_or_jump':_0x5e914e[_0x6ab7e3(0x258)],'exit_or_jump_rate':_0x5e914e['exitOrJumpRate']},_0x3dbaf1={'id':_0x5e914e['id'],'name':_0x41d1eb['stageNameMap']['get'](_0x5e914e['id'])??_0x5e914e['id'],..._0x2b4df9};return _0x41d1eb['hasPeriod']&&_0x41d1eb['includeHistory']&&_0x5e914e[_0x6ab7e3(0x271)]&&(_0x3dbaf1[_0x6ab7e3(0x271)]=_0x5e914e[_0x6ab7e3(0x271)]),_0x3dbaf1;}export class JourneyPauseCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]='journey:pause';[a27_0x7e19eb(0x25e)]=a27_0x7e19eb(0x22d);async[a27_0x7e19eb(0x21c)](_0x44cf98){const _0x2fbc90=a27_0x7e19eb,{options:_0x36fd55,args:_0x1b0df8,tdx:_0x4833bd}=_0x44cf98,_0x2a54e1=_0x1b0df8[0x0];if(!requireNameOrPath(_0x2a54e1))return 0x1;_0x36fd55[_0x2fbc90(0x182)]&&console[_0x2fbc90(0x1a2)](_0x2fbc90(0x17e)+_0x2a54e1);const {journeyId:_0x3222df,journeyName:_0x1ccaf4}=await resolveJourneyIdFromInput(_0x2a54e1,_0x36fd55,_0x4833bd);if(!_0x36fd55[_0x2fbc90(0x23d)]){const _0x3ccd35=await confirm(_0x2fbc90(0x166)+_0x1ccaf4+'\x22?');if(!_0x3ccd35)return console[_0x2fbc90(0x1a2)]('Cancelled'),0x0;}const _0x6adba=await withSpinner(_0x2fbc90(0x16c),()=>_0x4833bd[_0x2fbc90(0x1d0)][_0x2fbc90(0x1bd)](_0x3222df),{'verbose':_0x36fd55['verbose']}),_0x2bc692=_0x6adba['data'];return console[_0x2fbc90(0x1a2)](_0x2fbc90(0x1b2)+_0x2bc692[_0x2fbc90(0x1d7)]['name']+_0x2fbc90(0x1f8)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]='journey:resume';[a27_0x7e19eb(0x25e)]='Resume\x20a\x20paused\x20journey';async['execute'](_0x3dfd66){const _0x363c5e=a27_0x7e19eb,{options:_0x48d258,args:_0x2b7370,tdx:_0x3cf1dc}=_0x3dfd66,_0x51c498=_0x2b7370[0x0];if(!requireNameOrPath(_0x51c498))return 0x1;_0x48d258['verbose']&&console[_0x363c5e(0x1a2)](_0x363c5e(0x17e)+_0x51c498);const {journeyId:_0x223f6f,journeyName:_0x4ea6ff}=await resolveJourneyIdFromInput(_0x51c498,_0x48d258,_0x3cf1dc);if(_0x48d258[_0x363c5e(0x202)])return await this[_0x363c5e(0x193)](_0x3dfd66,_0x223f6f,_0x4ea6ff);if(!_0x48d258[_0x363c5e(0x23d)]){const _0x3ccbc5=await confirm(_0x363c5e(0x183)+_0x4ea6ff+'\x22?');if(!_0x3ccbc5)return console[_0x363c5e(0x1a2)](_0x363c5e(0x1f2)),0x0;}const _0x4ef7a4=await withSpinner(_0x363c5e(0x208),()=>_0x3cf1dc[_0x363c5e(0x1d0)][_0x363c5e(0x244)](_0x223f6f),{'verbose':_0x48d258[_0x363c5e(0x182)]}),_0x201690=_0x4ef7a4[_0x363c5e(0x205)];return console[_0x363c5e(0x1a2)](_0x363c5e(0x1b2)+_0x201690[_0x363c5e(0x1d7)][_0x363c5e(0x18f)]+_0x363c5e(0x1f4)),0x0;}async[a27_0x7e19eb(0x193)](_0x2dfb34,_0x4332ac,_0x4bc335){const _0x36fe03=a27_0x7e19eb,{options:_0x220756,tdx:_0x532569}=_0x2dfb34,_0xd300f=await withSpinner('Fetching\x20journey\x20'+_0x4bc335+_0x36fe03(0x1cc),()=>Promise[_0x36fe03(0x175)]([_0x532569[_0x36fe03(0x1d0)][_0x36fe03(0x19c)](_0x4332ac),_0x532569[_0x36fe03(0x1d0)][_0x36fe03(0x225)](_0x4332ac)]),{'verbose':_0x220756[_0x36fe03(0x182)]}),[_0x444315,_0x4506a6]=_0xd300f['data'],_0xfc834a=_0x444315[_0x36fe03(0x1d7)],_0x334be1=_0xfc834a[_0x36fe03(0x199)];console[_0x36fe03(0x171)](a27_0x38e41f[_0x36fe03(0x1a9)](_0x36fe03(0x27b)),_0xfc834a['name']),console[_0x36fe03(0x171)](a27_0x38e41f['bold'](_0x36fe03(0x252)),_0x444315['id']),console[_0x36fe03(0x171)](a27_0x38e41f['bold'](_0x36fe03(0x1fe)),_0xfc834a[_0x36fe03(0x18d)]),console['log'](a27_0x38e41f[_0x36fe03(0x1a9)](_0x36fe03(0x1cd)),_0xfc834a[_0x36fe03(0x24d)]?a27_0x38e41f[_0x36fe03(0x20f)](_0x36fe03(0x23d)):a27_0x38e41f[_0x36fe03(0x174)]('no'));_0xfc834a[_0x36fe03(0x27e)]&&console['log'](a27_0x38e41f[_0x36fe03(0x1a9)](_0x36fe03(0x267)),_0xfc834a[_0x36fe03(0x27e)]);console[_0x36fe03(0x171)](a27_0x38e41f[_0x36fe03(0x1a9)](_0x36fe03(0x288)),_0xfc834a[_0x36fe03(0x1ea)]);const _0x130398=_0x334be1[_0x36fe03(0x216)]>0x0?'\x20('+_0x334be1[_0x36fe03(0x1e2)](_0x75bce=>_0x75bce[_0x36fe03(0x18f)])[_0x36fe03(0x19f)](',\x20')+')':'';console['log'](a27_0x38e41f[_0x36fe03(0x1a9)](_0x36fe03(0x1b8)),''+_0x334be1['length']+_0x130398),console[_0x36fe03(0x171)]('');if(_0x4506a6[_0x36fe03(0x216)]===0x0)console['log'](a27_0x38e41f['bold'](_0x36fe03(0x24f)),a27_0x38e41f[_0x36fe03(0x1ee)](_0x36fe03(0x273)));else{console[_0x36fe03(0x171)](a27_0x38e41f[_0x36fe03(0x1a9)]('Activations:'));for(const _0xab413d of _0x4506a6){const _0x4af4c4=_0xab413d['name']??'(unnamed)',_0x5a14fd=_0xab413d['connectionId']!=null?'connection\x20'+_0xab413d['connectionId']:_0x36fe03(0x218),_0x111a6a=_0xab413d['scheduleType']?''+_0xab413d[_0x36fe03(0x28b)]+(_0xab413d[_0x36fe03(0x207)]?_0x36fe03(0x1ab)+_0xab413d['runAt']:''):_0x36fe03(0x213),_0x4cf17c=_0xab413d[_0x36fe03(0x239)]?'\x20[runs\x20on\x20refresh]':'';console[_0x36fe03(0x171)]('\x20\x20'+a27_0x38e41f[_0x36fe03(0x20f)](_0x36fe03(0x1b5))+'\x20'+_0x4af4c4+_0x36fe03(0x278)+_0x5a14fd+_0x36fe03(0x23e)+_0x111a6a+_0x4cf17c);}}return console[_0x36fe03(0x171)](a27_0x38e41f['yellow'](_0x36fe03(0x22e))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]=a27_0x7e19eb(0x181);['description']=a27_0x7e19eb(0x253);async[a27_0x7e19eb(0x21c)](_0x514dc1){const _0xbf440e=a27_0x7e19eb,{options:_0x5e881c,args:_0x29a9cd,tdx:_0x3d0bc4}=_0x514dc1,_0x1cf8d6=_0x5e881c,_0x279727=_0x29a9cd[0x0],_0x39ccaf=_0x279727&&isYamlFilePath(_0x279727),_0x1a536d=await resolveTarget({'arg':_0x39ccaf?_0x279727:undefined,'contextParent':_0x5e881c['parentSegment'],'cwd':process[_0xbf440e(0x242)]()});if(!isSuccessfulResolution(_0x1a536d))return _0x1a536d[_0xbf440e(0x1ff)]===_0xbf440e(0x1ce)?(console[_0xbf440e(0x1a2)](a27_0x38e41f['yellow'](_0xbf440e(0x178))),console[_0xbf440e(0x1a2)](_0xbf440e(0x164)),console['error'](_0xbf440e(0x187)),console[_0xbf440e(0x1a2)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0xbf440e(0x1a2)](_0xbf440e(0x1e9))):(console['error'](a27_0x38e41f['red'](_0xbf440e(0x1d8)+_0x1a536d[_0xbf440e(0x1d1)]+'\x0a')),_0x1a536d[_0xbf440e(0x1e5)]&&console[_0xbf440e(0x1a2)](a27_0x38e41f[_0xbf440e(0x26f)](_0x1a536d[_0xbf440e(0x1e5)]))),0x1;let _0x1b053c=_0x39ccaf?undefined:_0x279727,_0x11524a,_0x5e42df;_0x1a536d[_0xbf440e(0x18b)]==='file'&&(_0x1b053c=_0x1a536d['resourceName'],_0x11524a=_0x1a536d[_0xbf440e(0x18c)],_0x5e42df=_0x1a536d['folderPath']);const _0x40a5b6=_0x1a536d[_0xbf440e(0x198)],_0x2f50c0=_0x1a536d[_0xbf440e(0x25b)];_0x1cf8d6[_0xbf440e(0x182)]&&(console['error']('Parent\x20segment:\x20'+_0x40a5b6),console['error'](_0xbf440e(0x26d)+_0x2f50c0),_0x1b053c&&console[_0xbf440e(0x1a2)]('Journey\x20name:\x20'+_0x1b053c),_0x11524a&&console[_0xbf440e(0x1a2)](_0xbf440e(0x269)+_0x11524a),_0x5e42df&&console[_0xbf440e(0x1a2)](_0xbf440e(0x232)+_0x5e42df));const _0xc92352=await withSpinner(_0xbf440e(0x25a),()=>_0x3d0bc4[_0xbf440e(0x26e)][_0xbf440e(0x270)](_0x40a5b6),{'verbose':_0x5e881c[_0xbf440e(0x182)]}),_0x4a6881=_0xc92352[_0xbf440e(0x205)],{journeys:_0x4066cb,folders:_0xa10ab1}=await withSpinner(_0xbf440e(0x167),async()=>{const _0x3b4e1a=_0xbf440e,[_0x521aa5,_0x5d35bd]=await Promise[_0x3b4e1a(0x175)]([_0x3d0bc4['journey']['listJourneysFromParentSegment'](_0x4a6881,undefined,{'includeAllVersions':!![]}),_0x3d0bc4[_0x3b4e1a(0x26e)][_0x3b4e1a(0x268)](_0x4a6881)]);return{'journeys':_0x521aa5,'folders':_0x5d35bd};},{'verbose':_0x5e881c[_0xbf440e(0x182)]})[_0xbf440e(0x1ed)](_0x23e169=>_0x23e169['data']);let _0x2b4973=_0x4066cb;const _0x3073ad=buildFolderIdToPathMap(_0xa10ab1);if(_0x1b053c){const _0xd8b566=_0x2b4973[_0xbf440e(0x1cf)](_0x37efb4=>_0x37efb4[_0xbf440e(0x1af)][_0xbf440e(0x21a)]()===_0x1b053c['toLowerCase']());if(_0xd8b566[_0xbf440e(0x216)]===0x0)return console[_0xbf440e(0x1a2)]('Error:\x20Journey\x20not\x20found:\x20'+_0x1b053c),console[_0xbf440e(0x1a2)](_0xbf440e(0x21f)),0x1;_0x2b4973=_0xd8b566;}if(_0x5e42df!==undefined){const _0x2b4d88=_0x2b4973['filter'](_0x3dca49=>{const _0x597378=_0xbf440e,_0x15892f=_0x3dca49[_0x597378(0x18a)]?_0x3073ad['get'](_0x3dca49[_0x597378(0x18a)])||'':'';return _0x15892f===_0x5e42df;});if(_0x2b4d88['length']===0x0&&_0x2b4973['length']>0x0){console[_0xbf440e(0x1a2)](_0xbf440e(0x16e)+_0x1b053c+'\x27\x20not\x20found\x20in\x20'+(_0x5e42df||_0xbf440e(0x1eb))),console['error'](_0xbf440e(0x233));for(const _0x58788a of _0x2b4973){const _0x3e4813=_0x58788a[_0xbf440e(0x18a)]?_0x3073ad['get'](_0x58788a['folderId'])||'':'';console[_0xbf440e(0x1a2)]('\x20\x20-\x20'+(_0x3e4813||_0xbf440e(0x21d))+'/'+_0x58788a[_0xbf440e(0x1af)]);}return 0x1;}_0x2b4973=_0x2b4d88;}if(_0x2b4973[_0xbf440e(0x216)]===0x0)return console[_0xbf440e(0x1a2)](_0xbf440e(0x24b)),0x0;const _0x1991fd=new Map();for(const _0x1974db of _0x2b4973){const _0x280f4a=_0x1974db[_0xbf440e(0x1b0)];!_0x1991fd[_0xbf440e(0x1ef)](_0x280f4a)&&_0x1991fd['set'](_0x280f4a,[]),_0x1991fd[_0xbf440e(0x23f)](_0x280f4a)[_0xbf440e(0x214)](_0x1974db);}for(const _0x439152 of _0x1991fd[_0xbf440e(0x230)]()){_0x439152[_0xbf440e(0x235)]((_0x4c1459,_0x172767)=>(_0x4c1459[_0xbf440e(0x169)]||0x0)-(_0x172767['versionNumber']||0x0));}const _0x4d072f=[],{idToEmailMap:_0x140b35,connectionIdToNameMap:_0x38c8df}=await withSpinner(_0xbf440e(0x1d4),async()=>{const _0x13c144=_0xbf440e,[_0x161a12,_0x41edf5]=await Promise[_0x13c144(0x175)]([_0x3d0bc4[_0x13c144(0x20c)][_0x13c144(0x1e3)](),_0x3d0bc4[_0x13c144(0x1d5)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x161a12,'connectionIdToNameMap':_0x41edf5};},{'verbose':_0x5e881c['verbose']})[_0xbf440e(0x1ed)](_0xf17410=>_0xf17410[_0xbf440e(0x205)]);for(const _0x3ee86e of _0x1991fd[_0xbf440e(0x230)]()){const _0x581ed1=_0x3ee86e[0x0][_0xbf440e(0x1af)],_0x16234b=_0x3ee86e[0x0][_0xbf440e(0x18a)],_0x44b21a=_0x16234b?_0x3073ad[_0xbf440e(0x23f)](_0x16234b)||'':'',_0x2a11bc=_0x44b21a?a27_0x3238b5[_0xbf440e(0x19f)](_0x2f50c0,_0x44b21a):_0x2f50c0,_0x143714=_0x11524a||a27_0x3238b5[_0xbf440e(0x19f)](_0x2a11bc,sanitizeFileName(_0x581ed1)+_0xbf440e(0x222));let _0x1661ec,_0x146858;if(existsSync(_0x143714))try{const _0x1a9dce=readFileSync(_0x143714,'utf-8'),_0x3ddfb0=parseYamlString(_0x1a9dce);_0x146858=_0x3ddfb0,_0x1661ec=buildRuleToNameMapping(_0x3ddfb0),_0x1cf8d6[_0xbf440e(0x182)]&&_0x1661ec[_0xbf440e(0x189)]>0x0&&console[_0xbf440e(0x1a2)]('Found\x20'+_0x1661ec[_0xbf440e(0x189)]+_0xbf440e(0x1f5)+_0x581ed1);}catch(_0x51f511){_0x1cf8d6[_0xbf440e(0x182)]&&console[_0xbf440e(0x1a2)](_0xbf440e(0x1a7)+_0x51f511[_0xbf440e(0x1d1)]);}const _0x3bffe2=[],_0x86b07b=new Set(),_0x194adb=new Map(),_0x29ddbf=new Map(),_0x48d87f=new Set(),_0x17b679=new Map(),_0x13d8d4=new Map(),_0x55b4c3=createJumpTargetCache();await withProgressSpinner(_0xbf440e(0x1b4)+_0x581ed1+_0xbf440e(0x1cc),async _0x3a51ce=>{const _0x19fe66=_0xbf440e;for(const _0x2d6a2f of _0x3ee86e){const _0x16d140=_0x3ee86e[_0x19fe66(0x216)]>0x1?_0x2d6a2f['journeyBundleName']+'\x20v'+(_0x2d6a2f[_0x19fe66(0x169)]||0x1):_0x2d6a2f[_0x19fe66(0x1af)];_0x3a51ce[_0x19fe66(0x26a)]('Fetching\x20'+_0x16d140);const _0x2c3839=await _0x3d0bc4[_0x19fe66(0x1d0)]['getJourney'](_0x2d6a2f['id']),_0x1bfb17=_0x2c3839[_0x19fe66(0x1d7)]?.[_0x19fe66(0x1ea)],_0x3110e6={'resolveSegment':async _0xbd8e80=>{const _0x558855=_0x19fe66;if(!_0x1bfb17)return{'name':_0xbd8e80,'isJourneyLocal':![]};const _0x39b8c4=_0x194adb[_0x558855(0x23f)](_0xbd8e80);if(_0x39b8c4)return _0x39b8c4;try{const _0x169774=await _0x3d0bc4[_0x558855(0x26e)][_0x558855(0x20d)](_0x1bfb17,_0xbd8e80),_0x2c81e3=_0x169774[_0x558855(0x1c1)]===SEGMENT_KIND_JOURNEY;let _0x2280ae,_0x2e49e6=_0x169774['name'];if(_0x2c81e3&&_0x169774[_0x558855(0x23a)]){const _0x1f4d5b=await segmentResponseToDef(_0x169774,{'resolveSegmentName':async _0x1b7ddb=>{const _0x14b8df=_0x558855,_0xc3bc68=_0x194adb[_0x14b8df(0x23f)](_0x1b7ddb);if(_0xc3bc68)return _0xc3bc68[_0x14b8df(0x18f)];const _0x2eeed2=await _0x3110e6[_0x14b8df(0x1b7)](_0x1b7ddb);return _0x2eeed2['name'];}}),_0x21fbb1=_0x1f4d5b[_0x558855(0x23a)];_0x2280ae={'description':_0x169774[_0x558855(0x25e)],'rule':_0x21fbb1};const _0x29cee5=serializeRule(_0x21fbb1),_0x35c159=_0x29ddbf['get'](_0x29cee5);if(_0x35c159)_0x2e49e6=_0x35c159,_0x2280ae=undefined,_0x1cf8d6[_0x558855(0x182)]&&console[_0x558855(0x1a2)](_0x558855(0x1df)+_0x169774[_0x558855(0x18f)]+_0x558855(0x282)+_0x35c159);else{let _0x4bd35f=![];if(_0x1661ec){const _0x35f51b=_0x1661ec[_0x558855(0x23f)](_0x29cee5);if(_0x35f51b){const _0x1f3b43=_0x35f51b['find'](_0x590bfe=>!_0x86b07b[_0x558855(0x1ef)](_0x590bfe));_0x1f3b43&&(_0x2e49e6=_0x1f3b43,_0x86b07b[_0x558855(0x1c4)](_0x1f3b43),_0x29ddbf[_0x558855(0x1c2)](_0x29cee5,_0x1f3b43),_0x4bd35f=!![],_0x1cf8d6[_0x558855(0x182)]&&console[_0x558855(0x1a2)](_0x558855(0x196)+_0x1f3b43+_0x558855(0x195)));}}if(!_0x4bd35f){const _0x5f4613=generateJourneyLocalName(_0x169774['name']);_0x5f4613&&(_0x2e49e6=_0x5f4613);let _0x66ecf6=_0x2e49e6,_0x48348e=0x2;while(_0x86b07b[_0x558855(0x1ef)](_0x66ecf6)){_0x66ecf6=_0x2e49e6+'_'+_0x48348e,_0x48348e++;}_0x86b07b[_0x558855(0x1c4)](_0x66ecf6),_0x29ddbf['set'](_0x29cee5,_0x66ecf6),_0x2e49e6=_0x66ecf6;}}}const _0x557e56={'name':_0x2e49e6,'isJourneyLocal':_0x2c81e3,'definition':_0x2280ae};return _0x194adb[_0x558855(0x1c2)](_0xbd8e80,_0x557e56),_0x557e56;}catch(_0x15a647){return _0x5e881c['verbose']&&console[_0x558855(0x1a2)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0xbd8e80+':\x20'+_0x15a647[_0x558855(0x1d1)]),{'name':_0xbd8e80,'isJourneyLocal':![]};}},'resolveActivation':async _0x412d2a=>{const _0x1fb6f1=_0x19fe66,_0x34e4fb=_0x17b679['get'](_0x412d2a);if(_0x34e4fb)return _0x34e4fb;try{const _0x200cfe=await _0x3d0bc4[_0x1fb6f1(0x1d0)][_0x1fb6f1(0x231)](_0x2d6a2f['id'],_0x412d2a),_0x50400b=journeyActivationStepToYaml(_0x200cfe,_0x140b35,_0x38c8df),_0x1d0e3d=JSON['stringify']({'name':_0x50400b['name'],'connection':_0x50400b[_0x1fb6f1(0x1d5)],'connector_config':_0x50400b[_0x1fb6f1(0x23c)]}),_0x2dc066=_0x13d8d4[_0x1fb6f1(0x23f)](_0x1d0e3d);if(_0x2dc066){const _0x1cea71={'name':_0x2dc066,'isJourneyLocal':!![],'definition':_0x50400b};return _0x17b679['set'](_0x412d2a,_0x1cea71),_0x1cea71;}const _0x5e25ad=_0x200cfe[_0x1fb6f1(0x1d7)][_0x1fb6f1(0x204)][_0x1fb6f1(0x18f)]||_0x412d2a,_0x303413=sanitizeYamlKey(_0x5e25ad)||_0x1fb6f1(0x20b)+_0x412d2a;let _0x3009d3=_0x303413,_0x234a75=0x2;while(_0x48d87f[_0x1fb6f1(0x1ef)](_0x3009d3)){_0x3009d3=_0x303413+'_'+_0x234a75,_0x234a75++;}_0x48d87f[_0x1fb6f1(0x1c4)](_0x3009d3),_0x13d8d4[_0x1fb6f1(0x1c2)](_0x1d0e3d,_0x3009d3);const _0x1231f5={'name':_0x3009d3,'isJourneyLocal':!![],'definition':_0x50400b};return _0x17b679[_0x1fb6f1(0x1c2)](_0x412d2a,_0x1231f5),_0x1231f5;}catch(_0x18742f){return _0x5e881c[_0x1fb6f1(0x182)]&&console[_0x1fb6f1(0x1a2)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x412d2a+':\x20'+_0x18742f['message']),{'name':_0x412d2a,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x3da1fb,_0x1f3a60)=>{const _0x6d0b81=_0x19fe66;return resolveJumpTarget(_0x3da1fb,_0x1f3a60,_0x55b4c3,_0x20bd25=>_0x3d0bc4[_0x6d0b81(0x1d0)][_0x6d0b81(0x19c)](_0x20bd25));}},_0x50d00d=await journeyResponseToDef(_0x2c3839,_0x3110e6);_0x3bffe2[_0x19fe66(0x214)]({'item':_0x2d6a2f,'yaml':_0x50d00d});}},{'verbose':_0x5e881c[_0xbf440e(0x182)]});const _0x546209=await _0x3d0bc4[_0xbf440e(0x1d0)][_0xbf440e(0x263)](_0x3ee86e[0x0]['journeyBundleId']),_0x58953b=buildMergedJourneyDef(_0x3bffe2,_0x1661ec,_0x546209),_0x21e6d7=normalizeJourneyDef(_0x58953b,_0x146858),_0x5be077=toYamlString(_0x21e6d7),_0xbcec88=_0x11524a||a27_0x3238b5[_0xbf440e(0x19f)](_0x2a11bc,sanitizeFileName(_0x581ed1)+_0xbf440e(0x222));!_0x11524a&&_0x44b21a&&!existsSync(_0x2a11bc)&&mkdirSync(_0x2a11bc,{'recursive':!![]});const _0x44fbee=a27_0x3238b5[_0xbf440e(0x1ac)](process[_0xbf440e(0x242)](),_0xbcec88);if(existsSync(_0xbcec88)){const _0x4e871d=readFileSync(_0xbcec88,_0xbf440e(0x250)),_0x43c47e=generateDiff(_0x4e871d,_0x5be077),_0x49d267=hasChanges(_0x43c47e);_0x4d072f['push']({'relativePath':_0x44fbee,'absolutePath':_0xbcec88,'content':_0x5be077,'isNew':![],'hasChanges':_0x49d267,'diff':_0x49d267?formatDiffWithColors(_0x43c47e):undefined});}else _0x4d072f['push']({'relativePath':_0x44fbee,'absolutePath':_0xbcec88,'content':_0x5be077,'isNew':!![],'hasChanges':![]});}const _0x2ea876=_0x4d072f[_0xbf440e(0x1cf)](_0x16e5b0=>_0x16e5b0[_0xbf440e(0x17c)]),_0xade25b=_0x4d072f['filter'](_0x275dac=>!_0x275dac[_0xbf440e(0x17c)]&&_0x275dac[_0xbf440e(0x1c7)]),_0x1b3a8c=_0x4d072f['filter'](_0x211158=>!_0x211158[_0xbf440e(0x17c)]&&!_0x211158[_0xbf440e(0x1c7)]),_0x580757=_0x2b4973[_0xbf440e(0x216)],_0x1313d9=_0x1991fd[_0xbf440e(0x189)],_0x4602c6=_0x580757>_0x1313d9?'\x20('+_0x580757+_0xbf440e(0x16b):'';console['error'](_0xbf440e(0x23b)),console[_0xbf440e(0x1a2)]('\x20\x20'+a27_0x38e41f[_0xbf440e(0x26f)](_0x1313d9+'\x20journeys')+a27_0x38e41f[_0xbf440e(0x1ee)](_0x4602c6)),console['error']('\x20\x20'+a27_0x38e41f[_0xbf440e(0x174)]('+\x20'+_0x2ea876['length']+_0xbf440e(0x27d))),console[_0xbf440e(0x1a2)]('\x20\x20'+a27_0x38e41f[_0xbf440e(0x20f)]('~\x20'+_0xade25b[_0xbf440e(0x216)]+_0xbf440e(0x1c8))),console[_0xbf440e(0x1a2)]('\x20\x20'+a27_0x38e41f['dim']('=\x20'+_0x1b3a8c[_0xbf440e(0x216)]+_0xbf440e(0x243))),console['error']('\x20\x20Target:\x20'+a27_0x38e41f[_0xbf440e(0x26f)](_0x2f50c0)+'\x0a');if(_0xade25b[_0xbf440e(0x216)]>0x0)for(const _0x32ed96 of _0xade25b){console[_0xbf440e(0x1a2)](_0xbf440e(0x251)+_0x32ed96[_0xbf440e(0x257)]+'\x27:'),console[_0xbf440e(0x1a2)]('─'[_0xbf440e(0x227)](0x3c)),console[_0xbf440e(0x1a2)](_0x32ed96[_0xbf440e(0x1c0)]),console[_0xbf440e(0x1a2)]('─'['repeat'](0x3c));}if(_0x1cf8d6['dryRun'])return console[_0xbf440e(0x1a2)](a27_0x38e41f[_0xbf440e(0x20f)](_0xbf440e(0x286))),0x0;if(_0x2ea876[_0xbf440e(0x216)]===0x0&&_0xade25b[_0xbf440e(0x216)]===0x0)return console[_0xbf440e(0x1a2)](a27_0x38e41f[_0xbf440e(0x174)](_0xbf440e(0x274))),saveSessionContext({'parent_segment':_0x40a5b6},_0x1cf8d6[_0xbf440e(0x217)]),console[_0xbf440e(0x1a2)](a27_0x38e41f['green'](_0xbf440e(0x168)+a27_0x38e41f[_0xbf440e(0x1ee)]('parent_segment')+_0xbf440e(0x177)+a27_0x38e41f[_0xbf440e(0x26f)](_0x40a5b6))),0x0;if(!_0x1cf8d6[_0xbf440e(0x23d)]&&(_0x2ea876[_0xbf440e(0x216)]>0x0||_0xade25b[_0xbf440e(0x216)]>0x0)){if(!isInteractive())return console[_0xbf440e(0x1a2)](a27_0x38e41f['red'](_0xbf440e(0x234)),_0xbf440e(0x220)),console[_0xbf440e(0x1a2)](a27_0x38e41f['dim'](_0xbf440e(0x191))),0x1;const _0x1646e6=await confirmKey(_0xbf440e(0x284)+(_0x2ea876[_0xbf440e(0x216)]+_0xade25b['length'])+_0xbf440e(0x24a));if(!_0x1646e6)return console['error'](a27_0x38e41f[_0xbf440e(0x20f)](_0xbf440e(0x285)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x2f50c0)&&mkdirSync(_0x2f50c0,{'recursive':!![]});const _0x43ce66=a27_0x3238b5[_0xbf440e(0x19f)](_0x2f50c0,_0xbf440e(0x255));writeFileSync(_0x43ce66,createTdxConfigContent(_0x40a5b6),'utf-8');for(const _0x87c8f7 of _0x4d072f){(_0x87c8f7[_0xbf440e(0x17c)]||_0x87c8f7[_0xbf440e(0x1c7)])&&writeFileSync(_0x87c8f7[_0xbf440e(0x249)],_0x87c8f7[_0xbf440e(0x17d)],_0xbf440e(0x250));}return console[_0xbf440e(0x1a2)](a27_0x38e41f[_0xbf440e(0x174)]('✔\x20Pulled\x20'+(_0x2ea876[_0xbf440e(0x216)]+_0xade25b[_0xbf440e(0x216)])+_0xbf440e(0x1f3)+_0x2f50c0)),saveSessionContext({'parent_segment':_0x40a5b6},_0x1cf8d6['session']),console[_0xbf440e(0x1a2)](a27_0x38e41f[_0xbf440e(0x174)](_0xbf440e(0x168)+a27_0x38e41f['dim']('parent_segment')+_0xbf440e(0x177)+a27_0x38e41f[_0xbf440e(0x26f)](_0x40a5b6))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';['description']=a27_0x7e19eb(0x16d);async['execute'](_0x28a9bd){const _0x2dc008=a27_0x7e19eb,{options:_0x404cbf,args:_0x4dbb2b,tdx:_0x479784}=_0x28a9bd,_0x388cc6=_0x4dbb2b[0x0];if(!requireNameOrPath(_0x388cc6))return 0x1;_0x404cbf['verbose']&&console['error']('Input:\x20'+_0x388cc6);const {journeyId:_0x1fa315}=await resolveJourneyIdFromInput(_0x388cc6,_0x404cbf,_0x479784),_0x5db166=await withSpinner('Getting\x20column\x20mapping...',()=>_0x479784['journey'][_0x2dc008(0x245)](_0x1fa315),{'verbose':_0x404cbf[_0x2dc008(0x182)]}),_0xb55a88=_0x5db166[_0x2dc008(0x205)];return console[_0x2dc008(0x171)](_0x2dc008(0x1a8)+_0xb55a88['database']),console[_0x2dc008(0x171)](_0x2dc008(0x203)+_0xb55a88[_0x2dc008(0x1b1)]),await handleSDKOutput(_0xb55a88['columns'],_0x404cbf),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]=a27_0x7e19eb(0x170);[a27_0x7e19eb(0x25e)]=a27_0x7e19eb(0x17a);async['execute'](_0xec484d){const _0x4bfc8c=a27_0x7e19eb,{options:_0x24b5c3,args:_0x1b4554,tdx:_0x23a9aa}=_0xec484d,_0x39dc89=_0x1b4554[0x0];if(!requireNameOrPath(_0x39dc89))return 0x1;_0x24b5c3[_0x4bfc8c(0x182)]&&console[_0x4bfc8c(0x1a2)](_0x4bfc8c(0x17e)+_0x39dc89);const {journeyId:_0x40b9e7}=await resolveJourneyIdFromInput(_0x39dc89,_0x24b5c3,_0x23a9aa),_0xa240f6=await withSpinner(_0x4bfc8c(0x1fa),()=>_0x23a9aa[_0x4bfc8c(0x1d0)][_0x4bfc8c(0x225)](_0x40b9e7),{'verbose':_0x24b5c3['verbose']}),_0x283c15=_0xa240f6['data'];return console[_0x4bfc8c(0x1a2)]('Found\x20'+_0x283c15[_0x4bfc8c(0x216)]+_0x4bfc8c(0x264)+(_0x283c15[_0x4bfc8c(0x216)]!==0x1?'s':'')),await handleSDKOutput(_0x283c15,_0x24b5c3),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']='journey:push';[a27_0x7e19eb(0x25e)]=a27_0x7e19eb(0x192);[a27_0x7e19eb(0x1e1)]=new SegmentPushCommand();async[a27_0x7e19eb(0x21c)](_0x4e7bd1){const _0x1f4efd=a27_0x7e19eb,_0x1f9608=_0x4e7bd1[_0x1f4efd(0x275)][0x0];let _0x155ed7;if(_0x1f9608){const _0x42c8ca=await resolveTarget({'arg':_0x1f9608,'contextParent':_0x4e7bd1[_0x1f4efd(0x22a)][_0x1f4efd(0x279)],'cwd':process[_0x1f4efd(0x242)]()});isSuccessfulResolution(_0x42c8ca)&&_0x42c8ca[_0x1f4efd(0x18b)]===_0x1f4efd(0x261)&&(_0x155ed7=_0x42c8ca[_0x1f4efd(0x18c)]);}const _0x32dafe={..._0x4e7bd1,'options':{..._0x4e7bd1['options'],'journeysOnly':!![],..._0x155ed7&&{'singleFilePath':_0x155ed7}}};return this[_0x1f4efd(0x1e1)][_0x1f4efd(0x21c)](_0x32dafe);}}function a27_0x5a9b(){const _0x585b63=['join','completeMilestoneRate','40059kgGKNH','error','📁\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','completionRate','\x22\x20not\x20found','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Database:\x20','bold','List\x20all\x20versions\x20of\x20a\x20journey','\x20@\x20','relative','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','journeyBundleName','journeyBundleId','table','✔\x20Journey\x20\x22','Getting\x20journey\x20traffic\x20data...','Fetching\x20','⚠️\x20','find','resolveSegment','Stages:','\x20\x20Journey\x20ID:\x20','rootFolderId','updatedAt','getParentFull','pause','\x20(ID:\x20','segmentName','diff','kind','set','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','add','web','links','hasChanges','\x20changed\x20files','9322832mgjpHa','Error:\x20Invalid\x20--type\x20\x22','\x20(draft)\x20—\x20\x22','...','Paused:','no_parent','filter','journey','message','/app/ps/','listJourneysWithFolders','Fetching\x20users\x20and\x20connections...','connection','json','attributes','Error:\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','15546588idbJfe','Getting\x20version\x20','test','Error:\x20Parent\x20segment\x20context\x20required','(paused)','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Error:\x20Invalid\x20version\x20number:\x20','segmentPushCommand','map','buildIdToEmailMap','(running)','helpText','launched','journey:traffic','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','audienceId','root\x20folder','getTrafficData','then','dim','has','Getting\x20journey\x20details...','stages','Cancelled','\x20journey\x20files\x20to\x20','\x22\x20resumed','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','/j/da','\x20not\x20found.\x20Available:\x20','\x22\x20paused','replace','Listing\x20journey\x20activations...','98748jpnIBd','\x20details...','Show\x20journey\x20statistics','State:','errorCode','14SxOSjV','split','dryRun','Table:\x20','activationParams','data','11VaYstl','runAt','Resuming\x20journey...','enteredSize','\x20\x20Folder\x20path:\x20','activation_','user','getSegment','nodes','yellow','goal','resolveJourneyId','/e/','none','push','(completed)','length','session','no\x20connection','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','toLowerCase','Creating\x20new\x20version...','execute','(root)','3170754MOJbdN','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','includeStats','.yml','INVALID_ARGUMENT','\x20\x20Name:\x20','listActivationsFlat','\x20Created\x20v','repeat','folderPath','journey:versions','options','Listing\x20journeys...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Pause\x20a\x20running\x20journey','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','archived','values','getActivation','Folder\x20path:\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','\x0aError:','sort','segments','Resolving\x20version...','22wQpzrT','runAfterJourneyRefresh','rule','\x0aPull\x20summary:','connector_config','yes',',\x20schedule:\x20','get','Error:\x20Version\x20','Listing\x20journey\x20versions...','cwd','\x20unchanged\x20files','resume','getColumnMapping',',\x20version:\x20','759606NjKTvG','jsonl','absolutePath','\x20files?','No\x20journeys\x20found','conversion','paused','List\x20journeys\x20in\x20current\x20context','Activations:','utf-8','\x0aChanges\x20to\x20\x27','ID:','Export\x20journey(s)\x20as\x20YAML\x20files','journey:stats','tdx.json','listVersions','relativePath','exitOrJumpSize','completed','Resolving\x20parent\x20segment...','targetDir','goalSize','Resolved\x20YAML\x20file:\x20','description','draft','journeyId','file','folders','getLatestJourneyId','\x20activation','\x20version','localeCompare','Paused\x20at:','listFolders','Target\x20file:\x20','setPhase','format','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Target\x20directory:\x20','segment','cyan','resolveParentId','history','(archived)','(none)','✔\x20All\x20files\x20are\x20up\x20to\x20date','args','createVersion','site','\x20\x20←\x20','parentSegment','3210ARfaqR','Journey:','230ATKmPS','\x20new\x20files','pausedAt','\x20\x20Parent\x20segment:\x20','includeHistory','renderStats','\x20->\x20','activation','Write\x20','Aborted.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','No\x20statistics\x20available\x20for\x20journey:\x20','Parent\x20segment\x20ID:','journey:version:view','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','scheduleType','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)','getStatistics','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Fetching\x20journeys\x20and\x20folders...','✔\x20Context\x20set:\x20','versionNumber','createdAt','\x20versions)','Pausing\x20journey...','Show\x20journey\x20table\x20column\x20mapping','Error:\x20Journey\x20\x27','base','journey:activations','log','from','Options:','green','all','/j/da/je','\x20=\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Available\x20stages:\x20','List\x20activations\x20for\x20a\x20journey','Getting\x20journey\x20statistics...','isNew','content','Input:\x20','Error:\x20--version\x20option\x20is\x20required','stage','journey:pull','verbose','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20journey','tsv','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','milestoneSize','size','folderId','type','filePath','state','journeys','name','(draft)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','executeDryRun','Resolving\x20journey...','\x20(rule\x20match)','\x20\x20Preserving\x20local\x20segment\x20name:\x20','entries','parentName','journeyStages','\x20\x20Statistics\x20not\x20available','journey:view','getJourney','2316TRWztv','journeyName'];a27_0x5a9b=function(){return _0x585b63;};return a27_0x5a9b();}export class JourneyVersionsCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]=a27_0x7e19eb(0x229);[a27_0x7e19eb(0x25e)]=a27_0x7e19eb(0x1aa);async[a27_0x7e19eb(0x21c)](_0xd4360d){const _0x2b9acd=a27_0x7e19eb,{options:_0x471a5e,args:_0x49159c,tdx:_0x21da15}=_0xd4360d,_0x133de0=_0x49159c[0x0];if(!requireNameOrPath(_0x133de0))return 0x1;if(_0x471a5e[_0x2b9acd(0x182)])console[_0x2b9acd(0x1a2)](_0x2b9acd(0x17e)+_0x133de0);const {journeyId:_0x1278de}=await resolveJourneyIdFromInput(_0x133de0,_0x471a5e,_0x21da15),_0x8752ae=await withSpinner(_0x2b9acd(0x241),()=>_0x21da15[_0x2b9acd(0x1d0)]['listVersions'](_0x1278de),{'verbose':_0x471a5e[_0x2b9acd(0x182)]}),{bundleName:_0x2ab27c,versions:_0x312e1e,latestJourneyId:_0x45c4ac}=_0x8752ae[_0x2b9acd(0x205)];console['error'](_0x2ab27c+':\x20'+_0x312e1e['length']+_0x2b9acd(0x265)+(_0x312e1e[_0x2b9acd(0x216)]!==0x1?'s':''));const _0x53f128=_0x312e1e['map'](_0x4956cf=>({'version':_0x4956cf[_0x2b9acd(0x169)],'journey_id':_0x4956cf[_0x2b9acd(0x260)],'name':_0x4956cf[_0x2b9acd(0x18f)],'state':_0x4956cf[_0x2b9acd(0x18d)],'paused':_0x4956cf[_0x2b9acd(0x24d)],'latest':_0x4956cf['journeyId']===_0x45c4ac,'created_at':_0x4956cf[_0x2b9acd(0x16a)]}));return await handleSDKOutput(_0x53f128,_0x471a5e),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]='journey:version:create';[a27_0x7e19eb(0x25e)]=a27_0x7e19eb(0x184);async[a27_0x7e19eb(0x21c)](_0x3f673e){const _0x560e4f=a27_0x7e19eb,{options:_0xb2e235,args:_0x1307da,tdx:_0x1750da}=_0x3f673e,_0x4adefe=_0x1307da[0x0];if(!requireNameOrPath(_0x4adefe))return 0x1;if(_0xb2e235['verbose'])console['error'](_0x560e4f(0x17e)+_0x4adefe);const {journeyId:_0x5aaa91,journeyName:_0x22dce5}=await resolveJourneyIdFromInput(_0x4adefe,_0xb2e235,_0x1750da);if(!_0xb2e235[_0x560e4f(0x23d)]){const _0x8205d3=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x22dce5+'\x22?');if(!_0x8205d3)return console['error']('Cancelled'),0x0;}const _0x350a93=await withSpinner(_0x560e4f(0x21b),()=>_0x1750da[_0x560e4f(0x1d0)][_0x560e4f(0x276)](_0x5aaa91),{'verbose':_0xb2e235[_0x560e4f(0x182)]}),_0x5ebff6=_0x350a93[_0x560e4f(0x205)];return console[_0x560e4f(0x1a2)](a27_0x38e41f['green']('✔')+_0x560e4f(0x226)+_0x5ebff6['attributes'][_0x560e4f(0x169)]+_0x560e4f(0x1cb)+_0x5ebff6[_0x560e4f(0x1d7)][_0x560e4f(0x18f)]+'\x22'),console[_0x560e4f(0x1a2)](_0x560e4f(0x1b9)+_0x5ebff6['id']),await handleSingleObjectOutput({'id':_0x5ebff6['id'],'name':_0x5ebff6[_0x560e4f(0x1d7)][_0x560e4f(0x18f)],'version':_0x5ebff6[_0x560e4f(0x1d7)][_0x560e4f(0x169)],'state':_0x5ebff6[_0x560e4f(0x1d7)]['state'],'bundle_id':_0x5ebff6[_0x560e4f(0x1d7)][_0x560e4f(0x1b0)],'created_at':_0x5ebff6[_0x560e4f(0x1d7)][_0x560e4f(0x16a)]},_0xb2e235),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x7e19eb(0x18f)]=a27_0x7e19eb(0x289);[a27_0x7e19eb(0x25e)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x7e19eb(0x21c)](_0x5f3062){const _0x89fdf8=a27_0x7e19eb,{options:_0x2cb946,args:_0xce9b39,tdx:_0x32b7a5}=_0x5f3062,_0x296aa1=_0xce9b39[0x0];if(!requireNameOrPath(_0x296aa1))return 0x1;const _0x2398d2=_0x2cb946['version'];if(!_0x2398d2)return console['error'](_0x89fdf8(0x17f)),console[_0x89fdf8(0x1a2)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x519941=parseInt(_0x2398d2,0xa);if(isNaN(_0x519941)||_0x519941<0x1)return console[_0x89fdf8(0x1a2)](_0x89fdf8(0x1e0)+_0x2398d2),0x1;if(_0x2cb946[_0x89fdf8(0x182)])console[_0x89fdf8(0x1a2)](_0x89fdf8(0x17e)+_0x296aa1+_0x89fdf8(0x246)+_0x519941);const {journeyId:_0x152104,parentSegmentId:_0x3f697}=await resolveJourneyIdFromInput(_0x296aa1,_0x2cb946,_0x32b7a5),_0x5f26e5=await withSpinner(_0x89fdf8(0x237),()=>_0x32b7a5['journey'][_0x89fdf8(0x256)](_0x152104),{'verbose':_0x2cb946[_0x89fdf8(0x182)]}),{versions:_0xc0163c,latestJourneyId:_0x3b1225}=_0x5f26e5['data'],_0x359e5b=_0xc0163c[_0x89fdf8(0x1b6)](_0x53ef22=>_0x53ef22[_0x89fdf8(0x169)]===_0x519941);if(!_0x359e5b){const _0x2bb88e=_0xc0163c['map'](_0x56c549=>'v'+_0x56c549[_0x89fdf8(0x169)])[_0x89fdf8(0x19f)](',\x20');return console[_0x89fdf8(0x1a2)](_0x89fdf8(0x240)+_0x519941+_0x89fdf8(0x1f7)+_0x2bb88e),0x1;}const _0x39bd37=await withSpinner(_0x89fdf8(0x1db)+_0x519941+_0x89fdf8(0x1fc),()=>_0x32b7a5['journey'][_0x89fdf8(0x19c)](_0x359e5b[_0x89fdf8(0x260)]),{'verbose':_0x2cb946[_0x89fdf8(0x182)]}),_0x5d95ca=_0x39bd37[_0x89fdf8(0x205)],_0x2aef03=getConsoleNextUrl(_0x2cb946['site'],_0x89fdf8(0x1d2)+_0x3f697+_0x89fdf8(0x212)+_0x359e5b[_0x89fdf8(0x260)]+_0x89fdf8(0x176));return await handleSingleObjectOutput({'id':_0x5d95ca['id'],'name':_0x5d95ca['attributes']['name'],'version':_0x5d95ca[_0x89fdf8(0x1d7)][_0x89fdf8(0x169)],'description':_0x5d95ca[_0x89fdf8(0x1d7)]['description'],'state':_0x5d95ca[_0x89fdf8(0x1d7)][_0x89fdf8(0x18d)],'paused':_0x5d95ca['attributes']['paused'],'reentry_mode':_0x5d95ca[_0x89fdf8(0x1d7)]['reentryMode'],'stages':_0x5d95ca[_0x89fdf8(0x1d7)][_0x89fdf8(0x199)]?.[_0x89fdf8(0x216)]||0x0,..._0x5d95ca[_0x89fdf8(0x1d7)]['goal']&&{'goal':_0x5d95ca[_0x89fdf8(0x1d7)][_0x89fdf8(0x210)]['name']},'latest':_0x359e5b['journeyId']===_0x3b1225,'created_at':_0x5d95ca[_0x89fdf8(0x1d7)][_0x89fdf8(0x16a)],'updated_at':_0x5d95ca['attributes'][_0x89fdf8(0x1bb)],'url':_0x2aef03},_0x2cb946),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x9faf07=a28_0x1333;(function(_0x1d8b86,_0x1c68c3){const _0x4faa1b=a28_0x1333,_0x2ac112=_0x1d8b86();while(!![]){try{const _0x3cda7e=parseInt(_0x4faa1b(0xc7))/0x1*(parseInt(_0x4faa1b(0xbb))/0x2)+parseInt(_0x4faa1b(0xe5))/0x3+parseInt(_0x4faa1b(0xcd))/0x4+-parseInt(_0x4faa1b(0xc5))/0x5+parseInt(_0x4faa1b(0xd6))/0x6+parseInt(_0x4faa1b(0xbd))/0x7+parseInt(_0x4faa1b(0xc0))/0x8*(-parseInt(_0x4faa1b(0xc8))/0x9);if(_0x3cda7e===_0x1c68c3)break;else _0x2ac112['push'](_0x2ac112['shift']());}catch(_0x3c08b8){_0x2ac112['push'](_0x2ac112['shift']());}}}(a28_0x4927,0xb0ef7));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1333(_0x48778f,_0x2f84d4){_0x48778f=_0x48778f-0xb6;const _0x492762=a28_0x4927();let _0x133309=_0x492762[_0x48778f];return _0x133309;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x4927(){const _0x1ecc31=['No\x20journey\x20YAML\x20files\x20found\x20in\x20','validCount','type','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','hasErrors','52446dEQTfO','\x20journey(s)\x20with\x20errors,\x20','message','\x20segment\x20file(s)\x20skipped','✔\x20All\x20','journey','log','error','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','verbose','targetDir','parentSegment','description','Validation\x20failed:\x20','errors','green','70256TMBpUa','warnings','3338356GFLJLq','no_parent','warningCount','488992SdrdAZ','cwd','file','length','skippedCount','1950990FFqfkx','.yml','18Nwzwxi','333BjJoje','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','reason','name','Error:\x20','5178908ZwyriT','\x20segment\x20file(s)\x20skipped)','execute','valid','helpText','Error:\x20Directory\x20not\x20found:\x20','\x20journey(s)\x20valid','errorCode','red','5730552ECTeAE','Validate\x20journey\x20YAML\x20files','invalidCount','yellow','cyan','endsWith','dim','\x20(skipped:\x20','\x20warning(s)','filter'];a28_0x4927=function(){return _0x1ecc31;};return a28_0x4927();}import{existsSync}from'fs';import a28_0x18130d from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x9faf07(0xcb)]='journey:validate';[a28_0x9faf07(0xb7)]=a28_0x9faf07(0xd7);async[a28_0x9faf07(0xcf)](_0x1a3f14){const _0x2f13a9=a28_0x9faf07,{options:_0xb97d8e,args:_0x17256b}=_0x1a3f14,_0x3d9483=_0xb97d8e,_0x61b8ca=await resolveTarget({'arg':_0x17256b[0x0],'contextParent':_0xb97d8e[_0x2f13a9(0xb6)],'cwd':process[_0x2f13a9(0xc1)]()});if(!isSuccessfulResolution(_0x61b8ca))return _0x61b8ca[_0x2f13a9(0xd4)]===_0x2f13a9(0xbe)?(console[_0x2f13a9(0xec)](a28_0x18130d[_0x2f13a9(0xd9)](_0x2f13a9(0xed))),console[_0x2f13a9(0xec)](_0x2f13a9(0xe3)),console[_0x2f13a9(0xec)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error'](_0x2f13a9(0xc9))):(console[_0x2f13a9(0xec)](a28_0x18130d['red'](_0x2f13a9(0xcc)+_0x61b8ca[_0x2f13a9(0xe7)]+'\x0a')),_0x61b8ca[_0x2f13a9(0xd1)]&&console[_0x2f13a9(0xec)](a28_0x18130d[_0x2f13a9(0xda)](_0x61b8ca[_0x2f13a9(0xd1)]))),0x1;const _0x53d29c=_0x61b8ca[_0x2f13a9(0xef)],_0x1b0759=_0x61b8ca[_0x2f13a9(0xe2)]===_0x2f13a9(0xc2)?_0x61b8ca['filePath']:undefined;if(!_0x1b0759&&!existsSync(_0x53d29c))return console[_0x2f13a9(0xec)](a28_0x18130d[_0x2f13a9(0xd5)](_0x2f13a9(0xd2)+_0x53d29c+'\x0a')),0x1;let _0x2600e4;if(_0x1b0759){if(!_0x1b0759[_0x2f13a9(0xdb)](_0x2f13a9(0xc6))&&!_0x1b0759[_0x2f13a9(0xdb)]('.yaml'))return console['error'](a28_0x18130d[_0x2f13a9(0xd5)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1b0759+'\x0a')),0x1;_0x2600e4=[_0x1b0759];}else _0x2600e4=findYamlFiles(_0x53d29c);if(_0x2600e4['length']===0x0)return console[_0x2f13a9(0xec)](a28_0x18130d[_0x2f13a9(0xd5)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x53d29c+'\x0a')),0x1;const _0x29e571=validateYamlFiles(_0x2600e4,_0x53d29c,{'filterType':_0x2f13a9(0xea)}),_0x47f40e=calculateSummary(_0x29e571),_0x49c582=_0x29e571[_0x2f13a9(0xdf)](isValidationResult);if(_0x49c582[_0x2f13a9(0xc3)]===0x0)return console['error'](a28_0x18130d['yellow'](_0x2f13a9(0xe0)+_0x53d29c+'\x0a')),_0x47f40e[_0x2f13a9(0xc4)]>0x0&&console[_0x2f13a9(0xec)](a28_0x18130d[_0x2f13a9(0xdc)]('('+_0x47f40e[_0x2f13a9(0xc4)]+_0x2f13a9(0xce))),0x0;for(const _0xb5e540 of _0x29e571){if(!isValidationResult(_0xb5e540)){_0x3d9483['verbose']&&console[_0x2f13a9(0xeb)](a28_0x18130d[_0x2f13a9(0xdc)]('-\x20'+_0xb5e540['relativePath']+_0x2f13a9(0xdd)+_0xb5e540[_0x2f13a9(0xca)]+')'));continue;}const {relativePath:_0x2dd247,source:_0x36867a,result:_0x530a95}=_0xb5e540;if(_0x530a95[_0x2f13a9(0xd0)]&&_0x530a95['warnings'][_0x2f13a9(0xc3)]===0x0)_0x3d9483[_0x2f13a9(0xee)]&&console[_0x2f13a9(0xeb)](a28_0x18130d['green']('✔\x20'+_0x2dd247));else _0x530a95[_0x2f13a9(0xd0)]?(console[_0x2f13a9(0xeb)](a28_0x18130d[_0x2f13a9(0xd9)]('⚠\x20'+_0x2dd247+':\x20'+_0x530a95[_0x2f13a9(0xbc)][_0x2f13a9(0xc3)]+_0x2f13a9(0xde))),console[_0x2f13a9(0xeb)](formatValidationResult(_0x530a95,_0x36867a,_0x2dd247))):(console[_0x2f13a9(0xeb)](a28_0x18130d[_0x2f13a9(0xd5)]('✖\x20'+_0x2dd247+':\x20'+_0x530a95[_0x2f13a9(0xb9)][_0x2f13a9(0xc3)]+'\x20error(s)')),console['log'](formatValidationResult(_0x530a95,_0x36867a,_0x2dd247)));}return console['log'](''),_0x47f40e[_0x2f13a9(0xe4)]?(console[_0x2f13a9(0xeb)](a28_0x18130d[_0x2f13a9(0xd5)](_0x2f13a9(0xb8)+_0x47f40e[_0x2f13a9(0xd8)]+_0x2f13a9(0xe6)+_0x47f40e[_0x2f13a9(0xe1)]+'\x20valid')),_0x47f40e[_0x2f13a9(0xbf)]>0x0&&console['log'](a28_0x18130d[_0x2f13a9(0xd9)](_0x47f40e[_0x2f13a9(0xbf)]+'\x20warning(s)\x20found')),_0x47f40e['skippedCount']>0x0&&console[_0x2f13a9(0xeb)](a28_0x18130d[_0x2f13a9(0xdc)](_0x47f40e['skippedCount']+_0x2f13a9(0xe8))),0x1):(console[_0x2f13a9(0xeb)](a28_0x18130d[_0x2f13a9(0xba)](_0x2f13a9(0xe9)+_0x47f40e[_0x2f13a9(0xe1)]+_0x2f13a9(0xd3))),_0x47f40e[_0x2f13a9(0xbf)]>0x0&&console[_0x2f13a9(0xeb)](a28_0x18130d[_0x2f13a9(0xd9)](_0x47f40e[_0x2f13a9(0xbf)]+'\x20warning(s)\x20found')),_0x47f40e['skippedCount']>0x0&&console[_0x2f13a9(0xeb)](a28_0x18130d['dim'](_0x47f40e[_0x2f13a9(0xc4)]+_0x2f13a9(0xe8))),0x0);}}
|