@treasuredata/tdx 2026.3.31 → 2026.3.32
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.d.ts +36 -0
- package/dist/commands/work-command.d.ts.map +1 -0
- package/dist/commands/work-command.js +1 -0
- package/dist/commands/work-command.js.map +1 -0
- 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.d.ts +2 -0
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.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.d.ts +1 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.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.d.ts +2 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +146 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -0
- package/dist/sdk/types/workspace.js +1 -0
- package/dist/sdk/types/workspace.js.map +1 -0
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.d.ts +28 -0
- package/dist/sdk/workspace/frontmatter.d.ts.map +1 -0
- package/dist/sdk/workspace/frontmatter.js +1 -0
- package/dist/sdk/workspace/frontmatter.js.map +1 -0
- package/dist/sdk/workspace/git.d.ts +55 -0
- package/dist/sdk/workspace/git.d.ts.map +1 -0
- package/dist/sdk/workspace/git.js +1 -0
- package/dist/sdk/workspace/git.js.map +1 -0
- package/dist/sdk/workspace/index.d.ts +149 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -0
- package/dist/sdk/workspace/index.js +1 -0
- package/dist/sdk/workspace/index.js.map +1 -0
- package/dist/sdk/workspace/skills.d.ts +34 -0
- package/dist/sdk/workspace/skills.d.ts.map +1 -0
- package/dist/sdk/workspace/skills.js +1 -0
- package/dist/sdk/workspace/skills.js.map +1 -0
- package/dist/sdk/workspace/templates.d.ts +17 -0
- package/dist/sdk/workspace/templates.d.ts.map +1 -0
- package/dist/sdk/workspace/templates.js +1 -0
- package/dist/sdk/workspace/templates.js.map +1 -0
- package/dist/sdk/workspace/wikilinks.d.ts +44 -0
- package/dist/sdk/workspace/wikilinks.d.ts.map +1 -0
- package/dist/sdk/workspace/wikilinks.js +1 -0
- package/dist/sdk/workspace/wikilinks.js.map +1 -0
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x25763b=a26_0x5275;(function(_0xcc5adc,_0x30d6e4){const _0x1888ba=a26_0x5275,_0x325425=_0xcc5adc();while(!![]){try{const _0x29e3d4=parseInt(_0x1888ba(0xa1))/0x1+-parseInt(_0x1888ba(0x89))/0x2*(-parseInt(_0x1888ba(0x8c))/0x3)+parseInt(_0x1888ba(0x92))/0x4+parseInt(_0x1888ba(0x8f))/0x5+parseInt(_0x1888ba(0xa9))/0x6+parseInt(_0x1888ba(0xad))/0x7*(parseInt(_0x1888ba(0xa2))/0x8)+-parseInt(_0x1888ba(0xac))/0x9*(parseInt(_0x1888ba(0x9c))/0xa);if(_0x29e3d4===_0x30d6e4)break;else _0x325425['push'](_0x325425['shift']());}catch(_0x2e593d){_0x325425['push'](_0x325425['shift']());}}}(a26_0x99a3,0xb4fa9));import{BaseCommand}from'./command.js';function a26_0x99a3(){const _0x3a3c1e=['green','No\x20template\x20YAML\x20files\x20found\x20in\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','description','5368608eAatGq','cwd','verbose','36dhPRQN','2884FOjbbn','relativePath','Validation\x20failed:\x20','warnings','log','\x20warning(s)\x20found','\x20warning(s)','errors','Error:\x20Directory\x20not\x20found:\x20','endsWith','✔\x20All\x20','template','execute','length','invalidCount','12034SLLDHr','\x20valid','.yaml','303NnQWmr','error','dim','42135abBexA','yellow','Validate\x20template\x20YAML\x20files','618596mkjjjP','filter','skippedCount','hasErrors','warningCount','reason','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20error(s)','red','dirname','3901400AgLXeK','validCount','valid','engage:template:validate','\x20non-template\x20file(s)\x20skipped','109340VrdHPw','10232NAGkSu','.yml','\x20template(s)\x20with\x20errors,\x20'];a26_0x99a3=function(){return _0x3a3c1e;};return a26_0x99a3();}function a26_0x5275(_0x282189,_0x4998d6){_0x282189=_0x282189-0x82;const _0x99a3fa=a26_0x99a3();let _0x52757a=_0x99a3fa[_0x282189];return _0x52757a;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x36bb32 from'chalk';import a26_0x2760c5 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']=a26_0x25763b(0x9f);[a26_0x25763b(0xa8)]=a26_0x25763b(0x91);async[a26_0x25763b(0x86)](_0x52537b){const _0x520a24=a26_0x25763b,{options:_0x3c92c8,args:_0x2a8fd7}=_0x52537b,_0x3158d0=_0x3c92c8,_0x257e22=_0x2a8fd7[0x0],_0x8ba76=_0x257e22?a26_0x2760c5['resolve'](_0x257e22):undefined,_0x321734=_0x8ba76?isYamlFile(_0x8ba76):![];let _0x43f652,_0xa5c6f4;if(_0x321734&&_0x8ba76)_0x43f652=a26_0x2760c5[_0x520a24(0x9b)](_0x8ba76),_0xa5c6f4=_0x8ba76;else _0x8ba76?_0x43f652=_0x8ba76:_0x43f652=process[_0x520a24(0xaa)]();if(!_0xa5c6f4&&!existsSync(_0x43f652))return console[_0x520a24(0x8d)](a26_0x36bb32[_0x520a24(0x9a)](_0x520a24(0x82)+_0x43f652+'\x0a')),0x1;let _0x9b7c73;if(_0xa5c6f4){if(!_0xa5c6f4['endsWith'](_0x520a24(0xa3))&&!_0xa5c6f4[_0x520a24(0x83)](_0x520a24(0x8b)))return console['error'](a26_0x36bb32[_0x520a24(0x9a)](_0x520a24(0xa7)+_0xa5c6f4+'\x0a')),0x1;_0x9b7c73=[_0xa5c6f4];}else _0x9b7c73=findYamlFiles(_0x43f652);if(_0x9b7c73[_0x520a24(0x87)]===0x0)return console[_0x520a24(0x8d)](a26_0x36bb32['red'](_0x520a24(0x98)+_0x43f652+'\x0a')),0x1;const _0x31db17=validateYamlFiles(_0x9b7c73,_0x43f652,{'filterType':_0x520a24(0x85)}),_0x2e0133=calculateSummary(_0x31db17),_0x505394=_0x31db17[_0x520a24(0x93)](isValidationResult);if(_0x505394['length']===0x0)return console[_0x520a24(0x8d)](a26_0x36bb32['yellow'](_0x520a24(0xa6)+_0x43f652+'\x0a')),_0x2e0133['skippedCount']>0x0&&console[_0x520a24(0x8d)](a26_0x36bb32['dim']('('+_0x2e0133['skippedCount']+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0xee42a7 of _0x31db17){if(!isValidationResult(_0xee42a7)){_0x3158d0[_0x520a24(0xab)]&&console[_0x520a24(0xb1)](a26_0x36bb32['dim']('-\x20'+_0xee42a7[_0x520a24(0xae)]+'\x20(skipped:\x20'+_0xee42a7[_0x520a24(0x97)]+')'));continue;}const {relativePath:_0x9dc28d,source:_0x5cd80f,result:_0x174f88}=_0xee42a7;if(_0x174f88[_0x520a24(0x9e)]&&_0x174f88['warnings'][_0x520a24(0x87)]===0x0)_0x3158d0[_0x520a24(0xab)]&&console[_0x520a24(0xb1)](a26_0x36bb32[_0x520a24(0xa5)]('✔\x20'+_0x9dc28d));else _0x174f88['valid']?(console[_0x520a24(0xb1)](a26_0x36bb32[_0x520a24(0x90)]('⚠\x20'+_0x9dc28d+':\x20'+_0x174f88[_0x520a24(0xb0)]['length']+_0x520a24(0xb3))),console[_0x520a24(0xb1)](formatValidationResult(_0x174f88,_0x5cd80f,_0x9dc28d))):(console[_0x520a24(0xb1)](a26_0x36bb32[_0x520a24(0x9a)]('✖\x20'+_0x9dc28d+':\x20'+_0x174f88[_0x520a24(0xb4)][_0x520a24(0x87)]+_0x520a24(0x99))),console[_0x520a24(0xb1)](formatValidationResult(_0x174f88,_0x5cd80f,_0x9dc28d)));}return console['log'](''),_0x2e0133[_0x520a24(0x95)]?(console['log'](a26_0x36bb32[_0x520a24(0x9a)](_0x520a24(0xaf)+_0x2e0133[_0x520a24(0x88)]+_0x520a24(0xa4)+_0x2e0133[_0x520a24(0x9d)]+_0x520a24(0x8a))),_0x2e0133['warningCount']>0x0&&console[_0x520a24(0xb1)](a26_0x36bb32['yellow'](_0x2e0133[_0x520a24(0x96)]+_0x520a24(0xb2))),_0x2e0133[_0x520a24(0x94)]>0x0&&console[_0x520a24(0xb1)](a26_0x36bb32[_0x520a24(0x8e)](_0x2e0133[_0x520a24(0x94)]+_0x520a24(0xa0))),0x1):(console[_0x520a24(0xb1)](a26_0x36bb32[_0x520a24(0xa5)](_0x520a24(0x84)+_0x2e0133[_0x520a24(0x9d)]+'\x20template(s)\x20valid')),_0x2e0133[_0x520a24(0x96)]>0x0&&console[_0x520a24(0xb1)](a26_0x36bb32[_0x520a24(0x90)](_0x2e0133[_0x520a24(0x96)]+'\x20warning(s)\x20found')),_0x2e0133[_0x520a24(0x94)]>0x0&&console[_0x520a24(0xb1)](a26_0x36bb32[_0x520a24(0x8e)](_0x2e0133['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x442de4=a27_0x3a3c;(function(_0x3e1507,_0x428d72){const _0x398712=a27_0x3a3c,_0x336d94=_0x3e1507();while(!![]){try{const _0x28fd29=-parseInt(_0x398712(0xdc))/0x1+-parseInt(_0x398712(0xd9))/0x2+-parseInt(_0x398712(0xb8))/0x3+-parseInt(_0x398712(0xb1))/0x4+parseInt(_0x398712(0xaa))/0x5*(-parseInt(_0x398712(0xe0))/0x6)+parseInt(_0x398712(0xc6))/0x7+parseInt(_0x398712(0xa4))/0x8;if(_0x28fd29===_0x428d72)break;else _0x336d94['push'](_0x336d94['shift']());}catch(_0x4fa5ad){_0x336d94['push'](_0x336d94['shift']());}}}(a27_0x582c,0x77ff5));function a27_0x3a3c(_0x3eb5ab,_0x46e773){_0x3eb5ab=_0x3eb5ab-0x92;const _0x582cb3=a27_0x582c();let _0x3a3c96=_0x582cb3[_0x3eb5ab];return _0x3a3c96;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x28b99f from'chalk';function formatDuration(_0x471b7){const _0x2b987f=a27_0x3a3c;if(_0x471b7<0x3c)return _0x471b7+'s';if(_0x471b7<0xe10)return Math['floor'](_0x471b7/0x3c)+'m\x20'+_0x471b7%0x3c+'s';const _0x42daf5=Math[_0x2b987f(0xa6)](_0x471b7/0xe10),_0x17be6e=Math[_0x2b987f(0xa6)](_0x471b7%0xe10/0x3c);return _0x17be6e>0x0?_0x42daf5+'h\x20'+_0x17be6e+'m':_0x42daf5+'h';}function formatRelativeTime(_0x4a1f6c){const _0x3a88ed=a27_0x3a3c,_0x6afe12=Date[_0x3a88ed(0xe1)]()-_0x4a1f6c['getTime'](),_0x398014=Math[_0x3a88ed(0xa6)](Math['abs'](_0x6afe12)/0x3e8);if(_0x398014<0x3c)return _0x3a88ed(0xae);const _0x4d7751=Math[_0x3a88ed(0xa6)](_0x398014/0x3c);if(_0x4d7751<0x3c)return _0x4d7751+_0x3a88ed(0xe4);const _0x8af203=Math[_0x3a88ed(0xa6)](_0x4d7751/0x3c);if(_0x8af203<0x18)return _0x8af203+'h\x20ago';const _0x527766=Math[_0x3a88ed(0xa6)](_0x8af203/0x18);if(_0x527766<0x1e)return _0x527766+'d\x20ago';return Math['floor'](_0x527766/0x1e)+_0x3a88ed(0xd3);}export class JobListCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xba);[a27_0x442de4(0xe7)]=a27_0x442de4(0xda);async[a27_0x442de4(0xcf)](_0xfbba7d){const _0xe32e18=a27_0x442de4,{options:_0x4f51c6,tdx:_0x5145b6}=_0xfbba7d,_0x40db22=resolveLimit(_0x4f51c6[_0xe32e18(0xc4)],DEFAULT_DISPLAY_LIMIT),_0x2a20ae=_0x4f51c6[_0xe32e18(0xd4)];_0x4f51c6[_0xe32e18(0xb7)]&&(console[_0xe32e18(0xbc)](_0xe32e18(0xa8)+_0x40db22+'\x20jobs'),_0x2a20ae&&console[_0xe32e18(0xbc)](_0xe32e18(0xa2)+_0x2a20ae));const _0x241006=await withSpinner(_0xe32e18(0xd2),()=>_0x5145b6[_0xe32e18(0xba)][_0xe32e18(0x9b)]({'from':0x0,'to':_0x40db22-0x1,'status':_0x2a20ae}),{'verbose':_0x4f51c6['verbose']}),_0x5d7b0a=_0x241006[_0xe32e18(0x9c)];console[_0xe32e18(0xbc)](_0xe32e18(0xe3)+_0x5d7b0a['length']+_0xe32e18(0xab)+(_0x5d7b0a[_0xe32e18(0x95)]!==0x1?'s':''));const _0x27e356=_0x4f51c6[_0xe32e18(0x9d)];if(isStructuredFormat(_0x4f51c6)){const _0x57a2be=_0x5d7b0a['map'](_0x1e5f66=>{const _0x49835a=_0xe32e18;let _0x3e9873;if(_0x1e5f66[_0x49835a(0x9e)]&&_0x1e5f66[_0x49835a(0xc2)]){const _0x30aa9a=new Date(_0x1e5f66[_0x49835a(0x9e)])[_0x49835a(0xb2)](),_0x1307ee=new Date(_0x1e5f66[_0x49835a(0xc2)])[_0x49835a(0xb2)]();_0x3e9873=Math[_0x49835a(0xac)]((_0x1307ee-_0x30aa9a)/0x3e8);}return{'job_id':_0x1e5f66[_0x49835a(0xad)],'type':_0x1e5f66[_0x49835a(0xd6)]===_0x49835a(0x99)?_0x49835a(0xaf):_0x1e5f66[_0x49835a(0xd6)],'status':_0x1e5f66[_0x49835a(0xd4)],'user_name':_0x1e5f66[_0x49835a(0xde)],'duration_sec':_0x3e9873,'created_at':_0x1e5f66[_0x49835a(0xbf)],'started_at':_0x1e5f66[_0x49835a(0x9e)],'end_at':_0x1e5f66[_0x49835a(0xc2)]};});await handleSDKOutput(_0x57a2be,_0x4f51c6);}else for(const _0x375217 of _0x5d7b0a){const _0x5ddf3f=_0x375217[_0xe32e18(0xd4)]===_0xe32e18(0xc8)?a27_0x28b99f[_0xe32e18(0xcb)]:_0x375217[_0xe32e18(0xd4)]===_0xe32e18(0xbc)?a27_0x28b99f[_0xe32e18(0x97)]:a27_0x28b99f[_0xe32e18(0xa7)],_0x137c2e=_0x5ddf3f(_0x375217['status']),_0x24dd12=getJobUrl(_0x27e356,_0x375217[_0xe32e18(0xad)]),_0xe1ddb5=hyperlink(_0x375217[_0xe32e18(0xad)],_0x24dd12),_0x569806=a27_0x28b99f['dim'](_0x375217['type']===_0xe32e18(0x99)?_0xe32e18(0xaf):_0x375217['type']),_0x2f12e6=[];if(_0x375217[_0xe32e18(0x9e)]&&_0x375217[_0xe32e18(0xc2)]){const _0x3ee344=Math[_0xe32e18(0xac)]((new Date(_0x375217[_0xe32e18(0xc2)])[_0xe32e18(0xb2)]()-new Date(_0x375217['start_at'])[_0xe32e18(0xb2)]())/0x3e8);_0x2f12e6['push'](formatDuration(_0x3ee344));}if(_0x375217['end_at'])_0x2f12e6[_0xe32e18(0xcd)](formatRelativeTime(new Date(_0x375217[_0xe32e18(0xc2)])));else _0x375217[_0xe32e18(0x9e)]&&_0x2f12e6['push'](formatRelativeTime(new Date(_0x375217[_0xe32e18(0x9e)])));const _0x28a9df=_0x2f12e6[_0xe32e18(0x95)]>0x0?a27_0x28b99f['dim']('\x20'+_0x2f12e6[_0xe32e18(0xbd)](',\x20')):'';console['log']('⚡\x20'+_0xe1ddb5+'\x20'+_0x569806+'\x20'+_0x137c2e+_0x28a9df);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x442de4(0xd1)]='job:show';[a27_0x442de4(0xe7)]=a27_0x442de4(0xe5);['validate'](_0x3f854c){const _0x4630a5=a27_0x442de4,_0x42a961=_0x3f854c[_0x4630a5(0xd7)][0x0];if(!_0x42a961)return _0x4630a5(0xdb);return undefined;}async['execute'](_0x426d90){const _0x5e4815=a27_0x442de4,{options:_0x5595ba,args:_0x26a0e2,tdx:_0x5a7928}=_0x426d90,_0xb728bc=_0x26a0e2[0x0],_0x69b054=await withSpinner(_0x5e4815(0xd0),()=>_0x5a7928[_0x5e4815(0xba)][_0x5e4815(0xdf)](_0xb728bc),{'verbose':_0x5595ba['verbose']}),_0x3cf9cb=_0x69b054[_0x5e4815(0x9c)];let _0x5ac279;if(_0x3cf9cb[_0x5e4815(0x9e)]&&_0x3cf9cb[_0x5e4815(0xc2)]){const _0x511426=new Date(_0x3cf9cb['start_at'])[_0x5e4815(0xb2)](),_0x2198e1=new Date(_0x3cf9cb['end_at'])[_0x5e4815(0xb2)]();_0x5ac279=Math[_0x5e4815(0xac)]((_0x2198e1-_0x511426)/0x3e8);}const _0x2ca293={'job_id':_0x3cf9cb[_0x5e4815(0xad)],'type':_0x3cf9cb[_0x5e4815(0xd6)],'status':_0x3cf9cb[_0x5e4815(0xd4)],..._0x3cf9cb[_0x5e4815(0xde)]&&{'user_name':_0x3cf9cb[_0x5e4815(0xde)]},..._0x5ac279!==undefined&&{'duration_sec':_0x5ac279},..._0x3cf9cb[_0x5e4815(0xbf)]&&{'created_at':_0x3cf9cb[_0x5e4815(0xbf)]},..._0x3cf9cb[_0x5e4815(0x9e)]&&{'started_at':_0x3cf9cb[_0x5e4815(0x9e)]},..._0x3cf9cb[_0x5e4815(0xc2)]&&{'end_at':_0x3cf9cb[_0x5e4815(0xc2)]},..._0x3cf9cb['database']&&{'database':_0x3cf9cb[_0x5e4815(0xb5)]},..._0x3cf9cb[_0x5e4815(0xa0)]!==undefined&&{'priority':_0x3cf9cb[_0x5e4815(0xa0)]},..._0x3cf9cb[_0x5e4815(0xc7)]&&{'url':_0x3cf9cb['url']},..._0x3cf9cb[_0x5e4815(0xce)]&&{'query':_0x3cf9cb['query']},..._0x3cf9cb[_0x5e4815(0x94)]&&{'debug':_0x3cf9cb[_0x5e4815(0x94)]}};return await handleSingleObjectOutput(_0x2ca293,_0x5595ba),0x0;}}function a27_0x582c(){const _0x2a2eda=['2508116Befely','getTime','information_schema','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','database','Submit\x20a\x20job','verbose','1051443sbgTkw','hive','jobs','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','error','join','...','created_at','job:submit','\x27\x20to\x20verify\x20the\x20job\x20status','end_at','validate','limit','Job\x20type:\x20','2390829pduXFt','url','success','Query:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','green','Cancelled','push','query','execute','Getting\x20job\x20details...','name','Listing\x20jobs...','mo\x20ago','status','\x20\x20Job\x20ID:\x20','type','args','✔\x20Retrieved\x20','1954548YKSsec','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','630627RCoRtL','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','user_name','show','6ZENkRH','now','Get\x20job\x20results','✔\x20Found\x20','m\x20ago','Show\x20job\x20details','job:result','description','jobType','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','file','debug','length','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','red','Kill\x20a\x20job','presto','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','list','data','site','start_at','Submitting\x20job...','priority','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Status\x20filter:\x20','INVALID_ARGUMENT','28193728iAbyvA','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','floor','dim','Limit:\x20','substring','3944215VaJLTS','\x20job','round','job_id','just\x20now','trino','result'];a27_0x582c=function(){return _0x2a2eda;};return a27_0x582c();}export class JobKillCommand extends BaseCommand{['name']='job:kill';['description']=a27_0x442de4(0x98);['validate'](_0x4c56cb){const _0x39811e=a27_0x442de4,_0x5dc34b=_0x4c56cb[_0x39811e(0xd7)][0x0];if(!_0x5dc34b)return _0x39811e(0x96);return undefined;}async[a27_0x442de4(0xcf)](_0x14bb32){const _0x447642=a27_0x442de4,{options:_0x1c1712,args:_0xed0273,tdx:_0x1b9e66}=_0x14bb32,_0x36099e=_0xed0273[0x0];if(!_0x1c1712['yes']){const _0x36b397=await confirm(_0x447642(0xb4)+_0x36099e+'?');if(!_0x36b397)return console[_0x447642(0xbc)](_0x447642(0xcc)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x1b9e66[_0x447642(0xba)]['kill'](_0x36099e),{'verbose':_0x1c1712[_0x447642(0xb7)]}),console[_0x447642(0xbc)](_0x447642(0x92)+_0x36099e),console[_0x447642(0xbc)](_0x447642(0xca)+_0x36099e+_0x447642(0xc1)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xc0);['description']=a27_0x442de4(0xb6);async[a27_0x442de4(0xcf)](_0x138a2c){const _0x9a24b4=a27_0x442de4,{options:_0x47f27a,args:_0x324092,tdx:_0xaeb696}=_0x138a2c,_0x58b160=_0x47f27a[_0x9a24b4(0xe8)]||_0x9a24b4(0xaf),_0x590aaa=_0x47f27a[_0x9a24b4(0x93)],_0x26191f=_0x47f27a['database']||_0x9a24b4(0xb3),_0x5230dc=_0x47f27a['result'];if(_0x58b160!==_0x9a24b4(0xaf)&&_0x58b160!==_0x9a24b4(0xb9))throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xa1));let _0x3d2474;if(_0x590aaa){if(_0x324092[0x0])throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xbb));const _0x310d6d=readSqlStatementsFromFile(_0x590aaa);if(_0x310d6d[_0x9a24b4(0x95)]===0x0)throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x310d6d[_0x9a24b4(0x95)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x9a24b4(0x9a));_0x3d2474=_0x310d6d[0x0];}else{if(!_0x324092[0x0])throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xa5));_0x3d2474=_0x324092[0x0];}_0x47f27a['verbose']&&(console[_0x9a24b4(0xbc)](_0x9a24b4(0xc5)+_0x58b160),console[_0x9a24b4(0xbc)]('Database:\x20'+_0x26191f),console[_0x9a24b4(0xbc)](_0x9a24b4(0xc9)+_0x3d2474[_0x9a24b4(0xa9)](0x0,0x64)+(_0x3d2474['length']>0x64?_0x9a24b4(0xbe):'')));const _0x2bf56f=await withSpinner(_0x9a24b4(0x9f),()=>_0xaeb696[_0x9a24b4(0xba)]['submit'](_0x26191f,_0x3d2474,_0x58b160,_0x5230dc),{'verbose':_0x47f27a['verbose']}),_0x59086f=_0x2bf56f[_0x9a24b4(0x9c)];return console[_0x9a24b4(0xbc)]('✔\x20Job\x20submitted'),console[_0x9a24b4(0xbc)](_0x9a24b4(0xd5)+_0x59086f['job_id']),await handleSDKOutput([_0x59086f],_0x47f27a),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xe6);[a27_0x442de4(0xe7)]=a27_0x442de4(0xe2);[a27_0x442de4(0xc3)](_0x31e154){const _0x5b7f49=a27_0x442de4,_0x7a33f5=_0x31e154[_0x5b7f49(0xd7)][0x0];if(!_0x7a33f5)return _0x5b7f49(0xdd);return undefined;}async[a27_0x442de4(0xcf)](_0x5bfa92){const _0xddf19b=a27_0x442de4,{options:_0x503bf2,args:_0x54cea7,tdx:_0x2c1078}=_0x5bfa92,_0x3cf430=_0x54cea7[0x0],_0x2a6d37=await withSpinner('Getting\x20job\x20results...',()=>_0x2c1078['jobs'][_0xddf19b(0xb0)](_0x3cf430),{'verbose':_0x503bf2[_0xddf19b(0xb7)]}),_0xa0abfe=_0x2a6d37['data'];return console[_0xddf19b(0xbc)](_0xddf19b(0xd8)+_0xa0abfe[_0xddf19b(0x95)]+'\x20row'+(_0xa0abfe[_0xddf19b(0x95)]!==0x1?'s':'')),await handleSDKOutput(_0xa0abfe,_0x503bf2),0x0;}}
|
|
1
|
+
const a27_0x5b3b81=a27_0x1e53;(function(_0x8c8eb4,_0xc0ad47){const _0x8a945a=a27_0x1e53,_0x35b8bf=_0x8c8eb4();while(!![]){try{const _0x295c4e=parseInt(_0x8a945a(0x201))/0x1*(parseInt(_0x8a945a(0x1d1))/0x2)+parseInt(_0x8a945a(0x1f4))/0x3+-parseInt(_0x8a945a(0x20d))/0x4*(-parseInt(_0x8a945a(0x1be))/0x5)+parseInt(_0x8a945a(0x1ca))/0x6+parseInt(_0x8a945a(0x1df))/0x7*(-parseInt(_0x8a945a(0x1db))/0x8)+-parseInt(_0x8a945a(0x1c0))/0x9*(parseInt(_0x8a945a(0x1c9))/0xa)+-parseInt(_0x8a945a(0x1bf))/0xb;if(_0x295c4e===_0xc0ad47)break;else _0x35b8bf['push'](_0x35b8bf['shift']());}catch(_0x45ae8b){_0x35b8bf['push'](_0x35b8bf['shift']());}}}(a27_0x546a,0x4da8c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a27_0x1e53(_0xc6a5fc,_0x1000bb){_0xc6a5fc=_0xc6a5fc-0x1b4;const _0x546af6=a27_0x546a();let _0x1e53b4=_0x546af6[_0xc6a5fc];return _0x1e53b4;}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x546a(){const _0xe55675=['url','start_at','validate','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','mo\x20ago','execute','job:submit','job:kill','submit','Limit:\x20','430MrXvEB','4773824trePRj','9AClExP','Submit\x20a\x20job','✔\x20Retrieved\x20','Database:\x20','join','data','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','just\x20now','m\x20ago','4009420iYNAGq','2269164hsXPxt','debug','push','✔\x20Found\x20','Query:\x20','status','Job\x20type:\x20','7382RFIURM','green','result','floor','jobType','limit','List\x20jobs','jobs','kill','\x20jobs','72CiLgrj','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','error','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','454153WyOXcO','args','Cancelled','name','type','\x20row','red','Listing\x20jobs...','trino','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submitting\x20job...','presto','Submitting\x20kill\x20request...','log','job:show','\x20\x20Job\x20ID:\x20','user_name','priority','INVALID_ARGUMENT','\x27\x20to\x20verify\x20the\x20job\x20status','✔\x20Job\x20submitted','1744218jeVtqx','getTime','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','length','map','round','database','site','job:result','job_id','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','dim','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','65KcaHlA','Status\x20filter:\x20','end_at','h\x20ago','Kill\x20a\x20job','Show\x20job\x20details','verbose','description','Getting\x20job\x20results...','yes','created_at','query','24996zOgoYs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','abs'];a27_0x546a=function(){return _0xe55675;};return a27_0x546a();}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x22e766 from'chalk';function formatDuration(_0x3c3cc7){if(_0x3c3cc7<0x3c)return _0x3c3cc7+'s';if(_0x3c3cc7<0xe10)return Math['floor'](_0x3c3cc7/0x3c)+'m\x20'+_0x3c3cc7%0x3c+'s';const _0x4c5424=Math['floor'](_0x3c3cc7/0xe10),_0x4f7fff=Math['floor'](_0x3c3cc7%0xe10/0x3c);return _0x4f7fff>0x0?_0x4c5424+'h\x20'+_0x4f7fff+'m':_0x4c5424+'h';}function formatRelativeTime(_0x230c54){const _0x11873c=a27_0x1e53,_0x12d959=Date['now']()-_0x230c54['getTime'](),_0x2203de=Math['floor'](Math[_0x11873c(0x20f)](_0x12d959)/0x3e8);if(_0x2203de<0x3c)return _0x11873c(0x1c7);const _0x109e62=Math['floor'](_0x2203de/0x3c);if(_0x109e62<0x3c)return _0x109e62+_0x11873c(0x1c8);const _0x356cbd=Math[_0x11873c(0x1d4)](_0x109e62/0x3c);if(_0x356cbd<0x18)return _0x356cbd+_0x11873c(0x204);const _0x27fae1=Math[_0x11873c(0x1d4)](_0x356cbd/0x18);if(_0x27fae1<0x1e)return _0x27fae1+'d\x20ago';return Math[_0x11873c(0x1d4)](_0x27fae1/0x1e)+_0x11873c(0x1b8);}export class JobListCommand extends BaseCommand{[a27_0x5b3b81(0x1e2)]=a27_0x5b3b81(0x1d8);[a27_0x5b3b81(0x208)]=a27_0x5b3b81(0x1d7);async[a27_0x5b3b81(0x1b9)](_0x1ca7b8){const _0x3bbf05=a27_0x5b3b81,{options:_0x4f06f8,tdx:_0x236e9b}=_0x1ca7b8,_0xf94034=resolveLimit(_0x4f06f8[_0x3bbf05(0x1d6)],DEFAULT_DISPLAY_LIMIT),_0x223a01=_0x4f06f8[_0x3bbf05(0x1cf)];_0x4f06f8[_0x3bbf05(0x207)]&&(console[_0x3bbf05(0x1dd)](_0x3bbf05(0x1bd)+_0xf94034+_0x3bbf05(0x1da)),_0x223a01&&console[_0x3bbf05(0x1dd)](_0x3bbf05(0x202)+_0x223a01));const _0x442e63=await withSpinner(_0x3bbf05(0x1e6),()=>_0x236e9b[_0x3bbf05(0x1d8)]['list']({'from':0x0,'to':_0xf94034-0x1,'status':_0x223a01}),{'verbose':_0x4f06f8[_0x3bbf05(0x207)]}),_0x3adb01=_0x442e63[_0x3bbf05(0x1c5)];console[_0x3bbf05(0x1dd)](_0x3bbf05(0x1cd)+_0x3adb01['length']+'\x20job'+(_0x3adb01[_0x3bbf05(0x1f7)]!==0x1?'s':''));const _0x28447d=_0x4f06f8[_0x3bbf05(0x1fb)];if(isStructuredFormat(_0x4f06f8)){const _0x16daab=_0x3adb01[_0x3bbf05(0x1f8)](_0x337cd9=>{const _0x1f17a1=_0x3bbf05;let _0x99a290;if(_0x337cd9[_0x1f17a1(0x1b5)]&&_0x337cd9[_0x1f17a1(0x203)]){const _0x1c9ff4=new Date(_0x337cd9[_0x1f17a1(0x1b5)])[_0x1f17a1(0x1f5)](),_0x27fac8=new Date(_0x337cd9['end_at'])[_0x1f17a1(0x1f5)]();_0x99a290=Math[_0x1f17a1(0x1f9)]((_0x27fac8-_0x1c9ff4)/0x3e8);}return{'job_id':_0x337cd9['job_id'],'type':_0x337cd9[_0x1f17a1(0x1e3)]==='presto'?'trino':_0x337cd9['type'],'status':_0x337cd9[_0x1f17a1(0x1cf)],'user_name':_0x337cd9['user_name'],'duration_sec':_0x99a290,'created_at':_0x337cd9[_0x1f17a1(0x20b)],'started_at':_0x337cd9[_0x1f17a1(0x1b5)],'end_at':_0x337cd9[_0x1f17a1(0x203)]};});await handleSDKOutput(_0x16daab,_0x4f06f8);}else for(const _0x451ba4 of _0x3adb01){const _0x342351=_0x451ba4[_0x3bbf05(0x1cf)]==='success'?a27_0x22e766[_0x3bbf05(0x1d2)]:_0x451ba4[_0x3bbf05(0x1cf)]===_0x3bbf05(0x1dd)?a27_0x22e766[_0x3bbf05(0x1e5)]:a27_0x22e766[_0x3bbf05(0x1ff)],_0x10f4ff=_0x342351(_0x451ba4[_0x3bbf05(0x1cf)]),_0x1230d0=getJobUrl(_0x28447d,_0x451ba4[_0x3bbf05(0x1fd)]),_0x4da389=hyperlink(_0x451ba4[_0x3bbf05(0x1fd)],_0x1230d0),_0xfce848=a27_0x22e766[_0x3bbf05(0x1ff)](_0x451ba4[_0x3bbf05(0x1e3)]===_0x3bbf05(0x1ea)?_0x3bbf05(0x1e7):_0x451ba4[_0x3bbf05(0x1e3)]),_0x1a8dd8=[];if(_0x451ba4[_0x3bbf05(0x1b5)]&&_0x451ba4[_0x3bbf05(0x203)]){const _0x4af3dd=Math[_0x3bbf05(0x1f9)]((new Date(_0x451ba4['end_at'])[_0x3bbf05(0x1f5)]()-new Date(_0x451ba4[_0x3bbf05(0x1b5)])[_0x3bbf05(0x1f5)]())/0x3e8);_0x1a8dd8['push'](formatDuration(_0x4af3dd));}if(_0x451ba4[_0x3bbf05(0x203)])_0x1a8dd8[_0x3bbf05(0x1cc)](formatRelativeTime(new Date(_0x451ba4[_0x3bbf05(0x203)])));else _0x451ba4[_0x3bbf05(0x1b5)]&&_0x1a8dd8[_0x3bbf05(0x1cc)](formatRelativeTime(new Date(_0x451ba4['start_at'])));const _0x102562=_0x1a8dd8[_0x3bbf05(0x1f7)]>0x0?a27_0x22e766[_0x3bbf05(0x1ff)]('\x20'+_0x1a8dd8[_0x3bbf05(0x1c4)](',\x20')):'';console[_0x3bbf05(0x1ec)]('⚡\x20'+_0x4da389+'\x20'+_0xfce848+'\x20'+_0x10f4ff+_0x102562);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a27_0x5b3b81(0x1ed);[a27_0x5b3b81(0x208)]=a27_0x5b3b81(0x206);[a27_0x5b3b81(0x1b6)](_0x3f1aa0){const _0x4f6aae=a27_0x5b3b81,_0x1fbe8c=_0x3f1aa0[_0x4f6aae(0x1e0)][0x0];if(!_0x1fbe8c)return _0x4f6aae(0x1de);return undefined;}async[a27_0x5b3b81(0x1b9)](_0x477cbe){const _0x25ff88=a27_0x5b3b81,{options:_0xe2e90c,args:_0x11fe55,tdx:_0x10edd9}=_0x477cbe,_0x77ddc9=_0x11fe55[0x0],_0x13eafe=await withSpinner('Getting\x20job\x20details...',()=>_0x10edd9[_0x25ff88(0x1d8)]['show'](_0x77ddc9),{'verbose':_0xe2e90c[_0x25ff88(0x207)]}),_0x2dcec5=_0x13eafe[_0x25ff88(0x1c5)];let _0x1539be;if(_0x2dcec5[_0x25ff88(0x1b5)]&&_0x2dcec5[_0x25ff88(0x203)]){const _0x48e45f=new Date(_0x2dcec5['start_at'])[_0x25ff88(0x1f5)](),_0x575fde=new Date(_0x2dcec5['end_at'])['getTime']();_0x1539be=Math['round']((_0x575fde-_0x48e45f)/0x3e8);}const _0x2ae191={'job_id':_0x2dcec5[_0x25ff88(0x1fd)],'type':_0x2dcec5[_0x25ff88(0x1e3)],'status':_0x2dcec5[_0x25ff88(0x1cf)],..._0x2dcec5[_0x25ff88(0x1ef)]&&{'user_name':_0x2dcec5[_0x25ff88(0x1ef)]},..._0x1539be!==undefined&&{'duration_sec':_0x1539be},..._0x2dcec5['created_at']&&{'created_at':_0x2dcec5[_0x25ff88(0x20b)]},..._0x2dcec5[_0x25ff88(0x1b5)]&&{'started_at':_0x2dcec5[_0x25ff88(0x1b5)]},..._0x2dcec5[_0x25ff88(0x203)]&&{'end_at':_0x2dcec5[_0x25ff88(0x203)]},..._0x2dcec5['database']&&{'database':_0x2dcec5[_0x25ff88(0x1fa)]},..._0x2dcec5[_0x25ff88(0x1f0)]!==undefined&&{'priority':_0x2dcec5[_0x25ff88(0x1f0)]},..._0x2dcec5[_0x25ff88(0x1b4)]&&{'url':_0x2dcec5['url']},..._0x2dcec5[_0x25ff88(0x20c)]&&{'query':_0x2dcec5[_0x25ff88(0x20c)]},..._0x2dcec5[_0x25ff88(0x1cb)]&&{'debug':_0x2dcec5[_0x25ff88(0x1cb)]}};return await handleSingleObjectOutput(_0x2ae191,_0xe2e90c),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x5b3b81(0x1e2)]=a27_0x5b3b81(0x1bb);[a27_0x5b3b81(0x208)]=a27_0x5b3b81(0x205);['validate'](_0x3e4044){const _0x3cdc9a=a27_0x5b3b81,_0x2aed49=_0x3e4044['args'][0x0];if(!_0x2aed49)return _0x3cdc9a(0x1f6);return undefined;}async[a27_0x5b3b81(0x1b9)](_0x421072){const _0x505ec4=a27_0x5b3b81,{options:_0x1735b3,args:_0x14d1ea,tdx:_0x3e9b9}=_0x421072,_0x343f0=_0x14d1ea[0x0];if(!_0x1735b3[_0x505ec4(0x20a)]){const _0x4f1de2=await confirm(_0x505ec4(0x200)+_0x343f0+'?');if(!_0x4f1de2)return console['error'](_0x505ec4(0x1e1)),0x0;}return await withSpinner(_0x505ec4(0x1eb),()=>_0x3e9b9[_0x505ec4(0x1d8)][_0x505ec4(0x1d9)](_0x343f0),{'verbose':_0x1735b3[_0x505ec4(0x207)]}),console[_0x505ec4(0x1dd)](_0x505ec4(0x1c6)+_0x343f0),console[_0x505ec4(0x1dd)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x343f0+_0x505ec4(0x1f2)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x5b3b81(0x1e2)]=a27_0x5b3b81(0x1ba);[a27_0x5b3b81(0x208)]=a27_0x5b3b81(0x1c1);async[a27_0x5b3b81(0x1b9)](_0x660291){const _0x264932=a27_0x5b3b81,{options:_0x6cb9d8,args:_0x533840,tdx:_0x4de45d}=_0x660291,_0x3eb3fd=_0x6cb9d8[_0x264932(0x1d5)]||_0x264932(0x1e7),_0x163499=_0x6cb9d8['file'],_0x4b49c7=_0x6cb9d8[_0x264932(0x1fa)]||'information_schema',_0x2c8d00=_0x6cb9d8['result'];if(_0x3eb3fd!==_0x264932(0x1e7)&&_0x3eb3fd!=='hive')throw new SDKError(ErrorCode[_0x264932(0x1f1)],_0x264932(0x1b7));let _0x1931ed;if(_0x163499){if(_0x533840[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x264932(0x1e8));const _0x1f4be3=readSqlStatementsFromFile(_0x163499);if(_0x1f4be3[_0x264932(0x1f7)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x1f4be3[_0x264932(0x1f7)]>0x1)throw new SDKError(ErrorCode[_0x264932(0x1f1)],_0x264932(0x1dc));_0x1931ed=_0x1f4be3[0x0];}else{if(!_0x533840[0x0])throw new SDKError(ErrorCode[_0x264932(0x1f1)],_0x264932(0x1fe));_0x1931ed=_0x533840[0x0];}_0x6cb9d8['verbose']&&(console[_0x264932(0x1dd)](_0x264932(0x1d0)+_0x3eb3fd),console[_0x264932(0x1dd)](_0x264932(0x1c3)+_0x4b49c7),console[_0x264932(0x1dd)](_0x264932(0x1ce)+_0x1931ed['substring'](0x0,0x64)+(_0x1931ed[_0x264932(0x1f7)]>0x64?'...':'')));const _0x2bc695=await withSpinner(_0x264932(0x1e9),()=>_0x4de45d[_0x264932(0x1d8)][_0x264932(0x1bc)](_0x4b49c7,_0x1931ed,_0x3eb3fd,_0x2c8d00),{'verbose':_0x6cb9d8[_0x264932(0x207)]}),_0xf5f8f3=_0x2bc695[_0x264932(0x1c5)];return console[_0x264932(0x1dd)](_0x264932(0x1f3)),console[_0x264932(0x1dd)](_0x264932(0x1ee)+_0xf5f8f3[_0x264932(0x1fd)]),await handleSDKOutput([_0xf5f8f3],_0x6cb9d8),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x5b3b81(0x1e2)]=a27_0x5b3b81(0x1fc);[a27_0x5b3b81(0x208)]='Get\x20job\x20results';[a27_0x5b3b81(0x1b6)](_0x5f9a76){const _0x2165b4=a27_0x5b3b81,_0x2f11d2=_0x5f9a76[_0x2165b4(0x1e0)][0x0];if(!_0x2f11d2)return _0x2165b4(0x20e);return undefined;}async[a27_0x5b3b81(0x1b9)](_0x527008){const _0x2fdd75=a27_0x5b3b81,{options:_0x5a7106,args:_0x2088d0,tdx:_0x2c96a7}=_0x527008,_0x23ce97=_0x2088d0[0x0],_0x19af72=await withSpinner(_0x2fdd75(0x209),()=>_0x2c96a7[_0x2fdd75(0x1d8)][_0x2fdd75(0x1d3)](_0x23ce97),{'verbose':_0x5a7106[_0x2fdd75(0x207)]}),_0x325659=_0x19af72[_0x2fdd75(0x1c5)];return console[_0x2fdd75(0x1dd)](_0x2fdd75(0x1c2)+_0x325659[_0x2fdd75(0x1f7)]+_0x2fdd75(0x1e4)+(_0x325659[_0x2fdd75(0x1f7)]!==0x1?'s':'')),await handleSDKOutput(_0x325659,_0x5a7106),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a28_0x8121c3=a28_0x1d56;(function(_0x3e555c,_0xf479a7){const _0x38261c=a28_0x1d56,_0x5542d3=_0x3e555c();while(!![]){try{const _0x43e27d=parseInt(_0x38261c(0x28e))/0x1*(-parseInt(_0x38261c(0x230))/0x2)+parseInt(_0x38261c(0x20e))/0x3+parseInt(_0x38261c(0x276))/0x4*(-parseInt(_0x38261c(0x2b5))/0x5)+parseInt(_0x38261c(0x1e2))/0x6*(-parseInt(_0x38261c(0x289))/0x7)+-parseInt(_0x38261c(0x243))/0x8*(-parseInt(_0x38261c(0x1ea))/0x9)+parseInt(_0x38261c(0x2b4))/0xa*(-parseInt(_0x38261c(0x22b))/0xb)+parseInt(_0x38261c(0x268))/0xc;if(_0x43e27d===_0xf479a7)break;else _0x5542d3['push'](_0x5542d3['shift']());}catch(_0xc4852e){_0x5542d3['push'](_0x5542d3['shift']());}}}(a28_0x1230,0x6e371));import a28_0x302f34 from'chalk';import a28_0x1221b1 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';function a28_0x1d56(_0x4d69a8,_0xf440ff){_0x4d69a8=_0x4d69a8-0x1c9;const _0x1230f9=a28_0x1230();let _0x1d566b=_0x1230f9[_0x4d69a8];return _0x1d566b;}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';function a28_0x1230(){const _0x2f5e54=['reentryMode','size','✔\x20Pulled\x20','\x22\x20resumed','buildIdToEmailMap','43373OwZJgs','No\x20statistics\x20available\x20for\x20journey:\x20','journey:versions','\x20\x20Consolidating\x20duplicate\x20segment:\x20','data','26tZtDag','folders','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','parentSegment','getColumnMapping','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','yellow','Listing\x20journey\x20versions...','stages','resume','renderStats','Parent\x20segment:\x20','journey:version:create','resolveSegment','Error:\x20Journey\x20\x27','table','options','stage','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','887064YjvOCK','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','web','rootFolderId','Resolved\x20YAML\x20file:\x20','goal','exitOrJumpSize','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Invalid\x20--type\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','errorCode','✔\x20Journey\x20\x22','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','bold','filePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','limit','connection','entries','test','createdAt','INVALID_ARGUMENT','journeyBundleId','Resolving\x20version...','cwd','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','relativePath','\x20\x20Parent\x20segment:\x20','journey:pull','version','has','connector_config','base','\x20journey','length','12753600QMVQaD','error','Show\x20journey\x20details','Getting\x20journey\x20details...','from','Error:\x20','dim','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Pausing\x20journey...','(running)','getSegment','completeMilestoneRate','(paused)','\x20=\x20','872uAIlxm','split','journeyStages','hasPeriod','then','\x20files?','replace','description','find','tsv','filter','nodes','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x5c$&','log','\x0aPull\x20summary:','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x20versions)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','14bZHnhk','type','no_parent','cyan','exitOrJumpRate','3061cyshfv','Target\x20directory:\x20','utf-8','\x20\x20Statistics\x20not\x20available','dryRun','pause','history','journey:push','set','journey:traffic','getTrafficData','/j/da/je','Error:\x20Journey\x20not\x20found:\x20','name','journey','(draft)','draft','Input:\x20','audienceId','\x27\x20not\x20found\x20in\x20','Cancelled','parentName','all','site','Error:\x20Stage\x20\x22','rule','updatedAt','toLowerCase','journeyId','\x20not\x20found.\x20Available:\x20','segment','\x20->\x20','journey:stats','List\x20journeys\x20in\x20current\x20context','targetDir','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Folder\x20path:\x20','goalSize','1490IHtXau','15685hwBCLr','\x0aError:','Fetching\x20parent\x20segment...','Database:\x20','blue','file','state','Resolving\x20journey...','Fetching\x20journeys\x20and\x20folders...','links','conversion',',\x20version:\x20','journeyName','join','Fetching\x20','content','\x20unchanged\x20files','format','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20new\x20files','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','message','segments','\x22\x20paused','helpText','completed','resolveJourneyId','segmentPushCommand','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','jsonl','activation','(root)','getJourney','\x20(ID:\x20','/app/ps/','\x0aChanges\x20to\x20\x27','tdx.json','-\x20no\x20files\x20written','🗺️\x20','archived','green','launched','folderPath','segmentName','red','\x20\x20Journey\x20ID:\x20','resourceName','470292YmgdVi','✔\x20Found\x20','args','user','yes','/e/','activation_','\x20version','9aKKRvb','attributes','versionNumber','Write\x20','Getting\x20journey\x20statistics...','Resolving\x20parent\x20segment...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','isNew','repeat','getLatestJourneyId','completionRate','journey:activations','paused','Options:','add','folderId','(archived)','resolveParentId','getStatistics','stageNameMap','get','createVersion','verbose','/j/da','Folder\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','hasChanges','push','milestoneSize','values','Show\x20journey\x20table\x20column\x20mapping','(completed)','map','enteredSize','Aborted.','✔\x20Context\x20set:\x20','2237064OrkMVW','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','json','includeStats','Getting\x20column\x20mapping...','Resume\x20a\x20paused\x20journey','✔\x20All\x20files\x20are\x20up\x20to\x20date','setPhase','execute','journeyBundleName','Error:\x20--version\x20option\x20is\x20required','sort','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','buildIdToNameMap','listVersions','\x20\x20-\x20','Error:\x20Invalid\x20version\x20number:\x20','listActivationsFlat','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Error:\x20Version\x20','localeCompare','journey:pause'];a28_0x1230=function(){return _0x2f5e54;};return a28_0x1230();}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x24f18c){const _0x2ff002=a28_0x1d56;return!_0x24f18c&&(console[_0x2ff002(0x269)](_0x2ff002(0x1cf)),console[_0x2ff002(0x269)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x24f18c;}function withJsonFormat(_0x3faab5){const _0x3628ad=a28_0x1d56;if(!_0x3faab5['format']&&!_0x3faab5[_0x3628ad(0x212)]&&!_0x3faab5[_0x3628ad(0x1d0)]&&!_0x3faab5[_0x3628ad(0x27f)])return{..._0x3faab5,'format':_0x3628ad(0x212),'json':!![]};return _0x3faab5;}function formatJourneyState(_0x5f390a){const _0x58ead8=a28_0x1d56;switch(_0x5f390a){case _0x58ead8(0x1dc):return a28_0x302f34['green'](_0x58ead8(0x271));case _0x58ead8(0x29e):return a28_0x302f34[_0x58ead8(0x26e)](_0x58ead8(0x29d));case'paused':return a28_0x302f34['yellow'](_0x58ead8(0x274));case _0x58ead8(0x1cc):return a28_0x302f34[_0x58ead8(0x2b9)](_0x58ead8(0x209));case _0x58ead8(0x1da):return a28_0x302f34[_0x58ead8(0x26e)](_0x58ead8(0x1fa));default:return'('+_0x5f390a+')';}}function formatJourneyItem(_0xcdb75f,_0x1cf908='',_0x6ddf3a){const _0x7c4e76=a28_0x1d56,_0x53d245=formatJourneyState(_0xcdb75f[_0x7c4e76(0x2bb)]),_0x29a1a2=_0x6ddf3a?hyperlink(_0xcdb75f[_0x7c4e76(0x219)],_0x6ddf3a):_0xcdb75f['journeyBundleName'];return _0x1cf908+_0x7c4e76(0x1d9)+_0x29a1a2+'\x20'+_0x53d245;}function escapeRegex(_0x556749){const _0x385d06=a28_0x1d56;return _0x556749[_0x385d06(0x27c)](/[.*+?^${}()|[\]\\]/g,_0x385d06(0x283));}function globToRegex(_0x2893f3){const _0x47d79b=a28_0x1d56,_0x4e4000=_0x2893f3[_0x47d79b(0x277)]('*')[_0x47d79b(0x20a)](escapeRegex);return new RegExp(_0x4e4000['join']('.*'),'i');}function buildRuleToNameMapping(_0x330fd7){const _0x290747=a28_0x1d56,_0x2aed75=new Map();if(_0x330fd7[_0x290747(0x1c9)])for(const [_0x4374a4,_0x4a66c3]of Object[_0x290747(0x256)](_0x330fd7[_0x290747(0x1c9)])){if(_0x4a66c3[_0x290747(0x2a7)]){const _0x458604=serializeRule(_0x4a66c3['rule']),_0x463ab6=_0x2aed75[_0x290747(0x1fe)](_0x458604);_0x463ab6?_0x463ab6[_0x290747(0x205)](_0x4374a4):_0x2aed75[_0x290747(0x296)](_0x458604,[_0x4374a4]);}}return _0x2aed75;}async function resolveJourneyIdFromInput(_0x435975,_0x275dbb,_0x5615d6){const _0x311703=a28_0x1d56,_0x53963c=await resolveJourneyTarget(_0x435975,_0x275dbb['parentSegment'],_0x275dbb['verbose']),_0x44f85c=_0x53963c[_0x311703(0x233)];if(!_0x44f85c)throw new SDKError(ErrorCode[_0x311703(0x259)],_0x311703(0x2b1));const _0x14436f=await withSpinner(_0x311703(0x1ef),()=>_0x5615d6[_0x311703(0x2ac)][_0x311703(0x1fb)](_0x44f85c),{'verbose':_0x275dbb[_0x311703(0x200)]}),_0x333e26=_0x14436f[_0x311703(0x22f)],_0x20359e=await withSpinner(_0x311703(0x2bc),()=>_0x5615d6[_0x311703(0x29c)][_0x311703(0x1cd)](_0x333e26,_0x53963c[_0x311703(0x2c1)]),{'verbose':_0x275dbb[_0x311703(0x200)]});return{'journeyId':_0x20359e['data'],'journeyName':_0x53963c['journeyName'],'parentSegmentId':_0x333e26};}async function resolveJourneyTarget(_0x3ccccb,_0x182c6d,_0x26ad24){const _0x4992ba=a28_0x1d56;if(isYamlFilePath(_0x3ccccb))try{const _0x4403c0=await resolveYamlFilePath(_0x3ccccb);return _0x26ad24&&(console['error'](_0x4992ba(0x248)+_0x3ccccb),console['error'](_0x4992ba(0x260)+_0x4403c0[_0x4992ba(0x233)]),console['error']('\x20\x20Name:\x20'+_0x4403c0[_0x4992ba(0x1de)]),console[_0x4992ba(0x269)](_0x4992ba(0x2b2)+(_0x4403c0[_0x4992ba(0x1dd)]||_0x4992ba(0x1d2)))),{'journeyName':_0x4403c0[_0x4992ba(0x1de)],'parentSegment':_0x4403c0[_0x4992ba(0x233)],'resolved':_0x4403c0};}catch(_0x15006f){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4992ba(0x235)+_0x15006f[_0x4992ba(0x2ca)]);}if(!_0x182c6d)throw new SDKError(ErrorCode[_0x4992ba(0x259)],_0x4992ba(0x24b));return{'journeyName':_0x3ccccb,'parentSegment':_0x182c6d};}export class JourneyListCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:list';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x2af);async[a28_0x8121c3(0x218)](_0x5745fb){const _0x4d29e0=a28_0x8121c3,{options:_0x1a731f,args:_0x536c7d,tdx:_0x283246}=_0x5745fb,_0x43483c=_0x536c7d[0x0],_0x56bc31=_0x1a731f[_0x4d29e0(0x233)];if(!_0x56bc31)return console[_0x4d29e0(0x269)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x4d29e0(0x269)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x35d1c1=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x283246[_0x4d29e0(0x2ac)][_0x4d29e0(0x1fb)](_0x56bc31),{'verbose':_0x1a731f[_0x4d29e0(0x200)]}),_0x237e52=_0x35d1c1[_0x4d29e0(0x22f)];_0x1a731f[_0x4d29e0(0x200)]&&(console[_0x4d29e0(0x269)](_0x4d29e0(0x23b)+_0x56bc31+_0x4d29e0(0x1d4)+_0x237e52+')'),_0x43483c&&console['error']('Pattern:\x20'+_0x43483c));const _0x4bf15e=await withSpinner(_0x4d29e0(0x2b7),()=>_0x283246[_0x4d29e0(0x2ac)]['getParentFull'](_0x237e52),{'verbose':_0x1a731f[_0x4d29e0(0x200)]}),_0x1a8710=_0x4bf15e[_0x4d29e0(0x22f)],_0x4089f1=_0x1a8710[_0x4d29e0(0x247)],_0x57fd40=await withSpinner('Listing\x20journeys...',()=>_0x283246['journey']['listJourneysWithFolders'](_0x237e52,_0x4089f1),{'verbose':_0x1a731f['verbose']});let _0x3e8814=_0x57fd40[_0x4d29e0(0x22f)]['journeys'];const _0x2f5c96=_0x57fd40[_0x4d29e0(0x22f)][_0x4d29e0(0x231)],_0x74409d=new Map();for(const _0x169549 of _0x2f5c96){_0x74409d[_0x4d29e0(0x296)](_0x169549['id'],_0x169549[_0x4d29e0(0x29b)]);}if(_0x43483c){const _0x326c1e=globToRegex(_0x43483c);_0x3e8814=_0x3e8814['filter'](_0x59fe89=>_0x326c1e[_0x4d29e0(0x257)](_0x59fe89['journeyBundleName']));}console[_0x4d29e0(0x269)](_0x4d29e0(0x1e3)+_0x3e8814[_0x4d29e0(0x267)]+_0x4d29e0(0x266)+(_0x3e8814[_0x4d29e0(0x267)]!==0x1?'s':''));const _0x2451a1=_0x2a942a=>{const _0x477550=_0x4d29e0;return getConsoleNextUrl(_0x1a731f[_0x477550(0x2a5)],'/app/ps/'+_0x237e52+'/e/'+_0x2a942a+_0x477550(0x201));};if(_0x1a731f['format']==='table')await handleSDKOutput(_0x3e8814,_0x1a731f);else{if(_0x1a731f[_0x4d29e0(0x2c6)]===_0x4d29e0(0x212)){const _0x11fda9=_0x3e8814['map'](_0x75fdac=>({..._0x75fdac,'url':_0x2451a1(_0x75fdac['id'])}));await handleSDKOutput(_0x11fda9,_0x1a731f);}else{console[_0x4d29e0(0x284)]('['+_0x56bc31+']');const _0x3c828b=new Map(),_0xfb0209=[];for(const _0x107b13 of _0x3e8814){if(!_0x107b13[_0x4d29e0(0x1f9)]||_0x107b13[_0x4d29e0(0x1f9)]===_0x4089f1)_0xfb0209[_0x4d29e0(0x205)](_0x107b13);else{const _0x328a04=_0x3c828b['get'](_0x107b13[_0x4d29e0(0x1f9)])||[];_0x328a04['push'](_0x107b13),_0x3c828b[_0x4d29e0(0x296)](_0x107b13[_0x4d29e0(0x1f9)],_0x328a04);}}const _0x2cd5e8=(_0x2d2edb,_0x3a8003)=>_0x2d2edb[_0x4d29e0(0x219)][_0x4d29e0(0x224)](_0x3a8003['journeyBundleName'],undefined,{'sensitivity':'base'});_0xfb0209[_0x4d29e0(0x21b)](_0x2cd5e8);for(const _0x1cb3d1 of _0xfb0209){console[_0x4d29e0(0x284)](formatJourneyItem(_0x1cb3d1,'',_0x2451a1(_0x1cb3d1['id'])));}const _0x49c706=[..._0x3c828b[_0x4d29e0(0x256)]()][_0x4d29e0(0x21b)]((_0x3fbd5e,_0x33812c)=>{const _0x9031d4=_0x4d29e0,_0x3ae4b7=_0x74409d[_0x9031d4(0x1fe)](_0x3fbd5e[0x0])||_0x3fbd5e[0x0],_0x350f72=_0x74409d[_0x9031d4(0x1fe)](_0x33812c[0x0])||_0x33812c[0x0];return _0x3ae4b7[_0x9031d4(0x224)](_0x350f72,undefined,{'sensitivity':_0x9031d4(0x265)});});for(const [_0x2fae6f,_0xbd71ad]of _0x49c706){const _0x4079bd=_0x74409d[_0x4d29e0(0x1fe)](_0x2fae6f)||_0x2fae6f;console[_0x4d29e0(0x284)]('📁\x20'+_0x4079bd),_0xbd71ad[_0x4d29e0(0x21b)](_0x2cd5e8);for(const _0x385624 of _0xbd71ad){console[_0x4d29e0(0x284)](formatJourneyItem(_0x385624,'\x20\x20',_0x2451a1(_0x385624['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:view';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x26a);async[a28_0x8121c3(0x218)](_0x468cff){const _0x50198b=a28_0x8121c3,{options:_0x34e725,args:_0x1e818f,tdx:_0x5cc3db}=_0x468cff,_0x42d810=_0x1e818f[0x0];if(!_0x42d810)return console[_0x50198b(0x269)](_0x50198b(0x1cf)),console[_0x50198b(0x269)](_0x50198b(0x26f)),console[_0x50198b(0x269)](_0x50198b(0x1f7)),console[_0x50198b(0x269)](_0x50198b(0x2c9)),0x1;_0x34e725[_0x50198b(0x200)]&&console[_0x50198b(0x269)]('Input:\x20'+_0x42d810);const {journeyId:_0x54a756,parentSegmentId:_0x392c04}=await resolveJourneyIdFromInput(_0x42d810,_0x34e725,_0x5cc3db);if(_0x34e725[_0x50198b(0x246)]){const _0x3f30b3=getConsoleNextUrl(_0x34e725[_0x50198b(0x2a5)],_0x50198b(0x1d5)+_0x392c04+'/e/'+_0x54a756+_0x50198b(0x299));return console['error'](a28_0x302f34['green']('✔')+'\x20Opening\x20'+a28_0x302f34[_0x50198b(0x28c)](_0x3f30b3)),openBrowser(_0x3f30b3),0x0;}const _0x407c76=await withSpinner(_0x50198b(0x26b),()=>_0x5cc3db['journey'][_0x50198b(0x1d3)](_0x54a756),{'verbose':_0x34e725[_0x50198b(0x200)]}),_0x5bcdf1=_0x407c76['data'],_0x456dc7=_0x34e725[_0x50198b(0x213)];let _0x4693e7;if(_0x456dc7)try{const _0x152670=await withSpinner(_0x50198b(0x1ee),()=>_0x5cc3db[_0x50198b(0x29c)]['getStatistics'](_0x54a756),{'verbose':_0x34e725[_0x50198b(0x200)]});_0x4693e7=_0x152670[_0x50198b(0x22f)];}catch{_0x34e725['verbose']&&console[_0x50198b(0x269)](_0x50198b(0x291));}const _0x1f7739=getConsoleNextUrl(_0x34e725[_0x50198b(0x2a5)],_0x50198b(0x1d5)+_0x392c04+_0x50198b(0x1e7)+_0x54a756+_0x50198b(0x299)),_0x47b1a1={'id':_0x5bcdf1['id'],'name':_0x5bcdf1[_0x50198b(0x1eb)]['name'],'description':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x27d)],'state':_0x5bcdf1[_0x50198b(0x1eb)]['state'],'paused':_0x5bcdf1['attributes'][_0x50198b(0x1f6)],'reentry_mode':_0x5bcdf1['attributes'][_0x50198b(0x226)],'stages':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x278)]?.[_0x50198b(0x267)]||0x0,..._0x5bcdf1['attributes'][_0x50198b(0x249)]&&{'goal':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x249)][_0x50198b(0x29b)]},..._0x4693e7&&{'statistics':{'size':_0x4693e7[_0x50198b(0x227)],'entered':_0x4693e7[_0x50198b(0x20b)],'goal_achieved':_0x4693e7[_0x50198b(0x2b3)],'completion_rate':_0x4693e7[_0x50198b(0x1f4)],'exit_or_jump':_0x4693e7[_0x50198b(0x24a)],'exit_or_jump_rate':_0x4693e7[_0x50198b(0x28d)],'stages':_0x4693e7['stages']}},'url':_0x1f7739};return await handleSingleObjectOutput(_0x47b1a1,_0x34e725),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x2ae);[a28_0x8121c3(0x27d)]='Show\x20journey\x20statistics';async[a28_0x8121c3(0x218)](_0x184ad0){const _0xf3c551=a28_0x8121c3,{options:_0x125f12,args:_0x34ba27,tdx:_0x1eb1b1}=_0x184ad0,_0x152015=_0x34ba27[0x0];if(!requireNameOrPath(_0x152015))return 0x1;_0x125f12[_0xf3c551(0x200)]&&console[_0xf3c551(0x269)](_0xf3c551(0x29f)+_0x152015);const _0x3001a0=_0x125f12,_0x3611f1=_0x3001a0[_0xf3c551(0x26c)],_0x4c225d=_0x3001a0['to'],_0x5e7d27=_0x3001a0['includeHistory'],_0x3e97cb=_0x3001a0[_0xf3c551(0x241)];_0x5e7d27&&!_0x3611f1&&!_0x4c225d&&console[_0xf3c551(0x269)](_0xf3c551(0x250));const _0x5ed05d=_0x5e7d27?withJsonFormat(_0x125f12):_0x125f12,{journeyId:_0x524f0f,journeyName:_0x502a10}=await resolveJourneyIdFromInput(_0x152015,_0x5ed05d,_0x1eb1b1),_0x1b489a=_0x3611f1||_0x4c225d?{'from':_0x3611f1,'to':_0x4c225d}:undefined,_0x3d1aba=await withSpinner(_0xf3c551(0x1ee),()=>Promise[_0xf3c551(0x2a4)]([_0x1eb1b1[_0xf3c551(0x29c)][_0xf3c551(0x1d3)](_0x524f0f),_0x1eb1b1[_0xf3c551(0x29c)][_0xf3c551(0x1fc)](_0x524f0f,_0x1b489a)]),{'verbose':_0x5ed05d['verbose']}),[_0x491e70,_0x2f042f]=_0x3d1aba[_0xf3c551(0x22f)];if(!_0x2f042f||_0x2f042f[_0xf3c551(0x2aa)]===null)return console[_0xf3c551(0x269)](_0xf3c551(0x22c)+_0x502a10),console[_0xf3c551(0x269)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x26c006=buildStageNameMap(_0x491e70),_0x45f132=!!(_0x1b489a&&_0x2f042f[_0xf3c551(0x294)]?.[_0xf3c551(0x267)]),_0x8c6b9a={'stageNameMap':_0x26c006,'hasPeriod':_0x45f132,'includeHistory':!!_0x5e7d27};if(_0x3e97cb&&_0x2f042f[_0xf3c551(0x238)]){const _0x1a9bd3=_0x2f042f[_0xf3c551(0x238)][_0xf3c551(0x27e)](_0x453b5d=>{const _0xc9bfe3=_0xf3c551,_0x528656=_0x26c006[_0xc9bfe3(0x1fe)](_0x453b5d['id'])??'';return _0x528656['toLowerCase']()===_0x3e97cb[_0xc9bfe3(0x2a9)]();});if(_0x1a9bd3)return await handleSingleObjectOutput(formatStageStats(_0x1a9bd3,_0x8c6b9a),_0x5ed05d),0x0;const _0x260739=_0x2f042f[_0xf3c551(0x238)][_0xf3c551(0x20a)](_0x2e50d4=>_0x26c006['get'](_0x2e50d4['id'])??_0x2e50d4['id']);return console[_0xf3c551(0x269)](_0xf3c551(0x2a6)+_0x3e97cb+'\x22\x20not\x20found'),console[_0xf3c551(0x269)]('Available\x20stages:\x20'+_0x260739[_0xf3c551(0x2c2)](',\x20')),0x1;}const _0x3aab88=_0x2f042f['stages']?.[_0xf3c551(0x20a)](_0x35ae59=>formatStageStats(_0x35ae59,_0x8c6b9a)),_0x38966c=assembleJourneyStats(_0x2f042f,{'from':_0x3611f1,'to':_0x4c225d,'includeHistory':_0x5e7d27});return await this[_0xf3c551(0x23a)](_0x38966c,_0x3aab88??[],_0x5ed05d),0x0;}async[a28_0x8121c3(0x23a)](_0x36348a,_0x59c1c5,_0x2050c8){const _0x1494a5=a28_0x8121c3,_0x4bd49c=_0x2050c8['format']==='json'||_0x2050c8[_0x1494a5(0x2c6)]===_0x1494a5(0x1d0)||_0x2050c8['json']||_0x2050c8[_0x1494a5(0x1d0)];if(_0x4bd49c){_0x36348a[_0x1494a5(0x238)]=_0x59c1c5,await handleSingleObjectOutput(_0x36348a,_0x2050c8);return;}await handleSingleObjectOutput(_0x36348a,_0x2050c8);for(const _0x5ef6d0 of _0x59c1c5){console[_0x1494a5(0x284)](''),console[_0x1494a5(0x284)](String(a28_0x302f34[_0x1494a5(0x28c)][_0x1494a5(0x251)]('['+_0x5ef6d0[_0x1494a5(0x29b)]+']'))+a28_0x302f34[_0x1494a5(0x26e)]('\x20'+_0x5ef6d0['id']));const {id:_0x5e3082,name:_0x191461,..._0x50f1da}=_0x5ef6d0;await handleSingleObjectOutput(_0x50f1da,_0x2050c8);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x297);[a28_0x8121c3(0x27d)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x8121c3(0x218)](_0x5129bd){const _0x55f6d9=a28_0x8121c3,{options:_0x5b48dc,args:_0x20db8e,tdx:_0x33dac8}=_0x5129bd,_0x3e8454=_0x20db8e[0x0];if(!requireNameOrPath(_0x3e8454))return 0x1;_0x5b48dc[_0x55f6d9(0x200)]&&console[_0x55f6d9(0x269)]('Input:\x20'+_0x3e8454);const _0x3973e9=_0x5b48dc,_0xc60782=_0x3973e9[_0x55f6d9(0x28a)],_0x4ce6d7=_0x3973e9[_0x55f6d9(0x26c)],_0xa711e6=_0x3973e9['to'],_0x20421f=_0x3973e9[_0x55f6d9(0x254)];if(_0xc60782&&_0xc60782!==_0x55f6d9(0x2bf)&&_0xc60782!=='activation')return console['error'](_0x55f6d9(0x24c)+_0xc60782+_0x55f6d9(0x222)),0x1;const _0xdf27a=withJsonFormat(_0x5b48dc),{journeyId:_0x49a1d5,journeyName:_0x4e1edd}=await resolveJourneyIdFromInput(_0x3e8454,_0xdf27a,_0x33dac8),_0x40e753={'type':_0xc60782,'from':_0x4ce6d7,'to':_0xa711e6,'limit':_0x20421f},_0x37ba18=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x33dac8[_0x55f6d9(0x29c)][_0x55f6d9(0x298)](_0x49a1d5,_0x40e753),{'verbose':_0xdf27a[_0x55f6d9(0x200)]}),_0x311cf4=_0x37ba18[_0x55f6d9(0x22f)],_0x2af6a7=_0x311cf4[_0x55f6d9(0x2bf)]&&(_0x311cf4[_0x55f6d9(0x2bf)][_0x55f6d9(0x281)][_0x55f6d9(0x267)]>0x0||_0x311cf4['conversion'][_0x55f6d9(0x2be)][_0x55f6d9(0x267)]>0x0),_0x53ebb2=_0x311cf4['activation']&&_0x311cf4[_0x55f6d9(0x1d1)][_0x55f6d9(0x267)]>0x0;if(!_0x2af6a7&&!_0x53ebb2)return console['error'](_0x55f6d9(0x244)+_0x4e1edd),console[_0x55f6d9(0x269)](_0x55f6d9(0x2c7)),_0x4ce6d7&&_0xa711e6&&console[_0x55f6d9(0x269)](_0x55f6d9(0x1f0)),0x0;return await handleSingleObjectOutput(_0x311cf4,_0xdf27a),0x0;}}function formatStageStats(_0x405f82,_0x3a6908){const _0x5a3919=a28_0x8121c3,_0x6befed=_0x3a6908[_0x5a3919(0x279)]&&_0x405f82[_0x5a3919(0x294)]?.[_0x5a3919(0x267)]?aggregateStageHistory(_0x405f82[_0x5a3919(0x294)]):{'size':_0x405f82[_0x5a3919(0x227)],'entered':_0x405f82[_0x5a3919(0x20b)],'milestone':_0x405f82[_0x5a3919(0x206)],'milestone_rate':_0x405f82[_0x5a3919(0x273)],'exit_or_jump':_0x405f82[_0x5a3919(0x24a)],'exit_or_jump_rate':_0x405f82[_0x5a3919(0x28d)]},_0xdcec5c={'id':_0x405f82['id'],'name':_0x3a6908[_0x5a3919(0x1fd)]['get'](_0x405f82['id'])??_0x405f82['id'],..._0x6befed};return _0x3a6908[_0x5a3919(0x279)]&&_0x3a6908['includeHistory']&&_0x405f82['history']&&(_0xdcec5c['history']=_0x405f82['history']),_0xdcec5c;}export class JourneyPauseCommand extends BaseCommand{['name']=a28_0x8121c3(0x225);[a28_0x8121c3(0x27d)]='Pause\x20a\x20running\x20journey';async['execute'](_0x464b39){const _0x143dbb=a28_0x8121c3,{options:_0x2f217e,args:_0x5df915,tdx:_0x591f85}=_0x464b39,_0x36342b=_0x5df915[0x0];if(!requireNameOrPath(_0x36342b))return 0x1;_0x2f217e[_0x143dbb(0x200)]&&console[_0x143dbb(0x269)](_0x143dbb(0x29f)+_0x36342b);const {journeyId:_0x2fb911,journeyName:_0x57438e}=await resolveJourneyIdFromInput(_0x36342b,_0x2f217e,_0x591f85);if(!_0x2f217e[_0x143dbb(0x1e6)]){const _0x3cadce=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x57438e+'\x22?');if(!_0x3cadce)return console['error']('Cancelled'),0x0;}const _0x2701ee=await withSpinner(_0x143dbb(0x270),()=>_0x591f85[_0x143dbb(0x29c)][_0x143dbb(0x293)](_0x2fb911),{'verbose':_0x2f217e[_0x143dbb(0x200)]}),_0x1a7872=_0x2701ee[_0x143dbb(0x22f)];return console['error'](_0x143dbb(0x24f)+_0x1a7872[_0x143dbb(0x1eb)][_0x143dbb(0x29b)]+_0x143dbb(0x1ca)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:resume';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x215);async[a28_0x8121c3(0x218)](_0x472298){const _0x7f3887=a28_0x8121c3,{options:_0x6328a6,args:_0x2f7abe,tdx:_0x1c836d}=_0x472298,_0x3085d4=_0x2f7abe[0x0];if(!requireNameOrPath(_0x3085d4))return 0x1;_0x6328a6[_0x7f3887(0x200)]&&console[_0x7f3887(0x269)](_0x7f3887(0x29f)+_0x3085d4);const {journeyId:_0x43f7db,journeyName:_0x18abe3}=await resolveJourneyIdFromInput(_0x3085d4,_0x6328a6,_0x1c836d);if(!_0x6328a6[_0x7f3887(0x1e6)]){const _0x817a37=await confirm(_0x7f3887(0x286)+_0x18abe3+'\x22?');if(!_0x817a37)return console[_0x7f3887(0x269)](_0x7f3887(0x2a2)),0x0;}const _0x375f2f=await withSpinner('Resuming\x20journey...',()=>_0x1c836d[_0x7f3887(0x29c)][_0x7f3887(0x239)](_0x43f7db),{'verbose':_0x6328a6[_0x7f3887(0x200)]}),_0x53e536=_0x375f2f[_0x7f3887(0x22f)];return console['error'](_0x7f3887(0x24f)+_0x53e536[_0x7f3887(0x1eb)]['name']+_0x7f3887(0x229)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x261);[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x203);async['execute'](_0x3aa9c2){const _0x16baf0=a28_0x8121c3,{options:_0x22f106,args:_0x4275eb,tdx:_0x1c6ff0}=_0x3aa9c2,_0x174d81=_0x22f106,_0x2cb844=_0x4275eb[0x0],_0x3c129e=_0x2cb844&&isYamlFilePath(_0x2cb844),_0xb69cb8=await resolveTarget({'arg':_0x3c129e?_0x2cb844:undefined,'contextParent':_0x22f106['parentSegment'],'cwd':process[_0x16baf0(0x25c)]()});if(!isSuccessfulResolution(_0xb69cb8))return _0xb69cb8[_0x16baf0(0x24e)]===_0x16baf0(0x28b)?(console['error'](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x20f))),console[_0x16baf0(0x269)]('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[_0x16baf0(0x269)](_0x16baf0(0x288)),console['error'](_0x16baf0(0x25e)),console[_0x16baf0(0x269)](_0x16baf0(0x210))):(console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1df)](_0x16baf0(0x26d)+_0xb69cb8[_0x16baf0(0x2ca)]+'\x0a')),_0xb69cb8['helpText']&&console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x28c)](_0xb69cb8[_0x16baf0(0x1cb)]))),0x1;let _0x102905=_0x3c129e?undefined:_0x2cb844,_0x42ab65,_0x4e88c4;_0xb69cb8[_0x16baf0(0x28a)]===_0x16baf0(0x2ba)&&(_0x102905=_0xb69cb8[_0x16baf0(0x1e1)],_0x42ab65=_0xb69cb8[_0x16baf0(0x252)],_0x4e88c4=_0xb69cb8[_0x16baf0(0x1dd)]);const _0x15c4ad=_0xb69cb8[_0x16baf0(0x2a3)],_0x5cad98=_0xb69cb8[_0x16baf0(0x2b0)];_0x174d81[_0x16baf0(0x200)]&&(console[_0x16baf0(0x269)]('Parent\x20segment:\x20'+_0x15c4ad),console['error'](_0x16baf0(0x28f)+_0x5cad98),_0x102905&&console[_0x16baf0(0x269)]('Journey\x20name:\x20'+_0x102905),_0x42ab65&&console['error']('Target\x20file:\x20'+_0x42ab65),_0x4e88c4&&console['error'](_0x16baf0(0x202)+_0x4e88c4));const _0x14a0d3=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x1c6ff0[_0x16baf0(0x2ac)][_0x16baf0(0x1fb)](_0x15c4ad),{'verbose':_0x22f106[_0x16baf0(0x200)]}),_0xd2addd=_0x14a0d3[_0x16baf0(0x22f)],{journeys:_0xe27630,folders:_0x48e964}=await withSpinner(_0x16baf0(0x2bd),async()=>{const _0x2c7608=_0x16baf0,[_0x3d62c5,_0x42f65f]=await Promise[_0x2c7608(0x2a4)]([_0x1c6ff0[_0x2c7608(0x29c)]['listJourneysFromParentSegment'](_0xd2addd,undefined,{'includeAllVersions':!![]}),_0x1c6ff0[_0x2c7608(0x2ac)]['listFolders'](_0xd2addd)]);return{'journeys':_0x3d62c5,'folders':_0x42f65f};},{'verbose':_0x22f106[_0x16baf0(0x200)]})[_0x16baf0(0x27a)](_0x491af3=>_0x491af3[_0x16baf0(0x22f)]);let _0x28a983=_0xe27630;const _0x5a6313=buildFolderIdToPathMap(_0x48e964);if(_0x102905){const _0x338960=_0x28a983[_0x16baf0(0x280)](_0x4b5012=>_0x4b5012[_0x16baf0(0x219)][_0x16baf0(0x2a9)]()===_0x102905[_0x16baf0(0x2a9)]());if(_0x338960['length']===0x0)return console[_0x16baf0(0x269)](_0x16baf0(0x29a)+_0x102905),console[_0x16baf0(0x269)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x28a983=_0x338960;}if(_0x4e88c4!==undefined){const _0x2d812a=_0x28a983[_0x16baf0(0x280)](_0x358145=>{const _0x2ed7b7=_0x16baf0,_0x4b6149=_0x358145[_0x2ed7b7(0x1f9)]?_0x5a6313[_0x2ed7b7(0x1fe)](_0x358145['folderId'])||'':'';return _0x4b6149===_0x4e88c4;});if(_0x2d812a[_0x16baf0(0x267)]===0x0&&_0x28a983[_0x16baf0(0x267)]>0x0){console[_0x16baf0(0x269)](_0x16baf0(0x23e)+_0x102905+_0x16baf0(0x2a1)+(_0x4e88c4||'root\x20folder')),console['error'](_0x16baf0(0x245));for(const _0x2fdf29 of _0x28a983){const _0x2ebe1b=_0x2fdf29[_0x16baf0(0x1f9)]?_0x5a6313[_0x16baf0(0x1fe)](_0x2fdf29['folderId'])||'':'';console['error'](_0x16baf0(0x21f)+(_0x2ebe1b||_0x16baf0(0x1d2))+'/'+_0x2fdf29[_0x16baf0(0x219)]);}return 0x1;}_0x28a983=_0x2d812a;}if(_0x28a983[_0x16baf0(0x267)]===0x0)return console[_0x16baf0(0x269)]('No\x20journeys\x20found'),0x0;const _0x2c2c15=new Map();for(const _0x409348 of _0x28a983){const _0x29c7a6=_0x409348[_0x16baf0(0x25a)];!_0x2c2c15[_0x16baf0(0x263)](_0x29c7a6)&&_0x2c2c15[_0x16baf0(0x296)](_0x29c7a6,[]),_0x2c2c15[_0x16baf0(0x1fe)](_0x29c7a6)[_0x16baf0(0x205)](_0x409348);}for(const _0x31f10a of _0x2c2c15[_0x16baf0(0x207)]()){_0x31f10a[_0x16baf0(0x21b)]((_0x3e7339,_0x304884)=>(_0x3e7339[_0x16baf0(0x1ec)]||0x0)-(_0x304884['versionNumber']||0x0));}const _0x4b89a9=[],{idToEmailMap:_0xedb31b,connectionIdToNameMap:_0x505950}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0xdc2be3=_0x16baf0,[_0x3f7368,_0x5477aa]=await Promise[_0xdc2be3(0x2a4)]([_0x1c6ff0[_0xdc2be3(0x1e5)][_0xdc2be3(0x22a)](),_0x1c6ff0[_0xdc2be3(0x255)][_0xdc2be3(0x21d)]()]);return{'idToEmailMap':_0x3f7368,'connectionIdToNameMap':_0x5477aa};},{'verbose':_0x22f106[_0x16baf0(0x200)]})[_0x16baf0(0x27a)](_0x3f5159=>_0x3f5159['data']);for(const _0x20ac2e of _0x2c2c15[_0x16baf0(0x207)]()){const _0x41b9ba=_0x20ac2e[0x0][_0x16baf0(0x219)],_0x53c17a=_0x20ac2e[0x0]['folderId'],_0x25524a=_0x53c17a?_0x5a6313[_0x16baf0(0x1fe)](_0x53c17a)||'':'',_0x260ce8=_0x25524a?a28_0x1221b1[_0x16baf0(0x2c2)](_0x5cad98,_0x25524a):_0x5cad98,_0x1a16f3=_0x42ab65||a28_0x1221b1[_0x16baf0(0x2c2)](_0x260ce8,sanitizeFileName(_0x41b9ba)+'.yml');let _0x42729c,_0x531252;if(existsSync(_0x1a16f3))try{const _0x39530b=readFileSync(_0x1a16f3,_0x16baf0(0x290)),_0x25d8a4=parseYamlString(_0x39530b);_0x531252=_0x25d8a4,_0x42729c=buildRuleToNameMapping(_0x25d8a4),_0x174d81['verbose']&&_0x42729c['size']>0x0&&console[_0x16baf0(0x269)]('Found\x20'+_0x42729c[_0x16baf0(0x227)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x41b9ba);}catch(_0x28feb1){_0x174d81[_0x16baf0(0x200)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x28feb1[_0x16baf0(0x2ca)]);}const _0x11e0ec=[],_0x5036b0=new Set(),_0x5d7089=new Map(),_0x2c0f2a=new Map(),_0x1f554a=new Set(),_0x4a91e6=new Map(),_0x1b484c=new Map(),_0x5be43f=createJumpTargetCache();await withProgressSpinner(_0x16baf0(0x2c3)+_0x41b9ba+'...',async _0x542e12=>{const _0x28f0c3=_0x16baf0;for(const _0x26dc6e of _0x20ac2e){const _0x42c7df=_0x20ac2e['length']>0x1?_0x26dc6e[_0x28f0c3(0x219)]+'\x20v'+(_0x26dc6e[_0x28f0c3(0x1ec)]||0x1):_0x26dc6e['journeyBundleName'];_0x542e12[_0x28f0c3(0x217)]('Fetching\x20'+_0x42c7df);const _0x50ff9a=await _0x1c6ff0[_0x28f0c3(0x29c)][_0x28f0c3(0x1d3)](_0x26dc6e['id']),_0x4f3f47=_0x50ff9a[_0x28f0c3(0x1eb)]?.[_0x28f0c3(0x2a0)],_0xce222a={'resolveSegment':async _0x19dfbd=>{const _0x44777a=_0x28f0c3;if(!_0x4f3f47)return{'name':_0x19dfbd,'isJourneyLocal':![]};const _0x4b932b=_0x5d7089['get'](_0x19dfbd);if(_0x4b932b)return _0x4b932b;try{const _0x38e7dc=await _0x1c6ff0['segment'][_0x44777a(0x272)](_0x4f3f47,_0x19dfbd),_0x4a9b55=_0x38e7dc['kind']===SEGMENT_KIND_JOURNEY;let _0x5606ab,_0x179655=_0x38e7dc[_0x44777a(0x29b)];if(_0x4a9b55&&_0x38e7dc['rule']){const _0x45ef98=await segmentResponseToDef(_0x38e7dc,{'resolveSegmentName':async _0x5643d0=>{const _0x5cf244=_0x44777a,_0xe3f62d=_0x5d7089[_0x5cf244(0x1fe)](_0x5643d0);if(_0xe3f62d)return _0xe3f62d[_0x5cf244(0x29b)];const _0x18be7b=await _0xce222a[_0x5cf244(0x23d)](_0x5643d0);return _0x18be7b[_0x5cf244(0x29b)];}}),_0x119b38=_0x45ef98['rule'];_0x5606ab={'description':_0x38e7dc['description'],'rule':_0x119b38};const _0x4c2e9=serializeRule(_0x119b38),_0x475dda=_0x2c0f2a['get'](_0x4c2e9);if(_0x475dda)_0x179655=_0x475dda,_0x5606ab=undefined,_0x174d81[_0x44777a(0x200)]&&console[_0x44777a(0x269)](_0x44777a(0x22e)+_0x38e7dc[_0x44777a(0x29b)]+_0x44777a(0x2ad)+_0x475dda);else{let _0x3f79b4=![];if(_0x42729c){const _0x1bef58=_0x42729c[_0x44777a(0x1fe)](_0x4c2e9);if(_0x1bef58){const _0x2422c3=_0x1bef58[_0x44777a(0x27e)](_0x5b5125=>!_0x5036b0[_0x44777a(0x263)](_0x5b5125));_0x2422c3&&(_0x179655=_0x2422c3,_0x5036b0[_0x44777a(0x1f8)](_0x2422c3),_0x2c0f2a[_0x44777a(0x296)](_0x4c2e9,_0x2422c3),_0x3f79b4=!![],_0x174d81[_0x44777a(0x200)]&&console[_0x44777a(0x269)](_0x44777a(0x24d)+_0x2422c3+'\x20(rule\x20match)'));}}if(!_0x3f79b4){const _0x309c87=generateJourneyLocalName(_0x38e7dc[_0x44777a(0x29b)]);_0x309c87&&(_0x179655=_0x309c87);let _0x1c7194=_0x179655,_0x4964e7=0x2;while(_0x5036b0[_0x44777a(0x263)](_0x1c7194)){_0x1c7194=_0x179655+'_'+_0x4964e7,_0x4964e7++;}_0x5036b0[_0x44777a(0x1f8)](_0x1c7194),_0x2c0f2a['set'](_0x4c2e9,_0x1c7194),_0x179655=_0x1c7194;}}}const _0x1da7e0={'name':_0x179655,'isJourneyLocal':_0x4a9b55,'definition':_0x5606ab};return _0x5d7089['set'](_0x19dfbd,_0x1da7e0),_0x1da7e0;}catch(_0x1985f9){return _0x22f106['verbose']&&console[_0x44777a(0x269)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x19dfbd+':\x20'+_0x1985f9[_0x44777a(0x2ca)]),{'name':_0x19dfbd,'isJourneyLocal':![]};}},'resolveActivation':async _0x1dd663=>{const _0x10941d=_0x28f0c3,_0x5996fb=_0x4a91e6[_0x10941d(0x1fe)](_0x1dd663);if(_0x5996fb)return _0x5996fb;try{const _0x31a54d=await _0x1c6ff0['journey']['getActivation'](_0x26dc6e['id'],_0x1dd663),_0x322cda=journeyActivationStepToYaml(_0x31a54d,_0xedb31b,_0x505950),_0x45c858=JSON['stringify']({'name':_0x322cda[_0x10941d(0x29b)],'connection':_0x322cda[_0x10941d(0x255)],'connector_config':_0x322cda[_0x10941d(0x264)]}),_0x59c80f=_0x1b484c['get'](_0x45c858);if(_0x59c80f){const _0x33bf96={'name':_0x59c80f,'isJourneyLocal':!![],'definition':_0x322cda};return _0x4a91e6[_0x10941d(0x296)](_0x1dd663,_0x33bf96),_0x33bf96;}const _0x2243be=_0x31a54d[_0x10941d(0x1eb)]['activationParams'][_0x10941d(0x29b)]||_0x1dd663,_0x5ec699=sanitizeYamlKey(_0x2243be)||_0x10941d(0x1e8)+_0x1dd663;let _0x53761c=_0x5ec699,_0x1da8fa=0x2;while(_0x1f554a[_0x10941d(0x263)](_0x53761c)){_0x53761c=_0x5ec699+'_'+_0x1da8fa,_0x1da8fa++;}_0x1f554a[_0x10941d(0x1f8)](_0x53761c),_0x1b484c[_0x10941d(0x296)](_0x45c858,_0x53761c);const _0x216877={'name':_0x53761c,'isJourneyLocal':!![],'definition':_0x322cda};return _0x4a91e6[_0x10941d(0x296)](_0x1dd663,_0x216877),_0x216877;}catch(_0x1d54db){return _0x22f106['verbose']&&console[_0x10941d(0x269)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x1dd663+':\x20'+_0x1d54db[_0x10941d(0x2ca)]),{'name':_0x1dd663,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5c9482,_0x2ac975)=>{const _0x58f23a=_0x28f0c3;return resolveJumpTarget(_0x5c9482,_0x2ac975,_0x5be43f,_0x5d6b6d=>_0x1c6ff0[_0x58f23a(0x29c)][_0x58f23a(0x1d3)](_0x5d6b6d));}},_0x429618=await journeyResponseToDef(_0x50ff9a,_0xce222a);_0x11e0ec[_0x28f0c3(0x205)]({'item':_0x26dc6e,'yaml':_0x429618});}},{'verbose':_0x22f106['verbose']});const _0x5f34e0=await _0x1c6ff0[_0x16baf0(0x29c)][_0x16baf0(0x1f3)](_0x20ac2e[0x0]['journeyBundleId']),_0x71bcf1=buildMergedJourneyDef(_0x11e0ec,_0x42729c,_0x5f34e0),_0x162efb=normalizeJourneyDef(_0x71bcf1,_0x531252),_0x5c4fe2=toYamlString(_0x162efb),_0x3a796d=_0x42ab65||a28_0x1221b1[_0x16baf0(0x2c2)](_0x260ce8,sanitizeFileName(_0x41b9ba)+'.yml');!_0x42ab65&&_0x25524a&&!existsSync(_0x260ce8)&&mkdirSync(_0x260ce8,{'recursive':!![]});const _0x4f7883=a28_0x1221b1['relative'](process[_0x16baf0(0x25c)](),_0x3a796d);if(existsSync(_0x3a796d)){const _0x2655fe=readFileSync(_0x3a796d,_0x16baf0(0x290)),_0x219c30=generateDiff(_0x2655fe,_0x5c4fe2),_0x2b3631=hasChanges(_0x219c30);_0x4b89a9['push']({'relativePath':_0x4f7883,'absolutePath':_0x3a796d,'content':_0x5c4fe2,'isNew':![],'hasChanges':_0x2b3631,'diff':_0x2b3631?formatDiffWithColors(_0x219c30):undefined});}else _0x4b89a9[_0x16baf0(0x205)]({'relativePath':_0x4f7883,'absolutePath':_0x3a796d,'content':_0x5c4fe2,'isNew':!![],'hasChanges':![]});}const _0xb57cf9=_0x4b89a9[_0x16baf0(0x280)](_0x147301=>_0x147301['isNew']),_0x5d4e70=_0x4b89a9[_0x16baf0(0x280)](_0x1fd168=>!_0x1fd168[_0x16baf0(0x1f1)]&&_0x1fd168['hasChanges']),_0x518b5f=_0x4b89a9[_0x16baf0(0x280)](_0x4b42cf=>!_0x4b42cf[_0x16baf0(0x1f1)]&&!_0x4b42cf[_0x16baf0(0x204)]),_0x578ffd=_0x28a983[_0x16baf0(0x267)],_0x3133b1=_0x2c2c15[_0x16baf0(0x227)],_0x1b2478=_0x578ffd>_0x3133b1?'\x20('+_0x578ffd+_0x16baf0(0x287):'';console[_0x16baf0(0x269)](_0x16baf0(0x285)),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34['cyan'](_0x3133b1+'\x20journeys')+a28_0x302f34[_0x16baf0(0x26e)](_0x1b2478)),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x1db)]('+\x20'+_0xb57cf9['length']+_0x16baf0(0x2c8))),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x236)]('~\x20'+_0x5d4e70[_0x16baf0(0x267)]+'\x20changed\x20files')),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x26e)]('=\x20'+_0x518b5f[_0x16baf0(0x267)]+_0x16baf0(0x2c5))),console[_0x16baf0(0x269)]('\x20\x20Target:\x20'+a28_0x302f34[_0x16baf0(0x28c)](_0x5cad98)+'\x0a');if(_0x5d4e70[_0x16baf0(0x267)]>0x0)for(const _0x27579a of _0x5d4e70){console['error'](_0x16baf0(0x1d6)+_0x27579a[_0x16baf0(0x25f)]+'\x27:'),console[_0x16baf0(0x269)]('─'[_0x16baf0(0x1f2)](0x3c)),console[_0x16baf0(0x269)](_0x27579a['diff']),console[_0x16baf0(0x269)]('─'[_0x16baf0(0x1f2)](0x3c));}if(_0x174d81[_0x16baf0(0x292)])return console['error'](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x253))),0x0;if(_0xb57cf9['length']===0x0&&_0x5d4e70['length']===0x0)return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x216))),saveSessionContext({'parent_segment':_0x15c4ad},_0x174d81['session']),console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x20d)+a28_0x302f34[_0x16baf0(0x26e)](_0x16baf0(0x25d))+_0x16baf0(0x275)+a28_0x302f34[_0x16baf0(0x28c)](_0x15c4ad))),0x0;if(!_0x174d81[_0x16baf0(0x1e6)]&&(_0xb57cf9['length']>0x0||_0x5d4e70[_0x16baf0(0x267)]>0x0)){if(!isInteractive())return console['error'](a28_0x302f34[_0x16baf0(0x1df)](_0x16baf0(0x2b6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a28_0x302f34[_0x16baf0(0x26e)](_0x16baf0(0x211))),0x1;const _0x430957=await confirmKey(_0x16baf0(0x1ed)+(_0xb57cf9[_0x16baf0(0x267)]+_0x5d4e70[_0x16baf0(0x267)])+_0x16baf0(0x27b));if(!_0x430957)return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x20c)),_0x16baf0(0x1d8)),0x1;}!existsSync(_0x5cad98)&&mkdirSync(_0x5cad98,{'recursive':!![]});const _0x10135d=a28_0x1221b1[_0x16baf0(0x2c2)](_0x5cad98,_0x16baf0(0x1d7));writeFileSync(_0x10135d,createTdxConfigContent(_0x15c4ad),_0x16baf0(0x290));for(const _0x24d906 of _0x4b89a9){(_0x24d906[_0x16baf0(0x1f1)]||_0x24d906[_0x16baf0(0x204)])&&writeFileSync(_0x24d906['absolutePath'],_0x24d906[_0x16baf0(0x2c4)],'utf-8');}return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x228)+(_0xb57cf9[_0x16baf0(0x267)]+_0x5d4e70[_0x16baf0(0x267)])+'\x20journey\x20files\x20to\x20'+_0x5cad98)),saveSessionContext({'parent_segment':_0x15c4ad},_0x174d81['session']),console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)]('✔\x20Context\x20set:\x20'+a28_0x302f34['dim'](_0x16baf0(0x25d))+_0x16baf0(0x275)+a28_0x302f34[_0x16baf0(0x28c)](_0x15c4ad))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:columns';['description']=a28_0x8121c3(0x208);async['execute'](_0x3a4598){const _0x2ea626=a28_0x8121c3,{options:_0x105fce,args:_0x8cd976,tdx:_0x17a7d5}=_0x3a4598,_0x18fbbc=_0x8cd976[0x0];if(!requireNameOrPath(_0x18fbbc))return 0x1;_0x105fce[_0x2ea626(0x200)]&&console['error'](_0x2ea626(0x29f)+_0x18fbbc);const {journeyId:_0x5b5ed0}=await resolveJourneyIdFromInput(_0x18fbbc,_0x105fce,_0x17a7d5),_0x2caf00=await withSpinner(_0x2ea626(0x214),()=>_0x17a7d5[_0x2ea626(0x29c)][_0x2ea626(0x234)](_0x5b5ed0),{'verbose':_0x105fce['verbose']}),_0xe1741d=_0x2caf00['data'];return console[_0x2ea626(0x284)](_0x2ea626(0x2b8)+_0xe1741d['database']),console[_0x2ea626(0x284)]('Table:\x20'+_0xe1741d[_0x2ea626(0x23f)]),await handleSDKOutput(_0xe1741d['columns'],_0x105fce),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x1f5);['description']='List\x20activations\x20for\x20a\x20journey';async['execute'](_0xc0b104){const _0xef6335=a28_0x8121c3,{options:_0x70b25a,args:_0x177bcd,tdx:_0x31e188}=_0xc0b104,_0x4c3455=_0x177bcd[0x0];if(!requireNameOrPath(_0x4c3455))return 0x1;_0x70b25a[_0xef6335(0x200)]&&console[_0xef6335(0x269)](_0xef6335(0x29f)+_0x4c3455);const {journeyId:_0x251ce2}=await resolveJourneyIdFromInput(_0x4c3455,_0x70b25a,_0x31e188),_0x5147fc=await withSpinner('Listing\x20journey\x20activations...',()=>_0x31e188[_0xef6335(0x29c)][_0xef6335(0x221)](_0x251ce2),{'verbose':_0x70b25a[_0xef6335(0x200)]}),_0x49b36d=_0x5147fc[_0xef6335(0x22f)];return console[_0xef6335(0x269)]('Found\x20'+_0x49b36d[_0xef6335(0x267)]+'\x20activation'+(_0x49b36d[_0xef6335(0x267)]!==0x1?'s':'')),await handleSDKOutput(_0x49b36d,_0x70b25a),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x295);['description']=a28_0x8121c3(0x21c);[a28_0x8121c3(0x1ce)]=new SegmentPushCommand();async[a28_0x8121c3(0x218)](_0x184fed){const _0x5970bb=a28_0x8121c3,_0x55ebee=_0x184fed[_0x5970bb(0x1e4)][0x0];let _0x16ddc6;if(_0x55ebee){const _0x4e2afb=await resolveTarget({'arg':_0x55ebee,'contextParent':_0x184fed[_0x5970bb(0x240)][_0x5970bb(0x233)],'cwd':process[_0x5970bb(0x25c)]()});isSuccessfulResolution(_0x4e2afb)&&_0x4e2afb['type']===_0x5970bb(0x2ba)&&(_0x16ddc6=_0x4e2afb[_0x5970bb(0x252)]);}const _0x5bc085={..._0x184fed,'options':{..._0x184fed[_0x5970bb(0x240)],'journeysOnly':!![],..._0x16ddc6&&{'singleFilePath':_0x16ddc6}}};return this['segmentPushCommand']['execute'](_0x5bc085);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x22d);[a28_0x8121c3(0x27d)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a28_0x8121c3(0x218)](_0x49f404){const _0x311013=a28_0x8121c3,{options:_0x2ce19d,args:_0x1cfd6e,tdx:_0x46f95c}=_0x49f404,_0xa4c23e=_0x1cfd6e[0x0];if(!requireNameOrPath(_0xa4c23e))return 0x1;if(_0x2ce19d['verbose'])console[_0x311013(0x269)](_0x311013(0x29f)+_0xa4c23e);const {journeyId:_0x5ded7c}=await resolveJourneyIdFromInput(_0xa4c23e,_0x2ce19d,_0x46f95c),_0x298bfe=await withSpinner(_0x311013(0x237),()=>_0x46f95c[_0x311013(0x29c)][_0x311013(0x21e)](_0x5ded7c),{'verbose':_0x2ce19d[_0x311013(0x200)]}),{bundleName:_0x1c8330,versions:_0x1a3852,latestJourneyId:_0x39fed4}=_0x298bfe[_0x311013(0x22f)];console['error'](_0x1c8330+':\x20'+_0x1a3852[_0x311013(0x267)]+_0x311013(0x1e9)+(_0x1a3852[_0x311013(0x267)]!==0x1?'s':''));const _0x3acdc0=_0x1a3852[_0x311013(0x20a)](_0x1434d3=>({'version':_0x1434d3[_0x311013(0x1ec)],'journey_id':_0x1434d3[_0x311013(0x2aa)],'name':_0x1434d3[_0x311013(0x29b)],'state':_0x1434d3[_0x311013(0x2bb)],'paused':_0x1434d3[_0x311013(0x1f6)],'latest':_0x1434d3[_0x311013(0x2aa)]===_0x39fed4,'created_at':_0x1434d3[_0x311013(0x258)]}));return await handleSDKOutput(_0x3acdc0,_0x2ce19d),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x23c);[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x242);async[a28_0x8121c3(0x218)](_0x1afee5){const _0x4d927b=a28_0x8121c3,{options:_0x3afe97,args:_0x40abc0,tdx:_0x26cb13}=_0x1afee5,_0x110008=_0x40abc0[0x0];if(!requireNameOrPath(_0x110008))return 0x1;if(_0x3afe97[_0x4d927b(0x200)])console[_0x4d927b(0x269)](_0x4d927b(0x29f)+_0x110008);const {journeyId:_0x193cf4,journeyName:_0x13405b}=await resolveJourneyIdFromInput(_0x110008,_0x3afe97,_0x26cb13);if(!_0x3afe97[_0x4d927b(0x1e6)]){const _0x392019=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x13405b+'\x22?');if(!_0x392019)return console['error'](_0x4d927b(0x2a2)),0x0;}const _0x507381=await withSpinner('Creating\x20new\x20version...',()=>_0x26cb13['journey'][_0x4d927b(0x1ff)](_0x193cf4),{'verbose':_0x3afe97[_0x4d927b(0x200)]}),_0x1787d7=_0x507381[_0x4d927b(0x22f)];return console[_0x4d927b(0x269)](a28_0x302f34[_0x4d927b(0x1db)]('✔')+'\x20Created\x20v'+_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x1ec)]+'\x20(draft)\x20—\x20\x22'+_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x29b)]+'\x22'),console['error'](_0x4d927b(0x1e0)+_0x1787d7['id']),await handleSingleObjectOutput({'id':_0x1787d7['id'],'name':_0x1787d7[_0x4d927b(0x1eb)]['name'],'version':_0x1787d7[_0x4d927b(0x1eb)]['versionNumber'],'state':_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x2bb)],'bundle_id':_0x1787d7[_0x4d927b(0x1eb)]['journeyBundleId'],'created_at':_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x258)]},_0x3afe97),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x282);async['execute'](_0x261c93){const _0x485edb=a28_0x8121c3,{options:_0x167bcb,args:_0x4649a5,tdx:_0x19001b}=_0x261c93,_0x587b0c=_0x4649a5[0x0];if(!requireNameOrPath(_0x587b0c))return 0x1;const _0x594ff4=_0x167bcb[_0x485edb(0x262)];if(!_0x594ff4)return console[_0x485edb(0x269)](_0x485edb(0x21a)),console['error'](_0x485edb(0x232)),0x1;const _0x57b134=parseInt(_0x594ff4,0xa);if(isNaN(_0x57b134)||_0x57b134<0x1)return console[_0x485edb(0x269)](_0x485edb(0x220)+_0x594ff4),0x1;if(_0x167bcb['verbose'])console[_0x485edb(0x269)](_0x485edb(0x29f)+_0x587b0c+_0x485edb(0x2c0)+_0x57b134);const {journeyId:_0x5d9ef8,parentSegmentId:_0x30d4e8}=await resolveJourneyIdFromInput(_0x587b0c,_0x167bcb,_0x19001b),_0x58d412=await withSpinner(_0x485edb(0x25b),()=>_0x19001b['journey']['listVersions'](_0x5d9ef8),{'verbose':_0x167bcb[_0x485edb(0x200)]}),{versions:_0x3372b8,latestJourneyId:_0xd51f57}=_0x58d412[_0x485edb(0x22f)],_0x10ea4a=_0x3372b8['find'](_0x36b257=>_0x36b257['versionNumber']===_0x57b134);if(!_0x10ea4a){const _0x5b50ba=_0x3372b8['map'](_0x25733e=>'v'+_0x25733e[_0x485edb(0x1ec)])[_0x485edb(0x2c2)](',\x20');return console[_0x485edb(0x269)](_0x485edb(0x223)+_0x57b134+_0x485edb(0x2ab)+_0x5b50ba),0x1;}const _0x4e754c=await withSpinner('Getting\x20version\x20'+_0x57b134+'\x20details...',()=>_0x19001b['journey'][_0x485edb(0x1d3)](_0x10ea4a[_0x485edb(0x2aa)]),{'verbose':_0x167bcb[_0x485edb(0x200)]}),_0x1778c4=_0x4e754c[_0x485edb(0x22f)],_0x1d09bf=getConsoleNextUrl(_0x167bcb[_0x485edb(0x2a5)],'/app/ps/'+_0x30d4e8+_0x485edb(0x1e7)+_0x10ea4a['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x1778c4['id'],'name':_0x1778c4['attributes'][_0x485edb(0x29b)],'version':_0x1778c4['attributes'][_0x485edb(0x1ec)],'description':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x27d)],'state':_0x1778c4['attributes'][_0x485edb(0x2bb)],'paused':_0x1778c4['attributes'][_0x485edb(0x1f6)],'reentry_mode':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x226)],'stages':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x278)]?.['length']||0x0,..._0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x249)]&&{'goal':_0x1778c4['attributes'][_0x485edb(0x249)]['name']},'latest':_0x10ea4a[_0x485edb(0x2aa)]===_0xd51f57,'created_at':_0x1778c4['attributes']['createdAt'],'updated_at':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x2a8)],'url':_0x1d09bf},_0x167bcb),0x0;}}
|
|
1
|
+
const a28_0xa6993f=a28_0x4f8b;(function(_0x57c2b5,_0x359b67){const _0x597eba=a28_0x4f8b,_0x2f3b11=_0x57c2b5();while(!![]){try{const _0x47e8e3=-parseInt(_0x597eba(0x139))/0x1+-parseInt(_0x597eba(0x184))/0x2+parseInt(_0x597eba(0x168))/0x3*(-parseInt(_0x597eba(0x110))/0x4)+parseInt(_0x597eba(0x111))/0x5+parseInt(_0x597eba(0xb1))/0x6*(parseInt(_0x597eba(0x82))/0x7)+-parseInt(_0x597eba(0xf4))/0x8*(-parseInt(_0x597eba(0x121))/0x9)+parseInt(_0x597eba(0x114))/0xa;if(_0x47e8e3===_0x359b67)break;else _0x2f3b11['push'](_0x2f3b11['shift']());}catch(_0x4393d3){_0x2f3b11['push'](_0x2f3b11['shift']());}}}(a28_0x3569,0x73242));import a28_0x326cef from'chalk';function a28_0x3569(){const _0x4274b3=['options','segment','24HsyvFi','stages','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','data','rootFolderId','journeyBundleName','database','✔\x20Pulled\x20','\x20unchanged\x20files','\x20details...','Getting\x20journey\x20details...','List\x20all\x20versions\x20of\x20a\x20journey','✔\x20Journey\x20\x22','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','attributes','listJourneysFromParentSegment','resume','journey:traffic','createdAt','Fetching\x20','utf-8','journey:version:view','\x20\x20-\x20','buildIdToEmailMap','green','listActivationsFlat','✔\x20All\x20files\x20are\x20up\x20to\x20date','Pause\x20a\x20running\x20journey','148NeeyAz','2434035tJWGWh','cyan','Folder\x20path:\x20','3337590IoVxRV','Getting\x20column\x20mapping...','milestoneSize','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)','updatedAt','replace','Resume\x20a\x20paused\x20journey','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20activation','dryRun','yellow','from','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','629595crqYhl','\x20not\x20found.\x20Available:\x20','tsv','\x20=\x20','(paused)','Error:\x20Invalid\x20--type\x20\x22','all','helpText','isNew','\x20journey','conversion','📁\x20','resolveParentId','listVersions','\x20journey\x20files\x20to\x20','parent_segment','push','\x20(draft)\x20—\x20\x22','map','Error:\x20Stage\x20\x22','INVALID_ARGUMENT','\x20new\x20files','/app/ps/','site','438466mkxHgy','journey:stats','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Getting\x20journey\x20traffic\x20data...','-\x20no\x20files\x20written','.yml','getColumnMapping','toLowerCase','parentSegment','filter','Show\x20journey\x20details','includeHistory','\x5c$&','Warning:\x20Could\x20not\x20resolve\x20segment\x20','hasPeriod','root\x20folder','find','absolutePath','Input:\x20','Listing\x20journey\x20activations...','journey:list','base','add','✔\x20Context\x20set:\x20','getTrafficData','(running)','targetDir','resolveJourneyId','Aborted.','dim','journeys','Getting\x20version\x20','table','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','resourceName','Resolved\x20YAML\x20file:\x20','Show\x20journey\x20statistics','message','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','goalSize','segmentName','content','\x20Created\x20v','nodes','Error:\x20','getStatistics','9066ICjCoB','audienceId','Error:\x20Parent\x20segment\x20context\x20required','errorCode','jsonl','\x20version','sort','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','log','values','rule','pause','Fetching\x20journeys\x20and\x20folders...','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','folderPath','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','Write\x20','completeMilestoneRate','Listing\x20journeys...','journey:version:create','✔\x20Found\x20','journey:columns','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Target\x20directory:\x20','state','journeyBundleId','get','archived','1426212ufKBZv','Resolving\x20journey...','entries','stageNameMap','length','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','renderStats','/j/da/je','1169zYqJXF','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20\x20Preserving\x20local\x20segment\x20name:\x20','file','then','Show\x20journey\x20table\x20column\x20mapping','...','limit','(root)','localeCompare','\x22\x20paused','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20(rule\x20match)','No\x20journeys\x20found','relativePath','Parent\x20segment:\x20','(archived)','draft','activation','set','Cancelled','journey:activations','red','Resolving\x20version...','activationParams','journey:view','segments','exitOrJumpRate','Pausing\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','yes','web','goal','Found\x20','journey:pull','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','folderId','\x20journeys','createVersion','bold','(draft)','filePath','format','test','history','25314uvMlVJ','type','Table:\x20','\x20changed\x20files','reentryMode','\x20\x20Folder\x20path:\x20','size','🗺️\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journey','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','paused','journeyStages','\x20\x20Statistics\x20not\x20available','links','verbose','versionNumber','journeyName','\x20\x20Name:\x20','connection','launched','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','/j/da','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','folders','Database:\x20','name','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','completed','Error:\x20Journey\x20\x27','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','\x20->\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','exitOrJumpSize','/e/','\x20\x20Journey\x20ID:\x20','cwd','hasChanges','description','\x0aPull\x20summary:','Error:\x20Journey\x20not\x20found:\x20','Getting\x20journey\x20statistics...','join','Creating\x20new\x20version...','json','Pattern:\x20','getJourney','getSegment','enteredSize','\x27\x20not\x20found\x20in\x20','error','completionRate','segmentPushCommand','Error:\x20--version\x20option\x20is\x20required','blue','Journey\x20name:\x20','journeyId','\x20\x20Parent\x20segment:\x20','Listing\x20journey\x20versions...','no_parent','Resolving\x20parent\x20segment...','journey:push','repeat'];a28_0x3569=function(){return _0x4274b3;};return a28_0x3569();}import a28_0x4f205a 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';function a28_0x4f8b(_0x48b7ff,_0x1edc40){_0x48b7ff=_0x48b7ff-0x7c;const _0x356958=a28_0x3569();let _0x4f8bc1=_0x356958[_0x48b7ff];return _0x4f8bc1;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x11b7e8){const _0x9b66d8=a28_0x4f8b;return!_0x11b7e8&&(console[_0x9b66d8(0xe5)](_0x9b66d8(0x7f)),console['error'](_0x9b66d8(0x83))),!!_0x11b7e8;}function withJsonFormat(_0x57e42e){const _0x2d4fba=a28_0x4f8b;if(!_0x57e42e['format']&&!_0x57e42e[_0x2d4fba(0xdf)]&&!_0x57e42e[_0x2d4fba(0x16c)]&&!_0x57e42e[_0x2d4fba(0x123)])return{..._0x57e42e,'format':_0x2d4fba(0xdf),'json':!![]};return _0x57e42e;}function formatJourneyState(_0x2abd45){const _0x4a624e=a28_0x4f8b;switch(_0x2abd45){case _0x4a624e(0xc6):return a28_0x326cef[_0x4a624e(0x10c)](_0x4a624e(0x152));case _0x4a624e(0x94):return a28_0x326cef[_0x4a624e(0x156)](_0x4a624e(0xac));case _0x4a624e(0xbd):return a28_0x326cef[_0x4a624e(0x11e)](_0x4a624e(0x125));case _0x4a624e(0xcf):return a28_0x326cef[_0x4a624e(0xe9)]('(completed)');case _0x4a624e(0x183):return a28_0x326cef[_0x4a624e(0x156)](_0x4a624e(0x93));default:return'('+_0x2abd45+')';}}function formatJourneyItem(_0x1a39b0,_0x4f9731='',_0x2b4a85){const _0x595a39=a28_0x4f8b,_0x16616e=formatJourneyState(_0x1a39b0[_0x595a39(0x180)]),_0x12d331=_0x2b4a85?hyperlink(_0x1a39b0[_0x595a39(0xf9)],_0x2b4a85):_0x1a39b0['journeyBundleName'];return _0x4f9731+_0x595a39(0xb8)+_0x12d331+'\x20'+_0x16616e;}function escapeRegex(_0x4fb382){const _0x4bbe23=a28_0x4f8b;return _0x4fb382[_0x4bbe23(0x119)](/[.*+?^${}()|[\]\\]/g,_0x4bbe23(0x145));}function globToRegex(_0x3fb466){const _0x130ce7=a28_0x4f8b,_0x420ea5=_0x3fb466['split']('*')[_0x130ce7(0x133)](escapeRegex);return new RegExp(_0x420ea5[_0x130ce7(0xdd)]('.*'),'i');}function buildRuleToNameMapping(_0x41267f){const _0x37d3d3=a28_0x4f8b,_0x4838b3=new Map();if(_0x41267f['segments'])for(const [_0x30954d,_0x2b5f53]of Object[_0x37d3d3(0x7c)](_0x41267f[_0x37d3d3(0x9d)])){if(_0x2b5f53['rule']){const _0x504a8d=serializeRule(_0x2b5f53[_0x37d3d3(0x172)]),_0x52aa79=_0x4838b3['get'](_0x504a8d);_0x52aa79?_0x52aa79[_0x37d3d3(0x131)](_0x30954d):_0x4838b3['set'](_0x504a8d,[_0x30954d]);}}return _0x4838b3;}async function resolveJourneyIdFromInput(_0x119293,_0x1185b6,_0x3c9309){const _0x51b85b=a28_0x4f8b,_0x362e02=await resolveJourneyTarget(_0x119293,_0x1185b6['parentSegment'],_0x1185b6[_0x51b85b(0xc1)]),_0x58772c=_0x362e02[_0x51b85b(0x141)];if(!_0x58772c)throw new SDKError(ErrorCode[_0x51b85b(0x135)],_0x51b85b(0xce));const _0x457e5a=await withSpinner(_0x51b85b(0xef),()=>_0x3c9309[_0x51b85b(0xf3)]['resolveParentId'](_0x58772c),{'verbose':_0x1185b6['verbose']}),_0x31ca15=_0x457e5a[_0x51b85b(0xf7)],_0xba8d25=await withSpinner(_0x51b85b(0x185),()=>_0x3c9309['journey'][_0x51b85b(0x154)](_0x31ca15,_0x362e02[_0x51b85b(0xc3)]),{'verbose':_0x1185b6[_0x51b85b(0xc1)]});return{'journeyId':_0xba8d25[_0x51b85b(0xf7)],'journeyName':_0x362e02['journeyName'],'parentSegmentId':_0x31ca15};}async function resolveJourneyTarget(_0x1877d8,_0x8c90f2,_0x4eeb48){const _0x363677=a28_0x4f8b;if(isYamlFilePath(_0x1877d8))try{const _0x8d5d58=await resolveYamlFilePath(_0x1877d8);return _0x4eeb48&&(console[_0x363677(0xe5)](_0x363677(0x15d)+_0x1877d8),console[_0x363677(0xe5)](_0x363677(0xec)+_0x8d5d58[_0x363677(0x141)]),console[_0x363677(0xe5)](_0x363677(0xc4)+_0x8d5d58['segmentName']),console['error'](_0x363677(0xb6)+(_0x8d5d58[_0x363677(0x176)]||_0x363677(0x8a)))),{'journeyName':_0x8d5d58[_0x363677(0x162)],'parentSegment':_0x8d5d58['parentSegment'],'resolved':_0x8d5d58};}catch(_0x4533ef){throw new SDKError(ErrorCode[_0x363677(0x135)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4533ef[_0x363677(0x15f)]);}if(!_0x8c90f2)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x363677(0x13b));return{'journeyName':_0x1877d8,'parentSegment':_0x8c90f2};}export class JourneyListCommand extends BaseCommand{[a28_0xa6993f(0xcd)]=a28_0xa6993f(0x14d);[a28_0xa6993f(0xd9)]='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x5a20ec){const _0x541027=a28_0xa6993f,{options:_0x2684e3,args:_0x4bade4,tdx:_0x63dce7}=_0x5a20ec,_0x189bd2=_0x4bade4[0x0],_0x11a95e=_0x2684e3[_0x541027(0x141)];if(!_0x11a95e)return console[_0x541027(0xe5)](_0x541027(0x16a)),console[_0x541027(0xe5)](_0x541027(0x15a)),0x1;const _0x441173=await withSpinner(_0x541027(0xef),()=>_0x63dce7['segment'][_0x541027(0x12d)](_0x11a95e),{'verbose':_0x2684e3['verbose']}),_0xc89d1=_0x441173[_0x541027(0xf7)];_0x2684e3[_0x541027(0xc1)]&&(console['error'](_0x541027(0x92)+_0x11a95e+'\x20(ID:\x20'+_0xc89d1+')'),_0x189bd2&&console['error'](_0x541027(0xe0)+_0x189bd2));const _0x5866a9=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x63dce7[_0x541027(0xf3)]['getParentFull'](_0xc89d1),{'verbose':_0x2684e3[_0x541027(0xc1)]}),_0x122539=_0x5866a9[_0x541027(0xf7)],_0x1e5de3=_0x122539[_0x541027(0xf8)],_0x3fbeae=await withSpinner(_0x541027(0x17a),()=>_0x63dce7[_0x541027(0xbb)]['listJourneysWithFolders'](_0xc89d1,_0x1e5de3),{'verbose':_0x2684e3['verbose']});let _0x2d3ce5=_0x3fbeae[_0x541027(0xf7)][_0x541027(0x157)];const _0x488353=_0x3fbeae['data'][_0x541027(0xcb)],_0x10539e=new Map();for(const _0x4bdc4a of _0x488353){_0x10539e[_0x541027(0x96)](_0x4bdc4a['id'],_0x4bdc4a[_0x541027(0xcd)]);}if(_0x189bd2){const _0x5b43bd=globToRegex(_0x189bd2);_0x2d3ce5=_0x2d3ce5['filter'](_0x41d55e=>_0x5b43bd[_0x541027(0xaf)](_0x41d55e[_0x541027(0xf9)]));}console['error'](_0x541027(0x17c)+_0x2d3ce5[_0x541027(0x7e)]+_0x541027(0x12a)+(_0x2d3ce5['length']!==0x1?'s':''));const _0x4488b8=_0x357650=>{const _0x1b4b09=_0x541027;return getConsoleNextUrl(_0x2684e3['site'],_0x1b4b09(0x137)+_0xc89d1+_0x1b4b09(0xd5)+_0x357650+_0x1b4b09(0xc8));};if(_0x2684e3['format']===_0x541027(0x159))await handleSDKOutput(_0x2d3ce5,_0x2684e3);else{if(_0x2684e3[_0x541027(0xae)]===_0x541027(0xdf)){const _0x93378f=_0x2d3ce5[_0x541027(0x133)](_0x510325=>({..._0x510325,'url':_0x4488b8(_0x510325['id'])}));await handleSDKOutput(_0x93378f,_0x2684e3);}else{console['log']('['+_0x11a95e+']');const _0x4dc93e=new Map(),_0x4f2ceb=[];for(const _0x4a06ed of _0x2d3ce5){if(!_0x4a06ed[_0x541027(0xa8)]||_0x4a06ed[_0x541027(0xa8)]===_0x1e5de3)_0x4f2ceb['push'](_0x4a06ed);else{const _0x1cba22=_0x4dc93e[_0x541027(0x182)](_0x4a06ed[_0x541027(0xa8)])||[];_0x1cba22[_0x541027(0x131)](_0x4a06ed),_0x4dc93e[_0x541027(0x96)](_0x4a06ed[_0x541027(0xa8)],_0x1cba22);}}const _0x4bfc1b=(_0x391dd3,_0x548aaf)=>_0x391dd3[_0x541027(0xf9)][_0x541027(0x8b)](_0x548aaf[_0x541027(0xf9)],undefined,{'sensitivity':_0x541027(0x14e)});_0x4f2ceb['sort'](_0x4bfc1b);for(const _0x122255 of _0x4f2ceb){console['log'](formatJourneyItem(_0x122255,'',_0x4488b8(_0x122255['id'])));}const _0x3d5a3a=[..._0x4dc93e[_0x541027(0x7c)]()][_0x541027(0x16e)]((_0x40c3d1,_0x2ecb1b)=>{const _0x299fd5=_0x541027,_0x345dba=_0x10539e[_0x299fd5(0x182)](_0x40c3d1[0x0])||_0x40c3d1[0x0],_0x2baf6d=_0x10539e[_0x299fd5(0x182)](_0x2ecb1b[0x0])||_0x2ecb1b[0x0];return _0x345dba[_0x299fd5(0x8b)](_0x2baf6d,undefined,{'sensitivity':_0x299fd5(0x14e)});});for(const [_0x10a161,_0x299b18]of _0x3d5a3a){const _0x54fd43=_0x10539e['get'](_0x10a161)||_0x10a161;console['log'](_0x541027(0x12c)+_0x54fd43),_0x299b18[_0x541027(0x16e)](_0x4bfc1b);for(const _0x775e5a of _0x299b18){console[_0x541027(0x170)](formatJourneyItem(_0x775e5a,'\x20\x20',_0x4488b8(_0x775e5a['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0xa6993f(0xcd)]=a28_0xa6993f(0x9c);[a28_0xa6993f(0xd9)]=a28_0xa6993f(0x143);async[a28_0xa6993f(0x8d)](_0x5a8729){const _0x4ef406=a28_0xa6993f,{options:_0x27295f,args:_0x35ed0b,tdx:_0x37f603}=_0x5a8729,_0x4a2072=_0x35ed0b[0x0];if(!_0x4a2072)return console[_0x4ef406(0xe5)](_0x4ef406(0x7f)),console[_0x4ef406(0xe5)](_0x4ef406(0x160)),console[_0x4ef406(0xe5)]('Options:'),console[_0x4ef406(0xe5)](_0x4ef406(0xd3)),0x1;_0x27295f['verbose']&&console[_0x4ef406(0xe5)]('Input:\x20'+_0x4a2072);const {journeyId:_0x62fa0e,parentSegmentId:_0xdfbc3f}=await resolveJourneyIdFromInput(_0x4a2072,_0x27295f,_0x37f603);if(_0x27295f[_0x4ef406(0xa2)]){const _0x200e53=getConsoleNextUrl(_0x27295f['site'],_0x4ef406(0x137)+_0xdfbc3f+'/e/'+_0x62fa0e+_0x4ef406(0x81));return console[_0x4ef406(0xe5)](a28_0x326cef[_0x4ef406(0x10c)]('✔')+'\x20Opening\x20'+a28_0x326cef['cyan'](_0x200e53)),openBrowser(_0x200e53),0x0;}const _0x533eac=await withSpinner(_0x4ef406(0xfe),()=>_0x37f603['journey']['getJourney'](_0x62fa0e),{'verbose':_0x27295f[_0x4ef406(0xc1)]}),_0x505d47=_0x533eac[_0x4ef406(0xf7)],_0x4c8100=_0x27295f['includeStats'];let _0x2e0503;if(_0x4c8100)try{const _0x36eaec=await withSpinner(_0x4ef406(0xdc),()=>_0x37f603[_0x4ef406(0xbb)][_0x4ef406(0x167)](_0x62fa0e),{'verbose':_0x27295f[_0x4ef406(0xc1)]});_0x2e0503=_0x36eaec[_0x4ef406(0xf7)];}catch{_0x27295f[_0x4ef406(0xc1)]&&console[_0x4ef406(0xe5)](_0x4ef406(0xbf));}const _0x3ff7e3=getConsoleNextUrl(_0x27295f[_0x4ef406(0x138)],'/app/ps/'+_0xdfbc3f+_0x4ef406(0xd5)+_0x62fa0e+_0x4ef406(0x81)),_0x257806={'id':_0x505d47['id'],'name':_0x505d47[_0x4ef406(0x102)][_0x4ef406(0xcd)],'description':_0x505d47[_0x4ef406(0x102)][_0x4ef406(0xd9)],'state':_0x505d47[_0x4ef406(0x102)]['state'],'paused':_0x505d47[_0x4ef406(0x102)][_0x4ef406(0xbd)],'reentry_mode':_0x505d47[_0x4ef406(0x102)][_0x4ef406(0xb5)],'stages':_0x505d47[_0x4ef406(0x102)][_0x4ef406(0xbe)]?.[_0x4ef406(0x7e)]||0x0,..._0x505d47[_0x4ef406(0x102)]['goal']&&{'goal':_0x505d47['attributes'][_0x4ef406(0xa3)][_0x4ef406(0xcd)]},..._0x2e0503&&{'statistics':{'size':_0x2e0503['size'],'entered':_0x2e0503['enteredSize'],'goal_achieved':_0x2e0503[_0x4ef406(0x161)],'completion_rate':_0x2e0503[_0x4ef406(0xe6)],'exit_or_jump':_0x2e0503[_0x4ef406(0xd4)],'exit_or_jump_rate':_0x2e0503['exitOrJumpRate'],'stages':_0x2e0503['stages']}},'url':_0x3ff7e3};return await handleSingleObjectOutput(_0x257806,_0x27295f),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a28_0xa6993f(0x13a);[a28_0xa6993f(0xd9)]=a28_0xa6993f(0x15e);async[a28_0xa6993f(0x8d)](_0x849d3a){const _0x3247ae=a28_0xa6993f,{options:_0x4e1198,args:_0xeb621c,tdx:_0x58bbbd}=_0x849d3a,_0x343cc7=_0xeb621c[0x0];if(!requireNameOrPath(_0x343cc7))return 0x1;_0x4e1198[_0x3247ae(0xc1)]&&console['error'](_0x3247ae(0x14b)+_0x343cc7);const _0x15477a=_0x4e1198,_0x435be5=_0x15477a[_0x3247ae(0x11f)],_0x45af65=_0x15477a['to'],_0x8ac0ea=_0x15477a[_0x3247ae(0x144)],_0x1df190=_0x15477a['stage'];_0x8ac0ea&&!_0x435be5&&!_0x45af65&&console[_0x3247ae(0xe5)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x57d645=_0x8ac0ea?withJsonFormat(_0x4e1198):_0x4e1198,{journeyId:_0xe087e4,journeyName:_0x530d19}=await resolveJourneyIdFromInput(_0x343cc7,_0x57d645,_0x58bbbd),_0x24ac1b=_0x435be5||_0x45af65?{'from':_0x435be5,'to':_0x45af65}:undefined,_0xd884ca=await withSpinner(_0x3247ae(0xdc),()=>Promise[_0x3247ae(0x127)]([_0x58bbbd[_0x3247ae(0xbb)][_0x3247ae(0xe1)](_0xe087e4),_0x58bbbd['journey']['getStatistics'](_0xe087e4,_0x24ac1b)]),{'verbose':_0x57d645['verbose']}),[_0x4e5837,_0x3fcea2]=_0xd884ca['data'];if(!_0x3fcea2||_0x3fcea2['journeyId']===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x530d19),console['error'](_0x3247ae(0x11b)),0x0;const _0x59f719=buildStageNameMap(_0x4e5837),_0x37c148=!!(_0x24ac1b&&_0x3fcea2[_0x3247ae(0xb0)]?.['length']),_0x544ce9={'stageNameMap':_0x59f719,'hasPeriod':_0x37c148,'includeHistory':!!_0x8ac0ea};if(_0x1df190&&_0x3fcea2[_0x3247ae(0xf5)]){const _0x1a910e=_0x3fcea2[_0x3247ae(0xf5)]['find'](_0x4967be=>{const _0xcf8cdd=_0x3247ae,_0x4b2ffb=_0x59f719['get'](_0x4967be['id'])??'';return _0x4b2ffb[_0xcf8cdd(0x140)]()===_0x1df190['toLowerCase']();});if(_0x1a910e)return await handleSingleObjectOutput(formatStageStats(_0x1a910e,_0x544ce9),_0x57d645),0x0;const _0x49ecf9=_0x3fcea2[_0x3247ae(0xf5)][_0x3247ae(0x133)](_0x5a6f06=>_0x59f719['get'](_0x5a6f06['id'])??_0x5a6f06['id']);return console['error'](_0x3247ae(0x134)+_0x1df190+'\x22\x20not\x20found'),console['error']('Available\x20stages:\x20'+_0x49ecf9['join'](',\x20')),0x1;}const _0x30ed8a=_0x3fcea2[_0x3247ae(0xf5)]?.[_0x3247ae(0x133)](_0x2ab13c=>formatStageStats(_0x2ab13c,_0x544ce9)),_0x3357ad=assembleJourneyStats(_0x3fcea2,{'from':_0x435be5,'to':_0x45af65,'includeHistory':_0x8ac0ea});return await this['renderStats'](_0x3357ad,_0x30ed8a??[],_0x57d645),0x0;}async[a28_0xa6993f(0x80)](_0xc602cc,_0x33b115,_0x124a4c){const _0x1a504b=a28_0xa6993f,_0x462620=_0x124a4c[_0x1a504b(0xae)]==='json'||_0x124a4c[_0x1a504b(0xae)]===_0x1a504b(0x16c)||_0x124a4c[_0x1a504b(0xdf)]||_0x124a4c[_0x1a504b(0x16c)];if(_0x462620){_0xc602cc['stages']=_0x33b115,await handleSingleObjectOutput(_0xc602cc,_0x124a4c);return;}await handleSingleObjectOutput(_0xc602cc,_0x124a4c);for(const _0x2951f8 of _0x33b115){console[_0x1a504b(0x170)](''),console[_0x1a504b(0x170)](String(a28_0x326cef[_0x1a504b(0x112)][_0x1a504b(0xab)]('['+_0x2951f8[_0x1a504b(0xcd)]+']'))+a28_0x326cef[_0x1a504b(0x156)]('\x20'+_0x2951f8['id']));const {id:_0x173014,name:_0x30f692,..._0x23ef67}=_0x2951f8;await handleSingleObjectOutput(_0x23ef67,_0x124a4c);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0xa6993f(0xcd)]=a28_0xa6993f(0x105);['description']='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0xa6993f(0x8d)](_0x8b58c6){const _0xc93e70=a28_0xa6993f,{options:_0x5dd15a,args:_0x412d51,tdx:_0x1c1cd5}=_0x8b58c6,_0x9f50c2=_0x412d51[0x0];if(!requireNameOrPath(_0x9f50c2))return 0x1;_0x5dd15a[_0xc93e70(0xc1)]&&console['error']('Input:\x20'+_0x9f50c2);const _0x376e1b=_0x5dd15a,_0x169d7b=_0x376e1b['type'],_0x49c9f3=_0x376e1b[_0xc93e70(0x11f)],_0x590f51=_0x376e1b['to'],_0x4d2ca3=_0x376e1b[_0xc93e70(0x89)];if(_0x169d7b&&_0x169d7b!==_0xc93e70(0x12b)&&_0x169d7b!==_0xc93e70(0x95))return console[_0xc93e70(0xe5)](_0xc93e70(0x126)+_0x169d7b+_0xc93e70(0xa6)),0x1;const _0x4117e8=withJsonFormat(_0x5dd15a),{journeyId:_0x4262c7,journeyName:_0x35c97f}=await resolveJourneyIdFromInput(_0x9f50c2,_0x4117e8,_0x1c1cd5),_0xa051b0={'type':_0x169d7b,'from':_0x49c9f3,'to':_0x590f51,'limit':_0x4d2ca3},_0x4d3318=await withSpinner(_0xc93e70(0x13c),()=>_0x1c1cd5['journey'][_0xc93e70(0x151)](_0x4262c7,_0xa051b0),{'verbose':_0x4117e8['verbose']}),_0x337fd9=_0x4d3318[_0xc93e70(0xf7)],_0x234fdd=_0x337fd9[_0xc93e70(0x12b)]&&(_0x337fd9['conversion'][_0xc93e70(0x165)][_0xc93e70(0x7e)]>0x0||_0x337fd9['conversion'][_0xc93e70(0xc0)][_0xc93e70(0x7e)]>0x0),_0x33bb46=_0x337fd9[_0xc93e70(0x95)]&&_0x337fd9[_0xc93e70(0x95)][_0xc93e70(0x7e)]>0x0;if(!_0x234fdd&&!_0x33bb46)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x35c97f),console['error']('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x49c9f3&&_0x590f51&&console[_0xc93e70(0xe5)](_0xc93e70(0xd1)),0x0;return await handleSingleObjectOutput(_0x337fd9,_0x4117e8),0x0;}}function formatStageStats(_0x74952,_0x44489b){const _0x1cb2ea=a28_0xa6993f,_0x36726e=_0x44489b[_0x1cb2ea(0x147)]&&_0x74952[_0x1cb2ea(0xb0)]?.['length']?aggregateStageHistory(_0x74952[_0x1cb2ea(0xb0)]):{'size':_0x74952[_0x1cb2ea(0xb7)],'entered':_0x74952[_0x1cb2ea(0xe3)],'milestone':_0x74952[_0x1cb2ea(0x116)],'milestone_rate':_0x74952[_0x1cb2ea(0x179)],'exit_or_jump':_0x74952[_0x1cb2ea(0xd4)],'exit_or_jump_rate':_0x74952[_0x1cb2ea(0x9e)]},_0x150ab6={'id':_0x74952['id'],'name':_0x44489b[_0x1cb2ea(0x7d)][_0x1cb2ea(0x182)](_0x74952['id'])??_0x74952['id'],..._0x36726e};return _0x44489b['hasPeriod']&&_0x44489b['includeHistory']&&_0x74952[_0x1cb2ea(0xb0)]&&(_0x150ab6[_0x1cb2ea(0xb0)]=_0x74952[_0x1cb2ea(0xb0)]),_0x150ab6;}export class JourneyPauseCommand extends BaseCommand{[a28_0xa6993f(0xcd)]='journey:pause';[a28_0xa6993f(0xd9)]=a28_0xa6993f(0x10f);async[a28_0xa6993f(0x8d)](_0x496655){const _0x4a02f6=a28_0xa6993f,{options:_0x2a63c0,args:_0x20f6bb,tdx:_0x1e0ed8}=_0x496655,_0xee1da4=_0x20f6bb[0x0];if(!requireNameOrPath(_0xee1da4))return 0x1;_0x2a63c0['verbose']&&console[_0x4a02f6(0xe5)](_0x4a02f6(0x14b)+_0xee1da4);const {journeyId:_0x3d125c,journeyName:_0x4d550a}=await resolveJourneyIdFromInput(_0xee1da4,_0x2a63c0,_0x1e0ed8);if(!_0x2a63c0[_0x4a02f6(0xa1)]){const _0x14936e=await confirm(_0x4a02f6(0x120)+_0x4d550a+'\x22?');if(!_0x14936e)return console[_0x4a02f6(0xe5)]('Cancelled'),0x0;}const _0x2f377c=await withSpinner(_0x4a02f6(0x9f),()=>_0x1e0ed8[_0x4a02f6(0xbb)][_0x4a02f6(0x173)](_0x3d125c),{'verbose':_0x2a63c0[_0x4a02f6(0xc1)]}),_0x45e4ab=_0x2f377c[_0x4a02f6(0xf7)];return console[_0x4a02f6(0xe5)]('✔\x20Journey\x20\x22'+_0x45e4ab['attributes']['name']+_0x4a02f6(0x8c)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0xa6993f(0xcd)]='journey:resume';[a28_0xa6993f(0xd9)]=a28_0xa6993f(0x11a);async['execute'](_0x504f91){const _0x5a0702=a28_0xa6993f,{options:_0x567d38,args:_0x2b0b28,tdx:_0x57146d}=_0x504f91,_0x23877a=_0x2b0b28[0x0];if(!requireNameOrPath(_0x23877a))return 0x1;_0x567d38[_0x5a0702(0xc1)]&&console[_0x5a0702(0xe5)](_0x5a0702(0x14b)+_0x23877a);const {journeyId:_0x4f3729,journeyName:_0x296412}=await resolveJourneyIdFromInput(_0x23877a,_0x567d38,_0x57146d);if(!_0x567d38[_0x5a0702(0xa1)]){const _0x43ecf5=await confirm(_0x5a0702(0xa7)+_0x296412+'\x22?');if(!_0x43ecf5)return console[_0x5a0702(0xe5)](_0x5a0702(0x97)),0x0;}const _0x4c1ee2=await withSpinner('Resuming\x20journey...',()=>_0x57146d['journey'][_0x5a0702(0x104)](_0x4f3729),{'verbose':_0x567d38[_0x5a0702(0xc1)]}),_0x356acb=_0x4c1ee2[_0x5a0702(0xf7)];return console[_0x5a0702(0xe5)](_0x5a0702(0x100)+_0x356acb[_0x5a0702(0x102)][_0x5a0702(0xcd)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0xa6993f(0xcd)]=a28_0xa6993f(0xa5);[a28_0xa6993f(0xd9)]=a28_0xa6993f(0xca);async[a28_0xa6993f(0x8d)](_0x2d6046){const _0x43aaaa=a28_0xa6993f,{options:_0x2aaedb,args:_0x526c1f,tdx:_0x201436}=_0x2d6046,_0x5507a3=_0x2aaedb,_0x15a92e=_0x526c1f[0x0],_0x1e7dfb=_0x15a92e&&isYamlFilePath(_0x15a92e),_0x526778=await resolveTarget({'arg':_0x1e7dfb?_0x15a92e:undefined,'contextParent':_0x2aaedb['parentSegment'],'cwd':process[_0x43aaaa(0xd7)]()});if(!isSuccessfulResolution(_0x526778))return _0x526778[_0x43aaaa(0x16b)]===_0x43aaaa(0xee)?(console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x11e)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x43aaaa(0xe5)](_0x43aaaa(0x117)),console[_0x43aaaa(0xe5)](_0x43aaaa(0x17e)),console[_0x43aaaa(0xe5)](_0x43aaaa(0x8e)),console['error'](_0x43aaaa(0x16f))):(console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x99)](_0x43aaaa(0x166)+_0x526778[_0x43aaaa(0x15f)]+'\x0a')),_0x526778[_0x43aaaa(0x128)]&&console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x112)](_0x526778[_0x43aaaa(0x128)]))),0x1;let _0x4fc673=_0x1e7dfb?undefined:_0x15a92e,_0x5a50be,_0x4a1837;_0x526778[_0x43aaaa(0xb2)]===_0x43aaaa(0x85)&&(_0x4fc673=_0x526778[_0x43aaaa(0x15c)],_0x5a50be=_0x526778[_0x43aaaa(0xad)],_0x4a1837=_0x526778['folderPath']);const _0x5d1953=_0x526778['parentName'],_0x9bcee0=_0x526778[_0x43aaaa(0x153)];_0x5507a3[_0x43aaaa(0xc1)]&&(console[_0x43aaaa(0xe5)](_0x43aaaa(0x92)+_0x5d1953),console['error'](_0x43aaaa(0x17f)+_0x9bcee0),_0x4fc673&&console['error'](_0x43aaaa(0xea)+_0x4fc673),_0x5a50be&&console[_0x43aaaa(0xe5)]('Target\x20file:\x20'+_0x5a50be),_0x4a1837&&console[_0x43aaaa(0xe5)](_0x43aaaa(0x113)+_0x4a1837));const _0x368aad=await withSpinner(_0x43aaaa(0xef),()=>_0x201436[_0x43aaaa(0xf3)]['resolveParentId'](_0x5d1953),{'verbose':_0x2aaedb[_0x43aaaa(0xc1)]}),_0x21551d=_0x368aad[_0x43aaaa(0xf7)],{journeys:_0x49109a,folders:_0x1e15f9}=await withSpinner(_0x43aaaa(0x174),async()=>{const _0x1d0750=_0x43aaaa,[_0x2bc92d,_0x14ce64]=await Promise[_0x1d0750(0x127)]([_0x201436[_0x1d0750(0xbb)][_0x1d0750(0x103)](_0x21551d,undefined,{'includeAllVersions':!![]}),_0x201436[_0x1d0750(0xf3)]['listFolders'](_0x21551d)]);return{'journeys':_0x2bc92d,'folders':_0x14ce64};},{'verbose':_0x2aaedb['verbose']})['then'](_0x455d15=>_0x455d15[_0x43aaaa(0xf7)]);let _0x140df6=_0x49109a;const _0x9f328=buildFolderIdToPathMap(_0x1e15f9);if(_0x4fc673){const _0x386f31=_0x140df6['filter'](_0xe1e4e=>_0xe1e4e[_0x43aaaa(0xf9)][_0x43aaaa(0x140)]()===_0x4fc673[_0x43aaaa(0x140)]());if(_0x386f31[_0x43aaaa(0x7e)]===0x0)return console[_0x43aaaa(0xe5)](_0x43aaaa(0xdb)+_0x4fc673),console[_0x43aaaa(0xe5)](_0x43aaaa(0xb9)),0x1;_0x140df6=_0x386f31;}if(_0x4a1837!==undefined){const _0x7ea333=_0x140df6[_0x43aaaa(0x142)](_0x2df7aa=>{const _0x58029f=_0x43aaaa,_0x56cd68=_0x2df7aa[_0x58029f(0xa8)]?_0x9f328[_0x58029f(0x182)](_0x2df7aa['folderId'])||'':'';return _0x56cd68===_0x4a1837;});if(_0x7ea333[_0x43aaaa(0x7e)]===0x0&&_0x140df6[_0x43aaaa(0x7e)]>0x0){console['error'](_0x43aaaa(0xd0)+_0x4fc673+_0x43aaaa(0xe4)+(_0x4a1837||_0x43aaaa(0x148))),console[_0x43aaaa(0xe5)](_0x43aaaa(0x15b));for(const _0x313b66 of _0x140df6){const _0x1dd188=_0x313b66[_0x43aaaa(0xa8)]?_0x9f328[_0x43aaaa(0x182)](_0x313b66[_0x43aaaa(0xa8)])||'':'';console[_0x43aaaa(0xe5)](_0x43aaaa(0x10a)+(_0x1dd188||'(root)')+'/'+_0x313b66['journeyBundleName']);}return 0x1;}_0x140df6=_0x7ea333;}if(_0x140df6[_0x43aaaa(0x7e)]===0x0)return console[_0x43aaaa(0xe5)](_0x43aaaa(0x90)),0x0;const _0x2a8445=new Map();for(const _0x566a18 of _0x140df6){const _0x1b00b7=_0x566a18[_0x43aaaa(0x181)];!_0x2a8445['has'](_0x1b00b7)&&_0x2a8445[_0x43aaaa(0x96)](_0x1b00b7,[]),_0x2a8445[_0x43aaaa(0x182)](_0x1b00b7)['push'](_0x566a18);}for(const _0x556b8e of _0x2a8445['values']()){_0x556b8e['sort']((_0x9308d1,_0x4bb8c1)=>(_0x9308d1[_0x43aaaa(0xc2)]||0x0)-(_0x4bb8c1[_0x43aaaa(0xc2)]||0x0));}const _0xf0c0e6=[],{idToEmailMap:_0x32a3ad,connectionIdToNameMap:_0x17ff3b}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x426c2e=_0x43aaaa,[_0x54d029,_0x4a98cf]=await Promise[_0x426c2e(0x127)]([_0x201436['user'][_0x426c2e(0x10b)](),_0x201436[_0x426c2e(0xc5)]['buildIdToNameMap']()]);return{'idToEmailMap':_0x54d029,'connectionIdToNameMap':_0x4a98cf};},{'verbose':_0x2aaedb[_0x43aaaa(0xc1)]})[_0x43aaaa(0x86)](_0x19f0e1=>_0x19f0e1[_0x43aaaa(0xf7)]);for(const _0x4025a8 of _0x2a8445[_0x43aaaa(0x171)]()){const _0x2be23c=_0x4025a8[0x0]['journeyBundleName'],_0x55e182=_0x4025a8[0x0][_0x43aaaa(0xa8)],_0x5ca993=_0x55e182?_0x9f328[_0x43aaaa(0x182)](_0x55e182)||'':'',_0x4f4eca=_0x5ca993?a28_0x4f205a['join'](_0x9bcee0,_0x5ca993):_0x9bcee0,_0xbe9242=_0x5a50be||a28_0x4f205a[_0x43aaaa(0xdd)](_0x4f4eca,sanitizeFileName(_0x2be23c)+_0x43aaaa(0x13e));let _0x5dfb59,_0x42ec70;if(existsSync(_0xbe9242))try{const _0x2777f8=readFileSync(_0xbe9242,_0x43aaaa(0x108)),_0x43c9d7=parseYamlString(_0x2777f8);_0x42ec70=_0x43c9d7,_0x5dfb59=buildRuleToNameMapping(_0x43c9d7),_0x5507a3[_0x43aaaa(0xc1)]&&_0x5dfb59['size']>0x0&&console[_0x43aaaa(0xe5)](_0x43aaaa(0xa4)+_0x5dfb59['size']+_0x43aaaa(0xbc)+_0x2be23c);}catch(_0x1c1d0d){_0x5507a3[_0x43aaaa(0xc1)]&&console[_0x43aaaa(0xe5)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x1c1d0d['message']);}const _0x36c2a2=[],_0x42c76a=new Set(),_0x50d4f7=new Map(),_0xd34f8=new Map(),_0x510ecd=new Set(),_0x194cb2=new Map(),_0x443f30=new Map(),_0x488b3d=createJumpTargetCache();await withProgressSpinner(_0x43aaaa(0x107)+_0x2be23c+_0x43aaaa(0x88),async _0x2292b7=>{const _0x24cb72=_0x43aaaa;for(const _0x295a39 of _0x4025a8){const _0x3da781=_0x4025a8[_0x24cb72(0x7e)]>0x1?_0x295a39[_0x24cb72(0xf9)]+'\x20v'+(_0x295a39['versionNumber']||0x1):_0x295a39[_0x24cb72(0xf9)];_0x2292b7['setPhase']('Fetching\x20'+_0x3da781);const _0x546759=await _0x201436[_0x24cb72(0xbb)][_0x24cb72(0xe1)](_0x295a39['id']),_0x59f517=_0x546759[_0x24cb72(0x102)]?.[_0x24cb72(0x169)],_0x3bcd69={'resolveSegment':async _0x3dbd1a=>{const _0x365b5a=_0x24cb72;if(!_0x59f517)return{'name':_0x3dbd1a,'isJourneyLocal':![]};const _0x29e50b=_0x50d4f7[_0x365b5a(0x182)](_0x3dbd1a);if(_0x29e50b)return _0x29e50b;try{const _0x14935=await _0x201436[_0x365b5a(0xf3)][_0x365b5a(0xe2)](_0x59f517,_0x3dbd1a),_0x165dfe=_0x14935['kind']===SEGMENT_KIND_JOURNEY;let _0x4a6df5,_0x435e5c=_0x14935['name'];if(_0x165dfe&&_0x14935[_0x365b5a(0x172)]){const _0x189c8c=await segmentResponseToDef(_0x14935,{'resolveSegmentName':async _0x1c8ba7=>{const _0x390a5a=_0x365b5a,_0x1a343e=_0x50d4f7[_0x390a5a(0x182)](_0x1c8ba7);if(_0x1a343e)return _0x1a343e['name'];const _0x3bf65b=await _0x3bcd69['resolveSegment'](_0x1c8ba7);return _0x3bf65b[_0x390a5a(0xcd)];}}),_0x66b17a=_0x189c8c['rule'];_0x4a6df5={'description':_0x14935[_0x365b5a(0xd9)],'rule':_0x66b17a};const _0x1e0c24=serializeRule(_0x66b17a),_0x3ee838=_0xd34f8[_0x365b5a(0x182)](_0x1e0c24);if(_0x3ee838)_0x435e5c=_0x3ee838,_0x4a6df5=undefined,_0x5507a3[_0x365b5a(0xc1)]&&console[_0x365b5a(0xe5)](_0x365b5a(0xc9)+_0x14935[_0x365b5a(0xcd)]+_0x365b5a(0xd2)+_0x3ee838);else{let _0x3920f4=![];if(_0x5dfb59){const _0x1d7882=_0x5dfb59[_0x365b5a(0x182)](_0x1e0c24);if(_0x1d7882){const _0x26203a=_0x1d7882['find'](_0x4e4319=>!_0x42c76a['has'](_0x4e4319));_0x26203a&&(_0x435e5c=_0x26203a,_0x42c76a['add'](_0x26203a),_0xd34f8['set'](_0x1e0c24,_0x26203a),_0x3920f4=!![],_0x5507a3[_0x365b5a(0xc1)]&&console[_0x365b5a(0xe5)](_0x365b5a(0x84)+_0x26203a+_0x365b5a(0x8f)));}}if(!_0x3920f4){const _0x2480ff=generateJourneyLocalName(_0x14935[_0x365b5a(0xcd)]);_0x2480ff&&(_0x435e5c=_0x2480ff);let _0x52cd89=_0x435e5c,_0x90f3c9=0x2;while(_0x42c76a['has'](_0x52cd89)){_0x52cd89=_0x435e5c+'_'+_0x90f3c9,_0x90f3c9++;}_0x42c76a[_0x365b5a(0x14f)](_0x52cd89),_0xd34f8[_0x365b5a(0x96)](_0x1e0c24,_0x52cd89),_0x435e5c=_0x52cd89;}}}const _0x5de57a={'name':_0x435e5c,'isJourneyLocal':_0x165dfe,'definition':_0x4a6df5};return _0x50d4f7['set'](_0x3dbd1a,_0x5de57a),_0x5de57a;}catch(_0x5784f0){return _0x2aaedb[_0x365b5a(0xc1)]&&console[_0x365b5a(0xe5)](_0x365b5a(0x146)+_0x3dbd1a+':\x20'+_0x5784f0[_0x365b5a(0x15f)]),{'name':_0x3dbd1a,'isJourneyLocal':![]};}},'resolveActivation':async _0x30044e=>{const _0x373a37=_0x24cb72,_0x33d34a=_0x194cb2[_0x373a37(0x182)](_0x30044e);if(_0x33d34a)return _0x33d34a;try{const _0xd50379=await _0x201436['journey']['getActivation'](_0x295a39['id'],_0x30044e),_0x3ae552=journeyActivationStepToYaml(_0xd50379,_0x32a3ad,_0x17ff3b),_0x46efbd=JSON['stringify']({'name':_0x3ae552[_0x373a37(0xcd)],'connection':_0x3ae552[_0x373a37(0xc5)],'connector_config':_0x3ae552['connector_config']}),_0x40481f=_0x443f30[_0x373a37(0x182)](_0x46efbd);if(_0x40481f){const _0x3c0143={'name':_0x40481f,'isJourneyLocal':!![],'definition':_0x3ae552};return _0x194cb2[_0x373a37(0x96)](_0x30044e,_0x3c0143),_0x3c0143;}const _0x1aaf82=_0xd50379['attributes'][_0x373a37(0x9b)][_0x373a37(0xcd)]||_0x30044e,_0x19d112=sanitizeYamlKey(_0x1aaf82)||'activation_'+_0x30044e;let _0x3d5f14=_0x19d112,_0x2f61c5=0x2;while(_0x510ecd['has'](_0x3d5f14)){_0x3d5f14=_0x19d112+'_'+_0x2f61c5,_0x2f61c5++;}_0x510ecd[_0x373a37(0x14f)](_0x3d5f14),_0x443f30[_0x373a37(0x96)](_0x46efbd,_0x3d5f14);const _0x513242={'name':_0x3d5f14,'isJourneyLocal':!![],'definition':_0x3ae552};return _0x194cb2[_0x373a37(0x96)](_0x30044e,_0x513242),_0x513242;}catch(_0x43c853){return _0x2aaedb['verbose']&&console[_0x373a37(0xe5)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x30044e+':\x20'+_0x43c853[_0x373a37(0x15f)]),{'name':_0x30044e,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0xdb6002,_0x4d45ff)=>{const _0xae5e58=_0x24cb72;return resolveJumpTarget(_0xdb6002,_0x4d45ff,_0x488b3d,_0x24a8ac=>_0x201436[_0xae5e58(0xbb)][_0xae5e58(0xe1)](_0x24a8ac));}},_0x451ab3=await journeyResponseToDef(_0x546759,_0x3bcd69);_0x36c2a2[_0x24cb72(0x131)]({'item':_0x295a39,'yaml':_0x451ab3});}},{'verbose':_0x2aaedb[_0x43aaaa(0xc1)]});const _0x163c1a=await _0x201436[_0x43aaaa(0xbb)]['getLatestJourneyId'](_0x4025a8[0x0][_0x43aaaa(0x181)]),_0x421266=buildMergedJourneyDef(_0x36c2a2,_0x5dfb59,_0x163c1a),_0x214500=normalizeJourneyDef(_0x421266,_0x42ec70),_0x47491a=toYamlString(_0x214500),_0x583f50=_0x5a50be||a28_0x4f205a['join'](_0x4f4eca,sanitizeFileName(_0x2be23c)+_0x43aaaa(0x13e));!_0x5a50be&&_0x5ca993&&!existsSync(_0x4f4eca)&&mkdirSync(_0x4f4eca,{'recursive':!![]});const _0x3d4258=a28_0x4f205a['relative'](process[_0x43aaaa(0xd7)](),_0x583f50);if(existsSync(_0x583f50)){const _0x2d111a=readFileSync(_0x583f50,_0x43aaaa(0x108)),_0x5f1398=generateDiff(_0x2d111a,_0x47491a),_0x35d9d4=hasChanges(_0x5f1398);_0xf0c0e6['push']({'relativePath':_0x3d4258,'absolutePath':_0x583f50,'content':_0x47491a,'isNew':![],'hasChanges':_0x35d9d4,'diff':_0x35d9d4?formatDiffWithColors(_0x5f1398):undefined});}else _0xf0c0e6[_0x43aaaa(0x131)]({'relativePath':_0x3d4258,'absolutePath':_0x583f50,'content':_0x47491a,'isNew':!![],'hasChanges':![]});}const _0x2372fa=_0xf0c0e6[_0x43aaaa(0x142)](_0x4939a7=>_0x4939a7[_0x43aaaa(0x129)]),_0x22e4ed=_0xf0c0e6[_0x43aaaa(0x142)](_0x5b5be2=>!_0x5b5be2['isNew']&&_0x5b5be2[_0x43aaaa(0xd8)]),_0x4e6cb8=_0xf0c0e6['filter'](_0x112aec=>!_0x112aec['isNew']&&!_0x112aec[_0x43aaaa(0xd8)]),_0x3104b5=_0x140df6[_0x43aaaa(0x7e)],_0x32da0d=_0x2a8445['size'],_0x30a6d4=_0x3104b5>_0x32da0d?'\x20('+_0x3104b5+'\x20versions)':'';console[_0x43aaaa(0xe5)](_0x43aaaa(0xda)),console[_0x43aaaa(0xe5)]('\x20\x20'+a28_0x326cef[_0x43aaaa(0x112)](_0x32da0d+_0x43aaaa(0xa9))+a28_0x326cef['dim'](_0x30a6d4)),console['error']('\x20\x20'+a28_0x326cef[_0x43aaaa(0x10c)]('+\x20'+_0x2372fa[_0x43aaaa(0x7e)]+_0x43aaaa(0x136))),console[_0x43aaaa(0xe5)]('\x20\x20'+a28_0x326cef[_0x43aaaa(0x11e)]('~\x20'+_0x22e4ed[_0x43aaaa(0x7e)]+_0x43aaaa(0xb4))),console[_0x43aaaa(0xe5)]('\x20\x20'+a28_0x326cef[_0x43aaaa(0x156)]('=\x20'+_0x4e6cb8[_0x43aaaa(0x7e)]+_0x43aaaa(0xfc))),console[_0x43aaaa(0xe5)]('\x20\x20Target:\x20'+a28_0x326cef[_0x43aaaa(0x112)](_0x9bcee0)+'\x0a');if(_0x22e4ed[_0x43aaaa(0x7e)]>0x0)for(const _0x2c4fb9 of _0x22e4ed){console['error']('\x0aChanges\x20to\x20\x27'+_0x2c4fb9[_0x43aaaa(0x91)]+'\x27:'),console['error']('─'[_0x43aaaa(0xf1)](0x3c)),console['error'](_0x2c4fb9['diff']),console[_0x43aaaa(0xe5)]('─'['repeat'](0x3c));}if(_0x5507a3[_0x43aaaa(0x11d)])return console[_0x43aaaa(0xe5)](a28_0x326cef['yellow'](_0x43aaaa(0xf6))),0x0;if(_0x2372fa['length']===0x0&&_0x22e4ed[_0x43aaaa(0x7e)]===0x0)return console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x10c)](_0x43aaaa(0x10e))),saveSessionContext({'parent_segment':_0x5d1953},_0x5507a3['session']),console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x10c)](_0x43aaaa(0x150)+a28_0x326cef['dim'](_0x43aaaa(0x130))+_0x43aaaa(0x124)+a28_0x326cef[_0x43aaaa(0x112)](_0x5d1953))),0x0;if(!_0x5507a3[_0x43aaaa(0xa1)]&&(_0x2372fa[_0x43aaaa(0x7e)]>0x0||_0x22e4ed['length']>0x0)){if(!isInteractive())return console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x99)]('\x0aError:'),_0x43aaaa(0xc7)),console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x156)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1e5298=await confirmKey(_0x43aaaa(0x178)+(_0x2372fa[_0x43aaaa(0x7e)]+_0x22e4ed[_0x43aaaa(0x7e)])+'\x20files?');if(!_0x1e5298)return console[_0x43aaaa(0xe5)](a28_0x326cef['yellow'](_0x43aaaa(0x155)),_0x43aaaa(0x13d)),0x1;}!existsSync(_0x9bcee0)&&mkdirSync(_0x9bcee0,{'recursive':!![]});const _0x2357b4=a28_0x4f205a[_0x43aaaa(0xdd)](_0x9bcee0,'tdx.json');writeFileSync(_0x2357b4,createTdxConfigContent(_0x5d1953),_0x43aaaa(0x108));for(const _0x2c68ca of _0xf0c0e6){(_0x2c68ca['isNew']||_0x2c68ca[_0x43aaaa(0xd8)])&&writeFileSync(_0x2c68ca[_0x43aaaa(0x14a)],_0x2c68ca[_0x43aaaa(0x163)],_0x43aaaa(0x108));}return console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x10c)](_0x43aaaa(0xfb)+(_0x2372fa[_0x43aaaa(0x7e)]+_0x22e4ed['length'])+_0x43aaaa(0x12f)+_0x9bcee0)),saveSessionContext({'parent_segment':_0x5d1953},_0x5507a3['session']),console[_0x43aaaa(0xe5)](a28_0x326cef[_0x43aaaa(0x10c)](_0x43aaaa(0x150)+a28_0x326cef['dim']('parent_segment')+_0x43aaaa(0x124)+a28_0x326cef[_0x43aaaa(0x112)](_0x5d1953))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0xa6993f(0xcd)]=a28_0xa6993f(0x17d);['description']=a28_0xa6993f(0x87);async[a28_0xa6993f(0x8d)](_0x319da2){const _0x2746a3=a28_0xa6993f,{options:_0x23d8ca,args:_0x102a68,tdx:_0x7f5354}=_0x319da2,_0x50e998=_0x102a68[0x0];if(!requireNameOrPath(_0x50e998))return 0x1;_0x23d8ca[_0x2746a3(0xc1)]&&console['error'](_0x2746a3(0x14b)+_0x50e998);const {journeyId:_0x1830f0}=await resolveJourneyIdFromInput(_0x50e998,_0x23d8ca,_0x7f5354),_0x182c8a=await withSpinner(_0x2746a3(0x115),()=>_0x7f5354[_0x2746a3(0xbb)][_0x2746a3(0x13f)](_0x1830f0),{'verbose':_0x23d8ca[_0x2746a3(0xc1)]}),_0xf73f1f=_0x182c8a[_0x2746a3(0xf7)];return console[_0x2746a3(0x170)](_0x2746a3(0xcc)+_0xf73f1f[_0x2746a3(0xfa)]),console[_0x2746a3(0x170)](_0x2746a3(0xb3)+_0xf73f1f['table']),await handleSDKOutput(_0xf73f1f['columns'],_0x23d8ca),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a28_0xa6993f(0x98);[a28_0xa6993f(0xd9)]='List\x20activations\x20for\x20a\x20journey';async[a28_0xa6993f(0x8d)](_0x3933bd){const _0x3d56ee=a28_0xa6993f,{options:_0x336ba4,args:_0x13dd52,tdx:_0x3aebfc}=_0x3933bd,_0x5897cc=_0x13dd52[0x0];if(!requireNameOrPath(_0x5897cc))return 0x1;_0x336ba4[_0x3d56ee(0xc1)]&&console['error'](_0x3d56ee(0x14b)+_0x5897cc);const {journeyId:_0x1b1425}=await resolveJourneyIdFromInput(_0x5897cc,_0x336ba4,_0x3aebfc),_0x6ff27f=await withSpinner(_0x3d56ee(0x14c),()=>_0x3aebfc['journey'][_0x3d56ee(0x10d)](_0x1b1425),{'verbose':_0x336ba4[_0x3d56ee(0xc1)]}),_0x27df98=_0x6ff27f[_0x3d56ee(0xf7)];return console[_0x3d56ee(0xe5)](_0x3d56ee(0xa4)+_0x27df98[_0x3d56ee(0x7e)]+_0x3d56ee(0x11c)+(_0x27df98[_0x3d56ee(0x7e)]!==0x1?'s':'')),await handleSDKOutput(_0x27df98,_0x336ba4),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0xa6993f(0xcd)]=a28_0xa6993f(0xf0);[a28_0xa6993f(0xd9)]=a28_0xa6993f(0x175);[a28_0xa6993f(0xe7)]=new SegmentPushCommand();async[a28_0xa6993f(0x8d)](_0x453e28){const _0x179279=a28_0xa6993f,_0x3b84eb=_0x453e28['args'][0x0];let _0x890904;if(_0x3b84eb){const _0x1a819b=await resolveTarget({'arg':_0x3b84eb,'contextParent':_0x453e28[_0x179279(0xf2)]['parentSegment'],'cwd':process[_0x179279(0xd7)]()});isSuccessfulResolution(_0x1a819b)&&_0x1a819b[_0x179279(0xb2)]==='file'&&(_0x890904=_0x1a819b[_0x179279(0xad)]);}const _0x6d19dd={..._0x453e28,'options':{..._0x453e28[_0x179279(0xf2)],'journeysOnly':!![],..._0x890904&&{'singleFilePath':_0x890904}}};return this[_0x179279(0xe7)][_0x179279(0x8d)](_0x6d19dd);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0xa6993f(0xcd)]='journey:versions';['description']=a28_0xa6993f(0xff);async[a28_0xa6993f(0x8d)](_0x9cffd4){const _0x16040f=a28_0xa6993f,{options:_0x2dbf90,args:_0x43e4ef,tdx:_0x94d136}=_0x9cffd4,_0xd98311=_0x43e4ef[0x0];if(!requireNameOrPath(_0xd98311))return 0x1;if(_0x2dbf90['verbose'])console[_0x16040f(0xe5)](_0x16040f(0x14b)+_0xd98311);const {journeyId:_0x2fc4c5}=await resolveJourneyIdFromInput(_0xd98311,_0x2dbf90,_0x94d136),_0x34bc31=await withSpinner(_0x16040f(0xed),()=>_0x94d136[_0x16040f(0xbb)]['listVersions'](_0x2fc4c5),{'verbose':_0x2dbf90[_0x16040f(0xc1)]}),{bundleName:_0x1503c8,versions:_0x31b9cb,latestJourneyId:_0x46ae48}=_0x34bc31[_0x16040f(0xf7)];console[_0x16040f(0xe5)](_0x1503c8+':\x20'+_0x31b9cb[_0x16040f(0x7e)]+_0x16040f(0x16d)+(_0x31b9cb['length']!==0x1?'s':''));const _0xd56a2a=_0x31b9cb['map'](_0x566fbf=>({'version':_0x566fbf[_0x16040f(0xc2)],'journey_id':_0x566fbf[_0x16040f(0xeb)],'name':_0x566fbf[_0x16040f(0xcd)],'state':_0x566fbf[_0x16040f(0x180)],'paused':_0x566fbf[_0x16040f(0xbd)],'latest':_0x566fbf[_0x16040f(0xeb)]===_0x46ae48,'created_at':_0x566fbf[_0x16040f(0x106)]}));return await handleSDKOutput(_0xd56a2a,_0x2dbf90),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0xa6993f(0xcd)]=a28_0xa6993f(0x17b);[a28_0xa6993f(0xd9)]=a28_0xa6993f(0x177);async[a28_0xa6993f(0x8d)](_0x51e442){const _0x3cc491=a28_0xa6993f,{options:_0x4f5128,args:_0x220928,tdx:_0x50481b}=_0x51e442,_0x126978=_0x220928[0x0];if(!requireNameOrPath(_0x126978))return 0x1;if(_0x4f5128[_0x3cc491(0xc1)])console[_0x3cc491(0xe5)](_0x3cc491(0x14b)+_0x126978);const {journeyId:_0x3bc706,journeyName:_0xb23ae}=await resolveJourneyIdFromInput(_0x126978,_0x4f5128,_0x50481b);if(!_0x4f5128[_0x3cc491(0xa1)]){const _0x1eda63=await confirm(_0x3cc491(0xa0)+_0xb23ae+'\x22?');if(!_0x1eda63)return console[_0x3cc491(0xe5)](_0x3cc491(0x97)),0x0;}const _0x24be06=await withSpinner(_0x3cc491(0xde),()=>_0x50481b[_0x3cc491(0xbb)][_0x3cc491(0xaa)](_0x3bc706),{'verbose':_0x4f5128['verbose']}),_0x2108e5=_0x24be06[_0x3cc491(0xf7)];return console['error'](a28_0x326cef[_0x3cc491(0x10c)]('✔')+_0x3cc491(0x164)+_0x2108e5['attributes'][_0x3cc491(0xc2)]+_0x3cc491(0x132)+_0x2108e5[_0x3cc491(0x102)][_0x3cc491(0xcd)]+'\x22'),console['error'](_0x3cc491(0xd6)+_0x2108e5['id']),await handleSingleObjectOutput({'id':_0x2108e5['id'],'name':_0x2108e5['attributes'][_0x3cc491(0xcd)],'version':_0x2108e5['attributes'][_0x3cc491(0xc2)],'state':_0x2108e5[_0x3cc491(0x102)][_0x3cc491(0x180)],'bundle_id':_0x2108e5[_0x3cc491(0x102)][_0x3cc491(0x181)],'created_at':_0x2108e5[_0x3cc491(0x102)]['createdAt']},_0x4f5128),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a28_0xa6993f(0x109);['description']=a28_0xa6993f(0xba);async[a28_0xa6993f(0x8d)](_0x5ed015){const _0x6aac0=a28_0xa6993f,{options:_0x5f1d58,args:_0x4e222f,tdx:_0x4d6030}=_0x5ed015,_0x56982d=_0x4e222f[0x0];if(!requireNameOrPath(_0x56982d))return 0x1;const _0x4e93fa=_0x5f1d58['version'];if(!_0x4e93fa)return console[_0x6aac0(0xe5)](_0x6aac0(0xe8)),console[_0x6aac0(0xe5)](_0x6aac0(0x101)),0x1;const _0x316214=parseInt(_0x4e93fa,0xa);if(isNaN(_0x316214)||_0x316214<0x1)return console['error']('Error:\x20Invalid\x20version\x20number:\x20'+_0x4e93fa),0x1;if(_0x5f1d58[_0x6aac0(0xc1)])console[_0x6aac0(0xe5)](_0x6aac0(0x14b)+_0x56982d+',\x20version:\x20'+_0x316214);const {journeyId:_0xf1db58,parentSegmentId:_0x52a4e5}=await resolveJourneyIdFromInput(_0x56982d,_0x5f1d58,_0x4d6030),_0x1f37ce=await withSpinner(_0x6aac0(0x9a),()=>_0x4d6030['journey'][_0x6aac0(0x12e)](_0xf1db58),{'verbose':_0x5f1d58[_0x6aac0(0xc1)]}),{versions:_0x1a7f5c,latestJourneyId:_0x3cca2e}=_0x1f37ce['data'],_0x4ac58d=_0x1a7f5c[_0x6aac0(0x149)](_0x302e4e=>_0x302e4e[_0x6aac0(0xc2)]===_0x316214);if(!_0x4ac58d){const _0x59f4b4=_0x1a7f5c[_0x6aac0(0x133)](_0x4e7176=>'v'+_0x4e7176[_0x6aac0(0xc2)])[_0x6aac0(0xdd)](',\x20');return console[_0x6aac0(0xe5)]('Error:\x20Version\x20'+_0x316214+_0x6aac0(0x122)+_0x59f4b4),0x1;}const _0x298710=await withSpinner(_0x6aac0(0x158)+_0x316214+_0x6aac0(0xfd),()=>_0x4d6030[_0x6aac0(0xbb)]['getJourney'](_0x4ac58d[_0x6aac0(0xeb)]),{'verbose':_0x5f1d58[_0x6aac0(0xc1)]}),_0x721f74=_0x298710['data'],_0x314e59=getConsoleNextUrl(_0x5f1d58[_0x6aac0(0x138)],_0x6aac0(0x137)+_0x52a4e5+_0x6aac0(0xd5)+_0x4ac58d[_0x6aac0(0xeb)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x721f74['id'],'name':_0x721f74['attributes']['name'],'version':_0x721f74[_0x6aac0(0x102)][_0x6aac0(0xc2)],'description':_0x721f74[_0x6aac0(0x102)][_0x6aac0(0xd9)],'state':_0x721f74[_0x6aac0(0x102)]['state'],'paused':_0x721f74[_0x6aac0(0x102)]['paused'],'reentry_mode':_0x721f74['attributes']['reentryMode'],'stages':_0x721f74[_0x6aac0(0x102)][_0x6aac0(0xbe)]?.['length']||0x0,..._0x721f74['attributes'][_0x6aac0(0xa3)]&&{'goal':_0x721f74[_0x6aac0(0x102)][_0x6aac0(0xa3)][_0x6aac0(0xcd)]},'latest':_0x4ac58d[_0x6aac0(0xeb)]===_0x3cca2e,'created_at':_0x721f74[_0x6aac0(0x102)][_0x6aac0(0x106)],'updated_at':_0x721f74[_0x6aac0(0x102)][_0x6aac0(0x118)],'url':_0x314e59},_0x5f1d58),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x1a7479=a29_0x57ac;(function(_0x42a833,_0x1a22c4){const _0x19adbd=a29_0x57ac,_0x3fd37b=_0x42a833();while(!![]){try{const _0x59ceac=-parseInt(_0x19adbd(0x174))/0x1+parseInt(_0x19adbd(0x1a6))/0x2+-parseInt(_0x19adbd(0x197))/0x3+-parseInt(_0x19adbd(0x18a))/0x4+parseInt(_0x19adbd(0x196))/0x5+parseInt(_0x19adbd(0x181))/0x6*(parseInt(_0x19adbd(0x178))/0x7)+parseInt(_0x19adbd(0x198))/0x8;if(_0x59ceac===_0x1a22c4)break;else _0x3fd37b['push'](_0x3fd37b['shift']());}catch(_0x37ebef){_0x3fd37b['push'](_0x3fd37b['shift']());}}}(a29_0x5811,0xe76f2));function a29_0x5811(){const _0x32b112=['warningCount','description','cwd','\x20valid','\x20journey(s)\x20with\x20errors,\x20','Validation\x20failed:\x20','6567825LiIsKo','3997629FbziIa','12060160xbnaNl','red','length','Error:\x20','name','cyan','\x20error(s)','No\x20journey\x20YAML\x20files\x20found\x20in\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yml','valid','\x20segment\x20file(s)\x20skipped','errors','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','2564568qjpuWN','relativePath','validCount','\x20segment\x20file(s)\x20skipped)','type','Validate\x20journey\x20YAML\x20files','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','targetDir','1728738vJdqkZ','errorCode','filePath','no_parent','686DRaeXI','Error:\x20Directory\x20not\x20found:\x20','.yaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20(skipped:\x20','error','endsWith','dim','yellow','94602ukkdKh','helpText','✔\x20All\x20','green','invalidCount','\x20warning(s)\x20found','journey','filter','skippedCount','6557200XFzpiG','\x20journey(s)\x20valid','execute','log','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose'];a29_0x5811=function(){return _0x32b112;};return a29_0x5811();}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 a29_0x2b0002 from'chalk';function a29_0x57ac(_0x21fce1,_0x54b60a){_0x21fce1=_0x21fce1-0x172;const _0x5811eb=a29_0x5811();let _0x57acaa=_0x5811eb[_0x21fce1];return _0x57acaa;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a29_0x1a7479(0x19c)]='journey:validate';[a29_0x1a7479(0x191)]=a29_0x1a7479(0x1ab);async[a29_0x1a7479(0x18c)](_0x42680a){const _0x1a5c0c=a29_0x1a7479,{options:_0x331798,args:_0x3d4cfa}=_0x42680a,_0x123822=_0x331798,_0x5e9642=await resolveTarget({'arg':_0x3d4cfa[0x0],'contextParent':_0x331798['parentSegment'],'cwd':process[_0x1a5c0c(0x192)]()});if(!isSuccessfulResolution(_0x5e9642))return _0x5e9642[_0x1a5c0c(0x175)]===_0x1a5c0c(0x177)?(console[_0x1a5c0c(0x17d)](a29_0x2b0002['yellow'](_0x1a5c0c(0x1a5))),console[_0x1a5c0c(0x17d)](_0x1a5c0c(0x18e)),console[_0x1a5c0c(0x17d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x1a5c0c(0x17d)](_0x1a5c0c(0x17b))):(console[_0x1a5c0c(0x17d)](a29_0x2b0002[_0x1a5c0c(0x199)](_0x1a5c0c(0x19b)+_0x5e9642['message']+'\x0a')),_0x5e9642['helpText']&&console[_0x1a5c0c(0x17d)](a29_0x2b0002[_0x1a5c0c(0x19d)](_0x5e9642[_0x1a5c0c(0x182)]))),0x1;const _0x97131c=_0x5e9642[_0x1a5c0c(0x173)],_0xbdbb25=_0x5e9642[_0x1a5c0c(0x1aa)]==='file'?_0x5e9642[_0x1a5c0c(0x176)]:undefined;if(!_0xbdbb25&&!existsSync(_0x97131c))return console[_0x1a5c0c(0x17d)](a29_0x2b0002[_0x1a5c0c(0x199)](_0x1a5c0c(0x179)+_0x97131c+'\x0a')),0x1;let _0x28e9af;if(_0xbdbb25){if(!_0xbdbb25[_0x1a5c0c(0x17e)](_0x1a5c0c(0x1a1))&&!_0xbdbb25[_0x1a5c0c(0x17e)](_0x1a5c0c(0x17a)))return console[_0x1a5c0c(0x17d)](a29_0x2b0002[_0x1a5c0c(0x199)](_0x1a5c0c(0x172)+_0xbdbb25+'\x0a')),0x1;_0x28e9af=[_0xbdbb25];}else _0x28e9af=findYamlFiles(_0x97131c);if(_0x28e9af[_0x1a5c0c(0x19a)]===0x0)return console[_0x1a5c0c(0x17d)](a29_0x2b0002[_0x1a5c0c(0x199)](_0x1a5c0c(0x1a0)+_0x97131c+'\x0a')),0x1;const _0xa4bf66=validateYamlFiles(_0x28e9af,_0x97131c,{'filterType':_0x1a5c0c(0x187)}),_0x1920ca=calculateSummary(_0xa4bf66),_0x2d5bc2=_0xa4bf66[_0x1a5c0c(0x188)](isValidationResult);if(_0x2d5bc2[_0x1a5c0c(0x19a)]===0x0)return console['error'](a29_0x2b0002[_0x1a5c0c(0x180)](_0x1a5c0c(0x19f)+_0x97131c+'\x0a')),_0x1920ca['skippedCount']>0x0&&console['error'](a29_0x2b0002[_0x1a5c0c(0x17f)]('('+_0x1920ca[_0x1a5c0c(0x189)]+_0x1a5c0c(0x1a9))),0x0;for(const _0x5057e9 of _0xa4bf66){if(!isValidationResult(_0x5057e9)){_0x123822['verbose']&&console[_0x1a5c0c(0x18d)](a29_0x2b0002[_0x1a5c0c(0x17f)]('-\x20'+_0x5057e9[_0x1a5c0c(0x1a7)]+_0x1a5c0c(0x17c)+_0x5057e9['reason']+')'));continue;}const {relativePath:_0x4a6e29,source:_0x211d24,result:_0x4adb46}=_0x5057e9;if(_0x4adb46['valid']&&_0x4adb46['warnings'][_0x1a5c0c(0x19a)]===0x0)_0x123822[_0x1a5c0c(0x18f)]&&console['log'](a29_0x2b0002[_0x1a5c0c(0x184)]('✔\x20'+_0x4a6e29));else _0x4adb46[_0x1a5c0c(0x1a2)]?(console[_0x1a5c0c(0x18d)](a29_0x2b0002['yellow']('⚠\x20'+_0x4a6e29+':\x20'+_0x4adb46['warnings'][_0x1a5c0c(0x19a)]+'\x20warning(s)')),console[_0x1a5c0c(0x18d)](formatValidationResult(_0x4adb46,_0x211d24,_0x4a6e29))):(console[_0x1a5c0c(0x18d)](a29_0x2b0002[_0x1a5c0c(0x199)]('✖\x20'+_0x4a6e29+':\x20'+_0x4adb46[_0x1a5c0c(0x1a4)][_0x1a5c0c(0x19a)]+_0x1a5c0c(0x19e))),console[_0x1a5c0c(0x18d)](formatValidationResult(_0x4adb46,_0x211d24,_0x4a6e29)));}return console[_0x1a5c0c(0x18d)](''),_0x1920ca['hasErrors']?(console['log'](a29_0x2b0002['red'](_0x1a5c0c(0x195)+_0x1920ca[_0x1a5c0c(0x185)]+_0x1a5c0c(0x194)+_0x1920ca[_0x1a5c0c(0x1a8)]+_0x1a5c0c(0x193))),_0x1920ca[_0x1a5c0c(0x190)]>0x0&&console[_0x1a5c0c(0x18d)](a29_0x2b0002[_0x1a5c0c(0x180)](_0x1920ca[_0x1a5c0c(0x190)]+_0x1a5c0c(0x186))),_0x1920ca['skippedCount']>0x0&&console['log'](a29_0x2b0002['dim'](_0x1920ca['skippedCount']+_0x1a5c0c(0x1a3))),0x1):(console[_0x1a5c0c(0x18d)](a29_0x2b0002[_0x1a5c0c(0x184)](_0x1a5c0c(0x183)+_0x1920ca[_0x1a5c0c(0x1a8)]+_0x1a5c0c(0x18b))),_0x1920ca[_0x1a5c0c(0x190)]>0x0&&console[_0x1a5c0c(0x18d)](a29_0x2b0002[_0x1a5c0c(0x180)](_0x1920ca[_0x1a5c0c(0x190)]+_0x1a5c0c(0x186))),_0x1920ca['skippedCount']>0x0&&console[_0x1a5c0c(0x18d)](a29_0x2b0002['dim'](_0x1920ca[_0x1a5c0c(0x189)]+_0x1a5c0c(0x1a3))),0x0);}}
|