@treasuredata/tdx 2026.4.16 → 2026.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +17 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x130a4e=a25_0x329f;(function(_0x4c7d73,_0x3a3922){const _0x18392d=a25_0x329f,_0x2aa081=_0x4c7d73();while(!![]){try{const _0x1e32c3=parseInt(_0x18392d(0x173))/0x1+parseInt(_0x18392d(0x17a))/0x2+parseInt(_0x18392d(0x16a))/0x3*(parseInt(_0x18392d(0x171))/0x4)+parseInt(_0x18392d(0x17e))/0x5+parseInt(_0x18392d(0x187))/0x6+parseInt(_0x18392d(0x17c))/0x7+-parseInt(_0x18392d(0x186))/0x8;if(_0x1e32c3===_0x3a3922)break;else _0x2aa081['push'](_0x2aa081['shift']());}catch(_0x2884ec){_0x2aa081['push'](_0x2aa081['shift']());}}}(a25_0x1d60,0xe615d));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x329f(_0x51742e,_0x27eb5b){_0x51742e=_0x51742e-0x15c;const _0x1d6022=a25_0x1d60();let _0x329fca=_0x1d6022[_0x51742e];return _0x329fca;}import{existsSync}from'fs';import a25_0x2b6556 from'chalk';import a25_0xb93dfc from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a25_0x130a4e(0x16f);['description']=a25_0x130a4e(0x167);async['execute'](_0xdd7de8){const _0x44fe0a=a25_0x130a4e,{options:_0x154642,args:_0x51b4ba}=_0xdd7de8,_0x2db423=_0x154642,_0x182811=_0x51b4ba[0x0],_0x5e4a47=_0x182811?a25_0xb93dfc['resolve'](_0x182811):undefined,_0x1f3552=_0x5e4a47?isYamlFile(_0x5e4a47):![];let _0x4a01d1,_0x53bd2e;if(_0x1f3552&&_0x5e4a47)_0x4a01d1=a25_0xb93dfc[_0x44fe0a(0x185)](_0x5e4a47),_0x53bd2e=_0x5e4a47;else _0x5e4a47?_0x4a01d1=_0x5e4a47:_0x4a01d1=process[_0x44fe0a(0x17b)]();if(!_0x53bd2e&&!existsSync(_0x4a01d1))return console[_0x44fe0a(0x184)](a25_0x2b6556[_0x44fe0a(0x18a)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4a01d1+'\x0a')),0x1;let _0x286295;if(_0x53bd2e){if(!_0x53bd2e[_0x44fe0a(0x183)]('.yml')&&!_0x53bd2e[_0x44fe0a(0x183)](_0x44fe0a(0x16c)))return console[_0x44fe0a(0x184)](a25_0x2b6556[_0x44fe0a(0x18a)](_0x44fe0a(0x16d)+_0x53bd2e+'\x0a')),0x1;_0x286295=[_0x53bd2e];}else _0x286295=findYamlFiles(_0x4a01d1);if(_0x286295[_0x44fe0a(0x161)]===0x0)return console[_0x44fe0a(0x184)](a25_0x2b6556[_0x44fe0a(0x18a)](_0x44fe0a(0x178)+_0x4a01d1+'\x0a')),0x1;const _0x2898a9=validateYamlFiles(_0x286295,_0x4a01d1,{'filterType':_0x44fe0a(0x180)}),_0x1edae4=calculateSummary(_0x2898a9),_0x180a69=_0x2898a9['filter'](isValidationResult);if(_0x180a69[_0x44fe0a(0x161)]===0x0)return console['error'](a25_0x2b6556['yellow'](_0x44fe0a(0x182)+_0x4a01d1+'\x0a')),_0x1edae4['skippedCount']>0x0&&console[_0x44fe0a(0x184)](a25_0x2b6556[_0x44fe0a(0x176)]('('+_0x1edae4[_0x44fe0a(0x163)]+_0x44fe0a(0x165))),0x0;for(const _0x4e49cb of _0x2898a9){if(!isValidationResult(_0x4e49cb)){_0x2db423[_0x44fe0a(0x169)]&&console[_0x44fe0a(0x168)](a25_0x2b6556[_0x44fe0a(0x176)]('-\x20'+_0x4e49cb[_0x44fe0a(0x164)]+_0x44fe0a(0x15c)+_0x4e49cb[_0x44fe0a(0x181)]+')'));continue;}const {relativePath:_0x156251,source:_0x52a34b,result:_0x3e47da}=_0x4e49cb;if(_0x3e47da[_0x44fe0a(0x174)]&&_0x3e47da[_0x44fe0a(0x16e)][_0x44fe0a(0x161)]===0x0)_0x2db423[_0x44fe0a(0x169)]&&console[_0x44fe0a(0x168)](a25_0x2b6556['green']('✔\x20'+_0x156251));else _0x3e47da[_0x44fe0a(0x174)]?(console[_0x44fe0a(0x168)](a25_0x2b6556[_0x44fe0a(0x179)]('⚠\x20'+_0x156251+':\x20'+_0x3e47da['warnings']['length']+_0x44fe0a(0x15d))),console[_0x44fe0a(0x168)](formatValidationResult(_0x3e47da,_0x52a34b,_0x156251))):(console[_0x44fe0a(0x168)](a25_0x2b6556['red']('✖\x20'+_0x156251+':\x20'+_0x3e47da[_0x44fe0a(0x172)][_0x44fe0a(0x161)]+_0x44fe0a(0x15e))),console[_0x44fe0a(0x168)](formatValidationResult(_0x3e47da,_0x52a34b,_0x156251)));}return console[_0x44fe0a(0x168)](''),_0x1edae4[_0x44fe0a(0x166)]?(console['log'](a25_0x2b6556[_0x44fe0a(0x18a)](_0x44fe0a(0x177)+_0x1edae4[_0x44fe0a(0x15f)]+_0x44fe0a(0x175)+_0x1edae4[_0x44fe0a(0x188)]+_0x44fe0a(0x189))),_0x1edae4[_0x44fe0a(0x162)]>0x0&&console[_0x44fe0a(0x168)](a25_0x2b6556['yellow'](_0x1edae4['warningCount']+_0x44fe0a(0x170))),_0x1edae4[_0x44fe0a(0x163)]>0x0&&console['log'](a25_0x2b6556[_0x44fe0a(0x176)](_0x1edae4[_0x44fe0a(0x163)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x44fe0a(0x168)](a25_0x2b6556[_0x44fe0a(0x17f)](_0x44fe0a(0x17d)+_0x1edae4['validCount']+_0x44fe0a(0x16b))),_0x1edae4[_0x44fe0a(0x162)]>0x0&&console[_0x44fe0a(0x168)](a25_0x2b6556['yellow'](_0x1edae4['warningCount']+_0x44fe0a(0x170))),_0x1edae4[_0x44fe0a(0x163)]>0x0&&console[_0x44fe0a(0x168)](a25_0x2b6556[_0x44fe0a(0x176)](_0x1edae4[_0x44fe0a(0x163)]+_0x44fe0a(0x160))),0x0);}}function a25_0x1d60(){const _0x165955=['No\x20template\x20YAML\x20files\x20found\x20in\x20','endsWith','error','dirname','44762000SKhRhD','5053824OmDggx','validCount','\x20valid','red','\x20(skipped:\x20','\x20warning(s)','\x20error(s)','invalidCount','\x20non-template\x20file(s)\x20skipped','length','warningCount','skippedCount','relativePath','\x20non-template\x20file(s)\x20skipped)','hasErrors','Validate\x20template\x20YAML\x20files','log','verbose','81nABqkG','\x20template(s)\x20valid','.yaml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','warnings','engage:template:validate','\x20warning(s)\x20found','73420hLGPZo','errors','1660759lZaFvP','valid','\x20template(s)\x20with\x20errors,\x20','dim','Validation\x20failed:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','3350528ytVZZM','cwd','7364392udaCxi','✔\x20All\x20','4058555oSVPAt','green','template','reason'];a25_0x1d60=function(){return _0x165955;};return a25_0x1d60();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x3de47c=a26_0x231f;(function(_0x1f2a3e,_0xe387c5){const _0x3d452c=a26_0x231f,_0x109442=_0x1f2a3e();while(!![]){try{const _0x193872=parseInt(_0x3d452c(0x1db))/0x1+parseInt(_0x3d452c(0x20f))/0x2*(-parseInt(_0x3d452c(0x1f1))/0x3)+-parseInt(_0x3d452c(0x1f0))/0x4+parseInt(_0x3d452c(0x213))/0x5*(parseInt(_0x3d452c(0x1df))/0x6)+parseInt(_0x3d452c(0x1c2))/0x7*(-parseInt(_0x3d452c(0x1f7))/0x8)+parseInt(_0x3d452c(0x1ce))/0x9+parseInt(_0x3d452c(0x201))/0xa*(parseInt(_0x3d452c(0x209))/0xb);if(_0x193872===_0xe387c5)break;else _0x109442['push'](_0x109442['shift']());}catch(_0x1ebaaa){_0x109442['push'](_0x109442['shift']());}}}(a26_0x3205,0x536d4));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x26e862 from'chalk';function formatDuration(_0x571f59){const _0x34976b=a26_0x231f;if(_0x571f59<0x3c)return _0x571f59+'s';if(_0x571f59<0xe10)return Math[_0x34976b(0x1eb)](_0x571f59/0x3c)+'m\x20'+_0x571f59%0x3c+'s';const _0x276974=Math[_0x34976b(0x1eb)](_0x571f59/0xe10),_0x4502be=Math[_0x34976b(0x1eb)](_0x571f59%0xe10/0x3c);return _0x4502be>0x0?_0x276974+'h\x20'+_0x4502be+'m':_0x276974+'h';}function formatRelativeTime(_0x501ea2){const _0x572b23=a26_0x231f,_0x1d3792=Date[_0x572b23(0x1ff)]()-_0x501ea2[_0x572b23(0x1ca)](),_0x191d08=Math[_0x572b23(0x1eb)](Math[_0x572b23(0x1ed)](_0x1d3792)/0x3e8);if(_0x191d08<0x3c)return _0x572b23(0x21a);const _0x3564c9=Math[_0x572b23(0x1eb)](_0x191d08/0x3c);if(_0x3564c9<0x3c)return _0x3564c9+'m\x20ago';const _0x348012=Math['floor'](_0x3564c9/0x3c);if(_0x348012<0x18)return _0x348012+'h\x20ago';const _0x5d4da3=Math['floor'](_0x348012/0x18);if(_0x5d4da3<0x1e)return _0x5d4da3+_0x572b23(0x1d9);return Math[_0x572b23(0x1eb)](_0x5d4da3/0x1e)+_0x572b23(0x1fd);}function a26_0x3205(){const _0x25a0e7=['67780yFuCIK','limit','name','kill','hive','Submitting\x20job...','type','site','440hYtanc','\x20job','\x20\x20Job\x20ID:\x20','submit','result','start_at','106mzjqHf','end_at','priority','created_at','137915zATwTh','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','status','verbose','map','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','query','just\x20now','Limit:\x20','push','Cancelled','7nFIICA','dim','job:submit','Status\x20filter:\x20','trino','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','round','\x20row','getTime','log','success','✔\x20Retrieved\x20','2908251wXuBGm','Getting\x20job\x20details...','show','✔\x20Job\x20submitted','length','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job_id','Kill\x20a\x20job','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','args','d\x20ago','join','285849Dzoteu','description','execute','jobType','138jKIZNp','data','INVALID_ARGUMENT','Database:\x20','Show\x20job\x20details','substring','Getting\x20job\x20results...','debug','green','\x27\x20to\x20verify\x20the\x20job\x20status','jobs','url','floor','presto','abs','Query:\x20','validate','2529196OiGBiI','6333VdAzUY','Submit\x20a\x20job','error','\x20jobs','red','job:show','3428952XcHhJZ','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','List\x20jobs','Get\x20job\x20results','user_name','job:kill','mo\x20ago','✔\x20Found\x20','now','database'];a26_0x3205=function(){return _0x25a0e7;};return a26_0x3205();}export class JobListCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1e9);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1f9);async[a26_0x3de47c(0x1dd)](_0x479285){const _0x24449e=a26_0x3de47c,{options:_0x25b5be,tdx:_0x3904be}=_0x479285,_0x46b8a2=resolveLimit(_0x25b5be[_0x24449e(0x202)],DEFAULT_DISPLAY_LIMIT),_0x3eef2e=_0x25b5be['status'];_0x25b5be[_0x24449e(0x216)]&&(console['error'](_0x24449e(0x21b)+_0x46b8a2+_0x24449e(0x1f4)),_0x3eef2e&&console[_0x24449e(0x1f3)](_0x24449e(0x1c5)+_0x3eef2e));const _0xb1e60f=await withSpinner('Listing\x20jobs...',()=>_0x3904be[_0x24449e(0x1e9)]['list']({'from':0x0,'to':_0x46b8a2-0x1,'status':_0x3eef2e}),{'verbose':_0x25b5be[_0x24449e(0x216)]}),_0x1b4ccb=_0xb1e60f[_0x24449e(0x1e0)];console['error'](_0x24449e(0x1fe)+_0x1b4ccb['length']+_0x24449e(0x20a)+(_0x1b4ccb['length']!==0x1?'s':''));const _0x29a54c=_0x25b5be[_0x24449e(0x208)];if(isStructuredFormat(_0x25b5be)){const _0x248cd0=_0x1b4ccb[_0x24449e(0x217)](_0x3b99ad=>{const _0x5e62cd=_0x24449e;let _0xf8f0ae;if(_0x3b99ad[_0x5e62cd(0x20e)]&&_0x3b99ad[_0x5e62cd(0x210)]){const _0x321e0e=new Date(_0x3b99ad['start_at'])[_0x5e62cd(0x1ca)](),_0x3eb50e=new Date(_0x3b99ad[_0x5e62cd(0x210)])[_0x5e62cd(0x1ca)]();_0xf8f0ae=Math[_0x5e62cd(0x1c8)]((_0x3eb50e-_0x321e0e)/0x3e8);}return{'job_id':_0x3b99ad['job_id'],'type':_0x3b99ad[_0x5e62cd(0x207)]===_0x5e62cd(0x1ec)?_0x5e62cd(0x1c6):_0x3b99ad['type'],'status':_0x3b99ad[_0x5e62cd(0x215)],'user_name':_0x3b99ad[_0x5e62cd(0x1fb)],'duration_sec':_0xf8f0ae,'created_at':_0x3b99ad[_0x5e62cd(0x212)],'started_at':_0x3b99ad['start_at'],'end_at':_0x3b99ad[_0x5e62cd(0x210)]};});await handleSDKOutput(_0x248cd0,_0x25b5be);}else for(const _0x456bd3 of _0x1b4ccb){const _0x4be940=_0x456bd3[_0x24449e(0x215)]===_0x24449e(0x1cc)?a26_0x26e862[_0x24449e(0x1e7)]:_0x456bd3[_0x24449e(0x215)]===_0x24449e(0x1f3)?a26_0x26e862[_0x24449e(0x1f5)]:a26_0x26e862[_0x24449e(0x1c3)],_0x22438b=_0x4be940(_0x456bd3[_0x24449e(0x215)]),_0x45b4d4=getJobUrl(_0x29a54c,_0x456bd3[_0x24449e(0x1d5)]),_0x4ee26b=hyperlink(_0x456bd3[_0x24449e(0x1d5)],_0x45b4d4),_0x37d4f6=a26_0x26e862[_0x24449e(0x1c3)](_0x456bd3['type']==='presto'?_0x24449e(0x1c6):_0x456bd3[_0x24449e(0x207)]),_0x3120e7=[];if(_0x456bd3[_0x24449e(0x20e)]&&_0x456bd3['end_at']){const _0x4f1f08=Math[_0x24449e(0x1c8)]((new Date(_0x456bd3[_0x24449e(0x210)])[_0x24449e(0x1ca)]()-new Date(_0x456bd3[_0x24449e(0x20e)])[_0x24449e(0x1ca)]())/0x3e8);_0x3120e7[_0x24449e(0x1c0)](formatDuration(_0x4f1f08));}if(_0x456bd3[_0x24449e(0x210)])_0x3120e7[_0x24449e(0x1c0)](formatRelativeTime(new Date(_0x456bd3['end_at'])));else _0x456bd3[_0x24449e(0x20e)]&&_0x3120e7[_0x24449e(0x1c0)](formatRelativeTime(new Date(_0x456bd3['start_at'])));const _0x4b26e9=_0x3120e7[_0x24449e(0x1d2)]>0x0?a26_0x26e862['dim']('\x20'+_0x3120e7[_0x24449e(0x1da)](',\x20')):'';console[_0x24449e(0x1cb)]('⚡\x20'+_0x4ee26b+'\x20'+_0x37d4f6+'\x20'+_0x22438b+_0x4b26e9);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1f6);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1e3);[a26_0x3de47c(0x1ef)](_0x5de47f){const _0x2cd9d5=a26_0x3de47c,_0xd27d4f=_0x5de47f[_0x2cd9d5(0x1d8)][0x0];if(!_0xd27d4f)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x3de47c(0x1dd)](_0x3c5f6c){const _0x4dc8c2=a26_0x3de47c,{options:_0x5b8a55,args:_0x757920,tdx:_0x13ade6}=_0x3c5f6c,_0x31c018=_0x757920[0x0],_0x58298f=await withSpinner(_0x4dc8c2(0x1cf),()=>_0x13ade6[_0x4dc8c2(0x1e9)][_0x4dc8c2(0x1d0)](_0x31c018),{'verbose':_0x5b8a55[_0x4dc8c2(0x216)]}),_0x2d414f=_0x58298f[_0x4dc8c2(0x1e0)];let _0x383b8e;if(_0x2d414f[_0x4dc8c2(0x20e)]&&_0x2d414f[_0x4dc8c2(0x210)]){const _0x459774=new Date(_0x2d414f[_0x4dc8c2(0x20e)])[_0x4dc8c2(0x1ca)](),_0x112845=new Date(_0x2d414f[_0x4dc8c2(0x210)])['getTime']();_0x383b8e=Math[_0x4dc8c2(0x1c8)]((_0x112845-_0x459774)/0x3e8);}const _0x35590b={'job_id':_0x2d414f[_0x4dc8c2(0x1d5)],'type':_0x2d414f['type'],'status':_0x2d414f[_0x4dc8c2(0x215)],..._0x2d414f[_0x4dc8c2(0x1fb)]&&{'user_name':_0x2d414f[_0x4dc8c2(0x1fb)]},..._0x383b8e!==undefined&&{'duration_sec':_0x383b8e},..._0x2d414f[_0x4dc8c2(0x212)]&&{'created_at':_0x2d414f[_0x4dc8c2(0x212)]},..._0x2d414f[_0x4dc8c2(0x20e)]&&{'started_at':_0x2d414f[_0x4dc8c2(0x20e)]},..._0x2d414f[_0x4dc8c2(0x210)]&&{'end_at':_0x2d414f[_0x4dc8c2(0x210)]},..._0x2d414f[_0x4dc8c2(0x200)]&&{'database':_0x2d414f[_0x4dc8c2(0x200)]},..._0x2d414f[_0x4dc8c2(0x211)]!==undefined&&{'priority':_0x2d414f[_0x4dc8c2(0x211)]},..._0x2d414f[_0x4dc8c2(0x1ea)]&&{'url':_0x2d414f[_0x4dc8c2(0x1ea)]},..._0x2d414f[_0x4dc8c2(0x219)]&&{'query':_0x2d414f['query']},..._0x2d414f[_0x4dc8c2(0x1e6)]&&{'debug':_0x2d414f['debug']}};return await handleSingleObjectOutput(_0x35590b,_0x5b8a55),0x0;}}function a26_0x231f(_0x34c842,_0x41b837){_0x34c842=_0x34c842-0x1c0;const _0x32052c=a26_0x3205();let _0x231fa5=_0x32052c[_0x34c842];return _0x231fa5;}export class JobKillCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1fc);['description']=a26_0x3de47c(0x1d6);[a26_0x3de47c(0x1ef)](_0x28357b){const _0x4874ab=a26_0x3de47c,_0x3b1f29=_0x28357b['args'][0x0];if(!_0x3b1f29)return _0x4874ab(0x1f8);return undefined;}async['execute'](_0x5d2fc2){const _0x8068be=a26_0x3de47c,{options:_0x4f8939,args:_0x56165e,tdx:_0x2d9525}=_0x5d2fc2,_0x571bdb=_0x56165e[0x0];if(!_0x4f8939['yes']){const _0x2b2a5d=await confirm(_0x8068be(0x218)+_0x571bdb+'?');if(!_0x2b2a5d)return console[_0x8068be(0x1f3)](_0x8068be(0x1c1)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2d9525[_0x8068be(0x1e9)][_0x8068be(0x204)](_0x571bdb),{'verbose':_0x4f8939[_0x8068be(0x216)]}),console[_0x8068be(0x1f3)](_0x8068be(0x1d4)+_0x571bdb),console['error'](_0x8068be(0x1d7)+_0x571bdb+_0x8068be(0x1e8)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x3de47c(0x203)]=a26_0x3de47c(0x1c4);[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1f2);async[a26_0x3de47c(0x1dd)](_0x73f376){const _0x53746b=a26_0x3de47c,{options:_0x560e7a,args:_0x3c565a,tdx:_0xb17db0}=_0x73f376,_0x4d9f2a=_0x560e7a[_0x53746b(0x1de)]||_0x53746b(0x1c6),_0x507bd9=_0x560e7a['file'],_0x416700=_0x560e7a[_0x53746b(0x200)]||'information_schema',_0x4a4e5f=_0x560e7a[_0x53746b(0x20d)];if(_0x4d9f2a!=='trino'&&_0x4d9f2a!==_0x53746b(0x205))throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x57f9f1;if(_0x507bd9){if(_0x3c565a[0x0])throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x59c4d8=readSqlStatementsFromFile(_0x507bd9);if(_0x59c4d8[_0x53746b(0x1d2)]===0x0)throw new SDKError(ErrorCode[_0x53746b(0x1e1)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x59c4d8[_0x53746b(0x1d2)]>0x1)throw new SDKError(ErrorCode[_0x53746b(0x1e1)],_0x53746b(0x214));_0x57f9f1=_0x59c4d8[0x0];}else{if(!_0x3c565a[0x0])throw new SDKError(ErrorCode[_0x53746b(0x1e1)],_0x53746b(0x1d3));_0x57f9f1=_0x3c565a[0x0];}_0x560e7a[_0x53746b(0x216)]&&(console[_0x53746b(0x1f3)]('Job\x20type:\x20'+_0x4d9f2a),console[_0x53746b(0x1f3)](_0x53746b(0x1e2)+_0x416700),console[_0x53746b(0x1f3)](_0x53746b(0x1ee)+_0x57f9f1[_0x53746b(0x1e4)](0x0,0x64)+(_0x57f9f1[_0x53746b(0x1d2)]>0x64?'...':'')));const _0x300532=await withSpinner(_0x53746b(0x206),()=>_0xb17db0[_0x53746b(0x1e9)][_0x53746b(0x20c)](_0x416700,_0x57f9f1,_0x4d9f2a,_0x4a4e5f),{'verbose':_0x560e7a[_0x53746b(0x216)]}),_0x5e8795=_0x300532['data'];return console[_0x53746b(0x1f3)](_0x53746b(0x1d1)),console['error'](_0x53746b(0x20b)+_0x5e8795[_0x53746b(0x1d5)]),await handleSDKOutput([_0x5e8795],_0x560e7a),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a26_0x3de47c(0x1dc)]=a26_0x3de47c(0x1fa);[a26_0x3de47c(0x1ef)](_0x191c91){const _0x1def98=a26_0x3de47c,_0x274e66=_0x191c91[_0x1def98(0x1d8)][0x0];if(!_0x274e66)return _0x1def98(0x1c7);return undefined;}async[a26_0x3de47c(0x1dd)](_0x261870){const _0x114711=a26_0x3de47c,{options:_0x4c34a4,args:_0x358526,tdx:_0x2b3d7f}=_0x261870,_0x5694ab=_0x358526[0x0],_0x3b3fb1=await withSpinner(_0x114711(0x1e5),()=>_0x2b3d7f[_0x114711(0x1e9)][_0x114711(0x20d)](_0x5694ab),{'verbose':_0x4c34a4[_0x114711(0x216)]}),_0x411e49=_0x3b3fb1[_0x114711(0x1e0)];return console['error'](_0x114711(0x1cd)+_0x411e49[_0x114711(0x1d2)]+_0x114711(0x1c9)+(_0x411e49['length']!==0x1?'s':'')),await handleSDKOutput(_0x411e49,_0x4c34a4),0x0;}}
|
|
1
|
+
const a26_0x31ff3b=a26_0x5782;(function(_0x3669ce,_0x4becf4){const _0x21f6e2=a26_0x5782,_0xb4c00b=_0x3669ce();while(!![]){try{const _0x59612c=-parseInt(_0x21f6e2(0xa9))/0x1+parseInt(_0x21f6e2(0xce))/0x2*(parseInt(_0x21f6e2(0xbf))/0x3)+parseInt(_0x21f6e2(0x9b))/0x4+parseInt(_0x21f6e2(0x90))/0x5+-parseInt(_0x21f6e2(0x9f))/0x6+-parseInt(_0x21f6e2(0x78))/0x7*(parseInt(_0x21f6e2(0xc8))/0x8)+parseInt(_0x21f6e2(0x79))/0x9;if(_0x59612c===_0x4becf4)break;else _0xb4c00b['push'](_0xb4c00b['shift']());}catch(_0x430e78){_0xb4c00b['push'](_0xb4c00b['shift']());}}}(a26_0x2002,0x65f88));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';function a26_0x5782(_0x26b23a,_0x28e74c){_0x26b23a=_0x26b23a-0x73;const _0x2002c2=a26_0x2002();let _0x57827e=_0x2002c2[_0x26b23a];return _0x57827e;}import a26_0x4aaf78 from'chalk';function formatDuration(_0x5d1346){const _0x58585b=a26_0x5782;if(_0x5d1346<0x3c)return _0x5d1346+'s';if(_0x5d1346<0xe10)return Math[_0x58585b(0x84)](_0x5d1346/0x3c)+'m\x20'+_0x5d1346%0x3c+'s';const _0x14ba4e=Math[_0x58585b(0x84)](_0x5d1346/0xe10),_0x3d4c3c=Math[_0x58585b(0x84)](_0x5d1346%0xe10/0x3c);return _0x3d4c3c>0x0?_0x14ba4e+'h\x20'+_0x3d4c3c+'m':_0x14ba4e+'h';}function a26_0x2002(){const _0x45e9cf=['site','mo\x20ago','8hDzoQE','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','✔\x20Retrieved\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','priority','url','2cGCPxS','status','substring','\x20\x20Job\x20ID:\x20','submit','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','just\x20now','3806425bHTXyX','8647362mVxyue','\x20jobs','map','Show\x20job\x20details','job:kill','Job\x20type:\x20','Submitting\x20job...','validate','start_at','dim','trino','floor','✔\x20Job\x20submitted','✔\x20Found\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','No\x20SQL\x20statements\x20found\x20in\x20file','jobType','verbose','join','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','result','debug','name','2355305wZLqcJ','Limit:\x20','type','job:submit','job_id','List\x20jobs','end_at','query','database','jobs','Listing\x20jobs...','905420AiEkeV','created_at','error','push','1642554BOYpDr','presto','round','kill','\x20job','job:show','success','Get\x20job\x20results','Status\x20filter:\x20','...','771559rGoWdR','execute','data','m\x20ago','getTime','yes','INVALID_ARGUMENT','description','Cancelled','user_name','hive','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','red','show','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','\x27\x20to\x20verify\x20the\x20job\x20status','limit','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','information_schema','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','d\x20ago','Query:\x20','1045593BPSQzK','file','length','job:result','h\x20ago','args','Getting\x20job\x20results...'];a26_0x2002=function(){return _0x45e9cf;};return a26_0x2002();}function formatRelativeTime(_0xf61ee7){const _0x5afa3b=a26_0x5782,_0x4acf3a=Date['now']()-_0xf61ee7[_0x5afa3b(0xad)](),_0x59b719=Math[_0x5afa3b(0x84)](Math['abs'](_0x4acf3a)/0x3e8);if(_0x59b719<0x3c)return _0x5afa3b(0x77);const _0x4e3bf7=Math[_0x5afa3b(0x84)](_0x59b719/0x3c);if(_0x4e3bf7<0x3c)return _0x4e3bf7+_0x5afa3b(0xac);const _0x137098=Math[_0x5afa3b(0x84)](_0x4e3bf7/0x3c);if(_0x137098<0x18)return _0x137098+_0x5afa3b(0xc3);const _0x3077a5=Math[_0x5afa3b(0x84)](_0x137098/0x18);if(_0x3077a5<0x1e)return _0x3077a5+_0x5afa3b(0xbd);return Math[_0x5afa3b(0x84)](_0x3077a5/0x1e)+_0x5afa3b(0xc7);}export class JobListCommand extends BaseCommand{['name']='jobs';[a26_0x31ff3b(0xb0)]=a26_0x31ff3b(0x95);async[a26_0x31ff3b(0xaa)](_0xac04a5){const _0x25e044=a26_0x31ff3b,{options:_0x4cb76f,tdx:_0x2d9d39}=_0xac04a5,_0x17ea88=resolveLimit(_0x4cb76f[_0x25e044(0xb9)],DEFAULT_DISPLAY_LIMIT),_0x40cb6d=_0x4cb76f[_0x25e044(0xcf)];_0x4cb76f[_0x25e044(0x8a)]&&(console['error'](_0x25e044(0x91)+_0x17ea88+_0x25e044(0x7a)),_0x40cb6d&&console[_0x25e044(0x9d)](_0x25e044(0xa7)+_0x40cb6d));const _0x5596df=await withSpinner(_0x25e044(0x9a),()=>_0x2d9d39[_0x25e044(0x99)]['list']({'from':0x0,'to':_0x17ea88-0x1,'status':_0x40cb6d}),{'verbose':_0x4cb76f[_0x25e044(0x8a)]}),_0x335ea3=_0x5596df[_0x25e044(0xab)];console['error'](_0x25e044(0x86)+_0x335ea3[_0x25e044(0xc1)]+_0x25e044(0xa3)+(_0x335ea3['length']!==0x1?'s':''));const _0x25b7d3=_0x4cb76f[_0x25e044(0xc6)];if(isStructuredFormat(_0x4cb76f)){const _0x55effe=_0x335ea3[_0x25e044(0x7b)](_0x172350=>{const _0x824e44=_0x25e044;let _0x3089a6;if(_0x172350[_0x824e44(0x81)]&&_0x172350['end_at']){const _0x5dad6f=new Date(_0x172350[_0x824e44(0x81)])['getTime'](),_0x5d4a26=new Date(_0x172350[_0x824e44(0x96)])[_0x824e44(0xad)]();_0x3089a6=Math['round']((_0x5d4a26-_0x5dad6f)/0x3e8);}return{'job_id':_0x172350[_0x824e44(0x94)],'type':_0x172350[_0x824e44(0x92)]===_0x824e44(0xa0)?'trino':_0x172350[_0x824e44(0x92)],'status':_0x172350[_0x824e44(0xcf)],'user_name':_0x172350[_0x824e44(0xb2)],'duration_sec':_0x3089a6,'created_at':_0x172350[_0x824e44(0x9c)],'started_at':_0x172350['start_at'],'end_at':_0x172350[_0x824e44(0x96)]};});await handleSDKOutput(_0x55effe,_0x4cb76f);}else for(const _0x1d23b3 of _0x335ea3){const _0x423031=_0x1d23b3[_0x25e044(0xcf)]===_0x25e044(0xa5)?a26_0x4aaf78['green']:_0x1d23b3[_0x25e044(0xcf)]==='error'?a26_0x4aaf78[_0x25e044(0xb5)]:a26_0x4aaf78['dim'],_0x3a3b1b=_0x423031(_0x1d23b3[_0x25e044(0xcf)]),_0x2af22d=getJobUrl(_0x25b7d3,_0x1d23b3[_0x25e044(0x94)]),_0x1d60c1=hyperlink(_0x1d23b3[_0x25e044(0x94)],_0x2af22d),_0x3c950a=a26_0x4aaf78['dim'](_0x1d23b3['type']===_0x25e044(0xa0)?_0x25e044(0x83):_0x1d23b3['type']),_0x43eb70=[];if(_0x1d23b3[_0x25e044(0x81)]&&_0x1d23b3[_0x25e044(0x96)]){const _0x6da75e=Math[_0x25e044(0xa1)]((new Date(_0x1d23b3[_0x25e044(0x96)])['getTime']()-new Date(_0x1d23b3[_0x25e044(0x81)])[_0x25e044(0xad)]())/0x3e8);_0x43eb70['push'](formatDuration(_0x6da75e));}if(_0x1d23b3[_0x25e044(0x96)])_0x43eb70[_0x25e044(0x9e)](formatRelativeTime(new Date(_0x1d23b3[_0x25e044(0x96)])));else _0x1d23b3[_0x25e044(0x81)]&&_0x43eb70[_0x25e044(0x9e)](formatRelativeTime(new Date(_0x1d23b3['start_at'])));const _0x417bfb=_0x43eb70[_0x25e044(0xc1)]>0x0?a26_0x4aaf78[_0x25e044(0x82)]('\x20'+_0x43eb70[_0x25e044(0x8b)](',\x20')):'';console['log']('⚡\x20'+_0x1d60c1+'\x20'+_0x3c950a+'\x20'+_0x3a3b1b+_0x417bfb);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x31ff3b(0x8f)]=a26_0x31ff3b(0xa4);[a26_0x31ff3b(0xb0)]=a26_0x31ff3b(0x7c);[a26_0x31ff3b(0x80)](_0x507e21){const _0x1d885f=a26_0x31ff3b,_0xbc9287=_0x507e21['args'][0x0];if(!_0xbc9287)return _0x1d885f(0xbc);return undefined;}async[a26_0x31ff3b(0xaa)](_0xef6a73){const _0x11d170=a26_0x31ff3b,{options:_0x35de20,args:_0x8fe691,tdx:_0x37154b}=_0xef6a73,_0x1ecfa8=_0x8fe691[0x0],_0x11d671=await withSpinner('Getting\x20job\x20details...',()=>_0x37154b[_0x11d170(0x99)][_0x11d170(0xb6)](_0x1ecfa8),{'verbose':_0x35de20[_0x11d170(0x8a)]}),_0x576aca=_0x11d671[_0x11d170(0xab)];let _0x3ed945;if(_0x576aca[_0x11d170(0x81)]&&_0x576aca[_0x11d170(0x96)]){const _0xdf687d=new Date(_0x576aca[_0x11d170(0x81)])[_0x11d170(0xad)](),_0x1c130b=new Date(_0x576aca[_0x11d170(0x96)])[_0x11d170(0xad)]();_0x3ed945=Math[_0x11d170(0xa1)]((_0x1c130b-_0xdf687d)/0x3e8);}const _0xdd2db9={'job_id':_0x576aca[_0x11d170(0x94)],'type':_0x576aca[_0x11d170(0x92)],'status':_0x576aca[_0x11d170(0xcf)],..._0x576aca[_0x11d170(0xb2)]&&{'user_name':_0x576aca['user_name']},..._0x3ed945!==undefined&&{'duration_sec':_0x3ed945},..._0x576aca[_0x11d170(0x9c)]&&{'created_at':_0x576aca['created_at']},..._0x576aca[_0x11d170(0x81)]&&{'started_at':_0x576aca[_0x11d170(0x81)]},..._0x576aca[_0x11d170(0x96)]&&{'end_at':_0x576aca[_0x11d170(0x96)]},..._0x576aca[_0x11d170(0x98)]&&{'database':_0x576aca[_0x11d170(0x98)]},..._0x576aca['priority']!==undefined&&{'priority':_0x576aca[_0x11d170(0xcc)]},..._0x576aca[_0x11d170(0xcd)]&&{'url':_0x576aca['url']},..._0x576aca[_0x11d170(0x97)]&&{'query':_0x576aca[_0x11d170(0x97)]},..._0x576aca[_0x11d170(0x8e)]&&{'debug':_0x576aca[_0x11d170(0x8e)]}};return await handleSingleObjectOutput(_0xdd2db9,_0x35de20),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x31ff3b(0x7d);['description']='Kill\x20a\x20job';[a26_0x31ff3b(0x80)](_0x179e04){const _0x41ef21=a26_0x31ff3b,_0x2bf6bf=_0x179e04[_0x41ef21(0xc4)][0x0];if(!_0x2bf6bf)return _0x41ef21(0xb4);return undefined;}async[a26_0x31ff3b(0xaa)](_0x14ca33){const _0x38960b=a26_0x31ff3b,{options:_0x4354bb,args:_0x116d9f,tdx:_0x17de8c}=_0x14ca33,_0x4d5aba=_0x116d9f[0x0];if(!_0x4354bb[_0x38960b(0xae)]){const _0x42e19d=await confirm(_0x38960b(0xc9)+_0x4d5aba+'?');if(!_0x42e19d)return console[_0x38960b(0x9d)](_0x38960b(0xb1)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x17de8c[_0x38960b(0x99)][_0x38960b(0xa2)](_0x4d5aba),{'verbose':_0x4354bb[_0x38960b(0x8a)]}),console[_0x38960b(0x9d)](_0x38960b(0x8c)+_0x4d5aba),console[_0x38960b(0x9d)](_0x38960b(0xb7)+_0x4d5aba+_0x38960b(0xb8)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x31ff3b(0x8f)]=a26_0x31ff3b(0x93);['description']='Submit\x20a\x20job';async[a26_0x31ff3b(0xaa)](_0x56f127){const _0x271d6=a26_0x31ff3b,{options:_0x4b33ae,args:_0x195015,tdx:_0x85e1ac}=_0x56f127,_0xbc85dc=_0x4b33ae[_0x271d6(0x89)]||_0x271d6(0x83),_0x297e63=_0x4b33ae[_0x271d6(0xc0)],_0x281c4b=_0x4b33ae['database']||_0x271d6(0xbb),_0x2057ab=_0x4b33ae[_0x271d6(0x8d)];if(_0xbc85dc!==_0x271d6(0x83)&&_0xbc85dc!==_0x271d6(0xb3))throw new SDKError(ErrorCode[_0x271d6(0xaf)],_0x271d6(0xba));let _0x34cfdb;if(_0x297e63){if(_0x195015[0x0])throw new SDKError(ErrorCode[_0x271d6(0xaf)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x4abd2b=readSqlStatementsFromFile(_0x297e63);if(_0x4abd2b[_0x271d6(0xc1)]===0x0)throw new SDKError(ErrorCode[_0x271d6(0xaf)],_0x271d6(0x88));if(_0x4abd2b['length']>0x1)throw new SDKError(ErrorCode[_0x271d6(0xaf)],_0x271d6(0x76));_0x34cfdb=_0x4abd2b[0x0];}else{if(!_0x195015[0x0])throw new SDKError(ErrorCode[_0x271d6(0xaf)],_0x271d6(0xcb));_0x34cfdb=_0x195015[0x0];}_0x4b33ae[_0x271d6(0x8a)]&&(console[_0x271d6(0x9d)](_0x271d6(0x7e)+_0xbc85dc),console['error']('Database:\x20'+_0x281c4b),console[_0x271d6(0x9d)](_0x271d6(0xbe)+_0x34cfdb[_0x271d6(0x73)](0x0,0x64)+(_0x34cfdb['length']>0x64?_0x271d6(0xa8):'')));const _0x216863=await withSpinner(_0x271d6(0x7f),()=>_0x85e1ac[_0x271d6(0x99)][_0x271d6(0x75)](_0x281c4b,_0x34cfdb,_0xbc85dc,_0x2057ab),{'verbose':_0x4b33ae['verbose']}),_0x12093a=_0x216863[_0x271d6(0xab)];return console[_0x271d6(0x9d)](_0x271d6(0x85)),console[_0x271d6(0x9d)](_0x271d6(0x74)+_0x12093a[_0x271d6(0x94)]),await handleSDKOutput([_0x12093a],_0x4b33ae),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x31ff3b(0x8f)]=a26_0x31ff3b(0xc2);[a26_0x31ff3b(0xb0)]=a26_0x31ff3b(0xa6);[a26_0x31ff3b(0x80)](_0xc799a3){const _0x37265e=a26_0x31ff3b,_0x55e3fd=_0xc799a3[_0x37265e(0xc4)][0x0];if(!_0x55e3fd)return _0x37265e(0x87);return undefined;}async[a26_0x31ff3b(0xaa)](_0x25fcc5){const _0x3cf6f4=a26_0x31ff3b,{options:_0x58df1a,args:_0x1774c3,tdx:_0xe95388}=_0x25fcc5,_0x7225d3=_0x1774c3[0x0],_0x58f4c3=await withSpinner(_0x3cf6f4(0xc5),()=>_0xe95388[_0x3cf6f4(0x99)][_0x3cf6f4(0x8d)](_0x7225d3),{'verbose':_0x58df1a['verbose']}),_0x9717ed=_0x58f4c3['data'];return console[_0x3cf6f4(0x9d)](_0x3cf6f4(0xca)+_0x9717ed[_0x3cf6f4(0xc1)]+'\x20row'+(_0x9717ed[_0x3cf6f4(0xc1)]!==0x1?'s':'')),await handleSDKOutput(_0x9717ed,_0x58df1a),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x23db74=a27_0x1431;(function(_0x55834d,_0x297a51){const _0x127b9d=a27_0x1431,_0x2b4b41=_0x55834d();while(!![]){try{const _0x1b53ca=-parseInt(_0x127b9d(0x1a4))/0x1+-parseInt(_0x127b9d(0x253))/0x2+-parseInt(_0x127b9d(0x21e))/0x3*(parseInt(_0x127b9d(0x24e))/0x4)+-parseInt(_0x127b9d(0x202))/0x5+parseInt(_0x127b9d(0x1c8))/0x6*(parseInt(_0x127b9d(0x252))/0x7)+parseInt(_0x127b9d(0x22e))/0x8+parseInt(_0x127b9d(0x174))/0x9*(parseInt(_0x127b9d(0x222))/0xa);if(_0x1b53ca===_0x297a51)break;else _0x2b4b41['push'](_0x2b4b41['shift']());}catch(_0x77c162){_0x2b4b41['push'](_0x2b4b41['shift']());}}}(a27_0x316d,0x688b9));import a27_0x43c880 from'chalk';import a27_0x16dbc4 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';function a27_0x316d(){const _0x51040b=['user','Getting\x20version\x20','description','has','\x20\x20Parent\x20segment:\x20','session','verbose','List\x20journeys\x20in\x20current\x20context','add','history','✔\x20Found\x20','journey:pause','939447Tavcpk','\x0aPull\x20summary:','from','completionRate','includeHistory','No\x20journeys\x20found','getSegment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20--version\x20option\x20is\x20required','versionNumber','Pattern:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','/j/da/je','/e/','List\x20activations\x20for\x20a\x20journey',',\x20version:\x20','reentryMode','segmentPushCommand','✔\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20new\x20files','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey:version:create','launched','Parent\x20segment:\x20','\x20\x20Folder\x20path:\x20','blue','filter','\x20\x20Journey\x20ID:\x20','state','Fetching\x20users\x20and\x20connections...','size','cwd','(draft)','sort','yes','\x20(rule\x20match)','Resolved\x20YAML\x20file:\x20','Getting\x20journey\x20details...','renderStats','getActivation','error','listActivationsFlat','archived','stage','connection','Error:\x20Invalid\x20--type\x20\x22','folderPath','23986TopJnb','execute','Error:\x20Version\x20','no_parent','Show\x20journey\x20statistics','Resolving\x20parent\x20segment...','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','base','attributes','resolveParentId','completed','cyan','relative','listJourneysFromParentSegment','all','INVALID_ARGUMENT','paused','\x20\x20Preserving\x20local\x20segment\x20name:\x20','get','\x20->\x20','journeyId','tdx.json','journeyStages','No\x20statistics\x20available\x20for\x20journey:\x20','.yml','journey:traffic','values','name','listJourneysWithFolders','resolveJourneyId','red','utf-8','site','file','goalSize','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','186jxlZdZ','Cancelled','targetDir','Getting\x20journey\x20statistics...','/j/da','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x0aError:','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20Target:\x20','stageNameMap','replace','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','🗺️\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','resolveSegment','Show\x20journey\x20details','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','isNew','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','message','Target\x20file:\x20','journeyBundleId','content','options','journeyName','Error:\x20','toLowerCase','set','Export\x20journey(s)\x20as\x20YAML\x20files','conversion','tsv','json','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','data','milestoneSize','helpText','updatedAt','parentSegment','log','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','Input:\x20','limit','\x22\x20resumed','Listing\x20journey\x20versions...','args','entries','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','links','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x22\x20paused','completeMilestoneRate','audienceId','Found\x20','Options:','stages','397885Ghczai','then','includeStats','Resume\x20a\x20paused\x20journey','\x20files?','Listing\x20journeys...','yellow','enteredSize','journey:view','segments','table','\x20(draft)\x20—\x20\x22','getJourney','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','format','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segment','getLatestJourneyId','push','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','buildIdToNameMap','join','\x27\x20not\x20found\x20in\x20','folderId','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','buildIdToEmailMap','green','687prrFuS','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)','Listing\x20journey\x20activations...','rule','20GiAKQP','journey','find','...','dim','exitOrJumpRate','connector_config','\x20details...','\x20=\x20','segmentName','journey:push','hasChanges','4546800ixdvOH','journey:pull','Database:\x20','Folder\x20path:\x20','\x20not\x20found.\x20Available:\x20','getTrafficData','(root)','parent_segment','getStatistics','kind','Error:\x20Journey\x20not\x20found:\x20','errorCode','map','Creating\x20new\x20version...','getColumnMapping','Getting\x20column\x20mapping...','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','/app/ps/','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','✔\x20Pulled\x20','Table:\x20','activationParams','Show\x20journey\x20table\x20column\x20mapping','\x20(ID:\x20','Pausing\x20journey...','createdAt','type','repeat','\x0aChanges\x20to\x20\x27','Pause\x20a\x20running\x20journey','journeyBundleName','(archived)','236zjWfUd','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','activation','rootFolderId','68348VUogxb','1069018OWRaTM','length','exitOrJumpSize','jsonl','\x20Opening\x20','hasPeriod','stringify','Fetching\x20parent\x20segment...','(paused)','createVersion','List\x20all\x20versions\x20of\x20a\x20journey','root\x20folder','Warning:\x20Could\x20not\x20resolve\x20activation\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','relativePath','dryRun','localeCompare','Error:\x20Stage\x20\x22','goal','setPhase','filePath'];a27_0x316d=function(){return _0x51040b;};return a27_0x316d();}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(_0x553001){return!_0x553001&&(console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error']('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x553001;}function withJsonFormat(_0x30201b){const _0x12a1f1=a27_0x1431;if(!_0x30201b[_0x12a1f1(0x210)]&&!_0x30201b[_0x12a1f1(0x1e8)]&&!_0x30201b[_0x12a1f1(0x256)]&&!_0x30201b[_0x12a1f1(0x1e7)])return{..._0x30201b,'format':_0x12a1f1(0x1e8),'json':!![]};return _0x30201b;}function formatJourneyState(_0x1ed60c){const _0x2d5435=a27_0x1431;switch(_0x1ed60c){case _0x2d5435(0x18b):return a27_0x43c880['green']('(running)');case'draft':return a27_0x43c880[_0x2d5435(0x226)](_0x2d5435(0x195));case _0x2d5435(0x1b4):return a27_0x43c880['yellow'](_0x2d5435(0x25b));case _0x2d5435(0x1ae):return a27_0x43c880[_0x2d5435(0x18e)]('(completed)');case _0x2d5435(0x19f):return a27_0x43c880['dim'](_0x2d5435(0x24d));default:return'('+_0x1ed60c+')';}}function formatJourneyItem(_0x3f857f,_0x151047='',_0x57bc84){const _0x1b1a87=a27_0x1431,_0x4a4669=formatJourneyState(_0x3f857f[_0x1b1a87(0x191)]),_0x340f53=_0x57bc84?hyperlink(_0x3f857f[_0x1b1a87(0x24c)],_0x57bc84):_0x3f857f[_0x1b1a87(0x24c)];return _0x151047+_0x1b1a87(0x1d4)+_0x340f53+'\x20'+_0x4a4669;}function a27_0x1431(_0x357591,_0x40b3e5){_0x357591=_0x357591-0x161;const _0x316d53=a27_0x316d();let _0x143191=_0x316d53[_0x357591];return _0x143191;}function escapeRegex(_0x568237){const _0x110f8f=a27_0x1431;return _0x568237[_0x110f8f(0x1d2)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x5e24b4){const _0x31213e=a27_0x1431,_0x399483=_0x5e24b4['split']('*')[_0x31213e(0x23a)](escapeRegex);return new RegExp(_0x399483['join']('.*'),'i');}function buildRuleToNameMapping(_0xb4f452){const _0x387075=a27_0x1431,_0x4816f2=new Map();if(_0xb4f452[_0x387075(0x20b)])for(const [_0x304929,_0x3cb077]of Object[_0x387075(0x1f7)](_0xb4f452[_0x387075(0x20b)])){if(_0x3cb077[_0x387075(0x221)]){const _0x4641e3=serializeRule(_0x3cb077['rule']),_0x4549b0=_0x4816f2[_0x387075(0x1b6)](_0x4641e3);_0x4549b0?_0x4549b0[_0x387075(0x215)](_0x304929):_0x4816f2['set'](_0x4641e3,[_0x304929]);}}return _0x4816f2;}async function resolveJourneyIdFromInput(_0x3a45e8,_0x1b692d,_0x2df3bb){const _0x190c56=a27_0x1431,_0x319d31=await resolveJourneyTarget(_0x3a45e8,_0x1b692d[_0x190c56(0x1ee)],_0x1b692d[_0x190c56(0x16e)]),_0x3e2088=_0x319d31['parentSegment'];if(!_0x3e2088)throw new SDKError(ErrorCode[_0x190c56(0x1b3)],_0x190c56(0x1fa));const _0x34f957=await withSpinner(_0x190c56(0x1a9),()=>_0x2df3bb['segment'][_0x190c56(0x1ad)](_0x3e2088),{'verbose':_0x1b692d['verbose']}),_0x55a9b5=_0x34f957['data'],_0x30b0c8=await withSpinner('Resolving\x20journey...',()=>_0x2df3bb[_0x190c56(0x223)][_0x190c56(0x1c1)](_0x55a9b5,_0x319d31[_0x190c56(0x1e1)]),{'verbose':_0x1b692d[_0x190c56(0x16e)]});return{'journeyId':_0x30b0c8[_0x190c56(0x1ea)],'journeyName':_0x319d31['journeyName'],'parentSegmentId':_0x55a9b5};}async function resolveJourneyTarget(_0x2dad51,_0x987053,_0x1be36f){const _0x303d85=a27_0x1431;if(isYamlFilePath(_0x2dad51))try{const _0x54dc74=await resolveYamlFilePath(_0x2dad51);return _0x1be36f&&(console[_0x303d85(0x19d)](_0x303d85(0x199)+_0x2dad51),console[_0x303d85(0x19d)](_0x303d85(0x16c)+_0x54dc74['parentSegment']),console[_0x303d85(0x19d)]('\x20\x20Name:\x20'+_0x54dc74[_0x303d85(0x22b)]),console[_0x303d85(0x19d)](_0x303d85(0x18d)+(_0x54dc74[_0x303d85(0x1a3)]||_0x303d85(0x234)))),{'journeyName':_0x54dc74[_0x303d85(0x22b)],'parentSegment':_0x54dc74[_0x303d85(0x1ee)],'resolved':_0x54dc74};}catch(_0x63dabe){throw new SDKError(ErrorCode[_0x303d85(0x1b3)],_0x303d85(0x1cf)+_0x63dabe['message']);}if(!_0x987053)throw new SDKError(ErrorCode[_0x303d85(0x1b3)],_0x303d85(0x1fb));return{'journeyName':_0x2dad51,'parentSegment':_0x987053};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x23db74(0x16a)]=a27_0x23db74(0x16f);async[a27_0x23db74(0x1a5)](_0xba717b){const _0x13e0b4=a27_0x23db74,{options:_0x52dba5,args:_0x5baf5a,tdx:_0x58a87c}=_0xba717b,_0x589710=_0x5baf5a[0x0],_0x121b7c=_0x52dba5[_0x13e0b4(0x1ee)];if(!_0x121b7c)return console[_0x13e0b4(0x19d)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x13e0b4(0x19d)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x4c18c0=await withSpinner(_0x13e0b4(0x1a9),()=>_0x58a87c[_0x13e0b4(0x213)]['resolveParentId'](_0x121b7c),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]}),_0x332c28=_0x4c18c0['data'];_0x52dba5['verbose']&&(console['error']('Parent\x20segment:\x20'+_0x121b7c+_0x13e0b4(0x245)+_0x332c28+')'),_0x589710&&console[_0x13e0b4(0x19d)](_0x13e0b4(0x17e)+_0x589710));const _0x50c44f=await withSpinner(_0x13e0b4(0x25a),()=>_0x58a87c[_0x13e0b4(0x213)]['getParentFull'](_0x332c28),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]}),_0x38f873=_0x50c44f[_0x13e0b4(0x1ea)],_0x2d8f1d=_0x38f873[_0x13e0b4(0x251)],_0x3129ce=await withSpinner(_0x13e0b4(0x207),()=>_0x58a87c['journey'][_0x13e0b4(0x1c0)](_0x332c28,_0x2d8f1d),{'verbose':_0x52dba5[_0x13e0b4(0x16e)]});let _0x14031e=_0x3129ce[_0x13e0b4(0x1ea)]['journeys'];const _0x49d148=_0x3129ce[_0x13e0b4(0x1ea)]['folders'],_0x4a4a29=new Map();for(const _0x2b5faa of _0x49d148){_0x4a4a29[_0x13e0b4(0x1e4)](_0x2b5faa['id'],_0x2b5faa[_0x13e0b4(0x1bf)]);}if(_0x589710){const _0x4f5112=globToRegex(_0x589710);_0x14031e=_0x14031e[_0x13e0b4(0x18f)](_0xc19d31=>_0x4f5112['test'](_0xc19d31[_0x13e0b4(0x24c)]));}console[_0x13e0b4(0x19d)](_0x13e0b4(0x172)+_0x14031e['length']+'\x20journey'+(_0x14031e[_0x13e0b4(0x254)]!==0x1?'s':''));const _0x55628f=_0x39f057=>{const _0x81afbb=_0x13e0b4;return getConsoleNextUrl(_0x52dba5[_0x81afbb(0x1c4)],_0x81afbb(0x23f)+_0x332c28+_0x81afbb(0x181)+_0x39f057+_0x81afbb(0x1cc));};if(_0x52dba5[_0x13e0b4(0x210)]==='table')await handleSDKOutput(_0x14031e,_0x52dba5);else{if(_0x52dba5['format']===_0x13e0b4(0x1e8)){const _0x21dce2=_0x14031e['map'](_0x2b9d1a=>({..._0x2b9d1a,'url':_0x55628f(_0x2b9d1a['id'])}));await handleSDKOutput(_0x21dce2,_0x52dba5);}else{console[_0x13e0b4(0x1ef)]('['+_0x121b7c+']');const _0x32fd08=new Map(),_0xaff9e8=[];for(const _0x54b277 of _0x14031e){if(!_0x54b277[_0x13e0b4(0x21a)]||_0x54b277[_0x13e0b4(0x21a)]===_0x2d8f1d)_0xaff9e8[_0x13e0b4(0x215)](_0x54b277);else{const _0x468613=_0x32fd08['get'](_0x54b277[_0x13e0b4(0x21a)])||[];_0x468613[_0x13e0b4(0x215)](_0x54b277),_0x32fd08[_0x13e0b4(0x1e4)](_0x54b277[_0x13e0b4(0x21a)],_0x468613);}}const _0x5db9c7=(_0x5c615d,_0x3507c1)=>_0x5c615d[_0x13e0b4(0x24c)]['localeCompare'](_0x3507c1[_0x13e0b4(0x24c)],undefined,{'sensitivity':_0x13e0b4(0x1ab)});_0xaff9e8['sort'](_0x5db9c7);for(const _0x47a979 of _0xaff9e8){console['log'](formatJourneyItem(_0x47a979,'',_0x55628f(_0x47a979['id'])));}const _0x1d5d89=[..._0x32fd08[_0x13e0b4(0x1f7)]()][_0x13e0b4(0x196)]((_0x48204b,_0x564dcb)=>{const _0x157efb=_0x13e0b4,_0x4da3ce=_0x4a4a29[_0x157efb(0x1b6)](_0x48204b[0x0])||_0x48204b[0x0],_0x3a11f4=_0x4a4a29[_0x157efb(0x1b6)](_0x564dcb[0x0])||_0x564dcb[0x0];return _0x4da3ce[_0x157efb(0x163)](_0x3a11f4,undefined,{'sensitivity':_0x157efb(0x1ab)});});for(const [_0x363e57,_0x336955]of _0x1d5d89){const _0x4345e3=_0x4a4a29[_0x13e0b4(0x1b6)](_0x363e57)||_0x363e57;console[_0x13e0b4(0x1ef)]('📁\x20'+_0x4345e3),_0x336955[_0x13e0b4(0x196)](_0x5db9c7);for(const _0x36b0d8 of _0x336955){console[_0x13e0b4(0x1ef)](formatJourneyItem(_0x36b0d8,'\x20\x20',_0x55628f(_0x36b0d8['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x23db74(0x20a);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1d8);async[a27_0x23db74(0x1a5)](_0x469121){const _0x20cc61=a27_0x23db74,{options:_0x2f0d48,args:_0x2f081e,tdx:_0x16798b}=_0x469121,_0x51f94b=_0x2f081e[0x0];if(!_0x51f94b)return console[_0x20cc61(0x19d)](_0x20cc61(0x240)),console[_0x20cc61(0x19d)](_0x20cc61(0x1f8)),console[_0x20cc61(0x19d)](_0x20cc61(0x200)),console[_0x20cc61(0x19d)](_0x20cc61(0x1aa)),0x1;_0x2f0d48['verbose']&&console[_0x20cc61(0x19d)](_0x20cc61(0x1f2)+_0x51f94b);const {journeyId:_0x5efd4e,parentSegmentId:_0x58563e}=await resolveJourneyIdFromInput(_0x51f94b,_0x2f0d48,_0x16798b);if(_0x2f0d48['web']){const _0x38e7d3=getConsoleNextUrl(_0x2f0d48[_0x20cc61(0x1c4)],_0x20cc61(0x23f)+_0x58563e+'/e/'+_0x5efd4e+_0x20cc61(0x180));return console['error'](a27_0x43c880[_0x20cc61(0x21d)]('✔')+_0x20cc61(0x257)+a27_0x43c880[_0x20cc61(0x1af)](_0x38e7d3)),openBrowser(_0x38e7d3),0x0;}const _0x7c01af=await withSpinner(_0x20cc61(0x19a),()=>_0x16798b[_0x20cc61(0x223)]['getJourney'](_0x5efd4e),{'verbose':_0x2f0d48[_0x20cc61(0x16e)]}),_0x4895f6=_0x7c01af[_0x20cc61(0x1ea)],_0xea0285=_0x2f0d48[_0x20cc61(0x204)];let _0x53c6a2;if(_0xea0285)try{const _0x68da06=await withSpinner(_0x20cc61(0x1cb),()=>_0x16798b[_0x20cc61(0x223)][_0x20cc61(0x236)](_0x5efd4e),{'verbose':_0x2f0d48['verbose']});_0x53c6a2=_0x68da06[_0x20cc61(0x1ea)];}catch{_0x2f0d48[_0x20cc61(0x16e)]&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x47e684=getConsoleNextUrl(_0x2f0d48[_0x20cc61(0x1c4)],'/app/ps/'+_0x58563e+_0x20cc61(0x181)+_0x5efd4e+'/j/da/je'),_0x3c8ae3={'id':_0x4895f6['id'],'name':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1bf)],'description':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x16a)],'state':_0x4895f6['attributes']['state'],'paused':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1b4)],'reentry_mode':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x184)],'stages':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x1ba)]?.[_0x20cc61(0x254)]||0x0,..._0x4895f6['attributes']['goal']&&{'goal':_0x4895f6[_0x20cc61(0x1ac)][_0x20cc61(0x165)][_0x20cc61(0x1bf)]},..._0x53c6a2&&{'statistics':{'size':_0x53c6a2[_0x20cc61(0x193)],'entered':_0x53c6a2[_0x20cc61(0x209)],'goal_achieved':_0x53c6a2[_0x20cc61(0x1c6)],'completion_rate':_0x53c6a2[_0x20cc61(0x177)],'exit_or_jump':_0x53c6a2[_0x20cc61(0x255)],'exit_or_jump_rate':_0x53c6a2[_0x20cc61(0x227)],'stages':_0x53c6a2[_0x20cc61(0x201)]}},'url':_0x47e684};return await handleSingleObjectOutput(_0x3c8ae3,_0x2f0d48),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:stats';['description']=a27_0x23db74(0x1a8);async[a27_0x23db74(0x1a5)](_0x199a20){const _0xf3d8d2=a27_0x23db74,{options:_0x5c9984,args:_0x11ca65,tdx:_0x56f772}=_0x199a20,_0x23c2fb=_0x11ca65[0x0];if(!requireNameOrPath(_0x23c2fb))return 0x1;_0x5c9984[_0xf3d8d2(0x16e)]&&console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x1f2)+_0x23c2fb);const _0xd9f5b4=_0x5c9984,_0x4c39d5=_0xd9f5b4[_0xf3d8d2(0x176)],_0x488914=_0xd9f5b4['to'],_0x36cbc5=_0xd9f5b4['includeHistory'],_0x416787=_0xd9f5b4[_0xf3d8d2(0x1a0)];_0x36cbc5&&!_0x4c39d5&&!_0x488914&&console['error'](_0xf3d8d2(0x216));const _0x1de737=_0x36cbc5?withJsonFormat(_0x5c9984):_0x5c9984,{journeyId:_0x25f7d4,journeyName:_0x54cf3c}=await resolveJourneyIdFromInput(_0x23c2fb,_0x1de737,_0x56f772),_0x38816f=_0x4c39d5||_0x488914?{'from':_0x4c39d5,'to':_0x488914}:undefined,_0x5471fe=await withSpinner(_0xf3d8d2(0x1cb),()=>Promise[_0xf3d8d2(0x1b2)]([_0x56f772[_0xf3d8d2(0x223)][_0xf3d8d2(0x20e)](_0x25f7d4),_0x56f772[_0xf3d8d2(0x223)][_0xf3d8d2(0x236)](_0x25f7d4,_0x38816f)]),{'verbose':_0x1de737[_0xf3d8d2(0x16e)]}),[_0x21bf40,_0x2e34b9]=_0x5471fe[_0xf3d8d2(0x1ea)];if(!_0x2e34b9||_0x2e34b9[_0xf3d8d2(0x1b8)]===null)return console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x1bb)+_0x54cf3c),console[_0xf3d8d2(0x19d)](_0xf3d8d2(0x21b)),0x0;const _0x1425bb=buildStageNameMap(_0x21bf40),_0x2f9456=!!(_0x38816f&&_0x2e34b9['history']?.[_0xf3d8d2(0x254)]),_0x1d82c5={'stageNameMap':_0x1425bb,'hasPeriod':_0x2f9456,'includeHistory':!!_0x36cbc5};if(_0x416787&&_0x2e34b9[_0xf3d8d2(0x201)]){const _0x414fca=_0x2e34b9['stages'][_0xf3d8d2(0x224)](_0x59d364=>{const _0x4d1b3d=_0xf3d8d2,_0x30236d=_0x1425bb[_0x4d1b3d(0x1b6)](_0x59d364['id'])??'';return _0x30236d[_0x4d1b3d(0x1e3)]()===_0x416787['toLowerCase']();});if(_0x414fca)return await handleSingleObjectOutput(formatStageStats(_0x414fca,_0x1d82c5),_0x1de737),0x0;const _0x3f464e=_0x2e34b9[_0xf3d8d2(0x201)][_0xf3d8d2(0x23a)](_0x54481f=>_0x1425bb[_0xf3d8d2(0x1b6)](_0x54481f['id'])??_0x54481f['id']);return console['error'](_0xf3d8d2(0x164)+_0x416787+'\x22\x20not\x20found'),console[_0xf3d8d2(0x19d)]('Available\x20stages:\x20'+_0x3f464e[_0xf3d8d2(0x218)](',\x20')),0x1;}const _0x3d80d6=_0x2e34b9[_0xf3d8d2(0x201)]?.[_0xf3d8d2(0x23a)](_0x5d4410=>formatStageStats(_0x5d4410,_0x1d82c5)),_0x492c6f=assembleJourneyStats(_0x2e34b9,{'from':_0x4c39d5,'to':_0x488914,'includeHistory':_0x36cbc5});return await this[_0xf3d8d2(0x19b)](_0x492c6f,_0x3d80d6??[],_0x1de737),0x0;}async[a27_0x23db74(0x19b)](_0xd899d7,_0x15e90b,_0x454be3){const _0x59383f=a27_0x23db74,_0x4ccd1e=_0x454be3[_0x59383f(0x210)]==='json'||_0x454be3['format']===_0x59383f(0x256)||_0x454be3['json']||_0x454be3['jsonl'];if(_0x4ccd1e){_0xd899d7[_0x59383f(0x201)]=_0x15e90b,await handleSingleObjectOutput(_0xd899d7,_0x454be3);return;}await handleSingleObjectOutput(_0xd899d7,_0x454be3);for(const _0xa03a4c of _0x15e90b){console[_0x59383f(0x1ef)](''),console[_0x59383f(0x1ef)](String(a27_0x43c880['cyan']['bold']('['+_0xa03a4c[_0x59383f(0x1bf)]+']'))+a27_0x43c880[_0x59383f(0x226)]('\x20'+_0xa03a4c['id']));const {id:_0x58ad5c,name:_0x5882df,..._0xfd74e2}=_0xa03a4c;await handleSingleObjectOutput(_0xfd74e2,_0x454be3);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a27_0x23db74(0x1bd);[a27_0x23db74(0x16a)]=a27_0x23db74(0x17f);async[a27_0x23db74(0x1a5)](_0x486190){const _0xdd1d45=a27_0x23db74,{options:_0x1e4c9c,args:_0x19aa67,tdx:_0x373f13}=_0x486190,_0x468d3f=_0x19aa67[0x0];if(!requireNameOrPath(_0x468d3f))return 0x1;_0x1e4c9c[_0xdd1d45(0x16e)]&&console['error'](_0xdd1d45(0x1f2)+_0x468d3f);const _0x36f545=_0x1e4c9c,_0x277285=_0x36f545[_0xdd1d45(0x248)],_0x3aed51=_0x36f545[_0xdd1d45(0x176)],_0x2a110f=_0x36f545['to'],_0x16f000=_0x36f545[_0xdd1d45(0x1f3)];if(_0x277285&&_0x277285!==_0xdd1d45(0x1e6)&&_0x277285!==_0xdd1d45(0x250))return console[_0xdd1d45(0x19d)](_0xdd1d45(0x1a2)+_0x277285+_0xdd1d45(0x24f)),0x1;const _0x1063ab=withJsonFormat(_0x1e4c9c),{journeyId:_0x18f9b6,journeyName:_0x118dee}=await resolveJourneyIdFromInput(_0x468d3f,_0x1063ab,_0x373f13),_0x5a1370={'type':_0x277285,'from':_0x3aed51,'to':_0x2a110f,'limit':_0x16f000},_0x433c46=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x373f13['journey'][_0xdd1d45(0x233)](_0x18f9b6,_0x5a1370),{'verbose':_0x1063ab[_0xdd1d45(0x16e)]}),_0x114793=_0x433c46[_0xdd1d45(0x1ea)],_0xb50d1a=_0x114793[_0xdd1d45(0x1e6)]&&(_0x114793[_0xdd1d45(0x1e6)]['nodes'][_0xdd1d45(0x254)]>0x0||_0x114793[_0xdd1d45(0x1e6)][_0xdd1d45(0x1f9)][_0xdd1d45(0x254)]>0x0),_0x2ea293=_0x114793['activation']&&_0x114793[_0xdd1d45(0x250)][_0xdd1d45(0x254)]>0x0;if(!_0xb50d1a&&!_0x2ea293)return console[_0xdd1d45(0x19d)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x118dee),console[_0xdd1d45(0x19d)](_0xdd1d45(0x23e)),_0x3aed51&&_0x2a110f&&console[_0xdd1d45(0x19d)](_0xdd1d45(0x211)),0x0;return await handleSingleObjectOutput(_0x114793,_0x1063ab),0x0;}}function formatStageStats(_0x19649f,_0x2f8748){const _0x353cc6=a27_0x23db74,_0x3282b1=_0x2f8748[_0x353cc6(0x258)]&&_0x19649f[_0x353cc6(0x171)]?.[_0x353cc6(0x254)]?aggregateStageHistory(_0x19649f[_0x353cc6(0x171)]):{'size':_0x19649f[_0x353cc6(0x193)],'entered':_0x19649f[_0x353cc6(0x209)],'milestone':_0x19649f[_0x353cc6(0x1eb)],'milestone_rate':_0x19649f[_0x353cc6(0x1fd)],'exit_or_jump':_0x19649f[_0x353cc6(0x255)],'exit_or_jump_rate':_0x19649f[_0x353cc6(0x227)]},_0x199f71={'id':_0x19649f['id'],'name':_0x2f8748[_0x353cc6(0x1d1)][_0x353cc6(0x1b6)](_0x19649f['id'])??_0x19649f['id'],..._0x3282b1};return _0x2f8748[_0x353cc6(0x258)]&&_0x2f8748[_0x353cc6(0x178)]&&_0x19649f[_0x353cc6(0x171)]&&(_0x199f71[_0x353cc6(0x171)]=_0x19649f[_0x353cc6(0x171)]),_0x199f71;}export class JourneyPauseCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x173);['description']=a27_0x23db74(0x24b);async['execute'](_0x470e4c){const _0x29c0a5=a27_0x23db74,{options:_0x5916e3,args:_0x45f06d,tdx:_0x40d409}=_0x470e4c,_0x122706=_0x45f06d[0x0];if(!requireNameOrPath(_0x122706))return 0x1;_0x5916e3['verbose']&&console[_0x29c0a5(0x19d)](_0x29c0a5(0x1f2)+_0x122706);const {journeyId:_0x365a0f,journeyName:_0x25037e}=await resolveJourneyIdFromInput(_0x122706,_0x5916e3,_0x40d409);if(!_0x5916e3['yes']){const _0x48cf1f=await confirm(_0x29c0a5(0x20f)+_0x25037e+'\x22?');if(!_0x48cf1f)return console[_0x29c0a5(0x19d)](_0x29c0a5(0x1c9)),0x0;}const _0x1a8bbb=await withSpinner(_0x29c0a5(0x246),()=>_0x40d409['journey']['pause'](_0x365a0f),{'verbose':_0x5916e3[_0x29c0a5(0x16e)]}),_0x3abe73=_0x1a8bbb['data'];return console['error']('✔\x20Journey\x20\x22'+_0x3abe73[_0x29c0a5(0x1ac)][_0x29c0a5(0x1bf)]+_0x29c0a5(0x1fc)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:resume';[a27_0x23db74(0x16a)]=a27_0x23db74(0x205);async[a27_0x23db74(0x1a5)](_0x2ecf91){const _0x569d9d=a27_0x23db74,{options:_0x32e5de,args:_0x3a68d0,tdx:_0x5117a0}=_0x2ecf91,_0x2573ed=_0x3a68d0[0x0];if(!requireNameOrPath(_0x2573ed))return 0x1;_0x32e5de['verbose']&&console[_0x569d9d(0x19d)](_0x569d9d(0x1f2)+_0x2573ed);const {journeyId:_0x3ba2f4,journeyName:_0xef9d5a}=await resolveJourneyIdFromInput(_0x2573ed,_0x32e5de,_0x5117a0);if(!_0x32e5de[_0x569d9d(0x197)]){const _0x3eabdc=await confirm(_0x569d9d(0x1db)+_0xef9d5a+'\x22?');if(!_0x3eabdc)return console[_0x569d9d(0x19d)]('Cancelled'),0x0;}const _0x41848d=await withSpinner('Resuming\x20journey...',()=>_0x5117a0['journey']['resume'](_0x3ba2f4),{'verbose':_0x32e5de[_0x569d9d(0x16e)]}),_0x246088=_0x41848d[_0x569d9d(0x1ea)];return console[_0x569d9d(0x19d)]('✔\x20Journey\x20\x22'+_0x246088[_0x569d9d(0x1ac)][_0x569d9d(0x1bf)]+_0x569d9d(0x1f4)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x22f);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1e5);async[a27_0x23db74(0x1a5)](_0x281bac){const _0x3a5323=a27_0x23db74,{options:_0x4dcf27,args:_0x26bbe6,tdx:_0x4ff4f7}=_0x281bac,_0x5c2a02=_0x4dcf27,_0x328ff2=_0x26bbe6[0x0],_0x437fe3=_0x328ff2&&isYamlFilePath(_0x328ff2),_0xb33ce=await resolveTarget({'arg':_0x437fe3?_0x328ff2:undefined,'contextParent':_0x4dcf27[_0x3a5323(0x1ee)],'cwd':process[_0x3a5323(0x194)]()});if(!isSuccessfulResolution(_0xb33ce))return _0xb33ce[_0x3a5323(0x239)]===_0x3a5323(0x1a7)?(console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x208)](_0x3a5323(0x1e9))),console[_0x3a5323(0x19d)](_0x3a5323(0x21f)),console[_0x3a5323(0x19d)](_0x3a5323(0x1d6)),console[_0x3a5323(0x19d)](_0x3a5323(0x187)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x1c2)](_0x3a5323(0x1e2)+_0xb33ce['message']+'\x0a')),_0xb33ce[_0x3a5323(0x1ec)]&&console[_0x3a5323(0x19d)](a27_0x43c880['cyan'](_0xb33ce[_0x3a5323(0x1ec)]))),0x1;let _0x18db3d=_0x437fe3?undefined:_0x328ff2,_0x30bfed,_0x3fc52d;_0xb33ce[_0x3a5323(0x248)]===_0x3a5323(0x1c5)&&(_0x18db3d=_0xb33ce['resourceName'],_0x30bfed=_0xb33ce[_0x3a5323(0x167)],_0x3fc52d=_0xb33ce[_0x3a5323(0x1a3)]);const _0x1e77f6=_0xb33ce[_0x3a5323(0x1f1)],_0x196322=_0xb33ce[_0x3a5323(0x1ca)];_0x5c2a02['verbose']&&(console[_0x3a5323(0x19d)](_0x3a5323(0x18c)+_0x1e77f6),console[_0x3a5323(0x19d)]('Target\x20directory:\x20'+_0x196322),_0x18db3d&&console[_0x3a5323(0x19d)]('Journey\x20name:\x20'+_0x18db3d),_0x30bfed&&console['error'](_0x3a5323(0x1dd)+_0x30bfed),_0x3fc52d&&console['error'](_0x3a5323(0x231)+_0x3fc52d));const _0x46da31=await withSpinner(_0x3a5323(0x1a9),()=>_0x4ff4f7[_0x3a5323(0x213)]['resolveParentId'](_0x1e77f6),{'verbose':_0x4dcf27[_0x3a5323(0x16e)]}),_0xad9546=_0x46da31['data'],{journeys:_0x22d1b3,folders:_0x7de3a8}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x9dceae=_0x3a5323,[_0x36cbc2,_0x47f359]=await Promise[_0x9dceae(0x1b2)]([_0x4ff4f7['journey'][_0x9dceae(0x1b1)](_0xad9546,undefined,{'includeAllVersions':!![]}),_0x4ff4f7[_0x9dceae(0x213)]['listFolders'](_0xad9546)]);return{'journeys':_0x36cbc2,'folders':_0x47f359};},{'verbose':_0x4dcf27[_0x3a5323(0x16e)]})[_0x3a5323(0x203)](_0x2c94d8=>_0x2c94d8[_0x3a5323(0x1ea)]);let _0x2f2ac1=_0x22d1b3;const _0x32e080=buildFolderIdToPathMap(_0x7de3a8);if(_0x18db3d){const _0x4da4d7=_0x2f2ac1[_0x3a5323(0x18f)](_0x54377b=>_0x54377b['journeyBundleName'][_0x3a5323(0x1e3)]()===_0x18db3d[_0x3a5323(0x1e3)]());if(_0x4da4d7[_0x3a5323(0x254)]===0x0)return console['error'](_0x3a5323(0x238)+_0x18db3d),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x2f2ac1=_0x4da4d7;}if(_0x3fc52d!==undefined){const _0x34f26c=_0x2f2ac1[_0x3a5323(0x18f)](_0x6ad6b2=>{const _0x5f1371=_0x3a5323,_0x517d3f=_0x6ad6b2['folderId']?_0x32e080[_0x5f1371(0x1b6)](_0x6ad6b2[_0x5f1371(0x21a)])||'':'';return _0x517d3f===_0x3fc52d;});if(_0x34f26c['length']===0x0&&_0x2f2ac1[_0x3a5323(0x254)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x18db3d+_0x3a5323(0x219)+(_0x3fc52d||_0x3a5323(0x25e))),console['error'](_0x3a5323(0x1c7));for(const _0x21bcf8 of _0x2f2ac1){const _0x4398ea=_0x21bcf8[_0x3a5323(0x21a)]?_0x32e080[_0x3a5323(0x1b6)](_0x21bcf8['folderId'])||'':'';console['error']('\x20\x20-\x20'+(_0x4398ea||_0x3a5323(0x234))+'/'+_0x21bcf8[_0x3a5323(0x24c)]);}return 0x1;}_0x2f2ac1=_0x34f26c;}if(_0x2f2ac1['length']===0x0)return console['error'](_0x3a5323(0x179)),0x0;const _0x4e20ab=new Map();for(const _0x12ca3b of _0x2f2ac1){const _0x4de515=_0x12ca3b[_0x3a5323(0x1de)];!_0x4e20ab[_0x3a5323(0x16b)](_0x4de515)&&_0x4e20ab[_0x3a5323(0x1e4)](_0x4de515,[]),_0x4e20ab['get'](_0x4de515)['push'](_0x12ca3b);}for(const _0x1123db of _0x4e20ab[_0x3a5323(0x1be)]()){_0x1123db[_0x3a5323(0x196)]((_0x4ce983,_0x14afc3)=>(_0x4ce983['versionNumber']||0x0)-(_0x14afc3[_0x3a5323(0x17d)]||0x0));}const _0x5ca0bc=[],{idToEmailMap:_0x4df5b1,connectionIdToNameMap:_0x53b0aa}=await withSpinner(_0x3a5323(0x192),async()=>{const _0x4d51d9=_0x3a5323,[_0x46eb83,_0xeb104c]=await Promise[_0x4d51d9(0x1b2)]([_0x4ff4f7[_0x4d51d9(0x168)][_0x4d51d9(0x21c)](),_0x4ff4f7['connection'][_0x4d51d9(0x217)]()]);return{'idToEmailMap':_0x46eb83,'connectionIdToNameMap':_0xeb104c};},{'verbose':_0x4dcf27[_0x3a5323(0x16e)]})['then'](_0x5c72a1=>_0x5c72a1[_0x3a5323(0x1ea)]);for(const _0x57bb37 of _0x4e20ab[_0x3a5323(0x1be)]()){const _0x11e483=_0x57bb37[0x0][_0x3a5323(0x24c)],_0x4c6057=_0x57bb37[0x0][_0x3a5323(0x21a)],_0x369672=_0x4c6057?_0x32e080[_0x3a5323(0x1b6)](_0x4c6057)||'':'',_0x3fbd23=_0x369672?a27_0x16dbc4[_0x3a5323(0x218)](_0x196322,_0x369672):_0x196322,_0x289a55=_0x30bfed||a27_0x16dbc4[_0x3a5323(0x218)](_0x3fbd23,sanitizeFileName(_0x11e483)+_0x3a5323(0x1bc));let _0x2910fa,_0x208a59;if(existsSync(_0x289a55))try{const _0x277012=readFileSync(_0x289a55,_0x3a5323(0x1c3)),_0x30cd79=parseYamlString(_0x277012);_0x208a59=_0x30cd79,_0x2910fa=buildRuleToNameMapping(_0x30cd79),_0x5c2a02[_0x3a5323(0x16e)]&&_0x2910fa[_0x3a5323(0x193)]>0x0&&console[_0x3a5323(0x19d)](_0x3a5323(0x1ff)+_0x2910fa[_0x3a5323(0x193)]+_0x3a5323(0x212)+_0x11e483);}catch(_0x33858d){_0x5c2a02[_0x3a5323(0x16e)]&&console[_0x3a5323(0x19d)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x33858d[_0x3a5323(0x1dc)]);}const _0x446184=[],_0x5656d7=new Set(),_0x3bbfdd=new Map(),_0x2f240d=new Map(),_0x1b82bb=new Set(),_0x32b6eb=new Map(),_0x45aefc=new Map(),_0x189b1a=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x11e483+_0x3a5323(0x225),async _0x274470=>{const _0x166a6e=_0x3a5323;for(const _0x43c608 of _0x57bb37){const _0x50f632=_0x57bb37[_0x166a6e(0x254)]>0x1?_0x43c608[_0x166a6e(0x24c)]+'\x20v'+(_0x43c608[_0x166a6e(0x17d)]||0x1):_0x43c608[_0x166a6e(0x24c)];_0x274470[_0x166a6e(0x166)]('Fetching\x20'+_0x50f632);const _0x3a6337=await _0x4ff4f7[_0x166a6e(0x223)][_0x166a6e(0x20e)](_0x43c608['id']),_0x1bdd66=_0x3a6337[_0x166a6e(0x1ac)]?.[_0x166a6e(0x1fe)],_0x3a87c4={'resolveSegment':async _0x485b61=>{const _0xa93aba=_0x166a6e;if(!_0x1bdd66)return{'name':_0x485b61,'isJourneyLocal':![]};const _0x1e0c7a=_0x3bbfdd[_0xa93aba(0x1b6)](_0x485b61);if(_0x1e0c7a)return _0x1e0c7a;try{const _0x33af2b=await _0x4ff4f7[_0xa93aba(0x213)][_0xa93aba(0x17a)](_0x1bdd66,_0x485b61),_0x43ca4f=_0x33af2b[_0xa93aba(0x237)]===SEGMENT_KIND_JOURNEY;let _0x2c0be6,_0x2e0984=_0x33af2b['name'];if(_0x43ca4f&&_0x33af2b[_0xa93aba(0x221)]){const _0x5c0b49=await segmentResponseToDef(_0x33af2b,{'resolveSegmentName':async _0x50748d=>{const _0x46c878=_0xa93aba,_0x41bedb=_0x3bbfdd[_0x46c878(0x1b6)](_0x50748d);if(_0x41bedb)return _0x41bedb['name'];const _0x413f75=await _0x3a87c4[_0x46c878(0x1d7)](_0x50748d);return _0x413f75[_0x46c878(0x1bf)];}}),_0x4da827=_0x5c0b49['rule'];_0x2c0be6={'description':_0x33af2b[_0xa93aba(0x16a)],'rule':_0x4da827};const _0xfe48c8=serializeRule(_0x4da827),_0x377cd5=_0x2f240d[_0xa93aba(0x1b6)](_0xfe48c8);if(_0x377cd5)_0x2e0984=_0x377cd5,_0x2c0be6=undefined,_0x5c2a02[_0xa93aba(0x16e)]&&console['error'](_0xa93aba(0x1d5)+_0x33af2b[_0xa93aba(0x1bf)]+_0xa93aba(0x1b7)+_0x377cd5);else{let _0x3f2fe1=![];if(_0x2910fa){const _0x5da588=_0x2910fa[_0xa93aba(0x1b6)](_0xfe48c8);if(_0x5da588){const _0x2bf68f=_0x5da588[_0xa93aba(0x224)](_0x152316=>!_0x5656d7['has'](_0x152316));_0x2bf68f&&(_0x2e0984=_0x2bf68f,_0x5656d7[_0xa93aba(0x170)](_0x2bf68f),_0x2f240d[_0xa93aba(0x1e4)](_0xfe48c8,_0x2bf68f),_0x3f2fe1=!![],_0x5c2a02['verbose']&&console[_0xa93aba(0x19d)](_0xa93aba(0x1b5)+_0x2bf68f+_0xa93aba(0x198)));}}if(!_0x3f2fe1){const _0x4df4d9=generateJourneyLocalName(_0x33af2b['name']);_0x4df4d9&&(_0x2e0984=_0x4df4d9);let _0x35c33c=_0x2e0984,_0x12f8a3=0x2;while(_0x5656d7[_0xa93aba(0x16b)](_0x35c33c)){_0x35c33c=_0x2e0984+'_'+_0x12f8a3,_0x12f8a3++;}_0x5656d7[_0xa93aba(0x170)](_0x35c33c),_0x2f240d[_0xa93aba(0x1e4)](_0xfe48c8,_0x35c33c),_0x2e0984=_0x35c33c;}}}const _0x59a8ee={'name':_0x2e0984,'isJourneyLocal':_0x43ca4f,'definition':_0x2c0be6};return _0x3bbfdd[_0xa93aba(0x1e4)](_0x485b61,_0x59a8ee),_0x59a8ee;}catch(_0x4cac1e){return _0x4dcf27['verbose']&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x485b61+':\x20'+_0x4cac1e[_0xa93aba(0x1dc)]),{'name':_0x485b61,'isJourneyLocal':![]};}},'resolveActivation':async _0x569c04=>{const _0xf7df7d=_0x166a6e,_0x29e1d7=_0x32b6eb[_0xf7df7d(0x1b6)](_0x569c04);if(_0x29e1d7)return _0x29e1d7;try{const _0x2adc13=await _0x4ff4f7[_0xf7df7d(0x223)][_0xf7df7d(0x19c)](_0x43c608['id'],_0x569c04),_0x157fd3=journeyActivationStepToYaml(_0x2adc13,_0x4df5b1,_0x53b0aa),_0xb10492=JSON[_0xf7df7d(0x259)]({'name':_0x157fd3[_0xf7df7d(0x1bf)],'connection':_0x157fd3[_0xf7df7d(0x1a1)],'connector_config':_0x157fd3[_0xf7df7d(0x228)]}),_0x48d3ae=_0x45aefc['get'](_0xb10492);if(_0x48d3ae){const _0xddabfe={'name':_0x48d3ae,'isJourneyLocal':!![],'definition':_0x157fd3};return _0x32b6eb[_0xf7df7d(0x1e4)](_0x569c04,_0xddabfe),_0xddabfe;}const _0x35c597=_0x2adc13[_0xf7df7d(0x1ac)][_0xf7df7d(0x243)]['name']||_0x569c04,_0x51afcb=sanitizeYamlKey(_0x35c597)||'activation_'+_0x569c04;let _0x1baf3a=_0x51afcb,_0x2ee62d=0x2;while(_0x1b82bb['has'](_0x1baf3a)){_0x1baf3a=_0x51afcb+'_'+_0x2ee62d,_0x2ee62d++;}_0x1b82bb[_0xf7df7d(0x170)](_0x1baf3a),_0x45aefc[_0xf7df7d(0x1e4)](_0xb10492,_0x1baf3a);const _0x188c65={'name':_0x1baf3a,'isJourneyLocal':!![],'definition':_0x157fd3};return _0x32b6eb[_0xf7df7d(0x1e4)](_0x569c04,_0x188c65),_0x188c65;}catch(_0x42f619){return _0x4dcf27['verbose']&&console[_0xf7df7d(0x19d)](_0xf7df7d(0x25f)+_0x569c04+':\x20'+_0x42f619[_0xf7df7d(0x1dc)]),{'name':_0x569c04,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x43a7c6,_0x60ed2e)=>{const _0x507e9e=_0x166a6e;return resolveJumpTarget(_0x43a7c6,_0x60ed2e,_0x189b1a,_0xc68938=>_0x4ff4f7[_0x507e9e(0x223)][_0x507e9e(0x20e)](_0xc68938));}},_0x22d390=await journeyResponseToDef(_0x3a6337,_0x3a87c4);_0x446184['push']({'item':_0x43c608,'yaml':_0x22d390});}},{'verbose':_0x4dcf27['verbose']});const _0x3699cb=await _0x4ff4f7['journey'][_0x3a5323(0x214)](_0x57bb37[0x0][_0x3a5323(0x1de)]),_0x1ad52c=buildMergedJourneyDef(_0x446184,_0x2910fa,_0x3699cb),_0x5456f7=normalizeJourneyDef(_0x1ad52c,_0x208a59),_0x59a7c0=toYamlString(_0x5456f7),_0x5b6f63=_0x30bfed||a27_0x16dbc4['join'](_0x3fbd23,sanitizeFileName(_0x11e483)+_0x3a5323(0x1bc));!_0x30bfed&&_0x369672&&!existsSync(_0x3fbd23)&&mkdirSync(_0x3fbd23,{'recursive':!![]});const _0x577e87=a27_0x16dbc4[_0x3a5323(0x1b0)](process[_0x3a5323(0x194)](),_0x5b6f63);if(existsSync(_0x5b6f63)){const _0x3ad3f5=readFileSync(_0x5b6f63,_0x3a5323(0x1c3)),_0x4028ca=generateDiff(_0x3ad3f5,_0x59a7c0),_0x23e785=hasChanges(_0x4028ca);_0x5ca0bc[_0x3a5323(0x215)]({'relativePath':_0x577e87,'absolutePath':_0x5b6f63,'content':_0x59a7c0,'isNew':![],'hasChanges':_0x23e785,'diff':_0x23e785?formatDiffWithColors(_0x4028ca):undefined});}else _0x5ca0bc['push']({'relativePath':_0x577e87,'absolutePath':_0x5b6f63,'content':_0x59a7c0,'isNew':!![],'hasChanges':![]});}const _0x1e8511=_0x5ca0bc['filter'](_0x2fa122=>_0x2fa122['isNew']),_0x9f5c4d=_0x5ca0bc['filter'](_0x12b478=>!_0x12b478['isNew']&&_0x12b478[_0x3a5323(0x22d)]),_0x181202=_0x5ca0bc['filter'](_0x5751a4=>!_0x5751a4['isNew']&&!_0x5751a4[_0x3a5323(0x22d)]),_0x1efe51=_0x2f2ac1[_0x3a5323(0x254)],_0x2cc7a7=_0x4e20ab['size'],_0x12f5b8=_0x1efe51>_0x2cc7a7?'\x20('+_0x1efe51+'\x20versions)':'';console['error'](_0x3a5323(0x175)),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880[_0x3a5323(0x1af)](_0x2cc7a7+'\x20journeys')+a27_0x43c880[_0x3a5323(0x226)](_0x12f5b8)),console['error']('\x20\x20'+a27_0x43c880[_0x3a5323(0x21d)]('+\x20'+_0x1e8511[_0x3a5323(0x254)]+_0x3a5323(0x188))),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880['yellow']('~\x20'+_0x9f5c4d[_0x3a5323(0x254)]+'\x20changed\x20files')),console[_0x3a5323(0x19d)]('\x20\x20'+a27_0x43c880[_0x3a5323(0x226)]('=\x20'+_0x181202['length']+'\x20unchanged\x20files')),console[_0x3a5323(0x19d)](_0x3a5323(0x1d0)+a27_0x43c880['cyan'](_0x196322)+'\x0a');if(_0x9f5c4d[_0x3a5323(0x254)]>0x0)for(const _0x35c42b of _0x9f5c4d){console[_0x3a5323(0x19d)](_0x3a5323(0x24a)+_0x35c42b[_0x3a5323(0x161)]+'\x27:'),console[_0x3a5323(0x19d)]('─'[_0x3a5323(0x249)](0x3c)),console['error'](_0x35c42b['diff']),console['error']('─'[_0x3a5323(0x249)](0x3c));}if(_0x5c2a02[_0x3a5323(0x162)])return console['error'](a27_0x43c880[_0x3a5323(0x208)](_0x3a5323(0x1f0))),0x0;if(_0x1e8511[_0x3a5323(0x254)]===0x0&&_0x9f5c4d[_0x3a5323(0x254)]===0x0)return console['error'](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x260))),saveSessionContext({'parent_segment':_0x1e77f6},_0x5c2a02[_0x3a5323(0x16d)]),console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x186)+a27_0x43c880[_0x3a5323(0x226)]('parent_segment')+_0x3a5323(0x22a)+a27_0x43c880[_0x3a5323(0x1af)](_0x1e77f6))),0x0;if(!_0x5c2a02['yes']&&(_0x1e8511[_0x3a5323(0x254)]>0x0||_0x9f5c4d[_0x3a5323(0x254)]>0x0)){if(!isInteractive())return console[_0x3a5323(0x19d)](a27_0x43c880[_0x3a5323(0x1c2)](_0x3a5323(0x1ce)),_0x3a5323(0x1d9)),console['error'](a27_0x43c880['dim'](_0x3a5323(0x17b))),0x1;const _0x3f77a1=await confirmKey('Write\x20'+(_0x1e8511[_0x3a5323(0x254)]+_0x9f5c4d['length'])+_0x3a5323(0x206));if(!_0x3f77a1)return console['error'](a27_0x43c880[_0x3a5323(0x208)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x196322)&&mkdirSync(_0x196322,{'recursive':!![]});const _0x21dbd0=a27_0x16dbc4['join'](_0x196322,_0x3a5323(0x1b9));writeFileSync(_0x21dbd0,createTdxConfigContent(_0x1e77f6),_0x3a5323(0x1c3));for(const _0x3ece4b of _0x5ca0bc){(_0x3ece4b[_0x3a5323(0x1da)]||_0x3ece4b[_0x3a5323(0x22d)])&&writeFileSync(_0x3ece4b['absolutePath'],_0x3ece4b[_0x3a5323(0x1df)],_0x3a5323(0x1c3));}return console['error'](a27_0x43c880['green'](_0x3a5323(0x241)+(_0x1e8511[_0x3a5323(0x254)]+_0x9f5c4d[_0x3a5323(0x254)])+'\x20journey\x20files\x20to\x20'+_0x196322)),saveSessionContext({'parent_segment':_0x1e77f6},_0x5c2a02[_0x3a5323(0x16d)]),console['error'](a27_0x43c880[_0x3a5323(0x21d)](_0x3a5323(0x186)+a27_0x43c880[_0x3a5323(0x226)](_0x3a5323(0x235))+_0x3a5323(0x22a)+a27_0x43c880['cyan'](_0x1e77f6))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:columns';[a27_0x23db74(0x16a)]=a27_0x23db74(0x244);async[a27_0x23db74(0x1a5)](_0x2ff58e){const _0x4d1119=a27_0x23db74,{options:_0x3f4a28,args:_0x565369,tdx:_0x479988}=_0x2ff58e,_0x33df66=_0x565369[0x0];if(!requireNameOrPath(_0x33df66))return 0x1;_0x3f4a28[_0x4d1119(0x16e)]&&console[_0x4d1119(0x19d)]('Input:\x20'+_0x33df66);const {journeyId:_0x422ee2}=await resolveJourneyIdFromInput(_0x33df66,_0x3f4a28,_0x479988),_0x4d8800=await withSpinner(_0x4d1119(0x23d),()=>_0x479988[_0x4d1119(0x223)][_0x4d1119(0x23c)](_0x422ee2),{'verbose':_0x3f4a28[_0x4d1119(0x16e)]}),_0x1b1157=_0x4d8800[_0x4d1119(0x1ea)];return console['log'](_0x4d1119(0x230)+_0x1b1157['database']),console[_0x4d1119(0x1ef)](_0x4d1119(0x242)+_0x1b1157[_0x4d1119(0x20c)]),await handleSDKOutput(_0x1b1157['columns'],_0x3f4a28),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:activations';[a27_0x23db74(0x16a)]=a27_0x23db74(0x182);async[a27_0x23db74(0x1a5)](_0x192c1b){const _0x39311f=a27_0x23db74,{options:_0x468a97,args:_0x572053,tdx:_0x3defe1}=_0x192c1b,_0x200c56=_0x572053[0x0];if(!requireNameOrPath(_0x200c56))return 0x1;_0x468a97[_0x39311f(0x16e)]&&console[_0x39311f(0x19d)](_0x39311f(0x1f2)+_0x200c56);const {journeyId:_0x411b07}=await resolveJourneyIdFromInput(_0x200c56,_0x468a97,_0x3defe1),_0x4f2f7d=await withSpinner(_0x39311f(0x220),()=>_0x3defe1['journey'][_0x39311f(0x19e)](_0x411b07),{'verbose':_0x468a97[_0x39311f(0x16e)]}),_0x39cef4=_0x4f2f7d[_0x39311f(0x1ea)];return console[_0x39311f(0x19d)]('Found\x20'+_0x39cef4[_0x39311f(0x254)]+'\x20activation'+(_0x39cef4['length']!==0x1?'s':'')),await handleSDKOutput(_0x39cef4,_0x468a97),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x23db74(0x1bf)]=a27_0x23db74(0x22c);[a27_0x23db74(0x16a)]=a27_0x23db74(0x1d3);[a27_0x23db74(0x185)]=new SegmentPushCommand();async[a27_0x23db74(0x1a5)](_0x1cfa0a){const _0xd9cef8=a27_0x23db74,_0x3022d3=_0x1cfa0a[_0xd9cef8(0x1f6)][0x0];let _0x12c09b;if(_0x3022d3){const _0x597c4d=await resolveTarget({'arg':_0x3022d3,'contextParent':_0x1cfa0a[_0xd9cef8(0x1e0)]['parentSegment'],'cwd':process[_0xd9cef8(0x194)]()});isSuccessfulResolution(_0x597c4d)&&_0x597c4d[_0xd9cef8(0x248)]===_0xd9cef8(0x1c5)&&(_0x12c09b=_0x597c4d[_0xd9cef8(0x167)]);}const _0x142913={..._0x1cfa0a,'options':{..._0x1cfa0a[_0xd9cef8(0x1e0)],'journeysOnly':!![],..._0x12c09b&&{'singleFilePath':_0x12c09b}}};return this[_0xd9cef8(0x185)][_0xd9cef8(0x1a5)](_0x142913);}}export class JourneyVersionsCommand extends BaseCommand{['name']='journey:versions';['description']=a27_0x23db74(0x25d);async['execute'](_0x412530){const _0x20a87c=a27_0x23db74,{options:_0x376f5f,args:_0x5d807e,tdx:_0x58e5f7}=_0x412530,_0x143b78=_0x5d807e[0x0];if(!requireNameOrPath(_0x143b78))return 0x1;if(_0x376f5f[_0x20a87c(0x16e)])console[_0x20a87c(0x19d)](_0x20a87c(0x1f2)+_0x143b78);const {journeyId:_0x30a23e}=await resolveJourneyIdFromInput(_0x143b78,_0x376f5f,_0x58e5f7),_0x2d9a6b=await withSpinner(_0x20a87c(0x1f5),()=>_0x58e5f7['journey']['listVersions'](_0x30a23e),{'verbose':_0x376f5f[_0x20a87c(0x16e)]}),{bundleName:_0x2534f4,versions:_0xbcbe2a,latestJourneyId:_0x458026}=_0x2d9a6b[_0x20a87c(0x1ea)];console['error'](_0x2534f4+':\x20'+_0xbcbe2a[_0x20a87c(0x254)]+'\x20version'+(_0xbcbe2a[_0x20a87c(0x254)]!==0x1?'s':''));const _0x24f38b=_0xbcbe2a[_0x20a87c(0x23a)](_0x4caffc=>({'version':_0x4caffc[_0x20a87c(0x17d)],'journey_id':_0x4caffc['journeyId'],'name':_0x4caffc[_0x20a87c(0x1bf)],'state':_0x4caffc[_0x20a87c(0x191)],'paused':_0x4caffc[_0x20a87c(0x1b4)],'latest':_0x4caffc[_0x20a87c(0x1b8)]===_0x458026,'created_at':_0x4caffc[_0x20a87c(0x247)]}));return await handleSDKOutput(_0x24f38b,_0x376f5f),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0x23db74(0x18a);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a27_0x23db74(0x1a5)](_0x5468ee){const _0x24e72e=a27_0x23db74,{options:_0x440af1,args:_0x3f2c77,tdx:_0x508fd7}=_0x5468ee,_0x44f8da=_0x3f2c77[0x0];if(!requireNameOrPath(_0x44f8da))return 0x1;if(_0x440af1[_0x24e72e(0x16e)])console[_0x24e72e(0x19d)]('Input:\x20'+_0x44f8da);const {journeyId:_0x2debe2,journeyName:_0x440a1e}=await resolveJourneyIdFromInput(_0x44f8da,_0x440af1,_0x508fd7);if(!_0x440af1[_0x24e72e(0x197)]){const _0xa24885=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x440a1e+'\x22?');if(!_0xa24885)return console['error']('Cancelled'),0x0;}const _0x17a648=await withSpinner(_0x24e72e(0x23b),()=>_0x508fd7[_0x24e72e(0x223)][_0x24e72e(0x25c)](_0x2debe2),{'verbose':_0x440af1[_0x24e72e(0x16e)]}),_0x39a8ec=_0x17a648[_0x24e72e(0x1ea)];return console[_0x24e72e(0x19d)](a27_0x43c880[_0x24e72e(0x21d)]('✔')+'\x20Created\x20v'+_0x39a8ec[_0x24e72e(0x1ac)][_0x24e72e(0x17d)]+_0x24e72e(0x20d)+_0x39a8ec['attributes'][_0x24e72e(0x1bf)]+'\x22'),console['error'](_0x24e72e(0x190)+_0x39a8ec['id']),await handleSingleObjectOutput({'id':_0x39a8ec['id'],'name':_0x39a8ec[_0x24e72e(0x1ac)]['name'],'version':_0x39a8ec['attributes'][_0x24e72e(0x17d)],'state':_0x39a8ec[_0x24e72e(0x1ac)][_0x24e72e(0x191)],'bundle_id':_0x39a8ec['attributes'][_0x24e72e(0x1de)],'created_at':_0x39a8ec['attributes']['createdAt']},_0x440af1),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x23db74(0x1bf)]='journey:version:view';[a27_0x23db74(0x16a)]=a27_0x23db74(0x1cd);async[a27_0x23db74(0x1a5)](_0x32c75d){const _0x20e53c=a27_0x23db74,{options:_0xc7ae11,args:_0x304037,tdx:_0x716385}=_0x32c75d,_0x825901=_0x304037[0x0];if(!requireNameOrPath(_0x825901))return 0x1;const _0x5b8637=_0xc7ae11['version'];if(!_0x5b8637)return console[_0x20e53c(0x19d)](_0x20e53c(0x17c)),console[_0x20e53c(0x19d)](_0x20e53c(0x189)),0x1;const _0x2b9a12=parseInt(_0x5b8637,0xa);if(isNaN(_0x2b9a12)||_0x2b9a12<0x1)return console[_0x20e53c(0x19d)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x5b8637),0x1;if(_0xc7ae11[_0x20e53c(0x16e)])console['error'](_0x20e53c(0x1f2)+_0x825901+_0x20e53c(0x183)+_0x2b9a12);const {journeyId:_0x557608,parentSegmentId:_0x20552f}=await resolveJourneyIdFromInput(_0x825901,_0xc7ae11,_0x716385),_0x567ab8=await withSpinner('Resolving\x20version...',()=>_0x716385['journey']['listVersions'](_0x557608),{'verbose':_0xc7ae11[_0x20e53c(0x16e)]}),{versions:_0x12f6af,latestJourneyId:_0x266ca5}=_0x567ab8[_0x20e53c(0x1ea)],_0x5387da=_0x12f6af[_0x20e53c(0x224)](_0x170fdb=>_0x170fdb['versionNumber']===_0x2b9a12);if(!_0x5387da){const _0x214af7=_0x12f6af['map'](_0x4892db=>'v'+_0x4892db[_0x20e53c(0x17d)])['join'](',\x20');return console[_0x20e53c(0x19d)](_0x20e53c(0x1a6)+_0x2b9a12+_0x20e53c(0x232)+_0x214af7),0x1;}const _0x24dd3a=await withSpinner(_0x20e53c(0x169)+_0x2b9a12+_0x20e53c(0x229),()=>_0x716385['journey'][_0x20e53c(0x20e)](_0x5387da['journeyId']),{'verbose':_0xc7ae11['verbose']}),_0x4d938e=_0x24dd3a[_0x20e53c(0x1ea)],_0x16cd35=getConsoleNextUrl(_0xc7ae11[_0x20e53c(0x1c4)],_0x20e53c(0x23f)+_0x20552f+_0x20e53c(0x181)+_0x5387da[_0x20e53c(0x1b8)]+_0x20e53c(0x180));return await handleSingleObjectOutput({'id':_0x4d938e['id'],'name':_0x4d938e[_0x20e53c(0x1ac)]['name'],'version':_0x4d938e[_0x20e53c(0x1ac)]['versionNumber'],'description':_0x4d938e[_0x20e53c(0x1ac)]['description'],'state':_0x4d938e[_0x20e53c(0x1ac)]['state'],'paused':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x1b4)],'reentry_mode':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x184)],'stages':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x1ba)]?.['length']||0x0,..._0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x165)]&&{'goal':_0x4d938e[_0x20e53c(0x1ac)]['goal'][_0x20e53c(0x1bf)]},'latest':_0x5387da[_0x20e53c(0x1b8)]===_0x266ca5,'created_at':_0x4d938e[_0x20e53c(0x1ac)][_0x20e53c(0x247)],'updated_at':_0x4d938e['attributes'][_0x20e53c(0x1ed)],'url':_0x16cd35},_0xc7ae11),0x0;}}
|
|
1
|
+
function a27_0x4e43(_0x30ce73,_0x137753){_0x30ce73=_0x30ce73-0x162;const _0x419e9e=a27_0x419e();let _0x4e43de=_0x419e9e[_0x30ce73];return _0x4e43de;}const a27_0x34329f=a27_0x4e43;(function(_0x585711,_0x1ce9d5){const _0x30a9f9=a27_0x4e43,_0x45913e=_0x585711();while(!![]){try{const _0x223e26=parseInt(_0x30a9f9(0x18c))/0x1+parseInt(_0x30a9f9(0x191))/0x2*(-parseInt(_0x30a9f9(0x25a))/0x3)+parseInt(_0x30a9f9(0x1f1))/0x4+parseInt(_0x30a9f9(0x1f7))/0x5*(parseInt(_0x30a9f9(0x1a5))/0x6)+-parseInt(_0x30a9f9(0x16f))/0x7+-parseInt(_0x30a9f9(0x168))/0x8+parseInt(_0x30a9f9(0x232))/0x9;if(_0x223e26===_0x1ce9d5)break;else _0x45913e['push'](_0x45913e['shift']());}catch(_0x2eb806){_0x45913e['push'](_0x45913e['shift']());}}}(a27_0x419e,0xebe3e));import a27_0x119cbe from'chalk';import a27_0x46fb71 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';function a27_0x419e(){const _0x4afd89=['green','yes','message','Folder\x20path:\x20','jsonl','audienceId','createVersion','file','filePath','stage','join','Fetching\x20users\x20and\x20connections...','resourceName','folderId','connector_config','\x20journey','Resume\x20a\x20paused\x20journey','Show\x20journey\x20statistics','1857786oEgtir','parentName','Pattern:\x20','goal','Pausing\x20journey...','renderStats','completionRate','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','split','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','versionNumber','Getting\x20version\x20','INVALID_ARGUMENT','✔\x20Journey\x20\x22','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','push','launched','conversion','journeyName','getTrafficData','web','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','/app/ps/','test','\x20Opening\x20','getActivation','listJourneysWithFolders','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Found\x20','-\x20no\x20files\x20written','journey:list','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Resolved\x20YAML\x20file:\x20','journey','Show\x20journey\x20table\x20column\x20mapping','log','journey:version:create','activation_','List\x20activations\x20for\x20a\x20journey','options','milestoneSize','format','kind','Input:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','(paused)','\x20\x20Statistics\x20not\x20available','journeyBundleId','\x20\x20Target:\x20','helpText','(running)','✔\x20Pulled\x20','No\x20statistics\x20available\x20for\x20journey:\x20','\x20=\x20','(root)','Getting\x20journey\x20traffic\x20data...','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20activation','Aborted.','bold','getJourney','hasChanges','data','exitOrJumpRate','Listing\x20journey\x20activations...','cyan','\x20journeys','nodes','/j/da/je','includeHistory','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20details...','content','\x20\x20Name:\x20','262844YlVUBI','Database:\x20','Error:\x20--version\x20option\x20is\x20required','version','activation','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','25zAXhdw','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','cwd','entries','toLowerCase','journey:view','archived','folderPath','Fetching\x20parent\x20segment...','then','Resuming\x20journey...','parentSegment','\x20Created\x20v','buildIdToNameMap','add','updatedAt','📁\x20','description','Getting\x20column\x20mapping...','Parent\x20segment:\x20','journeyId','journey:stats','utf-8','\x22\x20not\x20found','Warning:\x20Could\x20not\x20resolve\x20activation\x20','listJourneysFromParentSegment','isNew','Write\x20','verbose','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Fetching\x20','goalSize','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journey:versions','\x20not\x20found.\x20Available:\x20','size','\x22\x20resumed','\x20\x20Journey\x20ID:\x20','history','getSegment','Warning:\x20Could\x20not\x20resolve\x20segment\x20','limit','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Listing\x20journey\x20versions...','errorCode','buildIdToEmailMap','\x20(draft)\x20—\x20\x22','\x20unchanged\x20files','\x20\x20Parent\x20segment:\x20','Resolving\x20version...','Error:\x20Journey\x20not\x20found:\x20','table','enteredSize','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','state','resolveJourneyId','resume','args','\x20versions)','21441348IAUKXa','✔\x20Found\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','dim','execute','red','map','stringify','folders','includeStats','relativePath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','🗺️\x20','localeCompare','\x20(ID:\x20','...','pause','(completed)','\x0aPull\x20summary:','✔\x20Context\x20set:\x20','find','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','filter','journeyBundleName','segmentPushCommand','reentryMode','replace','attributes','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','tdx.json','blue','\x20\x20-\x20','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x0aChanges\x20to\x20\x27','draft','repeat','segment','\x20\x20Preserving\x20local\x20segment\x20name:\x20','json','1792059mKQUFH','site','activationParams','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','get','completeMilestoneRate','values','parent_segment','Journey\x20name:\x20','journey:push','listActivationsFlat','journey:traffic','connection','journey:version:view','\x22\x20paused','journey:activations','createdAt','journey:columns','has','yellow','error','length','\x27\x20not\x20found\x20in\x20','/e/','Show\x20journey\x20details','Getting\x20journey\x20details...','sort','Error:\x20','from','segmentName','Error:\x20Parent\x20segment\x20context\x20required','.yml','14900184YcdqKg','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journeyStages','Available\x20stages:\x20','resolveParentId','\x20journey\x20files\x20to\x20','set','11228756HIAqMj','hasPeriod','(archived)','Resolving\x20journey...','Resolving\x20parent\x20segment...','exitOrJumpSize','journey:pull','Error:\x20Stage\x20\x22','listVersions','\x5c$&','name','Target\x20file:\x20','Creating\x20new\x20version...','session','Cancelled','columns','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','✔\x20All\x20files\x20are\x20up\x20to\x20date','completed','Export\x20journey(s)\x20as\x20YAML\x20files','getLatestJourneyId','\x20files?','type','\x20->\x20','stages','\x20(rule\x20match)','\x20changed\x20files','rule','List\x20journeys\x20in\x20current\x20context','1631305cxpGAz','Target\x20directory:\x20',',\x20version:\x20','all','paused','4vmEYrE','Getting\x20journey\x20statistics...'];a27_0x419e=function(){return _0x4afd89;};return a27_0x419e();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x35e475){const _0xf9cf23=a27_0x4e43;return!_0x35e475&&(console[_0xf9cf23(0x26e)](_0xf9cf23(0x1b4)),console[_0xf9cf23(0x26e)](_0xf9cf23(0x252))),!!_0x35e475;}function withJsonFormat(_0x14702f){const _0x24a2c6=a27_0x4e43;if(!_0x14702f[_0x24a2c6(0x1d0)]&&!_0x14702f[_0x24a2c6(0x259)]&&!_0x14702f[_0x24a2c6(0x197)]&&!_0x14702f['tsv'])return{..._0x14702f,'format':_0x24a2c6(0x259),'json':!![]};return _0x14702f;}function formatJourneyState(_0x31eec4){const _0x5eb688=a27_0x4e43;switch(_0x31eec4){case _0x5eb688(0x1b7):return a27_0x119cbe[_0x5eb688(0x193)](_0x5eb688(0x1d9));case _0x5eb688(0x255):return a27_0x119cbe[_0x5eb688(0x235)]('(draft)');case _0x5eb688(0x190):return a27_0x119cbe[_0x5eb688(0x26d)](_0x5eb688(0x1d4));case _0x5eb688(0x181):return a27_0x119cbe[_0x5eb688(0x250)](_0x5eb688(0x243));case _0x5eb688(0x1fd):return a27_0x119cbe[_0x5eb688(0x235)](_0x5eb688(0x171));default:return'('+_0x31eec4+')';}}function formatJourneyItem(_0xc5a1dd,_0x1ca2b1='',_0x2034bc){const _0x2a4c97=a27_0x4e43,_0x452f16=formatJourneyState(_0xc5a1dd[_0x2a4c97(0x22d)]),_0x4e51db=_0x2034bc?hyperlink(_0xc5a1dd[_0x2a4c97(0x249)],_0x2034bc):_0xc5a1dd[_0x2a4c97(0x249)];return _0x1ca2b1+_0x2a4c97(0x23e)+_0x4e51db+'\x20'+_0x452f16;}function escapeRegex(_0x3e8f8a){const _0x4c02cb=a27_0x4e43;return _0x3e8f8a[_0x4c02cb(0x24c)](/[.*+?^${}()|[\]\\]/g,_0x4c02cb(0x178));}function globToRegex(_0x1fcd1d){const _0x3a5afc=a27_0x4e43,_0x1c9cce=_0x1fcd1d[_0x3a5afc(0x1ae)]('*')['map'](escapeRegex);return new RegExp(_0x1c9cce[_0x3a5afc(0x19d)]('.*'),'i');}function buildRuleToNameMapping(_0x40dc12){const _0x2d8b90=a27_0x4e43,_0x1649e8=new Map();if(_0x40dc12['segments'])for(const [_0x26a8f9,_0x2f2c18]of Object[_0x2d8b90(0x1fa)](_0x40dc12['segments'])){if(_0x2f2c18[_0x2d8b90(0x18a)]){const _0x78ede3=serializeRule(_0x2f2c18[_0x2d8b90(0x18a)]),_0x227d4c=_0x1649e8[_0x2d8b90(0x25e)](_0x78ede3);_0x227d4c?_0x227d4c[_0x2d8b90(0x1b6)](_0x26a8f9):_0x1649e8[_0x2d8b90(0x16e)](_0x78ede3,[_0x26a8f9]);}}return _0x1649e8;}async function resolveJourneyIdFromInput(_0x26e197,_0x5c0b4b,_0x31f0ce){const _0x187135=a27_0x4e43,_0x1f1b4e=await resolveJourneyTarget(_0x26e197,_0x5c0b4b[_0x187135(0x202)],_0x5c0b4b[_0x187135(0x213)]),_0x43af25=_0x1f1b4e[_0x187135(0x202)];if(!_0x43af25)throw new SDKError(ErrorCode[_0x187135(0x1b2)],_0x187135(0x17f));const _0x2342f8=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x31f0ce[_0x187135(0x257)]['resolveParentId'](_0x43af25),{'verbose':_0x5c0b4b[_0x187135(0x213)]}),_0x490530=_0x2342f8[_0x187135(0x1e5)],_0x31d8c5=await withSpinner(_0x187135(0x172),()=>_0x31f0ce[_0x187135(0x1c8)][_0x187135(0x22e)](_0x490530,_0x1f1b4e[_0x187135(0x1b9)]),{'verbose':_0x5c0b4b[_0x187135(0x213)]});return{'journeyId':_0x31d8c5[_0x187135(0x1e5)],'journeyName':_0x1f1b4e['journeyName'],'parentSegmentId':_0x490530};}async function resolveJourneyTarget(_0x4bfd9,_0x2d0177,_0x10ade8){const _0xed317a=a27_0x4e43;if(isYamlFilePath(_0x4bfd9))try{const _0x4f2ed3=await resolveYamlFilePath(_0x4bfd9);return _0x10ade8&&(console[_0xed317a(0x26e)](_0xed317a(0x1c7)+_0x4bfd9),console[_0xed317a(0x26e)](_0xed317a(0x227)+_0x4f2ed3[_0xed317a(0x202)]),console[_0xed317a(0x26e)](_0xed317a(0x1f0)+_0x4f2ed3[_0xed317a(0x165)]),console[_0xed317a(0x26e)]('\x20\x20Folder\x20path:\x20'+(_0x4f2ed3[_0xed317a(0x1fe)]||_0xed317a(0x1dd)))),{'journeyName':_0x4f2ed3[_0xed317a(0x165)],'parentSegment':_0x4f2ed3[_0xed317a(0x202)],'resolved':_0x4f2ed3};}catch(_0x258c41){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xed317a(0x1b5)+_0x258c41['message']);}if(!_0x2d0177)throw new SDKError(ErrorCode[_0xed317a(0x1b2)],_0xed317a(0x24e));return{'journeyName':_0x4bfd9,'parentSegment':_0x2d0177};}export class JourneyListCommand extends BaseCommand{[a27_0x34329f(0x179)]=a27_0x34329f(0x1c5);[a27_0x34329f(0x208)]=a27_0x34329f(0x18b);async['execute'](_0x580e7c){const _0x1d096e=a27_0x34329f,{options:_0x2fbe48,args:_0x704668,tdx:_0x3b4e9e}=_0x580e7c,_0x1b0ce8=_0x704668[0x0],_0x3c2756=_0x2fbe48[_0x1d096e(0x202)];if(!_0x3c2756)return console[_0x1d096e(0x26e)](_0x1d096e(0x166)),console['error']('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x39cdf2=await withSpinner(_0x1d096e(0x173),()=>_0x3b4e9e[_0x1d096e(0x257)][_0x1d096e(0x16c)](_0x3c2756),{'verbose':_0x2fbe48['verbose']}),_0x4ceab1=_0x39cdf2['data'];_0x2fbe48['verbose']&&(console[_0x1d096e(0x26e)]('Parent\x20segment:\x20'+_0x3c2756+_0x1d096e(0x240)+_0x4ceab1+')'),_0x1b0ce8&&console['error'](_0x1d096e(0x1a7)+_0x1b0ce8));const _0x1a6c2a=await withSpinner(_0x1d096e(0x1ff),()=>_0x3b4e9e[_0x1d096e(0x257)]['getParentFull'](_0x4ceab1),{'verbose':_0x2fbe48[_0x1d096e(0x213)]}),_0x791b16=_0x1a6c2a[_0x1d096e(0x1e5)],_0x560bf=_0x791b16['rootFolderId'],_0x5596e1=await withSpinner('Listing\x20journeys...',()=>_0x3b4e9e[_0x1d096e(0x1c8)][_0x1d096e(0x1c1)](_0x4ceab1,_0x560bf),{'verbose':_0x2fbe48[_0x1d096e(0x213)]});let _0x44cfe7=_0x5596e1['data']['journeys'];const _0x5cfca9=_0x5596e1[_0x1d096e(0x1e5)][_0x1d096e(0x23a)],_0x22090f=new Map();for(const _0xf2dc80 of _0x5cfca9){_0x22090f[_0x1d096e(0x16e)](_0xf2dc80['id'],_0xf2dc80['name']);}if(_0x1b0ce8){const _0x452ff9=globToRegex(_0x1b0ce8);_0x44cfe7=_0x44cfe7[_0x1d096e(0x248)](_0x4101a=>_0x452ff9[_0x1d096e(0x1be)](_0x4101a[_0x1d096e(0x249)]));}console['error'](_0x1d096e(0x233)+_0x44cfe7['length']+_0x1d096e(0x1a2)+(_0x44cfe7[_0x1d096e(0x26f)]!==0x1?'s':''));const _0x608190=_0x180ea1=>{const _0x4b19cf=_0x1d096e;return getConsoleNextUrl(_0x2fbe48[_0x4b19cf(0x25b)],_0x4b19cf(0x1bd)+_0x4ceab1+_0x4b19cf(0x271)+_0x180ea1+'/j/da');};if(_0x2fbe48[_0x1d096e(0x1d0)]==='table')await handleSDKOutput(_0x44cfe7,_0x2fbe48);else{if(_0x2fbe48[_0x1d096e(0x1d0)]===_0x1d096e(0x259)){const _0x3fa462=_0x44cfe7[_0x1d096e(0x238)](_0x5cb685=>({..._0x5cb685,'url':_0x608190(_0x5cb685['id'])}));await handleSDKOutput(_0x3fa462,_0x2fbe48);}else{console['log']('['+_0x3c2756+']');const _0xd5a8f1=new Map(),_0x35ccd5=[];for(const _0xb92b3e of _0x44cfe7){if(!_0xb92b3e[_0x1d096e(0x1a0)]||_0xb92b3e[_0x1d096e(0x1a0)]===_0x560bf)_0x35ccd5[_0x1d096e(0x1b6)](_0xb92b3e);else{const _0x3c1d76=_0xd5a8f1[_0x1d096e(0x25e)](_0xb92b3e[_0x1d096e(0x1a0)])||[];_0x3c1d76[_0x1d096e(0x1b6)](_0xb92b3e),_0xd5a8f1[_0x1d096e(0x16e)](_0xb92b3e[_0x1d096e(0x1a0)],_0x3c1d76);}}const _0x517fef=(_0x6bcc32,_0x3595b0)=>_0x6bcc32[_0x1d096e(0x249)][_0x1d096e(0x23f)](_0x3595b0['journeyBundleName'],undefined,{'sensitivity':'base'});_0x35ccd5[_0x1d096e(0x162)](_0x517fef);for(const _0x3174eb of _0x35ccd5){console[_0x1d096e(0x1ca)](formatJourneyItem(_0x3174eb,'',_0x608190(_0x3174eb['id'])));}const _0x526e8d=[..._0xd5a8f1['entries']()][_0x1d096e(0x162)]((_0xe7a16b,_0x234f13)=>{const _0x3b2648=_0x1d096e,_0x577fca=_0x22090f[_0x3b2648(0x25e)](_0xe7a16b[0x0])||_0xe7a16b[0x0],_0xbeae13=_0x22090f[_0x3b2648(0x25e)](_0x234f13[0x0])||_0x234f13[0x0];return _0x577fca[_0x3b2648(0x23f)](_0xbeae13,undefined,{'sensitivity':'base'});});for(const [_0x5887e5,_0x4863e6]of _0x526e8d){const _0x212839=_0x22090f['get'](_0x5887e5)||_0x5887e5;console[_0x1d096e(0x1ca)](_0x1d096e(0x207)+_0x212839),_0x4863e6[_0x1d096e(0x162)](_0x517fef);for(const _0x35740a of _0x4863e6){console[_0x1d096e(0x1ca)](formatJourneyItem(_0x35740a,'\x20\x20',_0x608190(_0x35740a['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x34329f(0x179)]=a27_0x34329f(0x1fc);['description']=a27_0x34329f(0x272);async[a27_0x34329f(0x236)](_0x1365aa){const _0x42ade1=a27_0x34329f,{options:_0x551c20,args:_0x7ea813,tdx:_0x4930e3}=_0x1365aa,_0x4df5e0=_0x7ea813[0x0];if(!_0x4df5e0)return console[_0x42ade1(0x26e)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x42ade1(0x26e)](_0x42ade1(0x1f6)),console['error']('Options:'),console['error'](_0x42ade1(0x1df)),0x1;_0x551c20[_0x42ade1(0x213)]&&console[_0x42ade1(0x26e)](_0x42ade1(0x1d2)+_0x4df5e0);const {journeyId:_0x94b595,parentSegmentId:_0x52bc20}=await resolveJourneyIdFromInput(_0x4df5e0,_0x551c20,_0x4930e3);if(_0x551c20[_0x42ade1(0x1bb)]){const _0x2808a9=getConsoleNextUrl(_0x551c20[_0x42ade1(0x25b)],_0x42ade1(0x1bd)+_0x52bc20+_0x42ade1(0x271)+_0x94b595+_0x42ade1(0x1eb));return console['error'](a27_0x119cbe[_0x42ade1(0x193)]('✔')+_0x42ade1(0x1bf)+a27_0x119cbe[_0x42ade1(0x1e8)](_0x2808a9)),openBrowser(_0x2808a9),0x0;}const _0x4ffd9e=await withSpinner(_0x42ade1(0x273),()=>_0x4930e3[_0x42ade1(0x1c8)][_0x42ade1(0x1e3)](_0x94b595),{'verbose':_0x551c20[_0x42ade1(0x213)]}),_0x1e170d=_0x4ffd9e[_0x42ade1(0x1e5)],_0x43250b=_0x551c20[_0x42ade1(0x23b)];let _0x57cb57;if(_0x43250b)try{const _0x1ea4aa=await withSpinner(_0x42ade1(0x192),()=>_0x4930e3[_0x42ade1(0x1c8)]['getStatistics'](_0x94b595),{'verbose':_0x551c20[_0x42ade1(0x213)]});_0x57cb57=_0x1ea4aa[_0x42ade1(0x1e5)];}catch{_0x551c20[_0x42ade1(0x213)]&&console[_0x42ade1(0x26e)](_0x42ade1(0x1d5));}const _0x15dd35=getConsoleNextUrl(_0x551c20[_0x42ade1(0x25b)],_0x42ade1(0x1bd)+_0x52bc20+_0x42ade1(0x271)+_0x94b595+_0x42ade1(0x1eb)),_0x21e2d3={'id':_0x1e170d['id'],'name':_0x1e170d['attributes'][_0x42ade1(0x179)],'description':_0x1e170d[_0x42ade1(0x24d)][_0x42ade1(0x208)],'state':_0x1e170d[_0x42ade1(0x24d)][_0x42ade1(0x22d)],'paused':_0x1e170d[_0x42ade1(0x24d)][_0x42ade1(0x190)],'reentry_mode':_0x1e170d[_0x42ade1(0x24d)]['reentryMode'],'stages':_0x1e170d[_0x42ade1(0x24d)]['journeyStages']?.['length']||0x0,..._0x1e170d['attributes'][_0x42ade1(0x1a8)]&&{'goal':_0x1e170d['attributes'][_0x42ade1(0x1a8)]['name']},..._0x57cb57&&{'statistics':{'size':_0x57cb57['size'],'entered':_0x57cb57[_0x42ade1(0x22b)],'goal_achieved':_0x57cb57[_0x42ade1(0x216)],'completion_rate':_0x57cb57[_0x42ade1(0x1ab)],'exit_or_jump':_0x57cb57[_0x42ade1(0x174)],'exit_or_jump_rate':_0x57cb57[_0x42ade1(0x1e6)],'stages':_0x57cb57[_0x42ade1(0x187)]}},'url':_0x15dd35};return await handleSingleObjectOutput(_0x21e2d3,_0x551c20),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x34329f(0x20c);[a27_0x34329f(0x208)]=a27_0x34329f(0x1a4);async['execute'](_0x43065f){const _0x47d46f=a27_0x34329f,{options:_0x2169f9,args:_0x2993ef,tdx:_0xd63486}=_0x43065f,_0x1d3105=_0x2993ef[0x0];if(!requireNameOrPath(_0x1d3105))return 0x1;_0x2169f9[_0x47d46f(0x213)]&&console[_0x47d46f(0x26e)](_0x47d46f(0x1d2)+_0x1d3105);const _0x37784c=_0x2169f9,_0x2b73c1=_0x37784c[_0x47d46f(0x164)],_0x5aacac=_0x37784c['to'],_0x252434=_0x37784c[_0x47d46f(0x1ec)],_0x44a856=_0x37784c[_0x47d46f(0x19c)];_0x252434&&!_0x2b73c1&&!_0x5aacac&&console['error'](_0x47d46f(0x25d));const _0x906810=_0x252434?withJsonFormat(_0x2169f9):_0x2169f9,{journeyId:_0x5acd1c,journeyName:_0x53ee03}=await resolveJourneyIdFromInput(_0x1d3105,_0x906810,_0xd63486),_0xa7e89=_0x2b73c1||_0x5aacac?{'from':_0x2b73c1,'to':_0x5aacac}:undefined,_0x2c907e=await withSpinner(_0x47d46f(0x192),()=>Promise[_0x47d46f(0x18f)]([_0xd63486['journey'][_0x47d46f(0x1e3)](_0x5acd1c),_0xd63486[_0x47d46f(0x1c8)]['getStatistics'](_0x5acd1c,_0xa7e89)]),{'verbose':_0x906810[_0x47d46f(0x213)]}),[_0x4dacbe,_0x3857de]=_0x2c907e['data'];if(!_0x3857de||_0x3857de[_0x47d46f(0x20b)]===null)return console[_0x47d46f(0x26e)](_0x47d46f(0x1db)+_0x53ee03),console[_0x47d46f(0x26e)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x1c586f=buildStageNameMap(_0x4dacbe),_0x2d97f9=!!(_0xa7e89&&_0x3857de[_0x47d46f(0x21d)]?.['length']),_0x3ec1c3={'stageNameMap':_0x1c586f,'hasPeriod':_0x2d97f9,'includeHistory':!!_0x252434};if(_0x44a856&&_0x3857de['stages']){const _0x373cd3=_0x3857de[_0x47d46f(0x187)][_0x47d46f(0x246)](_0x4e0195=>{const _0x49fd55=_0x47d46f,_0x37b0e3=_0x1c586f[_0x49fd55(0x25e)](_0x4e0195['id'])??'';return _0x37b0e3['toLowerCase']()===_0x44a856[_0x49fd55(0x1fb)]();});if(_0x373cd3)return await handleSingleObjectOutput(formatStageStats(_0x373cd3,_0x3ec1c3),_0x906810),0x0;const _0x56d12e=_0x3857de[_0x47d46f(0x187)]['map'](_0x17f461=>_0x1c586f[_0x47d46f(0x25e)](_0x17f461['id'])??_0x17f461['id']);return console['error'](_0x47d46f(0x176)+_0x44a856+_0x47d46f(0x20e)),console[_0x47d46f(0x26e)](_0x47d46f(0x16b)+_0x56d12e[_0x47d46f(0x19d)](',\x20')),0x1;}const _0x3a7002=_0x3857de['stages']?.[_0x47d46f(0x238)](_0x26e4bf=>formatStageStats(_0x26e4bf,_0x3ec1c3)),_0x463ca1=assembleJourneyStats(_0x3857de,{'from':_0x2b73c1,'to':_0x5aacac,'includeHistory':_0x252434});return await this[_0x47d46f(0x1aa)](_0x463ca1,_0x3a7002??[],_0x906810),0x0;}async[a27_0x34329f(0x1aa)](_0x131c1b,_0x3d78cd,_0x3fa44d){const _0x38b0e3=a27_0x34329f,_0x34635d=_0x3fa44d['format']===_0x38b0e3(0x259)||_0x3fa44d[_0x38b0e3(0x1d0)]===_0x38b0e3(0x197)||_0x3fa44d['json']||_0x3fa44d[_0x38b0e3(0x197)];if(_0x34635d){_0x131c1b[_0x38b0e3(0x187)]=_0x3d78cd,await handleSingleObjectOutput(_0x131c1b,_0x3fa44d);return;}await handleSingleObjectOutput(_0x131c1b,_0x3fa44d);for(const _0x56a5fe of _0x3d78cd){console[_0x38b0e3(0x1ca)](''),console['log'](String(a27_0x119cbe[_0x38b0e3(0x1e8)][_0x38b0e3(0x1e2)]('['+_0x56a5fe['name']+']'))+a27_0x119cbe[_0x38b0e3(0x235)]('\x20'+_0x56a5fe['id']));const {id:_0x878100,name:_0x38452b,..._0x587871}=_0x56a5fe;await handleSingleObjectOutput(_0x587871,_0x3fa44d);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a27_0x34329f(0x265);[a27_0x34329f(0x208)]=a27_0x34329f(0x1c6);async[a27_0x34329f(0x236)](_0x4583a2){const _0x8fe15d=a27_0x34329f,{options:_0x490b65,args:_0x397f2e,tdx:_0x4cc271}=_0x4583a2,_0x14c79d=_0x397f2e[0x0];if(!requireNameOrPath(_0x14c79d))return 0x1;_0x490b65['verbose']&&console[_0x8fe15d(0x26e)]('Input:\x20'+_0x14c79d);const _0x5d72f9=_0x490b65,_0x3276ce=_0x5d72f9['type'],_0xb7861f=_0x5d72f9[_0x8fe15d(0x164)],_0x1c122e=_0x5d72f9['to'],_0x4d3385=_0x5d72f9[_0x8fe15d(0x220)];if(_0x3276ce&&_0x3276ce!==_0x8fe15d(0x1b8)&&_0x3276ce!=='activation')return console['error']('Error:\x20Invalid\x20--type\x20\x22'+_0x3276ce+_0x8fe15d(0x214)),0x1;const _0x531f61=withJsonFormat(_0x490b65),{journeyId:_0x13062c,journeyName:_0x5e99a7}=await resolveJourneyIdFromInput(_0x14c79d,_0x531f61,_0x4cc271),_0x1faa73={'type':_0x3276ce,'from':_0xb7861f,'to':_0x1c122e,'limit':_0x4d3385},_0x119692=await withSpinner(_0x8fe15d(0x1de),()=>_0x4cc271['journey'][_0x8fe15d(0x1ba)](_0x13062c,_0x1faa73),{'verbose':_0x531f61[_0x8fe15d(0x213)]}),_0xa472a5=_0x119692[_0x8fe15d(0x1e5)],_0x2f595a=_0xa472a5[_0x8fe15d(0x1b8)]&&(_0xa472a5[_0x8fe15d(0x1b8)][_0x8fe15d(0x1ea)]['length']>0x0||_0xa472a5[_0x8fe15d(0x1b8)]['links'][_0x8fe15d(0x26f)]>0x0),_0x4a1b73=_0xa472a5['activation']&&_0xa472a5[_0x8fe15d(0x1f5)]['length']>0x0;if(!_0x2f595a&&!_0x4a1b73)return console[_0x8fe15d(0x26e)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x5e99a7),console[_0x8fe15d(0x26e)](_0x8fe15d(0x1ad)),_0xb7861f&&_0x1c122e&&console[_0x8fe15d(0x26e)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0xa472a5,_0x531f61),0x0;}}function formatStageStats(_0x264efd,_0x16d4bc){const _0xfef9f4=a27_0x34329f,_0x2492d6=_0x16d4bc[_0xfef9f4(0x170)]&&_0x264efd[_0xfef9f4(0x21d)]?.[_0xfef9f4(0x26f)]?aggregateStageHistory(_0x264efd[_0xfef9f4(0x21d)]):{'size':_0x264efd[_0xfef9f4(0x21a)],'entered':_0x264efd[_0xfef9f4(0x22b)],'milestone':_0x264efd[_0xfef9f4(0x1cf)],'milestone_rate':_0x264efd[_0xfef9f4(0x25f)],'exit_or_jump':_0x264efd[_0xfef9f4(0x174)],'exit_or_jump_rate':_0x264efd[_0xfef9f4(0x1e6)]},_0x5ea92a={'id':_0x264efd['id'],'name':_0x16d4bc['stageNameMap'][_0xfef9f4(0x25e)](_0x264efd['id'])??_0x264efd['id'],..._0x2492d6};return _0x16d4bc['hasPeriod']&&_0x16d4bc['includeHistory']&&_0x264efd[_0xfef9f4(0x21d)]&&(_0x5ea92a[_0xfef9f4(0x21d)]=_0x264efd[_0xfef9f4(0x21d)]),_0x5ea92a;}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a27_0x34329f(0x208)]='Pause\x20a\x20running\x20journey';async[a27_0x34329f(0x236)](_0x17bab2){const _0xf39cf8=a27_0x34329f,{options:_0x345faf,args:_0x43aae7,tdx:_0x448ee7}=_0x17bab2,_0x564e85=_0x43aae7[0x0];if(!requireNameOrPath(_0x564e85))return 0x1;_0x345faf[_0xf39cf8(0x213)]&&console[_0xf39cf8(0x26e)](_0xf39cf8(0x1d2)+_0x564e85);const {journeyId:_0x234451,journeyName:_0x253cf6}=await resolveJourneyIdFromInput(_0x564e85,_0x345faf,_0x448ee7);if(!_0x345faf[_0xf39cf8(0x194)]){const _0x33e851=await confirm(_0xf39cf8(0x1ac)+_0x253cf6+'\x22?');if(!_0x33e851)return console[_0xf39cf8(0x26e)](_0xf39cf8(0x17d)),0x0;}const _0x3248ed=await withSpinner(_0xf39cf8(0x1a9),()=>_0x448ee7[_0xf39cf8(0x1c8)][_0xf39cf8(0x242)](_0x234451),{'verbose':_0x345faf[_0xf39cf8(0x213)]}),_0x4dc63f=_0x3248ed[_0xf39cf8(0x1e5)];return console[_0xf39cf8(0x26e)](_0xf39cf8(0x1b3)+_0x4dc63f[_0xf39cf8(0x24d)]['name']+_0xf39cf8(0x268)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x34329f(0x179)]='journey:resume';['description']=a27_0x34329f(0x1a3);async[a27_0x34329f(0x236)](_0x5c3268){const _0x424a47=a27_0x34329f,{options:_0x31635b,args:_0x179252,tdx:_0x348833}=_0x5c3268,_0x438d0e=_0x179252[0x0];if(!requireNameOrPath(_0x438d0e))return 0x1;_0x31635b[_0x424a47(0x213)]&&console[_0x424a47(0x26e)](_0x424a47(0x1d2)+_0x438d0e);const {journeyId:_0x47f94f,journeyName:_0x416dc1}=await resolveJourneyIdFromInput(_0x438d0e,_0x31635b,_0x348833);if(!_0x31635b[_0x424a47(0x194)]){const _0x29d280=await confirm(_0x424a47(0x221)+_0x416dc1+'\x22?');if(!_0x29d280)return console[_0x424a47(0x26e)](_0x424a47(0x17d)),0x0;}const _0x533b8b=await withSpinner(_0x424a47(0x201),()=>_0x348833[_0x424a47(0x1c8)][_0x424a47(0x22f)](_0x47f94f),{'verbose':_0x31635b[_0x424a47(0x213)]}),_0x8bdba4=_0x533b8b[_0x424a47(0x1e5)];return console[_0x424a47(0x26e)](_0x424a47(0x1b3)+_0x8bdba4['attributes']['name']+_0x424a47(0x21b)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x34329f(0x179)]=a27_0x34329f(0x175);['description']=a27_0x34329f(0x182);async[a27_0x34329f(0x236)](_0x3e6976){const _0x412a3d=a27_0x34329f,{options:_0x48b9d8,args:_0xe3aaa3,tdx:_0xe7c60b}=_0x3e6976,_0x3061dd=_0x48b9d8,_0x16adf7=_0xe3aaa3[0x0],_0x33c5e1=_0x16adf7&&isYamlFilePath(_0x16adf7),_0x151e0a=await resolveTarget({'arg':_0x33c5e1?_0x16adf7:undefined,'contextParent':_0x48b9d8[_0x412a3d(0x202)],'cwd':process[_0x412a3d(0x1f9)]()});if(!isSuccessfulResolution(_0x151e0a))return _0x151e0a[_0x412a3d(0x223)]==='no_parent'?(console[_0x412a3d(0x26e)](a27_0x119cbe[_0x412a3d(0x26d)](_0x412a3d(0x1af))),console[_0x412a3d(0x26e)]('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[_0x412a3d(0x26e)](_0x412a3d(0x247)),console['error'](_0x412a3d(0x1ed)),console['error'](_0x412a3d(0x22c))):(console['error'](a27_0x119cbe['red'](_0x412a3d(0x163)+_0x151e0a[_0x412a3d(0x195)]+'\x0a')),_0x151e0a[_0x412a3d(0x1d8)]&&console['error'](a27_0x119cbe[_0x412a3d(0x1e8)](_0x151e0a[_0x412a3d(0x1d8)]))),0x1;let _0x519ce4=_0x33c5e1?undefined:_0x16adf7,_0x34a748,_0x595249;_0x151e0a['type']===_0x412a3d(0x19a)&&(_0x519ce4=_0x151e0a[_0x412a3d(0x19f)],_0x34a748=_0x151e0a[_0x412a3d(0x19b)],_0x595249=_0x151e0a[_0x412a3d(0x1fe)]);const _0x304f6d=_0x151e0a[_0x412a3d(0x1a6)],_0x62fcd4=_0x151e0a['targetDir'];_0x3061dd['verbose']&&(console[_0x412a3d(0x26e)](_0x412a3d(0x20a)+_0x304f6d),console[_0x412a3d(0x26e)](_0x412a3d(0x18d)+_0x62fcd4),_0x519ce4&&console[_0x412a3d(0x26e)](_0x412a3d(0x262)+_0x519ce4),_0x34a748&&console[_0x412a3d(0x26e)](_0x412a3d(0x17a)+_0x34a748),_0x595249&&console[_0x412a3d(0x26e)](_0x412a3d(0x196)+_0x595249));const _0x23c3b8=await withSpinner(_0x412a3d(0x173),()=>_0xe7c60b[_0x412a3d(0x257)][_0x412a3d(0x16c)](_0x304f6d),{'verbose':_0x48b9d8[_0x412a3d(0x213)]}),_0x12e5e6=_0x23c3b8[_0x412a3d(0x1e5)],{journeys:_0x39d00f,folders:_0x1b738d}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x4a18f0=_0x412a3d,[_0x21639c,_0x51792b]=await Promise['all']([_0xe7c60b[_0x4a18f0(0x1c8)][_0x4a18f0(0x210)](_0x12e5e6,undefined,{'includeAllVersions':!![]}),_0xe7c60b[_0x4a18f0(0x257)]['listFolders'](_0x12e5e6)]);return{'journeys':_0x21639c,'folders':_0x51792b};},{'verbose':_0x48b9d8[_0x412a3d(0x213)]})['then'](_0x44681f=>_0x44681f[_0x412a3d(0x1e5)]);let _0x5b78b9=_0x39d00f;const _0xc0b52f=buildFolderIdToPathMap(_0x1b738d);if(_0x519ce4){const _0x4ddebd=_0x5b78b9[_0x412a3d(0x248)](_0x377a2d=>_0x377a2d['journeyBundleName'][_0x412a3d(0x1fb)]()===_0x519ce4[_0x412a3d(0x1fb)]());if(_0x4ddebd['length']===0x0)return console[_0x412a3d(0x26e)](_0x412a3d(0x229)+_0x519ce4),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x5b78b9=_0x4ddebd;}if(_0x595249!==undefined){const _0x3d9f9d=_0x5b78b9[_0x412a3d(0x248)](_0x24bca5=>{const _0x4d0978=_0x412a3d,_0x5bfdac=_0x24bca5[_0x4d0978(0x1a0)]?_0xc0b52f[_0x4d0978(0x25e)](_0x24bca5[_0x4d0978(0x1a0)])||'':'';return _0x5bfdac===_0x595249;});if(_0x3d9f9d[_0x412a3d(0x26f)]===0x0&&_0x5b78b9[_0x412a3d(0x26f)]>0x0){console[_0x412a3d(0x26e)]('Error:\x20Journey\x20\x27'+_0x519ce4+_0x412a3d(0x270)+(_0x595249||'root\x20folder')),console[_0x412a3d(0x26e)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x54c9a4 of _0x5b78b9){const _0x105f66=_0x54c9a4[_0x412a3d(0x1a0)]?_0xc0b52f[_0x412a3d(0x25e)](_0x54c9a4['folderId'])||'':'';console[_0x412a3d(0x26e)](_0x412a3d(0x251)+(_0x105f66||_0x412a3d(0x1dd))+'/'+_0x54c9a4[_0x412a3d(0x249)]);}return 0x1;}_0x5b78b9=_0x3d9f9d;}if(_0x5b78b9['length']===0x0)return console['error']('No\x20journeys\x20found'),0x0;const _0x9efba4=new Map();for(const _0x4f38f5 of _0x5b78b9){const _0x31b9bc=_0x4f38f5['journeyBundleId'];!_0x9efba4['has'](_0x31b9bc)&&_0x9efba4[_0x412a3d(0x16e)](_0x31b9bc,[]),_0x9efba4['get'](_0x31b9bc)['push'](_0x4f38f5);}for(const _0x18adf3 of _0x9efba4[_0x412a3d(0x260)]()){_0x18adf3[_0x412a3d(0x162)]((_0x1dd005,_0x11ed05)=>(_0x1dd005['versionNumber']||0x0)-(_0x11ed05['versionNumber']||0x0));}const _0x28e06b=[],{idToEmailMap:_0x14cc63,connectionIdToNameMap:_0xc4274d}=await withSpinner(_0x412a3d(0x19e),async()=>{const _0x73a9af=_0x412a3d,[_0x3b82aa,_0x4d41a9]=await Promise['all']([_0xe7c60b['user'][_0x73a9af(0x224)](),_0xe7c60b[_0x73a9af(0x266)][_0x73a9af(0x204)]()]);return{'idToEmailMap':_0x3b82aa,'connectionIdToNameMap':_0x4d41a9};},{'verbose':_0x48b9d8['verbose']})[_0x412a3d(0x200)](_0x14c387=>_0x14c387[_0x412a3d(0x1e5)]);for(const _0x578b1c of _0x9efba4['values']()){const _0x26f176=_0x578b1c[0x0][_0x412a3d(0x249)],_0x4cff6b=_0x578b1c[0x0][_0x412a3d(0x1a0)],_0x1cfab8=_0x4cff6b?_0xc0b52f[_0x412a3d(0x25e)](_0x4cff6b)||'':'',_0x10facd=_0x1cfab8?a27_0x46fb71[_0x412a3d(0x19d)](_0x62fcd4,_0x1cfab8):_0x62fcd4,_0x1ccac3=_0x34a748||a27_0x46fb71[_0x412a3d(0x19d)](_0x10facd,sanitizeFileName(_0x26f176)+_0x412a3d(0x167));let _0x4284c5,_0x47eeb6;if(existsSync(_0x1ccac3))try{const _0x23ae47=readFileSync(_0x1ccac3,_0x412a3d(0x20d)),_0x13598b=parseYamlString(_0x23ae47);_0x47eeb6=_0x13598b,_0x4284c5=buildRuleToNameMapping(_0x13598b),_0x3061dd[_0x412a3d(0x213)]&&_0x4284c5[_0x412a3d(0x21a)]>0x0&&console[_0x412a3d(0x26e)](_0x412a3d(0x1c3)+_0x4284c5[_0x412a3d(0x21a)]+_0x412a3d(0x1f8)+_0x26f176);}catch(_0x4d1a47){_0x3061dd['verbose']&&console[_0x412a3d(0x26e)](_0x412a3d(0x1bc)+_0x4d1a47[_0x412a3d(0x195)]);}const _0x3eba0a=[],_0x4f08e4=new Set(),_0x83b037=new Map(),_0x66e01c=new Map(),_0x137cd0=new Set(),_0x3b1bf7=new Map(),_0x535925=new Map(),_0x3e392f=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x26f176+_0x412a3d(0x241),async _0x364aef=>{const _0x71d550=_0x412a3d;for(const _0x5a6d50 of _0x578b1c){const _0x5de999=_0x578b1c[_0x71d550(0x26f)]>0x1?_0x5a6d50[_0x71d550(0x249)]+'\x20v'+(_0x5a6d50[_0x71d550(0x1b0)]||0x1):_0x5a6d50['journeyBundleName'];_0x364aef['setPhase'](_0x71d550(0x215)+_0x5de999);const _0x3a292a=await _0xe7c60b[_0x71d550(0x1c8)][_0x71d550(0x1e3)](_0x5a6d50['id']),_0x670071=_0x3a292a['attributes']?.[_0x71d550(0x198)],_0x3e0f0c={'resolveSegment':async _0x4f7b2c=>{const _0x1d6a73=_0x71d550;if(!_0x670071)return{'name':_0x4f7b2c,'isJourneyLocal':![]};const _0x36731f=_0x83b037['get'](_0x4f7b2c);if(_0x36731f)return _0x36731f;try{const _0x2e8b3e=await _0xe7c60b[_0x1d6a73(0x257)][_0x1d6a73(0x21e)](_0x670071,_0x4f7b2c),_0x4ca49e=_0x2e8b3e[_0x1d6a73(0x1d1)]===SEGMENT_KIND_JOURNEY;let _0x18d827,_0x5c2f22=_0x2e8b3e[_0x1d6a73(0x179)];if(_0x4ca49e&&_0x2e8b3e['rule']){const _0x371cc9=await segmentResponseToDef(_0x2e8b3e,{'resolveSegmentName':async _0x91a9d4=>{const _0x3955b2=_0x1d6a73,_0x4d0ac5=_0x83b037[_0x3955b2(0x25e)](_0x91a9d4);if(_0x4d0ac5)return _0x4d0ac5[_0x3955b2(0x179)];const _0x367eaf=await _0x3e0f0c['resolveSegment'](_0x91a9d4);return _0x367eaf['name'];}}),_0xba636f=_0x371cc9[_0x1d6a73(0x18a)];_0x18d827={'description':_0x2e8b3e[_0x1d6a73(0x208)],'rule':_0xba636f};const _0xbf1c13=serializeRule(_0xba636f),_0xfa20c1=_0x66e01c['get'](_0xbf1c13);if(_0xfa20c1)_0x5c2f22=_0xfa20c1,_0x18d827=undefined,_0x3061dd[_0x1d6a73(0x213)]&&console[_0x1d6a73(0x26e)](_0x1d6a73(0x234)+_0x2e8b3e[_0x1d6a73(0x179)]+_0x1d6a73(0x186)+_0xfa20c1);else{let _0x49afd6=![];if(_0x4284c5){const _0x4b4795=_0x4284c5[_0x1d6a73(0x25e)](_0xbf1c13);if(_0x4b4795){const _0x16e731=_0x4b4795['find'](_0x22eb32=>!_0x4f08e4['has'](_0x22eb32));_0x16e731&&(_0x5c2f22=_0x16e731,_0x4f08e4[_0x1d6a73(0x205)](_0x16e731),_0x66e01c['set'](_0xbf1c13,_0x16e731),_0x49afd6=!![],_0x3061dd[_0x1d6a73(0x213)]&&console[_0x1d6a73(0x26e)](_0x1d6a73(0x258)+_0x16e731+_0x1d6a73(0x188)));}}if(!_0x49afd6){const _0x1497bd=generateJourneyLocalName(_0x2e8b3e['name']);_0x1497bd&&(_0x5c2f22=_0x1497bd);let _0x2b7236=_0x5c2f22,_0x1a8e84=0x2;while(_0x4f08e4[_0x1d6a73(0x26c)](_0x2b7236)){_0x2b7236=_0x5c2f22+'_'+_0x1a8e84,_0x1a8e84++;}_0x4f08e4[_0x1d6a73(0x205)](_0x2b7236),_0x66e01c['set'](_0xbf1c13,_0x2b7236),_0x5c2f22=_0x2b7236;}}}const _0x41eb1c={'name':_0x5c2f22,'isJourneyLocal':_0x4ca49e,'definition':_0x18d827};return _0x83b037[_0x1d6a73(0x16e)](_0x4f7b2c,_0x41eb1c),_0x41eb1c;}catch(_0x31b97e){return _0x48b9d8[_0x1d6a73(0x213)]&&console[_0x1d6a73(0x26e)](_0x1d6a73(0x21f)+_0x4f7b2c+':\x20'+_0x31b97e['message']),{'name':_0x4f7b2c,'isJourneyLocal':![]};}},'resolveActivation':async _0xe77aa0=>{const _0xed4e33=_0x71d550,_0x3a9471=_0x3b1bf7[_0xed4e33(0x25e)](_0xe77aa0);if(_0x3a9471)return _0x3a9471;try{const _0x238808=await _0xe7c60b[_0xed4e33(0x1c8)][_0xed4e33(0x1c0)](_0x5a6d50['id'],_0xe77aa0),_0x33cde2=journeyActivationStepToYaml(_0x238808,_0x14cc63,_0xc4274d),_0x280a66=JSON[_0xed4e33(0x239)]({'name':_0x33cde2[_0xed4e33(0x179)],'connection':_0x33cde2[_0xed4e33(0x266)],'connector_config':_0x33cde2[_0xed4e33(0x1a1)]}),_0x31a358=_0x535925[_0xed4e33(0x25e)](_0x280a66);if(_0x31a358){const _0xb12359={'name':_0x31a358,'isJourneyLocal':!![],'definition':_0x33cde2};return _0x3b1bf7[_0xed4e33(0x16e)](_0xe77aa0,_0xb12359),_0xb12359;}const _0x35d1ed=_0x238808[_0xed4e33(0x24d)][_0xed4e33(0x25c)][_0xed4e33(0x179)]||_0xe77aa0,_0xa4add1=sanitizeYamlKey(_0x35d1ed)||_0xed4e33(0x1cc)+_0xe77aa0;let _0x3d4e5f=_0xa4add1,_0xc9933c=0x2;while(_0x137cd0[_0xed4e33(0x26c)](_0x3d4e5f)){_0x3d4e5f=_0xa4add1+'_'+_0xc9933c,_0xc9933c++;}_0x137cd0[_0xed4e33(0x205)](_0x3d4e5f),_0x535925[_0xed4e33(0x16e)](_0x280a66,_0x3d4e5f);const _0x181394={'name':_0x3d4e5f,'isJourneyLocal':!![],'definition':_0x33cde2};return _0x3b1bf7['set'](_0xe77aa0,_0x181394),_0x181394;}catch(_0x59cfe8){return _0x48b9d8[_0xed4e33(0x213)]&&console[_0xed4e33(0x26e)](_0xed4e33(0x20f)+_0xe77aa0+':\x20'+_0x59cfe8[_0xed4e33(0x195)]),{'name':_0xe77aa0,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x14a929,_0x5237c9)=>{const _0x65beaf=_0x71d550;return resolveJumpTarget(_0x14a929,_0x5237c9,_0x3e392f,_0x10fa78=>_0xe7c60b[_0x65beaf(0x1c8)][_0x65beaf(0x1e3)](_0x10fa78));}},_0x137371=await journeyResponseToDef(_0x3a292a,_0x3e0f0c);_0x3eba0a[_0x71d550(0x1b6)]({'item':_0x5a6d50,'yaml':_0x137371});}},{'verbose':_0x48b9d8[_0x412a3d(0x213)]});const _0x3dca6d=await _0xe7c60b[_0x412a3d(0x1c8)][_0x412a3d(0x183)](_0x578b1c[0x0][_0x412a3d(0x1d6)]),_0x2a71cb=buildMergedJourneyDef(_0x3eba0a,_0x4284c5,_0x3dca6d),_0x75ed7a=normalizeJourneyDef(_0x2a71cb,_0x47eeb6),_0x592f66=toYamlString(_0x75ed7a),_0x133cbc=_0x34a748||a27_0x46fb71['join'](_0x10facd,sanitizeFileName(_0x26f176)+'.yml');!_0x34a748&&_0x1cfab8&&!existsSync(_0x10facd)&&mkdirSync(_0x10facd,{'recursive':!![]});const _0x52d9ba=a27_0x46fb71['relative'](process[_0x412a3d(0x1f9)](),_0x133cbc);if(existsSync(_0x133cbc)){const _0xf9cfba=readFileSync(_0x133cbc,_0x412a3d(0x20d)),_0x164836=generateDiff(_0xf9cfba,_0x592f66),_0x1a79e7=hasChanges(_0x164836);_0x28e06b[_0x412a3d(0x1b6)]({'relativePath':_0x52d9ba,'absolutePath':_0x133cbc,'content':_0x592f66,'isNew':![],'hasChanges':_0x1a79e7,'diff':_0x1a79e7?formatDiffWithColors(_0x164836):undefined});}else _0x28e06b[_0x412a3d(0x1b6)]({'relativePath':_0x52d9ba,'absolutePath':_0x133cbc,'content':_0x592f66,'isNew':!![],'hasChanges':![]});}const _0x5579ac=_0x28e06b[_0x412a3d(0x248)](_0x4df88f=>_0x4df88f[_0x412a3d(0x211)]),_0x239ec0=_0x28e06b[_0x412a3d(0x248)](_0x87b40a=>!_0x87b40a[_0x412a3d(0x211)]&&_0x87b40a[_0x412a3d(0x1e4)]),_0x3b05a1=_0x28e06b[_0x412a3d(0x248)](_0x7c7a87=>!_0x7c7a87['isNew']&&!_0x7c7a87[_0x412a3d(0x1e4)]),_0x1613cc=_0x5b78b9[_0x412a3d(0x26f)],_0x187a7a=_0x9efba4[_0x412a3d(0x21a)],_0x3382fa=_0x1613cc>_0x187a7a?'\x20('+_0x1613cc+_0x412a3d(0x231):'';console[_0x412a3d(0x26e)](_0x412a3d(0x244)),console['error']('\x20\x20'+a27_0x119cbe['cyan'](_0x187a7a+_0x412a3d(0x1e9))+a27_0x119cbe[_0x412a3d(0x235)](_0x3382fa)),console[_0x412a3d(0x26e)]('\x20\x20'+a27_0x119cbe[_0x412a3d(0x193)]('+\x20'+_0x5579ac[_0x412a3d(0x26f)]+'\x20new\x20files')),console[_0x412a3d(0x26e)]('\x20\x20'+a27_0x119cbe[_0x412a3d(0x26d)]('~\x20'+_0x239ec0[_0x412a3d(0x26f)]+_0x412a3d(0x189))),console[_0x412a3d(0x26e)]('\x20\x20'+a27_0x119cbe['dim']('=\x20'+_0x3b05a1['length']+_0x412a3d(0x226))),console['error'](_0x412a3d(0x1d7)+a27_0x119cbe[_0x412a3d(0x1e8)](_0x62fcd4)+'\x0a');if(_0x239ec0[_0x412a3d(0x26f)]>0x0)for(const _0x16e650 of _0x239ec0){console[_0x412a3d(0x26e)](_0x412a3d(0x254)+_0x16e650[_0x412a3d(0x23c)]+'\x27:'),console[_0x412a3d(0x26e)]('─'[_0x412a3d(0x256)](0x3c)),console['error'](_0x16e650['diff']),console[_0x412a3d(0x26e)]('─'[_0x412a3d(0x256)](0x3c));}if(_0x3061dd['dryRun'])return console[_0x412a3d(0x26e)](a27_0x119cbe[_0x412a3d(0x26d)](_0x412a3d(0x217))),0x0;if(_0x5579ac['length']===0x0&&_0x239ec0[_0x412a3d(0x26f)]===0x0)return console[_0x412a3d(0x26e)](a27_0x119cbe['green'](_0x412a3d(0x180))),saveSessionContext({'parent_segment':_0x304f6d},_0x3061dd[_0x412a3d(0x17c)]),console[_0x412a3d(0x26e)](a27_0x119cbe[_0x412a3d(0x193)](_0x412a3d(0x245)+a27_0x119cbe[_0x412a3d(0x235)](_0x412a3d(0x261))+_0x412a3d(0x1dc)+a27_0x119cbe[_0x412a3d(0x1e8)](_0x304f6d))),0x0;if(!_0x3061dd['yes']&&(_0x5579ac[_0x412a3d(0x26f)]>0x0||_0x239ec0[_0x412a3d(0x26f)]>0x0)){if(!isInteractive())return console[_0x412a3d(0x26e)](a27_0x119cbe[_0x412a3d(0x237)]('\x0aError:'),_0x412a3d(0x23d)),console['error'](a27_0x119cbe[_0x412a3d(0x235)](_0x412a3d(0x1d3))),0x1;const _0x380abd=await confirmKey(_0x412a3d(0x212)+(_0x5579ac[_0x412a3d(0x26f)]+_0x239ec0[_0x412a3d(0x26f)])+_0x412a3d(0x184));if(!_0x380abd)return console[_0x412a3d(0x26e)](a27_0x119cbe['yellow'](_0x412a3d(0x1e1)),_0x412a3d(0x1c4)),0x1;}!existsSync(_0x62fcd4)&&mkdirSync(_0x62fcd4,{'recursive':!![]});const _0x200f80=a27_0x46fb71['join'](_0x62fcd4,_0x412a3d(0x24f));writeFileSync(_0x200f80,createTdxConfigContent(_0x304f6d),_0x412a3d(0x20d));for(const _0x21d486 of _0x28e06b){(_0x21d486[_0x412a3d(0x211)]||_0x21d486['hasChanges'])&&writeFileSync(_0x21d486['absolutePath'],_0x21d486[_0x412a3d(0x1ef)],_0x412a3d(0x20d));}return console[_0x412a3d(0x26e)](a27_0x119cbe[_0x412a3d(0x193)](_0x412a3d(0x1da)+(_0x5579ac[_0x412a3d(0x26f)]+_0x239ec0[_0x412a3d(0x26f)])+_0x412a3d(0x16d)+_0x62fcd4)),saveSessionContext({'parent_segment':_0x304f6d},_0x3061dd[_0x412a3d(0x17c)]),console[_0x412a3d(0x26e)](a27_0x119cbe[_0x412a3d(0x193)](_0x412a3d(0x245)+a27_0x119cbe[_0x412a3d(0x235)](_0x412a3d(0x261))+'\x20=\x20'+a27_0x119cbe['cyan'](_0x304f6d))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x34329f(0x26b);['description']=a27_0x34329f(0x1c9);async['execute'](_0x8bc253){const _0x3315a7=a27_0x34329f,{options:_0x12eab8,args:_0x63650f,tdx:_0x3f6339}=_0x8bc253,_0x21cd3b=_0x63650f[0x0];if(!requireNameOrPath(_0x21cd3b))return 0x1;_0x12eab8[_0x3315a7(0x213)]&&console[_0x3315a7(0x26e)](_0x3315a7(0x1d2)+_0x21cd3b);const {journeyId:_0x18557b}=await resolveJourneyIdFromInput(_0x21cd3b,_0x12eab8,_0x3f6339),_0x3f09c2=await withSpinner(_0x3315a7(0x209),()=>_0x3f6339[_0x3315a7(0x1c8)]['getColumnMapping'](_0x18557b),{'verbose':_0x12eab8[_0x3315a7(0x213)]}),_0x5dc0d9=_0x3f09c2['data'];return console[_0x3315a7(0x1ca)](_0x3315a7(0x1f2)+_0x5dc0d9['database']),console[_0x3315a7(0x1ca)]('Table:\x20'+_0x5dc0d9[_0x3315a7(0x22a)]),await handleSDKOutput(_0x5dc0d9[_0x3315a7(0x17e)],_0x12eab8),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x34329f(0x269);['description']=a27_0x34329f(0x1cd);async[a27_0x34329f(0x236)](_0x2c77f5){const _0x12b86f=a27_0x34329f,{options:_0x6e678d,args:_0x5ed919,tdx:_0x274d36}=_0x2c77f5,_0x559f93=_0x5ed919[0x0];if(!requireNameOrPath(_0x559f93))return 0x1;_0x6e678d[_0x12b86f(0x213)]&&console[_0x12b86f(0x26e)](_0x12b86f(0x1d2)+_0x559f93);const {journeyId:_0x56a6e2}=await resolveJourneyIdFromInput(_0x559f93,_0x6e678d,_0x274d36),_0x4a6c30=await withSpinner(_0x12b86f(0x1e7),()=>_0x274d36[_0x12b86f(0x1c8)][_0x12b86f(0x264)](_0x56a6e2),{'verbose':_0x6e678d[_0x12b86f(0x213)]}),_0x146b71=_0x4a6c30[_0x12b86f(0x1e5)];return console[_0x12b86f(0x26e)](_0x12b86f(0x1c3)+_0x146b71['length']+_0x12b86f(0x1e0)+(_0x146b71['length']!==0x1?'s':'')),await handleSDKOutput(_0x146b71,_0x6e678d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x34329f(0x179)]=a27_0x34329f(0x263);['description']=a27_0x34329f(0x1c2);[a27_0x34329f(0x24a)]=new SegmentPushCommand();async[a27_0x34329f(0x236)](_0x859cec){const _0x987647=a27_0x34329f,_0x445783=_0x859cec[_0x987647(0x230)][0x0];let _0x159d94;if(_0x445783){const _0x154a97=await resolveTarget({'arg':_0x445783,'contextParent':_0x859cec[_0x987647(0x1ce)][_0x987647(0x202)],'cwd':process[_0x987647(0x1f9)]()});isSuccessfulResolution(_0x154a97)&&_0x154a97[_0x987647(0x185)]===_0x987647(0x19a)&&(_0x159d94=_0x154a97[_0x987647(0x19b)]);}const _0x323bc0={..._0x859cec,'options':{..._0x859cec[_0x987647(0x1ce)],'journeysOnly':!![],..._0x159d94&&{'singleFilePath':_0x159d94}}};return this[_0x987647(0x24a)][_0x987647(0x236)](_0x323bc0);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x34329f(0x179)]=a27_0x34329f(0x218);[a27_0x34329f(0x208)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x34329f(0x236)](_0x48dfb7){const _0x3c8af2=a27_0x34329f,{options:_0xd33de3,args:_0x252d37,tdx:_0x32bd47}=_0x48dfb7,_0x5485a3=_0x252d37[0x0];if(!requireNameOrPath(_0x5485a3))return 0x1;if(_0xd33de3[_0x3c8af2(0x213)])console['error'](_0x3c8af2(0x1d2)+_0x5485a3);const {journeyId:_0x25cd0c}=await resolveJourneyIdFromInput(_0x5485a3,_0xd33de3,_0x32bd47),_0x5a4449=await withSpinner(_0x3c8af2(0x222),()=>_0x32bd47['journey'][_0x3c8af2(0x177)](_0x25cd0c),{'verbose':_0xd33de3[_0x3c8af2(0x213)]}),{bundleName:_0x245dab,versions:_0x191f01,latestJourneyId:_0x2ac72f}=_0x5a4449[_0x3c8af2(0x1e5)];console[_0x3c8af2(0x26e)](_0x245dab+':\x20'+_0x191f01['length']+'\x20version'+(_0x191f01[_0x3c8af2(0x26f)]!==0x1?'s':''));const _0x508970=_0x191f01[_0x3c8af2(0x238)](_0x40ec6c=>({'version':_0x40ec6c[_0x3c8af2(0x1b0)],'journey_id':_0x40ec6c[_0x3c8af2(0x20b)],'name':_0x40ec6c[_0x3c8af2(0x179)],'state':_0x40ec6c[_0x3c8af2(0x22d)],'paused':_0x40ec6c[_0x3c8af2(0x190)],'latest':_0x40ec6c[_0x3c8af2(0x20b)]===_0x2ac72f,'created_at':_0x40ec6c[_0x3c8af2(0x26a)]}));return await handleSDKOutput(_0x508970,_0xd33de3),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x34329f(0x179)]=a27_0x34329f(0x1cb);[a27_0x34329f(0x208)]=a27_0x34329f(0x253);async[a27_0x34329f(0x236)](_0x412436){const _0x16c5f0=a27_0x34329f,{options:_0x56358f,args:_0x575b85,tdx:_0x140e1b}=_0x412436,_0x1272cc=_0x575b85[0x0];if(!requireNameOrPath(_0x1272cc))return 0x1;if(_0x56358f[_0x16c5f0(0x213)])console[_0x16c5f0(0x26e)](_0x16c5f0(0x1d2)+_0x1272cc);const {journeyId:_0x1f7939,journeyName:_0x391386}=await resolveJourneyIdFromInput(_0x1272cc,_0x56358f,_0x140e1b);if(!_0x56358f[_0x16c5f0(0x194)]){const _0x31d8ae=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x391386+'\x22?');if(!_0x31d8ae)return console[_0x16c5f0(0x26e)](_0x16c5f0(0x17d)),0x0;}const _0xd90cf0=await withSpinner(_0x16c5f0(0x17b),()=>_0x140e1b[_0x16c5f0(0x1c8)][_0x16c5f0(0x199)](_0x1f7939),{'verbose':_0x56358f[_0x16c5f0(0x213)]}),_0x4cc39c=_0xd90cf0['data'];return console['error'](a27_0x119cbe[_0x16c5f0(0x193)]('✔')+_0x16c5f0(0x203)+_0x4cc39c['attributes'][_0x16c5f0(0x1b0)]+_0x16c5f0(0x225)+_0x4cc39c[_0x16c5f0(0x24d)][_0x16c5f0(0x179)]+'\x22'),console[_0x16c5f0(0x26e)](_0x16c5f0(0x21c)+_0x4cc39c['id']),await handleSingleObjectOutput({'id':_0x4cc39c['id'],'name':_0x4cc39c[_0x16c5f0(0x24d)]['name'],'version':_0x4cc39c['attributes'][_0x16c5f0(0x1b0)],'state':_0x4cc39c['attributes'][_0x16c5f0(0x22d)],'bundle_id':_0x4cc39c['attributes'][_0x16c5f0(0x1d6)],'created_at':_0x4cc39c[_0x16c5f0(0x24d)][_0x16c5f0(0x26a)]},_0x56358f),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x34329f(0x179)]=a27_0x34329f(0x267);[a27_0x34329f(0x208)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x34329f(0x236)](_0x58f4e9){const _0x493937=a27_0x34329f,{options:_0x2e5a36,args:_0x3e19f6,tdx:_0x5454d5}=_0x58f4e9,_0x51635e=_0x3e19f6[0x0];if(!requireNameOrPath(_0x51635e))return 0x1;const _0x2c1eb9=_0x2e5a36[_0x493937(0x1f4)];if(!_0x2c1eb9)return console['error'](_0x493937(0x1f3)),console[_0x493937(0x26e)](_0x493937(0x169)),0x1;const _0x27ce31=parseInt(_0x2c1eb9,0xa);if(isNaN(_0x27ce31)||_0x27ce31<0x1)return console[_0x493937(0x26e)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x2c1eb9),0x1;if(_0x2e5a36[_0x493937(0x213)])console[_0x493937(0x26e)](_0x493937(0x1d2)+_0x51635e+_0x493937(0x18e)+_0x27ce31);const {journeyId:_0x549ae1,parentSegmentId:_0x52a932}=await resolveJourneyIdFromInput(_0x51635e,_0x2e5a36,_0x5454d5),_0x38b16f=await withSpinner(_0x493937(0x228),()=>_0x5454d5['journey'][_0x493937(0x177)](_0x549ae1),{'verbose':_0x2e5a36[_0x493937(0x213)]}),{versions:_0x5e4dd6,latestJourneyId:_0x2a04c1}=_0x38b16f['data'],_0x5807c0=_0x5e4dd6[_0x493937(0x246)](_0x531b1d=>_0x531b1d[_0x493937(0x1b0)]===_0x27ce31);if(!_0x5807c0){const _0x516208=_0x5e4dd6[_0x493937(0x238)](_0x1cab2b=>'v'+_0x1cab2b[_0x493937(0x1b0)])['join'](',\x20');return console[_0x493937(0x26e)]('Error:\x20Version\x20'+_0x27ce31+_0x493937(0x219)+_0x516208),0x1;}const _0x47d3cf=await withSpinner(_0x493937(0x1b1)+_0x27ce31+_0x493937(0x1ee),()=>_0x5454d5[_0x493937(0x1c8)][_0x493937(0x1e3)](_0x5807c0[_0x493937(0x20b)]),{'verbose':_0x2e5a36[_0x493937(0x213)]}),_0x3c9b4c=_0x47d3cf[_0x493937(0x1e5)],_0x360fc9=getConsoleNextUrl(_0x2e5a36['site'],'/app/ps/'+_0x52a932+_0x493937(0x271)+_0x5807c0['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x3c9b4c['id'],'name':_0x3c9b4c[_0x493937(0x24d)][_0x493937(0x179)],'version':_0x3c9b4c['attributes'][_0x493937(0x1b0)],'description':_0x3c9b4c[_0x493937(0x24d)]['description'],'state':_0x3c9b4c['attributes'][_0x493937(0x22d)],'paused':_0x3c9b4c[_0x493937(0x24d)]['paused'],'reentry_mode':_0x3c9b4c[_0x493937(0x24d)][_0x493937(0x24b)],'stages':_0x3c9b4c['attributes'][_0x493937(0x16a)]?.['length']||0x0,..._0x3c9b4c[_0x493937(0x24d)][_0x493937(0x1a8)]&&{'goal':_0x3c9b4c[_0x493937(0x24d)][_0x493937(0x1a8)][_0x493937(0x179)]},'latest':_0x5807c0[_0x493937(0x20b)]===_0x2a04c1,'created_at':_0x3c9b4c[_0x493937(0x24d)][_0x493937(0x26a)],'updated_at':_0x3c9b4c[_0x493937(0x24d)][_0x493937(0x206)],'url':_0x360fc9},_0x2e5a36),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a28_0x524dfc=a28_0x3d63;function a28_0x3d63(_0x421b75,_0x4bdba4){_0x421b75=_0x421b75-0xd2;const _0x301a97=a28_0x301a();let _0x3d6395=_0x301a97[_0x421b75];return _0x3d6395;}(function(_0x426796,_0x59a932){const _0x529525=a28_0x3d63,_0x14e4d3=_0x426796();while(!![]){try{const _0x32236c=-parseInt(_0x529525(0x10b))/0x1*(-parseInt(_0x529525(0xe4))/0x2)+-parseInt(_0x529525(0xe0))/0x3+parseInt(_0x529525(0xfa))/0x4+parseInt(_0x529525(0xfd))/0x5*(parseInt(_0x529525(0x10a))/0x6)+-parseInt(_0x529525(0xda))/0x7+parseInt(_0x529525(0xe6))/0x8*(parseInt(_0x529525(0xd8))/0x9)+parseInt(_0x529525(0xd3))/0xa*(-parseInt(_0x529525(0x108))/0xb);if(_0x32236c===_0x59a932)break;else _0x14e4d3['push'](_0x14e4d3['shift']());}catch(_0x791912){_0x14e4d3['push'](_0x14e4d3['shift']());}}}(a28_0x301a,0x878f8));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x588bf2 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x524dfc(0xee)]=a28_0x524dfc(0xe5);['description']=a28_0x524dfc(0xf6);async[a28_0x524dfc(0xf5)](_0x376043){const _0x262957=a28_0x524dfc,{options:_0x52fc40,args:_0x123ab}=_0x376043,_0x2722fa=_0x52fc40,_0x5021df=await resolveTarget({'arg':_0x123ab[0x0],'contextParent':_0x52fc40[_0x262957(0xd7)],'cwd':process[_0x262957(0xe1)]()});if(!isSuccessfulResolution(_0x5021df))return _0x5021df['errorCode']===_0x262957(0x103)?(console[_0x262957(0xd2)](a28_0x588bf2['yellow'](_0x262957(0xdc))),console[_0x262957(0xd2)](_0x262957(0x105)),console[_0x262957(0xd2)](_0x262957(0xd9)),console[_0x262957(0xd2)](_0x262957(0xe9))):(console['error'](a28_0x588bf2[_0x262957(0x101)]('Error:\x20'+_0x5021df[_0x262957(0x107)]+'\x0a')),_0x5021df[_0x262957(0x100)]&&console['error'](a28_0x588bf2[_0x262957(0xe8)](_0x5021df[_0x262957(0x100)]))),0x1;const _0x428408=_0x5021df['targetDir'],_0x12eb5e=_0x5021df[_0x262957(0xd5)]===_0x262957(0xe7)?_0x5021df[_0x262957(0xf3)]:undefined;if(!_0x12eb5e&&!existsSync(_0x428408))return console[_0x262957(0xd2)](a28_0x588bf2[_0x262957(0x101)]('Error:\x20Directory\x20not\x20found:\x20'+_0x428408+'\x0a')),0x1;let _0x287ab5;if(_0x12eb5e){if(!_0x12eb5e[_0x262957(0xde)](_0x262957(0xf2))&&!_0x12eb5e[_0x262957(0xde)](_0x262957(0xeb)))return console[_0x262957(0xd2)](a28_0x588bf2[_0x262957(0x101)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x12eb5e+'\x0a')),0x1;_0x287ab5=[_0x12eb5e];}else _0x287ab5=findYamlFiles(_0x428408);if(_0x287ab5['length']===0x0)return console[_0x262957(0xd2)](a28_0x588bf2[_0x262957(0x101)](_0x262957(0xe2)+_0x428408+'\x0a')),0x1;const _0x3815a5=validateYamlFiles(_0x287ab5,_0x428408,{'filterType':_0x262957(0x109)}),_0x41435a=calculateSummary(_0x3815a5),_0x1c7d49=_0x3815a5[_0x262957(0xf8)](isValidationResult);if(_0x1c7d49[_0x262957(0xdb)]===0x0)return console['error'](a28_0x588bf2[_0x262957(0xf9)](_0x262957(0xea)+_0x428408+'\x0a')),_0x41435a[_0x262957(0xd4)]>0x0&&console[_0x262957(0xd2)](a28_0x588bf2[_0x262957(0x102)]('('+_0x41435a[_0x262957(0xd4)]+_0x262957(0xfc))),0x0;for(const _0x4dc439 of _0x3815a5){if(!isValidationResult(_0x4dc439)){_0x2722fa['verbose']&&console[_0x262957(0xfe)](a28_0x588bf2[_0x262957(0x102)]('-\x20'+_0x4dc439[_0x262957(0xe3)]+'\x20(skipped:\x20'+_0x4dc439[_0x262957(0xfb)]+')'));continue;}const {relativePath:_0x521f18,source:_0x3421b0,result:_0x25c9a4}=_0x4dc439;if(_0x25c9a4[_0x262957(0xf1)]&&_0x25c9a4[_0x262957(0xd6)][_0x262957(0xdb)]===0x0)_0x2722fa[_0x262957(0xec)]&&console[_0x262957(0xfe)](a28_0x588bf2[_0x262957(0xf7)]('✔\x20'+_0x521f18));else _0x25c9a4[_0x262957(0xf1)]?(console[_0x262957(0xfe)](a28_0x588bf2[_0x262957(0xf9)]('⚠\x20'+_0x521f18+':\x20'+_0x25c9a4[_0x262957(0xd6)]['length']+_0x262957(0xed))),console[_0x262957(0xfe)](formatValidationResult(_0x25c9a4,_0x3421b0,_0x521f18))):(console['log'](a28_0x588bf2['red']('✖\x20'+_0x521f18+':\x20'+_0x25c9a4[_0x262957(0xf4)]['length']+'\x20error(s)')),console['log'](formatValidationResult(_0x25c9a4,_0x3421b0,_0x521f18)));}return console['log'](''),_0x41435a[_0x262957(0xdd)]?(console[_0x262957(0xfe)](a28_0x588bf2['red'](_0x262957(0xff)+_0x41435a[_0x262957(0xdf)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x41435a[_0x262957(0x104)]+'\x20valid')),_0x41435a[_0x262957(0x10d)]>0x0&&console['log'](a28_0x588bf2['yellow'](_0x41435a[_0x262957(0x10d)]+'\x20warning(s)\x20found')),_0x41435a['skippedCount']>0x0&&console['log'](a28_0x588bf2[_0x262957(0x102)](_0x41435a[_0x262957(0xd4)]+_0x262957(0xf0))),0x1):(console[_0x262957(0xfe)](a28_0x588bf2[_0x262957(0xf7)](_0x262957(0x106)+_0x41435a[_0x262957(0x104)]+_0x262957(0x10c))),_0x41435a[_0x262957(0x10d)]>0x0&&console[_0x262957(0xfe)](a28_0x588bf2[_0x262957(0xf9)](_0x41435a[_0x262957(0x10d)]+_0x262957(0xef))),_0x41435a[_0x262957(0xd4)]>0x0&&console[_0x262957(0xfe)](a28_0x588bf2['dim'](_0x41435a['skippedCount']+_0x262957(0xf0))),0x0);}}function a28_0x301a(){const _0xd029f9=['length','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','hasErrors','endsWith','invalidCount','924471BeqPiO','cwd','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','relativePath','996322xCqutB','journey:validate','8EJoEzP','file','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','No\x20journey\x20YAML\x20files\x20found\x20in\x20','.yaml','verbose','\x20warning(s)','name','\x20warning(s)\x20found','\x20segment\x20file(s)\x20skipped','valid','.yml','filePath','errors','execute','Validate\x20journey\x20YAML\x20files','green','filter','yellow','3142360vZIUGK','reason','\x20segment\x20file(s)\x20skipped)','646130dxpnlE','log','Validation\x20failed:\x20','helpText','red','dim','no_parent','validCount','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','✔\x20All\x20','message','209DjaeXR','journey','6pMqOxD','2AsBrOa','\x20journey(s)\x20valid','warningCount','error','576770wPfCUG','skippedCount','type','warnings','parentSegment','9030618ftKSoK','\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','6686848FGkynX'];a28_0x301a=function(){return _0xd029f9;};return a28_0x301a();}
|