@treasuredata/tdx 0.16.6 β 0.16.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.d.ts.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/agent-test-command.js.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.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/describe.js +1 -1
- package/dist/commands/engage-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/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.d.ts +20 -0
- package/dist/commands/status-command.d.ts.map +1 -0
- package/dist/commands/status-command.js +1 -0
- package/dist/commands/status-command.js.map +1 -0
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-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 +1 -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/profile.d.ts +5 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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.d.ts +3 -1
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/test/parser.js.map +1 -1
- package/dist/sdk/agent/test/types.d.ts +4 -0
- package/dist/sdk/agent/test/types.d.ts.map +1 -1
- package/dist/sdk/agent/types/agent-def.d.ts +3 -3
- package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/api.js.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.d.ts +1 -1
- package/dist/sdk/claude-agent/system-prompts.d.ts.map +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js.map +1 -1
- package/dist/sdk/claude-agent/types.d.ts +6 -0
- package/dist/sdk/claude-agent/types.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +1 -2
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +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.d.ts +2 -5
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +10 -3
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.d.ts +2 -4
- package/dist/sdk/client/td-api-client.d.ts.map +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.d.ts +1 -3
- package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js.map +1 -1
- package/dist/sdk/client/workflow-client.d.ts +1 -2
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/connection.js.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +2 -10
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/job.js.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts +1 -0
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/index.js.map +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.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/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +36 -1
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/user.js.map +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/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.d.ts +99 -0
- package/dist/test-utils/command-runner.d.ts.map +1 -0
- package/dist/test-utils/command-runner.js +1 -0
- package/dist/test-utils/command-runner.js.map +1 -0
- package/dist/test-utils/factories.d.ts +183 -0
- package/dist/test-utils/factories.d.ts.map +1 -0
- package/dist/test-utils/factories.js +1 -0
- package/dist/test-utils/factories.js.map +1 -0
- package/dist/test-utils/fixtures.d.ts +395 -0
- package/dist/test-utils/fixtures.d.ts.map +1 -0
- package/dist/test-utils/fixtures.js +1 -0
- package/dist/test-utils/fixtures.js.map +1 -0
- package/dist/test-utils/http-mock.d.ts +285 -0
- package/dist/test-utils/http-mock.d.ts.map +1 -0
- package/dist/test-utils/http-mock.js +1 -0
- package/dist/test-utils/http-mock.js.map +1 -0
- package/dist/test-utils/index.d.ts +47 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/test-utils/index.js +1 -0
- package/dist/test-utils/index.js.map +1 -0
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/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.d.ts +33 -0
- package/dist/utils/logger/formatters/default-formatter.d.ts.map +1 -0
- package/dist/utils/logger/formatters/default-formatter.js +1 -0
- package/dist/utils/logger/formatters/default-formatter.js.map +1 -0
- package/dist/utils/logger/formatters/index.d.ts +8 -0
- package/dist/utils/logger/formatters/index.d.ts.map +1 -0
- package/dist/utils/logger/formatters/index.js +1 -0
- package/dist/utils/logger/formatters/index.js.map +1 -0
- package/dist/utils/logger/handlers/console-handler.d.ts +31 -0
- package/dist/utils/logger/handlers/console-handler.d.ts.map +1 -0
- package/dist/utils/logger/handlers/console-handler.js +1 -0
- package/dist/utils/logger/handlers/console-handler.js.map +1 -0
- package/dist/utils/logger/handlers/file-handler.d.ts +51 -0
- package/dist/utils/logger/handlers/file-handler.d.ts.map +1 -0
- package/dist/utils/logger/handlers/file-handler.js +1 -0
- package/dist/utils/logger/handlers/file-handler.js.map +1 -0
- package/dist/utils/logger/handlers/index.d.ts +11 -0
- package/dist/utils/logger/handlers/index.d.ts.map +1 -0
- package/dist/utils/logger/handlers/index.js +1 -0
- package/dist/utils/logger/handlers/index.js.map +1 -0
- package/dist/utils/logger/handlers/null-handler.d.ts +16 -0
- package/dist/utils/logger/handlers/null-handler.d.ts.map +1 -0
- package/dist/utils/logger/handlers/null-handler.js +1 -0
- package/dist/utils/logger/handlers/null-handler.js.map +1 -0
- package/dist/utils/logger/index.d.ts +37 -0
- package/dist/utils/logger/index.d.ts.map +1 -0
- package/dist/utils/logger/index.js +1 -0
- package/dist/utils/logger/index.js.map +1 -0
- package/dist/utils/logger/logger.d.ts +132 -0
- package/dist/utils/logger/logger.d.ts.map +1 -0
- package/dist/utils/logger/logger.js +1 -0
- package/dist/utils/logger/logger.js.map +1 -0
- package/dist/utils/logger/types.d.ts +95 -0
- package/dist/utils/logger/types.d.ts.map +1 -0
- package/dist/utils/logger/types.js +1 -0
- package/dist/utils/logger/types.js.map +1 -0
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.d.ts +9 -2
- package/dist/utils/sse-parser.d.ts.map +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/sse-parser.js.map +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.d.ts +44 -21
- package/dist/utils/tdx-logger.d.ts.map +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tdx-logger.js.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x5718b5=a16_0x1ecb;(function(_0x35b5c7,_0x3740e2){const _0x10af41=a16_0x1ecb,_0x19cceb=_0x35b5c7();while(!![]){try{const _0xe0371f=parseInt(_0x10af41(0x1e7))/0x1+parseInt(_0x10af41(0x1b1))/0x2*(parseInt(_0x10af41(0x1df))/0x3)+parseInt(_0x10af41(0x1e5))/0x4+parseInt(_0x10af41(0x1fb))/0x5+parseInt(_0x10af41(0x1fd))/0x6+parseInt(_0x10af41(0x1f7))/0x7*(-parseInt(_0x10af41(0x202))/0x8)+-parseInt(_0x10af41(0x22f))/0x9*(parseInt(_0x10af41(0x200))/0xa);if(_0xe0371f===_0x3740e2)break;else _0x19cceb['push'](_0x19cceb['shift']());}catch(_0x5594ad){_0x19cceb['push'](_0x19cceb['shift']());}}}(a16_0x4a9c,0xf0850));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x8bb508,_0xe0399c,_0x3f08d7=![]){const _0xeea34e=a16_0x1ecb;if(_0x8bb508[_0xeea34e(0x1c3)])return await _0xe0399c[_0xeea34e(0x1ba)]['resolveWorkspaceId'](_0x8bb508[_0xeea34e(0x1c3)]);const _0x80119a=loadSessionContext(_0x8bb508[_0xeea34e(0x21e)]);if(_0x80119a?.[_0xeea34e(0x212)])return await _0xe0399c['engage'][_0xeea34e(0x233)](_0x80119a[_0xeea34e(0x212)]);if(_0x3f08d7)throw new SDKError(ErrorCode[_0xeea34e(0x1be)],_0xeea34e(0x211),undefined,{'helpText':_0xeea34e(0x1ca)});return undefined;}async function resolveSegmentFromOptions(_0x36416a,_0x5a575b){const _0x16f7e4=a16_0x1ecb;if(!_0x36416a[_0x16f7e4(0x1f3)])return{};const _0x3b7039=_0x36416a['segment'],_0x12c9c9=await _0x5a575b[_0x16f7e4(0x1f3)][_0x16f7e4(0x1bc)](_0x3b7039);return{'audienceId':_0x12c9c9[_0x16f7e4(0x1bd)],'audienceName':_0x12c9c9[_0x16f7e4(0x1d2)],..._0x12c9c9[_0x16f7e4(0x22e)]&&{'segmentId':_0x12c9c9[_0x16f7e4(0x22e)],'segmentName':_0x12c9c9[_0x16f7e4(0x20b)]}};}function buildConnectorConfig(_0x489007){const _0x563bde=a16_0x1ecb,_0x432346=_0x489007['emailSenderId'],_0x409a78=_0x489007[_0x563bde(0x223)];if(!_0x432346&&!_0x409a78)return undefined;return{..._0x432346&&{'emailSenderId':_0x432346},..._0x409a78&&{'jsonColumns':_0x409a78}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1d5);['description']=a16_0x5718b5(0x1d4);async[a16_0x5718b5(0x1ae)](_0x15b629){const _0x435970=a16_0x5718b5,{options:_0x5c27eb,args:_0x2397f0,tdx:_0x252398}=_0x15b629,_0x38091c=_0x2397f0[0x0],_0x462952=resolveLimit(_0x5c27eb['limit'],DEFAULT_LLM_LIMIT),_0x137ef=_0x5c27eb,_0x354e95=_0x137ef['type'],_0x5a147e=_0x137ef[_0x435970(0x1e2)],_0x462854=await resolveWorkspaceIdFromOptions(_0x137ef,_0x252398),_0x4811af=await withSpinner(_0x435970(0x1e8),()=>_0x252398[_0x435970(0x1ba)][_0x435970(0x1d6)]({'type':_0x354e95,'status':_0x5a147e,'workspaceId':_0x462854,'limit':_0x462952}),{'verbose':_0x5c27eb[_0x435970(0x1c8)]});let _0x22de6d=_0x4811af[_0x435970(0x208)];return _0x38091c&&(_0x22de6d=_0x4811af[_0x435970(0x208)][_0x435970(0x1cd)](_0x267cee=>matchGlobPattern(_0x267cee[_0x435970(0x1cc)],_0x38091c))),await handleSDKOutput(_0x22de6d,_0x5c27eb),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1c7);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x204);async[a16_0x5718b5(0x1ae)](_0x3605da){const _0x4fec26=a16_0x5718b5,{options:_0x2f086,args:_0x13d68f,tdx:_0x25b25c}=_0x3605da;if(_0x13d68f[_0x4fec26(0x207)]===0x0)return console['error'](_0x4fec26(0x1bf)),console[_0x4fec26(0x1ef)](_0x4fec26(0x216)),0x1;const _0x24a4cf=_0x13d68f[0x0],_0x1a2436=_0x2f086,_0x69222=await resolveWorkspaceIdFromOptions(_0x1a2436,_0x25b25c),_0x3c8030=_0x1a2436[_0x4fec26(0x1ec)];if(_0x3c8030){const _0x285fa4=await withSpinner(_0x4fec26(0x218)+_0x24a4cf+'\x27...',()=>_0x25b25c['engage'][_0x4fec26(0x22c)](_0x24a4cf,_0x69222),{'verbose':_0x2f086[_0x4fec26(0x1c8)]});await handleSDKOutput([_0x285fa4],_0x2f086);}else{const _0x262d1b=await withSpinner(_0x4fec26(0x218)+_0x24a4cf+_0x4fec26(0x1b7),()=>_0x25b25c['engage'][_0x4fec26(0x231)](_0x24a4cf,_0x69222),{'verbose':_0x2f086['verbose']});await handleSDKOutput([_0x262d1b],_0x2f086);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x213);[a16_0x5718b5(0x235)]='Create\x20a\x20new\x20campaign';async[a16_0x5718b5(0x1ae)](_0x5585b6){const _0x4f0be0=a16_0x5718b5,{options:_0x13841a,tdx:_0x1654f3}=_0x5585b6,_0x481502=_0x13841a,_0x5062d0=_0x481502[_0x4f0be0(0x1cc)],_0x4cef4c=_0x481502[_0x4f0be0(0x22d)];if(!_0x5062d0)return console[_0x4f0be0(0x1ef)](_0x4f0be0(0x215)),console['error'](_0x4f0be0(0x1d8)),0x1;if(!_0x4cef4c)return console[_0x4f0be0(0x1ef)](_0x4f0be0(0x20a)),console[_0x4f0be0(0x1ef)](_0x4f0be0(0x1d8)),0x1;const _0x568ce8=await resolveWorkspaceIdFromOptions(_0x481502,_0x1654f3,!![]),_0x32bb4f=await resolveSegmentFromOptions(_0x481502,_0x1654f3),_0x51f2c1=buildConnectorConfig(_0x481502),_0x569be5={'name':_0x5062d0,'campaignType':_0x4cef4c,'workspaceId':_0x568ce8,'description':_0x481502[_0x4f0be0(0x235)],..._0x32bb4f,'connectorConfig':_0x51f2c1,'startAt':_0x481502[_0x4f0be0(0x203)],'timezone':_0x481502['timezone']},_0x1919d7=await withSpinner(_0x4f0be0(0x226)+_0x5062d0+'\x27...',()=>_0x1654f3[_0x4f0be0(0x1ba)][_0x4f0be0(0x21b)](_0x569be5));return await handleSDKOutput([_0x1919d7['data']],_0x13841a),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1d0);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1ad);async[a16_0x5718b5(0x1ae)](_0x47dc81){const _0x41e03c=a16_0x5718b5,{options:_0x346e01,args:_0x3ef185,tdx:_0x23d3a0}=_0x47dc81;if(_0x3ef185[_0x41e03c(0x207)]===0x0)return console['error'](_0x41e03c(0x1bf)),console[_0x41e03c(0x1ef)](_0x41e03c(0x1f5)),0x1;const _0x37871f=_0x3ef185[0x0],_0x37bf13=_0x346e01,_0x3ec82e=await resolveWorkspaceIdFromOptions(_0x37bf13,_0x23d3a0),_0x3eb584=await resolveSegmentFromOptions(_0x37bf13,_0x23d3a0),_0x33e15f=buildConnectorConfig(_0x37bf13),_0x5cb2ee={'name':_0x37bf13['name'],'description':_0x37bf13['description'],..._0x3eb584,'connectorConfig':_0x33e15f,'startAt':_0x37bf13['startAt'],'timezone':_0x37bf13[_0x41e03c(0x232)]},_0x8e87a6=Object[_0x41e03c(0x1b4)](Object[_0x41e03c(0x1b3)](_0x5cb2ee)[_0x41e03c(0x1cd)](([,_0x123104])=>_0x123104!==undefined));if(Object[_0x41e03c(0x1dd)](_0x8e87a6)['length']===0x0)return console[_0x41e03c(0x1ef)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error']('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x30d5fd=await withSpinner(_0x41e03c(0x1fe)+_0x37871f+'\x27...',()=>_0x23d3a0[_0x41e03c(0x1ba)][_0x41e03c(0x205)](_0x37871f,_0x8e87a6,_0x3ec82e),{'verbose':_0x346e01[_0x41e03c(0x1c8)]});return await handleSDKOutput([_0x30d5fd[_0x41e03c(0x208)]],_0x346e01),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a16_0x5718b5(0x1c2);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1ab);async['execute'](_0x21bcba){const _0x674b59=a16_0x5718b5,{options:_0xc3c27a,args:_0x17427c,tdx:_0x32d228}=_0x21bcba;if(_0x17427c[_0x674b59(0x207)]===0x0)return console['error'](_0x674b59(0x1bf)),console[_0x674b59(0x1ef)](_0x674b59(0x20f)),0x1;const _0x2a8fe7=_0x17427c[0x0],_0x48fc6d=_0xc3c27a,_0x4e1a3d=await resolveWorkspaceIdFromOptions(_0x48fc6d,_0x32d228);if(!_0xc3c27a[_0x674b59(0x1f9)]){const _0x5be481=await confirm(_0x674b59(0x21a)+_0x2a8fe7+_0x674b59(0x1cb));if(!_0x5be481)return console[_0x674b59(0x1f6)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x674b59(0x21f)+_0x2a8fe7+_0x674b59(0x1b7),()=>_0x32d228[_0x674b59(0x1ba)]['deleteCampaign'](_0x2a8fe7,_0x4e1a3d),{'verbose':_0xc3c27a[_0x674b59(0x1c8)]}),console['log'](_0x674b59(0x1b5)+_0x2a8fe7+_0x674b59(0x1ed)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1af);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1c5);async[a16_0x5718b5(0x1ae)](_0x31b7bd){const _0x149e93=a16_0x5718b5,{options:_0x540b3c,args:_0x1d4495,tdx:_0x400e1c}=_0x31b7bd;if(_0x1d4495['length']===0x0)return console[_0x149e93(0x1ef)](_0x149e93(0x1bf)),console[_0x149e93(0x1ef)](_0x149e93(0x1ee)),0x1;const _0x57287e=_0x1d4495[0x0],_0x3fafb4=_0x540b3c,_0x436e20=await resolveWorkspaceIdFromOptions(_0x3fafb4,_0x400e1c);return await withSpinner(_0x149e93(0x1ea)+_0x57287e+_0x149e93(0x1b7),()=>_0x400e1c[_0x149e93(0x1ba)][_0x149e93(0x230)](_0x57287e,_0x436e20),{'verbose':_0x540b3c[_0x149e93(0x1c8)]}),console['log'](_0x149e93(0x1b5)+_0x57287e+_0x149e93(0x1ac)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:campaign:pause';[a16_0x5718b5(0x235)]='Pause\x20a\x20campaign';async[a16_0x5718b5(0x1ae)](_0x12fe8f){const _0x241470=a16_0x5718b5,{options:_0x248123,args:_0x5a90e0,tdx:_0x1f775f}=_0x12fe8f;if(_0x5a90e0[_0x241470(0x207)]===0x0)return console[_0x241470(0x1ef)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x241470(0x1ef)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0xd4d9a8=_0x5a90e0[0x0],_0x33a15d=_0x248123,_0x9642cb=await resolveWorkspaceIdFromOptions(_0x33a15d,_0x1f775f);return await withSpinner('Pausing\x20campaign\x20\x27'+_0xd4d9a8+_0x241470(0x1b7),()=>_0x1f775f[_0x241470(0x1ba)][_0x241470(0x209)](_0xd4d9a8,_0x9642cb),{'verbose':_0x248123[_0x241470(0x1c8)]}),console[_0x241470(0x1f6)](_0x241470(0x1b5)+_0xd4d9a8+_0x241470(0x1d1)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:campaign:resume';[a16_0x5718b5(0x235)]='Resume\x20a\x20paused\x20campaign';async['execute'](_0x183408){const _0x11eeaa=a16_0x5718b5,{options:_0x5caf49,args:_0x26e2b5,tdx:_0x211210}=_0x183408;if(_0x26e2b5[_0x11eeaa(0x207)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x11eeaa(0x1db)),0x1;const _0x6cde9=_0x26e2b5[0x0],_0x2cac26=_0x5caf49,_0x5c12d2=await resolveWorkspaceIdFromOptions(_0x2cac26,_0x211210);return await withSpinner(_0x11eeaa(0x1da)+_0x6cde9+_0x11eeaa(0x1b7),()=>_0x211210[_0x11eeaa(0x1ba)][_0x11eeaa(0x1cf)](_0x6cde9,_0x5c12d2),{'verbose':_0x5caf49['verbose']}),console['log']('Campaign\x20\x27'+_0x6cde9+_0x11eeaa(0x1fc)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1e0);['description']=a16_0x5718b5(0x1f1);async[a16_0x5718b5(0x1ae)](_0x497982){const _0x4298c5=a16_0x5718b5,{options:_0x262097,args:_0x4ecbd0,tdx:_0x4aa269}=_0x497982;if(_0x4ecbd0[_0x4298c5(0x207)]===0x0)return console['error'](_0x4298c5(0x1bf)),console[_0x4298c5(0x1ef)](_0x4298c5(0x21c)),0x1;const _0x2beca2=_0x4ecbd0[0x0],_0x2449ff=_0x262097,_0x5c50ad=await resolveWorkspaceIdFromOptions(_0x2449ff,_0x4aa269),_0x169e1e=await withSpinner(_0x4298c5(0x1b6)+_0x2beca2+_0x4298c5(0x1b7),()=>_0x4aa269[_0x4298c5(0x1ba)][_0x4298c5(0x221)](_0x2beca2,_0x5c50ad),{'verbose':_0x262097[_0x4298c5(0x1c8)]});return await handleSDKOutput([_0x169e1e[_0x4298c5(0x208)]],_0x262097),0x0;}}function a16_0x1ecb(_0x38fa3e,_0x595111){_0x38fa3e=_0x38fa3e-0x1ab;const _0x4a9c1b=a16_0x4a9c();let _0x1ecbc3=_0x4a9c1b[_0x38fa3e];return _0x1ecbc3;}export class EngageTemplatesCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x234);['description']='List\x20email\x20templates';async[a16_0x5718b5(0x1ae)](_0x2778d8){const _0x33616b=a16_0x5718b5,{options:_0x9a5ea3,args:_0x4afd38,tdx:_0x5a6936}=_0x2778d8,_0x4f1e6f=_0x4afd38[0x0],_0x9fab09=resolveLimit(_0x9a5ea3[_0x33616b(0x1bb)],DEFAULT_LLM_LIMIT),_0x4c4502=_0x9a5ea3,_0x114fd3=await resolveWorkspaceIdFromOptions(_0x4c4502,_0x5a6936),_0x228bb4=await withSpinner(_0x33616b(0x1ff),()=>_0x5a6936[_0x33616b(0x1ba)][_0x33616b(0x1f2)]({'workspaceId':_0x114fd3,'limit':_0x9fab09}),{'verbose':_0x9a5ea3[_0x33616b(0x1c8)]});let _0x438870=_0x228bb4[_0x33616b(0x208)];return _0x4f1e6f&&(_0x438870=_0x228bb4['data'][_0x33616b(0x1cd)](_0x59f5ad=>matchGlobPattern(_0x59f5ad['name'],_0x4f1e6f))),await handleSDKOutput(_0x438870,_0x9a5ea3),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x20e);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1b0);async[a16_0x5718b5(0x1ae)](_0x3ad0f9){const _0x385352=a16_0x5718b5,{options:_0x6aed2f,args:_0x3ac7ab,tdx:_0x1215fa}=_0x3ad0f9;if(_0x3ac7ab[_0x385352(0x207)]===0x0)return console[_0x385352(0x1ef)](_0x385352(0x1b9)),console[_0x385352(0x1ef)]('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x5d7a63=_0x3ac7ab[0x0],_0x366222=_0x6aed2f,_0x2d6ea5=await resolveWorkspaceIdFromOptions(_0x366222,_0x1215fa),_0x358a6a=_0x366222[_0x385352(0x1ec)];if(_0x358a6a){const _0x5a5f46=await withSpinner(_0x385352(0x219)+_0x5d7a63+_0x385352(0x1b7),()=>_0x1215fa[_0x385352(0x1ba)][_0x385352(0x22a)](_0x5d7a63,_0x2d6ea5),{'verbose':_0x6aed2f[_0x385352(0x1c8)]});await handleSDKOutput([_0x5a5f46],_0x6aed2f);}else{const _0x3e171e=await withSpinner(_0x385352(0x219)+_0x5d7a63+_0x385352(0x1b7),()=>_0x1215fa[_0x385352(0x1ba)][_0x385352(0x229)](_0x5d7a63,_0x2d6ea5),{'verbose':_0x6aed2f[_0x385352(0x1c8)]});await handleSDKOutput([_0x3e171e],_0x6aed2f);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:template:create';[a16_0x5718b5(0x235)]=a16_0x5718b5(0x217);async[a16_0x5718b5(0x1ae)](_0x3ac5c6){const _0x23c1cf=a16_0x5718b5,{options:_0x4450a1,tdx:_0x49c11c}=_0x3ac5c6,_0xbe5812=_0x4450a1,_0x2d2fb5=_0xbe5812['name'],_0xcb2ed5=_0xbe5812['subject'],_0x51317d=_0xbe5812['html'];if(!_0x2d2fb5)return console[_0x23c1cf(0x1ef)](_0x23c1cf(0x215)),console[_0x23c1cf(0x1ef)](_0x23c1cf(0x227)),0x1;if(!_0xcb2ed5)return console['error'](_0x23c1cf(0x1e9)),0x1;if(!_0x51317d)return console[_0x23c1cf(0x1ef)](_0x23c1cf(0x210)),0x1;const _0xa65232=await resolveWorkspaceIdFromOptions(_0xbe5812,_0x49c11c,!![]),_0x23e8d8={'name':_0x2d2fb5,'subjectTemplate':_0xcb2ed5,'htmlTemplate':_0x51317d,'workspaceId':_0xa65232,'plaintextTemplate':_0xbe5812['plaintext'],'editorType':_0xbe5812[_0x23c1cf(0x1dc)]},_0x2726f8=await withSpinner('Creating\x20template\x20\x27'+_0x2d2fb5+'\x27...',()=>_0x49c11c[_0x23c1cf(0x1ba)][_0x23c1cf(0x1e1)](_0x23e8d8));return await handleSDKOutput([_0x2726f8[_0x23c1cf(0x208)]],_0x4450a1),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:template:update';[a16_0x5718b5(0x235)]='Update\x20an\x20email\x20template';async['execute'](_0x2ab12f){const _0x10848e=a16_0x5718b5,{options:_0x4c2eb7,args:_0x40a945,tdx:_0x1a16c8}=_0x2ab12f;if(_0x40a945[_0x10848e(0x207)]===0x0)return console[_0x10848e(0x1ef)](_0x10848e(0x1b9)),console[_0x10848e(0x1ef)](_0x10848e(0x236)),0x1;const _0x5c3a60=_0x40a945[0x0],_0x1ee728=_0x4c2eb7,_0x696fc3=await resolveWorkspaceIdFromOptions(_0x1ee728,_0x1a16c8),_0x5bf89a={'name':_0x1ee728[_0x10848e(0x1cc)],'subjectTemplate':_0x1ee728[_0x10848e(0x222)],'htmlTemplate':_0x1ee728[_0x10848e(0x1c9)],'plaintextTemplate':_0x1ee728[_0x10848e(0x228)]},_0x2850a1=Object[_0x10848e(0x1b4)](Object[_0x10848e(0x1b3)](_0x5bf89a)[_0x10848e(0x1cd)](([,_0x582e05])=>_0x582e05!==undefined));if(Object['keys'](_0x2850a1)[_0x10848e(0x207)]===0x0)return console[_0x10848e(0x1ef)](_0x10848e(0x21d)),console[_0x10848e(0x1ef)](_0x10848e(0x1c0)),0x1;const _0x29bf57=await withSpinner('Updating\x20template\x20\x27'+_0x5c3a60+_0x10848e(0x1b7),()=>_0x1a16c8['engage']['updateTemplate'](_0x5c3a60,_0x2850a1,_0x696fc3),{'verbose':_0x4c2eb7['verbose']});return await handleSDKOutput([_0x29bf57[_0x10848e(0x208)]],_0x4c2eb7),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1e4);[a16_0x5718b5(0x235)]='Delete\x20an\x20email\x20template';async[a16_0x5718b5(0x1ae)](_0x10c542){const _0x184e0f=a16_0x5718b5,{options:_0x51dcac,args:_0x4f37b4,tdx:_0x3635f8}=_0x10c542;if(_0x4f37b4[_0x184e0f(0x207)]===0x0)return console[_0x184e0f(0x1ef)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x184e0f(0x1ef)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x8e464a=_0x4f37b4[0x0],_0x2c6d82=_0x51dcac,_0x46692a=await resolveWorkspaceIdFromOptions(_0x2c6d82,_0x3635f8);if(!_0x51dcac[_0x184e0f(0x1f9)]){const _0x157c0f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x8e464a+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x157c0f)return console['log'](_0x184e0f(0x1f4)),0x0;}return await withSpinner(_0x184e0f(0x20c)+_0x8e464a+_0x184e0f(0x1b7),()=>_0x3635f8[_0x184e0f(0x1ba)][_0x184e0f(0x220)](_0x8e464a,_0x46692a),{'verbose':_0x51dcac[_0x184e0f(0x1c8)]}),console[_0x184e0f(0x1f6)]('Template\x20\x27'+_0x8e464a+_0x184e0f(0x1ed)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:workspaces';[a16_0x5718b5(0x235)]='List\x20workspaces';async[a16_0x5718b5(0x1ae)](_0x204831){const _0x1d56b5=a16_0x5718b5,{options:_0x1c06cf,args:_0x2a5508,tdx:_0x8bb03b}=_0x204831,_0x5c422d=_0x2a5508[0x0],_0xf171fc=resolveLimit(_0x1c06cf[_0x1d56b5(0x1bb)],DEFAULT_LLM_LIMIT),_0x18443c=await withSpinner('Fetching\x20workspaces...',()=>_0x8bb03b['engage']['listWorkspaces']({'limit':_0xf171fc}),{'verbose':_0x1c06cf[_0x1d56b5(0x1c8)]});let _0x5b212d=_0x18443c['data'];return _0x5c422d&&(_0x5b212d=_0x18443c[_0x1d56b5(0x208)][_0x1d56b5(0x1cd)](_0x56365b=>matchGlobPattern(_0x56365b[_0x1d56b5(0x1cc)],_0x5c422d))),await handleSDKOutput(_0x5b212d,_0x1c06cf),0x0;}}function a16_0x4a9c(){const _0x4b6feb=['error','engage:workspace:delete','Duplicate\x20a\x20campaign','listTemplates','segment','Operation\x20cancelled','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','log','9284443iudaWx','Workspace\x20\x27','yes','engage:workspace:update','3105585zuOexP','\x27\x20resumed\x20successfully','5890026SebkGq','Updating\x20campaign\x20\x27','Fetching\x20templates...','60380jbEPCA','engage:workspace:create','8xxnswu','startAt','Show\x20campaign\x20details','updateCampaign','Show\x20workspace\x20details','length','data','pauseCampaign','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','segmentName','Deleting\x20template\x20\x27','Engage\x20workspace\x20set\x20to:\x20','engage:template:show','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Error:\x20--html\x20is\x20required','Workspace\x20is\x20required\x20for\x20this\x20operation','engage_workspace','engage:campaign:create','updateWorkspace','Error:\x20--name\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Create\x20an\x20email\x20template','Fetching\x20campaign\x20\x27','Fetching\x20template\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','createCampaign','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','session','Deleting\x20campaign\x20\x27','deleteTemplate','duplicateCampaign','subject','jsonColumns','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Creating\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','plaintext','getTemplate','getTemplateFull','deleteWorkspace','getCampaignFull','type','segmentId','5634XWgyPU','launchCampaign','getCampaign','timezone','resolveWorkspaceId','engage:templates','description','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Delete\x20a\x20campaign','\x27\x20launched\x20successfully','Update\x20a\x20campaign','execute','engage:campaign:launch','Show\x20email\x20template\x20details','912026njzGcb','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','entries','fromEntries','Campaign\x20\x27','Duplicating\x20campaign\x20\x27','\x27...','Updating\x20workspace\x20\x27','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','engage','limit','resolvePathToResource','parentId','MISSING_ARGUMENT','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Create\x20a\x20workspace','engage:campaign:delete','workspace','Verifying\x20workspace\x20\x27','Launch\x20a\x20campaign','engage:workspace:show','engage:campaign:show','verbose','html','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','\x27?\x20This\x20cannot\x20be\x20undone.','name','filter','Creating\x20workspace\x20\x27','resumeCampaign','engage:campaign:update','\x27\x20paused\x20successfully','parentName','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','List\x20campaigns','engage:campaigns','listCampaigns','Fetching\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Options:\x20--name,\x20--description','Resuming\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','editorType','keys','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','12yiogHW','engage:campaign:duplicate','createTemplate','status','createWorkspace','engage:template:delete','3977596NHOmJz','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','1670066vEVmHk','Fetching\x20campaigns...','Error:\x20--subject\x20is\x20required','Launching\x20campaign\x20\x27','Set\x20workspace\x20context\x20for\x20Engage\x20commands','full','\x27\x20deleted\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'];a16_0x4a9c=function(){return _0x4b6feb;};return a16_0x4a9c();}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1c6);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x206);async['execute'](_0x53de1d){const _0x468499=a16_0x5718b5,{options:_0x2fa37b,args:_0x2d1332,tdx:_0x4b58a1}=_0x53de1d;if(_0x2d1332['length']===0x0)return console[_0x468499(0x1ef)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x468499(0x1ef)](_0x468499(0x225)),0x1;const _0x529250=_0x2d1332[0x0],_0xd72e1d=_0x2fa37b,_0x5609dc=_0xd72e1d[_0x468499(0x1ec)];if(_0x5609dc){const _0x3ae9e0=await withSpinner('Fetching\x20workspace\x20\x27'+_0x529250+'\x27...',()=>_0x4b58a1[_0x468499(0x1ba)]['getWorkspaceFull'](_0x529250),{'verbose':_0x2fa37b[_0x468499(0x1c8)]});await handleSDKOutput([_0x3ae9e0],_0x2fa37b);}else{const _0x2cf79f=await withSpinner(_0x468499(0x1d7)+_0x529250+_0x468499(0x1b7),()=>_0x4b58a1[_0x468499(0x1ba)]['getWorkspace'](_0x529250),{'verbose':_0x2fa37b[_0x468499(0x1c8)]});await handleSDKOutput([_0x2cf79f],_0x2fa37b);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x201);[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1c1);async[a16_0x5718b5(0x1ae)](_0x18c34d){const _0x577956=a16_0x5718b5,{options:_0x5e7c7f,tdx:_0x369ba5}=_0x18c34d,_0x493261=_0x5e7c7f,_0x5b4d18=_0x493261[_0x577956(0x1cc)];if(!_0x5b4d18)return console[_0x577956(0x1ef)](_0x577956(0x215)),console[_0x577956(0x1ef)](_0x577956(0x1d3)),0x1;const _0x2ff63a={'name':_0x5b4d18,'description':_0x493261[_0x577956(0x235)]},_0x280d15=await withSpinner(_0x577956(0x1ce)+_0x5b4d18+_0x577956(0x1b7),()=>_0x369ba5['engage'][_0x577956(0x1e3)](_0x2ff63a));return await handleSDKOutput([_0x280d15[_0x577956(0x208)]],_0x5e7c7f),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1fa);[a16_0x5718b5(0x235)]='Update\x20a\x20workspace';async[a16_0x5718b5(0x1ae)](_0x3cb90d){const _0x7593fc=a16_0x5718b5,{options:_0x530bae,args:_0x12337d,tdx:_0x5bc619}=_0x3cb90d;if(_0x12337d['length']===0x0)return console[_0x7593fc(0x1ef)](_0x7593fc(0x1b2)),console[_0x7593fc(0x1ef)](_0x7593fc(0x1e6)),0x1;const _0x374a2d=_0x12337d[0x0],_0x4a625c=_0x530bae,_0x134580={'name':_0x4a625c[_0x7593fc(0x1cc)],'description':_0x4a625c[_0x7593fc(0x235)]},_0x420152=Object[_0x7593fc(0x1b4)](Object[_0x7593fc(0x1b3)](_0x134580)['filter'](([,_0x5867aa])=>_0x5867aa!==undefined));if(Object['keys'](_0x420152)[_0x7593fc(0x207)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x7593fc(0x1d9)),0x1;const _0x553aec=await withSpinner(_0x7593fc(0x1b8)+_0x374a2d+_0x7593fc(0x1b7),()=>_0x5bc619[_0x7593fc(0x1ba)][_0x7593fc(0x214)](_0x374a2d,_0x420152),{'verbose':_0x530bae['verbose']});return await handleSDKOutput([_0x553aec[_0x7593fc(0x208)]],_0x530bae),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]=a16_0x5718b5(0x1f0);['description']='Delete\x20a\x20workspace';async[a16_0x5718b5(0x1ae)](_0xcd03f6){const _0x33bb3d=a16_0x5718b5,{options:_0x34787f,args:_0x44e99c,tdx:_0x4dcb35}=_0xcd03f6;if(_0x44e99c[_0x33bb3d(0x207)]===0x0)return console[_0x33bb3d(0x1ef)](_0x33bb3d(0x1b2)),console[_0x33bb3d(0x1ef)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x567e3f=_0x44e99c[0x0];if(!_0x34787f[_0x33bb3d(0x1f9)]){const _0x4e5082=await confirm(_0x33bb3d(0x224)+_0x567e3f+_0x33bb3d(0x1cb));if(!_0x4e5082)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x567e3f+_0x33bb3d(0x1b7),()=>_0x4dcb35[_0x33bb3d(0x1ba)][_0x33bb3d(0x22b)](_0x567e3f),{'verbose':_0x34787f[_0x33bb3d(0x1c8)]}),console[_0x33bb3d(0x1f6)](_0x33bb3d(0x1f8)+_0x567e3f+_0x33bb3d(0x1ed)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x5718b5(0x1cc)]='engage:workspace:use';[a16_0x5718b5(0x235)]=a16_0x5718b5(0x1eb);async[a16_0x5718b5(0x1ae)](_0x12357f){const _0x4e03cb=a16_0x5718b5,{options:_0x8a8b5e,args:_0xbfef63,tdx:_0x4dee93}=_0x12357f;if(_0xbfef63[_0x4e03cb(0x207)]===0x0)return console['error']('Error:\x20Workspace\x20name\x20is\x20required'),console['error'](_0x4e03cb(0x1de)),0x1;const _0x57ad51=_0xbfef63[0x0];await withSpinner(_0x4e03cb(0x1c4)+_0x57ad51+'\x27...',()=>_0x4dee93[_0x4e03cb(0x1ba)][_0x4e03cb(0x233)](_0x57ad51));const _0x5ed542=_0x8a8b5e[_0x4e03cb(0x21e)]||undefined;return saveSessionContext({'engage_workspace':_0x57ad51},_0x5ed542),console[_0x4e03cb(0x1f6)](_0x4e03cb(0x20d)+_0x57ad51),console['log']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
1
|
+
const a16_0x2f28f9=a16_0x13ce;(function(_0x42c97d,_0x365295){const _0x45ab8b=a16_0x13ce,_0x2fa6cf=_0x42c97d();while(!![]){try{const _0x43dfb0=parseInt(_0x45ab8b(0x15f))/0x1*(-parseInt(_0x45ab8b(0x149))/0x2)+-parseInt(_0x45ab8b(0x159))/0x3*(parseInt(_0x45ab8b(0x139))/0x4)+parseInt(_0x45ab8b(0x18d))/0x5+-parseInt(_0x45ab8b(0x199))/0x6*(parseInt(_0x45ab8b(0x135))/0x7)+parseInt(_0x45ab8b(0x150))/0x8+parseInt(_0x45ab8b(0x190))/0x9+parseInt(_0x45ab8b(0x1a3))/0xa*(parseInt(_0x45ab8b(0x129))/0xb);if(_0x43dfb0===_0x365295)break;else _0x2fa6cf['push'](_0x2fa6cf['shift']());}catch(_0x4fd177){_0x2fa6cf['push'](_0x2fa6cf['shift']());}}}(a16_0x62df,0xbe196));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x5d1766,_0x4d5b6e,_0x409cab=![]){const _0x2eabc2=a16_0x13ce;if(_0x5d1766[_0x2eabc2(0x163)])return await _0x4d5b6e[_0x2eabc2(0x19c)]['resolveWorkspaceId'](_0x5d1766['workspace']);const _0x288977=loadSessionContext(_0x5d1766[_0x2eabc2(0x13b)]);if(_0x288977?.[_0x2eabc2(0x12d)])return await _0x4d5b6e['engage'][_0x2eabc2(0x143)](_0x288977[_0x2eabc2(0x12d)]);if(_0x409cab)throw new SDKError(ErrorCode[_0x2eabc2(0x169)],'Workspace\x20is\x20required\x20for\x20this\x20operation',undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x34c4aa,_0x3b9bcc){const _0xd7accc=a16_0x13ce;if(!_0x34c4aa[_0xd7accc(0x1ab)])return{};const _0x210d46=_0x34c4aa[_0xd7accc(0x1ab)],_0x1b28d6=await _0x3b9bcc[_0xd7accc(0x1ab)][_0xd7accc(0x170)](_0x210d46);return{'audienceId':_0x1b28d6[_0xd7accc(0x1a8)],'audienceName':_0x1b28d6['parentName'],..._0x1b28d6[_0xd7accc(0x12c)]&&{'segmentId':_0x1b28d6[_0xd7accc(0x12c)],'segmentName':_0x1b28d6[_0xd7accc(0x12e)]}};}function buildConnectorConfig(_0x321375){const _0x4cd756=a16_0x13ce,_0x214666=_0x321375[_0x4cd756(0x147)],_0x4ed0dd=_0x321375[_0x4cd756(0x128)];if(!_0x214666&&!_0x4ed0dd)return undefined;return{..._0x214666&&{'emailSenderId':_0x214666},..._0x4ed0dd&&{'jsonColumns':_0x4ed0dd}};}export class EngageCampaignsCommand extends BaseCommand{['name']=a16_0x2f28f9(0x1ac);[a16_0x2f28f9(0x1b0)]='List\x20campaigns';async[a16_0x2f28f9(0x165)](_0x218823){const _0x110c41=a16_0x2f28f9,{options:_0x422754,args:_0x30b3d3,tdx:_0x59d7a4}=_0x218823,_0x5e4206=_0x30b3d3[0x0],_0x4dc5de=resolveLimit(_0x422754[_0x110c41(0x175)],DEFAULT_LLM_LIMIT),_0x53e27b=_0x422754,_0x1a2be6=_0x53e27b[_0x110c41(0x161)],_0x7d51b7=_0x53e27b[_0x110c41(0x1a0)],_0xf44021=await resolveWorkspaceIdFromOptions(_0x53e27b,_0x59d7a4),_0x2bd987=await withSpinner(_0x110c41(0x16d),()=>_0x59d7a4['engage'][_0x110c41(0x178)]({'type':_0x1a2be6,'status':_0x7d51b7,'workspaceId':_0xf44021,'limit':_0x4dc5de}),{'verbose':_0x422754[_0x110c41(0x152)]});let _0x379f68=_0x2bd987[_0x110c41(0x144)];return _0x5e4206&&(_0x379f68=_0x2bd987[_0x110c41(0x144)][_0x110c41(0x15d)](_0x5bdcdd=>matchGlobPattern(_0x5bdcdd[_0x110c41(0x194)],_0x5e4206))),await handleSDKOutput(_0x379f68,_0x422754),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x164);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x136);async[a16_0x2f28f9(0x165)](_0x44b2c0){const _0x45fbc6=a16_0x2f28f9,{options:_0xb352b0,args:_0x35ac40,tdx:_0x4ac3e0}=_0x44b2c0;if(_0x35ac40[_0x45fbc6(0x188)]===0x0)return console[_0x45fbc6(0x19f)](_0x45fbc6(0x15b)),console[_0x45fbc6(0x19f)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x5490ee=_0x35ac40[0x0],_0x340ee7=_0xb352b0,_0x10aa14=await resolveWorkspaceIdFromOptions(_0x340ee7,_0x4ac3e0),_0x43a57f=_0x340ee7[_0x45fbc6(0x166)];if(_0x43a57f){const _0x41b52d=await withSpinner(_0x45fbc6(0x134)+_0x5490ee+_0x45fbc6(0x195),()=>_0x4ac3e0[_0x45fbc6(0x19c)][_0x45fbc6(0x1af)](_0x5490ee,_0x10aa14),{'verbose':_0xb352b0[_0x45fbc6(0x152)]});await handleSDKOutput([_0x41b52d],_0xb352b0);}else{const _0x3c3344=await withSpinner(_0x45fbc6(0x134)+_0x5490ee+_0x45fbc6(0x195),()=>_0x4ac3e0[_0x45fbc6(0x19c)][_0x45fbc6(0x19b)](_0x5490ee,_0x10aa14),{'verbose':_0xb352b0['verbose']});await handleSDKOutput([_0x3c3344],_0xb352b0);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a16_0x2f28f9(0x194)]='engage:campaign:create';['description']=a16_0x2f28f9(0x1a2);async['execute'](_0x4a8f67){const _0x3d9a2f=a16_0x2f28f9,{options:_0xaa5c60,tdx:_0xe6cb0b}=_0x4a8f67,_0x2fc280=_0xaa5c60,_0x5cd927=_0x2fc280[_0x3d9a2f(0x194)],_0x5519ce=_0x2fc280[_0x3d9a2f(0x161)];if(!_0x5cd927)return console[_0x3d9a2f(0x19f)](_0x3d9a2f(0x187)),console[_0x3d9a2f(0x19f)](_0x3d9a2f(0x16e)),0x1;if(!_0x5519ce)return console['error']('Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)'),console['error'](_0x3d9a2f(0x16e)),0x1;const _0x1ebddf=await resolveWorkspaceIdFromOptions(_0x2fc280,_0xe6cb0b,!![]),_0x22a473=await resolveSegmentFromOptions(_0x2fc280,_0xe6cb0b),_0xce69ad=buildConnectorConfig(_0x2fc280),_0x3efaa0={'name':_0x5cd927,'campaignType':_0x5519ce,'workspaceId':_0x1ebddf,'description':_0x2fc280[_0x3d9a2f(0x1b0)],..._0x22a473,'connectorConfig':_0xce69ad,'startAt':_0x2fc280[_0x3d9a2f(0x191)],'timezone':_0x2fc280[_0x3d9a2f(0x1a6)]},_0x7321be=await withSpinner(_0x3d9a2f(0x19e)+_0x5cd927+_0x3d9a2f(0x195),()=>_0xe6cb0b[_0x3d9a2f(0x19c)]['createCampaign'](_0x3efaa0));return await handleSDKOutput([_0x7321be['data']],_0xaa5c60),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x125);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x17a);async[a16_0x2f28f9(0x165)](_0x259927){const _0x19d98e=a16_0x2f28f9,{options:_0x3ae729,args:_0x2529fc,tdx:_0x540041}=_0x259927;if(_0x2529fc[_0x19d98e(0x188)]===0x0)return console['error'](_0x19d98e(0x15b)),console[_0x19d98e(0x19f)](_0x19d98e(0x15c)),0x1;const _0x40b60a=_0x2529fc[0x0],_0x1b3663=_0x3ae729,_0x4a87ea=await resolveWorkspaceIdFromOptions(_0x1b3663,_0x540041),_0x389445=await resolveSegmentFromOptions(_0x1b3663,_0x540041),_0x1ad1f7=buildConnectorConfig(_0x1b3663),_0x4d42c9={'name':_0x1b3663[_0x19d98e(0x194)],'description':_0x1b3663[_0x19d98e(0x1b0)],..._0x389445,'connectorConfig':_0x1ad1f7,'startAt':_0x1b3663[_0x19d98e(0x191)],'timezone':_0x1b3663[_0x19d98e(0x1a6)]},_0x76ecff=Object[_0x19d98e(0x1ae)](Object['entries'](_0x4d42c9)[_0x19d98e(0x15d)](([,_0x1cff48])=>_0x1cff48!==undefined));if(Object['keys'](_0x76ecff)[_0x19d98e(0x188)]===0x0)return console[_0x19d98e(0x19f)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x19d98e(0x19f)](_0x19d98e(0x146)),0x1;const _0x54915c=await withSpinner(_0x19d98e(0x153)+_0x40b60a+'\x27...',()=>_0x540041[_0x19d98e(0x19c)][_0x19d98e(0x154)](_0x40b60a,_0x76ecff,_0x4a87ea),{'verbose':_0x3ae729['verbose']});return await handleSDKOutput([_0x54915c[_0x19d98e(0x144)]],_0x3ae729),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x18b);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x133);async[a16_0x2f28f9(0x165)](_0x305d03){const _0xbb1b44=a16_0x2f28f9,{options:_0x40740c,args:_0xd092ad,tdx:_0x1761d3}=_0x305d03;if(_0xd092ad['length']===0x0)return console['error'](_0xbb1b44(0x15b)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x2ef152=_0xd092ad[0x0],_0x8f9d55=_0x40740c,_0x32a4eb=await resolveWorkspaceIdFromOptions(_0x8f9d55,_0x1761d3);if(!_0x40740c['yes']){const _0x767180=await confirm(_0xbb1b44(0x17e)+_0x2ef152+_0xbb1b44(0x141));if(!_0x767180)return console['log'](_0xbb1b44(0x13a)),0x0;}return await withSpinner(_0xbb1b44(0x183)+_0x2ef152+'\x27...',()=>_0x1761d3['engage'][_0xbb1b44(0x130)](_0x2ef152,_0x32a4eb),{'verbose':_0x40740c[_0xbb1b44(0x152)]}),console[_0xbb1b44(0x19d)](_0xbb1b44(0x173)+_0x2ef152+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']=a16_0x2f28f9(0x15e);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x13e);async[a16_0x2f28f9(0x165)](_0x1e5b2c){const _0x36cd83=a16_0x2f28f9,{options:_0x278601,args:_0x2cb973,tdx:_0x29ed88}=_0x1e5b2c;if(_0x2cb973['length']===0x0)return console[_0x36cd83(0x19f)](_0x36cd83(0x15b)),console[_0x36cd83(0x19f)](_0x36cd83(0x197)),0x1;const _0x113418=_0x2cb973[0x0],_0x17df0a=_0x278601,_0xe5bb82=await resolveWorkspaceIdFromOptions(_0x17df0a,_0x29ed88);return await withSpinner('Launching\x20campaign\x20\x27'+_0x113418+_0x36cd83(0x195),()=>_0x29ed88[_0x36cd83(0x19c)]['launchCampaign'](_0x113418,_0xe5bb82),{'verbose':_0x278601[_0x36cd83(0x152)]}),console[_0x36cd83(0x19d)](_0x36cd83(0x173)+_0x113418+_0x36cd83(0x122)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x1ad);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x189);async['execute'](_0x2ff1f9){const _0x285a9e=a16_0x2f28f9,{options:_0x4878b4,args:_0x133e8f,tdx:_0x5af4dc}=_0x2ff1f9;if(_0x133e8f['length']===0x0)return console['error'](_0x285a9e(0x15b)),console[_0x285a9e(0x19f)](_0x285a9e(0x123)),0x1;const _0x179edb=_0x133e8f[0x0],_0x2813ac=_0x4878b4,_0x208d15=await resolveWorkspaceIdFromOptions(_0x2813ac,_0x5af4dc);return await withSpinner(_0x285a9e(0x16c)+_0x179edb+'\x27...',()=>_0x5af4dc[_0x285a9e(0x19c)][_0x285a9e(0x132)](_0x179edb,_0x208d15),{'verbose':_0x4878b4[_0x285a9e(0x152)]}),console[_0x285a9e(0x19d)](_0x285a9e(0x173)+_0x179edb+_0x285a9e(0x184)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x2f28f9(0x194)]='engage:campaign:resume';[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x160);async[a16_0x2f28f9(0x165)](_0x1960d6){const _0x2d7cea=a16_0x2f28f9,{options:_0x416140,args:_0x49e340,tdx:_0x345ff7}=_0x1960d6;if(_0x49e340[_0x2d7cea(0x188)]===0x0)return console[_0x2d7cea(0x19f)](_0x2d7cea(0x15b)),console[_0x2d7cea(0x19f)](_0x2d7cea(0x12f)),0x1;const _0x1df8fb=_0x49e340[0x0],_0x115308=_0x416140,_0x15533f=await resolveWorkspaceIdFromOptions(_0x115308,_0x345ff7);return await withSpinner(_0x2d7cea(0x18a)+_0x1df8fb+_0x2d7cea(0x195),()=>_0x345ff7['engage'][_0x2d7cea(0x177)](_0x1df8fb,_0x15533f),{'verbose':_0x416140[_0x2d7cea(0x152)]}),console[_0x2d7cea(0x19d)](_0x2d7cea(0x173)+_0x1df8fb+_0x2d7cea(0x151)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a16_0x2f28f9(0x162);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x181);async[a16_0x2f28f9(0x165)](_0x5c2d9b){const _0x356d6e=a16_0x2f28f9,{options:_0x519b24,args:_0x3ce133,tdx:_0x495e0a}=_0x5c2d9b;if(_0x3ce133[_0x356d6e(0x188)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x356d6e(0x19f)](_0x356d6e(0x1aa)),0x1;const _0x8d5636=_0x3ce133[0x0],_0x67eed5=_0x519b24,_0x421a7c=await resolveWorkspaceIdFromOptions(_0x67eed5,_0x495e0a),_0x3e8467=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x8d5636+'\x27...',()=>_0x495e0a[_0x356d6e(0x19c)][_0x356d6e(0x126)](_0x8d5636,_0x421a7c),{'verbose':_0x519b24[_0x356d6e(0x152)]});return await handleSDKOutput([_0x3e8467[_0x356d6e(0x144)]],_0x519b24),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x18e);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x157);async['execute'](_0x543db0){const _0x471d92=a16_0x2f28f9,{options:_0x21d464,args:_0x2abed0,tdx:_0x29c730}=_0x543db0,_0x4697a7=_0x2abed0[0x0],_0x4b236e=resolveLimit(_0x21d464[_0x471d92(0x175)],DEFAULT_LLM_LIMIT),_0x2c2439=_0x21d464,_0xde4880=await resolveWorkspaceIdFromOptions(_0x2c2439,_0x29c730),_0x31a943=await withSpinner(_0x471d92(0x140),()=>_0x29c730[_0x471d92(0x19c)][_0x471d92(0x142)]({'workspaceId':_0xde4880,'limit':_0x4b236e}),{'verbose':_0x21d464[_0x471d92(0x152)]});let _0x2fee2c=_0x31a943[_0x471d92(0x144)];return _0x4697a7&&(_0x2fee2c=_0x31a943['data'][_0x471d92(0x15d)](_0x3e9a9e=>matchGlobPattern(_0x3e9a9e[_0x471d92(0x194)],_0x4697a7))),await handleSDKOutput(_0x2fee2c,_0x21d464),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x16a);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x198);async[a16_0x2f28f9(0x165)](_0x314aff){const _0x5895d9=a16_0x2f28f9,{options:_0x2800e8,args:_0x28ac25,tdx:_0x26ff53}=_0x314aff;if(_0x28ac25[_0x5895d9(0x188)]===0x0)return console['error'](_0x5895d9(0x1a5)),console['error']('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x485c0e=_0x28ac25[0x0],_0x5cdf0c=_0x2800e8,_0x4db153=await resolveWorkspaceIdFromOptions(_0x5cdf0c,_0x26ff53),_0x2e0dc6=_0x5cdf0c[_0x5895d9(0x166)];if(_0x2e0dc6){const _0x7e8400=await withSpinner(_0x5895d9(0x14e)+_0x485c0e+_0x5895d9(0x195),()=>_0x26ff53[_0x5895d9(0x19c)]['getTemplateFull'](_0x485c0e,_0x4db153),{'verbose':_0x2800e8[_0x5895d9(0x152)]});await handleSDKOutput([_0x7e8400],_0x2800e8);}else{const _0xafb966=await withSpinner(_0x5895d9(0x14e)+_0x485c0e+'\x27...',()=>_0x26ff53[_0x5895d9(0x19c)]['getTemplate'](_0x485c0e,_0x4db153),{'verbose':_0x2800e8[_0x5895d9(0x152)]});await handleSDKOutput([_0xafb966],_0x2800e8);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x1a9);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x131);async[a16_0x2f28f9(0x165)](_0x47d90e){const _0x1bc8e5=a16_0x2f28f9,{options:_0x54ae23,tdx:_0x149e20}=_0x47d90e,_0x36e154=_0x54ae23,_0x5576c6=_0x36e154[_0x1bc8e5(0x194)],_0x581276=_0x36e154[_0x1bc8e5(0x168)],_0x58d4e2=_0x36e154[_0x1bc8e5(0x182)];if(!_0x5576c6)return console['error'](_0x1bc8e5(0x187)),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x581276)return console[_0x1bc8e5(0x19f)](_0x1bc8e5(0x15a)),0x1;if(!_0x58d4e2)return console['error'](_0x1bc8e5(0x158)),0x1;const _0xc043b3=await resolveWorkspaceIdFromOptions(_0x36e154,_0x149e20,!![]),_0x3fa8cd={'name':_0x5576c6,'subjectTemplate':_0x581276,'htmlTemplate':_0x58d4e2,'workspaceId':_0xc043b3,'plaintextTemplate':_0x36e154[_0x1bc8e5(0x17d)],'editorType':_0x36e154[_0x1bc8e5(0x17b)]},_0x3f0d2f=await withSpinner(_0x1bc8e5(0x180)+_0x5576c6+_0x1bc8e5(0x195),()=>_0x149e20[_0x1bc8e5(0x19c)][_0x1bc8e5(0x186)](_0x3fa8cd));return await handleSDKOutput([_0x3f0d2f[_0x1bc8e5(0x144)]],_0x54ae23),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x2f28f9(0x14c);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x172);async[a16_0x2f28f9(0x165)](_0x35bd38){const _0x28aba0=a16_0x2f28f9,{options:_0x336536,args:_0x302fc9,tdx:_0x80faf0}=_0x35bd38;if(_0x302fc9[_0x28aba0(0x188)]===0x0)return console[_0x28aba0(0x19f)](_0x28aba0(0x1a5)),console['error'](_0x28aba0(0x156)),0x1;const _0x345c49=_0x302fc9[0x0],_0x10ce3d=_0x336536,_0x2fa12b=await resolveWorkspaceIdFromOptions(_0x10ce3d,_0x80faf0),_0x1c3429={'name':_0x10ce3d['name'],'subjectTemplate':_0x10ce3d[_0x28aba0(0x168)],'htmlTemplate':_0x10ce3d[_0x28aba0(0x182)],'plaintextTemplate':_0x10ce3d[_0x28aba0(0x17d)]},_0x191754=Object[_0x28aba0(0x1ae)](Object[_0x28aba0(0x145)](_0x1c3429)[_0x28aba0(0x15d)](([,_0xb6519b])=>_0xb6519b!==undefined));if(Object[_0x28aba0(0x138)](_0x191754)[_0x28aba0(0x188)]===0x0)return console[_0x28aba0(0x19f)](_0x28aba0(0x1a7)),console[_0x28aba0(0x19f)](_0x28aba0(0x171)),0x1;const _0x2d2ac1=await withSpinner(_0x28aba0(0x148)+_0x345c49+_0x28aba0(0x195),()=>_0x80faf0[_0x28aba0(0x19c)][_0x28aba0(0x13f)](_0x345c49,_0x191754,_0x2fa12b),{'verbose':_0x336536[_0x28aba0(0x152)]});return await handleSDKOutput([_0x2d2ac1[_0x28aba0(0x144)]],_0x336536),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x13d);['description']=a16_0x2f28f9(0x192);async[a16_0x2f28f9(0x165)](_0x3abcb4){const _0x5233a9=a16_0x2f28f9,{options:_0xce00fd,args:_0x1c1e70,tdx:_0x4218d9}=_0x3abcb4;if(_0x1c1e70[_0x5233a9(0x188)]===0x0)return console['error'](_0x5233a9(0x1a5)),console[_0x5233a9(0x19f)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0xd49ca9=_0x1c1e70[0x0],_0x563f6a=_0xce00fd,_0x3bb734=await resolveWorkspaceIdFromOptions(_0x563f6a,_0x4218d9);if(!_0xce00fd['yes']){const _0x52f07c=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0xd49ca9+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x52f07c)return console[_0x5233a9(0x19d)](_0x5233a9(0x13a)),0x0;}return await withSpinner(_0x5233a9(0x155)+_0xd49ca9+_0x5233a9(0x195),()=>_0x4218d9[_0x5233a9(0x19c)][_0x5233a9(0x127)](_0xd49ca9,_0x3bb734),{'verbose':_0xce00fd['verbose']}),console[_0x5233a9(0x19d)]('Template\x20\x27'+_0xd49ca9+_0x5233a9(0x174)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x19a);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x179);async[a16_0x2f28f9(0x165)](_0x589056){const _0x52296e=a16_0x2f28f9,{options:_0x39794d,args:_0x5982d2,tdx:_0x459475}=_0x589056,_0x295f84=_0x5982d2[0x0],_0xf50483=resolveLimit(_0x39794d[_0x52296e(0x175)],DEFAULT_LLM_LIMIT),_0xd1615a=await withSpinner('Fetching\x20workspaces...',()=>_0x459475[_0x52296e(0x19c)][_0x52296e(0x185)]({'limit':_0xf50483}),{'verbose':_0x39794d['verbose']});let _0x2cb96c=_0xd1615a[_0x52296e(0x144)];return _0x295f84&&(_0x2cb96c=_0xd1615a['data']['filter'](_0x331034=>matchGlobPattern(_0x331034[_0x52296e(0x194)],_0x295f84))),await handleSDKOutput(_0x2cb96c,_0x39794d),0x0;}}function a16_0x13ce(_0x2caba7,_0x18b584){_0x2caba7=_0x2caba7-0x122;const _0x62df33=a16_0x62df();let _0x13ce59=_0x62df33[_0x2caba7];return _0x13ce59;}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x14f);[a16_0x2f28f9(0x1b0)]=a16_0x2f28f9(0x124);async['execute'](_0x3352e7){const _0x593e2f=a16_0x2f28f9,{options:_0x2fb51f,args:_0x5c47ca,tdx:_0x34c21e}=_0x3352e7;if(_0x5c47ca[_0x593e2f(0x188)]===0x0)return console[_0x593e2f(0x19f)](_0x593e2f(0x167)),console[_0x593e2f(0x19f)](_0x593e2f(0x1a4)),0x1;const _0x4ae1fb=_0x5c47ca[0x0],_0x82ffcb=_0x2fb51f,_0x543a65=_0x82ffcb[_0x593e2f(0x166)];if(_0x543a65){const _0x262050=await withSpinner(_0x593e2f(0x17f)+_0x4ae1fb+_0x593e2f(0x195),()=>_0x34c21e[_0x593e2f(0x19c)][_0x593e2f(0x18c)](_0x4ae1fb),{'verbose':_0x2fb51f[_0x593e2f(0x152)]});await handleSDKOutput([_0x262050],_0x2fb51f);}else{const _0x40d272=await withSpinner(_0x593e2f(0x17f)+_0x4ae1fb+_0x593e2f(0x195),()=>_0x34c21e[_0x593e2f(0x19c)][_0x593e2f(0x14a)](_0x4ae1fb),{'verbose':_0x2fb51f[_0x593e2f(0x152)]});await handleSDKOutput([_0x40d272],_0x2fb51f);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a16_0x2f28f9(0x1a1);[a16_0x2f28f9(0x1b0)]='Create\x20a\x20workspace';async[a16_0x2f28f9(0x165)](_0x58b696){const _0x3a71cf=a16_0x2f28f9,{options:_0x49a96b,tdx:_0x23af53}=_0x58b696,_0x5bac4a=_0x49a96b,_0x4fd95f=_0x5bac4a['name'];if(!_0x4fd95f)return console['error'](_0x3a71cf(0x187)),console[_0x3a71cf(0x19f)](_0x3a71cf(0x16b)),0x1;const _0x381820={'name':_0x4fd95f,'description':_0x5bac4a[_0x3a71cf(0x1b0)]},_0x5c1b28=await withSpinner(_0x3a71cf(0x14b)+_0x4fd95f+_0x3a71cf(0x195),()=>_0x23af53[_0x3a71cf(0x19c)][_0x3a71cf(0x196)](_0x381820));return await handleSDKOutput([_0x5c1b28[_0x3a71cf(0x144)]],_0x49a96b),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x2f28f9(0x194)]='engage:workspace:update';[a16_0x2f28f9(0x1b0)]='Update\x20a\x20workspace';async[a16_0x2f28f9(0x165)](_0x2dff72){const _0x5f1068=a16_0x2f28f9,{options:_0x1eb088,args:_0x4856c6,tdx:_0xf682f5}=_0x2dff72;if(_0x4856c6[_0x5f1068(0x188)]===0x0)return console[_0x5f1068(0x19f)](_0x5f1068(0x167)),console[_0x5f1068(0x19f)](_0x5f1068(0x193)),0x1;const _0x6ec0de=_0x4856c6[0x0],_0x96bbb0=_0x1eb088,_0x59ff19={'name':_0x96bbb0['name'],'description':_0x96bbb0['description']},_0x3940fa=Object[_0x5f1068(0x1ae)](Object[_0x5f1068(0x145)](_0x59ff19)['filter'](([,_0x104874])=>_0x104874!==undefined));if(Object[_0x5f1068(0x138)](_0x3940fa)[_0x5f1068(0x188)]===0x0)return console['error'](_0x5f1068(0x1a7)),console[_0x5f1068(0x19f)]('Options:\x20--name,\x20--description'),0x1;const _0x3a035c=await withSpinner('Updating\x20workspace\x20\x27'+_0x6ec0de+_0x5f1068(0x195),()=>_0xf682f5[_0x5f1068(0x19c)]['updateWorkspace'](_0x6ec0de,_0x3940fa),{'verbose':_0x1eb088['verbose']});return await handleSDKOutput([_0x3a035c[_0x5f1068(0x144)]],_0x1eb088),0x0;}}function a16_0x62df(){const _0x4d8527=['7EnEKgz','Show\x20campaign\x20details','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','keys','8MVxSNE','Operation\x20cancelled','session','engage:workspace:delete','engage:template:delete','Launch\x20a\x20campaign','updateTemplate','Fetching\x20templates...','\x27?\x20This\x20cannot\x20be\x20undone.','listTemplates','resolveWorkspaceId','data','entries','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','emailSenderId','Updating\x20template\x20\x27','4vwLgAh','getWorkspace','Creating\x20workspace\x20\x27','engage:template:update','engage:workspace:use','Fetching\x20template\x20\x27','engage:workspace:show','7453384aSnxHF','\x27\x20resumed\x20successfully','verbose','Updating\x20campaign\x20\x27','updateCampaign','Deleting\x20template\x20\x27','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','List\x20email\x20templates','Error:\x20--html\x20is\x20required','347745RYyhoj','Error:\x20--subject\x20is\x20required','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','filter','engage:campaign:launch','74073kuVmmv','Resume\x20a\x20paused\x20campaign','type','engage:campaign:duplicate','workspace','engage:campaign:show','execute','full','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','subject','MISSING_ARGUMENT','engage:template:show','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','Pausing\x20campaign\x20\x27','Fetching\x20campaigns...','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','resolvePathToResource','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Update\x20an\x20email\x20template','Campaign\x20\x27','\x27\x20deleted\x20successfully','limit','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','resumeCampaign','listCampaigns','List\x20workspaces','Update\x20a\x20campaign','editorType','Error:\x20Workspace\x20name\x20is\x20required','plaintext','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Fetching\x20workspace\x20\x27','Creating\x20template\x20\x27','Duplicate\x20a\x20campaign','html','Deleting\x20campaign\x20\x27','\x27\x20paused\x20successfully','listWorkspaces','createTemplate','Error:\x20--name\x20is\x20required','length','Pause\x20a\x20campaign','Resuming\x20campaign\x20\x27','engage:campaign:delete','getWorkspaceFull','7759450jIijNf','engage:templates','Engage\x20workspace\x20set\x20to:\x20','590292FUVEcI','startAt','Delete\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','name','\x27...','createWorkspace','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Show\x20email\x20template\x20details','9243090LRCVtz','engage:workspaces','getCampaign','engage','log','Creating\x20campaign\x20\x27','error','status','engage:workspace:create','Create\x20a\x20new\x20campaign','78940oFAPAv','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','timezone','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','parentId','engage:template:create','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','segment','engage:campaigns','engage:campaign:pause','fromEntries','getCampaignFull','description','\x27\x20launched\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Show\x20workspace\x20details','engage:campaign:update','duplicateCampaign','deleteTemplate','jsonColumns','209VIIZBM','Workspace\x20\x27','deleteWorkspace','segmentId','engage_workspace','segmentName','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','deleteCampaign','Create\x20an\x20email\x20template','pauseCampaign','Delete\x20a\x20campaign','Fetching\x20campaign\x20\x27'];a16_0x62df=function(){return _0x4d8527;};return a16_0x62df();}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a16_0x2f28f9(0x13c);[a16_0x2f28f9(0x1b0)]='Delete\x20a\x20workspace';async['execute'](_0x479b4a){const _0x2fb8cf=a16_0x2f28f9,{options:_0x19a330,args:_0x4fd2ff,tdx:_0x45a95d}=_0x479b4a;if(_0x4fd2ff[_0x2fb8cf(0x188)]===0x0)return console[_0x2fb8cf(0x19f)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x2fb8cf(0x19f)](_0x2fb8cf(0x176)),0x1;const _0x39101b=_0x4fd2ff[0x0];if(!_0x19a330['yes']){const _0x20fbd7=await confirm(_0x2fb8cf(0x137)+_0x39101b+_0x2fb8cf(0x141));if(!_0x20fbd7)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x39101b+_0x2fb8cf(0x195),()=>_0x45a95d['engage'][_0x2fb8cf(0x12b)](_0x39101b),{'verbose':_0x19a330[_0x2fb8cf(0x152)]}),console[_0x2fb8cf(0x19d)](_0x2fb8cf(0x12a)+_0x39101b+_0x2fb8cf(0x174)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a16_0x2f28f9(0x194)]=a16_0x2f28f9(0x14d);[a16_0x2f28f9(0x1b0)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async['execute'](_0x9147c1){const _0x212b4f=a16_0x2f28f9,{options:_0x1fafe9,args:_0x134789,tdx:_0x77a251}=_0x9147c1;if(_0x134789['length']===0x0)return console[_0x212b4f(0x19f)](_0x212b4f(0x17c)),console[_0x212b4f(0x19f)](_0x212b4f(0x16f)),0x1;const _0xc6ced9=_0x134789[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0xc6ced9+_0x212b4f(0x195),()=>_0x77a251['engage'][_0x212b4f(0x143)](_0xc6ced9));const _0x571dc2=_0x1fafe9['session']||undefined;return saveSessionContext({'engage_workspace':_0xc6ced9},_0x571dc2),console['log'](_0x212b4f(0x18f)+_0xc6ced9),console[_0x212b4f(0x19d)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a17_0x3d544b=a17_0x104a;(function(_0x2396da,_0x41cd61){const _0x1ec6b2=a17_0x104a,_0x571240=_0x2396da();while(!![]){try{const _0x2e2c4b=parseInt(_0x1ec6b2(0x12c))/0x1*(parseInt(_0x1ec6b2(0x12e))/0x2)+parseInt(_0x1ec6b2(0x152))/0x3+parseInt(_0x1ec6b2(0x144))/0x4*(parseInt(_0x1ec6b2(0x13b))/0x5)+parseInt(_0x1ec6b2(0x146))/0x6+-parseInt(_0x1ec6b2(0x13d))/0x7+-parseInt(_0x1ec6b2(0x11f))/0x8*(-parseInt(_0x1ec6b2(0x134))/0x9)+-parseInt(_0x1ec6b2(0x149))/0xa;if(_0x2e2c4b===_0x41cd61)break;else _0x571240['push'](_0x571240['shift']());}catch(_0x46b878){_0x571240['push'](_0x571240['shift']());}}}(a17_0x1984,0x97683));import{BaseCommand}from'./command.js';function a17_0x1984(){const _0x387d1a=['error','name','cause','data','map','execute','19sHHbBm','kill','80366MRkeeq','List\x20jobs','\x27\x20to\x20verify\x20the\x20job\x20status','information_schema','url','message','9AQejci','submit','\x20\x20Job\x20ID:\x20','Limit:\x20','priority','file','show','113840HEEfxi','...','7105861KaTmPi','limit','hive','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','β\x20Job\x20submitted','Usage:\x20job\x20kill\x20<job-id>','trino','64BqiAxZ','\x20\x20Cause:\x20','4153806PDDAEX','Error:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','7876710ZXxkfP','getTime','database','job_id','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Status\x20filter:\x20','Submit\x20a\x20job','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','jobType','838014wiVlvD','result','Submitting\x20job...','start_at','query','verbose','Listing\x20jobs...','\x20job','jobs','Usage:\x20job\x20show\x20<job-id>','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','end_at','Submitting\x20kill\x20request...','\x20jobs','type','created_at','length','round','Query:\x20','Show\x20job\x20details','Error:\x20Job\x20ID\x20is\x20required','user_name','description','debug','Cancelled','2588424Fxwpkv','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','job:show','substring','status','job:kill','Usage:\x20job\x20result\x20<job-id>'];a17_0x1984=function(){return _0x387d1a;};return a17_0x1984();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a17_0x104a(_0x55c029,_0x2dd456){_0x55c029=_0x55c029-0x112;const _0x1984b0=a17_0x1984();let _0x104afd=_0x1984b0[_0x55c029];return _0x104afd;}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{['name']=a17_0x3d544b(0x15a);[a17_0x3d544b(0x11c)]=a17_0x3d544b(0x12f);async[a17_0x3d544b(0x12b)](_0x50e68f){const _0x128c6d=a17_0x3d544b,{options:_0x30c4d7,tdx:_0x49808d}=_0x50e68f;try{const _0x926787=resolveLimit(_0x30c4d7[_0x128c6d(0x13e)],DEFAULT_DISPLAY_LIMIT),_0x3991c8=_0x30c4d7[_0x128c6d(0x123)];_0x30c4d7[_0x128c6d(0x157)]&&(console[_0x128c6d(0x126)](_0x128c6d(0x137)+_0x926787+_0x128c6d(0x113)),_0x3991c8&&console['error'](_0x128c6d(0x14e)+_0x3991c8));const _0x5b4a79=await withSpinner(_0x128c6d(0x158),()=>_0x49808d[_0x128c6d(0x15a)]['list']({'from':0x0,'to':_0x926787-0x1,'status':_0x3991c8}),{'verbose':_0x30c4d7[_0x128c6d(0x157)]}),_0x2cac58=_0x5b4a79[_0x128c6d(0x129)];console[_0x128c6d(0x126)]('β\x20Found\x20'+_0x2cac58['length']+_0x128c6d(0x159)+(_0x2cac58[_0x128c6d(0x116)]!==0x1?'s':''));const _0x6627c3=_0x2cac58[_0x128c6d(0x12a)](_0x22bc3a=>{const _0x3c027e=_0x128c6d;let _0x39ce01;if(_0x22bc3a[_0x3c027e(0x155)]&&_0x22bc3a['end_at']){const _0x2ee4e6=new Date(_0x22bc3a[_0x3c027e(0x155)])[_0x3c027e(0x14a)](),_0x33520f=new Date(_0x22bc3a[_0x3c027e(0x15d)])[_0x3c027e(0x14a)]();_0x39ce01=Math[_0x3c027e(0x117)]((_0x33520f-_0x2ee4e6)/0x3e8);}return{'job_id':_0x22bc3a[_0x3c027e(0x14c)],'type':_0x22bc3a['type'],'status':_0x22bc3a[_0x3c027e(0x123)],'user_name':_0x22bc3a['user_name'],'duration_sec':_0x39ce01,'created_at':_0x22bc3a[_0x3c027e(0x115)],'started_at':_0x22bc3a[_0x3c027e(0x155)],'end_at':_0x22bc3a[_0x3c027e(0x15d)]};});return await handleSDKOutput(_0x6627c3,_0x30c4d7),0x0;}catch(_0x19df60){if(_0x19df60 instanceof SDKError)return console[_0x128c6d(0x126)]('Error:\x20'+_0x19df60[_0x128c6d(0x133)]),_0x19df60[_0x128c6d(0x128)]&&console['error']('\x20\x20Cause:\x20'+_0x19df60[_0x128c6d(0x128)]),0x1;throw _0x19df60;}}}export class JobShowCommand extends BaseCommand{[a17_0x3d544b(0x127)]=a17_0x3d544b(0x121);['description']=a17_0x3d544b(0x119);async[a17_0x3d544b(0x12b)](_0x5ee0d5){const _0x3c3ffb=a17_0x3d544b,{options:_0x309c17,args:_0x1d4688,tdx:_0x455536}=_0x5ee0d5,_0x829507=_0x1d4688[0x0];if(!_0x829507)return console[_0x3c3ffb(0x126)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x3c3ffb(0x126)](_0x3c3ffb(0x15b)),0x1;try{const _0x4195c5=await withSpinner('Getting\x20job\x20details...',()=>_0x455536[_0x3c3ffb(0x15a)][_0x3c3ffb(0x13a)](_0x829507),{'verbose':_0x309c17[_0x3c3ffb(0x157)]}),_0x5401cf=_0x4195c5[_0x3c3ffb(0x129)];let _0x30804e;if(_0x5401cf[_0x3c3ffb(0x155)]&&_0x5401cf[_0x3c3ffb(0x15d)]){const _0x5c9266=new Date(_0x5401cf[_0x3c3ffb(0x155)])[_0x3c3ffb(0x14a)](),_0x7e408=new Date(_0x5401cf[_0x3c3ffb(0x15d)])['getTime']();_0x30804e=Math[_0x3c3ffb(0x117)]((_0x7e408-_0x5c9266)/0x3e8);}const _0x46be1c={'job_id':_0x5401cf[_0x3c3ffb(0x14c)],'type':_0x5401cf[_0x3c3ffb(0x114)],'status':_0x5401cf[_0x3c3ffb(0x123)],..._0x5401cf[_0x3c3ffb(0x11b)]&&{'user_name':_0x5401cf[_0x3c3ffb(0x11b)]},..._0x30804e!==undefined&&{'duration_sec':_0x30804e},..._0x5401cf[_0x3c3ffb(0x115)]&&{'created_at':_0x5401cf['created_at']},..._0x5401cf['start_at']&&{'started_at':_0x5401cf['start_at']},..._0x5401cf[_0x3c3ffb(0x15d)]&&{'end_at':_0x5401cf[_0x3c3ffb(0x15d)]},..._0x5401cf[_0x3c3ffb(0x14b)]&&{'database':_0x5401cf['database']},..._0x5401cf[_0x3c3ffb(0x138)]!==undefined&&{'priority':_0x5401cf[_0x3c3ffb(0x138)]},..._0x5401cf[_0x3c3ffb(0x132)]&&{'url':_0x5401cf[_0x3c3ffb(0x132)]},..._0x5401cf['query']&&{'query':_0x5401cf[_0x3c3ffb(0x156)]},..._0x5401cf[_0x3c3ffb(0x11d)]&&{'debug':_0x5401cf[_0x3c3ffb(0x11d)]}};return await handleSingleObjectOutput(_0x46be1c,_0x309c17),0x0;}catch(_0x4ff566){if(_0x4ff566 instanceof SDKError)return console[_0x3c3ffb(0x126)](_0x3c3ffb(0x147)+_0x4ff566[_0x3c3ffb(0x133)]),_0x4ff566[_0x3c3ffb(0x128)]&&console[_0x3c3ffb(0x126)](_0x3c3ffb(0x145)+_0x4ff566[_0x3c3ffb(0x128)]),0x1;throw _0x4ff566;}}}export class JobKillCommand extends BaseCommand{['name']=a17_0x3d544b(0x124);['description']='Kill\x20a\x20job';async[a17_0x3d544b(0x12b)](_0x4887f2){const _0x16cd02=a17_0x3d544b,{options:_0x4a3a11,args:_0x2fcc1f,tdx:_0x3c157a}=_0x4887f2,_0x2e9746=_0x2fcc1f[0x0];if(!_0x2e9746)return console[_0x16cd02(0x126)](_0x16cd02(0x11a)),console['error'](_0x16cd02(0x142)),0x1;try{if(!_0x4a3a11['yes']){const _0x24fc09=await confirm(_0x16cd02(0x148)+_0x2e9746+'?');if(!_0x24fc09)return console[_0x16cd02(0x126)](_0x16cd02(0x11e)),0x0;}return await withSpinner(_0x16cd02(0x112),()=>_0x3c157a[_0x16cd02(0x15a)][_0x16cd02(0x12d)](_0x2e9746),{'verbose':_0x4a3a11[_0x16cd02(0x157)]}),console[_0x16cd02(0x126)](_0x16cd02(0x150)+_0x2e9746),console[_0x16cd02(0x126)](_0x16cd02(0x15c)+_0x2e9746+_0x16cd02(0x130)),0x0;}catch(_0x310ddd){if(_0x310ddd instanceof SDKError)return console[_0x16cd02(0x126)]('Error:\x20'+_0x310ddd[_0x16cd02(0x133)]),_0x310ddd[_0x16cd02(0x128)]&&console[_0x16cd02(0x126)](_0x16cd02(0x145)+_0x310ddd['cause']),0x1;throw _0x310ddd;}}}export class JobSubmitCommand extends BaseCommand{[a17_0x3d544b(0x127)]='job:submit';[a17_0x3d544b(0x11c)]=a17_0x3d544b(0x14f);async['execute'](_0x23df54){const _0x350b33=a17_0x3d544b,{options:_0x1f35f6,args:_0x12b0c6,tdx:_0x18b2d4}=_0x23df54;try{const _0x5b11d2=_0x1f35f6[_0x350b33(0x151)]||_0x350b33(0x143),_0x333e35=_0x1f35f6[_0x350b33(0x139)],_0x2db7d6=_0x1f35f6[_0x350b33(0x14b)]||_0x350b33(0x131);if(_0x5b11d2!==_0x350b33(0x143)&&_0x5b11d2!==_0x350b33(0x13f))return console[_0x350b33(0x126)](_0x350b33(0x120)),0x1;let _0x249270;if(_0x333e35){if(_0x12b0c6[0x0])return console['error'](_0x350b33(0x140)),0x1;const _0x26e299=readSqlStatementsFromFile(_0x333e35);if(_0x26e299[_0x350b33(0x116)]===0x0)return console[_0x350b33(0x126)]('Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file'),0x1;if(_0x26e299[_0x350b33(0x116)]>0x1)return console[_0x350b33(0x126)]('Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'),0x1;_0x249270=_0x26e299[0x0];}else{if(!_0x12b0c6[0x0])return console[_0x350b33(0x126)]('Error:\x20Query\x20is\x20required'),console[_0x350b33(0x126)](_0x350b33(0x14d)),0x1;_0x249270=_0x12b0c6[0x0];}_0x1f35f6[_0x350b33(0x157)]&&(console[_0x350b33(0x126)]('Job\x20type:\x20'+_0x5b11d2),console[_0x350b33(0x126)]('Database:\x20'+_0x2db7d6),console[_0x350b33(0x126)](_0x350b33(0x118)+_0x249270[_0x350b33(0x122)](0x0,0x64)+(_0x249270['length']>0x64?_0x350b33(0x13c):'')));const _0x5bf2e4=await withSpinner(_0x350b33(0x154),()=>_0x18b2d4[_0x350b33(0x15a)][_0x350b33(0x135)](_0x2db7d6,_0x249270,_0x5b11d2),{'verbose':_0x1f35f6[_0x350b33(0x157)]}),_0x52c64e=_0x5bf2e4[_0x350b33(0x129)];return console[_0x350b33(0x126)](_0x350b33(0x141)),console['error'](_0x350b33(0x136)+_0x52c64e[_0x350b33(0x14c)]),await handleSDKOutput([_0x52c64e],_0x1f35f6),0x0;}catch(_0x153fc4){if(_0x153fc4 instanceof SDKError)return console[_0x350b33(0x126)](_0x350b33(0x147)+_0x153fc4[_0x350b33(0x133)]),_0x153fc4['cause']&&console[_0x350b33(0x126)]('\x20\x20Cause:\x20'+_0x153fc4[_0x350b33(0x128)]),0x1;throw _0x153fc4;}}}export class JobResultCommand extends BaseCommand{[a17_0x3d544b(0x127)]='job:result';['description']='Get\x20job\x20results';async[a17_0x3d544b(0x12b)](_0x2df51d){const _0x15dba3=a17_0x3d544b,{options:_0x5f4a15,args:_0x163b8d,tdx:_0x108c25}=_0x2df51d,_0x15a770=_0x163b8d[0x0];if(!_0x15a770)return console[_0x15dba3(0x126)]('Error:\x20Job\x20ID\x20is\x20required'),console['error'](_0x15dba3(0x125)),0x1;try{const _0x1a57be=await withSpinner('Getting\x20job\x20results...',()=>_0x108c25[_0x15dba3(0x15a)][_0x15dba3(0x153)](_0x15a770),{'verbose':_0x5f4a15['verbose']}),_0x46cdfa=_0x1a57be[_0x15dba3(0x129)];return console[_0x15dba3(0x126)]('β\x20Retrieved\x20'+_0x46cdfa[_0x15dba3(0x116)]+'\x20row'+(_0x46cdfa[_0x15dba3(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x46cdfa,_0x5f4a15),0x0;}catch(_0x3127f7){if(_0x3127f7 instanceof SDKError)return console[_0x15dba3(0x126)]('Error:\x20'+_0x3127f7[_0x15dba3(0x133)]),_0x3127f7[_0x15dba3(0x128)]&&console[_0x15dba3(0x126)]('\x20\x20Cause:\x20'+_0x3127f7[_0x15dba3(0x128)]),0x1;throw _0x3127f7;}}}
|
|
1
|
+
function a17_0x5b8e(){const _0xa6ff22=['job_id','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','verbose','kill','\x20job','data','Error:\x20Query\x20is\x20required','Submit\x20a\x20job','job:show','name','debug','32873220RSxUKw','Getting\x20job\x20results...','map','getTime','β\x20Found\x20','5363135jmSrly','description','information_schema','\x27\x20to\x20verify\x20the\x20job\x20status','Usage:\x20job\x20kill\x20<job-id>','end_at','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','...','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','cause','2449168NLqleW','3587718TvndJY','Show\x20job\x20details','2070844zXdXll','round','β\x20Job\x20submitted','Job\x20type:\x20','Cancelled','error','\x20\x20Job\x20ID:\x20','hive','jobs','1073044oxNzHe','user_name','18nsBPoE','substring','3YmHLtZ','β\x20Retrieved\x20','show','Get\x20job\x20results','Query:\x20','Error:\x20','Status\x20filter:\x20','trino','start_at','300482pPtwZV','jobType','\x20row','job:submit','Database:\x20','submit','query','status','Submitting\x20job...','job:kill','created_at','length','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','message','Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','\x20jobs','job:result','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','204NDOLNx','priority','yes','Error:\x20Job\x20ID\x20is\x20required','Submitting\x20kill\x20request...','list','Getting\x20job\x20details...','database','execute','\x20\x20Cause:\x20','file','url','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','type'];a17_0x5b8e=function(){return _0xa6ff22;};return a17_0x5b8e();}const a17_0x5ea68b=a17_0x395e;(function(_0x200966,_0x4acba9){const _0x5bb9fd=a17_0x395e,_0x15211b=_0x200966();while(!![]){try{const _0x53b796=-parseInt(_0x5bb9fd(0x17f))/0x1+-parseInt(_0x5bb9fd(0x174))/0x2+-parseInt(_0x5bb9fd(0x183))/0x3*(parseInt(_0x5bb9fd(0x176))/0x4)+-parseInt(_0x5bb9fd(0x169))/0x5+parseInt(_0x5bb9fd(0x19e))/0x6*(parseInt(_0x5bb9fd(0x18c))/0x7)+parseInt(_0x5bb9fd(0x173))/0x8*(parseInt(_0x5bb9fd(0x181))/0x9)+parseInt(_0x5bb9fd(0x164))/0xa;if(_0x53b796===_0x4acba9)break;else _0x15211b['push'](_0x15211b['shift']());}catch(_0x29d5fb){_0x15211b['push'](_0x15211b['shift']());}}}(a17_0x5b8e,0xdc2e1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}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';function a17_0x395e(_0x18e9a5,_0x1328a3){_0x18e9a5=_0x18e9a5-0x160;const _0x5b8eb0=a17_0x5b8e();let _0x395ecd=_0x5b8eb0[_0x18e9a5];return _0x395ecd;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{['name']='jobs';[a17_0x5ea68b(0x16a)]='List\x20jobs';async[a17_0x5ea68b(0x1a6)](_0x2c5fde){const _0x583641=a17_0x5ea68b,{options:_0x38628c,tdx:_0x49c6eb}=_0x2c5fde;try{const _0x4f0f6e=resolveLimit(_0x38628c['limit'],DEFAULT_DISPLAY_LIMIT),_0x35a032=_0x38628c[_0x583641(0x193)];_0x38628c[_0x583641(0x1ae)]&&(console['error']('Limit:\x20'+_0x4f0f6e+_0x583641(0x19b)),_0x35a032&&console['error'](_0x583641(0x189)+_0x35a032));const _0x117a7c=await withSpinner('Listing\x20jobs...',()=>_0x49c6eb[_0x583641(0x17e)][_0x583641(0x1a3)]({'from':0x0,'to':_0x4f0f6e-0x1,'status':_0x35a032}),{'verbose':_0x38628c['verbose']}),_0x307e77=_0x117a7c['data'];console[_0x583641(0x17b)](_0x583641(0x168)+_0x307e77['length']+_0x583641(0x1b0)+(_0x307e77[_0x583641(0x197)]!==0x1?'s':''));const _0x3e9a37=_0x307e77[_0x583641(0x166)](_0x3f1193=>{const _0x47cd60=_0x583641;let _0x4aec28;if(_0x3f1193[_0x47cd60(0x18b)]&&_0x3f1193['end_at']){const _0x12ce45=new Date(_0x3f1193[_0x47cd60(0x18b)])[_0x47cd60(0x167)](),_0xbf8e20=new Date(_0x3f1193[_0x47cd60(0x16e)])[_0x47cd60(0x167)]();_0x4aec28=Math[_0x47cd60(0x177)]((_0xbf8e20-_0x12ce45)/0x3e8);}return{'job_id':_0x3f1193['job_id'],'type':_0x3f1193[_0x47cd60(0x1ab)],'status':_0x3f1193[_0x47cd60(0x193)],'user_name':_0x3f1193['user_name'],'duration_sec':_0x4aec28,'created_at':_0x3f1193[_0x47cd60(0x196)],'started_at':_0x3f1193[_0x47cd60(0x18b)],'end_at':_0x3f1193[_0x47cd60(0x16e)]};});return await handleSDKOutput(_0x3e9a37,_0x38628c),0x0;}catch(_0x5f0d57){if(_0x5f0d57 instanceof SDKError)return console['error'](_0x583641(0x188)+_0x5f0d57['message']),_0x5f0d57['cause']&&console[_0x583641(0x17b)](_0x583641(0x1a7)+_0x5f0d57['cause']),0x1;throw _0x5f0d57;}}}export class JobShowCommand extends BaseCommand{['name']=a17_0x5ea68b(0x161);[a17_0x5ea68b(0x16a)]=a17_0x5ea68b(0x175);async[a17_0x5ea68b(0x1a6)](_0x552eb2){const _0x907645=a17_0x5ea68b,{options:_0x22612e,args:_0x40190c,tdx:_0x4a9251}=_0x552eb2,_0x941f65=_0x40190c[0x0];if(!_0x941f65)return console[_0x907645(0x17b)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x907645(0x17b)]('Usage:\x20job\x20show\x20<job-id>'),0x1;try{const _0x8ee134=await withSpinner(_0x907645(0x1a4),()=>_0x4a9251[_0x907645(0x17e)][_0x907645(0x185)](_0x941f65),{'verbose':_0x22612e[_0x907645(0x1ae)]}),_0x39cc4=_0x8ee134[_0x907645(0x1b1)];let _0x46cf44;if(_0x39cc4[_0x907645(0x18b)]&&_0x39cc4['end_at']){const _0x7a1db9=new Date(_0x39cc4[_0x907645(0x18b)])[_0x907645(0x167)](),_0xc998ff=new Date(_0x39cc4[_0x907645(0x16e)])['getTime']();_0x46cf44=Math[_0x907645(0x177)]((_0xc998ff-_0x7a1db9)/0x3e8);}const _0x3c8e7c={'job_id':_0x39cc4['job_id'],'type':_0x39cc4[_0x907645(0x1ab)],'status':_0x39cc4[_0x907645(0x193)],..._0x39cc4['user_name']&&{'user_name':_0x39cc4[_0x907645(0x180)]},..._0x46cf44!==undefined&&{'duration_sec':_0x46cf44},..._0x39cc4[_0x907645(0x196)]&&{'created_at':_0x39cc4['created_at']},..._0x39cc4[_0x907645(0x18b)]&&{'started_at':_0x39cc4[_0x907645(0x18b)]},..._0x39cc4[_0x907645(0x16e)]&&{'end_at':_0x39cc4['end_at']},..._0x39cc4['database']&&{'database':_0x39cc4[_0x907645(0x1a5)]},..._0x39cc4[_0x907645(0x19f)]!==undefined&&{'priority':_0x39cc4[_0x907645(0x19f)]},..._0x39cc4[_0x907645(0x1a9)]&&{'url':_0x39cc4[_0x907645(0x1a9)]},..._0x39cc4[_0x907645(0x192)]&&{'query':_0x39cc4[_0x907645(0x192)]},..._0x39cc4[_0x907645(0x163)]&&{'debug':_0x39cc4[_0x907645(0x163)]}};return await handleSingleObjectOutput(_0x3c8e7c,_0x22612e),0x0;}catch(_0x3550ab){if(_0x3550ab instanceof SDKError)return console[_0x907645(0x17b)](_0x907645(0x188)+_0x3550ab[_0x907645(0x199)]),_0x3550ab[_0x907645(0x172)]&&console[_0x907645(0x17b)]('\x20\x20Cause:\x20'+_0x3550ab[_0x907645(0x172)]),0x1;throw _0x3550ab;}}}export class JobKillCommand extends BaseCommand{[a17_0x5ea68b(0x162)]=a17_0x5ea68b(0x195);[a17_0x5ea68b(0x16a)]='Kill\x20a\x20job';async[a17_0x5ea68b(0x1a6)](_0x59ca1e){const _0x1da55e=a17_0x5ea68b,{options:_0x34f1a4,args:_0x282fc4,tdx:_0x3d341a}=_0x59ca1e,_0x194742=_0x282fc4[0x0];if(!_0x194742)return console[_0x1da55e(0x17b)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x1da55e(0x17b)](_0x1da55e(0x16d)),0x1;try{if(!_0x34f1a4[_0x1da55e(0x1a0)]){const _0x159460=await confirm(_0x1da55e(0x19d)+_0x194742+'?');if(!_0x159460)return console[_0x1da55e(0x17b)](_0x1da55e(0x17a)),0x0;}return await withSpinner(_0x1da55e(0x1a2),()=>_0x3d341a['jobs'][_0x1da55e(0x1af)](_0x194742),{'verbose':_0x34f1a4[_0x1da55e(0x1ae)]}),console['error'](_0x1da55e(0x1aa)+_0x194742),console[_0x1da55e(0x17b)](_0x1da55e(0x198)+_0x194742+_0x1da55e(0x16c)),0x0;}catch(_0x3308f2){if(_0x3308f2 instanceof SDKError)return console['error'](_0x1da55e(0x188)+_0x3308f2[_0x1da55e(0x199)]),_0x3308f2[_0x1da55e(0x172)]&&console['error'](_0x1da55e(0x1a7)+_0x3308f2[_0x1da55e(0x172)]),0x1;throw _0x3308f2;}}}export class JobSubmitCommand extends BaseCommand{[a17_0x5ea68b(0x162)]=a17_0x5ea68b(0x18f);[a17_0x5ea68b(0x16a)]=a17_0x5ea68b(0x160);async[a17_0x5ea68b(0x1a6)](_0x47d8be){const _0x90ee0e=a17_0x5ea68b,{options:_0x2a2e36,args:_0x5ae5ad,tdx:_0x560c07}=_0x47d8be;try{const _0x4e6d5d=_0x2a2e36[_0x90ee0e(0x18d)]||'trino',_0x1fba0a=_0x2a2e36[_0x90ee0e(0x1a8)],_0xe5a12f=_0x2a2e36[_0x90ee0e(0x1a5)]||_0x90ee0e(0x16b);if(_0x4e6d5d!==_0x90ee0e(0x18a)&&_0x4e6d5d!==_0x90ee0e(0x17d))return console['error']('Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22'),0x1;let _0x5a7de6;if(_0x1fba0a){if(_0x5ae5ad[0x0])return console[_0x90ee0e(0x17b)](_0x90ee0e(0x16f)),0x1;const _0x41ab4a=readSqlStatementsFromFile(_0x1fba0a);if(_0x41ab4a[_0x90ee0e(0x197)]===0x0)return console[_0x90ee0e(0x17b)](_0x90ee0e(0x171)),0x1;if(_0x41ab4a[_0x90ee0e(0x197)]>0x1)return console['error'](_0x90ee0e(0x1ad)),0x1;_0x5a7de6=_0x41ab4a[0x0];}else{if(!_0x5ae5ad[0x0])return console[_0x90ee0e(0x17b)](_0x90ee0e(0x1b2)),console[_0x90ee0e(0x17b)](_0x90ee0e(0x19a)),0x1;_0x5a7de6=_0x5ae5ad[0x0];}_0x2a2e36['verbose']&&(console[_0x90ee0e(0x17b)](_0x90ee0e(0x179)+_0x4e6d5d),console[_0x90ee0e(0x17b)](_0x90ee0e(0x190)+_0xe5a12f),console['error'](_0x90ee0e(0x187)+_0x5a7de6[_0x90ee0e(0x182)](0x0,0x64)+(_0x5a7de6[_0x90ee0e(0x197)]>0x64?_0x90ee0e(0x170):'')));const _0x497838=await withSpinner(_0x90ee0e(0x194),()=>_0x560c07[_0x90ee0e(0x17e)][_0x90ee0e(0x191)](_0xe5a12f,_0x5a7de6,_0x4e6d5d),{'verbose':_0x2a2e36['verbose']}),_0x3fa24f=_0x497838[_0x90ee0e(0x1b1)];return console['error'](_0x90ee0e(0x178)),console[_0x90ee0e(0x17b)](_0x90ee0e(0x17c)+_0x3fa24f[_0x90ee0e(0x1ac)]),await handleSDKOutput([_0x3fa24f],_0x2a2e36),0x0;}catch(_0x2c286a){if(_0x2c286a instanceof SDKError)return console[_0x90ee0e(0x17b)](_0x90ee0e(0x188)+_0x2c286a[_0x90ee0e(0x199)]),_0x2c286a[_0x90ee0e(0x172)]&&console[_0x90ee0e(0x17b)]('\x20\x20Cause:\x20'+_0x2c286a[_0x90ee0e(0x172)]),0x1;throw _0x2c286a;}}}export class JobResultCommand extends BaseCommand{['name']=a17_0x5ea68b(0x19c);['description']=a17_0x5ea68b(0x186);async[a17_0x5ea68b(0x1a6)](_0x588afa){const _0x23cc94=a17_0x5ea68b,{options:_0x3592e4,args:_0x4499ab,tdx:_0x568950}=_0x588afa,_0x2c10e7=_0x4499ab[0x0];if(!_0x2c10e7)return console['error'](_0x23cc94(0x1a1)),console['error']('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0x3ed55e=await withSpinner(_0x23cc94(0x165),()=>_0x568950['jobs']['result'](_0x2c10e7),{'verbose':_0x3592e4[_0x23cc94(0x1ae)]}),_0xff8e03=_0x3ed55e[_0x23cc94(0x1b1)];return console[_0x23cc94(0x17b)](_0x23cc94(0x184)+_0xff8e03[_0x23cc94(0x197)]+_0x23cc94(0x18e)+(_0xff8e03[_0x23cc94(0x197)]!==0x1?'s':'')),await handleSDKOutput(_0xff8e03,_0x3592e4),0x0;}catch(_0x4425b1){if(_0x4425b1 instanceof SDKError)return console[_0x23cc94(0x17b)](_0x23cc94(0x188)+_0x4425b1['message']),_0x4425b1['cause']&&console[_0x23cc94(0x17b)](_0x23cc94(0x1a7)+_0x4425b1[_0x23cc94(0x172)]),0x1;throw _0x4425b1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x4b99e4=a18_0x5d42;(function(_0x4abf2c,_0x282ab2){const _0x514244=a18_0x5d42,_0x4b3b57=_0x4abf2c();while(!![]){try{const _0x763a1f=-parseInt(_0x514244(0x243))/0x1+parseInt(_0x514244(0x218))/0x2*(-parseInt(_0x514244(0x24e))/0x3)+-parseInt(_0x514244(0x251))/0x4*(parseInt(_0x514244(0x1e8))/0x5)+parseInt(_0x514244(0x234))/0x6+parseInt(_0x514244(0x1bc))/0x7+-parseInt(_0x514244(0x1f4))/0x8+parseInt(_0x514244(0x231))/0x9;if(_0x763a1f===_0x282ab2)break;else _0x4b3b57['push'](_0x4b3b57['shift']());}catch(_0xf94ac1){_0x4b3b57['push'](_0x4b3b57['shift']());}}}(a18_0x2794,0x3a494));import a18_0x4f49ab from'chalk';import a18_0x56ab2f from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey}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{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a18_0x5d42(_0x1cc9be,_0x551a02){_0x1cc9be=_0x1cc9be-0x1b2;const _0x279413=a18_0x2794();let _0x5d42fc=_0x279413[_0x1cc9be];return _0x5d42fc;}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function formatJourneyState(_0x5c80f3){const _0x1ff2f1=a18_0x5d42;switch(_0x5c80f3){case _0x1ff2f1(0x1b7):return a18_0x4f49ab[_0x1ff2f1(0x21a)](_0x1ff2f1(0x1ce));case _0x1ff2f1(0x1b3):return a18_0x4f49ab[_0x1ff2f1(0x1f7)](_0x1ff2f1(0x219));case'paused':return a18_0x4f49ab[_0x1ff2f1(0x283)](_0x1ff2f1(0x246));case _0x1ff2f1(0x229):return a18_0x4f49ab[_0x1ff2f1(0x1c2)](_0x1ff2f1(0x1d4));case _0x1ff2f1(0x232):return a18_0x4f49ab[_0x1ff2f1(0x1f7)](_0x1ff2f1(0x21c));default:return'('+_0x5c80f3+')';}}function formatJourneyItem(_0x489fb0,_0x16512c='',_0x34f763){const _0xfea6fe=a18_0x5d42,_0x17bd2f=formatJourneyState(_0x489fb0[_0xfea6fe(0x276)]),_0x2d4b33=_0x34f763?hyperlink(_0x489fb0[_0xfea6fe(0x266)],_0x34f763):_0x489fb0['journeyBundleName'];return _0x16512c+_0xfea6fe(0x21f)+_0x2d4b33+'\x20'+_0x17bd2f;}function escapeRegex(_0x1aea33){const _0x5dddef=a18_0x5d42;return _0x1aea33['replace'](/[.*+?^${}()|[\]\\]/g,_0x5dddef(0x1d8));}function a18_0x2794(){const _0x32dcab=['/j/da','base','(root)','\x22\x20not\x20found','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','buildIdToNameMap','Parent\x20segment:\x20','absolutePath','250100akzGsj','dryRun','Fetching\x20','(paused)','π\x20','folders','journeyBundleId','listJourneysWithFolders','filter','Cancelled','No\x20statistics\x20available\x20for\x20journey:\x20','593025DRpCGp','totalEntered','log','550736PxGvsv','Error:\x20Journey\x20\x27','options','Fetching\x20users\x20for\x20email\x20resolution...','format','add','getJourney','journeyStages','test','folderId','stringify','journeyName','journeys','Export\x20journey(s)\x20as\x20YAML\x20files','Warning:\x20Stage\x20\x22','user','kind','execute','β\x20All\x20files\x20are\x20up\x20to\x20date','relativePath','INVALID_ARGUMENT','journeyBundleName','split','Listing\x20folders...','\x20->\x20','stageName','journey:list','segments','parent_segment','stage','Resolving\x20journey...','resolveSegment','Target\x20directory:\x20','.yml','\x20new\x20files','getParentFull','utf-8','state','\x20(ID:\x20','map','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','goalRate','Show\x20journey\x20details','Getting\x20journey\x20details...','setPhase','all','No\x20journeys\x20found','resolveJourneyId','journeyId','\x22\x20paused','yellow','Resolved\x20YAML\x20file:\x20','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','reentryMode','listFolders','Getting\x20journey\x20statistics...','Show\x20journey\x20statistics','description','\x20=\x20','draft','message','\x27\x20not\x20found\x20in\x20','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)','launched','Options:','journey:pause','Listing\x20journeys...','includeStats','198625KYXbMh','entered','stages','verbose','Usage:\x20journey\x20stats\x20<name-or-path>','sort','blue','site','data','has','errorCode','connection','rule','\x0aChanges\x20to\x20\x27','/e/','segment','Resume\x20a\x20paused\x20journey','Found\x20','(running)','type','\x20journeys','\x20\x20Statistics\x20not\x20available','\x20\x20Preserving\x20local\x20segment\x20name:\x20','table','(completed)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','diff','Usage:\x20journey\x20pause\x20<name-or-path>','\x5c$&','\x20\x20Consolidating\x20duplicate\x20segment:\x20','/j/da/je','cwd','repeat','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x20files?','entries','Resolving\x20parent\x20segment...','\x20\x20Name:\x20','exited','toLowerCase','\x20Opening\x20','Error:\x20Parent\x20segment\x20context\x20required','find','length','5HPtgmH','β\x20Journey\x20\x22','root\x20folder','population','β\x20Context\x20set:\x20','Fetching\x20parent\x20segment...','conversionRate','buildIdToEmailMap','content','activation_','\x20versions)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','3724056CrpdIZ','\x20(rule\x20match)','Usage:\x20journey\x20resume\x20<name-or-path>','dim','no_parent','hasChanges','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x22\x20resumed','parentName','\x20journey','session','totalGoalAchieved','segmentName','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','then','name','values','/app/ps/','size','web','journey:resume','cyan','paused','resolveParentId','args','Input:\x20','versionNumber','journey:push','getActivation','journey','folderPath','segmentPushCommand','...','\x20\x20-\x20','\x20\x20Folder\x20path:\x20','journey:view','2yRasxt','(draft)','green','localeCompare','(archived)','Error:\x20','attributes','πΊοΈ\x20','error','listJourneysFromParentSegment','get','getStatistics','set','Fetching\x20connections\x20for\x20name\x20resolution...','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','connector_config','rootFolderId','completed','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x20changed\x20files','parentSegment','push','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','yes','join','10497852JacRJw','archived','Target\x20file:\x20','569418mLSYYT','getSegment','file','Pausing\x20journey...','red','Pattern:\x20'];a18_0x2794=function(){return _0x32dcab;};return a18_0x2794();}function globToRegex(_0x36df95){const _0x4e9c54=a18_0x5d42,_0x4a1c3e=_0x36df95[_0x4e9c54(0x267)]('*')[_0x4e9c54(0x278)](escapeRegex);return new RegExp(_0x4a1c3e['join']('.*'),'i');}function buildRuleToNameMapping(_0x717cee){const _0x237f5c=a18_0x5d42,_0x30ef72=new Map();if(_0x717cee[_0x237f5c(0x26c)])for(const [_0x575df8,_0x206e49]of Object[_0x237f5c(0x1df)](_0x717cee[_0x237f5c(0x26c)])){if(_0x206e49[_0x237f5c(0x1c8)]){const _0x2f405f=serializeRule(_0x206e49[_0x237f5c(0x1c8)]),_0x3eef99=_0x30ef72[_0x237f5c(0x222)](_0x2f405f);_0x3eef99?_0x3eef99[_0x237f5c(0x22d)](_0x575df8):_0x30ef72[_0x237f5c(0x224)](_0x2f405f,[_0x575df8]);}}return _0x30ef72;}async function resolveJourneyTarget(_0x1a1934,_0x4f5cbc,_0x4e0408){const _0x39bb48=a18_0x5d42;if(isYamlFilePath(_0x1a1934))try{const _0x437470=await resolveYamlFilePath(_0x1a1934);return _0x4e0408&&(console[_0x39bb48(0x220)](_0x39bb48(0x284)+_0x1a1934),console[_0x39bb48(0x220)]('\x20\x20Parent\x20segment:\x20'+_0x437470[_0x39bb48(0x22c)]),console[_0x39bb48(0x220)](_0x39bb48(0x1e1)+_0x437470[_0x39bb48(0x200)]),console['error'](_0x39bb48(0x216)+(_0x437470[_0x39bb48(0x212)]||'(root)'))),{'journeyName':_0x437470[_0x39bb48(0x200)],'parentSegment':_0x437470['parentSegment'],'resolved':_0x437470};}catch(_0x4c4ca6){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x39bb48(0x23f)+_0x4c4ca6['message']);}if(!_0x4f5cbc)throw new SDKError(ErrorCode[_0x39bb48(0x265)],_0x39bb48(0x201));return{'journeyName':_0x1a1934,'parentSegment':_0x4f5cbc};}export class JourneyListCommand extends BaseCommand{[a18_0x4b99e4(0x203)]=a18_0x4b99e4(0x26b);[a18_0x4b99e4(0x28b)]='List\x20journeys\x20in\x20current\x20context';async[a18_0x4b99e4(0x262)](_0x2ccb63){const _0x1a2cca=a18_0x4b99e4,{options:_0x13ece7,args:_0x2c425c,tdx:_0x2dda6a}=_0x2ccb63,_0x2b547c=_0x2c425c[0x0],_0x2a4d8c=_0x13ece7['parentSegment'];if(!_0x2a4d8c)return console[_0x1a2cca(0x220)](_0x1a2cca(0x1e5)),console[_0x1a2cca(0x220)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x4ae282=await withSpinner(_0x1a2cca(0x1e0),()=>_0x2dda6a[_0x1a2cca(0x1cb)]['resolveParentId'](_0x2a4d8c),{'verbose':_0x13ece7[_0x1a2cca(0x1bf)]}),_0x515ae8=_0x4ae282['data'];_0x13ece7[_0x1a2cca(0x1bf)]&&(console['error']('Parent\x20segment:\x20'+_0x2a4d8c+_0x1a2cca(0x277)+_0x515ae8+')'),_0x2b547c&&console[_0x1a2cca(0x220)](_0x1a2cca(0x239)+_0x2b547c));const _0x13f043=await withSpinner(_0x1a2cca(0x1ed),()=>_0x2dda6a['segment'][_0x1a2cca(0x274)](_0x515ae8),{'verbose':_0x13ece7[_0x1a2cca(0x1bf)]}),_0x592798=_0x13f043['data'],_0x1a4a70=_0x592798[_0x1a2cca(0x228)],_0x29561e=await withSpinner(_0x1a2cca(0x1ba),()=>_0x2dda6a[_0x1a2cca(0x211)][_0x1a2cca(0x24a)](_0x515ae8,_0x1a4a70),{'verbose':_0x13ece7['verbose']});let _0x23d8b0=_0x29561e['data'][_0x1a2cca(0x25d)];const _0x27f33a=_0x29561e[_0x1a2cca(0x1c4)][_0x1a2cca(0x248)],_0x3d82a8=new Map();for(const _0x4619ea of _0x27f33a){_0x3d82a8[_0x1a2cca(0x224)](_0x4619ea['id'],_0x4619ea[_0x1a2cca(0x203)]);}if(_0x2b547c){const _0x92cb6d=globToRegex(_0x2b547c);_0x23d8b0=_0x23d8b0[_0x1a2cca(0x24b)](_0x3262e4=>_0x92cb6d[_0x1a2cca(0x259)](_0x3262e4[_0x1a2cca(0x266)]));}console[_0x1a2cca(0x220)]('β\x20Found\x20'+_0x23d8b0[_0x1a2cca(0x1e7)]+_0x1a2cca(0x1fd)+(_0x23d8b0[_0x1a2cca(0x1e7)]!==0x1?'s':''));const _0x346a74=_0x38c3a8=>{const _0x48eef4=_0x1a2cca;return getConsoleNextUrl(_0x13ece7[_0x48eef4(0x1c3)],_0x48eef4(0x205)+_0x515ae8+_0x48eef4(0x1ca)+_0x38c3a8+_0x48eef4(0x23a));};if(_0x13ece7[_0x1a2cca(0x255)]===_0x1a2cca(0x1d3))await handleSDKOutput(_0x23d8b0,_0x13ece7);else{if(_0x13ece7[_0x1a2cca(0x255)]==='json'){const _0x2746e8=_0x23d8b0['map'](_0x1e01ab=>({..._0x1e01ab,'url':_0x346a74(_0x1e01ab['id'])}));await handleSDKOutput(_0x2746e8,_0x13ece7);}else{console[_0x1a2cca(0x250)]('['+_0x2a4d8c+']');const _0x3ab157=new Map(),_0x3c4eb6=[];for(const _0x4c6e48 of _0x23d8b0){if(!_0x4c6e48[_0x1a2cca(0x25a)]||_0x4c6e48[_0x1a2cca(0x25a)]===_0x1a4a70)_0x3c4eb6[_0x1a2cca(0x22d)](_0x4c6e48);else{const _0x2af127=_0x3ab157[_0x1a2cca(0x222)](_0x4c6e48[_0x1a2cca(0x25a)])||[];_0x2af127[_0x1a2cca(0x22d)](_0x4c6e48),_0x3ab157[_0x1a2cca(0x224)](_0x4c6e48[_0x1a2cca(0x25a)],_0x2af127);}}const _0x205490=(_0x152b0d,_0x40925f)=>_0x152b0d[_0x1a2cca(0x266)][_0x1a2cca(0x21b)](_0x40925f[_0x1a2cca(0x266)],undefined,{'sensitivity':'base'});_0x3c4eb6[_0x1a2cca(0x1c1)](_0x205490);for(const _0x195601 of _0x3c4eb6){console[_0x1a2cca(0x250)](formatJourneyItem(_0x195601,'',_0x346a74(_0x195601['id'])));}const _0x222f1a=[..._0x3ab157[_0x1a2cca(0x1df)]()][_0x1a2cca(0x1c1)]((_0x5c6a79,_0x25d41e)=>{const _0x319e5=_0x1a2cca,_0x1b6a0a=_0x3d82a8[_0x319e5(0x222)](_0x5c6a79[0x0])||_0x5c6a79[0x0],_0x46c080=_0x3d82a8[_0x319e5(0x222)](_0x25d41e[0x0])||_0x25d41e[0x0];return _0x1b6a0a[_0x319e5(0x21b)](_0x46c080,undefined,{'sensitivity':_0x319e5(0x23b)});});for(const [_0x12e5d2,_0x46eeb0]of _0x222f1a){const _0x14e9c0=_0x3d82a8[_0x1a2cca(0x222)](_0x12e5d2)||_0x12e5d2;console[_0x1a2cca(0x250)](_0x1a2cca(0x247)+_0x14e9c0),_0x46eeb0['sort'](_0x205490);for(const _0x247352 of _0x46eeb0){console[_0x1a2cca(0x250)](formatJourneyItem(_0x247352,'\x20\x20',_0x346a74(_0x247352['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a18_0x4b99e4(0x203)]=a18_0x4b99e4(0x217);[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x27b);async[a18_0x4b99e4(0x262)](_0x4f64c2){const _0x2d77d3=a18_0x4b99e4,{options:_0x4fb21b,args:_0x1db8b7,tdx:_0x421ab1}=_0x4f64c2,_0xa75af4=_0x1db8b7[0x0];if(!_0xa75af4)return console['error'](_0x2d77d3(0x279)),console[_0x2d77d3(0x220)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x2d77d3(0x220)](_0x2d77d3(0x1b8)),console[_0x2d77d3(0x220)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x4fb21b[_0x2d77d3(0x1bf)]&&console['error'](_0x2d77d3(0x20d)+_0xa75af4);const _0x105cb8=await resolveJourneyTarget(_0xa75af4,_0x4fb21b[_0x2d77d3(0x22c)],_0x4fb21b[_0x2d77d3(0x1bf)]),_0x1dd1ed=await withSpinner(_0x2d77d3(0x1e0),()=>_0x421ab1[_0x2d77d3(0x1cb)][_0x2d77d3(0x20b)](_0x105cb8[_0x2d77d3(0x22c)]),{'verbose':_0x4fb21b[_0x2d77d3(0x1bf)]}),_0x4d467a=_0x1dd1ed['data'],_0x3e2266=await withSpinner(_0x2d77d3(0x26f),()=>_0x421ab1[_0x2d77d3(0x211)][_0x2d77d3(0x280)](_0x4d467a,_0x105cb8['journeyName']),{'verbose':_0x4fb21b[_0x2d77d3(0x1bf)]}),_0x3cbcf4=_0x3e2266[_0x2d77d3(0x1c4)];if(_0x4fb21b[_0x2d77d3(0x207)]){const _0x5855db=getConsoleNextUrl(_0x4fb21b[_0x2d77d3(0x1c3)],_0x2d77d3(0x205)+_0x4d467a+_0x2d77d3(0x1ca)+_0x3cbcf4+_0x2d77d3(0x1da));return console[_0x2d77d3(0x220)](a18_0x4f49ab[_0x2d77d3(0x21a)]('β')+_0x2d77d3(0x1e4)+a18_0x4f49ab[_0x2d77d3(0x209)](_0x5855db)),openBrowser(_0x5855db),0x0;}const _0x381832=await withSpinner(_0x2d77d3(0x27c),()=>_0x421ab1['journey'][_0x2d77d3(0x257)](_0x3cbcf4),{'verbose':_0x4fb21b[_0x2d77d3(0x1bf)]}),_0x3c3936=_0x381832['data'],_0x4f6cfc=_0x4fb21b[_0x2d77d3(0x1bb)];let _0x2f69e6;if(_0x4f6cfc)try{const _0x128637=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x421ab1[_0x2d77d3(0x211)][_0x2d77d3(0x223)](_0x3cbcf4),{'verbose':_0x4fb21b[_0x2d77d3(0x1bf)]});_0x2f69e6=_0x128637[_0x2d77d3(0x1c4)];}catch{_0x4fb21b[_0x2d77d3(0x1bf)]&&console[_0x2d77d3(0x220)](_0x2d77d3(0x1d1));}const _0x3f036a=getConsoleNextUrl(_0x4fb21b[_0x2d77d3(0x1c3)],'/app/ps/'+_0x4d467a+_0x2d77d3(0x1ca)+_0x3cbcf4+_0x2d77d3(0x1da)),_0x14c656={'id':_0x3c3936['id'],'name':_0x3c3936['attributes'][_0x2d77d3(0x203)],'description':_0x3c3936['attributes'][_0x2d77d3(0x28b)],'state':_0x3c3936['attributes']['state'],'paused':_0x3c3936['attributes'][_0x2d77d3(0x20a)],'reentry_mode':_0x3c3936['attributes'][_0x2d77d3(0x287)],'stages':_0x3c3936[_0x2d77d3(0x21e)][_0x2d77d3(0x258)]?.[_0x2d77d3(0x1e7)]||0x0,..._0x3c3936[_0x2d77d3(0x21e)]['goal']&&{'goal':_0x3c3936[_0x2d77d3(0x21e)]['goal'][_0x2d77d3(0x203)]},..._0x2f69e6&&{'statistics':{'total_entered':_0x2f69e6['totalEntered'],'goal_achieved':_0x2f69e6[_0x2d77d3(0x1ff)],'goal_rate':_0x2f69e6[_0x2d77d3(0x27a)],'stages':_0x2f69e6[_0x2d77d3(0x1be)]}},'url':_0x3f036a};return await handleSingleObjectOutput(_0x14c656,_0x4fb21b),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x4b99e4(0x203)]='journey:stats';[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x28a);async[a18_0x4b99e4(0x262)](_0x44b428){const _0x91b79d=a18_0x4b99e4,{options:_0x2ebe0d,args:_0x610d3b,tdx:_0x417f19}=_0x44b428,_0xa86b41=_0x610d3b[0x0];if(!_0xa86b41)return console[_0x91b79d(0x220)](_0x91b79d(0x279)),console[_0x91b79d(0x220)](_0x91b79d(0x1c0)),0x1;_0x2ebe0d[_0x91b79d(0x1bf)]&&console[_0x91b79d(0x220)](_0x91b79d(0x20d)+_0xa86b41);const _0x48846f=await resolveJourneyTarget(_0xa86b41,_0x2ebe0d['parentSegment'],_0x2ebe0d[_0x91b79d(0x1bf)]),_0x5b1092=await withSpinner(_0x91b79d(0x1e0),()=>_0x417f19['segment'][_0x91b79d(0x20b)](_0x48846f[_0x91b79d(0x22c)]),{'verbose':_0x2ebe0d[_0x91b79d(0x1bf)]}),_0x57c4d5=_0x5b1092['data'],_0x1c4199=await withSpinner('Resolving\x20journey...',()=>_0x417f19[_0x91b79d(0x211)][_0x91b79d(0x280)](_0x57c4d5,_0x48846f['journeyName']),{'verbose':_0x2ebe0d[_0x91b79d(0x1bf)]}),_0x85c83b=_0x1c4199['data'],_0x4b39ea=await withSpinner(_0x91b79d(0x289),()=>_0x417f19[_0x91b79d(0x211)][_0x91b79d(0x223)](_0x85c83b),{'verbose':_0x2ebe0d[_0x91b79d(0x1bf)]}),_0x32b41b=_0x4b39ea[_0x91b79d(0x1c4)];if(!_0x32b41b||_0x32b41b[_0x91b79d(0x281)]===null)return console['error'](_0x91b79d(0x24d)+_0x48846f[_0x91b79d(0x25c)]),console['error'](_0x91b79d(0x22e)),0x0;const _0x4f8308={'journey_id':_0x32b41b[_0x91b79d(0x281)],'total_entered':_0x32b41b[_0x91b79d(0x24f)],'goal_achieved':_0x32b41b['totalGoalAchieved'],'goal_rate':_0x32b41b[_0x91b79d(0x27a)],'stages':_0x32b41b[_0x91b79d(0x1be)]?.['map'](_0x451db9=>({'name':_0x451db9[_0x91b79d(0x26a)],'population':_0x451db9[_0x91b79d(0x1eb)],'entered':_0x451db9[_0x91b79d(0x1bd)],'exited':_0x451db9[_0x91b79d(0x1e2)],'conversion_rate':_0x451db9[_0x91b79d(0x1ee)]}))},_0x4558e8=_0x2ebe0d[_0x91b79d(0x26e)];if(_0x4558e8&&_0x32b41b[_0x91b79d(0x1be)]){const _0x44bc33=_0x32b41b['stages']['find'](_0x25f5bc=>_0x25f5bc[_0x91b79d(0x26a)]['toLowerCase']()===_0x4558e8[_0x91b79d(0x1e3)]());if(_0x44bc33)return await handleSingleObjectOutput({'stage_name':_0x44bc33['stageName'],'population':_0x44bc33[_0x91b79d(0x1eb)],'entered':_0x44bc33['entered'],'exited':_0x44bc33['exited'],'conversion_rate':_0x44bc33[_0x91b79d(0x1ee)]},_0x2ebe0d),0x0;console[_0x91b79d(0x220)](_0x91b79d(0x25f)+_0x4558e8+_0x91b79d(0x23d));}return await handleSingleObjectOutput(_0x4f8308,_0x2ebe0d),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a18_0x4b99e4(0x203)]=a18_0x4b99e4(0x1b9);[a18_0x4b99e4(0x28b)]='Pause\x20a\x20running\x20journey';async['execute'](_0x1b469a){const _0xf31240=a18_0x4b99e4,{options:_0x362287,args:_0x344ac6,tdx:_0x27b740}=_0x1b469a,_0x27db30=_0x344ac6[0x0];if(!_0x27db30)return console[_0xf31240(0x220)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0xf31240(0x220)](_0xf31240(0x1d7)),0x1;_0x362287[_0xf31240(0x1bf)]&&console['error'](_0xf31240(0x20d)+_0x27db30);const _0x40d97e=await resolveJourneyTarget(_0x27db30,_0x362287['parentSegment'],_0x362287[_0xf31240(0x1bf)]),_0x3a7670=await withSpinner(_0xf31240(0x1e0),()=>_0x27b740[_0xf31240(0x1cb)][_0xf31240(0x20b)](_0x40d97e[_0xf31240(0x22c)]),{'verbose':_0x362287[_0xf31240(0x1bf)]}),_0x27f09d=_0x3a7670[_0xf31240(0x1c4)],_0x585531=await withSpinner(_0xf31240(0x26f),()=>_0x27b740[_0xf31240(0x211)][_0xf31240(0x280)](_0x27f09d,_0x40d97e['journeyName']),{'verbose':_0x362287[_0xf31240(0x1bf)]}),_0x197d72=_0x585531[_0xf31240(0x1c4)];if(!_0x362287[_0xf31240(0x22f)]){const _0x59da69=await confirm(_0xf31240(0x22a)+_0x40d97e[_0xf31240(0x25c)]+'\x22?');if(!_0x59da69)return console['error'](_0xf31240(0x24c)),0x0;}const _0x403731=await withSpinner(_0xf31240(0x237),()=>_0x27b740[_0xf31240(0x211)]['pause'](_0x197d72),{'verbose':_0x362287[_0xf31240(0x1bf)]}),_0x212b75=_0x403731[_0xf31240(0x1c4)];return console['error'](_0xf31240(0x1e9)+_0x212b75[_0xf31240(0x21e)]['name']+_0xf31240(0x282)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a18_0x4b99e4(0x208);[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x1cc);async['execute'](_0x1a6224){const _0x5b4525=a18_0x4b99e4,{options:_0x594a0a,args:_0xc08f56,tdx:_0x276c6b}=_0x1a6224,_0x1fe052=_0xc08f56[0x0];if(!_0x1fe052)return console[_0x5b4525(0x220)](_0x5b4525(0x279)),console['error'](_0x5b4525(0x1f6)),0x1;_0x594a0a['verbose']&&console[_0x5b4525(0x220)](_0x5b4525(0x20d)+_0x1fe052);const _0x5e9f53=await resolveJourneyTarget(_0x1fe052,_0x594a0a[_0x5b4525(0x22c)],_0x594a0a[_0x5b4525(0x1bf)]),_0x1dae21=await withSpinner(_0x5b4525(0x1e0),()=>_0x276c6b['segment'][_0x5b4525(0x20b)](_0x5e9f53[_0x5b4525(0x22c)]),{'verbose':_0x594a0a['verbose']}),_0x3080d2=_0x1dae21[_0x5b4525(0x1c4)],_0x55164b=await withSpinner(_0x5b4525(0x26f),()=>_0x276c6b['journey'][_0x5b4525(0x280)](_0x3080d2,_0x5e9f53['journeyName']),{'verbose':_0x594a0a[_0x5b4525(0x1bf)]}),_0x181006=_0x55164b[_0x5b4525(0x1c4)];if(!_0x594a0a['yes']){const _0x3ce34a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x5e9f53[_0x5b4525(0x25c)]+'\x22?');if(!_0x3ce34a)return console[_0x5b4525(0x220)](_0x5b4525(0x24c)),0x0;}const _0x339850=await withSpinner('Resuming\x20journey...',()=>_0x276c6b[_0x5b4525(0x211)]['resume'](_0x181006),{'verbose':_0x594a0a['verbose']}),_0x9623a=_0x339850[_0x5b4525(0x1c4)];return console[_0x5b4525(0x220)]('β\x20Journey\x20\x22'+_0x9623a[_0x5b4525(0x21e)][_0x5b4525(0x203)]+_0x5b4525(0x1fb)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']='journey:pull';[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x25e);async[a18_0x4b99e4(0x262)](_0x12a848){const _0xedcc21=a18_0x4b99e4,{options:_0x32c224,args:_0x567c61,tdx:_0x24e730}=_0x12a848,_0x2b8019=_0x32c224,_0x1d31d4=_0x567c61[0x0],_0x4a1577=_0x1d31d4&&isYamlFilePath(_0x1d31d4),_0x3e19df=await resolveTarget({'arg':_0x4a1577?_0x1d31d4:undefined,'contextParent':_0x32c224[_0xedcc21(0x22c)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3e19df))return _0x3e19df[_0xedcc21(0x1c6)]===_0xedcc21(0x1f8)?(console[_0xedcc21(0x220)](a18_0x4f49ab['yellow'](_0xedcc21(0x286))),console['error'](_0xedcc21(0x1b6)),console[_0xedcc21(0x220)](_0xedcc21(0x1f3)),console[_0xedcc21(0x220)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0xedcc21(0x220)](_0xedcc21(0x1d5))):(console[_0xedcc21(0x220)](a18_0x4f49ab[_0xedcc21(0x238)](_0xedcc21(0x21d)+_0x3e19df['message']+'\x0a')),_0x3e19df['helpText']&&console[_0xedcc21(0x220)](a18_0x4f49ab['cyan'](_0x3e19df['helpText']))),0x1;let _0x4c642d=_0x4a1577?undefined:_0x1d31d4,_0x5f5abb,_0x27acbb;_0x3e19df[_0xedcc21(0x1cf)]===_0xedcc21(0x236)&&(_0x4c642d=_0x3e19df['resourceName'],_0x5f5abb=_0x3e19df[_0xedcc21(0x285)],_0x27acbb=_0x3e19df[_0xedcc21(0x212)]);const _0x5e26a5=_0x3e19df[_0xedcc21(0x1fc)],_0x1a5b0d=_0x3e19df['targetDir'];_0x2b8019[_0xedcc21(0x1bf)]&&(console['error'](_0xedcc21(0x241)+_0x5e26a5),console[_0xedcc21(0x220)](_0xedcc21(0x271)+_0x1a5b0d),_0x4c642d&&console[_0xedcc21(0x220)]('Journey\x20name:\x20'+_0x4c642d),_0x5f5abb&&console[_0xedcc21(0x220)](_0xedcc21(0x233)+_0x5f5abb),_0x27acbb&&console[_0xedcc21(0x220)]('Folder\x20path:\x20'+_0x27acbb));const _0x31d160=await withSpinner(_0xedcc21(0x1e0),()=>_0x24e730[_0xedcc21(0x1cb)]['resolveParentId'](_0x5e26a5),{'verbose':_0x32c224[_0xedcc21(0x1bf)]}),_0x312a84=_0x31d160[_0xedcc21(0x1c4)],[_0x203d91,_0x22d25c]=await Promise[_0xedcc21(0x27e)]([withSpinner(_0xedcc21(0x1ba),()=>_0x24e730[_0xedcc21(0x211)][_0xedcc21(0x221)](_0x312a84,undefined,{'includeAllVersions':!![]}),{'verbose':_0x32c224[_0xedcc21(0x1bf)]}),withSpinner(_0xedcc21(0x268),()=>_0x24e730[_0xedcc21(0x1cb)][_0xedcc21(0x288)](_0x312a84),{'verbose':_0x32c224[_0xedcc21(0x1bf)]})]);let _0x2db758=_0x203d91[_0xedcc21(0x1c4)];const _0x484d93=_0x22d25c[_0xedcc21(0x1c4)],_0x7bb7d5=buildFolderIdToPathMap(_0x484d93);if(_0x4c642d){const _0x3e7d67=_0x2db758[_0xedcc21(0x24b)](_0x1d78e6=>_0x1d78e6[_0xedcc21(0x266)][_0xedcc21(0x1e3)]()===_0x4c642d['toLowerCase']());if(_0x3e7d67[_0xedcc21(0x1e7)]===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x4c642d),console[_0xedcc21(0x220)](_0xedcc21(0x1fa)),0x1;_0x2db758=_0x3e7d67;}if(_0x27acbb!==undefined){const _0x278e36=_0x2db758[_0xedcc21(0x24b)](_0x2ffe95=>{const _0x2fdf69=_0xedcc21,_0x41761a=_0x2ffe95[_0x2fdf69(0x25a)]?_0x7bb7d5[_0x2fdf69(0x222)](_0x2ffe95[_0x2fdf69(0x25a)])||'':'';return _0x41761a===_0x27acbb;});if(_0x278e36[_0xedcc21(0x1e7)]===0x0&&_0x2db758['length']>0x0){console[_0xedcc21(0x220)](_0xedcc21(0x252)+_0x4c642d+_0xedcc21(0x1b5)+(_0x27acbb||_0xedcc21(0x1ea))),console[_0xedcc21(0x220)](_0xedcc21(0x226));for(const _0x5ebed8 of _0x2db758){const _0x423586=_0x5ebed8['folderId']?_0x7bb7d5[_0xedcc21(0x222)](_0x5ebed8['folderId'])||'':'';console['error'](_0xedcc21(0x215)+(_0x423586||_0xedcc21(0x23c))+'/'+_0x5ebed8[_0xedcc21(0x266)]);}return 0x1;}_0x2db758=_0x278e36;}if(_0x2db758[_0xedcc21(0x1e7)]===0x0)return console['error'](_0xedcc21(0x27f)),0x0;const _0x122b97=new Map();for(const _0x5b7ad1 of _0x2db758){const _0x3f17fc=_0x5b7ad1[_0xedcc21(0x249)];!_0x122b97[_0xedcc21(0x1c5)](_0x3f17fc)&&_0x122b97[_0xedcc21(0x224)](_0x3f17fc,[]),_0x122b97[_0xedcc21(0x222)](_0x3f17fc)[_0xedcc21(0x22d)](_0x5b7ad1);}for(const _0xf0c8f of _0x122b97['values']()){_0xf0c8f[_0xedcc21(0x1c1)]((_0x56aba4,_0x1d63dc)=>(_0x56aba4[_0xedcc21(0x20e)]||0x0)-(_0x1d63dc[_0xedcc21(0x20e)]||0x0));}const _0x184f4c=[],[_0xb5b43f,_0x4146fe]=await Promise[_0xedcc21(0x27e)]([withSpinner(_0xedcc21(0x254),()=>_0x24e730[_0xedcc21(0x260)][_0xedcc21(0x1ef)](),{'verbose':_0x32c224[_0xedcc21(0x1bf)]})[_0xedcc21(0x202)](_0x4345a2=>_0x4345a2['data']),withSpinner(_0xedcc21(0x225),()=>_0x24e730['connection'][_0xedcc21(0x240)](),{'verbose':_0x32c224['verbose']})[_0xedcc21(0x202)](_0x45731a=>_0x45731a[_0xedcc21(0x1c4)])]);for(const _0x5bb60c of _0x122b97[_0xedcc21(0x204)]()){const _0x39e7d8=_0x5bb60c[0x0]['journeyBundleName'],_0x4ceadf=_0x5bb60c[0x0][_0xedcc21(0x25a)],_0x10d402=_0x4ceadf?_0x7bb7d5[_0xedcc21(0x222)](_0x4ceadf)||'':'',_0x12bc0d=_0x10d402?a18_0x56ab2f[_0xedcc21(0x230)](_0x1a5b0d,_0x10d402):_0x1a5b0d,_0x5363a1=_0x5f5abb||a18_0x56ab2f[_0xedcc21(0x230)](_0x12bc0d,sanitizeFileName(_0x39e7d8)+_0xedcc21(0x272));let _0x3b1049,_0x359aed;if(existsSync(_0x5363a1))try{const _0x4534bd=readFileSync(_0x5363a1,_0xedcc21(0x275)),_0x727ad3=parseYamlString(_0x4534bd);_0x359aed=_0x727ad3,_0x3b1049=buildRuleToNameMapping(_0x727ad3),_0x2b8019[_0xedcc21(0x1bf)]&&_0x3b1049[_0xedcc21(0x206)]>0x0&&console[_0xedcc21(0x220)](_0xedcc21(0x1cd)+_0x3b1049[_0xedcc21(0x206)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x39e7d8);}catch(_0x330aef){_0x2b8019[_0xedcc21(0x1bf)]&&console[_0xedcc21(0x220)](_0xedcc21(0x1dd)+_0x330aef['message']);}const _0x4ac376=[],_0x25b300=new Set(),_0x34b9a4=new Map(),_0x1d8d00=new Map(),_0x40962e=new Set(),_0x5f4b7e=new Map(),_0xfb58df=new Map(),_0x54e49b=createJumpTargetCache();await withProgressSpinner(_0xedcc21(0x245)+_0x39e7d8+_0xedcc21(0x214),async _0x1e6624=>{const _0x4c19bc=_0xedcc21;for(const _0x3d9a0f of _0x5bb60c){const _0x2835b9=_0x5bb60c[_0x4c19bc(0x1e7)]>0x1?_0x3d9a0f[_0x4c19bc(0x266)]+'\x20v'+(_0x3d9a0f[_0x4c19bc(0x20e)]||0x1):_0x3d9a0f['journeyBundleName'];_0x1e6624[_0x4c19bc(0x27d)](_0x4c19bc(0x245)+_0x2835b9);const _0x2c903e=await _0x24e730[_0x4c19bc(0x211)]['getJourney'](_0x3d9a0f['id']),_0xd134b6=_0x2c903e[_0x4c19bc(0x21e)]?.['audienceId'],_0xb02592={'resolveSegment':async _0x167ed7=>{const _0x1de78c=_0x4c19bc;if(!_0xd134b6)return{'name':_0x167ed7,'isJourneyLocal':![]};const _0x291957=_0x34b9a4[_0x1de78c(0x222)](_0x167ed7);if(_0x291957)return _0x291957;try{const _0x5ed54d=await _0x24e730[_0x1de78c(0x1cb)][_0x1de78c(0x235)](_0xd134b6,_0x167ed7),_0x1c6a6e=_0x5ed54d[_0x1de78c(0x261)]===SEGMENT_KIND_JOURNEY;let _0x158d06,_0x1cdd6a=_0x5ed54d[_0x1de78c(0x203)];if(_0x1c6a6e&&_0x5ed54d[_0x1de78c(0x1c8)]){const _0x5094e3=await segmentResponseToDef(_0x5ed54d,{'resolveSegmentName':async _0x581756=>{const _0x17a234=_0x1de78c,_0x2e3c56=_0x34b9a4[_0x17a234(0x222)](_0x581756);if(_0x2e3c56)return _0x2e3c56[_0x17a234(0x203)];const _0x3aed65=await _0xb02592[_0x17a234(0x270)](_0x581756);return _0x3aed65[_0x17a234(0x203)];}}),_0x5aa49e=_0x5094e3[_0x1de78c(0x1c8)];_0x158d06={'description':_0x5ed54d['description'],'rule':_0x5aa49e};const _0x5adf1d=serializeRule(_0x5aa49e),_0x1e52fb=_0x1d8d00[_0x1de78c(0x222)](_0x5adf1d);if(_0x1e52fb)_0x1cdd6a=_0x1e52fb,_0x158d06=undefined,_0x2b8019[_0x1de78c(0x1bf)]&&console[_0x1de78c(0x220)](_0x1de78c(0x1d9)+_0x5ed54d[_0x1de78c(0x203)]+_0x1de78c(0x269)+_0x1e52fb);else{let _0x111b1e=![];if(_0x3b1049){const _0x43cc8f=_0x3b1049[_0x1de78c(0x222)](_0x5adf1d);if(_0x43cc8f){const _0x11a6ca=_0x43cc8f[_0x1de78c(0x1e6)](_0xcab21e=>!_0x25b300[_0x1de78c(0x1c5)](_0xcab21e));_0x11a6ca&&(_0x1cdd6a=_0x11a6ca,_0x25b300[_0x1de78c(0x256)](_0x11a6ca),_0x1d8d00[_0x1de78c(0x224)](_0x5adf1d,_0x11a6ca),_0x111b1e=!![],_0x2b8019[_0x1de78c(0x1bf)]&&console[_0x1de78c(0x220)](_0x1de78c(0x1d2)+_0x11a6ca+_0x1de78c(0x1f5)));}}if(!_0x111b1e){const _0x36cff9=generateJourneyLocalName(_0x5ed54d[_0x1de78c(0x203)]);_0x36cff9&&(_0x1cdd6a=_0x36cff9);let _0x5096b2=_0x1cdd6a,_0x5ad78a=0x2;while(_0x25b300[_0x1de78c(0x1c5)](_0x5096b2)){_0x5096b2=_0x1cdd6a+'_'+_0x5ad78a,_0x5ad78a++;}_0x25b300[_0x1de78c(0x256)](_0x5096b2),_0x1d8d00[_0x1de78c(0x224)](_0x5adf1d,_0x5096b2),_0x1cdd6a=_0x5096b2;}}}const _0xdf02de={'name':_0x1cdd6a,'isJourneyLocal':_0x1c6a6e,'definition':_0x158d06};return _0x34b9a4['set'](_0x167ed7,_0xdf02de),_0xdf02de;}catch(_0x2ffd36){return _0x32c224[_0x1de78c(0x1bf)]&&console[_0x1de78c(0x220)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x167ed7+':\x20'+_0x2ffd36['message']),{'name':_0x167ed7,'isJourneyLocal':![]};}},'resolveActivation':async _0x3bd39f=>{const _0x4b1bed=_0x4c19bc,_0x1cf9cf=_0x5f4b7e['get'](_0x3bd39f);if(_0x1cf9cf)return _0x1cf9cf;try{const _0xf47ee6=await _0x24e730[_0x4b1bed(0x211)][_0x4b1bed(0x210)](_0x3d9a0f['id'],_0x3bd39f),_0x3e5205=journeyActivationStepToYaml(_0xf47ee6,_0xb5b43f,_0x4146fe),_0xb7e22b=JSON[_0x4b1bed(0x25b)]({'name':_0x3e5205[_0x4b1bed(0x203)],'connection':_0x3e5205[_0x4b1bed(0x1c7)],'connector_config':_0x3e5205[_0x4b1bed(0x227)]}),_0x5cd40c=_0xfb58df[_0x4b1bed(0x222)](_0xb7e22b);if(_0x5cd40c){const _0x5af45c={'name':_0x5cd40c,'isJourneyLocal':!![],'definition':_0x3e5205};return _0x5f4b7e['set'](_0x3bd39f,_0x5af45c),_0x5af45c;}const _0xf1394a=_0xf47ee6[_0x4b1bed(0x21e)]['activationParams'][_0x4b1bed(0x203)]||_0x3bd39f,_0x18121e=sanitizeYamlKey(_0xf1394a)||_0x4b1bed(0x1f1)+_0x3bd39f;let _0x43ed34=_0x18121e,_0x3b860b=0x2;while(_0x40962e[_0x4b1bed(0x1c5)](_0x43ed34)){_0x43ed34=_0x18121e+'_'+_0x3b860b,_0x3b860b++;}_0x40962e[_0x4b1bed(0x256)](_0x43ed34),_0xfb58df[_0x4b1bed(0x224)](_0xb7e22b,_0x43ed34);const _0x4647f8={'name':_0x43ed34,'isJourneyLocal':!![],'definition':_0x3e5205};return _0x5f4b7e[_0x4b1bed(0x224)](_0x3bd39f,_0x4647f8),_0x4647f8;}catch(_0x2a71a1){return _0x32c224[_0x4b1bed(0x1bf)]&&console[_0x4b1bed(0x220)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x3bd39f+':\x20'+_0x2a71a1[_0x4b1bed(0x1b4)]),{'name':_0x3bd39f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0xb6e9a5,_0x1ad84a)=>{const _0x1f40af=_0x4c19bc;return resolveJumpTarget(_0xb6e9a5,_0x1ad84a,_0x54e49b,_0x52f736=>_0x24e730[_0x1f40af(0x211)]['getJourney'](_0x52f736));}},_0x255fbb=await journeyResponseToDef(_0x2c903e,_0xb02592);_0x4ac376[_0x4c19bc(0x22d)]({'item':_0x3d9a0f,'yaml':_0x255fbb});}},{'verbose':_0x32c224['verbose']});const _0x2c2225=buildMergedJourneyDef(_0x4ac376,_0x3b1049),_0x4f906b=normalizeJourneyDef(_0x2c2225,_0x359aed),_0x219a77=toYamlString(_0x4f906b),_0x5dd8ed=_0x5f5abb||a18_0x56ab2f['join'](_0x12bc0d,sanitizeFileName(_0x39e7d8)+_0xedcc21(0x272));!_0x5f5abb&&_0x10d402&&!existsSync(_0x12bc0d)&&mkdirSync(_0x12bc0d,{'recursive':!![]});const _0x4089ae=a18_0x56ab2f['relative'](process[_0xedcc21(0x1db)](),_0x5dd8ed);if(existsSync(_0x5dd8ed)){const _0x24ee52=readFileSync(_0x5dd8ed,'utf-8'),_0x40e934=generateDiff(_0x24ee52,_0x219a77),_0x46c70c=hasChanges(_0x40e934);_0x184f4c[_0xedcc21(0x22d)]({'relativePath':_0x4089ae,'absolutePath':_0x5dd8ed,'content':_0x219a77,'isNew':![],'hasChanges':_0x46c70c,'diff':_0x46c70c?formatDiffWithColors(_0x40e934):undefined});}else _0x184f4c[_0xedcc21(0x22d)]({'relativePath':_0x4089ae,'absolutePath':_0x5dd8ed,'content':_0x219a77,'isNew':!![],'hasChanges':![]});}const _0x4fa970=_0x184f4c[_0xedcc21(0x24b)](_0x12873a=>_0x12873a['isNew']),_0x595b54=_0x184f4c[_0xedcc21(0x24b)](_0x2f3093=>!_0x2f3093['isNew']&&_0x2f3093[_0xedcc21(0x1f9)]),_0x51e2a6=_0x184f4c[_0xedcc21(0x24b)](_0x5c1517=>!_0x5c1517['isNew']&&!_0x5c1517[_0xedcc21(0x1f9)]),_0x4af0b6=_0x2db758[_0xedcc21(0x1e7)],_0x1889f0=_0x122b97[_0xedcc21(0x206)],_0x485f8c=_0x4af0b6>_0x1889f0?'\x20('+_0x4af0b6+_0xedcc21(0x1f2):'';console[_0xedcc21(0x220)]('\x0aPull\x20summary:'),console[_0xedcc21(0x220)]('\x20\x20'+a18_0x4f49ab[_0xedcc21(0x209)](_0x1889f0+_0xedcc21(0x1d0))+a18_0x4f49ab[_0xedcc21(0x1f7)](_0x485f8c)),console[_0xedcc21(0x220)]('\x20\x20'+a18_0x4f49ab['green']('+\x20'+_0x4fa970[_0xedcc21(0x1e7)]+_0xedcc21(0x273))),console[_0xedcc21(0x220)]('\x20\x20'+a18_0x4f49ab[_0xedcc21(0x283)]('~\x20'+_0x595b54['length']+_0xedcc21(0x22b))),console[_0xedcc21(0x220)]('\x20\x20'+a18_0x4f49ab[_0xedcc21(0x1f7)]('=\x20'+_0x51e2a6[_0xedcc21(0x1e7)]+'\x20unchanged\x20files')),console[_0xedcc21(0x220)]('\x20\x20Target:\x20'+a18_0x4f49ab['cyan'](_0x1a5b0d)+'\x0a');if(_0x595b54[_0xedcc21(0x1e7)]>0x0)for(const _0x336c5a of _0x595b54){console[_0xedcc21(0x220)](_0xedcc21(0x1c9)+_0x336c5a[_0xedcc21(0x264)]+'\x27:'),console[_0xedcc21(0x220)]('β'[_0xedcc21(0x1dc)](0x3c)),console[_0xedcc21(0x220)](_0x336c5a[_0xedcc21(0x1d6)]),console[_0xedcc21(0x220)]('β'[_0xedcc21(0x1dc)](0x3c));}if(_0x2b8019[_0xedcc21(0x244)])return console[_0xedcc21(0x220)](a18_0x4f49ab[_0xedcc21(0x283)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4fa970[_0xedcc21(0x1e7)]===0x0&&_0x595b54[_0xedcc21(0x1e7)]===0x0)return console['error'](a18_0x4f49ab[_0xedcc21(0x21a)](_0xedcc21(0x263))),saveSessionContext({'parent_segment':_0x5e26a5},_0x2b8019[_0xedcc21(0x1fe)]),console[_0xedcc21(0x220)](a18_0x4f49ab[_0xedcc21(0x21a)](_0xedcc21(0x1ec)+a18_0x4f49ab['dim'](_0xedcc21(0x26d))+_0xedcc21(0x1b2)+a18_0x4f49ab['cyan'](_0x5e26a5))),0x0;if(!_0x2b8019['yes']&&(_0x4fa970['length']>0x0||_0x595b54['length']>0x0)){const _0x47d6e6=await confirmKey('Write\x20'+(_0x4fa970[_0xedcc21(0x1e7)]+_0x595b54['length'])+_0xedcc21(0x1de));if(!_0x47d6e6)return console[_0xedcc21(0x220)]('Aborted.'),0x1;}!existsSync(_0x1a5b0d)&&mkdirSync(_0x1a5b0d,{'recursive':!![]});for(const _0x41eea4 of _0x184f4c){(_0x41eea4['isNew']||_0x41eea4[_0xedcc21(0x1f9)])&&writeFileSync(_0x41eea4[_0xedcc21(0x242)],_0x41eea4[_0xedcc21(0x1f0)],_0xedcc21(0x275));}return console[_0xedcc21(0x220)](a18_0x4f49ab['green']('β\x20Pulled\x20'+(_0x4fa970[_0xedcc21(0x1e7)]+_0x595b54['length'])+'\x20journey\x20files\x20to\x20'+_0x1a5b0d)),saveSessionContext({'parent_segment':_0x5e26a5},_0x2b8019[_0xedcc21(0x1fe)]),console[_0xedcc21(0x220)](a18_0x4f49ab[_0xedcc21(0x21a)](_0xedcc21(0x1ec)+a18_0x4f49ab[_0xedcc21(0x1f7)](_0xedcc21(0x26d))+_0xedcc21(0x1b2)+a18_0x4f49ab['cyan'](_0x5e26a5))),0x0;}}export class JourneyPushCommand extends BaseCommand{[a18_0x4b99e4(0x203)]=a18_0x4b99e4(0x20f);[a18_0x4b99e4(0x28b)]=a18_0x4b99e4(0x23e);[a18_0x4b99e4(0x213)]=new SegmentPushCommand();async[a18_0x4b99e4(0x262)](_0x3f6e07){const _0x5007ba=a18_0x4b99e4,_0x3dc2db=_0x3f6e07[_0x5007ba(0x20c)][0x0];let _0x312613;if(_0x3dc2db){const _0x4712d1=await resolveTarget({'arg':_0x3dc2db,'contextParent':_0x3f6e07[_0x5007ba(0x253)][_0x5007ba(0x22c)],'cwd':process['cwd']()});isSuccessfulResolution(_0x4712d1)&&_0x4712d1[_0x5007ba(0x1cf)]==='file'&&(_0x312613=_0x4712d1[_0x5007ba(0x285)]);}const _0x470969={..._0x3f6e07,'options':{..._0x3f6e07[_0x5007ba(0x253)],'journeysOnly':!![],..._0x312613&&{'singleFilePath':_0x312613}}};return this[_0x5007ba(0x213)][_0x5007ba(0x262)](_0x470969);}}
|
|
1
|
+
const a18_0x3a9c8b=a18_0x6f1e;(function(_0x2f2694,_0x1da2ff){const _0x35137e=a18_0x6f1e,_0x13fc83=_0x2f2694();while(!![]){try{const _0x4cbfb7=parseInt(_0x35137e(0x215))/0x1+parseInt(_0x35137e(0x1ef))/0x2+parseInt(_0x35137e(0x1f7))/0x3+parseInt(_0x35137e(0x188))/0x4*(-parseInt(_0x35137e(0x1e5))/0x5)+parseInt(_0x35137e(0x219))/0x6+-parseInt(_0x35137e(0x230))/0x7+parseInt(_0x35137e(0x190))/0x8*(-parseInt(_0x35137e(0x1cb))/0x9);if(_0x4cbfb7===_0x1da2ff)break;else _0x13fc83['push'](_0x13fc83['shift']());}catch(_0x2a1ecf){_0x13fc83['push'](_0x13fc83['shift']());}}}(a18_0x191f,0xce1a4));import a18_0x5f092b from'chalk';import a18_0x18c56a from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a18_0x6f1e(_0x397ab3,_0x529dbb){_0x397ab3=_0x397ab3-0x17b;const _0x191f23=a18_0x191f();let _0x6f1e8b=_0x191f23[_0x397ab3];return _0x6f1e8b;}import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';function a18_0x191f(){const _0x2c1ebd=['description','set','listJourneysWithFolders','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20','file','data','yes','message','targetDir','helpText','find','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20journeys','\x20changed\x20files','stages','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Resolving\x20journey...','name','conversionRate','Error:\x20Parent\x20segment\x20context\x20required','β\x20Found\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','length','options','activationParams','diff','map','journey:view','size','segment','909Xmthxb','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','/j/da','state','INVALID_ARGUMENT','type','Resume\x20a\x20paused\x20journey','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','No\x20journeys\x20found','localeCompare','\x22\x20not\x20found','Fetching\x20users\x20for\x20email\x20resolution...','blue','cwd','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Warning:\x20Could\x20not\x20resolve\x20segment\x20','root\x20folder','goalRate','getSegment','dim','parentSegment','resolveJourneyId','getParentFull','repeat','Pause\x20a\x20running\x20journey','.yml','60bsgzfW','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','folders','replace','error','verbose','then','pause','Listing\x20journeys...','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','3035282gydrUX','Listing\x20folders...','has','Resolving\x20parent\x20segment...','/j/da/je','\x20\x20Folder\x20path:\x20','green','push','403983Xrvyvv','Show\x20journey\x20details','Options:','toLowerCase','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','folderId','\x22\x20resumed','\x27\x20not\x20found\x20in\x20','log','user','relative','Fetching\x20connections\x20for\x20name\x20resolution...','journeyId','connector_config','Usage:\x20journey\x20stats\x20<name-or-path>','completed','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Aborted.','listFolders','resolveSegment','Usage:\x20journey\x20pause\x20<name-or-path>','Target\x20file:\x20','execute','Warning:\x20Stage\x20\x22','journeyName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Resuming\x20journey...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','json','Getting\x20journey\x20statistics...','690934QGSGAG','\x20Opening\x20','stageName','exited','6954660SotBcb','reentryMode','web','audienceId','Cancelled','totalGoalAchieved','totalEntered','β\x20Pulled\x20','Journey\x20name:\x20','filePath','π\x20','buildIdToNameMap','β\x20Context\x20set:\x20','site','utf-8','format','\x20(rule\x20match)','Error:\x20Journey\x20\x27','versionNumber','connection','\x20journey','resolveParentId','\x20\x20Parent\x20segment:\x20','175301FRKyxg','sort','values','/app/ps/','setPhase','attributes','folderPath','base','stringify','filter','cyan','getActivation','Folder\x20path:\x20','\x20\x20Preserving\x20local\x20segment\x20name:\x20','πΊοΈ\x20','(paused)','Resolved\x20YAML\x20file:\x20','session','(draft)','journey:stats','β\x20Journey\x20\x22','(archived)','activation_','\x20unchanged\x20files','\x20versions)','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Fetching\x20parent\x20segment...','segmentName','Export\x20journey(s)\x20as\x20YAML\x20files','journeys','β\x20All\x20files\x20are\x20up\x20to\x20date','parentName','population','stage','journey','getStatistics','(root)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x20=\x20','segmentPushCommand','Usage:\x20journey\x20resume\x20<name-or-path>','Input:\x20','isNew','Getting\x20journey\x20details...','212348EkpHMD','getJourney','no_parent','buildIdToEmailMap','journey:resume','add','\x5c$&','segments','158104dTOCmL','hasChanges','\x0aPull\x20summary:','\x20journey\x20files\x20to\x20','\x0aChanges\x20to\x20\x27','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','get','join','journeyBundleName','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20Consolidating\x20duplicate\x20segment:\x20','red','entries','/e/','rule','No\x20statistics\x20available\x20for\x20journey:\x20','Fetching\x20','List\x20journeys\x20in\x20current\x20context','...','Pausing\x20journey...','all','(running)','entered','parent_segment','resume','yellow','goal','Parent\x20segment:\x20'];a18_0x191f=function(){return _0x2c1ebd;};return a18_0x191f();}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{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function formatJourneyState(_0x2b5783){const _0x2405dd=a18_0x6f1e;switch(_0x2b5783){case'launched':return a18_0x5f092b[_0x2405dd(0x1f5)](_0x2405dd(0x1a5));case'draft':return a18_0x5f092b[_0x2405dd(0x1de)](_0x2405dd(0x242));case'paused':return a18_0x5f092b[_0x2405dd(0x1a9)](_0x2405dd(0x23f));case _0x2405dd(0x206):return a18_0x5f092b[_0x2405dd(0x1d7)]('(completed)');case'archived':return a18_0x5f092b['dim'](_0x2405dd(0x245));default:return'('+_0x2b5783+')';}}function formatJourneyItem(_0x165d63,_0x1f3a1d='',_0x198edd){const _0x3a3344=a18_0x6f1e,_0x321ed4=formatJourneyState(_0x165d63[_0x3a3344(0x1ce)]),_0x2a8bd8=_0x198edd?hyperlink(_0x165d63[_0x3a3344(0x198)],_0x198edd):_0x165d63[_0x3a3344(0x198)];return _0x1f3a1d+_0x3a3344(0x23e)+_0x2a8bd8+'\x20'+_0x321ed4;}function escapeRegex(_0x53c8a7){const _0x3b0e0d=a18_0x6f1e;return _0x53c8a7[_0x3b0e0d(0x1e8)](/[.*+?^${}()|[\]\\]/g,_0x3b0e0d(0x18e));}function globToRegex(_0x528596){const _0x1ca7c2=a18_0x6f1e,_0x26dff0=_0x528596['split']('*')[_0x1ca7c2(0x1c7)](escapeRegex);return new RegExp(_0x26dff0[_0x1ca7c2(0x197)]('.*'),'i');}function buildRuleToNameMapping(_0x168a77){const _0x24dd56=a18_0x6f1e,_0x440d51=new Map();if(_0x168a77['segments'])for(const [_0x42a04c,_0x5d944a]of Object[_0x24dd56(0x19c)](_0x168a77[_0x24dd56(0x18f)])){if(_0x5d944a[_0x24dd56(0x19e)]){const _0x639035=serializeRule(_0x5d944a['rule']),_0x2de64d=_0x440d51[_0x24dd56(0x196)](_0x639035);_0x2de64d?_0x2de64d[_0x24dd56(0x1f6)](_0x42a04c):_0x440d51[_0x24dd56(0x1ad)](_0x639035,[_0x42a04c]);}}return _0x440d51;}async function resolveJourneyTarget(_0x344068,_0xd6b680,_0x4e261b){const _0x579e29=a18_0x6f1e;if(isYamlFilePath(_0x344068))try{const _0x4a3893=await resolveYamlFilePath(_0x344068);return _0x4e261b&&(console[_0x579e29(0x1e9)](_0x579e29(0x240)+_0x344068),console['error'](_0x579e29(0x22f)+_0x4a3893[_0x579e29(0x1df)]),console['error']('\x20\x20Name:\x20'+_0x4a3893[_0x579e29(0x24b)]),console[_0x579e29(0x1e9)](_0x579e29(0x1f4)+(_0x4a3893['folderPath']||_0x579e29(0x17f)))),{'journeyName':_0x4a3893['segmentName'],'parentSegment':_0x4a3893[_0x579e29(0x1df)],'resolved':_0x4a3893};}catch(_0x3f4a6e){throw new SDKError(ErrorCode[_0x579e29(0x1cf)],_0x579e29(0x1af)+_0x3f4a6e[_0x579e29(0x1b4)]);}if(!_0xd6b680)throw new SDKError(ErrorCode[_0x579e29(0x1cf)],_0x579e29(0x1c2));return{'journeyName':_0x344068,'parentSegment':_0xd6b680};}export class JourneyListCommand extends BaseCommand{[a18_0x3a9c8b(0x1be)]='journey:list';[a18_0x3a9c8b(0x1ac)]=a18_0x3a9c8b(0x1a1);async[a18_0x3a9c8b(0x20d)](_0x288cb5){const _0x4967a5=a18_0x3a9c8b,{options:_0xb0f479,args:_0x47d40f,tdx:_0x37130e}=_0x288cb5,_0x1faf9e=_0x47d40f[0x0],_0x3b8743=_0xb0f479['parentSegment'];if(!_0x3b8743)return console[_0x4967a5(0x1e9)](_0x4967a5(0x1c0)),console['error'](_0x4967a5(0x195)),0x1;const _0x54d58c=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x37130e[_0x4967a5(0x1ca)][_0x4967a5(0x22e)](_0x3b8743),{'verbose':_0xb0f479[_0x4967a5(0x1ea)]}),_0x3e2f87=_0x54d58c[_0x4967a5(0x1b2)];_0xb0f479[_0x4967a5(0x1ea)]&&(console[_0x4967a5(0x1e9)](_0x4967a5(0x1ab)+_0x3b8743+'\x20(ID:\x20'+_0x3e2f87+')'),_0x1faf9e&&console[_0x4967a5(0x1e9)]('Pattern:\x20'+_0x1faf9e));const _0x218e1b=await withSpinner(_0x4967a5(0x24a),()=>_0x37130e[_0x4967a5(0x1ca)][_0x4967a5(0x1e1)](_0x3e2f87),{'verbose':_0xb0f479[_0x4967a5(0x1ea)]}),_0x389fe3=_0x218e1b[_0x4967a5(0x1b2)],_0x20e6d1=_0x389fe3['rootFolderId'],_0x1fd2d0=await withSpinner(_0x4967a5(0x1ed),()=>_0x37130e['journey'][_0x4967a5(0x1ae)](_0x3e2f87,_0x20e6d1),{'verbose':_0xb0f479[_0x4967a5(0x1ea)]});let _0x270775=_0x1fd2d0[_0x4967a5(0x1b2)][_0x4967a5(0x24d)];const _0x1d915d=_0x1fd2d0[_0x4967a5(0x1b2)][_0x4967a5(0x1e7)],_0x1c2858=new Map();for(const _0x598121 of _0x1d915d){_0x1c2858['set'](_0x598121['id'],_0x598121['name']);}if(_0x1faf9e){const _0x990380=globToRegex(_0x1faf9e);_0x270775=_0x270775['filter'](_0x30e37c=>_0x990380['test'](_0x30e37c[_0x4967a5(0x198)]));}console[_0x4967a5(0x1e9)](_0x4967a5(0x1c1)+_0x270775[_0x4967a5(0x1c3)]+_0x4967a5(0x22d)+(_0x270775[_0x4967a5(0x1c3)]!==0x1?'s':''));const _0x58c407=_0x550078=>{const _0x3dbdfc=_0x4967a5;return getConsoleNextUrl(_0xb0f479[_0x3dbdfc(0x226)],_0x3dbdfc(0x233)+_0x3e2f87+_0x3dbdfc(0x19d)+_0x550078+_0x3dbdfc(0x1cd));};if(_0xb0f479[_0x4967a5(0x228)]==='table')await handleSDKOutput(_0x270775,_0xb0f479);else{if(_0xb0f479[_0x4967a5(0x228)]===_0x4967a5(0x213)){const _0x5c0d3c=_0x270775['map'](_0x34245a=>({..._0x34245a,'url':_0x58c407(_0x34245a['id'])}));await handleSDKOutput(_0x5c0d3c,_0xb0f479);}else{console['log']('['+_0x3b8743+']');const _0x29875a=new Map(),_0x1c997d=[];for(const _0x177f56 of _0x270775){if(!_0x177f56[_0x4967a5(0x1fc)]||_0x177f56[_0x4967a5(0x1fc)]===_0x20e6d1)_0x1c997d[_0x4967a5(0x1f6)](_0x177f56);else{const _0x1d0a53=_0x29875a[_0x4967a5(0x196)](_0x177f56['folderId'])||[];_0x1d0a53[_0x4967a5(0x1f6)](_0x177f56),_0x29875a['set'](_0x177f56['folderId'],_0x1d0a53);}}const _0x39f4c6=(_0x380f44,_0x38c800)=>_0x380f44[_0x4967a5(0x198)][_0x4967a5(0x1d4)](_0x38c800[_0x4967a5(0x198)],undefined,{'sensitivity':'base'});_0x1c997d[_0x4967a5(0x231)](_0x39f4c6);for(const _0x4beb51 of _0x1c997d){console[_0x4967a5(0x1ff)](formatJourneyItem(_0x4beb51,'',_0x58c407(_0x4beb51['id'])));}const _0xca66fa=[..._0x29875a[_0x4967a5(0x19c)]()][_0x4967a5(0x231)]((_0x29c619,_0x354cf9)=>{const _0x822beb=_0x4967a5,_0x46c365=_0x1c2858[_0x822beb(0x196)](_0x29c619[0x0])||_0x29c619[0x0],_0x525cf8=_0x1c2858[_0x822beb(0x196)](_0x354cf9[0x0])||_0x354cf9[0x0];return _0x46c365[_0x822beb(0x1d4)](_0x525cf8,undefined,{'sensitivity':_0x822beb(0x237)});});for(const [_0x5c39ea,_0x3b454a]of _0xca66fa){const _0x11872f=_0x1c2858[_0x4967a5(0x196)](_0x5c39ea)||_0x5c39ea;console[_0x4967a5(0x1ff)](_0x4967a5(0x223)+_0x11872f),_0x3b454a['sort'](_0x39f4c6);for(const _0x1af28a of _0x3b454a){console[_0x4967a5(0x1ff)](formatJourneyItem(_0x1af28a,'\x20\x20',_0x58c407(_0x1af28a['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a18_0x3a9c8b(0x1be)]=a18_0x3a9c8b(0x1c8);['description']=a18_0x3a9c8b(0x1f8);async['execute'](_0x532248){const _0x1b03fc=a18_0x3a9c8b,{options:_0x172bdc,args:_0x14506b,tdx:_0x2c2abe}=_0x532248,_0x47e803=_0x14506b[0x0];if(!_0x47e803)return console[_0x1b03fc(0x1e9)](_0x1b03fc(0x1fb)),console['error'](_0x1b03fc(0x207)),console[_0x1b03fc(0x1e9)](_0x1b03fc(0x1f9)),console[_0x1b03fc(0x1e9)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x172bdc[_0x1b03fc(0x1ea)]&&console[_0x1b03fc(0x1e9)](_0x1b03fc(0x185)+_0x47e803);const _0x3906db=await resolveJourneyTarget(_0x47e803,_0x172bdc[_0x1b03fc(0x1df)],_0x172bdc[_0x1b03fc(0x1ea)]),_0x185ba6=await withSpinner(_0x1b03fc(0x1f2),()=>_0x2c2abe[_0x1b03fc(0x1ca)][_0x1b03fc(0x22e)](_0x3906db[_0x1b03fc(0x1df)]),{'verbose':_0x172bdc[_0x1b03fc(0x1ea)]}),_0x4a548c=_0x185ba6[_0x1b03fc(0x1b2)],_0x588345=await withSpinner(_0x1b03fc(0x1bd),()=>_0x2c2abe[_0x1b03fc(0x17d)][_0x1b03fc(0x1e0)](_0x4a548c,_0x3906db['journeyName']),{'verbose':_0x172bdc[_0x1b03fc(0x1ea)]}),_0x521df6=_0x588345[_0x1b03fc(0x1b2)];if(_0x172bdc[_0x1b03fc(0x21b)]){const _0x32a541=getConsoleNextUrl(_0x172bdc[_0x1b03fc(0x226)],'/app/ps/'+_0x4a548c+_0x1b03fc(0x19d)+_0x521df6+'/j/da/je');return console['error'](a18_0x5f092b['green']('β')+_0x1b03fc(0x216)+a18_0x5f092b[_0x1b03fc(0x23a)](_0x32a541)),openBrowser(_0x32a541),0x0;}const _0x132a0b=await withSpinner(_0x1b03fc(0x187),()=>_0x2c2abe[_0x1b03fc(0x17d)][_0x1b03fc(0x189)](_0x521df6),{'verbose':_0x172bdc[_0x1b03fc(0x1ea)]}),_0x3c507d=_0x132a0b[_0x1b03fc(0x1b2)],_0x167550=_0x172bdc['includeStats'];let _0x422644;if(_0x167550)try{const _0x3cbc5c=await withSpinner(_0x1b03fc(0x214),()=>_0x2c2abe[_0x1b03fc(0x17d)][_0x1b03fc(0x17e)](_0x521df6),{'verbose':_0x172bdc[_0x1b03fc(0x1ea)]});_0x422644=_0x3cbc5c[_0x1b03fc(0x1b2)];}catch{_0x172bdc[_0x1b03fc(0x1ea)]&&console[_0x1b03fc(0x1e9)]('\x20\x20Statistics\x20not\x20available');}const _0x1bbafe=getConsoleNextUrl(_0x172bdc[_0x1b03fc(0x226)],'/app/ps/'+_0x4a548c+_0x1b03fc(0x19d)+_0x521df6+_0x1b03fc(0x1f3)),_0x200337={'id':_0x3c507d['id'],'name':_0x3c507d[_0x1b03fc(0x235)][_0x1b03fc(0x1be)],'description':_0x3c507d['attributes'][_0x1b03fc(0x1ac)],'state':_0x3c507d[_0x1b03fc(0x235)][_0x1b03fc(0x1ce)],'paused':_0x3c507d[_0x1b03fc(0x235)]['paused'],'reentry_mode':_0x3c507d[_0x1b03fc(0x235)][_0x1b03fc(0x21a)],'stages':_0x3c507d[_0x1b03fc(0x235)]['journeyStages']?.[_0x1b03fc(0x1c3)]||0x0,..._0x3c507d['attributes']['goal']&&{'goal':_0x3c507d[_0x1b03fc(0x235)][_0x1b03fc(0x1aa)][_0x1b03fc(0x1be)]},..._0x422644&&{'statistics':{'total_entered':_0x422644['totalEntered'],'goal_achieved':_0x422644[_0x1b03fc(0x21e)],'goal_rate':_0x422644['goalRate'],'stages':_0x422644[_0x1b03fc(0x1bb)]}},'url':_0x1bbafe};return await handleSingleObjectOutput(_0x200337,_0x172bdc),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x3a9c8b(0x1be)]=a18_0x3a9c8b(0x243);[a18_0x3a9c8b(0x1ac)]='Show\x20journey\x20statistics';async['execute'](_0x15c0d7){const _0x343f6b=a18_0x3a9c8b,{options:_0x2f702b,args:_0x5a1039,tdx:_0xf74a72}=_0x15c0d7,_0x5638bc=_0x5a1039[0x0];if(!_0x5638bc)return console[_0x343f6b(0x1e9)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x343f6b(0x205)),0x1;_0x2f702b[_0x343f6b(0x1ea)]&&console['error']('Input:\x20'+_0x5638bc);const _0x14780a=await resolveJourneyTarget(_0x5638bc,_0x2f702b[_0x343f6b(0x1df)],_0x2f702b[_0x343f6b(0x1ea)]),_0xb6b8ae=await withSpinner(_0x343f6b(0x1f2),()=>_0xf74a72[_0x343f6b(0x1ca)][_0x343f6b(0x22e)](_0x14780a[_0x343f6b(0x1df)]),{'verbose':_0x2f702b[_0x343f6b(0x1ea)]}),_0x2f3671=_0xb6b8ae[_0x343f6b(0x1b2)],_0x9e6ab0=await withSpinner(_0x343f6b(0x1bd),()=>_0xf74a72[_0x343f6b(0x17d)][_0x343f6b(0x1e0)](_0x2f3671,_0x14780a[_0x343f6b(0x20f)]),{'verbose':_0x2f702b[_0x343f6b(0x1ea)]}),_0x47a03b=_0x9e6ab0[_0x343f6b(0x1b2)],_0x22f7c2=await withSpinner('Getting\x20journey\x20statistics...',()=>_0xf74a72[_0x343f6b(0x17d)][_0x343f6b(0x17e)](_0x47a03b),{'verbose':_0x2f702b['verbose']}),_0x5317f2=_0x22f7c2[_0x343f6b(0x1b2)];if(!_0x5317f2||_0x5317f2[_0x343f6b(0x203)]===null)return console[_0x343f6b(0x1e9)](_0x343f6b(0x19f)+_0x14780a[_0x343f6b(0x20f)]),console[_0x343f6b(0x1e9)](_0x343f6b(0x1d9)),0x0;const _0x21cfbd={'journey_id':_0x5317f2[_0x343f6b(0x203)],'total_entered':_0x5317f2[_0x343f6b(0x21f)],'goal_achieved':_0x5317f2[_0x343f6b(0x21e)],'goal_rate':_0x5317f2[_0x343f6b(0x1dc)],'stages':_0x5317f2[_0x343f6b(0x1bb)]?.[_0x343f6b(0x1c7)](_0xe91cf7=>({'name':_0xe91cf7[_0x343f6b(0x217)],'population':_0xe91cf7[_0x343f6b(0x17b)],'entered':_0xe91cf7['entered'],'exited':_0xe91cf7[_0x343f6b(0x218)],'conversion_rate':_0xe91cf7[_0x343f6b(0x1bf)]}))},_0x27f6c2=_0x2f702b[_0x343f6b(0x17c)];if(_0x27f6c2&&_0x5317f2[_0x343f6b(0x1bb)]){const _0x4f94e8=_0x5317f2[_0x343f6b(0x1bb)][_0x343f6b(0x1b7)](_0x463831=>_0x463831[_0x343f6b(0x217)][_0x343f6b(0x1fa)]()===_0x27f6c2[_0x343f6b(0x1fa)]());if(_0x4f94e8)return await handleSingleObjectOutput({'stage_name':_0x4f94e8[_0x343f6b(0x217)],'population':_0x4f94e8[_0x343f6b(0x17b)],'entered':_0x4f94e8[_0x343f6b(0x1a6)],'exited':_0x4f94e8[_0x343f6b(0x218)],'conversion_rate':_0x4f94e8[_0x343f6b(0x1bf)]},_0x2f702b),0x0;console[_0x343f6b(0x1e9)](_0x343f6b(0x20e)+_0x27f6c2+_0x343f6b(0x1d5));}return await handleSingleObjectOutput(_0x21cfbd,_0x2f702b),0x0;}}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';['description']=a18_0x3a9c8b(0x1e3);async[a18_0x3a9c8b(0x20d)](_0x1fdbaa){const _0x5c27f8=a18_0x3a9c8b,{options:_0x1f009a,args:_0x554ad2,tdx:_0x4f3359}=_0x1fdbaa,_0x496eaf=_0x554ad2[0x0];if(!_0x496eaf)return console[_0x5c27f8(0x1e9)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x5c27f8(0x1e9)](_0x5c27f8(0x20b)),0x1;_0x1f009a['verbose']&&console[_0x5c27f8(0x1e9)]('Input:\x20'+_0x496eaf);const _0x272052=await resolveJourneyTarget(_0x496eaf,_0x1f009a[_0x5c27f8(0x1df)],_0x1f009a[_0x5c27f8(0x1ea)]),_0x58ce5e=await withSpinner(_0x5c27f8(0x1f2),()=>_0x4f3359[_0x5c27f8(0x1ca)]['resolveParentId'](_0x272052[_0x5c27f8(0x1df)]),{'verbose':_0x1f009a[_0x5c27f8(0x1ea)]}),_0x39dc36=_0x58ce5e['data'],_0x38c6c3=await withSpinner(_0x5c27f8(0x1bd),()=>_0x4f3359[_0x5c27f8(0x17d)][_0x5c27f8(0x1e0)](_0x39dc36,_0x272052[_0x5c27f8(0x20f)]),{'verbose':_0x1f009a['verbose']}),_0x5315e3=_0x38c6c3[_0x5c27f8(0x1b2)];if(!_0x1f009a[_0x5c27f8(0x1b3)]){const _0x2b27af=await confirm(_0x5c27f8(0x1cc)+_0x272052['journeyName']+'\x22?');if(!_0x2b27af)return console['error'](_0x5c27f8(0x21d)),0x0;}const _0x5a5de5=await withSpinner(_0x5c27f8(0x1a3),()=>_0x4f3359['journey'][_0x5c27f8(0x1ec)](_0x5315e3),{'verbose':_0x1f009a['verbose']}),_0x16ef98=_0x5a5de5['data'];return console['error'](_0x5c27f8(0x244)+_0x16ef98['attributes']['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x3a9c8b(0x1be)]=a18_0x3a9c8b(0x18c);[a18_0x3a9c8b(0x1ac)]=a18_0x3a9c8b(0x1d1);async[a18_0x3a9c8b(0x20d)](_0x43b064){const _0x7b767b=a18_0x3a9c8b,{options:_0x5c6ddf,args:_0x219acf,tdx:_0x13dfdf}=_0x43b064,_0x2221b3=_0x219acf[0x0];if(!_0x2221b3)return console[_0x7b767b(0x1e9)](_0x7b767b(0x1fb)),console[_0x7b767b(0x1e9)](_0x7b767b(0x184)),0x1;_0x5c6ddf[_0x7b767b(0x1ea)]&&console[_0x7b767b(0x1e9)](_0x7b767b(0x185)+_0x2221b3);const _0x3fb9ad=await resolveJourneyTarget(_0x2221b3,_0x5c6ddf[_0x7b767b(0x1df)],_0x5c6ddf['verbose']),_0x4c74f2=await withSpinner(_0x7b767b(0x1f2),()=>_0x13dfdf[_0x7b767b(0x1ca)]['resolveParentId'](_0x3fb9ad[_0x7b767b(0x1df)]),{'verbose':_0x5c6ddf[_0x7b767b(0x1ea)]}),_0x35f139=_0x4c74f2[_0x7b767b(0x1b2)],_0x3b4212=await withSpinner(_0x7b767b(0x1bd),()=>_0x13dfdf[_0x7b767b(0x17d)][_0x7b767b(0x1e0)](_0x35f139,_0x3fb9ad[_0x7b767b(0x20f)]),{'verbose':_0x5c6ddf[_0x7b767b(0x1ea)]}),_0x18d5ba=_0x3b4212[_0x7b767b(0x1b2)];if(!_0x5c6ddf[_0x7b767b(0x1b3)]){const _0x14c36c=await confirm(_0x7b767b(0x181)+_0x3fb9ad[_0x7b767b(0x20f)]+'\x22?');if(!_0x14c36c)return console['error'](_0x7b767b(0x21d)),0x0;}const _0x1e1f10=await withSpinner(_0x7b767b(0x211),()=>_0x13dfdf[_0x7b767b(0x17d)][_0x7b767b(0x1a8)](_0x18d5ba),{'verbose':_0x5c6ddf[_0x7b767b(0x1ea)]}),_0x46345f=_0x1e1f10['data'];return console['error']('β\x20Journey\x20\x22'+_0x46345f['attributes'][_0x7b767b(0x1be)]+_0x7b767b(0x1fd)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']='journey:pull';[a18_0x3a9c8b(0x1ac)]=a18_0x3a9c8b(0x24c);async[a18_0x3a9c8b(0x20d)](_0x58b6e2){const _0x26dcd8=a18_0x3a9c8b,{options:_0x2fa8ca,args:_0x42d13e,tdx:_0x1af7bd}=_0x58b6e2,_0x286377=_0x2fa8ca,_0x13cd24=_0x42d13e[0x0],_0x9334=_0x13cd24&&isYamlFilePath(_0x13cd24),_0x4996b4=await resolveTarget({'arg':_0x9334?_0x13cd24:undefined,'contextParent':_0x2fa8ca[_0x26dcd8(0x1df)],'cwd':process[_0x26dcd8(0x1d8)]()});if(!isSuccessfulResolution(_0x4996b4))return _0x4996b4['errorCode']===_0x26dcd8(0x18a)?(console[_0x26dcd8(0x1e9)](a18_0x5f092b[_0x26dcd8(0x1a9)](_0x26dcd8(0x1b8))),console['error']('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x26dcd8(0x1e9)](_0x26dcd8(0x180)),console['error'](_0x26dcd8(0x212)),console[_0x26dcd8(0x1e9)](_0x26dcd8(0x199))):(console['error'](a18_0x5f092b[_0x26dcd8(0x19b)](_0x26dcd8(0x1b0)+_0x4996b4[_0x26dcd8(0x1b4)]+'\x0a')),_0x4996b4[_0x26dcd8(0x1b6)]&&console['error'](a18_0x5f092b['cyan'](_0x4996b4['helpText']))),0x1;let _0x18b373=_0x9334?undefined:_0x13cd24,_0x3ea96f,_0x4d2e10;_0x4996b4[_0x26dcd8(0x1d0)]==='file'&&(_0x18b373=_0x4996b4['resourceName'],_0x3ea96f=_0x4996b4[_0x26dcd8(0x222)],_0x4d2e10=_0x4996b4[_0x26dcd8(0x236)]);const _0x4a803f=_0x4996b4[_0x26dcd8(0x24f)],_0xe7aecb=_0x4996b4[_0x26dcd8(0x1b5)];_0x286377[_0x26dcd8(0x1ea)]&&(console['error'](_0x26dcd8(0x1ab)+_0x4a803f),console['error']('Target\x20directory:\x20'+_0xe7aecb),_0x18b373&&console[_0x26dcd8(0x1e9)](_0x26dcd8(0x221)+_0x18b373),_0x3ea96f&&console[_0x26dcd8(0x1e9)](_0x26dcd8(0x20c)+_0x3ea96f),_0x4d2e10&&console[_0x26dcd8(0x1e9)](_0x26dcd8(0x23c)+_0x4d2e10));const _0x62e191=await withSpinner(_0x26dcd8(0x1f2),()=>_0x1af7bd[_0x26dcd8(0x1ca)][_0x26dcd8(0x22e)](_0x4a803f),{'verbose':_0x2fa8ca[_0x26dcd8(0x1ea)]}),_0x3547fa=_0x62e191[_0x26dcd8(0x1b2)],[_0x45f446,_0x404e5f]=await Promise['all']([withSpinner(_0x26dcd8(0x1ed),()=>_0x1af7bd[_0x26dcd8(0x17d)]['listJourneysFromParentSegment'](_0x3547fa,undefined,{'includeAllVersions':!![]}),{'verbose':_0x2fa8ca[_0x26dcd8(0x1ea)]}),withSpinner(_0x26dcd8(0x1f0),()=>_0x1af7bd[_0x26dcd8(0x1ca)][_0x26dcd8(0x209)](_0x3547fa),{'verbose':_0x2fa8ca[_0x26dcd8(0x1ea)]})]);let _0x49e8a2=_0x45f446[_0x26dcd8(0x1b2)];const _0x320ef4=_0x404e5f['data'],_0x23424c=buildFolderIdToPathMap(_0x320ef4);if(_0x18b373){const _0x3dbab7=_0x49e8a2[_0x26dcd8(0x239)](_0x236454=>_0x236454[_0x26dcd8(0x198)][_0x26dcd8(0x1fa)]()===_0x18b373[_0x26dcd8(0x1fa)]());if(_0x3dbab7[_0x26dcd8(0x1c3)]===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x18b373),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x49e8a2=_0x3dbab7;}if(_0x4d2e10!==undefined){const _0x45e680=_0x49e8a2[_0x26dcd8(0x239)](_0x479193=>{const _0x319047=_0x26dcd8,_0x19412f=_0x479193[_0x319047(0x1fc)]?_0x23424c['get'](_0x479193[_0x319047(0x1fc)])||'':'';return _0x19412f===_0x4d2e10;});if(_0x45e680[_0x26dcd8(0x1c3)]===0x0&&_0x49e8a2[_0x26dcd8(0x1c3)]>0x0){console['error'](_0x26dcd8(0x22a)+_0x18b373+_0x26dcd8(0x1fe)+(_0x4d2e10||_0x26dcd8(0x1db))),console[_0x26dcd8(0x1e9)](_0x26dcd8(0x1e6));for(const _0x42ff8a of _0x49e8a2){const _0x5691ef=_0x42ff8a[_0x26dcd8(0x1fc)]?_0x23424c[_0x26dcd8(0x196)](_0x42ff8a[_0x26dcd8(0x1fc)])||'':'';console['error']('\x20\x20-\x20'+(_0x5691ef||'(root)')+'/'+_0x42ff8a[_0x26dcd8(0x198)]);}return 0x1;}_0x49e8a2=_0x45e680;}if(_0x49e8a2['length']===0x0)return console[_0x26dcd8(0x1e9)](_0x26dcd8(0x1d3)),0x0;const _0x763ad4=new Map();for(const _0x332e64 of _0x49e8a2){const _0x10aed8=_0x332e64['journeyBundleId'];!_0x763ad4[_0x26dcd8(0x1f1)](_0x10aed8)&&_0x763ad4[_0x26dcd8(0x1ad)](_0x10aed8,[]),_0x763ad4['get'](_0x10aed8)['push'](_0x332e64);}for(const _0x26077e of _0x763ad4[_0x26dcd8(0x232)]()){_0x26077e['sort']((_0x22a4f0,_0x713ca3)=>(_0x22a4f0[_0x26dcd8(0x22b)]||0x0)-(_0x713ca3['versionNumber']||0x0));}const _0x598805=[],[_0x4c342c,_0x2d1574]=await Promise[_0x26dcd8(0x1a4)]([withSpinner(_0x26dcd8(0x1d6),()=>_0x1af7bd[_0x26dcd8(0x200)][_0x26dcd8(0x18b)](),{'verbose':_0x2fa8ca[_0x26dcd8(0x1ea)]})[_0x26dcd8(0x1eb)](_0x4fab96=>_0x4fab96[_0x26dcd8(0x1b2)]),withSpinner(_0x26dcd8(0x202),()=>_0x1af7bd[_0x26dcd8(0x22c)][_0x26dcd8(0x224)](),{'verbose':_0x2fa8ca['verbose']})[_0x26dcd8(0x1eb)](_0x541f59=>_0x541f59[_0x26dcd8(0x1b2)])]);for(const _0x340a45 of _0x763ad4[_0x26dcd8(0x232)]()){const _0x483bdf=_0x340a45[0x0]['journeyBundleName'],_0x203121=_0x340a45[0x0]['folderId'],_0x4c373b=_0x203121?_0x23424c[_0x26dcd8(0x196)](_0x203121)||'':'',_0x81ce91=_0x4c373b?a18_0x18c56a[_0x26dcd8(0x197)](_0xe7aecb,_0x4c373b):_0xe7aecb,_0x19fa19=_0x3ea96f||a18_0x18c56a[_0x26dcd8(0x197)](_0x81ce91,sanitizeFileName(_0x483bdf)+_0x26dcd8(0x1e4));let _0x206d06,_0x260505;if(existsSync(_0x19fa19))try{const _0x1d055c=readFileSync(_0x19fa19,'utf-8'),_0x4c0e07=parseYamlString(_0x1d055c);_0x260505=_0x4c0e07,_0x206d06=buildRuleToNameMapping(_0x4c0e07),_0x286377[_0x26dcd8(0x1ea)]&&_0x206d06[_0x26dcd8(0x1c9)]>0x0&&console[_0x26dcd8(0x1e9)]('Found\x20'+_0x206d06[_0x26dcd8(0x1c9)]+_0x26dcd8(0x1d2)+_0x483bdf);}catch(_0x1fc871){_0x286377[_0x26dcd8(0x1ea)]&&console['error'](_0x26dcd8(0x249)+_0x1fc871[_0x26dcd8(0x1b4)]);}const _0x1b83d3=[],_0x1daae3=new Set(),_0x4af4e9=new Map(),_0x2cf350=new Map(),_0x4142c9=new Set(),_0x33a6c6=new Map(),_0x2f9438=new Map(),_0x4a9c71=createJumpTargetCache();await withProgressSpinner(_0x26dcd8(0x1a0)+_0x483bdf+_0x26dcd8(0x1a2),async _0x306063=>{const _0x3c3e02=_0x26dcd8;for(const _0x2cc2fc of _0x340a45){const _0x3dc1f7=_0x340a45[_0x3c3e02(0x1c3)]>0x1?_0x2cc2fc[_0x3c3e02(0x198)]+'\x20v'+(_0x2cc2fc[_0x3c3e02(0x22b)]||0x1):_0x2cc2fc[_0x3c3e02(0x198)];_0x306063[_0x3c3e02(0x234)]('Fetching\x20'+_0x3dc1f7);const _0x3ae739=await _0x1af7bd['journey'][_0x3c3e02(0x189)](_0x2cc2fc['id']),_0x458339=_0x3ae739['attributes']?.[_0x3c3e02(0x21c)],_0x56414f={'resolveSegment':async _0x288521=>{const _0x148984=_0x3c3e02;if(!_0x458339)return{'name':_0x288521,'isJourneyLocal':![]};const _0x1e887c=_0x4af4e9[_0x148984(0x196)](_0x288521);if(_0x1e887c)return _0x1e887c;try{const _0x34ac04=await _0x1af7bd[_0x148984(0x1ca)][_0x148984(0x1dd)](_0x458339,_0x288521),_0x53bf67=_0x34ac04['kind']===SEGMENT_KIND_JOURNEY;let _0x3e6d12,_0x28e3a4=_0x34ac04[_0x148984(0x1be)];if(_0x53bf67&&_0x34ac04[_0x148984(0x19e)]){const _0xe28e3=await segmentResponseToDef(_0x34ac04,{'resolveSegmentName':async _0x34a689=>{const _0x3de744=_0x148984,_0x121dbf=_0x4af4e9[_0x3de744(0x196)](_0x34a689);if(_0x121dbf)return _0x121dbf[_0x3de744(0x1be)];const _0x37773e=await _0x56414f[_0x3de744(0x20a)](_0x34a689);return _0x37773e[_0x3de744(0x1be)];}}),_0x2df256=_0xe28e3['rule'];_0x3e6d12={'description':_0x34ac04['description'],'rule':_0x2df256};const _0x2ada23=serializeRule(_0x2df256),_0x57e9ca=_0x2cf350['get'](_0x2ada23);if(_0x57e9ca)_0x28e3a4=_0x57e9ca,_0x3e6d12=undefined,_0x286377[_0x148984(0x1ea)]&&console[_0x148984(0x1e9)](_0x148984(0x19a)+_0x34ac04[_0x148984(0x1be)]+'\x20->\x20'+_0x57e9ca);else{let _0x3c1a07=![];if(_0x206d06){const _0xb0451d=_0x206d06[_0x148984(0x196)](_0x2ada23);if(_0xb0451d){const _0xe40d2a=_0xb0451d[_0x148984(0x1b7)](_0x401bdb=>!_0x1daae3['has'](_0x401bdb));_0xe40d2a&&(_0x28e3a4=_0xe40d2a,_0x1daae3['add'](_0xe40d2a),_0x2cf350['set'](_0x2ada23,_0xe40d2a),_0x3c1a07=!![],_0x286377[_0x148984(0x1ea)]&&console[_0x148984(0x1e9)](_0x148984(0x23d)+_0xe40d2a+_0x148984(0x229)));}}if(!_0x3c1a07){const _0x22a0e8=generateJourneyLocalName(_0x34ac04['name']);_0x22a0e8&&(_0x28e3a4=_0x22a0e8);let _0x135bec=_0x28e3a4,_0x324aee=0x2;while(_0x1daae3[_0x148984(0x1f1)](_0x135bec)){_0x135bec=_0x28e3a4+'_'+_0x324aee,_0x324aee++;}_0x1daae3[_0x148984(0x18d)](_0x135bec),_0x2cf350[_0x148984(0x1ad)](_0x2ada23,_0x135bec),_0x28e3a4=_0x135bec;}}}const _0x31c075={'name':_0x28e3a4,'isJourneyLocal':_0x53bf67,'definition':_0x3e6d12};return _0x4af4e9[_0x148984(0x1ad)](_0x288521,_0x31c075),_0x31c075;}catch(_0x593e8f){return _0x2fa8ca[_0x148984(0x1ea)]&&console[_0x148984(0x1e9)](_0x148984(0x1da)+_0x288521+':\x20'+_0x593e8f['message']),{'name':_0x288521,'isJourneyLocal':![]};}},'resolveActivation':async _0x5d7a7c=>{const _0x2e7db4=_0x3c3e02,_0x5c46f0=_0x33a6c6[_0x2e7db4(0x196)](_0x5d7a7c);if(_0x5c46f0)return _0x5c46f0;try{const _0x593f74=await _0x1af7bd[_0x2e7db4(0x17d)][_0x2e7db4(0x23b)](_0x2cc2fc['id'],_0x5d7a7c),_0x2a8098=journeyActivationStepToYaml(_0x593f74,_0x4c342c,_0x2d1574),_0x5973bb=JSON[_0x2e7db4(0x238)]({'name':_0x2a8098[_0x2e7db4(0x1be)],'connection':_0x2a8098[_0x2e7db4(0x22c)],'connector_config':_0x2a8098[_0x2e7db4(0x204)]}),_0x3157d2=_0x2f9438[_0x2e7db4(0x196)](_0x5973bb);if(_0x3157d2){const _0x3df193={'name':_0x3157d2,'isJourneyLocal':!![],'definition':_0x2a8098};return _0x33a6c6[_0x2e7db4(0x1ad)](_0x5d7a7c,_0x3df193),_0x3df193;}const _0x1baa1f=_0x593f74[_0x2e7db4(0x235)][_0x2e7db4(0x1c5)][_0x2e7db4(0x1be)]||_0x5d7a7c,_0x29ac16=sanitizeYamlKey(_0x1baa1f)||_0x2e7db4(0x246)+_0x5d7a7c;let _0x1a0981=_0x29ac16,_0x3c0152=0x2;while(_0x4142c9['has'](_0x1a0981)){_0x1a0981=_0x29ac16+'_'+_0x3c0152,_0x3c0152++;}_0x4142c9[_0x2e7db4(0x18d)](_0x1a0981),_0x2f9438[_0x2e7db4(0x1ad)](_0x5973bb,_0x1a0981);const _0x43f642={'name':_0x1a0981,'isJourneyLocal':!![],'definition':_0x2a8098};return _0x33a6c6[_0x2e7db4(0x1ad)](_0x5d7a7c,_0x43f642),_0x43f642;}catch(_0x4fcdb0){return _0x2fa8ca[_0x2e7db4(0x1ea)]&&console[_0x2e7db4(0x1e9)](_0x2e7db4(0x1bc)+_0x5d7a7c+':\x20'+_0x4fcdb0[_0x2e7db4(0x1b4)]),{'name':_0x5d7a7c,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x262d1a,_0x1d6b42)=>{const _0x5e052a=_0x3c3e02;return resolveJumpTarget(_0x262d1a,_0x1d6b42,_0x4a9c71,_0x2a7abd=>_0x1af7bd['journey'][_0x5e052a(0x189)](_0x2a7abd));}},_0x3f47d2=await journeyResponseToDef(_0x3ae739,_0x56414f);_0x1b83d3['push']({'item':_0x2cc2fc,'yaml':_0x3f47d2});}},{'verbose':_0x2fa8ca[_0x26dcd8(0x1ea)]});const _0x12b855=buildMergedJourneyDef(_0x1b83d3,_0x206d06),_0x4dea29=normalizeJourneyDef(_0x12b855,_0x260505),_0x4e1753=toYamlString(_0x4dea29),_0x5b3996=_0x3ea96f||a18_0x18c56a[_0x26dcd8(0x197)](_0x81ce91,sanitizeFileName(_0x483bdf)+'.yml');!_0x3ea96f&&_0x4c373b&&!existsSync(_0x81ce91)&&mkdirSync(_0x81ce91,{'recursive':!![]});const _0xb78a60=a18_0x18c56a[_0x26dcd8(0x201)](process[_0x26dcd8(0x1d8)](),_0x5b3996);if(existsSync(_0x5b3996)){const _0x1429d2=readFileSync(_0x5b3996,'utf-8'),_0x5d4261=generateDiff(_0x1429d2,_0x4e1753),_0x3ec9f7=hasChanges(_0x5d4261);_0x598805['push']({'relativePath':_0xb78a60,'absolutePath':_0x5b3996,'content':_0x4e1753,'isNew':![],'hasChanges':_0x3ec9f7,'diff':_0x3ec9f7?formatDiffWithColors(_0x5d4261):undefined});}else _0x598805[_0x26dcd8(0x1f6)]({'relativePath':_0xb78a60,'absolutePath':_0x5b3996,'content':_0x4e1753,'isNew':!![],'hasChanges':![]});}const _0x4603a6=_0x598805[_0x26dcd8(0x239)](_0x540f1c=>_0x540f1c[_0x26dcd8(0x186)]),_0x136bac=_0x598805['filter'](_0x499c3c=>!_0x499c3c[_0x26dcd8(0x186)]&&_0x499c3c[_0x26dcd8(0x191)]),_0x5f0bdb=_0x598805[_0x26dcd8(0x239)](_0x19d003=>!_0x19d003[_0x26dcd8(0x186)]&&!_0x19d003['hasChanges']),_0x966ef0=_0x49e8a2[_0x26dcd8(0x1c3)],_0x197198=_0x763ad4[_0x26dcd8(0x1c9)],_0x1503b0=_0x966ef0>_0x197198?'\x20('+_0x966ef0+_0x26dcd8(0x248):'';console['error'](_0x26dcd8(0x192)),console[_0x26dcd8(0x1e9)]('\x20\x20'+a18_0x5f092b[_0x26dcd8(0x23a)](_0x197198+_0x26dcd8(0x1b9))+a18_0x5f092b[_0x26dcd8(0x1de)](_0x1503b0)),console[_0x26dcd8(0x1e9)]('\x20\x20'+a18_0x5f092b[_0x26dcd8(0x1f5)]('+\x20'+_0x4603a6[_0x26dcd8(0x1c3)]+'\x20new\x20files')),console[_0x26dcd8(0x1e9)]('\x20\x20'+a18_0x5f092b[_0x26dcd8(0x1a9)]('~\x20'+_0x136bac[_0x26dcd8(0x1c3)]+_0x26dcd8(0x1ba))),console[_0x26dcd8(0x1e9)]('\x20\x20'+a18_0x5f092b['dim']('=\x20'+_0x5f0bdb[_0x26dcd8(0x1c3)]+_0x26dcd8(0x247))),console[_0x26dcd8(0x1e9)]('\x20\x20Target:\x20'+a18_0x5f092b['cyan'](_0xe7aecb)+'\x0a');if(_0x136bac['length']>0x0)for(const _0x5b3a72 of _0x136bac){console[_0x26dcd8(0x1e9)](_0x26dcd8(0x194)+_0x5b3a72['relativePath']+'\x27:'),console[_0x26dcd8(0x1e9)]('β'[_0x26dcd8(0x1e2)](0x3c)),console[_0x26dcd8(0x1e9)](_0x5b3a72[_0x26dcd8(0x1c6)]),console[_0x26dcd8(0x1e9)]('β'[_0x26dcd8(0x1e2)](0x3c));}if(_0x286377['dryRun'])return console[_0x26dcd8(0x1e9)](a18_0x5f092b[_0x26dcd8(0x1a9)](_0x26dcd8(0x210))),0x0;if(_0x4603a6[_0x26dcd8(0x1c3)]===0x0&&_0x136bac[_0x26dcd8(0x1c3)]===0x0)return console['error'](a18_0x5f092b[_0x26dcd8(0x1f5)](_0x26dcd8(0x24e))),saveSessionContext({'parent_segment':_0x4a803f},_0x286377['session']),console[_0x26dcd8(0x1e9)](a18_0x5f092b[_0x26dcd8(0x1f5)](_0x26dcd8(0x225)+a18_0x5f092b[_0x26dcd8(0x1de)](_0x26dcd8(0x1a7))+_0x26dcd8(0x182)+a18_0x5f092b[_0x26dcd8(0x23a)](_0x4a803f))),0x0;if(!_0x286377[_0x26dcd8(0x1b3)]&&(_0x4603a6[_0x26dcd8(0x1c3)]>0x0||_0x136bac[_0x26dcd8(0x1c3)]>0x0)){const _0x4e7f02=await confirmKey('Write\x20'+(_0x4603a6[_0x26dcd8(0x1c3)]+_0x136bac[_0x26dcd8(0x1c3)])+'\x20files?');if(!_0x4e7f02)return console[_0x26dcd8(0x1e9)](_0x26dcd8(0x208)),0x1;}!existsSync(_0xe7aecb)&&mkdirSync(_0xe7aecb,{'recursive':!![]});for(const _0x31756d of _0x598805){(_0x31756d['isNew']||_0x31756d['hasChanges'])&&writeFileSync(_0x31756d['absolutePath'],_0x31756d['content'],_0x26dcd8(0x227));}return console[_0x26dcd8(0x1e9)](a18_0x5f092b[_0x26dcd8(0x1f5)](_0x26dcd8(0x220)+(_0x4603a6[_0x26dcd8(0x1c3)]+_0x136bac[_0x26dcd8(0x1c3)])+_0x26dcd8(0x193)+_0xe7aecb)),saveSessionContext({'parent_segment':_0x4a803f},_0x286377[_0x26dcd8(0x241)]),console[_0x26dcd8(0x1e9)](a18_0x5f092b[_0x26dcd8(0x1f5)]('β\x20Context\x20set:\x20'+a18_0x5f092b[_0x26dcd8(0x1de)](_0x26dcd8(0x1a7))+_0x26dcd8(0x182)+a18_0x5f092b[_0x26dcd8(0x23a)](_0x4a803f))),0x0;}}export class JourneyPushCommand extends BaseCommand{[a18_0x3a9c8b(0x1be)]='journey:push';['description']=a18_0x3a9c8b(0x1ee);[a18_0x3a9c8b(0x183)]=new SegmentPushCommand();async[a18_0x3a9c8b(0x20d)](_0x555476){const _0x172c9c=a18_0x3a9c8b,_0x247784=_0x555476['args'][0x0];let _0x25a375;if(_0x247784){const _0x23a1bd=await resolveTarget({'arg':_0x247784,'contextParent':_0x555476[_0x172c9c(0x1c4)]['parentSegment'],'cwd':process[_0x172c9c(0x1d8)]()});isSuccessfulResolution(_0x23a1bd)&&_0x23a1bd['type']===_0x172c9c(0x1b1)&&(_0x25a375=_0x23a1bd[_0x172c9c(0x222)]);}const _0x5dd19c={..._0x555476,'options':{..._0x555476[_0x172c9c(0x1c4)],'journeysOnly':!![],..._0x25a375&&{'singleFilePath':_0x25a375}}};return this[_0x172c9c(0x183)]['execute'](_0x5dd19c);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x4178c6=a19_0xc554;(function(_0x54f3c8,_0x244d15){const _0x19e9e8=a19_0xc554,_0x5f0edc=_0x54f3c8();while(!![]){try{const _0x1ab446=-parseInt(_0x19e9e8(0x10b))/0x1+-parseInt(_0x19e9e8(0x108))/0x2*(-parseInt(_0x19e9e8(0x127))/0x3)+-parseInt(_0x19e9e8(0x102))/0x4*(parseInt(_0x19e9e8(0x111))/0x5)+parseInt(_0x19e9e8(0x104))/0x6*(parseInt(_0x19e9e8(0x12d))/0x7)+parseInt(_0x19e9e8(0xfe))/0x8+parseInt(_0x19e9e8(0xff))/0x9+parseInt(_0x19e9e8(0x121))/0xa;if(_0x1ab446===_0x244d15)break;else _0x5f0edc['push'](_0x5f0edc['shift']());}catch(_0x4a150d){_0x5f0edc['push'](_0x5f0edc['shift']());}}}(a19_0x4e5f,0xed555));import{BaseCommand}from'./command.js';function a19_0xc554(_0x1dc3a4,_0x1c5536){_0x1dc3a4=_0x1dc3a4-0xfe;const _0x4e5fab=a19_0x4e5f();let _0xc5545=_0x4e5fab[_0x1dc3a4];return _0xc5545;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a19_0x22efc5 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a19_0x4e5f(){const _0x524d3a=['cyan','journey:validate','log','type','green','285QPthjz','warnings','validCount','skippedCount','.yml','\x20segment\x20file(s)\x20skipped','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','relativePath','β\x20All\x20','\x20journey(s)\x20with\x20errors,\x20','verbose','\x20journey(s)\x20valid','reason','\x20warning(s)','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','30111290LMmoQx','name','journey','invalidCount','No\x20journey\x20YAML\x20files\x20found\x20in\x20','helpText','3bBeBdy','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','description','targetDir','length','226639BFRQWq','warningCount','red','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','dim','execute','filter','.yaml','hasErrors','\x20valid','1745856XqFcVI','462780zoeKOP','valid','no_parent','127436kgwRDx','Validation\x20failed:\x20','48WJbOXw','\x20(skipped:\x20','error','yellow','1816606jFKHVj','filePath','Error:\x20Directory\x20not\x20found:\x20','1660020MKyuFz'];a19_0x4e5f=function(){return _0x524d3a;};return a19_0x4e5f();}export class JourneyValidateCommand extends BaseCommand{[a19_0x4178c6(0x122)]=a19_0x4178c6(0x10d);[a19_0x4178c6(0x12a)]='Validate\x20journey\x20YAML\x20files';async[a19_0x4178c6(0x132)](_0x2b9499){const _0x14d51d=a19_0x4178c6,{options:_0x160b9f,args:_0x15771d}=_0x2b9499,_0x2d3386=_0x160b9f,_0x2d2e1e=await resolveTarget({'arg':_0x15771d[0x0],'contextParent':_0x160b9f['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2d2e1e))return _0x2d2e1e['errorCode']===_0x14d51d(0x101)?(console[_0x14d51d(0x106)](a19_0x22efc5[_0x14d51d(0x107)](_0x14d51d(0x130))),console['error'](_0x14d51d(0x128)),console[_0x14d51d(0x106)](_0x14d51d(0x120)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x14d51d(0x106)](a19_0x22efc5[_0x14d51d(0x12f)]('Error:\x20'+_0x2d2e1e['message']+'\x0a')),_0x2d2e1e[_0x14d51d(0x126)]&&console['error'](a19_0x22efc5[_0x14d51d(0x10c)](_0x2d2e1e['helpText']))),0x1;const _0xa3e968=_0x2d2e1e[_0x14d51d(0x12b)],_0x2bff23=_0x2d2e1e[_0x14d51d(0x10f)]==='file'?_0x2d2e1e[_0x14d51d(0x109)]:undefined;if(!_0x2bff23&&!existsSync(_0xa3e968))return console['error'](a19_0x22efc5[_0x14d51d(0x12f)](_0x14d51d(0x10a)+_0xa3e968+'\x0a')),0x1;let _0x1b6a5a;if(_0x2bff23){if(!_0x2bff23[_0x14d51d(0x11f)](_0x14d51d(0x115))&&!_0x2bff23[_0x14d51d(0x11f)](_0x14d51d(0x134)))return console['error'](a19_0x22efc5[_0x14d51d(0x12f)](_0x14d51d(0x129)+_0x2bff23+'\x0a')),0x1;_0x1b6a5a=[_0x2bff23];}else _0x1b6a5a=findYamlFiles(_0xa3e968);if(_0x1b6a5a[_0x14d51d(0x12c)]===0x0)return console[_0x14d51d(0x106)](a19_0x22efc5[_0x14d51d(0x12f)](_0x14d51d(0x117)+_0xa3e968+'\x0a')),0x1;const _0x16e783=validateYamlFiles(_0x1b6a5a,_0xa3e968,{'filterType':_0x14d51d(0x123)}),_0x54ae05=calculateSummary(_0x16e783),_0x1f3a2e=_0x16e783[_0x14d51d(0x133)](isValidationResult);if(_0x1f3a2e[_0x14d51d(0x12c)]===0x0)return console[_0x14d51d(0x106)](a19_0x22efc5[_0x14d51d(0x107)](_0x14d51d(0x125)+_0xa3e968+'\x0a')),_0x54ae05[_0x14d51d(0x114)]>0x0&&console[_0x14d51d(0x106)](a19_0x22efc5[_0x14d51d(0x131)]('('+_0x54ae05[_0x14d51d(0x114)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x582e4a of _0x16e783){if(!isValidationResult(_0x582e4a)){_0x2d3386[_0x14d51d(0x11b)]&&console['log'](a19_0x22efc5[_0x14d51d(0x131)]('-\x20'+_0x582e4a[_0x14d51d(0x118)]+_0x14d51d(0x105)+_0x582e4a[_0x14d51d(0x11d)]+')'));continue;}const {relativePath:_0x572a63,source:_0x441675,result:_0x184735}=_0x582e4a;if(_0x184735[_0x14d51d(0x100)]&&_0x184735['warnings']['length']===0x0)_0x2d3386['verbose']&&console['log'](a19_0x22efc5[_0x14d51d(0x110)]('β\x20'+_0x572a63));else _0x184735[_0x14d51d(0x100)]?(console[_0x14d51d(0x10e)](a19_0x22efc5[_0x14d51d(0x107)]('β \x20'+_0x572a63+':\x20'+_0x184735[_0x14d51d(0x112)]['length']+_0x14d51d(0x11e))),console[_0x14d51d(0x10e)](formatValidationResult(_0x184735,_0x441675,_0x572a63))):(console['log'](a19_0x22efc5['red']('β\x20'+_0x572a63+':\x20'+_0x184735['errors'][_0x14d51d(0x12c)]+'\x20error(s)')),console[_0x14d51d(0x10e)](formatValidationResult(_0x184735,_0x441675,_0x572a63)));}return console[_0x14d51d(0x10e)](''),_0x54ae05[_0x14d51d(0x135)]?(console[_0x14d51d(0x10e)](a19_0x22efc5['red'](_0x14d51d(0x103)+_0x54ae05[_0x14d51d(0x124)]+_0x14d51d(0x11a)+_0x54ae05[_0x14d51d(0x113)]+_0x14d51d(0x136))),_0x54ae05['warningCount']>0x0&&console[_0x14d51d(0x10e)](a19_0x22efc5['yellow'](_0x54ae05[_0x14d51d(0x12e)]+'\x20warning(s)\x20found')),_0x54ae05[_0x14d51d(0x114)]>0x0&&console['log'](a19_0x22efc5['dim'](_0x54ae05['skippedCount']+_0x14d51d(0x116))),0x1):(console[_0x14d51d(0x10e)](a19_0x22efc5[_0x14d51d(0x110)](_0x14d51d(0x119)+_0x54ae05['validCount']+_0x14d51d(0x11c))),_0x54ae05[_0x14d51d(0x12e)]>0x0&&console[_0x14d51d(0x10e)](a19_0x22efc5[_0x14d51d(0x107)](_0x54ae05[_0x14d51d(0x12e)]+'\x20warning(s)\x20found')),_0x54ae05['skippedCount']>0x0&&console[_0x14d51d(0x10e)](a19_0x22efc5[_0x14d51d(0x131)](_0x54ae05[_0x14d51d(0x114)]+_0x14d51d(0x116))),0x0);}}
|