@treasuredata/tdx 2026.7.6 β 2026.8.1
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.d.ts +9 -0
- package/dist/commands/auth-command.d.ts.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 +10 -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/auth-token.d.ts +23 -0
- package/dist/sdk/auth-token.d.ts.map +1 -0
- package/dist/sdk/auth-token.js +1 -0
- package/dist/sdk/auth-token.js.map +1 -0
- 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.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.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 -2
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.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/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
|
-
const
|
|
1
|
+
const a26_0x191daf=a26_0x2b33;(function(_0x4192eb,_0x1738ed){const _0x13b02e=a26_0x2b33,_0x12033b=_0x4192eb();while(!![]){try{const _0x595fac=-parseInt(_0x13b02e(0x1a9))/0x1+-parseInt(_0x13b02e(0x1c3))/0x2*(-parseInt(_0x13b02e(0x19a))/0x3)+-parseInt(_0x13b02e(0x1be))/0x4*(-parseInt(_0x13b02e(0x1ad))/0x5)+-parseInt(_0x13b02e(0x1cf))/0x6*(-parseInt(_0x13b02e(0x19f))/0x7)+parseInt(_0x13b02e(0x1af))/0x8+-parseInt(_0x13b02e(0x195))/0x9*(-parseInt(_0x13b02e(0x1a0))/0xa)+-parseInt(_0x13b02e(0x1c8))/0xb*(parseInt(_0x13b02e(0x19b))/0xc);if(_0x595fac===_0x1738ed)break;else _0x12033b['push'](_0x12033b['shift']());}catch(_0x48c48c){_0x12033b['push'](_0x12033b['shift']());}}}(a26_0x5770,0xdc2fd));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';function a26_0x5770(){const _0x28e2b1=['No\x20templates\x20found\x20in\x20workspace\x20\x27','description','diff','\x20files?','Workspace\x20is\x20required.','cwd','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20=\x20','β\x20All\x20files\x20are\x20up\x20to\x20date','relativePath','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','\x20templates','\x20\x20Target:\x20','hasChanges','98844kqbylJ','workspaceName','β\x20Pulled\x20','dirname','green','12056PLuwmH','absolutePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','red','utf-8','22nrkOqH','name','engage','repeat','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aChanges\x20to\x20\x27','config','2765778eIIMgc','setPhase','counts','filter','engage:template:pull','yellow','verbose','isNew','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aError:','engage_workspace','2214396oKSgoq','session','targetDir','Write\x20','templates','33BvIIYK','12479436zEcayG','\x0aPull\x20summary\x20for\x20workspace\x20\x27','workspace','content','21lwRzIE','70kqhKci','files','error','length','\x20changed\x20files','dim','cyan','\x27...','Pull\x20templates\x20to\x20YAML\x20files','1083689GunQrB','\x20files\x20to\x20','data','dryRun','155OBIILQ','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1023472rPFGiX'];a26_0x5770=function(){return _0x28e2b1;};return a26_0x5770();}import a26_0x42d3a0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a26_0x2b33(_0x3ed03d,_0x501f24){_0x3ed03d=_0x3ed03d-0x18d;const _0x577028=a26_0x5770();let _0x2b334f=_0x577028[_0x3ed03d];return _0x2b334f;}import a26_0xf6ce83 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a26_0x191daf(0x1c9)]=a26_0x191daf(0x18d);[a26_0x191daf(0x1b1)]=a26_0x191daf(0x1a8);async[a26_0x191daf(0x191)](_0x3d8ed5){const _0x9912e8=a26_0x191daf,{options:_0x14f280,args:_0x1e6193,tdx:_0x44257a}=_0x3d8ed5,_0x36a6a4=_0x14f280,_0x284964=await resolveWorkspaceName(_0x1e6193[0x0],_0x36a6a4);if(!_0x284964)return console['error'](a26_0x42d3a0[_0x9912e8(0x18e)](_0x9912e8(0x1b4))),console['error'](_0x9912e8(0x1ba)),console[_0x9912e8(0x1a2)](_0x9912e8(0x1c5)),console[_0x9912e8(0x1a2)](_0x9912e8(0x1cc)),0x1;const _0x50a2c0=await withProgressSpinner('Pulling\x20templates\x20from\x20\x27'+_0x284964+_0x9912e8(0x1a7),_0x40b171=>pullTemplates({'engage':_0x44257a[_0x9912e8(0x1ca)]},_0x284964,{'templateName':_0x36a6a4[_0x9912e8(0x1c9)],'progress':{'update':_0x58577a=>{const _0x4c3315=_0x9912e8;_0x40b171[_0x4c3315(0x1d0)](_0x58577a);}}}),{'verbose':_0x36a6a4[_0x9912e8(0x18f)]}),_0x44151e=_0x50a2c0[_0x9912e8(0x1ab)];if(_0x44151e[_0x9912e8(0x1d1)][_0x9912e8(0x199)]===0x0)return console[_0x9912e8(0x1a2)](a26_0x42d3a0['yellow'](_0x9912e8(0x1b0)+_0x44151e[_0x9912e8(0x1bf)]+'\x27')),0x0;const _0x4a0581=_0x44151e[_0x9912e8(0x1a1)][_0x9912e8(0x1d2)](_0x4470fa=>_0x4470fa[_0x9912e8(0x190)]),_0x4aac91=_0x44151e[_0x9912e8(0x1a1)][_0x9912e8(0x1d2)](_0x248691=>!_0x248691[_0x9912e8(0x190)]&&_0x248691[_0x9912e8(0x1bd)]),_0x3ea616=_0x44151e[_0x9912e8(0x1a1)][_0x9912e8(0x1d2)](_0xe0c86=>!_0xe0c86[_0x9912e8(0x190)]&&!_0xe0c86[_0x9912e8(0x1bd)]);console[_0x9912e8(0x1a2)](_0x9912e8(0x19c)+_0x44151e[_0x9912e8(0x1bf)]+'\x27:'),console['error']('\x20\x20'+a26_0x42d3a0['cyan'](_0x44151e[_0x9912e8(0x1d1)][_0x9912e8(0x199)]+_0x9912e8(0x1bb))),console[_0x9912e8(0x1a2)]('\x20\x20'+a26_0x42d3a0[_0x9912e8(0x1c2)]('+\x20'+_0x4a0581[_0x9912e8(0x1a3)]+'\x20new\x20files')),console[_0x9912e8(0x1a2)]('\x20\x20'+a26_0x42d3a0['yellow']('~\x20'+_0x4aac91[_0x9912e8(0x1a3)]+_0x9912e8(0x1a4))),console[_0x9912e8(0x1a2)]('\x20\x20'+a26_0x42d3a0[_0x9912e8(0x1a5)]('=\x20'+_0x3ea616[_0x9912e8(0x1a3)]+'\x20unchanged\x20files')),console['error'](_0x9912e8(0x1bc)+a26_0x42d3a0[_0x9912e8(0x1a6)](_0x44151e['targetDir'])+'\x0a');if(_0x4aac91[_0x9912e8(0x1a3)]>0x0)for(const _0x33eec2 of _0x4aac91){console[_0x9912e8(0x1a2)](_0x9912e8(0x1cd)+_0x33eec2[_0x9912e8(0x1b9)]+'\x27:'),console['error']('\u2500'[_0x9912e8(0x1cb)](0x3c)),console[_0x9912e8(0x1a2)](_0x33eec2[_0x9912e8(0x1b2)]),console[_0x9912e8(0x1a2)]('\u2500'['repeat'](0x3c));}if(_0x36a6a4[_0x9912e8(0x1ac)])return console[_0x9912e8(0x1a2)](a26_0x42d3a0[_0x9912e8(0x18e)](_0x9912e8(0x1b6))),0x0;if(_0x4a0581[_0x9912e8(0x1a3)]===0x0&&_0x4aac91[_0x9912e8(0x1a3)]===0x0)return console[_0x9912e8(0x1a2)](a26_0x42d3a0[_0x9912e8(0x1c2)](_0x9912e8(0x1b8))),saveSessionContext({'engage_workspace':_0x44151e[_0x9912e8(0x1bf)]},_0x36a6a4['session']),0x0;if(!_0x36a6a4['yes']){if(!isInteractive())return console[_0x9912e8(0x1a2)](a26_0x42d3a0[_0x9912e8(0x1c6)](_0x9912e8(0x193)),_0x9912e8(0x192)),console[_0x9912e8(0x1a2)](a26_0x42d3a0[_0x9912e8(0x1a5)](_0x9912e8(0x1ae))),0x1;const _0x127940=await confirmKey(_0x9912e8(0x198)+(_0x4a0581[_0x9912e8(0x1a3)]+_0x4aac91[_0x9912e8(0x1a3)])+_0x9912e8(0x1b3));if(!_0x127940)return console[_0x9912e8(0x1a2)](a26_0x42d3a0[_0x9912e8(0x18e)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x58c659 of _0x44151e['files']){if(_0x58c659[_0x9912e8(0x190)]||_0x58c659[_0x9912e8(0x1bd)]){const _0x4668f0=a26_0xf6ce83[_0x9912e8(0x1c1)](_0x58c659[_0x9912e8(0x1c4)]);!existsSync(_0x4668f0)&&mkdirSync(_0x4668f0,{'recursive':!![]}),writeFileSync(_0x58c659[_0x9912e8(0x1c4)],_0x58c659[_0x9912e8(0x19e)],_0x9912e8(0x1c7));}}return console[_0x9912e8(0x1a2)](a26_0x42d3a0[_0x9912e8(0x1c2)](_0x9912e8(0x1c0)+(_0x4a0581['length']+_0x4aac91['length'])+_0x9912e8(0x1aa)+_0x44151e[_0x9912e8(0x197)])),saveSessionContext({'engage_workspace':_0x44151e['workspaceName']},_0x36a6a4['session']),console[_0x9912e8(0x1a2)](a26_0x42d3a0['green']('β\x20Context\x20set:\x20'+a26_0x42d3a0[_0x9912e8(0x1a5)](_0x9912e8(0x194))+_0x9912e8(0x1b7)+a26_0x42d3a0['cyan'](_0x44151e[_0x9912e8(0x1bf)]))),0x0;}}async function resolveWorkspaceName(_0x255a37,_0x27dfc0){const _0x28f50a=a26_0x191daf;if(_0x255a37)return _0x255a37;if(_0x27dfc0[_0x28f50a(0x19d)])return _0x27dfc0[_0x28f50a(0x19d)];const _0x27fa3c=tryFindTdxConfig(process[_0x28f50a(0x1b5)]());if(_0x27fa3c?.[_0x28f50a(0x1ce)][_0x28f50a(0x194)])return _0x27fa3c['config'][_0x28f50a(0x194)];const _0x3a6b92=loadSessionContext(_0x27dfc0[_0x28f50a(0x196)]);if(_0x3a6b92?.[_0x28f50a(0x194)])return _0x3a6b92['engage_workspace'];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x3aa2cf=a24_0x3fc4;(function(_0x158bc8,_0x23a2d3){const _0x246e41=a24_0x3fc4,_0x296348=_0x158bc8();while(!![]){try{const _0x448dbe=parseInt(_0x246e41(0x20d))/0x1+-parseInt(_0x246e41(0x203))/0x2+parseInt(_0x246e41(0x21b))/0x3*(-parseInt(_0x246e41(0x213))/0x4)+-parseInt(_0x246e41(0x20b))/0x5+parseInt(_0x246e41(0x20c))/0x6*(-parseInt(_0x246e41(0x202))/0x7)+-parseInt(_0x246e41(0x1f7))/0x8+-parseInt(_0x246e41(0x20a))/0x9*(-parseInt(_0x246e41(0x205))/0xa);if(_0x448dbe===_0x23a2d3)break;else _0x296348['push'](_0x296348['shift']());}catch(_0x1d2352){_0x296348['push'](_0x296348['shift']());}}}(a24_0x28e6,0x6ced3));import{BaseCommand}from'./command.js';function a24_0x3fc4(_0x12c48c,_0x556015){_0x12c48c=_0x12c48c-0x1e6;const _0x28e66e=a24_0x28e6();let _0x3fc426=_0x28e66e[_0x12c48c];return _0x3fc426;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a24_0x28e6(){const _0x3cf864=['448556qPXkrU','filter','valid','red','\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)','dryRun','name','3DQBIts','session','\x20templates','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','verbose','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','error','setPhase','created','Preparing\x20push\x20to\x20workspace\x20\x27','cwd','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','green','engage_workspace','\x20\x20\x20\x20','errors','dim','cyan','\x0aError:','\x0aValidation\x20errors\x20in\x20','results','config','\x20errors:','Push\x20','path','message','def','resolveWorkspaceId','yellow','β\x20Updated\x20','dirname','action','resolve','2403968nlDrWo','Resolving\x20references...','warnings','Aborted.','\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','engage','Workspace\x20is\x20required.','\x20templates?','\x20templates\x20to\x20update:','updated','No\x20template\x20YAML\x20files\x20found\x20in\x20','3108YRSffc','735676GCyILV','execute','4663210wfsuZS','\x0aPush\x20summary\x20for\x20workspace\x20\x27','configDir','workspace','data','27rWLzEn','1259255SnFlBX','3624YNjciM','347700GnRxAz','β\x20All\x20templates\x20are\x20up\x20to\x20date','site','relativePath','Pushing\x20templates...','update'];a24_0x28e6=function(){return _0x3cf864;};return a24_0x28e6();}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_0x653739 from'chalk';import a24_0x376ed8 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{['name']='engage:template:push';['description']=a24_0x3aa2cf(0x226);async[a24_0x3aa2cf(0x204)](_0x31d0e4){const _0x5f0de7=a24_0x3aa2cf,{options:_0x78723e,args:_0x3f1c62,tdx:_0x2b8dde}=_0x31d0e4,_0x1ed584=_0x78723e,_0x3bd3df=_0x3f1c62[0x0],_0x4f2180=_0x3bd3df?a24_0x376ed8[_0x5f0de7(0x1f6)](_0x3bd3df):undefined,_0x5a5928=_0x4f2180?isYamlFile(_0x4f2180):![];let _0x2a3444;if(_0x5a5928&&_0x4f2180)_0x2a3444=a24_0x376ed8['dirname'](_0x4f2180);else _0x4f2180?_0x2a3444=_0x4f2180:_0x2a3444=process[_0x5f0de7(0x225)]();let _0x41392f;const _0x20577a=tryFindTdxConfig(_0x2a3444);_0x20577a?.[_0x5f0de7(0x1eb)][_0x5f0de7(0x22b)]&&(_0x41392f=_0x20577a['config'][_0x5f0de7(0x22b)],!_0x5a5928&&(_0x2a3444=_0x20577a[_0x5f0de7(0x207)]));_0x1ed584[_0x5f0de7(0x208)]&&(_0x41392f=_0x1ed584[_0x5f0de7(0x208)]);if(!_0x41392f){const _0x3662c1=loadSessionContext(_0x1ed584['session']);_0x3662c1?.[_0x5f0de7(0x22b)]&&(_0x41392f=_0x3662c1[_0x5f0de7(0x22b)]);}if(!_0x41392f)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1f2)](_0x5f0de7(0x1fd))),console[_0x5f0de7(0x221)]('\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[_0x5f0de7(0x221)](_0x5f0de7(0x218)),console['error'](_0x5f0de7(0x1fb)),console[_0x5f0de7(0x221)](_0x5f0de7(0x229)),0x1;let _0x3b0d6d;_0x5a5928&&_0x4f2180?_0x3b0d6d=[parseTemplateFile(_0x4f2180,a24_0x376ed8[_0x5f0de7(0x1f4)](_0x4f2180))]:_0x3b0d6d=discoverAndParseTemplateFiles(_0x2a3444);if(_0x3b0d6d['length']===0x0)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1f2)](_0x5f0de7(0x201)+_0x2a3444)),console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1e6)](_0x5f0de7(0x21e))),0x1;const _0x47d026=_0x3b0d6d[_0x5f0de7(0x228)]===0x1?'1\x20template\x20file:\x20'+_0x3b0d6d[0x0][_0x5f0de7(0x1f0)][_0x5f0de7(0x21a)]:_0x3b0d6d[_0x5f0de7(0x228)]+'\x20template\x20files';console[_0x5f0de7(0x221)]('Found\x20'+a24_0x653739[_0x5f0de7(0x1e7)](_0x47d026));let _0x315044=![];for(const _0x15e174 of _0x3b0d6d){const _0x5c6b50=validateTemplateDef(_0x15e174[_0x5f0de7(0x1f0)]);if(!_0x5c6b50[_0x5f0de7(0x215)]){_0x315044=!![],console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x216)](_0x5f0de7(0x1e9)+_0x15e174[_0x5f0de7(0x210)]+':'));for(const _0x43e60b of _0x5c6b50[_0x5f0de7(0x22d)]){console['error']('\x20\x20'+a24_0x653739[_0x5f0de7(0x216)]('β')+'\x20'+_0x43e60b[_0x5f0de7(0x1ee)]+':\x20'+_0x43e60b['message']);}}for(const _0xd500ce of _0x5c6b50[_0x5f0de7(0x1f9)]){console[_0x5f0de7(0x221)]('\x20\x20'+a24_0x653739['yellow']('β ')+'\x20'+_0xd500ce[_0x5f0de7(0x1ee)]+':\x20'+_0xd500ce[_0x5f0de7(0x1ef)]);}}if(_0x315044)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x216)](_0x5f0de7(0x220))),0x1;const _0x567577=await _0x2b8dde[_0x5f0de7(0x1fc)][_0x5f0de7(0x1f1)](_0x41392f),_0x4450ce=await withProgressSpinner(_0x5f0de7(0x224)+_0x41392f+'\x27...',_0x18a84a=>preparePush({'engage':_0x2b8dde[_0x5f0de7(0x1fc)]},_0x3b0d6d,_0x567577,{'progress':{'update':_0x504a5f=>_0x18a84a[_0x5f0de7(0x222)](_0x504a5f)}}),{'verbose':_0x1ed584['verbose']}),_0x15aa5c=_0x4450ce[_0x5f0de7(0x209)];await withProgressSpinner(_0x5f0de7(0x1f8),_0x182f8f=>resolveAndBuildInputs({'engage':_0x2b8dde[_0x5f0de7(0x1fc)]},_0x15aa5c,_0x567577,{'progress':{'update':_0x3ea196=>_0x182f8f[_0x5f0de7(0x222)](_0x3ea196)}}),{'verbose':_0x1ed584[_0x5f0de7(0x21f)]});const _0x278225=_0x15aa5c['filter'](_0x53323d=>_0x53323d['action']==='create'),_0x2d1b9b=_0x15aa5c[_0x5f0de7(0x214)](_0x2608cc=>_0x2608cc[_0x5f0de7(0x1f5)]===_0x5f0de7(0x212));console[_0x5f0de7(0x221)](_0x5f0de7(0x206)+_0x41392f+'\x27:');if(_0x278225[_0x5f0de7(0x228)]>0x0){console[_0x5f0de7(0x221)]('\x20\x20'+a24_0x653739[_0x5f0de7(0x22a)]('+\x20'+_0x278225['length']+_0x5f0de7(0x217)));for(const _0x413c18 of _0x278225){console[_0x5f0de7(0x221)]('\x20\x20\x20\x20'+a24_0x653739[_0x5f0de7(0x22a)]('+')+'\x20'+_0x413c18[_0x5f0de7(0x1f0)][_0x5f0de7(0x21a)]);}}if(_0x2d1b9b[_0x5f0de7(0x228)]>0x0){console['error']('\x20\x20'+a24_0x653739[_0x5f0de7(0x1f2)]('~\x20'+_0x2d1b9b[_0x5f0de7(0x228)]+_0x5f0de7(0x1ff)));for(const _0xd9ddd of _0x2d1b9b){console['error'](_0x5f0de7(0x22c)+a24_0x653739[_0x5f0de7(0x1f2)]('~')+'\x20'+_0xd9ddd[_0x5f0de7(0x1f0)][_0x5f0de7(0x21a)]);}}if(_0x278225[_0x5f0de7(0x228)]===0x0&&_0x2d1b9b[_0x5f0de7(0x228)]===0x0)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x22a)](_0x5f0de7(0x20e))),0x0;if(_0x1ed584[_0x5f0de7(0x219)])return console[_0x5f0de7(0x221)](a24_0x653739['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x1ed584['yes']){if(!isInteractive())return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x216)](_0x5f0de7(0x1e8)),_0x5f0de7(0x227)),console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1e6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x20e256=await confirmKey(_0x5f0de7(0x1ed)+(_0x278225['length']+_0x2d1b9b['length'])+_0x5f0de7(0x1fe));if(!_0x20e256)return console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x1f2)](_0x5f0de7(0x1fa)),'-\x20no\x20changes\x20applied'),0x1;}const _0x4f4717=await withProgressSpinner(_0x5f0de7(0x211),_0xe360b0=>executePush({'engage':_0x2b8dde[_0x5f0de7(0x1fc)]},_0x15aa5c,{'progress':{'update':_0xdae3d=>_0xe360b0[_0x5f0de7(0x222)](_0xdae3d)}}),{'verbose':_0x1ed584[_0x5f0de7(0x21f)]}),_0x4fc2d7=_0x4f4717[_0x5f0de7(0x209)];for(const _0x16d335 of _0x4fc2d7[_0x5f0de7(0x1ea)]){if(_0x16d335['templateId']&&(_0x16d335[_0x5f0de7(0x1f5)]==='created'||_0x16d335[_0x5f0de7(0x1f5)]===_0x5f0de7(0x200))){const _0x24f217=getTemplateUrl(_0x1ed584[_0x5f0de7(0x20f)],_0x567577,_0x16d335['templateId']),_0x438f23=_0x16d335[_0x5f0de7(0x1f5)]===_0x5f0de7(0x223)?'+':'~',_0x1ef8f4=_0x16d335[_0x5f0de7(0x1f5)]==='created'?a24_0x653739[_0x5f0de7(0x22a)](_0x438f23):a24_0x653739['yellow'](_0x438f23);console['error']('\x20\x20'+_0x1ef8f4+'\x20'+hyperlink(_0x16d335[_0x5f0de7(0x21a)],_0x24f217)+'\x20'+a24_0x653739[_0x5f0de7(0x1e6)](_0x24f217));}}_0x4fc2d7[_0x5f0de7(0x223)]>0x0&&console[_0x5f0de7(0x221)](a24_0x653739['green']('β\x20Created\x20'+_0x4fc2d7[_0x5f0de7(0x223)]+'\x20templates'));_0x4fc2d7[_0x5f0de7(0x200)]>0x0&&console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x22a)](_0x5f0de7(0x1f3)+_0x4fc2d7[_0x5f0de7(0x200)]+_0x5f0de7(0x21d)));if(_0x4fc2d7[_0x5f0de7(0x22d)][_0x5f0de7(0x228)]>0x0){console[_0x5f0de7(0x221)](a24_0x653739[_0x5f0de7(0x216)]('β\x20'+_0x4fc2d7[_0x5f0de7(0x22d)][_0x5f0de7(0x228)]+_0x5f0de7(0x1ec)));for(const _0x569d20 of _0x4fc2d7['errors']){console[_0x5f0de7(0x221)]('\x20\x20'+a24_0x653739[_0x5f0de7(0x216)](_0x569d20[_0x5f0de7(0x21a)])+':\x20'+_0x569d20[_0x5f0de7(0x221)]);}}return saveSessionContext({'engage_workspace':_0x41392f},_0x1ed584[_0x5f0de7(0x21c)]),_0x4fc2d7[_0x5f0de7(0x22d)]['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a27_0x36e6f3=a27_0x5329;(function(_0x485a21,_0x4f0c66){const _0x1c0dee=a27_0x5329,_0x44cd15=_0x485a21();while(!![]){try{const _0x50a8fb=parseInt(_0x1c0dee(0x1cd))/0x1*(parseInt(_0x1c0dee(0x1a3))/0x2)+-parseInt(_0x1c0dee(0x1c1))/0x3*(parseInt(_0x1c0dee(0x192))/0x4)+parseInt(_0x1c0dee(0x1a6))/0x5+parseInt(_0x1c0dee(0x1cf))/0x6+parseInt(_0x1c0dee(0x1c5))/0x7*(-parseInt(_0x1c0dee(0x1a5))/0x8)+parseInt(_0x1c0dee(0x1a2))/0x9*(parseInt(_0x1c0dee(0x1c6))/0xa)+-parseInt(_0x1c0dee(0x1bf))/0xb*(parseInt(_0x1c0dee(0x1d4))/0xc);if(_0x50a8fb===_0x4f0c66)break;else _0x44cd15['push'](_0x44cd15['shift']());}catch(_0x1c6ffc){_0x44cd15['push'](_0x44cd15['shift']());}}}(a27_0x427c,0x7797b));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 a27_0x481b97 from'chalk';import a27_0x16d825 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';function a27_0x427c(){const _0x149bd0=['path','dim','\x20errors:','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','created','engage:template:push','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','verbose','message','length','templateId','green','Push\x20','54NwVjUq','2rbFcuw','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','304EEQBtj','2258105YBgzDu','\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','warnings','errors','Preparing\x20push\x20to\x20workspace\x20\x27','session','relativePath','action','Resolving\x20references...','execute','yellow','filter','red','updated','configDir','\x20\x20\x20\x20','name','setPhase','β\x20All\x20templates\x20are\x20up\x20to\x20date','workspace','\x20templates?','engage','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','description','def','253Mgwquz','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','21OMFofr','create','Aborted.','Pushing\x20templates...','31913Qoshfn','634910kqKCZB','-\x20no\x20changes\x20applied','error','1\x20template\x20file:\x20','\x0aValidation\x20errors\x20in\x20','\x20templates','config','246494RFdjWh','cwd','3987318OGNPpe','engage_workspace','\x20template\x20files','data','Found\x20','396360ixRjDo','site','update','\x20templates\x20to\x20update:','183332RWikFo','dirname','cyan'];a27_0x427c=function(){return _0x149bd0;};return a27_0x427c();}import{hyperlink}from'../sdk/util/formatters.js';function a27_0x5329(_0x49e431,_0x35c8a5){_0x49e431=_0x49e431-0x191;const _0x427c38=a27_0x427c();let _0x532965=_0x427c38[_0x49e431];return _0x532965;}export class EngageTemplatePushCommand extends BaseCommand{[a27_0x36e6f3(0x1b6)]=a27_0x36e6f3(0x19a);[a27_0x36e6f3(0x1bd)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a27_0x36e6f3(0x1af)](_0xce4124){const _0x3ec204=a27_0x36e6f3,{options:_0x233ce4,args:_0x414f2c,tdx:_0x1a25e6}=_0xce4124,_0x5428cc=_0x233ce4,_0x5b5c6a=_0x414f2c[0x0],_0x4031ff=_0x5b5c6a?a27_0x16d825['resolve'](_0x5b5c6a):undefined,_0x9074e7=_0x4031ff?isYamlFile(_0x4031ff):![];let _0xa470f3;if(_0x9074e7&&_0x4031ff)_0xa470f3=a27_0x16d825[_0x3ec204(0x193)](_0x4031ff);else _0x4031ff?_0xa470f3=_0x4031ff:_0xa470f3=process[_0x3ec204(0x1ce)]();let _0x1bb5a8;const _0x2ca785=tryFindTdxConfig(_0xa470f3);_0x2ca785?.[_0x3ec204(0x1cc)][_0x3ec204(0x1d0)]&&(_0x1bb5a8=_0x2ca785[_0x3ec204(0x1cc)]['engage_workspace'],!_0x9074e7&&(_0xa470f3=_0x2ca785[_0x3ec204(0x1b4)]));_0x5428cc[_0x3ec204(0x1b9)]&&(_0x1bb5a8=_0x5428cc[_0x3ec204(0x1b9)]);if(!_0x1bb5a8){const _0x63c367=loadSessionContext(_0x5428cc[_0x3ec204(0x1ab)]);_0x63c367?.[_0x3ec204(0x1d0)]&&(_0x1bb5a8=_0x63c367['engage_workspace']);}if(!_0x1bb5a8)return console[_0x3ec204(0x1c8)](a27_0x481b97['yellow']('Workspace\x20is\x20required.')),console[_0x3ec204(0x1c8)]('\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[_0x3ec204(0x1c8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console['error'](_0x3ec204(0x1a7)),console[_0x3ec204(0x1c8)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0xe36786;_0x9074e7&&_0x4031ff?_0xe36786=[parseTemplateFile(_0x4031ff,a27_0x16d825[_0x3ec204(0x193)](_0x4031ff))]:_0xe36786=discoverAndParseTemplateFiles(_0xa470f3);if(_0xe36786[_0x3ec204(0x19e)]===0x0)return console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b0)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0xa470f3)),console['error'](a27_0x481b97[_0x3ec204(0x196)](_0x3ec204(0x198))),0x1;const _0x3e76ac=_0xe36786[_0x3ec204(0x19e)]===0x1?_0x3ec204(0x1c9)+_0xe36786[0x0][_0x3ec204(0x1be)][_0x3ec204(0x1b6)]:_0xe36786[_0x3ec204(0x19e)]+_0x3ec204(0x1d1);console[_0x3ec204(0x1c8)](_0x3ec204(0x1d3)+a27_0x481b97[_0x3ec204(0x194)](_0x3e76ac));let _0x5e70ed=![];for(const _0xfd8b89 of _0xe36786){const _0x192d7e=validateTemplateDef(_0xfd8b89[_0x3ec204(0x1be)]);if(!_0x192d7e['valid']){_0x5e70ed=!![],console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b2)](_0x3ec204(0x1ca)+_0xfd8b89[_0x3ec204(0x1ac)]+':'));for(const _0x4ffce3 of _0x192d7e['errors']){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1b2)]('β')+'\x20'+_0x4ffce3['path']+':\x20'+_0x4ffce3[_0x3ec204(0x19d)]);}}for(const _0x1f55c1 of _0x192d7e[_0x3ec204(0x1a8)]){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1b0)]('β ')+'\x20'+_0x1f55c1[_0x3ec204(0x195)]+':\x20'+_0x1f55c1[_0x3ec204(0x19d)]);}}if(_0x5e70ed)return console['error'](a27_0x481b97['red'](_0x3ec204(0x1bc))),0x1;const _0x40401b=await _0x1a25e6[_0x3ec204(0x1bb)]['resolveWorkspaceId'](_0x1bb5a8),_0x1995a3=await withProgressSpinner(_0x3ec204(0x1aa)+_0x1bb5a8+'\x27...',_0x8fa6dc=>preparePush({'engage':_0x1a25e6[_0x3ec204(0x1bb)]},_0xe36786,_0x40401b,{'progress':{'update':_0x57d5fa=>_0x8fa6dc[_0x3ec204(0x1b7)](_0x57d5fa)}}),{'verbose':_0x5428cc[_0x3ec204(0x19c)]}),_0xb66dea=_0x1995a3[_0x3ec204(0x1d2)];await withProgressSpinner(_0x3ec204(0x1ae),_0x172d79=>resolveAndBuildInputs({'engage':_0x1a25e6[_0x3ec204(0x1bb)]},_0xb66dea,_0x40401b,{'progress':{'update':_0x2e2d97=>_0x172d79['setPhase'](_0x2e2d97)}}),{'verbose':_0x5428cc[_0x3ec204(0x19c)]});const _0x20a43b=_0xb66dea[_0x3ec204(0x1b1)](_0xf451cd=>_0xf451cd[_0x3ec204(0x1ad)]===_0x3ec204(0x1c2)),_0x29a8e0=_0xb66dea[_0x3ec204(0x1b1)](_0x2bc93=>_0x2bc93[_0x3ec204(0x1ad)]===_0x3ec204(0x1d6));console['error']('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x1bb5a8+'\x27:');if(_0x20a43b[_0x3ec204(0x19e)]>0x0){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1a0)]('+\x20'+_0x20a43b['length']+'\x20new\x20templates:'));for(const _0x6d7e3f of _0x20a43b){console['error'](_0x3ec204(0x1b5)+a27_0x481b97[_0x3ec204(0x1a0)]('+')+'\x20'+_0x6d7e3f['def'][_0x3ec204(0x1b6)]);}}if(_0x29a8e0[_0x3ec204(0x19e)]>0x0){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1b0)]('~\x20'+_0x29a8e0[_0x3ec204(0x19e)]+_0x3ec204(0x191)));for(const _0x1de340 of _0x29a8e0){console['error']('\x20\x20\x20\x20'+a27_0x481b97[_0x3ec204(0x1b0)]('~')+'\x20'+_0x1de340[_0x3ec204(0x1be)][_0x3ec204(0x1b6)]);}}if(_0x20a43b['length']===0x0&&_0x29a8e0[_0x3ec204(0x19e)]===0x0)return console['error'](a27_0x481b97[_0x3ec204(0x1a0)](_0x3ec204(0x1b8))),0x0;if(_0x5428cc['dryRun'])return console[_0x3ec204(0x1c8)](a27_0x481b97['yellow'](_0x3ec204(0x1c0))),0x0;if(!_0x5428cc['yes']){if(!isInteractive())return console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b2)]('\x0aError:'),_0x3ec204(0x19b)),console[_0x3ec204(0x1c8)](a27_0x481b97['dim'](_0x3ec204(0x1a4))),0x1;const _0x255c93=await confirmKey(_0x3ec204(0x1a1)+(_0x20a43b['length']+_0x29a8e0['length'])+_0x3ec204(0x1ba));if(!_0x255c93)return console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b0)](_0x3ec204(0x1c3)),_0x3ec204(0x1c7)),0x1;}const _0x5c536a=await withProgressSpinner(_0x3ec204(0x1c4),_0x1c989a=>executePush({'engage':_0x1a25e6[_0x3ec204(0x1bb)]},_0xb66dea,{'progress':{'update':_0x1d8b45=>_0x1c989a['setPhase'](_0x1d8b45)}}),{'verbose':_0x5428cc[_0x3ec204(0x19c)]}),_0x1ea2a0=_0x5c536a[_0x3ec204(0x1d2)];for(const _0x371735 of _0x1ea2a0['results']){if(_0x371735[_0x3ec204(0x19f)]&&(_0x371735[_0x3ec204(0x1ad)]==='created'||_0x371735['action']==='updated')){const _0x45b899=getTemplateUrl(_0x5428cc[_0x3ec204(0x1d5)],_0x40401b,_0x371735[_0x3ec204(0x19f)]),_0x452b08=_0x371735['action']===_0x3ec204(0x199)?'+':'~',_0xc166d2=_0x371735[_0x3ec204(0x1ad)]==='created'?a27_0x481b97['green'](_0x452b08):a27_0x481b97[_0x3ec204(0x1b0)](_0x452b08);console[_0x3ec204(0x1c8)]('\x20\x20'+_0xc166d2+'\x20'+hyperlink(_0x371735[_0x3ec204(0x1b6)],_0x45b899)+'\x20'+a27_0x481b97[_0x3ec204(0x196)](_0x45b899));}}_0x1ea2a0[_0x3ec204(0x199)]>0x0&&console[_0x3ec204(0x1c8)](a27_0x481b97['green']('β\x20Created\x20'+_0x1ea2a0[_0x3ec204(0x199)]+'\x20templates'));_0x1ea2a0[_0x3ec204(0x1b3)]>0x0&&console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1a0)]('β\x20Updated\x20'+_0x1ea2a0[_0x3ec204(0x1b3)]+_0x3ec204(0x1cb)));if(_0x1ea2a0['errors'][_0x3ec204(0x19e)]>0x0){console[_0x3ec204(0x1c8)](a27_0x481b97[_0x3ec204(0x1b2)]('β\x20'+_0x1ea2a0[_0x3ec204(0x1a9)][_0x3ec204(0x19e)]+_0x3ec204(0x197)));for(const _0x23c57b of _0x1ea2a0[_0x3ec204(0x1a9)]){console[_0x3ec204(0x1c8)]('\x20\x20'+a27_0x481b97[_0x3ec204(0x1b2)](_0x23c57b[_0x3ec204(0x1b6)])+':\x20'+_0x23c57b[_0x3ec204(0x1c8)]);}}return saveSessionContext({'engage_workspace':_0x1bb5a8},_0x5428cc[_0x3ec204(0x1ab)]),_0x1ea2a0[_0x3ec204(0x1a9)][_0x3ec204(0x19e)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x2ed350=a28_0x1237;(function(_0x47861c,_0x3d7e83){const _0x373624=a28_0x1237,_0x50cd16=_0x47861c();while(!![]){try{const _0x19bea7=-parseInt(_0x373624(0x83))/0x1*(-parseInt(_0x373624(0xa5))/0x2)+parseInt(_0x373624(0x96))/0x3*(parseInt(_0x373624(0x7e))/0x4)+parseInt(_0x373624(0x7a))/0x5*(-parseInt(_0x373624(0xa4))/0x6)+parseInt(_0x373624(0x7f))/0x7+parseInt(_0x373624(0xa2))/0x8*(parseInt(_0x373624(0x8d))/0x9)+parseInt(_0x373624(0x82))/0xa+-parseInt(_0x373624(0x84))/0xb*(parseInt(_0x373624(0x89))/0xc);if(_0x19bea7===_0x3d7e83)break;else _0x50cd16['push'](_0x50cd16['shift']());}catch(_0x2dfadb){_0x50cd16['push'](_0x50cd16['shift']());}}}(a28_0x315f,0x7742b));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a28_0x315f(){const _0x5c558d=['warnings','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','27DMWSOZ','yellow','description','\x20error(s)','validCount','Error:\x20Directory\x20not\x20found:\x20','\x20non-template\x20file(s)\x20skipped)','endsWith','dirname','1483155newQmJ','skippedCount','log','Validation\x20failed:\x20','template','invalidCount','verbose','hasErrors','execute','\x20warning(s)\x20found','\x20template(s)\x20valid','\x20non-template\x20file(s)\x20skipped','34840jZVAvW','name','9978dLlyVN','28220ibxbUL','errors','dim','valid','cwd','\x20template(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yaml','1365kfGNSS','red','warningCount','error','4RtWwRg','2067688KALLUv','green','\x20valid','2321440CAQema','15ckOBSG','11ywveuN','engage:template:validate','filter','relativePath','No\x20template\x20YAML\x20files\x20found\x20in\x20','3649656tnsZjU','length'];a28_0x315f=function(){return _0x5c558d;};return a28_0x315f();}function a28_0x1237(_0x29f40e,_0x567208){_0x29f40e=_0x29f40e-0x76;const _0x315f44=a28_0x315f();let _0x123711=_0x315f44[_0x29f40e];return _0x123711;}import{existsSync}from'fs';import a28_0x2f5330 from'chalk';import a28_0x3cff60 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_0x2ed350(0xa3)]=a28_0x2ed350(0x85);[a28_0x2ed350(0x8f)]='Validate\x20template\x20YAML\x20files';async[a28_0x2ed350(0x9e)](_0x2b9cca){const _0x7ff81e=a28_0x2ed350,{options:_0x92418d,args:_0x2ae3b3}=_0x2b9cca,_0x414e06=_0x92418d,_0x4f3106=_0x2ae3b3[0x0],_0x18e0e3=_0x4f3106?a28_0x3cff60['resolve'](_0x4f3106):undefined,_0x27bf25=_0x18e0e3?isYamlFile(_0x18e0e3):![];let _0x13f785,_0x29bbd5;if(_0x27bf25&&_0x18e0e3)_0x13f785=a28_0x3cff60[_0x7ff81e(0x95)](_0x18e0e3),_0x29bbd5=_0x18e0e3;else _0x18e0e3?_0x13f785=_0x18e0e3:_0x13f785=process[_0x7ff81e(0x76)]();if(!_0x29bbd5&&!existsSync(_0x13f785))return console['error'](a28_0x2f5330[_0x7ff81e(0x7b)](_0x7ff81e(0x92)+_0x13f785+'\x0a')),0x1;let _0x12f21b;if(_0x29bbd5){if(!_0x29bbd5[_0x7ff81e(0x94)]('.yml')&&!_0x29bbd5[_0x7ff81e(0x94)](_0x7ff81e(0x79)))return console[_0x7ff81e(0x7d)](a28_0x2f5330[_0x7ff81e(0x7b)](_0x7ff81e(0x8c)+_0x29bbd5+'\x0a')),0x1;_0x12f21b=[_0x29bbd5];}else _0x12f21b=findYamlFiles(_0x13f785);if(_0x12f21b[_0x7ff81e(0x8a)]===0x0)return console[_0x7ff81e(0x7d)](a28_0x2f5330[_0x7ff81e(0x7b)](_0x7ff81e(0x78)+_0x13f785+'\x0a')),0x1;const _0x2911e2=validateYamlFiles(_0x12f21b,_0x13f785,{'filterType':_0x7ff81e(0x9a)}),_0x62315c=calculateSummary(_0x2911e2),_0x5b10aa=_0x2911e2[_0x7ff81e(0x86)](isValidationResult);if(_0x5b10aa[_0x7ff81e(0x8a)]===0x0)return console[_0x7ff81e(0x7d)](a28_0x2f5330['yellow'](_0x7ff81e(0x88)+_0x13f785+'\x0a')),_0x62315c['skippedCount']>0x0&&console[_0x7ff81e(0x7d)](a28_0x2f5330[_0x7ff81e(0xa7)]('('+_0x62315c[_0x7ff81e(0x97)]+_0x7ff81e(0x93))),0x0;for(const _0x405498 of _0x2911e2){if(!isValidationResult(_0x405498)){_0x414e06[_0x7ff81e(0x9c)]&&console['log'](a28_0x2f5330[_0x7ff81e(0xa7)]('-\x20'+_0x405498[_0x7ff81e(0x87)]+'\x20(skipped:\x20'+_0x405498['reason']+')'));continue;}const {relativePath:_0x39edf4,source:_0x185756,result:_0x2b199c}=_0x405498;if(_0x2b199c['valid']&&_0x2b199c['warnings']['length']===0x0)_0x414e06[_0x7ff81e(0x9c)]&&console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0x80)]('β\x20'+_0x39edf4));else _0x2b199c[_0x7ff81e(0xa8)]?(console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0x8e)]('β \x20'+_0x39edf4+':\x20'+_0x2b199c[_0x7ff81e(0x8b)][_0x7ff81e(0x8a)]+'\x20warning(s)')),console[_0x7ff81e(0x98)](formatValidationResult(_0x2b199c,_0x185756,_0x39edf4))):(console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0x7b)]('β\x20'+_0x39edf4+':\x20'+_0x2b199c[_0x7ff81e(0xa6)]['length']+_0x7ff81e(0x90))),console[_0x7ff81e(0x98)](formatValidationResult(_0x2b199c,_0x185756,_0x39edf4)));}return console[_0x7ff81e(0x98)](''),_0x62315c[_0x7ff81e(0x9d)]?(console['log'](a28_0x2f5330['red'](_0x7ff81e(0x99)+_0x62315c[_0x7ff81e(0x9b)]+_0x7ff81e(0x77)+_0x62315c[_0x7ff81e(0x91)]+_0x7ff81e(0x81))),_0x62315c[_0x7ff81e(0x7c)]>0x0&&console[_0x7ff81e(0x98)](a28_0x2f5330['yellow'](_0x62315c['warningCount']+'\x20warning(s)\x20found')),_0x62315c[_0x7ff81e(0x97)]>0x0&&console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0xa7)](_0x62315c[_0x7ff81e(0x97)]+_0x7ff81e(0xa1))),0x1):(console['log'](a28_0x2f5330[_0x7ff81e(0x80)]('β\x20All\x20'+_0x62315c[_0x7ff81e(0x91)]+_0x7ff81e(0xa0))),_0x62315c[_0x7ff81e(0x7c)]>0x0&&console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0x8e)](_0x62315c[_0x7ff81e(0x7c)]+_0x7ff81e(0x9f))),_0x62315c[_0x7ff81e(0x97)]>0x0&&console[_0x7ff81e(0x98)](a28_0x2f5330[_0x7ff81e(0xa7)](_0x62315c['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x2f10fb=a26_0x3001;(function(_0x3c2298,_0x37ba1c){const _0x2f4428=a26_0x3001,_0x16fcbc=_0x3c2298();while(!![]){try{const _0x2f6030=parseInt(_0x2f4428(0xd7))/0x1*(-parseInt(_0x2f4428(0xc2))/0x2)+-parseInt(_0x2f4428(0xe7))/0x3+parseInt(_0x2f4428(0x9c))/0x4+parseInt(_0x2f4428(0xc8))/0x5*(parseInt(_0x2f4428(0xee))/0x6)+-parseInt(_0x2f4428(0xab))/0x7+parseInt(_0x2f4428(0xbc))/0x8+-parseInt(_0x2f4428(0xb3))/0x9*(parseInt(_0x2f4428(0xd1))/0xa);if(_0x2f6030===_0x37ba1c)break;else _0x16fcbc['push'](_0x16fcbc['shift']());}catch(_0x5ca76a){_0x16fcbc['push'](_0x16fcbc['shift']());}}}(a26_0x4bc8,0xb803c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a26_0x4bc8(){const _0x316bc6=['map','Cancelled','Get\x20job\x20results','60mOJOBE','verbose','show','type','job_id','submit','2165sGPUFJ','job:kill','Query:\x20','result','hive','description','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Listing\x20jobs...','d\x20ago','status','end_at','query','validate','m\x20ago','List\x20jobs','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','2052480zeYqHw','Submitting\x20job...','args','data','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','created_at','getTime','8152590VrCksY','name','substring','job:result','priority','yes','Kill\x20a\x20job','length','Submitting\x20kill\x20request...','\x20job','5525336wmzXou','push','kill','\x20jobs','β\x20Job\x20submitted','Show\x20job\x20details','url','h\x20ago','just\x20now','β\x20Found\x20','\x20row','Getting\x20job\x20details...','\x20\x20Job\x20ID:\x20','trino','floor','1581762zoEYUr','dim','now','execute','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','start_at','user_name','Database:\x20','2881863urMczc','β\x20Retrieved\x20','Job\x20type:\x20','...','No\x20SQL\x20statements\x20found\x20in\x20file','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','file','round','\x27\x20to\x20verify\x20the\x20job\x20status','9894864DVTjjd','success','presto','jobs','INVALID_ARGUMENT','Getting\x20job\x20results...','362FxOdFl','abs','error','debug','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','job:show','5NOxSIj','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','database','information_schema','Submit\x20a\x20job','log'];a26_0x4bc8=function(){return _0x316bc6;};return a26_0x4bc8();}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3a0e38 from'chalk';function formatDuration(_0x3c0eb1){const _0x1f06b1=a26_0x3001;if(_0x3c0eb1<0x3c)return _0x3c0eb1+'s';if(_0x3c0eb1<0xe10)return Math[_0x1f06b1(0xaa)](_0x3c0eb1/0x3c)+'m\x20'+_0x3c0eb1%0x3c+'s';const _0x565fbd=Math[_0x1f06b1(0xaa)](_0x3c0eb1/0xe10),_0x38f050=Math['floor'](_0x3c0eb1%0xe10/0x3c);return _0x38f050>0x0?_0x565fbd+'h\x20'+_0x38f050+'m':_0x565fbd+'h';}function formatRelativeTime(_0x58450e){const _0x2b641c=a26_0x3001,_0x30e7c7=Date[_0x2b641c(0xad)]()-_0x58450e[_0x2b641c(0xed)](),_0xa5d5c5=Math[_0x2b641c(0xaa)](Math[_0x2b641c(0xc3)](_0x30e7c7)/0x3e8);if(_0xa5d5c5<0x3c)return _0x2b641c(0xa4);const _0x4a5203=Math[_0x2b641c(0xaa)](_0xa5d5c5/0x3c);if(_0x4a5203<0x3c)return _0x4a5203+_0x2b641c(0xe4);const _0x376038=Math[_0x2b641c(0xaa)](_0x4a5203/0x3c);if(_0x376038<0x18)return _0x376038+_0x2b641c(0xa3);const _0x15fd52=Math[_0x2b641c(0xaa)](_0x376038/0x18);if(_0x15fd52<0x1e)return _0x15fd52+_0x2b641c(0xdf);return Math[_0x2b641c(0xaa)](_0x15fd52/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x2f10fb(0xef)]=a26_0x2f10fb(0xbf);[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0xe5);async[a26_0x2f10fb(0xae)](_0x24e9f5){const _0xb8b07d=a26_0x2f10fb,{options:_0x36985d,tdx:_0x3373cb}=_0x24e9f5,_0x544a69=resolveLimit(_0x36985d['limit'],DEFAULT_DISPLAY_LIMIT),_0x4a6416=_0x36985d[_0xb8b07d(0xe0)];_0x36985d[_0xb8b07d(0xd2)]&&(console['error']('Limit:\x20'+_0x544a69+_0xb8b07d(0x9f)),_0x4a6416&&console['error']('Status\x20filter:\x20'+_0x4a6416));const _0x19b40b=await withSpinner(_0xb8b07d(0xde),()=>_0x3373cb[_0xb8b07d(0xbf)]['list']({'from':0x0,'to':_0x544a69-0x1,'status':_0x4a6416}),{'verbose':_0x36985d['verbose']}),_0x2545d2=_0x19b40b['data'];console[_0xb8b07d(0xc4)](_0xb8b07d(0xa5)+_0x2545d2[_0xb8b07d(0x99)]+_0xb8b07d(0x9b)+(_0x2545d2[_0xb8b07d(0x99)]!==0x1?'s':''));const _0x1f9a36=_0x36985d['site'];if(isStructuredFormat(_0x36985d)){const _0x114f7d=_0x2545d2[_0xb8b07d(0xce)](_0x3181b4=>{const _0x4d1400=_0xb8b07d;let _0x24c309;if(_0x3181b4['start_at']&&_0x3181b4[_0x4d1400(0xe1)]){const _0x165c56=new Date(_0x3181b4[_0x4d1400(0xb0)])['getTime'](),_0x1d1acb=new Date(_0x3181b4[_0x4d1400(0xe1)])[_0x4d1400(0xed)]();_0x24c309=Math['round']((_0x1d1acb-_0x165c56)/0x3e8);}return{'job_id':_0x3181b4['job_id'],'type':_0x3181b4[_0x4d1400(0xd4)]===_0x4d1400(0xbe)?'trino':_0x3181b4['type'],'status':_0x3181b4[_0x4d1400(0xe0)],'user_name':_0x3181b4[_0x4d1400(0xb1)],'duration_sec':_0x24c309,'created_at':_0x3181b4['created_at'],'started_at':_0x3181b4[_0x4d1400(0xb0)],'end_at':_0x3181b4[_0x4d1400(0xe1)]};});await handleSDKOutput(_0x114f7d,_0x36985d);}else for(const _0x17d595 of _0x2545d2){const _0x24dce0=_0x17d595[_0xb8b07d(0xe0)]===_0xb8b07d(0xbd)?a26_0x3a0e38['green']:_0x17d595[_0xb8b07d(0xe0)]===_0xb8b07d(0xc4)?a26_0x3a0e38['red']:a26_0x3a0e38[_0xb8b07d(0xac)],_0xf7400e=_0x24dce0(_0x17d595[_0xb8b07d(0xe0)]),_0x2477f0=getJobUrl(_0x1f9a36,_0x17d595[_0xb8b07d(0xd5)]),_0x7ed2f2=hyperlink(_0x17d595[_0xb8b07d(0xd5)],_0x2477f0),_0x19f970=a26_0x3a0e38[_0xb8b07d(0xac)](_0x17d595[_0xb8b07d(0xd4)]===_0xb8b07d(0xbe)?_0xb8b07d(0xa9):_0x17d595[_0xb8b07d(0xd4)]),_0x2ac7e=[];if(_0x17d595['start_at']&&_0x17d595[_0xb8b07d(0xe1)]){const _0x2c907f=Math['round']((new Date(_0x17d595[_0xb8b07d(0xe1)])[_0xb8b07d(0xed)]()-new Date(_0x17d595[_0xb8b07d(0xb0)])[_0xb8b07d(0xed)]())/0x3e8);_0x2ac7e[_0xb8b07d(0x9d)](formatDuration(_0x2c907f));}if(_0x17d595[_0xb8b07d(0xe1)])_0x2ac7e[_0xb8b07d(0x9d)](formatRelativeTime(new Date(_0x17d595[_0xb8b07d(0xe1)])));else _0x17d595['start_at']&&_0x2ac7e[_0xb8b07d(0x9d)](formatRelativeTime(new Date(_0x17d595[_0xb8b07d(0xb0)])));const _0x39b6bb=_0x2ac7e[_0xb8b07d(0x99)]>0x0?a26_0x3a0e38[_0xb8b07d(0xac)]('\x20'+_0x2ac7e['join'](',\x20')):'';console[_0xb8b07d(0xcd)]('β‘\x20'+_0x7ed2f2+'\x20'+_0x19f970+'\x20'+_0xf7400e+_0x39b6bb);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x2f10fb(0xef)]=a26_0x2f10fb(0xc7);[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0xa1);[a26_0x2f10fb(0xe3)](_0x3306bb){const _0xb5a041=a26_0x2f10fb,_0x8018ad=_0x3306bb[_0xb5a041(0xe9)][0x0];if(!_0x8018ad)return _0xb5a041(0xc9);return undefined;}async['execute'](_0x4019a3){const _0x208af1=a26_0x2f10fb,{options:_0x1103cb,args:_0x5e623f,tdx:_0x27eb8b}=_0x4019a3,_0xabb6d9=_0x5e623f[0x0],_0x16709e=await withSpinner(_0x208af1(0xa7),()=>_0x27eb8b[_0x208af1(0xbf)][_0x208af1(0xd3)](_0xabb6d9),{'verbose':_0x1103cb[_0x208af1(0xd2)]}),_0x1e7919=_0x16709e[_0x208af1(0xea)];let _0x3f079b;if(_0x1e7919[_0x208af1(0xb0)]&&_0x1e7919[_0x208af1(0xe1)]){const _0x4faca2=new Date(_0x1e7919[_0x208af1(0xb0)])[_0x208af1(0xed)](),_0x18c27e=new Date(_0x1e7919['end_at'])['getTime']();_0x3f079b=Math[_0x208af1(0xba)]((_0x18c27e-_0x4faca2)/0x3e8);}const _0x419070={'job_id':_0x1e7919[_0x208af1(0xd5)],'type':_0x1e7919[_0x208af1(0xd4)],'status':_0x1e7919[_0x208af1(0xe0)],..._0x1e7919[_0x208af1(0xb1)]&&{'user_name':_0x1e7919[_0x208af1(0xb1)]},..._0x3f079b!==undefined&&{'duration_sec':_0x3f079b},..._0x1e7919[_0x208af1(0xec)]&&{'created_at':_0x1e7919[_0x208af1(0xec)]},..._0x1e7919['start_at']&&{'started_at':_0x1e7919[_0x208af1(0xb0)]},..._0x1e7919[_0x208af1(0xe1)]&&{'end_at':_0x1e7919[_0x208af1(0xe1)]},..._0x1e7919[_0x208af1(0xca)]&&{'database':_0x1e7919[_0x208af1(0xca)]},..._0x1e7919[_0x208af1(0xf2)]!==undefined&&{'priority':_0x1e7919['priority']},..._0x1e7919[_0x208af1(0xa2)]&&{'url':_0x1e7919['url']},..._0x1e7919[_0x208af1(0xe2)]&&{'query':_0x1e7919[_0x208af1(0xe2)]},..._0x1e7919[_0x208af1(0xc5)]&&{'debug':_0x1e7919[_0x208af1(0xc5)]}};return await handleSingleObjectOutput(_0x419070,_0x1103cb),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x2f10fb(0xd8);[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0x98);[a26_0x2f10fb(0xe3)](_0x5a85c5){const _0x25925a=a26_0x2f10fb,_0x24089c=_0x5a85c5[_0x25925a(0xe9)][0x0];if(!_0x24089c)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0x2f10fb(0xae)](_0x58a604){const _0xc909a6=a26_0x2f10fb,{options:_0x33f442,args:_0x23872d,tdx:_0x2954c9}=_0x58a604,_0x5c7d61=_0x23872d[0x0];if(!_0x33f442[_0xc909a6(0x97)]){const _0x171240=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x5c7d61+'?');if(!_0x171240)return console[_0xc909a6(0xc4)](_0xc909a6(0xcf)),0x0;}return await withSpinner(_0xc909a6(0x9a),()=>_0x2954c9['jobs'][_0xc909a6(0x9e)](_0x5c7d61),{'verbose':_0x33f442[_0xc909a6(0xd2)]}),console[_0xc909a6(0xc4)](_0xc909a6(0xe6)+_0x5c7d61),console['error'](_0xc909a6(0xdd)+_0x5c7d61+_0xc909a6(0xbb)),0x0;}}function a26_0x3001(_0x1b23bf,_0x51052e){_0x1b23bf=_0x1b23bf-0x97;const _0x4bc824=a26_0x4bc8();let _0x300102=_0x4bc824[_0x1b23bf];return _0x300102;}export class JobSubmitCommand extends BaseCommand{[a26_0x2f10fb(0xef)]='job:submit';[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0xcc);async[a26_0x2f10fb(0xae)](_0xf909af){const _0x5b16db=a26_0x2f10fb,{options:_0x422e50,args:_0x224f10,tdx:_0x28067e}=_0xf909af,_0xc4e375=_0x422e50['jobType']||_0x5b16db(0xa9),_0x280131=_0x422e50[_0x5b16db(0xb9)],_0x351296=_0x422e50[_0x5b16db(0xca)]||_0x5b16db(0xcb),_0x463a31=_0x422e50['result'];if(_0xc4e375!=='trino'&&_0xc4e375!==_0x5b16db(0xdb))throw new SDKError(ErrorCode[_0x5b16db(0xc0)],_0x5b16db(0xeb));let _0xd44d1;if(_0x280131){if(_0x224f10[0x0])throw new SDKError(ErrorCode[_0x5b16db(0xc0)],_0x5b16db(0xc6));const _0x8ab396=readSqlStatementsFromFile(_0x280131);if(_0x8ab396[_0x5b16db(0x99)]===0x0)throw new SDKError(ErrorCode[_0x5b16db(0xc0)],_0x5b16db(0xb7));if(_0x8ab396[_0x5b16db(0x99)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5b16db(0xb8));_0xd44d1=_0x8ab396[0x0];}else{if(!_0x224f10[0x0])throw new SDKError(ErrorCode[_0x5b16db(0xc0)],_0x5b16db(0xaf));_0xd44d1=_0x224f10[0x0];}_0x422e50['verbose']&&(console[_0x5b16db(0xc4)](_0x5b16db(0xb5)+_0xc4e375),console['error'](_0x5b16db(0xb2)+_0x351296),console[_0x5b16db(0xc4)](_0x5b16db(0xd9)+_0xd44d1[_0x5b16db(0xf0)](0x0,0x64)+(_0xd44d1[_0x5b16db(0x99)]>0x64?_0x5b16db(0xb6):'')));const _0x27f449=await withSpinner(_0x5b16db(0xe8),()=>_0x28067e[_0x5b16db(0xbf)][_0x5b16db(0xd6)](_0x351296,_0xd44d1,_0xc4e375,_0x463a31),{'verbose':_0x422e50[_0x5b16db(0xd2)]}),_0x3f58ab=_0x27f449['data'];return console[_0x5b16db(0xc4)](_0x5b16db(0xa0)),console['error'](_0x5b16db(0xa8)+_0x3f58ab[_0x5b16db(0xd5)]),await handleSDKOutput([_0x3f58ab],_0x422e50),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x2f10fb(0xef)]=a26_0x2f10fb(0xf1);[a26_0x2f10fb(0xdc)]=a26_0x2f10fb(0xd0);['validate'](_0x529e1b){const _0x21b63a=a26_0x2f10fb,_0x1f3ea0=_0x529e1b[_0x21b63a(0xe9)][0x0];if(!_0x1f3ea0)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x2f10fb(0xae)](_0x10768f){const _0x3fd7a0=a26_0x2f10fb,{options:_0x44ad3d,args:_0x5597c5,tdx:_0x253cec}=_0x10768f,_0x4ad3c4=_0x5597c5[0x0],_0x489315=await withSpinner(_0x3fd7a0(0xc1),()=>_0x253cec[_0x3fd7a0(0xbf)][_0x3fd7a0(0xda)](_0x4ad3c4),{'verbose':_0x44ad3d[_0x3fd7a0(0xd2)]}),_0x49540c=_0x489315[_0x3fd7a0(0xea)];return console[_0x3fd7a0(0xc4)](_0x3fd7a0(0xb4)+_0x49540c[_0x3fd7a0(0x99)]+_0x3fd7a0(0xa6)+(_0x49540c['length']!==0x1?'s':'')),await handleSDKOutput(_0x49540c,_0x44ad3d),0x0;}}
|
|
1
|
+
function a29_0x2d77(_0x2f5cda,_0x239fea){_0x2f5cda=_0x2f5cda-0x154;const _0x329cf7=a29_0x329c();let _0x2d7791=_0x329cf7[_0x2f5cda];return _0x2d7791;}const a29_0x2eb8a4=a29_0x2d77;(function(_0x5c9c8b,_0x6fe919){const _0x11ccf1=a29_0x2d77,_0x450512=_0x5c9c8b();while(!![]){try{const _0x3a516e=parseInt(_0x11ccf1(0x170))/0x1*(-parseInt(_0x11ccf1(0x15e))/0x2)+parseInt(_0x11ccf1(0x168))/0x3+-parseInt(_0x11ccf1(0x161))/0x4*(-parseInt(_0x11ccf1(0x1a5))/0x5)+parseInt(_0x11ccf1(0x16a))/0x6+parseInt(_0x11ccf1(0x177))/0x7*(-parseInt(_0x11ccf1(0x1a4))/0x8)+-parseInt(_0x11ccf1(0x162))/0x9+parseInt(_0x11ccf1(0x16d))/0xa*(parseInt(_0x11ccf1(0x18f))/0xb);if(_0x3a516e===_0x6fe919)break;else _0x450512['push'](_0x450512['shift']());}catch(_0x3c8773){_0x450512['push'](_0x450512['shift']());}}}(a29_0x329c,0xb2bd6));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x329c(){const _0xaf59e1=['22052IwfLiN','11774295dcfVAm','file','Listing\x20jobs...','created_at','now','join','1693167IIckoN','yes','3962742RHVdLO','Cancelled','type','5960QNcncy','show','job:submit','258oSFWjC','job_id','job:result','debug','execute','INVALID_ARGUMENT','β\x20Job\x20submitted','14POfvmI','description','\x27\x20to\x20verify\x20the\x20job\x20status','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','h\x20ago','green','success','mo\x20ago','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','information_schema','Database:\x20','floor','trino','getTime','List\x20jobs','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','args','result','status','user_name','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','No\x20SQL\x20statements\x20found\x20in\x20file','Limit:\x20','29546hNQHGG','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','red','Submitting\x20kill\x20request...','push','data','length','verbose','abs','round','jobs','map','d\x20ago','\x20jobs','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','end_at','start_at','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','dim','url','presto','2795784jUAKwm','695mHRHyE','Getting\x20job\x20details...','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','job:show','database','substring','Get\x20job\x20results','Query:\x20','error','query','name','6610lWbwoX','list','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'];a29_0x329c=function(){return _0xaf59e1;};return a29_0x329c();}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_0xb739ab from'chalk';function formatDuration(_0x2c17d2){const _0x390ae5=a29_0x2d77;if(_0x2c17d2<0x3c)return _0x2c17d2+'s';if(_0x2c17d2<0xe10)return Math['floor'](_0x2c17d2/0x3c)+'m\x20'+_0x2c17d2%0x3c+'s';const _0x36bae0=Math[_0x390ae5(0x183)](_0x2c17d2/0xe10),_0x4bbb78=Math[_0x390ae5(0x183)](_0x2c17d2%0xe10/0x3c);return _0x4bbb78>0x0?_0x36bae0+'h\x20'+_0x4bbb78+'m':_0x36bae0+'h';}function formatRelativeTime(_0x2f8b79){const _0x11041c=a29_0x2d77,_0x393528=Date[_0x11041c(0x166)]()-_0x2f8b79[_0x11041c(0x185)](),_0x5c8e85=Math['floor'](Math[_0x11041c(0x197)](_0x393528)/0x3e8);if(_0x5c8e85<0x3c)return'just\x20now';const _0x41729d=Math[_0x11041c(0x183)](_0x5c8e85/0x3c);if(_0x41729d<0x3c)return _0x41729d+'m\x20ago';const _0x19996c=Math[_0x11041c(0x183)](_0x41729d/0x3c);if(_0x19996c<0x18)return _0x19996c+_0x11041c(0x17b);const _0x2cc0e0=Math[_0x11041c(0x183)](_0x19996c/0x18);if(_0x2cc0e0<0x1e)return _0x2cc0e0+_0x11041c(0x19b);return Math[_0x11041c(0x183)](_0x2cc0e0/0x1e)+_0x11041c(0x17e);}export class JobListCommand extends BaseCommand{[a29_0x2eb8a4(0x15d)]=a29_0x2eb8a4(0x199);[a29_0x2eb8a4(0x178)]=a29_0x2eb8a4(0x186);async['execute'](_0x535969){const _0x4965f1=a29_0x2eb8a4,{options:_0x9fa43a,tdx:_0x36f02b}=_0x535969,_0xbf9e3d=resolveLimit(_0x9fa43a['limit'],DEFAULT_DISPLAY_LIMIT),_0x34eff4=_0x9fa43a[_0x4965f1(0x18a)];_0x9fa43a[_0x4965f1(0x196)]&&(console['error'](_0x4965f1(0x18e)+_0xbf9e3d+_0x4965f1(0x19c)),_0x34eff4&&console['error']('Status\x20filter:\x20'+_0x34eff4));const _0x3a317f=await withSpinner(_0x4965f1(0x164),()=>_0x36f02b[_0x4965f1(0x199)][_0x4965f1(0x15f)]({'from':0x0,'to':_0xbf9e3d-0x1,'status':_0x34eff4}),{'verbose':_0x9fa43a['verbose']}),_0x2f4609=_0x3a317f[_0x4965f1(0x194)];console[_0x4965f1(0x15b)]('β\x20Found\x20'+_0x2f4609[_0x4965f1(0x195)]+'\x20job'+(_0x2f4609[_0x4965f1(0x195)]!==0x1?'s':''));const _0x765a3d=_0x9fa43a[_0x4965f1(0x17f)];if(isStructuredFormat(_0x9fa43a)){const _0x443bef=_0x2f4609[_0x4965f1(0x19a)](_0x3cb27c=>{const _0x4b1481=_0x4965f1;let _0x8c8d23;if(_0x3cb27c['start_at']&&_0x3cb27c['end_at']){const _0x4b1611=new Date(_0x3cb27c[_0x4b1481(0x19f)])[_0x4b1481(0x185)](),_0x23b3d6=new Date(_0x3cb27c[_0x4b1481(0x19e)])['getTime']();_0x8c8d23=Math[_0x4b1481(0x198)]((_0x23b3d6-_0x4b1611)/0x3e8);}return{'job_id':_0x3cb27c['job_id'],'type':_0x3cb27c[_0x4b1481(0x16c)]===_0x4b1481(0x1a3)?_0x4b1481(0x184):_0x3cb27c[_0x4b1481(0x16c)],'status':_0x3cb27c['status'],'user_name':_0x3cb27c[_0x4b1481(0x18b)],'duration_sec':_0x8c8d23,'created_at':_0x3cb27c['created_at'],'started_at':_0x3cb27c['start_at'],'end_at':_0x3cb27c[_0x4b1481(0x19e)]};});await handleSDKOutput(_0x443bef,_0x9fa43a);}else for(const _0x11f8b3 of _0x2f4609){const _0x34d16d=_0x11f8b3['status']===_0x4965f1(0x17d)?a29_0xb739ab[_0x4965f1(0x17c)]:_0x11f8b3['status']===_0x4965f1(0x15b)?a29_0xb739ab[_0x4965f1(0x191)]:a29_0xb739ab[_0x4965f1(0x1a1)],_0xcc02fb=_0x34d16d(_0x11f8b3[_0x4965f1(0x18a)]),_0x2c74e2=getJobUrl(_0x765a3d,_0x11f8b3[_0x4965f1(0x171)]),_0x34fc8a=hyperlink(_0x11f8b3[_0x4965f1(0x171)],_0x2c74e2),_0x23af98=a29_0xb739ab[_0x4965f1(0x1a1)](_0x11f8b3[_0x4965f1(0x16c)]==='presto'?_0x4965f1(0x184):_0x11f8b3[_0x4965f1(0x16c)]),_0xdfb51a=[];if(_0x11f8b3[_0x4965f1(0x19f)]&&_0x11f8b3[_0x4965f1(0x19e)]){const _0x375f83=Math[_0x4965f1(0x198)]((new Date(_0x11f8b3[_0x4965f1(0x19e)])[_0x4965f1(0x185)]()-new Date(_0x11f8b3[_0x4965f1(0x19f)])[_0x4965f1(0x185)]())/0x3e8);_0xdfb51a[_0x4965f1(0x193)](formatDuration(_0x375f83));}if(_0x11f8b3[_0x4965f1(0x19e)])_0xdfb51a[_0x4965f1(0x193)](formatRelativeTime(new Date(_0x11f8b3[_0x4965f1(0x19e)])));else _0x11f8b3[_0x4965f1(0x19f)]&&_0xdfb51a[_0x4965f1(0x193)](formatRelativeTime(new Date(_0x11f8b3[_0x4965f1(0x19f)])));const _0x4d4d69=_0xdfb51a[_0x4965f1(0x195)]>0x0?a29_0xb739ab[_0x4965f1(0x1a1)]('\x20'+_0xdfb51a[_0x4965f1(0x167)](',\x20')):'';console['log']('β‘\x20'+_0x34fc8a+'\x20'+_0x23af98+'\x20'+_0xcc02fb+_0x4d4d69);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a29_0x2eb8a4(0x15d)]=a29_0x2eb8a4(0x156);[a29_0x2eb8a4(0x178)]='Show\x20job\x20details';['validate'](_0x154c54){const _0x2236ab=a29_0x2eb8a4,_0x17c1b1=_0x154c54[_0x2236ab(0x188)][0x0];if(!_0x17c1b1)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a29_0x2eb8a4(0x174)](_0x2bb8ef){const _0x5049c9=a29_0x2eb8a4,{options:_0x354b83,args:_0xc71290,tdx:_0x52cc96}=_0x2bb8ef,_0x2ced58=_0xc71290[0x0],_0x174ba4=await withSpinner(_0x5049c9(0x154),()=>_0x52cc96[_0x5049c9(0x199)][_0x5049c9(0x16e)](_0x2ced58),{'verbose':_0x354b83[_0x5049c9(0x196)]}),_0x12e3de=_0x174ba4[_0x5049c9(0x194)];let _0x2942a4;if(_0x12e3de[_0x5049c9(0x19f)]&&_0x12e3de[_0x5049c9(0x19e)]){const _0x4424ae=new Date(_0x12e3de[_0x5049c9(0x19f)])[_0x5049c9(0x185)](),_0x24f544=new Date(_0x12e3de[_0x5049c9(0x19e)])[_0x5049c9(0x185)]();_0x2942a4=Math[_0x5049c9(0x198)]((_0x24f544-_0x4424ae)/0x3e8);}const _0x6a6a6a={'job_id':_0x12e3de['job_id'],'type':_0x12e3de[_0x5049c9(0x16c)],'status':_0x12e3de[_0x5049c9(0x18a)],..._0x12e3de[_0x5049c9(0x18b)]&&{'user_name':_0x12e3de[_0x5049c9(0x18b)]},..._0x2942a4!==undefined&&{'duration_sec':_0x2942a4},..._0x12e3de[_0x5049c9(0x165)]&&{'created_at':_0x12e3de[_0x5049c9(0x165)]},..._0x12e3de[_0x5049c9(0x19f)]&&{'started_at':_0x12e3de[_0x5049c9(0x19f)]},..._0x12e3de[_0x5049c9(0x19e)]&&{'end_at':_0x12e3de[_0x5049c9(0x19e)]},..._0x12e3de[_0x5049c9(0x157)]&&{'database':_0x12e3de[_0x5049c9(0x157)]},..._0x12e3de['priority']!==undefined&&{'priority':_0x12e3de['priority']},..._0x12e3de[_0x5049c9(0x1a2)]&&{'url':_0x12e3de[_0x5049c9(0x1a2)]},..._0x12e3de[_0x5049c9(0x15c)]&&{'query':_0x12e3de['query']},..._0x12e3de[_0x5049c9(0x173)]&&{'debug':_0x12e3de[_0x5049c9(0x173)]}};return await handleSingleObjectOutput(_0x6a6a6a,_0x354b83),0x0;}}export class JobKillCommand extends BaseCommand{['name']='job:kill';[a29_0x2eb8a4(0x178)]='Kill\x20a\x20job';['validate'](_0x13ab9a){const _0xd53170=a29_0x2eb8a4,_0x415ec9=_0x13ab9a[_0xd53170(0x188)][0x0];if(!_0x415ec9)return _0xd53170(0x180);return undefined;}async[a29_0x2eb8a4(0x174)](_0x3bafd5){const _0x507fa7=a29_0x2eb8a4,{options:_0x1aefa5,args:_0x417ee3,tdx:_0x438d32}=_0x3bafd5,_0x7d15ec=_0x417ee3[0x0];if(!_0x1aefa5[_0x507fa7(0x169)]){const _0x340307=await confirm(_0x507fa7(0x190)+_0x7d15ec+'?');if(!_0x340307)return console[_0x507fa7(0x15b)](_0x507fa7(0x16b)),0x0;}return await withSpinner(_0x507fa7(0x192),()=>_0x438d32[_0x507fa7(0x199)]['kill'](_0x7d15ec),{'verbose':_0x1aefa5[_0x507fa7(0x196)]}),console[_0x507fa7(0x15b)](_0x507fa7(0x19d)+_0x7d15ec),console['error'](_0x507fa7(0x155)+_0x7d15ec+_0x507fa7(0x179)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a29_0x2eb8a4(0x16f);['description']='Submit\x20a\x20job';async[a29_0x2eb8a4(0x174)](_0x37c70c){const _0x31075f=a29_0x2eb8a4,{options:_0x585995,args:_0x5441e7,tdx:_0x463b1d}=_0x37c70c,_0x551363=_0x585995['jobType']||_0x31075f(0x184),_0x177855=_0x585995[_0x31075f(0x163)],_0x381d11=_0x585995[_0x31075f(0x157)]||_0x31075f(0x181),_0x58b965=_0x585995[_0x31075f(0x189)];if(_0x551363!==_0x31075f(0x184)&&_0x551363!=='hive')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x31075f(0x160));let _0x76c84e;if(_0x177855){if(_0x5441e7[0x0])throw new SDKError(ErrorCode[_0x31075f(0x175)],_0x31075f(0x17a));const _0x2d286c=readSqlStatementsFromFile(_0x177855);if(_0x2d286c[_0x31075f(0x195)]===0x0)throw new SDKError(ErrorCode[_0x31075f(0x175)],_0x31075f(0x18d));if(_0x2d286c[_0x31075f(0x195)]>0x1)throw new SDKError(ErrorCode[_0x31075f(0x175)],_0x31075f(0x187));_0x76c84e=_0x2d286c[0x0];}else{if(!_0x5441e7[0x0])throw new SDKError(ErrorCode[_0x31075f(0x175)],_0x31075f(0x1a0));_0x76c84e=_0x5441e7[0x0];}_0x585995[_0x31075f(0x196)]&&(console['error']('Job\x20type:\x20'+_0x551363),console[_0x31075f(0x15b)](_0x31075f(0x182)+_0x381d11),console['error'](_0x31075f(0x15a)+_0x76c84e[_0x31075f(0x158)](0x0,0x64)+(_0x76c84e[_0x31075f(0x195)]>0x64?'...':'')));const _0x281378=await withSpinner('Submitting\x20job...',()=>_0x463b1d[_0x31075f(0x199)]['submit'](_0x381d11,_0x76c84e,_0x551363,_0x58b965),{'verbose':_0x585995[_0x31075f(0x196)]}),_0x325666=_0x281378['data'];return console[_0x31075f(0x15b)](_0x31075f(0x176)),console[_0x31075f(0x15b)]('\x20\x20Job\x20ID:\x20'+_0x325666[_0x31075f(0x171)]),await handleSDKOutput([_0x325666],_0x585995),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a29_0x2eb8a4(0x172);[a29_0x2eb8a4(0x178)]=a29_0x2eb8a4(0x159);['validate'](_0xddd75c){const _0x4e0b09=a29_0x2eb8a4,_0x10bbaa=_0xddd75c['args'][0x0];if(!_0x10bbaa)return _0x4e0b09(0x18c);return undefined;}async[a29_0x2eb8a4(0x174)](_0x220995){const _0x331290=a29_0x2eb8a4,{options:_0x3122d0,args:_0x538a51,tdx:_0x4c2662}=_0x220995,_0x4ba968=_0x538a51[0x0],_0x109219=await withSpinner('Getting\x20job\x20results...',()=>_0x4c2662['jobs'][_0x331290(0x189)](_0x4ba968),{'verbose':_0x3122d0['verbose']}),_0x53e786=_0x109219[_0x331290(0x194)];return console[_0x331290(0x15b)]('β\x20Retrieved\x20'+_0x53e786[_0x331290(0x195)]+'\x20row'+(_0x53e786[_0x331290(0x195)]!==0x1?'s':'')),await handleSDKOutput(_0x53e786,_0x3122d0),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x11bc0d=a27_0x39d5;(function(_0x60c9af,_0x3d4492){const _0x5a47ea=a27_0x39d5,_0x139784=_0x60c9af();while(!![]){try{const _0x55d8bb=-parseInt(_0x5a47ea(0x1ac))/0x1*(-parseInt(_0x5a47ea(0x1f2))/0x2)+-parseInt(_0x5a47ea(0x233))/0x3+parseInt(_0x5a47ea(0x1f1))/0x4*(parseInt(_0x5a47ea(0x1be))/0x5)+-parseInt(_0x5a47ea(0x29b))/0x6*(-parseInt(_0x5a47ea(0x25e))/0x7)+-parseInt(_0x5a47ea(0x26a))/0x8*(-parseInt(_0x5a47ea(0x275))/0x9)+parseInt(_0x5a47ea(0x24c))/0xa+-parseInt(_0x5a47ea(0x206))/0xb;if(_0x55d8bb===_0x3d4492)break;else _0x139784['push'](_0x139784['shift']());}catch(_0x541ba3){_0x139784['push'](_0x139784['shift']());}}}(a27_0x4ef5,0x20fac));import a27_0x503b10 from'chalk';import a27_0x5a60d6 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(_0x43df00){const _0x3de01a=a27_0x39d5;return!_0x43df00&&(console['error'](_0x3de01a(0x235)),console['error'](_0x3de01a(0x18e))),!!_0x43df00;}function withJsonFormat(_0x3fec20){const _0x20098c=a27_0x39d5;if(!_0x3fec20[_0x20098c(0x1b6)]&&!_0x3fec20[_0x20098c(0x172)]&&!_0x3fec20[_0x20098c(0x223)]&&!_0x3fec20[_0x20098c(0x193)])return{..._0x3fec20,'format':'json','json':!![]};return _0x3fec20;}function formatJourneyState(_0x76f7bc){const _0x37b77a=a27_0x39d5;switch(_0x76f7bc){case'launched':return a27_0x503b10['green'](_0x37b77a(0x260));case _0x37b77a(0x216):return a27_0x503b10[_0x37b77a(0x257)](_0x37b77a(0x1f6));case'paused':return a27_0x503b10[_0x37b77a(0x243)](_0x37b77a(0x242));case _0x37b77a(0x1cc):return a27_0x503b10[_0x37b77a(0x291)](_0x37b77a(0x20c));case _0x37b77a(0x189):return a27_0x503b10[_0x37b77a(0x257)](_0x37b77a(0x1a4));default:return'('+_0x76f7bc+')';}}function formatJourneyItem(_0x5b484f,_0x54ef37='',_0x2020a2){const _0x1bd692=a27_0x39d5,_0x3419f5=formatJourneyState(_0x5b484f[_0x1bd692(0x17f)]),_0x40b8c4=_0x2020a2?hyperlink(_0x5b484f[_0x1bd692(0x27f)],_0x2020a2):_0x5b484f[_0x1bd692(0x27f)];return _0x54ef37+_0x1bd692(0x202)+_0x40b8c4+'\x20'+_0x3419f5;}function escapeRegex(_0x420572){const _0x29509c=a27_0x39d5;return _0x420572[_0x29509c(0x1fd)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x7fdaa5){const _0x2d6a=a27_0x39d5,_0x30e12b=_0x7fdaa5['split']('*')[_0x2d6a(0x184)](escapeRegex);return new RegExp(_0x30e12b[_0x2d6a(0x1cf)]('.*'),'i');}function a27_0x39d5(_0x41f031,_0x2982ae){_0x41f031=_0x41f031-0x16f;const _0x4ef5f4=a27_0x4ef5();let _0x39d578=_0x4ef5f4[_0x41f031];return _0x39d578;}function buildRuleToNameMapping(_0x473418){const _0x21223e=a27_0x39d5,_0x4f9632=new Map();if(_0x473418[_0x21223e(0x187)])for(const [_0x275cba,_0x10ecea]of Object[_0x21223e(0x296)](_0x473418[_0x21223e(0x187)])){if(_0x10ecea['rule']){const _0x6a7825=serializeRule(_0x10ecea['rule']),_0x3430dd=_0x4f9632[_0x21223e(0x237)](_0x6a7825);_0x3430dd?_0x3430dd[_0x21223e(0x213)](_0x275cba):_0x4f9632[_0x21223e(0x1fb)](_0x6a7825,[_0x275cba]);}}return _0x4f9632;}function a27_0x4ef5(){const _0x5ea418=['relative','run','journey:resume','set','version','replace','Error:\x20--version\x20option\x20is\x20required','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','red','rootFolderId','πΊοΈ\x20','verbose','isNew','\x20\x20Target:\x20','2344639dtihrc','from','getSegment','\x20\x20Journey\x20ID:\x20','getLatestJourneyId','Pause\x20a\x20running\x20journey','(completed)','journeyId','journey:versions','runAt','all','history','resolveSegment','push','Pausing\x20journey...','listJourneysFromParentSegment','draft','exitOrJumpRate','conversion','exitOrJumpSize','Error:\x20Journey\x20\x27','\x20versions)','targetDir','stageNameMap','\x20files?','\x20\x20Parent\x20segment:\x20','\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.','journeyStages','\x20\x20-\x20','jsonl','Resolving\x20version...','name','\x20[runs\x20on\x20refresh]','paused','segmentPushCommand','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','(unnamed)','connection\x20','activationParams','getJourney','Getting\x20journey\x20statistics...','Activations:','\x20(rule\x20match)','journey:run','\x22\x20paused','601581SfgjKO','Resolving\x20journey...','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','β οΈ\x20','get','Journey:','\x20\x20Statistics\x20not\x20available','resolveParentId','π\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','-\x20no\x20files\x20written','...','dryRun','table','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','(paused)','yellow','yes','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','log','tdx.json','completeMilestoneRate','options','journeyBundleId','getActivation','2317170sVGOuv','β\x20Pulled\x20','Journey\x20name:\x20','setPhase','Aborted.','columns','Folder\x20path:\x20','listVersions','Fetching\x20journeys\x20and\x20folders...','Warning:\x20Could\x20not\x20resolve\x20activation\x20','buildIdToEmailMap','dim','helpText','journey:push','journeyName','size','segment','Show\x20journey\x20details','94479ypDenS','Getting\x20journey\x20details...','(running)','List\x20activations\x20for\x20a\x20journey','stages','journey:columns','utf-8','milestoneSize','.journey.yml','Fetching\x20users\x20and\x20connections...',',\x20schedule:\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','87432eJSwyq','folders','kind','limit','β\x20Found\x20','listFolders','No\x20statistics\x20available\x20for\x20journey:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','filePath','9ASBZsx','List\x20all\x20versions\x20of\x20a\x20journey','Available\x20stages:\x20','\x20journeys','message','base','Export\x20journey(s)\x20as\x20YAML\x20files','β\x20Context\x20set:\x20','executeDryRun','errorCode','journeyBundleName','Error:\x20Invalid\x20version\x20number:\x20','description','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journey:traffic','completionRate','/j/da/je','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','green','filter','sort','\x20@\x20','Paused\x20at:','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Fetching\x20journey\x20','Resume\x20a\x20paused\x20journey','createdAt','error','blue','INVALID_ARGUMENT','\x20journey\x20files\x20to\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','workflowSessionId','entries','/e/','has','Parent\x20segment:\x20','getColumnMapping','6ZWHMPB','\x20details...','connection','No\x20journeys\x20found','ID:','createVersion','journey:pull','listActivationsFlat','no\x20connection','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','values','hasChanges','site','folderId','Trigger\x20on-demand\x20journey\x20workflow\x20execution','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:view','audienceId','toLowerCase','relativePath','json','length','includeHistory','enteredSize','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','execute','segmentName','Paused:','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','user','file','Triggering\x20journey\x20workflow...','state','Resolving\x20parent\x20segment...','hasPeriod','links','\x0aError:','map','connectionId','stage','segments','absolutePath','archived','parent_segment','session','versionNumber','(root)','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20\x20β\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','pause','\x20->\x20','tsv','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','Cancelled','journey:pause','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','cwd','getStatistics','Target\x20directory:\x20','cyan','goalSize','\x20\x20Consolidating\x20duplicate\x20segment:\x20','add','Creating\x20new\x20version...','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','journey','bold','type','(archived)','Write\x20','Error:\x20','Listing\x20journeys...','Options:','test','Error:\x20Version\x20','\x20not\x20found.\x20Available:\x20','26291SgBLTI','Getting\x20column\x20mapping...','pausedAt','Show\x20journey\x20table\x20column\x20mapping','folderPath','\x20Created\x20v','rule','activation','Fetching\x20','Pattern:\x20','format','\x20Opening\x20','resume','\x20=\x20','\x20Journey\x20workflow\x20started','Resuming\x20journey...','Session:','listJourneysWithFolders','2435svBmzF','renderStats','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','Database:\x20','β\x20All\x20files\x20are\x20up\x20to\x20date','\x20activation','Status:','Table:\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','data','goal','localeCompare','nodes','Error:\x20Stage\x20\x22','completed','stringify','parentSegment','join','State:','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','/app/ps/','\x20journey','runAfterJourneyRefresh','repeat','(none)','scheduleType','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','attributes','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','web','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','workflowId','\x22\x20resumed','connector_config','Listing\x20journey\x20versions...','journey:activations','journey:version:create','Error:\x20Invalid\x20--type\x20\x22','Stages:','Found\x20','database','getParentFull','Input:\x20','journey:version:view','find','β\x20Journey\x20\x22','buildIdToNameMap','updatedAt','status','includeStats','\x20\x20Name:\x20','244LnqmHL','20SpDROu','Parent\x20segment\x20ID:','journeys','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','(draft)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure'];a27_0x4ef5=function(){return _0x5ea418;};return a27_0x4ef5();}async function resolveJourneyIdFromInput(_0x5cc642,_0x960da2,_0x3f639e){const _0x8c391e=a27_0x39d5,_0xe5bb5e=await resolveJourneyTarget(_0x5cc642,_0x960da2[_0x8c391e(0x1ce)],_0x960da2['verbose']),_0x230bb9=_0xe5bb5e['parentSegment'];if(!_0x230bb9)throw new SDKError(ErrorCode[_0x8c391e(0x292)],_0x8c391e(0x229));const _0x2059d9=await withSpinner(_0x8c391e(0x180),()=>_0x3f639e[_0x8c391e(0x25c)][_0x8c391e(0x23a)](_0x230bb9),{'verbose':_0x960da2[_0x8c391e(0x203)]}),_0x26ff22=_0x2059d9['data'],_0x2bbd67=await withSpinner(_0x8c391e(0x234),()=>_0x3f639e[_0x8c391e(0x1a1)]['resolveJourneyId'](_0x26ff22,_0xe5bb5e['journeyName']),{'verbose':_0x960da2['verbose']});return{'journeyId':_0x2bbd67['data'],'journeyName':_0xe5bb5e[_0x8c391e(0x25a)],'parentSegmentId':_0x26ff22};}async function resolveJourneyTarget(_0x598586,_0x3e85b3,_0x4724f9){const _0x3dbe6b=a27_0x39d5;if(isYamlFilePath(_0x598586))try{const _0x5c0bd6=await resolveYamlFilePath(_0x598586);return _0x4724f9&&(console[_0x3dbe6b(0x290)]('Resolved\x20YAML\x20file:\x20'+_0x598586),console[_0x3dbe6b(0x290)](_0x3dbe6b(0x21f)+_0x5c0bd6[_0x3dbe6b(0x1ce)]),console[_0x3dbe6b(0x290)](_0x3dbe6b(0x1f0)+_0x5c0bd6['segmentName']),console[_0x3dbe6b(0x290)]('\x20\x20Folder\x20path:\x20'+(_0x5c0bd6['folderPath']||_0x3dbe6b(0x18d)))),{'journeyName':_0x5c0bd6[_0x3dbe6b(0x178)],'parentSegment':_0x5c0bd6[_0x3dbe6b(0x1ce)],'resolved':_0x5c0bd6};}catch(_0x2b7e34){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3dbe6b(0x241)+_0x2b7e34['message']);}if(!_0x3e85b3)throw new SDKError(ErrorCode[_0x3dbe6b(0x292)],_0x3dbe6b(0x190));return{'journeyName':_0x598586,'parentSegment':_0x3e85b3};}export class JourneyListCommand extends BaseCommand{[a27_0x11bc0d(0x225)]='journey:list';[a27_0x11bc0d(0x281)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x11bc0d(0x177)](_0x3b3c26){const _0x383604=a27_0x11bc0d,{options:_0x202aa9,args:_0x1f29da,tdx:_0x1ed258}=_0x3b3c26,_0x1e75de=_0x1f29da[0x0],_0x16a219=_0x202aa9[_0x383604(0x1ce)];if(!_0x16a219)return console[_0x383604(0x290)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0x383604(0x1d8)),0x1;const _0x560e88=await withSpinner(_0x383604(0x180),()=>_0x1ed258['segment'][_0x383604(0x23a)](_0x16a219),{'verbose':_0x202aa9[_0x383604(0x203)]}),_0x2b6b3b=_0x560e88[_0x383604(0x1c7)];_0x202aa9[_0x383604(0x203)]&&(console[_0x383604(0x290)](_0x383604(0x299)+_0x16a219+'\x20(ID:\x20'+_0x2b6b3b+')'),_0x1e75de&&console[_0x383604(0x290)](_0x383604(0x1b5)+_0x1e75de));const _0x548918=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x1ed258[_0x383604(0x25c)][_0x383604(0x1e7)](_0x2b6b3b),{'verbose':_0x202aa9[_0x383604(0x203)]}),_0x32ec2e=_0x548918[_0x383604(0x1c7)],_0x36f9ef=_0x32ec2e[_0x383604(0x201)],_0x373a80=await withSpinner(_0x383604(0x1a7),()=>_0x1ed258[_0x383604(0x1a1)][_0x383604(0x1bd)](_0x2b6b3b,_0x36f9ef),{'verbose':_0x202aa9[_0x383604(0x203)]});let _0x379dcd=_0x373a80['data'][_0x383604(0x1f4)];const _0x237c2d=_0x373a80[_0x383604(0x1c7)][_0x383604(0x26b)],_0x26a28f=new Map();for(const _0x41e0b1 of _0x237c2d){_0x26a28f['set'](_0x41e0b1['id'],_0x41e0b1[_0x383604(0x225)]);}if(_0x1e75de){const _0x3541d6=globToRegex(_0x1e75de);_0x379dcd=_0x379dcd[_0x383604(0x288)](_0x53850d=>_0x3541d6[_0x383604(0x1a9)](_0x53850d[_0x383604(0x27f)]));}console['error'](_0x383604(0x26e)+_0x379dcd[_0x383604(0x173)]+_0x383604(0x1d3)+(_0x379dcd[_0x383604(0x173)]!==0x1?'s':''));const _0x58b789=_0x10b511=>{const _0x2fb9c7=_0x383604;return getConsoleNextUrl(_0x202aa9[_0x2fb9c7(0x2a7)],_0x2fb9c7(0x1d2)+_0x2b6b3b+_0x2fb9c7(0x297)+_0x10b511+'/j/da');};if(_0x202aa9[_0x383604(0x1b6)]===_0x383604(0x240))await handleSDKOutput(_0x379dcd,_0x202aa9);else{if(_0x202aa9['format']===_0x383604(0x172)){const _0x2e546d=_0x379dcd[_0x383604(0x184)](_0x2f9242=>({..._0x2f9242,'url':_0x58b789(_0x2f9242['id'])}));await handleSDKOutput(_0x2e546d,_0x202aa9);}else{console['log']('['+_0x16a219+']');const _0x45a6c8=new Map(),_0x1312ce=[];for(const _0x439f1a of _0x379dcd){if(!_0x439f1a[_0x383604(0x2a8)]||_0x439f1a['folderId']===_0x36f9ef)_0x1312ce[_0x383604(0x213)](_0x439f1a);else{const _0x4311a4=_0x45a6c8[_0x383604(0x237)](_0x439f1a[_0x383604(0x2a8)])||[];_0x4311a4['push'](_0x439f1a),_0x45a6c8[_0x383604(0x1fb)](_0x439f1a['folderId'],_0x4311a4);}}const _0x394999=(_0x21a0b5,_0x458db0)=>_0x21a0b5[_0x383604(0x27f)][_0x383604(0x1c9)](_0x458db0[_0x383604(0x27f)],undefined,{'sensitivity':_0x383604(0x27a)});_0x1312ce[_0x383604(0x289)](_0x394999);for(const _0x4e737f of _0x1312ce){console[_0x383604(0x246)](formatJourneyItem(_0x4e737f,'',_0x58b789(_0x4e737f['id'])));}const _0x5f2c13=[..._0x45a6c8[_0x383604(0x296)]()][_0x383604(0x289)]((_0x40f977,_0x14a590)=>{const _0x1e9bf2=_0x383604,_0x3c56e8=_0x26a28f[_0x1e9bf2(0x237)](_0x40f977[0x0])||_0x40f977[0x0],_0xc8dd6e=_0x26a28f[_0x1e9bf2(0x237)](_0x14a590[0x0])||_0x14a590[0x0];return _0x3c56e8[_0x1e9bf2(0x1c9)](_0xc8dd6e,undefined,{'sensitivity':_0x1e9bf2(0x27a)});});for(const [_0x209f5f,_0x5f1205]of _0x5f2c13){const _0x85cab0=_0x26a28f[_0x383604(0x237)](_0x209f5f)||_0x209f5f;console[_0x383604(0x246)](_0x383604(0x23b)+_0x85cab0),_0x5f1205[_0x383604(0x289)](_0x394999);for(const _0x1c1c2e of _0x5f1205){console[_0x383604(0x246)](formatJourneyItem(_0x1c1c2e,'\x20\x20',_0x58b789(_0x1c1c2e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x2ab);['description']=a27_0x11bc0d(0x25d);async[a27_0x11bc0d(0x177)](_0x13835a){const _0x2b5c41=a27_0x11bc0d,{options:_0xd1bde1,args:_0x3f7831,tdx:_0x36555e}=_0x13835a,_0x523fc5=_0x3f7831[0x0];if(!_0x523fc5)return console[_0x2b5c41(0x290)](_0x2b5c41(0x235)),console['error']('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x2b5c41(0x290)](_0x2b5c41(0x1a8)),console[_0x2b5c41(0x290)](_0x2b5c41(0x286)),0x1;_0xd1bde1[_0x2b5c41(0x203)]&&console[_0x2b5c41(0x290)](_0x2b5c41(0x1e8)+_0x523fc5);const {journeyId:_0x35479c,parentSegmentId:_0x400768}=await resolveJourneyIdFromInput(_0x523fc5,_0xd1bde1,_0x36555e);if(_0xd1bde1[_0x2b5c41(0x1db)]){const _0x3d3275=getConsoleNextUrl(_0xd1bde1['site'],_0x2b5c41(0x1d2)+_0x400768+_0x2b5c41(0x297)+_0x35479c+_0x2b5c41(0x285));return console[_0x2b5c41(0x290)](a27_0x503b10[_0x2b5c41(0x287)]('β')+_0x2b5c41(0x1b7)+a27_0x503b10[_0x2b5c41(0x19b)](_0x3d3275)),openBrowser(_0x3d3275),0x0;}const _0x17b18d=await withSpinner(_0x2b5c41(0x25f),()=>_0x36555e[_0x2b5c41(0x1a1)][_0x2b5c41(0x22d)](_0x35479c),{'verbose':_0xd1bde1['verbose']}),_0x1f2446=_0x17b18d['data'],_0x423ca6=_0xd1bde1[_0x2b5c41(0x1ef)];let _0xaa01ca;if(_0x423ca6)try{const _0x28ed00=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x36555e[_0x2b5c41(0x1a1)][_0x2b5c41(0x199)](_0x35479c),{'verbose':_0xd1bde1['verbose']});_0xaa01ca=_0x28ed00[_0x2b5c41(0x1c7)];}catch{_0xd1bde1[_0x2b5c41(0x203)]&&console['error'](_0x2b5c41(0x239));}const _0x452206=getConsoleNextUrl(_0xd1bde1[_0x2b5c41(0x2a7)],_0x2b5c41(0x1d2)+_0x400768+_0x2b5c41(0x297)+_0x35479c+_0x2b5c41(0x285)),_0x4701ad={'id':_0x1f2446['id'],'name':_0x1f2446[_0x2b5c41(0x1d9)]['name'],'description':_0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x281)],'state':_0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x17f)],'paused':_0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x227)],'reentry_mode':_0x1f2446[_0x2b5c41(0x1d9)]['reentryMode'],'stages':_0x1f2446['attributes'][_0x2b5c41(0x221)]?.[_0x2b5c41(0x173)]||0x0,..._0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x1c8)]&&{'goal':_0x1f2446[_0x2b5c41(0x1d9)][_0x2b5c41(0x1c8)][_0x2b5c41(0x225)]},..._0xaa01ca&&{'statistics':{'size':_0xaa01ca['size'],'entered':_0xaa01ca[_0x2b5c41(0x175)],'goal_achieved':_0xaa01ca[_0x2b5c41(0x19c)],'completion_rate':_0xaa01ca[_0x2b5c41(0x284)],'exit_or_jump':_0xaa01ca[_0x2b5c41(0x219)],'exit_or_jump_rate':_0xaa01ca[_0x2b5c41(0x217)],'stages':_0xaa01ca[_0x2b5c41(0x262)]}},'url':_0x452206};return await handleSingleObjectOutput(_0x4701ad,_0xd1bde1),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x11bc0d(0x225)]='journey:stats';[a27_0x11bc0d(0x281)]='Show\x20journey\x20statistics';async[a27_0x11bc0d(0x177)](_0x3ab7b3){const _0x274627=a27_0x11bc0d,{options:_0x47c06c,args:_0x58c78c,tdx:_0x2db683}=_0x3ab7b3,_0x5cf7ec=_0x58c78c[0x0];if(!requireNameOrPath(_0x5cf7ec))return 0x1;_0x47c06c[_0x274627(0x203)]&&console[_0x274627(0x290)](_0x274627(0x1e8)+_0x5cf7ec);const _0x5c8d38=_0x47c06c,_0x2200e5=_0x5c8d38[_0x274627(0x207)],_0x12d320=_0x5c8d38['to'],_0xaa4f6f=_0x5c8d38[_0x274627(0x174)],_0x1bd727=_0x5c8d38[_0x274627(0x186)];_0xaa4f6f&&!_0x2200e5&&!_0x12d320&&console[_0x274627(0x290)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x5ccc1f=_0xaa4f6f?withJsonFormat(_0x47c06c):_0x47c06c,{journeyId:_0x334306,journeyName:_0xee44d6}=await resolveJourneyIdFromInput(_0x5cf7ec,_0x5ccc1f,_0x2db683),_0x429daa=_0x2200e5||_0x12d320?{'from':_0x2200e5,'to':_0x12d320}:undefined,_0x525813=await withSpinner(_0x274627(0x22e),()=>Promise[_0x274627(0x210)]([_0x2db683['journey'][_0x274627(0x22d)](_0x334306),_0x2db683[_0x274627(0x1a1)][_0x274627(0x199)](_0x334306,_0x429daa)]),{'verbose':_0x5ccc1f[_0x274627(0x203)]}),[_0x1f1ef6,_0x4301c0]=_0x525813[_0x274627(0x1c7)];if(!_0x4301c0||_0x4301c0['journeyId']===null)return console['error'](_0x274627(0x270)+_0xee44d6),console[_0x274627(0x290)](_0x274627(0x2a4)),0x0;const _0x11d45f=buildStageNameMap(_0x1f1ef6),_0x248e56=!!(_0x429daa&&_0x4301c0[_0x274627(0x211)]?.['length']),_0x3d46d6={'stageNameMap':_0x11d45f,'hasPeriod':_0x248e56,'includeHistory':!!_0xaa4f6f};if(_0x1bd727&&_0x4301c0[_0x274627(0x262)]){const _0x1b46e7=_0x4301c0[_0x274627(0x262)][_0x274627(0x1ea)](_0x586652=>{const _0x99bf38=_0x274627,_0x1d0b00=_0x11d45f[_0x99bf38(0x237)](_0x586652['id'])??'';return _0x1d0b00['toLowerCase']()===_0x1bd727[_0x99bf38(0x170)]();});if(_0x1b46e7)return await handleSingleObjectOutput(formatStageStats(_0x1b46e7,_0x3d46d6),_0x5ccc1f),0x0;const _0x3c2ecb=_0x4301c0[_0x274627(0x262)]['map'](_0x1be1fd=>_0x11d45f['get'](_0x1be1fd['id'])??_0x1be1fd['id']);return console[_0x274627(0x290)](_0x274627(0x1cb)+_0x1bd727+'\x22\x20not\x20found'),console[_0x274627(0x290)](_0x274627(0x277)+_0x3c2ecb[_0x274627(0x1cf)](',\x20')),0x1;}const _0x561e1c=_0x4301c0['stages']?.[_0x274627(0x184)](_0xf79499=>formatStageStats(_0xf79499,_0x3d46d6)),_0x12a98a=assembleJourneyStats(_0x4301c0,{'from':_0x2200e5,'to':_0x12d320,'includeHistory':_0xaa4f6f});return await this['renderStats'](_0x12a98a,_0x561e1c??[],_0x5ccc1f),0x0;}async[a27_0x11bc0d(0x1bf)](_0x4ea4b3,_0x34df5,_0x3c60e8){const _0x19fe08=a27_0x11bc0d,_0x10cd6b=_0x3c60e8[_0x19fe08(0x1b6)]==='json'||_0x3c60e8[_0x19fe08(0x1b6)]===_0x19fe08(0x223)||_0x3c60e8[_0x19fe08(0x172)]||_0x3c60e8[_0x19fe08(0x223)];if(_0x10cd6b){_0x4ea4b3[_0x19fe08(0x262)]=_0x34df5,await handleSingleObjectOutput(_0x4ea4b3,_0x3c60e8);return;}await handleSingleObjectOutput(_0x4ea4b3,_0x3c60e8);for(const _0x2414a2 of _0x34df5){console[_0x19fe08(0x246)](''),console[_0x19fe08(0x246)](String(a27_0x503b10['cyan'][_0x19fe08(0x1a2)]('['+_0x2414a2[_0x19fe08(0x225)]+']'))+a27_0x503b10['dim']('\x20'+_0x2414a2['id']));const {id:_0x27bf55,name:_0xe8e5fe,..._0x21c199}=_0x2414a2;await handleSingleObjectOutput(_0x21c199,_0x3c60e8);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x283);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x17a);async['execute'](_0x531fb8){const _0x1bbc6e=a27_0x11bc0d,{options:_0x3b1175,args:_0x127c32,tdx:_0x1ddf5a}=_0x531fb8,_0x121d47=_0x127c32[0x0];if(!requireNameOrPath(_0x121d47))return 0x1;_0x3b1175[_0x1bbc6e(0x203)]&&console[_0x1bbc6e(0x290)](_0x1bbc6e(0x1e8)+_0x121d47);const _0x4f16ca=_0x3b1175,_0x128f2c=_0x4f16ca['type'],_0x5675cd=_0x4f16ca[_0x1bbc6e(0x207)],_0x3ea959=_0x4f16ca['to'],_0x41ba2c=_0x4f16ca[_0x1bbc6e(0x26d)];if(_0x128f2c&&_0x128f2c!==_0x1bbc6e(0x218)&&_0x128f2c!==_0x1bbc6e(0x1b3))return console[_0x1bbc6e(0x290)](_0x1bbc6e(0x1e3)+_0x128f2c+_0x1bbc6e(0x1c6)),0x1;const _0x2dc23a=withJsonFormat(_0x3b1175),{journeyId:_0x48264a,journeyName:_0x292bc2}=await resolveJourneyIdFromInput(_0x121d47,_0x2dc23a,_0x1ddf5a),_0x1490bf={'type':_0x128f2c,'from':_0x5675cd,'to':_0x3ea959,'limit':_0x41ba2c},_0x48f355=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x1ddf5a[_0x1bbc6e(0x1a1)]['getTrafficData'](_0x48264a,_0x1490bf),{'verbose':_0x2dc23a['verbose']}),_0x1e30bf=_0x48f355[_0x1bbc6e(0x1c7)],_0x54067b=_0x1e30bf[_0x1bbc6e(0x218)]&&(_0x1e30bf[_0x1bbc6e(0x218)][_0x1bbc6e(0x1ca)][_0x1bbc6e(0x173)]>0x0||_0x1e30bf[_0x1bbc6e(0x218)][_0x1bbc6e(0x182)][_0x1bbc6e(0x173)]>0x0),_0x41f9bd=_0x1e30bf['activation']&&_0x1e30bf['activation'][_0x1bbc6e(0x173)]>0x0;if(!_0x54067b&&!_0x41f9bd)return console['error'](_0x1bbc6e(0x1d1)+_0x292bc2),console[_0x1bbc6e(0x290)](_0x1bbc6e(0x245)),_0x5675cd&&_0x3ea959&&console[_0x1bbc6e(0x290)](_0x1bbc6e(0x1f5)),0x0;return await handleSingleObjectOutput(_0x1e30bf,_0x2dc23a),0x0;}}function formatStageStats(_0x3dfe0b,_0x127a14){const _0x3f6f66=a27_0x11bc0d,_0x475023=_0x127a14['hasPeriod']&&_0x3dfe0b[_0x3f6f66(0x211)]?.['length']?aggregateStageHistory(_0x3dfe0b['history']):{'size':_0x3dfe0b[_0x3f6f66(0x25b)],'entered':_0x3dfe0b[_0x3f6f66(0x175)],'milestone':_0x3dfe0b[_0x3f6f66(0x265)],'milestone_rate':_0x3dfe0b[_0x3f6f66(0x248)],'exit_or_jump':_0x3dfe0b['exitOrJumpSize'],'exit_or_jump_rate':_0x3dfe0b[_0x3f6f66(0x217)]},_0x4702ed={'id':_0x3dfe0b['id'],'name':_0x127a14[_0x3f6f66(0x21d)]['get'](_0x3dfe0b['id'])??_0x3dfe0b['id'],..._0x475023};return _0x127a14[_0x3f6f66(0x181)]&&_0x127a14[_0x3f6f66(0x174)]&&_0x3dfe0b[_0x3f6f66(0x211)]&&(_0x4702ed[_0x3f6f66(0x211)]=_0x3dfe0b[_0x3f6f66(0x211)]),_0x4702ed;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x11bc0d(0x196);['description']=a27_0x11bc0d(0x20b);async['execute'](_0x5a7226){const _0x4b5775=a27_0x11bc0d,{options:_0x31aa4b,args:_0x26d187,tdx:_0xb8bbf}=_0x5a7226,_0x18d2ac=_0x26d187[0x0];if(!requireNameOrPath(_0x18d2ac))return 0x1;_0x31aa4b[_0x4b5775(0x203)]&&console[_0x4b5775(0x290)]('Input:\x20'+_0x18d2ac);const {journeyId:_0x2abf96,journeyName:_0x1fb53c}=await resolveJourneyIdFromInput(_0x18d2ac,_0x31aa4b,_0xb8bbf);if(!_0x31aa4b[_0x4b5775(0x244)]){const _0x16097f=await confirm(_0x4b5775(0x1dc)+_0x1fb53c+'\x22?');if(!_0x16097f)return console[_0x4b5775(0x290)](_0x4b5775(0x195)),0x0;}const _0x4b73e5=await withSpinner(_0x4b5775(0x214),()=>_0xb8bbf[_0x4b5775(0x1a1)][_0x4b5775(0x191)](_0x2abf96),{'verbose':_0x31aa4b[_0x4b5775(0x203)]}),_0x530c36=_0x4b73e5[_0x4b5775(0x1c7)];return console[_0x4b5775(0x290)]('β\x20Journey\x20\x22'+_0x530c36[_0x4b5775(0x1d9)]['name']+_0x4b5775(0x232)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x231);['description']=a27_0x11bc0d(0x2a9);async[a27_0x11bc0d(0x177)](_0x388a1b){const _0x241493=a27_0x11bc0d,{options:_0x11acb9,args:_0x14dcd2,tdx:_0x583c12}=_0x388a1b,_0x1527c7=_0x14dcd2[0x0];if(!requireNameOrPath(_0x1527c7))return 0x1;_0x11acb9[_0x241493(0x203)]&&console['error'](_0x241493(0x1e8)+_0x1527c7);const {journeyId:_0x138050,journeyName:_0x3ccb57}=await resolveJourneyIdFromInput(_0x1527c7,_0x11acb9,_0x583c12);if(_0x11acb9[_0x241493(0x23f)])return await this[_0x241493(0x27d)](_0x388a1b,_0x138050,_0x3ccb57);if(!_0x11acb9[_0x241493(0x244)]){const _0x2363e9=await confirm(_0x241493(0x273)+_0x3ccb57+'\x22?');if(!_0x2363e9)return console[_0x241493(0x290)]('Cancelled'),0x0;}const _0x3691fc=await withSpinner(_0x241493(0x17e),()=>_0x583c12[_0x241493(0x1a1)][_0x241493(0x1f9)](_0x138050),{'verbose':_0x11acb9[_0x241493(0x203)]}),_0x59efec=_0x3691fc[_0x241493(0x1c7)],_0x2cec2c=getWorkflowSessionUrl(_0x11acb9['site'],_0x59efec[_0x241493(0x1dd)],_0x59efec['workflowSessionId']);return console['error']('\x0a'+a27_0x503b10[_0x241493(0x287)]('β')+_0x241493(0x1ba)),console['error']('\x20\x20'+a27_0x503b10[_0x241493(0x257)](_0x241493(0x238))+'\x20'+_0x3ccb57),console[_0x241493(0x290)]('\x20\x20'+a27_0x503b10[_0x241493(0x257)](_0x241493(0x1c4))+'\x20'+_0x59efec[_0x241493(0x1ee)]),console[_0x241493(0x290)]('\x20\x20'+a27_0x503b10[_0x241493(0x257)](_0x241493(0x1bc))+'\x20'+_0x59efec[_0x241493(0x295)]),console[_0x241493(0x290)]('\x20\x20'+_0x2cec2c),0x0;}async[a27_0x11bc0d(0x27d)](_0x4400cc,_0x405117,_0x2c0ee0){const _0x2b2782=a27_0x11bc0d,{options:_0x2e3104,tdx:_0x1966a6}=_0x4400cc,_0x1fd631=await withSpinner(_0x2b2782(0x28d)+_0x2c0ee0+_0x2b2782(0x23e),()=>Promise['all']([_0x1966a6[_0x2b2782(0x1a1)]['getJourney'](_0x405117),_0x1966a6[_0x2b2782(0x1a1)][_0x2b2782(0x2a2)](_0x405117)]),{'verbose':_0x2e3104[_0x2b2782(0x203)]}),[_0x5af203,_0x3fb741]=_0x1fd631[_0x2b2782(0x1c7)],_0x5b4a50=_0x5af203['attributes'],_0x494158=_0x5b4a50['journeyStages'];console[_0x2b2782(0x246)](a27_0x503b10[_0x2b2782(0x1a2)](_0x2b2782(0x238)),_0x5b4a50['name']),console[_0x2b2782(0x246)](a27_0x503b10['bold'](_0x2b2782(0x29f)),_0x5af203['id']),console['log'](a27_0x503b10['bold'](_0x2b2782(0x1d0)),_0x5b4a50['state']),console[_0x2b2782(0x246)](a27_0x503b10[_0x2b2782(0x1a2)](_0x2b2782(0x179)),_0x5b4a50['paused']?a27_0x503b10[_0x2b2782(0x243)](_0x2b2782(0x244)):a27_0x503b10['green']('no')),console['log'](a27_0x503b10['bold'](_0x2b2782(0x1f3)),_0x5b4a50['audienceId']);const _0x210e57=_0x494158[_0x2b2782(0x173)]>0x0?'\x20('+_0x494158[_0x2b2782(0x184)](_0x219399=>_0x219399[_0x2b2782(0x225)])[_0x2b2782(0x1cf)](',\x20')+')':'';console[_0x2b2782(0x246)](a27_0x503b10['bold'](_0x2b2782(0x1e4)),''+_0x494158[_0x2b2782(0x173)]+_0x210e57),console['log']('');if(_0x3fb741['length']===0x0)console[_0x2b2782(0x246)](a27_0x503b10[_0x2b2782(0x1a2)](_0x2b2782(0x22f)),a27_0x503b10[_0x2b2782(0x257)](_0x2b2782(0x1d6)));else{console[_0x2b2782(0x246)](a27_0x503b10[_0x2b2782(0x1a2)](_0x2b2782(0x22f)));for(const _0x488107 of _0x3fb741){const _0x53abba=_0x488107[_0x2b2782(0x225)]??_0x2b2782(0x22a),_0x237b25=_0x488107[_0x2b2782(0x185)]!=null?'connection\x20'+_0x488107[_0x2b2782(0x185)]:_0x2b2782(0x2a3),_0x129a0b=_0x488107[_0x2b2782(0x1d7)]?''+_0x488107[_0x2b2782(0x1d7)]+(_0x488107[_0x2b2782(0x20f)]?_0x2b2782(0x28a)+_0x488107[_0x2b2782(0x20f)]:''):'none',_0x306841=_0x488107[_0x2b2782(0x1d4)]?_0x2b2782(0x226):'';console[_0x2b2782(0x246)]('\x20\x20'+a27_0x503b10[_0x2b2782(0x243)]('β οΈ\x20')+'\x20'+_0x53abba+_0x2b2782(0x18f)+_0x237b25+_0x2b2782(0x268)+_0x129a0b+_0x306841);}}return console[_0x2b2782(0x246)](a27_0x503b10['yellow']('\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.')),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x1fa);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x28e);async['execute'](_0x30c241){const _0x410171=a27_0x11bc0d,{options:_0x32360b,args:_0x120efb,tdx:_0x2c06af}=_0x30c241,_0x18ebf1=_0x120efb[0x0];if(!requireNameOrPath(_0x18ebf1))return 0x1;_0x32360b[_0x410171(0x203)]&&console['error']('Input:\x20'+_0x18ebf1);const {journeyId:_0x147a33,journeyName:_0xcf3a40}=await resolveJourneyIdFromInput(_0x18ebf1,_0x32360b,_0x2c06af);if(_0x32360b[_0x410171(0x23f)])return await this[_0x410171(0x27d)](_0x30c241,_0x147a33,_0xcf3a40);if(!_0x32360b[_0x410171(0x244)]){const _0x2a90fd=await confirm(_0x410171(0x1da)+_0xcf3a40+'\x22?');if(!_0x2a90fd)return console['error'](_0x410171(0x195)),0x0;}const _0xacf303=await withSpinner(_0x410171(0x1bb),()=>_0x2c06af[_0x410171(0x1a1)][_0x410171(0x1b8)](_0x147a33),{'verbose':_0x32360b[_0x410171(0x203)]}),_0x2e7909=_0xacf303[_0x410171(0x1c7)];return console[_0x410171(0x290)](_0x410171(0x1eb)+_0x2e7909['attributes'][_0x410171(0x225)]+_0x410171(0x1de)),0x0;}async[a27_0x11bc0d(0x27d)](_0x26d2e0,_0x57a6f,_0x140a85){const _0x1e3c33=a27_0x11bc0d,{options:_0x56fe18,tdx:_0x1b3062}=_0x26d2e0,_0x4a81ef=await withSpinner(_0x1e3c33(0x28d)+_0x140a85+_0x1e3c33(0x23e),()=>Promise[_0x1e3c33(0x210)]([_0x1b3062[_0x1e3c33(0x1a1)][_0x1e3c33(0x22d)](_0x57a6f),_0x1b3062['journey']['listActivationsFlat'](_0x57a6f)]),{'verbose':_0x56fe18['verbose']}),[_0x42f9da,_0x3e07e0]=_0x4a81ef[_0x1e3c33(0x1c7)],_0x13bc53=_0x42f9da[_0x1e3c33(0x1d9)],_0x389f4e=_0x13bc53[_0x1e3c33(0x221)];console[_0x1e3c33(0x246)](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x238)),_0x13bc53[_0x1e3c33(0x225)]),console[_0x1e3c33(0x246)](a27_0x503b10['bold'](_0x1e3c33(0x29f)),_0x42f9da['id']),console[_0x1e3c33(0x246)](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x1d0)),_0x13bc53[_0x1e3c33(0x17f)]),console[_0x1e3c33(0x246)](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x179)),_0x13bc53[_0x1e3c33(0x227)]?a27_0x503b10['yellow'](_0x1e3c33(0x244)):a27_0x503b10[_0x1e3c33(0x287)]('no'));_0x13bc53[_0x1e3c33(0x1ae)]&&console[_0x1e3c33(0x246)](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x28b)),_0x13bc53[_0x1e3c33(0x1ae)]);console['log'](a27_0x503b10['bold']('Parent\x20segment\x20ID:'),_0x13bc53[_0x1e3c33(0x16f)]);const _0x3d958a=_0x389f4e[_0x1e3c33(0x173)]>0x0?'\x20('+_0x389f4e[_0x1e3c33(0x184)](_0x9833d6=>_0x9833d6[_0x1e3c33(0x225)])['join'](',\x20')+')':'';console['log'](a27_0x503b10[_0x1e3c33(0x1a2)](_0x1e3c33(0x1e4)),''+_0x389f4e[_0x1e3c33(0x173)]+_0x3d958a),console[_0x1e3c33(0x246)]('');if(_0x3e07e0[_0x1e3c33(0x173)]===0x0)console[_0x1e3c33(0x246)](a27_0x503b10['bold'](_0x1e3c33(0x22f)),a27_0x503b10[_0x1e3c33(0x257)](_0x1e3c33(0x1d6)));else{console['log'](a27_0x503b10['bold'](_0x1e3c33(0x22f)));for(const _0x267f77 of _0x3e07e0){const _0x244738=_0x267f77[_0x1e3c33(0x225)]??_0x1e3c33(0x22a),_0x5702b9=_0x267f77['connectionId']!=null?_0x1e3c33(0x22b)+_0x267f77[_0x1e3c33(0x185)]:_0x1e3c33(0x2a3),_0x53ce2f=_0x267f77[_0x1e3c33(0x1d7)]?''+_0x267f77[_0x1e3c33(0x1d7)]+(_0x267f77[_0x1e3c33(0x20f)]?_0x1e3c33(0x28a)+_0x267f77[_0x1e3c33(0x20f)]:''):'none',_0x17abb6=_0x267f77[_0x1e3c33(0x1d4)]?_0x1e3c33(0x226):'';console['log']('\x20\x20'+a27_0x503b10[_0x1e3c33(0x243)](_0x1e3c33(0x236))+'\x20'+_0x244738+_0x1e3c33(0x18f)+_0x5702b9+',\x20schedule:\x20'+_0x53ce2f+_0x17abb6);}}return console[_0x1e3c33(0x246)](a27_0x503b10['yellow'](_0x1e3c33(0x220))),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x2a1);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x27b);async[a27_0x11bc0d(0x177)](_0x1c0089){const _0x14a0a0=a27_0x11bc0d,{options:_0x282fd4,args:_0x5adf05,tdx:_0x20fa90}=_0x1c0089,_0x542d27=_0x282fd4,_0x21d79e=_0x5adf05[0x0],_0x23bea6=_0x21d79e&&isYamlFilePath(_0x21d79e),_0x1017f0=await resolveTarget({'arg':_0x23bea6?_0x21d79e:undefined,'contextParent':_0x282fd4[_0x14a0a0(0x1ce)],'cwd':process[_0x14a0a0(0x198)]()});if(!isSuccessfulResolution(_0x1017f0))return _0x1017f0[_0x14a0a0(0x27e)]==='no_parent'?(console['error'](a27_0x503b10[_0x14a0a0(0x243)](_0x14a0a0(0x271))),console[_0x14a0a0(0x290)]('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[_0x14a0a0(0x290)](_0x14a0a0(0x17b)),console[_0x14a0a0(0x290)](_0x14a0a0(0x197)),console[_0x14a0a0(0x290)](_0x14a0a0(0x1f7))):(console['error'](a27_0x503b10[_0x14a0a0(0x200)](_0x14a0a0(0x1a6)+_0x1017f0['message']+'\x0a')),_0x1017f0[_0x14a0a0(0x258)]&&console['error'](a27_0x503b10['cyan'](_0x1017f0['helpText']))),0x1;let _0x559f2c=_0x23bea6?undefined:_0x21d79e,_0x312eaf,_0x1d44d7;_0x1017f0[_0x14a0a0(0x1a3)]===_0x14a0a0(0x17d)&&(_0x559f2c=_0x1017f0['resourceName'],_0x312eaf=_0x1017f0[_0x14a0a0(0x274)],_0x1d44d7=_0x1017f0[_0x14a0a0(0x1b0)]);const _0x1ae544=_0x1017f0['parentName'],_0x2b17b9=_0x1017f0[_0x14a0a0(0x21c)];_0x542d27['verbose']&&(console['error'](_0x14a0a0(0x299)+_0x1ae544),console[_0x14a0a0(0x290)](_0x14a0a0(0x19a)+_0x2b17b9),_0x559f2c&&console[_0x14a0a0(0x290)](_0x14a0a0(0x24e)+_0x559f2c),_0x312eaf&&console['error']('Target\x20file:\x20'+_0x312eaf),_0x1d44d7&&console[_0x14a0a0(0x290)](_0x14a0a0(0x252)+_0x1d44d7));const _0x327a91=await withSpinner(_0x14a0a0(0x180),()=>_0x20fa90[_0x14a0a0(0x25c)][_0x14a0a0(0x23a)](_0x1ae544),{'verbose':_0x282fd4[_0x14a0a0(0x203)]}),_0x56dd13=_0x327a91[_0x14a0a0(0x1c7)],{journeys:_0x45dffb,folders:_0x3991f2}=await withSpinner(_0x14a0a0(0x254),async()=>{const _0x3d09a3=_0x14a0a0,[_0x1745df,_0x47b630]=await Promise[_0x3d09a3(0x210)]([_0x20fa90[_0x3d09a3(0x1a1)][_0x3d09a3(0x215)](_0x56dd13,undefined,{'includeAllVersions':!![]}),_0x20fa90['segment'][_0x3d09a3(0x26f)](_0x56dd13)]);return{'journeys':_0x1745df,'folders':_0x47b630};},{'verbose':_0x282fd4[_0x14a0a0(0x203)]})['then'](_0xb8cba3=>_0xb8cba3['data']);let _0x1c82f5=_0x45dffb;const _0x43f6fa=buildFolderIdToPathMap(_0x3991f2);if(_0x559f2c){const _0x2b277b=_0x1c82f5[_0x14a0a0(0x288)](_0x29c808=>_0x29c808[_0x14a0a0(0x27f)][_0x14a0a0(0x170)]()===_0x559f2c[_0x14a0a0(0x170)]());if(_0x2b277b[_0x14a0a0(0x173)]===0x0)return console[_0x14a0a0(0x290)]('Error:\x20Journey\x20not\x20found:\x20'+_0x559f2c),console[_0x14a0a0(0x290)](_0x14a0a0(0x23c)),0x1;_0x1c82f5=_0x2b277b;}if(_0x1d44d7!==undefined){const _0x44ac44=_0x1c82f5[_0x14a0a0(0x288)](_0x2521f0=>{const _0x46b991=_0x14a0a0,_0x1564d6=_0x2521f0[_0x46b991(0x2a8)]?_0x43f6fa[_0x46b991(0x237)](_0x2521f0['folderId'])||'':'';return _0x1564d6===_0x1d44d7;});if(_0x44ac44[_0x14a0a0(0x173)]===0x0&&_0x1c82f5[_0x14a0a0(0x173)]>0x0){console['error'](_0x14a0a0(0x21a)+_0x559f2c+'\x27\x20not\x20found\x20in\x20'+(_0x1d44d7||'root\x20folder')),console[_0x14a0a0(0x290)](_0x14a0a0(0x1ff));for(const _0x551c48 of _0x1c82f5){const _0x14b813=_0x551c48[_0x14a0a0(0x2a8)]?_0x43f6fa[_0x14a0a0(0x237)](_0x551c48[_0x14a0a0(0x2a8)])||'':'';console[_0x14a0a0(0x290)](_0x14a0a0(0x222)+(_0x14b813||'(root)')+'/'+_0x551c48[_0x14a0a0(0x27f)]);}return 0x1;}_0x1c82f5=_0x44ac44;}if(_0x1c82f5[_0x14a0a0(0x173)]===0x0)return console[_0x14a0a0(0x290)](_0x14a0a0(0x29e)),0x0;const _0x342dc2=new Map();for(const _0x44f8ba of _0x1c82f5){const _0x3365f8=_0x44f8ba[_0x14a0a0(0x24a)];!_0x342dc2['has'](_0x3365f8)&&_0x342dc2[_0x14a0a0(0x1fb)](_0x3365f8,[]),_0x342dc2[_0x14a0a0(0x237)](_0x3365f8)[_0x14a0a0(0x213)](_0x44f8ba);}for(const _0x270680 of _0x342dc2[_0x14a0a0(0x2a5)]()){_0x270680['sort']((_0x38d3cc,_0x3f1565)=>(_0x38d3cc[_0x14a0a0(0x18c)]||0x0)-(_0x3f1565['versionNumber']||0x0));}const _0x22597f=[],{idToEmailMap:_0x3c86f7,connectionIdToNameMap:_0x40bdc3}=await withSpinner(_0x14a0a0(0x267),async()=>{const _0x5ae548=_0x14a0a0,[_0x5be4b6,_0x839902]=await Promise[_0x5ae548(0x210)]([_0x20fa90[_0x5ae548(0x17c)][_0x5ae548(0x256)](),_0x20fa90[_0x5ae548(0x29d)][_0x5ae548(0x1ec)]()]);return{'idToEmailMap':_0x5be4b6,'connectionIdToNameMap':_0x839902};},{'verbose':_0x282fd4[_0x14a0a0(0x203)]})['then'](_0x4fb839=>_0x4fb839[_0x14a0a0(0x1c7)]);for(const _0x2d85cd of _0x342dc2[_0x14a0a0(0x2a5)]()){const _0xe2d06d=_0x2d85cd[0x0][_0x14a0a0(0x27f)],_0x153bb9=_0x2d85cd[0x0][_0x14a0a0(0x2a8)],_0x580e8c=_0x153bb9?_0x43f6fa[_0x14a0a0(0x237)](_0x153bb9)||'':'',_0x1c6f8c=_0x580e8c?a27_0x5a60d6['join'](_0x2b17b9,_0x580e8c):_0x2b17b9,_0x4e4d93=_0x312eaf||a27_0x5a60d6[_0x14a0a0(0x1cf)](_0x1c6f8c,sanitizeFileName(_0xe2d06d)+'.journey.yml');let _0x148a64,_0xa5d84d;if(existsSync(_0x4e4d93))try{const _0x446d8a=readFileSync(_0x4e4d93,_0x14a0a0(0x264)),_0x167944=parseYamlString(_0x446d8a);_0xa5d84d=_0x167944,_0x148a64=buildRuleToNameMapping(_0x167944),_0x542d27[_0x14a0a0(0x203)]&&_0x148a64['size']>0x0&&console[_0x14a0a0(0x290)](_0x14a0a0(0x1e5)+_0x148a64[_0x14a0a0(0x25b)]+_0x14a0a0(0x28c)+_0xe2d06d);}catch(_0x4be6ca){_0x542d27['verbose']&&console[_0x14a0a0(0x290)](_0x14a0a0(0x2aa)+_0x4be6ca[_0x14a0a0(0x279)]);}const _0x5e6ed5=[],_0x2a855a=new Set(),_0x2b2c83=new Map(),_0x5ee314=new Map(),_0x4d6522=new Set(),_0x53234e=new Map(),_0x5296ab=new Map(),_0x430c8a=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0xe2d06d+'...',async _0x5b4731=>{const _0x3bbe32=_0x14a0a0;for(const _0x33b423 of _0x2d85cd){const _0x447585=_0x2d85cd[_0x3bbe32(0x173)]>0x1?_0x33b423[_0x3bbe32(0x27f)]+'\x20v'+(_0x33b423['versionNumber']||0x1):_0x33b423[_0x3bbe32(0x27f)];_0x5b4731[_0x3bbe32(0x24f)](_0x3bbe32(0x1b4)+_0x447585);const _0x3ccdb3=await _0x20fa90[_0x3bbe32(0x1a1)]['getJourney'](_0x33b423['id']),_0xc2f0b3=_0x3ccdb3[_0x3bbe32(0x1d9)]?.[_0x3bbe32(0x16f)],_0x2d8aa4={'resolveSegment':async _0x45a50b=>{const _0x240d76=_0x3bbe32;if(!_0xc2f0b3)return{'name':_0x45a50b,'isJourneyLocal':![]};const _0x3cf85b=_0x2b2c83['get'](_0x45a50b);if(_0x3cf85b)return _0x3cf85b;try{const _0x5ecff6=await _0x20fa90[_0x240d76(0x25c)][_0x240d76(0x208)](_0xc2f0b3,_0x45a50b),_0x2f6d1c=_0x5ecff6[_0x240d76(0x26c)]===SEGMENT_KIND_JOURNEY;let _0x312405,_0x4a2087=_0x5ecff6[_0x240d76(0x225)];if(_0x2f6d1c&&_0x5ecff6[_0x240d76(0x1b2)]){const _0x8aad59=await segmentResponseToDef(_0x5ecff6,{'resolveSegmentName':async _0x379f3a=>{const _0x3e8702=_0x240d76,_0x5cad5a=_0x2b2c83[_0x3e8702(0x237)](_0x379f3a);if(_0x5cad5a)return _0x5cad5a[_0x3e8702(0x225)];const _0x1be819=await _0x2d8aa4[_0x3e8702(0x212)](_0x379f3a);return _0x1be819[_0x3e8702(0x225)];}}),_0x33851e=_0x8aad59[_0x240d76(0x1b2)];_0x312405={'description':_0x5ecff6[_0x240d76(0x281)],'rule':_0x33851e};const _0x261462=serializeRule(_0x33851e),_0x1ec75e=_0x5ee314[_0x240d76(0x237)](_0x261462);if(_0x1ec75e)_0x4a2087=_0x1ec75e,_0x312405=undefined,_0x542d27[_0x240d76(0x203)]&&console[_0x240d76(0x290)](_0x240d76(0x19d)+_0x5ecff6[_0x240d76(0x225)]+_0x240d76(0x192)+_0x1ec75e);else{let _0x3a8d63=![];if(_0x148a64){const _0x90f8f3=_0x148a64[_0x240d76(0x237)](_0x261462);if(_0x90f8f3){const _0x2ad943=_0x90f8f3['find'](_0x27f53f=>!_0x2a855a[_0x240d76(0x298)](_0x27f53f));_0x2ad943&&(_0x4a2087=_0x2ad943,_0x2a855a[_0x240d76(0x19e)](_0x2ad943),_0x5ee314[_0x240d76(0x1fb)](_0x261462,_0x2ad943),_0x3a8d63=!![],_0x542d27[_0x240d76(0x203)]&&console[_0x240d76(0x290)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x2ad943+_0x240d76(0x230)));}}if(!_0x3a8d63){const _0x1998b8=generateJourneyLocalName(_0x5ecff6['name']);_0x1998b8&&(_0x4a2087=_0x1998b8);let _0x3f00ac=_0x4a2087,_0x2522ba=0x2;while(_0x2a855a['has'](_0x3f00ac)){_0x3f00ac=_0x4a2087+'_'+_0x2522ba,_0x2522ba++;}_0x2a855a[_0x240d76(0x19e)](_0x3f00ac),_0x5ee314[_0x240d76(0x1fb)](_0x261462,_0x3f00ac),_0x4a2087=_0x3f00ac;}}}const _0x50827e={'name':_0x4a2087,'isJourneyLocal':_0x2f6d1c,'definition':_0x312405};return _0x2b2c83[_0x240d76(0x1fb)](_0x45a50b,_0x50827e),_0x50827e;}catch(_0x3da23c){return _0x282fd4['verbose']&&console['error'](_0x240d76(0x282)+_0x45a50b+':\x20'+_0x3da23c[_0x240d76(0x279)]),{'name':_0x45a50b,'isJourneyLocal':![]};}},'resolveActivation':async _0xd85931=>{const _0x121adc=_0x3bbe32,_0x4d3c2c=_0x53234e[_0x121adc(0x237)](_0xd85931);if(_0x4d3c2c)return _0x4d3c2c;try{const _0x2efcc2=await _0x20fa90[_0x121adc(0x1a1)][_0x121adc(0x24b)](_0x33b423['id'],_0xd85931),_0x342eeb=journeyActivationStepToYaml(_0x2efcc2,_0x3c86f7,_0x40bdc3),_0x1d766a=JSON[_0x121adc(0x1cd)]({'name':_0x342eeb['name'],'connection':_0x342eeb['connection'],'connector_config':_0x342eeb[_0x121adc(0x1df)]}),_0x303ed8=_0x5296ab['get'](_0x1d766a);if(_0x303ed8){const _0x297522={'name':_0x303ed8,'isJourneyLocal':!![],'definition':_0x342eeb};return _0x53234e[_0x121adc(0x1fb)](_0xd85931,_0x297522),_0x297522;}const _0x36b27d=_0x2efcc2[_0x121adc(0x1d9)][_0x121adc(0x22c)][_0x121adc(0x225)]||_0xd85931,_0xac9993=sanitizeYamlKey(_0x36b27d)||'activation_'+_0xd85931;let _0xcc738d=_0xac9993,_0x345de6=0x2;while(_0x4d6522[_0x121adc(0x298)](_0xcc738d)){_0xcc738d=_0xac9993+'_'+_0x345de6,_0x345de6++;}_0x4d6522['add'](_0xcc738d),_0x5296ab[_0x121adc(0x1fb)](_0x1d766a,_0xcc738d);const _0x1283f2={'name':_0xcc738d,'isJourneyLocal':!![],'definition':_0x342eeb};return _0x53234e[_0x121adc(0x1fb)](_0xd85931,_0x1283f2),_0x1283f2;}catch(_0xbc8668){return _0x282fd4[_0x121adc(0x203)]&&console[_0x121adc(0x290)](_0x121adc(0x255)+_0xd85931+':\x20'+_0xbc8668[_0x121adc(0x279)]),{'name':_0xd85931,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1d85c5,_0x307e3c)=>{const _0x114c7e=_0x3bbe32;return resolveJumpTarget(_0x1d85c5,_0x307e3c,_0x430c8a,_0x1d6ae2=>_0x20fa90[_0x114c7e(0x1a1)]['getJourney'](_0x1d6ae2));}},_0x5b41d0=await journeyResponseToDef(_0x3ccdb3,_0x2d8aa4);_0x5e6ed5[_0x3bbe32(0x213)]({'item':_0x33b423,'yaml':_0x5b41d0});}},{'verbose':_0x282fd4[_0x14a0a0(0x203)]});const _0x4e2e8f=await _0x20fa90[_0x14a0a0(0x1a1)][_0x14a0a0(0x20a)](_0x2d85cd[0x0]['journeyBundleId']),_0x371d66=buildMergedJourneyDef(_0x5e6ed5,_0x148a64,_0x4e2e8f),_0x58c6d3=normalizeJourneyDef(_0x371d66,_0xa5d84d),_0x16030a=toYamlString(_0x58c6d3),_0x10e945=_0x312eaf||a27_0x5a60d6[_0x14a0a0(0x1cf)](_0x1c6f8c,sanitizeFileName(_0xe2d06d)+_0x14a0a0(0x266));!_0x312eaf&&_0x580e8c&&!existsSync(_0x1c6f8c)&&mkdirSync(_0x1c6f8c,{'recursive':!![]});const _0xea47c5=a27_0x5a60d6[_0x14a0a0(0x1f8)](process[_0x14a0a0(0x198)](),_0x10e945);if(existsSync(_0x10e945)){const _0x2365a0=readFileSync(_0x10e945,'utf-8'),_0x1fac9d=generateDiff(_0x2365a0,_0x16030a),_0x560cec=hasChanges(_0x1fac9d);_0x22597f[_0x14a0a0(0x213)]({'relativePath':_0xea47c5,'absolutePath':_0x10e945,'content':_0x16030a,'isNew':![],'hasChanges':_0x560cec,'diff':_0x560cec?formatDiffWithColors(_0x1fac9d):undefined});}else _0x22597f['push']({'relativePath':_0xea47c5,'absolutePath':_0x10e945,'content':_0x16030a,'isNew':!![],'hasChanges':![]});}const _0x481892=_0x22597f[_0x14a0a0(0x288)](_0x58c79b=>_0x58c79b[_0x14a0a0(0x204)]),_0x5c4770=_0x22597f[_0x14a0a0(0x288)](_0x2b13d7=>!_0x2b13d7[_0x14a0a0(0x204)]&&_0x2b13d7['hasChanges']),_0x2f43e3=_0x22597f['filter'](_0x3f47cd=>!_0x3f47cd[_0x14a0a0(0x204)]&&!_0x3f47cd['hasChanges']),_0x42f84c=_0x1c82f5[_0x14a0a0(0x173)],_0x118045=_0x342dc2[_0x14a0a0(0x25b)],_0x255fcf=_0x42f84c>_0x118045?'\x20('+_0x42f84c+_0x14a0a0(0x21b):'';console[_0x14a0a0(0x290)]('\x0aPull\x20summary:'),console[_0x14a0a0(0x290)]('\x20\x20'+a27_0x503b10[_0x14a0a0(0x19b)](_0x118045+_0x14a0a0(0x278))+a27_0x503b10[_0x14a0a0(0x257)](_0x255fcf)),console[_0x14a0a0(0x290)]('\x20\x20'+a27_0x503b10[_0x14a0a0(0x287)]('+\x20'+_0x481892[_0x14a0a0(0x173)]+'\x20new\x20files')),console['error']('\x20\x20'+a27_0x503b10[_0x14a0a0(0x243)]('~\x20'+_0x5c4770[_0x14a0a0(0x173)]+'\x20changed\x20files')),console[_0x14a0a0(0x290)]('\x20\x20'+a27_0x503b10['dim']('=\x20'+_0x2f43e3[_0x14a0a0(0x173)]+'\x20unchanged\x20files')),console[_0x14a0a0(0x290)](_0x14a0a0(0x205)+a27_0x503b10[_0x14a0a0(0x19b)](_0x2b17b9)+'\x0a');if(_0x5c4770[_0x14a0a0(0x173)]>0x0)for(const _0x242fe4 of _0x5c4770){console[_0x14a0a0(0x290)]('\x0aChanges\x20to\x20\x27'+_0x242fe4[_0x14a0a0(0x171)]+'\x27:'),console[_0x14a0a0(0x290)]('β'[_0x14a0a0(0x1d5)](0x3c)),console[_0x14a0a0(0x290)](_0x242fe4['diff']),console[_0x14a0a0(0x290)]('β'[_0x14a0a0(0x1d5)](0x3c));}if(_0x542d27[_0x14a0a0(0x23f)])return console[_0x14a0a0(0x290)](a27_0x503b10['yellow'](_0x14a0a0(0x176))),0x0;if(_0x481892[_0x14a0a0(0x173)]===0x0&&_0x5c4770['length']===0x0)return console[_0x14a0a0(0x290)](a27_0x503b10['green'](_0x14a0a0(0x1c2))),saveSessionContext({'parent_segment':_0x1ae544},_0x542d27[_0x14a0a0(0x18b)]),console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x287)](_0x14a0a0(0x27c)+a27_0x503b10[_0x14a0a0(0x257)](_0x14a0a0(0x18a))+_0x14a0a0(0x1b9)+a27_0x503b10[_0x14a0a0(0x19b)](_0x1ae544))),0x0;if(!_0x542d27[_0x14a0a0(0x244)]&&(_0x481892['length']>0x0||_0x5c4770['length']>0x0)){if(!isInteractive())return console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x200)](_0x14a0a0(0x183)),_0x14a0a0(0x272)),console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x257)](_0x14a0a0(0x294))),0x1;const _0x526d75=await confirmKey(_0x14a0a0(0x1a5)+(_0x481892[_0x14a0a0(0x173)]+_0x5c4770[_0x14a0a0(0x173)])+_0x14a0a0(0x21e));if(!_0x526d75)return console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x243)](_0x14a0a0(0x250)),_0x14a0a0(0x23d)),0x1;}!existsSync(_0x2b17b9)&&mkdirSync(_0x2b17b9,{'recursive':!![]});const _0xff4863=a27_0x5a60d6[_0x14a0a0(0x1cf)](_0x2b17b9,_0x14a0a0(0x247));writeFileSync(_0xff4863,createTdxConfigContent(_0x1ae544),_0x14a0a0(0x264));for(const _0x87b160 of _0x22597f){(_0x87b160['isNew']||_0x87b160[_0x14a0a0(0x2a6)])&&writeFileSync(_0x87b160[_0x14a0a0(0x188)],_0x87b160['content'],_0x14a0a0(0x264));}return console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x287)](_0x14a0a0(0x24d)+(_0x481892[_0x14a0a0(0x173)]+_0x5c4770[_0x14a0a0(0x173)])+_0x14a0a0(0x293)+_0x2b17b9)),saveSessionContext({'parent_segment':_0x1ae544},_0x542d27[_0x14a0a0(0x18b)]),console[_0x14a0a0(0x290)](a27_0x503b10[_0x14a0a0(0x287)]('β\x20Context\x20set:\x20'+a27_0x503b10['dim']('parent_segment')+'\x20=\x20'+a27_0x503b10[_0x14a0a0(0x19b)](_0x1ae544))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x263);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x1af);async[a27_0x11bc0d(0x177)](_0x2105ca){const _0x16f2c9=a27_0x11bc0d,{options:_0x1ac62f,args:_0x16f42e,tdx:_0x28a985}=_0x2105ca,_0x26427e=_0x16f42e[0x0];if(!requireNameOrPath(_0x26427e))return 0x1;_0x1ac62f[_0x16f2c9(0x203)]&&console[_0x16f2c9(0x290)]('Input:\x20'+_0x26427e);const {journeyId:_0x5507a0}=await resolveJourneyIdFromInput(_0x26427e,_0x1ac62f,_0x28a985),_0x547a2a=await withSpinner(_0x16f2c9(0x1ad),()=>_0x28a985[_0x16f2c9(0x1a1)][_0x16f2c9(0x29a)](_0x5507a0),{'verbose':_0x1ac62f['verbose']}),_0x5a84e7=_0x547a2a['data'];return console[_0x16f2c9(0x246)](_0x16f2c9(0x1c1)+_0x5a84e7[_0x16f2c9(0x1e6)]),console[_0x16f2c9(0x246)](_0x16f2c9(0x1c5)+_0x5a84e7[_0x16f2c9(0x240)]),await handleSDKOutput(_0x5a84e7[_0x16f2c9(0x251)],_0x1ac62f),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x11bc0d(0x1e1);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x261);async[a27_0x11bc0d(0x177)](_0x1df5e8){const _0x1fd6e5=a27_0x11bc0d,{options:_0x4d653d,args:_0xb086bc,tdx:_0x3b52f6}=_0x1df5e8,_0x8df2eb=_0xb086bc[0x0];if(!requireNameOrPath(_0x8df2eb))return 0x1;_0x4d653d[_0x1fd6e5(0x203)]&&console['error']('Input:\x20'+_0x8df2eb);const {journeyId:_0x69b01a}=await resolveJourneyIdFromInput(_0x8df2eb,_0x4d653d,_0x3b52f6),_0x4b78b1=await withSpinner('Listing\x20journey\x20activations...',()=>_0x3b52f6[_0x1fd6e5(0x1a1)]['listActivationsFlat'](_0x69b01a),{'verbose':_0x4d653d[_0x1fd6e5(0x203)]}),_0xe57db4=_0x4b78b1['data'];return console[_0x1fd6e5(0x290)]('Found\x20'+_0xe57db4[_0x1fd6e5(0x173)]+_0x1fd6e5(0x1c3)+(_0xe57db4[_0x1fd6e5(0x173)]!==0x1?'s':'')),await handleSDKOutput(_0xe57db4,_0x4d653d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x259);['description']=a27_0x11bc0d(0x194);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x51ea7a){const _0x4ce213=a27_0x11bc0d,_0x1b8a94=_0x51ea7a['args'][0x0];let _0x399f94;if(_0x1b8a94){const _0x238f92=await resolveTarget({'arg':_0x1b8a94,'contextParent':_0x51ea7a[_0x4ce213(0x249)][_0x4ce213(0x1ce)],'cwd':process['cwd']()});isSuccessfulResolution(_0x238f92)&&_0x238f92[_0x4ce213(0x1a3)]===_0x4ce213(0x17d)&&(_0x399f94=_0x238f92[_0x4ce213(0x274)]);}const _0x569ad9={..._0x51ea7a,'options':{..._0x51ea7a[_0x4ce213(0x249)],'journeysOnly':!![],..._0x399f94&&{'singleFilePath':_0x399f94}}};return this[_0x4ce213(0x228)][_0x4ce213(0x177)](_0x569ad9);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x20e);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x276);async[a27_0x11bc0d(0x177)](_0x2bca27){const _0x2f7f71=a27_0x11bc0d,{options:_0x5d6a2b,args:_0x176404,tdx:_0x1b8282}=_0x2bca27,_0x111113=_0x176404[0x0];if(!requireNameOrPath(_0x111113))return 0x1;if(_0x5d6a2b[_0x2f7f71(0x203)])console[_0x2f7f71(0x290)](_0x2f7f71(0x1e8)+_0x111113);const {journeyId:_0x2bd957}=await resolveJourneyIdFromInput(_0x111113,_0x5d6a2b,_0x1b8282),_0x2dffa8=await withSpinner(_0x2f7f71(0x1e0),()=>_0x1b8282[_0x2f7f71(0x1a1)][_0x2f7f71(0x253)](_0x2bd957),{'verbose':_0x5d6a2b[_0x2f7f71(0x203)]}),{bundleName:_0x3a287f,versions:_0x51d5c9,latestJourneyId:_0x2c99fe}=_0x2dffa8[_0x2f7f71(0x1c7)];console[_0x2f7f71(0x290)](_0x3a287f+':\x20'+_0x51d5c9[_0x2f7f71(0x173)]+'\x20version'+(_0x51d5c9['length']!==0x1?'s':''));const _0x59e34d=_0x51d5c9[_0x2f7f71(0x184)](_0x4396e7=>({'version':_0x4396e7['versionNumber'],'journey_id':_0x4396e7['journeyId'],'name':_0x4396e7[_0x2f7f71(0x225)],'state':_0x4396e7[_0x2f7f71(0x17f)],'paused':_0x4396e7[_0x2f7f71(0x227)],'latest':_0x4396e7[_0x2f7f71(0x20d)]===_0x2c99fe,'created_at':_0x4396e7[_0x2f7f71(0x28f)]}));return await handleSDKOutput(_0x59e34d,_0x5d6a2b),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x1e2);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x1c0);async['execute'](_0x514e13){const _0x2b28de=a27_0x11bc0d,{options:_0x193d84,args:_0x449e6d,tdx:_0x4ad2bf}=_0x514e13,_0x5396f3=_0x449e6d[0x0];if(!requireNameOrPath(_0x5396f3))return 0x1;if(_0x193d84[_0x2b28de(0x203)])console[_0x2b28de(0x290)]('Input:\x20'+_0x5396f3);const {journeyId:_0x14c868,journeyName:_0x32c455}=await resolveJourneyIdFromInput(_0x5396f3,_0x193d84,_0x4ad2bf);if(!_0x193d84[_0x2b28de(0x244)]){const _0x1cff60=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x32c455+'\x22?');if(!_0x1cff60)return console[_0x2b28de(0x290)](_0x2b28de(0x195)),0x0;}const _0xdcedab=await withSpinner(_0x2b28de(0x19f),()=>_0x4ad2bf[_0x2b28de(0x1a1)][_0x2b28de(0x2a0)](_0x14c868),{'verbose':_0x193d84[_0x2b28de(0x203)]}),_0x405d5b=_0xdcedab[_0x2b28de(0x1c7)];return console[_0x2b28de(0x290)](a27_0x503b10[_0x2b28de(0x287)]('\u2714')+_0x2b28de(0x1b1)+_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x18c)]+'\x20(draft)\x20β\x20\x22'+_0x405d5b['attributes'][_0x2b28de(0x225)]+'\x22'),console[_0x2b28de(0x290)](_0x2b28de(0x209)+_0x405d5b['id']),await handleSingleObjectOutput({'id':_0x405d5b['id'],'name':_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x225)],'version':_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x18c)],'state':_0x405d5b[_0x2b28de(0x1d9)]['state'],'bundle_id':_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x24a)],'created_at':_0x405d5b[_0x2b28de(0x1d9)][_0x2b28de(0x28f)]},_0x193d84),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x11bc0d(0x225)]=a27_0x11bc0d(0x1e9);[a27_0x11bc0d(0x281)]=a27_0x11bc0d(0x269);async['execute'](_0x16223a){const _0x413453=a27_0x11bc0d,{options:_0x4b7d05,args:_0x31f15e,tdx:_0x3359bc}=_0x16223a,_0x5033d0=_0x31f15e[0x0];if(!requireNameOrPath(_0x5033d0))return 0x1;const _0x1a542c=_0x4b7d05[_0x413453(0x1fc)];if(!_0x1a542c)return console[_0x413453(0x290)](_0x413453(0x1fe)),console[_0x413453(0x290)](_0x413453(0x1a0)),0x1;const _0x372c30=parseInt(_0x1a542c,0xa);if(isNaN(_0x372c30)||_0x372c30<0x1)return console[_0x413453(0x290)](_0x413453(0x280)+_0x1a542c),0x1;if(_0x4b7d05[_0x413453(0x203)])console[_0x413453(0x290)]('Input:\x20'+_0x5033d0+',\x20version:\x20'+_0x372c30);const {journeyId:_0xf0acc9,parentSegmentId:_0x33a316}=await resolveJourneyIdFromInput(_0x5033d0,_0x4b7d05,_0x3359bc),_0x2a3b78=await withSpinner(_0x413453(0x224),()=>_0x3359bc[_0x413453(0x1a1)][_0x413453(0x253)](_0xf0acc9),{'verbose':_0x4b7d05[_0x413453(0x203)]}),{versions:_0x87f7e4,latestJourneyId:_0x38f0a8}=_0x2a3b78[_0x413453(0x1c7)],_0x257897=_0x87f7e4['find'](_0x517a78=>_0x517a78[_0x413453(0x18c)]===_0x372c30);if(!_0x257897){const _0x10f6a1=_0x87f7e4[_0x413453(0x184)](_0x1ebd63=>'v'+_0x1ebd63[_0x413453(0x18c)])[_0x413453(0x1cf)](',\x20');return console['error'](_0x413453(0x1aa)+_0x372c30+_0x413453(0x1ab)+_0x10f6a1),0x1;}const _0x4faf56=await withSpinner('Getting\x20version\x20'+_0x372c30+_0x413453(0x29c),()=>_0x3359bc[_0x413453(0x1a1)][_0x413453(0x22d)](_0x257897[_0x413453(0x20d)]),{'verbose':_0x4b7d05['verbose']}),_0x1d5b1e=_0x4faf56[_0x413453(0x1c7)],_0x40545b=getConsoleNextUrl(_0x4b7d05[_0x413453(0x2a7)],_0x413453(0x1d2)+_0x33a316+_0x413453(0x297)+_0x257897[_0x413453(0x20d)]+_0x413453(0x285));return await handleSingleObjectOutput({'id':_0x1d5b1e['id'],'name':_0x1d5b1e['attributes']['name'],'version':_0x1d5b1e['attributes']['versionNumber'],'description':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x281)],'state':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x17f)],'paused':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x227)],'reentry_mode':_0x1d5b1e[_0x413453(0x1d9)]['reentryMode'],'stages':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x221)]?.[_0x413453(0x173)]||0x0,..._0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x1c8)]&&{'goal':_0x1d5b1e[_0x413453(0x1d9)][_0x413453(0x1c8)][_0x413453(0x225)]},'latest':_0x257897[_0x413453(0x20d)]===_0x38f0a8,'created_at':_0x1d5b1e['attributes'][_0x413453(0x28f)],'updated_at':_0x1d5b1e['attributes'][_0x413453(0x1ed)],'url':_0x40545b},_0x4b7d05),0x0;}}
|
|
1
|
+
const a30_0x9050c5=a30_0x130d;(function(_0x580aa5,_0x19f3f9){const _0x5f06f1=a30_0x130d,_0x2d438c=_0x580aa5();while(!![]){try{const _0x2fafe4=-parseInt(_0x5f06f1(0xd5))/0x1*(parseInt(_0x5f06f1(0x18a))/0x2)+-parseInt(_0x5f06f1(0x198))/0x3*(parseInt(_0x5f06f1(0x90))/0x4)+parseInt(_0x5f06f1(0xf6))/0x5+-parseInt(_0x5f06f1(0x103))/0x6+parseInt(_0x5f06f1(0x118))/0x7+parseInt(_0x5f06f1(0x13e))/0x8*(parseInt(_0x5f06f1(0x11b))/0x9)+parseInt(_0x5f06f1(0x8f))/0xa;if(_0x2fafe4===_0x19f3f9)break;else _0x2d438c['push'](_0x2d438c['shift']());}catch(_0x33dac1){_0x2d438c['push'](_0x2d438c['shift']());}}}(a30_0x5ef9,0xb2501));import a30_0x2170a8 from'chalk';import a30_0x39acee 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(_0x305b37){const _0x349d51=a30_0x130d;return!_0x305b37&&(console['error'](_0x349d51(0x8e)),console[_0x349d51(0x92)](_0x349d51(0xbe))),!!_0x305b37;}function withJsonFormat(_0x55aba8){const _0x2a4d45=a30_0x130d;if(!_0x55aba8[_0x2a4d45(0x1ad)]&&!_0x55aba8[_0x2a4d45(0x106)]&&!_0x55aba8[_0x2a4d45(0x182)]&&!_0x55aba8[_0x2a4d45(0x194)])return{..._0x55aba8,'format':'json','json':!![]};return _0x55aba8;}function formatJourneyState(_0x3f6ea8){const _0x49e376=a30_0x130d;switch(_0x3f6ea8){case'launched':return a30_0x2170a8[_0x49e376(0x1a3)]('(running)');case _0x49e376(0xf8):return a30_0x2170a8[_0x49e376(0xc0)](_0x49e376(0x18f));case _0x49e376(0x9f):return a30_0x2170a8[_0x49e376(0xc5)](_0x49e376(0x10e));case _0x49e376(0x192):return a30_0x2170a8['blue']('(completed)');case _0x49e376(0x7c):return a30_0x2170a8[_0x49e376(0xc0)](_0x49e376(0x1a0));default:return'('+_0x3f6ea8+')';}}function formatJourneyItem(_0x27d098,_0x3f82b2='',_0x1f70a4){const _0x3628da=a30_0x130d,_0x3cd931=formatJourneyState(_0x27d098['state']),_0x13e40b=_0x1f70a4?hyperlink(_0x27d098[_0x3628da(0x15f)],_0x1f70a4):_0x27d098[_0x3628da(0x15f)];return _0x3f82b2+_0x3628da(0xa8)+_0x13e40b+'\x20'+_0x3cd931;}function escapeRegex(_0x310fc8){const _0x22cdca=a30_0x130d;return _0x310fc8[_0x22cdca(0x108)](/[.*+?^${}()|[\]\\]/g,_0x22cdca(0x19c));}function a30_0x130d(_0x15e58e,_0x41bdc1){_0x15e58e=_0x15e58e-0x7a;const _0x5ef9f6=a30_0x5ef9();let _0x130dbb=_0x5ef9f6[_0x15e58e];return _0x130dbb;}function globToRegex(_0x1f8078){const _0x26ee99=a30_0x130d,_0x3bd716=_0x1f8078[_0x26ee99(0x1ac)]('*')[_0x26ee99(0x17a)](escapeRegex);return new RegExp(_0x3bd716[_0x26ee99(0x101)]('.*'),'i');}function buildRuleToNameMapping(_0x4bd776){const _0x5615a4=a30_0x130d,_0x2b3abd=new Map();if(_0x4bd776[_0x5615a4(0x150)])for(const [_0x1708f0,_0x534884]of Object['entries'](_0x4bd776[_0x5615a4(0x150)])){if(_0x534884[_0x5615a4(0xd8)]){const _0x22ee1b=serializeRule(_0x534884[_0x5615a4(0xd8)]),_0x5da87c=_0x2b3abd[_0x5615a4(0xa3)](_0x22ee1b);_0x5da87c?_0x5da87c[_0x5615a4(0x121)](_0x1708f0):_0x2b3abd['set'](_0x22ee1b,[_0x1708f0]);}}return _0x2b3abd;}async function resolveJourneyIdFromInput(_0x234f08,_0xb775a0,_0x510585){const _0x168ca8=a30_0x130d,_0x5ed73f=await resolveJourneyTarget(_0x234f08,_0xb775a0[_0x168ca8(0x190)],_0xb775a0[_0x168ca8(0x175)]),_0x3449e9=_0x5ed73f['parentSegment'];if(!_0x3449e9)throw new SDKError(ErrorCode[_0x168ca8(0x14e)],_0x168ca8(0x116));const _0x25e8f7=await withSpinner(_0x168ca8(0x98),()=>_0x510585['segment'][_0x168ca8(0x115)](_0x3449e9),{'verbose':_0xb775a0['verbose']}),_0x1ae3ea=_0x25e8f7[_0x168ca8(0x14b)],_0x4e2959=await withSpinner(_0x168ca8(0xf9),()=>_0x510585[_0x168ca8(0xc3)][_0x168ca8(0x10d)](_0x1ae3ea,_0x5ed73f[_0x168ca8(0x97)]),{'verbose':_0xb775a0[_0x168ca8(0x175)]});return{'journeyId':_0x4e2959[_0x168ca8(0x14b)],'journeyName':_0x5ed73f[_0x168ca8(0x97)],'parentSegmentId':_0x1ae3ea};}async function resolveJourneyTarget(_0x192626,_0x4320d3,_0x26ad90){const _0x3543d0=a30_0x130d;if(isYamlFilePath(_0x192626))try{const _0x281b13=await resolveYamlFilePath(_0x192626);return _0x26ad90&&(console[_0x3543d0(0x92)](_0x3543d0(0xce)+_0x192626),console['error'](_0x3543d0(0x102)+_0x281b13[_0x3543d0(0x190)]),console['error'](_0x3543d0(0x134)+_0x281b13['segmentName']),console[_0x3543d0(0x92)](_0x3543d0(0x176)+(_0x281b13['folderPath']||_0x3543d0(0xb0)))),{'journeyName':_0x281b13[_0x3543d0(0x14d)],'parentSegment':_0x281b13[_0x3543d0(0x190)],'resolved':_0x281b13};}catch(_0x4dd79a){throw new SDKError(ErrorCode[_0x3543d0(0x14e)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4dd79a[_0x3543d0(0x177)]);}if(!_0x4320d3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3543d0(0x13c));return{'journeyName':_0x192626,'parentSegment':_0x4320d3};}export class JourneyListCommand extends BaseCommand{['name']=a30_0x9050c5(0x151);[a30_0x9050c5(0x16c)]=a30_0x9050c5(0x158);async[a30_0x9050c5(0x1a1)](_0x241ad7){const _0x55f2ac=a30_0x9050c5,{options:_0x3a7aad,args:_0xb8c196,tdx:_0x35c776}=_0x241ad7,_0x4a7e91=_0xb8c196[0x0],_0x1be1a7=_0x3a7aad[_0x55f2ac(0x190)];if(!_0x1be1a7)return console[_0x55f2ac(0x92)](_0x55f2ac(0x193)),console[_0x55f2ac(0x92)](_0x55f2ac(0x187)),0x1;const _0x36f887=await withSpinner(_0x55f2ac(0x98),()=>_0x35c776[_0x55f2ac(0xc2)]['resolveParentId'](_0x1be1a7),{'verbose':_0x3a7aad[_0x55f2ac(0x175)]}),_0x1fcf7f=_0x36f887[_0x55f2ac(0x14b)];_0x3a7aad['verbose']&&(console[_0x55f2ac(0x92)](_0x55f2ac(0x136)+_0x1be1a7+_0x55f2ac(0x138)+_0x1fcf7f+')'),_0x4a7e91&&console[_0x55f2ac(0x92)](_0x55f2ac(0x7f)+_0x4a7e91));const _0x177032=await withSpinner(_0x55f2ac(0x149),()=>_0x35c776['segment'][_0x55f2ac(0xe7)](_0x1fcf7f),{'verbose':_0x3a7aad[_0x55f2ac(0x175)]}),_0x37fa88=_0x177032[_0x55f2ac(0x14b)],_0x3928b5=_0x37fa88[_0x55f2ac(0xa7)],_0x1db0bb=await withSpinner(_0x55f2ac(0xa5),()=>_0x35c776[_0x55f2ac(0xc3)][_0x55f2ac(0xe3)](_0x1fcf7f,_0x3928b5),{'verbose':_0x3a7aad['verbose']});let _0xc613f4=_0x1db0bb[_0x55f2ac(0x14b)][_0x55f2ac(0x197)];const _0x5b3403=_0x1db0bb['data'][_0x55f2ac(0x111)],_0x1ba3f0=new Map();for(const _0x35c6a2 of _0x5b3403){_0x1ba3f0[_0x55f2ac(0x11d)](_0x35c6a2['id'],_0x35c6a2['name']);}if(_0x4a7e91){const _0x995951=globToRegex(_0x4a7e91);_0xc613f4=_0xc613f4[_0x55f2ac(0x119)](_0x461c4f=>_0x995951[_0x55f2ac(0xa6)](_0x461c4f[_0x55f2ac(0x15f)]));}console['error'](_0x55f2ac(0x168)+_0xc613f4[_0x55f2ac(0x130)]+_0x55f2ac(0xca)+(_0xc613f4[_0x55f2ac(0x130)]!==0x1?'s':''));const _0x2b1d37=_0x35c4c7=>{const _0x49d804=_0x55f2ac;return getConsoleNextUrl(_0x3a7aad[_0x49d804(0x110)],'/app/ps/'+_0x1fcf7f+'/e/'+_0x35c4c7+'/j/da');};if(_0x3a7aad['format']==='table')await handleSDKOutput(_0xc613f4,_0x3a7aad);else{if(_0x3a7aad[_0x55f2ac(0x1ad)]==='json'){const _0x34ac89=_0xc613f4[_0x55f2ac(0x17a)](_0x487904=>({..._0x487904,'url':_0x2b1d37(_0x487904['id'])}));await handleSDKOutput(_0x34ac89,_0x3a7aad);}else{console[_0x55f2ac(0x172)]('['+_0x1be1a7+']');const _0x106106=new Map(),_0x37609a=[];for(const _0x232f0e of _0xc613f4){if(!_0x232f0e[_0x55f2ac(0xd7)]||_0x232f0e[_0x55f2ac(0xd7)]===_0x3928b5)_0x37609a['push'](_0x232f0e);else{const _0x1dad4d=_0x106106[_0x55f2ac(0xa3)](_0x232f0e[_0x55f2ac(0xd7)])||[];_0x1dad4d[_0x55f2ac(0x121)](_0x232f0e),_0x106106['set'](_0x232f0e[_0x55f2ac(0xd7)],_0x1dad4d);}}const _0x100794=(_0x195b07,_0x1ba7fb)=>_0x195b07['journeyBundleName']['localeCompare'](_0x1ba7fb[_0x55f2ac(0x15f)],undefined,{'sensitivity':'base'});_0x37609a['sort'](_0x100794);for(const _0x134299 of _0x37609a){console[_0x55f2ac(0x172)](formatJourneyItem(_0x134299,'',_0x2b1d37(_0x134299['id'])));}const _0x2f7eaf=[..._0x106106['entries']()][_0x55f2ac(0xb9)]((_0x248bd0,_0x351a94)=>{const _0x2a1191=_0x55f2ac,_0x123ff1=_0x1ba3f0[_0x2a1191(0xa3)](_0x248bd0[0x0])||_0x248bd0[0x0],_0x2cc063=_0x1ba3f0['get'](_0x351a94[0x0])||_0x351a94[0x0];return _0x123ff1['localeCompare'](_0x2cc063,undefined,{'sensitivity':_0x2a1191(0x126)});});for(const [_0x54267e,_0xc8ee7a]of _0x2f7eaf){const _0x610b72=_0x1ba3f0[_0x55f2ac(0xa3)](_0x54267e)||_0x54267e;console[_0x55f2ac(0x172)](_0x55f2ac(0x199)+_0x610b72),_0xc8ee7a[_0x55f2ac(0xb9)](_0x100794);for(const _0x172175 of _0xc8ee7a){console[_0x55f2ac(0x172)](formatJourneyItem(_0x172175,'\x20\x20',_0x2b1d37(_0x172175['id'])));}}}}return 0x0;}}function a30_0x5ef9(){const _0xdd721e=['segmentName','INVALID_ARGUMENT','segmentPushCommand','segments','journey:list','isNew','Parent\x20segment\x20ID:','conversion','...','\x20new\x20files','has','List\x20journeys\x20in\x20current\x20context','setPhase','\x20details...','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)','Error:\x20--version\x20option\x20is\x20required','journey:version:create','file','journeyBundleName','State:','runAt','Session:','\x22\x20paused','run','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','cyan','journey:versions','β\x20Found\x20','content','journey:activations','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','description','tdx.json','\x20Opening\x20','history','Found\x20','Listing\x20journey\x20versions...','log','Input:\x20','exitOrJumpRate','verbose','\x20\x20Folder\x20path:\x20','message','root\x20folder','web','map','find','user','exitOrJumpSize','connection','Activations:','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','nodes','jsonl','resourceName','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','then','\x20@\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20=\x20','Error:\x20Version\x20','1350nlECxT','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','diff','\x20\x20Statistics\x20not\x20available','add','(draft)','parentSegment','journeyBundleId','completed','Error:\x20Parent\x20segment\x20context\x20required','tsv','Target\x20directory:\x20','No\x20journeys\x20found','journeys','1101JlwqWa','π\x20','activationParams','/e/','\x5c$&','workflowId','includeHistory','Available\x20stages:\x20','(archived)','execute','Trigger\x20on-demand\x20workflow\x20execution\x20for\x20journey\x20\x22','green','.journey.yml','milestoneSize','attributes','Table:\x20','buildIdToNameMap','completeMilestoneRate','β\x20Journey\x20\x22','runAfterJourneyRefresh','split','format','\x0aChanges\x20to\x20\x27','state','archived','/j/da/je','Export\x20journey(s)\x20as\x20YAML\x20files','Pattern:\x20','database','resume','folderPath','Paused\x20at:','Fetching\x20','β\x20Context\x20set:\x20','limit','Resolving\x20version...','type','\x20Created\x20v','toLowerCase','Triggering\x20journey\x20workflow...','renderStats','journeyId','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','1065450SoultL','7604YqVWoy','Status:','error','getJourney','pausedAt','journey:push','Error:\x20Journey\x20\x27','journeyName','Resolving\x20parent\x20segment...','\x20files?','journey:columns','Fetching\x20journeys\x20and\x20folders...','listActivationsFlat','\x20\x20Consolidating\x20duplicate\x20segment:\x20','reentryMode','paused','session','utf-8','listVersions','get','Resume\x20a\x20paused\x20journey','Listing\x20journeys...','test','rootFolderId','πΊοΈ\x20','journey:traffic','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','getColumnMapping','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','links','\x20unchanged\x20files','size','(root)','columns','executeDryRun','Show\x20journey\x20details','-\x20no\x20files\x20written','helpText','goal','options','listFolders','sort','\x20->\x20','\x20\x20Target:\x20','No\x20statistics\x20available\x20for\x20journey:\x20','table','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','bold','dim','\x27\x20not\x20found\x20in\x20','segment','journey','no\x20connection','yellow','List\x20all\x20versions\x20of\x20a\x20journey','β οΈ\x20','completionRate','updatedAt','\x20journey','scheduleType','Show\x20journey\x20table\x20column\x20mapping','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Resolved\x20YAML\x20file:\x20','pause','name','journey:run','\x20\x20-\x20','ID:','createVersion','1117dmdMyz','Error:\x20Invalid\x20version\x20number:\x20','folderId','rule','none','List\x20activations\x20for\x20a\x20journey','cwd','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','getStatistics','Getting\x20column\x20mapping...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','args','Database:\x20','listJourneysWithFolders','\x20version','from','Fetching\x20journey\x20','getParentFull','Paused:','β\x20All\x20files\x20are\x20up\x20to\x20date','\x22\x20not\x20found','\x20(rule\x20match)','journeyStages',',\x20version:\x20','hasPeriod','journey:pull','getSegment','includeStats',',\x20schedule:\x20','\x20\x20β\x20','relativePath','Listing\x20journey\x20activations...','5872520KifYOS','\x20\x20Preserving\x20local\x20segment\x20name:\x20','draft','Resolving\x20journey...','\x0aPull\x20summary:','stageNameMap','Warning:\x20Could\x20not\x20resolve\x20segment\x20','audienceId','no_parent','Getting\x20journey\x20statistics...','absolutePath','join','\x20\x20Parent\x20segment:\x20','6536952hkNaBl','\x20journeys','enteredSize','json','Fetching\x20users\x20and\x20connections...','replace','\x0aError:','kind','dryRun','listJourneysFromParentSegment','resolveJourneyId','(paused)','/app/ps/','site','folders','Journey\x20name:\x20','Resuming\x20journey...','versionNumber','resolveParentId','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','6274485YvTHCV','filter','\x20\x20Journey\x20ID:\x20','9846891aONxto','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','set','Stages:','\x20(draft)\x20β\x20\x22','relative','push','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Getting\x20version\x20','Target\x20file:\x20','yes','base','View\x20a\x20specific\x20version\x20of\x20a\x20journey','targetDir','createdAt','parent_segment','status','\x0a[Dry\x20run]\x20Journey\x20workflow\x20was\x20NOT\x20triggered.','Options:','filePath','red','length','Error:\x20Journey\x20not\x20found:\x20','getTrafficData','all','\x20\x20Name:\x20','stringify','Parent\x20segment:\x20','activation','\x20(ID:\x20','parentName','errorCode','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20AI','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','stage','8RRkkos','stages','journey:stats','journey:pause','Journey:','Cancelled','Getting\x20journey\x20traffic\x20data...','connection\x20','hasChanges','connectionId','\x20not\x20found.\x20Available:\x20','Fetching\x20parent\x20segment...','journey:version:view','data','workflowSessionId'];a30_0x5ef9=function(){return _0xdd721e;};return a30_0x5ef9();}export class JourneyViewCommand extends BaseCommand{[a30_0x9050c5(0xd0)]='journey:view';['description']=a30_0x9050c5(0xb3);async['execute'](_0x230be6){const _0x339a8c=a30_0x9050c5,{options:_0x529a94,args:_0x14948a,tdx:_0x4be49f}=_0x230be6,_0x14e2a4=_0x14948a[0x0];if(!_0x14e2a4)return console['error'](_0x339a8c(0x8e)),console[_0x339a8c(0x92)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x339a8c(0x92)](_0x339a8c(0x12d)),console[_0x339a8c(0x92)](_0x339a8c(0x117)),0x1;_0x529a94['verbose']&&console[_0x339a8c(0x92)](_0x339a8c(0x173)+_0x14e2a4);const {journeyId:_0x5d35a8,parentSegmentId:_0x52edd2}=await resolveJourneyIdFromInput(_0x14e2a4,_0x529a94,_0x4be49f);if(_0x529a94[_0x339a8c(0x179)]){const _0x2a740e=getConsoleNextUrl(_0x529a94[_0x339a8c(0x110)],'/app/ps/'+_0x52edd2+_0x339a8c(0x19b)+_0x5d35a8+_0x339a8c(0x7d));return console[_0x339a8c(0x92)](a30_0x2170a8[_0x339a8c(0x1a3)]('β')+_0x339a8c(0x16e)+a30_0x2170a8[_0x339a8c(0x166)](_0x2a740e)),openBrowser(_0x2a740e),0x0;}const _0x82e7bf=await withSpinner('Getting\x20journey\x20details...',()=>_0x4be49f[_0x339a8c(0xc3)][_0x339a8c(0x93)](_0x5d35a8),{'verbose':_0x529a94[_0x339a8c(0x175)]}),_0x4d1a7a=_0x82e7bf[_0x339a8c(0x14b)],_0x2ff02e=_0x529a94[_0x339a8c(0xf1)];let _0x40ff7e;if(_0x2ff02e)try{const _0x43ca47=await withSpinner(_0x339a8c(0xff),()=>_0x4be49f['journey'][_0x339a8c(0xdd)](_0x5d35a8),{'verbose':_0x529a94[_0x339a8c(0x175)]});_0x40ff7e=_0x43ca47[_0x339a8c(0x14b)];}catch{_0x529a94['verbose']&&console[_0x339a8c(0x92)](_0x339a8c(0x18d));}const _0x20edc4=getConsoleNextUrl(_0x529a94['site'],_0x339a8c(0x10f)+_0x52edd2+_0x339a8c(0x19b)+_0x5d35a8+'/j/da/je'),_0xc53bfe={'id':_0x4d1a7a['id'],'name':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0xd0)],'description':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0x16c)],'state':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0x7b)],'paused':_0x4d1a7a[_0x339a8c(0x1a6)]['paused'],'reentry_mode':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0x9e)],'stages':_0x4d1a7a[_0x339a8c(0x1a6)]['journeyStages']?.[_0x339a8c(0x130)]||0x0,..._0x4d1a7a['attributes'][_0x339a8c(0xb6)]&&{'goal':_0x4d1a7a[_0x339a8c(0x1a6)][_0x339a8c(0xb6)][_0x339a8c(0xd0)]},..._0x40ff7e&&{'statistics':{'size':_0x40ff7e[_0x339a8c(0xaf)],'entered':_0x40ff7e['enteredSize'],'goal_achieved':_0x40ff7e['goalSize'],'completion_rate':_0x40ff7e[_0x339a8c(0xc8)],'exit_or_jump':_0x40ff7e[_0x339a8c(0x17d)],'exit_or_jump_rate':_0x40ff7e[_0x339a8c(0x174)],'stages':_0x40ff7e[_0x339a8c(0x13f)]}},'url':_0x20edc4};return await handleSingleObjectOutput(_0xc53bfe,_0x529a94),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x140);[a30_0x9050c5(0x16c)]='Show\x20journey\x20statistics';async[a30_0x9050c5(0x1a1)](_0x181630){const _0x51494d=a30_0x9050c5,{options:_0x4f397b,args:_0x4e4108,tdx:_0x5c7807}=_0x181630,_0x96bf23=_0x4e4108[0x0];if(!requireNameOrPath(_0x96bf23))return 0x1;_0x4f397b['verbose']&&console[_0x51494d(0x92)](_0x51494d(0x173)+_0x96bf23);const _0x2726cf=_0x4f397b,_0xf316e7=_0x2726cf['from'],_0x3ed26c=_0x2726cf['to'],_0x4d8cc0=_0x2726cf[_0x51494d(0x19e)],_0x229480=_0x2726cf[_0x51494d(0x13d)];_0x4d8cc0&&!_0xf316e7&&!_0x3ed26c&&console[_0x51494d(0x92)](_0x51494d(0xe0));const _0x3eb77c=_0x4d8cc0?withJsonFormat(_0x4f397b):_0x4f397b,{journeyId:_0x1a5161,journeyName:_0x43072c}=await resolveJourneyIdFromInput(_0x96bf23,_0x3eb77c,_0x5c7807),_0x1b6f7b=_0xf316e7||_0x3ed26c?{'from':_0xf316e7,'to':_0x3ed26c}:undefined,_0x3a29ae=await withSpinner(_0x51494d(0xff),()=>Promise[_0x51494d(0x133)]([_0x5c7807[_0x51494d(0xc3)][_0x51494d(0x93)](_0x1a5161),_0x5c7807[_0x51494d(0xc3)]['getStatistics'](_0x1a5161,_0x1b6f7b)]),{'verbose':_0x3eb77c['verbose']}),[_0x5deabe,_0x2cb6c3]=_0x3a29ae['data'];if(!_0x2cb6c3||_0x2cb6c3[_0x51494d(0x8d)]===null)return console[_0x51494d(0x92)](_0x51494d(0xbc)+_0x43072c),console['error'](_0x51494d(0x180)),0x0;const _0x3a6fcc=buildStageNameMap(_0x5deabe),_0x29c8e1=!!(_0x1b6f7b&&_0x2cb6c3[_0x51494d(0x16f)]?.['length']),_0x1fae28={'stageNameMap':_0x3a6fcc,'hasPeriod':_0x29c8e1,'includeHistory':!!_0x4d8cc0};if(_0x229480&&_0x2cb6c3[_0x51494d(0x13f)]){const _0x4427e9=_0x2cb6c3['stages'][_0x51494d(0x17b)](_0x580fac=>{const _0xd85b7b=_0x51494d,_0x212f89=_0x3a6fcc[_0xd85b7b(0xa3)](_0x580fac['id'])??'';return _0x212f89[_0xd85b7b(0x8a)]()===_0x229480[_0xd85b7b(0x8a)]();});if(_0x4427e9)return await handleSingleObjectOutput(formatStageStats(_0x4427e9,_0x1fae28),_0x3eb77c),0x0;const _0x2c35a3=_0x2cb6c3['stages'][_0x51494d(0x17a)](_0x305317=>_0x3a6fcc[_0x51494d(0xa3)](_0x305317['id'])??_0x305317['id']);return console[_0x51494d(0x92)]('Error:\x20Stage\x20\x22'+_0x229480+_0x51494d(0xea)),console['error'](_0x51494d(0x19f)+_0x2c35a3['join'](',\x20')),0x1;}const _0x4e2b93=_0x2cb6c3[_0x51494d(0x13f)]?.[_0x51494d(0x17a)](_0x16440c=>formatStageStats(_0x16440c,_0x1fae28)),_0x14b9f=assembleJourneyStats(_0x2cb6c3,{'from':_0xf316e7,'to':_0x3ed26c,'includeHistory':_0x4d8cc0});return await this[_0x51494d(0x8c)](_0x14b9f,_0x4e2b93??[],_0x3eb77c),0x0;}async['renderStats'](_0x140db2,_0x3b503f,_0x4820bc){const _0x333977=a30_0x9050c5,_0x8da82e=_0x4820bc[_0x333977(0x1ad)]===_0x333977(0x106)||_0x4820bc[_0x333977(0x1ad)]===_0x333977(0x182)||_0x4820bc[_0x333977(0x106)]||_0x4820bc[_0x333977(0x182)];if(_0x8da82e){_0x140db2[_0x333977(0x13f)]=_0x3b503f,await handleSingleObjectOutput(_0x140db2,_0x4820bc);return;}await handleSingleObjectOutput(_0x140db2,_0x4820bc);for(const _0x549944 of _0x3b503f){console[_0x333977(0x172)](''),console[_0x333977(0x172)](String(a30_0x2170a8[_0x333977(0x166)]['bold']('['+_0x549944[_0x333977(0xd0)]+']'))+a30_0x2170a8[_0x333977(0xc0)]('\x20'+_0x549944['id']));const {id:_0x39635a,name:_0x226449,..._0x29afb6}=_0x549944;await handleSingleObjectOutput(_0x29afb6,_0x4820bc);}}}export class JourneyTrafficCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0xa9);['description']=a30_0x9050c5(0xdc);async[a30_0x9050c5(0x1a1)](_0x5bd628){const _0x5126b8=a30_0x9050c5,{options:_0xf77932,args:_0x101c8d,tdx:_0x44ed3d}=_0x5bd628,_0x5be10a=_0x101c8d[0x0];if(!requireNameOrPath(_0x5be10a))return 0x1;_0xf77932[_0x5126b8(0x175)]&&console[_0x5126b8(0x92)](_0x5126b8(0x173)+_0x5be10a);const _0xa58382=_0xf77932,_0x398ea6=_0xa58382[_0x5126b8(0x88)],_0x500506=_0xa58382[_0x5126b8(0xe5)],_0x3d8502=_0xa58382['to'],_0x145310=_0xa58382[_0x5126b8(0x86)];if(_0x398ea6&&_0x398ea6!=='conversion'&&_0x398ea6!==_0x5126b8(0x137))return console[_0x5126b8(0x92)]('Error:\x20Invalid\x20--type\x20\x22'+_0x398ea6+_0x5126b8(0x165)),0x1;const _0x1c1607=withJsonFormat(_0xf77932),{journeyId:_0x22c65b,journeyName:_0x4b81e3}=await resolveJourneyIdFromInput(_0x5be10a,_0x1c1607,_0x44ed3d),_0x3c5996={'type':_0x398ea6,'from':_0x500506,'to':_0x3d8502,'limit':_0x145310},_0x1f1233=await withSpinner(_0x5126b8(0x144),()=>_0x44ed3d['journey'][_0x5126b8(0x132)](_0x22c65b,_0x3c5996),{'verbose':_0x1c1607[_0x5126b8(0x175)]}),_0x1c204f=_0x1f1233[_0x5126b8(0x14b)],_0x590491=_0x1c204f[_0x5126b8(0x154)]&&(_0x1c204f[_0x5126b8(0x154)][_0x5126b8(0x181)][_0x5126b8(0x130)]>0x0||_0x1c204f[_0x5126b8(0x154)][_0x5126b8(0xad)][_0x5126b8(0x130)]>0x0),_0x1880d6=_0x1c204f[_0x5126b8(0x137)]&&_0x1c204f[_0x5126b8(0x137)]['length']>0x0;if(!_0x590491&&!_0x1880d6)return console[_0x5126b8(0x92)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x4b81e3),console[_0x5126b8(0x92)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x500506&&_0x3d8502&&console[_0x5126b8(0x92)]('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(_0x1c204f,_0x1c1607),0x0;}}function formatStageStats(_0x40f1dc,_0x4ef016){const _0x1defd8=a30_0x9050c5,_0x16d207=_0x4ef016[_0x1defd8(0xee)]&&_0x40f1dc[_0x1defd8(0x16f)]?.[_0x1defd8(0x130)]?aggregateStageHistory(_0x40f1dc['history']):{'size':_0x40f1dc[_0x1defd8(0xaf)],'entered':_0x40f1dc[_0x1defd8(0x105)],'milestone':_0x40f1dc[_0x1defd8(0x1a5)],'milestone_rate':_0x40f1dc[_0x1defd8(0x1a9)],'exit_or_jump':_0x40f1dc[_0x1defd8(0x17d)],'exit_or_jump_rate':_0x40f1dc[_0x1defd8(0x174)]},_0x350a10={'id':_0x40f1dc['id'],'name':_0x4ef016[_0x1defd8(0xfb)][_0x1defd8(0xa3)](_0x40f1dc['id'])??_0x40f1dc['id'],..._0x16d207};return _0x4ef016[_0x1defd8(0xee)]&&_0x4ef016['includeHistory']&&_0x40f1dc['history']&&(_0x350a10['history']=_0x40f1dc['history']),_0x350a10;}export class JourneyPauseCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x141);[a30_0x9050c5(0x16c)]='Pause\x20a\x20running\x20journey';async[a30_0x9050c5(0x1a1)](_0x1e4bb8){const _0x3ad1bc=a30_0x9050c5,{options:_0x21e993,args:_0x913f3c,tdx:_0x55b1ce}=_0x1e4bb8,_0x3317b5=_0x913f3c[0x0];if(!requireNameOrPath(_0x3317b5))return 0x1;_0x21e993['verbose']&&console[_0x3ad1bc(0x92)](_0x3ad1bc(0x173)+_0x3317b5);const {journeyId:_0x58ea74,journeyName:_0x70d7fa}=await resolveJourneyIdFromInput(_0x3317b5,_0x21e993,_0x55b1ce);if(!_0x21e993['yes']){const _0x5646b1=await confirm(_0x3ad1bc(0x16b)+_0x70d7fa+'\x22?');if(!_0x5646b1)return console[_0x3ad1bc(0x92)]('Cancelled'),0x0;}const _0x373c44=await withSpinner('Pausing\x20journey...',()=>_0x55b1ce[_0x3ad1bc(0xc3)][_0x3ad1bc(0xcf)](_0x58ea74),{'verbose':_0x21e993['verbose']}),_0xe5b757=_0x373c44[_0x3ad1bc(0x14b)];return console['error']('β\x20Journey\x20\x22'+_0xe5b757[_0x3ad1bc(0x1a6)]['name']+_0x3ad1bc(0x163)),0x0;}}export class JourneyRunCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0xd1);[a30_0x9050c5(0x16c)]='Trigger\x20on-demand\x20journey\x20workflow\x20execution';async[a30_0x9050c5(0x1a1)](_0x54e24b){const _0x1999f1=a30_0x9050c5,{options:_0x488a4d,args:_0x96baf6,tdx:_0xf07d6b}=_0x54e24b,_0x2ad697=_0x96baf6[0x0];if(!requireNameOrPath(_0x2ad697))return 0x1;_0x488a4d[_0x1999f1(0x175)]&&console['error'](_0x1999f1(0x173)+_0x2ad697);const {journeyId:_0x46f845,journeyName:_0x10efc0}=await resolveJourneyIdFromInput(_0x2ad697,_0x488a4d,_0xf07d6b);if(_0x488a4d['dryRun'])return await this[_0x1999f1(0xb2)](_0x54e24b,_0x46f845,_0x10efc0);if(!_0x488a4d['yes']){const _0x9ee019=await confirm(_0x1999f1(0x1a2)+_0x10efc0+'\x22?');if(!_0x9ee019)return console[_0x1999f1(0x92)](_0x1999f1(0x143)),0x0;}const _0x1d544c=await withSpinner(_0x1999f1(0x8b),()=>_0xf07d6b[_0x1999f1(0xc3)][_0x1999f1(0x164)](_0x46f845),{'verbose':_0x488a4d[_0x1999f1(0x175)]}),_0xcfba0c=_0x1d544c[_0x1999f1(0x14b)],_0x52b443=getWorkflowSessionUrl(_0x488a4d['site'],_0xcfba0c[_0x1999f1(0x19d)],_0xcfba0c[_0x1999f1(0x14c)]);return console[_0x1999f1(0x92)]('\x0a'+a30_0x2170a8[_0x1999f1(0x1a3)]('β')+'\x20Journey\x20workflow\x20started'),console[_0x1999f1(0x92)]('\x20\x20'+a30_0x2170a8['dim']('Journey:')+'\x20'+_0x10efc0),console[_0x1999f1(0x92)]('\x20\x20'+a30_0x2170a8[_0x1999f1(0xc0)](_0x1999f1(0x91))+'\x20'+_0xcfba0c[_0x1999f1(0x12b)]),console[_0x1999f1(0x92)]('\x20\x20'+a30_0x2170a8[_0x1999f1(0xc0)](_0x1999f1(0x162))+'\x20'+_0xcfba0c[_0x1999f1(0x14c)]),console[_0x1999f1(0x92)]('\x20\x20'+_0x52b443),0x0;}async[a30_0x9050c5(0xb2)](_0xf9a72c,_0x534de0,_0x39e5b8){const _0x450728=a30_0x9050c5,{options:_0x2a3dff,tdx:_0x575c38}=_0xf9a72c,_0x2b07d9=await withSpinner(_0x450728(0xe6)+_0x39e5b8+_0x450728(0x155),()=>Promise[_0x450728(0x133)]([_0x575c38[_0x450728(0xc3)][_0x450728(0x93)](_0x534de0),_0x575c38[_0x450728(0xc3)]['listActivationsFlat'](_0x534de0)]),{'verbose':_0x2a3dff[_0x450728(0x175)]}),[_0x58a835,_0x3b89c2]=_0x2b07d9[_0x450728(0x14b)],_0x5cb012=_0x58a835['attributes'],_0x1cf39a=_0x5cb012['journeyStages'];console[_0x450728(0x172)](a30_0x2170a8[_0x450728(0xbf)](_0x450728(0x142)),_0x5cb012['name']),console[_0x450728(0x172)](a30_0x2170a8['bold'](_0x450728(0xd3)),_0x58a835['id']),console[_0x450728(0x172)](a30_0x2170a8['bold']('State:'),_0x5cb012['state']),console['log'](a30_0x2170a8[_0x450728(0xbf)](_0x450728(0xe8)),_0x5cb012[_0x450728(0x9f)]?a30_0x2170a8[_0x450728(0xc5)]('yes'):a30_0x2170a8[_0x450728(0x1a3)]('no')),console['log'](a30_0x2170a8['bold'](_0x450728(0x153)),_0x5cb012[_0x450728(0xfd)]);const _0x481e40=_0x1cf39a[_0x450728(0x130)]>0x0?'\x20('+_0x1cf39a[_0x450728(0x17a)](_0x5e1184=>_0x5e1184[_0x450728(0xd0)])['join'](',\x20')+')':'';console[_0x450728(0x172)](a30_0x2170a8[_0x450728(0xbf)](_0x450728(0x11e)),''+_0x1cf39a[_0x450728(0x130)]+_0x481e40),console[_0x450728(0x172)]('');if(_0x3b89c2[_0x450728(0x130)]===0x0)console['log'](a30_0x2170a8['bold'](_0x450728(0x17f)),a30_0x2170a8[_0x450728(0xc0)]('(none)'));else{console[_0x450728(0x172)](a30_0x2170a8['bold'](_0x450728(0x17f)));for(const _0x21641f of _0x3b89c2){const _0x54a9a0=_0x21641f['name']??'(unnamed)',_0x33dcaa=_0x21641f[_0x450728(0x147)]!=null?_0x450728(0x145)+_0x21641f[_0x450728(0x147)]:_0x450728(0xc4),_0x29b164=_0x21641f[_0x450728(0xcb)]?''+_0x21641f[_0x450728(0xcb)]+(_0x21641f[_0x450728(0x161)]?_0x450728(0x186)+_0x21641f[_0x450728(0x161)]:''):_0x450728(0xd9),_0x338ff4=_0x21641f[_0x450728(0x1ab)]?'\x20[runs\x20on\x20refresh]':'';console[_0x450728(0x172)]('\x20\x20'+a30_0x2170a8[_0x450728(0xc5)](_0x450728(0xc7))+'\x20'+_0x54a9a0+_0x450728(0xf3)+_0x33dcaa+_0x450728(0xf2)+_0x29b164+_0x338ff4);}}return console[_0x450728(0x172)](a30_0x2170a8[_0x450728(0xc5)](_0x450728(0x12c))),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a30_0x9050c5(0xd0)]='journey:resume';[a30_0x9050c5(0x16c)]=a30_0x9050c5(0xa4);async[a30_0x9050c5(0x1a1)](_0xd4c52c){const _0x4a1f67=a30_0x9050c5,{options:_0x18074a,args:_0x3d5096,tdx:_0x14093b}=_0xd4c52c,_0x5ca287=_0x3d5096[0x0];if(!requireNameOrPath(_0x5ca287))return 0x1;_0x18074a[_0x4a1f67(0x175)]&&console[_0x4a1f67(0x92)](_0x4a1f67(0x173)+_0x5ca287);const {journeyId:_0x2374f5,journeyName:_0x274ad8}=await resolveJourneyIdFromInput(_0x5ca287,_0x18074a,_0x14093b);if(_0x18074a[_0x4a1f67(0x10b)])return await this['executeDryRun'](_0xd4c52c,_0x2374f5,_0x274ad8);if(!_0x18074a[_0x4a1f67(0x125)]){const _0x199c3e=await confirm(_0x4a1f67(0x122)+_0x274ad8+'\x22?');if(!_0x199c3e)return console[_0x4a1f67(0x92)](_0x4a1f67(0x143)),0x0;}const _0x18b207=await withSpinner(_0x4a1f67(0x113),()=>_0x14093b[_0x4a1f67(0xc3)][_0x4a1f67(0x81)](_0x2374f5),{'verbose':_0x18074a[_0x4a1f67(0x175)]}),_0x363902=_0x18b207[_0x4a1f67(0x14b)];return console[_0x4a1f67(0x92)](_0x4a1f67(0x1aa)+_0x363902[_0x4a1f67(0x1a6)]['name']+'\x22\x20resumed'),0x0;}async[a30_0x9050c5(0xb2)](_0x4675c7,_0x28af6f,_0x10753c){const _0x549132=a30_0x9050c5,{options:_0x1f2385,tdx:_0x444f34}=_0x4675c7,_0x2acc4c=await withSpinner(_0x549132(0xe6)+_0x10753c+_0x549132(0x155),()=>Promise['all']([_0x444f34[_0x549132(0xc3)]['getJourney'](_0x28af6f),_0x444f34[_0x549132(0xc3)][_0x549132(0x9c)](_0x28af6f)]),{'verbose':_0x1f2385[_0x549132(0x175)]}),[_0x577fc8,_0x12a72d]=_0x2acc4c[_0x549132(0x14b)],_0x194059=_0x577fc8[_0x549132(0x1a6)],_0x35f11f=_0x194059['journeyStages'];console['log'](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x142)),_0x194059['name']),console[_0x549132(0x172)](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0xd3)),_0x577fc8['id']),console['log'](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x160)),_0x194059[_0x549132(0x7b)]),console[_0x549132(0x172)](a30_0x2170a8['bold'](_0x549132(0xe8)),_0x194059[_0x549132(0x9f)]?a30_0x2170a8[_0x549132(0xc5)](_0x549132(0x125)):a30_0x2170a8[_0x549132(0x1a3)]('no'));_0x194059[_0x549132(0x94)]&&console['log'](a30_0x2170a8['bold'](_0x549132(0x83)),_0x194059[_0x549132(0x94)]);console[_0x549132(0x172)](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x153)),_0x194059['audienceId']);const _0x2f8805=_0x35f11f[_0x549132(0x130)]>0x0?'\x20('+_0x35f11f[_0x549132(0x17a)](_0x594152=>_0x594152[_0x549132(0xd0)])['join'](',\x20')+')':'';console[_0x549132(0x172)](a30_0x2170a8['bold'](_0x549132(0x11e)),''+_0x35f11f[_0x549132(0x130)]+_0x2f8805),console[_0x549132(0x172)]('');if(_0x12a72d[_0x549132(0x130)]===0x0)console['log'](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x17f)),a30_0x2170a8[_0x549132(0xc0)]('(none)'));else{console[_0x549132(0x172)](a30_0x2170a8[_0x549132(0xbf)](_0x549132(0x17f)));for(const _0xb586c3 of _0x12a72d){const _0x69366d=_0xb586c3[_0x549132(0xd0)]??'(unnamed)',_0x32623f=_0xb586c3[_0x549132(0x147)]!=null?_0x549132(0x145)+_0xb586c3[_0x549132(0x147)]:_0x549132(0xc4),_0x3a9e89=_0xb586c3[_0x549132(0xcb)]?''+_0xb586c3[_0x549132(0xcb)]+(_0xb586c3[_0x549132(0x161)]?'\x20@\x20'+_0xb586c3[_0x549132(0x161)]:''):_0x549132(0xd9),_0x4353d2=_0xb586c3[_0x549132(0x1ab)]?'\x20[runs\x20on\x20refresh]':'';console['log']('\x20\x20'+a30_0x2170a8[_0x549132(0xc5)](_0x549132(0xc7))+'\x20'+_0x69366d+_0x549132(0xf3)+_0x32623f+_0x549132(0xf2)+_0x3a9e89+_0x4353d2);}}return console['log'](a30_0x2170a8[_0x549132(0xc5)]('\x0a[Dry\x20run]\x20Journey\x20was\x20NOT\x20resumed.')),0x0;}}export class JourneyPullCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0xef);['description']=a30_0x9050c5(0x7e);async[a30_0x9050c5(0x1a1)](_0x4bfe90){const _0x1b736d=a30_0x9050c5,{options:_0x407f33,args:_0x312009,tdx:_0x466178}=_0x4bfe90,_0xf17abd=_0x407f33,_0x41dea3=_0x312009[0x0],_0x31f2f7=_0x41dea3&&isYamlFilePath(_0x41dea3),_0x2a534c=await resolveTarget({'arg':_0x31f2f7?_0x41dea3:undefined,'contextParent':_0x407f33[_0x1b736d(0x190)],'cwd':process[_0x1b736d(0xdb)]()});if(!isSuccessfulResolution(_0x2a534c))return _0x2a534c[_0x1b736d(0x13a)]===_0x1b736d(0xfe)?(console['error'](a30_0x2170a8['yellow'](_0x1b736d(0xac))),console['error'](_0x1b736d(0x15b)),console[_0x1b736d(0x92)](_0x1b736d(0x11c)),console[_0x1b736d(0x92)](_0x1b736d(0xdf)),console[_0x1b736d(0x92)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console['error'](a30_0x2170a8['red']('Error:\x20'+_0x2a534c[_0x1b736d(0x177)]+'\x0a')),_0x2a534c[_0x1b736d(0xb5)]&&console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0x166)](_0x2a534c[_0x1b736d(0xb5)]))),0x1;let _0x2b61b7=_0x31f2f7?undefined:_0x41dea3,_0x5dfd43,_0x35431f;_0x2a534c[_0x1b736d(0x88)]===_0x1b736d(0x15e)&&(_0x2b61b7=_0x2a534c[_0x1b736d(0x183)],_0x5dfd43=_0x2a534c['filePath'],_0x35431f=_0x2a534c[_0x1b736d(0x82)]);const _0x58cb12=_0x2a534c[_0x1b736d(0x139)],_0x4ba0e6=_0x2a534c[_0x1b736d(0x128)];_0xf17abd[_0x1b736d(0x175)]&&(console[_0x1b736d(0x92)](_0x1b736d(0x136)+_0x58cb12),console[_0x1b736d(0x92)](_0x1b736d(0x195)+_0x4ba0e6),_0x2b61b7&&console[_0x1b736d(0x92)](_0x1b736d(0x112)+_0x2b61b7),_0x5dfd43&&console[_0x1b736d(0x92)](_0x1b736d(0x124)+_0x5dfd43),_0x35431f&&console[_0x1b736d(0x92)]('Folder\x20path:\x20'+_0x35431f));const _0x2a579f=await withSpinner(_0x1b736d(0x98),()=>_0x466178[_0x1b736d(0xc2)][_0x1b736d(0x115)](_0x58cb12),{'verbose':_0x407f33[_0x1b736d(0x175)]}),_0x5b8f73=_0x2a579f[_0x1b736d(0x14b)],{journeys:_0x219d4e,folders:_0x11036a}=await withSpinner(_0x1b736d(0x9b),async()=>{const _0x3d4bf1=_0x1b736d,[_0x257b25,_0x24b82b]=await Promise[_0x3d4bf1(0x133)]([_0x466178[_0x3d4bf1(0xc3)][_0x3d4bf1(0x10c)](_0x5b8f73,undefined,{'includeAllVersions':!![]}),_0x466178['segment'][_0x3d4bf1(0xb8)](_0x5b8f73)]);return{'journeys':_0x257b25,'folders':_0x24b82b};},{'verbose':_0x407f33[_0x1b736d(0x175)]})[_0x1b736d(0x185)](_0x519e2f=>_0x519e2f[_0x1b736d(0x14b)]);let _0x8da429=_0x219d4e;const _0x28b9b8=buildFolderIdToPathMap(_0x11036a);if(_0x2b61b7){const _0x231534=_0x8da429['filter'](_0x3d9416=>_0x3d9416['journeyBundleName'][_0x1b736d(0x8a)]()===_0x2b61b7['toLowerCase']());if(_0x231534[_0x1b736d(0x130)]===0x0)return console['error'](_0x1b736d(0x131)+_0x2b61b7),console['error'](_0x1b736d(0x184)),0x1;_0x8da429=_0x231534;}if(_0x35431f!==undefined){const _0x2eb5f5=_0x8da429[_0x1b736d(0x119)](_0x4780d1=>{const _0x23a9da=_0x1b736d,_0x2a72f6=_0x4780d1[_0x23a9da(0xd7)]?_0x28b9b8['get'](_0x4780d1['folderId'])||'':'';return _0x2a72f6===_0x35431f;});if(_0x2eb5f5[_0x1b736d(0x130)]===0x0&&_0x8da429[_0x1b736d(0x130)]>0x0){console['error'](_0x1b736d(0x96)+_0x2b61b7+_0x1b736d(0xc1)+(_0x35431f||_0x1b736d(0x178))),console['error'](_0x1b736d(0xaa));for(const _0x5eb689 of _0x8da429){const _0x4929de=_0x5eb689[_0x1b736d(0xd7)]?_0x28b9b8[_0x1b736d(0xa3)](_0x5eb689[_0x1b736d(0xd7)])||'':'';console[_0x1b736d(0x92)](_0x1b736d(0xd2)+(_0x4929de||_0x1b736d(0xb0))+'/'+_0x5eb689[_0x1b736d(0x15f)]);}return 0x1;}_0x8da429=_0x2eb5f5;}if(_0x8da429['length']===0x0)return console['error'](_0x1b736d(0x196)),0x0;const _0x5025d2=new Map();for(const _0x9427d4 of _0x8da429){const _0x5c6362=_0x9427d4[_0x1b736d(0x191)];!_0x5025d2[_0x1b736d(0x157)](_0x5c6362)&&_0x5025d2[_0x1b736d(0x11d)](_0x5c6362,[]),_0x5025d2['get'](_0x5c6362)[_0x1b736d(0x121)](_0x9427d4);}for(const _0x11d23e of _0x5025d2['values']()){_0x11d23e[_0x1b736d(0xb9)]((_0x12e224,_0x1a0921)=>(_0x12e224[_0x1b736d(0x114)]||0x0)-(_0x1a0921[_0x1b736d(0x114)]||0x0));}const _0x1bbadc=[],{idToEmailMap:_0xb4ebaa,connectionIdToNameMap:_0xe40f1c}=await withSpinner(_0x1b736d(0x107),async()=>{const _0x38f7a0=_0x1b736d,[_0x4e3aa3,_0x4d0c4e]=await Promise[_0x38f7a0(0x133)]([_0x466178[_0x38f7a0(0x17c)]['buildIdToEmailMap'](),_0x466178[_0x38f7a0(0x17e)][_0x38f7a0(0x1a8)]()]);return{'idToEmailMap':_0x4e3aa3,'connectionIdToNameMap':_0x4d0c4e};},{'verbose':_0x407f33[_0x1b736d(0x175)]})['then'](_0x29a3d4=>_0x29a3d4['data']);for(const _0x432a22 of _0x5025d2['values']()){const _0x5899b3=_0x432a22[0x0][_0x1b736d(0x15f)],_0x3adea2=_0x432a22[0x0][_0x1b736d(0xd7)],_0x37b952=_0x3adea2?_0x28b9b8[_0x1b736d(0xa3)](_0x3adea2)||'':'',_0x3712fd=_0x37b952?a30_0x39acee[_0x1b736d(0x101)](_0x4ba0e6,_0x37b952):_0x4ba0e6,_0x485b75=_0x5dfd43||a30_0x39acee['join'](_0x3712fd,sanitizeFileName(_0x5899b3)+_0x1b736d(0x1a4));let _0x9a98e7,_0x1a2f7a;if(existsSync(_0x485b75))try{const _0x40f520=readFileSync(_0x485b75,'utf-8'),_0x4c93a4=parseYamlString(_0x40f520);_0x1a2f7a=_0x4c93a4,_0x9a98e7=buildRuleToNameMapping(_0x4c93a4),_0xf17abd['verbose']&&_0x9a98e7[_0x1b736d(0xaf)]>0x0&&console[_0x1b736d(0x92)](_0x1b736d(0x170)+_0x9a98e7['size']+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x5899b3);}catch(_0x53b103){_0xf17abd[_0x1b736d(0x175)]&&console[_0x1b736d(0x92)](_0x1b736d(0x18b)+_0x53b103[_0x1b736d(0x177)]);}const _0x41eac2=[],_0x3437eb=new Set(),_0x1cf453=new Map(),_0x4da90b=new Map(),_0x388dc1=new Set(),_0x468d2b=new Map(),_0x24cb4a=new Map(),_0x104f37=createJumpTargetCache();await withProgressSpinner(_0x1b736d(0x84)+_0x5899b3+_0x1b736d(0x155),async _0x32cae1=>{const _0x14759e=_0x1b736d;for(const _0x1b3f4b of _0x432a22){const _0x46deef=_0x432a22[_0x14759e(0x130)]>0x1?_0x1b3f4b[_0x14759e(0x15f)]+'\x20v'+(_0x1b3f4b['versionNumber']||0x1):_0x1b3f4b[_0x14759e(0x15f)];_0x32cae1[_0x14759e(0x159)](_0x14759e(0x84)+_0x46deef);const _0xa84921=await _0x466178['journey'][_0x14759e(0x93)](_0x1b3f4b['id']),_0x1b6ea5=_0xa84921['attributes']?.[_0x14759e(0xfd)],_0x2cffd8={'resolveSegment':async _0x160b94=>{const _0x6c0198=_0x14759e;if(!_0x1b6ea5)return{'name':_0x160b94,'isJourneyLocal':![]};const _0x120718=_0x1cf453[_0x6c0198(0xa3)](_0x160b94);if(_0x120718)return _0x120718;try{const _0x3b90d2=await _0x466178[_0x6c0198(0xc2)][_0x6c0198(0xf0)](_0x1b6ea5,_0x160b94),_0xa8ce08=_0x3b90d2[_0x6c0198(0x10a)]===SEGMENT_KIND_JOURNEY;let _0x52b8d6,_0x5a4d44=_0x3b90d2[_0x6c0198(0xd0)];if(_0xa8ce08&&_0x3b90d2[_0x6c0198(0xd8)]){const _0x3c272d=await segmentResponseToDef(_0x3b90d2,{'resolveSegmentName':async _0x2ee412=>{const _0x18ec77=_0x6c0198,_0x430087=_0x1cf453[_0x18ec77(0xa3)](_0x2ee412);if(_0x430087)return _0x430087[_0x18ec77(0xd0)];const _0x5b255a=await _0x2cffd8['resolveSegment'](_0x2ee412);return _0x5b255a['name'];}}),_0x49a29c=_0x3c272d[_0x6c0198(0xd8)];_0x52b8d6={'description':_0x3b90d2[_0x6c0198(0x16c)],'rule':_0x49a29c};const _0x2d0bcd=serializeRule(_0x49a29c),_0x12a984=_0x4da90b[_0x6c0198(0xa3)](_0x2d0bcd);if(_0x12a984)_0x5a4d44=_0x12a984,_0x52b8d6=undefined,_0xf17abd[_0x6c0198(0x175)]&&console['error'](_0x6c0198(0x9d)+_0x3b90d2[_0x6c0198(0xd0)]+_0x6c0198(0xba)+_0x12a984);else{let _0x2501c5=![];if(_0x9a98e7){const _0x3d34be=_0x9a98e7['get'](_0x2d0bcd);if(_0x3d34be){const _0x224226=_0x3d34be['find'](_0x476c67=>!_0x3437eb[_0x6c0198(0x157)](_0x476c67));_0x224226&&(_0x5a4d44=_0x224226,_0x3437eb['add'](_0x224226),_0x4da90b[_0x6c0198(0x11d)](_0x2d0bcd,_0x224226),_0x2501c5=!![],_0xf17abd['verbose']&&console[_0x6c0198(0x92)](_0x6c0198(0xf7)+_0x224226+_0x6c0198(0xeb)));}}if(!_0x2501c5){const _0xd3d0a9=generateJourneyLocalName(_0x3b90d2['name']);_0xd3d0a9&&(_0x5a4d44=_0xd3d0a9);let _0x571c29=_0x5a4d44,_0x1b6f07=0x2;while(_0x3437eb[_0x6c0198(0x157)](_0x571c29)){_0x571c29=_0x5a4d44+'_'+_0x1b6f07,_0x1b6f07++;}_0x3437eb[_0x6c0198(0x18e)](_0x571c29),_0x4da90b[_0x6c0198(0x11d)](_0x2d0bcd,_0x571c29),_0x5a4d44=_0x571c29;}}}const _0x180455={'name':_0x5a4d44,'isJourneyLocal':_0xa8ce08,'definition':_0x52b8d6};return _0x1cf453[_0x6c0198(0x11d)](_0x160b94,_0x180455),_0x180455;}catch(_0xda40d4){return _0x407f33[_0x6c0198(0x175)]&&console[_0x6c0198(0x92)](_0x6c0198(0xfc)+_0x160b94+':\x20'+_0xda40d4[_0x6c0198(0x177)]),{'name':_0x160b94,'isJourneyLocal':![]};}},'resolveActivation':async _0x1684dc=>{const _0x401cfd=_0x14759e,_0x15df4b=_0x468d2b['get'](_0x1684dc);if(_0x15df4b)return _0x15df4b;try{const _0x2102f5=await _0x466178[_0x401cfd(0xc3)]['getActivation'](_0x1b3f4b['id'],_0x1684dc),_0x3cb42d=journeyActivationStepToYaml(_0x2102f5,_0xb4ebaa,_0xe40f1c),_0x3f7b40=JSON[_0x401cfd(0x135)]({'name':_0x3cb42d[_0x401cfd(0xd0)],'connection':_0x3cb42d[_0x401cfd(0x17e)],'connector_config':_0x3cb42d['connector_config']}),_0x2dc93e=_0x24cb4a['get'](_0x3f7b40);if(_0x2dc93e){const _0xc8821f={'name':_0x2dc93e,'isJourneyLocal':!![],'definition':_0x3cb42d};return _0x468d2b[_0x401cfd(0x11d)](_0x1684dc,_0xc8821f),_0xc8821f;}const _0x31c29b=_0x2102f5[_0x401cfd(0x1a6)][_0x401cfd(0x19a)][_0x401cfd(0xd0)]||_0x1684dc,_0x2be5c3=sanitizeYamlKey(_0x31c29b)||'activation_'+_0x1684dc;let _0x1faf8e=_0x2be5c3,_0x349acc=0x2;while(_0x388dc1[_0x401cfd(0x157)](_0x1faf8e)){_0x1faf8e=_0x2be5c3+'_'+_0x349acc,_0x349acc++;}_0x388dc1[_0x401cfd(0x18e)](_0x1faf8e),_0x24cb4a['set'](_0x3f7b40,_0x1faf8e);const _0x19be24={'name':_0x1faf8e,'isJourneyLocal':!![],'definition':_0x3cb42d};return _0x468d2b[_0x401cfd(0x11d)](_0x1684dc,_0x19be24),_0x19be24;}catch(_0x4066ae){return _0x407f33[_0x401cfd(0x175)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x1684dc+':\x20'+_0x4066ae[_0x401cfd(0x177)]),{'name':_0x1684dc,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0xfc5655,_0x1ec5bf)=>{const _0x11cc8b=_0x14759e;return resolveJumpTarget(_0xfc5655,_0x1ec5bf,_0x104f37,_0x1cedd3=>_0x466178[_0x11cc8b(0xc3)][_0x11cc8b(0x93)](_0x1cedd3));}},_0x135755=await journeyResponseToDef(_0xa84921,_0x2cffd8);_0x41eac2[_0x14759e(0x121)]({'item':_0x1b3f4b,'yaml':_0x135755});}},{'verbose':_0x407f33[_0x1b736d(0x175)]});const _0x3a4601=await _0x466178[_0x1b736d(0xc3)]['getLatestJourneyId'](_0x432a22[0x0]['journeyBundleId']),_0x22d1da=buildMergedJourneyDef(_0x41eac2,_0x9a98e7,_0x3a4601),_0x4bed9c=normalizeJourneyDef(_0x22d1da,_0x1a2f7a),_0x30ab6d=toYamlString(_0x4bed9c),_0xc01586=_0x5dfd43||a30_0x39acee[_0x1b736d(0x101)](_0x3712fd,sanitizeFileName(_0x5899b3)+_0x1b736d(0x1a4));!_0x5dfd43&&_0x37b952&&!existsSync(_0x3712fd)&&mkdirSync(_0x3712fd,{'recursive':!![]});const _0x41dac5=a30_0x39acee[_0x1b736d(0x120)](process['cwd'](),_0xc01586);if(existsSync(_0xc01586)){const _0x517503=readFileSync(_0xc01586,_0x1b736d(0xa1)),_0x30a3bb=generateDiff(_0x517503,_0x30ab6d),_0x5990b4=hasChanges(_0x30a3bb);_0x1bbadc[_0x1b736d(0x121)]({'relativePath':_0x41dac5,'absolutePath':_0xc01586,'content':_0x30ab6d,'isNew':![],'hasChanges':_0x5990b4,'diff':_0x5990b4?formatDiffWithColors(_0x30a3bb):undefined});}else _0x1bbadc['push']({'relativePath':_0x41dac5,'absolutePath':_0xc01586,'content':_0x30ab6d,'isNew':!![],'hasChanges':![]});}const _0xf1c4bd=_0x1bbadc[_0x1b736d(0x119)](_0x1c7de5=>_0x1c7de5['isNew']),_0x33124b=_0x1bbadc[_0x1b736d(0x119)](_0xa0fa84=>!_0xa0fa84[_0x1b736d(0x152)]&&_0xa0fa84['hasChanges']),_0x4a4292=_0x1bbadc['filter'](_0x3ef265=>!_0x3ef265[_0x1b736d(0x152)]&&!_0x3ef265[_0x1b736d(0x146)]),_0x4ff7ca=_0x8da429[_0x1b736d(0x130)],_0x408c28=_0x5025d2[_0x1b736d(0xaf)],_0x25d110=_0x4ff7ca>_0x408c28?'\x20('+_0x4ff7ca+'\x20versions)':'';console['error'](_0x1b736d(0xfa)),console[_0x1b736d(0x92)]('\x20\x20'+a30_0x2170a8[_0x1b736d(0x166)](_0x408c28+_0x1b736d(0x104))+a30_0x2170a8[_0x1b736d(0xc0)](_0x25d110)),console['error']('\x20\x20'+a30_0x2170a8['green']('+\x20'+_0xf1c4bd['length']+_0x1b736d(0x156))),console[_0x1b736d(0x92)]('\x20\x20'+a30_0x2170a8['yellow']('~\x20'+_0x33124b[_0x1b736d(0x130)]+'\x20changed\x20files')),console['error']('\x20\x20'+a30_0x2170a8[_0x1b736d(0xc0)]('=\x20'+_0x4a4292[_0x1b736d(0x130)]+_0x1b736d(0xae))),console[_0x1b736d(0x92)](_0x1b736d(0xbb)+a30_0x2170a8['cyan'](_0x4ba0e6)+'\x0a');if(_0x33124b[_0x1b736d(0x130)]>0x0)for(const _0x31af0a of _0x33124b){console[_0x1b736d(0x92)](_0x1b736d(0x7a)+_0x31af0a[_0x1b736d(0xf4)]+'\x27:'),console['error']('β'['repeat'](0x3c)),console['error'](_0x31af0a[_0x1b736d(0x18c)]),console[_0x1b736d(0x92)]('β'['repeat'](0x3c));}if(_0xf17abd['dryRun'])return console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0xc5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xf1c4bd[_0x1b736d(0x130)]===0x0&&_0x33124b[_0x1b736d(0x130)]===0x0)return console['error'](a30_0x2170a8[_0x1b736d(0x1a3)](_0x1b736d(0xe9))),saveSessionContext({'parent_segment':_0x58cb12},_0xf17abd[_0x1b736d(0xa0)]),console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0x1a3)](_0x1b736d(0x85)+a30_0x2170a8[_0x1b736d(0xc0)](_0x1b736d(0x12a))+'\x20=\x20'+a30_0x2170a8[_0x1b736d(0x166)](_0x58cb12))),0x0;if(!_0xf17abd['yes']&&(_0xf1c4bd[_0x1b736d(0x130)]>0x0||_0x33124b[_0x1b736d(0x130)]>0x0)){if(!isInteractive())return console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0x12f)](_0x1b736d(0x109)),_0x1b736d(0xcd)),console[_0x1b736d(0x92)](a30_0x2170a8['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5f0a06=await confirmKey('Write\x20'+(_0xf1c4bd[_0x1b736d(0x130)]+_0x33124b['length'])+_0x1b736d(0x99));if(!_0x5f0a06)return console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0xc5)]('Aborted.'),_0x1b736d(0xb4)),0x1;}!existsSync(_0x4ba0e6)&&mkdirSync(_0x4ba0e6,{'recursive':!![]});const _0x30e0c3=a30_0x39acee[_0x1b736d(0x101)](_0x4ba0e6,_0x1b736d(0x16d));writeFileSync(_0x30e0c3,createTdxConfigContent(_0x58cb12),'utf-8');for(const _0x73ac6b of _0x1bbadc){(_0x73ac6b[_0x1b736d(0x152)]||_0x73ac6b[_0x1b736d(0x146)])&&writeFileSync(_0x73ac6b[_0x1b736d(0x100)],_0x73ac6b[_0x1b736d(0x169)],_0x1b736d(0xa1));}return console[_0x1b736d(0x92)](a30_0x2170a8[_0x1b736d(0x1a3)]('β\x20Pulled\x20'+(_0xf1c4bd[_0x1b736d(0x130)]+_0x33124b[_0x1b736d(0x130)])+'\x20journey\x20files\x20to\x20'+_0x4ba0e6)),saveSessionContext({'parent_segment':_0x58cb12},_0xf17abd[_0x1b736d(0xa0)]),console['error'](a30_0x2170a8[_0x1b736d(0x1a3)](_0x1b736d(0x85)+a30_0x2170a8[_0x1b736d(0xc0)](_0x1b736d(0x12a))+_0x1b736d(0x188)+a30_0x2170a8['cyan'](_0x58cb12))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x9a);[a30_0x9050c5(0x16c)]=a30_0x9050c5(0xcc);async['execute'](_0x2379b0){const _0x36c191=a30_0x9050c5,{options:_0x2dcf1d,args:_0x4e130b,tdx:_0x44c538}=_0x2379b0,_0x29ba57=_0x4e130b[0x0];if(!requireNameOrPath(_0x29ba57))return 0x1;_0x2dcf1d[_0x36c191(0x175)]&&console[_0x36c191(0x92)](_0x36c191(0x173)+_0x29ba57);const {journeyId:_0x2eb6de}=await resolveJourneyIdFromInput(_0x29ba57,_0x2dcf1d,_0x44c538),_0x2b89ef=await withSpinner(_0x36c191(0xde),()=>_0x44c538[_0x36c191(0xc3)][_0x36c191(0xab)](_0x2eb6de),{'verbose':_0x2dcf1d[_0x36c191(0x175)]}),_0x51cbb0=_0x2b89ef[_0x36c191(0x14b)];return console[_0x36c191(0x172)](_0x36c191(0xe2)+_0x51cbb0[_0x36c191(0x80)]),console[_0x36c191(0x172)](_0x36c191(0x1a7)+_0x51cbb0[_0x36c191(0xbd)]),await handleSDKOutput(_0x51cbb0[_0x36c191(0xb1)],_0x2dcf1d),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x16a);['description']=a30_0x9050c5(0xda);async[a30_0x9050c5(0x1a1)](_0xc3032c){const _0x58e8d8=a30_0x9050c5,{options:_0x21f9fa,args:_0x5dbe83,tdx:_0x3c5940}=_0xc3032c,_0x3d2bf1=_0x5dbe83[0x0];if(!requireNameOrPath(_0x3d2bf1))return 0x1;_0x21f9fa[_0x58e8d8(0x175)]&&console['error'](_0x58e8d8(0x173)+_0x3d2bf1);const {journeyId:_0x54479a}=await resolveJourneyIdFromInput(_0x3d2bf1,_0x21f9fa,_0x3c5940),_0x1841ff=await withSpinner(_0x58e8d8(0xf5),()=>_0x3c5940['journey']['listActivationsFlat'](_0x54479a),{'verbose':_0x21f9fa[_0x58e8d8(0x175)]}),_0x396788=_0x1841ff[_0x58e8d8(0x14b)];return console[_0x58e8d8(0x92)](_0x58e8d8(0x170)+_0x396788[_0x58e8d8(0x130)]+'\x20activation'+(_0x396788['length']!==0x1?'s':'')),await handleSDKOutput(_0x396788,_0x21f9fa),0x0;}}export class JourneyPushCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x95);['description']=a30_0x9050c5(0x13b);[a30_0x9050c5(0x14f)]=new SegmentPushCommand();async['execute'](_0x4b3a28){const _0x3bf176=a30_0x9050c5,_0x31f8f7=_0x4b3a28[_0x3bf176(0xe1)][0x0];let _0x39c680;if(_0x31f8f7){const _0x222c9c=await resolveTarget({'arg':_0x31f8f7,'contextParent':_0x4b3a28[_0x3bf176(0xb7)]['parentSegment'],'cwd':process[_0x3bf176(0xdb)]()});isSuccessfulResolution(_0x222c9c)&&_0x222c9c['type']===_0x3bf176(0x15e)&&(_0x39c680=_0x222c9c[_0x3bf176(0x12e)]);}const _0x2a592f={..._0x4b3a28,'options':{..._0x4b3a28[_0x3bf176(0xb7)],'journeysOnly':!![],..._0x39c680&&{'singleFilePath':_0x39c680}}};return this['segmentPushCommand'][_0x3bf176(0x1a1)](_0x2a592f);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a30_0x9050c5(0x167);[a30_0x9050c5(0x16c)]=a30_0x9050c5(0xc6);async[a30_0x9050c5(0x1a1)](_0x54e190){const _0x34d227=a30_0x9050c5,{options:_0x1c2a8e,args:_0x2a9409,tdx:_0x4869be}=_0x54e190,_0x5bbcca=_0x2a9409[0x0];if(!requireNameOrPath(_0x5bbcca))return 0x1;if(_0x1c2a8e['verbose'])console['error'](_0x34d227(0x173)+_0x5bbcca);const {journeyId:_0x3f089a}=await resolveJourneyIdFromInput(_0x5bbcca,_0x1c2a8e,_0x4869be),_0x3864c7=await withSpinner(_0x34d227(0x171),()=>_0x4869be[_0x34d227(0xc3)]['listVersions'](_0x3f089a),{'verbose':_0x1c2a8e[_0x34d227(0x175)]}),{bundleName:_0x4fd1d3,versions:_0x5b1cc6,latestJourneyId:_0x34854c}=_0x3864c7[_0x34d227(0x14b)];console['error'](_0x4fd1d3+':\x20'+_0x5b1cc6[_0x34d227(0x130)]+_0x34d227(0xe4)+(_0x5b1cc6[_0x34d227(0x130)]!==0x1?'s':''));const _0x1ba438=_0x5b1cc6[_0x34d227(0x17a)](_0x54f90b=>({'version':_0x54f90b['versionNumber'],'journey_id':_0x54f90b[_0x34d227(0x8d)],'name':_0x54f90b[_0x34d227(0xd0)],'state':_0x54f90b[_0x34d227(0x7b)],'paused':_0x54f90b[_0x34d227(0x9f)],'latest':_0x54f90b['journeyId']===_0x34854c,'created_at':_0x54f90b[_0x34d227(0x129)]}));return await handleSDKOutput(_0x1ba438,_0x1c2a8e),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x15d);[a30_0x9050c5(0x16c)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a30_0x9050c5(0x1a1)](_0x1bc003){const _0x37343c=a30_0x9050c5,{options:_0x56bb23,args:_0x293543,tdx:_0x4c18b7}=_0x1bc003,_0x32a1dc=_0x293543[0x0];if(!requireNameOrPath(_0x32a1dc))return 0x1;if(_0x56bb23[_0x37343c(0x175)])console[_0x37343c(0x92)](_0x37343c(0x173)+_0x32a1dc);const {journeyId:_0x977cf4,journeyName:_0x28b172}=await resolveJourneyIdFromInput(_0x32a1dc,_0x56bb23,_0x4c18b7);if(!_0x56bb23[_0x37343c(0x125)]){const _0xf92afc=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x28b172+'\x22?');if(!_0xf92afc)return console['error'](_0x37343c(0x143)),0x0;}const _0x2d7843=await withSpinner('Creating\x20new\x20version...',()=>_0x4c18b7[_0x37343c(0xc3)][_0x37343c(0xd4)](_0x977cf4),{'verbose':_0x56bb23[_0x37343c(0x175)]}),_0x356a77=_0x2d7843['data'];return console[_0x37343c(0x92)](a30_0x2170a8[_0x37343c(0x1a3)]('\u2714')+_0x37343c(0x89)+_0x356a77[_0x37343c(0x1a6)][_0x37343c(0x114)]+_0x37343c(0x11f)+_0x356a77[_0x37343c(0x1a6)][_0x37343c(0xd0)]+'\x22'),console[_0x37343c(0x92)](_0x37343c(0x11a)+_0x356a77['id']),await handleSingleObjectOutput({'id':_0x356a77['id'],'name':_0x356a77[_0x37343c(0x1a6)][_0x37343c(0xd0)],'version':_0x356a77['attributes'][_0x37343c(0x114)],'state':_0x356a77[_0x37343c(0x1a6)][_0x37343c(0x7b)],'bundle_id':_0x356a77[_0x37343c(0x1a6)][_0x37343c(0x191)],'created_at':_0x356a77[_0x37343c(0x1a6)]['createdAt']},_0x56bb23),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a30_0x9050c5(0xd0)]=a30_0x9050c5(0x14a);[a30_0x9050c5(0x16c)]=a30_0x9050c5(0x127);async[a30_0x9050c5(0x1a1)](_0x266ede){const _0x2d9233=a30_0x9050c5,{options:_0x98531e,args:_0x191231,tdx:_0x23456b}=_0x266ede,_0x264382=_0x191231[0x0];if(!requireNameOrPath(_0x264382))return 0x1;const _0x4e59e3=_0x98531e['version'];if(!_0x4e59e3)return console[_0x2d9233(0x92)](_0x2d9233(0x15c)),console[_0x2d9233(0x92)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x397a13=parseInt(_0x4e59e3,0xa);if(isNaN(_0x397a13)||_0x397a13<0x1)return console[_0x2d9233(0x92)](_0x2d9233(0xd6)+_0x4e59e3),0x1;if(_0x98531e[_0x2d9233(0x175)])console[_0x2d9233(0x92)](_0x2d9233(0x173)+_0x264382+_0x2d9233(0xed)+_0x397a13);const {journeyId:_0x53b3e2,parentSegmentId:_0x1135e5}=await resolveJourneyIdFromInput(_0x264382,_0x98531e,_0x23456b),_0x4f3aab=await withSpinner(_0x2d9233(0x87),()=>_0x23456b['journey'][_0x2d9233(0xa2)](_0x53b3e2),{'verbose':_0x98531e[_0x2d9233(0x175)]}),{versions:_0x3d7499,latestJourneyId:_0x587b5f}=_0x4f3aab[_0x2d9233(0x14b)],_0x481a40=_0x3d7499[_0x2d9233(0x17b)](_0x5502e4=>_0x5502e4[_0x2d9233(0x114)]===_0x397a13);if(!_0x481a40){const _0x3f8b08=_0x3d7499[_0x2d9233(0x17a)](_0x125a6a=>'v'+_0x125a6a[_0x2d9233(0x114)])['join'](',\x20');return console[_0x2d9233(0x92)](_0x2d9233(0x189)+_0x397a13+_0x2d9233(0x148)+_0x3f8b08),0x1;}const _0x3fa432=await withSpinner(_0x2d9233(0x123)+_0x397a13+_0x2d9233(0x15a),()=>_0x23456b[_0x2d9233(0xc3)][_0x2d9233(0x93)](_0x481a40['journeyId']),{'verbose':_0x98531e[_0x2d9233(0x175)]}),_0x44ab46=_0x3fa432['data'],_0x151c37=getConsoleNextUrl(_0x98531e[_0x2d9233(0x110)],'/app/ps/'+_0x1135e5+'/e/'+_0x481a40[_0x2d9233(0x8d)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x44ab46['id'],'name':_0x44ab46['attributes'][_0x2d9233(0xd0)],'version':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x114)],'description':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x16c)],'state':_0x44ab46['attributes'][_0x2d9233(0x7b)],'paused':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x9f)],'reentry_mode':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x9e)],'stages':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0xec)]?.[_0x2d9233(0x130)]||0x0,..._0x44ab46['attributes'][_0x2d9233(0xb6)]&&{'goal':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0xb6)][_0x2d9233(0xd0)]},'latest':_0x481a40[_0x2d9233(0x8d)]===_0x587b5f,'created_at':_0x44ab46[_0x2d9233(0x1a6)][_0x2d9233(0x129)],'updated_at':_0x44ab46['attributes'][_0x2d9233(0xc9)],'url':_0x151c37},_0x98531e),0x0;}}
|