@treasuredata/tdx 2026.7.5 → 2026.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.d.ts.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.d.ts +8 -0
- package/dist/commands/command.d.ts.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/command.js.map +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-always-on-campaign-pull-command.d.ts +16 -0
- package/dist/commands/engage-always-on-campaign-pull-command.d.ts.map +1 -0
- package/dist/commands/engage-always-on-campaign-pull-command.js +1 -0
- package/dist/commands/engage-always-on-campaign-pull-command.js.map +1 -0
- package/dist/commands/engage-always-on-campaign-push-command.d.ts +16 -0
- package/dist/commands/engage-always-on-campaign-push-command.d.ts.map +1 -0
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -0
- package/dist/commands/engage-always-on-campaign-push-command.js.map +1 -0
- package/dist/commands/engage-always-on-campaign-validate-command.d.ts +16 -0
- package/dist/commands/engage-always-on-campaign-validate-command.d.ts.map +1 -0
- package/dist/commands/engage-always-on-campaign-validate-command.js +1 -0
- package/dist/commands/engage-always-on-campaign-validate-command.js.map +1 -0
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts +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/profile-command.js.map +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-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/status-command.js.map +1 -1
- package/dist/commands/table-deleted.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.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +35 -1
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.d.ts +68 -0
- package/dist/core/site-mismatch.d.ts.map +1 -0
- package/dist/core/site-mismatch.js +1 -0
- package/dist/core/site-mismatch.js.map +1 -0
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.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/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +6 -6
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +1 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/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.d.ts +7 -4
- package/dist/sdk/connection-validator.d.ts.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection-validator.js.map +1 -1
- package/dist/sdk/connection.d.ts +15 -0
- package/dist/sdk/connection.d.ts.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/connection.js.map +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/always-on-campaign-pull.d.ts +66 -0
- package/dist/sdk/engage/always-on-campaign-pull.d.ts.map +1 -0
- package/dist/sdk/engage/always-on-campaign-pull.js +1 -0
- package/dist/sdk/engage/always-on-campaign-pull.js.map +1 -0
- package/dist/sdk/engage/always-on-campaign-push.d.ts +93 -0
- package/dist/sdk/engage/always-on-campaign-push.d.ts.map +1 -0
- package/dist/sdk/engage/always-on-campaign-push.js +1 -0
- package/dist/sdk/engage/always-on-campaign-push.js.map +1 -0
- package/dist/sdk/engage/always-on-campaign-validator.d.ts +18 -0
- package/dist/sdk/engage/always-on-campaign-validator.d.ts.map +1 -0
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -0
- package/dist/sdk/engage/always-on-campaign-validator.js.map +1 -0
- package/dist/sdk/engage/always-on-campaign-yaml.d.ts +62 -0
- package/dist/sdk/engage/always-on-campaign-yaml.d.ts.map +1 -0
- package/dist/sdk/engage/always-on-campaign-yaml.js +1 -0
- package/dist/sdk/engage/always-on-campaign-yaml.js.map +1 -0
- 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/campaign-yaml.js.map +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/always-on-campaign-schema.d.ts +125 -0
- package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +1 -0
- package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -0
- package/dist/sdk/engage/types/always-on-campaign-schema.js.map +1 -0
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +8 -8
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +20 -0
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.d.ts +13 -2
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +12 -10
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.d.ts +66 -7
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js.map +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.d.ts +110 -1
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js.map +1 -1
- package/dist/sdk/segment/validate-files.d.ts +6 -1
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +7 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/engage.d.ts +31 -5
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.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/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.d.ts +6 -0
- package/dist/test-utils/factories.d.ts.map +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/factories.js.map +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.d.ts +1 -1
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.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/proxy-fetch.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
|
-
|
|
1
|
+
function a26_0x7f9b(_0x5424e8,_0x499b93){_0x5424e8=_0x5424e8-0x1a1;const _0x3099d1=a26_0x3099();let _0x7f9b03=_0x3099d1[_0x5424e8];return _0x7f9b03;}function a26_0x3099(){const _0x2d8eea=['3711953JLbDry','relativePath','workspaceName','Aborted.','error','absolutePath','targetDir','engage:template:pull','\x20new\x20files','\x20files\x20to\x20','templates','content','length','setPhase','execute','Pulling\x20templates\x20from\x20\x27','engage_workspace','name','561963XwNuDx','✔\x20Pulled\x20','yellow','\x20=\x20','description','1249710sJhPub','1303592dsvEXD','\x0aPull\x20summary\x20for\x20workspace\x20\x27','cyan','hasChanges','yes','data','dirname','\x20unchanged\x20files','148518aOEsBD','Workspace\x20is\x20required.','3486060nudEuE','config','counts','repeat','filter','session','isNew','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','engage','red','\x0aError:','utf-8','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','\x27...','Pull\x20templates\x20to\x20YAML\x20files','workspace','✔\x20All\x20files\x20are\x20up\x20to\x20date','dim','No\x20templates\x20found\x20in\x20workspace\x20\x27','\x0aChanges\x20to\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','Write\x20','\x20templates','files','364480AIFUjz','\x20\x20Target:\x20'];a26_0x3099=function(){return _0x2d8eea;};return a26_0x3099();}const a26_0x5e7e0c=a26_0x7f9b;(function(_0xf8c659,_0x141a5a){const _0x3075b0=a26_0x7f9b,_0x47988e=_0xf8c659();while(!![]){try{const _0x36a2b9=-parseInt(_0x3075b0(0x1d9))/0x1+parseInt(_0x3075b0(0x1de))/0x2+-parseInt(_0x3075b0(0x1a8))/0x3+parseInt(_0x3075b0(0x1df))/0x4+-parseInt(_0x3075b0(0x1c5))/0x5+parseInt(_0x3075b0(0x1aa))/0x6+-parseInt(_0x3075b0(0x1c7))/0x7;if(_0x36a2b9===_0x141a5a)break;else _0x47988e['push'](_0x47988e['shift']());}catch(_0x287a0b){_0x47988e['push'](_0x47988e['shift']());}}}(a26_0x3099,0x4d6bf));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a26_0x8cdf9 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a26_0x289bfe from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{['name']=a26_0x5e7e0c(0x1ce);[a26_0x5e7e0c(0x1dd)]=a26_0x5e7e0c(0x1ba);async[a26_0x5e7e0c(0x1d5)](_0x59f07d){const _0x14aa06=a26_0x5e7e0c,{options:_0x24dd5e,args:_0x492ad0,tdx:_0x4b6e35}=_0x59f07d,_0x123582=_0x24dd5e,_0x4e1bc4=await resolveWorkspaceName(_0x492ad0[0x0],_0x123582);if(!_0x4e1bc4)return console[_0x14aa06(0x1cb)](a26_0x8cdf9['yellow'](_0x14aa06(0x1a9))),console[_0x14aa06(0x1cb)](_0x14aa06(0x1b1)),console[_0x14aa06(0x1cb)](_0x14aa06(0x1b8)),console[_0x14aa06(0x1cb)](_0x14aa06(0x1b2)),0x1;const _0x4d4d3b=await withProgressSpinner(_0x14aa06(0x1d6)+_0x4e1bc4+_0x14aa06(0x1b9),_0x160f76=>pullTemplates({'engage':_0x4b6e35[_0x14aa06(0x1b3)]},_0x4e1bc4,{'templateName':_0x123582[_0x14aa06(0x1d8)],'progress':{'update':_0x476b2a=>{const _0x2194ce=_0x14aa06;_0x160f76[_0x2194ce(0x1d4)](_0x476b2a);}}}),{'verbose':_0x123582['verbose']}),_0x5ed678=_0x4d4d3b[_0x14aa06(0x1a5)];if(_0x5ed678[_0x14aa06(0x1ac)][_0x14aa06(0x1d1)]===0x0)return console[_0x14aa06(0x1cb)](a26_0x8cdf9[_0x14aa06(0x1db)](_0x14aa06(0x1be)+_0x5ed678[_0x14aa06(0x1c9)]+'\x27')),0x0;const _0xe02336=_0x5ed678['files'][_0x14aa06(0x1ae)](_0x3c22fd=>_0x3c22fd['isNew']),_0x2366ad=_0x5ed678[_0x14aa06(0x1c4)]['filter'](_0x25f348=>!_0x25f348[_0x14aa06(0x1b0)]&&_0x25f348[_0x14aa06(0x1a3)]),_0x4607eb=_0x5ed678['files'][_0x14aa06(0x1ae)](_0x2618fb=>!_0x2618fb[_0x14aa06(0x1b0)]&&!_0x2618fb[_0x14aa06(0x1a3)]);console[_0x14aa06(0x1cb)](_0x14aa06(0x1a1)+_0x5ed678[_0x14aa06(0x1c9)]+'\x27:'),console[_0x14aa06(0x1cb)]('\x20\x20'+a26_0x8cdf9['cyan'](_0x5ed678[_0x14aa06(0x1ac)]['templates']+_0x14aa06(0x1c3))),console['error']('\x20\x20'+a26_0x8cdf9['green']('+\x20'+_0xe02336['length']+_0x14aa06(0x1cf))),console[_0x14aa06(0x1cb)]('\x20\x20'+a26_0x8cdf9[_0x14aa06(0x1db)]('~\x20'+_0x2366ad[_0x14aa06(0x1d3)]+'\x20changed\x20files')),console[_0x14aa06(0x1cb)]('\x20\x20'+a26_0x8cdf9[_0x14aa06(0x1bd)]('=\x20'+_0x4607eb[_0x14aa06(0x1d3)]+_0x14aa06(0x1a7))),console[_0x14aa06(0x1cb)](_0x14aa06(0x1c6)+a26_0x8cdf9[_0x14aa06(0x1a2)](_0x5ed678[_0x14aa06(0x1cd)])+'\x0a');if(_0x2366ad[_0x14aa06(0x1d3)]>0x0)for(const _0x264661 of _0x2366ad){console['error'](_0x14aa06(0x1bf)+_0x264661[_0x14aa06(0x1c8)]+'\x27:'),console[_0x14aa06(0x1cb)]('\u2500'[_0x14aa06(0x1ad)](0x3c)),console[_0x14aa06(0x1cb)](_0x264661['diff']),console[_0x14aa06(0x1cb)]('\u2500'[_0x14aa06(0x1ad)](0x3c));}if(_0x123582['dryRun'])return console[_0x14aa06(0x1cb)](a26_0x8cdf9[_0x14aa06(0x1db)](_0x14aa06(0x1c0))),0x0;if(_0xe02336[_0x14aa06(0x1d3)]===0x0&&_0x2366ad[_0x14aa06(0x1d3)]===0x0)return console[_0x14aa06(0x1cb)](a26_0x8cdf9[_0x14aa06(0x1c1)](_0x14aa06(0x1bc))),saveSessionContext({'engage_workspace':_0x5ed678[_0x14aa06(0x1c9)]},_0x123582[_0x14aa06(0x1af)]),0x0;if(!_0x123582[_0x14aa06(0x1a4)]){if(!isInteractive())return console['error'](a26_0x8cdf9[_0x14aa06(0x1b4)](_0x14aa06(0x1b5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a26_0x8cdf9[_0x14aa06(0x1bd)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x128ae8=await confirmKey(_0x14aa06(0x1c2)+(_0xe02336[_0x14aa06(0x1d3)]+_0x2366ad[_0x14aa06(0x1d3)])+'\x20files?');if(!_0x128ae8)return console[_0x14aa06(0x1cb)](a26_0x8cdf9['yellow'](_0x14aa06(0x1ca)),'-\x20no\x20files\x20written'),0x1;}for(const _0x255d13 of _0x5ed678[_0x14aa06(0x1c4)]){if(_0x255d13[_0x14aa06(0x1b0)]||_0x255d13[_0x14aa06(0x1a3)]){const _0x2942a8=a26_0x289bfe[_0x14aa06(0x1a6)](_0x255d13[_0x14aa06(0x1cc)]);!existsSync(_0x2942a8)&&mkdirSync(_0x2942a8,{'recursive':!![]}),writeFileSync(_0x255d13[_0x14aa06(0x1cc)],_0x255d13[_0x14aa06(0x1d2)],_0x14aa06(0x1b6));}}return console['error'](a26_0x8cdf9[_0x14aa06(0x1c1)](_0x14aa06(0x1da)+(_0xe02336[_0x14aa06(0x1d3)]+_0x2366ad['length'])+_0x14aa06(0x1d0)+_0x5ed678[_0x14aa06(0x1cd)])),saveSessionContext({'engage_workspace':_0x5ed678['workspaceName']},_0x123582[_0x14aa06(0x1af)]),console['error'](a26_0x8cdf9[_0x14aa06(0x1c1)]('✔\x20Context\x20set:\x20'+a26_0x8cdf9['dim'](_0x14aa06(0x1d7))+_0x14aa06(0x1dc)+a26_0x8cdf9[_0x14aa06(0x1a2)](_0x5ed678[_0x14aa06(0x1c9)]))),0x0;}}async function resolveWorkspaceName(_0x34fdac,_0x4d69bd){const _0x5bb72c=a26_0x5e7e0c;if(_0x34fdac)return _0x34fdac;if(_0x4d69bd[_0x5bb72c(0x1bb)])return _0x4d69bd[_0x5bb72c(0x1bb)];const _0xfb7ac9=tryFindTdxConfig(process[_0x5bb72c(0x1b7)]());if(_0xfb7ac9?.['config'][_0x5bb72c(0x1d7)])return _0xfb7ac9[_0x5bb72c(0x1ab)]['engage_workspace'];const _0x120281=loadSessionContext(_0x4d69bd[_0x5bb72c(0x1af)]);if(_0x120281?.[_0x5bb72c(0x1d7)])return _0x120281[_0x5bb72c(0x1d7)];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a24_0x373b(){const _0x55a1b5=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Aborted.','Push\x20','\x0aPush\x20summary\x20for\x20workspace\x20\x27','Resolving\x20references...','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x20template\x20files','valid','relativePath','red','336MrBplm','warnings','execute','648152pWSeII','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','✔\x20Created\x20','green','updated','12UcRtSq','cwd','✔\x20All\x20templates\x20are\x20up\x20to\x20date','35522010iRaEDZ','error','def','Found\x20','\x20templates\x20to\x20update:','session','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','94315XJoQdS','setPhase','config','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x0aError:','-\x20no\x20changes\x20applied','engage_workspace','7479871WrUQCK','dryRun','66294eTGYev','cyan','message','workspace','dim','878872mLgkAK','yes','750408lddljD','1\x20template\x20file:\x20','update','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','created','configDir','site','✔\x20Updated\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','create','length','resolve','\x20new\x20templates:','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','engage','data','resolveWorkspaceId','description','848pRsDlI','\x0aValidation\x20errors\x20in\x20','\x20\x20\x20\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','templateId','path','action','No\x20template\x20YAML\x20files\x20found\x20in\x20','name','verbose','yellow','Workspace\x20is\x20required.','dirname','errors'];a24_0x373b=function(){return _0x55a1b5;};return a24_0x373b();}const a24_0x59b2d9=a24_0x4d40;(function(_0x1f63f0,_0x482eba){const _0x151465=a24_0x4d40,_0x5d34ad=_0x1f63f0();while(!![]){try{const _0x3327bd=-parseInt(_0x151465(0x20b))/0x1+parseInt(_0x151465(0x209))/0x2+-parseInt(_0x151465(0x23d))/0x3*(-parseInt(_0x151465(0x238))/0x4)+parseInt(_0x151465(0x1fb))/0x5*(-parseInt(_0x151465(0x235))/0x6)+-parseInt(_0x151465(0x202))/0x7+parseInt(_0x151465(0x21d))/0x8*(-parseInt(_0x151465(0x204))/0x9)+parseInt(_0x151465(0x1f4))/0xa;if(_0x3327bd===_0x482eba)break;else _0x5d34ad['push'](_0x5d34ad['shift']());}catch(_0x23f93d){_0x5d34ad['push'](_0x5d34ad['shift']());}}}(a24_0x373b,0xf0298));function a24_0x4d40(_0x2db44a,_0x42aadc){_0x2db44a=_0x2db44a-0x1f2;const _0x373b41=a24_0x373b();let _0x4d4001=_0x373b41[_0x2db44a];return _0x4d4001;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x34c0a3 from'chalk';import a24_0x42776a from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x59b2d9(0x225)]='engage:template:push';[a24_0x59b2d9(0x21c)]=a24_0x59b2d9(0x220);async[a24_0x59b2d9(0x237)](_0x555b21){const _0x5adc7c=a24_0x59b2d9,{options:_0x34579d,args:_0x4bde2d,tdx:_0x32a08e}=_0x555b21,_0x24110d=_0x34579d,_0xd59bb7=_0x4bde2d[0x0],_0xea0c20=_0xd59bb7?a24_0x42776a[_0x5adc7c(0x216)](_0xd59bb7):undefined,_0x174d18=_0xea0c20?isYamlFile(_0xea0c20):![];let _0x43f41a;if(_0x174d18&&_0xea0c20)_0x43f41a=a24_0x42776a['dirname'](_0xea0c20);else _0xea0c20?_0x43f41a=_0xea0c20:_0x43f41a=process[_0x5adc7c(0x1f2)]();let _0x2e2ef0;const _0x49b85c=tryFindTdxConfig(_0x43f41a);_0x49b85c?.[_0x5adc7c(0x1fd)][_0x5adc7c(0x201)]&&(_0x2e2ef0=_0x49b85c[_0x5adc7c(0x1fd)]['engage_workspace'],!_0x174d18&&(_0x43f41a=_0x49b85c[_0x5adc7c(0x210)]));_0x24110d[_0x5adc7c(0x207)]&&(_0x2e2ef0=_0x24110d[_0x5adc7c(0x207)]);if(!_0x2e2ef0){const _0x11dc13=loadSessionContext(_0x24110d[_0x5adc7c(0x1f9)]);_0x11dc13?.['engage_workspace']&&(_0x2e2ef0=_0x11dc13[_0x5adc7c(0x201)]);}if(!_0x2e2ef0)return console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x227)](_0x5adc7c(0x228))),console['error']('\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console[_0x5adc7c(0x1f5)](_0x5adc7c(0x218)),console['error'](_0x5adc7c(0x20e)),console[_0x5adc7c(0x1f5)](_0x5adc7c(0x239)),0x1;let _0x50e2bf;_0x174d18&&_0xea0c20?_0x50e2bf=[parseTemplateFile(_0xea0c20,a24_0x42776a[_0x5adc7c(0x229)](_0xea0c20))]:_0x50e2bf=discoverAndParseTemplateFiles(_0x43f41a);if(_0x50e2bf[_0x5adc7c(0x215)]===0x0)return console[_0x5adc7c(0x1f5)](a24_0x34c0a3['yellow'](_0x5adc7c(0x224)+_0x43f41a)),console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x208)](_0x5adc7c(0x1fe))),0x1;const _0x346036=_0x50e2bf[_0x5adc7c(0x215)]===0x1?_0x5adc7c(0x20c)+_0x50e2bf[0x0]['def'][_0x5adc7c(0x225)]:_0x50e2bf[_0x5adc7c(0x215)]+_0x5adc7c(0x231);console[_0x5adc7c(0x1f5)](_0x5adc7c(0x1f7)+a24_0x34c0a3[_0x5adc7c(0x205)](_0x346036));let _0x13342e=![];for(const _0x52805b of _0x50e2bf){const _0x422b17=validateTemplateDef(_0x52805b[_0x5adc7c(0x1f6)]);if(!_0x422b17[_0x5adc7c(0x232)]){_0x13342e=!![],console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x234)](_0x5adc7c(0x21e)+_0x52805b[_0x5adc7c(0x233)]+':'));for(const _0x56cb3f of _0x422b17[_0x5adc7c(0x22a)]){console[_0x5adc7c(0x1f5)]('\x20\x20'+a24_0x34c0a3['red']('✗')+'\x20'+_0x56cb3f[_0x5adc7c(0x222)]+':\x20'+_0x56cb3f['message']);}}for(const _0x5d5bfd of _0x422b17[_0x5adc7c(0x236)]){console[_0x5adc7c(0x1f5)]('\x20\x20'+a24_0x34c0a3['yellow']('⚠')+'\x20'+_0x5d5bfd[_0x5adc7c(0x222)]+':\x20'+_0x5d5bfd[_0x5adc7c(0x206)]);}}if(_0x13342e)return console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x234)](_0x5adc7c(0x230))),0x1;const _0x45be92=await _0x32a08e[_0x5adc7c(0x219)][_0x5adc7c(0x21b)](_0x2e2ef0),_0x182d96=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x2e2ef0+'\x27...',_0x201b8e=>preparePush({'engage':_0x32a08e[_0x5adc7c(0x219)]},_0x50e2bf,_0x45be92,{'progress':{'update':_0x3e8a94=>_0x201b8e[_0x5adc7c(0x1fc)](_0x3e8a94)}}),{'verbose':_0x24110d[_0x5adc7c(0x226)]}),_0x36ccb8=_0x182d96['data'];await withProgressSpinner(_0x5adc7c(0x22f),_0x56ddd4=>resolveAndBuildInputs({'engage':_0x32a08e[_0x5adc7c(0x219)]},_0x36ccb8,_0x45be92,{'progress':{'update':_0x160eb8=>_0x56ddd4['setPhase'](_0x160eb8)}}),{'verbose':_0x24110d['verbose']});const _0x384ea8=_0x36ccb8['filter'](_0x32d7c2=>_0x32d7c2['action']===_0x5adc7c(0x214)),_0xe7deb9=_0x36ccb8['filter'](_0x405212=>_0x405212[_0x5adc7c(0x223)]===_0x5adc7c(0x20d));console[_0x5adc7c(0x1f5)](_0x5adc7c(0x22e)+_0x2e2ef0+'\x27:');if(_0x384ea8[_0x5adc7c(0x215)]>0x0){console[_0x5adc7c(0x1f5)]('\x20\x20'+a24_0x34c0a3[_0x5adc7c(0x23b)]('+\x20'+_0x384ea8[_0x5adc7c(0x215)]+_0x5adc7c(0x217)));for(const _0x36d95a of _0x384ea8){console[_0x5adc7c(0x1f5)](_0x5adc7c(0x21f)+a24_0x34c0a3[_0x5adc7c(0x23b)]('+')+'\x20'+_0x36d95a['def'][_0x5adc7c(0x225)]);}}if(_0xe7deb9['length']>0x0){console[_0x5adc7c(0x1f5)]('\x20\x20'+a24_0x34c0a3[_0x5adc7c(0x227)]('~\x20'+_0xe7deb9[_0x5adc7c(0x215)]+_0x5adc7c(0x1f8)));for(const _0x2aabc9 of _0xe7deb9){console[_0x5adc7c(0x1f5)](_0x5adc7c(0x21f)+a24_0x34c0a3[_0x5adc7c(0x227)]('~')+'\x20'+_0x2aabc9[_0x5adc7c(0x1f6)][_0x5adc7c(0x225)]);}}if(_0x384ea8[_0x5adc7c(0x215)]===0x0&&_0xe7deb9[_0x5adc7c(0x215)]===0x0)return console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x23b)](_0x5adc7c(0x1f3))),0x0;if(_0x24110d[_0x5adc7c(0x203)])return console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x227)](_0x5adc7c(0x213))),0x0;if(!_0x24110d[_0x5adc7c(0x20a)]){if(!isInteractive())return console['error'](a24_0x34c0a3[_0x5adc7c(0x234)](_0x5adc7c(0x1ff)),_0x5adc7c(0x1fa)),console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x208)](_0x5adc7c(0x22b))),0x1;const _0x1c8e83=await confirmKey(_0x5adc7c(0x22d)+(_0x384ea8[_0x5adc7c(0x215)]+_0xe7deb9[_0x5adc7c(0x215)])+'\x20templates?');if(!_0x1c8e83)return console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x227)](_0x5adc7c(0x22c)),_0x5adc7c(0x200)),0x1;}const _0x122e8b=await withProgressSpinner('Pushing\x20templates...',_0x376fcc=>executePush({'engage':_0x32a08e['engage']},_0x36ccb8,{'progress':{'update':_0x1cb095=>_0x376fcc[_0x5adc7c(0x1fc)](_0x1cb095)}}),{'verbose':_0x24110d[_0x5adc7c(0x226)]}),_0x28c086=_0x122e8b[_0x5adc7c(0x21a)];for(const _0x3d45ae of _0x28c086['results']){if(_0x3d45ae['templateId']&&(_0x3d45ae[_0x5adc7c(0x223)]==='created'||_0x3d45ae[_0x5adc7c(0x223)]===_0x5adc7c(0x23c))){const _0x3b6f05=getTemplateUrl(_0x24110d[_0x5adc7c(0x211)],_0x45be92,_0x3d45ae[_0x5adc7c(0x221)]),_0x1c4702=_0x3d45ae['action']===_0x5adc7c(0x20f)?'+':'~',_0x72207e=_0x3d45ae['action']===_0x5adc7c(0x20f)?a24_0x34c0a3[_0x5adc7c(0x23b)](_0x1c4702):a24_0x34c0a3['yellow'](_0x1c4702);console[_0x5adc7c(0x1f5)]('\x20\x20'+_0x72207e+'\x20'+hyperlink(_0x3d45ae['name'],_0x3b6f05)+'\x20'+a24_0x34c0a3[_0x5adc7c(0x208)](_0x3b6f05));}}_0x28c086[_0x5adc7c(0x20f)]>0x0&&console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x23b)](_0x5adc7c(0x23a)+_0x28c086[_0x5adc7c(0x20f)]+'\x20templates'));_0x28c086['updated']>0x0&&console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x23b)](_0x5adc7c(0x212)+_0x28c086[_0x5adc7c(0x23c)]+'\x20templates'));if(_0x28c086[_0x5adc7c(0x22a)][_0x5adc7c(0x215)]>0x0){console[_0x5adc7c(0x1f5)](a24_0x34c0a3[_0x5adc7c(0x234)]('✘\x20'+_0x28c086[_0x5adc7c(0x22a)]['length']+'\x20errors:'));for(const _0x332e1e of _0x28c086[_0x5adc7c(0x22a)]){console[_0x5adc7c(0x1f5)]('\x20\x20'+a24_0x34c0a3['red'](_0x332e1e[_0x5adc7c(0x225)])+':\x20'+_0x332e1e[_0x5adc7c(0x1f5)]);}}return saveSessionContext({'engage_workspace':_0x2e2ef0},_0x24110d[_0x5adc7c(0x1f9)]),_0x28c086[_0x5adc7c(0x22a)][_0x5adc7c(0x215)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a27_0x183692=a27_0x5690;(function(_0x70be9,_0x176897){const _0x4f8b39=a27_0x5690,_0x4af8f1=_0x70be9();while(!![]){try{const _0x14362=-parseInt(_0x4f8b39(0xc5))/0x1*(-parseInt(_0x4f8b39(0xd0))/0x2)+parseInt(_0x4f8b39(0xeb))/0x3+-parseInt(_0x4f8b39(0xef))/0x4*(-parseInt(_0x4f8b39(0xcb))/0x5)+parseInt(_0x4f8b39(0xf5))/0x6+-parseInt(_0x4f8b39(0xcc))/0x7+-parseInt(_0x4f8b39(0x103))/0x8*(parseInt(_0x4f8b39(0xe8))/0x9)+-parseInt(_0x4f8b39(0x110))/0xa;if(_0x14362===_0x176897)break;else _0x4af8f1['push'](_0x4af8f1['shift']());}catch(_0x2984a5){_0x4af8f1['push'](_0x4af8f1['shift']());}}}(a27_0xd63f,0xd9fb1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a27_0xd63f(){const _0x24a9ad=['engage_workspace','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','relativePath','\x20templates','Preparing\x20push\x20to\x20workspace\x20\x27','\x20\x20\x20\x20','site','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','templateId','\x20templates\x20to\x20update:','green','No\x20template\x20YAML\x20files\x20found\x20in\x20','9VjQVgf','✔\x20Updated\x20','cwd','5114388hOUCZp','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','created','43108UoswyW','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','workspace','Push\x20','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','configDir','4662528odtFFf','results','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x20errors:','session','\x0aError:','Pushing\x20templates...','engage:template:push','\x20new\x20templates:','Aborted.','dryRun','create','verbose','red','7228392zhTukw','errors','action','cyan','yes','path','updated','Found\x20','\x20templates?','warnings','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','valid','engage','16895080vzXeYw','dirname','def','1xsUOpF','Resolving\x20references...','error','config','resolveWorkspaceId','message','485SUqsDy','4644689RqlRZI','yellow','filter','data','1244360wIIrXo','Workspace\x20is\x20required.','name','description','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','execute','-\x20no\x20changes\x20applied','1\x20template\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','length','setPhase','✔\x20Created\x20'];a27_0xd63f=function(){return _0x24a9ad;};return a27_0xd63f();}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a27_0x207327 from'chalk';import a27_0x55f492 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a27_0x5690(_0x4839f8,_0x1b61b5){_0x4839f8=_0x4839f8-0xc5;const _0xd63f2b=a27_0xd63f();let _0x5690ee=_0xd63f2b[_0x4839f8];return _0x5690ee;}export class EngageTemplatePushCommand extends BaseCommand{[a27_0x183692(0xd2)]=a27_0x183692(0xfc);[a27_0x183692(0xd3)]=a27_0x183692(0xf3);async[a27_0x183692(0xd5)](_0x5e10d2){const _0x19485f=a27_0x183692,{options:_0x30dfb4,args:_0x424d5d,tdx:_0x1bd277}=_0x5e10d2,_0x4161be=_0x30dfb4,_0x277dee=_0x424d5d[0x0],_0x19c7d1=_0x277dee?a27_0x55f492['resolve'](_0x277dee):undefined,_0x2a621=_0x19c7d1?isYamlFile(_0x19c7d1):![];let _0x45f460;if(_0x2a621&&_0x19c7d1)_0x45f460=a27_0x55f492[_0x19485f(0x111)](_0x19c7d1);else _0x19c7d1?_0x45f460=_0x19c7d1:_0x45f460=process[_0x19485f(0xea)]();let _0x365f2c;const _0x298c8f=tryFindTdxConfig(_0x45f460);_0x298c8f?.[_0x19485f(0xc8)][_0x19485f(0xdc)]&&(_0x365f2c=_0x298c8f[_0x19485f(0xc8)][_0x19485f(0xdc)],!_0x2a621&&(_0x45f460=_0x298c8f[_0x19485f(0xf4)]));_0x4161be['workspace']&&(_0x365f2c=_0x4161be[_0x19485f(0xf1)]);if(!_0x365f2c){const _0x2d903c=loadSessionContext(_0x4161be[_0x19485f(0xf9)]);_0x2d903c?.[_0x19485f(0xdc)]&&(_0x365f2c=_0x2d903c['engage_workspace']);}if(!_0x365f2c)return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xd1))),console[_0x19485f(0xc7)](_0x19485f(0xd4)),console['error'](_0x19485f(0xed)),console[_0x19485f(0xc7)](_0x19485f(0xd8)),console[_0x19485f(0xc7)](_0x19485f(0xf7)),0x1;let _0xacc215;_0x2a621&&_0x19c7d1?_0xacc215=[parseTemplateFile(_0x19c7d1,a27_0x55f492[_0x19485f(0x111)](_0x19c7d1))]:_0xacc215=discoverAndParseTemplateFiles(_0x45f460);if(_0xacc215[_0x19485f(0xd9)]===0x0)return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xe7)+_0x45f460)),console[_0x19485f(0xc7)](a27_0x207327['dim'](_0x19485f(0xf0))),0x1;const _0x1d43c5=_0xacc215[_0x19485f(0xd9)]===0x1?_0x19485f(0xd7)+_0xacc215[0x0][_0x19485f(0x112)][_0x19485f(0xd2)]:_0xacc215['length']+'\x20template\x20files';console[_0x19485f(0xc7)](_0x19485f(0x10a)+a27_0x207327[_0x19485f(0x106)](_0x1d43c5));let _0xd536be=![];for(const _0xb74296 of _0xacc215){const _0x2c2490=validateTemplateDef(_0xb74296[_0x19485f(0x112)]);if(!_0x2c2490[_0x19485f(0x10e)]){_0xd536be=!![],console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0x102)]('\x0aValidation\x20errors\x20in\x20'+_0xb74296[_0x19485f(0xde)]+':'));for(const _0x5ce005 of _0x2c2490[_0x19485f(0x104)]){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327['red']('✗')+'\x20'+_0x5ce005[_0x19485f(0x108)]+':\x20'+_0x5ce005[_0x19485f(0xca)]);}}for(const _0x110699 of _0x2c2490[_0x19485f(0x10c)]){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0xcd)]('⚠')+'\x20'+_0x110699[_0x19485f(0x108)]+':\x20'+_0x110699[_0x19485f(0xca)]);}}if(_0xd536be)return console['error'](a27_0x207327[_0x19485f(0x102)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x334a3b=await _0x1bd277[_0x19485f(0x10f)][_0x19485f(0xc9)](_0x365f2c),_0x2e82ee=await withProgressSpinner(_0x19485f(0xe0)+_0x365f2c+'\x27...',_0x524da6=>preparePush({'engage':_0x1bd277['engage']},_0xacc215,_0x334a3b,{'progress':{'update':_0x1fbed4=>_0x524da6['setPhase'](_0x1fbed4)}}),{'verbose':_0x4161be[_0x19485f(0x101)]}),_0x1912e3=_0x2e82ee[_0x19485f(0xcf)];await withProgressSpinner(_0x19485f(0xc6),_0x319a05=>resolveAndBuildInputs({'engage':_0x1bd277[_0x19485f(0x10f)]},_0x1912e3,_0x334a3b,{'progress':{'update':_0x2d6d4a=>_0x319a05['setPhase'](_0x2d6d4a)}}),{'verbose':_0x4161be['verbose']});const _0x11e57a=_0x1912e3[_0x19485f(0xce)](_0x251d5c=>_0x251d5c[_0x19485f(0x105)]===_0x19485f(0x100)),_0x2757e1=_0x1912e3[_0x19485f(0xce)](_0x40e688=>_0x40e688[_0x19485f(0x105)]==='update');console[_0x19485f(0xc7)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x365f2c+'\x27:');if(_0x11e57a['length']>0x0){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0xe6)]('+\x20'+_0x11e57a[_0x19485f(0xd9)]+_0x19485f(0xfd)));for(const _0x3bd483 of _0x11e57a){console[_0x19485f(0xc7)](_0x19485f(0xe1)+a27_0x207327[_0x19485f(0xe6)]('+')+'\x20'+_0x3bd483[_0x19485f(0x112)][_0x19485f(0xd2)]);}}if(_0x2757e1[_0x19485f(0xd9)]>0x0){console['error']('\x20\x20'+a27_0x207327[_0x19485f(0xcd)]('~\x20'+_0x2757e1[_0x19485f(0xd9)]+_0x19485f(0xe5)));for(const _0x489bb6 of _0x2757e1){console[_0x19485f(0xc7)](_0x19485f(0xe1)+a27_0x207327[_0x19485f(0xcd)]('~')+'\x20'+_0x489bb6[_0x19485f(0x112)][_0x19485f(0xd2)]);}}if(_0x11e57a[_0x19485f(0xd9)]===0x0&&_0x2757e1[_0x19485f(0xd9)]===0x0)return console['error'](a27_0x207327[_0x19485f(0xe6)]('\u2714\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x4161be[_0x19485f(0xff)])return console[_0x19485f(0xc7)](a27_0x207327['yellow'](_0x19485f(0xdd))),0x0;if(!_0x4161be[_0x19485f(0x107)]){if(!isInteractive())return console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0x102)](_0x19485f(0xfa)),_0x19485f(0x10d)),console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xec)](_0x19485f(0xe3))),0x1;const _0x3f4f6f=await confirmKey(_0x19485f(0xf2)+(_0x11e57a[_0x19485f(0xd9)]+_0x2757e1[_0x19485f(0xd9)])+_0x19485f(0x10b));if(!_0x3f4f6f)return console['error'](a27_0x207327[_0x19485f(0xcd)](_0x19485f(0xfe)),_0x19485f(0xd6)),0x1;}const _0xcc02c7=await withProgressSpinner(_0x19485f(0xfb),_0x1e7bd5=>executePush({'engage':_0x1bd277[_0x19485f(0x10f)]},_0x1912e3,{'progress':{'update':_0x146fcb=>_0x1e7bd5[_0x19485f(0xda)](_0x146fcb)}}),{'verbose':_0x4161be[_0x19485f(0x101)]}),_0x2b04ae=_0xcc02c7[_0x19485f(0xcf)];for(const _0x3aca7c of _0x2b04ae[_0x19485f(0xf6)]){if(_0x3aca7c['templateId']&&(_0x3aca7c['action']===_0x19485f(0xee)||_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0x109))){const _0x53b2eb=getTemplateUrl(_0x4161be[_0x19485f(0xe2)],_0x334a3b,_0x3aca7c[_0x19485f(0xe4)]),_0x3b9293=_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0xee)?'+':'~',_0xb64474=_0x3aca7c[_0x19485f(0x105)]===_0x19485f(0xee)?a27_0x207327[_0x19485f(0xe6)](_0x3b9293):a27_0x207327[_0x19485f(0xcd)](_0x3b9293);console[_0x19485f(0xc7)]('\x20\x20'+_0xb64474+'\x20'+hyperlink(_0x3aca7c['name'],_0x53b2eb)+'\x20'+a27_0x207327[_0x19485f(0xec)](_0x53b2eb));}}_0x2b04ae[_0x19485f(0xee)]>0x0&&console[_0x19485f(0xc7)](a27_0x207327[_0x19485f(0xe6)](_0x19485f(0xdb)+_0x2b04ae[_0x19485f(0xee)]+_0x19485f(0xdf)));_0x2b04ae[_0x19485f(0x109)]>0x0&&console['error'](a27_0x207327[_0x19485f(0xe6)](_0x19485f(0xe9)+_0x2b04ae['updated']+'\x20templates'));if(_0x2b04ae[_0x19485f(0x104)]['length']>0x0){console[_0x19485f(0xc7)](a27_0x207327['red']('✘\x20'+_0x2b04ae['errors']['length']+_0x19485f(0xf8)));for(const _0x4041d2 of _0x2b04ae['errors']){console[_0x19485f(0xc7)]('\x20\x20'+a27_0x207327[_0x19485f(0x102)](_0x4041d2[_0x19485f(0xd2)])+':\x20'+_0x4041d2[_0x19485f(0xc7)]);}}return saveSessionContext({'engage_workspace':_0x365f2c},_0x4161be[_0x19485f(0xf9)]),_0x2b04ae[_0x19485f(0x104)][_0x19485f(0xd9)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x5d0b1e=a28_0x5786;(function(_0x35c9a5,_0x52af31){const _0xf441dc=a28_0x5786,_0x2de351=_0x35c9a5();while(!![]){try{const _0x18b5a9=-parseInt(_0xf441dc(0x1c9))/0x1+-parseInt(_0xf441dc(0x1ca))/0x2*(-parseInt(_0xf441dc(0x1dd))/0x3)+parseInt(_0xf441dc(0x1c3))/0x4+parseInt(_0xf441dc(0x1d1))/0x5+-parseInt(_0xf441dc(0x1de))/0x6*(parseInt(_0xf441dc(0x1dc))/0x7)+parseInt(_0xf441dc(0x1c1))/0x8+-parseInt(_0xf441dc(0x1ce))/0x9;if(_0x18b5a9===_0x52af31)break;else _0x2de351['push'](_0x2de351['shift']());}catch(_0x32219a){_0x2de351['push'](_0x2de351['shift']());}}}(a28_0x63ec,0xa63ca));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x63ec(){const _0x527b71=['5847nWeqID','1515408OXvkjy','dim','name','valid','relativePath','reason','filter','✔\x20All\x20','red','Error:\x20Directory\x20not\x20found:\x20','endsWith','\x20warning(s)\x20found','resolve','length','yellow','\x20template(s)\x20valid','template','\x20(skipped:\x20','8605616KOYKfA','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','285932SDiMmv','.yaml','\x20valid','log','\x20template(s)\x20with\x20errors,\x20','invalidCount','1020438cbXVEY','1202Fxhmmm','skippedCount','Validate\x20template\x20YAML\x20files','execute','6397353SLPqkx','green','\x20non-template\x20file(s)\x20skipped)','1730975zumadC','warningCount','validCount','.yml','dirname','error','engage:template:validate','warnings','\x20non-template\x20file(s)\x20skipped','verbose','description','7fJOLyE'];a28_0x63ec=function(){return _0x527b71;};return a28_0x63ec();}function a28_0x5786(_0x266cf6,_0x285557){_0x266cf6=_0x266cf6-0x1b8;const _0x63ecf=a28_0x63ec();let _0x5786c1=_0x63ecf[_0x266cf6];return _0x5786c1;}import a28_0x55d76b from'chalk';import a28_0x3be570 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{[a28_0x5d0b1e(0x1e0)]=a28_0x5d0b1e(0x1d7);[a28_0x5d0b1e(0x1db)]=a28_0x5d0b1e(0x1cc);async[a28_0x5d0b1e(0x1cd)](_0x294db1){const _0x3b6f75=a28_0x5d0b1e,{options:_0x56a622,args:_0x2b2541}=_0x294db1,_0x256033=_0x56a622,_0x3b0250=_0x2b2541[0x0],_0x3767b7=_0x3b0250?a28_0x3be570[_0x3b6f75(0x1bb)](_0x3b0250):undefined,_0x477276=_0x3767b7?isYamlFile(_0x3767b7):![];let _0x273926,_0xd97bfb;if(_0x477276&&_0x3767b7)_0x273926=a28_0x3be570[_0x3b6f75(0x1d5)](_0x3767b7),_0xd97bfb=_0x3767b7;else _0x3767b7?_0x273926=_0x3767b7:_0x273926=process['cwd']();if(!_0xd97bfb&&!existsSync(_0x273926))return console['error'](a28_0x55d76b[_0x3b6f75(0x1e6)](_0x3b6f75(0x1b8)+_0x273926+'\x0a')),0x1;let _0x5e75f5;if(_0xd97bfb){if(!_0xd97bfb[_0x3b6f75(0x1b9)](_0x3b6f75(0x1d4))&&!_0xd97bfb[_0x3b6f75(0x1b9)](_0x3b6f75(0x1c4)))return console['error'](a28_0x55d76b[_0x3b6f75(0x1e6)](_0x3b6f75(0x1c2)+_0xd97bfb+'\x0a')),0x1;_0x5e75f5=[_0xd97bfb];}else _0x5e75f5=findYamlFiles(_0x273926);if(_0x5e75f5[_0x3b6f75(0x1bc)]===0x0)return console[_0x3b6f75(0x1d6)](a28_0x55d76b[_0x3b6f75(0x1e6)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x273926+'\x0a')),0x1;const _0x55812f=validateYamlFiles(_0x5e75f5,_0x273926,{'filterType':_0x3b6f75(0x1bf)}),_0xdea9f9=calculateSummary(_0x55812f),_0x9d3113=_0x55812f[_0x3b6f75(0x1e4)](isValidationResult);if(_0x9d3113[_0x3b6f75(0x1bc)]===0x0)return console['error'](a28_0x55d76b[_0x3b6f75(0x1bd)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x273926+'\x0a')),_0xdea9f9['skippedCount']>0x0&&console[_0x3b6f75(0x1d6)](a28_0x55d76b['dim']('('+_0xdea9f9[_0x3b6f75(0x1cb)]+_0x3b6f75(0x1d0))),0x0;for(const _0x18bc5f of _0x55812f){if(!isValidationResult(_0x18bc5f)){_0x256033[_0x3b6f75(0x1da)]&&console['log'](a28_0x55d76b[_0x3b6f75(0x1df)]('-\x20'+_0x18bc5f[_0x3b6f75(0x1e2)]+_0x3b6f75(0x1c0)+_0x18bc5f[_0x3b6f75(0x1e3)]+')'));continue;}const {relativePath:_0x16b7f3,source:_0x26b4fd,result:_0x2c9900}=_0x18bc5f;if(_0x2c9900[_0x3b6f75(0x1e1)]&&_0x2c9900[_0x3b6f75(0x1d8)][_0x3b6f75(0x1bc)]===0x0)_0x256033['verbose']&&console[_0x3b6f75(0x1c6)](a28_0x55d76b[_0x3b6f75(0x1cf)]('✔\x20'+_0x16b7f3));else _0x2c9900[_0x3b6f75(0x1e1)]?(console[_0x3b6f75(0x1c6)](a28_0x55d76b['yellow']('⚠\x20'+_0x16b7f3+':\x20'+_0x2c9900[_0x3b6f75(0x1d8)][_0x3b6f75(0x1bc)]+'\x20warning(s)')),console[_0x3b6f75(0x1c6)](formatValidationResult(_0x2c9900,_0x26b4fd,_0x16b7f3))):(console['log'](a28_0x55d76b[_0x3b6f75(0x1e6)]('✖\x20'+_0x16b7f3+':\x20'+_0x2c9900['errors'][_0x3b6f75(0x1bc)]+'\x20error(s)')),console[_0x3b6f75(0x1c6)](formatValidationResult(_0x2c9900,_0x26b4fd,_0x16b7f3)));}return console[_0x3b6f75(0x1c6)](''),_0xdea9f9['hasErrors']?(console[_0x3b6f75(0x1c6)](a28_0x55d76b[_0x3b6f75(0x1e6)]('Validation\x20failed:\x20'+_0xdea9f9[_0x3b6f75(0x1c8)]+_0x3b6f75(0x1c7)+_0xdea9f9[_0x3b6f75(0x1d3)]+_0x3b6f75(0x1c5))),_0xdea9f9[_0x3b6f75(0x1d2)]>0x0&&console[_0x3b6f75(0x1c6)](a28_0x55d76b['yellow'](_0xdea9f9[_0x3b6f75(0x1d2)]+_0x3b6f75(0x1ba))),_0xdea9f9[_0x3b6f75(0x1cb)]>0x0&&console[_0x3b6f75(0x1c6)](a28_0x55d76b[_0x3b6f75(0x1df)](_0xdea9f9['skippedCount']+_0x3b6f75(0x1d9))),0x1):(console[_0x3b6f75(0x1c6)](a28_0x55d76b['green'](_0x3b6f75(0x1e5)+_0xdea9f9[_0x3b6f75(0x1d3)]+_0x3b6f75(0x1be))),_0xdea9f9[_0x3b6f75(0x1d2)]>0x0&&console[_0x3b6f75(0x1c6)](a28_0x55d76b[_0x3b6f75(0x1bd)](_0xdea9f9[_0x3b6f75(0x1d2)]+_0x3b6f75(0x1ba))),_0xdea9f9[_0x3b6f75(0x1cb)]>0x0&&console['log'](a28_0x55d76b[_0x3b6f75(0x1df)](_0xdea9f9[_0x3b6f75(0x1cb)]+_0x3b6f75(0x1d9))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x3d29c7=a26_0x3113;(function(_0x339493,_0x5d9038){const _0x562cf7=a26_0x3113,_0x49dbb5=_0x339493();while(!![]){try{const _0x5ad607=parseInt(_0x562cf7(0xcd))/0x1*(-parseInt(_0x562cf7(0xcf))/0x2)+-parseInt(_0x562cf7(0xc9))/0x3*(parseInt(_0x562cf7(0xa1))/0x4)+parseInt(_0x562cf7(0xaf))/0x5*(-parseInt(_0x562cf7(0xa0))/0x6)+-parseInt(_0x562cf7(0xb8))/0x7*(-parseInt(_0x562cf7(0xb2))/0x8)+-parseInt(_0x562cf7(0xb9))/0x9+parseInt(_0x562cf7(0xa2))/0xa*(parseInt(_0x562cf7(0x8a))/0xb)+-parseInt(_0x562cf7(0xba))/0xc*(-parseInt(_0x562cf7(0xcb))/0xd);if(_0x5ad607===_0x5d9038)break;else _0x49dbb5['push'](_0x49dbb5['shift']());}catch(_0x56dc0e){_0x49dbb5['push'](_0x49dbb5['shift']());}}}(a26_0xea9a,0xedc38));import{BaseCommand}from'./command.js';function a26_0xea9a(){const _0x1832d4=['data','✔\x20Found\x20','validate','verbose','now','20QRNNvL','INVALID_ARGUMENT','floor','1568992JxfDqm','debug','m\x20ago','h\x20ago','job:kill','trino','7pylIlA','3058110AJcnLW','12zWBMJX','...','No\x20SQL\x20statements\x20found\x20in\x20file','Submitting\x20kill\x20request...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','description','created_at','type','just\x20now','url','substring','submit','length','end_at','Getting\x20job\x20results...','32559euTPuY','Limit:\x20','23529974mPVSoR','jobType','1jGyxdA','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','3173162nQzbhj','execute','mo\x20ago','✔\x20Retrieved\x20','join','abs','push','Status\x20filter:\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job:submit','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','show','Get\x20job\x20results','job_id','user_name','hive','✔\x20Job\x20submitted','\x20job','green','error','result','\x20row','red','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','args','kill','query','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','4686SqYDFw','Kill\x20a\x20job','getTime','priority','Listing\x20jobs...','status','presto','list','job:result','Getting\x20job\x20details...','Submit\x20a\x20job','round','map','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Query:\x20','\x20jobs','information_schema','jobs','Show\x20job\x20details','job:show','Cancelled','name','578118PyIBcg','20eJxLur','31310LqLezB','\x27\x20to\x20verify\x20the\x20job\x20status','site','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','database','dim','start_at','Database:\x20'];a26_0xea9a=function(){return _0x1832d4;};return a26_0xea9a();}import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0x3113(_0x25dd31,_0xf617e2){_0x25dd31=_0x25dd31-0x82;const _0xea9aa8=a26_0xea9a();let _0x311363=_0xea9aa8[_0x25dd31];return _0x311363;}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x4625bd from'chalk';function formatDuration(_0x388fe7){const _0x1ce28f=a26_0x3113;if(_0x388fe7<0x3c)return _0x388fe7+'s';if(_0x388fe7<0xe10)return Math[_0x1ce28f(0xb1)](_0x388fe7/0x3c)+'m\x20'+_0x388fe7%0x3c+'s';const _0x1f6f41=Math['floor'](_0x388fe7/0xe10),_0xab8b1c=Math[_0x1ce28f(0xb1)](_0x388fe7%0xe10/0x3c);return _0xab8b1c>0x0?_0x1f6f41+'h\x20'+_0xab8b1c+'m':_0x1f6f41+'h';}function formatRelativeTime(_0x2f95d2){const _0x5e038e=a26_0x3113,_0x202aff=Date[_0x5e038e(0xae)]()-_0x2f95d2['getTime'](),_0x3b8145=Math[_0x5e038e(0xb1)](Math[_0x5e038e(0xd4)](_0x202aff)/0x3e8);if(_0x3b8145<0x3c)return _0x5e038e(0xc2);const _0x83e1d=Math[_0x5e038e(0xb1)](_0x3b8145/0x3c);if(_0x83e1d<0x3c)return _0x83e1d+_0x5e038e(0xb4);const _0x2215b8=Math[_0x5e038e(0xb1)](_0x83e1d/0x3c);if(_0x2215b8<0x18)return _0x2215b8+_0x5e038e(0xb5);const _0x1e6aca=Math['floor'](_0x2215b8/0x18);if(_0x1e6aca<0x1e)return _0x1e6aca+'d\x20ago';return Math['floor'](_0x1e6aca/0x1e)+_0x5e038e(0xd1);}export class JobListCommand extends BaseCommand{['name']=a26_0x3d29c7(0x9b);[a26_0x3d29c7(0xbf)]='List\x20jobs';async['execute'](_0x510003){const _0x28d63a=a26_0x3d29c7,{options:_0x1ec454,tdx:_0x4ff0d2}=_0x510003,_0x45f7ce=resolveLimit(_0x1ec454['limit'],DEFAULT_DISPLAY_LIMIT),_0x4d352d=_0x1ec454[_0x28d63a(0x8f)];_0x1ec454['verbose']&&(console['error'](_0x28d63a(0xca)+_0x45f7ce+_0x28d63a(0x99)),_0x4d352d&&console[_0x28d63a(0xe3)](_0x28d63a(0xd6)+_0x4d352d));const _0xf0b943=await withSpinner(_0x28d63a(0x8e),()=>_0x4ff0d2[_0x28d63a(0x9b)][_0x28d63a(0x91)]({'from':0x0,'to':_0x45f7ce-0x1,'status':_0x4d352d}),{'verbose':_0x1ec454[_0x28d63a(0xad)]}),_0x39886a=_0xf0b943[_0x28d63a(0xaa)];console['error'](_0x28d63a(0xab)+_0x39886a[_0x28d63a(0xc6)]+_0x28d63a(0xe1)+(_0x39886a[_0x28d63a(0xc6)]!==0x1?'s':''));const _0x58be7e=_0x1ec454[_0x28d63a(0xa4)];if(isStructuredFormat(_0x1ec454)){const _0x4a7ad6=_0x39886a[_0x28d63a(0x96)](_0x279ee1=>{const _0x3ee789=_0x28d63a;let _0x3abfd7;if(_0x279ee1['start_at']&&_0x279ee1['end_at']){const _0x872218=new Date(_0x279ee1[_0x3ee789(0xa8)])[_0x3ee789(0x8c)](),_0x6d9443=new Date(_0x279ee1[_0x3ee789(0xc7)])[_0x3ee789(0x8c)]();_0x3abfd7=Math['round']((_0x6d9443-_0x872218)/0x3e8);}return{'job_id':_0x279ee1['job_id'],'type':_0x279ee1[_0x3ee789(0xc1)]===_0x3ee789(0x90)?_0x3ee789(0xb7):_0x279ee1[_0x3ee789(0xc1)],'status':_0x279ee1[_0x3ee789(0x8f)],'user_name':_0x279ee1[_0x3ee789(0xde)],'duration_sec':_0x3abfd7,'created_at':_0x279ee1[_0x3ee789(0xc0)],'started_at':_0x279ee1[_0x3ee789(0xa8)],'end_at':_0x279ee1[_0x3ee789(0xc7)]};});await handleSDKOutput(_0x4a7ad6,_0x1ec454);}else for(const _0x3dd998 of _0x39886a){const _0x11d468=_0x3dd998[_0x28d63a(0x8f)]==='success'?a26_0x4625bd[_0x28d63a(0xe2)]:_0x3dd998['status']===_0x28d63a(0xe3)?a26_0x4625bd[_0x28d63a(0x84)]:a26_0x4625bd[_0x28d63a(0xa7)],_0x2fddc0=_0x11d468(_0x3dd998[_0x28d63a(0x8f)]),_0x583f63=getJobUrl(_0x58be7e,_0x3dd998[_0x28d63a(0xdd)]),_0x5c3303=hyperlink(_0x3dd998[_0x28d63a(0xdd)],_0x583f63),_0x2f2460=a26_0x4625bd[_0x28d63a(0xa7)](_0x3dd998['type']===_0x28d63a(0x90)?_0x28d63a(0xb7):_0x3dd998[_0x28d63a(0xc1)]),_0x56fda3=[];if(_0x3dd998['start_at']&&_0x3dd998['end_at']){const _0x3ff3a0=Math[_0x28d63a(0x95)]((new Date(_0x3dd998['end_at'])[_0x28d63a(0x8c)]()-new Date(_0x3dd998['start_at'])[_0x28d63a(0x8c)]())/0x3e8);_0x56fda3['push'](formatDuration(_0x3ff3a0));}if(_0x3dd998[_0x28d63a(0xc7)])_0x56fda3['push'](formatRelativeTime(new Date(_0x3dd998[_0x28d63a(0xc7)])));else _0x3dd998[_0x28d63a(0xa8)]&&_0x56fda3[_0x28d63a(0xd5)](formatRelativeTime(new Date(_0x3dd998[_0x28d63a(0xa8)])));const _0x1667a5=_0x56fda3['length']>0x0?a26_0x4625bd[_0x28d63a(0xa7)]('\x20'+_0x56fda3[_0x28d63a(0xd3)](',\x20')):'';console['log']('⚡\x20'+_0x5c3303+'\x20'+_0x2f2460+'\x20'+_0x2fddc0+_0x1667a5);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x3d29c7(0x9d);[a26_0x3d29c7(0xbf)]=a26_0x3d29c7(0x9c);[a26_0x3d29c7(0xac)](_0xe5654){const _0x25d6c9=a26_0x3d29c7,_0x9c3602=_0xe5654['args'][0x0];if(!_0x9c3602)return _0x25d6c9(0xbe);return undefined;}async[a26_0x3d29c7(0xd0)](_0x29ce7d){const _0x52ac04=a26_0x3d29c7,{options:_0x5e8b2e,args:_0x49977d,tdx:_0x73f9cb}=_0x29ce7d,_0x179669=_0x49977d[0x0],_0x34c373=await withSpinner(_0x52ac04(0x93),()=>_0x73f9cb[_0x52ac04(0x9b)][_0x52ac04(0xdb)](_0x179669),{'verbose':_0x5e8b2e[_0x52ac04(0xad)]}),_0x29a0c8=_0x34c373[_0x52ac04(0xaa)];let _0x142f22;if(_0x29a0c8[_0x52ac04(0xa8)]&&_0x29a0c8[_0x52ac04(0xc7)]){const _0x429214=new Date(_0x29a0c8[_0x52ac04(0xa8)])[_0x52ac04(0x8c)](),_0x4940a8=new Date(_0x29a0c8['end_at'])[_0x52ac04(0x8c)]();_0x142f22=Math[_0x52ac04(0x95)]((_0x4940a8-_0x429214)/0x3e8);}const _0x2ebd76={'job_id':_0x29a0c8[_0x52ac04(0xdd)],'type':_0x29a0c8[_0x52ac04(0xc1)],'status':_0x29a0c8[_0x52ac04(0x8f)],..._0x29a0c8[_0x52ac04(0xde)]&&{'user_name':_0x29a0c8[_0x52ac04(0xde)]},..._0x142f22!==undefined&&{'duration_sec':_0x142f22},..._0x29a0c8['created_at']&&{'created_at':_0x29a0c8['created_at']},..._0x29a0c8[_0x52ac04(0xa8)]&&{'started_at':_0x29a0c8[_0x52ac04(0xa8)]},..._0x29a0c8['end_at']&&{'end_at':_0x29a0c8['end_at']},..._0x29a0c8['database']&&{'database':_0x29a0c8[_0x52ac04(0xa6)]},..._0x29a0c8[_0x52ac04(0x8d)]!==undefined&&{'priority':_0x29a0c8[_0x52ac04(0x8d)]},..._0x29a0c8[_0x52ac04(0xc3)]&&{'url':_0x29a0c8[_0x52ac04(0xc3)]},..._0x29a0c8[_0x52ac04(0x88)]&&{'query':_0x29a0c8[_0x52ac04(0x88)]},..._0x29a0c8[_0x52ac04(0xb3)]&&{'debug':_0x29a0c8[_0x52ac04(0xb3)]}};return await handleSingleObjectOutput(_0x2ebd76,_0x5e8b2e),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x3d29c7(0x9f)]=a26_0x3d29c7(0xb6);[a26_0x3d29c7(0xbf)]=a26_0x3d29c7(0x8b);[a26_0x3d29c7(0xac)](_0xeb2a1c){const _0x3b35f7=a26_0x3d29c7,_0x4d3096=_0xeb2a1c[_0x3b35f7(0x86)][0x0];if(!_0x4d3096)return _0x3b35f7(0x97);return undefined;}async[a26_0x3d29c7(0xd0)](_0x3f9a83){const _0x2f0b80=a26_0x3d29c7,{options:_0x25b9a9,args:_0x2cc1dd,tdx:_0x35d8a1}=_0x3f9a83,_0x4d42e7=_0x2cc1dd[0x0];if(!_0x25b9a9['yes']){const _0x422809=await confirm(_0x2f0b80(0xd8)+_0x4d42e7+'?');if(!_0x422809)return console[_0x2f0b80(0xe3)](_0x2f0b80(0x9e)),0x0;}return await withSpinner(_0x2f0b80(0xbd),()=>_0x35d8a1[_0x2f0b80(0x9b)][_0x2f0b80(0x87)](_0x4d42e7),{'verbose':_0x25b9a9[_0x2f0b80(0xad)]}),console[_0x2f0b80(0xe3)](_0x2f0b80(0x89)+_0x4d42e7),console['error'](_0x2f0b80(0xda)+_0x4d42e7+_0x2f0b80(0xa3)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x3d29c7(0x9f)]=a26_0x3d29c7(0xd9);[a26_0x3d29c7(0xbf)]=a26_0x3d29c7(0x94);async[a26_0x3d29c7(0xd0)](_0xc3909c){const _0x2344a5=a26_0x3d29c7,{options:_0x4e6054,args:_0xc512ba,tdx:_0x4b3d83}=_0xc3909c,_0x1e07bb=_0x4e6054[_0x2344a5(0xcc)]||_0x2344a5(0xb7),_0x5f4327=_0x4e6054['file'],_0x162150=_0x4e6054[_0x2344a5(0xa6)]||_0x2344a5(0x9a),_0x1b996b=_0x4e6054[_0x2344a5(0x82)];if(_0x1e07bb!==_0x2344a5(0xb7)&&_0x1e07bb!==_0x2344a5(0xdf))throw new SDKError(ErrorCode[_0x2344a5(0xb0)],_0x2344a5(0xa5));let _0x164b27;if(_0x5f4327){if(_0xc512ba[0x0])throw new SDKError(ErrorCode[_0x2344a5(0xb0)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x2e297d=readSqlStatementsFromFile(_0x5f4327);if(_0x2e297d[_0x2344a5(0xc6)]===0x0)throw new SDKError(ErrorCode[_0x2344a5(0xb0)],_0x2344a5(0xbc));if(_0x2e297d[_0x2344a5(0xc6)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2344a5(0x85));_0x164b27=_0x2e297d[0x0];}else{if(!_0xc512ba[0x0])throw new SDKError(ErrorCode[_0x2344a5(0xb0)],_0x2344a5(0xd7));_0x164b27=_0xc512ba[0x0];}_0x4e6054[_0x2344a5(0xad)]&&(console[_0x2344a5(0xe3)]('Job\x20type:\x20'+_0x1e07bb),console[_0x2344a5(0xe3)](_0x2344a5(0xa9)+_0x162150),console['error'](_0x2344a5(0x98)+_0x164b27[_0x2344a5(0xc4)](0x0,0x64)+(_0x164b27[_0x2344a5(0xc6)]>0x64?_0x2344a5(0xbb):'')));const _0x49d7f2=await withSpinner('Submitting\x20job...',()=>_0x4b3d83[_0x2344a5(0x9b)][_0x2344a5(0xc5)](_0x162150,_0x164b27,_0x1e07bb,_0x1b996b),{'verbose':_0x4e6054[_0x2344a5(0xad)]}),_0x46d1ff=_0x49d7f2['data'];return console[_0x2344a5(0xe3)](_0x2344a5(0xe0)),console[_0x2344a5(0xe3)]('\x20\x20Job\x20ID:\x20'+_0x46d1ff[_0x2344a5(0xdd)]),await handleSDKOutput([_0x46d1ff],_0x4e6054),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x3d29c7(0x9f)]=a26_0x3d29c7(0x92);[a26_0x3d29c7(0xbf)]=a26_0x3d29c7(0xdc);[a26_0x3d29c7(0xac)](_0x4f9d6a){const _0x58b9ee=a26_0x3d29c7,_0x26dc55=_0x4f9d6a['args'][0x0];if(!_0x26dc55)return _0x58b9ee(0xce);return undefined;}async[a26_0x3d29c7(0xd0)](_0x5b787f){const _0x5a9828=a26_0x3d29c7,{options:_0x5eeda6,args:_0x282a57,tdx:_0x49e3f5}=_0x5b787f,_0x442665=_0x282a57[0x0],_0x124fc9=await withSpinner(_0x5a9828(0xc8),()=>_0x49e3f5[_0x5a9828(0x9b)]['result'](_0x442665),{'verbose':_0x5eeda6[_0x5a9828(0xad)]}),_0x5a6dd5=_0x124fc9[_0x5a9828(0xaa)];return console[_0x5a9828(0xe3)](_0x5a9828(0xd2)+_0x5a6dd5[_0x5a9828(0xc6)]+_0x5a9828(0x83)+(_0x5a6dd5[_0x5a9828(0xc6)]!==0x1?'s':'')),await handleSDKOutput(_0x5a6dd5,_0x5eeda6),0x0;}}
|
|
1
|
+
const a29_0x3a2ccf=a29_0x343c;(function(_0x53330a,_0x2dd3cc){const _0x3e49d2=a29_0x343c,_0x5a13ba=_0x53330a();while(!![]){try{const _0x1c5119=parseInt(_0x3e49d2(0x1be))/0x1+parseInt(_0x3e49d2(0x1a7))/0x2+-parseInt(_0x3e49d2(0x1ef))/0x3+parseInt(_0x3e49d2(0x1ee))/0x4+parseInt(_0x3e49d2(0x1d5))/0x5+-parseInt(_0x3e49d2(0x1bf))/0x6*(-parseInt(_0x3e49d2(0x198))/0x7)+-parseInt(_0x3e49d2(0x1e9))/0x8;if(_0x1c5119===_0x2dd3cc)break;else _0x5a13ba['push'](_0x5a13ba['shift']());}catch(_0x1b094a){_0x5a13ba['push'](_0x5a13ba['shift']());}}}(a29_0x3c8e,0xa197d));import{BaseCommand}from'./command.js';function a29_0x343c(_0x49134c,_0x5c92a6){_0x49134c=_0x49134c-0x196;const _0x3c8e4c=a29_0x3c8e();let _0x343cc3=_0x3c8e4c[_0x49134c];return _0x343cc3;}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 a29_0x316307 from'chalk';function formatDuration(_0x1ad8c8){const _0x5b1035=a29_0x343c;if(_0x1ad8c8<0x3c)return _0x1ad8c8+'s';if(_0x1ad8c8<0xe10)return Math[_0x5b1035(0x1ea)](_0x1ad8c8/0x3c)+'m\x20'+_0x1ad8c8%0x3c+'s';const _0x47f6b6=Math['floor'](_0x1ad8c8/0xe10),_0x3df80b=Math['floor'](_0x1ad8c8%0xe10/0x3c);return _0x3df80b>0x0?_0x47f6b6+'h\x20'+_0x3df80b+'m':_0x47f6b6+'h';}function a29_0x3c8e(){const _0x4aca0b=['file','name','description','Submit\x20a\x20job','jobs','\x20\x20Job\x20ID:\x20','Submitting\x20kill\x20request...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','execute','mo\x20ago','presto','\x20row','5314220mNPcwj','Cancelled','Getting\x20job\x20results...','just\x20now','query','Getting\x20job\x20details...','status','show','substring','result','\x20jobs','✔\x20Found\x20','job_id','h\x20ago','debug','Limit:\x20','now','Database:\x20','verbose','submit','14030008TGJeEI','floor','...','priority','error','2866032zWeYbZ','3637968HJzmWS','join','✔\x20Job\x20submitted','2744CHiMMW','list','getTime','List\x20jobs','site','end_at','INVALID_ARGUMENT','job:result','map','user_name','length','hive','kill','created_at','validate','537470zdLsaf','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','job:kill','data','dim','success','Kill\x20a\x20job','Query:\x20','push','information_schema','Get\x20job\x20results','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','start_at','trino','limit','args','Job\x20type:\x20','No\x20SQL\x20statements\x20found\x20in\x20file','job:submit','type','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','jobType','672333kgQerj','13896Mltwxi','round','red','✔\x20Retrieved\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','database','url','\x27\x20to\x20verify\x20the\x20job\x20status','Status\x20filter:\x20','log'];a29_0x3c8e=function(){return _0x4aca0b;};return a29_0x3c8e();}function formatRelativeTime(_0x320142){const _0x5b4d97=a29_0x343c,_0x494408=Date[_0x5b4d97(0x1e5)]()-_0x320142[_0x5b4d97(0x19a)](),_0xf14f6d=Math[_0x5b4d97(0x1ea)](Math['abs'](_0x494408)/0x3e8);if(_0xf14f6d<0x3c)return _0x5b4d97(0x1d8);const _0x286750=Math[_0x5b4d97(0x1ea)](_0xf14f6d/0x3c);if(_0x286750<0x3c)return _0x286750+'m\x20ago';const _0x2e65f6=Math[_0x5b4d97(0x1ea)](_0x286750/0x3c);if(_0x2e65f6<0x18)return _0x2e65f6+_0x5b4d97(0x1e2);const _0x58553a=Math[_0x5b4d97(0x1ea)](_0x2e65f6/0x18);if(_0x58553a<0x1e)return _0x58553a+'d\x20ago';return Math[_0x5b4d97(0x1ea)](_0x58553a/0x1e)+_0x5b4d97(0x1d2);}export class JobListCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1cd);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x19b);async['execute'](_0x8d1a7c){const _0x14d478=a29_0x3a2ccf,{options:_0x385f70,tdx:_0x4c4808}=_0x8d1a7c,_0x1ecedb=resolveLimit(_0x385f70[_0x14d478(0x1b6)],DEFAULT_DISPLAY_LIMIT),_0x1718cb=_0x385f70['status'];_0x385f70[_0x14d478(0x1e7)]&&(console['error'](_0x14d478(0x1e4)+_0x1ecedb+_0x14d478(0x1df)),_0x1718cb&&console['error'](_0x14d478(0x1c7)+_0x1718cb));const _0x5ade98=await withSpinner('Listing\x20jobs...',()=>_0x4c4808['jobs'][_0x14d478(0x199)]({'from':0x0,'to':_0x1ecedb-0x1,'status':_0x1718cb}),{'verbose':_0x385f70[_0x14d478(0x1e7)]}),_0x14af25=_0x5ade98['data'];console[_0x14d478(0x1ed)](_0x14d478(0x1e0)+_0x14af25[_0x14d478(0x1a2)]+'\x20job'+(_0x14af25[_0x14d478(0x1a2)]!==0x1?'s':''));const _0x5174a9=_0x385f70[_0x14d478(0x19c)];if(isStructuredFormat(_0x385f70)){const _0x1a1835=_0x14af25[_0x14d478(0x1a0)](_0x76d9da=>{const _0x5c6423=_0x14d478;let _0x5bf23e;if(_0x76d9da[_0x5c6423(0x1b4)]&&_0x76d9da[_0x5c6423(0x19d)]){const _0x47fc17=new Date(_0x76d9da[_0x5c6423(0x1b4)])[_0x5c6423(0x19a)](),_0x1e509e=new Date(_0x76d9da[_0x5c6423(0x19d)])['getTime']();_0x5bf23e=Math['round']((_0x1e509e-_0x47fc17)/0x3e8);}return{'job_id':_0x76d9da['job_id'],'type':_0x76d9da[_0x5c6423(0x1bb)]===_0x5c6423(0x1d3)?_0x5c6423(0x1b5):_0x76d9da[_0x5c6423(0x1bb)],'status':_0x76d9da['status'],'user_name':_0x76d9da['user_name'],'duration_sec':_0x5bf23e,'created_at':_0x76d9da[_0x5c6423(0x1a5)],'started_at':_0x76d9da[_0x5c6423(0x1b4)],'end_at':_0x76d9da[_0x5c6423(0x19d)]};});await handleSDKOutput(_0x1a1835,_0x385f70);}else for(const _0x48497e of _0x14af25){const _0x1d8151=_0x48497e[_0x14d478(0x1db)]===_0x14d478(0x1ad)?a29_0x316307['green']:_0x48497e[_0x14d478(0x1db)]==='error'?a29_0x316307[_0x14d478(0x1c1)]:a29_0x316307['dim'],_0x23046b=_0x1d8151(_0x48497e[_0x14d478(0x1db)]),_0x1bf4f8=getJobUrl(_0x5174a9,_0x48497e['job_id']),_0x4e3840=hyperlink(_0x48497e[_0x14d478(0x1e1)],_0x1bf4f8),_0x3603d8=a29_0x316307[_0x14d478(0x1ac)](_0x48497e[_0x14d478(0x1bb)]===_0x14d478(0x1d3)?'trino':_0x48497e[_0x14d478(0x1bb)]),_0xca5d68=[];if(_0x48497e[_0x14d478(0x1b4)]&&_0x48497e[_0x14d478(0x19d)]){const _0x481f95=Math[_0x14d478(0x1c0)]((new Date(_0x48497e[_0x14d478(0x19d)])['getTime']()-new Date(_0x48497e[_0x14d478(0x1b4)])[_0x14d478(0x19a)]())/0x3e8);_0xca5d68['push'](formatDuration(_0x481f95));}if(_0x48497e[_0x14d478(0x19d)])_0xca5d68['push'](formatRelativeTime(new Date(_0x48497e[_0x14d478(0x19d)])));else _0x48497e['start_at']&&_0xca5d68[_0x14d478(0x1b0)](formatRelativeTime(new Date(_0x48497e['start_at'])));const _0x2f0db3=_0xca5d68['length']>0x0?a29_0x316307[_0x14d478(0x1ac)]('\x20'+_0xca5d68[_0x14d478(0x196)](',\x20')):'';console[_0x14d478(0x1c8)]('⚡\x20'+_0x4e3840+'\x20'+_0x3603d8+'\x20'+_0x23046b+_0x2f0db3);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']='job:show';['description']='Show\x20job\x20details';['validate'](_0x568cac){const _0x5f2caf=a29_0x3a2ccf,_0x110c5b=_0x568cac[_0x5f2caf(0x1b7)][0x0];if(!_0x110c5b)return _0x5f2caf(0x1a9);return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x4db17e){const _0x17f4f8=a29_0x3a2ccf,{options:_0xf319a8,args:_0x42edc6,tdx:_0x35e18f}=_0x4db17e,_0x41ee62=_0x42edc6[0x0],_0x498f24=await withSpinner(_0x17f4f8(0x1da),()=>_0x35e18f['jobs'][_0x17f4f8(0x1dc)](_0x41ee62),{'verbose':_0xf319a8['verbose']}),_0x5d2c28=_0x498f24['data'];let _0x232d9b;if(_0x5d2c28[_0x17f4f8(0x1b4)]&&_0x5d2c28[_0x17f4f8(0x19d)]){const _0x23eccd=new Date(_0x5d2c28[_0x17f4f8(0x1b4)])[_0x17f4f8(0x19a)](),_0x558caa=new Date(_0x5d2c28[_0x17f4f8(0x19d)])[_0x17f4f8(0x19a)]();_0x232d9b=Math['round']((_0x558caa-_0x23eccd)/0x3e8);}const _0x3eeba0={'job_id':_0x5d2c28['job_id'],'type':_0x5d2c28[_0x17f4f8(0x1bb)],'status':_0x5d2c28[_0x17f4f8(0x1db)],..._0x5d2c28['user_name']&&{'user_name':_0x5d2c28[_0x17f4f8(0x1a1)]},..._0x232d9b!==undefined&&{'duration_sec':_0x232d9b},..._0x5d2c28[_0x17f4f8(0x1a5)]&&{'created_at':_0x5d2c28[_0x17f4f8(0x1a5)]},..._0x5d2c28[_0x17f4f8(0x1b4)]&&{'started_at':_0x5d2c28[_0x17f4f8(0x1b4)]},..._0x5d2c28[_0x17f4f8(0x19d)]&&{'end_at':_0x5d2c28[_0x17f4f8(0x19d)]},..._0x5d2c28[_0x17f4f8(0x1c4)]&&{'database':_0x5d2c28[_0x17f4f8(0x1c4)]},..._0x5d2c28[_0x17f4f8(0x1ec)]!==undefined&&{'priority':_0x5d2c28['priority']},..._0x5d2c28['url']&&{'url':_0x5d2c28[_0x17f4f8(0x1c5)]},..._0x5d2c28['query']&&{'query':_0x5d2c28[_0x17f4f8(0x1d9)]},..._0x5d2c28[_0x17f4f8(0x1e3)]&&{'debug':_0x5d2c28[_0x17f4f8(0x1e3)]}};return await handleSingleObjectOutput(_0x3eeba0,_0xf319a8),0x0;}}export class JobKillCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1aa);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1ae);['validate'](_0xe351e5){const _0x43529d=a29_0x3a2ccf,_0x45ab81=_0xe351e5['args'][0x0];if(!_0x45ab81)return _0x43529d(0x1a8);return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x4cdc03){const _0x25b238=a29_0x3a2ccf,{options:_0x2dffca,args:_0x284e03,tdx:_0x2417c9}=_0x4cdc03,_0x228140=_0x284e03[0x0];if(!_0x2dffca['yes']){const _0x2ae362=await confirm(_0x25b238(0x1b3)+_0x228140+'?');if(!_0x2ae362)return console[_0x25b238(0x1ed)](_0x25b238(0x1d6)),0x0;}return await withSpinner(_0x25b238(0x1cf),()=>_0x2417c9[_0x25b238(0x1cd)][_0x25b238(0x1a4)](_0x228140),{'verbose':_0x2dffca[_0x25b238(0x1e7)]}),console[_0x25b238(0x1ed)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x228140),console[_0x25b238(0x1ed)](_0x25b238(0x1c3)+_0x228140+_0x25b238(0x1c6)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x1ba);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1cc);async[a29_0x3a2ccf(0x1d1)](_0x3976ab){const _0x5db9c1=a29_0x3a2ccf,{options:_0x4b815b,args:_0x17c9f3,tdx:_0x4eab63}=_0x3976ab,_0x55794c=_0x4b815b[_0x5db9c1(0x1bd)]||_0x5db9c1(0x1b5),_0x1db0b9=_0x4b815b[_0x5db9c1(0x1c9)],_0x309345=_0x4b815b['database']||_0x5db9c1(0x1b1),_0x57b04b=_0x4b815b['result'];if(_0x55794c!==_0x5db9c1(0x1b5)&&_0x55794c!==_0x5db9c1(0x1a3))throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1bc));let _0x35d940;if(_0x1db0b9){if(_0x17c9f3[0x0])throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1d0));const _0x91e00f=readSqlStatementsFromFile(_0x1db0b9);if(_0x91e00f[_0x5db9c1(0x1a2)]===0x0)throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],_0x5db9c1(0x1b9));if(_0x91e00f['length']>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x35d940=_0x91e00f[0x0];}else{if(!_0x17c9f3[0x0])throw new SDKError(ErrorCode[_0x5db9c1(0x19e)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x35d940=_0x17c9f3[0x0];}_0x4b815b[_0x5db9c1(0x1e7)]&&(console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1b8)+_0x55794c),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1e6)+_0x309345),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1af)+_0x35d940[_0x5db9c1(0x1dd)](0x0,0x64)+(_0x35d940[_0x5db9c1(0x1a2)]>0x64?_0x5db9c1(0x1eb):'')));const _0xad66ec=await withSpinner('Submitting\x20job...',()=>_0x4eab63[_0x5db9c1(0x1cd)][_0x5db9c1(0x1e8)](_0x309345,_0x35d940,_0x55794c,_0x57b04b),{'verbose':_0x4b815b[_0x5db9c1(0x1e7)]}),_0x307742=_0xad66ec[_0x5db9c1(0x1ab)];return console[_0x5db9c1(0x1ed)](_0x5db9c1(0x197)),console[_0x5db9c1(0x1ed)](_0x5db9c1(0x1ce)+_0x307742[_0x5db9c1(0x1e1)]),await handleSDKOutput([_0x307742],_0x4b815b),0x0;}}export class JobResultCommand extends BaseCommand{[a29_0x3a2ccf(0x1ca)]=a29_0x3a2ccf(0x19f);[a29_0x3a2ccf(0x1cb)]=a29_0x3a2ccf(0x1b2);[a29_0x3a2ccf(0x1a6)](_0xe17f98){const _0x3c9e69=a29_0x3a2ccf,_0x24dfad=_0xe17f98[_0x3c9e69(0x1b7)][0x0];if(!_0x24dfad)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a29_0x3a2ccf(0x1d1)](_0x451722){const _0x6c7dbb=a29_0x3a2ccf,{options:_0x30f8e5,args:_0x32ad4a,tdx:_0x1f9364}=_0x451722,_0x13dd75=_0x32ad4a[0x0],_0x5f1935=await withSpinner(_0x6c7dbb(0x1d7),()=>_0x1f9364['jobs'][_0x6c7dbb(0x1de)](_0x13dd75),{'verbose':_0x30f8e5['verbose']}),_0x5991f8=_0x5f1935[_0x6c7dbb(0x1ab)];return console[_0x6c7dbb(0x1ed)](_0x6c7dbb(0x1c2)+_0x5991f8['length']+_0x6c7dbb(0x1d4)+(_0x5991f8['length']!==0x1?'s':'')),await handleSDKOutput(_0x5991f8,_0x30f8e5),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x2b4b4d=a27_0x4fc8;(function(_0x1d54a1,_0x134492){const _0x3df3ca=a27_0x4fc8,_0x50ea0c=_0x1d54a1();while(!![]){try{const _0xa4d9c2=-parseInt(_0x3df3ca(0x247))/0x1*(parseInt(_0x3df3ca(0x15d))/0x2)+-parseInt(_0x3df3ca(0x242))/0x3*(-parseInt(_0x3df3ca(0x16a))/0x4)+parseInt(_0x3df3ca(0x250))/0x5*(parseInt(_0x3df3ca(0x230))/0x6)+parseInt(_0x3df3ca(0x1ed))/0x7+parseInt(_0x3df3ca(0x232))/0x8*(-parseInt(_0x3df3ca(0x139))/0x9)+parseInt(_0x3df3ca(0x19f))/0xa*(parseInt(_0x3df3ca(0x237))/0xb)+parseInt(_0x3df3ca(0x254))/0xc;if(_0xa4d9c2===_0x134492)break;else _0x50ea0c['push'](_0x50ea0c['shift']());}catch(_0x4ff085){_0x50ea0c['push'](_0x50ea0c['shift']());}}}(a27_0x2662,0x5ad20));import a27_0x42f4e5 from'chalk';import a27_0x169f08 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 a27_0x2662(){const _0x5b0188=['folderId','message','connection','journeys','\x27\x20not\x20found\x20in\x20','journey:traffic','paused','sort','Getting\x20journey\x20statistics...','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x0aError:','then','versionNumber','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','rule','Journey:','Resuming\x20journey...','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','\x22\x20not\x20found','repeat','has','segment','executeDryRun','\x20new\x20files','\x22\x20resumed','\x20not\x20found.\x20Available:\x20','26TsEAXK','Resolving\x20journey...','activation','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','runAt','length','base','No\x20statistics\x20available\x20for\x20journey:\x20','localeCompare','Warning:\x20Could\x20not\x20resolve\x20activation\x20','INVALID_ARGUMENT','getLatestJourneyId','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','544xgeowc','Show\x20journey\x20table\x20column\x20mapping','\x20unchanged\x20files','\x20\x20←\x20','Paused:','includeStats',',\x20version:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','map','(completed)','filePath','relativePath','Error:\x20--version\x20option\x20is\x20required','options','getJourney','Resolving\x20parent\x20segment...','red','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20changed\x20files','Folder\x20path:\x20','targetDir','resolveSegment','log','Input:\x20','journey:pause','Aborted.','no\x20connection','scheduleType','yellow','exitOrJumpRate','\x20\x20Statistics\x20not\x20available','hasPeriod','type','Fetching\x20journey\x20','\x20version','folderPath','Stages:','completionRate','Getting\x20version\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','journeyStages','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','reentryMode','stage','dim','archived','ID:','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journeyId','Fetching\x20','dryRun','run','Error:\x20Journey\x20\x27','110PuLPyL','(unnamed)','journey:version:view','attributes','✔\x20Pulled\x20','Found\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x20files?','Trigger\x20on-demand\x20journey\x20workflow\x20execution','segmentPushCommand','listJourneysFromParentSegment','errorCode','file','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20(rule\x20match)','values','Pattern:\x20','\x20->\x20','from','connectionId','none',',\x20schedule:\x20','tsv','json','pausedAt','/e/','bold','goal','\x22\x20paused','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','limit','getParentFull','\x20\x20Journey\x20ID:\x20','columns','journeyBundleId','verbose','tdx.json','get','activation_','journey:resume','stages','no_parent','filter','rootFolderId','listVersions','site','getStatistics','push','data','args','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','cwd','\x20@\x20','parent_segment','journey:version:create','all','Triggering\x20journey\x20workflow...','getSegment','\x0aPull\x20summary:','buildIdToEmailMap','links','goalSize','root\x20folder','\x20activation','\x20Opening\x20','workflowSessionId','exitOrJumpSize','journey:pull','split','name','description','absolutePath','listFolders','resolveParentId','blue','nodes','version','completed','1724121MkiURl','(archived)','Status:','jsonl','audienceId','\x20(ID:\x20','\x5c$&','\x20\x20Folder\x20path:\x20','Error:\x20Version\x20','createVersion','error','state','activationParams','Cancelled','\x20details...','hasChanges','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Parent\x20segment\x20ID:','createdAt','Fetching\x20users\x20and\x20connections...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','toLowerCase','\x20\x20Name:\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','buildIdToNameMap','/j/da','green','...','Error:\x20Invalid\x20version\x20number:\x20','session','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getColumnMapping','journey:view','set','entries','\x20\x20Parent\x20segment:\x20','helpText','renderStats','\x20[runs\x20on\x20refresh]','runAfterJourneyRefresh','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)','segmentName','status','Error:\x20Parent\x20segment\x20context\x20required','join','updatedAt','table','enteredSize','/j/da/je','format','yes','journeyName','State:','✔\x20All\x20files\x20are\x20up\x20to\x20date','⚠️\x20','\x20Journey\x20workflow\x20started','Target\x20file:\x20','milestoneSize','conversion','launched','content','workflowId','journeyBundleName','parentSegment','📁\x20','size','137322tmXeKx','\x20journeys','306184BbjTcI','✔\x20Context\x20set:\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/app/ps/','211365fNFOjY','kind','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resume','Parent\x20segment:\x20','database','Pausing\x20journey...','Activations:','setPhase','history','Show\x20journey\x20statistics','4497SBZxfi','getActivation','✔\x20Journey\x20\x22','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20versions)','42269WxAAxs','Target\x20directory:\x20','List\x20journeys\x20in\x20current\x20context','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','add','\x20journey','Error:\x20Journey\x20not\x20found:\x20','test','journey','80qIasPX','Resume\x20a\x20paused\x20journey','getTrafficData','includeHistory','103104lKdbUv','isNew','Database:\x20','resourceName','listActivationsFlat','segments','(root)','\x20=\x20','diff','\x20(draft)\x20—\x20\x22','\x20\x20-\x20','Listing\x20journeys...','Session:','\x20Created\x20v','List\x20activations\x20for\x20a\x20journey','execute','Paused\x20at:','utf-8','cyan','journey:versions','27DBgOxw','folders','find','✔\x20Found\x20','Fetching\x20parent\x20segment...','Listing\x20journey\x20versions...','\x20\x20Consolidating\x20duplicate\x20segment:\x20','journey:stats','journey:columns'];a27_0x2662=function(){return _0x5b0188;};return a27_0x2662();}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';function a27_0x4fc8(_0x3a5a6c,_0x2b3686){_0x3a5a6c=_0x3a5a6c-0x128;const _0x26628c=a27_0x2662();let _0x4fc835=_0x26628c[_0x3a5a6c];return _0x4fc835;}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,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1f63fe){const _0x573fb9=a27_0x4fc8;return!_0x1f63fe&&(console[_0x573fb9(0x1f7)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x573fb9(0x1f7)](_0x573fb9(0x17b))),!!_0x1f63fe;}function withJsonFormat(_0x23aefb){const _0x309fc2=a27_0x4fc8;if(!_0x23aefb[_0x309fc2(0x21f)]&&!_0x23aefb[_0x309fc2(0x1b6)]&&!_0x23aefb[_0x309fc2(0x1f0)]&&!_0x23aefb[_0x309fc2(0x1b5)])return{..._0x23aefb,'format':_0x309fc2(0x1b6),'json':!![]};return _0x23aefb;}function formatJourneyState(_0x4f2fd1){const _0x1a4e09=a27_0x4fc8;switch(_0x4f2fd1){case _0x1a4e09(0x229):return a27_0x42f4e5[_0x1a4e09(0x207)]('(running)');case'draft':return a27_0x42f4e5[_0x1a4e09(0x196)]('(draft)');case _0x1a4e09(0x148):return a27_0x42f4e5['yellow']('(paused)');case _0x1a4e09(0x1ec):return a27_0x42f4e5[_0x1a4e09(0x1e9)](_0x1a4e09(0x173));case _0x1a4e09(0x197):return a27_0x42f4e5['dim'](_0x1a4e09(0x1ee));default:return'('+_0x4f2fd1+')';}}function formatJourneyItem(_0x1ce68a,_0x121e1f='',_0x74cb7b){const _0x87d7aa=a27_0x4fc8,_0x3fa16d=formatJourneyState(_0x1ce68a['state']),_0x3c6a24=_0x74cb7b?hyperlink(_0x1ce68a[_0x87d7aa(0x22c)],_0x74cb7b):_0x1ce68a[_0x87d7aa(0x22c)];return _0x121e1f+'🗺️\x20'+_0x3c6a24+'\x20'+_0x3fa16d;}function escapeRegex(_0x1f2599){const _0x39f636=a27_0x4fc8;return _0x1f2599['replace'](/[.*+?^${}()|[\]\\]/g,_0x39f636(0x1f3));}function globToRegex(_0x4748b2){const _0x52f4c8=a27_0x4fc8,_0x31cd35=_0x4748b2[_0x52f4c8(0x1e3)]('*')[_0x52f4c8(0x172)](escapeRegex);return new RegExp(_0x31cd35[_0x52f4c8(0x21a)]('.*'),'i');}function buildRuleToNameMapping(_0x39c406){const _0x2ad390=a27_0x4fc8,_0x1ddaa5=new Map();if(_0x39c406[_0x2ad390(0x12a)])for(const [_0x59b4d2,_0x5932d7]of Object[_0x2ad390(0x210)](_0x39c406[_0x2ad390(0x12a)])){if(_0x5932d7[_0x2ad390(0x151)]){const _0x409186=serializeRule(_0x5932d7[_0x2ad390(0x151)]),_0x27ddc8=_0x1ddaa5['get'](_0x409186);_0x27ddc8?_0x27ddc8[_0x2ad390(0x1ce)](_0x59b4d2):_0x1ddaa5[_0x2ad390(0x20f)](_0x409186,[_0x59b4d2]);}}return _0x1ddaa5;}async function resolveJourneyIdFromInput(_0x458fa0,_0x2bccf7,_0x26a037){const _0x45c447=a27_0x4fc8,_0x3885b8=await resolveJourneyTarget(_0x458fa0,_0x2bccf7['parentSegment'],_0x2bccf7[_0x45c447(0x1c2)]),_0x1e8f2d=_0x3885b8['parentSegment'];if(!_0x1e8f2d)throw new SDKError(ErrorCode[_0x45c447(0x167)],_0x45c447(0x24a));const _0xf15ba4=await withSpinner(_0x45c447(0x179),()=>_0x26a037['segment'][_0x45c447(0x1e8)](_0x1e8f2d),{'verbose':_0x2bccf7[_0x45c447(0x1c2)]}),_0x3a6a7f=_0xf15ba4[_0x45c447(0x1cf)],_0xba1ca2=await withSpinner(_0x45c447(0x15e),()=>_0x26a037[_0x45c447(0x24f)]['resolveJourneyId'](_0x3a6a7f,_0x3885b8[_0x45c447(0x221)]),{'verbose':_0x2bccf7[_0x45c447(0x1c2)]});return{'journeyId':_0xba1ca2['data'],'journeyName':_0x3885b8[_0x45c447(0x221)],'parentSegmentId':_0x3a6a7f};}async function resolveJourneyTarget(_0x482423,_0x157aa9,_0x213218){const _0x427abc=a27_0x4fc8;if(isYamlFilePath(_0x482423))try{const _0x5d95f4=await resolveYamlFilePath(_0x482423);return _0x213218&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x482423),console['error'](_0x427abc(0x211)+_0x5d95f4[_0x427abc(0x22d)]),console[_0x427abc(0x1f7)](_0x427abc(0x203)+_0x5d95f4[_0x427abc(0x217)]),console[_0x427abc(0x1f7)](_0x427abc(0x1f4)+(_0x5d95f4['folderPath']||_0x427abc(0x12b)))),{'journeyName':_0x5d95f4[_0x427abc(0x217)],'parentSegment':_0x5d95f4[_0x427abc(0x22d)],'resolved':_0x5d95f4};}catch(_0x48060d){throw new SDKError(ErrorCode[_0x427abc(0x167)],_0x427abc(0x201)+_0x48060d[_0x427abc(0x143)]);}if(!_0x157aa9)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x482423,'parentSegment':_0x157aa9};}export class JourneyListCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]='journey:list';['description']=a27_0x2b4b4d(0x249);async[a27_0x2b4b4d(0x134)](_0x25899f){const _0x32364f=a27_0x2b4b4d,{options:_0x45bd1d,args:_0x1da153,tdx:_0x18b9a3}=_0x25899f,_0x3d2c85=_0x1da153[0x0],_0x3b7819=_0x45bd1d[_0x32364f(0x22d)];if(!_0x3b7819)return console[_0x32364f(0x1f7)](_0x32364f(0x219)),console[_0x32364f(0x1f7)](_0x32364f(0x191)),0x1;const _0x3991e6=await withSpinner(_0x32364f(0x179),()=>_0x18b9a3[_0x32364f(0x158)][_0x32364f(0x1e8)](_0x3b7819),{'verbose':_0x45bd1d[_0x32364f(0x1c2)]}),_0x35d8e8=_0x3991e6[_0x32364f(0x1cf)];_0x45bd1d['verbose']&&(console['error'](_0x32364f(0x23b)+_0x3b7819+_0x32364f(0x1f2)+_0x35d8e8+')'),_0x3d2c85&&console[_0x32364f(0x1f7)](_0x32364f(0x1af)+_0x3d2c85));const _0x188e90=await withSpinner(_0x32364f(0x13d),()=>_0x18b9a3[_0x32364f(0x158)][_0x32364f(0x1be)](_0x35d8e8),{'verbose':_0x45bd1d[_0x32364f(0x1c2)]}),_0x32503b=_0x188e90[_0x32364f(0x1cf)],_0x434928=_0x32503b[_0x32364f(0x1ca)],_0x1b993e=await withSpinner(_0x32364f(0x130),()=>_0x18b9a3['journey']['listJourneysWithFolders'](_0x35d8e8,_0x434928),{'verbose':_0x45bd1d[_0x32364f(0x1c2)]});let _0x13ea2e=_0x1b993e['data'][_0x32364f(0x145)];const _0xdde44f=_0x1b993e[_0x32364f(0x1cf)][_0x32364f(0x13a)],_0x5ecfd4=new Map();for(const _0x4f5ff9 of _0xdde44f){_0x5ecfd4[_0x32364f(0x20f)](_0x4f5ff9['id'],_0x4f5ff9['name']);}if(_0x3d2c85){const _0x5761fd=globToRegex(_0x3d2c85);_0x13ea2e=_0x13ea2e[_0x32364f(0x1c9)](_0x246f69=>_0x5761fd[_0x32364f(0x24e)](_0x246f69['journeyBundleName']));}console[_0x32364f(0x1f7)](_0x32364f(0x13c)+_0x13ea2e[_0x32364f(0x162)]+_0x32364f(0x24c)+(_0x13ea2e[_0x32364f(0x162)]!==0x1?'s':''));const _0x3e6a44=_0x16f1f9=>{const _0x1fb60a=_0x32364f;return getConsoleNextUrl(_0x45bd1d[_0x1fb60a(0x1cc)],_0x1fb60a(0x236)+_0x35d8e8+_0x1fb60a(0x1b8)+_0x16f1f9+_0x1fb60a(0x206));};if(_0x45bd1d[_0x32364f(0x21f)]===_0x32364f(0x21c))await handleSDKOutput(_0x13ea2e,_0x45bd1d);else{if(_0x45bd1d['format']==='json'){const _0x487c51=_0x13ea2e[_0x32364f(0x172)](_0x3188cd=>({..._0x3188cd,'url':_0x3e6a44(_0x3188cd['id'])}));await handleSDKOutput(_0x487c51,_0x45bd1d);}else{console['log']('['+_0x3b7819+']');const _0x2c261f=new Map(),_0x42059f=[];for(const _0x53ca75 of _0x13ea2e){if(!_0x53ca75[_0x32364f(0x142)]||_0x53ca75[_0x32364f(0x142)]===_0x434928)_0x42059f['push'](_0x53ca75);else{const _0x3b53cf=_0x2c261f[_0x32364f(0x1c4)](_0x53ca75[_0x32364f(0x142)])||[];_0x3b53cf[_0x32364f(0x1ce)](_0x53ca75),_0x2c261f[_0x32364f(0x20f)](_0x53ca75['folderId'],_0x3b53cf);}}const _0x2af788=(_0x1372e7,_0x580b6a)=>_0x1372e7['journeyBundleName'][_0x32364f(0x165)](_0x580b6a[_0x32364f(0x22c)],undefined,{'sensitivity':_0x32364f(0x163)});_0x42059f[_0x32364f(0x149)](_0x2af788);for(const _0x2fd32f of _0x42059f){console[_0x32364f(0x180)](formatJourneyItem(_0x2fd32f,'',_0x3e6a44(_0x2fd32f['id'])));}const _0x30408c=[..._0x2c261f[_0x32364f(0x210)]()][_0x32364f(0x149)]((_0x39ff82,_0x2eadda)=>{const _0x2da63b=_0x32364f,_0x14720f=_0x5ecfd4['get'](_0x39ff82[0x0])||_0x39ff82[0x0],_0x2068e7=_0x5ecfd4[_0x2da63b(0x1c4)](_0x2eadda[0x0])||_0x2eadda[0x0];return _0x14720f['localeCompare'](_0x2068e7,undefined,{'sensitivity':_0x2da63b(0x163)});});for(const [_0x3d271e,_0x3ef41e]of _0x30408c){const _0x31555e=_0x5ecfd4['get'](_0x3d271e)||_0x3d271e;console['log'](_0x32364f(0x22e)+_0x31555e),_0x3ef41e[_0x32364f(0x149)](_0x2af788);for(const _0x498ee1 of _0x3ef41e){console[_0x32364f(0x180)](formatJourneyItem(_0x498ee1,'\x20\x20',_0x3e6a44(_0x498ee1['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a27_0x2b4b4d(0x20e);['description']='Show\x20journey\x20details';async[a27_0x2b4b4d(0x134)](_0x3869cc){const _0x3ea0e9=a27_0x2b4b4d,{options:_0x4eb578,args:_0x1a036d,tdx:_0x25da08}=_0x3869cc,_0x2cc0c1=_0x1a036d[0x0];if(!_0x2cc0c1)return console[_0x3ea0e9(0x1f7)](_0x3ea0e9(0x1fd)),console[_0x3ea0e9(0x1f7)](_0x3ea0e9(0x204)),console[_0x3ea0e9(0x1f7)]('Options:'),console[_0x3ea0e9(0x1f7)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x4eb578[_0x3ea0e9(0x1c2)]&&console[_0x3ea0e9(0x1f7)](_0x3ea0e9(0x181)+_0x2cc0c1);const {journeyId:_0x45857d,parentSegmentId:_0xae1b0f}=await resolveJourneyIdFromInput(_0x2cc0c1,_0x4eb578,_0x25da08);if(_0x4eb578['web']){const _0x184f97=getConsoleNextUrl(_0x4eb578[_0x3ea0e9(0x1cc)],_0x3ea0e9(0x236)+_0xae1b0f+_0x3ea0e9(0x1b8)+_0x45857d+_0x3ea0e9(0x21e));return console[_0x3ea0e9(0x1f7)](a27_0x42f4e5[_0x3ea0e9(0x207)]('✔')+_0x3ea0e9(0x1df)+a27_0x42f4e5[_0x3ea0e9(0x137)](_0x184f97)),openBrowser(_0x184f97),0x0;}const _0x47c156=await withSpinner('Getting\x20journey\x20details...',()=>_0x25da08[_0x3ea0e9(0x24f)][_0x3ea0e9(0x178)](_0x45857d),{'verbose':_0x4eb578['verbose']}),_0x3e10c3=_0x47c156['data'],_0xe4cadc=_0x4eb578[_0x3ea0e9(0x16f)];let _0x667c28;if(_0xe4cadc)try{const _0x458e85=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x25da08[_0x3ea0e9(0x24f)][_0x3ea0e9(0x1cd)](_0x45857d),{'verbose':_0x4eb578[_0x3ea0e9(0x1c2)]});_0x667c28=_0x458e85[_0x3ea0e9(0x1cf)];}catch{_0x4eb578['verbose']&&console[_0x3ea0e9(0x1f7)](_0x3ea0e9(0x188));}const _0x261da0=getConsoleNextUrl(_0x4eb578['site'],'/app/ps/'+_0xae1b0f+'/e/'+_0x45857d+_0x3ea0e9(0x21e)),_0x4d46df={'id':_0x3e10c3['id'],'name':_0x3e10c3[_0x3ea0e9(0x1a2)][_0x3ea0e9(0x1e4)],'description':_0x3e10c3[_0x3ea0e9(0x1a2)][_0x3ea0e9(0x1e5)],'state':_0x3e10c3['attributes']['state'],'paused':_0x3e10c3['attributes'][_0x3ea0e9(0x148)],'reentry_mode':_0x3e10c3[_0x3ea0e9(0x1a2)][_0x3ea0e9(0x194)],'stages':_0x3e10c3[_0x3ea0e9(0x1a2)][_0x3ea0e9(0x192)]?.[_0x3ea0e9(0x162)]||0x0,..._0x3e10c3[_0x3ea0e9(0x1a2)][_0x3ea0e9(0x1ba)]&&{'goal':_0x3e10c3[_0x3ea0e9(0x1a2)][_0x3ea0e9(0x1ba)][_0x3ea0e9(0x1e4)]},..._0x667c28&&{'statistics':{'size':_0x667c28['size'],'entered':_0x667c28[_0x3ea0e9(0x21d)],'goal_achieved':_0x667c28[_0x3ea0e9(0x1dc)],'completion_rate':_0x667c28[_0x3ea0e9(0x18f)],'exit_or_jump':_0x667c28['exitOrJumpSize'],'exit_or_jump_rate':_0x667c28[_0x3ea0e9(0x187)],'stages':_0x667c28[_0x3ea0e9(0x1c7)]}},'url':_0x261da0};return await handleSingleObjectOutput(_0x4d46df,_0x4eb578),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]=a27_0x2b4b4d(0x140);[a27_0x2b4b4d(0x1e5)]=a27_0x2b4b4d(0x241);async[a27_0x2b4b4d(0x134)](_0x28baef){const _0x59fb2d=a27_0x2b4b4d,{options:_0x32fd84,args:_0x4baff8,tdx:_0x53a399}=_0x28baef,_0x4c3c3c=_0x4baff8[0x0];if(!requireNameOrPath(_0x4c3c3c))return 0x1;_0x32fd84[_0x59fb2d(0x1c2)]&&console[_0x59fb2d(0x1f7)]('Input:\x20'+_0x4c3c3c);const _0xa4ac7=_0x32fd84,_0xfc59cb=_0xa4ac7[_0x59fb2d(0x1b1)],_0x3d3098=_0xa4ac7['to'],_0x4c9f04=_0xa4ac7[_0x59fb2d(0x253)],_0x2d72e3=_0xa4ac7[_0x59fb2d(0x195)];_0x4c9f04&&!_0xfc59cb&&!_0x3d3098&&console['error']('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x30cf46=_0x4c9f04?withJsonFormat(_0x32fd84):_0x32fd84,{journeyId:_0x118baa,journeyName:_0x3ef2f0}=await resolveJourneyIdFromInput(_0x4c3c3c,_0x30cf46,_0x53a399),_0x1d61d6=_0xfc59cb||_0x3d3098?{'from':_0xfc59cb,'to':_0x3d3098}:undefined,_0x1e9e8c=await withSpinner(_0x59fb2d(0x14a),()=>Promise['all']([_0x53a399[_0x59fb2d(0x24f)][_0x59fb2d(0x178)](_0x118baa),_0x53a399[_0x59fb2d(0x24f)]['getStatistics'](_0x118baa,_0x1d61d6)]),{'verbose':_0x30cf46['verbose']}),[_0x5604a5,_0x55b266]=_0x1e9e8c['data'];if(!_0x55b266||_0x55b266[_0x59fb2d(0x19a)]===null)return console[_0x59fb2d(0x1f7)](_0x59fb2d(0x164)+_0x3ef2f0),console[_0x59fb2d(0x1f7)](_0x59fb2d(0x160)),0x0;const _0x22228b=buildStageNameMap(_0x5604a5),_0x434c1b=!!(_0x1d61d6&&_0x55b266[_0x59fb2d(0x240)]?.['length']),_0xd37929={'stageNameMap':_0x22228b,'hasPeriod':_0x434c1b,'includeHistory':!!_0x4c9f04};if(_0x2d72e3&&_0x55b266[_0x59fb2d(0x1c7)]){const _0x291a41=_0x55b266[_0x59fb2d(0x1c7)][_0x59fb2d(0x13b)](_0x59de0f=>{const _0x202e13=_0x59fb2d,_0x3c60d6=_0x22228b[_0x202e13(0x1c4)](_0x59de0f['id'])??'';return _0x3c60d6[_0x202e13(0x202)]()===_0x2d72e3[_0x202e13(0x202)]();});if(_0x291a41)return await handleSingleObjectOutput(formatStageStats(_0x291a41,_0xd37929),_0x30cf46),0x0;const _0x4352ec=_0x55b266[_0x59fb2d(0x1c7)][_0x59fb2d(0x172)](_0x598218=>_0x22228b[_0x59fb2d(0x1c4)](_0x598218['id'])??_0x598218['id']);return console[_0x59fb2d(0x1f7)]('Error:\x20Stage\x20\x22'+_0x2d72e3+_0x59fb2d(0x155)),console[_0x59fb2d(0x1f7)]('Available\x20stages:\x20'+_0x4352ec['join'](',\x20')),0x1;}const _0x1f8203=_0x55b266[_0x59fb2d(0x1c7)]?.['map'](_0x6c0cbb=>formatStageStats(_0x6c0cbb,_0xd37929)),_0x1bbd31=assembleJourneyStats(_0x55b266,{'from':_0xfc59cb,'to':_0x3d3098,'includeHistory':_0x4c9f04});return await this[_0x59fb2d(0x213)](_0x1bbd31,_0x1f8203??[],_0x30cf46),0x0;}async[a27_0x2b4b4d(0x213)](_0x3f2e96,_0x5322a0,_0x3cda61){const _0x20f353=a27_0x2b4b4d,_0x2c1329=_0x3cda61[_0x20f353(0x21f)]===_0x20f353(0x1b6)||_0x3cda61[_0x20f353(0x21f)]===_0x20f353(0x1f0)||_0x3cda61[_0x20f353(0x1b6)]||_0x3cda61[_0x20f353(0x1f0)];if(_0x2c1329){_0x3f2e96['stages']=_0x5322a0,await handleSingleObjectOutput(_0x3f2e96,_0x3cda61);return;}await handleSingleObjectOutput(_0x3f2e96,_0x3cda61);for(const _0x1cb452 of _0x5322a0){console[_0x20f353(0x180)](''),console[_0x20f353(0x180)](String(a27_0x42f4e5[_0x20f353(0x137)][_0x20f353(0x1b9)]('['+_0x1cb452[_0x20f353(0x1e4)]+']'))+a27_0x42f4e5[_0x20f353(0x196)]('\x20'+_0x1cb452['id']));const {id:_0x26346f,name:_0x3e8abe,..._0x1ca5ba}=_0x1cb452;await handleSingleObjectOutput(_0x1ca5ba,_0x3cda61);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]=a27_0x2b4b4d(0x147);[a27_0x2b4b4d(0x1e5)]=a27_0x2b4b4d(0x169);async['execute'](_0x569983){const _0x45c1fc=a27_0x2b4b4d,{options:_0x40e930,args:_0x49fb6d,tdx:_0x3ae334}=_0x569983,_0x5ed712=_0x49fb6d[0x0];if(!requireNameOrPath(_0x5ed712))return 0x1;_0x40e930[_0x45c1fc(0x1c2)]&&console[_0x45c1fc(0x1f7)](_0x45c1fc(0x181)+_0x5ed712);const _0x2643b1=_0x40e930,_0x213d15=_0x2643b1[_0x45c1fc(0x18a)],_0x2fed8c=_0x2643b1['from'],_0x358f43=_0x2643b1['to'],_0x35f105=_0x2643b1[_0x45c1fc(0x1bd)];if(_0x213d15&&_0x213d15!==_0x45c1fc(0x228)&&_0x213d15!=='activation')return console[_0x45c1fc(0x1f7)]('Error:\x20Invalid\x20--type\x20\x22'+_0x213d15+_0x45c1fc(0x199)),0x1;const _0x53f1b6=withJsonFormat(_0x40e930),{journeyId:_0x31d653,journeyName:_0xbe8e23}=await resolveJourneyIdFromInput(_0x5ed712,_0x53f1b6,_0x3ae334),_0x5bebff={'type':_0x213d15,'from':_0x2fed8c,'to':_0x358f43,'limit':_0x35f105},_0x33f28e=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x3ae334[_0x45c1fc(0x24f)][_0x45c1fc(0x252)](_0x31d653,_0x5bebff),{'verbose':_0x53f1b6[_0x45c1fc(0x1c2)]}),_0x5c08d5=_0x33f28e[_0x45c1fc(0x1cf)],_0x3f3d2c=_0x5c08d5[_0x45c1fc(0x228)]&&(_0x5c08d5['conversion'][_0x45c1fc(0x1ea)][_0x45c1fc(0x162)]>0x0||_0x5c08d5[_0x45c1fc(0x228)][_0x45c1fc(0x1db)][_0x45c1fc(0x162)]>0x0),_0x29c0e0=_0x5c08d5['activation']&&_0x5c08d5[_0x45c1fc(0x15f)]['length']>0x0;if(!_0x3f3d2c&&!_0x29c0e0)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0xbe8e23),console['error'](_0x45c1fc(0x14f)),_0x2fed8c&&_0x358f43&&console['error']('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x5c08d5,_0x53f1b6),0x0;}}function formatStageStats(_0x3c476a,_0x31be3c){const _0x57a612=a27_0x2b4b4d,_0x9c8eea=_0x31be3c[_0x57a612(0x189)]&&_0x3c476a[_0x57a612(0x240)]?.[_0x57a612(0x162)]?aggregateStageHistory(_0x3c476a[_0x57a612(0x240)]):{'size':_0x3c476a[_0x57a612(0x22f)],'entered':_0x3c476a[_0x57a612(0x21d)],'milestone':_0x3c476a[_0x57a612(0x227)],'milestone_rate':_0x3c476a['completeMilestoneRate'],'exit_or_jump':_0x3c476a[_0x57a612(0x1e1)],'exit_or_jump_rate':_0x3c476a[_0x57a612(0x187)]},_0x6ba385={'id':_0x3c476a['id'],'name':_0x31be3c['stageNameMap']['get'](_0x3c476a['id'])??_0x3c476a['id'],..._0x9c8eea};return _0x31be3c[_0x57a612(0x189)]&&_0x31be3c[_0x57a612(0x253)]&&_0x3c476a[_0x57a612(0x240)]&&(_0x6ba385[_0x57a612(0x240)]=_0x3c476a['history']),_0x6ba385;}export class JourneyPauseCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]=a27_0x2b4b4d(0x182);[a27_0x2b4b4d(0x1e5)]='Pause\x20a\x20running\x20journey';async[a27_0x2b4b4d(0x134)](_0x47521a){const _0x13c3ce=a27_0x2b4b4d,{options:_0x5b12a7,args:_0x1ee14e,tdx:_0x34f064}=_0x47521a,_0x69a09b=_0x1ee14e[0x0];if(!requireNameOrPath(_0x69a09b))return 0x1;_0x5b12a7[_0x13c3ce(0x1c2)]&&console[_0x13c3ce(0x1f7)](_0x13c3ce(0x181)+_0x69a09b);const {journeyId:_0x4a44c0,journeyName:_0x50dcc5}=await resolveJourneyIdFromInput(_0x69a09b,_0x5b12a7,_0x34f064);if(!_0x5b12a7[_0x13c3ce(0x220)]){const _0xf62124=await confirm(_0x13c3ce(0x171)+_0x50dcc5+'\x22?');if(!_0xf62124)return console[_0x13c3ce(0x1f7)](_0x13c3ce(0x1fa)),0x0;}const _0x1b0e08=await withSpinner(_0x13c3ce(0x23d),()=>_0x34f064[_0x13c3ce(0x24f)]['pause'](_0x4a44c0),{'verbose':_0x5b12a7[_0x13c3ce(0x1c2)]}),_0x1b9ced=_0x1b0e08[_0x13c3ce(0x1cf)];return console[_0x13c3ce(0x1f7)](_0x13c3ce(0x244)+_0x1b9ced[_0x13c3ce(0x1a2)][_0x13c3ce(0x1e4)]+_0x13c3ce(0x1bb)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]='journey:run';['description']=a27_0x2b4b4d(0x1a7);async['execute'](_0x38b1d1){const _0x4a8ba1=a27_0x2b4b4d,{options:_0x4410bc,args:_0x43a4b9,tdx:_0x572450}=_0x38b1d1,_0x594ac4=_0x43a4b9[0x0];if(!requireNameOrPath(_0x594ac4))return 0x1;_0x4410bc['verbose']&&console[_0x4a8ba1(0x1f7)](_0x4a8ba1(0x181)+_0x594ac4);const {journeyId:_0x4d417d,journeyName:_0x20a342}=await resolveJourneyIdFromInput(_0x594ac4,_0x4410bc,_0x572450);if(_0x4410bc[_0x4a8ba1(0x19c)])return await this[_0x4a8ba1(0x159)](_0x38b1d1,_0x4d417d,_0x20a342);if(!_0x4410bc[_0x4a8ba1(0x220)]){const _0x282bc7=await confirm(_0x4a8ba1(0x154)+_0x20a342+'\x22?');if(!_0x282bc7)return console[_0x4a8ba1(0x1f7)](_0x4a8ba1(0x1fa)),0x0;}const _0x696199=await withSpinner(_0x4a8ba1(0x1d7),()=>_0x572450[_0x4a8ba1(0x24f)][_0x4a8ba1(0x19d)](_0x4d417d),{'verbose':_0x4410bc[_0x4a8ba1(0x1c2)]}),_0x2e0dd9=_0x696199['data'],_0x2bc3f2=getWorkflowSessionUrl(_0x4410bc[_0x4a8ba1(0x1cc)],_0x2e0dd9[_0x4a8ba1(0x22b)],_0x2e0dd9[_0x4a8ba1(0x1e0)]);return console[_0x4a8ba1(0x1f7)]('\x0a'+a27_0x42f4e5['green']('✔')+_0x4a8ba1(0x225)),console[_0x4a8ba1(0x1f7)]('\x20\x20'+a27_0x42f4e5[_0x4a8ba1(0x196)](_0x4a8ba1(0x152))+'\x20'+_0x20a342),console[_0x4a8ba1(0x1f7)]('\x20\x20'+a27_0x42f4e5[_0x4a8ba1(0x196)](_0x4a8ba1(0x1ef))+'\x20'+_0x2e0dd9[_0x4a8ba1(0x218)]),console[_0x4a8ba1(0x1f7)]('\x20\x20'+a27_0x42f4e5[_0x4a8ba1(0x196)](_0x4a8ba1(0x131))+'\x20'+_0x2e0dd9['workflowSessionId']),console[_0x4a8ba1(0x1f7)]('\x20\x20'+_0x2bc3f2),0x0;}async[a27_0x2b4b4d(0x159)](_0x4e1844,_0x5dd390,_0x5af690){const _0x4637af=a27_0x2b4b4d,{options:_0x192fe3,tdx:_0xd1bdd6}=_0x4e1844,_0x190027=await withSpinner(_0x4637af(0x18b)+_0x5af690+_0x4637af(0x208),()=>Promise[_0x4637af(0x1d6)]([_0xd1bdd6[_0x4637af(0x24f)][_0x4637af(0x178)](_0x5dd390),_0xd1bdd6[_0x4637af(0x24f)]['listActivationsFlat'](_0x5dd390)]),{'verbose':_0x192fe3[_0x4637af(0x1c2)]}),[_0xd61c90,_0x2227dd]=_0x190027[_0x4637af(0x1cf)],_0x5cd8af=_0xd61c90[_0x4637af(0x1a2)],_0x5d3c77=_0x5cd8af['journeyStages'];console[_0x4637af(0x180)](a27_0x42f4e5[_0x4637af(0x1b9)]('Journey:'),_0x5cd8af[_0x4637af(0x1e4)]),console[_0x4637af(0x180)](a27_0x42f4e5['bold'](_0x4637af(0x198)),_0xd61c90['id']),console[_0x4637af(0x180)](a27_0x42f4e5[_0x4637af(0x1b9)](_0x4637af(0x222)),_0x5cd8af['state']),console[_0x4637af(0x180)](a27_0x42f4e5[_0x4637af(0x1b9)](_0x4637af(0x16e)),_0x5cd8af[_0x4637af(0x148)]?a27_0x42f4e5['yellow'](_0x4637af(0x220)):a27_0x42f4e5[_0x4637af(0x207)]('no')),console['log'](a27_0x42f4e5[_0x4637af(0x1b9)](_0x4637af(0x1fe)),_0x5cd8af[_0x4637af(0x1f1)]);const _0x310835=_0x5d3c77[_0x4637af(0x162)]>0x0?'\x20('+_0x5d3c77['map'](_0x4d9ccb=>_0x4d9ccb[_0x4637af(0x1e4)])['join'](',\x20')+')':'';console[_0x4637af(0x180)](a27_0x42f4e5[_0x4637af(0x1b9)](_0x4637af(0x18e)),''+_0x5d3c77['length']+_0x310835),console['log']('');if(_0x2227dd[_0x4637af(0x162)]===0x0)console[_0x4637af(0x180)](a27_0x42f4e5[_0x4637af(0x1b9)](_0x4637af(0x23e)),a27_0x42f4e5['dim']('(none)'));else{console[_0x4637af(0x180)](a27_0x42f4e5[_0x4637af(0x1b9)]('Activations:'));for(const _0x3edf3f of _0x2227dd){const _0x4ccbf2=_0x3edf3f[_0x4637af(0x1e4)]??'(unnamed)',_0x1d3393=_0x3edf3f[_0x4637af(0x1b2)]!=null?'connection\x20'+_0x3edf3f[_0x4637af(0x1b2)]:_0x4637af(0x184),_0x654104=_0x3edf3f[_0x4637af(0x185)]?''+_0x3edf3f[_0x4637af(0x185)]+(_0x3edf3f['runAt']?'\x20@\x20'+_0x3edf3f['runAt']:''):'none',_0x518796=_0x3edf3f[_0x4637af(0x215)]?_0x4637af(0x214):'';console['log']('\x20\x20'+a27_0x42f4e5[_0x4637af(0x186)](_0x4637af(0x224))+'\x20'+_0x4ccbf2+_0x4637af(0x16d)+_0x1d3393+_0x4637af(0x1b4)+_0x654104+_0x518796);}}return console[_0x4637af(0x180)](a27_0x42f4e5['yellow']('\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.')),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x2b4b4d(0x1c6);[a27_0x2b4b4d(0x1e5)]=a27_0x2b4b4d(0x251);async[a27_0x2b4b4d(0x134)](_0x54d43c){const _0x4fe6f5=a27_0x2b4b4d,{options:_0x20d1f2,args:_0x11fbf5,tdx:_0x44bddd}=_0x54d43c,_0x3382f6=_0x11fbf5[0x0];if(!requireNameOrPath(_0x3382f6))return 0x1;_0x20d1f2[_0x4fe6f5(0x1c2)]&&console['error'](_0x4fe6f5(0x181)+_0x3382f6);const {journeyId:_0x540037,journeyName:_0x198264}=await resolveJourneyIdFromInput(_0x3382f6,_0x20d1f2,_0x44bddd);if(_0x20d1f2['dryRun'])return await this[_0x4fe6f5(0x159)](_0x54d43c,_0x540037,_0x198264);if(!_0x20d1f2['yes']){const _0x4716f5=await confirm(_0x4fe6f5(0x150)+_0x198264+'\x22?');if(!_0x4716f5)return console[_0x4fe6f5(0x1f7)]('Cancelled'),0x0;}const _0x7b2eb7=await withSpinner(_0x4fe6f5(0x153),()=>_0x44bddd[_0x4fe6f5(0x24f)][_0x4fe6f5(0x23a)](_0x540037),{'verbose':_0x20d1f2[_0x4fe6f5(0x1c2)]}),_0x32a31e=_0x7b2eb7[_0x4fe6f5(0x1cf)];return console[_0x4fe6f5(0x1f7)](_0x4fe6f5(0x244)+_0x32a31e[_0x4fe6f5(0x1a2)][_0x4fe6f5(0x1e4)]+_0x4fe6f5(0x15b)),0x0;}async[a27_0x2b4b4d(0x159)](_0x29012d,_0x43d79a,_0x906772){const _0x4a9aa4=a27_0x2b4b4d,{options:_0xd70ec9,tdx:_0x52ebc9}=_0x29012d,_0x2ed6d6=await withSpinner('Fetching\x20journey\x20'+_0x906772+'...',()=>Promise[_0x4a9aa4(0x1d6)]([_0x52ebc9[_0x4a9aa4(0x24f)][_0x4a9aa4(0x178)](_0x43d79a),_0x52ebc9['journey']['listActivationsFlat'](_0x43d79a)]),{'verbose':_0xd70ec9[_0x4a9aa4(0x1c2)]}),[_0x5bec8e,_0x514fdb]=_0x2ed6d6[_0x4a9aa4(0x1cf)],_0xadebca=_0x5bec8e['attributes'],_0x28a367=_0xadebca['journeyStages'];console[_0x4a9aa4(0x180)](a27_0x42f4e5['bold'](_0x4a9aa4(0x152)),_0xadebca['name']),console[_0x4a9aa4(0x180)](a27_0x42f4e5[_0x4a9aa4(0x1b9)]('ID:'),_0x5bec8e['id']),console['log'](a27_0x42f4e5[_0x4a9aa4(0x1b9)](_0x4a9aa4(0x222)),_0xadebca[_0x4a9aa4(0x1f8)]),console[_0x4a9aa4(0x180)](a27_0x42f4e5[_0x4a9aa4(0x1b9)](_0x4a9aa4(0x16e)),_0xadebca[_0x4a9aa4(0x148)]?a27_0x42f4e5[_0x4a9aa4(0x186)](_0x4a9aa4(0x220)):a27_0x42f4e5[_0x4a9aa4(0x207)]('no'));_0xadebca[_0x4a9aa4(0x1b7)]&&console[_0x4a9aa4(0x180)](a27_0x42f4e5[_0x4a9aa4(0x1b9)](_0x4a9aa4(0x135)),_0xadebca['pausedAt']);console['log'](a27_0x42f4e5[_0x4a9aa4(0x1b9)](_0x4a9aa4(0x1fe)),_0xadebca[_0x4a9aa4(0x1f1)]);const _0x147df6=_0x28a367[_0x4a9aa4(0x162)]>0x0?'\x20('+_0x28a367[_0x4a9aa4(0x172)](_0x1d1ca4=>_0x1d1ca4[_0x4a9aa4(0x1e4)])[_0x4a9aa4(0x21a)](',\x20')+')':'';console[_0x4a9aa4(0x180)](a27_0x42f4e5[_0x4a9aa4(0x1b9)](_0x4a9aa4(0x18e)),''+_0x28a367[_0x4a9aa4(0x162)]+_0x147df6),console['log']('');if(_0x514fdb['length']===0x0)console[_0x4a9aa4(0x180)](a27_0x42f4e5[_0x4a9aa4(0x1b9)](_0x4a9aa4(0x23e)),a27_0x42f4e5['dim']('(none)'));else{console[_0x4a9aa4(0x180)](a27_0x42f4e5[_0x4a9aa4(0x1b9)](_0x4a9aa4(0x23e)));for(const _0x462ff7 of _0x514fdb){const _0x267234=_0x462ff7[_0x4a9aa4(0x1e4)]??_0x4a9aa4(0x1a0),_0x5cbfa2=_0x462ff7['connectionId']!=null?'connection\x20'+_0x462ff7['connectionId']:_0x4a9aa4(0x184),_0x38be37=_0x462ff7['scheduleType']?''+_0x462ff7['scheduleType']+(_0x462ff7[_0x4a9aa4(0x161)]?_0x4a9aa4(0x1d3)+_0x462ff7[_0x4a9aa4(0x161)]:''):_0x4a9aa4(0x1b3),_0x3d2bf5=_0x462ff7[_0x4a9aa4(0x215)]?_0x4a9aa4(0x214):'';console[_0x4a9aa4(0x180)]('\x20\x20'+a27_0x42f4e5[_0x4a9aa4(0x186)](_0x4a9aa4(0x224))+'\x20'+_0x267234+_0x4a9aa4(0x16d)+_0x5cbfa2+',\x20schedule:\x20'+_0x38be37+_0x3d2bf5);}}return console[_0x4a9aa4(0x180)](a27_0x42f4e5[_0x4a9aa4(0x186)](_0x4a9aa4(0x1bc))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]=a27_0x2b4b4d(0x1e2);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x2b4b4d(0x134)](_0x136c68){const _0x19c938=a27_0x2b4b4d,{options:_0x4c1dbf,args:_0x3b9242,tdx:_0x4342d5}=_0x136c68,_0x2574ad=_0x4c1dbf,_0x1e349c=_0x3b9242[0x0],_0x35024f=_0x1e349c&&isYamlFilePath(_0x1e349c),_0x3ba94e=await resolveTarget({'arg':_0x35024f?_0x1e349c:undefined,'contextParent':_0x4c1dbf[_0x19c938(0x22d)],'cwd':process[_0x19c938(0x1d2)]()});if(!isSuccessfulResolution(_0x3ba94e))return _0x3ba94e[_0x19c938(0x1aa)]===_0x19c938(0x1c8)?(console['error'](a27_0x42f4e5['yellow'](_0x19c938(0x239))),console['error'](_0x19c938(0x216)),console[_0x19c938(0x1f7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x19c938(0x1f7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console['error'](_0x19c938(0x235))):(console[_0x19c938(0x1f7)](a27_0x42f4e5[_0x19c938(0x17a)]('Error:\x20'+_0x3ba94e[_0x19c938(0x143)]+'\x0a')),_0x3ba94e[_0x19c938(0x212)]&&console[_0x19c938(0x1f7)](a27_0x42f4e5[_0x19c938(0x137)](_0x3ba94e['helpText']))),0x1;let _0x244ade=_0x35024f?undefined:_0x1e349c,_0x38dd16,_0x43ac59;_0x3ba94e[_0x19c938(0x18a)]===_0x19c938(0x1ab)&&(_0x244ade=_0x3ba94e[_0x19c938(0x128)],_0x38dd16=_0x3ba94e[_0x19c938(0x174)],_0x43ac59=_0x3ba94e[_0x19c938(0x18d)]);const _0x975df5=_0x3ba94e['parentName'],_0x382d3d=_0x3ba94e[_0x19c938(0x17e)];_0x2574ad[_0x19c938(0x1c2)]&&(console['error'](_0x19c938(0x23b)+_0x975df5),console[_0x19c938(0x1f7)](_0x19c938(0x248)+_0x382d3d),_0x244ade&&console[_0x19c938(0x1f7)]('Journey\x20name:\x20'+_0x244ade),_0x38dd16&&console['error'](_0x19c938(0x226)+_0x38dd16),_0x43ac59&&console[_0x19c938(0x1f7)](_0x19c938(0x17d)+_0x43ac59));const _0x44825f=await withSpinner(_0x19c938(0x179),()=>_0x4342d5[_0x19c938(0x158)][_0x19c938(0x1e8)](_0x975df5),{'verbose':_0x4c1dbf[_0x19c938(0x1c2)]}),_0x2057a4=_0x44825f[_0x19c938(0x1cf)],{journeys:_0x26be84,folders:_0x1ffc17}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x5ab924=_0x19c938,[_0x511ffc,_0xa449e0]=await Promise[_0x5ab924(0x1d6)]([_0x4342d5['journey'][_0x5ab924(0x1a9)](_0x2057a4,undefined,{'includeAllVersions':!![]}),_0x4342d5[_0x5ab924(0x158)][_0x5ab924(0x1e7)](_0x2057a4)]);return{'journeys':_0x511ffc,'folders':_0xa449e0};},{'verbose':_0x4c1dbf[_0x19c938(0x1c2)]})[_0x19c938(0x14d)](_0x25fed3=>_0x25fed3[_0x19c938(0x1cf)]);let _0x34f01b=_0x26be84;const _0x3fceb0=buildFolderIdToPathMap(_0x1ffc17);if(_0x244ade){const _0x4c449e=_0x34f01b['filter'](_0x3ff058=>_0x3ff058[_0x19c938(0x22c)][_0x19c938(0x202)]()===_0x244ade[_0x19c938(0x202)]());if(_0x4c449e[_0x19c938(0x162)]===0x0)return console[_0x19c938(0x1f7)](_0x19c938(0x24d)+_0x244ade),console[_0x19c938(0x1f7)](_0x19c938(0x1a5)),0x1;_0x34f01b=_0x4c449e;}if(_0x43ac59!==undefined){const _0x17ea4d=_0x34f01b[_0x19c938(0x1c9)](_0xa1e54e=>{const _0x60c122=_0x19c938,_0x312c46=_0xa1e54e[_0x60c122(0x142)]?_0x3fceb0['get'](_0xa1e54e['folderId'])||'':'';return _0x312c46===_0x43ac59;});if(_0x17ea4d[_0x19c938(0x162)]===0x0&&_0x34f01b[_0x19c938(0x162)]>0x0){console[_0x19c938(0x1f7)](_0x19c938(0x19e)+_0x244ade+_0x19c938(0x146)+(_0x43ac59||_0x19c938(0x1dd))),console[_0x19c938(0x1f7)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x3da629 of _0x34f01b){const _0x14216c=_0x3da629[_0x19c938(0x142)]?_0x3fceb0['get'](_0x3da629[_0x19c938(0x142)])||'':'';console[_0x19c938(0x1f7)](_0x19c938(0x12f)+(_0x14216c||'(root)')+'/'+_0x3da629['journeyBundleName']);}return 0x1;}_0x34f01b=_0x17ea4d;}if(_0x34f01b[_0x19c938(0x162)]===0x0)return console[_0x19c938(0x1f7)]('No\x20journeys\x20found'),0x0;const _0x52ecf2=new Map();for(const _0xf65973 of _0x34f01b){const _0x397e36=_0xf65973[_0x19c938(0x1c1)];!_0x52ecf2[_0x19c938(0x157)](_0x397e36)&&_0x52ecf2[_0x19c938(0x20f)](_0x397e36,[]),_0x52ecf2[_0x19c938(0x1c4)](_0x397e36)['push'](_0xf65973);}for(const _0x27c169 of _0x52ecf2[_0x19c938(0x1ae)]()){_0x27c169['sort']((_0x176b61,_0x1ba8b0)=>(_0x176b61[_0x19c938(0x14e)]||0x0)-(_0x1ba8b0[_0x19c938(0x14e)]||0x0));}const _0x5c2064=[],{idToEmailMap:_0x22a9ae,connectionIdToNameMap:_0x30fadf}=await withSpinner(_0x19c938(0x200),async()=>{const _0x388ae3=_0x19c938,[_0x5c33b5,_0x393f4f]=await Promise[_0x388ae3(0x1d6)]([_0x4342d5['user'][_0x388ae3(0x1da)](),_0x4342d5[_0x388ae3(0x144)][_0x388ae3(0x205)]()]);return{'idToEmailMap':_0x5c33b5,'connectionIdToNameMap':_0x393f4f};},{'verbose':_0x4c1dbf[_0x19c938(0x1c2)]})['then'](_0x13e066=>_0x13e066[_0x19c938(0x1cf)]);for(const _0x379c19 of _0x52ecf2[_0x19c938(0x1ae)]()){const _0x4b0bce=_0x379c19[0x0][_0x19c938(0x22c)],_0x50633f=_0x379c19[0x0]['folderId'],_0x83830a=_0x50633f?_0x3fceb0[_0x19c938(0x1c4)](_0x50633f)||'':'',_0x229be3=_0x83830a?a27_0x169f08['join'](_0x382d3d,_0x83830a):_0x382d3d,_0x56c08d=_0x38dd16||a27_0x169f08[_0x19c938(0x21a)](_0x229be3,sanitizeFileName(_0x4b0bce)+'.journey.yml');let _0x56c58a,_0x1166e0;if(existsSync(_0x56c08d))try{const _0xd79fc2=readFileSync(_0x56c08d,'utf-8'),_0x40ce84=parseYamlString(_0xd79fc2);_0x1166e0=_0x40ce84,_0x56c58a=buildRuleToNameMapping(_0x40ce84),_0x2574ad[_0x19c938(0x1c2)]&&_0x56c58a[_0x19c938(0x22f)]>0x0&&console[_0x19c938(0x1f7)](_0x19c938(0x1a4)+_0x56c58a[_0x19c938(0x22f)]+_0x19c938(0x245)+_0x4b0bce);}catch(_0x25cbae){_0x2574ad[_0x19c938(0x1c2)]&&console[_0x19c938(0x1f7)](_0x19c938(0x1ac)+_0x25cbae[_0x19c938(0x143)]);}const _0x3536ff=[],_0x23358e=new Set(),_0x3993b6=new Map(),_0x5a1d1c=new Map(),_0x541c20=new Set(),_0x5100be=new Map(),_0x5ed590=new Map(),_0x21b5be=createJumpTargetCache();await withProgressSpinner(_0x19c938(0x19b)+_0x4b0bce+_0x19c938(0x208),async _0x5c4db5=>{const _0x46bf98=_0x19c938;for(const _0xd7fe1c of _0x379c19){const _0x2cc8e5=_0x379c19[_0x46bf98(0x162)]>0x1?_0xd7fe1c[_0x46bf98(0x22c)]+'\x20v'+(_0xd7fe1c[_0x46bf98(0x14e)]||0x1):_0xd7fe1c['journeyBundleName'];_0x5c4db5[_0x46bf98(0x23f)](_0x46bf98(0x19b)+_0x2cc8e5);const _0x45b3cf=await _0x4342d5[_0x46bf98(0x24f)]['getJourney'](_0xd7fe1c['id']),_0x5b1369=_0x45b3cf[_0x46bf98(0x1a2)]?.[_0x46bf98(0x1f1)],_0x5a59e9={'resolveSegment':async _0x501e68=>{const _0x53c57e=_0x46bf98;if(!_0x5b1369)return{'name':_0x501e68,'isJourneyLocal':![]};const _0x1d1dd9=_0x3993b6[_0x53c57e(0x1c4)](_0x501e68);if(_0x1d1dd9)return _0x1d1dd9;try{const _0x546dcf=await _0x4342d5[_0x53c57e(0x158)][_0x53c57e(0x1d8)](_0x5b1369,_0x501e68),_0x3dc36f=_0x546dcf[_0x53c57e(0x238)]===SEGMENT_KIND_JOURNEY;let _0x70c817,_0x144494=_0x546dcf[_0x53c57e(0x1e4)];if(_0x3dc36f&&_0x546dcf['rule']){const _0x3e825b=await segmentResponseToDef(_0x546dcf,{'resolveSegmentName':async _0xbe0358=>{const _0x1e4746=_0x53c57e,_0x566d39=_0x3993b6[_0x1e4746(0x1c4)](_0xbe0358);if(_0x566d39)return _0x566d39[_0x1e4746(0x1e4)];const _0x54bc56=await _0x5a59e9[_0x1e4746(0x17f)](_0xbe0358);return _0x54bc56[_0x1e4746(0x1e4)];}}),_0x1a7e02=_0x3e825b[_0x53c57e(0x151)];_0x70c817={'description':_0x546dcf[_0x53c57e(0x1e5)],'rule':_0x1a7e02};const _0x5f4272=serializeRule(_0x1a7e02),_0xdabff4=_0x5a1d1c['get'](_0x5f4272);if(_0xdabff4)_0x144494=_0xdabff4,_0x70c817=undefined,_0x2574ad['verbose']&&console['error'](_0x53c57e(0x13f)+_0x546dcf['name']+_0x53c57e(0x1b0)+_0xdabff4);else{let _0x3bbaf6=![];if(_0x56c58a){const _0x4bce8f=_0x56c58a[_0x53c57e(0x1c4)](_0x5f4272);if(_0x4bce8f){const _0x4d449b=_0x4bce8f['find'](_0xe618f5=>!_0x23358e[_0x53c57e(0x157)](_0xe618f5));_0x4d449b&&(_0x144494=_0x4d449b,_0x23358e[_0x53c57e(0x24b)](_0x4d449b),_0x5a1d1c[_0x53c57e(0x20f)](_0x5f4272,_0x4d449b),_0x3bbaf6=!![],_0x2574ad[_0x53c57e(0x1c2)]&&console['error'](_0x53c57e(0x14b)+_0x4d449b+_0x53c57e(0x1ad)));}}if(!_0x3bbaf6){const _0x10f1b4=generateJourneyLocalName(_0x546dcf[_0x53c57e(0x1e4)]);_0x10f1b4&&(_0x144494=_0x10f1b4);let _0x58fcd8=_0x144494,_0x2d4370=0x2;while(_0x23358e[_0x53c57e(0x157)](_0x58fcd8)){_0x58fcd8=_0x144494+'_'+_0x2d4370,_0x2d4370++;}_0x23358e[_0x53c57e(0x24b)](_0x58fcd8),_0x5a1d1c[_0x53c57e(0x20f)](_0x5f4272,_0x58fcd8),_0x144494=_0x58fcd8;}}}const _0x2843ba={'name':_0x144494,'isJourneyLocal':_0x3dc36f,'definition':_0x70c817};return _0x3993b6[_0x53c57e(0x20f)](_0x501e68,_0x2843ba),_0x2843ba;}catch(_0x11b2d1){return _0x4c1dbf[_0x53c57e(0x1c2)]&&console[_0x53c57e(0x1f7)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x501e68+':\x20'+_0x11b2d1[_0x53c57e(0x143)]),{'name':_0x501e68,'isJourneyLocal':![]};}},'resolveActivation':async _0x4bcfad=>{const _0x1e03eb=_0x46bf98,_0x46e6d7=_0x5100be[_0x1e03eb(0x1c4)](_0x4bcfad);if(_0x46e6d7)return _0x46e6d7;try{const _0x2889e3=await _0x4342d5[_0x1e03eb(0x24f)][_0x1e03eb(0x243)](_0xd7fe1c['id'],_0x4bcfad),_0xd0dbdd=journeyActivationStepToYaml(_0x2889e3,_0x22a9ae,_0x30fadf),_0x95fcf9=JSON['stringify']({'name':_0xd0dbdd['name'],'connection':_0xd0dbdd[_0x1e03eb(0x144)],'connector_config':_0xd0dbdd['connector_config']}),_0x3860be=_0x5ed590[_0x1e03eb(0x1c4)](_0x95fcf9);if(_0x3860be){const _0x3cb0ee={'name':_0x3860be,'isJourneyLocal':!![],'definition':_0xd0dbdd};return _0x5100be[_0x1e03eb(0x20f)](_0x4bcfad,_0x3cb0ee),_0x3cb0ee;}const _0x3bc74c=_0x2889e3[_0x1e03eb(0x1a2)][_0x1e03eb(0x1f9)][_0x1e03eb(0x1e4)]||_0x4bcfad,_0x58aac3=sanitizeYamlKey(_0x3bc74c)||_0x1e03eb(0x1c5)+_0x4bcfad;let _0x52e7d2=_0x58aac3,_0x1066d0=0x2;while(_0x541c20[_0x1e03eb(0x157)](_0x52e7d2)){_0x52e7d2=_0x58aac3+'_'+_0x1066d0,_0x1066d0++;}_0x541c20[_0x1e03eb(0x24b)](_0x52e7d2),_0x5ed590['set'](_0x95fcf9,_0x52e7d2);const _0x5afc80={'name':_0x52e7d2,'isJourneyLocal':!![],'definition':_0xd0dbdd};return _0x5100be[_0x1e03eb(0x20f)](_0x4bcfad,_0x5afc80),_0x5afc80;}catch(_0x52a25f){return _0x4c1dbf['verbose']&&console[_0x1e03eb(0x1f7)](_0x1e03eb(0x166)+_0x4bcfad+':\x20'+_0x52a25f[_0x1e03eb(0x143)]),{'name':_0x4bcfad,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5db093,_0x20d20f)=>{const _0x2a833b=_0x46bf98;return resolveJumpTarget(_0x5db093,_0x20d20f,_0x21b5be,_0x802793=>_0x4342d5[_0x2a833b(0x24f)][_0x2a833b(0x178)](_0x802793));}},_0x501494=await journeyResponseToDef(_0x45b3cf,_0x5a59e9);_0x3536ff['push']({'item':_0xd7fe1c,'yaml':_0x501494});}},{'verbose':_0x4c1dbf[_0x19c938(0x1c2)]});const _0x49b6a0=await _0x4342d5[_0x19c938(0x24f)][_0x19c938(0x168)](_0x379c19[0x0][_0x19c938(0x1c1)]),_0x599471=buildMergedJourneyDef(_0x3536ff,_0x56c58a,_0x49b6a0),_0x11e68e=normalizeJourneyDef(_0x599471,_0x1166e0),_0x319f31=toYamlString(_0x11e68e),_0x683eb1=_0x38dd16||a27_0x169f08[_0x19c938(0x21a)](_0x229be3,sanitizeFileName(_0x4b0bce)+'.journey.yml');!_0x38dd16&&_0x83830a&&!existsSync(_0x229be3)&&mkdirSync(_0x229be3,{'recursive':!![]});const _0x2e2165=a27_0x169f08['relative'](process[_0x19c938(0x1d2)](),_0x683eb1);if(existsSync(_0x683eb1)){const _0x3068b8=readFileSync(_0x683eb1,_0x19c938(0x136)),_0x3edd4f=generateDiff(_0x3068b8,_0x319f31),_0x1d3888=hasChanges(_0x3edd4f);_0x5c2064[_0x19c938(0x1ce)]({'relativePath':_0x2e2165,'absolutePath':_0x683eb1,'content':_0x319f31,'isNew':![],'hasChanges':_0x1d3888,'diff':_0x1d3888?formatDiffWithColors(_0x3edd4f):undefined});}else _0x5c2064[_0x19c938(0x1ce)]({'relativePath':_0x2e2165,'absolutePath':_0x683eb1,'content':_0x319f31,'isNew':!![],'hasChanges':![]});}const _0x45407c=_0x5c2064[_0x19c938(0x1c9)](_0x19267c=>_0x19267c[_0x19c938(0x255)]),_0x2d5602=_0x5c2064['filter'](_0x28f40e=>!_0x28f40e['isNew']&&_0x28f40e['hasChanges']),_0x23ff90=_0x5c2064[_0x19c938(0x1c9)](_0x17b721=>!_0x17b721['isNew']&&!_0x17b721[_0x19c938(0x1fc)]),_0x32e003=_0x34f01b['length'],_0x4e3c7c=_0x52ecf2[_0x19c938(0x22f)],_0x2f3596=_0x32e003>_0x4e3c7c?'\x20('+_0x32e003+_0x19c938(0x246):'';console['error'](_0x19c938(0x1d9)),console['error']('\x20\x20'+a27_0x42f4e5['cyan'](_0x4e3c7c+_0x19c938(0x231))+a27_0x42f4e5[_0x19c938(0x196)](_0x2f3596)),console[_0x19c938(0x1f7)]('\x20\x20'+a27_0x42f4e5['green']('+\x20'+_0x45407c['length']+_0x19c938(0x15a))),console['error']('\x20\x20'+a27_0x42f4e5[_0x19c938(0x186)]('~\x20'+_0x2d5602[_0x19c938(0x162)]+_0x19c938(0x17c))),console[_0x19c938(0x1f7)]('\x20\x20'+a27_0x42f4e5[_0x19c938(0x196)]('=\x20'+_0x23ff90[_0x19c938(0x162)]+_0x19c938(0x16c))),console[_0x19c938(0x1f7)]('\x20\x20Target:\x20'+a27_0x42f4e5[_0x19c938(0x137)](_0x382d3d)+'\x0a');if(_0x2d5602['length']>0x0)for(const _0x558be3 of _0x2d5602){console[_0x19c938(0x1f7)]('\x0aChanges\x20to\x20\x27'+_0x558be3[_0x19c938(0x175)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x19c938(0x1f7)](_0x558be3[_0x19c938(0x12d)]),console[_0x19c938(0x1f7)]('─'[_0x19c938(0x156)](0x3c));}if(_0x2574ad[_0x19c938(0x19c)])return console['error'](a27_0x42f4e5[_0x19c938(0x186)](_0x19c938(0x20b))),0x0;if(_0x45407c[_0x19c938(0x162)]===0x0&&_0x2d5602['length']===0x0)return console['error'](a27_0x42f4e5['green'](_0x19c938(0x223))),saveSessionContext({'parent_segment':_0x975df5},_0x2574ad[_0x19c938(0x20a)]),console[_0x19c938(0x1f7)](a27_0x42f4e5[_0x19c938(0x207)]('✔\x20Context\x20set:\x20'+a27_0x42f4e5[_0x19c938(0x196)](_0x19c938(0x1d4))+_0x19c938(0x12c)+a27_0x42f4e5[_0x19c938(0x137)](_0x975df5))),0x0;if(!_0x2574ad[_0x19c938(0x220)]&&(_0x45407c[_0x19c938(0x162)]>0x0||_0x2d5602[_0x19c938(0x162)]>0x0)){if(!isInteractive())return console['error'](a27_0x42f4e5['red'](_0x19c938(0x14c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x19c938(0x1f7)](a27_0x42f4e5[_0x19c938(0x196)](_0x19c938(0x20c))),0x1;const _0x3f4028=await confirmKey('Write\x20'+(_0x45407c[_0x19c938(0x162)]+_0x2d5602['length'])+_0x19c938(0x1a6));if(!_0x3f4028)return console[_0x19c938(0x1f7)](a27_0x42f4e5[_0x19c938(0x186)](_0x19c938(0x183)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x382d3d)&&mkdirSync(_0x382d3d,{'recursive':!![]});const _0x1c5fb6=a27_0x169f08[_0x19c938(0x21a)](_0x382d3d,_0x19c938(0x1c3));writeFileSync(_0x1c5fb6,createTdxConfigContent(_0x975df5),_0x19c938(0x136));for(const _0x1fb2db of _0x5c2064){(_0x1fb2db['isNew']||_0x1fb2db[_0x19c938(0x1fc)])&&writeFileSync(_0x1fb2db[_0x19c938(0x1e6)],_0x1fb2db[_0x19c938(0x22a)],_0x19c938(0x136));}return console[_0x19c938(0x1f7)](a27_0x42f4e5[_0x19c938(0x207)](_0x19c938(0x1a3)+(_0x45407c[_0x19c938(0x162)]+_0x2d5602[_0x19c938(0x162)])+'\x20journey\x20files\x20to\x20'+_0x382d3d)),saveSessionContext({'parent_segment':_0x975df5},_0x2574ad[_0x19c938(0x20a)]),console[_0x19c938(0x1f7)](a27_0x42f4e5[_0x19c938(0x207)](_0x19c938(0x233)+a27_0x42f4e5['dim']('parent_segment')+'\x20=\x20'+a27_0x42f4e5[_0x19c938(0x137)](_0x975df5))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]=a27_0x2b4b4d(0x141);['description']=a27_0x2b4b4d(0x16b);async[a27_0x2b4b4d(0x134)](_0x34d4d2){const _0x3b2229=a27_0x2b4b4d,{options:_0x543c9e,args:_0x290c36,tdx:_0x52366c}=_0x34d4d2,_0xc49ed1=_0x290c36[0x0];if(!requireNameOrPath(_0xc49ed1))return 0x1;_0x543c9e[_0x3b2229(0x1c2)]&&console['error'](_0x3b2229(0x181)+_0xc49ed1);const {journeyId:_0x1fe47f}=await resolveJourneyIdFromInput(_0xc49ed1,_0x543c9e,_0x52366c),_0x4ca6d1=await withSpinner('Getting\x20column\x20mapping...',()=>_0x52366c[_0x3b2229(0x24f)][_0x3b2229(0x20d)](_0x1fe47f),{'verbose':_0x543c9e[_0x3b2229(0x1c2)]}),_0x176255=_0x4ca6d1['data'];return console['log'](_0x3b2229(0x256)+_0x176255[_0x3b2229(0x23c)]),console[_0x3b2229(0x180)]('Table:\x20'+_0x176255[_0x3b2229(0x21c)]),await handleSDKOutput(_0x176255[_0x3b2229(0x1c0)],_0x543c9e),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]='journey:activations';[a27_0x2b4b4d(0x1e5)]=a27_0x2b4b4d(0x133);async[a27_0x2b4b4d(0x134)](_0x3b9cbe){const _0x3a628d=a27_0x2b4b4d,{options:_0x43eb4e,args:_0x11d55e,tdx:_0x39049a}=_0x3b9cbe,_0x3eb712=_0x11d55e[0x0];if(!requireNameOrPath(_0x3eb712))return 0x1;_0x43eb4e['verbose']&&console[_0x3a628d(0x1f7)](_0x3a628d(0x181)+_0x3eb712);const {journeyId:_0x446b09}=await resolveJourneyIdFromInput(_0x3eb712,_0x43eb4e,_0x39049a),_0x3cdb66=await withSpinner('Listing\x20journey\x20activations...',()=>_0x39049a[_0x3a628d(0x24f)][_0x3a628d(0x129)](_0x446b09),{'verbose':_0x43eb4e[_0x3a628d(0x1c2)]}),_0x21827f=_0x3cdb66[_0x3a628d(0x1cf)];return console[_0x3a628d(0x1f7)](_0x3a628d(0x1a4)+_0x21827f[_0x3a628d(0x162)]+_0x3a628d(0x1de)+(_0x21827f['length']!==0x1?'s':'')),await handleSDKOutput(_0x21827f,_0x43eb4e),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]='journey:push';[a27_0x2b4b4d(0x1e5)]=a27_0x2b4b4d(0x1d1);[a27_0x2b4b4d(0x1a8)]=new SegmentPushCommand();async['execute'](_0xfbc3b8){const _0x2e3e69=a27_0x2b4b4d,_0x559084=_0xfbc3b8[_0x2e3e69(0x1d0)][0x0];let _0x3e34f1;if(_0x559084){const _0x39c129=await resolveTarget({'arg':_0x559084,'contextParent':_0xfbc3b8[_0x2e3e69(0x177)][_0x2e3e69(0x22d)],'cwd':process[_0x2e3e69(0x1d2)]()});isSuccessfulResolution(_0x39c129)&&_0x39c129[_0x2e3e69(0x18a)]===_0x2e3e69(0x1ab)&&(_0x3e34f1=_0x39c129[_0x2e3e69(0x174)]);}const _0x258b0e={..._0xfbc3b8,'options':{..._0xfbc3b8[_0x2e3e69(0x177)],'journeysOnly':!![],..._0x3e34f1&&{'singleFilePath':_0x3e34f1}}};return this['segmentPushCommand']['execute'](_0x258b0e);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]=a27_0x2b4b4d(0x138);[a27_0x2b4b4d(0x1e5)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x2b4b4d(0x134)](_0x83909f){const _0x59d035=a27_0x2b4b4d,{options:_0xf05ba8,args:_0xb293f3,tdx:_0x2c9059}=_0x83909f,_0x2c3d5e=_0xb293f3[0x0];if(!requireNameOrPath(_0x2c3d5e))return 0x1;if(_0xf05ba8[_0x59d035(0x1c2)])console[_0x59d035(0x1f7)](_0x59d035(0x181)+_0x2c3d5e);const {journeyId:_0x472ba5}=await resolveJourneyIdFromInput(_0x2c3d5e,_0xf05ba8,_0x2c9059),_0x4d1255=await withSpinner(_0x59d035(0x13e),()=>_0x2c9059[_0x59d035(0x24f)]['listVersions'](_0x472ba5),{'verbose':_0xf05ba8[_0x59d035(0x1c2)]}),{bundleName:_0x5e5e1b,versions:_0x344b95,latestJourneyId:_0x2263d2}=_0x4d1255[_0x59d035(0x1cf)];console[_0x59d035(0x1f7)](_0x5e5e1b+':\x20'+_0x344b95['length']+_0x59d035(0x18c)+(_0x344b95[_0x59d035(0x162)]!==0x1?'s':''));const _0x53b379=_0x344b95[_0x59d035(0x172)](_0x1f39a0=>({'version':_0x1f39a0[_0x59d035(0x14e)],'journey_id':_0x1f39a0[_0x59d035(0x19a)],'name':_0x1f39a0[_0x59d035(0x1e4)],'state':_0x1f39a0[_0x59d035(0x1f8)],'paused':_0x1f39a0[_0x59d035(0x148)],'latest':_0x1f39a0[_0x59d035(0x19a)]===_0x2263d2,'created_at':_0x1f39a0[_0x59d035(0x1ff)]}));return await handleSDKOutput(_0x53b379,_0xf05ba8),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0x2b4b4d(0x1d5);[a27_0x2b4b4d(0x1e5)]=a27_0x2b4b4d(0x193);async['execute'](_0x5a2782){const _0x3d3abe=a27_0x2b4b4d,{options:_0x39c6dc,args:_0x2b9395,tdx:_0x28c5ad}=_0x5a2782,_0x7c1e6=_0x2b9395[0x0];if(!requireNameOrPath(_0x7c1e6))return 0x1;if(_0x39c6dc['verbose'])console[_0x3d3abe(0x1f7)]('Input:\x20'+_0x7c1e6);const {journeyId:_0x1cdc23,journeyName:_0x49fccc}=await resolveJourneyIdFromInput(_0x7c1e6,_0x39c6dc,_0x28c5ad);if(!_0x39c6dc['yes']){const _0x1f464c=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x49fccc+'\x22?');if(!_0x1f464c)return console['error'](_0x3d3abe(0x1fa)),0x0;}const _0x298845=await withSpinner('Creating\x20new\x20version...',()=>_0x28c5ad[_0x3d3abe(0x24f)][_0x3d3abe(0x1f6)](_0x1cdc23),{'verbose':_0x39c6dc[_0x3d3abe(0x1c2)]}),_0x142e4a=_0x298845[_0x3d3abe(0x1cf)];return console['error'](a27_0x42f4e5[_0x3d3abe(0x207)]('\u2714')+_0x3d3abe(0x132)+_0x142e4a[_0x3d3abe(0x1a2)][_0x3d3abe(0x14e)]+_0x3d3abe(0x12e)+_0x142e4a[_0x3d3abe(0x1a2)][_0x3d3abe(0x1e4)]+'\x22'),console[_0x3d3abe(0x1f7)](_0x3d3abe(0x1bf)+_0x142e4a['id']),await handleSingleObjectOutput({'id':_0x142e4a['id'],'name':_0x142e4a[_0x3d3abe(0x1a2)]['name'],'version':_0x142e4a[_0x3d3abe(0x1a2)][_0x3d3abe(0x14e)],'state':_0x142e4a[_0x3d3abe(0x1a2)][_0x3d3abe(0x1f8)],'bundle_id':_0x142e4a[_0x3d3abe(0x1a2)][_0x3d3abe(0x1c1)],'created_at':_0x142e4a[_0x3d3abe(0x1a2)][_0x3d3abe(0x1ff)]},_0x39c6dc),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x2b4b4d(0x1e4)]=a27_0x2b4b4d(0x1a1);[a27_0x2b4b4d(0x1e5)]=a27_0x2b4b4d(0x234);async[a27_0x2b4b4d(0x134)](_0x4975ee){const _0x66c833=a27_0x2b4b4d,{options:_0x25b875,args:_0x5f3704,tdx:_0x50d037}=_0x4975ee,_0x3d041e=_0x5f3704[0x0];if(!requireNameOrPath(_0x3d041e))return 0x1;const _0x550a84=_0x25b875[_0x66c833(0x1eb)];if(!_0x550a84)return console[_0x66c833(0x1f7)](_0x66c833(0x176)),console[_0x66c833(0x1f7)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x5fa8ce=parseInt(_0x550a84,0xa);if(isNaN(_0x5fa8ce)||_0x5fa8ce<0x1)return console['error'](_0x66c833(0x209)+_0x550a84),0x1;if(_0x25b875[_0x66c833(0x1c2)])console[_0x66c833(0x1f7)](_0x66c833(0x181)+_0x3d041e+_0x66c833(0x170)+_0x5fa8ce);const {journeyId:_0x5e4213,parentSegmentId:_0x424028}=await resolveJourneyIdFromInput(_0x3d041e,_0x25b875,_0x50d037),_0x44d5f5=await withSpinner('Resolving\x20version...',()=>_0x50d037[_0x66c833(0x24f)][_0x66c833(0x1cb)](_0x5e4213),{'verbose':_0x25b875[_0x66c833(0x1c2)]}),{versions:_0x285a6a,latestJourneyId:_0x42b6dc}=_0x44d5f5[_0x66c833(0x1cf)],_0x5743fb=_0x285a6a[_0x66c833(0x13b)](_0x1cc2f0=>_0x1cc2f0['versionNumber']===_0x5fa8ce);if(!_0x5743fb){const _0x409ec9=_0x285a6a['map'](_0x306d81=>'v'+_0x306d81[_0x66c833(0x14e)])[_0x66c833(0x21a)](',\x20');return console['error'](_0x66c833(0x1f5)+_0x5fa8ce+_0x66c833(0x15c)+_0x409ec9),0x1;}const _0x2bf283=await withSpinner(_0x66c833(0x190)+_0x5fa8ce+_0x66c833(0x1fb),()=>_0x50d037[_0x66c833(0x24f)][_0x66c833(0x178)](_0x5743fb[_0x66c833(0x19a)]),{'verbose':_0x25b875[_0x66c833(0x1c2)]}),_0x838c39=_0x2bf283[_0x66c833(0x1cf)],_0x1cb98f=getConsoleNextUrl(_0x25b875[_0x66c833(0x1cc)],_0x66c833(0x236)+_0x424028+'/e/'+_0x5743fb['journeyId']+_0x66c833(0x21e));return await handleSingleObjectOutput({'id':_0x838c39['id'],'name':_0x838c39[_0x66c833(0x1a2)][_0x66c833(0x1e4)],'version':_0x838c39[_0x66c833(0x1a2)]['versionNumber'],'description':_0x838c39['attributes']['description'],'state':_0x838c39[_0x66c833(0x1a2)]['state'],'paused':_0x838c39['attributes'][_0x66c833(0x148)],'reentry_mode':_0x838c39[_0x66c833(0x1a2)][_0x66c833(0x194)],'stages':_0x838c39['attributes'][_0x66c833(0x192)]?.[_0x66c833(0x162)]||0x0,..._0x838c39[_0x66c833(0x1a2)][_0x66c833(0x1ba)]&&{'goal':_0x838c39[_0x66c833(0x1a2)][_0x66c833(0x1ba)]['name']},'latest':_0x5743fb[_0x66c833(0x19a)]===_0x42b6dc,'created_at':_0x838c39[_0x66c833(0x1a2)][_0x66c833(0x1ff)],'updated_at':_0x838c39[_0x66c833(0x1a2)][_0x66c833(0x21b)],'url':_0x1cb98f},_0x25b875),0x0;}}
|
|
1
|
+
const a30_0x242395=a30_0x5b1b;(function(_0x2a74d4,_0x763d39){const _0x23dab1=a30_0x5b1b,_0x3b1b9b=_0x2a74d4();while(!![]){try{const _0xae7c58=parseInt(_0x23dab1(0x1f0))/0x1*(parseInt(_0x23dab1(0x1fe))/0x2)+-parseInt(_0x23dab1(0x13c))/0x3*(parseInt(_0x23dab1(0x203))/0x4)+parseInt(_0x23dab1(0x1c3))/0x5+-parseInt(_0x23dab1(0x1c1))/0x6+parseInt(_0x23dab1(0x202))/0x7*(-parseInt(_0x23dab1(0x155))/0x8)+parseInt(_0x23dab1(0x1cf))/0x9+parseInt(_0x23dab1(0x1bf))/0xa;if(_0xae7c58===_0x763d39)break;else _0x3b1b9b['push'](_0x3b1b9b['shift']());}catch(_0x30f705){_0x3b1b9b['push'](_0x3b1b9b['shift']());}}}(a30_0x1f27,0x3dfe5));import a30_0x247543 from'chalk';function a30_0x1f27(){const _0x4d8456=['resourceName','database','Database:\x20','Write\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Listing\x20journey\x20versions...','2690990TeHKDD','repeat','1821396dePSne','targetDir','2178545cPVtpC','Aborted.','updatedAt','parentSegment','dryRun','\x20\x20Parent\x20segment:\x20','journeyStages','parentName','stage','Journey:','Error:\x20Invalid\x20version\x20number:\x20','Error:\x20--version\x20option\x20is\x20required','1458837hsOqzF','audienceId','activation','\x20@\x20','nodes','journey:version:create','red','ID:','(unnamed)','\x20\x20Consolidating\x20duplicate\x20segment:\x20','getParentFull','journey:columns','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Warning:\x20Could\x20not\x20resolve\x20segment\x20','description','Parent\x20segment:\x20','\x20(ID:\x20','from','jsonl','Fetching\x20parent\x20segment...','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','data','\x22\x20resumed','\x20(draft)\x20—\x20\x22','scheduleType','Status:','resolveParentId','journey:pull','has','history','isNew','utf-8','segment','1YViRtn','\x22\x20not\x20found','pausedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Available\x20stages:\x20','listActivationsFlat','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Getting\x20journey\x20details...','listVersions','tdx.json','state','localeCompare','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','sort','767246qUIaav','runAt','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','pause','3004085WEVuYA','8AdbUXS','yellow','journeyName','length','cyan','type','.journey.yml','limit','Error:\x20Journey\x20not\x20found:\x20','\x20changed\x20files','\x20\x20-\x20','dim','renderStats','map','listJourneysFromParentSegment','goal','Target\x20file:\x20','resolveJourneyId','journey:version:view','Resolving\x20parent\x20segment...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','launched','web','test','values','✔\x20All\x20files\x20are\x20up\x20to\x20date','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','session','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','connection','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','draft','journey:view','stageNameMap','push','No\x20statistics\x20available\x20for\x20journey:\x20','(none)','green','journeyId','yes','find','toLowerCase','List\x20all\x20versions\x20of\x20a\x20journey','segmentName','Listing\x20journeys...','\x20journey\x20files\x20to\x20','Error:\x20','hasChanges','json','Fetching\x20journey\x20','exitOrJumpRate','Pattern:\x20','Activations:','journey:run','\x22\x20paused','journey:resume','getActivation','filePath','connection\x20','columns','✔\x20Found\x20','parent_segment','segmentPushCommand','error','Journey\x20name:\x20','(draft)','\x20\x20Target:\x20','Getting\x20column\x20mapping...','getJourney','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20Opening\x20','Show\x20journey\x20table\x20column\x20mapping','site','log','none','file','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20Parent\x20segment\x20context\x20required','then','Found\x20','Export\x20journey(s)\x20as\x20YAML\x20files','Input:\x20','table','conversion','Folder\x20path:\x20','Paused\x20at:','cwd','Getting\x20journey\x20statistics...','\x20not\x20found.\x20Available:\x20','execute','\x20version','\x20new\x20files','395817Smwlqn','goalSize','hasPeriod','versionNumber','root\x20folder','all','add','\x20Journey\x20workflow\x20started','executeDryRun','includeHistory','paused','📁\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journey','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Error:\x20Invalid\x20--type\x20\x22','kind','Error:\x20Stage\x20\x22','/j/da/je','Parent\x20segment\x20ID:','\x27\x20not\x20found\x20in\x20','get','Resolving\x20journey...','State:','\x20=\x20','8MyPDFH','\x0aError:','Session:','blue','\x20details...','setPhase','enteredSize','getSegment','activation_','journeyBundleId','name','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','(archived)','user','no\x20connection','reentryMode','\x20files?','segments','\x5c$&','bold','resolveSegment','connectionId','milestoneSize','✔\x20Context\x20set:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','set','journey:activations','connector_config','absolutePath','content','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Table:\x20','version','journeyBundleName','INVALID_ARGUMENT','🗺️\x20','folders','includeStats','buildIdToNameMap','diff','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','size','\x0aPull\x20summary:','journey:list','attributes','rootFolderId','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','journey:versions','Pausing\x20journey...','Show\x20journey\x20statistics','Resume\x20a\x20paused\x20journey','workflowSessionId','journey:traffic','\x20\x20Folder\x20path:\x20','buildIdToEmailMap','Paused:','rule','...','relative','createdAt','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20Journey\x20\x22','Cancelled','Resolving\x20version...','stages','\x20journey','getStatistics','\x20\x20←\x20','No\x20journeys\x20found','Triggering\x20journey\x20workflow...','runAfterJourneyRefresh','workflowId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','activationParams',',\x20schedule:\x20','Listing\x20journey\x20activations...','Stages:','⚠️\x20','journey:stats','message','folderPath','Error:\x20Journey\x20\x27','relativePath','filter','split','join','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','/app/ps/','\x20versions)','run','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','format','(root)','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','/e/','Target\x20directory:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','verbose','Trigger\x20on-demand\x20journey\x20workflow\x20execution'];a30_0x1f27=function(){return _0x4d8456;};return a30_0x1f27();}import a30_0x326e95 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl,getWorkflowSessionUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x107bab){const _0x461b7d=a30_0x5b1b;return!_0x107bab&&(console[_0x461b7d(0x11f)](_0x461b7d(0x1e3)),console[_0x461b7d(0x11f)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x107bab;}function withJsonFormat(_0x53ea4c){const _0x585773=a30_0x5b1b;if(!_0x53ea4c[_0x585773(0x1b1)]&&!_0x53ea4c['json']&&!_0x53ea4c[_0x585773(0x1e1)]&&!_0x53ea4c['tsv'])return{..._0x53ea4c,'format':_0x585773(0x233),'json':!![]};return _0x53ea4c;}function formatJourneyState(_0x2f3333){const _0x29830d=a30_0x5b1b;switch(_0x2f3333){case _0x29830d(0x218):return a30_0x247543[_0x29830d(0x228)]('(running)');case _0x29830d(0x222):return a30_0x247543['dim'](_0x29830d(0x121));case _0x29830d(0x146):return a30_0x247543[_0x29830d(0x204)]('(paused)');case'completed':return a30_0x247543[_0x29830d(0x158)]('(completed)');case'archived':return a30_0x247543[_0x29830d(0x20e)](_0x29830d(0x162));default:return'('+_0x2f3333+')';}}function a30_0x5b1b(_0xab05a2,_0x3ae91c){_0xab05a2=_0xab05a2-0x111;const _0x1f2719=a30_0x1f27();let _0x5b1b95=_0x1f2719[_0xab05a2];return _0x5b1b95;}function formatJourneyItem(_0x3f6524,_0x593db7='',_0x3fb256){const _0x37878c=a30_0x5b1b,_0x489b79=formatJourneyState(_0x3f6524['state']),_0x464dbe=_0x3fb256?hyperlink(_0x3f6524[_0x37878c(0x177)],_0x3fb256):_0x3f6524[_0x37878c(0x177)];return _0x593db7+_0x37878c(0x179)+_0x464dbe+'\x20'+_0x489b79;}function escapeRegex(_0x30b05c){const _0x2102c4=a30_0x5b1b;return _0x30b05c['replace'](/[.*+?^${}()|[\]\\]/g,_0x2102c4(0x168));}function globToRegex(_0x545520){const _0x588dbf=a30_0x5b1b,_0x4bb3f7=_0x545520[_0x588dbf(0x1aa)]('*')[_0x588dbf(0x210)](escapeRegex);return new RegExp(_0x4bb3f7[_0x588dbf(0x1ab)]('.*'),'i');}function buildRuleToNameMapping(_0x535d52){const _0x536a22=a30_0x5b1b,_0x564b5b=new Map();if(_0x535d52[_0x536a22(0x167)])for(const [_0xeb7f4c,_0x558c93]of Object['entries'](_0x535d52['segments'])){if(_0x558c93[_0x536a22(0x18e)]){const _0xa6102d=serializeRule(_0x558c93['rule']),_0x58793f=_0x564b5b['get'](_0xa6102d);_0x58793f?_0x58793f['push'](_0xeb7f4c):_0x564b5b[_0x536a22(0x16f)](_0xa6102d,[_0xeb7f4c]);}}return _0x564b5b;}async function resolveJourneyIdFromInput(_0x4a56d8,_0x4969aa,_0x253dfe){const _0x150c74=a30_0x5b1b,_0x301480=await resolveJourneyTarget(_0x4a56d8,_0x4969aa[_0x150c74(0x1c6)],_0x4969aa['verbose']),_0x385de7=_0x301480[_0x150c74(0x1c6)];if(!_0x385de7)throw new SDKError(ErrorCode[_0x150c74(0x178)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0xc48321=await withSpinner(_0x150c74(0x216),()=>_0x253dfe['segment']['resolveParentId'](_0x385de7),{'verbose':_0x4969aa[_0x150c74(0x1b7)]}),_0x42493d=_0xc48321[_0x150c74(0x1e4)],_0x31d147=await withSpinner(_0x150c74(0x152),()=>_0x253dfe[_0x150c74(0x149)][_0x150c74(0x214)](_0x42493d,_0x301480[_0x150c74(0x205)]),{'verbose':_0x4969aa[_0x150c74(0x1b7)]});return{'journeyId':_0x31d147['data'],'journeyName':_0x301480[_0x150c74(0x205)],'parentSegmentId':_0x42493d};}async function resolveJourneyTarget(_0x1a5885,_0x48ebce,_0x3f4a5b){const _0x5c3f0e=a30_0x5b1b;if(isYamlFilePath(_0x1a5885))try{const _0x3f369e=await resolveYamlFilePath(_0x1a5885);return _0x3f4a5b&&(console[_0x5c3f0e(0x11f)]('Resolved\x20YAML\x20file:\x20'+_0x1a5885),console[_0x5c3f0e(0x11f)](_0x5c3f0e(0x1c8)+_0x3f369e[_0x5c3f0e(0x1c6)]),console[_0x5c3f0e(0x11f)]('\x20\x20Name:\x20'+_0x3f369e[_0x5c3f0e(0x22e)]),console[_0x5c3f0e(0x11f)](_0x5c3f0e(0x18b)+(_0x3f369e[_0x5c3f0e(0x1a6)]||_0x5c3f0e(0x1b2)))),{'journeyName':_0x3f369e['segmentName'],'parentSegment':_0x3f369e['parentSegment'],'resolved':_0x3f369e};}catch(_0x1a5d7d){throw new SDKError(ErrorCode[_0x5c3f0e(0x178)],_0x5c3f0e(0x1bd)+_0x1a5d7d[_0x5c3f0e(0x1a5)]);}if(!_0x48ebce)throw new SDKError(ErrorCode[_0x5c3f0e(0x178)],_0x5c3f0e(0x174));return{'journeyName':_0x1a5885,'parentSegment':_0x48ebce};}export class JourneyListCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x181);['description']='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x198efd){const _0x16ef6e=a30_0x242395,{options:_0x4e979b,args:_0x1a921f,tdx:_0x42f25b}=_0x198efd,_0x3e81fe=_0x1a921f[0x0],_0x4eca6d=_0x4e979b[_0x16ef6e(0x1c6)];if(!_0x4eca6d)return console[_0x16ef6e(0x11f)](_0x16ef6e(0x12d)),console[_0x16ef6e(0x11f)](_0x16ef6e(0x16e)),0x1;const _0x1873a6=await withSpinner(_0x16ef6e(0x216),()=>_0x42f25b[_0x16ef6e(0x1ef)]['resolveParentId'](_0x4eca6d),{'verbose':_0x4e979b[_0x16ef6e(0x1b7)]}),_0x16c4b6=_0x1873a6[_0x16ef6e(0x1e4)];_0x4e979b[_0x16ef6e(0x1b7)]&&(console['error']('Parent\x20segment:\x20'+_0x4eca6d+_0x16ef6e(0x1df)+_0x16c4b6+')'),_0x3e81fe&&console[_0x16ef6e(0x11f)](_0x16ef6e(0x113)+_0x3e81fe));const _0x456d6d=await withSpinner(_0x16ef6e(0x1e2),()=>_0x42f25b[_0x16ef6e(0x1ef)][_0x16ef6e(0x1d9)](_0x16c4b6),{'verbose':_0x4e979b['verbose']}),_0x4f0677=_0x456d6d[_0x16ef6e(0x1e4)],_0x4eb520=_0x4f0677[_0x16ef6e(0x183)],_0x5d839e=await withSpinner(_0x16ef6e(0x22f),()=>_0x42f25b['journey']['listJourneysWithFolders'](_0x16c4b6,_0x4eb520),{'verbose':_0x4e979b[_0x16ef6e(0x1b7)]});let _0x460289=_0x5d839e[_0x16ef6e(0x1e4)]['journeys'];const _0x1a8cc4=_0x5d839e[_0x16ef6e(0x1e4)][_0x16ef6e(0x17a)],_0x2e1025=new Map();for(const _0x3d1085 of _0x1a8cc4){_0x2e1025[_0x16ef6e(0x16f)](_0x3d1085['id'],_0x3d1085[_0x16ef6e(0x15f)]);}if(_0x3e81fe){const _0x47ee45=globToRegex(_0x3e81fe);_0x460289=_0x460289[_0x16ef6e(0x1a9)](_0x4ab1e0=>_0x47ee45[_0x16ef6e(0x21a)](_0x4ab1e0['journeyBundleName']));}console[_0x16ef6e(0x11f)](_0x16ef6e(0x11c)+_0x460289[_0x16ef6e(0x206)]+_0x16ef6e(0x197)+(_0x460289[_0x16ef6e(0x206)]!==0x1?'s':''));const _0x266631=_0x25092a=>{const _0x515373=_0x16ef6e;return getConsoleNextUrl(_0x4e979b[_0x515373(0x128)],_0x515373(0x1ad)+_0x16c4b6+'/e/'+_0x25092a+'/j/da');};if(_0x4e979b[_0x16ef6e(0x1b1)]===_0x16ef6e(0x132))await handleSDKOutput(_0x460289,_0x4e979b);else{if(_0x4e979b[_0x16ef6e(0x1b1)]==='json'){const _0x4cb109=_0x460289[_0x16ef6e(0x210)](_0x3d9298=>({..._0x3d9298,'url':_0x266631(_0x3d9298['id'])}));await handleSDKOutput(_0x4cb109,_0x4e979b);}else{console[_0x16ef6e(0x129)]('['+_0x4eca6d+']');const _0x4ad449=new Map(),_0x566e7d=[];for(const _0x3a5b9a of _0x460289){if(!_0x3a5b9a[_0x16ef6e(0x160)]||_0x3a5b9a[_0x16ef6e(0x160)]===_0x4eb520)_0x566e7d[_0x16ef6e(0x225)](_0x3a5b9a);else{const _0x2d372c=_0x4ad449[_0x16ef6e(0x151)](_0x3a5b9a[_0x16ef6e(0x160)])||[];_0x2d372c[_0x16ef6e(0x225)](_0x3a5b9a),_0x4ad449[_0x16ef6e(0x16f)](_0x3a5b9a['folderId'],_0x2d372c);}}const _0x33ae00=(_0x28ae83,_0x5ee218)=>_0x28ae83[_0x16ef6e(0x177)][_0x16ef6e(0x1fb)](_0x5ee218[_0x16ef6e(0x177)],undefined,{'sensitivity':'base'});_0x566e7d[_0x16ef6e(0x1fd)](_0x33ae00);for(const _0x3e530a of _0x566e7d){console[_0x16ef6e(0x129)](formatJourneyItem(_0x3e530a,'',_0x266631(_0x3e530a['id'])));}const _0x375976=[..._0x4ad449['entries']()][_0x16ef6e(0x1fd)]((_0x174056,_0x24ec84)=>{const _0x146f1f=_0x16ef6e,_0x620b04=_0x2e1025['get'](_0x174056[0x0])||_0x174056[0x0],_0x53db4d=_0x2e1025[_0x146f1f(0x151)](_0x24ec84[0x0])||_0x24ec84[0x0];return _0x620b04['localeCompare'](_0x53db4d,undefined,{'sensitivity':'base'});});for(const [_0x875c8a,_0x3549a8]of _0x375976){const _0x150265=_0x2e1025['get'](_0x875c8a)||_0x875c8a;console[_0x16ef6e(0x129)](_0x16ef6e(0x147)+_0x150265),_0x3549a8['sort'](_0x33ae00);for(const _0x16f313 of _0x3549a8){console[_0x16ef6e(0x129)](formatJourneyItem(_0x16f313,'\x20\x20',_0x266631(_0x16f313['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x223);['description']='Show\x20journey\x20details';async['execute'](_0x3b5715){const _0x59311c=a30_0x242395,{options:_0x1c92cc,args:_0x4ee79b,tdx:_0x982dbb}=_0x3b5715,_0x15db16=_0x4ee79b[0x0];if(!_0x15db16)return console[_0x59311c(0x11f)](_0x59311c(0x1e3)),console[_0x59311c(0x11f)](_0x59311c(0x1f6)),console[_0x59311c(0x11f)]('Options:'),console[_0x59311c(0x11f)](_0x59311c(0x1b3)),0x1;_0x1c92cc[_0x59311c(0x1b7)]&&console['error']('Input:\x20'+_0x15db16);const {journeyId:_0x5e7466,parentSegmentId:_0x35625a}=await resolveJourneyIdFromInput(_0x15db16,_0x1c92cc,_0x982dbb);if(_0x1c92cc[_0x59311c(0x219)]){const _0x5c5c4f=getConsoleNextUrl(_0x1c92cc[_0x59311c(0x128)],'/app/ps/'+_0x35625a+'/e/'+_0x5e7466+'/j/da/je');return console['error'](a30_0x247543[_0x59311c(0x228)]('✔')+_0x59311c(0x126)+a30_0x247543[_0x59311c(0x207)](_0x5c5c4f)),openBrowser(_0x5c5c4f),0x0;}const _0x19cf90=await withSpinner(_0x59311c(0x1f7),()=>_0x982dbb[_0x59311c(0x149)][_0x59311c(0x124)](_0x5e7466),{'verbose':_0x1c92cc[_0x59311c(0x1b7)]}),_0x52eb18=_0x19cf90[_0x59311c(0x1e4)],_0x33d392=_0x1c92cc[_0x59311c(0x17b)];let _0x4cdde7;if(_0x33d392)try{const _0x2dd32c=await withSpinner(_0x59311c(0x137),()=>_0x982dbb[_0x59311c(0x149)][_0x59311c(0x198)](_0x5e7466),{'verbose':_0x1c92cc[_0x59311c(0x1b7)]});_0x4cdde7=_0x2dd32c[_0x59311c(0x1e4)];}catch{_0x1c92cc[_0x59311c(0x1b7)]&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x2885d5=getConsoleNextUrl(_0x1c92cc[_0x59311c(0x128)],_0x59311c(0x1ad)+_0x35625a+_0x59311c(0x1b4)+_0x5e7466+_0x59311c(0x14e)),_0x1e096e={'id':_0x52eb18['id'],'name':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x15f)],'description':_0x52eb18[_0x59311c(0x182)]['description'],'state':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x1fa)],'paused':_0x52eb18['attributes'][_0x59311c(0x146)],'reentry_mode':_0x52eb18[_0x59311c(0x182)][_0x59311c(0x165)],'stages':_0x52eb18['attributes'][_0x59311c(0x1c9)]?.[_0x59311c(0x206)]||0x0,..._0x52eb18[_0x59311c(0x182)]['goal']&&{'goal':_0x52eb18['attributes'][_0x59311c(0x212)]['name']},..._0x4cdde7&&{'statistics':{'size':_0x4cdde7['size'],'entered':_0x4cdde7[_0x59311c(0x15b)],'goal_achieved':_0x4cdde7[_0x59311c(0x13d)],'completion_rate':_0x4cdde7['completionRate'],'exit_or_jump':_0x4cdde7['exitOrJumpSize'],'exit_or_jump_rate':_0x4cdde7[_0x59311c(0x112)],'stages':_0x4cdde7[_0x59311c(0x196)]}},'url':_0x2885d5};return await handleSingleObjectOutput(_0x1e096e,_0x1c92cc),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1a4);[a30_0x242395(0x1dd)]=a30_0x242395(0x187);async[a30_0x242395(0x139)](_0x62ff1f){const _0xf829f6=a30_0x242395,{options:_0x318391,args:_0x3a888e,tdx:_0x45b717}=_0x62ff1f,_0x2211e6=_0x3a888e[0x0];if(!requireNameOrPath(_0x2211e6))return 0x1;_0x318391[_0xf829f6(0x1b7)]&&console[_0xf829f6(0x11f)](_0xf829f6(0x131)+_0x2211e6);const _0x3e53f3=_0x318391,_0xa253e7=_0x3e53f3[_0xf829f6(0x1e0)],_0x2a1cbc=_0x3e53f3['to'],_0x5d5668=_0x3e53f3[_0xf829f6(0x145)],_0x375cf5=_0x3e53f3[_0xf829f6(0x1cb)];_0x5d5668&&!_0xa253e7&&!_0x2a1cbc&&console['error'](_0xf829f6(0x1b0));const _0x226012=_0x5d5668?withJsonFormat(_0x318391):_0x318391,{journeyId:_0x3b63a0,journeyName:_0x12c234}=await resolveJourneyIdFromInput(_0x2211e6,_0x226012,_0x45b717),_0x17a196=_0xa253e7||_0x2a1cbc?{'from':_0xa253e7,'to':_0x2a1cbc}:undefined,_0x1795ac=await withSpinner(_0xf829f6(0x137),()=>Promise[_0xf829f6(0x141)]([_0x45b717[_0xf829f6(0x149)][_0xf829f6(0x124)](_0x3b63a0),_0x45b717[_0xf829f6(0x149)]['getStatistics'](_0x3b63a0,_0x17a196)]),{'verbose':_0x226012[_0xf829f6(0x1b7)]}),[_0x353093,_0x4206c3]=_0x1795ac['data'];if(!_0x4206c3||_0x4206c3[_0xf829f6(0x229)]===null)return console[_0xf829f6(0x11f)](_0xf829f6(0x226)+_0x12c234),console[_0xf829f6(0x11f)](_0xf829f6(0x200)),0x0;const _0x18fe2c=buildStageNameMap(_0x353093),_0x40196a=!!(_0x17a196&&_0x4206c3['history']?.[_0xf829f6(0x206)]),_0x257c8b={'stageNameMap':_0x18fe2c,'hasPeriod':_0x40196a,'includeHistory':!!_0x5d5668};if(_0x375cf5&&_0x4206c3[_0xf829f6(0x196)]){const _0x2067bf=_0x4206c3[_0xf829f6(0x196)][_0xf829f6(0x22b)](_0x3aff99=>{const _0x3d2cf6=_0xf829f6,_0x30edbc=_0x18fe2c['get'](_0x3aff99['id'])??'';return _0x30edbc[_0x3d2cf6(0x22c)]()===_0x375cf5[_0x3d2cf6(0x22c)]();});if(_0x2067bf)return await handleSingleObjectOutput(formatStageStats(_0x2067bf,_0x257c8b),_0x226012),0x0;const _0x2af79b=_0x4206c3[_0xf829f6(0x196)]['map'](_0x63443d=>_0x18fe2c[_0xf829f6(0x151)](_0x63443d['id'])??_0x63443d['id']);return console[_0xf829f6(0x11f)](_0xf829f6(0x14d)+_0x375cf5+_0xf829f6(0x1f1)),console[_0xf829f6(0x11f)](_0xf829f6(0x1f4)+_0x2af79b['join'](',\x20')),0x1;}const _0x479009=_0x4206c3[_0xf829f6(0x196)]?.[_0xf829f6(0x210)](_0x3a8f51=>formatStageStats(_0x3a8f51,_0x257c8b)),_0x3fb99d=assembleJourneyStats(_0x4206c3,{'from':_0xa253e7,'to':_0x2a1cbc,'includeHistory':_0x5d5668});return await this[_0xf829f6(0x20f)](_0x3fb99d,_0x479009??[],_0x226012),0x0;}async[a30_0x242395(0x20f)](_0x58f43b,_0x12be18,_0x510db0){const _0x2b5d4f=a30_0x242395,_0x1096b0=_0x510db0[_0x2b5d4f(0x1b1)]==='json'||_0x510db0[_0x2b5d4f(0x1b1)]===_0x2b5d4f(0x1e1)||_0x510db0['json']||_0x510db0[_0x2b5d4f(0x1e1)];if(_0x1096b0){_0x58f43b['stages']=_0x12be18,await handleSingleObjectOutput(_0x58f43b,_0x510db0);return;}await handleSingleObjectOutput(_0x58f43b,_0x510db0);for(const _0x43b635 of _0x12be18){console['log'](''),console['log'](String(a30_0x247543['cyan']['bold']('['+_0x43b635[_0x2b5d4f(0x15f)]+']'))+a30_0x247543['dim']('\x20'+_0x43b635['id']));const {id:_0x12d6c8,name:_0x486622,..._0x5872d9}=_0x43b635;await handleSingleObjectOutput(_0x5872d9,_0x510db0);}}}export class JourneyTrafficCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x18a);['description']=a30_0x242395(0x221);async[a30_0x242395(0x139)](_0x380a21){const _0x320650=a30_0x242395,{options:_0x378985,args:_0x1d722,tdx:_0x584f21}=_0x380a21,_0x2c2286=_0x1d722[0x0];if(!requireNameOrPath(_0x2c2286))return 0x1;_0x378985[_0x320650(0x1b7)]&&console[_0x320650(0x11f)]('Input:\x20'+_0x2c2286);const _0x154f56=_0x378985,_0xbe0ecf=_0x154f56['type'],_0x2fc01d=_0x154f56[_0x320650(0x1e0)],_0x23d230=_0x154f56['to'],_0x5aff24=_0x154f56[_0x320650(0x20a)];if(_0xbe0ecf&&_0xbe0ecf!==_0x320650(0x133)&&_0xbe0ecf!==_0x320650(0x1d1))return console[_0x320650(0x11f)](_0x320650(0x14b)+_0xbe0ecf+_0x320650(0x148)),0x1;const _0x4c836d=withJsonFormat(_0x378985),{journeyId:_0x16d048,journeyName:_0x85ab77}=await resolveJourneyIdFromInput(_0x2c2286,_0x4c836d,_0x584f21),_0x5604f4={'type':_0xbe0ecf,'from':_0x2fc01d,'to':_0x23d230,'limit':_0x5aff24},_0x5267d0=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x584f21[_0x320650(0x149)]['getTrafficData'](_0x16d048,_0x5604f4),{'verbose':_0x4c836d['verbose']}),_0x11c0eb=_0x5267d0['data'],_0x345440=_0x11c0eb['conversion']&&(_0x11c0eb['conversion'][_0x320650(0x1d3)]['length']>0x0||_0x11c0eb['conversion']['links'][_0x320650(0x206)]>0x0),_0x3e0ca2=_0x11c0eb[_0x320650(0x1d1)]&&_0x11c0eb[_0x320650(0x1d1)][_0x320650(0x206)]>0x0;if(!_0x345440&&!_0x3e0ca2)return console['error']('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x85ab77),console['error'](_0x320650(0x17e)),_0x2fc01d&&_0x23d230&&console[_0x320650(0x11f)](_0x320650(0x19e)),0x0;return await handleSingleObjectOutput(_0x11c0eb,_0x4c836d),0x0;}}function formatStageStats(_0x1356fb,_0x328ca4){const _0x78da3f=a30_0x242395,_0x405624=_0x328ca4['hasPeriod']&&_0x1356fb[_0x78da3f(0x1ec)]?.['length']?aggregateStageHistory(_0x1356fb[_0x78da3f(0x1ec)]):{'size':_0x1356fb[_0x78da3f(0x17f)],'entered':_0x1356fb[_0x78da3f(0x15b)],'milestone':_0x1356fb[_0x78da3f(0x16c)],'milestone_rate':_0x1356fb['completeMilestoneRate'],'exit_or_jump':_0x1356fb['exitOrJumpSize'],'exit_or_jump_rate':_0x1356fb[_0x78da3f(0x112)]},_0x41450a={'id':_0x1356fb['id'],'name':_0x328ca4[_0x78da3f(0x224)][_0x78da3f(0x151)](_0x1356fb['id'])??_0x1356fb['id'],..._0x405624};return _0x328ca4[_0x78da3f(0x13e)]&&_0x328ca4['includeHistory']&&_0x1356fb[_0x78da3f(0x1ec)]&&(_0x41450a['history']=_0x1356fb['history']),_0x41450a;}export class JourneyPauseCommand extends BaseCommand{[a30_0x242395(0x15f)]='journey:pause';[a30_0x242395(0x1dd)]='Pause\x20a\x20running\x20journey';async['execute'](_0x2c010c){const _0x651185=a30_0x242395,{options:_0x76018c,args:_0x10e3b0,tdx:_0x4dbb5c}=_0x2c010c,_0x3b01fe=_0x10e3b0[0x0];if(!requireNameOrPath(_0x3b01fe))return 0x1;_0x76018c[_0x651185(0x1b7)]&&console[_0x651185(0x11f)]('Input:\x20'+_0x3b01fe);const {journeyId:_0x4679af,journeyName:_0xab0547}=await resolveJourneyIdFromInput(_0x3b01fe,_0x76018c,_0x4dbb5c);if(!_0x76018c[_0x651185(0x22a)]){const _0x15044d=await confirm(_0x651185(0x217)+_0xab0547+'\x22?');if(!_0x15044d)return console['error'](_0x651185(0x194)),0x0;}const _0x702e59=await withSpinner(_0x651185(0x186),()=>_0x4dbb5c['journey'][_0x651185(0x201)](_0x4679af),{'verbose':_0x76018c[_0x651185(0x1b7)]}),_0x11b082=_0x702e59[_0x651185(0x1e4)];return console[_0x651185(0x11f)](_0x651185(0x193)+_0x11b082[_0x651185(0x182)][_0x651185(0x15f)]+_0x651185(0x116)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x115);[a30_0x242395(0x1dd)]=a30_0x242395(0x1b8);async['execute'](_0x48c1c8){const _0x432587=a30_0x242395,{options:_0x172b91,args:_0x3e39bf,tdx:_0x194e64}=_0x48c1c8,_0x4e3e36=_0x3e39bf[0x0];if(!requireNameOrPath(_0x4e3e36))return 0x1;_0x172b91[_0x432587(0x1b7)]&&console[_0x432587(0x11f)]('Input:\x20'+_0x4e3e36);const {journeyId:_0x84e5a2,journeyName:_0x30d2b6}=await resolveJourneyIdFromInput(_0x4e3e36,_0x172b91,_0x194e64);if(_0x172b91[_0x432587(0x1c7)])return await this[_0x432587(0x144)](_0x48c1c8,_0x84e5a2,_0x30d2b6);if(!_0x172b91['yes']){const _0x2e79bf=await confirm(_0x432587(0x184)+_0x30d2b6+'\x22?');if(!_0x2e79bf)return console[_0x432587(0x11f)](_0x432587(0x194)),0x0;}const _0x4102e0=await withSpinner(_0x432587(0x19b),()=>_0x194e64[_0x432587(0x149)][_0x432587(0x1af)](_0x84e5a2),{'verbose':_0x172b91[_0x432587(0x1b7)]}),_0x411348=_0x4102e0[_0x432587(0x1e4)],_0x357523=getWorkflowSessionUrl(_0x172b91[_0x432587(0x128)],_0x411348[_0x432587(0x19d)],_0x411348['workflowSessionId']);return console[_0x432587(0x11f)]('\x0a'+a30_0x247543[_0x432587(0x228)]('✔')+_0x432587(0x143)),console[_0x432587(0x11f)]('\x20\x20'+a30_0x247543[_0x432587(0x20e)](_0x432587(0x1cc))+'\x20'+_0x30d2b6),console['error']('\x20\x20'+a30_0x247543['dim'](_0x432587(0x1e8))+'\x20'+_0x411348['status']),console['error']('\x20\x20'+a30_0x247543[_0x432587(0x20e)](_0x432587(0x157))+'\x20'+_0x411348[_0x432587(0x189)]),console[_0x432587(0x11f)]('\x20\x20'+_0x357523),0x0;}async[a30_0x242395(0x144)](_0x5604a2,_0x40a2ee,_0x263704){const _0x46027d=a30_0x242395,{options:_0x26cd83,tdx:_0x17a1db}=_0x5604a2,_0x20fa1f=await withSpinner(_0x46027d(0x111)+_0x263704+_0x46027d(0x18f),()=>Promise[_0x46027d(0x141)]([_0x17a1db['journey'][_0x46027d(0x124)](_0x40a2ee),_0x17a1db[_0x46027d(0x149)][_0x46027d(0x1f5)](_0x40a2ee)]),{'verbose':_0x26cd83[_0x46027d(0x1b7)]}),[_0x572dc0,_0xd80b8e]=_0x20fa1f['data'],_0x337d5b=_0x572dc0[_0x46027d(0x182)],_0x6d2980=_0x337d5b[_0x46027d(0x1c9)];console[_0x46027d(0x129)](a30_0x247543['bold']('Journey:'),_0x337d5b[_0x46027d(0x15f)]),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x1d6)),_0x572dc0['id']),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x153)),_0x337d5b[_0x46027d(0x1fa)]),console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x18d)),_0x337d5b[_0x46027d(0x146)]?a30_0x247543['yellow'](_0x46027d(0x22a)):a30_0x247543[_0x46027d(0x228)]('no')),console[_0x46027d(0x129)](a30_0x247543['bold'](_0x46027d(0x14f)),_0x337d5b[_0x46027d(0x1d0)]);const _0x3076c2=_0x6d2980['length']>0x0?'\x20('+_0x6d2980[_0x46027d(0x210)](_0x49a650=>_0x49a650[_0x46027d(0x15f)])[_0x46027d(0x1ab)](',\x20')+')':'';console[_0x46027d(0x129)](a30_0x247543['bold']('Stages:'),''+_0x6d2980['length']+_0x3076c2),console[_0x46027d(0x129)]('');if(_0xd80b8e[_0x46027d(0x206)]===0x0)console['log'](a30_0x247543[_0x46027d(0x169)]('Activations:'),a30_0x247543[_0x46027d(0x20e)]('(none)'));else{console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x169)](_0x46027d(0x114)));for(const _0x58647c of _0xd80b8e){const _0x18c38c=_0x58647c[_0x46027d(0x15f)]??_0x46027d(0x1d7),_0xd604da=_0x58647c['connectionId']!=null?'connection\x20'+_0x58647c[_0x46027d(0x16b)]:_0x46027d(0x164),_0x30117d=_0x58647c[_0x46027d(0x1e7)]?''+_0x58647c[_0x46027d(0x1e7)]+(_0x58647c['runAt']?_0x46027d(0x1d2)+_0x58647c[_0x46027d(0x1ff)]:''):_0x46027d(0x12a),_0x5f2457=_0x58647c[_0x46027d(0x19c)]?'\x20[runs\x20on\x20refresh]':'';console[_0x46027d(0x129)]('\x20\x20'+a30_0x247543[_0x46027d(0x204)](_0x46027d(0x1a3))+'\x20'+_0x18c38c+_0x46027d(0x199)+_0xd604da+_0x46027d(0x1a0)+_0x30117d+_0x5f2457);}}return console[_0x46027d(0x129)](a30_0x247543[_0x46027d(0x204)](_0x46027d(0x1db))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x117);[a30_0x242395(0x1dd)]=a30_0x242395(0x188);async['execute'](_0x33dd85){const _0x402e69=a30_0x242395,{options:_0x5405bc,args:_0xcb0ef3,tdx:_0x5b27ac}=_0x33dd85,_0x19c49f=_0xcb0ef3[0x0];if(!requireNameOrPath(_0x19c49f))return 0x1;_0x5405bc[_0x402e69(0x1b7)]&&console[_0x402e69(0x11f)](_0x402e69(0x131)+_0x19c49f);const {journeyId:_0x418a3b,journeyName:_0x38a210}=await resolveJourneyIdFromInput(_0x19c49f,_0x5405bc,_0x5b27ac);if(_0x5405bc['dryRun'])return await this['executeDryRun'](_0x33dd85,_0x418a3b,_0x38a210);if(!_0x5405bc[_0x402e69(0x22a)]){const _0x54a7be=await confirm(_0x402e69(0x1f3)+_0x38a210+'\x22?');if(!_0x54a7be)return console[_0x402e69(0x11f)](_0x402e69(0x194)),0x0;}const _0x336852=await withSpinner('Resuming\x20journey...',()=>_0x5b27ac['journey']['resume'](_0x418a3b),{'verbose':_0x5405bc['verbose']}),_0x106385=_0x336852[_0x402e69(0x1e4)];return console[_0x402e69(0x11f)](_0x402e69(0x193)+_0x106385[_0x402e69(0x182)][_0x402e69(0x15f)]+_0x402e69(0x1e5)),0x0;}async[a30_0x242395(0x144)](_0x586c6b,_0x3363f5,_0x11a451){const _0x16285b=a30_0x242395,{options:_0x1066b8,tdx:_0xb3018a}=_0x586c6b,_0x18972b=await withSpinner(_0x16285b(0x111)+_0x11a451+_0x16285b(0x18f),()=>Promise[_0x16285b(0x141)]([_0xb3018a[_0x16285b(0x149)][_0x16285b(0x124)](_0x3363f5),_0xb3018a[_0x16285b(0x149)][_0x16285b(0x1f5)](_0x3363f5)]),{'verbose':_0x1066b8[_0x16285b(0x1b7)]}),[_0xf528ec,_0x576273]=_0x18972b[_0x16285b(0x1e4)],_0x143246=_0xf528ec['attributes'],_0x5873e4=_0x143246[_0x16285b(0x1c9)];console['log'](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1cc)),_0x143246[_0x16285b(0x15f)]),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1d6)),_0xf528ec['id']),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)]('State:'),_0x143246['state']),console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x18d)),_0x143246[_0x16285b(0x146)]?a30_0x247543[_0x16285b(0x204)](_0x16285b(0x22a)):a30_0x247543[_0x16285b(0x228)]('no'));_0x143246[_0x16285b(0x1f2)]&&console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x135)),_0x143246[_0x16285b(0x1f2)]);console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)]('Parent\x20segment\x20ID:'),_0x143246['audienceId']);const _0x2952d0=_0x5873e4[_0x16285b(0x206)]>0x0?'\x20('+_0x5873e4[_0x16285b(0x210)](_0x4ddce1=>_0x4ddce1[_0x16285b(0x15f)])[_0x16285b(0x1ab)](',\x20')+')':'';console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x1a2)),''+_0x5873e4[_0x16285b(0x206)]+_0x2952d0),console[_0x16285b(0x129)]('');if(_0x576273[_0x16285b(0x206)]===0x0)console['log'](a30_0x247543['bold']('Activations:'),a30_0x247543[_0x16285b(0x20e)](_0x16285b(0x227)));else{console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x169)](_0x16285b(0x114)));for(const _0x27642b of _0x576273){const _0x1e2af4=_0x27642b['name']??_0x16285b(0x1d7),_0x30f57f=_0x27642b[_0x16285b(0x16b)]!=null?_0x16285b(0x11a)+_0x27642b[_0x16285b(0x16b)]:_0x16285b(0x164),_0x559e87=_0x27642b[_0x16285b(0x1e7)]?''+_0x27642b[_0x16285b(0x1e7)]+(_0x27642b[_0x16285b(0x1ff)]?_0x16285b(0x1d2)+_0x27642b['runAt']:''):_0x16285b(0x12a),_0x2a9215=_0x27642b[_0x16285b(0x19c)]?'\x20[runs\x20on\x20refresh]':'';console[_0x16285b(0x129)]('\x20\x20'+a30_0x247543[_0x16285b(0x204)]('⚠️\x20')+'\x20'+_0x1e2af4+_0x16285b(0x199)+_0x30f57f+_0x16285b(0x1a0)+_0x559e87+_0x2a9215);}}return console[_0x16285b(0x129)](a30_0x247543[_0x16285b(0x204)]('\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.')),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a30_0x242395(0x1ea);[a30_0x242395(0x1dd)]=a30_0x242395(0x130);async[a30_0x242395(0x139)](_0x566d4f){const _0x296f44=a30_0x242395,{options:_0x4f27c4,args:_0x11ddc2,tdx:_0x252690}=_0x566d4f,_0x2a82c8=_0x4f27c4,_0x3ebbcc=_0x11ddc2[0x0],_0x12d0a2=_0x3ebbcc&&isYamlFilePath(_0x3ebbcc),_0x1dd5e3=await resolveTarget({'arg':_0x12d0a2?_0x3ebbcc:undefined,'contextParent':_0x4f27c4[_0x296f44(0x1c6)],'cwd':process[_0x296f44(0x136)]()});if(!isSuccessfulResolution(_0x1dd5e3))return _0x1dd5e3['errorCode']==='no_parent'?(console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x204)](_0x296f44(0x12c))),console['error']('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['error'](_0x296f44(0x161)),console[_0x296f44(0x11f)](_0x296f44(0x1b6)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a30_0x247543[_0x296f44(0x1d5)](_0x296f44(0x231)+_0x1dd5e3[_0x296f44(0x1a5)]+'\x0a')),_0x1dd5e3['helpText']&&console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x207)](_0x1dd5e3['helpText']))),0x1;let _0x16a0df=_0x12d0a2?undefined:_0x3ebbcc,_0x5a7a77,_0x4acf81;_0x1dd5e3[_0x296f44(0x208)]===_0x296f44(0x12b)&&(_0x16a0df=_0x1dd5e3[_0x296f44(0x1b9)],_0x5a7a77=_0x1dd5e3['filePath'],_0x4acf81=_0x1dd5e3[_0x296f44(0x1a6)]);const _0x5ba65b=_0x1dd5e3[_0x296f44(0x1ca)],_0x498ac7=_0x1dd5e3[_0x296f44(0x1c2)];_0x2a82c8[_0x296f44(0x1b7)]&&(console[_0x296f44(0x11f)](_0x296f44(0x1de)+_0x5ba65b),console[_0x296f44(0x11f)](_0x296f44(0x1b5)+_0x498ac7),_0x16a0df&&console['error'](_0x296f44(0x120)+_0x16a0df),_0x5a7a77&&console[_0x296f44(0x11f)](_0x296f44(0x213)+_0x5a7a77),_0x4acf81&&console[_0x296f44(0x11f)](_0x296f44(0x134)+_0x4acf81));const _0x255f4f=await withSpinner(_0x296f44(0x216),()=>_0x252690[_0x296f44(0x1ef)][_0x296f44(0x1e9)](_0x5ba65b),{'verbose':_0x4f27c4['verbose']}),_0x55c876=_0x255f4f['data'],{journeys:_0x39f31,folders:_0x316849}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x4bd0d3=_0x296f44,[_0x4afa34,_0x692e7f]=await Promise[_0x4bd0d3(0x141)]([_0x252690['journey'][_0x4bd0d3(0x211)](_0x55c876,undefined,{'includeAllVersions':!![]}),_0x252690[_0x4bd0d3(0x1ef)]['listFolders'](_0x55c876)]);return{'journeys':_0x4afa34,'folders':_0x692e7f};},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]})[_0x296f44(0x12e)](_0x2f44e4=>_0x2f44e4[_0x296f44(0x1e4)]);let _0xdd5270=_0x39f31;const _0x543ef7=buildFolderIdToPathMap(_0x316849);if(_0x16a0df){const _0x3e8f64=_0xdd5270[_0x296f44(0x1a9)](_0x433653=>_0x433653[_0x296f44(0x177)]['toLowerCase']()===_0x16a0df[_0x296f44(0x22c)]());if(_0x3e8f64[_0x296f44(0x206)]===0x0)return console[_0x296f44(0x11f)](_0x296f44(0x20b)+_0x16a0df),console[_0x296f44(0x11f)](_0x296f44(0x1ac)),0x1;_0xdd5270=_0x3e8f64;}if(_0x4acf81!==undefined){const _0x525d9a=_0xdd5270[_0x296f44(0x1a9)](_0x505ea6=>{const _0x17d037=_0x296f44,_0x4a4b23=_0x505ea6[_0x17d037(0x160)]?_0x543ef7['get'](_0x505ea6['folderId'])||'':'';return _0x4a4b23===_0x4acf81;});if(_0x525d9a[_0x296f44(0x206)]===0x0&&_0xdd5270[_0x296f44(0x206)]>0x0){console[_0x296f44(0x11f)](_0x296f44(0x1a7)+_0x16a0df+_0x296f44(0x150)+(_0x4acf81||_0x296f44(0x140))),console[_0x296f44(0x11f)]('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x433f39 of _0xdd5270){const _0x2922be=_0x433f39[_0x296f44(0x160)]?_0x543ef7['get'](_0x433f39['folderId'])||'':'';console[_0x296f44(0x11f)](_0x296f44(0x20d)+(_0x2922be||_0x296f44(0x1b2))+'/'+_0x433f39[_0x296f44(0x177)]);}return 0x1;}_0xdd5270=_0x525d9a;}if(_0xdd5270['length']===0x0)return console[_0x296f44(0x11f)](_0x296f44(0x19a)),0x0;const _0x445779=new Map();for(const _0x25d50f of _0xdd5270){const _0x172e5b=_0x25d50f[_0x296f44(0x15e)];!_0x445779[_0x296f44(0x1eb)](_0x172e5b)&&_0x445779[_0x296f44(0x16f)](_0x172e5b,[]),_0x445779[_0x296f44(0x151)](_0x172e5b)[_0x296f44(0x225)](_0x25d50f);}for(const _0x421de2 of _0x445779[_0x296f44(0x21b)]()){_0x421de2[_0x296f44(0x1fd)]((_0x590c3b,_0x217474)=>(_0x590c3b['versionNumber']||0x0)-(_0x217474[_0x296f44(0x13f)]||0x0));}const _0x1f2674=[],{idToEmailMap:_0x22682f,connectionIdToNameMap:_0x2a9b6}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x5efb58=_0x296f44,[_0x5c0a81,_0x24dc15]=await Promise[_0x5efb58(0x141)]([_0x252690[_0x5efb58(0x163)][_0x5efb58(0x18c)](),_0x252690[_0x5efb58(0x220)][_0x5efb58(0x17c)]()]);return{'idToEmailMap':_0x5c0a81,'connectionIdToNameMap':_0x24dc15};},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]})[_0x296f44(0x12e)](_0x5ae3ac=>_0x5ae3ac[_0x296f44(0x1e4)]);for(const _0x36703b of _0x445779[_0x296f44(0x21b)]()){const _0x2e5db8=_0x36703b[0x0][_0x296f44(0x177)],_0x1afd88=_0x36703b[0x0][_0x296f44(0x160)],_0x1f560f=_0x1afd88?_0x543ef7[_0x296f44(0x151)](_0x1afd88)||'':'',_0x4b541d=_0x1f560f?a30_0x326e95[_0x296f44(0x1ab)](_0x498ac7,_0x1f560f):_0x498ac7,_0x3aae6e=_0x5a7a77||a30_0x326e95[_0x296f44(0x1ab)](_0x4b541d,sanitizeFileName(_0x2e5db8)+_0x296f44(0x209));let _0x38ac90,_0x2e72f9;if(existsSync(_0x3aae6e))try{const _0x2c6387=readFileSync(_0x3aae6e,_0x296f44(0x1ee)),_0x507641=parseYamlString(_0x2c6387);_0x2e72f9=_0x507641,_0x38ac90=buildRuleToNameMapping(_0x507641),_0x2a82c8[_0x296f44(0x1b7)]&&_0x38ac90['size']>0x0&&console[_0x296f44(0x11f)](_0x296f44(0x12f)+_0x38ac90[_0x296f44(0x17f)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x2e5db8);}catch(_0x8d479d){_0x2a82c8[_0x296f44(0x1b7)]&&console[_0x296f44(0x11f)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x8d479d[_0x296f44(0x1a5)]);}const _0x4f20ce=[],_0x306c89=new Set(),_0x4babad=new Map(),_0x3f737b=new Map(),_0x52db2e=new Set(),_0x20b996=new Map(),_0x51415c=new Map(),_0x5e3625=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x2e5db8+_0x296f44(0x18f),async _0x4cde79=>{const _0x1bffc1=_0x296f44;for(const _0x20fe9c of _0x36703b){const _0x51b65b=_0x36703b[_0x1bffc1(0x206)]>0x1?_0x20fe9c['journeyBundleName']+'\x20v'+(_0x20fe9c[_0x1bffc1(0x13f)]||0x1):_0x20fe9c[_0x1bffc1(0x177)];_0x4cde79[_0x1bffc1(0x15a)]('Fetching\x20'+_0x51b65b);const _0x148ec9=await _0x252690[_0x1bffc1(0x149)][_0x1bffc1(0x124)](_0x20fe9c['id']),_0x5915f4=_0x148ec9[_0x1bffc1(0x182)]?.[_0x1bffc1(0x1d0)],_0x59b4bd={'resolveSegment':async _0x567f1e=>{const _0x2443f8=_0x1bffc1;if(!_0x5915f4)return{'name':_0x567f1e,'isJourneyLocal':![]};const _0x8ea0d8=_0x4babad[_0x2443f8(0x151)](_0x567f1e);if(_0x8ea0d8)return _0x8ea0d8;try{const _0x31688e=await _0x252690[_0x2443f8(0x1ef)][_0x2443f8(0x15c)](_0x5915f4,_0x567f1e),_0x2e4822=_0x31688e[_0x2443f8(0x14c)]===SEGMENT_KIND_JOURNEY;let _0x5b7836,_0x17eee0=_0x31688e[_0x2443f8(0x15f)];if(_0x2e4822&&_0x31688e[_0x2443f8(0x18e)]){const _0x242c3f=await segmentResponseToDef(_0x31688e,{'resolveSegmentName':async _0x9b76b5=>{const _0x228720=_0x2443f8,_0x323029=_0x4babad[_0x228720(0x151)](_0x9b76b5);if(_0x323029)return _0x323029[_0x228720(0x15f)];const _0x995b20=await _0x59b4bd[_0x228720(0x16a)](_0x9b76b5);return _0x995b20['name'];}}),_0x4e0534=_0x242c3f[_0x2443f8(0x18e)];_0x5b7836={'description':_0x31688e[_0x2443f8(0x1dd)],'rule':_0x4e0534};const _0x5c8ce8=serializeRule(_0x4e0534),_0x5d731b=_0x3f737b[_0x2443f8(0x151)](_0x5c8ce8);if(_0x5d731b)_0x17eee0=_0x5d731b,_0x5b7836=undefined,_0x2a82c8[_0x2443f8(0x1b7)]&&console[_0x2443f8(0x11f)](_0x2443f8(0x1d8)+_0x31688e[_0x2443f8(0x15f)]+'\x20->\x20'+_0x5d731b);else{let _0x2455d9=![];if(_0x38ac90){const _0xb39b51=_0x38ac90[_0x2443f8(0x151)](_0x5c8ce8);if(_0xb39b51){const _0x22cd1e=_0xb39b51[_0x2443f8(0x22b)](_0x5a8e9a=>!_0x306c89['has'](_0x5a8e9a));_0x22cd1e&&(_0x17eee0=_0x22cd1e,_0x306c89[_0x2443f8(0x142)](_0x22cd1e),_0x3f737b[_0x2443f8(0x16f)](_0x5c8ce8,_0x22cd1e),_0x2455d9=!![],_0x2a82c8['verbose']&&console[_0x2443f8(0x11f)](_0x2443f8(0x125)+_0x22cd1e+'\x20(rule\x20match)'));}}if(!_0x2455d9){const _0x68f4de=generateJourneyLocalName(_0x31688e[_0x2443f8(0x15f)]);_0x68f4de&&(_0x17eee0=_0x68f4de);let _0x5d58b8=_0x17eee0,_0x40c1ea=0x2;while(_0x306c89[_0x2443f8(0x1eb)](_0x5d58b8)){_0x5d58b8=_0x17eee0+'_'+_0x40c1ea,_0x40c1ea++;}_0x306c89[_0x2443f8(0x142)](_0x5d58b8),_0x3f737b['set'](_0x5c8ce8,_0x5d58b8),_0x17eee0=_0x5d58b8;}}}const _0x1aaf2f={'name':_0x17eee0,'isJourneyLocal':_0x2e4822,'definition':_0x5b7836};return _0x4babad[_0x2443f8(0x16f)](_0x567f1e,_0x1aaf2f),_0x1aaf2f;}catch(_0x325b3a){return _0x4f27c4['verbose']&&console[_0x2443f8(0x11f)](_0x2443f8(0x1dc)+_0x567f1e+':\x20'+_0x325b3a['message']),{'name':_0x567f1e,'isJourneyLocal':![]};}},'resolveActivation':async _0x53f4b0=>{const _0x334c33=_0x1bffc1,_0x4aef5a=_0x20b996['get'](_0x53f4b0);if(_0x4aef5a)return _0x4aef5a;try{const _0xe09e35=await _0x252690[_0x334c33(0x149)][_0x334c33(0x118)](_0x20fe9c['id'],_0x53f4b0),_0x77a5e1=journeyActivationStepToYaml(_0xe09e35,_0x22682f,_0x2a9b6),_0x3555d8=JSON['stringify']({'name':_0x77a5e1['name'],'connection':_0x77a5e1[_0x334c33(0x220)],'connector_config':_0x77a5e1[_0x334c33(0x171)]}),_0xd38ad5=_0x51415c['get'](_0x3555d8);if(_0xd38ad5){const _0x21f63f={'name':_0xd38ad5,'isJourneyLocal':!![],'definition':_0x77a5e1};return _0x20b996[_0x334c33(0x16f)](_0x53f4b0,_0x21f63f),_0x21f63f;}const _0x2f9c08=_0xe09e35[_0x334c33(0x182)][_0x334c33(0x19f)][_0x334c33(0x15f)]||_0x53f4b0,_0x4a26da=sanitizeYamlKey(_0x2f9c08)||_0x334c33(0x15d)+_0x53f4b0;let _0x227441=_0x4a26da,_0x1f0c7a=0x2;while(_0x52db2e[_0x334c33(0x1eb)](_0x227441)){_0x227441=_0x4a26da+'_'+_0x1f0c7a,_0x1f0c7a++;}_0x52db2e['add'](_0x227441),_0x51415c[_0x334c33(0x16f)](_0x3555d8,_0x227441);const _0x1569d9={'name':_0x227441,'isJourneyLocal':!![],'definition':_0x77a5e1};return _0x20b996[_0x334c33(0x16f)](_0x53f4b0,_0x1569d9),_0x1569d9;}catch(_0x21aea4){return _0x4f27c4[_0x334c33(0x1b7)]&&console[_0x334c33(0x11f)](_0x334c33(0x14a)+_0x53f4b0+':\x20'+_0x21aea4[_0x334c33(0x1a5)]),{'name':_0x53f4b0,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x35af3f,_0x1f3123)=>{const _0x1d498f=_0x1bffc1;return resolveJumpTarget(_0x35af3f,_0x1f3123,_0x5e3625,_0x12d3a4=>_0x252690[_0x1d498f(0x149)][_0x1d498f(0x124)](_0x12d3a4));}},_0x2c6232=await journeyResponseToDef(_0x148ec9,_0x59b4bd);_0x4f20ce[_0x1bffc1(0x225)]({'item':_0x20fe9c,'yaml':_0x2c6232});}},{'verbose':_0x4f27c4[_0x296f44(0x1b7)]});const _0x3608fb=await _0x252690[_0x296f44(0x149)]['getLatestJourneyId'](_0x36703b[0x0][_0x296f44(0x15e)]),_0x53f179=buildMergedJourneyDef(_0x4f20ce,_0x38ac90,_0x3608fb),_0x21f934=normalizeJourneyDef(_0x53f179,_0x2e72f9),_0x46cdee=toYamlString(_0x21f934),_0x4d4aa9=_0x5a7a77||a30_0x326e95[_0x296f44(0x1ab)](_0x4b541d,sanitizeFileName(_0x2e5db8)+'.journey.yml');!_0x5a7a77&&_0x1f560f&&!existsSync(_0x4b541d)&&mkdirSync(_0x4b541d,{'recursive':!![]});const _0x112b5d=a30_0x326e95[_0x296f44(0x190)](process[_0x296f44(0x136)](),_0x4d4aa9);if(existsSync(_0x4d4aa9)){const _0x5f0fb9=readFileSync(_0x4d4aa9,'utf-8'),_0x494894=generateDiff(_0x5f0fb9,_0x46cdee),_0x5b04e7=hasChanges(_0x494894);_0x1f2674[_0x296f44(0x225)]({'relativePath':_0x112b5d,'absolutePath':_0x4d4aa9,'content':_0x46cdee,'isNew':![],'hasChanges':_0x5b04e7,'diff':_0x5b04e7?formatDiffWithColors(_0x494894):undefined});}else _0x1f2674[_0x296f44(0x225)]({'relativePath':_0x112b5d,'absolutePath':_0x4d4aa9,'content':_0x46cdee,'isNew':!![],'hasChanges':![]});}const _0x4bc1cb=_0x1f2674[_0x296f44(0x1a9)](_0x5a8d04=>_0x5a8d04['isNew']),_0x42f045=_0x1f2674['filter'](_0x3679d4=>!_0x3679d4['isNew']&&_0x3679d4['hasChanges']),_0x36d61b=_0x1f2674[_0x296f44(0x1a9)](_0x3766e4=>!_0x3766e4[_0x296f44(0x1ed)]&&!_0x3766e4[_0x296f44(0x232)]),_0x297db0=_0xdd5270['length'],_0x5efce8=_0x445779['size'],_0x379d4f=_0x297db0>_0x5efce8?'\x20('+_0x297db0+_0x296f44(0x1ae):'';console[_0x296f44(0x11f)](_0x296f44(0x180)),console['error']('\x20\x20'+a30_0x247543[_0x296f44(0x207)](_0x5efce8+'\x20journeys')+a30_0x247543[_0x296f44(0x20e)](_0x379d4f)),console[_0x296f44(0x11f)]('\x20\x20'+a30_0x247543['green']('+\x20'+_0x4bc1cb['length']+_0x296f44(0x13b))),console['error']('\x20\x20'+a30_0x247543[_0x296f44(0x204)]('~\x20'+_0x42f045['length']+_0x296f44(0x20c))),console[_0x296f44(0x11f)]('\x20\x20'+a30_0x247543[_0x296f44(0x20e)]('=\x20'+_0x36d61b[_0x296f44(0x206)]+'\x20unchanged\x20files')),console[_0x296f44(0x11f)](_0x296f44(0x122)+a30_0x247543['cyan'](_0x498ac7)+'\x0a');if(_0x42f045[_0x296f44(0x206)]>0x0)for(const _0x15ec7c of _0x42f045){console[_0x296f44(0x11f)]('\x0aChanges\x20to\x20\x27'+_0x15ec7c[_0x296f44(0x1a8)]+'\x27:'),console[_0x296f44(0x11f)]('─'[_0x296f44(0x1c0)](0x3c)),console['error'](_0x15ec7c[_0x296f44(0x17d)]),console[_0x296f44(0x11f)]('─'[_0x296f44(0x1c0)](0x3c));}if(_0x2a82c8['dryRun'])return console['error'](a30_0x247543['yellow'](_0x296f44(0x192))),0x0;if(_0x4bc1cb[_0x296f44(0x206)]===0x0&&_0x42f045[_0x296f44(0x206)]===0x0)return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x21c))),saveSessionContext({'parent_segment':_0x5ba65b},_0x2a82c8['session']),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x16d)+a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x11d))+_0x296f44(0x154)+a30_0x247543[_0x296f44(0x207)](_0x5ba65b))),0x0;if(!_0x2a82c8[_0x296f44(0x22a)]&&(_0x4bc1cb[_0x296f44(0x206)]>0x0||_0x42f045[_0x296f44(0x206)]>0x0)){if(!isInteractive())return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x1d5)](_0x296f44(0x156)),_0x296f44(0x1fc)),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x21f))),0x1;const _0x5b8689=await confirmKey(_0x296f44(0x1bc)+(_0x4bc1cb[_0x296f44(0x206)]+_0x42f045[_0x296f44(0x206)])+_0x296f44(0x166));if(!_0x5b8689)return console['error'](a30_0x247543['yellow'](_0x296f44(0x1c4)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x498ac7)&&mkdirSync(_0x498ac7,{'recursive':!![]});const _0x471f01=a30_0x326e95[_0x296f44(0x1ab)](_0x498ac7,_0x296f44(0x1f9));writeFileSync(_0x471f01,createTdxConfigContent(_0x5ba65b),_0x296f44(0x1ee));for(const _0x110952 of _0x1f2674){(_0x110952[_0x296f44(0x1ed)]||_0x110952[_0x296f44(0x232)])&&writeFileSync(_0x110952[_0x296f44(0x172)],_0x110952[_0x296f44(0x173)],_0x296f44(0x1ee));}return console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)]('✔\x20Pulled\x20'+(_0x4bc1cb['length']+_0x42f045[_0x296f44(0x206)])+_0x296f44(0x230)+_0x498ac7)),saveSessionContext({'parent_segment':_0x5ba65b},_0x2a82c8[_0x296f44(0x21e)]),console[_0x296f44(0x11f)](a30_0x247543[_0x296f44(0x228)](_0x296f44(0x16d)+a30_0x247543[_0x296f44(0x20e)](_0x296f44(0x11d))+_0x296f44(0x154)+a30_0x247543['cyan'](_0x5ba65b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1da);[a30_0x242395(0x1dd)]=a30_0x242395(0x127);async[a30_0x242395(0x139)](_0x4934c7){const _0xccda4a=a30_0x242395,{options:_0x281868,args:_0x3d54e7,tdx:_0x19d69d}=_0x4934c7,_0x5747fd=_0x3d54e7[0x0];if(!requireNameOrPath(_0x5747fd))return 0x1;_0x281868[_0xccda4a(0x1b7)]&&console[_0xccda4a(0x11f)]('Input:\x20'+_0x5747fd);const {journeyId:_0x6691f8}=await resolveJourneyIdFromInput(_0x5747fd,_0x281868,_0x19d69d),_0x5b096e=await withSpinner(_0xccda4a(0x123),()=>_0x19d69d[_0xccda4a(0x149)]['getColumnMapping'](_0x6691f8),{'verbose':_0x281868[_0xccda4a(0x1b7)]}),_0x431a33=_0x5b096e[_0xccda4a(0x1e4)];return console[_0xccda4a(0x129)](_0xccda4a(0x1bb)+_0x431a33[_0xccda4a(0x1ba)]),console['log'](_0xccda4a(0x175)+_0x431a33[_0xccda4a(0x132)]),await handleSDKOutput(_0x431a33[_0xccda4a(0x11b)],_0x281868),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x170);['description']='List\x20activations\x20for\x20a\x20journey';async[a30_0x242395(0x139)](_0x438b93){const _0x48541f=a30_0x242395,{options:_0x5cb539,args:_0x501ecb,tdx:_0x4e5c58}=_0x438b93,_0x4ce543=_0x501ecb[0x0];if(!requireNameOrPath(_0x4ce543))return 0x1;_0x5cb539[_0x48541f(0x1b7)]&&console[_0x48541f(0x11f)](_0x48541f(0x131)+_0x4ce543);const {journeyId:_0x5a9e02}=await resolveJourneyIdFromInput(_0x4ce543,_0x5cb539,_0x4e5c58),_0x4fba4d=await withSpinner(_0x48541f(0x1a1),()=>_0x4e5c58[_0x48541f(0x149)][_0x48541f(0x1f5)](_0x5a9e02),{'verbose':_0x5cb539[_0x48541f(0x1b7)]}),_0x35cb3d=_0x4fba4d[_0x48541f(0x1e4)];return console[_0x48541f(0x11f)]('Found\x20'+_0x35cb3d[_0x48541f(0x206)]+'\x20activation'+(_0x35cb3d[_0x48541f(0x206)]!==0x1?'s':'')),await handleSDKOutput(_0x35cb3d,_0x5cb539),0x0;}}export class JourneyPushCommand extends BaseCommand{[a30_0x242395(0x15f)]='journey:push';['description']=a30_0x242395(0x21d);[a30_0x242395(0x11e)]=new SegmentPushCommand();async['execute'](_0x125e68){const _0x210a29=a30_0x242395,_0x7acc73=_0x125e68['args'][0x0];let _0x375bc4;if(_0x7acc73){const _0x2084ae=await resolveTarget({'arg':_0x7acc73,'contextParent':_0x125e68['options'][_0x210a29(0x1c6)],'cwd':process['cwd']()});isSuccessfulResolution(_0x2084ae)&&_0x2084ae[_0x210a29(0x208)]===_0x210a29(0x12b)&&(_0x375bc4=_0x2084ae[_0x210a29(0x119)]);}const _0x218290={..._0x125e68,'options':{..._0x125e68['options'],'journeysOnly':!![],..._0x375bc4&&{'singleFilePath':_0x375bc4}}};return this['segmentPushCommand']['execute'](_0x218290);}}export class JourneyVersionsCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x185);[a30_0x242395(0x1dd)]=a30_0x242395(0x22d);async[a30_0x242395(0x139)](_0x149551){const _0x23fbd0=a30_0x242395,{options:_0x2ea128,args:_0x30b25b,tdx:_0x1eedda}=_0x149551,_0x35e7c6=_0x30b25b[0x0];if(!requireNameOrPath(_0x35e7c6))return 0x1;if(_0x2ea128['verbose'])console[_0x23fbd0(0x11f)](_0x23fbd0(0x131)+_0x35e7c6);const {journeyId:_0x511d43}=await resolveJourneyIdFromInput(_0x35e7c6,_0x2ea128,_0x1eedda),_0x1230fd=await withSpinner(_0x23fbd0(0x1be),()=>_0x1eedda[_0x23fbd0(0x149)]['listVersions'](_0x511d43),{'verbose':_0x2ea128[_0x23fbd0(0x1b7)]}),{bundleName:_0x2bcc3a,versions:_0x4833be,latestJourneyId:_0x162361}=_0x1230fd['data'];console['error'](_0x2bcc3a+':\x20'+_0x4833be[_0x23fbd0(0x206)]+_0x23fbd0(0x13a)+(_0x4833be[_0x23fbd0(0x206)]!==0x1?'s':''));const _0x1be073=_0x4833be[_0x23fbd0(0x210)](_0x57409d=>({'version':_0x57409d[_0x23fbd0(0x13f)],'journey_id':_0x57409d[_0x23fbd0(0x229)],'name':_0x57409d['name'],'state':_0x57409d['state'],'paused':_0x57409d[_0x23fbd0(0x146)],'latest':_0x57409d['journeyId']===_0x162361,'created_at':_0x57409d[_0x23fbd0(0x191)]}));return await handleSDKOutput(_0x1be073,_0x2ea128),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x1d4);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a30_0x242395(0x139)](_0x2478b6){const _0x462110=a30_0x242395,{options:_0x406056,args:_0x47ba17,tdx:_0x47eadb}=_0x2478b6,_0x4d9dad=_0x47ba17[0x0];if(!requireNameOrPath(_0x4d9dad))return 0x1;if(_0x406056[_0x462110(0x1b7)])console['error']('Input:\x20'+_0x4d9dad);const {journeyId:_0x1977e3,journeyName:_0x53adb2}=await resolveJourneyIdFromInput(_0x4d9dad,_0x406056,_0x47eadb);if(!_0x406056[_0x462110(0x22a)]){const _0x2cf70d=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x53adb2+'\x22?');if(!_0x2cf70d)return console[_0x462110(0x11f)]('Cancelled'),0x0;}const _0x26e8c1=await withSpinner('Creating\x20new\x20version...',()=>_0x47eadb['journey']['createVersion'](_0x1977e3),{'verbose':_0x406056[_0x462110(0x1b7)]}),_0x3ecf46=_0x26e8c1[_0x462110(0x1e4)];return console['error'](a30_0x247543[_0x462110(0x228)]('\u2714')+'\x20Created\x20v'+_0x3ecf46[_0x462110(0x182)][_0x462110(0x13f)]+_0x462110(0x1e6)+_0x3ecf46[_0x462110(0x182)][_0x462110(0x15f)]+'\x22'),console['error']('\x20\x20Journey\x20ID:\x20'+_0x3ecf46['id']),await handleSingleObjectOutput({'id':_0x3ecf46['id'],'name':_0x3ecf46['attributes'][_0x462110(0x15f)],'version':_0x3ecf46[_0x462110(0x182)][_0x462110(0x13f)],'state':_0x3ecf46[_0x462110(0x182)][_0x462110(0x1fa)],'bundle_id':_0x3ecf46[_0x462110(0x182)][_0x462110(0x15e)],'created_at':_0x3ecf46['attributes'][_0x462110(0x191)]},_0x406056),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a30_0x242395(0x15f)]=a30_0x242395(0x215);['description']='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async['execute'](_0x588c05){const _0x1f0169=a30_0x242395,{options:_0x84a606,args:_0xaaf78b,tdx:_0x53d5b0}=_0x588c05,_0x12fa7d=_0xaaf78b[0x0];if(!requireNameOrPath(_0x12fa7d))return 0x1;const _0x33f5c6=_0x84a606[_0x1f0169(0x176)];if(!_0x33f5c6)return console[_0x1f0169(0x11f)](_0x1f0169(0x1ce)),console[_0x1f0169(0x11f)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x43cfaa=parseInt(_0x33f5c6,0xa);if(isNaN(_0x43cfaa)||_0x43cfaa<0x1)return console[_0x1f0169(0x11f)](_0x1f0169(0x1cd)+_0x33f5c6),0x1;if(_0x84a606['verbose'])console[_0x1f0169(0x11f)](_0x1f0169(0x131)+_0x12fa7d+',\x20version:\x20'+_0x43cfaa);const {journeyId:_0x554e84,parentSegmentId:_0x28d766}=await resolveJourneyIdFromInput(_0x12fa7d,_0x84a606,_0x53d5b0),_0x4ae5d2=await withSpinner(_0x1f0169(0x195),()=>_0x53d5b0[_0x1f0169(0x149)][_0x1f0169(0x1f8)](_0x554e84),{'verbose':_0x84a606['verbose']}),{versions:_0x53bc8c,latestJourneyId:_0x28b381}=_0x4ae5d2[_0x1f0169(0x1e4)],_0x4a2a04=_0x53bc8c[_0x1f0169(0x22b)](_0x228c2e=>_0x228c2e[_0x1f0169(0x13f)]===_0x43cfaa);if(!_0x4a2a04){const _0x328891=_0x53bc8c['map'](_0x2dd069=>'v'+_0x2dd069[_0x1f0169(0x13f)])[_0x1f0169(0x1ab)](',\x20');return console['error']('Error:\x20Version\x20'+_0x43cfaa+_0x1f0169(0x138)+_0x328891),0x1;}const _0x36e5c1=await withSpinner('Getting\x20version\x20'+_0x43cfaa+_0x1f0169(0x159),()=>_0x53d5b0[_0x1f0169(0x149)][_0x1f0169(0x124)](_0x4a2a04[_0x1f0169(0x229)]),{'verbose':_0x84a606[_0x1f0169(0x1b7)]}),_0x70cec9=_0x36e5c1[_0x1f0169(0x1e4)],_0x264427=getConsoleNextUrl(_0x84a606[_0x1f0169(0x128)],_0x1f0169(0x1ad)+_0x28d766+_0x1f0169(0x1b4)+_0x4a2a04[_0x1f0169(0x229)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x70cec9['id'],'name':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x15f)],'version':_0x70cec9[_0x1f0169(0x182)]['versionNumber'],'description':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1dd)],'state':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1fa)],'paused':_0x70cec9['attributes'][_0x1f0169(0x146)],'reentry_mode':_0x70cec9[_0x1f0169(0x182)]['reentryMode'],'stages':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1c9)]?.['length']||0x0,..._0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x212)]&&{'goal':_0x70cec9[_0x1f0169(0x182)]['goal'][_0x1f0169(0x15f)]},'latest':_0x4a2a04['journeyId']===_0x28b381,'created_at':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x191)],'updated_at':_0x70cec9[_0x1f0169(0x182)][_0x1f0169(0x1c5)],'url':_0x264427},_0x84a606),0x0;}}
|