@treasuredata/tdx 2026.3.30 → 2026.3.31
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.d.ts.map +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.d.ts +55 -0
- package/dist/commands/cas-command.d.ts.map +1 -0
- package/dist/commands/cas-command.js +1 -0
- package/dist/commands/cas-command.js.map +1 -0
- package/dist/commands/cas-segment-command.d.ts +18 -0
- package/dist/commands/cas-segment-command.d.ts.map +1 -0
- package/dist/commands/cas-segment-command.js +1 -0
- package/dist/commands/cas-segment-command.js.map +1 -0
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.d.ts.map +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/unset-command.js.map +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/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 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +2 -1
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.d.ts +77 -0
- package/dist/sdk/cas/cas-api-client.d.ts.map +1 -0
- package/dist/sdk/cas/cas-api-client.js +1 -0
- package/dist/sdk/cas/cas-api-client.js.map +1 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts +32 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -0
- package/dist/sdk/cas/cas-audience-yaml.js +1 -0
- package/dist/sdk/cas/cas-audience-yaml.js.map +1 -0
- package/dist/sdk/cas/cas-segment-yaml.d.ts +38 -0
- package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -0
- package/dist/sdk/cas/cas-segment-yaml.js +1 -0
- package/dist/sdk/cas/cas-segment-yaml.js.map +1 -0
- package/dist/sdk/cas/index.d.ts +61 -0
- package/dist/sdk/cas/index.d.ts.map +1 -0
- package/dist/sdk/cas/index.js +1 -0
- package/dist/sdk/cas/index.js.map +1 -0
- package/dist/sdk/cas/pull-workflow.d.ts +53 -0
- package/dist/sdk/cas/pull-workflow.d.ts.map +1 -0
- package/dist/sdk/cas/pull-workflow.js +1 -0
- package/dist/sdk/cas/pull-workflow.js.map +1 -0
- package/dist/sdk/cas/push-workflow.d.ts +50 -0
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -0
- package/dist/sdk/cas/push-workflow.js +1 -0
- package/dist/sdk/cas/push-workflow.js.map +1 -0
- package/dist/sdk/cas/types.d.ts +115 -0
- package/dist/sdk/cas/types.d.ts.map +1 -0
- package/dist/sdk/cas/types.js +1 -0
- package/dist/sdk/cas/types.js.map +1 -0
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +4 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +6 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cas.d.ts +242 -0
- package/dist/sdk/types/cas.d.ts.map +1 -0
- package/dist/sdk/types/cas.js +1 -0
- package/dist/sdk/types/cas.js.map +1 -0
- package/dist/sdk/types/index.d.ts +3 -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/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x1954a7=a24_0x5d09;(function(_0x36882d,_0xaab862){const _0x340149=a24_0x5d09,_0x2f0cb1=_0x36882d();while(!![]){try{const _0x3f432a=-parseInt(_0x340149(0x112))/0x1+-parseInt(_0x340149(0x108))/0x2+parseInt(_0x340149(0xe6))/0x3+parseInt(_0x340149(0xef))/0x4+-parseInt(_0x340149(0x10c))/0x5*(parseInt(_0x340149(0x103))/0x6)+-parseInt(_0x340149(0x111))/0x7+parseInt(_0x340149(0xe7))/0x8;if(_0x3f432a===_0xaab862)break;else _0x2f0cb1['push'](_0x2f0cb1['shift']());}catch(_0x41f079){_0x2f0cb1['push'](_0x2f0cb1['shift']());}}}(a24_0x56d5,0x6b2a7));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a24_0x3ee56e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a24_0x5d09(_0x1ee72f,_0x222474){_0x1ee72f=_0x1ee72f-0xdb;const _0x56d5e7=a24_0x56d5();let _0x5d095d=_0x56d5e7[_0x1ee72f];return _0x5d095d;}import a24_0x25f8e3 from'path';function a24_0x56d5(){const _0x4370ba=['\x0aError:','session','1046624NwEvPx','yes','files','Pulling\x20templates\x20from\x20\x27','filter','green','description','setPhase','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','name','absolutePath','Aborted.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','execute','yellow','repeat','diff','\x20templates','hasChanges','\x0aChanges\x20to\x20\x27','42WOFNwJ','content','cwd','config','✔\x20All\x20files\x20are\x20up\x20to\x20date','161172lQGuMh','data','counts','engage_workspace','550195OFSaxh','engage:template:pull','workspace','cyan','error','103754fuHWDq','42995MPlbac','\x20changed\x20files','isNew','relativePath','Workspace\x20is\x20required.','dim','targetDir','verbose','dirname','workspaceName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','\x20new\x20files','\x20=\x20','✔\x20Pulled\x20','\x20files\x20to\x20','688905KlflHe','6850688douXQH','templates','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','✔\x20Context\x20set:\x20','Pull\x20templates\x20to\x20YAML\x20files'];a24_0x56d5=function(){return _0x4370ba;};return a24_0x56d5();}import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{[a24_0x1954a7(0xf8)]=a24_0x1954a7(0x10d);[a24_0x1954a7(0xf5)]=a24_0x1954a7(0xec);async[a24_0x1954a7(0xfc)](_0x2b05c6){const _0x1e4e39=a24_0x1954a7,{options:_0x230b29,args:_0xbffa63,tdx:_0x2f959b}=_0x2b05c6,_0x26a71b=_0x230b29,_0x2ac999=await resolveWorkspaceName(_0xbffa63[0x0],_0x26a71b);if(!_0x2ac999)return console[_0x1e4e39(0x110)](a24_0x3ee56e[_0x1e4e39(0xfd)](_0x1e4e39(0x116))),console[_0x1e4e39(0x110)](_0x1e4e39(0xf7)),console[_0x1e4e39(0x110)](_0x1e4e39(0xe1)),console[_0x1e4e39(0x110)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x7554b0=await withProgressSpinner(_0x1e4e39(0xf2)+_0x2ac999+'\x27...',_0x4c6fdd=>pullTemplates({'engage':_0x2f959b['engage']},_0x2ac999,{'templateName':_0x26a71b[_0x1e4e39(0xf8)],'progress':{'update':_0x57fd2f=>{const _0x2a4347=_0x1e4e39;_0x4c6fdd[_0x2a4347(0xf6)](_0x57fd2f);}}}),{'verbose':_0x26a71b[_0x1e4e39(0xdd)]}),_0x5d8013=_0x7554b0[_0x1e4e39(0x109)];if(_0x5d8013['counts'][_0x1e4e39(0xe8)]===0x0)return console[_0x1e4e39(0x110)](a24_0x3ee56e[_0x1e4e39(0xfd)]('No\x20templates\x20found\x20in\x20workspace\x20\x27'+_0x5d8013[_0x1e4e39(0xdf)]+'\x27')),0x0;const _0x264294=_0x5d8013[_0x1e4e39(0xf1)][_0x1e4e39(0xf3)](_0x4fdb9c=>_0x4fdb9c[_0x1e4e39(0x114)]),_0x1b2034=_0x5d8013[_0x1e4e39(0xf1)][_0x1e4e39(0xf3)](_0x331522=>!_0x331522['isNew']&&_0x331522[_0x1e4e39(0x101)]),_0x3ab82d=_0x5d8013[_0x1e4e39(0xf1)][_0x1e4e39(0xf3)](_0x2239fc=>!_0x2239fc['isNew']&&!_0x2239fc[_0x1e4e39(0x101)]);console[_0x1e4e39(0x110)]('\x0aPull\x20summary\x20for\x20workspace\x20\x27'+_0x5d8013[_0x1e4e39(0xdf)]+'\x27:'),console[_0x1e4e39(0x110)]('\x20\x20'+a24_0x3ee56e[_0x1e4e39(0x10f)](_0x5d8013[_0x1e4e39(0x10a)][_0x1e4e39(0xe8)]+_0x1e4e39(0x100))),console['error']('\x20\x20'+a24_0x3ee56e['green']('+\x20'+_0x264294['length']+_0x1e4e39(0xe2))),console[_0x1e4e39(0x110)]('\x20\x20'+a24_0x3ee56e[_0x1e4e39(0xfd)]('~\x20'+_0x1b2034[_0x1e4e39(0xea)]+_0x1e4e39(0x113))),console[_0x1e4e39(0x110)]('\x20\x20'+a24_0x3ee56e[_0x1e4e39(0xdb)]('=\x20'+_0x3ab82d[_0x1e4e39(0xea)]+'\x20unchanged\x20files')),console[_0x1e4e39(0x110)]('\x20\x20Target:\x20'+a24_0x3ee56e[_0x1e4e39(0x10f)](_0x5d8013[_0x1e4e39(0xdc)])+'\x0a');if(_0x1b2034[_0x1e4e39(0xea)]>0x0)for(const _0x2b7c5d of _0x1b2034){console[_0x1e4e39(0x110)](_0x1e4e39(0x102)+_0x2b7c5d[_0x1e4e39(0x115)]+'\x27:'),console[_0x1e4e39(0x110)]('─'['repeat'](0x3c)),console[_0x1e4e39(0x110)](_0x2b7c5d[_0x1e4e39(0xff)]),console[_0x1e4e39(0x110)]('─'[_0x1e4e39(0xfe)](0x3c));}if(_0x26a71b['dryRun'])return console[_0x1e4e39(0x110)](a24_0x3ee56e['yellow'](_0x1e4e39(0xfb))),0x0;if(_0x264294[_0x1e4e39(0xea)]===0x0&&_0x1b2034[_0x1e4e39(0xea)]===0x0)return console['error'](a24_0x3ee56e[_0x1e4e39(0xf4)](_0x1e4e39(0x107))),saveSessionContext({'engage_workspace':_0x5d8013['workspaceName']},_0x26a71b[_0x1e4e39(0xee)]),0x0;if(!_0x26a71b[_0x1e4e39(0xf0)]){if(!isInteractive())return console[_0x1e4e39(0x110)](a24_0x3ee56e['red'](_0x1e4e39(0xed)),_0x1e4e39(0xe9)),console[_0x1e4e39(0x110)](a24_0x3ee56e['dim'](_0x1e4e39(0xe0))),0x1;const _0x57d7f=await confirmKey('Write\x20'+(_0x264294[_0x1e4e39(0xea)]+_0x1b2034[_0x1e4e39(0xea)])+'\x20files?');if(!_0x57d7f)return console[_0x1e4e39(0x110)](a24_0x3ee56e[_0x1e4e39(0xfd)](_0x1e4e39(0xfa)),'-\x20no\x20files\x20written'),0x1;}for(const _0x1dea89 of _0x5d8013['files']){if(_0x1dea89[_0x1e4e39(0x114)]||_0x1dea89[_0x1e4e39(0x101)]){const _0x6658f5=a24_0x25f8e3[_0x1e4e39(0xde)](_0x1dea89[_0x1e4e39(0xf9)]);!existsSync(_0x6658f5)&&mkdirSync(_0x6658f5,{'recursive':!![]}),writeFileSync(_0x1dea89['absolutePath'],_0x1dea89[_0x1e4e39(0x104)],'utf-8');}}return console[_0x1e4e39(0x110)](a24_0x3ee56e['green'](_0x1e4e39(0xe4)+(_0x264294[_0x1e4e39(0xea)]+_0x1b2034['length'])+_0x1e4e39(0xe5)+_0x5d8013[_0x1e4e39(0xdc)])),saveSessionContext({'engage_workspace':_0x5d8013[_0x1e4e39(0xdf)]},_0x26a71b[_0x1e4e39(0xee)]),console['error'](a24_0x3ee56e[_0x1e4e39(0xf4)](_0x1e4e39(0xeb)+a24_0x3ee56e[_0x1e4e39(0xdb)](_0x1e4e39(0x10b))+_0x1e4e39(0xe3)+a24_0x3ee56e[_0x1e4e39(0x10f)](_0x5d8013['workspaceName']))),0x0;}}async function resolveWorkspaceName(_0x2591c5,_0x5dadf8){const _0x34991e=a24_0x1954a7;if(_0x2591c5)return _0x2591c5;if(_0x5dadf8[_0x34991e(0x10e)])return _0x5dadf8[_0x34991e(0x10e)];const _0x46d03b=tryFindTdxConfig(process[_0x34991e(0x105)]());if(_0x46d03b?.[_0x34991e(0x106)]['engage_workspace'])return _0x46d03b[_0x34991e(0x106)][_0x34991e(0x10b)];const _0xb3b482=loadSessionContext(_0x5dadf8['session']);if(_0xb3b482?.['engage_workspace'])return _0xb3b482[_0x34991e(0x10b)];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0xc6052d=a23_0x6ac8;(function(_0x27e983,_0x45dcb7){const _0x340ffe=a23_0x6ac8,_0x2702d6=_0x27e983();while(!![]){try{const _0x52a00c=-parseInt(_0x340ffe(0x9c))/0x1+parseInt(_0x340ffe(0xc1))/0x2+parseInt(_0x340ffe(0xcd))/0x3+-parseInt(_0x340ffe(0x92))/0x4+parseInt(_0x340ffe(0xc0))/0x5*(-parseInt(_0x340ffe(0xd0))/0x6)+parseInt(_0x340ffe(0x8e))/0x7+parseInt(_0x340ffe(0xc7))/0x8*(parseInt(_0x340ffe(0xaa))/0x9);if(_0x52a00c===_0x45dcb7)break;else _0x2702d6['push'](_0x2702d6['shift']());}catch(_0x59483){_0x2702d6['push'](_0x2702d6['shift']());}}}(a23_0x215f,0x38905));function a23_0x6ac8(_0x264f4d,_0x47994a){_0x264f4d=_0x264f4d-0x8c;const _0x215fc5=a23_0x215f();let _0x6ac824=_0x215fc5[_0x264f4d];return _0x6ac824;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a23_0x1d9386 from'chalk';function a23_0x215f(){const _0x35d5f4=['description','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','green','\x20templates?','\x0aPush\x20summary\x20for\x20workspace\x20\x27','session','relativePath','No\x20template\x20YAML\x20files\x20found\x20in\x20','path','updated','yellow','setPhase','Found\x20','Workspace\x20is\x20required.','workspace','dirname','engage_workspace','\x0aValidation\x20errors\x20in\x20','update','1025jhByHQ','722332gWpTcA','site','engage','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','execute','\x0aError:','16JzElYY','message','-\x20no\x20changes\x20applied','engage:template:push','\x20templates','data','66273EnEIvz','\x20errors:','✔\x20All\x20templates\x20are\x20up\x20to\x20date','4134iMxjYQ','verbose','error','errors','2641436EQwNQx','dim','configDir','def','1103084MfjtdG','yes','length','\x20templates\x20to\x20update:','filter','Resolving\x20references...','templateId','\x20\x20\x20\x20','cwd','action','347058LCbiKf','red','config','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20new\x20templates:','create','Aborted.','warnings','Preparing\x20push\x20to\x20workspace\x20\x27','Pushing\x20templates...','\x27...','Push\x20','results','name','1058193cXJRua','created'];a23_0x215f=function(){return _0x35d5f4;};return a23_0x215f();}import a23_0x342e58 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']=a23_0xc6052d(0xca);[a23_0xc6052d(0xac)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a23_0xc6052d(0xc5)](_0x2d5aa4){const _0x4b76fd=a23_0xc6052d,{options:_0x27a88d,args:_0x21c527,tdx:_0x247482}=_0x2d5aa4,_0x2f73f2=_0x27a88d,_0x53151b=_0x21c527[0x0],_0x30031f=_0x53151b?a23_0x342e58['resolve'](_0x53151b):undefined,_0x1c37f9=_0x30031f?isYamlFile(_0x30031f):![];let _0x226054;if(_0x1c37f9&&_0x30031f)_0x226054=a23_0x342e58['dirname'](_0x30031f);else _0x30031f?_0x226054=_0x30031f:_0x226054=process[_0x4b76fd(0x9a)]();let _0x27bbb5;const _0x56fde0=tryFindTdxConfig(_0x226054);_0x56fde0?.[_0x4b76fd(0x9e)][_0x4b76fd(0xbd)]&&(_0x27bbb5=_0x56fde0[_0x4b76fd(0x9e)]['engage_workspace'],!_0x1c37f9&&(_0x226054=_0x56fde0[_0x4b76fd(0x90)]));_0x2f73f2[_0x4b76fd(0xbb)]&&(_0x27bbb5=_0x2f73f2[_0x4b76fd(0xbb)]);if(!_0x27bbb5){const _0x1f1c46=loadSessionContext(_0x2f73f2[_0x4b76fd(0xb2)]);_0x1f1c46?.['engage_workspace']&&(_0x27bbb5=_0x1f1c46[_0x4b76fd(0xbd)]);}if(!_0x27bbb5)return console[_0x4b76fd(0x8c)](a23_0x1d9386[_0x4b76fd(0xb7)](_0x4b76fd(0xba))),console['error'](_0x4b76fd(0xae)),console[_0x4b76fd(0x8c)](_0x4b76fd(0xc4)),console[_0x4b76fd(0x8c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console[_0x4b76fd(0x8c)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x50a5b2;_0x1c37f9&&_0x30031f?_0x50a5b2=[parseTemplateFile(_0x30031f,a23_0x342e58[_0x4b76fd(0xbc)](_0x30031f))]:_0x50a5b2=discoverAndParseTemplateFiles(_0x226054);if(_0x50a5b2[_0x4b76fd(0x94)]===0x0)return console[_0x4b76fd(0x8c)](a23_0x1d9386['yellow'](_0x4b76fd(0xb4)+_0x226054)),console[_0x4b76fd(0x8c)](a23_0x1d9386['dim']('Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.')),0x1;const _0x399489=_0x50a5b2['length']===0x1?'1\x20template\x20file:\x20'+_0x50a5b2[0x0][_0x4b76fd(0x91)]['name']:_0x50a5b2[_0x4b76fd(0x94)]+'\x20template\x20files';console['error'](_0x4b76fd(0xb9)+a23_0x1d9386['cyan'](_0x399489));let _0x2477ec=![];for(const _0x35f853 of _0x50a5b2){const _0x360f0c=validateTemplateDef(_0x35f853['def']);if(!_0x360f0c['valid']){_0x2477ec=!![],console[_0x4b76fd(0x8c)](a23_0x1d9386[_0x4b76fd(0x9d)](_0x4b76fd(0xbe)+_0x35f853[_0x4b76fd(0xb3)]+':'));for(const _0x7d3178 of _0x360f0c[_0x4b76fd(0x8d)]){console[_0x4b76fd(0x8c)]('\x20\x20'+a23_0x1d9386[_0x4b76fd(0x9d)]('✗')+'\x20'+_0x7d3178[_0x4b76fd(0xb5)]+':\x20'+_0x7d3178[_0x4b76fd(0xc8)]);}}for(const _0x5dd6dc of _0x360f0c[_0x4b76fd(0xa3)]){console['error']('\x20\x20'+a23_0x1d9386['yellow']('⚠')+'\x20'+_0x5dd6dc['path']+':\x20'+_0x5dd6dc[_0x4b76fd(0xc8)]);}}if(_0x2477ec)return console['error'](a23_0x1d9386[_0x4b76fd(0x9d)](_0x4b76fd(0xad))),0x1;const _0x5eca44=await _0x247482[_0x4b76fd(0xc3)]['resolveWorkspaceId'](_0x27bbb5),_0x56c416=await withProgressSpinner(_0x4b76fd(0xa4)+_0x27bbb5+_0x4b76fd(0xa6),_0x1768c1=>preparePush({'engage':_0x247482['engage']},_0x50a5b2,_0x5eca44,{'progress':{'update':_0x5a7c38=>_0x1768c1['setPhase'](_0x5a7c38)}}),{'verbose':_0x2f73f2[_0x4b76fd(0xd1)]}),_0x2eec74=_0x56c416[_0x4b76fd(0xcc)];await withProgressSpinner(_0x4b76fd(0x97),_0xda7d77=>resolveAndBuildInputs({'engage':_0x247482[_0x4b76fd(0xc3)]},_0x2eec74,_0x5eca44,{'progress':{'update':_0x3c6392=>_0xda7d77[_0x4b76fd(0xb8)](_0x3c6392)}}),{'verbose':_0x2f73f2[_0x4b76fd(0xd1)]});const _0x5357d2=_0x2eec74['filter'](_0x56dd6a=>_0x56dd6a[_0x4b76fd(0x9b)]===_0x4b76fd(0xa1)),_0x5ef014=_0x2eec74[_0x4b76fd(0x96)](_0x2e394d=>_0x2e394d[_0x4b76fd(0x9b)]===_0x4b76fd(0xbf));console[_0x4b76fd(0x8c)](_0x4b76fd(0xb1)+_0x27bbb5+'\x27:');if(_0x5357d2[_0x4b76fd(0x94)]>0x0){console[_0x4b76fd(0x8c)]('\x20\x20'+a23_0x1d9386[_0x4b76fd(0xaf)]('+\x20'+_0x5357d2[_0x4b76fd(0x94)]+_0x4b76fd(0xa0)));for(const _0x2d0376 of _0x5357d2){console[_0x4b76fd(0x8c)](_0x4b76fd(0x99)+a23_0x1d9386['green']('+')+'\x20'+_0x2d0376[_0x4b76fd(0x91)][_0x4b76fd(0xa9)]);}}if(_0x5ef014['length']>0x0){console[_0x4b76fd(0x8c)]('\x20\x20'+a23_0x1d9386[_0x4b76fd(0xb7)]('~\x20'+_0x5ef014[_0x4b76fd(0x94)]+_0x4b76fd(0x95)));for(const _0x24c3d6 of _0x5ef014){console[_0x4b76fd(0x8c)](_0x4b76fd(0x99)+a23_0x1d9386[_0x4b76fd(0xb7)]('~')+'\x20'+_0x24c3d6[_0x4b76fd(0x91)]['name']);}}if(_0x5357d2['length']===0x0&&_0x5ef014[_0x4b76fd(0x94)]===0x0)return console[_0x4b76fd(0x8c)](a23_0x1d9386[_0x4b76fd(0xaf)](_0x4b76fd(0xcf))),0x0;if(_0x2f73f2['dryRun'])return console[_0x4b76fd(0x8c)](a23_0x1d9386[_0x4b76fd(0xb7)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x2f73f2[_0x4b76fd(0x93)]){if(!isInteractive())return console[_0x4b76fd(0x8c)](a23_0x1d9386[_0x4b76fd(0x9d)](_0x4b76fd(0xc6)),_0x4b76fd(0x9f)),console[_0x4b76fd(0x8c)](a23_0x1d9386[_0x4b76fd(0x8f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5910c3=await confirmKey(_0x4b76fd(0xa7)+(_0x5357d2['length']+_0x5ef014[_0x4b76fd(0x94)])+_0x4b76fd(0xb0));if(!_0x5910c3)return console[_0x4b76fd(0x8c)](a23_0x1d9386['yellow'](_0x4b76fd(0xa2)),_0x4b76fd(0xc9)),0x1;}const _0x19f3c9=await withProgressSpinner(_0x4b76fd(0xa5),_0xec9a50=>executePush({'engage':_0x247482['engage']},_0x2eec74,{'progress':{'update':_0x4fcf23=>_0xec9a50[_0x4b76fd(0xb8)](_0x4fcf23)}}),{'verbose':_0x2f73f2[_0x4b76fd(0xd1)]}),_0x4af86e=_0x19f3c9[_0x4b76fd(0xcc)];for(const _0x49ceb6 of _0x4af86e[_0x4b76fd(0xa8)]){if(_0x49ceb6[_0x4b76fd(0x98)]&&(_0x49ceb6[_0x4b76fd(0x9b)]===_0x4b76fd(0xab)||_0x49ceb6[_0x4b76fd(0x9b)]===_0x4b76fd(0xb6))){const _0x552b7d=getTemplateUrl(_0x2f73f2[_0x4b76fd(0xc2)],_0x5eca44,_0x49ceb6[_0x4b76fd(0x98)]),_0x33811d=_0x49ceb6[_0x4b76fd(0x9b)]==='created'?'+':'~',_0x40f4aa=_0x49ceb6[_0x4b76fd(0x9b)]===_0x4b76fd(0xab)?a23_0x1d9386[_0x4b76fd(0xaf)](_0x33811d):a23_0x1d9386['yellow'](_0x33811d);console[_0x4b76fd(0x8c)]('\x20\x20'+_0x40f4aa+'\x20'+hyperlink(_0x49ceb6[_0x4b76fd(0xa9)],_0x552b7d)+'\x20'+a23_0x1d9386['dim'](_0x552b7d));}}_0x4af86e['created']>0x0&&console[_0x4b76fd(0x8c)](a23_0x1d9386['green']('✔\x20Created\x20'+_0x4af86e[_0x4b76fd(0xab)]+'\x20templates'));_0x4af86e[_0x4b76fd(0xb6)]>0x0&&console['error'](a23_0x1d9386['green']('✔\x20Updated\x20'+_0x4af86e['updated']+_0x4b76fd(0xcb)));if(_0x4af86e[_0x4b76fd(0x8d)]['length']>0x0){console[_0x4b76fd(0x8c)](a23_0x1d9386[_0x4b76fd(0x9d)]('✘\x20'+_0x4af86e['errors'][_0x4b76fd(0x94)]+_0x4b76fd(0xce)));for(const _0x1c1923 of _0x4af86e[_0x4b76fd(0x8d)]){console[_0x4b76fd(0x8c)]('\x20\x20'+a23_0x1d9386[_0x4b76fd(0x9d)](_0x1c1923['name'])+':\x20'+_0x1c1923[_0x4b76fd(0x8c)]);}}return saveSessionContext({'engage_workspace':_0x27bbb5},_0x2f73f2[_0x4b76fd(0xb2)]),_0x4af86e[_0x4b76fd(0x8d)]['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a25_0x1d9ab3=a25_0xe6bf;function a25_0xe6bf(_0x86f2e7,_0x3677be){_0x86f2e7=_0x86f2e7-0x180;const _0x47fd08=a25_0x47fd();let _0xe6bf77=_0x47fd08[_0x86f2e7];return _0xe6bf77;}(function(_0x3e3706,_0xc567df){const _0x2c0598=a25_0xe6bf,_0x2495de=_0x3e3706();while(!![]){try{const _0x1eac54=parseInt(_0x2c0598(0x184))/0x1*(-parseInt(_0x2c0598(0x1c6))/0x2)+-parseInt(_0x2c0598(0x1c1))/0x3+-parseInt(_0x2c0598(0x199))/0x4*(parseInt(_0x2c0598(0x1a0))/0x5)+-parseInt(_0x2c0598(0x198))/0x6+-parseInt(_0x2c0598(0x1af))/0x7+parseInt(_0x2c0598(0x187))/0x8*(parseInt(_0x2c0598(0x1c2))/0x9)+parseInt(_0x2c0598(0x18a))/0xa;if(_0x1eac54===_0xc567df)break;else _0x2495de['push'](_0x2495de['shift']());}catch(_0x37b608){_0x2495de['push'](_0x2495de['shift']());}}}(a25_0x47fd,0x5fce9));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a25_0x47fd(){const _0x27a236=['Found\x20','Preparing\x20push\x20to\x20workspace\x20\x27','6488pxqpUQ','\x0aValidation\x20errors\x20in\x20','action','488fvPsbw','engage_workspace','updated','14595120tEwbmE','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20template\x20YAML\x20files\x20found\x20in\x20','update','dim','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','templateId','create','\x27...','engage:template:push','config','Resolving\x20references...','dirname','valid','2822286ypQDgn','1128ghVlbl','-\x20no\x20changes\x20applied','def','created','resolve','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','configDir','5395oPAQzQ','✔\x20Created\x20','warnings','length','setPhase','execute','error','\x20templates','Aborted.','path','dryRun','yes','1\x20template\x20file:\x20','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','\x20\x20\x20\x20','2887318WyoRNt','Pushing\x20templates...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','Workspace\x20is\x20required.','site','\x0aPush\x20summary\x20for\x20workspace\x20\x27','✔\x20Updated\x20','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','workspace','\x20template\x20files','message','engage','yellow','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','cwd','results','name','Push\x20','87708kFRTgK','71802ItUrHJ','green','relativePath','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','104LnuhxY','errors','verbose','red'];a25_0x47fd=function(){return _0x27a236;};return a25_0x47fd();}import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a25_0x67137 from'chalk';import a25_0x3ecf4e from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']=a25_0x1d9ab3(0x193);['description']=a25_0x1d9ab3(0x1c5);async[a25_0x1d9ab3(0x1a5)](_0x143537){const _0x1fefc1=a25_0x1d9ab3,{options:_0x646438,args:_0xac7894,tdx:_0x2e1512}=_0x143537,_0x20af82=_0x646438,_0x27bbaa=_0xac7894[0x0],_0x39b5cd=_0x27bbaa?a25_0x3ecf4e[_0x1fefc1(0x19d)](_0x27bbaa):undefined,_0x516c96=_0x39b5cd?isYamlFile(_0x39b5cd):![];let _0x35bad6;if(_0x516c96&&_0x39b5cd)_0x35bad6=a25_0x3ecf4e[_0x1fefc1(0x196)](_0x39b5cd);else _0x39b5cd?_0x35bad6=_0x39b5cd:_0x35bad6=process[_0x1fefc1(0x1bd)]();let _0x2b5a3f;const _0x1cfd3e=tryFindTdxConfig(_0x35bad6);_0x1cfd3e?.['config']['engage_workspace']&&(_0x2b5a3f=_0x1cfd3e[_0x1fefc1(0x194)][_0x1fefc1(0x188)],!_0x516c96&&(_0x35bad6=_0x1cfd3e[_0x1fefc1(0x19f)]));_0x20af82[_0x1fefc1(0x1b7)]&&(_0x2b5a3f=_0x20af82['workspace']);if(!_0x2b5a3f){const _0x3bdb6c=loadSessionContext(_0x20af82['session']);_0x3bdb6c?.[_0x1fefc1(0x188)]&&(_0x2b5a3f=_0x3bdb6c[_0x1fefc1(0x188)]);}if(!_0x2b5a3f)return console[_0x1fefc1(0x1a6)](a25_0x67137['yellow'](_0x1fefc1(0x1b2))),console[_0x1fefc1(0x1a6)](_0x1fefc1(0x1bc)),console['error'](_0x1fefc1(0x19e)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console['error'](_0x1fefc1(0x1b6)),0x1;let _0x37636a;_0x516c96&&_0x39b5cd?_0x37636a=[parseTemplateFile(_0x39b5cd,a25_0x3ecf4e[_0x1fefc1(0x196)](_0x39b5cd))]:_0x37636a=discoverAndParseTemplateFiles(_0x35bad6);if(_0x37636a[_0x1fefc1(0x1a3)]===0x0)return console[_0x1fefc1(0x1a6)](a25_0x67137[_0x1fefc1(0x1bb)](_0x1fefc1(0x18c)+_0x35bad6)),console[_0x1fefc1(0x1a6)](a25_0x67137[_0x1fefc1(0x18e)](_0x1fefc1(0x1ad))),0x1;const _0x7d4078=_0x37636a['length']===0x1?_0x1fefc1(0x1ac)+_0x37636a[0x0][_0x1fefc1(0x19b)][_0x1fefc1(0x1bf)]:_0x37636a[_0x1fefc1(0x1a3)]+_0x1fefc1(0x1b8);console[_0x1fefc1(0x1a6)](_0x1fefc1(0x182)+a25_0x67137['cyan'](_0x7d4078));let _0x3157cd=![];for(const _0x5d11d4 of _0x37636a){const _0x20dfcc=validateTemplateDef(_0x5d11d4[_0x1fefc1(0x19b)]);if(!_0x20dfcc[_0x1fefc1(0x197)]){_0x3157cd=!![],console[_0x1fefc1(0x1a6)](a25_0x67137['red'](_0x1fefc1(0x185)+_0x5d11d4[_0x1fefc1(0x1c4)]+':'));for(const _0x234186 of _0x20dfcc[_0x1fefc1(0x1c7)]){console[_0x1fefc1(0x1a6)]('\x20\x20'+a25_0x67137['red']('✗')+'\x20'+_0x234186['path']+':\x20'+_0x234186['message']);}}for(const _0x361ba6 of _0x20dfcc[_0x1fefc1(0x1a2)]){console[_0x1fefc1(0x1a6)]('\x20\x20'+a25_0x67137['yellow']('⚠')+'\x20'+_0x361ba6[_0x1fefc1(0x1a9)]+':\x20'+_0x361ba6[_0x1fefc1(0x1b9)]);}}if(_0x3157cd)return console['error'](a25_0x67137[_0x1fefc1(0x181)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x51ba19=await _0x2e1512['engage']['resolveWorkspaceId'](_0x2b5a3f),_0x3a737f=await withProgressSpinner(_0x1fefc1(0x183)+_0x2b5a3f+_0x1fefc1(0x192),_0x2857a6=>preparePush({'engage':_0x2e1512[_0x1fefc1(0x1ba)]},_0x37636a,_0x51ba19,{'progress':{'update':_0x35e5a6=>_0x2857a6[_0x1fefc1(0x1a4)](_0x35e5a6)}}),{'verbose':_0x20af82[_0x1fefc1(0x180)]}),_0x4015d1=_0x3a737f['data'];await withProgressSpinner(_0x1fefc1(0x195),_0x26c863=>resolveAndBuildInputs({'engage':_0x2e1512[_0x1fefc1(0x1ba)]},_0x4015d1,_0x51ba19,{'progress':{'update':_0x294eec=>_0x26c863[_0x1fefc1(0x1a4)](_0x294eec)}}),{'verbose':_0x20af82[_0x1fefc1(0x180)]});const _0x4e6d52=_0x4015d1['filter'](_0x593385=>_0x593385[_0x1fefc1(0x186)]===_0x1fefc1(0x191)),_0x14ce20=_0x4015d1['filter'](_0x3c75b5=>_0x3c75b5[_0x1fefc1(0x186)]===_0x1fefc1(0x18d));console[_0x1fefc1(0x1a6)](_0x1fefc1(0x1b4)+_0x2b5a3f+'\x27:');if(_0x4e6d52[_0x1fefc1(0x1a3)]>0x0){console[_0x1fefc1(0x1a6)]('\x20\x20'+a25_0x67137['green']('+\x20'+_0x4e6d52[_0x1fefc1(0x1a3)]+'\x20new\x20templates:'));for(const _0x543578 of _0x4e6d52){console[_0x1fefc1(0x1a6)]('\x20\x20\x20\x20'+a25_0x67137['green']('+')+'\x20'+_0x543578[_0x1fefc1(0x19b)][_0x1fefc1(0x1bf)]);}}if(_0x14ce20['length']>0x0){console[_0x1fefc1(0x1a6)]('\x20\x20'+a25_0x67137[_0x1fefc1(0x1bb)]('~\x20'+_0x14ce20[_0x1fefc1(0x1a3)]+'\x20templates\x20to\x20update:'));for(const _0x10c3db of _0x14ce20){console[_0x1fefc1(0x1a6)](_0x1fefc1(0x1ae)+a25_0x67137[_0x1fefc1(0x1bb)]('~')+'\x20'+_0x10c3db[_0x1fefc1(0x19b)][_0x1fefc1(0x1bf)]);}}if(_0x4e6d52[_0x1fefc1(0x1a3)]===0x0&&_0x14ce20[_0x1fefc1(0x1a3)]===0x0)return console[_0x1fefc1(0x1a6)](a25_0x67137[_0x1fefc1(0x1c3)]('✔\x20All\x20templates\x20are\x20up\x20to\x20date')),0x0;if(_0x20af82[_0x1fefc1(0x1aa)])return console['error'](a25_0x67137[_0x1fefc1(0x1bb)](_0x1fefc1(0x1b1))),0x0;if(!_0x20af82[_0x1fefc1(0x1ab)]){if(!isInteractive())return console['error'](a25_0x67137[_0x1fefc1(0x181)]('\x0aError:'),_0x1fefc1(0x18b)),console['error'](a25_0x67137[_0x1fefc1(0x18e)](_0x1fefc1(0x18f))),0x1;const _0x2a9fc9=await confirmKey(_0x1fefc1(0x1c0)+(_0x4e6d52[_0x1fefc1(0x1a3)]+_0x14ce20[_0x1fefc1(0x1a3)])+'\x20templates?');if(!_0x2a9fc9)return console['error'](a25_0x67137[_0x1fefc1(0x1bb)](_0x1fefc1(0x1a8)),_0x1fefc1(0x19a)),0x1;}const _0x17c6c8=await withProgressSpinner(_0x1fefc1(0x1b0),_0x431163=>executePush({'engage':_0x2e1512[_0x1fefc1(0x1ba)]},_0x4015d1,{'progress':{'update':_0x2e94ca=>_0x431163['setPhase'](_0x2e94ca)}}),{'verbose':_0x20af82[_0x1fefc1(0x180)]}),_0x16d569=_0x17c6c8['data'];for(const _0x37af78 of _0x16d569[_0x1fefc1(0x1be)]){if(_0x37af78[_0x1fefc1(0x190)]&&(_0x37af78[_0x1fefc1(0x186)]==='created'||_0x37af78['action']==='updated')){const _0x44c2bc=getTemplateUrl(_0x20af82[_0x1fefc1(0x1b3)],_0x51ba19,_0x37af78[_0x1fefc1(0x190)]),_0x5ba440=_0x37af78[_0x1fefc1(0x186)]===_0x1fefc1(0x19c)?'+':'~',_0x3642a3=_0x37af78[_0x1fefc1(0x186)]===_0x1fefc1(0x19c)?a25_0x67137['green'](_0x5ba440):a25_0x67137[_0x1fefc1(0x1bb)](_0x5ba440);console[_0x1fefc1(0x1a6)]('\x20\x20'+_0x3642a3+'\x20'+hyperlink(_0x37af78[_0x1fefc1(0x1bf)],_0x44c2bc)+'\x20'+a25_0x67137['dim'](_0x44c2bc));}}_0x16d569['created']>0x0&&console[_0x1fefc1(0x1a6)](a25_0x67137[_0x1fefc1(0x1c3)](_0x1fefc1(0x1a1)+_0x16d569[_0x1fefc1(0x19c)]+_0x1fefc1(0x1a7)));_0x16d569[_0x1fefc1(0x189)]>0x0&&console[_0x1fefc1(0x1a6)](a25_0x67137['green'](_0x1fefc1(0x1b5)+_0x16d569[_0x1fefc1(0x189)]+'\x20templates'));if(_0x16d569[_0x1fefc1(0x1c7)][_0x1fefc1(0x1a3)]>0x0){console[_0x1fefc1(0x1a6)](a25_0x67137['red']('✘\x20'+_0x16d569[_0x1fefc1(0x1c7)][_0x1fefc1(0x1a3)]+'\x20errors:'));for(const _0x483fe1 of _0x16d569[_0x1fefc1(0x1c7)]){console['error']('\x20\x20'+a25_0x67137[_0x1fefc1(0x181)](_0x483fe1[_0x1fefc1(0x1bf)])+':\x20'+_0x483fe1[_0x1fefc1(0x1a6)]);}}return saveSessionContext({'engage_workspace':_0x2b5a3f},_0x20af82['session']),_0x16d569[_0x1fefc1(0x1c7)][_0x1fefc1(0x1a3)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0xc1efe6=a26_0x3c6b;(function(_0x216e02,_0x44bccb){const _0x153723=a26_0x3c6b,_0x124513=_0x216e02();while(!![]){try{const _0x5c47c6=-parseInt(_0x153723(0x16f))/0x1*(-parseInt(_0x153723(0x173))/0x2)+-parseInt(_0x153723(0x17a))/0x3*(parseInt(_0x153723(0x195))/0x4)+parseInt(_0x153723(0x191))/0x5+parseInt(_0x153723(0x180))/0x6*(parseInt(_0x153723(0x171))/0x7)+parseInt(_0x153723(0x18b))/0x8*(parseInt(_0x153723(0x18a))/0x9)+-parseInt(_0x153723(0x17c))/0xa*(parseInt(_0x153723(0x178))/0xb)+-parseInt(_0x153723(0x185))/0xc*(-parseInt(_0x153723(0x182))/0xd);if(_0x5c47c6===_0x44bccb)break;else _0x124513['push'](_0x124513['shift']());}catch(_0x29206c){_0x124513['push'](_0x124513['shift']());}}}(a26_0x567b,0x28c10));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a26_0x4e0d4a from'chalk';import a26_0x25bcd9 from'path';function a26_0x3c6b(_0x597ef3,_0x342689){_0x597ef3=_0x597ef3-0x169;const _0x567b8c=a26_0x567b();let _0x3c6bc0=_0x567b8c[_0x597ef3];return _0x3c6bc0;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a26_0x567b(){const _0x209128=['verbose','\x20error(s)','1771VQYeKA','yellow','159ZynhVv','template','12180PcSyab','warningCount','validCount','.yaml','6882CnGuKh','Error:\x20Directory\x20not\x20found:\x20','73879grcYCs','name','filter','192PQLBoU','invalidCount','relativePath','hasErrors','\x20non-template\x20file(s)\x20skipped)','1962wUUKWd','3496DaAGYU','\x20warning(s)\x20found','error','\x20(skipped:\x20','\x20valid','warnings','800500yMBmAm','dirname','\x20template(s)\x20with\x20errors,\x20','\x20warning(s)','14588lsRyqG','Validation\x20failed:\x20','green','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','skippedCount','dim','log','\x20template(s)\x20valid','length','1ekxiCt','endsWith','525peZyUI','engage:template:validate','247996PBqSAv','valid','errors'];a26_0x567b=function(){return _0x209128;};return a26_0x567b();}export class EngageTemplateValidateCommand extends BaseCommand{[a26_0xc1efe6(0x183)]=a26_0xc1efe6(0x172);['description']='Validate\x20template\x20YAML\x20files';async['execute'](_0x5a9df5){const _0x18993c=a26_0xc1efe6,{options:_0x12fe9d,args:_0x3f068e}=_0x5a9df5,_0x4422b9=_0x12fe9d,_0x2debc8=_0x3f068e[0x0],_0x81d1ee=_0x2debc8?a26_0x25bcd9['resolve'](_0x2debc8):undefined,_0x41ba8f=_0x81d1ee?isYamlFile(_0x81d1ee):![];let _0x3d9707,_0xe5cf4e;if(_0x41ba8f&&_0x81d1ee)_0x3d9707=a26_0x25bcd9[_0x18993c(0x192)](_0x81d1ee),_0xe5cf4e=_0x81d1ee;else _0x81d1ee?_0x3d9707=_0x81d1ee:_0x3d9707=process['cwd']();if(!_0xe5cf4e&&!existsSync(_0x3d9707))return console[_0x18993c(0x18d)](a26_0x4e0d4a['red'](_0x18993c(0x181)+_0x3d9707+'\x0a')),0x1;let _0x53601d;if(_0xe5cf4e){if(!_0xe5cf4e[_0x18993c(0x170)]('.yml')&&!_0xe5cf4e['endsWith'](_0x18993c(0x17f)))return console['error'](a26_0x4e0d4a[_0x18993c(0x169)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xe5cf4e+'\x0a')),0x1;_0x53601d=[_0xe5cf4e];}else _0x53601d=findYamlFiles(_0x3d9707);if(_0x53601d[_0x18993c(0x16e)]===0x0)return console[_0x18993c(0x18d)](a26_0x4e0d4a[_0x18993c(0x169)](_0x18993c(0x198)+_0x3d9707+'\x0a')),0x1;const _0x27fcbe=validateYamlFiles(_0x53601d,_0x3d9707,{'filterType':_0x18993c(0x17b)}),_0xd157cb=calculateSummary(_0x27fcbe),_0xe35413=_0x27fcbe[_0x18993c(0x184)](isValidationResult);if(_0xe35413[_0x18993c(0x16e)]===0x0)return console[_0x18993c(0x18d)](a26_0x4e0d4a[_0x18993c(0x179)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x3d9707+'\x0a')),_0xd157cb['skippedCount']>0x0&&console[_0x18993c(0x18d)](a26_0x4e0d4a[_0x18993c(0x16b)]('('+_0xd157cb[_0x18993c(0x16a)]+_0x18993c(0x189))),0x0;for(const _0x3284b0 of _0x27fcbe){if(!isValidationResult(_0x3284b0)){_0x4422b9[_0x18993c(0x176)]&&console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x16b)]('-\x20'+_0x3284b0[_0x18993c(0x187)]+_0x18993c(0x18e)+_0x3284b0['reason']+')'));continue;}const {relativePath:_0x432bff,source:_0x54a9f7,result:_0x48555a}=_0x3284b0;if(_0x48555a[_0x18993c(0x174)]&&_0x48555a[_0x18993c(0x190)][_0x18993c(0x16e)]===0x0)_0x4422b9['verbose']&&console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x197)]('✔\x20'+_0x432bff));else _0x48555a[_0x18993c(0x174)]?(console['log'](a26_0x4e0d4a[_0x18993c(0x179)]('⚠\x20'+_0x432bff+':\x20'+_0x48555a['warnings'][_0x18993c(0x16e)]+_0x18993c(0x194))),console['log'](formatValidationResult(_0x48555a,_0x54a9f7,_0x432bff))):(console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x169)]('✖\x20'+_0x432bff+':\x20'+_0x48555a[_0x18993c(0x175)][_0x18993c(0x16e)]+_0x18993c(0x177))),console[_0x18993c(0x16c)](formatValidationResult(_0x48555a,_0x54a9f7,_0x432bff)));}return console[_0x18993c(0x16c)](''),_0xd157cb[_0x18993c(0x188)]?(console['log'](a26_0x4e0d4a[_0x18993c(0x169)](_0x18993c(0x196)+_0xd157cb[_0x18993c(0x186)]+_0x18993c(0x193)+_0xd157cb[_0x18993c(0x17e)]+_0x18993c(0x18f))),_0xd157cb[_0x18993c(0x17d)]>0x0&&console[_0x18993c(0x16c)](a26_0x4e0d4a['yellow'](_0xd157cb[_0x18993c(0x17d)]+_0x18993c(0x18c))),_0xd157cb[_0x18993c(0x16a)]>0x0&&console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x16b)](_0xd157cb['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x197)]('✔\x20All\x20'+_0xd157cb[_0x18993c(0x17e)]+_0x18993c(0x16d))),_0xd157cb[_0x18993c(0x17d)]>0x0&&console[_0x18993c(0x16c)](a26_0x4e0d4a[_0x18993c(0x179)](_0xd157cb[_0x18993c(0x17d)]+_0x18993c(0x18c))),_0xd157cb[_0x18993c(0x16a)]>0x0&&console[_0x18993c(0x16c)](a26_0x4e0d4a['dim'](_0xd157cb[_0x18993c(0x16a)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x566b76=a25_0x2195;(function(_0x245efa,_0x5c41c0){const _0x49436f=a25_0x2195,_0x4f08b5=_0x245efa();while(!![]){try{const _0x5f49b=parseInt(_0x49436f(0x11f))/0x1+-parseInt(_0x49436f(0x101))/0x2*(parseInt(_0x49436f(0xe1))/0x3)+-parseInt(_0x49436f(0xdf))/0x4+parseInt(_0x49436f(0xde))/0x5+parseInt(_0x49436f(0xf6))/0x6+parseInt(_0x49436f(0xcc))/0x7*(-parseInt(_0x49436f(0xf2))/0x8)+-parseInt(_0x49436f(0x117))/0x9;if(_0x5f49b===_0x5c41c0)break;else _0x4f08b5['push'](_0x4f08b5['shift']());}catch(_0x112a6a){_0x4f08b5['push'](_0x4f08b5['shift']());}}}(a25_0x2c60,0xeb734));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a25_0x2195(_0x1e6fb2,_0x13ab2f){_0x1e6fb2=_0x1e6fb2-0xcc;const _0x2c60f9=a25_0x2c60();let _0x2195cf=_0x2c60f9[_0x1e6fb2];return _0x2195cf;}import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a25_0x440970 from'chalk';function formatDuration(_0x119ad1){const _0x1b6e2a=a25_0x2195;if(_0x119ad1<0x3c)return _0x119ad1+'s';if(_0x119ad1<0xe10)return Math[_0x1b6e2a(0xfe)](_0x119ad1/0x3c)+'m\x20'+_0x119ad1%0x3c+'s';const _0x43801f=Math[_0x1b6e2a(0xfe)](_0x119ad1/0xe10),_0x3f8258=Math[_0x1b6e2a(0xfe)](_0x119ad1%0xe10/0x3c);return _0x3f8258>0x0?_0x43801f+'h\x20'+_0x3f8258+'m':_0x43801f+'h';}function formatRelativeTime(_0x3b35dc){const _0x4c388b=a25_0x2195,_0x281b30=Date[_0x4c388b(0xd2)]()-_0x3b35dc[_0x4c388b(0x119)](),_0x51e9eb=Math[_0x4c388b(0xfe)](Math[_0x4c388b(0xe8)](_0x281b30)/0x3e8);if(_0x51e9eb<0x3c)return _0x4c388b(0xcd);const _0xc65951=Math[_0x4c388b(0xfe)](_0x51e9eb/0x3c);if(_0xc65951<0x3c)return _0xc65951+_0x4c388b(0xff);const _0x212ad2=Math[_0x4c388b(0xfe)](_0xc65951/0x3c);if(_0x212ad2<0x18)return _0x212ad2+'h\x20ago';const _0x596c64=Math[_0x4c388b(0xfe)](_0x212ad2/0x18);if(_0x596c64<0x1e)return _0x596c64+_0x4c388b(0xda);return Math[_0x4c388b(0xfe)](_0x596c64/0x1e)+_0x4c388b(0x104);}export class JobListCommand extends BaseCommand{[a25_0x566b76(0x11b)]=a25_0x566b76(0x107);[a25_0x566b76(0x109)]='List\x20jobs';async['execute'](_0x172470){const _0x5d0dde=a25_0x566b76,{options:_0x4a9e93,tdx:_0x24f0e5}=_0x172470,_0x1ab739=resolveLimit(_0x4a9e93[_0x5d0dde(0x128)],DEFAULT_DISPLAY_LIMIT),_0x49d5f1=_0x4a9e93['status'];_0x4a9e93[_0x5d0dde(0x10a)]&&(console[_0x5d0dde(0xd1)]('Limit:\x20'+_0x1ab739+_0x5d0dde(0x103)),_0x49d5f1&&console[_0x5d0dde(0xd1)](_0x5d0dde(0x124)+_0x49d5f1));const _0x129e02=await withSpinner('Listing\x20jobs...',()=>_0x24f0e5[_0x5d0dde(0x107)]['list']({'from':0x0,'to':_0x1ab739-0x1,'status':_0x49d5f1}),{'verbose':_0x4a9e93[_0x5d0dde(0x10a)]}),_0x311305=_0x129e02[_0x5d0dde(0xef)];console[_0x5d0dde(0xd1)](_0x5d0dde(0x115)+_0x311305[_0x5d0dde(0xd7)]+_0x5d0dde(0xe7)+(_0x311305[_0x5d0dde(0xd7)]!==0x1?'s':''));const _0x5d5c01=_0x4a9e93[_0x5d0dde(0x100)];if(isStructuredFormat(_0x4a9e93)){const _0x3ce267=_0x311305[_0x5d0dde(0xe2)](_0x4fab56=>{const _0x37a78c=_0x5d0dde;let _0x59a668;if(_0x4fab56[_0x37a78c(0xfb)]&&_0x4fab56[_0x37a78c(0xec)]){const _0x2664b7=new Date(_0x4fab56['start_at'])[_0x37a78c(0x119)](),_0x57bca8=new Date(_0x4fab56[_0x37a78c(0xec)])[_0x37a78c(0x119)]();_0x59a668=Math['round']((_0x57bca8-_0x2664b7)/0x3e8);}return{'job_id':_0x4fab56[_0x37a78c(0xed)],'type':_0x4fab56['type']===_0x37a78c(0x102)?_0x37a78c(0x121):_0x4fab56['type'],'status':_0x4fab56[_0x37a78c(0x122)],'user_name':_0x4fab56[_0x37a78c(0xfc)],'duration_sec':_0x59a668,'created_at':_0x4fab56[_0x37a78c(0xdd)],'started_at':_0x4fab56[_0x37a78c(0xfb)],'end_at':_0x4fab56['end_at']};});await handleSDKOutput(_0x3ce267,_0x4a9e93);}else for(const _0x442b7b of _0x311305){const _0x5c9961=_0x442b7b['status']===_0x5d0dde(0xe4)?a25_0x440970[_0x5d0dde(0xd9)]:_0x442b7b[_0x5d0dde(0x122)]===_0x5d0dde(0xd1)?a25_0x440970[_0x5d0dde(0x11d)]:a25_0x440970['dim'],_0x5df67e=_0x5c9961(_0x442b7b[_0x5d0dde(0x122)]),_0x4f246f=getJobUrl(_0x5d5c01,_0x442b7b[_0x5d0dde(0xed)]),_0x3b3424=hyperlink(_0x442b7b['job_id'],_0x4f246f),_0x12e8e3=a25_0x440970['dim'](_0x442b7b[_0x5d0dde(0xd5)]===_0x5d0dde(0x102)?_0x5d0dde(0x121):_0x442b7b[_0x5d0dde(0xd5)]),_0x5b9350=[];if(_0x442b7b[_0x5d0dde(0xfb)]&&_0x442b7b[_0x5d0dde(0xec)]){const _0x2c7d71=Math[_0x5d0dde(0x110)]((new Date(_0x442b7b[_0x5d0dde(0xec)])['getTime']()-new Date(_0x442b7b[_0x5d0dde(0xfb)])['getTime']())/0x3e8);_0x5b9350['push'](formatDuration(_0x2c7d71));}if(_0x442b7b[_0x5d0dde(0xec)])_0x5b9350[_0x5d0dde(0x10e)](formatRelativeTime(new Date(_0x442b7b[_0x5d0dde(0xec)])));else _0x442b7b[_0x5d0dde(0xfb)]&&_0x5b9350[_0x5d0dde(0x10e)](formatRelativeTime(new Date(_0x442b7b[_0x5d0dde(0xfb)])));const _0x57c849=_0x5b9350[_0x5d0dde(0xd7)]>0x0?a25_0x440970[_0x5d0dde(0xf8)]('\x20'+_0x5b9350[_0x5d0dde(0x10d)](',\x20')):'';console[_0x5d0dde(0x114)]('⚡\x20'+_0x3b3424+'\x20'+_0x12e8e3+'\x20'+_0x5df67e+_0x57c849);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x566b76(0x11b)]='job:show';[a25_0x566b76(0x109)]=a25_0x566b76(0x111);['validate'](_0xb4b0c3){const _0x1654fd=a25_0x566b76,_0x549b26=_0xb4b0c3['args'][0x0];if(!_0x549b26)return _0x1654fd(0xea);return undefined;}async[a25_0x566b76(0xfa)](_0x5c9528){const _0x4d705c=a25_0x566b76,{options:_0x2fb1e5,args:_0x44baad,tdx:_0x336344}=_0x5c9528,_0x14b158=_0x44baad[0x0],_0x399452=await withSpinner(_0x4d705c(0xf9),()=>_0x336344[_0x4d705c(0x107)][_0x4d705c(0xd0)](_0x14b158),{'verbose':_0x2fb1e5[_0x4d705c(0x10a)]}),_0x219e57=_0x399452[_0x4d705c(0xef)];let _0x1b7c07;if(_0x219e57[_0x4d705c(0xfb)]&&_0x219e57[_0x4d705c(0xec)]){const _0x998a0a=new Date(_0x219e57[_0x4d705c(0xfb)])[_0x4d705c(0x119)](),_0x3c9088=new Date(_0x219e57[_0x4d705c(0xec)])[_0x4d705c(0x119)]();_0x1b7c07=Math['round']((_0x3c9088-_0x998a0a)/0x3e8);}const _0xc2ba87={'job_id':_0x219e57[_0x4d705c(0xed)],'type':_0x219e57[_0x4d705c(0xd5)],'status':_0x219e57['status'],..._0x219e57[_0x4d705c(0xfc)]&&{'user_name':_0x219e57[_0x4d705c(0xfc)]},..._0x1b7c07!==undefined&&{'duration_sec':_0x1b7c07},..._0x219e57[_0x4d705c(0xdd)]&&{'created_at':_0x219e57['created_at']},..._0x219e57['start_at']&&{'started_at':_0x219e57['start_at']},..._0x219e57[_0x4d705c(0xec)]&&{'end_at':_0x219e57[_0x4d705c(0xec)]},..._0x219e57['database']&&{'database':_0x219e57[_0x4d705c(0xe6)]},..._0x219e57['priority']!==undefined&&{'priority':_0x219e57[_0x4d705c(0x10f)]},..._0x219e57[_0x4d705c(0xee)]&&{'url':_0x219e57[_0x4d705c(0xee)]},..._0x219e57['query']&&{'query':_0x219e57[_0x4d705c(0xf1)]},..._0x219e57[_0x4d705c(0xf3)]&&{'debug':_0x219e57[_0x4d705c(0xf3)]}};return await handleSingleObjectOutput(_0xc2ba87,_0x2fb1e5),0x0;}}export class JobKillCommand extends BaseCommand{[a25_0x566b76(0x11b)]=a25_0x566b76(0x106);[a25_0x566b76(0x109)]='Kill\x20a\x20job';[a25_0x566b76(0x123)](_0x52c03d){const _0x48256b=a25_0x566b76,_0xfe094e=_0x52c03d['args'][0x0];if(!_0xfe094e)return _0x48256b(0x112);return undefined;}async['execute'](_0x179585){const _0x55a29a=a25_0x566b76,{options:_0x483486,args:_0x3793e5,tdx:_0x34a9f2}=_0x179585,_0x3e5c91=_0x3793e5[0x0];if(!_0x483486[_0x55a29a(0xf7)]){const _0x4ab990=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x3e5c91+'?');if(!_0x4ab990)return console[_0x55a29a(0xd1)](_0x55a29a(0x10c)),0x0;}return await withSpinner(_0x55a29a(0x105),()=>_0x34a9f2[_0x55a29a(0x107)][_0x55a29a(0xcf)](_0x3e5c91),{'verbose':_0x483486['verbose']}),console[_0x55a29a(0xd1)](_0x55a29a(0xf4)+_0x3e5c91),console[_0x55a29a(0xd1)](_0x55a29a(0xf0)+_0x3e5c91+_0x55a29a(0x126)),0x0;}}function a25_0x2c60(){const _0x554559=['result','log','✔\x20Found\x20','Getting\x20job\x20results...','3656124GCbvfF','✔\x20Job\x20submitted','getTime','INVALID_ARGUMENT','name','\x20\x20Job\x20ID:\x20','red','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','789201UpDGjC','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','trino','status','validate','Status\x20filter:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','\x27\x20to\x20verify\x20the\x20job\x20status','substring','limit','7GsbkWk','just\x20now','submit','kill','show','error','now','information_schema','Database:\x20','type','Query:\x20','length','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','green','d\x20ago','args','No\x20SQL\x20statements\x20found\x20in\x20file','created_at','9428860lrXyYA','3500812jTSTUS','Submit\x20a\x20job','87723eHdpYF','map','Submitting\x20job...','success','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','database','\x20job','abs','hive','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Job\x20type:\x20','end_at','job_id','url','data','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','query','12538040WEONhH','debug','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job:submit','11565792BjgKHS','yes','dim','Getting\x20job\x20details...','execute','start_at','user_name','job:result','floor','m\x20ago','site','54jpqumv','presto','\x20jobs','mo\x20ago','Submitting\x20kill\x20request...','job:kill','jobs','\x20row','description','verbose','file','Cancelled','join','push','priority','round','Show\x20job\x20details','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>'];a25_0x2c60=function(){return _0x554559;};return a25_0x2c60();}export class JobSubmitCommand extends BaseCommand{[a25_0x566b76(0x11b)]=a25_0x566b76(0xf5);['description']=a25_0x566b76(0xe0);async[a25_0x566b76(0xfa)](_0x3bf0fd){const _0x149600=a25_0x566b76,{options:_0x20ebf6,args:_0x3354c7,tdx:_0x1f1915}=_0x3bf0fd,_0x445110=_0x20ebf6['jobType']||'trino',_0x3fc0c9=_0x20ebf6[_0x149600(0x10b)],_0x3f4ddc=_0x20ebf6[_0x149600(0xe6)]||_0x149600(0xd3),_0x93c2b4=_0x20ebf6[_0x149600(0x113)];if(_0x445110!=='trino'&&_0x445110!==_0x149600(0xe9))throw new SDKError(ErrorCode[_0x149600(0x11a)],_0x149600(0x120));let _0x13b209;if(_0x3fc0c9){if(_0x3354c7[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x149600(0x125));const _0x34e267=readSqlStatementsFromFile(_0x3fc0c9);if(_0x34e267['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x149600(0xdc));if(_0x34e267[_0x149600(0xd7)]>0x1)throw new SDKError(ErrorCode[_0x149600(0x11a)],_0x149600(0xd8));_0x13b209=_0x34e267[0x0];}else{if(!_0x3354c7[0x0])throw new SDKError(ErrorCode[_0x149600(0x11a)],_0x149600(0x11e));_0x13b209=_0x3354c7[0x0];}_0x20ebf6[_0x149600(0x10a)]&&(console[_0x149600(0xd1)](_0x149600(0xeb)+_0x445110),console[_0x149600(0xd1)](_0x149600(0xd4)+_0x3f4ddc),console['error'](_0x149600(0xd6)+_0x13b209[_0x149600(0x127)](0x0,0x64)+(_0x13b209[_0x149600(0xd7)]>0x64?'...':'')));const _0x2dbb7b=await withSpinner(_0x149600(0xe3),()=>_0x1f1915[_0x149600(0x107)][_0x149600(0xce)](_0x3f4ddc,_0x13b209,_0x445110,_0x93c2b4),{'verbose':_0x20ebf6[_0x149600(0x10a)]}),_0x137dd9=_0x2dbb7b[_0x149600(0xef)];return console[_0x149600(0xd1)](_0x149600(0x118)),console['error'](_0x149600(0x11c)+_0x137dd9[_0x149600(0xed)]),await handleSDKOutput([_0x137dd9],_0x20ebf6),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x566b76(0x11b)]=a25_0x566b76(0xfd);[a25_0x566b76(0x109)]='Get\x20job\x20results';[a25_0x566b76(0x123)](_0x181c26){const _0x1193b3=a25_0x566b76,_0x5a5424=_0x181c26[_0x1193b3(0xdb)][0x0];if(!_0x5a5424)return _0x1193b3(0xe5);return undefined;}async[a25_0x566b76(0xfa)](_0x54430d){const _0x5cb279=a25_0x566b76,{options:_0x57e5bd,args:_0x4462c6,tdx:_0x2d197b}=_0x54430d,_0xb760f0=_0x4462c6[0x0],_0x14d9b1=await withSpinner(_0x5cb279(0x116),()=>_0x2d197b['jobs']['result'](_0xb760f0),{'verbose':_0x57e5bd[_0x5cb279(0x10a)]}),_0x43f906=_0x14d9b1['data'];return console[_0x5cb279(0xd1)]('✔\x20Retrieved\x20'+_0x43f906[_0x5cb279(0xd7)]+_0x5cb279(0x108)+(_0x43f906[_0x5cb279(0xd7)]!==0x1?'s':'')),await handleSDKOutput(_0x43f906,_0x57e5bd),0x0;}}
|
|
1
|
+
const a27_0x442de4=a27_0x3a3c;(function(_0x3e1507,_0x428d72){const _0x398712=a27_0x3a3c,_0x336d94=_0x3e1507();while(!![]){try{const _0x28fd29=-parseInt(_0x398712(0xdc))/0x1+-parseInt(_0x398712(0xd9))/0x2+-parseInt(_0x398712(0xb8))/0x3+-parseInt(_0x398712(0xb1))/0x4+parseInt(_0x398712(0xaa))/0x5*(-parseInt(_0x398712(0xe0))/0x6)+parseInt(_0x398712(0xc6))/0x7+parseInt(_0x398712(0xa4))/0x8;if(_0x28fd29===_0x428d72)break;else _0x336d94['push'](_0x336d94['shift']());}catch(_0x4fa5ad){_0x336d94['push'](_0x336d94['shift']());}}}(a27_0x582c,0x77ff5));function a27_0x3a3c(_0x3eb5ab,_0x46e773){_0x3eb5ab=_0x3eb5ab-0x92;const _0x582cb3=a27_0x582c();let _0x3a3c96=_0x582cb3[_0x3eb5ab];return _0x3a3c96;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x28b99f from'chalk';function formatDuration(_0x471b7){const _0x2b987f=a27_0x3a3c;if(_0x471b7<0x3c)return _0x471b7+'s';if(_0x471b7<0xe10)return Math['floor'](_0x471b7/0x3c)+'m\x20'+_0x471b7%0x3c+'s';const _0x42daf5=Math[_0x2b987f(0xa6)](_0x471b7/0xe10),_0x17be6e=Math[_0x2b987f(0xa6)](_0x471b7%0xe10/0x3c);return _0x17be6e>0x0?_0x42daf5+'h\x20'+_0x17be6e+'m':_0x42daf5+'h';}function formatRelativeTime(_0x4a1f6c){const _0x3a88ed=a27_0x3a3c,_0x6afe12=Date[_0x3a88ed(0xe1)]()-_0x4a1f6c['getTime'](),_0x398014=Math[_0x3a88ed(0xa6)](Math['abs'](_0x6afe12)/0x3e8);if(_0x398014<0x3c)return _0x3a88ed(0xae);const _0x4d7751=Math[_0x3a88ed(0xa6)](_0x398014/0x3c);if(_0x4d7751<0x3c)return _0x4d7751+_0x3a88ed(0xe4);const _0x8af203=Math[_0x3a88ed(0xa6)](_0x4d7751/0x3c);if(_0x8af203<0x18)return _0x8af203+'h\x20ago';const _0x527766=Math[_0x3a88ed(0xa6)](_0x8af203/0x18);if(_0x527766<0x1e)return _0x527766+'d\x20ago';return Math['floor'](_0x527766/0x1e)+_0x3a88ed(0xd3);}export class JobListCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xba);[a27_0x442de4(0xe7)]=a27_0x442de4(0xda);async[a27_0x442de4(0xcf)](_0xfbba7d){const _0xe32e18=a27_0x442de4,{options:_0x4f51c6,tdx:_0x5145b6}=_0xfbba7d,_0x40db22=resolveLimit(_0x4f51c6[_0xe32e18(0xc4)],DEFAULT_DISPLAY_LIMIT),_0x2a20ae=_0x4f51c6[_0xe32e18(0xd4)];_0x4f51c6[_0xe32e18(0xb7)]&&(console[_0xe32e18(0xbc)](_0xe32e18(0xa8)+_0x40db22+'\x20jobs'),_0x2a20ae&&console[_0xe32e18(0xbc)](_0xe32e18(0xa2)+_0x2a20ae));const _0x241006=await withSpinner(_0xe32e18(0xd2),()=>_0x5145b6[_0xe32e18(0xba)][_0xe32e18(0x9b)]({'from':0x0,'to':_0x40db22-0x1,'status':_0x2a20ae}),{'verbose':_0x4f51c6['verbose']}),_0x5d7b0a=_0x241006[_0xe32e18(0x9c)];console[_0xe32e18(0xbc)](_0xe32e18(0xe3)+_0x5d7b0a['length']+_0xe32e18(0xab)+(_0x5d7b0a[_0xe32e18(0x95)]!==0x1?'s':''));const _0x27e356=_0x4f51c6[_0xe32e18(0x9d)];if(isStructuredFormat(_0x4f51c6)){const _0x57a2be=_0x5d7b0a['map'](_0x1e5f66=>{const _0x49835a=_0xe32e18;let _0x3e9873;if(_0x1e5f66[_0x49835a(0x9e)]&&_0x1e5f66[_0x49835a(0xc2)]){const _0x30aa9a=new Date(_0x1e5f66[_0x49835a(0x9e)])[_0x49835a(0xb2)](),_0x1307ee=new Date(_0x1e5f66[_0x49835a(0xc2)])[_0x49835a(0xb2)]();_0x3e9873=Math[_0x49835a(0xac)]((_0x1307ee-_0x30aa9a)/0x3e8);}return{'job_id':_0x1e5f66[_0x49835a(0xad)],'type':_0x1e5f66[_0x49835a(0xd6)]===_0x49835a(0x99)?_0x49835a(0xaf):_0x1e5f66[_0x49835a(0xd6)],'status':_0x1e5f66[_0x49835a(0xd4)],'user_name':_0x1e5f66[_0x49835a(0xde)],'duration_sec':_0x3e9873,'created_at':_0x1e5f66[_0x49835a(0xbf)],'started_at':_0x1e5f66[_0x49835a(0x9e)],'end_at':_0x1e5f66[_0x49835a(0xc2)]};});await handleSDKOutput(_0x57a2be,_0x4f51c6);}else for(const _0x375217 of _0x5d7b0a){const _0x5ddf3f=_0x375217[_0xe32e18(0xd4)]===_0xe32e18(0xc8)?a27_0x28b99f[_0xe32e18(0xcb)]:_0x375217[_0xe32e18(0xd4)]===_0xe32e18(0xbc)?a27_0x28b99f[_0xe32e18(0x97)]:a27_0x28b99f[_0xe32e18(0xa7)],_0x137c2e=_0x5ddf3f(_0x375217['status']),_0x24dd12=getJobUrl(_0x27e356,_0x375217[_0xe32e18(0xad)]),_0xe1ddb5=hyperlink(_0x375217[_0xe32e18(0xad)],_0x24dd12),_0x569806=a27_0x28b99f['dim'](_0x375217['type']===_0xe32e18(0x99)?_0xe32e18(0xaf):_0x375217['type']),_0x2f12e6=[];if(_0x375217[_0xe32e18(0x9e)]&&_0x375217[_0xe32e18(0xc2)]){const _0x3ee344=Math[_0xe32e18(0xac)]((new Date(_0x375217[_0xe32e18(0xc2)])[_0xe32e18(0xb2)]()-new Date(_0x375217['start_at'])[_0xe32e18(0xb2)]())/0x3e8);_0x2f12e6['push'](formatDuration(_0x3ee344));}if(_0x375217['end_at'])_0x2f12e6[_0xe32e18(0xcd)](formatRelativeTime(new Date(_0x375217[_0xe32e18(0xc2)])));else _0x375217[_0xe32e18(0x9e)]&&_0x2f12e6['push'](formatRelativeTime(new Date(_0x375217[_0xe32e18(0x9e)])));const _0x28a9df=_0x2f12e6[_0xe32e18(0x95)]>0x0?a27_0x28b99f['dim']('\x20'+_0x2f12e6[_0xe32e18(0xbd)](',\x20')):'';console['log']('⚡\x20'+_0xe1ddb5+'\x20'+_0x569806+'\x20'+_0x137c2e+_0x28a9df);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x442de4(0xd1)]='job:show';[a27_0x442de4(0xe7)]=a27_0x442de4(0xe5);['validate'](_0x3f854c){const _0x4630a5=a27_0x442de4,_0x42a961=_0x3f854c[_0x4630a5(0xd7)][0x0];if(!_0x42a961)return _0x4630a5(0xdb);return undefined;}async['execute'](_0x426d90){const _0x5e4815=a27_0x442de4,{options:_0x5595ba,args:_0x26a0e2,tdx:_0x5a7928}=_0x426d90,_0xb728bc=_0x26a0e2[0x0],_0x69b054=await withSpinner(_0x5e4815(0xd0),()=>_0x5a7928[_0x5e4815(0xba)][_0x5e4815(0xdf)](_0xb728bc),{'verbose':_0x5595ba['verbose']}),_0x3cf9cb=_0x69b054[_0x5e4815(0x9c)];let _0x5ac279;if(_0x3cf9cb[_0x5e4815(0x9e)]&&_0x3cf9cb[_0x5e4815(0xc2)]){const _0x511426=new Date(_0x3cf9cb['start_at'])[_0x5e4815(0xb2)](),_0x2198e1=new Date(_0x3cf9cb['end_at'])[_0x5e4815(0xb2)]();_0x5ac279=Math[_0x5e4815(0xac)]((_0x2198e1-_0x511426)/0x3e8);}const _0x2ca293={'job_id':_0x3cf9cb[_0x5e4815(0xad)],'type':_0x3cf9cb[_0x5e4815(0xd6)],'status':_0x3cf9cb[_0x5e4815(0xd4)],..._0x3cf9cb[_0x5e4815(0xde)]&&{'user_name':_0x3cf9cb[_0x5e4815(0xde)]},..._0x5ac279!==undefined&&{'duration_sec':_0x5ac279},..._0x3cf9cb[_0x5e4815(0xbf)]&&{'created_at':_0x3cf9cb[_0x5e4815(0xbf)]},..._0x3cf9cb[_0x5e4815(0x9e)]&&{'started_at':_0x3cf9cb[_0x5e4815(0x9e)]},..._0x3cf9cb[_0x5e4815(0xc2)]&&{'end_at':_0x3cf9cb[_0x5e4815(0xc2)]},..._0x3cf9cb['database']&&{'database':_0x3cf9cb[_0x5e4815(0xb5)]},..._0x3cf9cb[_0x5e4815(0xa0)]!==undefined&&{'priority':_0x3cf9cb[_0x5e4815(0xa0)]},..._0x3cf9cb[_0x5e4815(0xc7)]&&{'url':_0x3cf9cb['url']},..._0x3cf9cb[_0x5e4815(0xce)]&&{'query':_0x3cf9cb['query']},..._0x3cf9cb[_0x5e4815(0x94)]&&{'debug':_0x3cf9cb[_0x5e4815(0x94)]}};return await handleSingleObjectOutput(_0x2ca293,_0x5595ba),0x0;}}function a27_0x582c(){const _0x2a2eda=['2508116Befely','getTime','information_schema','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','database','Submit\x20a\x20job','verbose','1051443sbgTkw','hive','jobs','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','error','join','...','created_at','job:submit','\x27\x20to\x20verify\x20the\x20job\x20status','end_at','validate','limit','Job\x20type:\x20','2390829pduXFt','url','success','Query:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','green','Cancelled','push','query','execute','Getting\x20job\x20details...','name','Listing\x20jobs...','mo\x20ago','status','\x20\x20Job\x20ID:\x20','type','args','✔\x20Retrieved\x20','1954548YKSsec','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','630627RCoRtL','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','user_name','show','6ZENkRH','now','Get\x20job\x20results','✔\x20Found\x20','m\x20ago','Show\x20job\x20details','job:result','description','jobType','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','file','debug','length','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','red','Kill\x20a\x20job','presto','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','list','data','site','start_at','Submitting\x20job...','priority','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Status\x20filter:\x20','INVALID_ARGUMENT','28193728iAbyvA','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','floor','dim','Limit:\x20','substring','3944215VaJLTS','\x20job','round','job_id','just\x20now','trino','result'];a27_0x582c=function(){return _0x2a2eda;};return a27_0x582c();}export class JobKillCommand extends BaseCommand{['name']='job:kill';['description']=a27_0x442de4(0x98);['validate'](_0x4c56cb){const _0x39811e=a27_0x442de4,_0x5dc34b=_0x4c56cb[_0x39811e(0xd7)][0x0];if(!_0x5dc34b)return _0x39811e(0x96);return undefined;}async[a27_0x442de4(0xcf)](_0x14bb32){const _0x447642=a27_0x442de4,{options:_0x1c1712,args:_0xed0273,tdx:_0x1b9e66}=_0x14bb32,_0x36099e=_0xed0273[0x0];if(!_0x1c1712['yes']){const _0x36b397=await confirm(_0x447642(0xb4)+_0x36099e+'?');if(!_0x36b397)return console[_0x447642(0xbc)](_0x447642(0xcc)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x1b9e66[_0x447642(0xba)]['kill'](_0x36099e),{'verbose':_0x1c1712[_0x447642(0xb7)]}),console[_0x447642(0xbc)](_0x447642(0x92)+_0x36099e),console[_0x447642(0xbc)](_0x447642(0xca)+_0x36099e+_0x447642(0xc1)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xc0);['description']=a27_0x442de4(0xb6);async[a27_0x442de4(0xcf)](_0x138a2c){const _0x9a24b4=a27_0x442de4,{options:_0x47f27a,args:_0x324092,tdx:_0xaeb696}=_0x138a2c,_0x58b160=_0x47f27a[_0x9a24b4(0xe8)]||_0x9a24b4(0xaf),_0x590aaa=_0x47f27a[_0x9a24b4(0x93)],_0x26191f=_0x47f27a['database']||_0x9a24b4(0xb3),_0x5230dc=_0x47f27a['result'];if(_0x58b160!==_0x9a24b4(0xaf)&&_0x58b160!==_0x9a24b4(0xb9))throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xa1));let _0x3d2474;if(_0x590aaa){if(_0x324092[0x0])throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xbb));const _0x310d6d=readSqlStatementsFromFile(_0x590aaa);if(_0x310d6d[_0x9a24b4(0x95)]===0x0)throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x310d6d[_0x9a24b4(0x95)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x9a24b4(0x9a));_0x3d2474=_0x310d6d[0x0];}else{if(!_0x324092[0x0])throw new SDKError(ErrorCode[_0x9a24b4(0xa3)],_0x9a24b4(0xa5));_0x3d2474=_0x324092[0x0];}_0x47f27a['verbose']&&(console[_0x9a24b4(0xbc)](_0x9a24b4(0xc5)+_0x58b160),console[_0x9a24b4(0xbc)]('Database:\x20'+_0x26191f),console[_0x9a24b4(0xbc)](_0x9a24b4(0xc9)+_0x3d2474[_0x9a24b4(0xa9)](0x0,0x64)+(_0x3d2474['length']>0x64?_0x9a24b4(0xbe):'')));const _0x2bf56f=await withSpinner(_0x9a24b4(0x9f),()=>_0xaeb696[_0x9a24b4(0xba)]['submit'](_0x26191f,_0x3d2474,_0x58b160,_0x5230dc),{'verbose':_0x47f27a['verbose']}),_0x59086f=_0x2bf56f[_0x9a24b4(0x9c)];return console[_0x9a24b4(0xbc)]('✔\x20Job\x20submitted'),console[_0x9a24b4(0xbc)](_0x9a24b4(0xd5)+_0x59086f['job_id']),await handleSDKOutput([_0x59086f],_0x47f27a),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x442de4(0xd1)]=a27_0x442de4(0xe6);[a27_0x442de4(0xe7)]=a27_0x442de4(0xe2);[a27_0x442de4(0xc3)](_0x31e154){const _0x5b7f49=a27_0x442de4,_0x7a33f5=_0x31e154[_0x5b7f49(0xd7)][0x0];if(!_0x7a33f5)return _0x5b7f49(0xdd);return undefined;}async[a27_0x442de4(0xcf)](_0x5bfa92){const _0xddf19b=a27_0x442de4,{options:_0x503bf2,args:_0x54cea7,tdx:_0x2c1078}=_0x5bfa92,_0x3cf430=_0x54cea7[0x0],_0x2a6d37=await withSpinner('Getting\x20job\x20results...',()=>_0x2c1078['jobs'][_0xddf19b(0xb0)](_0x3cf430),{'verbose':_0x503bf2[_0xddf19b(0xb7)]}),_0xa0abfe=_0x2a6d37['data'];return console[_0xddf19b(0xbc)](_0xddf19b(0xd8)+_0xa0abfe[_0xddf19b(0x95)]+'\x20row'+(_0xa0abfe[_0xddf19b(0x95)]!==0x1?'s':'')),await handleSDKOutput(_0xa0abfe,_0x503bf2),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x22fcc0=a26_0x1cca;(function(_0x5a37eb,_0xbc8c9e){const _0x9941d3=a26_0x1cca,_0x43fd17=_0x5a37eb();while(!![]){try{const _0x446016=parseInt(_0x9941d3(0xc0))/0x1+parseInt(_0x9941d3(0x14e))/0x2+parseInt(_0x9941d3(0x17d))/0x3+parseInt(_0x9941d3(0xc2))/0x4+-parseInt(_0x9941d3(0xe7))/0x5*(-parseInt(_0x9941d3(0xd4))/0x6)+parseInt(_0x9941d3(0x148))/0x7*(parseInt(_0x9941d3(0x16e))/0x8)+-parseInt(_0x9941d3(0xd6))/0x9*(parseInt(_0x9941d3(0x121))/0xa);if(_0x446016===_0xbc8c9e)break;else _0x43fd17['push'](_0x43fd17['shift']());}catch(_0x2cca7a){_0x43fd17['push'](_0x43fd17['shift']());}}}(a26_0x462a,0x61b60));import a26_0x3b9971 from'chalk';function a26_0x1cca(_0x1f8b7d,_0x2231ab){_0x1f8b7d=_0x1f8b7d-0xa8;const _0x462a02=a26_0x462a();let _0x1cca48=_0x462a02[_0x1f8b7d];return _0x1cca48;}import a26_0x30379f from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x5e045e){const _0x2b7e49=a26_0x1cca;return!_0x5e045e&&(console[_0x2b7e49(0xc8)](_0x2b7e49(0x1ae)),console['error'](_0x2b7e49(0xf3))),!!_0x5e045e;}function withJsonFormat(_0x3856e9){const _0x4b06ff=a26_0x1cca;if(!_0x3856e9[_0x4b06ff(0x13a)]&&!_0x3856e9['json']&&!_0x3856e9['jsonl']&&!_0x3856e9['tsv'])return{..._0x3856e9,'format':_0x4b06ff(0x10c),'json':!![]};return _0x3856e9;}function a26_0x462a(){const _0x35052a=['Write\x20','.yml','resolveParentId','\x20\x20Folder\x20path:\x20','resume','connection','parentSegment','site','\x22\x20resumed','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x0aChanges\x20to\x20\x27','8tXIODH','folderPath','segmentPushCommand','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','getStatistics','localeCompare','Getting\x20journey\x20details...','helpText','exitOrJumpSize','parent_segment','filter','links','Error:\x20Invalid\x20--type\x20\x22','attributes','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','2315910lPwUlf','journey:resume','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','versionNumber','Fetching\x20','isNew','Target\x20file:\x20','errorCode','\x20\x20Statistics\x20not\x20available','sort','absolutePath','journeyId','set','tdx.json','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','jsonl','listJourneysFromParentSegment','journey:traffic','history','find','name','\x20\x20-\x20','journey:version:create','\x20versions)','Fetching\x20users\x20and\x20connections...','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','setPhase','journey:list','data','Error:\x20Stage\x20\x22','description','\x5c$&','\x22\x20paused','getParentFull','getLatestJourneyId','web','Getting\x20journey\x20traffic\x20data...','add','Error:\x20Journey\x20not\x20found:\x20','Creating\x20new\x20version...','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','has','\x20\x20Name:\x20','Getting\x20column\x20mapping...','file','Target\x20directory:\x20','values','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Fetching\x20journeys\x20and\x20folders...','red','getActivation','renderStats','segmentName','Show\x20journey\x20statistics','stringify','milestoneSize','createdAt','activationParams','green','buildIdToEmailMap','conversion','listVersions','replace','✔\x20Pulled\x20','join','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','completed','\x20not\x20found.\x20Available:\x20','all','✔\x20Journey\x20\x22','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','diff','775258fexTIZ','from','876320KZPtox','Aborted.','utf-8','\x20(ID:\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Error:\x20Parent\x20segment\x20context\x20required','error','resolveSegment','no_parent','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Export\x20journey(s)\x20as\x20YAML\x20files','filePath','journeys','message','Parent\x20segment:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','user','journeyName','486402VXAThm','journeyBundleId','6129SmxEqj','INVALID_ARGUMENT','\x20=\x20','Error:\x20Invalid\x20version\x20number:\x20','\x0aError:','updatedAt','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journey','Resolving\x20parent\x20segment...','stages','\x20\x20Target:\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)','journey:pull','Error:\x20Version\x20','Table:\x20','🗺️\x20','draft','5XQwyyA','\x20\x20Consolidating\x20duplicate\x20segment:\x20','verbose','paused','(paused)','database','listActivationsFlat','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20(draft)\x20—\x20\x22','rootFolderId','\x20Opening\x20','Listing\x20journeys...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','length','getTrafficData','/e/','\x20new\x20files','journey:columns','journey:stats','size','connector_config','Resuming\x20journey...','resourceName','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','folderId','options','split','reentryMode','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','(running)','execute','table','List\x20all\x20versions\x20of\x20a\x20journey','Folder\x20path:\x20','Options:','yellow','/j/da','json','dim','Show\x20journey\x20table\x20column\x20mapping','includeHistory','/j/da/je','type','(draft)','\x20Created\x20v','/app/ps/','get','columns','Listing\x20journey\x20activations...','\x20\x20Journey\x20ID:\x20','archived','Input:\x20','(archived)','Pause\x20a\x20running\x20journey','List\x20journeys\x20in\x20current\x20context','exitOrJumpRate','listFolders','log','37760pUPoWX','Error:\x20Journey\x20\x27','Cancelled','pause','audienceId','root\x20folder','Show\x20journey\x20details','getSegment','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','segment','Error:\x20','\x20->\x20','map','then','\x20\x20Parent\x20segment:\x20','Error:\x20--version\x20option\x20is\x20required','...','journey:view','completeMilestoneRate','toLowerCase','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','buildIdToNameMap','push','activation','(root)','format','createVersion','journey:pause','hasChanges','journey:version:view','session','yes','repeat','parentName','goal','journeyBundleName','content','hasPeriod','journey:push','2938271FnlTlx','Found\x20','rule','-\x20no\x20files\x20written','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','enteredSize','1409104bLuBbH','Getting\x20version\x20','state','(completed)','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','cwd','args','entries','Resolving\x20journey...','Journey\x20name:\x20','List\x20activations\x20for\x20a\x20journey','\x20(rule\x20match)','cyan','Getting\x20journey\x20statistics...','✔\x20Found\x20','Listing\x20journey\x20versions...','base','nodes','getJourney','blue','limit'];a26_0x462a=function(){return _0x35052a;};return a26_0x462a();}function formatJourneyState(_0x397547){const _0x21828f=a26_0x1cca;switch(_0x397547){case'launched':return a26_0x3b9971[_0x21828f(0xb2)](_0x21828f(0x104));case _0x21828f(0xe6):return a26_0x3b9971[_0x21828f(0x10d)](_0x21828f(0x112));case _0x21828f(0xea):return a26_0x3b9971['yellow'](_0x21828f(0xeb));case _0x21828f(0xba):return a26_0x3b9971[_0x21828f(0x161)](_0x21828f(0x151));case _0x21828f(0x119):return a26_0x3b9971['dim'](_0x21828f(0x11b));default:return'('+_0x397547+')';}}function formatJourneyItem(_0x47525,_0x68267f='',_0x5b6e40){const _0x2a60b8=a26_0x1cca,_0x48d6ee=formatJourneyState(_0x47525['state']),_0x1876fd=_0x5b6e40?hyperlink(_0x47525[_0x2a60b8(0x144)],_0x5b6e40):_0x47525[_0x2a60b8(0x144)];return _0x68267f+_0x2a60b8(0xe5)+_0x1876fd+'\x20'+_0x48d6ee;}function escapeRegex(_0x37ddfa){const _0x154c29=a26_0x1cca;return _0x37ddfa[_0x154c29(0xb6)](/[.*+?^${}()|[\]\\]/g,_0x154c29(0x19e));}function globToRegex(_0x42fdba){const _0x149f25=a26_0x1cca,_0x499e2e=_0x42fdba[_0x149f25(0x101)]('*')['map'](escapeRegex);return new RegExp(_0x499e2e[_0x149f25(0xb8)]('.*'),'i');}function buildRuleToNameMapping(_0x5c5297){const _0x5654db=a26_0x1cca,_0x272157=new Map();if(_0x5c5297['segments'])for(const [_0x189e1b,_0x54bf72]of Object[_0x5654db(0x155)](_0x5c5297['segments'])){if(_0x54bf72[_0x5654db(0x14a)]){const _0x5d4860=serializeRule(_0x54bf72[_0x5654db(0x14a)]),_0x170eeb=_0x272157['get'](_0x5d4860);_0x170eeb?_0x170eeb[_0x5654db(0x137)](_0x189e1b):_0x272157[_0x5654db(0x189)](_0x5d4860,[_0x189e1b]);}}return _0x272157;}async function resolveJourneyIdFromInput(_0x3dd6a3,_0xe07e3b,_0x15d9ff){const _0x32b409=a26_0x1cca,_0x56585b=await resolveJourneyTarget(_0x3dd6a3,_0xe07e3b[_0x32b409(0x169)],_0xe07e3b[_0x32b409(0xe9)]),_0x14617e=_0x56585b[_0x32b409(0x169)];if(!_0x14617e)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x5dc172=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x15d9ff['segment'][_0x32b409(0x165)](_0x14617e),{'verbose':_0xe07e3b[_0x32b409(0xe9)]}),_0x5085b0=_0x5dc172[_0x32b409(0x19b)],_0x361974=await withSpinner(_0x32b409(0x156),()=>_0x15d9ff['journey']['resolveJourneyId'](_0x5085b0,_0x56585b[_0x32b409(0xd3)]),{'verbose':_0xe07e3b[_0x32b409(0xe9)]});return{'journeyId':_0x361974[_0x32b409(0x19b)],'journeyName':_0x56585b[_0x32b409(0xd3)],'parentSegmentId':_0x5085b0};}async function resolveJourneyTarget(_0x21e365,_0x3d3384,_0x15df5a){const _0x3df941=a26_0x1cca;if(isYamlFilePath(_0x21e365))try{const _0x160bb1=await resolveYamlFilePath(_0x21e365);return _0x15df5a&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x21e365),console[_0x3df941(0xc8)](_0x3df941(0x12f)+_0x160bb1[_0x3df941(0x169)]),console['error'](_0x3df941(0x1a9)+_0x160bb1[_0x3df941(0xac)]),console['error'](_0x3df941(0x166)+(_0x160bb1[_0x3df941(0x16f)]||_0x3df941(0x139)))),{'journeyName':_0x160bb1[_0x3df941(0xac)],'parentSegment':_0x160bb1[_0x3df941(0x169)],'resolved':_0x160bb1};}catch(_0x26b57f){throw new SDKError(ErrorCode[_0x3df941(0xd7)],_0x3df941(0xd1)+_0x26b57f[_0x3df941(0xcf)]);}if(!_0x3d3384)throw new SDKError(ErrorCode[_0x3df941(0xd7)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x21e365,'parentSegment':_0x3d3384};}export class JourneyListCommand extends BaseCommand{['name']=a26_0x22fcc0(0x19a);[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0x11d);async[a26_0x22fcc0(0x105)](_0x3f423b){const _0x385b30=a26_0x22fcc0,{options:_0x58c02f,args:_0x4b6912,tdx:_0x40acf7}=_0x3f423b,_0xc5cb2e=_0x4b6912[0x0],_0x38517e=_0x58c02f[_0x385b30(0x169)];if(!_0x38517e)return console['error'](_0x385b30(0xc7)),console[_0x385b30(0xc8)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x139590=await withSpinner(_0x385b30(0xde),()=>_0x40acf7[_0x385b30(0x12a)][_0x385b30(0x165)](_0x38517e),{'verbose':_0x58c02f[_0x385b30(0xe9)]}),_0x182fc1=_0x139590[_0x385b30(0x19b)];_0x58c02f[_0x385b30(0xe9)]&&(console['error'](_0x385b30(0xd0)+_0x38517e+_0x385b30(0xc5)+_0x182fc1+')'),_0xc5cb2e&&console[_0x385b30(0xc8)]('Pattern:\x20'+_0xc5cb2e));const _0x3fb5d6=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x40acf7[_0x385b30(0x12a)][_0x385b30(0x1a0)](_0x182fc1),{'verbose':_0x58c02f[_0x385b30(0xe9)]}),_0x4aa3a0=_0x3fb5d6['data'],_0x648597=_0x4aa3a0[_0x385b30(0xf0)],_0x5c249e=await withSpinner(_0x385b30(0xf2),()=>_0x40acf7[_0x385b30(0xdd)]['listJourneysWithFolders'](_0x182fc1,_0x648597),{'verbose':_0x58c02f[_0x385b30(0xe9)]});let _0x5720bf=_0x5c249e[_0x385b30(0x19b)][_0x385b30(0xce)];const _0x1f2873=_0x5c249e[_0x385b30(0x19b)]['folders'],_0x287c5a=new Map();for(const _0x350d6c of _0x1f2873){_0x287c5a['set'](_0x350d6c['id'],_0x350d6c['name']);}if(_0xc5cb2e){const _0x1dfa34=globToRegex(_0xc5cb2e);_0x5720bf=_0x5720bf['filter'](_0x461e68=>_0x1dfa34['test'](_0x461e68[_0x385b30(0x144)]));}console[_0x385b30(0xc8)](_0x385b30(0x15c)+_0x5720bf[_0x385b30(0xf4)]+'\x20journey'+(_0x5720bf[_0x385b30(0xf4)]!==0x1?'s':''));const _0x5dd9a2=_0x24c7f5=>{const _0x475a5f=_0x385b30;return getConsoleNextUrl(_0x58c02f[_0x475a5f(0x16a)],'/app/ps/'+_0x182fc1+_0x475a5f(0xf6)+_0x24c7f5+_0x475a5f(0x10b));};if(_0x58c02f[_0x385b30(0x13a)]===_0x385b30(0x106))await handleSDKOutput(_0x5720bf,_0x58c02f);else{if(_0x58c02f[_0x385b30(0x13a)]===_0x385b30(0x10c)){const _0x2c73da=_0x5720bf[_0x385b30(0x12d)](_0x35926f=>({..._0x35926f,'url':_0x5dd9a2(_0x35926f['id'])}));await handleSDKOutput(_0x2c73da,_0x58c02f);}else{console[_0x385b30(0x120)]('['+_0x38517e+']');const _0x39f258=new Map(),_0x57bd31=[];for(const _0x5c6816 of _0x5720bf){if(!_0x5c6816[_0x385b30(0xff)]||_0x5c6816[_0x385b30(0xff)]===_0x648597)_0x57bd31['push'](_0x5c6816);else{const _0x39b6a5=_0x39f258[_0x385b30(0x115)](_0x5c6816['folderId'])||[];_0x39b6a5[_0x385b30(0x137)](_0x5c6816),_0x39f258['set'](_0x5c6816['folderId'],_0x39b6a5);}}const _0x1927cb=(_0x596cf4,_0x1fcc7d)=>_0x596cf4[_0x385b30(0x144)]['localeCompare'](_0x1fcc7d['journeyBundleName'],undefined,{'sensitivity':'base'});_0x57bd31['sort'](_0x1927cb);for(const _0xd0305a of _0x57bd31){console[_0x385b30(0x120)](formatJourneyItem(_0xd0305a,'',_0x5dd9a2(_0xd0305a['id'])));}const _0xfeeb1=[..._0x39f258[_0x385b30(0x155)]()]['sort']((_0x132a6d,_0x4d10ee)=>{const _0x309af2=_0x385b30,_0x243365=_0x287c5a[_0x309af2(0x115)](_0x132a6d[0x0])||_0x132a6d[0x0],_0x24aa66=_0x287c5a['get'](_0x4d10ee[0x0])||_0x4d10ee[0x0];return _0x243365[_0x309af2(0x173)](_0x24aa66,undefined,{'sensitivity':_0x309af2(0x15e)});});for(const [_0x36e305,_0x117972]of _0xfeeb1){const _0x34e9a1=_0x287c5a[_0x385b30(0x115)](_0x36e305)||_0x36e305;console[_0x385b30(0x120)]('📁\x20'+_0x34e9a1),_0x117972[_0x385b30(0x186)](_0x1927cb);for(const _0x581e9a of _0x117972){console[_0x385b30(0x120)](formatJourneyItem(_0x581e9a,'\x20\x20',_0x5dd9a2(_0x581e9a['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0x22fcc0(0x191)]=a26_0x22fcc0(0x132);[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0x127);async[a26_0x22fcc0(0x105)](_0x444f90){const _0x1cd13a=a26_0x22fcc0,{options:_0x512cc6,args:_0x17d5f6,tdx:_0x55c0b0}=_0x444f90,_0x448ce4=_0x17d5f6[0x0];if(!_0x448ce4)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x1cd13a(0xc8)](_0x1cd13a(0xfe)),console['error'](_0x1cd13a(0x109)),console['error'](_0x1cd13a(0xee)),0x1;_0x512cc6['verbose']&&console[_0x1cd13a(0xc8)](_0x1cd13a(0x11a)+_0x448ce4);const {journeyId:_0x5c1610,parentSegmentId:_0x1f8f7f}=await resolveJourneyIdFromInput(_0x448ce4,_0x512cc6,_0x55c0b0);if(_0x512cc6[_0x1cd13a(0x1a2)]){const _0x559a89=getConsoleNextUrl(_0x512cc6[_0x1cd13a(0x16a)],_0x1cd13a(0x114)+_0x1f8f7f+'/e/'+_0x5c1610+_0x1cd13a(0x110));return console[_0x1cd13a(0xc8)](a26_0x3b9971[_0x1cd13a(0xb2)]('✔')+_0x1cd13a(0xf1)+a26_0x3b9971[_0x1cd13a(0x15a)](_0x559a89)),openBrowser(_0x559a89),0x0;}const _0x32b446=await withSpinner(_0x1cd13a(0x174),()=>_0x55c0b0[_0x1cd13a(0xdd)][_0x1cd13a(0x160)](_0x5c1610),{'verbose':_0x512cc6[_0x1cd13a(0xe9)]}),_0x22ff60=_0x32b446[_0x1cd13a(0x19b)],_0x50c20c=_0x512cc6['includeStats'];let _0x364e61;if(_0x50c20c)try{const _0x579ccb=await withSpinner(_0x1cd13a(0x15b),()=>_0x55c0b0['journey'][_0x1cd13a(0x172)](_0x5c1610),{'verbose':_0x512cc6[_0x1cd13a(0xe9)]});_0x364e61=_0x579ccb[_0x1cd13a(0x19b)];}catch{_0x512cc6[_0x1cd13a(0xe9)]&&console[_0x1cd13a(0xc8)](_0x1cd13a(0x185));}const _0x1c2178=getConsoleNextUrl(_0x512cc6[_0x1cd13a(0x16a)],'/app/ps/'+_0x1f8f7f+_0x1cd13a(0xf6)+_0x5c1610+_0x1cd13a(0x110)),_0x383bef={'id':_0x22ff60['id'],'name':_0x22ff60[_0x1cd13a(0x17b)][_0x1cd13a(0x191)],'description':_0x22ff60[_0x1cd13a(0x17b)]['description'],'state':_0x22ff60['attributes'][_0x1cd13a(0x150)],'paused':_0x22ff60[_0x1cd13a(0x17b)][_0x1cd13a(0xea)],'reentry_mode':_0x22ff60[_0x1cd13a(0x17b)][_0x1cd13a(0x102)],'stages':_0x22ff60[_0x1cd13a(0x17b)]['journeyStages']?.[_0x1cd13a(0xf4)]||0x0,..._0x22ff60['attributes'][_0x1cd13a(0x143)]&&{'goal':_0x22ff60['attributes'][_0x1cd13a(0x143)][_0x1cd13a(0x191)]},..._0x364e61&&{'statistics':{'size':_0x364e61[_0x1cd13a(0xfa)],'entered':_0x364e61[_0x1cd13a(0x14d)],'goal_achieved':_0x364e61['goalSize'],'completion_rate':_0x364e61['completionRate'],'exit_or_jump':_0x364e61[_0x1cd13a(0x176)],'exit_or_jump_rate':_0x364e61[_0x1cd13a(0x11e)],'stages':_0x364e61['stages']}},'url':_0x1c2178};return await handleSingleObjectOutput(_0x383bef,_0x512cc6),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a26_0x22fcc0(0xf9);[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0xad);async[a26_0x22fcc0(0x105)](_0x1f6ab2){const _0x20a70b=a26_0x22fcc0,{options:_0x5e0416,args:_0x1f4e79,tdx:_0x264dea}=_0x1f6ab2,_0x1be577=_0x1f4e79[0x0];if(!requireNameOrPath(_0x1be577))return 0x1;_0x5e0416['verbose']&&console[_0x20a70b(0xc8)](_0x20a70b(0x11a)+_0x1be577);const _0x64e86=_0x5e0416,_0x2066ac=_0x64e86[_0x20a70b(0xc1)],_0x215791=_0x64e86['to'],_0xd86925=_0x64e86[_0x20a70b(0x10f)],_0x22c8d6=_0x64e86['stage'];_0xd86925&&!_0x2066ac&&!_0x215791&&console[_0x20a70b(0xc8)](_0x20a70b(0x17c));const _0x76bd=_0xd86925?withJsonFormat(_0x5e0416):_0x5e0416,{journeyId:_0x2a13e8,journeyName:_0x3f1152}=await resolveJourneyIdFromInput(_0x1be577,_0x76bd,_0x264dea),_0x30b3fa=_0x2066ac||_0x215791?{'from':_0x2066ac,'to':_0x215791}:undefined,_0x579bf6=await withSpinner(_0x20a70b(0x15b),()=>Promise[_0x20a70b(0xbc)]([_0x264dea[_0x20a70b(0xdd)]['getJourney'](_0x2a13e8),_0x264dea[_0x20a70b(0xdd)]['getStatistics'](_0x2a13e8,_0x30b3fa)]),{'verbose':_0x76bd[_0x20a70b(0xe9)]}),[_0x1e93c6,_0x4051a7]=_0x579bf6[_0x20a70b(0x19b)];if(!_0x4051a7||_0x4051a7[_0x20a70b(0x188)]===null)return console[_0x20a70b(0xc8)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x3f1152),console['error']('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x409d8b=buildStageNameMap(_0x1e93c6),_0x10258d=!!(_0x30b3fa&&_0x4051a7[_0x20a70b(0x18f)]?.[_0x20a70b(0xf4)]),_0xc439c9={'stageNameMap':_0x409d8b,'hasPeriod':_0x10258d,'includeHistory':!!_0xd86925};if(_0x22c8d6&&_0x4051a7[_0x20a70b(0xdf)]){const _0x59203c=_0x4051a7[_0x20a70b(0xdf)][_0x20a70b(0x190)](_0x465859=>{const _0x33e172=_0x20a70b,_0x303cdd=_0x409d8b[_0x33e172(0x115)](_0x465859['id'])??'';return _0x303cdd['toLowerCase']()===_0x22c8d6[_0x33e172(0x134)]();});if(_0x59203c)return await handleSingleObjectOutput(formatStageStats(_0x59203c,_0xc439c9),_0x76bd),0x0;const _0x3b6465=_0x4051a7[_0x20a70b(0xdf)][_0x20a70b(0x12d)](_0xe10125=>_0x409d8b[_0x20a70b(0x115)](_0xe10125['id'])??_0xe10125['id']);return console[_0x20a70b(0xc8)](_0x20a70b(0x19c)+_0x22c8d6+'\x22\x20not\x20found'),console[_0x20a70b(0xc8)]('Available\x20stages:\x20'+_0x3b6465[_0x20a70b(0xb8)](',\x20')),0x1;}const _0x94c69f=_0x4051a7[_0x20a70b(0xdf)]?.[_0x20a70b(0x12d)](_0x43d3fd=>formatStageStats(_0x43d3fd,_0xc439c9)),_0x26cc66=assembleJourneyStats(_0x4051a7,{'from':_0x2066ac,'to':_0x215791,'includeHistory':_0xd86925});return await this[_0x20a70b(0xab)](_0x26cc66,_0x94c69f??[],_0x76bd),0x0;}async['renderStats'](_0x8837e3,_0x4acb6f,_0x20c9fa){const _0x583f00=a26_0x22fcc0,_0x34575e=_0x20c9fa['format']===_0x583f00(0x10c)||_0x20c9fa['format']===_0x583f00(0x18c)||_0x20c9fa[_0x583f00(0x10c)]||_0x20c9fa[_0x583f00(0x18c)];if(_0x34575e){_0x8837e3['stages']=_0x4acb6f,await handleSingleObjectOutput(_0x8837e3,_0x20c9fa);return;}await handleSingleObjectOutput(_0x8837e3,_0x20c9fa);for(const _0x32627d of _0x4acb6f){console[_0x583f00(0x120)](''),console[_0x583f00(0x120)](String(a26_0x3b9971[_0x583f00(0x15a)]['bold']('['+_0x32627d[_0x583f00(0x191)]+']'))+a26_0x3b9971[_0x583f00(0x10d)]('\x20'+_0x32627d['id']));const {id:_0x5846bf,name:_0x1ef318,..._0x2b4755}=_0x32627d;await handleSingleObjectOutput(_0x2b4755,_0x20c9fa);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a26_0x22fcc0(0x18e);['description']=a26_0x22fcc0(0x17f);async[a26_0x22fcc0(0x105)](_0x355ae4){const _0x311e15=a26_0x22fcc0,{options:_0x1169bb,args:_0x5e2738,tdx:_0x546e2c}=_0x355ae4,_0x163c74=_0x5e2738[0x0];if(!requireNameOrPath(_0x163c74))return 0x1;_0x1169bb[_0x311e15(0xe9)]&&console[_0x311e15(0xc8)](_0x311e15(0x11a)+_0x163c74);const _0x3159b2=_0x1169bb,_0x36b5a9=_0x3159b2[_0x311e15(0x111)],_0x5ec1ed=_0x3159b2['from'],_0x381152=_0x3159b2['to'],_0x141c89=_0x3159b2[_0x311e15(0x162)];if(_0x36b5a9&&_0x36b5a9!==_0x311e15(0xb4)&&_0x36b5a9!=='activation')return console[_0x311e15(0xc8)](_0x311e15(0x17a)+_0x36b5a9+_0x311e15(0xdc)),0x1;const _0x4da079=withJsonFormat(_0x1169bb),{journeyId:_0x50881f,journeyName:_0x1d78e5}=await resolveJourneyIdFromInput(_0x163c74,_0x4da079,_0x546e2c),_0x4fa906={'type':_0x36b5a9,'from':_0x5ec1ed,'to':_0x381152,'limit':_0x141c89},_0x3a5656=await withSpinner(_0x311e15(0x1a3),()=>_0x546e2c['journey'][_0x311e15(0xf5)](_0x50881f,_0x4fa906),{'verbose':_0x4da079['verbose']}),_0x1532be=_0x3a5656[_0x311e15(0x19b)],_0x5cc284=_0x1532be[_0x311e15(0xb4)]&&(_0x1532be['conversion'][_0x311e15(0x15f)][_0x311e15(0xf4)]>0x0||_0x1532be[_0x311e15(0xb4)][_0x311e15(0x179)]['length']>0x0),_0x159331=_0x1532be['activation']&&_0x1532be[_0x311e15(0x138)]['length']>0x0;if(!_0x5cc284&&!_0x159331)return console[_0x311e15(0xc8)](_0x311e15(0x1a7)+_0x1d78e5),console['error'](_0x311e15(0x196)),_0x5ec1ed&&_0x381152&&console[_0x311e15(0xc8)](_0x311e15(0x103)),0x0;return await handleSingleObjectOutput(_0x1532be,_0x4da079),0x0;}}function formatStageStats(_0x3de6d9,_0x223cec){const _0x23f497=a26_0x22fcc0,_0x5673c8=_0x223cec[_0x23f497(0x146)]&&_0x3de6d9['history']?.['length']?aggregateStageHistory(_0x3de6d9['history']):{'size':_0x3de6d9['size'],'entered':_0x3de6d9[_0x23f497(0x14d)],'milestone':_0x3de6d9[_0x23f497(0xaf)],'milestone_rate':_0x3de6d9[_0x23f497(0x133)],'exit_or_jump':_0x3de6d9['exitOrJumpSize'],'exit_or_jump_rate':_0x3de6d9[_0x23f497(0x11e)]},_0x36f155={'id':_0x3de6d9['id'],'name':_0x223cec['stageNameMap'][_0x23f497(0x115)](_0x3de6d9['id'])??_0x3de6d9['id'],..._0x5673c8};return _0x223cec['hasPeriod']&&_0x223cec[_0x23f497(0x10f)]&&_0x3de6d9['history']&&(_0x36f155[_0x23f497(0x18f)]=_0x3de6d9['history']),_0x36f155;}export class JourneyPauseCommand extends BaseCommand{[a26_0x22fcc0(0x191)]=a26_0x22fcc0(0x13c);[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0x11c);async['execute'](_0xf95ffe){const _0x1ad326=a26_0x22fcc0,{options:_0x43107e,args:_0x8d3e4a,tdx:_0x4400e6}=_0xf95ffe,_0x227044=_0x8d3e4a[0x0];if(!requireNameOrPath(_0x227044))return 0x1;_0x43107e[_0x1ad326(0xe9)]&&console['error']('Input:\x20'+_0x227044);const {journeyId:_0x264124,journeyName:_0x24c65c}=await resolveJourneyIdFromInput(_0x227044,_0x43107e,_0x4400e6);if(!_0x43107e[_0x1ad326(0x140)]){const _0x4ca412=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x24c65c+'\x22?');if(!_0x4ca412)return console['error']('Cancelled'),0x0;}const _0x259b18=await withSpinner('Pausing\x20journey...',()=>_0x4400e6['journey'][_0x1ad326(0x124)](_0x264124),{'verbose':_0x43107e[_0x1ad326(0xe9)]}),_0x5b535e=_0x259b18[_0x1ad326(0x19b)];return console[_0x1ad326(0xc8)]('✔\x20Journey\x20\x22'+_0x5b535e[_0x1ad326(0x17b)][_0x1ad326(0x191)]+_0x1ad326(0x19f)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x22fcc0(0x191)]=a26_0x22fcc0(0x17e);[a26_0x22fcc0(0x19d)]='Resume\x20a\x20paused\x20journey';async[a26_0x22fcc0(0x105)](_0x209aee){const _0x42bb8f=a26_0x22fcc0,{options:_0x3bb756,args:_0x126850,tdx:_0x260305}=_0x209aee,_0x4353ec=_0x126850[0x0];if(!requireNameOrPath(_0x4353ec))return 0x1;_0x3bb756[_0x42bb8f(0xe9)]&&console[_0x42bb8f(0xc8)](_0x42bb8f(0x11a)+_0x4353ec);const {journeyId:_0x54ffd9,journeyName:_0x550c05}=await resolveJourneyIdFromInput(_0x4353ec,_0x3bb756,_0x260305);if(!_0x3bb756['yes']){const _0x4ec301=await confirm(_0x42bb8f(0xcb)+_0x550c05+'\x22?');if(!_0x4ec301)return console[_0x42bb8f(0xc8)](_0x42bb8f(0x123)),0x0;}const _0x1a8511=await withSpinner(_0x42bb8f(0xfc),()=>_0x260305[_0x42bb8f(0xdd)][_0x42bb8f(0x167)](_0x54ffd9),{'verbose':_0x3bb756[_0x42bb8f(0xe9)]}),_0x29ef85=_0x1a8511[_0x42bb8f(0x19b)];return console[_0x42bb8f(0xc8)](_0x42bb8f(0xbd)+_0x29ef85[_0x42bb8f(0x17b)][_0x42bb8f(0x191)]+_0x42bb8f(0x16b)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a26_0x22fcc0(0xe2);['description']=a26_0x22fcc0(0xcc);async['execute'](_0x2c74b7){const _0x19377d=a26_0x22fcc0,{options:_0x11d3fe,args:_0x5e884b,tdx:_0xa5a187}=_0x2c74b7,_0x55aff0=_0x11d3fe,_0x2f8589=_0x5e884b[0x0],_0x4a6fe9=_0x2f8589&&isYamlFilePath(_0x2f8589),_0x302224=await resolveTarget({'arg':_0x4a6fe9?_0x2f8589:undefined,'contextParent':_0x11d3fe['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x302224))return _0x302224[_0x19377d(0x184)]===_0x19377d(0xca)?(console[_0x19377d(0xc8)](a26_0x3b9971[_0x19377d(0x10a)](_0x19377d(0xbe))),console[_0x19377d(0xc8)](_0x19377d(0xe1)),console[_0x19377d(0xc8)](_0x19377d(0x135)),console[_0x19377d(0xc8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x19377d(0xc8)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x19377d(0xc8)](a26_0x3b9971['red'](_0x19377d(0x12b)+_0x302224[_0x19377d(0xcf)]+'\x0a')),_0x302224[_0x19377d(0x175)]&&console[_0x19377d(0xc8)](a26_0x3b9971['cyan'](_0x302224[_0x19377d(0x175)]))),0x1;let _0x1a9497=_0x4a6fe9?undefined:_0x2f8589,_0x35faef,_0x5d2dbe;_0x302224[_0x19377d(0x111)]===_0x19377d(0x1ab)&&(_0x1a9497=_0x302224[_0x19377d(0xfd)],_0x35faef=_0x302224[_0x19377d(0xcd)],_0x5d2dbe=_0x302224['folderPath']);const _0x2f960b=_0x302224[_0x19377d(0x142)],_0x1cbe38=_0x302224['targetDir'];_0x55aff0[_0x19377d(0xe9)]&&(console[_0x19377d(0xc8)](_0x19377d(0xd0)+_0x2f960b),console['error'](_0x19377d(0x1ac)+_0x1cbe38),_0x1a9497&&console['error'](_0x19377d(0x157)+_0x1a9497),_0x35faef&&console[_0x19377d(0xc8)](_0x19377d(0x183)+_0x35faef),_0x5d2dbe&&console['error'](_0x19377d(0x108)+_0x5d2dbe));const _0x509574=await withSpinner('Resolving\x20parent\x20segment...',()=>_0xa5a187['segment'][_0x19377d(0x165)](_0x2f960b),{'verbose':_0x11d3fe['verbose']}),_0x204435=_0x509574[_0x19377d(0x19b)],{journeys:_0x38094e,folders:_0x29ae86}=await withSpinner(_0x19377d(0xa8),async()=>{const _0xc3b899=_0x19377d,[_0x32dda5,_0x57fc4b]=await Promise['all']([_0xa5a187['journey'][_0xc3b899(0x18d)](_0x204435,undefined,{'includeAllVersions':!![]}),_0xa5a187[_0xc3b899(0x12a)][_0xc3b899(0x11f)](_0x204435)]);return{'journeys':_0x32dda5,'folders':_0x57fc4b};},{'verbose':_0x11d3fe[_0x19377d(0xe9)]})[_0x19377d(0x12e)](_0xfae39a=>_0xfae39a['data']);let _0x447ac7=_0x38094e;const _0x21e8d2=buildFolderIdToPathMap(_0x29ae86);if(_0x1a9497){const _0x2a91a3=_0x447ac7['filter'](_0x4fe771=>_0x4fe771['journeyBundleName']['toLowerCase']()===_0x1a9497['toLowerCase']());if(_0x2a91a3[_0x19377d(0xf4)]===0x0)return console[_0x19377d(0xc8)](_0x19377d(0x1a5)+_0x1a9497),console[_0x19377d(0xc8)](_0x19377d(0xb9)),0x1;_0x447ac7=_0x2a91a3;}if(_0x5d2dbe!==undefined){const _0x2e47ec=_0x447ac7['filter'](_0xbb4ce4=>{const _0x166864=_0x19377d,_0x22afb1=_0xbb4ce4[_0x166864(0xff)]?_0x21e8d2[_0x166864(0x115)](_0xbb4ce4[_0x166864(0xff)])||'':'';return _0x22afb1===_0x5d2dbe;});if(_0x2e47ec[_0x19377d(0xf4)]===0x0&&_0x447ac7[_0x19377d(0xf4)]>0x0){console[_0x19377d(0xc8)](_0x19377d(0x122)+_0x1a9497+'\x27\x20not\x20found\x20in\x20'+(_0x5d2dbe||_0x19377d(0x126))),console[_0x19377d(0xc8)](_0x19377d(0x18b));for(const _0x1c54ec of _0x447ac7){const _0x32d0b5=_0x1c54ec[_0x19377d(0xff)]?_0x21e8d2[_0x19377d(0x115)](_0x1c54ec[_0x19377d(0xff)])||'':'';console[_0x19377d(0xc8)](_0x19377d(0x192)+(_0x32d0b5||'(root)')+'/'+_0x1c54ec[_0x19377d(0x144)]);}return 0x1;}_0x447ac7=_0x2e47ec;}if(_0x447ac7[_0x19377d(0xf4)]===0x0)return console['error']('No\x20journeys\x20found'),0x0;const _0x3fe9a0=new Map();for(const _0x1639b6 of _0x447ac7){const _0x1f6339=_0x1639b6[_0x19377d(0xd5)];!_0x3fe9a0[_0x19377d(0x1a8)](_0x1f6339)&&_0x3fe9a0[_0x19377d(0x189)](_0x1f6339,[]),_0x3fe9a0[_0x19377d(0x115)](_0x1f6339)[_0x19377d(0x137)](_0x1639b6);}for(const _0x47de9e of _0x3fe9a0[_0x19377d(0x1ad)]()){_0x47de9e[_0x19377d(0x186)]((_0x301864,_0x3a8865)=>(_0x301864['versionNumber']||0x0)-(_0x3a8865['versionNumber']||0x0));}const _0x460f38=[],{idToEmailMap:_0x155143,connectionIdToNameMap:_0x4776b1}=await withSpinner(_0x19377d(0x195),async()=>{const _0x4c18b7=_0x19377d,[_0x46b7d2,_0x1d90e2]=await Promise['all']([_0xa5a187[_0x4c18b7(0xd2)][_0x4c18b7(0xb3)](),_0xa5a187['connection'][_0x4c18b7(0x136)]()]);return{'idToEmailMap':_0x46b7d2,'connectionIdToNameMap':_0x1d90e2};},{'verbose':_0x11d3fe[_0x19377d(0xe9)]})[_0x19377d(0x12e)](_0x19b420=>_0x19b420['data']);for(const _0x43a18d of _0x3fe9a0[_0x19377d(0x1ad)]()){const _0x3ccfbb=_0x43a18d[0x0][_0x19377d(0x144)],_0x44262f=_0x43a18d[0x0][_0x19377d(0xff)],_0x3782e5=_0x44262f?_0x21e8d2['get'](_0x44262f)||'':'',_0x7e6fb=_0x3782e5?a26_0x30379f[_0x19377d(0xb8)](_0x1cbe38,_0x3782e5):_0x1cbe38,_0x5e1ca5=_0x35faef||a26_0x30379f['join'](_0x7e6fb,sanitizeFileName(_0x3ccfbb)+_0x19377d(0x164));let _0xa713c5,_0x1dd049;if(existsSync(_0x5e1ca5))try{const _0x564e53=readFileSync(_0x5e1ca5,'utf-8'),_0x550d64=parseYamlString(_0x564e53);_0x1dd049=_0x550d64,_0xa713c5=buildRuleToNameMapping(_0x550d64),_0x55aff0[_0x19377d(0xe9)]&&_0xa713c5['size']>0x0&&console['error'](_0x19377d(0x149)+_0xa713c5['size']+_0x19377d(0x129)+_0x3ccfbb);}catch(_0x198538){_0x55aff0[_0x19377d(0xe9)]&&console[_0x19377d(0xc8)](_0x19377d(0x197)+_0x198538[_0x19377d(0xcf)]);}const _0x2c14d8=[],_0x155ef3=new Set(),_0x329d02=new Map(),_0x9253a=new Map(),_0x550d04=new Set(),_0xe51caa=new Map(),_0x1c8196=new Map(),_0x47a85f=createJumpTargetCache();await withProgressSpinner(_0x19377d(0x181)+_0x3ccfbb+_0x19377d(0x131),async _0x1fa696=>{const _0x2b89ef=_0x19377d;for(const _0x445fe4 of _0x43a18d){const _0x5016b4=_0x43a18d[_0x2b89ef(0xf4)]>0x1?_0x445fe4[_0x2b89ef(0x144)]+'\x20v'+(_0x445fe4[_0x2b89ef(0x180)]||0x1):_0x445fe4['journeyBundleName'];_0x1fa696[_0x2b89ef(0x199)](_0x2b89ef(0x181)+_0x5016b4);const _0x1a7456=await _0xa5a187[_0x2b89ef(0xdd)][_0x2b89ef(0x160)](_0x445fe4['id']),_0x5ac088=_0x1a7456[_0x2b89ef(0x17b)]?.[_0x2b89ef(0x125)],_0x50646f={'resolveSegment':async _0x286241=>{const _0x573c4b=_0x2b89ef;if(!_0x5ac088)return{'name':_0x286241,'isJourneyLocal':![]};const _0x44497a=_0x329d02['get'](_0x286241);if(_0x44497a)return _0x44497a;try{const _0x4b1d16=await _0xa5a187['segment'][_0x573c4b(0x128)](_0x5ac088,_0x286241),_0x46dcd9=_0x4b1d16['kind']===SEGMENT_KIND_JOURNEY;let _0x3cdce9,_0x30622f=_0x4b1d16['name'];if(_0x46dcd9&&_0x4b1d16['rule']){const _0x5c4a0a=await segmentResponseToDef(_0x4b1d16,{'resolveSegmentName':async _0x2720f0=>{const _0x3296df=_0x573c4b,_0x3244dc=_0x329d02['get'](_0x2720f0);if(_0x3244dc)return _0x3244dc[_0x3296df(0x191)];const _0x2cc4a9=await _0x50646f[_0x3296df(0xc9)](_0x2720f0);return _0x2cc4a9[_0x3296df(0x191)];}}),_0x4d029d=_0x5c4a0a[_0x573c4b(0x14a)];_0x3cdce9={'description':_0x4b1d16[_0x573c4b(0x19d)],'rule':_0x4d029d};const _0x51abce=serializeRule(_0x4d029d),_0x184ee3=_0x9253a['get'](_0x51abce);if(_0x184ee3)_0x30622f=_0x184ee3,_0x3cdce9=undefined,_0x55aff0[_0x573c4b(0xe9)]&&console[_0x573c4b(0xc8)](_0x573c4b(0xe8)+_0x4b1d16[_0x573c4b(0x191)]+_0x573c4b(0x12c)+_0x184ee3);else{let _0x37cdc3=![];if(_0xa713c5){const _0x173a79=_0xa713c5[_0x573c4b(0x115)](_0x51abce);if(_0x173a79){const _0x130c2d=_0x173a79[_0x573c4b(0x190)](_0x3b0d08=>!_0x155ef3[_0x573c4b(0x1a8)](_0x3b0d08));_0x130c2d&&(_0x30622f=_0x130c2d,_0x155ef3[_0x573c4b(0x1a4)](_0x130c2d),_0x9253a[_0x573c4b(0x189)](_0x51abce,_0x130c2d),_0x37cdc3=!![],_0x55aff0[_0x573c4b(0xe9)]&&console[_0x573c4b(0xc8)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x130c2d+_0x573c4b(0x159)));}}if(!_0x37cdc3){const _0x251062=generateJourneyLocalName(_0x4b1d16['name']);_0x251062&&(_0x30622f=_0x251062);let _0x29aef7=_0x30622f,_0xbb63c4=0x2;while(_0x155ef3[_0x573c4b(0x1a8)](_0x29aef7)){_0x29aef7=_0x30622f+'_'+_0xbb63c4,_0xbb63c4++;}_0x155ef3[_0x573c4b(0x1a4)](_0x29aef7),_0x9253a[_0x573c4b(0x189)](_0x51abce,_0x29aef7),_0x30622f=_0x29aef7;}}}const _0xe064c={'name':_0x30622f,'isJourneyLocal':_0x46dcd9,'definition':_0x3cdce9};return _0x329d02[_0x573c4b(0x189)](_0x286241,_0xe064c),_0xe064c;}catch(_0x250788){return _0x11d3fe[_0x573c4b(0xe9)]&&console[_0x573c4b(0xc8)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x286241+':\x20'+_0x250788[_0x573c4b(0xcf)]),{'name':_0x286241,'isJourneyLocal':![]};}},'resolveActivation':async _0x55bf7f=>{const _0x1149a9=_0x2b89ef,_0x1a5acb=_0xe51caa[_0x1149a9(0x115)](_0x55bf7f);if(_0x1a5acb)return _0x1a5acb;try{const _0x438bd3=await _0xa5a187[_0x1149a9(0xdd)][_0x1149a9(0xaa)](_0x445fe4['id'],_0x55bf7f),_0x85b258=journeyActivationStepToYaml(_0x438bd3,_0x155143,_0x4776b1),_0x4536e2=JSON[_0x1149a9(0xae)]({'name':_0x85b258['name'],'connection':_0x85b258[_0x1149a9(0x168)],'connector_config':_0x85b258[_0x1149a9(0xfb)]}),_0x6258e0=_0x1c8196[_0x1149a9(0x115)](_0x4536e2);if(_0x6258e0){const _0x2a9a41={'name':_0x6258e0,'isJourneyLocal':!![],'definition':_0x85b258};return _0xe51caa[_0x1149a9(0x189)](_0x55bf7f,_0x2a9a41),_0x2a9a41;}const _0x449871=_0x438bd3['attributes'][_0x1149a9(0xb1)][_0x1149a9(0x191)]||_0x55bf7f,_0x565bea=sanitizeYamlKey(_0x449871)||'activation_'+_0x55bf7f;let _0xc9cf04=_0x565bea,_0x327274=0x2;while(_0x550d04['has'](_0xc9cf04)){_0xc9cf04=_0x565bea+'_'+_0x327274,_0x327274++;}_0x550d04[_0x1149a9(0x1a4)](_0xc9cf04),_0x1c8196[_0x1149a9(0x189)](_0x4536e2,_0xc9cf04);const _0x49cb9c={'name':_0xc9cf04,'isJourneyLocal':!![],'definition':_0x85b258};return _0xe51caa['set'](_0x55bf7f,_0x49cb9c),_0x49cb9c;}catch(_0x42bde7){return _0x11d3fe[_0x1149a9(0xe9)]&&console[_0x1149a9(0xc8)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x55bf7f+':\x20'+_0x42bde7[_0x1149a9(0xcf)]),{'name':_0x55bf7f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x3a3094,_0x51c82e)=>{const _0xb29da0=_0x2b89ef;return resolveJumpTarget(_0x3a3094,_0x51c82e,_0x47a85f,_0x722627=>_0xa5a187[_0xb29da0(0xdd)][_0xb29da0(0x160)](_0x722627));}},_0x1d2d1e=await journeyResponseToDef(_0x1a7456,_0x50646f);_0x2c14d8[_0x2b89ef(0x137)]({'item':_0x445fe4,'yaml':_0x1d2d1e});}},{'verbose':_0x11d3fe[_0x19377d(0xe9)]});const _0x147f6e=await _0xa5a187[_0x19377d(0xdd)][_0x19377d(0x1a1)](_0x43a18d[0x0][_0x19377d(0xd5)]),_0x64ebfb=buildMergedJourneyDef(_0x2c14d8,_0xa713c5,_0x147f6e),_0x411a6a=normalizeJourneyDef(_0x64ebfb,_0x1dd049),_0x49e874=toYamlString(_0x411a6a),_0x15f660=_0x35faef||a26_0x30379f[_0x19377d(0xb8)](_0x7e6fb,sanitizeFileName(_0x3ccfbb)+'.yml');!_0x35faef&&_0x3782e5&&!existsSync(_0x7e6fb)&&mkdirSync(_0x7e6fb,{'recursive':!![]});const _0x101d26=a26_0x30379f['relative'](process['cwd'](),_0x15f660);if(existsSync(_0x15f660)){const _0x205ebc=readFileSync(_0x15f660,_0x19377d(0xc4)),_0x14f355=generateDiff(_0x205ebc,_0x49e874),_0x26e881=hasChanges(_0x14f355);_0x460f38[_0x19377d(0x137)]({'relativePath':_0x101d26,'absolutePath':_0x15f660,'content':_0x49e874,'isNew':![],'hasChanges':_0x26e881,'diff':_0x26e881?formatDiffWithColors(_0x14f355):undefined});}else _0x460f38[_0x19377d(0x137)]({'relativePath':_0x101d26,'absolutePath':_0x15f660,'content':_0x49e874,'isNew':!![],'hasChanges':![]});}const _0x2fc5ce=_0x460f38[_0x19377d(0x178)](_0x449697=>_0x449697['isNew']),_0xff5d63=_0x460f38[_0x19377d(0x178)](_0x33dc6a=>!_0x33dc6a[_0x19377d(0x182)]&&_0x33dc6a['hasChanges']),_0x37c48a=_0x460f38[_0x19377d(0x178)](_0xb325fc=>!_0xb325fc['isNew']&&!_0xb325fc[_0x19377d(0x13d)]),_0x16f625=_0x447ac7[_0x19377d(0xf4)],_0x4f10d5=_0x3fe9a0[_0x19377d(0xfa)],_0x4c3dcf=_0x16f625>_0x4f10d5?'\x20('+_0x16f625+_0x19377d(0x194):'';console['error']('\x0aPull\x20summary:'),console[_0x19377d(0xc8)]('\x20\x20'+a26_0x3b9971[_0x19377d(0x15a)](_0x4f10d5+'\x20journeys')+a26_0x3b9971[_0x19377d(0x10d)](_0x4c3dcf)),console[_0x19377d(0xc8)]('\x20\x20'+a26_0x3b9971[_0x19377d(0xb2)]('+\x20'+_0x2fc5ce['length']+_0x19377d(0xf7))),console['error']('\x20\x20'+a26_0x3b9971[_0x19377d(0x10a)]('~\x20'+_0xff5d63[_0x19377d(0xf4)]+'\x20changed\x20files')),console[_0x19377d(0xc8)]('\x20\x20'+a26_0x3b9971[_0x19377d(0x10d)]('=\x20'+_0x37c48a[_0x19377d(0xf4)]+'\x20unchanged\x20files')),console['error'](_0x19377d(0xe0)+a26_0x3b9971['cyan'](_0x1cbe38)+'\x0a');if(_0xff5d63[_0x19377d(0xf4)]>0x0)for(const _0xd5f325 of _0xff5d63){console[_0x19377d(0xc8)](_0x19377d(0x16d)+_0xd5f325['relativePath']+'\x27:'),console[_0x19377d(0xc8)]('─'[_0x19377d(0x141)](0x3c)),console[_0x19377d(0xc8)](_0xd5f325[_0x19377d(0xbf)]),console[_0x19377d(0xc8)]('─'['repeat'](0x3c));}if(_0x55aff0['dryRun'])return console['error'](a26_0x3b9971[_0x19377d(0x10a)](_0x19377d(0x198))),0x0;if(_0x2fc5ce[_0x19377d(0xf4)]===0x0&&_0xff5d63['length']===0x0)return console[_0x19377d(0xc8)](a26_0x3b9971[_0x19377d(0xb2)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2f960b},_0x55aff0[_0x19377d(0x13f)]),console[_0x19377d(0xc8)](a26_0x3b9971[_0x19377d(0xb2)]('✔\x20Context\x20set:\x20'+a26_0x3b9971[_0x19377d(0x10d)](_0x19377d(0x177))+_0x19377d(0xd8)+a26_0x3b9971['cyan'](_0x2f960b))),0x0;if(!_0x55aff0[_0x19377d(0x140)]&&(_0x2fc5ce['length']>0x0||_0xff5d63[_0x19377d(0xf4)]>0x0)){if(!isInteractive())return console['error'](a26_0x3b9971[_0x19377d(0xa9)](_0x19377d(0xda)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x19377d(0xc8)](a26_0x3b9971[_0x19377d(0x10d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1641f1=await confirmKey(_0x19377d(0x163)+(_0x2fc5ce[_0x19377d(0xf4)]+_0xff5d63[_0x19377d(0xf4)])+'\x20files?');if(!_0x1641f1)return console[_0x19377d(0xc8)](a26_0x3b9971[_0x19377d(0x10a)](_0x19377d(0xc3)),_0x19377d(0x14b)),0x1;}!existsSync(_0x1cbe38)&&mkdirSync(_0x1cbe38,{'recursive':!![]});const _0x20a032=a26_0x30379f[_0x19377d(0xb8)](_0x1cbe38,_0x19377d(0x18a));writeFileSync(_0x20a032,createTdxConfigContent(_0x2f960b),'utf-8');for(const _0x5bde50 of _0x460f38){(_0x5bde50[_0x19377d(0x182)]||_0x5bde50[_0x19377d(0x13d)])&&writeFileSync(_0x5bde50[_0x19377d(0x187)],_0x5bde50[_0x19377d(0x145)],_0x19377d(0xc4));}return console[_0x19377d(0xc8)](a26_0x3b9971[_0x19377d(0xb2)](_0x19377d(0xb7)+(_0x2fc5ce[_0x19377d(0xf4)]+_0xff5d63['length'])+'\x20journey\x20files\x20to\x20'+_0x1cbe38)),saveSessionContext({'parent_segment':_0x2f960b},_0x55aff0[_0x19377d(0x13f)]),console[_0x19377d(0xc8)](a26_0x3b9971[_0x19377d(0xb2)]('✔\x20Context\x20set:\x20'+a26_0x3b9971['dim'](_0x19377d(0x177))+_0x19377d(0xd8)+a26_0x3b9971[_0x19377d(0x15a)](_0x2f960b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0x22fcc0(0x191)]=a26_0x22fcc0(0xf8);[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0x10e);async[a26_0x22fcc0(0x105)](_0x46df1b){const _0x27c62d=a26_0x22fcc0,{options:_0x50f993,args:_0x427ff3,tdx:_0x4ef87c}=_0x46df1b,_0x350e5f=_0x427ff3[0x0];if(!requireNameOrPath(_0x350e5f))return 0x1;_0x50f993['verbose']&&console[_0x27c62d(0xc8)](_0x27c62d(0x11a)+_0x350e5f);const {journeyId:_0x2bc9f1}=await resolveJourneyIdFromInput(_0x350e5f,_0x50f993,_0x4ef87c),_0x173265=await withSpinner(_0x27c62d(0x1aa),()=>_0x4ef87c['journey']['getColumnMapping'](_0x2bc9f1),{'verbose':_0x50f993[_0x27c62d(0xe9)]}),_0x278f23=_0x173265[_0x27c62d(0x19b)];return console['log']('Database:\x20'+_0x278f23[_0x27c62d(0xec)]),console[_0x27c62d(0x120)](_0x27c62d(0xe4)+_0x278f23['table']),await handleSDKOutput(_0x278f23[_0x27c62d(0x116)],_0x50f993),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0x158);async['execute'](_0x3f0ab3){const _0x251a93=a26_0x22fcc0,{options:_0x1db9f3,args:_0x4cc90d,tdx:_0x3e67b9}=_0x3f0ab3,_0x28171e=_0x4cc90d[0x0];if(!requireNameOrPath(_0x28171e))return 0x1;_0x1db9f3['verbose']&&console[_0x251a93(0xc8)](_0x251a93(0x11a)+_0x28171e);const {journeyId:_0x4dfd43}=await resolveJourneyIdFromInput(_0x28171e,_0x1db9f3,_0x3e67b9),_0x3c9e2d=await withSpinner(_0x251a93(0x117),()=>_0x3e67b9[_0x251a93(0xdd)][_0x251a93(0xed)](_0x4dfd43),{'verbose':_0x1db9f3[_0x251a93(0xe9)]}),_0x4b4344=_0x3c9e2d['data'];return console[_0x251a93(0xc8)](_0x251a93(0x149)+_0x4b4344[_0x251a93(0xf4)]+'\x20activation'+(_0x4b4344[_0x251a93(0xf4)]!==0x1?'s':'')),await handleSDKOutput(_0x4b4344,_0x1db9f3),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x22fcc0(0x191)]=a26_0x22fcc0(0x147);[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0x14c);[a26_0x22fcc0(0x170)]=new SegmentPushCommand();async[a26_0x22fcc0(0x105)](_0x1673b0){const _0xff5a82=a26_0x22fcc0,_0x5a3361=_0x1673b0[_0xff5a82(0x154)][0x0];let _0x347f33;if(_0x5a3361){const _0x5b729b=await resolveTarget({'arg':_0x5a3361,'contextParent':_0x1673b0[_0xff5a82(0x100)][_0xff5a82(0x169)],'cwd':process[_0xff5a82(0x153)]()});isSuccessfulResolution(_0x5b729b)&&_0x5b729b[_0xff5a82(0x111)]===_0xff5a82(0x1ab)&&(_0x347f33=_0x5b729b['filePath']);}const _0x179e6a={..._0x1673b0,'options':{..._0x1673b0['options'],'journeysOnly':!![],..._0x347f33&&{'singleFilePath':_0x347f33}}};return this['segmentPushCommand'][_0xff5a82(0x105)](_0x179e6a);}}export class JourneyVersionsCommand extends BaseCommand{['name']='journey:versions';[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0x107);async[a26_0x22fcc0(0x105)](_0x363c88){const _0x6e83b7=a26_0x22fcc0,{options:_0x31f13d,args:_0x2ba2a6,tdx:_0x7d38b0}=_0x363c88,_0x50b5ee=_0x2ba2a6[0x0];if(!requireNameOrPath(_0x50b5ee))return 0x1;if(_0x31f13d['verbose'])console[_0x6e83b7(0xc8)](_0x6e83b7(0x11a)+_0x50b5ee);const {journeyId:_0x2ad83b}=await resolveJourneyIdFromInput(_0x50b5ee,_0x31f13d,_0x7d38b0),_0x5cb751=await withSpinner(_0x6e83b7(0x15d),()=>_0x7d38b0['journey'][_0x6e83b7(0xb5)](_0x2ad83b),{'verbose':_0x31f13d[_0x6e83b7(0xe9)]}),{bundleName:_0x5ba99c,versions:_0x219c87,latestJourneyId:_0x19522c}=_0x5cb751[_0x6e83b7(0x19b)];console[_0x6e83b7(0xc8)](_0x5ba99c+':\x20'+_0x219c87[_0x6e83b7(0xf4)]+'\x20version'+(_0x219c87[_0x6e83b7(0xf4)]!==0x1?'s':''));const _0x2307ed=_0x219c87[_0x6e83b7(0x12d)](_0x574ee3=>({'version':_0x574ee3[_0x6e83b7(0x180)],'journey_id':_0x574ee3[_0x6e83b7(0x188)],'name':_0x574ee3[_0x6e83b7(0x191)],'state':_0x574ee3[_0x6e83b7(0x150)],'paused':_0x574ee3[_0x6e83b7(0xea)],'latest':_0x574ee3[_0x6e83b7(0x188)]===_0x19522c,'created_at':_0x574ee3[_0x6e83b7(0xb0)]}));return await handleSDKOutput(_0x2307ed,_0x31f13d),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a26_0x22fcc0(0x191)]=a26_0x22fcc0(0x193);[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0x171);async[a26_0x22fcc0(0x105)](_0x43180b){const _0x899fd9=a26_0x22fcc0,{options:_0x27d149,args:_0x58051b,tdx:_0x8709cb}=_0x43180b,_0x509d8a=_0x58051b[0x0];if(!requireNameOrPath(_0x509d8a))return 0x1;if(_0x27d149[_0x899fd9(0xe9)])console[_0x899fd9(0xc8)](_0x899fd9(0x11a)+_0x509d8a);const {journeyId:_0x5349b1,journeyName:_0x262b85}=await resolveJourneyIdFromInput(_0x509d8a,_0x27d149,_0x8709cb);if(!_0x27d149[_0x899fd9(0x140)]){const _0x5e0c59=await confirm(_0x899fd9(0x152)+_0x262b85+'\x22?');if(!_0x5e0c59)return console[_0x899fd9(0xc8)]('Cancelled'),0x0;}const _0x53450a=await withSpinner(_0x899fd9(0x1a6),()=>_0x8709cb['journey'][_0x899fd9(0x13b)](_0x5349b1),{'verbose':_0x27d149[_0x899fd9(0xe9)]}),_0x5007c3=_0x53450a['data'];return console[_0x899fd9(0xc8)](a26_0x3b9971[_0x899fd9(0xb2)]('✔')+_0x899fd9(0x113)+_0x5007c3[_0x899fd9(0x17b)]['versionNumber']+_0x899fd9(0xef)+_0x5007c3[_0x899fd9(0x17b)][_0x899fd9(0x191)]+'\x22'),console['error'](_0x899fd9(0x118)+_0x5007c3['id']),await handleSingleObjectOutput({'id':_0x5007c3['id'],'name':_0x5007c3[_0x899fd9(0x17b)]['name'],'version':_0x5007c3['attributes']['versionNumber'],'state':_0x5007c3['attributes']['state'],'bundle_id':_0x5007c3['attributes']['journeyBundleId'],'created_at':_0x5007c3['attributes']['createdAt']},_0x27d149),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0x22fcc0(0x191)]=a26_0x22fcc0(0x13e);[a26_0x22fcc0(0x19d)]=a26_0x22fcc0(0xc6);async[a26_0x22fcc0(0x105)](_0x51fd75){const _0x39ea93=a26_0x22fcc0,{options:_0x45a39b,args:_0x4df828,tdx:_0x3ee977}=_0x51fd75,_0x41daa4=_0x4df828[0x0];if(!requireNameOrPath(_0x41daa4))return 0x1;const _0x3d1bc5=_0x45a39b['version'];if(!_0x3d1bc5)return console[_0x39ea93(0xc8)](_0x39ea93(0x130)),console['error'](_0x39ea93(0x16c)),0x1;const _0x4cce38=parseInt(_0x3d1bc5,0xa);if(isNaN(_0x4cce38)||_0x4cce38<0x1)return console[_0x39ea93(0xc8)](_0x39ea93(0xd9)+_0x3d1bc5),0x1;if(_0x45a39b[_0x39ea93(0xe9)])console[_0x39ea93(0xc8)](_0x39ea93(0x11a)+_0x41daa4+',\x20version:\x20'+_0x4cce38);const {journeyId:_0x3dc86e,parentSegmentId:_0xa90519}=await resolveJourneyIdFromInput(_0x41daa4,_0x45a39b,_0x3ee977),_0x3c5cc0=await withSpinner('Resolving\x20version...',()=>_0x3ee977[_0x39ea93(0xdd)][_0x39ea93(0xb5)](_0x3dc86e),{'verbose':_0x45a39b[_0x39ea93(0xe9)]}),{versions:_0x32c94c,latestJourneyId:_0x46fa29}=_0x3c5cc0['data'],_0x31fd9f=_0x32c94c[_0x39ea93(0x190)](_0x26fc9c=>_0x26fc9c[_0x39ea93(0x180)]===_0x4cce38);if(!_0x31fd9f){const _0x37632c=_0x32c94c['map'](_0x118451=>'v'+_0x118451[_0x39ea93(0x180)])[_0x39ea93(0xb8)](',\x20');return console[_0x39ea93(0xc8)](_0x39ea93(0xe3)+_0x4cce38+_0x39ea93(0xbb)+_0x37632c),0x1;}const _0x465f84=await withSpinner(_0x39ea93(0x14f)+_0x4cce38+'\x20details...',()=>_0x3ee977[_0x39ea93(0xdd)]['getJourney'](_0x31fd9f['journeyId']),{'verbose':_0x45a39b[_0x39ea93(0xe9)]}),_0x379c4b=_0x465f84['data'],_0x11317c=getConsoleNextUrl(_0x45a39b['site'],_0x39ea93(0x114)+_0xa90519+_0x39ea93(0xf6)+_0x31fd9f[_0x39ea93(0x188)]+_0x39ea93(0x110));return await handleSingleObjectOutput({'id':_0x379c4b['id'],'name':_0x379c4b[_0x39ea93(0x17b)][_0x39ea93(0x191)],'version':_0x379c4b[_0x39ea93(0x17b)][_0x39ea93(0x180)],'description':_0x379c4b['attributes'][_0x39ea93(0x19d)],'state':_0x379c4b[_0x39ea93(0x17b)][_0x39ea93(0x150)],'paused':_0x379c4b[_0x39ea93(0x17b)][_0x39ea93(0xea)],'reentry_mode':_0x379c4b['attributes'][_0x39ea93(0x102)],'stages':_0x379c4b[_0x39ea93(0x17b)]['journeyStages']?.[_0x39ea93(0xf4)]||0x0,..._0x379c4b[_0x39ea93(0x17b)][_0x39ea93(0x143)]&&{'goal':_0x379c4b[_0x39ea93(0x17b)][_0x39ea93(0x143)][_0x39ea93(0x191)]},'latest':_0x31fd9f['journeyId']===_0x46fa29,'created_at':_0x379c4b[_0x39ea93(0x17b)][_0x39ea93(0xb0)],'updated_at':_0x379c4b[_0x39ea93(0x17b)][_0x39ea93(0xdb)],'url':_0x11317c},_0x45a39b),0x0;}}
|
|
1
|
+
const a28_0x8121c3=a28_0x1d56;(function(_0x3e555c,_0xf479a7){const _0x38261c=a28_0x1d56,_0x5542d3=_0x3e555c();while(!![]){try{const _0x43e27d=parseInt(_0x38261c(0x28e))/0x1*(-parseInt(_0x38261c(0x230))/0x2)+parseInt(_0x38261c(0x20e))/0x3+parseInt(_0x38261c(0x276))/0x4*(-parseInt(_0x38261c(0x2b5))/0x5)+parseInt(_0x38261c(0x1e2))/0x6*(-parseInt(_0x38261c(0x289))/0x7)+-parseInt(_0x38261c(0x243))/0x8*(-parseInt(_0x38261c(0x1ea))/0x9)+parseInt(_0x38261c(0x2b4))/0xa*(-parseInt(_0x38261c(0x22b))/0xb)+parseInt(_0x38261c(0x268))/0xc;if(_0x43e27d===_0xf479a7)break;else _0x5542d3['push'](_0x5542d3['shift']());}catch(_0xc4852e){_0x5542d3['push'](_0x5542d3['shift']());}}}(a28_0x1230,0x6e371));import a28_0x302f34 from'chalk';import a28_0x1221b1 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';function a28_0x1d56(_0x4d69a8,_0xf440ff){_0x4d69a8=_0x4d69a8-0x1c9;const _0x1230f9=a28_0x1230();let _0x1d566b=_0x1230f9[_0x4d69a8];return _0x1d566b;}import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a28_0x1230(){const _0x2f5e54=['reentryMode','size','✔\x20Pulled\x20','\x22\x20resumed','buildIdToEmailMap','43373OwZJgs','No\x20statistics\x20available\x20for\x20journey:\x20','journey:versions','\x20\x20Consolidating\x20duplicate\x20segment:\x20','data','26tZtDag','folders','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','parentSegment','getColumnMapping','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','yellow','Listing\x20journey\x20versions...','stages','resume','renderStats','Parent\x20segment:\x20','journey:version:create','resolveSegment','Error:\x20Journey\x20\x27','table','options','stage','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','887064YjvOCK','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','web','rootFolderId','Resolved\x20YAML\x20file:\x20','goal','exitOrJumpSize','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Invalid\x20--type\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','errorCode','✔\x20Journey\x20\x22','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','bold','filePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','limit','connection','entries','test','createdAt','INVALID_ARGUMENT','journeyBundleId','Resolving\x20version...','cwd','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','relativePath','\x20\x20Parent\x20segment:\x20','journey:pull','version','has','connector_config','base','\x20journey','length','12753600QMVQaD','error','Show\x20journey\x20details','Getting\x20journey\x20details...','from','Error:\x20','dim','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Pausing\x20journey...','(running)','getSegment','completeMilestoneRate','(paused)','\x20=\x20','872uAIlxm','split','journeyStages','hasPeriod','then','\x20files?','replace','description','find','tsv','filter','nodes','View\x20a\x20specific\x20version\x20of\x20a\x20journey','\x5c$&','log','\x0aPull\x20summary:','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x20versions)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','14bZHnhk','type','no_parent','cyan','exitOrJumpRate','3061cyshfv','Target\x20directory:\x20','utf-8','\x20\x20Statistics\x20not\x20available','dryRun','pause','history','journey:push','set','journey:traffic','getTrafficData','/j/da/je','Error:\x20Journey\x20not\x20found:\x20','name','journey','(draft)','draft','Input:\x20','audienceId','\x27\x20not\x20found\x20in\x20','Cancelled','parentName','all','site','Error:\x20Stage\x20\x22','rule','updatedAt','toLowerCase','journeyId','\x20not\x20found.\x20Available:\x20','segment','\x20->\x20','journey:stats','List\x20journeys\x20in\x20current\x20context','targetDir','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Folder\x20path:\x20','goalSize','1490IHtXau','15685hwBCLr','\x0aError:','Fetching\x20parent\x20segment...','Database:\x20','blue','file','state','Resolving\x20journey...','Fetching\x20journeys\x20and\x20folders...','links','conversion',',\x20version:\x20','journeyName','join','Fetching\x20','content','\x20unchanged\x20files','format','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20new\x20files','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','message','segments','\x22\x20paused','helpText','completed','resolveJourneyId','segmentPushCommand','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','jsonl','activation','(root)','getJourney','\x20(ID:\x20','/app/ps/','\x0aChanges\x20to\x20\x27','tdx.json','-\x20no\x20files\x20written','🗺️\x20','archived','green','launched','folderPath','segmentName','red','\x20\x20Journey\x20ID:\x20','resourceName','470292YmgdVi','✔\x20Found\x20','args','user','yes','/e/','activation_','\x20version','9aKKRvb','attributes','versionNumber','Write\x20','Getting\x20journey\x20statistics...','Resolving\x20parent\x20segment...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','isNew','repeat','getLatestJourneyId','completionRate','journey:activations','paused','Options:','add','folderId','(archived)','resolveParentId','getStatistics','stageNameMap','get','createVersion','verbose','/j/da','Folder\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','hasChanges','push','milestoneSize','values','Show\x20journey\x20table\x20column\x20mapping','(completed)','map','enteredSize','Aborted.','✔\x20Context\x20set:\x20','2237064OrkMVW','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','json','includeStats','Getting\x20column\x20mapping...','Resume\x20a\x20paused\x20journey','✔\x20All\x20files\x20are\x20up\x20to\x20date','setPhase','execute','journeyBundleName','Error:\x20--version\x20option\x20is\x20required','sort','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','buildIdToNameMap','listVersions','\x20\x20-\x20','Error:\x20Invalid\x20version\x20number:\x20','listActivationsFlat','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Error:\x20Version\x20','localeCompare','journey:pause'];a28_0x1230=function(){return _0x2f5e54;};return a28_0x1230();}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x24f18c){const _0x2ff002=a28_0x1d56;return!_0x24f18c&&(console[_0x2ff002(0x269)](_0x2ff002(0x1cf)),console[_0x2ff002(0x269)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x24f18c;}function withJsonFormat(_0x3faab5){const _0x3628ad=a28_0x1d56;if(!_0x3faab5['format']&&!_0x3faab5[_0x3628ad(0x212)]&&!_0x3faab5[_0x3628ad(0x1d0)]&&!_0x3faab5[_0x3628ad(0x27f)])return{..._0x3faab5,'format':_0x3628ad(0x212),'json':!![]};return _0x3faab5;}function formatJourneyState(_0x5f390a){const _0x58ead8=a28_0x1d56;switch(_0x5f390a){case _0x58ead8(0x1dc):return a28_0x302f34['green'](_0x58ead8(0x271));case _0x58ead8(0x29e):return a28_0x302f34[_0x58ead8(0x26e)](_0x58ead8(0x29d));case'paused':return a28_0x302f34['yellow'](_0x58ead8(0x274));case _0x58ead8(0x1cc):return a28_0x302f34[_0x58ead8(0x2b9)](_0x58ead8(0x209));case _0x58ead8(0x1da):return a28_0x302f34[_0x58ead8(0x26e)](_0x58ead8(0x1fa));default:return'('+_0x5f390a+')';}}function formatJourneyItem(_0xcdb75f,_0x1cf908='',_0x6ddf3a){const _0x7c4e76=a28_0x1d56,_0x53d245=formatJourneyState(_0xcdb75f[_0x7c4e76(0x2bb)]),_0x29a1a2=_0x6ddf3a?hyperlink(_0xcdb75f[_0x7c4e76(0x219)],_0x6ddf3a):_0xcdb75f['journeyBundleName'];return _0x1cf908+_0x7c4e76(0x1d9)+_0x29a1a2+'\x20'+_0x53d245;}function escapeRegex(_0x556749){const _0x385d06=a28_0x1d56;return _0x556749[_0x385d06(0x27c)](/[.*+?^${}()|[\]\\]/g,_0x385d06(0x283));}function globToRegex(_0x2893f3){const _0x47d79b=a28_0x1d56,_0x4e4000=_0x2893f3[_0x47d79b(0x277)]('*')[_0x47d79b(0x20a)](escapeRegex);return new RegExp(_0x4e4000['join']('.*'),'i');}function buildRuleToNameMapping(_0x330fd7){const _0x290747=a28_0x1d56,_0x2aed75=new Map();if(_0x330fd7[_0x290747(0x1c9)])for(const [_0x4374a4,_0x4a66c3]of Object[_0x290747(0x256)](_0x330fd7[_0x290747(0x1c9)])){if(_0x4a66c3[_0x290747(0x2a7)]){const _0x458604=serializeRule(_0x4a66c3['rule']),_0x463ab6=_0x2aed75[_0x290747(0x1fe)](_0x458604);_0x463ab6?_0x463ab6[_0x290747(0x205)](_0x4374a4):_0x2aed75[_0x290747(0x296)](_0x458604,[_0x4374a4]);}}return _0x2aed75;}async function resolveJourneyIdFromInput(_0x435975,_0x275dbb,_0x5615d6){const _0x311703=a28_0x1d56,_0x53963c=await resolveJourneyTarget(_0x435975,_0x275dbb['parentSegment'],_0x275dbb['verbose']),_0x44f85c=_0x53963c[_0x311703(0x233)];if(!_0x44f85c)throw new SDKError(ErrorCode[_0x311703(0x259)],_0x311703(0x2b1));const _0x14436f=await withSpinner(_0x311703(0x1ef),()=>_0x5615d6[_0x311703(0x2ac)][_0x311703(0x1fb)](_0x44f85c),{'verbose':_0x275dbb[_0x311703(0x200)]}),_0x333e26=_0x14436f[_0x311703(0x22f)],_0x20359e=await withSpinner(_0x311703(0x2bc),()=>_0x5615d6[_0x311703(0x29c)][_0x311703(0x1cd)](_0x333e26,_0x53963c[_0x311703(0x2c1)]),{'verbose':_0x275dbb[_0x311703(0x200)]});return{'journeyId':_0x20359e['data'],'journeyName':_0x53963c['journeyName'],'parentSegmentId':_0x333e26};}async function resolveJourneyTarget(_0x3ccccb,_0x182c6d,_0x26ad24){const _0x4992ba=a28_0x1d56;if(isYamlFilePath(_0x3ccccb))try{const _0x4403c0=await resolveYamlFilePath(_0x3ccccb);return _0x26ad24&&(console['error'](_0x4992ba(0x248)+_0x3ccccb),console['error'](_0x4992ba(0x260)+_0x4403c0[_0x4992ba(0x233)]),console['error']('\x20\x20Name:\x20'+_0x4403c0[_0x4992ba(0x1de)]),console[_0x4992ba(0x269)](_0x4992ba(0x2b2)+(_0x4403c0[_0x4992ba(0x1dd)]||_0x4992ba(0x1d2)))),{'journeyName':_0x4403c0[_0x4992ba(0x1de)],'parentSegment':_0x4403c0[_0x4992ba(0x233)],'resolved':_0x4403c0};}catch(_0x15006f){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4992ba(0x235)+_0x15006f[_0x4992ba(0x2ca)]);}if(!_0x182c6d)throw new SDKError(ErrorCode[_0x4992ba(0x259)],_0x4992ba(0x24b));return{'journeyName':_0x3ccccb,'parentSegment':_0x182c6d};}export class JourneyListCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:list';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x2af);async[a28_0x8121c3(0x218)](_0x5745fb){const _0x4d29e0=a28_0x8121c3,{options:_0x1a731f,args:_0x536c7d,tdx:_0x283246}=_0x5745fb,_0x43483c=_0x536c7d[0x0],_0x56bc31=_0x1a731f[_0x4d29e0(0x233)];if(!_0x56bc31)return console[_0x4d29e0(0x269)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x4d29e0(0x269)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x35d1c1=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x283246[_0x4d29e0(0x2ac)][_0x4d29e0(0x1fb)](_0x56bc31),{'verbose':_0x1a731f[_0x4d29e0(0x200)]}),_0x237e52=_0x35d1c1[_0x4d29e0(0x22f)];_0x1a731f[_0x4d29e0(0x200)]&&(console[_0x4d29e0(0x269)](_0x4d29e0(0x23b)+_0x56bc31+_0x4d29e0(0x1d4)+_0x237e52+')'),_0x43483c&&console['error']('Pattern:\x20'+_0x43483c));const _0x4bf15e=await withSpinner(_0x4d29e0(0x2b7),()=>_0x283246[_0x4d29e0(0x2ac)]['getParentFull'](_0x237e52),{'verbose':_0x1a731f[_0x4d29e0(0x200)]}),_0x1a8710=_0x4bf15e[_0x4d29e0(0x22f)],_0x4089f1=_0x1a8710[_0x4d29e0(0x247)],_0x57fd40=await withSpinner('Listing\x20journeys...',()=>_0x283246['journey']['listJourneysWithFolders'](_0x237e52,_0x4089f1),{'verbose':_0x1a731f['verbose']});let _0x3e8814=_0x57fd40[_0x4d29e0(0x22f)]['journeys'];const _0x2f5c96=_0x57fd40[_0x4d29e0(0x22f)][_0x4d29e0(0x231)],_0x74409d=new Map();for(const _0x169549 of _0x2f5c96){_0x74409d[_0x4d29e0(0x296)](_0x169549['id'],_0x169549[_0x4d29e0(0x29b)]);}if(_0x43483c){const _0x326c1e=globToRegex(_0x43483c);_0x3e8814=_0x3e8814['filter'](_0x59fe89=>_0x326c1e[_0x4d29e0(0x257)](_0x59fe89['journeyBundleName']));}console[_0x4d29e0(0x269)](_0x4d29e0(0x1e3)+_0x3e8814[_0x4d29e0(0x267)]+_0x4d29e0(0x266)+(_0x3e8814[_0x4d29e0(0x267)]!==0x1?'s':''));const _0x2451a1=_0x2a942a=>{const _0x477550=_0x4d29e0;return getConsoleNextUrl(_0x1a731f[_0x477550(0x2a5)],'/app/ps/'+_0x237e52+'/e/'+_0x2a942a+_0x477550(0x201));};if(_0x1a731f['format']==='table')await handleSDKOutput(_0x3e8814,_0x1a731f);else{if(_0x1a731f[_0x4d29e0(0x2c6)]===_0x4d29e0(0x212)){const _0x11fda9=_0x3e8814['map'](_0x75fdac=>({..._0x75fdac,'url':_0x2451a1(_0x75fdac['id'])}));await handleSDKOutput(_0x11fda9,_0x1a731f);}else{console[_0x4d29e0(0x284)]('['+_0x56bc31+']');const _0x3c828b=new Map(),_0xfb0209=[];for(const _0x107b13 of _0x3e8814){if(!_0x107b13[_0x4d29e0(0x1f9)]||_0x107b13[_0x4d29e0(0x1f9)]===_0x4089f1)_0xfb0209[_0x4d29e0(0x205)](_0x107b13);else{const _0x328a04=_0x3c828b['get'](_0x107b13[_0x4d29e0(0x1f9)])||[];_0x328a04['push'](_0x107b13),_0x3c828b[_0x4d29e0(0x296)](_0x107b13[_0x4d29e0(0x1f9)],_0x328a04);}}const _0x2cd5e8=(_0x2d2edb,_0x3a8003)=>_0x2d2edb[_0x4d29e0(0x219)][_0x4d29e0(0x224)](_0x3a8003['journeyBundleName'],undefined,{'sensitivity':'base'});_0xfb0209[_0x4d29e0(0x21b)](_0x2cd5e8);for(const _0x1cb3d1 of _0xfb0209){console[_0x4d29e0(0x284)](formatJourneyItem(_0x1cb3d1,'',_0x2451a1(_0x1cb3d1['id'])));}const _0x49c706=[..._0x3c828b[_0x4d29e0(0x256)]()][_0x4d29e0(0x21b)]((_0x3fbd5e,_0x33812c)=>{const _0x9031d4=_0x4d29e0,_0x3ae4b7=_0x74409d[_0x9031d4(0x1fe)](_0x3fbd5e[0x0])||_0x3fbd5e[0x0],_0x350f72=_0x74409d[_0x9031d4(0x1fe)](_0x33812c[0x0])||_0x33812c[0x0];return _0x3ae4b7[_0x9031d4(0x224)](_0x350f72,undefined,{'sensitivity':_0x9031d4(0x265)});});for(const [_0x2fae6f,_0xbd71ad]of _0x49c706){const _0x4079bd=_0x74409d[_0x4d29e0(0x1fe)](_0x2fae6f)||_0x2fae6f;console[_0x4d29e0(0x284)]('📁\x20'+_0x4079bd),_0xbd71ad[_0x4d29e0(0x21b)](_0x2cd5e8);for(const _0x385624 of _0xbd71ad){console[_0x4d29e0(0x284)](formatJourneyItem(_0x385624,'\x20\x20',_0x2451a1(_0x385624['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:view';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x26a);async[a28_0x8121c3(0x218)](_0x468cff){const _0x50198b=a28_0x8121c3,{options:_0x34e725,args:_0x1e818f,tdx:_0x5cc3db}=_0x468cff,_0x42d810=_0x1e818f[0x0];if(!_0x42d810)return console[_0x50198b(0x269)](_0x50198b(0x1cf)),console[_0x50198b(0x269)](_0x50198b(0x26f)),console[_0x50198b(0x269)](_0x50198b(0x1f7)),console[_0x50198b(0x269)](_0x50198b(0x2c9)),0x1;_0x34e725[_0x50198b(0x200)]&&console[_0x50198b(0x269)]('Input:\x20'+_0x42d810);const {journeyId:_0x54a756,parentSegmentId:_0x392c04}=await resolveJourneyIdFromInput(_0x42d810,_0x34e725,_0x5cc3db);if(_0x34e725[_0x50198b(0x246)]){const _0x3f30b3=getConsoleNextUrl(_0x34e725[_0x50198b(0x2a5)],_0x50198b(0x1d5)+_0x392c04+'/e/'+_0x54a756+_0x50198b(0x299));return console['error'](a28_0x302f34['green']('✔')+'\x20Opening\x20'+a28_0x302f34[_0x50198b(0x28c)](_0x3f30b3)),openBrowser(_0x3f30b3),0x0;}const _0x407c76=await withSpinner(_0x50198b(0x26b),()=>_0x5cc3db['journey'][_0x50198b(0x1d3)](_0x54a756),{'verbose':_0x34e725[_0x50198b(0x200)]}),_0x5bcdf1=_0x407c76['data'],_0x456dc7=_0x34e725[_0x50198b(0x213)];let _0x4693e7;if(_0x456dc7)try{const _0x152670=await withSpinner(_0x50198b(0x1ee),()=>_0x5cc3db[_0x50198b(0x29c)]['getStatistics'](_0x54a756),{'verbose':_0x34e725[_0x50198b(0x200)]});_0x4693e7=_0x152670[_0x50198b(0x22f)];}catch{_0x34e725['verbose']&&console[_0x50198b(0x269)](_0x50198b(0x291));}const _0x1f7739=getConsoleNextUrl(_0x34e725[_0x50198b(0x2a5)],_0x50198b(0x1d5)+_0x392c04+_0x50198b(0x1e7)+_0x54a756+_0x50198b(0x299)),_0x47b1a1={'id':_0x5bcdf1['id'],'name':_0x5bcdf1[_0x50198b(0x1eb)]['name'],'description':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x27d)],'state':_0x5bcdf1[_0x50198b(0x1eb)]['state'],'paused':_0x5bcdf1['attributes'][_0x50198b(0x1f6)],'reentry_mode':_0x5bcdf1['attributes'][_0x50198b(0x226)],'stages':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x278)]?.[_0x50198b(0x267)]||0x0,..._0x5bcdf1['attributes'][_0x50198b(0x249)]&&{'goal':_0x5bcdf1[_0x50198b(0x1eb)][_0x50198b(0x249)][_0x50198b(0x29b)]},..._0x4693e7&&{'statistics':{'size':_0x4693e7[_0x50198b(0x227)],'entered':_0x4693e7[_0x50198b(0x20b)],'goal_achieved':_0x4693e7[_0x50198b(0x2b3)],'completion_rate':_0x4693e7[_0x50198b(0x1f4)],'exit_or_jump':_0x4693e7[_0x50198b(0x24a)],'exit_or_jump_rate':_0x4693e7[_0x50198b(0x28d)],'stages':_0x4693e7['stages']}},'url':_0x1f7739};return await handleSingleObjectOutput(_0x47b1a1,_0x34e725),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x2ae);[a28_0x8121c3(0x27d)]='Show\x20journey\x20statistics';async[a28_0x8121c3(0x218)](_0x184ad0){const _0xf3c551=a28_0x8121c3,{options:_0x125f12,args:_0x34ba27,tdx:_0x1eb1b1}=_0x184ad0,_0x152015=_0x34ba27[0x0];if(!requireNameOrPath(_0x152015))return 0x1;_0x125f12[_0xf3c551(0x200)]&&console[_0xf3c551(0x269)](_0xf3c551(0x29f)+_0x152015);const _0x3001a0=_0x125f12,_0x3611f1=_0x3001a0[_0xf3c551(0x26c)],_0x4c225d=_0x3001a0['to'],_0x5e7d27=_0x3001a0['includeHistory'],_0x3e97cb=_0x3001a0[_0xf3c551(0x241)];_0x5e7d27&&!_0x3611f1&&!_0x4c225d&&console[_0xf3c551(0x269)](_0xf3c551(0x250));const _0x5ed05d=_0x5e7d27?withJsonFormat(_0x125f12):_0x125f12,{journeyId:_0x524f0f,journeyName:_0x502a10}=await resolveJourneyIdFromInput(_0x152015,_0x5ed05d,_0x1eb1b1),_0x1b489a=_0x3611f1||_0x4c225d?{'from':_0x3611f1,'to':_0x4c225d}:undefined,_0x3d1aba=await withSpinner(_0xf3c551(0x1ee),()=>Promise[_0xf3c551(0x2a4)]([_0x1eb1b1[_0xf3c551(0x29c)][_0xf3c551(0x1d3)](_0x524f0f),_0x1eb1b1[_0xf3c551(0x29c)][_0xf3c551(0x1fc)](_0x524f0f,_0x1b489a)]),{'verbose':_0x5ed05d['verbose']}),[_0x491e70,_0x2f042f]=_0x3d1aba[_0xf3c551(0x22f)];if(!_0x2f042f||_0x2f042f[_0xf3c551(0x2aa)]===null)return console[_0xf3c551(0x269)](_0xf3c551(0x22c)+_0x502a10),console[_0xf3c551(0x269)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x26c006=buildStageNameMap(_0x491e70),_0x45f132=!!(_0x1b489a&&_0x2f042f[_0xf3c551(0x294)]?.[_0xf3c551(0x267)]),_0x8c6b9a={'stageNameMap':_0x26c006,'hasPeriod':_0x45f132,'includeHistory':!!_0x5e7d27};if(_0x3e97cb&&_0x2f042f[_0xf3c551(0x238)]){const _0x1a9bd3=_0x2f042f[_0xf3c551(0x238)][_0xf3c551(0x27e)](_0x453b5d=>{const _0xc9bfe3=_0xf3c551,_0x528656=_0x26c006[_0xc9bfe3(0x1fe)](_0x453b5d['id'])??'';return _0x528656['toLowerCase']()===_0x3e97cb[_0xc9bfe3(0x2a9)]();});if(_0x1a9bd3)return await handleSingleObjectOutput(formatStageStats(_0x1a9bd3,_0x8c6b9a),_0x5ed05d),0x0;const _0x260739=_0x2f042f[_0xf3c551(0x238)][_0xf3c551(0x20a)](_0x2e50d4=>_0x26c006['get'](_0x2e50d4['id'])??_0x2e50d4['id']);return console[_0xf3c551(0x269)](_0xf3c551(0x2a6)+_0x3e97cb+'\x22\x20not\x20found'),console[_0xf3c551(0x269)]('Available\x20stages:\x20'+_0x260739[_0xf3c551(0x2c2)](',\x20')),0x1;}const _0x3aab88=_0x2f042f['stages']?.[_0xf3c551(0x20a)](_0x35ae59=>formatStageStats(_0x35ae59,_0x8c6b9a)),_0x38966c=assembleJourneyStats(_0x2f042f,{'from':_0x3611f1,'to':_0x4c225d,'includeHistory':_0x5e7d27});return await this[_0xf3c551(0x23a)](_0x38966c,_0x3aab88??[],_0x5ed05d),0x0;}async[a28_0x8121c3(0x23a)](_0x36348a,_0x59c1c5,_0x2050c8){const _0x1494a5=a28_0x8121c3,_0x4bd49c=_0x2050c8['format']==='json'||_0x2050c8[_0x1494a5(0x2c6)]===_0x1494a5(0x1d0)||_0x2050c8['json']||_0x2050c8[_0x1494a5(0x1d0)];if(_0x4bd49c){_0x36348a[_0x1494a5(0x238)]=_0x59c1c5,await handleSingleObjectOutput(_0x36348a,_0x2050c8);return;}await handleSingleObjectOutput(_0x36348a,_0x2050c8);for(const _0x5ef6d0 of _0x59c1c5){console[_0x1494a5(0x284)](''),console[_0x1494a5(0x284)](String(a28_0x302f34[_0x1494a5(0x28c)][_0x1494a5(0x251)]('['+_0x5ef6d0[_0x1494a5(0x29b)]+']'))+a28_0x302f34[_0x1494a5(0x26e)]('\x20'+_0x5ef6d0['id']));const {id:_0x5e3082,name:_0x191461,..._0x50f1da}=_0x5ef6d0;await handleSingleObjectOutput(_0x50f1da,_0x2050c8);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x297);[a28_0x8121c3(0x27d)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x8121c3(0x218)](_0x5129bd){const _0x55f6d9=a28_0x8121c3,{options:_0x5b48dc,args:_0x20db8e,tdx:_0x33dac8}=_0x5129bd,_0x3e8454=_0x20db8e[0x0];if(!requireNameOrPath(_0x3e8454))return 0x1;_0x5b48dc[_0x55f6d9(0x200)]&&console[_0x55f6d9(0x269)]('Input:\x20'+_0x3e8454);const _0x3973e9=_0x5b48dc,_0xc60782=_0x3973e9[_0x55f6d9(0x28a)],_0x4ce6d7=_0x3973e9[_0x55f6d9(0x26c)],_0xa711e6=_0x3973e9['to'],_0x20421f=_0x3973e9[_0x55f6d9(0x254)];if(_0xc60782&&_0xc60782!==_0x55f6d9(0x2bf)&&_0xc60782!=='activation')return console['error'](_0x55f6d9(0x24c)+_0xc60782+_0x55f6d9(0x222)),0x1;const _0xdf27a=withJsonFormat(_0x5b48dc),{journeyId:_0x49a1d5,journeyName:_0x4e1edd}=await resolveJourneyIdFromInput(_0x3e8454,_0xdf27a,_0x33dac8),_0x40e753={'type':_0xc60782,'from':_0x4ce6d7,'to':_0xa711e6,'limit':_0x20421f},_0x37ba18=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x33dac8[_0x55f6d9(0x29c)][_0x55f6d9(0x298)](_0x49a1d5,_0x40e753),{'verbose':_0xdf27a[_0x55f6d9(0x200)]}),_0x311cf4=_0x37ba18[_0x55f6d9(0x22f)],_0x2af6a7=_0x311cf4[_0x55f6d9(0x2bf)]&&(_0x311cf4[_0x55f6d9(0x2bf)][_0x55f6d9(0x281)][_0x55f6d9(0x267)]>0x0||_0x311cf4['conversion'][_0x55f6d9(0x2be)][_0x55f6d9(0x267)]>0x0),_0x53ebb2=_0x311cf4['activation']&&_0x311cf4[_0x55f6d9(0x1d1)][_0x55f6d9(0x267)]>0x0;if(!_0x2af6a7&&!_0x53ebb2)return console['error'](_0x55f6d9(0x244)+_0x4e1edd),console[_0x55f6d9(0x269)](_0x55f6d9(0x2c7)),_0x4ce6d7&&_0xa711e6&&console[_0x55f6d9(0x269)](_0x55f6d9(0x1f0)),0x0;return await handleSingleObjectOutput(_0x311cf4,_0xdf27a),0x0;}}function formatStageStats(_0x405f82,_0x3a6908){const _0x5a3919=a28_0x8121c3,_0x6befed=_0x3a6908[_0x5a3919(0x279)]&&_0x405f82[_0x5a3919(0x294)]?.[_0x5a3919(0x267)]?aggregateStageHistory(_0x405f82[_0x5a3919(0x294)]):{'size':_0x405f82[_0x5a3919(0x227)],'entered':_0x405f82[_0x5a3919(0x20b)],'milestone':_0x405f82[_0x5a3919(0x206)],'milestone_rate':_0x405f82[_0x5a3919(0x273)],'exit_or_jump':_0x405f82[_0x5a3919(0x24a)],'exit_or_jump_rate':_0x405f82[_0x5a3919(0x28d)]},_0xdcec5c={'id':_0x405f82['id'],'name':_0x3a6908[_0x5a3919(0x1fd)]['get'](_0x405f82['id'])??_0x405f82['id'],..._0x6befed};return _0x3a6908[_0x5a3919(0x279)]&&_0x3a6908['includeHistory']&&_0x405f82['history']&&(_0xdcec5c['history']=_0x405f82['history']),_0xdcec5c;}export class JourneyPauseCommand extends BaseCommand{['name']=a28_0x8121c3(0x225);[a28_0x8121c3(0x27d)]='Pause\x20a\x20running\x20journey';async['execute'](_0x464b39){const _0x143dbb=a28_0x8121c3,{options:_0x2f217e,args:_0x5df915,tdx:_0x591f85}=_0x464b39,_0x36342b=_0x5df915[0x0];if(!requireNameOrPath(_0x36342b))return 0x1;_0x2f217e[_0x143dbb(0x200)]&&console[_0x143dbb(0x269)](_0x143dbb(0x29f)+_0x36342b);const {journeyId:_0x2fb911,journeyName:_0x57438e}=await resolveJourneyIdFromInput(_0x36342b,_0x2f217e,_0x591f85);if(!_0x2f217e[_0x143dbb(0x1e6)]){const _0x3cadce=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x57438e+'\x22?');if(!_0x3cadce)return console['error']('Cancelled'),0x0;}const _0x2701ee=await withSpinner(_0x143dbb(0x270),()=>_0x591f85[_0x143dbb(0x29c)][_0x143dbb(0x293)](_0x2fb911),{'verbose':_0x2f217e[_0x143dbb(0x200)]}),_0x1a7872=_0x2701ee[_0x143dbb(0x22f)];return console['error'](_0x143dbb(0x24f)+_0x1a7872[_0x143dbb(0x1eb)][_0x143dbb(0x29b)]+_0x143dbb(0x1ca)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:resume';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x215);async[a28_0x8121c3(0x218)](_0x472298){const _0x7f3887=a28_0x8121c3,{options:_0x6328a6,args:_0x2f7abe,tdx:_0x1c836d}=_0x472298,_0x3085d4=_0x2f7abe[0x0];if(!requireNameOrPath(_0x3085d4))return 0x1;_0x6328a6[_0x7f3887(0x200)]&&console[_0x7f3887(0x269)](_0x7f3887(0x29f)+_0x3085d4);const {journeyId:_0x43f7db,journeyName:_0x18abe3}=await resolveJourneyIdFromInput(_0x3085d4,_0x6328a6,_0x1c836d);if(!_0x6328a6[_0x7f3887(0x1e6)]){const _0x817a37=await confirm(_0x7f3887(0x286)+_0x18abe3+'\x22?');if(!_0x817a37)return console[_0x7f3887(0x269)](_0x7f3887(0x2a2)),0x0;}const _0x375f2f=await withSpinner('Resuming\x20journey...',()=>_0x1c836d[_0x7f3887(0x29c)][_0x7f3887(0x239)](_0x43f7db),{'verbose':_0x6328a6[_0x7f3887(0x200)]}),_0x53e536=_0x375f2f[_0x7f3887(0x22f)];return console['error'](_0x7f3887(0x24f)+_0x53e536[_0x7f3887(0x1eb)]['name']+_0x7f3887(0x229)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x261);[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x203);async['execute'](_0x3aa9c2){const _0x16baf0=a28_0x8121c3,{options:_0x22f106,args:_0x4275eb,tdx:_0x1c6ff0}=_0x3aa9c2,_0x174d81=_0x22f106,_0x2cb844=_0x4275eb[0x0],_0x3c129e=_0x2cb844&&isYamlFilePath(_0x2cb844),_0xb69cb8=await resolveTarget({'arg':_0x3c129e?_0x2cb844:undefined,'contextParent':_0x22f106['parentSegment'],'cwd':process[_0x16baf0(0x25c)]()});if(!isSuccessfulResolution(_0xb69cb8))return _0xb69cb8[_0x16baf0(0x24e)]===_0x16baf0(0x28b)?(console['error'](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x20f))),console[_0x16baf0(0x269)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x16baf0(0x269)](_0x16baf0(0x288)),console['error'](_0x16baf0(0x25e)),console[_0x16baf0(0x269)](_0x16baf0(0x210))):(console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1df)](_0x16baf0(0x26d)+_0xb69cb8[_0x16baf0(0x2ca)]+'\x0a')),_0xb69cb8['helpText']&&console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x28c)](_0xb69cb8[_0x16baf0(0x1cb)]))),0x1;let _0x102905=_0x3c129e?undefined:_0x2cb844,_0x42ab65,_0x4e88c4;_0xb69cb8[_0x16baf0(0x28a)]===_0x16baf0(0x2ba)&&(_0x102905=_0xb69cb8[_0x16baf0(0x1e1)],_0x42ab65=_0xb69cb8[_0x16baf0(0x252)],_0x4e88c4=_0xb69cb8[_0x16baf0(0x1dd)]);const _0x15c4ad=_0xb69cb8[_0x16baf0(0x2a3)],_0x5cad98=_0xb69cb8[_0x16baf0(0x2b0)];_0x174d81[_0x16baf0(0x200)]&&(console[_0x16baf0(0x269)]('Parent\x20segment:\x20'+_0x15c4ad),console['error'](_0x16baf0(0x28f)+_0x5cad98),_0x102905&&console[_0x16baf0(0x269)]('Journey\x20name:\x20'+_0x102905),_0x42ab65&&console['error']('Target\x20file:\x20'+_0x42ab65),_0x4e88c4&&console['error'](_0x16baf0(0x202)+_0x4e88c4));const _0x14a0d3=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x1c6ff0[_0x16baf0(0x2ac)][_0x16baf0(0x1fb)](_0x15c4ad),{'verbose':_0x22f106[_0x16baf0(0x200)]}),_0xd2addd=_0x14a0d3[_0x16baf0(0x22f)],{journeys:_0xe27630,folders:_0x48e964}=await withSpinner(_0x16baf0(0x2bd),async()=>{const _0x2c7608=_0x16baf0,[_0x3d62c5,_0x42f65f]=await Promise[_0x2c7608(0x2a4)]([_0x1c6ff0[_0x2c7608(0x29c)]['listJourneysFromParentSegment'](_0xd2addd,undefined,{'includeAllVersions':!![]}),_0x1c6ff0[_0x2c7608(0x2ac)]['listFolders'](_0xd2addd)]);return{'journeys':_0x3d62c5,'folders':_0x42f65f};},{'verbose':_0x22f106[_0x16baf0(0x200)]})[_0x16baf0(0x27a)](_0x491af3=>_0x491af3[_0x16baf0(0x22f)]);let _0x28a983=_0xe27630;const _0x5a6313=buildFolderIdToPathMap(_0x48e964);if(_0x102905){const _0x338960=_0x28a983[_0x16baf0(0x280)](_0x4b5012=>_0x4b5012[_0x16baf0(0x219)][_0x16baf0(0x2a9)]()===_0x102905[_0x16baf0(0x2a9)]());if(_0x338960['length']===0x0)return console[_0x16baf0(0x269)](_0x16baf0(0x29a)+_0x102905),console[_0x16baf0(0x269)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x28a983=_0x338960;}if(_0x4e88c4!==undefined){const _0x2d812a=_0x28a983[_0x16baf0(0x280)](_0x358145=>{const _0x2ed7b7=_0x16baf0,_0x4b6149=_0x358145[_0x2ed7b7(0x1f9)]?_0x5a6313[_0x2ed7b7(0x1fe)](_0x358145['folderId'])||'':'';return _0x4b6149===_0x4e88c4;});if(_0x2d812a[_0x16baf0(0x267)]===0x0&&_0x28a983[_0x16baf0(0x267)]>0x0){console[_0x16baf0(0x269)](_0x16baf0(0x23e)+_0x102905+_0x16baf0(0x2a1)+(_0x4e88c4||'root\x20folder')),console['error'](_0x16baf0(0x245));for(const _0x2fdf29 of _0x28a983){const _0x2ebe1b=_0x2fdf29[_0x16baf0(0x1f9)]?_0x5a6313[_0x16baf0(0x1fe)](_0x2fdf29['folderId'])||'':'';console['error'](_0x16baf0(0x21f)+(_0x2ebe1b||_0x16baf0(0x1d2))+'/'+_0x2fdf29[_0x16baf0(0x219)]);}return 0x1;}_0x28a983=_0x2d812a;}if(_0x28a983[_0x16baf0(0x267)]===0x0)return console[_0x16baf0(0x269)]('No\x20journeys\x20found'),0x0;const _0x2c2c15=new Map();for(const _0x409348 of _0x28a983){const _0x29c7a6=_0x409348[_0x16baf0(0x25a)];!_0x2c2c15[_0x16baf0(0x263)](_0x29c7a6)&&_0x2c2c15[_0x16baf0(0x296)](_0x29c7a6,[]),_0x2c2c15[_0x16baf0(0x1fe)](_0x29c7a6)[_0x16baf0(0x205)](_0x409348);}for(const _0x31f10a of _0x2c2c15[_0x16baf0(0x207)]()){_0x31f10a[_0x16baf0(0x21b)]((_0x3e7339,_0x304884)=>(_0x3e7339[_0x16baf0(0x1ec)]||0x0)-(_0x304884['versionNumber']||0x0));}const _0x4b89a9=[],{idToEmailMap:_0xedb31b,connectionIdToNameMap:_0x505950}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0xdc2be3=_0x16baf0,[_0x3f7368,_0x5477aa]=await Promise[_0xdc2be3(0x2a4)]([_0x1c6ff0[_0xdc2be3(0x1e5)][_0xdc2be3(0x22a)](),_0x1c6ff0[_0xdc2be3(0x255)][_0xdc2be3(0x21d)]()]);return{'idToEmailMap':_0x3f7368,'connectionIdToNameMap':_0x5477aa};},{'verbose':_0x22f106[_0x16baf0(0x200)]})[_0x16baf0(0x27a)](_0x3f5159=>_0x3f5159['data']);for(const _0x20ac2e of _0x2c2c15[_0x16baf0(0x207)]()){const _0x41b9ba=_0x20ac2e[0x0][_0x16baf0(0x219)],_0x53c17a=_0x20ac2e[0x0]['folderId'],_0x25524a=_0x53c17a?_0x5a6313[_0x16baf0(0x1fe)](_0x53c17a)||'':'',_0x260ce8=_0x25524a?a28_0x1221b1[_0x16baf0(0x2c2)](_0x5cad98,_0x25524a):_0x5cad98,_0x1a16f3=_0x42ab65||a28_0x1221b1[_0x16baf0(0x2c2)](_0x260ce8,sanitizeFileName(_0x41b9ba)+'.yml');let _0x42729c,_0x531252;if(existsSync(_0x1a16f3))try{const _0x39530b=readFileSync(_0x1a16f3,_0x16baf0(0x290)),_0x25d8a4=parseYamlString(_0x39530b);_0x531252=_0x25d8a4,_0x42729c=buildRuleToNameMapping(_0x25d8a4),_0x174d81['verbose']&&_0x42729c['size']>0x0&&console[_0x16baf0(0x269)]('Found\x20'+_0x42729c[_0x16baf0(0x227)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x41b9ba);}catch(_0x28feb1){_0x174d81[_0x16baf0(0x200)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x28feb1[_0x16baf0(0x2ca)]);}const _0x11e0ec=[],_0x5036b0=new Set(),_0x5d7089=new Map(),_0x2c0f2a=new Map(),_0x1f554a=new Set(),_0x4a91e6=new Map(),_0x1b484c=new Map(),_0x5be43f=createJumpTargetCache();await withProgressSpinner(_0x16baf0(0x2c3)+_0x41b9ba+'...',async _0x542e12=>{const _0x28f0c3=_0x16baf0;for(const _0x26dc6e of _0x20ac2e){const _0x42c7df=_0x20ac2e['length']>0x1?_0x26dc6e[_0x28f0c3(0x219)]+'\x20v'+(_0x26dc6e[_0x28f0c3(0x1ec)]||0x1):_0x26dc6e['journeyBundleName'];_0x542e12[_0x28f0c3(0x217)]('Fetching\x20'+_0x42c7df);const _0x50ff9a=await _0x1c6ff0[_0x28f0c3(0x29c)][_0x28f0c3(0x1d3)](_0x26dc6e['id']),_0x4f3f47=_0x50ff9a[_0x28f0c3(0x1eb)]?.[_0x28f0c3(0x2a0)],_0xce222a={'resolveSegment':async _0x19dfbd=>{const _0x44777a=_0x28f0c3;if(!_0x4f3f47)return{'name':_0x19dfbd,'isJourneyLocal':![]};const _0x4b932b=_0x5d7089['get'](_0x19dfbd);if(_0x4b932b)return _0x4b932b;try{const _0x38e7dc=await _0x1c6ff0['segment'][_0x44777a(0x272)](_0x4f3f47,_0x19dfbd),_0x4a9b55=_0x38e7dc['kind']===SEGMENT_KIND_JOURNEY;let _0x5606ab,_0x179655=_0x38e7dc[_0x44777a(0x29b)];if(_0x4a9b55&&_0x38e7dc['rule']){const _0x45ef98=await segmentResponseToDef(_0x38e7dc,{'resolveSegmentName':async _0x5643d0=>{const _0x5cf244=_0x44777a,_0xe3f62d=_0x5d7089[_0x5cf244(0x1fe)](_0x5643d0);if(_0xe3f62d)return _0xe3f62d[_0x5cf244(0x29b)];const _0x18be7b=await _0xce222a[_0x5cf244(0x23d)](_0x5643d0);return _0x18be7b[_0x5cf244(0x29b)];}}),_0x119b38=_0x45ef98['rule'];_0x5606ab={'description':_0x38e7dc['description'],'rule':_0x119b38};const _0x4c2e9=serializeRule(_0x119b38),_0x475dda=_0x2c0f2a['get'](_0x4c2e9);if(_0x475dda)_0x179655=_0x475dda,_0x5606ab=undefined,_0x174d81[_0x44777a(0x200)]&&console[_0x44777a(0x269)](_0x44777a(0x22e)+_0x38e7dc[_0x44777a(0x29b)]+_0x44777a(0x2ad)+_0x475dda);else{let _0x3f79b4=![];if(_0x42729c){const _0x1bef58=_0x42729c[_0x44777a(0x1fe)](_0x4c2e9);if(_0x1bef58){const _0x2422c3=_0x1bef58[_0x44777a(0x27e)](_0x5b5125=>!_0x5036b0[_0x44777a(0x263)](_0x5b5125));_0x2422c3&&(_0x179655=_0x2422c3,_0x5036b0[_0x44777a(0x1f8)](_0x2422c3),_0x2c0f2a[_0x44777a(0x296)](_0x4c2e9,_0x2422c3),_0x3f79b4=!![],_0x174d81[_0x44777a(0x200)]&&console[_0x44777a(0x269)](_0x44777a(0x24d)+_0x2422c3+'\x20(rule\x20match)'));}}if(!_0x3f79b4){const _0x309c87=generateJourneyLocalName(_0x38e7dc[_0x44777a(0x29b)]);_0x309c87&&(_0x179655=_0x309c87);let _0x1c7194=_0x179655,_0x4964e7=0x2;while(_0x5036b0[_0x44777a(0x263)](_0x1c7194)){_0x1c7194=_0x179655+'_'+_0x4964e7,_0x4964e7++;}_0x5036b0[_0x44777a(0x1f8)](_0x1c7194),_0x2c0f2a['set'](_0x4c2e9,_0x1c7194),_0x179655=_0x1c7194;}}}const _0x1da7e0={'name':_0x179655,'isJourneyLocal':_0x4a9b55,'definition':_0x5606ab};return _0x5d7089['set'](_0x19dfbd,_0x1da7e0),_0x1da7e0;}catch(_0x1985f9){return _0x22f106['verbose']&&console[_0x44777a(0x269)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x19dfbd+':\x20'+_0x1985f9[_0x44777a(0x2ca)]),{'name':_0x19dfbd,'isJourneyLocal':![]};}},'resolveActivation':async _0x1dd663=>{const _0x10941d=_0x28f0c3,_0x5996fb=_0x4a91e6[_0x10941d(0x1fe)](_0x1dd663);if(_0x5996fb)return _0x5996fb;try{const _0x31a54d=await _0x1c6ff0['journey']['getActivation'](_0x26dc6e['id'],_0x1dd663),_0x322cda=journeyActivationStepToYaml(_0x31a54d,_0xedb31b,_0x505950),_0x45c858=JSON['stringify']({'name':_0x322cda[_0x10941d(0x29b)],'connection':_0x322cda[_0x10941d(0x255)],'connector_config':_0x322cda[_0x10941d(0x264)]}),_0x59c80f=_0x1b484c['get'](_0x45c858);if(_0x59c80f){const _0x33bf96={'name':_0x59c80f,'isJourneyLocal':!![],'definition':_0x322cda};return _0x4a91e6[_0x10941d(0x296)](_0x1dd663,_0x33bf96),_0x33bf96;}const _0x2243be=_0x31a54d[_0x10941d(0x1eb)]['activationParams'][_0x10941d(0x29b)]||_0x1dd663,_0x5ec699=sanitizeYamlKey(_0x2243be)||_0x10941d(0x1e8)+_0x1dd663;let _0x53761c=_0x5ec699,_0x1da8fa=0x2;while(_0x1f554a[_0x10941d(0x263)](_0x53761c)){_0x53761c=_0x5ec699+'_'+_0x1da8fa,_0x1da8fa++;}_0x1f554a[_0x10941d(0x1f8)](_0x53761c),_0x1b484c[_0x10941d(0x296)](_0x45c858,_0x53761c);const _0x216877={'name':_0x53761c,'isJourneyLocal':!![],'definition':_0x322cda};return _0x4a91e6[_0x10941d(0x296)](_0x1dd663,_0x216877),_0x216877;}catch(_0x1d54db){return _0x22f106['verbose']&&console[_0x10941d(0x269)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x1dd663+':\x20'+_0x1d54db[_0x10941d(0x2ca)]),{'name':_0x1dd663,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5c9482,_0x2ac975)=>{const _0x58f23a=_0x28f0c3;return resolveJumpTarget(_0x5c9482,_0x2ac975,_0x5be43f,_0x5d6b6d=>_0x1c6ff0[_0x58f23a(0x29c)][_0x58f23a(0x1d3)](_0x5d6b6d));}},_0x429618=await journeyResponseToDef(_0x50ff9a,_0xce222a);_0x11e0ec[_0x28f0c3(0x205)]({'item':_0x26dc6e,'yaml':_0x429618});}},{'verbose':_0x22f106['verbose']});const _0x5f34e0=await _0x1c6ff0[_0x16baf0(0x29c)][_0x16baf0(0x1f3)](_0x20ac2e[0x0]['journeyBundleId']),_0x71bcf1=buildMergedJourneyDef(_0x11e0ec,_0x42729c,_0x5f34e0),_0x162efb=normalizeJourneyDef(_0x71bcf1,_0x531252),_0x5c4fe2=toYamlString(_0x162efb),_0x3a796d=_0x42ab65||a28_0x1221b1[_0x16baf0(0x2c2)](_0x260ce8,sanitizeFileName(_0x41b9ba)+'.yml');!_0x42ab65&&_0x25524a&&!existsSync(_0x260ce8)&&mkdirSync(_0x260ce8,{'recursive':!![]});const _0x4f7883=a28_0x1221b1['relative'](process[_0x16baf0(0x25c)](),_0x3a796d);if(existsSync(_0x3a796d)){const _0x2655fe=readFileSync(_0x3a796d,_0x16baf0(0x290)),_0x219c30=generateDiff(_0x2655fe,_0x5c4fe2),_0x2b3631=hasChanges(_0x219c30);_0x4b89a9['push']({'relativePath':_0x4f7883,'absolutePath':_0x3a796d,'content':_0x5c4fe2,'isNew':![],'hasChanges':_0x2b3631,'diff':_0x2b3631?formatDiffWithColors(_0x219c30):undefined});}else _0x4b89a9[_0x16baf0(0x205)]({'relativePath':_0x4f7883,'absolutePath':_0x3a796d,'content':_0x5c4fe2,'isNew':!![],'hasChanges':![]});}const _0xb57cf9=_0x4b89a9[_0x16baf0(0x280)](_0x147301=>_0x147301['isNew']),_0x5d4e70=_0x4b89a9[_0x16baf0(0x280)](_0x1fd168=>!_0x1fd168[_0x16baf0(0x1f1)]&&_0x1fd168['hasChanges']),_0x518b5f=_0x4b89a9[_0x16baf0(0x280)](_0x4b42cf=>!_0x4b42cf[_0x16baf0(0x1f1)]&&!_0x4b42cf[_0x16baf0(0x204)]),_0x578ffd=_0x28a983[_0x16baf0(0x267)],_0x3133b1=_0x2c2c15[_0x16baf0(0x227)],_0x1b2478=_0x578ffd>_0x3133b1?'\x20('+_0x578ffd+_0x16baf0(0x287):'';console[_0x16baf0(0x269)](_0x16baf0(0x285)),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34['cyan'](_0x3133b1+'\x20journeys')+a28_0x302f34[_0x16baf0(0x26e)](_0x1b2478)),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x1db)]('+\x20'+_0xb57cf9['length']+_0x16baf0(0x2c8))),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x236)]('~\x20'+_0x5d4e70[_0x16baf0(0x267)]+'\x20changed\x20files')),console[_0x16baf0(0x269)]('\x20\x20'+a28_0x302f34[_0x16baf0(0x26e)]('=\x20'+_0x518b5f[_0x16baf0(0x267)]+_0x16baf0(0x2c5))),console[_0x16baf0(0x269)]('\x20\x20Target:\x20'+a28_0x302f34[_0x16baf0(0x28c)](_0x5cad98)+'\x0a');if(_0x5d4e70[_0x16baf0(0x267)]>0x0)for(const _0x27579a of _0x5d4e70){console['error'](_0x16baf0(0x1d6)+_0x27579a[_0x16baf0(0x25f)]+'\x27:'),console[_0x16baf0(0x269)]('─'[_0x16baf0(0x1f2)](0x3c)),console[_0x16baf0(0x269)](_0x27579a['diff']),console[_0x16baf0(0x269)]('─'[_0x16baf0(0x1f2)](0x3c));}if(_0x174d81[_0x16baf0(0x292)])return console['error'](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x253))),0x0;if(_0xb57cf9['length']===0x0&&_0x5d4e70['length']===0x0)return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x216))),saveSessionContext({'parent_segment':_0x15c4ad},_0x174d81['session']),console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x20d)+a28_0x302f34[_0x16baf0(0x26e)](_0x16baf0(0x25d))+_0x16baf0(0x275)+a28_0x302f34[_0x16baf0(0x28c)](_0x15c4ad))),0x0;if(!_0x174d81[_0x16baf0(0x1e6)]&&(_0xb57cf9['length']>0x0||_0x5d4e70[_0x16baf0(0x267)]>0x0)){if(!isInteractive())return console['error'](a28_0x302f34[_0x16baf0(0x1df)](_0x16baf0(0x2b6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a28_0x302f34[_0x16baf0(0x26e)](_0x16baf0(0x211))),0x1;const _0x430957=await confirmKey(_0x16baf0(0x1ed)+(_0xb57cf9[_0x16baf0(0x267)]+_0x5d4e70[_0x16baf0(0x267)])+_0x16baf0(0x27b));if(!_0x430957)return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x236)](_0x16baf0(0x20c)),_0x16baf0(0x1d8)),0x1;}!existsSync(_0x5cad98)&&mkdirSync(_0x5cad98,{'recursive':!![]});const _0x10135d=a28_0x1221b1[_0x16baf0(0x2c2)](_0x5cad98,_0x16baf0(0x1d7));writeFileSync(_0x10135d,createTdxConfigContent(_0x15c4ad),_0x16baf0(0x290));for(const _0x24d906 of _0x4b89a9){(_0x24d906[_0x16baf0(0x1f1)]||_0x24d906[_0x16baf0(0x204)])&&writeFileSync(_0x24d906['absolutePath'],_0x24d906[_0x16baf0(0x2c4)],'utf-8');}return console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)](_0x16baf0(0x228)+(_0xb57cf9[_0x16baf0(0x267)]+_0x5d4e70[_0x16baf0(0x267)])+'\x20journey\x20files\x20to\x20'+_0x5cad98)),saveSessionContext({'parent_segment':_0x15c4ad},_0x174d81['session']),console[_0x16baf0(0x269)](a28_0x302f34[_0x16baf0(0x1db)]('✔\x20Context\x20set:\x20'+a28_0x302f34['dim'](_0x16baf0(0x25d))+_0x16baf0(0x275)+a28_0x302f34[_0x16baf0(0x28c)](_0x15c4ad))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]='journey:columns';['description']=a28_0x8121c3(0x208);async['execute'](_0x3a4598){const _0x2ea626=a28_0x8121c3,{options:_0x105fce,args:_0x8cd976,tdx:_0x17a7d5}=_0x3a4598,_0x18fbbc=_0x8cd976[0x0];if(!requireNameOrPath(_0x18fbbc))return 0x1;_0x105fce[_0x2ea626(0x200)]&&console['error'](_0x2ea626(0x29f)+_0x18fbbc);const {journeyId:_0x5b5ed0}=await resolveJourneyIdFromInput(_0x18fbbc,_0x105fce,_0x17a7d5),_0x2caf00=await withSpinner(_0x2ea626(0x214),()=>_0x17a7d5[_0x2ea626(0x29c)][_0x2ea626(0x234)](_0x5b5ed0),{'verbose':_0x105fce['verbose']}),_0xe1741d=_0x2caf00['data'];return console[_0x2ea626(0x284)](_0x2ea626(0x2b8)+_0xe1741d['database']),console[_0x2ea626(0x284)]('Table:\x20'+_0xe1741d[_0x2ea626(0x23f)]),await handleSDKOutput(_0xe1741d['columns'],_0x105fce),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x1f5);['description']='List\x20activations\x20for\x20a\x20journey';async['execute'](_0xc0b104){const _0xef6335=a28_0x8121c3,{options:_0x70b25a,args:_0x177bcd,tdx:_0x31e188}=_0xc0b104,_0x4c3455=_0x177bcd[0x0];if(!requireNameOrPath(_0x4c3455))return 0x1;_0x70b25a[_0xef6335(0x200)]&&console[_0xef6335(0x269)](_0xef6335(0x29f)+_0x4c3455);const {journeyId:_0x251ce2}=await resolveJourneyIdFromInput(_0x4c3455,_0x70b25a,_0x31e188),_0x5147fc=await withSpinner('Listing\x20journey\x20activations...',()=>_0x31e188[_0xef6335(0x29c)][_0xef6335(0x221)](_0x251ce2),{'verbose':_0x70b25a[_0xef6335(0x200)]}),_0x49b36d=_0x5147fc[_0xef6335(0x22f)];return console[_0xef6335(0x269)]('Found\x20'+_0x49b36d[_0xef6335(0x267)]+'\x20activation'+(_0x49b36d[_0xef6335(0x267)]!==0x1?'s':'')),await handleSDKOutput(_0x49b36d,_0x70b25a),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x295);['description']=a28_0x8121c3(0x21c);[a28_0x8121c3(0x1ce)]=new SegmentPushCommand();async[a28_0x8121c3(0x218)](_0x184fed){const _0x5970bb=a28_0x8121c3,_0x55ebee=_0x184fed[_0x5970bb(0x1e4)][0x0];let _0x16ddc6;if(_0x55ebee){const _0x4e2afb=await resolveTarget({'arg':_0x55ebee,'contextParent':_0x184fed[_0x5970bb(0x240)][_0x5970bb(0x233)],'cwd':process[_0x5970bb(0x25c)]()});isSuccessfulResolution(_0x4e2afb)&&_0x4e2afb['type']===_0x5970bb(0x2ba)&&(_0x16ddc6=_0x4e2afb[_0x5970bb(0x252)]);}const _0x5bc085={..._0x184fed,'options':{..._0x184fed[_0x5970bb(0x240)],'journeysOnly':!![],..._0x16ddc6&&{'singleFilePath':_0x16ddc6}}};return this['segmentPushCommand']['execute'](_0x5bc085);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x22d);[a28_0x8121c3(0x27d)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a28_0x8121c3(0x218)](_0x49f404){const _0x311013=a28_0x8121c3,{options:_0x2ce19d,args:_0x1cfd6e,tdx:_0x46f95c}=_0x49f404,_0xa4c23e=_0x1cfd6e[0x0];if(!requireNameOrPath(_0xa4c23e))return 0x1;if(_0x2ce19d['verbose'])console[_0x311013(0x269)](_0x311013(0x29f)+_0xa4c23e);const {journeyId:_0x5ded7c}=await resolveJourneyIdFromInput(_0xa4c23e,_0x2ce19d,_0x46f95c),_0x298bfe=await withSpinner(_0x311013(0x237),()=>_0x46f95c[_0x311013(0x29c)][_0x311013(0x21e)](_0x5ded7c),{'verbose':_0x2ce19d[_0x311013(0x200)]}),{bundleName:_0x1c8330,versions:_0x1a3852,latestJourneyId:_0x39fed4}=_0x298bfe[_0x311013(0x22f)];console['error'](_0x1c8330+':\x20'+_0x1a3852[_0x311013(0x267)]+_0x311013(0x1e9)+(_0x1a3852[_0x311013(0x267)]!==0x1?'s':''));const _0x3acdc0=_0x1a3852[_0x311013(0x20a)](_0x1434d3=>({'version':_0x1434d3[_0x311013(0x1ec)],'journey_id':_0x1434d3[_0x311013(0x2aa)],'name':_0x1434d3[_0x311013(0x29b)],'state':_0x1434d3[_0x311013(0x2bb)],'paused':_0x1434d3[_0x311013(0x1f6)],'latest':_0x1434d3[_0x311013(0x2aa)]===_0x39fed4,'created_at':_0x1434d3[_0x311013(0x258)]}));return await handleSDKOutput(_0x3acdc0,_0x2ce19d),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x8121c3(0x29b)]=a28_0x8121c3(0x23c);[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x242);async[a28_0x8121c3(0x218)](_0x1afee5){const _0x4d927b=a28_0x8121c3,{options:_0x3afe97,args:_0x40abc0,tdx:_0x26cb13}=_0x1afee5,_0x110008=_0x40abc0[0x0];if(!requireNameOrPath(_0x110008))return 0x1;if(_0x3afe97[_0x4d927b(0x200)])console[_0x4d927b(0x269)](_0x4d927b(0x29f)+_0x110008);const {journeyId:_0x193cf4,journeyName:_0x13405b}=await resolveJourneyIdFromInput(_0x110008,_0x3afe97,_0x26cb13);if(!_0x3afe97[_0x4d927b(0x1e6)]){const _0x392019=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x13405b+'\x22?');if(!_0x392019)return console['error'](_0x4d927b(0x2a2)),0x0;}const _0x507381=await withSpinner('Creating\x20new\x20version...',()=>_0x26cb13['journey'][_0x4d927b(0x1ff)](_0x193cf4),{'verbose':_0x3afe97[_0x4d927b(0x200)]}),_0x1787d7=_0x507381[_0x4d927b(0x22f)];return console[_0x4d927b(0x269)](a28_0x302f34[_0x4d927b(0x1db)]('✔')+'\x20Created\x20v'+_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x1ec)]+'\x20(draft)\x20—\x20\x22'+_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x29b)]+'\x22'),console['error'](_0x4d927b(0x1e0)+_0x1787d7['id']),await handleSingleObjectOutput({'id':_0x1787d7['id'],'name':_0x1787d7[_0x4d927b(0x1eb)]['name'],'version':_0x1787d7[_0x4d927b(0x1eb)]['versionNumber'],'state':_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x2bb)],'bundle_id':_0x1787d7[_0x4d927b(0x1eb)]['journeyBundleId'],'created_at':_0x1787d7[_0x4d927b(0x1eb)][_0x4d927b(0x258)]},_0x3afe97),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']='journey:version:view';[a28_0x8121c3(0x27d)]=a28_0x8121c3(0x282);async['execute'](_0x261c93){const _0x485edb=a28_0x8121c3,{options:_0x167bcb,args:_0x4649a5,tdx:_0x19001b}=_0x261c93,_0x587b0c=_0x4649a5[0x0];if(!requireNameOrPath(_0x587b0c))return 0x1;const _0x594ff4=_0x167bcb[_0x485edb(0x262)];if(!_0x594ff4)return console[_0x485edb(0x269)](_0x485edb(0x21a)),console['error'](_0x485edb(0x232)),0x1;const _0x57b134=parseInt(_0x594ff4,0xa);if(isNaN(_0x57b134)||_0x57b134<0x1)return console[_0x485edb(0x269)](_0x485edb(0x220)+_0x594ff4),0x1;if(_0x167bcb['verbose'])console[_0x485edb(0x269)](_0x485edb(0x29f)+_0x587b0c+_0x485edb(0x2c0)+_0x57b134);const {journeyId:_0x5d9ef8,parentSegmentId:_0x30d4e8}=await resolveJourneyIdFromInput(_0x587b0c,_0x167bcb,_0x19001b),_0x58d412=await withSpinner(_0x485edb(0x25b),()=>_0x19001b['journey']['listVersions'](_0x5d9ef8),{'verbose':_0x167bcb[_0x485edb(0x200)]}),{versions:_0x3372b8,latestJourneyId:_0xd51f57}=_0x58d412[_0x485edb(0x22f)],_0x10ea4a=_0x3372b8['find'](_0x36b257=>_0x36b257['versionNumber']===_0x57b134);if(!_0x10ea4a){const _0x5b50ba=_0x3372b8['map'](_0x25733e=>'v'+_0x25733e[_0x485edb(0x1ec)])[_0x485edb(0x2c2)](',\x20');return console[_0x485edb(0x269)](_0x485edb(0x223)+_0x57b134+_0x485edb(0x2ab)+_0x5b50ba),0x1;}const _0x4e754c=await withSpinner('Getting\x20version\x20'+_0x57b134+'\x20details...',()=>_0x19001b['journey'][_0x485edb(0x1d3)](_0x10ea4a[_0x485edb(0x2aa)]),{'verbose':_0x167bcb[_0x485edb(0x200)]}),_0x1778c4=_0x4e754c[_0x485edb(0x22f)],_0x1d09bf=getConsoleNextUrl(_0x167bcb[_0x485edb(0x2a5)],'/app/ps/'+_0x30d4e8+_0x485edb(0x1e7)+_0x10ea4a['journeyId']+'/j/da/je');return await handleSingleObjectOutput({'id':_0x1778c4['id'],'name':_0x1778c4['attributes'][_0x485edb(0x29b)],'version':_0x1778c4['attributes'][_0x485edb(0x1ec)],'description':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x27d)],'state':_0x1778c4['attributes'][_0x485edb(0x2bb)],'paused':_0x1778c4['attributes'][_0x485edb(0x1f6)],'reentry_mode':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x226)],'stages':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x278)]?.['length']||0x0,..._0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x249)]&&{'goal':_0x1778c4['attributes'][_0x485edb(0x249)]['name']},'latest':_0x10ea4a[_0x485edb(0x2aa)]===_0xd51f57,'created_at':_0x1778c4['attributes']['createdAt'],'updated_at':_0x1778c4[_0x485edb(0x1eb)][_0x485edb(0x2a8)],'url':_0x1d09bf},_0x167bcb),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x42974e=a29_0x18b6;(function(_0x12725e,_0x4a5397){const _0x498d09=a29_0x18b6,_0x549d91=_0x12725e();while(!![]){try{const _0x55d281=-parseInt(_0x498d09(0x11b))/0x1+-parseInt(_0x498d09(0x131))/0x2+parseInt(_0x498d09(0x12a))/0x3+-parseInt(_0x498d09(0x105))/0x4*(-parseInt(_0x498d09(0x125))/0x5)+-parseInt(_0x498d09(0x117))/0x6*(parseInt(_0x498d09(0x116))/0x7)+parseInt(_0x498d09(0x12f))/0x8*(parseInt(_0x498d09(0x130))/0x9)+parseInt(_0x498d09(0x11f))/0xa*(-parseInt(_0x498d09(0x121))/0xb);if(_0x55d281===_0x4a5397)break;else _0x549d91['push'](_0x549d91['shift']());}catch(_0x5aeeb1){_0x549d91['push'](_0x549d91['shift']());}}}(a29_0x3195,0x6a6da));function a29_0x3195(){const _0x1d2fa1=['reason','Error:\x20Directory\x20not\x20found:\x20','warnings','160648BBGSTz','message','hasErrors','Error:\x20','\x20segment\x20file(s)\x20skipped)','file','filePath','\x20segment\x20file(s)\x20skipped','\x20valid','helpText','\x20warning(s)','cwd','invalidCount','red','execute','yellow','relativePath','4298xODEzy','1074FqHEAE','warningCount','length','\x20journey(s)\x20valid','76048VZJBoV','description','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','journey:validate','67030djOqSX','Validation\x20failed:\x20','1122pAqVqF','journey','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filter','10DtcMJQ','\x20journey(s)\x20with\x20errors,\x20','targetDir','endsWith','skippedCount','2490546OUNRMO','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','error','no_parent','log','272jiXPLL','139257wqqRfO','261996HLhQgf','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found','green','\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','\x20(skipped:\x20','.yml','type','dim','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parentSegment','name','cyan','✔\x20All\x20'];a29_0x3195=function(){return _0x1d2fa1;};return a29_0x3195();}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0xca69d from'chalk';function a29_0x18b6(_0x5e1be1,_0xf77827){_0x5e1be1=_0x5e1be1-0xfc;const _0x31950f=a29_0x3195();let _0x18b634=_0x31950f[_0x5e1be1];return _0x18b634;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a29_0x42974e(0xff)]=a29_0x42974e(0x11e);[a29_0x42974e(0x11c)]='Validate\x20journey\x20YAML\x20files';async[a29_0x42974e(0x113)](_0x3ac383){const _0x8bb23a=a29_0x42974e,{options:_0x105cd1,args:_0x22e03b}=_0x3ac383,_0x682c09=_0x105cd1,_0x2ffc0c=await resolveTarget({'arg':_0x22e03b[0x0],'contextParent':_0x105cd1[_0x8bb23a(0xfe)],'cwd':process[_0x8bb23a(0x110)]()});if(!isSuccessfulResolution(_0x2ffc0c))return _0x2ffc0c['errorCode']===_0x8bb23a(0x12d)?(console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x114)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x8bb23a(0x11d)),console['error'](_0x8bb23a(0x135)),console[_0x8bb23a(0x12c)](_0x8bb23a(0x123))):(console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0x108)+_0x2ffc0c[_0x8bb23a(0x106)]+'\x0a')),_0x2ffc0c['helpText']&&console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x100)](_0x2ffc0c[_0x8bb23a(0x10e)]))),0x1;const _0x524d72=_0x2ffc0c[_0x8bb23a(0x127)],_0x5e25aa=_0x2ffc0c[_0x8bb23a(0x138)]===_0x8bb23a(0x10a)?_0x2ffc0c[_0x8bb23a(0x10b)]:undefined;if(!_0x5e25aa&&!existsSync(_0x524d72))return console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0x103)+_0x524d72+'\x0a')),0x1;let _0x80880f;if(_0x5e25aa){if(!_0x5e25aa['endsWith'](_0x8bb23a(0x137))&&!_0x5e25aa[_0x8bb23a(0x128)]('.yaml'))return console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0x12b)+_0x5e25aa+'\x0a')),0x1;_0x80880f=[_0x5e25aa];}else _0x80880f=findYamlFiles(_0x524d72);if(_0x80880f['length']===0x0)return console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0xfd)+_0x524d72+'\x0a')),0x1;const _0x2cf25b=validateYamlFiles(_0x80880f,_0x524d72,{'filterType':_0x8bb23a(0x122)}),_0x5a08d0=calculateSummary(_0x2cf25b),_0x393274=_0x2cf25b[_0x8bb23a(0x124)](isValidationResult);if(_0x393274[_0x8bb23a(0x119)]===0x0)return console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0x114)](_0x8bb23a(0x132)+_0x524d72+'\x0a')),_0x5a08d0['skippedCount']>0x0&&console[_0x8bb23a(0x12c)](a29_0xca69d[_0x8bb23a(0xfc)]('('+_0x5a08d0['skippedCount']+_0x8bb23a(0x109))),0x0;for(const _0x25fbf5 of _0x2cf25b){if(!isValidationResult(_0x25fbf5)){_0x682c09['verbose']&&console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0xfc)]('-\x20'+_0x25fbf5[_0x8bb23a(0x115)]+_0x8bb23a(0x136)+_0x25fbf5[_0x8bb23a(0x102)]+')'));continue;}const {relativePath:_0x3544ef,source:_0x2caf70,result:_0x5c7f02}=_0x25fbf5;if(_0x5c7f02['valid']&&_0x5c7f02[_0x8bb23a(0x104)]['length']===0x0)_0x682c09['verbose']&&console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0x134)]('✔\x20'+_0x3544ef));else _0x5c7f02['valid']?(console[_0x8bb23a(0x12e)](a29_0xca69d['yellow']('⚠\x20'+_0x3544ef+':\x20'+_0x5c7f02[_0x8bb23a(0x104)][_0x8bb23a(0x119)]+_0x8bb23a(0x10f))),console[_0x8bb23a(0x12e)](formatValidationResult(_0x5c7f02,_0x2caf70,_0x3544ef))):(console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0x112)]('✖\x20'+_0x3544ef+':\x20'+_0x5c7f02['errors'][_0x8bb23a(0x119)]+'\x20error(s)')),console['log'](formatValidationResult(_0x5c7f02,_0x2caf70,_0x3544ef)));}return console[_0x8bb23a(0x12e)](''),_0x5a08d0[_0x8bb23a(0x107)]?(console['log'](a29_0xca69d[_0x8bb23a(0x112)](_0x8bb23a(0x120)+_0x5a08d0[_0x8bb23a(0x111)]+_0x8bb23a(0x126)+_0x5a08d0['validCount']+_0x8bb23a(0x10d))),_0x5a08d0['warningCount']>0x0&&console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0x114)](_0x5a08d0[_0x8bb23a(0x118)]+_0x8bb23a(0x133))),_0x5a08d0[_0x8bb23a(0x129)]>0x0&&console['log'](a29_0xca69d[_0x8bb23a(0xfc)](_0x5a08d0[_0x8bb23a(0x129)]+_0x8bb23a(0x10c))),0x1):(console[_0x8bb23a(0x12e)](a29_0xca69d['green'](_0x8bb23a(0x101)+_0x5a08d0['validCount']+_0x8bb23a(0x11a))),_0x5a08d0[_0x8bb23a(0x118)]>0x0&&console[_0x8bb23a(0x12e)](a29_0xca69d['yellow'](_0x5a08d0[_0x8bb23a(0x118)]+_0x8bb23a(0x133))),_0x5a08d0[_0x8bb23a(0x129)]>0x0&&console[_0x8bb23a(0x12e)](a29_0xca69d[_0x8bb23a(0xfc)](_0x5a08d0[_0x8bb23a(0x129)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}
|