@treasuredata/tdx 0.29.5 β 2026.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.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/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.d.ts.map +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/databases.js.map +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.d.ts +97 -1
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/job-command.js.map +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/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.d.ts.map +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/tables.js.map +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/workflow-command.js +1 -1
- package/dist/core/auth.d.ts +8 -5
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.d.ts +38 -6
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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.d.ts +3 -3
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/api.js.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.d.ts +16 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +47 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +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/llm-api-client.js.map +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/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +95 -4
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +10 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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.d.ts +2 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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/personalization.js.map +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/realtime.js.map +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/parent-segment-yaml.js.map +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/engage.d.ts +119 -0
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.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.d.ts +1 -0
- package/dist/sdk/util/index.d.ts.map +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/index.js.map +1 -1
- package/dist/sdk/util/paginate.d.ts +18 -0
- package/dist/sdk/util/paginate.d.ts.map +1 -0
- package/dist/sdk/util/paginate.js +1 -0
- package/dist/sdk/util/paginate.js.map +1 -0
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/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 +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a21_0x2b94(){const _0xdeeab6=['engage_workspace','error','engage:template:pull','yes','isNew','136279rWCtuV','workspace','2085080CAVSuF','\x20new\x20files','repeat','\x20templates','β\x20All\x20files\x20are\x20up\x20to\x20date','data','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','β\x20Pulled\x20','dim','session','\x20changed\x20files','relativePath','templates','verbose','setPhase','-\x20no\x20files\x20written','diff','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','name','targetDir','1182HuQZje','workspaceName','hasChanges','3KDBfIU','Workspace\x20is\x20required.','length','\x20files\x20to\x20','8YINULO','files','utf-8','Pull\x20templates\x20to\x20YAML\x20files','Aborted.','execute','662226PcjwdA','\x0aChanges\x20to\x20\x27','2090uRzHQa','29967QjLhQo','yellow','cyan','\x20\x20Target:\x20','green','description','Write\x20','Pulling\x20templates\x20from\x20\x27','No\x20templates\x20found\x20in\x20workspace\x20\x27','β\x20Context\x20set:\x20','173542sVrBde','3436596SJvLbm','config','\x0aError:','filter','\x27...','2788332lJhKbo','counts','absolutePath','\x20files?'];a21_0x2b94=function(){return _0xdeeab6;};return a21_0x2b94();}const a21_0x23ef2b=a21_0x4bd5;(function(_0x45bc19,_0x4030b7){const _0x4aa1c8=a21_0x4bd5,_0x4ccd0b=_0x45bc19();while(!![]){try{const _0x287669=-parseInt(_0x4aa1c8(0xeb))/0x1+-parseInt(_0x4aa1c8(0xf8))/0x2*(-parseInt(_0x4aa1c8(0xe1))/0x3)+-parseInt(_0x4aa1c8(0xfe))/0x4+-parseInt(_0x4aa1c8(0xc8))/0x5+-parseInt(_0x4aa1c8(0xde))/0x6*(parseInt(_0x4aa1c8(0xee))/0x7)+parseInt(_0x4aa1c8(0xe5))/0x8*(parseInt(_0x4aa1c8(0xf9))/0x9)+parseInt(_0x4aa1c8(0xed))/0xa*(parseInt(_0x4aa1c8(0xc6))/0xb);if(_0x287669===_0x4030b7)break;else _0x4ccd0b['push'](_0x4ccd0b['shift']());}catch(_0x3ba448){_0x4ccd0b['push'](_0x4ccd0b['shift']());}}}(a21_0x2b94,0x6afda));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 a21_0x17240b from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a21_0x33d4d3 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a21_0x23ef2b(0xdc)]=a21_0x23ef2b(0x104);[a21_0x23ef2b(0xf3)]=a21_0x23ef2b(0xe8);async[a21_0x23ef2b(0xea)](_0x24e8cc){const _0x1332aa=a21_0x23ef2b,{options:_0x289104,args:_0x570d56,tdx:_0x195f0d}=_0x24e8cc,_0xa19a5e=_0x289104,_0x46b2de=await resolveWorkspaceName(_0x570d56[0x0],_0xa19a5e);if(!_0x46b2de)return console[_0x1332aa(0x103)](a21_0x17240b[_0x1332aa(0xef)](_0x1332aa(0xe2))),console[_0x1332aa(0x103)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console[_0x1332aa(0x103)](_0x1332aa(0xdb)),console[_0x1332aa(0x103)](_0x1332aa(0xd9)),0x1;const _0x58083e=await withProgressSpinner(_0x1332aa(0xf5)+_0x46b2de+_0x1332aa(0xfd),_0x519a7a=>pullTemplates({'engage':_0x195f0d['engage']},_0x46b2de,{'templateName':_0xa19a5e[_0x1332aa(0xdc)],'progress':{'update':_0x31d747=>{const _0x2edcc5=_0x1332aa;_0x519a7a[_0x2edcc5(0xd6)](_0x31d747);}}}),{'verbose':_0xa19a5e[_0x1332aa(0xd5)]}),_0x3612b9=_0x58083e[_0x1332aa(0xcd)];if(_0x3612b9['counts'][_0x1332aa(0xd4)]===0x0)return console[_0x1332aa(0x103)](a21_0x17240b[_0x1332aa(0xef)](_0x1332aa(0xf6)+_0x3612b9['workspaceName']+'\x27')),0x0;const _0x3de17e=_0x3612b9[_0x1332aa(0xe6)]['filter'](_0x2714bb=>_0x2714bb['isNew']),_0x62c072=_0x3612b9['files'][_0x1332aa(0xfc)](_0x367531=>!_0x367531[_0x1332aa(0xc5)]&&_0x367531[_0x1332aa(0xe0)]),_0x2cabb4=_0x3612b9[_0x1332aa(0xe6)]['filter'](_0xfabd32=>!_0xfabd32['isNew']&&!_0xfabd32[_0x1332aa(0xe0)]);console[_0x1332aa(0x103)]('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x3612b9[_0x1332aa(0xdf)]+'\x27:'),console[_0x1332aa(0x103)]('\x20\x20'+a21_0x17240b['cyan'](_0x3612b9[_0x1332aa(0xff)][_0x1332aa(0xd4)]+_0x1332aa(0xcb))),console[_0x1332aa(0x103)]('\x20\x20'+a21_0x17240b['green']('+\x20'+_0x3de17e['length']+_0x1332aa(0xc9))),console[_0x1332aa(0x103)]('\x20\x20'+a21_0x17240b['yellow']('~\x20'+_0x62c072[_0x1332aa(0xe3)]+_0x1332aa(0xd2))),console[_0x1332aa(0x103)]('\x20\x20'+a21_0x17240b['dim']('=\x20'+_0x2cabb4[_0x1332aa(0xe3)]+'\x20unchanged\x20files')),console[_0x1332aa(0x103)](_0x1332aa(0xf1)+a21_0x17240b[_0x1332aa(0xf0)](_0x3612b9[_0x1332aa(0xdd)])+'\x0a');if(_0x62c072[_0x1332aa(0xe3)]>0x0)for(const _0x6ccba7 of _0x62c072){console[_0x1332aa(0x103)](_0x1332aa(0xec)+_0x6ccba7[_0x1332aa(0xd3)]+'\x27:'),console[_0x1332aa(0x103)]('β'['repeat'](0x3c)),console[_0x1332aa(0x103)](_0x6ccba7[_0x1332aa(0xd8)]),console['error']('β'[_0x1332aa(0xca)](0x3c));}if(_0xa19a5e['dryRun'])return console[_0x1332aa(0x103)](a21_0x17240b['yellow'](_0x1332aa(0xce))),0x0;if(_0x3de17e['length']===0x0&&_0x62c072['length']===0x0)return console[_0x1332aa(0x103)](a21_0x17240b['green'](_0x1332aa(0xcc))),saveSessionContext({'engage_workspace':_0x3612b9[_0x1332aa(0xdf)]},_0xa19a5e[_0x1332aa(0xd1)]),0x0;if(!_0xa19a5e[_0x1332aa(0xc4)]){if(!isInteractive())return console[_0x1332aa(0x103)](a21_0x17240b['red'](_0x1332aa(0xfb)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1332aa(0x103)](a21_0x17240b[_0x1332aa(0xd0)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5e5358=await confirmKey(_0x1332aa(0xf4)+(_0x3de17e[_0x1332aa(0xe3)]+_0x62c072['length'])+_0x1332aa(0x101));if(!_0x5e5358)return console[_0x1332aa(0x103)](a21_0x17240b['yellow'](_0x1332aa(0xe9)),_0x1332aa(0xd7)),0x1;}for(const _0x8ef842 of _0x3612b9[_0x1332aa(0xe6)]){if(_0x8ef842['isNew']||_0x8ef842[_0x1332aa(0xe0)]){const _0xa628a=a21_0x33d4d3['dirname'](_0x8ef842[_0x1332aa(0x100)]);!existsSync(_0xa628a)&&mkdirSync(_0xa628a,{'recursive':!![]}),writeFileSync(_0x8ef842['absolutePath'],_0x8ef842['content'],_0x1332aa(0xe7));}}return console[_0x1332aa(0x103)](a21_0x17240b[_0x1332aa(0xf2)](_0x1332aa(0xcf)+(_0x3de17e[_0x1332aa(0xe3)]+_0x62c072[_0x1332aa(0xe3)])+_0x1332aa(0xe4)+_0x3612b9[_0x1332aa(0xdd)])),saveSessionContext({'engage_workspace':_0x3612b9[_0x1332aa(0xdf)]},_0xa19a5e[_0x1332aa(0xd1)]),console[_0x1332aa(0x103)](a21_0x17240b['green'](_0x1332aa(0xf7)+a21_0x17240b[_0x1332aa(0xd0)](_0x1332aa(0x102))+'\x20=\x20'+a21_0x17240b[_0x1332aa(0xf0)](_0x3612b9[_0x1332aa(0xdf)]))),0x0;}}function a21_0x4bd5(_0x909226,_0x34e757){_0x909226=_0x909226-0xc4;const _0x2b9486=a21_0x2b94();let _0x4bd534=_0x2b9486[_0x909226];return _0x4bd534;}async function resolveWorkspaceName(_0x5546f2,_0xe05ea9){const _0xc4e5cf=a21_0x23ef2b;if(_0x5546f2)return _0x5546f2;if(_0xe05ea9[_0xc4e5cf(0xc7)])return _0xe05ea9[_0xc4e5cf(0xc7)];const _0x56e590=tryFindTdxConfig(process[_0xc4e5cf(0xda)]());if(_0x56e590?.['config'][_0xc4e5cf(0x102)])return _0x56e590[_0xc4e5cf(0xfa)][_0xc4e5cf(0x102)];const _0x1b592e=loadSessionContext(_0xe05ea9[_0xc4e5cf(0xd1)]);if(_0x1b592e?.['engage_workspace'])return _0x1b592e['engage_workspace'];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a22_0x4d42(){const _0x44aac2=['yellow','green','\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','960073RDETgG','update','cyan','resolveWorkspaceId','templateId','\x20templates','5TXWviz','1584248lbbiAu','configDir','-\x20no\x20changes\x20applied','name','def','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\x0aPush\x20summary\x20for\x20workspace\x20\x27','setPhase','execute','error','538353ChUJWA','\x20templates?','2020720YuMKge','Aborted.','session','\x0aValidation\x20errors\x20in\x20','Push\x20','\x20errors:','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','relativePath','action','\x0aError:','verbose','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','engage:template:push','length','230942XTZNhU','Preparing\x20push\x20to\x20workspace\x20\x27','config','\x20template\x20files','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','red','β\x20Updated\x20','56oPowwG','engage','dryRun','dirname','116166ZpYIGq','created','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Workspace\x20is\x20required.','data','\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)','22tSfvQc','filter','engage_workspace','Pushing\x20templates...','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','Found\x20','\x20\x20\x20\x20','warnings','dim','updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','workspace','resolve','message','6GSckvj','9318200aieawA','create','No\x20template\x20YAML\x20files\x20found\x20in\x20','errors','path'];a22_0x4d42=function(){return _0x44aac2;};return a22_0x4d42();}const a22_0x53a33b=a22_0x1889;(function(_0x39cdb8,_0x36db8e){const _0x520b32=a22_0x1889,_0x2a7861=_0x39cdb8();while(!![]){try{const _0x4078d1=parseInt(_0x520b32(0x101))/0x1+-parseInt(_0x520b32(0x122))/0x2*(-parseInt(_0x520b32(0xf8))/0x3)+-parseInt(_0x520b32(0x114))/0x4+parseInt(_0x520b32(0x107))/0x5*(parseInt(_0x520b32(0x12d))/0x6)+parseInt(_0x520b32(0x129))/0x7*(-parseInt(_0x520b32(0x108))/0x8)+-parseInt(_0x520b32(0x112))/0x9+parseInt(_0x520b32(0xf9))/0xa*(parseInt(_0x520b32(0x133))/0xb);if(_0x4078d1===_0x36db8e)break;else _0x2a7861['push'](_0x2a7861['shift']());}catch(_0x557f9a){_0x2a7861['push'](_0x2a7861['shift']());}}}(a22_0x4d42,0xe1c63));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a22_0x1889(_0x5b9f6d,_0x580a63){_0x5b9f6d=_0x5b9f6d-0xf8;const _0x4d42c9=a22_0x4d42();let _0x18893b=_0x4d42c9[_0x5b9f6d];return _0x18893b;}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 a22_0x33aa9d from'chalk';import a22_0x4c0050 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']=a22_0x53a33b(0x120);['description']=a22_0x53a33b(0x126);async[a22_0x53a33b(0x110)](_0x8ade17){const _0x3ce16c=a22_0x53a33b,{options:_0x403fe0,args:_0x6175b6,tdx:_0x40a3c5}=_0x8ade17,_0x29faea=_0x403fe0,_0x50cf02=_0x6175b6[0x0],_0x2307a7=_0x50cf02?a22_0x4c0050[_0x3ce16c(0x13f)](_0x50cf02):undefined,_0x1bd2da=_0x2307a7?isYamlFile(_0x2307a7):![];let _0x236bf4;if(_0x1bd2da&&_0x2307a7)_0x236bf4=a22_0x4c0050[_0x3ce16c(0x12c)](_0x2307a7);else _0x2307a7?_0x236bf4=_0x2307a7:_0x236bf4=process['cwd']();let _0x1fe40e;const _0x4dda0e=tryFindTdxConfig(_0x236bf4);_0x4dda0e?.['config'][_0x3ce16c(0x135)]&&(_0x1fe40e=_0x4dda0e[_0x3ce16c(0x124)][_0x3ce16c(0x135)],!_0x1bd2da&&(_0x236bf4=_0x4dda0e[_0x3ce16c(0x109)]));_0x29faea[_0x3ce16c(0x13e)]&&(_0x1fe40e=_0x29faea[_0x3ce16c(0x13e)]);if(!_0x1fe40e){const _0x3f7df1=loadSessionContext(_0x29faea[_0x3ce16c(0x116)]);_0x3f7df1?.[_0x3ce16c(0x135)]&&(_0x1fe40e=_0x3f7df1[_0x3ce16c(0x135)]);}if(!_0x1fe40e)return console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0xfe)](_0x3ce16c(0x130))),console['error'](_0x3ce16c(0x100)),console['error'](_0x3ce16c(0x132)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console[_0x3ce16c(0x111)](_0x3ce16c(0x137)),0x1;let _0x2c5be3;_0x1bd2da&&_0x2307a7?_0x2c5be3=[parseTemplateFile(_0x2307a7,a22_0x4c0050['dirname'](_0x2307a7))]:_0x2c5be3=discoverAndParseTemplateFiles(_0x236bf4);if(_0x2c5be3[_0x3ce16c(0x121)]===0x0)return console['error'](a22_0x33aa9d[_0x3ce16c(0xfe)](_0x3ce16c(0xfb)+_0x236bf4)),console[_0x3ce16c(0x111)](a22_0x33aa9d['dim'](_0x3ce16c(0x11f))),0x1;const _0x13310a=_0x2c5be3['length']===0x1?'1\x20template\x20file:\x20'+_0x2c5be3[0x0][_0x3ce16c(0x10c)][_0x3ce16c(0x10b)]:_0x2c5be3[_0x3ce16c(0x121)]+_0x3ce16c(0x125);console[_0x3ce16c(0x111)](_0x3ce16c(0x138)+a22_0x33aa9d[_0x3ce16c(0x103)](_0x13310a));let _0xd9ab4a=![];for(const _0x5b92e7 of _0x2c5be3){const _0x309246=validateTemplateDef(_0x5b92e7[_0x3ce16c(0x10c)]);if(!_0x309246['valid']){_0xd9ab4a=!![],console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x127)](_0x3ce16c(0x117)+_0x5b92e7[_0x3ce16c(0x11b)]+':'));for(const _0x15e44c of _0x309246['errors']){console[_0x3ce16c(0x111)]('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0x127)]('β')+'\x20'+_0x15e44c['path']+':\x20'+_0x15e44c[_0x3ce16c(0x140)]);}}for(const _0x199035 of _0x309246[_0x3ce16c(0x13a)]){console[_0x3ce16c(0x111)]('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0xfe)]('β ')+'\x20'+_0x199035[_0x3ce16c(0xfd)]+':\x20'+_0x199035[_0x3ce16c(0x140)]);}}if(_0xd9ab4a)return console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x127)](_0x3ce16c(0x11a))),0x1;const _0x299ccc=await _0x40a3c5[_0x3ce16c(0x12a)][_0x3ce16c(0x104)](_0x1fe40e),_0x1da7d0=await withProgressSpinner(_0x3ce16c(0x123)+_0x1fe40e+'\x27...',_0x2856be=>preparePush({'engage':_0x40a3c5['engage']},_0x2c5be3,_0x299ccc,{'progress':{'update':_0x118052=>_0x2856be[_0x3ce16c(0x10f)](_0x118052)}}),{'verbose':_0x29faea['verbose']}),_0x131816=_0x1da7d0[_0x3ce16c(0x131)];await withProgressSpinner('Resolving\x20references...',_0x5a742b=>resolveAndBuildInputs({'engage':_0x40a3c5['engage']},_0x131816,_0x299ccc,{'progress':{'update':_0xfd1f36=>_0x5a742b['setPhase'](_0xfd1f36)}}),{'verbose':_0x29faea[_0x3ce16c(0x11e)]});const _0x1d0388=_0x131816[_0x3ce16c(0x134)](_0x1b798e=>_0x1b798e[_0x3ce16c(0x11c)]===_0x3ce16c(0xfa)),_0x5287b2=_0x131816[_0x3ce16c(0x134)](_0x5953b0=>_0x5953b0['action']===_0x3ce16c(0x102));console[_0x3ce16c(0x111)](_0x3ce16c(0x10e)+_0x1fe40e+'\x27:');if(_0x1d0388[_0x3ce16c(0x121)]>0x0){console[_0x3ce16c(0x111)]('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0xff)]('+\x20'+_0x1d0388[_0x3ce16c(0x121)]+'\x20new\x20templates:'));for(const _0x167798 of _0x1d0388){console[_0x3ce16c(0x111)]('\x20\x20\x20\x20'+a22_0x33aa9d[_0x3ce16c(0xff)]('+')+'\x20'+_0x167798[_0x3ce16c(0x10c)][_0x3ce16c(0x10b)]);}}if(_0x5287b2[_0x3ce16c(0x121)]>0x0){console['error']('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0xfe)]('~\x20'+_0x5287b2[_0x3ce16c(0x121)]+'\x20templates\x20to\x20update:'));for(const _0x115877 of _0x5287b2){console[_0x3ce16c(0x111)](_0x3ce16c(0x139)+a22_0x33aa9d['yellow']('~')+'\x20'+_0x115877[_0x3ce16c(0x10c)][_0x3ce16c(0x10b)]);}}if(_0x1d0388[_0x3ce16c(0x121)]===0x0&&_0x5287b2['length']===0x0)return console['error'](a22_0x33aa9d[_0x3ce16c(0xff)]('β\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x29faea[_0x3ce16c(0x12b)])return console['error'](a22_0x33aa9d[_0x3ce16c(0xfe)](_0x3ce16c(0x10d))),0x0;if(!_0x29faea['yes']){if(!isInteractive())return console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x127)](_0x3ce16c(0x11d)),_0x3ce16c(0x13d)),console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x13b)](_0x3ce16c(0x12f))),0x1;const _0x1790af=await confirmKey(_0x3ce16c(0x118)+(_0x1d0388[_0x3ce16c(0x121)]+_0x5287b2[_0x3ce16c(0x121)])+_0x3ce16c(0x113));if(!_0x1790af)return console['error'](a22_0x33aa9d['yellow'](_0x3ce16c(0x115)),_0x3ce16c(0x10a)),0x1;}const _0x1a50a0=await withProgressSpinner(_0x3ce16c(0x136),_0x747bf8=>executePush({'engage':_0x40a3c5[_0x3ce16c(0x12a)]},_0x131816,{'progress':{'update':_0x2571cc=>_0x747bf8['setPhase'](_0x2571cc)}}),{'verbose':_0x29faea[_0x3ce16c(0x11e)]}),_0x304a52=_0x1a50a0[_0x3ce16c(0x131)];for(const _0x291240 of _0x304a52['results']){if(_0x291240[_0x3ce16c(0x105)]&&(_0x291240['action']===_0x3ce16c(0x12e)||_0x291240[_0x3ce16c(0x11c)]===_0x3ce16c(0x13c))){const _0x2cb2da=getTemplateUrl(_0x29faea['site'],_0x299ccc,_0x291240[_0x3ce16c(0x105)]),_0x43f919=_0x291240['action']===_0x3ce16c(0x12e)?'+':'~',_0x17e2c0=_0x291240[_0x3ce16c(0x11c)]==='created'?a22_0x33aa9d[_0x3ce16c(0xff)](_0x43f919):a22_0x33aa9d[_0x3ce16c(0xfe)](_0x43f919);console[_0x3ce16c(0x111)]('\x20\x20'+_0x17e2c0+'\x20'+hyperlink(_0x291240[_0x3ce16c(0x10b)],_0x2cb2da)+'\x20'+a22_0x33aa9d[_0x3ce16c(0x13b)](_0x2cb2da));}}_0x304a52[_0x3ce16c(0x12e)]>0x0&&console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0xff)]('β\x20Created\x20'+_0x304a52[_0x3ce16c(0x12e)]+'\x20templates'));_0x304a52[_0x3ce16c(0x13c)]>0x0&&console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0xff)](_0x3ce16c(0x128)+_0x304a52[_0x3ce16c(0x13c)]+_0x3ce16c(0x106)));if(_0x304a52[_0x3ce16c(0xfc)][_0x3ce16c(0x121)]>0x0){console[_0x3ce16c(0x111)](a22_0x33aa9d[_0x3ce16c(0x127)]('β\x20'+_0x304a52[_0x3ce16c(0xfc)][_0x3ce16c(0x121)]+_0x3ce16c(0x119)));for(const _0x305d4e of _0x304a52[_0x3ce16c(0xfc)]){console['error']('\x20\x20'+a22_0x33aa9d[_0x3ce16c(0x127)](_0x305d4e[_0x3ce16c(0x10b)])+':\x20'+_0x305d4e[_0x3ce16c(0x111)]);}}return saveSessionContext({'engage_workspace':_0x1fe40e},_0x29faea[_0x3ce16c(0x116)]),_0x304a52['errors']['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a22_0x10ab41=a22_0xf83c;(function(_0x166a89,_0x3f5e9f){const _0x13a8b9=a22_0xf83c,_0x1cec85=_0x166a89();while(!![]){try{const _0x39338f=-parseInt(_0x13a8b9(0xcb))/0x1*(parseInt(_0x13a8b9(0xec))/0x2)+parseInt(_0x13a8b9(0xf8))/0x3*(-parseInt(_0x13a8b9(0xf6))/0x4)+-parseInt(_0x13a8b9(0xbb))/0x5+-parseInt(_0x13a8b9(0xd1))/0x6+parseInt(_0x13a8b9(0xf4))/0x7+-parseInt(_0x13a8b9(0xf1))/0x8*(-parseInt(_0x13a8b9(0xba))/0x9)+-parseInt(_0x13a8b9(0xf3))/0xa*(-parseInt(_0x13a8b9(0xde))/0xb);if(_0x39338f===_0x3f5e9f)break;else _0x1cec85['push'](_0x1cec85['shift']());}catch(_0x49686f){_0x1cec85['push'](_0x1cec85['shift']());}}}(a22_0x5217,0x60d4b));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 a22_0x4dd38b from'chalk';import a22_0x155630 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';function a22_0xf83c(_0x1c5808,_0x5abceb){_0x1c5808=_0x1c5808-0xb5;const _0x521709=a22_0x5217();let _0xf83c65=_0x521709[_0x1c5808];return _0xf83c65;}import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a22_0x5217(){const _0x62581f=['engage:template:push','24937WMNnDf','valid','dirname','length','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','path','config','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','dryRun','session','relativePath','No\x20template\x20YAML\x20files\x20found\x20in\x20','Workspace\x20is\x20required.','created','764NMOHRz','1\x20template\x20file:\x20','cyan','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','\x20errors:','67784DqtgyG','engage_workspace','4710nRyOaS','1736756UtFRwt','data','2821584bnnHBf','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','3usVVcC','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','create','yellow','description','setPhase','Resolving\x20references...','action','β\x20Created\x20','477clrcDK','483930tsnAYt','β\x20Updated\x20','β\x20All\x20templates\x20are\x20up\x20to\x20date','\x20templates','Push\x20','\x0aPush\x20summary\x20for\x20workspace\x20\x27','workspace','Pushing\x20templates...','verbose','\x20new\x20templates:','\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','templateId','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x20\x20\x20\x20','\x0aError:','\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','29wMdyeO','results','\x0aValidation\x20errors\x20in\x20','name','engage','message','3330330FphdLx','def','\x20template\x20files','red','yes','errors','resolve','updated','green','Aborted.','dim','error'];a22_0x5217=function(){return _0x62581f;};return a22_0x5217();}export class EngageTemplatePushCommand extends BaseCommand{['name']=a22_0x10ab41(0xdd);[a22_0x10ab41(0xb5)]=a22_0x10ab41(0xef);async['execute'](_0x140621){const _0x45a8e9=a22_0x10ab41,{options:_0x551d92,args:_0x289f24,tdx:_0x5132bd}=_0x140621,_0x15c7fd=_0x551d92,_0x1d1003=_0x289f24[0x0],_0x53ee0a=_0x1d1003?a22_0x155630[_0x45a8e9(0xd7)](_0x1d1003):undefined,_0x4410c0=_0x53ee0a?isYamlFile(_0x53ee0a):![];let _0x270d6c;if(_0x4410c0&&_0x53ee0a)_0x270d6c=a22_0x155630[_0x45a8e9(0xe0)](_0x53ee0a);else _0x53ee0a?_0x270d6c=_0x53ee0a:_0x270d6c=process['cwd']();let _0x2a7330;const _0xcd1f08=tryFindTdxConfig(_0x270d6c);_0xcd1f08?.[_0x45a8e9(0xe4)][_0x45a8e9(0xf2)]&&(_0x2a7330=_0xcd1f08[_0x45a8e9(0xe4)][_0x45a8e9(0xf2)],!_0x4410c0&&(_0x270d6c=_0xcd1f08['configDir']));_0x15c7fd[_0x45a8e9(0xc1)]&&(_0x2a7330=_0x15c7fd[_0x45a8e9(0xc1)]);if(!_0x2a7330){const _0x248694=loadSessionContext(_0x15c7fd[_0x45a8e9(0xe7)]);_0x248694?.[_0x45a8e9(0xf2)]&&(_0x2a7330=_0x248694[_0x45a8e9(0xf2)]);}if(!_0x2a7330)return console[_0x45a8e9(0xdc)](a22_0x4dd38b[_0x45a8e9(0xfb)](_0x45a8e9(0xea))),console[_0x45a8e9(0xdc)](_0x45a8e9(0xc5)),console[_0x45a8e9(0xdc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console['error'](_0x45a8e9(0xca)),console[_0x45a8e9(0xdc)](_0x45a8e9(0xf7)),0x1;let _0x2b0719;_0x4410c0&&_0x53ee0a?_0x2b0719=[parseTemplateFile(_0x53ee0a,a22_0x155630[_0x45a8e9(0xe0)](_0x53ee0a))]:_0x2b0719=discoverAndParseTemplateFiles(_0x270d6c);if(_0x2b0719[_0x45a8e9(0xe1)]===0x0)return console[_0x45a8e9(0xdc)](a22_0x4dd38b[_0x45a8e9(0xfb)](_0x45a8e9(0xe9)+_0x270d6c)),console[_0x45a8e9(0xdc)](a22_0x4dd38b[_0x45a8e9(0xdb)](_0x45a8e9(0xf9))),0x1;const _0x30d537=_0x2b0719[_0x45a8e9(0xe1)]===0x1?_0x45a8e9(0xed)+_0x2b0719[0x0][_0x45a8e9(0xd2)]['name']:_0x2b0719[_0x45a8e9(0xe1)]+_0x45a8e9(0xd3);console[_0x45a8e9(0xdc)]('Found\x20'+a22_0x4dd38b[_0x45a8e9(0xee)](_0x30d537));let _0x2fb620=![];for(const _0x46f13b of _0x2b0719){const _0x91f6=validateTemplateDef(_0x46f13b[_0x45a8e9(0xd2)]);if(!_0x91f6[_0x45a8e9(0xdf)]){_0x2fb620=!![],console[_0x45a8e9(0xdc)](a22_0x4dd38b['red'](_0x45a8e9(0xcd)+_0x46f13b[_0x45a8e9(0xe8)]+':'));for(const _0xbee2c1 of _0x91f6[_0x45a8e9(0xd6)]){console[_0x45a8e9(0xdc)]('\x20\x20'+a22_0x4dd38b[_0x45a8e9(0xd4)]('β')+'\x20'+_0xbee2c1[_0x45a8e9(0xe3)]+':\x20'+_0xbee2c1[_0x45a8e9(0xd0)]);}}for(const _0x218913 of _0x91f6['warnings']){console['error']('\x20\x20'+a22_0x4dd38b[_0x45a8e9(0xfb)]('β ')+'\x20'+_0x218913[_0x45a8e9(0xe3)]+':\x20'+_0x218913[_0x45a8e9(0xd0)]);}}if(_0x2fb620)return console['error'](a22_0x4dd38b['red'](_0x45a8e9(0xc7))),0x1;const _0x1cbcb6=await _0x5132bd[_0x45a8e9(0xcf)]['resolveWorkspaceId'](_0x2a7330),_0x2e79ec=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x2a7330+'\x27...',_0x5246e8=>preparePush({'engage':_0x5132bd[_0x45a8e9(0xcf)]},_0x2b0719,_0x1cbcb6,{'progress':{'update':_0x4f8120=>_0x5246e8[_0x45a8e9(0xb6)](_0x4f8120)}}),{'verbose':_0x15c7fd[_0x45a8e9(0xc3)]}),_0x1bcb6a=_0x2e79ec['data'];await withProgressSpinner(_0x45a8e9(0xb7),_0x2dcb02=>resolveAndBuildInputs({'engage':_0x5132bd[_0x45a8e9(0xcf)]},_0x1bcb6a,_0x1cbcb6,{'progress':{'update':_0x467b67=>_0x2dcb02[_0x45a8e9(0xb6)](_0x467b67)}}),{'verbose':_0x15c7fd[_0x45a8e9(0xc3)]});const _0x1fbfbc=_0x1bcb6a['filter'](_0x5e224c=>_0x5e224c['action']===_0x45a8e9(0xfa)),_0x131166=_0x1bcb6a['filter'](_0x1c47c2=>_0x1c47c2['action']==='update');console[_0x45a8e9(0xdc)](_0x45a8e9(0xc0)+_0x2a7330+'\x27:');if(_0x1fbfbc[_0x45a8e9(0xe1)]>0x0){console[_0x45a8e9(0xdc)]('\x20\x20'+a22_0x4dd38b['green']('+\x20'+_0x1fbfbc[_0x45a8e9(0xe1)]+_0x45a8e9(0xc4)));for(const _0x14ebf9 of _0x1fbfbc){console[_0x45a8e9(0xdc)](_0x45a8e9(0xc8)+a22_0x4dd38b[_0x45a8e9(0xd9)]('+')+'\x20'+_0x14ebf9['def']['name']);}}if(_0x131166[_0x45a8e9(0xe1)]>0x0){console[_0x45a8e9(0xdc)]('\x20\x20'+a22_0x4dd38b[_0x45a8e9(0xfb)]('~\x20'+_0x131166[_0x45a8e9(0xe1)]+'\x20templates\x20to\x20update:'));for(const _0x4ff5a3 of _0x131166){console['error'](_0x45a8e9(0xc8)+a22_0x4dd38b['yellow']('~')+'\x20'+_0x4ff5a3['def'][_0x45a8e9(0xce)]);}}if(_0x1fbfbc[_0x45a8e9(0xe1)]===0x0&&_0x131166[_0x45a8e9(0xe1)]===0x0)return console[_0x45a8e9(0xdc)](a22_0x4dd38b[_0x45a8e9(0xd9)](_0x45a8e9(0xbd))),0x0;if(_0x15c7fd[_0x45a8e9(0xe6)])return console['error'](a22_0x4dd38b[_0x45a8e9(0xfb)](_0x45a8e9(0xe5))),0x0;if(!_0x15c7fd[_0x45a8e9(0xd5)]){if(!isInteractive())return console[_0x45a8e9(0xdc)](a22_0x4dd38b['red'](_0x45a8e9(0xc9)),_0x45a8e9(0xe2)),console['error'](a22_0x4dd38b[_0x45a8e9(0xdb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x31a8b1=await confirmKey(_0x45a8e9(0xbf)+(_0x1fbfbc['length']+_0x131166['length'])+'\x20templates?');if(!_0x31a8b1)return console[_0x45a8e9(0xdc)](a22_0x4dd38b['yellow'](_0x45a8e9(0xda)),'-\x20no\x20changes\x20applied'),0x1;}const _0x5642f5=await withProgressSpinner(_0x45a8e9(0xc2),_0x3b92d3=>executePush({'engage':_0x5132bd[_0x45a8e9(0xcf)]},_0x1bcb6a,{'progress':{'update':_0x58a7ff=>_0x3b92d3[_0x45a8e9(0xb6)](_0x58a7ff)}}),{'verbose':_0x15c7fd['verbose']}),_0x2633c1=_0x5642f5[_0x45a8e9(0xf5)];for(const _0x1dd630 of _0x2633c1[_0x45a8e9(0xcc)]){if(_0x1dd630[_0x45a8e9(0xc6)]&&(_0x1dd630['action']===_0x45a8e9(0xeb)||_0x1dd630[_0x45a8e9(0xb8)]===_0x45a8e9(0xd8))){const _0x502dc1=getTemplateUrl(_0x15c7fd['site'],_0x1cbcb6,_0x1dd630[_0x45a8e9(0xc6)]),_0x252fc8=_0x1dd630['action']===_0x45a8e9(0xeb)?'+':'~',_0x3a349c=_0x1dd630[_0x45a8e9(0xb8)]===_0x45a8e9(0xeb)?a22_0x4dd38b['green'](_0x252fc8):a22_0x4dd38b[_0x45a8e9(0xfb)](_0x252fc8);console[_0x45a8e9(0xdc)]('\x20\x20'+_0x3a349c+'\x20'+hyperlink(_0x1dd630['name'],_0x502dc1)+'\x20'+a22_0x4dd38b['dim'](_0x502dc1));}}_0x2633c1[_0x45a8e9(0xeb)]>0x0&&console[_0x45a8e9(0xdc)](a22_0x4dd38b['green'](_0x45a8e9(0xb9)+_0x2633c1[_0x45a8e9(0xeb)]+_0x45a8e9(0xbe)));_0x2633c1[_0x45a8e9(0xd8)]>0x0&&console[_0x45a8e9(0xdc)](a22_0x4dd38b[_0x45a8e9(0xd9)](_0x45a8e9(0xbc)+_0x2633c1[_0x45a8e9(0xd8)]+_0x45a8e9(0xbe)));if(_0x2633c1[_0x45a8e9(0xd6)][_0x45a8e9(0xe1)]>0x0){console['error'](a22_0x4dd38b['red']('β\x20'+_0x2633c1[_0x45a8e9(0xd6)][_0x45a8e9(0xe1)]+_0x45a8e9(0xf0)));for(const _0xf83156 of _0x2633c1[_0x45a8e9(0xd6)]){console[_0x45a8e9(0xdc)]('\x20\x20'+a22_0x4dd38b['red'](_0xf83156[_0x45a8e9(0xce)])+':\x20'+_0xf83156[_0x45a8e9(0xdc)]);}}return saveSessionContext({'engage_workspace':_0x2a7330},_0x15c7fd[_0x45a8e9(0xe7)]),_0x2633c1[_0x45a8e9(0xd6)]['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x1aad25=a23_0x1d6e;(function(_0x1a3f56,_0x5ea7bc){const _0xc9dcc7=a23_0x1d6e,_0x113493=_0x1a3f56();while(!![]){try{const _0x27a38a=-parseInt(_0xc9dcc7(0x112))/0x1+-parseInt(_0xc9dcc7(0x108))/0x2*(-parseInt(_0xc9dcc7(0xfe))/0x3)+parseInt(_0xc9dcc7(0x10d))/0x4+-parseInt(_0xc9dcc7(0x10e))/0x5*(parseInt(_0xc9dcc7(0x127))/0x6)+-parseInt(_0xc9dcc7(0x106))/0x7*(parseInt(_0xc9dcc7(0x123))/0x8)+-parseInt(_0xc9dcc7(0x115))/0x9+parseInt(_0xc9dcc7(0x121))/0xa;if(_0x27a38a===_0x5ea7bc)break;else _0x113493['push'](_0x113493['shift']());}catch(_0x51bf9a){_0x113493['push'](_0x113493['shift']());}}}(a23_0x7d18,0xe57ac));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a23_0x1d6e(_0x230c98,_0x9440b2){_0x230c98=_0x230c98-0xfd;const _0x7d18ca=a23_0x7d18();let _0x1d6ee1=_0x7d18ca[_0x230c98];return _0x1d6ee1;}import{existsSync}from'fs';import a23_0x4fbcd5 from'chalk';import a23_0x315a37 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a23_0x7d18(){const _0x4cf5c7=['warnings','8531982pTeCPB','.yaml','invalidCount','skippedCount','No\x20template\x20YAML\x20files\x20found\x20in\x20','execute','.yml','filter','error','length','valid','\x20error(s)','9773970EMBLvY','log','3761936RBAuhX','warningCount','yellow','\x20valid','6ihwVLC','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20template(s)\x20with\x20errors,\x20','\x20non-template\x20file(s)\x20skipped','errors','4688472IVQYNZ','Validation\x20failed:\x20','Validate\x20template\x20YAML\x20files','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20(skipped:\x20','engage:template:validate','\x20non-template\x20file(s)\x20skipped)','\x20warning(s)\x20found','7KyMykL','dim','2fggIbG','red','endsWith','hasErrors','resolve','4257468ahAxcy','5111945gYvVjW','validCount','verbose','Error:\x20Directory\x20not\x20found:\x20','224011XdnnFP','cwd'];a23_0x7d18=function(){return _0x4cf5c7;};return a23_0x7d18();}export class EngageTemplateValidateCommand extends BaseCommand{['name']=a23_0x1aad25(0x103);['description']=a23_0x1aad25(0x100);async[a23_0x1aad25(0x11a)](_0x1388a8){const _0x3f59b5=a23_0x1aad25,{options:_0x5ad9bd,args:_0x3bf4a2}=_0x1388a8,_0x3952d6=_0x5ad9bd,_0x289555=_0x3bf4a2[0x0],_0x2db9cd=_0x289555?a23_0x315a37[_0x3f59b5(0x10c)](_0x289555):undefined,_0x1deacc=_0x2db9cd?isYamlFile(_0x2db9cd):![];let _0x148470,_0x292234;if(_0x1deacc&&_0x2db9cd)_0x148470=a23_0x315a37['dirname'](_0x2db9cd),_0x292234=_0x2db9cd;else _0x2db9cd?_0x148470=_0x2db9cd:_0x148470=process[_0x3f59b5(0x113)]();if(!_0x292234&&!existsSync(_0x148470))return console[_0x3f59b5(0x11d)](a23_0x4fbcd5[_0x3f59b5(0x109)](_0x3f59b5(0x111)+_0x148470+'\x0a')),0x1;let _0x22557d;if(_0x292234){if(!_0x292234[_0x3f59b5(0x10a)](_0x3f59b5(0x11b))&&!_0x292234[_0x3f59b5(0x10a)](_0x3f59b5(0x116)))return console[_0x3f59b5(0x11d)](a23_0x4fbcd5[_0x3f59b5(0x109)](_0x3f59b5(0x128)+_0x292234+'\x0a')),0x1;_0x22557d=[_0x292234];}else _0x22557d=findYamlFiles(_0x148470);if(_0x22557d['length']===0x0)return console[_0x3f59b5(0x11d)](a23_0x4fbcd5['red'](_0x3f59b5(0x101)+_0x148470+'\x0a')),0x1;const _0x200a3a=validateYamlFiles(_0x22557d,_0x148470,{'filterType':'template'}),_0x5245da=calculateSummary(_0x200a3a),_0x20404f=_0x200a3a[_0x3f59b5(0x11c)](isValidationResult);if(_0x20404f[_0x3f59b5(0x11e)]===0x0)return console['error'](a23_0x4fbcd5[_0x3f59b5(0x125)](_0x3f59b5(0x119)+_0x148470+'\x0a')),_0x5245da[_0x3f59b5(0x118)]>0x0&&console['error'](a23_0x4fbcd5[_0x3f59b5(0x107)]('('+_0x5245da[_0x3f59b5(0x118)]+_0x3f59b5(0x104))),0x0;for(const _0x569a2a of _0x200a3a){if(!isValidationResult(_0x569a2a)){_0x3952d6[_0x3f59b5(0x110)]&&console[_0x3f59b5(0x122)](a23_0x4fbcd5[_0x3f59b5(0x107)]('-\x20'+_0x569a2a['relativePath']+_0x3f59b5(0x102)+_0x569a2a['reason']+')'));continue;}const {relativePath:_0x2ac669,source:_0x1898c8,result:_0x5a28a4}=_0x569a2a;if(_0x5a28a4[_0x3f59b5(0x11f)]&&_0x5a28a4[_0x3f59b5(0x114)][_0x3f59b5(0x11e)]===0x0)_0x3952d6['verbose']&&console['log'](a23_0x4fbcd5['green']('β\x20'+_0x2ac669));else _0x5a28a4[_0x3f59b5(0x11f)]?(console[_0x3f59b5(0x122)](a23_0x4fbcd5[_0x3f59b5(0x125)]('β \x20'+_0x2ac669+':\x20'+_0x5a28a4[_0x3f59b5(0x114)][_0x3f59b5(0x11e)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x5a28a4,_0x1898c8,_0x2ac669))):(console[_0x3f59b5(0x122)](a23_0x4fbcd5[_0x3f59b5(0x109)]('β\x20'+_0x2ac669+':\x20'+_0x5a28a4[_0x3f59b5(0xfd)][_0x3f59b5(0x11e)]+_0x3f59b5(0x120))),console[_0x3f59b5(0x122)](formatValidationResult(_0x5a28a4,_0x1898c8,_0x2ac669)));}return console['log'](''),_0x5245da[_0x3f59b5(0x10b)]?(console['log'](a23_0x4fbcd5[_0x3f59b5(0x109)](_0x3f59b5(0xff)+_0x5245da[_0x3f59b5(0x117)]+_0x3f59b5(0x129)+_0x5245da[_0x3f59b5(0x10f)]+_0x3f59b5(0x126))),_0x5245da[_0x3f59b5(0x124)]>0x0&&console[_0x3f59b5(0x122)](a23_0x4fbcd5[_0x3f59b5(0x125)](_0x5245da[_0x3f59b5(0x124)]+_0x3f59b5(0x105))),_0x5245da['skippedCount']>0x0&&console[_0x3f59b5(0x122)](a23_0x4fbcd5[_0x3f59b5(0x107)](_0x5245da[_0x3f59b5(0x118)]+_0x3f59b5(0x12a))),0x1):(console[_0x3f59b5(0x122)](a23_0x4fbcd5['green']('β\x20All\x20'+_0x5245da['validCount']+'\x20template(s)\x20valid')),_0x5245da[_0x3f59b5(0x124)]>0x0&&console[_0x3f59b5(0x122)](a23_0x4fbcd5[_0x3f59b5(0x125)](_0x5245da[_0x3f59b5(0x124)]+_0x3f59b5(0x105))),_0x5245da[_0x3f59b5(0x118)]>0x0&&console['log'](a23_0x4fbcd5[_0x3f59b5(0x107)](_0x5245da['skippedCount']+_0x3f59b5(0x12a))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-command.d.ts","sourceRoot":"","sources":["../../src/commands/job-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"job-command.d.ts","sourceRoot":"","sources":["../../src/commands/job-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAA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|
-
const a24_0x19316b=a24_0x50ea;(function(_0x36d507,_0x56cdfc){const _0x1860ec=a24_0x50ea,_0x83760=_0x36d507();while(!![]){try{const _0x7e87eb=-parseInt(_0x1860ec(0x17f))/0x1+-parseInt(_0x1860ec(0x140))/0x2*(-parseInt(_0x1860ec(0x141))/0x3)+parseInt(_0x1860ec(0x13f))/0x4*(parseInt(_0x1860ec(0x161))/0x5)+-parseInt(_0x1860ec(0x172))/0x6*(-parseInt(_0x1860ec(0x184))/0x7)+-parseInt(_0x1860ec(0x143))/0x8*(-parseInt(_0x1860ec(0x164))/0x9)+parseInt(_0x1860ec(0x171))/0xa*(-parseInt(_0x1860ec(0x179))/0xb)+parseInt(_0x1860ec(0x14a))/0xc;if(_0x7e87eb===_0x56cdfc)break;else _0x83760['push'](_0x83760['shift']());}catch(_0x3ec51a){_0x83760['push'](_0x83760['shift']());}}}(a24_0x3c3c,0x4ac6a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a24_0x50ea(_0x4a84ad,_0x58f837){_0x4a84ad=_0x4a84ad-0x13f;const _0x3c3cf4=a24_0x3c3c();let _0x50eae=_0x3c3cf4[_0x4a84ad];return _0x50eae;}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a24_0x3c3c(){const _0x58004d=['5565lThAPk','β\x20Retrieved\x20','48bZcfkZ','validate','priority','Submitting\x20kill\x20request...','Cancelled','execute','start_at','4911372WIzmWR','β\x20Job\x20submitted','verbose','name','List\x20jobs','Getting\x20job\x20details...','job_id','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submit\x20a\x20job','end_at','map','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Listing\x20jobs...','limit','status','url','Query:\x20','jobType','\x20job','kill','database','getTime','\x20jobs','5YKTCtz','result','job:kill','380763PanWHp','\x20row','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','hive','type','user_name','job:submit','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Kill\x20a\x20job','information_schema','20fMQhMq','201336INyoxC','trino','Submitting\x20job...','Status\x20filter:\x20','list','jobs','Show\x20job\x20details','3304664zynKNH','created_at','debug','error','substring','args','270357LCyCQy','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job:show','job:result','Job\x20type:\x20','91XWfnVo','length','description','Get\x20job\x20results','data','file','89944GoMBiP','60ZozDcU'];a24_0x3c3c=function(){return _0x58004d;};return a24_0x3c3c();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{[a24_0x19316b(0x14d)]='jobs';[a24_0x19316b(0x186)]=a24_0x19316b(0x14e);async['execute'](_0x58393b){const _0x18fd43=a24_0x19316b,{options:_0x127266,tdx:_0x144590}=_0x58393b,_0x302813=resolveLimit(_0x127266[_0x18fd43(0x157)],DEFAULT_DISPLAY_LIMIT),_0xe1d61d=_0x127266[_0x18fd43(0x158)];_0x127266[_0x18fd43(0x14c)]&&(console[_0x18fd43(0x17c)]('Limit:\x20'+_0x302813+_0x18fd43(0x160)),_0xe1d61d&&console[_0x18fd43(0x17c)](_0x18fd43(0x175)+_0xe1d61d));const _0x12fbab=await withSpinner(_0x18fd43(0x156),()=>_0x144590[_0x18fd43(0x177)][_0x18fd43(0x176)]({'from':0x0,'to':_0x302813-0x1,'status':_0xe1d61d}),{'verbose':_0x127266[_0x18fd43(0x14c)]}),_0x3d3c2c=_0x12fbab[_0x18fd43(0x188)];console[_0x18fd43(0x17c)]('β\x20Found\x20'+_0x3d3c2c[_0x18fd43(0x185)]+_0x18fd43(0x15c)+(_0x3d3c2c[_0x18fd43(0x185)]!==0x1?'s':''));const _0x433ccf=_0x3d3c2c[_0x18fd43(0x154)](_0x327591=>{const _0x5a7941=_0x18fd43;let _0x5ec334;if(_0x327591[_0x5a7941(0x149)]&&_0x327591[_0x5a7941(0x153)]){const _0x5efb3c=new Date(_0x327591[_0x5a7941(0x149)])[_0x5a7941(0x15f)](),_0x485d2b=new Date(_0x327591[_0x5a7941(0x153)])[_0x5a7941(0x15f)]();_0x5ec334=Math['round']((_0x485d2b-_0x5efb3c)/0x3e8);}return{'job_id':_0x327591[_0x5a7941(0x150)],'type':_0x327591[_0x5a7941(0x16b)],'status':_0x327591[_0x5a7941(0x158)],'user_name':_0x327591[_0x5a7941(0x16c)],'duration_sec':_0x5ec334,'created_at':_0x327591['created_at'],'started_at':_0x327591[_0x5a7941(0x149)],'end_at':_0x327591[_0x5a7941(0x153)]};});return await handleSDKOutput(_0x433ccf,_0x127266),0x0;}}export class JobShowCommand extends BaseCommand{[a24_0x19316b(0x14d)]=a24_0x19316b(0x181);['description']=a24_0x19316b(0x178);[a24_0x19316b(0x144)](_0x4e9278){const _0x83e13a=_0x4e9278['args'][0x0];if(!_0x83e13a)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async['execute'](_0x32ddbd){const _0x260a78=a24_0x19316b,{options:_0x4d675a,args:_0x5ef71b,tdx:_0x385d17}=_0x32ddbd,_0x3ad940=_0x5ef71b[0x0],_0x4e48c4=await withSpinner(_0x260a78(0x14f),()=>_0x385d17['jobs']['show'](_0x3ad940),{'verbose':_0x4d675a[_0x260a78(0x14c)]}),_0x161e97=_0x4e48c4['data'];let _0x5e1fc9;if(_0x161e97['start_at']&&_0x161e97[_0x260a78(0x153)]){const _0x519feb=new Date(_0x161e97[_0x260a78(0x149)])[_0x260a78(0x15f)](),_0x142833=new Date(_0x161e97[_0x260a78(0x153)])['getTime']();_0x5e1fc9=Math['round']((_0x142833-_0x519feb)/0x3e8);}const _0x194e22={'job_id':_0x161e97[_0x260a78(0x150)],'type':_0x161e97['type'],'status':_0x161e97[_0x260a78(0x158)],..._0x161e97['user_name']&&{'user_name':_0x161e97['user_name']},..._0x5e1fc9!==undefined&&{'duration_sec':_0x5e1fc9},..._0x161e97[_0x260a78(0x17a)]&&{'created_at':_0x161e97['created_at']},..._0x161e97[_0x260a78(0x149)]&&{'started_at':_0x161e97['start_at']},..._0x161e97[_0x260a78(0x153)]&&{'end_at':_0x161e97[_0x260a78(0x153)]},..._0x161e97[_0x260a78(0x15e)]&&{'database':_0x161e97['database']},..._0x161e97[_0x260a78(0x145)]!==undefined&&{'priority':_0x161e97[_0x260a78(0x145)]},..._0x161e97[_0x260a78(0x159)]&&{'url':_0x161e97[_0x260a78(0x159)]},..._0x161e97['query']&&{'query':_0x161e97['query']},..._0x161e97['debug']&&{'debug':_0x161e97[_0x260a78(0x17b)]}};return await handleSingleObjectOutput(_0x194e22,_0x4d675a),0x0;}}export class JobKillCommand extends BaseCommand{[a24_0x19316b(0x14d)]=a24_0x19316b(0x163);[a24_0x19316b(0x186)]=a24_0x19316b(0x16f);['validate'](_0x55d631){const _0x2d7eb3=a24_0x19316b,_0x5957ee=_0x55d631[_0x2d7eb3(0x17e)][0x0];if(!_0x5957ee)return _0x2d7eb3(0x169);return undefined;}async[a24_0x19316b(0x148)](_0xffa2e7){const _0x431492=a24_0x19316b,{options:_0x3f5747,args:_0x2ad95a,tdx:_0x3bdfe1}=_0xffa2e7,_0x16487a=_0x2ad95a[0x0];if(!_0x3f5747['yes']){const _0x2af971=await confirm(_0x431492(0x180)+_0x16487a+'?');if(!_0x2af971)return console[_0x431492(0x17c)](_0x431492(0x147)),0x0;}return await withSpinner(_0x431492(0x146),()=>_0x3bdfe1['jobs'][_0x431492(0x15d)](_0x16487a),{'verbose':_0x3f5747[_0x431492(0x14c)]}),console[_0x431492(0x17c)](_0x431492(0x167)+_0x16487a),console[_0x431492(0x17c)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x16487a+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a24_0x19316b(0x14d)]=a24_0x19316b(0x16d);[a24_0x19316b(0x186)]=a24_0x19316b(0x152);async[a24_0x19316b(0x148)](_0x535154){const _0x5414b0=a24_0x19316b,{options:_0x347618,args:_0xea3229,tdx:_0x9d57e}=_0x535154,_0x5343e5=_0x347618[_0x5414b0(0x15b)]||_0x5414b0(0x173),_0x57b105=_0x347618[_0x5414b0(0x189)],_0x5a7978=_0x347618[_0x5414b0(0x15e)]||_0x5414b0(0x170),_0x2e65bc=_0x347618[_0x5414b0(0x162)];if(_0x5343e5!==_0x5414b0(0x173)&&_0x5343e5!==_0x5414b0(0x16a))throw new SDKError(ErrorCode[_0x5414b0(0x168)],_0x5414b0(0x16e));let _0x5e3477;if(_0x57b105){if(_0xea3229[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5414b0(0x151));const _0x53c650=readSqlStatementsFromFile(_0x57b105);if(_0x53c650[_0x5414b0(0x185)]===0x0)throw new SDKError(ErrorCode[_0x5414b0(0x168)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x53c650[_0x5414b0(0x185)]>0x1)throw new SDKError(ErrorCode[_0x5414b0(0x168)],_0x5414b0(0x166));_0x5e3477=_0x53c650[0x0];}else{if(!_0xea3229[0x0])throw new SDKError(ErrorCode[_0x5414b0(0x168)],_0x5414b0(0x155));_0x5e3477=_0xea3229[0x0];}_0x347618['verbose']&&(console[_0x5414b0(0x17c)](_0x5414b0(0x183)+_0x5343e5),console[_0x5414b0(0x17c)]('Database:\x20'+_0x5a7978),console[_0x5414b0(0x17c)](_0x5414b0(0x15a)+_0x5e3477[_0x5414b0(0x17d)](0x0,0x64)+(_0x5e3477[_0x5414b0(0x185)]>0x64?'...':'')));const _0x20d8b0=await withSpinner(_0x5414b0(0x174),()=>_0x9d57e['jobs']['submit'](_0x5a7978,_0x5e3477,_0x5343e5,_0x2e65bc),{'verbose':_0x347618['verbose']}),_0x3fee40=_0x20d8b0[_0x5414b0(0x188)];return console[_0x5414b0(0x17c)](_0x5414b0(0x14b)),console['error']('\x20\x20Job\x20ID:\x20'+_0x3fee40[_0x5414b0(0x150)]),await handleSDKOutput([_0x3fee40],_0x347618),0x0;}}export class JobResultCommand extends BaseCommand{[a24_0x19316b(0x14d)]=a24_0x19316b(0x182);[a24_0x19316b(0x186)]=a24_0x19316b(0x187);['validate'](_0x27a07b){const _0x34cd76=_0x27a07b['args'][0x0];if(!_0x34cd76)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a24_0x19316b(0x148)](_0x18e1b2){const _0x455b74=a24_0x19316b,{options:_0x535318,args:_0x1fa0b2,tdx:_0x5a24a1}=_0x18e1b2,_0x307992=_0x1fa0b2[0x0],_0x93b7c9=await withSpinner('Getting\x20job\x20results...',()=>_0x5a24a1[_0x455b74(0x177)][_0x455b74(0x162)](_0x307992),{'verbose':_0x535318[_0x455b74(0x14c)]}),_0xc7182a=_0x93b7c9[_0x455b74(0x188)];return console[_0x455b74(0x17c)](_0x455b74(0x142)+_0xc7182a[_0x455b74(0x185)]+_0x455b74(0x165)+(_0xc7182a[_0x455b74(0x185)]!==0x1?'s':'')),await handleSDKOutput(_0xc7182a,_0x535318),0x0;}}
|
|
1
|
+
const a24_0x286ad3=a24_0x4162;(function(_0x548038,_0x58cf98){const _0x25ceb0=a24_0x4162,_0x4230c3=_0x548038();while(!![]){try{const _0x139e59=-parseInt(_0x25ceb0(0x18e))/0x1*(parseInt(_0x25ceb0(0x19f))/0x2)+-parseInt(_0x25ceb0(0x18f))/0x3+parseInt(_0x25ceb0(0x17f))/0x4+parseInt(_0x25ceb0(0x192))/0x5*(-parseInt(_0x25ceb0(0x178))/0x6)+-parseInt(_0x25ceb0(0x16d))/0x7+-parseInt(_0x25ceb0(0x172))/0x8+-parseInt(_0x25ceb0(0x193))/0x9*(-parseInt(_0x25ceb0(0x165))/0xa);if(_0x139e59===_0x58cf98)break;else _0x4230c3['push'](_0x4230c3['shift']());}catch(_0x4cb90b){_0x4230c3['push'](_0x4230c3['shift']());}}}(a24_0x1d24,0x4b71a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a24_0x4162(_0x531e23,_0x24c9d8){_0x531e23=_0x531e23-0x162;const _0x1d24d2=a24_0x1d24();let _0x4162cc=_0x1d24d2[_0x531e23];return _0x4162cc;}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 a24_0x8d2d1 from'chalk';function formatDuration(_0x33c75f){const _0x5d9787=a24_0x4162;if(_0x33c75f<0x3c)return _0x33c75f+'s';if(_0x33c75f<0xe10)return Math[_0x5d9787(0x1b1)](_0x33c75f/0x3c)+'m\x20'+_0x33c75f%0x3c+'s';const _0x60c395=Math['floor'](_0x33c75f/0xe10),_0x276a0a=Math['floor'](_0x33c75f%0xe10/0x3c);return _0x276a0a>0x0?_0x60c395+'h\x20'+_0x276a0a+'m':_0x60c395+'h';}function formatRelativeTime(_0x305969){const _0x578d7a=a24_0x4162,_0x4964f8=Date[_0x578d7a(0x1ad)]()-_0x305969[_0x578d7a(0x190)](),_0x100ca0=Math['floor'](Math[_0x578d7a(0x18b)](_0x4964f8)/0x3e8);if(_0x100ca0<0x3c)return _0x578d7a(0x1a0);const _0xa3ccc4=Math[_0x578d7a(0x1b1)](_0x100ca0/0x3c);if(_0xa3ccc4<0x3c)return _0xa3ccc4+'m\x20ago';const _0x524bd7=Math[_0x578d7a(0x1b1)](_0xa3ccc4/0x3c);if(_0x524bd7<0x18)return _0x524bd7+_0x578d7a(0x174);const _0x1a99f3=Math[_0x578d7a(0x1b1)](_0x524bd7/0x18);if(_0x1a99f3<0x1e)return _0x1a99f3+'d\x20ago';return Math[_0x578d7a(0x1b1)](_0x1a99f3/0x1e)+_0x578d7a(0x16a);}export class JobListCommand extends BaseCommand{['name']=a24_0x286ad3(0x185);[a24_0x286ad3(0x168)]=a24_0x286ad3(0x162);async[a24_0x286ad3(0x1b7)](_0x29a932){const _0x5e1c7a=a24_0x286ad3,{options:_0x48f81d,tdx:_0x56730c}=_0x29a932,_0x377b6e=resolveLimit(_0x48f81d['limit'],DEFAULT_DISPLAY_LIMIT),_0x42e3a6=_0x48f81d[_0x5e1c7a(0x1b8)];_0x48f81d[_0x5e1c7a(0x17d)]&&(console[_0x5e1c7a(0x166)](_0x5e1c7a(0x19b)+_0x377b6e+_0x5e1c7a(0x169)),_0x42e3a6&&console[_0x5e1c7a(0x166)](_0x5e1c7a(0x1ac)+_0x42e3a6));const _0x10ff93=await withSpinner(_0x5e1c7a(0x17b),()=>_0x56730c[_0x5e1c7a(0x185)][_0x5e1c7a(0x1af)]({'from':0x0,'to':_0x377b6e-0x1,'status':_0x42e3a6}),{'verbose':_0x48f81d[_0x5e1c7a(0x17d)]}),_0x42a692=_0x10ff93[_0x5e1c7a(0x171)];console['error']('β\x20Found\x20'+_0x42a692['length']+_0x5e1c7a(0x1bb)+(_0x42a692[_0x5e1c7a(0x191)]!==0x1?'s':''));const _0x1acc84=_0x48f81d[_0x5e1c7a(0x177)];if(isStructuredFormat(_0x48f81d)){const _0x390bd8=_0x42a692[_0x5e1c7a(0x189)](_0x581911=>{const _0x9e5035=_0x5e1c7a;let _0x1772c5;if(_0x581911['start_at']&&_0x581911[_0x9e5035(0x19c)]){const _0x5855a0=new Date(_0x581911[_0x9e5035(0x19e)])[_0x9e5035(0x190)](),_0x1fd083=new Date(_0x581911['end_at'])['getTime']();_0x1772c5=Math['round']((_0x1fd083-_0x5855a0)/0x3e8);}return{'job_id':_0x581911['job_id'],'type':_0x581911[_0x9e5035(0x16c)]==='presto'?_0x9e5035(0x194):_0x581911[_0x9e5035(0x16c)],'status':_0x581911[_0x9e5035(0x1b8)],'user_name':_0x581911[_0x9e5035(0x19d)],'duration_sec':_0x1772c5,'created_at':_0x581911['created_at'],'started_at':_0x581911[_0x9e5035(0x19e)],'end_at':_0x581911[_0x9e5035(0x19c)]};});await handleSDKOutput(_0x390bd8,_0x48f81d);}else for(const _0x1979db of _0x42a692){const _0x5f061e=_0x1979db['status']===_0x5e1c7a(0x1ab)?a24_0x8d2d1[_0x5e1c7a(0x19a)]:_0x1979db[_0x5e1c7a(0x1b8)]===_0x5e1c7a(0x166)?a24_0x8d2d1[_0x5e1c7a(0x1b4)]:a24_0x8d2d1[_0x5e1c7a(0x176)],_0x4442aa=_0x5f061e(_0x1979db[_0x5e1c7a(0x1b8)]),_0x371b59=getJobUrl(_0x1acc84,_0x1979db[_0x5e1c7a(0x17c)]),_0x2af282=hyperlink(_0x1979db['job_id'],_0x371b59),_0xa03538=a24_0x8d2d1[_0x5e1c7a(0x176)](_0x1979db[_0x5e1c7a(0x16c)]===_0x5e1c7a(0x1a6)?_0x5e1c7a(0x194):_0x1979db[_0x5e1c7a(0x16c)]),_0x348f64=[];if(_0x1979db[_0x5e1c7a(0x19e)]&&_0x1979db[_0x5e1c7a(0x19c)]){const _0x395e85=Math[_0x5e1c7a(0x182)]((new Date(_0x1979db[_0x5e1c7a(0x19c)])[_0x5e1c7a(0x190)]()-new Date(_0x1979db[_0x5e1c7a(0x19e)])[_0x5e1c7a(0x190)]())/0x3e8);_0x348f64[_0x5e1c7a(0x170)](formatDuration(_0x395e85));}if(_0x1979db[_0x5e1c7a(0x19c)])_0x348f64[_0x5e1c7a(0x170)](formatRelativeTime(new Date(_0x1979db[_0x5e1c7a(0x19c)])));else _0x1979db[_0x5e1c7a(0x19e)]&&_0x348f64[_0x5e1c7a(0x170)](formatRelativeTime(new Date(_0x1979db['start_at'])));const _0x3d23b4=_0x348f64[_0x5e1c7a(0x191)]>0x0?a24_0x8d2d1[_0x5e1c7a(0x176)]('\x20'+_0x348f64[_0x5e1c7a(0x1b0)](',\x20')):'';console[_0x5e1c7a(0x17e)]('β‘\x20'+_0x2af282+'\x20'+_0xa03538+'\x20'+_0x4442aa+_0x3d23b4);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a24_0x286ad3(0x1aa);[a24_0x286ad3(0x168)]='Show\x20job\x20details';[a24_0x286ad3(0x1a7)](_0x3ba2c9){const _0x13b847=a24_0x286ad3,_0x1dcf72=_0x3ba2c9['args'][0x0];if(!_0x1dcf72)return _0x13b847(0x188);return undefined;}async[a24_0x286ad3(0x1b7)](_0x319388){const _0x2f50dc=a24_0x286ad3,{options:_0x88ada2,args:_0x3b913e,tdx:_0x3669d0}=_0x319388,_0x4a8ba9=_0x3b913e[0x0],_0x59e49b=await withSpinner(_0x2f50dc(0x184),()=>_0x3669d0[_0x2f50dc(0x185)]['show'](_0x4a8ba9),{'verbose':_0x88ada2[_0x2f50dc(0x17d)]}),_0x5d38b3=_0x59e49b['data'];let _0x8e676a;if(_0x5d38b3[_0x2f50dc(0x19e)]&&_0x5d38b3[_0x2f50dc(0x19c)]){const _0x1efa90=new Date(_0x5d38b3[_0x2f50dc(0x19e)])[_0x2f50dc(0x190)](),_0x41decf=new Date(_0x5d38b3[_0x2f50dc(0x19c)])['getTime']();_0x8e676a=Math['round']((_0x41decf-_0x1efa90)/0x3e8);}const _0x1fc03f={'job_id':_0x5d38b3[_0x2f50dc(0x17c)],'type':_0x5d38b3[_0x2f50dc(0x16c)],'status':_0x5d38b3['status'],..._0x5d38b3[_0x2f50dc(0x19d)]&&{'user_name':_0x5d38b3['user_name']},..._0x8e676a!==undefined&&{'duration_sec':_0x8e676a},..._0x5d38b3['created_at']&&{'created_at':_0x5d38b3[_0x2f50dc(0x181)]},..._0x5d38b3[_0x2f50dc(0x19e)]&&{'started_at':_0x5d38b3[_0x2f50dc(0x19e)]},..._0x5d38b3[_0x2f50dc(0x19c)]&&{'end_at':_0x5d38b3['end_at']},..._0x5d38b3[_0x2f50dc(0x1ae)]&&{'database':_0x5d38b3['database']},..._0x5d38b3[_0x2f50dc(0x197)]!==undefined&&{'priority':_0x5d38b3['priority']},..._0x5d38b3[_0x2f50dc(0x167)]&&{'url':_0x5d38b3[_0x2f50dc(0x167)]},..._0x5d38b3[_0x2f50dc(0x1a3)]&&{'query':_0x5d38b3[_0x2f50dc(0x1a3)]},..._0x5d38b3[_0x2f50dc(0x186)]&&{'debug':_0x5d38b3[_0x2f50dc(0x186)]}};return await handleSingleObjectOutput(_0x1fc03f,_0x88ada2),0x0;}}export class JobKillCommand extends BaseCommand{[a24_0x286ad3(0x1b2)]=a24_0x286ad3(0x18d);[a24_0x286ad3(0x168)]='Kill\x20a\x20job';[a24_0x286ad3(0x1a7)](_0x2ea0a2){const _0x29b35f=a24_0x286ad3,_0x576a42=_0x2ea0a2[_0x29b35f(0x199)][0x0];if(!_0x576a42)return _0x29b35f(0x18a);return undefined;}async[a24_0x286ad3(0x1b7)](_0x3d0b49){const _0x53611e=a24_0x286ad3,{options:_0x5211ca,args:_0x3c4a96,tdx:_0x426204}=_0x3d0b49,_0x4fbd10=_0x3c4a96[0x0];if(!_0x5211ca[_0x53611e(0x16f)]){const _0x11b743=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x4fbd10+'?');if(!_0x11b743)return console[_0x53611e(0x166)](_0x53611e(0x16b)),0x0;}return await withSpinner(_0x53611e(0x175),()=>_0x426204[_0x53611e(0x185)][_0x53611e(0x180)](_0x4fbd10),{'verbose':_0x5211ca[_0x53611e(0x17d)]}),console[_0x53611e(0x166)](_0x53611e(0x179)+_0x4fbd10),console[_0x53611e(0x166)](_0x53611e(0x17a)+_0x4fbd10+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a24_0x286ad3(0x1a2);[a24_0x286ad3(0x168)]=a24_0x286ad3(0x187);async[a24_0x286ad3(0x1b7)](_0x5041ba){const _0x2a59ed=a24_0x286ad3,{options:_0x1280b7,args:_0x36de10,tdx:_0x5d4013}=_0x5041ba,_0x3ba0af=_0x1280b7[_0x2a59ed(0x195)]||_0x2a59ed(0x194),_0x3758d3=_0x1280b7[_0x2a59ed(0x1a9)],_0x59abe3=_0x1280b7['database']||_0x2a59ed(0x196),_0x3e1fa3=_0x1280b7['result'];if(_0x3ba0af!==_0x2a59ed(0x194)&&_0x3ba0af!==_0x2a59ed(0x1ba))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2a59ed(0x1a4));let _0x4ad852;if(_0x3758d3){if(_0x36de10[0x0])throw new SDKError(ErrorCode[_0x2a59ed(0x198)],_0x2a59ed(0x1bc));const _0x120690=readSqlStatementsFromFile(_0x3758d3);if(_0x120690[_0x2a59ed(0x191)]===0x0)throw new SDKError(ErrorCode[_0x2a59ed(0x198)],_0x2a59ed(0x1a1));if(_0x120690['length']>0x1)throw new SDKError(ErrorCode[_0x2a59ed(0x198)],_0x2a59ed(0x163));_0x4ad852=_0x120690[0x0];}else{if(!_0x36de10[0x0])throw new SDKError(ErrorCode[_0x2a59ed(0x198)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x4ad852=_0x36de10[0x0];}_0x1280b7[_0x2a59ed(0x17d)]&&(console[_0x2a59ed(0x166)](_0x2a59ed(0x1b9)+_0x3ba0af),console[_0x2a59ed(0x166)](_0x2a59ed(0x183)+_0x59abe3),console['error'](_0x2a59ed(0x16e)+_0x4ad852[_0x2a59ed(0x1b3)](0x0,0x64)+(_0x4ad852[_0x2a59ed(0x191)]>0x64?_0x2a59ed(0x1a8):'')));const _0x58daf1=await withSpinner('Submitting\x20job...',()=>_0x5d4013[_0x2a59ed(0x185)][_0x2a59ed(0x18c)](_0x59abe3,_0x4ad852,_0x3ba0af,_0x3e1fa3),{'verbose':_0x1280b7[_0x2a59ed(0x17d)]}),_0x19829e=_0x58daf1[_0x2a59ed(0x171)];return console[_0x2a59ed(0x166)](_0x2a59ed(0x1a5)),console[_0x2a59ed(0x166)]('\x20\x20Job\x20ID:\x20'+_0x19829e['job_id']),await handleSDKOutput([_0x19829e],_0x1280b7),0x0;}}function a24_0x1d24(){const _0xb8e091=['kill','created_at','round','Database:\x20','Getting\x20job\x20details...','jobs','debug','Submit\x20a\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','map','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','abs','submit','job:kill','512jRyVDa','1568076LUAmcv','getTime','length','605ZYzRBr','11117187fddoSF','trino','jobType','information_schema','priority','INVALID_ARGUMENT','args','green','Limit:\x20','end_at','user_name','start_at','1956pbKpHT','just\x20now','No\x20SQL\x20statements\x20found\x20in\x20file','job:submit','query','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','β\x20Job\x20submitted','presto','validate','...','file','job:show','success','Status\x20filter:\x20','now','database','list','join','floor','name','substring','red','Getting\x20job\x20results...','β\x20Retrieved\x20','execute','status','Job\x20type:\x20','hive','\x20job','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','List\x20jobs','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','\x20row','20PJlNes','error','url','description','\x20jobs','mo\x20ago','Cancelled','type','2493883ePcliw','Query:\x20','yes','push','data','3515456kTjqvH','result','h\x20ago','Submitting\x20kill\x20request...','dim','site','19302FSgHgp','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Listing\x20jobs...','job_id','verbose','log','187672ZWHBdO'];a24_0x1d24=function(){return _0xb8e091;};return a24_0x1d24();}export class JobResultCommand extends BaseCommand{['name']='job:result';[a24_0x286ad3(0x168)]='Get\x20job\x20results';[a24_0x286ad3(0x1a7)](_0x477054){const _0x5c182e=a24_0x286ad3,_0x5254c0=_0x477054[_0x5c182e(0x199)][0x0];if(!_0x5254c0)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a24_0x286ad3(0x1b7)](_0x379341){const _0x50cb64=a24_0x286ad3,{options:_0x465628,args:_0x37619f,tdx:_0x2c7b14}=_0x379341,_0x31ef50=_0x37619f[0x0],_0x220145=await withSpinner(_0x50cb64(0x1b5),()=>_0x2c7b14['jobs'][_0x50cb64(0x173)](_0x31ef50),{'verbose':_0x465628['verbose']}),_0x4b5559=_0x220145['data'];return console[_0x50cb64(0x166)](_0x50cb64(0x1b6)+_0x4b5559[_0x50cb64(0x191)]+_0x50cb64(0x164)+(_0x4b5559['length']!==0x1?'s':'')),await handleSDKOutput(_0x4b5559,_0x465628),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-command.js","sourceRoot":"","sources":["../../src/commands/job-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAsB,MAAM,2BAA2B,CAAC;AAC1G,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IACpC,IAAI,GAAG,MAAM,CAAC;IACd,WAAW,GAAG,WAAW,CAAC;IAEnC,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,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AE,OAAO,CAAC,CAAC;QACpE,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x25349b=a25_0x5d07;(function(_0x7286b1,_0x55397f){const _0x5c5924=a25_0x5d07,_0x389a67=_0x7286b1();while(!![]){try{const _0x229a23=-parseInt(_0x5c5924(0x169))/0x1+-parseInt(_0x5c5924(0x1f7))/0x2*(parseInt(_0x5c5924(0x152))/0x3)+parseInt(_0x5c5924(0x205))/0x4+parseInt(_0x5c5924(0x1da))/0x5*(-parseInt(_0x5c5924(0x206))/0x6)+-parseInt(_0x5c5924(0x1fb))/0x7+-parseInt(_0x5c5924(0x1fe))/0x8*(-parseInt(_0x5c5924(0x183))/0x9)+-parseInt(_0x5c5924(0x1d9))/0xa*(-parseInt(_0x5c5924(0x158))/0xb);if(_0x229a23===_0x55397f)break;else _0x389a67['push'](_0x389a67['shift']());}catch(_0x34a8dd){_0x389a67['push'](_0x389a67['shift']());}}}(a25_0x27cf,0x24840));import a25_0x3b0196 from'chalk';import a25_0x20df61 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';function a25_0x27cf(){const _0x5d5823=['conversion','journey:stats','\x20changed\x20files','versionNumber','milestoneSize','getTrafficData','activation','data','join','\x20\x20Preserving\x20local\x20segment\x20name:\x20','replace','journey','List\x20journeys\x20in\x20current\x20context','then','115636umWzoy','length','yellow','includeStats','session','site','folderPath','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)','tsv','Input:\x20','description','createVersion','Warning:\x20Could\x20not\x20resolve\x20segment\x20','hasPeriod','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','parent_segment','Pausing\x20journey...','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Show\x20journey\x20table\x20column\x20mapping','Resolving\x20parent\x20segment...','π\x20','journeyStages','absolutePath','List\x20all\x20versions\x20of\x20a\x20journey','Database:\x20','filter','787095IhzUJV','\x27\x20not\x20found\x20in\x20','\x0aPull\x20summary:','Show\x20journey\x20details','columns','connector_config','\x20\x20Target:\x20','renderStats','journey:traffic','rule','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','values','\x20\x20Consolidating\x20duplicate\x20segment:\x20','listActivationsFlat','getLatestJourneyId','base','no_parent','stageNameMap','\x20\x20Folder\x20path:\x20','β\x20Journey\x20\x22','map','\x20(rule\x20match)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','getJourney','execute','stages','launched','add','getActivation','listFolders','type','Show\x20journey\x20statistics','split','find','activationParams','nodes','filePath','Creating\x20new\x20version...','Error:\x20Invalid\x20version\x20number:\x20','goal','links','get','utf-8','Error:\x20Journey\x20\x27','(draft)','message','resolveSegment','content','Getting\x20journey\x20statistics...','Found\x20','journeyBundleId','segments','Journey\x20name:\x20','β\x20All\x20files\x20are\x20up\x20to\x20date','enteredSize','Error:\x20Journey\x20not\x20found:\x20','/e/','\x20new\x20files','segmentName','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Fetching\x20','\x20not\x20found.\x20Available:\x20','blue','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20','red',',\x20version:\x20','resume','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','stage','Cancelled','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeyName','has','\x20unchanged\x20files','attributes','updatedAt','from','journeys','journey:columns','listVersions','\x20files?','database','parentName','560zLUEbg','1349965RDgdun','\x20journey\x20files\x20to\x20','.yml','web','localeCompare','completeMilestoneRate','Target\x20file:\x20','listJourneysFromParentSegment','\x20=\x20','Resolving\x20journey...','entries','size','(archived)','exitOrJumpRate','/j/da','args','errorCode','\x20->\x20','getSegment','rootFolderId','reentryMode','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journey:list','table','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','draft','getColumnMapping','cyan','6022LmVmfF','limit','exitOrJumpSize','Pattern:\x20','1486954ILoGWr','getStatistics','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','16WaMHoK','yes','state','Listing\x20journey\x20activations...','parentSegment','pause','log','1004868PnytAi','6HEeEAA','\x22\x20resumed','name','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','segment','user','goalSize','options','all','\x20details...','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','/app/ps/','journey:view','Warning:\x20Could\x20not\x20resolve\x20activation\x20','repeat','Listing\x20journey\x20versions...','journey:version:create','No\x20journeys\x20found','history','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Getting\x20column\x20mapping...','segmentPushCommand','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','json','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','helpText','\x20Created\x20v','journey:pull','journey:push','sort','cwd','verbose','resolveParentId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','paused','resourceName','completed','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20(ID:\x20','\x20journeys','diff','Error:\x20Stage\x20\x22','tdx.json','\x22\x20paused','Fetching\x20journeys\x20and\x20folders...','β\x20Context\x20set:\x20','format','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journey:versions','Getting\x20journey\x20details...','Aborted.','πΊοΈ\x20','\x20journey','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20(draft)\x20β\x20\x22','Options:','-\x20no\x20files\x20written','INVALID_ARGUMENT','stringify','journeyBundleName','List\x20activations\x20for\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','isNew','folderId','error','set','\x0aError:','Error:\x20Invalid\x20--type\x20\x22','root\x20folder','jsonl','\x5c$&','Write\x20','includeHistory','/j/da/je','audienceId','toLowerCase','Resume\x20a\x20paused\x20journey','(paused)','journey:version:view','(root)','dim','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20\x20Journey\x20ID:\x20','buildIdToEmailMap','createdAt','(running)','\x20activation','journeyId','Listing\x20journeys...','hasChanges','folders','buildIdToNameMap','12kPFhcN','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','(completed)','push','connection','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','65516MmpuTL','green','Export\x20journey(s)\x20as\x20YAML\x20files'];a25_0x27cf=function(){return _0x5d5823;};return a25_0x27cf();}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(_0x57a415){const _0x16a58b=a25_0x5d07;return!_0x57a415&&(console[_0x16a58b(0x136)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x16a58b(0x136)](_0x16a58b(0x1f3))),!!_0x57a415;}function withJsonFormat(_0x32adfe){const _0x3cea86=a25_0x5d07;if(!_0x32adfe[_0x3cea86(0x124)]&&!_0x32adfe['json']&&!_0x32adfe[_0x3cea86(0x13b)]&&!_0x32adfe[_0x3cea86(0x171)])return{..._0x32adfe,'format':'json','json':!![]};return _0x32adfe;}function formatJourneyState(_0x57988b){const _0x192e53=a25_0x5d07;switch(_0x57988b){case _0x192e53(0x19e):return a25_0x3b0196['green'](_0x192e53(0x14b));case _0x192e53(0x1f4):return a25_0x3b0196[_0x192e53(0x146)](_0x192e53(0x1b0));case'paused':return a25_0x3b0196[_0x192e53(0x16b)](_0x192e53(0x143));case _0x192e53(0x11a):return a25_0x3b0196[_0x192e53(0x1c2)](_0x192e53(0x154));case'archived':return a25_0x3b0196[_0x192e53(0x146)](_0x192e53(0x1e6));default:return'('+_0x57988b+')';}}function formatJourneyItem(_0x3f0f1a,_0xb12f2a='',_0x496016){const _0x4a6329=a25_0x5d07,_0x3abaf6=formatJourneyState(_0x3f0f1a['state']),_0x455031=_0x496016?hyperlink(_0x3f0f1a[_0x4a6329(0x131)],_0x496016):_0x3f0f1a['journeyBundleName'];return _0xb12f2a+_0x4a6329(0x129)+_0x455031+'\x20'+_0x3abaf6;}function escapeRegex(_0x3a71b7){const _0x1fb841=a25_0x5d07;return _0x3a71b7[_0x1fb841(0x165)](/[.*+?^${}()|[\]\\]/g,_0x1fb841(0x13c));}function globToRegex(_0x53a3e9){const _0x510753=a25_0x5d07,_0x16c4d1=_0x53a3e9[_0x510753(0x1a4)]('*')[_0x510753(0x198)](escapeRegex);return new RegExp(_0x16c4d1[_0x510753(0x163)]('.*'),'i');}function buildRuleToNameMapping(_0x1b68f1){const _0x370890=a25_0x5d07,_0x461895=new Map();if(_0x1b68f1[_0x370890(0x1b7)])for(const [_0x32bb3a,_0x1c373e]of Object[_0x370890(0x1e4)](_0x1b68f1[_0x370890(0x1b7)])){if(_0x1c373e[_0x370890(0x18c)]){const _0x53d73c=serializeRule(_0x1c373e[_0x370890(0x18c)]),_0x36d2f5=_0x461895[_0x370890(0x1ad)](_0x53d73c);_0x36d2f5?_0x36d2f5[_0x370890(0x155)](_0x32bb3a):_0x461895[_0x370890(0x137)](_0x53d73c,[_0x32bb3a]);}}return _0x461895;}async function resolveJourneyIdFromInput(_0x563f26,_0x5405da,_0x3b9597){const _0x2fa483=a25_0x5d07,_0x33bf19=await resolveJourneyTarget(_0x563f26,_0x5405da['parentSegment'],_0x5405da[_0x2fa483(0x225)]),_0x12e212=_0x33bf19[_0x2fa483(0x202)];if(!_0x12e212)throw new SDKError(ErrorCode[_0x2fa483(0x12f)],_0x2fa483(0x209));const _0x206a7a=await withSpinner(_0x2fa483(0x17c),()=>_0x3b9597[_0x2fa483(0x20a)][_0x2fa483(0x226)](_0x12e212),{'verbose':_0x5405da[_0x2fa483(0x225)]}),_0x13e85c=_0x206a7a[_0x2fa483(0x162)],_0x314454=await withSpinner(_0x2fa483(0x1e3),()=>_0x3b9597[_0x2fa483(0x166)]['resolveJourneyId'](_0x13e85c,_0x33bf19[_0x2fa483(0x1cd)]),{'verbose':_0x5405da[_0x2fa483(0x225)]});return{'journeyId':_0x314454['data'],'journeyName':_0x33bf19[_0x2fa483(0x1cd)],'parentSegmentId':_0x13e85c};}async function resolveJourneyTarget(_0x44f522,_0x3a674c,_0xf9f729){const _0x3c28bd=a25_0x5d07;if(isYamlFilePath(_0x44f522))try{const _0x50a061=await resolveYamlFilePath(_0x44f522);return _0xf9f729&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x44f522),console[_0x3c28bd(0x136)]('\x20\x20Parent\x20segment:\x20'+_0x50a061[_0x3c28bd(0x202)]),console[_0x3c28bd(0x136)]('\x20\x20Name:\x20'+_0x50a061[_0x3c28bd(0x1be)]),console[_0x3c28bd(0x136)](_0x3c28bd(0x196)+(_0x50a061[_0x3c28bd(0x16f)]||_0x3c28bd(0x145)))),{'journeyName':_0x50a061[_0x3c28bd(0x1be)],'parentSegment':_0x50a061[_0x3c28bd(0x202)],'resolved':_0x50a061};}catch(_0x1a4a46){throw new SDKError(ErrorCode[_0x3c28bd(0x12f)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1a4a46[_0x3c28bd(0x1b1)]);}if(!_0x3a674c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3c28bd(0x17a));return{'journeyName':_0x44f522,'parentSegment':_0x3a674c};}export class JourneyListCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x1f1);['description']=a25_0x25349b(0x167);async[a25_0x25349b(0x19c)](_0x249a1c){const _0x2409ff=a25_0x25349b,{options:_0xae0a4a,args:_0x3627c7,tdx:_0x3260ad}=_0x249a1c,_0x2bb37b=_0x3627c7[0x0],_0xbf0aca=_0xae0a4a[_0x2409ff(0x202)];if(!_0xbf0aca)return console[_0x2409ff(0x136)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x2409ff(0x136)](_0x2409ff(0x18d)),0x1;const _0x391e46=await withSpinner(_0x2409ff(0x17c),()=>_0x3260ad['segment'][_0x2409ff(0x226)](_0xbf0aca),{'verbose':_0xae0a4a[_0x2409ff(0x225)]}),_0x59e134=_0x391e46['data'];_0xae0a4a[_0x2409ff(0x225)]&&(console[_0x2409ff(0x136)]('Parent\x20segment:\x20'+_0xbf0aca+_0x2409ff(0x11c)+_0x59e134+')'),_0x2bb37b&&console[_0x2409ff(0x136)](_0x2409ff(0x1fa)+_0x2bb37b));const _0x446201=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x3260ad[_0x2409ff(0x20a)]['getParentFull'](_0x59e134),{'verbose':_0xae0a4a[_0x2409ff(0x225)]}),_0xf57f5d=_0x446201[_0x2409ff(0x162)],_0x2237ed=_0xf57f5d[_0x2409ff(0x1ed)],_0x50f315=await withSpinner(_0x2409ff(0x14e),()=>_0x3260ad[_0x2409ff(0x166)]['listJourneysWithFolders'](_0x59e134,_0x2237ed),{'verbose':_0xae0a4a[_0x2409ff(0x225)]});let _0x5b2c8e=_0x50f315[_0x2409ff(0x162)][_0x2409ff(0x1d3)];const _0x32720c=_0x50f315[_0x2409ff(0x162)][_0x2409ff(0x150)],_0x3e409c=new Map();for(const _0xf3f267 of _0x32720c){_0x3e409c[_0x2409ff(0x137)](_0xf3f267['id'],_0xf3f267['name']);}if(_0x2bb37b){const _0x143c4b=globToRegex(_0x2bb37b);_0x5b2c8e=_0x5b2c8e[_0x2409ff(0x182)](_0xbb9fde=>_0x143c4b['test'](_0xbb9fde[_0x2409ff(0x131)]));}console[_0x2409ff(0x136)]('β\x20Found\x20'+_0x5b2c8e['length']+_0x2409ff(0x12a)+(_0x5b2c8e[_0x2409ff(0x16a)]!==0x1?'s':''));const _0x18bce0=_0x4dfe21=>{const _0x379a92=_0x2409ff;return getConsoleNextUrl(_0xae0a4a['site'],_0x379a92(0x211)+_0x59e134+'/e/'+_0x4dfe21+_0x379a92(0x1e8));};if(_0xae0a4a[_0x2409ff(0x124)]===_0x2409ff(0x1f2))await handleSDKOutput(_0x5b2c8e,_0xae0a4a);else{if(_0xae0a4a['format']==='json'){const _0x25c209=_0x5b2c8e[_0x2409ff(0x198)](_0x526224=>({..._0x526224,'url':_0x18bce0(_0x526224['id'])}));await handleSDKOutput(_0x25c209,_0xae0a4a);}else{console[_0x2409ff(0x204)]('['+_0xbf0aca+']');const _0x128165=new Map(),_0x3dc750=[];for(const _0x4e22d3 of _0x5b2c8e){if(!_0x4e22d3[_0x2409ff(0x135)]||_0x4e22d3[_0x2409ff(0x135)]===_0x2237ed)_0x3dc750['push'](_0x4e22d3);else{const _0x4099a4=_0x128165[_0x2409ff(0x1ad)](_0x4e22d3[_0x2409ff(0x135)])||[];_0x4099a4[_0x2409ff(0x155)](_0x4e22d3),_0x128165[_0x2409ff(0x137)](_0x4e22d3[_0x2409ff(0x135)],_0x4099a4);}}const _0x45c776=(_0x27bb19,_0x4ba54a)=>_0x27bb19[_0x2409ff(0x131)][_0x2409ff(0x1de)](_0x4ba54a[_0x2409ff(0x131)],undefined,{'sensitivity':_0x2409ff(0x193)});_0x3dc750['sort'](_0x45c776);for(const _0x5aa30e of _0x3dc750){console[_0x2409ff(0x204)](formatJourneyItem(_0x5aa30e,'',_0x18bce0(_0x5aa30e['id'])));}const _0x556b98=[..._0x128165[_0x2409ff(0x1e4)]()][_0x2409ff(0x223)]((_0x37a1f5,_0x373419)=>{const _0x125d0a=_0x2409ff,_0x2dd0e9=_0x3e409c[_0x125d0a(0x1ad)](_0x37a1f5[0x0])||_0x37a1f5[0x0],_0x28a52e=_0x3e409c[_0x125d0a(0x1ad)](_0x373419[0x0])||_0x373419[0x0];return _0x2dd0e9[_0x125d0a(0x1de)](_0x28a52e,undefined,{'sensitivity':_0x125d0a(0x193)});});for(const [_0x30386c,_0xa03e6a]of _0x556b98){const _0x1916a3=_0x3e409c[_0x2409ff(0x1ad)](_0x30386c)||_0x30386c;console[_0x2409ff(0x204)](_0x2409ff(0x17d)+_0x1916a3),_0xa03e6a[_0x2409ff(0x223)](_0x45c776);for(const _0x1c2dda of _0xa03e6a){console[_0x2409ff(0x204)](formatJourneyItem(_0x1c2dda,'\x20\x20',_0x18bce0(_0x1c2dda['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x212);[a25_0x25349b(0x173)]=a25_0x25349b(0x186);async[a25_0x25349b(0x19c)](_0x5eeaa4){const _0x13cfc2=a25_0x25349b,{options:_0x4dd7d2,args:_0xe1de7e,tdx:_0x29e4eb}=_0x5eeaa4,_0x390365=_0xe1de7e[0x0];if(!_0x390365)return console[_0x13cfc2(0x136)](_0x13cfc2(0x21c)),console[_0x13cfc2(0x136)](_0x13cfc2(0x1c3)),console['error'](_0x13cfc2(0x12d)),console['error'](_0x13cfc2(0x147)),0x1;_0x4dd7d2['verbose']&&console[_0x13cfc2(0x136)](_0x13cfc2(0x172)+_0x390365);const {journeyId:_0x31c1f2,parentSegmentId:_0x17c527}=await resolveJourneyIdFromInput(_0x390365,_0x4dd7d2,_0x29e4eb);if(_0x4dd7d2[_0x13cfc2(0x1dd)]){const _0x2f1778=getConsoleNextUrl(_0x4dd7d2[_0x13cfc2(0x16e)],_0x13cfc2(0x211)+_0x17c527+'/e/'+_0x31c1f2+'/j/da/je');return console[_0x13cfc2(0x136)](a25_0x3b0196['green']('β')+'\x20Opening\x20'+a25_0x3b0196[_0x13cfc2(0x1f6)](_0x2f1778)),openBrowser(_0x2f1778),0x0;}const _0x3fd459=await withSpinner(_0x13cfc2(0x127),()=>_0x29e4eb[_0x13cfc2(0x166)]['getJourney'](_0x31c1f2),{'verbose':_0x4dd7d2['verbose']}),_0x5973ae=_0x3fd459['data'],_0x44322a=_0x4dd7d2[_0x13cfc2(0x16c)];let _0x110463;if(_0x44322a)try{const _0x115db6=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x29e4eb[_0x13cfc2(0x166)][_0x13cfc2(0x1fc)](_0x31c1f2),{'verbose':_0x4dd7d2['verbose']});_0x110463=_0x115db6[_0x13cfc2(0x162)];}catch{_0x4dd7d2[_0x13cfc2(0x225)]&&console[_0x13cfc2(0x136)]('\x20\x20Statistics\x20not\x20available');}const _0x58c19d=getConsoleNextUrl(_0x4dd7d2[_0x13cfc2(0x16e)],_0x13cfc2(0x211)+_0x17c527+'/e/'+_0x31c1f2+_0x13cfc2(0x13f)),_0x56b931={'id':_0x5973ae['id'],'name':_0x5973ae[_0x13cfc2(0x1d0)][_0x13cfc2(0x208)],'description':_0x5973ae[_0x13cfc2(0x1d0)][_0x13cfc2(0x173)],'state':_0x5973ae[_0x13cfc2(0x1d0)]['state'],'paused':_0x5973ae[_0x13cfc2(0x1d0)]['paused'],'reentry_mode':_0x5973ae[_0x13cfc2(0x1d0)][_0x13cfc2(0x1ee)],'stages':_0x5973ae['attributes'][_0x13cfc2(0x17e)]?.[_0x13cfc2(0x16a)]||0x0,..._0x5973ae[_0x13cfc2(0x1d0)][_0x13cfc2(0x1ab)]&&{'goal':_0x5973ae['attributes'][_0x13cfc2(0x1ab)][_0x13cfc2(0x208)]},..._0x110463&&{'statistics':{'size':_0x110463['size'],'entered':_0x110463[_0x13cfc2(0x1ba)],'goal_achieved':_0x110463[_0x13cfc2(0x20c)],'completion_rate':_0x110463['completionRate'],'exit_or_jump':_0x110463['exitOrJumpSize'],'exit_or_jump_rate':_0x110463[_0x13cfc2(0x1e7)],'stages':_0x110463['stages']}},'url':_0x58c19d};return await handleSingleObjectOutput(_0x56b931,_0x4dd7d2),0x0;}}function a25_0x5d07(_0x505f54,_0x12144a){_0x505f54=_0x505f54-0x119;const _0x27cf05=a25_0x27cf();let _0x5d074c=_0x27cf05[_0x505f54];return _0x5d074c;}export class JourneyStatsCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x15c);['description']=a25_0x25349b(0x1a3);async['execute'](_0x142c26){const _0x3f9de5=a25_0x25349b,{options:_0x4d2ea1,args:_0x33dc92,tdx:_0x4e5e9f}=_0x142c26,_0x7b41ef=_0x33dc92[0x0];if(!requireNameOrPath(_0x7b41ef))return 0x1;_0x4d2ea1['verbose']&&console['error'](_0x3f9de5(0x172)+_0x7b41ef);const _0x400f76=_0x4d2ea1,_0x29ac28=_0x400f76[_0x3f9de5(0x1d2)],_0x126cd5=_0x400f76['to'],_0x55a7ba=_0x400f76[_0x3f9de5(0x13e)],_0x23eb90=_0x400f76[_0x3f9de5(0x1ca)];_0x55a7ba&&!_0x29ac28&&!_0x126cd5&&console[_0x3f9de5(0x136)](_0x3f9de5(0x1ef));const _0x398e41=_0x55a7ba?withJsonFormat(_0x4d2ea1):_0x4d2ea1,{journeyId:_0xe0295f,journeyName:_0x411727}=await resolveJourneyIdFromInput(_0x7b41ef,_0x398e41,_0x4e5e9f),_0x270be7=_0x29ac28||_0x126cd5?{'from':_0x29ac28,'to':_0x126cd5}:undefined,_0x1ddcfd=await withSpinner(_0x3f9de5(0x1b4),()=>Promise[_0x3f9de5(0x20e)]([_0x4e5e9f[_0x3f9de5(0x166)][_0x3f9de5(0x19b)](_0xe0295f),_0x4e5e9f[_0x3f9de5(0x166)][_0x3f9de5(0x1fc)](_0xe0295f,_0x270be7)]),{'verbose':_0x398e41[_0x3f9de5(0x225)]}),[_0x4749a5,_0x132bc3]=_0x1ddcfd[_0x3f9de5(0x162)];if(!_0x132bc3||_0x132bc3[_0x3f9de5(0x14d)]===null)return console[_0x3f9de5(0x136)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x411727),console[_0x3f9de5(0x136)](_0x3f9de5(0x12b)),0x0;const _0x504c80=buildStageNameMap(_0x4749a5),_0x1a7b6=!!(_0x270be7&&_0x132bc3[_0x3f9de5(0x218)]?.['length']),_0x267829={'stageNameMap':_0x504c80,'hasPeriod':_0x1a7b6,'includeHistory':!!_0x55a7ba};if(_0x23eb90&&_0x132bc3[_0x3f9de5(0x19d)]){const _0x45d75a=_0x132bc3[_0x3f9de5(0x19d)][_0x3f9de5(0x1a5)](_0x300552=>{const _0x5f23be=_0x3f9de5,_0x9c2d3=_0x504c80[_0x5f23be(0x1ad)](_0x300552['id'])??'';return _0x9c2d3[_0x5f23be(0x141)]()===_0x23eb90[_0x5f23be(0x141)]();});if(_0x45d75a)return await handleSingleObjectOutput(formatStageStats(_0x45d75a,_0x267829),_0x398e41),0x0;const _0x11e6ce=_0x132bc3[_0x3f9de5(0x19d)]['map'](_0x218132=>_0x504c80[_0x3f9de5(0x1ad)](_0x218132['id'])??_0x218132['id']);return console['error'](_0x3f9de5(0x11f)+_0x23eb90+'\x22\x20not\x20found'),console[_0x3f9de5(0x136)]('Available\x20stages:\x20'+_0x11e6ce['join'](',\x20')),0x1;}const _0x1110e8=_0x132bc3[_0x3f9de5(0x19d)]?.[_0x3f9de5(0x198)](_0x78a06f=>formatStageStats(_0x78a06f,_0x267829)),_0x1eec54=assembleJourneyStats(_0x132bc3,{'from':_0x29ac28,'to':_0x126cd5,'includeHistory':_0x55a7ba});return await this[_0x3f9de5(0x18a)](_0x1eec54,_0x1110e8??[],_0x398e41),0x0;}async[a25_0x25349b(0x18a)](_0x2df0f9,_0x191621,_0xf8ec1d){const _0x13d4ce=a25_0x25349b,_0x5cff03=_0xf8ec1d[_0x13d4ce(0x124)]===_0x13d4ce(0x21d)||_0xf8ec1d[_0x13d4ce(0x124)]===_0x13d4ce(0x13b)||_0xf8ec1d[_0x13d4ce(0x21d)]||_0xf8ec1d[_0x13d4ce(0x13b)];if(_0x5cff03){_0x2df0f9['stages']=_0x191621,await handleSingleObjectOutput(_0x2df0f9,_0xf8ec1d);return;}await handleSingleObjectOutput(_0x2df0f9,_0xf8ec1d);for(const _0x2a868f of _0x191621){console[_0x13d4ce(0x204)](''),console[_0x13d4ce(0x204)](String(a25_0x3b0196['cyan']['bold']('['+_0x2a868f[_0x13d4ce(0x208)]+']'))+a25_0x3b0196[_0x13d4ce(0x146)]('\x20'+_0x2a868f['id']));const {id:_0x510b44,name:_0x3a5b8f,..._0x42f0b6}=_0x2a868f;await handleSingleObjectOutput(_0x42f0b6,_0xf8ec1d);}}}export class JourneyTrafficCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x18b);[a25_0x25349b(0x173)]=a25_0x25349b(0x153);async[a25_0x25349b(0x19c)](_0x102c45){const _0x2f76c0=a25_0x25349b,{options:_0x30d296,args:_0x50e614,tdx:_0x397e74}=_0x102c45,_0x2b2354=_0x50e614[0x0];if(!requireNameOrPath(_0x2b2354))return 0x1;_0x30d296['verbose']&&console[_0x2f76c0(0x136)](_0x2f76c0(0x172)+_0x2b2354);const _0x8d374f=_0x30d296,_0x534982=_0x8d374f[_0x2f76c0(0x1a2)],_0x3fe00c=_0x8d374f[_0x2f76c0(0x1d2)],_0x25962a=_0x8d374f['to'],_0x4ba617=_0x8d374f[_0x2f76c0(0x1f8)];if(_0x534982&&_0x534982!==_0x2f76c0(0x15b)&&_0x534982!==_0x2f76c0(0x161))return console[_0x2f76c0(0x136)](_0x2f76c0(0x139)+_0x534982+_0x2f76c0(0x210)),0x1;const _0x128a0a=withJsonFormat(_0x30d296),{journeyId:_0x4361e2,journeyName:_0xb9ff1b}=await resolveJourneyIdFromInput(_0x2b2354,_0x128a0a,_0x397e74),_0xf57436={'type':_0x534982,'from':_0x3fe00c,'to':_0x25962a,'limit':_0x4ba617},_0xa1ca84=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x397e74[_0x2f76c0(0x166)][_0x2f76c0(0x160)](_0x4361e2,_0xf57436),{'verbose':_0x128a0a[_0x2f76c0(0x225)]}),_0x35f760=_0xa1ca84[_0x2f76c0(0x162)],_0x95617e=_0x35f760['conversion']&&(_0x35f760[_0x2f76c0(0x15b)][_0x2f76c0(0x1a7)][_0x2f76c0(0x16a)]>0x0||_0x35f760[_0x2f76c0(0x15b)][_0x2f76c0(0x1ac)][_0x2f76c0(0x16a)]>0x0),_0x213220=_0x35f760[_0x2f76c0(0x161)]&&_0x35f760[_0x2f76c0(0x161)][_0x2f76c0(0x16a)]>0x0;if(!_0x95617e&&!_0x213220)return console[_0x2f76c0(0x136)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0xb9ff1b),console['error'](_0x2f76c0(0x157)),_0x3fe00c&&_0x25962a&&console[_0x2f76c0(0x136)](_0x2f76c0(0x1fd)),0x0;return await handleSingleObjectOutput(_0x35f760,_0x128a0a),0x0;}}function formatStageStats(_0x43bba7,_0x3d2fc3){const _0x29a211=a25_0x25349b,_0x175629=_0x3d2fc3[_0x29a211(0x176)]&&_0x43bba7['history']?.[_0x29a211(0x16a)]?aggregateStageHistory(_0x43bba7[_0x29a211(0x218)]):{'size':_0x43bba7[_0x29a211(0x1e5)],'entered':_0x43bba7[_0x29a211(0x1ba)],'milestone':_0x43bba7[_0x29a211(0x15f)],'milestone_rate':_0x43bba7[_0x29a211(0x1df)],'exit_or_jump':_0x43bba7[_0x29a211(0x1f9)],'exit_or_jump_rate':_0x43bba7[_0x29a211(0x1e7)]},_0x30eda0={'id':_0x43bba7['id'],'name':_0x3d2fc3[_0x29a211(0x195)][_0x29a211(0x1ad)](_0x43bba7['id'])??_0x43bba7['id'],..._0x175629};return _0x3d2fc3['hasPeriod']&&_0x3d2fc3[_0x29a211(0x13e)]&&_0x43bba7[_0x29a211(0x218)]&&(_0x30eda0[_0x29a211(0x218)]=_0x43bba7[_0x29a211(0x218)]),_0x30eda0;}export class JourneyPauseCommand extends BaseCommand{[a25_0x25349b(0x208)]='journey:pause';[a25_0x25349b(0x173)]='Pause\x20a\x20running\x20journey';async[a25_0x25349b(0x19c)](_0x4fa99e){const _0x43101b=a25_0x25349b,{options:_0x5bb287,args:_0x1f9d17,tdx:_0x1378cd}=_0x4fa99e,_0x3aa34e=_0x1f9d17[0x0];if(!requireNameOrPath(_0x3aa34e))return 0x1;_0x5bb287['verbose']&&console[_0x43101b(0x136)]('Input:\x20'+_0x3aa34e);const {journeyId:_0x1b69f1,journeyName:_0x5c02ea}=await resolveJourneyIdFromInput(_0x3aa34e,_0x5bb287,_0x1378cd);if(!_0x5bb287['yes']){const _0x4e9990=await confirm(_0x43101b(0x133)+_0x5c02ea+'\x22?');if(!_0x4e9990)return console[_0x43101b(0x136)](_0x43101b(0x1cb)),0x0;}const _0x47f655=await withSpinner(_0x43101b(0x179),()=>_0x1378cd[_0x43101b(0x166)][_0x43101b(0x203)](_0x1b69f1),{'verbose':_0x5bb287[_0x43101b(0x225)]}),_0x193dd3=_0x47f655[_0x43101b(0x162)];return console['error'](_0x43101b(0x197)+_0x193dd3[_0x43101b(0x1d0)]['name']+_0x43101b(0x121)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a25_0x25349b(0x208)]='journey:resume';[a25_0x25349b(0x173)]=a25_0x25349b(0x142);async[a25_0x25349b(0x19c)](_0x15b963){const _0x1b7a3f=a25_0x25349b,{options:_0x3872f3,args:_0x1ccb9d,tdx:_0x414ae1}=_0x15b963,_0x530a5e=_0x1ccb9d[0x0];if(!requireNameOrPath(_0x530a5e))return 0x1;_0x3872f3[_0x1b7a3f(0x225)]&&console['error'](_0x1b7a3f(0x172)+_0x530a5e);const {journeyId:_0x3befc0,journeyName:_0x5e51aa}=await resolveJourneyIdFromInput(_0x530a5e,_0x3872f3,_0x414ae1);if(!_0x3872f3[_0x1b7a3f(0x1ff)]){const _0x1a614e=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x5e51aa+'\x22?');if(!_0x1a614e)return console[_0x1b7a3f(0x136)](_0x1b7a3f(0x1cb)),0x0;}const _0x3554dc=await withSpinner('Resuming\x20journey...',()=>_0x414ae1[_0x1b7a3f(0x166)][_0x1b7a3f(0x1c8)](_0x3befc0),{'verbose':_0x3872f3[_0x1b7a3f(0x225)]}),_0xdd8c3a=_0x3554dc['data'];return console['error']('β\x20Journey\x20\x22'+_0xdd8c3a['attributes'][_0x1b7a3f(0x208)]+_0x1b7a3f(0x207)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x221);[a25_0x25349b(0x173)]=a25_0x25349b(0x15a);async[a25_0x25349b(0x19c)](_0x1b36db){const _0x32a4e6=a25_0x25349b,{options:_0x304071,args:_0x1830a8,tdx:_0x51ce4d}=_0x1b36db,_0x581fc0=_0x304071,_0x34bf87=_0x1830a8[0x0],_0x279e37=_0x34bf87&&isYamlFilePath(_0x34bf87),_0x5e6225=await resolveTarget({'arg':_0x279e37?_0x34bf87:undefined,'contextParent':_0x304071['parentSegment'],'cwd':process[_0x32a4e6(0x224)]()});if(!isSuccessfulResolution(_0x5e6225))return _0x5e6225[_0x32a4e6(0x1ea)]===_0x32a4e6(0x194)?(console['error'](a25_0x3b0196['yellow'](_0x32a4e6(0x227))),console[_0x32a4e6(0x136)](_0x32a4e6(0x170)),console[_0x32a4e6(0x136)](_0x32a4e6(0x19a)),console[_0x32a4e6(0x136)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x32a4e6(0x136)](_0x32a4e6(0x219))):(console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x1c6)](_0x32a4e6(0x1c5)+_0x5e6225[_0x32a4e6(0x1b1)]+'\x0a')),_0x5e6225[_0x32a4e6(0x21f)]&&console[_0x32a4e6(0x136)](a25_0x3b0196['cyan'](_0x5e6225[_0x32a4e6(0x21f)]))),0x1;let _0x59e7b7=_0x279e37?undefined:_0x34bf87,_0x6bfea1,_0x1689cc;_0x5e6225[_0x32a4e6(0x1a2)]==='file'&&(_0x59e7b7=_0x5e6225[_0x32a4e6(0x119)],_0x6bfea1=_0x5e6225['filePath'],_0x1689cc=_0x5e6225[_0x32a4e6(0x16f)]);const _0x357074=_0x5e6225[_0x32a4e6(0x1d8)],_0x491b82=_0x5e6225['targetDir'];_0x581fc0[_0x32a4e6(0x225)]&&(console[_0x32a4e6(0x136)]('Parent\x20segment:\x20'+_0x357074),console[_0x32a4e6(0x136)]('Target\x20directory:\x20'+_0x491b82),_0x59e7b7&&console[_0x32a4e6(0x136)](_0x32a4e6(0x1b8)+_0x59e7b7),_0x6bfea1&&console[_0x32a4e6(0x136)](_0x32a4e6(0x1e0)+_0x6bfea1),_0x1689cc&&console['error']('Folder\x20path:\x20'+_0x1689cc));const _0xe3ce06=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x51ce4d['segment']['resolveParentId'](_0x357074),{'verbose':_0x304071[_0x32a4e6(0x225)]}),_0x26073b=_0xe3ce06[_0x32a4e6(0x162)],{journeys:_0xe9217d,folders:_0x2e0f33}=await withSpinner(_0x32a4e6(0x122),async()=>{const _0x158ea5=_0x32a4e6,[_0x4b7e54,_0x4c6f46]=await Promise[_0x158ea5(0x20e)]([_0x51ce4d[_0x158ea5(0x166)][_0x158ea5(0x1e1)](_0x26073b,undefined,{'includeAllVersions':!![]}),_0x51ce4d[_0x158ea5(0x20a)][_0x158ea5(0x1a1)](_0x26073b)]);return{'journeys':_0x4b7e54,'folders':_0x4c6f46};},{'verbose':_0x304071[_0x32a4e6(0x225)]})[_0x32a4e6(0x168)](_0x4c08=>_0x4c08[_0x32a4e6(0x162)]);let _0x296845=_0xe9217d;const _0x3843ea=buildFolderIdToPathMap(_0x2e0f33);if(_0x59e7b7){const _0x575d8d=_0x296845['filter'](_0x501b65=>_0x501b65[_0x32a4e6(0x131)][_0x32a4e6(0x141)]()===_0x59e7b7[_0x32a4e6(0x141)]());if(_0x575d8d[_0x32a4e6(0x16a)]===0x0)return console[_0x32a4e6(0x136)](_0x32a4e6(0x1bb)+_0x59e7b7),console['error'](_0x32a4e6(0x1bf)),0x1;_0x296845=_0x575d8d;}if(_0x1689cc!==undefined){const _0x2c5d43=_0x296845[_0x32a4e6(0x182)](_0x291a40=>{const _0x377294=_0x32a4e6,_0x41dab7=_0x291a40[_0x377294(0x135)]?_0x3843ea[_0x377294(0x1ad)](_0x291a40[_0x377294(0x135)])||'':'';return _0x41dab7===_0x1689cc;});if(_0x2c5d43['length']===0x0&&_0x296845[_0x32a4e6(0x16a)]>0x0){console[_0x32a4e6(0x136)](_0x32a4e6(0x1af)+_0x59e7b7+_0x32a4e6(0x184)+(_0x1689cc||_0x32a4e6(0x13a))),console[_0x32a4e6(0x136)](_0x32a4e6(0x1c4));for(const _0x13d652 of _0x296845){const _0xd7bcd2=_0x13d652[_0x32a4e6(0x135)]?_0x3843ea[_0x32a4e6(0x1ad)](_0x13d652[_0x32a4e6(0x135)])||'':'';console[_0x32a4e6(0x136)]('\x20\x20-\x20'+(_0xd7bcd2||_0x32a4e6(0x145))+'/'+_0x13d652['journeyBundleName']);}return 0x1;}_0x296845=_0x2c5d43;}if(_0x296845['length']===0x0)return console[_0x32a4e6(0x136)](_0x32a4e6(0x217)),0x0;const _0x721d2c=new Map();for(const _0x4809d4 of _0x296845){const _0x560f5d=_0x4809d4[_0x32a4e6(0x1b6)];!_0x721d2c[_0x32a4e6(0x1ce)](_0x560f5d)&&_0x721d2c['set'](_0x560f5d,[]),_0x721d2c[_0x32a4e6(0x1ad)](_0x560f5d)[_0x32a4e6(0x155)](_0x4809d4);}for(const _0x5b110f of _0x721d2c[_0x32a4e6(0x18f)]()){_0x5b110f['sort']((_0x2dfd61,_0x591336)=>(_0x2dfd61[_0x32a4e6(0x15e)]||0x0)-(_0x591336[_0x32a4e6(0x15e)]||0x0));}const _0x3a488d=[],{idToEmailMap:_0x3663c0,connectionIdToNameMap:_0x3ba23d}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x587b3d=_0x32a4e6,[_0x5b18c4,_0x2d9c90]=await Promise[_0x587b3d(0x20e)]([_0x51ce4d[_0x587b3d(0x20b)][_0x587b3d(0x149)](),_0x51ce4d[_0x587b3d(0x156)][_0x587b3d(0x151)]()]);return{'idToEmailMap':_0x5b18c4,'connectionIdToNameMap':_0x2d9c90};},{'verbose':_0x304071[_0x32a4e6(0x225)]})[_0x32a4e6(0x168)](_0x3b308e=>_0x3b308e[_0x32a4e6(0x162)]);for(const _0x584cb9 of _0x721d2c[_0x32a4e6(0x18f)]()){const _0x371e1b=_0x584cb9[0x0]['journeyBundleName'],_0x524990=_0x584cb9[0x0][_0x32a4e6(0x135)],_0xae731a=_0x524990?_0x3843ea[_0x32a4e6(0x1ad)](_0x524990)||'':'',_0x2050d5=_0xae731a?a25_0x20df61[_0x32a4e6(0x163)](_0x491b82,_0xae731a):_0x491b82,_0x59c95f=_0x6bfea1||a25_0x20df61['join'](_0x2050d5,sanitizeFileName(_0x371e1b)+'.yml');let _0xc6a6ca,_0x47844c;if(existsSync(_0x59c95f))try{const _0x575093=readFileSync(_0x59c95f,_0x32a4e6(0x1ae)),_0x86d399=parseYamlString(_0x575093);_0x47844c=_0x86d399,_0xc6a6ca=buildRuleToNameMapping(_0x86d399),_0x581fc0['verbose']&&_0xc6a6ca[_0x32a4e6(0x1e5)]>0x0&&console[_0x32a4e6(0x136)](_0x32a4e6(0x1b5)+_0xc6a6ca[_0x32a4e6(0x1e5)]+_0x32a4e6(0x18e)+_0x371e1b);}catch(_0x3a60fa){_0x581fc0['verbose']&&console['error'](_0x32a4e6(0x1c9)+_0x3a60fa[_0x32a4e6(0x1b1)]);}const _0x3be44f=[],_0x3a6477=new Set(),_0x261a90=new Map(),_0x29ccfa=new Map(),_0x278587=new Set(),_0x2edd64=new Map(),_0x531d54=new Map(),_0x16d469=createJumpTargetCache();await withProgressSpinner(_0x32a4e6(0x1c0)+_0x371e1b+'...',async _0x58dba5=>{const _0x572b09=_0x32a4e6;for(const _0x3a33a8 of _0x584cb9){const _0x4a4928=_0x584cb9[_0x572b09(0x16a)]>0x1?_0x3a33a8[_0x572b09(0x131)]+'\x20v'+(_0x3a33a8[_0x572b09(0x15e)]||0x1):_0x3a33a8[_0x572b09(0x131)];_0x58dba5['setPhase']('Fetching\x20'+_0x4a4928);const _0x29c63d=await _0x51ce4d[_0x572b09(0x166)][_0x572b09(0x19b)](_0x3a33a8['id']),_0xaa03cb=_0x29c63d['attributes']?.[_0x572b09(0x140)],_0x38147a={'resolveSegment':async _0x4c8534=>{const _0x4e2d68=_0x572b09;if(!_0xaa03cb)return{'name':_0x4c8534,'isJourneyLocal':![]};const _0x16b32d=_0x261a90[_0x4e2d68(0x1ad)](_0x4c8534);if(_0x16b32d)return _0x16b32d;try{const _0x48419d=await _0x51ce4d[_0x4e2d68(0x20a)][_0x4e2d68(0x1ec)](_0xaa03cb,_0x4c8534),_0x394966=_0x48419d['kind']===SEGMENT_KIND_JOURNEY;let _0xc52d62,_0x5cb20a=_0x48419d[_0x4e2d68(0x208)];if(_0x394966&&_0x48419d[_0x4e2d68(0x18c)]){const _0x339551=await segmentResponseToDef(_0x48419d,{'resolveSegmentName':async _0x144695=>{const _0x1ef660=_0x4e2d68,_0x1584c3=_0x261a90['get'](_0x144695);if(_0x1584c3)return _0x1584c3[_0x1ef660(0x208)];const _0x1f2f52=await _0x38147a[_0x1ef660(0x1b2)](_0x144695);return _0x1f2f52[_0x1ef660(0x208)];}}),_0x211006=_0x339551[_0x4e2d68(0x18c)];_0xc52d62={'description':_0x48419d['description'],'rule':_0x211006};const _0x55eac5=serializeRule(_0x211006),_0x5abb81=_0x29ccfa[_0x4e2d68(0x1ad)](_0x55eac5);if(_0x5abb81)_0x5cb20a=_0x5abb81,_0xc52d62=undefined,_0x581fc0[_0x4e2d68(0x225)]&&console[_0x4e2d68(0x136)](_0x4e2d68(0x190)+_0x48419d['name']+_0x4e2d68(0x1eb)+_0x5abb81);else{let _0x461ca8=![];if(_0xc6a6ca){const _0x510419=_0xc6a6ca['get'](_0x55eac5);if(_0x510419){const _0x205b31=_0x510419[_0x4e2d68(0x1a5)](_0x3babdf=>!_0x3a6477[_0x4e2d68(0x1ce)](_0x3babdf));_0x205b31&&(_0x5cb20a=_0x205b31,_0x3a6477[_0x4e2d68(0x19f)](_0x205b31),_0x29ccfa[_0x4e2d68(0x137)](_0x55eac5,_0x205b31),_0x461ca8=!![],_0x581fc0['verbose']&&console[_0x4e2d68(0x136)](_0x4e2d68(0x164)+_0x205b31+_0x4e2d68(0x199)));}}if(!_0x461ca8){const _0x25f8df=generateJourneyLocalName(_0x48419d[_0x4e2d68(0x208)]);_0x25f8df&&(_0x5cb20a=_0x25f8df);let _0x37d24e=_0x5cb20a,_0x106bd9=0x2;while(_0x3a6477[_0x4e2d68(0x1ce)](_0x37d24e)){_0x37d24e=_0x5cb20a+'_'+_0x106bd9,_0x106bd9++;}_0x3a6477['add'](_0x37d24e),_0x29ccfa[_0x4e2d68(0x137)](_0x55eac5,_0x37d24e),_0x5cb20a=_0x37d24e;}}}const _0x2026c4={'name':_0x5cb20a,'isJourneyLocal':_0x394966,'definition':_0xc52d62};return _0x261a90['set'](_0x4c8534,_0x2026c4),_0x2026c4;}catch(_0x2de49b){return _0x304071[_0x4e2d68(0x225)]&&console[_0x4e2d68(0x136)](_0x4e2d68(0x175)+_0x4c8534+':\x20'+_0x2de49b[_0x4e2d68(0x1b1)]),{'name':_0x4c8534,'isJourneyLocal':![]};}},'resolveActivation':async _0x142fba=>{const _0xc50045=_0x572b09,_0x2218a9=_0x2edd64[_0xc50045(0x1ad)](_0x142fba);if(_0x2218a9)return _0x2218a9;try{const _0x70d449=await _0x51ce4d[_0xc50045(0x166)][_0xc50045(0x1a0)](_0x3a33a8['id'],_0x142fba),_0x330e07=journeyActivationStepToYaml(_0x70d449,_0x3663c0,_0x3ba23d),_0x1f03d0=JSON[_0xc50045(0x130)]({'name':_0x330e07['name'],'connection':_0x330e07[_0xc50045(0x156)],'connector_config':_0x330e07[_0xc50045(0x188)]}),_0x7b165e=_0x531d54[_0xc50045(0x1ad)](_0x1f03d0);if(_0x7b165e){const _0x322fca={'name':_0x7b165e,'isJourneyLocal':!![],'definition':_0x330e07};return _0x2edd64[_0xc50045(0x137)](_0x142fba,_0x322fca),_0x322fca;}const _0x3a1886=_0x70d449[_0xc50045(0x1d0)][_0xc50045(0x1a6)]['name']||_0x142fba,_0x4d973f=sanitizeYamlKey(_0x3a1886)||'activation_'+_0x142fba;let _0x54c52d=_0x4d973f,_0xc232fa=0x2;while(_0x278587[_0xc50045(0x1ce)](_0x54c52d)){_0x54c52d=_0x4d973f+'_'+_0xc232fa,_0xc232fa++;}_0x278587['add'](_0x54c52d),_0x531d54[_0xc50045(0x137)](_0x1f03d0,_0x54c52d);const _0x3882b4={'name':_0x54c52d,'isJourneyLocal':!![],'definition':_0x330e07};return _0x2edd64[_0xc50045(0x137)](_0x142fba,_0x3882b4),_0x3882b4;}catch(_0x446409){return _0x304071[_0xc50045(0x225)]&&console[_0xc50045(0x136)](_0xc50045(0x213)+_0x142fba+':\x20'+_0x446409[_0xc50045(0x1b1)]),{'name':_0x142fba,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x456f09,_0x527076)=>{const _0x6d6fb=_0x572b09;return resolveJumpTarget(_0x456f09,_0x527076,_0x16d469,_0x20892f=>_0x51ce4d[_0x6d6fb(0x166)]['getJourney'](_0x20892f));}},_0x125d35=await journeyResponseToDef(_0x29c63d,_0x38147a);_0x3be44f[_0x572b09(0x155)]({'item':_0x3a33a8,'yaml':_0x125d35});}},{'verbose':_0x304071[_0x32a4e6(0x225)]});const _0x3ad710=await _0x51ce4d[_0x32a4e6(0x166)][_0x32a4e6(0x192)](_0x584cb9[0x0]['journeyBundleId']),_0x2c80ae=buildMergedJourneyDef(_0x3be44f,_0xc6a6ca,_0x3ad710),_0x6763f8=normalizeJourneyDef(_0x2c80ae,_0x47844c),_0x44c202=toYamlString(_0x6763f8),_0xcb4520=_0x6bfea1||a25_0x20df61['join'](_0x2050d5,sanitizeFileName(_0x371e1b)+_0x32a4e6(0x1dc));!_0x6bfea1&&_0xae731a&&!existsSync(_0x2050d5)&&mkdirSync(_0x2050d5,{'recursive':!![]});const _0x275ee1=a25_0x20df61['relative'](process[_0x32a4e6(0x224)](),_0xcb4520);if(existsSync(_0xcb4520)){const _0x65eed=readFileSync(_0xcb4520,_0x32a4e6(0x1ae)),_0x2a2e96=generateDiff(_0x65eed,_0x44c202),_0xea6696=hasChanges(_0x2a2e96);_0x3a488d[_0x32a4e6(0x155)]({'relativePath':_0x275ee1,'absolutePath':_0xcb4520,'content':_0x44c202,'isNew':![],'hasChanges':_0xea6696,'diff':_0xea6696?formatDiffWithColors(_0x2a2e96):undefined});}else _0x3a488d[_0x32a4e6(0x155)]({'relativePath':_0x275ee1,'absolutePath':_0xcb4520,'content':_0x44c202,'isNew':!![],'hasChanges':![]});}const _0x2029e1=_0x3a488d[_0x32a4e6(0x182)](_0xcbcbb7=>_0xcbcbb7['isNew']),_0x3cc8d1=_0x3a488d[_0x32a4e6(0x182)](_0x415c8a=>!_0x415c8a['isNew']&&_0x415c8a[_0x32a4e6(0x14f)]),_0x2c98cc=_0x3a488d['filter'](_0x11d1fc=>!_0x11d1fc[_0x32a4e6(0x134)]&&!_0x11d1fc[_0x32a4e6(0x14f)]),_0x2f4c68=_0x296845['length'],_0x5c1478=_0x721d2c[_0x32a4e6(0x1e5)],_0xd3d5df=_0x2f4c68>_0x5c1478?'\x20('+_0x2f4c68+'\x20versions)':'';console[_0x32a4e6(0x136)](_0x32a4e6(0x185)),console[_0x32a4e6(0x136)]('\x20\x20'+a25_0x3b0196[_0x32a4e6(0x1f6)](_0x5c1478+_0x32a4e6(0x11d))+a25_0x3b0196[_0x32a4e6(0x146)](_0xd3d5df)),console[_0x32a4e6(0x136)]('\x20\x20'+a25_0x3b0196[_0x32a4e6(0x159)]('+\x20'+_0x2029e1[_0x32a4e6(0x16a)]+_0x32a4e6(0x1bd))),console[_0x32a4e6(0x136)]('\x20\x20'+a25_0x3b0196[_0x32a4e6(0x16b)]('~\x20'+_0x3cc8d1[_0x32a4e6(0x16a)]+_0x32a4e6(0x15d))),console['error']('\x20\x20'+a25_0x3b0196[_0x32a4e6(0x146)]('=\x20'+_0x2c98cc[_0x32a4e6(0x16a)]+_0x32a4e6(0x1cf))),console[_0x32a4e6(0x136)](_0x32a4e6(0x189)+a25_0x3b0196['cyan'](_0x491b82)+'\x0a');if(_0x3cc8d1[_0x32a4e6(0x16a)]>0x0)for(const _0x578f3d of _0x3cc8d1){console[_0x32a4e6(0x136)]('\x0aChanges\x20to\x20\x27'+_0x578f3d['relativePath']+'\x27:'),console[_0x32a4e6(0x136)]('β'[_0x32a4e6(0x214)](0x3c)),console[_0x32a4e6(0x136)](_0x578f3d[_0x32a4e6(0x11e)]),console[_0x32a4e6(0x136)]('β'[_0x32a4e6(0x214)](0x3c));}if(_0x581fc0['dryRun'])return console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x16b)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2029e1['length']===0x0&&_0x3cc8d1[_0x32a4e6(0x16a)]===0x0)return console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x159)](_0x32a4e6(0x1b9))),saveSessionContext({'parent_segment':_0x357074},_0x581fc0[_0x32a4e6(0x16d)]),console[_0x32a4e6(0x136)](a25_0x3b0196['green'](_0x32a4e6(0x123)+a25_0x3b0196[_0x32a4e6(0x146)](_0x32a4e6(0x178))+'\x20=\x20'+a25_0x3b0196[_0x32a4e6(0x1f6)](_0x357074))),0x0;if(!_0x581fc0[_0x32a4e6(0x1ff)]&&(_0x2029e1['length']>0x0||_0x3cc8d1['length']>0x0)){if(!isInteractive())return console['error'](a25_0x3b0196[_0x32a4e6(0x1c6)](_0x32a4e6(0x138)),_0x32a4e6(0x1f0)),console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x146)](_0x32a4e6(0x125))),0x1;const _0x51cb1d=await confirmKey(_0x32a4e6(0x13d)+(_0x2029e1['length']+_0x3cc8d1['length'])+_0x32a4e6(0x1d6));if(!_0x51cb1d)return console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x16b)](_0x32a4e6(0x128)),_0x32a4e6(0x12e)),0x1;}!existsSync(_0x491b82)&&mkdirSync(_0x491b82,{'recursive':!![]});const _0x38d722=a25_0x20df61[_0x32a4e6(0x163)](_0x491b82,_0x32a4e6(0x120));writeFileSync(_0x38d722,createTdxConfigContent(_0x357074),_0x32a4e6(0x1ae));for(const _0x371fe5 of _0x3a488d){(_0x371fe5[_0x32a4e6(0x134)]||_0x371fe5[_0x32a4e6(0x14f)])&&writeFileSync(_0x371fe5[_0x32a4e6(0x17f)],_0x371fe5[_0x32a4e6(0x1b3)],_0x32a4e6(0x1ae));}return console[_0x32a4e6(0x136)](a25_0x3b0196[_0x32a4e6(0x159)]('β\x20Pulled\x20'+(_0x2029e1[_0x32a4e6(0x16a)]+_0x3cc8d1[_0x32a4e6(0x16a)])+_0x32a4e6(0x1db)+_0x491b82)),saveSessionContext({'parent_segment':_0x357074},_0x581fc0[_0x32a4e6(0x16d)]),console[_0x32a4e6(0x136)](a25_0x3b0196['green']('β\x20Context\x20set:\x20'+a25_0x3b0196[_0x32a4e6(0x146)]('parent_segment')+_0x32a4e6(0x1e2)+a25_0x3b0196[_0x32a4e6(0x1f6)](_0x357074))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a25_0x25349b(0x1d4);[a25_0x25349b(0x173)]=a25_0x25349b(0x17b);async[a25_0x25349b(0x19c)](_0x2c9dd3){const _0x2c5a61=a25_0x25349b,{options:_0x495c0a,args:_0x4af77,tdx:_0x5e2f57}=_0x2c9dd3,_0x2e85c5=_0x4af77[0x0];if(!requireNameOrPath(_0x2e85c5))return 0x1;_0x495c0a[_0x2c5a61(0x225)]&&console[_0x2c5a61(0x136)](_0x2c5a61(0x172)+_0x2e85c5);const {journeyId:_0x170b4e}=await resolveJourneyIdFromInput(_0x2e85c5,_0x495c0a,_0x5e2f57),_0x2021c2=await withSpinner(_0x2c5a61(0x21a),()=>_0x5e2f57[_0x2c5a61(0x166)][_0x2c5a61(0x1f5)](_0x170b4e),{'verbose':_0x495c0a[_0x2c5a61(0x225)]}),_0x369d06=_0x2021c2[_0x2c5a61(0x162)];return console[_0x2c5a61(0x204)](_0x2c5a61(0x181)+_0x369d06[_0x2c5a61(0x1d7)]),console[_0x2c5a61(0x204)]('Table:\x20'+_0x369d06[_0x2c5a61(0x1f2)]),await handleSDKOutput(_0x369d06[_0x2c5a61(0x187)],_0x495c0a),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a25_0x25349b(0x208)]='journey:activations';[a25_0x25349b(0x173)]=a25_0x25349b(0x132);async['execute'](_0x2d0309){const _0x392c73=a25_0x25349b,{options:_0xfdb4f2,args:_0x262ac3,tdx:_0x34a0e3}=_0x2d0309,_0x3b3f31=_0x262ac3[0x0];if(!requireNameOrPath(_0x3b3f31))return 0x1;_0xfdb4f2[_0x392c73(0x225)]&&console[_0x392c73(0x136)](_0x392c73(0x172)+_0x3b3f31);const {journeyId:_0x3c3c53}=await resolveJourneyIdFromInput(_0x3b3f31,_0xfdb4f2,_0x34a0e3),_0x17d533=await withSpinner(_0x392c73(0x201),()=>_0x34a0e3['journey'][_0x392c73(0x191)](_0x3c3c53),{'verbose':_0xfdb4f2[_0x392c73(0x225)]}),_0x518a4a=_0x17d533['data'];return console[_0x392c73(0x136)](_0x392c73(0x1b5)+_0x518a4a['length']+_0x392c73(0x14c)+(_0x518a4a[_0x392c73(0x16a)]!==0x1?'s':'')),await handleSDKOutput(_0x518a4a,_0xfdb4f2),0x0;}}export class JourneyPushCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x222);[a25_0x25349b(0x173)]=a25_0x25349b(0x177);[a25_0x25349b(0x21b)]=new SegmentPushCommand();async[a25_0x25349b(0x19c)](_0x4686e8){const _0x2ab34e=a25_0x25349b,_0x2d7e67=_0x4686e8[_0x2ab34e(0x1e9)][0x0];let _0x568b01;if(_0x2d7e67){const _0xd1d8e0=await resolveTarget({'arg':_0x2d7e67,'contextParent':_0x4686e8[_0x2ab34e(0x20d)][_0x2ab34e(0x202)],'cwd':process['cwd']()});isSuccessfulResolution(_0xd1d8e0)&&_0xd1d8e0[_0x2ab34e(0x1a2)]==='file'&&(_0x568b01=_0xd1d8e0[_0x2ab34e(0x1a8)]);}const _0x55a413={..._0x4686e8,'options':{..._0x4686e8[_0x2ab34e(0x20d)],'journeysOnly':!![],..._0x568b01&&{'singleFilePath':_0x568b01}}};return this['segmentPushCommand'][_0x2ab34e(0x19c)](_0x55a413);}}export class JourneyVersionsCommand extends BaseCommand{[a25_0x25349b(0x208)]=a25_0x25349b(0x126);[a25_0x25349b(0x173)]=a25_0x25349b(0x180);async[a25_0x25349b(0x19c)](_0x386445){const _0x3fc56e=a25_0x25349b,{options:_0x1cd342,args:_0x24e992,tdx:_0x12b5e5}=_0x386445,_0x572da6=_0x24e992[0x0];if(!requireNameOrPath(_0x572da6))return 0x1;if(_0x1cd342['verbose'])console[_0x3fc56e(0x136)](_0x3fc56e(0x172)+_0x572da6);const {journeyId:_0x413d7a}=await resolveJourneyIdFromInput(_0x572da6,_0x1cd342,_0x12b5e5),_0x5c6f04=await withSpinner(_0x3fc56e(0x215),()=>_0x12b5e5[_0x3fc56e(0x166)]['listVersions'](_0x413d7a),{'verbose':_0x1cd342[_0x3fc56e(0x225)]}),{bundleName:_0x50d99b,versions:_0x157bcd,latestJourneyId:_0x396790}=_0x5c6f04['data'];console[_0x3fc56e(0x136)](_0x50d99b+':\x20'+_0x157bcd[_0x3fc56e(0x16a)]+'\x20version'+(_0x157bcd[_0x3fc56e(0x16a)]!==0x1?'s':''));const _0x1d1a23=_0x157bcd['map'](_0x214754=>({'version':_0x214754['versionNumber'],'journey_id':_0x214754['journeyId'],'name':_0x214754['name'],'state':_0x214754[_0x3fc56e(0x200)],'paused':_0x214754[_0x3fc56e(0x228)],'latest':_0x214754[_0x3fc56e(0x14d)]===_0x396790,'created_at':_0x214754['createdAt']}));return await handleSDKOutput(_0x1d1a23,_0x1cd342),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a25_0x25349b(0x216);['description']=a25_0x25349b(0x21e);async[a25_0x25349b(0x19c)](_0x175202){const _0x15db10=a25_0x25349b,{options:_0x3c89de,args:_0x21ea6a,tdx:_0x176a6f}=_0x175202,_0x47f507=_0x21ea6a[0x0];if(!requireNameOrPath(_0x47f507))return 0x1;if(_0x3c89de[_0x15db10(0x225)])console[_0x15db10(0x136)](_0x15db10(0x172)+_0x47f507);const {journeyId:_0xe7d0b7,journeyName:_0xcab33b}=await resolveJourneyIdFromInput(_0x47f507,_0x3c89de,_0x176a6f);if(!_0x3c89de[_0x15db10(0x1ff)]){const _0x382a36=await confirm(_0x15db10(0x11b)+_0xcab33b+'\x22?');if(!_0x382a36)return console[_0x15db10(0x136)]('Cancelled'),0x0;}const _0x4de047=await withSpinner(_0x15db10(0x1a9),()=>_0x176a6f[_0x15db10(0x166)][_0x15db10(0x174)](_0xe7d0b7),{'verbose':_0x3c89de[_0x15db10(0x225)]}),_0x4f2597=_0x4de047['data'];return console['error'](a25_0x3b0196[_0x15db10(0x159)]('β')+_0x15db10(0x220)+_0x4f2597['attributes']['versionNumber']+_0x15db10(0x12c)+_0x4f2597['attributes'][_0x15db10(0x208)]+'\x22'),console['error'](_0x15db10(0x148)+_0x4f2597['id']),await handleSingleObjectOutput({'id':_0x4f2597['id'],'name':_0x4f2597[_0x15db10(0x1d0)]['name'],'version':_0x4f2597[_0x15db10(0x1d0)][_0x15db10(0x15e)],'state':_0x4f2597[_0x15db10(0x1d0)][_0x15db10(0x200)],'bundle_id':_0x4f2597[_0x15db10(0x1d0)][_0x15db10(0x1b6)],'created_at':_0x4f2597[_0x15db10(0x1d0)][_0x15db10(0x14a)]},_0x3c89de),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a25_0x25349b(0x144);['description']=a25_0x25349b(0x1cc);async['execute'](_0x46c19e){const _0x483c9b=a25_0x25349b,{options:_0x3eaa8f,args:_0xc04e28,tdx:_0x1bfe95}=_0x46c19e,_0x1f3364=_0xc04e28[0x0];if(!requireNameOrPath(_0x1f3364))return 0x1;const _0x5ca31e=_0x3eaa8f['version'];if(!_0x5ca31e)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x483c9b(0x136)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x307206=parseInt(_0x5ca31e,0xa);if(isNaN(_0x307206)||_0x307206<0x1)return console[_0x483c9b(0x136)](_0x483c9b(0x1aa)+_0x5ca31e),0x1;if(_0x3eaa8f[_0x483c9b(0x225)])console[_0x483c9b(0x136)](_0x483c9b(0x172)+_0x1f3364+_0x483c9b(0x1c7)+_0x307206);const {journeyId:_0x304066,parentSegmentId:_0x499162}=await resolveJourneyIdFromInput(_0x1f3364,_0x3eaa8f,_0x1bfe95),_0x389759=await withSpinner('Resolving\x20version...',()=>_0x1bfe95[_0x483c9b(0x166)][_0x483c9b(0x1d5)](_0x304066),{'verbose':_0x3eaa8f['verbose']}),{versions:_0x437495,latestJourneyId:_0x4a8619}=_0x389759['data'],_0x1e249b=_0x437495[_0x483c9b(0x1a5)](_0x2c7226=>_0x2c7226[_0x483c9b(0x15e)]===_0x307206);if(!_0x1e249b){const _0x4a4e5c=_0x437495['map'](_0x48b457=>'v'+_0x48b457[_0x483c9b(0x15e)])['join'](',\x20');return console['error']('Error:\x20Version\x20'+_0x307206+_0x483c9b(0x1c1)+_0x4a4e5c),0x1;}const _0x1ed8b6=await withSpinner('Getting\x20version\x20'+_0x307206+_0x483c9b(0x20f),()=>_0x1bfe95[_0x483c9b(0x166)][_0x483c9b(0x19b)](_0x1e249b[_0x483c9b(0x14d)]),{'verbose':_0x3eaa8f[_0x483c9b(0x225)]}),_0x7173c0=_0x1ed8b6[_0x483c9b(0x162)],_0x35d8c6=getConsoleNextUrl(_0x3eaa8f[_0x483c9b(0x16e)],_0x483c9b(0x211)+_0x499162+_0x483c9b(0x1bc)+_0x1e249b['journeyId']+_0x483c9b(0x13f));return await handleSingleObjectOutput({'id':_0x7173c0['id'],'name':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x208)],'version':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x15e)],'description':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x173)],'state':_0x7173c0[_0x483c9b(0x1d0)]['state'],'paused':_0x7173c0[_0x483c9b(0x1d0)]['paused'],'reentry_mode':_0x7173c0['attributes'][_0x483c9b(0x1ee)],'stages':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x17e)]?.['length']||0x0,..._0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x1ab)]&&{'goal':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x1ab)][_0x483c9b(0x208)]},'latest':_0x1e249b[_0x483c9b(0x14d)]===_0x4a8619,'created_at':_0x7173c0[_0x483c9b(0x1d0)][_0x483c9b(0x14a)],'updated_at':_0x7173c0['attributes'][_0x483c9b(0x1d1)],'url':_0x35d8c6},_0x3eaa8f),0x0;}}
|
|
1
|
+
const a25_0x43c82a=a25_0xda95;(function(_0x41ee01,_0x4240b6){const _0x32041a=a25_0xda95,_0x5b46bf=_0x41ee01();while(!![]){try{const _0x1a0ce6=parseInt(_0x32041a(0x16a))/0x1+parseInt(_0x32041a(0x152))/0x2+parseInt(_0x32041a(0xb2))/0x3+parseInt(_0x32041a(0x15b))/0x4+parseInt(_0x32041a(0x121))/0x5*(-parseInt(_0x32041a(0xae))/0x6)+parseInt(_0x32041a(0xe2))/0x7+parseInt(_0x32041a(0xee))/0x8*(-parseInt(_0x32041a(0x116))/0x9);if(_0x1a0ce6===_0x4240b6)break;else _0x5b46bf['push'](_0x5b46bf['shift']());}catch(_0x4652e1){_0x5b46bf['push'](_0x5b46bf['shift']());}}}(a25_0x133d,0xaff0c));import a25_0x4c1e02 from'chalk';import a25_0x178c23 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x3e8261){const _0x51745e=a25_0xda95;return!_0x3e8261&&(console['error'](_0x51745e(0x171)),console[_0x51745e(0xf2)](_0x51745e(0xa9))),!!_0x3e8261;}function withJsonFormat(_0x4e6afd){const _0x3a3858=a25_0xda95;if(!_0x4e6afd[_0x3a3858(0xca)]&&!_0x4e6afd['json']&&!_0x4e6afd['jsonl']&&!_0x4e6afd[_0x3a3858(0x19e)])return{..._0x4e6afd,'format':_0x3a3858(0x130),'json':!![]};return _0x4e6afd;}function formatJourneyState(_0x5f4516){const _0x57f4f9=a25_0xda95;switch(_0x5f4516){case _0x57f4f9(0x109):return a25_0x4c1e02[_0x57f4f9(0xe4)](_0x57f4f9(0x102));case _0x57f4f9(0x13b):return a25_0x4c1e02[_0x57f4f9(0xd6)](_0x57f4f9(0x163));case _0x57f4f9(0x134):return a25_0x4c1e02[_0x57f4f9(0x11f)](_0x57f4f9(0x118));case'completed':return a25_0x4c1e02['blue'](_0x57f4f9(0xf0));case _0x57f4f9(0x158):return a25_0x4c1e02[_0x57f4f9(0xd6)]('(archived)');default:return'('+_0x5f4516+')';}}function formatJourneyItem(_0xefb39c,_0x4e0c39='',_0x465b50){const _0x1e5636=a25_0xda95,_0x1a4f46=formatJourneyState(_0xefb39c[_0x1e5636(0xa8)]),_0xc13394=_0x465b50?hyperlink(_0xefb39c[_0x1e5636(0x105)],_0x465b50):_0xefb39c[_0x1e5636(0x105)];return _0x4e0c39+'πΊοΈ\x20'+_0xc13394+'\x20'+_0x1a4f46;}function escapeRegex(_0x2613f5){const _0x473849=a25_0xda95;return _0x2613f5[_0x473849(0xfd)](/[.*+?^${}()|[\]\\]/g,_0x473849(0x1a7));}function globToRegex(_0x4d721c){const _0x448308=a25_0xda95,_0x5e1305=_0x4d721c[_0x448308(0x133)]('*')[_0x448308(0x189)](escapeRegex);return new RegExp(_0x5e1305[_0x448308(0x17d)]('.*'),'i');}function buildRuleToNameMapping(_0x5c04e3){const _0x226a94=a25_0xda95,_0x5bfec3=new Map();if(_0x5c04e3[_0x226a94(0xad)])for(const [_0x4fad49,_0x30fa6c]of Object[_0x226a94(0x12e)](_0x5c04e3[_0x226a94(0xad)])){if(_0x30fa6c[_0x226a94(0x17a)]){const _0xae3e03=serializeRule(_0x30fa6c[_0x226a94(0x17a)]),_0x10f30e=_0x5bfec3[_0x226a94(0x1ae)](_0xae3e03);_0x10f30e?_0x10f30e[_0x226a94(0x13f)](_0x4fad49):_0x5bfec3['set'](_0xae3e03,[_0x4fad49]);}}return _0x5bfec3;}async function resolveJourneyIdFromInput(_0x56303e,_0x1f37a9,_0x55935a){const _0x38519e=a25_0xda95,_0x11294e=await resolveJourneyTarget(_0x56303e,_0x1f37a9[_0x38519e(0x1ac)],_0x1f37a9[_0x38519e(0xc2)]),_0x4566e3=_0x11294e[_0x38519e(0x1ac)];if(!_0x4566e3)throw new SDKError(ErrorCode[_0x38519e(0xff)],_0x38519e(0x10c));const _0x43b5f9=await withSpinner(_0x38519e(0xec),()=>_0x55935a[_0x38519e(0x114)]['resolveParentId'](_0x4566e3),{'verbose':_0x1f37a9[_0x38519e(0xc2)]}),_0x3baf32=_0x43b5f9['data'],_0xd2ae3f=await withSpinner(_0x38519e(0x184),()=>_0x55935a[_0x38519e(0xa4)][_0x38519e(0x132)](_0x3baf32,_0x11294e['journeyName']),{'verbose':_0x1f37a9[_0x38519e(0xc2)]});return{'journeyId':_0xd2ae3f[_0x38519e(0x14a)],'journeyName':_0x11294e[_0x38519e(0x160)],'parentSegmentId':_0x3baf32};}async function resolveJourneyTarget(_0x2bdc4e,_0x36d63f,_0x24f3d9){const _0x2a0990=a25_0xda95;if(isYamlFilePath(_0x2bdc4e))try{const _0x3b3ae4=await resolveYamlFilePath(_0x2bdc4e);return _0x24f3d9&&(console[_0x2a0990(0xf2)](_0x2a0990(0xeb)+_0x2bdc4e),console[_0x2a0990(0xf2)]('\x20\x20Parent\x20segment:\x20'+_0x3b3ae4[_0x2a0990(0x1ac)]),console[_0x2a0990(0xf2)]('\x20\x20Name:\x20'+_0x3b3ae4[_0x2a0990(0x1b4)]),console['error'](_0x2a0990(0x150)+(_0x3b3ae4[_0x2a0990(0x139)]||_0x2a0990(0xcb)))),{'journeyName':_0x3b3ae4[_0x2a0990(0x1b4)],'parentSegment':_0x3b3ae4[_0x2a0990(0x1ac)],'resolved':_0x3b3ae4};}catch(_0xca361f){throw new SDKError(ErrorCode[_0x2a0990(0xff)],_0x2a0990(0xc7)+_0xca361f[_0x2a0990(0xce)]);}if(!_0x36d63f)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2a0990(0x137));return{'journeyName':_0x2bdc4e,'parentSegment':_0x36d63f};}function a25_0xda95(_0x54aedc,_0x3d373a){_0x54aedc=_0x54aedc-0x9e;const _0x133db9=a25_0x133d();let _0xda95e8=_0x133db9[_0x54aedc];return _0xda95e8;}export class JourneyListCommand extends BaseCommand{[a25_0x43c82a(0xe6)]='journey:list';[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0x165);async['execute'](_0x13ccf7){const _0x147824=a25_0x43c82a,{options:_0x4623cd,args:_0x383be7,tdx:_0x3042b}=_0x13ccf7,_0x3a77e0=_0x383be7[0x0],_0x10eb41=_0x4623cd[_0x147824(0x1ac)];if(!_0x10eb41)return console[_0x147824(0xf2)](_0x147824(0xef)),console[_0x147824(0xf2)](_0x147824(0x17c)),0x1;const _0x2d5329=await withSpinner(_0x147824(0xec),()=>_0x3042b['segment'][_0x147824(0x1a2)](_0x10eb41),{'verbose':_0x4623cd[_0x147824(0xc2)]}),_0x474cde=_0x2d5329['data'];_0x4623cd[_0x147824(0xc2)]&&(console[_0x147824(0xf2)](_0x147824(0x11d)+_0x10eb41+'\x20(ID:\x20'+_0x474cde+')'),_0x3a77e0&&console[_0x147824(0xf2)](_0x147824(0x1ad)+_0x3a77e0));const _0x11cb9d=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x3042b[_0x147824(0x114)][_0x147824(0xd3)](_0x474cde),{'verbose':_0x4623cd[_0x147824(0xc2)]}),_0x488008=_0x11cb9d['data'],_0x1d1bd5=_0x488008[_0x147824(0xd2)],_0x5300fd=await withSpinner(_0x147824(0xc8),()=>_0x3042b[_0x147824(0xa4)][_0x147824(0xea)](_0x474cde,_0x1d1bd5),{'verbose':_0x4623cd['verbose']});let _0x2d281e=_0x5300fd[_0x147824(0x14a)][_0x147824(0x135)];const _0x391f5a=_0x5300fd['data'][_0x147824(0xe7)],_0x899c0c=new Map();for(const _0x392abf of _0x391f5a){_0x899c0c[_0x147824(0x100)](_0x392abf['id'],_0x392abf[_0x147824(0xe6)]);}if(_0x3a77e0){const _0x3abce2=globToRegex(_0x3a77e0);_0x2d281e=_0x2d281e['filter'](_0x2dcdc4=>_0x3abce2[_0x147824(0x110)](_0x2dcdc4[_0x147824(0x105)]));}console['error'](_0x147824(0x12d)+_0x2d281e[_0x147824(0x199)]+_0x147824(0x10e)+(_0x2d281e[_0x147824(0x199)]!==0x1?'s':''));const _0x338906=_0x29f723=>{const _0x23d1d3=_0x147824;return getConsoleNextUrl(_0x4623cd[_0x23d1d3(0x1ab)],_0x23d1d3(0xbf)+_0x474cde+_0x23d1d3(0x154)+_0x29f723+_0x23d1d3(0x197));};if(_0x4623cd[_0x147824(0xca)]===_0x147824(0x11e))await handleSDKOutput(_0x2d281e,_0x4623cd);else{if(_0x4623cd[_0x147824(0xca)]===_0x147824(0x130)){const _0x36282b=_0x2d281e[_0x147824(0x189)](_0x2e4636=>({..._0x2e4636,'url':_0x338906(_0x2e4636['id'])}));await handleSDKOutput(_0x36282b,_0x4623cd);}else{console[_0x147824(0x167)]('['+_0x10eb41+']');const _0x27fbbf=new Map(),_0x220110=[];for(const _0x6d5050 of _0x2d281e){if(!_0x6d5050[_0x147824(0x120)]||_0x6d5050['folderId']===_0x1d1bd5)_0x220110[_0x147824(0x13f)](_0x6d5050);else{const _0x1e1acb=_0x27fbbf[_0x147824(0x1ae)](_0x6d5050['folderId'])||[];_0x1e1acb[_0x147824(0x13f)](_0x6d5050),_0x27fbbf[_0x147824(0x100)](_0x6d5050[_0x147824(0x120)],_0x1e1acb);}}const _0x20dd08=(_0xb46b48,_0x290ee9)=>_0xb46b48[_0x147824(0x105)][_0x147824(0x117)](_0x290ee9[_0x147824(0x105)],undefined,{'sensitivity':'base'});_0x220110[_0x147824(0xbc)](_0x20dd08);for(const _0x349440 of _0x220110){console[_0x147824(0x167)](formatJourneyItem(_0x349440,'',_0x338906(_0x349440['id'])));}const _0x575474=[..._0x27fbbf[_0x147824(0x12e)]()][_0x147824(0xbc)]((_0x38f42a,_0x21f16e)=>{const _0x3a2a43=_0x147824,_0x434b3f=_0x899c0c[_0x3a2a43(0x1ae)](_0x38f42a[0x0])||_0x38f42a[0x0],_0x1754fd=_0x899c0c[_0x3a2a43(0x1ae)](_0x21f16e[0x0])||_0x21f16e[0x0];return _0x434b3f[_0x3a2a43(0x117)](_0x1754fd,undefined,{'sensitivity':_0x3a2a43(0x143)});});for(const [_0xf88439,_0x3b5f83]of _0x575474){const _0x2a2b32=_0x899c0c[_0x147824(0x1ae)](_0xf88439)||_0xf88439;console[_0x147824(0x167)]('π\x20'+_0x2a2b32),_0x3b5f83[_0x147824(0xbc)](_0x20dd08);for(const _0x23eeef of _0x3b5f83){console['log'](formatJourneyItem(_0x23eeef,'\x20\x20',_0x338906(_0x23eeef['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a25_0x43c82a(0xf7);[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0x15d);async[a25_0x43c82a(0x12b)](_0x512d9e){const _0x51c503=a25_0x43c82a,{options:_0x5a8f16,args:_0x20281d,tdx:_0x2c028f}=_0x512d9e,_0xe78be8=_0x20281d[0x0];if(!_0xe78be8)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x51c503(0xf2)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x51c503(0xf2)](_0x51c503(0xb3)),console[_0x51c503(0xf2)](_0x51c503(0x129)),0x1;_0x5a8f16[_0x51c503(0xc2)]&&console[_0x51c503(0xf2)](_0x51c503(0xb7)+_0xe78be8);const {journeyId:_0x4714d6,parentSegmentId:_0x59a589}=await resolveJourneyIdFromInput(_0xe78be8,_0x5a8f16,_0x2c028f);if(_0x5a8f16[_0x51c503(0x1a9)]){const _0x45e771=getConsoleNextUrl(_0x5a8f16[_0x51c503(0x1ab)],_0x51c503(0xbf)+_0x59a589+_0x51c503(0x154)+_0x4714d6+_0x51c503(0x198));return console['error'](a25_0x4c1e02[_0x51c503(0xe4)]('β')+_0x51c503(0x142)+a25_0x4c1e02[_0x51c503(0xdb)](_0x45e771)),openBrowser(_0x45e771),0x0;}const _0x141cdb=await withSpinner(_0x51c503(0xbe),()=>_0x2c028f[_0x51c503(0xa4)][_0x51c503(0xab)](_0x4714d6),{'verbose':_0x5a8f16[_0x51c503(0xc2)]}),_0x49c4c9=_0x141cdb[_0x51c503(0x14a)],_0x3fb271=_0x5a8f16[_0x51c503(0x147)];let _0x2e15e9;if(_0x3fb271)try{const _0x16a49e=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x2c028f[_0x51c503(0xa4)][_0x51c503(0x153)](_0x4714d6),{'verbose':_0x5a8f16['verbose']});_0x2e15e9=_0x16a49e[_0x51c503(0x14a)];}catch{_0x5a8f16[_0x51c503(0xc2)]&&console[_0x51c503(0xf2)](_0x51c503(0x10b));}const _0x39278c=getConsoleNextUrl(_0x5a8f16[_0x51c503(0x1ab)],_0x51c503(0xbf)+_0x59a589+_0x51c503(0x154)+_0x4714d6+_0x51c503(0x198)),_0x32220c={'id':_0x49c4c9['id'],'name':_0x49c4c9[_0x51c503(0xb5)][_0x51c503(0xe6)],'description':_0x49c4c9[_0x51c503(0xb5)]['description'],'state':_0x49c4c9[_0x51c503(0xb5)][_0x51c503(0xa8)],'paused':_0x49c4c9[_0x51c503(0xb5)]['paused'],'reentry_mode':_0x49c4c9['attributes'][_0x51c503(0x13c)],'stages':_0x49c4c9[_0x51c503(0xb5)][_0x51c503(0x186)]?.[_0x51c503(0x199)]||0x0,..._0x49c4c9[_0x51c503(0xb5)][_0x51c503(0xd1)]&&{'goal':_0x49c4c9[_0x51c503(0xb5)][_0x51c503(0xd1)][_0x51c503(0xe6)]},..._0x2e15e9&&{'statistics':{'size':_0x2e15e9[_0x51c503(0x136)],'entered':_0x2e15e9[_0x51c503(0x127)],'goal_achieved':_0x2e15e9[_0x51c503(0x12c)],'completion_rate':_0x2e15e9[_0x51c503(0x16e)],'exit_or_jump':_0x2e15e9['exitOrJumpSize'],'exit_or_jump_rate':_0x2e15e9[_0x51c503(0xcc)],'stages':_0x2e15e9[_0x51c503(0xf8)]}},'url':_0x39278c};return await handleSingleObjectOutput(_0x32220c,_0x5a8f16),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a25_0x43c82a(0xe6)]=a25_0x43c82a(0xe3);[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0xa6);async[a25_0x43c82a(0x12b)](_0x5b5f78){const _0x4ab6af=a25_0x43c82a,{options:_0x17eacc,args:_0xd8f3db,tdx:_0x359d7f}=_0x5b5f78,_0x5e7e03=_0xd8f3db[0x0];if(!requireNameOrPath(_0x5e7e03))return 0x1;_0x17eacc['verbose']&&console[_0x4ab6af(0xf2)](_0x4ab6af(0xb7)+_0x5e7e03);const _0x47ae56=_0x17eacc,_0x4ee0b3=_0x47ae56[_0x4ab6af(0xc9)],_0x24bc36=_0x47ae56['to'],_0x678834=_0x47ae56[_0x4ab6af(0x9f)],_0x15cc99=_0x47ae56[_0x4ab6af(0x19c)];_0x678834&&!_0x4ee0b3&&!_0x24bc36&&console[_0x4ab6af(0xf2)](_0x4ab6af(0xa3));const _0x1d7a37=_0x678834?withJsonFormat(_0x17eacc):_0x17eacc,{journeyId:_0x4d7f23,journeyName:_0x369dd6}=await resolveJourneyIdFromInput(_0x5e7e03,_0x1d7a37,_0x359d7f),_0x2a0773=_0x4ee0b3||_0x24bc36?{'from':_0x4ee0b3,'to':_0x24bc36}:undefined,_0x515a14=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x4ab6af(0x131)]([_0x359d7f[_0x4ab6af(0xa4)][_0x4ab6af(0xab)](_0x4d7f23),_0x359d7f['journey'][_0x4ab6af(0x153)](_0x4d7f23,_0x2a0773)]),{'verbose':_0x1d7a37['verbose']}),[_0x4fcd80,_0x17e522]=_0x515a14[_0x4ab6af(0x14a)];if(!_0x17e522||_0x17e522[_0x4ab6af(0xd7)]===null)return console[_0x4ab6af(0xf2)](_0x4ab6af(0x1af)+_0x369dd6),console[_0x4ab6af(0xf2)](_0x4ab6af(0xb0)),0x0;const _0x3125ac=buildStageNameMap(_0x4fcd80),_0x5270fe=!!(_0x2a0773&&_0x17e522['history']?.['length']),_0x3ff7b2={'stageNameMap':_0x3125ac,'hasPeriod':_0x5270fe,'includeHistory':!!_0x678834};if(_0x15cc99&&_0x17e522['stages']){const _0x4662d7=_0x17e522['stages']['find'](_0x3b254a=>{const _0x1ce339=_0x4ab6af,_0x2a2d88=_0x3125ac[_0x1ce339(0x1ae)](_0x3b254a['id'])??'';return _0x2a2d88['toLowerCase']()===_0x15cc99[_0x1ce339(0xe8)]();});if(_0x4662d7)return await handleSingleObjectOutput(formatStageStats(_0x4662d7,_0x3ff7b2),_0x1d7a37),0x0;const _0xbea00e=_0x17e522['stages']['map'](_0x4a6dc7=>_0x3125ac[_0x4ab6af(0x1ae)](_0x4a6dc7['id'])??_0x4a6dc7['id']);return console[_0x4ab6af(0xf2)](_0x4ab6af(0xdc)+_0x15cc99+_0x4ab6af(0x1b3)),console['error'](_0x4ab6af(0x1a0)+_0xbea00e[_0x4ab6af(0x17d)](',\x20')),0x1;}const _0x2d9836=_0x17e522[_0x4ab6af(0xf8)]?.[_0x4ab6af(0x189)](_0x2466e7=>formatStageStats(_0x2466e7,_0x3ff7b2)),_0x415c21=assembleJourneyStats(_0x17e522,{'from':_0x4ee0b3,'to':_0x24bc36,'includeHistory':_0x678834});return await this[_0x4ab6af(0xda)](_0x415c21,_0x2d9836??[],_0x1d7a37),0x0;}async[a25_0x43c82a(0xda)](_0x47d2a3,_0x5c9946,_0x1f5ca8){const _0x303db0=a25_0x43c82a,_0xd4c688=_0x1f5ca8[_0x303db0(0xca)]===_0x303db0(0x130)||_0x1f5ca8['format']===_0x303db0(0x125)||_0x1f5ca8[_0x303db0(0x130)]||_0x1f5ca8['jsonl'];if(_0xd4c688){_0x47d2a3[_0x303db0(0xf8)]=_0x5c9946,await handleSingleObjectOutput(_0x47d2a3,_0x1f5ca8);return;}await handleSingleObjectOutput(_0x47d2a3,_0x1f5ca8);for(const _0x14fab8 of _0x5c9946){console['log'](''),console[_0x303db0(0x167)](String(a25_0x4c1e02[_0x303db0(0xdb)]['bold']('['+_0x14fab8[_0x303db0(0xe6)]+']'))+a25_0x4c1e02[_0x303db0(0xd6)]('\x20'+_0x14fab8['id']));const {id:_0x566699,name:_0x30cda5,..._0x32746b}=_0x14fab8;await handleSingleObjectOutput(_0x32746b,_0x1f5ca8);}}}export class JourneyTrafficCommand extends BaseCommand{[a25_0x43c82a(0xe6)]='journey:traffic';[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0x191);async[a25_0x43c82a(0x12b)](_0x3c1657){const _0x491db9=a25_0x43c82a,{options:_0x3392a3,args:_0x357899,tdx:_0x9cee8e}=_0x3c1657,_0xc5e955=_0x357899[0x0];if(!requireNameOrPath(_0xc5e955))return 0x1;_0x3392a3[_0x491db9(0xc2)]&&console[_0x491db9(0xf2)]('Input:\x20'+_0xc5e955);const _0x1fbd43=_0x3392a3,_0x1009d8=_0x1fbd43['type'],_0x20eb56=_0x1fbd43[_0x491db9(0xc9)],_0x496275=_0x1fbd43['to'],_0x98e909=_0x1fbd43[_0x491db9(0x128)];if(_0x1009d8&&_0x1009d8!=='conversion'&&_0x1009d8!==_0x491db9(0x15e))return console[_0x491db9(0xf2)](_0x491db9(0xa5)+_0x1009d8+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x195cb5=withJsonFormat(_0x3392a3),{journeyId:_0x197a19,journeyName:_0x1f7df7}=await resolveJourneyIdFromInput(_0xc5e955,_0x195cb5,_0x9cee8e),_0x4a79e5={'type':_0x1009d8,'from':_0x20eb56,'to':_0x496275,'limit':_0x98e909},_0x58826b=await withSpinner(_0x491db9(0xc3),()=>_0x9cee8e['journey'][_0x491db9(0x19a)](_0x197a19,_0x4a79e5),{'verbose':_0x195cb5[_0x491db9(0xc2)]}),_0x412cd2=_0x58826b[_0x491db9(0x14a)],_0x585a54=_0x412cd2[_0x491db9(0x183)]&&(_0x412cd2['conversion'][_0x491db9(0x185)]['length']>0x0||_0x412cd2[_0x491db9(0x183)]['links'][_0x491db9(0x199)]>0x0),_0x2cb020=_0x412cd2[_0x491db9(0x15e)]&&_0x412cd2[_0x491db9(0x15e)][_0x491db9(0x199)]>0x0;if(!_0x585a54&&!_0x2cb020)return console[_0x491db9(0xf2)](_0x491db9(0x19b)+_0x1f7df7),console[_0x491db9(0xf2)](_0x491db9(0x14e)),_0x20eb56&&_0x496275&&console[_0x491db9(0xf2)](_0x491db9(0xcd)),0x0;return await handleSingleObjectOutput(_0x412cd2,_0x195cb5),0x0;}}function formatStageStats(_0x526204,_0x4bf282){const _0x313055=a25_0x43c82a,_0x2d0183=_0x4bf282[_0x313055(0x141)]&&_0x526204[_0x313055(0xcf)]?.[_0x313055(0x199)]?aggregateStageHistory(_0x526204[_0x313055(0xcf)]):{'size':_0x526204[_0x313055(0x136)],'entered':_0x526204['enteredSize'],'milestone':_0x526204[_0x313055(0xde)],'milestone_rate':_0x526204[_0x313055(0x106)],'exit_or_jump':_0x526204[_0x313055(0x1a5)],'exit_or_jump_rate':_0x526204[_0x313055(0xcc)]},_0x573ecf={'id':_0x526204['id'],'name':_0x4bf282['stageNameMap'][_0x313055(0x1ae)](_0x526204['id'])??_0x526204['id'],..._0x2d0183};return _0x4bf282[_0x313055(0x141)]&&_0x4bf282['includeHistory']&&_0x526204[_0x313055(0xcf)]&&(_0x573ecf['history']=_0x526204['history']),_0x573ecf;}function a25_0x133d(){const _0x3e6083=['listJourneysWithFolders','Resolved\x20YAML\x20file:\x20','Resolving\x20parent\x20segment...','session','899528MrAUtZ','Error:\x20Parent\x20segment\x20context\x20required','(completed)','β\x20Pulled\x20','error','Warning:\x20Could\x20not\x20resolve\x20segment\x20','stringify','\x22\x20paused','red','journey:view','stages','activationParams','\x20journeys','journey:columns','\x20new\x20files','replace','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','INVALID_ARGUMENT','set','Error:\x20--version\x20option\x20is\x20required','(running)','updatedAt','createVersion','journeyBundleName','completeMilestoneRate','Target\x20file:\x20','Fetching\x20users\x20and\x20connections...','launched','database','\x20\x20Statistics\x20not\x20available','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Fetching\x20','\x20journey','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','test','tdx.json','isNew','\x20(rule\x20match)','segment','utf-8','270winWCD','localeCompare','(paused)','Pausing\x20journey...','Export\x20journey(s)\x20as\x20YAML\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','type','Parent\x20segment:\x20','table','yellow','folderId','5255GJMnAh','has','setPhase','View\x20a\x20specific\x20version\x20of\x20a\x20journey','jsonl','Listing\x20journey\x20activations...','enteredSize','limit','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20\x20Consolidating\x20duplicate\x20segment:\x20','execute','goalSize','β\x20Found\x20','entries','-\x20no\x20files\x20written','json','all','resolveJourneyId','split','paused','journeys','size','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20files?','folderPath','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)','draft','reentryMode','Error:\x20Invalid\x20version\x20number:\x20','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','push','hasChanges','hasPeriod','\x20Opening\x20','base','Folder\x20path:\x20','segmentPushCommand','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','includeStats','\x20not\x20found.\x20Available:\x20','resolveSegment','data','β\x20Journey\x20\x22','repeat','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','β\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Folder\x20path:\x20','journey:versions','2730990DHVivK','getStatistics','/e/','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','getLatestJourneyId','args','archived','audienceId','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','5698568IlNAmG','find','Show\x20journey\x20details','activation','\x20Created\x20v','journeyName','List\x20activations\x20for\x20a\x20journey','\x20changed\x20files','(draft)','List\x20all\x20versions\x20of\x20a\x20journey','List\x20journeys\x20in\x20current\x20context','listActivationsFlat','log','\x22\x20resumed','\x20\x20Journey\x20ID:\x20','641174iIITZX','parent_segment','absolutePath','Error:\x20Journey\x20not\x20found:\x20','completionRate','resume','values','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','add','errorCode','\x20->\x20','cwd','Show\x20journey\x20table\x20column\x20mapping','journey:push','filePath','Error:\x20','rule','pause','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','join','\x20versions)','β\x20Context\x20set:\x20','helpText','\x20(draft)\x20β\x20\x22','journeyBundleId','conversion','Resolving\x20journey...','nodes','journeyStages','\x20unchanged\x20files','journey:pull','map','versionNumber','listJourneysFromParentSegment','kind','\x20\x20-\x20','Write\x20','Creating\x20new\x20version...','Getting\x20column\x20mapping...','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Journey\x20name:\x20','file','getActivation','Error:\x20Version\x20','buildIdToNameMap','/j/da','/j/da/je','length','getTrafficData','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','stage','Database:\x20','tsv','listFolders','Available\x20stages:\x20','listVersions','resolveParentId','relativePath','\x20\x20Preserving\x20local\x20segment\x20name:\x20','exitOrJumpSize','content','\x5c$&','Resuming\x20journey...','web','journey:version:view','site','parentSegment','Pattern:\x20','get','No\x20statistics\x20available\x20for\x20journey:\x20','...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','description','\x22\x20not\x20found','segmentName','\x20version','includeHistory','journey:version:create','getColumnMapping','Pause\x20a\x20running\x20journey','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','journey','Error:\x20Invalid\x20--type\x20\x22','Show\x20journey\x20statistics','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','state','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','getJourney','Warning:\x20Could\x20not\x20resolve\x20activation\x20','segments','1926xgCXxW','createdAt','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.',',\x20version:\x20','2313783phlFkn','Options:','Error:\x20Journey\x20\x27','attributes','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Input:\x20','filter','Getting\x20version\x20','parentName','then','sort','user','Getting\x20journey\x20details...','/app/ps/','root\x20folder','targetDir','verbose','Getting\x20journey\x20traffic\x20data...','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','.yml','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Listing\x20journeys...','from','format','(root)','exitOrJumpRate','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','message','history','Table:\x20','goal','rootFolderId','getParentFull','journey:activations','version','dim','journeyId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','options','renderStats','cyan','Error:\x20Stage\x20\x22','relative','milestoneSize','\x0aChanges\x20to\x20\x27','\x20details...','yes','1600767fGAHAh','journey:stats','green','\x27\x20not\x20found\x20in\x20','name','folders','toLowerCase','Found\x20'];a25_0x133d=function(){return _0x3e6083;};return a25_0x133d();}export class JourneyPauseCommand extends BaseCommand{[a25_0x43c82a(0xe6)]='journey:pause';[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0xa2);async[a25_0x43c82a(0x12b)](_0x1b9f5e){const _0x50823d=a25_0x43c82a,{options:_0x5748f9,args:_0x1270bc,tdx:_0x5b1137}=_0x1b9f5e,_0x41c51a=_0x1270bc[0x0];if(!requireNameOrPath(_0x41c51a))return 0x1;_0x5748f9[_0x50823d(0xc2)]&&console[_0x50823d(0xf2)]('Input:\x20'+_0x41c51a);const {journeyId:_0x17440c,journeyName:_0x52062b}=await resolveJourneyIdFromInput(_0x41c51a,_0x5748f9,_0x5b1137);if(!_0x5748f9[_0x50823d(0xe1)]){const _0x527c73=await confirm(_0x50823d(0x14d)+_0x52062b+'\x22?');if(!_0x527c73)return console[_0x50823d(0xf2)]('Cancelled'),0x0;}const _0x2c5ca7=await withSpinner(_0x50823d(0x119),()=>_0x5b1137[_0x50823d(0xa4)][_0x50823d(0x17b)](_0x17440c),{'verbose':_0x5748f9[_0x50823d(0xc2)]}),_0x1d7082=_0x2c5ca7[_0x50823d(0x14a)];return console[_0x50823d(0xf2)](_0x50823d(0x14b)+_0x1d7082[_0x50823d(0xb5)][_0x50823d(0xe6)]+_0x50823d(0xf5)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a25_0x43c82a(0xe6)]='journey:resume';[a25_0x43c82a(0x1b2)]='Resume\x20a\x20paused\x20journey';async[a25_0x43c82a(0x12b)](_0x3baf5e){const _0x157c3c=a25_0x43c82a,{options:_0x4a4e92,args:_0x18ce94,tdx:_0x673902}=_0x3baf5e,_0x3f1354=_0x18ce94[0x0];if(!requireNameOrPath(_0x3f1354))return 0x1;_0x4a4e92[_0x157c3c(0xc2)]&&console[_0x157c3c(0xf2)](_0x157c3c(0xb7)+_0x3f1354);const {journeyId:_0x289cc1,journeyName:_0x20d4b2}=await resolveJourneyIdFromInput(_0x3f1354,_0x4a4e92,_0x673902);if(!_0x4a4e92['yes']){const _0x1f61d6=await confirm(_0x157c3c(0xb6)+_0x20d4b2+'\x22?');if(!_0x1f61d6)return console[_0x157c3c(0xf2)]('Cancelled'),0x0;}const _0x3ec06d=await withSpinner(_0x157c3c(0x1a8),()=>_0x673902['journey'][_0x157c3c(0x16f)](_0x289cc1),{'verbose':_0x4a4e92[_0x157c3c(0xc2)]}),_0x54ed8b=_0x3ec06d[_0x157c3c(0x14a)];return console['error']('β\x20Journey\x20\x22'+_0x54ed8b['attributes'][_0x157c3c(0xe6)]+_0x157c3c(0x168)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a25_0x43c82a(0xe6)]=a25_0x43c82a(0x188);['description']=a25_0x43c82a(0x11a);async[a25_0x43c82a(0x12b)](_0x2c5648){const _0x5b05d3=a25_0x43c82a,{options:_0x5f2aba,args:_0x57d53a,tdx:_0xcc99f9}=_0x2c5648,_0x276cfa=_0x5f2aba,_0x2bb814=_0x57d53a[0x0],_0x2cb79c=_0x2bb814&&isYamlFilePath(_0x2bb814),_0x58c849=await resolveTarget({'arg':_0x2cb79c?_0x2bb814:undefined,'contextParent':_0x5f2aba[_0x5b05d3(0x1ac)],'cwd':process[_0x5b05d3(0x175)]()});if(!isSuccessfulResolution(_0x58c849))return _0x58c849[_0x5b05d3(0x173)]==='no_parent'?(console[_0x5b05d3(0xf2)](a25_0x4c1e02['yellow'](_0x5b05d3(0xd8))),console['error'](_0x5b05d3(0x13a)),console[_0x5b05d3(0xf2)](_0x5b05d3(0xaa)),console[_0x5b05d3(0xf2)](_0x5b05d3(0x11b)),console[_0x5b05d3(0xf2)](_0x5b05d3(0x155))):(console[_0x5b05d3(0xf2)](a25_0x4c1e02[_0x5b05d3(0xf6)](_0x5b05d3(0x179)+_0x58c849[_0x5b05d3(0xce)]+'\x0a')),_0x58c849[_0x5b05d3(0x180)]&&console[_0x5b05d3(0xf2)](a25_0x4c1e02[_0x5b05d3(0xdb)](_0x58c849[_0x5b05d3(0x180)]))),0x1;let _0x1b249e=_0x2cb79c?undefined:_0x2bb814,_0x250a3f,_0x4db72d;_0x58c849[_0x5b05d3(0x11c)]==='file'&&(_0x1b249e=_0x58c849['resourceName'],_0x250a3f=_0x58c849[_0x5b05d3(0x178)],_0x4db72d=_0x58c849['folderPath']);const _0x3ef72c=_0x58c849[_0x5b05d3(0xba)],_0x2cede5=_0x58c849[_0x5b05d3(0xc1)];_0x276cfa['verbose']&&(console['error'](_0x5b05d3(0x11d)+_0x3ef72c),console[_0x5b05d3(0xf2)]('Target\x20directory:\x20'+_0x2cede5),_0x1b249e&&console[_0x5b05d3(0xf2)](_0x5b05d3(0x192)+_0x1b249e),_0x250a3f&&console[_0x5b05d3(0xf2)](_0x5b05d3(0x107)+_0x250a3f),_0x4db72d&&console[_0x5b05d3(0xf2)](_0x5b05d3(0x144)+_0x4db72d));const _0x21e10f=await withSpinner(_0x5b05d3(0xec),()=>_0xcc99f9[_0x5b05d3(0x114)][_0x5b05d3(0x1a2)](_0x3ef72c),{'verbose':_0x5f2aba[_0x5b05d3(0xc2)]}),_0x2bf55c=_0x21e10f['data'],{journeys:_0x1dbeaf,folders:_0x5eeddb}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x43bf73=_0x5b05d3,[_0x3496ff,_0x44e506]=await Promise[_0x43bf73(0x131)]([_0xcc99f9[_0x43bf73(0xa4)][_0x43bf73(0x18b)](_0x2bf55c,undefined,{'includeAllVersions':!![]}),_0xcc99f9[_0x43bf73(0x114)][_0x43bf73(0x19f)](_0x2bf55c)]);return{'journeys':_0x3496ff,'folders':_0x44e506};},{'verbose':_0x5f2aba[_0x5b05d3(0xc2)]})['then'](_0x5b516f=>_0x5b516f[_0x5b05d3(0x14a)]);let _0x47ceaf=_0x1dbeaf;const _0x5f079f=buildFolderIdToPathMap(_0x5eeddb);if(_0x1b249e){const _0x41fd8e=_0x47ceaf[_0x5b05d3(0xb8)](_0x486325=>_0x486325['journeyBundleName'][_0x5b05d3(0xe8)]()===_0x1b249e[_0x5b05d3(0xe8)]());if(_0x41fd8e['length']===0x0)return console[_0x5b05d3(0xf2)](_0x5b05d3(0x16d)+_0x1b249e),console[_0x5b05d3(0xf2)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x47ceaf=_0x41fd8e;}if(_0x4db72d!==undefined){const _0x1de7c4=_0x47ceaf['filter'](_0x1cab24=>{const _0x2bb56c=_0x5b05d3,_0x40c2a0=_0x1cab24[_0x2bb56c(0x120)]?_0x5f079f[_0x2bb56c(0x1ae)](_0x1cab24[_0x2bb56c(0x120)])||'':'';return _0x40c2a0===_0x4db72d;});if(_0x1de7c4['length']===0x0&&_0x47ceaf[_0x5b05d3(0x199)]>0x0){console['error'](_0x5b05d3(0xb4)+_0x1b249e+_0x5b05d3(0xe5)+(_0x4db72d||_0x5b05d3(0xc0))),console[_0x5b05d3(0xf2)](_0x5b05d3(0x10f));for(const _0x432059 of _0x47ceaf){const _0x3e4c23=_0x432059[_0x5b05d3(0x120)]?_0x5f079f['get'](_0x432059[_0x5b05d3(0x120)])||'':'';console[_0x5b05d3(0xf2)](_0x5b05d3(0x18d)+(_0x3e4c23||_0x5b05d3(0xcb))+'/'+_0x432059[_0x5b05d3(0x105)]);}return 0x1;}_0x47ceaf=_0x1de7c4;}if(_0x47ceaf[_0x5b05d3(0x199)]===0x0)return console[_0x5b05d3(0xf2)]('No\x20journeys\x20found'),0x0;const _0xbc9e2a=new Map();for(const _0x251ef1 of _0x47ceaf){const _0x3e5329=_0x251ef1[_0x5b05d3(0x182)];!_0xbc9e2a['has'](_0x3e5329)&&_0xbc9e2a[_0x5b05d3(0x100)](_0x3e5329,[]),_0xbc9e2a[_0x5b05d3(0x1ae)](_0x3e5329)[_0x5b05d3(0x13f)](_0x251ef1);}for(const _0x1dcb8d of _0xbc9e2a['values']()){_0x1dcb8d[_0x5b05d3(0xbc)]((_0x4776a4,_0x445326)=>(_0x4776a4['versionNumber']||0x0)-(_0x445326[_0x5b05d3(0x18a)]||0x0));}const _0x3041a1=[],{idToEmailMap:_0x163636,connectionIdToNameMap:_0x4206b3}=await withSpinner(_0x5b05d3(0x108),async()=>{const _0x1cf800=_0x5b05d3,[_0x18d562,_0x147a19]=await Promise[_0x1cf800(0x131)]([_0xcc99f9[_0x1cf800(0xbd)]['buildIdToEmailMap'](),_0xcc99f9['connection'][_0x1cf800(0x196)]()]);return{'idToEmailMap':_0x18d562,'connectionIdToNameMap':_0x147a19};},{'verbose':_0x5f2aba[_0x5b05d3(0xc2)]})[_0x5b05d3(0xbb)](_0x4dd5b2=>_0x4dd5b2[_0x5b05d3(0x14a)]);for(const _0x548ab0 of _0xbc9e2a[_0x5b05d3(0x170)]()){const _0x1ded99=_0x548ab0[0x0][_0x5b05d3(0x105)],_0x201ccb=_0x548ab0[0x0]['folderId'],_0x352f2e=_0x201ccb?_0x5f079f[_0x5b05d3(0x1ae)](_0x201ccb)||'':'',_0x2a532f=_0x352f2e?a25_0x178c23['join'](_0x2cede5,_0x352f2e):_0x2cede5,_0x193170=_0x250a3f||a25_0x178c23[_0x5b05d3(0x17d)](_0x2a532f,sanitizeFileName(_0x1ded99)+_0x5b05d3(0xc6));let _0x549d70,_0x1ce0e5;if(existsSync(_0x193170))try{const _0x41f8b6=readFileSync(_0x193170,'utf-8'),_0x431a2e=parseYamlString(_0x41f8b6);_0x1ce0e5=_0x431a2e,_0x549d70=buildRuleToNameMapping(_0x431a2e),_0x276cfa[_0x5b05d3(0xc2)]&&_0x549d70[_0x5b05d3(0x136)]>0x0&&console['error'](_0x5b05d3(0xe9)+_0x549d70[_0x5b05d3(0x136)]+_0x5b05d3(0x15a)+_0x1ded99);}catch(_0x3fbe01){_0x276cfa[_0x5b05d3(0xc2)]&&console[_0x5b05d3(0xf2)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x3fbe01[_0x5b05d3(0xce)]);}const _0x475393=[],_0x5074f9=new Set(),_0x492280=new Map(),_0xf309f9=new Map(),_0x33bb42=new Set(),_0x5e7665=new Map(),_0x298403=new Map(),_0xf75db7=createJumpTargetCache();await withProgressSpinner(_0x5b05d3(0x10d)+_0x1ded99+_0x5b05d3(0x1b0),async _0x52b99a=>{const _0x4a11bc=_0x5b05d3;for(const _0x2c0327 of _0x548ab0){const _0x13c25a=_0x548ab0[_0x4a11bc(0x199)]>0x1?_0x2c0327['journeyBundleName']+'\x20v'+(_0x2c0327[_0x4a11bc(0x18a)]||0x1):_0x2c0327[_0x4a11bc(0x105)];_0x52b99a[_0x4a11bc(0x123)]('Fetching\x20'+_0x13c25a);const _0x555883=await _0xcc99f9[_0x4a11bc(0xa4)]['getJourney'](_0x2c0327['id']),_0x55a60b=_0x555883[_0x4a11bc(0xb5)]?.[_0x4a11bc(0x159)],_0x14d7f6={'resolveSegment':async _0x15af98=>{const _0x58a05a=_0x4a11bc;if(!_0x55a60b)return{'name':_0x15af98,'isJourneyLocal':![]};const _0x21a514=_0x492280[_0x58a05a(0x1ae)](_0x15af98);if(_0x21a514)return _0x21a514;try{const _0x44212a=await _0xcc99f9['segment']['getSegment'](_0x55a60b,_0x15af98),_0x54f7ad=_0x44212a[_0x58a05a(0x18c)]===SEGMENT_KIND_JOURNEY;let _0x4997a7,_0x29d663=_0x44212a[_0x58a05a(0xe6)];if(_0x54f7ad&&_0x44212a[_0x58a05a(0x17a)]){const _0x287ce2=await segmentResponseToDef(_0x44212a,{'resolveSegmentName':async _0x1727c3=>{const _0x21349c=_0x58a05a,_0x4242d6=_0x492280[_0x21349c(0x1ae)](_0x1727c3);if(_0x4242d6)return _0x4242d6['name'];const _0x219387=await _0x14d7f6[_0x21349c(0x149)](_0x1727c3);return _0x219387[_0x21349c(0xe6)];}}),_0x559399=_0x287ce2[_0x58a05a(0x17a)];_0x4997a7={'description':_0x44212a[_0x58a05a(0x1b2)],'rule':_0x559399};const _0x49bd7d=serializeRule(_0x559399),_0x58757b=_0xf309f9['get'](_0x49bd7d);if(_0x58757b)_0x29d663=_0x58757b,_0x4997a7=undefined,_0x276cfa['verbose']&&console['error'](_0x58a05a(0x12a)+_0x44212a[_0x58a05a(0xe6)]+_0x58a05a(0x174)+_0x58757b);else{let _0x3f9931=![];if(_0x549d70){const _0x400b23=_0x549d70[_0x58a05a(0x1ae)](_0x49bd7d);if(_0x400b23){const _0x243458=_0x400b23[_0x58a05a(0x15c)](_0xa06d56=>!_0x5074f9[_0x58a05a(0x122)](_0xa06d56));_0x243458&&(_0x29d663=_0x243458,_0x5074f9[_0x58a05a(0x172)](_0x243458),_0xf309f9['set'](_0x49bd7d,_0x243458),_0x3f9931=!![],_0x276cfa['verbose']&&console[_0x58a05a(0xf2)](_0x58a05a(0x1a4)+_0x243458+_0x58a05a(0x113)));}}if(!_0x3f9931){const _0x122671=generateJourneyLocalName(_0x44212a[_0x58a05a(0xe6)]);_0x122671&&(_0x29d663=_0x122671);let _0x1935d2=_0x29d663,_0x214d3a=0x2;while(_0x5074f9[_0x58a05a(0x122)](_0x1935d2)){_0x1935d2=_0x29d663+'_'+_0x214d3a,_0x214d3a++;}_0x5074f9[_0x58a05a(0x172)](_0x1935d2),_0xf309f9['set'](_0x49bd7d,_0x1935d2),_0x29d663=_0x1935d2;}}}const _0x16af5e={'name':_0x29d663,'isJourneyLocal':_0x54f7ad,'definition':_0x4997a7};return _0x492280[_0x58a05a(0x100)](_0x15af98,_0x16af5e),_0x16af5e;}catch(_0x27af2d){return _0x5f2aba[_0x58a05a(0xc2)]&&console[_0x58a05a(0xf2)](_0x58a05a(0xf3)+_0x15af98+':\x20'+_0x27af2d['message']),{'name':_0x15af98,'isJourneyLocal':![]};}},'resolveActivation':async _0x2e5382=>{const _0x175ae0=_0x4a11bc,_0x1b24d8=_0x5e7665[_0x175ae0(0x1ae)](_0x2e5382);if(_0x1b24d8)return _0x1b24d8;try{const _0x2e59a6=await _0xcc99f9['journey'][_0x175ae0(0x194)](_0x2c0327['id'],_0x2e5382),_0x238035=journeyActivationStepToYaml(_0x2e59a6,_0x163636,_0x4206b3),_0x229e27=JSON[_0x175ae0(0xf4)]({'name':_0x238035[_0x175ae0(0xe6)],'connection':_0x238035['connection'],'connector_config':_0x238035['connector_config']}),_0x719a2f=_0x298403['get'](_0x229e27);if(_0x719a2f){const _0x21c40b={'name':_0x719a2f,'isJourneyLocal':!![],'definition':_0x238035};return _0x5e7665[_0x175ae0(0x100)](_0x2e5382,_0x21c40b),_0x21c40b;}const _0xd72788=_0x2e59a6['attributes'][_0x175ae0(0xf9)][_0x175ae0(0xe6)]||_0x2e5382,_0x88e1a=sanitizeYamlKey(_0xd72788)||'activation_'+_0x2e5382;let _0x2af421=_0x88e1a,_0x29e862=0x2;while(_0x33bb42['has'](_0x2af421)){_0x2af421=_0x88e1a+'_'+_0x29e862,_0x29e862++;}_0x33bb42[_0x175ae0(0x172)](_0x2af421),_0x298403[_0x175ae0(0x100)](_0x229e27,_0x2af421);const _0x581efb={'name':_0x2af421,'isJourneyLocal':!![],'definition':_0x238035};return _0x5e7665[_0x175ae0(0x100)](_0x2e5382,_0x581efb),_0x581efb;}catch(_0x33f262){return _0x5f2aba['verbose']&&console['error'](_0x175ae0(0xac)+_0x2e5382+':\x20'+_0x33f262[_0x175ae0(0xce)]),{'name':_0x2e5382,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x129f27,_0x269126)=>{const _0x5a7603=_0x4a11bc;return resolveJumpTarget(_0x129f27,_0x269126,_0xf75db7,_0xbfe5a2=>_0xcc99f9[_0x5a7603(0xa4)][_0x5a7603(0xab)](_0xbfe5a2));}},_0x2e830e=await journeyResponseToDef(_0x555883,_0x14d7f6);_0x475393['push']({'item':_0x2c0327,'yaml':_0x2e830e});}},{'verbose':_0x5f2aba[_0x5b05d3(0xc2)]});const _0xce5986=await _0xcc99f9['journey'][_0x5b05d3(0x156)](_0x548ab0[0x0]['journeyBundleId']),_0xd8d70a=buildMergedJourneyDef(_0x475393,_0x549d70,_0xce5986),_0x59042f=normalizeJourneyDef(_0xd8d70a,_0x1ce0e5),_0x3f5fe5=toYamlString(_0x59042f),_0x3c675a=_0x250a3f||a25_0x178c23['join'](_0x2a532f,sanitizeFileName(_0x1ded99)+_0x5b05d3(0xc6));!_0x250a3f&&_0x352f2e&&!existsSync(_0x2a532f)&&mkdirSync(_0x2a532f,{'recursive':!![]});const _0x566ef7=a25_0x178c23[_0x5b05d3(0xdd)](process[_0x5b05d3(0x175)](),_0x3c675a);if(existsSync(_0x3c675a)){const _0x4073df=readFileSync(_0x3c675a,_0x5b05d3(0x115)),_0x1c5025=generateDiff(_0x4073df,_0x3f5fe5),_0x1d89bc=hasChanges(_0x1c5025);_0x3041a1[_0x5b05d3(0x13f)]({'relativePath':_0x566ef7,'absolutePath':_0x3c675a,'content':_0x3f5fe5,'isNew':![],'hasChanges':_0x1d89bc,'diff':_0x1d89bc?formatDiffWithColors(_0x1c5025):undefined});}else _0x3041a1[_0x5b05d3(0x13f)]({'relativePath':_0x566ef7,'absolutePath':_0x3c675a,'content':_0x3f5fe5,'isNew':!![],'hasChanges':![]});}const _0x15be45=_0x3041a1[_0x5b05d3(0xb8)](_0x5e6cc5=>_0x5e6cc5[_0x5b05d3(0x112)]),_0x395198=_0x3041a1[_0x5b05d3(0xb8)](_0xa001db=>!_0xa001db[_0x5b05d3(0x112)]&&_0xa001db[_0x5b05d3(0x140)]),_0x1819bf=_0x3041a1[_0x5b05d3(0xb8)](_0x3def06=>!_0x3def06['isNew']&&!_0x3def06[_0x5b05d3(0x140)]),_0x112ec0=_0x47ceaf[_0x5b05d3(0x199)],_0x48003a=_0xbc9e2a[_0x5b05d3(0x136)],_0x439147=_0x112ec0>_0x48003a?'\x20('+_0x112ec0+_0x5b05d3(0x17e):'';console[_0x5b05d3(0xf2)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a25_0x4c1e02['cyan'](_0x48003a+_0x5b05d3(0xfa))+a25_0x4c1e02['dim'](_0x439147)),console['error']('\x20\x20'+a25_0x4c1e02[_0x5b05d3(0xe4)]('+\x20'+_0x15be45[_0x5b05d3(0x199)]+_0x5b05d3(0xfc))),console['error']('\x20\x20'+a25_0x4c1e02[_0x5b05d3(0x11f)]('~\x20'+_0x395198[_0x5b05d3(0x199)]+_0x5b05d3(0x162))),console['error']('\x20\x20'+a25_0x4c1e02['dim']('=\x20'+_0x1819bf['length']+_0x5b05d3(0x187))),console['error']('\x20\x20Target:\x20'+a25_0x4c1e02[_0x5b05d3(0xdb)](_0x2cede5)+'\x0a');if(_0x395198[_0x5b05d3(0x199)]>0x0)for(const _0x241d64 of _0x395198){console[_0x5b05d3(0xf2)](_0x5b05d3(0xdf)+_0x241d64[_0x5b05d3(0x1a3)]+'\x27:'),console[_0x5b05d3(0xf2)]('β'[_0x5b05d3(0x14c)](0x3c)),console['error'](_0x241d64[_0x5b05d3(0xc4)]),console['error']('β'[_0x5b05d3(0x14c)](0x3c));}if(_0x276cfa['dryRun'])return console[_0x5b05d3(0xf2)](a25_0x4c1e02[_0x5b05d3(0x11f)](_0x5b05d3(0x1b1))),0x0;if(_0x15be45[_0x5b05d3(0x199)]===0x0&&_0x395198['length']===0x0)return console[_0x5b05d3(0xf2)](a25_0x4c1e02['green'](_0x5b05d3(0x14f))),saveSessionContext({'parent_segment':_0x3ef72c},_0x276cfa['session']),console[_0x5b05d3(0xf2)](a25_0x4c1e02[_0x5b05d3(0xe4)](_0x5b05d3(0x17f)+a25_0x4c1e02[_0x5b05d3(0xd6)](_0x5b05d3(0x16b))+'\x20=\x20'+a25_0x4c1e02[_0x5b05d3(0xdb)](_0x3ef72c))),0x0;if(!_0x276cfa[_0x5b05d3(0xe1)]&&(_0x15be45['length']>0x0||_0x395198[_0x5b05d3(0x199)]>0x0)){if(!isInteractive())return console[_0x5b05d3(0xf2)](a25_0x4c1e02[_0x5b05d3(0xf6)]('\x0aError:'),_0x5b05d3(0xc5)),console['error'](a25_0x4c1e02[_0x5b05d3(0xd6)](_0x5b05d3(0x146))),0x1;const _0x2606c3=await confirmKey(_0x5b05d3(0x18e)+(_0x15be45[_0x5b05d3(0x199)]+_0x395198['length'])+_0x5b05d3(0x138));if(!_0x2606c3)return console['error'](a25_0x4c1e02[_0x5b05d3(0x11f)]('Aborted.'),_0x5b05d3(0x12f)),0x1;}!existsSync(_0x2cede5)&&mkdirSync(_0x2cede5,{'recursive':!![]});const _0x2cf98c=a25_0x178c23[_0x5b05d3(0x17d)](_0x2cede5,_0x5b05d3(0x111));writeFileSync(_0x2cf98c,createTdxConfigContent(_0x3ef72c),_0x5b05d3(0x115));for(const _0x3d432c of _0x3041a1){(_0x3d432c['isNew']||_0x3d432c[_0x5b05d3(0x140)])&&writeFileSync(_0x3d432c[_0x5b05d3(0x16c)],_0x3d432c[_0x5b05d3(0x1a6)],_0x5b05d3(0x115));}return console[_0x5b05d3(0xf2)](a25_0x4c1e02['green'](_0x5b05d3(0xf1)+(_0x15be45[_0x5b05d3(0x199)]+_0x395198['length'])+'\x20journey\x20files\x20to\x20'+_0x2cede5)),saveSessionContext({'parent_segment':_0x3ef72c},_0x276cfa[_0x5b05d3(0xed)]),console[_0x5b05d3(0xf2)](a25_0x4c1e02[_0x5b05d3(0xe4)](_0x5b05d3(0x17f)+a25_0x4c1e02[_0x5b05d3(0xd6)](_0x5b05d3(0x16b))+'\x20=\x20'+a25_0x4c1e02[_0x5b05d3(0xdb)](_0x3ef72c))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a25_0x43c82a(0xfb);[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0x176);async[a25_0x43c82a(0x12b)](_0x29c167){const _0x5be037=a25_0x43c82a,{options:_0x55db0f,args:_0x3a78a1,tdx:_0x2cc29f}=_0x29c167,_0x5d2c77=_0x3a78a1[0x0];if(!requireNameOrPath(_0x5d2c77))return 0x1;_0x55db0f[_0x5be037(0xc2)]&&console[_0x5be037(0xf2)](_0x5be037(0xb7)+_0x5d2c77);const {journeyId:_0x2e82db}=await resolveJourneyIdFromInput(_0x5d2c77,_0x55db0f,_0x2cc29f),_0x2c7c06=await withSpinner(_0x5be037(0x190),()=>_0x2cc29f[_0x5be037(0xa4)][_0x5be037(0xa1)](_0x2e82db),{'verbose':_0x55db0f[_0x5be037(0xc2)]}),_0x4eff45=_0x2c7c06[_0x5be037(0x14a)];return console[_0x5be037(0x167)](_0x5be037(0x19d)+_0x4eff45[_0x5be037(0x10a)]),console[_0x5be037(0x167)](_0x5be037(0xd0)+_0x4eff45['table']),await handleSDKOutput(_0x4eff45['columns'],_0x55db0f),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a25_0x43c82a(0xe6)]=a25_0x43c82a(0xd4);[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0x161);async['execute'](_0x161735){const _0x1ff5c5=a25_0x43c82a,{options:_0x6897f5,args:_0x5beec0,tdx:_0xbf1360}=_0x161735,_0x516db5=_0x5beec0[0x0];if(!requireNameOrPath(_0x516db5))return 0x1;_0x6897f5[_0x1ff5c5(0xc2)]&&console[_0x1ff5c5(0xf2)](_0x1ff5c5(0xb7)+_0x516db5);const {journeyId:_0x469c4d}=await resolveJourneyIdFromInput(_0x516db5,_0x6897f5,_0xbf1360),_0x5108ef=await withSpinner(_0x1ff5c5(0x126),()=>_0xbf1360['journey'][_0x1ff5c5(0x166)](_0x469c4d),{'verbose':_0x6897f5[_0x1ff5c5(0xc2)]}),_0x19a098=_0x5108ef[_0x1ff5c5(0x14a)];return console[_0x1ff5c5(0xf2)]('Found\x20'+_0x19a098['length']+'\x20activation'+(_0x19a098[_0x1ff5c5(0x199)]!==0x1?'s':'')),await handleSDKOutput(_0x19a098,_0x6897f5),0x0;}}export class JourneyPushCommand extends BaseCommand{[a25_0x43c82a(0xe6)]=a25_0x43c82a(0x177);[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0x13e);[a25_0x43c82a(0x145)]=new SegmentPushCommand();async[a25_0x43c82a(0x12b)](_0x5b7a78){const _0xe75a13=a25_0x43c82a,_0x4f4531=_0x5b7a78[_0xe75a13(0x157)][0x0];let _0x3acb2e;if(_0x4f4531){const _0x14ed46=await resolveTarget({'arg':_0x4f4531,'contextParent':_0x5b7a78[_0xe75a13(0xd9)][_0xe75a13(0x1ac)],'cwd':process[_0xe75a13(0x175)]()});isSuccessfulResolution(_0x14ed46)&&_0x14ed46[_0xe75a13(0x11c)]===_0xe75a13(0x193)&&(_0x3acb2e=_0x14ed46[_0xe75a13(0x178)]);}const _0xf15ef2={..._0x5b7a78,'options':{..._0x5b7a78[_0xe75a13(0xd9)],'journeysOnly':!![],..._0x3acb2e&&{'singleFilePath':_0x3acb2e}}};return this[_0xe75a13(0x145)][_0xe75a13(0x12b)](_0xf15ef2);}}export class JourneyVersionsCommand extends BaseCommand{[a25_0x43c82a(0xe6)]=a25_0x43c82a(0x151);[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0x164);async['execute'](_0x498bca){const _0x2f41d1=a25_0x43c82a,{options:_0x4dd623,args:_0xe09d37,tdx:_0x2d80b8}=_0x498bca,_0x5812a1=_0xe09d37[0x0];if(!requireNameOrPath(_0x5812a1))return 0x1;if(_0x4dd623[_0x2f41d1(0xc2)])console[_0x2f41d1(0xf2)](_0x2f41d1(0xb7)+_0x5812a1);const {journeyId:_0x3956c8}=await resolveJourneyIdFromInput(_0x5812a1,_0x4dd623,_0x2d80b8),_0x2ac12b=await withSpinner('Listing\x20journey\x20versions...',()=>_0x2d80b8[_0x2f41d1(0xa4)][_0x2f41d1(0x1a1)](_0x3956c8),{'verbose':_0x4dd623[_0x2f41d1(0xc2)]}),{bundleName:_0x531e51,versions:_0x91296f,latestJourneyId:_0x34d37d}=_0x2ac12b[_0x2f41d1(0x14a)];console[_0x2f41d1(0xf2)](_0x531e51+':\x20'+_0x91296f['length']+_0x2f41d1(0x9e)+(_0x91296f[_0x2f41d1(0x199)]!==0x1?'s':''));const _0x4f01e2=_0x91296f['map'](_0x392f8c=>({'version':_0x392f8c[_0x2f41d1(0x18a)],'journey_id':_0x392f8c[_0x2f41d1(0xd7)],'name':_0x392f8c[_0x2f41d1(0xe6)],'state':_0x392f8c[_0x2f41d1(0xa8)],'paused':_0x392f8c['paused'],'latest':_0x392f8c[_0x2f41d1(0xd7)]===_0x34d37d,'created_at':_0x392f8c[_0x2f41d1(0xaf)]}));return await handleSDKOutput(_0x4f01e2,_0x4dd623),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a25_0x43c82a(0xe6)]=a25_0x43c82a(0xa0);['description']=a25_0x43c82a(0xfe);async['execute'](_0x4f5bad){const _0x21174f=a25_0x43c82a,{options:_0x2f7b85,args:_0x5b8d40,tdx:_0x358e56}=_0x4f5bad,_0x406215=_0x5b8d40[0x0];if(!requireNameOrPath(_0x406215))return 0x1;if(_0x2f7b85[_0x21174f(0xc2)])console[_0x21174f(0xf2)](_0x21174f(0xb7)+_0x406215);const {journeyId:_0x37704d,journeyName:_0xe92fec}=await resolveJourneyIdFromInput(_0x406215,_0x2f7b85,_0x358e56);if(!_0x2f7b85[_0x21174f(0xe1)]){const _0x107c86=await confirm(_0x21174f(0xa7)+_0xe92fec+'\x22?');if(!_0x107c86)return console[_0x21174f(0xf2)]('Cancelled'),0x0;}const _0x2a82e9=await withSpinner(_0x21174f(0x18f),()=>_0x358e56[_0x21174f(0xa4)][_0x21174f(0x104)](_0x37704d),{'verbose':_0x2f7b85[_0x21174f(0xc2)]}),_0x2cacfc=_0x2a82e9[_0x21174f(0x14a)];return console[_0x21174f(0xf2)](a25_0x4c1e02[_0x21174f(0xe4)]('β')+_0x21174f(0x15f)+_0x2cacfc['attributes'][_0x21174f(0x18a)]+_0x21174f(0x181)+_0x2cacfc['attributes']['name']+'\x22'),console[_0x21174f(0xf2)](_0x21174f(0x169)+_0x2cacfc['id']),await handleSingleObjectOutput({'id':_0x2cacfc['id'],'name':_0x2cacfc[_0x21174f(0xb5)][_0x21174f(0xe6)],'version':_0x2cacfc[_0x21174f(0xb5)]['versionNumber'],'state':_0x2cacfc[_0x21174f(0xb5)][_0x21174f(0xa8)],'bundle_id':_0x2cacfc[_0x21174f(0xb5)][_0x21174f(0x182)],'created_at':_0x2cacfc[_0x21174f(0xb5)]['createdAt']},_0x2f7b85),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a25_0x43c82a(0x1aa);[a25_0x43c82a(0x1b2)]=a25_0x43c82a(0x124);async[a25_0x43c82a(0x12b)](_0x37d141){const _0x1f624f=a25_0x43c82a,{options:_0xafe954,args:_0x4c9ef2,tdx:_0x2b652b}=_0x37d141,_0x4f092c=_0x4c9ef2[0x0];if(!requireNameOrPath(_0x4f092c))return 0x1;const _0xb5a706=_0xafe954[_0x1f624f(0xd5)];if(!_0xb5a706)return console[_0x1f624f(0xf2)](_0x1f624f(0x101)),console[_0x1f624f(0xf2)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x3ff57f=parseInt(_0xb5a706,0xa);if(isNaN(_0x3ff57f)||_0x3ff57f<0x1)return console[_0x1f624f(0xf2)](_0x1f624f(0x13d)+_0xb5a706),0x1;if(_0xafe954[_0x1f624f(0xc2)])console[_0x1f624f(0xf2)]('Input:\x20'+_0x4f092c+_0x1f624f(0xb1)+_0x3ff57f);const {journeyId:_0x48df02,parentSegmentId:_0x5ef5c9}=await resolveJourneyIdFromInput(_0x4f092c,_0xafe954,_0x2b652b),_0x42b693=await withSpinner('Resolving\x20version...',()=>_0x2b652b[_0x1f624f(0xa4)][_0x1f624f(0x1a1)](_0x48df02),{'verbose':_0xafe954[_0x1f624f(0xc2)]}),{versions:_0x115824,latestJourneyId:_0x2c5fbb}=_0x42b693[_0x1f624f(0x14a)],_0x28b9b4=_0x115824[_0x1f624f(0x15c)](_0x19af8e=>_0x19af8e[_0x1f624f(0x18a)]===_0x3ff57f);if(!_0x28b9b4){const _0x4699e2=_0x115824['map'](_0x1bf66e=>'v'+_0x1bf66e[_0x1f624f(0x18a)])[_0x1f624f(0x17d)](',\x20');return console[_0x1f624f(0xf2)](_0x1f624f(0x195)+_0x3ff57f+_0x1f624f(0x148)+_0x4699e2),0x1;}const _0x20f81c=await withSpinner(_0x1f624f(0xb9)+_0x3ff57f+_0x1f624f(0xe0),()=>_0x2b652b[_0x1f624f(0xa4)][_0x1f624f(0xab)](_0x28b9b4[_0x1f624f(0xd7)]),{'verbose':_0xafe954[_0x1f624f(0xc2)]}),_0x452d8f=_0x20f81c[_0x1f624f(0x14a)],_0x4966e7=getConsoleNextUrl(_0xafe954['site'],_0x1f624f(0xbf)+_0x5ef5c9+'/e/'+_0x28b9b4[_0x1f624f(0xd7)]+_0x1f624f(0x198));return await handleSingleObjectOutput({'id':_0x452d8f['id'],'name':_0x452d8f[_0x1f624f(0xb5)][_0x1f624f(0xe6)],'version':_0x452d8f[_0x1f624f(0xb5)][_0x1f624f(0x18a)],'description':_0x452d8f[_0x1f624f(0xb5)][_0x1f624f(0x1b2)],'state':_0x452d8f['attributes']['state'],'paused':_0x452d8f[_0x1f624f(0xb5)][_0x1f624f(0x134)],'reentry_mode':_0x452d8f[_0x1f624f(0xb5)][_0x1f624f(0x13c)],'stages':_0x452d8f['attributes'][_0x1f624f(0x186)]?.[_0x1f624f(0x199)]||0x0,..._0x452d8f[_0x1f624f(0xb5)][_0x1f624f(0xd1)]&&{'goal':_0x452d8f[_0x1f624f(0xb5)][_0x1f624f(0xd1)][_0x1f624f(0xe6)]},'latest':_0x28b9b4[_0x1f624f(0xd7)]===_0x2c5fbb,'created_at':_0x452d8f[_0x1f624f(0xb5)]['createdAt'],'updated_at':_0x452d8f[_0x1f624f(0xb5)][_0x1f624f(0x103)],'url':_0x4966e7},_0xafe954),0x0;}}
|