@treasuredata/tdx 2026.3.54 → 2026.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +27 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.d.ts +10 -0
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +61 -3
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/agent/types/agent-def.d.ts +43 -0
- package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +73 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts +28 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.d.ts.map +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/file-discovery.js.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +2 -2
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +158 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workflow.d.ts +26 -0
- package/dist/sdk/types/workflow.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +22 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x52b15e=a23_0x4c14;(function(_0x358319,_0x25efc8){const _0x30b827=a23_0x4c14,_0x3c10fe=_0x358319();while(!![]){try{const _0x1fed9b=-parseInt(_0x30b827(0x11b))/0x1+-parseInt(_0x30b827(0x12b))/0x2*(-parseInt(_0x30b827(0x124))/0x3)+-parseInt(_0x30b827(0x123))/0x4+parseInt(_0x30b827(0x11a))/0x5*(parseInt(_0x30b827(0x11e))/0x6)+-parseInt(_0x30b827(0x13d))/0x7+-parseInt(_0x30b827(0x135))/0x8*(parseInt(_0x30b827(0x13c))/0x9)+parseInt(_0x30b827(0x140))/0xa;if(_0x1fed9b===_0x25efc8)break;else _0x3c10fe['push'](_0x3c10fe['shift']());}catch(_0x20978b){_0x3c10fe['push'](_0x3c10fe['shift']());}}}(a23_0x4aae,0xb8aee));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 a23_0x763d12 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a23_0x4c14(_0x1702a5,_0x2a6f98){_0x1702a5=_0x1702a5-0x11a;const _0x4aae28=a23_0x4aae();let _0x4c1480=_0x4aae28[_0x1702a5];return _0x4c1480;}function a23_0x4aae(){const _0x3e20b8=['dirname','\x20files\x20to\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','9562473lqgKUm','3819949DczUHH','filter','absolutePath','21260890nomtIY','cwd','isNew','engage:template:pull','config','workspaceName','Workspace\x20is\x20required.','name','repeat','utf-8','files','error','description','hasChanges','\x20changed\x20files','yes','engage_workspace','yellow','targetDir','dim','session','cyan','red','\x20unchanged\x20files','dryRun','content','1513375HKjLEp','1469965IkNNys','engage','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','12Pdhepq','counts','✔\x20Pulled\x20','templates','\x0aError:','1234644ftmWat','519JyBXqL','Pull\x20templates\x20to\x20YAML\x20files','green','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','execute','-\x20no\x20files\x20written','\x20templates','16322OiNySi','\x20new\x20files','Write\x20','✔\x20Context\x20set:\x20','length','\x20\x20Target:\x20','\x0aPull\x20summary\x20for\x20workspace\x20\x27','relativePath','workspace','verbose','8WOpcvg','Pulling\x20templates\x20from\x20\x27','data'];a23_0x4aae=function(){return _0x3e20b8;};return a23_0x4aae();}import a23_0x4e0ef5 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a23_0x52b15e(0x147)]=a23_0x52b15e(0x143);[a23_0x52b15e(0x14c)]=a23_0x52b15e(0x125);async[a23_0x52b15e(0x128)](_0x4e05ff){const _0x48c866=a23_0x52b15e,{options:_0x430041,args:_0x8b6ca2,tdx:_0x13f523}=_0x4e05ff,_0x58435c=_0x430041,_0x39f42f=await resolveWorkspaceName(_0x8b6ca2[0x0],_0x58435c);if(!_0x39f42f)return console[_0x48c866(0x14b)](a23_0x763d12[_0x48c866(0x151)](_0x48c866(0x146))),console['error']('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console['error'](_0x48c866(0x13b)),console[_0x48c866(0x14b)](_0x48c866(0x11d)),0x1;const _0x3dbae3=await withProgressSpinner(_0x48c866(0x136)+_0x39f42f+'\x27...',_0x1b0d7d=>pullTemplates({'engage':_0x13f523[_0x48c866(0x11c)]},_0x39f42f,{'templateName':_0x58435c['name'],'progress':{'update':_0x25c324=>{_0x1b0d7d['setPhase'](_0x25c324);}}}),{'verbose':_0x58435c[_0x48c866(0x134)]}),_0x4ffeb6=_0x3dbae3[_0x48c866(0x137)];if(_0x4ffeb6['counts'][_0x48c866(0x121)]===0x0)return console['error'](a23_0x763d12['yellow']('No\x20templates\x20found\x20in\x20workspace\x20\x27'+_0x4ffeb6[_0x48c866(0x145)]+'\x27')),0x0;const _0x559d1b=_0x4ffeb6[_0x48c866(0x14a)]['filter'](_0x57a2f1=>_0x57a2f1[_0x48c866(0x142)]),_0x59c71c=_0x4ffeb6[_0x48c866(0x14a)][_0x48c866(0x13e)](_0x10d853=>!_0x10d853[_0x48c866(0x142)]&&_0x10d853[_0x48c866(0x14d)]),_0x40994a=_0x4ffeb6[_0x48c866(0x14a)][_0x48c866(0x13e)](_0x5dab05=>!_0x5dab05[_0x48c866(0x142)]&&!_0x5dab05[_0x48c866(0x14d)]);console[_0x48c866(0x14b)](_0x48c866(0x131)+_0x4ffeb6[_0x48c866(0x145)]+'\x27:'),console[_0x48c866(0x14b)]('\x20\x20'+a23_0x763d12[_0x48c866(0x155)](_0x4ffeb6[_0x48c866(0x11f)][_0x48c866(0x121)]+_0x48c866(0x12a))),console['error']('\x20\x20'+a23_0x763d12['green']('+\x20'+_0x559d1b['length']+_0x48c866(0x12c))),console[_0x48c866(0x14b)]('\x20\x20'+a23_0x763d12[_0x48c866(0x151)]('~\x20'+_0x59c71c[_0x48c866(0x12f)]+_0x48c866(0x14e))),console[_0x48c866(0x14b)]('\x20\x20'+a23_0x763d12[_0x48c866(0x153)]('=\x20'+_0x40994a[_0x48c866(0x12f)]+_0x48c866(0x157))),console[_0x48c866(0x14b)](_0x48c866(0x130)+a23_0x763d12['cyan'](_0x4ffeb6[_0x48c866(0x152)])+'\x0a');if(_0x59c71c[_0x48c866(0x12f)]>0x0)for(const _0x5ba24f of _0x59c71c){console[_0x48c866(0x14b)]('\x0aChanges\x20to\x20\x27'+_0x5ba24f[_0x48c866(0x132)]+'\x27:'),console[_0x48c866(0x14b)]('─'[_0x48c866(0x148)](0x3c)),console[_0x48c866(0x14b)](_0x5ba24f['diff']),console[_0x48c866(0x14b)]('─'[_0x48c866(0x148)](0x3c));}if(_0x58435c[_0x48c866(0x158)])return console[_0x48c866(0x14b)](a23_0x763d12[_0x48c866(0x151)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x559d1b['length']===0x0&&_0x59c71c[_0x48c866(0x12f)]===0x0)return console[_0x48c866(0x14b)](a23_0x763d12[_0x48c866(0x126)](_0x48c866(0x13a))),saveSessionContext({'engage_workspace':_0x4ffeb6[_0x48c866(0x145)]},_0x58435c['session']),0x0;if(!_0x58435c[_0x48c866(0x14f)]){if(!isInteractive())return console[_0x48c866(0x14b)](a23_0x763d12[_0x48c866(0x156)](_0x48c866(0x122)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a23_0x763d12[_0x48c866(0x153)](_0x48c866(0x127))),0x1;const _0x444f2f=await confirmKey(_0x48c866(0x12d)+(_0x559d1b[_0x48c866(0x12f)]+_0x59c71c[_0x48c866(0x12f)])+'\x20files?');if(!_0x444f2f)return console['error'](a23_0x763d12[_0x48c866(0x151)]('Aborted.'),_0x48c866(0x129)),0x1;}for(const _0x4760cd of _0x4ffeb6[_0x48c866(0x14a)]){if(_0x4760cd['isNew']||_0x4760cd[_0x48c866(0x14d)]){const _0x5633cc=a23_0x4e0ef5[_0x48c866(0x138)](_0x4760cd['absolutePath']);!existsSync(_0x5633cc)&&mkdirSync(_0x5633cc,{'recursive':!![]}),writeFileSync(_0x4760cd[_0x48c866(0x13f)],_0x4760cd[_0x48c866(0x159)],_0x48c866(0x149));}}return console['error'](a23_0x763d12['green'](_0x48c866(0x120)+(_0x559d1b['length']+_0x59c71c[_0x48c866(0x12f)])+_0x48c866(0x139)+_0x4ffeb6[_0x48c866(0x152)])),saveSessionContext({'engage_workspace':_0x4ffeb6[_0x48c866(0x145)]},_0x58435c[_0x48c866(0x154)]),console[_0x48c866(0x14b)](a23_0x763d12[_0x48c866(0x126)](_0x48c866(0x12e)+a23_0x763d12[_0x48c866(0x153)](_0x48c866(0x150))+'\x20=\x20'+a23_0x763d12['cyan'](_0x4ffeb6[_0x48c866(0x145)]))),0x0;}}async function resolveWorkspaceName(_0x189e47,_0x5ec6d0){const _0x2e264b=a23_0x52b15e;if(_0x189e47)return _0x189e47;if(_0x5ec6d0['workspace'])return _0x5ec6d0[_0x2e264b(0x133)];const _0x354cb5=tryFindTdxConfig(process[_0x2e264b(0x141)]());if(_0x354cb5?.[_0x2e264b(0x144)]['engage_workspace'])return _0x354cb5[_0x2e264b(0x144)]['engage_workspace'];const _0x492091=loadSessionContext(_0x5ec6d0['session']);if(_0x492091?.[_0x2e264b(0x150)])return _0x492091[_0x2e264b(0x150)];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x8033de=a24_0x37e5;(function(_0x56bcc2,_0x1089d1){const _0x27e092=a24_0x37e5,_0x1d211a=_0x56bcc2();while(!![]){try{const _0x28e00c=-parseInt(_0x27e092(0xde))/0x1*(-parseInt(_0x27e092(0xe9))/0x2)+-parseInt(_0x27e092(0x100))/0x3*(parseInt(_0x27e092(0xec))/0x4)+parseInt(_0x27e092(0xfa))/0x5+parseInt(_0x27e092(0xe0))/0x6*(-parseInt(_0x27e092(0xf6))/0x7)+parseInt(_0x27e092(0xd0))/0x8*(parseInt(_0x27e092(0xd8))/0x9)+-parseInt(_0x27e092(0xe3))/0xa+parseInt(_0x27e092(0xbd))/0xb;if(_0x28e00c===_0x1089d1)break;else _0x1d211a['push'](_0x1d211a['shift']());}catch(_0x408a72){_0x1d211a['push'](_0x1d211a['shift']());}}}(a24_0x15df,0xc007d));import{BaseCommand}from'./command.js';function a24_0x15df(){const _0x55387b=['16458222JIZeFp','message','Aborted.','filter','update','resolveWorkspaceId','cwd','red','\x20new\x20templates:','\x0aError:','templateId','Preparing\x20push\x20to\x20workspace\x20\x27','verbose','dryRun','dim','\x27...','green','\x20\x20\x20\x20','workspace','11992PCtXlF','✔\x20Created\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','config','setPhase','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','engage','yellow','6111ZXAQDq','length','execute','resolve','No\x20template\x20YAML\x20files\x20found\x20in\x20','Resolving\x20references...','77Xwttyi','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2382cAALIv','engage_workspace','created','15421690PHVwWr','data','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','errors','1\x20template\x20file:\x20','Found\x20','27758bhiHSv','Workspace\x20is\x20required.','description','1076nkWggl','error','path','create','\x20templates','name','\x20errors:','action','site','session','10423xuVLqw','\x20templates?','Pushing\x20templates...','✔\x20Updated\x20','4036190BaElsA','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','cyan','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','def','16395eOVWdV','-\x20no\x20changes\x20applied','results','updated','valid','relativePath','yes','warnings','\x0aValidation\x20errors\x20in\x20'];a24_0x15df=function(){return _0x55387b;};return a24_0x15df();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x129c70 from'chalk';import a24_0x127784 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';function a24_0x37e5(_0x986465,_0x59d6c0){_0x986465=_0x986465-0xbc;const _0x15df5d=a24_0x15df();let _0x37e55c=_0x15df5d[_0x986465];return _0x37e55c;}import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x8033de(0xf1)]='engage:template:push';[a24_0x8033de(0xeb)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x8033de(0xda)](_0x7bafa6){const _0x3ace9c=a24_0x8033de,{options:_0x1a7207,args:_0x50244d,tdx:_0x3a3f65}=_0x7bafa6,_0x40c7d1=_0x1a7207,_0x13d60e=_0x50244d[0x0],_0x4a16b7=_0x13d60e?a24_0x127784[_0x3ace9c(0xdb)](_0x13d60e):undefined,_0x1dde34=_0x4a16b7?isYamlFile(_0x4a16b7):![];let _0x5eb842;if(_0x1dde34&&_0x4a16b7)_0x5eb842=a24_0x127784['dirname'](_0x4a16b7);else _0x4a16b7?_0x5eb842=_0x4a16b7:_0x5eb842=process[_0x3ace9c(0xc3)]();let _0x261f50;const _0x1ffa12=tryFindTdxConfig(_0x5eb842);_0x1ffa12?.['config'][_0x3ace9c(0xe1)]&&(_0x261f50=_0x1ffa12[_0x3ace9c(0xd3)][_0x3ace9c(0xe1)],!_0x1dde34&&(_0x5eb842=_0x1ffa12['configDir']));_0x40c7d1[_0x3ace9c(0xcf)]&&(_0x261f50=_0x40c7d1[_0x3ace9c(0xcf)]);if(!_0x261f50){const _0x437e7a=loadSessionContext(_0x40c7d1[_0x3ace9c(0xf5)]);_0x437e7a?.[_0x3ace9c(0xe1)]&&(_0x261f50=_0x437e7a['engage_workspace']);}if(!_0x261f50)return console['error'](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xea))),console[_0x3ace9c(0xed)](_0x3ace9c(0xfc)),console[_0x3ace9c(0xed)](_0x3ace9c(0xd5)),console[_0x3ace9c(0xed)](_0x3ace9c(0xd2)),console[_0x3ace9c(0xed)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x211a54;_0x1dde34&&_0x4a16b7?_0x211a54=[parseTemplateFile(_0x4a16b7,a24_0x127784['dirname'](_0x4a16b7))]:_0x211a54=discoverAndParseTemplateFiles(_0x5eb842);if(_0x211a54[_0x3ace9c(0xd9)]===0x0)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xdc)+_0x5eb842)),console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcb)](_0x3ace9c(0xfb))),0x1;const _0x241892=_0x211a54['length']===0x1?_0x3ace9c(0xe7)+_0x211a54[0x0][_0x3ace9c(0xff)][_0x3ace9c(0xf1)]:_0x211a54[_0x3ace9c(0xd9)]+'\x20template\x20files';console[_0x3ace9c(0xed)](_0x3ace9c(0xe8)+a24_0x129c70[_0x3ace9c(0xfd)](_0x241892));let _0x362103=![];for(const _0x4b7076 of _0x211a54){const _0x22ba1c=validateTemplateDef(_0x4b7076[_0x3ace9c(0xff)]);if(!_0x22ba1c[_0x3ace9c(0x104)]){_0x362103=!![],console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xbc)+_0x4b7076[_0x3ace9c(0x105)]+':'));for(const _0x8acefa of _0x22ba1c[_0x3ace9c(0xe6)]){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xc4)]('✗')+'\x20'+_0x8acefa['path']+':\x20'+_0x8acefa['message']);}}for(const _0x150948 of _0x22ba1c[_0x3ace9c(0x107)]){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xd7)]('⚠')+'\x20'+_0x150948[_0x3ace9c(0xee)]+':\x20'+_0x150948[_0x3ace9c(0xbe)]);}}if(_0x362103)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xfe))),0x1;const _0x2204fc=await _0x3a3f65[_0x3ace9c(0xd6)][_0x3ace9c(0xc2)](_0x261f50),_0x160b09=await withProgressSpinner(_0x3ace9c(0xc8)+_0x261f50+_0x3ace9c(0xcc),_0x8180ca=>preparePush({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x211a54,_0x2204fc,{'progress':{'update':_0x49f2cd=>_0x8180ca[_0x3ace9c(0xd4)](_0x49f2cd)}}),{'verbose':_0x40c7d1['verbose']}),_0x201529=_0x160b09[_0x3ace9c(0xe4)];await withProgressSpinner(_0x3ace9c(0xdd),_0x16ba48=>resolveAndBuildInputs({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x201529,_0x2204fc,{'progress':{'update':_0x1e85d5=>_0x16ba48[_0x3ace9c(0xd4)](_0x1e85d5)}}),{'verbose':_0x40c7d1[_0x3ace9c(0xc9)]});const _0x1c9113=_0x201529[_0x3ace9c(0xc0)](_0x843618=>_0x843618['action']===_0x3ace9c(0xef)),_0x138caf=_0x201529[_0x3ace9c(0xc0)](_0x33991a=>_0x33991a['action']===_0x3ace9c(0xc1));console[_0x3ace9c(0xed)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x261f50+'\x27:');if(_0x1c9113[_0x3ace9c(0xd9)]>0x0){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xcd)]('+\x20'+_0x1c9113[_0x3ace9c(0xd9)]+_0x3ace9c(0xc5)));for(const _0x175fb0 of _0x1c9113){console[_0x3ace9c(0xed)](_0x3ace9c(0xce)+a24_0x129c70[_0x3ace9c(0xcd)]('+')+'\x20'+_0x175fb0['def']['name']);}}if(_0x138caf[_0x3ace9c(0xd9)]>0x0){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70[_0x3ace9c(0xd7)]('~\x20'+_0x138caf[_0x3ace9c(0xd9)]+'\x20templates\x20to\x20update:'));for(const _0x18c323 of _0x138caf){console['error'](_0x3ace9c(0xce)+a24_0x129c70['yellow']('~')+'\x20'+_0x18c323[_0x3ace9c(0xff)][_0x3ace9c(0xf1)]);}}if(_0x1c9113[_0x3ace9c(0xd9)]===0x0&&_0x138caf[_0x3ace9c(0xd9)]===0x0)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcd)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x40c7d1[_0x3ace9c(0xca)])return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xe5))),0x0;if(!_0x40c7d1[_0x3ace9c(0x106)]){if(!isInteractive())return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xc4)](_0x3ace9c(0xc6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xcb)](_0x3ace9c(0xdf))),0x1;const _0x520fd7=await confirmKey('Push\x20'+(_0x1c9113[_0x3ace9c(0xd9)]+_0x138caf[_0x3ace9c(0xd9)])+_0x3ace9c(0xf7));if(!_0x520fd7)return console[_0x3ace9c(0xed)](a24_0x129c70[_0x3ace9c(0xd7)](_0x3ace9c(0xbf)),_0x3ace9c(0x101)),0x1;}const _0x150f19=await withProgressSpinner(_0x3ace9c(0xf8),_0x90197c=>executePush({'engage':_0x3a3f65[_0x3ace9c(0xd6)]},_0x201529,{'progress':{'update':_0x166e75=>_0x90197c[_0x3ace9c(0xd4)](_0x166e75)}}),{'verbose':_0x40c7d1[_0x3ace9c(0xc9)]}),_0x364315=_0x150f19[_0x3ace9c(0xe4)];for(const _0x2b173e of _0x364315[_0x3ace9c(0x102)]){if(_0x2b173e[_0x3ace9c(0xc7)]&&(_0x2b173e['action']===_0x3ace9c(0xe2)||_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0x103))){const _0x7f05d1=getTemplateUrl(_0x40c7d1[_0x3ace9c(0xf4)],_0x2204fc,_0x2b173e[_0x3ace9c(0xc7)]),_0xb45d90=_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0xe2)?'+':'~',_0x29f2fa=_0x2b173e[_0x3ace9c(0xf3)]===_0x3ace9c(0xe2)?a24_0x129c70[_0x3ace9c(0xcd)](_0xb45d90):a24_0x129c70['yellow'](_0xb45d90);console['error']('\x20\x20'+_0x29f2fa+'\x20'+hyperlink(_0x2b173e[_0x3ace9c(0xf1)],_0x7f05d1)+'\x20'+a24_0x129c70['dim'](_0x7f05d1));}}_0x364315[_0x3ace9c(0xe2)]>0x0&&console['error'](a24_0x129c70[_0x3ace9c(0xcd)](_0x3ace9c(0xd1)+_0x364315[_0x3ace9c(0xe2)]+'\x20templates'));_0x364315[_0x3ace9c(0x103)]>0x0&&console['error'](a24_0x129c70[_0x3ace9c(0xcd)](_0x3ace9c(0xf9)+_0x364315[_0x3ace9c(0x103)]+_0x3ace9c(0xf0)));if(_0x364315[_0x3ace9c(0xe6)]['length']>0x0){console[_0x3ace9c(0xed)](a24_0x129c70['red']('✘\x20'+_0x364315[_0x3ace9c(0xe6)][_0x3ace9c(0xd9)]+_0x3ace9c(0xf2)));for(const _0x100b57 of _0x364315['errors']){console[_0x3ace9c(0xed)]('\x20\x20'+a24_0x129c70['red'](_0x100b57['name'])+':\x20'+_0x100b57[_0x3ace9c(0xed)]);}}return saveSessionContext({'engage_workspace':_0x261f50},_0x40c7d1['session']),_0x364315[_0x3ace9c(0xe6)][_0x3ace9c(0xd9)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a24_0x457d48=a24_0x5e08;(function(_0x3c5134,_0x5c3968){const _0x38165d=a24_0x5e08,_0x195829=_0x3c5134();while(!![]){try{const _0x4cd610=parseInt(_0x38165d(0x13b))/0x1+-parseInt(_0x38165d(0x128))/0x2*(parseInt(_0x38165d(0x10b))/0x3)+-parseInt(_0x38165d(0x111))/0x4+parseInt(_0x38165d(0x129))/0x5+parseInt(_0x38165d(0x126))/0x6*(-parseInt(_0x38165d(0x134))/0x7)+-parseInt(_0x38165d(0x127))/0x8+-parseInt(_0x38165d(0x14a))/0x9*(-parseInt(_0x38165d(0x13c))/0xa);if(_0x4cd610===_0x5c3968)break;else _0x195829['push'](_0x195829['shift']());}catch(_0x2c222b){_0x195829['push'](_0x195829['shift']());}}}(a24_0x319a,0xb9671));import{BaseCommand}from'./command.js';function a24_0x5e08(_0x16a407,_0x5e151b){_0x16a407=_0x16a407-0x109;const _0x319a83=a24_0x319a();let _0x5e0895=_0x319a83[_0x16a407];return _0x5e0895;}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';function a24_0x319a(){const _0x3282ed=['45hAsrWs','cyan','red','resolve','name','def','705832fyJwXY','action','\x20new\x20templates:','length','yes','setPhase','engage_workspace','templateId','1\x20template\x20file:\x20','✔\x20Updated\x20','engage:template:push','Resolving\x20references...','updated','errors','workspace','\x27...','data','✔\x20All\x20templates\x20are\x20up\x20to\x20date','warnings','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','relativePath','24PbNOcc','5570040zQWSbi','30078FRkgub','477365rEdnol','engage','\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','configDir','No\x20template\x20YAML\x20files\x20found\x20in\x20','config','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','filter','\x20\x20\x20\x20','create','valid','581273XUAoJy','site','Aborted.','Preparing\x20push\x20to\x20workspace\x20\x27','Found\x20','verbose','path','573474EYgPGg','40aEEBOf','dim','error','description','dirname','\x20templates','dryRun','\x20templates?','cwd','results','Push\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','created','green','3422061WKkqcu','session','\x20templates\x20to\x20update:','message','yellow','-\x20no\x20changes\x20applied','Workspace\x20is\x20required.','\x20template\x20files'];a24_0x319a=function(){return _0x3282ed;};return a24_0x319a();}import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x2546b9 from'chalk';import a24_0xcda943 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x457d48(0x10f)]=a24_0x457d48(0x11b);[a24_0x457d48(0x13f)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async['execute'](_0x2e02fa){const _0x5079a6=a24_0x457d48,{options:_0x3e2cc9,args:_0x5a4452,tdx:_0x1e8c3a}=_0x2e02fa,_0xe0b0c=_0x3e2cc9,_0x2371e3=_0x5a4452[0x0],_0x399e7f=_0x2371e3?a24_0xcda943[_0x5079a6(0x10e)](_0x2371e3):undefined,_0x443854=_0x399e7f?isYamlFile(_0x399e7f):![];let _0x30f0cf;if(_0x443854&&_0x399e7f)_0x30f0cf=a24_0xcda943[_0x5079a6(0x140)](_0x399e7f);else _0x399e7f?_0x30f0cf=_0x399e7f:_0x30f0cf=process[_0x5079a6(0x144)]();let _0x3d4fed;const _0xd80597=tryFindTdxConfig(_0x30f0cf);_0xd80597?.[_0x5079a6(0x12e)]['engage_workspace']&&(_0x3d4fed=_0xd80597[_0x5079a6(0x12e)][_0x5079a6(0x117)],!_0x443854&&(_0x30f0cf=_0xd80597[_0x5079a6(0x12c)]));_0xe0b0c[_0x5079a6(0x11f)]&&(_0x3d4fed=_0xe0b0c[_0x5079a6(0x11f)]);if(!_0x3d4fed){const _0x1e6d3b=loadSessionContext(_0xe0b0c[_0x5079a6(0x14b)]);_0x1e6d3b?.[_0x5079a6(0x117)]&&(_0x3d4fed=_0x1e6d3b[_0x5079a6(0x117)]);}if(!_0x3d4fed)return console[_0x5079a6(0x13e)](a24_0x2546b9[_0x5079a6(0x14e)](_0x5079a6(0x109))),console[_0x5079a6(0x13e)](_0x5079a6(0x12b)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console[_0x5079a6(0x13e)](_0x5079a6(0x147)),console[_0x5079a6(0x13e)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x519a35;_0x443854&&_0x399e7f?_0x519a35=[parseTemplateFile(_0x399e7f,a24_0xcda943['dirname'](_0x399e7f))]:_0x519a35=discoverAndParseTemplateFiles(_0x30f0cf);if(_0x519a35[_0x5079a6(0x114)]===0x0)return console[_0x5079a6(0x13e)](a24_0x2546b9[_0x5079a6(0x14e)](_0x5079a6(0x12d)+_0x30f0cf)),console['error'](a24_0x2546b9[_0x5079a6(0x13d)]('Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.')),0x1;const _0x4032c9=_0x519a35[_0x5079a6(0x114)]===0x1?_0x5079a6(0x119)+_0x519a35[0x0][_0x5079a6(0x110)][_0x5079a6(0x10f)]:_0x519a35[_0x5079a6(0x114)]+_0x5079a6(0x10a);console[_0x5079a6(0x13e)](_0x5079a6(0x138)+a24_0x2546b9[_0x5079a6(0x10c)](_0x4032c9));let _0x1e172=![];for(const _0x735ebc of _0x519a35){const _0x28da5a=validateTemplateDef(_0x735ebc[_0x5079a6(0x110)]);if(!_0x28da5a[_0x5079a6(0x133)]){_0x1e172=!![],console[_0x5079a6(0x13e)](a24_0x2546b9[_0x5079a6(0x10d)]('\x0aValidation\x20errors\x20in\x20'+_0x735ebc[_0x5079a6(0x125)]+':'));for(const _0x3efd87 of _0x28da5a[_0x5079a6(0x11e)]){console[_0x5079a6(0x13e)]('\x20\x20'+a24_0x2546b9['red']('✗')+'\x20'+_0x3efd87[_0x5079a6(0x13a)]+':\x20'+_0x3efd87['message']);}}for(const _0x27bc15 of _0x28da5a[_0x5079a6(0x123)]){console[_0x5079a6(0x13e)]('\x20\x20'+a24_0x2546b9['yellow']('⚠')+'\x20'+_0x27bc15[_0x5079a6(0x13a)]+':\x20'+_0x27bc15[_0x5079a6(0x14d)]);}}if(_0x1e172)return console[_0x5079a6(0x13e)](a24_0x2546b9[_0x5079a6(0x10d)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x524600=await _0x1e8c3a['engage']['resolveWorkspaceId'](_0x3d4fed),_0x893d18=await withProgressSpinner(_0x5079a6(0x137)+_0x3d4fed+_0x5079a6(0x120),_0x4a54ac=>preparePush({'engage':_0x1e8c3a[_0x5079a6(0x12a)]},_0x519a35,_0x524600,{'progress':{'update':_0x47b37f=>_0x4a54ac[_0x5079a6(0x116)](_0x47b37f)}}),{'verbose':_0xe0b0c[_0x5079a6(0x139)]}),_0x583d06=_0x893d18[_0x5079a6(0x121)];await withProgressSpinner(_0x5079a6(0x11c),_0x3cfe5c=>resolveAndBuildInputs({'engage':_0x1e8c3a[_0x5079a6(0x12a)]},_0x583d06,_0x524600,{'progress':{'update':_0x3fb3e4=>_0x3cfe5c[_0x5079a6(0x116)](_0x3fb3e4)}}),{'verbose':_0xe0b0c[_0x5079a6(0x139)]});const _0x262f4b=_0x583d06[_0x5079a6(0x130)](_0x127936=>_0x127936['action']===_0x5079a6(0x132)),_0x3dc6a1=_0x583d06[_0x5079a6(0x130)](_0x1401e8=>_0x1401e8['action']==='update');console['error']('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x3d4fed+'\x27:');if(_0x262f4b[_0x5079a6(0x114)]>0x0){console[_0x5079a6(0x13e)]('\x20\x20'+a24_0x2546b9[_0x5079a6(0x149)]('+\x20'+_0x262f4b[_0x5079a6(0x114)]+_0x5079a6(0x113)));for(const _0x5b4633 of _0x262f4b){console[_0x5079a6(0x13e)](_0x5079a6(0x131)+a24_0x2546b9['green']('+')+'\x20'+_0x5b4633['def'][_0x5079a6(0x10f)]);}}if(_0x3dc6a1[_0x5079a6(0x114)]>0x0){console[_0x5079a6(0x13e)]('\x20\x20'+a24_0x2546b9[_0x5079a6(0x14e)]('~\x20'+_0x3dc6a1['length']+_0x5079a6(0x14c)));for(const _0x39b186 of _0x3dc6a1){console[_0x5079a6(0x13e)]('\x20\x20\x20\x20'+a24_0x2546b9[_0x5079a6(0x14e)]('~')+'\x20'+_0x39b186[_0x5079a6(0x110)][_0x5079a6(0x10f)]);}}if(_0x262f4b[_0x5079a6(0x114)]===0x0&&_0x3dc6a1[_0x5079a6(0x114)]===0x0)return console['error'](a24_0x2546b9[_0x5079a6(0x149)](_0x5079a6(0x122))),0x0;if(_0xe0b0c[_0x5079a6(0x142)])return console['error'](a24_0x2546b9['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0xe0b0c[_0x5079a6(0x115)]){if(!isInteractive())return console[_0x5079a6(0x13e)](a24_0x2546b9['red']('\x0aError:'),_0x5079a6(0x124)),console[_0x5079a6(0x13e)](a24_0x2546b9[_0x5079a6(0x13d)](_0x5079a6(0x12f))),0x1;const _0x18e6f4=await confirmKey(_0x5079a6(0x146)+(_0x262f4b[_0x5079a6(0x114)]+_0x3dc6a1[_0x5079a6(0x114)])+_0x5079a6(0x143));if(!_0x18e6f4)return console[_0x5079a6(0x13e)](a24_0x2546b9[_0x5079a6(0x14e)](_0x5079a6(0x136)),_0x5079a6(0x14f)),0x1;}const _0x2cda98=await withProgressSpinner('Pushing\x20templates...',_0x501d8d=>executePush({'engage':_0x1e8c3a[_0x5079a6(0x12a)]},_0x583d06,{'progress':{'update':_0x12fd89=>_0x501d8d[_0x5079a6(0x116)](_0x12fd89)}}),{'verbose':_0xe0b0c[_0x5079a6(0x139)]}),_0x13949a=_0x2cda98[_0x5079a6(0x121)];for(const _0x184b5a of _0x13949a[_0x5079a6(0x145)]){if(_0x184b5a[_0x5079a6(0x118)]&&(_0x184b5a[_0x5079a6(0x112)]===_0x5079a6(0x148)||_0x184b5a['action']===_0x5079a6(0x11d))){const _0x3bdbbd=getTemplateUrl(_0xe0b0c[_0x5079a6(0x135)],_0x524600,_0x184b5a['templateId']),_0x314d89=_0x184b5a['action']===_0x5079a6(0x148)?'+':'~',_0xeb4fa2=_0x184b5a[_0x5079a6(0x112)]===_0x5079a6(0x148)?a24_0x2546b9[_0x5079a6(0x149)](_0x314d89):a24_0x2546b9[_0x5079a6(0x14e)](_0x314d89);console[_0x5079a6(0x13e)]('\x20\x20'+_0xeb4fa2+'\x20'+hyperlink(_0x184b5a['name'],_0x3bdbbd)+'\x20'+a24_0x2546b9['dim'](_0x3bdbbd));}}_0x13949a[_0x5079a6(0x148)]>0x0&&console['error'](a24_0x2546b9['green']('✔\x20Created\x20'+_0x13949a[_0x5079a6(0x148)]+_0x5079a6(0x141)));_0x13949a[_0x5079a6(0x11d)]>0x0&&console[_0x5079a6(0x13e)](a24_0x2546b9[_0x5079a6(0x149)](_0x5079a6(0x11a)+_0x13949a[_0x5079a6(0x11d)]+_0x5079a6(0x141)));if(_0x13949a[_0x5079a6(0x11e)]['length']>0x0){console[_0x5079a6(0x13e)](a24_0x2546b9['red']('✘\x20'+_0x13949a[_0x5079a6(0x11e)][_0x5079a6(0x114)]+'\x20errors:'));for(const _0x35a3cc of _0x13949a[_0x5079a6(0x11e)]){console['error']('\x20\x20'+a24_0x2546b9[_0x5079a6(0x10d)](_0x35a3cc[_0x5079a6(0x10f)])+':\x20'+_0x35a3cc[_0x5079a6(0x13e)]);}}return saveSessionContext({'engage_workspace':_0x3d4fed},_0xe0b0c['session']),_0x13949a[_0x5079a6(0x11e)]['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x188d41=a25_0x2e09;(function(_0x46c7ea,_0x212b44){const _0x959938=a25_0x2e09,_0x6b42f5=_0x46c7ea();while(!![]){try{const _0xb35b97=-parseInt(_0x959938(0x8f))/0x1*(-parseInt(_0x959938(0x97))/0x2)+-parseInt(_0x959938(0xae))/0x3+parseInt(_0x959938(0x9f))/0x4*(parseInt(_0x959938(0xaa))/0x5)+parseInt(_0x959938(0xac))/0x6+parseInt(_0x959938(0x9b))/0x7+-parseInt(_0x959938(0x90))/0x8*(parseInt(_0x959938(0x9d))/0x9)+parseInt(_0x959938(0xa3))/0xa*(-parseInt(_0x959938(0x8b))/0xb);if(_0xb35b97===_0x212b44)break;else _0x6b42f5['push'](_0x6b42f5['shift']());}catch(_0x2782ef){_0x6b42f5['push'](_0x6b42f5['shift']());}}}(a25_0x4743,0x4d548));function a25_0x2e09(_0x3bb599,_0xa9b58d){_0x3bb599=_0x3bb599-0x87;const _0x4743d2=a25_0x4743();let _0x2e09df=_0x4743d2[_0x3bb599];return _0x2e09df;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x2989ef from'chalk';import a25_0x55b1cc from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x188d41(0x88)]=a25_0x188d41(0x8c);['description']=a25_0x188d41(0x87);async[a25_0x188d41(0xa6)](_0x40dcec){const _0x3b08bf=a25_0x188d41,{options:_0x43d360,args:_0x5844d3}=_0x40dcec,_0x4327c2=_0x43d360,_0x2cac4c=_0x5844d3[0x0],_0x17471b=_0x2cac4c?a25_0x55b1cc[_0x3b08bf(0xa4)](_0x2cac4c):undefined,_0x3678fe=_0x17471b?isYamlFile(_0x17471b):![];let _0x23d3a8,_0xfacb57;if(_0x3678fe&&_0x17471b)_0x23d3a8=a25_0x55b1cc[_0x3b08bf(0xaf)](_0x17471b),_0xfacb57=_0x17471b;else _0x17471b?_0x23d3a8=_0x17471b:_0x23d3a8=process[_0x3b08bf(0x8e)]();if(!_0xfacb57&&!existsSync(_0x23d3a8))return console[_0x3b08bf(0xad)](a25_0x2989ef[_0x3b08bf(0x99)]('Error:\x20Directory\x20not\x20found:\x20'+_0x23d3a8+'\x0a')),0x1;let _0x5b24e4;if(_0xfacb57){if(!_0xfacb57[_0x3b08bf(0x98)]('.yml')&&!_0xfacb57[_0x3b08bf(0x98)](_0x3b08bf(0x92)))return console['error'](a25_0x2989ef['red'](_0x3b08bf(0xa8)+_0xfacb57+'\x0a')),0x1;_0x5b24e4=[_0xfacb57];}else _0x5b24e4=findYamlFiles(_0x23d3a8);if(_0x5b24e4[_0x3b08bf(0xab)]===0x0)return console['error'](a25_0x2989ef['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x23d3a8+'\x0a')),0x1;const _0x8a6381=validateYamlFiles(_0x5b24e4,_0x23d3a8,{'filterType':_0x3b08bf(0x9e)}),_0xa0f271=calculateSummary(_0x8a6381),_0x5a55cc=_0x8a6381[_0x3b08bf(0x94)](isValidationResult);if(_0x5a55cc[_0x3b08bf(0xab)]===0x0)return console['error'](a25_0x2989ef[_0x3b08bf(0xa5)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x23d3a8+'\x0a')),_0xa0f271[_0x3b08bf(0xa1)]>0x0&&console[_0x3b08bf(0xad)](a25_0x2989ef[_0x3b08bf(0xb0)]('('+_0xa0f271['skippedCount']+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x366429 of _0x8a6381){if(!isValidationResult(_0x366429)){_0x4327c2[_0x3b08bf(0x9a)]&&console['log'](a25_0x2989ef[_0x3b08bf(0xb0)]('-\x20'+_0x366429['relativePath']+_0x3b08bf(0xb3)+_0x366429[_0x3b08bf(0x96)]+')'));continue;}const {relativePath:_0x53a97c,source:_0xa6b932,result:_0x3c7314}=_0x366429;if(_0x3c7314[_0x3b08bf(0xb1)]&&_0x3c7314['warnings'][_0x3b08bf(0xab)]===0x0)_0x4327c2[_0x3b08bf(0x9a)]&&console['log'](a25_0x2989ef[_0x3b08bf(0xb5)]('✔\x20'+_0x53a97c));else _0x3c7314['valid']?(console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xa5)]('⚠\x20'+_0x53a97c+':\x20'+_0x3c7314['warnings'][_0x3b08bf(0xab)]+_0x3b08bf(0x93))),console[_0x3b08bf(0x95)](formatValidationResult(_0x3c7314,_0xa6b932,_0x53a97c))):(console[_0x3b08bf(0x95)](a25_0x2989ef['red']('✖\x20'+_0x53a97c+':\x20'+_0x3c7314['errors']['length']+'\x20error(s)')),console[_0x3b08bf(0x95)](formatValidationResult(_0x3c7314,_0xa6b932,_0x53a97c)));}return console[_0x3b08bf(0x95)](''),_0xa0f271[_0x3b08bf(0xb4)]?(console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0x99)](_0x3b08bf(0xa0)+_0xa0f271[_0x3b08bf(0x8d)]+_0x3b08bf(0xa9)+_0xa0f271[_0x3b08bf(0xa2)]+_0x3b08bf(0x89))),_0xa0f271[_0x3b08bf(0x91)]>0x0&&console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xa5)](_0xa0f271[_0x3b08bf(0x91)]+_0x3b08bf(0x8a))),_0xa0f271[_0x3b08bf(0xa1)]>0x0&&console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xb0)](_0xa0f271[_0x3b08bf(0xa1)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xb5)](_0x3b08bf(0xb2)+_0xa0f271[_0x3b08bf(0xa2)]+_0x3b08bf(0x9c))),_0xa0f271[_0x3b08bf(0x91)]>0x0&&console[_0x3b08bf(0x95)](a25_0x2989ef[_0x3b08bf(0xa5)](_0xa0f271['warningCount']+_0x3b08bf(0x8a))),_0xa0f271[_0x3b08bf(0xa1)]>0x0&&console['log'](a25_0x2989ef[_0x3b08bf(0xb0)](_0xa0f271['skippedCount']+_0x3b08bf(0xa7))),0x0);}}function a25_0x4743(){const _0x120064=['error','728403tvxdSP','dirname','dim','valid','✔\x20All\x20','\x20(skipped:\x20','hasErrors','green','Validate\x20template\x20YAML\x20files','name','\x20valid','\x20warning(s)\x20found','2849tfgBVr','engage:template:validate','invalidCount','cwd','6985edDodx','264ZybRwa','warningCount','.yaml','\x20warning(s)','filter','log','reason','158hruUjT','endsWith','red','verbose','2319170foXNMR','\x20template(s)\x20valid','171531cYkqWO','template','108gTtAPz','Validation\x20failed:\x20','skippedCount','validCount','14340XGRqBC','resolve','yellow','execute','\x20non-template\x20file(s)\x20skipped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20template(s)\x20with\x20errors,\x20','74195RDWtJb','length','1656720deLSIP'];a25_0x4743=function(){return _0x120064;};return a25_0x4743();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x4fd919=a26_0x60da;function a26_0x60da(_0x3f4645,_0x1a4951){_0x3f4645=_0x3f4645-0x1c7;const _0x9dc464=a26_0x9dc4();let _0x60da95=_0x9dc464[_0x3f4645];return _0x60da95;}(function(_0xe438d0,_0x92a403){const _0x5b721c=a26_0x60da,_0x2dcba2=_0xe438d0();while(!![]){try{const _0xe9a898=parseInt(_0x5b721c(0x1e8))/0x1+-parseInt(_0x5b721c(0x1f2))/0x2*(-parseInt(_0x5b721c(0x200))/0x3)+parseInt(_0x5b721c(0x1cf))/0x4*(parseInt(_0x5b721c(0x1cb))/0x5)+-parseInt(_0x5b721c(0x1ca))/0x6+-parseInt(_0x5b721c(0x20d))/0x7+parseInt(_0x5b721c(0x1cc))/0x8*(-parseInt(_0x5b721c(0x1ff))/0x9)+parseInt(_0x5b721c(0x1f7))/0xa*(parseInt(_0x5b721c(0x21e))/0xb);if(_0xe9a898===_0x92a403)break;else _0x2dcba2['push'](_0x2dcba2['shift']());}catch(_0x1b0bad){_0x2dcba2['push'](_0x2dcba2['shift']());}}}(a26_0x9dc4,0xd5531));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a26_0x9dc4(){const _0x338335=['floor','...','jobs','map','Submitting\x20kill\x20request...','substring','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','11TIIVkP','show','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Query:\x20','Getting\x20job\x20results...','length','job_id','7554300WWlDNP','1565owgftu','8pKJMTl','start_at','execute','14152EBkeRi','user_name','push','Submitting\x20job...','✔\x20Found\x20','job:result','abs','presto','red','data','round','limit','join','debug','d\x20ago','Cancelled','log','list','status','green','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Get\x20job\x20results','\x20row','job:submit','1311787REnOYm','✔\x20Job\x20submitted','h\x20ago','validate','Kill\x20a\x20job','created_at','file','getTime','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Getting\x20job\x20details...','227126hJXwWT','now','priority','name','result','16535990LksakQ','end_at','Show\x20job\x20details','job:show','No\x20SQL\x20statements\x20found\x20in\x20file','dim','information_schema','List\x20jobs','11688237dUuVOI','3gsHWtl','verbose','database','trino','Listing\x20jobs...','type','\x27\x20to\x20verify\x20the\x20job\x20status','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','just\x20now','args','success','\x20job','url','5283761LiOEwf','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','m\x20ago','hive','error','jobType','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','description'];a26_0x9dc4=function(){return _0x338335;};return a26_0x9dc4();}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x1cb628 from'chalk';function formatDuration(_0x98000d){const _0x1aab72=a26_0x60da;if(_0x98000d<0x3c)return _0x98000d+'s';if(_0x98000d<0xe10)return Math[_0x1aab72(0x217)](_0x98000d/0x3c)+'m\x20'+_0x98000d%0x3c+'s';const _0x1aa12c=Math[_0x1aab72(0x217)](_0x98000d/0xe10),_0x5432ea=Math[_0x1aab72(0x217)](_0x98000d%0xe10/0x3c);return _0x5432ea>0x0?_0x1aa12c+'h\x20'+_0x5432ea+'m':_0x1aa12c+'h';}function formatRelativeTime(_0x1799ac){const _0x59a4c4=a26_0x60da,_0x4295b3=Date[_0x59a4c4(0x1f3)]()-_0x1799ac[_0x59a4c4(0x1ef)](),_0x3fa49c=Math['floor'](Math[_0x59a4c4(0x1d5)](_0x4295b3)/0x3e8);if(_0x3fa49c<0x3c)return _0x59a4c4(0x208);const _0x234245=Math[_0x59a4c4(0x217)](_0x3fa49c/0x3c);if(_0x234245<0x3c)return _0x234245+_0x59a4c4(0x20f);const _0x4ea579=Math[_0x59a4c4(0x217)](_0x234245/0x3c);if(_0x4ea579<0x18)return _0x4ea579+_0x59a4c4(0x1ea);const _0x39c35f=Math['floor'](_0x4ea579/0x18);if(_0x39c35f<0x1e)return _0x39c35f+_0x59a4c4(0x1dd);return Math[_0x59a4c4(0x217)](_0x39c35f/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{['name']=a26_0x4fd919(0x219);[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1fe);async[a26_0x4fd919(0x1ce)](_0x77bd3d){const _0x568b0d=a26_0x4fd919,{options:_0x22efe8,tdx:_0x52ed2f}=_0x77bd3d,_0x446a4b=resolveLimit(_0x22efe8[_0x568b0d(0x1da)],DEFAULT_DISPLAY_LIMIT),_0x50ed3c=_0x22efe8[_0x568b0d(0x1e1)];_0x22efe8[_0x568b0d(0x201)]&&(console[_0x568b0d(0x211)]('Limit:\x20'+_0x446a4b+'\x20jobs'),_0x50ed3c&&console['error']('Status\x20filter:\x20'+_0x50ed3c));const _0x33abab=await withSpinner(_0x568b0d(0x204),()=>_0x52ed2f['jobs'][_0x568b0d(0x1e0)]({'from':0x0,'to':_0x446a4b-0x1,'status':_0x50ed3c}),{'verbose':_0x22efe8[_0x568b0d(0x201)]}),_0x46b54e=_0x33abab['data'];console['error'](_0x568b0d(0x1d3)+_0x46b54e[_0x568b0d(0x1c8)]+_0x568b0d(0x20b)+(_0x46b54e[_0x568b0d(0x1c8)]!==0x1?'s':''));const _0xa9edbf=_0x22efe8['site'];if(isStructuredFormat(_0x22efe8)){const _0x4e58e4=_0x46b54e[_0x568b0d(0x21a)](_0xa06a9f=>{const _0x164de7=_0x568b0d;let _0x193dbc;if(_0xa06a9f['start_at']&&_0xa06a9f[_0x164de7(0x1f8)]){const _0x415eb=new Date(_0xa06a9f[_0x164de7(0x1cd)])[_0x164de7(0x1ef)](),_0x24258b=new Date(_0xa06a9f[_0x164de7(0x1f8)])[_0x164de7(0x1ef)]();_0x193dbc=Math[_0x164de7(0x1d9)]((_0x24258b-_0x415eb)/0x3e8);}return{'job_id':_0xa06a9f[_0x164de7(0x1c9)],'type':_0xa06a9f['type']===_0x164de7(0x1d6)?_0x164de7(0x203):_0xa06a9f[_0x164de7(0x205)],'status':_0xa06a9f[_0x164de7(0x1e1)],'user_name':_0xa06a9f[_0x164de7(0x1d0)],'duration_sec':_0x193dbc,'created_at':_0xa06a9f[_0x164de7(0x1ed)],'started_at':_0xa06a9f[_0x164de7(0x1cd)],'end_at':_0xa06a9f[_0x164de7(0x1f8)]};});await handleSDKOutput(_0x4e58e4,_0x22efe8);}else for(const _0xf8f390 of _0x46b54e){const _0x61f957=_0xf8f390[_0x568b0d(0x1e1)]===_0x568b0d(0x20a)?a26_0x1cb628[_0x568b0d(0x1e2)]:_0xf8f390[_0x568b0d(0x1e1)]===_0x568b0d(0x211)?a26_0x1cb628[_0x568b0d(0x1d7)]:a26_0x1cb628[_0x568b0d(0x1fc)],_0x4a9cda=_0x61f957(_0xf8f390[_0x568b0d(0x1e1)]),_0x16b5c2=getJobUrl(_0xa9edbf,_0xf8f390[_0x568b0d(0x1c9)]),_0x1a1c8e=hyperlink(_0xf8f390['job_id'],_0x16b5c2),_0x11e8c6=a26_0x1cb628[_0x568b0d(0x1fc)](_0xf8f390[_0x568b0d(0x205)]==='presto'?'trino':_0xf8f390[_0x568b0d(0x205)]),_0x1a1230=[];if(_0xf8f390[_0x568b0d(0x1cd)]&&_0xf8f390[_0x568b0d(0x1f8)]){const _0x11f590=Math[_0x568b0d(0x1d9)]((new Date(_0xf8f390[_0x568b0d(0x1f8)])[_0x568b0d(0x1ef)]()-new Date(_0xf8f390[_0x568b0d(0x1cd)])[_0x568b0d(0x1ef)]())/0x3e8);_0x1a1230[_0x568b0d(0x1d1)](formatDuration(_0x11f590));}if(_0xf8f390[_0x568b0d(0x1f8)])_0x1a1230[_0x568b0d(0x1d1)](formatRelativeTime(new Date(_0xf8f390[_0x568b0d(0x1f8)])));else _0xf8f390[_0x568b0d(0x1cd)]&&_0x1a1230[_0x568b0d(0x1d1)](formatRelativeTime(new Date(_0xf8f390[_0x568b0d(0x1cd)])));const _0x1fe0cf=_0x1a1230[_0x568b0d(0x1c8)]>0x0?a26_0x1cb628[_0x568b0d(0x1fc)]('\x20'+_0x1a1230[_0x568b0d(0x1db)](',\x20')):'';console[_0x568b0d(0x1df)]('⚡\x20'+_0x1a1c8e+'\x20'+_0x11e8c6+'\x20'+_0x4a9cda+_0x1fe0cf);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1fa);[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1f9);['validate'](_0x10f476){const _0x4793a4=a26_0x4fd919,_0x2d810b=_0x10f476[_0x4793a4(0x209)][0x0];if(!_0x2d810b)return _0x4793a4(0x215);return undefined;}async[a26_0x4fd919(0x1ce)](_0xfbf524){const _0x2ac5d9=a26_0x4fd919,{options:_0x480f4c,args:_0x3a7079,tdx:_0x1314ce}=_0xfbf524,_0x3c4acd=_0x3a7079[0x0],_0xa603a0=await withSpinner(_0x2ac5d9(0x1f1),()=>_0x1314ce[_0x2ac5d9(0x219)][_0x2ac5d9(0x21f)](_0x3c4acd),{'verbose':_0x480f4c['verbose']}),_0xc81805=_0xa603a0[_0x2ac5d9(0x1d8)];let _0x1c2e45;if(_0xc81805['start_at']&&_0xc81805[_0x2ac5d9(0x1f8)]){const _0x8ffb18=new Date(_0xc81805[_0x2ac5d9(0x1cd)])[_0x2ac5d9(0x1ef)](),_0x32305e=new Date(_0xc81805[_0x2ac5d9(0x1f8)])[_0x2ac5d9(0x1ef)]();_0x1c2e45=Math['round']((_0x32305e-_0x8ffb18)/0x3e8);}const _0x4a5d15={'job_id':_0xc81805[_0x2ac5d9(0x1c9)],'type':_0xc81805[_0x2ac5d9(0x205)],'status':_0xc81805['status'],..._0xc81805[_0x2ac5d9(0x1d0)]&&{'user_name':_0xc81805[_0x2ac5d9(0x1d0)]},..._0x1c2e45!==undefined&&{'duration_sec':_0x1c2e45},..._0xc81805[_0x2ac5d9(0x1ed)]&&{'created_at':_0xc81805['created_at']},..._0xc81805[_0x2ac5d9(0x1cd)]&&{'started_at':_0xc81805[_0x2ac5d9(0x1cd)]},..._0xc81805[_0x2ac5d9(0x1f8)]&&{'end_at':_0xc81805['end_at']},..._0xc81805[_0x2ac5d9(0x202)]&&{'database':_0xc81805['database']},..._0xc81805[_0x2ac5d9(0x1f4)]!==undefined&&{'priority':_0xc81805[_0x2ac5d9(0x1f4)]},..._0xc81805[_0x2ac5d9(0x20c)]&&{'url':_0xc81805[_0x2ac5d9(0x20c)]},..._0xc81805['query']&&{'query':_0xc81805['query']},..._0xc81805['debug']&&{'debug':_0xc81805[_0x2ac5d9(0x1dc)]}};return await handleSingleObjectOutput(_0x4a5d15,_0x480f4c),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]='job:kill';[a26_0x4fd919(0x216)]=a26_0x4fd919(0x1ec);[a26_0x4fd919(0x1eb)](_0xae416e){const _0x65eb0=a26_0x4fd919,_0x4384ba=_0xae416e[_0x65eb0(0x209)][0x0];if(!_0x4384ba)return _0x65eb0(0x214);return undefined;}async['execute'](_0x203031){const _0x1db736=a26_0x4fd919,{options:_0x224f57,args:_0x4588d2,tdx:_0xc29d00}=_0x203031,_0x50498d=_0x4588d2[0x0];if(!_0x224f57['yes']){const _0x2d5d8d=await confirm(_0x1db736(0x1f0)+_0x50498d+'?');if(!_0x2d5d8d)return console[_0x1db736(0x211)](_0x1db736(0x1de)),0x0;}return await withSpinner(_0x1db736(0x21b),()=>_0xc29d00['jobs']['kill'](_0x50498d),{'verbose':_0x224f57[_0x1db736(0x201)]}),console[_0x1db736(0x211)](_0x1db736(0x207)+_0x50498d),console[_0x1db736(0x211)](_0x1db736(0x1e3)+_0x50498d+_0x1db736(0x206)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1e7);['description']='Submit\x20a\x20job';async[a26_0x4fd919(0x1ce)](_0x1db8d7){const _0x885f27=a26_0x4fd919,{options:_0x17b0d0,args:_0x3499fb,tdx:_0x114f19}=_0x1db8d7,_0x32e44c=_0x17b0d0[_0x885f27(0x212)]||_0x885f27(0x203),_0x2611bb=_0x17b0d0[_0x885f27(0x1ee)],_0x1bfa4b=_0x17b0d0[_0x885f27(0x202)]||_0x885f27(0x1fd),_0x5c6a4b=_0x17b0d0[_0x885f27(0x1f6)];if(_0x32e44c!==_0x885f27(0x203)&&_0x32e44c!==_0x885f27(0x210))throw new SDKError(ErrorCode[_0x885f27(0x220)],_0x885f27(0x21d));let _0x257ecf;if(_0x2611bb){if(_0x3499fb[0x0])throw new SDKError(ErrorCode[_0x885f27(0x220)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x354bd1=readSqlStatementsFromFile(_0x2611bb);if(_0x354bd1[_0x885f27(0x1c8)]===0x0)throw new SDKError(ErrorCode[_0x885f27(0x220)],_0x885f27(0x1fb));if(_0x354bd1[_0x885f27(0x1c8)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x885f27(0x20e));_0x257ecf=_0x354bd1[0x0];}else{if(!_0x3499fb[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x885f27(0x1e4));_0x257ecf=_0x3499fb[0x0];}_0x17b0d0[_0x885f27(0x201)]&&(console[_0x885f27(0x211)]('Job\x20type:\x20'+_0x32e44c),console[_0x885f27(0x211)](_0x885f27(0x213)+_0x1bfa4b),console['error'](_0x885f27(0x222)+_0x257ecf[_0x885f27(0x21c)](0x0,0x64)+(_0x257ecf[_0x885f27(0x1c8)]>0x64?_0x885f27(0x218):'')));const _0x1e2ca1=await withSpinner(_0x885f27(0x1d2),()=>_0x114f19[_0x885f27(0x219)]['submit'](_0x1bfa4b,_0x257ecf,_0x32e44c,_0x5c6a4b),{'verbose':_0x17b0d0[_0x885f27(0x201)]}),_0xd81f9d=_0x1e2ca1[_0x885f27(0x1d8)];return console[_0x885f27(0x211)](_0x885f27(0x1e9)),console[_0x885f27(0x211)]('\x20\x20Job\x20ID:\x20'+_0xd81f9d[_0x885f27(0x1c9)]),await handleSDKOutput([_0xd81f9d],_0x17b0d0),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x4fd919(0x1f5)]=a26_0x4fd919(0x1d4);['description']=a26_0x4fd919(0x1e5);[a26_0x4fd919(0x1eb)](_0x1d88b6){const _0x260a97=a26_0x4fd919,_0x176618=_0x1d88b6['args'][0x0];if(!_0x176618)return _0x260a97(0x221);return undefined;}async[a26_0x4fd919(0x1ce)](_0x3e878e){const _0x4f79bc=a26_0x4fd919,{options:_0x3b23b0,args:_0x4ef9dc,tdx:_0x1691bb}=_0x3e878e,_0x3ef827=_0x4ef9dc[0x0],_0x3a9b23=await withSpinner(_0x4f79bc(0x1c7),()=>_0x1691bb[_0x4f79bc(0x219)]['result'](_0x3ef827),{'verbose':_0x3b23b0[_0x4f79bc(0x201)]}),_0x58bc97=_0x3a9b23[_0x4f79bc(0x1d8)];return console[_0x4f79bc(0x211)]('✔\x20Retrieved\x20'+_0x58bc97[_0x4f79bc(0x1c8)]+_0x4f79bc(0x1e6)+(_0x58bc97[_0x4f79bc(0x1c8)]!==0x1?'s':'')),await handleSDKOutput(_0x58bc97,_0x3b23b0),0x0;}}
|
|
1
|
+
const a26_0x2e5cc9=a26_0x42b9;function a26_0x42b9(_0x594c94,_0x904da){_0x594c94=_0x594c94-0x153;const _0x460002=a26_0x4600();let _0x42b9a0=_0x460002[_0x594c94];return _0x42b9a0;}(function(_0x417099,_0x2763a7){const _0x1e68a5=a26_0x42b9,_0x529cc9=_0x417099();while(!![]){try{const _0x439222=-parseInt(_0x1e68a5(0x17c))/0x1*(-parseInt(_0x1e68a5(0x176))/0x2)+parseInt(_0x1e68a5(0x18a))/0x3+parseInt(_0x1e68a5(0x18b))/0x4*(parseInt(_0x1e68a5(0x188))/0x5)+parseInt(_0x1e68a5(0x192))/0x6*(parseInt(_0x1e68a5(0x168))/0x7)+parseInt(_0x1e68a5(0x155))/0x8+parseInt(_0x1e68a5(0x165))/0x9+parseInt(_0x1e68a5(0x189))/0xa*(-parseInt(_0x1e68a5(0x17d))/0xb);if(_0x439222===_0x2763a7)break;else _0x529cc9['push'](_0x529cc9['shift']());}catch(_0x2d9f27){_0x529cc9['push'](_0x529cc9['shift']());}}}(a26_0x4600,0x2ada2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a26_0x4600(){const _0xb91505=['dim','presto','6875LBtgbs','1640140DmGsSH','532581AdWPxc','460wbOMxz','job:kill','database','INVALID_ARGUMENT','...','✔\x20Retrieved\x20','verbose','6zcXOwe','list','substring','d\x20ago','log','Database:\x20','type','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','green','show','validate','mo\x20ago','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','kill','success','Get\x20job\x20results','trino','args','result','Getting\x20job\x20details...','job:result','abs','status','job:submit','name','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','1494896EdbnbA','getTime','limit','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','map','Submitting\x20job...','Getting\x20job\x20results...','url','m\x20ago','✔\x20Found\x20','Listing\x20jobs...','execute','description','push','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','No\x20SQL\x20statements\x20found\x20in\x20file','415971EMGkHD','Kill\x20a\x20job','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','363587FxbQgH','error','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','priority','submit','Submitting\x20kill\x20request...','start_at','Limit:\x20','query','job_id','length','Submit\x20a\x20job','end_at','debug','60OLfdaY','user_name','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','\x20row','yes','jobType','1563DJqNhs','33TAadpn','data','Show\x20job\x20details','List\x20jobs','created_at','floor','jobs','✔\x20Job\x20submitted','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'];a26_0x4600=function(){return _0xb91505;};return a26_0x4600();}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x1dc756 from'chalk';function formatDuration(_0xa70931){const _0x2dcac9=a26_0x42b9;if(_0xa70931<0x3c)return _0xa70931+'s';if(_0xa70931<0xe10)return Math['floor'](_0xa70931/0x3c)+'m\x20'+_0xa70931%0x3c+'s';const _0x32c156=Math['floor'](_0xa70931/0xe10),_0x32804a=Math[_0x2dcac9(0x182)](_0xa70931%0xe10/0x3c);return _0x32804a>0x0?_0x32c156+'h\x20'+_0x32804a+'m':_0x32c156+'h';}function formatRelativeTime(_0xb563a2){const _0x508204=a26_0x42b9,_0x553346=Date['now']()-_0xb563a2[_0x508204(0x156)](),_0x33abb5=Math[_0x508204(0x182)](Math[_0x508204(0x1a7)](_0x553346)/0x3e8);if(_0x33abb5<0x3c)return'just\x20now';const _0x5891d9=Math[_0x508204(0x182)](_0x33abb5/0x3c);if(_0x5891d9<0x3c)return _0x5891d9+_0x508204(0x15d);const _0x19d35f=Math[_0x508204(0x182)](_0x5891d9/0x3c);if(_0x19d35f<0x18)return _0x19d35f+'h\x20ago';const _0x4100db=Math[_0x508204(0x182)](_0x19d35f/0x18);if(_0x4100db<0x1e)return _0x4100db+_0x508204(0x195);return Math[_0x508204(0x182)](_0x4100db/0x1e)+_0x508204(0x19d);}export class JobListCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x183);[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x180);async[a26_0x2e5cc9(0x160)](_0x3d0b4e){const _0x5f5c9b=a26_0x2e5cc9,{options:_0x5e9071,tdx:_0x362a5d}=_0x3d0b4e,_0x2bd87f=resolveLimit(_0x5e9071[_0x5f5c9b(0x157)],DEFAULT_DISPLAY_LIMIT),_0x25ce4d=_0x5e9071[_0x5f5c9b(0x1a8)];_0x5e9071[_0x5f5c9b(0x191)]&&(console[_0x5f5c9b(0x169)](_0x5f5c9b(0x16f)+_0x2bd87f+'\x20jobs'),_0x25ce4d&&console[_0x5f5c9b(0x169)]('Status\x20filter:\x20'+_0x25ce4d));const _0x5bdca4=await withSpinner(_0x5f5c9b(0x15f),()=>_0x362a5d[_0x5f5c9b(0x183)][_0x5f5c9b(0x193)]({'from':0x0,'to':_0x2bd87f-0x1,'status':_0x25ce4d}),{'verbose':_0x5e9071[_0x5f5c9b(0x191)]}),_0x150768=_0x5bdca4[_0x5f5c9b(0x17e)];console[_0x5f5c9b(0x169)](_0x5f5c9b(0x15e)+_0x150768[_0x5f5c9b(0x172)]+'\x20job'+(_0x150768[_0x5f5c9b(0x172)]!==0x1?'s':''));const _0x4ebf72=_0x5e9071['site'];if(isStructuredFormat(_0x5e9071)){const _0x155f86=_0x150768[_0x5f5c9b(0x159)](_0x394d76=>{const _0x2c4861=_0x5f5c9b;let _0x492284;if(_0x394d76[_0x2c4861(0x16e)]&&_0x394d76['end_at']){const _0x2e7430=new Date(_0x394d76[_0x2c4861(0x16e)])[_0x2c4861(0x156)](),_0x28fe24=new Date(_0x394d76[_0x2c4861(0x174)])['getTime']();_0x492284=Math['round']((_0x28fe24-_0x2e7430)/0x3e8);}return{'job_id':_0x394d76['job_id'],'type':_0x394d76[_0x2c4861(0x198)]===_0x2c4861(0x187)?_0x2c4861(0x1a2):_0x394d76[_0x2c4861(0x198)],'status':_0x394d76[_0x2c4861(0x1a8)],'user_name':_0x394d76[_0x2c4861(0x177)],'duration_sec':_0x492284,'created_at':_0x394d76[_0x2c4861(0x181)],'started_at':_0x394d76['start_at'],'end_at':_0x394d76[_0x2c4861(0x174)]};});await handleSDKOutput(_0x155f86,_0x5e9071);}else for(const _0x481501 of _0x150768){const _0x2bcd50=_0x481501[_0x5f5c9b(0x1a8)]===_0x5f5c9b(0x1a0)?a26_0x1dc756[_0x5f5c9b(0x19a)]:_0x481501[_0x5f5c9b(0x1a8)]===_0x5f5c9b(0x169)?a26_0x1dc756['red']:a26_0x1dc756[_0x5f5c9b(0x186)],_0x335588=_0x2bcd50(_0x481501[_0x5f5c9b(0x1a8)]),_0x57036d=getJobUrl(_0x4ebf72,_0x481501[_0x5f5c9b(0x171)]),_0x55bf24=hyperlink(_0x481501[_0x5f5c9b(0x171)],_0x57036d),_0x2ae34a=a26_0x1dc756['dim'](_0x481501[_0x5f5c9b(0x198)]===_0x5f5c9b(0x187)?_0x5f5c9b(0x1a2):_0x481501[_0x5f5c9b(0x198)]),_0xd7e3c6=[];if(_0x481501[_0x5f5c9b(0x16e)]&&_0x481501[_0x5f5c9b(0x174)]){const _0x36838d=Math['round']((new Date(_0x481501[_0x5f5c9b(0x174)])['getTime']()-new Date(_0x481501['start_at'])[_0x5f5c9b(0x156)]())/0x3e8);_0xd7e3c6[_0x5f5c9b(0x162)](formatDuration(_0x36838d));}if(_0x481501['end_at'])_0xd7e3c6[_0x5f5c9b(0x162)](formatRelativeTime(new Date(_0x481501['end_at'])));else _0x481501[_0x5f5c9b(0x16e)]&&_0xd7e3c6[_0x5f5c9b(0x162)](formatRelativeTime(new Date(_0x481501[_0x5f5c9b(0x16e)])));const _0x3f02df=_0xd7e3c6['length']>0x0?a26_0x1dc756[_0x5f5c9b(0x186)]('\x20'+_0xd7e3c6['join'](',\x20')):'';console[_0x5f5c9b(0x196)]('⚡\x20'+_0x55bf24+'\x20'+_0x2ae34a+'\x20'+_0x335588+_0x3f02df);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x17f);[a26_0x2e5cc9(0x19c)](_0x44f9b9){const _0x590cd1=a26_0x2e5cc9,_0x3b37ed=_0x44f9b9[_0x590cd1(0x1a3)][0x0];if(!_0x3b37ed)return _0x590cd1(0x178);return undefined;}async['execute'](_0x251d76){const _0x25223e=a26_0x2e5cc9,{options:_0x5dd776,args:_0x257a57,tdx:_0x59d781}=_0x251d76,_0x20e9f4=_0x257a57[0x0],_0x25c7d6=await withSpinner(_0x25223e(0x1a5),()=>_0x59d781[_0x25223e(0x183)][_0x25223e(0x19b)](_0x20e9f4),{'verbose':_0x5dd776[_0x25223e(0x191)]}),_0x49fbb8=_0x25c7d6[_0x25223e(0x17e)];let _0x3a9219;if(_0x49fbb8[_0x25223e(0x16e)]&&_0x49fbb8[_0x25223e(0x174)]){const _0x270a68=new Date(_0x49fbb8[_0x25223e(0x16e)])[_0x25223e(0x156)](),_0x1a9d1b=new Date(_0x49fbb8[_0x25223e(0x174)])[_0x25223e(0x156)]();_0x3a9219=Math['round']((_0x1a9d1b-_0x270a68)/0x3e8);}const _0x918a07={'job_id':_0x49fbb8['job_id'],'type':_0x49fbb8[_0x25223e(0x198)],'status':_0x49fbb8[_0x25223e(0x1a8)],..._0x49fbb8[_0x25223e(0x177)]&&{'user_name':_0x49fbb8[_0x25223e(0x177)]},..._0x3a9219!==undefined&&{'duration_sec':_0x3a9219},..._0x49fbb8[_0x25223e(0x181)]&&{'created_at':_0x49fbb8['created_at']},..._0x49fbb8[_0x25223e(0x16e)]&&{'started_at':_0x49fbb8['start_at']},..._0x49fbb8[_0x25223e(0x174)]&&{'end_at':_0x49fbb8[_0x25223e(0x174)]},..._0x49fbb8['database']&&{'database':_0x49fbb8[_0x25223e(0x18d)]},..._0x49fbb8['priority']!==undefined&&{'priority':_0x49fbb8[_0x25223e(0x16b)]},..._0x49fbb8[_0x25223e(0x15c)]&&{'url':_0x49fbb8['url']},..._0x49fbb8['query']&&{'query':_0x49fbb8[_0x25223e(0x170)]},..._0x49fbb8[_0x25223e(0x175)]&&{'debug':_0x49fbb8[_0x25223e(0x175)]}};return await handleSingleObjectOutput(_0x918a07,_0x5dd776),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x18c);['description']=a26_0x2e5cc9(0x166);['validate'](_0x40b8d2){const _0x575548=a26_0x2e5cc9,_0x1465d6=_0x40b8d2[_0x575548(0x1a3)][0x0];if(!_0x1465d6)return _0x575548(0x163);return undefined;}async[a26_0x2e5cc9(0x160)](_0x3c51b7){const _0x3267e0=a26_0x2e5cc9,{options:_0x4c2e8e,args:_0x4af19d,tdx:_0x6e2583}=_0x3c51b7,_0x36b1aa=_0x4af19d[0x0];if(!_0x4c2e8e[_0x3267e0(0x17a)]){const _0x325467=await confirm(_0x3267e0(0x19e)+_0x36b1aa+'?');if(!_0x325467)return console['error']('Cancelled'),0x0;}return await withSpinner(_0x3267e0(0x16d),()=>_0x6e2583['jobs'][_0x3267e0(0x19f)](_0x36b1aa),{'verbose':_0x4c2e8e['verbose']}),console[_0x3267e0(0x169)](_0x3267e0(0x154)+_0x36b1aa),console['error'](_0x3267e0(0x167)+_0x36b1aa+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x2e5cc9(0x153)]=a26_0x2e5cc9(0x1a9);['description']=a26_0x2e5cc9(0x173);async[a26_0x2e5cc9(0x160)](_0x3b8394){const _0x157188=a26_0x2e5cc9,{options:_0x9a984,args:_0x21616e,tdx:_0x173f8f}=_0x3b8394,_0x425b7c=_0x9a984[_0x157188(0x17b)]||_0x157188(0x1a2),_0x26eb14=_0x9a984['file'],_0x2f9729=_0x9a984['database']||'information_schema',_0x4487dc=_0x9a984['result'];if(_0x425b7c!==_0x157188(0x1a2)&&_0x425b7c!=='hive')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x157188(0x16a));let _0x1b705f;if(_0x26eb14){if(_0x21616e[0x0])throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x158));const _0x25d03a=readSqlStatementsFromFile(_0x26eb14);if(_0x25d03a[_0x157188(0x172)]===0x0)throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x164));if(_0x25d03a[_0x157188(0x172)]>0x1)throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x185));_0x1b705f=_0x25d03a[0x0];}else{if(!_0x21616e[0x0])throw new SDKError(ErrorCode[_0x157188(0x18e)],_0x157188(0x199));_0x1b705f=_0x21616e[0x0];}_0x9a984[_0x157188(0x191)]&&(console[_0x157188(0x169)]('Job\x20type:\x20'+_0x425b7c),console['error'](_0x157188(0x197)+_0x2f9729),console['error']('Query:\x20'+_0x1b705f[_0x157188(0x194)](0x0,0x64)+(_0x1b705f[_0x157188(0x172)]>0x64?_0x157188(0x18f):'')));const _0x44f162=await withSpinner(_0x157188(0x15a),()=>_0x173f8f[_0x157188(0x183)][_0x157188(0x16c)](_0x2f9729,_0x1b705f,_0x425b7c,_0x4487dc),{'verbose':_0x9a984[_0x157188(0x191)]}),_0x25fec7=_0x44f162[_0x157188(0x17e)];return console[_0x157188(0x169)](_0x157188(0x184)),console[_0x157188(0x169)]('\x20\x20Job\x20ID:\x20'+_0x25fec7[_0x157188(0x171)]),await handleSDKOutput([_0x25fec7],_0x9a984),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a26_0x2e5cc9(0x1a6);[a26_0x2e5cc9(0x161)]=a26_0x2e5cc9(0x1a1);[a26_0x2e5cc9(0x19c)](_0x8e2ef1){const _0x4c216a=a26_0x2e5cc9,_0xc95241=_0x8e2ef1[_0x4c216a(0x1a3)][0x0];if(!_0xc95241)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x2e5cc9(0x160)](_0x539c26){const _0x59575b=a26_0x2e5cc9,{options:_0x3872a9,args:_0x48305c,tdx:_0xba2d6d}=_0x539c26,_0x5b0607=_0x48305c[0x0],_0x23ed90=await withSpinner(_0x59575b(0x15b),()=>_0xba2d6d[_0x59575b(0x183)][_0x59575b(0x1a4)](_0x5b0607),{'verbose':_0x3872a9['verbose']}),_0x5659d8=_0x23ed90[_0x59575b(0x17e)];return console[_0x59575b(0x169)](_0x59575b(0x190)+_0x5659d8[_0x59575b(0x172)]+_0x59575b(0x179)+(_0x5659d8[_0x59575b(0x172)]!==0x1?'s':'')),await handleSDKOutput(_0x5659d8,_0x3872a9),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x511dbc=a27_0x1a99;(function(_0xe64560,_0x25c92d){const _0x13ceea=a27_0x1a99,_0x1df65f=_0xe64560();while(!![]){try{const _0x245dd5=parseInt(_0x13ceea(0x29a))/0x1*(parseInt(_0x13ceea(0x1ed))/0x2)+parseInt(_0x13ceea(0x2cd))/0x3*(-parseInt(_0x13ceea(0x217))/0x4)+-parseInt(_0x13ceea(0x2c6))/0x5+parseInt(_0x13ceea(0x2a7))/0x6+parseInt(_0x13ceea(0x1d3))/0x7+-parseInt(_0x13ceea(0x27c))/0x8*(parseInt(_0x13ceea(0x1e9))/0x9)+-parseInt(_0x13ceea(0x291))/0xa*(-parseInt(_0x13ceea(0x1fe))/0xb);if(_0x245dd5===_0x25c92d)break;else _0x1df65f['push'](_0x1df65f['shift']());}catch(_0x13e1e9){_0x1df65f['push'](_0x1df65f['shift']());}}}(a27_0x215c,0xa2451));import a27_0x43744a from'chalk';import a27_0x303d57 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';function a27_0x1a99(_0x1a91ee,_0xcaad39){_0x1a91ee=_0x1a91ee-0x1c7;const _0x215c59=a27_0x215c();let _0x1a9982=_0x215c59[_0x1a91ee];return _0x1a9982;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x28c9c5){const _0x41f619=a27_0x1a99;return!_0x28c9c5&&(console[_0x41f619(0x290)](_0x41f619(0x24e)),console[_0x41f619(0x290)](_0x41f619(0x21b))),!!_0x28c9c5;}function withJsonFormat(_0x306828){const _0x276579=a27_0x1a99;if(!_0x306828['format']&&!_0x306828[_0x276579(0x25b)]&&!_0x306828[_0x276579(0x1cd)]&&!_0x306828[_0x276579(0x250)])return{..._0x306828,'format':_0x276579(0x25b),'json':!![]};return _0x306828;}function formatJourneyState(_0x585232){const _0x1e8827=a27_0x1a99;switch(_0x585232){case _0x1e8827(0x242):return a27_0x43744a[_0x1e8827(0x29c)]('(running)');case _0x1e8827(0x1d4):return a27_0x43744a['dim'](_0x1e8827(0x1e4));case _0x1e8827(0x203):return a27_0x43744a[_0x1e8827(0x294)](_0x1e8827(0x1c7));case _0x1e8827(0x1ff):return a27_0x43744a['blue'](_0x1e8827(0x222));case _0x1e8827(0x1f2):return a27_0x43744a[_0x1e8827(0x23d)](_0x1e8827(0x23e));default:return'('+_0x585232+')';}}function formatJourneyItem(_0x2639d1,_0x6ea31a='',_0x138eff){const _0x1b77c1=a27_0x1a99,_0x2cdc85=formatJourneyState(_0x2639d1[_0x1b77c1(0x24f)]),_0x5853a0=_0x138eff?hyperlink(_0x2639d1[_0x1b77c1(0x2bb)],_0x138eff):_0x2639d1['journeyBundleName'];return _0x6ea31a+'🗺️\x20'+_0x5853a0+'\x20'+_0x2cdc85;}function escapeRegex(_0x195215){const _0x58da43=a27_0x1a99;return _0x195215[_0x58da43(0x25a)](/[.*+?^${}()|[\]\\]/g,_0x58da43(0x22f));}function globToRegex(_0x51428c){const _0x376c19=a27_0x1a99,_0x571374=_0x51428c[_0x376c19(0x260)]('*')[_0x376c19(0x20c)](escapeRegex);return new RegExp(_0x571374[_0x376c19(0x299)]('.*'),'i');}function buildRuleToNameMapping(_0x14fd26){const _0x50284d=a27_0x1a99,_0x3219ef=new Map();if(_0x14fd26[_0x50284d(0x24b)])for(const [_0x2fe671,_0x56fe2f]of Object[_0x50284d(0x1cb)](_0x14fd26['segments'])){if(_0x56fe2f[_0x50284d(0x1d8)]){const _0x2ccbcb=serializeRule(_0x56fe2f[_0x50284d(0x1d8)]),_0x46c1aa=_0x3219ef[_0x50284d(0x1f9)](_0x2ccbcb);_0x46c1aa?_0x46c1aa['push'](_0x2fe671):_0x3219ef[_0x50284d(0x2b0)](_0x2ccbcb,[_0x2fe671]);}}return _0x3219ef;}async function resolveJourneyIdFromInput(_0x8f38c0,_0x8ccd76,_0x14d589){const _0x48f785=a27_0x1a99,_0xe449ac=await resolveJourneyTarget(_0x8f38c0,_0x8ccd76[_0x48f785(0x220)],_0x8ccd76[_0x48f785(0x1e3)]),_0x2637d3=_0xe449ac[_0x48f785(0x220)];if(!_0x2637d3)throw new SDKError(ErrorCode[_0x48f785(0x1e2)],_0x48f785(0x1fa));const _0x138fca=await withSpinner(_0x48f785(0x2c3),()=>_0x14d589['segment'][_0x48f785(0x21f)](_0x2637d3),{'verbose':_0x8ccd76[_0x48f785(0x1e3)]}),_0x13e18b=_0x138fca['data'],_0xc6bda0=await withSpinner(_0x48f785(0x2cc),()=>_0x14d589[_0x48f785(0x24d)]['resolveJourneyId'](_0x13e18b,_0xe449ac[_0x48f785(0x25e)]),{'verbose':_0x8ccd76[_0x48f785(0x1e3)]});return{'journeyId':_0xc6bda0['data'],'journeyName':_0xe449ac['journeyName'],'parentSegmentId':_0x13e18b};}async function resolveJourneyTarget(_0x17f3c0,_0x30eceb,_0x2e6eea){const _0x397c6c=a27_0x1a99;if(isYamlFilePath(_0x17f3c0))try{const _0x20ec0c=await resolveYamlFilePath(_0x17f3c0);return _0x2e6eea&&(console[_0x397c6c(0x290)](_0x397c6c(0x28d)+_0x17f3c0),console[_0x397c6c(0x290)](_0x397c6c(0x27f)+_0x20ec0c['parentSegment']),console[_0x397c6c(0x290)]('\x20\x20Name:\x20'+_0x20ec0c['segmentName']),console[_0x397c6c(0x290)](_0x397c6c(0x25c)+(_0x20ec0c[_0x397c6c(0x27b)]||_0x397c6c(0x23b)))),{'journeyName':_0x20ec0c[_0x397c6c(0x27d)],'parentSegment':_0x20ec0c[_0x397c6c(0x220)],'resolved':_0x20ec0c};}catch(_0x5dd925){throw new SDKError(ErrorCode[_0x397c6c(0x1e2)],_0x397c6c(0x21e)+_0x5dd925[_0x397c6c(0x28e)]);}if(!_0x30eceb)throw new SDKError(ErrorCode[_0x397c6c(0x1e2)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x17f3c0,'parentSegment':_0x30eceb};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x511dbc(0x225)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x511dbc(0x229)](_0x3a9a22){const _0xed7d61=a27_0x511dbc,{options:_0x5d4b4e,args:_0x55aabd,tdx:_0x3e5c7d}=_0x3a9a22,_0x4d24c4=_0x55aabd[0x0],_0x4b48ee=_0x5d4b4e['parentSegment'];if(!_0x4b48ee)return console[_0xed7d61(0x290)](_0xed7d61(0x213)),console[_0xed7d61(0x290)](_0xed7d61(0x241)),0x1;const _0x6be85e=await withSpinner(_0xed7d61(0x2c3),()=>_0x3e5c7d['segment'][_0xed7d61(0x21f)](_0x4b48ee),{'verbose':_0x5d4b4e[_0xed7d61(0x1e3)]}),_0x4aad3b=_0x6be85e[_0xed7d61(0x253)];_0x5d4b4e[_0xed7d61(0x1e3)]&&(console[_0xed7d61(0x290)](_0xed7d61(0x2b5)+_0x4b48ee+_0xed7d61(0x1d7)+_0x4aad3b+')'),_0x4d24c4&&console[_0xed7d61(0x290)]('Pattern:\x20'+_0x4d24c4));const _0x4d99dd=await withSpinner(_0xed7d61(0x240),()=>_0x3e5c7d[_0xed7d61(0x207)]['getParentFull'](_0x4aad3b),{'verbose':_0x5d4b4e['verbose']}),_0x315711=_0x4d99dd[_0xed7d61(0x253)],_0x4a6aca=_0x315711[_0xed7d61(0x1ca)],_0x3d1517=await withSpinner(_0xed7d61(0x243),()=>_0x3e5c7d[_0xed7d61(0x24d)][_0xed7d61(0x20d)](_0x4aad3b,_0x4a6aca),{'verbose':_0x5d4b4e[_0xed7d61(0x1e3)]});let _0x57f69f=_0x3d1517[_0xed7d61(0x253)]['journeys'];const _0x25e973=_0x3d1517[_0xed7d61(0x253)]['folders'],_0x3f490d=new Map();for(const _0x4e8f25 of _0x25e973){_0x3f490d['set'](_0x4e8f25['id'],_0x4e8f25[_0xed7d61(0x2ac)]);}if(_0x4d24c4){const _0x4110ae=globToRegex(_0x4d24c4);_0x57f69f=_0x57f69f[_0xed7d61(0x266)](_0x501ff6=>_0x4110ae[_0xed7d61(0x20f)](_0x501ff6[_0xed7d61(0x2bb)]));}console[_0xed7d61(0x290)]('✔\x20Found\x20'+_0x57f69f[_0xed7d61(0x284)]+_0xed7d61(0x20a)+(_0x57f69f[_0xed7d61(0x284)]!==0x1?'s':''));const _0x351eae=_0xe55dce=>{const _0x346d2a=_0xed7d61;return getConsoleNextUrl(_0x5d4b4e[_0x346d2a(0x2b8)],_0x346d2a(0x236)+_0x4aad3b+'/e/'+_0xe55dce+_0x346d2a(0x2bd));};if(_0x5d4b4e[_0xed7d61(0x1ce)]==='table')await handleSDKOutput(_0x57f69f,_0x5d4b4e);else{if(_0x5d4b4e[_0xed7d61(0x1ce)]===_0xed7d61(0x25b)){const _0xb81f83=_0x57f69f[_0xed7d61(0x20c)](_0x324f17=>({..._0x324f17,'url':_0x351eae(_0x324f17['id'])}));await handleSDKOutput(_0xb81f83,_0x5d4b4e);}else{console[_0xed7d61(0x279)]('['+_0x4b48ee+']');const _0x11878c=new Map(),_0x5260e9=[];for(const _0x1a0a7f of _0x57f69f){if(!_0x1a0a7f[_0xed7d61(0x216)]||_0x1a0a7f[_0xed7d61(0x216)]===_0x4a6aca)_0x5260e9[_0xed7d61(0x202)](_0x1a0a7f);else{const _0x4fefb8=_0x11878c[_0xed7d61(0x1f9)](_0x1a0a7f['folderId'])||[];_0x4fefb8[_0xed7d61(0x202)](_0x1a0a7f),_0x11878c[_0xed7d61(0x2b0)](_0x1a0a7f['folderId'],_0x4fefb8);}}const _0x3f06d6=(_0x337f3b,_0x46a208)=>_0x337f3b[_0xed7d61(0x2bb)][_0xed7d61(0x285)](_0x46a208['journeyBundleName'],undefined,{'sensitivity':_0xed7d61(0x280)});_0x5260e9[_0xed7d61(0x234)](_0x3f06d6);for(const _0xbdcc87 of _0x5260e9){console[_0xed7d61(0x279)](formatJourneyItem(_0xbdcc87,'',_0x351eae(_0xbdcc87['id'])));}const _0x585473=[..._0x11878c[_0xed7d61(0x1cb)]()][_0xed7d61(0x234)]((_0x2e7e0b,_0x16d70e)=>{const _0x589935=_0xed7d61,_0x1f6ef7=_0x3f490d[_0x589935(0x1f9)](_0x2e7e0b[0x0])||_0x2e7e0b[0x0],_0x5d0405=_0x3f490d['get'](_0x16d70e[0x0])||_0x16d70e[0x0];return _0x1f6ef7[_0x589935(0x285)](_0x5d0405,undefined,{'sensitivity':_0x589935(0x280)});});for(const [_0x21b4f1,_0x9923bf]of _0x585473){const _0xbccc7d=_0x3f490d['get'](_0x21b4f1)||_0x21b4f1;console[_0xed7d61(0x279)](_0xed7d61(0x230)+_0xbccc7d),_0x9923bf[_0xed7d61(0x234)](_0x3f06d6);for(const _0x2b72c2 of _0x9923bf){console[_0xed7d61(0x279)](formatJourneyItem(_0x2b72c2,'\x20\x20',_0x351eae(_0x2b72c2['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x28b);[a27_0x511dbc(0x225)]='Show\x20journey\x20details';async['execute'](_0xf7b1c2){const _0x514c81=a27_0x511dbc,{options:_0xd563c8,args:_0x193302,tdx:_0x245e47}=_0xf7b1c2,_0x543fd4=_0x193302[0x0];if(!_0x543fd4)return console[_0x514c81(0x290)](_0x514c81(0x24e)),console[_0x514c81(0x290)](_0x514c81(0x1d6)),console[_0x514c81(0x290)](_0x514c81(0x1f6)),console[_0x514c81(0x290)](_0x514c81(0x255)),0x1;_0xd563c8[_0x514c81(0x1e3)]&&console[_0x514c81(0x290)](_0x514c81(0x257)+_0x543fd4);const {journeyId:_0x1f7a98,parentSegmentId:_0x54f891}=await resolveJourneyIdFromInput(_0x543fd4,_0xd563c8,_0x245e47);if(_0xd563c8[_0x514c81(0x264)]){const _0x138bc9=getConsoleNextUrl(_0xd563c8['site'],_0x514c81(0x236)+_0x54f891+_0x514c81(0x1dd)+_0x1f7a98+_0x514c81(0x23a));return console[_0x514c81(0x290)](a27_0x43744a['green']('✔')+_0x514c81(0x2c0)+a27_0x43744a['cyan'](_0x138bc9)),openBrowser(_0x138bc9),0x0;}const _0x3dad8c=await withSpinner(_0x514c81(0x1e0),()=>_0x245e47['journey'][_0x514c81(0x1fb)](_0x1f7a98),{'verbose':_0xd563c8[_0x514c81(0x1e3)]}),_0x41ba43=_0x3dad8c[_0x514c81(0x253)],_0x39d9f3=_0xd563c8[_0x514c81(0x2c1)];let _0x3a91e2;if(_0x39d9f3)try{const _0x134913=await withSpinner(_0x514c81(0x28c),()=>_0x245e47[_0x514c81(0x24d)][_0x514c81(0x226)](_0x1f7a98),{'verbose':_0xd563c8[_0x514c81(0x1e3)]});_0x3a91e2=_0x134913[_0x514c81(0x253)];}catch{_0xd563c8[_0x514c81(0x1e3)]&&console[_0x514c81(0x290)](_0x514c81(0x26f));}const _0x2e21d9=getConsoleNextUrl(_0xd563c8[_0x514c81(0x2b8)],_0x514c81(0x236)+_0x54f891+_0x514c81(0x1dd)+_0x1f7a98+_0x514c81(0x23a)),_0x2e3722={'id':_0x41ba43['id'],'name':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x2ac)],'description':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x225)],'state':_0x41ba43['attributes'][_0x514c81(0x24f)],'paused':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x203)],'reentry_mode':_0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x206)],'stages':_0x41ba43[_0x514c81(0x1e5)]['journeyStages']?.['length']||0x0,..._0x41ba43[_0x514c81(0x1e5)][_0x514c81(0x292)]&&{'goal':_0x41ba43[_0x514c81(0x1e5)]['goal'][_0x514c81(0x2ac)]},..._0x3a91e2&&{'statistics':{'size':_0x3a91e2['size'],'entered':_0x3a91e2['enteredSize'],'goal_achieved':_0x3a91e2[_0x514c81(0x2a1)],'completion_rate':_0x3a91e2[_0x514c81(0x23c)],'exit_or_jump':_0x3a91e2['exitOrJumpSize'],'exit_or_jump_rate':_0x3a91e2['exitOrJumpRate'],'stages':_0x3a91e2[_0x514c81(0x2b9)]}},'url':_0x2e21d9};return await handleSingleObjectOutput(_0x2e3722,_0xd563c8),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:stats';[a27_0x511dbc(0x225)]='Show\x20journey\x20statistics';async['execute'](_0x14700b){const _0x4774e1=a27_0x511dbc,{options:_0x5cf05a,args:_0x45db6b,tdx:_0x576cab}=_0x14700b,_0x48bf32=_0x45db6b[0x0];if(!requireNameOrPath(_0x48bf32))return 0x1;_0x5cf05a[_0x4774e1(0x1e3)]&&console[_0x4774e1(0x290)](_0x4774e1(0x257)+_0x48bf32);const _0x35d477=_0x5cf05a,_0x377900=_0x35d477[_0x4774e1(0x1f1)],_0x12461d=_0x35d477['to'],_0x3a77f2=_0x35d477[_0x4774e1(0x2bc)],_0x29cf6f=_0x35d477[_0x4774e1(0x227)];_0x3a77f2&&!_0x377900&&!_0x12461d&&console[_0x4774e1(0x290)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x721956=_0x3a77f2?withJsonFormat(_0x5cf05a):_0x5cf05a,{journeyId:_0x4ca1f4,journeyName:_0x50621c}=await resolveJourneyIdFromInput(_0x48bf32,_0x721956,_0x576cab),_0x50bcb4=_0x377900||_0x12461d?{'from':_0x377900,'to':_0x12461d}:undefined,_0x310af4=await withSpinner(_0x4774e1(0x28c),()=>Promise[_0x4774e1(0x245)]([_0x576cab[_0x4774e1(0x24d)][_0x4774e1(0x1fb)](_0x4ca1f4),_0x576cab[_0x4774e1(0x24d)]['getStatistics'](_0x4ca1f4,_0x50bcb4)]),{'verbose':_0x721956[_0x4774e1(0x1e3)]}),[_0x1aaacb,_0x8a4a34]=_0x310af4['data'];if(!_0x8a4a34||_0x8a4a34[_0x4774e1(0x2a5)]===null)return console[_0x4774e1(0x290)](_0x4774e1(0x247)+_0x50621c),console[_0x4774e1(0x290)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x42a78d=buildStageNameMap(_0x1aaacb),_0x252258=!!(_0x50bcb4&&_0x8a4a34['history']?.[_0x4774e1(0x284)]),_0x1f5a81={'stageNameMap':_0x42a78d,'hasPeriod':_0x252258,'includeHistory':!!_0x3a77f2};if(_0x29cf6f&&_0x8a4a34[_0x4774e1(0x2b9)]){const _0x4ccf0d=_0x8a4a34[_0x4774e1(0x2b9)][_0x4774e1(0x239)](_0x5d4c79=>{const _0x13e4d2=_0x4774e1,_0x1c3e28=_0x42a78d['get'](_0x5d4c79['id'])??'';return _0x1c3e28['toLowerCase']()===_0x29cf6f[_0x13e4d2(0x273)]();});if(_0x4ccf0d)return await handleSingleObjectOutput(formatStageStats(_0x4ccf0d,_0x1f5a81),_0x721956),0x0;const _0x2ca367=_0x8a4a34[_0x4774e1(0x2b9)][_0x4774e1(0x20c)](_0x4c7699=>_0x42a78d[_0x4774e1(0x1f9)](_0x4c7699['id'])??_0x4c7699['id']);return console[_0x4774e1(0x290)](_0x4774e1(0x28a)+_0x29cf6f+_0x4774e1(0x20e)),console[_0x4774e1(0x290)](_0x4774e1(0x26c)+_0x2ca367[_0x4774e1(0x299)](',\x20')),0x1;}const _0x3c4050=_0x8a4a34[_0x4774e1(0x2b9)]?.['map'](_0x5db373=>formatStageStats(_0x5db373,_0x1f5a81)),_0x136a5c=assembleJourneyStats(_0x8a4a34,{'from':_0x377900,'to':_0x12461d,'includeHistory':_0x3a77f2});return await this[_0x4774e1(0x258)](_0x136a5c,_0x3c4050??[],_0x721956),0x0;}async['renderStats'](_0x5ae606,_0x45cf32,_0x17b7ca){const _0x5dcb50=a27_0x511dbc,_0xc3e9bf=_0x17b7ca['format']==='json'||_0x17b7ca[_0x5dcb50(0x1ce)]===_0x5dcb50(0x1cd)||_0x17b7ca[_0x5dcb50(0x25b)]||_0x17b7ca[_0x5dcb50(0x1cd)];if(_0xc3e9bf){_0x5ae606['stages']=_0x45cf32,await handleSingleObjectOutput(_0x5ae606,_0x17b7ca);return;}await handleSingleObjectOutput(_0x5ae606,_0x17b7ca);for(const _0x317783 of _0x45cf32){console['log'](''),console[_0x5dcb50(0x279)](String(a27_0x43744a[_0x5dcb50(0x232)]['bold']('['+_0x317783[_0x5dcb50(0x2ac)]+']'))+a27_0x43744a[_0x5dcb50(0x23d)]('\x20'+_0x317783['id']));const {id:_0x194aeb,name:_0x4146b7,..._0x2e62bd}=_0x317783;await handleSingleObjectOutput(_0x2e62bd,_0x17b7ca);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x246);['description']=a27_0x511dbc(0x219);async[a27_0x511dbc(0x229)](_0x56aec2){const _0xfd53cf=a27_0x511dbc,{options:_0x53e6bb,args:_0x15585a,tdx:_0x4823df}=_0x56aec2,_0xdbecc7=_0x15585a[0x0];if(!requireNameOrPath(_0xdbecc7))return 0x1;_0x53e6bb['verbose']&&console[_0xfd53cf(0x290)](_0xfd53cf(0x257)+_0xdbecc7);const _0x406d2c=_0x53e6bb,_0x5c9761=_0x406d2c[_0xfd53cf(0x26d)],_0x3e88c3=_0x406d2c['from'],_0x229b2b=_0x406d2c['to'],_0x46a257=_0x406d2c[_0xfd53cf(0x261)];if(_0x5c9761&&_0x5c9761!==_0xfd53cf(0x2a6)&&_0x5c9761!==_0xfd53cf(0x214))return console['error'](_0xfd53cf(0x2b1)+_0x5c9761+_0xfd53cf(0x21a)),0x1;const _0xbc0c01=withJsonFormat(_0x53e6bb),{journeyId:_0x2a500a,journeyName:_0x455c09}=await resolveJourneyIdFromInput(_0xdbecc7,_0xbc0c01,_0x4823df),_0x283c8e={'type':_0x5c9761,'from':_0x3e88c3,'to':_0x229b2b,'limit':_0x46a257},_0x40e6cb=await withSpinner(_0xfd53cf(0x21d),()=>_0x4823df[_0xfd53cf(0x24d)][_0xfd53cf(0x282)](_0x2a500a,_0x283c8e),{'verbose':_0xbc0c01[_0xfd53cf(0x1e3)]}),_0x39f174=_0x40e6cb['data'],_0x4caffd=_0x39f174[_0xfd53cf(0x2a6)]&&(_0x39f174['conversion'][_0xfd53cf(0x2c4)]['length']>0x0||_0x39f174[_0xfd53cf(0x2a6)][_0xfd53cf(0x29e)][_0xfd53cf(0x284)]>0x0),_0xe0120d=_0x39f174[_0xfd53cf(0x214)]&&_0x39f174[_0xfd53cf(0x214)][_0xfd53cf(0x284)]>0x0;if(!_0x4caffd&&!_0xe0120d)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x455c09),console[_0xfd53cf(0x290)](_0xfd53cf(0x274)),_0x3e88c3&&_0x229b2b&&console['error']('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x39f174,_0xbc0c01),0x0;}}function formatStageStats(_0x410a5d,_0x2b73e2){const _0x575516=a27_0x511dbc,_0x946736=_0x2b73e2['hasPeriod']&&_0x410a5d[_0x575516(0x2c5)]?.['length']?aggregateStageHistory(_0x410a5d['history']):{'size':_0x410a5d[_0x575516(0x201)],'entered':_0x410a5d[_0x575516(0x210)],'milestone':_0x410a5d['milestoneSize'],'milestone_rate':_0x410a5d['completeMilestoneRate'],'exit_or_jump':_0x410a5d[_0x575516(0x2cb)],'exit_or_jump_rate':_0x410a5d[_0x575516(0x1dc)]},_0x163aee={'id':_0x410a5d['id'],'name':_0x2b73e2['stageNameMap'][_0x575516(0x1f9)](_0x410a5d['id'])??_0x410a5d['id'],..._0x946736};return _0x2b73e2[_0x575516(0x224)]&&_0x2b73e2['includeHistory']&&_0x410a5d[_0x575516(0x2c5)]&&(_0x163aee[_0x575516(0x2c5)]=_0x410a5d[_0x575516(0x2c5)]),_0x163aee;}export class JourneyPauseCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x1eb);[a27_0x511dbc(0x225)]=a27_0x511dbc(0x24a);async[a27_0x511dbc(0x229)](_0x7e0167){const _0x4cacfb=a27_0x511dbc,{options:_0x5ba591,args:_0x20ece1,tdx:_0x4d65f3}=_0x7e0167,_0x36ed7c=_0x20ece1[0x0];if(!requireNameOrPath(_0x36ed7c))return 0x1;_0x5ba591[_0x4cacfb(0x1e3)]&&console[_0x4cacfb(0x290)]('Input:\x20'+_0x36ed7c);const {journeyId:_0x1c2f70,journeyName:_0x3f13cc}=await resolveJourneyIdFromInput(_0x36ed7c,_0x5ba591,_0x4d65f3);if(!_0x5ba591[_0x4cacfb(0x1cf)]){const _0x5097d8=await confirm(_0x4cacfb(0x2a2)+_0x3f13cc+'\x22?');if(!_0x5097d8)return console[_0x4cacfb(0x290)](_0x4cacfb(0x259)),0x0;}const _0x1e4a44=await withSpinner(_0x4cacfb(0x1de),()=>_0x4d65f3[_0x4cacfb(0x24d)][_0x4cacfb(0x254)](_0x1c2f70),{'verbose':_0x5ba591[_0x4cacfb(0x1e3)]}),_0x4efcdc=_0x1e4a44[_0x4cacfb(0x253)];return console[_0x4cacfb(0x290)](_0x4cacfb(0x25d)+_0x4efcdc[_0x4cacfb(0x1e5)][_0x4cacfb(0x2ac)]+_0x4cacfb(0x2ad)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:resume';[a27_0x511dbc(0x225)]='Resume\x20a\x20paused\x20journey';async[a27_0x511dbc(0x229)](_0x369920){const _0x268665=a27_0x511dbc,{options:_0x26a731,args:_0x1559cc,tdx:_0x4fac32}=_0x369920,_0x1f2b8c=_0x1559cc[0x0];if(!requireNameOrPath(_0x1f2b8c))return 0x1;_0x26a731[_0x268665(0x1e3)]&&console[_0x268665(0x290)](_0x268665(0x257)+_0x1f2b8c);const {journeyId:_0x3eae6f,journeyName:_0x13b547}=await resolveJourneyIdFromInput(_0x1f2b8c,_0x26a731,_0x4fac32);if(!_0x26a731[_0x268665(0x1cf)]){const _0x5de853=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x13b547+'\x22?');if(!_0x5de853)return console[_0x268665(0x290)](_0x268665(0x259)),0x0;}const _0x4ea8bc=await withSpinner('Resuming\x20journey...',()=>_0x4fac32['journey']['resume'](_0x3eae6f),{'verbose':_0x26a731[_0x268665(0x1e3)]}),_0x39f45a=_0x4ea8bc[_0x268665(0x253)];return console[_0x268665(0x290)](_0x268665(0x25d)+_0x39f45a['attributes']['name']+_0x268665(0x2cf)),0x0;}}function a27_0x215c(){const _0x48abbf=['replace','json','\x20\x20Folder\x20path:\x20','✔\x20Journey\x20\x22','journeyName','\x20journeys','split','limit','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Found\x20','web','resolveSegment','filter','Getting\x20column\x20mapping...','\x27\x20not\x20found\x20in\x20','table','isNew','\x20files?','Available\x20stages:\x20','type','\x20Created\x20v','\x20\x20Statistics\x20not\x20available','Warning:\x20Could\x20not\x20resolve\x20activation\x20','session','stringify','toLowerCase','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','values','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','log','cwd','folderPath','16ikekEx','segmentName','getSegment','\x20\x20Parent\x20segment:\x20','base','file','getTrafficData','getActivation','length','localeCompare','Journey\x20name:\x20','buildIdToNameMap','\x20(draft)\x20—\x20\x22','\x20version','Error:\x20Stage\x20\x22','journey:view','Getting\x20journey\x20statistics...','Resolved\x20YAML\x20file:\x20','message','hasChanges','error','10ttkwCQ','goal','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','yellow','listFolders','listJourneysFromParentSegment','add','options','join','408GhmxMz','Warning:\x20Could\x20not\x20resolve\x20segment\x20','green','journey:pull','links','listActivationsFlat','\x20activation','goalSize','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20Version\x20','journeyId','conversion','4782954fgTltZ','Folder\x20path:\x20',',\x20version:\x20','setPhase','audienceId','name','\x22\x20paused','List\x20all\x20versions\x20of\x20a\x20journey','createdAt','set','Error:\x20Invalid\x20--type\x20\x22','absolutePath','errorCode','Fetching\x20','Parent\x20segment:\x20','journey:versions','parent_segment','site','stages','journey:version:create','journeyBundleName','includeHistory','/j/da','versionNumber','activationParams','\x20Opening\x20','includeStats','...','Resolving\x20parent\x20segment...','nodes','history','4525565fWongF','Listing\x20journey\x20activations...','red','Fetching\x20users\x20and\x20connections...','helpText','exitOrJumpSize','Resolving\x20journey...','3462891iKtWwE','filePath','\x22\x20resumed','(paused)','Error:\x20Journey\x20not\x20found:\x20','No\x20journeys\x20found','rootFolderId','entries','journeyBundleId','jsonl','format','yes','user','then','Error:\x20--version\x20option\x20is\x20required','7093849whfcpS','draft','-\x20no\x20files\x20written','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x20(ID:\x20','rule','✔\x20Context\x20set:\x20','Error:\x20','createVersion','exitOrJumpRate','/e/','Pausing\x20journey...','\x20\x20Journey\x20ID:\x20','Getting\x20journey\x20details...','journey:activations','INVALID_ARGUMENT','verbose','(draft)','attributes','getColumnMapping','Write\x20','Export\x20journey(s)\x20as\x20YAML\x20files','1563183UyUGiW','repeat','journey:pause','relativePath','4538HTzsev','\x20\x20Consolidating\x20duplicate\x20segment:\x20','has','listVersions','from','archived','version','activation_','connector_config','Options:','Database:\x20','journeyStages','get','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','getJourney','Show\x20journey\x20table\x20column\x20mapping','args','3686353ToESlW','completed','✔\x20Pulled\x20','size','push','paused','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Table:\x20','reentryMode','segment','connection','\x20unchanged\x20files','\x20journey','Error:\x20Journey\x20\x27','map','listJourneysWithFolders','\x22\x20not\x20found','test','enteredSize','targetDir','✔\x20All\x20files\x20are\x20up\x20to\x20date','Error:\x20Parent\x20segment\x20context\x20required','activation','buildIdToEmailMap','folderId','4guccYx','\x20not\x20found.\x20Available:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Resolving\x20version...','Getting\x20journey\x20traffic\x20data...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','resolveParentId','parentSegment','Listing\x20journey\x20versions...','(completed)','parentName','hasPeriod','description','getStatistics','stage','segmentPushCommand','execute','Fetching\x20journeys\x20and\x20folders...','.yml','\x20(rule\x20match)','\x20versions)','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','\x5c$&','📁\x20','database','cyan','Creating\x20new\x20version...','sort','\x20new\x20files','/app/ps/','\x20journey\x20files\x20to\x20','content','find','/j/da/je','(root)','completionRate','dim','(archived)','utf-8','Fetching\x20parent\x20segment...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','launched','Listing\x20journeys...','diff','all','journey:traffic','No\x20statistics\x20available\x20for\x20journey:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','getLatestJourneyId','Pause\x20a\x20running\x20journey','segments','kind','journey','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','state','tsv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aPull\x20summary:','data','pause','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20\x20-\x20','Input:\x20','renderStats','Cancelled'];a27_0x215c=function(){return _0x48abbf;};return a27_0x215c();}export class JourneyPullCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x29d);['description']=a27_0x511dbc(0x1e8);async[a27_0x511dbc(0x229)](_0x1f0183){const _0x5dd557=a27_0x511dbc,{options:_0x32d24a,args:_0x26f6f3,tdx:_0x34b05d}=_0x1f0183,_0x1dc154=_0x32d24a,_0x5f0c25=_0x26f6f3[0x0],_0x31714c=_0x5f0c25&&isYamlFilePath(_0x5f0c25),_0x1974af=await resolveTarget({'arg':_0x31714c?_0x5f0c25:undefined,'contextParent':_0x32d24a[_0x5dd557(0x220)],'cwd':process[_0x5dd557(0x27a)]()});if(!isSuccessfulResolution(_0x1974af))return _0x1974af[_0x5dd557(0x2b3)]==='no_parent'?(console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x294)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x5dd557(0x22e)),console[_0x5dd557(0x290)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x5dd557(0x290)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x5dd557(0x290)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a27_0x43744a['red'](_0x5dd557(0x1da)+_0x1974af[_0x5dd557(0x28e)]+'\x0a')),_0x1974af[_0x5dd557(0x2ca)]&&console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x232)](_0x1974af[_0x5dd557(0x2ca)]))),0x1;let _0x3f591b=_0x31714c?undefined:_0x5f0c25,_0x376a04,_0x515a76;_0x1974af['type']===_0x5dd557(0x281)&&(_0x3f591b=_0x1974af['resourceName'],_0x376a04=_0x1974af[_0x5dd557(0x2ce)],_0x515a76=_0x1974af[_0x5dd557(0x27b)]);const _0x39ad06=_0x1974af[_0x5dd557(0x223)],_0x369aed=_0x1974af[_0x5dd557(0x211)];_0x1dc154['verbose']&&(console['error']('Parent\x20segment:\x20'+_0x39ad06),console[_0x5dd557(0x290)]('Target\x20directory:\x20'+_0x369aed),_0x3f591b&&console[_0x5dd557(0x290)](_0x5dd557(0x286)+_0x3f591b),_0x376a04&&console['error']('Target\x20file:\x20'+_0x376a04),_0x515a76&&console['error'](_0x5dd557(0x2a8)+_0x515a76));const _0x216ce0=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x34b05d['segment'][_0x5dd557(0x21f)](_0x39ad06),{'verbose':_0x32d24a[_0x5dd557(0x1e3)]}),_0x2618e3=_0x216ce0[_0x5dd557(0x253)],{journeys:_0x59ff24,folders:_0x3a60ee}=await withSpinner(_0x5dd557(0x22a),async()=>{const _0x4672f9=_0x5dd557,[_0x54ff2d,_0x7c4f97]=await Promise[_0x4672f9(0x245)]([_0x34b05d[_0x4672f9(0x24d)][_0x4672f9(0x296)](_0x2618e3,undefined,{'includeAllVersions':!![]}),_0x34b05d[_0x4672f9(0x207)][_0x4672f9(0x295)](_0x2618e3)]);return{'journeys':_0x54ff2d,'folders':_0x7c4f97};},{'verbose':_0x32d24a[_0x5dd557(0x1e3)]})[_0x5dd557(0x1d1)](_0x1904ec=>_0x1904ec[_0x5dd557(0x253)]);let _0xcadd8=_0x59ff24;const _0x3a3f66=buildFolderIdToPathMap(_0x3a60ee);if(_0x3f591b){const _0x4cf2f6=_0xcadd8[_0x5dd557(0x266)](_0x3042b7=>_0x3042b7[_0x5dd557(0x2bb)]['toLowerCase']()===_0x3f591b[_0x5dd557(0x273)]());if(_0x4cf2f6[_0x5dd557(0x284)]===0x0)return console['error'](_0x5dd557(0x1c8)+_0x3f591b),console[_0x5dd557(0x290)](_0x5dd557(0x204)),0x1;_0xcadd8=_0x4cf2f6;}if(_0x515a76!==undefined){const _0x25062b=_0xcadd8[_0x5dd557(0x266)](_0x39395e=>{const _0x34120c=_0x5dd557,_0x68d21e=_0x39395e[_0x34120c(0x216)]?_0x3a3f66[_0x34120c(0x1f9)](_0x39395e['folderId'])||'':'';return _0x68d21e===_0x515a76;});if(_0x25062b[_0x5dd557(0x284)]===0x0&&_0xcadd8['length']>0x0){console[_0x5dd557(0x290)](_0x5dd557(0x20b)+_0x3f591b+_0x5dd557(0x268)+(_0x515a76||'root\x20folder')),console[_0x5dd557(0x290)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x2ef3fe of _0xcadd8){const _0x217562=_0x2ef3fe[_0x5dd557(0x216)]?_0x3a3f66[_0x5dd557(0x1f9)](_0x2ef3fe[_0x5dd557(0x216)])||'':'';console[_0x5dd557(0x290)](_0x5dd557(0x256)+(_0x217562||'(root)')+'/'+_0x2ef3fe['journeyBundleName']);}return 0x1;}_0xcadd8=_0x25062b;}if(_0xcadd8[_0x5dd557(0x284)]===0x0)return console[_0x5dd557(0x290)](_0x5dd557(0x1c9)),0x0;const _0x59ae4c=new Map();for(const _0x52161b of _0xcadd8){const _0x39854c=_0x52161b[_0x5dd557(0x1cc)];!_0x59ae4c[_0x5dd557(0x1ef)](_0x39854c)&&_0x59ae4c['set'](_0x39854c,[]),_0x59ae4c[_0x5dd557(0x1f9)](_0x39854c)[_0x5dd557(0x202)](_0x52161b);}for(const _0x1ed008 of _0x59ae4c['values']()){_0x1ed008['sort']((_0x261771,_0x1f0679)=>(_0x261771[_0x5dd557(0x2be)]||0x0)-(_0x1f0679['versionNumber']||0x0));}const _0x429447=[],{idToEmailMap:_0x5c8b99,connectionIdToNameMap:_0x40f3d5}=await withSpinner(_0x5dd557(0x2c9),async()=>{const _0x423751=_0x5dd557,[_0x41eb38,_0x322580]=await Promise[_0x423751(0x245)]([_0x34b05d[_0x423751(0x1d0)][_0x423751(0x215)](),_0x34b05d[_0x423751(0x208)][_0x423751(0x287)]()]);return{'idToEmailMap':_0x41eb38,'connectionIdToNameMap':_0x322580};},{'verbose':_0x32d24a[_0x5dd557(0x1e3)]})[_0x5dd557(0x1d1)](_0x3e1edc=>_0x3e1edc[_0x5dd557(0x253)]);for(const _0x27cf56 of _0x59ae4c[_0x5dd557(0x275)]()){const _0x4c4545=_0x27cf56[0x0][_0x5dd557(0x2bb)],_0x48bfbf=_0x27cf56[0x0][_0x5dd557(0x216)],_0x51b26a=_0x48bfbf?_0x3a3f66[_0x5dd557(0x1f9)](_0x48bfbf)||'':'',_0xa25dde=_0x51b26a?a27_0x303d57[_0x5dd557(0x299)](_0x369aed,_0x51b26a):_0x369aed,_0x363452=_0x376a04||a27_0x303d57[_0x5dd557(0x299)](_0xa25dde,sanitizeFileName(_0x4c4545)+_0x5dd557(0x22b));let _0x408a10,_0x2e3ba2;if(existsSync(_0x363452))try{const _0x4f8cda=readFileSync(_0x363452,_0x5dd557(0x23f)),_0x8807f3=parseYamlString(_0x4f8cda);_0x2e3ba2=_0x8807f3,_0x408a10=buildRuleToNameMapping(_0x8807f3),_0x1dc154['verbose']&&_0x408a10['size']>0x0&&console['error'](_0x5dd557(0x263)+_0x408a10[_0x5dd557(0x201)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x4c4545);}catch(_0x25e4e4){_0x1dc154[_0x5dd557(0x1e3)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x25e4e4['message']);}const _0x50ef38=[],_0x219cb2=new Set(),_0x43aa9e=new Map(),_0x54c445=new Map(),_0x57dbe3=new Set(),_0x2ace5d=new Map(),_0x3221ca=new Map(),_0x36cc9a=createJumpTargetCache();await withProgressSpinner(_0x5dd557(0x2b4)+_0x4c4545+_0x5dd557(0x2c2),async _0x3a03eb=>{const _0x21a660=_0x5dd557;for(const _0x1a7e68 of _0x27cf56){const _0x36de4c=_0x27cf56['length']>0x1?_0x1a7e68[_0x21a660(0x2bb)]+'\x20v'+(_0x1a7e68[_0x21a660(0x2be)]||0x1):_0x1a7e68[_0x21a660(0x2bb)];_0x3a03eb[_0x21a660(0x2aa)](_0x21a660(0x2b4)+_0x36de4c);const _0x13409a=await _0x34b05d[_0x21a660(0x24d)][_0x21a660(0x1fb)](_0x1a7e68['id']),_0x1bc445=_0x13409a['attributes']?.[_0x21a660(0x2ab)],_0xf007de={'resolveSegment':async _0x1338dc=>{const _0x3713cc=_0x21a660;if(!_0x1bc445)return{'name':_0x1338dc,'isJourneyLocal':![]};const _0x2c91ed=_0x43aa9e[_0x3713cc(0x1f9)](_0x1338dc);if(_0x2c91ed)return _0x2c91ed;try{const _0x4db57a=await _0x34b05d['segment'][_0x3713cc(0x27e)](_0x1bc445,_0x1338dc),_0x58ff78=_0x4db57a[_0x3713cc(0x24c)]===SEGMENT_KIND_JOURNEY;let _0x9260f,_0x4c6b50=_0x4db57a['name'];if(_0x58ff78&&_0x4db57a['rule']){const _0xd32b82=await segmentResponseToDef(_0x4db57a,{'resolveSegmentName':async _0x1c1ebb=>{const _0x264a93=_0x3713cc,_0x10c41c=_0x43aa9e[_0x264a93(0x1f9)](_0x1c1ebb);if(_0x10c41c)return _0x10c41c[_0x264a93(0x2ac)];const _0x4def9e=await _0xf007de[_0x264a93(0x265)](_0x1c1ebb);return _0x4def9e['name'];}}),_0x391c81=_0xd32b82[_0x3713cc(0x1d8)];_0x9260f={'description':_0x4db57a[_0x3713cc(0x225)],'rule':_0x391c81};const _0x176c08=serializeRule(_0x391c81),_0x265c41=_0x54c445[_0x3713cc(0x1f9)](_0x176c08);if(_0x265c41)_0x4c6b50=_0x265c41,_0x9260f=undefined,_0x1dc154[_0x3713cc(0x1e3)]&&console[_0x3713cc(0x290)](_0x3713cc(0x1ee)+_0x4db57a[_0x3713cc(0x2ac)]+'\x20->\x20'+_0x265c41);else{let _0x217596=![];if(_0x408a10){const _0x348d0e=_0x408a10[_0x3713cc(0x1f9)](_0x176c08);if(_0x348d0e){const _0x53d16c=_0x348d0e[_0x3713cc(0x239)](_0xb38560=>!_0x219cb2[_0x3713cc(0x1ef)](_0xb38560));_0x53d16c&&(_0x4c6b50=_0x53d16c,_0x219cb2[_0x3713cc(0x297)](_0x53d16c),_0x54c445['set'](_0x176c08,_0x53d16c),_0x217596=!![],_0x1dc154[_0x3713cc(0x1e3)]&&console['error'](_0x3713cc(0x277)+_0x53d16c+_0x3713cc(0x22c)));}}if(!_0x217596){const _0x3836ea=generateJourneyLocalName(_0x4db57a['name']);_0x3836ea&&(_0x4c6b50=_0x3836ea);let _0x4140e2=_0x4c6b50,_0x21ce2e=0x2;while(_0x219cb2['has'](_0x4140e2)){_0x4140e2=_0x4c6b50+'_'+_0x21ce2e,_0x21ce2e++;}_0x219cb2[_0x3713cc(0x297)](_0x4140e2),_0x54c445[_0x3713cc(0x2b0)](_0x176c08,_0x4140e2),_0x4c6b50=_0x4140e2;}}}const _0x5313d5={'name':_0x4c6b50,'isJourneyLocal':_0x58ff78,'definition':_0x9260f};return _0x43aa9e[_0x3713cc(0x2b0)](_0x1338dc,_0x5313d5),_0x5313d5;}catch(_0x169ac4){return _0x32d24a['verbose']&&console['error'](_0x3713cc(0x29b)+_0x1338dc+':\x20'+_0x169ac4[_0x3713cc(0x28e)]),{'name':_0x1338dc,'isJourneyLocal':![]};}},'resolveActivation':async _0x2b3e15=>{const _0x1d70ae=_0x21a660,_0x462d45=_0x2ace5d[_0x1d70ae(0x1f9)](_0x2b3e15);if(_0x462d45)return _0x462d45;try{const _0x4793d4=await _0x34b05d[_0x1d70ae(0x24d)][_0x1d70ae(0x283)](_0x1a7e68['id'],_0x2b3e15),_0x355b8d=journeyActivationStepToYaml(_0x4793d4,_0x5c8b99,_0x40f3d5),_0x1f3729=JSON[_0x1d70ae(0x272)]({'name':_0x355b8d[_0x1d70ae(0x2ac)],'connection':_0x355b8d[_0x1d70ae(0x208)],'connector_config':_0x355b8d[_0x1d70ae(0x1f5)]}),_0xa8eef0=_0x3221ca['get'](_0x1f3729);if(_0xa8eef0){const _0x133edc={'name':_0xa8eef0,'isJourneyLocal':!![],'definition':_0x355b8d};return _0x2ace5d['set'](_0x2b3e15,_0x133edc),_0x133edc;}const _0x1cdbf9=_0x4793d4[_0x1d70ae(0x1e5)][_0x1d70ae(0x2bf)][_0x1d70ae(0x2ac)]||_0x2b3e15,_0x2acdbf=sanitizeYamlKey(_0x1cdbf9)||_0x1d70ae(0x1f4)+_0x2b3e15;let _0x2579b1=_0x2acdbf,_0x3202a6=0x2;while(_0x57dbe3[_0x1d70ae(0x1ef)](_0x2579b1)){_0x2579b1=_0x2acdbf+'_'+_0x3202a6,_0x3202a6++;}_0x57dbe3[_0x1d70ae(0x297)](_0x2579b1),_0x3221ca[_0x1d70ae(0x2b0)](_0x1f3729,_0x2579b1);const _0x5edcac={'name':_0x2579b1,'isJourneyLocal':!![],'definition':_0x355b8d};return _0x2ace5d['set'](_0x2b3e15,_0x5edcac),_0x5edcac;}catch(_0x4b7daa){return _0x32d24a[_0x1d70ae(0x1e3)]&&console['error'](_0x1d70ae(0x270)+_0x2b3e15+':\x20'+_0x4b7daa[_0x1d70ae(0x28e)]),{'name':_0x2b3e15,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1da5ed,_0x3640f7)=>{const _0x42ba80=_0x21a660;return resolveJumpTarget(_0x1da5ed,_0x3640f7,_0x36cc9a,_0xb79474=>_0x34b05d[_0x42ba80(0x24d)][_0x42ba80(0x1fb)](_0xb79474));}},_0x12f993=await journeyResponseToDef(_0x13409a,_0xf007de);_0x50ef38[_0x21a660(0x202)]({'item':_0x1a7e68,'yaml':_0x12f993});}},{'verbose':_0x32d24a['verbose']});const _0x554d01=await _0x34b05d[_0x5dd557(0x24d)][_0x5dd557(0x249)](_0x27cf56[0x0][_0x5dd557(0x1cc)]),_0x286191=buildMergedJourneyDef(_0x50ef38,_0x408a10,_0x554d01),_0x2f3969=normalizeJourneyDef(_0x286191,_0x2e3ba2),_0x197a5b=toYamlString(_0x2f3969),_0x19183f=_0x376a04||a27_0x303d57[_0x5dd557(0x299)](_0xa25dde,sanitizeFileName(_0x4c4545)+_0x5dd557(0x22b));!_0x376a04&&_0x51b26a&&!existsSync(_0xa25dde)&&mkdirSync(_0xa25dde,{'recursive':!![]});const _0x40ca62=a27_0x303d57['relative'](process[_0x5dd557(0x27a)](),_0x19183f);if(existsSync(_0x19183f)){const _0x2fe1f8=readFileSync(_0x19183f,'utf-8'),_0x5cfeeb=generateDiff(_0x2fe1f8,_0x197a5b),_0xe20145=hasChanges(_0x5cfeeb);_0x429447[_0x5dd557(0x202)]({'relativePath':_0x40ca62,'absolutePath':_0x19183f,'content':_0x197a5b,'isNew':![],'hasChanges':_0xe20145,'diff':_0xe20145?formatDiffWithColors(_0x5cfeeb):undefined});}else _0x429447['push']({'relativePath':_0x40ca62,'absolutePath':_0x19183f,'content':_0x197a5b,'isNew':!![],'hasChanges':![]});}const _0x17a88f=_0x429447['filter'](_0x51055b=>_0x51055b['isNew']),_0x31bd18=_0x429447[_0x5dd557(0x266)](_0x5bd33d=>!_0x5bd33d[_0x5dd557(0x26a)]&&_0x5bd33d['hasChanges']),_0x52bb6c=_0x429447['filter'](_0x15213a=>!_0x15213a[_0x5dd557(0x26a)]&&!_0x15213a[_0x5dd557(0x28f)]),_0x22e9f0=_0xcadd8['length'],_0x6b1e36=_0x59ae4c[_0x5dd557(0x201)],_0x5287e3=_0x22e9f0>_0x6b1e36?'\x20('+_0x22e9f0+_0x5dd557(0x22d):'';console['error'](_0x5dd557(0x252)),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x6b1e36+_0x5dd557(0x25f))+a27_0x43744a['dim'](_0x5287e3)),console['error']('\x20\x20'+a27_0x43744a[_0x5dd557(0x29c)]('+\x20'+_0x17a88f[_0x5dd557(0x284)]+_0x5dd557(0x235))),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a[_0x5dd557(0x294)]('~\x20'+_0x31bd18[_0x5dd557(0x284)]+'\x20changed\x20files')),console[_0x5dd557(0x290)]('\x20\x20'+a27_0x43744a['dim']('=\x20'+_0x52bb6c['length']+_0x5dd557(0x209))),console[_0x5dd557(0x290)]('\x20\x20Target:\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x369aed)+'\x0a');if(_0x31bd18['length']>0x0)for(const _0x1945fd of _0x31bd18){console[_0x5dd557(0x290)]('\x0aChanges\x20to\x20\x27'+_0x1945fd[_0x5dd557(0x1ec)]+'\x27:'),console[_0x5dd557(0x290)]('─'[_0x5dd557(0x1ea)](0x3c)),console['error'](_0x1945fd[_0x5dd557(0x244)]),console[_0x5dd557(0x290)]('─'['repeat'](0x3c));}if(_0x1dc154['dryRun'])return console['error'](a27_0x43744a[_0x5dd557(0x294)](_0x5dd557(0x248))),0x0;if(_0x17a88f[_0x5dd557(0x284)]===0x0&&_0x31bd18['length']===0x0)return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x212))),saveSessionContext({'parent_segment':_0x39ad06},_0x1dc154[_0x5dd557(0x271)]),console['error'](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x1d9)+a27_0x43744a[_0x5dd557(0x23d)]('parent_segment')+'\x20=\x20'+a27_0x43744a['cyan'](_0x39ad06))),0x0;if(!_0x1dc154[_0x5dd557(0x1cf)]&&(_0x17a88f['length']>0x0||_0x31bd18[_0x5dd557(0x284)]>0x0)){if(!isInteractive())return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x2c8)]('\x0aError:'),_0x5dd557(0x2a3)),console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x23d)](_0x5dd557(0x251))),0x1;const _0x2f1688=await confirmKey(_0x5dd557(0x1e7)+(_0x17a88f[_0x5dd557(0x284)]+_0x31bd18[_0x5dd557(0x284)])+_0x5dd557(0x26b));if(!_0x2f1688)return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x294)]('Aborted.'),_0x5dd557(0x1d5)),0x1;}!existsSync(_0x369aed)&&mkdirSync(_0x369aed,{'recursive':!![]});const _0x561a85=a27_0x303d57[_0x5dd557(0x299)](_0x369aed,'tdx.json');writeFileSync(_0x561a85,createTdxConfigContent(_0x39ad06),_0x5dd557(0x23f));for(const _0x5eb9f5 of _0x429447){(_0x5eb9f5[_0x5dd557(0x26a)]||_0x5eb9f5[_0x5dd557(0x28f)])&&writeFileSync(_0x5eb9f5[_0x5dd557(0x2b2)],_0x5eb9f5[_0x5dd557(0x238)],_0x5dd557(0x23f));}return console[_0x5dd557(0x290)](a27_0x43744a[_0x5dd557(0x29c)](_0x5dd557(0x200)+(_0x17a88f[_0x5dd557(0x284)]+_0x31bd18['length'])+_0x5dd557(0x237)+_0x369aed)),saveSessionContext({'parent_segment':_0x39ad06},_0x1dc154[_0x5dd557(0x271)]),console[_0x5dd557(0x290)](a27_0x43744a['green'](_0x5dd557(0x1d9)+a27_0x43744a[_0x5dd557(0x23d)](_0x5dd557(0x2b7))+'\x20=\x20'+a27_0x43744a[_0x5dd557(0x232)](_0x39ad06))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a27_0x511dbc(0x225)]=a27_0x511dbc(0x1fc);async[a27_0x511dbc(0x229)](_0x887335){const _0x1500d9=a27_0x511dbc,{options:_0x1b9dc7,args:_0x21f75f,tdx:_0x46e7db}=_0x887335,_0x4479c5=_0x21f75f[0x0];if(!requireNameOrPath(_0x4479c5))return 0x1;_0x1b9dc7[_0x1500d9(0x1e3)]&&console[_0x1500d9(0x290)](_0x1500d9(0x257)+_0x4479c5);const {journeyId:_0x22fd0a}=await resolveJourneyIdFromInput(_0x4479c5,_0x1b9dc7,_0x46e7db),_0x42b059=await withSpinner(_0x1500d9(0x267),()=>_0x46e7db[_0x1500d9(0x24d)][_0x1500d9(0x1e6)](_0x22fd0a),{'verbose':_0x1b9dc7['verbose']}),_0x2e4b50=_0x42b059[_0x1500d9(0x253)];return console[_0x1500d9(0x279)](_0x1500d9(0x1f7)+_0x2e4b50[_0x1500d9(0x231)]),console[_0x1500d9(0x279)](_0x1500d9(0x205)+_0x2e4b50[_0x1500d9(0x269)]),await handleSDKOutput(_0x2e4b50['columns'],_0x1b9dc7),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x1e1);[a27_0x511dbc(0x225)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x511dbc(0x229)](_0x30c6ed){const _0x1c45c7=a27_0x511dbc,{options:_0x180226,args:_0x351c0e,tdx:_0x4b9119}=_0x30c6ed,_0x40cc86=_0x351c0e[0x0];if(!requireNameOrPath(_0x40cc86))return 0x1;_0x180226[_0x1c45c7(0x1e3)]&&console[_0x1c45c7(0x290)](_0x1c45c7(0x257)+_0x40cc86);const {journeyId:_0x2c8abb}=await resolveJourneyIdFromInput(_0x40cc86,_0x180226,_0x4b9119),_0x5e0d4c=await withSpinner(_0x1c45c7(0x2c7),()=>_0x4b9119[_0x1c45c7(0x24d)][_0x1c45c7(0x29f)](_0x2c8abb),{'verbose':_0x180226['verbose']}),_0x4baf60=_0x5e0d4c['data'];return console[_0x1c45c7(0x290)](_0x1c45c7(0x263)+_0x4baf60[_0x1c45c7(0x284)]+_0x1c45c7(0x2a0)+(_0x4baf60['length']!==0x1?'s':'')),await handleSDKOutput(_0x4baf60,_0x180226),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:push';[a27_0x511dbc(0x225)]=a27_0x511dbc(0x293);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x511dbc(0x229)](_0x3b1778){const _0x50d3c5=a27_0x511dbc,_0x4750f4=_0x3b1778[_0x50d3c5(0x1fd)][0x0];let _0x53ebd2;if(_0x4750f4){const _0xbc8a1c=await resolveTarget({'arg':_0x4750f4,'contextParent':_0x3b1778[_0x50d3c5(0x298)][_0x50d3c5(0x220)],'cwd':process[_0x50d3c5(0x27a)]()});isSuccessfulResolution(_0xbc8a1c)&&_0xbc8a1c['type']==='file'&&(_0x53ebd2=_0xbc8a1c[_0x50d3c5(0x2ce)]);}const _0x80780c={..._0x3b1778,'options':{..._0x3b1778[_0x50d3c5(0x298)],'journeysOnly':!![],..._0x53ebd2&&{'singleFilePath':_0x53ebd2}}};return this[_0x50d3c5(0x228)]['execute'](_0x80780c);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a27_0x511dbc(0x2b6);[a27_0x511dbc(0x225)]=a27_0x511dbc(0x2ae);async[a27_0x511dbc(0x229)](_0x90b254){const _0x1ea319=a27_0x511dbc,{options:_0x34a93f,args:_0x38d910,tdx:_0x3583d6}=_0x90b254,_0x42ee2e=_0x38d910[0x0];if(!requireNameOrPath(_0x42ee2e))return 0x1;if(_0x34a93f['verbose'])console[_0x1ea319(0x290)](_0x1ea319(0x257)+_0x42ee2e);const {journeyId:_0x17b66b}=await resolveJourneyIdFromInput(_0x42ee2e,_0x34a93f,_0x3583d6),_0x4855ae=await withSpinner(_0x1ea319(0x221),()=>_0x3583d6[_0x1ea319(0x24d)][_0x1ea319(0x1f0)](_0x17b66b),{'verbose':_0x34a93f[_0x1ea319(0x1e3)]}),{bundleName:_0xd4cfbd,versions:_0x3e7980,latestJourneyId:_0x4c67ef}=_0x4855ae[_0x1ea319(0x253)];console[_0x1ea319(0x290)](_0xd4cfbd+':\x20'+_0x3e7980[_0x1ea319(0x284)]+_0x1ea319(0x289)+(_0x3e7980[_0x1ea319(0x284)]!==0x1?'s':''));const _0x5df20d=_0x3e7980[_0x1ea319(0x20c)](_0x304666=>({'version':_0x304666[_0x1ea319(0x2be)],'journey_id':_0x304666[_0x1ea319(0x2a5)],'name':_0x304666[_0x1ea319(0x2ac)],'state':_0x304666['state'],'paused':_0x304666[_0x1ea319(0x203)],'latest':_0x304666[_0x1ea319(0x2a5)]===_0x4c67ef,'created_at':_0x304666['createdAt']}));return await handleSDKOutput(_0x5df20d,_0x34a93f),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]=a27_0x511dbc(0x2ba);['description']=a27_0x511dbc(0x276);async[a27_0x511dbc(0x229)](_0x431522){const _0x4cabd5=a27_0x511dbc,{options:_0x49d896,args:_0x79fc78,tdx:_0x17b6b7}=_0x431522,_0xb78b1b=_0x79fc78[0x0];if(!requireNameOrPath(_0xb78b1b))return 0x1;if(_0x49d896[_0x4cabd5(0x1e3)])console[_0x4cabd5(0x290)](_0x4cabd5(0x257)+_0xb78b1b);const {journeyId:_0x45ecec,journeyName:_0x1e7d46}=await resolveJourneyIdFromInput(_0xb78b1b,_0x49d896,_0x17b6b7);if(!_0x49d896['yes']){const _0x4de838=await confirm(_0x4cabd5(0x278)+_0x1e7d46+'\x22?');if(!_0x4de838)return console[_0x4cabd5(0x290)](_0x4cabd5(0x259)),0x0;}const _0x155c82=await withSpinner(_0x4cabd5(0x233),()=>_0x17b6b7[_0x4cabd5(0x24d)][_0x4cabd5(0x1db)](_0x45ecec),{'verbose':_0x49d896[_0x4cabd5(0x1e3)]}),_0x21628d=_0x155c82['data'];return console[_0x4cabd5(0x290)](a27_0x43744a['green']('✔')+_0x4cabd5(0x26e)+_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2be)]+_0x4cabd5(0x288)+_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2ac)]+'\x22'),console[_0x4cabd5(0x290)](_0x4cabd5(0x1df)+_0x21628d['id']),await handleSingleObjectOutput({'id':_0x21628d['id'],'name':_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x2ac)],'version':_0x21628d['attributes'][_0x4cabd5(0x2be)],'state':_0x21628d['attributes'][_0x4cabd5(0x24f)],'bundle_id':_0x21628d[_0x4cabd5(0x1e5)][_0x4cabd5(0x1cc)],'created_at':_0x21628d[_0x4cabd5(0x1e5)]['createdAt']},_0x49d896),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x511dbc(0x2ac)]='journey:version:view';[a27_0x511dbc(0x225)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x511dbc(0x229)](_0x46057b){const _0x27ce79=a27_0x511dbc,{options:_0x3006d0,args:_0x3eb20a,tdx:_0x18821a}=_0x46057b,_0x42397e=_0x3eb20a[0x0];if(!requireNameOrPath(_0x42397e))return 0x1;const _0x230acb=_0x3006d0[_0x27ce79(0x1f3)];if(!_0x230acb)return console['error'](_0x27ce79(0x1d2)),console[_0x27ce79(0x290)](_0x27ce79(0x262)),0x1;const _0x3ea895=parseInt(_0x230acb,0xa);if(isNaN(_0x3ea895)||_0x3ea895<0x1)return console[_0x27ce79(0x290)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x230acb),0x1;if(_0x3006d0['verbose'])console[_0x27ce79(0x290)](_0x27ce79(0x257)+_0x42397e+_0x27ce79(0x2a9)+_0x3ea895);const {journeyId:_0x3c1655,parentSegmentId:_0x523549}=await resolveJourneyIdFromInput(_0x42397e,_0x3006d0,_0x18821a),_0x39ad2a=await withSpinner(_0x27ce79(0x21c),()=>_0x18821a['journey'][_0x27ce79(0x1f0)](_0x3c1655),{'verbose':_0x3006d0[_0x27ce79(0x1e3)]}),{versions:_0x2298c3,latestJourneyId:_0x2187f3}=_0x39ad2a[_0x27ce79(0x253)],_0x20e857=_0x2298c3['find'](_0x274d8c=>_0x274d8c['versionNumber']===_0x3ea895);if(!_0x20e857){const _0x14b59b=_0x2298c3[_0x27ce79(0x20c)](_0x15116e=>'v'+_0x15116e[_0x27ce79(0x2be)])[_0x27ce79(0x299)](',\x20');return console[_0x27ce79(0x290)](_0x27ce79(0x2a4)+_0x3ea895+_0x27ce79(0x218)+_0x14b59b),0x1;}const _0x49e6d0=await withSpinner('Getting\x20version\x20'+_0x3ea895+'\x20details...',()=>_0x18821a[_0x27ce79(0x24d)]['getJourney'](_0x20e857['journeyId']),{'verbose':_0x3006d0[_0x27ce79(0x1e3)]}),_0x227f1a=_0x49e6d0[_0x27ce79(0x253)],_0x34cca8=getConsoleNextUrl(_0x3006d0[_0x27ce79(0x2b8)],_0x27ce79(0x236)+_0x523549+_0x27ce79(0x1dd)+_0x20e857[_0x27ce79(0x2a5)]+_0x27ce79(0x23a));return await handleSingleObjectOutput({'id':_0x227f1a['id'],'name':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x2ac)],'version':_0x227f1a[_0x27ce79(0x1e5)]['versionNumber'],'description':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x225)],'state':_0x227f1a[_0x27ce79(0x1e5)]['state'],'paused':_0x227f1a[_0x27ce79(0x1e5)]['paused'],'reentry_mode':_0x227f1a['attributes'][_0x27ce79(0x206)],'stages':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x1f8)]?.[_0x27ce79(0x284)]||0x0,..._0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x292)]&&{'goal':_0x227f1a['attributes'][_0x27ce79(0x292)][_0x27ce79(0x2ac)]},'latest':_0x20e857[_0x27ce79(0x2a5)]===_0x2187f3,'created_at':_0x227f1a[_0x27ce79(0x1e5)][_0x27ce79(0x2af)],'updated_at':_0x227f1a['attributes']['updatedAt'],'url':_0x34cca8},_0x3006d0),0x0;}}
|
|
1
|
+
const a27_0x272d82=a27_0x45e0;(function(_0x5e1019,_0x1288f7){const _0x133a5c=a27_0x45e0,_0x379224=_0x5e1019();while(!![]){try{const _0xf98c05=-parseInt(_0x133a5c(0x1d2))/0x1*(-parseInt(_0x133a5c(0x1fc))/0x2)+parseInt(_0x133a5c(0x1a2))/0x3+parseInt(_0x133a5c(0x278))/0x4+parseInt(_0x133a5c(0x27d))/0x5*(-parseInt(_0x133a5c(0x203))/0x6)+parseInt(_0x133a5c(0x249))/0x7+-parseInt(_0x133a5c(0x227))/0x8+-parseInt(_0x133a5c(0x232))/0x9*(parseInt(_0x133a5c(0x191))/0xa);if(_0xf98c05===_0x1288f7)break;else _0x379224['push'](_0x379224['shift']());}catch(_0x4f4107){_0x379224['push'](_0x379224['shift']());}}}(a27_0x2486,0xe60f6));import a27_0x58417c from'chalk';import a27_0x4af32d 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(_0x1bc6cf){const _0x584977=a27_0x45e0;return!_0x1bc6cf&&(console[_0x584977(0x1f1)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x584977(0x1f1)](_0x584977(0x1fd))),!!_0x1bc6cf;}function withJsonFormat(_0x143382){const _0x4cdc48=a27_0x45e0;if(!_0x143382[_0x4cdc48(0x267)]&&!_0x143382[_0x4cdc48(0x1c0)]&&!_0x143382[_0x4cdc48(0x226)]&&!_0x143382[_0x4cdc48(0x23e)])return{..._0x143382,'format':'json','json':!![]};return _0x143382;}function formatJourneyState(_0x701511){const _0x434d33=a27_0x45e0;switch(_0x701511){case _0x434d33(0x233):return a27_0x58417c[_0x434d33(0x237)]('(running)');case _0x434d33(0x1bd):return a27_0x58417c[_0x434d33(0x256)]('(draft)');case _0x434d33(0x20c):return a27_0x58417c[_0x434d33(0x1d6)]('(paused)');case'completed':return a27_0x58417c[_0x434d33(0x201)](_0x434d33(0x21d));case _0x434d33(0x239):return a27_0x58417c[_0x434d33(0x256)](_0x434d33(0x286));default:return'('+_0x701511+')';}}function formatJourneyItem(_0x499296,_0x2e1d6c='',_0x15e8d3){const _0x2cc7db=a27_0x45e0,_0x25ff2d=formatJourneyState(_0x499296[_0x2cc7db(0x1b2)]),_0x3f0e4e=_0x15e8d3?hyperlink(_0x499296[_0x2cc7db(0x1a9)],_0x15e8d3):_0x499296[_0x2cc7db(0x1a9)];return _0x2e1d6c+_0x2cc7db(0x1aa)+_0x3f0e4e+'\x20'+_0x25ff2d;}function escapeRegex(_0x1cec87){const _0x19d1ac=a27_0x45e0;return _0x1cec87[_0x19d1ac(0x1b9)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x395820){const _0x32dcb7=a27_0x45e0,_0x4426a4=_0x395820[_0x32dcb7(0x19b)]('*')['map'](escapeRegex);return new RegExp(_0x4426a4[_0x32dcb7(0x1c1)]('.*'),'i');}function buildRuleToNameMapping(_0x288b3b){const _0x3c6c7a=a27_0x45e0,_0x246dbf=new Map();if(_0x288b3b[_0x3c6c7a(0x228)])for(const [_0x45e545,_0x4f6fec]of Object[_0x3c6c7a(0x243)](_0x288b3b['segments'])){if(_0x4f6fec['rule']){const _0x7d20d1=serializeRule(_0x4f6fec[_0x3c6c7a(0x1dd)]),_0x24b518=_0x246dbf[_0x3c6c7a(0x1a6)](_0x7d20d1);_0x24b518?_0x24b518[_0x3c6c7a(0x202)](_0x45e545):_0x246dbf[_0x3c6c7a(0x1e4)](_0x7d20d1,[_0x45e545]);}}return _0x246dbf;}async function resolveJourneyIdFromInput(_0x5ac580,_0xedca34,_0x2a00bb){const _0x30c706=a27_0x45e0,_0x1030db=await resolveJourneyTarget(_0x5ac580,_0xedca34['parentSegment'],_0xedca34[_0x30c706(0x1f4)]),_0x1d4ca4=_0x1030db[_0x30c706(0x26f)];if(!_0x1d4ca4)throw new SDKError(ErrorCode[_0x30c706(0x289)],_0x30c706(0x252));const _0x12bd97=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2a00bb[_0x30c706(0x24a)][_0x30c706(0x231)](_0x1d4ca4),{'verbose':_0xedca34[_0x30c706(0x1f4)]}),_0x10388d=_0x12bd97[_0x30c706(0x28a)],_0x2c7e8b=await withSpinner('Resolving\x20journey...',()=>_0x2a00bb['journey']['resolveJourneyId'](_0x10388d,_0x1030db['journeyName']),{'verbose':_0xedca34['verbose']});return{'journeyId':_0x2c7e8b[_0x30c706(0x28a)],'journeyName':_0x1030db['journeyName'],'parentSegmentId':_0x10388d};}function a27_0x45e0(_0x2064d4,_0x6d85bc){_0x2064d4=_0x2064d4-0x191;const _0x248607=a27_0x2486();let _0x45e0a4=_0x248607[_0x2064d4];return _0x45e0a4;}async function resolveJourneyTarget(_0x196ea8,_0x115056,_0x394aa7){const _0x3a6cda=a27_0x45e0;if(isYamlFilePath(_0x196ea8))try{const _0x1e6453=await resolveYamlFilePath(_0x196ea8);return _0x394aa7&&(console['error'](_0x3a6cda(0x236)+_0x196ea8),console[_0x3a6cda(0x1f1)](_0x3a6cda(0x215)+_0x1e6453[_0x3a6cda(0x26f)]),console['error'](_0x3a6cda(0x234)+_0x1e6453[_0x3a6cda(0x1a5)]),console[_0x3a6cda(0x1f1)](_0x3a6cda(0x248)+(_0x1e6453[_0x3a6cda(0x1ce)]||_0x3a6cda(0x285)))),{'journeyName':_0x1e6453['segmentName'],'parentSegment':_0x1e6453[_0x3a6cda(0x26f)],'resolved':_0x1e6453};}catch(_0x264a36){throw new SDKError(ErrorCode[_0x3a6cda(0x289)],_0x3a6cda(0x1db)+_0x264a36[_0x3a6cda(0x290)]);}if(!_0x115056)throw new SDKError(ErrorCode[_0x3a6cda(0x289)],_0x3a6cda(0x274));return{'journeyName':_0x196ea8,'parentSegment':_0x115056};}function a27_0x2486(){const _0x40aa55=['hasPeriod','parentSegment','\x20changed\x20files','\x20activation','\x20=\x20','from','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20parent\x20segment...','buildIdToEmailMap','setPhase','343004RwtBAq','Found\x20','Show\x20journey\x20statistics','web','Error:\x20Stage\x20\x22','25AFODsq','\x22\x20paused','journey:columns','✔\x20Pulled\x20','localeCompare','journey:push','resolveSegment','journey:resume','(root)','(archived)','includeHistory','Input:\x20','INVALID_ARGUMENT','data','add','stageNameMap','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','all','\x20not\x20found.\x20Available:\x20','message','table','enteredSize','journey:version:create','-\x20no\x20files\x20written','11890oyqOLm','\x20new\x20files','audienceId','user','\x20journeys','Getting\x20version\x20','map','utf-8','Pattern:\x20','\x20Opening\x20','split','listActivationsFlat','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','✔\x20Journey\x20\x22','\x20\x20-\x20','getActivation','journey:stats','1337190RvXBUk','\x20(draft)\x20—\x20\x22','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segmentName','get','Creating\x20new\x20version...','No\x20statistics\x20available\x20for\x20journey:\x20','journeyBundleName','🗺️\x20','Export\x20journey(s)\x20as\x20YAML\x20files','Pause\x20a\x20running\x20journey','hasChanges','List\x20all\x20versions\x20of\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','values','state','log','getSegment','Getting\x20journey\x20details...','nodes','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Show\x20journey\x20table\x20column\x20mapping','replace','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20(ID:\x20','No\x20journeys\x20found','draft','pause','Cancelled','json','join','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','goalSize','has','size','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20journey\x20files\x20to\x20','✔\x20Found\x20','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','\x20files?','cwd','connection','folderPath','site','Aborted.','absolutePath','11106OzSuRt','journey','isNew','relative','yellow','goal','buildIdToNameMap','journey:view','.yml','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Invalid\x20--type\x20\x22','rule','Options:','options','activationParams','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Invalid\x20version\x20number:\x20','diff','set','Database:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','createVersion','/app/ps/','listVersions','journeyId','\x20unchanged\x20files','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','execute','stages','attributes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','error','\x20\x20Target:\x20','conversion','verbose','Warning:\x20Could\x20not\x20resolve\x20activation\x20','segmentPushCommand','Resuming\x20journey...','resume','repeat','...','/e/','222NfhxNu','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Parent\x20segment:\x20','find','content','blue','push','1478238AWxBOi','reentryMode','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','stringify','base','Fetching\x20users\x20and\x20connections...','updatedAt','description','journey:pause','paused','Target\x20directory:\x20','Getting\x20journey\x20traffic\x20data...','getColumnMapping','journey:activations','yes','Error:\x20Journey\x20not\x20found:\x20','Fetching\x20journeys\x20and\x20folders...','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','\x20\x20Parent\x20segment:\x20','file','getJourney','versionNumber','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','completeMilestoneRate','history','(completed)','toLowerCase','renderStats','root\x20folder','tdx.json','\x20versions)','Available\x20stages:\x20','no_parent','Error:\x20','jsonl','280984dpqMfL','segments','dryRun','filePath','listJourneysFromParentSegment','📁\x20','Resolving\x20version...','/j/da/je','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Listing\x20journey\x20activations...','resolveParentId','2619GEYCXg','launched','\x20\x20Name:\x20','\x20\x20Journey\x20ID:\x20','Resolved\x20YAML\x20file:\x20','green','relativePath','archived','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeyStages','test','journeyBundleId','tsv','\x0aChanges\x20to\x20\x27','\x20\x20Preserving\x20local\x20segment\x20name:\x20','session','journey:list','entries','getStatistics','Show\x20journey\x20details','sort','listJourneysWithFolders','\x20\x20Folder\x20path:\x20','5537462TUbWBq','segment','Fetching\x20','rootFolderId','targetDir','cyan','columns','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Pausing\x20journey...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20version','\x22\x20resumed','then','dim','folderId','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20Created\x20v','name','helpText','Resume\x20a\x20paused\x20journey','✔\x20Context\x20set:\x20','\x20\x20Statistics\x20not\x20available','createdAt','activation','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','red','limit','Getting\x20journey\x20statistics...','exitOrJumpRate','format','type','filter','\x20details...','\x20journey','parent_segment','/j/da'];a27_0x2486=function(){return _0x40aa55;};return a27_0x2486();}export class JourneyListCommand extends BaseCommand{['name']=a27_0x272d82(0x242);[a27_0x272d82(0x20a)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x272d82(0x1ed)](_0x1fd0a7){const _0x541475=a27_0x272d82,{options:_0x2dcb14,args:_0x416582,tdx:_0x5d4371}=_0x1fd0a7,_0x8b4af9=_0x416582[0x0],_0x409bb8=_0x2dcb14[_0x541475(0x26f)];if(!_0x409bb8)return console[_0x541475(0x1f1)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x541475(0x1f1)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x12dda1=await withSpinner(_0x541475(0x275),()=>_0x5d4371[_0x541475(0x24a)][_0x541475(0x231)](_0x409bb8),{'verbose':_0x2dcb14[_0x541475(0x1f4)]}),_0x493100=_0x12dda1['data'];_0x2dcb14[_0x541475(0x1f4)]&&(console[_0x541475(0x1f1)](_0x541475(0x1fe)+_0x409bb8+_0x541475(0x1bb)+_0x493100+')'),_0x8b4af9&&console[_0x541475(0x1f1)](_0x541475(0x199)+_0x8b4af9));const _0x1fe36d=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x5d4371[_0x541475(0x24a)]['getParentFull'](_0x493100),{'verbose':_0x2dcb14['verbose']}),_0x4511c0=_0x1fe36d[_0x541475(0x28a)],_0x28f0f0=_0x4511c0[_0x541475(0x24c)],_0x1f6b66=await withSpinner('Listing\x20journeys...',()=>_0x5d4371[_0x541475(0x1d3)][_0x541475(0x247)](_0x493100,_0x28f0f0),{'verbose':_0x2dcb14[_0x541475(0x1f4)]});let _0x45a7ec=_0x1f6b66[_0x541475(0x28a)][_0x541475(0x1c6)];const _0x2db8cc=_0x1f6b66[_0x541475(0x28a)]['folders'],_0x41e350=new Map();for(const _0x5923a2 of _0x2db8cc){_0x41e350['set'](_0x5923a2['id'],_0x5923a2[_0x541475(0x25a)]);}if(_0x8b4af9){const _0x5bc7f4=globToRegex(_0x8b4af9);_0x45a7ec=_0x45a7ec[_0x541475(0x269)](_0x39e81e=>_0x5bc7f4[_0x541475(0x23c)](_0x39e81e[_0x541475(0x1a9)]));}console['error'](_0x541475(0x1c9)+_0x45a7ec[_0x541475(0x219)]+_0x541475(0x26b)+(_0x45a7ec[_0x541475(0x219)]!==0x1?'s':''));const _0x5a0e27=_0x28bdc0=>{const _0x4cfe73=_0x541475;return getConsoleNextUrl(_0x2dcb14[_0x4cfe73(0x1cf)],'/app/ps/'+_0x493100+'/e/'+_0x28bdc0+_0x4cfe73(0x26d));};if(_0x2dcb14[_0x541475(0x267)]==='table')await handleSDKOutput(_0x45a7ec,_0x2dcb14);else{if(_0x2dcb14[_0x541475(0x267)]===_0x541475(0x1c0)){const _0x41e367=_0x45a7ec[_0x541475(0x197)](_0x1f240f=>({..._0x1f240f,'url':_0x5a0e27(_0x1f240f['id'])}));await handleSDKOutput(_0x41e367,_0x2dcb14);}else{console[_0x541475(0x1b3)]('['+_0x409bb8+']');const _0x313172=new Map(),_0x4a42e3=[];for(const _0x50b13c of _0x45a7ec){if(!_0x50b13c[_0x541475(0x257)]||_0x50b13c[_0x541475(0x257)]===_0x28f0f0)_0x4a42e3[_0x541475(0x202)](_0x50b13c);else{const _0x3030b9=_0x313172[_0x541475(0x1a6)](_0x50b13c['folderId'])||[];_0x3030b9['push'](_0x50b13c),_0x313172[_0x541475(0x1e4)](_0x50b13c[_0x541475(0x257)],_0x3030b9);}}const _0x203ddc=(_0x38ca12,_0x41acec)=>_0x38ca12[_0x541475(0x1a9)][_0x541475(0x281)](_0x41acec[_0x541475(0x1a9)],undefined,{'sensitivity':'base'});_0x4a42e3[_0x541475(0x246)](_0x203ddc);for(const _0xfbadc5 of _0x4a42e3){console['log'](formatJourneyItem(_0xfbadc5,'',_0x5a0e27(_0xfbadc5['id'])));}const _0x301cbb=[..._0x313172[_0x541475(0x243)]()][_0x541475(0x246)]((_0x553a51,_0x160e4f)=>{const _0x3a170a=_0x541475,_0x2cd47e=_0x41e350[_0x3a170a(0x1a6)](_0x553a51[0x0])||_0x553a51[0x0],_0x2283e6=_0x41e350[_0x3a170a(0x1a6)](_0x160e4f[0x0])||_0x160e4f[0x0];return _0x2cd47e[_0x3a170a(0x281)](_0x2283e6,undefined,{'sensitivity':_0x3a170a(0x207)});});for(const [_0x33d3e0,_0x338ffd]of _0x301cbb){const _0x2ad850=_0x41e350[_0x541475(0x1a6)](_0x33d3e0)||_0x33d3e0;console[_0x541475(0x1b3)](_0x541475(0x22c)+_0x2ad850),_0x338ffd[_0x541475(0x246)](_0x203ddc);for(const _0x35f6ef of _0x338ffd){console[_0x541475(0x1b3)](formatJourneyItem(_0x35f6ef,'\x20\x20',_0x5a0e27(_0x35f6ef['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x272d82(0x1d9);[a27_0x272d82(0x20a)]=a27_0x272d82(0x245);async['execute'](_0x276720){const _0x5d50a3=a27_0x272d82,{options:_0x4de081,args:_0x40fd7a,tdx:_0x1fbd12}=_0x276720,_0x1563b1=_0x40fd7a[0x0];if(!_0x1563b1)return console[_0x5d50a3(0x1f1)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5d50a3(0x1f1)](_0x5d50a3(0x1b7)),console[_0x5d50a3(0x1f1)](_0x5d50a3(0x1de)),console['error'](_0x5d50a3(0x19d)),0x1;_0x4de081['verbose']&&console['error'](_0x5d50a3(0x288)+_0x1563b1);const {journeyId:_0x3a7709,parentSegmentId:_0x8464e0}=await resolveJourneyIdFromInput(_0x1563b1,_0x4de081,_0x1fbd12);if(_0x4de081[_0x5d50a3(0x27b)]){const _0x422cda=getConsoleNextUrl(_0x4de081['site'],'/app/ps/'+_0x8464e0+_0x5d50a3(0x1fb)+_0x3a7709+_0x5d50a3(0x22e));return console[_0x5d50a3(0x1f1)](a27_0x58417c[_0x5d50a3(0x237)]('✔')+_0x5d50a3(0x19a)+a27_0x58417c[_0x5d50a3(0x24e)](_0x422cda)),openBrowser(_0x422cda),0x0;}const _0x2f6ee5=await withSpinner(_0x5d50a3(0x1b5),()=>_0x1fbd12[_0x5d50a3(0x1d3)][_0x5d50a3(0x217)](_0x3a7709),{'verbose':_0x4de081[_0x5d50a3(0x1f4)]}),_0x1b33ae=_0x2f6ee5[_0x5d50a3(0x28a)],_0x403577=_0x4de081[_0x5d50a3(0x262)];let _0x5d313d;if(_0x403577)try{const _0x5cf31c=await withSpinner(_0x5d50a3(0x265),()=>_0x1fbd12[_0x5d50a3(0x1d3)][_0x5d50a3(0x244)](_0x3a7709),{'verbose':_0x4de081['verbose']});_0x5d313d=_0x5cf31c[_0x5d50a3(0x28a)];}catch{_0x4de081['verbose']&&console[_0x5d50a3(0x1f1)](_0x5d50a3(0x25e));}const _0x17c06b=getConsoleNextUrl(_0x4de081[_0x5d50a3(0x1cf)],_0x5d50a3(0x1e8)+_0x8464e0+_0x5d50a3(0x1fb)+_0x3a7709+_0x5d50a3(0x22e)),_0x4c9843={'id':_0x1b33ae['id'],'name':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x25a)],'description':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x20a)],'state':_0x1b33ae['attributes'][_0x5d50a3(0x1b2)],'paused':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x20c)],'reentry_mode':_0x1b33ae[_0x5d50a3(0x1ef)]['reentryMode'],'stages':_0x1b33ae[_0x5d50a3(0x1ef)][_0x5d50a3(0x23b)]?.['length']||0x0,..._0x1b33ae['attributes'][_0x5d50a3(0x1d7)]&&{'goal':_0x1b33ae['attributes']['goal'][_0x5d50a3(0x25a)]},..._0x5d313d&&{'statistics':{'size':_0x5d313d[_0x5d50a3(0x1c5)],'entered':_0x5d313d[_0x5d50a3(0x292)],'goal_achieved':_0x5d313d[_0x5d50a3(0x1c3)],'completion_rate':_0x5d313d['completionRate'],'exit_or_jump':_0x5d313d['exitOrJumpSize'],'exit_or_jump_rate':_0x5d313d[_0x5d50a3(0x266)],'stages':_0x5d313d[_0x5d50a3(0x1ee)]}},'url':_0x17c06b};return await handleSingleObjectOutput(_0x4c9843,_0x4de081),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x272d82(0x1a1);[a27_0x272d82(0x20a)]=a27_0x272d82(0x27a);async[a27_0x272d82(0x1ed)](_0x5d8b3d){const _0x5b60fe=a27_0x272d82,{options:_0x4ec8dd,args:_0x407784,tdx:_0x358c82}=_0x5d8b3d,_0x35943a=_0x407784[0x0];if(!requireNameOrPath(_0x35943a))return 0x1;_0x4ec8dd['verbose']&&console[_0x5b60fe(0x1f1)](_0x5b60fe(0x288)+_0x35943a);const _0x50cccb=_0x4ec8dd,_0x47bfdb=_0x50cccb[_0x5b60fe(0x273)],_0x569e6e=_0x50cccb['to'],_0x1f66e5=_0x50cccb[_0x5b60fe(0x287)],_0x4c107b=_0x50cccb['stage'];_0x1f66e5&&!_0x47bfdb&&!_0x569e6e&&console[_0x5b60fe(0x1f1)](_0x5b60fe(0x258));const _0x361080=_0x1f66e5?withJsonFormat(_0x4ec8dd):_0x4ec8dd,{journeyId:_0x359ec9,journeyName:_0x5e4690}=await resolveJourneyIdFromInput(_0x35943a,_0x361080,_0x358c82),_0x438a01=_0x47bfdb||_0x569e6e?{'from':_0x47bfdb,'to':_0x569e6e}:undefined,_0x118cac=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x5b60fe(0x28e)]([_0x358c82[_0x5b60fe(0x1d3)]['getJourney'](_0x359ec9),_0x358c82[_0x5b60fe(0x1d3)][_0x5b60fe(0x244)](_0x359ec9,_0x438a01)]),{'verbose':_0x361080[_0x5b60fe(0x1f4)]}),[_0x57b464,_0x4d57f0]=_0x118cac[_0x5b60fe(0x28a)];if(!_0x4d57f0||_0x4d57f0[_0x5b60fe(0x1ea)]===null)return console['error'](_0x5b60fe(0x1a8)+_0x5e4690),console[_0x5b60fe(0x1f1)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x547063=buildStageNameMap(_0x57b464),_0x5dec4f=!!(_0x438a01&&_0x4d57f0[_0x5b60fe(0x21c)]?.[_0x5b60fe(0x219)]),_0x5b1072={'stageNameMap':_0x547063,'hasPeriod':_0x5dec4f,'includeHistory':!!_0x1f66e5};if(_0x4c107b&&_0x4d57f0[_0x5b60fe(0x1ee)]){const _0x5129e7=_0x4d57f0['stages'][_0x5b60fe(0x1ff)](_0x21c890=>{const _0x2fad07=_0x5b60fe,_0x2b1260=_0x547063[_0x2fad07(0x1a6)](_0x21c890['id'])??'';return _0x2b1260[_0x2fad07(0x21e)]()===_0x4c107b['toLowerCase']();});if(_0x5129e7)return await handleSingleObjectOutput(formatStageStats(_0x5129e7,_0x5b1072),_0x361080),0x0;const _0x2ac798=_0x4d57f0['stages'][_0x5b60fe(0x197)](_0x5d35f3=>_0x547063['get'](_0x5d35f3['id'])??_0x5d35f3['id']);return console['error'](_0x5b60fe(0x27c)+_0x4c107b+'\x22\x20not\x20found'),console[_0x5b60fe(0x1f1)](_0x5b60fe(0x223)+_0x2ac798['join'](',\x20')),0x1;}const _0x54d2f1=_0x4d57f0['stages']?.[_0x5b60fe(0x197)](_0x1ae4ce=>formatStageStats(_0x1ae4ce,_0x5b1072)),_0x4c42fa=assembleJourneyStats(_0x4d57f0,{'from':_0x47bfdb,'to':_0x569e6e,'includeHistory':_0x1f66e5});return await this['renderStats'](_0x4c42fa,_0x54d2f1??[],_0x361080),0x0;}async[a27_0x272d82(0x21f)](_0xdd509d,_0x33f02f,_0x3b9bdb){const _0x457005=a27_0x272d82,_0x2262bb=_0x3b9bdb[_0x457005(0x267)]==='json'||_0x3b9bdb[_0x457005(0x267)]==='jsonl'||_0x3b9bdb[_0x457005(0x1c0)]||_0x3b9bdb[_0x457005(0x226)];if(_0x2262bb){_0xdd509d['stages']=_0x33f02f,await handleSingleObjectOutput(_0xdd509d,_0x3b9bdb);return;}await handleSingleObjectOutput(_0xdd509d,_0x3b9bdb);for(const _0x1ad0c0 of _0x33f02f){console[_0x457005(0x1b3)](''),console[_0x457005(0x1b3)](String(a27_0x58417c[_0x457005(0x24e)]['bold']('['+_0x1ad0c0['name']+']'))+a27_0x58417c['dim']('\x20'+_0x1ad0c0['id']));const {id:_0x59944f,name:_0x486544,..._0x3abe73}=_0x1ad0c0;await handleSingleObjectOutput(_0x3abe73,_0x3b9bdb);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:traffic';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1b0);async[a27_0x272d82(0x1ed)](_0x30a572){const _0x272aa1=a27_0x272d82,{options:_0x3a3338,args:_0xb70696,tdx:_0xecb553}=_0x30a572,_0x45f50b=_0xb70696[0x0];if(!requireNameOrPath(_0x45f50b))return 0x1;_0x3a3338[_0x272aa1(0x1f4)]&&console[_0x272aa1(0x1f1)]('Input:\x20'+_0x45f50b);const _0x2faff9=_0x3a3338,_0x1be2db=_0x2faff9[_0x272aa1(0x268)],_0x1e7418=_0x2faff9[_0x272aa1(0x273)],_0x3e6e5b=_0x2faff9['to'],_0x59a4a6=_0x2faff9[_0x272aa1(0x264)];if(_0x1be2db&&_0x1be2db!=='conversion'&&_0x1be2db!==_0x272aa1(0x260))return console[_0x272aa1(0x1f1)](_0x272aa1(0x1dc)+_0x1be2db+_0x272aa1(0x214)),0x1;const _0x4beb90=withJsonFormat(_0x3a3338),{journeyId:_0x4fd337,journeyName:_0x256b05}=await resolveJourneyIdFromInput(_0x45f50b,_0x4beb90,_0xecb553),_0x2338b9={'type':_0x1be2db,'from':_0x1e7418,'to':_0x3e6e5b,'limit':_0x59a4a6},_0x6c9e76=await withSpinner(_0x272aa1(0x20e),()=>_0xecb553[_0x272aa1(0x1d3)]['getTrafficData'](_0x4fd337,_0x2338b9),{'verbose':_0x4beb90[_0x272aa1(0x1f4)]}),_0x706e2f=_0x6c9e76[_0x272aa1(0x28a)],_0x4ac09e=_0x706e2f[_0x272aa1(0x1f3)]&&(_0x706e2f[_0x272aa1(0x1f3)][_0x272aa1(0x1b6)][_0x272aa1(0x219)]>0x0||_0x706e2f[_0x272aa1(0x1f3)]['links'][_0x272aa1(0x219)]>0x0),_0x182f2c=_0x706e2f[_0x272aa1(0x260)]&&_0x706e2f['activation'][_0x272aa1(0x219)]>0x0;if(!_0x4ac09e&&!_0x182f2c)return console[_0x272aa1(0x1f1)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x256b05),console[_0x272aa1(0x1f1)](_0x272aa1(0x205)),_0x1e7418&&_0x3e6e5b&&console['error'](_0x272aa1(0x1ec)),0x0;return await handleSingleObjectOutput(_0x706e2f,_0x4beb90),0x0;}}function formatStageStats(_0xc0c88a,_0x2f1314){const _0x573149=a27_0x272d82,_0x11f4ef=_0x2f1314[_0x573149(0x26e)]&&_0xc0c88a[_0x573149(0x21c)]?.[_0x573149(0x219)]?aggregateStageHistory(_0xc0c88a[_0x573149(0x21c)]):{'size':_0xc0c88a['size'],'entered':_0xc0c88a[_0x573149(0x292)],'milestone':_0xc0c88a['milestoneSize'],'milestone_rate':_0xc0c88a[_0x573149(0x21b)],'exit_or_jump':_0xc0c88a['exitOrJumpSize'],'exit_or_jump_rate':_0xc0c88a[_0x573149(0x266)]},_0xed360e={'id':_0xc0c88a['id'],'name':_0x2f1314[_0x573149(0x28c)][_0x573149(0x1a6)](_0xc0c88a['id'])??_0xc0c88a['id'],..._0x11f4ef};return _0x2f1314['hasPeriod']&&_0x2f1314[_0x573149(0x287)]&&_0xc0c88a[_0x573149(0x21c)]&&(_0xed360e[_0x573149(0x21c)]=_0xc0c88a[_0x573149(0x21c)]),_0xed360e;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x272d82(0x20b);[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ac);async[a27_0x272d82(0x1ed)](_0x3148bb){const _0x34cc1b=a27_0x272d82,{options:_0x43b613,args:_0x15d738,tdx:_0x41cfe6}=_0x3148bb,_0x206b90=_0x15d738[0x0];if(!requireNameOrPath(_0x206b90))return 0x1;_0x43b613[_0x34cc1b(0x1f4)]&&console[_0x34cc1b(0x1f1)](_0x34cc1b(0x288)+_0x206b90);const {journeyId:_0x591fcf,journeyName:_0x257a83}=await resolveJourneyIdFromInput(_0x206b90,_0x43b613,_0x41cfe6);if(!_0x43b613[_0x34cc1b(0x211)]){const _0x28f680=await confirm(_0x34cc1b(0x1af)+_0x257a83+'\x22?');if(!_0x28f680)return console[_0x34cc1b(0x1f1)]('Cancelled'),0x0;}const _0x1cc95c=await withSpinner(_0x34cc1b(0x251),()=>_0x41cfe6['journey'][_0x34cc1b(0x1be)](_0x591fcf),{'verbose':_0x43b613[_0x34cc1b(0x1f4)]}),_0x4901c3=_0x1cc95c['data'];return console['error']('✔\x20Journey\x20\x22'+_0x4901c3['attributes']['name']+_0x34cc1b(0x27e)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x284);[a27_0x272d82(0x20a)]=a27_0x272d82(0x25c);async[a27_0x272d82(0x1ed)](_0x15953f){const _0x375734=a27_0x272d82,{options:_0x25b749,args:_0x5be57e,tdx:_0x5d7c36}=_0x15953f,_0x401896=_0x5be57e[0x0];if(!requireNameOrPath(_0x401896))return 0x1;_0x25b749['verbose']&&console[_0x375734(0x1f1)](_0x375734(0x288)+_0x401896);const {journeyId:_0x7faf69,journeyName:_0x14f3f1}=await resolveJourneyIdFromInput(_0x401896,_0x25b749,_0x5d7c36);if(!_0x25b749[_0x375734(0x211)]){const _0x87f38d=await confirm(_0x375734(0x1e6)+_0x14f3f1+'\x22?');if(!_0x87f38d)return console['error'](_0x375734(0x1bf)),0x0;}const _0x566135=await withSpinner(_0x375734(0x1f7),()=>_0x5d7c36[_0x375734(0x1d3)][_0x375734(0x1f8)](_0x7faf69),{'verbose':_0x25b749[_0x375734(0x1f4)]}),_0x3842a5=_0x566135[_0x375734(0x28a)];return console[_0x375734(0x1f1)](_0x375734(0x19e)+_0x3842a5[_0x375734(0x1ef)]['name']+_0x375734(0x254)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:pull';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ab);async['execute'](_0xa7a3f4){const _0x3260e3=a27_0x272d82,{options:_0x412d2b,args:_0x8a1022,tdx:_0x358727}=_0xa7a3f4,_0x158192=_0x412d2b,_0x40390b=_0x8a1022[0x0],_0x26d578=_0x40390b&&isYamlFilePath(_0x40390b),_0x3262e3=await resolveTarget({'arg':_0x26d578?_0x40390b:undefined,'contextParent':_0x412d2b[_0x3260e3(0x26f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3262e3))return _0x3262e3['errorCode']===_0x3260e3(0x224)?(console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)](_0x3260e3(0x1e1))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1ca)),console[_0x3260e3(0x1f1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x3260e3(0x21a)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a27_0x58417c[_0x3260e3(0x263)](_0x3260e3(0x225)+_0x3262e3[_0x3260e3(0x290)]+'\x0a')),_0x3262e3[_0x3260e3(0x25b)]&&console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x24e)](_0x3262e3[_0x3260e3(0x25b)]))),0x1;let _0x149721=_0x26d578?undefined:_0x40390b,_0x1a8aae,_0x2592fd;_0x3262e3[_0x3260e3(0x268)]===_0x3260e3(0x216)&&(_0x149721=_0x3262e3['resourceName'],_0x1a8aae=_0x3262e3['filePath'],_0x2592fd=_0x3262e3[_0x3260e3(0x1ce)]);const _0x24e462=_0x3262e3['parentName'],_0x3d490c=_0x3262e3[_0x3260e3(0x24d)];_0x158192['verbose']&&(console[_0x3260e3(0x1f1)](_0x3260e3(0x1fe)+_0x24e462),console['error'](_0x3260e3(0x20d)+_0x3d490c),_0x149721&&console[_0x3260e3(0x1f1)]('Journey\x20name:\x20'+_0x149721),_0x1a8aae&&console['error']('Target\x20file:\x20'+_0x1a8aae),_0x2592fd&&console[_0x3260e3(0x1f1)]('Folder\x20path:\x20'+_0x2592fd));const _0x116c6d=await withSpinner(_0x3260e3(0x275),()=>_0x358727[_0x3260e3(0x24a)][_0x3260e3(0x231)](_0x24e462),{'verbose':_0x412d2b[_0x3260e3(0x1f4)]}),_0x45b8c4=_0x116c6d['data'],{journeys:_0x35475e,folders:_0x22aff8}=await withSpinner(_0x3260e3(0x213),async()=>{const _0x41d39c=_0x3260e3,[_0x43a93a,_0x2dce06]=await Promise[_0x41d39c(0x28e)]([_0x358727[_0x41d39c(0x1d3)][_0x41d39c(0x22b)](_0x45b8c4,undefined,{'includeAllVersions':!![]}),_0x358727[_0x41d39c(0x24a)]['listFolders'](_0x45b8c4)]);return{'journeys':_0x43a93a,'folders':_0x2dce06};},{'verbose':_0x412d2b['verbose']})[_0x3260e3(0x255)](_0x1728b2=>_0x1728b2[_0x3260e3(0x28a)]);let _0x1c8b5f=_0x35475e;const _0x4e77d7=buildFolderIdToPathMap(_0x22aff8);if(_0x149721){const _0x5d0500=_0x1c8b5f['filter'](_0x3251aa=>_0x3251aa[_0x3260e3(0x1a9)][_0x3260e3(0x21e)]()===_0x149721[_0x3260e3(0x21e)]());if(_0x5d0500[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](_0x3260e3(0x212)+_0x149721),console[_0x3260e3(0x1f1)](_0x3260e3(0x261)),0x1;_0x1c8b5f=_0x5d0500;}if(_0x2592fd!==undefined){const _0xeaaf64=_0x1c8b5f[_0x3260e3(0x269)](_0x2d52df=>{const _0x14c153=_0x3260e3,_0x38d076=_0x2d52df[_0x14c153(0x257)]?_0x4e77d7['get'](_0x2d52df[_0x14c153(0x257)])||'':'';return _0x38d076===_0x2592fd;});if(_0xeaaf64[_0x3260e3(0x219)]===0x0&&_0x1c8b5f[_0x3260e3(0x219)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x149721+'\x27\x20not\x20found\x20in\x20'+(_0x2592fd||_0x3260e3(0x220))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1c2));for(const _0x536d84 of _0x1c8b5f){const _0x21d427=_0x536d84[_0x3260e3(0x257)]?_0x4e77d7[_0x3260e3(0x1a6)](_0x536d84['folderId'])||'':'';console[_0x3260e3(0x1f1)](_0x3260e3(0x19f)+(_0x21d427||_0x3260e3(0x285))+'/'+_0x536d84['journeyBundleName']);}return 0x1;}_0x1c8b5f=_0xeaaf64;}if(_0x1c8b5f[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](_0x3260e3(0x1bc)),0x0;const _0x211981=new Map();for(const _0x4dafc4 of _0x1c8b5f){const _0x1ea7ac=_0x4dafc4[_0x3260e3(0x23d)];!_0x211981['has'](_0x1ea7ac)&&_0x211981[_0x3260e3(0x1e4)](_0x1ea7ac,[]),_0x211981[_0x3260e3(0x1a6)](_0x1ea7ac)['push'](_0x4dafc4);}for(const _0x3dffd0 of _0x211981['values']()){_0x3dffd0[_0x3260e3(0x246)]((_0x6ee40e,_0x3a1ddf)=>(_0x6ee40e[_0x3260e3(0x218)]||0x0)-(_0x3a1ddf[_0x3260e3(0x218)]||0x0));}const _0xef995c=[],{idToEmailMap:_0x4d81c9,connectionIdToNameMap:_0x2f2124}=await withSpinner(_0x3260e3(0x208),async()=>{const _0x270117=_0x3260e3,[_0x31d953,_0x38b86a]=await Promise[_0x270117(0x28e)]([_0x358727[_0x270117(0x194)][_0x270117(0x276)](),_0x358727[_0x270117(0x1cd)][_0x270117(0x1d8)]()]);return{'idToEmailMap':_0x31d953,'connectionIdToNameMap':_0x38b86a};},{'verbose':_0x412d2b[_0x3260e3(0x1f4)]})[_0x3260e3(0x255)](_0x3d0c37=>_0x3d0c37[_0x3260e3(0x28a)]);for(const _0x3dddb8 of _0x211981[_0x3260e3(0x1b1)]()){const _0x15cfe1=_0x3dddb8[0x0][_0x3260e3(0x1a9)],_0x4dd49b=_0x3dddb8[0x0][_0x3260e3(0x257)],_0x12d010=_0x4dd49b?_0x4e77d7[_0x3260e3(0x1a6)](_0x4dd49b)||'':'',_0x4fc022=_0x12d010?a27_0x4af32d[_0x3260e3(0x1c1)](_0x3d490c,_0x12d010):_0x3d490c,_0x3b0518=_0x1a8aae||a27_0x4af32d[_0x3260e3(0x1c1)](_0x4fc022,sanitizeFileName(_0x15cfe1)+_0x3260e3(0x1da));let _0x353eb1,_0x29e250;if(existsSync(_0x3b0518))try{const _0x5587de=readFileSync(_0x3b0518,_0x3260e3(0x198)),_0x2517c1=parseYamlString(_0x5587de);_0x29e250=_0x2517c1,_0x353eb1=buildRuleToNameMapping(_0x2517c1),_0x158192[_0x3260e3(0x1f4)]&&_0x353eb1['size']>0x0&&console[_0x3260e3(0x1f1)](_0x3260e3(0x279)+_0x353eb1[_0x3260e3(0x1c5)]+_0x3260e3(0x1a4)+_0x15cfe1);}catch(_0x7d44c6){_0x158192[_0x3260e3(0x1f4)]&&console[_0x3260e3(0x1f1)](_0x3260e3(0x1ba)+_0x7d44c6[_0x3260e3(0x290)]);}const _0x38d5ea=[],_0x475b7e=new Set(),_0x5b9ffb=new Map(),_0x515b8b=new Map(),_0x5908f9=new Set(),_0x3c8807=new Map(),_0x3b3a96=new Map(),_0x2f7590=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x15cfe1+_0x3260e3(0x1fa),async _0x286792=>{const _0x521631=_0x3260e3;for(const _0x123aa9 of _0x3dddb8){const _0xa20b=_0x3dddb8[_0x521631(0x219)]>0x1?_0x123aa9[_0x521631(0x1a9)]+'\x20v'+(_0x123aa9[_0x521631(0x218)]||0x1):_0x123aa9['journeyBundleName'];_0x286792[_0x521631(0x277)](_0x521631(0x24b)+_0xa20b);const _0x2dc859=await _0x358727['journey'][_0x521631(0x217)](_0x123aa9['id']),_0x480e9b=_0x2dc859[_0x521631(0x1ef)]?.[_0x521631(0x193)],_0x1e1e03={'resolveSegment':async _0x33d4da=>{const _0x503d96=_0x521631;if(!_0x480e9b)return{'name':_0x33d4da,'isJourneyLocal':![]};const _0x8f1ea0=_0x5b9ffb['get'](_0x33d4da);if(_0x8f1ea0)return _0x8f1ea0;try{const _0x45953e=await _0x358727[_0x503d96(0x24a)][_0x503d96(0x1b4)](_0x480e9b,_0x33d4da),_0x2be7f9=_0x45953e['kind']===SEGMENT_KIND_JOURNEY;let _0x30de1f,_0x5b6ecd=_0x45953e[_0x503d96(0x25a)];if(_0x2be7f9&&_0x45953e[_0x503d96(0x1dd)]){const _0x451d1c=await segmentResponseToDef(_0x45953e,{'resolveSegmentName':async _0x598a4=>{const _0x2256d8=_0x503d96,_0x2fa909=_0x5b9ffb[_0x2256d8(0x1a6)](_0x598a4);if(_0x2fa909)return _0x2fa909[_0x2256d8(0x25a)];const _0x1016bf=await _0x1e1e03[_0x2256d8(0x283)](_0x598a4);return _0x1016bf[_0x2256d8(0x25a)];}}),_0x1dc3a5=_0x451d1c[_0x503d96(0x1dd)];_0x30de1f={'description':_0x45953e[_0x503d96(0x20a)],'rule':_0x1dc3a5};const _0xcf7d8a=serializeRule(_0x1dc3a5),_0x40c5bf=_0x515b8b[_0x503d96(0x1a6)](_0xcf7d8a);if(_0x40c5bf)_0x5b6ecd=_0x40c5bf,_0x30de1f=undefined,_0x158192['verbose']&&console[_0x503d96(0x1f1)](_0x503d96(0x250)+_0x45953e[_0x503d96(0x25a)]+'\x20->\x20'+_0x40c5bf);else{let _0x2e687d=![];if(_0x353eb1){const _0x4f7b08=_0x353eb1[_0x503d96(0x1a6)](_0xcf7d8a);if(_0x4f7b08){const _0xd8a8f3=_0x4f7b08['find'](_0x3c7a02=>!_0x475b7e[_0x503d96(0x1c4)](_0x3c7a02));_0xd8a8f3&&(_0x5b6ecd=_0xd8a8f3,_0x475b7e[_0x503d96(0x28b)](_0xd8a8f3),_0x515b8b[_0x503d96(0x1e4)](_0xcf7d8a,_0xd8a8f3),_0x2e687d=!![],_0x158192[_0x503d96(0x1f4)]&&console['error'](_0x503d96(0x240)+_0xd8a8f3+'\x20(rule\x20match)'));}}if(!_0x2e687d){const _0x37c663=generateJourneyLocalName(_0x45953e['name']);_0x37c663&&(_0x5b6ecd=_0x37c663);let _0x32e528=_0x5b6ecd,_0x3e590a=0x2;while(_0x475b7e[_0x503d96(0x1c4)](_0x32e528)){_0x32e528=_0x5b6ecd+'_'+_0x3e590a,_0x3e590a++;}_0x475b7e[_0x503d96(0x28b)](_0x32e528),_0x515b8b['set'](_0xcf7d8a,_0x32e528),_0x5b6ecd=_0x32e528;}}}const _0x30a90f={'name':_0x5b6ecd,'isJourneyLocal':_0x2be7f9,'definition':_0x30de1f};return _0x5b9ffb[_0x503d96(0x1e4)](_0x33d4da,_0x30a90f),_0x30a90f;}catch(_0x16761a){return _0x412d2b[_0x503d96(0x1f4)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x33d4da+':\x20'+_0x16761a[_0x503d96(0x290)]),{'name':_0x33d4da,'isJourneyLocal':![]};}},'resolveActivation':async _0x34754f=>{const _0x4472f7=_0x521631,_0x1c47b4=_0x3c8807[_0x4472f7(0x1a6)](_0x34754f);if(_0x1c47b4)return _0x1c47b4;try{const _0x13c81c=await _0x358727[_0x4472f7(0x1d3)][_0x4472f7(0x1a0)](_0x123aa9['id'],_0x34754f),_0x2cb28c=journeyActivationStepToYaml(_0x13c81c,_0x4d81c9,_0x2f2124),_0x3c9d78=JSON[_0x4472f7(0x206)]({'name':_0x2cb28c[_0x4472f7(0x25a)],'connection':_0x2cb28c['connection'],'connector_config':_0x2cb28c['connector_config']}),_0x7e20e7=_0x3b3a96[_0x4472f7(0x1a6)](_0x3c9d78);if(_0x7e20e7){const _0x55a786={'name':_0x7e20e7,'isJourneyLocal':!![],'definition':_0x2cb28c};return _0x3c8807[_0x4472f7(0x1e4)](_0x34754f,_0x55a786),_0x55a786;}const _0x26a238=_0x13c81c[_0x4472f7(0x1ef)][_0x4472f7(0x1e0)][_0x4472f7(0x25a)]||_0x34754f,_0x463b27=sanitizeYamlKey(_0x26a238)||'activation_'+_0x34754f;let _0xdd4744=_0x463b27,_0x5bbe2e=0x2;while(_0x5908f9['has'](_0xdd4744)){_0xdd4744=_0x463b27+'_'+_0x5bbe2e,_0x5bbe2e++;}_0x5908f9[_0x4472f7(0x28b)](_0xdd4744),_0x3b3a96[_0x4472f7(0x1e4)](_0x3c9d78,_0xdd4744);const _0x1e1761={'name':_0xdd4744,'isJourneyLocal':!![],'definition':_0x2cb28c};return _0x3c8807['set'](_0x34754f,_0x1e1761),_0x1e1761;}catch(_0xa3ff3b){return _0x412d2b[_0x4472f7(0x1f4)]&&console[_0x4472f7(0x1f1)](_0x4472f7(0x1f5)+_0x34754f+':\x20'+_0xa3ff3b['message']),{'name':_0x34754f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x329bb7,_0x278579)=>{const _0x43ff76=_0x521631;return resolveJumpTarget(_0x329bb7,_0x278579,_0x2f7590,_0x452dba=>_0x358727[_0x43ff76(0x1d3)][_0x43ff76(0x217)](_0x452dba));}},_0x38fd4b=await journeyResponseToDef(_0x2dc859,_0x1e1e03);_0x38d5ea[_0x521631(0x202)]({'item':_0x123aa9,'yaml':_0x38fd4b});}},{'verbose':_0x412d2b[_0x3260e3(0x1f4)]});const _0x2fee0f=await _0x358727['journey']['getLatestJourneyId'](_0x3dddb8[0x0][_0x3260e3(0x23d)]),_0x1075fc=buildMergedJourneyDef(_0x38d5ea,_0x353eb1,_0x2fee0f),_0x1f2c7d=normalizeJourneyDef(_0x1075fc,_0x29e250),_0x2aee62=toYamlString(_0x1f2c7d),_0x1c8ab8=_0x1a8aae||a27_0x4af32d[_0x3260e3(0x1c1)](_0x4fc022,sanitizeFileName(_0x15cfe1)+_0x3260e3(0x1da));!_0x1a8aae&&_0x12d010&&!existsSync(_0x4fc022)&&mkdirSync(_0x4fc022,{'recursive':!![]});const _0x4f8267=a27_0x4af32d[_0x3260e3(0x1d5)](process['cwd'](),_0x1c8ab8);if(existsSync(_0x1c8ab8)){const _0x55a288=readFileSync(_0x1c8ab8,_0x3260e3(0x198)),_0x26bf52=generateDiff(_0x55a288,_0x2aee62),_0x57e802=hasChanges(_0x26bf52);_0xef995c['push']({'relativePath':_0x4f8267,'absolutePath':_0x1c8ab8,'content':_0x2aee62,'isNew':![],'hasChanges':_0x57e802,'diff':_0x57e802?formatDiffWithColors(_0x26bf52):undefined});}else _0xef995c[_0x3260e3(0x202)]({'relativePath':_0x4f8267,'absolutePath':_0x1c8ab8,'content':_0x2aee62,'isNew':!![],'hasChanges':![]});}const _0x41cb9b=_0xef995c['filter'](_0x46853a=>_0x46853a[_0x3260e3(0x1d4)]),_0x207776=_0xef995c['filter'](_0x18db8d=>!_0x18db8d['isNew']&&_0x18db8d[_0x3260e3(0x1ad)]),_0x402a25=_0xef995c[_0x3260e3(0x269)](_0xba71e8=>!_0xba71e8[_0x3260e3(0x1d4)]&&!_0xba71e8[_0x3260e3(0x1ad)]),_0x29b2e1=_0x1c8b5f[_0x3260e3(0x219)],_0xfb2b40=_0x211981['size'],_0xf5307d=_0x29b2e1>_0xfb2b40?'\x20('+_0x29b2e1+_0x3260e3(0x222):'';console[_0x3260e3(0x1f1)]('\x0aPull\x20summary:'),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x24e)](_0xfb2b40+_0x3260e3(0x195))+a27_0x58417c['dim'](_0xf5307d)),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x237)]('+\x20'+_0x41cb9b['length']+_0x3260e3(0x192))),console[_0x3260e3(0x1f1)]('\x20\x20'+a27_0x58417c[_0x3260e3(0x1d6)]('~\x20'+_0x207776[_0x3260e3(0x219)]+_0x3260e3(0x270))),console['error']('\x20\x20'+a27_0x58417c['dim']('=\x20'+_0x402a25['length']+_0x3260e3(0x1eb))),console[_0x3260e3(0x1f1)](_0x3260e3(0x1f2)+a27_0x58417c[_0x3260e3(0x24e)](_0x3d490c)+'\x0a');if(_0x207776[_0x3260e3(0x219)]>0x0)for(const _0x141e4b of _0x207776){console[_0x3260e3(0x1f1)](_0x3260e3(0x23f)+_0x141e4b[_0x3260e3(0x238)]+'\x27:'),console[_0x3260e3(0x1f1)]('─'[_0x3260e3(0x1f9)](0x3c)),console[_0x3260e3(0x1f1)](_0x141e4b[_0x3260e3(0x1e3)]),console['error']('─'[_0x3260e3(0x1f9)](0x3c));}if(_0x158192[_0x3260e3(0x229)])return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x41cb9b[_0x3260e3(0x219)]===0x0&&_0x207776[_0x3260e3(0x219)]===0x0)return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x24e462},_0x158192[_0x3260e3(0x241)]),console['error'](a27_0x58417c['green'](_0x3260e3(0x25d)+a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x26c))+'\x20=\x20'+a27_0x58417c['cyan'](_0x24e462))),0x0;if(!_0x158192[_0x3260e3(0x211)]&&(_0x41cb9b[_0x3260e3(0x219)]>0x0||_0x207776[_0x3260e3(0x219)]>0x0)){if(!isInteractive())return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x263)]('\x0aError:'),_0x3260e3(0x1c7)),console['error'](a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x1f0))),0x1;const _0x3f45c6=await confirmKey('Write\x20'+(_0x41cb9b[_0x3260e3(0x219)]+_0x207776[_0x3260e3(0x219)])+_0x3260e3(0x1cb));if(!_0x3f45c6)return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x1d6)](_0x3260e3(0x1d0)),_0x3260e3(0x294)),0x1;}!existsSync(_0x3d490c)&&mkdirSync(_0x3d490c,{'recursive':!![]});const _0x5e9247=a27_0x4af32d[_0x3260e3(0x1c1)](_0x3d490c,_0x3260e3(0x221));writeFileSync(_0x5e9247,createTdxConfigContent(_0x24e462),_0x3260e3(0x198));for(const _0xec8149 of _0xef995c){(_0xec8149['isNew']||_0xec8149[_0x3260e3(0x1ad)])&&writeFileSync(_0xec8149[_0x3260e3(0x1d1)],_0xec8149[_0x3260e3(0x200)],_0x3260e3(0x198));}return console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)](_0x3260e3(0x280)+(_0x41cb9b[_0x3260e3(0x219)]+_0x207776[_0x3260e3(0x219)])+_0x3260e3(0x1c8)+_0x3d490c)),saveSessionContext({'parent_segment':_0x24e462},_0x158192['session']),console[_0x3260e3(0x1f1)](a27_0x58417c[_0x3260e3(0x237)](_0x3260e3(0x25d)+a27_0x58417c[_0x3260e3(0x256)](_0x3260e3(0x26c))+_0x3260e3(0x272)+a27_0x58417c[_0x3260e3(0x24e)](_0x24e462))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x272d82(0x27f);['description']=a27_0x272d82(0x1b8);async['execute'](_0x39e35d){const _0x53222b=a27_0x272d82,{options:_0x19986e,args:_0x2d876b,tdx:_0x3c349f}=_0x39e35d,_0x3a884b=_0x2d876b[0x0];if(!requireNameOrPath(_0x3a884b))return 0x1;_0x19986e[_0x53222b(0x1f4)]&&console[_0x53222b(0x1f1)](_0x53222b(0x288)+_0x3a884b);const {journeyId:_0x6fe0f2}=await resolveJourneyIdFromInput(_0x3a884b,_0x19986e,_0x3c349f),_0x5b3fff=await withSpinner('Getting\x20column\x20mapping...',()=>_0x3c349f[_0x53222b(0x1d3)][_0x53222b(0x20f)](_0x6fe0f2),{'verbose':_0x19986e[_0x53222b(0x1f4)]}),_0x3ecbc1=_0x5b3fff['data'];return console['log'](_0x53222b(0x1e5)+_0x3ecbc1['database']),console[_0x53222b(0x1b3)]('Table:\x20'+_0x3ecbc1[_0x53222b(0x291)]),await handleSDKOutput(_0x3ecbc1[_0x53222b(0x24f)],_0x19986e),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x210);[a27_0x272d82(0x20a)]='List\x20activations\x20for\x20a\x20journey';async[a27_0x272d82(0x1ed)](_0x16c70e){const _0x9182ba=a27_0x272d82,{options:_0x28abc2,args:_0x1c1045,tdx:_0x38f328}=_0x16c70e,_0x430ea6=_0x1c1045[0x0];if(!requireNameOrPath(_0x430ea6))return 0x1;_0x28abc2['verbose']&&console[_0x9182ba(0x1f1)](_0x9182ba(0x288)+_0x430ea6);const {journeyId:_0x130058}=await resolveJourneyIdFromInput(_0x430ea6,_0x28abc2,_0x38f328),_0x343df6=await withSpinner(_0x9182ba(0x230),()=>_0x38f328[_0x9182ba(0x1d3)][_0x9182ba(0x19c)](_0x130058),{'verbose':_0x28abc2['verbose']}),_0x36f9b9=_0x343df6[_0x9182ba(0x28a)];return console[_0x9182ba(0x1f1)](_0x9182ba(0x279)+_0x36f9b9[_0x9182ba(0x219)]+_0x9182ba(0x271)+(_0x36f9b9[_0x9182ba(0x219)]!==0x1?'s':'')),await handleSDKOutput(_0x36f9b9,_0x28abc2),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x272d82(0x282);[a27_0x272d82(0x20a)]=a27_0x272d82(0x28d);[a27_0x272d82(0x1f6)]=new SegmentPushCommand();async[a27_0x272d82(0x1ed)](_0x45071f){const _0xa8b3ad=a27_0x272d82,_0x141f93=_0x45071f['args'][0x0];let _0x5b56b6;if(_0x141f93){const _0x460483=await resolveTarget({'arg':_0x141f93,'contextParent':_0x45071f[_0xa8b3ad(0x1df)][_0xa8b3ad(0x26f)],'cwd':process[_0xa8b3ad(0x1cc)]()});isSuccessfulResolution(_0x460483)&&_0x460483[_0xa8b3ad(0x268)]===_0xa8b3ad(0x216)&&(_0x5b56b6=_0x460483[_0xa8b3ad(0x22a)]);}const _0x20bdc5={..._0x45071f,'options':{..._0x45071f[_0xa8b3ad(0x1df)],'journeysOnly':!![],..._0x5b56b6&&{'singleFilePath':_0x5b56b6}}};return this['segmentPushCommand'][_0xa8b3ad(0x1ed)](_0x20bdc5);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x272d82(0x25a)]='journey:versions';[a27_0x272d82(0x20a)]=a27_0x272d82(0x1ae);async['execute'](_0x2ac52a){const _0x150c25=a27_0x272d82,{options:_0x4fccad,args:_0x1cc0c5,tdx:_0x3de626}=_0x2ac52a,_0xfdcc65=_0x1cc0c5[0x0];if(!requireNameOrPath(_0xfdcc65))return 0x1;if(_0x4fccad[_0x150c25(0x1f4)])console[_0x150c25(0x1f1)]('Input:\x20'+_0xfdcc65);const {journeyId:_0x51e138}=await resolveJourneyIdFromInput(_0xfdcc65,_0x4fccad,_0x3de626),_0x420992=await withSpinner('Listing\x20journey\x20versions...',()=>_0x3de626[_0x150c25(0x1d3)][_0x150c25(0x1e9)](_0x51e138),{'verbose':_0x4fccad[_0x150c25(0x1f4)]}),{bundleName:_0x443bd4,versions:_0x1434d4,latestJourneyId:_0x5c5988}=_0x420992['data'];console[_0x150c25(0x1f1)](_0x443bd4+':\x20'+_0x1434d4[_0x150c25(0x219)]+_0x150c25(0x253)+(_0x1434d4[_0x150c25(0x219)]!==0x1?'s':''));const _0x5197ef=_0x1434d4[_0x150c25(0x197)](_0x1d8b20=>({'version':_0x1d8b20[_0x150c25(0x218)],'journey_id':_0x1d8b20[_0x150c25(0x1ea)],'name':_0x1d8b20[_0x150c25(0x25a)],'state':_0x1d8b20[_0x150c25(0x1b2)],'paused':_0x1d8b20['paused'],'latest':_0x1d8b20['journeyId']===_0x5c5988,'created_at':_0x1d8b20[_0x150c25(0x25f)]}));return await handleSDKOutput(_0x5197ef,_0x4fccad),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x272d82(0x25a)]=a27_0x272d82(0x293);[a27_0x272d82(0x20a)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x272d82(0x1ed)](_0x2249b9){const _0x116fb9=a27_0x272d82,{options:_0x4a9fb9,args:_0x380a0a,tdx:_0x2e41a7}=_0x2249b9,_0x16abb5=_0x380a0a[0x0];if(!requireNameOrPath(_0x16abb5))return 0x1;if(_0x4a9fb9[_0x116fb9(0x1f4)])console[_0x116fb9(0x1f1)](_0x116fb9(0x288)+_0x16abb5);const {journeyId:_0x3762c,journeyName:_0x1ab763}=await resolveJourneyIdFromInput(_0x16abb5,_0x4a9fb9,_0x2e41a7);if(!_0x4a9fb9[_0x116fb9(0x211)]){const _0x4f3ff0=await confirm(_0x116fb9(0x22f)+_0x1ab763+'\x22?');if(!_0x4f3ff0)return console[_0x116fb9(0x1f1)](_0x116fb9(0x1bf)),0x0;}const _0x4b2dd1=await withSpinner(_0x116fb9(0x1a7),()=>_0x2e41a7[_0x116fb9(0x1d3)][_0x116fb9(0x1e7)](_0x3762c),{'verbose':_0x4a9fb9['verbose']}),_0x473fbd=_0x4b2dd1['data'];return console[_0x116fb9(0x1f1)](a27_0x58417c['green']('✔')+_0x116fb9(0x259)+_0x473fbd[_0x116fb9(0x1ef)]['versionNumber']+_0x116fb9(0x1a3)+_0x473fbd['attributes'][_0x116fb9(0x25a)]+'\x22'),console[_0x116fb9(0x1f1)](_0x116fb9(0x235)+_0x473fbd['id']),await handleSingleObjectOutput({'id':_0x473fbd['id'],'name':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x25a)],'version':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x218)],'state':_0x473fbd['attributes'][_0x116fb9(0x1b2)],'bundle_id':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x23d)],'created_at':_0x473fbd[_0x116fb9(0x1ef)][_0x116fb9(0x25f)]},_0x4a9fb9),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';['description']=a27_0x272d82(0x23a);async[a27_0x272d82(0x1ed)](_0x4175f5){const _0x208b8d=a27_0x272d82,{options:_0x41b396,args:_0x4677bc,tdx:_0x45e2de}=_0x4175f5,_0x557b1c=_0x4677bc[0x0];if(!requireNameOrPath(_0x557b1c))return 0x1;const _0x2882d1=_0x41b396['version'];if(!_0x2882d1)return console[_0x208b8d(0x1f1)]('Error:\x20--version\x20option\x20is\x20required'),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x4e0238=parseInt(_0x2882d1,0xa);if(isNaN(_0x4e0238)||_0x4e0238<0x1)return console['error'](_0x208b8d(0x1e2)+_0x2882d1),0x1;if(_0x41b396['verbose'])console[_0x208b8d(0x1f1)](_0x208b8d(0x288)+_0x557b1c+',\x20version:\x20'+_0x4e0238);const {journeyId:_0x485899,parentSegmentId:_0x247082}=await resolveJourneyIdFromInput(_0x557b1c,_0x41b396,_0x45e2de),_0x4b6117=await withSpinner(_0x208b8d(0x22d),()=>_0x45e2de[_0x208b8d(0x1d3)][_0x208b8d(0x1e9)](_0x485899),{'verbose':_0x41b396['verbose']}),{versions:_0x4ebeda,latestJourneyId:_0x24c20d}=_0x4b6117[_0x208b8d(0x28a)],_0x446396=_0x4ebeda[_0x208b8d(0x1ff)](_0x2551e8=>_0x2551e8[_0x208b8d(0x218)]===_0x4e0238);if(!_0x446396){const _0x3ceb71=_0x4ebeda[_0x208b8d(0x197)](_0x534795=>'v'+_0x534795['versionNumber'])[_0x208b8d(0x1c1)](',\x20');return console['error']('Error:\x20Version\x20'+_0x4e0238+_0x208b8d(0x28f)+_0x3ceb71),0x1;}const _0x56f275=await withSpinner(_0x208b8d(0x196)+_0x4e0238+_0x208b8d(0x26a),()=>_0x45e2de[_0x208b8d(0x1d3)][_0x208b8d(0x217)](_0x446396[_0x208b8d(0x1ea)]),{'verbose':_0x41b396[_0x208b8d(0x1f4)]}),_0x55be3d=_0x56f275[_0x208b8d(0x28a)],_0x44e2f0=getConsoleNextUrl(_0x41b396[_0x208b8d(0x1cf)],_0x208b8d(0x1e8)+_0x247082+_0x208b8d(0x1fb)+_0x446396[_0x208b8d(0x1ea)]+_0x208b8d(0x22e));return await handleSingleObjectOutput({'id':_0x55be3d['id'],'name':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x25a)],'version':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x218)],'description':_0x55be3d['attributes'][_0x208b8d(0x20a)],'state':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x1b2)],'paused':_0x55be3d[_0x208b8d(0x1ef)]['paused'],'reentry_mode':_0x55be3d['attributes'][_0x208b8d(0x204)],'stages':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x23b)]?.[_0x208b8d(0x219)]||0x0,..._0x55be3d['attributes'][_0x208b8d(0x1d7)]&&{'goal':_0x55be3d['attributes']['goal'][_0x208b8d(0x25a)]},'latest':_0x446396[_0x208b8d(0x1ea)]===_0x24c20d,'created_at':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x25f)],'updated_at':_0x55be3d[_0x208b8d(0x1ef)][_0x208b8d(0x209)],'url':_0x44e2f0},_0x41b396),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a28_0x4440(_0x321fcb,_0x376a5b){_0x321fcb=_0x321fcb-0xe3;const _0x5d8302=a28_0x5d83();let _0x44405e=_0x5d8302[_0x321fcb];return _0x44405e;}const a28_0x2373a5=a28_0x4440;(function(_0x471912,_0x5a1581){const _0x582c86=a28_0x4440,_0x5ef7a5=_0x471912();while(!![]){try{const _0x13516e=-parseInt(_0x582c86(0x101))/0x1+parseInt(_0x582c86(0x116))/0x2*(-parseInt(_0x582c86(0xf4))/0x3)+-parseInt(_0x582c86(0x11b))/0x4+-parseInt(_0x582c86(0x117))/0x5+-parseInt(_0x582c86(0xe7))/0x6*(parseInt(_0x582c86(0xe6))/0x7)+-parseInt(_0x582c86(0xf6))/0x8*(-parseInt(_0x582c86(0x118))/0x9)+parseInt(_0x582c86(0x109))/0xa*(parseInt(_0x582c86(0x112))/0xb);if(_0x13516e===_0x5a1581)break;else _0x5ef7a5['push'](_0x5ef7a5['shift']());}catch(_0x596374){_0x5ef7a5['push'](_0x5ef7a5['shift']());}}}(a28_0x5d83,0x3e855));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x2c5c20 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a28_0x5d83(){const _0x547f8d=['relativePath','99724vrUsFN','log','valid','parentSegment','735OgAimd','10002uXvXuX','error','invalidCount','length','warningCount','cyan','cwd','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','name','warnings','red','journey','75OILRFp','\x20warning(s)\x20found','8rSCmML','.yml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','green','Error:\x20','message','helpText','Validate\x20journey\x20YAML\x20files','\x20warning(s)','\x20segment\x20file(s)\x20skipped','✔\x20All\x20','99850VjbHZv','.yaml','dim','\x20segment\x20file(s)\x20skipped)','\x20journey(s)\x20with\x20errors,\x20','filter','hasErrors','skippedCount','7849860lhyoNg','filePath','verbose','validCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','errorCode','\x20(skipped:\x20','\x20valid','11gHSzMC','description','no_parent','file','7112ttjOgA','1574090injLuF','1571697PgSXxX','yellow'];a28_0x5d83=function(){return _0x547f8d;};return a28_0x5d83();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x2373a5(0xf0)]='journey:validate';[a28_0x2373a5(0x113)]=a28_0x2373a5(0xfd);async['execute'](_0x33e598){const _0x43c6f1=a28_0x2373a5,{options:_0x55a2ea,args:_0x402405}=_0x33e598,_0x1c12e9=_0x55a2ea,_0x3c1c78=await resolveTarget({'arg':_0x402405[0x0],'contextParent':_0x55a2ea[_0x43c6f1(0xe5)],'cwd':process[_0x43c6f1(0xed)]()});if(!isSuccessfulResolution(_0x3c1c78))return _0x3c1c78[_0x43c6f1(0x10f)]===_0x43c6f1(0x114)?(console['error'](a28_0x2c5c20[_0x43c6f1(0x119)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x43c6f1(0xe8)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x43c6f1(0xe8)](_0x43c6f1(0xef)),console[_0x43c6f1(0xe8)](_0x43c6f1(0x10e))):(console[_0x43c6f1(0xe8)](a28_0x2c5c20[_0x43c6f1(0xf2)](_0x43c6f1(0xfa)+_0x3c1c78[_0x43c6f1(0xfb)]+'\x0a')),_0x3c1c78[_0x43c6f1(0xfc)]&&console['error'](a28_0x2c5c20[_0x43c6f1(0xec)](_0x3c1c78[_0x43c6f1(0xfc)]))),0x1;const _0x4c37c4=_0x3c1c78['targetDir'],_0x1e7283=_0x3c1c78['type']===_0x43c6f1(0x115)?_0x3c1c78[_0x43c6f1(0x10a)]:undefined;if(!_0x1e7283&&!existsSync(_0x4c37c4))return console[_0x43c6f1(0xe8)](a28_0x2c5c20[_0x43c6f1(0xf2)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4c37c4+'\x0a')),0x1;let _0x4810c2;if(_0x1e7283){if(!_0x1e7283[_0x43c6f1(0xee)](_0x43c6f1(0xf7))&&!_0x1e7283[_0x43c6f1(0xee)](_0x43c6f1(0x102)))return console[_0x43c6f1(0xe8)](a28_0x2c5c20[_0x43c6f1(0xf2)](_0x43c6f1(0x10d)+_0x1e7283+'\x0a')),0x1;_0x4810c2=[_0x1e7283];}else _0x4810c2=findYamlFiles(_0x4c37c4);if(_0x4810c2[_0x43c6f1(0xea)]===0x0)return console[_0x43c6f1(0xe8)](a28_0x2c5c20['red'](_0x43c6f1(0xf8)+_0x4c37c4+'\x0a')),0x1;const _0x489da5=validateYamlFiles(_0x4810c2,_0x4c37c4,{'filterType':_0x43c6f1(0xf3)}),_0x334a15=calculateSummary(_0x489da5),_0x56d853=_0x489da5[_0x43c6f1(0x106)](isValidationResult);if(_0x56d853[_0x43c6f1(0xea)]===0x0)return console[_0x43c6f1(0xe8)](a28_0x2c5c20['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x4c37c4+'\x0a')),_0x334a15[_0x43c6f1(0x108)]>0x0&&console[_0x43c6f1(0xe8)](a28_0x2c5c20['dim']('('+_0x334a15[_0x43c6f1(0x108)]+_0x43c6f1(0x104))),0x0;for(const _0x4fd732 of _0x489da5){if(!isValidationResult(_0x4fd732)){_0x1c12e9[_0x43c6f1(0x10b)]&&console['log'](a28_0x2c5c20[_0x43c6f1(0x103)]('-\x20'+_0x4fd732[_0x43c6f1(0x11a)]+_0x43c6f1(0x110)+_0x4fd732['reason']+')'));continue;}const {relativePath:_0x4dd0bf,source:_0x17ea16,result:_0x16568e}=_0x4fd732;if(_0x16568e[_0x43c6f1(0xe4)]&&_0x16568e[_0x43c6f1(0xf1)][_0x43c6f1(0xea)]===0x0)_0x1c12e9[_0x43c6f1(0x10b)]&&console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0xf9)]('✔\x20'+_0x4dd0bf));else _0x16568e[_0x43c6f1(0xe4)]?(console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0x119)]('⚠\x20'+_0x4dd0bf+':\x20'+_0x16568e[_0x43c6f1(0xf1)][_0x43c6f1(0xea)]+_0x43c6f1(0xfe))),console[_0x43c6f1(0xe3)](formatValidationResult(_0x16568e,_0x17ea16,_0x4dd0bf))):(console[_0x43c6f1(0xe3)](a28_0x2c5c20['red']('✖\x20'+_0x4dd0bf+':\x20'+_0x16568e['errors'][_0x43c6f1(0xea)]+'\x20error(s)')),console[_0x43c6f1(0xe3)](formatValidationResult(_0x16568e,_0x17ea16,_0x4dd0bf)));}return console[_0x43c6f1(0xe3)](''),_0x334a15[_0x43c6f1(0x107)]?(console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0xf2)]('Validation\x20failed:\x20'+_0x334a15[_0x43c6f1(0xe9)]+_0x43c6f1(0x105)+_0x334a15['validCount']+_0x43c6f1(0x111))),_0x334a15[_0x43c6f1(0xeb)]>0x0&&console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0x119)](_0x334a15[_0x43c6f1(0xeb)]+_0x43c6f1(0xf5))),_0x334a15[_0x43c6f1(0x108)]>0x0&&console['log'](a28_0x2c5c20[_0x43c6f1(0x103)](_0x334a15[_0x43c6f1(0x108)]+_0x43c6f1(0xff))),0x1):(console[_0x43c6f1(0xe3)](a28_0x2c5c20['green'](_0x43c6f1(0x100)+_0x334a15[_0x43c6f1(0x10c)]+'\x20journey(s)\x20valid')),_0x334a15[_0x43c6f1(0xeb)]>0x0&&console[_0x43c6f1(0xe3)](a28_0x2c5c20[_0x43c6f1(0x119)](_0x334a15[_0x43c6f1(0xeb)]+_0x43c6f1(0xf5))),_0x334a15['skippedCount']>0x0&&console['log'](a28_0x2c5c20[_0x43c6f1(0x103)](_0x334a15[_0x43c6f1(0x108)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}
|