@treasuredata/tdx 2026.3.37 → 2026.3.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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.d.ts +8 -2
- package/dist/commands/work-command.d.ts.map +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/work-command.js.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js.map +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +9 -7
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/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.d.ts +3 -0
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js.map +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/cas.d.ts +2 -1
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/cdp.d.ts +16 -1
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +19 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +12 -4
- 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.d.ts +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/github-releases.js.map +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x4a12(_0x48933d,_0x132b15){_0x48933d=_0x48933d-0x177;const _0x260526=a26_0x2605();let _0x4a1263=_0x260526[_0x48933d];return _0x4a1263;}const a26_0x56a3f0=a26_0x4a12;(function(_0x4d23e2,_0x5d0352){const _0x4eb01e=a26_0x4a12,_0x5151fe=_0x4d23e2();while(!![]){try{const _0xc71dd0=-parseInt(_0x4eb01e(0x1a4))/0x1+-parseInt(_0x4eb01e(0x192))/0x2+parseInt(_0x4eb01e(0x181))/0x3+-parseInt(_0x4eb01e(0x17d))/0x4*(-parseInt(_0x4eb01e(0x187))/0x5)+-parseInt(_0x4eb01e(0x18f))/0x6+-parseInt(_0x4eb01e(0x18b))/0x7*(-parseInt(_0x4eb01e(0x1a8))/0x8)+parseInt(_0x4eb01e(0x17c))/0x9*(parseInt(_0x4eb01e(0x19f))/0xa);if(_0xc71dd0===_0x5d0352)break;else _0x5151fe['push'](_0x5151fe['shift']());}catch(_0x1f639c){_0x5151fe['push'](_0x5151fe['shift']());}}}(a26_0x2605,0x2e158));import{BaseCommand}from'./command.js';function a26_0x2605(){const _0x260ede=['warnings','\x20non-template\x20file(s)\x20skipped','validCount','Validation\x20failed:\x20','\x20template(s)\x20valid','dirname','30PUdDQe','error','yellow','skippedCount','valid','5514ILODgT','log','.yaml','resolve','6424ZKMMkK','length','execute','verbose','warningCount','hasErrors','583083XAXxxw','49852qfewfR','endsWith','filter','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','626877CDgQMx','✔\x20All\x20','\x20error(s)','\x20(skipped:\x20','\x20valid','Error:\x20Directory\x20not\x20found:\x20','45nOInjb','Validate\x20template\x20YAML\x20files','errors','\x20warning(s)','819bARtYk','.yml','description','name','2076576yDEKpD','cwd','dim','138136QLzVjA','red','\x20warning(s)\x20found','No\x20template\x20YAML\x20files\x20found\x20in\x20','engage:template:validate','green','template'];a26_0x2605=function(){return _0x260ede;};return a26_0x2605();}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x4c4bc2 from'chalk';import a26_0x337831 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{[a26_0x56a3f0(0x18e)]=a26_0x56a3f0(0x196);[a26_0x56a3f0(0x18d)]=a26_0x56a3f0(0x188);async[a26_0x56a3f0(0x178)](_0x156a50){const _0x45049f=a26_0x56a3f0,{options:_0x1e0c23,args:_0x4cf017}=_0x156a50,_0x250139=_0x1e0c23,_0x43e5bb=_0x4cf017[0x0],_0x1bbdc2=_0x43e5bb?a26_0x337831[_0x45049f(0x1a7)](_0x43e5bb):undefined,_0x4986dd=_0x1bbdc2?isYamlFile(_0x1bbdc2):![];let _0xdc624f,_0x199c00;if(_0x4986dd&&_0x1bbdc2)_0xdc624f=a26_0x337831[_0x45049f(0x19e)](_0x1bbdc2),_0x199c00=_0x1bbdc2;else _0x1bbdc2?_0xdc624f=_0x1bbdc2:_0xdc624f=process[_0x45049f(0x190)]();if(!_0x199c00&&!existsSync(_0xdc624f))return console[_0x45049f(0x1a0)](a26_0x4c4bc2[_0x45049f(0x193)](_0x45049f(0x186)+_0xdc624f+'\x0a')),0x1;let _0x49aa25;if(_0x199c00){if(!_0x199c00['endsWith'](_0x45049f(0x18c))&&!_0x199c00[_0x45049f(0x17e)](_0x45049f(0x1a6)))return console[_0x45049f(0x1a0)](a26_0x4c4bc2[_0x45049f(0x193)](_0x45049f(0x180)+_0x199c00+'\x0a')),0x1;_0x49aa25=[_0x199c00];}else _0x49aa25=findYamlFiles(_0xdc624f);if(_0x49aa25['length']===0x0)return console[_0x45049f(0x1a0)](a26_0x4c4bc2[_0x45049f(0x193)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0xdc624f+'\x0a')),0x1;const _0x31a2d9=validateYamlFiles(_0x49aa25,_0xdc624f,{'filterType':_0x45049f(0x198)}),_0x3b0734=calculateSummary(_0x31a2d9),_0x167e55=_0x31a2d9[_0x45049f(0x17f)](isValidationResult);if(_0x167e55[_0x45049f(0x177)]===0x0)return console[_0x45049f(0x1a0)](a26_0x4c4bc2[_0x45049f(0x1a1)](_0x45049f(0x195)+_0xdc624f+'\x0a')),_0x3b0734[_0x45049f(0x1a2)]>0x0&&console[_0x45049f(0x1a0)](a26_0x4c4bc2[_0x45049f(0x191)]('('+_0x3b0734[_0x45049f(0x1a2)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x50f7ea of _0x31a2d9){if(!isValidationResult(_0x50f7ea)){_0x250139[_0x45049f(0x179)]&&console['log'](a26_0x4c4bc2[_0x45049f(0x191)]('-\x20'+_0x50f7ea['relativePath']+_0x45049f(0x184)+_0x50f7ea['reason']+')'));continue;}const {relativePath:_0x16653f,source:_0x1ce790,result:_0x2804f7}=_0x50f7ea;if(_0x2804f7[_0x45049f(0x1a3)]&&_0x2804f7[_0x45049f(0x199)][_0x45049f(0x177)]===0x0)_0x250139['verbose']&&console[_0x45049f(0x1a5)](a26_0x4c4bc2[_0x45049f(0x197)]('✔\x20'+_0x16653f));else _0x2804f7[_0x45049f(0x1a3)]?(console[_0x45049f(0x1a5)](a26_0x4c4bc2[_0x45049f(0x1a1)]('⚠\x20'+_0x16653f+':\x20'+_0x2804f7[_0x45049f(0x199)][_0x45049f(0x177)]+_0x45049f(0x18a))),console['log'](formatValidationResult(_0x2804f7,_0x1ce790,_0x16653f))):(console[_0x45049f(0x1a5)](a26_0x4c4bc2['red']('✖\x20'+_0x16653f+':\x20'+_0x2804f7[_0x45049f(0x189)][_0x45049f(0x177)]+_0x45049f(0x183))),console[_0x45049f(0x1a5)](formatValidationResult(_0x2804f7,_0x1ce790,_0x16653f)));}return console[_0x45049f(0x1a5)](''),_0x3b0734[_0x45049f(0x17b)]?(console[_0x45049f(0x1a5)](a26_0x4c4bc2[_0x45049f(0x193)](_0x45049f(0x19c)+_0x3b0734['invalidCount']+'\x20template(s)\x20with\x20errors,\x20'+_0x3b0734[_0x45049f(0x19b)]+_0x45049f(0x185))),_0x3b0734['warningCount']>0x0&&console['log'](a26_0x4c4bc2[_0x45049f(0x1a1)](_0x3b0734[_0x45049f(0x17a)]+_0x45049f(0x194))),_0x3b0734[_0x45049f(0x1a2)]>0x0&&console[_0x45049f(0x1a5)](a26_0x4c4bc2[_0x45049f(0x191)](_0x3b0734[_0x45049f(0x1a2)]+_0x45049f(0x19a))),0x1):(console[_0x45049f(0x1a5)](a26_0x4c4bc2[_0x45049f(0x197)](_0x45049f(0x182)+_0x3b0734[_0x45049f(0x19b)]+_0x45049f(0x19d))),_0x3b0734[_0x45049f(0x17a)]>0x0&&console[_0x45049f(0x1a5)](a26_0x4c4bc2[_0x45049f(0x1a1)](_0x3b0734[_0x45049f(0x17a)]+_0x45049f(0x194))),_0x3b0734[_0x45049f(0x1a2)]>0x0&&console[_0x45049f(0x1a5)](a26_0x4c4bc2[_0x45049f(0x191)](_0x3b0734[_0x45049f(0x1a2)]+_0x45049f(0x19a))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x39ba4c=a27_0x497c;(function(_0x42c8f3,_0x577c84){const _0x2635f1=a27_0x497c,_0x54adf4=_0x42c8f3();while(!![]){try{const _0x12a23d=-parseInt(_0x2635f1(0x13c))/0x1+parseInt(_0x2635f1(0x11b))/0x2+-parseInt(_0x2635f1(0x130))/0x3+-parseInt(_0x2635f1(0xec))/0x4+-parseInt(_0x2635f1(0xf9))/0x5+parseInt(_0x2635f1(0x13d))/0x6+-parseInt(_0x2635f1(0xf7))/0x7*(-parseInt(_0x2635f1(0xf4))/0x8);if(_0x12a23d===_0x577c84)break;else _0x54adf4['push'](_0x54adf4['shift']());}catch(_0x15fcd1){_0x54adf4['push'](_0x54adf4['shift']());}}}(a27_0x49e7,0x9217b));function a27_0x497c(_0x144fff,_0x4f18b4){_0x144fff=_0x144fff-0xe6;const _0x49e794=a27_0x49e7();let _0x497c59=_0x49e794[_0x144fff];return _0x497c59;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0xe4d50b from'chalk';function formatDuration(_0x456331){const _0x46f810=a27_0x497c;if(_0x456331<0x3c)return _0x456331+'s';if(_0x456331<0xe10)return Math['floor'](_0x456331/0x3c)+'m\x20'+_0x456331%0x3c+'s';const _0x50a4cc=Math['floor'](_0x456331/0xe10),_0x4997b8=Math[_0x46f810(0xed)](_0x456331%0xe10/0x3c);return _0x4997b8>0x0?_0x50a4cc+'h\x20'+_0x4997b8+'m':_0x50a4cc+'h';}function formatRelativeTime(_0xbb6fce){const _0x965938=a27_0x497c,_0x5a7301=Date['now']()-_0xbb6fce[_0x965938(0x116)](),_0x25584d=Math[_0x965938(0xed)](Math[_0x965938(0x12d)](_0x5a7301)/0x3e8);if(_0x25584d<0x3c)return _0x965938(0x10d);const _0x43b062=Math[_0x965938(0xed)](_0x25584d/0x3c);if(_0x43b062<0x3c)return _0x43b062+_0x965938(0x119);const _0x2ffa30=Math[_0x965938(0xed)](_0x43b062/0x3c);if(_0x2ffa30<0x18)return _0x2ffa30+_0x965938(0x115);const _0x5516e7=Math[_0x965938(0xed)](_0x2ffa30/0x18);if(_0x5516e7<0x1e)return _0x5516e7+_0x965938(0x137);return Math[_0x965938(0xed)](_0x5516e7/0x1e)+_0x965938(0x10a);}export class JobListCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]='jobs';['description']=a27_0x39ba4c(0xfa);async[a27_0x39ba4c(0xe6)](_0x3ad46c){const _0x2c00e6=a27_0x39ba4c,{options:_0x197c04,tdx:_0x44195a}=_0x3ad46c,_0x52636b=resolveLimit(_0x197c04[_0x2c00e6(0xfe)],DEFAULT_DISPLAY_LIMIT),_0x3e6921=_0x197c04[_0x2c00e6(0x122)];_0x197c04[_0x2c00e6(0x108)]&&(console[_0x2c00e6(0x141)](_0x2c00e6(0x110)+_0x52636b+_0x2c00e6(0x11d)),_0x3e6921&&console[_0x2c00e6(0x141)](_0x2c00e6(0x12c)+_0x3e6921));const _0x28d0b2=await withSpinner(_0x2c00e6(0x128),()=>_0x44195a['jobs']['list']({'from':0x0,'to':_0x52636b-0x1,'status':_0x3e6921}),{'verbose':_0x197c04[_0x2c00e6(0x108)]}),_0x412da3=_0x28d0b2[_0x2c00e6(0xf8)];console[_0x2c00e6(0x141)](_0x2c00e6(0x129)+_0x412da3[_0x2c00e6(0x135)]+_0x2c00e6(0x138)+(_0x412da3[_0x2c00e6(0x135)]!==0x1?'s':''));const _0x295a87=_0x197c04[_0x2c00e6(0x101)];if(isStructuredFormat(_0x197c04)){const _0x285446=_0x412da3[_0x2c00e6(0x134)](_0x11c526=>{const _0x14a343=_0x2c00e6;let _0xd60726;if(_0x11c526[_0x14a343(0x123)]&&_0x11c526[_0x14a343(0xe9)]){const _0x32779e=new Date(_0x11c526['start_at'])[_0x14a343(0x116)](),_0x2f48e7=new Date(_0x11c526['end_at'])[_0x14a343(0x116)]();_0xd60726=Math['round']((_0x2f48e7-_0x32779e)/0x3e8);}return{'job_id':_0x11c526[_0x14a343(0x12e)],'type':_0x11c526[_0x14a343(0xeb)]===_0x14a343(0x121)?_0x14a343(0x104):_0x11c526[_0x14a343(0xeb)],'status':_0x11c526[_0x14a343(0x122)],'user_name':_0x11c526[_0x14a343(0x113)],'duration_sec':_0xd60726,'created_at':_0x11c526[_0x14a343(0x125)],'started_at':_0x11c526[_0x14a343(0x123)],'end_at':_0x11c526['end_at']};});await handleSDKOutput(_0x285446,_0x197c04);}else for(const _0x338f05 of _0x412da3){const _0x515058=_0x338f05['status']===_0x2c00e6(0xf2)?a27_0xe4d50b[_0x2c00e6(0x11e)]:_0x338f05[_0x2c00e6(0x122)]===_0x2c00e6(0x141)?a27_0xe4d50b[_0x2c00e6(0x11a)]:a27_0xe4d50b[_0x2c00e6(0xef)],_0x414c78=_0x515058(_0x338f05[_0x2c00e6(0x122)]),_0x1ecd4b=getJobUrl(_0x295a87,_0x338f05['job_id']),_0x466a91=hyperlink(_0x338f05['job_id'],_0x1ecd4b),_0x5d5d51=a27_0xe4d50b['dim'](_0x338f05['type']===_0x2c00e6(0x121)?'trino':_0x338f05[_0x2c00e6(0xeb)]),_0x164323=[];if(_0x338f05[_0x2c00e6(0x123)]&&_0x338f05[_0x2c00e6(0xe9)]){const _0x3a55f5=Math['round']((new Date(_0x338f05['end_at'])['getTime']()-new Date(_0x338f05[_0x2c00e6(0x123)])[_0x2c00e6(0x116)]())/0x3e8);_0x164323[_0x2c00e6(0x112)](formatDuration(_0x3a55f5));}if(_0x338f05[_0x2c00e6(0xe9)])_0x164323[_0x2c00e6(0x112)](formatRelativeTime(new Date(_0x338f05[_0x2c00e6(0xe9)])));else _0x338f05['start_at']&&_0x164323[_0x2c00e6(0x112)](formatRelativeTime(new Date(_0x338f05[_0x2c00e6(0x123)])));const _0xc4b985=_0x164323[_0x2c00e6(0x135)]>0x0?a27_0xe4d50b[_0x2c00e6(0xef)]('\x20'+_0x164323[_0x2c00e6(0x10c)](',\x20')):'';console[_0x2c00e6(0x11c)]('⚡\x20'+_0x466a91+'\x20'+_0x5d5d51+'\x20'+_0x414c78+_0xc4b985);}return 0x0;}}function a27_0x49e7(){const _0x4426da=['job:kill','site','submit','args','trino','\x27\x20to\x20verify\x20the\x20job\x20status','job:result','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','verbose','Show\x20job\x20details','mo\x20ago','✔\x20Job\x20submitted','join','just\x20now','Job\x20type:\x20','Kill\x20a\x20job','Limit:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','push','user_name','Submitting\x20kill\x20request...','h\x20ago','getTime','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','debug','m\x20ago','red','2268842IyeVrm','log','\x20jobs','green','result','job:show','presto','status','start_at','jobType','created_at','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Query:\x20','Listing\x20jobs...','✔\x20Found\x20','INVALID_ARGUMENT','\x20row','Status\x20filter:\x20','abs','job_id','Cancelled','601965xzCuKe','database','yes','Submit\x20a\x20job','map','length','✔\x20Retrieved\x20','d\x20ago','\x20job','...','description','priority','924066vxrMJe','742518kVBLfY','kill','validate','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','error','execute','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','No\x20SQL\x20statements\x20found\x20in\x20file','end_at','Getting\x20job\x20results...','type','4756472EvwWpk','floor','Getting\x20job\x20details...','dim','Get\x20job\x20results','Database:\x20','success','jobs','163928QDjwpW','hive','file','959IXnWyt','data','5766035zCEsNN','List\x20jobs','name','query','information_schema','limit','Submitting\x20job...'];a27_0x49e7=function(){return _0x4426da;};return a27_0x49e7();}export class JobShowCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]=a27_0x39ba4c(0x120);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0x109);[a27_0x39ba4c(0x13f)](_0xf4184a){const _0x2e4828=a27_0x39ba4c,_0x4cf2ff=_0xf4184a[_0x2e4828(0x103)][0x0];if(!_0x4cf2ff)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a27_0x39ba4c(0xe6)](_0x34094d){const _0x2c0f41=a27_0x39ba4c,{options:_0x421db4,args:_0x10ac9e,tdx:_0x3735ad}=_0x34094d,_0x598bd3=_0x10ac9e[0x0],_0x4a7044=await withSpinner(_0x2c0f41(0xee),()=>_0x3735ad[_0x2c0f41(0xf3)]['show'](_0x598bd3),{'verbose':_0x421db4[_0x2c0f41(0x108)]}),_0x3d49e5=_0x4a7044[_0x2c0f41(0xf8)];let _0x55df22;if(_0x3d49e5['start_at']&&_0x3d49e5[_0x2c0f41(0xe9)]){const _0x336101=new Date(_0x3d49e5[_0x2c0f41(0x123)])[_0x2c0f41(0x116)](),_0x349b1c=new Date(_0x3d49e5[_0x2c0f41(0xe9)])[_0x2c0f41(0x116)]();_0x55df22=Math['round']((_0x349b1c-_0x336101)/0x3e8);}const _0x2c1cc8={'job_id':_0x3d49e5[_0x2c0f41(0x12e)],'type':_0x3d49e5[_0x2c0f41(0xeb)],'status':_0x3d49e5['status'],..._0x3d49e5['user_name']&&{'user_name':_0x3d49e5[_0x2c0f41(0x113)]},..._0x55df22!==undefined&&{'duration_sec':_0x55df22},..._0x3d49e5[_0x2c0f41(0x125)]&&{'created_at':_0x3d49e5['created_at']},..._0x3d49e5[_0x2c0f41(0x123)]&&{'started_at':_0x3d49e5[_0x2c0f41(0x123)]},..._0x3d49e5[_0x2c0f41(0xe9)]&&{'end_at':_0x3d49e5[_0x2c0f41(0xe9)]},..._0x3d49e5[_0x2c0f41(0x131)]&&{'database':_0x3d49e5[_0x2c0f41(0x131)]},..._0x3d49e5[_0x2c0f41(0x13b)]!==undefined&&{'priority':_0x3d49e5['priority']},..._0x3d49e5['url']&&{'url':_0x3d49e5['url']},..._0x3d49e5[_0x2c0f41(0xfc)]&&{'query':_0x3d49e5[_0x2c0f41(0xfc)]},..._0x3d49e5[_0x2c0f41(0x118)]&&{'debug':_0x3d49e5['debug']}};return await handleSingleObjectOutput(_0x2c1cc8,_0x421db4),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]=a27_0x39ba4c(0x100);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0x10f);[a27_0x39ba4c(0x13f)](_0x6cd483){const _0x35e359=a27_0x39ba4c,_0x2293d2=_0x6cd483[_0x35e359(0x103)][0x0];if(!_0x2293d2)return _0x35e359(0x140);return undefined;}async[a27_0x39ba4c(0xe6)](_0x11e8c6){const _0x23aee3=a27_0x39ba4c,{options:_0x533f5f,args:_0x242dd7,tdx:_0x178d9d}=_0x11e8c6,_0x3717f6=_0x242dd7[0x0];if(!_0x533f5f[_0x23aee3(0x132)]){const _0x5980a0=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x3717f6+'?');if(!_0x5980a0)return console[_0x23aee3(0x141)](_0x23aee3(0x12f)),0x0;}return await withSpinner(_0x23aee3(0x114),()=>_0x178d9d[_0x23aee3(0xf3)][_0x23aee3(0x13e)](_0x3717f6),{'verbose':_0x533f5f[_0x23aee3(0x108)]}),console[_0x23aee3(0x141)](_0x23aee3(0x107)+_0x3717f6),console['error'](_0x23aee3(0xe7)+_0x3717f6+_0x23aee3(0x105)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x39ba4c(0xfb)]='job:submit';['description']=a27_0x39ba4c(0x133);async[a27_0x39ba4c(0xe6)](_0x3688df){const _0xbb8281=a27_0x39ba4c,{options:_0x5307e8,args:_0x19705e,tdx:_0x60befc}=_0x3688df,_0x3c0824=_0x5307e8[_0xbb8281(0x124)]||_0xbb8281(0x104),_0x190bed=_0x5307e8[_0xbb8281(0xf6)],_0x46195b=_0x5307e8[_0xbb8281(0x131)]||_0xbb8281(0xfd),_0x4126c2=_0x5307e8[_0xbb8281(0x11f)];if(_0x3c0824!==_0xbb8281(0x104)&&_0x3c0824!==_0xbb8281(0xf5))throw new SDKError(ErrorCode[_0xbb8281(0x12a)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x155916;if(_0x190bed){if(_0x19705e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xbb8281(0x111));const _0x491365=readSqlStatementsFromFile(_0x190bed);if(_0x491365[_0xbb8281(0x135)]===0x0)throw new SDKError(ErrorCode[_0xbb8281(0x12a)],_0xbb8281(0xe8));if(_0x491365[_0xbb8281(0x135)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x155916=_0x491365[0x0];}else{if(!_0x19705e[0x0])throw new SDKError(ErrorCode[_0xbb8281(0x12a)],_0xbb8281(0x126));_0x155916=_0x19705e[0x0];}_0x5307e8[_0xbb8281(0x108)]&&(console['error'](_0xbb8281(0x10e)+_0x3c0824),console[_0xbb8281(0x141)](_0xbb8281(0xf1)+_0x46195b),console[_0xbb8281(0x141)](_0xbb8281(0x127)+_0x155916['substring'](0x0,0x64)+(_0x155916[_0xbb8281(0x135)]>0x64?_0xbb8281(0x139):'')));const _0x18019d=await withSpinner(_0xbb8281(0xff),()=>_0x60befc['jobs'][_0xbb8281(0x102)](_0x46195b,_0x155916,_0x3c0824,_0x4126c2),{'verbose':_0x5307e8[_0xbb8281(0x108)]}),_0x17416b=_0x18019d['data'];return console['error'](_0xbb8281(0x10b)),console[_0xbb8281(0x141)]('\x20\x20Job\x20ID:\x20'+_0x17416b['job_id']),await handleSDKOutput([_0x17416b],_0x5307e8),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a27_0x39ba4c(0x106);[a27_0x39ba4c(0x13a)]=a27_0x39ba4c(0xf0);[a27_0x39ba4c(0x13f)](_0x51065e){const _0x3cb235=a27_0x39ba4c,_0x373a60=_0x51065e[_0x3cb235(0x103)][0x0];if(!_0x373a60)return _0x3cb235(0x117);return undefined;}async[a27_0x39ba4c(0xe6)](_0xbb925c){const _0x3f4665=a27_0x39ba4c,{options:_0x1528a5,args:_0x16ad5d,tdx:_0x1ef085}=_0xbb925c,_0x5f3022=_0x16ad5d[0x0],_0x1dd3eb=await withSpinner(_0x3f4665(0xea),()=>_0x1ef085[_0x3f4665(0xf3)][_0x3f4665(0x11f)](_0x5f3022),{'verbose':_0x1528a5[_0x3f4665(0x108)]}),_0x3300df=_0x1dd3eb['data'];return console[_0x3f4665(0x141)](_0x3f4665(0x136)+_0x3300df[_0x3f4665(0x135)]+_0x3f4665(0x12b)+(_0x3300df[_0x3f4665(0x135)]!==0x1?'s':'')),await handleSDKOutput(_0x3300df,_0x1528a5),0x0;}}
|
|
1
|
+
const a27_0xcce535=a27_0x3acf;(function(_0x3ecf09,_0x1874c9){const _0x435843=a27_0x3acf,_0x5422a6=_0x3ecf09();while(!![]){try{const _0xe2cdb4=parseInt(_0x435843(0x1f5))/0x1+parseInt(_0x435843(0x1de))/0x2+parseInt(_0x435843(0x218))/0x3+parseInt(_0x435843(0x1e3))/0x4+-parseInt(_0x435843(0x201))/0x5+parseInt(_0x435843(0x211))/0x6*(parseInt(_0x435843(0x215))/0x7)+-parseInt(_0x435843(0x217))/0x8*(parseInt(_0x435843(0x222))/0x9);if(_0xe2cdb4===_0x1874c9)break;else _0x5422a6['push'](_0x5422a6['shift']());}catch(_0x4f1096){_0x5422a6['push'](_0x5422a6['shift']());}}}(a27_0x18a5,0x46eb8));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 a27_0x18a5(){const _0x2e8a9e=['show','d\x20ago','presto','Limit:\x20','6YTqhni','start_at','Submitting\x20job...','job:submit','2956247wRGoJF','Cancelled','158248TmgIyy','1375506peZNTb','Getting\x20job\x20details...','priority','job:show','push','INVALID_ARGUMENT','verbose','No\x20SQL\x20statements\x20found\x20in\x20file','job_id','job:kill','603neuoky','\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','length','limit','log','debug','job:result','Query:\x20','jobType','name','success','abs','args','Listing\x20jobs...','green','1046054iTGhwR','Database:\x20','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','database','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','1021068gVfrJq','user_name','status','description','m\x20ago','site','map','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','data','floor','round','✔\x20Job\x20submitted','h\x20ago','hive','error','trino','✔\x20Retrieved\x20','jobs','18400eNBHdO','Kill\x20a\x20job','dim','✔\x20Found\x20','Getting\x20job\x20results...','submit','query','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','type','url','created_at','substring','308510IFCbgd','\x20row','end_at','validate','Job\x20type:\x20','getTime','list','Status\x20filter:\x20','...','yes','execute','result'];a27_0x18a5=function(){return _0x2e8a9e;};return a27_0x18a5();}function a27_0x3acf(_0x5b2b89,_0x23640a){_0x5b2b89=_0x5b2b89-0x1d2;const _0x18a516=a27_0x18a5();let _0x3acfa6=_0x18a516[_0x5b2b89];return _0x3acfa6;}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x118cc8 from'chalk';function formatDuration(_0x4d2cd8){const _0x4fe81c=a27_0x3acf;if(_0x4d2cd8<0x3c)return _0x4d2cd8+'s';if(_0x4d2cd8<0xe10)return Math[_0x4fe81c(0x1ec)](_0x4d2cd8/0x3c)+'m\x20'+_0x4d2cd8%0x3c+'s';const _0x2be0e0=Math[_0x4fe81c(0x1ec)](_0x4d2cd8/0xe10),_0x147b5f=Math[_0x4fe81c(0x1ec)](_0x4d2cd8%0xe10/0x3c);return _0x147b5f>0x0?_0x2be0e0+'h\x20'+_0x147b5f+'m':_0x2be0e0+'h';}function formatRelativeTime(_0x268384){const _0x1e3547=a27_0x3acf,_0x2f2370=Date['now']()-_0x268384[_0x1e3547(0x206)](),_0x4d81f8=Math[_0x1e3547(0x1ec)](Math[_0x1e3547(0x1da)](_0x2f2370)/0x3e8);if(_0x4d81f8<0x3c)return'just\x20now';const _0x3d45f3=Math[_0x1e3547(0x1ec)](_0x4d81f8/0x3c);if(_0x3d45f3<0x3c)return _0x3d45f3+_0x1e3547(0x1e7);const _0x3d656f=Math[_0x1e3547(0x1ec)](_0x3d45f3/0x3c);if(_0x3d656f<0x18)return _0x3d656f+_0x1e3547(0x1ef);const _0x47152f=Math['floor'](_0x3d656f/0x18);if(_0x47152f<0x1e)return _0x47152f+_0x1e3547(0x20e);return Math[_0x1e3547(0x1ec)](_0x47152f/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0xcce535(0x1d8)]=a27_0xcce535(0x1f4);[a27_0xcce535(0x1e6)]='List\x20jobs';async[a27_0xcce535(0x20b)](_0x1b855b){const _0x450c6f=a27_0xcce535,{options:_0x849d8d,tdx:_0x36d358}=_0x1b855b,_0xd714dd=resolveLimit(_0x849d8d[_0x450c6f(0x1d2)],DEFAULT_DISPLAY_LIMIT),_0x5ddbee=_0x849d8d[_0x450c6f(0x1e5)];_0x849d8d[_0x450c6f(0x21e)]&&(console[_0x450c6f(0x1f1)](_0x450c6f(0x210)+_0xd714dd+'\x20jobs'),_0x5ddbee&&console[_0x450c6f(0x1f1)](_0x450c6f(0x208)+_0x5ddbee));const _0x2d4d9d=await withSpinner(_0x450c6f(0x1dc),()=>_0x36d358[_0x450c6f(0x1f4)][_0x450c6f(0x207)]({'from':0x0,'to':_0xd714dd-0x1,'status':_0x5ddbee}),{'verbose':_0x849d8d[_0x450c6f(0x21e)]}),_0x2f4267=_0x2d4d9d[_0x450c6f(0x1eb)];console['error'](_0x450c6f(0x1f8)+_0x2f4267[_0x450c6f(0x225)]+_0x450c6f(0x223)+(_0x2f4267[_0x450c6f(0x225)]!==0x1?'s':''));const _0x4e1879=_0x849d8d[_0x450c6f(0x1e8)];if(isStructuredFormat(_0x849d8d)){const _0x5a5e1c=_0x2f4267[_0x450c6f(0x1e9)](_0x4a7b9e=>{const _0x36522f=_0x450c6f;let _0x1e1406;if(_0x4a7b9e[_0x36522f(0x212)]&&_0x4a7b9e[_0x36522f(0x203)]){const _0x1224b7=new Date(_0x4a7b9e[_0x36522f(0x212)])[_0x36522f(0x206)](),_0x44647d=new Date(_0x4a7b9e[_0x36522f(0x203)])['getTime']();_0x1e1406=Math[_0x36522f(0x1ed)]((_0x44647d-_0x1224b7)/0x3e8);}return{'job_id':_0x4a7b9e[_0x36522f(0x220)],'type':_0x4a7b9e['type']===_0x36522f(0x20f)?_0x36522f(0x1f2):_0x4a7b9e[_0x36522f(0x1fd)],'status':_0x4a7b9e[_0x36522f(0x1e5)],'user_name':_0x4a7b9e['user_name'],'duration_sec':_0x1e1406,'created_at':_0x4a7b9e['created_at'],'started_at':_0x4a7b9e[_0x36522f(0x212)],'end_at':_0x4a7b9e[_0x36522f(0x203)]};});await handleSDKOutput(_0x5a5e1c,_0x849d8d);}else for(const _0x5f4e69 of _0x2f4267){const _0x597170=_0x5f4e69[_0x450c6f(0x1e5)]===_0x450c6f(0x1d9)?a27_0x118cc8[_0x450c6f(0x1dd)]:_0x5f4e69[_0x450c6f(0x1e5)]===_0x450c6f(0x1f1)?a27_0x118cc8['red']:a27_0x118cc8['dim'],_0x267120=_0x597170(_0x5f4e69[_0x450c6f(0x1e5)]),_0x1d9e4a=getJobUrl(_0x4e1879,_0x5f4e69[_0x450c6f(0x220)]),_0x5ed9e8=hyperlink(_0x5f4e69[_0x450c6f(0x220)],_0x1d9e4a),_0x372502=a27_0x118cc8[_0x450c6f(0x1f7)](_0x5f4e69[_0x450c6f(0x1fd)]===_0x450c6f(0x20f)?'trino':_0x5f4e69[_0x450c6f(0x1fd)]),_0x43b886=[];if(_0x5f4e69['start_at']&&_0x5f4e69[_0x450c6f(0x203)]){const _0x1de748=Math[_0x450c6f(0x1ed)]((new Date(_0x5f4e69['end_at'])['getTime']()-new Date(_0x5f4e69[_0x450c6f(0x212)])[_0x450c6f(0x206)]())/0x3e8);_0x43b886[_0x450c6f(0x21c)](formatDuration(_0x1de748));}if(_0x5f4e69[_0x450c6f(0x203)])_0x43b886[_0x450c6f(0x21c)](formatRelativeTime(new Date(_0x5f4e69['end_at'])));else _0x5f4e69[_0x450c6f(0x212)]&&_0x43b886[_0x450c6f(0x21c)](formatRelativeTime(new Date(_0x5f4e69[_0x450c6f(0x212)])));const _0x51983a=_0x43b886[_0x450c6f(0x225)]>0x0?a27_0x118cc8[_0x450c6f(0x1f7)]('\x20'+_0x43b886['join'](',\x20')):'';console[_0x450c6f(0x1d3)]('⚡\x20'+_0x5ed9e8+'\x20'+_0x372502+'\x20'+_0x267120+_0x51983a);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a27_0xcce535(0x21b);[a27_0xcce535(0x1e6)]='Show\x20job\x20details';[a27_0xcce535(0x204)](_0x18ca6f){const _0x334f90=a27_0xcce535,_0x534996=_0x18ca6f[_0x334f90(0x1db)][0x0];if(!_0x534996)return _0x334f90(0x1ea);return undefined;}async['execute'](_0x3c796b){const _0x553378=a27_0xcce535,{options:_0x1cb6a,args:_0x2a416d,tdx:_0x265bed}=_0x3c796b,_0x1d05d4=_0x2a416d[0x0],_0x4353d6=await withSpinner(_0x553378(0x219),()=>_0x265bed[_0x553378(0x1f4)][_0x553378(0x20d)](_0x1d05d4),{'verbose':_0x1cb6a['verbose']}),_0x55502f=_0x4353d6[_0x553378(0x1eb)];let _0x5aac7a;if(_0x55502f[_0x553378(0x212)]&&_0x55502f['end_at']){const _0x27d30f=new Date(_0x55502f[_0x553378(0x212)])['getTime'](),_0x39d67d=new Date(_0x55502f[_0x553378(0x203)])[_0x553378(0x206)]();_0x5aac7a=Math['round']((_0x39d67d-_0x27d30f)/0x3e8);}const _0x41d198={'job_id':_0x55502f[_0x553378(0x220)],'type':_0x55502f[_0x553378(0x1fd)],'status':_0x55502f[_0x553378(0x1e5)],..._0x55502f[_0x553378(0x1e4)]&&{'user_name':_0x55502f[_0x553378(0x1e4)]},..._0x5aac7a!==undefined&&{'duration_sec':_0x5aac7a},..._0x55502f[_0x553378(0x1ff)]&&{'created_at':_0x55502f[_0x553378(0x1ff)]},..._0x55502f['start_at']&&{'started_at':_0x55502f[_0x553378(0x212)]},..._0x55502f[_0x553378(0x203)]&&{'end_at':_0x55502f['end_at']},..._0x55502f[_0x553378(0x1e1)]&&{'database':_0x55502f[_0x553378(0x1e1)]},..._0x55502f[_0x553378(0x21a)]!==undefined&&{'priority':_0x55502f[_0x553378(0x21a)]},..._0x55502f[_0x553378(0x1fe)]&&{'url':_0x55502f[_0x553378(0x1fe)]},..._0x55502f[_0x553378(0x1fb)]&&{'query':_0x55502f[_0x553378(0x1fb)]},..._0x55502f[_0x553378(0x1d4)]&&{'debug':_0x55502f['debug']}};return await handleSingleObjectOutput(_0x41d198,_0x1cb6a),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0xcce535(0x1d8)]=a27_0xcce535(0x221);['description']=a27_0xcce535(0x1f6);[a27_0xcce535(0x204)](_0x3357ac){const _0x4ced42=a27_0xcce535,_0x49190a=_0x3357ac[_0x4ced42(0x1db)][0x0];if(!_0x49190a)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a27_0xcce535(0x20b)](_0x3ed432){const _0x21b6d6=a27_0xcce535,{options:_0x2a9455,args:_0x58a0f8,tdx:_0x6e8b0}=_0x3ed432,_0x2185ae=_0x58a0f8[0x0];if(!_0x2a9455[_0x21b6d6(0x20a)]){const _0xe9b263=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x2185ae+'?');if(!_0xe9b263)return console[_0x21b6d6(0x1f1)](_0x21b6d6(0x216)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x6e8b0['jobs']['kill'](_0x2185ae),{'verbose':_0x2a9455[_0x21b6d6(0x21e)]}),console[_0x21b6d6(0x1f1)](_0x21b6d6(0x1fc)+_0x2185ae),console[_0x21b6d6(0x1f1)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x2185ae+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0xcce535(0x1d8)]=a27_0xcce535(0x214);[a27_0xcce535(0x1e6)]='Submit\x20a\x20job';async['execute'](_0x305729){const _0x489d1a=a27_0xcce535,{options:_0x32bf2a,args:_0x22b429,tdx:_0x486676}=_0x305729,_0x2a8281=_0x32bf2a[_0x489d1a(0x1d7)]||_0x489d1a(0x1f2),_0x4ef391=_0x32bf2a['file'],_0x1d8aa7=_0x32bf2a[_0x489d1a(0x1e1)]||'information_schema',_0x31b51d=_0x32bf2a['result'];if(_0x2a8281!=='trino'&&_0x2a8281!==_0x489d1a(0x1f0))throw new SDKError(ErrorCode[_0x489d1a(0x21d)],_0x489d1a(0x1e0));let _0x50ffce;if(_0x4ef391){if(_0x22b429[0x0])throw new SDKError(ErrorCode[_0x489d1a(0x21d)],_0x489d1a(0x1e2));const _0xe03166=readSqlStatementsFromFile(_0x4ef391);if(_0xe03166[_0x489d1a(0x225)]===0x0)throw new SDKError(ErrorCode[_0x489d1a(0x21d)],_0x489d1a(0x21f));if(_0xe03166[_0x489d1a(0x225)]>0x1)throw new SDKError(ErrorCode[_0x489d1a(0x21d)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x50ffce=_0xe03166[0x0];}else{if(!_0x22b429[0x0])throw new SDKError(ErrorCode[_0x489d1a(0x21d)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x50ffce=_0x22b429[0x0];}_0x32bf2a[_0x489d1a(0x21e)]&&(console[_0x489d1a(0x1f1)](_0x489d1a(0x205)+_0x2a8281),console[_0x489d1a(0x1f1)](_0x489d1a(0x1df)+_0x1d8aa7),console['error'](_0x489d1a(0x1d6)+_0x50ffce[_0x489d1a(0x200)](0x0,0x64)+(_0x50ffce[_0x489d1a(0x225)]>0x64?_0x489d1a(0x209):'')));const _0x399dca=await withSpinner(_0x489d1a(0x213),()=>_0x486676[_0x489d1a(0x1f4)][_0x489d1a(0x1fa)](_0x1d8aa7,_0x50ffce,_0x2a8281,_0x31b51d),{'verbose':_0x32bf2a[_0x489d1a(0x21e)]}),_0x2c819c=_0x399dca[_0x489d1a(0x1eb)];return console[_0x489d1a(0x1f1)](_0x489d1a(0x1ee)),console[_0x489d1a(0x1f1)]('\x20\x20Job\x20ID:\x20'+_0x2c819c[_0x489d1a(0x220)]),await handleSDKOutput([_0x2c819c],_0x32bf2a),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0xcce535(0x1d8)]=a27_0xcce535(0x1d5);[a27_0xcce535(0x1e6)]='Get\x20job\x20results';[a27_0xcce535(0x204)](_0x45cd21){const _0x3ea2a1=a27_0xcce535,_0x33a91d=_0x45cd21[_0x3ea2a1(0x1db)][0x0];if(!_0x33a91d)return _0x3ea2a1(0x224);return undefined;}async[a27_0xcce535(0x20b)](_0x2d1495){const _0x2c2577=a27_0xcce535,{options:_0x19627c,args:_0x3a3b16,tdx:_0x2447d2}=_0x2d1495,_0x4cb49c=_0x3a3b16[0x0],_0x15386b=await withSpinner(_0x2c2577(0x1f9),()=>_0x2447d2['jobs'][_0x2c2577(0x20c)](_0x4cb49c),{'verbose':_0x19627c[_0x2c2577(0x21e)]}),_0x273b99=_0x15386b['data'];return console['error'](_0x2c2577(0x1f3)+_0x273b99[_0x2c2577(0x225)]+_0x2c2577(0x202)+(_0x273b99[_0x2c2577(0x225)]!==0x1?'s':'')),await handleSDKOutput(_0x273b99,_0x19627c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a28_0x41d493=a28_0x3602;(function(_0x530381,_0x49cf0d){const _0x3abcb2=a28_0x3602,_0x3f15e9=_0x530381();while(!![]){try{const _0x30b307=-parseInt(_0x3abcb2(0x13f))/0x1+parseInt(_0x3abcb2(0x15d))/0x2+-parseInt(_0x3abcb2(0x175))/0x3+parseInt(_0x3abcb2(0x170))/0x4*(parseInt(_0x3abcb2(0x152))/0x5)+parseInt(_0x3abcb2(0x147))/0x6+parseInt(_0x3abcb2(0x125))/0x7*(parseInt(_0x3abcb2(0x185))/0x8)+-parseInt(_0x3abcb2(0x14d))/0x9;if(_0x30b307===_0x49cf0d)break;else _0x3f15e9['push'](_0x3f15e9['shift']());}catch(_0x21b21c){_0x3f15e9['push'](_0x3f15e9['shift']());}}}(a28_0x19be,0x4a984));import a28_0x458e20 from'chalk';import a28_0x3d093a 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';function a28_0x3602(_0x4daaac,_0x591cf7){_0x4daaac=_0x4daaac-0xbd;const _0x19be5c=a28_0x19be();let _0x36024a=_0x19be5c[_0x4daaac];return _0x36024a;}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(_0x2bbd45){const _0x5afb22=a28_0x3602;return!_0x2bbd45&&(console[_0x5afb22(0x16c)](_0x5afb22(0x1c3)),console[_0x5afb22(0x16c)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x2bbd45;}function withJsonFormat(_0x2e0631){const _0x4e5317=a28_0x3602;if(!_0x2e0631[_0x4e5317(0x10f)]&&!_0x2e0631['json']&&!_0x2e0631[_0x4e5317(0x1c6)]&&!_0x2e0631[_0x4e5317(0x14c)])return{..._0x2e0631,'format':'json','json':!![]};return _0x2e0631;}function formatJourneyState(_0x45ab39){const _0x506019=a28_0x3602;switch(_0x45ab39){case _0x506019(0xe6):return a28_0x458e20[_0x506019(0x1ac)]('(running)');case'draft':return a28_0x458e20[_0x506019(0x1c4)](_0x506019(0xeb));case _0x506019(0xe2):return a28_0x458e20[_0x506019(0xf0)](_0x506019(0x186));case _0x506019(0x1c2):return a28_0x458e20[_0x506019(0x119)]('(completed)');case _0x506019(0x153):return a28_0x458e20[_0x506019(0x1c4)](_0x506019(0x183));default:return'('+_0x45ab39+')';}}function formatJourneyItem(_0x3f3567,_0x4d6756='',_0xa054){const _0x35edb5=a28_0x3602,_0x13c8ca=formatJourneyState(_0x3f3567[_0x35edb5(0x133)]),_0x4a0c8e=_0xa054?hyperlink(_0x3f3567[_0x35edb5(0x197)],_0xa054):_0x3f3567[_0x35edb5(0x197)];return _0x4d6756+_0x35edb5(0x13d)+_0x4a0c8e+'\x20'+_0x13c8ca;}function escapeRegex(_0x20f17d){const _0x5687de=a28_0x3602;return _0x20f17d[_0x5687de(0xda)](/[.*+?^${}()|[\]\\]/g,_0x5687de(0x17b));}function globToRegex(_0x2c6a54){const _0x4ace8f=a28_0x3602,_0x59c00a=_0x2c6a54[_0x4ace8f(0x10a)]('*')[_0x4ace8f(0x143)](escapeRegex);return new RegExp(_0x59c00a[_0x4ace8f(0x1a8)]('.*'),'i');}function buildRuleToNameMapping(_0x5c40b3){const _0x82ede=a28_0x3602,_0x1dd2f9=new Map();if(_0x5c40b3[_0x82ede(0x150)])for(const [_0x396902,_0x3dbc26]of Object['entries'](_0x5c40b3[_0x82ede(0x150)])){if(_0x3dbc26[_0x82ede(0x1ba)]){const _0x1e6b74=serializeRule(_0x3dbc26[_0x82ede(0x1ba)]),_0x1a868e=_0x1dd2f9[_0x82ede(0x174)](_0x1e6b74);_0x1a868e?_0x1a868e[_0x82ede(0xde)](_0x396902):_0x1dd2f9['set'](_0x1e6b74,[_0x396902]);}}return _0x1dd2f9;}async function resolveJourneyIdFromInput(_0x2c36e5,_0x5e6367,_0x368fc4){const _0x40614e=a28_0x3602,_0x3b9ddc=await resolveJourneyTarget(_0x2c36e5,_0x5e6367[_0x40614e(0x182)],_0x5e6367[_0x40614e(0x181)]),_0x5db834=_0x3b9ddc[_0x40614e(0x182)];if(!_0x5db834)throw new SDKError(ErrorCode[_0x40614e(0x16f)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x1d45ef=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x368fc4[_0x40614e(0x18d)][_0x40614e(0x178)](_0x5db834),{'verbose':_0x5e6367[_0x40614e(0x181)]}),_0x162313=_0x1d45ef[_0x40614e(0x11f)],_0x1d29c8=await withSpinner('Resolving\x20journey...',()=>_0x368fc4[_0x40614e(0x14b)]['resolveJourneyId'](_0x162313,_0x3b9ddc[_0x40614e(0x140)]),{'verbose':_0x5e6367['verbose']});return{'journeyId':_0x1d29c8[_0x40614e(0x11f)],'journeyName':_0x3b9ddc[_0x40614e(0x140)],'parentSegmentId':_0x162313};}function a28_0x19be(){const _0x75cf5a=['journey:push','split','options','entries','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Parent\x20segment:\x20','format','args','folderPath','Fetching\x20','cwd','conversion','Getting\x20journey\x20traffic\x20data...','parentName','Database:\x20','\x22\x20paused','blue','\x20not\x20found.\x20Available:\x20','Show\x20journey\x20table\x20column\x20mapping','folderId','Resolved\x20YAML\x20file:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','data','✔\x20Found\x20','Export\x20journey(s)\x20as\x20YAML\x20files','\x20(rule\x20match)','log','helpText','1061767BLdfbK','repeat','yes','dryRun','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','includeStats','getParentFull','Error:\x20Stage\x20\x22','createdAt','✔\x20Pulled\x20','Error:\x20Journey\x20not\x20found:\x20','Getting\x20journey\x20statistics...','-\x20no\x20files\x20written','pause','state','listJourneysWithFolders','Write\x20','Listing\x20journey\x20versions...','hasChanges','\x20unchanged\x20files','journeyId','Resume\x20a\x20paused\x20journey','\x20->\x20','stage','🗺️\x20','attributes','528918YVArOa','journeyName','name','content','map','test','renderStats','exitOrJumpSize','3066762cVqRXg','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Getting\x20journey\x20details...','\x20(draft)\x20—\x20\x22','journey','tsv','6213033nRFSgw','\x20details...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','segments','no_parent','499145hsaPsZ','archived','/e/','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Folder\x20path:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','getJourney','\x20=\x20','toLowerCase','connector_config','Pause\x20a\x20running\x20journey','454806nhgJXR','add','exitOrJumpRate','journey:traffic','/j/da/je','\x20journeys','segmentName','cyan','columns','\x22\x20resumed','goalSize','getLatestJourneyId','getStatistics','Getting\x20version\x20','database','error','diff','journey:resume','INVALID_ARGUMENT','20DlFEXa','Options:','activation','Error:\x20Invalid\x20--type\x20\x22','get','958812eJiQLh','set','relative','resolveParentId','journeyBundleId','\x0aChanges\x20to\x20\x27','\x5c$&','Fetching\x20users\x20and\x20connections...','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','folders','audienceId','✔\x20Context\x20set:\x20','verbose','parentSegment','(archived)','web','32KPhvLx','(paused)','\x20Opening\x20','Folder\x20path:\x20','\x20\x20-\x20','user','journey:list','connection','segment','includeHistory','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','red','List\x20journeys\x20in\x20current\x20context','json','has','errorCode','Show\x20journey\x20details','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleName','/app/ps/','getTrafficData','history','filter','journeys','isNew','\x20versions)','parent_segment','from','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','.yml','Table:\x20','journeyStages','targetDir','List\x20all\x20versions\x20of\x20a\x20journey','Error:\x20Version\x20','join','journey:activations','table','resolveSegment','green','segmentPushCommand','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Error:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Cancelled','sort','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Pattern:\x20','rootFolderId','stages','milestoneSize','buildIdToEmailMap','rule','Journey\x20name:\x20','Input:\x20','✔\x20Journey\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','List\x20activations\x20for\x20a\x20journey','find','getActivation','completed','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','dim','Resolving\x20version...','jsonl','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','versionNumber','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','site','reentryMode','\x0aPull\x20summary:','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','file','utf-8','getSegment','journey:pause','Fetching\x20journeys\x20and\x20folders...','Parent\x20segment:\x20','\x20\x20Journey\x20ID:\x20','activationParams','all','\x20activation','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','session','/j/da','Aborted.','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','completeMilestoneRate','description','completionRate','\x20journey\x20files\x20to\x20','stringify','size','replace','Listing\x20journey\x20activations...','buildIdToNameMap','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','push','listVersions','Resolving\x20parent\x20segment...','\x27\x20not\x20found\x20in\x20','paused','Resuming\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','localeCompare','launched','(root)','stageNameMap','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20\x20Name:\x20','(draft)','Target\x20directory:\x20','message','Show\x20journey\x20statistics','Found\x20','yellow','\x20\x20Statistics\x20not\x20available','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journey:pull','length','execute','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Creating\x20new\x20version...','then','updatedAt','\x20files?','filePath','Getting\x20column\x20mapping...','limit','\x20(ID:\x20','journey:view','listFolders','base','type','goal','resourceName','journey:versions','resume',',\x20version:\x20','Available\x20stages:\x20'];a28_0x19be=function(){return _0x75cf5a;};return a28_0x19be();}async function resolveJourneyTarget(_0x4722c1,_0x4370e1,_0x13efef){const _0x38392e=a28_0x3602;if(isYamlFilePath(_0x4722c1))try{const _0x2beea0=await resolveYamlFilePath(_0x4722c1);return _0x13efef&&(console[_0x38392e(0x16c)](_0x38392e(0x11d)+_0x4722c1),console[_0x38392e(0x16c)](_0x38392e(0x10e)+_0x2beea0[_0x38392e(0x182)]),console[_0x38392e(0x16c)](_0x38392e(0xea)+_0x2beea0['segmentName']),console[_0x38392e(0x16c)](_0x38392e(0x156)+(_0x2beea0[_0x38392e(0x111)]||_0x38392e(0xe7)))),{'journeyName':_0x2beea0[_0x38392e(0x163)],'parentSegment':_0x2beea0[_0x38392e(0x182)],'resolved':_0x2beea0};}catch(_0x299707){throw new SDKError(ErrorCode[_0x38392e(0x16f)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x299707[_0x38392e(0xed)]);}if(!_0x4370e1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x38392e(0x10d));return{'journeyName':_0x4722c1,'parentSegment':_0x4370e1};}export class JourneyListCommand extends BaseCommand{['name']=a28_0x41d493(0x18b);[a28_0x41d493(0xd5)]=a28_0x41d493(0x191);async[a28_0x41d493(0xf5)](_0x379983){const _0xaa3a2c=a28_0x41d493,{options:_0x5e92e1,args:_0x1afd77,tdx:_0x955a12}=_0x379983,_0x2ecf99=_0x1afd77[0x0],_0x16e87a=_0x5e92e1[_0xaa3a2c(0x182)];if(!_0x16e87a)return console[_0xaa3a2c(0x16c)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0xaa3a2c(0x1b0)),0x1;const _0xab2517=await withSpinner(_0xaa3a2c(0xe0),()=>_0x955a12['segment']['resolveParentId'](_0x16e87a),{'verbose':_0x5e92e1['verbose']}),_0x38508b=_0xab2517['data'];_0x5e92e1[_0xaa3a2c(0x181)]&&(console[_0xaa3a2c(0x16c)](_0xaa3a2c(0xca)+_0x16e87a+_0xaa3a2c(0xfe)+_0x38508b+')'),_0x2ecf99&&console[_0xaa3a2c(0x16c)](_0xaa3a2c(0x1b5)+_0x2ecf99));const _0x25cdff=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x955a12['segment'][_0xaa3a2c(0x12b)](_0x38508b),{'verbose':_0x5e92e1[_0xaa3a2c(0x181)]}),_0x2b460c=_0x25cdff[_0xaa3a2c(0x11f)],_0x28b4ae=_0x2b460c[_0xaa3a2c(0x1b6)],_0x1172bc=await withSpinner('Listing\x20journeys...',()=>_0x955a12[_0xaa3a2c(0x14b)][_0xaa3a2c(0x134)](_0x38508b,_0x28b4ae),{'verbose':_0x5e92e1['verbose']});let _0x1eb2eb=_0x1172bc['data'][_0xaa3a2c(0x19c)];const _0x4e8b8b=_0x1172bc[_0xaa3a2c(0x11f)][_0xaa3a2c(0x17e)],_0x464544=new Map();for(const _0x5b765c of _0x4e8b8b){_0x464544[_0xaa3a2c(0x176)](_0x5b765c['id'],_0x5b765c[_0xaa3a2c(0x141)]);}if(_0x2ecf99){const _0xc42e09=globToRegex(_0x2ecf99);_0x1eb2eb=_0x1eb2eb[_0xaa3a2c(0x19b)](_0x51a549=>_0xc42e09[_0xaa3a2c(0x144)](_0x51a549['journeyBundleName']));}console[_0xaa3a2c(0x16c)](_0xaa3a2c(0x120)+_0x1eb2eb[_0xaa3a2c(0xf4)]+'\x20journey'+(_0x1eb2eb['length']!==0x1?'s':''));const _0x2df40a=_0x51cb24=>{const _0x574dc6=_0xaa3a2c;return getConsoleNextUrl(_0x5e92e1[_0x574dc6(0xc0)],_0x574dc6(0x198)+_0x38508b+_0x574dc6(0x154)+_0x51cb24+_0x574dc6(0xd1));};if(_0x5e92e1[_0xaa3a2c(0x10f)]===_0xaa3a2c(0x1aa))await handleSDKOutput(_0x1eb2eb,_0x5e92e1);else{if(_0x5e92e1[_0xaa3a2c(0x10f)]===_0xaa3a2c(0x192)){const _0x438c2b=_0x1eb2eb[_0xaa3a2c(0x143)](_0xb59d45=>({..._0xb59d45,'url':_0x2df40a(_0xb59d45['id'])}));await handleSDKOutput(_0x438c2b,_0x5e92e1);}else{console['log']('['+_0x16e87a+']');const _0x4060e8=new Map(),_0x57c603=[];for(const _0x5546e6 of _0x1eb2eb){if(!_0x5546e6[_0xaa3a2c(0x11c)]||_0x5546e6[_0xaa3a2c(0x11c)]===_0x28b4ae)_0x57c603['push'](_0x5546e6);else{const _0x5f15db=_0x4060e8[_0xaa3a2c(0x174)](_0x5546e6[_0xaa3a2c(0x11c)])||[];_0x5f15db[_0xaa3a2c(0xde)](_0x5546e6),_0x4060e8[_0xaa3a2c(0x176)](_0x5546e6[_0xaa3a2c(0x11c)],_0x5f15db);}}const _0x56d13a=(_0x34e55f,_0x3aa8a1)=>_0x34e55f['journeyBundleName'][_0xaa3a2c(0xe5)](_0x3aa8a1['journeyBundleName'],undefined,{'sensitivity':'base'});_0x57c603[_0xaa3a2c(0x1b2)](_0x56d13a);for(const _0x14e93f of _0x57c603){console['log'](formatJourneyItem(_0x14e93f,'',_0x2df40a(_0x14e93f['id'])));}const _0x168816=[..._0x4060e8[_0xaa3a2c(0x10c)]()][_0xaa3a2c(0x1b2)]((_0x5e046f,_0x45643c)=>{const _0x4374f6=_0xaa3a2c,_0x24f13e=_0x464544[_0x4374f6(0x174)](_0x5e046f[0x0])||_0x5e046f[0x0],_0x258ee3=_0x464544[_0x4374f6(0x174)](_0x45643c[0x0])||_0x45643c[0x0];return _0x24f13e[_0x4374f6(0xe5)](_0x258ee3,undefined,{'sensitivity':_0x4374f6(0x101)});});for(const [_0x102acd,_0x1b78b4]of _0x168816){const _0x53127c=_0x464544[_0xaa3a2c(0x174)](_0x102acd)||_0x102acd;console[_0xaa3a2c(0x123)]('📁\x20'+_0x53127c),_0x1b78b4[_0xaa3a2c(0x1b2)](_0x56d13a);for(const _0x4ae567 of _0x1b78b4){console[_0xaa3a2c(0x123)](formatJourneyItem(_0x4ae567,'\x20\x20',_0x2df40a(_0x4ae567['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a28_0x41d493(0xff);[a28_0x41d493(0xd5)]=a28_0x41d493(0x195);async[a28_0x41d493(0xf5)](_0x154cd5){const _0x58f0a6=a28_0x41d493,{options:_0x4802ef,args:_0x397af4,tdx:_0x4cc4ca}=_0x154cd5,_0x34533a=_0x397af4[0x0];if(!_0x34533a)return console[_0x58f0a6(0x16c)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x58f0a6(0x16c)](_0x58f0a6(0x17d)),console[_0x58f0a6(0x16c)](_0x58f0a6(0x171)),console[_0x58f0a6(0x16c)](_0x58f0a6(0xc4)),0x1;_0x4802ef[_0x58f0a6(0x181)]&&console['error'](_0x58f0a6(0x1bc)+_0x34533a);const {journeyId:_0x506ad2,parentSegmentId:_0x391b55}=await resolveJourneyIdFromInput(_0x34533a,_0x4802ef,_0x4cc4ca);if(_0x4802ef[_0x58f0a6(0x184)]){const _0x4fdc7d=getConsoleNextUrl(_0x4802ef[_0x58f0a6(0xc0)],_0x58f0a6(0x198)+_0x391b55+'/e/'+_0x506ad2+'/j/da/je');return console[_0x58f0a6(0x16c)](a28_0x458e20[_0x58f0a6(0x1ac)]('✔')+_0x58f0a6(0x187)+a28_0x458e20[_0x58f0a6(0x164)](_0x4fdc7d)),openBrowser(_0x4fdc7d),0x0;}const _0x1094ed=await withSpinner(_0x58f0a6(0x149),()=>_0x4cc4ca[_0x58f0a6(0x14b)]['getJourney'](_0x506ad2),{'verbose':_0x4802ef['verbose']}),_0x1869ca=_0x1094ed['data'],_0x50cfd1=_0x4802ef[_0x58f0a6(0x12a)];let _0x59b6fb;if(_0x50cfd1)try{const _0x2bad7a=await withSpinner(_0x58f0a6(0x130),()=>_0x4cc4ca[_0x58f0a6(0x14b)][_0x58f0a6(0x169)](_0x506ad2),{'verbose':_0x4802ef['verbose']});_0x59b6fb=_0x2bad7a[_0x58f0a6(0x11f)];}catch{_0x4802ef[_0x58f0a6(0x181)]&&console[_0x58f0a6(0x16c)](_0x58f0a6(0xf1));}const _0x38f678=getConsoleNextUrl(_0x4802ef[_0x58f0a6(0xc0)],_0x58f0a6(0x198)+_0x391b55+_0x58f0a6(0x154)+_0x506ad2+'/j/da/je'),_0x462193={'id':_0x1869ca['id'],'name':_0x1869ca['attributes'][_0x58f0a6(0x141)],'description':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0xd5)],'state':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x133)],'paused':_0x1869ca[_0x58f0a6(0x13e)]['paused'],'reentry_mode':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0xc1)],'stages':_0x1869ca[_0x58f0a6(0x13e)]['journeyStages']?.[_0x58f0a6(0xf4)]||0x0,..._0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x103)]&&{'goal':_0x1869ca[_0x58f0a6(0x13e)][_0x58f0a6(0x103)]['name']},..._0x59b6fb&&{'statistics':{'size':_0x59b6fb[_0x58f0a6(0xd9)],'entered':_0x59b6fb['enteredSize'],'goal_achieved':_0x59b6fb[_0x58f0a6(0x167)],'completion_rate':_0x59b6fb[_0x58f0a6(0xd6)],'exit_or_jump':_0x59b6fb[_0x58f0a6(0x146)],'exit_or_jump_rate':_0x59b6fb[_0x58f0a6(0x15f)],'stages':_0x59b6fb[_0x58f0a6(0x1b7)]}},'url':_0x38f678};return await handleSingleObjectOutput(_0x462193,_0x4802ef),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:stats';['description']=a28_0x41d493(0xee);async['execute'](_0x2bcad1){const _0x24fcee=a28_0x41d493,{options:_0x141ae2,args:_0x39dc09,tdx:_0x445b74}=_0x2bcad1,_0x20d026=_0x39dc09[0x0];if(!requireNameOrPath(_0x20d026))return 0x1;_0x141ae2[_0x24fcee(0x181)]&&console[_0x24fcee(0x16c)](_0x24fcee(0x1bc)+_0x20d026);const _0x46ccff=_0x141ae2,_0x2df45b=_0x46ccff[_0x24fcee(0x1a0)],_0x22dd50=_0x46ccff['to'],_0x31b735=_0x46ccff[_0x24fcee(0x18e)],_0x140ffb=_0x46ccff[_0x24fcee(0x13c)];_0x31b735&&!_0x2df45b&&!_0x22dd50&&console['error'](_0x24fcee(0x1b4));const _0x5a9f30=_0x31b735?withJsonFormat(_0x141ae2):_0x141ae2,{journeyId:_0x3153eb,journeyName:_0x17bcf9}=await resolveJourneyIdFromInput(_0x20d026,_0x5a9f30,_0x445b74),_0x4d208d=_0x2df45b||_0x22dd50?{'from':_0x2df45b,'to':_0x22dd50}:undefined,_0x57b9e3=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x24fcee(0xcd)]([_0x445b74[_0x24fcee(0x14b)][_0x24fcee(0x158)](_0x3153eb),_0x445b74['journey']['getStatistics'](_0x3153eb,_0x4d208d)]),{'verbose':_0x5a9f30[_0x24fcee(0x181)]}),[_0x1d7bb2,_0x58541a]=_0x57b9e3[_0x24fcee(0x11f)];if(!_0x58541a||_0x58541a[_0x24fcee(0x139)]===null)return console[_0x24fcee(0x16c)](_0x24fcee(0xc3)+_0x17bcf9),console[_0x24fcee(0x16c)](_0x24fcee(0x196)),0x0;const _0x543472=buildStageNameMap(_0x1d7bb2),_0x5041e1=!!(_0x4d208d&&_0x58541a[_0x24fcee(0x19a)]?.[_0x24fcee(0xf4)]),_0x2ebc47={'stageNameMap':_0x543472,'hasPeriod':_0x5041e1,'includeHistory':!!_0x31b735};if(_0x140ffb&&_0x58541a[_0x24fcee(0x1b7)]){const _0x167cb6=_0x58541a[_0x24fcee(0x1b7)][_0x24fcee(0x1c0)](_0xbc47e1=>{const _0x5b9ba1=_0x24fcee,_0x44ed7f=_0x543472[_0x5b9ba1(0x174)](_0xbc47e1['id'])??'';return _0x44ed7f['toLowerCase']()===_0x140ffb[_0x5b9ba1(0x15a)]();});if(_0x167cb6)return await handleSingleObjectOutput(formatStageStats(_0x167cb6,_0x2ebc47),_0x5a9f30),0x0;const _0x2c3d9c=_0x58541a[_0x24fcee(0x1b7)][_0x24fcee(0x143)](_0x542783=>_0x543472['get'](_0x542783['id'])??_0x542783['id']);return console[_0x24fcee(0x16c)](_0x24fcee(0x12c)+_0x140ffb+'\x22\x20not\x20found'),console[_0x24fcee(0x16c)](_0x24fcee(0x108)+_0x2c3d9c[_0x24fcee(0x1a8)](',\x20')),0x1;}const _0x40056a=_0x58541a[_0x24fcee(0x1b7)]?.[_0x24fcee(0x143)](_0x2fdb67=>formatStageStats(_0x2fdb67,_0x2ebc47)),_0x2b4d2e=assembleJourneyStats(_0x58541a,{'from':_0x2df45b,'to':_0x22dd50,'includeHistory':_0x31b735});return await this[_0x24fcee(0x145)](_0x2b4d2e,_0x40056a??[],_0x5a9f30),0x0;}async[a28_0x41d493(0x145)](_0x2562e2,_0xa3b678,_0x125940){const _0x49f757=a28_0x41d493,_0x1eec51=_0x125940[_0x49f757(0x10f)]===_0x49f757(0x192)||_0x125940['format']===_0x49f757(0x1c6)||_0x125940[_0x49f757(0x192)]||_0x125940[_0x49f757(0x1c6)];if(_0x1eec51){_0x2562e2[_0x49f757(0x1b7)]=_0xa3b678,await handleSingleObjectOutput(_0x2562e2,_0x125940);return;}await handleSingleObjectOutput(_0x2562e2,_0x125940);for(const _0x497f91 of _0xa3b678){console[_0x49f757(0x123)](''),console[_0x49f757(0x123)](String(a28_0x458e20['cyan']['bold']('['+_0x497f91[_0x49f757(0x141)]+']'))+a28_0x458e20[_0x49f757(0x1c4)]('\x20'+_0x497f91['id']));const {id:_0x47b584,name:_0x443909,..._0xeb5be}=_0x497f91;await handleSingleObjectOutput(_0xeb5be,_0x125940);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a28_0x41d493(0x160);[a28_0x41d493(0xd5)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x41d493(0xf5)](_0x377338){const _0x45756b=a28_0x41d493,{options:_0x47a022,args:_0x2c146b,tdx:_0x568e42}=_0x377338,_0x56059e=_0x2c146b[0x0];if(!requireNameOrPath(_0x56059e))return 0x1;_0x47a022['verbose']&&console['error'](_0x45756b(0x1bc)+_0x56059e);const _0x4e6791=_0x47a022,_0x168939=_0x4e6791[_0x45756b(0x102)],_0x941469=_0x4e6791['from'],_0x450cab=_0x4e6791['to'],_0x407027=_0x4e6791[_0x45756b(0xfd)];if(_0x168939&&_0x168939!==_0x45756b(0x114)&&_0x168939!==_0x45756b(0x172))return console[_0x45756b(0x16c)](_0x45756b(0x173)+_0x168939+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x4c5410=withJsonFormat(_0x47a022),{journeyId:_0x456010,journeyName:_0x1a0ed7}=await resolveJourneyIdFromInput(_0x56059e,_0x4c5410,_0x568e42),_0x35b9e1={'type':_0x168939,'from':_0x941469,'to':_0x450cab,'limit':_0x407027},_0x4bd97a=await withSpinner(_0x45756b(0x115),()=>_0x568e42['journey'][_0x45756b(0x199)](_0x456010,_0x35b9e1),{'verbose':_0x4c5410[_0x45756b(0x181)]}),_0x58458d=_0x4bd97a[_0x45756b(0x11f)],_0x1265ce=_0x58458d['conversion']&&(_0x58458d['conversion']['nodes'][_0x45756b(0xf4)]>0x0||_0x58458d[_0x45756b(0x114)]['links'][_0x45756b(0xf4)]>0x0),_0x3160ab=_0x58458d['activation']&&_0x58458d[_0x45756b(0x172)]['length']>0x0;if(!_0x1265ce&&!_0x3160ab)return console[_0x45756b(0x16c)](_0x45756b(0x1a1)+_0x1a0ed7),console[_0x45756b(0x16c)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x941469&&_0x450cab&&console[_0x45756b(0x16c)](_0x45756b(0x14f)),0x0;return await handleSingleObjectOutput(_0x58458d,_0x4c5410),0x0;}}function formatStageStats(_0x5854f8,_0x278e40){const _0x14819c=a28_0x41d493,_0x5c8ecb=_0x278e40['hasPeriod']&&_0x5854f8[_0x14819c(0x19a)]?.[_0x14819c(0xf4)]?aggregateStageHistory(_0x5854f8[_0x14819c(0x19a)]):{'size':_0x5854f8[_0x14819c(0xd9)],'entered':_0x5854f8['enteredSize'],'milestone':_0x5854f8[_0x14819c(0x1b8)],'milestone_rate':_0x5854f8[_0x14819c(0xd4)],'exit_or_jump':_0x5854f8[_0x14819c(0x146)],'exit_or_jump_rate':_0x5854f8[_0x14819c(0x15f)]},_0x5f48c1={'id':_0x5854f8['id'],'name':_0x278e40[_0x14819c(0xe8)]['get'](_0x5854f8['id'])??_0x5854f8['id'],..._0x5c8ecb};return _0x278e40['hasPeriod']&&_0x278e40[_0x14819c(0x18e)]&&_0x5854f8[_0x14819c(0x19a)]&&(_0x5f48c1[_0x14819c(0x19a)]=_0x5854f8['history']),_0x5f48c1;}export class JourneyPauseCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0xc8);[a28_0x41d493(0xd5)]=a28_0x41d493(0x15c);async[a28_0x41d493(0xf5)](_0x237674){const _0x251c4b=a28_0x41d493,{options:_0x3269e6,args:_0x422701,tdx:_0x336185}=_0x237674,_0x4c0c2c=_0x422701[0x0];if(!requireNameOrPath(_0x4c0c2c))return 0x1;_0x3269e6[_0x251c4b(0x181)]&&console[_0x251c4b(0x16c)](_0x251c4b(0x1bc)+_0x4c0c2c);const {journeyId:_0x1fc28e,journeyName:_0x3ef8f9}=await resolveJourneyIdFromInput(_0x4c0c2c,_0x3269e6,_0x336185);if(!_0x3269e6[_0x251c4b(0x127)]){const _0x1fe633=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x3ef8f9+'\x22?');if(!_0x1fe633)return console[_0x251c4b(0x16c)](_0x251c4b(0x1b1)),0x0;}const _0x36d544=await withSpinner('Pausing\x20journey...',()=>_0x336185[_0x251c4b(0x14b)][_0x251c4b(0x132)](_0x1fc28e),{'verbose':_0x3269e6[_0x251c4b(0x181)]}),_0x171e44=_0x36d544[_0x251c4b(0x11f)];return console[_0x251c4b(0x16c)](_0x251c4b(0x1bd)+_0x171e44[_0x251c4b(0x13e)][_0x251c4b(0x141)]+_0x251c4b(0x118)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0x16e);[a28_0x41d493(0xd5)]=a28_0x41d493(0x13a);async[a28_0x41d493(0xf5)](_0x3fed8f){const _0x2c3670=a28_0x41d493,{options:_0x3011bb,args:_0x2c27d1,tdx:_0x1f6242}=_0x3fed8f,_0x2ecbea=_0x2c27d1[0x0];if(!requireNameOrPath(_0x2ecbea))return 0x1;_0x3011bb[_0x2c3670(0x181)]&&console[_0x2c3670(0x16c)](_0x2c3670(0x1bc)+_0x2ecbea);const {journeyId:_0x2761ee,journeyName:_0x2f42de}=await resolveJourneyIdFromInput(_0x2ecbea,_0x3011bb,_0x1f6242);if(!_0x3011bb[_0x2c3670(0x127)]){const _0x7c8a98=await confirm(_0x2c3670(0xd3)+_0x2f42de+'\x22?');if(!_0x7c8a98)return console[_0x2c3670(0x16c)](_0x2c3670(0x1b1)),0x0;}const _0x16515b=await withSpinner(_0x2c3670(0xe3),()=>_0x1f6242[_0x2c3670(0x14b)][_0x2c3670(0x106)](_0x2761ee),{'verbose':_0x3011bb[_0x2c3670(0x181)]}),_0x44fb6e=_0x16515b[_0x2c3670(0x11f)];return console['error']('✔\x20Journey\x20\x22'+_0x44fb6e[_0x2c3670(0x13e)][_0x2c3670(0x141)]+_0x2c3670(0x166)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0xf3);[a28_0x41d493(0xd5)]=a28_0x41d493(0x121);async['execute'](_0x3e7f50){const _0x52778c=a28_0x41d493,{options:_0x48dbf6,args:_0x273310,tdx:_0x504e82}=_0x3e7f50,_0x16b26e=_0x48dbf6,_0x40c7ce=_0x273310[0x0],_0xc68356=_0x40c7ce&&isYamlFilePath(_0x40c7ce),_0x2fc671=await resolveTarget({'arg':_0xc68356?_0x40c7ce:undefined,'contextParent':_0x48dbf6['parentSegment'],'cwd':process[_0x52778c(0x113)]()});if(!isSuccessfulResolution(_0x2fc671))return _0x2fc671[_0x52778c(0x194)]===_0x52778c(0x151)?(console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0x157))),console[_0x52778c(0x16c)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x52778c(0x16c)](_0x52778c(0xcf)),console[_0x52778c(0x16c)](_0x52778c(0xdd)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a28_0x458e20[_0x52778c(0x190)](_0x52778c(0x1af)+_0x2fc671[_0x52778c(0xed)]+'\x0a')),_0x2fc671[_0x52778c(0x124)]&&console['error'](a28_0x458e20['cyan'](_0x2fc671[_0x52778c(0x124)]))),0x1;let _0x3292c8=_0xc68356?undefined:_0x40c7ce,_0x50f6f1,_0x10c46b;_0x2fc671[_0x52778c(0x102)]==='file'&&(_0x3292c8=_0x2fc671[_0x52778c(0x104)],_0x50f6f1=_0x2fc671['filePath'],_0x10c46b=_0x2fc671[_0x52778c(0x111)]);const _0xe3459=_0x2fc671[_0x52778c(0x116)],_0x58db88=_0x2fc671[_0x52778c(0x1a5)];_0x16b26e[_0x52778c(0x181)]&&(console[_0x52778c(0x16c)](_0x52778c(0xca)+_0xe3459),console[_0x52778c(0x16c)](_0x52778c(0xec)+_0x58db88),_0x3292c8&&console['error'](_0x52778c(0x1bb)+_0x3292c8),_0x50f6f1&&console[_0x52778c(0x16c)]('Target\x20file:\x20'+_0x50f6f1),_0x10c46b&&console[_0x52778c(0x16c)](_0x52778c(0x188)+_0x10c46b));const _0x522d95=await withSpinner(_0x52778c(0xe0),()=>_0x504e82['segment'][_0x52778c(0x178)](_0xe3459),{'verbose':_0x48dbf6[_0x52778c(0x181)]}),_0x593326=_0x522d95[_0x52778c(0x11f)],{journeys:_0x92004f,folders:_0x29a180}=await withSpinner(_0x52778c(0xc9),async()=>{const _0x2389bf=_0x52778c,[_0x59db14,_0x4df834]=await Promise[_0x2389bf(0xcd)]([_0x504e82[_0x2389bf(0x14b)]['listJourneysFromParentSegment'](_0x593326,undefined,{'includeAllVersions':!![]}),_0x504e82[_0x2389bf(0x18d)][_0x2389bf(0x100)](_0x593326)]);return{'journeys':_0x59db14,'folders':_0x4df834};},{'verbose':_0x48dbf6[_0x52778c(0x181)]})[_0x52778c(0xf8)](_0x4250c7=>_0x4250c7[_0x52778c(0x11f)]);let _0x24282c=_0x92004f;const _0x1fadc0=buildFolderIdToPathMap(_0x29a180);if(_0x3292c8){const _0x3be666=_0x24282c[_0x52778c(0x19b)](_0x488aa1=>_0x488aa1['journeyBundleName'][_0x52778c(0x15a)]()===_0x3292c8[_0x52778c(0x15a)]());if(_0x3be666['length']===0x0)return console[_0x52778c(0x16c)](_0x52778c(0x12f)+_0x3292c8),console[_0x52778c(0x16c)](_0x52778c(0x129)),0x1;_0x24282c=_0x3be666;}if(_0x10c46b!==undefined){const _0x2a1d53=_0x24282c['filter'](_0xd38921=>{const _0x378105=_0x52778c,_0x499b41=_0xd38921[_0x378105(0x11c)]?_0x1fadc0[_0x378105(0x174)](_0xd38921[_0x378105(0x11c)])||'':'';return _0x499b41===_0x10c46b;});if(_0x2a1d53[_0x52778c(0xf4)]===0x0&&_0x24282c[_0x52778c(0xf4)]>0x0){console[_0x52778c(0x16c)]('Error:\x20Journey\x20\x27'+_0x3292c8+_0x52778c(0xe1)+(_0x10c46b||'root\x20folder')),console[_0x52778c(0x16c)](_0x52778c(0x1ae));for(const _0x396739 of _0x24282c){const _0x3de52b=_0x396739['folderId']?_0x1fadc0['get'](_0x396739['folderId'])||'':'';console['error'](_0x52778c(0x189)+(_0x3de52b||_0x52778c(0xe7))+'/'+_0x396739['journeyBundleName']);}return 0x1;}_0x24282c=_0x2a1d53;}if(_0x24282c[_0x52778c(0xf4)]===0x0)return console[_0x52778c(0x16c)]('No\x20journeys\x20found'),0x0;const _0x5c3fd7=new Map();for(const _0x988115 of _0x24282c){const _0x202d28=_0x988115['journeyBundleId'];!_0x5c3fd7[_0x52778c(0x193)](_0x202d28)&&_0x5c3fd7[_0x52778c(0x176)](_0x202d28,[]),_0x5c3fd7[_0x52778c(0x174)](_0x202d28)[_0x52778c(0xde)](_0x988115);}for(const _0x455dba of _0x5c3fd7['values']()){_0x455dba[_0x52778c(0x1b2)]((_0x3fb0bb,_0x377307)=>(_0x3fb0bb['versionNumber']||0x0)-(_0x377307[_0x52778c(0xbe)]||0x0));}const _0xe5b61a=[],{idToEmailMap:_0x46b132,connectionIdToNameMap:_0x51092e}=await withSpinner(_0x52778c(0x17c),async()=>{const _0x4b4a56=_0x52778c,[_0xa02adc,_0x53e905]=await Promise['all']([_0x504e82[_0x4b4a56(0x18a)][_0x4b4a56(0x1b9)](),_0x504e82[_0x4b4a56(0x18c)][_0x4b4a56(0xdc)]()]);return{'idToEmailMap':_0xa02adc,'connectionIdToNameMap':_0x53e905};},{'verbose':_0x48dbf6['verbose']})[_0x52778c(0xf8)](_0x45c0b2=>_0x45c0b2[_0x52778c(0x11f)]);for(const _0x293828 of _0x5c3fd7['values']()){const _0x400de8=_0x293828[0x0][_0x52778c(0x197)],_0x5a039a=_0x293828[0x0][_0x52778c(0x11c)],_0x45fcc=_0x5a039a?_0x1fadc0[_0x52778c(0x174)](_0x5a039a)||'':'',_0x55c832=_0x45fcc?a28_0x3d093a[_0x52778c(0x1a8)](_0x58db88,_0x45fcc):_0x58db88,_0x5cde52=_0x50f6f1||a28_0x3d093a['join'](_0x55c832,sanitizeFileName(_0x400de8)+_0x52778c(0x1a2));let _0x3bd894,_0x279e63;if(existsSync(_0x5cde52))try{const _0x14196d=readFileSync(_0x5cde52,_0x52778c(0xc6)),_0x1ca8de=parseYamlString(_0x14196d);_0x279e63=_0x1ca8de,_0x3bd894=buildRuleToNameMapping(_0x1ca8de),_0x16b26e[_0x52778c(0x181)]&&_0x3bd894['size']>0x0&&console[_0x52778c(0x16c)](_0x52778c(0xef)+_0x3bd894[_0x52778c(0xd9)]+_0x52778c(0x11e)+_0x400de8);}catch(_0xbf48e5){_0x16b26e[_0x52778c(0x181)]&&console[_0x52778c(0x16c)](_0x52778c(0xbd)+_0xbf48e5[_0x52778c(0xed)]);}const _0x3b0266=[],_0x4c4637=new Set(),_0x1275b2=new Map(),_0x24f78a=new Map(),_0x29d5e5=new Set(),_0x1495c7=new Map(),_0xd9df35=new Map(),_0x4fdadd=createJumpTargetCache();await withProgressSpinner(_0x52778c(0x112)+_0x400de8+'...',async _0xd5356f=>{const _0x5043c6=_0x52778c;for(const _0x300048 of _0x293828){const _0x3b0ca1=_0x293828[_0x5043c6(0xf4)]>0x1?_0x300048[_0x5043c6(0x197)]+'\x20v'+(_0x300048[_0x5043c6(0xbe)]||0x1):_0x300048[_0x5043c6(0x197)];_0xd5356f['setPhase'](_0x5043c6(0x112)+_0x3b0ca1);const _0x59448a=await _0x504e82[_0x5043c6(0x14b)][_0x5043c6(0x158)](_0x300048['id']),_0x5a047b=_0x59448a[_0x5043c6(0x13e)]?.[_0x5043c6(0x17f)],_0x5efb33={'resolveSegment':async _0x4e7c06=>{const _0x263c40=_0x5043c6;if(!_0x5a047b)return{'name':_0x4e7c06,'isJourneyLocal':![]};const _0x316b65=_0x1275b2[_0x263c40(0x174)](_0x4e7c06);if(_0x316b65)return _0x316b65;try{const _0xcc9389=await _0x504e82[_0x263c40(0x18d)][_0x263c40(0xc7)](_0x5a047b,_0x4e7c06),_0x31977e=_0xcc9389['kind']===SEGMENT_KIND_JOURNEY;let _0x2c08ba,_0x56704b=_0xcc9389[_0x263c40(0x141)];if(_0x31977e&&_0xcc9389['rule']){const _0x6fb1ed=await segmentResponseToDef(_0xcc9389,{'resolveSegmentName':async _0x2b4f81=>{const _0xf5aebc=_0x263c40,_0x39097b=_0x1275b2[_0xf5aebc(0x174)](_0x2b4f81);if(_0x39097b)return _0x39097b[_0xf5aebc(0x141)];const _0x2c4235=await _0x5efb33[_0xf5aebc(0x1ab)](_0x2b4f81);return _0x2c4235[_0xf5aebc(0x141)];}}),_0x1c2f25=_0x6fb1ed[_0x263c40(0x1ba)];_0x2c08ba={'description':_0xcc9389[_0x263c40(0xd5)],'rule':_0x1c2f25};const _0x231bfc=serializeRule(_0x1c2f25),_0x5b1700=_0x24f78a[_0x263c40(0x174)](_0x231bfc);if(_0x5b1700)_0x56704b=_0x5b1700,_0x2c08ba=undefined,_0x16b26e[_0x263c40(0x181)]&&console['error'](_0x263c40(0x1b3)+_0xcc9389[_0x263c40(0x141)]+_0x263c40(0x13b)+_0x5b1700);else{let _0x37c401=![];if(_0x3bd894){const _0x2a9971=_0x3bd894['get'](_0x231bfc);if(_0x2a9971){const _0x45d3e8=_0x2a9971[_0x263c40(0x1c0)](_0x26731c=>!_0x4c4637['has'](_0x26731c));_0x45d3e8&&(_0x56704b=_0x45d3e8,_0x4c4637['add'](_0x45d3e8),_0x24f78a[_0x263c40(0x176)](_0x231bfc,_0x45d3e8),_0x37c401=!![],_0x16b26e[_0x263c40(0x181)]&&console[_0x263c40(0x16c)](_0x263c40(0x1be)+_0x45d3e8+_0x263c40(0x122)));}}if(!_0x37c401){const _0x59dee6=generateJourneyLocalName(_0xcc9389[_0x263c40(0x141)]);_0x59dee6&&(_0x56704b=_0x59dee6);let _0x4c0f2b=_0x56704b,_0x48ff59=0x2;while(_0x4c4637['has'](_0x4c0f2b)){_0x4c0f2b=_0x56704b+'_'+_0x48ff59,_0x48ff59++;}_0x4c4637[_0x263c40(0x15e)](_0x4c0f2b),_0x24f78a[_0x263c40(0x176)](_0x231bfc,_0x4c0f2b),_0x56704b=_0x4c0f2b;}}}const _0x379638={'name':_0x56704b,'isJourneyLocal':_0x31977e,'definition':_0x2c08ba};return _0x1275b2[_0x263c40(0x176)](_0x4e7c06,_0x379638),_0x379638;}catch(_0x1f8885){return _0x48dbf6['verbose']&&console[_0x263c40(0x16c)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x4e7c06+':\x20'+_0x1f8885[_0x263c40(0xed)]),{'name':_0x4e7c06,'isJourneyLocal':![]};}},'resolveActivation':async _0x4516d3=>{const _0x3ec3ba=_0x5043c6,_0x510ae5=_0x1495c7[_0x3ec3ba(0x174)](_0x4516d3);if(_0x510ae5)return _0x510ae5;try{const _0xfef99d=await _0x504e82['journey'][_0x3ec3ba(0x1c1)](_0x300048['id'],_0x4516d3),_0x5e3b81=journeyActivationStepToYaml(_0xfef99d,_0x46b132,_0x51092e),_0x15bd95=JSON[_0x3ec3ba(0xd8)]({'name':_0x5e3b81[_0x3ec3ba(0x141)],'connection':_0x5e3b81[_0x3ec3ba(0x18c)],'connector_config':_0x5e3b81[_0x3ec3ba(0x15b)]}),_0x4795c9=_0xd9df35['get'](_0x15bd95);if(_0x4795c9){const _0xc7d6ad={'name':_0x4795c9,'isJourneyLocal':!![],'definition':_0x5e3b81};return _0x1495c7[_0x3ec3ba(0x176)](_0x4516d3,_0xc7d6ad),_0xc7d6ad;}const _0x40e835=_0xfef99d['attributes'][_0x3ec3ba(0xcc)][_0x3ec3ba(0x141)]||_0x4516d3,_0x46dd77=sanitizeYamlKey(_0x40e835)||'activation_'+_0x4516d3;let _0x2f09ab=_0x46dd77,_0x4dbc3d=0x2;while(_0x29d5e5[_0x3ec3ba(0x193)](_0x2f09ab)){_0x2f09ab=_0x46dd77+'_'+_0x4dbc3d,_0x4dbc3d++;}_0x29d5e5[_0x3ec3ba(0x15e)](_0x2f09ab),_0xd9df35[_0x3ec3ba(0x176)](_0x15bd95,_0x2f09ab);const _0x580757={'name':_0x2f09ab,'isJourneyLocal':!![],'definition':_0x5e3b81};return _0x1495c7[_0x3ec3ba(0x176)](_0x4516d3,_0x580757),_0x580757;}catch(_0x494b3b){return _0x48dbf6[_0x3ec3ba(0x181)]&&console['error'](_0x3ec3ba(0xf6)+_0x4516d3+':\x20'+_0x494b3b['message']),{'name':_0x4516d3,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x41c9c2,_0x214edb)=>{const _0x492e8f=_0x5043c6;return resolveJumpTarget(_0x41c9c2,_0x214edb,_0x4fdadd,_0x1efcc1=>_0x504e82[_0x492e8f(0x14b)]['getJourney'](_0x1efcc1));}},_0x8245f1=await journeyResponseToDef(_0x59448a,_0x5efb33);_0x3b0266[_0x5043c6(0xde)]({'item':_0x300048,'yaml':_0x8245f1});}},{'verbose':_0x48dbf6[_0x52778c(0x181)]});const _0x24a70a=await _0x504e82[_0x52778c(0x14b)][_0x52778c(0x168)](_0x293828[0x0][_0x52778c(0x179)]),_0x3867e8=buildMergedJourneyDef(_0x3b0266,_0x3bd894,_0x24a70a),_0x447c21=normalizeJourneyDef(_0x3867e8,_0x279e63),_0x4f2605=toYamlString(_0x447c21),_0x33c23e=_0x50f6f1||a28_0x3d093a['join'](_0x55c832,sanitizeFileName(_0x400de8)+_0x52778c(0x1a2));!_0x50f6f1&&_0x45fcc&&!existsSync(_0x55c832)&&mkdirSync(_0x55c832,{'recursive':!![]});const _0x170c44=a28_0x3d093a[_0x52778c(0x177)](process[_0x52778c(0x113)](),_0x33c23e);if(existsSync(_0x33c23e)){const _0x55472f=readFileSync(_0x33c23e,_0x52778c(0xc6)),_0x32b1e0=generateDiff(_0x55472f,_0x4f2605),_0x5e5831=hasChanges(_0x32b1e0);_0xe5b61a[_0x52778c(0xde)]({'relativePath':_0x170c44,'absolutePath':_0x33c23e,'content':_0x4f2605,'isNew':![],'hasChanges':_0x5e5831,'diff':_0x5e5831?formatDiffWithColors(_0x32b1e0):undefined});}else _0xe5b61a[_0x52778c(0xde)]({'relativePath':_0x170c44,'absolutePath':_0x33c23e,'content':_0x4f2605,'isNew':!![],'hasChanges':![]});}const _0x417711=_0xe5b61a[_0x52778c(0x19b)](_0x1456ac=>_0x1456ac[_0x52778c(0x19d)]),_0x2eed22=_0xe5b61a['filter'](_0xb0c560=>!_0xb0c560['isNew']&&_0xb0c560[_0x52778c(0x137)]),_0x917acc=_0xe5b61a['filter'](_0x1b0adf=>!_0x1b0adf[_0x52778c(0x19d)]&&!_0x1b0adf[_0x52778c(0x137)]),_0x33f2f2=_0x24282c['length'],_0x572a3d=_0x5c3fd7['size'],_0x5b1aa8=_0x33f2f2>_0x572a3d?'\x20('+_0x33f2f2+_0x52778c(0x19e):'';console[_0x52778c(0x16c)](_0x52778c(0xc2)),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0x164)](_0x572a3d+_0x52778c(0x162))+a28_0x458e20['dim'](_0x5b1aa8)),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20['green']('+\x20'+_0x417711['length']+'\x20new\x20files')),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0xf0)]('~\x20'+_0x2eed22[_0x52778c(0xf4)]+'\x20changed\x20files')),console[_0x52778c(0x16c)]('\x20\x20'+a28_0x458e20[_0x52778c(0x1c4)]('=\x20'+_0x917acc[_0x52778c(0xf4)]+_0x52778c(0x138))),console['error']('\x20\x20Target:\x20'+a28_0x458e20['cyan'](_0x58db88)+'\x0a');if(_0x2eed22[_0x52778c(0xf4)]>0x0)for(const _0x358736 of _0x2eed22){console[_0x52778c(0x16c)](_0x52778c(0x17a)+_0x358736['relativePath']+'\x27:'),console[_0x52778c(0x16c)]('─'[_0x52778c(0x126)](0x3c)),console['error'](_0x358736[_0x52778c(0x16d)]),console[_0x52778c(0x16c)]('─'[_0x52778c(0x126)](0x3c));}if(_0x16b26e[_0x52778c(0x128)])return console['error'](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0x18f))),0x0;if(_0x417711[_0x52778c(0xf4)]===0x0&&_0x2eed22[_0x52778c(0xf4)]===0x0)return console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0x1ac)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0xe3459},_0x16b26e[_0x52778c(0xd0)]),console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0x1ac)](_0x52778c(0x180)+a28_0x458e20['dim']('parent_segment')+'\x20=\x20'+a28_0x458e20[_0x52778c(0x164)](_0xe3459))),0x0;if(!_0x16b26e['yes']&&(_0x417711[_0x52778c(0xf4)]>0x0||_0x2eed22[_0x52778c(0xf4)]>0x0)){if(!isInteractive())return console['error'](a28_0x458e20[_0x52778c(0x190)]('\x0aError:'),_0x52778c(0x155)),console['error'](a28_0x458e20[_0x52778c(0x1c4)](_0x52778c(0xf2))),0x1;const _0x44c7ff=await confirmKey(_0x52778c(0x135)+(_0x417711[_0x52778c(0xf4)]+_0x2eed22['length'])+_0x52778c(0xfa));if(!_0x44c7ff)return console[_0x52778c(0x16c)](a28_0x458e20[_0x52778c(0xf0)](_0x52778c(0xd2)),_0x52778c(0x131)),0x1;}!existsSync(_0x58db88)&&mkdirSync(_0x58db88,{'recursive':!![]});const _0x168ba7=a28_0x3d093a[_0x52778c(0x1a8)](_0x58db88,'tdx.json');writeFileSync(_0x168ba7,createTdxConfigContent(_0xe3459),'utf-8');for(const _0x2c78b1 of _0xe5b61a){(_0x2c78b1[_0x52778c(0x19d)]||_0x2c78b1[_0x52778c(0x137)])&&writeFileSync(_0x2c78b1['absolutePath'],_0x2c78b1[_0x52778c(0x142)],_0x52778c(0xc6));}return console[_0x52778c(0x16c)](a28_0x458e20['green'](_0x52778c(0x12e)+(_0x417711['length']+_0x2eed22[_0x52778c(0xf4)])+_0x52778c(0xd7)+_0x58db88)),saveSessionContext({'parent_segment':_0xe3459},_0x16b26e[_0x52778c(0xd0)]),console[_0x52778c(0x16c)](a28_0x458e20['green']('✔\x20Context\x20set:\x20'+a28_0x458e20[_0x52778c(0x1c4)](_0x52778c(0x19f))+_0x52778c(0x159)+a28_0x458e20['cyan'](_0xe3459))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:columns';['description']=a28_0x41d493(0x11b);async['execute'](_0x51e475){const _0x3a2591=a28_0x41d493,{options:_0x39632c,args:_0x2e7850,tdx:_0x229da6}=_0x51e475,_0x1676b1=_0x2e7850[0x0];if(!requireNameOrPath(_0x1676b1))return 0x1;_0x39632c['verbose']&&console[_0x3a2591(0x16c)](_0x3a2591(0x1bc)+_0x1676b1);const {journeyId:_0xe00a54}=await resolveJourneyIdFromInput(_0x1676b1,_0x39632c,_0x229da6),_0x49ca95=await withSpinner(_0x3a2591(0xfc),()=>_0x229da6[_0x3a2591(0x14b)]['getColumnMapping'](_0xe00a54),{'verbose':_0x39632c[_0x3a2591(0x181)]}),_0x1ca1e0=_0x49ca95['data'];return console[_0x3a2591(0x123)](_0x3a2591(0x117)+_0x1ca1e0[_0x3a2591(0x16b)]),console['log'](_0x3a2591(0x1a3)+_0x1ca1e0['table']),await handleSDKOutput(_0x1ca1e0[_0x3a2591(0x165)],_0x39632c),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a28_0x41d493(0x1a9);[a28_0x41d493(0xd5)]=a28_0x41d493(0x1bf);async['execute'](_0x2a64f2){const _0x2e8031=a28_0x41d493,{options:_0x13ef87,args:_0x26aaf7,tdx:_0x41609f}=_0x2a64f2,_0x2b05af=_0x26aaf7[0x0];if(!requireNameOrPath(_0x2b05af))return 0x1;_0x13ef87[_0x2e8031(0x181)]&&console['error']('Input:\x20'+_0x2b05af);const {journeyId:_0xecb324}=await resolveJourneyIdFromInput(_0x2b05af,_0x13ef87,_0x41609f),_0x430b7e=await withSpinner(_0x2e8031(0xdb),()=>_0x41609f[_0x2e8031(0x14b)]['listActivationsFlat'](_0xecb324),{'verbose':_0x13ef87[_0x2e8031(0x181)]}),_0x15c723=_0x430b7e[_0x2e8031(0x11f)];return console[_0x2e8031(0x16c)]('Found\x20'+_0x15c723[_0x2e8031(0xf4)]+_0x2e8031(0xce)+(_0x15c723[_0x2e8031(0xf4)]!==0x1?'s':'')),await handleSDKOutput(_0x15c723,_0x13ef87),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x41d493(0x141)]=a28_0x41d493(0x109);[a28_0x41d493(0xd5)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a28_0x41d493(0x1ad)]=new SegmentPushCommand();async[a28_0x41d493(0xf5)](_0x1870d7){const _0x527bc5=a28_0x41d493,_0x4d1ab1=_0x1870d7[_0x527bc5(0x110)][0x0];let _0x13111d;if(_0x4d1ab1){const _0x413500=await resolveTarget({'arg':_0x4d1ab1,'contextParent':_0x1870d7[_0x527bc5(0x10b)][_0x527bc5(0x182)],'cwd':process[_0x527bc5(0x113)]()});isSuccessfulResolution(_0x413500)&&_0x413500[_0x527bc5(0x102)]===_0x527bc5(0xc5)&&(_0x13111d=_0x413500[_0x527bc5(0xfb)]);}const _0x2984b7={..._0x1870d7,'options':{..._0x1870d7['options'],'journeysOnly':!![],..._0x13111d&&{'singleFilePath':_0x13111d}}};return this[_0x527bc5(0x1ad)][_0x527bc5(0xf5)](_0x2984b7);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a28_0x41d493(0x105);['description']=a28_0x41d493(0x1a6);async[a28_0x41d493(0xf5)](_0x2be745){const _0x111bd5=a28_0x41d493,{options:_0xc9f447,args:_0x172eba,tdx:_0x3ff23f}=_0x2be745,_0x51ca20=_0x172eba[0x0];if(!requireNameOrPath(_0x51ca20))return 0x1;if(_0xc9f447[_0x111bd5(0x181)])console[_0x111bd5(0x16c)](_0x111bd5(0x1bc)+_0x51ca20);const {journeyId:_0x2e8242}=await resolveJourneyIdFromInput(_0x51ca20,_0xc9f447,_0x3ff23f),_0x5b4ae1=await withSpinner(_0x111bd5(0x136),()=>_0x3ff23f['journey'][_0x111bd5(0xdf)](_0x2e8242),{'verbose':_0xc9f447[_0x111bd5(0x181)]}),{bundleName:_0x427d8a,versions:_0x54743a,latestJourneyId:_0x14aa21}=_0x5b4ae1[_0x111bd5(0x11f)];console['error'](_0x427d8a+':\x20'+_0x54743a[_0x111bd5(0xf4)]+'\x20version'+(_0x54743a[_0x111bd5(0xf4)]!==0x1?'s':''));const _0x45ec7f=_0x54743a[_0x111bd5(0x143)](_0x5b5aff=>({'version':_0x5b5aff[_0x111bd5(0xbe)],'journey_id':_0x5b5aff[_0x111bd5(0x139)],'name':_0x5b5aff[_0x111bd5(0x141)],'state':_0x5b5aff[_0x111bd5(0x133)],'paused':_0x5b5aff[_0x111bd5(0xe2)],'latest':_0x5b5aff[_0x111bd5(0x139)]===_0x14aa21,'created_at':_0x5b5aff[_0x111bd5(0x12d)]}));return await handleSDKOutput(_0x45ec7f,_0xc9f447),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x41d493(0x141)]='journey:version:create';[a28_0x41d493(0xd5)]=a28_0x41d493(0xe4);async[a28_0x41d493(0xf5)](_0x570e68){const _0xfce973=a28_0x41d493,{options:_0x307704,args:_0xdb26e2,tdx:_0x3ad5b9}=_0x570e68,_0x2e3160=_0xdb26e2[0x0];if(!requireNameOrPath(_0x2e3160))return 0x1;if(_0x307704[_0xfce973(0x181)])console['error'](_0xfce973(0x1bc)+_0x2e3160);const {journeyId:_0x3ba0ff,journeyName:_0x3479f7}=await resolveJourneyIdFromInput(_0x2e3160,_0x307704,_0x3ad5b9);if(!_0x307704['yes']){const _0xab9335=await confirm(_0xfce973(0x148)+_0x3479f7+'\x22?');if(!_0xab9335)return console['error'](_0xfce973(0x1b1)),0x0;}const _0x53d6a9=await withSpinner(_0xfce973(0xf7),()=>_0x3ad5b9[_0xfce973(0x14b)]['createVersion'](_0x3ba0ff),{'verbose':_0x307704[_0xfce973(0x181)]}),_0x186af1=_0x53d6a9[_0xfce973(0x11f)];return console[_0xfce973(0x16c)](a28_0x458e20[_0xfce973(0x1ac)]('✔')+'\x20Created\x20v'+_0x186af1[_0xfce973(0x13e)][_0xfce973(0xbe)]+_0xfce973(0x14a)+_0x186af1['attributes'][_0xfce973(0x141)]+'\x22'),console[_0xfce973(0x16c)](_0xfce973(0xcb)+_0x186af1['id']),await handleSingleObjectOutput({'id':_0x186af1['id'],'name':_0x186af1['attributes'][_0xfce973(0x141)],'version':_0x186af1[_0xfce973(0x13e)][_0xfce973(0xbe)],'state':_0x186af1['attributes'][_0xfce973(0x133)],'bundle_id':_0x186af1[_0xfce973(0x13e)][_0xfce973(0x179)],'created_at':_0x186af1[_0xfce973(0x13e)][_0xfce973(0x12d)]},_0x307704),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a28_0x41d493(0xd5)]=a28_0x41d493(0xe9);async[a28_0x41d493(0xf5)](_0x2b4a18){const _0x5b0b7d=a28_0x41d493,{options:_0x4b771f,args:_0x3347fd,tdx:_0x467429}=_0x2b4a18,_0x12bfeb=_0x3347fd[0x0];if(!requireNameOrPath(_0x12bfeb))return 0x1;const _0x270fe9=_0x4b771f['version'];if(!_0x270fe9)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x5b0b7d(0x16c)](_0x5b0b7d(0xbf)),0x1;const _0x3979d8=parseInt(_0x270fe9,0xa);if(isNaN(_0x3979d8)||_0x3979d8<0x1)return console[_0x5b0b7d(0x16c)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x270fe9),0x1;if(_0x4b771f['verbose'])console[_0x5b0b7d(0x16c)]('Input:\x20'+_0x12bfeb+_0x5b0b7d(0x107)+_0x3979d8);const {journeyId:_0x3e4fba,parentSegmentId:_0x554c48}=await resolveJourneyIdFromInput(_0x12bfeb,_0x4b771f,_0x467429),_0xd4ecee=await withSpinner(_0x5b0b7d(0x1c5),()=>_0x467429['journey'][_0x5b0b7d(0xdf)](_0x3e4fba),{'verbose':_0x4b771f['verbose']}),{versions:_0x48bdd6,latestJourneyId:_0xa94afd}=_0xd4ecee['data'],_0xed5654=_0x48bdd6[_0x5b0b7d(0x1c0)](_0x4c39cb=>_0x4c39cb[_0x5b0b7d(0xbe)]===_0x3979d8);if(!_0xed5654){const _0x2038c0=_0x48bdd6['map'](_0x5b2e6e=>'v'+_0x5b2e6e[_0x5b0b7d(0xbe)])[_0x5b0b7d(0x1a8)](',\x20');return console[_0x5b0b7d(0x16c)](_0x5b0b7d(0x1a7)+_0x3979d8+_0x5b0b7d(0x11a)+_0x2038c0),0x1;}const _0x14ed28=await withSpinner(_0x5b0b7d(0x16a)+_0x3979d8+_0x5b0b7d(0x14e),()=>_0x467429[_0x5b0b7d(0x14b)][_0x5b0b7d(0x158)](_0xed5654[_0x5b0b7d(0x139)]),{'verbose':_0x4b771f[_0x5b0b7d(0x181)]}),_0x3eba42=_0x14ed28[_0x5b0b7d(0x11f)],_0x3b2e3e=getConsoleNextUrl(_0x4b771f['site'],_0x5b0b7d(0x198)+_0x554c48+_0x5b0b7d(0x154)+_0xed5654['journeyId']+_0x5b0b7d(0x161));return await handleSingleObjectOutput({'id':_0x3eba42['id'],'name':_0x3eba42[_0x5b0b7d(0x13e)]['name'],'version':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xbe)],'description':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xd5)],'state':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x133)],'paused':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0xe2)],'reentry_mode':_0x3eba42['attributes'][_0x5b0b7d(0xc1)],'stages':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x1a4)]?.[_0x5b0b7d(0xf4)]||0x0,..._0x3eba42['attributes'][_0x5b0b7d(0x103)]&&{'goal':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x103)][_0x5b0b7d(0x141)]},'latest':_0xed5654[_0x5b0b7d(0x139)]===_0xa94afd,'created_at':_0x3eba42[_0x5b0b7d(0x13e)][_0x5b0b7d(0x12d)],'updated_at':_0x3eba42['attributes'][_0x5b0b7d(0xf9)],'url':_0x3b2e3e},_0x4b771f),0x0;}}
|
|
1
|
+
const a28_0x2caa77=a28_0x4bd0;(function(_0x5f2f48,_0x3a0118){const _0x28be39=a28_0x4bd0,_0x886048=_0x5f2f48();while(!![]){try{const _0x534572=parseInt(_0x28be39(0x206))/0x1*(-parseInt(_0x28be39(0x17b))/0x2)+parseInt(_0x28be39(0x21a))/0x3*(-parseInt(_0x28be39(0x17d))/0x4)+parseInt(_0x28be39(0x1c7))/0x5+parseInt(_0x28be39(0x1e3))/0x6+-parseInt(_0x28be39(0x216))/0x7*(parseInt(_0x28be39(0x13a))/0x8)+parseInt(_0x28be39(0x143))/0x9*(-parseInt(_0x28be39(0x179))/0xa)+-parseInt(_0x28be39(0x1d2))/0xb*(-parseInt(_0x28be39(0x1c9))/0xc);if(_0x534572===_0x3a0118)break;else _0x886048['push'](_0x886048['shift']());}catch(_0x4ae37d){_0x886048['push'](_0x886048['shift']());}}}(a28_0x2ca6,0xf03ae));import a28_0xca0a23 from'chalk';import a28_0x3d6e5c 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(_0x1218e1){const _0x48180a=a28_0x4bd0;return!_0x1218e1&&(console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x48180a(0x1d6))),!!_0x1218e1;}function a28_0x2ca6(){const _0x32dea8=['resume','sort','Table:\x20','🗺️\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','resolveParentId','Fetching\x20','27axRwCy','blue','Export\x20journey(s)\x20as\x20YAML\x20files','✔\x20Pulled\x20','all','relative','dryRun','renderStats','Fetching\x20parent\x20segment...','links','\x20\x20Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','segmentName','reentryMode','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','root\x20folder','yes','journeyName','Getting\x20journey\x20details...','listActivationsFlat','Resume\x20a\x20paused\x20journey','map','Warning:\x20Could\x20not\x20resolve\x20segment\x20','connection','/j/da/je','(root)','isNew','\x20journeys','milestoneSize','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','utf-8','getJourney','\x20\x20Name:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','completed','rule','localeCompare','helpText','getStatistics','options','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x22\x20resumed','completionRate','Journey\x20name:\x20','journey','(draft)','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','limit','parent_segment','listJourneysFromParentSegment','attributes','journeyId','2610340kVlsTJ','\x20unchanged\x20files','732322LfJViu','parentSegment','160tgIsZa','push','hasChanges','\x20\x20Preserving\x20local\x20segment\x20name:\x20','folderPath','name','filter','toLowerCase','Pause\x20a\x20running\x20journey','dim','database','(completed)','verbose','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','journeyStages','Fetching\x20users\x20and\x20connections...','file','\x20(draft)\x20—\x20\x22','absolutePath','journey:push','Error:\x20Journey\x20\x27','List\x20journeys\x20in\x20current\x20context','\x22\x20not\x20found','No\x20statistics\x20available\x20for\x20journey:\x20','tsv','\x22\x20paused','paused','Fetching\x20journeys\x20and\x20folders...','journey:columns','error','has','nodes','stringify','\x27\x20not\x20found\x20in\x20','Getting\x20journey\x20traffic\x20data...','Found\x20','List\x20all\x20versions\x20of\x20a\x20journey','getSegment','/app/ps/','find','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','journey:versions','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Resuming\x20journey...','Input:\x20','segment','then','goal','Creating\x20new\x20version...','journey:list','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','connector_config','test','(archived)','\x20version','Target\x20directory:\x20','journeys','pause','journey:version:create','from','\x20(rule\x20match)','Cancelled','/e/','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','state','split','folders','base','\x20\x20Journey\x20ID:\x20','INVALID_ARGUMENT','versionNumber','table','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','add','6573610yVByso','\x20journey','20400684jXOREE','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x20activation','set','Error:\x20Journey\x20not\x20found:\x20','activation_','\x20Created\x20v','getActivation','✔\x20Found\x20','11gBgYew','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','conversion','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','session','.yml','createVersion','description','Error:\x20Stage\x20\x22','join','repeat','Resolved\x20YAML\x20file:\x20','getTrafficData','activation','format','3488334aSHhHg','segments','listJourneysWithFolders','getLatestJourneyId','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','filePath','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','json','version','yellow','includeHistory','exitOrJumpSize','type','Target\x20file:\x20','archived','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Aborted.','Pausing\x20journey...','goalSize','journey:traffic','hasPeriod','Error:\x20Parent\x20segment\x20context\x20required','journey:version:view','journeyBundleId','execute','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','✔\x20Journey\x20\x22','No\x20journeys\x20found','getParentFull','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Error:\x20Invalid\x20--type\x20\x22','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Write\x20','red','1zTRMEi','\x20=\x20','buildIdToEmailMap','values','\x5c$&','journey:pause','cwd','\x20\x20Folder\x20path:\x20','message','Error:\x20','Parent\x20segment:\x20','listVersions','Show\x20journey\x20statistics','segmentPushCommand','\x20\x20-\x20','includeStats','21KdsOuR','setPhase','journey:view','Getting\x20journey\x20statistics...','73908PBlvKo','\x20\x20Target:\x20','length','relativePath','jsonl','site','tdx.json','data','journeyBundleName','green','...','createdAt','exitOrJumpRate','Resolving\x20journey...','\x20->\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20details...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20files?','(running)','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Show\x20journey\x20table\x20column\x20mapping','get','Resolving\x20parent\x20segment...','history','✔\x20Context\x20set:\x20','log','Resolving\x20version...','cyan','Listing\x20journey\x20versions...','Getting\x20column\x20mapping...','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','folderId','journey:stats','\x0aError:','Error:\x20--version\x20option\x20is\x20required','Getting\x20version\x20','size','web',',\x20version:\x20','\x20changed\x20files','Show\x20journey\x20details','journey:activations','buildIdToNameMap','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','(paused)','enteredSize','Pattern:\x20','1273288FctevD','stages'];a28_0x2ca6=function(){return _0x32dea8;};return a28_0x2ca6();}function a28_0x4bd0(_0x6bb7b2,_0x17cce0){_0x6bb7b2=_0x6bb7b2-0x11b;const _0x2ca69a=a28_0x2ca6();let _0x4bd061=_0x2ca69a[_0x6bb7b2];return _0x4bd061;}function withJsonFormat(_0x217e44){const _0x4b8965=a28_0x4bd0;if(!_0x217e44[_0x4b8965(0x1e2)]&&!_0x217e44[_0x4b8965(0x1ea)]&&!_0x217e44['jsonl']&&!_0x217e44[_0x4b8965(0x195)])return{..._0x217e44,'format':'json','json':!![]};return _0x217e44;}function formatJourneyState(_0x46f7f5){const _0x70fc97=a28_0x4bd0;switch(_0x46f7f5){case'launched':return a28_0xca0a23[_0x70fc97(0x223)](_0x70fc97(0x11d));case'draft':return a28_0xca0a23['dim'](_0x70fc97(0x172));case _0x70fc97(0x197):return a28_0xca0a23[_0x70fc97(0x1ec)](_0x70fc97(0x137));case _0x70fc97(0x167):return a28_0xca0a23[_0x70fc97(0x144)](_0x70fc97(0x188));case _0x70fc97(0x1f1):return a28_0xca0a23[_0x70fc97(0x186)](_0x70fc97(0x1b2));default:return'('+_0x46f7f5+')';}}function formatJourneyItem(_0x3b25b7,_0x22b2a7='',_0x167919){const _0x28320c=a28_0x4bd0,_0x77554e=formatJourneyState(_0x3b25b7[_0x28320c(0x1bd)]),_0x2d293f=_0x167919?hyperlink(_0x3b25b7[_0x28320c(0x222)],_0x167919):_0x3b25b7[_0x28320c(0x222)];return _0x22b2a7+_0x28320c(0x13f)+_0x2d293f+'\x20'+_0x77554e;}function escapeRegex(_0x47d891){const _0x1152d1=a28_0x4bd0;return _0x47d891['replace'](/[.*+?^${}()|[\]\\]/g,_0x1152d1(0x20a));}function globToRegex(_0x1ed1e2){const _0x262944=a28_0x4bd0,_0xd9dfeb=_0x1ed1e2[_0x262944(0x1be)]('*')[_0x262944(0x159)](escapeRegex);return new RegExp(_0xd9dfeb[_0x262944(0x1dd)]('.*'),'i');}function buildRuleToNameMapping(_0x934094){const _0x3d0687=a28_0x4bd0,_0x83cce3=new Map();if(_0x934094[_0x3d0687(0x1e4)])for(const [_0xfa924b,_0x547650]of Object['entries'](_0x934094[_0x3d0687(0x1e4)])){if(_0x547650['rule']){const _0x1edb8f=serializeRule(_0x547650[_0x3d0687(0x168)]),_0x433946=_0x83cce3[_0x3d0687(0x120)](_0x1edb8f);_0x433946?_0x433946[_0x3d0687(0x17e)](_0xfa924b):_0x83cce3[_0x3d0687(0x1cc)](_0x1edb8f,[_0xfa924b]);}}return _0x83cce3;}async function resolveJourneyIdFromInput(_0xf834be,_0xc955d8,_0x3be1da){const _0x5d58b7=a28_0x4bd0,_0x5719e0=await resolveJourneyTarget(_0xf834be,_0xc955d8[_0x5d58b7(0x17c)],_0xc955d8[_0x5d58b7(0x189)]),_0x2af3ce=_0x5719e0[_0x5d58b7(0x17c)];if(!_0x2af3ce)throw new SDKError(ErrorCode[_0x5d58b7(0x1c2)],_0x5d58b7(0x173));const _0x4b3175=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3be1da[_0x5d58b7(0x1aa)][_0x5d58b7(0x141)](_0x2af3ce),{'verbose':_0xc955d8['verbose']}),_0x37cc2b=_0x4b3175[_0x5d58b7(0x221)],_0x35636d=await withSpinner(_0x5d58b7(0x227),()=>_0x3be1da[_0x5d58b7(0x171)]['resolveJourneyId'](_0x37cc2b,_0x5719e0['journeyName']),{'verbose':_0xc955d8[_0x5d58b7(0x189)]});return{'journeyId':_0x35636d['data'],'journeyName':_0x5719e0[_0x5d58b7(0x155)],'parentSegmentId':_0x37cc2b};}async function resolveJourneyTarget(_0x3263c4,_0x5a2a06,_0xf870ea){const _0x5d6202=a28_0x4bd0;if(isYamlFilePath(_0x3263c4))try{const _0x3d80ac=await resolveYamlFilePath(_0x3263c4);return _0xf870ea&&(console[_0x5d6202(0x19a)](_0x5d6202(0x1df)+_0x3263c4),console['error'](_0x5d6202(0x14d)+_0x3d80ac[_0x5d6202(0x17c)]),console[_0x5d6202(0x19a)](_0x5d6202(0x165)+_0x3d80ac['segmentName']),console['error'](_0x5d6202(0x20d)+(_0x3d80ac['folderPath']||'(root)'))),{'journeyName':_0x3d80ac[_0x5d6202(0x14f)],'parentSegment':_0x3d80ac[_0x5d6202(0x17c)],'resolved':_0x3d80ac};}catch(_0x3e1c6c){throw new SDKError(ErrorCode[_0x5d6202(0x1c2)],_0x5d6202(0x166)+_0x3e1c6c[_0x5d6202(0x20e)]);}if(!_0x5a2a06)throw new SDKError(ErrorCode[_0x5d6202(0x1c2)],_0x5d6202(0x1f2));return{'journeyName':_0x3263c4,'parentSegment':_0x5a2a06};}export class JourneyListCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x1ae);[a28_0x2caa77(0x1db)]=a28_0x2caa77(0x192);async[a28_0x2caa77(0x1fc)](_0x5443ce){const _0x2620b7=a28_0x2caa77,{options:_0x2c9b23,args:_0x2968c2,tdx:_0x1da6ea}=_0x5443ce,_0x544095=_0x2968c2[0x0],_0x15fafa=_0x2c9b23['parentSegment'];if(!_0x15fafa)return console[_0x2620b7(0x19a)](_0x2620b7(0x1f9)),console['error'](_0x2620b7(0x201)),0x1;const _0x5348bd=await withSpinner(_0x2620b7(0x121),()=>_0x1da6ea[_0x2620b7(0x1aa)][_0x2620b7(0x141)](_0x15fafa),{'verbose':_0x2c9b23[_0x2620b7(0x189)]}),_0x455461=_0x5348bd[_0x2620b7(0x221)];_0x2c9b23[_0x2620b7(0x189)]&&(console['error'](_0x2620b7(0x210)+_0x15fafa+'\x20(ID:\x20'+_0x455461+')'),_0x544095&&console['error'](_0x2620b7(0x139)+_0x544095));const _0x5a13a8=await withSpinner(_0x2620b7(0x14b),()=>_0x1da6ea[_0x2620b7(0x1aa)][_0x2620b7(0x200)](_0x455461),{'verbose':_0x2c9b23[_0x2620b7(0x189)]}),_0x3535c4=_0x5a13a8[_0x2620b7(0x221)],_0x51cd8a=_0x3535c4['rootFolderId'],_0x1edcc4=await withSpinner('Listing\x20journeys...',()=>_0x1da6ea[_0x2620b7(0x171)][_0x2620b7(0x1e5)](_0x455461,_0x51cd8a),{'verbose':_0x2c9b23[_0x2620b7(0x189)]});let _0x18a47d=_0x1edcc4[_0x2620b7(0x221)][_0x2620b7(0x1b5)];const _0x2db98d=_0x1edcc4[_0x2620b7(0x221)][_0x2620b7(0x1bf)],_0x53e6a3=new Map();for(const _0x822ee of _0x2db98d){_0x53e6a3[_0x2620b7(0x1cc)](_0x822ee['id'],_0x822ee[_0x2620b7(0x182)]);}if(_0x544095){const _0x4d0634=globToRegex(_0x544095);_0x18a47d=_0x18a47d[_0x2620b7(0x183)](_0x102cb2=>_0x4d0634[_0x2620b7(0x1b1)](_0x102cb2[_0x2620b7(0x222)]));}console[_0x2620b7(0x19a)](_0x2620b7(0x1d1)+_0x18a47d['length']+_0x2620b7(0x1c8)+(_0x18a47d[_0x2620b7(0x21c)]!==0x1?'s':''));const _0x3ea13d=_0x1b1aa4=>{const _0x4535b3=_0x2620b7;return getConsoleNextUrl(_0x2c9b23[_0x4535b3(0x21f)],_0x4535b3(0x1a3)+_0x455461+'/e/'+_0x1b1aa4+'/j/da');};if(_0x2c9b23[_0x2620b7(0x1e2)]===_0x2620b7(0x1c4))await handleSDKOutput(_0x18a47d,_0x2c9b23);else{if(_0x2c9b23[_0x2620b7(0x1e2)]===_0x2620b7(0x1ea)){const _0x4ee79a=_0x18a47d[_0x2620b7(0x159)](_0x488fdd=>({..._0x488fdd,'url':_0x3ea13d(_0x488fdd['id'])}));await handleSDKOutput(_0x4ee79a,_0x2c9b23);}else{console['log']('['+_0x15fafa+']');const _0x411961=new Map(),_0x22b6da=[];for(const _0x1dc04e of _0x18a47d){if(!_0x1dc04e[_0x2620b7(0x12a)]||_0x1dc04e['folderId']===_0x51cd8a)_0x22b6da[_0x2620b7(0x17e)](_0x1dc04e);else{const _0x29af0b=_0x411961['get'](_0x1dc04e[_0x2620b7(0x12a)])||[];_0x29af0b[_0x2620b7(0x17e)](_0x1dc04e),_0x411961[_0x2620b7(0x1cc)](_0x1dc04e[_0x2620b7(0x12a)],_0x29af0b);}}const _0x16e06a=(_0x23bfbb,_0x2b4dd8)=>_0x23bfbb[_0x2620b7(0x222)][_0x2620b7(0x169)](_0x2b4dd8[_0x2620b7(0x222)],undefined,{'sensitivity':_0x2620b7(0x1c0)});_0x22b6da[_0x2620b7(0x13d)](_0x16e06a);for(const _0x4b03be of _0x22b6da){console['log'](formatJourneyItem(_0x4b03be,'',_0x3ea13d(_0x4b03be['id'])));}const _0x1676ce=[..._0x411961['entries']()]['sort']((_0x48bc01,_0x2193db)=>{const _0xb5094d=_0x2620b7,_0x45a8bb=_0x53e6a3['get'](_0x48bc01[0x0])||_0x48bc01[0x0],_0xd6d88f=_0x53e6a3[_0xb5094d(0x120)](_0x2193db[0x0])||_0x2193db[0x0];return _0x45a8bb[_0xb5094d(0x169)](_0xd6d88f,undefined,{'sensitivity':'base'});});for(const [_0x908aa3,_0x95656b]of _0x1676ce){const _0x5ce18a=_0x53e6a3[_0x2620b7(0x120)](_0x908aa3)||_0x908aa3;console['log']('📁\x20'+_0x5ce18a),_0x95656b['sort'](_0x16e06a);for(const _0x167ede of _0x95656b){console[_0x2620b7(0x124)](formatJourneyItem(_0x167ede,'\x20\x20',_0x3ea13d(_0x167ede['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x218);[a28_0x2caa77(0x1db)]=a28_0x2caa77(0x133);async['execute'](_0x7c40ae){const _0x28341e=a28_0x2caa77,{options:_0x55185d,args:_0xb66184,tdx:_0xbb0ef1}=_0x7c40ae,_0x2b922b=_0xb66184[0x0];if(!_0x2b922b)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x28341e(0x19a)](_0x28341e(0x1af)),console[_0x28341e(0x19a)]('Options:'),console['error'](_0x28341e(0x203)),0x1;_0x55185d[_0x28341e(0x189)]&&console[_0x28341e(0x19a)](_0x28341e(0x1a9)+_0x2b922b);const {journeyId:_0x35afba,parentSegmentId:_0x3c9be7}=await resolveJourneyIdFromInput(_0x2b922b,_0x55185d,_0xbb0ef1);if(_0x55185d[_0x28341e(0x130)]){const _0x39dc25=getConsoleNextUrl(_0x55185d[_0x28341e(0x21f)],_0x28341e(0x1a3)+_0x3c9be7+_0x28341e(0x1bb)+_0x35afba+_0x28341e(0x15c));return console[_0x28341e(0x19a)](a28_0xca0a23[_0x28341e(0x223)]('✔')+'\x20Opening\x20'+a28_0xca0a23[_0x28341e(0x126)](_0x39dc25)),openBrowser(_0x39dc25),0x0;}const _0x48b4f1=await withSpinner(_0x28341e(0x156),()=>_0xbb0ef1[_0x28341e(0x171)][_0x28341e(0x164)](_0x35afba),{'verbose':_0x55185d[_0x28341e(0x189)]}),_0xc6e341=_0x48b4f1[_0x28341e(0x221)],_0x324788=_0x55185d[_0x28341e(0x215)];let _0x59658e;if(_0x324788)try{const _0x575e78=await withSpinner(_0x28341e(0x219),()=>_0xbb0ef1[_0x28341e(0x171)]['getStatistics'](_0x35afba),{'verbose':_0x55185d[_0x28341e(0x189)]});_0x59658e=_0x575e78[_0x28341e(0x221)];}catch{_0x55185d[_0x28341e(0x189)]&&console[_0x28341e(0x19a)]('\x20\x20Statistics\x20not\x20available');}const _0x47e0cf=getConsoleNextUrl(_0x55185d[_0x28341e(0x21f)],_0x28341e(0x1a3)+_0x3c9be7+_0x28341e(0x1bb)+_0x35afba+_0x28341e(0x15c)),_0x37ddbb={'id':_0xc6e341['id'],'name':_0xc6e341['attributes'][_0x28341e(0x182)],'description':_0xc6e341['attributes']['description'],'state':_0xc6e341[_0x28341e(0x177)]['state'],'paused':_0xc6e341[_0x28341e(0x177)][_0x28341e(0x197)],'reentry_mode':_0xc6e341[_0x28341e(0x177)]['reentryMode'],'stages':_0xc6e341[_0x28341e(0x177)][_0x28341e(0x18b)]?.[_0x28341e(0x21c)]||0x0,..._0xc6e341[_0x28341e(0x177)][_0x28341e(0x1ac)]&&{'goal':_0xc6e341[_0x28341e(0x177)][_0x28341e(0x1ac)]['name']},..._0x59658e&&{'statistics':{'size':_0x59658e[_0x28341e(0x12f)],'entered':_0x59658e[_0x28341e(0x138)],'goal_achieved':_0x59658e[_0x28341e(0x1f6)],'completion_rate':_0x59658e[_0x28341e(0x16f)],'exit_or_jump':_0x59658e['exitOrJumpSize'],'exit_or_jump_rate':_0x59658e['exitOrJumpRate'],'stages':_0x59658e[_0x28341e(0x13b)]}},'url':_0x47e0cf};return await handleSingleObjectOutput(_0x37ddbb,_0x55185d),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a28_0x2caa77(0x12b);[a28_0x2caa77(0x1db)]=a28_0x2caa77(0x212);async[a28_0x2caa77(0x1fc)](_0x1dc422){const _0x281934=a28_0x2caa77,{options:_0x2556b6,args:_0x4212fc,tdx:_0x3dffa3}=_0x1dc422,_0x2c052b=_0x4212fc[0x0];if(!requireNameOrPath(_0x2c052b))return 0x1;_0x2556b6[_0x281934(0x189)]&&console[_0x281934(0x19a)](_0x281934(0x1a9)+_0x2c052b);const _0x557d18=_0x2556b6,_0x2fa2f0=_0x557d18[_0x281934(0x1b8)],_0xeeb723=_0x557d18['to'],_0x4204ad=_0x557d18[_0x281934(0x1ed)],_0x25469e=_0x557d18['stage'];_0x4204ad&&!_0x2fa2f0&&!_0xeeb723&&console[_0x281934(0x19a)](_0x281934(0x1c5));const _0x44bd88=_0x4204ad?withJsonFormat(_0x2556b6):_0x2556b6,{journeyId:_0x5b2f93,journeyName:_0x3d389a}=await resolveJourneyIdFromInput(_0x2c052b,_0x44bd88,_0x3dffa3),_0x46a52b=_0x2fa2f0||_0xeeb723?{'from':_0x2fa2f0,'to':_0xeeb723}:undefined,_0x527477=await withSpinner(_0x281934(0x219),()=>Promise[_0x281934(0x147)]([_0x3dffa3[_0x281934(0x171)][_0x281934(0x164)](_0x5b2f93),_0x3dffa3[_0x281934(0x171)][_0x281934(0x16b)](_0x5b2f93,_0x46a52b)]),{'verbose':_0x44bd88[_0x281934(0x189)]}),[_0x127880,_0x52a036]=_0x527477['data'];if(!_0x52a036||_0x52a036['journeyId']===null)return console[_0x281934(0x19a)](_0x281934(0x194)+_0x3d389a),console[_0x281934(0x19a)](_0x281934(0x229)),0x0;const _0x1db4b3=buildStageNameMap(_0x127880),_0x13d044=!!(_0x46a52b&&_0x52a036[_0x281934(0x122)]?.[_0x281934(0x21c)]),_0x55d657={'stageNameMap':_0x1db4b3,'hasPeriod':_0x13d044,'includeHistory':!!_0x4204ad};if(_0x25469e&&_0x52a036[_0x281934(0x13b)]){const _0x1130c0=_0x52a036['stages'][_0x281934(0x1a4)](_0x1ce181=>{const _0x51f8de=_0x281934,_0x51da18=_0x1db4b3[_0x51f8de(0x120)](_0x1ce181['id'])??'';return _0x51da18[_0x51f8de(0x184)]()===_0x25469e['toLowerCase']();});if(_0x1130c0)return await handleSingleObjectOutput(formatStageStats(_0x1130c0,_0x55d657),_0x44bd88),0x0;const _0x253f1f=_0x52a036['stages'][_0x281934(0x159)](_0x481d3c=>_0x1db4b3[_0x281934(0x120)](_0x481d3c['id'])??_0x481d3c['id']);return console['error'](_0x281934(0x1dc)+_0x25469e+_0x281934(0x193)),console['error']('Available\x20stages:\x20'+_0x253f1f[_0x281934(0x1dd)](',\x20')),0x1;}const _0x132c8e=_0x52a036[_0x281934(0x13b)]?.[_0x281934(0x159)](_0x5bc435=>formatStageStats(_0x5bc435,_0x55d657)),_0x4f1d44=assembleJourneyStats(_0x52a036,{'from':_0x2fa2f0,'to':_0xeeb723,'includeHistory':_0x4204ad});return await this[_0x281934(0x14a)](_0x4f1d44,_0x132c8e??[],_0x44bd88),0x0;}async[a28_0x2caa77(0x14a)](_0x1f4a2a,_0x595da8,_0x120fa5){const _0xc40904=a28_0x2caa77,_0x293ed3=_0x120fa5[_0xc40904(0x1e2)]==='json'||_0x120fa5[_0xc40904(0x1e2)]===_0xc40904(0x21e)||_0x120fa5[_0xc40904(0x1ea)]||_0x120fa5[_0xc40904(0x21e)];if(_0x293ed3){_0x1f4a2a[_0xc40904(0x13b)]=_0x595da8,await handleSingleObjectOutput(_0x1f4a2a,_0x120fa5);return;}await handleSingleObjectOutput(_0x1f4a2a,_0x120fa5);for(const _0x401ab1 of _0x595da8){console[_0xc40904(0x124)](''),console[_0xc40904(0x124)](String(a28_0xca0a23['cyan']['bold']('['+_0x401ab1['name']+']'))+a28_0xca0a23[_0xc40904(0x186)]('\x20'+_0x401ab1['id']));const {id:_0x2557cd,name:_0x4f3f45,..._0x240f30}=_0x401ab1;await handleSingleObjectOutput(_0x240f30,_0x120fa5);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x1f7);[a28_0x2caa77(0x1db)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x2caa77(0x1fc)](_0x2b063e){const _0x493223=a28_0x2caa77,{options:_0x57569f,args:_0x58064f,tdx:_0x549b30}=_0x2b063e,_0x35fd52=_0x58064f[0x0];if(!requireNameOrPath(_0x35fd52))return 0x1;_0x57569f[_0x493223(0x189)]&&console[_0x493223(0x19a)](_0x493223(0x1a9)+_0x35fd52);const _0x1e747f=_0x57569f,_0x549ee8=_0x1e747f[_0x493223(0x1ef)],_0x8cbdb0=_0x1e747f[_0x493223(0x1b8)],_0x3c0359=_0x1e747f['to'],_0x38c9e6=_0x1e747f[_0x493223(0x174)];if(_0x549ee8&&_0x549ee8!==_0x493223(0x1d5)&&_0x549ee8!==_0x493223(0x1e1))return console['error'](_0x493223(0x202)+_0x549ee8+_0x493223(0x1e7)),0x1;const _0x1d89b8=withJsonFormat(_0x57569f),{journeyId:_0x1a83b9,journeyName:_0x5e8a83}=await resolveJourneyIdFromInput(_0x35fd52,_0x1d89b8,_0x549b30),_0x3cb690={'type':_0x549ee8,'from':_0x8cbdb0,'to':_0x3c0359,'limit':_0x38c9e6},_0x27dce9=await withSpinner(_0x493223(0x19f),()=>_0x549b30['journey'][_0x493223(0x1e0)](_0x1a83b9,_0x3cb690),{'verbose':_0x1d89b8[_0x493223(0x189)]}),_0x39bf4e=_0x27dce9[_0x493223(0x221)],_0x545523=_0x39bf4e['conversion']&&(_0x39bf4e[_0x493223(0x1d5)][_0x493223(0x19c)]['length']>0x0||_0x39bf4e[_0x493223(0x1d5)][_0x493223(0x14c)][_0x493223(0x21c)]>0x0),_0x4fe35d=_0x39bf4e[_0x493223(0x1e1)]&&_0x39bf4e['activation'][_0x493223(0x21c)]>0x0;if(!_0x545523&&!_0x4fe35d)return console[_0x493223(0x19a)](_0x493223(0x129)+_0x5e8a83),console[_0x493223(0x19a)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x8cbdb0&&_0x3c0359&&console[_0x493223(0x19a)](_0x493223(0x1e9)),0x0;return await handleSingleObjectOutput(_0x39bf4e,_0x1d89b8),0x0;}}function formatStageStats(_0x3babb2,_0x4523c4){const _0x3cc8a7=a28_0x2caa77,_0x259909=_0x4523c4['hasPeriod']&&_0x3babb2['history']?.['length']?aggregateStageHistory(_0x3babb2['history']):{'size':_0x3babb2['size'],'entered':_0x3babb2['enteredSize'],'milestone':_0x3babb2[_0x3cc8a7(0x160)],'milestone_rate':_0x3babb2['completeMilestoneRate'],'exit_or_jump':_0x3babb2[_0x3cc8a7(0x1ee)],'exit_or_jump_rate':_0x3babb2[_0x3cc8a7(0x226)]},_0x10c9a6={'id':_0x3babb2['id'],'name':_0x4523c4['stageNameMap'][_0x3cc8a7(0x120)](_0x3babb2['id'])??_0x3babb2['id'],..._0x259909};return _0x4523c4[_0x3cc8a7(0x1f8)]&&_0x4523c4['includeHistory']&&_0x3babb2[_0x3cc8a7(0x122)]&&(_0x10c9a6[_0x3cc8a7(0x122)]=_0x3babb2[_0x3cc8a7(0x122)]),_0x10c9a6;}export class JourneyPauseCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x20b);['description']=a28_0x2caa77(0x185);async[a28_0x2caa77(0x1fc)](_0x1e1eea){const _0x2bde8c=a28_0x2caa77,{options:_0x18e3fb,args:_0x439c65,tdx:_0x3a514d}=_0x1e1eea,_0xc0052b=_0x439c65[0x0];if(!requireNameOrPath(_0xc0052b))return 0x1;_0x18e3fb['verbose']&&console[_0x2bde8c(0x19a)](_0x2bde8c(0x1a9)+_0xc0052b);const {journeyId:_0x361bd8,journeyName:_0x364735}=await resolveJourneyIdFromInput(_0xc0052b,_0x18e3fb,_0x3a514d);if(!_0x18e3fb[_0x2bde8c(0x154)]){const _0x4466c2=await confirm(_0x2bde8c(0x1a5)+_0x364735+'\x22?');if(!_0x4466c2)return console[_0x2bde8c(0x19a)](_0x2bde8c(0x1ba)),0x0;}const _0x11a486=await withSpinner(_0x2bde8c(0x1f5),()=>_0x3a514d[_0x2bde8c(0x171)][_0x2bde8c(0x1b6)](_0x361bd8),{'verbose':_0x18e3fb[_0x2bde8c(0x189)]}),_0x2a6404=_0x11a486[_0x2bde8c(0x221)];return console['error'](_0x2bde8c(0x1fe)+_0x2a6404[_0x2bde8c(0x177)][_0x2bde8c(0x182)]+_0x2bde8c(0x196)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x2caa77(0x182)]='journey:resume';[a28_0x2caa77(0x1db)]=a28_0x2caa77(0x158);async['execute'](_0xf7e7a9){const _0x1f1228=a28_0x2caa77,{options:_0x47de7a,args:_0x28719b,tdx:_0x530ce3}=_0xf7e7a9,_0xa8c234=_0x28719b[0x0];if(!requireNameOrPath(_0xa8c234))return 0x1;_0x47de7a[_0x1f1228(0x189)]&&console[_0x1f1228(0x19a)]('Input:\x20'+_0xa8c234);const {journeyId:_0x2bf784,journeyName:_0xa9c22}=await resolveJourneyIdFromInput(_0xa8c234,_0x47de7a,_0x530ce3);if(!_0x47de7a[_0x1f1228(0x154)]){const _0x45bbac=await confirm(_0x1f1228(0x1fd)+_0xa9c22+'\x22?');if(!_0x45bbac)return console['error']('Cancelled'),0x0;}const _0x59f5dd=await withSpinner(_0x1f1228(0x1a8),()=>_0x530ce3[_0x1f1228(0x171)][_0x1f1228(0x13c)](_0x2bf784),{'verbose':_0x47de7a[_0x1f1228(0x189)]}),_0x458911=_0x59f5dd[_0x1f1228(0x221)];return console[_0x1f1228(0x19a)](_0x1f1228(0x1fe)+_0x458911[_0x1f1228(0x177)][_0x1f1228(0x182)]+_0x1f1228(0x16e)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x2caa77(0x182)]='journey:pull';['description']=a28_0x2caa77(0x145);async[a28_0x2caa77(0x1fc)](_0xd34da0){const _0x38f36a=a28_0x2caa77,{options:_0x518bb6,args:_0x6768d3,tdx:_0x4016c2}=_0xd34da0,_0x71dc09=_0x518bb6,_0x4422dc=_0x6768d3[0x0],_0x319261=_0x4422dc&&isYamlFilePath(_0x4422dc),_0xc41b08=await resolveTarget({'arg':_0x319261?_0x4422dc:undefined,'contextParent':_0x518bb6[_0x38f36a(0x17c)],'cwd':process[_0x38f36a(0x20c)]()});if(!isSuccessfulResolution(_0xc41b08))return _0xc41b08['errorCode']==='no_parent'?(console[_0x38f36a(0x19a)](a28_0xca0a23[_0x38f36a(0x1ec)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x38f36a(0x19a)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x38f36a(0x19a)](_0x38f36a(0x161)),console[_0x38f36a(0x19a)](_0x38f36a(0x14e)),console[_0x38f36a(0x19a)](_0x38f36a(0x1bc))):(console[_0x38f36a(0x19a)](a28_0xca0a23['red'](_0x38f36a(0x20f)+_0xc41b08[_0x38f36a(0x20e)]+'\x0a')),_0xc41b08[_0x38f36a(0x16a)]&&console[_0x38f36a(0x19a)](a28_0xca0a23[_0x38f36a(0x126)](_0xc41b08[_0x38f36a(0x16a)]))),0x1;let _0x1ee904=_0x319261?undefined:_0x4422dc,_0x1ad0ee,_0x3407f5;_0xc41b08[_0x38f36a(0x1ef)]==='file'&&(_0x1ee904=_0xc41b08['resourceName'],_0x1ad0ee=_0xc41b08[_0x38f36a(0x1e8)],_0x3407f5=_0xc41b08[_0x38f36a(0x181)]);const _0x34ee04=_0xc41b08[_0x38f36a(0x152)],_0x4cec76=_0xc41b08['targetDir'];_0x71dc09[_0x38f36a(0x189)]&&(console[_0x38f36a(0x19a)](_0x38f36a(0x210)+_0x34ee04),console[_0x38f36a(0x19a)](_0x38f36a(0x1b4)+_0x4cec76),_0x1ee904&&console[_0x38f36a(0x19a)](_0x38f36a(0x170)+_0x1ee904),_0x1ad0ee&&console[_0x38f36a(0x19a)](_0x38f36a(0x1f0)+_0x1ad0ee),_0x3407f5&&console[_0x38f36a(0x19a)]('Folder\x20path:\x20'+_0x3407f5));const _0xe49f14=await withSpinner(_0x38f36a(0x121),()=>_0x4016c2[_0x38f36a(0x1aa)][_0x38f36a(0x141)](_0x34ee04),{'verbose':_0x518bb6[_0x38f36a(0x189)]}),_0x41d15f=_0xe49f14['data'],{journeys:_0x5ac5ab,folders:_0x55175a}=await withSpinner(_0x38f36a(0x198),async()=>{const _0x461e36=_0x38f36a,[_0x52fd3e,_0x52fa80]=await Promise[_0x461e36(0x147)]([_0x4016c2[_0x461e36(0x171)][_0x461e36(0x176)](_0x41d15f,undefined,{'includeAllVersions':!![]}),_0x4016c2[_0x461e36(0x1aa)]['listFolders'](_0x41d15f)]);return{'journeys':_0x52fd3e,'folders':_0x52fa80};},{'verbose':_0x518bb6['verbose']})['then'](_0x3fd82b=>_0x3fd82b[_0x38f36a(0x221)]);let _0x2702b8=_0x5ac5ab;const _0x48271a=buildFolderIdToPathMap(_0x55175a);if(_0x1ee904){const _0x216ce9=_0x2702b8['filter'](_0x36d740=>_0x36d740[_0x38f36a(0x222)][_0x38f36a(0x184)]()===_0x1ee904[_0x38f36a(0x184)]());if(_0x216ce9[_0x38f36a(0x21c)]===0x0)return console[_0x38f36a(0x19a)](_0x38f36a(0x1cd)+_0x1ee904),console[_0x38f36a(0x19a)](_0x38f36a(0x1d3)),0x1;_0x2702b8=_0x216ce9;}if(_0x3407f5!==undefined){const _0x2d62f8=_0x2702b8[_0x38f36a(0x183)](_0x15c99a=>{const _0xc18bec=_0x38f36a,_0x5d0077=_0x15c99a[_0xc18bec(0x12a)]?_0x48271a[_0xc18bec(0x120)](_0x15c99a[_0xc18bec(0x12a)])||'':'';return _0x5d0077===_0x3407f5;});if(_0x2d62f8['length']===0x0&&_0x2702b8['length']>0x0){console[_0x38f36a(0x19a)](_0x38f36a(0x191)+_0x1ee904+_0x38f36a(0x19e)+(_0x3407f5||_0x38f36a(0x153))),console[_0x38f36a(0x19a)](_0x38f36a(0x11e));for(const _0x3f1fab of _0x2702b8){const _0x51f558=_0x3f1fab[_0x38f36a(0x12a)]?_0x48271a[_0x38f36a(0x120)](_0x3f1fab[_0x38f36a(0x12a)])||'':'';console[_0x38f36a(0x19a)](_0x38f36a(0x214)+(_0x51f558||_0x38f36a(0x15d))+'/'+_0x3f1fab['journeyBundleName']);}return 0x1;}_0x2702b8=_0x2d62f8;}if(_0x2702b8[_0x38f36a(0x21c)]===0x0)return console[_0x38f36a(0x19a)](_0x38f36a(0x1ff)),0x0;const _0x170ba0=new Map();for(const _0x573ea9 of _0x2702b8){const _0x10e9b1=_0x573ea9[_0x38f36a(0x1fb)];!_0x170ba0[_0x38f36a(0x19b)](_0x10e9b1)&&_0x170ba0[_0x38f36a(0x1cc)](_0x10e9b1,[]),_0x170ba0[_0x38f36a(0x120)](_0x10e9b1)[_0x38f36a(0x17e)](_0x573ea9);}for(const _0x7a6c7c of _0x170ba0['values']()){_0x7a6c7c[_0x38f36a(0x13d)]((_0x587e92,_0x1d5bdf)=>(_0x587e92['versionNumber']||0x0)-(_0x1d5bdf[_0x38f36a(0x1c3)]||0x0));}const _0x452247=[],{idToEmailMap:_0x33bb45,connectionIdToNameMap:_0x52c4bd}=await withSpinner(_0x38f36a(0x18c),async()=>{const _0x25fb40=_0x38f36a,[_0x1e7310,_0x579ce0]=await Promise[_0x25fb40(0x147)]([_0x4016c2['user'][_0x25fb40(0x208)](),_0x4016c2[_0x25fb40(0x15b)][_0x25fb40(0x135)]()]);return{'idToEmailMap':_0x1e7310,'connectionIdToNameMap':_0x579ce0};},{'verbose':_0x518bb6[_0x38f36a(0x189)]})[_0x38f36a(0x1ab)](_0x4c7dab=>_0x4c7dab['data']);for(const _0x4e6733 of _0x170ba0[_0x38f36a(0x209)]()){const _0x7f4be=_0x4e6733[0x0][_0x38f36a(0x222)],_0x5aadfa=_0x4e6733[0x0]['folderId'],_0x2df023=_0x5aadfa?_0x48271a[_0x38f36a(0x120)](_0x5aadfa)||'':'',_0x523515=_0x2df023?a28_0x3d6e5c[_0x38f36a(0x1dd)](_0x4cec76,_0x2df023):_0x4cec76,_0x4057bf=_0x1ad0ee||a28_0x3d6e5c[_0x38f36a(0x1dd)](_0x523515,sanitizeFileName(_0x7f4be)+'.yml');let _0x1788f2,_0xe4ac3c;if(existsSync(_0x4057bf))try{const _0x4b7f1a=readFileSync(_0x4057bf,_0x38f36a(0x163)),_0x26c0d9=parseYamlString(_0x4b7f1a);_0xe4ac3c=_0x26c0d9,_0x1788f2=buildRuleToNameMapping(_0x26c0d9),_0x71dc09['verbose']&&_0x1788f2[_0x38f36a(0x12f)]>0x0&&console[_0x38f36a(0x19a)]('Found\x20'+_0x1788f2[_0x38f36a(0x12f)]+_0x38f36a(0x1d7)+_0x7f4be);}catch(_0x28ada2){_0x71dc09[_0x38f36a(0x189)]&&console[_0x38f36a(0x19a)](_0x38f36a(0x1d4)+_0x28ada2['message']);}const _0x5f6026=[],_0x32bf77=new Set(),_0x46cdc9=new Map(),_0x28fae7=new Map(),_0x1d5de7=new Set(),_0x43b172=new Map(),_0xd4cdc7=new Map(),_0xa50378=createJumpTargetCache();await withProgressSpinner(_0x38f36a(0x142)+_0x7f4be+_0x38f36a(0x224),async _0x253ad1=>{const _0x338d2b=_0x38f36a;for(const _0x19d4d2 of _0x4e6733){const _0x11bc5e=_0x4e6733[_0x338d2b(0x21c)]>0x1?_0x19d4d2['journeyBundleName']+'\x20v'+(_0x19d4d2[_0x338d2b(0x1c3)]||0x1):_0x19d4d2[_0x338d2b(0x222)];_0x253ad1[_0x338d2b(0x217)]('Fetching\x20'+_0x11bc5e);const _0x437492=await _0x4016c2[_0x338d2b(0x171)][_0x338d2b(0x164)](_0x19d4d2['id']),_0x117a84=_0x437492[_0x338d2b(0x177)]?.['audienceId'],_0x1a1412={'resolveSegment':async _0x5d18fa=>{const _0x576b63=_0x338d2b;if(!_0x117a84)return{'name':_0x5d18fa,'isJourneyLocal':![]};const _0x16636e=_0x46cdc9['get'](_0x5d18fa);if(_0x16636e)return _0x16636e;try{const _0x40aca8=await _0x4016c2[_0x576b63(0x1aa)][_0x576b63(0x1a2)](_0x117a84,_0x5d18fa),_0x16e0bc=_0x40aca8['kind']===SEGMENT_KIND_JOURNEY;let _0xf481f5,_0x297873=_0x40aca8[_0x576b63(0x182)];if(_0x16e0bc&&_0x40aca8['rule']){const _0x4fcc8b=await segmentResponseToDef(_0x40aca8,{'resolveSegmentName':async _0x29ee8c=>{const _0x36148=_0x576b63,_0x3e2929=_0x46cdc9[_0x36148(0x120)](_0x29ee8c);if(_0x3e2929)return _0x3e2929['name'];const _0x13795d=await _0x1a1412['resolveSegment'](_0x29ee8c);return _0x13795d[_0x36148(0x182)];}}),_0x23c30c=_0x4fcc8b[_0x576b63(0x168)];_0xf481f5={'description':_0x40aca8[_0x576b63(0x1db)],'rule':_0x23c30c};const _0x2b762d=serializeRule(_0x23c30c),_0x44c23f=_0x28fae7[_0x576b63(0x120)](_0x2b762d);if(_0x44c23f)_0x297873=_0x44c23f,_0xf481f5=undefined,_0x71dc09[_0x576b63(0x189)]&&console[_0x576b63(0x19a)](_0x576b63(0x1f3)+_0x40aca8['name']+_0x576b63(0x228)+_0x44c23f);else{let _0x38e253=![];if(_0x1788f2){const _0x445215=_0x1788f2['get'](_0x2b762d);if(_0x445215){const _0x6f0a40=_0x445215[_0x576b63(0x1a4)](_0x1ce425=>!_0x32bf77[_0x576b63(0x19b)](_0x1ce425));_0x6f0a40&&(_0x297873=_0x6f0a40,_0x32bf77['add'](_0x6f0a40),_0x28fae7[_0x576b63(0x1cc)](_0x2b762d,_0x6f0a40),_0x38e253=!![],_0x71dc09[_0x576b63(0x189)]&&console[_0x576b63(0x19a)](_0x576b63(0x180)+_0x6f0a40+_0x576b63(0x1b9)));}}if(!_0x38e253){const _0x265c1c=generateJourneyLocalName(_0x40aca8[_0x576b63(0x182)]);_0x265c1c&&(_0x297873=_0x265c1c);let _0x2c432b=_0x297873,_0x5cdb0b=0x2;while(_0x32bf77[_0x576b63(0x19b)](_0x2c432b)){_0x2c432b=_0x297873+'_'+_0x5cdb0b,_0x5cdb0b++;}_0x32bf77[_0x576b63(0x1c6)](_0x2c432b),_0x28fae7[_0x576b63(0x1cc)](_0x2b762d,_0x2c432b),_0x297873=_0x2c432b;}}}const _0x2bdbbc={'name':_0x297873,'isJourneyLocal':_0x16e0bc,'definition':_0xf481f5};return _0x46cdc9[_0x576b63(0x1cc)](_0x5d18fa,_0x2bdbbc),_0x2bdbbc;}catch(_0x2d9808){return _0x518bb6['verbose']&&console['error'](_0x576b63(0x15a)+_0x5d18fa+':\x20'+_0x2d9808[_0x576b63(0x20e)]),{'name':_0x5d18fa,'isJourneyLocal':![]};}},'resolveActivation':async _0x15da2d=>{const _0x7e090a=_0x338d2b,_0x58c257=_0x43b172['get'](_0x15da2d);if(_0x58c257)return _0x58c257;try{const _0x293073=await _0x4016c2['journey'][_0x7e090a(0x1d0)](_0x19d4d2['id'],_0x15da2d),_0x2bcee7=journeyActivationStepToYaml(_0x293073,_0x33bb45,_0x52c4bd),_0x1cbf2b=JSON[_0x7e090a(0x19d)]({'name':_0x2bcee7[_0x7e090a(0x182)],'connection':_0x2bcee7[_0x7e090a(0x15b)],'connector_config':_0x2bcee7[_0x7e090a(0x1b0)]}),_0x5994e2=_0xd4cdc7[_0x7e090a(0x120)](_0x1cbf2b);if(_0x5994e2){const _0x27821e={'name':_0x5994e2,'isJourneyLocal':!![],'definition':_0x2bcee7};return _0x43b172['set'](_0x15da2d,_0x27821e),_0x27821e;}const _0x4f4540=_0x293073[_0x7e090a(0x177)]['activationParams'][_0x7e090a(0x182)]||_0x15da2d,_0x19c482=sanitizeYamlKey(_0x4f4540)||_0x7e090a(0x1ce)+_0x15da2d;let _0x515161=_0x19c482,_0x25b456=0x2;while(_0x1d5de7[_0x7e090a(0x19b)](_0x515161)){_0x515161=_0x19c482+'_'+_0x25b456,_0x25b456++;}_0x1d5de7[_0x7e090a(0x1c6)](_0x515161),_0xd4cdc7[_0x7e090a(0x1cc)](_0x1cbf2b,_0x515161);const _0x2c073d={'name':_0x515161,'isJourneyLocal':!![],'definition':_0x2bcee7};return _0x43b172[_0x7e090a(0x1cc)](_0x15da2d,_0x2c073d),_0x2c073d;}catch(_0x52ce27){return _0x518bb6[_0x7e090a(0x189)]&&console[_0x7e090a(0x19a)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x15da2d+':\x20'+_0x52ce27[_0x7e090a(0x20e)]),{'name':_0x15da2d,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x59ce8c,_0x4fc606)=>{const _0x54438a=_0x338d2b;return resolveJumpTarget(_0x59ce8c,_0x4fc606,_0xa50378,_0xd854a=>_0x4016c2['journey'][_0x54438a(0x164)](_0xd854a));}},_0x12b10c=await journeyResponseToDef(_0x437492,_0x1a1412);_0x5f6026[_0x338d2b(0x17e)]({'item':_0x19d4d2,'yaml':_0x12b10c});}},{'verbose':_0x518bb6[_0x38f36a(0x189)]});const _0x5d0ddd=await _0x4016c2[_0x38f36a(0x171)][_0x38f36a(0x1e6)](_0x4e6733[0x0][_0x38f36a(0x1fb)]),_0x1442b0=buildMergedJourneyDef(_0x5f6026,_0x1788f2,_0x5d0ddd),_0x299557=normalizeJourneyDef(_0x1442b0,_0xe4ac3c),_0xd8885a=toYamlString(_0x299557),_0x44a074=_0x1ad0ee||a28_0x3d6e5c[_0x38f36a(0x1dd)](_0x523515,sanitizeFileName(_0x7f4be)+_0x38f36a(0x1d9));!_0x1ad0ee&&_0x2df023&&!existsSync(_0x523515)&&mkdirSync(_0x523515,{'recursive':!![]});const _0x7a1dc4=a28_0x3d6e5c[_0x38f36a(0x148)](process[_0x38f36a(0x20c)](),_0x44a074);if(existsSync(_0x44a074)){const _0x3967aa=readFileSync(_0x44a074,'utf-8'),_0x252043=generateDiff(_0x3967aa,_0xd8885a),_0x49eeeb=hasChanges(_0x252043);_0x452247[_0x38f36a(0x17e)]({'relativePath':_0x7a1dc4,'absolutePath':_0x44a074,'content':_0xd8885a,'isNew':![],'hasChanges':_0x49eeeb,'diff':_0x49eeeb?formatDiffWithColors(_0x252043):undefined});}else _0x452247['push']({'relativePath':_0x7a1dc4,'absolutePath':_0x44a074,'content':_0xd8885a,'isNew':!![],'hasChanges':![]});}const _0x5b9a12=_0x452247[_0x38f36a(0x183)](_0x26cf52=>_0x26cf52[_0x38f36a(0x15e)]),_0x350070=_0x452247[_0x38f36a(0x183)](_0x10a66a=>!_0x10a66a[_0x38f36a(0x15e)]&&_0x10a66a[_0x38f36a(0x17f)]),_0x1bb768=_0x452247['filter'](_0xd501ee=>!_0xd501ee[_0x38f36a(0x15e)]&&!_0xd501ee[_0x38f36a(0x17f)]),_0x3065dd=_0x2702b8['length'],_0x52c0a5=_0x170ba0[_0x38f36a(0x12f)],_0x5cddb2=_0x3065dd>_0x52c0a5?'\x20('+_0x3065dd+'\x20versions)':'';console['error']('\x0aPull\x20summary:'),console[_0x38f36a(0x19a)]('\x20\x20'+a28_0xca0a23[_0x38f36a(0x126)](_0x52c0a5+_0x38f36a(0x15f))+a28_0xca0a23[_0x38f36a(0x186)](_0x5cddb2)),console[_0x38f36a(0x19a)]('\x20\x20'+a28_0xca0a23[_0x38f36a(0x223)]('+\x20'+_0x5b9a12[_0x38f36a(0x21c)]+'\x20new\x20files')),console[_0x38f36a(0x19a)]('\x20\x20'+a28_0xca0a23[_0x38f36a(0x1ec)]('~\x20'+_0x350070[_0x38f36a(0x21c)]+_0x38f36a(0x132))),console[_0x38f36a(0x19a)]('\x20\x20'+a28_0xca0a23[_0x38f36a(0x186)]('=\x20'+_0x1bb768['length']+_0x38f36a(0x17a))),console[_0x38f36a(0x19a)](_0x38f36a(0x21b)+a28_0xca0a23['cyan'](_0x4cec76)+'\x0a');if(_0x350070['length']>0x0)for(const _0xec0811 of _0x350070){console[_0x38f36a(0x19a)]('\x0aChanges\x20to\x20\x27'+_0xec0811[_0x38f36a(0x21d)]+'\x27:'),console['error']('─'[_0x38f36a(0x1de)](0x3c)),console[_0x38f36a(0x19a)](_0xec0811['diff']),console[_0x38f36a(0x19a)]('─'['repeat'](0x3c));}if(_0x71dc09[_0x38f36a(0x149)])return console['error'](a28_0xca0a23[_0x38f36a(0x1ec)](_0x38f36a(0x151))),0x0;if(_0x5b9a12[_0x38f36a(0x21c)]===0x0&&_0x350070[_0x38f36a(0x21c)]===0x0)return console[_0x38f36a(0x19a)](a28_0xca0a23[_0x38f36a(0x223)](_0x38f36a(0x140))),saveSessionContext({'parent_segment':_0x34ee04},_0x71dc09[_0x38f36a(0x1d8)]),console[_0x38f36a(0x19a)](a28_0xca0a23['green'](_0x38f36a(0x123)+a28_0xca0a23[_0x38f36a(0x186)](_0x38f36a(0x175))+_0x38f36a(0x207)+a28_0xca0a23[_0x38f36a(0x126)](_0x34ee04))),0x0;if(!_0x71dc09[_0x38f36a(0x154)]&&(_0x5b9a12[_0x38f36a(0x21c)]>0x0||_0x350070[_0x38f36a(0x21c)]>0x0)){if(!isInteractive())return console[_0x38f36a(0x19a)](a28_0xca0a23[_0x38f36a(0x205)](_0x38f36a(0x12c)),_0x38f36a(0x11b)),console[_0x38f36a(0x19a)](a28_0xca0a23[_0x38f36a(0x186)](_0x38f36a(0x16d))),0x1;const _0x20d99c=await confirmKey(_0x38f36a(0x204)+(_0x5b9a12['length']+_0x350070[_0x38f36a(0x21c)])+_0x38f36a(0x11c));if(!_0x20d99c)return console[_0x38f36a(0x19a)](a28_0xca0a23['yellow'](_0x38f36a(0x1f4)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x4cec76)&&mkdirSync(_0x4cec76,{'recursive':!![]});const _0x335dea=a28_0x3d6e5c['join'](_0x4cec76,_0x38f36a(0x220));writeFileSync(_0x335dea,createTdxConfigContent(_0x34ee04),_0x38f36a(0x163));for(const _0x4b196d of _0x452247){(_0x4b196d['isNew']||_0x4b196d[_0x38f36a(0x17f)])&&writeFileSync(_0x4b196d[_0x38f36a(0x18f)],_0x4b196d['content'],'utf-8');}return console[_0x38f36a(0x19a)](a28_0xca0a23['green'](_0x38f36a(0x146)+(_0x5b9a12[_0x38f36a(0x21c)]+_0x350070[_0x38f36a(0x21c)])+'\x20journey\x20files\x20to\x20'+_0x4cec76)),saveSessionContext({'parent_segment':_0x34ee04},_0x71dc09[_0x38f36a(0x1d8)]),console[_0x38f36a(0x19a)](a28_0xca0a23[_0x38f36a(0x223)](_0x38f36a(0x123)+a28_0xca0a23[_0x38f36a(0x186)](_0x38f36a(0x175))+_0x38f36a(0x207)+a28_0xca0a23[_0x38f36a(0x126)](_0x34ee04))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x199);['description']=a28_0x2caa77(0x11f);async[a28_0x2caa77(0x1fc)](_0x240170){const _0x41e987=a28_0x2caa77,{options:_0x4a76fc,args:_0x70669f,tdx:_0x1df190}=_0x240170,_0x25d815=_0x70669f[0x0];if(!requireNameOrPath(_0x25d815))return 0x1;_0x4a76fc[_0x41e987(0x189)]&&console['error'](_0x41e987(0x1a9)+_0x25d815);const {journeyId:_0x1b6842}=await resolveJourneyIdFromInput(_0x25d815,_0x4a76fc,_0x1df190),_0x3b10e4=await withSpinner(_0x41e987(0x128),()=>_0x1df190[_0x41e987(0x171)]['getColumnMapping'](_0x1b6842),{'verbose':_0x4a76fc[_0x41e987(0x189)]}),_0x24f6ae=_0x3b10e4['data'];return console['log']('Database:\x20'+_0x24f6ae[_0x41e987(0x187)]),console['log'](_0x41e987(0x13e)+_0x24f6ae[_0x41e987(0x1c4)]),await handleSDKOutput(_0x24f6ae['columns'],_0x4a76fc),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x134);[a28_0x2caa77(0x1db)]='List\x20activations\x20for\x20a\x20journey';async[a28_0x2caa77(0x1fc)](_0x484e04){const _0x344d43=a28_0x2caa77,{options:_0xfde1f0,args:_0x594310,tdx:_0xd0bdd6}=_0x484e04,_0x4d0e20=_0x594310[0x0];if(!requireNameOrPath(_0x4d0e20))return 0x1;_0xfde1f0[_0x344d43(0x189)]&&console[_0x344d43(0x19a)](_0x344d43(0x1a9)+_0x4d0e20);const {journeyId:_0x3185d8}=await resolveJourneyIdFromInput(_0x4d0e20,_0xfde1f0,_0xd0bdd6),_0x1b82c4=await withSpinner('Listing\x20journey\x20activations...',()=>_0xd0bdd6[_0x344d43(0x171)][_0x344d43(0x157)](_0x3185d8),{'verbose':_0xfde1f0[_0x344d43(0x189)]}),_0x48a95e=_0x1b82c4[_0x344d43(0x221)];return console[_0x344d43(0x19a)](_0x344d43(0x1a0)+_0x48a95e[_0x344d43(0x21c)]+_0x344d43(0x1cb)+(_0x48a95e['length']!==0x1?'s':'')),await handleSDKOutput(_0x48a95e,_0xfde1f0),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x190);[a28_0x2caa77(0x1db)]=a28_0x2caa77(0x18a);[a28_0x2caa77(0x213)]=new SegmentPushCommand();async['execute'](_0xc68a4d){const _0x4b66ef=a28_0x2caa77,_0x411f36=_0xc68a4d['args'][0x0];let _0x46e795;if(_0x411f36){const _0x19bab0=await resolveTarget({'arg':_0x411f36,'contextParent':_0xc68a4d[_0x4b66ef(0x16c)]['parentSegment'],'cwd':process[_0x4b66ef(0x20c)]()});isSuccessfulResolution(_0x19bab0)&&_0x19bab0[_0x4b66ef(0x1ef)]===_0x4b66ef(0x18d)&&(_0x46e795=_0x19bab0['filePath']);}const _0x7eeead={..._0xc68a4d,'options':{..._0xc68a4d[_0x4b66ef(0x16c)],'journeysOnly':!![],..._0x46e795&&{'singleFilePath':_0x46e795}}};return this['segmentPushCommand'][_0x4b66ef(0x1fc)](_0x7eeead);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x1a6);['description']=a28_0x2caa77(0x1a1);async[a28_0x2caa77(0x1fc)](_0x4c38f6){const _0x264193=a28_0x2caa77,{options:_0x3f344a,args:_0x2bc771,tdx:_0x33d1d8}=_0x4c38f6,_0x42c96c=_0x2bc771[0x0];if(!requireNameOrPath(_0x42c96c))return 0x1;if(_0x3f344a[_0x264193(0x189)])console[_0x264193(0x19a)](_0x264193(0x1a9)+_0x42c96c);const {journeyId:_0x4684c1}=await resolveJourneyIdFromInput(_0x42c96c,_0x3f344a,_0x33d1d8),_0x31fab2=await withSpinner(_0x264193(0x127),()=>_0x33d1d8[_0x264193(0x171)][_0x264193(0x211)](_0x4684c1),{'verbose':_0x3f344a[_0x264193(0x189)]}),{bundleName:_0x336261,versions:_0x1325c3,latestJourneyId:_0x50a438}=_0x31fab2[_0x264193(0x221)];console[_0x264193(0x19a)](_0x336261+':\x20'+_0x1325c3[_0x264193(0x21c)]+_0x264193(0x1b3)+(_0x1325c3['length']!==0x1?'s':''));const _0x23258e=_0x1325c3[_0x264193(0x159)](_0x343de9=>({'version':_0x343de9[_0x264193(0x1c3)],'journey_id':_0x343de9[_0x264193(0x178)],'name':_0x343de9['name'],'state':_0x343de9[_0x264193(0x1bd)],'paused':_0x343de9[_0x264193(0x197)],'latest':_0x343de9[_0x264193(0x178)]===_0x50a438,'created_at':_0x343de9[_0x264193(0x225)]}));return await handleSDKOutput(_0x23258e,_0x3f344a),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x1b7);[a28_0x2caa77(0x1db)]=a28_0x2caa77(0x162);async[a28_0x2caa77(0x1fc)](_0x49b920){const _0x294f28=a28_0x2caa77,{options:_0x382bb5,args:_0x2bd6d1,tdx:_0x426138}=_0x49b920,_0xd65fad=_0x2bd6d1[0x0];if(!requireNameOrPath(_0xd65fad))return 0x1;if(_0x382bb5[_0x294f28(0x189)])console[_0x294f28(0x19a)]('Input:\x20'+_0xd65fad);const {journeyId:_0x4f1146,journeyName:_0x18e1a8}=await resolveJourneyIdFromInput(_0xd65fad,_0x382bb5,_0x426138);if(!_0x382bb5[_0x294f28(0x154)]){const _0x47d55d=await confirm(_0x294f28(0x1a7)+_0x18e1a8+'\x22?');if(!_0x47d55d)return console[_0x294f28(0x19a)](_0x294f28(0x1ba)),0x0;}const _0x4fc0e1=await withSpinner(_0x294f28(0x1ad),()=>_0x426138['journey'][_0x294f28(0x1da)](_0x4f1146),{'verbose':_0x382bb5[_0x294f28(0x189)]}),_0x1a506b=_0x4fc0e1[_0x294f28(0x221)];return console[_0x294f28(0x19a)](a28_0xca0a23[_0x294f28(0x223)]('✔')+_0x294f28(0x1cf)+_0x1a506b[_0x294f28(0x177)][_0x294f28(0x1c3)]+_0x294f28(0x18e)+_0x1a506b[_0x294f28(0x177)]['name']+'\x22'),console[_0x294f28(0x19a)](_0x294f28(0x1c1)+_0x1a506b['id']),await handleSingleObjectOutput({'id':_0x1a506b['id'],'name':_0x1a506b[_0x294f28(0x177)]['name'],'version':_0x1a506b[_0x294f28(0x177)][_0x294f28(0x1c3)],'state':_0x1a506b[_0x294f28(0x177)]['state'],'bundle_id':_0x1a506b[_0x294f28(0x177)][_0x294f28(0x1fb)],'created_at':_0x1a506b[_0x294f28(0x177)][_0x294f28(0x225)]},_0x382bb5),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x2caa77(0x182)]=a28_0x2caa77(0x1fa);[a28_0x2caa77(0x1db)]=a28_0x2caa77(0x1ca);async[a28_0x2caa77(0x1fc)](_0x145df9){const _0x3fbd6d=a28_0x2caa77,{options:_0x3782e7,args:_0x55295f,tdx:_0x38c4c0}=_0x145df9,_0x14d7db=_0x55295f[0x0];if(!requireNameOrPath(_0x14d7db))return 0x1;const _0x2840a1=_0x3782e7[_0x3fbd6d(0x1eb)];if(!_0x2840a1)return console[_0x3fbd6d(0x19a)](_0x3fbd6d(0x12d)),console[_0x3fbd6d(0x19a)](_0x3fbd6d(0x136)),0x1;const _0x1e4105=parseInt(_0x2840a1,0xa);if(isNaN(_0x1e4105)||_0x1e4105<0x1)return console[_0x3fbd6d(0x19a)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x2840a1),0x1;if(_0x3782e7['verbose'])console[_0x3fbd6d(0x19a)](_0x3fbd6d(0x1a9)+_0x14d7db+_0x3fbd6d(0x131)+_0x1e4105);const {journeyId:_0x766bcc,parentSegmentId:_0x3c857e}=await resolveJourneyIdFromInput(_0x14d7db,_0x3782e7,_0x38c4c0),_0x4a63d7=await withSpinner(_0x3fbd6d(0x125),()=>_0x38c4c0[_0x3fbd6d(0x171)][_0x3fbd6d(0x211)](_0x766bcc),{'verbose':_0x3782e7[_0x3fbd6d(0x189)]}),{versions:_0x169129,latestJourneyId:_0x2be1ff}=_0x4a63d7[_0x3fbd6d(0x221)],_0x49502d=_0x169129[_0x3fbd6d(0x1a4)](_0x1d51fe=>_0x1d51fe[_0x3fbd6d(0x1c3)]===_0x1e4105);if(!_0x49502d){const _0x1a58c1=_0x169129['map'](_0x25e60a=>'v'+_0x25e60a['versionNumber'])[_0x3fbd6d(0x1dd)](',\x20');return console[_0x3fbd6d(0x19a)]('Error:\x20Version\x20'+_0x1e4105+'\x20not\x20found.\x20Available:\x20'+_0x1a58c1),0x1;}const _0x284361=await withSpinner(_0x3fbd6d(0x12e)+_0x1e4105+_0x3fbd6d(0x22a),()=>_0x38c4c0[_0x3fbd6d(0x171)][_0x3fbd6d(0x164)](_0x49502d[_0x3fbd6d(0x178)]),{'verbose':_0x3782e7[_0x3fbd6d(0x189)]}),_0x3909ab=_0x284361[_0x3fbd6d(0x221)],_0x1f986a=getConsoleNextUrl(_0x3782e7[_0x3fbd6d(0x21f)],_0x3fbd6d(0x1a3)+_0x3c857e+_0x3fbd6d(0x1bb)+_0x49502d['journeyId']+_0x3fbd6d(0x15c));return await handleSingleObjectOutput({'id':_0x3909ab['id'],'name':_0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x182)],'version':_0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x1c3)],'description':_0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x1db)],'state':_0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x1bd)],'paused':_0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x197)],'reentry_mode':_0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x150)],'stages':_0x3909ab[_0x3fbd6d(0x177)]['journeyStages']?.[_0x3fbd6d(0x21c)]||0x0,..._0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x1ac)]&&{'goal':_0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x1ac)][_0x3fbd6d(0x182)]},'latest':_0x49502d[_0x3fbd6d(0x178)]===_0x2be1ff,'created_at':_0x3909ab[_0x3fbd6d(0x177)][_0x3fbd6d(0x225)],'updated_at':_0x3909ab['attributes']['updatedAt'],'url':_0x1f986a},_0x3782e7),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x410dfe=a29_0x4546;(function(_0x5e93a7,_0x3c5c1c){const _0xe99275=a29_0x4546,_0x5347d9=_0x5e93a7();while(!![]){try{const _0x3e1dd5=-parseInt(_0xe99275(0x1ad))/0x1+-parseInt(_0xe99275(0x1c6))/0x2*(-parseInt(_0xe99275(0x1c0))/0x3)+-parseInt(_0xe99275(0x1ae))/0x4+parseInt(_0xe99275(0x1c5))/0x5+-parseInt(_0xe99275(0x1bd))/0x6+parseInt(_0xe99275(0x1be))/0x7*(parseInt(_0xe99275(0x19c))/0x8)+parseInt(_0xe99275(0x1ba))/0x9*(-parseInt(_0xe99275(0x1c3))/0xa);if(_0x3e1dd5===_0x3c5c1c)break;else _0x5347d9['push'](_0x5347d9['shift']());}catch(_0x19f015){_0x5347d9['push'](_0x5347d9['shift']());}}}(a29_0x1533,0x337a5));function a29_0x1533(){const _0x27a884=['parentSegment','length','87549edUyBQ','837684GKpMME','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','message','endsWith','helpText','warningCount','validCount','reason','Validation\x20failed:\x20','Error:\x20Directory\x20not\x20found:\x20','relativePath','5859FCDqbM','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','skippedCount','497298IMNDPn','1841189MBVrlB','file','336GRXdCc','warnings','hasErrors','6030KtLLVW','cwd','1607000HQyYjs','7122AdGQGc','\x20valid','\x20warning(s)','verbose','invalidCount','✔\x20All\x20','dim','journey:validate','\x20(skipped:\x20','\x20warning(s)\x20found','error','log','errors','8VjGSaO','\x20segment\x20file(s)\x20skipped','cyan','Error:\x20','red','\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','\x20journey(s)\x20with\x20errors,\x20','\x20journey(s)\x20valid','.yml','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','description','No\x20journey\x20YAML\x20files\x20found\x20in\x20','type','yellow'];a29_0x1533=function(){return _0x27a884;};return a29_0x1533();}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a29_0x4546(_0x233ecc,_0x3e3d44){_0x233ecc=_0x233ecc-0x19a;const _0x153339=a29_0x1533();let _0x454606=_0x153339[_0x233ecc];return _0x454606;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0xe375e5 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a29_0x410dfe(0x1cd);[a29_0x410dfe(0x1a7)]='Validate\x20journey\x20YAML\x20files';async['execute'](_0x193f86){const _0xe3d48=a29_0x410dfe,{options:_0x1c7027,args:_0x4de5ba}=_0x193f86,_0x5da51d=_0x1c7027,_0x3b8b3a=await resolveTarget({'arg':_0x4de5ba[0x0],'contextParent':_0x1c7027[_0xe3d48(0x1ab)],'cwd':process[_0xe3d48(0x1c4)]()});if(!isSuccessfulResolution(_0x3b8b3a))return _0x3b8b3a['errorCode']==='no_parent'?(console[_0xe3d48(0x1d0)](a29_0xe375e5['yellow'](_0xe3d48(0x1a6))),console[_0xe3d48(0x1d0)](_0xe3d48(0x1bb)),console['error'](_0xe3d48(0x1a1)),console[_0xe3d48(0x1d0)](_0xe3d48(0x1af))):(console[_0xe3d48(0x1d0)](a29_0xe375e5['red'](_0xe3d48(0x19f)+_0x3b8b3a[_0xe3d48(0x1b1)]+'\x0a')),_0x3b8b3a[_0xe3d48(0x1b3)]&&console[_0xe3d48(0x1d0)](a29_0xe375e5[_0xe3d48(0x19e)](_0x3b8b3a[_0xe3d48(0x1b3)]))),0x1;const _0x3c9d4b=_0x3b8b3a['targetDir'],_0x43d490=_0x3b8b3a[_0xe3d48(0x1a9)]===_0xe3d48(0x1bf)?_0x3b8b3a['filePath']:undefined;if(!_0x43d490&&!existsSync(_0x3c9d4b))return console[_0xe3d48(0x1d0)](a29_0xe375e5[_0xe3d48(0x1a0)](_0xe3d48(0x1b8)+_0x3c9d4b+'\x0a')),0x1;let _0x416499;if(_0x43d490){if(!_0x43d490['endsWith'](_0xe3d48(0x1a4))&&!_0x43d490[_0xe3d48(0x1b2)]('.yaml'))return console[_0xe3d48(0x1d0)](a29_0xe375e5[_0xe3d48(0x1a0)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x43d490+'\x0a')),0x1;_0x416499=[_0x43d490];}else _0x416499=findYamlFiles(_0x3c9d4b);if(_0x416499[_0xe3d48(0x1ac)]===0x0)return console['error'](a29_0xe375e5[_0xe3d48(0x1a0)](_0xe3d48(0x1b0)+_0x3c9d4b+'\x0a')),0x1;const _0x3f823c=validateYamlFiles(_0x416499,_0x3c9d4b,{'filterType':'journey'}),_0x533a23=calculateSummary(_0x3f823c),_0x3b69b7=_0x3f823c['filter'](isValidationResult);if(_0x3b69b7['length']===0x0)return console[_0xe3d48(0x1d0)](a29_0xe375e5[_0xe3d48(0x1aa)](_0xe3d48(0x1a8)+_0x3c9d4b+'\x0a')),_0x533a23[_0xe3d48(0x1bc)]>0x0&&console['error'](a29_0xe375e5[_0xe3d48(0x1cc)]('('+_0x533a23[_0xe3d48(0x1bc)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x4b5658 of _0x3f823c){if(!isValidationResult(_0x4b5658)){_0x5da51d[_0xe3d48(0x1c9)]&&console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1cc)]('-\x20'+_0x4b5658[_0xe3d48(0x1b9)]+_0xe3d48(0x1ce)+_0x4b5658[_0xe3d48(0x1b6)]+')'));continue;}const {relativePath:_0x89c2d1,source:_0x4efefe,result:_0x10a5bd}=_0x4b5658;if(_0x10a5bd['valid']&&_0x10a5bd[_0xe3d48(0x1c1)][_0xe3d48(0x1ac)]===0x0)_0x5da51d['verbose']&&console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1a5)]('✔\x20'+_0x89c2d1));else _0x10a5bd['valid']?(console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1aa)]('⚠\x20'+_0x89c2d1+':\x20'+_0x10a5bd[_0xe3d48(0x1c1)][_0xe3d48(0x1ac)]+_0xe3d48(0x1c8))),console[_0xe3d48(0x19a)](formatValidationResult(_0x10a5bd,_0x4efefe,_0x89c2d1))):(console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1a0)]('✖\x20'+_0x89c2d1+':\x20'+_0x10a5bd[_0xe3d48(0x19b)]['length']+'\x20error(s)')),console[_0xe3d48(0x19a)](formatValidationResult(_0x10a5bd,_0x4efefe,_0x89c2d1)));}return console[_0xe3d48(0x19a)](''),_0x533a23[_0xe3d48(0x1c2)]?(console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1a0)](_0xe3d48(0x1b7)+_0x533a23[_0xe3d48(0x1ca)]+_0xe3d48(0x1a2)+_0x533a23[_0xe3d48(0x1b5)]+_0xe3d48(0x1c7))),_0x533a23['warningCount']>0x0&&console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1aa)](_0x533a23['warningCount']+_0xe3d48(0x1cf))),_0x533a23[_0xe3d48(0x1bc)]>0x0&&console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1cc)](_0x533a23[_0xe3d48(0x1bc)]+_0xe3d48(0x19d))),0x1):(console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1a5)](_0xe3d48(0x1cb)+_0x533a23['validCount']+_0xe3d48(0x1a3))),_0x533a23[_0xe3d48(0x1b4)]>0x0&&console[_0xe3d48(0x19a)](a29_0xe375e5[_0xe3d48(0x1aa)](_0x533a23['warningCount']+_0xe3d48(0x1cf))),_0x533a23[_0xe3d48(0x1bc)]>0x0&&console[_0xe3d48(0x19a)](a29_0xe375e5['dim'](_0x533a23[_0xe3d48(0x1bc)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}
|